From: Andrea Amorese Date: Tue, 25 Jan 2022 17:13:15 +0000 (+0100) Subject: Built motion from commit fbacb665.|2.5.44 X-Git-Url: http://repos.xcallymotion.com/base//%22./banner.jpg/%22?a=commitdiff_plain;h=cc596f18dbbad1384faab875d874e9abb784dc73;p=motion2.git Built motion from commit fbacb665.|2.5.44 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f8d3b6b..ff871fe 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-25T16:50:09.020Z", + "time": "2022-01-25T17:04:40.920Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 940ae97..359b0b3 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-25T16:50:09.020Z", + "time": "2022-01-25T17:04:40.920Z", "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 db5febb..e5fcc8e 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 _0x98ba=['urlForward[body]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x98ba,0x141));var _0xa98b=function(_0x30ebc5,_0x1d6f6a){_0x30ebc5=_0x30ebc5-0x0;var _0xfbe79a=_0x98ba[_0x30ebc5];return _0xfbe79a;};'use strict';var Sequelize=require(_0xa98b('0x0'));module[_0xa98b('0x1')]={'name':{'type':Sequelize[_0xa98b('0x2')],'get':function(_0x11aa08){return this['getDataValue'](_0xa98b('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xa98b('0x4'),_0xa98b('0x5'),_0xa98b('0x6'),_0xa98b('0x7'),_0xa98b('0x8'),'browser',_0xa98b('0x9'),_0xa98b('0xa')]],'msg':_0xa98b('0xb')}},'comment':_0xa98b('0xb')},'data1':{'type':Sequelize[_0xa98b('0xc')](0x1000),'comment':_0xa98b('0xd')},'data2':{'type':Sequelize[_0xa98b('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xa98b('0xc')](0x1000),'comment':_0xa98b('0xe')},'data4':{'type':Sequelize[_0xa98b('0xc')](0x1000),'comments':_0xa98b('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa98b('0x10')},'data6':{'type':Sequelize[_0xa98b('0xc')],'comments':_0xa98b('0x11')},'data7':{'type':Sequelize[_0xa98b('0x12')],'comments':_0xa98b('0x13')}}; \ No newline at end of file +var _0x8b2d=['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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x4b92c3,_0x23be84){var _0x57d180=function(_0x17f35e){while(--_0x17f35e){_0x4b92c3['push'](_0x4b92c3['shift']());}};_0x57d180(++_0x23be84);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x336d19,_0x3767d0){_0x336d19=_0x336d19-0x0;var _0x419656=_0x8b2d[_0x336d19];return _0x419656;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd8b2('0x0')],'get':function(_0x4a6f41){return this[_0xd8b2('0x1')](_0xd8b2('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd8b2('0x3'),_0xd8b2('0x4'),'motionbar',_0xd8b2('0x5'),_0xd8b2('0x6'),_0xd8b2('0x7'),_0xd8b2('0x8'),_0xd8b2('0x9')]],'msg':_0xd8b2('0xa')}},'comment':_0xd8b2('0xa')},'data1':{'type':Sequelize[_0xd8b2('0xb')](0x1000),'comment':_0xd8b2('0xc')},'data2':{'type':Sequelize[_0xd8b2('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xd8b2('0xb')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xd8b2('0xb')](0x1000),'comments':_0xd8b2('0xd')},'data5':{'type':Sequelize[_0xd8b2('0xb')](0x1000),'comments':_0xd8b2('0xe')},'data6':{'type':Sequelize[_0xd8b2('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'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 2aaf26d..4726a70 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 _0xc7ac=['crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','end','error','stack','name','send','update','body','find','params','destroy','Action','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xc7ac,0xa7));var _0xcc7a=function(_0x44e9d8,_0x13c3cd){_0x44e9d8=_0x44e9d8-0x0;var _0x32a396=_0xc7ac[_0x44e9d8];return _0x32a396;};'use strict';var emlformat=require(_0xcc7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc7a('0x1'));var jsonpatch=require(_0xcc7a('0x2'));var rp=require('request-promise');var moment=require(_0xcc7a('0x3'));var BPromise=require(_0xcc7a('0x4'));var Mustache=require(_0xcc7a('0x5'));var util=require(_0xcc7a('0x6'));var path=require(_0xcc7a('0x7'));var sox=require(_0xcc7a('0x8'));var csv=require(_0xcc7a('0x9'));var ejs=require(_0xcc7a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc7a('0xb'));var squel=require(_0xcc7a('0xc'));var crypto=require(_0xcc7a('0xd'));var jsforce=require(_0xcc7a('0xe'));var deskjs=require(_0xcc7a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc7a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc7a('0x12'));var logger=require(_0xcc7a('0x13'))(_0xcc7a('0x14'));var utils=require('../../config/utils');var config=require(_0xcc7a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30c314,_0x270277){_0x270277=_0x270277||0xcc;return function(_0x419ddb){if(_0x419ddb){return _0x30c314[_0xcc7a('0x16')](_0x270277);}return _0x30c314[_0xcc7a('0x17')](_0x270277)['end']();};}function respondWithResult(_0x5f9ee2,_0x417f18){_0x417f18=_0x417f18||0xc8;return function(_0xc7e275){if(_0xc7e275){return _0x5f9ee2[_0xcc7a('0x17')](_0x417f18)[_0xcc7a('0x18')](_0xc7e275);}};}function respondWithFilteredResult(_0x17e63d,_0x145710){return function(_0x6fab84){if(_0x6fab84){var _0x480e4f=typeof _0x145710[_0xcc7a('0x19')]===_0xcc7a('0x1a')&&typeof _0x145710[_0xcc7a('0x1b')]===_0xcc7a('0x1a');var _0x1d09ca=_0x6fab84[_0xcc7a('0x1c')];var _0x19eff8=_0x480e4f?0x0:_0x145710['offset'];var _0x41b956=_0x480e4f?_0x6fab84[_0xcc7a('0x1c')]:_0x145710[_0xcc7a('0x19')]+_0x145710['limit'];var _0x5d5573;if(_0x41b956>=_0x1d09ca){_0x41b956=_0x1d09ca;_0x5d5573=0xc8;}else{_0x5d5573=0xce;}_0x17e63d[_0xcc7a('0x17')](_0x5d5573);return _0x17e63d['set'](_0xcc7a('0x1d'),_0x19eff8+'-'+_0x41b956+'/'+_0x1d09ca)['json'](_0x6fab84);}return null;};}function patchUpdates(_0x549c69){return function(_0x22110a){try{jsonpatch['apply'](_0x22110a,_0x549c69,!![]);}catch(_0x418901){return BPromise[_0xcc7a('0x1e')](_0x418901);}return _0x22110a[_0xcc7a('0x1f')]();};}function saveUpdates(_0x280652,_0x58aec3){return function(_0x17fb49){if(_0x17fb49){return _0x17fb49['update'](_0x280652)['then'](function(_0x5e3ac2){return _0x5e3ac2;});}return null;};}function removeEntity(_0x38cb60,_0x9e7e2b){return function(_0x4be289){if(_0x4be289){return _0x4be289['destroy']()[_0xcc7a('0x20')](function(){_0x38cb60[_0xcc7a('0x17')](0xcc)[_0xcc7a('0x21')]();});}};}function handleEntityNotFound(_0x470438,_0x43c148){return function(_0xe4fa73){if(!_0xe4fa73){_0x470438[_0xcc7a('0x16')](0x194);}return _0xe4fa73;};}function handleError(_0x2b0c9f,_0x3c25bd){_0x3c25bd=_0x3c25bd||0x1f4;return function(_0x30270a){logger[_0xcc7a('0x22')](_0x30270a[_0xcc7a('0x23')]);if(_0x30270a['name']){delete _0x30270a[_0xcc7a('0x24')];}_0x2b0c9f[_0xcc7a('0x17')](_0x3c25bd)[_0xcc7a('0x25')](_0x30270a);};}exports[_0xcc7a('0x26')]=function(_0x4ea4ad,_0x2b1ca1){if(_0x4ea4ad[_0xcc7a('0x27')]['id']){delete _0x4ea4ad[_0xcc7a('0x27')]['id'];}return db['Action'][_0xcc7a('0x28')]({'where':{'id':_0x4ea4ad[_0xcc7a('0x29')]['id']}})[_0xcc7a('0x20')](handleEntityNotFound(_0x2b1ca1,null))[_0xcc7a('0x20')](saveUpdates(_0x4ea4ad['body'],null))[_0xcc7a('0x20')](respondWithResult(_0x2b1ca1,null))['catch'](handleError(_0x2b1ca1,null));};exports[_0xcc7a('0x2a')]=function(_0x1ab9ba,_0x1b2ad4){return db[_0xcc7a('0x2b')][_0xcc7a('0x28')]({'where':{'id':_0x1ab9ba[_0xcc7a('0x29')]['id']}})[_0xcc7a('0x20')](handleEntityNotFound(_0x1b2ad4,null))[_0xcc7a('0x20')](removeEntity(_0x1b2ad4,null))[_0xcc7a('0x2c')](handleError(_0x1b2ad4,null));}; \ No newline at end of file +var _0x865b=['json','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','body','Action','find','params','catch','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0xcce66d,_0x5379a0){var _0x2e56c2=function(_0x4f9892){while(--_0x4f9892){_0xcce66d['push'](_0xcce66d['shift']());}};_0x2e56c2(++_0x5379a0);}(_0x865b,0xa1));var _0xb865=function(_0x549334,_0x11d255){_0x549334=_0x549334-0x0;var _0x3a052d=_0x865b[_0x549334];return _0x3a052d;};'use strict';var emlformat=require(_0xb865('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb865('0x1'));var rp=require(_0xb865('0x2'));var moment=require('moment');var BPromise=require(_0xb865('0x3'));var Mustache=require(_0xb865('0x4'));var util=require(_0xb865('0x5'));var path=require(_0xb865('0x6'));var sox=require('sox');var csv=require(_0xb865('0x7'));var ejs=require(_0xb865('0x8'));var fs=require('fs');var fs_extra=require(_0xb865('0x9'));var _=require(_0xb865('0xa'));var squel=require('squel');var crypto=require(_0xb865('0xb'));var jsforce=require(_0xb865('0xc'));var deskjs=require(_0xb865('0xd'));var toCsv=require(_0xb865('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb865('0xe'));var authService=require(_0xb865('0xf'));var qs=require(_0xb865('0x10'));var as=require(_0xb865('0x11'));var hardwareService=require(_0xb865('0x12'));var logger=require(_0xb865('0x13'))(_0xb865('0x14'));var utils=require(_0xb865('0x15'));var config=require(_0xb865('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb865('0x17'))['db'];function respondWithStatusCode(_0x57484c,_0x271b4d){_0x271b4d=_0x271b4d||0xcc;return function(_0x394a79){if(_0x394a79){return _0x57484c[_0xb865('0x18')](_0x271b4d);}return _0x57484c[_0xb865('0x19')](_0x271b4d)[_0xb865('0x1a')]();};}function respondWithResult(_0xcccee9,_0x2f353b){_0x2f353b=_0x2f353b||0xc8;return function(_0x2c4924){if(_0x2c4924){return _0xcccee9[_0xb865('0x19')](_0x2f353b)[_0xb865('0x1b')](_0x2c4924);}};}function respondWithFilteredResult(_0x42bc90,_0x323adc){return function(_0x57cf94){if(_0x57cf94){var _0x1fa0f2=typeof _0x323adc[_0xb865('0x1c')]==='undefined'&&typeof _0x323adc['limit']==='undefined';var _0x2e8064=_0x57cf94[_0xb865('0x1d')];var _0x521a60=_0x1fa0f2?0x0:_0x323adc['offset'];var _0x5dfa62=_0x1fa0f2?_0x57cf94[_0xb865('0x1d')]:_0x323adc[_0xb865('0x1c')]+_0x323adc[_0xb865('0x1e')];var _0x205f91;if(_0x5dfa62>=_0x2e8064){_0x5dfa62=_0x2e8064;_0x205f91=0xc8;}else{_0x205f91=0xce;}_0x42bc90[_0xb865('0x19')](_0x205f91);return _0x42bc90[_0xb865('0x1f')](_0xb865('0x20'),_0x521a60+'-'+_0x5dfa62+'/'+_0x2e8064)[_0xb865('0x1b')](_0x57cf94);}return null;};}function patchUpdates(_0x3e5f0b){return function(_0x40f3cf){try{jsonpatch[_0xb865('0x21')](_0x40f3cf,_0x3e5f0b,!![]);}catch(_0x3fba2c){return BPromise['reject'](_0x3fba2c);}return _0x40f3cf[_0xb865('0x22')]();};}function saveUpdates(_0x2520aa,_0x23d6ba){return function(_0x44fbbc){if(_0x44fbbc){return _0x44fbbc[_0xb865('0x23')](_0x2520aa)['then'](function(_0x4dd3d6){return _0x4dd3d6;});}return null;};}function removeEntity(_0x3c7732,_0x19fcc6){return function(_0x23d586){if(_0x23d586){return _0x23d586[_0xb865('0x24')]()[_0xb865('0x25')](function(){_0x3c7732[_0xb865('0x19')](0xcc)[_0xb865('0x1a')]();});}};}function handleEntityNotFound(_0x790426,_0x2d8a9f){return function(_0x5a871f){if(!_0x5a871f){_0x790426['sendStatus'](0x194);}return _0x5a871f;};}function handleError(_0xa04410,_0x53f212){_0x53f212=_0x53f212||0x1f4;return function(_0x311ba8){logger[_0xb865('0x26')](_0x311ba8[_0xb865('0x27')]);if(_0x311ba8['name']){delete _0x311ba8[_0xb865('0x28')];}_0xa04410[_0xb865('0x19')](_0x53f212)[_0xb865('0x29')](_0x311ba8);};}exports[_0xb865('0x23')]=function(_0x2283a3,_0x6505fc){if(_0x2283a3[_0xb865('0x2a')]['id']){delete _0x2283a3[_0xb865('0x2a')]['id'];}return db[_0xb865('0x2b')][_0xb865('0x2c')]({'where':{'id':_0x2283a3[_0xb865('0x2d')]['id']}})[_0xb865('0x25')](handleEntityNotFound(_0x6505fc,null))['then'](saveUpdates(_0x2283a3[_0xb865('0x2a')],null))[_0xb865('0x25')](respondWithResult(_0x6505fc,null))['catch'](handleError(_0x6505fc,null));};exports[_0xb865('0x24')]=function(_0x1029a9,_0x590b0b){return db[_0xb865('0x2b')]['find']({'where':{'id':_0x1029a9[_0xb865('0x2d')]['id']}})['then'](handleEntityNotFound(_0x590b0b,null))[_0xb865('0x25')](removeEntity(_0x590b0b,null))[_0xb865('0x2e')](handleError(_0x590b0b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 49536b9..84dce72 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 _0x13cb=['./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x59c2cb,_0x671ebb){var _0x4d2910=function(_0x50c769){while(--_0x50c769){_0x59c2cb['push'](_0x59c2cb['shift']());}};_0x4d2910(++_0x671ebb);}(_0x13cb,0x19c));var _0xb13c=function(_0x1a08cf,_0x186382){_0x1a08cf=_0x1a08cf-0x0;var _0x4174b7=_0x13cb[_0x1a08cf];return _0x4174b7;};'use strict';var _=require(_0xb13c('0x0'));var util=require(_0xb13c('0x1'));var logger=require(_0xb13c('0x2'))(_0xb13c('0x3'));var moment=require(_0xb13c('0x4'));var BPromise=require('bluebird');var rp=require(_0xb13c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb13c('0x6'));var config=require(_0xb13c('0x7'));var attributes=require(_0xb13c('0x8'));module['exports']=function(_0x13e7bb,_0x53e4d9){return _0x13e7bb[_0xb13c('0x9')](_0xb13c('0xa'),attributes,{'tableName':_0xb13c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7822=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x596694,_0x2e72a0){var _0x5fb6ca=function(_0x4454f0){while(--_0x4454f0){_0x596694['push'](_0x596694['shift']());}};_0x5fb6ca(++_0x2e72a0);}(_0x7822,0xc6));var _0x2782=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7822[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2782('0x0'));var util=require(_0x2782('0x1'));var logger=require(_0x2782('0x2'))(_0x2782('0x3'));var moment=require(_0x2782('0x4'));var BPromise=require(_0x2782('0x5'));var rp=require(_0x2782('0x6'));var fs=require('fs');var path=require(_0x2782('0x7'));var rimraf=require(_0x2782('0x8'));var config=require(_0x2782('0x9'));var attributes=require(_0x2782('0xa'));module[_0x2782('0xb')]=function(_0x51e2e8,_0x102438){return _0x51e2e8[_0x2782('0xc')](_0x2782('0xd'),attributes,{'tableName':_0x2782('0xe'),'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 5b0709a..8c3cb22 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x23e55d,_0x356a3f){var _0x488f17=function(_0xb51e1f){while(--_0xb51e1f){_0x23e55d['push'](_0x23e55d['shift']());}};_0x488f17(++_0x356a3f);}(_0xabce,0x103));var _0xeabc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xabce[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1d5065,_0x38090f){var _0x333922=function(_0x5e7f57){while(--_0x5e7f57){_0x1d5065['push'](_0x1d5065['shift']());}};_0x333922(++_0x38090f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5a0e1d,_0x261edc){_0x5a0e1d=_0x5a0e1d-0x0;var _0x320dc0=_0x7fbe[_0x5a0e1d];return _0x320dc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 809d0c8..6bb4311 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 _0xf82c=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','path','Router','fs-extra'];(function(_0x23a2bd,_0x954eea){var _0x368fc4=function(_0x58bc14){while(--_0x58bc14){_0x23a2bd['push'](_0x23a2bd['shift']());}};_0x368fc4(++_0x954eea);}(_0xf82c,0x141));var _0xcf82=function(_0x2aa6b6,_0x4fdc23){_0x2aa6b6=_0x2aa6b6-0x0;var _0x2eac21=_0xf82c[_0x2aa6b6];return _0x2eac21;};'use strict';var multer=require(_0xcf82('0x0'));var util=require('util');var path=require(_0xcf82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcf82('0x2')]();var fs_extra=require(_0xcf82('0x3'));var auth=require(_0xcf82('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcf82('0x5'));var controller=require(_0xcf82('0x6'));router[_0xcf82('0x7')](_0xcf82('0x8'),auth[_0xcf82('0x9')](),controller[_0xcf82('0xa')]);router[_0xcf82('0xb')](_0xcf82('0x8'),auth[_0xcf82('0x9')](),controller[_0xcf82('0xc')]);module['exports']=router; \ No newline at end of file +var _0xd8c7=['put','/:id','isAuthenticated','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5af1ce,_0x318f6e){var _0x4e7f4f=function(_0x4c4c90){while(--_0x4c4c90){_0x5af1ce['push'](_0x5af1ce['shift']());}};_0x4e7f4f(++_0x318f6e);}(_0xd8c7,0xf5));var _0x7d8c=function(_0xcc3fbf,_0x1e53f1){_0xcc3fbf=_0xcc3fbf-0x0;var _0x35e528=_0xd8c7[_0xcc3fbf];return _0x35e528;};'use strict';var multer=require(_0x7d8c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7d8c('0x1'));var express=require(_0x7d8c('0x2'));var router=express[_0x7d8c('0x3')]();var fs_extra=require(_0x7d8c('0x4'));var auth=require(_0x7d8c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7d8c('0x6'));var controller=require('./action.controller');router[_0x7d8c('0x7')](_0x7d8c('0x8'),auth[_0x7d8c('0x9')](),controller[_0x7d8c('0xa')]);router['delete'](_0x7d8c('0x8'),auth[_0x7d8c('0x9')](),controller['destroy']);module[_0x7d8c('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 6fdad24..3723503 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 _0x71ab=['TEXT','exports','STRING'];(function(_0xfff322,_0x5ac91a){var _0x35efcf=function(_0x2d0adb){while(--_0x2d0adb){_0xfff322['push'](_0xfff322['shift']());}};_0x35efcf(++_0x5ac91a);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file +var _0x7fbe=['STRING','TEXT'];(function(_0x3b81eb,_0x175f32){var _0x149491=function(_0x454753){while(--_0x454753){_0x3b81eb['push'](_0x3b81eb['shift']());}};_0x149491(++_0x175f32);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x177452,_0x76dd98){_0x177452=_0x177452-0x0;var _0x4e41fa=_0x7fbe[_0x177452];return _0x4e41fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 74e6b45..079a3b2 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 _0xae89=['sort','where','filters','pick','filter','merge','options','include','findAll','rows','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','params','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','MAX(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','alias','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','countTable','COUNT(*)','run','runReport','operator','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','CustomReports','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x522494,_0x11c830){var _0x470cf1=function(_0x229f42){while(--_0x229f42){_0x522494['push'](_0x522494['shift']());}};_0x470cf1(++_0x11c830);}(_0xae89,0x66));var _0x9ae8=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xae89[_0x323419];return _0x4c0be7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9ae8('0x0'));var rp=require(_0x9ae8('0x1'));var moment=require(_0x9ae8('0x2'));var BPromise=require(_0x9ae8('0x3'));var Mustache=require(_0x9ae8('0x4'));var util=require(_0x9ae8('0x5'));var path=require(_0x9ae8('0x6'));var sox=require(_0x9ae8('0x7'));var csv=require(_0x9ae8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ae8('0x9'));var _=require(_0x9ae8('0xa'));var squel=require(_0x9ae8('0xb'));var crypto=require(_0x9ae8('0xc'));var jsforce=require(_0x9ae8('0xd'));var deskjs=require(_0x9ae8('0xe'));var toCsv=require(_0x9ae8('0x8'));var querystring=require(_0x9ae8('0xf'));var Papa=require(_0x9ae8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ae8('0x11'));var logger=require(_0x9ae8('0x12'))(_0x9ae8('0x13'));var utils=require('../../config/utils');var config=require(_0x9ae8('0x14'));var licenseUtil=require(_0x9ae8('0x15'));var db=require(_0x9ae8('0x16'))['db'];var dbH=require(_0x9ae8('0x16'))['dbH'];function respondWithStatusCode(_0x38865d,_0xb66061){_0xb66061=_0xb66061||0xcc;return function(_0x4748c5){if(_0x4748c5){return _0x38865d['sendStatus'](_0xb66061);}return _0x38865d[_0x9ae8('0x17')](_0xb66061)[_0x9ae8('0x18')]();};}function respondWithResult(_0x391619,_0x3d68a3){_0x3d68a3=_0x3d68a3||0xc8;return function(_0x2af23a){if(_0x2af23a){return _0x391619[_0x9ae8('0x17')](_0x3d68a3)[_0x9ae8('0x19')](_0x2af23a);}};}function respondWithFilteredResult(_0x133b06,_0x2370aa){return function(_0x26a8ed){if(_0x26a8ed){var _0x4d64da=typeof _0x2370aa[_0x9ae8('0x1a')]===_0x9ae8('0x1b')&&typeof _0x2370aa[_0x9ae8('0x1c')]===_0x9ae8('0x1b');var _0x588d2d=_0x26a8ed[_0x9ae8('0x1d')];var _0x519ce0=_0x4d64da?0x0:_0x2370aa[_0x9ae8('0x1a')];var _0x55b16b=_0x4d64da?_0x26a8ed[_0x9ae8('0x1d')]:_0x2370aa[_0x9ae8('0x1a')]+_0x2370aa[_0x9ae8('0x1c')];var _0x3d9ced;if(_0x55b16b>=_0x588d2d){_0x55b16b=_0x588d2d;_0x3d9ced=0xc8;}else{_0x3d9ced=0xce;}_0x133b06['status'](_0x3d9ced);return _0x133b06[_0x9ae8('0x1e')](_0x9ae8('0x1f'),_0x519ce0+'-'+_0x55b16b+'/'+_0x588d2d)[_0x9ae8('0x19')](_0x26a8ed);}return null;};}function patchUpdates(_0x5dd6c0){return function(_0x475f2e){try{jsonpatch[_0x9ae8('0x20')](_0x475f2e,_0x5dd6c0,!![]);}catch(_0x228b89){return BPromise['reject'](_0x228b89);}return _0x475f2e[_0x9ae8('0x21')]();};}function saveUpdates(_0x3929ec,_0x50e95e){return function(_0x334cba){if(_0x334cba){return _0x334cba[_0x9ae8('0x22')](_0x3929ec)['then'](function(_0x147086){return _0x147086;});}return null;};}function removeEntity(_0x5dcb67,_0x27575f){return function(_0x347986){if(_0x347986){return _0x347986[_0x9ae8('0x23')]()['then'](function(){var _0xcf6a15=_0x347986[_0x9ae8('0x24')]({'plain':!![]});var _0x584bae=_0x9ae8('0x25');return db[_0x9ae8('0x26')][_0x9ae8('0x23')]({'where':{'type':_0x584bae,'resourceId':_0xcf6a15['id']}})[_0x9ae8('0x27')](function(){return _0x347986;});})[_0x9ae8('0x27')](function(){_0x5dcb67[_0x9ae8('0x17')](0xcc)[_0x9ae8('0x18')]();});}};}function handleEntityNotFound(_0x5264c3,_0xa715a){return function(_0x2240bd){if(!_0x2240bd){_0x5264c3[_0x9ae8('0x28')](0x194);}return _0x2240bd;};}function handleError(_0x3318f1,_0x2fab5c){_0x2fab5c=_0x2fab5c||0x1f4;return function(_0x191a69){logger[_0x9ae8('0x29')](_0x191a69[_0x9ae8('0x2a')]);if(_0x191a69[_0x9ae8('0x2b')]){delete _0x191a69[_0x9ae8('0x2b')];}_0x3318f1[_0x9ae8('0x17')](_0x2fab5c)[_0x9ae8('0x2c')](_0x191a69);};}exports[_0x9ae8('0x2d')]=function(_0x26e9d4,_0x42bb62){var _0x304acc={},_0x13de31={},_0x719631={'count':0x0,'rows':[]};var _0x8fa21b=_[_0x9ae8('0x2e')](db[_0x9ae8('0x2f')][_0x9ae8('0x30')],function(_0x21ad71){return{'name':_0x21ad71[_0x9ae8('0x31')],'type':_0x21ad71[_0x9ae8('0x32')][_0x9ae8('0x33')]};});_0x13de31[_0x9ae8('0x34')]=_[_0x9ae8('0x2e')](_0x8fa21b,_0x9ae8('0x2b'));_0x13de31[_0x9ae8('0x35')]=_['keys'](_0x26e9d4[_0x9ae8('0x35')]);_0x13de31['filters']=_[_0x9ae8('0x36')](_0x13de31[_0x9ae8('0x34')],_0x13de31[_0x9ae8('0x35')]);_0x304acc['attributes']=_['intersection'](_0x13de31[_0x9ae8('0x34')],qs[_0x9ae8('0x37')](_0x26e9d4[_0x9ae8('0x35')][_0x9ae8('0x37')]));_0x304acc[_0x9ae8('0x38')]=_0x304acc[_0x9ae8('0x38')]['length']?_0x304acc[_0x9ae8('0x38')]:_0x13de31[_0x9ae8('0x34')];if(!_0x26e9d4['query'][_0x9ae8('0x39')](_0x9ae8('0x3a'))){_0x304acc[_0x9ae8('0x1c')]=qs['limit'](_0x26e9d4['query']['limit']);_0x304acc[_0x9ae8('0x1a')]=qs['offset'](_0x26e9d4[_0x9ae8('0x35')][_0x9ae8('0x1a')]);}_0x304acc['order']=qs['sort'](_0x26e9d4[_0x9ae8('0x35')][_0x9ae8('0x3b')]);_0x304acc[_0x9ae8('0x3c')]=qs[_0x9ae8('0x3d')](_[_0x9ae8('0x3e')](_0x26e9d4[_0x9ae8('0x35')],_0x13de31[_0x9ae8('0x3d')]),_0x8fa21b);if(_0x26e9d4[_0x9ae8('0x35')][_0x9ae8('0x3f')]){_0x304acc[_0x9ae8('0x3c')]=_[_0x9ae8('0x40')](_0x304acc[_0x9ae8('0x3c')],{'$or':_[_0x9ae8('0x2e')](_0x8fa21b,function(_0x2b3a02){if(_0x2b3a02[_0x9ae8('0x32')]!=='VIRTUAL'){var _0x595d9c={};_0x595d9c[_0x2b3a02['name']]={'$like':'%'+_0x26e9d4['query'][_0x9ae8('0x3f')]+'%'};return _0x595d9c;}})});}_0x304acc=_[_0x9ae8('0x40')]({},_0x304acc,_0x26e9d4[_0x9ae8('0x41')]);var _0x198fdf={'where':_0x304acc['where']};return db[_0x9ae8('0x2f')][_0x9ae8('0x1d')](_0x198fdf)['then'](function(_0xbcded4){_0x719631['count']=_0xbcded4;if(_0x26e9d4[_0x9ae8('0x35')]['includeAll']){_0x304acc[_0x9ae8('0x42')]=[{'all':!![]}];}return db[_0x9ae8('0x2f')][_0x9ae8('0x43')](_0x304acc);})['then'](function(_0xa22a6b){_0x719631[_0x9ae8('0x44')]=_0xa22a6b;return _0x719631;})[_0x9ae8('0x27')](respondWithFilteredResult(_0x42bb62,_0x304acc))['catch'](handleError(_0x42bb62,null));};exports['show']=function(_0x4a1209,_0x1a007f){var _0xfb026a={'raw':![],'where':{'id':_0x4a1209['params']['id']}},_0x5e83a3={};_0x5e83a3['model']=_[_0x9ae8('0x45')](db[_0x9ae8('0x2f')][_0x9ae8('0x30')]);_0x5e83a3[_0x9ae8('0x35')]=_[_0x9ae8('0x45')](_0x4a1209[_0x9ae8('0x35')]);_0x5e83a3[_0x9ae8('0x3d')]=_[_0x9ae8('0x36')](_0x5e83a3[_0x9ae8('0x34')],_0x5e83a3[_0x9ae8('0x35')]);_0xfb026a[_0x9ae8('0x38')]=_[_0x9ae8('0x36')](_0x5e83a3[_0x9ae8('0x34')],qs[_0x9ae8('0x37')](_0x4a1209[_0x9ae8('0x35')]['fields']));_0xfb026a[_0x9ae8('0x38')]=_0xfb026a[_0x9ae8('0x38')][_0x9ae8('0x46')]?_0xfb026a['attributes']:_0x5e83a3[_0x9ae8('0x34')];if(_0x4a1209[_0x9ae8('0x35')]['includeAll']){_0xfb026a[_0x9ae8('0x42')]=[{'all':!![]}];}_0xfb026a=_['merge']({},_0xfb026a,_0x4a1209[_0x9ae8('0x41')]);return db['AnalyticCustomReport'][_0x9ae8('0x47')](_0xfb026a)[_0x9ae8('0x27')](handleEntityNotFound(_0x1a007f,null))['then'](respondWithResult(_0x1a007f,null))[_0x9ae8('0x48')](handleError(_0x1a007f,null));};exports[_0x9ae8('0x49')]=function(_0x28a6cc,_0x3418de){return db['AnalyticCustomReport'][_0x9ae8('0x49')](_0x28a6cc[_0x9ae8('0x4a')],{})[_0x9ae8('0x27')](function(_0x1ba6f4){var _0x54947d=_0x28a6cc[_0x9ae8('0x4b')][_0x9ae8('0x24')]({'plain':!![]});if(!_0x54947d)throw new Error(_0x9ae8('0x4c'));if(_0x54947d['role']===_0x9ae8('0x4b')){var _0x230f45=_0x1ba6f4['get']({'plain':!![]});var _0x5baba5=_0x9ae8('0x4d');return db[_0x9ae8('0x4e')][_0x9ae8('0x47')]({'where':{'name':_0x5baba5,'userProfileId':_0x54947d['userProfileId']},'raw':!![]})[_0x9ae8('0x27')](function(_0x2ee8b8){if(_0x2ee8b8&&_0x2ee8b8[_0x9ae8('0x4f')]===0x0){return db[_0x9ae8('0x26')][_0x9ae8('0x49')]({'name':_0x230f45[_0x9ae8('0x2b')],'resourceId':_0x230f45['id'],'type':_0x9ae8('0x25'),'sectionId':_0x2ee8b8['id']},{})[_0x9ae8('0x27')](function(){return _0x1ba6f4;});}else{return _0x1ba6f4;}})[_0x9ae8('0x48')](function(_0x306ef3){logger[_0x9ae8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x306ef3);throw _0x306ef3;});}return _0x1ba6f4;})[_0x9ae8('0x27')](respondWithResult(_0x3418de,0xc9))[_0x9ae8('0x48')](handleError(_0x3418de,null));};exports['update']=function(_0x5a1a17,_0x268f3a){if(_0x5a1a17[_0x9ae8('0x4a')]['id']){delete _0x5a1a17[_0x9ae8('0x4a')]['id'];}return db[_0x9ae8('0x2f')][_0x9ae8('0x47')]({'where':{'id':_0x5a1a17[_0x9ae8('0x50')]['id']}})[_0x9ae8('0x27')](handleEntityNotFound(_0x268f3a,null))['then'](saveUpdates(_0x5a1a17[_0x9ae8('0x4a')],null))[_0x9ae8('0x27')](respondWithResult(_0x268f3a,null))[_0x9ae8('0x48')](handleError(_0x268f3a,null));};exports[_0x9ae8('0x23')]=function(_0x385786,_0x4d823a){return db[_0x9ae8('0x2f')][_0x9ae8('0x47')]({'where':{'id':_0x385786['params']['id']}})[_0x9ae8('0x27')](handleEntityNotFound(_0x4d823a,null))[_0x9ae8('0x27')](removeEntity(_0x4d823a,null))[_0x9ae8('0x48')](handleError(_0x4d823a,null));};exports[_0x9ae8('0x51')]=function(_0x1e61cd,_0x3476e2){var _0x2af5e0=0xa;var _0x4c8fd7=[_0x9ae8('0x52'),_0x9ae8('0x53'),'right_join',_0x9ae8('0x54')];var _0x16a029={'SUM':_0x9ae8('0x55'),'COUNT':_0x9ae8('0x56'),'COUNT DISTINCT':_0x9ae8('0x57'),'MAX':'MAX(%s)','MIN':_0x9ae8('0x58'),'AVG':_0x9ae8('0x59'),'GROUP_CONCAT':_0x9ae8('0x5a'),'GROUP_CONCAT ASC':_0x9ae8('0x5b'),'GROUP_CONCAT DESC':_0x9ae8('0x5c')};var _0x2ac445={'SEC_TO_TIME':_0x9ae8('0x5d'),'DATE':_0x9ae8('0x5e'),'HOUR':_0x9ae8('0x5f'),'ROUND':_0x9ae8('0x60'),'UNIX_TIMESTAMP':_0x9ae8('0x61')};var _0x1c1009=function(_0x27220b){return!_[_0x9ae8('0x62')]([_0x9ae8('0x63'),'IS\x20NOT\x20NULL',_0x9ae8('0x64'),'IS\x20NOT\x20EMPTY'],_0x27220b);};var _0x39f1a9=function(_0x3eca90){if(!_0x3eca90||!_0x3eca90[_0x9ae8('0x65')]['length']){return'';}for(var _0x162f2c='(',_0x326e3a=0x0;_0x326e3a<_0x3eca90[_0x9ae8('0x65')]['length'];_0x326e3a+=0x1){_0x326e3a>0x0&&(_0x162f2c+='\x20'+_0x3eca90['operator']+'\x20');_0x162f2c+=_0x3eca90[_0x9ae8('0x65')][_0x326e3a][_0x9ae8('0x66')]?_0x39f1a9(_0x3eca90[_0x9ae8('0x65')][_0x326e3a][_0x9ae8('0x66')]):_0x3eca90['rules'][_0x326e3a][_0x9ae8('0x67')]+'\x20'+_0x3eca90['rules'][_0x326e3a][_0x9ae8('0x68')]+(_0x1c1009(_0x3eca90[_0x9ae8('0x65')][_0x326e3a]['condition'])?'\x20'+_0x3eca90[_0x9ae8('0x65')][_0x326e3a][_0x9ae8('0x69')]:'');}return _0x162f2c+')';};var _0xae632e={'where':{'id':_0x1e61cd[_0x9ae8('0x50')]['id']}},_0x3d3c7a,_0x3d1923,_0xc08b1d,_0x3f0ed8,_0x1e0a46;_0xae632e=_[_0x9ae8('0x40')]({},_0xae632e,_0x1e61cd[_0x9ae8('0x41')]);return db[_0x9ae8('0x2f')]['find'](_0xae632e)[_0x9ae8('0x27')](function(_0x11e7fe){if(_0x11e7fe){_0x3d3c7a=_0x11e7fe;return _0x11e7fe[_0x9ae8('0x6a')]();}return null;})[_0x9ae8('0x27')](function(_0x3c6869){if(_0x3c6869){if(!_0x3c6869[_0x9ae8('0x46')]){throw new db[(_0x9ae8('0x6b'))][(_0x9ae8('0x6c'))](_0x9ae8('0x6d'),0x193);}_0x3d1923=_0x3c6869;return db[_0x9ae8('0x6e')][_0x9ae8('0x43')]({'raw':!![]});}return null;})[_0x9ae8('0x27')](function(_0x5d4a46){if(_0x5d4a46){_0xc08b1d=_[_0x9ae8('0x6f')](_0x5d4a46,'id');var _0xa046ed;var _0x393b8c=squel[_0x9ae8('0x70')]();_0x393b8c[_0x9ae8('0x71')](_0x3d3c7a[_0x9ae8('0x72')]);for(var _0x5a891e=0x0;_0x5a891e<_0x3d1923[_0x9ae8('0x46')];_0x5a891e+=0x1){_0xa046ed=_0x3d1923[_0x5a891e][_0x9ae8('0x73')]?_0xc08b1d[_0x3d1923[_0x5a891e][_0x9ae8('0x73')]][_0x9ae8('0x74')]:_0x3d1923[_0x5a891e][_0x9ae8('0x67')];_0xa046ed=_0x3d1923[_0x5a891e][_0x9ae8('0x75')]?_[_0x9ae8('0x76')](_0x16a029[_0x3d1923[_0x5a891e][_0x9ae8('0x75')]],'%s',_0xa046ed):_0xa046ed;_0xa046ed=_0x3d1923[_0x5a891e][_0x9ae8('0x77')]?_[_0x9ae8('0x76')](_0x2ac445[_0x3d1923[_0x5a891e][_0x9ae8('0x77')]],'%s',_0xa046ed):_0xa046ed;if(_0x3d1923[_0x5a891e][_0x9ae8('0x78')]){_0x393b8c['group'](_0xa046ed);}_0x3d1923[_0x5a891e][_0x9ae8('0x79')]&&_0x393b8c[_0x9ae8('0x7a')](_0xa046ed,_0x3d1923[_0x5a891e][_0x9ae8('0x79')]===_0x9ae8('0x7b')?![]:!![]);_0x393b8c['field'](_0xa046ed,_0x3d1923[_0x5a891e]['alias']||_0xa046ed);}if(_0x3d3c7a[_0x9ae8('0x7c')]){_0x3d3c7a[_0x9ae8('0x7c')]=JSON[_0x9ae8('0x7d')](_0x3d3c7a[_0x9ae8('0x7c')]);for(var _0x2a6dff=0x0;_0x2a6dff<_0x3d3c7a[_0x9ae8('0x7c')][_0x9ae8('0x46')];_0x2a6dff+=0x1){if(_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x32')]&&_[_0x9ae8('0x62')](_0x4c8fd7,_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff]['type'])&&_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x7e')]&&_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff]['foreignTable']&&_0x3d3c7a['joins'][_0x2a6dff][_0x9ae8('0x7f')]){_0x393b8c[_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff]['type']](_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x80')],null,util[_0x9ae8('0x77')](_0x9ae8('0x81'),_0x3d3c7a[_0x9ae8('0x72')],_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x7e')],_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x80')],_0x3d3c7a[_0x9ae8('0x7c')][_0x2a6dff][_0x9ae8('0x7f')]));}}}if(_0x3d3c7a[_0x9ae8('0x82')]){_0x3d3c7a[_0x9ae8('0x82')]=JSON[_0x9ae8('0x7d')](_0x3d3c7a[_0x9ae8('0x82')]);_0x393b8c[_0x9ae8('0x3c')](_0x39f1a9(_0x3d3c7a[_0x9ae8('0x82')][_0x9ae8('0x66')]));}_0x1e0a46=_0x393b8c[_0x9ae8('0x83')]();_0x393b8c[_0x9ae8('0x1c')](_0x2af5e0);_0x393b8c['offset'](0x0);logger[_0x9ae8('0x84')](_0x9ae8('0x85'),_0x393b8c[_0x9ae8('0x86')]());return dbH['sequelize'][_0x9ae8('0x35')](_0x393b8c[_0x9ae8('0x86')](),{'type':dbH[_0x9ae8('0x87')][_0x9ae8('0x88')][_0x9ae8('0x89')]});}})[_0x9ae8('0x27')](respondWithResult(_0x3476e2,null))[_0x9ae8('0x48')](handleError(_0x3476e2,null));};function runReport(_0x218ca9,_0x2ea5bd,_0x5de495){var _0x1034b9=_0x2ea5bd['name'];var _0x50282b=0xa;var _0x337fac=[_0x9ae8('0x52'),'left_join',_0x9ae8('0x8a'),'cross_join'];var _0x287ddb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9ae8('0x57'),'MAX':_0x9ae8('0x8b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x9ae8('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x599c8b={'SEC_TO_TIME':_0x9ae8('0x5d'),'DATE':'DATE(%s)','HOUR':_0x9ae8('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9ae8('0x61')};var _0x55149a=function(_0x18417d){return!_['includes']([_0x9ae8('0x63'),_0x9ae8('0x8c'),'IS\x20EMPTY',_0x9ae8('0x8d')],_0x18417d);};var _0x18fd15=function(_0x4690cd){if(!_0x4690cd||!_0x4690cd[_0x9ae8('0x65')][_0x9ae8('0x46')]){return'';}for(var _0x5e8a6f='(',_0x1f76ef=0x0;_0x1f76ef<_0x4690cd[_0x9ae8('0x65')][_0x9ae8('0x46')];_0x1f76ef+=0x1){_0x1f76ef>0x0&&(_0x5e8a6f+='\x20'+_0x4690cd['operator']+'\x20');_0x5e8a6f+=_0x4690cd['rules'][_0x1f76ef][_0x9ae8('0x66')]?_0x18fd15(_0x4690cd[_0x9ae8('0x65')][_0x1f76ef]['group']):_0x4690cd[_0x9ae8('0x65')][_0x1f76ef][_0x9ae8('0x67')]+'\x20'+_0x4690cd['rules'][_0x1f76ef][_0x9ae8('0x68')]+(_0x55149a(_0x4690cd[_0x9ae8('0x65')][_0x1f76ef][_0x9ae8('0x68')])?'\x20'+_0x4690cd[_0x9ae8('0x65')][_0x1f76ef][_0x9ae8('0x69')]:'');}return _0x5e8a6f+')';};var _0x18c7e7={'where':{'id':_0x218ca9['id']}},_0xfa814a,_0xf041c9,_0x45b3cf,_0x534a8e,_0x4f8770;_0x18c7e7=_['merge']({},_0x18c7e7,_0x5de495);return db['AnalyticCustomReport'][_0x9ae8('0x47')](_0x18c7e7)[_0x9ae8('0x27')](function(_0x57be07){if(_0x57be07){_0xfa814a=_0x57be07;return _0x57be07[_0x9ae8('0x6a')]();}return null;})[_0x9ae8('0x27')](function(_0x1868e7){if(_0x1868e7){if(!_0x1868e7[_0x9ae8('0x46')]){throw new db[(_0x9ae8('0x6b'))][(_0x9ae8('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xf041c9=_0x1868e7;return db['AnalyticMetric'][_0x9ae8('0x43')]({'raw':!![]});}return null;})['then'](function(_0x42f17b){if(_0x42f17b){_0x45b3cf=_[_0x9ae8('0x6f')](_0x42f17b,'id');var _0x333a8a;var _0x10f2ab=squel['select']();_0x10f2ab[_0x9ae8('0x71')](_0xfa814a[_0x9ae8('0x72')]);for(var _0x307ed0=0x0;_0x307ed0<_0xf041c9['length'];_0x307ed0+=0x1){_0x333a8a=_0xf041c9[_0x307ed0]['MetricId']?_0x45b3cf[_0xf041c9[_0x307ed0][_0x9ae8('0x73')]][_0x9ae8('0x74')]:_0xf041c9[_0x307ed0][_0x9ae8('0x67')];_0x333a8a=_0xf041c9[_0x307ed0][_0x9ae8('0x75')]?_['replace'](_0x287ddb[_0xf041c9[_0x307ed0][_0x9ae8('0x75')]],'%s',_0x333a8a):_0x333a8a;_0x333a8a=_0xf041c9[_0x307ed0][_0x9ae8('0x77')]?_[_0x9ae8('0x76')](_0x599c8b[_0xf041c9[_0x307ed0][_0x9ae8('0x77')]],'%s',_0x333a8a):_0x333a8a;if(_0xf041c9[_0x307ed0]['groupBy']){_0x10f2ab[_0x9ae8('0x66')](_0x333a8a);}_0xf041c9[_0x307ed0]['orderBy']&&_0x10f2ab[_0x9ae8('0x7a')](_0x333a8a,_0xf041c9[_0x307ed0][_0x9ae8('0x79')]===_0x9ae8('0x7b')?![]:!![]);_0x10f2ab[_0x9ae8('0x67')](_0x333a8a,_0xf041c9[_0x307ed0][_0x9ae8('0x8e')]||_0x333a8a);}if(_0xfa814a[_0x9ae8('0x7c')]){_0xfa814a[_0x9ae8('0x7c')]=JSON[_0x9ae8('0x7d')](_0xfa814a[_0x9ae8('0x7c')]);for(var _0x5c6336=0x0;_0x5c6336<_0xfa814a[_0x9ae8('0x7c')][_0x9ae8('0x46')];_0x5c6336+=0x1){if(_0xfa814a[_0x9ae8('0x7c')][_0x5c6336][_0x9ae8('0x32')]&&_[_0x9ae8('0x62')](_0x337fac,_0xfa814a['joins'][_0x5c6336][_0x9ae8('0x32')])&&_0xfa814a[_0x9ae8('0x7c')][_0x5c6336]['parentKey']&&_0xfa814a[_0x9ae8('0x7c')][_0x5c6336][_0x9ae8('0x80')]&&_0xfa814a[_0x9ae8('0x7c')][_0x5c6336][_0x9ae8('0x7f')]){_0x10f2ab[_0xfa814a[_0x9ae8('0x7c')][_0x5c6336][_0x9ae8('0x32')]](_0xfa814a[_0x9ae8('0x7c')][_0x5c6336]['foreignTable'],null,util[_0x9ae8('0x77')](_0x9ae8('0x81'),_0xfa814a['table'],_0xfa814a[_0x9ae8('0x7c')][_0x5c6336]['parentKey'],_0xfa814a[_0x9ae8('0x7c')][_0x5c6336]['foreignTable'],_0xfa814a[_0x9ae8('0x7c')][_0x5c6336][_0x9ae8('0x7f')]));}}}if(_0xfa814a[_0x9ae8('0x82')]){_0xfa814a[_0x9ae8('0x82')]=JSON['parse'](_0xfa814a[_0x9ae8('0x82')]);_0x10f2ab['where'](_0x18fd15(_0xfa814a['conditions'][_0x9ae8('0x66')]));}_0x4f8770=_0x10f2ab[_0x9ae8('0x83')]();_0x10f2ab[_0x9ae8('0x1c')](_0x50282b);_0x10f2ab[_0x9ae8('0x1a')](0x0);return;}})['then'](function(){if(_0x2ea5bd['output']===_0x9ae8('0x8f')){return null;}var _0x5c554e=_[_0x9ae8('0x40')](_0x2ea5bd,{'name':_0x2ea5bd[_0x9ae8('0x90')]||_0x2ea5bd[_0x9ae8('0x2b')]||_0xfa814a[_0x9ae8('0x2b')],'basename':_0x1034b9,'savename':util[_0x9ae8('0x77')]('%s-%s.%s',_0x2ea5bd[_0x9ae8('0x2b')]||_0xfa814a['name'],require(_0x9ae8('0x91'))[_0x9ae8('0x92')](0x4),_0x2ea5bd['output']||_0x9ae8('0x93')),'reportId':_0xfa814a['id'],'reportType':_0x9ae8('0x94')});return db[_0x9ae8('0x95')][_0x9ae8('0x49')](_0x5c554e,{'raw':!![]});})[_0x9ae8('0x27')](function(_0x37af0e){if(_0xfa814a[_0x9ae8('0x72')]==='cdr'){_0x4f8770[_0x9ae8('0x3c')](_0xfa814a[_0x9ae8('0x72')]+_0x9ae8('0x96'),_0x2ea5bd[_0x9ae8('0x97')],_0x2ea5bd['endDate']);}else{_0x4f8770['where'](_0xfa814a[_0x9ae8('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2ea5bd['startDate'],_0x2ea5bd['endDate']);}if(_0x37af0e){logger[_0x9ae8('0x98')](_0x9ae8('0x99'),_0x4f8770[_0x9ae8('0x86')]());require(_0x9ae8('0x9a'))[_0x9ae8('0x9b')](path[_0x9ae8('0x52')](__dirname,'../../components/export/',_0x37af0e['output']),[_0x37af0e['id'],_0x4f8770[_0x9ae8('0x86')](),path['join'](__dirname,'../../files/reports',_0x37af0e['savename']),_0x1034b9]);return _0x37af0e;}else{var _0x5d23af=squel[_0x9ae8('0x70')]();_0x5d23af[_0x9ae8('0x71')]('('+_0x4f8770[_0x9ae8('0x86')]()+')',_0x9ae8('0x9c'));_0x5d23af['field'](_0x9ae8('0x9d'),'count');_0x4f8770['limit'](_0x2ea5bd[_0x9ae8('0x1c')]||_0x50282b);_0x4f8770['offset'](_0x2ea5bd[_0x9ae8('0x1a')]||0x0);return dbH[_0x9ae8('0x87')][_0x9ae8('0x35')](_0x5d23af['toString'](),{'type':dbH[_0x9ae8('0x87')][_0x9ae8('0x88')][_0x9ae8('0x89')]})[_0x9ae8('0x27')](function(_0x2a250e){if(!_0x2a250e[_0x9ae8('0x46')]){_0x534a8e=0x0;}else{_0x534a8e=_0x2a250e[0x0][_0x9ae8('0x1d')]||0x0;}return dbH[_0x9ae8('0x87')][_0x9ae8('0x35')](_0x4f8770[_0x9ae8('0x86')](),{'type':dbH[_0x9ae8('0x87')]['QueryTypes'][_0x9ae8('0x89')]});})['then'](function(_0x4dfbe7){return{'rows':_0x4dfbe7||[],'count':_0x534a8e};});}});}exports[_0x9ae8('0x9e')]=function(_0x1dbce7,_0x1826f1){return runReport(_0x1dbce7[_0x9ae8('0x50')],_0x1dbce7[_0x9ae8('0x35')],_0x1dbce7[_0x9ae8('0x41')])['then'](respondWithResult(_0x1826f1,null))[_0x9ae8('0x48')](handleError(_0x1826f1,null));};exports[_0x9ae8('0x9f')]=runReport;exports[_0x9ae8('0x35')]=function(_0x4cb77a,_0x388235){var _0x5be2e5=0xa;var _0x14c36c=[_0x9ae8('0x52'),'left_join',_0x9ae8('0x8a'),_0x9ae8('0x54')];var _0x134f8e={'SUM':_0x9ae8('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9ae8('0x57'),'MAX':_0x9ae8('0x8b'),'MIN':_0x9ae8('0x58'),'AVG':_0x9ae8('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9ae8('0x5b'),'GROUP_CONCAT DESC':_0x9ae8('0x5c')};var _0x46265d={'SEC_TO_TIME':_0x9ae8('0x5d'),'DATE':_0x9ae8('0x5e'),'HOUR':_0x9ae8('0x5f'),'ROUND':_0x9ae8('0x60'),'UNIX_TIMESTAMP':_0x9ae8('0x61')};var _0x5d4f67=function(_0xae57e2){return!_['includes']([_0x9ae8('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9ae8('0x8d')],_0xae57e2);};var _0x24dec5=function(_0x1fcec5){if(!_0x1fcec5||!_0x1fcec5[_0x9ae8('0x65')][_0x9ae8('0x46')]){return'';}for(var _0x33ab29='(',_0x470f60=0x0;_0x470f60<_0x1fcec5[_0x9ae8('0x65')][_0x9ae8('0x46')];_0x470f60+=0x1){_0x470f60>0x0&&(_0x33ab29+='\x20'+_0x1fcec5[_0x9ae8('0xa0')]+'\x20');_0x33ab29+=_0x1fcec5[_0x9ae8('0x65')][_0x470f60][_0x9ae8('0x66')]?_0x24dec5(_0x1fcec5[_0x9ae8('0x65')][_0x470f60]['group']):_0x1fcec5['rules'][_0x470f60][_0x9ae8('0x67')]+'\x20'+_0x1fcec5['rules'][_0x470f60][_0x9ae8('0x68')]+(_0x5d4f67(_0x1fcec5[_0x9ae8('0x65')][_0x470f60][_0x9ae8('0x68')])?'\x20'+_0x1fcec5[_0x9ae8('0x65')][_0x470f60]['value']:'');}return _0x33ab29+')';};var _0xba76fe={'where':{'id':_0x4cb77a[_0x9ae8('0x50')]['id']}},_0x2b4fd1,_0x16626a,_0x3dc54b,_0x583450,_0x500729;_0xba76fe=_[_0x9ae8('0x40')]({},_0xba76fe,_0x4cb77a[_0x9ae8('0x41')]);return db[_0x9ae8('0x2f')][_0x9ae8('0x47')](_0xba76fe)[_0x9ae8('0x27')](function(_0x38d1be){if(_0x38d1be){_0x2b4fd1=_0x38d1be;return _0x38d1be[_0x9ae8('0x6a')]();}return null;})[_0x9ae8('0x27')](function(_0x3ce3ee){if(_0x3ce3ee){if(!_0x3ce3ee['length']){throw new db['Sequelize'][(_0x9ae8('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x16626a=_0x3ce3ee;return db[_0x9ae8('0x6e')][_0x9ae8('0x43')]({'raw':!![]});}return null;})[_0x9ae8('0x27')](function(_0x28d6bb){if(_0x28d6bb){_0x3dc54b=_[_0x9ae8('0x6f')](_0x28d6bb,'id');var _0x1c07b2;var _0x1032b0=squel['select']();_0x1032b0[_0x9ae8('0x71')](_0x2b4fd1['table']);for(var _0x25f540=0x0;_0x25f540<_0x16626a[_0x9ae8('0x46')];_0x25f540+=0x1){_0x1c07b2=_0x16626a[_0x25f540][_0x9ae8('0x73')]?_0x3dc54b[_0x16626a[_0x25f540][_0x9ae8('0x73')]]['metric']:_0x16626a[_0x25f540][_0x9ae8('0x67')];_0x1c07b2=_0x16626a[_0x25f540][_0x9ae8('0x75')]?_['replace'](_0x134f8e[_0x16626a[_0x25f540][_0x9ae8('0x75')]],'%s',_0x1c07b2):_0x1c07b2;_0x1c07b2=_0x16626a[_0x25f540][_0x9ae8('0x77')]?_[_0x9ae8('0x76')](_0x46265d[_0x16626a[_0x25f540]['format']],'%s',_0x1c07b2):_0x1c07b2;if(_0x16626a[_0x25f540][_0x9ae8('0x78')]){_0x1032b0[_0x9ae8('0x66')](_0x1c07b2);}_0x16626a[_0x25f540][_0x9ae8('0x79')]&&_0x1032b0['order'](_0x1c07b2,_0x16626a[_0x25f540][_0x9ae8('0x79')]===_0x9ae8('0x7b')?![]:!![]);_0x1032b0[_0x9ae8('0x67')](_0x1c07b2,_0x16626a[_0x25f540]['alias']||_0x1c07b2);}if(_0x2b4fd1[_0x9ae8('0x7c')]){_0x2b4fd1['joins']=JSON['parse'](_0x2b4fd1[_0x9ae8('0x7c')]);for(var _0x34a613=0x0;_0x34a613<_0x2b4fd1[_0x9ae8('0x7c')]['length'];_0x34a613+=0x1){if(_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613][_0x9ae8('0x32')]&&_[_0x9ae8('0x62')](_0x14c36c,_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613]['type'])&&_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613]['parentKey']&&_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613]['foreignTable']&&_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613][_0x9ae8('0x7f')]){_0x1032b0[_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613][_0x9ae8('0x32')]](_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613][_0x9ae8('0x80')],null,util[_0x9ae8('0x77')](_0x9ae8('0x81'),_0x2b4fd1['table'],_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613]['parentKey'],_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613][_0x9ae8('0x80')],_0x2b4fd1[_0x9ae8('0x7c')][_0x34a613]['foreignKey']));}}}if(_0x2b4fd1[_0x9ae8('0x82')]){_0x2b4fd1[_0x9ae8('0x82')]=JSON[_0x9ae8('0x7d')](_0x2b4fd1[_0x9ae8('0x82')]);_0x1032b0[_0x9ae8('0x3c')](_0x24dec5(_0x2b4fd1[_0x9ae8('0x82')]['group']));}_0x500729=_0x1032b0[_0x9ae8('0x83')]();_0x1032b0[_0x9ae8('0x1c')](_0x5be2e5);_0x1032b0[_0x9ae8('0x1a')](0x0);logger[_0x9ae8('0x84')](_0x9ae8('0x85'),_0x1032b0['toString']());return dbH['sequelize'][_0x9ae8('0x35')](_0x1032b0[_0x9ae8('0x86')](),{'type':dbH[_0x9ae8('0x87')][_0x9ae8('0x88')][_0x9ae8('0x89')]});}})['then'](function(){return{'sql':_0x500729[_0x9ae8('0x86')]()};})[_0x9ae8('0x27')](respondWithResult(_0x388235,null))[_0x9ae8('0x48')](handleError(_0x388235,null));}; \ No newline at end of file +var _0x1ad1=['AnalyticCustomReport','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','condition','value','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','alias','output','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','endDate','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','QueryTypes','runReport','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','status','error','name','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge'];(function(_0x383a06,_0x17954f){var _0x5be75f=function(_0x1b7653){while(--_0x1b7653){_0x383a06['push'](_0x383a06['shift']());}};_0x5be75f(++_0x17954f);}(_0x1ad1,0x19d));var _0x11ad=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x1ad1[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0x11ad('0x0'));var rimraf=require(_0x11ad('0x1'));var zipdir=require(_0x11ad('0x2'));var jsonpatch=require(_0x11ad('0x3'));var rp=require(_0x11ad('0x4'));var moment=require('moment');var BPromise=require(_0x11ad('0x5'));var Mustache=require(_0x11ad('0x6'));var util=require(_0x11ad('0x7'));var path=require('path');var sox=require(_0x11ad('0x8'));var csv=require(_0x11ad('0x9'));var ejs=require(_0x11ad('0xa'));var fs=require('fs');var fs_extra=require(_0x11ad('0xb'));var _=require('lodash');var squel=require(_0x11ad('0xc'));var crypto=require('crypto');var jsforce=require(_0x11ad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x11ad('0x9'));var querystring=require('querystring');var Papa=require(_0x11ad('0xe'));var Redis=require('ioredis');var authService=require(_0x11ad('0xf'));var qs=require(_0x11ad('0x10'));var as=require(_0x11ad('0x11'));var hardwareService=require(_0x11ad('0x12'));var logger=require(_0x11ad('0x13'))('api');var utils=require(_0x11ad('0x14'));var config=require(_0x11ad('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11ad('0x16'))['db'];var dbH=require(_0x11ad('0x16'))[_0x11ad('0x17')];function respondWithStatusCode(_0x5535b7,_0x14893f){_0x14893f=_0x14893f||0xcc;return function(_0x2a4e8c){if(_0x2a4e8c){return _0x5535b7[_0x11ad('0x18')](_0x14893f);}return _0x5535b7['status'](_0x14893f)[_0x11ad('0x19')]();};}function respondWithResult(_0x1fa08a,_0x148bb5){_0x148bb5=_0x148bb5||0xc8;return function(_0x4178ae){if(_0x4178ae){return _0x1fa08a['status'](_0x148bb5)[_0x11ad('0x1a')](_0x4178ae);}};}function respondWithFilteredResult(_0x7a6278,_0x3ea0d4){return function(_0x1d12aa){if(_0x1d12aa){var _0x24418e=typeof _0x3ea0d4[_0x11ad('0x1b')]===_0x11ad('0x1c')&&typeof _0x3ea0d4[_0x11ad('0x1d')]===_0x11ad('0x1c');var _0x5530c0=_0x1d12aa[_0x11ad('0x1e')];var _0x22cf4=_0x24418e?0x0:_0x3ea0d4[_0x11ad('0x1b')];var _0x2bc0cf=_0x24418e?_0x1d12aa[_0x11ad('0x1e')]:_0x3ea0d4['offset']+_0x3ea0d4['limit'];var _0x24a2b9;if(_0x2bc0cf>=_0x5530c0){_0x2bc0cf=_0x5530c0;_0x24a2b9=0xc8;}else{_0x24a2b9=0xce;}_0x7a6278['status'](_0x24a2b9);return _0x7a6278[_0x11ad('0x1f')](_0x11ad('0x20'),_0x22cf4+'-'+_0x2bc0cf+'/'+_0x5530c0)['json'](_0x1d12aa);}return null;};}function patchUpdates(_0x124507){return function(_0x3efb65){try{jsonpatch[_0x11ad('0x21')](_0x3efb65,_0x124507,!![]);}catch(_0x5d1101){return BPromise[_0x11ad('0x22')](_0x5d1101);}return _0x3efb65[_0x11ad('0x23')]();};}function saveUpdates(_0x288ad2,_0x28c7fa){return function(_0x2d9b8e){if(_0x2d9b8e){return _0x2d9b8e['update'](_0x288ad2)[_0x11ad('0x24')](function(_0x44161b){return _0x44161b;});}return null;};}function removeEntity(_0x237fb2,_0x19d8e8){return function(_0x25f139){if(_0x25f139){return _0x25f139[_0x11ad('0x25')]()[_0x11ad('0x24')](function(){var _0x1fdcd9=_0x25f139[_0x11ad('0x26')]({'plain':!![]});var _0x4e3315=_0x11ad('0x27');return db[_0x11ad('0x28')]['destroy']({'where':{'type':_0x4e3315,'resourceId':_0x1fdcd9['id']}})[_0x11ad('0x24')](function(){return _0x25f139;});})['then'](function(){_0x237fb2[_0x11ad('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c61c7,_0x5e0d7c){return function(_0x243591){if(!_0x243591){_0x1c61c7['sendStatus'](0x194);}return _0x243591;};}function handleError(_0x53ce81,_0x5973e6){_0x5973e6=_0x5973e6||0x1f4;return function(_0x54a0cc){logger[_0x11ad('0x2a')](_0x54a0cc['stack']);if(_0x54a0cc['name']){delete _0x54a0cc[_0x11ad('0x2b')];}_0x53ce81[_0x11ad('0x29')](_0x5973e6)[_0x11ad('0x2c')](_0x54a0cc);};}exports['index']=function(_0x544464,_0x165af7){var _0x1891d0={},_0x3c5534={},_0x28e5c9={'count':0x0,'rows':[]};var _0x145a99=_[_0x11ad('0x2d')](db['AnalyticCustomReport'][_0x11ad('0x2e')],function(_0x1d1961){return{'name':_0x1d1961[_0x11ad('0x2f')],'type':_0x1d1961['type']['key']};});_0x3c5534[_0x11ad('0x30')]=_[_0x11ad('0x2d')](_0x145a99,_0x11ad('0x2b'));_0x3c5534[_0x11ad('0x31')]=_[_0x11ad('0x32')](_0x544464[_0x11ad('0x31')]);_0x3c5534[_0x11ad('0x33')]=_['intersection'](_0x3c5534[_0x11ad('0x30')],_0x3c5534[_0x11ad('0x31')]);_0x1891d0[_0x11ad('0x34')]=_[_0x11ad('0x35')](_0x3c5534[_0x11ad('0x30')],qs[_0x11ad('0x36')](_0x544464['query'][_0x11ad('0x36')]));_0x1891d0['attributes']=_0x1891d0['attributes'][_0x11ad('0x37')]?_0x1891d0[_0x11ad('0x34')]:_0x3c5534['model'];if(!_0x544464[_0x11ad('0x31')]['hasOwnProperty']('nolimit')){_0x1891d0[_0x11ad('0x1d')]=qs[_0x11ad('0x1d')](_0x544464[_0x11ad('0x31')][_0x11ad('0x1d')]);_0x1891d0['offset']=qs[_0x11ad('0x1b')](_0x544464[_0x11ad('0x31')][_0x11ad('0x1b')]);}_0x1891d0[_0x11ad('0x38')]=qs[_0x11ad('0x39')](_0x544464[_0x11ad('0x31')][_0x11ad('0x39')]);_0x1891d0[_0x11ad('0x3a')]=qs[_0x11ad('0x33')](_[_0x11ad('0x3b')](_0x544464[_0x11ad('0x31')],_0x3c5534[_0x11ad('0x33')]),_0x145a99);if(_0x544464[_0x11ad('0x31')][_0x11ad('0x3c')]){_0x1891d0[_0x11ad('0x3a')]=_['merge'](_0x1891d0['where'],{'$or':_['map'](_0x145a99,function(_0x51a034){if(_0x51a034[_0x11ad('0x3d')]!==_0x11ad('0x3e')){var _0x2867ec={};_0x2867ec[_0x51a034[_0x11ad('0x2b')]]={'$like':'%'+_0x544464[_0x11ad('0x31')][_0x11ad('0x3c')]+'%'};return _0x2867ec;}})});}_0x1891d0=_[_0x11ad('0x3f')]({},_0x1891d0,_0x544464['options']);var _0x4367ce={'where':_0x1891d0[_0x11ad('0x3a')]};return db[_0x11ad('0x40')]['count'](_0x4367ce)['then'](function(_0x597ae9){_0x28e5c9[_0x11ad('0x1e')]=_0x597ae9;if(_0x544464[_0x11ad('0x31')]['includeAll']){_0x1891d0[_0x11ad('0x41')]=[{'all':!![]}];}return db[_0x11ad('0x40')][_0x11ad('0x42')](_0x1891d0);})[_0x11ad('0x24')](function(_0x2730ba){_0x28e5c9['rows']=_0x2730ba;return _0x28e5c9;})['then'](respondWithFilteredResult(_0x165af7,_0x1891d0))[_0x11ad('0x43')](handleError(_0x165af7,null));};exports[_0x11ad('0x44')]=function(_0xb4ef48,_0x1b0063){var _0x584652={'raw':![],'where':{'id':_0xb4ef48[_0x11ad('0x45')]['id']}},_0x21f8ab={};_0x21f8ab[_0x11ad('0x30')]=_[_0x11ad('0x32')](db[_0x11ad('0x40')]['rawAttributes']);_0x21f8ab[_0x11ad('0x31')]=_['keys'](_0xb4ef48[_0x11ad('0x31')]);_0x21f8ab[_0x11ad('0x33')]=_[_0x11ad('0x35')](_0x21f8ab['model'],_0x21f8ab[_0x11ad('0x31')]);_0x584652[_0x11ad('0x34')]=_[_0x11ad('0x35')](_0x21f8ab[_0x11ad('0x30')],qs['fields'](_0xb4ef48[_0x11ad('0x31')][_0x11ad('0x36')]));_0x584652[_0x11ad('0x34')]=_0x584652[_0x11ad('0x34')][_0x11ad('0x37')]?_0x584652[_0x11ad('0x34')]:_0x21f8ab[_0x11ad('0x30')];if(_0xb4ef48['query']['includeAll']){_0x584652[_0x11ad('0x41')]=[{'all':!![]}];}_0x584652=_['merge']({},_0x584652,_0xb4ef48[_0x11ad('0x46')]);return db['AnalyticCustomReport'][_0x11ad('0x47')](_0x584652)['then'](handleEntityNotFound(_0x1b0063,null))['then'](respondWithResult(_0x1b0063,null))[_0x11ad('0x43')](handleError(_0x1b0063,null));};exports[_0x11ad('0x48')]=function(_0x2efdd5,_0x269892){return db[_0x11ad('0x40')]['create'](_0x2efdd5[_0x11ad('0x49')],{})['then'](function(_0x1bd09d){var _0x52d67a=_0x2efdd5[_0x11ad('0x4a')][_0x11ad('0x26')]({'plain':!![]});if(!_0x52d67a)throw new Error(_0x11ad('0x4b'));if(_0x52d67a['role']==='user'){var _0x14bfee=_0x1bd09d[_0x11ad('0x26')]({'plain':!![]});var _0x24ae27='Reports';return db[_0x11ad('0x4c')][_0x11ad('0x47')]({'where':{'name':_0x24ae27,'userProfileId':_0x52d67a['userProfileId']},'raw':!![]})[_0x11ad('0x24')](function(_0x526310){if(_0x526310&&_0x526310[_0x11ad('0x4d')]===0x0){return db[_0x11ad('0x28')]['create']({'name':_0x14bfee[_0x11ad('0x2b')],'resourceId':_0x14bfee['id'],'type':'CustomReports','sectionId':_0x526310['id']},{})['then'](function(){return _0x1bd09d;});}else{return _0x1bd09d;}})['catch'](function(_0x14d7be){logger[_0x11ad('0x2a')](_0x11ad('0x4e'),_0x14d7be);throw _0x14d7be;});}return _0x1bd09d;})['then'](respondWithResult(_0x269892,0xc9))[_0x11ad('0x43')](handleError(_0x269892,null));};exports[_0x11ad('0x4f')]=function(_0x5d2921,_0x33080b){if(_0x5d2921[_0x11ad('0x49')]['id']){delete _0x5d2921[_0x11ad('0x49')]['id'];}return db[_0x11ad('0x40')][_0x11ad('0x47')]({'where':{'id':_0x5d2921['params']['id']}})['then'](handleEntityNotFound(_0x33080b,null))[_0x11ad('0x24')](saveUpdates(_0x5d2921['body'],null))[_0x11ad('0x24')](respondWithResult(_0x33080b,null))[_0x11ad('0x43')](handleError(_0x33080b,null));};exports[_0x11ad('0x25')]=function(_0x8d8b4a,_0x292c2e){return db[_0x11ad('0x40')][_0x11ad('0x47')]({'where':{'id':_0x8d8b4a[_0x11ad('0x45')]['id']}})[_0x11ad('0x24')](handleEntityNotFound(_0x292c2e,null))[_0x11ad('0x24')](removeEntity(_0x292c2e,null))[_0x11ad('0x43')](handleError(_0x292c2e,null));};exports[_0x11ad('0x50')]=function(_0x3685f0,_0x1801a4){var _0x2dc078=0xa;var _0x55a8ee=[_0x11ad('0x51'),_0x11ad('0x52'),'right_join',_0x11ad('0x53')];var _0x56b889={'SUM':_0x11ad('0x54'),'COUNT':_0x11ad('0x55'),'COUNT DISTINCT':_0x11ad('0x56'),'MAX':_0x11ad('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x11ad('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x11ad('0x59')};var _0x54a238={'SEC_TO_TIME':_0x11ad('0x5a'),'DATE':_0x11ad('0x5b'),'HOUR':_0x11ad('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x11ad('0x5d')};var _0x4890d9=function(_0x578b5a){return!_[_0x11ad('0x5e')]([_0x11ad('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x578b5a);};var _0x5299a0=function(_0x2c94f7){if(!_0x2c94f7||!_0x2c94f7[_0x11ad('0x60')][_0x11ad('0x37')]){return'';}for(var _0x22baf4='(',_0xc20999=0x0;_0xc20999<_0x2c94f7[_0x11ad('0x60')]['length'];_0xc20999+=0x1){_0xc20999>0x0&&(_0x22baf4+='\x20'+_0x2c94f7[_0x11ad('0x61')]+'\x20');_0x22baf4+=_0x2c94f7[_0x11ad('0x60')][_0xc20999][_0x11ad('0x62')]?_0x5299a0(_0x2c94f7['rules'][_0xc20999][_0x11ad('0x62')]):_0x2c94f7[_0x11ad('0x60')][_0xc20999][_0x11ad('0x63')]+'\x20'+_0x2c94f7[_0x11ad('0x60')][_0xc20999][_0x11ad('0x64')]+(_0x4890d9(_0x2c94f7[_0x11ad('0x60')][_0xc20999]['condition'])?'\x20'+_0x2c94f7['rules'][_0xc20999][_0x11ad('0x65')]:'');}return _0x22baf4+')';};var _0x56141e={'where':{'id':_0x3685f0[_0x11ad('0x45')]['id']}},_0x112ab5,_0x325ec5,_0x2bdf9a,_0x1ea0e5,_0x2f7734;_0x56141e=_[_0x11ad('0x3f')]({},_0x56141e,_0x3685f0['options']);return db[_0x11ad('0x40')][_0x11ad('0x47')](_0x56141e)[_0x11ad('0x24')](function(_0x356749){if(_0x356749){_0x112ab5=_0x356749;return _0x356749['getFields']();}return null;})[_0x11ad('0x24')](function(_0x27cb25){if(_0x27cb25){if(!_0x27cb25[_0x11ad('0x37')]){throw new db['Sequelize'][(_0x11ad('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x325ec5=_0x27cb25;return db[_0x11ad('0x67')][_0x11ad('0x42')]({'raw':!![]});}return null;})['then'](function(_0x40b9aa){if(_0x40b9aa){_0x2bdf9a=_['keyBy'](_0x40b9aa,'id');var _0x27a764;var _0x12b27d=squel[_0x11ad('0x68')]();_0x12b27d[_0x11ad('0x69')](_0x112ab5[_0x11ad('0x6a')]);for(var _0xafddb2=0x0;_0xafddb2<_0x325ec5[_0x11ad('0x37')];_0xafddb2+=0x1){_0x27a764=_0x325ec5[_0xafddb2][_0x11ad('0x6b')]?_0x2bdf9a[_0x325ec5[_0xafddb2][_0x11ad('0x6b')]][_0x11ad('0x6c')]:_0x325ec5[_0xafddb2]['field'];_0x27a764=_0x325ec5[_0xafddb2][_0x11ad('0x6d')]?_[_0x11ad('0x6e')](_0x56b889[_0x325ec5[_0xafddb2]['function']],'%s',_0x27a764):_0x27a764;_0x27a764=_0x325ec5[_0xafddb2][_0x11ad('0x6f')]?_[_0x11ad('0x6e')](_0x54a238[_0x325ec5[_0xafddb2][_0x11ad('0x6f')]],'%s',_0x27a764):_0x27a764;if(_0x325ec5[_0xafddb2][_0x11ad('0x70')]){_0x12b27d[_0x11ad('0x62')](_0x27a764);}_0x325ec5[_0xafddb2][_0x11ad('0x71')]&&_0x12b27d['order'](_0x27a764,_0x325ec5[_0xafddb2]['orderBy']===_0x11ad('0x72')?![]:!![]);_0x12b27d[_0x11ad('0x63')](_0x27a764,_0x325ec5[_0xafddb2]['alias']||_0x27a764);}if(_0x112ab5[_0x11ad('0x73')]){_0x112ab5[_0x11ad('0x73')]=JSON[_0x11ad('0x74')](_0x112ab5[_0x11ad('0x73')]);for(var _0x187cf1=0x0;_0x187cf1<_0x112ab5[_0x11ad('0x73')][_0x11ad('0x37')];_0x187cf1+=0x1){if(_0x112ab5['joins'][_0x187cf1][_0x11ad('0x3d')]&&_['includes'](_0x55a8ee,_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x3d')])&&_0x112ab5[_0x11ad('0x73')][_0x187cf1]['parentKey']&&_0x112ab5['joins'][_0x187cf1]['foreignTable']&&_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x75')]){_0x12b27d[_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x3d')]](_0x112ab5['joins'][_0x187cf1][_0x11ad('0x76')],null,util[_0x11ad('0x6f')](_0x11ad('0x77'),_0x112ab5['table'],_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x78')],_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x76')],_0x112ab5[_0x11ad('0x73')][_0x187cf1][_0x11ad('0x75')]));}}}if(_0x112ab5[_0x11ad('0x79')]){_0x112ab5[_0x11ad('0x79')]=JSON['parse'](_0x112ab5['conditions']);_0x12b27d[_0x11ad('0x3a')](_0x5299a0(_0x112ab5[_0x11ad('0x79')][_0x11ad('0x62')]));}_0x2f7734=_0x12b27d[_0x11ad('0x7a')]();_0x12b27d['limit'](_0x2dc078);_0x12b27d['offset'](0x0);logger[_0x11ad('0x7b')](_0x11ad('0x7c'),_0x12b27d[_0x11ad('0x7d')]());return dbH[_0x11ad('0x7e')]['query'](_0x12b27d[_0x11ad('0x7d')](),{'type':dbH[_0x11ad('0x7e')]['QueryTypes'][_0x11ad('0x7f')]});}})[_0x11ad('0x24')](respondWithResult(_0x1801a4,null))[_0x11ad('0x43')](handleError(_0x1801a4,null));};function runReport(_0x52ffc8,_0x44485c,_0x58530a){var _0x9a5715=_0x44485c[_0x11ad('0x2b')];var _0x48d068=0xa;var _0x3fea0b=[_0x11ad('0x51'),_0x11ad('0x52'),_0x11ad('0x80'),'cross_join'];var _0x290af6={'SUM':_0x11ad('0x54'),'COUNT':_0x11ad('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x11ad('0x81'),'AVG':_0x11ad('0x82'),'GROUP_CONCAT':_0x11ad('0x58'),'GROUP_CONCAT ASC':_0x11ad('0x83'),'GROUP_CONCAT DESC':_0x11ad('0x59')};var _0x219654={'SEC_TO_TIME':_0x11ad('0x5a'),'DATE':_0x11ad('0x5b'),'HOUR':_0x11ad('0x5c'),'ROUND':_0x11ad('0x84'),'UNIX_TIMESTAMP':_0x11ad('0x5d')};var _0x5a1948=function(_0xf5df5e){return!_['includes']([_0x11ad('0x5f'),_0x11ad('0x85'),'IS\x20EMPTY',_0x11ad('0x86')],_0xf5df5e);};var _0x4410e6=function(_0x4d6b42){if(!_0x4d6b42||!_0x4d6b42['rules'][_0x11ad('0x37')]){return'';}for(var _0x2b8c43='(',_0x161d1e=0x0;_0x161d1e<_0x4d6b42[_0x11ad('0x60')][_0x11ad('0x37')];_0x161d1e+=0x1){_0x161d1e>0x0&&(_0x2b8c43+='\x20'+_0x4d6b42[_0x11ad('0x61')]+'\x20');_0x2b8c43+=_0x4d6b42['rules'][_0x161d1e]['group']?_0x4410e6(_0x4d6b42['rules'][_0x161d1e][_0x11ad('0x62')]):_0x4d6b42[_0x11ad('0x60')][_0x161d1e][_0x11ad('0x63')]+'\x20'+_0x4d6b42[_0x11ad('0x60')][_0x161d1e]['condition']+(_0x5a1948(_0x4d6b42['rules'][_0x161d1e][_0x11ad('0x64')])?'\x20'+_0x4d6b42[_0x11ad('0x60')][_0x161d1e][_0x11ad('0x65')]:'');}return _0x2b8c43+')';};var _0x4fe5be={'where':{'id':_0x52ffc8['id']}},_0xa1afb8,_0x2eea89,_0x1ab5b8,_0x4b00ad,_0x401734;_0x4fe5be=_[_0x11ad('0x3f')]({},_0x4fe5be,_0x58530a);return db[_0x11ad('0x40')][_0x11ad('0x47')](_0x4fe5be)[_0x11ad('0x24')](function(_0x59542a){if(_0x59542a){_0xa1afb8=_0x59542a;return _0x59542a[_0x11ad('0x87')]();}return null;})['then'](function(_0x55c894){if(_0x55c894){if(!_0x55c894[_0x11ad('0x37')]){throw new db[(_0x11ad('0x88'))][(_0x11ad('0x66'))](_0x11ad('0x89'),0x193);}_0x2eea89=_0x55c894;return db['AnalyticMetric'][_0x11ad('0x42')]({'raw':!![]});}return null;})['then'](function(_0x1c2944){if(_0x1c2944){_0x1ab5b8=_[_0x11ad('0x8a')](_0x1c2944,'id');var _0x29d663;var _0x2dd2f6=squel[_0x11ad('0x68')]();_0x2dd2f6['from'](_0xa1afb8[_0x11ad('0x6a')]);for(var _0x3cb484=0x0;_0x3cb484<_0x2eea89[_0x11ad('0x37')];_0x3cb484+=0x1){_0x29d663=_0x2eea89[_0x3cb484][_0x11ad('0x6b')]?_0x1ab5b8[_0x2eea89[_0x3cb484][_0x11ad('0x6b')]][_0x11ad('0x6c')]:_0x2eea89[_0x3cb484][_0x11ad('0x63')];_0x29d663=_0x2eea89[_0x3cb484][_0x11ad('0x6d')]?_[_0x11ad('0x6e')](_0x290af6[_0x2eea89[_0x3cb484][_0x11ad('0x6d')]],'%s',_0x29d663):_0x29d663;_0x29d663=_0x2eea89[_0x3cb484]['format']?_[_0x11ad('0x6e')](_0x219654[_0x2eea89[_0x3cb484][_0x11ad('0x6f')]],'%s',_0x29d663):_0x29d663;if(_0x2eea89[_0x3cb484][_0x11ad('0x70')]){_0x2dd2f6['group'](_0x29d663);}_0x2eea89[_0x3cb484]['orderBy']&&_0x2dd2f6[_0x11ad('0x38')](_0x29d663,_0x2eea89[_0x3cb484][_0x11ad('0x71')]===_0x11ad('0x72')?![]:!![]);_0x2dd2f6['field'](_0x29d663,_0x2eea89[_0x3cb484][_0x11ad('0x8b')]||_0x29d663);}if(_0xa1afb8[_0x11ad('0x73')]){_0xa1afb8[_0x11ad('0x73')]=JSON[_0x11ad('0x74')](_0xa1afb8['joins']);for(var _0x10ba3b=0x0;_0x10ba3b<_0xa1afb8[_0x11ad('0x73')]['length'];_0x10ba3b+=0x1){if(_0xa1afb8[_0x11ad('0x73')][_0x10ba3b][_0x11ad('0x3d')]&&_[_0x11ad('0x5e')](_0x3fea0b,_0xa1afb8[_0x11ad('0x73')][_0x10ba3b][_0x11ad('0x3d')])&&_0xa1afb8[_0x11ad('0x73')][_0x10ba3b]['parentKey']&&_0xa1afb8['joins'][_0x10ba3b][_0x11ad('0x76')]&&_0xa1afb8[_0x11ad('0x73')][_0x10ba3b]['foreignKey']){_0x2dd2f6[_0xa1afb8[_0x11ad('0x73')][_0x10ba3b][_0x11ad('0x3d')]](_0xa1afb8[_0x11ad('0x73')][_0x10ba3b]['foreignTable'],null,util['format'](_0x11ad('0x77'),_0xa1afb8[_0x11ad('0x6a')],_0xa1afb8['joins'][_0x10ba3b][_0x11ad('0x78')],_0xa1afb8[_0x11ad('0x73')][_0x10ba3b][_0x11ad('0x76')],_0xa1afb8[_0x11ad('0x73')][_0x10ba3b][_0x11ad('0x75')]));}}}if(_0xa1afb8['conditions']){_0xa1afb8['conditions']=JSON['parse'](_0xa1afb8[_0x11ad('0x79')]);_0x2dd2f6[_0x11ad('0x3a')](_0x4410e6(_0xa1afb8[_0x11ad('0x79')][_0x11ad('0x62')]));}_0x401734=_0x2dd2f6[_0x11ad('0x7a')]();_0x2dd2f6[_0x11ad('0x1d')](_0x48d068);_0x2dd2f6['offset'](0x0);return;}})[_0x11ad('0x24')](function(){if(_0x44485c[_0x11ad('0x8c')]===_0x11ad('0x8d')){return null;}var _0x37c152=_[_0x11ad('0x3f')](_0x44485c,{'name':_0x44485c[_0x11ad('0x8e')]||_0x44485c[_0x11ad('0x2b')]||_0xa1afb8['name'],'basename':_0x9a5715,'savename':util[_0x11ad('0x6f')]('%s-%s.%s',_0x44485c[_0x11ad('0x2b')]||_0xa1afb8['name'],require(_0x11ad('0x8f'))['generate'](0x4),_0x44485c[_0x11ad('0x8c')]||_0x11ad('0x90')),'reportId':_0xa1afb8['id'],'reportType':_0x11ad('0x91')});return db[_0x11ad('0x92')][_0x11ad('0x48')](_0x37c152,{'raw':!![]});})[_0x11ad('0x24')](function(_0x1f8e54){if(_0xa1afb8[_0x11ad('0x6a')]===_0x11ad('0x93')){_0x401734[_0x11ad('0x3a')](_0xa1afb8[_0x11ad('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x44485c['startDate'],_0x44485c[_0x11ad('0x94')]);}else{_0x401734['where'](_0xa1afb8[_0x11ad('0x6a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x44485c[_0x11ad('0x95')],_0x44485c[_0x11ad('0x94')]);}if(_0x1f8e54){logger['info'](_0x11ad('0x96'),_0x401734['toString']());require(_0x11ad('0x97'))[_0x11ad('0x98')](path[_0x11ad('0x51')](__dirname,_0x11ad('0x99'),_0x1f8e54[_0x11ad('0x8c')]),[_0x1f8e54['id'],_0x401734[_0x11ad('0x7d')](),path[_0x11ad('0x51')](__dirname,_0x11ad('0x9a'),_0x1f8e54['savename']),_0x9a5715]);return _0x1f8e54;}else{var _0x129fe8=squel['select']();_0x129fe8[_0x11ad('0x69')]('('+_0x401734[_0x11ad('0x7d')]()+')','countTable');_0x129fe8['field'](_0x11ad('0x9b'),_0x11ad('0x1e'));_0x401734['limit'](_0x44485c[_0x11ad('0x1d')]||_0x48d068);_0x401734[_0x11ad('0x1b')](_0x44485c[_0x11ad('0x1b')]||0x0);return dbH[_0x11ad('0x7e')][_0x11ad('0x31')](_0x129fe8[_0x11ad('0x7d')](),{'type':dbH[_0x11ad('0x7e')][_0x11ad('0x9c')][_0x11ad('0x7f')]})[_0x11ad('0x24')](function(_0x228a1a){if(!_0x228a1a[_0x11ad('0x37')]){_0x4b00ad=0x0;}else{_0x4b00ad=_0x228a1a[0x0][_0x11ad('0x1e')]||0x0;}return dbH['sequelize'][_0x11ad('0x31')](_0x401734[_0x11ad('0x7d')](),{'type':dbH[_0x11ad('0x7e')][_0x11ad('0x9c')]['SELECT']});})[_0x11ad('0x24')](function(_0x3fe5c3){return{'rows':_0x3fe5c3||[],'count':_0x4b00ad};});}});}exports['run']=function(_0x3d8671,_0x4e8271){return runReport(_0x3d8671['params'],_0x3d8671[_0x11ad('0x31')],_0x3d8671[_0x11ad('0x46')])[_0x11ad('0x24')](respondWithResult(_0x4e8271,null))[_0x11ad('0x43')](handleError(_0x4e8271,null));};exports[_0x11ad('0x9d')]=runReport;exports['query']=function(_0x196e58,_0x23e236){var _0x2bcb2f=0xa;var _0x4a7371=[_0x11ad('0x51'),_0x11ad('0x52'),_0x11ad('0x80'),_0x11ad('0x53')];var _0x3dacab={'SUM':_0x11ad('0x54'),'COUNT':_0x11ad('0x55'),'COUNT DISTINCT':_0x11ad('0x56'),'MAX':_0x11ad('0x57'),'MIN':_0x11ad('0x81'),'AVG':_0x11ad('0x82'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1dbe91={'SEC_TO_TIME':_0x11ad('0x5a'),'DATE':_0x11ad('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x11ad('0x84'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf5ef3f=function(_0x3cd4a2){return!_[_0x11ad('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x11ad('0x9e'),'IS\x20NOT\x20EMPTY'],_0x3cd4a2);};var _0x18e0e9=function(_0x4561ab){if(!_0x4561ab||!_0x4561ab[_0x11ad('0x60')][_0x11ad('0x37')]){return'';}for(var _0x961c25='(',_0x36eabd=0x0;_0x36eabd<_0x4561ab[_0x11ad('0x60')][_0x11ad('0x37')];_0x36eabd+=0x1){_0x36eabd>0x0&&(_0x961c25+='\x20'+_0x4561ab[_0x11ad('0x61')]+'\x20');_0x961c25+=_0x4561ab['rules'][_0x36eabd][_0x11ad('0x62')]?_0x18e0e9(_0x4561ab['rules'][_0x36eabd]['group']):_0x4561ab['rules'][_0x36eabd]['field']+'\x20'+_0x4561ab[_0x11ad('0x60')][_0x36eabd]['condition']+(_0xf5ef3f(_0x4561ab[_0x11ad('0x60')][_0x36eabd][_0x11ad('0x64')])?'\x20'+_0x4561ab[_0x11ad('0x60')][_0x36eabd][_0x11ad('0x65')]:'');}return _0x961c25+')';};var _0x5221c4={'where':{'id':_0x196e58[_0x11ad('0x45')]['id']}},_0x55902f,_0x3d8c16,_0x383acd,_0x15ed8e,_0x154247;_0x5221c4=_[_0x11ad('0x3f')]({},_0x5221c4,_0x196e58['options']);return db[_0x11ad('0x40')][_0x11ad('0x47')](_0x5221c4)[_0x11ad('0x24')](function(_0x1731ba){if(_0x1731ba){_0x55902f=_0x1731ba;return _0x1731ba['getFields']();}return null;})[_0x11ad('0x24')](function(_0x4a7e72){if(_0x4a7e72){if(!_0x4a7e72[_0x11ad('0x37')]){throw new db[(_0x11ad('0x88'))]['ValidationErrorItem'](_0x11ad('0x89'),0x193);}_0x3d8c16=_0x4a7e72;return db['AnalyticMetric'][_0x11ad('0x42')]({'raw':!![]});}return null;})[_0x11ad('0x24')](function(_0x47f5f5){if(_0x47f5f5){_0x383acd=_[_0x11ad('0x8a')](_0x47f5f5,'id');var _0x4318db;var _0x346b39=squel[_0x11ad('0x68')]();_0x346b39['from'](_0x55902f[_0x11ad('0x6a')]);for(var _0xcc6cd4=0x0;_0xcc6cd4<_0x3d8c16[_0x11ad('0x37')];_0xcc6cd4+=0x1){_0x4318db=_0x3d8c16[_0xcc6cd4][_0x11ad('0x6b')]?_0x383acd[_0x3d8c16[_0xcc6cd4][_0x11ad('0x6b')]][_0x11ad('0x6c')]:_0x3d8c16[_0xcc6cd4][_0x11ad('0x63')];_0x4318db=_0x3d8c16[_0xcc6cd4][_0x11ad('0x6d')]?_[_0x11ad('0x6e')](_0x3dacab[_0x3d8c16[_0xcc6cd4][_0x11ad('0x6d')]],'%s',_0x4318db):_0x4318db;_0x4318db=_0x3d8c16[_0xcc6cd4][_0x11ad('0x6f')]?_['replace'](_0x1dbe91[_0x3d8c16[_0xcc6cd4][_0x11ad('0x6f')]],'%s',_0x4318db):_0x4318db;if(_0x3d8c16[_0xcc6cd4][_0x11ad('0x70')]){_0x346b39['group'](_0x4318db);}_0x3d8c16[_0xcc6cd4][_0x11ad('0x71')]&&_0x346b39[_0x11ad('0x38')](_0x4318db,_0x3d8c16[_0xcc6cd4][_0x11ad('0x71')]===_0x11ad('0x72')?![]:!![]);_0x346b39[_0x11ad('0x63')](_0x4318db,_0x3d8c16[_0xcc6cd4][_0x11ad('0x8b')]||_0x4318db);}if(_0x55902f[_0x11ad('0x73')]){_0x55902f[_0x11ad('0x73')]=JSON['parse'](_0x55902f[_0x11ad('0x73')]);for(var _0x12e44b=0x0;_0x12e44b<_0x55902f[_0x11ad('0x73')][_0x11ad('0x37')];_0x12e44b+=0x1){if(_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x3d')]&&_[_0x11ad('0x5e')](_0x4a7371,_0x55902f[_0x11ad('0x73')][_0x12e44b]['type'])&&_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x78')]&&_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x76')]&&_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x75')]){_0x346b39[_0x55902f[_0x11ad('0x73')][_0x12e44b]['type']](_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x76')],null,util[_0x11ad('0x6f')]('%s.%s\x20=\x20%s.%s',_0x55902f[_0x11ad('0x6a')],_0x55902f[_0x11ad('0x73')][_0x12e44b]['parentKey'],_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x76')],_0x55902f[_0x11ad('0x73')][_0x12e44b][_0x11ad('0x75')]));}}}if(_0x55902f[_0x11ad('0x79')]){_0x55902f[_0x11ad('0x79')]=JSON[_0x11ad('0x74')](_0x55902f[_0x11ad('0x79')]);_0x346b39[_0x11ad('0x3a')](_0x18e0e9(_0x55902f['conditions'][_0x11ad('0x62')]));}_0x154247=_0x346b39['clone']();_0x346b39['limit'](_0x2bcb2f);_0x346b39['offset'](0x0);logger['debug'](_0x11ad('0x7c'),_0x346b39[_0x11ad('0x7d')]());return dbH['sequelize']['query'](_0x346b39[_0x11ad('0x7d')](),{'type':dbH['sequelize'][_0x11ad('0x9c')][_0x11ad('0x7f')]});}})[_0x11ad('0x24')](function(){return{'sql':_0x154247['toString']()};})[_0x11ad('0x24')](respondWithResult(_0x23e236,null))[_0x11ad('0x43')](handleError(_0x23e236,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 15ba92e..31904b7 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 _0x8741=['moment','bluebird','path','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8741,0x173));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1874('0x0'));var logger=require(_0x1874('0x1'))(_0x1874('0x2'));var moment=require(_0x1874('0x3'));var BPromise=require(_0x1874('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1874('0x5'));var rimraf=require(_0x1874('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x1874('0x7')]=function(_0x5ce91a,_0x79f9cf){return _0x5ce91a[_0x1874('0x8')](_0x1874('0x9'),attributes,{'tableName':_0x1874('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd210=['../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util'];(function(_0x262911,_0x31e761){var _0x220842=function(_0x1e942a){while(--_0x1e942a){_0x262911['push'](_0x262911['shift']());}};_0x220842(++_0x31e761);}(_0xd210,0xfb));var _0x0d21=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xd210[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0x0d21('0x0'));var util=require(_0x0d21('0x1'));var logger=require(_0x0d21('0x2'))(_0x0d21('0x3'));var moment=require('moment');var BPromise=require(_0x0d21('0x4'));var rp=require(_0x0d21('0x5'));var fs=require('fs');var path=require(_0x0d21('0x6'));var rimraf=require(_0x0d21('0x7'));var config=require('../../config/environment');var attributes=require(_0x0d21('0x8'));module[_0x0d21('0x9')]=function(_0x1972a0,_0x5dec30){return _0x1972a0['define']('AnalyticCustomReport',attributes,{'tableName':_0x0d21('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 2fe80a8..dbe95c3 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 _0x20ff=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x20ff,0x1c9));var _0xf20f=function(_0x17804d,_0x297381){_0x17804d=_0x17804d-0x0;var _0x27fcc8=_0x20ff[_0x17804d];return _0x27fcc8;};'use strict';var _=require('lodash');var util=require(_0xf20f('0x0'));var moment=require('moment');var BPromise=require(_0xf20f('0x1'));var rs=require(_0xf20f('0x2'));var fs=require('fs');var Redis=require(_0xf20f('0x3'));var db=require(_0xf20f('0x4'))['db'];var utils=require(_0xf20f('0x5'));var logger=require(_0xf20f('0x6'))('rpc');var config=require(_0xf20f('0x7'));var jayson=require(_0xf20f('0x8'));var client=jayson[_0xf20f('0x9')][_0xf20f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c452e,_0x3729a5,_0x191853){return new BPromise(function(_0x458f80,_0x47febc){return client[_0xf20f('0xb')](_0x5c452e,_0x191853)[_0xf20f('0xc')](function(_0x8224f4){logger[_0xf20f('0xd')](_0xf20f('0xe'),_0x3729a5,_0xf20f('0xf'));logger[_0xf20f('0x10')](_0xf20f('0x11'),_0x3729a5,_0xf20f('0xf'),JSON['stringify'](_0x8224f4));if(_0x8224f4['error']){if(_0x8224f4[_0xf20f('0x12')][_0xf20f('0x13')]===0x1f4){logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x3729a5,_0x8224f4[_0xf20f('0x12')][_0xf20f('0x14')]);return _0x47febc(_0x8224f4[_0xf20f('0x12')][_0xf20f('0x14')]);}logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x3729a5,_0x8224f4['error'][_0xf20f('0x14')]);return _0x458f80(_0x8224f4[_0xf20f('0x12')]['message']);}else{logger[_0xf20f('0xd')](_0xf20f('0xe'),_0x3729a5,_0xf20f('0xf'));_0x458f80(_0x8224f4[_0xf20f('0x15')][_0xf20f('0x14')]);}})[_0xf20f('0x16')](function(_0x4029f4){logger[_0xf20f('0x12')](_0xf20f('0xe'),_0x3729a5,_0x4029f4);_0x47febc(_0x4029f4);});});} \ No newline at end of file +var _0x5d68=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1a2745,_0x59ee8e){var _0x2c01be=function(_0x235267){while(--_0x235267){_0x1a2745['push'](_0x1a2745['shift']());}};_0x2c01be(++_0x59ee8e);}(_0x5d68,0xad));var _0x85d6=function(_0x4294ce,_0x277093){_0x4294ce=_0x4294ce-0x0;var _0x232aaa=_0x5d68[_0x4294ce];return _0x232aaa;};'use strict';var _=require('lodash');var util=require(_0x85d6('0x0'));var moment=require(_0x85d6('0x1'));var BPromise=require('bluebird');var rs=require(_0x85d6('0x2'));var fs=require('fs');var Redis=require(_0x85d6('0x3'));var db=require(_0x85d6('0x4'))['db'];var utils=require(_0x85d6('0x5'));var logger=require(_0x85d6('0x6'))(_0x85d6('0x7'));var config=require(_0x85d6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x85d6('0x9')][_0x85d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54bb0f,_0x4c9995,_0x5e362b){return new BPromise(function(_0xeda0ca,_0x4b5731){return client['request'](_0x54bb0f,_0x5e362b)['then'](function(_0x1340e8){logger[_0x85d6('0xb')](_0x85d6('0xc'),_0x4c9995,_0x85d6('0xd'));logger[_0x85d6('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4c9995,_0x85d6('0xd'),JSON[_0x85d6('0xf')](_0x1340e8));if(_0x1340e8['error']){if(_0x1340e8[_0x85d6('0x10')]['code']===0x1f4){logger[_0x85d6('0x10')](_0x85d6('0xc'),_0x4c9995,_0x1340e8[_0x85d6('0x10')]['message']);return _0x4b5731(_0x1340e8[_0x85d6('0x10')][_0x85d6('0x11')]);}logger['error'](_0x85d6('0xc'),_0x4c9995,_0x1340e8[_0x85d6('0x10')][_0x85d6('0x11')]);return _0xeda0ca(_0x1340e8['error'][_0x85d6('0x11')]);}else{logger[_0x85d6('0xb')](_0x85d6('0xc'),_0x4c9995,_0x85d6('0xd'));_0xeda0ca(_0x1340e8[_0x85d6('0x12')][_0x85d6('0x11')]);}})['catch'](function(_0x7cca87){logger[_0x85d6('0x10')](_0x85d6('0xc'),_0x4c9995,_0x7cca87);_0x4b5731(_0x7cca87);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index fa96b10..0fb0398 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 _0xa1b8=['exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','query','post','put','destroy'];(function(_0x132d31,_0x11bd12){var _0x3e0ebe=function(_0x26bba2){while(--_0x26bba2){_0x132d31['push'](_0x132d31['shift']());}};_0x3e0ebe(++_0x11bd12);}(_0xa1b8,0x1e1));var _0x8a1b=function(_0x1c8ac4,_0x559fd8){_0x1c8ac4=_0x1c8ac4-0x0;var _0x466643=_0xa1b8[_0x1c8ac4];return _0x466643;};'use strict';var multer=require(_0x8a1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a1b('0x1'));var express=require('express');var router=express[_0x8a1b('0x2')]();var fs_extra=require(_0x8a1b('0x3'));var auth=require(_0x8a1b('0x4'));var interaction=require(_0x8a1b('0x5'));var config=require(_0x8a1b('0x6'));var controller=require(_0x8a1b('0x7'));router[_0x8a1b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8a1b('0x8')](_0x8a1b('0x9'),auth[_0x8a1b('0xa')](),controller['show']);router[_0x8a1b('0x8')](_0x8a1b('0xb'),auth[_0x8a1b('0xa')](),controller[_0x8a1b('0xc')]);router[_0x8a1b('0x8')](_0x8a1b('0xd'),auth[_0x8a1b('0xa')](),controller[_0x8a1b('0xe')]);router[_0x8a1b('0x8')]('/:id/query',auth[_0x8a1b('0xa')](),controller[_0x8a1b('0xf')]);router[_0x8a1b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8a1b('0x11')]('/:id',auth[_0x8a1b('0xa')](),controller['update']);router['delete']('/:id',auth[_0x8a1b('0xa')](),controller[_0x8a1b('0x12')]);module[_0x8a1b('0x13')]=router; \ No newline at end of file +var _0xdba6=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','preview','run','/:id/query','put','destroy','exports','multer','util','connect-timeout'];(function(_0x3da52e,_0x47abeb){var _0x238523=function(_0x1c3ce2){while(--_0x1c3ce2){_0x3da52e['push'](_0x3da52e['shift']());}};_0x238523(++_0x47abeb);}(_0xdba6,0x75));var _0x6dba=function(_0x168264,_0x323e43){_0x168264=_0x168264-0x0;var _0x29a1c7=_0xdba6[_0x168264];return _0x29a1c7;};'use strict';var multer=require(_0x6dba('0x0'));var util=require(_0x6dba('0x1'));var path=require('path');var timeout=require(_0x6dba('0x2'));var express=require('express');var router=express[_0x6dba('0x3')]();var fs_extra=require(_0x6dba('0x4'));var auth=require(_0x6dba('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6dba('0x6'));var controller=require(_0x6dba('0x7'));router[_0x6dba('0x8')]('/',auth['isAuthenticated'](),controller[_0x6dba('0x9')]);router['get'](_0x6dba('0xa'),auth['isAuthenticated'](),controller[_0x6dba('0xb')]);router[_0x6dba('0x8')](_0x6dba('0xc'),auth[_0x6dba('0xd')](),controller[_0x6dba('0xe')]);router[_0x6dba('0x8')]('/:id/run',auth[_0x6dba('0xd')](),controller[_0x6dba('0xf')]);router[_0x6dba('0x8')](_0x6dba('0x10'),auth[_0x6dba('0xd')](),controller['query']);router['post']('/',auth[_0x6dba('0xd')](),controller['create']);router[_0x6dba('0x11')](_0x6dba('0xa'),auth[_0x6dba('0xd')](),controller['update']);router['delete'](_0x6dba('0xa'),auth[_0x6dba('0xd')](),controller[_0x6dba('0x12')]);module[_0x6dba('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index f919c27..9557957 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x1f909a,_0x15d56f){var _0x543f16=function(_0x17a991){while(--_0x17a991){_0x1f909a['push'](_0x1f909a['shift']());}};_0x543f16(++_0x15d56f);}(_0x5075,0x73));var _0x5507=function(_0x51a85c,_0x2660a3){_0x51a85c=_0x51a85c-0x0;var _0x55001f=_0x5075[_0x51a85c];return _0x55001f;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x1c661b,_0x153a64){var _0x59ae7d=function(_0x38f565){while(--_0x38f565){_0x1c661b['push'](_0x1c661b['shift']());}};_0x59ae7d(++_0x153a64);}(_0x31f0,0xb7));var _0x031f=function(_0x4dbcd4,_0x5db48e){_0x4dbcd4=_0x4dbcd4-0x0;var _0x4e0517=_0x31f0[_0x4dbcd4];return _0x4e0517;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 464e29e..8a03100 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 _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(_0x4ae459,_0x3bf329){var _0x51d0c9=function(_0x1ce66b){while(--_0x1ce66b){_0x4ae459['push'](_0x4ae459['shift']());}};_0x51d0c9(++_0x3bf329);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'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 +var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x3d0366,_0x50211a){var _0x5ce75e=function(_0xc70777){while(--_0xc70777){_0x3d0366['push'](_0x3d0366['shift']());}};_0x5ce75e(++_0x50211a);}(_0x4819,0xcd));var _0x9481=function(_0x34951f,_0x277327){_0x34951f=_0x34951f-0x0;var _0x487db1=_0x4819[_0x34951f];return _0x487db1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 9119ea4..c3e720a 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 _0xb85e=['../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb85e,0xd1));var _0xeb85=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0xb85e[_0x5645ad];return _0x17d292;};'use strict';var _=require('lodash');var util=require(_0xeb85('0x0'));var logger=require(_0xeb85('0x1'))('api');var moment=require(_0xeb85('0x2'));var BPromise=require(_0xeb85('0x3'));var rp=require(_0xeb85('0x4'));var fs=require('fs');var path=require(_0xeb85('0x5'));var rimraf=require(_0xeb85('0x6'));var config=require(_0xeb85('0x7'));var attributes=require(_0xeb85('0x8'));module[_0xeb85('0x9')]=function(_0x59088c,_0xbf550d){return _0x59088c[_0xeb85('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xeb85('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7394=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x401a04,_0x27cd04){var _0x469676=function(_0x39aea1){while(--_0x39aea1){_0x401a04['push'](_0x401a04['shift']());}};_0x469676(++_0x27cd04);}(_0x7394,0x10c));var _0x4739=function(_0x4b2b95,_0x3e21a2){_0x4b2b95=_0x4b2b95-0x0;var _0x2b12dd=_0x7394[_0x4b2b95];return _0x2b12dd;};'use strict';var _=require('lodash');var util=require(_0x4739('0x0'));var logger=require(_0x4739('0x1'))(_0x4739('0x2'));var moment=require(_0x4739('0x3'));var BPromise=require(_0x4739('0x4'));var rp=require(_0x4739('0x5'));var fs=require('fs');var path=require(_0x4739('0x6'));var rimraf=require(_0x4739('0x7'));var config=require(_0x4739('0x8'));var attributes=require(_0x4739('0x9'));module['exports']=function(_0x4c88db,_0x247aae){return _0x4c88db[_0x4739('0xa')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index e65b2c4..7611ef1 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 _0x086c=['rpc','../../config/environment','jayson/promise','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x54ac2b,_0x51f6dd){var _0x5b1586=function(_0x11912d){while(--_0x11912d){_0x54ac2b['push'](_0x54ac2b['shift']());}};_0x5b1586(++_0x51f6dd);}(_0x086c,0xfa));var _0xc086=function(_0x353856,_0x5ce89d){_0x353856=_0x353856-0x0;var _0xa58048=_0x086c[_0x353856];return _0xa58048;};'use strict';var _=require(_0xc086('0x0'));var util=require('util');var moment=require(_0xc086('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc086('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc086('0x3'));var logger=require(_0xc086('0x4'))(_0xc086('0x5'));var config=require(_0xc086('0x6'));var jayson=require(_0xc086('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce271,_0x5509bb,_0x2853c8){return new BPromise(function(_0x5b72a7,_0x5c1bb7){return client['request'](_0x1ce271,_0x2853c8)['then'](function(_0x14e325){logger[_0xc086('0x8')](_0xc086('0x9'),_0x5509bb,_0xc086('0xa'));logger[_0xc086('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5509bb,_0xc086('0xa'),JSON[_0xc086('0xc')](_0x14e325));if(_0x14e325[_0xc086('0xd')]){if(_0x14e325['error']['code']===0x1f4){logger[_0xc086('0xd')](_0xc086('0x9'),_0x5509bb,_0x14e325[_0xc086('0xd')][_0xc086('0xe')]);return _0x5c1bb7(_0x14e325[_0xc086('0xd')][_0xc086('0xe')]);}logger[_0xc086('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5509bb,_0x14e325[_0xc086('0xd')][_0xc086('0xe')]);return _0x5b72a7(_0x14e325[_0xc086('0xd')]['message']);}else{logger[_0xc086('0x8')](_0xc086('0x9'),_0x5509bb,'request\x20sent');_0x5b72a7(_0x14e325[_0xc086('0xf')][_0xc086('0xe')]);}})[_0xc086('0x10')](function(_0x15542b){logger['error'](_0xc086('0x9'),_0x5509bb,_0x15542b);_0x5c1bb7(_0x15542b);});});} \ No newline at end of file +var _0x68ed=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x68ed,0x86));var _0xd68e=function(_0x2b4b83,_0x3378a4){_0x2b4b83=_0x2b4b83-0x0;var _0x5ab8de=_0x68ed[_0x2b4b83];return _0x5ab8de;};'use strict';var _=require(_0xd68e('0x0'));var util=require(_0xd68e('0x1'));var moment=require('moment');var BPromise=require(_0xd68e('0x2'));var rs=require(_0xd68e('0x3'));var fs=require('fs');var Redis=require(_0xd68e('0x4'));var db=require(_0xd68e('0x5'))['db'];var utils=require(_0xd68e('0x6'));var logger=require(_0xd68e('0x7'))(_0xd68e('0x8'));var config=require(_0xd68e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd68e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14e470,_0x23d3d2,_0x34b034){return new BPromise(function(_0x3f704b,_0x512dcc){return client[_0xd68e('0xb')](_0x14e470,_0x34b034)['then'](function(_0x56ceee){logger[_0xd68e('0xc')](_0xd68e('0xd'),_0x23d3d2,_0xd68e('0xe'));logger[_0xd68e('0xf')](_0xd68e('0x10'),_0x23d3d2,_0xd68e('0xe'),JSON[_0xd68e('0x11')](_0x56ceee));if(_0x56ceee['error']){if(_0x56ceee[_0xd68e('0x12')][_0xd68e('0x13')]===0x1f4){logger[_0xd68e('0x12')](_0xd68e('0xd'),_0x23d3d2,_0x56ceee[_0xd68e('0x12')][_0xd68e('0x14')]);return _0x512dcc(_0x56ceee['error'][_0xd68e('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x23d3d2,_0x56ceee['error'][_0xd68e('0x14')]);return _0x3f704b(_0x56ceee[_0xd68e('0x12')][_0xd68e('0x14')]);}else{logger[_0xd68e('0xc')](_0xd68e('0xd'),_0x23d3d2,_0xd68e('0xe'));_0x3f704b(_0x56ceee[_0xd68e('0x15')][_0xd68e('0x14')]);}})[_0xd68e('0x16')](function(_0x24c411){logger['error'](_0xd68e('0xd'),_0x23d3d2,_0x24c411);_0x512dcc(_0x24c411);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0227dac..b7038a2 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 _0x352d=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','put','update','delete','destroy','multer'];(function(_0x4dda11,_0x4fc4c4){var _0x5a61a2=function(_0x45fe5c){while(--_0x45fe5c){_0x4dda11['push'](_0x4dda11['shift']());}};_0x5a61a2(++_0x4fc4c4);}(_0x352d,0x133));var _0xd352=function(_0x3ce6e8,_0x150292){_0x3ce6e8=_0x3ce6e8-0x0;var _0x214088=_0x352d[_0x3ce6e8];return _0x214088;};'use strict';var multer=require(_0xd352('0x0'));var util=require(_0xd352('0x1'));var path=require(_0xd352('0x2'));var timeout=require(_0xd352('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd352('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd352('0x5'));var config=require(_0xd352('0x6'));var controller=require(_0xd352('0x7'));router[_0xd352('0x8')]('/',auth[_0xd352('0x9')](),controller[_0xd352('0xa')]);router['get'](_0xd352('0xb'),auth[_0xd352('0x9')](),controller[_0xd352('0xc')]);router[_0xd352('0x8')](_0xd352('0xd'),auth[_0xd352('0x9')](),controller['preview']);router[_0xd352('0x8')](_0xd352('0xe'),auth[_0xd352('0x9')](),controller[_0xd352('0xf')]);router[_0xd352('0x8')](_0xd352('0x10'),auth['isAuthenticated'](),controller['query']);router[_0xd352('0x11')]('/',auth[_0xd352('0x9')](),controller['create']);router[_0xd352('0x12')](_0xd352('0xb'),auth[_0xd352('0x9')](),controller[_0xd352('0x13')]);router[_0xd352('0x14')](_0xd352('0xb'),auth['isAuthenticated'](),controller[_0xd352('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9e55=['express','Router','../../components/auth/service','../../config/environment','index','isAuthenticated','show','get','/:id/preview','preview','/:id/run','run','query','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x9e55,0xee));var _0x59e5=function(_0x2e6c3d,_0x3a18bb){_0x2e6c3d=_0x2e6c3d-0x0;var _0x3332ca=_0x9e55[_0x2e6c3d];return _0x3332ca;};'use strict';var multer=require(_0x59e5('0x0'));var util=require(_0x59e5('0x1'));var path=require(_0x59e5('0x2'));var timeout=require(_0x59e5('0x3'));var express=require(_0x59e5('0x4'));var router=express[_0x59e5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x59e5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x59e5('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x59e5('0x8')]);router['get']('/:id',auth[_0x59e5('0x9')](),controller[_0x59e5('0xa')]);router[_0x59e5('0xb')](_0x59e5('0xc'),auth[_0x59e5('0x9')](),controller[_0x59e5('0xd')]);router['get'](_0x59e5('0xe'),auth[_0x59e5('0x9')](),controller[_0x59e5('0xf')]);router[_0x59e5('0xb')]('/:id/query',auth[_0x59e5('0x9')](),controller[_0x59e5('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x59e5('0x11')](_0x59e5('0x12'),auth[_0x59e5('0x9')](),controller['update']);router[_0x59e5('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x59e5('0x14')]);module[_0x59e5('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a70b464..c49b6c5 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 _0x31da=['manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x31da,0x1c7));var _0xa31d=function(_0x3cd0c2,_0x1c341d){_0x3cd0c2=_0x3cd0c2-0x0;var _0x128d9f=_0x31da[_0x3cd0c2];return _0x128d9f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa31d('0x0'));module[_0xa31d('0x1')]={'name':{'type':Sequelize[_0xa31d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa31d('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa31d('0x3'),_0xa31d('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xa31d('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xa31d('0x5')]},'status':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':_0xa31d('0x6')},'type':{'type':Sequelize['ENUM'](_0xa31d('0x7'),_0xa31d('0x8')),'allowNull':![],'defaultValue':_0xa31d('0x7')},'reportId':{'type':Sequelize[_0xa31d('0x9')](0xb)[_0xa31d('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa943=['STRING','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','ENUM','csv','pdf','xlsx'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa943,0x17b));var _0x3a94=function(_0x260ef1,_0x2f628a){_0x260ef1=_0x260ef1-0x0;var _0x52cd97=_0xa943[_0x260ef1];return _0x52cd97;};'use strict';var Sequelize=require(_0x3a94('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x3a94('0x1')](_0x3a94('0x2'),_0x3a94('0x3'),_0x3a94('0x4')),'allowNull':![],'defaultValue':_0x3a94('0x2')},'savename':{'type':Sequelize[_0x3a94('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3a94('0x6')]},'endDate':{'type':Sequelize[_0x3a94('0x6')]},'status':{'type':Sequelize[_0x3a94('0x5')],'defaultValue':_0x3a94('0x7')},'type':{'type':Sequelize[_0x3a94('0x1')]('manual',_0x3a94('0x8')),'allowNull':![],'defaultValue':_0x3a94('0x9')},'reportId':{'type':Sequelize[_0x3a94('0xa')](0xb)[_0x3a94('0xb')]},'reportType':{'type':Sequelize[_0x3a94('0x5')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5333220..60ef2db 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 _0x37a0=['send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','join','root','server/files/reports','ValidationError','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','name'];(function(_0x487524,_0x292ba6){var _0x3f3543=function(_0xaba548){while(--_0xaba548){_0x487524['push'](_0x487524['shift']());}};_0x3f3543(++_0x292ba6);}(_0x37a0,0x154));var _0x037a=function(_0x463d18,_0x370389){_0x463d18=_0x463d18-0x0;var _0x4acce6=_0x37a0[_0x463d18];return _0x4acce6;};'use strict';var emlformat=require(_0x037a('0x0'));var rimraf=require(_0x037a('0x1'));var zipdir=require(_0x037a('0x2'));var jsonpatch=require(_0x037a('0x3'));var rp=require(_0x037a('0x4'));var moment=require('moment');var BPromise=require(_0x037a('0x5'));var Mustache=require(_0x037a('0x6'));var util=require(_0x037a('0x7'));var path=require(_0x037a('0x8'));var sox=require(_0x037a('0x9'));var csv=require('to-csv');var ejs=require(_0x037a('0xa'));var fs=require('fs');var fs_extra=require(_0x037a('0xb'));var _=require(_0x037a('0xc'));var squel=require(_0x037a('0xd'));var crypto=require(_0x037a('0xe'));var jsforce=require(_0x037a('0xf'));var deskjs=require(_0x037a('0x10'));var toCsv=require(_0x037a('0x11'));var querystring=require('querystring');var Papa=require(_0x037a('0x12'));var Redis=require('ioredis');var authService=require(_0x037a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x037a('0x14'));var logger=require('../../config/logger')(_0x037a('0x15'));var utils=require(_0x037a('0x16'));var config=require(_0x037a('0x17'));var licenseUtil=require(_0x037a('0x18'));var db=require(_0x037a('0x19'))['db'];function respondWithStatusCode(_0x4d9773,_0x256bb8){_0x256bb8=_0x256bb8||0xcc;return function(_0x31ece8){if(_0x31ece8){return _0x4d9773[_0x037a('0x1a')](_0x256bb8);}return _0x4d9773[_0x037a('0x1b')](_0x256bb8)[_0x037a('0x1c')]();};}function respondWithResult(_0x227f6c,_0x510585){_0x510585=_0x510585||0xc8;return function(_0x3fdf36){if(_0x3fdf36){return _0x227f6c[_0x037a('0x1b')](_0x510585)['json'](_0x3fdf36);}};}function respondWithFilteredResult(_0x36f11c,_0x5754c2){return function(_0x8a7320){if(_0x8a7320){var _0x2873ca=typeof _0x5754c2['offset']==='undefined'&&typeof _0x5754c2[_0x037a('0x1d')]===_0x037a('0x1e');var _0x214607=_0x8a7320[_0x037a('0x1f')];var _0x845696=_0x2873ca?0x0:_0x5754c2[_0x037a('0x20')];var _0x3e8472=_0x2873ca?_0x8a7320[_0x037a('0x1f')]:_0x5754c2['offset']+_0x5754c2[_0x037a('0x1d')];var _0x25e0df;if(_0x3e8472>=_0x214607){_0x3e8472=_0x214607;_0x25e0df=0xc8;}else{_0x25e0df=0xce;}_0x36f11c[_0x037a('0x1b')](_0x25e0df);return _0x36f11c['set']('Content-Range',_0x845696+'-'+_0x3e8472+'/'+_0x214607)[_0x037a('0x21')](_0x8a7320);}return null;};}function patchUpdates(_0x44278c){return function(_0x2ab1df){try{jsonpatch[_0x037a('0x22')](_0x2ab1df,_0x44278c,!![]);}catch(_0x4c7626){return BPromise[_0x037a('0x23')](_0x4c7626);}return _0x2ab1df[_0x037a('0x24')]();};}function saveUpdates(_0x98a23d,_0x158787){return function(_0x7f3207){if(_0x7f3207){return _0x7f3207[_0x037a('0x25')](_0x98a23d)[_0x037a('0x26')](function(_0x5d462e){return _0x5d462e;});}return null;};}function removeEntity(_0x50d951,_0x2be144){return function(_0x2d228e){if(_0x2d228e){return _0x2d228e['destroy']()[_0x037a('0x26')](function(){var _0x3b4db6=_0x2d228e[_0x037a('0x27')]({'plain':!![]});var _0x12097d=_0x037a('0x28');return db[_0x037a('0x29')][_0x037a('0x2a')]({'where':{'type':_0x12097d,'resourceId':_0x3b4db6['id']}})['then'](function(){return _0x2d228e;});})[_0x037a('0x26')](function(){_0x50d951['status'](0xcc)[_0x037a('0x1c')]();});}};}function handleEntityNotFound(_0x4aefad,_0x460ab8){return function(_0x5a79cb){if(!_0x5a79cb){_0x4aefad[_0x037a('0x1a')](0x194);}return _0x5a79cb;};}function handleError(_0x8ec530,_0x5f53bc){_0x5f53bc=_0x5f53bc||0x1f4;return function(_0x58a6a5){logger['error'](_0x58a6a5['stack']);if(_0x58a6a5[_0x037a('0x2b')]){delete _0x58a6a5['name'];}_0x8ec530[_0x037a('0x1b')](_0x5f53bc)[_0x037a('0x2c')](_0x58a6a5);};}exports[_0x037a('0x2d')]=function(_0x14c7ce,_0x166f2e){var _0x2c1177={},_0x289cfd={},_0x376530={'count':0x0,'rows':[]};var _0x2f2320=_[_0x037a('0x2e')](db[_0x037a('0x2f')][_0x037a('0x30')],function(_0x56cd6b){return{'name':_0x56cd6b[_0x037a('0x31')],'type':_0x56cd6b[_0x037a('0x32')][_0x037a('0x33')]};});_0x289cfd[_0x037a('0x34')]=_[_0x037a('0x2e')](_0x2f2320,_0x037a('0x2b'));_0x289cfd[_0x037a('0x35')]=_[_0x037a('0x36')](_0x14c7ce['query']);_0x289cfd[_0x037a('0x37')]=_['intersection'](_0x289cfd[_0x037a('0x34')],_0x289cfd[_0x037a('0x35')]);_0x2c1177['attributes']=_[_0x037a('0x38')](_0x289cfd[_0x037a('0x34')],qs[_0x037a('0x39')](_0x14c7ce[_0x037a('0x35')][_0x037a('0x39')]));_0x2c1177[_0x037a('0x3a')]=_0x2c1177[_0x037a('0x3a')][_0x037a('0x3b')]?_0x2c1177[_0x037a('0x3a')]:_0x289cfd['model'];if(!_0x14c7ce[_0x037a('0x35')][_0x037a('0x3c')](_0x037a('0x3d'))){_0x2c1177[_0x037a('0x1d')]=qs['limit'](_0x14c7ce[_0x037a('0x35')][_0x037a('0x1d')]);_0x2c1177['offset']=qs[_0x037a('0x20')](_0x14c7ce[_0x037a('0x35')][_0x037a('0x20')]);}_0x2c1177[_0x037a('0x3e')]=qs['sort'](_0x14c7ce['query'][_0x037a('0x3f')]);_0x2c1177[_0x037a('0x40')]=qs[_0x037a('0x37')](_[_0x037a('0x41')](_0x14c7ce['query'],_0x289cfd[_0x037a('0x37')]),_0x2f2320);if(_0x14c7ce[_0x037a('0x35')][_0x037a('0x42')]){_0x2c1177[_0x037a('0x40')]=_[_0x037a('0x43')](_0x2c1177[_0x037a('0x40')],{'$or':_[_0x037a('0x2e')](_0x2f2320,function(_0x586a48){if(_0x586a48[_0x037a('0x32')]!==_0x037a('0x44')){var _0x36f3a8={};_0x36f3a8[_0x586a48['name']]={'$like':'%'+_0x14c7ce['query'][_0x037a('0x42')]+'%'};return _0x36f3a8;}})});}_0x2c1177=_['merge']({},_0x2c1177,_0x14c7ce['options']);var _0x20af41={'where':_0x2c1177[_0x037a('0x40')]};return db[_0x037a('0x2f')]['count'](_0x20af41)[_0x037a('0x26')](function(_0xa3184){_0x376530['count']=_0xa3184;if(_0x14c7ce[_0x037a('0x35')][_0x037a('0x45')]){_0x2c1177[_0x037a('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x037a('0x47')](_0x2c1177);})[_0x037a('0x26')](function(_0x40e5ad){_0x376530['rows']=_0x40e5ad;return _0x376530;})[_0x037a('0x26')](respondWithFilteredResult(_0x166f2e,_0x2c1177))[_0x037a('0x48')](handleError(_0x166f2e,null));};exports[_0x037a('0x49')]=function(_0x19a39c,_0x1d28b7){var _0x429d15={'raw':!![],'where':{'id':_0x19a39c[_0x037a('0x4a')]['id']}},_0x199934={};_0x199934[_0x037a('0x34')]=_[_0x037a('0x36')](db['AnalyticExtractedReport'][_0x037a('0x30')]);_0x199934['query']=_['keys'](_0x19a39c['query']);_0x199934['filters']=_[_0x037a('0x38')](_0x199934[_0x037a('0x34')],_0x199934[_0x037a('0x35')]);_0x429d15['attributes']=_['intersection'](_0x199934[_0x037a('0x34')],qs['fields'](_0x19a39c[_0x037a('0x35')][_0x037a('0x39')]));_0x429d15[_0x037a('0x3a')]=_0x429d15[_0x037a('0x3a')][_0x037a('0x3b')]?_0x429d15[_0x037a('0x3a')]:_0x199934[_0x037a('0x34')];if(_0x19a39c[_0x037a('0x35')][_0x037a('0x45')]){_0x429d15[_0x037a('0x46')]=[{'all':!![]}];}_0x429d15=_['merge']({},_0x429d15,_0x19a39c[_0x037a('0x4b')]);return db[_0x037a('0x2f')][_0x037a('0x4c')](_0x429d15)[_0x037a('0x26')](handleEntityNotFound(_0x1d28b7,null))[_0x037a('0x26')](respondWithResult(_0x1d28b7,null))[_0x037a('0x48')](handleError(_0x1d28b7,null));};exports[_0x037a('0x4d')]=function(_0x4fbd54,_0x46d207){return db[_0x037a('0x2f')][_0x037a('0x4d')](_0x4fbd54[_0x037a('0x4e')],{})[_0x037a('0x26')](function(_0xe52f50){var _0x23a6af=_0x4fbd54[_0x037a('0x4f')][_0x037a('0x27')]({'plain':!![]});if(!_0x23a6af)throw new Error(_0x037a('0x50'));if(_0x23a6af[_0x037a('0x51')]===_0x037a('0x4f')){var _0x2ae623=_0xe52f50[_0x037a('0x27')]({'plain':!![]});var _0xfdf4c1=_0x037a('0x28');return db['UserProfileSection'][_0x037a('0x4c')]({'where':{'name':_0xfdf4c1,'userProfileId':_0x23a6af['userProfileId']},'raw':!![]})['then'](function(_0x2cb851){if(_0x2cb851&&_0x2cb851[_0x037a('0x52')]===0x0){return db[_0x037a('0x29')][_0x037a('0x4d')]({'name':_0x2ae623['name'],'resourceId':_0x2ae623['id'],'type':_0x2cb851[_0x037a('0x2b')],'sectionId':_0x2cb851['id']},{})[_0x037a('0x26')](function(){return _0xe52f50;});}else{return _0xe52f50;}})[_0x037a('0x48')](function(_0x5eb69a){logger[_0x037a('0x53')](_0x037a('0x54'),_0x5eb69a);throw _0x5eb69a;});}return _0xe52f50;})[_0x037a('0x26')](respondWithResult(_0x46d207,0xc9))[_0x037a('0x48')](handleError(_0x46d207,null));};exports[_0x037a('0x25')]=function(_0xbdb62,_0x2dcdcc){if(_0xbdb62[_0x037a('0x4e')]['id']){delete _0xbdb62[_0x037a('0x4e')]['id'];}return db[_0x037a('0x2f')][_0x037a('0x4c')]({'where':{'id':_0xbdb62[_0x037a('0x4a')]['id']}})[_0x037a('0x26')](handleEntityNotFound(_0x2dcdcc,null))['then'](saveUpdates(_0xbdb62[_0x037a('0x4e')],null))[_0x037a('0x26')](respondWithResult(_0x2dcdcc,null))[_0x037a('0x48')](handleError(_0x2dcdcc,null));};exports[_0x037a('0x2a')]=function(_0x37a355,_0x490cd9){return db['AnalyticExtractedReport'][_0x037a('0x4c')]({'where':{'id':_0x37a355[_0x037a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x490cd9,null))[_0x037a('0x26')](removeEntity(_0x490cd9,null))[_0x037a('0x48')](handleError(_0x490cd9,null));};exports[_0x037a('0x55')]=function(_0x3d5877,_0x27512f,_0x40d2e0){return db['AnalyticExtractedReport'][_0x037a('0x4c')]({'where':{'id':_0x3d5877[_0x037a('0x4a')]['id']},'attributes':[_0x037a('0x2b'),_0x037a('0x56'),_0x037a('0x57'),_0x037a('0x58')],'raw':!![]})[_0x037a('0x26')](handleEntityNotFound(_0x27512f,null))[_0x037a('0x26')](function(_0x519d9d){if(_0x519d9d){if(!fs['existsSync'](path[_0x037a('0x59')](config[_0x037a('0x5a')],_0x037a('0x5b'),_0x519d9d[_0x037a('0x57')]))){throw new db['Sequelize'][(_0x037a('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3d5877['query'][_0x037a('0x5d')]){return _0x27512f[_0x037a('0x1a')](0xc8);}return _0x27512f[_0x037a('0x55')](path[_0x037a('0x59')](config[_0x037a('0x5a')],_0x037a('0x5b'),_0x519d9d[_0x037a('0x57')]),util['format'](_0x037a('0x5e'),_0x519d9d[_0x037a('0x56')]||_0x519d9d[_0x037a('0x2b')],_0x519d9d[_0x037a('0x58')][_0x037a('0x5f')]()));}})['catch'](handleError(_0x27512f,null));}; \ No newline at end of file +var _0x3a79=['order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','rawAttributes','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','params','download','basename','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','end','error','stack','name','send','index','AnalyticExtractedReport','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3a79,0x157));var _0x93a7=function(_0x28c759,_0x33d60e){_0x28c759=_0x28c759-0x0;var _0x5e8d0e=_0x3a79[_0x28c759];return _0x5e8d0e;};'use strict';var emlformat=require(_0x93a7('0x0'));var rimraf=require(_0x93a7('0x1'));var zipdir=require(_0x93a7('0x2'));var jsonpatch=require(_0x93a7('0x3'));var rp=require('request-promise');var moment=require(_0x93a7('0x4'));var BPromise=require(_0x93a7('0x5'));var Mustache=require(_0x93a7('0x6'));var util=require(_0x93a7('0x7'));var path=require(_0x93a7('0x8'));var sox=require(_0x93a7('0x9'));var csv=require(_0x93a7('0xa'));var ejs=require(_0x93a7('0xb'));var fs=require('fs');var fs_extra=require(_0x93a7('0xc'));var _=require(_0x93a7('0xd'));var squel=require(_0x93a7('0xe'));var crypto=require(_0x93a7('0xf'));var jsforce=require(_0x93a7('0x10'));var deskjs=require(_0x93a7('0x11'));var toCsv=require(_0x93a7('0xa'));var querystring=require(_0x93a7('0x12'));var Papa=require(_0x93a7('0x13'));var Redis=require(_0x93a7('0x14'));var authService=require(_0x93a7('0x15'));var qs=require(_0x93a7('0x16'));var as=require(_0x93a7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93a7('0x18'))(_0x93a7('0x19'));var utils=require('../../config/utils');var config=require(_0x93a7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5e386,_0x2ce09c){_0x2ce09c=_0x2ce09c||0xcc;return function(_0x2e9d56){if(_0x2e9d56){return _0xa5e386[_0x93a7('0x1b')](_0x2ce09c);}return _0xa5e386[_0x93a7('0x1c')](_0x2ce09c)['end']();};}function respondWithResult(_0x1e1095,_0x1cfdb0){_0x1cfdb0=_0x1cfdb0||0xc8;return function(_0x5b2f2a){if(_0x5b2f2a){return _0x1e1095[_0x93a7('0x1c')](_0x1cfdb0)[_0x93a7('0x1d')](_0x5b2f2a);}};}function respondWithFilteredResult(_0x350937,_0x38ac8a){return function(_0x40d860){if(_0x40d860){var _0xbcbac1=typeof _0x38ac8a['offset']===_0x93a7('0x1e')&&typeof _0x38ac8a[_0x93a7('0x1f')]==='undefined';var _0x3d3b81=_0x40d860['count'];var _0x2ee6f0=_0xbcbac1?0x0:_0x38ac8a[_0x93a7('0x20')];var _0x556ba5=_0xbcbac1?_0x40d860[_0x93a7('0x21')]:_0x38ac8a['offset']+_0x38ac8a[_0x93a7('0x1f')];var _0xf476ce;if(_0x556ba5>=_0x3d3b81){_0x556ba5=_0x3d3b81;_0xf476ce=0xc8;}else{_0xf476ce=0xce;}_0x350937['status'](_0xf476ce);return _0x350937[_0x93a7('0x22')](_0x93a7('0x23'),_0x2ee6f0+'-'+_0x556ba5+'/'+_0x3d3b81)[_0x93a7('0x1d')](_0x40d860);}return null;};}function patchUpdates(_0x20547a){return function(_0x8348e8){try{jsonpatch[_0x93a7('0x24')](_0x8348e8,_0x20547a,!![]);}catch(_0xe9c247){return BPromise[_0x93a7('0x25')](_0xe9c247);}return _0x8348e8[_0x93a7('0x26')]();};}function saveUpdates(_0x51ea96,_0x38ea52){return function(_0x187c3b){if(_0x187c3b){return _0x187c3b['update'](_0x51ea96)[_0x93a7('0x27')](function(_0x182809){return _0x182809;});}return null;};}function removeEntity(_0x59b092,_0x109ed6){return function(_0x13e92a){if(_0x13e92a){return _0x13e92a[_0x93a7('0x28')]()[_0x93a7('0x27')](function(){var _0x12436c=_0x13e92a[_0x93a7('0x29')]({'plain':!![]});var _0x206a31=_0x93a7('0x2a');return db['UserProfileResource'][_0x93a7('0x28')]({'where':{'type':_0x206a31,'resourceId':_0x12436c['id']}})['then'](function(){return _0x13e92a;});})[_0x93a7('0x27')](function(){_0x59b092[_0x93a7('0x1c')](0xcc)[_0x93a7('0x2b')]();});}};}function handleEntityNotFound(_0x501040,_0x13e99a){return function(_0x1fc2a0){if(!_0x1fc2a0){_0x501040[_0x93a7('0x1b')](0x194);}return _0x1fc2a0;};}function handleError(_0x33fa72,_0x1ddfa3){_0x1ddfa3=_0x1ddfa3||0x1f4;return function(_0x56d7e6){logger[_0x93a7('0x2c')](_0x56d7e6[_0x93a7('0x2d')]);if(_0x56d7e6['name']){delete _0x56d7e6[_0x93a7('0x2e')];}_0x33fa72[_0x93a7('0x1c')](_0x1ddfa3)[_0x93a7('0x2f')](_0x56d7e6);};}exports[_0x93a7('0x30')]=function(_0x18b15f,_0x32cfff){var _0x337c41={},_0x427db6={},_0x2a7100={'count':0x0,'rows':[]};var _0x2f187f=_['map'](db[_0x93a7('0x31')]['rawAttributes'],function(_0x4892a7){return{'name':_0x4892a7[_0x93a7('0x32')],'type':_0x4892a7[_0x93a7('0x33')]['key']};});_0x427db6[_0x93a7('0x34')]=_[_0x93a7('0x35')](_0x2f187f,_0x93a7('0x2e'));_0x427db6[_0x93a7('0x36')]=_[_0x93a7('0x37')](_0x18b15f[_0x93a7('0x36')]);_0x427db6[_0x93a7('0x38')]=_['intersection'](_0x427db6[_0x93a7('0x34')],_0x427db6[_0x93a7('0x36')]);_0x337c41['attributes']=_['intersection'](_0x427db6[_0x93a7('0x34')],qs[_0x93a7('0x39')](_0x18b15f[_0x93a7('0x36')][_0x93a7('0x39')]));_0x337c41['attributes']=_0x337c41[_0x93a7('0x3a')][_0x93a7('0x3b')]?_0x337c41['attributes']:_0x427db6[_0x93a7('0x34')];if(!_0x18b15f[_0x93a7('0x36')][_0x93a7('0x3c')]('nolimit')){_0x337c41[_0x93a7('0x1f')]=qs[_0x93a7('0x1f')](_0x18b15f[_0x93a7('0x36')][_0x93a7('0x1f')]);_0x337c41['offset']=qs[_0x93a7('0x20')](_0x18b15f[_0x93a7('0x36')]['offset']);}_0x337c41[_0x93a7('0x3d')]=qs[_0x93a7('0x3e')](_0x18b15f['query'][_0x93a7('0x3e')]);_0x337c41[_0x93a7('0x3f')]=qs['filters'](_[_0x93a7('0x40')](_0x18b15f[_0x93a7('0x36')],_0x427db6['filters']),_0x2f187f);if(_0x18b15f[_0x93a7('0x36')][_0x93a7('0x41')]){_0x337c41[_0x93a7('0x3f')]=_[_0x93a7('0x42')](_0x337c41['where'],{'$or':_[_0x93a7('0x35')](_0x2f187f,function(_0x11433f){if(_0x11433f['type']!=='VIRTUAL'){var _0x20cd26={};_0x20cd26[_0x11433f[_0x93a7('0x2e')]]={'$like':'%'+_0x18b15f[_0x93a7('0x36')]['filter']+'%'};return _0x20cd26;}})});}_0x337c41=_[_0x93a7('0x42')]({},_0x337c41,_0x18b15f['options']);var _0x16a0bb={'where':_0x337c41[_0x93a7('0x3f')]};return db['AnalyticExtractedReport'][_0x93a7('0x21')](_0x16a0bb)['then'](function(_0xad93d3){_0x2a7100[_0x93a7('0x21')]=_0xad93d3;if(_0x18b15f[_0x93a7('0x36')]['includeAll']){_0x337c41[_0x93a7('0x43')]=[{'all':!![]}];}return db[_0x93a7('0x31')][_0x93a7('0x44')](_0x337c41);})[_0x93a7('0x27')](function(_0x1628f5){_0x2a7100[_0x93a7('0x45')]=_0x1628f5;return _0x2a7100;})[_0x93a7('0x27')](respondWithFilteredResult(_0x32cfff,_0x337c41))[_0x93a7('0x46')](handleError(_0x32cfff,null));};exports[_0x93a7('0x47')]=function(_0x3f9228,_0x20e792){var _0x1b3e9c={'raw':!![],'where':{'id':_0x3f9228['params']['id']}},_0x4aa5fc={};_0x4aa5fc[_0x93a7('0x34')]=_[_0x93a7('0x37')](db[_0x93a7('0x31')][_0x93a7('0x48')]);_0x4aa5fc[_0x93a7('0x36')]=_['keys'](_0x3f9228[_0x93a7('0x36')]);_0x4aa5fc[_0x93a7('0x38')]=_['intersection'](_0x4aa5fc[_0x93a7('0x34')],_0x4aa5fc[_0x93a7('0x36')]);_0x1b3e9c[_0x93a7('0x3a')]=_[_0x93a7('0x49')](_0x4aa5fc[_0x93a7('0x34')],qs[_0x93a7('0x39')](_0x3f9228[_0x93a7('0x36')][_0x93a7('0x39')]));_0x1b3e9c[_0x93a7('0x3a')]=_0x1b3e9c[_0x93a7('0x3a')]['length']?_0x1b3e9c[_0x93a7('0x3a')]:_0x4aa5fc['model'];if(_0x3f9228[_0x93a7('0x36')][_0x93a7('0x4a')]){_0x1b3e9c[_0x93a7('0x43')]=[{'all':!![]}];}_0x1b3e9c=_[_0x93a7('0x42')]({},_0x1b3e9c,_0x3f9228[_0x93a7('0x4b')]);return db[_0x93a7('0x31')][_0x93a7('0x4c')](_0x1b3e9c)['then'](handleEntityNotFound(_0x20e792,null))[_0x93a7('0x27')](respondWithResult(_0x20e792,null))[_0x93a7('0x46')](handleError(_0x20e792,null));};exports[_0x93a7('0x4d')]=function(_0x15e453,_0x27cf20){return db[_0x93a7('0x31')][_0x93a7('0x4d')](_0x15e453[_0x93a7('0x4e')],{})[_0x93a7('0x27')](function(_0x40fb67){var _0x56442c=_0x15e453[_0x93a7('0x4f')][_0x93a7('0x29')]({'plain':!![]});if(!_0x56442c)throw new Error(_0x93a7('0x50'));if(_0x56442c['role']===_0x93a7('0x4f')){var _0x3b9fa2=_0x40fb67[_0x93a7('0x29')]({'plain':!![]});var _0x41fe06='ExtractedReports';return db[_0x93a7('0x51')]['find']({'where':{'name':_0x41fe06,'userProfileId':_0x56442c[_0x93a7('0x52')]},'raw':!![]})[_0x93a7('0x27')](function(_0x4234d6){if(_0x4234d6&&_0x4234d6[_0x93a7('0x53')]===0x0){return db[_0x93a7('0x54')][_0x93a7('0x4d')]({'name':_0x3b9fa2[_0x93a7('0x2e')],'resourceId':_0x3b9fa2['id'],'type':_0x4234d6[_0x93a7('0x2e')],'sectionId':_0x4234d6['id']},{})[_0x93a7('0x27')](function(){return _0x40fb67;});}else{return _0x40fb67;}})['catch'](function(_0x28fdd0){logger[_0x93a7('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28fdd0);throw _0x28fdd0;});}return _0x40fb67;})[_0x93a7('0x27')](respondWithResult(_0x27cf20,0xc9))[_0x93a7('0x46')](handleError(_0x27cf20,null));};exports[_0x93a7('0x55')]=function(_0x15cb5a,_0x51086a){if(_0x15cb5a[_0x93a7('0x4e')]['id']){delete _0x15cb5a[_0x93a7('0x4e')]['id'];}return db[_0x93a7('0x31')]['find']({'where':{'id':_0x15cb5a[_0x93a7('0x56')]['id']}})['then'](handleEntityNotFound(_0x51086a,null))[_0x93a7('0x27')](saveUpdates(_0x15cb5a[_0x93a7('0x4e')],null))[_0x93a7('0x27')](respondWithResult(_0x51086a,null))[_0x93a7('0x46')](handleError(_0x51086a,null));};exports[_0x93a7('0x28')]=function(_0xec06d8,_0x231be6){return db['AnalyticExtractedReport'][_0x93a7('0x4c')]({'where':{'id':_0xec06d8[_0x93a7('0x56')]['id']}})[_0x93a7('0x27')](handleEntityNotFound(_0x231be6,null))['then'](removeEntity(_0x231be6,null))[_0x93a7('0x46')](handleError(_0x231be6,null));};exports[_0x93a7('0x57')]=function(_0x303f46,_0x2a0b3d,_0xc03fc0){return db[_0x93a7('0x31')][_0x93a7('0x4c')]({'where':{'id':_0x303f46[_0x93a7('0x56')]['id']},'attributes':[_0x93a7('0x2e'),_0x93a7('0x58'),'savename',_0x93a7('0x59')],'raw':!![]})[_0x93a7('0x27')](handleEntityNotFound(_0x2a0b3d,null))[_0x93a7('0x27')](function(_0x3ed7b3){if(_0x3ed7b3){if(!fs['existsSync'](path[_0x93a7('0x5a')](config[_0x93a7('0x5b')],_0x93a7('0x5c'),_0x3ed7b3[_0x93a7('0x5d')]))){throw new db[(_0x93a7('0x5e'))][(_0x93a7('0x5f'))](_0x93a7('0x60'));}if(_0x303f46[_0x93a7('0x36')][_0x93a7('0x61')]){return _0x2a0b3d[_0x93a7('0x1b')](0xc8);}return _0x2a0b3d[_0x93a7('0x57')](path['join'](config[_0x93a7('0x5b')],'server/files/reports',_0x3ed7b3[_0x93a7('0x5d')]),util[_0x93a7('0x62')](_0x93a7('0x63'),_0x3ed7b3[_0x93a7('0x58')]||_0x3ed7b3[_0x93a7('0x2e')],_0x3ed7b3[_0x93a7('0x59')][_0x93a7('0x64')]()));}})['catch'](handleError(_0x2a0b3d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b144fa0..d9d0450 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 _0xeacd=['moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x113e2f,_0x2b25ee){var _0x390c2f=function(_0x4fb867){while(--_0x4fb867){_0x113e2f['push'](_0x113e2f['shift']());}};_0x390c2f(++_0x2b25ee);}(_0xeacd,0x11f));var _0xdeac=function(_0x10a2be,_0x175892){_0x10a2be=_0x10a2be-0x0;var _0x52bdef=_0xeacd[_0x10a2be];return _0x52bdef;};'use strict';var _=require('lodash');var util=require(_0xdeac('0x0'));var logger=require(_0xdeac('0x1'))(_0xdeac('0x2'));var moment=require(_0xdeac('0x3'));var BPromise=require(_0xdeac('0x4'));var rp=require(_0xdeac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdeac('0x6'));var attributes=require(_0xdeac('0x7'));module['exports']=function(_0x598fd5,_0x498bfe){return _0x598fd5[_0xdeac('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0xdeac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d9d=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x9d9d,0x8f));var _0xd9d9=function(_0x25d525,_0x4f8c20){_0x25d525=_0x25d525-0x0;var _0x5bb628=_0x9d9d[_0x25d525];return _0x5bb628;};'use strict';var _=require(_0xd9d9('0x0'));var util=require(_0xd9d9('0x1'));var logger=require(_0xd9d9('0x2'))(_0xd9d9('0x3'));var moment=require(_0xd9d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9d9('0x5'));var rimraf=require(_0xd9d9('0x6'));var config=require(_0xd9d9('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xd9d9('0x8')]=function(_0x39d407,_0x15a90c){return _0x39d407[_0xd9d9('0x9')](_0xd9d9('0xa'),attributes,{'tableName':'analytics_extracted_reports','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 65afeb0..8d776db 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 _0xf458=['../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x55deec,_0x130e1f){var _0x2a071a=function(_0x292388){while(--_0x292388){_0x55deec['push'](_0x55deec['shift']());}};_0x2a071a(++_0x130e1f);}(_0xf458,0x1e9));var _0x8f45=function(_0x34ba1a,_0x3efc5c){_0x34ba1a=_0x34ba1a-0x0;var _0x5c7ff5=_0xf458[_0x34ba1a];return _0x5c7ff5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f45('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f45('0x1'))['db'];var utils=require(_0x8f45('0x2'));var logger=require('../../config/logger')(_0x8f45('0x3'));var config=require(_0x8f45('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8f45('0x5')][_0x8f45('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d4bdc,_0x59a80c,_0x126dca){return new BPromise(function(_0x45531d,_0x1c7efa){return client[_0x8f45('0x7')](_0x3d4bdc,_0x126dca)[_0x8f45('0x8')](function(_0x43ffc4){logger[_0x8f45('0x9')](_0x8f45('0xa'),_0x59a80c,_0x8f45('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x59a80c,'request\x20sent',JSON[_0x8f45('0xc')](_0x43ffc4));if(_0x43ffc4['error']){if(_0x43ffc4[_0x8f45('0xd')]['code']===0x1f4){logger[_0x8f45('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59a80c,_0x43ffc4['error'][_0x8f45('0xe')]);return _0x1c7efa(_0x43ffc4[_0x8f45('0xd')][_0x8f45('0xe')]);}logger[_0x8f45('0xd')](_0x8f45('0xa'),_0x59a80c,_0x43ffc4[_0x8f45('0xd')][_0x8f45('0xe')]);return _0x45531d(_0x43ffc4['error'][_0x8f45('0xe')]);}else{logger['info'](_0x8f45('0xa'),_0x59a80c,_0x8f45('0xb'));_0x45531d(_0x43ffc4[_0x8f45('0xf')]['message']);}})[_0x8f45('0x10')](function(_0x52f747){logger[_0x8f45('0xd')](_0x8f45('0xa'),_0x59a80c,_0x52f747);_0x1c7efa(_0x52f747);});});} \ No newline at end of file +var _0x8006=['client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x8006,0x90));var _0x6800=function(_0x10588e,_0x3dfa76){_0x10588e=_0x10588e-0x0;var _0x33332a=_0x8006[_0x10588e];return _0x33332a;};'use strict';var _=require('lodash');var util=require(_0x6800('0x0'));var moment=require('moment');var BPromise=require(_0x6800('0x1'));var rs=require(_0x6800('0x2'));var fs=require('fs');var Redis=require(_0x6800('0x3'));var db=require(_0x6800('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6800('0x5'))(_0x6800('0x6'));var config=require('../../config/environment');var jayson=require(_0x6800('0x7'));var client=jayson[_0x6800('0x8')][_0x6800('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445361,_0x199543,_0x2dca8e){return new BPromise(function(_0x24a635,_0x4c56e7){return client['request'](_0x445361,_0x2dca8e)[_0x6800('0xa')](function(_0x510713){logger[_0x6800('0xb')](_0x6800('0xc'),_0x199543,_0x6800('0xd'));logger['debug'](_0x6800('0xe'),_0x199543,'request\x20sent',JSON[_0x6800('0xf')](_0x510713));if(_0x510713['error']){if(_0x510713['error']['code']===0x1f4){logger[_0x6800('0x10')](_0x6800('0xc'),_0x199543,_0x510713[_0x6800('0x10')][_0x6800('0x11')]);return _0x4c56e7(_0x510713[_0x6800('0x10')][_0x6800('0x11')]);}logger[_0x6800('0x10')](_0x6800('0xc'),_0x199543,_0x510713[_0x6800('0x10')][_0x6800('0x11')]);return _0x24a635(_0x510713[_0x6800('0x10')][_0x6800('0x11')]);}else{logger[_0x6800('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x199543,_0x6800('0xd'));_0x24a635(_0x510713['result'][_0x6800('0x11')]);}})[_0x6800('0x12')](function(_0x31950f){logger[_0x6800('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x199543,_0x31950f);_0x4c56e7(_0x31950f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index dadf5d6..fae0fa3 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 _0x21a3=['isAuthenticated','/:id','show','download','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x397958,_0x270d41){var _0x235f9e=function(_0x3d2a3d){while(--_0x3d2a3d){_0x397958['push'](_0x397958['shift']());}};_0x235f9e(++_0x270d41);}(_0x21a3,0x186));var _0x321a=function(_0x27ff4d,_0x41a7d6){_0x27ff4d=_0x27ff4d-0x0;var _0x803d72=_0x21a3[_0x27ff4d];return _0x803d72;};'use strict';var multer=require(_0x321a('0x0'));var util=require('util');var path=require(_0x321a('0x1'));var timeout=require('connect-timeout');var express=require(_0x321a('0x2'));var router=express[_0x321a('0x3')]();var fs_extra=require(_0x321a('0x4'));var auth=require(_0x321a('0x5'));var interaction=require(_0x321a('0x6'));var config=require(_0x321a('0x7'));var controller=require(_0x321a('0x8'));router[_0x321a('0x9')]('/',auth[_0x321a('0xa')](),controller['index']);router['get'](_0x321a('0xb'),auth[_0x321a('0xa')](),controller[_0x321a('0xc')]);router['get']('/:id/download',auth[_0x321a('0xa')](),controller[_0x321a('0xd')]);router[_0x321a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x321a('0xf')]('/:id',auth[_0x321a('0xa')](),controller[_0x321a('0x10')]);router[_0x321a('0x11')](_0x321a('0xb'),auth[_0x321a('0xa')](),controller[_0x321a('0x12')]);module[_0x321a('0x13')]=router; \ No newline at end of file +var _0x82f8=['isAuthenticated','index','show','/:id/download','download','post','put','/:id','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0x82f8,0x14c));var _0x882f=function(_0x43080f,_0x334d80){_0x43080f=_0x43080f-0x0;var _0x2889bd=_0x82f8[_0x43080f];return _0x2889bd;};'use strict';var multer=require(_0x882f('0x0'));var util=require('util');var path=require(_0x882f('0x1'));var timeout=require('connect-timeout');var express=require(_0x882f('0x2'));var router=express[_0x882f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x882f('0x4'));var interaction=require(_0x882f('0x5'));var config=require('../../config/environment');var controller=require(_0x882f('0x6'));router[_0x882f('0x7')]('/',auth[_0x882f('0x8')](),controller[_0x882f('0x9')]);router[_0x882f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x882f('0xa')]);router[_0x882f('0x7')](_0x882f('0xb'),auth[_0x882f('0x8')](),controller[_0x882f('0xc')]);router[_0x882f('0xd')]('/',auth[_0x882f('0x8')](),controller['create']);router[_0x882f('0xe')](_0x882f('0xf'),auth[_0x882f('0x8')](),controller['update']);router['delete'](_0x882f('0xf'),auth[_0x882f('0x8')](),controller['destroy']);module[_0x882f('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0a64182..a135662 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 _0x3d4d=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4cf105,_0x3533a1){var _0x3bf9b2=function(_0xbbc488){while(--_0xbbc488){_0x4cf105['push'](_0x4cf105['shift']());}};_0x3bf9b2(++_0x3533a1);}(_0x3d4d,0x13f));var _0xd3d4=function(_0x158ff8,_0x49e9f9){_0x158ff8=_0x158ff8-0x0;var _0x122487=_0x3d4d[_0x158ff8];return _0x122487;};'use strict';var Sequelize=require(_0xd3d4('0x0'));module['exports']={'field':{'type':Sequelize[_0xd3d4('0x1')]},'alias':{'type':Sequelize[_0xd3d4('0x2')]},'function':{'type':Sequelize[_0xd3d4('0x2')]},'format':{'type':Sequelize[_0xd3d4('0x2')]},'groupBy':{'type':Sequelize[_0xd3d4('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd3d4('0x2')]},'custom':{'type':Sequelize[_0xd3d4('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0e87=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1ebfcc,_0x28e9e0){var _0x1ac092=function(_0x9ed932){while(--_0x9ed932){_0x1ebfcc['push'](_0x1ebfcc['shift']());}};_0x1ac092(++_0x28e9e0);}(_0x0e87,0xeb));var _0x70e8=function(_0x2d89d4,_0xf4fd8e){_0x2d89d4=_0x2d89d4-0x0;var _0x2bb136=_0x0e87[_0x2d89d4];return _0x2bb136;};'use strict';var Sequelize=require(_0x70e8('0x0'));module[_0x70e8('0x1')]={'field':{'type':Sequelize[_0x70e8('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x70e8('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x70e8('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x70e8('0x3')]},'custom':{'type':Sequelize[_0x70e8('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 335ae69..af9e998 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 _0x6346=['end','json','offset','limit','undefined','count','reject','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','include','catch','show','params','includeAll','find','create','bulkCreate','body','update','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','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/environment','../../config/license/util','sendStatus','status'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x6346,0x1b4));var _0x6634=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6346[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6634('0x0'));var rimraf=require(_0x6634('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6634('0x2'));var rp=require(_0x6634('0x3'));var moment=require('moment');var BPromise=require(_0x6634('0x4'));var Mustache=require(_0x6634('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6634('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6634('0x7'));var _=require(_0x6634('0x8'));var squel=require(_0x6634('0x9'));var crypto=require(_0x6634('0xa'));var jsforce=require(_0x6634('0xb'));var deskjs=require(_0x6634('0xc'));var toCsv=require(_0x6634('0xd'));var querystring=require(_0x6634('0xe'));var Papa=require(_0x6634('0xf'));var Redis=require(_0x6634('0x10'));var authService=require(_0x6634('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6634('0x12'));var hardwareService=require(_0x6634('0x13'));var logger=require(_0x6634('0x14'))(_0x6634('0x15'));var utils=require('../../config/utils');var config=require(_0x6634('0x16'));var licenseUtil=require(_0x6634('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54252f,_0x3590dc){_0x3590dc=_0x3590dc||0xcc;return function(_0xb744a1){if(_0xb744a1){return _0x54252f[_0x6634('0x18')](_0x3590dc);}return _0x54252f[_0x6634('0x19')](_0x3590dc)[_0x6634('0x1a')]();};}function respondWithResult(_0x4e68c7,_0x42aef0){_0x42aef0=_0x42aef0||0xc8;return function(_0x251740){if(_0x251740){return _0x4e68c7[_0x6634('0x19')](_0x42aef0)[_0x6634('0x1b')](_0x251740);}};}function respondWithFilteredResult(_0x40e54f,_0x4bf4ce){return function(_0x242267){if(_0x242267){var _0x17aa87=typeof _0x4bf4ce[_0x6634('0x1c')]==='undefined'&&typeof _0x4bf4ce[_0x6634('0x1d')]===_0x6634('0x1e');var _0x523b86=_0x242267[_0x6634('0x1f')];var _0x3b1896=_0x17aa87?0x0:_0x4bf4ce[_0x6634('0x1c')];var _0xb128aa=_0x17aa87?_0x242267[_0x6634('0x1f')]:_0x4bf4ce[_0x6634('0x1c')]+_0x4bf4ce[_0x6634('0x1d')];var _0x21514b;if(_0xb128aa>=_0x523b86){_0xb128aa=_0x523b86;_0x21514b=0xc8;}else{_0x21514b=0xce;}_0x40e54f[_0x6634('0x19')](_0x21514b);return _0x40e54f['set']('Content-Range',_0x3b1896+'-'+_0xb128aa+'/'+_0x523b86)[_0x6634('0x1b')](_0x242267);}return null;};}function patchUpdates(_0xf694ff){return function(_0x2fd255){try{jsonpatch['apply'](_0x2fd255,_0xf694ff,!![]);}catch(_0x12d24c){return BPromise[_0x6634('0x20')](_0x12d24c);}return _0x2fd255['save']();};}function saveUpdates(_0x2581f7,_0x30ae90){return function(_0x3f612d){if(_0x3f612d){return _0x3f612d['update'](_0x2581f7)['then'](function(_0x257657){return _0x257657;});}return null;};}function removeEntity(_0x54b95b,_0x104f3c){return function(_0x197a53){if(_0x197a53){return _0x197a53['destroy']()['then'](function(){_0x54b95b[_0x6634('0x19')](0xcc)[_0x6634('0x1a')]();});}};}function handleEntityNotFound(_0x2ba53a,_0x49bb57){return function(_0xcf2f40){if(!_0xcf2f40){_0x2ba53a[_0x6634('0x18')](0x194);}return _0xcf2f40;};}function handleError(_0x151163,_0x4d36d7){_0x4d36d7=_0x4d36d7||0x1f4;return function(_0x599bf7){logger[_0x6634('0x21')](_0x599bf7[_0x6634('0x22')]);if(_0x599bf7['name']){delete _0x599bf7[_0x6634('0x23')];}_0x151163[_0x6634('0x19')](_0x4d36d7)[_0x6634('0x24')](_0x599bf7);};}exports['index']=function(_0x12c98e,_0x116972){var _0x35ea9d={},_0x22d282={},_0x496f0e={'count':0x0,'rows':[]};var _0x495c5d=_[_0x6634('0x25')](db[_0x6634('0x26')]['rawAttributes'],function(_0x201349){return{'name':_0x201349[_0x6634('0x27')],'type':_0x201349[_0x6634('0x28')]['key']};});_0x22d282[_0x6634('0x29')]=_['map'](_0x495c5d,_0x6634('0x23'));_0x22d282['query']=_[_0x6634('0x2a')](_0x12c98e['query']);_0x22d282['filters']=_['intersection'](_0x22d282[_0x6634('0x29')],_0x22d282[_0x6634('0x2b')]);_0x35ea9d[_0x6634('0x2c')]=_[_0x6634('0x2d')](_0x22d282['model'],qs[_0x6634('0x2e')](_0x12c98e[_0x6634('0x2b')]['fields']));_0x35ea9d[_0x6634('0x2c')]=_0x35ea9d[_0x6634('0x2c')][_0x6634('0x2f')]?_0x35ea9d[_0x6634('0x2c')]:_0x22d282[_0x6634('0x29')];if(!_0x12c98e[_0x6634('0x2b')][_0x6634('0x30')](_0x6634('0x31'))){_0x35ea9d['limit']=qs[_0x6634('0x1d')](_0x12c98e[_0x6634('0x2b')][_0x6634('0x1d')]);_0x35ea9d[_0x6634('0x1c')]=qs['offset'](_0x12c98e[_0x6634('0x2b')]['offset']);}_0x35ea9d[_0x6634('0x32')]=qs[_0x6634('0x33')](_0x12c98e[_0x6634('0x2b')][_0x6634('0x33')]);_0x35ea9d[_0x6634('0x34')]=qs['filters'](_[_0x6634('0x35')](_0x12c98e[_0x6634('0x2b')],_0x22d282[_0x6634('0x36')]),_0x495c5d);if(_0x12c98e[_0x6634('0x2b')][_0x6634('0x37')]){_0x35ea9d[_0x6634('0x34')]=_[_0x6634('0x38')](_0x35ea9d['where'],{'$or':_['map'](_0x495c5d,function(_0x4b25c6){if(_0x4b25c6[_0x6634('0x28')]!==_0x6634('0x39')){var _0x51c94a={};_0x51c94a[_0x4b25c6[_0x6634('0x23')]]={'$like':'%'+_0x12c98e[_0x6634('0x2b')][_0x6634('0x37')]+'%'};return _0x51c94a;}})});}_0x35ea9d=_[_0x6634('0x38')]({},_0x35ea9d,_0x12c98e[_0x6634('0x3a')]);var _0x19df96={'where':_0x35ea9d['where']};return db[_0x6634('0x26')][_0x6634('0x1f')](_0x19df96)[_0x6634('0x3b')](function(_0x4cd1d0){_0x496f0e[_0x6634('0x1f')]=_0x4cd1d0;if(_0x12c98e['query']['includeAll']){_0x35ea9d[_0x6634('0x3c')]=[{'all':!![]}];}return db[_0x6634('0x26')]['findAll'](_0x35ea9d);})[_0x6634('0x3b')](function(_0x2af613){_0x496f0e['rows']=_0x2af613;return _0x496f0e;})['then'](respondWithFilteredResult(_0x116972,_0x35ea9d))[_0x6634('0x3d')](handleError(_0x116972,null));};exports[_0x6634('0x3e')]=function(_0x5a1645,_0xaa0b8f){var _0x231346={'raw':![],'where':{'id':_0x5a1645[_0x6634('0x3f')]['id']}},_0x4bdab8={};_0x4bdab8[_0x6634('0x29')]=_['keys'](db[_0x6634('0x26')]['rawAttributes']);_0x4bdab8[_0x6634('0x2b')]=_[_0x6634('0x2a')](_0x5a1645[_0x6634('0x2b')]);_0x4bdab8[_0x6634('0x36')]=_['intersection'](_0x4bdab8[_0x6634('0x29')],_0x4bdab8[_0x6634('0x2b')]);_0x231346[_0x6634('0x2c')]=_[_0x6634('0x2d')](_0x4bdab8[_0x6634('0x29')],qs[_0x6634('0x2e')](_0x5a1645[_0x6634('0x2b')][_0x6634('0x2e')]));_0x231346[_0x6634('0x2c')]=_0x231346[_0x6634('0x2c')][_0x6634('0x2f')]?_0x231346[_0x6634('0x2c')]:_0x4bdab8[_0x6634('0x29')];if(_0x5a1645[_0x6634('0x2b')][_0x6634('0x40')]){_0x231346[_0x6634('0x3c')]=[{'all':!![]}];}_0x231346=_[_0x6634('0x38')]({},_0x231346,_0x5a1645['options']);return db['AnalyticFieldReport'][_0x6634('0x41')](_0x231346)['then'](handleEntityNotFound(_0xaa0b8f,null))[_0x6634('0x3b')](respondWithResult(_0xaa0b8f,null))['catch'](handleError(_0xaa0b8f,null));};exports['create']=function(_0x4392fd,_0x3bc92a){return db[_0x6634('0x26')][_0x6634('0x42')](_0x4392fd['body'],{})[_0x6634('0x3b')](respondWithResult(_0x3bc92a,0xc9))[_0x6634('0x3d')](handleError(_0x3bc92a,null));};exports[_0x6634('0x43')]=function(_0x331c4e,_0x22f1a4){return db[_0x6634('0x26')]['bulkCreate'](_0x331c4e[_0x6634('0x44')],{'raw':![],'individualHooks':!![]})[_0x6634('0x3b')](respondWithResult(_0x22f1a4,0xc9))[_0x6634('0x3d')](handleError(_0x22f1a4,null));};exports[_0x6634('0x45')]=function(_0x84db9,_0x10c1e8){if(_0x84db9[_0x6634('0x44')]['id']){delete _0x84db9['body']['id'];}return db[_0x6634('0x26')]['find']({'where':{'id':_0x84db9[_0x6634('0x3f')]['id']}})[_0x6634('0x3b')](handleEntityNotFound(_0x10c1e8,null))[_0x6634('0x3b')](saveUpdates(_0x84db9['body'],null))['then'](respondWithResult(_0x10c1e8,null))['catch'](handleError(_0x10c1e8,null));};exports['destroy']=function(_0x413a14,_0x4909eb){return db[_0x6634('0x26')][_0x6634('0x41')]({'where':{'id':_0x413a14['params']['id']}})[_0x6634('0x3b')](handleEntityNotFound(_0x4909eb,null))[_0x6634('0x3b')](removeEntity(_0x4909eb,null))[_0x6634('0x3d')](handleError(_0x4909eb,null));};exports[_0x6634('0x46')]=function(_0x59cb9f,_0x3e9f8f){return db[_0x6634('0x26')][_0x6634('0x47')]({'where':{'id':_0x59cb9f[_0x6634('0x2b')][_0x6634('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x6634('0x3b')](respondWithResult(_0x3e9f8f,0xcc))['catch'](handleError(_0x3e9f8f,null));};exports[_0x6634('0x49')]=function(_0x3e1b9d,_0x389df6,_0x3f73cf){return db[_0x6634('0x4a')]['findOne']({'where':{'id':_0x3e1b9d['params']['id']}})['then'](handleEntityNotFound(_0x389df6,null))['then'](function(_0x3a76ec){if(_0x3a76ec){return db['sequelize']['transaction'](function(_0x16bef7){return db[_0x6634('0x26')][_0x6634('0x47')]({'where':{'CustomReportId':_0x3e1b9d[_0x6634('0x3f')]['id']},'transaction':_0x16bef7})[_0x6634('0x3b')](function(_0x10899d){var _0x3aa1c2=_[_0x6634('0x25')](_0x3e1b9d['body'],function(_0x3babc7){delete _0x3babc7['id'];_0x3babc7[_0x6634('0x4b')]=_0x3e1b9d[_0x6634('0x3f')]['id'];return _0x3babc7;});return db['AnalyticFieldReport'][_0x6634('0x43')](_0x3aa1c2,{'transaction':_0x16bef7});});})['then'](function(){return db[_0x6634('0x26')][_0x6634('0x4c')]({'where':{'CustomReportId':_0x3e1b9d[_0x6634('0x3f')]['id']}});});}})[_0x6634('0x3b')](respondWithResult(_0x389df6,null))['catch'](handleError(_0x389df6,null));}; \ No newline at end of file +var _0x2066=['error','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','bulkCreate','bulkDestroy','destroy','ids','findOne','sequelize','transaction','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then'];(function(_0x233b5,_0x161156){var _0x4f8877=function(_0x5cca5d){while(--_0x5cca5d){_0x233b5['push'](_0x233b5['shift']());}};_0x4f8877(++_0x161156);}(_0x2066,0x7b));var _0x6206=function(_0x450bd3,_0x14af79){_0x450bd3=_0x450bd3-0x0;var _0x11bdcc=_0x2066[_0x450bd3];return _0x11bdcc;};'use strict';var emlformat=require(_0x6206('0x0'));var rimraf=require(_0x6206('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6206('0x2'));var moment=require(_0x6206('0x3'));var BPromise=require(_0x6206('0x4'));var Mustache=require(_0x6206('0x5'));var util=require(_0x6206('0x6'));var path=require(_0x6206('0x7'));var sox=require(_0x6206('0x8'));var csv=require(_0x6206('0x9'));var ejs=require(_0x6206('0xa'));var fs=require('fs');var fs_extra=require(_0x6206('0xb'));var _=require(_0x6206('0xc'));var squel=require(_0x6206('0xd'));var crypto=require(_0x6206('0xe'));var jsforce=require(_0x6206('0xf'));var deskjs=require(_0x6206('0x10'));var toCsv=require(_0x6206('0x9'));var querystring=require(_0x6206('0x11'));var Papa=require(_0x6206('0x12'));var Redis=require(_0x6206('0x13'));var authService=require(_0x6206('0x14'));var qs=require(_0x6206('0x15'));var as=require(_0x6206('0x16'));var hardwareService=require(_0x6206('0x17'));var logger=require(_0x6206('0x18'))(_0x6206('0x19'));var utils=require('../../config/utils');var config=require(_0x6206('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba5fc,_0x250ec9){_0x250ec9=_0x250ec9||0xcc;return function(_0x49ce14){if(_0x49ce14){return _0x5ba5fc[_0x6206('0x1b')](_0x250ec9);}return _0x5ba5fc[_0x6206('0x1c')](_0x250ec9)['end']();};}function respondWithResult(_0x1980a5,_0x1c3800){_0x1c3800=_0x1c3800||0xc8;return function(_0x127c65){if(_0x127c65){return _0x1980a5[_0x6206('0x1c')](_0x1c3800)[_0x6206('0x1d')](_0x127c65);}};}function respondWithFilteredResult(_0x2aad1b,_0x16552c){return function(_0x293d46){if(_0x293d46){var _0x19a694=typeof _0x16552c[_0x6206('0x1e')]===_0x6206('0x1f')&&typeof _0x16552c[_0x6206('0x20')]==='undefined';var _0x50ee57=_0x293d46[_0x6206('0x21')];var _0x3570b8=_0x19a694?0x0:_0x16552c[_0x6206('0x1e')];var _0x404ada=_0x19a694?_0x293d46['count']:_0x16552c['offset']+_0x16552c[_0x6206('0x20')];var _0x2612c8;if(_0x404ada>=_0x50ee57){_0x404ada=_0x50ee57;_0x2612c8=0xc8;}else{_0x2612c8=0xce;}_0x2aad1b[_0x6206('0x1c')](_0x2612c8);return _0x2aad1b[_0x6206('0x22')](_0x6206('0x23'),_0x3570b8+'-'+_0x404ada+'/'+_0x50ee57)[_0x6206('0x1d')](_0x293d46);}return null;};}function patchUpdates(_0x28078b){return function(_0x52adcc){try{jsonpatch[_0x6206('0x24')](_0x52adcc,_0x28078b,!![]);}catch(_0x23b64d){return BPromise['reject'](_0x23b64d);}return _0x52adcc['save']();};}function saveUpdates(_0xc28ec3,_0x431c2c){return function(_0x25f6ca){if(_0x25f6ca){return _0x25f6ca[_0x6206('0x25')](_0xc28ec3)[_0x6206('0x26')](function(_0x13144a){return _0x13144a;});}return null;};}function removeEntity(_0x4fb269,_0x46d95a){return function(_0x1a582d){if(_0x1a582d){return _0x1a582d['destroy']()[_0x6206('0x26')](function(){_0x4fb269[_0x6206('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e397b,_0x24b1b3){return function(_0x4f5b9e){if(!_0x4f5b9e){_0x1e397b[_0x6206('0x1b')](0x194);}return _0x4f5b9e;};}function handleError(_0x48c990,_0x2aa3e1){_0x2aa3e1=_0x2aa3e1||0x1f4;return function(_0x1a8fb2){logger[_0x6206('0x27')](_0x1a8fb2[_0x6206('0x28')]);if(_0x1a8fb2[_0x6206('0x29')]){delete _0x1a8fb2['name'];}_0x48c990[_0x6206('0x1c')](_0x2aa3e1)[_0x6206('0x2a')](_0x1a8fb2);};}exports['index']=function(_0x248e2e,_0xa7237f){var _0x3a26e9={},_0xcf6e46={},_0x3baa1b={'count':0x0,'rows':[]};var _0x55447c=_['map'](db[_0x6206('0x2b')][_0x6206('0x2c')],function(_0x5b43bb){return{'name':_0x5b43bb[_0x6206('0x2d')],'type':_0x5b43bb[_0x6206('0x2e')][_0x6206('0x2f')]};});_0xcf6e46[_0x6206('0x30')]=_['map'](_0x55447c,_0x6206('0x29'));_0xcf6e46[_0x6206('0x31')]=_[_0x6206('0x32')](_0x248e2e[_0x6206('0x31')]);_0xcf6e46[_0x6206('0x33')]=_[_0x6206('0x34')](_0xcf6e46[_0x6206('0x30')],_0xcf6e46[_0x6206('0x31')]);_0x3a26e9[_0x6206('0x35')]=_['intersection'](_0xcf6e46[_0x6206('0x30')],qs[_0x6206('0x36')](_0x248e2e['query']['fields']));_0x3a26e9[_0x6206('0x35')]=_0x3a26e9['attributes'][_0x6206('0x37')]?_0x3a26e9[_0x6206('0x35')]:_0xcf6e46[_0x6206('0x30')];if(!_0x248e2e[_0x6206('0x31')]['hasOwnProperty']('nolimit')){_0x3a26e9['limit']=qs[_0x6206('0x20')](_0x248e2e[_0x6206('0x31')][_0x6206('0x20')]);_0x3a26e9[_0x6206('0x1e')]=qs[_0x6206('0x1e')](_0x248e2e[_0x6206('0x31')][_0x6206('0x1e')]);}_0x3a26e9[_0x6206('0x38')]=qs[_0x6206('0x39')](_0x248e2e[_0x6206('0x31')]['sort']);_0x3a26e9[_0x6206('0x3a')]=qs['filters'](_[_0x6206('0x3b')](_0x248e2e[_0x6206('0x31')],_0xcf6e46[_0x6206('0x33')]),_0x55447c);if(_0x248e2e[_0x6206('0x31')][_0x6206('0x3c')]){_0x3a26e9[_0x6206('0x3a')]=_[_0x6206('0x3d')](_0x3a26e9[_0x6206('0x3a')],{'$or':_[_0x6206('0x3e')](_0x55447c,function(_0x3f38f2){if(_0x3f38f2['type']!==_0x6206('0x3f')){var _0x28095a={};_0x28095a[_0x3f38f2[_0x6206('0x29')]]={'$like':'%'+_0x248e2e[_0x6206('0x31')][_0x6206('0x3c')]+'%'};return _0x28095a;}})});}_0x3a26e9=_['merge']({},_0x3a26e9,_0x248e2e['options']);var _0x347398={'where':_0x3a26e9['where']};return db[_0x6206('0x2b')][_0x6206('0x21')](_0x347398)[_0x6206('0x26')](function(_0x421685){_0x3baa1b[_0x6206('0x21')]=_0x421685;if(_0x248e2e[_0x6206('0x31')][_0x6206('0x40')]){_0x3a26e9['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x6206('0x41')](_0x3a26e9);})[_0x6206('0x26')](function(_0x21ace4){_0x3baa1b['rows']=_0x21ace4;return _0x3baa1b;})['then'](respondWithFilteredResult(_0xa7237f,_0x3a26e9))[_0x6206('0x42')](handleError(_0xa7237f,null));};exports[_0x6206('0x43')]=function(_0x461b48,_0x189ffc){var _0x289284={'raw':![],'where':{'id':_0x461b48[_0x6206('0x44')]['id']}},_0x4c9595={};_0x4c9595[_0x6206('0x30')]=_[_0x6206('0x32')](db[_0x6206('0x2b')][_0x6206('0x2c')]);_0x4c9595[_0x6206('0x31')]=_[_0x6206('0x32')](_0x461b48['query']);_0x4c9595[_0x6206('0x33')]=_[_0x6206('0x34')](_0x4c9595[_0x6206('0x30')],_0x4c9595[_0x6206('0x31')]);_0x289284[_0x6206('0x35')]=_[_0x6206('0x34')](_0x4c9595[_0x6206('0x30')],qs[_0x6206('0x36')](_0x461b48['query'][_0x6206('0x36')]));_0x289284[_0x6206('0x35')]=_0x289284[_0x6206('0x35')]['length']?_0x289284['attributes']:_0x4c9595[_0x6206('0x30')];if(_0x461b48[_0x6206('0x31')][_0x6206('0x40')]){_0x289284[_0x6206('0x45')]=[{'all':!![]}];}_0x289284=_[_0x6206('0x3d')]({},_0x289284,_0x461b48[_0x6206('0x46')]);return db[_0x6206('0x2b')][_0x6206('0x47')](_0x289284)[_0x6206('0x26')](handleEntityNotFound(_0x189ffc,null))[_0x6206('0x26')](respondWithResult(_0x189ffc,null))['catch'](handleError(_0x189ffc,null));};exports[_0x6206('0x48')]=function(_0x37866e,_0x3cbd18){return db[_0x6206('0x2b')][_0x6206('0x48')](_0x37866e[_0x6206('0x49')],{})[_0x6206('0x26')](respondWithResult(_0x3cbd18,0xc9))[_0x6206('0x42')](handleError(_0x3cbd18,null));};exports[_0x6206('0x4a')]=function(_0x2cb8eb,_0x99ba5e){return db[_0x6206('0x2b')][_0x6206('0x4a')](_0x2cb8eb[_0x6206('0x49')],{'raw':![],'individualHooks':!![]})[_0x6206('0x26')](respondWithResult(_0x99ba5e,0xc9))[_0x6206('0x42')](handleError(_0x99ba5e,null));};exports[_0x6206('0x25')]=function(_0x5dda84,_0x1b9878){if(_0x5dda84[_0x6206('0x49')]['id']){delete _0x5dda84[_0x6206('0x49')]['id'];}return db[_0x6206('0x2b')][_0x6206('0x47')]({'where':{'id':_0x5dda84['params']['id']}})[_0x6206('0x26')](handleEntityNotFound(_0x1b9878,null))[_0x6206('0x26')](saveUpdates(_0x5dda84['body'],null))[_0x6206('0x26')](respondWithResult(_0x1b9878,null))[_0x6206('0x42')](handleError(_0x1b9878,null));};exports['destroy']=function(_0x522c3b,_0x448ec8){return db['AnalyticFieldReport']['find']({'where':{'id':_0x522c3b['params']['id']}})[_0x6206('0x26')](handleEntityNotFound(_0x448ec8,null))[_0x6206('0x26')](removeEntity(_0x448ec8,null))['catch'](handleError(_0x448ec8,null));};exports[_0x6206('0x4b')]=function(_0xdc6099,_0x266f05){return db['AnalyticFieldReport'][_0x6206('0x4c')]({'where':{'id':_0xdc6099[_0x6206('0x31')][_0x6206('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x6206('0x26')](respondWithResult(_0x266f05,0xcc))[_0x6206('0x42')](handleError(_0x266f05,null));};exports['addFields']=function(_0x5e623b,_0x2db092,_0x130a5e){return db['AnalyticCustomReport'][_0x6206('0x4e')]({'where':{'id':_0x5e623b[_0x6206('0x44')]['id']}})[_0x6206('0x26')](handleEntityNotFound(_0x2db092,null))[_0x6206('0x26')](function(_0x2b091c){if(_0x2b091c){return db[_0x6206('0x4f')][_0x6206('0x50')](function(_0x33dc09){return db[_0x6206('0x2b')]['destroy']({'where':{'CustomReportId':_0x5e623b['params']['id']},'transaction':_0x33dc09})[_0x6206('0x26')](function(_0x3e79cd){var _0x31f6e0=_[_0x6206('0x3e')](_0x5e623b[_0x6206('0x49')],function(_0x52a547){delete _0x52a547['id'];_0x52a547['CustomReportId']=_0x5e623b['params']['id'];return _0x52a547;});return db[_0x6206('0x2b')][_0x6206('0x4a')](_0x31f6e0,{'transaction':_0x33dc09});});})[_0x6206('0x26')](function(){return db[_0x6206('0x2b')][_0x6206('0x41')]({'where':{'CustomReportId':_0x5e623b[_0x6206('0x44')]['id']}});});}})['then'](respondWithResult(_0x2db092,null))[_0x6206('0x42')](handleError(_0x2db092,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 1d2889c..dff18f9 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 _0xeeee=['analytics_report_fields','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0xeeee,0x191));var _0xeeee=function(_0x77841d,_0x2a278b){_0x77841d=_0x77841d-0x0;var _0x45e1df=_0xeeee[_0x77841d];return _0x45e1df;};'use strict';var _=require(_0xeeee('0x0'));var util=require(_0xeeee('0x1'));var logger=require(_0xeeee('0x2'))('api');var moment=require(_0xeeee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeeee('0x4'));var config=require(_0xeeee('0x5'));var attributes=require(_0xeeee('0x6'));module[_0xeeee('0x7')]=function(_0x22cc49,_0x498aac){return _0x22cc49['define'](_0xeeee('0x8'),attributes,{'tableName':_0xeeee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87c3=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3a1061,_0x2005ce){var _0x5135b3=function(_0xd3671d){while(--_0xd3671d){_0x3a1061['push'](_0x3a1061['shift']());}};_0x5135b3(++_0x2005ce);}(_0x87c3,0xe8));var _0x387c=function(_0x2d5d93,_0x500fd8){_0x2d5d93=_0x2d5d93-0x0;var _0x389b4a=_0x87c3[_0x2d5d93];return _0x389b4a;};'use strict';var _=require(_0x387c('0x0'));var util=require('util');var logger=require(_0x387c('0x1'))(_0x387c('0x2'));var moment=require(_0x387c('0x3'));var BPromise=require(_0x387c('0x4'));var rp=require(_0x387c('0x5'));var fs=require('fs');var path=require(_0x387c('0x6'));var rimraf=require('rimraf');var config=require(_0x387c('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x387c('0x8')]=function(_0x371b59,_0x5c1f52){return _0x371b59[_0x387c('0x9')](_0x387c('0xa'),attributes,{'tableName':_0x387c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 5b98577..6f38c64 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 _0x64ab=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x297acf,_0x530d6c){var _0x2dd757=function(_0x1b7aa9){while(--_0x1b7aa9){_0x297acf['push'](_0x297acf['shift']());}};_0x2dd757(++_0x530d6c);}(_0x64ab,0x121));var _0xb64a=function(_0x1e97c5,_0x5cdaac){_0x1e97c5=_0x1e97c5-0x0;var _0x374ec0=_0x64ab[_0x1e97c5];return _0x374ec0;};'use strict';var _=require(_0xb64a('0x0'));var util=require(_0xb64a('0x1'));var moment=require(_0xb64a('0x2'));var BPromise=require(_0xb64a('0x3'));var rs=require(_0xb64a('0x4'));var fs=require('fs');var Redis=require(_0xb64a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb64a('0x6'));var logger=require(_0xb64a('0x7'))('rpc');var config=require(_0xb64a('0x8'));var jayson=require(_0xb64a('0x9'));var client=jayson[_0xb64a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c8a85,_0x5970f7,_0x5b58dc){return new BPromise(function(_0x2cbde4,_0x3e4794){return client['request'](_0x2c8a85,_0x5b58dc)[_0xb64a('0xb')](function(_0x586df0){logger[_0xb64a('0xc')](_0xb64a('0xd'),_0x5970f7,_0xb64a('0xe'));logger[_0xb64a('0xf')](_0xb64a('0x10'),_0x5970f7,'request\x20sent',JSON['stringify'](_0x586df0));if(_0x586df0['error']){if(_0x586df0[_0xb64a('0x11')][_0xb64a('0x12')]===0x1f4){logger[_0xb64a('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5970f7,_0x586df0[_0xb64a('0x11')][_0xb64a('0x13')]);return _0x3e4794(_0x586df0[_0xb64a('0x11')]['message']);}logger['error'](_0xb64a('0xd'),_0x5970f7,_0x586df0['error'][_0xb64a('0x13')]);return _0x2cbde4(_0x586df0[_0xb64a('0x11')][_0xb64a('0x13')]);}else{logger[_0xb64a('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5970f7,_0xb64a('0xe'));_0x2cbde4(_0x586df0[_0xb64a('0x14')][_0xb64a('0x13')]);}})['catch'](function(_0x4a7cbe){logger['error'](_0xb64a('0xd'),_0x5970f7,_0x4a7cbe);_0x3e4794(_0x4a7cbe);});});} \ No newline at end of file +var _0x75ca=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x218dbb,_0x39b4a7){var _0x46531c=function(_0x3dca46){while(--_0x3dca46){_0x218dbb['push'](_0x218dbb['shift']());}};_0x46531c(++_0x39b4a7);}(_0x75ca,0x1a0));var _0xa75c=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x75ca[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0xa75c('0x0'));var util=require(_0xa75c('0x1'));var moment=require(_0xa75c('0x2'));var BPromise=require(_0xa75c('0x3'));var rs=require(_0xa75c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa75c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8335,_0x3ee9c3,_0x23fe57){return new BPromise(function(_0x1453fc,_0xc17b8d){return client[_0xa75c('0x7')](_0x3e8335,_0x23fe57)['then'](function(_0x5b19a5){logger[_0xa75c('0x8')](_0xa75c('0x9'),_0x3ee9c3,_0xa75c('0xa'));logger[_0xa75c('0xb')](_0xa75c('0xc'),_0x3ee9c3,_0xa75c('0xa'),JSON[_0xa75c('0xd')](_0x5b19a5));if(_0x5b19a5['error']){if(_0x5b19a5[_0xa75c('0xe')][_0xa75c('0xf')]===0x1f4){logger[_0xa75c('0xe')](_0xa75c('0x9'),_0x3ee9c3,_0x5b19a5[_0xa75c('0xe')]['message']);return _0xc17b8d(_0x5b19a5[_0xa75c('0xe')][_0xa75c('0x10')]);}logger['error'](_0xa75c('0x9'),_0x3ee9c3,_0x5b19a5[_0xa75c('0xe')][_0xa75c('0x10')]);return _0x1453fc(_0x5b19a5['error'][_0xa75c('0x10')]);}else{logger[_0xa75c('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3ee9c3,_0xa75c('0xa'));_0x1453fc(_0x5b19a5['result'][_0xa75c('0x10')]);}})[_0xa75c('0x11')](function(_0x7989cc){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3ee9c3,_0x7989cc);_0xc17b8d(_0x7989cc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 104f881..7a944f7 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(_0x1c5c8d,_0x5d8ff9){var _0x14925b=function(_0x1f2ed1){while(--_0x1f2ed1){_0x1c5c8d['push'](_0x1c5c8d['shift']());}};_0x14925b(++_0x5d8ff9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x403aa2,_0x1140bc){var _0x20f524=function(_0x1269ea){while(--_0x1269ea){_0x403aa2['push'](_0x403aa2['shift']());}};_0x20f524(++_0x1140bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 a145347..100dbac 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 _0x95c5=['exports','name','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x153));var _0x595c=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0x95c5[_0x2967c1];return _0x103397;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x595c('0x2')},'table':{'type':Sequelize[_0x595c('0x3')]},'metric':{'type':Sequelize[_0x595c('0x4')]},'description':{'type':Sequelize[_0x595c('0x3')]}}; \ No newline at end of file +var _0x2e31=['TEXT','sequelize','exports','STRING'];(function(_0x1f243b,_0x5011f0){var _0x373f2a=function(_0x5ac146){while(--_0x5ac146){_0x1f243b['push'](_0x1f243b['shift']());}};_0x373f2a(++_0x5011f0);}(_0x2e31,0x145));var _0x12e3=function(_0x52970a,_0x282d7e){_0x52970a=_0x52970a-0x0;var _0x590faa=_0x2e31[_0x52970a];return _0x590faa;};'use strict';var Sequelize=require(_0x12e3('0x0'));module[_0x12e3('0x1')]={'name':{'type':Sequelize[_0x12e3('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x12e3('0x2')]},'metric':{'type':Sequelize[_0x12e3('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 dfe7d27..8dea117 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5df375,_0x3afbbe){_0x5df375=_0x5df375-0x0;var _0x18c11=_0x1cb9[_0x5df375];return _0x18c11;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1c6b91,_0x399c82){var _0x522c9a=function(_0xb5d12a){while(--_0xb5d12a){_0x1c6b91['push'](_0x1c6b91['shift']());}};_0x522c9a(++_0x399c82);}(_0x4b84,0x1cc));var _0x44b8=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0x4b84[_0x564821];return _0x2b604d;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 467095f..be873de 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 _0x4753=['bluebird','path','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x5d867a,_0x11dd28){var _0xe501f2=function(_0x42c237){while(--_0x42c237){_0x5d867a['push'](_0x5d867a['shift']());}};_0xe501f2(++_0x11dd28);}(_0x4753,0x1f4));var _0x3475=function(_0xb73a25,_0x4492fb){_0xb73a25=_0xb73a25-0x0;var _0x43341d=_0x4753[_0xb73a25];return _0x43341d;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var logger=require(_0x3475('0x2'))('api');var moment=require(_0x3475('0x3'));var BPromise=require(_0x3475('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3475('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x12df57,_0x18bd53){return _0x12df57['define'](_0x3475('0x6'),attributes,{'tableName':_0x3475('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','analytics_metrics','bluebird'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x5d58,0x187));var _0x85d5=function(_0x38b5b1,_0x141563){_0x38b5b1=_0x38b5b1-0x0;var _0x3cd8be=_0x5d58[_0x38b5b1];return _0x3cd8be;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./analyticMetric.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('AnalyticMetric',attributes,{'tableName':_0x85d5('0x6'),'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 9c5b3c6..e8ef8a5 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 _0x7335=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x7335,0x177));var _0x5733=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7335[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x5733('0x0'));var util=require(_0x5733('0x1'));var moment=require(_0x5733('0x2'));var BPromise=require(_0x5733('0x3'));var rs=require(_0x5733('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5733('0x5'))['db'];var utils=require(_0x5733('0x6'));var logger=require(_0x5733('0x7'))(_0x5733('0x8'));var config=require(_0x5733('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5733('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59f7a7,_0x5dc2e9,_0x29eb7a){return new BPromise(function(_0x6ab59b,_0x2bca75){return client[_0x5733('0xb')](_0x59f7a7,_0x29eb7a)[_0x5733('0xc')](function(_0xaf2997){logger[_0x5733('0xd')](_0x5733('0xe'),_0x5dc2e9,'request\x20sent');logger[_0x5733('0xf')](_0x5733('0x10'),_0x5dc2e9,_0x5733('0x11'),JSON['stringify'](_0xaf2997));if(_0xaf2997[_0x5733('0x12')]){if(_0xaf2997[_0x5733('0x12')]['code']===0x1f4){logger['error'](_0x5733('0xe'),_0x5dc2e9,_0xaf2997[_0x5733('0x12')][_0x5733('0x13')]);return _0x2bca75(_0xaf2997[_0x5733('0x12')][_0x5733('0x13')]);}logger[_0x5733('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x5dc2e9,_0xaf2997['error'][_0x5733('0x13')]);return _0x6ab59b(_0xaf2997[_0x5733('0x12')]['message']);}else{logger[_0x5733('0xd')](_0x5733('0xe'),_0x5dc2e9,_0x5733('0x11'));_0x6ab59b(_0xaf2997['result'][_0x5733('0x13')]);}})[_0x5733('0x14')](function(_0x27748a){logger[_0x5733('0x12')](_0x5733('0xe'),_0x5dc2e9,_0x27748a);_0x2bca75(_0x27748a);});});} \ No newline at end of file +var _0x6931=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x302108,_0x2133c6){var _0x47504b=function(_0x4e35c4){while(--_0x4e35c4){_0x302108['push'](_0x302108['shift']());}};_0x47504b(++_0x2133c6);}(_0x6931,0xac));var _0x1693=function(_0x4bf895,_0x495e79){_0x4bf895=_0x4bf895-0x0;var _0x4f08b1=_0x6931[_0x4bf895];return _0x4f08b1;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var moment=require(_0x1693('0x2'));var BPromise=require(_0x1693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1693('0x4'))['db'];var utils=require(_0x1693('0x5'));var logger=require('../../config/logger')(_0x1693('0x6'));var config=require('../../config/environment');var jayson=require(_0x1693('0x7'));var client=jayson[_0x1693('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32e244,_0x3c66fe,_0x429814){return new BPromise(function(_0x286cca,_0x3e0daa){return client[_0x1693('0x9')](_0x32e244,_0x429814)['then'](function(_0x4ad7aa){logger[_0x1693('0xa')](_0x1693('0xb'),_0x3c66fe,'request\x20sent');logger['debug'](_0x1693('0xc'),_0x3c66fe,_0x1693('0xd'),JSON[_0x1693('0xe')](_0x4ad7aa));if(_0x4ad7aa['error']){if(_0x4ad7aa[_0x1693('0xf')]['code']===0x1f4){logger[_0x1693('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3c66fe,_0x4ad7aa['error'][_0x1693('0x10')]);return _0x3e0daa(_0x4ad7aa['error'][_0x1693('0x10')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3c66fe,_0x4ad7aa['error'][_0x1693('0x10')]);return _0x286cca(_0x4ad7aa['error'][_0x1693('0x10')]);}else{logger['info'](_0x1693('0xb'),_0x3c66fe,_0x1693('0xd'));_0x286cca(_0x4ad7aa[_0x1693('0x11')][_0x1693('0x10')]);}})[_0x1693('0x12')](function(_0x46c086){logger[_0x1693('0xf')](_0x1693('0xb'),_0x3c66fe,_0x46c086);_0x3e0daa(_0x46c086);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9421039..85a4477 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 _0x6c32=['post','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x50e49c,_0x6a9479){var _0x5d9e5a=function(_0x9add58){while(--_0x9add58){_0x50e49c['push'](_0x50e49c['shift']());}};_0x5d9e5a(++_0x6a9479);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x26c3('0x0'));var util=require('util');var path=require(_0x26c3('0x1'));var timeout=require('connect-timeout');var express=require(_0x26c3('0x2'));var router=express['Router']();var fs_extra=require(_0x26c3('0x3'));var auth=require(_0x26c3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26c3('0x5'));router[_0x26c3('0x6')]('/',auth[_0x26c3('0x7')](),controller[_0x26c3('0x8')]);router[_0x26c3('0x6')](_0x26c3('0x9'),auth[_0x26c3('0x7')](),controller[_0x26c3('0xa')]);router[_0x26c3('0xb')]('/',auth[_0x26c3('0x7')](),controller['create']);router['put'](_0x26c3('0x9'),auth['isAuthenticated'](),controller[_0x26c3('0xc')]);router[_0x26c3('0xd')]('/:id',auth[_0x26c3('0x7')](),controller[_0x26c3('0xe')]);module[_0x26c3('0xf')]=router; \ No newline at end of file +var _0x4986=['delete','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x5e9e5f,_0x19aeeb){var _0x4944f5=function(_0x1add77){while(--_0x1add77){_0x5e9e5f['push'](_0x5e9e5f['shift']());}};_0x4944f5(++_0x19aeeb);}(_0x4986,0x6e));var _0x6498=function(_0x3f76ab,_0x3b4b90){_0x3f76ab=_0x3f76ab-0x0;var _0x2bbb91=_0x4986[_0x3f76ab];return _0x2bbb91;};'use strict';var multer=require(_0x6498('0x0'));var util=require(_0x6498('0x1'));var path=require(_0x6498('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6498('0x3')]();var fs_extra=require(_0x6498('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6498('0x5'));var config=require(_0x6498('0x6'));var controller=require(_0x6498('0x7'));router[_0x6498('0x8')]('/',auth[_0x6498('0x9')](),controller[_0x6498('0xa')]);router[_0x6498('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6498('0xb')]);router[_0x6498('0xc')]('/',auth[_0x6498('0x9')](),controller[_0x6498('0xd')]);router[_0x6498('0xe')]('/:id',auth[_0x6498('0x9')](),controller[_0x6498('0xf')]);router[_0x6498('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6498('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f98332a..dc55a1d 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 _0x3098=['exports','TEXT','sequelize'];(function(_0x37f4c1,_0x4416dd){var _0x118c29=function(_0x3c6d59){while(--_0x3c6d59){_0x37f4c1['push'](_0x37f4c1['shift']());}};_0x118c29(++_0x4416dd);}(_0x3098,0x86));var _0x8309=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x3098[_0x39bc44];return _0x2916d8;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'tree':{'type':Sequelize[_0x8309('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf899=['TEXT','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf899,0xa6));var _0x9f89=function(_0x186f6e,_0x36b6a8){_0x186f6e=_0x186f6e-0x0;var _0x580e66=_0xf899[_0x186f6e];return _0x580e66;};'use strict';var Sequelize=require(_0x9f89('0x0'));module[_0x9f89('0x1')]={'tree':{'type':Sequelize[_0x9f89('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 5107fd7..0bc3009 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 _0xb72b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','reject','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','AnalyticTreeReport','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0xb72b,0x89));var _0xbb72=function(_0xd37592,_0x5b1c4a){_0xd37592=_0xd37592-0x0;var _0x8371fd=_0xb72b[_0xd37592];return _0x8371fd;};'use strict';var emlformat=require(_0xbb72('0x0'));var rimraf=require(_0xbb72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb72('0x2'));var rp=require(_0xbb72('0x3'));var moment=require(_0xbb72('0x4'));var BPromise=require(_0xbb72('0x5'));var Mustache=require('mustache');var util=require(_0xbb72('0x6'));var path=require(_0xbb72('0x7'));var sox=require(_0xbb72('0x8'));var csv=require(_0xbb72('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb72('0xa'));var _=require(_0xbb72('0xb'));var squel=require(_0xbb72('0xc'));var crypto=require(_0xbb72('0xd'));var jsforce=require(_0xbb72('0xe'));var deskjs=require(_0xbb72('0xf'));var toCsv=require(_0xbb72('0x9'));var querystring=require(_0xbb72('0x10'));var Papa=require(_0xbb72('0x11'));var Redis=require(_0xbb72('0x12'));var authService=require(_0xbb72('0x13'));var qs=require(_0xbb72('0x14'));var as=require(_0xbb72('0x15'));var hardwareService=require(_0xbb72('0x16'));var logger=require(_0xbb72('0x17'))(_0xbb72('0x18'));var utils=require(_0xbb72('0x19'));var config=require(_0xbb72('0x1a'));var licenseUtil=require(_0xbb72('0x1b'));var db=require(_0xbb72('0x1c'))['db'];function respondWithStatusCode(_0x4e0e4a,_0x1d3dae){_0x1d3dae=_0x1d3dae||0xcc;return function(_0x582562){if(_0x582562){return _0x4e0e4a[_0xbb72('0x1d')](_0x1d3dae);}return _0x4e0e4a[_0xbb72('0x1e')](_0x1d3dae)['end']();};}function respondWithResult(_0xe02e30,_0x4fa7d8){_0x4fa7d8=_0x4fa7d8||0xc8;return function(_0x22019f){if(_0x22019f){return _0xe02e30['status'](_0x4fa7d8)[_0xbb72('0x1f')](_0x22019f);}};}function respondWithFilteredResult(_0x4ad92c,_0x221e54){return function(_0x52d6ff){if(_0x52d6ff){var _0x43c93f=typeof _0x221e54[_0xbb72('0x20')]===_0xbb72('0x21')&&typeof _0x221e54[_0xbb72('0x22')]===_0xbb72('0x21');var _0x3c2197=_0x52d6ff['count'];var _0x263a08=_0x43c93f?0x0:_0x221e54[_0xbb72('0x20')];var _0x3b0685=_0x43c93f?_0x52d6ff['count']:_0x221e54[_0xbb72('0x20')]+_0x221e54['limit'];var _0x170352;if(_0x3b0685>=_0x3c2197){_0x3b0685=_0x3c2197;_0x170352=0xc8;}else{_0x170352=0xce;}_0x4ad92c[_0xbb72('0x1e')](_0x170352);return _0x4ad92c['set']('Content-Range',_0x263a08+'-'+_0x3b0685+'/'+_0x3c2197)[_0xbb72('0x1f')](_0x52d6ff);}return null;};}function patchUpdates(_0x6c63fd){return function(_0x188bfd){try{jsonpatch['apply'](_0x188bfd,_0x6c63fd,!![]);}catch(_0x1f69cb){return BPromise[_0xbb72('0x23')](_0x1f69cb);}return _0x188bfd['save']();};}function saveUpdates(_0x35c4d6,_0x529f98){return function(_0x31d7f1){if(_0x31d7f1){return _0x31d7f1[_0xbb72('0x24')](_0x35c4d6)[_0xbb72('0x25')](function(_0x5939c9){return _0x5939c9;});}return null;};}function removeEntity(_0x1fdd76,_0x2d1bd2){return function(_0x2432e1){if(_0x2432e1){return _0x2432e1[_0xbb72('0x26')]()[_0xbb72('0x25')](function(){_0x1fdd76[_0xbb72('0x1e')](0xcc)[_0xbb72('0x27')]();});}};}function handleEntityNotFound(_0x171c48,_0x81ec4d){return function(_0x2fb457){if(!_0x2fb457){_0x171c48['sendStatus'](0x194);}return _0x2fb457;};}function handleError(_0x51acc0,_0x12ddaa){_0x12ddaa=_0x12ddaa||0x1f4;return function(_0x46f833){logger[_0xbb72('0x28')](_0x46f833[_0xbb72('0x29')]);if(_0x46f833[_0xbb72('0x2a')]){delete _0x46f833[_0xbb72('0x2a')];}_0x51acc0['status'](_0x12ddaa)[_0xbb72('0x2b')](_0x46f833);};}exports['index']=function(_0x5dbda6,_0x23167f){var _0x31f499={},_0x16bc1a={},_0x14a089={'count':0x0,'rows':[]};var _0x714bec=_[_0xbb72('0x2c')](db['AnalyticTreeReport'][_0xbb72('0x2d')],function(_0x3050f3){return{'name':_0x3050f3[_0xbb72('0x2e')],'type':_0x3050f3['type']['key']};});_0x16bc1a[_0xbb72('0x2f')]=_[_0xbb72('0x2c')](_0x714bec,'name');_0x16bc1a[_0xbb72('0x30')]=_[_0xbb72('0x31')](_0x5dbda6[_0xbb72('0x30')]);_0x16bc1a['filters']=_['intersection'](_0x16bc1a[_0xbb72('0x2f')],_0x16bc1a[_0xbb72('0x30')]);_0x31f499[_0xbb72('0x32')]=_[_0xbb72('0x33')](_0x16bc1a[_0xbb72('0x2f')],qs['fields'](_0x5dbda6['query'][_0xbb72('0x34')]));_0x31f499[_0xbb72('0x32')]=_0x31f499[_0xbb72('0x32')][_0xbb72('0x35')]?_0x31f499[_0xbb72('0x32')]:_0x16bc1a['model'];if(!_0x5dbda6['query'][_0xbb72('0x36')]('nolimit')){_0x31f499[_0xbb72('0x22')]=qs[_0xbb72('0x22')](_0x5dbda6['query'][_0xbb72('0x22')]);_0x31f499[_0xbb72('0x20')]=qs['offset'](_0x5dbda6['query'][_0xbb72('0x20')]);}_0x31f499[_0xbb72('0x37')]=qs[_0xbb72('0x38')](_0x5dbda6['query'][_0xbb72('0x38')]);_0x31f499[_0xbb72('0x39')]=qs[_0xbb72('0x3a')](_[_0xbb72('0x3b')](_0x5dbda6[_0xbb72('0x30')],_0x16bc1a[_0xbb72('0x3a')]),_0x714bec);if(_0x5dbda6[_0xbb72('0x30')]['filter']){_0x31f499[_0xbb72('0x39')]=_[_0xbb72('0x3c')](_0x31f499['where'],{'$or':_[_0xbb72('0x2c')](_0x714bec,function(_0xaaf99e){if(_0xaaf99e[_0xbb72('0x3d')]!==_0xbb72('0x3e')){var _0x1ad0c9={};_0x1ad0c9[_0xaaf99e[_0xbb72('0x2a')]]={'$like':'%'+_0x5dbda6[_0xbb72('0x30')][_0xbb72('0x3f')]+'%'};return _0x1ad0c9;}})});}_0x31f499=_[_0xbb72('0x3c')]({},_0x31f499,_0x5dbda6[_0xbb72('0x40')]);var _0x5e9478={'where':_0x31f499[_0xbb72('0x39')]};return db[_0xbb72('0x41')][_0xbb72('0x42')](_0x5e9478)[_0xbb72('0x25')](function(_0x412799){_0x14a089[_0xbb72('0x42')]=_0x412799;if(_0x5dbda6['query'][_0xbb72('0x43')]){_0x31f499[_0xbb72('0x44')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xbb72('0x45')](_0x31f499);})[_0xbb72('0x25')](function(_0x9a80d){_0x14a089[_0xbb72('0x46')]=_0x9a80d;return _0x14a089;})[_0xbb72('0x25')](respondWithFilteredResult(_0x23167f,_0x31f499))['catch'](handleError(_0x23167f,null));};exports[_0xbb72('0x47')]=function(_0x3608dc,_0x31d694){var _0x1f6f10={'raw':!![],'where':{'id':_0x3608dc[_0xbb72('0x48')]['id']}},_0x2638d4={};_0x2638d4['model']=_[_0xbb72('0x31')](db['AnalyticTreeReport'][_0xbb72('0x2d')]);_0x2638d4[_0xbb72('0x30')]=_[_0xbb72('0x31')](_0x3608dc[_0xbb72('0x30')]);_0x2638d4[_0xbb72('0x3a')]=_['intersection'](_0x2638d4['model'],_0x2638d4[_0xbb72('0x30')]);_0x1f6f10['attributes']=_['intersection'](_0x2638d4[_0xbb72('0x2f')],qs[_0xbb72('0x34')](_0x3608dc[_0xbb72('0x30')]['fields']));_0x1f6f10['attributes']=_0x1f6f10[_0xbb72('0x32')][_0xbb72('0x35')]?_0x1f6f10['attributes']:_0x2638d4[_0xbb72('0x2f')];if(_0x3608dc[_0xbb72('0x30')][_0xbb72('0x43')]){_0x1f6f10['include']=[{'all':!![]}];}_0x1f6f10=_[_0xbb72('0x3c')]({},_0x1f6f10,_0x3608dc[_0xbb72('0x40')]);return db[_0xbb72('0x41')][_0xbb72('0x49')](_0x1f6f10)[_0xbb72('0x25')](handleEntityNotFound(_0x31d694,null))[_0xbb72('0x25')](respondWithResult(_0x31d694,null))[_0xbb72('0x4a')](handleError(_0x31d694,null));};exports['create']=function(_0x244367,_0x3028be){return db[_0xbb72('0x41')][_0xbb72('0x4b')](_0x244367[_0xbb72('0x4c')],{})[_0xbb72('0x25')](respondWithResult(_0x3028be,0xc9))[_0xbb72('0x4a')](handleError(_0x3028be,null));};exports[_0xbb72('0x24')]=function(_0x4ed75a,_0x1a398f){if(_0x4ed75a['body']['id']){delete _0x4ed75a[_0xbb72('0x4c')]['id'];}return db[_0xbb72('0x41')][_0xbb72('0x49')]({'where':{'id':_0x4ed75a['params']['id']}})['then'](handleEntityNotFound(_0x1a398f,null))['then'](saveUpdates(_0x4ed75a['body'],null))[_0xbb72('0x25')](respondWithResult(_0x1a398f,null))[_0xbb72('0x4a')](handleError(_0x1a398f,null));};exports[_0xbb72('0x26')]=function(_0x292d93,_0x423a16){return db['AnalyticTreeReport']['find']({'where':{'id':_0x292d93[_0xbb72('0x48')]['id']}})[_0xbb72('0x25')](handleEntityNotFound(_0x423a16,null))['then'](removeEntity(_0x423a16,null))[_0xbb72('0x4a')](handleError(_0x423a16,null));}; \ No newline at end of file +var _0xdddf=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','fields','length','find','create','update','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x409746,_0x44ad4e){var _0x3faabb=function(_0x2d04b0){while(--_0x2d04b0){_0x409746['push'](_0x409746['shift']());}};_0x3faabb(++_0x44ad4e);}(_0xdddf,0x1f1));var _0xfddd=function(_0x527a3e,_0x5076fc){_0x527a3e=_0x527a3e-0x0;var _0x380edf=_0xdddf[_0x527a3e];return _0x380edf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfddd('0x0'));var jsonpatch=require(_0xfddd('0x1'));var rp=require(_0xfddd('0x2'));var moment=require(_0xfddd('0x3'));var BPromise=require(_0xfddd('0x4'));var Mustache=require(_0xfddd('0x5'));var util=require('util');var path=require('path');var sox=require(_0xfddd('0x6'));var csv=require(_0xfddd('0x7'));var ejs=require(_0xfddd('0x8'));var fs=require('fs');var fs_extra=require(_0xfddd('0x9'));var _=require(_0xfddd('0xa'));var squel=require('squel');var crypto=require(_0xfddd('0xb'));var jsforce=require(_0xfddd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfddd('0x7'));var querystring=require(_0xfddd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfddd('0xe'));var as=require(_0xfddd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfddd('0x10'))(_0xfddd('0x11'));var utils=require('../../config/utils');var config=require(_0xfddd('0x12'));var licenseUtil=require(_0xfddd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54d30d,_0x5282c6){_0x5282c6=_0x5282c6||0xcc;return function(_0x1b00f2){if(_0x1b00f2){return _0x54d30d[_0xfddd('0x14')](_0x5282c6);}return _0x54d30d[_0xfddd('0x15')](_0x5282c6)['end']();};}function respondWithResult(_0x357e0e,_0x40bed1){_0x40bed1=_0x40bed1||0xc8;return function(_0x507781){if(_0x507781){return _0x357e0e['status'](_0x40bed1)[_0xfddd('0x16')](_0x507781);}};}function respondWithFilteredResult(_0x3e28a6,_0x43d948){return function(_0x328e64){if(_0x328e64){var _0x546c42=typeof _0x43d948[_0xfddd('0x17')]==='undefined'&&typeof _0x43d948[_0xfddd('0x18')]===_0xfddd('0x19');var _0x34a6af=_0x328e64['count'];var _0x3f7d29=_0x546c42?0x0:_0x43d948[_0xfddd('0x17')];var _0x4b4161=_0x546c42?_0x328e64['count']:_0x43d948[_0xfddd('0x17')]+_0x43d948[_0xfddd('0x18')];var _0x5c8eae;if(_0x4b4161>=_0x34a6af){_0x4b4161=_0x34a6af;_0x5c8eae=0xc8;}else{_0x5c8eae=0xce;}_0x3e28a6['status'](_0x5c8eae);return _0x3e28a6[_0xfddd('0x1a')](_0xfddd('0x1b'),_0x3f7d29+'-'+_0x4b4161+'/'+_0x34a6af)[_0xfddd('0x16')](_0x328e64);}return null;};}function patchUpdates(_0x3614fb){return function(_0x3d3b4c){try{jsonpatch[_0xfddd('0x1c')](_0x3d3b4c,_0x3614fb,!![]);}catch(_0x3415ea){return BPromise[_0xfddd('0x1d')](_0x3415ea);}return _0x3d3b4c[_0xfddd('0x1e')]();};}function saveUpdates(_0x4539c5,_0x269c9b){return function(_0x50b079){if(_0x50b079){return _0x50b079['update'](_0x4539c5)[_0xfddd('0x1f')](function(_0x5eb531){return _0x5eb531;});}return null;};}function removeEntity(_0x2c41e3,_0x145e52){return function(_0x38e0f8){if(_0x38e0f8){return _0x38e0f8[_0xfddd('0x20')]()['then'](function(){_0x2c41e3[_0xfddd('0x15')](0xcc)[_0xfddd('0x21')]();});}};}function handleEntityNotFound(_0x1b7cb3,_0x49a487){return function(_0x44324c){if(!_0x44324c){_0x1b7cb3[_0xfddd('0x14')](0x194);}return _0x44324c;};}function handleError(_0x456159,_0x3d4c89){_0x3d4c89=_0x3d4c89||0x1f4;return function(_0x42248e){logger[_0xfddd('0x22')](_0x42248e[_0xfddd('0x23')]);if(_0x42248e[_0xfddd('0x24')]){delete _0x42248e['name'];}_0x456159[_0xfddd('0x15')](_0x3d4c89)['send'](_0x42248e);};}exports[_0xfddd('0x25')]=function(_0x4f4aaf,_0x501345){var _0x2955ed={},_0x2baa6b={},_0x4918b1={'count':0x0,'rows':[]};var _0x38fdbd=_[_0xfddd('0x26')](db[_0xfddd('0x27')][_0xfddd('0x28')],function(_0x3d8916){return{'name':_0x3d8916[_0xfddd('0x29')],'type':_0x3d8916[_0xfddd('0x2a')][_0xfddd('0x2b')]};});_0x2baa6b['model']=_[_0xfddd('0x26')](_0x38fdbd,_0xfddd('0x24'));_0x2baa6b[_0xfddd('0x2c')]=_[_0xfddd('0x2d')](_0x4f4aaf[_0xfddd('0x2c')]);_0x2baa6b[_0xfddd('0x2e')]=_['intersection'](_0x2baa6b[_0xfddd('0x2f')],_0x2baa6b[_0xfddd('0x2c')]);_0x2955ed[_0xfddd('0x30')]=_['intersection'](_0x2baa6b[_0xfddd('0x2f')],qs['fields'](_0x4f4aaf['query']['fields']));_0x2955ed['attributes']=_0x2955ed['attributes']['length']?_0x2955ed[_0xfddd('0x30')]:_0x2baa6b[_0xfddd('0x2f')];if(!_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x31')](_0xfddd('0x32'))){_0x2955ed['limit']=qs[_0xfddd('0x18')](_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x18')]);_0x2955ed[_0xfddd('0x17')]=qs['offset'](_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x17')]);}_0x2955ed[_0xfddd('0x33')]=qs[_0xfddd('0x34')](_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x34')]);_0x2955ed[_0xfddd('0x35')]=qs[_0xfddd('0x2e')](_[_0xfddd('0x36')](_0x4f4aaf['query'],_0x2baa6b[_0xfddd('0x2e')]),_0x38fdbd);if(_0x4f4aaf[_0xfddd('0x2c')]['filter']){_0x2955ed['where']=_[_0xfddd('0x37')](_0x2955ed[_0xfddd('0x35')],{'$or':_[_0xfddd('0x26')](_0x38fdbd,function(_0x7c4cc0){if(_0x7c4cc0['type']!=='VIRTUAL'){var _0x40164b={};_0x40164b[_0x7c4cc0[_0xfddd('0x24')]]={'$like':'%'+_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x38')]+'%'};return _0x40164b;}})});}_0x2955ed=_[_0xfddd('0x37')]({},_0x2955ed,_0x4f4aaf[_0xfddd('0x39')]);var _0x43f6cf={'where':_0x2955ed[_0xfddd('0x35')]};return db[_0xfddd('0x27')][_0xfddd('0x3a')](_0x43f6cf)['then'](function(_0x3a65f2){_0x4918b1[_0xfddd('0x3a')]=_0x3a65f2;if(_0x4f4aaf[_0xfddd('0x2c')][_0xfddd('0x3b')]){_0x2955ed[_0xfddd('0x3c')]=[{'all':!![]}];}return db[_0xfddd('0x27')][_0xfddd('0x3d')](_0x2955ed);})['then'](function(_0x3e479d){_0x4918b1[_0xfddd('0x3e')]=_0x3e479d;return _0x4918b1;})[_0xfddd('0x1f')](respondWithFilteredResult(_0x501345,_0x2955ed))[_0xfddd('0x3f')](handleError(_0x501345,null));};exports[_0xfddd('0x40')]=function(_0x36d6ed,_0x4297d1){var _0x4d4585={'raw':!![],'where':{'id':_0x36d6ed[_0xfddd('0x41')]['id']}},_0x408e2b={};_0x408e2b['model']=_[_0xfddd('0x2d')](db[_0xfddd('0x27')][_0xfddd('0x28')]);_0x408e2b[_0xfddd('0x2c')]=_[_0xfddd('0x2d')](_0x36d6ed['query']);_0x408e2b['filters']=_[_0xfddd('0x42')](_0x408e2b['model'],_0x408e2b[_0xfddd('0x2c')]);_0x4d4585[_0xfddd('0x30')]=_[_0xfddd('0x42')](_0x408e2b[_0xfddd('0x2f')],qs[_0xfddd('0x43')](_0x36d6ed[_0xfddd('0x2c')][_0xfddd('0x43')]));_0x4d4585[_0xfddd('0x30')]=_0x4d4585[_0xfddd('0x30')][_0xfddd('0x44')]?_0x4d4585['attributes']:_0x408e2b[_0xfddd('0x2f')];if(_0x36d6ed[_0xfddd('0x2c')][_0xfddd('0x3b')]){_0x4d4585[_0xfddd('0x3c')]=[{'all':!![]}];}_0x4d4585=_['merge']({},_0x4d4585,_0x36d6ed[_0xfddd('0x39')]);return db[_0xfddd('0x27')][_0xfddd('0x45')](_0x4d4585)[_0xfddd('0x1f')](handleEntityNotFound(_0x4297d1,null))[_0xfddd('0x1f')](respondWithResult(_0x4297d1,null))[_0xfddd('0x3f')](handleError(_0x4297d1,null));};exports['create']=function(_0x3c0e77,_0x4c92bd){return db[_0xfddd('0x27')][_0xfddd('0x46')](_0x3c0e77['body'],{})[_0xfddd('0x1f')](respondWithResult(_0x4c92bd,0xc9))[_0xfddd('0x3f')](handleError(_0x4c92bd,null));};exports[_0xfddd('0x47')]=function(_0x42b97e,_0x2bf66f){if(_0x42b97e[_0xfddd('0x48')]['id']){delete _0x42b97e[_0xfddd('0x48')]['id'];}return db['AnalyticTreeReport'][_0xfddd('0x45')]({'where':{'id':_0x42b97e['params']['id']}})[_0xfddd('0x1f')](handleEntityNotFound(_0x2bf66f,null))[_0xfddd('0x1f')](saveUpdates(_0x42b97e['body'],null))[_0xfddd('0x1f')](respondWithResult(_0x2bf66f,null))[_0xfddd('0x3f')](handleError(_0x2bf66f,null));};exports[_0xfddd('0x20')]=function(_0x5bc73,_0x356d9d){return db[_0xfddd('0x27')][_0xfddd('0x45')]({'where':{'id':_0x5bc73['params']['id']}})[_0xfddd('0x1f')](handleEntityNotFound(_0x356d9d,null))[_0xfddd('0x1f')](removeEntity(_0x356d9d,null))[_0xfddd('0x3f')](handleError(_0x356d9d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 2436d15..abcf428 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 _0xeca1=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird'];(function(_0x575c93,_0x3b54d6){var _0x2606a0=function(_0xe1cdaa){while(--_0xe1cdaa){_0x575c93['push'](_0x575c93['shift']());}};_0x2606a0(++_0x3b54d6);}(_0xeca1,0x1bf));var _0x1eca=function(_0x197ecc,_0x4697b5){_0x197ecc=_0x197ecc-0x0;var _0x27fb69=_0xeca1[_0x197ecc];return _0x27fb69;};'use strict';var _=require(_0x1eca('0x0'));var util=require('util');var logger=require(_0x1eca('0x1'))(_0x1eca('0x2'));var moment=require('moment');var BPromise=require(_0x1eca('0x3'));var rp=require(_0x1eca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1eca('0x5'));var config=require(_0x1eca('0x6'));var attributes=require(_0x1eca('0x7'));module[_0x1eca('0x8')]=function(_0x37896e,_0x1a33b9){return _0x37896e['define'](_0x1eca('0x9'),attributes,{'tableName':_0x1eca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25d0=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x49e496,_0x3a2217){var _0x2d096b=function(_0x57bd59){while(--_0x57bd59){_0x49e496['push'](_0x49e496['shift']());}};_0x2d096b(++_0x3a2217);}(_0x25d0,0x102));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x025d('0x0'));var util=require(_0x025d('0x1'));var logger=require(_0x025d('0x2'))(_0x025d('0x3'));var moment=require(_0x025d('0x4'));var BPromise=require(_0x025d('0x5'));var rp=require(_0x025d('0x6'));var fs=require('fs');var path=require(_0x025d('0x7'));var rimraf=require(_0x025d('0x8'));var config=require(_0x025d('0x9'));var attributes=require(_0x025d('0xa'));module[_0x025d('0xb')]=function(_0x562047,_0x542149){return _0x562047[_0x025d('0xc')](_0x025d('0xd'),attributes,{'tableName':_0x025d('0xe'),'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 302453e..91f3e52 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x382584,_0x191130){var _0xb270b8=function(_0x1c54f7){while(--_0x1c54f7){_0x382584['push'](_0x382584['shift']());}};_0xb270b8(++_0x191130);}(_0xdb28,0x106));var _0x8db2=function(_0x2b6eab,_0x3db7e9){_0x2b6eab=_0x2b6eab-0x0;var _0x40e13b=_0xdb28[_0x2b6eab];return _0x40e13b;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4cce30,_0x38de32){var _0x14d45e=function(_0x4c10c5){while(--_0x4c10c5){_0x4cce30['push'](_0x4cce30['shift']());}};_0x14d45e(++_0x38de32);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1bec21,_0x2d6f06){_0x1bec21=_0x1bec21-0x0;var _0x41660f=_0x5f2f[_0x1bec21];return _0x41660f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b4748d9..f977275 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 _0x5886=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x233506,_0x34fc86){var _0x453ec6=function(_0x4c8811){while(--_0x4c8811){_0x233506['push'](_0x233506['shift']());}};_0x453ec6(++_0x34fc86);}(_0x5886,0x95));var _0x6588=function(_0x2bfbea,_0x52486b){_0x2bfbea=_0x2bfbea-0x0;var _0x95f576=_0x5886[_0x2bfbea];return _0x95f576;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6588('0x0'));var timeout=require(_0x6588('0x1'));var express=require('express');var router=express[_0x6588('0x2')]();var fs_extra=require(_0x6588('0x3'));var auth=require(_0x6588('0x4'));var interaction=require(_0x6588('0x5'));var config=require(_0x6588('0x6'));var controller=require(_0x6588('0x7'));router['get']('/',auth[_0x6588('0x8')](),controller[_0x6588('0x9')]);router['get']('/:id',auth[_0x6588('0x8')](),controller[_0x6588('0xa')]);router[_0x6588('0xb')]('/',auth[_0x6588('0x8')](),controller[_0x6588('0xc')]);router[_0x6588('0xd')](_0x6588('0xe'),auth[_0x6588('0x8')](),controller[_0x6588('0xf')]);router[_0x6588('0x10')](_0x6588('0xe'),auth[_0x6588('0x8')](),controller[_0x6588('0x11')]);module[_0x6588('0x12')]=router; \ No newline at end of file +var _0x0672=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0672,0x115));var _0x2067=function(_0x319516,_0x270808){_0x319516=_0x319516-0x0;var _0x289583=_0x0672[_0x319516];return _0x289583;};'use strict';var multer=require(_0x2067('0x0'));var util=require(_0x2067('0x1'));var path=require(_0x2067('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2067('0x3')]();var fs_extra=require(_0x2067('0x4'));var auth=require(_0x2067('0x5'));var interaction=require(_0x2067('0x6'));var config=require(_0x2067('0x7'));var controller=require(_0x2067('0x8'));router[_0x2067('0x9')]('/',auth[_0x2067('0xa')](),controller[_0x2067('0xb')]);router['get'](_0x2067('0xc'),auth[_0x2067('0xa')](),controller[_0x2067('0xd')]);router[_0x2067('0xe')]('/',auth['isAuthenticated'](),controller[_0x2067('0xf')]);router[_0x2067('0x10')](_0x2067('0xc'),auth['isAuthenticated'](),controller[_0x2067('0x11')]);router['delete'](_0x2067('0xc'),auth[_0x2067('0xa')](),controller[_0x2067('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 88b84b0..cf6eef7 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 _0x2a3a=['sequelize','exports','STRING'];(function(_0x521be0,_0x2d8691){var _0x117d4e=function(_0x200aa8){while(--_0x200aa8){_0x521be0['push'](_0x521be0['shift']());}};_0x117d4e(++_0x2d8691);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x42148e,_0x2e4bdb){_0x42148e=_0x42148e-0x0;var _0xf42760=_0x2a3a[_0x42148e];return _0xf42760;};'use strict';var Sequelize=require(_0xa2a3('0x0'));module[_0xa2a3('0x1')]={'name':{'type':Sequelize[_0xa2a3('0x2')]},'basename':{'type':Sequelize[_0xa2a3('0x2')]},'type':{'type':Sequelize[_0xa2a3('0x2')]}}; \ No newline at end of file +var _0x61a5=['sequelize','STRING'];(function(_0x278876,_0x4df11c){var _0x5a2162=function(_0x221201){while(--_0x221201){_0x278876['push'](_0x278876['shift']());}};_0x5a2162(++_0x4df11c);}(_0x61a5,0xf0));var _0x561a=function(_0x4a8227,_0x27ab19){_0x4a8227=_0x4a8227-0x0;var _0x403b2c=_0x61a5[_0x4a8227];return _0x403b2c;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'name':{'type':Sequelize[_0x561a('0x1')]},'basename':{'type':Sequelize[_0x561a('0x1')]},'type':{'type':Sequelize[_0x561a('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 976855c..d24ba24 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 _0x2ac5=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','options','Attachment','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','clone','get','updatedAt','body','omit','createdAt','create','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x177d46,_0x3bc970){var _0x3f82ee=function(_0x273181){while(--_0x273181){_0x177d46['push'](_0x177d46['shift']());}};_0x3f82ee(++_0x3bc970);}(_0x2ac5,0x10f));var _0x52ac=function(_0x551b0a,_0x41348c){_0x551b0a=_0x551b0a-0x0;var _0x5dacb8=_0x2ac5[_0x551b0a];return _0x5dacb8;};'use strict';var emlformat=require(_0x52ac('0x0'));var rimraf=require(_0x52ac('0x1'));var zipdir=require(_0x52ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52ac('0x3'));var moment=require('moment');var BPromise=require(_0x52ac('0x4'));var Mustache=require(_0x52ac('0x5'));var util=require(_0x52ac('0x6'));var path=require(_0x52ac('0x7'));var sox=require('sox');var csv=require(_0x52ac('0x8'));var ejs=require(_0x52ac('0x9'));var fs=require('fs');var fs_extra=require(_0x52ac('0xa'));var _=require(_0x52ac('0xb'));var squel=require(_0x52ac('0xc'));var crypto=require(_0x52ac('0xd'));var jsforce=require(_0x52ac('0xe'));var deskjs=require(_0x52ac('0xf'));var toCsv=require(_0x52ac('0x8'));var querystring=require('querystring');var Papa=require(_0x52ac('0x10'));var Redis=require(_0x52ac('0x11'));var authService=require(_0x52ac('0x12'));var qs=require(_0x52ac('0x13'));var as=require(_0x52ac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52ac('0x15'))(_0x52ac('0x16'));var utils=require(_0x52ac('0x17'));var config=require(_0x52ac('0x18'));var licenseUtil=require(_0x52ac('0x19'));var db=require(_0x52ac('0x1a'))['db'];function respondWithStatusCode(_0x234c4d,_0x2b7cfe){_0x2b7cfe=_0x2b7cfe||0xcc;return function(_0x3cc7ee){if(_0x3cc7ee){return _0x234c4d[_0x52ac('0x1b')](_0x2b7cfe);}return _0x234c4d[_0x52ac('0x1c')](_0x2b7cfe)[_0x52ac('0x1d')]();};}function respondWithResult(_0x3c1893,_0x4f86d4){_0x4f86d4=_0x4f86d4||0xc8;return function(_0x1ae027){if(_0x1ae027){return _0x3c1893[_0x52ac('0x1c')](_0x4f86d4)[_0x52ac('0x1e')](_0x1ae027);}};}function respondWithFilteredResult(_0x42b6f2,_0x32671d){return function(_0x5b01be){if(_0x5b01be){var _0x313419=typeof _0x32671d['offset']===_0x52ac('0x1f')&&typeof _0x32671d['limit']==='undefined';var _0x3f8737=_0x5b01be[_0x52ac('0x20')];var _0x5d52b5=_0x313419?0x0:_0x32671d[_0x52ac('0x21')];var _0x5d7dfa=_0x313419?_0x5b01be['count']:_0x32671d[_0x52ac('0x21')]+_0x32671d[_0x52ac('0x22')];var _0x5c532f;if(_0x5d7dfa>=_0x3f8737){_0x5d7dfa=_0x3f8737;_0x5c532f=0xc8;}else{_0x5c532f=0xce;}_0x42b6f2[_0x52ac('0x1c')](_0x5c532f);return _0x42b6f2[_0x52ac('0x23')](_0x52ac('0x24'),_0x5d52b5+'-'+_0x5d7dfa+'/'+_0x3f8737)[_0x52ac('0x1e')](_0x5b01be);}return null;};}function patchUpdates(_0x44c858){return function(_0x175d5d){try{jsonpatch[_0x52ac('0x25')](_0x175d5d,_0x44c858,!![]);}catch(_0x105f25){return BPromise['reject'](_0x105f25);}return _0x175d5d['save']();};}function saveUpdates(_0x1fe918,_0x1bebd9){return function(_0x560384){if(_0x560384){return _0x560384[_0x52ac('0x26')](_0x1fe918)[_0x52ac('0x27')](function(_0x687c79){return _0x687c79;});}return null;};}function removeEntity(_0x39bf9c,_0x4cc263){return function(_0x5a9c40){if(_0x5a9c40){return _0x5a9c40[_0x52ac('0x28')]()[_0x52ac('0x27')](function(){_0x39bf9c[_0x52ac('0x1c')](0xcc)[_0x52ac('0x1d')]();});}};}function handleEntityNotFound(_0x279f4e,_0xfcb36d){return function(_0x461870){if(!_0x461870){_0x279f4e[_0x52ac('0x1b')](0x194);}return _0x461870;};}function handleError(_0xaa2be0,_0x2cf357){_0x2cf357=_0x2cf357||0x1f4;return function(_0x12ce9b){logger[_0x52ac('0x29')](_0x12ce9b[_0x52ac('0x2a')]);if(_0x12ce9b[_0x52ac('0x2b')]){delete _0x12ce9b[_0x52ac('0x2b')];}_0xaa2be0[_0x52ac('0x1c')](_0x2cf357)[_0x52ac('0x2c')](_0x12ce9b);};}exports[_0x52ac('0x2d')]=function(_0x3851dc,_0x46d787){var _0x184a92={},_0x359b99={},_0x421dc2={'count':0x0,'rows':[]};var _0x4e6902=_['map'](db['Attachment']['rawAttributes'],function(_0x4b2ba2){return{'name':_0x4b2ba2[_0x52ac('0x2e')],'type':_0x4b2ba2[_0x52ac('0x2f')][_0x52ac('0x30')]};});_0x359b99['model']=_['map'](_0x4e6902,_0x52ac('0x2b'));_0x359b99[_0x52ac('0x31')]=_[_0x52ac('0x32')](_0x3851dc[_0x52ac('0x31')]);_0x359b99[_0x52ac('0x33')]=_[_0x52ac('0x34')](_0x359b99['model'],_0x359b99[_0x52ac('0x31')]);_0x184a92['attributes']=_[_0x52ac('0x34')](_0x359b99[_0x52ac('0x35')],qs[_0x52ac('0x36')](_0x3851dc[_0x52ac('0x31')][_0x52ac('0x36')]));_0x184a92[_0x52ac('0x37')]=_0x184a92[_0x52ac('0x37')][_0x52ac('0x38')]?_0x184a92['attributes']:_0x359b99['model'];if(!_0x3851dc[_0x52ac('0x31')][_0x52ac('0x39')]('nolimit')){_0x184a92[_0x52ac('0x22')]=qs[_0x52ac('0x22')](_0x3851dc[_0x52ac('0x31')][_0x52ac('0x22')]);_0x184a92[_0x52ac('0x21')]=qs[_0x52ac('0x21')](_0x3851dc[_0x52ac('0x31')][_0x52ac('0x21')]);}_0x184a92[_0x52ac('0x3a')]=qs[_0x52ac('0x3b')](_0x3851dc[_0x52ac('0x31')]['sort']);_0x184a92[_0x52ac('0x3c')]=qs[_0x52ac('0x33')](_['pick'](_0x3851dc[_0x52ac('0x31')],_0x359b99[_0x52ac('0x33')]),_0x4e6902);if(_0x3851dc[_0x52ac('0x31')][_0x52ac('0x3d')]){_0x184a92[_0x52ac('0x3c')]=_[_0x52ac('0x3e')](_0x184a92[_0x52ac('0x3c')],{'$or':_[_0x52ac('0x3f')](_0x4e6902,function(_0xb02ab4){if(_0xb02ab4[_0x52ac('0x2f')]!=='VIRTUAL'){var _0x1ee847={};_0x1ee847[_0xb02ab4[_0x52ac('0x2b')]]={'$like':'%'+_0x3851dc[_0x52ac('0x31')]['filter']+'%'};return _0x1ee847;}})});}_0x184a92=_[_0x52ac('0x3e')]({},_0x184a92,_0x3851dc[_0x52ac('0x40')]);var _0x4ac9de={'where':_0x184a92[_0x52ac('0x3c')]};return db[_0x52ac('0x41')][_0x52ac('0x20')](_0x4ac9de)[_0x52ac('0x27')](function(_0x12b446){_0x421dc2[_0x52ac('0x20')]=_0x12b446;if(_0x3851dc[_0x52ac('0x31')][_0x52ac('0x42')]){_0x184a92[_0x52ac('0x43')]=[{'all':!![]}];}return db[_0x52ac('0x41')][_0x52ac('0x44')](_0x184a92);})['then'](function(_0x1603b6){_0x421dc2[_0x52ac('0x45')]=_0x1603b6;return _0x421dc2;})['then'](respondWithFilteredResult(_0x46d787,_0x184a92))[_0x52ac('0x46')](handleError(_0x46d787,null));};exports[_0x52ac('0x47')]=function(_0x2e4f0c,_0x42c7a5){var _0x157fc3={'raw':!![],'where':{'id':_0x2e4f0c[_0x52ac('0x48')]['id']}},_0x37fb85={};_0x37fb85[_0x52ac('0x35')]=_[_0x52ac('0x32')](db[_0x52ac('0x41')][_0x52ac('0x49')]);_0x37fb85[_0x52ac('0x31')]=_[_0x52ac('0x32')](_0x2e4f0c[_0x52ac('0x31')]);_0x37fb85[_0x52ac('0x33')]=_[_0x52ac('0x34')](_0x37fb85[_0x52ac('0x35')],_0x37fb85['query']);_0x157fc3[_0x52ac('0x37')]=_[_0x52ac('0x34')](_0x37fb85[_0x52ac('0x35')],qs['fields'](_0x2e4f0c[_0x52ac('0x31')]['fields']));_0x157fc3['attributes']=_0x157fc3[_0x52ac('0x37')][_0x52ac('0x38')]?_0x157fc3[_0x52ac('0x37')]:_0x37fb85['model'];if(_0x2e4f0c[_0x52ac('0x31')][_0x52ac('0x42')]){_0x157fc3['include']=[{'all':!![]}];}_0x157fc3=_['merge']({},_0x157fc3,_0x2e4f0c[_0x52ac('0x40')]);return db['Attachment'][_0x52ac('0x4a')](_0x157fc3)[_0x52ac('0x27')](handleEntityNotFound(_0x42c7a5,null))[_0x52ac('0x27')](respondWithResult(_0x42c7a5,null))[_0x52ac('0x46')](handleError(_0x42c7a5,null));};exports[_0x52ac('0x4b')]=function(_0xa16ba9,_0x5853b3){var _0x3934bc={'where':{'id':_0xa16ba9['params']['id']}},_0x8207e8={};_0x8207e8[_0x52ac('0x35')]=_[_0x52ac('0x32')](db[_0x52ac('0x41')][_0x52ac('0x49')]);_0x3934bc[_0x52ac('0x37')]=_[_0x52ac('0x34')](_0x8207e8[_0x52ac('0x35')],qs['fields'](_0xa16ba9['query'][_0x52ac('0x36')]));_0x3934bc[_0x52ac('0x37')]=_0x3934bc[_0x52ac('0x37')][_0x52ac('0x38')]?_0x3934bc[_0x52ac('0x37')]:_0x8207e8['model'];if(_0xa16ba9[_0x52ac('0x31')]['includeAll']){_0x3934bc['include']=[{'all':!![]}];}_0x3934bc=_['merge']({},_0x3934bc,_0xa16ba9[_0x52ac('0x40')]);return db[_0x52ac('0x41')][_0x52ac('0x4a')](_0x3934bc)[_0x52ac('0x27')](handleEntityNotFound(_0x5853b3,null))[_0x52ac('0x27')](function(_0x242ad0){if(_0x242ad0){var _0x2b5163=_0x242ad0[_0x52ac('0x4c')]({'plain':!![]});_0x2b5163=qs['omit'](_0x2b5163,['id','createdAt',_0x52ac('0x4d')]);_0xa16ba9[_0x52ac('0x4e')]=_[_0x52ac('0x4f')](_0xa16ba9[_0x52ac('0x4e')],['id',_0x52ac('0x50'),_0x52ac('0x4d')]);return db[_0x52ac('0x41')]['create'](_[_0x52ac('0x3e')](_0x2b5163,_0xa16ba9[_0x52ac('0x4e')]),{'include':_0xa16ba9[_0x52ac('0x31')][_0x52ac('0x42')]?[{'all':!![]}]:undefined});}})[_0x52ac('0x27')](respondWithResult(_0x5853b3,0xc9))[_0x52ac('0x46')](handleError(_0x5853b3,null));};exports[_0x52ac('0x26')]=function(_0x41a644,_0x579506){if(_0x41a644['body']['id']){delete _0x41a644[_0x52ac('0x4e')]['id'];}return db[_0x52ac('0x41')]['find']({'where':{'id':_0x41a644['params']['id']}})[_0x52ac('0x27')](handleEntityNotFound(_0x579506,null))[_0x52ac('0x27')](saveUpdates(_0x41a644['body'],null))[_0x52ac('0x27')](respondWithResult(_0x579506,null))[_0x52ac('0x46')](handleError(_0x579506,null));};exports[_0x52ac('0x28')]=function(_0x100d0d,_0x55cd3f){return db[_0x52ac('0x41')][_0x52ac('0x4a')]({'where':{'id':_0x100d0d['params']['id']}})[_0x52ac('0x27')](handleEntityNotFound(_0x55cd3f,null))[_0x52ac('0x27')](removeEntity(_0x55cd3f,null))[_0x52ac('0x46')](handleError(_0x55cd3f,null));};exports[_0x52ac('0x51')]=function(_0x6f8b66,_0x2d46f7,_0xfc31b0){_0x6f8b66[_0x52ac('0x4e')]['name']=_0x6f8b66[_0x52ac('0x52')][_0x52ac('0x53')];_0x6f8b66['body'][_0x52ac('0x54')]=_0x6f8b66[_0x52ac('0x52')][_0x52ac('0x55')];_0x6f8b66[_0x52ac('0x4e')][_0x52ac('0x2f')]=_0x6f8b66['file']['mimetype'];return db[_0x52ac('0x41')][_0x52ac('0x51')](_0x6f8b66['body'])[_0x52ac('0x27')](respondWithResult(_0x2d46f7,0xc9))['catch'](handleError(_0x2d46f7,null));};exports[_0x52ac('0x56')]=function(_0x28064f,_0x5e4405,_0xeb70e8){return db[_0x52ac('0x41')]['findOne']({'where':{'id':_0x28064f[_0x52ac('0x48')]['id']},'raw':!![]})[_0x52ac('0x27')](handleEntityNotFound(_0x5e4405,null))[_0x52ac('0x27')](function(_0x118ab2){if(_0x118ab2){var _0x349473=_0x118ab2[_0x52ac('0x57')]!==null;var _0x484418=path[_0x52ac('0x58')](config[_0x52ac('0x59')],_0x52ac('0x5a'));if(_0x349473){_0x484418=path[_0x52ac('0x58')](_0x484418,_0x52ac('0x5b'));}var _0x38b7ef=path['join'](_0x484418,_0x118ab2[_0x52ac('0x54')]);return _0x5e4405[_0x52ac('0x56')](_0x38b7ef);}})['catch'](handleError(_0x5e4405,null));}; \ No newline at end of file +var _0x5bfa=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','get','body','omit','updatedAt','create','file','basename','filename','mimetype','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','Attachment','rawAttributes','key','model','keys','query','intersection','attributes','fields','length'];(function(_0x2496a6,_0x27f3d9){var _0x3b539f=function(_0xc8d885){while(--_0xc8d885){_0x2496a6['push'](_0x2496a6['shift']());}};_0x3b539f(++_0x27f3d9);}(_0x5bfa,0xcd));var _0xa5bf=function(_0xd2f4ac,_0x5aa8e5){_0xd2f4ac=_0xd2f4ac-0x0;var _0x9757b2=_0x5bfa[_0xd2f4ac];return _0x9757b2;};'use strict';var emlformat=require(_0xa5bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5bf('0x1'));var jsonpatch=require(_0xa5bf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa5bf('0x3'));var util=require(_0xa5bf('0x4'));var path=require(_0xa5bf('0x5'));var sox=require('sox');var csv=require(_0xa5bf('0x6'));var ejs=require(_0xa5bf('0x7'));var fs=require('fs');var fs_extra=require(_0xa5bf('0x8'));var _=require(_0xa5bf('0x9'));var squel=require(_0xa5bf('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa5bf('0xb'));var Papa=require(_0xa5bf('0xc'));var Redis=require(_0xa5bf('0xd'));var authService=require(_0xa5bf('0xe'));var qs=require(_0xa5bf('0xf'));var as=require(_0xa5bf('0x10'));var hardwareService=require(_0xa5bf('0x11'));var logger=require(_0xa5bf('0x12'))(_0xa5bf('0x13'));var utils=require(_0xa5bf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa5bf('0x15'));var db=require(_0xa5bf('0x16'))['db'];function respondWithStatusCode(_0xdc8b09,_0x498bbe){_0x498bbe=_0x498bbe||0xcc;return function(_0x4ee0bb){if(_0x4ee0bb){return _0xdc8b09[_0xa5bf('0x17')](_0x498bbe);}return _0xdc8b09[_0xa5bf('0x18')](_0x498bbe)[_0xa5bf('0x19')]();};}function respondWithResult(_0x429a9a,_0x49d9b1){_0x49d9b1=_0x49d9b1||0xc8;return function(_0x5936a3){if(_0x5936a3){return _0x429a9a[_0xa5bf('0x18')](_0x49d9b1)[_0xa5bf('0x1a')](_0x5936a3);}};}function respondWithFilteredResult(_0x14c942,_0x450728){return function(_0x569e60){if(_0x569e60){var _0x4b8981=typeof _0x450728[_0xa5bf('0x1b')]===_0xa5bf('0x1c')&&typeof _0x450728[_0xa5bf('0x1d')]===_0xa5bf('0x1c');var _0x40f358=_0x569e60[_0xa5bf('0x1e')];var _0x2afb32=_0x4b8981?0x0:_0x450728[_0xa5bf('0x1b')];var _0x22463c=_0x4b8981?_0x569e60[_0xa5bf('0x1e')]:_0x450728[_0xa5bf('0x1b')]+_0x450728[_0xa5bf('0x1d')];var _0x2d28a1;if(_0x22463c>=_0x40f358){_0x22463c=_0x40f358;_0x2d28a1=0xc8;}else{_0x2d28a1=0xce;}_0x14c942[_0xa5bf('0x18')](_0x2d28a1);return _0x14c942[_0xa5bf('0x1f')](_0xa5bf('0x20'),_0x2afb32+'-'+_0x22463c+'/'+_0x40f358)[_0xa5bf('0x1a')](_0x569e60);}return null;};}function patchUpdates(_0x154b06){return function(_0x4f2008){try{jsonpatch[_0xa5bf('0x21')](_0x4f2008,_0x154b06,!![]);}catch(_0x55e1ce){return BPromise[_0xa5bf('0x22')](_0x55e1ce);}return _0x4f2008[_0xa5bf('0x23')]();};}function saveUpdates(_0x32fe8b,_0x4ce6d3){return function(_0x366d1a){if(_0x366d1a){return _0x366d1a[_0xa5bf('0x24')](_0x32fe8b)[_0xa5bf('0x25')](function(_0x4f3133){return _0x4f3133;});}return null;};}function removeEntity(_0x5e6601,_0x270064){return function(_0x14e24e){if(_0x14e24e){return _0x14e24e['destroy']()[_0xa5bf('0x25')](function(){_0x5e6601[_0xa5bf('0x18')](0xcc)[_0xa5bf('0x19')]();});}};}function handleEntityNotFound(_0x2e6a4a,_0xa1eaa7){return function(_0x292087){if(!_0x292087){_0x2e6a4a['sendStatus'](0x194);}return _0x292087;};}function handleError(_0x44fadd,_0x3649a1){_0x3649a1=_0x3649a1||0x1f4;return function(_0x230fd7){logger[_0xa5bf('0x26')](_0x230fd7[_0xa5bf('0x27')]);if(_0x230fd7[_0xa5bf('0x28')]){delete _0x230fd7[_0xa5bf('0x28')];}_0x44fadd['status'](_0x3649a1)['send'](_0x230fd7);};}exports[_0xa5bf('0x29')]=function(_0x11b1a6,_0x53fda2){var _0x1d9027={},_0x5a84c9={},_0x4de06f={'count':0x0,'rows':[]};var _0x42e3ce=_[_0xa5bf('0x2a')](db[_0xa5bf('0x2b')][_0xa5bf('0x2c')],function(_0x2fbe20){return{'name':_0x2fbe20['fieldName'],'type':_0x2fbe20['type'][_0xa5bf('0x2d')]};});_0x5a84c9[_0xa5bf('0x2e')]=_['map'](_0x42e3ce,_0xa5bf('0x28'));_0x5a84c9['query']=_[_0xa5bf('0x2f')](_0x11b1a6[_0xa5bf('0x30')]);_0x5a84c9['filters']=_[_0xa5bf('0x31')](_0x5a84c9['model'],_0x5a84c9[_0xa5bf('0x30')]);_0x1d9027[_0xa5bf('0x32')]=_[_0xa5bf('0x31')](_0x5a84c9[_0xa5bf('0x2e')],qs[_0xa5bf('0x33')](_0x11b1a6[_0xa5bf('0x30')]['fields']));_0x1d9027['attributes']=_0x1d9027[_0xa5bf('0x32')][_0xa5bf('0x34')]?_0x1d9027[_0xa5bf('0x32')]:_0x5a84c9[_0xa5bf('0x2e')];if(!_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x35')](_0xa5bf('0x36'))){_0x1d9027[_0xa5bf('0x1d')]=qs[_0xa5bf('0x1d')](_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x1d')]);_0x1d9027[_0xa5bf('0x1b')]=qs[_0xa5bf('0x1b')](_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x1b')]);}_0x1d9027[_0xa5bf('0x37')]=qs[_0xa5bf('0x38')](_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x38')]);_0x1d9027[_0xa5bf('0x39')]=qs[_0xa5bf('0x3a')](_[_0xa5bf('0x3b')](_0x11b1a6[_0xa5bf('0x30')],_0x5a84c9[_0xa5bf('0x3a')]),_0x42e3ce);if(_0x11b1a6[_0xa5bf('0x30')]['filter']){_0x1d9027[_0xa5bf('0x39')]=_[_0xa5bf('0x3c')](_0x1d9027[_0xa5bf('0x39')],{'$or':_['map'](_0x42e3ce,function(_0x27fa39){if(_0x27fa39[_0xa5bf('0x3d')]!==_0xa5bf('0x3e')){var _0x4f4bb3={};_0x4f4bb3[_0x27fa39['name']]={'$like':'%'+_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x3f')]+'%'};return _0x4f4bb3;}})});}_0x1d9027=_[_0xa5bf('0x3c')]({},_0x1d9027,_0x11b1a6['options']);var _0x12b341={'where':_0x1d9027[_0xa5bf('0x39')]};return db[_0xa5bf('0x2b')][_0xa5bf('0x1e')](_0x12b341)[_0xa5bf('0x25')](function(_0x599674){_0x4de06f[_0xa5bf('0x1e')]=_0x599674;if(_0x11b1a6[_0xa5bf('0x30')][_0xa5bf('0x40')]){_0x1d9027[_0xa5bf('0x41')]=[{'all':!![]}];}return db[_0xa5bf('0x2b')][_0xa5bf('0x42')](_0x1d9027);})[_0xa5bf('0x25')](function(_0x334ac3){_0x4de06f['rows']=_0x334ac3;return _0x4de06f;})[_0xa5bf('0x25')](respondWithFilteredResult(_0x53fda2,_0x1d9027))[_0xa5bf('0x43')](handleError(_0x53fda2,null));};exports[_0xa5bf('0x44')]=function(_0x52eb8c,_0x555d8a){var _0x81bd1={'raw':!![],'where':{'id':_0x52eb8c[_0xa5bf('0x45')]['id']}},_0x4b0adf={};_0x4b0adf['model']=_['keys'](db['Attachment']['rawAttributes']);_0x4b0adf[_0xa5bf('0x30')]=_[_0xa5bf('0x2f')](_0x52eb8c[_0xa5bf('0x30')]);_0x4b0adf['filters']=_[_0xa5bf('0x31')](_0x4b0adf[_0xa5bf('0x2e')],_0x4b0adf['query']);_0x81bd1[_0xa5bf('0x32')]=_['intersection'](_0x4b0adf[_0xa5bf('0x2e')],qs[_0xa5bf('0x33')](_0x52eb8c[_0xa5bf('0x30')][_0xa5bf('0x33')]));_0x81bd1[_0xa5bf('0x32')]=_0x81bd1[_0xa5bf('0x32')][_0xa5bf('0x34')]?_0x81bd1[_0xa5bf('0x32')]:_0x4b0adf['model'];if(_0x52eb8c[_0xa5bf('0x30')]['includeAll']){_0x81bd1[_0xa5bf('0x41')]=[{'all':!![]}];}_0x81bd1=_['merge']({},_0x81bd1,_0x52eb8c[_0xa5bf('0x46')]);return db['Attachment'][_0xa5bf('0x47')](_0x81bd1)[_0xa5bf('0x25')](handleEntityNotFound(_0x555d8a,null))['then'](respondWithResult(_0x555d8a,null))['catch'](handleError(_0x555d8a,null));};exports['clone']=function(_0x5538ae,_0x2a1e43){var _0x2ca8cc={'where':{'id':_0x5538ae[_0xa5bf('0x45')]['id']}},_0x46cea3={};_0x46cea3[_0xa5bf('0x2e')]=_['keys'](db['Attachment'][_0xa5bf('0x2c')]);_0x2ca8cc[_0xa5bf('0x32')]=_['intersection'](_0x46cea3[_0xa5bf('0x2e')],qs['fields'](_0x5538ae[_0xa5bf('0x30')][_0xa5bf('0x33')]));_0x2ca8cc[_0xa5bf('0x32')]=_0x2ca8cc[_0xa5bf('0x32')][_0xa5bf('0x34')]?_0x2ca8cc[_0xa5bf('0x32')]:_0x46cea3['model'];if(_0x5538ae[_0xa5bf('0x30')]['includeAll']){_0x2ca8cc['include']=[{'all':!![]}];}_0x2ca8cc=_[_0xa5bf('0x3c')]({},_0x2ca8cc,_0x5538ae[_0xa5bf('0x46')]);return db[_0xa5bf('0x2b')][_0xa5bf('0x47')](_0x2ca8cc)[_0xa5bf('0x25')](handleEntityNotFound(_0x2a1e43,null))[_0xa5bf('0x25')](function(_0x70ed3c){if(_0x70ed3c){var _0x5aef6c=_0x70ed3c[_0xa5bf('0x48')]({'plain':!![]});_0x5aef6c=qs['omit'](_0x5aef6c,['id','createdAt','updatedAt']);_0x5538ae[_0xa5bf('0x49')]=_[_0xa5bf('0x4a')](_0x5538ae[_0xa5bf('0x49')],['id','createdAt',_0xa5bf('0x4b')]);return db[_0xa5bf('0x2b')][_0xa5bf('0x4c')](_[_0xa5bf('0x3c')](_0x5aef6c,_0x5538ae['body']),{'include':_0x5538ae[_0xa5bf('0x30')][_0xa5bf('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2a1e43,0xc9))['catch'](handleError(_0x2a1e43,null));};exports[_0xa5bf('0x24')]=function(_0x38f9e2,_0x2a0cd7){if(_0x38f9e2[_0xa5bf('0x49')]['id']){delete _0x38f9e2['body']['id'];}return db[_0xa5bf('0x2b')][_0xa5bf('0x47')]({'where':{'id':_0x38f9e2[_0xa5bf('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a0cd7,null))['then'](saveUpdates(_0x38f9e2[_0xa5bf('0x49')],null))[_0xa5bf('0x25')](respondWithResult(_0x2a0cd7,null))[_0xa5bf('0x43')](handleError(_0x2a0cd7,null));};exports['destroy']=function(_0x53cdbb,_0x5b3cd7){return db['Attachment'][_0xa5bf('0x47')]({'where':{'id':_0x53cdbb[_0xa5bf('0x45')]['id']}})[_0xa5bf('0x25')](handleEntityNotFound(_0x5b3cd7,null))['then'](removeEntity(_0x5b3cd7,null))[_0xa5bf('0x43')](handleError(_0x5b3cd7,null));};exports[_0xa5bf('0x4c')]=function(_0x1e00ab,_0x13ef81,_0x200d6e){_0x1e00ab['body'][_0xa5bf('0x28')]=_0x1e00ab[_0xa5bf('0x4d')]['originalname'];_0x1e00ab[_0xa5bf('0x49')][_0xa5bf('0x4e')]=_0x1e00ab[_0xa5bf('0x4d')][_0xa5bf('0x4f')];_0x1e00ab[_0xa5bf('0x49')][_0xa5bf('0x3d')]=_0x1e00ab['file'][_0xa5bf('0x50')];return db[_0xa5bf('0x2b')][_0xa5bf('0x4c')](_0x1e00ab[_0xa5bf('0x49')])[_0xa5bf('0x25')](respondWithResult(_0x13ef81,0xc9))[_0xa5bf('0x43')](handleError(_0x13ef81,null));};exports[_0xa5bf('0x51')]=function(_0x25e6f8,_0x4a3a49,_0x559fd3){return db['Attachment']['findOne']({'where':{'id':_0x25e6f8[_0xa5bf('0x45')]['id']},'raw':!![]})[_0xa5bf('0x25')](handleEntityNotFound(_0x4a3a49,null))[_0xa5bf('0x25')](function(_0x5a82bf){if(_0x5a82bf){var _0x354705=_0x5a82bf[_0xa5bf('0x52')]!==null;var _0x1f94d4=path[_0xa5bf('0x53')](config['root'],_0xa5bf('0x54'));if(_0x354705){_0x1f94d4=path[_0xa5bf('0x53')](_0x1f94d4,_0xa5bf('0x55'));}var _0x514d22=path[_0xa5bf('0x53')](_0x1f94d4,_0x5a82bf[_0xa5bf('0x4e')]);return _0x4a3a49[_0xa5bf('0x51')](_0x514d22);}})['catch'](handleError(_0x4a3a49,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7e4e48e..df7f6f2 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 _0xa5f0=['exports','define','attachments','../../config/logger','api','moment','bluebird','request-promise','path','./attachment.attributes'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa5f0,0x19d));var _0x0a5f=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xa5f0[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0a5f('0x0'))(_0x0a5f('0x1'));var moment=require(_0x0a5f('0x2'));var BPromise=require(_0x0a5f('0x3'));var rp=require(_0x0a5f('0x4'));var fs=require('fs');var path=require(_0x0a5f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a5f('0x6'));module[_0x0a5f('0x7')]=function(_0x632e51,_0x524f9f){return _0x632e51[_0x0a5f('0x8')]('Attachment',attributes,{'tableName':_0x0a5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c62=['rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','api','moment','bluebird','request-promise'];(function(_0x51d1c9,_0x4e9043){var _0x1872a4=function(_0x4524a7){while(--_0x4524a7){_0x51d1c9['push'](_0x51d1c9['shift']());}};_0x1872a4(++_0x4e9043);}(_0x2c62,0x69));var _0x22c6=function(_0x21dc01,_0x467f2c){_0x21dc01=_0x21dc01-0x0;var _0x53f3b5=_0x2c62[_0x21dc01];return _0x53f3b5;};'use strict';var _=require(_0x22c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x22c6('0x1'));var moment=require(_0x22c6('0x2'));var BPromise=require(_0x22c6('0x3'));var rp=require(_0x22c6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22c6('0x5'));var config=require(_0x22c6('0x6'));var attributes=require(_0x22c6('0x7'));module[_0x22c6('0x8')]=function(_0x5c134d,_0x3f23f9){return _0x5c134d[_0x22c6('0x9')]('Attachment',attributes,{'tableName':_0x22c6('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 84565b0..c6c08c6 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 _0x0fc2=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x21f425,_0x16f48f){var _0x261f03=function(_0x5616d0){while(--_0x5616d0){_0x21f425['push'](_0x21f425['shift']());}};_0x261f03(++_0x16f48f);}(_0x0fc2,0x6e));var _0x20fc=function(_0x50f1e4,_0xd2e4d6){_0x50f1e4=_0x50f1e4-0x0;var _0x470580=_0x0fc2[_0x50f1e4];return _0x470580;};'use strict';var _=require(_0x20fc('0x0'));var util=require(_0x20fc('0x1'));var moment=require(_0x20fc('0x2'));var BPromise=require(_0x20fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20fc('0x4'));var db=require(_0x20fc('0x5'))['db'];var utils=require(_0x20fc('0x6'));var logger=require(_0x20fc('0x7'))(_0x20fc('0x8'));var config=require(_0x20fc('0x9'));var jayson=require(_0x20fc('0xa'));var client=jayson[_0x20fc('0xb')][_0x20fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc556e8,_0x157c28,_0x470d1a){return new BPromise(function(_0x24b617,_0x17415e){return client[_0x20fc('0xd')](_0xc556e8,_0x470d1a)[_0x20fc('0xe')](function(_0x5cb749){logger[_0x20fc('0xf')](_0x20fc('0x10'),_0x157c28,_0x20fc('0x11'));logger['debug'](_0x20fc('0x12'),_0x157c28,_0x20fc('0x11'),JSON[_0x20fc('0x13')](_0x5cb749));if(_0x5cb749[_0x20fc('0x14')]){if(_0x5cb749[_0x20fc('0x14')][_0x20fc('0x15')]===0x1f4){logger[_0x20fc('0x14')](_0x20fc('0x10'),_0x157c28,_0x5cb749['error'][_0x20fc('0x16')]);return _0x17415e(_0x5cb749['error'][_0x20fc('0x16')]);}logger['error'](_0x20fc('0x10'),_0x157c28,_0x5cb749['error'][_0x20fc('0x16')]);return _0x24b617(_0x5cb749[_0x20fc('0x14')][_0x20fc('0x16')]);}else{logger[_0x20fc('0xf')](_0x20fc('0x10'),_0x157c28,_0x20fc('0x11'));_0x24b617(_0x5cb749[_0x20fc('0x17')][_0x20fc('0x16')]);}})['catch'](function(_0x56eaf4){logger[_0x20fc('0x14')](_0x20fc('0x10'),_0x157c28,_0x56eaf4);_0x17415e(_0x56eaf4);});});}exports[_0x20fc('0x18')]=function(_0x421ff8){var _0x4d5e00=this;return new Promise(function(_0x3f4190,_0x322e2c){return db[_0x20fc('0x19')][_0x20fc('0x1a')](_0x421ff8[_0x20fc('0x1b')],{'raw':_0x421ff8[_0x20fc('0x1c')]?_0x421ff8[_0x20fc('0x1c')][_0x20fc('0x1d')]===undefined?!![]:![]:!![]})[_0x20fc('0xe')](function(_0x41be86){logger['info'](_0x20fc('0x18'),_0x421ff8);logger[_0x20fc('0x1e')]('CreateAttachment',_0x421ff8,JSON[_0x20fc('0x13')](_0x41be86));_0x3f4190(_0x41be86);})[_0x20fc('0x1f')](function(_0x359881){logger[_0x20fc('0x14')](_0x20fc('0x18'),_0x359881[_0x20fc('0x16')],_0x421ff8);_0x322e2c(_0x4d5e00[_0x20fc('0x14')](0x1f4,_0x359881['message']));});});}; \ No newline at end of file +var _0xb903=['Attachment,\x20%s,\x20%s','message','info','result','create','options','then','CreateAttachment','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2c0654,_0x3ac4e7){var _0x2256da=function(_0x8aaf5c){while(--_0x8aaf5c){_0x2c0654['push'](_0x2c0654['shift']());}};_0x2256da(++_0x3ac4e7);}(_0xb903,0x185));var _0x3b90=function(_0x538fe4,_0xd535f){_0x538fe4=_0x538fe4-0x0;var _0x2b2e38=_0xb903[_0x538fe4];return _0x2b2e38;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('Attachment,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['CreateAttachment']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['Attachment'][_0x3b90('0x14')](_0x269488['body'],{'raw':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3b90('0x16')](function(_0x12e1cf){logger[_0x3b90('0x12')](_0x3b90('0x17'),_0x269488);logger[_0x3b90('0x18')](_0x3b90('0x17'),_0x269488,JSON[_0x3b90('0x19')](_0x12e1cf));_0x11ad7d(_0x12e1cf);})[_0x3b90('0x1a')](function(_0xa98414){logger[_0x3b90('0xf')]('CreateAttachment',_0xa98414[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xa98414[_0x3b90('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 053824b..5b39dc3 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x34d3fa,_0x2e54e1){var _0x1257c3=function(_0x41503d){while(--_0x41503d){_0x34d3fa['push'](_0x34d3fa['shift']());}};_0x1257c3(++_0x2e54e1);}(_0xadb5,0xad));var _0x5adb=function(_0x6b2927,_0x568817){_0x6b2927=_0x6b2927-0x0;var _0x295067=_0xadb5[_0x6b2927];return _0x295067;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +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(_0x4a6d32,_0x5232a1){var _0x375a21=function(_0x1184a5){while(--_0x1184a5){_0x4a6d32['push'](_0x4a6d32['shift']());}};_0x375a21(++_0x5232a1);}(_0x757a,0xde));var _0xa757=function(_0x3ed548,_0x5c66af){_0x3ed548=_0x3ed548-0x0;var _0x4aa4d4=_0x757a[_0x3ed548];return _0x4aa4d4;};'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 759c5bc..f6dafd7 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 _0xf83f=['clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blocked','blockedAt','online','admin','user','name','blockDuration','add','minutes'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0xf83f,0xff));var _0xff83=function(_0x31d350,_0x260a1b){_0x31d350=_0x31d350-0x0;var _0x28035f=_0xf83f[_0x31d350];return _0x28035f;};'use strict';var passport=require(_0xff83('0x0'));var LocalStrategy=require(_0xff83('0x1'))[_0xff83('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xff83('0x3'));var BPromise=require(_0xff83('0x4'));var util=require('util');var db=require(_0xff83('0x5'))['db'];var authService=require(_0xff83('0x6'));var utils=require(_0xff83('0x7'));var config=require('../../config/environment');var logger=require(_0xff83('0x8'))(_0xff83('0x9'));function isActiveDirectoryConfigured(_0x34642c){var _0x7c48a7=![];if(typeof _0x34642c[_0xff83('0xa')]!==_0xff83('0xb')){_0x7c48a7=_0x34642c[_0xff83('0xa')][_0xff83('0xc')]&&_0x34642c[_0xff83('0xa')][_0xff83('0xd')]&&_0x34642c['activedirectory'][_0xff83('0xe')];}return _0x7c48a7;}function adAuthenticate(_0x2b7a46,_0x10fecc,_0x2b7217){return new BPromise(function(_0x33ba0b,_0x1a4c54){try{var _0xd6bf70=new ActiveDirectory(_0x2b7a46);_0xd6bf70[_0xff83('0xf')](_0x10fecc,_0x2b7217,function(_0x4998d5,_0x493827){if(_0x4998d5){logger[_0xff83('0x10')](_0xff83('0x11'),_0x10fecc,util[_0xff83('0x12')](_0x4998d5,{'showHidden':![],'depth':null}));_0x1a4c54('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x493827){logger[_0xff83('0x10')](_0xff83('0x13'),_0x10fecc);_0x1a4c54('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x33ba0b(_0x493827);}});}catch(_0x5c39b0){_0x1a4c54(_0x5c39b0);}});}function ActiveDirectoryAuthenticate(_0x2d62eb,_0x352596,_0xd87ec0,_0x9ab202){var _0x5998f1,_0x2cc5f8;if(!isActiveDirectoryConfigured(config)){logger[_0xff83('0x10')](_0xff83('0x14'),_0x352596);return _0x9ab202(null,![],{'message':_0xff83('0x15')});}return db[_0xff83('0x16')][_0xff83('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0xff83('0x18')](function(_0x1e717d){_0x5998f1=_0x1e717d;if(!_0x5998f1[_0xff83('0x19')]){logger['error'](_0xff83('0x1a'),_0x352596);throw new Error(_0xff83('0x15'));}return _0x2d62eb[_0xff83('0x17')]({'logging':!![],'attributes':['id','name',_0xff83('0x1b'),_0xff83('0x1c'),'role',_0xff83('0x1d'),_0xff83('0x1e'),_0xff83('0x1f'),_0xff83('0x20')],'where':{'name':_0x352596,'role':{'$or':[_0xff83('0x21'),_0xff83('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0xff83('0x18')](function(_0x440b29){if(!_0x440b29||_0x440b29&&_0x440b29[_0xff83('0x23')]!==_0x352596){throw new Error(_0xff83('0x15'));}_0x2cc5f8=_0x440b29;var _0x4b6208=_0x2cc5f8[_0xff83('0x23')]+'@'+config[_0xff83('0xa')][_0xff83('0xe')];return adAuthenticate(config['activedirectory'],_0x4b6208,_0xd87ec0);})[_0xff83('0x18')](function(_0x29f238){if(_0x2cc5f8['disabled']){throw new Error(_0xff83('0x15'));}if(_0x5998f1[_0xff83('0x24')]>0x0){if(_0x2cc5f8['blocked']){if(moment(_0x2cc5f8[_0xff83('0x1f')])[_0xff83('0x25')](_0x5998f1['blockDuration'],_0xff83('0x26'))>moment()){throw new Error(_0xff83('0x15'));}return utils[_0xff83('0x27')](_0x2cc5f8,0x0,![],null)[_0xff83('0x18')](function(){return utils[_0xff83('0x28')](_0x2cc5f8);})[_0xff83('0x18')](function(){return _0x9ab202(null,_0x2cc5f8);});}else{return utils[_0xff83('0x28')](_0x2cc5f8)[_0xff83('0x18')](function(){return _0x9ab202(null,_0x2cc5f8);});}}else{return utils[_0xff83('0x28')](_0x2cc5f8)[_0xff83('0x18')](function(){return _0x9ab202(null,_0x2cc5f8);});}})[_0xff83('0x29')](function(_0x27f236){return _0x9ab202(null,![],_0x27f236);});}function handleError(_0x469e39,_0x4e3237,_0x3d0f83){return _0x469e39[_0xff83('0x2a')](_0x4e3237||0x1f4)[_0xff83('0x2b')]({'message':_0x3d0f83?_0x3d0f83['message']||_0x3d0f83:''});}exports[_0xff83('0x2c')]=function(_0x15125d,_0x1b80b8,_0xa8e8da){passport[_0xff83('0xf')](_0xff83('0x2d'),function(_0x263de4,_0x1941d9,_0x5142b6){var _0x768f7=_0x263de4||_0x5142b6;if(_0x768f7){return handleError(_0x1b80b8,0x191,_0x768f7);}if(!_0x1941d9){return handleError(_0x1b80b8,0x194,{'message':_0xff83('0x2e')});}else{var _0x5ac23a={'payload':{'id':_0x1941d9['id'],'role':_0x1941d9[_0xff83('0x2f')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5ac23a)[_0xff83('0x18')](function(_0x22e197){_0x1b80b8[_0xff83('0x30')]({'id':_0x1941d9['id'],'token':_0x22e197,'statusCall':'','isAlreadyLogged':_0x1941d9[_0xff83('0x20')]});});}})(_0x15125d,_0x1b80b8,_0xa8e8da);};passport['use'](_0xff83('0x2d'),new LocalStrategy({'usernameField':_0xff83('0x23'),'passwordField':_0xff83('0x1b')},function(_0x4e255b,_0x3aa065,_0x234dbe){return ActiveDirectoryAuthenticate(db['User'],_0x4e255b,_0x3aa065,_0x234dbe);})); \ No newline at end of file +var _0xc9ce=['name','password','salt','role','disabled','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','passport','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then'];(function(_0x314c6a,_0xded0be){var _0x2608d1=function(_0x4d7607){while(--_0x4d7607){_0x314c6a['push'](_0x314c6a['shift']());}};_0x2608d1(++_0xded0be);}(_0xc9ce,0x10a));var _0xec9c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc9ce[_0x40a045];return _0x1a687c;};'use strict';var passport=require(_0xec9c('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xec9c('0x1'));var ActiveDirectory=require(_0xec9c('0x2'));var BPromise=require(_0xec9c('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xec9c('0x4'));var utils=require(_0xec9c('0x5'));var config=require(_0xec9c('0x6'));var logger=require('../../config/logger')(_0xec9c('0x7'));function isActiveDirectoryConfigured(_0x587b4c){var _0x2c5216=![];if(typeof _0x587b4c[_0xec9c('0x8')]!==_0xec9c('0x9')){_0x2c5216=_0x587b4c[_0xec9c('0x8')][_0xec9c('0xa')]&&_0x587b4c[_0xec9c('0x8')]['url']&&_0x587b4c['activedirectory'][_0xec9c('0xb')];}return _0x2c5216;}function adAuthenticate(_0x40589e,_0x2f7a40,_0x2c141a){return new BPromise(function(_0x3838bd,_0x44fb1a){try{var _0x37d372=new ActiveDirectory(_0x40589e);_0x37d372[_0xec9c('0xc')](_0x2f7a40,_0x2c141a,function(_0x405ac1,_0x2f5328){if(_0x405ac1){logger[_0xec9c('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x2f7a40,util['inspect'](_0x405ac1,{'showHidden':![],'depth':null}));_0x44fb1a(_0xec9c('0xe'));}else if(!_0x2f5328){logger[_0xec9c('0xd')](_0xec9c('0xf'),_0x2f7a40);_0x44fb1a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3838bd(_0x2f5328);}});}catch(_0x2a8497){_0x44fb1a(_0x2a8497);}});}function ActiveDirectoryAuthenticate(_0xaae154,_0xebb17d,_0x260f8b,_0x4264d2){var _0x51f34a,_0xfb2399;if(!isActiveDirectoryConfigured(config)){logger[_0xec9c('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xebb17d);return _0x4264d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xec9c('0x10')][_0xec9c('0x11')]({'where':{'id':0x1},'attributes':[_0xec9c('0x12'),_0xec9c('0x13')],'raw':!![]})[_0xec9c('0x14')](function(_0xd2fc9f){_0x51f34a=_0xd2fc9f;if(!_0x51f34a[_0xec9c('0x12')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xebb17d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xaae154[_0xec9c('0x11')]({'logging':!![],'attributes':['id',_0xec9c('0x15'),_0xec9c('0x16'),_0xec9c('0x17'),_0xec9c('0x18'),_0xec9c('0x19'),_0xec9c('0x1a'),'blockedAt','online'],'where':{'name':_0xebb17d,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})[_0xec9c('0x14')](function(_0x30f1e3){if(!_0x30f1e3||_0x30f1e3&&_0x30f1e3[_0xec9c('0x15')]!==_0xebb17d){throw new Error(_0xec9c('0xe'));}_0xfb2399=_0x30f1e3;var _0x289c6d=_0xfb2399[_0xec9c('0x15')]+'@'+config['activedirectory'][_0xec9c('0xb')];return adAuthenticate(config[_0xec9c('0x8')],_0x289c6d,_0x260f8b);})['then'](function(_0x56be2d){if(_0xfb2399[_0xec9c('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x51f34a[_0xec9c('0x13')]>0x0){if(_0xfb2399[_0xec9c('0x1a')]){if(moment(_0xfb2399[_0xec9c('0x1b')])['add'](_0x51f34a[_0xec9c('0x13')],_0xec9c('0x1c'))>moment()){throw new Error(_0xec9c('0xe'));}return utils[_0xec9c('0x1d')](_0xfb2399,0x0,![],null)[_0xec9c('0x14')](function(){return utils[_0xec9c('0x1e')](_0xfb2399);})['then'](function(){return _0x4264d2(null,_0xfb2399);});}else{return utils[_0xec9c('0x1e')](_0xfb2399)[_0xec9c('0x14')](function(){return _0x4264d2(null,_0xfb2399);});}}else{return utils['getLicense'](_0xfb2399)[_0xec9c('0x14')](function(){return _0x4264d2(null,_0xfb2399);});}})[_0xec9c('0x1f')](function(_0x4b4a09){return _0x4264d2(null,![],_0x4b4a09);});}function handleError(_0x3ee7c7,_0x123e46,_0x1113ac){return _0x3ee7c7[_0xec9c('0x20')](_0x123e46||0x1f4)[_0xec9c('0x21')]({'message':_0x1113ac?_0x1113ac[_0xec9c('0x22')]||_0x1113ac:''});}exports[_0xec9c('0x23')]=function(_0x3fc5c1,_0x1b4e04,_0xa4d021){passport[_0xec9c('0xc')](_0xec9c('0x24'),function(_0x308e79,_0x4ff51b,_0x2e24b4){var _0x151c60=_0x308e79||_0x2e24b4;if(_0x151c60){return handleError(_0x1b4e04,0x191,_0x151c60);}if(!_0x4ff51b){return handleError(_0x1b4e04,0x194,{'message':_0xec9c('0x25')});}else{var _0x441b79={'payload':{'id':_0x4ff51b['id'],'role':_0x4ff51b[_0xec9c('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0xec9c('0x26')](_0x441b79)[_0xec9c('0x14')](function(_0xc7d738){_0x1b4e04[_0xec9c('0x27')]({'id':_0x4ff51b['id'],'token':_0xc7d738,'statusCall':'','isAlreadyLogged':_0x4ff51b[_0xec9c('0x28')]});});}})(_0x3fc5c1,_0x1b4e04,_0xa4d021);};passport['use'](_0xec9c('0x24'),new LocalStrategy({'usernameField':_0xec9c('0x15'),'passwordField':_0xec9c('0x16')},function(_0xc7f5f1,_0x458f08,_0x415da1){return ActiveDirectoryAuthenticate(db['User'],_0xc7f5f1,_0x458f08,_0x415da1);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index a36f908..049a2f4 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 _0xd614=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xd614,0x9a));var _0x4d61=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xd614[_0x618414];return _0x21c19a;};'use strict';var express=require('express');var router=express[_0x4d61('0x0')]();var controller=require(_0x4d61('0x1'));router[_0x4d61('0x2')]('/',controller[_0x4d61('0x3')]);module[_0x4d61('0x4')]=router; \ No newline at end of file +var _0x622a=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x24ecfc,_0x3edb3e){var _0x265caf=function(_0x47d037){while(--_0x47d037){_0x24ecfc['push'](_0x24ecfc['shift']());}};_0x265caf(++_0x3edb3e);}(_0x622a,0x1d0));var _0xa622=function(_0x566661,_0x3ef886){_0x566661=_0x566661-0x0;var _0x2d07d9=_0x622a[_0x566661];return _0x2d07d9;};'use strict';var express=require(_0xa622('0x0'));var router=express[_0xa622('0x1')]();var controller=require(_0xa622('0x2'));router[_0xa622('0x3')]('/',controller['login']);module[_0xa622('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ecd2f14..6d1fe79 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x59c1bd,_0x54a96c){_0x59c1bd=_0x59c1bd-0x0;var _0x30c166=_0x7a54[_0x59c1bd];return _0x30c166;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x6cbee,_0x55a318){var _0x4218ec=function(_0x179d74){while(--_0x179d74){_0x6cbee['push'](_0x6cbee['shift']());}};_0x4218ec(++_0x55a318);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 eec6323..81f2b33 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 _0x10b2=['callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x10b2,0x18e));var _0x210b=function(_0x2471d6,_0x11dd31){_0x2471d6=_0x2471d6-0x0;var _0x847aec=_0x10b2[_0x2471d6];return _0x847aec;};'use strict';var express=require(_0x210b('0x0'));var passport=require(_0x210b('0x1'));var router=express[_0x210b('0x2')]();var controller=require(_0x210b('0x3'));var userController=require(_0x210b('0x4'));var authService=require(_0x210b('0x5'));router['get']('/',controller[_0x210b('0x6')]);router[_0x210b('0x7')](_0x210b('0x8'),controller[_0x210b('0x9')],authService[_0x210b('0xa')],userController[_0x210b('0x6')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x238f=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','express','passport'];(function(_0x44073b,_0x53116c){var _0x3757d4=function(_0x1a7263){while(--_0x1a7263){_0x44073b['push'](_0x44073b['shift']());}};_0x3757d4(++_0x53116c);}(_0x238f,0x1d4));var _0xf238=function(_0x577a5f,_0xc90bbd){_0x577a5f=_0x577a5f-0x0;var _0x32a472=_0x238f[_0x577a5f];return _0x32a472;};'use strict';var express=require(_0xf238('0x0'));var passport=require(_0xf238('0x1'));var router=express[_0xf238('0x2')]();var controller=require(_0xf238('0x3'));var userController=require(_0xf238('0x4'));var authService=require(_0xf238('0x5'));router[_0xf238('0x6')]('/',controller[_0xf238('0x7')]);router[_0xf238('0x6')](_0xf238('0x8'),controller[_0xf238('0x9')],authService['isMiddleware'],userController[_0xf238('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 73edbf5..05d91e2 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 _0x9952=['Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','use','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','allowedLoginAttempts','blockDuration','findOne','name','role','disabled','blocked','loginAttempts','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','body'];(function(_0x44e50a,_0x1cc4a2){var _0x1b5994=function(_0x29a487){while(--_0x29a487){_0x44e50a['push'](_0x44e50a['shift']());}};_0x1b5994(++_0x1cc4a2);}(_0x9952,0x6e));var _0x2995=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0x9952[_0x503ffd];return _0x160437;};'use strict';var util=require(_0x2995('0x0'));var passport=require('passport');var LocalStrategy=require(_0x2995('0x1'))[_0x2995('0x2')];var jayson=require('jayson/promise');var _=require(_0x2995('0x3'));var rs=require(_0x2995('0x4'));var moment=require(_0x2995('0x5'));var db=require(_0x2995('0x6'))['db'];var authService=require(_0x2995('0x7'));var utils=require(_0x2995('0x8'));var client=jayson[_0x2995('0x9')]['http']({'port':0x232b});function localAuthenticate(_0xe494a4,_0x34c9ea,_0x2c301e,_0xa8e58f){var _0x2ca24d,_0x338d7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x2995('0xa'),_0x2995('0xb')],'raw':!![]})['then'](function(_0x1124e5){_0x2ca24d=_0x1124e5;return _0xe494a4[_0x2995('0xc')]({'attributes':['id',_0x2995('0xd'),'password','salt',_0x2995('0xe'),_0x2995('0xf'),_0x2995('0x10'),'blockedAt',_0x2995('0x11')],'where':{'name':_0x34c9ea,'role':{'$or':['admin','user',_0x2995('0x12')]}}});})[_0x2995('0x13')](function(_0x479826){if(!_0x479826||_0x479826&&_0x479826[_0x2995('0xd')]!==_0x34c9ea){throw new Error(_0x2995('0x14'));}else{_0x338d7=_0x479826;return _0x338d7;}})[_0x2995('0x13')](function(){_0x338d7[_0x2995('0x15')](_0x2c301e,function(_0x4acbfd,_0x60d599){var _0x58d555=_0x338d7['loginAttempts']+0x1;if(_0x4acbfd){return _0xa8e58f(_0x4acbfd);}else if(!_0x60d599){if(_0x338d7[_0x2995('0xf')]){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}else if(_0x2ca24d[_0x2995('0xa')]>0x0){if(_0x338d7[_0x2995('0x10')]){if(_0x2ca24d[_0x2995('0xb')]>0x0){if(moment(_0x338d7[_0x2995('0x16')])['add'](_0x2ca24d[_0x2995('0xb')],'minutes')>moment()){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}else{return utils[_0x2995('0x17')](_0x338d7,_0x58d555,![],null)[_0x2995('0x13')](function(){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});});}}else{return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}}else{if(_0x58d555>=_0x2ca24d['allowedLoginAttempts']){return utils[_0x2995('0x17')](_0x338d7,0x0,!![],moment())[_0x2995('0x13')](function(){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});});}else{return utils[_0x2995('0x17')](_0x338d7,_0x58d555,![],null)[_0x2995('0x13')](function(){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});});}}}else{return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}}else{if(_0x338d7['disabled']){return _0xa8e58f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2ca24d[_0x2995('0xa')]>0x0){if(_0x338d7[_0x2995('0x10')]){if(_0x2ca24d[_0x2995('0xb')]>0x0){if(moment(_0x338d7[_0x2995('0x16')])[_0x2995('0x18')](_0x2ca24d[_0x2995('0xb')],_0x2995('0x19'))>moment()){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}else{return utils[_0x2995('0x17')](_0x338d7,0x0,![],null)[_0x2995('0x13')](function(){return utils[_0x2995('0x1a')](_0x338d7);})[_0x2995('0x13')](function(){return _0xa8e58f(null,_0x338d7);});}}else{return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}}else{return utils[_0x2995('0x17')](_0x338d7,0x0,![],null)[_0x2995('0x13')](function(){return utils[_0x2995('0x1a')](_0x338d7);})['then'](function(){return _0xa8e58f(null,_0x338d7);})[_0x2995('0x1b')](function(_0x5c078b){return _0xa8e58f(null,![],_0x5c078b);});}}else{if(_0x338d7[_0x2995('0x10')]){return _0xa8e58f(null,![],{'message':_0x2995('0x14')});}else{return utils[_0x2995('0x1a')](_0x338d7)['then'](function(){return _0xa8e58f(null,_0x338d7);});}}}});})[_0x2995('0x1b')](function(_0x2ee38a){return _0xa8e58f(null,![],_0x2ee38a);});}function sendServiceMail(_0x5b7a62){return db[_0x2995('0x1c')][_0x2995('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x2995('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x2995('0x1e')}]})[_0x2995('0x13')](function(_0x3197d1){if(!_0x3197d1){throw new Error(_0x2995('0x1f'));}var _0x55bfd8={'tls':{'rejectUnauthorized':![]}};if(_0x3197d1['Smtp'][_0x2995('0x20')]){_0x55bfd8[_0x2995('0x20')]=_0x3197d1[_0x2995('0x1e')][_0x2995('0x20')];}else{_0x55bfd8[_0x2995('0x21')]=_0x3197d1['Smtp'][_0x2995('0x21')];_0x55bfd8[_0x2995('0x22')]=_0x3197d1['Smtp'][_0x2995('0x22')];_0x55bfd8['secure']=_0x3197d1[_0x2995('0x1e')][_0x2995('0x23')];}if(_0x3197d1['Smtp'][_0x2995('0x24')]){_0x55bfd8[_0x2995('0x25')]={'user':_0x3197d1['Smtp'][_0x2995('0x26')],'pass':_0x3197d1[_0x2995('0x1e')]['pass']};}var _0x205635={'account':_0x55bfd8,'message':_[_0x2995('0x27')]({'from':util[_0x2995('0x28')](_0x2995('0x29'),_0x3197d1[_0x2995('0xd')],_0x3197d1[_0x2995('0x2a')]||_0x3197d1[_0x2995('0x1e')][_0x2995('0x26')])},_0x5b7a62)};return client[_0x2995('0x2b')](_0x2995('0x2c'),_0x205635);})[_0x2995('0x13')](function(_0x46745f){if(_0x46745f[_0x2995('0x2d')]){throw new Error(util['format'](_0x2995('0x2e'),_0x46745f['error'][_0x2995('0x2f')]||JSON[_0x2995('0x30')](_0x46745f[_0x2995('0x2d')])));}return!![];});}function handleError(_0x5c1103,_0x434953,_0x2dfd30){return _0x5c1103[_0x2995('0x31')](_0x434953||0x1f4)[_0x2995('0x32')]({'message':_0x2dfd30?_0x2dfd30[_0x2995('0x2f')]||_0x2dfd30:''});}exports[_0x2995('0x33')]=function(_0x2c3076,_0x227c82,_0x32d996){passport[_0x2995('0x15')](_0x2995('0x34'),function(_0x1156bf,_0x37deaf,_0x3a1060){var _0x5b5a8d=_0x1156bf||_0x3a1060;if(_0x5b5a8d){return handleError(_0x227c82,0x191,_0x5b5a8d);}if(!_0x37deaf){return handleError(_0x227c82,0x194,{'message':_0x2995('0x35')});}else{var _0x430368={'payload':{'id':_0x37deaf['id'],'role':_0x37deaf['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x430368)[_0x2995('0x13')](function(_0x2832ae){_0x227c82['json']({'id':_0x37deaf['id'],'token':_0x2832ae,'statusCall':'','isAlreadyLogged':_0x37deaf[_0x2995('0x36')]});});}})(_0x2c3076,_0x227c82,_0x32d996);};exports['forgot']=function(_0x330b12,_0x9716ca,_0x30698d){if(!_0x330b12[_0x2995('0x37')]['email']){return handleError(_0x9716ca,0x1f4,{'message':_0x2995('0x38')});}var _0x3536fe=rs[_0x2995('0x39')]();_0x330b12['body'][_0x2995('0x2a')]=_0x330b12[_0x2995('0x37')][_0x2995('0x2a')][_0x2995('0x3a')]()[_0x2995('0x3b')]();var _0x13a65f;return db[_0x2995('0x3c')][_0x2995('0xc')]({'where':{'id':0x1},'attributes':[_0x2995('0xa'),_0x2995('0xb')],'raw':!![]})[_0x2995('0x13')](function(_0x1c8717){_0x13a65f=_0x1c8717;return db[_0x2995('0x3d')][_0x2995('0x1d')]({'where':{'email':_0x330b12[_0x2995('0x37')][_0x2995('0x2a')]}});})[_0x2995('0x13')](function(_0x20c200){if(!_0x20c200){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x20c200['disabled']){throw new Error(_0x2995('0x3e'));}if(_0x20c200['blocked']){if(moment(_0x20c200[_0x2995('0x16')])[_0x2995('0x18')](_0x13a65f[_0x2995('0xb')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x20c200[_0x2995('0x10')]=![];_0x20c200[_0x2995('0x16')]=null;}}_0x20c200['resetPasswordToken']=_0x3536fe;_0x20c200['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x20c200[_0x2995('0x3f')]();})[_0x2995('0x13')](function(){return sendServiceMail({'to':_0x330b12[_0x2995('0x37')][_0x2995('0x2a')],'subject':_0x2995('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x2995('0x41')+_0x2995('0x42')+_0x330b12[_0x2995('0x43')][_0x2995('0x21')]+_0x2995('0x44')+_0x3536fe+'\x0a\x0a'+_0x2995('0x45')});})[_0x2995('0x13')](function(){_0x9716ca[_0x2995('0x31')](0xc8)[_0x2995('0x32')]({'message':_0x2995('0x46')});})['catch'](function(_0x235d56){return handleError(_0x9716ca,0x1f4,_0x235d56);});};exports[_0x2995('0x47')]=function(_0x27746e,_0x1e4af1,_0x1e45fe){return db['User'][_0x2995('0x1d')]({'where':{'resetPasswordToken':_0x27746e[_0x2995('0x48')][_0x2995('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2995('0x13')](function(_0x1ae5cd){if(!_0x1ae5cd){throw new Error(_0x2995('0x4a'));}return db[_0x2995('0x3c')]['findOne']({'attributes':['id',_0x2995('0x4b'),'enforcePasswordHistory',_0x2995('0x4c')]})[_0x2995('0x13')](function(_0x44a74d){if(_0x44a74d['securePassword'])authService['validatePasswordPattern'](_0x27746e[_0x2995('0x37')][_0x2995('0x4d')]);if(!_0x44a74d['enforcePasswordHistory']||!_0x1ae5cd[_0x2995('0x4e')])return _0x1ae5cd;authService[_0x2995('0x4f')](_0x27746e[_0x2995('0x37')][_0x2995('0x4d')],_0x1ae5cd[_0x2995('0x4e')],_0x44a74d[_0x2995('0x4c')]);return _0x1ae5cd;})['then'](function(){_0x1ae5cd[_0x2995('0x4d')]=_0x27746e[_0x2995('0x37')][_0x2995('0x4d')];_0x1ae5cd[_0x2995('0x50')]=null;_0x1ae5cd[_0x2995('0x51')]=null;return _0x1ae5cd[_0x2995('0x3f')]();});})[_0x2995('0x13')](function(){_0x1e4af1[_0x2995('0x31')](0xc8)[_0x2995('0x32')]({'message':'Password\x20reset!'});})['catch'](function(_0x85776f){return handleError(_0x1e4af1,0x1f4,_0x85776f);});};passport[_0x2995('0x52')](_0x2995('0x34'),new LocalStrategy({'usernameField':_0x2995('0xd'),'passwordField':_0x2995('0x4d')},function(_0x226132,_0x1bbec8,_0x528c7f){return localAuthenticate(db['User'],_0x226132,_0x1bbec8,_0x528c7f);})); \ No newline at end of file +var _0x0868=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','minutes','clearBlockUser','add','getLicense','catch','Smtp'];(function(_0xad73e7,_0x37d3ec){var _0x3f5732=function(_0x58b19e){while(--_0x58b19e){_0xad73e7['push'](_0xad73e7['shift']());}};_0x3f5732(++_0x37d3ec);}(_0x0868,0xdf));var _0x8086=function(_0x2590a5,_0x48072f){_0x2590a5=_0x2590a5-0x0;var _0x1c241d=_0x0868[_0x2590a5];return _0x1c241d;};'use strict';var util=require(_0x8086('0x0'));var passport=require(_0x8086('0x1'));var LocalStrategy=require(_0x8086('0x2'))[_0x8086('0x3')];var jayson=require('jayson/promise');var _=require(_0x8086('0x4'));var rs=require(_0x8086('0x5'));var moment=require(_0x8086('0x6'));var db=require(_0x8086('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8086('0x8'));var client=jayson[_0x8086('0x9')][_0x8086('0xa')]({'port':0x232b});function localAuthenticate(_0x13e6e3,_0x2f44ae,_0x4dc83f,_0x194280){var _0x320934,_0x5d85f2;return db['Setting'][_0x8086('0xb')]({'where':{'id':0x1},'attributes':[_0x8086('0xc'),_0x8086('0xd')],'raw':!![]})[_0x8086('0xe')](function(_0x443984){_0x320934=_0x443984;return _0x13e6e3['findOne']({'attributes':['id',_0x8086('0xf'),_0x8086('0x10'),'salt','role','disabled',_0x8086('0x11'),_0x8086('0x12'),'loginAttempts'],'where':{'name':_0x2f44ae,'role':{'$or':[_0x8086('0x13'),_0x8086('0x14'),_0x8086('0x15')]}}});})['then'](function(_0x415283){if(!_0x415283||_0x415283&&_0x415283['name']!==_0x2f44ae){throw new Error(_0x8086('0x16'));}else{_0x5d85f2=_0x415283;return _0x5d85f2;}})[_0x8086('0xe')](function(){_0x5d85f2[_0x8086('0x17')](_0x4dc83f,function(_0x11e151,_0x4ef5f3){var _0x16ec8a=_0x5d85f2[_0x8086('0x18')]+0x1;if(_0x11e151){return _0x194280(_0x11e151);}else if(!_0x4ef5f3){if(_0x5d85f2[_0x8086('0x19')]){return _0x194280(null,![],{'message':_0x8086('0x16')});}else if(_0x320934[_0x8086('0xc')]>0x0){if(_0x5d85f2[_0x8086('0x11')]){if(_0x320934[_0x8086('0xd')]>0x0){if(moment(_0x5d85f2[_0x8086('0x12')])['add'](_0x320934[_0x8086('0xd')],_0x8086('0x1a'))>moment()){return _0x194280(null,![],{'message':_0x8086('0x16')});}else{return utils['clearBlockUser'](_0x5d85f2,_0x16ec8a,![],null)['then'](function(){return _0x194280(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x194280(null,![],{'message':_0x8086('0x16')});}}else{if(_0x16ec8a>=_0x320934[_0x8086('0xc')]){return utils[_0x8086('0x1b')](_0x5d85f2,0x0,!![],moment())[_0x8086('0xe')](function(){return _0x194280(null,![],{'message':_0x8086('0x16')});});}else{return utils[_0x8086('0x1b')](_0x5d85f2,_0x16ec8a,![],null)['then'](function(){return _0x194280(null,![],{'message':_0x8086('0x16')});});}}}else{return _0x194280(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5d85f2[_0x8086('0x19')]){return _0x194280(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x320934[_0x8086('0xc')]>0x0){if(_0x5d85f2[_0x8086('0x11')]){if(_0x320934[_0x8086('0xd')]>0x0){if(moment(_0x5d85f2['blockedAt'])[_0x8086('0x1c')](_0x320934[_0x8086('0xd')],_0x8086('0x1a'))>moment()){return _0x194280(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8086('0x1b')](_0x5d85f2,0x0,![],null)[_0x8086('0xe')](function(){return utils['getLicense'](_0x5d85f2);})[_0x8086('0xe')](function(){return _0x194280(null,_0x5d85f2);});}}else{return _0x194280(null,![],{'message':_0x8086('0x16')});}}else{return utils['clearBlockUser'](_0x5d85f2,0x0,![],null)[_0x8086('0xe')](function(){return utils[_0x8086('0x1d')](_0x5d85f2);})['then'](function(){return _0x194280(null,_0x5d85f2);})[_0x8086('0x1e')](function(_0x225735){return _0x194280(null,![],_0x225735);});}}else{if(_0x5d85f2[_0x8086('0x11')]){return _0x194280(null,![],{'message':_0x8086('0x16')});}else{return utils['getLicense'](_0x5d85f2)[_0x8086('0xe')](function(){return _0x194280(null,_0x5d85f2);});}}}});})[_0x8086('0x1e')](function(_0x4c5ee0){return _0x194280(null,![],_0x4c5ee0);});}function sendServiceMail(_0x175ac0){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x8086('0xf'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x8086('0x1f')}]})['then'](function(_0x1c7341){if(!_0x1c7341){throw new Error(_0x8086('0x20'));}var _0x2052c9={'tls':{'rejectUnauthorized':![]}};if(_0x1c7341[_0x8086('0x1f')]['service']){_0x2052c9[_0x8086('0x21')]=_0x1c7341[_0x8086('0x1f')][_0x8086('0x21')];}else{_0x2052c9[_0x8086('0x22')]=_0x1c7341['Smtp']['host'];_0x2052c9[_0x8086('0x23')]=_0x1c7341['Smtp'][_0x8086('0x23')];_0x2052c9['secure']=_0x1c7341[_0x8086('0x1f')][_0x8086('0x24')];}if(_0x1c7341[_0x8086('0x1f')][_0x8086('0x25')]){_0x2052c9[_0x8086('0x26')]={'user':_0x1c7341['Smtp']['user'],'pass':_0x1c7341['Smtp']['pass']};}var _0x3b94ae={'account':_0x2052c9,'message':_[_0x8086('0x27')]({'from':util[_0x8086('0x28')](_0x8086('0x29'),_0x1c7341['name'],_0x1c7341[_0x8086('0x2a')]||_0x1c7341[_0x8086('0x1f')][_0x8086('0x14')])},_0x175ac0)};return client[_0x8086('0x2b')](_0x8086('0x2c'),_0x3b94ae);})['then'](function(_0x5692d0){if(_0x5692d0[_0x8086('0x2d')]){throw new Error(util['format'](_0x8086('0x2e'),_0x5692d0[_0x8086('0x2d')][_0x8086('0x2f')]||JSON[_0x8086('0x30')](_0x5692d0[_0x8086('0x2d')])));}return!![];});}function handleError(_0x1af1fe,_0x49e00a,_0x47d98c){return _0x1af1fe[_0x8086('0x31')](_0x49e00a||0x1f4)[_0x8086('0x32')]({'message':_0x47d98c?_0x47d98c['message']||_0x47d98c:''});}exports['login']=function(_0x2707f9,_0x4c1bb3,_0x3a02cf){passport[_0x8086('0x17')](_0x8086('0x33'),function(_0x5e5ee4,_0x1091e1,_0x365a0d){var _0x592e50=_0x5e5ee4||_0x365a0d;if(_0x592e50){return handleError(_0x4c1bb3,0x191,_0x592e50);}if(!_0x1091e1){return handleError(_0x4c1bb3,0x194,{'message':_0x8086('0x34')});}else{var _0x2c4f9c={'payload':{'id':_0x1091e1['id'],'role':_0x1091e1['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2c4f9c)[_0x8086('0xe')](function(_0x2063a0){_0x4c1bb3[_0x8086('0x35')]({'id':_0x1091e1['id'],'token':_0x2063a0,'statusCall':'','isAlreadyLogged':_0x1091e1['online']});});}})(_0x2707f9,_0x4c1bb3,_0x3a02cf);};exports[_0x8086('0x36')]=function(_0x46d9a6,_0x3d4698,_0x125eea){if(!_0x46d9a6[_0x8086('0x37')][_0x8086('0x2a')]){return handleError(_0x3d4698,0x1f4,{'message':_0x8086('0x38')});}var _0x6ba95e=rs[_0x8086('0x39')]();_0x46d9a6[_0x8086('0x37')][_0x8086('0x2a')]=_0x46d9a6[_0x8086('0x37')][_0x8086('0x2a')][_0x8086('0x3a')]()[_0x8086('0x3b')]();var _0x3f0d7f;return db[_0x8086('0x3c')]['findOne']({'where':{'id':0x1},'attributes':[_0x8086('0xc'),_0x8086('0xd')],'raw':!![]})[_0x8086('0xe')](function(_0x406255){_0x3f0d7f=_0x406255;return db[_0x8086('0x3d')]['find']({'where':{'email':_0x46d9a6['body']['email']}});})['then'](function(_0x5ead6e){if(!_0x5ead6e){throw new Error(_0x8086('0x3e'));}if(_0x5ead6e['disabled']){throw new Error(_0x8086('0x3f'));}if(_0x5ead6e[_0x8086('0x11')]){if(moment(_0x5ead6e[_0x8086('0x12')])[_0x8086('0x1c')](_0x3f0d7f['blockDuration'],_0x8086('0x1a'))>moment()){throw new Error(_0x8086('0x40'));}else{_0x5ead6e[_0x8086('0x11')]=![];_0x5ead6e[_0x8086('0x12')]=null;}}_0x5ead6e[_0x8086('0x41')]=_0x6ba95e;_0x5ead6e['resetPasswordExpires']=Date[_0x8086('0x42')]()+0x36ee80;return _0x5ead6e[_0x8086('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x46d9a6[_0x8086('0x37')][_0x8086('0x2a')],'subject':_0x8086('0x44'),'text':_0x8086('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x8086('0x46')+_0x46d9a6[_0x8086('0x47')][_0x8086('0x22')]+'/reset/'+_0x6ba95e+'\x0a\x0a'+_0x8086('0x48')});})[_0x8086('0xe')](function(){_0x3d4698[_0x8086('0x31')](0xc8)[_0x8086('0x32')]({'message':_0x8086('0x49')});})['catch'](function(_0x56135b){return handleError(_0x3d4698,0x1f4,_0x56135b);});};exports[_0x8086('0x4a')]=function(_0x3dfc1d,_0x35f052,_0x23540b){return db[_0x8086('0x3d')]['find']({'where':{'resetPasswordToken':_0x3dfc1d['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x8086('0xe')](function(_0x3a7162){if(!_0x3a7162){throw new Error(_0x8086('0x4b'));}return db[_0x8086('0x3c')][_0x8086('0xb')]({'attributes':['id',_0x8086('0x4c'),_0x8086('0x4d'),_0x8086('0x4e')]})[_0x8086('0xe')](function(_0x470604){if(_0x470604[_0x8086('0x4c')])authService[_0x8086('0x4f')](_0x3dfc1d[_0x8086('0x37')][_0x8086('0x10')]);if(!_0x470604['enforcePasswordHistory']||!_0x3a7162['previousPasswords'])return _0x3a7162;authService[_0x8086('0x50')](_0x3dfc1d['body'][_0x8086('0x10')],_0x3a7162[_0x8086('0x51')],_0x470604[_0x8086('0x4e')]);return _0x3a7162;})[_0x8086('0xe')](function(){_0x3a7162[_0x8086('0x10')]=_0x3dfc1d['body']['password'];_0x3a7162[_0x8086('0x41')]=null;_0x3a7162[_0x8086('0x52')]=null;return _0x3a7162[_0x8086('0x43')]();});})[_0x8086('0xe')](function(){_0x35f052[_0x8086('0x31')](0xc8)[_0x8086('0x32')]({'message':_0x8086('0x53')});})[_0x8086('0x1e')](function(_0x23c7e8){return handleError(_0x35f052,0x1f4,_0x23c7e8);});};passport[_0x8086('0x54')](_0x8086('0x33'),new LocalStrategy({'usernameField':_0x8086('0xf'),'passwordField':'password'},function(_0x66a782,_0xcf06ea,_0x2c77dd){return localAuthenticate(db[_0x8086('0x3d')],_0x66a782,_0xcf06ea,_0x2c77dd);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f4f902f..58c9992 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 _0xba5f=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x5313c2,_0x70c1de){var _0x2c5017=function(_0x24bd89){while(--_0x24bd89){_0x5313c2['push'](_0x5313c2['shift']());}};_0x2c5017(++_0x70c1de);}(_0xba5f,0x1da));var _0xfba5=function(_0x577e4a,_0x25e8f5){_0x577e4a=_0x577e4a-0x0;var _0x5bcbe1=_0xba5f[_0x577e4a];return _0x5bcbe1;};'use strict';var express=require('express');var router=express[_0xfba5('0x0')]();var controller=require(_0xfba5('0x1'));router[_0xfba5('0x2')]('/',controller[_0xfba5('0x3')]);router[_0xfba5('0x2')](_0xfba5('0x4'),controller[_0xfba5('0x5')]);router[_0xfba5('0x2')](_0xfba5('0x6'),controller[_0xfba5('0x7')]);module[_0xfba5('0x8')]=router; \ No newline at end of file +var _0xd84e=['./authLocal.controller','post','login','/forgot','forgot','reset','express'];(function(_0x147e6a,_0x50227c){var _0x4f77fa=function(_0x240ae3){while(--_0x240ae3){_0x147e6a['push'](_0x147e6a['shift']());}};_0x4f77fa(++_0x50227c);}(_0xd84e,0x1f0));var _0xed84=function(_0x2c6748,_0x1d40db){_0x2c6748=_0x2c6748-0x0;var _0x2f7677=_0xd84e[_0x2c6748];return _0x2f7677;};'use strict';var express=require(_0xed84('0x0'));var router=express['Router']();var controller=require(_0xed84('0x1'));router[_0xed84('0x2')]('/',controller[_0xed84('0x3')]);router[_0xed84('0x2')](_0xed84('0x4'),controller[_0xed84('0x5')]);router[_0xed84('0x2')]('/reset/:token',controller[_0xed84('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 797665e..e9d64ca 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 _0xcc71=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1c399b,_0x3bd125){var _0x1fc4a9=function(_0x1c5afe){while(--_0x1c5afe){_0x1c399b['push'](_0x1c399b['shift']());}};_0x1fc4a9(++_0x3bd125);}(_0xcc71,0x1b4));var _0x1cc7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xcc71[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0x1cc7('0x0'));module[_0x1cc7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1cc7('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1cc7('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1cc7('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa674=['INTEGER','exports','STRING'];(function(_0x1e2e28,_0xfa167b){var _0x5e14dd=function(_0x2a4154){while(--_0x2a4154){_0x1e2e28['push'](_0x1e2e28['shift']());}};_0x5e14dd(++_0xfa167b);}(_0xa674,0x12d));var _0x4a67=function(_0x2ba96b,_0x3bcefd){_0x2ba96b=_0x2ba96b-0x0;var _0x4b7d33=_0xa674[_0x2ba96b];return _0x4b7d33;};'use strict';var Sequelize=require('sequelize');module[_0x4a67('0x0')]={'name':{'type':Sequelize[_0x4a67('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4a67('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4a67('0x2')],'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 8106dba..03b9fec 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 _0x552e=['options','includeAll','Automation','findAll','rows','catch','show','params','rawAttributes','find','create','body','addConditions','Condition','omit','ids','getConditions','order','pick','addActions','findOne','Action','getActions','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','reject','update','then','destroy','end','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge'];(function(_0x33d1ea,_0x45fd13){var _0xe9b5cd=function(_0x203b0b){while(--_0x203b0b){_0x33d1ea['push'](_0x33d1ea['shift']());}};_0xe9b5cd(++_0x45fd13);}(_0x552e,0x15f));var _0xe552=function(_0x23ffff,_0x807a2a){_0x23ffff=_0x23ffff-0x0;var _0x94d47f=_0x552e[_0x23ffff];return _0x94d47f;};'use strict';var emlformat=require(_0xe552('0x0'));var rimraf=require(_0xe552('0x1'));var zipdir=require(_0xe552('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe552('0x3'));var moment=require('moment');var BPromise=require(_0xe552('0x4'));var Mustache=require('mustache');var util=require(_0xe552('0x5'));var path=require('path');var sox=require(_0xe552('0x6'));var csv=require(_0xe552('0x7'));var ejs=require(_0xe552('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe552('0x9'));var crypto=require(_0xe552('0xa'));var jsforce=require(_0xe552('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe552('0x7'));var querystring=require(_0xe552('0xc'));var Papa=require(_0xe552('0xd'));var Redis=require(_0xe552('0xe'));var authService=require(_0xe552('0xf'));var qs=require(_0xe552('0x10'));var as=require(_0xe552('0x11'));var hardwareService=require(_0xe552('0x12'));var logger=require(_0xe552('0x13'))(_0xe552('0x14'));var utils=require('../../config/utils');var config=require(_0xe552('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe552('0x16'))['db'];function respondWithStatusCode(_0xdfee76,_0x9328ff){_0x9328ff=_0x9328ff||0xcc;return function(_0x2f5972){if(_0x2f5972){return _0xdfee76[_0xe552('0x17')](_0x9328ff);}return _0xdfee76['status'](_0x9328ff)['end']();};}function respondWithResult(_0x1a38ba,_0x4fb1ec){_0x4fb1ec=_0x4fb1ec||0xc8;return function(_0x4a544d){if(_0x4a544d){return _0x1a38ba[_0xe552('0x18')](_0x4fb1ec)[_0xe552('0x19')](_0x4a544d);}};}function respondWithFilteredResult(_0x3f8770,_0x167d46){return function(_0x457dea){if(_0x457dea){var _0x5bf8a8=typeof _0x167d46[_0xe552('0x1a')]===_0xe552('0x1b')&&typeof _0x167d46['limit']===_0xe552('0x1b');var _0x31143a=_0x457dea[_0xe552('0x1c')];var _0x1530da=_0x5bf8a8?0x0:_0x167d46['offset'];var _0x368eac=_0x5bf8a8?_0x457dea[_0xe552('0x1c')]:_0x167d46[_0xe552('0x1a')]+_0x167d46['limit'];var _0x1710ce;if(_0x368eac>=_0x31143a){_0x368eac=_0x31143a;_0x1710ce=0xc8;}else{_0x1710ce=0xce;}_0x3f8770[_0xe552('0x18')](_0x1710ce);return _0x3f8770[_0xe552('0x1d')]('Content-Range',_0x1530da+'-'+_0x368eac+'/'+_0x31143a)[_0xe552('0x19')](_0x457dea);}return null;};}function patchUpdates(_0x2d6310){return function(_0x1bce02){try{jsonpatch['apply'](_0x1bce02,_0x2d6310,!![]);}catch(_0x3b9f05){return BPromise[_0xe552('0x1e')](_0x3b9f05);}return _0x1bce02['save']();};}function saveUpdates(_0x5e30f7,_0x13a428){return function(_0x3f4aa4){if(_0x3f4aa4){return _0x3f4aa4[_0xe552('0x1f')](_0x5e30f7)[_0xe552('0x20')](function(_0x3f9e1e){return _0x3f9e1e;});}return null;};}function removeEntity(_0x3a39a6,_0x363c91){return function(_0x10637b){if(_0x10637b){return _0x10637b[_0xe552('0x21')]()[_0xe552('0x20')](function(){_0x3a39a6['status'](0xcc)[_0xe552('0x22')]();});}};}function handleEntityNotFound(_0x559edf,_0x4f8c0b){return function(_0x4a9bd5){if(!_0x4a9bd5){_0x559edf[_0xe552('0x17')](0x194);}return _0x4a9bd5;};}function handleError(_0x328bfb,_0xaa71f3){_0xaa71f3=_0xaa71f3||0x1f4;return function(_0xd68754){logger['error'](_0xd68754[_0xe552('0x23')]);if(_0xd68754[_0xe552('0x24')]){delete _0xd68754[_0xe552('0x24')];}_0x328bfb[_0xe552('0x18')](_0xaa71f3)[_0xe552('0x25')](_0xd68754);};}exports[_0xe552('0x26')]=function(_0x1f0ca3,_0x25e61a){var _0x1632c2={},_0x2ffa0b={},_0x567895={'count':0x0,'rows':[]};var _0x399a45=_[_0xe552('0x27')](db['Automation']['rawAttributes'],function(_0x21026f){return{'name':_0x21026f[_0xe552('0x28')],'type':_0x21026f[_0xe552('0x29')][_0xe552('0x2a')]};});_0x2ffa0b[_0xe552('0x2b')]=_['map'](_0x399a45,_0xe552('0x24'));_0x2ffa0b['query']=_[_0xe552('0x2c')](_0x1f0ca3[_0xe552('0x2d')]);_0x2ffa0b[_0xe552('0x2e')]=_[_0xe552('0x2f')](_0x2ffa0b['model'],_0x2ffa0b['query']);_0x1632c2[_0xe552('0x30')]=_[_0xe552('0x2f')](_0x2ffa0b[_0xe552('0x2b')],qs[_0xe552('0x31')](_0x1f0ca3['query'][_0xe552('0x31')]));_0x1632c2[_0xe552('0x30')]=_0x1632c2['attributes'][_0xe552('0x32')]?_0x1632c2[_0xe552('0x30')]:_0x2ffa0b[_0xe552('0x2b')];if(!_0x1f0ca3[_0xe552('0x2d')][_0xe552('0x33')](_0xe552('0x34'))){_0x1632c2[_0xe552('0x35')]=qs['limit'](_0x1f0ca3[_0xe552('0x2d')]['limit']);_0x1632c2[_0xe552('0x1a')]=qs[_0xe552('0x1a')](_0x1f0ca3['query'][_0xe552('0x1a')]);}_0x1632c2['order']=qs[_0xe552('0x36')](_0x1f0ca3[_0xe552('0x2d')][_0xe552('0x36')]);_0x1632c2[_0xe552('0x37')]=qs['filters'](_['pick'](_0x1f0ca3[_0xe552('0x2d')],_0x2ffa0b[_0xe552('0x2e')]),_0x399a45);if(_0x1f0ca3[_0xe552('0x2d')][_0xe552('0x38')]){_0x1632c2[_0xe552('0x37')]=_['merge'](_0x1632c2[_0xe552('0x37')],{'$or':_[_0xe552('0x27')](_0x399a45,function(_0x3ad70f){if(_0x3ad70f[_0xe552('0x29')]!==_0xe552('0x39')){var _0x13daa6={};_0x13daa6[_0x3ad70f[_0xe552('0x24')]]={'$like':'%'+_0x1f0ca3[_0xe552('0x2d')][_0xe552('0x38')]+'%'};return _0x13daa6;}})});}_0x1632c2=_[_0xe552('0x3a')]({},_0x1632c2,_0x1f0ca3[_0xe552('0x3b')]);var _0x426fdd={'where':_0x1632c2['where']};return db['Automation'][_0xe552('0x1c')](_0x426fdd)[_0xe552('0x20')](function(_0x38e9e5){_0x567895[_0xe552('0x1c')]=_0x38e9e5;if(_0x1f0ca3[_0xe552('0x2d')][_0xe552('0x3c')]){_0x1632c2['include']=[{'all':!![]}];}return db[_0xe552('0x3d')][_0xe552('0x3e')](_0x1632c2);})[_0xe552('0x20')](function(_0xb8794d){_0x567895[_0xe552('0x3f')]=_0xb8794d;return _0x567895;})[_0xe552('0x20')](respondWithFilteredResult(_0x25e61a,_0x1632c2))[_0xe552('0x40')](handleError(_0x25e61a,null));};exports[_0xe552('0x41')]=function(_0x80071d,_0x3a891e){var _0x3d0b2a={'raw':![],'where':{'id':_0x80071d[_0xe552('0x42')]['id']}},_0x202379={};_0x202379[_0xe552('0x2b')]=_[_0xe552('0x2c')](db[_0xe552('0x3d')][_0xe552('0x43')]);_0x202379[_0xe552('0x2d')]=_[_0xe552('0x2c')](_0x80071d[_0xe552('0x2d')]);_0x202379['filters']=_[_0xe552('0x2f')](_0x202379['model'],_0x202379[_0xe552('0x2d')]);_0x3d0b2a[_0xe552('0x30')]=_[_0xe552('0x2f')](_0x202379[_0xe552('0x2b')],qs[_0xe552('0x31')](_0x80071d[_0xe552('0x2d')][_0xe552('0x31')]));_0x3d0b2a[_0xe552('0x30')]=_0x3d0b2a[_0xe552('0x30')][_0xe552('0x32')]?_0x3d0b2a[_0xe552('0x30')]:_0x202379['model'];if(_0x80071d[_0xe552('0x2d')]['includeAll']){_0x3d0b2a['include']=[{'all':!![]}];}_0x3d0b2a=_[_0xe552('0x3a')]({},_0x3d0b2a,_0x80071d['options']);return db[_0xe552('0x3d')][_0xe552('0x44')](_0x3d0b2a)[_0xe552('0x20')](handleEntityNotFound(_0x3a891e,null))[_0xe552('0x20')](respondWithResult(_0x3a891e,null))[_0xe552('0x40')](handleError(_0x3a891e,null));};exports[_0xe552('0x45')]=function(_0x48a1bb,_0x35b0cf){return db[_0xe552('0x3d')][_0xe552('0x45')](_0x48a1bb[_0xe552('0x46')],{})[_0xe552('0x20')](respondWithResult(_0x35b0cf,0xc9))[_0xe552('0x40')](handleError(_0x35b0cf,null));};exports[_0xe552('0x1f')]=function(_0xcf9de1,_0x958454){if(_0xcf9de1[_0xe552('0x46')]['id']){delete _0xcf9de1['body']['id'];}return db[_0xe552('0x3d')][_0xe552('0x44')]({'where':{'id':_0xcf9de1[_0xe552('0x42')]['id']}})['then'](handleEntityNotFound(_0x958454,null))[_0xe552('0x20')](saveUpdates(_0xcf9de1['body'],null))['then'](respondWithResult(_0x958454,null))['catch'](handleError(_0x958454,null));};exports[_0xe552('0x21')]=function(_0xefd7f8,_0x3211dd){return db[_0xe552('0x3d')][_0xe552('0x44')]({'where':{'id':_0xefd7f8['params']['id']}})['then'](handleEntityNotFound(_0x3211dd,null))[_0xe552('0x20')](removeEntity(_0x3211dd,null))[_0xe552('0x40')](handleError(_0x3211dd,null));};exports[_0xe552('0x47')]=function(_0x157153,_0x49660a,_0x56eb55){return db[_0xe552('0x48')]['find']({'where':{'id':_0x157153[_0xe552('0x42')]['id']}})['then'](handleEntityNotFound(_0x49660a,null))[_0xe552('0x20')](function(_0x234e9a){if(_0x234e9a){return _0x234e9a[_0xe552('0x47')](_0x157153[_0xe552('0x46')]['ids'],_[_0xe552('0x49')](_0x157153['body'],[_0xe552('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x49660a,null))[_0xe552('0x40')](handleError(_0x49660a,null));};exports[_0xe552('0x4b')]=function(_0x347d0b,_0x4bc49e,_0x1ec1f2){var _0x4e25a7={};var _0x29aef8={};var _0x1c6ea0;var _0x1220b3;return db[_0xe552('0x3d')]['findOne']({'where':{'id':_0x347d0b[_0xe552('0x42')]['id']}})[_0xe552('0x20')](handleEntityNotFound(_0x4bc49e,null))['then'](function(_0x3de570){if(_0x3de570){_0x1c6ea0=_0x3de570;_0x29aef8[_0xe552('0x2b')]=_[_0xe552('0x2c')](db[_0xe552('0x48')][_0xe552('0x43')]);_0x29aef8[_0xe552('0x2d')]=_[_0xe552('0x2c')](_0x347d0b['query']);_0x29aef8[_0xe552('0x2e')]=_[_0xe552('0x2f')](_0x29aef8[_0xe552('0x2b')],_0x29aef8[_0xe552('0x2d')]);_0x4e25a7[_0xe552('0x30')]=_[_0xe552('0x2f')](_0x29aef8[_0xe552('0x2b')],qs[_0xe552('0x31')](_0x347d0b[_0xe552('0x2d')]['fields']));_0x4e25a7[_0xe552('0x30')]=_0x4e25a7[_0xe552('0x30')][_0xe552('0x32')]?_0x4e25a7[_0xe552('0x30')]:_0x29aef8[_0xe552('0x2b')];_0x4e25a7[_0xe552('0x4c')]=qs['sort'](_0x347d0b['query'][_0xe552('0x36')]);_0x4e25a7[_0xe552('0x37')]=qs[_0xe552('0x2e')](_[_0xe552('0x4d')](_0x347d0b[_0xe552('0x2d')],_0x29aef8[_0xe552('0x2e')]));if(_0x347d0b[_0xe552('0x2d')][_0xe552('0x38')]){_0x4e25a7[_0xe552('0x37')]=_['merge'](_0x4e25a7[_0xe552('0x37')],{'$or':_[_0xe552('0x27')](_0x4e25a7['attributes'],function(_0x257ef9){var _0x181300={};_0x181300[_0x257ef9]={'$like':'%'+_0x347d0b[_0xe552('0x2d')][_0xe552('0x38')]+'%'};return _0x181300;})});}_0x4e25a7=_[_0xe552('0x3a')]({},_0x4e25a7,_0x347d0b[_0xe552('0x3b')]);return _0x1c6ea0[_0xe552('0x4b')](_0x4e25a7);}})['then'](function(_0x418655){if(_0x418655){_0x1220b3=_0x418655['length'];if(!_0x347d0b[_0xe552('0x2d')][_0xe552('0x33')]('nolimit')){_0x4e25a7[_0xe552('0x35')]=qs[_0xe552('0x35')](_0x347d0b[_0xe552('0x2d')]['limit']);_0x4e25a7[_0xe552('0x1a')]=qs[_0xe552('0x1a')](_0x347d0b[_0xe552('0x2d')]['offset']);}return _0x1c6ea0['getConditions'](_0x4e25a7);}})[_0xe552('0x20')](function(_0x4776a0){if(_0x4776a0){return _0x4776a0?{'count':_0x1220b3,'rows':_0x4776a0}:null;}})[_0xe552('0x20')](respondWithResult(_0x4bc49e,null))[_0xe552('0x40')](handleError(_0x4bc49e,null));};exports[_0xe552('0x4e')]=function(_0x322441,_0x558e95,_0x573986){return db['Action']['find']({'where':{'id':_0x322441[_0xe552('0x42')]['id']}})[_0xe552('0x20')](handleEntityNotFound(_0x558e95,null))[_0xe552('0x20')](function(_0x1f3bae){if(_0x1f3bae){return _0x1f3bae[_0xe552('0x4e')](_0x322441[_0xe552('0x46')]['ids'],_[_0xe552('0x49')](_0x322441['body'],[_0xe552('0x4a'),'id'])||{});}})[_0xe552('0x20')](respondWithResult(_0x558e95,null))[_0xe552('0x40')](handleError(_0x558e95,null));};exports['getActions']=function(_0x5f2972,_0x198144,_0x5263d0){var _0x24b386={};var _0x64b3f9={};var _0xb22a64;var _0x32be10;return db[_0xe552('0x3d')][_0xe552('0x4f')]({'where':{'id':_0x5f2972[_0xe552('0x42')]['id']}})[_0xe552('0x20')](handleEntityNotFound(_0x198144,null))[_0xe552('0x20')](function(_0x30c4a0){if(_0x30c4a0){_0xb22a64=_0x30c4a0;_0x64b3f9[_0xe552('0x2b')]=_[_0xe552('0x2c')](db[_0xe552('0x50')][_0xe552('0x43')]);_0x64b3f9[_0xe552('0x2d')]=_[_0xe552('0x2c')](_0x5f2972[_0xe552('0x2d')]);_0x64b3f9[_0xe552('0x2e')]=_[_0xe552('0x2f')](_0x64b3f9[_0xe552('0x2b')],_0x64b3f9[_0xe552('0x2d')]);_0x24b386[_0xe552('0x30')]=_[_0xe552('0x2f')](_0x64b3f9[_0xe552('0x2b')],qs['fields'](_0x5f2972['query'][_0xe552('0x31')]));_0x24b386[_0xe552('0x30')]=_0x24b386['attributes'][_0xe552('0x32')]?_0x24b386[_0xe552('0x30')]:_0x64b3f9['model'];_0x24b386[_0xe552('0x4c')]=qs[_0xe552('0x36')](_0x5f2972[_0xe552('0x2d')][_0xe552('0x36')]);_0x24b386['where']=qs['filters'](_[_0xe552('0x4d')](_0x5f2972[_0xe552('0x2d')],_0x64b3f9['filters']));if(_0x5f2972[_0xe552('0x2d')][_0xe552('0x38')]){_0x24b386[_0xe552('0x37')]=_[_0xe552('0x3a')](_0x24b386['where'],{'$or':_[_0xe552('0x27')](_0x24b386[_0xe552('0x30')],function(_0x59cd6b){var _0x1c22ee={};_0x1c22ee[_0x59cd6b]={'$like':'%'+_0x5f2972[_0xe552('0x2d')]['filter']+'%'};return _0x1c22ee;})});}_0x24b386=_[_0xe552('0x3a')]({},_0x24b386,_0x5f2972['options']);return _0xb22a64[_0xe552('0x51')](_0x24b386);}})[_0xe552('0x20')](function(_0x553227){if(_0x553227){_0x32be10=_0x553227['length'];if(!_0x5f2972['query'][_0xe552('0x33')](_0xe552('0x34'))){_0x24b386[_0xe552('0x35')]=qs['limit'](_0x5f2972['query'][_0xe552('0x35')]);_0x24b386['offset']=qs[_0xe552('0x1a')](_0x5f2972['query']['offset']);}return _0xb22a64['getActions'](_0x24b386);}})[_0xe552('0x20')](function(_0x4fe0a4){if(_0x4fe0a4){return _0x4fe0a4?{'count':_0x32be10,'rows':_0x4fe0a4}:null;}})['then'](respondWithResult(_0x198144,null))[_0xe552('0x40')](handleError(_0x198144,null));}; \ No newline at end of file +var _0x5f66=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','Automation','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','addActions','getActions','Action','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2ffa62,_0x5edc74){var _0x2e01a7=function(_0x4d64a8){while(--_0x4d64a8){_0x2ffa62['push'](_0x2ffa62['shift']());}};_0x2e01a7(++_0x5edc74);}(_0x5f66,0x1ef));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var Mustache=require(_0x65f6('0x4'));var util=require(_0x65f6('0x5'));var path=require(_0x65f6('0x6'));var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require(_0x65f6('0x9'));var fs=require('fs');var fs_extra=require(_0x65f6('0xa'));var _=require(_0x65f6('0xb'));var squel=require(_0x65f6('0xc'));var crypto=require(_0x65f6('0xd'));var jsforce=require(_0x65f6('0xe'));var deskjs=require(_0x65f6('0xf'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0x10'));var Papa=require(_0x65f6('0x11'));var Redis=require('ioredis');var authService=require(_0x65f6('0x12'));var qs=require(_0x65f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65f6('0x14'));var logger=require('../../config/logger')(_0x65f6('0x15'));var utils=require('../../config/utils');var config=require(_0x65f6('0x16'));var licenseUtil=require(_0x65f6('0x17'));var db=require(_0x65f6('0x18'))['db'];function respondWithStatusCode(_0x4be164,_0x4db64d){_0x4db64d=_0x4db64d||0xcc;return function(_0x365a07){if(_0x365a07){return _0x4be164[_0x65f6('0x19')](_0x4db64d);}return _0x4be164[_0x65f6('0x1a')](_0x4db64d)[_0x65f6('0x1b')]();};}function respondWithResult(_0x34bbde,_0x349e12){_0x349e12=_0x349e12||0xc8;return function(_0x1c4f40){if(_0x1c4f40){return _0x34bbde[_0x65f6('0x1a')](_0x349e12)[_0x65f6('0x1c')](_0x1c4f40);}};}function respondWithFilteredResult(_0x4722a0,_0x56cbb3){return function(_0x2c5634){if(_0x2c5634){var _0x57deb9=typeof _0x56cbb3[_0x65f6('0x1d')]===_0x65f6('0x1e')&&typeof _0x56cbb3['limit']===_0x65f6('0x1e');var _0x4df62b=_0x2c5634[_0x65f6('0x1f')];var _0x4811f0=_0x57deb9?0x0:_0x56cbb3[_0x65f6('0x1d')];var _0x56cb25=_0x57deb9?_0x2c5634['count']:_0x56cbb3[_0x65f6('0x1d')]+_0x56cbb3[_0x65f6('0x20')];var _0x567e96;if(_0x56cb25>=_0x4df62b){_0x56cb25=_0x4df62b;_0x567e96=0xc8;}else{_0x567e96=0xce;}_0x4722a0['status'](_0x567e96);return _0x4722a0[_0x65f6('0x21')](_0x65f6('0x22'),_0x4811f0+'-'+_0x56cb25+'/'+_0x4df62b)['json'](_0x2c5634);}return null;};}function patchUpdates(_0x1ad4f5){return function(_0x50b0fc){try{jsonpatch['apply'](_0x50b0fc,_0x1ad4f5,!![]);}catch(_0x8eff6f){return BPromise[_0x65f6('0x23')](_0x8eff6f);}return _0x50b0fc[_0x65f6('0x24')]();};}function saveUpdates(_0x3cd429,_0x32e7fb){return function(_0x44145a){if(_0x44145a){return _0x44145a[_0x65f6('0x25')](_0x3cd429)['then'](function(_0x2a43c8){return _0x2a43c8;});}return null;};}function removeEntity(_0x2c21b0,_0x23fa5b){return function(_0x3eb70d){if(_0x3eb70d){return _0x3eb70d['destroy']()[_0x65f6('0x26')](function(){_0x2c21b0['status'](0xcc)[_0x65f6('0x1b')]();});}};}function handleEntityNotFound(_0x38aa77,_0x3468a8){return function(_0x583e5d){if(!_0x583e5d){_0x38aa77[_0x65f6('0x19')](0x194);}return _0x583e5d;};}function handleError(_0x1b340a,_0x11d3c5){_0x11d3c5=_0x11d3c5||0x1f4;return function(_0x572269){logger[_0x65f6('0x27')](_0x572269[_0x65f6('0x28')]);if(_0x572269[_0x65f6('0x29')]){delete _0x572269['name'];}_0x1b340a[_0x65f6('0x1a')](_0x11d3c5)[_0x65f6('0x2a')](_0x572269);};}exports[_0x65f6('0x2b')]=function(_0x2f7a2e,_0x2b192e){var _0x249aea={},_0x3733eb={},_0x31459c={'count':0x0,'rows':[]};var _0x33d83f=_['map'](db['Automation'][_0x65f6('0x2c')],function(_0x5c5588){return{'name':_0x5c5588[_0x65f6('0x2d')],'type':_0x5c5588[_0x65f6('0x2e')][_0x65f6('0x2f')]};});_0x3733eb[_0x65f6('0x30')]=_['map'](_0x33d83f,'name');_0x3733eb[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x2f7a2e[_0x65f6('0x31')]);_0x3733eb[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x3733eb['model'],_0x3733eb[_0x65f6('0x31')]);_0x249aea[_0x65f6('0x35')]=_['intersection'](_0x3733eb[_0x65f6('0x30')],qs[_0x65f6('0x36')](_0x2f7a2e[_0x65f6('0x31')][_0x65f6('0x36')]));_0x249aea[_0x65f6('0x35')]=_0x249aea[_0x65f6('0x35')][_0x65f6('0x37')]?_0x249aea[_0x65f6('0x35')]:_0x3733eb[_0x65f6('0x30')];if(!_0x2f7a2e[_0x65f6('0x31')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x249aea[_0x65f6('0x20')]=qs['limit'](_0x2f7a2e[_0x65f6('0x31')][_0x65f6('0x20')]);_0x249aea[_0x65f6('0x1d')]=qs['offset'](_0x2f7a2e['query'][_0x65f6('0x1d')]);}_0x249aea[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x2f7a2e[_0x65f6('0x31')][_0x65f6('0x3b')]);_0x249aea['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x2f7a2e[_0x65f6('0x31')],_0x3733eb[_0x65f6('0x33')]),_0x33d83f);if(_0x2f7a2e[_0x65f6('0x31')][_0x65f6('0x3d')]){_0x249aea[_0x65f6('0x3e')]=_[_0x65f6('0x3f')](_0x249aea[_0x65f6('0x3e')],{'$or':_[_0x65f6('0x40')](_0x33d83f,function(_0x2ec694){if(_0x2ec694[_0x65f6('0x2e')]!=='VIRTUAL'){var _0x569270={};_0x569270[_0x2ec694[_0x65f6('0x29')]]={'$like':'%'+_0x2f7a2e[_0x65f6('0x31')]['filter']+'%'};return _0x569270;}})});}_0x249aea=_[_0x65f6('0x3f')]({},_0x249aea,_0x2f7a2e['options']);var _0x25838f={'where':_0x249aea[_0x65f6('0x3e')]};return db[_0x65f6('0x41')][_0x65f6('0x1f')](_0x25838f)[_0x65f6('0x26')](function(_0x24ca04){_0x31459c['count']=_0x24ca04;if(_0x2f7a2e['query'][_0x65f6('0x42')]){_0x249aea[_0x65f6('0x43')]=[{'all':!![]}];}return db['Automation'][_0x65f6('0x44')](_0x249aea);})[_0x65f6('0x26')](function(_0x312435){_0x31459c[_0x65f6('0x45')]=_0x312435;return _0x31459c;})[_0x65f6('0x26')](respondWithFilteredResult(_0x2b192e,_0x249aea))[_0x65f6('0x46')](handleError(_0x2b192e,null));};exports['show']=function(_0x4d39e3,_0x262f61){var _0x1d252b={'raw':![],'where':{'id':_0x4d39e3[_0x65f6('0x47')]['id']}},_0xb494c3={};_0xb494c3[_0x65f6('0x30')]=_[_0x65f6('0x32')](db[_0x65f6('0x41')][_0x65f6('0x2c')]);_0xb494c3['query']=_['keys'](_0x4d39e3[_0x65f6('0x31')]);_0xb494c3['filters']=_[_0x65f6('0x34')](_0xb494c3[_0x65f6('0x30')],_0xb494c3[_0x65f6('0x31')]);_0x1d252b['attributes']=_[_0x65f6('0x34')](_0xb494c3[_0x65f6('0x30')],qs[_0x65f6('0x36')](_0x4d39e3['query']['fields']));_0x1d252b[_0x65f6('0x35')]=_0x1d252b['attributes'][_0x65f6('0x37')]?_0x1d252b[_0x65f6('0x35')]:_0xb494c3['model'];if(_0x4d39e3[_0x65f6('0x31')][_0x65f6('0x42')]){_0x1d252b[_0x65f6('0x43')]=[{'all':!![]}];}_0x1d252b=_[_0x65f6('0x3f')]({},_0x1d252b,_0x4d39e3[_0x65f6('0x48')]);return db[_0x65f6('0x41')][_0x65f6('0x49')](_0x1d252b)[_0x65f6('0x26')](handleEntityNotFound(_0x262f61,null))[_0x65f6('0x26')](respondWithResult(_0x262f61,null))[_0x65f6('0x46')](handleError(_0x262f61,null));};exports['create']=function(_0x1d63b7,_0x2dcd01){return db[_0x65f6('0x41')][_0x65f6('0x4a')](_0x1d63b7[_0x65f6('0x4b')],{})['then'](respondWithResult(_0x2dcd01,0xc9))[_0x65f6('0x46')](handleError(_0x2dcd01,null));};exports[_0x65f6('0x25')]=function(_0x500aea,_0x28d8f1){if(_0x500aea[_0x65f6('0x4b')]['id']){delete _0x500aea[_0x65f6('0x4b')]['id'];}return db[_0x65f6('0x41')][_0x65f6('0x49')]({'where':{'id':_0x500aea[_0x65f6('0x47')]['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x28d8f1,null))[_0x65f6('0x26')](saveUpdates(_0x500aea[_0x65f6('0x4b')],null))[_0x65f6('0x26')](respondWithResult(_0x28d8f1,null))[_0x65f6('0x46')](handleError(_0x28d8f1,null));};exports[_0x65f6('0x4c')]=function(_0x336f9f,_0x5b7b1c){return db[_0x65f6('0x41')][_0x65f6('0x49')]({'where':{'id':_0x336f9f['params']['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x5b7b1c,null))[_0x65f6('0x26')](removeEntity(_0x5b7b1c,null))[_0x65f6('0x46')](handleError(_0x5b7b1c,null));};exports[_0x65f6('0x4d')]=function(_0x2425bb,_0x269a96,_0x106d25){return db['Condition'][_0x65f6('0x49')]({'where':{'id':_0x2425bb[_0x65f6('0x47')]['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x269a96,null))[_0x65f6('0x26')](function(_0x28cfe0){if(_0x28cfe0){return _0x28cfe0[_0x65f6('0x4d')](_0x2425bb['body'][_0x65f6('0x4e')],_[_0x65f6('0x4f')](_0x2425bb[_0x65f6('0x4b')],[_0x65f6('0x4e'),'id'])||{});}})[_0x65f6('0x26')](respondWithResult(_0x269a96,null))[_0x65f6('0x46')](handleError(_0x269a96,null));};exports[_0x65f6('0x50')]=function(_0x9d5df7,_0x194b62,_0x3926a9){var _0x5af7f0={};var _0x5bd31d={};var _0x19a2c5;var _0x3a84e9;return db[_0x65f6('0x41')][_0x65f6('0x51')]({'where':{'id':_0x9d5df7[_0x65f6('0x47')]['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x194b62,null))[_0x65f6('0x26')](function(_0x340863){if(_0x340863){_0x19a2c5=_0x340863;_0x5bd31d['model']=_['keys'](db['Condition'][_0x65f6('0x2c')]);_0x5bd31d['query']=_['keys'](_0x9d5df7[_0x65f6('0x31')]);_0x5bd31d['filters']=_[_0x65f6('0x34')](_0x5bd31d[_0x65f6('0x30')],_0x5bd31d[_0x65f6('0x31')]);_0x5af7f0[_0x65f6('0x35')]=_[_0x65f6('0x34')](_0x5bd31d[_0x65f6('0x30')],qs['fields'](_0x9d5df7[_0x65f6('0x31')]['fields']));_0x5af7f0[_0x65f6('0x35')]=_0x5af7f0[_0x65f6('0x35')][_0x65f6('0x37')]?_0x5af7f0[_0x65f6('0x35')]:_0x5bd31d['model'];_0x5af7f0[_0x65f6('0x3a')]=qs[_0x65f6('0x3b')](_0x9d5df7[_0x65f6('0x31')][_0x65f6('0x3b')]);_0x5af7f0[_0x65f6('0x3e')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x9d5df7['query'],_0x5bd31d[_0x65f6('0x33')]));if(_0x9d5df7['query'][_0x65f6('0x3d')]){_0x5af7f0[_0x65f6('0x3e')]=_['merge'](_0x5af7f0['where'],{'$or':_[_0x65f6('0x40')](_0x5af7f0[_0x65f6('0x35')],function(_0x39632f){var _0x49e10d={};_0x49e10d[_0x39632f]={'$like':'%'+_0x9d5df7[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x49e10d;})});}_0x5af7f0=_[_0x65f6('0x3f')]({},_0x5af7f0,_0x9d5df7[_0x65f6('0x48')]);return _0x19a2c5[_0x65f6('0x50')](_0x5af7f0);}})['then'](function(_0x4d2096){if(_0x4d2096){_0x3a84e9=_0x4d2096[_0x65f6('0x37')];if(!_0x9d5df7[_0x65f6('0x31')][_0x65f6('0x38')](_0x65f6('0x39'))){_0x5af7f0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x9d5df7[_0x65f6('0x31')][_0x65f6('0x20')]);_0x5af7f0[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x9d5df7['query']['offset']);}return _0x19a2c5[_0x65f6('0x50')](_0x5af7f0);}})['then'](function(_0x375493){if(_0x375493){return _0x375493?{'count':_0x3a84e9,'rows':_0x375493}:null;}})[_0x65f6('0x26')](respondWithResult(_0x194b62,null))[_0x65f6('0x46')](handleError(_0x194b62,null));};exports[_0x65f6('0x52')]=function(_0x1fcb13,_0x3265c2,_0x12db66){return db['Action'][_0x65f6('0x49')]({'where':{'id':_0x1fcb13[_0x65f6('0x47')]['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x3265c2,null))[_0x65f6('0x26')](function(_0x5878d4){if(_0x5878d4){return _0x5878d4[_0x65f6('0x52')](_0x1fcb13[_0x65f6('0x4b')][_0x65f6('0x4e')],_[_0x65f6('0x4f')](_0x1fcb13[_0x65f6('0x4b')],['ids','id'])||{});}})[_0x65f6('0x26')](respondWithResult(_0x3265c2,null))['catch'](handleError(_0x3265c2,null));};exports[_0x65f6('0x53')]=function(_0x251180,_0x44190b,_0x2c3f01){var _0x502553={};var _0x1d95d6={};var _0x16de63;var _0x509303;return db['Automation'][_0x65f6('0x51')]({'where':{'id':_0x251180[_0x65f6('0x47')]['id']}})[_0x65f6('0x26')](handleEntityNotFound(_0x44190b,null))[_0x65f6('0x26')](function(_0xa3f007){if(_0xa3f007){_0x16de63=_0xa3f007;_0x1d95d6['model']=_[_0x65f6('0x32')](db[_0x65f6('0x54')][_0x65f6('0x2c')]);_0x1d95d6['query']=_[_0x65f6('0x32')](_0x251180['query']);_0x1d95d6[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x1d95d6[_0x65f6('0x30')],_0x1d95d6[_0x65f6('0x31')]);_0x502553['attributes']=_[_0x65f6('0x34')](_0x1d95d6[_0x65f6('0x30')],qs['fields'](_0x251180[_0x65f6('0x31')][_0x65f6('0x36')]));_0x502553[_0x65f6('0x35')]=_0x502553[_0x65f6('0x35')]['length']?_0x502553[_0x65f6('0x35')]:_0x1d95d6['model'];_0x502553[_0x65f6('0x3a')]=qs['sort'](_0x251180[_0x65f6('0x31')][_0x65f6('0x3b')]);_0x502553[_0x65f6('0x3e')]=qs['filters'](_[_0x65f6('0x3c')](_0x251180[_0x65f6('0x31')],_0x1d95d6[_0x65f6('0x33')]));if(_0x251180['query']['filter']){_0x502553[_0x65f6('0x3e')]=_[_0x65f6('0x3f')](_0x502553[_0x65f6('0x3e')],{'$or':_[_0x65f6('0x40')](_0x502553['attributes'],function(_0x8e6d7b){var _0x7c81ed={};_0x7c81ed[_0x8e6d7b]={'$like':'%'+_0x251180[_0x65f6('0x31')]['filter']+'%'};return _0x7c81ed;})});}_0x502553=_[_0x65f6('0x3f')]({},_0x502553,_0x251180[_0x65f6('0x48')]);return _0x16de63[_0x65f6('0x53')](_0x502553);}})[_0x65f6('0x26')](function(_0x1ff5dd){if(_0x1ff5dd){_0x509303=_0x1ff5dd[_0x65f6('0x37')];if(!_0x251180['query'][_0x65f6('0x38')]('nolimit')){_0x502553[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x251180['query']['limit']);_0x502553[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x251180['query']['offset']);}return _0x16de63['getActions'](_0x502553);}})[_0x65f6('0x26')](function(_0x34cfb5){if(_0x34cfb5){return _0x34cfb5?{'count':_0x509303,'rows':_0x34cfb5}:null;}})[_0x65f6('0x26')](respondWithResult(_0x44190b,null))[_0x65f6('0x46')](handleError(_0x44190b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index be95f3c..9a8893c 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 _0xe966=['./automation.attributes','../../config/logger','api','moment','request-promise'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xe966,0x83));var _0x6e96=function(_0x482fcb,_0x5a5ff2){_0x482fcb=_0x482fcb-0x0;var _0x4eae71=_0xe966[_0x482fcb];return _0x4eae71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e96('0x0'))(_0x6e96('0x1'));var moment=require(_0x6e96('0x2'));var BPromise=require('bluebird');var rp=require(_0x6e96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e96('0x4'));module['exports']=function(_0x2ffe57,_0x1bc7e6){return _0x2ffe57['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1545=['./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3ef7cc,_0x42383e){var _0x512863=function(_0xb96400){while(--_0xb96400){_0x3ef7cc['push'](_0x3ef7cc['shift']());}};_0x512863(++_0x42383e);}(_0x1545,0xf5));var _0x5154=function(_0x5b4303,_0x225e71){_0x5b4303=_0x5b4303-0x0;var _0x1aacba=_0x1545[_0x5b4303];return _0x1aacba;};'use strict';var _=require(_0x5154('0x0'));var util=require('util');var logger=require(_0x5154('0x1'))(_0x5154('0x2'));var moment=require(_0x5154('0x3'));var BPromise=require('bluebird');var rp=require(_0x5154('0x4'));var fs=require('fs');var path=require(_0x5154('0x5'));var rimraf=require(_0x5154('0x6'));var config=require('../../config/environment');var attributes=require(_0x5154('0x7'));module[_0x5154('0x8')]=function(_0x2f6181,_0x148fdb){return _0x2f6181[_0x5154('0x9')](_0x5154('0xa'),attributes,{'tableName':_0x5154('0xb'),'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 c311663..f01e0f6 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 _0xcb10=['info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9cbfe0,_0x56aada){var _0x1f1534=function(_0x422947){while(--_0x422947){_0x9cbfe0['push'](_0x9cbfe0['shift']());}};_0x1f1534(++_0x56aada);}(_0xcb10,0x104));var _0x0cb1=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xcb10[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var moment=require('moment');var BPromise=require(_0x0cb1('0x2'));var rs=require(_0x0cb1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cb1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cb1('0x5'))(_0x0cb1('0x6'));var config=require(_0x0cb1('0x7'));var jayson=require(_0x0cb1('0x8'));var client=jayson[_0x0cb1('0x9')][_0x0cb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x390335,_0xdda18c,_0x575138){return new BPromise(function(_0x43620c,_0x1f815e){return client[_0x0cb1('0xb')](_0x390335,_0x575138)[_0x0cb1('0xc')](function(_0x41e0d2){logger[_0x0cb1('0xd')](_0x0cb1('0xe'),_0xdda18c,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xdda18c,_0x0cb1('0xf'),JSON[_0x0cb1('0x10')](_0x41e0d2));if(_0x41e0d2['error']){if(_0x41e0d2['error']['code']===0x1f4){logger[_0x0cb1('0x11')]('Automation,\x20%s,\x20%s',_0xdda18c,_0x41e0d2[_0x0cb1('0x11')][_0x0cb1('0x12')]);return _0x1f815e(_0x41e0d2[_0x0cb1('0x11')][_0x0cb1('0x12')]);}logger[_0x0cb1('0x11')](_0x0cb1('0xe'),_0xdda18c,_0x41e0d2['error'][_0x0cb1('0x12')]);return _0x43620c(_0x41e0d2[_0x0cb1('0x11')]['message']);}else{logger[_0x0cb1('0xd')]('Automation,\x20%s,\x20%s',_0xdda18c,_0x0cb1('0xf'));_0x43620c(_0x41e0d2[_0x0cb1('0x13')]['message']);}})[_0x0cb1('0x14')](function(_0x24315d){logger[_0x0cb1('0x11')](_0x0cb1('0xe'),_0xdda18c,_0x24315d);_0x1f815e(_0x24315d);});});} \ No newline at end of file +var _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5ba3,0x140));var _0x35ba=function(_0x1f7ee5,_0xf7d9d1){_0x1f7ee5=_0x1f7ee5-0x0;var _0x1eb293=_0x5ba3[_0x1f7ee5];return _0x1eb293;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b29993a..746cd60 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 _0xf9fd=['index','/:id','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./automation.controller','isAuthenticated'];(function(_0x9985b9,_0x4080d0){var _0x333811=function(_0x53270e){while(--_0x53270e){_0x9985b9['push'](_0x9985b9['shift']());}};_0x333811(++_0x4080d0);}(_0xf9fd,0x118));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var path=require(_0xdf9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf9f('0x3'));var router=express[_0xdf9f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf9f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf9f('0x6'));router['get']('/',auth[_0xdf9f('0x7')](),controller[_0xdf9f('0x8')]);router['get'](_0xdf9f('0x9'),auth[_0xdf9f('0x7')](),controller['show']);router[_0xdf9f('0xa')](_0xdf9f('0xb'),auth['isAuthenticated'](),controller[_0xdf9f('0xc')]);router[_0xdf9f('0xa')](_0xdf9f('0xd'),auth['isAuthenticated'](),controller[_0xdf9f('0xe')]);router[_0xdf9f('0xf')]('/',auth[_0xdf9f('0x7')](),controller[_0xdf9f('0x10')]);router[_0xdf9f('0xf')](_0xdf9f('0xb'),auth[_0xdf9f('0x7')](),controller[_0xdf9f('0x11')]);router['post'](_0xdf9f('0xd'),auth['isAuthenticated'](),controller[_0xdf9f('0x12')]);router[_0xdf9f('0x13')](_0xdf9f('0x9'),auth[_0xdf9f('0x7')](),controller[_0xdf9f('0x14')]);router[_0xdf9f('0x15')](_0xdf9f('0x9'),auth['isAuthenticated'](),controller[_0xdf9f('0x16')]);module[_0xdf9f('0x17')]=router; \ No newline at end of file +var _0x4422=['update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x5ab17f,_0x399bd9){var _0x90c968=function(_0x4a70ac){while(--_0x4a70ac){_0x5ab17f['push'](_0x5ab17f['shift']());}};_0x90c968(++_0x399bd9);}(_0x4422,0xab));var _0x2442=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4422[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x2442('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2442('0x1'));var express=require('express');var router=express[_0x2442('0x2')]();var fs_extra=require(_0x2442('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2442('0x4'));var controller=require(_0x2442('0x5'));router[_0x2442('0x6')]('/',auth[_0x2442('0x7')](),controller['index']);router[_0x2442('0x6')](_0x2442('0x8'),auth[_0x2442('0x7')](),controller[_0x2442('0x9')]);router[_0x2442('0x6')](_0x2442('0xa'),auth['isAuthenticated'](),controller[_0x2442('0xb')]);router[_0x2442('0x6')](_0x2442('0xc'),auth[_0x2442('0x7')](),controller[_0x2442('0xd')]);router[_0x2442('0xe')]('/',auth[_0x2442('0x7')](),controller[_0x2442('0xf')]);router['post'](_0x2442('0xa'),auth[_0x2442('0x7')](),controller[_0x2442('0x10')]);router[_0x2442('0xe')](_0x2442('0xc'),auth[_0x2442('0x7')](),controller[_0x2442('0x11')]);router['put'](_0x2442('0x8'),auth[_0x2442('0x7')](),controller[_0x2442('0x12')]);router[_0x2442('0x13')]('/:id',auth[_0x2442('0x7')](),controller[_0x2442('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 150bd9b..f3a37f5 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 _0x223e=['#Machine\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xfe21d8,_0x15ade1){var _0x3fe30f=function(_0x28f552){while(--_0x28f552){_0xfe21d8['push'](_0xfe21d8['shift']());}};_0x3fe30f(++_0x15ade1);}(_0x223e,0x1b1));var _0xe223=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x223e[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xe223('0x0'));module[_0xe223('0x1')]={'name':{'type':Sequelize[_0xe223('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe223('0x3')](_0xe223('0x4')),'allowNull':![],'defaultValue':_0xe223('0x4')},'description':{'type':Sequelize[_0xe223('0x2')]},'active':{'type':Sequelize[_0xe223('0x5')],'defaultValue':0x0,'comment':_0xe223('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe223('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe223('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe223('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe223('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe223('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe223('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe223('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe223('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe223('0x2')],'defaultValue':_0xe223('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xe223('0x3')](_0xe223('0x11'),'never','onlyIfOpen'),'defaultValue':_0xe223('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe223('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe223('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe223('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe223('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe223('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe223('0x8')](0x9)[_0xe223('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe223('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xe223('0x8')](0x9)[_0xe223('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe223('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe223('0x8')](0x9)[_0xe223('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe223('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe223('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe223('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe223('0x8')](0x9)[_0xe223('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe223('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe223('0x3')]('DESC',_0xe223('0x1b')),'defaultValue':_0xe223('0x1c')},'dialPrefix':{'type':Sequelize[_0xe223('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe223('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe223('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xe223('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe223('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe223('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe223('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe223('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe223('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe223('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe223('0x8')](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe223('0x8')](0x3)[_0xe223('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe223('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x0699=['UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER'];(function(_0x449842,_0x3d7507){var _0x99e21f=function(_0x29ab8d){while(--_0x29ab8d){_0x449842['push'](_0x449842['shift']());}};_0x99e21f(++_0x3d7507);}(_0x0699,0x1db));var _0x9069=function(_0x25ba05,_0x45a3eb){_0x25ba05=_0x25ba05-0x0;var _0x1c7fae=_0x0699[_0x25ba05];return _0x1c7fae;};'use strict';var Sequelize=require(_0x9069('0x0'));module['exports']={'name':{'type':Sequelize[_0x9069('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9069('0x2')](_0x9069('0x3')),'allowNull':![],'defaultValue':_0x9069('0x3')},'description':{'type':Sequelize[_0x9069('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9069('0x4')},'limitCalls':{'type':Sequelize[_0x9069('0x5')](0x4)[_0x9069('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9069('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9069('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9069('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9069('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'defaultValue':0x3,'comment':_0x9069('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9069('0xd')},'dialTimezone':{'type':Sequelize[_0x9069('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9069('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9069('0xe'),'never',_0x9069('0xf')),'defaultValue':_0x9069('0xe')},'dialAMDActive':{'type':Sequelize[_0x9069('0x10')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x9069('0x5')](0x9)[_0x9069('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9069('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x9069('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9069('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9069('0x5')](0x9)[_0x9069('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9069('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9069('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x9069('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9069('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9069('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9069('0x5')](0x9)[_0x9069('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9069('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9069('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9069('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9069('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9069('0x2')]('DESC',_0x9069('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x9069('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9069('0x19')},'dialCutDigit':{'type':Sequelize[_0x9069('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9069('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9069('0x5')](0x3)[_0x9069('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9069('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9069('0x5')](0x5)[_0x9069('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9069('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 7348320..d34b90f 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 _0xe871=['updatedAt','omit','UserProfileSection','autoAssociation','getHoppers','findOne','CmHopper','rawAttributes','pick','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xe871,0x145));var _0x1e87=function(_0x1b01d8,_0x454635){_0x1b01d8=_0x1b01d8-0x0;var _0x469731=_0xe871[_0x1b01d8];return _0x469731;};'use strict';var emlformat=require(_0x1e87('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1e87('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e87('0x2'));var util=require(_0x1e87('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x1e87('0x4'));var ejs=require(_0x1e87('0x5'));var fs=require('fs');var fs_extra=require(_0x1e87('0x6'));var _=require(_0x1e87('0x7'));var squel=require(_0x1e87('0x8'));var crypto=require(_0x1e87('0x9'));var jsforce=require(_0x1e87('0xa'));var deskjs=require(_0x1e87('0xb'));var toCsv=require(_0x1e87('0x4'));var querystring=require(_0x1e87('0xc'));var Papa=require(_0x1e87('0xd'));var Redis=require(_0x1e87('0xe'));var authService=require(_0x1e87('0xf'));var qs=require(_0x1e87('0x10'));var as=require(_0x1e87('0x11'));var hardwareService=require(_0x1e87('0x12'));var logger=require(_0x1e87('0x13'))(_0x1e87('0x14'));var utils=require('../../config/utils');var config=require(_0x1e87('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e87('0x16'))['db'];function respondWithStatusCode(_0x3a7015,_0x149490){_0x149490=_0x149490||0xcc;return function(_0x1895ec){if(_0x1895ec){return _0x3a7015[_0x1e87('0x17')](_0x149490);}return _0x3a7015[_0x1e87('0x18')](_0x149490)[_0x1e87('0x19')]();};}function respondWithResult(_0x21a1db,_0x587995){_0x587995=_0x587995||0xc8;return function(_0x177299){if(_0x177299){return _0x21a1db[_0x1e87('0x18')](_0x587995)[_0x1e87('0x1a')](_0x177299);}};}function respondWithFilteredResult(_0x4670b0,_0xe8cf20){return function(_0x227a04){if(_0x227a04){var _0x2f3d6f=typeof _0xe8cf20[_0x1e87('0x1b')]===_0x1e87('0x1c')&&typeof _0xe8cf20[_0x1e87('0x1d')]===_0x1e87('0x1c');var _0x2e6b4f=_0x227a04[_0x1e87('0x1e')];var _0x4189a0=_0x2f3d6f?0x0:_0xe8cf20[_0x1e87('0x1b')];var _0xb52e61=_0x2f3d6f?_0x227a04[_0x1e87('0x1e')]:_0xe8cf20['offset']+_0xe8cf20[_0x1e87('0x1d')];var _0x1bc2bb;if(_0xb52e61>=_0x2e6b4f){_0xb52e61=_0x2e6b4f;_0x1bc2bb=0xc8;}else{_0x1bc2bb=0xce;}_0x4670b0[_0x1e87('0x18')](_0x1bc2bb);return _0x4670b0['set']('Content-Range',_0x4189a0+'-'+_0xb52e61+'/'+_0x2e6b4f)[_0x1e87('0x1a')](_0x227a04);}return null;};}function patchUpdates(_0x402c3a){return function(_0x285990){try{jsonpatch[_0x1e87('0x1f')](_0x285990,_0x402c3a,!![]);}catch(_0x5d36fa){return BPromise[_0x1e87('0x20')](_0x5d36fa);}return _0x285990[_0x1e87('0x21')]();};}function saveUpdates(_0x1d551e,_0x2f7e16){return function(_0x3da922){if(_0x3da922){return _0x3da922[_0x1e87('0x22')](_0x1d551e)[_0x1e87('0x23')](function(_0x2f9ca3){return _0x2f9ca3;});}return null;};}function removeEntity(_0xfea4ee,_0x4618a0){return function(_0x2d00ca){if(_0x2d00ca){return _0x2d00ca[_0x1e87('0x24')]()[_0x1e87('0x23')](function(){var _0x4bd3f9=_0x2d00ca['get']({'plain':!![]});var _0x214bf1='IvrCampaigns';return db['UserProfileResource'][_0x1e87('0x24')]({'where':{'type':_0x214bf1,'resourceId':_0x4bd3f9['id']}})[_0x1e87('0x23')](function(){return _0x2d00ca;});})[_0x1e87('0x23')](function(){_0xfea4ee[_0x1e87('0x18')](0xcc)[_0x1e87('0x19')]();});}};}function handleEntityNotFound(_0x407e86,_0x4ba29c){return function(_0x52fed0){if(!_0x52fed0){_0x407e86[_0x1e87('0x17')](0x194);}return _0x52fed0;};}function handleError(_0x5e4e31,_0x11584a){_0x11584a=_0x11584a||0x1f4;return function(_0xdf9eeb){logger[_0x1e87('0x25')](_0xdf9eeb['stack']);if(_0xdf9eeb[_0x1e87('0x26')]){delete _0xdf9eeb[_0x1e87('0x26')];}_0x5e4e31[_0x1e87('0x18')](_0x11584a)[_0x1e87('0x27')](_0xdf9eeb);};}exports[_0x1e87('0x28')]=function(_0x205a60,_0x25d23f){var _0x5a8eac={},_0x204a79={},_0x1845f2={'count':0x0,'rows':[]};var _0x2cb7d9=_[_0x1e87('0x29')](db['Campaign']['rawAttributes'],function(_0x6669d9){return{'name':_0x6669d9[_0x1e87('0x2a')],'type':_0x6669d9[_0x1e87('0x2b')][_0x1e87('0x2c')]};});_0x204a79[_0x1e87('0x2d')]=_[_0x1e87('0x29')](_0x2cb7d9,_0x1e87('0x26'));_0x204a79[_0x1e87('0x2e')]=_[_0x1e87('0x2f')](_0x205a60['query']);_0x204a79[_0x1e87('0x30')]=_[_0x1e87('0x31')](_0x204a79[_0x1e87('0x2d')],_0x204a79[_0x1e87('0x2e')]);_0x5a8eac[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x204a79['model'],qs[_0x1e87('0x33')](_0x205a60[_0x1e87('0x2e')]['fields']));_0x5a8eac[_0x1e87('0x32')]=_0x5a8eac[_0x1e87('0x32')]['length']?_0x5a8eac[_0x1e87('0x32')]:_0x204a79['model'];if(!_0x205a60[_0x1e87('0x2e')][_0x1e87('0x34')](_0x1e87('0x35'))){_0x5a8eac[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x205a60[_0x1e87('0x2e')][_0x1e87('0x1d')]);_0x5a8eac[_0x1e87('0x1b')]=qs['offset'](_0x205a60['query'][_0x1e87('0x1b')]);}_0x5a8eac[_0x1e87('0x36')]=qs[_0x1e87('0x37')](_0x205a60['query'][_0x1e87('0x37')]);_0x5a8eac[_0x1e87('0x38')]=qs[_0x1e87('0x30')](_['pick'](_0x205a60[_0x1e87('0x2e')],_0x204a79[_0x1e87('0x30')]),_0x2cb7d9);if(_0x205a60['query']['filter']){_0x5a8eac['where']=_[_0x1e87('0x39')](_0x5a8eac[_0x1e87('0x38')],{'$or':_['map'](_0x2cb7d9,function(_0x4d97da){if(_0x4d97da[_0x1e87('0x2b')]!==_0x1e87('0x3a')){var _0x3ae83b={};_0x3ae83b[_0x4d97da[_0x1e87('0x26')]]={'$like':'%'+_0x205a60[_0x1e87('0x2e')][_0x1e87('0x3b')]+'%'};return _0x3ae83b;}})});}_0x5a8eac=_[_0x1e87('0x39')]({},_0x5a8eac,_0x205a60[_0x1e87('0x3c')]);var _0x5c7460={'where':_0x5a8eac[_0x1e87('0x38')]};return db[_0x1e87('0x3d')][_0x1e87('0x1e')](_0x5c7460)[_0x1e87('0x23')](function(_0x4b985d){_0x1845f2[_0x1e87('0x1e')]=_0x4b985d;if(_0x205a60[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x5a8eac[_0x1e87('0x3f')]=[{'all':!![]}];}return db[_0x1e87('0x3d')][_0x1e87('0x40')](_0x5a8eac);})[_0x1e87('0x23')](function(_0xb8ec4b){_0x1845f2[_0x1e87('0x41')]=_0xb8ec4b;return _0x1845f2;})[_0x1e87('0x23')](respondWithFilteredResult(_0x25d23f,_0x5a8eac))[_0x1e87('0x42')](handleError(_0x25d23f,null));};exports[_0x1e87('0x43')]=function(_0x5179a0,_0x38b06c){var _0x4b83a6={'raw':![],'where':{'id':_0x5179a0[_0x1e87('0x44')]['id']}},_0x1d285d={};_0x1d285d[_0x1e87('0x2d')]=_['keys'](db[_0x1e87('0x3d')]['rawAttributes']);_0x1d285d['query']=_[_0x1e87('0x2f')](_0x5179a0[_0x1e87('0x2e')]);_0x1d285d[_0x1e87('0x30')]=_[_0x1e87('0x31')](_0x1d285d['model'],_0x1d285d[_0x1e87('0x2e')]);_0x4b83a6['attributes']=_[_0x1e87('0x31')](_0x1d285d[_0x1e87('0x2d')],qs[_0x1e87('0x33')](_0x5179a0[_0x1e87('0x2e')][_0x1e87('0x33')]));_0x4b83a6[_0x1e87('0x32')]=_0x4b83a6['attributes'][_0x1e87('0x45')]?_0x4b83a6[_0x1e87('0x32')]:_0x1d285d[_0x1e87('0x2d')];if(_0x5179a0[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x4b83a6['include']=[{'all':!![]}];}_0x4b83a6=_['merge']({},_0x4b83a6,_0x5179a0[_0x1e87('0x3c')]);return db[_0x1e87('0x3d')][_0x1e87('0x46')](_0x4b83a6)[_0x1e87('0x23')](handleEntityNotFound(_0x38b06c,null))[_0x1e87('0x23')](respondWithResult(_0x38b06c,null))[_0x1e87('0x42')](handleError(_0x38b06c,null));};exports[_0x1e87('0x47')]=function(_0x41eb45,_0x5efd16){return db['Campaign'][_0x1e87('0x47')](_0x41eb45[_0x1e87('0x48')],{})[_0x1e87('0x23')](function(_0x5e3052){var _0x2587b8=_0x41eb45[_0x1e87('0x49')][_0x1e87('0x4a')]({'plain':!![]});if(!_0x2587b8)throw new Error(_0x1e87('0x4b'));if(_0x2587b8[_0x1e87('0x4c')]==='user'){var _0xec8ee4=_0x5e3052[_0x1e87('0x4a')]({'plain':!![]});var _0x266604=_0x1e87('0x4d');return db['UserProfileSection'][_0x1e87('0x46')]({'where':{'name':_0x266604,'userProfileId':_0x2587b8[_0x1e87('0x4e')]},'raw':!![]})[_0x1e87('0x23')](function(_0xae9a75){if(_0xae9a75&&_0xae9a75['autoAssociation']===0x0){return db[_0x1e87('0x4f')][_0x1e87('0x47')]({'name':_0xec8ee4[_0x1e87('0x26')],'resourceId':_0xec8ee4['id'],'type':_0xae9a75['name'],'sectionId':_0xae9a75['id']},{})[_0x1e87('0x23')](function(){return _0x5e3052;});}else{return _0x5e3052;}})[_0x1e87('0x42')](function(_0x468592){logger[_0x1e87('0x25')](_0x1e87('0x50'),_0x468592);throw _0x468592;});}return _0x5e3052;})[_0x1e87('0x23')](respondWithResult(_0x5efd16,0xc9))[_0x1e87('0x42')](handleError(_0x5efd16,null));};exports[_0x1e87('0x51')]=function(_0x1b131b,_0x25889d){var _0xb02af={'where':{'id':_0x1b131b[_0x1e87('0x44')]['id']}},_0x5cd22a={};_0x5cd22a[_0x1e87('0x2d')]=_[_0x1e87('0x2f')](db[_0x1e87('0x3d')]['rawAttributes']);_0xb02af[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x5cd22a[_0x1e87('0x2d')],qs[_0x1e87('0x33')](_0x1b131b[_0x1e87('0x2e')][_0x1e87('0x33')]));_0xb02af[_0x1e87('0x32')]=_0xb02af[_0x1e87('0x32')][_0x1e87('0x45')]?_0xb02af[_0x1e87('0x32')]:_0x5cd22a[_0x1e87('0x2d')];if(_0x1b131b[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0xb02af[_0x1e87('0x3f')]=[{'all':!![]}];}_0xb02af=_['merge']({},_0xb02af,_0x1b131b['options']);return db[_0x1e87('0x3d')][_0x1e87('0x46')](_0xb02af)[_0x1e87('0x23')](handleEntityNotFound(_0x25889d,null))[_0x1e87('0x23')](function(_0x2572c9){if(_0x2572c9){var _0x18da76=_0x2572c9[_0x1e87('0x4a')]({'plain':!![]});_0x18da76=qs['omit'](_0x18da76,['id',_0x1e87('0x52'),_0x1e87('0x53')]);_0x1b131b[_0x1e87('0x48')]=_[_0x1e87('0x54')](_0x1b131b[_0x1e87('0x48')],['id',_0x1e87('0x52'),_0x1e87('0x53')]);return db[_0x1e87('0x3d')][_0x1e87('0x47')](_[_0x1e87('0x39')](_0x18da76,_0x1b131b[_0x1e87('0x48')]),{'include':_0x1b131b[_0x1e87('0x2e')][_0x1e87('0x3e')]?[{'all':!![]}]:undefined})[_0x1e87('0x23')](function(_0x250106){var _0x4229a4=_0x1b131b[_0x1e87('0x49')][_0x1e87('0x4a')]({'plain':!![]});if(!_0x4229a4)throw new Error(_0x1e87('0x4b'));if(_0x4229a4[_0x1e87('0x4c')]===_0x1e87('0x49')){var _0x2f0f80=_0x250106['get']({'plain':!![]});var _0x1903c6=_0x1e87('0x4d');return db[_0x1e87('0x55')][_0x1e87('0x46')]({'where':{'name':_0x1903c6,'userProfileId':_0x4229a4[_0x1e87('0x4e')]},'raw':!![]})[_0x1e87('0x23')](function(_0x37149c){if(_0x37149c&&_0x37149c[_0x1e87('0x56')]===0x0){return db['UserProfileResource'][_0x1e87('0x47')]({'name':_0x2f0f80[_0x1e87('0x26')],'resourceId':_0x2f0f80['id'],'type':_0x37149c['name'],'sectionId':_0x37149c['id']},{})[_0x1e87('0x23')](function(){return _0x250106;});}else{return _0x250106;}})['catch'](function(_0x11310f){logger[_0x1e87('0x25')](_0x1e87('0x50'),_0x11310f);throw _0x11310f;});}return _0x250106;});}})[_0x1e87('0x23')](respondWithResult(_0x25889d,0xc9))[_0x1e87('0x42')](handleError(_0x25889d,null));};exports[_0x1e87('0x22')]=function(_0x43b39e,_0x2c77e6){if(_0x43b39e[_0x1e87('0x48')]['id']){delete _0x43b39e[_0x1e87('0x48')]['id'];}return db[_0x1e87('0x3d')][_0x1e87('0x46')]({'where':{'id':_0x43b39e[_0x1e87('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c77e6,null))['then'](saveUpdates(_0x43b39e[_0x1e87('0x48')],null))[_0x1e87('0x23')](respondWithResult(_0x2c77e6,null))['catch'](handleError(_0x2c77e6,null));};exports[_0x1e87('0x24')]=function(_0x55dde7,_0x3484e3){return db['Campaign'][_0x1e87('0x46')]({'where':{'id':_0x55dde7[_0x1e87('0x44')]['id']}})['then'](handleEntityNotFound(_0x3484e3,null))['then'](removeEntity(_0x3484e3,null))['catch'](handleError(_0x3484e3,null));};exports[_0x1e87('0x57')]=function(_0x17ccbc,_0x3b246b,_0x21e49f){var _0x3a779a={'raw':!![],'where':{}};var _0x4f2c36={};var _0xc52e9f={'count':0x0,'rows':[]};return db[_0x1e87('0x3d')][_0x1e87('0x58')]({'where':{'id':_0x17ccbc[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x3b246b,null))[_0x1e87('0x23')](function(_0x3fa133){if(_0x3fa133){_0x4f2c36[_0x1e87('0x2d')]=_[_0x1e87('0x2f')](db[_0x1e87('0x59')][_0x1e87('0x5a')]);_0x4f2c36[_0x1e87('0x2e')]=_[_0x1e87('0x2f')](_0x17ccbc[_0x1e87('0x2e')]);_0x4f2c36[_0x1e87('0x30')]=_[_0x1e87('0x31')](_0x4f2c36[_0x1e87('0x2d')],_0x4f2c36[_0x1e87('0x2e')]);_0x3a779a['attributes']=_['intersection'](_0x4f2c36[_0x1e87('0x2d')],qs['fields'](_0x17ccbc[_0x1e87('0x2e')]['fields']));_0x3a779a[_0x1e87('0x32')]=_0x3a779a[_0x1e87('0x32')][_0x1e87('0x45')]?_0x3a779a[_0x1e87('0x32')]:_0x4f2c36[_0x1e87('0x2d')];if(!_0x17ccbc[_0x1e87('0x2e')]['hasOwnProperty']('nolimit')){_0x3a779a[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x1d')]);_0x3a779a['offset']=qs[_0x1e87('0x1b')](_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x1b')]);}_0x3a779a[_0x1e87('0x36')]=qs['sort'](_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x37')]);_0x3a779a['where']=qs[_0x1e87('0x30')](_[_0x1e87('0x5b')](_0x17ccbc['query'],_0x4f2c36[_0x1e87('0x30')]));_0x3a779a[_0x1e87('0x38')]['CampaignId']=_0x3fa133['id'];if(_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x3b')]){_0x3a779a[_0x1e87('0x38')]=_[_0x1e87('0x39')](_0x3a779a[_0x1e87('0x38')],{'$or':_[_0x1e87('0x29')](_0x3a779a[_0x1e87('0x32')],function(_0x47fcfe){var _0x1ea0f5={};_0x1ea0f5[_0x47fcfe]={'$like':'%'+_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x3b')]+'%'};return _0x1ea0f5;})});}_0x3a779a=_[_0x1e87('0x39')]({},_0x3a779a,_0x17ccbc['options']);return db[_0x1e87('0x59')][_0x1e87('0x1e')]({'where':_0x3a779a[_0x1e87('0x38')]})['then'](function(_0x4e8736){_0xc52e9f[_0x1e87('0x1e')]=_0x4e8736;if(_0x17ccbc[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x3a779a[_0x1e87('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x1e87('0x40')](_0x3a779a);})[_0x1e87('0x23')](function(_0x15e715){_0xc52e9f[_0x1e87('0x41')]=_0x15e715;return _0xc52e9f;});}})[_0x1e87('0x23')](respondWithFilteredResult(_0x3b246b,_0x3a779a))['catch'](handleError(_0x3b246b,null));};exports[_0x1e87('0x5c')]=function(_0x217e27,_0x269a0d,_0xf66714){var _0x46f802={'raw':!![],'where':{}};var _0x3ea3f6={};var _0x47cd82={'count':0x0,'rows':[]};return db[_0x1e87('0x3d')]['findOne']({'where':{'id':_0x217e27[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x269a0d,null))[_0x1e87('0x23')](function(_0x134afc){if(_0x134afc){_0x3ea3f6['model']=_['keys'](db[_0x1e87('0x5d')][_0x1e87('0x5a')]);_0x3ea3f6[_0x1e87('0x2e')]=_[_0x1e87('0x2f')](_0x217e27[_0x1e87('0x2e')]);_0x3ea3f6['filters']=_[_0x1e87('0x31')](_0x3ea3f6[_0x1e87('0x2d')],_0x3ea3f6['query']);_0x46f802[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x3ea3f6[_0x1e87('0x2d')],qs['fields'](_0x217e27['query'][_0x1e87('0x33')]));_0x46f802[_0x1e87('0x32')]=_0x46f802[_0x1e87('0x32')][_0x1e87('0x45')]?_0x46f802['attributes']:_0x3ea3f6[_0x1e87('0x2d')];if(!_0x217e27[_0x1e87('0x2e')][_0x1e87('0x34')](_0x1e87('0x35'))){_0x46f802[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x217e27[_0x1e87('0x2e')][_0x1e87('0x1d')]);_0x46f802[_0x1e87('0x1b')]=qs[_0x1e87('0x1b')](_0x217e27[_0x1e87('0x2e')][_0x1e87('0x1b')]);}_0x46f802['order']=qs[_0x1e87('0x37')](_0x217e27['query'][_0x1e87('0x37')]);_0x46f802[_0x1e87('0x38')]=qs[_0x1e87('0x30')](_[_0x1e87('0x5b')](_0x217e27['query'],_0x3ea3f6[_0x1e87('0x30')]));_0x46f802[_0x1e87('0x38')][_0x1e87('0x5e')]=_0x134afc['id'];if(_0x217e27['query']['filter']){_0x46f802['where']=_[_0x1e87('0x39')](_0x46f802['where'],{'$or':_[_0x1e87('0x29')](_0x46f802[_0x1e87('0x32')],function(_0x1f3303){var _0x1ce009={};_0x1ce009[_0x1f3303]={'$like':'%'+_0x217e27[_0x1e87('0x2e')][_0x1e87('0x3b')]+'%'};return _0x1ce009;})});}_0x46f802=_[_0x1e87('0x39')]({},_0x46f802,_0x217e27[_0x1e87('0x3c')]);return db[_0x1e87('0x5d')][_0x1e87('0x1e')]({'where':_0x46f802[_0x1e87('0x38')]})[_0x1e87('0x23')](function(_0x206c38){_0x47cd82[_0x1e87('0x1e')]=_0x206c38;if(_0x217e27[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x46f802[_0x1e87('0x3f')]=[{'all':!![]}];}return db[_0x1e87('0x5d')][_0x1e87('0x40')](_0x46f802);})[_0x1e87('0x23')](function(_0x2cd820){_0x47cd82[_0x1e87('0x41')]=_0x2cd820;return _0x47cd82;});}})[_0x1e87('0x23')](respondWithFilteredResult(_0x269a0d,_0x46f802))['catch'](handleError(_0x269a0d,null));};exports[_0x1e87('0x5f')]=function(_0x222902,_0x1dafd8,_0x542556){var _0x57aa62={'raw':!![],'where':{}};var _0x1b7b88={};var _0x3e08cd={'count':0x0,'rows':[]};return db[_0x1e87('0x3d')][_0x1e87('0x58')]({'where':{'id':_0x222902[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x1dafd8,null))['then'](function(_0x4050b4){if(_0x4050b4){_0x1b7b88[_0x1e87('0x2d')]=_[_0x1e87('0x2f')](db[_0x1e87('0x60')]['rawAttributes']);_0x1b7b88['query']=_[_0x1e87('0x2f')](_0x222902[_0x1e87('0x2e')]);_0x1b7b88['filters']=_[_0x1e87('0x31')](_0x1b7b88[_0x1e87('0x2d')],_0x1b7b88[_0x1e87('0x2e')]);_0x57aa62[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x1b7b88[_0x1e87('0x2d')],qs[_0x1e87('0x33')](_0x222902[_0x1e87('0x2e')][_0x1e87('0x33')]));_0x57aa62['attributes']=_0x57aa62['attributes'][_0x1e87('0x45')]?_0x57aa62[_0x1e87('0x32')]:_0x1b7b88[_0x1e87('0x2d')];if(!_0x222902['query']['hasOwnProperty'](_0x1e87('0x35'))){_0x57aa62[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x222902[_0x1e87('0x2e')]['limit']);_0x57aa62[_0x1e87('0x1b')]=qs[_0x1e87('0x1b')](_0x222902[_0x1e87('0x2e')][_0x1e87('0x1b')]);}_0x57aa62[_0x1e87('0x36')]=qs[_0x1e87('0x37')](_0x222902[_0x1e87('0x2e')][_0x1e87('0x37')]);_0x57aa62[_0x1e87('0x38')]=qs[_0x1e87('0x30')](_[_0x1e87('0x5b')](_0x222902['query'],_0x1b7b88[_0x1e87('0x30')]));_0x57aa62['where'][_0x1e87('0x5e')]=_0x4050b4['id'];if(_0x222902[_0x1e87('0x2e')][_0x1e87('0x3b')]){_0x57aa62[_0x1e87('0x38')]=_[_0x1e87('0x39')](_0x57aa62[_0x1e87('0x38')],{'$or':_[_0x1e87('0x29')](_0x57aa62[_0x1e87('0x32')],function(_0x4dbfeb){var _0x579c64={};_0x579c64[_0x4dbfeb]={'$like':'%'+_0x222902[_0x1e87('0x2e')]['filter']+'%'};return _0x579c64;})});}_0x57aa62=_[_0x1e87('0x39')]({},_0x57aa62,_0x222902[_0x1e87('0x3c')]);return db[_0x1e87('0x60')][_0x1e87('0x1e')]({'where':_0x57aa62[_0x1e87('0x38')]})[_0x1e87('0x23')](function(_0x154ea1){_0x3e08cd[_0x1e87('0x1e')]=_0x154ea1;if(_0x222902[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x57aa62[_0x1e87('0x3f')]=[{'all':!![]}];}return db[_0x1e87('0x60')][_0x1e87('0x40')](_0x57aa62);})['then'](function(_0x3b9173){_0x3e08cd[_0x1e87('0x41')]=_0x3b9173;return _0x3e08cd;});}})[_0x1e87('0x23')](respondWithFilteredResult(_0x1dafd8,_0x57aa62))[_0x1e87('0x42')](handleError(_0x1dafd8,null));};exports['getHopperBlacks']=function(_0x1ce24d,_0x48bca2,_0x552e6b){var _0x392ee8={'raw':!![],'where':{}};var _0x55a7ad={};var _0x375c47={'count':0x0,'rows':[]};return db['Campaign'][_0x1e87('0x58')]({'where':{'id':_0x1ce24d['params']['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x48bca2,null))[_0x1e87('0x23')](function(_0x1df522){if(_0x1df522){_0x55a7ad[_0x1e87('0x2d')]=_[_0x1e87('0x2f')](db['CmHopperBlack'][_0x1e87('0x5a')]);_0x55a7ad[_0x1e87('0x2e')]=_[_0x1e87('0x2f')](_0x1ce24d[_0x1e87('0x2e')]);_0x55a7ad[_0x1e87('0x30')]=_[_0x1e87('0x31')](_0x55a7ad[_0x1e87('0x2d')],_0x55a7ad[_0x1e87('0x2e')]);_0x392ee8[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x55a7ad[_0x1e87('0x2d')],qs[_0x1e87('0x33')](_0x1ce24d[_0x1e87('0x2e')]['fields']));_0x392ee8['attributes']=_0x392ee8[_0x1e87('0x32')]['length']?_0x392ee8[_0x1e87('0x32')]:_0x55a7ad[_0x1e87('0x2d')];if(!_0x1ce24d[_0x1e87('0x2e')]['hasOwnProperty'](_0x1e87('0x35'))){_0x392ee8[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x1ce24d['query']['limit']);_0x392ee8[_0x1e87('0x1b')]=qs['offset'](_0x1ce24d[_0x1e87('0x2e')]['offset']);}_0x392ee8[_0x1e87('0x36')]=qs[_0x1e87('0x37')](_0x1ce24d['query'][_0x1e87('0x37')]);_0x392ee8[_0x1e87('0x38')]=qs['filters'](_[_0x1e87('0x5b')](_0x1ce24d[_0x1e87('0x2e')],_0x55a7ad[_0x1e87('0x30')]));_0x392ee8['where'][_0x1e87('0x5e')]=_0x1df522['id'];if(_0x1ce24d[_0x1e87('0x2e')]['filter']){_0x392ee8[_0x1e87('0x38')]=_[_0x1e87('0x39')](_0x392ee8[_0x1e87('0x38')],{'$or':_[_0x1e87('0x29')](_0x392ee8[_0x1e87('0x32')],function(_0x5eb511){var _0x3b97a9={};_0x3b97a9[_0x5eb511]={'$like':'%'+_0x1ce24d[_0x1e87('0x2e')][_0x1e87('0x3b')]+'%'};return _0x3b97a9;})});}_0x392ee8=_[_0x1e87('0x39')]({},_0x392ee8,_0x1ce24d[_0x1e87('0x3c')]);return db[_0x1e87('0x61')][_0x1e87('0x1e')]({'where':_0x392ee8['where']})['then'](function(_0x5029d7){_0x375c47[_0x1e87('0x1e')]=_0x5029d7;if(_0x1ce24d[_0x1e87('0x2e')][_0x1e87('0x3e')]){_0x392ee8[_0x1e87('0x3f')]=[{'all':!![]}];}return db[_0x1e87('0x61')][_0x1e87('0x40')](_0x392ee8);})[_0x1e87('0x23')](function(_0x6ad47a){_0x375c47[_0x1e87('0x41')]=_0x6ad47a;return _0x375c47;});}})[_0x1e87('0x23')](respondWithFilteredResult(_0x48bca2,_0x392ee8))[_0x1e87('0x42')](handleError(_0x48bca2,null));};exports[_0x1e87('0x62')]=function(_0x3844c4,_0x425d18,_0x4e9310){var _0x2721af={};var _0x2dc610={};var _0x551394;var _0x1ecb9b;return db[_0x1e87('0x3d')]['findOne']({'where':{'id':_0x3844c4[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x425d18,null))['then'](function(_0x3a204e){if(_0x3a204e){_0x551394=_0x3a204e;_0x2dc610[_0x1e87('0x2d')]=_['keys'](db[_0x1e87('0x63')][_0x1e87('0x5a')]);_0x2dc610[_0x1e87('0x2e')]=_[_0x1e87('0x2f')](_0x3844c4[_0x1e87('0x2e')]);_0x2dc610[_0x1e87('0x30')]=_[_0x1e87('0x31')](_0x2dc610[_0x1e87('0x2d')],_0x2dc610[_0x1e87('0x2e')]);_0x2721af['attributes']=_[_0x1e87('0x31')](_0x2dc610[_0x1e87('0x2d')],qs[_0x1e87('0x33')](_0x3844c4[_0x1e87('0x2e')][_0x1e87('0x33')]));_0x2721af[_0x1e87('0x32')]=_0x2721af[_0x1e87('0x32')]['length']?_0x2721af['attributes']:_0x2dc610[_0x1e87('0x2d')];_0x2721af[_0x1e87('0x36')]=qs[_0x1e87('0x37')](_0x3844c4[_0x1e87('0x2e')]['sort']);_0x2721af['where']=qs[_0x1e87('0x30')](_[_0x1e87('0x5b')](_0x3844c4['query'],_0x2dc610['filters']));if(_0x3844c4[_0x1e87('0x2e')]['filter']){_0x2721af['where']=_['merge'](_0x2721af[_0x1e87('0x38')],{'$or':_[_0x1e87('0x29')](_0x2721af['attributes'],function(_0x218d19){var _0x1b0b76={};_0x1b0b76[_0x218d19]={'$like':'%'+_0x3844c4[_0x1e87('0x2e')][_0x1e87('0x3b')]+'%'};return _0x1b0b76;})});}_0x2721af=_[_0x1e87('0x39')]({},_0x2721af,_0x3844c4[_0x1e87('0x3c')]);return _0x551394[_0x1e87('0x62')](_0x2721af);}})[_0x1e87('0x23')](function(_0x3919ce){if(_0x3919ce){_0x1ecb9b=_0x3919ce[_0x1e87('0x45')];if(!_0x3844c4[_0x1e87('0x2e')][_0x1e87('0x34')](_0x1e87('0x35'))){_0x2721af[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0x3844c4[_0x1e87('0x2e')]['limit']);_0x2721af[_0x1e87('0x1b')]=qs[_0x1e87('0x1b')](_0x3844c4[_0x1e87('0x2e')][_0x1e87('0x1b')]);}return _0x551394['getLists'](_0x2721af);}})[_0x1e87('0x23')](function(_0x1b81eb){if(_0x1b81eb){return _0x1b81eb?{'count':_0x1ecb9b,'rows':_0x1b81eb}:null;}})['then'](respondWithResult(_0x425d18,null))[_0x1e87('0x42')](handleError(_0x425d18,null));};exports[_0x1e87('0x64')]=function(_0x54c7ba,_0x389c64,_0x3669b5){var _0x4045e9,_0xc4bd5e;return db[_0x1e87('0x3d')][_0x1e87('0x46')]({'where':{'id':_0x54c7ba[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x389c64,null))[_0x1e87('0x23')](function(_0x79a352){if(_0x79a352){_0xc4bd5e=_0x79a352;return _0x79a352[_0x1e87('0x64')](_0x54c7ba[_0x1e87('0x48')][_0x1e87('0x65')],_['omit'](_0x54c7ba[_0x1e87('0x48')],[_0x1e87('0x65'),'id'])||{});}return null;})[_0x1e87('0x66')](function(_0x1fdb6c){var _0x295a8b;_0x4045e9=_0x1fdb6c||[];var _0x2e70fa=[];if(_0x1fdb6c){for(var _0x486415=0x0;_0x486415<_0x1fdb6c['length'];_0x486415+=0x1){var _0x5ee3d0=_0x1fdb6c[_0x486415][_0x1e87('0x4a')]({'plain':!![]});_0xc4bd5e[_0x1e87('0x67')]=_0x54c7ba[_0x1e87('0x48')][_0x1e87('0x67')]?_0x54c7ba[_0x1e87('0x48')][_0x1e87('0x67')]:_0xc4bd5e[_0x1e87('0x67')];switch(_0xc4bd5e['dialCheckDuplicateType']){case _0x1e87('0x68'):_0x295a8b=squel[_0x1e87('0x69')]()[_0x1e87('0x6a')](_0x1e87('0x6b'))[_0x1e87('0x6c')]([_0x1e87('0x6d'),'scheduledAt','ContactId',_0x1e87('0x6e'),_0x1e87('0x5e'),_0x1e87('0x52'),'updatedAt'],squel[_0x1e87('0x6f')]()[_0x1e87('0x70')](_0x1e87('0x6d'),_0x1e87('0x6d'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x72'))[_0x1e87('0x70')]('id',_0x1e87('0x73'))[_0x1e87('0x70')](_0x5ee3d0[_0x1e87('0x74')][_0x1e87('0x75')](),'ListId')['field'](_0x54c7ba[_0x1e87('0x44')]['id'][_0x1e87('0x75')](),_0x1e87('0x5e'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x52'))[_0x1e87('0x70')](_0x1e87('0x71'),'updatedAt')[_0x1e87('0x76')](_0x1e87('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x1e87('0x38')]('ListId\x20=\x20?',_0x5ee3d0[_0x1e87('0x74')][_0x1e87('0x75')]())[_0x1e87('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x1e87('0x38')](_0x1e87('0x78'),squel['select']()[_0x1e87('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x1e87('0x76')](_0x1e87('0x79'))[_0x1e87('0x38')](_0x1e87('0x7a'),_0x54c7ba[_0x1e87('0x44')]['id'][_0x1e87('0x75')]()))['where'](_0x1e87('0x78'),squel[_0x1e87('0x6f')]()[_0x1e87('0x70')](_0x1e87('0x7b'))[_0x1e87('0x76')](_0x1e87('0x6b'))[_0x1e87('0x38')](_0x1e87('0x7a'),_0x54c7ba[_0x1e87('0x44')]['id'][_0x1e87('0x75')]())))[_0x1e87('0x75')]();break;case _0x1e87('0x7c'):_0x295a8b=squel[_0x1e87('0x69')]()['into'](_0x1e87('0x6b'))['fromQuery']([_0x1e87('0x6d'),_0x1e87('0x72'),_0x1e87('0x73'),'ListId',_0x1e87('0x5e'),_0x1e87('0x52'),_0x1e87('0x53')],squel[_0x1e87('0x6f')]()[_0x1e87('0x70')](_0x1e87('0x6d'),_0x1e87('0x6d'))[_0x1e87('0x70')]('NOW()',_0x1e87('0x72'))[_0x1e87('0x70')]('id',_0x1e87('0x73'))[_0x1e87('0x70')](_0x5ee3d0[_0x1e87('0x74')][_0x1e87('0x75')](),_0x1e87('0x6e'))[_0x1e87('0x70')](_0x54c7ba['params']['id'][_0x1e87('0x75')](),_0x1e87('0x5e'))['field'](_0x1e87('0x71'),'createdAt')[_0x1e87('0x70')](_0x1e87('0x71'),'updatedAt')[_0x1e87('0x76')]('cm_contacts')[_0x1e87('0x38')](_0x1e87('0x7d'))['where']('ListId\x20=\x20?',_0x5ee3d0[_0x1e87('0x74')][_0x1e87('0x75')]())[_0x1e87('0x38')](_0x1e87('0x7e'))['where'](_0x1e87('0x78'),squel['select']()[_0x1e87('0x70')](_0x1e87('0x7b'))[_0x1e87('0x76')](_0x1e87('0x6b'))[_0x1e87('0x38')]('CampaignId\x20=\x20?',_0x54c7ba[_0x1e87('0x44')]['id'][_0x1e87('0x75')]())))[_0x1e87('0x75')]();break;default:_0x295a8b=squel[_0x1e87('0x69')]()[_0x1e87('0x6a')]('cm_hopper')[_0x1e87('0x6c')]([_0x1e87('0x6d'),_0x1e87('0x72'),_0x1e87('0x73'),_0x1e87('0x6e'),_0x1e87('0x5e'),_0x1e87('0x52'),_0x1e87('0x53')],squel[_0x1e87('0x6f')]()['field']('phone',_0x1e87('0x6d'))[_0x1e87('0x70')](_0x1e87('0x71'),'scheduledAt')['field']('id',_0x1e87('0x73'))[_0x1e87('0x70')](_0x5ee3d0[_0x1e87('0x74')][_0x1e87('0x75')](),_0x1e87('0x6e'))[_0x1e87('0x70')](_0x54c7ba[_0x1e87('0x44')]['id']['toString'](),_0x1e87('0x5e'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x52'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x53'))[_0x1e87('0x76')]('cm_contacts')[_0x1e87('0x38')](_0x1e87('0x7d'))[_0x1e87('0x38')](_0x1e87('0x7f'),_0x5ee3d0['CmListId']['toString']())[_0x1e87('0x38')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x2e70fa[_0x1e87('0x80')](db[_0x1e87('0x81')][_0x1e87('0x2e')](_0x295a8b));}return BPromise[_0x1e87('0x82')](_0x2e70fa);}})[_0x1e87('0x23')](function(){return _0x4045e9;})[_0x1e87('0x23')](respondWithResult(_0x389c64,null))[_0x1e87('0x42')](handleError(_0x389c64,null));};exports[_0x1e87('0x83')]=function(_0x2371dc,_0x4c2a74,_0x1b5013){return db['Campaign'][_0x1e87('0x46')]({'where':{'id':_0x2371dc[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x4c2a74,null))[_0x1e87('0x23')](function(_0x362b1b){if(_0x362b1b){return _0x362b1b['removeLists'](_0x2371dc[_0x1e87('0x2e')][_0x1e87('0x65')]);}})['then'](function(_0x26f245){if(_0x26f245){return db['CmHopper']['destroy']({'where':{'ListId':_0x2371dc[_0x1e87('0x2e')][_0x1e87('0x65')],'CampaignId':_0x2371dc[_0x1e87('0x44')]['id']}})['then'](function(){return _0x26f245;});}})['then'](respondWithStatusCode(_0x4c2a74,null))['catch'](handleError(_0x4c2a74,null));};exports['getBlackLists']=function(_0x5b1e4d,_0x205d05,_0x450245){var _0x334411={};var _0x42342c={};var _0x1ab3e8;var _0x33c27a;return db[_0x1e87('0x3d')][_0x1e87('0x58')]({'where':{'id':_0x5b1e4d[_0x1e87('0x44')]['id']}})['then'](handleEntityNotFound(_0x205d05,null))[_0x1e87('0x23')](function(_0x11507e){if(_0x11507e){_0x1ab3e8=_0x11507e;_0x42342c[_0x1e87('0x2d')]=_[_0x1e87('0x2f')](db[_0x1e87('0x63')][_0x1e87('0x5a')]);_0x42342c[_0x1e87('0x2e')]=_['keys'](_0x5b1e4d[_0x1e87('0x2e')]);_0x42342c['filters']=_[_0x1e87('0x31')](_0x42342c[_0x1e87('0x2d')],_0x42342c['query']);_0x334411[_0x1e87('0x32')]=_[_0x1e87('0x31')](_0x42342c['model'],qs[_0x1e87('0x33')](_0x5b1e4d[_0x1e87('0x2e')]['fields']));_0x334411[_0x1e87('0x32')]=_0x334411[_0x1e87('0x32')][_0x1e87('0x45')]?_0x334411['attributes']:_0x42342c['model'];_0x334411[_0x1e87('0x36')]=qs[_0x1e87('0x37')](_0x5b1e4d[_0x1e87('0x2e')]['sort']);_0x334411[_0x1e87('0x38')]=qs['filters'](_[_0x1e87('0x5b')](_0x5b1e4d[_0x1e87('0x2e')],_0x42342c[_0x1e87('0x30')]));if(_0x5b1e4d[_0x1e87('0x2e')][_0x1e87('0x3b')]){_0x334411[_0x1e87('0x38')]=_[_0x1e87('0x39')](_0x334411[_0x1e87('0x38')],{'$or':_[_0x1e87('0x29')](_0x334411[_0x1e87('0x32')],function(_0x424630){var _0x404cf5={};_0x404cf5[_0x424630]={'$like':'%'+_0x5b1e4d['query']['filter']+'%'};return _0x404cf5;})});}_0x334411=_[_0x1e87('0x39')]({},_0x334411,_0x5b1e4d[_0x1e87('0x3c')]);return _0x1ab3e8[_0x1e87('0x84')](_0x334411);}})[_0x1e87('0x23')](function(_0x4b89dc){if(_0x4b89dc){_0x33c27a=_0x4b89dc[_0x1e87('0x45')];if(!_0x5b1e4d[_0x1e87('0x2e')]['hasOwnProperty'](_0x1e87('0x35'))){_0x334411['limit']=qs['limit'](_0x5b1e4d['query'][_0x1e87('0x1d')]);_0x334411[_0x1e87('0x1b')]=qs[_0x1e87('0x1b')](_0x5b1e4d[_0x1e87('0x2e')]['offset']);}return _0x1ab3e8[_0x1e87('0x84')](_0x334411);}})[_0x1e87('0x23')](function(_0x504a54){if(_0x504a54){return _0x504a54?{'count':_0x33c27a,'rows':_0x504a54}:null;}})[_0x1e87('0x23')](respondWithResult(_0x205d05,null))[_0x1e87('0x42')](handleError(_0x205d05,null));};exports[_0x1e87('0x85')]=function(_0x4da2cf,_0x2931fe,_0x3fb74c){var _0x13a4f8,_0x44db66;return db[_0x1e87('0x3d')]['find']({'where':{'id':_0x4da2cf['params']['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x2931fe,null))['then'](function(_0xe04d6d){if(_0xe04d6d){_0x44db66=_0xe04d6d;return _0xe04d6d['addBlackLists'](_0x4da2cf[_0x1e87('0x48')][_0x1e87('0x65')],_[_0x1e87('0x54')](_0x4da2cf[_0x1e87('0x48')],['ids','id'])||{});}return null;})[_0x1e87('0x66')](function(_0x3d473a){var _0x154dbc;_0x13a4f8=_0x3d473a||[];var _0x26c250=[];if(_0x3d473a){for(var _0x3856c4=0x0;_0x3856c4<_0x3d473a[_0x1e87('0x45')];_0x3856c4+=0x1){var _0xe0db5d=_0x3d473a[_0x3856c4]['get']({'plain':!![]});_0x154dbc=squel[_0x1e87('0x69')]()[_0x1e87('0x6a')](_0x1e87('0x86'))[_0x1e87('0x6c')]([_0x1e87('0x6d'),_0x1e87('0x73'),_0x1e87('0x6e'),_0x1e87('0x5e'),_0x1e87('0x52'),_0x1e87('0x53')],squel[_0x1e87('0x6f')]()['field']('phone',_0x1e87('0x6d'))[_0x1e87('0x70')]('id',_0x1e87('0x73'))[_0x1e87('0x70')](_0xe0db5d[_0x1e87('0x74')]['toString'](),_0x1e87('0x6e'))[_0x1e87('0x70')](_0x4da2cf[_0x1e87('0x44')]['id'][_0x1e87('0x75')](),_0x1e87('0x5e'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x52'))[_0x1e87('0x70')](_0x1e87('0x71'),_0x1e87('0x53'))['from'](_0x1e87('0x77'))[_0x1e87('0x38')](_0x1e87('0x7d'))[_0x1e87('0x38')](_0x1e87('0x7f'),_0xe0db5d[_0x1e87('0x74')][_0x1e87('0x75')]())[_0x1e87('0x38')](_0x1e87('0x7e')))[_0x1e87('0x75')]();_0x26c250['push'](db[_0x1e87('0x81')][_0x1e87('0x2e')](_0x154dbc));}return BPromise[_0x1e87('0x82')](_0x26c250);}})[_0x1e87('0x23')](function(){return _0x13a4f8;})[_0x1e87('0x23')](respondWithResult(_0x2931fe,null))[_0x1e87('0x42')](handleError(_0x2931fe,null));};exports[_0x1e87('0x87')]=function(_0x3e62b7,_0x3d8579,_0x5ea5b6){return db[_0x1e87('0x3d')][_0x1e87('0x46')]({'where':{'id':_0x3e62b7['params']['id']}})[_0x1e87('0x23')](handleEntityNotFound(_0x3d8579,null))[_0x1e87('0x23')](function(_0x1fc057){if(_0x1fc057){return _0x1fc057[_0x1e87('0x87')](_0x3e62b7[_0x1e87('0x2e')]['ids']);}})[_0x1e87('0x23')](function(_0x285f06){if(_0x285f06){return db[_0x1e87('0x61')][_0x1e87('0x24')]({'where':{'ListId':_0x3e62b7[_0x1e87('0x2e')][_0x1e87('0x65')],'CampaignId':_0x3e62b7[_0x1e87('0x44')]['id']}})[_0x1e87('0x23')](function(){return _0x285f06;});}})[_0x1e87('0x23')](respondWithStatusCode(_0x3d8579,null))[_0x1e87('0x42')](handleError(_0x3d8579,null));}; \ No newline at end of file +var _0x596a=['options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','clone','params','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','insert','ListId','cm_contacts','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','Content-Range','reject','save','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Campaign','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x596a,0x158));var _0xa596=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x596a[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa596('0x0'));var zipdir=require(_0xa596('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa596('0x2'));var moment=require('moment');var BPromise=require(_0xa596('0x3'));var Mustache=require(_0xa596('0x4'));var util=require(_0xa596('0x5'));var path=require(_0xa596('0x6'));var sox=require(_0xa596('0x7'));var csv=require('to-csv');var ejs=require(_0xa596('0x8'));var fs=require('fs');var fs_extra=require(_0xa596('0x9'));var _=require(_0xa596('0xa'));var squel=require(_0xa596('0xb'));var crypto=require('crypto');var jsforce=require(_0xa596('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa596('0xd'));var Papa=require(_0xa596('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa596('0xf'));var hardwareService=require(_0xa596('0x10'));var logger=require(_0xa596('0x11'))(_0xa596('0x12'));var utils=require(_0xa596('0x13'));var config=require(_0xa596('0x14'));var licenseUtil=require(_0xa596('0x15'));var db=require(_0xa596('0x16'))['db'];function respondWithStatusCode(_0x3c011b,_0x1b6697){_0x1b6697=_0x1b6697||0xcc;return function(_0x2b1f48){if(_0x2b1f48){return _0x3c011b['sendStatus'](_0x1b6697);}return _0x3c011b['status'](_0x1b6697)[_0xa596('0x17')]();};}function respondWithResult(_0xc02308,_0xb3477e){_0xb3477e=_0xb3477e||0xc8;return function(_0x2d4343){if(_0x2d4343){return _0xc02308[_0xa596('0x18')](_0xb3477e)[_0xa596('0x19')](_0x2d4343);}};}function respondWithFilteredResult(_0x5c55ac,_0x41361c){return function(_0x464fff){if(_0x464fff){var _0x2408af=typeof _0x41361c['offset']==='undefined'&&typeof _0x41361c[_0xa596('0x1a')]===_0xa596('0x1b');var _0x136a6d=_0x464fff[_0xa596('0x1c')];var _0x572436=_0x2408af?0x0:_0x41361c['offset'];var _0x48a5aa=_0x2408af?_0x464fff[_0xa596('0x1c')]:_0x41361c[_0xa596('0x1d')]+_0x41361c[_0xa596('0x1a')];var _0x1475e0;if(_0x48a5aa>=_0x136a6d){_0x48a5aa=_0x136a6d;_0x1475e0=0xc8;}else{_0x1475e0=0xce;}_0x5c55ac[_0xa596('0x18')](_0x1475e0);return _0x5c55ac['set'](_0xa596('0x1e'),_0x572436+'-'+_0x48a5aa+'/'+_0x136a6d)[_0xa596('0x19')](_0x464fff);}return null;};}function patchUpdates(_0x2fe150){return function(_0xde5363){try{jsonpatch['apply'](_0xde5363,_0x2fe150,!![]);}catch(_0x1c04f7){return BPromise[_0xa596('0x1f')](_0x1c04f7);}return _0xde5363[_0xa596('0x20')]();};}function saveUpdates(_0x17925c,_0x3b98a3){return function(_0x257f73){if(_0x257f73){return _0x257f73['update'](_0x17925c)[_0xa596('0x21')](function(_0x4cb6da){return _0x4cb6da;});}return null;};}function removeEntity(_0x39d0d8,_0x47ecd4){return function(_0x414b67){if(_0x414b67){return _0x414b67['destroy']()[_0xa596('0x21')](function(){var _0x59c37f=_0x414b67[_0xa596('0x22')]({'plain':!![]});var _0x4cad1e=_0xa596('0x23');return db[_0xa596('0x24')][_0xa596('0x25')]({'where':{'type':_0x4cad1e,'resourceId':_0x59c37f['id']}})[_0xa596('0x21')](function(){return _0x414b67;});})['then'](function(){_0x39d0d8[_0xa596('0x18')](0xcc)[_0xa596('0x17')]();});}};}function handleEntityNotFound(_0x29fc9c,_0x3d4795){return function(_0x21ed62){if(!_0x21ed62){_0x29fc9c[_0xa596('0x26')](0x194);}return _0x21ed62;};}function handleError(_0x11caff,_0x256c96){_0x256c96=_0x256c96||0x1f4;return function(_0xa1c2de){logger[_0xa596('0x27')](_0xa1c2de[_0xa596('0x28')]);if(_0xa1c2de[_0xa596('0x29')]){delete _0xa1c2de[_0xa596('0x29')];}_0x11caff[_0xa596('0x18')](_0x256c96)['send'](_0xa1c2de);};}exports[_0xa596('0x2a')]=function(_0x3e6e50,_0x2e6c6f){var _0x49e0c7={},_0x49d181={},_0xae79de={'count':0x0,'rows':[]};var _0x4b6fb3=_[_0xa596('0x2b')](db[_0xa596('0x2c')]['rawAttributes'],function(_0x26930c){return{'name':_0x26930c[_0xa596('0x2d')],'type':_0x26930c[_0xa596('0x2e')][_0xa596('0x2f')]};});_0x49d181['model']=_[_0xa596('0x2b')](_0x4b6fb3,'name');_0x49d181[_0xa596('0x30')]=_[_0xa596('0x31')](_0x3e6e50[_0xa596('0x30')]);_0x49d181[_0xa596('0x32')]=_[_0xa596('0x33')](_0x49d181[_0xa596('0x34')],_0x49d181[_0xa596('0x30')]);_0x49e0c7[_0xa596('0x35')]=_[_0xa596('0x33')](_0x49d181[_0xa596('0x34')],qs[_0xa596('0x36')](_0x3e6e50[_0xa596('0x30')][_0xa596('0x36')]));_0x49e0c7[_0xa596('0x35')]=_0x49e0c7[_0xa596('0x35')][_0xa596('0x37')]?_0x49e0c7[_0xa596('0x35')]:_0x49d181[_0xa596('0x34')];if(!_0x3e6e50['query'][_0xa596('0x38')](_0xa596('0x39'))){_0x49e0c7[_0xa596('0x1a')]=qs[_0xa596('0x1a')](_0x3e6e50[_0xa596('0x30')]['limit']);_0x49e0c7[_0xa596('0x1d')]=qs[_0xa596('0x1d')](_0x3e6e50['query'][_0xa596('0x1d')]);}_0x49e0c7[_0xa596('0x3a')]=qs[_0xa596('0x3b')](_0x3e6e50[_0xa596('0x30')][_0xa596('0x3b')]);_0x49e0c7[_0xa596('0x3c')]=qs[_0xa596('0x32')](_['pick'](_0x3e6e50['query'],_0x49d181[_0xa596('0x32')]),_0x4b6fb3);if(_0x3e6e50[_0xa596('0x30')][_0xa596('0x3d')]){_0x49e0c7['where']=_[_0xa596('0x3e')](_0x49e0c7['where'],{'$or':_[_0xa596('0x2b')](_0x4b6fb3,function(_0x1c400a){if(_0x1c400a[_0xa596('0x2e')]!==_0xa596('0x3f')){var _0x582384={};_0x582384[_0x1c400a[_0xa596('0x29')]]={'$like':'%'+_0x3e6e50[_0xa596('0x30')][_0xa596('0x3d')]+'%'};return _0x582384;}})});}_0x49e0c7=_[_0xa596('0x3e')]({},_0x49e0c7,_0x3e6e50[_0xa596('0x40')]);var _0x2297a7={'where':_0x49e0c7[_0xa596('0x3c')]};return db[_0xa596('0x2c')][_0xa596('0x1c')](_0x2297a7)[_0xa596('0x21')](function(_0x1dc752){_0xae79de[_0xa596('0x1c')]=_0x1dc752;if(_0x3e6e50[_0xa596('0x30')][_0xa596('0x41')]){_0x49e0c7[_0xa596('0x42')]=[{'all':!![]}];}return db[_0xa596('0x2c')][_0xa596('0x43')](_0x49e0c7);})[_0xa596('0x21')](function(_0x374590){_0xae79de[_0xa596('0x44')]=_0x374590;return _0xae79de;})[_0xa596('0x21')](respondWithFilteredResult(_0x2e6c6f,_0x49e0c7))[_0xa596('0x45')](handleError(_0x2e6c6f,null));};exports[_0xa596('0x46')]=function(_0x10e5ee,_0x4084ad){var _0x54143d={'raw':![],'where':{'id':_0x10e5ee['params']['id']}},_0x31d147={};_0x31d147[_0xa596('0x34')]=_[_0xa596('0x31')](db[_0xa596('0x2c')][_0xa596('0x47')]);_0x31d147[_0xa596('0x30')]=_[_0xa596('0x31')](_0x10e5ee[_0xa596('0x30')]);_0x31d147[_0xa596('0x32')]=_[_0xa596('0x33')](_0x31d147[_0xa596('0x34')],_0x31d147['query']);_0x54143d['attributes']=_[_0xa596('0x33')](_0x31d147[_0xa596('0x34')],qs[_0xa596('0x36')](_0x10e5ee[_0xa596('0x30')]['fields']));_0x54143d['attributes']=_0x54143d['attributes']['length']?_0x54143d[_0xa596('0x35')]:_0x31d147[_0xa596('0x34')];if(_0x10e5ee[_0xa596('0x30')][_0xa596('0x41')]){_0x54143d[_0xa596('0x42')]=[{'all':!![]}];}_0x54143d=_[_0xa596('0x3e')]({},_0x54143d,_0x10e5ee[_0xa596('0x40')]);return db[_0xa596('0x2c')][_0xa596('0x48')](_0x54143d)[_0xa596('0x21')](handleEntityNotFound(_0x4084ad,null))[_0xa596('0x21')](respondWithResult(_0x4084ad,null))[_0xa596('0x45')](handleError(_0x4084ad,null));};exports[_0xa596('0x49')]=function(_0x1c0281,_0x5d25ad){return db[_0xa596('0x2c')][_0xa596('0x49')](_0x1c0281[_0xa596('0x4a')],{})[_0xa596('0x21')](function(_0xd5badb){var _0x365f17=_0x1c0281[_0xa596('0x4b')][_0xa596('0x22')]({'plain':!![]});if(!_0x365f17)throw new Error(_0xa596('0x4c'));if(_0x365f17[_0xa596('0x4d')]===_0xa596('0x4b')){var _0x4ce782=_0xd5badb[_0xa596('0x22')]({'plain':!![]});var _0x3260f6=_0xa596('0x23');return db['UserProfileSection'][_0xa596('0x48')]({'where':{'name':_0x3260f6,'userProfileId':_0x365f17[_0xa596('0x4e')]},'raw':!![]})['then'](function(_0x16cd4e){if(_0x16cd4e&&_0x16cd4e['autoAssociation']===0x0){return db[_0xa596('0x24')][_0xa596('0x49')]({'name':_0x4ce782['name'],'resourceId':_0x4ce782['id'],'type':_0x16cd4e[_0xa596('0x29')],'sectionId':_0x16cd4e['id']},{})[_0xa596('0x21')](function(){return _0xd5badb;});}else{return _0xd5badb;}})[_0xa596('0x45')](function(_0x4b12f9){logger[_0xa596('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b12f9);throw _0x4b12f9;});}return _0xd5badb;})['then'](respondWithResult(_0x5d25ad,0xc9))[_0xa596('0x45')](handleError(_0x5d25ad,null));};exports[_0xa596('0x4f')]=function(_0xc4a948,_0x5a6890){var _0x58db3f={'where':{'id':_0xc4a948[_0xa596('0x50')]['id']}},_0xec4b7a={};_0xec4b7a[_0xa596('0x34')]=_[_0xa596('0x31')](db[_0xa596('0x2c')][_0xa596('0x47')]);_0x58db3f[_0xa596('0x35')]=_[_0xa596('0x33')](_0xec4b7a[_0xa596('0x34')],qs[_0xa596('0x36')](_0xc4a948[_0xa596('0x30')][_0xa596('0x36')]));_0x58db3f[_0xa596('0x35')]=_0x58db3f[_0xa596('0x35')]['length']?_0x58db3f[_0xa596('0x35')]:_0xec4b7a['model'];if(_0xc4a948[_0xa596('0x30')]['includeAll']){_0x58db3f['include']=[{'all':!![]}];}_0x58db3f=_['merge']({},_0x58db3f,_0xc4a948['options']);return db[_0xa596('0x2c')][_0xa596('0x48')](_0x58db3f)[_0xa596('0x21')](handleEntityNotFound(_0x5a6890,null))[_0xa596('0x21')](function(_0x4f8fd1){if(_0x4f8fd1){var _0x1f4e5e=_0x4f8fd1[_0xa596('0x22')]({'plain':!![]});_0x1f4e5e=qs[_0xa596('0x51')](_0x1f4e5e,['id',_0xa596('0x52'),_0xa596('0x53')]);_0xc4a948[_0xa596('0x4a')]=_[_0xa596('0x51')](_0xc4a948[_0xa596('0x4a')],['id',_0xa596('0x52'),'updatedAt']);return db[_0xa596('0x2c')]['create'](_[_0xa596('0x3e')](_0x1f4e5e,_0xc4a948['body']),{'include':_0xc4a948[_0xa596('0x30')][_0xa596('0x41')]?[{'all':!![]}]:undefined})[_0xa596('0x21')](function(_0x8f0599){var _0x26d382=_0xc4a948['user'][_0xa596('0x22')]({'plain':!![]});if(!_0x26d382)throw new Error(_0xa596('0x4c'));if(_0x26d382[_0xa596('0x4d')]===_0xa596('0x4b')){var _0x578086=_0x8f0599['get']({'plain':!![]});var _0x596d57=_0xa596('0x23');return db['UserProfileSection'][_0xa596('0x48')]({'where':{'name':_0x596d57,'userProfileId':_0x26d382[_0xa596('0x4e')]},'raw':!![]})[_0xa596('0x21')](function(_0x397955){if(_0x397955&&_0x397955[_0xa596('0x54')]===0x0){return db[_0xa596('0x24')][_0xa596('0x49')]({'name':_0x578086['name'],'resourceId':_0x578086['id'],'type':_0x397955[_0xa596('0x29')],'sectionId':_0x397955['id']},{})[_0xa596('0x21')](function(){return _0x8f0599;});}else{return _0x8f0599;}})[_0xa596('0x45')](function(_0x2a45d0){logger['error'](_0xa596('0x55'),_0x2a45d0);throw _0x2a45d0;});}return _0x8f0599;});}})[_0xa596('0x21')](respondWithResult(_0x5a6890,0xc9))[_0xa596('0x45')](handleError(_0x5a6890,null));};exports[_0xa596('0x56')]=function(_0x5959fc,_0x43f46c){if(_0x5959fc[_0xa596('0x4a')]['id']){delete _0x5959fc[_0xa596('0x4a')]['id'];}return db[_0xa596('0x2c')][_0xa596('0x48')]({'where':{'id':_0x5959fc[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x43f46c,null))[_0xa596('0x21')](saveUpdates(_0x5959fc[_0xa596('0x4a')],null))[_0xa596('0x21')](respondWithResult(_0x43f46c,null))[_0xa596('0x45')](handleError(_0x43f46c,null));};exports[_0xa596('0x25')]=function(_0x39b8f5,_0x1db843){return db[_0xa596('0x2c')]['find']({'where':{'id':_0x39b8f5['params']['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x1db843,null))[_0xa596('0x21')](removeEntity(_0x1db843,null))[_0xa596('0x45')](handleError(_0x1db843,null));};exports[_0xa596('0x57')]=function(_0x1f669f,_0x20ab97,_0x2808ba){var _0x3928c6={'raw':!![],'where':{}};var _0xdb019c={};var _0x3d4bcc={'count':0x0,'rows':[]};return db[_0xa596('0x2c')][_0xa596('0x58')]({'where':{'id':_0x1f669f['params']['id']}})['then'](handleEntityNotFound(_0x20ab97,null))[_0xa596('0x21')](function(_0x1a56ea){if(_0x1a56ea){_0xdb019c[_0xa596('0x34')]=_[_0xa596('0x31')](db[_0xa596('0x59')]['rawAttributes']);_0xdb019c['query']=_[_0xa596('0x31')](_0x1f669f['query']);_0xdb019c[_0xa596('0x32')]=_[_0xa596('0x33')](_0xdb019c[_0xa596('0x34')],_0xdb019c[_0xa596('0x30')]);_0x3928c6[_0xa596('0x35')]=_['intersection'](_0xdb019c[_0xa596('0x34')],qs[_0xa596('0x36')](_0x1f669f[_0xa596('0x30')][_0xa596('0x36')]));_0x3928c6[_0xa596('0x35')]=_0x3928c6[_0xa596('0x35')][_0xa596('0x37')]?_0x3928c6['attributes']:_0xdb019c[_0xa596('0x34')];if(!_0x1f669f[_0xa596('0x30')][_0xa596('0x38')](_0xa596('0x39'))){_0x3928c6['limit']=qs[_0xa596('0x1a')](_0x1f669f[_0xa596('0x30')][_0xa596('0x1a')]);_0x3928c6['offset']=qs[_0xa596('0x1d')](_0x1f669f[_0xa596('0x30')]['offset']);}_0x3928c6[_0xa596('0x3a')]=qs['sort'](_0x1f669f[_0xa596('0x30')][_0xa596('0x3b')]);_0x3928c6[_0xa596('0x3c')]=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x1f669f[_0xa596('0x30')],_0xdb019c['filters']));_0x3928c6['where'][_0xa596('0x5b')]=_0x1a56ea['id'];if(_0x1f669f['query'][_0xa596('0x3d')]){_0x3928c6[_0xa596('0x3c')]=_['merge'](_0x3928c6[_0xa596('0x3c')],{'$or':_[_0xa596('0x2b')](_0x3928c6['attributes'],function(_0x53926e){var _0x21969e={};_0x21969e[_0x53926e]={'$like':'%'+_0x1f669f[_0xa596('0x30')][_0xa596('0x3d')]+'%'};return _0x21969e;})});}_0x3928c6=_[_0xa596('0x3e')]({},_0x3928c6,_0x1f669f[_0xa596('0x40')]);return db['CmHopper'][_0xa596('0x1c')]({'where':_0x3928c6[_0xa596('0x3c')]})[_0xa596('0x21')](function(_0x1d1a8d){_0x3d4bcc[_0xa596('0x1c')]=_0x1d1a8d;if(_0x1f669f['query']['includeAll']){_0x3928c6[_0xa596('0x42')]=[{'all':!![]}];}return db[_0xa596('0x59')]['findAll'](_0x3928c6);})['then'](function(_0x10b190){_0x3d4bcc[_0xa596('0x44')]=_0x10b190;return _0x3d4bcc;});}})[_0xa596('0x21')](respondWithFilteredResult(_0x20ab97,_0x3928c6))[_0xa596('0x45')](handleError(_0x20ab97,null));};exports[_0xa596('0x5c')]=function(_0x5baa97,_0x3c070d,_0x441752){var _0x31166b={'raw':!![],'where':{}};var _0x24500c={};var _0x40ba99={'count':0x0,'rows':[]};return db[_0xa596('0x2c')][_0xa596('0x58')]({'where':{'id':_0x5baa97[_0xa596('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c070d,null))[_0xa596('0x21')](function(_0x30ab2f){if(_0x30ab2f){_0x24500c['model']=_[_0xa596('0x31')](db[_0xa596('0x5d')][_0xa596('0x47')]);_0x24500c[_0xa596('0x30')]=_[_0xa596('0x31')](_0x5baa97[_0xa596('0x30')]);_0x24500c[_0xa596('0x32')]=_[_0xa596('0x33')](_0x24500c[_0xa596('0x34')],_0x24500c['query']);_0x31166b[_0xa596('0x35')]=_[_0xa596('0x33')](_0x24500c[_0xa596('0x34')],qs[_0xa596('0x36')](_0x5baa97[_0xa596('0x30')]['fields']));_0x31166b[_0xa596('0x35')]=_0x31166b[_0xa596('0x35')]['length']?_0x31166b[_0xa596('0x35')]:_0x24500c['model'];if(!_0x5baa97[_0xa596('0x30')][_0xa596('0x38')](_0xa596('0x39'))){_0x31166b[_0xa596('0x1a')]=qs['limit'](_0x5baa97[_0xa596('0x30')][_0xa596('0x1a')]);_0x31166b[_0xa596('0x1d')]=qs[_0xa596('0x1d')](_0x5baa97['query'][_0xa596('0x1d')]);}_0x31166b['order']=qs['sort'](_0x5baa97[_0xa596('0x30')][_0xa596('0x3b')]);_0x31166b['where']=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x5baa97[_0xa596('0x30')],_0x24500c['filters']));_0x31166b[_0xa596('0x3c')][_0xa596('0x5b')]=_0x30ab2f['id'];if(_0x5baa97['query'][_0xa596('0x3d')]){_0x31166b['where']=_[_0xa596('0x3e')](_0x31166b['where'],{'$or':_[_0xa596('0x2b')](_0x31166b[_0xa596('0x35')],function(_0xdaf83d){var _0x4f933a={};_0x4f933a[_0xdaf83d]={'$like':'%'+_0x5baa97[_0xa596('0x30')]['filter']+'%'};return _0x4f933a;})});}_0x31166b=_[_0xa596('0x3e')]({},_0x31166b,_0x5baa97[_0xa596('0x40')]);return db[_0xa596('0x5d')][_0xa596('0x1c')]({'where':_0x31166b[_0xa596('0x3c')]})[_0xa596('0x21')](function(_0x32b14a){_0x40ba99['count']=_0x32b14a;if(_0x5baa97[_0xa596('0x30')][_0xa596('0x41')]){_0x31166b[_0xa596('0x42')]=[{'all':!![]}];}return db[_0xa596('0x5d')]['findAll'](_0x31166b);})[_0xa596('0x21')](function(_0x3c5921){_0x40ba99[_0xa596('0x44')]=_0x3c5921;return _0x40ba99;});}})['then'](respondWithFilteredResult(_0x3c070d,_0x31166b))['catch'](handleError(_0x3c070d,null));};exports[_0xa596('0x5e')]=function(_0x4b6a87,_0x4ac0b5,_0x15aea8){var _0x54e08b={'raw':!![],'where':{}};var _0x5d35f7={};var _0xd24664={'count':0x0,'rows':[]};return db['Campaign'][_0xa596('0x58')]({'where':{'id':_0x4b6a87[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x4ac0b5,null))['then'](function(_0x3548a8){if(_0x3548a8){_0x5d35f7[_0xa596('0x34')]=_[_0xa596('0x31')](db[_0xa596('0x5f')][_0xa596('0x47')]);_0x5d35f7[_0xa596('0x30')]=_[_0xa596('0x31')](_0x4b6a87[_0xa596('0x30')]);_0x5d35f7[_0xa596('0x32')]=_['intersection'](_0x5d35f7[_0xa596('0x34')],_0x5d35f7[_0xa596('0x30')]);_0x54e08b[_0xa596('0x35')]=_['intersection'](_0x5d35f7[_0xa596('0x34')],qs[_0xa596('0x36')](_0x4b6a87[_0xa596('0x30')][_0xa596('0x36')]));_0x54e08b[_0xa596('0x35')]=_0x54e08b[_0xa596('0x35')][_0xa596('0x37')]?_0x54e08b[_0xa596('0x35')]:_0x5d35f7[_0xa596('0x34')];if(!_0x4b6a87['query'][_0xa596('0x38')](_0xa596('0x39'))){_0x54e08b[_0xa596('0x1a')]=qs[_0xa596('0x1a')](_0x4b6a87[_0xa596('0x30')][_0xa596('0x1a')]);_0x54e08b['offset']=qs[_0xa596('0x1d')](_0x4b6a87['query']['offset']);}_0x54e08b[_0xa596('0x3a')]=qs[_0xa596('0x3b')](_0x4b6a87[_0xa596('0x30')][_0xa596('0x3b')]);_0x54e08b[_0xa596('0x3c')]=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x4b6a87[_0xa596('0x30')],_0x5d35f7[_0xa596('0x32')]));_0x54e08b['where'][_0xa596('0x5b')]=_0x3548a8['id'];if(_0x4b6a87[_0xa596('0x30')]['filter']){_0x54e08b[_0xa596('0x3c')]=_[_0xa596('0x3e')](_0x54e08b[_0xa596('0x3c')],{'$or':_[_0xa596('0x2b')](_0x54e08b[_0xa596('0x35')],function(_0x52eff4){var _0x5dcb0a={};_0x5dcb0a[_0x52eff4]={'$like':'%'+_0x4b6a87[_0xa596('0x30')][_0xa596('0x3d')]+'%'};return _0x5dcb0a;})});}_0x54e08b=_[_0xa596('0x3e')]({},_0x54e08b,_0x4b6a87['options']);return db[_0xa596('0x5f')]['count']({'where':_0x54e08b['where']})[_0xa596('0x21')](function(_0x10be7a){_0xd24664['count']=_0x10be7a;if(_0x4b6a87[_0xa596('0x30')][_0xa596('0x41')]){_0x54e08b['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xa596('0x43')](_0x54e08b);})[_0xa596('0x21')](function(_0x2d0337){_0xd24664['rows']=_0x2d0337;return _0xd24664;});}})['then'](respondWithFilteredResult(_0x4ac0b5,_0x54e08b))[_0xa596('0x45')](handleError(_0x4ac0b5,null));};exports[_0xa596('0x60')]=function(_0x12fff8,_0x5cc0bc,_0x4cca8f){var _0x5bc68d={'raw':!![],'where':{}};var _0x1cc0ba={};var _0x46b663={'count':0x0,'rows':[]};return db['Campaign'][_0xa596('0x58')]({'where':{'id':_0x12fff8['params']['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x5cc0bc,null))['then'](function(_0x28e736){if(_0x28e736){_0x1cc0ba['model']=_['keys'](db[_0xa596('0x61')][_0xa596('0x47')]);_0x1cc0ba[_0xa596('0x30')]=_['keys'](_0x12fff8['query']);_0x1cc0ba[_0xa596('0x32')]=_[_0xa596('0x33')](_0x1cc0ba[_0xa596('0x34')],_0x1cc0ba[_0xa596('0x30')]);_0x5bc68d[_0xa596('0x35')]=_[_0xa596('0x33')](_0x1cc0ba[_0xa596('0x34')],qs[_0xa596('0x36')](_0x12fff8[_0xa596('0x30')]['fields']));_0x5bc68d[_0xa596('0x35')]=_0x5bc68d[_0xa596('0x35')][_0xa596('0x37')]?_0x5bc68d[_0xa596('0x35')]:_0x1cc0ba[_0xa596('0x34')];if(!_0x12fff8[_0xa596('0x30')]['hasOwnProperty']('nolimit')){_0x5bc68d[_0xa596('0x1a')]=qs[_0xa596('0x1a')](_0x12fff8[_0xa596('0x30')]['limit']);_0x5bc68d[_0xa596('0x1d')]=qs[_0xa596('0x1d')](_0x12fff8[_0xa596('0x30')]['offset']);}_0x5bc68d[_0xa596('0x3a')]=qs['sort'](_0x12fff8['query'][_0xa596('0x3b')]);_0x5bc68d[_0xa596('0x3c')]=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x12fff8[_0xa596('0x30')],_0x1cc0ba[_0xa596('0x32')]));_0x5bc68d[_0xa596('0x3c')]['CampaignId']=_0x28e736['id'];if(_0x12fff8[_0xa596('0x30')][_0xa596('0x3d')]){_0x5bc68d['where']=_[_0xa596('0x3e')](_0x5bc68d[_0xa596('0x3c')],{'$or':_['map'](_0x5bc68d[_0xa596('0x35')],function(_0x3e8c21){var _0x312c64={};_0x312c64[_0x3e8c21]={'$like':'%'+_0x12fff8[_0xa596('0x30')][_0xa596('0x3d')]+'%'};return _0x312c64;})});}_0x5bc68d=_[_0xa596('0x3e')]({},_0x5bc68d,_0x12fff8[_0xa596('0x40')]);return db['CmHopperBlack'][_0xa596('0x1c')]({'where':_0x5bc68d['where']})[_0xa596('0x21')](function(_0x1024e3){_0x46b663['count']=_0x1024e3;if(_0x12fff8[_0xa596('0x30')][_0xa596('0x41')]){_0x5bc68d[_0xa596('0x42')]=[{'all':!![]}];}return db[_0xa596('0x61')][_0xa596('0x43')](_0x5bc68d);})[_0xa596('0x21')](function(_0x214320){_0x46b663['rows']=_0x214320;return _0x46b663;});}})[_0xa596('0x21')](respondWithFilteredResult(_0x5cc0bc,_0x5bc68d))[_0xa596('0x45')](handleError(_0x5cc0bc,null));};exports[_0xa596('0x62')]=function(_0x3de964,_0x289709,_0x5eb10a){var _0x3132c3={};var _0x56115f={};var _0x441b24;var _0x3f3c5e;return db[_0xa596('0x2c')][_0xa596('0x58')]({'where':{'id':_0x3de964[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x289709,null))[_0xa596('0x21')](function(_0x314cc2){if(_0x314cc2){_0x441b24=_0x314cc2;_0x56115f['model']=_[_0xa596('0x31')](db[_0xa596('0x63')][_0xa596('0x47')]);_0x56115f['query']=_[_0xa596('0x31')](_0x3de964[_0xa596('0x30')]);_0x56115f[_0xa596('0x32')]=_['intersection'](_0x56115f[_0xa596('0x34')],_0x56115f['query']);_0x3132c3[_0xa596('0x35')]=_['intersection'](_0x56115f['model'],qs['fields'](_0x3de964[_0xa596('0x30')][_0xa596('0x36')]));_0x3132c3[_0xa596('0x35')]=_0x3132c3[_0xa596('0x35')]['length']?_0x3132c3['attributes']:_0x56115f[_0xa596('0x34')];_0x3132c3[_0xa596('0x3a')]=qs[_0xa596('0x3b')](_0x3de964['query'][_0xa596('0x3b')]);_0x3132c3[_0xa596('0x3c')]=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x3de964[_0xa596('0x30')],_0x56115f[_0xa596('0x32')]));if(_0x3de964['query'][_0xa596('0x3d')]){_0x3132c3[_0xa596('0x3c')]=_[_0xa596('0x3e')](_0x3132c3['where'],{'$or':_[_0xa596('0x2b')](_0x3132c3[_0xa596('0x35')],function(_0x2f6144){var _0x30c0cd={};_0x30c0cd[_0x2f6144]={'$like':'%'+_0x3de964[_0xa596('0x30')][_0xa596('0x3d')]+'%'};return _0x30c0cd;})});}_0x3132c3=_[_0xa596('0x3e')]({},_0x3132c3,_0x3de964[_0xa596('0x40')]);return _0x441b24[_0xa596('0x62')](_0x3132c3);}})[_0xa596('0x21')](function(_0x3866){if(_0x3866){_0x3f3c5e=_0x3866[_0xa596('0x37')];if(!_0x3de964[_0xa596('0x30')][_0xa596('0x38')](_0xa596('0x39'))){_0x3132c3[_0xa596('0x1a')]=qs[_0xa596('0x1a')](_0x3de964['query'][_0xa596('0x1a')]);_0x3132c3['offset']=qs[_0xa596('0x1d')](_0x3de964[_0xa596('0x30')][_0xa596('0x1d')]);}return _0x441b24[_0xa596('0x62')](_0x3132c3);}})[_0xa596('0x21')](function(_0x292805){if(_0x292805){return _0x292805?{'count':_0x3f3c5e,'rows':_0x292805}:null;}})[_0xa596('0x21')](respondWithResult(_0x289709,null))[_0xa596('0x45')](handleError(_0x289709,null));};exports['addLists']=function(_0x4ada32,_0x36b834,_0x4e6278){var _0x35e102,_0x151b6c;return db[_0xa596('0x2c')]['find']({'where':{'id':_0x4ada32['params']['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x36b834,null))[_0xa596('0x21')](function(_0x4ba32d){if(_0x4ba32d){_0x151b6c=_0x4ba32d;return _0x4ba32d[_0xa596('0x64')](_0x4ada32[_0xa596('0x4a')][_0xa596('0x65')],_[_0xa596('0x51')](_0x4ada32[_0xa596('0x4a')],['ids','id'])||{});}return null;})[_0xa596('0x66')](function(_0x1fda8f){var _0x2935af;_0x35e102=_0x1fda8f||[];var _0x4bf27b=[];if(_0x1fda8f){for(var _0x3acb7d=0x0;_0x3acb7d<_0x1fda8f[_0xa596('0x37')];_0x3acb7d+=0x1){var _0x23c41c=_0x1fda8f[_0x3acb7d]['get']({'plain':!![]});_0x151b6c[_0xa596('0x67')]=_0x4ada32['body'][_0xa596('0x67')]?_0x4ada32[_0xa596('0x4a')]['dialCheckDuplicateType']:_0x151b6c['dialCheckDuplicateType'];switch(_0x151b6c['dialCheckDuplicateType']){case _0xa596('0x68'):_0x2935af=squel['insert']()[_0xa596('0x69')](_0xa596('0x6a'))[_0xa596('0x6b')]([_0xa596('0x6c'),'scheduledAt',_0xa596('0x6d'),'ListId',_0xa596('0x5b'),_0xa596('0x52'),_0xa596('0x53')],squel[_0xa596('0x6e')]()[_0xa596('0x6f')](_0xa596('0x6c'),_0xa596('0x6c'))['field'](_0xa596('0x70'),_0xa596('0x71'))['field']('id',_0xa596('0x6d'))[_0xa596('0x6f')](_0x23c41c[_0xa596('0x72')][_0xa596('0x73')](),'ListId')[_0xa596('0x6f')](_0x4ada32[_0xa596('0x50')]['id'][_0xa596('0x73')](),'CampaignId')['field'](_0xa596('0x70'),_0xa596('0x52'))[_0xa596('0x6f')](_0xa596('0x70'),_0xa596('0x53'))[_0xa596('0x74')]('cm_contacts')[_0xa596('0x3c')](_0xa596('0x75'))[_0xa596('0x3c')]('ListId\x20=\x20?',_0x23c41c[_0xa596('0x72')]['toString']())['where'](_0xa596('0x76'))['where'](_0xa596('0x77'),squel[_0xa596('0x6e')]()[_0xa596('0x6f')](_0xa596('0x78'))[_0xa596('0x74')](_0xa596('0x79'))[_0xa596('0x3c')]('CampaignId\x20=\x20?',_0x4ada32[_0xa596('0x50')]['id'][_0xa596('0x73')]()))[_0xa596('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa596('0x6e')]()[_0xa596('0x6f')]('COALESCE(phone,\x27\x27)')[_0xa596('0x74')](_0xa596('0x6a'))[_0xa596('0x3c')](_0xa596('0x7a'),_0x4ada32['params']['id'][_0xa596('0x73')]())))[_0xa596('0x73')]();break;case _0xa596('0x7b'):_0x2935af=squel[_0xa596('0x7c')]()[_0xa596('0x69')](_0xa596('0x6a'))[_0xa596('0x6b')]([_0xa596('0x6c'),_0xa596('0x71'),_0xa596('0x6d'),_0xa596('0x7d'),_0xa596('0x5b'),_0xa596('0x52'),_0xa596('0x53')],squel[_0xa596('0x6e')]()[_0xa596('0x6f')](_0xa596('0x6c'),_0xa596('0x6c'))[_0xa596('0x6f')](_0xa596('0x70'),_0xa596('0x71'))['field']('id',_0xa596('0x6d'))[_0xa596('0x6f')](_0x23c41c[_0xa596('0x72')][_0xa596('0x73')](),_0xa596('0x7d'))[_0xa596('0x6f')](_0x4ada32[_0xa596('0x50')]['id']['toString'](),_0xa596('0x5b'))['field'](_0xa596('0x70'),_0xa596('0x52'))[_0xa596('0x6f')](_0xa596('0x70'),_0xa596('0x53'))[_0xa596('0x74')](_0xa596('0x7e'))['where'](_0xa596('0x75'))[_0xa596('0x3c')](_0xa596('0x7f'),_0x23c41c['CmListId'][_0xa596('0x73')]())[_0xa596('0x3c')](_0xa596('0x76'))[_0xa596('0x3c')](_0xa596('0x77'),squel['select']()['field'](_0xa596('0x80'))[_0xa596('0x74')](_0xa596('0x6a'))[_0xa596('0x3c')](_0xa596('0x7a'),_0x4ada32['params']['id'][_0xa596('0x73')]())))[_0xa596('0x73')]();break;default:_0x2935af=squel[_0xa596('0x7c')]()[_0xa596('0x69')](_0xa596('0x6a'))[_0xa596('0x6b')]([_0xa596('0x6c'),_0xa596('0x71'),_0xa596('0x6d'),_0xa596('0x7d'),_0xa596('0x5b'),_0xa596('0x52'),_0xa596('0x53')],squel[_0xa596('0x6e')]()[_0xa596('0x6f')](_0xa596('0x6c'),'phone')[_0xa596('0x6f')](_0xa596('0x70'),_0xa596('0x71'))['field']('id','ContactId')[_0xa596('0x6f')](_0x23c41c[_0xa596('0x72')]['toString'](),_0xa596('0x7d'))[_0xa596('0x6f')](_0x4ada32[_0xa596('0x50')]['id'][_0xa596('0x73')](),_0xa596('0x5b'))[_0xa596('0x6f')]('NOW()',_0xa596('0x52'))[_0xa596('0x6f')](_0xa596('0x70'),_0xa596('0x53'))[_0xa596('0x74')]('cm_contacts')['where'](_0xa596('0x75'))[_0xa596('0x3c')](_0xa596('0x7f'),_0x23c41c['CmListId'][_0xa596('0x73')]())[_0xa596('0x3c')](_0xa596('0x76')))[_0xa596('0x73')]();}_0x4bf27b[_0xa596('0x81')](db[_0xa596('0x82')]['query'](_0x2935af));}return BPromise[_0xa596('0x83')](_0x4bf27b);}})[_0xa596('0x21')](function(){return _0x35e102;})['then'](respondWithResult(_0x36b834,null))[_0xa596('0x45')](handleError(_0x36b834,null));};exports[_0xa596('0x84')]=function(_0x2b83c2,_0x44253d,_0x391745){return db[_0xa596('0x2c')][_0xa596('0x48')]({'where':{'id':_0x2b83c2[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x44253d,null))[_0xa596('0x21')](function(_0x572beb){if(_0x572beb){return _0x572beb[_0xa596('0x84')](_0x2b83c2[_0xa596('0x30')]['ids']);}})['then'](function(_0x3ff9a6){if(_0x3ff9a6){return db[_0xa596('0x59')]['destroy']({'where':{'ListId':_0x2b83c2['query']['ids'],'CampaignId':_0x2b83c2[_0xa596('0x50')]['id']}})[_0xa596('0x21')](function(){return _0x3ff9a6;});}})['then'](respondWithStatusCode(_0x44253d,null))[_0xa596('0x45')](handleError(_0x44253d,null));};exports[_0xa596('0x85')]=function(_0x3f170f,_0x24655a,_0x4c40ca){var _0x20388e={};var _0x553ba9={};var _0x4c9447;var _0x5cccb8;return db[_0xa596('0x2c')]['findOne']({'where':{'id':_0x3f170f[_0xa596('0x50')]['id']}})['then'](handleEntityNotFound(_0x24655a,null))[_0xa596('0x21')](function(_0x44c9f3){if(_0x44c9f3){_0x4c9447=_0x44c9f3;_0x553ba9[_0xa596('0x34')]=_['keys'](db[_0xa596('0x63')][_0xa596('0x47')]);_0x553ba9[_0xa596('0x30')]=_[_0xa596('0x31')](_0x3f170f[_0xa596('0x30')]);_0x553ba9[_0xa596('0x32')]=_['intersection'](_0x553ba9['model'],_0x553ba9[_0xa596('0x30')]);_0x20388e[_0xa596('0x35')]=_['intersection'](_0x553ba9['model'],qs[_0xa596('0x36')](_0x3f170f[_0xa596('0x30')][_0xa596('0x36')]));_0x20388e[_0xa596('0x35')]=_0x20388e[_0xa596('0x35')][_0xa596('0x37')]?_0x20388e['attributes']:_0x553ba9[_0xa596('0x34')];_0x20388e[_0xa596('0x3a')]=qs['sort'](_0x3f170f[_0xa596('0x30')][_0xa596('0x3b')]);_0x20388e[_0xa596('0x3c')]=qs[_0xa596('0x32')](_[_0xa596('0x5a')](_0x3f170f[_0xa596('0x30')],_0x553ba9[_0xa596('0x32')]));if(_0x3f170f[_0xa596('0x30')]['filter']){_0x20388e['where']=_[_0xa596('0x3e')](_0x20388e[_0xa596('0x3c')],{'$or':_[_0xa596('0x2b')](_0x20388e[_0xa596('0x35')],function(_0xf7a58e){var _0x85ae3d={};_0x85ae3d[_0xf7a58e]={'$like':'%'+_0x3f170f['query'][_0xa596('0x3d')]+'%'};return _0x85ae3d;})});}_0x20388e=_['merge']({},_0x20388e,_0x3f170f[_0xa596('0x40')]);return _0x4c9447['getBlackLists'](_0x20388e);}})[_0xa596('0x21')](function(_0x13156a){if(_0x13156a){_0x5cccb8=_0x13156a[_0xa596('0x37')];if(!_0x3f170f[_0xa596('0x30')][_0xa596('0x38')]('nolimit')){_0x20388e[_0xa596('0x1a')]=qs[_0xa596('0x1a')](_0x3f170f[_0xa596('0x30')][_0xa596('0x1a')]);_0x20388e[_0xa596('0x1d')]=qs[_0xa596('0x1d')](_0x3f170f[_0xa596('0x30')][_0xa596('0x1d')]);}return _0x4c9447[_0xa596('0x85')](_0x20388e);}})[_0xa596('0x21')](function(_0x10af4c){if(_0x10af4c){return _0x10af4c?{'count':_0x5cccb8,'rows':_0x10af4c}:null;}})[_0xa596('0x21')](respondWithResult(_0x24655a,null))[_0xa596('0x45')](handleError(_0x24655a,null));};exports[_0xa596('0x86')]=function(_0x43eb4a,_0x3768a8,_0x29070e){var _0x1f48b5,_0x2c9710;return db[_0xa596('0x2c')][_0xa596('0x48')]({'where':{'id':_0x43eb4a[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x3768a8,null))['then'](function(_0xe615b2){if(_0xe615b2){_0x2c9710=_0xe615b2;return _0xe615b2[_0xa596('0x86')](_0x43eb4a[_0xa596('0x4a')][_0xa596('0x65')],_[_0xa596('0x51')](_0x43eb4a[_0xa596('0x4a')],['ids','id'])||{});}return null;})[_0xa596('0x66')](function(_0x1e6fd3){var _0x48f69a;_0x1f48b5=_0x1e6fd3||[];var _0x204774=[];if(_0x1e6fd3){for(var _0x303d4e=0x0;_0x303d4e<_0x1e6fd3['length'];_0x303d4e+=0x1){var _0x33998c=_0x1e6fd3[_0x303d4e][_0xa596('0x22')]({'plain':!![]});_0x48f69a=squel['insert']()[_0xa596('0x69')]('cm_hopper_black')[_0xa596('0x6b')]([_0xa596('0x6c'),_0xa596('0x6d'),'ListId',_0xa596('0x5b'),_0xa596('0x52'),'updatedAt'],squel[_0xa596('0x6e')]()[_0xa596('0x6f')](_0xa596('0x6c'),_0xa596('0x6c'))['field']('id',_0xa596('0x6d'))[_0xa596('0x6f')](_0x33998c[_0xa596('0x72')][_0xa596('0x73')](),_0xa596('0x7d'))['field'](_0x43eb4a[_0xa596('0x50')]['id'][_0xa596('0x73')](),_0xa596('0x5b'))['field'](_0xa596('0x70'),_0xa596('0x52'))[_0xa596('0x6f')](_0xa596('0x70'),'updatedAt')[_0xa596('0x74')](_0xa596('0x7e'))[_0xa596('0x3c')](_0xa596('0x75'))[_0xa596('0x3c')](_0xa596('0x7f'),_0x33998c[_0xa596('0x72')][_0xa596('0x73')]())[_0xa596('0x3c')](_0xa596('0x76')))[_0xa596('0x73')]();_0x204774['push'](db[_0xa596('0x82')][_0xa596('0x30')](_0x48f69a));}return BPromise['all'](_0x204774);}})['then'](function(){return _0x1f48b5;})[_0xa596('0x21')](respondWithResult(_0x3768a8,null))[_0xa596('0x45')](handleError(_0x3768a8,null));};exports[_0xa596('0x87')]=function(_0x1717d5,_0x53b902,_0x1d09f4){return db[_0xa596('0x2c')][_0xa596('0x48')]({'where':{'id':_0x1717d5[_0xa596('0x50')]['id']}})[_0xa596('0x21')](handleEntityNotFound(_0x53b902,null))[_0xa596('0x21')](function(_0x38fd38){if(_0x38fd38){return _0x38fd38[_0xa596('0x87')](_0x1717d5[_0xa596('0x30')]['ids']);}})[_0xa596('0x21')](function(_0x1322de){if(_0x1322de){return db[_0xa596('0x61')][_0xa596('0x25')]({'where':{'ListId':_0x1717d5[_0xa596('0x30')][_0xa596('0x65')],'CampaignId':_0x1717d5[_0xa596('0x50')]['id']}})[_0xa596('0x21')](function(){return _0x1322de;});}})[_0xa596('0x21')](respondWithStatusCode(_0x53b902,null))[_0xa596('0x45')](handleError(_0x53b902,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 38929be..bcb608b 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0x7a54,0x106));var _0x47a5=function(_0x557435,_0x2b721f){_0x557435=_0x557435-0x0;var _0x3d1cce=_0x7a54[_0x557435];return _0x3d1cce;};'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 2224f82..1eb7f36 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 _0x3b75=['error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15b605,_0x312fe1){var _0x3d0bf2=function(_0x1dbfc8){while(--_0x1dbfc8){_0x15b605['push'](_0x15b605['shift']());}};_0x3d0bf2(++_0x312fe1);}(_0x3b75,0xdc));var _0x53b7=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x3b75[_0x152aa1];return _0x1bc01a;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['GetCampaign']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')]({'raw':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a['options'][_0x53b7('0x1b')]||null:null,'attributes':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1c')]||null:null,'limit':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1d')]||null:null,'include':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1e')]?_[_0x53b7('0x1f')](_0x4eaf6a[_0x53b7('0x19')]['include'],function(_0x41706f){return{'model':db[_0x41706f['model']],'as':_0x41706f['as'],'attributes':_0x41706f[_0x53b7('0x1c')],'include':_0x41706f[_0x53b7('0x1e')]?_['map'](_0x41706f['include'],function(_0x9f699d){return{'model':db[_0x9f699d[_0x53b7('0x20')]],'as':_0x9f699d['as'],'attributes':_0x9f699d[_0x53b7('0x1c')],'include':_0x9f699d[_0x53b7('0x1e')]?_['map'](_0x9f699d[_0x53b7('0x1e')],function(_0x465d87){return{'model':db[_0x465d87[_0x53b7('0x20')]],'as':_0x465d87['as'],'attributes':_0x465d87[_0x53b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53b7('0xb')](function(_0x39d382){logger['info'](_0x53b7('0x21'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x21'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x39d382));_0x45b608(_0x39d382);})[_0x53b7('0x16')](function(_0x1024b5){logger[_0x53b7('0x12')](_0x53b7('0x21'),_0x1024b5[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x1024b5[_0x53b7('0x14')]));});});}; \ No newline at end of file +var _0x94dc=['attributes','limit','include','map','model','GetCampaign','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x94dc,0xb1));var _0xc94d=function(_0x18f75b,_0xd4d87){_0x18f75b=_0x18f75b-0x0;var _0xbad23f=_0x94dc[_0x18f75b];return _0xbad23f;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Campaign,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Campaign,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['GetCampaign']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Campaign'][_0xc94d('0x17')]({'raw':_0x48b879[_0xc94d('0x18')]?_0x48b879['options'][_0xc94d('0x19')]===undefined?!![]:![]:!![],'where':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1a')]||null:null,'attributes':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1b')]||null:null,'limit':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1c')]||null:null,'include':_0x48b879['options']?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')],function(_0x557bfb){return{'model':db[_0x557bfb['model']],'as':_0x557bfb['as'],'attributes':_0x557bfb['attributes'],'include':_0x557bfb[_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x557bfb[_0xc94d('0x1d')],function(_0x1de964){return{'model':db[_0x1de964['model']],'as':_0x1de964['as'],'attributes':_0x1de964['attributes'],'include':_0x1de964[_0xc94d('0x1d')]?_['map'](_0x1de964[_0xc94d('0x1d')],function(_0x362ff4){return{'model':db[_0x362ff4[_0xc94d('0x1f')]],'as':_0x362ff4['as'],'attributes':_0x362ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc94d('0xc')](function(_0x196b59){logger[_0xc94d('0xd')](_0xc94d('0x20'),_0x48b879);logger[_0xc94d('0x10')]('GetCampaign',_0x48b879,JSON[_0xc94d('0x21')](_0x196b59));_0x4784a2(_0x196b59);})[_0xc94d('0x16')](function(_0x3a2342){logger[_0xc94d('0x12')](_0xc94d('0x20'),_0x3a2342['message'],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x3a2342[_0xc94d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 543848d..f68bda1 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 _0xa62c=['path','connect-timeout','express','Router','fs-extra','../../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','getLists','getBlackLists','create','clone','post','addLists','addBlackLists','put','update','delete','destroy','/:id/blacklists','removeBlackLists','exports','multer','util'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0xa62c,0x70));var _0xca62=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xa62c[_0x3c22e0];return _0x215811;};'use strict';var multer=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var path=require(_0xca62('0x2'));var timeout=require(_0xca62('0x3'));var express=require(_0xca62('0x4'));var router=express[_0xca62('0x5')]();var fs_extra=require(_0xca62('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xca62('0x7'));var config=require(_0xca62('0x8'));var controller=require(_0xca62('0x9'));router[_0xca62('0xa')]('/',auth[_0xca62('0xb')](),controller[_0xca62('0xc')]);router[_0xca62('0xa')](_0xca62('0xd'),auth['isAuthenticated'](),controller[_0xca62('0xe')]);router[_0xca62('0xa')](_0xca62('0xf'),auth['isAuthenticated'](),controller[_0xca62('0x10')]);router[_0xca62('0xa')](_0xca62('0x11'),auth['isAuthenticated'](),controller[_0xca62('0x12')]);router[_0xca62('0xa')](_0xca62('0x13'),auth[_0xca62('0xb')](),controller[_0xca62('0x14')]);router[_0xca62('0xa')](_0xca62('0x15'),auth[_0xca62('0xb')](),controller[_0xca62('0x16')]);router['get'](_0xca62('0x17'),auth[_0xca62('0xb')](),controller[_0xca62('0x18')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xca62('0x19')]);router['post']('/',auth[_0xca62('0xb')](),controller[_0xca62('0x1a')]);router['post']('/:id/clone',auth[_0xca62('0xb')](),controller[_0xca62('0x1b')]);router[_0xca62('0x1c')]('/:id/lists',auth[_0xca62('0xb')](),controller[_0xca62('0x1d')]);router[_0xca62('0x1c')]('/:id/blacklists',auth[_0xca62('0xb')](),controller[_0xca62('0x1e')]);router[_0xca62('0x1f')](_0xca62('0xd'),auth[_0xca62('0xb')](),controller[_0xca62('0x20')]);router[_0xca62('0x21')](_0xca62('0xd'),auth[_0xca62('0xb')](),controller[_0xca62('0x22')]);router[_0xca62('0x21')](_0xca62('0x17'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0xca62('0x23'),auth[_0xca62('0xb')](),controller[_0xca62('0x24')]);module[_0xca62('0x25')]=router; \ No newline at end of file +var _0xe207=['getBlackLists','create','post','clone','addLists','addBlackLists','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists'];(function(_0x499886,_0x229657){var _0x23a7f0=function(_0x3e067b){while(--_0x3e067b){_0x499886['push'](_0x499886['shift']());}};_0x23a7f0(++_0x229657);}(_0xe207,0x154));var _0x7e20=function(_0x3d10d1,_0x192eb3){_0x3d10d1=_0x3d10d1-0x0;var _0x85c07c=_0xe207[_0x3d10d1];return _0x85c07c;};'use strict';var multer=require(_0x7e20('0x0'));var util=require(_0x7e20('0x1'));var path=require(_0x7e20('0x2'));var timeout=require(_0x7e20('0x3'));var express=require(_0x7e20('0x4'));var router=express[_0x7e20('0x5')]();var fs_extra=require(_0x7e20('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0x7e20('0x7')](),controller[_0x7e20('0x8')]);router[_0x7e20('0x9')](_0x7e20('0xa'),auth[_0x7e20('0x7')](),controller[_0x7e20('0xb')]);router[_0x7e20('0x9')](_0x7e20('0xc'),auth[_0x7e20('0x7')](),controller[_0x7e20('0xd')]);router[_0x7e20('0x9')]('/:id/hopper_histories',auth[_0x7e20('0x7')](),controller[_0x7e20('0xe')]);router[_0x7e20('0x9')]('/:id/hopper_finals',auth[_0x7e20('0x7')](),controller[_0x7e20('0xf')]);router['get'](_0x7e20('0x10'),auth[_0x7e20('0x7')](),controller['getHopperBlacks']);router[_0x7e20('0x9')](_0x7e20('0x11'),auth[_0x7e20('0x7')](),controller[_0x7e20('0x12')]);router[_0x7e20('0x9')](_0x7e20('0x13'),auth[_0x7e20('0x7')](),controller[_0x7e20('0x14')]);router['post']('/',auth[_0x7e20('0x7')](),controller[_0x7e20('0x15')]);router[_0x7e20('0x16')]('/:id/clone',auth[_0x7e20('0x7')](),controller[_0x7e20('0x17')]);router[_0x7e20('0x16')](_0x7e20('0x11'),auth['isAuthenticated'](),controller[_0x7e20('0x18')]);router['post'](_0x7e20('0x13'),auth[_0x7e20('0x7')](),controller[_0x7e20('0x19')]);router[_0x7e20('0x1a')](_0x7e20('0xa'),auth[_0x7e20('0x7')](),controller[_0x7e20('0x1b')]);router[_0x7e20('0x1c')]('/:id',auth[_0x7e20('0x7')](),controller['destroy']);router['delete'](_0x7e20('0x11'),auth[_0x7e20('0x7')](),controller['removeLists']);router[_0x7e20('0x1c')](_0x7e20('0x13'),auth[_0x7e20('0x7')](),controller['removeBlackLists']);module[_0x7e20('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 32124f3..9ad15da 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 _0xe98f=['TEXT','VIRTUAL','exports'];(function(_0x5900b6,_0x542703){var _0x33347b=function(_0x4971d6){while(--_0x4971d6){_0x5900b6['push'](_0x5900b6['shift']());}};_0x33347b(++_0x542703);}(_0xe98f,0x9b));var _0xfe98=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe98f[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xfe98('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xfe98('0x2')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xcd15=['STRING','TEXT','getDataValue','key'];(function(_0x3605b5,_0x1b3f1c){var _0x3d65a9=function(_0x429e43){while(--_0x429e43){_0x3605b5['push'](_0x3605b5['shift']());}};_0x3d65a9(++_0x1b3f1c);}(_0xcd15,0xa4));var _0x5cd1=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xcd15[_0xcf5436];return _0xc4f5c8;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x5cd1('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x5cd1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5cd1('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5cd1('0x2')](_0x5cd1('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b17853f..92ac6bc 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 _0xe0c1=['options','CannedAnswer','count','findAll','rows','catch','show','params','filters','length','includeAll','include','merge','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter'];(function(_0x14a54b,_0x3eec32){var _0x5b5e4b=function(_0x1b3f00){while(--_0x1b3f00){_0x14a54b['push'](_0x14a54b['shift']());}};_0x5b5e4b(++_0x3eec32);}(_0xe0c1,0x74));var _0x1e0c=function(_0x2db18d,_0xc7c3f6){_0x2db18d=_0x2db18d-0x0;var _0x361708=_0xe0c1[_0x2db18d];return _0x361708;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e0c('0x0'));var zipdir=require(_0x1e0c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e0c('0x2'));var moment=require('moment');var BPromise=require(_0x1e0c('0x3'));var Mustache=require(_0x1e0c('0x4'));var util=require(_0x1e0c('0x5'));var path=require(_0x1e0c('0x6'));var sox=require(_0x1e0c('0x7'));var csv=require(_0x1e0c('0x8'));var ejs=require(_0x1e0c('0x9'));var fs=require('fs');var fs_extra=require(_0x1e0c('0xa'));var _=require(_0x1e0c('0xb'));var squel=require(_0x1e0c('0xc'));var crypto=require(_0x1e0c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1e0c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e0c('0xf'));var Papa=require(_0x1e0c('0x10'));var Redis=require(_0x1e0c('0x11'));var authService=require(_0x1e0c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e0c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1e0c('0x14'));var licenseUtil=require(_0x1e0c('0x15'));var db=require(_0x1e0c('0x16'))['db'];function respondWithStatusCode(_0x1b0627,_0xaade20){_0xaade20=_0xaade20||0xcc;return function(_0xb4d884){if(_0xb4d884){return _0x1b0627[_0x1e0c('0x17')](_0xaade20);}return _0x1b0627[_0x1e0c('0x18')](_0xaade20)['end']();};}function respondWithResult(_0x3681f1,_0x2e745b){_0x2e745b=_0x2e745b||0xc8;return function(_0x4c33b0){if(_0x4c33b0){return _0x3681f1[_0x1e0c('0x18')](_0x2e745b)[_0x1e0c('0x19')](_0x4c33b0);}};}function respondWithFilteredResult(_0x404fae,_0x448b39){return function(_0x59b645){if(_0x59b645){var _0x16d597=typeof _0x448b39[_0x1e0c('0x1a')]===_0x1e0c('0x1b')&&typeof _0x448b39[_0x1e0c('0x1c')]===_0x1e0c('0x1b');var _0x403778=_0x59b645['count'];var _0x13f89c=_0x16d597?0x0:_0x448b39['offset'];var _0x455b20=_0x16d597?_0x59b645['count']:_0x448b39[_0x1e0c('0x1a')]+_0x448b39[_0x1e0c('0x1c')];var _0x3b8cae;if(_0x455b20>=_0x403778){_0x455b20=_0x403778;_0x3b8cae=0xc8;}else{_0x3b8cae=0xce;}_0x404fae['status'](_0x3b8cae);return _0x404fae[_0x1e0c('0x1d')](_0x1e0c('0x1e'),_0x13f89c+'-'+_0x455b20+'/'+_0x403778)['json'](_0x59b645);}return null;};}function patchUpdates(_0x4883ed){return function(_0x388789){try{jsonpatch[_0x1e0c('0x1f')](_0x388789,_0x4883ed,!![]);}catch(_0x411583){return BPromise[_0x1e0c('0x20')](_0x411583);}return _0x388789[_0x1e0c('0x21')]();};}function saveUpdates(_0x54b634,_0x2de4c4){return function(_0xf9ad3a){if(_0xf9ad3a){return _0xf9ad3a[_0x1e0c('0x22')](_0x54b634)[_0x1e0c('0x23')](function(_0x18183f){return _0x18183f;});}return null;};}function removeEntity(_0x3c0dea,_0x435a59){return function(_0xdee72){if(_0xdee72){return _0xdee72[_0x1e0c('0x24')]()[_0x1e0c('0x23')](function(){var _0x3ccade=_0xdee72[_0x1e0c('0x25')]({'plain':!![]});var _0x2f84aa=_0x1e0c('0x26');return db[_0x1e0c('0x27')][_0x1e0c('0x24')]({'where':{'type':_0x2f84aa,'resourceId':_0x3ccade['id']}})['then'](function(){return _0xdee72;});})[_0x1e0c('0x23')](function(){_0x3c0dea[_0x1e0c('0x18')](0xcc)[_0x1e0c('0x28')]();});}};}function handleEntityNotFound(_0xd4f1cb,_0xa8f00){return function(_0x29afa0){if(!_0x29afa0){_0xd4f1cb[_0x1e0c('0x17')](0x194);}return _0x29afa0;};}function handleError(_0x1b3736,_0x8b04f0){_0x8b04f0=_0x8b04f0||0x1f4;return function(_0x432d9b){logger[_0x1e0c('0x29')](_0x432d9b['stack']);if(_0x432d9b[_0x1e0c('0x2a')]){delete _0x432d9b['name'];}_0x1b3736[_0x1e0c('0x18')](_0x8b04f0)[_0x1e0c('0x2b')](_0x432d9b);};}exports[_0x1e0c('0x2c')]=function(_0x3dec34,_0x1a9e06){var _0x14ef49={},_0xff8d2b={},_0x53a84d={'count':0x0,'rows':[]};var _0x553f12=_[_0x1e0c('0x2d')](db['CannedAnswer'][_0x1e0c('0x2e')],function(_0x16f24d){return{'name':_0x16f24d[_0x1e0c('0x2f')],'type':_0x16f24d[_0x1e0c('0x30')]['key']};});_0xff8d2b[_0x1e0c('0x31')]=_[_0x1e0c('0x2d')](_0x553f12,_0x1e0c('0x2a'));_0xff8d2b['query']=_[_0x1e0c('0x32')](_0x3dec34[_0x1e0c('0x33')]);_0xff8d2b['filters']=_[_0x1e0c('0x34')](_0xff8d2b[_0x1e0c('0x31')],_0xff8d2b[_0x1e0c('0x33')]);_0x14ef49[_0x1e0c('0x35')]=_[_0x1e0c('0x34')](_0xff8d2b['model'],qs[_0x1e0c('0x36')](_0x3dec34['query'][_0x1e0c('0x36')]));_0x14ef49[_0x1e0c('0x35')]=_0x14ef49['attributes']['length']?_0x14ef49[_0x1e0c('0x35')]:_0xff8d2b['model'];if(!_0x3dec34[_0x1e0c('0x33')][_0x1e0c('0x37')]('nolimit')){_0x14ef49[_0x1e0c('0x1c')]=qs['limit'](_0x3dec34[_0x1e0c('0x33')]['limit']);_0x14ef49[_0x1e0c('0x1a')]=qs['offset'](_0x3dec34[_0x1e0c('0x33')][_0x1e0c('0x1a')]);}_0x14ef49[_0x1e0c('0x38')]=qs[_0x1e0c('0x39')](_0x3dec34['query'][_0x1e0c('0x39')]);_0x14ef49['where']=qs['filters'](_['pick'](_0x3dec34[_0x1e0c('0x33')],_0xff8d2b['filters']),_0x553f12);if(_0x3dec34['query']['filter']){_0x14ef49['where']=_['merge'](_0x14ef49[_0x1e0c('0x3a')],{'$or':[{'key':{'$like':'%'+_0x3dec34[_0x1e0c('0x33')][_0x1e0c('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3dec34[_0x1e0c('0x33')][_0x1e0c('0x3b')]+'%'}}]});}_0x14ef49=_['merge']({},_0x14ef49,_0x3dec34[_0x1e0c('0x3c')]);var _0x3cd799={'where':_0x14ef49['where']};return db[_0x1e0c('0x3d')][_0x1e0c('0x3e')](_0x3cd799)[_0x1e0c('0x23')](function(_0x40046e){_0x53a84d[_0x1e0c('0x3e')]=_0x40046e;if(_0x3dec34[_0x1e0c('0x33')]['includeAll']){_0x14ef49['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1e0c('0x3f')](_0x14ef49);})[_0x1e0c('0x23')](function(_0x205521){_0x53a84d[_0x1e0c('0x40')]=_0x205521;return _0x53a84d;})[_0x1e0c('0x23')](respondWithFilteredResult(_0x1a9e06,_0x14ef49))[_0x1e0c('0x41')](handleError(_0x1a9e06,null));};exports[_0x1e0c('0x42')]=function(_0x5c7528,_0x122e8f){var _0xb6f228={'raw':!![],'where':{'id':_0x5c7528[_0x1e0c('0x43')]['id']}},_0x6937f1={};_0x6937f1[_0x1e0c('0x31')]=_[_0x1e0c('0x32')](db['CannedAnswer'][_0x1e0c('0x2e')]);_0x6937f1['query']=_[_0x1e0c('0x32')](_0x5c7528[_0x1e0c('0x33')]);_0x6937f1[_0x1e0c('0x44')]=_['intersection'](_0x6937f1[_0x1e0c('0x31')],_0x6937f1[_0x1e0c('0x33')]);_0xb6f228['attributes']=_[_0x1e0c('0x34')](_0x6937f1[_0x1e0c('0x31')],qs[_0x1e0c('0x36')](_0x5c7528[_0x1e0c('0x33')][_0x1e0c('0x36')]));_0xb6f228[_0x1e0c('0x35')]=_0xb6f228[_0x1e0c('0x35')][_0x1e0c('0x45')]?_0xb6f228[_0x1e0c('0x35')]:_0x6937f1[_0x1e0c('0x31')];if(_0x5c7528[_0x1e0c('0x33')][_0x1e0c('0x46')]){_0xb6f228[_0x1e0c('0x47')]=[{'all':!![]}];}_0xb6f228=_[_0x1e0c('0x48')]({},_0xb6f228,_0x5c7528[_0x1e0c('0x3c')]);return db[_0x1e0c('0x3d')][_0x1e0c('0x49')](_0xb6f228)[_0x1e0c('0x23')](handleEntityNotFound(_0x122e8f,null))['then'](respondWithResult(_0x122e8f,null))[_0x1e0c('0x41')](handleError(_0x122e8f,null));};exports['update']=function(_0x4af4fd,_0x485c95){if(_0x4af4fd['body']['id']){delete _0x4af4fd[_0x1e0c('0x4a')]['id'];}return db[_0x1e0c('0x3d')]['find']({'where':{'id':_0x4af4fd[_0x1e0c('0x43')]['id']}})[_0x1e0c('0x23')](handleEntityNotFound(_0x485c95,null))[_0x1e0c('0x23')](saveUpdates(_0x4af4fd[_0x1e0c('0x4a')],null))[_0x1e0c('0x23')](respondWithResult(_0x485c95,null))['catch'](handleError(_0x485c95,null));};exports['destroy']=function(_0x1a4f7d,_0x1b19a4){return db[_0x1e0c('0x3d')][_0x1e0c('0x49')]({'where':{'id':_0x1a4f7d[_0x1e0c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b19a4,null))[_0x1e0c('0x23')](removeEntity(_0x1b19a4,null))[_0x1e0c('0x41')](handleError(_0x1b19a4,null));};exports[_0x1e0c('0x4b')]=function(_0x45e032,_0x271757){var _0x54be18={'key':_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x4c')]};if(_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x4d')]){_0x54be18[_0x1e0c('0x4d')]=_0x45e032['body'][_0x1e0c('0x4d')];}else if(_0x45e032[_0x1e0c('0x4a')]['SmsAccountId']){_0x54be18['SmsAccountId']=_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x4e')];}else if(_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x4f')]){_0x54be18[_0x1e0c('0x4f')]=_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x4f')];}else if(_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x50')]){_0x54be18[_0x1e0c('0x50')]=_0x45e032[_0x1e0c('0x4a')][_0x1e0c('0x50')];}return db[_0x1e0c('0x3d')][_0x1e0c('0x49')]({'where':_0x54be18})[_0x1e0c('0x23')](function(_0x3793aa){if(_0x3793aa){throw new db[(_0x1e0c('0x51'))][(_0x1e0c('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x1e0c('0x3d')][_0x1e0c('0x4b')](_0x45e032[_0x1e0c('0x4a')]);})[_0x1e0c('0x23')](function(_0x4e2c68){var _0x4e7778=_0x45e032['user'][_0x1e0c('0x25')]({'plain':!![]});if(!_0x4e7778)throw new Error(_0x1e0c('0x53'));if(_0x4e7778['role']===_0x1e0c('0x54')){var _0x2a8962=_0x4e2c68[_0x1e0c('0x25')]({'plain':!![]});return db[_0x1e0c('0x55')][_0x1e0c('0x49')]({'where':{'name':_0x1e0c('0x26'),'userProfileId':_0x4e7778['userProfileId']},'raw':!![]})[_0x1e0c('0x23')](function(_0x5c4782){if(_0x5c4782&&_0x5c4782[_0x1e0c('0x56')]===0x0){return db[_0x1e0c('0x27')][_0x1e0c('0x4b')]({'name':_0x2a8962[_0x1e0c('0x2a')],'resourceId':_0x2a8962['id'],'type':_0x5c4782[_0x1e0c('0x2a')],'sectionId':_0x5c4782['id']},{})[_0x1e0c('0x23')](function(){return _0x4e2c68;});}else{return _0x4e2c68;}})[_0x1e0c('0x41')](function(_0x1674df){logger[_0x1e0c('0x29')](_0x1e0c('0x57'),_0x1674df);throw _0x1674df;});}return _0x4e2c68;})[_0x1e0c('0x23')](respondWithResult(_0x271757,0xc9))[_0x1e0c('0x41')](handleError(_0x271757,null));}; \ No newline at end of file +var _0x4cee=['reject','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','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/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','apply'];(function(_0x582143,_0x110efa){var _0x5c15e6=function(_0x2c5c9a){while(--_0x2c5c9a){_0x582143['push'](_0x582143['shift']());}};_0x5c15e6(++_0x110efa);}(_0x4cee,0xe5));var _0xe4ce=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4cee[_0x24f31b];return _0x488401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4ce('0x0'));var zipdir=require(_0xe4ce('0x1'));var jsonpatch=require(_0xe4ce('0x2'));var rp=require(_0xe4ce('0x3'));var moment=require('moment');var BPromise=require(_0xe4ce('0x4'));var Mustache=require(_0xe4ce('0x5'));var util=require('util');var path=require(_0xe4ce('0x6'));var sox=require(_0xe4ce('0x7'));var csv=require(_0xe4ce('0x8'));var ejs=require(_0xe4ce('0x9'));var fs=require('fs');var fs_extra=require(_0xe4ce('0xa'));var _=require(_0xe4ce('0xb'));var squel=require(_0xe4ce('0xc'));var crypto=require(_0xe4ce('0xd'));var jsforce=require(_0xe4ce('0xe'));var deskjs=require(_0xe4ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe4ce('0x10'));var Papa=require(_0xe4ce('0x11'));var Redis=require(_0xe4ce('0x12'));var authService=require(_0xe4ce('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe4ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe4ce('0x15'))('api');var utils=require(_0xe4ce('0x16'));var config=require(_0xe4ce('0x17'));var licenseUtil=require(_0xe4ce('0x18'));var db=require(_0xe4ce('0x19'))['db'];function respondWithStatusCode(_0x46fdaa,_0x58af4b){_0x58af4b=_0x58af4b||0xcc;return function(_0x2112c1){if(_0x2112c1){return _0x46fdaa[_0xe4ce('0x1a')](_0x58af4b);}return _0x46fdaa[_0xe4ce('0x1b')](_0x58af4b)[_0xe4ce('0x1c')]();};}function respondWithResult(_0x3e2e04,_0x438aa8){_0x438aa8=_0x438aa8||0xc8;return function(_0xc48dfc){if(_0xc48dfc){return _0x3e2e04[_0xe4ce('0x1b')](_0x438aa8)[_0xe4ce('0x1d')](_0xc48dfc);}};}function respondWithFilteredResult(_0x579fb0,_0x3eb55a){return function(_0x23e696){if(_0x23e696){var _0x576dda=typeof _0x3eb55a['offset']===_0xe4ce('0x1e')&&typeof _0x3eb55a[_0xe4ce('0x1f')]===_0xe4ce('0x1e');var _0xe1f1a5=_0x23e696['count'];var _0x3b9a71=_0x576dda?0x0:_0x3eb55a['offset'];var _0x13002c=_0x576dda?_0x23e696['count']:_0x3eb55a[_0xe4ce('0x20')]+_0x3eb55a[_0xe4ce('0x1f')];var _0x5190aa;if(_0x13002c>=_0xe1f1a5){_0x13002c=_0xe1f1a5;_0x5190aa=0xc8;}else{_0x5190aa=0xce;}_0x579fb0[_0xe4ce('0x1b')](_0x5190aa);return _0x579fb0[_0xe4ce('0x21')]('Content-Range',_0x3b9a71+'-'+_0x13002c+'/'+_0xe1f1a5)[_0xe4ce('0x1d')](_0x23e696);}return null;};}function patchUpdates(_0x2de9d6){return function(_0x848e1){try{jsonpatch[_0xe4ce('0x22')](_0x848e1,_0x2de9d6,!![]);}catch(_0x1c3291){return BPromise[_0xe4ce('0x23')](_0x1c3291);}return _0x848e1['save']();};}function saveUpdates(_0x3f21cb,_0xb27d27){return function(_0x3ecf9f){if(_0x3ecf9f){return _0x3ecf9f[_0xe4ce('0x24')](_0x3f21cb)[_0xe4ce('0x25')](function(_0x4ad29){return _0x4ad29;});}return null;};}function removeEntity(_0x22e4a8,_0x50d1e0){return function(_0x5da16d){if(_0x5da16d){return _0x5da16d['destroy']()['then'](function(){var _0x332ba5=_0x5da16d[_0xe4ce('0x26')]({'plain':!![]});var _0x25d3c2=_0xe4ce('0x27');return db[_0xe4ce('0x28')][_0xe4ce('0x29')]({'where':{'type':_0x25d3c2,'resourceId':_0x332ba5['id']}})[_0xe4ce('0x25')](function(){return _0x5da16d;});})[_0xe4ce('0x25')](function(){_0x22e4a8[_0xe4ce('0x1b')](0xcc)[_0xe4ce('0x1c')]();});}};}function handleEntityNotFound(_0xaeb096,_0x4fa04a){return function(_0x4454b9){if(!_0x4454b9){_0xaeb096[_0xe4ce('0x1a')](0x194);}return _0x4454b9;};}function handleError(_0x375849,_0x559734){_0x559734=_0x559734||0x1f4;return function(_0x52dfd6){logger['error'](_0x52dfd6[_0xe4ce('0x2a')]);if(_0x52dfd6[_0xe4ce('0x2b')]){delete _0x52dfd6[_0xe4ce('0x2b')];}_0x375849['status'](_0x559734)[_0xe4ce('0x2c')](_0x52dfd6);};}exports[_0xe4ce('0x2d')]=function(_0x24e333,_0x37b779){var _0x4f01c5={},_0x3af081={},_0x5898f3={'count':0x0,'rows':[]};var _0x34bb03=_[_0xe4ce('0x2e')](db['CannedAnswer'][_0xe4ce('0x2f')],function(_0x1f30cf){return{'name':_0x1f30cf[_0xe4ce('0x30')],'type':_0x1f30cf[_0xe4ce('0x31')][_0xe4ce('0x32')]};});_0x3af081[_0xe4ce('0x33')]=_['map'](_0x34bb03,'name');_0x3af081[_0xe4ce('0x34')]=_[_0xe4ce('0x35')](_0x24e333['query']);_0x3af081[_0xe4ce('0x36')]=_[_0xe4ce('0x37')](_0x3af081[_0xe4ce('0x33')],_0x3af081['query']);_0x4f01c5[_0xe4ce('0x38')]=_['intersection'](_0x3af081[_0xe4ce('0x33')],qs[_0xe4ce('0x39')](_0x24e333[_0xe4ce('0x34')]['fields']));_0x4f01c5[_0xe4ce('0x38')]=_0x4f01c5[_0xe4ce('0x38')][_0xe4ce('0x3a')]?_0x4f01c5['attributes']:_0x3af081['model'];if(!_0x24e333['query'][_0xe4ce('0x3b')]('nolimit')){_0x4f01c5[_0xe4ce('0x1f')]=qs['limit'](_0x24e333[_0xe4ce('0x34')]['limit']);_0x4f01c5[_0xe4ce('0x20')]=qs[_0xe4ce('0x20')](_0x24e333[_0xe4ce('0x34')][_0xe4ce('0x20')]);}_0x4f01c5['order']=qs[_0xe4ce('0x3c')](_0x24e333[_0xe4ce('0x34')][_0xe4ce('0x3c')]);_0x4f01c5[_0xe4ce('0x3d')]=qs[_0xe4ce('0x36')](_[_0xe4ce('0x3e')](_0x24e333['query'],_0x3af081[_0xe4ce('0x36')]),_0x34bb03);if(_0x24e333['query'][_0xe4ce('0x3f')]){_0x4f01c5['where']=_[_0xe4ce('0x40')](_0x4f01c5[_0xe4ce('0x3d')],{'$or':[{'key':{'$like':'%'+_0x24e333[_0xe4ce('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x24e333[_0xe4ce('0x34')][_0xe4ce('0x3f')]+'%'}}]});}_0x4f01c5=_['merge']({},_0x4f01c5,_0x24e333[_0xe4ce('0x41')]);var _0x1818ea={'where':_0x4f01c5[_0xe4ce('0x3d')]};return db[_0xe4ce('0x42')]['count'](_0x1818ea)[_0xe4ce('0x25')](function(_0x59b58d){_0x5898f3['count']=_0x59b58d;if(_0x24e333['query'][_0xe4ce('0x43')]){_0x4f01c5['include']=[{'all':!![]}];}return db[_0xe4ce('0x42')][_0xe4ce('0x44')](_0x4f01c5);})['then'](function(_0x35d8b3){_0x5898f3[_0xe4ce('0x45')]=_0x35d8b3;return _0x5898f3;})['then'](respondWithFilteredResult(_0x37b779,_0x4f01c5))[_0xe4ce('0x46')](handleError(_0x37b779,null));};exports['show']=function(_0x31bb33,_0x213ae3){var _0x21b7bd={'raw':!![],'where':{'id':_0x31bb33[_0xe4ce('0x47')]['id']}},_0x24dbac={};_0x24dbac[_0xe4ce('0x33')]=_[_0xe4ce('0x35')](db[_0xe4ce('0x42')][_0xe4ce('0x2f')]);_0x24dbac[_0xe4ce('0x34')]=_['keys'](_0x31bb33[_0xe4ce('0x34')]);_0x24dbac['filters']=_[_0xe4ce('0x37')](_0x24dbac[_0xe4ce('0x33')],_0x24dbac['query']);_0x21b7bd[_0xe4ce('0x38')]=_['intersection'](_0x24dbac['model'],qs[_0xe4ce('0x39')](_0x31bb33[_0xe4ce('0x34')][_0xe4ce('0x39')]));_0x21b7bd['attributes']=_0x21b7bd['attributes'][_0xe4ce('0x3a')]?_0x21b7bd['attributes']:_0x24dbac[_0xe4ce('0x33')];if(_0x31bb33[_0xe4ce('0x34')][_0xe4ce('0x43')]){_0x21b7bd['include']=[{'all':!![]}];}_0x21b7bd=_[_0xe4ce('0x40')]({},_0x21b7bd,_0x31bb33['options']);return db[_0xe4ce('0x42')][_0xe4ce('0x48')](_0x21b7bd)[_0xe4ce('0x25')](handleEntityNotFound(_0x213ae3,null))[_0xe4ce('0x25')](respondWithResult(_0x213ae3,null))[_0xe4ce('0x46')](handleError(_0x213ae3,null));};exports[_0xe4ce('0x24')]=function(_0x49bb85,_0x2271f3){if(_0x49bb85['body']['id']){delete _0x49bb85[_0xe4ce('0x49')]['id'];}return db[_0xe4ce('0x42')][_0xe4ce('0x48')]({'where':{'id':_0x49bb85[_0xe4ce('0x47')]['id']}})[_0xe4ce('0x25')](handleEntityNotFound(_0x2271f3,null))['then'](saveUpdates(_0x49bb85['body'],null))[_0xe4ce('0x25')](respondWithResult(_0x2271f3,null))[_0xe4ce('0x46')](handleError(_0x2271f3,null));};exports[_0xe4ce('0x29')]=function(_0x1c40e0,_0x11b02f){return db[_0xe4ce('0x42')][_0xe4ce('0x48')]({'where':{'id':_0x1c40e0[_0xe4ce('0x47')]['id']}})[_0xe4ce('0x25')](handleEntityNotFound(_0x11b02f,null))[_0xe4ce('0x25')](removeEntity(_0x11b02f,null))['catch'](handleError(_0x11b02f,null));};exports[_0xe4ce('0x4a')]=function(_0x3736bc,_0x52fc07){var _0x2b4010={'key':_0x3736bc[_0xe4ce('0x49')]['key']};if(_0x3736bc[_0xe4ce('0x49')]['MailAccountId']){_0x2b4010['MailAccountId']=_0x3736bc[_0xe4ce('0x49')][_0xe4ce('0x4b')];}else if(_0x3736bc[_0xe4ce('0x49')][_0xe4ce('0x4c')]){_0x2b4010[_0xe4ce('0x4c')]=_0x3736bc[_0xe4ce('0x49')]['SmsAccountId'];}else if(_0x3736bc[_0xe4ce('0x49')][_0xe4ce('0x4d')]){_0x2b4010['OpenchannelAccountId']=_0x3736bc[_0xe4ce('0x49')][_0xe4ce('0x4d')];}else if(_0x3736bc[_0xe4ce('0x49')][_0xe4ce('0x4e')]){_0x2b4010[_0xe4ce('0x4e')]=_0x3736bc[_0xe4ce('0x49')]['ChatWebsiteId'];}return db[_0xe4ce('0x42')]['find']({'where':_0x2b4010})[_0xe4ce('0x25')](function(_0x5e1ea2){if(_0x5e1ea2){throw new db[(_0xe4ce('0x4f'))][(_0xe4ce('0x50'))](_0xe4ce('0x51'));}return db[_0xe4ce('0x42')][_0xe4ce('0x4a')](_0x3736bc['body']);})[_0xe4ce('0x25')](function(_0x5a337a){var _0x503697=_0x3736bc[_0xe4ce('0x52')][_0xe4ce('0x26')]({'plain':!![]});if(!_0x503697)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x503697[_0xe4ce('0x53')]==='user'){var _0x47a408=_0x5a337a[_0xe4ce('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xe4ce('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x503697[_0xe4ce('0x54')]},'raw':!![]})[_0xe4ce('0x25')](function(_0x4b569b){if(_0x4b569b&&_0x4b569b[_0xe4ce('0x55')]===0x0){return db[_0xe4ce('0x28')][_0xe4ce('0x4a')]({'name':_0x47a408[_0xe4ce('0x2b')],'resourceId':_0x47a408['id'],'type':_0x4b569b[_0xe4ce('0x2b')],'sectionId':_0x4b569b['id']},{})[_0xe4ce('0x25')](function(){return _0x5a337a;});}else{return _0x5a337a;}})[_0xe4ce('0x46')](function(_0x566e41){logger[_0xe4ce('0x56')](_0xe4ce('0x57'),_0x566e41);throw _0x566e41;});}return _0x5a337a;})[_0xe4ce('0x25')](respondWithResult(_0x52fc07,0xc9))[_0xe4ce('0x46')](handleError(_0x52fc07,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 601167a..19ae60f 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 _0x7c11=['moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','api'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x7c11,0x1c5));var _0x17c1=function(_0x56684e,_0x3e6e67){_0x56684e=_0x56684e-0x0;var _0x4e84dc=_0x7c11[_0x56684e];return _0x4e84dc;};'use strict';var _=require('lodash');var util=require(_0x17c1('0x0'));var logger=require('../../config/logger')(_0x17c1('0x1'));var moment=require(_0x17c1('0x2'));var BPromise=require(_0x17c1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17c1('0x4'));var rimraf=require(_0x17c1('0x5'));var config=require(_0x17c1('0x6'));var attributes=require(_0x17c1('0x7'));module[_0x17c1('0x8')]=function(_0x4846be,_0x3a3af1){return _0x4846be[_0x17c1('0x9')](_0x17c1('0xa'),attributes,{'tableName':_0x17c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x17c1('0xc')});}; \ No newline at end of file +var _0x6ecb=['api','moment','bluebird','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger'];(function(_0x431811,_0x103e1e){var _0x5b489c=function(_0x27a36){while(--_0x27a36){_0x431811['push'](_0x431811['shift']());}};_0x5b489c(++_0x103e1e);}(_0x6ecb,0x14f));var _0xb6ec=function(_0x274c31,_0xf74ab8){_0x274c31=_0x274c31-0x0;var _0x3b36df=_0x6ecb[_0x274c31];return _0x3b36df;};'use strict';var _=require(_0xb6ec('0x0'));var util=require(_0xb6ec('0x1'));var logger=require(_0xb6ec('0x2'))(_0xb6ec('0x3'));var moment=require(_0xb6ec('0x4'));var BPromise=require(_0xb6ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb6ec('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6ec('0x7'));module[_0xb6ec('0x8')]=function(_0x5bab6,_0x2e7b4e){return _0x5bab6[_0xb6ec('0x9')](_0xb6ec('0xa'),attributes,{'tableName':_0xb6ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6ec('0xc'),'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 376ac8b..b7571c0 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(_0x490657,_0x189e4d){var _0x8c2aca=function(_0x30acf){while(--_0x30acf){_0x490657['push'](_0x490657['shift']());}};_0x8c2aca(++_0x189e4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x1cd554,_0x497ee4){var _0x18a802=function(_0x488bbb){while(--_0x488bbb){_0x1cd554['push'](_0x1cd554['shift']());}};_0x18a802(++_0x497ee4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 68ed2b2..dfae9c8 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 _0x0f13=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x37737e,_0x22c163){var _0x1b8daa=function(_0x39993d){while(--_0x39993d){_0x37737e['push'](_0x37737e['shift']());}};_0x1b8daa(++_0x22c163);}(_0x0f13,0x6a));var _0x30f1=function(_0x3ed7c2,_0x14ee82){_0x3ed7c2=_0x3ed7c2-0x0;var _0x334c0f=_0x0f13[_0x3ed7c2];return _0x334c0f;};'use strict';var multer=require('multer');var util=require(_0x30f1('0x0'));var path=require(_0x30f1('0x1'));var timeout=require(_0x30f1('0x2'));var express=require(_0x30f1('0x3'));var router=express[_0x30f1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x30f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x30f1('0x6'));var controller=require('./cannedAnswer.controller');router[_0x30f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x30f1('0x8')]);router[_0x30f1('0x7')]('/:id',auth[_0x30f1('0x9')](),controller[_0x30f1('0xa')]);router[_0x30f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x30f1('0xc')]);router[_0x30f1('0xd')](_0x30f1('0xe'),auth[_0x30f1('0x9')](),controller[_0x30f1('0xf')]);router[_0x30f1('0x10')]('/:id',auth[_0x30f1('0x9')](),controller['destroy']);module[_0x30f1('0x11')]=router; \ No newline at end of file +var _0xa0f3=['index','show','post','update','/:id','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x4d7707,_0x9784ca){var _0x5d3421=function(_0x57dd26){while(--_0x57dd26){_0x4d7707['push'](_0x4d7707['shift']());}};_0x5d3421(++_0x9784ca);}(_0xa0f3,0xab));var _0x3a0f=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa0f3[_0x5b561d];return _0x431060;};'use strict';var multer=require('multer');var util=require(_0x3a0f('0x0'));var path=require(_0x3a0f('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a0f('0x2'));var router=express[_0x3a0f('0x3')]();var fs_extra=require(_0x3a0f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a0f('0x5'));var config=require('../../config/environment');var controller=require(_0x3a0f('0x6'));router[_0x3a0f('0x7')]('/',auth[_0x3a0f('0x8')](),controller[_0x3a0f('0x9')]);router[_0x3a0f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3a0f('0xa')]);router[_0x3a0f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x3a0f('0x8')](),controller[_0x3a0f('0xc')]);router['delete'](_0x3a0f('0xd'),auth[_0x3a0f('0x8')](),controller['destroy']);module[_0x3a0f('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index af39ded..455e9c4 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 _0x5cbc=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x22a9bf,_0x18d676){var _0x3ad498=function(_0x481aae){while(--_0x481aae){_0x22a9bf['push'](_0x22a9bf['shift']());}};_0x3ad498(++_0x18d676);}(_0x5cbc,0xfb));var _0xc5cb=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x5cbc[_0x547e20];return _0x359171;};'use strict';var Sequelize=require(_0xc5cb('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xc5cb('0x1')],'allowNull':![],'defaultValue':_0xc5cb('0x2')},'clid':{'type':Sequelize[_0xc5cb('0x3')]},'src':{'type':Sequelize[_0xc5cb('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xc5cb('0x3')]},'channel':{'type':Sequelize[_0xc5cb('0x3')]},'dstchannel':{'type':Sequelize[_0xc5cb('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc5cb('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc5cb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc5cb('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc5cb('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc5cb('0x3')]},'linkedid':{'type':Sequelize[_0xc5cb('0x3')]},'sequence':{'type':Sequelize[_0xc5cb('0x3')]},'peeraccount':{'type':Sequelize[_0xc5cb('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc5cb('0x3')]}}; \ No newline at end of file +var _0x92ab=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4a2b0f,_0x341e54){var _0x4cda12=function(_0x1d6c3c){while(--_0x1d6c3c){_0x4a2b0f['push'](_0x4a2b0f['shift']());}};_0x4cda12(++_0x341e54);}(_0x92ab,0x193));var _0xb92a=function(_0x2004d7,_0x356115){_0x2004d7=_0x2004d7-0x0;var _0x1ce8b3=_0x92ab[_0x2004d7];return _0x1ce8b3;};'use strict';var Sequelize=require(_0xb92a('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb92a('0x1')},'clid':{'type':Sequelize[_0xb92a('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb92a('0x2')]},'dcontext':{'type':Sequelize[_0xb92a('0x2')]},'channel':{'type':Sequelize[_0xb92a('0x2')]},'dstchannel':{'type':Sequelize[_0xb92a('0x2')]},'lastapp':{'type':Sequelize[_0xb92a('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb92a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb92a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb92a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb92a('0x2')]},'userfield':{'type':Sequelize[_0xb92a('0x2')]},'uniqueid':{'type':Sequelize[_0xb92a('0x2')]},'linkedid':{'type':Sequelize[_0xb92a('0x2')]},'sequence':{'type':Sequelize[_0xb92a('0x2')]},'peeraccount':{'type':Sequelize[_0xb92a('0x2')]},'type':{'type':Sequelize[_0xb92a('0x2')]},'tag':{'type':Sequelize[_0xb92a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e139cb6..0dc00ec 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 _0x3c94=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Cdr','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x4baf6b,_0x440b09){var _0x5ad1b9=function(_0x247bb5){while(--_0x247bb5){_0x4baf6b['push'](_0x4baf6b['shift']());}};_0x5ad1b9(++_0x440b09);}(_0x3c94,0xcd));var _0x43c9=function(_0x1c7386,_0x298a93){_0x1c7386=_0x1c7386-0x0;var _0x2b6b71=_0x3c94[_0x1c7386];return _0x2b6b71;};'use strict';var emlformat=require(_0x43c9('0x0'));var rimraf=require(_0x43c9('0x1'));var zipdir=require(_0x43c9('0x2'));var jsonpatch=require(_0x43c9('0x3'));var rp=require(_0x43c9('0x4'));var moment=require(_0x43c9('0x5'));var BPromise=require(_0x43c9('0x6'));var Mustache=require(_0x43c9('0x7'));var util=require(_0x43c9('0x8'));var path=require(_0x43c9('0x9'));var sox=require(_0x43c9('0xa'));var csv=require(_0x43c9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43c9('0xc'));var _=require(_0x43c9('0xd'));var squel=require(_0x43c9('0xe'));var crypto=require(_0x43c9('0xf'));var jsforce=require(_0x43c9('0x10'));var deskjs=require(_0x43c9('0x11'));var toCsv=require(_0x43c9('0xb'));var querystring=require(_0x43c9('0x12'));var Papa=require(_0x43c9('0x13'));var Redis=require('ioredis');var authService=require(_0x43c9('0x14'));var qs=require(_0x43c9('0x15'));var as=require(_0x43c9('0x16'));var hardwareService=require(_0x43c9('0x17'));var logger=require(_0x43c9('0x18'))(_0x43c9('0x19'));var utils=require(_0x43c9('0x1a'));var config=require(_0x43c9('0x1b'));var licenseUtil=require(_0x43c9('0x1c'));var db=require(_0x43c9('0x1d'))['db'];function respondWithStatusCode(_0x62bb3b,_0x31faa1){_0x31faa1=_0x31faa1||0xcc;return function(_0x11fe24){if(_0x11fe24){return _0x62bb3b[_0x43c9('0x1e')](_0x31faa1);}return _0x62bb3b[_0x43c9('0x1f')](_0x31faa1)[_0x43c9('0x20')]();};}function respondWithResult(_0x275b2b,_0x569fa9){_0x569fa9=_0x569fa9||0xc8;return function(_0x37932f){if(_0x37932f){return _0x275b2b[_0x43c9('0x1f')](_0x569fa9)[_0x43c9('0x21')](_0x37932f);}};}function respondWithFilteredResult(_0xe02707,_0x3f908d){return function(_0x5cc1fa){if(_0x5cc1fa){var _0x549d3f=typeof _0x3f908d[_0x43c9('0x22')]===_0x43c9('0x23')&&typeof _0x3f908d[_0x43c9('0x24')]===_0x43c9('0x23');var _0x501856=_0x5cc1fa[_0x43c9('0x25')];var _0x1da149=_0x549d3f?0x0:_0x3f908d[_0x43c9('0x22')];var _0x22bf3d=_0x549d3f?_0x5cc1fa[_0x43c9('0x25')]:_0x3f908d[_0x43c9('0x22')]+_0x3f908d[_0x43c9('0x24')];var _0x1e3996;if(_0x22bf3d>=_0x501856){_0x22bf3d=_0x501856;_0x1e3996=0xc8;}else{_0x1e3996=0xce;}_0xe02707[_0x43c9('0x1f')](_0x1e3996);return _0xe02707[_0x43c9('0x26')](_0x43c9('0x27'),_0x1da149+'-'+_0x22bf3d+'/'+_0x501856)['json'](_0x5cc1fa);}return null;};}function patchUpdates(_0x39c6f1){return function(_0x772b71){try{jsonpatch[_0x43c9('0x28')](_0x772b71,_0x39c6f1,!![]);}catch(_0x4c2d7c){return BPromise[_0x43c9('0x29')](_0x4c2d7c);}return _0x772b71[_0x43c9('0x2a')]();};}function saveUpdates(_0x2ef8d9,_0x5705c6){return function(_0x28290a){if(_0x28290a){return _0x28290a[_0x43c9('0x2b')](_0x2ef8d9)[_0x43c9('0x2c')](function(_0x4d58d7){return _0x4d58d7;});}return null;};}function removeEntity(_0x4963d2,_0x2a40f4){return function(_0x3fd641){if(_0x3fd641){return _0x3fd641[_0x43c9('0x2d')]()['then'](function(){_0x4963d2[_0x43c9('0x1f')](0xcc)[_0x43c9('0x20')]();});}};}function handleEntityNotFound(_0x1e676a,_0x16fee9){return function(_0x2c69af){if(!_0x2c69af){_0x1e676a['sendStatus'](0x194);}return _0x2c69af;};}function handleError(_0x386078,_0x3b5c47){_0x3b5c47=_0x3b5c47||0x1f4;return function(_0x3910af){logger[_0x43c9('0x2e')](_0x3910af[_0x43c9('0x2f')]);if(_0x3910af[_0x43c9('0x30')]){delete _0x3910af[_0x43c9('0x30')];}_0x386078[_0x43c9('0x1f')](_0x3b5c47)[_0x43c9('0x31')](_0x3910af);};}exports[_0x43c9('0x32')]=function(_0x4eb970,_0x11e3c3){var _0x2cbfd7={},_0x15028c={},_0x519e2c={'count':0x0,'rows':[]};var _0x2c0ccc=_[_0x43c9('0x33')](db['Cdr'][_0x43c9('0x34')],function(_0x497719){return{'name':_0x497719[_0x43c9('0x35')],'type':_0x497719[_0x43c9('0x36')][_0x43c9('0x37')]};});_0x15028c[_0x43c9('0x38')]=_['map'](_0x2c0ccc,_0x43c9('0x30'));_0x15028c[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0x4eb970['query']);_0x15028c[_0x43c9('0x3b')]=_['intersection'](_0x15028c[_0x43c9('0x38')],_0x15028c[_0x43c9('0x39')]);_0x2cbfd7[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x15028c['model'],qs[_0x43c9('0x3e')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x2cbfd7[_0x43c9('0x3c')]=_0x2cbfd7['attributes'][_0x43c9('0x3f')]?_0x2cbfd7[_0x43c9('0x3c')]:_0x15028c[_0x43c9('0x38')];if(!_0x4eb970[_0x43c9('0x39')][_0x43c9('0x40')](_0x43c9('0x41'))){_0x2cbfd7[_0x43c9('0x24')]=qs[_0x43c9('0x24')](_0x4eb970['query'][_0x43c9('0x24')]);_0x2cbfd7[_0x43c9('0x22')]=qs[_0x43c9('0x22')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x22')]);}_0x2cbfd7[_0x43c9('0x42')]=qs[_0x43c9('0x43')](_0x4eb970[_0x43c9('0x39')][_0x43c9('0x43')]);_0x2cbfd7['where']=qs[_0x43c9('0x3b')](_['pick'](_0x4eb970[_0x43c9('0x39')],_0x15028c[_0x43c9('0x3b')]),_0x2c0ccc);if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]){_0x2cbfd7[_0x43c9('0x45')]=_[_0x43c9('0x46')](_0x2cbfd7[_0x43c9('0x45')],{'$or':_[_0x43c9('0x33')](_0x2c0ccc,function(_0x518bd3){if(_0x518bd3['type']!==_0x43c9('0x47')){var _0x2d63bd={};_0x2d63bd[_0x518bd3['name']]={'$like':'%'+_0x4eb970[_0x43c9('0x39')][_0x43c9('0x44')]+'%'};return _0x2d63bd;}})});}_0x2cbfd7=_[_0x43c9('0x46')]({},_0x2cbfd7,_0x4eb970['options']);var _0xb01a6e={'where':_0x2cbfd7[_0x43c9('0x45')]};return db[_0x43c9('0x48')][_0x43c9('0x25')](_0xb01a6e)[_0x43c9('0x2c')](function(_0x39601e){_0x519e2c[_0x43c9('0x25')]=_0x39601e;if(_0x4eb970[_0x43c9('0x39')][_0x43c9('0x49')]){_0x2cbfd7[_0x43c9('0x4a')]=[{'all':!![]}];}return db[_0x43c9('0x48')][_0x43c9('0x4b')](_0x2cbfd7);})['then'](function(_0x2d5dd5){_0x519e2c[_0x43c9('0x4c')]=_0x2d5dd5;return _0x519e2c;})[_0x43c9('0x2c')](respondWithFilteredResult(_0x11e3c3,_0x2cbfd7))[_0x43c9('0x4d')](handleError(_0x11e3c3,null));};exports['show']=function(_0xff891d,_0x66cac9){var _0x5ce14f={'raw':!![],'where':{'id':_0xff891d[_0x43c9('0x4e')]['id']}},_0x2a8f7d={};_0x2a8f7d[_0x43c9('0x38')]=_[_0x43c9('0x3a')](db[_0x43c9('0x48')][_0x43c9('0x34')]);_0x2a8f7d[_0x43c9('0x39')]=_[_0x43c9('0x3a')](_0xff891d[_0x43c9('0x39')]);_0x2a8f7d['filters']=_[_0x43c9('0x3d')](_0x2a8f7d['model'],_0x2a8f7d[_0x43c9('0x39')]);_0x5ce14f[_0x43c9('0x3c')]=_[_0x43c9('0x3d')](_0x2a8f7d[_0x43c9('0x38')],qs['fields'](_0xff891d[_0x43c9('0x39')][_0x43c9('0x3e')]));_0x5ce14f['attributes']=_0x5ce14f[_0x43c9('0x3c')][_0x43c9('0x3f')]?_0x5ce14f['attributes']:_0x2a8f7d[_0x43c9('0x38')];if(_0xff891d[_0x43c9('0x39')][_0x43c9('0x49')]){_0x5ce14f['include']=[{'all':!![]}];}_0x5ce14f=_[_0x43c9('0x46')]({},_0x5ce14f,_0xff891d['options']);return db['Cdr'][_0x43c9('0x4f')](_0x5ce14f)[_0x43c9('0x2c')](handleEntityNotFound(_0x66cac9,null))[_0x43c9('0x2c')](respondWithResult(_0x66cac9,null))[_0x43c9('0x4d')](handleError(_0x66cac9,null));};exports[_0x43c9('0x50')]=function(_0x28fe5d,_0x1f966e){return db[_0x43c9('0x48')][_0x43c9('0x50')](_0x28fe5d[_0x43c9('0x51')],{})[_0x43c9('0x2c')](respondWithResult(_0x1f966e,0xc9))[_0x43c9('0x4d')](handleError(_0x1f966e,null));};exports[_0x43c9('0x2b')]=function(_0x5082e9,_0xc57086){if(_0x5082e9[_0x43c9('0x51')]['id']){delete _0x5082e9['body']['id'];}return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x5082e9[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0xc57086,null))[_0x43c9('0x2c')](saveUpdates(_0x5082e9[_0x43c9('0x51')],null))[_0x43c9('0x2c')](respondWithResult(_0xc57086,null))[_0x43c9('0x4d')](handleError(_0xc57086,null));};exports[_0x43c9('0x2d')]=function(_0x508b62,_0x27db89){return db[_0x43c9('0x48')][_0x43c9('0x4f')]({'where':{'id':_0x508b62[_0x43c9('0x4e')]['id']}})[_0x43c9('0x2c')](handleEntityNotFound(_0x27db89,null))[_0x43c9('0x2c')](removeEntity(_0x27db89,null))['catch'](handleError(_0x27db89,null));};exports[_0x43c9('0x52')]=function(_0x1bc3b5,_0x3aff2e){return db[_0x43c9('0x48')][_0x43c9('0x52')]()[_0x43c9('0x2c')](respondWithResult(_0x3aff2e,null))[_0x43c9('0x4d')](handleError(_0x3aff2e,null));}; \ No newline at end of file +var _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x549444,_0x41c180){var _0x2348d2=function(_0x12e035){while(--_0x12e035){_0x549444['push'](_0x549444['shift']());}};_0x2348d2(++_0x41c180);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x13bc96,_0x4f3e8c){_0x13bc96=_0x13bc96-0x0;var _0x2ff1e1=_0x3c6c[_0x13bc96];return _0x2ff1e1;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['Cdr'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['Cdr'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b46c5e8..f11a272 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(_0xe4dc62,_0x543aa4){var _0x1ea798=function(_0x10f96b){while(--_0x10f96b){_0xe4dc62['push'](_0xe4dc62['shift']());}};_0x1ea798(++_0x543aa4);}(_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':'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(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 4696dd7..aee84f0 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 _0x9a52=['http','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client'];(function(_0x1318c4,_0x46c0d1){var _0x3ef069=function(_0x598c82){while(--_0x598c82){_0x1318c4['push'](_0x1318c4['shift']());}};_0x3ef069(++_0x46c0d1);}(_0x9a52,0x19a));var _0x29a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x29a5('0x0'));var util=require(_0x29a5('0x1'));var moment=require('moment');var BPromise=require(_0x29a5('0x2'));var rs=require(_0x29a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29a5('0x4'))(_0x29a5('0x5'));var config=require(_0x29a5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29a5('0x7')][_0x29a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfe5f80,_0x12d631,_0x369a3c){return new BPromise(function(_0xce93b6,_0x252a6a){return client['request'](_0xfe5f80,_0x369a3c)['then'](function(_0xa952dc){logger[_0x29a5('0x9')](_0x29a5('0xa'),_0x12d631,'request\x20sent');logger[_0x29a5('0xb')](_0x29a5('0xc'),_0x12d631,_0x29a5('0xd'),JSON[_0x29a5('0xe')](_0xa952dc));if(_0xa952dc[_0x29a5('0xf')]){if(_0xa952dc[_0x29a5('0xf')][_0x29a5('0x10')]===0x1f4){logger['error'](_0x29a5('0xa'),_0x12d631,_0xa952dc[_0x29a5('0xf')][_0x29a5('0x11')]);return _0x252a6a(_0xa952dc['error']['message']);}logger[_0x29a5('0xf')](_0x29a5('0xa'),_0x12d631,_0xa952dc[_0x29a5('0xf')][_0x29a5('0x11')]);return _0xce93b6(_0xa952dc[_0x29a5('0xf')][_0x29a5('0x11')]);}else{logger[_0x29a5('0x9')](_0x29a5('0xa'),_0x12d631,_0x29a5('0xd'));_0xce93b6(_0xa952dc['result'][_0x29a5('0x11')]);}})[_0x29a5('0x12')](function(_0x2856f7){logger[_0x29a5('0xf')](_0x29a5('0xa'),_0x12d631,_0x2856f7);_0x252a6a(_0x2856f7);});});} \ No newline at end of file +var _0xaeca=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaeca,0x197));var _0xaaec=function(_0x444e1c,_0x1aadb2){_0x444e1c=_0x444e1c-0x0;var _0x5a8b5d=_0xaeca[_0x444e1c];return _0x5a8b5d;};'use strict';var _=require(_0xaaec('0x0'));var util=require('util');var moment=require(_0xaaec('0x1'));var BPromise=require(_0xaaec('0x2'));var rs=require(_0xaaec('0x3'));var fs=require('fs');var Redis=require(_0xaaec('0x4'));var db=require(_0xaaec('0x5'))['db'];var utils=require(_0xaaec('0x6'));var logger=require(_0xaaec('0x7'))('rpc');var config=require(_0xaaec('0x8'));var jayson=require(_0xaaec('0x9'));var client=jayson['client'][_0xaaec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24a52a,_0x52a565,_0x5997a1){return new BPromise(function(_0x3c1f5e,_0x4af967){return client['request'](_0x24a52a,_0x5997a1)[_0xaaec('0xb')](function(_0x28eb48){logger[_0xaaec('0xc')](_0xaaec('0xd'),_0x52a565,_0xaaec('0xe'));logger[_0xaaec('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x52a565,_0xaaec('0xe'),JSON[_0xaaec('0x10')](_0x28eb48));if(_0x28eb48[_0xaaec('0x11')]){if(_0x28eb48['error']['code']===0x1f4){logger[_0xaaec('0x11')](_0xaaec('0xd'),_0x52a565,_0x28eb48['error'][_0xaaec('0x12')]);return _0x4af967(_0x28eb48['error'][_0xaaec('0x12')]);}logger['error'](_0xaaec('0xd'),_0x52a565,_0x28eb48[_0xaaec('0x11')][_0xaaec('0x12')]);return _0x3c1f5e(_0x28eb48['error'][_0xaaec('0x12')]);}else{logger[_0xaaec('0xc')](_0xaaec('0xd'),_0x52a565,'request\x20sent');_0x3c1f5e(_0x28eb48[_0xaaec('0x13')][_0xaaec('0x12')]);}})[_0xaaec('0x14')](function(_0xa4f2d2){logger[_0xaaec('0x11')]('Cdr,\x20%s,\x20%s',_0x52a565,_0xa4f2d2);_0x4af967(_0xa4f2d2);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 57d54ca..1878044 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(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x51f632,_0x5a14d5){var _0x24cf36=function(_0x3f2799){while(--_0x3f2799){_0x51f632['push'](_0x51f632['shift']());}};_0x24cf36(++_0x5a14d5);}(_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 a5ebde4..a44b56e 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 _0x8d87=['noop','TEXT','*,*,*,*','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d87,0x193));var _0x78d8=function(_0x1a660d,_0x182bba){_0x1a660d=_0x1a660d-0x0;var _0x3c1a19=_0x8d87[_0x1a660d];return _0x3c1a19;};'use strict';var Sequelize=require('sequelize');module[_0x78d8('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x78d8('0x1')],'allowNull':![],'defaultValue':_0x78d8('0x2')},'appdata':{'type':Sequelize[_0x78d8('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x78d8('0x4')}}; \ No newline at end of file +var _0xd5a8=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x47ef23,_0x2fcf9d){var _0x4875dd=function(_0x3814a1){while(--_0x3814a1){_0x47ef23['push'](_0x47ef23['shift']());}};_0x4875dd(++_0x2fcf9d);}(_0xd5a8,0x7e));var _0x8d5a=function(_0x4f2503,_0x5050fe){_0x4f2503=_0x4f2503-0x0;var _0x32ca04=_0xd5a8[_0x4f2503];return _0x32ca04;};'use strict';var Sequelize=require(_0x8d5a('0x0'));module[_0x8d5a('0x1')]={'priority':{'type':Sequelize[_0x8d5a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8d5a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8d5a('0x3')]},'interval':{'type':Sequelize[_0x8d5a('0x3')],'defaultValue':_0x8d5a('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 46047e1..33fc197 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 _0xbefe=['sendStatus','error','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy'];(function(_0x39b352,_0x5db49d){var _0x4a39d3=function(_0x277004){while(--_0x277004){_0x39b352['push'](_0x39b352['shift']());}};_0x4a39d3(++_0x5db49d);}(_0xbefe,0x168));var _0xebef=function(_0xe4f7a3,_0x449042){_0xe4f7a3=_0xe4f7a3-0x0;var _0xb1da7c=_0xbefe[_0xe4f7a3];return _0xb1da7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];function respondWithStatusCode(_0x1dcae4,_0x566dbe){_0x566dbe=_0x566dbe||0xcc;return function(_0x584ac2){if(_0x584ac2){return _0x1dcae4['sendStatus'](_0x566dbe);}return _0x1dcae4['status'](_0x566dbe)[_0xebef('0x1a')]();};}function respondWithResult(_0x124634,_0x31772a){_0x31772a=_0x31772a||0xc8;return function(_0x35cd7a){if(_0x35cd7a){return _0x124634[_0xebef('0x1b')](_0x31772a)[_0xebef('0x1c')](_0x35cd7a);}};}function respondWithFilteredResult(_0x5813eb,_0x32ec37){return function(_0x9411d4){if(_0x9411d4){var _0x1921aa=typeof _0x32ec37[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x32ec37[_0xebef('0x1f')]===_0xebef('0x1e');var _0x1e4ddf=_0x9411d4[_0xebef('0x20')];var _0x16856f=_0x1921aa?0x0:_0x32ec37[_0xebef('0x1d')];var _0x5161f1=_0x1921aa?_0x9411d4[_0xebef('0x20')]:_0x32ec37[_0xebef('0x1d')]+_0x32ec37[_0xebef('0x1f')];var _0x502c1e;if(_0x5161f1>=_0x1e4ddf){_0x5161f1=_0x1e4ddf;_0x502c1e=0xc8;}else{_0x502c1e=0xce;}_0x5813eb[_0xebef('0x1b')](_0x502c1e);return _0x5813eb[_0xebef('0x21')](_0xebef('0x22'),_0x16856f+'-'+_0x5161f1+'/'+_0x1e4ddf)[_0xebef('0x1c')](_0x9411d4);}return null;};}function patchUpdates(_0x7ca0cc){return function(_0x138760){try{jsonpatch[_0xebef('0x23')](_0x138760,_0x7ca0cc,!![]);}catch(_0x4cc18e){return BPromise['reject'](_0x4cc18e);}return _0x138760['save']();};}function saveUpdates(_0x59e078,_0x2f1193){return function(_0x38f0b8){if(_0x38f0b8){return _0x38f0b8[_0xebef('0x24')](_0x59e078)[_0xebef('0x25')](function(_0x1ee3b){return _0x1ee3b;});}return null;};}function removeEntity(_0xe8dcbf,_0x5c5091){return function(_0x460104){if(_0x460104){return _0x460104[_0xebef('0x26')]()[_0xebef('0x25')](function(){_0xe8dcbf[_0xebef('0x1b')](0xcc)[_0xebef('0x1a')]();});}};}function handleEntityNotFound(_0x27f212,_0x36ca6b){return function(_0x42d2af){if(!_0x42d2af){_0x27f212[_0xebef('0x27')](0x194);}return _0x42d2af;};}function handleError(_0x2d63a8,_0x456a81){_0x456a81=_0x456a81||0x1f4;return function(_0x4fb77f){logger[_0xebef('0x28')](_0x4fb77f['stack']);if(_0x4fb77f['name']){delete _0x4fb77f['name'];}_0x2d63a8['status'](_0x456a81)['send'](_0x4fb77f);};}exports['show']=function(_0x55732a,_0x5703fc){var _0x506e64={'raw':!![],'where':{'id':_0x55732a['params']['id']}},_0x5a9249={};_0x5a9249[_0xebef('0x29')]=_['keys'](db[_0xebef('0x2a')]['rawAttributes']);_0x5a9249[_0xebef('0x2b')]=_[_0xebef('0x2c')](_0x55732a['query']);_0x5a9249[_0xebef('0x2d')]=_['intersection'](_0x5a9249[_0xebef('0x29')],_0x5a9249[_0xebef('0x2b')]);_0x506e64[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5a9249[_0xebef('0x29')],qs[_0xebef('0x30')](_0x55732a['query'][_0xebef('0x30')]));_0x506e64['attributes']=_0x506e64[_0xebef('0x2e')][_0xebef('0x31')]?_0x506e64[_0xebef('0x2e')]:_0x5a9249[_0xebef('0x29')];if(_0x55732a[_0xebef('0x2b')][_0xebef('0x32')]){_0x506e64[_0xebef('0x33')]=[{'all':!![]}];}_0x506e64=_['merge']({},_0x506e64,_0x55732a[_0xebef('0x34')]);return db[_0xebef('0x2a')][_0xebef('0x35')](_0x506e64)[_0xebef('0x25')](handleEntityNotFound(_0x5703fc,null))[_0xebef('0x25')](respondWithResult(_0x5703fc,null))[_0xebef('0x36')](handleError(_0x5703fc,null));};exports[_0xebef('0x24')]=function(_0x48aa2f,_0x53ad2b){if(_0x48aa2f[_0xebef('0x37')]['id']){delete _0x48aa2f['body']['id'];}return db[_0xebef('0x2a')][_0xebef('0x35')]({'where':{'id':_0x48aa2f[_0xebef('0x38')]['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x53ad2b,null))[_0xebef('0x25')](saveUpdates(_0x48aa2f['body'],null))[_0xebef('0x25')](respondWithResult(_0x53ad2b,null))[_0xebef('0x36')](handleError(_0x53ad2b,null));};exports['destroy']=function(_0x5a4750,_0x890f2f){return db['ChatApplication']['find']({'where':{'id':_0x5a4750['params']['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x890f2f,null))['then'](removeEntity(_0x890f2f,null))['catch'](handleError(_0x890f2f,null));}; \ No newline at end of file +var _0x8164=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x517a9b,_0x2376cd){var _0x19f650=function(_0x59be8c){while(--_0x59be8c){_0x517a9b['push'](_0x517a9b['shift']());}};_0x19f650(++_0x2376cd);}(_0x8164,0x170));var _0x4816=function(_0x135ebc,_0x123430){_0x135ebc=_0x135ebc-0x0;var _0x210162=_0x8164[_0x135ebc];return _0x210162;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c173b,_0x51a5f8){_0x51a5f8=_0x51a5f8||0xcc;return function(_0x5c4d42){if(_0x5c4d42){return _0x3c173b[_0x4816('0x15')](_0x51a5f8);}return _0x3c173b['status'](_0x51a5f8)[_0x4816('0x16')]();};}function respondWithResult(_0x2554b4,_0x13a685){_0x13a685=_0x13a685||0xc8;return function(_0x316f36){if(_0x316f36){return _0x2554b4[_0x4816('0x17')](_0x13a685)[_0x4816('0x18')](_0x316f36);}};}function respondWithFilteredResult(_0x1eb683,_0x2a58b7){return function(_0x45c006){if(_0x45c006){var _0x21354c=typeof _0x2a58b7[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x2a58b7[_0x4816('0x1b')]===_0x4816('0x1a');var _0x1961a5=_0x45c006[_0x4816('0x1c')];var _0x4803d0=_0x21354c?0x0:_0x2a58b7['offset'];var _0x8d4393=_0x21354c?_0x45c006[_0x4816('0x1c')]:_0x2a58b7[_0x4816('0x19')]+_0x2a58b7[_0x4816('0x1b')];var _0xc8ffd5;if(_0x8d4393>=_0x1961a5){_0x8d4393=_0x1961a5;_0xc8ffd5=0xc8;}else{_0xc8ffd5=0xce;}_0x1eb683[_0x4816('0x17')](_0xc8ffd5);return _0x1eb683[_0x4816('0x1d')](_0x4816('0x1e'),_0x4803d0+'-'+_0x8d4393+'/'+_0x1961a5)[_0x4816('0x18')](_0x45c006);}return null;};}function patchUpdates(_0x53189e){return function(_0x1ab50d){try{jsonpatch['apply'](_0x1ab50d,_0x53189e,!![]);}catch(_0x521472){return BPromise[_0x4816('0x1f')](_0x521472);}return _0x1ab50d[_0x4816('0x20')]();};}function saveUpdates(_0x5de184,_0x2bbaf4){return function(_0x576221){if(_0x576221){return _0x576221[_0x4816('0x21')](_0x5de184)[_0x4816('0x22')](function(_0x571c81){return _0x571c81;});}return null;};}function removeEntity(_0x504851,_0xe484b2){return function(_0x2c8dc4){if(_0x2c8dc4){return _0x2c8dc4[_0x4816('0x23')]()['then'](function(){_0x504851[_0x4816('0x17')](0xcc)[_0x4816('0x16')]();});}};}function handleEntityNotFound(_0x126c60,_0x3f07f1){return function(_0x571a05){if(!_0x571a05){_0x126c60['sendStatus'](0x194);}return _0x571a05;};}function handleError(_0x901967,_0x47701a){_0x47701a=_0x47701a||0x1f4;return function(_0x590349){logger[_0x4816('0x24')](_0x590349['stack']);if(_0x590349['name']){delete _0x590349[_0x4816('0x25')];}_0x901967[_0x4816('0x17')](_0x47701a)[_0x4816('0x26')](_0x590349);};}exports['show']=function(_0xbeb8fb,_0x521259){var _0x39ddbd={'raw':!![],'where':{'id':_0xbeb8fb['params']['id']}},_0x229086={};_0x229086[_0x4816('0x27')]=_[_0x4816('0x28')](db[_0x4816('0x29')][_0x4816('0x2a')]);_0x229086[_0x4816('0x2b')]=_[_0x4816('0x28')](_0xbeb8fb[_0x4816('0x2b')]);_0x229086[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x229086['model'],_0x229086[_0x4816('0x2b')]);_0x39ddbd[_0x4816('0x2e')]=_['intersection'](_0x229086['model'],qs[_0x4816('0x2f')](_0xbeb8fb[_0x4816('0x2b')][_0x4816('0x2f')]));_0x39ddbd[_0x4816('0x2e')]=_0x39ddbd[_0x4816('0x2e')]['length']?_0x39ddbd['attributes']:_0x229086['model'];if(_0xbeb8fb[_0x4816('0x2b')][_0x4816('0x30')]){_0x39ddbd[_0x4816('0x31')]=[{'all':!![]}];}_0x39ddbd=_[_0x4816('0x32')]({},_0x39ddbd,_0xbeb8fb[_0x4816('0x33')]);return db[_0x4816('0x29')]['find'](_0x39ddbd)[_0x4816('0x22')](handleEntityNotFound(_0x521259,null))['then'](respondWithResult(_0x521259,null))[_0x4816('0x34')](handleError(_0x521259,null));};exports[_0x4816('0x21')]=function(_0x37a212,_0x30d55f){if(_0x37a212[_0x4816('0x35')]['id']){delete _0x37a212['body']['id'];}return db[_0x4816('0x29')]['find']({'where':{'id':_0x37a212['params']['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x30d55f,null))['then'](saveUpdates(_0x37a212['body'],null))['then'](respondWithResult(_0x30d55f,null))['catch'](handleError(_0x30d55f,null));};exports[_0x4816('0x23')]=function(_0x3e6a11,_0x589f7d){return db[_0x4816('0x29')][_0x4816('0x36')]({'where':{'id':_0x3e6a11['params']['id']}})[_0x4816('0x22')](handleEntityNotFound(_0x589f7d,null))[_0x4816('0x22')](removeEntity(_0x589f7d,null))[_0x4816('0x34')](handleError(_0x589f7d,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4f49a86..0ddbdc1 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 _0x807b=['path','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x11ddae,_0x4b8ae4){var _0x437c1a=function(_0x5ad06f){while(--_0x5ad06f){_0x11ddae['push'](_0x11ddae['shift']());}};_0x437c1a(++_0x4b8ae4);}(_0x807b,0x13f));var _0xb807=function(_0x26d561,_0x32d756){_0x26d561=_0x26d561-0x0;var _0x1c8f0=_0x807b[_0x26d561];return _0x1c8f0;};'use strict';var _=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var moment=require('moment');var BPromise=require(_0xb807('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb807('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb807('0x6'));module[_0xb807('0x7')]=function(_0xa845ff,_0x309df0){return _0xa845ff[_0xb807('0x8')]('ChatApplication',attributes,{'tableName':_0xb807('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb807('0xa'),'collate':_0xb807('0xb')});}; \ No newline at end of file +var _0x7c5d=['../../config/environment','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x559e51,_0x2836f7){var _0x3d228c=function(_0x1f2a44){while(--_0x1f2a44){_0x559e51['push'](_0x559e51['shift']());}};_0x3d228c(++_0x2836f7);}(_0x7c5d,0x1aa));var _0xd7c5=function(_0x22b681,_0x230c47){_0x22b681=_0x22b681-0x0;var _0x23b2a5=_0x7c5d[_0x22b681];return _0x23b2a5;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var logger=require(_0xd7c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd7c5('0x2'));var rp=require(_0xd7c5('0x3'));var fs=require('fs');var path=require(_0xd7c5('0x4'));var rimraf=require(_0xd7c5('0x5'));var config=require(_0xd7c5('0x6'));var attributes=require('./chatApplication.attributes');module[_0xd7c5('0x7')]=function(_0x27b31b,_0x2bbadb){return _0x27b31b[_0xd7c5('0x8')]('ChatApplication',attributes,{'tableName':_0xd7c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7c5('0xa'),'collate':_0xd7c5('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b876b54..a23098c 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 _0x61a8=['ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x61a8,0xd6));var _0x861a=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x61a8[_0x5d860f];return _0x236490;};'use strict';var _=require(_0x861a('0x0'));var util=require(_0x861a('0x1'));var moment=require('moment');var BPromise=require(_0x861a('0x2'));var rs=require(_0x861a('0x3'));var fs=require('fs');var Redis=require(_0x861a('0x4'));var db=require(_0x861a('0x5'))['db'];var utils=require(_0x861a('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x861a('0x7')][_0x861a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d42eb,_0x57b874,_0x256d16){return new BPromise(function(_0xb2142e,_0x58ebf3){return client[_0x861a('0x9')](_0x2d42eb,_0x256d16)[_0x861a('0xa')](function(_0x4c30e9){logger[_0x861a('0xb')]('ChatApplication,\x20%s,\x20%s',_0x57b874,_0x861a('0xc'));logger[_0x861a('0xd')](_0x861a('0xe'),_0x57b874,_0x861a('0xc'),JSON[_0x861a('0xf')](_0x4c30e9));if(_0x4c30e9['error']){if(_0x4c30e9['error']['code']===0x1f4){logger[_0x861a('0x10')](_0x861a('0x11'),_0x57b874,_0x4c30e9[_0x861a('0x10')][_0x861a('0x12')]);return _0x58ebf3(_0x4c30e9[_0x861a('0x10')][_0x861a('0x12')]);}logger[_0x861a('0x10')](_0x861a('0x11'),_0x57b874,_0x4c30e9[_0x861a('0x10')][_0x861a('0x12')]);return _0xb2142e(_0x4c30e9[_0x861a('0x10')]['message']);}else{logger['info'](_0x861a('0x11'),_0x57b874,_0x861a('0xc'));_0xb2142e(_0x4c30e9[_0x861a('0x13')]['message']);}})[_0x861a('0x14')](function(_0x56d135){logger[_0x861a('0x10')](_0x861a('0x11'),_0x57b874,_0x56d135);_0x58ebf3(_0x56d135);});});} \ No newline at end of file +var _0x6e1b=['message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e1b,0x158));var _0xb6e1=function(_0x265e33,_0x3d5f7b){_0x265e33=_0x265e33-0x0;var _0x4ce44e=_0x6e1b[_0x265e33];return _0x4ce44e;};'use strict';var _=require(_0xb6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6e1('0x1'));var rs=require(_0xb6e1('0x2'));var fs=require('fs');var Redis=require(_0xb6e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6e1('0x4'));var logger=require('../../config/logger')(_0xb6e1('0x5'));var config=require(_0xb6e1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb6e1('0x7')][_0xb6e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc1bdc0,_0x4780ad,_0x11c961){return new BPromise(function(_0x176170,_0x318e07){return client[_0xb6e1('0x9')](_0xc1bdc0,_0x11c961)[_0xb6e1('0xa')](function(_0x5ca7d8){logger['info'](_0xb6e1('0xb'),_0x4780ad,_0xb6e1('0xc'));logger[_0xb6e1('0xd')](_0xb6e1('0xe'),_0x4780ad,_0xb6e1('0xc'),JSON['stringify'](_0x5ca7d8));if(_0x5ca7d8[_0xb6e1('0xf')]){if(_0x5ca7d8[_0xb6e1('0xf')][_0xb6e1('0x10')]===0x1f4){logger[_0xb6e1('0xf')](_0xb6e1('0xb'),_0x4780ad,_0x5ca7d8[_0xb6e1('0xf')][_0xb6e1('0x11')]);return _0x318e07(_0x5ca7d8[_0xb6e1('0xf')][_0xb6e1('0x11')]);}logger[_0xb6e1('0xf')](_0xb6e1('0xb'),_0x4780ad,_0x5ca7d8['error']['message']);return _0x176170(_0x5ca7d8[_0xb6e1('0xf')][_0xb6e1('0x11')]);}else{logger['info'](_0xb6e1('0xb'),_0x4780ad,_0xb6e1('0xc'));_0x176170(_0x5ca7d8[_0xb6e1('0x12')]['message']);}})['catch'](function(_0x3bdb79){logger[_0xb6e1('0xf')](_0xb6e1('0xb'),_0x4780ad,_0x3bdb79);_0x318e07(_0x3bdb79);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c172c30..ec1f1b3 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 _0xda7b=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports'];(function(_0x1b0826,_0x5eeb01){var _0x5dd7e5=function(_0x126688){while(--_0x126688){_0x1b0826['push'](_0x1b0826['shift']());}};_0x5dd7e5(++_0x5eeb01);}(_0xda7b,0x99));var _0xbda7=function(_0x2e7fca,_0x593ef5){_0x2e7fca=_0x2e7fca-0x0;var _0x56d7e7=_0xda7b[_0x2e7fca];return _0x56d7e7;};'use strict';var multer=require(_0xbda7('0x0'));var util=require(_0xbda7('0x1'));var path=require(_0xbda7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbda7('0x3'));var router=express[_0xbda7('0x4')]();var fs_extra=require(_0xbda7('0x5'));var auth=require(_0xbda7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbda7('0x7'));var controller=require(_0xbda7('0x8'));router[_0xbda7('0x9')](_0xbda7('0xa'),auth[_0xbda7('0xb')](),controller['show']);router[_0xbda7('0xc')](_0xbda7('0xa'),auth[_0xbda7('0xb')](),controller[_0xbda7('0xd')]);router[_0xbda7('0xe')](_0xbda7('0xa'),auth[_0xbda7('0xb')](),controller[_0xbda7('0xf')]);module[_0xbda7('0x10')]=router; \ No newline at end of file +var _0x7d07=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','update'];(function(_0x3b2f8e,_0x5afc06){var _0x43743f=function(_0x5e3d33){while(--_0x5e3d33){_0x3b2f8e['push'](_0x3b2f8e['shift']());}};_0x43743f(++_0x5afc06);}(_0x7d07,0x93));var _0x77d0=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x7d07[_0x2d61b2];return _0x12df89;};'use strict';var multer=require(_0x77d0('0x0'));var util=require(_0x77d0('0x1'));var path=require(_0x77d0('0x2'));var timeout=require(_0x77d0('0x3'));var express=require(_0x77d0('0x4'));var router=express['Router']();var fs_extra=require(_0x77d0('0x5'));var auth=require(_0x77d0('0x6'));var interaction=require(_0x77d0('0x7'));var config=require(_0x77d0('0x8'));var controller=require(_0x77d0('0x9'));router[_0x77d0('0xa')](_0x77d0('0xb'),auth['isAuthenticated'](),controller[_0x77d0('0xc')]);router[_0x77d0('0xd')](_0x77d0('0xb'),auth['isAuthenticated'](),controller[_0x77d0('0xe')]);router[_0x77d0('0xf')](_0x77d0('0xb'),auth[_0x77d0('0x10')](),controller['destroy']);module[_0x77d0('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 23c9690..b173f62 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 _0xd177=['STRING','BOOLEAN'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xd177,0x11e));var _0x7d17=function(_0x5f4216,_0x420201){_0x5f4216=_0x5f4216-0x0;var _0x461715=_0xd177[_0x5f4216];return _0x461715;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d17('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x7d17('0x0')]},'write':{'type':Sequelize[_0x7d17('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb725=['STRING','BOOLEAN','exports'];(function(_0x55ec2a,_0x2f8e47){var _0x31d67d=function(_0xe3bccd){while(--_0xe3bccd){_0x55ec2a['push'](_0x55ec2a['shift']());}};_0x31d67d(++_0x2f8e47);}(_0xb725,0x86));var _0x5b72=function(_0x464ec5,_0x708e0a){_0x464ec5=_0x464ec5-0x0;var _0x30a88b=_0xb725[_0x464ec5];return _0x30a88b;};'use strict';var Sequelize=require('sequelize');module[_0x5b72('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5b72('0x1')]},'write':{'type':Sequelize[_0x5b72('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 635bfd7..4af5b4c 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 _0x2eed=['offset','undefined','limit','count','Content-Range','json','apply','save','update','then','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','user','toInteger','addMembers','omit','ids','getMembers','User','filter','options','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end'];(function(_0x1948d5,_0x2b2ee9){var _0x4eb7e1=function(_0x994ea8){while(--_0x994ea8){_0x1948d5['push'](_0x1948d5['shift']());}};_0x4eb7e1(++_0x2b2ee9);}(_0x2eed,0x9e));var _0xd2ee=function(_0x3f5aca,_0x21f54c){_0x3f5aca=_0x3f5aca-0x0;var _0x49d5f8=_0x2eed[_0x3f5aca];return _0x49d5f8;};'use strict';var emlformat=require(_0xd2ee('0x0'));var rimraf=require(_0xd2ee('0x1'));var zipdir=require(_0xd2ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2ee('0x3'));var moment=require(_0xd2ee('0x4'));var BPromise=require(_0xd2ee('0x5'));var Mustache=require(_0xd2ee('0x6'));var util=require(_0xd2ee('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd2ee('0x8'));var ejs=require(_0xd2ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd2ee('0xa'));var _=require(_0xd2ee('0xb'));var squel=require('squel');var crypto=require(_0xd2ee('0xc'));var jsforce=require(_0xd2ee('0xd'));var deskjs=require(_0xd2ee('0xe'));var toCsv=require(_0xd2ee('0x8'));var querystring=require('querystring');var Papa=require(_0xd2ee('0xf'));var Redis=require(_0xd2ee('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd2ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2ee('0x12'))(_0xd2ee('0x13'));var utils=require(_0xd2ee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd2ee('0x15'));var db=require(_0xd2ee('0x16'))['db'];config[_0xd2ee('0x17')]=_['defaults'](config['redis'],{'host':_0xd2ee('0x18'),'port':0x18eb});var socket=require(_0xd2ee('0x19'))(new Redis(config['redis']));require(_0xd2ee('0x1a'))[_0xd2ee('0x1b')](socket);function respondWithStatusCode(_0x7107af,_0x453409){_0x453409=_0x453409||0xcc;return function(_0x398dc9){if(_0x398dc9){return _0x7107af['sendStatus'](_0x453409);}return _0x7107af[_0xd2ee('0x1c')](_0x453409)[_0xd2ee('0x1d')]();};}function respondWithResult(_0x3296be,_0x127410){_0x127410=_0x127410||0xc8;return function(_0x1e0ffd){if(_0x1e0ffd){return _0x3296be['status'](_0x127410)['json'](_0x1e0ffd);}};}function respondWithFilteredResult(_0x468e6a,_0x1f3101){return function(_0x535229){if(_0x535229){var _0x3e2df3=typeof _0x1f3101[_0xd2ee('0x1e')]===_0xd2ee('0x1f')&&typeof _0x1f3101[_0xd2ee('0x20')]===_0xd2ee('0x1f');var _0x13a88a=_0x535229[_0xd2ee('0x21')];var _0x46bfea=_0x3e2df3?0x0:_0x1f3101[_0xd2ee('0x1e')];var _0x1a34fc=_0x3e2df3?_0x535229['count']:_0x1f3101[_0xd2ee('0x1e')]+_0x1f3101[_0xd2ee('0x20')];var _0x245ec0;if(_0x1a34fc>=_0x13a88a){_0x1a34fc=_0x13a88a;_0x245ec0=0xc8;}else{_0x245ec0=0xce;}_0x468e6a['status'](_0x245ec0);return _0x468e6a['set'](_0xd2ee('0x22'),_0x46bfea+'-'+_0x1a34fc+'/'+_0x13a88a)[_0xd2ee('0x23')](_0x535229);}return null;};}function patchUpdates(_0x3fbb7d){return function(_0x4415bc){try{jsonpatch[_0xd2ee('0x24')](_0x4415bc,_0x3fbb7d,!![]);}catch(_0x1fd782){return BPromise['reject'](_0x1fd782);}return _0x4415bc[_0xd2ee('0x25')]();};}function saveUpdates(_0x54eade,_0x572823){return function(_0x4d3c72){if(_0x4d3c72){return _0x4d3c72[_0xd2ee('0x26')](_0x54eade)[_0xd2ee('0x27')](function(_0x46b04e){return _0x46b04e;});}return null;};}function removeEntity(_0x4e947d,_0x473818){return function(_0x2d8457){if(_0x2d8457){return _0x2d8457['destroy']()[_0xd2ee('0x27')](function(){_0x4e947d[_0xd2ee('0x1c')](0xcc)[_0xd2ee('0x1d')]();});}};}function handleEntityNotFound(_0x4e3740,_0x2c5b33){return function(_0x4b2675){if(!_0x4b2675){_0x4e3740['sendStatus'](0x194);}return _0x4b2675;};}function handleError(_0x27a19f,_0x16b7c8){_0x16b7c8=_0x16b7c8||0x1f4;return function(_0x297cd5){logger['error'](_0x297cd5[_0xd2ee('0x28')]);if(_0x297cd5[_0xd2ee('0x29')]){delete _0x297cd5[_0xd2ee('0x29')];}_0x27a19f[_0xd2ee('0x1c')](_0x16b7c8)[_0xd2ee('0x2a')](_0x297cd5);};}exports['index']=function(_0x5b09d8,_0x324c58){var _0x47add3={},_0x2e4b45={},_0x2665a6={'count':0x0,'rows':[]};var _0x300d58=_[_0xd2ee('0x2b')](db[_0xd2ee('0x2c')][_0xd2ee('0x2d')],function(_0x1cdecb){return{'name':_0x1cdecb[_0xd2ee('0x2e')],'type':_0x1cdecb[_0xd2ee('0x2f')][_0xd2ee('0x30')]};});_0x2e4b45['model']=_[_0xd2ee('0x2b')](_0x300d58,_0xd2ee('0x29'));_0x2e4b45[_0xd2ee('0x31')]=_[_0xd2ee('0x32')](_0x5b09d8[_0xd2ee('0x31')]);_0x2e4b45['filters']=_[_0xd2ee('0x33')](_0x2e4b45[_0xd2ee('0x34')],_0x2e4b45[_0xd2ee('0x31')]);_0x47add3[_0xd2ee('0x35')]=_[_0xd2ee('0x33')](_0x2e4b45['model'],qs[_0xd2ee('0x36')](_0x5b09d8[_0xd2ee('0x31')][_0xd2ee('0x36')]));_0x47add3[_0xd2ee('0x35')]=_0x47add3[_0xd2ee('0x35')][_0xd2ee('0x37')]?_0x47add3['attributes']:_0x2e4b45['model'];if(!_0x5b09d8[_0xd2ee('0x31')]['hasOwnProperty']('nolimit')){_0x47add3[_0xd2ee('0x20')]=qs['limit'](_0x5b09d8[_0xd2ee('0x31')][_0xd2ee('0x20')]);_0x47add3[_0xd2ee('0x1e')]=qs[_0xd2ee('0x1e')](_0x5b09d8[_0xd2ee('0x31')]['offset']);}_0x47add3[_0xd2ee('0x38')]=qs[_0xd2ee('0x39')](_0x5b09d8[_0xd2ee('0x31')][_0xd2ee('0x39')]);_0x47add3[_0xd2ee('0x3a')]=qs[_0xd2ee('0x3b')](_[_0xd2ee('0x3c')](_0x5b09d8[_0xd2ee('0x31')],_0x2e4b45[_0xd2ee('0x3b')]),_0x300d58);if(_0x5b09d8[_0xd2ee('0x31')]['filter']){_0x47add3[_0xd2ee('0x3a')]=_[_0xd2ee('0x3d')](_0x47add3[_0xd2ee('0x3a')],{'$or':_[_0xd2ee('0x2b')](_0x300d58,function(_0x194f71){if(_0x194f71[_0xd2ee('0x2f')]!==_0xd2ee('0x3e')){var _0x5593df={};_0x5593df[_0x194f71[_0xd2ee('0x29')]]={'$like':'%'+_0x5b09d8[_0xd2ee('0x31')]['filter']+'%'};return _0x5593df;}})});}_0x47add3=_[_0xd2ee('0x3d')]({},_0x47add3,_0x5b09d8['options']);var _0x1fb0f2={'where':_0x47add3['where']};return db['ChatGroup']['count'](_0x1fb0f2)[_0xd2ee('0x27')](function(_0x12498d){_0x2665a6[_0xd2ee('0x21')]=_0x12498d;if(_0x5b09d8[_0xd2ee('0x31')][_0xd2ee('0x3f')]){_0x47add3[_0xd2ee('0x40')]=[{'all':!![]}];}return db[_0xd2ee('0x2c')][_0xd2ee('0x41')](_0x47add3);})['then'](function(_0x18ec7d){_0x2665a6[_0xd2ee('0x42')]=_0x18ec7d;return _0x2665a6;})[_0xd2ee('0x27')](respondWithFilteredResult(_0x324c58,_0x47add3))['catch'](handleError(_0x324c58,null));};exports['show']=function(_0x4c30c1,_0x56e9e2){var _0x4b0897={'raw':!![],'where':{'id':_0x4c30c1[_0xd2ee('0x43')]['id']}},_0x396e6={};_0x396e6['model']=_[_0xd2ee('0x32')](db['ChatGroup'][_0xd2ee('0x2d')]);_0x396e6[_0xd2ee('0x31')]=_['keys'](_0x4c30c1['query']);_0x396e6[_0xd2ee('0x3b')]=_['intersection'](_0x396e6['model'],_0x396e6[_0xd2ee('0x31')]);_0x4b0897[_0xd2ee('0x35')]=_[_0xd2ee('0x33')](_0x396e6[_0xd2ee('0x34')],qs[_0xd2ee('0x36')](_0x4c30c1[_0xd2ee('0x31')][_0xd2ee('0x36')]));_0x4b0897[_0xd2ee('0x35')]=_0x4b0897[_0xd2ee('0x35')][_0xd2ee('0x37')]?_0x4b0897[_0xd2ee('0x35')]:_0x396e6['model'];if(_0x4c30c1['query']['includeAll']){_0x4b0897[_0xd2ee('0x40')]=[{'all':!![]}];}_0x4b0897=_[_0xd2ee('0x3d')]({},_0x4b0897,_0x4c30c1['options']);return db[_0xd2ee('0x2c')][_0xd2ee('0x44')](_0x4b0897)['then'](handleEntityNotFound(_0x56e9e2,null))['then'](respondWithResult(_0x56e9e2,null))[_0xd2ee('0x45')](handleError(_0x56e9e2,null));};exports['create']=function(_0x1176bb,_0x29b5f4){return db[_0xd2ee('0x2c')][_0xd2ee('0x46')](_0x1176bb[_0xd2ee('0x47')],{})[_0xd2ee('0x27')](respondWithResult(_0x29b5f4,0xc9))['catch'](handleError(_0x29b5f4,null));};exports[_0xd2ee('0x26')]=function(_0xab056f,_0x1c8cac){if(_0xab056f[_0xd2ee('0x47')]['id']){delete _0xab056f['body']['id'];}return db[_0xd2ee('0x2c')][_0xd2ee('0x44')]({'where':{'id':_0xab056f[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x1c8cac,null))[_0xd2ee('0x27')](saveUpdates(_0xab056f[_0xd2ee('0x47')],null))['then'](respondWithResult(_0x1c8cac,null))[_0xd2ee('0x45')](handleError(_0x1c8cac,null));};exports[_0xd2ee('0x48')]=function(_0x4da539,_0x4a4fdc){return db['ChatGroup'][_0xd2ee('0x44')]({'where':{'id':_0x4da539[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x4a4fdc,null))['then'](removeEntity(_0x4a4fdc,null))[_0xd2ee('0x45')](handleError(_0x4a4fdc,null));};exports[_0xd2ee('0x49')]=function(_0x5b3774,_0xbe92ba){return db[_0xd2ee('0x2c')]['describe']()[_0xd2ee('0x27')](respondWithResult(_0xbe92ba,null))[_0xd2ee('0x45')](handleError(_0xbe92ba,null));};exports['getUnread']=function(_0x239100,_0x33511a,_0xb11976){return db['ChatInternalMessage'][_0xd2ee('0x21')]({'where':{'ChatGroupId':_0x239100['params']['id'],'ToId':_0x239100[_0xd2ee('0x4a')]['id'],'read':![]}})[_0xd2ee('0x27')](function(_0x2d99d8){return{'id':_[_0xd2ee('0x4b')](_0x239100[_0xd2ee('0x43')]['id']),'count':_0x2d99d8};})['then'](respondWithResult(_0x33511a,null))[_0xd2ee('0x45')](handleError(_0x33511a,null));};exports[_0xd2ee('0x4c')]=function(_0x17c7cf,_0x4170d1,_0x8f6d13){return db[_0xd2ee('0x2c')][_0xd2ee('0x44')]({'where':{'id':_0x17c7cf[_0xd2ee('0x43')]['id']}})['then'](handleEntityNotFound(_0x4170d1,null))[_0xd2ee('0x27')](function(_0x2b56fb){if(_0x2b56fb){return _0x2b56fb[_0xd2ee('0x4c')](_0x17c7cf[_0xd2ee('0x47')]['ids'],_[_0xd2ee('0x4d')](_0x17c7cf['body'],[_0xd2ee('0x4e'),'id'])||{});}})[_0xd2ee('0x27')](respondWithResult(_0x4170d1,null))[_0xd2ee('0x45')](handleError(_0x4170d1,null));};exports[_0xd2ee('0x4f')]=function(_0x22e540,_0x2679cd,_0x19419b){var _0x322a94={};var _0xff2f4b={};var _0x75808a;var _0x2f7d97;return db[_0xd2ee('0x2c')]['findOne']({'where':{'id':_0x22e540[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x2679cd,null))[_0xd2ee('0x27')](function(_0x577e7d){if(_0x577e7d){_0x75808a=_0x577e7d;_0xff2f4b[_0xd2ee('0x34')]=_[_0xd2ee('0x32')](db[_0xd2ee('0x50')][_0xd2ee('0x2d')]);_0xff2f4b[_0xd2ee('0x31')]=_[_0xd2ee('0x32')](_0x22e540[_0xd2ee('0x31')]);_0xff2f4b['filters']=_[_0xd2ee('0x33')](_0xff2f4b[_0xd2ee('0x34')],_0xff2f4b[_0xd2ee('0x31')]);_0x322a94[_0xd2ee('0x35')]=_[_0xd2ee('0x33')](_0xff2f4b[_0xd2ee('0x34')],qs[_0xd2ee('0x36')](_0x22e540[_0xd2ee('0x31')]['fields']));_0x322a94[_0xd2ee('0x35')]=_0x322a94[_0xd2ee('0x35')][_0xd2ee('0x37')]?_0x322a94[_0xd2ee('0x35')]:_0xff2f4b[_0xd2ee('0x34')];_0x322a94[_0xd2ee('0x38')]=qs['sort'](_0x22e540[_0xd2ee('0x31')]['sort']);_0x322a94[_0xd2ee('0x3a')]=qs[_0xd2ee('0x3b')](_[_0xd2ee('0x3c')](_0x22e540[_0xd2ee('0x31')],_0xff2f4b[_0xd2ee('0x3b')]));if(_0x22e540['query'][_0xd2ee('0x51')]){_0x322a94[_0xd2ee('0x3a')]=_['merge'](_0x322a94[_0xd2ee('0x3a')],{'$or':_[_0xd2ee('0x2b')](_0x322a94[_0xd2ee('0x35')],function(_0x683a70){var _0x1f1204={};_0x1f1204[_0x683a70]={'$like':'%'+_0x22e540[_0xd2ee('0x31')]['filter']+'%'};return _0x1f1204;})});}_0x322a94=_[_0xd2ee('0x3d')]({},_0x322a94,_0x22e540[_0xd2ee('0x52')]);return _0x75808a[_0xd2ee('0x4f')](_0x322a94);}})[_0xd2ee('0x27')](function(_0x327782){if(_0x327782){_0x2f7d97=_0x327782[_0xd2ee('0x37')];if(!_0x22e540[_0xd2ee('0x31')]['hasOwnProperty'](_0xd2ee('0x53'))){_0x322a94[_0xd2ee('0x20')]=qs[_0xd2ee('0x20')](_0x22e540[_0xd2ee('0x31')][_0xd2ee('0x20')]);_0x322a94['offset']=qs[_0xd2ee('0x1e')](_0x22e540[_0xd2ee('0x31')][_0xd2ee('0x1e')]);}return _0x75808a['getMembers'](_0x322a94);}})[_0xd2ee('0x27')](function(_0x1a99c9){if(_0x1a99c9){return _0x1a99c9?{'count':_0x2f7d97,'rows':_0x1a99c9}:null;}})[_0xd2ee('0x27')](respondWithResult(_0x2679cd,null))[_0xd2ee('0x45')](handleError(_0x2679cd,null));};exports['removeMembers']=function(_0x3d358f,_0x4fc814,_0x1c1ba3){return db['ChatGroup'][_0xd2ee('0x44')]({'where':{'id':_0x3d358f[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x4fc814,null))[_0xd2ee('0x27')](function(_0x4823c5){if(_0x4823c5){return _0x4823c5[_0xd2ee('0x54')](_0x3d358f['query'][_0xd2ee('0x4e')]);}})[_0xd2ee('0x27')](respondWithStatusCode(_0x4fc814,null))[_0xd2ee('0x45')](handleError(_0x4fc814,null));};exports[_0xd2ee('0x55')]=function(_0x20dccf,_0x586194,_0x3ae578){if(_0x20dccf[_0xd2ee('0x47')]['id']){delete _0x20dccf[_0xd2ee('0x47')]['id'];}return db[_0xd2ee('0x2c')][_0xd2ee('0x44')]({'where':{'id':_0x20dccf[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x586194,null))['then'](function(_0x51de33){if(_0x51de33){_0x20dccf[_0xd2ee('0x47')][_0xd2ee('0x56')]=_0x51de33['id'];return db[_0xd2ee('0x57')][_0xd2ee('0x46')](_0x20dccf[_0xd2ee('0x47')]);}})['then'](respondWithResult(_0x586194,null))[_0xd2ee('0x45')](handleError(_0x586194,null));};exports[_0xd2ee('0x58')]=function(_0x25f75e,_0x1c33e4,_0x4e71a8){var _0x567551={};var _0x43674d={};var _0x2dd033;var _0x4f52ad;return db[_0xd2ee('0x2c')][_0xd2ee('0x59')]({'where':{'id':_0x25f75e[_0xd2ee('0x43')]['id']}})[_0xd2ee('0x27')](handleEntityNotFound(_0x1c33e4,null))[_0xd2ee('0x27')](function(_0x4a162d){if(_0x4a162d){_0x2dd033=_0x4a162d;_0x43674d[_0xd2ee('0x34')]=_['keys'](db[_0xd2ee('0x57')]['rawAttributes']);_0x43674d['query']=_['keys'](_0x25f75e[_0xd2ee('0x31')]);_0x43674d[_0xd2ee('0x3b')]=_['intersection'](_0x43674d[_0xd2ee('0x34')],_0x43674d['query']);_0x567551[_0xd2ee('0x35')]=_['intersection'](_0x43674d[_0xd2ee('0x34')],qs[_0xd2ee('0x36')](_0x25f75e['query'][_0xd2ee('0x36')]));_0x567551[_0xd2ee('0x35')]=_0x567551[_0xd2ee('0x35')][_0xd2ee('0x37')]?_0x567551['attributes']:_0x43674d[_0xd2ee('0x34')];_0x567551[_0xd2ee('0x38')]=qs[_0xd2ee('0x39')](_0x25f75e['query'][_0xd2ee('0x39')]);_0x567551[_0xd2ee('0x3a')]=qs['filters'](_[_0xd2ee('0x3c')](_0x25f75e['query'],_0x43674d[_0xd2ee('0x3b')]));if(_0x25f75e[_0xd2ee('0x31')][_0xd2ee('0x51')]){_0x567551[_0xd2ee('0x3a')]=_[_0xd2ee('0x3d')](_0x567551['where'],{'$or':_[_0xd2ee('0x2b')](_0x567551['attributes'],function(_0x4a786a){var _0x2ffb91={};_0x2ffb91[_0x4a786a]={'$like':'%'+_0x25f75e[_0xd2ee('0x31')][_0xd2ee('0x51')]+'%'};return _0x2ffb91;})});}if(_0x25f75e[_0xd2ee('0x31')][_0xd2ee('0x5a')]){var _0x3ed558=_0x25f75e['query'][_0xd2ee('0x5a')][_0xd2ee('0x5b')](',');var _0x3a5f40={};_0x3a5f40[_0x3ed558[0x0]]={'$gte':moment(_0x3ed558[0x1])[_0xd2ee('0x5c')](_0xd2ee('0x5d'))};_0x567551[_0xd2ee('0x3a')]=_[_0xd2ee('0x3d')](_0x567551[_0xd2ee('0x3a')],_0x3a5f40);}_0x567551=_[_0xd2ee('0x3d')]({},_0x567551,_0x25f75e['options']);return _0x2dd033[_0xd2ee('0x58')](_0x567551);}})[_0xd2ee('0x27')](function(_0x18abee){if(_0x18abee){_0x4f52ad=_0x18abee['length'];if(!_0x25f75e[_0xd2ee('0x31')]['hasOwnProperty']('nolimit')){_0x567551[_0xd2ee('0x20')]=qs['limit'](_0x25f75e[_0xd2ee('0x31')]['limit']);_0x567551[_0xd2ee('0x1e')]=qs[_0xd2ee('0x1e')](_0x25f75e[_0xd2ee('0x31')][_0xd2ee('0x1e')]);}return _0x2dd033[_0xd2ee('0x58')](_0x567551);}})['then'](function(_0x8e6cde){if(_0x8e6cde){return _0x8e6cde?{'count':_0x4f52ad,'rows':_0x8e6cde}:null;}})[_0xd2ee('0x27')](respondWithResult(_0x1c33e4,null))[_0xd2ee('0x45')](handleError(_0x1c33e4,null));}; \ No newline at end of file +var _0xf064=['model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','pick','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf064,0x8d));var _0x4f06=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xf064[_0x376db5];return _0x304c17;};'use strict';var emlformat=require(_0x4f06('0x0'));var rimraf=require(_0x4f06('0x1'));var zipdir=require(_0x4f06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f06('0x3'));var moment=require('moment');var BPromise=require(_0x4f06('0x4'));var Mustache=require(_0x4f06('0x5'));var util=require(_0x4f06('0x6'));var path=require(_0x4f06('0x7'));var sox=require(_0x4f06('0x8'));var csv=require(_0x4f06('0x9'));var ejs=require(_0x4f06('0xa'));var fs=require('fs');var fs_extra=require(_0x4f06('0xb'));var _=require(_0x4f06('0xc'));var squel=require('squel');var crypto=require(_0x4f06('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f06('0x9'));var querystring=require(_0x4f06('0xe'));var Papa=require(_0x4f06('0xf'));var Redis=require('ioredis');var authService=require(_0x4f06('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4f06('0x11'));var hardwareService=require(_0x4f06('0x12'));var logger=require(_0x4f06('0x13'))(_0x4f06('0x14'));var utils=require(_0x4f06('0x15'));var config=require(_0x4f06('0x16'));var licenseUtil=require(_0x4f06('0x17'));var db=require(_0x4f06('0x18'))['db'];config[_0x4f06('0x19')]=_[_0x4f06('0x1a')](config[_0x4f06('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f06('0x1b'))(new Redis(config[_0x4f06('0x19')]));require(_0x4f06('0x1c'))['register'](socket);function respondWithStatusCode(_0x2d69a2,_0xdcd64d){_0xdcd64d=_0xdcd64d||0xcc;return function(_0x19436d){if(_0x19436d){return _0x2d69a2[_0x4f06('0x1d')](_0xdcd64d);}return _0x2d69a2[_0x4f06('0x1e')](_0xdcd64d)[_0x4f06('0x1f')]();};}function respondWithResult(_0x1010f5,_0x5c7ee4){_0x5c7ee4=_0x5c7ee4||0xc8;return function(_0x3a86d3){if(_0x3a86d3){return _0x1010f5[_0x4f06('0x1e')](_0x5c7ee4)[_0x4f06('0x20')](_0x3a86d3);}};}function respondWithFilteredResult(_0x10328e,_0x3886ba){return function(_0x35e335){if(_0x35e335){var _0x2a562e=typeof _0x3886ba[_0x4f06('0x21')]===_0x4f06('0x22')&&typeof _0x3886ba[_0x4f06('0x23')]===_0x4f06('0x22');var _0x12ac93=_0x35e335[_0x4f06('0x24')];var _0x1fe99e=_0x2a562e?0x0:_0x3886ba[_0x4f06('0x21')];var _0x3c08d7=_0x2a562e?_0x35e335['count']:_0x3886ba['offset']+_0x3886ba['limit'];var _0x33c24b;if(_0x3c08d7>=_0x12ac93){_0x3c08d7=_0x12ac93;_0x33c24b=0xc8;}else{_0x33c24b=0xce;}_0x10328e['status'](_0x33c24b);return _0x10328e[_0x4f06('0x25')](_0x4f06('0x26'),_0x1fe99e+'-'+_0x3c08d7+'/'+_0x12ac93)[_0x4f06('0x20')](_0x35e335);}return null;};}function patchUpdates(_0x3cc5e3){return function(_0x1d27d2){try{jsonpatch[_0x4f06('0x27')](_0x1d27d2,_0x3cc5e3,!![]);}catch(_0xcfe6f){return BPromise[_0x4f06('0x28')](_0xcfe6f);}return _0x1d27d2['save']();};}function saveUpdates(_0x1b5df8,_0x4cbc66){return function(_0x10b015){if(_0x10b015){return _0x10b015[_0x4f06('0x29')](_0x1b5df8)[_0x4f06('0x2a')](function(_0x1a01d6){return _0x1a01d6;});}return null;};}function removeEntity(_0xfac7b4,_0x467b5c){return function(_0xe1abda){if(_0xe1abda){return _0xe1abda[_0x4f06('0x2b')]()[_0x4f06('0x2a')](function(){_0xfac7b4[_0x4f06('0x1e')](0xcc)[_0x4f06('0x1f')]();});}};}function handleEntityNotFound(_0x462eb0,_0x18aebd){return function(_0x38ddb5){if(!_0x38ddb5){_0x462eb0[_0x4f06('0x1d')](0x194);}return _0x38ddb5;};}function handleError(_0x20f68b,_0x5ce1e6){_0x5ce1e6=_0x5ce1e6||0x1f4;return function(_0x3d0d37){logger[_0x4f06('0x2c')](_0x3d0d37[_0x4f06('0x2d')]);if(_0x3d0d37[_0x4f06('0x2e')]){delete _0x3d0d37[_0x4f06('0x2e')];}_0x20f68b[_0x4f06('0x1e')](_0x5ce1e6)[_0x4f06('0x2f')](_0x3d0d37);};}exports[_0x4f06('0x30')]=function(_0x23554a,_0x535608){var _0x3ae6c7={},_0x45a28c={},_0x5c2ece={'count':0x0,'rows':[]};var _0x477bf7=_['map'](db[_0x4f06('0x31')][_0x4f06('0x32')],function(_0x7b1b50){return{'name':_0x7b1b50[_0x4f06('0x33')],'type':_0x7b1b50[_0x4f06('0x34')][_0x4f06('0x35')]};});_0x45a28c['model']=_[_0x4f06('0x36')](_0x477bf7,_0x4f06('0x2e'));_0x45a28c[_0x4f06('0x37')]=_[_0x4f06('0x38')](_0x23554a[_0x4f06('0x37')]);_0x45a28c[_0x4f06('0x39')]=_[_0x4f06('0x3a')](_0x45a28c[_0x4f06('0x3b')],_0x45a28c[_0x4f06('0x37')]);_0x3ae6c7[_0x4f06('0x3c')]=_[_0x4f06('0x3a')](_0x45a28c[_0x4f06('0x3b')],qs[_0x4f06('0x3d')](_0x23554a[_0x4f06('0x37')][_0x4f06('0x3d')]));_0x3ae6c7[_0x4f06('0x3c')]=_0x3ae6c7[_0x4f06('0x3c')][_0x4f06('0x3e')]?_0x3ae6c7[_0x4f06('0x3c')]:_0x45a28c[_0x4f06('0x3b')];if(!_0x23554a['query'][_0x4f06('0x3f')]('nolimit')){_0x3ae6c7[_0x4f06('0x23')]=qs['limit'](_0x23554a['query']['limit']);_0x3ae6c7['offset']=qs[_0x4f06('0x21')](_0x23554a[_0x4f06('0x37')][_0x4f06('0x21')]);}_0x3ae6c7[_0x4f06('0x40')]=qs[_0x4f06('0x41')](_0x23554a[_0x4f06('0x37')][_0x4f06('0x41')]);_0x3ae6c7[_0x4f06('0x42')]=qs['filters'](_['pick'](_0x23554a[_0x4f06('0x37')],_0x45a28c[_0x4f06('0x39')]),_0x477bf7);if(_0x23554a[_0x4f06('0x37')][_0x4f06('0x43')]){_0x3ae6c7[_0x4f06('0x42')]=_[_0x4f06('0x44')](_0x3ae6c7[_0x4f06('0x42')],{'$or':_[_0x4f06('0x36')](_0x477bf7,function(_0x4e4a30){if(_0x4e4a30[_0x4f06('0x34')]!==_0x4f06('0x45')){var _0x11b3d0={};_0x11b3d0[_0x4e4a30['name']]={'$like':'%'+_0x23554a[_0x4f06('0x37')][_0x4f06('0x43')]+'%'};return _0x11b3d0;}})});}_0x3ae6c7=_[_0x4f06('0x44')]({},_0x3ae6c7,_0x23554a[_0x4f06('0x46')]);var _0x538fb1={'where':_0x3ae6c7[_0x4f06('0x42')]};return db[_0x4f06('0x31')]['count'](_0x538fb1)[_0x4f06('0x2a')](function(_0x2455c5){_0x5c2ece[_0x4f06('0x24')]=_0x2455c5;if(_0x23554a[_0x4f06('0x37')][_0x4f06('0x47')]){_0x3ae6c7[_0x4f06('0x48')]=[{'all':!![]}];}return db[_0x4f06('0x31')][_0x4f06('0x49')](_0x3ae6c7);})[_0x4f06('0x2a')](function(_0x5967c9){_0x5c2ece[_0x4f06('0x4a')]=_0x5967c9;return _0x5c2ece;})[_0x4f06('0x2a')](respondWithFilteredResult(_0x535608,_0x3ae6c7))[_0x4f06('0x4b')](handleError(_0x535608,null));};exports[_0x4f06('0x4c')]=function(_0x421e1a,_0x5f3130){var _0xf285be={'raw':!![],'where':{'id':_0x421e1a[_0x4f06('0x4d')]['id']}},_0x42d897={};_0x42d897[_0x4f06('0x3b')]=_['keys'](db[_0x4f06('0x31')]['rawAttributes']);_0x42d897['query']=_[_0x4f06('0x38')](_0x421e1a[_0x4f06('0x37')]);_0x42d897['filters']=_[_0x4f06('0x3a')](_0x42d897[_0x4f06('0x3b')],_0x42d897['query']);_0xf285be[_0x4f06('0x3c')]=_['intersection'](_0x42d897[_0x4f06('0x3b')],qs[_0x4f06('0x3d')](_0x421e1a[_0x4f06('0x37')]['fields']));_0xf285be['attributes']=_0xf285be[_0x4f06('0x3c')][_0x4f06('0x3e')]?_0xf285be['attributes']:_0x42d897['model'];if(_0x421e1a[_0x4f06('0x37')][_0x4f06('0x47')]){_0xf285be['include']=[{'all':!![]}];}_0xf285be=_[_0x4f06('0x44')]({},_0xf285be,_0x421e1a['options']);return db['ChatGroup'][_0x4f06('0x4e')](_0xf285be)[_0x4f06('0x2a')](handleEntityNotFound(_0x5f3130,null))[_0x4f06('0x2a')](respondWithResult(_0x5f3130,null))[_0x4f06('0x4b')](handleError(_0x5f3130,null));};exports[_0x4f06('0x4f')]=function(_0x3bbbc6,_0x4b7336){return db[_0x4f06('0x31')][_0x4f06('0x4f')](_0x3bbbc6[_0x4f06('0x50')],{})['then'](respondWithResult(_0x4b7336,0xc9))['catch'](handleError(_0x4b7336,null));};exports[_0x4f06('0x29')]=function(_0x1f4266,_0x500503){if(_0x1f4266[_0x4f06('0x50')]['id']){delete _0x1f4266[_0x4f06('0x50')]['id'];}return db[_0x4f06('0x31')][_0x4f06('0x4e')]({'where':{'id':_0x1f4266[_0x4f06('0x4d')]['id']}})[_0x4f06('0x2a')](handleEntityNotFound(_0x500503,null))[_0x4f06('0x2a')](saveUpdates(_0x1f4266['body'],null))[_0x4f06('0x2a')](respondWithResult(_0x500503,null))['catch'](handleError(_0x500503,null));};exports[_0x4f06('0x2b')]=function(_0x56e305,_0x1356af){return db[_0x4f06('0x31')][_0x4f06('0x4e')]({'where':{'id':_0x56e305['params']['id']}})['then'](handleEntityNotFound(_0x1356af,null))[_0x4f06('0x2a')](removeEntity(_0x1356af,null))[_0x4f06('0x4b')](handleError(_0x1356af,null));};exports[_0x4f06('0x51')]=function(_0x5a3cfd,_0x2511c3){return db[_0x4f06('0x31')]['describe']()[_0x4f06('0x2a')](respondWithResult(_0x2511c3,null))[_0x4f06('0x4b')](handleError(_0x2511c3,null));};exports['getUnread']=function(_0x1cdad0,_0x5b3751,_0x4b472f){return db[_0x4f06('0x52')][_0x4f06('0x24')]({'where':{'ChatGroupId':_0x1cdad0[_0x4f06('0x4d')]['id'],'ToId':_0x1cdad0[_0x4f06('0x53')]['id'],'read':![]}})[_0x4f06('0x2a')](function(_0x581c2b){return{'id':_['toInteger'](_0x1cdad0[_0x4f06('0x4d')]['id']),'count':_0x581c2b};})[_0x4f06('0x2a')](respondWithResult(_0x5b3751,null))[_0x4f06('0x4b')](handleError(_0x5b3751,null));};exports[_0x4f06('0x54')]=function(_0x92caa6,_0x1b395e,_0x33f3ec){return db[_0x4f06('0x31')][_0x4f06('0x4e')]({'where':{'id':_0x92caa6['params']['id']}})[_0x4f06('0x2a')](handleEntityNotFound(_0x1b395e,null))[_0x4f06('0x2a')](function(_0x4542f3){if(_0x4542f3){return _0x4542f3[_0x4f06('0x54')](_0x92caa6['body'][_0x4f06('0x55')],_[_0x4f06('0x56')](_0x92caa6[_0x4f06('0x50')],[_0x4f06('0x55'),'id'])||{});}})[_0x4f06('0x2a')](respondWithResult(_0x1b395e,null))[_0x4f06('0x4b')](handleError(_0x1b395e,null));};exports[_0x4f06('0x57')]=function(_0x55b651,_0x4b5123,_0x14a6ec){var _0x5ec29b={};var _0x3454dd={};var _0x1c6c70;var _0x402634;return db[_0x4f06('0x31')][_0x4f06('0x58')]({'where':{'id':_0x55b651[_0x4f06('0x4d')]['id']}})[_0x4f06('0x2a')](handleEntityNotFound(_0x4b5123,null))[_0x4f06('0x2a')](function(_0x2a1e9a){if(_0x2a1e9a){_0x1c6c70=_0x2a1e9a;_0x3454dd[_0x4f06('0x3b')]=_['keys'](db[_0x4f06('0x59')]['rawAttributes']);_0x3454dd[_0x4f06('0x37')]=_['keys'](_0x55b651['query']);_0x3454dd[_0x4f06('0x39')]=_[_0x4f06('0x3a')](_0x3454dd[_0x4f06('0x3b')],_0x3454dd['query']);_0x5ec29b[_0x4f06('0x3c')]=_['intersection'](_0x3454dd[_0x4f06('0x3b')],qs[_0x4f06('0x3d')](_0x55b651[_0x4f06('0x37')][_0x4f06('0x3d')]));_0x5ec29b[_0x4f06('0x3c')]=_0x5ec29b[_0x4f06('0x3c')]['length']?_0x5ec29b[_0x4f06('0x3c')]:_0x3454dd[_0x4f06('0x3b')];_0x5ec29b[_0x4f06('0x40')]=qs[_0x4f06('0x41')](_0x55b651[_0x4f06('0x37')][_0x4f06('0x41')]);_0x5ec29b[_0x4f06('0x42')]=qs['filters'](_[_0x4f06('0x5a')](_0x55b651[_0x4f06('0x37')],_0x3454dd[_0x4f06('0x39')]));if(_0x55b651[_0x4f06('0x37')][_0x4f06('0x43')]){_0x5ec29b[_0x4f06('0x42')]=_['merge'](_0x5ec29b['where'],{'$or':_[_0x4f06('0x36')](_0x5ec29b['attributes'],function(_0x1a8fd8){var _0xd6415={};_0xd6415[_0x1a8fd8]={'$like':'%'+_0x55b651[_0x4f06('0x37')][_0x4f06('0x43')]+'%'};return _0xd6415;})});}_0x5ec29b=_[_0x4f06('0x44')]({},_0x5ec29b,_0x55b651[_0x4f06('0x46')]);return _0x1c6c70[_0x4f06('0x57')](_0x5ec29b);}})[_0x4f06('0x2a')](function(_0x3f9887){if(_0x3f9887){_0x402634=_0x3f9887[_0x4f06('0x3e')];if(!_0x55b651['query'][_0x4f06('0x3f')](_0x4f06('0x5b'))){_0x5ec29b['limit']=qs[_0x4f06('0x23')](_0x55b651[_0x4f06('0x37')][_0x4f06('0x23')]);_0x5ec29b[_0x4f06('0x21')]=qs['offset'](_0x55b651[_0x4f06('0x37')][_0x4f06('0x21')]);}return _0x1c6c70[_0x4f06('0x57')](_0x5ec29b);}})[_0x4f06('0x2a')](function(_0x4f7228){if(_0x4f7228){return _0x4f7228?{'count':_0x402634,'rows':_0x4f7228}:null;}})[_0x4f06('0x2a')](respondWithResult(_0x4b5123,null))['catch'](handleError(_0x4b5123,null));};exports[_0x4f06('0x5c')]=function(_0x4dcfda,_0x4e14b2,_0x1aaf23){return db[_0x4f06('0x31')]['find']({'where':{'id':_0x4dcfda[_0x4f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e14b2,null))[_0x4f06('0x2a')](function(_0x2b8803){if(_0x2b8803){return _0x2b8803[_0x4f06('0x5c')](_0x4dcfda[_0x4f06('0x37')][_0x4f06('0x55')]);}})[_0x4f06('0x2a')](respondWithStatusCode(_0x4e14b2,null))[_0x4f06('0x4b')](handleError(_0x4e14b2,null));};exports[_0x4f06('0x5d')]=function(_0x4a9a71,_0x542b6e,_0x9f815a){if(_0x4a9a71[_0x4f06('0x50')]['id']){delete _0x4a9a71[_0x4f06('0x50')]['id'];}return db[_0x4f06('0x31')][_0x4f06('0x4e')]({'where':{'id':_0x4a9a71[_0x4f06('0x4d')]['id']}})[_0x4f06('0x2a')](handleEntityNotFound(_0x542b6e,null))[_0x4f06('0x2a')](function(_0x27704f){if(_0x27704f){_0x4a9a71[_0x4f06('0x50')][_0x4f06('0x5e')]=_0x27704f['id'];return db[_0x4f06('0x52')][_0x4f06('0x4f')](_0x4a9a71[_0x4f06('0x50')]);}})['then'](respondWithResult(_0x542b6e,null))[_0x4f06('0x4b')](handleError(_0x542b6e,null));};exports[_0x4f06('0x5f')]=function(_0xc4db7a,_0x47fdc2,_0x595625){var _0x4cb8ec={};var _0x1a50f0={};var _0x2dfd41;var _0x2b37fe;return db['ChatGroup'][_0x4f06('0x58')]({'where':{'id':_0xc4db7a[_0x4f06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x47fdc2,null))[_0x4f06('0x2a')](function(_0x31f6b3){if(_0x31f6b3){_0x2dfd41=_0x31f6b3;_0x1a50f0[_0x4f06('0x3b')]=_[_0x4f06('0x38')](db[_0x4f06('0x52')][_0x4f06('0x32')]);_0x1a50f0['query']=_[_0x4f06('0x38')](_0xc4db7a[_0x4f06('0x37')]);_0x1a50f0[_0x4f06('0x39')]=_['intersection'](_0x1a50f0['model'],_0x1a50f0[_0x4f06('0x37')]);_0x4cb8ec[_0x4f06('0x3c')]=_[_0x4f06('0x3a')](_0x1a50f0[_0x4f06('0x3b')],qs[_0x4f06('0x3d')](_0xc4db7a[_0x4f06('0x37')]['fields']));_0x4cb8ec[_0x4f06('0x3c')]=_0x4cb8ec[_0x4f06('0x3c')]['length']?_0x4cb8ec[_0x4f06('0x3c')]:_0x1a50f0[_0x4f06('0x3b')];_0x4cb8ec[_0x4f06('0x40')]=qs[_0x4f06('0x41')](_0xc4db7a[_0x4f06('0x37')][_0x4f06('0x41')]);_0x4cb8ec[_0x4f06('0x42')]=qs[_0x4f06('0x39')](_[_0x4f06('0x5a')](_0xc4db7a[_0x4f06('0x37')],_0x1a50f0['filters']));if(_0xc4db7a[_0x4f06('0x37')][_0x4f06('0x43')]){_0x4cb8ec['where']=_[_0x4f06('0x44')](_0x4cb8ec['where'],{'$or':_[_0x4f06('0x36')](_0x4cb8ec[_0x4f06('0x3c')],function(_0x481444){var _0xe1c30a={};_0xe1c30a[_0x481444]={'$like':'%'+_0xc4db7a[_0x4f06('0x37')]['filter']+'%'};return _0xe1c30a;})});}if(_0xc4db7a['query'][_0x4f06('0x60')]){var _0x26a812=_0xc4db7a['query'][_0x4f06('0x60')][_0x4f06('0x61')](',');var _0x346f25={};_0x346f25[_0x26a812[0x0]]={'$gte':moment(_0x26a812[0x1])[_0x4f06('0x62')](_0x4f06('0x63'))};_0x4cb8ec[_0x4f06('0x42')]=_[_0x4f06('0x44')](_0x4cb8ec['where'],_0x346f25);}_0x4cb8ec=_[_0x4f06('0x44')]({},_0x4cb8ec,_0xc4db7a['options']);return _0x2dfd41[_0x4f06('0x5f')](_0x4cb8ec);}})[_0x4f06('0x2a')](function(_0x3b6938){if(_0x3b6938){_0x2b37fe=_0x3b6938[_0x4f06('0x3e')];if(!_0xc4db7a[_0x4f06('0x37')][_0x4f06('0x3f')]('nolimit')){_0x4cb8ec['limit']=qs[_0x4f06('0x23')](_0xc4db7a[_0x4f06('0x37')]['limit']);_0x4cb8ec['offset']=qs[_0x4f06('0x21')](_0xc4db7a[_0x4f06('0x37')][_0x4f06('0x21')]);}return _0x2dfd41[_0x4f06('0x5f')](_0x4cb8ec);}})[_0x4f06('0x2a')](function(_0x51b3c2){if(_0x51b3c2){return _0x51b3c2?{'count':_0x2b37fe,'rows':_0x51b3c2}:null;}})['then'](respondWithResult(_0x47fdc2,null))[_0x4f06('0x4b')](handleError(_0x47fdc2,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ef9def8..bac6249 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 _0xed3e=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x283176,_0x19ea6e){var _0x573b13=function(_0x10e221){while(--_0x10e221){_0x283176['push'](_0x283176['shift']());}};_0x573b13(++_0x19ea6e);}(_0xed3e,0xf0));var _0xeed3=function(_0x192a1c,_0x2b4937){_0x192a1c=_0x192a1c-0x0;var _0x1f0d94=_0xed3e[_0x192a1c];return _0x1f0d94;};'use strict';var EventEmitter=require(_0xeed3('0x0'));var ChatGroup=require(_0xeed3('0x1'))['db'][_0xeed3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xeed3('0x3')](0x0);var events={'afterCreate':_0xeed3('0x4'),'afterUpdate':_0xeed3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x271fe2){return function(_0x1bf2d7,_0x25be3e,_0xbef652){ChatGroupEvents[_0xeed3('0x6')](_0x271fe2+':'+_0x1bf2d7['id'],_0x1bf2d7);ChatGroupEvents[_0xeed3('0x6')](_0x271fe2,_0x1bf2d7);_0xbef652(null);};}for(var e in events){if(events[_0xeed3('0x7')](e)){var event=events[e];ChatGroup[_0xeed3('0x8')](e,emitEvent(event));}}module[_0xeed3('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x7d5b=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x7d5b,0x131));var _0xb7d5=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x7d5b[_0x38ced4];return _0x547c07;};'use strict';var EventEmitter=require(_0xb7d5('0x0'));var ChatGroup=require(_0xb7d5('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb7d5('0x2')](0x0);var events={'afterCreate':_0xb7d5('0x3'),'afterUpdate':_0xb7d5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1a86f5){return function(_0x9a875,_0xf37c04,_0x4bc772){ChatGroupEvents[_0xb7d5('0x5')](_0x1a86f5+':'+_0x9a875['id'],_0x9a875);ChatGroupEvents['emit'](_0x1a86f5,_0x9a875);_0x4bc772(null);};}for(var e in events){if(events[_0xb7d5('0x6')](e)){var event=events[e];ChatGroup[_0xb7d5('0x7')](e,emitEvent(event));}}module[_0xb7d5('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 0e58233..2e8ddb6 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 _0x22a7=['rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3767fe,_0x207ed9){var _0x288159=function(_0x48e317){while(--_0x48e317){_0x3767fe['push'](_0x3767fe['shift']());}};_0x288159(++_0x207ed9);}(_0x22a7,0x6e));var _0x722a=function(_0x5be1d6,_0x52ab2a){_0x5be1d6=_0x5be1d6-0x0;var _0x5d9bd4=_0x22a7[_0x5be1d6];return _0x5d9bd4;};'use strict';var _=require(_0x722a('0x0'));var util=require(_0x722a('0x1'));var logger=require(_0x722a('0x2'))('api');var moment=require(_0x722a('0x3'));var BPromise=require(_0x722a('0x4'));var rp=require(_0x722a('0x5'));var fs=require('fs');var path=require(_0x722a('0x6'));var rimraf=require(_0x722a('0x7'));var config=require(_0x722a('0x8'));var attributes=require(_0x722a('0x9'));module[_0x722a('0xa')]=function(_0x59f569,_0x3c0688){return _0x59f569['define'](_0x722a('0xb'),attributes,{'tableName':_0x722a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe01f=['../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','moment','path','rimraf'];(function(_0x2fd6bd,_0x9ad1d1){var _0x174ba3=function(_0x2d2288){while(--_0x2d2288){_0x2fd6bd['push'](_0x2fd6bd['shift']());}};_0x174ba3(++_0x9ad1d1);}(_0xe01f,0x127));var _0xfe01=function(_0x234e99,_0x56a577){_0x234e99=_0x234e99-0x0;var _0x1b7da4=_0xe01f[_0x234e99];return _0x1b7da4;};'use strict';var _=require('lodash');var util=require(_0xfe01('0x0'));var logger=require(_0xfe01('0x1'))('api');var moment=require(_0xfe01('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe01('0x3'));var rimraf=require(_0xfe01('0x4'));var config=require(_0xfe01('0x5'));var attributes=require('./chatGroup.attributes');module[_0xfe01('0x6')]=function(_0x2cc258,_0x2a55cd){return _0x2cc258[_0xfe01('0x7')](_0xfe01('0x8'),attributes,{'tableName':_0xfe01('0x9'),'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 e47dccd..7cc51f4 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 _0xe5f7=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x20a031,_0x154d0d){var _0x587265=function(_0x5ca3eb){while(--_0x5ca3eb){_0x20a031['push'](_0x20a031['shift']());}};_0x587265(++_0x154d0d);}(_0xe5f7,0x178));var _0x7e5f=function(_0x1d8dba,_0x218d53){_0x1d8dba=_0x1d8dba-0x0;var _0x532a14=_0xe5f7[_0x1d8dba];return _0x532a14;};'use strict';var _=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var moment=require(_0x7e5f('0x2'));var BPromise=require(_0x7e5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e5f('0x4'))['db'];var utils=require(_0x7e5f('0x5'));var logger=require(_0x7e5f('0x6'))('rpc');var config=require(_0x7e5f('0x7'));var jayson=require(_0x7e5f('0x8'));var client=jayson['client'][_0x7e5f('0x9')]({'port':0x232a});config[_0x7e5f('0xa')]=_[_0x7e5f('0xb')](config[_0x7e5f('0xa')],{'host':_0x7e5f('0xc'),'port':0x18eb});var socket=require(_0x7e5f('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x7e5f('0xe')](socket);function respondWithRpcPromise(_0x1fec12,_0x313706,_0x1900d8){return new BPromise(function(_0x3844af,_0x218e50){return client[_0x7e5f('0xf')](_0x1fec12,_0x1900d8)[_0x7e5f('0x10')](function(_0x23a476){logger[_0x7e5f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x313706,_0x7e5f('0x12'));logger['debug'](_0x7e5f('0x13'),_0x313706,_0x7e5f('0x12'),JSON[_0x7e5f('0x14')](_0x23a476));if(_0x23a476[_0x7e5f('0x15')]){if(_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x16')]===0x1f4){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')][_0x7e5f('0x18')]);return _0x218e50(_0x23a476['error'][_0x7e5f('0x18')]);}logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0x23a476[_0x7e5f('0x15')]['message']);return _0x3844af(_0x23a476['error']['message']);}else{logger[_0x7e5f('0x11')](_0x7e5f('0x17'),_0x313706,'request\x20sent');_0x3844af(_0x23a476[_0x7e5f('0x19')][_0x7e5f('0x18')]);}})[_0x7e5f('0x1a')](function(_0xd97c29){logger[_0x7e5f('0x15')](_0x7e5f('0x17'),_0x313706,_0xd97c29);_0x218e50(_0xd97c29);});});} \ No newline at end of file +var _0x24ca=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xf34fb,_0x138c38){var _0x47af3b=function(_0x7af136){while(--_0x7af136){_0xf34fb['push'](_0xf34fb['shift']());}};_0x47af3b(++_0x138c38);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x24ca[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});config[_0xa24c('0xc')]=_[_0xa24c('0xd')](config[_0xa24c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa24c('0xe'))(new Redis(config[_0xa24c('0xc')]));require(_0xa24c('0xf'))['register'](socket);function respondWithRpcPromise(_0x399f32,_0x325c6d,_0x288f76){return new BPromise(function(_0x211003,_0x169632){return client[_0xa24c('0x10')](_0x399f32,_0x288f76)[_0xa24c('0x11')](function(_0xc82af0){logger[_0xa24c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x325c6d,_0xa24c('0x13'));logger[_0xa24c('0x14')](_0xa24c('0x15'),_0x325c6d,_0xa24c('0x13'),JSON['stringify'](_0xc82af0));if(_0xc82af0[_0xa24c('0x16')]){if(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x17')]===0x1f4){logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);return _0x169632(_0xc82af0['error']['message']);}logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0['error']['message']);return _0x211003(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);}else{logger['info'](_0xa24c('0x18'),_0x325c6d,'request\x20sent');_0x211003(_0xc82af0[_0xa24c('0x1a')][_0xa24c('0x19')]);}})[_0xa24c('0x1b')](function(_0xefdbd9){logger['error'](_0xa24c('0x18'),_0x325c6d,_0xefdbd9);_0x169632(_0xefdbd9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index bd608a6..cc5bbb3 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 _0x5d6e=['remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0x5d6e,0xfe));var _0xe5d6=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x5d6e[_0x50e7e0];return _0x1a0307;};'use strict';var ChatGroupEvents=require(_0xe5d6('0x0'));var events=[_0xe5d6('0x1'),_0xe5d6('0x2'),_0xe5d6('0x3')];function createListener(_0x4e550b,_0xa8881f){return function(_0x2777e6){_0xa8881f[_0xe5d6('0x4')](_0x4e550b,_0x2777e6);};}function removeListener(_0x4d8e18,_0x521056){return function(){ChatGroupEvents[_0xe5d6('0x5')](_0x4d8e18,_0x521056);};}exports['register']=function(_0x319f83){for(var _0x157c66=0x0,_0x5e348f=events[_0xe5d6('0x6')];_0x157c66<_0x5e348f;_0x157c66++){var _0x29d7ab=events[_0x157c66];var _0x1df81c=createListener(_0xe5d6('0x7')+_0x29d7ab,_0x319f83);ChatGroupEvents['on'](_0x29d7ab,_0x1df81c);}}; \ No newline at end of file +var _0x229a=['length','chatGroup:','save','remove','update','emit','removeListener','register'];(function(_0x500e2a,_0x29c9fa){var _0x27ef29=function(_0x4fa0e3){while(--_0x4fa0e3){_0x500e2a['push'](_0x500e2a['shift']());}};_0x27ef29(++_0x29c9fa);}(_0x229a,0x1b2));var _0xa229=function(_0x5b772a,_0x57a098){_0x5b772a=_0x5b772a-0x0;var _0x28005=_0x229a[_0x5b772a];return _0x28005;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xa229('0x0'),_0xa229('0x1'),_0xa229('0x2')];function createListener(_0x48f1b7,_0x11c335){return function(_0x2dd2e6){_0x11c335[_0xa229('0x3')](_0x48f1b7,_0x2dd2e6);};}function removeListener(_0xcd1a93,_0x15e069){return function(){ChatGroupEvents[_0xa229('0x4')](_0xcd1a93,_0x15e069);};}exports[_0xa229('0x5')]=function(_0x12f932){for(var _0x5e81da=0x0,_0x33f5ab=events[_0xa229('0x6')];_0x5e81da<_0x33f5ab;_0x5e81da++){var _0x1203fd=events[_0x5e81da];var _0x454167=createListener(_0xa229('0x7')+_0x1203fd,_0x12f932);ChatGroupEvents['on'](_0x1203fd,_0x454167);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 72741f0..ca27878 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 _0x023d=['fs-extra','get','isAuthenticated','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','Router'];(function(_0x588ead,_0x224d24){var _0x12a8f7=function(_0x2ec3a7){while(--_0x2ec3a7){_0x588ead['push'](_0x588ead['shift']());}};_0x12a8f7(++_0x224d24);}(_0x023d,0x1df));var _0xd023=function(_0x1cc3eb,_0x1e26f9){_0x1cc3eb=_0x1cc3eb-0x0;var _0x3ac1c9=_0x023d[_0x1cc3eb];return _0x3ac1c9;};'use strict';var multer=require(_0xd023('0x0'));var util=require(_0xd023('0x1'));var path=require('path');var timeout=require(_0xd023('0x2'));var express=require(_0xd023('0x3'));var router=express[_0xd023('0x4')]();var fs_extra=require(_0xd023('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xd023('0x6')]('/',auth[_0xd023('0x7')](),controller['index']);router[_0xd023('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xd023('0x8'),auth[_0xd023('0x7')](),controller['show']);router[_0xd023('0x6')](_0xd023('0x9'),auth[_0xd023('0x7')](),controller[_0xd023('0xa')]);router['get'](_0xd023('0xb'),auth['isAuthenticated'](),controller[_0xd023('0xc')]);router[_0xd023('0x6')](_0xd023('0xd'),auth[_0xd023('0x7')](),controller['getMessages']);router[_0xd023('0xe')]('/',auth[_0xd023('0x7')](),controller['create']);router[_0xd023('0xe')](_0xd023('0xb'),auth[_0xd023('0x7')](),controller[_0xd023('0xf')]);router['post']('/:id/messages',auth[_0xd023('0x7')](),controller[_0xd023('0x10')]);router['put'](_0xd023('0x8'),auth[_0xd023('0x7')](),controller[_0xd023('0x11')]);router[_0xd023('0x12')]('/:id',auth[_0xd023('0x7')](),controller[_0xd023('0x13')]);router[_0xd023('0x12')](_0xd023('0xb'),auth[_0xd023('0x7')](),controller[_0xd023('0x14')]);module[_0xd023('0x15')]=router; \ No newline at end of file +var _0x6619=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','update','delete','removeMembers','exports','util'];(function(_0x61cfe2,_0x53c70d){var _0xea158a=function(_0x3e4885){while(--_0x3e4885){_0x61cfe2['push'](_0x61cfe2['shift']());}};_0xea158a(++_0x53c70d);}(_0x6619,0x72));var _0x9661=function(_0x1b2c11,_0x2eac9f){_0x1b2c11=_0x1b2c11-0x0;var _0x46cca9=_0x6619[_0x1b2c11];return _0x46cca9;};'use strict';var multer=require('multer');var util=require(_0x9661('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9661('0x1'));var auth=require(_0x9661('0x2'));var interaction=require(_0x9661('0x3'));var config=require(_0x9661('0x4'));var controller=require(_0x9661('0x5'));router[_0x9661('0x6')]('/',auth[_0x9661('0x7')](),controller[_0x9661('0x8')]);router[_0x9661('0x6')](_0x9661('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x9661('0x6')](_0x9661('0xa'),auth[_0x9661('0x7')](),controller['show']);router[_0x9661('0x6')]('/:id/unread',auth[_0x9661('0x7')](),controller[_0x9661('0xb')]);router[_0x9661('0x6')](_0x9661('0xc'),auth[_0x9661('0x7')](),controller['getMembers']);router[_0x9661('0x6')](_0x9661('0xd'),auth['isAuthenticated'](),controller[_0x9661('0xe')]);router[_0x9661('0xf')]('/',auth[_0x9661('0x7')](),controller[_0x9661('0x10')]);router[_0x9661('0xf')]('/:id/members',auth[_0x9661('0x7')](),controller[_0x9661('0x11')]);router[_0x9661('0xf')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x9661('0x12')](_0x9661('0xa'),auth[_0x9661('0x7')](),controller[_0x9661('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x9661('0x14')](_0x9661('0xc'),auth[_0x9661('0x7')](),controller[_0x9661('0x15')]);module[_0x9661('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4441471..4d59d01 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 _0xa062=['star','thumb','TEXT','STRING','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0x172250,_0x2bef4a){var _0x421bcd=function(_0xb5bd17){while(--_0xb5bd17){_0x172250['push'](_0x172250['shift']());}};_0x421bcd(++_0x2bef4a);}(_0xa062,0x101));var _0x2a06=function(_0x291d65,_0x25bc0b){_0x291d65=_0x291d65-0x0;var _0x59e8f0=_0xa062[_0x291d65];return _0x59e8f0;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'closed':{'type':Sequelize[_0x2a06('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x2a06('0x3')](_0x2a06('0x4'),_0x2a06('0x5')),'defaultValue':_0x2a06('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2a06('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2a06('0x7')]},'secondDisposition':{'type':Sequelize[_0x2a06('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2a06('0x7')]},'note':{'type':Sequelize[_0x2a06('0x7')]},'browserName':{'type':Sequelize[_0x2a06('0x7')]},'browserVersion':{'type':Sequelize[_0x2a06('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2a06('0x7')]},'deviceModel':{'type':Sequelize[_0x2a06('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2a06('0x7')]},'referer':{'type':Sequelize[_0x2a06('0x6')]},'customerIp':{'type':Sequelize[_0x2a06('0x7')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2a06('0x3')]('in',_0x2a06('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2a06('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2a06('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2a06('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe0c0=['ENUM','star','TEXT','DATE','STRING','long','out','sequelize','BOOLEAN','INTEGER'];(function(_0x1da7a7,_0x360d47){var _0x454ba0=function(_0xc4d7d){while(--_0xc4d7d){_0x1da7a7['push'](_0x1da7a7['shift']());}};_0x454ba0(++_0x360d47);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x2b41eb,_0x1d7eee){_0x2b41eb=_0x2b41eb-0x0;var _0xe37d0c=_0xe0c0[_0x2b41eb];return _0xe37d0c;};'use strict';var Sequelize=require(_0x0e0c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0e0c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0e0c('0x2')]},'ratingType':{'type':Sequelize[_0x0e0c('0x3')](_0x0e0c('0x4'),'thumb'),'defaultValue':_0x0e0c('0x4')},'ratingMessage':{'type':Sequelize[_0x0e0c('0x5')]},'pathTranscript':{'type':Sequelize[_0x0e0c('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0e0c('0x6')]},'disposition':{'type':Sequelize[_0x0e0c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0e0c('0x7')]},'note':{'type':Sequelize[_0x0e0c('0x7')]},'browserName':{'type':Sequelize[_0x0e0c('0x7')]},'browserVersion':{'type':Sequelize[_0x0e0c('0x7')]},'osName':{'type':Sequelize[_0x0e0c('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x0e0c('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x0e0c('0x7')]},'formData':{'type':Sequelize[_0x0e0c('0x5')](_0x0e0c('0x8'))},'read1stAt':{'type':Sequelize[_0x0e0c('0x6')]},'lastMsgAt':{'type':Sequelize[_0x0e0c('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0e0c('0x3')]('in',_0x0e0c('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0e0c('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x0e0c('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 3b2ed65..c69a1f0 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 _0xddc5=['buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','ChatWebsiteId','where','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)','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','user','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','merge','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','filename','file','mimetype','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','User','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','include','findAll','getMyMessages','includeAgent','setTags','emit','chatInteractionTags:save','removeTags','unix','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','out','direction','renderFile','server','views','transcript-','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','end','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','talking','answered','total','closed','UserId','waiting','disposition','abandoned','unmanaged','index','ChatInteraction','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','find','ContactId'];(function(_0x222af7,_0x507d48){var _0x42bb7b=function(_0x2920b1){while(--_0x2920b1){_0x222af7['push'](_0x222af7['shift']());}};_0x42bb7b(++_0x507d48);}(_0xddc5,0xba));var _0x5ddc=function(_0x2de7d9,_0x167fb0){_0x2de7d9=_0x2de7d9-0x0;var _0x317d15=_0xddc5[_0x2de7d9];return _0x317d15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ddc('0x0'));var zipdir=require(_0x5ddc('0x1'));var jsonpatch=require(_0x5ddc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ddc('0x3'));var Mustache=require('mustache');var util=require(_0x5ddc('0x4'));var path=require(_0x5ddc('0x5'));var sox=require(_0x5ddc('0x6'));var csv=require(_0x5ddc('0x7'));var ejs=require(_0x5ddc('0x8'));var fs=require('fs');var fs_extra=require(_0x5ddc('0x9'));var _=require('lodash');var squel=require(_0x5ddc('0xa'));var crypto=require('crypto');var jsforce=require(_0x5ddc('0xb'));var deskjs=require(_0x5ddc('0xc'));var toCsv=require(_0x5ddc('0x7'));var querystring=require(_0x5ddc('0xd'));var Papa=require(_0x5ddc('0xe'));var Redis=require(_0x5ddc('0xf'));var authService=require(_0x5ddc('0x10'));var qs=require(_0x5ddc('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5ddc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ddc('0x13'))('api');var utils=require(_0x5ddc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5ddc('0x15'));var db=require(_0x5ddc('0x16'))['db'];config[_0x5ddc('0x17')]=_['defaults'](config['redis'],{'host':_0x5ddc('0x18'),'port':0x18eb});var socket=require(_0x5ddc('0x19'))(new Redis(config[_0x5ddc('0x17')]));require(_0x5ddc('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5ddc('0x1b')][_0x5ddc('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x5ddc('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x4bb4ff,_0x25a521,_0x126f31,_0x172b66){return new BPromise(function(_0x491257,_0x345fe4){var _0x5c103b=_0x172b66||client;return _0x5c103b['request'](_0x4bb4ff,_0x126f31)[_0x5ddc('0x1d')](function(_0x4c3db4){logger['info'](_0x5ddc('0x1e'),_0x25a521,_0x5ddc('0x1f'));logger['debug'](_0x5ddc('0x20'),_0x25a521,_0x5ddc('0x1f'),JSON[_0x5ddc('0x21')](_0x4c3db4));if(_0x4c3db4[_0x5ddc('0x22')]){if(_0x4c3db4[_0x5ddc('0x22')][_0x5ddc('0x23')]===0x1f4){logger[_0x5ddc('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x25a521,_0x4c3db4[_0x5ddc('0x22')]['message']);return _0x345fe4(_0x4c3db4[_0x5ddc('0x22')][_0x5ddc('0x24')]);}logger['error'](_0x5ddc('0x1e'),_0x25a521,_0x4c3db4[_0x5ddc('0x22')]['message']);return _0x491257(_0x4c3db4[_0x5ddc('0x22')][_0x5ddc('0x24')]);}else{logger[_0x5ddc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x25a521,_0x5ddc('0x1f'));_0x491257(_0x4c3db4['result']['message']);}})[_0x5ddc('0x26')](function(_0xaffc49){logger[_0x5ddc('0x22')](_0x5ddc('0x1e'),_0x25a521,_0xaffc49);_0x345fe4(_0xaffc49);});});}function respondWithStatusCode(_0x499216,_0x3d09df){_0x3d09df=_0x3d09df||0xcc;return function(_0x3afc30){if(_0x3afc30){return _0x499216[_0x5ddc('0x27')](_0x3d09df);}return _0x499216[_0x5ddc('0x28')](_0x3d09df)['end']();};}function respondWithResult(_0x3ab1b0,_0x443a92){_0x443a92=_0x443a92||0xc8;return function(_0x4ca8cf){if(_0x4ca8cf){return _0x3ab1b0['status'](_0x443a92)[_0x5ddc('0x29')](_0x4ca8cf);}};}function respondWithFilteredResult(_0x526e04,_0x5217c7){return function(_0x52b18d){if(_0x52b18d){var _0x123d11=typeof _0x5217c7['offset']===_0x5ddc('0x2a')&&typeof _0x5217c7[_0x5ddc('0x2b')]===_0x5ddc('0x2a');var _0x23dd8d=_0x52b18d[_0x5ddc('0x2c')];var _0x27e6c3=_0x123d11?0x0:_0x5217c7[_0x5ddc('0x2d')];var _0x442c76=_0x123d11?_0x52b18d['count']:_0x5217c7[_0x5ddc('0x2d')]+_0x5217c7[_0x5ddc('0x2b')];var _0x4f3287;if(_0x442c76>=_0x23dd8d){_0x442c76=_0x23dd8d;_0x4f3287=0xc8;}else{_0x4f3287=0xce;}_0x526e04[_0x5ddc('0x28')](_0x4f3287);return _0x526e04[_0x5ddc('0x2e')](_0x5ddc('0x2f'),_0x27e6c3+'-'+_0x442c76+'/'+_0x23dd8d)[_0x5ddc('0x29')](_0x52b18d);}return null;};}function patchUpdates(_0x10d630){return function(_0x2c7a70){try{jsonpatch['apply'](_0x2c7a70,_0x10d630,!![]);}catch(_0x1a5d6f){return BPromise['reject'](_0x1a5d6f);}return _0x2c7a70[_0x5ddc('0x30')]();};}function saveUpdates(_0x3b848f,_0x2bf35b){return function(_0x338237){if(_0x338237){return _0x338237[_0x5ddc('0x31')](_0x3b848f)[_0x5ddc('0x1d')](function(_0x438fc8){return _0x438fc8;});}return null;};}function removeEntity(_0x4c66dc,_0x4d8448){return function(_0xf2a3a7){if(_0xf2a3a7){return _0xf2a3a7[_0x5ddc('0x32')]()[_0x5ddc('0x1d')](function(){_0x4c66dc[_0x5ddc('0x28')](0xcc)[_0x5ddc('0x33')]();});}};}function handleEntityNotFound(_0x16752b,_0x598f11){return function(_0x4178f7){if(!_0x4178f7){_0x16752b[_0x5ddc('0x27')](0x194);}return _0x4178f7;};}function handleError(_0x93d25a,_0x590d0d){_0x590d0d=_0x590d0d||0x1f4;return function(_0x996552){logger[_0x5ddc('0x22')](_0x996552['stack']);if(_0x996552[_0x5ddc('0x34')]){delete _0x996552[_0x5ddc('0x34')];}_0x93d25a['status'](_0x590d0d)[_0x5ddc('0x35')](_0x996552);};}function getMustacheRender(_0x5c3d01,_0x35498c){return Mustache['render'](_0x5c3d01,_['merge'](_0x35498c[_0x5ddc('0x36')],{'contact':_0x35498c[_0x5ddc('0x37')],'message':_0x35498c[_0x5ddc('0x24')],'agent':_0x35498c['agent'],'interaction':_0x35498c[_0x5ddc('0x38')],'account':_0x35498c[_0x5ddc('0x39')]}))||'';}function getInteractionUsers(_0xbecc4c,_0x5a7377){return new BPromise(function(_0x13eae4,_0x2a7836){try{if(_0x5a7377[_0xbecc4c['id']]){_0xbecc4c[_0x5ddc('0x3a')]=_[_0x5ddc('0x3b')](_0x5a7377[_0xbecc4c['id']],function(_0x35d09c){return{'id':_0x35d09c['id'],'fullname':_0x35d09c[_0x5ddc('0x3c')]};});}}catch(_0xe9e85c){_0x2a7836(_0xe9e85c);}_0x13eae4(_0xbecc4c);});}function getInteractionTags(_0x609368,_0x4980af){return new BPromise(function(_0x48066d,_0x337845){try{if(_0x609368[_0x5ddc('0x3d')]){_0x609368[_0x5ddc('0x3e')]=[];_0x609368['TagIds'][_0x5ddc('0x3f')](',')[_0x5ddc('0x40')](function(_0x251636){_0x609368['Tags'][_0x5ddc('0x41')](_0x4980af[_0x251636]);});}delete _0x609368['TagIds'];}catch(_0x38e138){_0x337845(_0x38e138);}_0x48066d(_0x609368);});}function updateChatInteraction(_0x11b118,_0x5eb937,_0x2cf3a2){return new BPromise(function(_0x3ee2d2,_0x55ccbd){return getInteractionUsers(_0x11b118,_0x2cf3a2)[_0x5ddc('0x1d')](function(_0x37eecc){return getInteractionTags(_0x37eecc,_0x5eb937);})[_0x5ddc('0x1d')](function(_0x3ec5e5){return getStateInteraction(_0x3ec5e5);})[_0x5ddc('0x1d')](function(_0x5121d4){_0x3ee2d2(_0x5121d4);})[_0x5ddc('0x26')](function(_0x53499c){_0x55ccbd(_0x53499c);});});}function getStateInteraction(_0x750a2b){return new BPromise(function(_0x494e13){_0x750a2b['waiting']=0x0;_0x750a2b[_0x5ddc('0x42')]=0x0;_0x750a2b[_0x5ddc('0x43')]=0x0;_0x750a2b['unmanaged']=0x0;_0x750a2b['abandoned']=0x0;_0x750a2b[_0x5ddc('0x44')]=0x0;if(!_0x750a2b[_0x5ddc('0x45')]&&!_0x750a2b[_0x5ddc('0x46')]){_0x750a2b[_0x5ddc('0x47')]+=0x1;}if(!_0x750a2b[_0x5ddc('0x45')]&&_0x750a2b[_0x5ddc('0x46')]){_0x750a2b[_0x5ddc('0x42')]+=0x1;if(_0x750a2b[_0x5ddc('0x47')]){_0x750a2b[_0x5ddc('0x47')]-=0x1;}}if(_0x750a2b[_0x5ddc('0x45')]&&_0x750a2b[_0x5ddc('0x48')]===_0x5ddc('0x49')){_0x750a2b['abandoned']+=0x1;if(_0x750a2b[_0x5ddc('0x47')]){_0x750a2b['waiting']-=0x1;}}else if(_0x750a2b[_0x5ddc('0x45')]&&!_0x750a2b[_0x5ddc('0x46')]&&_0x750a2b[_0x5ddc('0x48')]){_0x750a2b[_0x5ddc('0x4a')]+=0x1;if(_0x750a2b[_0x5ddc('0x47')]){_0x750a2b[_0x5ddc('0x47')]-=0x1;}}else if(_0x750a2b[_0x5ddc('0x45')]&&_0x750a2b[_0x5ddc('0x46')]){_0x750a2b[_0x5ddc('0x43')]+=0x1;if(_0x750a2b[_0x5ddc('0x42')]){_0x750a2b[_0x5ddc('0x42')]-=0x1;}}_0x750a2b[_0x5ddc('0x44')]+=0x1;_0x494e13(_0x750a2b);});}exports[_0x5ddc('0x4b')]=function(_0x3ddbb4,_0x5a38a2){var _0x4e0c9f={},_0x52fe61={},_0x2f2ced={'count':0x0,'rows':[]};var _0x48d976=_[_0x5ddc('0x3b')](db[_0x5ddc('0x4c')][_0x5ddc('0x4d')],function(_0xef8ed8){return{'name':_0xef8ed8['fieldName'],'type':_0xef8ed8[_0x5ddc('0x4e')][_0x5ddc('0x4f')]};});_0x52fe61[_0x5ddc('0x50')]=_[_0x5ddc('0x3b')](_0x48d976,_0x5ddc('0x34'));_0x52fe61['query']=_[_0x5ddc('0x51')](_0x3ddbb4[_0x5ddc('0x52')]);_0x52fe61[_0x5ddc('0x53')]=_['intersection'](_0x52fe61[_0x5ddc('0x50')],_0x52fe61[_0x5ddc('0x52')]);_0x4e0c9f[_0x5ddc('0x54')]=_[_0x5ddc('0x55')](_0x52fe61[_0x5ddc('0x50')],qs[_0x5ddc('0x56')](_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x56')]));_0x4e0c9f[_0x5ddc('0x54')]=_0x4e0c9f[_0x5ddc('0x54')][_0x5ddc('0x57')]?_0x4e0c9f['attributes']:_0x52fe61[_0x5ddc('0x50')];if(!_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x58')](_0x5ddc('0x59'))){_0x4e0c9f[_0x5ddc('0x2b')]=qs[_0x5ddc('0x2b')](_0x3ddbb4[_0x5ddc('0x52')]['limit']);_0x4e0c9f[_0x5ddc('0x2d')]=qs[_0x5ddc('0x2d')](_0x3ddbb4['query'][_0x5ddc('0x2d')]);}_0x4e0c9f[_0x5ddc('0x5a')]=qs[_0x5ddc('0x5b')](_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x5b')]);_0x4e0c9f['where']=qs[_0x5ddc('0x53')](_[_0x5ddc('0x5c')](_0x3ddbb4[_0x5ddc('0x52')],_0x52fe61[_0x5ddc('0x53')]),_0x48d976);var _0x2d45bb=[];var _0x4d0575=squel[_0x5ddc('0x5d')]()[_0x5ddc('0x5e')]('id')[_0x5ddc('0x5e')](_0x5ddc('0x34'))[_0x5ddc('0x5e')](_0x5ddc('0x5f'))[_0x5ddc('0x60')](_0x5ddc('0x61'));var _0x34ba3e=squel['select']()['field']('u.id')[_0x5ddc('0x5e')](_0x5ddc('0x62'))['field'](_0x5ddc('0x63'))[_0x5ddc('0x60')](_0x5ddc('0x64'),'ui')['left_join'](_0x5ddc('0x65'),'u',_0x5ddc('0x66'));var _0x2d8b60=squel[_0x5ddc('0x5d')]()[_0x5ddc('0x60')](_0x5ddc('0x67'),'i')['left_join'](_0x5ddc('0x68'),'c',_0x5ddc('0x69'))[_0x5ddc('0x6a')](_0x5ddc('0x65'),'o','o.id\x20=\x20i.UserId')[_0x5ddc('0x6a')](_0x5ddc('0x6b'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x5ddc('0x6a')]('chat_messages','me',_0x5ddc('0x6c'))[_0x5ddc('0x6a')](_0x5ddc('0x6d'),'it',_0x5ddc('0x6e'))['left_join'](_0x5ddc('0x61'),'t',_0x5ddc('0x6f'));var _0x3cb658=squel[_0x5ddc('0x70')]();var _0x296a7d=[];var _0x373a07=squel[_0x5ddc('0x70')]();var _0x29d5b6;if(_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x71')]){_0x29d5b6=as['parseSearch'](_0x3ddbb4[_0x5ddc('0x52')]['search']);var _0x1e6181=_0x29d5b6[_0x5ddc('0x72')];for(var _0x498c69=0x0;_0x498c69<_0x29d5b6[_0x5ddc('0x73')][_0x5ddc('0x57')];_0x498c69++){var _0xef10e6=_0x29d5b6[_0x5ddc('0x73')][_0x498c69];var _0x77f9c0='i';var _0x41aacb=_['find'](_0x48d976,['name',_0xef10e6[_0x5ddc('0x5e')]]);if(!_0x41aacb){switch(_0xef10e6[_0x5ddc('0x5e')]){case'unreadMessages':if(_0xef10e6['value']==0x1){_0x2d8b60['having']('`'+_0xef10e6[_0x5ddc('0x5e')]+_0x5ddc('0x74'));}else{_0x2d8b60[_0x5ddc('0x75')]('`'+_0xef10e6[_0x5ddc('0x5e')]+_0x5ddc('0x76'));}break;case _0x5ddc('0x77'):if(_0xef10e6['operator']===_0x5ddc('0x78')){if(_0xef10e6[_0x5ddc('0x79')][_0x5ddc('0x3f')]('\x20')[_0x5ddc('0x57')]>0x1){_0x3cb658[_0x1e6181]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xef10e6[_0x5ddc('0x79')]),null);}else{var _0x2002d6='%'+_0xef10e6[_0x5ddc('0x79')]+'%';_0x3cb658[_0x1e6181]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2002d6,_0x2002d6,_0x2002d6);}}else{_0x41aacb=_[_0x5ddc('0x7a')](_0x48d976,[_0x5ddc('0x34'),_0x5ddc('0x7b')]);_0xef10e6['field']=_0x5ddc('0x7b');_0x34b4de=as[_0x5ddc('0x7c')](_0x77f9c0,_0x41aacb[_0x5ddc('0x4e')],_0xef10e6);_0x3cb658[_0x1e6181](_0x34b4de[_0x5ddc('0x7d')],_0x34b4de[_0x5ddc('0x79')]['start'],_0x34b4de['value']['end']);}break;case _0x5ddc('0x7e'):var _0x4feb91=_0xef10e6['value']['split'](',')[_0x5ddc('0x3b')](function(_0x3eb127){return Number(_0x3eb127);});_0x4feb91[_0x5ddc('0x40')](function(_0xe19331){_0x373a07['or'](_0x5ddc('0x7f'),'%,'+_0xe19331+',%');});_0x296a7d=_['union'](_0x296a7d,_0x4feb91);break;case'User':if(_0xef10e6['operator']===_0x5ddc('0x78')){_0x3cb658[_0x1e6181](_0x5ddc('0x80'),'%'+_0xef10e6[_0x5ddc('0x79')]+'%',null);}else{_0x41aacb=_['find'](_0x48d976,[_0x5ddc('0x34'),_0x5ddc('0x46')]);_0xef10e6[_0x5ddc('0x5e')]=_0x5ddc('0x46');_0x34b4de=as['buildExpression'](_0x77f9c0,_0x41aacb[_0x5ddc('0x4e')],_0xef10e6);_0x3cb658[_0x1e6181](_0x34b4de[_0x5ddc('0x7d')],_0x34b4de['value'][_0x5ddc('0x81')],_0x34b4de[_0x5ddc('0x79')][_0x5ddc('0x33')]);}break;case _0x5ddc('0x36'):_0x34b4de=as[_0x5ddc('0x7c')]('me',null,_0xef10e6);_0x3cb658[_0x1e6181](_0x34b4de[_0x5ddc('0x7d')],_0x34b4de[_0x5ddc('0x79')][_0x5ddc('0x81')],_0x34b4de[_0x5ddc('0x79')][_0x5ddc('0x33')]);break;}}else{var _0x34b4de=as[_0x5ddc('0x7c')](_0x77f9c0,_0x41aacb[_0x5ddc('0x4e')],_0xef10e6);_0x3cb658[_0x1e6181](_0x34b4de[_0x5ddc('0x7d')],_0x34b4de[_0x5ddc('0x79')][_0x5ddc('0x81')],_0x34b4de[_0x5ddc('0x79')][_0x5ddc('0x33')]);}}}else{var _0xdedc2f=_(_0x3ddbb4['query'])['keys']()[_0x5ddc('0x3b')](function(_0x3ffecb){return _[_0x5ddc('0x82')](_0x48d976,[_0x5ddc('0x34'),_0x3ffecb])?_0x3ffecb:undefined;})[_0x5ddc('0x83')]()[_0x5ddc('0x79')]();if(!_[_0x5ddc('0x84')](_0xdedc2f)){_0xdedc2f[_0x5ddc('0x40')](function(_0x18c9be){if(_0x18c9be===_0x5ddc('0x85')){_0x2d8b60[_0x5ddc('0x86')]('i.ChatWebsiteId\x20IN\x20?',[][_0x5ddc('0x87')](_0x3ddbb4[_0x5ddc('0x52')][_0x18c9be]));}else if(_0x18c9be==='createdAt'){var _0x690480=JSON[_0x5ddc('0x88')](_0x3ddbb4[_0x5ddc('0x52')][_0x18c9be])[_0x5ddc('0x89')];var _0x322596=JSON[_0x5ddc('0x88')](_0x3ddbb4[_0x5ddc('0x52')][_0x18c9be])[_0x5ddc('0x8a')];_0x2d8b60['where'](_0x5ddc('0x8b'),_0x690480,_0x322596);}else{if(_0x3ddbb4[_0x5ddc('0x52')][_0x18c9be]===_0x5ddc('0x8c')){_0x2d8b60[_0x5ddc('0x86')]('i.'+_0x18c9be+_0x5ddc('0x8d'));}else{_0x2d8b60[_0x5ddc('0x86')]('i.'+_0x18c9be+_0x5ddc('0x8e'),_0x3ddbb4[_0x5ddc('0x52')][_0x18c9be]);}}});}if(_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x8f')]){if(_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x8f')]==0x1){_0x2d8b60['having']('`unreadMessages`\x20=\x200');}else{_0x2d8b60[_0x5ddc('0x75')](_0x5ddc('0x90'));}}if(_0x3ddbb4['query'][_0x5ddc('0x91')]){_0x296a7d=_['isArray'](_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x91')])?_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x91')]:new Array(_0x3ddbb4[_0x5ddc('0x52')]['tag']);_0x296a7d[_0x5ddc('0x40')](function(_0x2caa35){_0x373a07['or'](_0x5ddc('0x7f'),'%,'+_0x2caa35+',%');});}if(_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x92')]){var _0x9e4367=_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x92')]['replace']('\x5c','\x5c\x5c')[_0x5ddc('0x93')](/'/g,'\x27\x27');if(qs[_0x5ddc('0x94')](_0x9e4367)){_0x3cb658['or'](_0x5ddc('0x95'),_0x9e4367+'%');}else{_0x3cb658['or'](_0x5ddc('0x96'),qs[_0x5ddc('0x97')](_0x9e4367))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9e4367+'%');}}}_0x2d8b60[_0x5ddc('0x86')](_0x3cb658);_0x2d8b60['group'](_0x5ddc('0x98'));var _0x38c620={'type':db[_0x5ddc('0x99')][_0x5ddc('0x9a')][_0x5ddc('0x9b')],'raw':!![]};var _0x3f274e=_0x2d8b60[_0x5ddc('0x9c')]();_0x3f274e[_0x5ddc('0x5e')]('i.id');_0x3f274e[_0x5ddc('0x5e')](_0x5ddc('0x9d'),_0x5ddc('0x9e'));if(_0x4e0c9f[_0x5ddc('0x5a')]){_0x4e0c9f[_0x5ddc('0x5a')]['forEach'](function(_0x226902){var _0x2976eb=_0x226902[0x0]===_0x5ddc('0x9f')?_0x226902[0x0]:'i.'+_0x226902[0x0];_0x2d8b60[_0x5ddc('0x5a')](_0x2976eb,_0x226902[0x1]===_0x5ddc('0xa0')?![]:!![]);});}if(!_[_0x5ddc('0x84')](_0x296a7d)){_0x2d8b60[_0x5ddc('0x75')](_0x373a07);_0x3f274e[_0x5ddc('0x86')](_0x5ddc('0xa1'),_0x296a7d);}BPromise[_0x5ddc('0xa2')]()[_0x5ddc('0x1d')](function(){if(!_0x29d5b6){if(_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x85')])return;_0x3f274e[_0x5ddc('0x86')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2d8b60[_0x5ddc('0x86')](_0x5ddc('0xa3'));return;}if(_0x3ddbb4['user'][_0x5ddc('0xa4')]!==_0x5ddc('0xa5'))return;return _0x3ddbb4['user'][_0x5ddc('0xa6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd84bb6){if(_['isEmpty'](_0xd84bb6)){_0x3f274e[_0x5ddc('0x86')](_0x5ddc('0xa7'));_0x2d8b60['where'](_0x5ddc('0xa7'));}else{_0x3f274e[_0x5ddc('0x86')](_0x5ddc('0xa8'),_[_0x5ddc('0x3b')](_0xd84bb6,'id'));_0x2d8b60[_0x5ddc('0x86')](_0x5ddc('0xa8'),_[_0x5ddc('0x3b')](_0xd84bb6,'id'));}});})[_0x5ddc('0x1d')](function(){if(_0x3ddbb4[_0x5ddc('0xa9')][_0x5ddc('0xa4')]===_0x5ddc('0xa5')&&!_0x29d5b6&&!_0x3ddbb4[_0x5ddc('0x52')][_0x5ddc('0x85')])return[];return db[_0x5ddc('0xaa')]['query'](_0x3f274e[_0x5ddc('0xab')](),_0x38c620);})[_0x5ddc('0x1d')](function(_0x3a74c8){_0x2f2ced[_0x5ddc('0x2c')]=_0x3a74c8[_0x5ddc('0x57')];if(_0x2f2ced['count']===0x0)return[];return db[_0x5ddc('0xaa')][_0x5ddc('0x52')](_0x4d0575['toString'](),_0x38c620)[_0x5ddc('0x1d')](function(_0x476369){_0x2d45bb=_[_0x5ddc('0xac')](_0x476369,'id');_0x38c620=_['merge'](_0x38c620,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ddbb4['query']['fields']){_0x4e0c9f[_0x5ddc('0x54')][_0x5ddc('0x40')](function(_0x448959){_0x2d8b60['field']('i.'+_0x448959);});}else{_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0x9d'),_0x5ddc('0x9e'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xad'),_0x5ddc('0xae'));_0x2d8b60['field'](_0x5ddc('0xaf'),_0x5ddc('0xb0'));_0x2d8b60['field']('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',_0x5ddc('0x9f'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xb1'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xb2'),_0x5ddc('0xb3'));_0x2d8b60[_0x5ddc('0x5e')]('c.lastName',_0x5ddc('0xb4'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xb5'),_0x5ddc('0xb6'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xb7'),_0x5ddc('0xb8'));_0x2d8b60['field']('c.mobile',_0x5ddc('0xb9'));_0x2d8b60[_0x5ddc('0x5e')]('c.fax',_0x5ddc('0xba'));_0x2d8b60[_0x5ddc('0x5e')](_0x5ddc('0xbb'),_0x5ddc('0xbc'));_0x2d8b60[_0x5ddc('0x5e')]('o.internal','Owner.internal');_0x2d8b60['field'](_0x5ddc('0xbd'),_0x5ddc('0x3d'));}if(_0x4e0c9f[_0x5ddc('0x2b')])_0x2d8b60[_0x5ddc('0x2b')](_0x4e0c9f[_0x5ddc('0x2b')]);if(_0x4e0c9f[_0x5ddc('0x2d')])_0x2d8b60[_0x5ddc('0x2d')](_0x4e0c9f['offset']);return db[_0x5ddc('0xaa')]['query'](_0x2d8b60[_0x5ddc('0xab')](),_0x38c620);})[_0x5ddc('0x1d')](function(_0x2b8571){if(_0x2b8571[_0x5ddc('0x57')]>0x0)_0x34ba3e['where'](_0x5ddc('0xbe'),_[_0x5ddc('0x3b')](_0x2b8571,'id'));return db[_0x5ddc('0xaa')]['query'](_0x34ba3e['toString'](),_0x38c620)[_0x5ddc('0x1d')](function(_0x143db2){var _0x4d2771=_[_0x5ddc('0xbf')](_0x143db2,'ChatInteractionId');var _0x239395=[];_0x2b8571[_0x5ddc('0x40')](function(_0x2fd415){_0x239395[_0x5ddc('0x41')](updateChatInteraction(_0x2fd415,_0x2d45bb,_0x4d2771));});return BPromise[_0x5ddc('0xc0')](_0x239395);});});})[_0x5ddc('0x1d')](function(_0x45e6bb){_0x2f2ced[_0x5ddc('0xc1')]=_0x45e6bb;return _0x2f2ced;})[_0x5ddc('0x1d')](respondWithFilteredResult(_0x5a38a2,_0x4e0c9f))['catch'](handleError(_0x5a38a2,null));};exports['show']=function(_0x24f740,_0x4a323a){var _0xdb1be3={'raw':![],'where':{'id':_0x24f740[_0x5ddc('0xc2')]['id']}},_0x3740bc={};_0x3740bc[_0x5ddc('0x50')]=_[_0x5ddc('0x51')](db[_0x5ddc('0x4c')][_0x5ddc('0x4d')]);_0x3740bc[_0x5ddc('0x52')]=_[_0x5ddc('0x51')](_0x24f740[_0x5ddc('0x52')]);_0x3740bc[_0x5ddc('0x53')]=_['intersection'](_0x3740bc['model'],_0x3740bc['query']);_0xdb1be3['attributes']=_[_0x5ddc('0x55')](_0x3740bc['model'],qs['fields'](_0x24f740[_0x5ddc('0x52')][_0x5ddc('0x56')]));_0xdb1be3['attributes']=_0xdb1be3[_0x5ddc('0x54')][_0x5ddc('0x57')]?_0xdb1be3[_0x5ddc('0x54')]:_0x3740bc[_0x5ddc('0x50')];if(_0x24f740['query'][_0x5ddc('0xc3')]){_0xdb1be3['include']=[{'all':!![]}];}_0xdb1be3=_[_0x5ddc('0xc4')]({},_0xdb1be3,_0x24f740[_0x5ddc('0xc5')]);return db[_0x5ddc('0x4c')][_0x5ddc('0x7a')](_0xdb1be3)[_0x5ddc('0x1d')](handleEntityNotFound(_0x4a323a,null))[_0x5ddc('0x1d')](respondWithResult(_0x4a323a,null))[_0x5ddc('0x26')](handleError(_0x4a323a,null));};exports[_0x5ddc('0xc6')]=function(_0x2099c5,_0x210182){return db[_0x5ddc('0x4c')]['create'](_0x2099c5[_0x5ddc('0x36')],{})['then'](respondWithResult(_0x210182,0xc9))[_0x5ddc('0x26')](handleError(_0x210182,null));};exports[_0x5ddc('0x31')]=function(_0x228f19,_0x538d32){if(_0x228f19[_0x5ddc('0x36')]['id']){delete _0x228f19[_0x5ddc('0x36')]['id'];}return db['ChatInteraction'][_0x5ddc('0x7a')]({'where':{'id':_0x228f19[_0x5ddc('0xc2')]['id']}})['then'](handleEntityNotFound(_0x538d32,null))[_0x5ddc('0x1d')](saveUpdates(_0x228f19[_0x5ddc('0x36')],null))[_0x5ddc('0x1d')](respondWithResult(_0x538d32,null))['catch'](handleError(_0x538d32,null));};exports[_0x5ddc('0x32')]=function(_0x388289,_0x11fe79){return db['ChatInteraction']['find']({'where':{'id':_0x388289[_0x5ddc('0xc2')]['id']}})[_0x5ddc('0x1d')](handleEntityNotFound(_0x11fe79,null))['then'](removeEntity(_0x11fe79,null))[_0x5ddc('0x26')](handleError(_0x11fe79,null));};exports[_0x5ddc('0xc7')]=function(_0x3097cb,_0x584341){return db['ChatInteraction'][_0x5ddc('0xc7')]()['then'](respondWithResult(_0x584341,null))['catch'](handleError(_0x584341,null));};exports[_0x5ddc('0xc8')]=function(_0x3c2420,_0x23d96b){var _0x4d1763=_0x3c2420['params']['id'];var _0x23558b;var _0x309f61;var _0x240c1;return db[_0x5ddc('0x4c')][_0x5ddc('0xc9')]({'where':{'id':_0x4d1763}})[_0x5ddc('0x1d')](function(_0x556601){_0x23558b=_0x556601;return db[_0x5ddc('0xca')][_0x5ddc('0xc9')]({'where':{'id':_0x556601[_0x5ddc('0x85')]},'attributes':['id','vidaooApiKey',_0x5ddc('0xcb'),_0x5ddc('0xcc'),_0x5ddc('0xcd'),_0x5ddc('0xce')],'raw':!![]});})['then'](function(_0x1d7468){if(_0x1d7468&&_0x1d7468[_0x5ddc('0xcf')]&&_0x1d7468[_0x5ddc('0xcb')]){_0x309f61=_0x1d7468;var _0x168a63={'interaction':{'id':_0x4d1763},'agent':{'id':_0x3c2420[_0x5ddc('0xa9')]['id'],'name':_0x3c2420[_0x5ddc('0xa9')][_0x5ddc('0x34')],'fullname':_0x3c2420[_0x5ddc('0xa9')][_0x5ddc('0x3c')],'email':_0x3c2420[_0x5ddc('0xa9')][_0x5ddc('0xd0')]},'contact':_0x3c2420[_0x5ddc('0x36')]['contact'],'account':_0x3c2420[_0x5ddc('0x36')][_0x5ddc('0x39')]};var _0x2f4b89={'rejectUnauthorized':![],'method':'POST','url':_0x5ddc('0xd1'),'headers':{'X-APIKEY':_0x1d7468[_0x5ddc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c2420['user'][_0x5ddc('0xd0')]],'buttons':null,'topic':_0x309f61[_0x5ddc('0xcc')],'note':_['isNull'](_0x309f61[_0x5ddc('0xcd')])?null:getMustacheRender(_0x309f61[_0x5ddc('0xcd')],_0x168a63),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5ddc('0xd2')](_0x309f61['vidaooMetadata'])){var _0x1b3930=getMustacheRender(_0x309f61[_0x5ddc('0xce')],_0x168a63);var _0x3b63d2=JSON['parse'](_0x1b3930);_0x2f4b89[_0x5ddc('0x36')][_0x5ddc('0xd3')]=_0x3b63d2;}}catch(_0x5562cf){throw new db[(_0x5ddc('0x99'))][(_0x5ddc('0xd4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2f4b89);}else{throw new db[(_0x5ddc('0x99'))]['ValidationError'](_0x5ddc('0xd5'));}})[_0x5ddc('0x1d')](function(_0x4dda03){_0x240c1=_0x4dda03;if(_0x240c1['id']){var _0xc1d5e={'body':_0x240c1['join_url'],'ChatWebsiteId':_0x309f61['id'],'ChatInteractionId':_0x23558b['id'],'direction':'out','UserId':_0x3c2420['user']['id']};return db[_0x5ddc('0xd6')][_0x5ddc('0xc6')](_0xc1d5e,{});}else{throw new db[(_0x5ddc('0x99'))][(_0x5ddc('0xd4'))](_0x5ddc('0xd7'));}})[_0x5ddc('0x1d')](function(){return _0x23558b[_0x5ddc('0xd8')]({'vidaooSessionId':_0x240c1['id']});})[_0x5ddc('0x1d')](respondWithResult(_0x23d96b,null))[_0x5ddc('0x26')](handleError(_0x23d96b,null));};exports[_0x5ddc('0xd9')]=function(_0xc440b2,_0x4e0021){if(_0xc440b2[_0x5ddc('0x36')]['id']){delete _0xc440b2[_0x5ddc('0x36')]['id'];}return db['ChatInteraction'][_0x5ddc('0x7a')]({'where':{'id':_0xc440b2[_0x5ddc('0xc2')]['id']},'include':[{'model':db[_0x5ddc('0xda')],'as':_0x5ddc('0x77')}]})[_0x5ddc('0x1d')](handleEntityNotFound(_0x4e0021,null))[_0x5ddc('0x1d')](saveUpdates(_0xc440b2[_0x5ddc('0x36')],null))[_0x5ddc('0x1d')](respondWithResult(_0x4e0021,null))[_0x5ddc('0x26')](handleError(_0x4e0021,null));};exports[_0x5ddc('0xdb')]=function(_0x491723,_0x36d287,_0x4791ce){if(_0x491723[_0x5ddc('0x36')]['id']){delete _0x491723[_0x5ddc('0x36')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x491723[_0x5ddc('0xc2')]['id']}})[_0x5ddc('0x1d')](function(_0x266ad0){if(!_0x266ad0){logger[_0x5ddc('0x22')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5ddc('0xdb'),0x194,_0x5ddc('0xdc'));_0x36d287[_0x5ddc('0x27')](0x194);}else{if(_0x266ad0['UserId']){throw new db[(_0x5ddc('0x99'))][(_0x5ddc('0xd4'))](_0x5ddc('0xdd'));}}return _0x266ad0;})[_0x5ddc('0x1d')](function(_0x5c00d9){if(_0x5c00d9){return _0x5c00d9['update']({'closed':_0x491723[_0x5ddc('0x36')]['closed'],'disposition':_0x491723[_0x5ddc('0x36')]['disposition']})['then'](function(_0x4a373b){return _0x4a373b;});}})[_0x5ddc('0x1d')](function(_0x1434b0){return respondWithRpcPromise(_0x5ddc('0xde'),_0x5ddc('0xdb'),_0x491723[_0x5ddc('0x36')],client9004);})[_0x5ddc('0x1d')](respondWithResult(_0x36d287,null))[_0x5ddc('0x26')](handleError(_0x36d287,null));};exports[_0x5ddc('0xdf')]=function(_0x22c2b3,_0x18648b,_0x110f93){_0x22c2b3['body'][_0x5ddc('0x34')]=_0x22c2b3['file'][_0x5ddc('0xe0')];_0x22c2b3[_0x5ddc('0x36')][_0x5ddc('0xe1')]=_0x22c2b3['file'][_0x5ddc('0xe2')];_0x22c2b3['body']['type']=_0x22c2b3[_0x5ddc('0xe3')][_0x5ddc('0xe4')];return db[_0x5ddc('0xe5')]['create'](_0x22c2b3[_0x5ddc('0x36')])[_0x5ddc('0x1d')](respondWithResult(_0x18648b,0xc9))[_0x5ddc('0x26')](handleError(_0x18648b,null));};exports['attachmentDownload']=function(_0x50a7bf,_0x1b29d3,_0x3fe916){return db['ChatInteraction'][_0x5ddc('0xc9')]({'where':{'id':_0x50a7bf[_0x5ddc('0xc2')]['id']},'raw':!![]})[_0x5ddc('0x1d')](handleEntityNotFound(_0x1b29d3,null))[_0x5ddc('0x1d')](function(_0x4795c9){if(_0x4795c9){if(_0x4795c9['closed']){return _0x1b29d3['status'](0x193)[_0x5ddc('0x29')]({'status':0x193,'message':'Unauthorized'});}return db[_0x5ddc('0xe5')]['findOne']({'where':{'id':_0x50a7bf[_0x5ddc('0x52')][_0x5ddc('0xe6')]},'raw':!![]})[_0x5ddc('0x1d')](handleEntityNotFound(_0x1b29d3,null));}})[_0x5ddc('0x1d')](function(_0x1825d9){if(_0x1825d9){var _0x1f143d=_0x1825d9[_0x5ddc('0xe7')]!==null;var _0xf423ee=path[_0x5ddc('0xe8')](config[_0x5ddc('0xe9')],_0x5ddc('0xea'));if(_0x1f143d){_0xf423ee=path[_0x5ddc('0xe8')](_0xf423ee,'offline-chat/');}var _0x1f5bc6=path[_0x5ddc('0xe8')](_0xf423ee,_0x1825d9[_0x5ddc('0xe1')]);return _0x1b29d3[_0x5ddc('0xeb')](_0x1f5bc6);}})[_0x5ddc('0x26')](handleError(_0x1b29d3,null));};exports[_0x5ddc('0xec')]=function(_0x25b27e,_0x513478){var _0x33dcbe=null;var _0x14af12=null;var _0x448e2f=null;var _0x568e85=null;if(_0x25b27e['body']['id']){delete _0x25b27e[_0x5ddc('0x36')]['id'];}if(_0x25b27e[_0x5ddc('0x36')][_0x5ddc('0xed')]){_0x568e85=path[_0x5ddc('0xe8')](config[_0x5ddc('0xe9')],_0x5ddc('0xee'),util['format'](_0x5ddc('0xef'),Date[_0x5ddc('0xf0')]()));_0x25b27e[_0x5ddc('0x36')][_0x5ddc('0xf1')]=_0x568e85;}return db[_0x5ddc('0x4c')]['find']({'where':{'id':_0x25b27e[_0x5ddc('0xc2')]['id']},'include':[{'model':db[_0x5ddc('0xd6')],'as':'Messages','include':[{'model':db[_0x5ddc('0xf2')],'as':_0x5ddc('0xf2')}]}]})[_0x5ddc('0x1d')](handleEntityNotFound(_0x513478,null))['then'](saveUpdates(_0x25b27e[_0x5ddc('0x36')],null))[_0x5ddc('0x1d')](function(_0x312e2e){if(_0x312e2e){_0x33dcbe=_0x312e2e;return db[_0x5ddc('0xca')]['find']({'where':{'id':_0x33dcbe['ChatWebsiteId']}});}})[_0x5ddc('0x1d')](function(_0x5c72f3){if(_0x5c72f3){_0x448e2f=_0x5c72f3;return db[_0x5ddc('0xda')][_0x5ddc('0x7a')]({'where':{'id':_0x33dcbe[_0x5ddc('0x7b')]}});}})[_0x5ddc('0x1d')](function(_0x17defb){if(_0x17defb){_0x14af12=_0x17defb;if(_0x568e85){var _0x438ab1=null;for(var _0x112f08=0x1;_0x112f08<_0x33dcbe[_0x5ddc('0xf3')][_0x5ddc('0x57')];++_0x112f08){_0x438ab1=_0x33dcbe[_0x5ddc('0xf3')][_0x112f08];var _0x38e4c1=_0x438ab1['UserId']?util[_0x5ddc('0xf4')](_0x5ddc('0xf5'),_0x448e2f['agentAlias'],_0x438ab1[_0x5ddc('0x46')]):_0x5ddc('0xf6');var _0x4c50fc=_0x25b27e[_0x5ddc('0x36')][_0x5ddc('0xf7')]||util[_0x5ddc('0xf4')](_0x5ddc('0xf5'),_0x5ddc('0xf8'),_0x438ab1[_0x5ddc('0x7b')]);switch(_0x448e2f[_0x5ddc('0xf9')]){case _0x5ddc('0xfa'):_0x38e4c1=_0x438ab1[_0x5ddc('0x46')]?util['format'](_0x5ddc('0xf5'),_0x448e2f[_0x5ddc('0xfb')],_0x438ab1[_0x5ddc('0x46')]):_0x5ddc('0xf6');break;case _0x5ddc('0xfc'):_0x38e4c1=_0x438ab1['UserId']?_0x438ab1['User'][_0x5ddc('0xfd')]||_0x438ab1[_0x5ddc('0xf2')][_0x5ddc('0x3c')]:'System';break;case _0x5ddc('0xfe'):_0x38e4c1=_0x438ab1[_0x5ddc('0x46')]?_0x438ab1[_0x5ddc('0xf2')][_0x5ddc('0x3c')]:_0x5ddc('0xf6');break;default:_0x38e4c1=_0x438ab1[_0x5ddc('0x46')]?util[_0x5ddc('0xf4')](_0x5ddc('0xf5'),_0x448e2f[_0x5ddc('0xfb')],_0x438ab1[_0x5ddc('0x46')]):_0x5ddc('0xf6');}var _0x396a6b=util[_0x5ddc('0xf4')]('[%s]\x20%s:\x20%s\x0a',moment(_0x438ab1[_0x5ddc('0xff')])['format'](_0x5ddc('0x100')),_0x438ab1['direction']==='in'?_0x4c50fc:_0x38e4c1,_0x438ab1[_0x5ddc('0x36')]);if(!_0x438ab1[_0x5ddc('0x101')]){fs['appendFileSync'](_0x568e85,_0x396a6b);}}return db[_0x5ddc('0x102')][_0x5ddc('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x5ddc('0x103')],'as':_0x5ddc('0x104'),'raw':!![]}]});}}})[_0x5ddc('0x1d')](function(_0x210f12){if(_0x210f12&&_0x210f12[_0x5ddc('0x104')]&&_0x25b27e['body']){var _0x3cbd8b={'tls':{'rejectUnauthorized':![]}};if(_0x210f12[_0x5ddc('0x104')]['service']){_0x3cbd8b[_0x5ddc('0x105')]=_0x210f12[_0x5ddc('0x104')][_0x5ddc('0x105')];}else{_0x3cbd8b[_0x5ddc('0x106')]=_0x210f12['Smtp']['host'];_0x3cbd8b[_0x5ddc('0x107')]=_0x210f12[_0x5ddc('0x104')][_0x5ddc('0x107')];_0x3cbd8b['secure']=_0x210f12[_0x5ddc('0x104')][_0x5ddc('0x108')];}if(_0x210f12[_0x5ddc('0x104')][_0x5ddc('0x109')]){_0x3cbd8b[_0x5ddc('0x10a')]={'user':_0x210f12[_0x5ddc('0x104')][_0x5ddc('0xa9')],'pass':_0x210f12[_0x5ddc('0x104')]['pass']};}return respondWithRpcPromise('SendMail',_0x5ddc('0x10b'),{'account':_0x3cbd8b,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x210f12['name'],_0x210f12[_0x5ddc('0xd0')]||_0x210f12[_0x5ddc('0x104')][_0x5ddc('0xa9')]),'to':_0x25b27e['body']['mailTranscript'],'subject':_0x5ddc('0x10c'),'text':util['format'](_0x5ddc('0x10d'),_0x25b27e[_0x5ddc('0x36')][_0x5ddc('0xed')]),'attachments':[{'path':_0x568e85}]}})['then'](function(){return _0x33dcbe;})['catch'](function(_0x1ccd71){console['error'](_0x1ccd71);});}else{return _0x33dcbe;}})[_0x5ddc('0x1d')](respondWithStatusCode(_0x513478,0xc8))['catch'](handleError(_0x513478,null));};exports[_0x5ddc('0x10e')]=function(_0xa80399,_0x5a5eca,_0x24afd8){return db[_0x5ddc('0xd6')][_0x5ddc('0x7a')]({'where':{'id':_0xa80399[_0x5ddc('0xc2')]['id']}})[_0x5ddc('0x1d')](handleEntityNotFound(_0x5a5eca,null))['then'](function(_0x2817c1){if(_0x2817c1){return _0x2817c1[_0x5ddc('0x10e')](_0xa80399[_0x5ddc('0x36')][_0x5ddc('0x10f')],_[_0x5ddc('0x110')](_0xa80399['body'],[_0x5ddc('0x10f'),'id'])||{});}})[_0x5ddc('0x1d')](respondWithResult(_0x5a5eca,null))['catch'](handleError(_0x5a5eca,null));};exports[_0x5ddc('0x111')]=function(_0x2dc80e,_0x27cf26,_0x241df3){var _0x222c3a={'raw':![],'where':{}};var _0x4de286={};var _0x5858dc={'count':0x0,'rows':[]};return db[_0x5ddc('0x4c')][_0x5ddc('0xc9')]({'where':{'id':_0x2dc80e[_0x5ddc('0xc2')]['id']}})[_0x5ddc('0x1d')](handleEntityNotFound(_0x27cf26,null))[_0x5ddc('0x1d')](function(_0x566691){if(_0x566691){_0x4de286['model']=_['keys'](db[_0x5ddc('0xd6')][_0x5ddc('0x4d')]);_0x4de286[_0x5ddc('0x52')]=_[_0x5ddc('0x51')](_0x2dc80e[_0x5ddc('0x52')]);_0x4de286[_0x5ddc('0x53')]=_[_0x5ddc('0x55')](_0x4de286[_0x5ddc('0x50')],_0x4de286[_0x5ddc('0x52')]);_0x222c3a[_0x5ddc('0x54')]=_[_0x5ddc('0x55')](_0x4de286['model'],qs[_0x5ddc('0x56')](_0x2dc80e['query']['fields']));_0x222c3a[_0x5ddc('0x54')]=_0x222c3a['attributes']['length']?_0x222c3a[_0x5ddc('0x54')]:_0x4de286['model'];if(!_0x2dc80e[_0x5ddc('0x52')]['hasOwnProperty'](_0x5ddc('0x59'))){_0x222c3a[_0x5ddc('0x2b')]=qs['limit'](_0x2dc80e[_0x5ddc('0x52')]['limit']);_0x222c3a[_0x5ddc('0x2d')]=qs[_0x5ddc('0x2d')](_0x2dc80e[_0x5ddc('0x52')][_0x5ddc('0x2d')]);}_0x222c3a[_0x5ddc('0x5a')]=qs[_0x5ddc('0x5b')](_0x2dc80e['query'][_0x5ddc('0x5b')]);_0x222c3a[_0x5ddc('0x86')]=qs['filters'](_[_0x5ddc('0x5c')](_0x2dc80e[_0x5ddc('0x52')],_0x4de286[_0x5ddc('0x53')]));_0x222c3a[_0x5ddc('0x86')][_0x5ddc('0x112')]=_0x566691['id'];if(_0x2dc80e[_0x5ddc('0x52')]['filter']){_0x222c3a[_0x5ddc('0x86')]=_[_0x5ddc('0xc4')](_0x222c3a[_0x5ddc('0x86')],{'$or':_[_0x5ddc('0x3b')](_0x222c3a[_0x5ddc('0x54')],function(_0x3c4dba){var _0x49239e={};_0x49239e[_0x3c4dba]={'$like':'%'+_0x2dc80e['query'][_0x5ddc('0x92')]+'%'};return _0x49239e;})});}if(_0x2dc80e[_0x5ddc('0x52')][_0x5ddc('0x89')]){var _0x27d629=_0x2dc80e[_0x5ddc('0x52')]['$gte']['split'](',');var _0x1d58bb={};_0x1d58bb[_0x27d629[0x0]]={'$gte':moment(_0x27d629[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x222c3a['where']=_['merge'](_0x222c3a[_0x5ddc('0x86')],_0x1d58bb);}_0x222c3a=_['merge']({},_0x222c3a,_0x2dc80e['options']);return db['ChatMessage'][_0x5ddc('0x2c')]({'where':_0x222c3a[_0x5ddc('0x86')]})['then'](function(_0x1a9f53){_0x5858dc['count']=_0x1a9f53;if(_0x2dc80e[_0x5ddc('0x52')][_0x5ddc('0xc3')]){_0x222c3a[_0x5ddc('0x113')]=[{'all':!![]}];}return db[_0x5ddc('0xd6')][_0x5ddc('0x114')](_0x222c3a);})[_0x5ddc('0x1d')](function(_0x177db4){_0x5858dc['rows']=_0x177db4;return _0x5858dc;});}})[_0x5ddc('0x1d')](respondWithFilteredResult(_0x27cf26,_0x222c3a))['catch'](handleError(_0x27cf26,null));};exports[_0x5ddc('0x115')]=function(_0x344e45,_0x3d39e7,_0x4b21cf){var _0xf18fa1={'where':{}},_0x1c2aff={},_0x5c588f={'count':0x0,'rows':[]};return db[_0x5ddc('0x4c')][_0x5ddc('0xc9')]({'where':{'id':_0x344e45['params']['id']}})['then'](handleEntityNotFound(_0x3d39e7,null))[_0x5ddc('0x1d')](function(_0x5cf447){if(_0x5cf447){_0x1c2aff['model']=_[_0x5ddc('0x51')](db[_0x5ddc('0xd6')][_0x5ddc('0x4d')]);_0x1c2aff[_0x5ddc('0x52')]=_[_0x5ddc('0x51')](_0x344e45[_0x5ddc('0x52')]);_0x1c2aff[_0x5ddc('0x53')]=_[_0x5ddc('0x55')](_0x1c2aff[_0x5ddc('0x50')],_0x1c2aff[_0x5ddc('0x52')]);_0xf18fa1[_0x5ddc('0x54')]=_[_0x5ddc('0x55')](_0x1c2aff[_0x5ddc('0x50')],qs[_0x5ddc('0x56')](_0x344e45['query'][_0x5ddc('0x56')]));_0xf18fa1['attributes']=_0xf18fa1[_0x5ddc('0x54')]['length']?_0xf18fa1[_0x5ddc('0x54')]:_0x1c2aff[_0x5ddc('0x50')];if(!_0x344e45['query'][_0x5ddc('0x58')](_0x5ddc('0x59'))){_0xf18fa1['limit']=qs[_0x5ddc('0x2b')](_0x344e45[_0x5ddc('0x52')]['limit']);_0xf18fa1[_0x5ddc('0x2d')]=qs['offset'](_0x344e45[_0x5ddc('0x52')][_0x5ddc('0x2d')]);}_0xf18fa1[_0x5ddc('0x5a')]=qs['sort'](_0x344e45[_0x5ddc('0x52')][_0x5ddc('0x5b')]);_0xf18fa1['where']=qs[_0x5ddc('0x53')](_[_0x5ddc('0x5c')](_0x344e45[_0x5ddc('0x52')],_0x1c2aff[_0x5ddc('0x53')]));_0xf18fa1['where'][_0x5ddc('0x112')]=_0x5cf447['id'];if(_0x344e45['query'][_0x5ddc('0x92')]){_0xf18fa1[_0x5ddc('0x86')]=_[_0x5ddc('0xc4')](_0xf18fa1[_0x5ddc('0x86')],{'$or':_[_0x5ddc('0x3b')](_0xf18fa1[_0x5ddc('0x54')],function(_0x520c1b){var _0x4a135a={};_0x4a135a[_0x520c1b]={'$like':'%'+_0x344e45[_0x5ddc('0x52')]['filter']+'%'};return _0x4a135a;})});}_0xf18fa1[_0x5ddc('0x86')][_0x5ddc('0x101')]=![];if(_0x344e45[_0x5ddc('0x52')]['id']){_0xf18fa1[_0x5ddc('0x86')]['id']={'$gt':_0x344e45[_0x5ddc('0x52')]['id']};}_0xf18fa1=_[_0x5ddc('0xc4')]({},_0xf18fa1,_0x344e45[_0x5ddc('0xc5')]);return db['ChatMessage'][_0x5ddc('0x2c')]({'where':_0xf18fa1[_0x5ddc('0x86')]})['then'](function(_0x442141){_0x5c588f[_0x5ddc('0x2c')]=_0x442141;_0xf18fa1[_0x5ddc('0x113')]=[];if(_0x344e45[_0x5ddc('0x52')][_0x5ddc('0x116')]){_0xf18fa1[_0x5ddc('0x113')][_0x5ddc('0x41')]({'model':db[_0x5ddc('0xf2')],'as':_0x5ddc('0xf2'),'attributes':['id',_0x5ddc('0x3c'),_0x5ddc('0xfd')]});}if(_0x344e45[_0x5ddc('0x52')][_0x5ddc('0xc3')]){_0xf18fa1['include']=[{'all':!![]}];}return db[_0x5ddc('0xd6')][_0x5ddc('0x114')](_0xf18fa1);})[_0x5ddc('0x1d')](function(_0x41df2a){_0x5c588f[_0x5ddc('0xc1')]=_0x41df2a;return _0x5c588f;});}})['then'](respondWithFilteredResult(_0x3d39e7,_0xf18fa1))[_0x5ddc('0x26')](handleError(_0x3d39e7,null));};exports['addTags']=function(_0x1e1334,_0xe4902f,_0x5af93b){return db[_0x5ddc('0x4c')]['find']({'where':{'id':_0x1e1334['params']['id']}})[_0x5ddc('0x1d')](handleEntityNotFound(_0xe4902f,null))[_0x5ddc('0x1d')](function(_0x6bc00){if(_0x6bc00){return _0x6bc00[_0x5ddc('0x117')](_0x1e1334[_0x5ddc('0x36')][_0x5ddc('0x10f')],_[_0x5ddc('0x110')](_0x1e1334[_0x5ddc('0x36')],[_0x5ddc('0x10f'),'id'])||{})['spread'](function(){return db[_0x5ddc('0x7e')][_0x5ddc('0x114')]({'attributes':['id',_0x5ddc('0x34'),_0x5ddc('0x5f')],'where':{'id':_0x1e1334[_0x5ddc('0x36')][_0x5ddc('0x10f')]}});})[_0x5ddc('0x1d')](function(_0x3b0ed0){socket[_0x5ddc('0x118')](_0x5ddc('0x119'),{'id':Number(_0x1e1334[_0x5ddc('0xc2')]['id']),'tags':_0x3b0ed0||[]});return{'id':Number(_0x1e1334[_0x5ddc('0xc2')]['id']),'tags':_0x3b0ed0||[]};});}})[_0x5ddc('0x1d')](respondWithResult(_0xe4902f,null))[_0x5ddc('0x26')](handleError(_0xe4902f,null));};exports[_0x5ddc('0x11a')]=function(_0x4ed35b,_0x1e3d7a,_0x443a42){return db[_0x5ddc('0x4c')][_0x5ddc('0x7a')]({'where':{'id':_0x4ed35b[_0x5ddc('0xc2')]['id']}})[_0x5ddc('0x1d')](handleEntityNotFound(_0x1e3d7a,null))[_0x5ddc('0x1d')](function(_0x1c7c4c){if(_0x1c7c4c){return _0x1c7c4c[_0x5ddc('0x11a')](_0x4ed35b[_0x5ddc('0x52')][_0x5ddc('0x10f')]);}})[_0x5ddc('0x1d')](respondWithStatusCode(_0x1e3d7a,null))[_0x5ddc('0x26')](handleError(_0x1e3d7a,null));};exports[_0x5ddc('0xeb')]=function(_0x231339,_0x2283a1){var _0xb3b8ff=moment()[_0x5ddc('0x11b')]()[_0x5ddc('0xab')]();var _0xf9a6e6=path[_0x5ddc('0xe8')](config[_0x5ddc('0xe9')],'server',_0x5ddc('0x11c'),'tmp');var _0x10fc4c=path[_0x5ddc('0xe8')](config[_0x5ddc('0xe9')],'server',_0x5ddc('0x11c'),_0x5ddc('0x11d'));var _0x3240a0=path[_0x5ddc('0xe8')](_0xf9a6e6,_0xb3b8ff);var _0x5eb5de=util[_0x5ddc('0xf4')](_0x5ddc('0x11e'),_0x231339['params']['id'],_0xb3b8ff);var _0x1281e0=path[_0x5ddc('0xe8')](_0xf9a6e6,_0x5eb5de);var _0x1fbc3d=[];_0x1fbc3d[_0x5ddc('0x41')]({'model':db[_0x5ddc('0xf2')],'as':_0x5ddc('0xf2'),'attributes':['id',_0x5ddc('0x3c')],'raw':!![]});_0x1fbc3d[_0x5ddc('0x41')]({'model':db[_0x5ddc('0xda')],'as':_0x5ddc('0x77'),'attributes':['id',_0x5ddc('0x11f'),_0x5ddc('0x120')],'raw':!![]});if(_0x231339['query'][_0x5ddc('0x11d')]){_0x1fbc3d[_0x5ddc('0x41')]({'model':db[_0x5ddc('0xe5')],'as':'Attachment','raw':!![]});}var _0xd729cf=[{'model':db[_0x5ddc('0xd6')],'as':_0x5ddc('0xf3'),'attributes':['id','body','createdAt','direction',_0x5ddc('0x101'),_0x5ddc('0x8f')],'include':_0x1fbc3d}];_0xd729cf[_0x5ddc('0x41')]({'model':db['ChatWebsite'],'as':_0x5ddc('0x121'),'attributes':['id',_0x5ddc('0x34')]});_0xd729cf['push']({'model':db[_0x5ddc('0xf2')],'as':_0x5ddc('0x122'),'attributes':['id',_0x5ddc('0x3c')]});return db[_0x5ddc('0x4c')][_0x5ddc('0x7a')]({'where':{'id':_0x231339[_0x5ddc('0xc2')]['id']},'include':_0xd729cf})[_0x5ddc('0x1d')](handleEntityNotFound(_0x2283a1,null))[_0x5ddc('0x1d')](function(_0x2076a9){if(_0x2076a9){var _0x25a7da=_0x2076a9['get']({'plain':!![]});fs['mkdirSync'](_0x3240a0);var _0x3182e4={'channel':'Chat','account':_0x25a7da[_0x5ddc('0x121')][_0x5ddc('0x34')],'agent':_0x25a7da[_0x5ddc('0x122')]?_0x25a7da[_0x5ddc('0x122')][_0x5ddc('0x3c')]:_0x5ddc('0x123'),'createdAt':moment(_0x25a7da[_0x5ddc('0xff')])['format'](_0x5ddc('0x124'))[_0x5ddc('0xab')](),'closedAt':_0x25a7da[_0x5ddc('0x45')]?moment(_0x25a7da[_0x5ddc('0x125')])[_0x5ddc('0xf4')](_0x5ddc('0x124'))[_0x5ddc('0xab')]():'','disposition':_0x25a7da[_0x5ddc('0x48')],'chatInfo':{'browser':_0x25a7da['browserName'],'os':_0x25a7da['osName'],'referer':_0x25a7da['referer'],'customerIp':_0x25a7da[_0x5ddc('0x126')],'customerPort':_0x25a7da['customerPort']?_0x25a7da[_0x5ddc('0x127')]:'N.A.'},'messages':_(_0x25a7da[_0x5ddc('0xf3')])[_0x5ddc('0x128')]()[_0x5ddc('0x92')]({'secret':![]})[_0x5ddc('0x3b')](function(_0x2fdf4a){if(_0x2fdf4a[_0x5ddc('0xe5')]){var _0x75e1f7=path[_0x5ddc('0xe8')](_0x10fc4c,_0x2fdf4a[_0x5ddc('0xe5')][_0x5ddc('0xe1')]);if(fs['existsSync'](_0x75e1f7)){fs[_0x5ddc('0x129')](_0x75e1f7)[_0x5ddc('0x12a')](fs[_0x5ddc('0x12b')](path[_0x5ddc('0xe8')](_0x3240a0,_0x2fdf4a[_0x5ddc('0xe5')]['basename'])));}}return{'date':moment(_0x2fdf4a[_0x5ddc('0xff')])[_0x5ddc('0xf4')](_0x5ddc('0x124'))[_0x5ddc('0xab')](),'sender':_0x2fdf4a['direction']===_0x5ddc('0x12c')?_0x2fdf4a[_0x5ddc('0xf2')]?_0x2fdf4a[_0x5ddc('0xf2')]['fullname']:_0x5ddc('0xf6'):_0x2fdf4a[_0x5ddc('0x77')][_0x5ddc('0x11f')]+(_0x2fdf4a[_0x5ddc('0x77')][_0x5ddc('0x120')]?'\x20'+_0x2fdf4a[_0x5ddc('0x77')]['lastName']:''),'body':_0x2fdf4a['Attachment']?_0x2fdf4a['Attachment'][_0x5ddc('0xe1')]:_0x2fdf4a[_0x5ddc('0x36')],'direction':_0x2fdf4a[_0x5ddc('0x12d')]===_0x5ddc('0x12c')?'A':'C','secret':_0x2fdf4a[_0x5ddc('0x101')],'read':_0x2fdf4a[_0x5ddc('0x8f')],'attachment':_0x2fdf4a[_0x5ddc('0xe5')]};})[_0x5ddc('0x79')]()};return ejs[_0x5ddc('0x12e')](path[_0x5ddc('0xe8')](config[_0x5ddc('0xe9')],_0x5ddc('0x12f'),_0x5ddc('0x130'),'downloadInteraction.ejs'),{'interaction':_0x3182e4})[_0x5ddc('0x1d')](function(_0x20691a){var _0x4caae0=path['join'](_0x3240a0,_0x5ddc('0x131')+_0x25a7da['id']+'-'+_0xb3b8ff+_0x5ddc('0x132'));var _0x14d2ce={'path':_0x4caae0,'channel':_0x5ddc('0x133'),'interactionId':_0x25a7da['id']};return pdf['createPdfFromHTML'](_0x20691a,_0x14d2ce);})[_0x5ddc('0x1d')](function(){return new BPromise(function(_0x100bea,_0x4573a6){zipdir(_0x3240a0,{'saveTo':_0x1281e0},function(_0x14f099,_0x220e16){if(_0x14f099)return _0x4573a6(_0x14f099);return _0x100bea(_0x220e16);});})[_0x5ddc('0x1d')](function(){return new BPromise(function(_0x1ec281,_0xe4d549){rimraf(_0x3240a0,function(_0x2f2b9c){if(_0x2f2b9c)_0xe4d549(_0x2f2b9c);return _0x1ec281();});});})['then'](function(){return _0x2283a1[_0x5ddc('0xeb')](_0x1281e0,_0x5eb5de,function(_0x3a36b0){if(_0x3a36b0){console['log'](_0x5ddc('0x134'),_0x3a36b0);}else{fs[_0x5ddc('0x135')](_0x1281e0);}});});});}else{return _0x2283a1[_0x5ddc('0x27')](0xc8);}})[_0x5ddc('0x26')](handleError(_0x2283a1,null));}; \ No newline at end of file +var _0x1350=['i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','options','create','update','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','account','POST','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','server/files/attachments/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','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','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','include','includeAgent','addTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','Content-Range','reject','save','destroy','end','name','send','render','merge','contact','interaction','Users','map','fullname','Tags','TagIds','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','from','u.id','u.fullname','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','body','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group'];(function(_0x2540db,_0x9b7318){var _0xbf6e9f=function(_0x5be1c6){while(--_0x5be1c6){_0x2540db['push'](_0x2540db['shift']());}};_0xbf6e9f(++_0x9b7318);}(_0x1350,0xa7));var _0x0135=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1350[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0135('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0135('0x1'));var rp=require(_0x0135('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0135('0x3'));var util=require(_0x0135('0x4'));var path=require(_0x0135('0x5'));var sox=require(_0x0135('0x6'));var csv=require(_0x0135('0x7'));var ejs=require(_0x0135('0x8'));var fs=require('fs');var fs_extra=require(_0x0135('0x9'));var _=require(_0x0135('0xa'));var squel=require(_0x0135('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0135('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0135('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0135('0xe'));var qs=require(_0x0135('0xf'));var as=require(_0x0135('0x10'));var pdf=require(_0x0135('0x11'));var hardwareService=require(_0x0135('0x12'));var logger=require(_0x0135('0x13'))('api');var utils=require(_0x0135('0x14'));var config=require(_0x0135('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0135('0x16'))['db'];config[_0x0135('0x17')]=_[_0x0135('0x18')](config[_0x0135('0x17')],{'host':_0x0135('0x19'),'port':0x18eb});var socket=require(_0x0135('0x1a'))(new Redis(config[_0x0135('0x17')]));require(_0x0135('0x1b'))[_0x0135('0x1c')](socket);var jayson=require(_0x0135('0x1d'));var client=jayson['client'][_0x0135('0x1e')]({'port':0x232b});var client9004=jayson[_0x0135('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x293119,_0x48051b,_0xbc623b,_0x567ff9){return new BPromise(function(_0x56a380,_0x3acd88){var _0x99e5cb=_0x567ff9||client;return _0x99e5cb['request'](_0x293119,_0xbc623b)[_0x0135('0x20')](function(_0x9aee8){logger[_0x0135('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x48051b,'request\x20sent');logger[_0x0135('0x22')](_0x0135('0x23'),_0x48051b,_0x0135('0x24'),JSON[_0x0135('0x25')](_0x9aee8));if(_0x9aee8[_0x0135('0x26')]){if(_0x9aee8[_0x0135('0x26')][_0x0135('0x27')]===0x1f4){logger[_0x0135('0x26')](_0x0135('0x28'),_0x48051b,_0x9aee8['error']['message']);return _0x3acd88(_0x9aee8[_0x0135('0x26')][_0x0135('0x29')]);}logger[_0x0135('0x26')](_0x0135('0x28'),_0x48051b,_0x9aee8[_0x0135('0x26')][_0x0135('0x29')]);return _0x56a380(_0x9aee8[_0x0135('0x26')]['message']);}else{logger[_0x0135('0x21')](_0x0135('0x28'),_0x48051b,_0x0135('0x24'));_0x56a380(_0x9aee8[_0x0135('0x2a')][_0x0135('0x29')]);}})[_0x0135('0x2b')](function(_0x54e19b){logger[_0x0135('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x48051b,_0x54e19b);_0x3acd88(_0x54e19b);});});}function respondWithStatusCode(_0x1e2561,_0x2cd0b4){_0x2cd0b4=_0x2cd0b4||0xcc;return function(_0x1cbf56){if(_0x1cbf56){return _0x1e2561[_0x0135('0x2c')](_0x2cd0b4);}return _0x1e2561['status'](_0x2cd0b4)['end']();};}function respondWithResult(_0x5eac54,_0x5452b3){_0x5452b3=_0x5452b3||0xc8;return function(_0x181c16){if(_0x181c16){return _0x5eac54['status'](_0x5452b3)[_0x0135('0x2d')](_0x181c16);}};}function respondWithFilteredResult(_0x27bdc4,_0x3c5ff1){return function(_0x4ebcfa){if(_0x4ebcfa){var _0x10825d=typeof _0x3c5ff1[_0x0135('0x2e')]===_0x0135('0x2f')&&typeof _0x3c5ff1[_0x0135('0x30')]==='undefined';var _0x116ce7=_0x4ebcfa[_0x0135('0x31')];var _0x50ca19=_0x10825d?0x0:_0x3c5ff1[_0x0135('0x2e')];var _0x57437c=_0x10825d?_0x4ebcfa[_0x0135('0x31')]:_0x3c5ff1[_0x0135('0x2e')]+_0x3c5ff1[_0x0135('0x30')];var _0x215dda;if(_0x57437c>=_0x116ce7){_0x57437c=_0x116ce7;_0x215dda=0xc8;}else{_0x215dda=0xce;}_0x27bdc4[_0x0135('0x32')](_0x215dda);return _0x27bdc4['set'](_0x0135('0x33'),_0x50ca19+'-'+_0x57437c+'/'+_0x116ce7)[_0x0135('0x2d')](_0x4ebcfa);}return null;};}function patchUpdates(_0x35ef57){return function(_0x304ee1){try{jsonpatch['apply'](_0x304ee1,_0x35ef57,!![]);}catch(_0x18a2d4){return BPromise[_0x0135('0x34')](_0x18a2d4);}return _0x304ee1[_0x0135('0x35')]();};}function saveUpdates(_0x2d146a,_0x465bb3){return function(_0x2c9525){if(_0x2c9525){return _0x2c9525['update'](_0x2d146a)['then'](function(_0x379247){return _0x379247;});}return null;};}function removeEntity(_0x382b8d,_0x2039f5){return function(_0x3e596a){if(_0x3e596a){return _0x3e596a[_0x0135('0x36')]()[_0x0135('0x20')](function(){_0x382b8d[_0x0135('0x32')](0xcc)[_0x0135('0x37')]();});}};}function handleEntityNotFound(_0x4fa621,_0x434b16){return function(_0x1134e1){if(!_0x1134e1){_0x4fa621[_0x0135('0x2c')](0x194);}return _0x1134e1;};}function handleError(_0x3f12f1,_0x88c19c){_0x88c19c=_0x88c19c||0x1f4;return function(_0x377cba){logger['error'](_0x377cba['stack']);if(_0x377cba[_0x0135('0x38')]){delete _0x377cba['name'];}_0x3f12f1[_0x0135('0x32')](_0x88c19c)[_0x0135('0x39')](_0x377cba);};}function getMustacheRender(_0x51d891,_0x401014){return Mustache[_0x0135('0x3a')](_0x51d891,_[_0x0135('0x3b')](_0x401014['body'],{'contact':_0x401014[_0x0135('0x3c')],'message':_0x401014[_0x0135('0x29')],'agent':_0x401014['agent'],'interaction':_0x401014[_0x0135('0x3d')],'account':_0x401014['account']}))||'';}function getInteractionUsers(_0x27d17b,_0x3afb0a){return new BPromise(function(_0x18b3d7,_0x2ae7b7){try{if(_0x3afb0a[_0x27d17b['id']]){_0x27d17b[_0x0135('0x3e')]=_[_0x0135('0x3f')](_0x3afb0a[_0x27d17b['id']],function(_0x547c97){return{'id':_0x547c97['id'],'fullname':_0x547c97[_0x0135('0x40')]};});}}catch(_0x119137){_0x2ae7b7(_0x119137);}_0x18b3d7(_0x27d17b);});}function getInteractionTags(_0x465ed7,_0x545d94){return new BPromise(function(_0x343951,_0x1609ca){try{if(_0x465ed7['TagIds']){_0x465ed7[_0x0135('0x41')]=[];_0x465ed7[_0x0135('0x42')][_0x0135('0x43')](',')[_0x0135('0x44')](function(_0x6347a1){_0x465ed7[_0x0135('0x41')][_0x0135('0x45')](_0x545d94[_0x6347a1]);});}delete _0x465ed7[_0x0135('0x42')];}catch(_0x208a5a){_0x1609ca(_0x208a5a);}_0x343951(_0x465ed7);});}function updateChatInteraction(_0x24f1ed,_0x140279,_0x586193){return new BPromise(function(_0x1a99bc,_0x3dda39){return getInteractionUsers(_0x24f1ed,_0x586193)[_0x0135('0x20')](function(_0x173511){return getInteractionTags(_0x173511,_0x140279);})[_0x0135('0x20')](function(_0x5a2366){return getStateInteraction(_0x5a2366);})[_0x0135('0x20')](function(_0x3323b5){_0x1a99bc(_0x3323b5);})[_0x0135('0x2b')](function(_0x4c92ff){_0x3dda39(_0x4c92ff);});});}function getStateInteraction(_0x3195ea){return new BPromise(function(_0xc264db){_0x3195ea[_0x0135('0x46')]=0x0;_0x3195ea[_0x0135('0x47')]=0x0;_0x3195ea[_0x0135('0x48')]=0x0;_0x3195ea[_0x0135('0x49')]=0x0;_0x3195ea[_0x0135('0x4a')]=0x0;_0x3195ea[_0x0135('0x4b')]=0x0;if(!_0x3195ea[_0x0135('0x4c')]&&!_0x3195ea['UserId']){_0x3195ea[_0x0135('0x46')]+=0x1;}if(!_0x3195ea[_0x0135('0x4c')]&&_0x3195ea[_0x0135('0x4d')]){_0x3195ea['talking']+=0x1;if(_0x3195ea[_0x0135('0x46')]){_0x3195ea[_0x0135('0x46')]-=0x1;}}if(_0x3195ea[_0x0135('0x4c')]&&_0x3195ea['disposition']===_0x0135('0x4a')){_0x3195ea[_0x0135('0x4a')]+=0x1;if(_0x3195ea[_0x0135('0x46')]){_0x3195ea[_0x0135('0x46')]-=0x1;}}else if(_0x3195ea[_0x0135('0x4c')]&&!_0x3195ea[_0x0135('0x4d')]&&_0x3195ea[_0x0135('0x4e')]){_0x3195ea[_0x0135('0x49')]+=0x1;if(_0x3195ea[_0x0135('0x46')]){_0x3195ea[_0x0135('0x46')]-=0x1;}}else if(_0x3195ea[_0x0135('0x4c')]&&_0x3195ea[_0x0135('0x4d')]){_0x3195ea[_0x0135('0x48')]+=0x1;if(_0x3195ea[_0x0135('0x47')]){_0x3195ea[_0x0135('0x47')]-=0x1;}}_0x3195ea[_0x0135('0x4b')]+=0x1;_0xc264db(_0x3195ea);});}exports['index']=function(_0xd460ba,_0x32f535){var _0x218d98={},_0x3689c4={},_0x47e1c6={'count':0x0,'rows':[]};var _0x216687=_['map'](db['ChatInteraction'][_0x0135('0x4f')],function(_0x4ff43b){return{'name':_0x4ff43b[_0x0135('0x50')],'type':_0x4ff43b['type'][_0x0135('0x51')]};});_0x3689c4[_0x0135('0x52')]=_['map'](_0x216687,_0x0135('0x38'));_0x3689c4[_0x0135('0x53')]=_[_0x0135('0x54')](_0xd460ba[_0x0135('0x53')]);_0x3689c4[_0x0135('0x55')]=_[_0x0135('0x56')](_0x3689c4[_0x0135('0x52')],_0x3689c4[_0x0135('0x53')]);_0x218d98[_0x0135('0x57')]=_[_0x0135('0x56')](_0x3689c4[_0x0135('0x52')],qs['fields'](_0xd460ba['query'][_0x0135('0x58')]));_0x218d98[_0x0135('0x57')]=_0x218d98[_0x0135('0x57')][_0x0135('0x59')]?_0x218d98[_0x0135('0x57')]:_0x3689c4[_0x0135('0x52')];if(!_0xd460ba['query'][_0x0135('0x5a')]('nolimit')){_0x218d98[_0x0135('0x30')]=qs[_0x0135('0x30')](_0xd460ba[_0x0135('0x53')][_0x0135('0x30')]);_0x218d98[_0x0135('0x2e')]=qs['offset'](_0xd460ba[_0x0135('0x53')][_0x0135('0x2e')]);}_0x218d98['order']=qs[_0x0135('0x5b')](_0xd460ba['query']['sort']);_0x218d98[_0x0135('0x5c')]=qs[_0x0135('0x55')](_[_0x0135('0x5d')](_0xd460ba[_0x0135('0x53')],_0x3689c4['filters']),_0x216687);var _0x2e158c=[];var _0x4a1bcf=squel[_0x0135('0x5e')]()[_0x0135('0x5f')]('id')['field'](_0x0135('0x38'))[_0x0135('0x5f')](_0x0135('0x60'))[_0x0135('0x61')]('tools_tags');var _0xc13602=squel[_0x0135('0x5e')]()['field'](_0x0135('0x62'))[_0x0135('0x5f')](_0x0135('0x63'))[_0x0135('0x5f')]('ui.ChatInteractionId')[_0x0135('0x61')]('user_has_chat_interactions','ui')[_0x0135('0x64')]('users','u',_0x0135('0x65'));var _0xb15673=squel[_0x0135('0x5e')]()[_0x0135('0x61')]('chat_interactions','i')['left_join'](_0x0135('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0135('0x64')](_0x0135('0x67'),'o',_0x0135('0x68'))[_0x0135('0x64')](_0x0135('0x69'),'a',_0x0135('0x6a'))[_0x0135('0x64')](_0x0135('0x6b'),'me',_0x0135('0x6c'))[_0x0135('0x64')](_0x0135('0x6d'),'it',_0x0135('0x6e'))['left_join'](_0x0135('0x6f'),'t',_0x0135('0x70'));var _0x3cb6b6=squel[_0x0135('0x71')]();var _0xc51cc4=[];var _0x46b984=squel['expr']();var _0x5206b4;if(_0xd460ba[_0x0135('0x53')]['search']){_0x5206b4=as[_0x0135('0x72')](_0xd460ba['query']['search']);var _0x402871=_0x5206b4[_0x0135('0x73')];for(var _0x2f925b=0x0;_0x2f925b<_0x5206b4[_0x0135('0x74')]['length'];_0x2f925b++){var _0x30a77d=_0x5206b4['conditions'][_0x2f925b];var _0xd81739='i';var _0x23cc4f=_[_0x0135('0x75')](_0x216687,[_0x0135('0x38'),_0x30a77d[_0x0135('0x5f')]]);if(!_0x23cc4f){switch(_0x30a77d['field']){case _0x0135('0x76'):if(_0x30a77d[_0x0135('0x77')]==0x1){_0xb15673[_0x0135('0x78')]('`'+_0x30a77d[_0x0135('0x5f')]+_0x0135('0x79'));}else{_0xb15673[_0x0135('0x78')]('`'+_0x30a77d['field']+_0x0135('0x7a'));}break;case'Contact':if(_0x30a77d[_0x0135('0x7b')]===_0x0135('0x7c')){if(_0x30a77d[_0x0135('0x77')][_0x0135('0x43')]('\x20')[_0x0135('0x59')]>0x1){_0x3cb6b6[_0x402871]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x30a77d[_0x0135('0x77')]),null);}else{var _0x8b823a='%'+_0x30a77d[_0x0135('0x77')]+'%';_0x3cb6b6[_0x402871](_0x0135('0x7d'),_0x8b823a,_0x8b823a,_0x8b823a);}}else{_0x23cc4f=_[_0x0135('0x75')](_0x216687,[_0x0135('0x38'),'ContactId']);_0x30a77d[_0x0135('0x5f')]=_0x0135('0x7e');_0x50ca72=as[_0x0135('0x7f')](_0xd81739,_0x23cc4f[_0x0135('0x80')],_0x30a77d);_0x3cb6b6[_0x402871](_0x50ca72[_0x0135('0x81')],_0x50ca72[_0x0135('0x77')][_0x0135('0x82')],_0x50ca72['value'][_0x0135('0x37')]);}break;case _0x0135('0x83'):var _0x6fb12=_0x30a77d['value'][_0x0135('0x43')](',')[_0x0135('0x3f')](function(_0xed35bd){return Number(_0xed35bd);});_0x6fb12['forEach'](function(_0x216899){_0x46b984['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x216899+',%');});_0xc51cc4=_[_0x0135('0x84')](_0xc51cc4,_0x6fb12);break;case _0x0135('0x85'):if(_0x30a77d['operator']===_0x0135('0x7c')){_0x3cb6b6[_0x402871]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x30a77d[_0x0135('0x77')]+'%',null);}else{_0x23cc4f=_[_0x0135('0x75')](_0x216687,['name',_0x0135('0x4d')]);_0x30a77d['field']=_0x0135('0x4d');_0x50ca72=as[_0x0135('0x7f')](_0xd81739,_0x23cc4f[_0x0135('0x80')],_0x30a77d);_0x3cb6b6[_0x402871](_0x50ca72['text'],_0x50ca72[_0x0135('0x77')][_0x0135('0x82')],_0x50ca72[_0x0135('0x77')]['end']);}break;case _0x0135('0x86'):_0x50ca72=as[_0x0135('0x7f')]('me',null,_0x30a77d);_0x3cb6b6[_0x402871](_0x50ca72['text'],_0x50ca72[_0x0135('0x77')][_0x0135('0x82')],_0x50ca72[_0x0135('0x77')][_0x0135('0x37')]);break;}}else{var _0x50ca72=as[_0x0135('0x7f')](_0xd81739,_0x23cc4f[_0x0135('0x80')],_0x30a77d);_0x3cb6b6[_0x402871](_0x50ca72['text'],_0x50ca72[_0x0135('0x77')][_0x0135('0x82')],_0x50ca72[_0x0135('0x77')][_0x0135('0x37')]);}}}else{var _0x1098e6=_(_0xd460ba[_0x0135('0x53')])[_0x0135('0x54')]()[_0x0135('0x3f')](function(_0x57991b){return _['some'](_0x216687,[_0x0135('0x38'),_0x57991b])?_0x57991b:undefined;})[_0x0135('0x87')]()[_0x0135('0x77')]();if(!_[_0x0135('0x88')](_0x1098e6)){_0x1098e6[_0x0135('0x44')](function(_0x466567){if(_0x466567===_0x0135('0x89')){_0xb15673[_0x0135('0x5c')](_0x0135('0x8a'),[]['concat'](_0xd460ba['query'][_0x466567]));}else if(_0x466567===_0x0135('0x8b')){var _0x54922e=JSON[_0x0135('0x8c')](_0xd460ba[_0x0135('0x53')][_0x466567])[_0x0135('0x8d')];var _0x21f01c=JSON[_0x0135('0x8c')](_0xd460ba[_0x0135('0x53')][_0x466567])[_0x0135('0x8e')];_0xb15673['where'](_0x0135('0x8f'),_0x54922e,_0x21f01c);}else{if(_0xd460ba[_0x0135('0x53')][_0x466567]===_0x0135('0x90')){_0xb15673[_0x0135('0x5c')]('i.'+_0x466567+'\x20IS\x20NULL');}else{_0xb15673[_0x0135('0x5c')]('i.'+_0x466567+_0x0135('0x91'),_0xd460ba['query'][_0x466567]);}}});}if(_0xd460ba['query'][_0x0135('0x92')]){if(_0xd460ba['query']['read']==0x1){_0xb15673[_0x0135('0x78')](_0x0135('0x93'));}else{_0xb15673['having'](_0x0135('0x94'));}}if(_0xd460ba['query'][_0x0135('0x95')]){_0xc51cc4=_[_0x0135('0x96')](_0xd460ba[_0x0135('0x53')][_0x0135('0x95')])?_0xd460ba['query'][_0x0135('0x95')]:new Array(_0xd460ba[_0x0135('0x53')][_0x0135('0x95')]);_0xc51cc4[_0x0135('0x44')](function(_0x284369){_0x46b984['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x284369+',%');});}if(_0xd460ba[_0x0135('0x53')][_0x0135('0x97')]){var _0x1d2ae5=_0xd460ba[_0x0135('0x53')]['filter'][_0x0135('0x98')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0135('0x99')](_0x1d2ae5)){_0x3cb6b6['or'](_0x0135('0x9a'),_0x1d2ae5+'%');}else{_0x3cb6b6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0135('0x9b')](_0x1d2ae5))['or'](_0x0135('0x9c'),_0x1d2ae5+'%');}}}_0xb15673['where'](_0x3cb6b6);_0xb15673[_0x0135('0x9d')](_0x0135('0x9e'));var _0x5594b0={'type':db[_0x0135('0x9f')][_0x0135('0xa0')][_0x0135('0xa1')],'raw':!![]};var _0xadd0c2=_0xb15673[_0x0135('0xa2')]();_0xadd0c2['field'](_0x0135('0x9e'));_0xadd0c2[_0x0135('0x5f')](_0x0135('0xa3'),_0x0135('0x76'));if(_0x218d98[_0x0135('0xa4')]){_0x218d98[_0x0135('0xa4')][_0x0135('0x44')](function(_0x122aa4){var _0x22d0cf=_0x122aa4[0x0]==='contactName'?_0x122aa4[0x0]:'i.'+_0x122aa4[0x0];_0xb15673[_0x0135('0xa4')](_0x22d0cf,_0x122aa4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0135('0x88')](_0xc51cc4)){_0xb15673[_0x0135('0x78')](_0x46b984);_0xadd0c2['where'](_0x0135('0xa5'),_0xc51cc4);}BPromise[_0x0135('0xa6')]()[_0x0135('0x20')](function(){if(!_0x5206b4){if(_0xd460ba[_0x0135('0x53')][_0x0135('0x89')])return;_0xadd0c2[_0x0135('0x5c')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xb15673[_0x0135('0x5c')](_0x0135('0xa7'));return;}if(_0xd460ba[_0x0135('0xa8')][_0x0135('0xa9')]!==_0x0135('0xaa'))return;return _0xd460ba[_0x0135('0xa8')][_0x0135('0xab')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36be2e){if(_['isEmpty'](_0x36be2e)){_0xadd0c2[_0x0135('0x5c')](_0x0135('0xac'));_0xb15673[_0x0135('0x5c')](_0x0135('0xac'));}else{_0xadd0c2[_0x0135('0x5c')](_0x0135('0x8a'),_['map'](_0x36be2e,'id'));_0xb15673['where']('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x36be2e,'id'));}});})[_0x0135('0x20')](function(){if(_0xd460ba[_0x0135('0xa8')]['role']==='agent'&&!_0x5206b4&&!_0xd460ba[_0x0135('0x53')][_0x0135('0x89')])return[];return db[_0x0135('0xad')][_0x0135('0x53')](_0xadd0c2[_0x0135('0xae')](),_0x5594b0);})[_0x0135('0x20')](function(_0x330b28){_0x47e1c6[_0x0135('0x31')]=_0x330b28[_0x0135('0x59')];if(_0x47e1c6['count']===0x0)return[];return db['sequelize']['query'](_0x4a1bcf[_0x0135('0xae')](),_0x5594b0)[_0x0135('0x20')](function(_0x4f1816){_0x2e158c=_[_0x0135('0xaf')](_0x4f1816,'id');_0x5594b0=_[_0x0135('0x3b')](_0x5594b0,{'model':db[_0x0135('0xb0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd460ba[_0x0135('0x53')][_0x0135('0x58')]){_0x218d98['attributes'][_0x0135('0x44')](function(_0x309e9f){_0xb15673[_0x0135('0x5f')]('i.'+_0x309e9f);});}else{_0xb15673[_0x0135('0x5f')](_0x0135('0xa3'),_0x0135('0x76'));_0xb15673['field'](_0x0135('0xb1'),_0x0135('0xb2'));_0xb15673[_0x0135('0x5f')](_0x0135('0xb3'),_0x0135('0xb4'));_0xb15673[_0x0135('0x5f')](_0x0135('0xb5'),_0x0135('0xb6'));_0xb15673[_0x0135('0x5f')](_0x0135('0xb7'));_0xb15673[_0x0135('0x5f')](_0x0135('0xb8'),'Contact.firstName');_0xb15673[_0x0135('0x5f')](_0x0135('0xb9'),_0x0135('0xba'));_0xb15673[_0x0135('0x5f')]('c.email',_0x0135('0xbb'));_0xb15673['field'](_0x0135('0xbc'),_0x0135('0xbd'));_0xb15673[_0x0135('0x5f')](_0x0135('0xbe'),'Contact.mobile');_0xb15673[_0x0135('0x5f')]('c.fax',_0x0135('0xbf'));_0xb15673[_0x0135('0x5f')](_0x0135('0xc0'),_0x0135('0xc1'));_0xb15673[_0x0135('0x5f')](_0x0135('0xc2'),_0x0135('0xc3'));_0xb15673['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0135('0x42'));}if(_0x218d98[_0x0135('0x30')])_0xb15673['limit'](_0x218d98[_0x0135('0x30')]);if(_0x218d98['offset'])_0xb15673[_0x0135('0x2e')](_0x218d98[_0x0135('0x2e')]);return db[_0x0135('0xad')][_0x0135('0x53')](_0xb15673[_0x0135('0xae')](),_0x5594b0);})[_0x0135('0x20')](function(_0x3500f7){if(_0x3500f7[_0x0135('0x59')]>0x0)_0xc13602[_0x0135('0x5c')](_0x0135('0xc4'),_[_0x0135('0x3f')](_0x3500f7,'id'));return db[_0x0135('0xad')][_0x0135('0x53')](_0xc13602['toString'](),_0x5594b0)[_0x0135('0x20')](function(_0x4b0f92){var _0x59d911=_[_0x0135('0xc5')](_0x4b0f92,_0x0135('0xc6'));var _0x4b008e=[];_0x3500f7[_0x0135('0x44')](function(_0x3e2f35){_0x4b008e[_0x0135('0x45')](updateChatInteraction(_0x3e2f35,_0x2e158c,_0x59d911));});return BPromise['all'](_0x4b008e);});});})[_0x0135('0x20')](function(_0x45bd2b){_0x47e1c6[_0x0135('0xc7')]=_0x45bd2b;return _0x47e1c6;})['then'](respondWithFilteredResult(_0x32f535,_0x218d98))[_0x0135('0x2b')](handleError(_0x32f535,null));};exports[_0x0135('0xc8')]=function(_0x88d9d9,_0x1b534f){var _0xf6e58d={'raw':![],'where':{'id':_0x88d9d9[_0x0135('0xc9')]['id']}},_0x2ffff8={};_0x2ffff8['model']=_[_0x0135('0x54')](db[_0x0135('0xb0')][_0x0135('0x4f')]);_0x2ffff8[_0x0135('0x53')]=_[_0x0135('0x54')](_0x88d9d9[_0x0135('0x53')]);_0x2ffff8[_0x0135('0x55')]=_[_0x0135('0x56')](_0x2ffff8[_0x0135('0x52')],_0x2ffff8[_0x0135('0x53')]);_0xf6e58d['attributes']=_[_0x0135('0x56')](_0x2ffff8[_0x0135('0x52')],qs['fields'](_0x88d9d9['query'][_0x0135('0x58')]));_0xf6e58d['attributes']=_0xf6e58d[_0x0135('0x57')][_0x0135('0x59')]?_0xf6e58d[_0x0135('0x57')]:_0x2ffff8[_0x0135('0x52')];if(_0x88d9d9[_0x0135('0x53')][_0x0135('0xca')]){_0xf6e58d['include']=[{'all':!![]}];}_0xf6e58d=_['merge']({},_0xf6e58d,_0x88d9d9[_0x0135('0xcb')]);return db['ChatInteraction'][_0x0135('0x75')](_0xf6e58d)[_0x0135('0x20')](handleEntityNotFound(_0x1b534f,null))[_0x0135('0x20')](respondWithResult(_0x1b534f,null))[_0x0135('0x2b')](handleError(_0x1b534f,null));};exports[_0x0135('0xcc')]=function(_0x2c173d,_0x63da86){return db[_0x0135('0xb0')]['create'](_0x2c173d[_0x0135('0x86')],{})[_0x0135('0x20')](respondWithResult(_0x63da86,0xc9))[_0x0135('0x2b')](handleError(_0x63da86,null));};exports[_0x0135('0xcd')]=function(_0x46ee47,_0x574113){if(_0x46ee47[_0x0135('0x86')]['id']){delete _0x46ee47[_0x0135('0x86')]['id'];}return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x46ee47[_0x0135('0xc9')]['id']}})[_0x0135('0x20')](handleEntityNotFound(_0x574113,null))[_0x0135('0x20')](saveUpdates(_0x46ee47[_0x0135('0x86')],null))[_0x0135('0x20')](respondWithResult(_0x574113,null))[_0x0135('0x2b')](handleError(_0x574113,null));};exports[_0x0135('0x36')]=function(_0x43ffb6,_0x351b87){return db[_0x0135('0xb0')]['find']({'where':{'id':_0x43ffb6['params']['id']}})['then'](handleEntityNotFound(_0x351b87,null))[_0x0135('0x20')](removeEntity(_0x351b87,null))[_0x0135('0x2b')](handleError(_0x351b87,null));};exports['describe']=function(_0x142906,_0x6e95fc){return db[_0x0135('0xb0')][_0x0135('0xce')]()[_0x0135('0x20')](respondWithResult(_0x6e95fc,null))['catch'](handleError(_0x6e95fc,null));};exports[_0x0135('0xcf')]=function(_0x47e56c,_0x2d2170){var _0x4753e8=_0x47e56c[_0x0135('0xc9')]['id'];var _0x10f715;var _0x2d8d5a;var _0x62643d;return db[_0x0135('0xb0')]['findOne']({'where':{'id':_0x4753e8}})['then'](function(_0x4f6c94){_0x10f715=_0x4f6c94;return db[_0x0135('0xd0')][_0x0135('0xd1')]({'where':{'id':_0x4f6c94[_0x0135('0x89')]},'attributes':['id',_0x0135('0xd2'),_0x0135('0xd3'),_0x0135('0xd4'),'vidaooNote',_0x0135('0xd5')],'raw':!![]});})['then'](function(_0x27c964){if(_0x27c964&&_0x27c964[_0x0135('0xd2')]&&_0x27c964['vidaooEscalation']){_0x2d8d5a=_0x27c964;var _0x152390={'interaction':{'id':_0x4753e8},'agent':{'id':_0x47e56c[_0x0135('0xa8')]['id'],'name':_0x47e56c[_0x0135('0xa8')][_0x0135('0x38')],'fullname':_0x47e56c[_0x0135('0xa8')][_0x0135('0x40')],'email':_0x47e56c['user'][_0x0135('0xd6')]},'contact':_0x47e56c['body'][_0x0135('0x3c')],'account':_0x47e56c[_0x0135('0x86')][_0x0135('0xd7')]};var _0x5acb9e={'rejectUnauthorized':![],'method':_0x0135('0xd8'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x27c964[_0x0135('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x47e56c[_0x0135('0xa8')][_0x0135('0xd6')]],'buttons':null,'topic':_0x2d8d5a[_0x0135('0xd4')],'note':_[_0x0135('0xd9')](_0x2d8d5a['vidaooNote'])?null:getMustacheRender(_0x2d8d5a[_0x0135('0xda')],_0x152390),'metadata':null},'redirect':_0x0135('0xdb'),'json':!![]};try{if(!_[_0x0135('0xd9')](_0x2d8d5a[_0x0135('0xd5')])){var _0x24d08e=getMustacheRender(_0x2d8d5a[_0x0135('0xd5')],_0x152390);var _0x31ec19=JSON['parse'](_0x24d08e);_0x5acb9e[_0x0135('0x86')][_0x0135('0xdc')]=_0x31ec19;}}catch(_0x97c06b){throw new db['Sequelize'][(_0x0135('0xdd'))](_0x0135('0xde'));}return rp(_0x5acb9e);}else{throw new db[(_0x0135('0x9f'))][(_0x0135('0xdd'))](_0x0135('0xdf'));}})[_0x0135('0x20')](function(_0x122395){_0x62643d=_0x122395;if(_0x62643d['id']){var _0x303084={'body':_0x62643d[_0x0135('0xe0')],'ChatWebsiteId':_0x2d8d5a['id'],'ChatInteractionId':_0x10f715['id'],'direction':_0x0135('0xe1'),'UserId':_0x47e56c[_0x0135('0xa8')]['id']};return db[_0x0135('0xe2')][_0x0135('0xcc')](_0x303084,{});}else{throw new db[(_0x0135('0x9f'))][(_0x0135('0xdd'))](_0x0135('0xe3'));}})[_0x0135('0x20')](function(){return _0x10f715[_0x0135('0xe4')]({'vidaooSessionId':_0x62643d['id']});})[_0x0135('0x20')](respondWithResult(_0x2d2170,null))[_0x0135('0x2b')](handleError(_0x2d2170,null));};exports[_0x0135('0xe5')]=function(_0x4c9dc8,_0x143399){if(_0x4c9dc8[_0x0135('0x86')]['id']){delete _0x4c9dc8[_0x0135('0x86')]['id'];}return db[_0x0135('0xb0')]['find']({'where':{'id':_0x4c9dc8[_0x0135('0xc9')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x0135('0x20')](handleEntityNotFound(_0x143399,null))[_0x0135('0x20')](saveUpdates(_0x4c9dc8[_0x0135('0x86')],null))[_0x0135('0x20')](respondWithResult(_0x143399,null))[_0x0135('0x2b')](handleError(_0x143399,null));};exports[_0x0135('0xe6')]=function(_0x418926,_0x50b8eb,_0x5eae1d){if(_0x418926[_0x0135('0x86')]['id']){delete _0x418926[_0x0135('0x86')]['id'];}return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x418926[_0x0135('0xc9')]['id']}})[_0x0135('0x20')](function(_0x5b9b51){if(!_0x5b9b51){logger[_0x0135('0x26')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0135('0xe6'),0x194,_0x0135('0xe7'));_0x50b8eb[_0x0135('0x2c')](0x194);}else{if(_0x5b9b51[_0x0135('0x4d')]){throw new db[(_0x0135('0x9f'))][(_0x0135('0xdd'))](_0x0135('0xe8'));}}return _0x5b9b51;})[_0x0135('0x20')](function(_0x4881fe){if(_0x4881fe){return _0x4881fe[_0x0135('0xcd')]({'closed':_0x418926[_0x0135('0x86')]['closed'],'disposition':_0x418926[_0x0135('0x86')][_0x0135('0x4e')]})[_0x0135('0x20')](function(_0x41a036){return _0x41a036;});}})[_0x0135('0x20')](function(_0x124f9f){return respondWithRpcPromise(_0x0135('0xe9'),_0x0135('0xe6'),_0x418926[_0x0135('0x86')],client9004);})[_0x0135('0x20')](respondWithResult(_0x50b8eb,null))['catch'](handleError(_0x50b8eb,null));};exports[_0x0135('0xea')]=function(_0x5dd678,_0x376232,_0x1a645f){_0x5dd678[_0x0135('0x86')][_0x0135('0x38')]=_0x5dd678[_0x0135('0xeb')]['originalname'];_0x5dd678[_0x0135('0x86')][_0x0135('0xec')]=_0x5dd678[_0x0135('0xeb')][_0x0135('0xed')];_0x5dd678['body'][_0x0135('0x80')]=_0x5dd678[_0x0135('0xeb')][_0x0135('0xee')];return db[_0x0135('0xef')][_0x0135('0xcc')](_0x5dd678[_0x0135('0x86')])[_0x0135('0x20')](respondWithResult(_0x376232,0xc9))['catch'](handleError(_0x376232,null));};exports[_0x0135('0xf0')]=function(_0x4b8984,_0x2d29a2,_0x561fa){return db[_0x0135('0xb0')][_0x0135('0xd1')]({'where':{'id':_0x4b8984['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d29a2,null))[_0x0135('0x20')](function(_0x2e6818){if(_0x2e6818){if(_0x2e6818[_0x0135('0x4c')]){return _0x2d29a2[_0x0135('0x32')](0x193)[_0x0135('0x2d')]({'status':0x193,'message':_0x0135('0xf1')});}return db[_0x0135('0xef')][_0x0135('0xd1')]({'where':{'id':_0x4b8984[_0x0135('0x53')][_0x0135('0xf2')]},'raw':!![]})['then'](handleEntityNotFound(_0x2d29a2,null));}})[_0x0135('0x20')](function(_0x1469cb){if(_0x1469cb){var _0x128ecf=_0x1469cb['ChatOfflineMessageId']!==null;var _0x57b754=path[_0x0135('0xf3')](config['root'],_0x0135('0xf4'));if(_0x128ecf){_0x57b754=path[_0x0135('0xf3')](_0x57b754,'offline-chat/');}var _0x44fa1a=path[_0x0135('0xf3')](_0x57b754,_0x1469cb[_0x0135('0xec')]);return _0x2d29a2['download'](_0x44fa1a);}})[_0x0135('0x2b')](handleError(_0x2d29a2,null));};exports[_0x0135('0xf5')]=function(_0x4cf13a,_0x5641ff){var _0x5b80d7=null;var _0x29ac67=null;var _0x1c0edf=null;var _0x228f1b=null;if(_0x4cf13a[_0x0135('0x86')]['id']){delete _0x4cf13a[_0x0135('0x86')]['id'];}if(_0x4cf13a[_0x0135('0x86')][_0x0135('0xf6')]){_0x228f1b=path['join'](config[_0x0135('0xf7')],_0x0135('0xf8'),util[_0x0135('0xf9')](_0x0135('0xfa'),Date[_0x0135('0xfb')]()));_0x4cf13a[_0x0135('0x86')][_0x0135('0xfc')]=_0x228f1b;}return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x4cf13a[_0x0135('0xc9')]['id']},'include':[{'model':db[_0x0135('0xe2')],'as':'Messages','include':[{'model':db[_0x0135('0x85')],'as':_0x0135('0x85')}]}]})['then'](handleEntityNotFound(_0x5641ff,null))[_0x0135('0x20')](saveUpdates(_0x4cf13a[_0x0135('0x86')],null))[_0x0135('0x20')](function(_0xa4c8e5){if(_0xa4c8e5){_0x5b80d7=_0xa4c8e5;return db[_0x0135('0xd0')][_0x0135('0x75')]({'where':{'id':_0x5b80d7['ChatWebsiteId']}});}})[_0x0135('0x20')](function(_0x5a18eb){if(_0x5a18eb){_0x1c0edf=_0x5a18eb;return db['CmContact']['find']({'where':{'id':_0x5b80d7[_0x0135('0x7e')]}});}})['then'](function(_0x5aff44){if(_0x5aff44){_0x29ac67=_0x5aff44;if(_0x228f1b){var _0x50bc61=null;for(var _0x1bf924=0x1;_0x1bf924<_0x5b80d7[_0x0135('0xfd')][_0x0135('0x59')];++_0x1bf924){_0x50bc61=_0x5b80d7['Messages'][_0x1bf924];var _0x44bd60=_0x50bc61[_0x0135('0x4d')]?util[_0x0135('0xf9')](_0x0135('0xfe'),_0x1c0edf[_0x0135('0xff')],_0x50bc61[_0x0135('0x4d')]):'System';var _0x5e950c=_0x4cf13a[_0x0135('0x86')]['customer']||util['format'](_0x0135('0xfe'),'Visitor',_0x50bc61['ContactId']);switch(_0x1c0edf[_0x0135('0x100')]){case _0x0135('0x101'):_0x44bd60=_0x50bc61[_0x0135('0x4d')]?util[_0x0135('0xf9')](_0x0135('0xfe'),_0x1c0edf[_0x0135('0xff')],_0x50bc61[_0x0135('0x4d')]):_0x0135('0x102');break;case _0x0135('0x103'):_0x44bd60=_0x50bc61[_0x0135('0x4d')]?_0x50bc61[_0x0135('0x85')][_0x0135('0x104')]||_0x50bc61[_0x0135('0x85')][_0x0135('0x40')]:'System';break;case _0x0135('0x105'):_0x44bd60=_0x50bc61[_0x0135('0x4d')]?_0x50bc61[_0x0135('0x85')][_0x0135('0x40')]:'System';break;default:_0x44bd60=_0x50bc61[_0x0135('0x4d')]?util[_0x0135('0xf9')](_0x0135('0xfe'),_0x1c0edf['agentAlias'],_0x50bc61[_0x0135('0x4d')]):_0x0135('0x102');}var _0x269dcc=util[_0x0135('0xf9')]('[%s]\x20%s:\x20%s\x0a',moment(_0x50bc61['createdAt'])['format'](_0x0135('0x106')),_0x50bc61[_0x0135('0x107')]==='in'?_0x5e950c:_0x44bd60,_0x50bc61[_0x0135('0x86')]);if(!_0x50bc61[_0x0135('0x108')]){fs[_0x0135('0x109')](_0x228f1b,_0x269dcc);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0135('0x10a')],'as':_0x0135('0x10b'),'raw':!![]}]});}}})[_0x0135('0x20')](function(_0x4ed4cd){if(_0x4ed4cd&&_0x4ed4cd[_0x0135('0x10b')]&&_0x4cf13a[_0x0135('0x86')]){var _0x389a53={'tls':{'rejectUnauthorized':![]}};if(_0x4ed4cd[_0x0135('0x10b')]['service']){_0x389a53[_0x0135('0x10c')]=_0x4ed4cd[_0x0135('0x10b')][_0x0135('0x10c')];}else{_0x389a53[_0x0135('0x10d')]=_0x4ed4cd[_0x0135('0x10b')][_0x0135('0x10d')];_0x389a53[_0x0135('0x10e')]=_0x4ed4cd[_0x0135('0x10b')][_0x0135('0x10e')];_0x389a53['secure']=_0x4ed4cd['Smtp'][_0x0135('0x10f')];}if(_0x4ed4cd[_0x0135('0x10b')]['authentication']){_0x389a53[_0x0135('0x110')]={'user':_0x4ed4cd['Smtp'][_0x0135('0xa8')],'pass':_0x4ed4cd[_0x0135('0x10b')][_0x0135('0x111')]};}return respondWithRpcPromise(_0x0135('0x112'),_0x0135('0x113'),{'account':_0x389a53,'message':{'from':util['format'](_0x0135('0x114'),_0x4ed4cd['name'],_0x4ed4cd[_0x0135('0xd6')]||_0x4ed4cd[_0x0135('0x10b')][_0x0135('0xa8')]),'to':_0x4cf13a[_0x0135('0x86')][_0x0135('0xf6')],'subject':_0x0135('0x115'),'text':util[_0x0135('0xf9')](_0x0135('0x116'),_0x4cf13a[_0x0135('0x86')][_0x0135('0xf6')]),'attachments':[{'path':_0x228f1b}]}})[_0x0135('0x20')](function(){return _0x5b80d7;})[_0x0135('0x2b')](function(_0x4bc22e){console[_0x0135('0x26')](_0x4bc22e);});}else{return _0x5b80d7;}})[_0x0135('0x20')](respondWithStatusCode(_0x5641ff,0xc8))[_0x0135('0x2b')](handleError(_0x5641ff,null));};exports['addMessage']=function(_0x40f076,_0x401cae,_0x944d97){return db['ChatMessage'][_0x0135('0x75')]({'where':{'id':_0x40f076[_0x0135('0xc9')]['id']}})[_0x0135('0x20')](handleEntityNotFound(_0x401cae,null))[_0x0135('0x20')](function(_0x2370ac){if(_0x2370ac){return _0x2370ac['addMessage'](_0x40f076['body'][_0x0135('0x117')],_[_0x0135('0x118')](_0x40f076[_0x0135('0x86')],[_0x0135('0x117'),'id'])||{});}})[_0x0135('0x20')](respondWithResult(_0x401cae,null))[_0x0135('0x2b')](handleError(_0x401cae,null));};exports[_0x0135('0x119')]=function(_0x52b334,_0x1962b6,_0x5830e0){var _0x3ab41c={'raw':![],'where':{}};var _0x3298e6={};var _0x9f438a={'count':0x0,'rows':[]};return db[_0x0135('0xb0')][_0x0135('0xd1')]({'where':{'id':_0x52b334[_0x0135('0xc9')]['id']}})[_0x0135('0x20')](handleEntityNotFound(_0x1962b6,null))[_0x0135('0x20')](function(_0x31b338){if(_0x31b338){_0x3298e6[_0x0135('0x52')]=_[_0x0135('0x54')](db[_0x0135('0xe2')][_0x0135('0x4f')]);_0x3298e6[_0x0135('0x53')]=_[_0x0135('0x54')](_0x52b334[_0x0135('0x53')]);_0x3298e6[_0x0135('0x55')]=_[_0x0135('0x56')](_0x3298e6[_0x0135('0x52')],_0x3298e6[_0x0135('0x53')]);_0x3ab41c[_0x0135('0x57')]=_[_0x0135('0x56')](_0x3298e6[_0x0135('0x52')],qs[_0x0135('0x58')](_0x52b334[_0x0135('0x53')][_0x0135('0x58')]));_0x3ab41c[_0x0135('0x57')]=_0x3ab41c[_0x0135('0x57')][_0x0135('0x59')]?_0x3ab41c[_0x0135('0x57')]:_0x3298e6['model'];if(!_0x52b334[_0x0135('0x53')][_0x0135('0x5a')](_0x0135('0x11a'))){_0x3ab41c['limit']=qs[_0x0135('0x30')](_0x52b334[_0x0135('0x53')][_0x0135('0x30')]);_0x3ab41c[_0x0135('0x2e')]=qs['offset'](_0x52b334[_0x0135('0x53')][_0x0135('0x2e')]);}_0x3ab41c['order']=qs[_0x0135('0x5b')](_0x52b334[_0x0135('0x53')][_0x0135('0x5b')]);_0x3ab41c[_0x0135('0x5c')]=qs[_0x0135('0x55')](_['pick'](_0x52b334[_0x0135('0x53')],_0x3298e6[_0x0135('0x55')]));_0x3ab41c[_0x0135('0x5c')][_0x0135('0xc6')]=_0x31b338['id'];if(_0x52b334[_0x0135('0x53')][_0x0135('0x97')]){_0x3ab41c[_0x0135('0x5c')]=_[_0x0135('0x3b')](_0x3ab41c[_0x0135('0x5c')],{'$or':_[_0x0135('0x3f')](_0x3ab41c['attributes'],function(_0xbf0fc3){var _0x428edf={};_0x428edf[_0xbf0fc3]={'$like':'%'+_0x52b334[_0x0135('0x53')][_0x0135('0x97')]+'%'};return _0x428edf;})});}if(_0x52b334['query'][_0x0135('0x8d')]){var _0x1205d2=_0x52b334[_0x0135('0x53')][_0x0135('0x8d')][_0x0135('0x43')](',');var _0x519076={};_0x519076[_0x1205d2[0x0]]={'$gte':moment(_0x1205d2[0x1])[_0x0135('0xf9')](_0x0135('0x11b'))};_0x3ab41c[_0x0135('0x5c')]=_['merge'](_0x3ab41c[_0x0135('0x5c')],_0x519076);}_0x3ab41c=_[_0x0135('0x3b')]({},_0x3ab41c,_0x52b334[_0x0135('0xcb')]);return db[_0x0135('0xe2')][_0x0135('0x31')]({'where':_0x3ab41c[_0x0135('0x5c')]})[_0x0135('0x20')](function(_0x56ac38){_0x9f438a[_0x0135('0x31')]=_0x56ac38;if(_0x52b334['query'][_0x0135('0xca')]){_0x3ab41c['include']=[{'all':!![]}];}return db[_0x0135('0xe2')][_0x0135('0x11c')](_0x3ab41c);})[_0x0135('0x20')](function(_0x9d2ae3){_0x9f438a['rows']=_0x9d2ae3;return _0x9f438a;});}})[_0x0135('0x20')](respondWithFilteredResult(_0x1962b6,_0x3ab41c))[_0x0135('0x2b')](handleError(_0x1962b6,null));};exports[_0x0135('0x11d')]=function(_0x36b4e6,_0x2ee62a,_0x2f6d6b){var _0x140d8f={'where':{}},_0x3db126={},_0x3af5da={'count':0x0,'rows':[]};return db[_0x0135('0xb0')][_0x0135('0xd1')]({'where':{'id':_0x36b4e6[_0x0135('0xc9')]['id']}})['then'](handleEntityNotFound(_0x2ee62a,null))['then'](function(_0x13e2fc){if(_0x13e2fc){_0x3db126[_0x0135('0x52')]=_[_0x0135('0x54')](db[_0x0135('0xe2')][_0x0135('0x4f')]);_0x3db126[_0x0135('0x53')]=_[_0x0135('0x54')](_0x36b4e6['query']);_0x3db126[_0x0135('0x55')]=_[_0x0135('0x56')](_0x3db126[_0x0135('0x52')],_0x3db126[_0x0135('0x53')]);_0x140d8f[_0x0135('0x57')]=_[_0x0135('0x56')](_0x3db126[_0x0135('0x52')],qs[_0x0135('0x58')](_0x36b4e6[_0x0135('0x53')]['fields']));_0x140d8f[_0x0135('0x57')]=_0x140d8f[_0x0135('0x57')][_0x0135('0x59')]?_0x140d8f['attributes']:_0x3db126[_0x0135('0x52')];if(!_0x36b4e6[_0x0135('0x53')][_0x0135('0x5a')](_0x0135('0x11a'))){_0x140d8f[_0x0135('0x30')]=qs[_0x0135('0x30')](_0x36b4e6['query'][_0x0135('0x30')]);_0x140d8f[_0x0135('0x2e')]=qs[_0x0135('0x2e')](_0x36b4e6[_0x0135('0x53')][_0x0135('0x2e')]);}_0x140d8f[_0x0135('0xa4')]=qs['sort'](_0x36b4e6[_0x0135('0x53')][_0x0135('0x5b')]);_0x140d8f[_0x0135('0x5c')]=qs['filters'](_[_0x0135('0x5d')](_0x36b4e6[_0x0135('0x53')],_0x3db126['filters']));_0x140d8f['where'][_0x0135('0xc6')]=_0x13e2fc['id'];if(_0x36b4e6[_0x0135('0x53')][_0x0135('0x97')]){_0x140d8f['where']=_[_0x0135('0x3b')](_0x140d8f[_0x0135('0x5c')],{'$or':_['map'](_0x140d8f[_0x0135('0x57')],function(_0x7b5cce){var _0x68ed7b={};_0x68ed7b[_0x7b5cce]={'$like':'%'+_0x36b4e6[_0x0135('0x53')][_0x0135('0x97')]+'%'};return _0x68ed7b;})});}_0x140d8f['where'][_0x0135('0x108')]=![];if(_0x36b4e6['query']['id']){_0x140d8f['where']['id']={'$gt':_0x36b4e6[_0x0135('0x53')]['id']};}_0x140d8f=_[_0x0135('0x3b')]({},_0x140d8f,_0x36b4e6[_0x0135('0xcb')]);return db['ChatMessage'][_0x0135('0x31')]({'where':_0x140d8f[_0x0135('0x5c')]})[_0x0135('0x20')](function(_0x3b9d02){_0x3af5da[_0x0135('0x31')]=_0x3b9d02;_0x140d8f[_0x0135('0x11e')]=[];if(_0x36b4e6[_0x0135('0x53')][_0x0135('0x11f')]){_0x140d8f['include'][_0x0135('0x45')]({'model':db[_0x0135('0x85')],'as':_0x0135('0x85'),'attributes':['id',_0x0135('0x40'),_0x0135('0x104')]});}if(_0x36b4e6['query'][_0x0135('0xca')]){_0x140d8f[_0x0135('0x11e')]=[{'all':!![]}];}return db['ChatMessage'][_0x0135('0x11c')](_0x140d8f);})[_0x0135('0x20')](function(_0x44a916){_0x3af5da['rows']=_0x44a916;return _0x3af5da;});}})[_0x0135('0x20')](respondWithFilteredResult(_0x2ee62a,_0x140d8f))[_0x0135('0x2b')](handleError(_0x2ee62a,null));};exports[_0x0135('0x120')]=function(_0x76a876,_0x281bb2,_0x4d0e6e){return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x76a876[_0x0135('0xc9')]['id']}})[_0x0135('0x20')](handleEntityNotFound(_0x281bb2,null))[_0x0135('0x20')](function(_0x30aef6){if(_0x30aef6){return _0x30aef6['setTags'](_0x76a876[_0x0135('0x86')][_0x0135('0x117')],_['omit'](_0x76a876[_0x0135('0x86')],[_0x0135('0x117'),'id'])||{})[_0x0135('0x121')](function(){return db['Tag'][_0x0135('0x11c')]({'attributes':['id','name',_0x0135('0x60')],'where':{'id':_0x76a876[_0x0135('0x86')][_0x0135('0x117')]}});})[_0x0135('0x20')](function(_0x57689b){socket[_0x0135('0x122')](_0x0135('0x123'),{'id':Number(_0x76a876[_0x0135('0xc9')]['id']),'tags':_0x57689b||[]});return{'id':Number(_0x76a876[_0x0135('0xc9')]['id']),'tags':_0x57689b||[]};});}})['then'](respondWithResult(_0x281bb2,null))['catch'](handleError(_0x281bb2,null));};exports[_0x0135('0x124')]=function(_0x2f7609,_0x397c30,_0x1a410f){return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x2f7609['params']['id']}})[_0x0135('0x20')](handleEntityNotFound(_0x397c30,null))[_0x0135('0x20')](function(_0x2f0db5){if(_0x2f0db5){return _0x2f0db5['removeTags'](_0x2f7609['query'][_0x0135('0x117')]);}})['then'](respondWithStatusCode(_0x397c30,null))[_0x0135('0x2b')](handleError(_0x397c30,null));};exports[_0x0135('0x125')]=function(_0x4d0509,_0x3273f3){var _0x263019=moment()[_0x0135('0x126')]()[_0x0135('0xae')]();var _0x4819a9=path[_0x0135('0xf3')](config['root'],_0x0135('0x127'),_0x0135('0x128'),'tmp');var _0x3876f6=path[_0x0135('0xf3')](config[_0x0135('0xf7')],_0x0135('0x127'),_0x0135('0x128'),_0x0135('0x129'));var _0x335b4a=path['join'](_0x4819a9,_0x263019);var _0x5a3eef=util[_0x0135('0xf9')](_0x0135('0x12a'),_0x4d0509[_0x0135('0xc9')]['id'],_0x263019);var _0x57c703=path['join'](_0x4819a9,_0x5a3eef);var _0x2b7cc9=[];_0x2b7cc9[_0x0135('0x45')]({'model':db[_0x0135('0x85')],'as':_0x0135('0x85'),'attributes':['id','fullname'],'raw':!![]});_0x2b7cc9[_0x0135('0x45')]({'model':db['CmContact'],'as':_0x0135('0x12b'),'attributes':['id',_0x0135('0x12c'),_0x0135('0x12d')],'raw':!![]});if(_0x4d0509[_0x0135('0x53')]['attachments']){_0x2b7cc9[_0x0135('0x45')]({'model':db[_0x0135('0xef')],'as':'Attachment','raw':!![]});}var _0x4d45f1=[{'model':db[_0x0135('0xe2')],'as':_0x0135('0xfd'),'attributes':['id','body',_0x0135('0x8b'),'direction','secret',_0x0135('0x92')],'include':_0x2b7cc9}];_0x4d45f1[_0x0135('0x45')]({'model':db['ChatWebsite'],'as':_0x0135('0x12e'),'attributes':['id',_0x0135('0x38')]});_0x4d45f1['push']({'model':db[_0x0135('0x85')],'as':'Owner','attributes':['id','fullname']});return db[_0x0135('0xb0')][_0x0135('0x75')]({'where':{'id':_0x4d0509['params']['id']},'include':_0x4d45f1})['then'](handleEntityNotFound(_0x3273f3,null))['then'](function(_0xc4cd68){if(_0xc4cd68){var _0x3d5208=_0xc4cd68[_0x0135('0x12f')]({'plain':!![]});fs[_0x0135('0x130')](_0x335b4a);var _0x33f045={'channel':'Chat','account':_0x3d5208[_0x0135('0x12e')][_0x0135('0x38')],'agent':_0x3d5208[_0x0135('0x131')]?_0x3d5208[_0x0135('0x131')][_0x0135('0x40')]:_0x0135('0x132'),'createdAt':moment(_0x3d5208[_0x0135('0x8b')])['format'](_0x0135('0x11b'))[_0x0135('0xae')](),'closedAt':_0x3d5208[_0x0135('0x4c')]?moment(_0x3d5208[_0x0135('0x133')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x0135('0xae')]():'','disposition':_0x3d5208[_0x0135('0x4e')],'chatInfo':{'browser':_0x3d5208[_0x0135('0x134')],'os':_0x3d5208[_0x0135('0x135')],'referer':_0x3d5208[_0x0135('0x136')],'customerIp':_0x3d5208['customerIp'],'customerPort':_0x3d5208[_0x0135('0x137')]?_0x3d5208[_0x0135('0x137')]:_0x0135('0x132')},'messages':_(_0x3d5208[_0x0135('0xfd')])[_0x0135('0x138')]()[_0x0135('0x97')]({'secret':![]})['map'](function(_0x23dafb){if(_0x23dafb[_0x0135('0xef')]){var _0x8e79fa=path['join'](_0x3876f6,_0x23dafb[_0x0135('0xef')][_0x0135('0xec')]);if(fs[_0x0135('0x139')](_0x8e79fa)){fs[_0x0135('0x13a')](_0x8e79fa)[_0x0135('0x13b')](fs[_0x0135('0x13c')](path['join'](_0x335b4a,_0x23dafb[_0x0135('0xef')][_0x0135('0xec')])));}}return{'date':moment(_0x23dafb[_0x0135('0x8b')])[_0x0135('0xf9')](_0x0135('0x11b'))[_0x0135('0xae')](),'sender':_0x23dafb[_0x0135('0x107')]===_0x0135('0xe1')?_0x23dafb[_0x0135('0x85')]?_0x23dafb[_0x0135('0x85')]['fullname']:_0x0135('0x102'):_0x23dafb[_0x0135('0x12b')][_0x0135('0x12c')]+(_0x23dafb[_0x0135('0x12b')][_0x0135('0x12d')]?'\x20'+_0x23dafb[_0x0135('0x12b')][_0x0135('0x12d')]:''),'body':_0x23dafb['Attachment']?_0x23dafb[_0x0135('0xef')][_0x0135('0xec')]:_0x23dafb[_0x0135('0x86')],'direction':_0x23dafb[_0x0135('0x107')]===_0x0135('0xe1')?'A':'C','secret':_0x23dafb[_0x0135('0x108')],'read':_0x23dafb[_0x0135('0x92')],'attachment':_0x23dafb[_0x0135('0xef')]};})['value']()};return ejs['renderFile'](path[_0x0135('0xf3')](config['root'],'server','views',_0x0135('0x13d')),{'interaction':_0x33f045})[_0x0135('0x20')](function(_0x3a7c51){var _0x291e93=path['join'](_0x335b4a,_0x0135('0x13e')+_0x3d5208['id']+'-'+_0x263019+_0x0135('0x13f'));var _0x8ff6ff={'path':_0x291e93,'channel':_0x0135('0x140'),'interactionId':_0x3d5208['id']};return pdf[_0x0135('0x141')](_0x3a7c51,_0x8ff6ff);})[_0x0135('0x20')](function(){return new BPromise(function(_0x3debe1,_0x2e5b55){zipdir(_0x335b4a,{'saveTo':_0x57c703},function(_0x532dfb,_0x3e272e){if(_0x532dfb)return _0x2e5b55(_0x532dfb);return _0x3debe1(_0x3e272e);});})[_0x0135('0x20')](function(){return new BPromise(function(_0x3d7da6,_0x1b0c96){rimraf(_0x335b4a,function(_0x318af4){if(_0x318af4)_0x1b0c96(_0x318af4);return _0x3d7da6();});});})[_0x0135('0x20')](function(){return _0x3273f3[_0x0135('0x125')](_0x57c703,_0x5a3eef,function(_0x1616ad){if(_0x1616ad){console[_0x0135('0x142')](_0x0135('0x143'),_0x1616ad);}else{fs[_0x0135('0x144')](_0x57c703);}});});});}else{return _0x3273f3[_0x0135('0x2c')](0xc8);}})['catch'](handleError(_0x3273f3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 879c347..6a6a3d7 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 _0xc9ac=['getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','save','remove'];(function(_0x6abae1,_0x11a02f){var _0x14dad0=function(_0xf1fa3){while(--_0xf1fa3){_0x6abae1['push'](_0x6abae1['shift']());}};_0x14dad0(++_0x11a02f);}(_0xc9ac,0x18f));var _0xcc9a=function(_0x2b30fe,_0xe92c0a){_0x2b30fe=_0x2b30fe-0x0;var _0x2d1e4e=_0xc9ac[_0x2b30fe];return _0x2d1e4e;};'use strict';var EventEmitter=require(_0xcc9a('0x0'));var ChatInteraction=require(_0xcc9a('0x1'))['db'][_0xcc9a('0x2')];var ChatMessage=require(_0xcc9a('0x1'))['db'][_0xcc9a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc9a('0x4'),'afterUpdate':'update','afterDestroy':_0xcc9a('0x5')};function emitEvent(_0x3d6f9b){return function(_0x4ff337,_0x2d42d8,_0xdc65d6){_0x4ff337[_0xcc9a('0x6')]({'attributes':['id'],'raw':!![]})[_0xcc9a('0x7')](function(_0x608bb2){_0x4ff337[_0xcc9a('0x8')]('Users',_0x608bb2[_0xcc9a('0x9')](function(_0xbe078a){return{'id':_0xbe078a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4ff337['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc9a('0x7')](function(_0x1b1a7d){_0x4ff337[_0xcc9a('0x8')](_0xcc9a('0xa'),_0x1b1a7d['length']);ChatInteractionEvents[_0xcc9a('0xb')](_0x3d6f9b+':'+_0x4ff337['id'],_0x4ff337);ChatInteractionEvents[_0xcc9a('0xb')](_0x3d6f9b,_0x4ff337);_0xdc65d6(null);})[_0xcc9a('0xc')](_0xdc65d6(null));};}for(var e in events){if(events[_0xcc9a('0xd')](e)){var event=events[e];ChatInteraction[_0xcc9a('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xa9b6=['getUsers','setDataValue','map','findAll','then','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove'];(function(_0x44501e,_0x499e64){var _0xd9c1fe=function(_0x5ca590){while(--_0x5ca590){_0x44501e['push'](_0x44501e['shift']());}};_0xd9c1fe(++_0x499e64);}(_0xa9b6,0x12b));var _0x6a9b=function(_0x21de38,_0x3df9bd){_0x21de38=_0x21de38-0x0;var _0x46e6c0=_0xa9b6[_0x21de38];return _0x46e6c0;};'use strict';var EventEmitter=require(_0x6a9b('0x0'));var ChatInteraction=require(_0x6a9b('0x1'))['db'][_0x6a9b('0x2')];var ChatMessage=require(_0x6a9b('0x1'))['db'][_0x6a9b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6a9b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6a9b('0x5'),'afterDestroy':_0x6a9b('0x6')};function emitEvent(_0x18dc05){return function(_0xacd79d,_0x5c5d62,_0xfa29ee){_0xacd79d[_0x6a9b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e1421){_0xacd79d[_0x6a9b('0x8')]('Users',_0x5e1421[_0x6a9b('0x9')](function(_0x4c0ffa){return{'id':_0x4c0ffa['id']};}));return ChatMessage[_0x6a9b('0xa')]({'where':{'ChatInteractionId':_0xacd79d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6a9b('0xb')](function(_0x2b143e){_0xacd79d[_0x6a9b('0x8')]('unreadMessages',_0x2b143e[_0x6a9b('0xc')]);ChatInteractionEvents[_0x6a9b('0xd')](_0x18dc05+':'+_0xacd79d['id'],_0xacd79d);ChatInteractionEvents[_0x6a9b('0xd')](_0x18dc05,_0xacd79d);_0xfa29ee(null);})[_0x6a9b('0xe')](_0xfa29ee(null));};}for(var e in events){if(events[_0x6a9b('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x6a9b('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index c6a56ec..fb5293a 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 _0xa32b=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','utf8mb4_unicode_ci'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xa32b,0x170));var _0xba32=function(_0x5c4d27,_0x5b0822){_0x5c4d27=_0x5c4d27-0x0;var _0x1dda1a=_0xa32b[_0x5c4d27];return _0x1dda1a;};'use strict';var _=require(_0xba32('0x0'));var util=require(_0xba32('0x1'));var logger=require('../../config/logger')(_0xba32('0x2'));var moment=require(_0xba32('0x3'));var BPromise=require(_0xba32('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba32('0x5'));var rimraf=require(_0xba32('0x6'));var config=require(_0xba32('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xba32('0x8')]=function(_0x475b79,_0x51a8c5){return _0x475b79[_0xba32('0x9')](_0xba32('0xa'),attributes,{'tableName':_0xba32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49f5bb,_0x50a917,_0x37a60f){if(_0x49f5bb['changed'](_0xba32('0xc'))){_0x49f5bb[_0xba32('0xd')]=moment()[_0xba32('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x37a60f(null,_0x49f5bb);}},'charset':'utf8mb4','collate':_0xba32('0xf')});}; \ No newline at end of file +var _0x3e2c=['rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise'];(function(_0x2accb9,_0x57fc26){var _0x2a8a4e=function(_0x4f3588){while(--_0x4f3588){_0x2accb9['push'](_0x2accb9['shift']());}};_0x2a8a4e(++_0x57fc26);}(_0x3e2c,0x1e8));var _0xc3e2=function(_0x28ee9c,_0x1ae563){_0x28ee9c=_0x28ee9c-0x0;var _0x36f796=_0x3e2c[_0x28ee9c];return _0x36f796;};'use strict';var _=require(_0xc3e2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3e2('0x1'));var moment=require(_0xc3e2('0x2'));var BPromise=require(_0xc3e2('0x3'));var rp=require(_0xc3e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3e2('0x5'));var config=require(_0xc3e2('0x6'));var attributes=require(_0xc3e2('0x7'));module[_0xc3e2('0x8')]=function(_0xa0fe32,_0x26eb6f){return _0xa0fe32['define']('ChatInteraction',attributes,{'tableName':_0xc3e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd7765d,_0x39dd52,_0xc547a2){if(_0xd7765d[_0xc3e2('0xa')](_0xc3e2('0xb'))){_0xd7765d[_0xc3e2('0xc')]=moment()[_0xc3e2('0xd')](_0xc3e2('0xe'));}_0xc547a2(null,_0xd7765d);}},'charset':_0xc3e2('0xf'),'collate':_0xc3e2('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 219f79f..1aaab1a 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 _0xeb4e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','bluebird'];(function(_0x82305a,_0x46a9fb){var _0x5b57e6=function(_0x1139a9){while(--_0x1139a9){_0x82305a['push'](_0x82305a['shift']());}};_0x5b57e6(++_0x46a9fb);}(_0xeb4e,0x1b5));var _0xeeb4=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xeb4e[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xeeb4('0x0'));var util=require(_0xeeb4('0x1'));var moment=require('moment');var BPromise=require(_0xeeb4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeeb4('0x3'))['db'];var utils=require(_0xeeb4('0x4'));var logger=require(_0xeeb4('0x5'))(_0xeeb4('0x6'));var config=require(_0xeeb4('0x7'));var jayson=require(_0xeeb4('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xeeb4('0x9')]=_['defaults'](config['redis'],{'host':_0xeeb4('0xa'),'port':0x18eb});var socket=require(_0xeeb4('0xb'))(new Redis(config['redis']));require(_0xeeb4('0xc'))[_0xeeb4('0xd')](socket);function respondWithRpcPromise(_0x5e7386,_0x4f9168,_0x9d1546){return new BPromise(function(_0x4c2806,_0x217922){return client[_0xeeb4('0xe')](_0x5e7386,_0x9d1546)[_0xeeb4('0xf')](function(_0x2e526e){logger[_0xeeb4('0x10')](_0xeeb4('0x11'),_0x4f9168,_0xeeb4('0x12'));logger[_0xeeb4('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4f9168,_0xeeb4('0x12'),JSON[_0xeeb4('0x14')](_0x2e526e));if(_0x2e526e[_0xeeb4('0x15')]){if(_0x2e526e[_0xeeb4('0x15')][_0xeeb4('0x16')]===0x1f4){logger['error'](_0xeeb4('0x11'),_0x4f9168,_0x2e526e[_0xeeb4('0x15')]['message']);return _0x217922(_0x2e526e[_0xeeb4('0x15')][_0xeeb4('0x17')]);}logger[_0xeeb4('0x15')](_0xeeb4('0x11'),_0x4f9168,_0x2e526e['error']['message']);return _0x4c2806(_0x2e526e[_0xeeb4('0x15')][_0xeeb4('0x17')]);}else{logger[_0xeeb4('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x4f9168,_0xeeb4('0x12'));_0x4c2806(_0x2e526e[_0xeeb4('0x18')]['message']);}})['catch'](function(_0x23aaaf){logger[_0xeeb4('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x4f9168,_0x23aaaf);_0x217922(_0x23aaaf);});});}exports[_0xeeb4('0x19')]=function(_0x462fd1){var _0x154b6f=this;return new Promise(function(_0x2b2dbb,_0x4b5ca7){return db['ChatInteraction'][_0xeeb4('0x1a')](_0x462fd1[_0xeeb4('0x1b')],{'raw':_0x462fd1[_0xeeb4('0x1c')]?_0x462fd1[_0xeeb4('0x1c')][_0xeeb4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462fd1[_0xeeb4('0x1c')]?_0x462fd1['options'][_0xeeb4('0x1e')]||null:null,'attributes':_0x462fd1['options']?_0x462fd1[_0xeeb4('0x1c')]['attributes']||null:null,'limit':_0x462fd1[_0xeeb4('0x1c')]?_0x462fd1[_0xeeb4('0x1c')][_0xeeb4('0x1f')]||null:null})[_0xeeb4('0xf')](function(_0x31b598){logger[_0xeeb4('0x10')](_0xeeb4('0x19'),_0x462fd1);logger[_0xeeb4('0x13')](_0xeeb4('0x19'),_0x462fd1,JSON[_0xeeb4('0x14')](_0x31b598));_0x2b2dbb(_0x31b598);})['catch'](function(_0x242895){logger[_0xeeb4('0x15')]('UpdateChatInteraction',_0x242895[_0xeeb4('0x17')],_0x462fd1);_0x4b5ca7(_0x154b6f[_0xeeb4('0x15')](0x1f4,_0x242895[_0xeeb4('0x17')]));});});};exports[_0xeeb4('0x20')]=function(_0x3a1d8f){return new Promise(function(_0x4430a7,_0x5d9775){return db['ChatInteraction'][_0xeeb4('0x21')]({'where':_0x3a1d8f[_0xeeb4('0x1c')]?_0x3a1d8f[_0xeeb4('0x1c')][_0xeeb4('0x1e')]||null:null})['then'](function(_0x44b272){if(_0x44b272){return _0x44b272[_0xeeb4('0x22')](_0x3a1d8f[_0xeeb4('0x1b')][_0xeeb4('0x23')],_[_0xeeb4('0x24')](_0x3a1d8f[_0xeeb4('0x1b')],[_0xeeb4('0x23'),'id'])||{});}})[_0xeeb4('0x25')](function(_0x3d758e){logger[_0xeeb4('0x10')]('AddTags',_0x3a1d8f);logger[_0xeeb4('0x13')](_0xeeb4('0x26'),_0x3a1d8f,JSON[_0xeeb4('0x14')](_0x3d758e));_0x4430a7(_0x3d758e);})[_0xeeb4('0x27')](function(_0x27e0c2){logger[_0xeeb4('0x15')](_0xeeb4('0x26'),_0x27e0c2[_0xeeb4('0x17')],_0x3a1d8f);_0x5d9775(_this[_0xeeb4('0x15')](0x1f4,_0x27e0c2[_0xeeb4('0x17')]));});});}; \ No newline at end of file +var _0xac10=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatInteraction','update','options','where','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','ids','omit','AddTags','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info'];(function(_0x31472c,_0x1bd343){var _0x283f73=function(_0xe1cc62){while(--_0xe1cc62){_0x31472c['push'](_0x31472c['shift']());}};_0x283f73(++_0x1bd343);}(_0xac10,0x1a6));var _0x0ac1=function(_0x13117b,_0x3449eb){_0x13117b=_0x13117b-0x0;var _0x418124=_0xac10[_0x13117b];return _0x418124;};'use strict';var _=require('lodash');var util=require(_0x0ac1('0x0'));var moment=require(_0x0ac1('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ac1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0ac1('0x3'));var logger=require('../../config/logger')(_0x0ac1('0x4'));var config=require(_0x0ac1('0x5'));var jayson=require(_0x0ac1('0x6'));var client=jayson[_0x0ac1('0x7')][_0x0ac1('0x8')]({'port':0x232a});config[_0x0ac1('0x9')]=_[_0x0ac1('0xa')](config[_0x0ac1('0x9')],{'host':_0x0ac1('0xb'),'port':0x18eb});var socket=require(_0x0ac1('0xc'))(new Redis(config[_0x0ac1('0x9')]));require(_0x0ac1('0xd'))[_0x0ac1('0xe')](socket);function respondWithRpcPromise(_0xb30b7c,_0x5268b9,_0xe07fc5){return new BPromise(function(_0x409f62,_0x998529){return client[_0x0ac1('0xf')](_0xb30b7c,_0xe07fc5)[_0x0ac1('0x10')](function(_0x44d4fc){logger[_0x0ac1('0x11')](_0x0ac1('0x12'),_0x5268b9,_0x0ac1('0x13'));logger[_0x0ac1('0x14')](_0x0ac1('0x15'),_0x5268b9,_0x0ac1('0x13'),JSON[_0x0ac1('0x16')](_0x44d4fc));if(_0x44d4fc[_0x0ac1('0x17')]){if(_0x44d4fc[_0x0ac1('0x17')]['code']===0x1f4){logger[_0x0ac1('0x17')](_0x0ac1('0x12'),_0x5268b9,_0x44d4fc[_0x0ac1('0x17')][_0x0ac1('0x18')]);return _0x998529(_0x44d4fc[_0x0ac1('0x17')][_0x0ac1('0x18')]);}logger[_0x0ac1('0x17')](_0x0ac1('0x12'),_0x5268b9,_0x44d4fc[_0x0ac1('0x17')][_0x0ac1('0x18')]);return _0x409f62(_0x44d4fc[_0x0ac1('0x17')]['message']);}else{logger[_0x0ac1('0x11')](_0x0ac1('0x12'),_0x5268b9,'request\x20sent');_0x409f62(_0x44d4fc[_0x0ac1('0x19')][_0x0ac1('0x18')]);}})[_0x0ac1('0x1a')](function(_0x2ae613){logger['error'](_0x0ac1('0x12'),_0x5268b9,_0x2ae613);_0x998529(_0x2ae613);});});}exports['UpdateChatInteraction']=function(_0x2c31a0){var _0x2a1bff=this;return new Promise(function(_0x4c6560,_0x3d3426){return db[_0x0ac1('0x1b')][_0x0ac1('0x1c')](_0x2c31a0['body'],{'raw':_0x2c31a0[_0x0ac1('0x1d')]?_0x2c31a0[_0x0ac1('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c31a0[_0x0ac1('0x1d')]?_0x2c31a0['options'][_0x0ac1('0x1e')]||null:null,'attributes':_0x2c31a0['options']?_0x2c31a0[_0x0ac1('0x1d')][_0x0ac1('0x1f')]||null:null,'limit':_0x2c31a0[_0x0ac1('0x1d')]?_0x2c31a0['options']['limit']||null:null})[_0x0ac1('0x10')](function(_0x5b1efc){logger[_0x0ac1('0x11')](_0x0ac1('0x20'),_0x2c31a0);logger[_0x0ac1('0x14')](_0x0ac1('0x20'),_0x2c31a0,JSON[_0x0ac1('0x16')](_0x5b1efc));_0x4c6560(_0x5b1efc);})['catch'](function(_0x3aa091){logger[_0x0ac1('0x17')](_0x0ac1('0x20'),_0x3aa091[_0x0ac1('0x18')],_0x2c31a0);_0x3d3426(_0x2a1bff[_0x0ac1('0x17')](0x1f4,_0x3aa091[_0x0ac1('0x18')]));});});};exports[_0x0ac1('0x21')]=function(_0x8ca83a){return new Promise(function(_0x2e7bb1,_0x64fe67){return db[_0x0ac1('0x1b')][_0x0ac1('0x22')]({'where':_0x8ca83a[_0x0ac1('0x1d')]?_0x8ca83a[_0x0ac1('0x1d')][_0x0ac1('0x1e')]||null:null})[_0x0ac1('0x10')](function(_0x372076){if(_0x372076){return _0x372076[_0x0ac1('0x23')](_0x8ca83a[_0x0ac1('0x24')][_0x0ac1('0x25')],_[_0x0ac1('0x26')](_0x8ca83a[_0x0ac1('0x24')],['ids','id'])||{});}})['spread'](function(_0x79a9a8){logger[_0x0ac1('0x11')](_0x0ac1('0x27'),_0x8ca83a);logger[_0x0ac1('0x14')](_0x0ac1('0x27'),_0x8ca83a,JSON[_0x0ac1('0x16')](_0x79a9a8));_0x2e7bb1(_0x79a9a8);})['catch'](function(_0x571146){logger[_0x0ac1('0x17')](_0x0ac1('0x27'),_0x571146[_0x0ac1('0x18')],_0x8ca83a);_0x64fe67(_this['error'](0x1f4,_0x571146[_0x0ac1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8685011..69a09fe 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 _0x21d9=['./chatInteraction.events','save','update','removeListener','register','chatInteraction:'];(function(_0x5bb710,_0x2f29f4){var _0x40ed91=function(_0x111bcb){while(--_0x111bcb){_0x5bb710['push'](_0x5bb710['shift']());}};_0x40ed91(++_0x2f29f4);}(_0x21d9,0xf0));var _0x921d=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x21d9[_0x32b993];return _0x482780;};'use strict';var ChatInteractionEvents=require(_0x921d('0x0'));var events=[_0x921d('0x1'),'remove',_0x921d('0x2')];function createListener(_0x32afc7,_0x11eff8){return function(_0x26cd01){_0x11eff8['emit'](_0x32afc7,_0x26cd01);};}function removeListener(_0x4706f4,_0x43d1a2){return function(){ChatInteractionEvents[_0x921d('0x3')](_0x4706f4,_0x43d1a2);};}exports[_0x921d('0x4')]=function(_0x290d34){for(var _0x12715c=0x0,_0x9f18a=events['length'];_0x12715c<_0x9f18a;_0x12715c++){var _0x26e2c0=events[_0x12715c];var _0x54d58f=createListener(_0x921d('0x5')+_0x26e2c0,_0x290d34);ChatInteractionEvents['on'](_0x26e2c0,_0x54d58f);}}; \ No newline at end of file +var _0xb26e=['register','length','chatInteraction:','./chatInteraction.events','emit','removeListener'];(function(_0x3d74e7,_0x46c1a1){var _0x16d7bc=function(_0x4a23f7){while(--_0x4a23f7){_0x3d74e7['push'](_0x3d74e7['shift']());}};_0x16d7bc(++_0x46c1a1);}(_0xb26e,0x11d));var _0xeb26=function(_0x5236a7,_0x410673){_0x5236a7=_0x5236a7-0x0;var _0x55831a=_0xb26e[_0x5236a7];return _0x55831a;};'use strict';var ChatInteractionEvents=require(_0xeb26('0x0'));var events=['save','remove','update'];function createListener(_0x196269,_0x179b14){return function(_0x48ce2b){_0x179b14[_0xeb26('0x1')](_0x196269,_0x48ce2b);};}function removeListener(_0x3b8a6f,_0x2817de){return function(){ChatInteractionEvents[_0xeb26('0x2')](_0x3b8a6f,_0x2817de);};}exports[_0xeb26('0x3')]=function(_0x17f489){for(var _0x2351f9=0x0,_0xc0d644=events[_0xeb26('0x4')];_0x2351f9<_0xc0d644;_0x2351f9++){var _0x12e21a=events[_0x2351f9];var _0x170f9b=createListener(_0xeb26('0x5')+_0x12e21a,_0x17f489);ChatInteractionEvents['on'](_0x12e21a,_0x170f9b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5958f4e..162b5b9 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 _0x47d2=['post','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','single','file','attachmentUpload','addMessage','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','download','create'];(function(_0x25a73d,_0x4fd9ee){var _0x9a40b1=function(_0x4ba486){while(--_0x4ba486){_0x25a73d['push'](_0x25a73d['shift']());}};_0x9a40b1(++_0x4fd9ee);}(_0x47d2,0x122));var _0x247d=function(_0x4559a7,_0x597010){_0x4559a7=_0x4559a7-0x0;var _0x2de007=_0x47d2[_0x4559a7];return _0x2de007;};'use strict';var multer=require('multer');var util=require(_0x247d('0x0'));var path=require(_0x247d('0x1'));var timeout=require(_0x247d('0x2'));var express=require('express');var router=express[_0x247d('0x3')]();var fs_extra=require(_0x247d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x247d('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x247d('0x6')]('/',auth['isAuthenticated'](),controller[_0x247d('0x7')]);router[_0x247d('0x6')](_0x247d('0x8'),auth[_0x247d('0x9')](),controller[_0x247d('0xa')]);router[_0x247d('0x6')](_0x247d('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x247d('0xc')]);router[_0x247d('0x6')](_0x247d('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x247d('0xe')]);router[_0x247d('0x6')](_0x247d('0xf'),auth[_0x247d('0x9')](),controller[_0x247d('0x10')]);router[_0x247d('0x6')](_0x247d('0x11'),auth[_0x247d('0x12')](),controller[_0x247d('0x13')]);router[_0x247d('0x6')]('/:id/download',auth[_0x247d('0x9')](),controller[_0x247d('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x247d('0x15')]);router[_0x247d('0x16')]('/:id/vidaoo',auth[_0x247d('0x9')](),controller[_0x247d('0x17')]);var upload=multer({'storage':multer[_0x247d('0x18')]({'destination':function(_0x1c068a,_0x1603b6,_0x58f041){_0x58f041(null,path[_0x247d('0x19')](config[_0x247d('0x1a')],_0x247d('0x1b')));},'filename':function(_0x485ca6,_0x91242,_0x92f767){_0x92f767(null,util['format'](_0x247d('0x1c'),Date[_0x247d('0x1d')](),_0x91242[_0x247d('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x247d('0x16')]('/:id/attachment_upload',upload[_0x247d('0x1f')](_0x247d('0x20')),controller[_0x247d('0x21')]);router[_0x247d('0x16')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x247d('0x22')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x247d('0x23')]('chat','chatinteraction:addtags'),controller[_0x247d('0x24')]);router[_0x247d('0x25')](_0x247d('0xb'),auth[_0x247d('0x9')](),interaction[_0x247d('0x23')](_0x247d('0x26'),_0x247d('0x27')),controller[_0x247d('0x28')]);router['put'](_0x247d('0x29'),controller[_0x247d('0x2a')]);router[_0x247d('0x25')](_0x247d('0x2b'),auth[_0x247d('0x12')](),controller['abandon']);router[_0x247d('0x25')](_0x247d('0x2c'),controller[_0x247d('0x2d')]);router[_0x247d('0x2e')](_0x247d('0xb'),auth['isAuthenticated'](),interaction[_0x247d('0x23')](_0x247d('0x26'),_0x247d('0x2f')),controller[_0x247d('0x30')]);router[_0x247d('0x2e')](_0x247d('0x31'),auth['isAuthenticated'](),controller[_0x247d('0x32')]);module[_0x247d('0x33')]=router; \ No newline at end of file +var _0xb4f2=['fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','download','/:id/vidaoo','diskStorage','join','server/files/attachments/','%s-%s','now','/:id/attachment_upload','single','attachmentUpload','post','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb4f2,0xe0));var _0x2b4f=function(_0xea2757,_0x394521){_0xea2757=_0xea2757-0x0;var _0x3ed656=_0xb4f2[_0xea2757];return _0x3ed656;};'use strict';var multer=require(_0x2b4f('0x0'));var util=require(_0x2b4f('0x1'));var path=require(_0x2b4f('0x2'));var timeout=require(_0x2b4f('0x3'));var express=require(_0x2b4f('0x4'));var router=express[_0x2b4f('0x5')]();var fs_extra=require(_0x2b4f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2b4f('0x7'));var config=require(_0x2b4f('0x8'));var controller=require(_0x2b4f('0x9'));router[_0x2b4f('0xa')]('/',auth[_0x2b4f('0xb')](),controller[_0x2b4f('0xc')]);router['get'](_0x2b4f('0xd'),auth[_0x2b4f('0xb')](),controller[_0x2b4f('0xe')]);router[_0x2b4f('0xa')](_0x2b4f('0xf'),auth[_0x2b4f('0x10')](),controller['show']);router[_0x2b4f('0xa')]('/:id/attachment_download',auth[_0x2b4f('0x10')](),controller['attachmentDownload']);router['get'](_0x2b4f('0x11'),auth['isAuthenticated'](),controller[_0x2b4f('0x12')]);router[_0x2b4f('0xa')](_0x2b4f('0x13'),auth[_0x2b4f('0x10')](),controller['getMyMessages']);router[_0x2b4f('0xa')]('/:id/download',auth[_0x2b4f('0xb')](),controller[_0x2b4f('0x14')]);router['post']('/',auth[_0x2b4f('0xb')](),controller['create']);router['post'](_0x2b4f('0x15'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x2b4f('0x16')]({'destination':function(_0xa5d0f5,_0x51d3cb,_0x28f32b){_0x28f32b(null,path[_0x2b4f('0x17')](config['root'],_0x2b4f('0x18')));},'filename':function(_0x525e9b,_0x33ccac,_0x1c2932){_0x1c2932(null,util['format'](_0x2b4f('0x19'),Date[_0x2b4f('0x1a')](),_0x33ccac['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2b4f('0x1b'),upload[_0x2b4f('0x1c')]('file'),controller[_0x2b4f('0x1d')]);router[_0x2b4f('0x1e')](_0x2b4f('0x11'),auth[_0x2b4f('0x10')](),controller[_0x2b4f('0x1f')]);router[_0x2b4f('0x1e')](_0x2b4f('0x20'),auth[_0x2b4f('0xb')](),interaction[_0x2b4f('0x21')](_0x2b4f('0x22'),_0x2b4f('0x23')),controller[_0x2b4f('0x24')]);router[_0x2b4f('0x25')](_0x2b4f('0xf'),auth[_0x2b4f('0xb')](),interaction[_0x2b4f('0x21')](_0x2b4f('0x22'),'chatinteraction:update'),controller[_0x2b4f('0x26')]);router[_0x2b4f('0x25')](_0x2b4f('0x27'),controller[_0x2b4f('0x28')]);router[_0x2b4f('0x25')](_0x2b4f('0x29'),auth[_0x2b4f('0x10')](),controller[_0x2b4f('0x2a')]);router['put'](_0x2b4f('0x2b'),controller['close']);router[_0x2b4f('0x2c')](_0x2b4f('0xf'),auth[_0x2b4f('0xb')](),interaction[_0x2b4f('0x21')](_0x2b4f('0x22'),'chatinteraction:destroy'),controller[_0x2b4f('0x2d')]);router[_0x2b4f('0x2c')](_0x2b4f('0x20'),auth[_0x2b4f('0xb')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f847f0c..0737b73 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 _0xd6df=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0x411a13,_0x4cf363){var _0x18cf54=function(_0x1af266){while(--_0x1af266){_0x411a13['push'](_0x411a13['shift']());}};_0x18cf54(++_0x4cf363);}(_0xd6df,0x110));var _0xfd6d=function(_0x5a02c0,_0x3179f9){_0x5a02c0=_0x5a02c0-0x0;var _0x3634cb=_0xd6df[_0x5a02c0];return _0x3634cb;};'use strict';var Sequelize=require(_0xfd6d('0x0'));module[_0xfd6d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xfd6d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfd6d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xfd6d('0x4')]}}; \ No newline at end of file +var _0x2873=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x2dced3,_0x445684){var _0x1d3a18=function(_0x5ef82c){while(--_0x5ef82c){_0x2dced3['push'](_0x2dced3['shift']());}};_0x1d3a18(++_0x445684);}(_0x2873,0x18c));var _0x3287=function(_0x5c4908,_0x30892e){_0x5c4908=_0x5c4908-0x0;var _0x58c36f=_0x2873[_0x5c4908];return _0x58c36f;};'use strict';var Sequelize=require(_0x3287('0x0'));module[_0x3287('0x1')]={'body':{'type':Sequelize[_0x3287('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3287('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3287('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6d54fbe..eb1fad5 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 _0xbc99=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','catch','params','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type'];(function(_0x560c01,_0x12b739){var _0x41885e=function(_0x435bbb){while(--_0x435bbb){_0x560c01['push'](_0x560c01['shift']());}};_0x41885e(++_0x12b739);}(_0xbc99,0xa8));var _0x9bc9=function(_0x493869,_0x165d37){_0x493869=_0x493869-0x0;var _0x44ecbb=_0xbc99[_0x493869];return _0x44ecbb;};'use strict';var emlformat=require(_0x9bc9('0x0'));var rimraf=require(_0x9bc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bc9('0x2'));var moment=require(_0x9bc9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9bc9('0x4'));var util=require(_0x9bc9('0x5'));var path=require(_0x9bc9('0x6'));var sox=require(_0x9bc9('0x7'));var csv=require(_0x9bc9('0x8'));var ejs=require(_0x9bc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bc9('0xa'));var squel=require(_0x9bc9('0xb'));var crypto=require(_0x9bc9('0xc'));var jsforce=require(_0x9bc9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9bc9('0x8'));var querystring=require(_0x9bc9('0xe'));var Papa=require(_0x9bc9('0xf'));var Redis=require(_0x9bc9('0x10'));var authService=require(_0x9bc9('0x11'));var qs=require(_0x9bc9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bc9('0x13'));var logger=require(_0x9bc9('0x14'))(_0x9bc9('0x15'));var utils=require('../../config/utils');var config=require(_0x9bc9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9bc9('0x17')]=_[_0x9bc9('0x18')](config[_0x9bc9('0x17')],{'host':_0x9bc9('0x19'),'port':0x18eb});var socket=require(_0x9bc9('0x1a'))(new Redis(config[_0x9bc9('0x17')]));require(_0x9bc9('0x1b'))['register'](socket);function respondWithStatusCode(_0x4c1317,_0x1350fb){_0x1350fb=_0x1350fb||0xcc;return function(_0x47754f){if(_0x47754f){return _0x4c1317[_0x9bc9('0x1c')](_0x1350fb);}return _0x4c1317[_0x9bc9('0x1d')](_0x1350fb)[_0x9bc9('0x1e')]();};}function respondWithResult(_0x4961da,_0x33122f){_0x33122f=_0x33122f||0xc8;return function(_0x335a9f){if(_0x335a9f){return _0x4961da[_0x9bc9('0x1d')](_0x33122f)['json'](_0x335a9f);}};}function respondWithFilteredResult(_0x61f14e,_0x38c53d){return function(_0xb085d6){if(_0xb085d6){var _0x38aba2=typeof _0x38c53d[_0x9bc9('0x1f')]===_0x9bc9('0x20')&&typeof _0x38c53d['limit']===_0x9bc9('0x20');var _0x2df54a=_0xb085d6[_0x9bc9('0x21')];var _0x35a2aa=_0x38aba2?0x0:_0x38c53d[_0x9bc9('0x1f')];var _0x2d6b40=_0x38aba2?_0xb085d6['count']:_0x38c53d[_0x9bc9('0x1f')]+_0x38c53d['limit'];var _0x278de5;if(_0x2d6b40>=_0x2df54a){_0x2d6b40=_0x2df54a;_0x278de5=0xc8;}else{_0x278de5=0xce;}_0x61f14e['status'](_0x278de5);return _0x61f14e[_0x9bc9('0x22')]('Content-Range',_0x35a2aa+'-'+_0x2d6b40+'/'+_0x2df54a)['json'](_0xb085d6);}return null;};}function patchUpdates(_0x586e31){return function(_0x48d65e){try{jsonpatch[_0x9bc9('0x23')](_0x48d65e,_0x586e31,!![]);}catch(_0xe58ebe){return BPromise[_0x9bc9('0x24')](_0xe58ebe);}return _0x48d65e[_0x9bc9('0x25')]();};}function saveUpdates(_0x2385e5,_0x4bced8){return function(_0x24e916){if(_0x24e916){return _0x24e916[_0x9bc9('0x26')](_0x2385e5)['then'](function(_0x26bd75){return _0x26bd75;});}return null;};}function removeEntity(_0xf97786,_0x42ce37){return function(_0x34ed25){if(_0x34ed25){return _0x34ed25[_0x9bc9('0x27')]()[_0x9bc9('0x28')](function(){_0xf97786[_0x9bc9('0x1d')](0xcc)[_0x9bc9('0x1e')]();});}};}function handleEntityNotFound(_0x2e9e39,_0x2479ae){return function(_0x264104){if(!_0x264104){_0x2e9e39['sendStatus'](0x194);}return _0x264104;};}function handleError(_0x1f2c75,_0x2e7590){_0x2e7590=_0x2e7590||0x1f4;return function(_0x17c680){logger[_0x9bc9('0x29')](_0x17c680[_0x9bc9('0x2a')]);if(_0x17c680[_0x9bc9('0x2b')]){delete _0x17c680[_0x9bc9('0x2b')];}_0x1f2c75[_0x9bc9('0x1d')](_0x2e7590)['send'](_0x17c680);};}exports[_0x9bc9('0x2c')]=function(_0x466223,_0x19e5ab){var _0x597cfd={},_0x248e72={},_0x348c10={'count':0x0,'rows':[]};var _0x14c6d8=_[_0x9bc9('0x2d')](db[_0x9bc9('0x2e')][_0x9bc9('0x2f')],function(_0x4fde4e){return{'name':_0x4fde4e[_0x9bc9('0x30')],'type':_0x4fde4e[_0x9bc9('0x31')][_0x9bc9('0x32')]};});_0x248e72[_0x9bc9('0x33')]=_[_0x9bc9('0x2d')](_0x14c6d8,_0x9bc9('0x2b'));_0x248e72[_0x9bc9('0x34')]=_[_0x9bc9('0x35')](_0x466223[_0x9bc9('0x34')]);_0x248e72['filters']=_[_0x9bc9('0x36')](_0x248e72[_0x9bc9('0x33')],_0x248e72[_0x9bc9('0x34')]);_0x597cfd['attributes']=_['intersection'](_0x248e72[_0x9bc9('0x33')],qs[_0x9bc9('0x37')](_0x466223['query'][_0x9bc9('0x37')]));_0x597cfd[_0x9bc9('0x38')]=_0x597cfd['attributes'][_0x9bc9('0x39')]?_0x597cfd[_0x9bc9('0x38')]:_0x248e72[_0x9bc9('0x33')];if(!_0x466223[_0x9bc9('0x34')][_0x9bc9('0x3a')](_0x9bc9('0x3b'))){_0x597cfd[_0x9bc9('0x3c')]=qs[_0x9bc9('0x3c')](_0x466223[_0x9bc9('0x34')][_0x9bc9('0x3c')]);_0x597cfd[_0x9bc9('0x1f')]=qs[_0x9bc9('0x1f')](_0x466223[_0x9bc9('0x34')][_0x9bc9('0x1f')]);}_0x597cfd[_0x9bc9('0x3d')]=qs['sort'](_0x466223[_0x9bc9('0x34')][_0x9bc9('0x3e')]);_0x597cfd[_0x9bc9('0x3f')]=qs['filters'](_[_0x9bc9('0x40')](_0x466223[_0x9bc9('0x34')],_0x248e72[_0x9bc9('0x41')]),_0x14c6d8);if(_0x466223[_0x9bc9('0x34')]['filter']){_0x597cfd[_0x9bc9('0x3f')]=_[_0x9bc9('0x42')](_0x597cfd[_0x9bc9('0x3f')],{'$or':_[_0x9bc9('0x2d')](_0x14c6d8,function(_0x392412){if(_0x392412['type']!==_0x9bc9('0x43')){var _0x28b7a1={};_0x28b7a1[_0x392412[_0x9bc9('0x2b')]]={'$like':'%'+_0x466223[_0x9bc9('0x34')][_0x9bc9('0x44')]+'%'};return _0x28b7a1;}})});}_0x597cfd=_[_0x9bc9('0x42')]({},_0x597cfd,_0x466223[_0x9bc9('0x45')]);var _0x58b12f={'where':_0x597cfd['where']};return db[_0x9bc9('0x2e')]['count'](_0x58b12f)['then'](function(_0x25372c){_0x348c10[_0x9bc9('0x21')]=_0x25372c;if(_0x466223['query']['includeAll']){_0x597cfd[_0x9bc9('0x46')]=[{'all':!![]}];}return db[_0x9bc9('0x2e')]['findAll'](_0x597cfd);})['then'](function(_0x1b94f2){_0x348c10['rows']=_0x1b94f2;return _0x348c10;})['then'](respondWithFilteredResult(_0x19e5ab,_0x597cfd))[_0x9bc9('0x47')](handleError(_0x19e5ab,null));};exports['show']=function(_0x518263,_0x32d624){var _0x4ad1db={'raw':!![],'where':{'id':_0x518263[_0x9bc9('0x48')]['id']}},_0x2aade7={};_0x2aade7[_0x9bc9('0x33')]=_[_0x9bc9('0x35')](db[_0x9bc9('0x2e')][_0x9bc9('0x2f')]);_0x2aade7[_0x9bc9('0x34')]=_[_0x9bc9('0x35')](_0x518263[_0x9bc9('0x34')]);_0x2aade7[_0x9bc9('0x41')]=_[_0x9bc9('0x36')](_0x2aade7[_0x9bc9('0x33')],_0x2aade7[_0x9bc9('0x34')]);_0x4ad1db[_0x9bc9('0x38')]=_[_0x9bc9('0x36')](_0x2aade7['model'],qs[_0x9bc9('0x37')](_0x518263[_0x9bc9('0x34')][_0x9bc9('0x37')]));_0x4ad1db['attributes']=_0x4ad1db[_0x9bc9('0x38')][_0x9bc9('0x39')]?_0x4ad1db['attributes']:_0x2aade7[_0x9bc9('0x33')];if(_0x518263[_0x9bc9('0x34')][_0x9bc9('0x49')]){_0x4ad1db[_0x9bc9('0x46')]=[{'all':!![]}];}_0x4ad1db=_[_0x9bc9('0x42')]({},_0x4ad1db,_0x518263[_0x9bc9('0x45')]);return db[_0x9bc9('0x2e')][_0x9bc9('0x4a')](_0x4ad1db)[_0x9bc9('0x28')](handleEntityNotFound(_0x32d624,null))[_0x9bc9('0x28')](respondWithResult(_0x32d624,null))[_0x9bc9('0x47')](handleError(_0x32d624,null));};exports[_0x9bc9('0x4b')]=function(_0x5c6ede,_0x2c4153){return db[_0x9bc9('0x2e')][_0x9bc9('0x4b')](_0x5c6ede['body'],{})[_0x9bc9('0x28')](respondWithResult(_0x2c4153,0xc9))[_0x9bc9('0x47')](handleError(_0x2c4153,null));};exports[_0x9bc9('0x26')]=function(_0x53c333,_0x3342dc){if(_0x53c333[_0x9bc9('0x4c')]['id']){delete _0x53c333[_0x9bc9('0x4c')]['id'];}return db[_0x9bc9('0x2e')][_0x9bc9('0x4a')]({'where':{'id':_0x53c333[_0x9bc9('0x48')]['id']}})['then'](handleEntityNotFound(_0x3342dc,null))['then'](saveUpdates(_0x53c333['body'],null))['then'](respondWithResult(_0x3342dc,null))[_0x9bc9('0x47')](handleError(_0x3342dc,null));};exports['destroy']=function(_0x5093c5,_0x52c151){return db[_0x9bc9('0x2e')]['find']({'where':{'id':_0x5093c5[_0x9bc9('0x48')]['id']}})[_0x9bc9('0x28')](handleEntityNotFound(_0x52c151,null))[_0x9bc9('0x28')](removeEntity(_0x52c151,null))[_0x9bc9('0x47')](handleError(_0x52c151,null));};exports[_0x9bc9('0x4d')]=function(_0x1150bb,_0x44244a){return db['ChatInternalMessage']['describe']()[_0x9bc9('0x28')](respondWithResult(_0x44244a,null))[_0x9bc9('0x47')](handleError(_0x44244a,null));};function wrapUser(_0x276bc3){return function(_0x349d79){var _0x3dead=_0x276bc3[_0x9bc9('0x4e')]({'plain':!![]});_0x3dead[_0x9bc9('0x4f')]=[];if(_0x349d79){_0x3dead[_0x9bc9('0x50')]=_0x349d79[_0x9bc9('0x51')];_0x3dead['lastMessage']=_0x349d79;}else{_0x3dead[_0x9bc9('0x50')]=moment(0x0)[_0x9bc9('0x52')](_0x9bc9('0x53'));_0x3dead['lastMessage']={};}return _0x3dead;};}exports['getUsers']=function(_0x5edf28,_0x593cb1,_0x50d6cf){var _0x4cfae9=[];return db[_0x9bc9('0x54')][_0x9bc9('0x55')]({'where':{'role':['agent','admin',_0x9bc9('0x56')]},'attributes':['id',_0x9bc9('0x57'),_0x9bc9('0x2b'),_0x9bc9('0x58'),_0x9bc9('0x59'),_0x9bc9('0x5a'),_0x9bc9('0x5b'),_0x9bc9('0x5c'),_0x9bc9('0x5d'),'showWebBar'],'order':qs[_0x9bc9('0x3e')](_0x9bc9('0x5e')),'include':[{'model':db[_0x9bc9('0x5f')],'as':_0x9bc9('0x60'),'attributes':['id',_0x9bc9('0x2b'),_0x9bc9('0x31')],'through':{'attributes':[]}}]})[_0x9bc9('0x28')](function(_0x29c0a1){if(_0x29c0a1){var _0x50b07c=_0x5edf28['user'][_0x9bc9('0x4e')]({'plain':!![]});if(!_0x50b07c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50b07c['role']===_0x9bc9('0x56')){return db['UserProfileSection'][_0x9bc9('0x4a')]({'where':{'name':_0x9bc9('0x61'),'userProfileId':_0x50b07c[_0x9bc9('0x62')]},'raw':!![]})[_0x9bc9('0x28')](function(_0x3b11c1){if(_0x3b11c1){if(_0x3b11c1[_0x9bc9('0x63')]===0x0){return db[_0x9bc9('0x64')][_0x9bc9('0x55')]({'where':{'sectionId':_0x3b11c1['id']},'raw':!![]})[_0x9bc9('0x28')](function(_0x3a9869){var _0x5b1c78=[];if(_[_0x9bc9('0x65')](_0x3a9869)){_0x5b1c78=_[_0x9bc9('0x44')](_0x29c0a1,function(_0x26d75f){if(_0x26d75f['role']!==_0x9bc9('0x66')){return _0x26d75f;}});return _0x5b1c78;}else{for(var _0x16f1cf=0x0;_0x16f1cf<_0x29c0a1[_0x9bc9('0x39')];_0x16f1cf++){var _0x591012=_0x29c0a1[_0x16f1cf];if(_0x591012[_0x9bc9('0x58')]===_0x9bc9('0x66')){var _0x510cba=_[_0x9bc9('0x4a')](_0x3a9869,function(_0x5efcb1){return _0x5efcb1[_0x9bc9('0x67')]===_0x591012['id'];});if(_0x510cba)_0x5b1c78['push'](_0x591012);}else{_0x5b1c78['push'](_0x591012);}}return _0x5b1c78;}});}else{return _0x29c0a1;}}else{var _0x5228ce=_[_0x9bc9('0x44')](_0x29c0a1,function(_0x48ceed){if(_0x48ceed[_0x9bc9('0x58')]!=='agent'){return _0x48ceed;}});return _0x5228ce;}});}else{return _0x29c0a1;}}})[_0x9bc9('0x28')](function(_0x3c6ef4){var _0x1a287f=[];if(_0x3c6ef4){_0x4cfae9=_0x3c6ef4;for(var _0x51629d=0x0;_0x51629d<_0x3c6ef4['length'];_0x51629d+=0x1){_0x4cfae9[_0x51629d][_0x9bc9('0x4f')]=[];_0x1a287f[_0x9bc9('0x68')](db[_0x9bc9('0x2e')][_0x9bc9('0x4a')]({'where':{'FromId':[_0x5edf28['user']['id'],_0x3c6ef4[_0x51629d]['id']],'ToId':[_0x5edf28[_0x9bc9('0x56')]['id'],_0x3c6ef4[_0x51629d]['id']],'ChatGroupId':null},'attributes':['id',_0x9bc9('0x51'),_0x9bc9('0x69'),_0x9bc9('0x6a'),'read',_0x9bc9('0x4c')],'order':qs['sort'](_0x9bc9('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3c6ef4[_0x51629d])));}return BPromise[_0x9bc9('0x6c')](_0x1a287f);}return[];})[_0x9bc9('0x28')](function(_0x37928a){return{'rows':_0x37928a,'count':_0x37928a['length']};})[_0x9bc9('0x28')](respondWithResult(_0x593cb1,null))[_0x9bc9('0x47')](handleError(_0x593cb1,null));}; \ No newline at end of file +var _0x379c=['show','params','find','catch','create','body','destroy','describe','get','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','agent','messages','FromId','ToId','read','-createdAt','all','eml-format','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows'];(function(_0x2a2ce3,_0x1430a6){var _0x15f1c6=function(_0x1fe5b2){while(--_0x1fe5b2){_0x2a2ce3['push'](_0x2a2ce3['shift']());}};_0x15f1c6(++_0x1430a6);}(_0x379c,0x112));var _0xc379=function(_0x33b678,_0x35f4cf){_0x33b678=_0x33b678-0x0;var _0x463b6c=_0x379c[_0x33b678];return _0x463b6c;};'use strict';var emlformat=require(_0xc379('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc379('0x1'));var moment=require('moment');var BPromise=require(_0xc379('0x2'));var Mustache=require(_0xc379('0x3'));var util=require(_0xc379('0x4'));var path=require(_0xc379('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc379('0x6'));var fs=require('fs');var fs_extra=require(_0xc379('0x7'));var _=require('lodash');var squel=require(_0xc379('0x8'));var crypto=require(_0xc379('0x9'));var jsforce=require(_0xc379('0xa'));var deskjs=require(_0xc379('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc379('0xc'));var Papa=require(_0xc379('0xd'));var Redis=require(_0xc379('0xe'));var authService=require(_0xc379('0xf'));var qs=require(_0xc379('0x10'));var as=require(_0xc379('0x11'));var hardwareService=require(_0xc379('0x12'));var logger=require(_0xc379('0x13'))(_0xc379('0x14'));var utils=require('../../config/utils');var config=require(_0xc379('0x15'));var licenseUtil=require(_0xc379('0x16'));var db=require(_0xc379('0x17'))['db'];config['redis']=_['defaults'](config[_0xc379('0x18')],{'host':_0xc379('0x19'),'port':0x18eb});var socket=require(_0xc379('0x1a'))(new Redis(config[_0xc379('0x18')]));require(_0xc379('0x1b'))['register'](socket);function respondWithStatusCode(_0x5b461b,_0x33c286){_0x33c286=_0x33c286||0xcc;return function(_0x56e5a0){if(_0x56e5a0){return _0x5b461b[_0xc379('0x1c')](_0x33c286);}return _0x5b461b[_0xc379('0x1d')](_0x33c286)[_0xc379('0x1e')]();};}function respondWithResult(_0x12aaf2,_0x1333a5){_0x1333a5=_0x1333a5||0xc8;return function(_0x1d2e41){if(_0x1d2e41){return _0x12aaf2['status'](_0x1333a5)[_0xc379('0x1f')](_0x1d2e41);}};}function respondWithFilteredResult(_0x776e6f,_0x325084){return function(_0x1ec12d){if(_0x1ec12d){var _0x56e4b0=typeof _0x325084['offset']===_0xc379('0x20')&&typeof _0x325084[_0xc379('0x21')]===_0xc379('0x20');var _0x9b004=_0x1ec12d[_0xc379('0x22')];var _0x3e092e=_0x56e4b0?0x0:_0x325084[_0xc379('0x23')];var _0x12e411=_0x56e4b0?_0x1ec12d[_0xc379('0x22')]:_0x325084['offset']+_0x325084[_0xc379('0x21')];var _0x1fe22a;if(_0x12e411>=_0x9b004){_0x12e411=_0x9b004;_0x1fe22a=0xc8;}else{_0x1fe22a=0xce;}_0x776e6f['status'](_0x1fe22a);return _0x776e6f[_0xc379('0x24')]('Content-Range',_0x3e092e+'-'+_0x12e411+'/'+_0x9b004)[_0xc379('0x1f')](_0x1ec12d);}return null;};}function patchUpdates(_0x219228){return function(_0x1421ad){try{jsonpatch[_0xc379('0x25')](_0x1421ad,_0x219228,!![]);}catch(_0x531729){return BPromise[_0xc379('0x26')](_0x531729);}return _0x1421ad[_0xc379('0x27')]();};}function saveUpdates(_0x33ef90,_0x315339){return function(_0x246a48){if(_0x246a48){return _0x246a48[_0xc379('0x28')](_0x33ef90)[_0xc379('0x29')](function(_0x1ca5ef){return _0x1ca5ef;});}return null;};}function removeEntity(_0x545370,_0x3f0130){return function(_0x1e130e){if(_0x1e130e){return _0x1e130e['destroy']()[_0xc379('0x29')](function(){_0x545370[_0xc379('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ab5c,_0x5512bc){return function(_0x4120d3){if(!_0x4120d3){_0x13ab5c[_0xc379('0x1c')](0x194);}return _0x4120d3;};}function handleError(_0x10e368,_0x41aca6){_0x41aca6=_0x41aca6||0x1f4;return function(_0xf2da51){logger[_0xc379('0x2a')](_0xf2da51[_0xc379('0x2b')]);if(_0xf2da51['name']){delete _0xf2da51[_0xc379('0x2c')];}_0x10e368['status'](_0x41aca6)[_0xc379('0x2d')](_0xf2da51);};}exports[_0xc379('0x2e')]=function(_0x4f2602,_0x2c69a4){var _0x50cc25={},_0x27555d={},_0x58a6af={'count':0x0,'rows':[]};var _0x127f9f=_[_0xc379('0x2f')](db['ChatInternalMessage'][_0xc379('0x30')],function(_0x28a59c){return{'name':_0x28a59c[_0xc379('0x31')],'type':_0x28a59c[_0xc379('0x32')][_0xc379('0x33')]};});_0x27555d[_0xc379('0x34')]=_[_0xc379('0x2f')](_0x127f9f,'name');_0x27555d[_0xc379('0x35')]=_[_0xc379('0x36')](_0x4f2602[_0xc379('0x35')]);_0x27555d['filters']=_[_0xc379('0x37')](_0x27555d['model'],_0x27555d[_0xc379('0x35')]);_0x50cc25['attributes']=_['intersection'](_0x27555d[_0xc379('0x34')],qs[_0xc379('0x38')](_0x4f2602[_0xc379('0x35')][_0xc379('0x38')]));_0x50cc25['attributes']=_0x50cc25[_0xc379('0x39')][_0xc379('0x3a')]?_0x50cc25[_0xc379('0x39')]:_0x27555d[_0xc379('0x34')];if(!_0x4f2602[_0xc379('0x35')][_0xc379('0x3b')](_0xc379('0x3c'))){_0x50cc25[_0xc379('0x21')]=qs[_0xc379('0x21')](_0x4f2602[_0xc379('0x35')][_0xc379('0x21')]);_0x50cc25[_0xc379('0x23')]=qs['offset'](_0x4f2602[_0xc379('0x35')][_0xc379('0x23')]);}_0x50cc25['order']=qs[_0xc379('0x3d')](_0x4f2602[_0xc379('0x35')][_0xc379('0x3d')]);_0x50cc25['where']=qs[_0xc379('0x3e')](_[_0xc379('0x3f')](_0x4f2602[_0xc379('0x35')],_0x27555d[_0xc379('0x3e')]),_0x127f9f);if(_0x4f2602[_0xc379('0x35')][_0xc379('0x40')]){_0x50cc25['where']=_[_0xc379('0x41')](_0x50cc25[_0xc379('0x42')],{'$or':_['map'](_0x127f9f,function(_0x217220){if(_0x217220[_0xc379('0x32')]!==_0xc379('0x43')){var _0x20f1e0={};_0x20f1e0[_0x217220[_0xc379('0x2c')]]={'$like':'%'+_0x4f2602[_0xc379('0x35')]['filter']+'%'};return _0x20f1e0;}})});}_0x50cc25=_[_0xc379('0x41')]({},_0x50cc25,_0x4f2602[_0xc379('0x44')]);var _0x68d8f6={'where':_0x50cc25[_0xc379('0x42')]};return db[_0xc379('0x45')][_0xc379('0x22')](_0x68d8f6)[_0xc379('0x29')](function(_0x2e4a40){_0x58a6af[_0xc379('0x22')]=_0x2e4a40;if(_0x4f2602[_0xc379('0x35')][_0xc379('0x46')]){_0x50cc25[_0xc379('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xc379('0x48')](_0x50cc25);})[_0xc379('0x29')](function(_0xa76252){_0x58a6af[_0xc379('0x49')]=_0xa76252;return _0x58a6af;})[_0xc379('0x29')](respondWithFilteredResult(_0x2c69a4,_0x50cc25))['catch'](handleError(_0x2c69a4,null));};exports[_0xc379('0x4a')]=function(_0x5f2c79,_0x55f070){var _0x26e4b5={'raw':!![],'where':{'id':_0x5f2c79[_0xc379('0x4b')]['id']}},_0x38fb01={};_0x38fb01[_0xc379('0x34')]=_[_0xc379('0x36')](db[_0xc379('0x45')][_0xc379('0x30')]);_0x38fb01[_0xc379('0x35')]=_[_0xc379('0x36')](_0x5f2c79[_0xc379('0x35')]);_0x38fb01[_0xc379('0x3e')]=_['intersection'](_0x38fb01[_0xc379('0x34')],_0x38fb01['query']);_0x26e4b5[_0xc379('0x39')]=_[_0xc379('0x37')](_0x38fb01[_0xc379('0x34')],qs['fields'](_0x5f2c79['query'][_0xc379('0x38')]));_0x26e4b5[_0xc379('0x39')]=_0x26e4b5[_0xc379('0x39')]['length']?_0x26e4b5[_0xc379('0x39')]:_0x38fb01[_0xc379('0x34')];if(_0x5f2c79[_0xc379('0x35')][_0xc379('0x46')]){_0x26e4b5['include']=[{'all':!![]}];}_0x26e4b5=_[_0xc379('0x41')]({},_0x26e4b5,_0x5f2c79[_0xc379('0x44')]);return db[_0xc379('0x45')][_0xc379('0x4c')](_0x26e4b5)['then'](handleEntityNotFound(_0x55f070,null))[_0xc379('0x29')](respondWithResult(_0x55f070,null))[_0xc379('0x4d')](handleError(_0x55f070,null));};exports['create']=function(_0x2e4911,_0x32e189){return db[_0xc379('0x45')][_0xc379('0x4e')](_0x2e4911[_0xc379('0x4f')],{})[_0xc379('0x29')](respondWithResult(_0x32e189,0xc9))[_0xc379('0x4d')](handleError(_0x32e189,null));};exports[_0xc379('0x28')]=function(_0x5ba81b,_0x29ed57){if(_0x5ba81b[_0xc379('0x4f')]['id']){delete _0x5ba81b[_0xc379('0x4f')]['id'];}return db[_0xc379('0x45')][_0xc379('0x4c')]({'where':{'id':_0x5ba81b[_0xc379('0x4b')]['id']}})[_0xc379('0x29')](handleEntityNotFound(_0x29ed57,null))[_0xc379('0x29')](saveUpdates(_0x5ba81b[_0xc379('0x4f')],null))[_0xc379('0x29')](respondWithResult(_0x29ed57,null))[_0xc379('0x4d')](handleError(_0x29ed57,null));};exports[_0xc379('0x50')]=function(_0x1b26fe,_0xfe6faa){return db[_0xc379('0x45')]['find']({'where':{'id':_0x1b26fe[_0xc379('0x4b')]['id']}})[_0xc379('0x29')](handleEntityNotFound(_0xfe6faa,null))[_0xc379('0x29')](removeEntity(_0xfe6faa,null))[_0xc379('0x4d')](handleError(_0xfe6faa,null));};exports[_0xc379('0x51')]=function(_0x3562fd,_0x4ef66b){return db['ChatInternalMessage'][_0xc379('0x51')]()['then'](respondWithResult(_0x4ef66b,null))[_0xc379('0x4d')](handleError(_0x4ef66b,null));};function wrapUser(_0x4a0938){return function(_0x2f400f){var _0x534c00=_0x4a0938[_0xc379('0x52')]({'plain':!![]});_0x534c00['messages']=[];if(_0x2f400f){_0x534c00['lastMessageAt']=_0x2f400f[_0xc379('0x53')];_0x534c00[_0xc379('0x54')]=_0x2f400f;}else{_0x534c00[_0xc379('0x55')]=moment(0x0)['format'](_0xc379('0x56'));_0x534c00[_0xc379('0x54')]={};}return _0x534c00;};}exports[_0xc379('0x57')]=function(_0x5a60a9,_0x58b307,_0x538de2){var _0x2f4ba2=[];return db['User'][_0xc379('0x48')]({'where':{'role':['agent',_0xc379('0x58'),'user']},'attributes':['id',_0xc379('0x59'),'name',_0xc379('0x5a'),_0xc379('0x5b'),'internal',_0xc379('0x5c'),_0xc379('0x5d'),_0xc379('0x5e'),_0xc379('0x5f')],'order':qs['sort'](_0xc379('0x60')),'include':[{'model':db[_0xc379('0x61')],'as':_0xc379('0x62'),'attributes':['id',_0xc379('0x2c'),_0xc379('0x32')],'through':{'attributes':[]}}]})[_0xc379('0x29')](function(_0x1e0b21){if(_0x1e0b21){var _0x33b464=_0x5a60a9[_0xc379('0x63')][_0xc379('0x52')]({'plain':!![]});if(!_0x33b464)throw new Error(_0xc379('0x64'));if(_0x33b464[_0xc379('0x5a')]===_0xc379('0x63')){return db[_0xc379('0x65')][_0xc379('0x4c')]({'where':{'name':_0xc379('0x66'),'userProfileId':_0x33b464[_0xc379('0x67')]},'raw':!![]})[_0xc379('0x29')](function(_0x4c3bb1){if(_0x4c3bb1){if(_0x4c3bb1[_0xc379('0x68')]===0x0){return db[_0xc379('0x69')][_0xc379('0x48')]({'where':{'sectionId':_0x4c3bb1['id']},'raw':!![]})[_0xc379('0x29')](function(_0x57e832){var _0x301f01=[];if(_[_0xc379('0x6a')](_0x57e832)){_0x301f01=_['filter'](_0x1e0b21,function(_0x44b41f){if(_0x44b41f['role']!=='agent'){return _0x44b41f;}});return _0x301f01;}else{for(var _0x17bcc0=0x0;_0x17bcc0<_0x1e0b21[_0xc379('0x3a')];_0x17bcc0++){var _0x4a0963=_0x1e0b21[_0x17bcc0];if(_0x4a0963['role']==='agent'){var _0x5441fe=_[_0xc379('0x4c')](_0x57e832,function(_0x30c1ee){return _0x30c1ee[_0xc379('0x6b')]===_0x4a0963['id'];});if(_0x5441fe)_0x301f01[_0xc379('0x6c')](_0x4a0963);}else{_0x301f01[_0xc379('0x6c')](_0x4a0963);}}return _0x301f01;}});}else{return _0x1e0b21;}}else{var _0x2caa4c=_[_0xc379('0x40')](_0x1e0b21,function(_0x2e3f0e){if(_0x2e3f0e['role']!==_0xc379('0x6d')){return _0x2e3f0e;}});return _0x2caa4c;}});}else{return _0x1e0b21;}}})['then'](function(_0x4e0b0b){var _0x281892=[];if(_0x4e0b0b){_0x2f4ba2=_0x4e0b0b;for(var _0x5cbbe0=0x0;_0x5cbbe0<_0x4e0b0b[_0xc379('0x3a')];_0x5cbbe0+=0x1){_0x2f4ba2[_0x5cbbe0][_0xc379('0x6e')]=[];_0x281892[_0xc379('0x6c')](db[_0xc379('0x45')][_0xc379('0x4c')]({'where':{'FromId':[_0x5a60a9[_0xc379('0x63')]['id'],_0x4e0b0b[_0x5cbbe0]['id']],'ToId':[_0x5a60a9[_0xc379('0x63')]['id'],_0x4e0b0b[_0x5cbbe0]['id']],'ChatGroupId':null},'attributes':['id',_0xc379('0x53'),_0xc379('0x6f'),_0xc379('0x70'),_0xc379('0x71'),_0xc379('0x4f')],'order':qs[_0xc379('0x3d')](_0xc379('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc379('0x29')](wrapUser(_0x4e0b0b[_0x5cbbe0])));}return BPromise[_0xc379('0x73')](_0x281892);}return[];})[_0xc379('0x29')](function(_0x55c2ae){return{'rows':_0x55c2ae,'count':_0x55c2ae[_0xc379('0x3a')]};})[_0xc379('0x29')](respondWithResult(_0x58b307,null))['catch'](handleError(_0x58b307,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9ab3aab..ff1954c 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 _0x7381=['exports','events','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0x13a3cc,_0x136345){var _0x583000=function(_0x10eb7c){while(--_0x10eb7c){_0x13a3cc['push'](_0x13a3cc['shift']());}};_0x583000(++_0x136345);}(_0x7381,0x133));var _0x1738=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x7381[_0x29aefc];return _0x11be36;};'use strict';var EventEmitter=require(_0x1738('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1738('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58068d){return function(_0x5d44dd,_0x15e752,_0x3fdeb3){ChatInternalMessageEvents['emit'](_0x58068d+':'+_0x5d44dd['id'],_0x5d44dd);ChatInternalMessageEvents[_0x1738('0x2')](_0x58068d,_0x5d44dd);_0x3fdeb3(null);};}for(var e in events){if(events[_0x1738('0x3')](e)){var event=events[e];ChatInternalMessage[_0x1738('0x4')](e,emitEvent(event));}}module[_0x1738('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xbed6=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbed6,0x146));var _0x6bed=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xbed6[_0x45e98e];return _0x374dba;};'use strict';var EventEmitter=require(_0x6bed('0x0'));var ChatInternalMessage=require(_0x6bed('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6bed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bed('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21f2c3){return function(_0x2a79ec,_0x3bf377,_0x55e177){ChatInternalMessageEvents['emit'](_0x21f2c3+':'+_0x2a79ec['id'],_0x2a79ec);ChatInternalMessageEvents[_0x6bed('0x4')](_0x21f2c3,_0x2a79ec);_0x55e177(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x6bed('0x5')](e,emitEvent(event));}}module[_0x6bed('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index e19eea7..bc7365a 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 _0xf169=['define','ChatInternalMessage','util','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x20f52e,_0x596d5e){var _0x1489ca=function(_0x550038){while(--_0x550038){_0x20f52e['push'](_0x20f52e['shift']());}};_0x1489ca(++_0x596d5e);}(_0xf169,0x1c4));var _0x9f16=function(_0x451e00,_0x4c8dd3){_0x451e00=_0x451e00-0x0;var _0x4148e7=_0xf169[_0x451e00];return _0x4148e7;};'use strict';var _=require('lodash');var util=require(_0x9f16('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9f16('0x1'));var rp=require(_0x9f16('0x2'));var fs=require('fs');var path=require(_0x9f16('0x3'));var rimraf=require(_0x9f16('0x4'));var config=require(_0x9f16('0x5'));var attributes=require(_0x9f16('0x6'));module['exports']=function(_0x7c7b2e,_0x5cce95){return _0x7c7b2e[_0x9f16('0x7')](_0x9f16('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4d77=['bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x4d77,0x1e2));var _0x74d7=function(_0x5a7ea1,_0x192405){_0x5a7ea1=_0x5a7ea1-0x0;var _0x268960=_0x4d77[_0x5a7ea1];return _0x268960;};'use strict';var _=require('lodash');var util=require(_0x74d7('0x0'));var logger=require(_0x74d7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x74d7('0x2'));var rp=require(_0x74d7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74d7('0x4'));var config=require(_0x74d7('0x5'));var attributes=require(_0x74d7('0x6'));module['exports']=function(_0x2d0abf,_0x130378){return _0x2d0abf['define'](_0x74d7('0x7'),attributes,{'tableName':_0x74d7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74d7('0x9'),'collate':_0x74d7('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 0edc99b..a86b8c1 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 _0xea81=['rpc','../../config/environment','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x169585,_0x476cc6){var _0x5cf666=function(_0x4f7106){while(--_0x4f7106){_0x169585['push'](_0x169585['shift']());}};_0x5cf666(++_0x476cc6);}(_0xea81,0x1ed));var _0x1ea8=function(_0x89aca9,_0x2cf00a){_0x89aca9=_0x89aca9-0x0;var _0x17f368=_0xea81[_0x89aca9];return _0x17f368;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var moment=require(_0x1ea8('0x2'));var BPromise=require(_0x1ea8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ea8('0x4'))['db'];var utils=require(_0x1ea8('0x5'));var logger=require(_0x1ea8('0x6'))(_0x1ea8('0x7'));var config=require(_0x1ea8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1ea8('0x9')]=_[_0x1ea8('0xa')](config[_0x1ea8('0x9')],{'host':_0x1ea8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ea8('0x9')]));require(_0x1ea8('0xc'))[_0x1ea8('0xd')](socket);function respondWithRpcPromise(_0x432447,_0x495092,_0x5732b5){return new BPromise(function(_0x5be789,_0x5bd5dc){return client[_0x1ea8('0xe')](_0x432447,_0x5732b5)[_0x1ea8('0xf')](function(_0x5a327){logger[_0x1ea8('0x10')](_0x1ea8('0x11'),_0x495092,'request\x20sent');logger['debug'](_0x1ea8('0x12'),_0x495092,_0x1ea8('0x13'),JSON['stringify'](_0x5a327));if(_0x5a327[_0x1ea8('0x14')]){if(_0x5a327[_0x1ea8('0x14')][_0x1ea8('0x15')]===0x1f4){logger[_0x1ea8('0x14')](_0x1ea8('0x11'),_0x495092,_0x5a327['error'][_0x1ea8('0x16')]);return _0x5bd5dc(_0x5a327[_0x1ea8('0x14')][_0x1ea8('0x16')]);}logger['error'](_0x1ea8('0x11'),_0x495092,_0x5a327[_0x1ea8('0x14')]['message']);return _0x5be789(_0x5a327['error'][_0x1ea8('0x16')]);}else{logger['info'](_0x1ea8('0x11'),_0x495092,'request\x20sent');_0x5be789(_0x5a327[_0x1ea8('0x17')][_0x1ea8('0x16')]);}})[_0x1ea8('0x18')](function(_0xc24384){logger[_0x1ea8('0x14')](_0x1ea8('0x11'),_0x495092,_0xc24384);_0x5bd5dc(_0xc24384);});});} \ No newline at end of file +var _0x2c81=['stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4cc728,_0x2490b4){var _0xf1a344=function(_0x1a5b8b){while(--_0x1a5b8b){_0x4cc728['push'](_0x4cc728['shift']());}};_0xf1a344(++_0x2490b4);}(_0x2c81,0x1d1));var _0x12c8=function(_0x22b70b,_0xecd525){_0x22b70b=_0x22b70b-0x0;var _0x52e0f4=_0x2c81[_0x22b70b];return _0x52e0f4;};'use strict';var _=require(_0x12c8('0x0'));var util=require(_0x12c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12c8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12c8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12c8('0x4'))(_0x12c8('0x5'));var config=require(_0x12c8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x12c8('0x7')][_0x12c8('0x8')]({'port':0x232a});config[_0x12c8('0x9')]=_[_0x12c8('0xa')](config[_0x12c8('0x9')],{'host':_0x12c8('0xb'),'port':0x18eb});var socket=require(_0x12c8('0xc'))(new Redis(config[_0x12c8('0x9')]));require(_0x12c8('0xd'))[_0x12c8('0xe')](socket);function respondWithRpcPromise(_0x18cd80,_0x38ae59,_0x51f0b2){return new BPromise(function(_0x4b4292,_0x2b0f1d){return client[_0x12c8('0xf')](_0x18cd80,_0x51f0b2)[_0x12c8('0x10')](function(_0x51dd46){logger[_0x12c8('0x11')](_0x12c8('0x12'),_0x38ae59,_0x12c8('0x13'));logger[_0x12c8('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x38ae59,_0x12c8('0x13'),JSON[_0x12c8('0x15')](_0x51dd46));if(_0x51dd46[_0x12c8('0x16')]){if(_0x51dd46[_0x12c8('0x16')][_0x12c8('0x17')]===0x1f4){logger[_0x12c8('0x16')](_0x12c8('0x12'),_0x38ae59,_0x51dd46[_0x12c8('0x16')][_0x12c8('0x18')]);return _0x2b0f1d(_0x51dd46[_0x12c8('0x16')][_0x12c8('0x18')]);}logger[_0x12c8('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x38ae59,_0x51dd46['error'][_0x12c8('0x18')]);return _0x4b4292(_0x51dd46['error']['message']);}else{logger[_0x12c8('0x11')](_0x12c8('0x12'),_0x38ae59,_0x12c8('0x13'));_0x4b4292(_0x51dd46[_0x12c8('0x19')][_0x12c8('0x18')]);}})[_0x12c8('0x1a')](function(_0x5d5d12){logger[_0x12c8('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x38ae59,_0x5d5d12);_0x2b0f1d(_0x5d5d12);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ab3fde2..30f9f04 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 _0x64a7=['update','emit','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x64a7,0x18d));var _0x764a=function(_0x403554,_0x23456a){_0x403554=_0x403554-0x0;var _0x2061d0=_0x64a7[_0x403554];return _0x2061d0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x764a('0x0'),_0x764a('0x1'),_0x764a('0x2')];function createListener(_0x4664aa,_0x4b18d4){return function(_0x58bb49){_0x4b18d4[_0x764a('0x3')](_0x4664aa,_0x58bb49);};}function removeListener(_0x329a73,_0x58da5c){return function(){ChatInternalMessageEvents[_0x764a('0x4')](_0x329a73,_0x58da5c);};}exports[_0x764a('0x5')]=function(_0x457bb2){for(var _0x5ca27b=0x0,_0x1fb0f7=events['length'];_0x5ca27b<_0x1fb0f7;_0x5ca27b++){var _0x459983=events[_0x5ca27b];var _0x128ed9=createListener(_0x764a('0x6')+_0x459983,_0x457bb2);ChatInternalMessageEvents['on'](_0x459983,_0x128ed9);}}; \ No newline at end of file +var _0x7cee=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','register','length'];(function(_0x5f2637,_0x1eec28){var _0x4c1c9d=function(_0x5e3782){while(--_0x5e3782){_0x5f2637['push'](_0x5f2637['shift']());}};_0x4c1c9d(++_0x1eec28);}(_0x7cee,0xb7));var _0xe7ce=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7cee[_0x3e5086];return _0xfeb102;};'use strict';var ChatInternalMessageEvents=require(_0xe7ce('0x0'));var events=[_0xe7ce('0x1'),_0xe7ce('0x2'),_0xe7ce('0x3')];function createListener(_0x380e81,_0x30de05){return function(_0x27d220){_0x30de05['emit'](_0x380e81,_0x27d220);};}function removeListener(_0x4a3679,_0x1cdeab){return function(){ChatInternalMessageEvents['removeListener'](_0x4a3679,_0x1cdeab);};}exports[_0xe7ce('0x4')]=function(_0x56c506){for(var _0x4e037f=0x0,_0x56bc40=events[_0xe7ce('0x5')];_0x4e037f<_0x56bc40;_0x4e037f++){var _0x598bdf=events[_0x4e037f];var _0x546282=createListener(_0xe7ce('0x6')+_0x598bdf,_0x56c506);ChatInternalMessageEvents['on'](_0x598bdf,_0x546282);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a29af05..a8e538b 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 _0x07f0=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','post','put'];(function(_0x261f8d,_0x328248){var _0xd6e676=function(_0x45d8d7){while(--_0x45d8d7){_0x261f8d['push'](_0x261f8d['shift']());}};_0xd6e676(++_0x328248);}(_0x07f0,0x136));var _0x007f=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x07f0[_0x178856];return _0x3c7fe7;};'use strict';var multer=require(_0x007f('0x0'));var util=require(_0x007f('0x1'));var path=require(_0x007f('0x2'));var timeout=require(_0x007f('0x3'));var express=require(_0x007f('0x4'));var router=express[_0x007f('0x5')]();var fs_extra=require(_0x007f('0x6'));var auth=require(_0x007f('0x7'));var interaction=require(_0x007f('0x8'));var config=require('../../config/environment');var controller=require(_0x007f('0x9'));router[_0x007f('0xa')]('/',auth[_0x007f('0xb')](),controller[_0x007f('0xc')]);router['get'](_0x007f('0xd'),auth[_0x007f('0xb')](),controller[_0x007f('0xe')]);router[_0x007f('0xa')](_0x007f('0xf'),auth[_0x007f('0xb')](),controller[_0x007f('0x10')]);router['get'](_0x007f('0x11'),auth[_0x007f('0xb')](),controller['show']);router[_0x007f('0x12')]('/',auth[_0x007f('0xb')](),controller['create']);router[_0x007f('0x13')](_0x007f('0x11'),controller['update']);router[_0x007f('0x14')](_0x007f('0x11'),auth[_0x007f('0xb')](),controller[_0x007f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9fe9=['express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','put','update','delete','destroy','exports','path'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9fe9,0x1b7));var _0x99fe=function(_0x57ad3a,_0x5cead5){_0x57ad3a=_0x57ad3a-0x0;var _0x93aa5d=_0x9fe9[_0x57ad3a];return _0x93aa5d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99fe('0x0'));var timeout=require('connect-timeout');var express=require(_0x99fe('0x1'));var router=express[_0x99fe('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x99fe('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x99fe('0x4'));var controller=require(_0x99fe('0x5'));router[_0x99fe('0x6')]('/',auth[_0x99fe('0x7')](),controller[_0x99fe('0x8')]);router[_0x99fe('0x6')](_0x99fe('0x9'),auth['isAuthenticated'](),controller[_0x99fe('0xa')]);router[_0x99fe('0x6')]('/users',auth[_0x99fe('0x7')](),controller[_0x99fe('0xb')]);router[_0x99fe('0x6')](_0x99fe('0xc'),auth[_0x99fe('0x7')](),controller[_0x99fe('0xd')]);router[_0x99fe('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x99fe('0xf')]('/:id',controller[_0x99fe('0x10')]);router[_0x99fe('0x11')](_0x99fe('0xc'),auth[_0x99fe('0x7')](),controller[_0x99fe('0x12')]);module[_0x99fe('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 5e5d1ee..0e97d07 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 _0xe820=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xe820,0xd2));var _0x0e82=function(_0x55ceca,_0x3b899c){_0x55ceca=_0x55ceca-0x0;var _0x31fef3=_0xe820[_0x55ceca];return _0x31fef3;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'body':{'type':Sequelize[_0x0e82('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0e82('0x3')]('in',_0x0e82('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0e82('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0e82('0x1')]}}; \ No newline at end of file +var _0x7334=['out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x272b42,_0x1ccd6f){var _0xd7bc8b=function(_0x56c866){while(--_0x56c866){_0x272b42['push'](_0x272b42['shift']());}};_0xd7bc8b(++_0x1ccd6f);}(_0x7334,0x184));var _0x4733=function(_0xde8df8,_0x4813de){_0xde8df8=_0xde8df8-0x0;var _0x2a3ea1=_0x7334[_0xde8df8];return _0x2a3ea1;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'body':{'type':Sequelize[_0x4733('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x4733('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4733('0x4')),'defaultValue':_0x4733('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4733('0x5')]},'providerName':{'type':Sequelize[_0x4733('0x6')]},'providerResponse':{'type':Sequelize[_0x4733('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7724e6a..977939b 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 _0x0055=['apply','reject','save','destroy','send','index','map','ChatMessage','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','formData','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json'];(function(_0xe8e2ad,_0x4df5f5){var _0x15f391=function(_0x2eb6fd){while(--_0x2eb6fd){_0xe8e2ad['push'](_0xe8e2ad['shift']());}};_0x15f391(++_0x4df5f5);}(_0x0055,0x160));var _0x5005=function(_0x5eb3c1,_0x2d0bab){_0x5eb3c1=_0x5eb3c1-0x0;var _0xfafed=_0x0055[_0x5eb3c1];return _0xfafed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5005('0x0'));var jsonpatch=require(_0x5005('0x1'));var rp=require(_0x5005('0x2'));var moment=require(_0x5005('0x3'));var BPromise=require(_0x5005('0x4'));var Mustache=require(_0x5005('0x5'));var util=require(_0x5005('0x6'));var path=require(_0x5005('0x7'));var sox=require(_0x5005('0x8'));var csv=require('to-csv');var ejs=require(_0x5005('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5005('0xa'));var squel=require('squel');var crypto=require(_0x5005('0xb'));var jsforce=require(_0x5005('0xc'));var deskjs=require(_0x5005('0xd'));var toCsv=require(_0x5005('0xe'));var querystring=require(_0x5005('0xf'));var Papa=require(_0x5005('0x10'));var Redis=require(_0x5005('0x11'));var authService=require(_0x5005('0x12'));var qs=require(_0x5005('0x13'));var as=require(_0x5005('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5005('0x15'))(_0x5005('0x16'));var utils=require(_0x5005('0x17'));var config=require(_0x5005('0x18'));var licenseUtil=require(_0x5005('0x19'));var db=require(_0x5005('0x1a'))['db'];config['redis']=_[_0x5005('0x1b')](config[_0x5005('0x1c')],{'host':_0x5005('0x1d'),'port':0x18eb});var socket=require(_0x5005('0x1e'))(new Redis(config[_0x5005('0x1c')]));require('./chatMessage.socket')[_0x5005('0x1f')](socket);var jayson=require(_0x5005('0x20'));var client=jayson[_0x5005('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x5005('0x21')][_0x5005('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x525dd2,_0x62a768,_0x42c1ab,_0x16ca56){return new BPromise(function(_0x30643e,_0x72e846){var _0x38e382=_0x16ca56||client;return _0x38e382[_0x5005('0x23')](_0x525dd2,_0x42c1ab)[_0x5005('0x24')](function(_0x5857bb){logger[_0x5005('0x25')](_0x5005('0x26'),_0x62a768,_0x5005('0x27'));logger[_0x5005('0x28')](_0x5005('0x29'),_0x62a768,_0x5005('0x27'),JSON['stringify'](_0x5857bb));if(_0x5857bb[_0x5005('0x2a')]){if(_0x5857bb[_0x5005('0x2a')][_0x5005('0x2b')]===0x1f4){logger[_0x5005('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x62a768,_0x5857bb['error'][_0x5005('0x2c')]);return _0x72e846(_0x5857bb['error'][_0x5005('0x2c')]);}logger[_0x5005('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x62a768,_0x5857bb['error'][_0x5005('0x2c')]);return _0x30643e(_0x5857bb['error'][_0x5005('0x2c')]);}else{logger[_0x5005('0x25')](_0x5005('0x26'),_0x62a768,_0x5005('0x27'));_0x30643e(_0x5857bb[_0x5005('0x2d')][_0x5005('0x2c')]);}})[_0x5005('0x2e')](function(_0xca3fd0){logger['error']('ChatMessage,\x20%s,\x20%s',_0x62a768,_0xca3fd0);_0x72e846(_0xca3fd0);});});}function respondWithStatusCode(_0x42bbca,_0x67e10f){_0x67e10f=_0x67e10f||0xcc;return function(_0x2f6f79){if(_0x2f6f79){return _0x42bbca[_0x5005('0x2f')](_0x67e10f);}return _0x42bbca[_0x5005('0x30')](_0x67e10f)[_0x5005('0x31')]();};}function respondWithResult(_0x2815c9,_0x594067){_0x594067=_0x594067||0xc8;return function(_0x430a5c){if(_0x430a5c){return _0x2815c9['status'](_0x594067)['json'](_0x430a5c);}};}function respondWithFilteredResult(_0x1588c6,_0x28645f){return function(_0x3a39ed){if(_0x3a39ed){var _0x12aff7=typeof _0x28645f[_0x5005('0x32')]===_0x5005('0x33')&&typeof _0x28645f['limit']===_0x5005('0x33');var _0x251e91=_0x3a39ed[_0x5005('0x34')];var _0x121349=_0x12aff7?0x0:_0x28645f['offset'];var _0x3196c9=_0x12aff7?_0x3a39ed['count']:_0x28645f[_0x5005('0x32')]+_0x28645f[_0x5005('0x35')];var _0x172d1c;if(_0x3196c9>=_0x251e91){_0x3196c9=_0x251e91;_0x172d1c=0xc8;}else{_0x172d1c=0xce;}_0x1588c6[_0x5005('0x30')](_0x172d1c);return _0x1588c6[_0x5005('0x36')]('Content-Range',_0x121349+'-'+_0x3196c9+'/'+_0x251e91)[_0x5005('0x37')](_0x3a39ed);}return null;};}function patchUpdates(_0x1e96fd){return function(_0xdf3542){try{jsonpatch[_0x5005('0x38')](_0xdf3542,_0x1e96fd,!![]);}catch(_0x13ec3b){return BPromise[_0x5005('0x39')](_0x13ec3b);}return _0xdf3542[_0x5005('0x3a')]();};}function saveUpdates(_0x54e924,_0x3a6ba9){return function(_0x2f6f28){if(_0x2f6f28){return _0x2f6f28['update'](_0x54e924)[_0x5005('0x24')](function(_0x5cba00){return _0x5cba00;});}return null;};}function removeEntity(_0x221dcb,_0x3873ac){return function(_0x11abc8){if(_0x11abc8){return _0x11abc8[_0x5005('0x3b')]()[_0x5005('0x24')](function(){_0x221dcb[_0x5005('0x30')](0xcc)[_0x5005('0x31')]();});}};}function handleEntityNotFound(_0x4c2f81,_0x3f2ba2){return function(_0x375d28){if(!_0x375d28){_0x4c2f81[_0x5005('0x2f')](0x194);}return _0x375d28;};}function handleError(_0x2f84fc,_0x34d7a5){_0x34d7a5=_0x34d7a5||0x1f4;return function(_0x102e4b){logger['error'](_0x102e4b['stack']);if(_0x102e4b['name']){delete _0x102e4b['name'];}_0x2f84fc['status'](_0x34d7a5)[_0x5005('0x3c')](_0x102e4b);};}exports[_0x5005('0x3d')]=function(_0x1c12a0,_0x33328c){var _0x154214={},_0x3adf68={},_0x2deff7={'count':0x0,'rows':[]};var _0x280e6e=_[_0x5005('0x3e')](db[_0x5005('0x3f')]['rawAttributes'],function(_0x1fccc2){return{'name':_0x1fccc2['fieldName'],'type':_0x1fccc2[_0x5005('0x40')][_0x5005('0x41')]};});_0x3adf68[_0x5005('0x42')]=_[_0x5005('0x3e')](_0x280e6e,_0x5005('0x43'));_0x3adf68[_0x5005('0x44')]=_[_0x5005('0x45')](_0x1c12a0[_0x5005('0x44')]);_0x3adf68['filters']=_[_0x5005('0x46')](_0x3adf68[_0x5005('0x42')],_0x3adf68['query']);_0x154214[_0x5005('0x47')]=_['intersection'](_0x3adf68['model'],qs[_0x5005('0x48')](_0x1c12a0[_0x5005('0x44')]['fields']));_0x154214[_0x5005('0x47')]=_0x154214[_0x5005('0x47')]['length']?_0x154214[_0x5005('0x47')]:_0x3adf68['model'];if(!_0x1c12a0['query'][_0x5005('0x49')](_0x5005('0x4a'))){_0x154214[_0x5005('0x35')]=qs['limit'](_0x1c12a0[_0x5005('0x44')][_0x5005('0x35')]);_0x154214['offset']=qs['offset'](_0x1c12a0['query'][_0x5005('0x32')]);}_0x154214[_0x5005('0x4b')]=qs['sort'](_0x1c12a0[_0x5005('0x44')][_0x5005('0x4c')]);_0x154214['where']=qs[_0x5005('0x4d')](_[_0x5005('0x4e')](_0x1c12a0[_0x5005('0x44')],_0x3adf68[_0x5005('0x4d')]),_0x280e6e);if(_0x1c12a0[_0x5005('0x44')][_0x5005('0x4f')]){_0x154214[_0x5005('0x50')]=_[_0x5005('0x51')](_0x154214[_0x5005('0x50')],{'$or':_[_0x5005('0x3e')](_0x280e6e,function(_0x367e9c){if(_0x367e9c[_0x5005('0x40')]!==_0x5005('0x52')){var _0x4e199f={};_0x4e199f[_0x367e9c[_0x5005('0x43')]]={'$like':'%'+_0x1c12a0[_0x5005('0x44')]['filter']+'%'};return _0x4e199f;}})});}_0x154214=_[_0x5005('0x51')]({},_0x154214,_0x1c12a0['options']);var _0x51baca={'where':_0x154214[_0x5005('0x50')]};return db['ChatMessage'][_0x5005('0x34')](_0x51baca)[_0x5005('0x24')](function(_0x562fe7){_0x2deff7[_0x5005('0x34')]=_0x562fe7;if(_0x1c12a0[_0x5005('0x44')][_0x5005('0x53')]){_0x154214[_0x5005('0x54')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x154214);})['then'](function(_0x433a95){_0x2deff7[_0x5005('0x55')]=_0x433a95;return _0x2deff7;})[_0x5005('0x24')](respondWithFilteredResult(_0x33328c,_0x154214))[_0x5005('0x2e')](handleError(_0x33328c,null));};exports[_0x5005('0x56')]=function(_0x1c4c37,_0x1ecca0){var _0x13f265={'raw':!![],'where':{'id':_0x1c4c37[_0x5005('0x57')]['id']}},_0x502780={};_0x502780[_0x5005('0x42')]=_[_0x5005('0x45')](db['ChatMessage']['rawAttributes']);_0x502780[_0x5005('0x44')]=_[_0x5005('0x45')](_0x1c4c37[_0x5005('0x44')]);_0x502780[_0x5005('0x4d')]=_[_0x5005('0x46')](_0x502780[_0x5005('0x42')],_0x502780[_0x5005('0x44')]);_0x13f265['attributes']=_[_0x5005('0x46')](_0x502780[_0x5005('0x42')],qs[_0x5005('0x48')](_0x1c4c37[_0x5005('0x44')][_0x5005('0x48')]));_0x13f265['attributes']=_0x13f265['attributes'][_0x5005('0x58')]?_0x13f265['attributes']:_0x502780[_0x5005('0x42')];if(_0x1c4c37[_0x5005('0x44')][_0x5005('0x53')]){_0x13f265[_0x5005('0x54')]=[{'all':!![]}];}_0x13f265=_[_0x5005('0x51')]({},_0x13f265,_0x1c4c37[_0x5005('0x59')]);return db[_0x5005('0x3f')][_0x5005('0x5a')](_0x13f265)['then'](handleEntityNotFound(_0x1ecca0,null))[_0x5005('0x24')](respondWithResult(_0x1ecca0,null))[_0x5005('0x2e')](handleError(_0x1ecca0,null));};exports[_0x5005('0x5b')]=function(_0x15a4ac,_0x4feed6){return db[_0x5005('0x3f')][_0x5005('0x5b')](_0x15a4ac[_0x5005('0x5c')],{})['then'](respondWithResult(_0x4feed6,0xc9))[_0x5005('0x2e')](handleError(_0x4feed6,null));};exports[_0x5005('0x5d')]=function(_0x7d3187,_0x399064){if(_0x7d3187[_0x5005('0x5c')]['id']){delete _0x7d3187[_0x5005('0x5c')]['id'];}return db[_0x5005('0x3f')][_0x5005('0x5a')]({'where':{'id':_0x7d3187[_0x5005('0x57')]['id']}})['then'](handleEntityNotFound(_0x399064,null))[_0x5005('0x24')](saveUpdates(_0x7d3187[_0x5005('0x5c')],null))['then'](respondWithResult(_0x399064,null))[_0x5005('0x2e')](handleError(_0x399064,null));};exports[_0x5005('0x3b')]=function(_0x364839,_0x4bf112){return db[_0x5005('0x3f')][_0x5005('0x5a')]({'where':{'id':_0x364839[_0x5005('0x57')]['id']}})[_0x5005('0x24')](handleEntityNotFound(_0x4bf112,null))[_0x5005('0x24')](removeEntity(_0x4bf112,null))[_0x5005('0x2e')](handleError(_0x4bf112,null));};exports[_0x5005('0x5e')]=function(_0x2968e4,_0x4a9d55){return db[_0x5005('0x3f')]['describe']()[_0x5005('0x24')](respondWithResult(_0x4a9d55,null))[_0x5005('0x2e')](handleError(_0x4a9d55,null));};var interaction_log=require('../../config/logger')(_0x5005('0x5f'));exports[_0x5005('0x60')]=function(_0xa672b4,_0x19a2fc,_0x557858){var _0x14c54a={'agent':{},'channel':_0x5005('0x61')};if(_0xa672b4[_0x5005('0x5c')]['id']){delete _0xa672b4['body']['id'];}_0xa672b4[_0x5005('0x5c')][_0x5005('0x62')]=!![];_0xa672b4[_0x5005('0x5c')][_0x5005('0x63')]=moment()[_0x5005('0x64')](_0x5005('0x65'));_0xa672b4['body'][_0x5005('0x66')]=_0xa672b4[_0x5005('0x5c')][_0x5005('0x66')]||_0xa672b4[_0x5005('0x67')]['id'];_0x14c54a[_0x5005('0x68')]['id']=_0xa672b4[_0x5005('0x5c')]['UserId'];return db[_0x5005('0x3f')][_0x5005('0x5a')]({'where':{'id':_0xa672b4[_0x5005('0x57')]['id'],'UserId':null}})[_0x5005('0x24')](handleEntityNotFound(_0x19a2fc,null))['then'](saveUpdates(_0xa672b4[_0x5005('0x5c')],null))[_0x5005('0x24')](function(_0x2ebed4){if(_0x2ebed4){_0x14c54a['message']=_0x2ebed4[_0x5005('0x69')]({'plain':!![]});return db[_0x5005('0x6a')][_0x5005('0x5a')]({'where':{'id':_0x2ebed4['ChatInteractionId']}});}return null;})[_0x5005('0x24')](handleEntityNotFound(_0x19a2fc,null))[_0x5005('0x24')](function(_0x582b3a){if(_0x582b3a){return _0x582b3a[_0x5005('0x5d')]({'UserId':_0xa672b4['body'][_0x5005('0x66')],'read1stAt':_[_0x5005('0x6b')](_0x582b3a[_0x5005('0x6c')])?moment()[_0x5005('0x64')](_0x5005('0x65')):undefined});}return null;})[_0x5005('0x24')](function(_0x4bd4c6){if(_0x4bd4c6){_0x14c54a['interaction']=_0x4bd4c6[_0x5005('0x69')]({'plain':!![]});interaction_log['info'](_0x5005('0x6d'),_0xa672b4[_0x5005('0x67')]['id'],_0xa672b4[_0x5005('0x67')][_0x5005('0x43')],_0xa672b4[_0x5005('0x67')][_0x5005('0x6e')],_0x14c54a[_0x5005('0x6f')]['id'],_0xa672b4[_0x5005('0x5c')]?JSON[_0x5005('0x70')](_0xa672b4[_0x5005('0x5c')]):_0x5005('0x71'));return respondWithRpcPromise(_0x5005('0x72'),'acceptMessage',_0x14c54a);}return null;})[_0x5005('0x24')](function(_0x4298ce){var _0x1ab1aa=_0x5005('0x73')+_0x4298ce['message'][_0x5005('0x74')];return db['sequelize'][_0x5005('0x44')](_0x1ab1aa,{'type':db[_0x5005('0x75')][_0x5005('0x76')][_0x5005('0x77')],'raw':!![]})[_0x5005('0x24')](function(_0x3f0adf){return _0x3f0adf;});})[_0x5005('0x24')](function(_0x5719b7){if(_0x5719b7){_0x14c54a[_0x5005('0x2c')][_0x5005('0x78')]=_0x5719b7[0x0];if(!_0xa672b4[_0x5005('0x5c')]['UserId'])return;return db['User'][_0x5005('0x5a')]({'where':{'id':_0xa672b4[_0x5005('0x5c')][_0x5005('0x66')],'role':_0x5005('0x68')},'attributes':['id',_0x5005('0x43'),_0x5005('0x79'),_0x5005('0x7a'),_0x5005('0x7b')],'raw':!![]});}return null;})[_0x5005('0x24')](function(_0x1318a4){if(!_0x1318a4)return null;_0x14c54a[_0x5005('0x2c')][_0x5005('0x68')]=_0x1318a4;return _0x14c54a;})[_0x5005('0x24')](function(_0xb62182){if(_0xb62182){if(_0xa672b4['body'][_0x5005('0x7c')]){_0x14c54a[_0x5005('0x2c')][_0x5005('0x7d')]=util[_0x5005('0x64')](_0x5005('0x7e'),_0xa672b4[_0x5005('0x67')][_0x5005('0x43')]);_0x14c54a[_0x5005('0x2c')][_0x5005('0x7f')]=_0x14c54a['channel'];_0x14c54a[_0x5005('0x2c')][_0x5005('0x80')]=_0x14c54a['channel'];_0x14c54a['message']['event']=_0x5005('0x60');return respondWithRpcPromise(_0x5005('0x81'),_0x5005('0x81'),{'event':_0x5005('0x82'),'message':_[_0x5005('0x51')](_0x14c54a[_0x5005('0x2c')],JSON[_0x5005('0x83')](_0x14c54a[_0x5005('0x6f')]['formData']))},client9002)[_0x5005('0x24')](function(){return _0x14c54a;});}return _0x14c54a;}return null;})[_0x5005('0x24')](respondWithResult(_0x19a2fc,null))[_0x5005('0x2e')](handleError(_0x19a2fc,null));};var interaction_log=require(_0x5005('0x15'))('chat-interactions');exports[_0x5005('0x39')]=function(_0xd5f6c,_0x53fe4c,_0x46b305){var _0x3ba829={'agent':{},'channel':_0x5005('0x61')};if(_0xd5f6c['body']['id']){delete _0xd5f6c[_0x5005('0x5c')]['id'];}_0xd5f6c['body'][_0x5005('0x66')]=_0xd5f6c[_0x5005('0x5c')]['UserId']||_0xd5f6c[_0x5005('0x67')]['id'];_0x3ba829[_0x5005('0x68')]['id']=_0xd5f6c['body']['UserId'];return db['ChatMessage'][_0x5005('0x5a')]({'where':{'id':_0xd5f6c[_0x5005('0x57')]['id'],'UserId':null}})[_0x5005('0x24')](handleEntityNotFound(_0x53fe4c,null))['then'](function(_0x468014){if(_0x468014){_0x3ba829['message']=_0x468014['get']({'plain':!![]});return db[_0x5005('0x6a')][_0x5005('0x5a')]({'where':{'id':_0x468014['ChatInteractionId']}});}return null;})[_0x5005('0x24')](handleEntityNotFound(_0x53fe4c,null))[_0x5005('0x24')](function(_0x2475fb){if(_0x2475fb){_0x3ba829[_0x5005('0x6f')]=_0x2475fb['get']({'plain':!![]});interaction_log[_0x5005('0x25')](_0x5005('0x84'),_0xd5f6c[_0x5005('0x67')]['id'],_0xd5f6c[_0x5005('0x67')][_0x5005('0x43')],_0xd5f6c['user'][_0x5005('0x6e')],_0x3ba829[_0x5005('0x6f')]['id'],_0xd5f6c[_0x5005('0x5c')]?JSON['stringify'](_0xd5f6c[_0x5005('0x5c')]):_0x5005('0x71'));return respondWithRpcPromise(_0x5005('0x85'),_0x5005('0x86'),_0x3ba829);}return null;})[_0x5005('0x24')](function(_0xde8364){var _0x51e3da='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xde8364['message'][_0x5005('0x74')];return db['sequelize'][_0x5005('0x44')](_0x51e3da,{'type':db[_0x5005('0x75')][_0x5005('0x76')][_0x5005('0x77')],'raw':!![]})[_0x5005('0x24')](function(_0x31c5e0){return _0x31c5e0;});})[_0x5005('0x24')](function(_0x45886f){if(_0x45886f){_0x3ba829[_0x5005('0x2c')][_0x5005('0x78')]=_0x45886f[0x0];if(!_0xd5f6c[_0x5005('0x5c')][_0x5005('0x66')])return;return db['User'][_0x5005('0x5a')]({'where':{'id':_0xd5f6c['body'][_0x5005('0x66')],'role':'agent'},'attributes':['id','name',_0x5005('0x79'),'email',_0x5005('0x7b')],'raw':!![]});}return null;})[_0x5005('0x24')](function(_0x30b35b){if(!_0x30b35b)return null;_0x3ba829[_0x5005('0x2c')][_0x5005('0x68')]=_0x30b35b;return _0x3ba829;})[_0x5005('0x24')](function(_0x4a8a4d){if(_0x4a8a4d){_0x4a8a4d[_0x5005('0x2c')][_0x5005('0x7d')]=util['format'](_0x5005('0x7e'),_0xd5f6c[_0x5005('0x67')][_0x5005('0x43')]);_0x4a8a4d['message'][_0x5005('0x7f')]=_0x3ba829[_0x5005('0x7f')];_0x4a8a4d['message'][_0x5005('0x80')]=_0x3ba829[_0x5005('0x7f')];_0x4a8a4d['message']['event']=_0x5005('0x39');respondWithRpcPromise('EventManager',_0x5005('0x81'),{'event':'rejectmessage','message':_['merge'](_0x3ba829[_0x5005('0x2c')],JSON['parse'](_0x3ba829[_0x5005('0x6f')][_0x5005('0x87')]))},client9002);return _0x3ba829;}return null;})[_0x5005('0x24')](respondWithResult(_0x53fe4c,null))[_0x5005('0x2e')](handleError(_0x53fe4c,null));}; \ No newline at end of file +var _0x6545=['code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','send','index','fieldName','model','map','name','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','rows','catch','params','includeAll','find','create','body','describe','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','contact','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','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','redis','defaults','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6545,0xdf));var _0x5654=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6545[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5654('0x0'));var rimraf=require(_0x5654('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5654('0x2'));var rp=require('request-promise');var moment=require(_0x5654('0x3'));var BPromise=require(_0x5654('0x4'));var Mustache=require(_0x5654('0x5'));var util=require(_0x5654('0x6'));var path=require(_0x5654('0x7'));var sox=require(_0x5654('0x8'));var csv=require(_0x5654('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5654('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5654('0xb'));var deskjs=require(_0x5654('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5654('0xd'));var Papa=require(_0x5654('0xe'));var Redis=require(_0x5654('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5654('0x10'));var as=require(_0x5654('0x11'));var hardwareService=require(_0x5654('0x12'));var logger=require(_0x5654('0x13'))(_0x5654('0x14'));var utils=require(_0x5654('0x15'));var config=require(_0x5654('0x16'));var licenseUtil=require(_0x5654('0x17'));var db=require(_0x5654('0x18'))['db'];config[_0x5654('0x19')]=_[_0x5654('0x1a')](config[_0x5654('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5654('0x19')]));require(_0x5654('0x1b'))['register'](socket);var jayson=require(_0x5654('0x1c'));var client=jayson[_0x5654('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5654('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x386237,_0x41ad09,_0x5450b1,_0x5c0ee6){return new BPromise(function(_0x845d1,_0x57ed53){var _0x23ade9=_0x5c0ee6||client;return _0x23ade9[_0x5654('0x1f')](_0x386237,_0x5450b1)[_0x5654('0x20')](function(_0x24c14e){logger['info'](_0x5654('0x21'),_0x41ad09,_0x5654('0x22'));logger[_0x5654('0x23')](_0x5654('0x24'),_0x41ad09,'request\x20sent',JSON[_0x5654('0x25')](_0x24c14e));if(_0x24c14e[_0x5654('0x26')]){if(_0x24c14e[_0x5654('0x26')][_0x5654('0x27')]===0x1f4){logger[_0x5654('0x26')](_0x5654('0x21'),_0x41ad09,_0x24c14e[_0x5654('0x26')][_0x5654('0x28')]);return _0x57ed53(_0x24c14e[_0x5654('0x26')][_0x5654('0x28')]);}logger['error'](_0x5654('0x21'),_0x41ad09,_0x24c14e['error'][_0x5654('0x28')]);return _0x845d1(_0x24c14e['error']['message']);}else{logger[_0x5654('0x29')](_0x5654('0x21'),_0x41ad09,_0x5654('0x22'));_0x845d1(_0x24c14e[_0x5654('0x2a')][_0x5654('0x28')]);}})['catch'](function(_0x477e16){logger[_0x5654('0x26')](_0x5654('0x21'),_0x41ad09,_0x477e16);_0x57ed53(_0x477e16);});});}function respondWithStatusCode(_0x1c6b90,_0x15ce55){_0x15ce55=_0x15ce55||0xcc;return function(_0xf6a4e2){if(_0xf6a4e2){return _0x1c6b90[_0x5654('0x2b')](_0x15ce55);}return _0x1c6b90[_0x5654('0x2c')](_0x15ce55)[_0x5654('0x2d')]();};}function respondWithResult(_0x5e8e14,_0x58b6f3){_0x58b6f3=_0x58b6f3||0xc8;return function(_0x4ee68b){if(_0x4ee68b){return _0x5e8e14[_0x5654('0x2c')](_0x58b6f3)[_0x5654('0x2e')](_0x4ee68b);}};}function respondWithFilteredResult(_0x2e4c73,_0x467496){return function(_0x47b179){if(_0x47b179){var _0x150327=typeof _0x467496[_0x5654('0x2f')]===_0x5654('0x30')&&typeof _0x467496[_0x5654('0x31')]===_0x5654('0x30');var _0x368b45=_0x47b179[_0x5654('0x32')];var _0x4ae804=_0x150327?0x0:_0x467496[_0x5654('0x2f')];var _0x3f0560=_0x150327?_0x47b179[_0x5654('0x32')]:_0x467496[_0x5654('0x2f')]+_0x467496[_0x5654('0x31')];var _0x5e4c76;if(_0x3f0560>=_0x368b45){_0x3f0560=_0x368b45;_0x5e4c76=0xc8;}else{_0x5e4c76=0xce;}_0x2e4c73[_0x5654('0x2c')](_0x5e4c76);return _0x2e4c73[_0x5654('0x33')](_0x5654('0x34'),_0x4ae804+'-'+_0x3f0560+'/'+_0x368b45)[_0x5654('0x2e')](_0x47b179);}return null;};}function patchUpdates(_0x9bf0de){return function(_0x298670){try{jsonpatch[_0x5654('0x35')](_0x298670,_0x9bf0de,!![]);}catch(_0x2bdfcb){return BPromise[_0x5654('0x36')](_0x2bdfcb);}return _0x298670['save']();};}function saveUpdates(_0x2c5dc6,_0x3a0860){return function(_0x3c84f7){if(_0x3c84f7){return _0x3c84f7[_0x5654('0x37')](_0x2c5dc6)['then'](function(_0x20f70c){return _0x20f70c;});}return null;};}function removeEntity(_0xb912a1,_0x4c8a98){return function(_0x2557a4){if(_0x2557a4){return _0x2557a4[_0x5654('0x38')]()[_0x5654('0x20')](function(){_0xb912a1[_0x5654('0x2c')](0xcc)[_0x5654('0x2d')]();});}};}function handleEntityNotFound(_0x5083ff,_0x3df32d){return function(_0x5825bf){if(!_0x5825bf){_0x5083ff[_0x5654('0x2b')](0x194);}return _0x5825bf;};}function handleError(_0x5a4232,_0x2ba387){_0x2ba387=_0x2ba387||0x1f4;return function(_0x5198d9){logger['error'](_0x5198d9[_0x5654('0x39')]);if(_0x5198d9['name']){delete _0x5198d9['name'];}_0x5a4232[_0x5654('0x2c')](_0x2ba387)[_0x5654('0x3a')](_0x5198d9);};}exports[_0x5654('0x3b')]=function(_0x1db9b2,_0x443a58){var _0x3e2869={},_0x481333={},_0x3be03a={'count':0x0,'rows':[]};var _0xfe2968=_['map'](db['ChatMessage']['rawAttributes'],function(_0x4007e4){return{'name':_0x4007e4[_0x5654('0x3c')],'type':_0x4007e4['type']['key']};});_0x481333[_0x5654('0x3d')]=_[_0x5654('0x3e')](_0xfe2968,_0x5654('0x3f'));_0x481333['query']=_[_0x5654('0x40')](_0x1db9b2['query']);_0x481333['filters']=_[_0x5654('0x41')](_0x481333['model'],_0x481333[_0x5654('0x42')]);_0x3e2869['attributes']=_[_0x5654('0x41')](_0x481333[_0x5654('0x3d')],qs[_0x5654('0x43')](_0x1db9b2[_0x5654('0x42')][_0x5654('0x43')]));_0x3e2869[_0x5654('0x44')]=_0x3e2869[_0x5654('0x44')][_0x5654('0x45')]?_0x3e2869[_0x5654('0x44')]:_0x481333[_0x5654('0x3d')];if(!_0x1db9b2[_0x5654('0x42')][_0x5654('0x46')](_0x5654('0x47'))){_0x3e2869['limit']=qs[_0x5654('0x31')](_0x1db9b2['query'][_0x5654('0x31')]);_0x3e2869[_0x5654('0x2f')]=qs[_0x5654('0x2f')](_0x1db9b2[_0x5654('0x42')][_0x5654('0x2f')]);}_0x3e2869[_0x5654('0x48')]=qs['sort'](_0x1db9b2['query']['sort']);_0x3e2869[_0x5654('0x49')]=qs[_0x5654('0x4a')](_[_0x5654('0x4b')](_0x1db9b2['query'],_0x481333[_0x5654('0x4a')]),_0xfe2968);if(_0x1db9b2[_0x5654('0x42')][_0x5654('0x4c')]){_0x3e2869['where']=_[_0x5654('0x4d')](_0x3e2869[_0x5654('0x49')],{'$or':_[_0x5654('0x3e')](_0xfe2968,function(_0x289e3a){if(_0x289e3a[_0x5654('0x4e')]!==_0x5654('0x4f')){var _0x1bff18={};_0x1bff18[_0x289e3a['name']]={'$like':'%'+_0x1db9b2[_0x5654('0x42')][_0x5654('0x4c')]+'%'};return _0x1bff18;}})});}_0x3e2869=_[_0x5654('0x4d')]({},_0x3e2869,_0x1db9b2[_0x5654('0x50')]);var _0x560836={'where':_0x3e2869['where']};return db[_0x5654('0x51')]['count'](_0x560836)[_0x5654('0x20')](function(_0x371064){_0x3be03a[_0x5654('0x32')]=_0x371064;if(_0x1db9b2['query']['includeAll']){_0x3e2869[_0x5654('0x52')]=[{'all':!![]}];}return db[_0x5654('0x51')]['findAll'](_0x3e2869);})[_0x5654('0x20')](function(_0x285c41){_0x3be03a[_0x5654('0x53')]=_0x285c41;return _0x3be03a;})[_0x5654('0x20')](respondWithFilteredResult(_0x443a58,_0x3e2869))[_0x5654('0x54')](handleError(_0x443a58,null));};exports['show']=function(_0x2d1934,_0x274e9b){var _0x4f7103={'raw':!![],'where':{'id':_0x2d1934[_0x5654('0x55')]['id']}},_0x90706d={};_0x90706d['model']=_[_0x5654('0x40')](db['ChatMessage']['rawAttributes']);_0x90706d[_0x5654('0x42')]=_[_0x5654('0x40')](_0x2d1934[_0x5654('0x42')]);_0x90706d[_0x5654('0x4a')]=_[_0x5654('0x41')](_0x90706d[_0x5654('0x3d')],_0x90706d['query']);_0x4f7103[_0x5654('0x44')]=_[_0x5654('0x41')](_0x90706d[_0x5654('0x3d')],qs[_0x5654('0x43')](_0x2d1934[_0x5654('0x42')][_0x5654('0x43')]));_0x4f7103[_0x5654('0x44')]=_0x4f7103[_0x5654('0x44')]['length']?_0x4f7103[_0x5654('0x44')]:_0x90706d[_0x5654('0x3d')];if(_0x2d1934['query'][_0x5654('0x56')]){_0x4f7103[_0x5654('0x52')]=[{'all':!![]}];}_0x4f7103=_[_0x5654('0x4d')]({},_0x4f7103,_0x2d1934[_0x5654('0x50')]);return db[_0x5654('0x51')][_0x5654('0x57')](_0x4f7103)[_0x5654('0x20')](handleEntityNotFound(_0x274e9b,null))[_0x5654('0x20')](respondWithResult(_0x274e9b,null))['catch'](handleError(_0x274e9b,null));};exports[_0x5654('0x58')]=function(_0xc3707a,_0x19bf88){return db[_0x5654('0x51')][_0x5654('0x58')](_0xc3707a[_0x5654('0x59')],{})[_0x5654('0x20')](respondWithResult(_0x19bf88,0xc9))['catch'](handleError(_0x19bf88,null));};exports['update']=function(_0x3d5b37,_0x23d275){if(_0x3d5b37[_0x5654('0x59')]['id']){delete _0x3d5b37[_0x5654('0x59')]['id'];}return db[_0x5654('0x51')]['find']({'where':{'id':_0x3d5b37[_0x5654('0x55')]['id']}})[_0x5654('0x20')](handleEntityNotFound(_0x23d275,null))[_0x5654('0x20')](saveUpdates(_0x3d5b37['body'],null))[_0x5654('0x20')](respondWithResult(_0x23d275,null))[_0x5654('0x54')](handleError(_0x23d275,null));};exports['destroy']=function(_0x1aaf8c,_0xc3a28e){return db[_0x5654('0x51')][_0x5654('0x57')]({'where':{'id':_0x1aaf8c[_0x5654('0x55')]['id']}})['then'](handleEntityNotFound(_0xc3a28e,null))[_0x5654('0x20')](removeEntity(_0xc3a28e,null))[_0x5654('0x54')](handleError(_0xc3a28e,null));};exports[_0x5654('0x5a')]=function(_0x7a211e,_0xb98b31){return db[_0x5654('0x51')][_0x5654('0x5a')]()[_0x5654('0x20')](respondWithResult(_0xb98b31,null))[_0x5654('0x54')](handleError(_0xb98b31,null));};var interaction_log=require('../../config/logger')(_0x5654('0x5b'));exports[_0x5654('0x5c')]=function(_0x294c7f,_0x32c88b,_0x1caf4d){var _0x372360={'agent':{},'channel':'chat'};if(_0x294c7f[_0x5654('0x59')]['id']){delete _0x294c7f['body']['id'];}_0x294c7f[_0x5654('0x59')][_0x5654('0x5d')]=!![];_0x294c7f['body']['readAt']=moment()[_0x5654('0x5e')](_0x5654('0x5f'));_0x294c7f[_0x5654('0x59')][_0x5654('0x60')]=_0x294c7f[_0x5654('0x59')][_0x5654('0x60')]||_0x294c7f[_0x5654('0x61')]['id'];_0x372360[_0x5654('0x62')]['id']=_0x294c7f[_0x5654('0x59')]['UserId'];return db[_0x5654('0x51')][_0x5654('0x57')]({'where':{'id':_0x294c7f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32c88b,null))[_0x5654('0x20')](saveUpdates(_0x294c7f[_0x5654('0x59')],null))['then'](function(_0x1a3ffe){if(_0x1a3ffe){_0x372360[_0x5654('0x28')]=_0x1a3ffe[_0x5654('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x5654('0x57')]({'where':{'id':_0x1a3ffe['ChatInteractionId']}});}return null;})[_0x5654('0x20')](handleEntityNotFound(_0x32c88b,null))[_0x5654('0x20')](function(_0x5d6e2f){if(_0x5d6e2f){return _0x5d6e2f[_0x5654('0x37')]({'UserId':_0x294c7f['body'][_0x5654('0x60')],'read1stAt':_[_0x5654('0x64')](_0x5d6e2f[_0x5654('0x65')])?moment()[_0x5654('0x5e')](_0x5654('0x5f')):undefined});}return null;})[_0x5654('0x20')](function(_0xe4741a){if(_0xe4741a){_0x372360[_0x5654('0x66')]=_0xe4741a[_0x5654('0x63')]({'plain':!![]});interaction_log[_0x5654('0x29')](_0x5654('0x67'),_0x294c7f[_0x5654('0x61')]['id'],_0x294c7f['user'][_0x5654('0x3f')],_0x294c7f[_0x5654('0x61')][_0x5654('0x68')],_0x372360['interaction']['id'],_0x294c7f[_0x5654('0x59')]?JSON[_0x5654('0x25')](_0x294c7f[_0x5654('0x59')]):_0x5654('0x69'));return respondWithRpcPromise(_0x5654('0x6a'),'acceptMessage',_0x372360);}return null;})['then'](function(_0x5d40ed){var _0x1916f1=_0x5654('0x6b')+_0x5d40ed[_0x5654('0x28')]['ContactId'];return db[_0x5654('0x6c')][_0x5654('0x42')](_0x1916f1,{'type':db[_0x5654('0x6d')][_0x5654('0x6e')]['SELECT'],'raw':!![]})[_0x5654('0x20')](function(_0x20638e){return _0x20638e;});})[_0x5654('0x20')](function(_0x869d49){if(_0x869d49){_0x372360[_0x5654('0x28')]['contact']=_0x869d49[0x0];if(!_0x294c7f[_0x5654('0x59')]['UserId'])return;return db[_0x5654('0x6f')][_0x5654('0x57')]({'where':{'id':_0x294c7f[_0x5654('0x59')]['UserId'],'role':_0x5654('0x62')},'attributes':['id',_0x5654('0x3f'),_0x5654('0x70'),_0x5654('0x71'),_0x5654('0x72')],'raw':!![]});}return null;})[_0x5654('0x20')](function(_0x159269){if(!_0x159269)return null;_0x372360[_0x5654('0x28')][_0x5654('0x62')]=_0x159269;return _0x372360;})[_0x5654('0x20')](function(_0x1afa1c){if(_0x1afa1c){if(_0x294c7f[_0x5654('0x59')][_0x5654('0x73')]){_0x372360['message']['interface']=util[_0x5654('0x5e')](_0x5654('0x74'),_0x294c7f['user']['name']);_0x372360['message'][_0x5654('0x75')]=_0x372360[_0x5654('0x75')];_0x372360['message'][_0x5654('0x76')]=_0x372360[_0x5654('0x75')];_0x372360[_0x5654('0x28')][_0x5654('0x77')]=_0x5654('0x5c');return respondWithRpcPromise('EventManager',_0x5654('0x78'),{'event':'acceptmessage','message':_[_0x5654('0x4d')](_0x372360[_0x5654('0x28')],JSON[_0x5654('0x79')](_0x372360[_0x5654('0x66')][_0x5654('0x7a')]))},client9002)[_0x5654('0x20')](function(){return _0x372360;});}return _0x372360;}return null;})[_0x5654('0x20')](respondWithResult(_0x32c88b,null))['catch'](handleError(_0x32c88b,null));};var interaction_log=require(_0x5654('0x13'))(_0x5654('0x5b'));exports[_0x5654('0x36')]=function(_0x46f727,_0x4a585f,_0x20306b){var _0x43387c={'agent':{},'channel':'chat'};if(_0x46f727[_0x5654('0x59')]['id']){delete _0x46f727[_0x5654('0x59')]['id'];}_0x46f727[_0x5654('0x59')][_0x5654('0x60')]=_0x46f727[_0x5654('0x59')][_0x5654('0x60')]||_0x46f727[_0x5654('0x61')]['id'];_0x43387c[_0x5654('0x62')]['id']=_0x46f727[_0x5654('0x59')][_0x5654('0x60')];return db[_0x5654('0x51')][_0x5654('0x57')]({'where':{'id':_0x46f727[_0x5654('0x55')]['id'],'UserId':null}})[_0x5654('0x20')](handleEntityNotFound(_0x4a585f,null))[_0x5654('0x20')](function(_0x17ccfe){if(_0x17ccfe){_0x43387c[_0x5654('0x28')]=_0x17ccfe[_0x5654('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x5654('0x57')]({'where':{'id':_0x17ccfe[_0x5654('0x7b')]}});}return null;})[_0x5654('0x20')](handleEntityNotFound(_0x4a585f,null))[_0x5654('0x20')](function(_0x2f3c8b){if(_0x2f3c8b){_0x43387c[_0x5654('0x66')]=_0x2f3c8b['get']({'plain':!![]});interaction_log[_0x5654('0x29')](_0x5654('0x7c'),_0x46f727['user']['id'],_0x46f727[_0x5654('0x61')]['name'],_0x46f727[_0x5654('0x61')][_0x5654('0x68')],_0x43387c[_0x5654('0x66')]['id'],_0x46f727[_0x5654('0x59')]?JSON[_0x5654('0x25')](_0x46f727[_0x5654('0x59')]):'null');return respondWithRpcPromise(_0x5654('0x7d'),_0x5654('0x7e'),_0x43387c);}return null;})[_0x5654('0x20')](function(_0x3d87de){var _0x494263=_0x5654('0x6b')+_0x3d87de['message'][_0x5654('0x7f')];return db[_0x5654('0x6c')][_0x5654('0x42')](_0x494263,{'type':db[_0x5654('0x6d')][_0x5654('0x6e')][_0x5654('0x80')],'raw':!![]})[_0x5654('0x20')](function(_0x17f77b){return _0x17f77b;});})[_0x5654('0x20')](function(_0x2282aa){if(_0x2282aa){_0x43387c[_0x5654('0x28')][_0x5654('0x81')]=_0x2282aa[0x0];if(!_0x46f727['body'][_0x5654('0x60')])return;return db[_0x5654('0x6f')][_0x5654('0x57')]({'where':{'id':_0x46f727[_0x5654('0x59')][_0x5654('0x60')],'role':'agent'},'attributes':['id',_0x5654('0x3f'),_0x5654('0x70'),_0x5654('0x71'),_0x5654('0x72')],'raw':!![]});}return null;})[_0x5654('0x20')](function(_0x42dfbc){if(!_0x42dfbc)return null;_0x43387c[_0x5654('0x28')][_0x5654('0x62')]=_0x42dfbc;return _0x43387c;})[_0x5654('0x20')](function(_0x1b68c6){if(_0x1b68c6){_0x1b68c6[_0x5654('0x28')]['interface']=util[_0x5654('0x5e')](_0x5654('0x74'),_0x46f727['user']['name']);_0x1b68c6[_0x5654('0x28')][_0x5654('0x75')]=_0x43387c[_0x5654('0x75')];_0x1b68c6[_0x5654('0x28')][_0x5654('0x76')]=_0x43387c['channel'];_0x1b68c6[_0x5654('0x28')][_0x5654('0x77')]=_0x5654('0x36');respondWithRpcPromise(_0x5654('0x78'),'EventManager',{'event':_0x5654('0x82'),'message':_[_0x5654('0x4d')](_0x43387c[_0x5654('0x28')],JSON[_0x5654('0x79')](_0x43387c[_0x5654('0x66')][_0x5654('0x7a')]))},client9002);return _0x43387c;}return null;})[_0x5654('0x20')](respondWithResult(_0x4a585f,null))['catch'](handleError(_0x4a585f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 61559f9..d1f0e0f 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 _0x9efa=['remove','emit','events','../../mysqldb','setMaxListeners','save'];(function(_0x30c6ec,_0x388d9b){var _0x43c1b1=function(_0x29ea88){while(--_0x29ea88){_0x30c6ec['push'](_0x30c6ec['shift']());}};_0x43c1b1(++_0x388d9b);}(_0x9efa,0x1d0));var _0xa9ef=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9efa[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0xa9ef('0x0'));var ChatMessage=require(_0xa9ef('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa9ef('0x2')](0x0);var events={'afterCreate':_0xa9ef('0x3'),'afterUpdate':'update','afterDestroy':_0xa9ef('0x4')};function emitEvent(_0x3fe1cb){return function(_0x76003,_0x5b02b4,_0x22e759){ChatMessageEvents[_0xa9ef('0x5')](_0x3fe1cb+':'+_0x76003['id'],_0x76003);ChatMessageEvents[_0xa9ef('0x5')](_0x3fe1cb,_0x76003);_0x22e759(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x811f=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','hook','exports'];(function(_0x462e27,_0x40cd8f){var _0x114f0f=function(_0x21cb0d){while(--_0x21cb0d){_0x462e27['push'](_0x462e27['shift']());}};_0x114f0f(++_0x40cd8f);}(_0x811f,0x128));var _0xf811=function(_0x3af770,_0x1a957a){_0x3af770=_0x3af770-0x0;var _0x42c9a9=_0x811f[_0x3af770];return _0x42c9a9;};'use strict';var EventEmitter=require(_0xf811('0x0'));var ChatMessage=require(_0xf811('0x1'))['db'][_0xf811('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf811('0x3')](0x0);var events={'afterCreate':_0xf811('0x4'),'afterUpdate':'update','afterDestroy':_0xf811('0x5')};function emitEvent(_0x467acd){return function(_0x1b3001,_0x37c2c5,_0x4f2c9d){ChatMessageEvents['emit'](_0x467acd+':'+_0x1b3001['id'],_0x1b3001);ChatMessageEvents['emit'](_0x467acd,_0x1b3001);_0x4f2c9d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf811('0x6')](e,emitEvent(event));}}module[_0xf811('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f5a0577..392a403 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 _0x1070=['define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','direction','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes'];(function(_0x746018,_0x307bbb){var _0x20f3b2=function(_0x41eccf){while(--_0x41eccf){_0x746018['push'](_0x746018['shift']());}};_0x20f3b2(++_0x307bbb);}(_0x1070,0x1c2));var _0x0107=function(_0x39e5db,_0x4038f2){_0x39e5db=_0x39e5db-0x0;var _0x39fb47=_0x1070[_0x39e5db];return _0x39fb47;};'use strict';var _=require(_0x0107('0x0'));var util=require(_0x0107('0x1'));var logger=require(_0x0107('0x2'))(_0x0107('0x3'));var moment=require(_0x0107('0x4'));var BPromise=require(_0x0107('0x5'));var rp=require(_0x0107('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0107('0x7'));var attributes=require(_0x0107('0x8'));module['exports']=function(_0x5772da,_0x234730){return _0x5772da[_0x0107('0x9')](_0x0107('0xa'),attributes,{'tableName':_0x0107('0xb'),'paranoid':![],'indexes':[{'name':_0x0107('0xc'),'fields':[_0x0107('0xd')],'type':_0x0107('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xca8e24,_0x58147a,_0x4c15d6){var _0x3304ea=_0x5772da['models'];var _0x45629e=_0xca8e24[_0x0107('0xf')]({'plain':!![]});if(_0x45629e['direction']['toLowerCase']()==='in'||_0x45629e['direction'][_0x0107('0x10')]()==='out'&&!_0x45629e['secret']&&!_[_0x0107('0x11')](_0x45629e[_0x0107('0x12')])){_0x3304ea[_0x0107('0x13')][_0x0107('0x14')]({'where':{'id':_0x45629e['ChatInteractionId']}})[_0x0107('0x15')](function(_0x40322a){if(_0x40322a){_0x40322a[_0x0107('0x16')]({'lastMsgAt':_0x45629e[_0x0107('0x17')],'lastMsgDirection':_0x45629e[_0x0107('0x18')][_0x0107('0x10')]()});}})[_0x0107('0x19')](function(_0x3b4917){console[_0x0107('0x1a')](_0x3b4917);});}_0x4c15d6();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc43d=['fti_chat_messages','body','models','toLowerCase','direction','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x55602b,_0x139343){var _0x141f56=function(_0x31387f){while(--_0x31387f){_0x55602b['push'](_0x55602b['shift']());}};_0x141f56(++_0x139343);}(_0xc43d,0xb2));var _0xdc43=function(_0x490e0a,_0x1eca50){_0x490e0a=_0x490e0a-0x0;var _0x212ff2=_0xc43d[_0x490e0a];return _0x212ff2;};'use strict';var _=require(_0xdc43('0x0'));var util=require(_0xdc43('0x1'));var logger=require(_0xdc43('0x2'))('api');var moment=require(_0xdc43('0x3'));var BPromise=require(_0xdc43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc43('0x5'));var rimraf=require(_0xdc43('0x6'));var config=require(_0xdc43('0x7'));var attributes=require(_0xdc43('0x8'));module['exports']=function(_0x21c2d1,_0x100617){return _0x21c2d1[_0xdc43('0x9')](_0xdc43('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xdc43('0xb'),'fields':[_0xdc43('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d11b7,_0x1620a6,_0xd52f4c){var _0x2a7f43=_0x21c2d1[_0xdc43('0xd')];var _0x1cbbf5=_0x4d11b7['get']({'plain':!![]});if(_0x1cbbf5['direction'][_0xdc43('0xe')]()==='in'||_0x1cbbf5[_0xdc43('0xf')][_0xdc43('0xe')]()==='out'&&!_0x1cbbf5[_0xdc43('0x10')]&&!_[_0xdc43('0x11')](_0x1cbbf5['UserId'])){_0x2a7f43[_0xdc43('0x12')][_0xdc43('0x13')]({'where':{'id':_0x1cbbf5[_0xdc43('0x14')]}})[_0xdc43('0x15')](function(_0xf44528){if(_0xf44528){_0xf44528[_0xdc43('0x16')]({'lastMsgAt':_0x1cbbf5[_0xdc43('0x17')],'lastMsgDirection':_0x1cbbf5['direction']['toLowerCase']()});}})[_0xdc43('0x18')](function(_0x4a9ab3){console[_0xdc43('0x19')](_0x4a9ab3);});}_0xd52f4c();}},'charset':'utf8mb4','collate':_0xdc43('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index d8c52b6..751b47f 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 _0x2865=['body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage'];(function(_0x52d32c,_0x18be15){var _0x4aec2b=function(_0x6e8870){while(--_0x6e8870){_0x52d32c['push'](_0x52d32c['shift']());}};_0x4aec2b(++_0x18be15);}(_0x2865,0x1b0));var _0x5286=function(_0xda4ace,_0x125cd8){_0xda4ace=_0xda4ace-0x0;var _0x5cac51=_0x2865[_0xda4ace];return _0x5cac51;};'use strict';var _=require('lodash');var util=require(_0x5286('0x0'));var moment=require(_0x5286('0x1'));var BPromise=require(_0x5286('0x2'));var rs=require(_0x5286('0x3'));var fs=require('fs');var Redis=require(_0x5286('0x4'));var db=require(_0x5286('0x5'))['db'];var utils=require(_0x5286('0x6'));var logger=require(_0x5286('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5286('0x8'));var client=jayson[_0x5286('0x9')][_0x5286('0xa')]({'port':0x232a});config[_0x5286('0xb')]=_['defaults'](config[_0x5286('0xb')],{'host':_0x5286('0xc'),'port':0x18eb});var socket=require(_0x5286('0xd'))(new Redis(config[_0x5286('0xb')]));require(_0x5286('0xe'))[_0x5286('0xf')](socket);function respondWithRpcPromise(_0x56db61,_0x1768e7,_0x17a40b){return new BPromise(function(_0x4307b2,_0x4b85e3){return client[_0x5286('0x10')](_0x56db61,_0x17a40b)[_0x5286('0x11')](function(_0x507059){logger[_0x5286('0x12')](_0x5286('0x13'),_0x1768e7,_0x5286('0x14'));logger[_0x5286('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1768e7,_0x5286('0x14'),JSON[_0x5286('0x16')](_0x507059));if(_0x507059[_0x5286('0x17')]){if(_0x507059[_0x5286('0x17')][_0x5286('0x18')]===0x1f4){logger[_0x5286('0x17')](_0x5286('0x13'),_0x1768e7,_0x507059['error'][_0x5286('0x19')]);return _0x4b85e3(_0x507059[_0x5286('0x17')][_0x5286('0x19')]);}logger[_0x5286('0x17')]('ChatMessage,\x20%s,\x20%s',_0x1768e7,_0x507059['error'][_0x5286('0x19')]);return _0x4307b2(_0x507059[_0x5286('0x17')][_0x5286('0x19')]);}else{logger[_0x5286('0x12')](_0x5286('0x13'),_0x1768e7,_0x5286('0x14'));_0x4307b2(_0x507059[_0x5286('0x1a')][_0x5286('0x19')]);}})[_0x5286('0x1b')](function(_0x350988){logger[_0x5286('0x17')](_0x5286('0x13'),_0x1768e7,_0x350988);_0x4b85e3(_0x350988);});});}exports[_0x5286('0x1c')]=function(_0x564930){var _0x34be80=this;return new Promise(function(_0x47e115,_0x3a1329){return db[_0x5286('0x1d')]['create'](_0x564930[_0x5286('0x1e')],{'raw':_0x564930[_0x5286('0x1f')]?_0x564930[_0x5286('0x1f')][_0x5286('0x20')]===undefined?!![]:![]:!![]})[_0x5286('0x11')](function(_0x1ae21b){logger[_0x5286('0x12')]('CreateChatMessage',_0x564930);logger[_0x5286('0x15')](_0x5286('0x1c'),_0x564930,JSON[_0x5286('0x16')](_0x1ae21b));_0x47e115(_0x1ae21b);})[_0x5286('0x1b')](function(_0x533582){logger[_0x5286('0x17')](_0x5286('0x1c'),_0x533582[_0x5286('0x19')],_0x564930);_0x3a1329(_0x34be80[_0x5286('0x17')](0x1f4,_0x533582[_0x5286('0x19')]));});});}; \ No newline at end of file +var _0x7799=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatMessage','options','raw','CreateChatMessage','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1329c8,_0x28bdf9){var _0x4c1d82=function(_0x59b1ff){while(--_0x59b1ff){_0x1329c8['push'](_0x1329c8['shift']());}};_0x4c1d82(++_0x28bdf9);}(_0x7799,0x12f));var _0x9779=function(_0x581c23,_0x485718){_0x581c23=_0x581c23-0x0;var _0x2dea41=_0x7799[_0x581c23];return _0x2dea41;};'use strict';var _=require(_0x9779('0x0'));var util=require('util');var moment=require(_0x9779('0x1'));var BPromise=require(_0x9779('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9779('0x3'));var db=require(_0x9779('0x4'))['db'];var utils=require(_0x9779('0x5'));var logger=require(_0x9779('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9779('0x7'));var client=jayson[_0x9779('0x8')][_0x9779('0x9')]({'port':0x232a});config['redis']=_[_0x9779('0xa')](config[_0x9779('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9779('0xc'))(new Redis(config['redis']));require(_0x9779('0xd'))[_0x9779('0xe')](socket);function respondWithRpcPromise(_0x3e98a5,_0x11877d,_0xc890de){return new BPromise(function(_0x2ee191,_0x924dd){return client[_0x9779('0xf')](_0x3e98a5,_0xc890de)[_0x9779('0x10')](function(_0x43db6b){logger[_0x9779('0x11')](_0x9779('0x12'),_0x11877d,_0x9779('0x13'));logger['debug'](_0x9779('0x14'),_0x11877d,'request\x20sent',JSON[_0x9779('0x15')](_0x43db6b));if(_0x43db6b['error']){if(_0x43db6b[_0x9779('0x16')][_0x9779('0x17')]===0x1f4){logger['error'](_0x9779('0x12'),_0x11877d,_0x43db6b[_0x9779('0x16')]['message']);return _0x924dd(_0x43db6b[_0x9779('0x16')][_0x9779('0x18')]);}logger[_0x9779('0x16')](_0x9779('0x12'),_0x11877d,_0x43db6b[_0x9779('0x16')][_0x9779('0x18')]);return _0x2ee191(_0x43db6b['error'][_0x9779('0x18')]);}else{logger[_0x9779('0x11')](_0x9779('0x12'),_0x11877d,_0x9779('0x13'));_0x2ee191(_0x43db6b['result'][_0x9779('0x18')]);}})[_0x9779('0x19')](function(_0x3f10a4){logger[_0x9779('0x16')](_0x9779('0x12'),_0x11877d,_0x3f10a4);_0x924dd(_0x3f10a4);});});}exports['CreateChatMessage']=function(_0xaa64b2){var _0x245c10=this;return new Promise(function(_0x19bfc7,_0x3a9ab6){return db[_0x9779('0x1a')]['create'](_0xaa64b2['body'],{'raw':_0xaa64b2[_0x9779('0x1b')]?_0xaa64b2[_0x9779('0x1b')][_0x9779('0x1c')]===undefined?!![]:![]:!![]})[_0x9779('0x10')](function(_0x1a99bc){logger[_0x9779('0x11')](_0x9779('0x1d'),_0xaa64b2);logger[_0x9779('0x1e')](_0x9779('0x1d'),_0xaa64b2,JSON['stringify'](_0x1a99bc));_0x19bfc7(_0x1a99bc);})[_0x9779('0x19')](function(_0xc362ec){logger[_0x9779('0x16')](_0x9779('0x1d'),_0xc362ec['message'],_0xaa64b2);_0x3a9ab6(_0x245c10[_0x9779('0x16')](0x1f4,_0xc362ec[_0x9779('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 635bc94..6618e76 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 _0x6bac=['./chatMessage.events','remove','update','removeListener','length'];(function(_0x229b05,_0x58c5a9){var _0x2ea740=function(_0x463061){while(--_0x463061){_0x229b05['push'](_0x229b05['shift']());}};_0x2ea740(++_0x58c5a9);}(_0x6bac,0xa5));var _0xc6ba=function(_0x79e805,_0x17a8ed){_0x79e805=_0x79e805-0x0;var _0x4da84d=_0x6bac[_0x79e805];return _0x4da84d;};'use strict';var ChatMessageEvents=require(_0xc6ba('0x0'));var events=['save',_0xc6ba('0x1'),_0xc6ba('0x2')];function createListener(_0xf479c,_0x1869a3){return function(_0x489037){_0x1869a3['emit'](_0xf479c,_0x489037);};}function removeListener(_0x487ef1,_0x378f3d){return function(){ChatMessageEvents[_0xc6ba('0x3')](_0x487ef1,_0x378f3d);};}exports['register']=function(_0x222f20){for(var _0x2a16af=0x0,_0x33167e=events[_0xc6ba('0x4')];_0x2a16af<_0x33167e;_0x2a16af++){var _0x12d6e9=events[_0x2a16af];var _0x1fa2a8=createListener('chatMessage:'+_0x12d6e9,_0x222f20);ChatMessageEvents['on'](_0x12d6e9,_0x1fa2a8);}}; \ No newline at end of file +var _0x0a52=['removeListener','register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x1b7031,_0xdde94e){var _0x2f29eb=function(_0x2f9458){while(--_0x2f9458){_0x1b7031['push'](_0x1b7031['shift']());}};_0x2f29eb(++_0xdde94e);}(_0x0a52,0xe4));var _0x20a5=function(_0x249b38,_0xda9889){_0x249b38=_0x249b38-0x0;var _0x1076f8=_0x0a52[_0x249b38];return _0x1076f8;};'use strict';var ChatMessageEvents=require(_0x20a5('0x0'));var events=[_0x20a5('0x1'),'remove',_0x20a5('0x2')];function createListener(_0x396070,_0xe4dbc9){return function(_0x5a71da){_0xe4dbc9[_0x20a5('0x3')](_0x396070,_0x5a71da);};}function removeListener(_0x16e604,_0x243305){return function(){ChatMessageEvents[_0x20a5('0x4')](_0x16e604,_0x243305);};}exports[_0x20a5('0x5')]=function(_0x1fcc72){for(var _0x4acc66=0x0,_0x56b172=events[_0x20a5('0x6')];_0x4acc66<_0x56b172;_0x4acc66++){var _0x1f44fd=events[_0x4acc66];var _0x478779=createListener(_0x20a5('0x7')+_0x1f44fd,_0x1fcc72);ChatMessageEvents['on'](_0x1f44fd,_0x478779);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index d65e477..3fb69a6 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 _0xbf3c=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','exports','util','path','connect-timeout'];(function(_0x227b65,_0x3a4249){var _0x32c32f=function(_0x2aa7b4){while(--_0x2aa7b4){_0x227b65['push'](_0x227b65['shift']());}};_0x32c32f(++_0x3a4249);}(_0xbf3c,0xef));var _0xcbf3=function(_0x15c25b,_0x3e45aa){_0x15c25b=_0x15c25b-0x0;var _0x3a4965=_0xbf3c[_0x15c25b];return _0x3a4965;};'use strict';var multer=require('multer');var util=require(_0xcbf3('0x0'));var path=require(_0xcbf3('0x1'));var timeout=require(_0xcbf3('0x2'));var express=require(_0xcbf3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcbf3('0x4'));var interaction=require(_0xcbf3('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0xcbf3('0x6')]('/',auth[_0xcbf3('0x7')](),controller[_0xcbf3('0x8')]);router[_0xcbf3('0x6')](_0xcbf3('0x9'),auth[_0xcbf3('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcbf3('0xa')]);router['post']('/',auth[_0xcbf3('0x7')](),interaction[_0xcbf3('0xb')](_0xcbf3('0xc'),_0xcbf3('0xd')),controller['create']);router[_0xcbf3('0xe')]('/:id',controller[_0xcbf3('0xf')]);router[_0xcbf3('0xe')](_0xcbf3('0x10'),auth[_0xcbf3('0x7')](),controller[_0xcbf3('0x11')]);router['put']('/:id/reject',auth[_0xcbf3('0x7')](),controller[_0xcbf3('0x12')]);router[_0xcbf3('0x13')]('/:id',auth[_0xcbf3('0x7')](),controller[_0xcbf3('0x14')]);module[_0xcbf3('0x15')]=router; \ No newline at end of file +var _0xd01c=['/:id','isAuthenticated','show','tracked','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','describe'];(function(_0x5963d1,_0x1b0cfe){var _0x3993fe=function(_0x436f60){while(--_0x436f60){_0x5963d1['push'](_0x5963d1['shift']());}};_0x3993fe(++_0x1b0cfe);}(_0xd01c,0x155));var _0xcd01=function(_0x2ffea5,_0x28dea7){_0x2ffea5=_0x2ffea5-0x0;var _0x5f0fce=_0xd01c[_0x2ffea5];return _0x5f0fce;};'use strict';var multer=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var path=require('path');var timeout=require(_0xcd01('0x2'));var express=require(_0xcd01('0x3'));var router=express[_0xcd01('0x4')]();var fs_extra=require(_0xcd01('0x5'));var auth=require(_0xcd01('0x6'));var interaction=require(_0xcd01('0x7'));var config=require(_0xcd01('0x8'));var controller=require('./chatMessage.controller');router[_0xcd01('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd01('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcd01('0xa')]);router['get'](_0xcd01('0xb'),auth[_0xcd01('0xc')](),controller[_0xcd01('0xd')]);router['post']('/',auth[_0xcd01('0xc')](),interaction[_0xcd01('0xe')]('chat',_0xcd01('0xf')),controller['create']);router[_0xcd01('0x10')](_0xcd01('0xb'),controller['update']);router[_0xcd01('0x10')](_0xcd01('0x11'),auth[_0xcd01('0xc')](),controller[_0xcd01('0x12')]);router[_0xcd01('0x10')](_0xcd01('0x13'),auth[_0xcd01('0xc')](),controller[_0xcd01('0x14')]);router['delete'](_0xcd01('0xb'),auth['isAuthenticated'](),controller[_0xcd01('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index abb9290..5ca3abe 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x58d23c,_0x34d513){var _0x17d372=function(_0x5b6e2b){while(--_0x5b6e2b){_0x58d23c['push'](_0x58d23c['shift']());}};_0x17d372(++_0x34d513);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5bc76e,_0x2d69c7){_0x5bc76e=_0x5bc76e-0x0;var _0x524844=_0x5f2f[_0x5bc76e];return _0x524844;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x0b0e[_0x378720];return _0x47920a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7b91dc0..c01c231 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(_0x9496d2,_0x58c6f4){var _0x4ff60f=function(_0x50c716){while(--_0x50c716){_0x9496d2['push'](_0x9496d2['shift']());}};_0x4ff60f(++_0x58c6f4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 _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(_0x46b803,_0x78edca){var _0xe91bc2=function(_0x281a68){while(--_0x281a68){_0x46b803['push'](_0x46b803['shift']());}};_0xe91bc2(++_0x78edca);}(_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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index d117ac0..b020bac 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 _0x2973=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x12e542,_0x3da782){var _0x2d2195=function(_0x430822){while(--_0x430822){_0x12e542['push'](_0x12e542['shift']());}};_0x2d2195(++_0x3da782);}(_0x2973,0xef));var _0x3297=function(_0x34e481,_0x1f0d05){_0x34e481=_0x34e481-0x0;var _0x195d01=_0x2973[_0x34e481];return _0x195d01;};'use strict';var EventEmitter=require(_0x3297('0x0'));var ChatOfflineMessage=require(_0x3297('0x1'))['db'][_0x3297('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3297('0x3')](0x0);var events={'afterCreate':_0x3297('0x4'),'afterUpdate':_0x3297('0x5'),'afterDestroy':_0x3297('0x6')};function emitEvent(_0x572151){return function(_0xb386a2,_0x8b8a4a,_0x46498e){ChatOfflineMessageEvents[_0x3297('0x7')](_0x572151+':'+_0xb386a2['id'],_0xb386a2);ChatOfflineMessageEvents[_0x3297('0x7')](_0x572151,_0xb386a2);_0x46498e(null);};}for(var e in events){if(events[_0x3297('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x3297('0x9')](e,emitEvent(event));}}module[_0x3297('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xbbbd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbbd,0xc1));var _0xdbbb=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xbbbd[_0x2b9b7f];return _0x4ed19a;};'use strict';var EventEmitter=require(_0xdbbb('0x0'));var ChatOfflineMessage=require(_0xdbbb('0x1'))['db'][_0xdbbb('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xdbbb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbbb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b2c4f){return function(_0x27a501,_0x57e863,_0x361c64){ChatOfflineMessageEvents[_0xdbbb('0x5')](_0x1b2c4f+':'+_0x27a501['id'],_0x27a501);ChatOfflineMessageEvents[_0xdbbb('0x5')](_0x1b2c4f,_0x27a501);_0x361c64(null);};}for(var e in events){if(events[_0xdbbb('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xdbbb('0x7')](e,emitEvent(event));}}module[_0xdbbb('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index cbab7d8..63f01f5 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 _0xb5d3=['exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x470ada,_0x59115d){var _0x2e53c1=function(_0x3c3d71){while(--_0x3c3d71){_0x470ada['push'](_0x470ada['shift']());}};_0x2e53c1(++_0x59115d);}(_0xb5d3,0x149));var _0x3b5d=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0xb5d3[_0x3b6cc7];return _0x37f564;};'use strict';var attributes=require(_0x3b5d('0x0'));module[_0x3b5d('0x1')]=function(_0x487290){return _0x487290[_0x3b5d('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x3b5d('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b5d('0x4'),'collate':_0x3b5d('0x5')});}; \ No newline at end of file +var _0x6fcf=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x57e834,_0x328d1a){var _0x1076d9=function(_0xd8e4c){while(--_0xd8e4c){_0x57e834['push'](_0x57e834['shift']());}};_0x1076d9(++_0x328d1a);}(_0x6fcf,0x1c5));var _0xf6fc=function(_0x45e064,_0x411c6a){_0x45e064=_0x45e064-0x0;var _0x1c1ee4=_0x6fcf[_0x45e064];return _0x1c1ee4;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xf6fc('0x0')]=function(_0xae3d8a){return _0xae3d8a[_0xf6fc('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0xf6fc('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6fc('0x3'),'collate':_0xf6fc('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e273231..17f24e6 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 _0xfd69=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0xfd69,0xa4));var _0x9fd6=function(_0x1c2aa7,_0x1f7fb6){_0x1c2aa7=_0x1c2aa7-0x0;var _0x51594c=_0xfd69[_0x1c2aa7];return _0x51594c;};'use strict';var _=require(_0x9fd6('0x0'));var util=require(_0x9fd6('0x1'));var moment=require(_0x9fd6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fd6('0x3'));var db=require(_0x9fd6('0x4'))['db'];var utils=require(_0x9fd6('0x5'));var logger=require(_0x9fd6('0x6'))(_0x9fd6('0x7'));var config=require(_0x9fd6('0x8'));var jayson=require(_0x9fd6('0x9'));var client=jayson[_0x9fd6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6792,_0x5df490,_0x53e38d){return new BPromise(function(_0x29aedc,_0x36206a){return client[_0x9fd6('0xb')](_0x2a6792,_0x53e38d)[_0x9fd6('0xc')](function(_0x244ee3){logger[_0x9fd6('0xd')](_0x9fd6('0xe'),_0x5df490,_0x9fd6('0xf'));logger[_0x9fd6('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5df490,'request\x20sent',JSON[_0x9fd6('0x11')](_0x244ee3));if(_0x244ee3[_0x9fd6('0x12')]){if(_0x244ee3[_0x9fd6('0x12')][_0x9fd6('0x13')]===0x1f4){logger[_0x9fd6('0x12')](_0x9fd6('0xe'),_0x5df490,_0x244ee3[_0x9fd6('0x12')][_0x9fd6('0x14')]);return _0x36206a(_0x244ee3[_0x9fd6('0x12')][_0x9fd6('0x14')]);}logger['error'](_0x9fd6('0xe'),_0x5df490,_0x244ee3[_0x9fd6('0x12')]['message']);return _0x29aedc(_0x244ee3[_0x9fd6('0x12')]['message']);}else{logger[_0x9fd6('0xd')](_0x9fd6('0xe'),_0x5df490,'request\x20sent');_0x29aedc(_0x244ee3[_0x9fd6('0x15')][_0x9fd6('0x14')]);}})['catch'](function(_0x51270e){logger[_0x9fd6('0x12')](_0x9fd6('0xe'),_0x5df490,_0x51270e);_0x36206a(_0x51270e);});});} \ No newline at end of file +var _0xc94e=['message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xbf10cd,_0x469c08){var _0xca76eb=function(_0x18696d){while(--_0x18696d){_0xbf10cd['push'](_0xbf10cd['shift']());}};_0xca76eb(++_0x469c08);}(_0xc94e,0x76));var _0xec94=function(_0x4bccf7,_0x5d4ae0){_0x4bccf7=_0x4bccf7-0x0;var _0x86ea42=_0xc94e[_0x4bccf7];return _0x86ea42;};'use strict';var _=require(_0xec94('0x0'));var util=require('util');var moment=require(_0xec94('0x1'));var BPromise=require(_0xec94('0x2'));var rs=require(_0xec94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xec94('0x4'))(_0xec94('0x5'));var config=require('../../config/environment');var jayson=require(_0xec94('0x6'));var client=jayson[_0xec94('0x7')][_0xec94('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ecb60,_0x5e7a4d,_0x59ace5){return new BPromise(function(_0x5a1fa0,_0x42c941){return client['request'](_0x5ecb60,_0x59ace5)[_0xec94('0x9')](function(_0x2763e0){logger['info'](_0xec94('0xa'),_0x5e7a4d,_0xec94('0xb'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5e7a4d,'request\x20sent',JSON[_0xec94('0xc')](_0x2763e0));if(_0x2763e0[_0xec94('0xd')]){if(_0x2763e0['error'][_0xec94('0xe')]===0x1f4){logger['error'](_0xec94('0xa'),_0x5e7a4d,_0x2763e0['error'][_0xec94('0xf')]);return _0x42c941(_0x2763e0['error']['message']);}logger[_0xec94('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5e7a4d,_0x2763e0['error'][_0xec94('0xf')]);return _0x5a1fa0(_0x2763e0['error']['message']);}else{logger[_0xec94('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5e7a4d,_0xec94('0xb'));_0x5a1fa0(_0x2763e0[_0xec94('0x11')][_0xec94('0xf')]);}})[_0xec94('0x12')](function(_0x27951f){logger[_0xec94('0xd')](_0xec94('0xa'),_0x5e7a4d,_0x27951f);_0x42c941(_0x27951f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 7af6416..e457084 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 _0x0217=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x58c23d,_0x88614f){var _0x20e8ae=function(_0x3951eb){while(--_0x3951eb){_0x58c23d['push'](_0x58c23d['shift']());}};_0x20e8ae(++_0x88614f);}(_0x0217,0x1cf));var _0x7021=function(_0x3f6fd0,_0x4b5c9c){_0x3f6fd0=_0x3f6fd0-0x0;var _0x4257a2=_0x0217[_0x3f6fd0];return _0x4257a2;};'use strict';var multer=require(_0x7021('0x0'));var util=require('util');var path=require(_0x7021('0x1'));var timeout=require(_0x7021('0x2'));var express=require('express');var router=express[_0x7021('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7021('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7021('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x7021('0x6')]('/',auth[_0x7021('0x7')](),controller[_0x7021('0x8')]);router[_0x7021('0x6')](_0x7021('0x9'),auth[_0x7021('0x7')](),controller[_0x7021('0xa')]);router[_0x7021('0x6')](_0x7021('0xb'),auth[_0x7021('0x7')](),controller['show']);router[_0x7021('0xc')]('/',auth[_0x7021('0x7')](),controller['create']);router[_0x7021('0xd')](_0x7021('0xb'),auth['isAuthenticated'](),controller[_0x7021('0xe')]);router[_0x7021('0xf')](_0x7021('0xb'),auth[_0x7021('0x7')](),controller[_0x7021('0x10')]);module[_0x7021('0x11')]=router; \ No newline at end of file +var _0x3858=['create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0x3858,0x101));var _0x8385=function(_0xb8cd0a,_0x52d523){_0xb8cd0a=_0xb8cd0a-0x0;var _0x598b11=_0x3858[_0xb8cd0a];return _0x598b11;};'use strict';var multer=require(_0x8385('0x0'));var util=require(_0x8385('0x1'));var path=require(_0x8385('0x2'));var timeout=require('connect-timeout');var express=require(_0x8385('0x3'));var router=express['Router']();var fs_extra=require(_0x8385('0x4'));var auth=require(_0x8385('0x5'));var interaction=require(_0x8385('0x6'));var config=require('../../config/environment');var controller=require(_0x8385('0x7'));router[_0x8385('0x8')]('/',auth[_0x8385('0x9')](),controller[_0x8385('0xa')]);router[_0x8385('0x8')](_0x8385('0xb'),auth[_0x8385('0x9')](),controller['describe']);router[_0x8385('0x8')](_0x8385('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8385('0x9')](),controller[_0x8385('0xd')]);router[_0x8385('0xe')](_0x8385('0xc'),auth[_0x8385('0x9')](),controller['update']);router[_0x8385('0xf')](_0x8385('0xc'),auth[_0x8385('0x9')](),controller[_0x8385('0x10')]);module[_0x8385('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 73fb925..e9f71bb 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 _0xdfad=['sequelize','exports','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x25e0c7,_0x3e4af4){var _0x299fd0=function(_0x365fb8){while(--_0x365fb8){_0x25e0c7['push'](_0x25e0c7['shift']());}};_0x299fd0(++_0x3e4af4);}(_0xdfad,0x157));var _0xddfa=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xdfad[_0x504df1];return _0x1063b5;};'use strict';var Sequelize=require(_0xddfa('0x0'));module[_0xddfa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xddfa('0x2')](_0xddfa('0x3'),_0xddfa('0x4')),'defaultValue':_0xddfa('0x3')},'selector':{'type':Sequelize[_0xddfa('0x5')]},'timeout':{'type':Sequelize[_0xddfa('0x6')]}}; \ No newline at end of file +var _0x4d35=['STRING','ENUM','timeout','INTEGER','sequelize','exports'];(function(_0x3c304d,_0x356e5d){var _0x480335=function(_0x34707f){while(--_0x34707f){_0x3c304d['push'](_0x3c304d['shift']());}};_0x480335(++_0x356e5d);}(_0x4d35,0x1a2));var _0x54d3=function(_0x3897a9,_0x2b1139){_0x3897a9=_0x3897a9-0x0;var _0x26ad3d=_0x4d35[_0x3897a9];return _0x26ad3d;};'use strict';var Sequelize=require(_0x54d3('0x0'));module[_0x54d3('0x1')]={'name':{'type':Sequelize[_0x54d3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x54d3('0x3')]('mouseOver',_0x54d3('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x54d3('0x2')]},'timeout':{'type':Sequelize[_0x54d3('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 3a1964e..26c1e3f 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 _0x7118=['json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','params','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','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7118,0x159));var _0x8711=function(_0x3c7d11,_0x25a5c9){_0x3c7d11=_0x3c7d11-0x0;var _0x4fb661=_0x7118[_0x3c7d11];return _0x4fb661;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8711('0x0'));var jsonpatch=require(_0x8711('0x1'));var rp=require('request-promise');var moment=require(_0x8711('0x2'));var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8711('0x9'));var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x13'));var logger=require(_0x8711('0x14'))(_0x8711('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8711('0x16'));var db=require(_0x8711('0x17'))['db'];function respondWithStatusCode(_0x5d2c38,_0x49b241){_0x49b241=_0x49b241||0xcc;return function(_0x11adb0){if(_0x11adb0){return _0x5d2c38[_0x8711('0x18')](_0x49b241);}return _0x5d2c38[_0x8711('0x19')](_0x49b241)[_0x8711('0x1a')]();};}function respondWithResult(_0xc0a891,_0x22f434){_0x22f434=_0x22f434||0xc8;return function(_0x16b742){if(_0x16b742){return _0xc0a891['status'](_0x22f434)[_0x8711('0x1b')](_0x16b742);}};}function respondWithFilteredResult(_0x363bcd,_0x13f394){return function(_0x2e12ec){if(_0x2e12ec){var _0x3ab905=typeof _0x13f394[_0x8711('0x1c')]==='undefined'&&typeof _0x13f394[_0x8711('0x1d')]===_0x8711('0x1e');var _0x1c2cb5=_0x2e12ec[_0x8711('0x1f')];var _0x19a157=_0x3ab905?0x0:_0x13f394['offset'];var _0x5b2bf8=_0x3ab905?_0x2e12ec['count']:_0x13f394[_0x8711('0x1c')]+_0x13f394[_0x8711('0x1d')];var _0x2f6134;if(_0x5b2bf8>=_0x1c2cb5){_0x5b2bf8=_0x1c2cb5;_0x2f6134=0xc8;}else{_0x2f6134=0xce;}_0x363bcd['status'](_0x2f6134);return _0x363bcd['set'](_0x8711('0x20'),_0x19a157+'-'+_0x5b2bf8+'/'+_0x1c2cb5)[_0x8711('0x1b')](_0x2e12ec);}return null;};}function patchUpdates(_0x1209e0){return function(_0x44b948){try{jsonpatch[_0x8711('0x21')](_0x44b948,_0x1209e0,!![]);}catch(_0x270081){return BPromise[_0x8711('0x22')](_0x270081);}return _0x44b948[_0x8711('0x23')]();};}function saveUpdates(_0xace829,_0x41369d){return function(_0x4a35f5){if(_0x4a35f5){return _0x4a35f5[_0x8711('0x24')](_0xace829)[_0x8711('0x25')](function(_0x3302b9){return _0x3302b9;});}return null;};}function removeEntity(_0x939ef3,_0x4cf830){return function(_0x27cafd){if(_0x27cafd){return _0x27cafd[_0x8711('0x26')]()[_0x8711('0x25')](function(){_0x939ef3['status'](0xcc)[_0x8711('0x1a')]();});}};}function handleEntityNotFound(_0x17bf7f,_0x3e8281){return function(_0x217197){if(!_0x217197){_0x17bf7f[_0x8711('0x18')](0x194);}return _0x217197;};}function handleError(_0x514956,_0x494683){_0x494683=_0x494683||0x1f4;return function(_0x515a74){logger[_0x8711('0x27')](_0x515a74[_0x8711('0x28')]);if(_0x515a74[_0x8711('0x29')]){delete _0x515a74[_0x8711('0x29')];}_0x514956[_0x8711('0x19')](_0x494683)[_0x8711('0x2a')](_0x515a74);};}exports[_0x8711('0x2b')]=function(_0x3ca2b5,_0x398097){var _0x47e7b7={'raw':!![],'where':{'id':_0x3ca2b5['params']['id']}},_0x27db5d={};_0x27db5d[_0x8711('0x2c')]=_[_0x8711('0x2d')](db[_0x8711('0x2e')]['rawAttributes']);_0x27db5d[_0x8711('0x2f')]=_['keys'](_0x3ca2b5[_0x8711('0x2f')]);_0x27db5d[_0x8711('0x30')]=_[_0x8711('0x31')](_0x27db5d['model'],_0x27db5d['query']);_0x47e7b7[_0x8711('0x32')]=_[_0x8711('0x31')](_0x27db5d[_0x8711('0x2c')],qs[_0x8711('0x33')](_0x3ca2b5[_0x8711('0x2f')][_0x8711('0x33')]));_0x47e7b7[_0x8711('0x32')]=_0x47e7b7[_0x8711('0x32')][_0x8711('0x34')]?_0x47e7b7[_0x8711('0x32')]:_0x27db5d['model'];if(_0x3ca2b5[_0x8711('0x2f')][_0x8711('0x35')]){_0x47e7b7[_0x8711('0x36')]=[{'all':!![]}];}_0x47e7b7=_[_0x8711('0x37')]({},_0x47e7b7,_0x3ca2b5[_0x8711('0x38')]);return db[_0x8711('0x2e')][_0x8711('0x39')](_0x47e7b7)[_0x8711('0x25')](handleEntityNotFound(_0x398097,null))[_0x8711('0x25')](respondWithResult(_0x398097,null))[_0x8711('0x3a')](handleError(_0x398097,null));};exports['create']=function(_0x18643f,_0x318e5d){return db[_0x8711('0x2e')][_0x8711('0x3b')](_0x18643f[_0x8711('0x3c')],{})['then'](respondWithResult(_0x318e5d,0xc9))[_0x8711('0x3a')](handleError(_0x318e5d,null));};exports[_0x8711('0x24')]=function(_0xa31bb6,_0x59486c){if(_0xa31bb6[_0x8711('0x3c')]['id']){delete _0xa31bb6[_0x8711('0x3c')]['id'];}return db[_0x8711('0x2e')][_0x8711('0x39')]({'where':{'id':_0xa31bb6[_0x8711('0x3d')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x59486c,null))[_0x8711('0x25')](saveUpdates(_0xa31bb6['body'],null))[_0x8711('0x25')](respondWithResult(_0x59486c,null))[_0x8711('0x3a')](handleError(_0x59486c,null));};exports[_0x8711('0x26')]=function(_0x3bb19e,_0x5a7e83){return db['ChatProactiveAction'][_0x8711('0x39')]({'where':{'id':_0x3bb19e[_0x8711('0x3d')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x5a7e83,null))[_0x8711('0x25')](removeEntity(_0x5a7e83,null))[_0x8711('0x3a')](handleError(_0x5a7e83,null));}; \ No newline at end of file +var _0xedf2=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','sendStatus','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','include','options','catch','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4bb485,_0x1ca047){var _0x1cb8b5=function(_0x492ec2){while(--_0x492ec2){_0x4bb485['push'](_0x4bb485['shift']());}};_0x1cb8b5(++_0x1ca047);}(_0xedf2,0x1ac));var _0x2edf=function(_0xd48eda,_0x39c30e){_0xd48eda=_0xd48eda-0x0;var _0x2b3c02=_0xedf2[_0xd48eda];return _0x2b3c02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2edf('0x0'));var zipdir=require(_0x2edf('0x1'));var jsonpatch=require(_0x2edf('0x2'));var rp=require('request-promise');var moment=require(_0x2edf('0x3'));var BPromise=require(_0x2edf('0x4'));var Mustache=require('mustache');var util=require(_0x2edf('0x5'));var path=require(_0x2edf('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2edf('0x7'));var fs=require('fs');var fs_extra=require(_0x2edf('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2edf('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2edf('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2edf('0xb'));var Papa=require(_0x2edf('0xc'));var Redis=require(_0x2edf('0xd'));var authService=require(_0x2edf('0xe'));var qs=require(_0x2edf('0xf'));var as=require(_0x2edf('0x10'));var hardwareService=require(_0x2edf('0x11'));var logger=require(_0x2edf('0x12'))(_0x2edf('0x13'));var utils=require('../../config/utils');var config=require(_0x2edf('0x14'));var licenseUtil=require(_0x2edf('0x15'));var db=require(_0x2edf('0x16'))['db'];function respondWithStatusCode(_0x27ac5b,_0x15764c){_0x15764c=_0x15764c||0xcc;return function(_0x38e24f){if(_0x38e24f){return _0x27ac5b['sendStatus'](_0x15764c);}return _0x27ac5b[_0x2edf('0x17')](_0x15764c)[_0x2edf('0x18')]();};}function respondWithResult(_0x17a90d,_0x3f5283){_0x3f5283=_0x3f5283||0xc8;return function(_0x5b5482){if(_0x5b5482){return _0x17a90d[_0x2edf('0x17')](_0x3f5283)[_0x2edf('0x19')](_0x5b5482);}};}function respondWithFilteredResult(_0x39087e,_0x171066){return function(_0x3802a9){if(_0x3802a9){var _0x4477fa=typeof _0x171066['offset']===_0x2edf('0x1a')&&typeof _0x171066[_0x2edf('0x1b')]===_0x2edf('0x1a');var _0x589cc2=_0x3802a9[_0x2edf('0x1c')];var _0x5b96d0=_0x4477fa?0x0:_0x171066[_0x2edf('0x1d')];var _0x14f2bb=_0x4477fa?_0x3802a9[_0x2edf('0x1c')]:_0x171066[_0x2edf('0x1d')]+_0x171066[_0x2edf('0x1b')];var _0x46d788;if(_0x14f2bb>=_0x589cc2){_0x14f2bb=_0x589cc2;_0x46d788=0xc8;}else{_0x46d788=0xce;}_0x39087e[_0x2edf('0x17')](_0x46d788);return _0x39087e[_0x2edf('0x1e')](_0x2edf('0x1f'),_0x5b96d0+'-'+_0x14f2bb+'/'+_0x589cc2)[_0x2edf('0x19')](_0x3802a9);}return null;};}function patchUpdates(_0x4f29c0){return function(_0x3c0fb8){try{jsonpatch[_0x2edf('0x20')](_0x3c0fb8,_0x4f29c0,!![]);}catch(_0x10b51a){return BPromise[_0x2edf('0x21')](_0x10b51a);}return _0x3c0fb8['save']();};}function saveUpdates(_0x5cf296,_0x4a1f52){return function(_0x10e007){if(_0x10e007){return _0x10e007['update'](_0x5cf296)['then'](function(_0x22dc8c){return _0x22dc8c;});}return null;};}function removeEntity(_0x34c30e,_0x245dc0){return function(_0x56abc9){if(_0x56abc9){return _0x56abc9[_0x2edf('0x22')]()[_0x2edf('0x23')](function(){_0x34c30e[_0x2edf('0x17')](0xcc)[_0x2edf('0x18')]();});}};}function handleEntityNotFound(_0x1a8e3b,_0x136311){return function(_0x59e11a){if(!_0x59e11a){_0x1a8e3b[_0x2edf('0x24')](0x194);}return _0x59e11a;};}function handleError(_0x389fdc,_0x5b3f59){_0x5b3f59=_0x5b3f59||0x1f4;return function(_0x2e3f85){logger['error'](_0x2e3f85[_0x2edf('0x25')]);if(_0x2e3f85['name']){delete _0x2e3f85[_0x2edf('0x26')];}_0x389fdc[_0x2edf('0x17')](_0x5b3f59)[_0x2edf('0x27')](_0x2e3f85);};}exports['show']=function(_0x67f085,_0x4170a0){var _0x221050={'raw':!![],'where':{'id':_0x67f085[_0x2edf('0x28')]['id']}},_0x3c1a7d={};_0x3c1a7d[_0x2edf('0x29')]=_[_0x2edf('0x2a')](db[_0x2edf('0x2b')][_0x2edf('0x2c')]);_0x3c1a7d[_0x2edf('0x2d')]=_[_0x2edf('0x2a')](_0x67f085[_0x2edf('0x2d')]);_0x3c1a7d['filters']=_[_0x2edf('0x2e')](_0x3c1a7d[_0x2edf('0x29')],_0x3c1a7d[_0x2edf('0x2d')]);_0x221050['attributes']=_[_0x2edf('0x2e')](_0x3c1a7d[_0x2edf('0x29')],qs[_0x2edf('0x2f')](_0x67f085[_0x2edf('0x2d')][_0x2edf('0x2f')]));_0x221050[_0x2edf('0x30')]=_0x221050[_0x2edf('0x30')]['length']?_0x221050[_0x2edf('0x30')]:_0x3c1a7d[_0x2edf('0x29')];if(_0x67f085[_0x2edf('0x2d')][_0x2edf('0x31')]){_0x221050[_0x2edf('0x32')]=[{'all':!![]}];}_0x221050=_['merge']({},_0x221050,_0x67f085[_0x2edf('0x33')]);return db[_0x2edf('0x2b')]['find'](_0x221050)[_0x2edf('0x23')](handleEntityNotFound(_0x4170a0,null))[_0x2edf('0x23')](respondWithResult(_0x4170a0,null))[_0x2edf('0x34')](handleError(_0x4170a0,null));};exports[_0x2edf('0x35')]=function(_0xd10f4b,_0x554257){return db[_0x2edf('0x2b')][_0x2edf('0x35')](_0xd10f4b[_0x2edf('0x36')],{})[_0x2edf('0x23')](respondWithResult(_0x554257,0xc9))['catch'](handleError(_0x554257,null));};exports[_0x2edf('0x37')]=function(_0x4697f9,_0x4667ba){if(_0x4697f9[_0x2edf('0x36')]['id']){delete _0x4697f9[_0x2edf('0x36')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x4697f9[_0x2edf('0x28')]['id']}})[_0x2edf('0x23')](handleEntityNotFound(_0x4667ba,null))[_0x2edf('0x23')](saveUpdates(_0x4697f9[_0x2edf('0x36')],null))[_0x2edf('0x23')](respondWithResult(_0x4667ba,null))[_0x2edf('0x34')](handleError(_0x4667ba,null));};exports[_0x2edf('0x22')]=function(_0x37e7e8,_0x5218f5){return db['ChatProactiveAction']['find']({'where':{'id':_0x37e7e8[_0x2edf('0x28')]['id']}})[_0x2edf('0x23')](handleEntityNotFound(_0x5218f5,null))[_0x2edf('0x23')](removeEntity(_0x5218f5,null))[_0x2edf('0x34')](handleError(_0x5218f5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f66dccd..e25d96a 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 _0xa002=['moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','util','../../config/logger'];(function(_0x5730e3,_0x5d58ff){var _0x83daa4=function(_0xa30445){while(--_0xa30445){_0x5730e3['push'](_0x5730e3['shift']());}};_0x83daa4(++_0x5d58ff);}(_0xa002,0xa0));var _0x2a00=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa002[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x2a00('0x0'));var logger=require(_0x2a00('0x1'))('api');var moment=require(_0x2a00('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a00('0x3'));var fs=require('fs');var path=require(_0x2a00('0x4'));var rimraf=require('rimraf');var config=require(_0x2a00('0x5'));var attributes=require(_0x2a00('0x6'));module[_0x2a00('0x7')]=function(_0x428115,_0x299b16){return _0x428115['define'](_0x2a00('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb444=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger'];(function(_0x4d8e6a,_0x5646ce){var _0x436e70=function(_0x509996){while(--_0x509996){_0x4d8e6a['push'](_0x4d8e6a['shift']());}};_0x436e70(++_0x5646ce);}(_0xb444,0x1ab));var _0x4b44=function(_0x2f3d33,_0x1d256c){_0x2f3d33=_0x2f3d33-0x0;var _0x43026c=_0xb444[_0x2f3d33];return _0x43026c;};'use strict';var _=require('lodash');var util=require(_0x4b44('0x0'));var logger=require(_0x4b44('0x1'))(_0x4b44('0x2'));var moment=require(_0x4b44('0x3'));var BPromise=require(_0x4b44('0x4'));var rp=require(_0x4b44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b44('0x6'));var config=require(_0x4b44('0x7'));var attributes=require(_0x4b44('0x8'));module[_0x4b44('0x9')]=function(_0x53d8ae,_0x7e8d82){return _0x53d8ae[_0x4b44('0xa')](_0x4b44('0xb'),attributes,{'tableName':_0x4b44('0xc'),'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 4fa9e48..cbbb7bc 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 _0x2984=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2984,0x121));var _0x4298=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x2984[_0x142ec2];return _0x45ef4e;};'use strict';var _=require(_0x4298('0x0'));var util=require(_0x4298('0x1'));var moment=require('moment');var BPromise=require(_0x4298('0x2'));var rs=require(_0x4298('0x3'));var fs=require('fs');var Redis=require(_0x4298('0x4'));var db=require(_0x4298('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4298('0x6'));var config=require(_0x4298('0x7'));var jayson=require(_0x4298('0x8'));var client=jayson[_0x4298('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51fcf1,_0x1fba00,_0x2f5df0){return new BPromise(function(_0x5edb2e,_0x4ea8ec){return client[_0x4298('0xa')](_0x51fcf1,_0x2f5df0)[_0x4298('0xb')](function(_0x5e379f){logger[_0x4298('0xc')](_0x4298('0xd'),_0x1fba00,_0x4298('0xe'));logger[_0x4298('0xf')](_0x4298('0x10'),_0x1fba00,'request\x20sent',JSON[_0x4298('0x11')](_0x5e379f));if(_0x5e379f[_0x4298('0x12')]){if(_0x5e379f[_0x4298('0x12')][_0x4298('0x13')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1fba00,_0x5e379f[_0x4298('0x12')][_0x4298('0x14')]);return _0x4ea8ec(_0x5e379f[_0x4298('0x12')][_0x4298('0x14')]);}logger[_0x4298('0x12')](_0x4298('0xd'),_0x1fba00,_0x5e379f[_0x4298('0x12')]['message']);return _0x5edb2e(_0x5e379f['error'][_0x4298('0x14')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x1fba00,_0x4298('0xe'));_0x5edb2e(_0x5e379f['result'][_0x4298('0x14')]);}})[_0x4298('0x15')](function(_0x174eeb){logger[_0x4298('0x12')](_0x4298('0xd'),_0x1fba00,_0x174eeb);_0x4ea8ec(_0x174eeb);});});} \ No newline at end of file +var _0x4d9f=['client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfe1ca8,_0x167ff8){var _0x2d48b0=function(_0x3ba149){while(--_0x3ba149){_0xfe1ca8['push'](_0xfe1ca8['shift']());}};_0x2d48b0(++_0x167ff8);}(_0x4d9f,0x14f));var _0xf4d9=function(_0x49bb24,_0x11805f){_0x49bb24=_0x49bb24-0x0;var _0x46aacc=_0x4d9f[_0x49bb24];return _0x46aacc;};'use strict';var _=require(_0xf4d9('0x0'));var util=require(_0xf4d9('0x1'));var moment=require(_0xf4d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4d9('0x4'))['db'];var utils=require(_0xf4d9('0x5'));var logger=require(_0xf4d9('0x6'))(_0xf4d9('0x7'));var config=require(_0xf4d9('0x8'));var jayson=require(_0xf4d9('0x9'));var client=jayson[_0xf4d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103c7d,_0xbba2a6,_0x2a6d6a){return new BPromise(function(_0x20a6a5,_0x51c972){return client[_0xf4d9('0xb')](_0x103c7d,_0x2a6d6a)[_0xf4d9('0xc')](function(_0x211b27){logger[_0xf4d9('0xd')](_0xf4d9('0xe'),_0xbba2a6,_0xf4d9('0xf'));logger[_0xf4d9('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0xbba2a6,_0xf4d9('0xf'),JSON[_0xf4d9('0x11')](_0x211b27));if(_0x211b27[_0xf4d9('0x12')]){if(_0x211b27[_0xf4d9('0x12')][_0xf4d9('0x13')]===0x1f4){logger[_0xf4d9('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xbba2a6,_0x211b27[_0xf4d9('0x12')]['message']);return _0x51c972(_0x211b27[_0xf4d9('0x12')][_0xf4d9('0x14')]);}logger[_0xf4d9('0x12')](_0xf4d9('0xe'),_0xbba2a6,_0x211b27[_0xf4d9('0x12')][_0xf4d9('0x14')]);return _0x20a6a5(_0x211b27[_0xf4d9('0x12')]['message']);}else{logger[_0xf4d9('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0xbba2a6,'request\x20sent');_0x20a6a5(_0x211b27[_0xf4d9('0x15')][_0xf4d9('0x14')]);}})[_0xf4d9('0x16')](function(_0x3a4dcd){logger[_0xf4d9('0x12')](_0xf4d9('0xe'),_0xbba2a6,_0x3a4dcd);_0x51c972(_0x3a4dcd);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 812b375..51a64f5 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 _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xc7abef,_0x879cf2){_0xc7abef=_0xc7abef-0x0;var _0x5bace7=_0x3eea[_0xc7abef];return _0x5bace7;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc4aa=['show','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x842ed4,_0x3f008f){var _0x4aa2c2=function(_0xebb021){while(--_0xebb021){_0x842ed4['push'](_0x842ed4['shift']());}};_0x4aa2c2(++_0x3f008f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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')](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xb')]);router[_0xac4a('0xc')]('/',auth[_0xac4a('0xa')](),controller['create']);router['put'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xd')]);router['delete'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xe')]);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 42e60eb..7a0f618 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 _0x1fb3=['name','exports','STRING'];(function(_0x3afaae,_0x1ee943){var _0x21c7cc=function(_0x4f545d){while(--_0x4f545d){_0x3afaae['push'](_0x3afaae['shift']());}};_0x21c7cc(++_0x1ee943);}(_0x1fb3,0x160));var _0x31fb=function(_0x5a306a,_0x3bdfdf){_0x5a306a=_0x5a306a-0x0;var _0x5ec858=_0x1fb3[_0x5a306a];return _0x5ec858;};'use strict';var Sequelize=require('sequelize');module[_0x31fb('0x0')]={'name':{'type':Sequelize[_0x31fb('0x1')],'unique':_0x31fb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x31fb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0xfbb1=['name','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0x27948c,_0x59999c){var _0x2c2df9=function(_0x49e065){while(--_0x49e065){_0x27948c['push'](_0x27948c['shift']());}};_0x2c2df9(++_0x59999c);}(_0xfbb1,0x1e4));var _0x1fbb=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xfbb1[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x1fbb('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fbb('0x1')],'unique':_0x1fbb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1fbb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1fbb('0x3')](_0x1fbb('0x4'),_0x1fbb('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b1e2c02..e1b6a3f 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 _0xaae9=['update','destroy','get','stack','name','send','index','map','fieldName','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','ChatQueue','include','findAll','rows','catch','show','params','rawAttributes','keys','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','pick','ChatQueueId','filter','UserChatQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','chatPause','getTeams','Team','order','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xaae9,0x18e));var _0x9aae=function(_0x8624a2,_0x405fa1){_0x8624a2=_0x8624a2-0x0;var _0x3d94ae=_0xaae9[_0x8624a2];return _0x3d94ae;};'use strict';var emlformat=require(_0x9aae('0x0'));var rimraf=require(_0x9aae('0x1'));var zipdir=require(_0x9aae('0x2'));var jsonpatch=require(_0x9aae('0x3'));var rp=require(_0x9aae('0x4'));var moment=require(_0x9aae('0x5'));var BPromise=require(_0x9aae('0x6'));var Mustache=require(_0x9aae('0x7'));var util=require(_0x9aae('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9aae('0x9'));var fs=require('fs');var fs_extra=require(_0x9aae('0xa'));var _=require(_0x9aae('0xb'));var squel=require(_0x9aae('0xc'));var crypto=require(_0x9aae('0xd'));var jsforce=require(_0x9aae('0xe'));var deskjs=require(_0x9aae('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9aae('0x10'));var Papa=require(_0x9aae('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9aae('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9aae('0x13'));var logger=require('../../config/logger')(_0x9aae('0x14'));var utils=require(_0x9aae('0x15'));var config=require(_0x9aae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9aae('0x17'))['db'];config[_0x9aae('0x18')]=_[_0x9aae('0x19')](config[_0x9aae('0x18')],{'host':_0x9aae('0x1a'),'port':0x18eb});var socket=require(_0x9aae('0x1b'))(new Redis(config['redis']));require(_0x9aae('0x1c'))[_0x9aae('0x1d')](socket);var jayson=require(_0x9aae('0x1e'));var client=jayson[_0x9aae('0x1f')][_0x9aae('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1165af,_0x256401,_0x166fc7,_0x53e784){return new BPromise(function(_0x3b3557,_0x1dca12){var _0x1ad285=_0x53e784||client;return _0x1ad285[_0x9aae('0x21')](_0x1165af,_0x166fc7)[_0x9aae('0x22')](function(_0x3268c5){logger[_0x9aae('0x23')]('ChatQueue,\x20%s,\x20%s',_0x256401,'request\x20sent');logger[_0x9aae('0x24')](_0x9aae('0x25'),_0x256401,_0x9aae('0x26'),JSON[_0x9aae('0x27')](_0x3268c5));if(_0x3268c5[_0x9aae('0x28')]){if(_0x3268c5['error']['code']===0x1f4){logger['error'](_0x9aae('0x29'),_0x256401,_0x3268c5[_0x9aae('0x28')][_0x9aae('0x2a')]);return _0x1dca12(_0x3268c5['error'][_0x9aae('0x2a')]);}logger[_0x9aae('0x28')]('ChatQueue,\x20%s,\x20%s',_0x256401,_0x3268c5['error'][_0x9aae('0x2a')]);return _0x3b3557(_0x3268c5[_0x9aae('0x28')][_0x9aae('0x2a')]);}else{logger['info'](_0x9aae('0x29'),_0x256401,'request\x20sent');_0x3b3557(_0x3268c5[_0x9aae('0x2b')]['message']);}})['catch'](function(_0x49d132){logger[_0x9aae('0x28')](_0x9aae('0x29'),_0x256401,_0x49d132);_0x1dca12(_0x49d132);});});}function respondWithStatusCode(_0x3db2fb,_0x2b9fa5){_0x2b9fa5=_0x2b9fa5||0xcc;return function(_0x331f15){if(_0x331f15){return _0x3db2fb[_0x9aae('0x2c')](_0x2b9fa5);}return _0x3db2fb[_0x9aae('0x2d')](_0x2b9fa5)['end']();};}function respondWithResult(_0x34130d,_0x34debe){_0x34debe=_0x34debe||0xc8;return function(_0x3da42e){if(_0x3da42e){return _0x34130d[_0x9aae('0x2d')](_0x34debe)[_0x9aae('0x2e')](_0x3da42e);}};}function respondWithFilteredResult(_0x14e865,_0x28588e){return function(_0x424f36){if(_0x424f36){var _0x146d01=typeof _0x28588e[_0x9aae('0x2f')]===_0x9aae('0x30')&&typeof _0x28588e[_0x9aae('0x31')]===_0x9aae('0x30');var _0x2558f1=_0x424f36[_0x9aae('0x32')];var _0x5c5d46=_0x146d01?0x0:_0x28588e[_0x9aae('0x2f')];var _0x50e9f4=_0x146d01?_0x424f36[_0x9aae('0x32')]:_0x28588e[_0x9aae('0x2f')]+_0x28588e['limit'];var _0x4a9ec6;if(_0x50e9f4>=_0x2558f1){_0x50e9f4=_0x2558f1;_0x4a9ec6=0xc8;}else{_0x4a9ec6=0xce;}_0x14e865['status'](_0x4a9ec6);return _0x14e865[_0x9aae('0x33')]('Content-Range',_0x5c5d46+'-'+_0x50e9f4+'/'+_0x2558f1)['json'](_0x424f36);}return null;};}function patchUpdates(_0x366de7){return function(_0x171bbe){try{jsonpatch[_0x9aae('0x34')](_0x171bbe,_0x366de7,!![]);}catch(_0x54327c){return BPromise[_0x9aae('0x35')](_0x54327c);}return _0x171bbe[_0x9aae('0x36')]();};}function saveUpdates(_0x401b49,_0x1df8b0){return function(_0x4842c6){if(_0x4842c6){return _0x4842c6[_0x9aae('0x37')](_0x401b49)[_0x9aae('0x22')](function(_0x23abe3){return _0x23abe3;});}return null;};}function removeEntity(_0x9178ab,_0x4dc0ff){return function(_0x864a6a){if(_0x864a6a){return _0x864a6a[_0x9aae('0x38')]()[_0x9aae('0x22')](function(){var _0x935150=_0x864a6a[_0x9aae('0x39')]({'plain':!![]});var _0x3b7e4f='ChatQueues';return db['UserProfileResource'][_0x9aae('0x38')]({'where':{'type':_0x3b7e4f,'resourceId':_0x935150['id']}})[_0x9aae('0x22')](function(){return _0x864a6a;});})[_0x9aae('0x22')](function(){_0x9178ab[_0x9aae('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aee01,_0x304998){return function(_0x2081f2){if(!_0x2081f2){_0x3aee01[_0x9aae('0x2c')](0x194);}return _0x2081f2;};}function handleError(_0x512f13,_0x4013a4){_0x4013a4=_0x4013a4||0x1f4;return function(_0x239a21){logger[_0x9aae('0x28')](_0x239a21[_0x9aae('0x3a')]);if(_0x239a21[_0x9aae('0x3b')]){delete _0x239a21[_0x9aae('0x3b')];}_0x512f13['status'](_0x4013a4)[_0x9aae('0x3c')](_0x239a21);};}exports[_0x9aae('0x3d')]=function(_0x183b3c,_0x413560){var _0x49589a={},_0x5acb2a={},_0x318950={'count':0x0,'rows':[]};var _0x4d4cd1=_[_0x9aae('0x3e')](db['ChatQueue']['rawAttributes'],function(_0x5ae0d4){return{'name':_0x5ae0d4[_0x9aae('0x3f')],'type':_0x5ae0d4['type']['key']};});_0x5acb2a[_0x9aae('0x40')]=_[_0x9aae('0x3e')](_0x4d4cd1,_0x9aae('0x3b'));_0x5acb2a[_0x9aae('0x41')]=_['keys'](_0x183b3c['query']);_0x5acb2a['filters']=_['intersection'](_0x5acb2a[_0x9aae('0x40')],_0x5acb2a[_0x9aae('0x41')]);_0x49589a['attributes']=_['intersection'](_0x5acb2a[_0x9aae('0x40')],qs[_0x9aae('0x42')](_0x183b3c['query'][_0x9aae('0x42')]));_0x49589a['attributes']=_0x49589a[_0x9aae('0x43')][_0x9aae('0x44')]?_0x49589a[_0x9aae('0x43')]:_0x5acb2a[_0x9aae('0x40')];if(!_0x183b3c['query'][_0x9aae('0x45')](_0x9aae('0x46'))){_0x49589a['limit']=qs[_0x9aae('0x31')](_0x183b3c['query'][_0x9aae('0x31')]);_0x49589a['offset']=qs[_0x9aae('0x2f')](_0x183b3c[_0x9aae('0x41')][_0x9aae('0x2f')]);}_0x49589a['order']=qs['sort'](_0x183b3c[_0x9aae('0x41')][_0x9aae('0x47')]);_0x49589a[_0x9aae('0x48')]=qs[_0x9aae('0x49')](_['pick'](_0x183b3c['query'],_0x5acb2a[_0x9aae('0x49')]),_0x4d4cd1);if(_0x183b3c[_0x9aae('0x41')]['filter']){_0x49589a[_0x9aae('0x48')]=_[_0x9aae('0x4a')](_0x49589a[_0x9aae('0x48')],{'$or':_[_0x9aae('0x3e')](_0x4d4cd1,function(_0x6a85e4){if(_0x6a85e4[_0x9aae('0x4b')]!==_0x9aae('0x4c')){var _0x11940d={};_0x11940d[_0x6a85e4[_0x9aae('0x3b')]]={'$like':'%'+_0x183b3c[_0x9aae('0x41')]['filter']+'%'};return _0x11940d;}})});}_0x49589a=_['merge']({},_0x49589a,_0x183b3c['options']);var _0x25dc60={'where':_0x49589a[_0x9aae('0x48')]};return db[_0x9aae('0x4d')][_0x9aae('0x32')](_0x25dc60)[_0x9aae('0x22')](function(_0x3002aa){_0x318950[_0x9aae('0x32')]=_0x3002aa;if(_0x183b3c[_0x9aae('0x41')]['includeAll']){_0x49589a[_0x9aae('0x4e')]=[{'all':!![]}];}return db[_0x9aae('0x4d')][_0x9aae('0x4f')](_0x49589a);})[_0x9aae('0x22')](function(_0xe0a26f){_0x318950[_0x9aae('0x50')]=_0xe0a26f;return _0x318950;})['then'](respondWithFilteredResult(_0x413560,_0x49589a))[_0x9aae('0x51')](handleError(_0x413560,null));};exports[_0x9aae('0x52')]=function(_0x22ad17,_0x3a03c1){var _0x2748d0={'raw':!![],'where':{'id':_0x22ad17[_0x9aae('0x53')]['id']}},_0x4c262c={};_0x4c262c[_0x9aae('0x40')]=_['keys'](db[_0x9aae('0x4d')][_0x9aae('0x54')]);_0x4c262c[_0x9aae('0x41')]=_[_0x9aae('0x55')](_0x22ad17[_0x9aae('0x41')]);_0x4c262c['filters']=_[_0x9aae('0x56')](_0x4c262c[_0x9aae('0x40')],_0x4c262c[_0x9aae('0x41')]);_0x2748d0[_0x9aae('0x43')]=_[_0x9aae('0x56')](_0x4c262c['model'],qs[_0x9aae('0x42')](_0x22ad17[_0x9aae('0x41')][_0x9aae('0x42')]));_0x2748d0['attributes']=_0x2748d0[_0x9aae('0x43')][_0x9aae('0x44')]?_0x2748d0['attributes']:_0x4c262c['model'];if(_0x22ad17['query']['includeAll']){_0x2748d0[_0x9aae('0x4e')]=[{'all':!![]}];}_0x2748d0=_[_0x9aae('0x4a')]({},_0x2748d0,_0x22ad17[_0x9aae('0x57')]);return db[_0x9aae('0x4d')][_0x9aae('0x58')](_0x2748d0)[_0x9aae('0x22')](handleEntityNotFound(_0x3a03c1,null))[_0x9aae('0x22')](respondWithResult(_0x3a03c1,null))[_0x9aae('0x51')](handleError(_0x3a03c1,null));};exports['create']=function(_0x58ca61,_0x49db02){return db[_0x9aae('0x4d')][_0x9aae('0x59')](_0x58ca61[_0x9aae('0x5a')],{})[_0x9aae('0x22')](function(_0x68ce8c){var _0x45fd6d=_0x58ca61[_0x9aae('0x5b')][_0x9aae('0x39')]({'plain':!![]});if(!_0x45fd6d)throw new Error(_0x9aae('0x5c'));if(_0x45fd6d['role']===_0x9aae('0x5b')){var _0x44e08d=_0x68ce8c[_0x9aae('0x39')]({'plain':!![]});var _0x3fa9da=_0x9aae('0x5d');return db['UserProfileSection'][_0x9aae('0x58')]({'where':{'name':_0x3fa9da,'userProfileId':_0x45fd6d[_0x9aae('0x5e')]},'raw':!![]})['then'](function(_0x3450b5){if(_0x3450b5&&_0x3450b5['autoAssociation']===0x0){return db[_0x9aae('0x5f')][_0x9aae('0x59')]({'name':_0x44e08d[_0x9aae('0x3b')],'resourceId':_0x44e08d['id'],'type':_0x3450b5[_0x9aae('0x3b')],'sectionId':_0x3450b5['id']},{})['then'](function(){return _0x68ce8c;});}else{return _0x68ce8c;}})[_0x9aae('0x51')](function(_0x182d33){logger[_0x9aae('0x28')](_0x9aae('0x60'),_0x182d33);throw _0x182d33;});}return _0x68ce8c;})[_0x9aae('0x22')](respondWithResult(_0x49db02,0xc9))[_0x9aae('0x51')](handleError(_0x49db02,null));};exports['update']=function(_0x24e25e,_0x1f879b){if(_0x24e25e[_0x9aae('0x5a')]['id']){delete _0x24e25e[_0x9aae('0x5a')]['id'];}return db[_0x9aae('0x4d')]['find']({'where':{'id':_0x24e25e[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x1f879b,null))[_0x9aae('0x22')](saveUpdates(_0x24e25e[_0x9aae('0x5a')],null))[_0x9aae('0x22')](respondWithResult(_0x1f879b,null))[_0x9aae('0x51')](handleError(_0x1f879b,null));};exports[_0x9aae('0x38')]=function(_0x30a47d,_0x554901){return db['ChatQueue'][_0x9aae('0x58')]({'where':{'id':_0x30a47d[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x554901,null))['then'](removeEntity(_0x554901,null))[_0x9aae('0x51')](handleError(_0x554901,null));};exports['describe']=function(_0x15e84b,_0x41eb82){return db[_0x9aae('0x4d')][_0x9aae('0x61')]()[_0x9aae('0x22')](respondWithResult(_0x41eb82,null))[_0x9aae('0x51')](handleError(_0x41eb82,null));};exports['getMembers']=function(_0x3b96d0,_0x433d53,_0x24ed6b){var _0x32c1c0={'raw':!![],'where':{}},_0x551e8d={},_0x39eb44;return db[_0x9aae('0x4d')][_0x9aae('0x62')]({'where':{'id':_0x3b96d0[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x433d53,null))['then'](function(_0x5e38ae){if(_0x5e38ae){_0x39eb44=_0x5e38ae[_0x9aae('0x39')]({'plain':!![]});_0x551e8d[_0x9aae('0x40')]=_[_0x9aae('0x55')](db['UserChatQueue']['rawAttributes']);_0x551e8d[_0x9aae('0x41')]=_[_0x9aae('0x55')](_0x3b96d0['query']);_0x551e8d[_0x9aae('0x49')]=_[_0x9aae('0x56')](_0x551e8d['model'],_0x551e8d[_0x9aae('0x41')]);_0x32c1c0[_0x9aae('0x43')]=_[_0x9aae('0x56')](_0x551e8d[_0x9aae('0x40')],qs[_0x9aae('0x42')](_0x3b96d0[_0x9aae('0x41')][_0x9aae('0x42')]));_0x32c1c0['attributes']=_0x32c1c0[_0x9aae('0x43')][_0x9aae('0x44')]?_0x32c1c0[_0x9aae('0x43')]:_0x551e8d[_0x9aae('0x40')];if(!_0x3b96d0[_0x9aae('0x41')]['hasOwnProperty'](_0x9aae('0x46'))){_0x32c1c0['limit']=qs[_0x9aae('0x31')](_0x3b96d0['query'][_0x9aae('0x31')]);_0x32c1c0[_0x9aae('0x2f')]=qs['offset'](_0x3b96d0['query'][_0x9aae('0x2f')]);}_0x32c1c0['order']=qs[_0x9aae('0x47')](_0x3b96d0[_0x9aae('0x41')][_0x9aae('0x47')]);_0x32c1c0[_0x9aae('0x48')]=qs[_0x9aae('0x49')](_[_0x9aae('0x63')](_0x3b96d0[_0x9aae('0x41')],_0x551e8d[_0x9aae('0x49')]));_0x32c1c0[_0x9aae('0x48')][_0x9aae('0x64')]=_0x5e38ae['id'];if(_0x3b96d0[_0x9aae('0x41')][_0x9aae('0x65')]){_0x32c1c0[_0x9aae('0x48')]=_['merge'](_0x32c1c0[_0x9aae('0x48')],{'$or':_[_0x9aae('0x3e')](_0x32c1c0[_0x9aae('0x43')],function(_0x48d55e){var _0x183b96={};_0x183b96[_0x48d55e]={'$like':'%'+_0x3b96d0['query'][_0x9aae('0x65')]+'%'};return _0x183b96;})});}_0x32c1c0=_[_0x9aae('0x4a')]({},_0x32c1c0,_0x3b96d0[_0x9aae('0x57')]);return db[_0x9aae('0x66')][_0x9aae('0x4f')](_0x32c1c0);}})[_0x9aae('0x22')](function(_0x59dd62){if(_0x59dd62){return db['User'][_0x9aae('0x67')]({'where':{'id':_[_0x9aae('0x3e')](_0x59dd62,_0x9aae('0x68')),'role':_0x9aae('0x69')},'attributes':['id',_0x9aae('0x3b'),'chatPause',_0x9aae('0x6a'),_0x9aae('0x6b')]});}})['then'](function(_0x51bd1e){if(_0x51bd1e){return{'count':_0x51bd1e['count'],'rows':_['map'](_0x51bd1e[_0x9aae('0x50')],function(_0x13c42b){return{'membername':_0x13c42b[_0x9aae('0x3b')],'UserId':_0x13c42b['id'],'queue_name':_0x39eb44[_0x9aae('0x3b')],'ChatQueueId':_0x39eb44['id'],'interface':util['format'](_0x9aae('0x6c'),'SIP',_0x13c42b[_0x9aae('0x3b')]),'penalty':0x0,'paused':_0x13c42b[_0x9aae('0x6d')],'createdAt':_0x13c42b['createdAt'],'updatedAt':_0x13c42b[_0x9aae('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9aae('0x22')](respondWithFilteredResult(_0x433d53,_0x32c1c0))[_0x9aae('0x51')](handleError(_0x433d53,null));};exports[_0x9aae('0x6e')]=function(_0x4dc615,_0x2ff09d,_0x164f25){var _0x12d93e={};var _0x317649={};var _0x3409f9;var _0x44dc29;return db[_0x9aae('0x4d')][_0x9aae('0x62')]({'where':{'id':_0x4dc615['params']['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x2ff09d,null))[_0x9aae('0x22')](function(_0x25e177){if(_0x25e177){_0x3409f9=_0x25e177;_0x317649['model']=_['keys'](db[_0x9aae('0x6f')][_0x9aae('0x54')]);_0x317649['query']=_[_0x9aae('0x55')](_0x4dc615['query']);_0x317649[_0x9aae('0x49')]=_[_0x9aae('0x56')](_0x317649['model'],_0x317649[_0x9aae('0x41')]);_0x12d93e[_0x9aae('0x43')]=_[_0x9aae('0x56')](_0x317649[_0x9aae('0x40')],qs[_0x9aae('0x42')](_0x4dc615[_0x9aae('0x41')][_0x9aae('0x42')]));_0x12d93e[_0x9aae('0x43')]=_0x12d93e['attributes'][_0x9aae('0x44')]?_0x12d93e[_0x9aae('0x43')]:_0x317649[_0x9aae('0x40')];_0x12d93e[_0x9aae('0x70')]=qs['sort'](_0x4dc615[_0x9aae('0x41')][_0x9aae('0x47')]);_0x12d93e[_0x9aae('0x48')]=qs[_0x9aae('0x49')](_['pick'](_0x4dc615[_0x9aae('0x41')],_0x317649[_0x9aae('0x49')]));if(_0x4dc615[_0x9aae('0x41')][_0x9aae('0x65')]){_0x12d93e['where']=_['merge'](_0x12d93e[_0x9aae('0x48')],{'$or':_[_0x9aae('0x3e')](_0x12d93e[_0x9aae('0x43')],function(_0x3dbec1){var _0x5b6092={};_0x5b6092[_0x3dbec1]={'$like':'%'+_0x4dc615[_0x9aae('0x41')][_0x9aae('0x65')]+'%'};return _0x5b6092;})});}_0x12d93e=_['merge']({},_0x12d93e,_0x4dc615[_0x9aae('0x57')]);return _0x3409f9[_0x9aae('0x6e')](_0x12d93e);}})[_0x9aae('0x22')](function(_0x5edf0d){if(_0x5edf0d){_0x44dc29=_0x5edf0d[_0x9aae('0x44')];if(!_0x4dc615[_0x9aae('0x41')]['hasOwnProperty']('nolimit')){_0x12d93e[_0x9aae('0x31')]=qs[_0x9aae('0x31')](_0x4dc615[_0x9aae('0x41')][_0x9aae('0x31')]);_0x12d93e[_0x9aae('0x2f')]=qs[_0x9aae('0x2f')](_0x4dc615[_0x9aae('0x41')][_0x9aae('0x2f')]);}return _0x3409f9[_0x9aae('0x6e')](_0x12d93e);}})[_0x9aae('0x22')](function(_0x22fe39){if(_0x22fe39){return _0x22fe39?{'count':_0x44dc29,'rows':_0x22fe39}:null;}})[_0x9aae('0x22')](respondWithResult(_0x2ff09d,null))[_0x9aae('0x51')](handleError(_0x2ff09d,null));};exports[_0x9aae('0x71')]=function(_0x17e09b,_0x4ed3b7,_0x338c97){var _0x478664=_0x17e09b[_0x9aae('0x5a')]['ids'];return db[_0x9aae('0x6f')][_0x9aae('0x4f')]({'where':{'id':_0x478664},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x9aae('0x72'),_0x9aae('0x73'),_0x9aae('0x74')],'raw':!![]}]})['then'](function(_0x658818){if(_0x658818){var _0xf80905=_[_0x9aae('0x75')](_0x658818,function(_0x5dbcfb){var _0x9d144b=_0x5dbcfb[_0x9aae('0x39')]({'plain':!![]});return _0x9d144b[_0x9aae('0x76')];});return db[_0x9aae('0x4d')][_0x9aae('0x58')]({'where':{'id':_0x17e09b[_0x9aae('0x53')]['id']}})['then'](function(_0x1687f3){return db[_0x9aae('0x77')][_0x9aae('0x78')](function(_0x12a9c9){return _0x1687f3[_0x9aae('0x71')](_0x478664,{'transaction':_0x12a9c9})['then'](function(){return BPromise[_0x9aae('0x79')](_0xf80905,function(_0x50d52f){return db[_0x9aae('0x66')][_0x9aae('0x7a')]({'where':{'UserId':_0x50d52f['id'],'ChatQueueId':_0x17e09b['params']['id']},'transaction':_0x12a9c9});});})[_0x9aae('0x22')](function(){_0xf80905[_0x9aae('0x7b')](function(_0x34f477){socket[_0x9aae('0x7c')](_0x9aae('0x7d'),{'UserId':_0x34f477['id'],'ChatQueueId':_0x1687f3['id']});});});});});}})[_0x9aae('0x22')](respondWithStatusCode(_0x4ed3b7,null))[_0x9aae('0x51')](handleError(_0x4ed3b7,null));};exports[_0x9aae('0x7e')]=function(_0x513c7b,_0x299606,_0xc6ec6){return db[_0x9aae('0x6f')]['findAll']({'where':{'id':_0x513c7b[_0x9aae('0x41')][_0x9aae('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9aae('0x76'),'attributes':['id'],'raw':!![]}]})[_0x9aae('0x22')](handleEntityNotFound(_0x299606,null))[_0x9aae('0x22')](function(_0x3d4822){var _0x1c17f7=_['map'](_0x3d4822,'id');var _0x4422a9=[];var _0x45720f=[];var _0x270c1b=squel[_0x9aae('0x80')]();_0x270c1b[_0x9aae('0x81')]('tq.TeamId')[_0x9aae('0x82')](_0x9aae('0x83'),'tq')['join'](_0x9aae('0x84'),'ut',_0x9aae('0x85'))[_0x9aae('0x48')](_0x9aae('0x86'),_0x513c7b[_0x9aae('0x53')]['id']);for(var _0x58df27=0x0;_0x58df27<_0x3d4822[_0x9aae('0x44')];_0x58df27+=0x1){let _0x42dc4e=_0x3d4822[_0x58df27];for(var _0x483775=0x0;_0x483775<_0x42dc4e[_0x9aae('0x76')][_0x9aae('0x44')];_0x483775+=0x1){let _0x1e81ef=_0x42dc4e[_0x9aae('0x76')][_0x483775];var _0x104219=_0x270c1b[_0x9aae('0x87')]();_0x104219[_0x9aae('0x48')](_0x9aae('0x88'),_0x1e81ef['id']);_0x45720f[_0x9aae('0x89')](db['sequelize'][_0x9aae('0x41')](_0x104219['toString'](),{'type':db[_0x9aae('0x77')][_0x9aae('0x8a')][_0x9aae('0x8b')]})[_0x9aae('0x22')](function(_0x35ef3a){if(_0x35ef3a[_0x9aae('0x44')]===0x1){return _0x1e81ef['id'];}else{var _0x30291e=_['every'](_[_0x9aae('0x3e')](_0x35ef3a,'TeamId'),function(_0x43f97a){return _[_0x9aae('0x8c')](_0x1c17f7,_0x43f97a);});if(_0x30291e){return _0x1e81ef['id'];}}}));}}return BPromise[_0x9aae('0x8d')](_0x45720f)[_0x9aae('0x22')](function(_0x53d931){_0x4422a9=_(_0x4422a9)[_0x9aae('0x8e')](_0x53d931)[_0x9aae('0x8f')]()['value']();return db[_0x9aae('0x4d')][_0x9aae('0x58')]({'where':{'id':_0x513c7b[_0x9aae('0x53')]['id']}})['then'](function(_0x1d8411){return db['sequelize'][_0x9aae('0x78')](function(_0x397a13){return _0x1d8411[_0x9aae('0x7e')](_0x513c7b[_0x9aae('0x41')][_0x9aae('0x7f')],{'transaction':_0x397a13})[_0x9aae('0x22')](function(){if(!_['isEmpty'](_0x4422a9)){return _0x1d8411[_0x9aae('0x90')](_0x4422a9,{'transaction':_0x397a13});}})[_0x9aae('0x22')](function(){_0x4422a9['forEach'](function(_0x49f429){socket['emit'](_0x9aae('0x91'),{'UserId':_0x49f429,'ChatQueueId':_0x1d8411['id']});});});});});});})[_0x9aae('0x22')](respondWithStatusCode(_0x299606,null))['catch'](handleError(_0x299606,null));};exports[_0x9aae('0x92')]=function(_0x3fa734,_0x517bcf,_0x4f3b17){return db[_0x9aae('0x4d')][_0x9aae('0x58')]({'where':{'id':_0x3fa734[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x517bcf,null))['then'](function(_0xb45f83){if(_0xb45f83){return _0xb45f83['addAgents'](_0x3fa734['body'][_0x9aae('0x7f')],_[_0x9aae('0x93')](_0x3fa734[_0x9aae('0x5a')],[_0x9aae('0x7f'),'id'])||{})[_0x9aae('0x94')](function(_0x119f7c){for(var _0x576755=0x0;_0x576755<_0x3fa734[_0x9aae('0x5a')][_0x9aae('0x7f')][_0x9aae('0x44')];_0x576755+=0x1){socket[_0x9aae('0x7c')](_0x9aae('0x7d'),{'UserId':Number(_0x3fa734[_0x9aae('0x5a')][_0x9aae('0x7f')][_0x576755]),'ChatQueueId':Number(_0x3fa734[_0x9aae('0x53')]['id'])});}return _0x119f7c;});}})['then'](respondWithResult(_0x517bcf,null))[_0x9aae('0x51')](handleError(_0x517bcf,null));};exports[_0x9aae('0x90')]=function(_0x6898f6,_0x41ffc4,_0x134c15){return db[_0x9aae('0x4d')]['find']({'where':{'id':_0x6898f6[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x41ffc4,null))[_0x9aae('0x22')](function(_0x1315e4){if(_0x1315e4){return _0x1315e4[_0x9aae('0x90')](_0x6898f6['query']['ids'])[_0x9aae('0x22')](function(){if(_[_0x9aae('0x95')](_0x6898f6['query'][_0x9aae('0x7f')])){for(var _0x5a3258=0x0;_0x5a3258<_0x6898f6['query'][_0x9aae('0x7f')][_0x9aae('0x44')];_0x5a3258+=0x1){socket[_0x9aae('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x6898f6['query'][_0x9aae('0x7f')][_0x5a3258]),'ChatQueueId':Number(_0x6898f6[_0x9aae('0x53')]['id'])});}}else{socket[_0x9aae('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x6898f6[_0x9aae('0x41')][_0x9aae('0x7f')]),'ChatQueueId':Number(_0x6898f6[_0x9aae('0x53')]['id'])});}});}})[_0x9aae('0x22')](respondWithStatusCode(_0x41ffc4,null))['catch'](handleError(_0x41ffc4,null));};exports[_0x9aae('0x96')]=function(_0x3d1619,_0x10ef4f,_0x18c8cc){var _0x378c25={};var _0x3c8297={};var _0x143d46;var _0x85e8db;return db[_0x9aae('0x4d')][_0x9aae('0x62')]({'where':{'id':_0x3d1619[_0x9aae('0x53')]['id']}})[_0x9aae('0x22')](handleEntityNotFound(_0x10ef4f,null))[_0x9aae('0x22')](function(_0x2af22b){if(_0x2af22b){_0x143d46=_0x2af22b;_0x3c8297[_0x9aae('0x40')]=_[_0x9aae('0x55')](db['User'][_0x9aae('0x54')]);_0x3c8297[_0x9aae('0x41')]=_['keys'](_0x3d1619['query']);_0x3c8297['filters']=_[_0x9aae('0x56')](_0x3c8297[_0x9aae('0x40')],_0x3c8297[_0x9aae('0x41')]);_0x378c25[_0x9aae('0x43')]=_['intersection'](_0x3c8297[_0x9aae('0x40')],qs[_0x9aae('0x42')](_0x3d1619['query'][_0x9aae('0x42')]));_0x378c25['attributes']=_0x378c25['attributes'][_0x9aae('0x44')]?_0x378c25[_0x9aae('0x43')]:_0x3c8297[_0x9aae('0x40')];_0x378c25[_0x9aae('0x70')]=qs[_0x9aae('0x47')](_0x3d1619['query'][_0x9aae('0x47')]);_0x378c25[_0x9aae('0x48')]=qs[_0x9aae('0x49')](_[_0x9aae('0x63')](_0x3d1619[_0x9aae('0x41')],_0x3c8297[_0x9aae('0x49')]));if(_0x3d1619['query']['filter']){_0x378c25['where']=_['merge'](_0x378c25['where'],{'$or':_[_0x9aae('0x3e')](_0x378c25['attributes'],function(_0x2d5036){var _0xb3f916={};_0xb3f916[_0x2d5036]={'$like':'%'+_0x3d1619['query'][_0x9aae('0x65')]+'%'};return _0xb3f916;})});}_0x378c25=_[_0x9aae('0x4a')]({},_0x378c25,_0x3d1619[_0x9aae('0x57')]);return _0x143d46[_0x9aae('0x96')](_0x378c25);}})[_0x9aae('0x22')](function(_0x31f31c){if(_0x31f31c){_0x85e8db=_0x31f31c[_0x9aae('0x44')];if(!_0x3d1619[_0x9aae('0x41')][_0x9aae('0x45')]('nolimit')){_0x378c25[_0x9aae('0x31')]=qs[_0x9aae('0x31')](_0x3d1619['query'][_0x9aae('0x31')]);_0x378c25[_0x9aae('0x2f')]=qs[_0x9aae('0x2f')](_0x3d1619[_0x9aae('0x41')][_0x9aae('0x2f')]);}return _0x143d46[_0x9aae('0x96')](_0x378c25);}})['then'](function(_0x5a1456){if(_0x5a1456){return _0x5a1456?{'count':_0x85e8db,'rows':_0x5a1456}:null;}})[_0x9aae('0x22')](respondWithResult(_0x10ef4f,null))[_0x9aae('0x51')](handleError(_0x10ef4f,null));}; \ No newline at end of file +var _0x1123=['compact','value','removeTeams','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','limit','offset','json','apply','reject','update','ChatQueues','UserProfileResource','destroy','end','stack','name','send','index','ChatQueue','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','count','includeAll','include','findAll','rows','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','merge','User','findAndCountAll','UserId','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','includes','all'];(function(_0x40fc4a,_0x5f2247){var _0x52f56b=function(_0x5ceb0b){while(--_0x5ceb0b){_0x40fc4a['push'](_0x40fc4a['shift']());}};_0x52f56b(++_0x5f2247);}(_0x1123,0x13e));var _0x3112=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1123[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x3112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3112('0x1'));var jsonpatch=require(_0x3112('0x2'));var rp=require(_0x3112('0x3'));var moment=require(_0x3112('0x4'));var BPromise=require(_0x3112('0x5'));var Mustache=require(_0x3112('0x6'));var util=require(_0x3112('0x7'));var path=require('path');var sox=require(_0x3112('0x8'));var csv=require(_0x3112('0x9'));var ejs=require(_0x3112('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3112('0xb'));var crypto=require(_0x3112('0xc'));var jsforce=require(_0x3112('0xd'));var deskjs=require(_0x3112('0xe'));var toCsv=require(_0x3112('0x9'));var querystring=require(_0x3112('0xf'));var Papa=require(_0x3112('0x10'));var Redis=require(_0x3112('0x11'));var authService=require(_0x3112('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3112('0x13'));var hardwareService=require(_0x3112('0x14'));var logger=require(_0x3112('0x15'))(_0x3112('0x16'));var utils=require(_0x3112('0x17'));var config=require(_0x3112('0x18'));var licenseUtil=require(_0x3112('0x19'));var db=require(_0x3112('0x1a'))['db'];config[_0x3112('0x1b')]=_[_0x3112('0x1c')](config[_0x3112('0x1b')],{'host':_0x3112('0x1d'),'port':0x18eb});var socket=require(_0x3112('0x1e'))(new Redis(config[_0x3112('0x1b')]));require(_0x3112('0x1f'))[_0x3112('0x20')](socket);var jayson=require(_0x3112('0x21'));var client=jayson[_0x3112('0x22')][_0x3112('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x16e378,_0x509d97,_0x9e0226,_0x3a1a2a){return new BPromise(function(_0x2cdbb2,_0x33243b){var _0xf36538=_0x3a1a2a||client;return _0xf36538[_0x3112('0x24')](_0x16e378,_0x9e0226)[_0x3112('0x25')](function(_0x4c681f){logger[_0x3112('0x26')](_0x3112('0x27'),_0x509d97,'request\x20sent');logger[_0x3112('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x509d97,_0x3112('0x29'),JSON[_0x3112('0x2a')](_0x4c681f));if(_0x4c681f[_0x3112('0x2b')]){if(_0x4c681f[_0x3112('0x2b')][_0x3112('0x2c')]===0x1f4){logger[_0x3112('0x2b')](_0x3112('0x27'),_0x509d97,_0x4c681f[_0x3112('0x2b')]['message']);return _0x33243b(_0x4c681f[_0x3112('0x2b')][_0x3112('0x2d')]);}logger[_0x3112('0x2b')]('ChatQueue,\x20%s,\x20%s',_0x509d97,_0x4c681f['error'][_0x3112('0x2d')]);return _0x2cdbb2(_0x4c681f['error'][_0x3112('0x2d')]);}else{logger[_0x3112('0x26')](_0x3112('0x27'),_0x509d97,_0x3112('0x29'));_0x2cdbb2(_0x4c681f[_0x3112('0x2e')][_0x3112('0x2d')]);}})[_0x3112('0x2f')](function(_0x1f2fc0){logger[_0x3112('0x2b')](_0x3112('0x27'),_0x509d97,_0x1f2fc0);_0x33243b(_0x1f2fc0);});});}function respondWithStatusCode(_0x60110d,_0x1bcd25){_0x1bcd25=_0x1bcd25||0xcc;return function(_0xd0d9b3){if(_0xd0d9b3){return _0x60110d[_0x3112('0x30')](_0x1bcd25);}return _0x60110d[_0x3112('0x31')](_0x1bcd25)['end']();};}function respondWithResult(_0x20d8ec,_0x9b977a){_0x9b977a=_0x9b977a||0xc8;return function(_0x47640d){if(_0x47640d){return _0x20d8ec['status'](_0x9b977a)['json'](_0x47640d);}};}function respondWithFilteredResult(_0x3e69fc,_0x3f2821){return function(_0x2e76c0){if(_0x2e76c0){var _0x2c13ac=typeof _0x3f2821['offset']==='undefined'&&typeof _0x3f2821[_0x3112('0x32')]==='undefined';var _0x1f971e=_0x2e76c0['count'];var _0x3840bb=_0x2c13ac?0x0:_0x3f2821[_0x3112('0x33')];var _0x3b68ef=_0x2c13ac?_0x2e76c0['count']:_0x3f2821[_0x3112('0x33')]+_0x3f2821[_0x3112('0x32')];var _0x28ef82;if(_0x3b68ef>=_0x1f971e){_0x3b68ef=_0x1f971e;_0x28ef82=0xc8;}else{_0x28ef82=0xce;}_0x3e69fc['status'](_0x28ef82);return _0x3e69fc['set']('Content-Range',_0x3840bb+'-'+_0x3b68ef+'/'+_0x1f971e)[_0x3112('0x34')](_0x2e76c0);}return null;};}function patchUpdates(_0x11d1f1){return function(_0xe36b4f){try{jsonpatch[_0x3112('0x35')](_0xe36b4f,_0x11d1f1,!![]);}catch(_0x57c8a7){return BPromise[_0x3112('0x36')](_0x57c8a7);}return _0xe36b4f['save']();};}function saveUpdates(_0x37be7f,_0x326461){return function(_0x54121d){if(_0x54121d){return _0x54121d[_0x3112('0x37')](_0x37be7f)[_0x3112('0x25')](function(_0x808567){return _0x808567;});}return null;};}function removeEntity(_0x4d05f8,_0x1177db){return function(_0x49a305){if(_0x49a305){return _0x49a305['destroy']()['then'](function(){var _0x13ad5d=_0x49a305['get']({'plain':!![]});var _0x138d97=_0x3112('0x38');return db[_0x3112('0x39')][_0x3112('0x3a')]({'where':{'type':_0x138d97,'resourceId':_0x13ad5d['id']}})[_0x3112('0x25')](function(){return _0x49a305;});})['then'](function(){_0x4d05f8[_0x3112('0x31')](0xcc)[_0x3112('0x3b')]();});}};}function handleEntityNotFound(_0x55afe7,_0x390018){return function(_0x544778){if(!_0x544778){_0x55afe7[_0x3112('0x30')](0x194);}return _0x544778;};}function handleError(_0x1be275,_0xfdacc0){_0xfdacc0=_0xfdacc0||0x1f4;return function(_0x219659){logger['error'](_0x219659[_0x3112('0x3c')]);if(_0x219659[_0x3112('0x3d')]){delete _0x219659[_0x3112('0x3d')];}_0x1be275[_0x3112('0x31')](_0xfdacc0)[_0x3112('0x3e')](_0x219659);};}exports[_0x3112('0x3f')]=function(_0x4e6563,_0x32f69d){var _0x409f3a={},_0xd64a52={},_0x5a13f4={'count':0x0,'rows':[]};var _0x3e5cdc=_['map'](db[_0x3112('0x40')][_0x3112('0x41')],function(_0x2a0366){return{'name':_0x2a0366[_0x3112('0x42')],'type':_0x2a0366['type']['key']};});_0xd64a52[_0x3112('0x43')]=_[_0x3112('0x44')](_0x3e5cdc,_0x3112('0x3d'));_0xd64a52['query']=_[_0x3112('0x45')](_0x4e6563[_0x3112('0x46')]);_0xd64a52[_0x3112('0x47')]=_[_0x3112('0x48')](_0xd64a52[_0x3112('0x43')],_0xd64a52[_0x3112('0x46')]);_0x409f3a[_0x3112('0x49')]=_[_0x3112('0x48')](_0xd64a52[_0x3112('0x43')],qs[_0x3112('0x4a')](_0x4e6563[_0x3112('0x46')][_0x3112('0x4a')]));_0x409f3a[_0x3112('0x49')]=_0x409f3a[_0x3112('0x49')][_0x3112('0x4b')]?_0x409f3a[_0x3112('0x49')]:_0xd64a52[_0x3112('0x43')];if(!_0x4e6563['query'][_0x3112('0x4c')](_0x3112('0x4d'))){_0x409f3a[_0x3112('0x32')]=qs[_0x3112('0x32')](_0x4e6563[_0x3112('0x46')][_0x3112('0x32')]);_0x409f3a['offset']=qs[_0x3112('0x33')](_0x4e6563[_0x3112('0x46')][_0x3112('0x33')]);}_0x409f3a['order']=qs['sort'](_0x4e6563['query'][_0x3112('0x4e')]);_0x409f3a[_0x3112('0x4f')]=qs[_0x3112('0x47')](_[_0x3112('0x50')](_0x4e6563['query'],_0xd64a52[_0x3112('0x47')]),_0x3e5cdc);if(_0x4e6563['query'][_0x3112('0x51')]){_0x409f3a[_0x3112('0x4f')]=_['merge'](_0x409f3a['where'],{'$or':_[_0x3112('0x44')](_0x3e5cdc,function(_0x391c3e){if(_0x391c3e[_0x3112('0x52')]!==_0x3112('0x53')){var _0x453017={};_0x453017[_0x391c3e['name']]={'$like':'%'+_0x4e6563[_0x3112('0x46')][_0x3112('0x51')]+'%'};return _0x453017;}})});}_0x409f3a=_['merge']({},_0x409f3a,_0x4e6563['options']);var _0x2c19e7={'where':_0x409f3a[_0x3112('0x4f')]};return db[_0x3112('0x40')]['count'](_0x2c19e7)[_0x3112('0x25')](function(_0x8b290a){_0x5a13f4[_0x3112('0x54')]=_0x8b290a;if(_0x4e6563[_0x3112('0x46')][_0x3112('0x55')]){_0x409f3a[_0x3112('0x56')]=[{'all':!![]}];}return db[_0x3112('0x40')][_0x3112('0x57')](_0x409f3a);})[_0x3112('0x25')](function(_0x4607a6){_0x5a13f4[_0x3112('0x58')]=_0x4607a6;return _0x5a13f4;})[_0x3112('0x25')](respondWithFilteredResult(_0x32f69d,_0x409f3a))['catch'](handleError(_0x32f69d,null));};exports['show']=function(_0x5cb004,_0x23c5f4){var _0x972d34={'raw':!![],'where':{'id':_0x5cb004[_0x3112('0x59')]['id']}},_0x208930={};_0x208930[_0x3112('0x43')]=_[_0x3112('0x45')](db['ChatQueue'][_0x3112('0x41')]);_0x208930[_0x3112('0x46')]=_[_0x3112('0x45')](_0x5cb004[_0x3112('0x46')]);_0x208930[_0x3112('0x47')]=_[_0x3112('0x48')](_0x208930[_0x3112('0x43')],_0x208930['query']);_0x972d34[_0x3112('0x49')]=_[_0x3112('0x48')](_0x208930[_0x3112('0x43')],qs[_0x3112('0x4a')](_0x5cb004['query'][_0x3112('0x4a')]));_0x972d34[_0x3112('0x49')]=_0x972d34[_0x3112('0x49')][_0x3112('0x4b')]?_0x972d34[_0x3112('0x49')]:_0x208930['model'];if(_0x5cb004['query'][_0x3112('0x55')]){_0x972d34[_0x3112('0x56')]=[{'all':!![]}];}_0x972d34=_['merge']({},_0x972d34,_0x5cb004[_0x3112('0x5a')]);return db['ChatQueue']['find'](_0x972d34)[_0x3112('0x25')](handleEntityNotFound(_0x23c5f4,null))['then'](respondWithResult(_0x23c5f4,null))[_0x3112('0x2f')](handleError(_0x23c5f4,null));};exports[_0x3112('0x5b')]=function(_0x3e2ba6,_0x4590a0){return db[_0x3112('0x40')]['create'](_0x3e2ba6[_0x3112('0x5c')],{})[_0x3112('0x25')](function(_0x299c01){var _0xf0f488=_0x3e2ba6[_0x3112('0x5d')][_0x3112('0x5e')]({'plain':!![]});if(!_0xf0f488)throw new Error(_0x3112('0x5f'));if(_0xf0f488[_0x3112('0x60')]==='user'){var _0x2e2a27=_0x299c01[_0x3112('0x5e')]({'plain':!![]});var _0x1cf11c=_0x3112('0x38');return db[_0x3112('0x61')][_0x3112('0x62')]({'where':{'name':_0x1cf11c,'userProfileId':_0xf0f488['userProfileId']},'raw':!![]})[_0x3112('0x25')](function(_0x2d0ac8){if(_0x2d0ac8&&_0x2d0ac8[_0x3112('0x63')]===0x0){return db['UserProfileResource'][_0x3112('0x5b')]({'name':_0x2e2a27[_0x3112('0x3d')],'resourceId':_0x2e2a27['id'],'type':_0x2d0ac8[_0x3112('0x3d')],'sectionId':_0x2d0ac8['id']},{})[_0x3112('0x25')](function(){return _0x299c01;});}else{return _0x299c01;}})[_0x3112('0x2f')](function(_0x69b41f){logger[_0x3112('0x2b')](_0x3112('0x64'),_0x69b41f);throw _0x69b41f;});}return _0x299c01;})[_0x3112('0x25')](respondWithResult(_0x4590a0,0xc9))[_0x3112('0x2f')](handleError(_0x4590a0,null));};exports['update']=function(_0x5e25c9,_0x5e7e21){if(_0x5e25c9[_0x3112('0x5c')]['id']){delete _0x5e25c9[_0x3112('0x5c')]['id'];}return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x5e25c9[_0x3112('0x59')]['id']}})['then'](handleEntityNotFound(_0x5e7e21,null))['then'](saveUpdates(_0x5e25c9[_0x3112('0x5c')],null))[_0x3112('0x25')](respondWithResult(_0x5e7e21,null))[_0x3112('0x2f')](handleError(_0x5e7e21,null));};exports[_0x3112('0x3a')]=function(_0x3e976f,_0xbfec81){return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x3e976f[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0xbfec81,null))[_0x3112('0x25')](removeEntity(_0xbfec81,null))['catch'](handleError(_0xbfec81,null));};exports[_0x3112('0x65')]=function(_0xfc9036,_0x365b56){return db[_0x3112('0x40')][_0x3112('0x65')]()['then'](respondWithResult(_0x365b56,null))[_0x3112('0x2f')](handleError(_0x365b56,null));};exports[_0x3112('0x66')]=function(_0x431b0f,_0x2ae59f,_0x95cc76){var _0x3b10b4={'raw':!![],'where':{}},_0x38d73c={},_0x571a54;return db[_0x3112('0x40')][_0x3112('0x67')]({'where':{'id':_0x431b0f[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0x2ae59f,null))[_0x3112('0x25')](function(_0x5c8e6){if(_0x5c8e6){_0x571a54=_0x5c8e6['get']({'plain':!![]});_0x38d73c['model']=_[_0x3112('0x45')](db[_0x3112('0x68')][_0x3112('0x41')]);_0x38d73c[_0x3112('0x46')]=_['keys'](_0x431b0f[_0x3112('0x46')]);_0x38d73c['filters']=_[_0x3112('0x48')](_0x38d73c[_0x3112('0x43')],_0x38d73c['query']);_0x3b10b4['attributes']=_[_0x3112('0x48')](_0x38d73c[_0x3112('0x43')],qs[_0x3112('0x4a')](_0x431b0f[_0x3112('0x46')]['fields']));_0x3b10b4[_0x3112('0x49')]=_0x3b10b4[_0x3112('0x49')][_0x3112('0x4b')]?_0x3b10b4[_0x3112('0x49')]:_0x38d73c[_0x3112('0x43')];if(!_0x431b0f[_0x3112('0x46')]['hasOwnProperty'](_0x3112('0x4d'))){_0x3b10b4[_0x3112('0x32')]=qs['limit'](_0x431b0f[_0x3112('0x46')][_0x3112('0x32')]);_0x3b10b4[_0x3112('0x33')]=qs[_0x3112('0x33')](_0x431b0f[_0x3112('0x46')][_0x3112('0x33')]);}_0x3b10b4[_0x3112('0x69')]=qs['sort'](_0x431b0f['query'][_0x3112('0x4e')]);_0x3b10b4[_0x3112('0x4f')]=qs[_0x3112('0x47')](_[_0x3112('0x50')](_0x431b0f[_0x3112('0x46')],_0x38d73c[_0x3112('0x47')]));_0x3b10b4[_0x3112('0x4f')][_0x3112('0x6a')]=_0x5c8e6['id'];if(_0x431b0f[_0x3112('0x46')][_0x3112('0x51')]){_0x3b10b4['where']=_[_0x3112('0x6b')](_0x3b10b4[_0x3112('0x4f')],{'$or':_[_0x3112('0x44')](_0x3b10b4[_0x3112('0x49')],function(_0x543ab6){var _0x1f92ed={};_0x1f92ed[_0x543ab6]={'$like':'%'+_0x431b0f['query'][_0x3112('0x51')]+'%'};return _0x1f92ed;})});}_0x3b10b4=_[_0x3112('0x6b')]({},_0x3b10b4,_0x431b0f[_0x3112('0x5a')]);return db[_0x3112('0x68')][_0x3112('0x57')](_0x3b10b4);}})[_0x3112('0x25')](function(_0x2f8466){if(_0x2f8466){return db[_0x3112('0x6c')][_0x3112('0x6d')]({'where':{'id':_[_0x3112('0x44')](_0x2f8466,_0x3112('0x6e')),'role':'agent'},'attributes':['id',_0x3112('0x3d'),_0x3112('0x6f'),'updatedAt',_0x3112('0x70')]});}})[_0x3112('0x25')](function(_0x265abb){if(_0x265abb){return{'count':_0x265abb[_0x3112('0x54')],'rows':_[_0x3112('0x44')](_0x265abb['rows'],function(_0x191708){return{'membername':_0x191708[_0x3112('0x3d')],'UserId':_0x191708['id'],'queue_name':_0x571a54[_0x3112('0x3d')],'ChatQueueId':_0x571a54['id'],'interface':util[_0x3112('0x71')](_0x3112('0x72'),_0x3112('0x73'),_0x191708['name']),'penalty':0x0,'paused':_0x191708['chatPause'],'createdAt':_0x191708[_0x3112('0x70')],'updatedAt':_0x191708[_0x3112('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3112('0x25')](respondWithFilteredResult(_0x2ae59f,_0x3b10b4))[_0x3112('0x2f')](handleError(_0x2ae59f,null));};exports[_0x3112('0x75')]=function(_0x35e140,_0x40a093,_0x52d33c){var _0x3413cc={};var _0x1bd5ef={};var _0x2ae4dc;var _0x9f9a79;return db['ChatQueue'][_0x3112('0x67')]({'where':{'id':_0x35e140[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0x40a093,null))[_0x3112('0x25')](function(_0x3e4596){if(_0x3e4596){_0x2ae4dc=_0x3e4596;_0x1bd5ef[_0x3112('0x43')]=_[_0x3112('0x45')](db['Team'][_0x3112('0x41')]);_0x1bd5ef[_0x3112('0x46')]=_[_0x3112('0x45')](_0x35e140['query']);_0x1bd5ef[_0x3112('0x47')]=_[_0x3112('0x48')](_0x1bd5ef[_0x3112('0x43')],_0x1bd5ef[_0x3112('0x46')]);_0x3413cc[_0x3112('0x49')]=_[_0x3112('0x48')](_0x1bd5ef['model'],qs['fields'](_0x35e140['query']['fields']));_0x3413cc[_0x3112('0x49')]=_0x3413cc[_0x3112('0x49')][_0x3112('0x4b')]?_0x3413cc[_0x3112('0x49')]:_0x1bd5ef['model'];_0x3413cc[_0x3112('0x69')]=qs[_0x3112('0x4e')](_0x35e140['query'][_0x3112('0x4e')]);_0x3413cc[_0x3112('0x4f')]=qs[_0x3112('0x47')](_[_0x3112('0x50')](_0x35e140[_0x3112('0x46')],_0x1bd5ef['filters']));if(_0x35e140[_0x3112('0x46')][_0x3112('0x51')]){_0x3413cc[_0x3112('0x4f')]=_[_0x3112('0x6b')](_0x3413cc[_0x3112('0x4f')],{'$or':_[_0x3112('0x44')](_0x3413cc[_0x3112('0x49')],function(_0x414876){var _0x7632f6={};_0x7632f6[_0x414876]={'$like':'%'+_0x35e140[_0x3112('0x46')]['filter']+'%'};return _0x7632f6;})});}_0x3413cc=_['merge']({},_0x3413cc,_0x35e140['options']);return _0x2ae4dc[_0x3112('0x75')](_0x3413cc);}})[_0x3112('0x25')](function(_0xaa2b4c){if(_0xaa2b4c){_0x9f9a79=_0xaa2b4c['length'];if(!_0x35e140[_0x3112('0x46')][_0x3112('0x4c')](_0x3112('0x4d'))){_0x3413cc['limit']=qs[_0x3112('0x32')](_0x35e140['query'][_0x3112('0x32')]);_0x3413cc[_0x3112('0x33')]=qs[_0x3112('0x33')](_0x35e140[_0x3112('0x46')][_0x3112('0x33')]);}return _0x2ae4dc[_0x3112('0x75')](_0x3413cc);}})[_0x3112('0x25')](function(_0x21a388){if(_0x21a388){return _0x21a388?{'count':_0x9f9a79,'rows':_0x21a388}:null;}})['then'](respondWithResult(_0x40a093,null))[_0x3112('0x2f')](handleError(_0x40a093,null));};exports[_0x3112('0x76')]=function(_0x2ac3ef,_0x281636,_0xa99fae){var _0x273fc0=_0x2ac3ef[_0x3112('0x5c')][_0x3112('0x77')];return db['Team'][_0x3112('0x57')]({'where':{'id':_0x273fc0},'attributes':['id'],'include':[{'model':db[_0x3112('0x6c')],'as':_0x3112('0x78'),'attributes':['id',_0x3112('0x3d'),_0x3112('0x79'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1b971f){if(_0x1b971f){var _0x57cbaf=_[_0x3112('0x7a')](_0x1b971f,function(_0x5214a7){var _0x1a1d24=_0x5214a7[_0x3112('0x5e')]({'plain':!![]});return _0x1a1d24[_0x3112('0x78')];});return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x2ac3ef[_0x3112('0x59')]['id']}})[_0x3112('0x25')](function(_0x2d3423){return db[_0x3112('0x7b')][_0x3112('0x7c')](function(_0x320ea1){return _0x2d3423[_0x3112('0x76')](_0x273fc0,{'transaction':_0x320ea1})['then'](function(){return BPromise[_0x3112('0x7d')](_0x57cbaf,function(_0x686385){return db[_0x3112('0x68')][_0x3112('0x7e')]({'where':{'UserId':_0x686385['id'],'ChatQueueId':_0x2ac3ef[_0x3112('0x59')]['id']},'transaction':_0x320ea1});});})[_0x3112('0x25')](function(){_0x57cbaf[_0x3112('0x7f')](function(_0x268a75){socket['emit'](_0x3112('0x80'),{'UserId':_0x268a75['id'],'ChatQueueId':_0x2d3423['id']});});});});});}})[_0x3112('0x25')](respondWithStatusCode(_0x281636,null))[_0x3112('0x2f')](handleError(_0x281636,null));};exports['removeTeams']=function(_0x4cdd14,_0xb9cd10,_0x453403){return db['Team'][_0x3112('0x57')]({'where':{'id':_0x4cdd14[_0x3112('0x46')][_0x3112('0x77')]},'attributes':['id'],'include':[{'model':db[_0x3112('0x6c')],'as':_0x3112('0x78'),'attributes':['id'],'raw':!![]}]})[_0x3112('0x25')](handleEntityNotFound(_0xb9cd10,null))[_0x3112('0x25')](function(_0x35227c){var _0x3e2dfb=_['map'](_0x35227c,'id');var _0x4d8f03=[];var _0xc0a748=[];var _0x1a56e3=squel[_0x3112('0x81')]();_0x1a56e3[_0x3112('0x82')](_0x3112('0x83'))[_0x3112('0x84')](_0x3112('0x85'),'tq')['join'](_0x3112('0x86'),'ut',_0x3112('0x87'))['where'](_0x3112('0x88'),_0x4cdd14[_0x3112('0x59')]['id']);for(var _0x3ad83c=0x0;_0x3ad83c<_0x35227c[_0x3112('0x4b')];_0x3ad83c+=0x1){let _0x43e3b8=_0x35227c[_0x3ad83c];for(var _0x2c516a=0x0;_0x2c516a<_0x43e3b8[_0x3112('0x78')][_0x3112('0x4b')];_0x2c516a+=0x1){let _0x14a869=_0x43e3b8[_0x3112('0x78')][_0x2c516a];var _0x531c12=_0x1a56e3[_0x3112('0x89')]();_0x531c12['where'](_0x3112('0x8a'),_0x14a869['id']);_0xc0a748[_0x3112('0x8b')](db[_0x3112('0x7b')][_0x3112('0x46')](_0x531c12[_0x3112('0x8c')](),{'type':db[_0x3112('0x7b')]['QueryTypes']['SELECT']})[_0x3112('0x25')](function(_0x3448a9){if(_0x3448a9[_0x3112('0x4b')]===0x1){return _0x14a869['id'];}else{var _0x1af449=_[_0x3112('0x8d')](_[_0x3112('0x44')](_0x3448a9,'TeamId'),function(_0x302822){return _[_0x3112('0x8e')](_0x3e2dfb,_0x302822);});if(_0x1af449){return _0x14a869['id'];}}}));}}return BPromise[_0x3112('0x8f')](_0xc0a748)[_0x3112('0x25')](function(_0x574a25){_0x4d8f03=_(_0x4d8f03)['union'](_0x574a25)[_0x3112('0x90')]()[_0x3112('0x91')]();return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x4cdd14[_0x3112('0x59')]['id']}})[_0x3112('0x25')](function(_0x10fee8){return db[_0x3112('0x7b')][_0x3112('0x7c')](function(_0x57b9bb){return _0x10fee8[_0x3112('0x92')](_0x4cdd14[_0x3112('0x46')][_0x3112('0x77')],{'transaction':_0x57b9bb})[_0x3112('0x25')](function(){if(!_[_0x3112('0x93')](_0x4d8f03)){return _0x10fee8['removeAgents'](_0x4d8f03,{'transaction':_0x57b9bb});}})['then'](function(){_0x4d8f03[_0x3112('0x7f')](function(_0x86578){socket['emit'](_0x3112('0x94'),{'UserId':_0x86578,'ChatQueueId':_0x10fee8['id']});});});});});});})['then'](respondWithStatusCode(_0xb9cd10,null))[_0x3112('0x2f')](handleError(_0xb9cd10,null));};exports['addAgents']=function(_0x2b6669,_0x306d71,_0xd173eb){return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x2b6669[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0x306d71,null))[_0x3112('0x25')](function(_0x22227e){if(_0x22227e){return _0x22227e[_0x3112('0x95')](_0x2b6669['body']['ids'],_['omit'](_0x2b6669[_0x3112('0x5c')],[_0x3112('0x77'),'id'])||{})[_0x3112('0x96')](function(_0x10293e){for(var _0x9bda6f=0x0;_0x9bda6f<_0x2b6669['body'][_0x3112('0x77')][_0x3112('0x4b')];_0x9bda6f+=0x1){socket['emit'](_0x3112('0x80'),{'UserId':Number(_0x2b6669['body'][_0x3112('0x77')][_0x9bda6f]),'ChatQueueId':Number(_0x2b6669[_0x3112('0x59')]['id'])});}return _0x10293e;});}})['then'](respondWithResult(_0x306d71,null))['catch'](handleError(_0x306d71,null));};exports[_0x3112('0x97')]=function(_0x1f5ef3,_0x3d4465,_0x2dc43c){return db[_0x3112('0x40')][_0x3112('0x62')]({'where':{'id':_0x1f5ef3[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0x3d4465,null))[_0x3112('0x25')](function(_0xa4cff2){if(_0xa4cff2){return _0xa4cff2[_0x3112('0x97')](_0x1f5ef3[_0x3112('0x46')]['ids'])[_0x3112('0x25')](function(){if(_['isArray'](_0x1f5ef3[_0x3112('0x46')][_0x3112('0x77')])){for(var _0x29ab75=0x0;_0x29ab75<_0x1f5ef3[_0x3112('0x46')][_0x3112('0x77')][_0x3112('0x4b')];_0x29ab75+=0x1){socket[_0x3112('0x98')](_0x3112('0x94'),{'UserId':Number(_0x1f5ef3[_0x3112('0x46')]['ids'][_0x29ab75]),'ChatQueueId':Number(_0x1f5ef3[_0x3112('0x59')]['id'])});}}else{socket[_0x3112('0x98')](_0x3112('0x94'),{'UserId':Number(_0x1f5ef3['query'][_0x3112('0x77')]),'ChatQueueId':Number(_0x1f5ef3['params']['id'])});}});}})[_0x3112('0x25')](respondWithStatusCode(_0x3d4465,null))[_0x3112('0x2f')](handleError(_0x3d4465,null));};exports[_0x3112('0x99')]=function(_0x23dc5e,_0x4e6a2e,_0x33010d){var _0x452cc3={};var _0x525067={};var _0xcc94d4;var _0x3896c4;return db[_0x3112('0x40')][_0x3112('0x67')]({'where':{'id':_0x23dc5e[_0x3112('0x59')]['id']}})[_0x3112('0x25')](handleEntityNotFound(_0x4e6a2e,null))['then'](function(_0x3b25e9){if(_0x3b25e9){_0xcc94d4=_0x3b25e9;_0x525067['model']=_['keys'](db[_0x3112('0x6c')][_0x3112('0x41')]);_0x525067[_0x3112('0x46')]=_[_0x3112('0x45')](_0x23dc5e[_0x3112('0x46')]);_0x525067[_0x3112('0x47')]=_[_0x3112('0x48')](_0x525067[_0x3112('0x43')],_0x525067['query']);_0x452cc3[_0x3112('0x49')]=_[_0x3112('0x48')](_0x525067[_0x3112('0x43')],qs[_0x3112('0x4a')](_0x23dc5e[_0x3112('0x46')][_0x3112('0x4a')]));_0x452cc3[_0x3112('0x49')]=_0x452cc3[_0x3112('0x49')][_0x3112('0x4b')]?_0x452cc3[_0x3112('0x49')]:_0x525067['model'];_0x452cc3['order']=qs['sort'](_0x23dc5e['query'][_0x3112('0x4e')]);_0x452cc3['where']=qs[_0x3112('0x47')](_['pick'](_0x23dc5e[_0x3112('0x46')],_0x525067[_0x3112('0x47')]));if(_0x23dc5e['query'][_0x3112('0x51')]){_0x452cc3['where']=_[_0x3112('0x6b')](_0x452cc3[_0x3112('0x4f')],{'$or':_[_0x3112('0x44')](_0x452cc3[_0x3112('0x49')],function(_0x48c573){var _0x20662d={};_0x20662d[_0x48c573]={'$like':'%'+_0x23dc5e[_0x3112('0x46')][_0x3112('0x51')]+'%'};return _0x20662d;})});}_0x452cc3=_[_0x3112('0x6b')]({},_0x452cc3,_0x23dc5e[_0x3112('0x5a')]);return _0xcc94d4[_0x3112('0x99')](_0x452cc3);}})[_0x3112('0x25')](function(_0x2594e1){if(_0x2594e1){_0x3896c4=_0x2594e1[_0x3112('0x4b')];if(!_0x23dc5e[_0x3112('0x46')][_0x3112('0x4c')](_0x3112('0x4d'))){_0x452cc3[_0x3112('0x32')]=qs[_0x3112('0x32')](_0x23dc5e[_0x3112('0x46')][_0x3112('0x32')]);_0x452cc3[_0x3112('0x33')]=qs[_0x3112('0x33')](_0x23dc5e['query'][_0x3112('0x33')]);}return _0xcc94d4[_0x3112('0x99')](_0x452cc3);}})[_0x3112('0x25')](function(_0x187edf){if(_0x187edf){return _0x187edf?{'count':_0x3896c4,'rows':_0x187edf}:null;}})['then'](respondWithResult(_0x4e6a2e,null))[_0x3112('0x2f')](handleError(_0x4e6a2e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1af87a0..d7a63a5 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 _0x94b4=['remove','emit','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x94b4,0x174));var _0x494b=function(_0xc294c4,_0x48f78a){_0xc294c4=_0xc294c4-0x0;var _0x460cf3=_0x94b4[_0xc294c4];return _0x460cf3;};'use strict';var EventEmitter=require(_0x494b('0x0'));var ChatQueue=require(_0x494b('0x1'))['db'][_0x494b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x494b('0x3')](0x0);var events={'afterCreate':_0x494b('0x4'),'afterUpdate':_0x494b('0x5'),'afterDestroy':_0x494b('0x6')};function emitEvent(_0x526dfb){return function(_0xc808,_0x23b906,_0x56d85d){ChatQueueEvents[_0x494b('0x7')](_0x526dfb+':'+_0xc808['id'],_0xc808);ChatQueueEvents[_0x494b('0x7')](_0x526dfb,_0xc808);_0x56d85d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x494b('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xd6ec=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x245aff,_0x179446){var _0x193b51=function(_0x58562a){while(--_0x58562a){_0x245aff['push'](_0x245aff['shift']());}};_0x193b51(++_0x179446);}(_0xd6ec,0x6e));var _0xcd6e=function(_0x24f1a4,_0x3625f5){_0x24f1a4=_0x24f1a4-0x0;var _0x33303c=_0xd6ec[_0x24f1a4];return _0x33303c;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xcd6e('0x0'))['db'][_0xcd6e('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcd6e('0x2')](0x0);var events={'afterCreate':_0xcd6e('0x3'),'afterUpdate':_0xcd6e('0x4'),'afterDestroy':_0xcd6e('0x5')};function emitEvent(_0x20aaf1){return function(_0x19a009,_0x21f717,_0x387831){ChatQueueEvents[_0xcd6e('0x6')](_0x20aaf1+':'+_0x19a009['id'],_0x19a009);ChatQueueEvents[_0xcd6e('0x6')](_0x20aaf1,_0x19a009);_0x387831(null);};}for(var e in events){if(events[_0xcd6e('0x7')](e)){var event=events[e];ChatQueue[_0xcd6e('0x8')](e,emitEvent(event));}}module[_0xcd6e('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index bcb37b2..7b11091 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 _0xbe91=['rimraf','exports','ChatQueue','lodash','util','../../config/logger','api','moment','path'];(function(_0x2a3bbe,_0x455253){var _0x5afbc5=function(_0x6817fb){while(--_0x6817fb){_0x2a3bbe['push'](_0x2a3bbe['shift']());}};_0x5afbc5(++_0x455253);}(_0xbe91,0xb7));var _0x1be9=function(_0x55af0d,_0x5db5c9){_0x55af0d=_0x55af0d-0x0;var _0x245085=_0xbe91[_0x55af0d];return _0x245085;};'use strict';var _=require(_0x1be9('0x0'));var util=require(_0x1be9('0x1'));var logger=require(_0x1be9('0x2'))(_0x1be9('0x3'));var moment=require(_0x1be9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1be9('0x5'));var rimraf=require(_0x1be9('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x1be9('0x7')]=function(_0x1ef159,_0x5ae84f){return _0x1ef159['define'](_0x1be9('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0011=['define','ChatQueue','lodash','util','../../config/logger','moment','bluebird','./chatQueue.attributes','exports'];(function(_0x415e13,_0x19623a){var _0xa3a89=function(_0x43149b){while(--_0x43149b){_0x415e13['push'](_0x415e13['shift']());}};_0xa3a89(++_0x19623a);}(_0x0011,0x1a0));var _0x1001=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0011[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x1001('0x0'));var util=require(_0x1001('0x1'));var logger=require(_0x1001('0x2'))('api');var moment=require(_0x1001('0x3'));var BPromise=require(_0x1001('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(_0x1001('0x5'));module[_0x1001('0x6')]=function(_0x2469e2,_0x1adc34){return _0x2469e2[_0x1001('0x7')](_0x1001('0x8'),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 8776e73..d626fb2 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 _0x020a=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x56e03e,_0xd00a46){var _0x28609a=function(_0x4d0051){while(--_0x4d0051){_0x56e03e['push'](_0x56e03e['shift']());}};_0x28609a(++_0xd00a46);}(_0x020a,0xc9));var _0xa020=function(_0x5f52a4,_0x5706d9){_0x5f52a4=_0x5f52a4-0x0;var _0xde1bce=_0x020a[_0x5f52a4];return _0xde1bce;};'use strict';var _=require(_0xa020('0x0'));var util=require(_0xa020('0x1'));var moment=require(_0xa020('0x2'));var BPromise=require('bluebird');var rs=require(_0xa020('0x3'));var fs=require('fs');var Redis=require(_0xa020('0x4'));var db=require(_0xa020('0x5'))['db'];var utils=require(_0xa020('0x6'));var logger=require(_0xa020('0x7'))(_0xa020('0x8'));var config=require(_0xa020('0x9'));var jayson=require(_0xa020('0xa'));var client=jayson[_0xa020('0xb')][_0xa020('0xc')]({'port':0x232a});config['redis']=_[_0xa020('0xd')](config[_0xa020('0xe')],{'host':_0xa020('0xf'),'port':0x18eb});var socket=require(_0xa020('0x10'))(new Redis(config['redis']));require(_0xa020('0x11'))[_0xa020('0x12')](socket);function respondWithRpcPromise(_0x133c26,_0x10d945,_0x3bb4b6){return new BPromise(function(_0x1f42ed,_0x1cf52a){return client['request'](_0x133c26,_0x3bb4b6)['then'](function(_0x22bf19){logger[_0xa020('0x13')](_0xa020('0x14'),_0x10d945,_0xa020('0x15'));logger[_0xa020('0x16')](_0xa020('0x17'),_0x10d945,_0xa020('0x15'),JSON[_0xa020('0x18')](_0x22bf19));if(_0x22bf19[_0xa020('0x19')]){if(_0x22bf19[_0xa020('0x19')][_0xa020('0x1a')]===0x1f4){logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x22bf19[_0xa020('0x19')]['message']);return _0x1cf52a(_0x22bf19[_0xa020('0x19')][_0xa020('0x1b')]);}logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x22bf19[_0xa020('0x19')][_0xa020('0x1b')]);return _0x1f42ed(_0x22bf19[_0xa020('0x19')]['message']);}else{logger[_0xa020('0x13')](_0xa020('0x14'),_0x10d945,_0xa020('0x15'));_0x1f42ed(_0x22bf19[_0xa020('0x1c')][_0xa020('0x1b')]);}})['catch'](function(_0x2ae88d){logger[_0xa020('0x19')](_0xa020('0x14'),_0x10d945,_0x2ae88d);_0x1cf52a(_0x2ae88d);});});}exports[_0xa020('0x1d')]=function(_0x59c001){var _0x5a18c7=this;return new Promise(function(_0x4ce464,_0x2704b4){return db[_0xa020('0x1e')][_0xa020('0x1f')]({'raw':_0x59c001[_0xa020('0x20')]?_0x59c001['options'][_0xa020('0x21')]===undefined?!![]:![]:!![],'where':_0x59c001['options']?_0x59c001[_0xa020('0x20')][_0xa020('0x22')]||null:null,'attributes':_0x59c001[_0xa020('0x20')]?_0x59c001[_0xa020('0x20')][_0xa020('0x23')]||null:null,'limit':_0x59c001[_0xa020('0x20')]?_0x59c001[_0xa020('0x20')][_0xa020('0x24')]||null:null,'include':_0x59c001[_0xa020('0x20')]?_0x59c001['options'][_0xa020('0x25')]?_[_0xa020('0x26')](_0x59c001[_0xa020('0x20')]['include'],function(_0x30fa91){return{'model':db[_0x30fa91[_0xa020('0x27')]],'as':_0x30fa91['as'],'attributes':_0x30fa91[_0xa020('0x23')],'include':_0x30fa91['include']?_['map'](_0x30fa91[_0xa020('0x25')],function(_0x44f771){return{'model':db[_0x44f771[_0xa020('0x27')]],'as':_0x44f771['as'],'attributes':_0x44f771[_0xa020('0x23')],'include':_0x44f771['include']?_['map'](_0x44f771[_0xa020('0x25')],function(_0x241a8c){return{'model':db[_0x241a8c['model']],'as':_0x241a8c['as'],'attributes':_0x241a8c[_0xa020('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa020('0x28')](function(_0x2567e8){logger[_0xa020('0x13')]('GetChatQueue',_0x59c001);logger['debug'](_0xa020('0x1d'),_0x59c001,JSON['stringify'](_0x2567e8));_0x4ce464(_0x2567e8);})[_0xa020('0x29')](function(_0x39e8cb){logger[_0xa020('0x19')]('GetChatQueue',_0x39e8cb[_0xa020('0x1b')],_0x59c001);_0x2704b4(_0x5a18c7[_0xa020('0x19')](0x1f4,_0x39e8cb[_0xa020('0x1b')]));});});};exports[_0xa020('0x2a')]=function(_0x34cc23){var _0x2298d0=this;return new Promise(function(_0x552a1e,_0x490e82){return db[_0xa020('0x1e')][_0xa020('0x2b')]({'raw':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x21')]===undefined?!![]:![]:!![],'where':_0x34cc23[_0xa020('0x20')]?_0x34cc23['options']['where']||null:null,'attributes':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x23')]||null:null,'include':_0x34cc23[_0xa020('0x20')]?_0x34cc23[_0xa020('0x20')][_0xa020('0x25')]?_[_0xa020('0x26')](_0x34cc23[_0xa020('0x20')]['include'],function(_0x16a433){return{'model':db[_0x16a433['model']],'as':_0x16a433['as'],'attributes':_0x16a433[_0xa020('0x23')],'include':_0x16a433[_0xa020('0x25')]?_[_0xa020('0x26')](_0x16a433[_0xa020('0x25')],function(_0xaca9f1){return{'model':db[_0xaca9f1[_0xa020('0x27')]],'as':_0xaca9f1['as'],'attributes':_0xaca9f1['attributes'],'include':_0xaca9f1[_0xa020('0x25')]?_['map'](_0xaca9f1['include'],function(_0x13beb2){return{'model':db[_0x13beb2['model']],'as':_0x13beb2['as'],'attributes':_0x13beb2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa020('0x28')](function(_0x209d5e){logger['info'](_0xa020('0x2a'),_0x34cc23);logger['debug'](_0xa020('0x2a'),_0x34cc23,JSON[_0xa020('0x18')](_0x209d5e));_0x552a1e(_0x209d5e);})[_0xa020('0x29')](function(_0x1e4294){logger['error'](_0xa020('0x2a'),_0x1e4294[_0xa020('0x1b')],_0x34cc23);_0x490e82(_0x2298d0[_0xa020('0x19')](0x1f4,_0x1e4294['message']));});});}; \ No newline at end of file +var _0xe4c0=['attributes','limit','include','map','model','stringify','catch','ShowChatQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','raw'];(function(_0x4b0cdc,_0x2e85e2){var _0x59969d=function(_0xccb839){while(--_0xccb839){_0x4b0cdc['push'](_0x4b0cdc['shift']());}};_0x59969d(++_0x2e85e2);}(_0xe4c0,0x10c));var _0x0e4c=function(_0x2ddb6d,_0x25d45b){_0x2ddb6d=_0x2ddb6d-0x0;var _0x56c103=_0xe4c0[_0x2ddb6d];return _0x56c103;};'use strict';var _=require(_0x0e4c('0x0'));var util=require(_0x0e4c('0x1'));var moment=require(_0x0e4c('0x2'));var BPromise=require(_0x0e4c('0x3'));var rs=require(_0x0e4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e4c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e4c('0x6'))('rpc');var config=require(_0x0e4c('0x7'));var jayson=require(_0x0e4c('0x8'));var client=jayson[_0x0e4c('0x9')][_0x0e4c('0xa')]({'port':0x232a});config[_0x0e4c('0xb')]=_[_0x0e4c('0xc')](config[_0x0e4c('0xb')],{'host':_0x0e4c('0xd'),'port':0x18eb});var socket=require(_0x0e4c('0xe'))(new Redis(config[_0x0e4c('0xb')]));require(_0x0e4c('0xf'))[_0x0e4c('0x10')](socket);function respondWithRpcPromise(_0x2f0640,_0x448e8d,_0x475a25){return new BPromise(function(_0x32271c,_0x5223ec){return client[_0x0e4c('0x11')](_0x2f0640,_0x475a25)[_0x0e4c('0x12')](function(_0x3ab483){logger[_0x0e4c('0x13')]('ChatQueue,\x20%s,\x20%s',_0x448e8d,'request\x20sent');logger[_0x0e4c('0x14')](_0x0e4c('0x15'),_0x448e8d,_0x0e4c('0x16'),JSON['stringify'](_0x3ab483));if(_0x3ab483[_0x0e4c('0x17')]){if(_0x3ab483['error'][_0x0e4c('0x18')]===0x1f4){logger[_0x0e4c('0x17')]('ChatQueue,\x20%s,\x20%s',_0x448e8d,_0x3ab483[_0x0e4c('0x17')][_0x0e4c('0x19')]);return _0x5223ec(_0x3ab483[_0x0e4c('0x17')][_0x0e4c('0x19')]);}logger[_0x0e4c('0x17')](_0x0e4c('0x1a'),_0x448e8d,_0x3ab483['error'][_0x0e4c('0x19')]);return _0x32271c(_0x3ab483[_0x0e4c('0x17')][_0x0e4c('0x19')]);}else{logger[_0x0e4c('0x13')](_0x0e4c('0x1a'),_0x448e8d,'request\x20sent');_0x32271c(_0x3ab483[_0x0e4c('0x1b')][_0x0e4c('0x19')]);}})['catch'](function(_0x8012d9){logger['error'](_0x0e4c('0x1a'),_0x448e8d,_0x8012d9);_0x5223ec(_0x8012d9);});});}exports[_0x0e4c('0x1c')]=function(_0x3c325b){var _0x19954d=this;return new Promise(function(_0x3690b9,_0xcf6a7b){return db[_0x0e4c('0x1d')][_0x0e4c('0x1e')]({'raw':_0x3c325b[_0x0e4c('0x1f')]?_0x3c325b[_0x0e4c('0x1f')][_0x0e4c('0x20')]===undefined?!![]:![]:!![],'where':_0x3c325b[_0x0e4c('0x1f')]?_0x3c325b['options']['where']||null:null,'attributes':_0x3c325b[_0x0e4c('0x1f')]?_0x3c325b[_0x0e4c('0x1f')][_0x0e4c('0x21')]||null:null,'limit':_0x3c325b[_0x0e4c('0x1f')]?_0x3c325b[_0x0e4c('0x1f')][_0x0e4c('0x22')]||null:null,'include':_0x3c325b[_0x0e4c('0x1f')]?_0x3c325b['options'][_0x0e4c('0x23')]?_[_0x0e4c('0x24')](_0x3c325b[_0x0e4c('0x1f')]['include'],function(_0x5995fd){return{'model':db[_0x5995fd[_0x0e4c('0x25')]],'as':_0x5995fd['as'],'attributes':_0x5995fd[_0x0e4c('0x21')],'include':_0x5995fd[_0x0e4c('0x23')]?_[_0x0e4c('0x24')](_0x5995fd[_0x0e4c('0x23')],function(_0x503355){return{'model':db[_0x503355[_0x0e4c('0x25')]],'as':_0x503355['as'],'attributes':_0x503355[_0x0e4c('0x21')],'include':_0x503355[_0x0e4c('0x23')]?_[_0x0e4c('0x24')](_0x503355[_0x0e4c('0x23')],function(_0x21887c){return{'model':db[_0x21887c[_0x0e4c('0x25')]],'as':_0x21887c['as'],'attributes':_0x21887c[_0x0e4c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0e4c('0x12')](function(_0x128553){logger[_0x0e4c('0x13')]('GetChatQueue',_0x3c325b);logger[_0x0e4c('0x14')](_0x0e4c('0x1c'),_0x3c325b,JSON[_0x0e4c('0x26')](_0x128553));_0x3690b9(_0x128553);})[_0x0e4c('0x27')](function(_0x24ca83){logger[_0x0e4c('0x17')](_0x0e4c('0x1c'),_0x24ca83[_0x0e4c('0x19')],_0x3c325b);_0xcf6a7b(_0x19954d['error'](0x1f4,_0x24ca83[_0x0e4c('0x19')]));});});};exports[_0x0e4c('0x28')]=function(_0x1d6047){var _0x4b7047=this;return new Promise(function(_0x1c1d78,_0x33abf3){return db[_0x0e4c('0x1d')][_0x0e4c('0x29')]({'raw':_0x1d6047['options']?_0x1d6047[_0x0e4c('0x1f')][_0x0e4c('0x20')]===undefined?!![]:![]:!![],'where':_0x1d6047[_0x0e4c('0x1f')]?_0x1d6047[_0x0e4c('0x1f')][_0x0e4c('0x2a')]||null:null,'attributes':_0x1d6047[_0x0e4c('0x1f')]?_0x1d6047[_0x0e4c('0x1f')][_0x0e4c('0x21')]||null:null,'include':_0x1d6047[_0x0e4c('0x1f')]?_0x1d6047['options'][_0x0e4c('0x23')]?_[_0x0e4c('0x24')](_0x1d6047['options'][_0x0e4c('0x23')],function(_0x535a4e){return{'model':db[_0x535a4e[_0x0e4c('0x25')]],'as':_0x535a4e['as'],'attributes':_0x535a4e[_0x0e4c('0x21')],'include':_0x535a4e[_0x0e4c('0x23')]?_['map'](_0x535a4e[_0x0e4c('0x23')],function(_0x15a541){return{'model':db[_0x15a541[_0x0e4c('0x25')]],'as':_0x15a541['as'],'attributes':_0x15a541[_0x0e4c('0x21')],'include':_0x15a541[_0x0e4c('0x23')]?_[_0x0e4c('0x24')](_0x15a541[_0x0e4c('0x23')],function(_0x46da35){return{'model':db[_0x46da35['model']],'as':_0x46da35['as'],'attributes':_0x46da35['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fbbc6){logger[_0x0e4c('0x13')](_0x0e4c('0x28'),_0x1d6047);logger[_0x0e4c('0x14')](_0x0e4c('0x28'),_0x1d6047,JSON['stringify'](_0x2fbbc6));_0x1c1d78(_0x2fbbc6);})['catch'](function(_0x490114){logger['error']('ShowChatQueue',_0x490114['message'],_0x1d6047);_0x33abf3(_0x4b7047[_0x0e4c('0x17')](0x1f4,_0x490114[_0x0e4c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index cafcb5d..6916e86 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 _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x4497cd,_0x4a2208){var _0x3c6c43=function(_0x6a8fda){while(--_0x6a8fda){_0x4497cd['push'](_0x4497cd['shift']());}};_0x3c6c43(++_0x4a2208);}(_0xc368,0x7b));var _0x8c36=function(_0x2b08c0,_0x905d08){_0x2b08c0=_0x2b08c0-0x0;var _0x5ae759=_0xc368[_0x2b08c0];return _0x5ae759;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}}; \ No newline at end of file +var _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xc368,0x7b));var _0x8c36=function(_0x30625e,_0x5a5b44){_0x30625e=_0x30625e-0x0;var _0x44b13f=_0xc368[_0x30625e];return _0x44b13f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5aed0ac..fb58ee3 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x36c9c4,_0x5c6d32){var _0x253490=function(_0x1875a7){while(--_0x1875a7){_0x36c9c4['push'](_0x36c9c4['shift']());}};_0x253490(++_0x5c6d32);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _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(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x5fc3[_0x14a0a0];return _0x56b651;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index fa493b5..b3c1329 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 _0x8cce=['STRING','DATE','moment','sequelize'];(function(_0x19738a,_0x562adf){var _0x1633fa=function(_0x5883cd){while(--_0x5883cd){_0x19738a['push'](_0x19738a['shift']());}};_0x1633fa(++_0x562adf);}(_0x8cce,0xee));var _0xe8cc=function(_0x29d92b,_0x16d171){_0x29d92b=_0x29d92b-0x0;var _0x2e0777=_0x8cce[_0x29d92b];return _0x2e0777;};'use strict';var moment=require(_0xe8cc('0x0'));var Sequelize=require(_0xe8cc('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe8cc('0x2')]},'joinAt':{'type':Sequelize[_0xe8cc('0x3')]},'leaveAt':{'type':Sequelize[_0xe8cc('0x3')]},'acceptAt':{'type':Sequelize[_0xe8cc('0x3')]},'exitAt':{'type':Sequelize[_0xe8cc('0x3')]},'reason':{'type':Sequelize[_0xe8cc('0x2')]}}; \ No newline at end of file +var _0xc675=['sequelize','exports','STRING','DATE','moment'];(function(_0x3d9de8,_0x26defd){var _0x2746f1=function(_0x54c93e){while(--_0x54c93e){_0x3d9de8['push'](_0x3d9de8['shift']());}};_0x2746f1(++_0x26defd);}(_0xc675,0xd1));var _0x5c67=function(_0x50e7bd,_0x226bae){_0x50e7bd=_0x50e7bd-0x0;var _0x2d462b=_0xc675[_0x50e7bd];return _0x2d462b;};'use strict';var moment=require(_0x5c67('0x0'));var Sequelize=require(_0x5c67('0x1'));module[_0x5c67('0x2')]={'uniqueid':{'type':Sequelize[_0x5c67('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c67('0x3')]},'joinAt':{'type':Sequelize[_0x5c67('0x4')]},'leaveAt':{'type':Sequelize[_0x5c67('0x4')]},'acceptAt':{'type':Sequelize[_0x5c67('0x4')]},'exitAt':{'type':Sequelize[_0x5c67('0x4')]},'reason':{'type':Sequelize[_0x5c67('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 4ab6bff..2c0fc72 100644 --- a/server/api/chatQueueReport/chatQueueReport.controller.js +++ b/server/api/chatQueueReport/chatQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa498=['params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0xa498,0x179));var _0x8a49=function(_0x3b4455,_0x3e4395){_0x3b4455=_0x3b4455-0x0;var _0x34dd09=_0xa498[_0x3b4455];return _0x34dd09;};'use strict';var emlformat=require(_0x8a49('0x0'));var rimraf=require(_0x8a49('0x1'));var zipdir=require(_0x8a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a49('0x3'));var moment=require(_0x8a49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8a49('0x5'));var util=require(_0x8a49('0x6'));var path=require(_0x8a49('0x7'));var sox=require(_0x8a49('0x8'));var csv=require(_0x8a49('0x9'));var ejs=require(_0x8a49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a49('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a49('0xc'));var deskjs=require(_0x8a49('0xd'));var toCsv=require(_0x8a49('0x9'));var querystring=require(_0x8a49('0xe'));var Papa=require(_0x8a49('0xf'));var Redis=require(_0x8a49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x11'));var as=require(_0x8a49('0x12'));var hardwareService=require(_0x8a49('0x13'));var logger=require(_0x8a49('0x14'))(_0x8a49('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a49('0x16'))['db'];function respondWithStatusCode(_0x5b7fe8,_0x408ca9){_0x408ca9=_0x408ca9||0xcc;return function(_0x5c7d24){if(_0x5c7d24){return _0x5b7fe8['sendStatus'](_0x408ca9);}return _0x5b7fe8[_0x8a49('0x17')](_0x408ca9)[_0x8a49('0x18')]();};}function respondWithResult(_0x57bcb3,_0x45b414){_0x45b414=_0x45b414||0xc8;return function(_0x3e4e73){if(_0x3e4e73){return _0x57bcb3['status'](_0x45b414)[_0x8a49('0x19')](_0x3e4e73);}};}function respondWithFilteredResult(_0x424925,_0x4a6aec){return function(_0x1fdaf4){if(_0x1fdaf4){var _0x50a72d=typeof _0x4a6aec[_0x8a49('0x1a')]==='undefined'&&typeof _0x4a6aec['limit']==='undefined';var _0x18f466=_0x1fdaf4[_0x8a49('0x1b')];var _0x563bbc=_0x50a72d?0x0:_0x4a6aec[_0x8a49('0x1a')];var _0x22f569=_0x50a72d?_0x1fdaf4[_0x8a49('0x1b')]:_0x4a6aec[_0x8a49('0x1a')]+_0x4a6aec[_0x8a49('0x1c')];var _0x42c2a5;if(_0x22f569>=_0x18f466){_0x22f569=_0x18f466;_0x42c2a5=0xc8;}else{_0x42c2a5=0xce;}_0x424925['status'](_0x42c2a5);return _0x424925[_0x8a49('0x1d')]('Content-Range',_0x563bbc+'-'+_0x22f569+'/'+_0x18f466)[_0x8a49('0x19')](_0x1fdaf4);}return null;};}function patchUpdates(_0x254d6e){return function(_0x49526a){try{jsonpatch['apply'](_0x49526a,_0x254d6e,!![]);}catch(_0x14bfb2){return BPromise[_0x8a49('0x1e')](_0x14bfb2);}return _0x49526a[_0x8a49('0x1f')]();};}function saveUpdates(_0x3659da,_0xcebf3e){return function(_0x4e0bf1){if(_0x4e0bf1){return _0x4e0bf1[_0x8a49('0x20')](_0x3659da)[_0x8a49('0x21')](function(_0x19f79b){return _0x19f79b;});}return null;};}function removeEntity(_0x2d47f4,_0x4b895f){return function(_0x19431c){if(_0x19431c){return _0x19431c[_0x8a49('0x22')]()[_0x8a49('0x21')](function(){_0x2d47f4[_0x8a49('0x17')](0xcc)[_0x8a49('0x18')]();});}};}function handleEntityNotFound(_0x493380,_0x4d177a){return function(_0x4304d4){if(!_0x4304d4){_0x493380[_0x8a49('0x23')](0x194);}return _0x4304d4;};}function handleError(_0x5de9a2,_0x385a06){_0x385a06=_0x385a06||0x1f4;return function(_0x1a8e0b){logger[_0x8a49('0x24')](_0x1a8e0b[_0x8a49('0x25')]);if(_0x1a8e0b['name']){delete _0x1a8e0b[_0x8a49('0x26')];}_0x5de9a2[_0x8a49('0x17')](_0x385a06)[_0x8a49('0x27')](_0x1a8e0b);};}exports[_0x8a49('0x28')]=function(_0x59e4a9,_0x1dc14a){var _0x31673a={},_0x3eadad={},_0x1b181b={'count':0x0,'rows':[]};var _0x477c36=_[_0x8a49('0x29')](db[_0x8a49('0x2a')]['rawAttributes'],function(_0x4f256e){return{'name':_0x4f256e[_0x8a49('0x2b')],'type':_0x4f256e[_0x8a49('0x2c')][_0x8a49('0x2d')]};});_0x3eadad[_0x8a49('0x2e')]=_['map'](_0x477c36,_0x8a49('0x26'));_0x3eadad[_0x8a49('0x2f')]=_[_0x8a49('0x30')](_0x59e4a9[_0x8a49('0x2f')]);_0x3eadad[_0x8a49('0x31')]=_['intersection'](_0x3eadad[_0x8a49('0x2e')],_0x3eadad['query']);_0x31673a[_0x8a49('0x32')]=_[_0x8a49('0x33')](_0x3eadad[_0x8a49('0x2e')],qs[_0x8a49('0x34')](_0x59e4a9['query'][_0x8a49('0x34')]));_0x31673a[_0x8a49('0x32')]=_0x31673a[_0x8a49('0x32')][_0x8a49('0x35')]?_0x31673a[_0x8a49('0x32')]:_0x3eadad['model'];if(!_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x36')](_0x8a49('0x37'))){_0x31673a[_0x8a49('0x1c')]=qs['limit'](_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x1c')]);_0x31673a['offset']=qs['offset'](_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x1a')]);}_0x31673a[_0x8a49('0x38')]=qs[_0x8a49('0x39')](_0x59e4a9['query'][_0x8a49('0x39')]);_0x31673a['where']=qs[_0x8a49('0x31')](_[_0x8a49('0x3a')](_0x59e4a9[_0x8a49('0x2f')],_0x3eadad[_0x8a49('0x31')]),_0x477c36);if(_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x3b')]){_0x31673a[_0x8a49('0x3c')]=_[_0x8a49('0x3d')](_0x31673a[_0x8a49('0x3c')],{'$or':_[_0x8a49('0x29')](_0x477c36,function(_0x4c08a5){if(_0x4c08a5[_0x8a49('0x2c')]!==_0x8a49('0x3e')){var _0x34d9f7={};_0x34d9f7[_0x4c08a5[_0x8a49('0x26')]]={'$like':'%'+_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x3b')]+'%'};return _0x34d9f7;}})});}_0x31673a=_[_0x8a49('0x3d')]({},_0x31673a,_0x59e4a9[_0x8a49('0x3f')]);var _0x63271b={'where':_0x31673a[_0x8a49('0x3c')]};return db[_0x8a49('0x2a')]['count'](_0x63271b)[_0x8a49('0x21')](function(_0x5dc751){_0x1b181b[_0x8a49('0x1b')]=_0x5dc751;if(_0x59e4a9[_0x8a49('0x2f')][_0x8a49('0x40')]){_0x31673a[_0x8a49('0x41')]=[{'all':!![]}];}return db[_0x8a49('0x2a')][_0x8a49('0x42')](_0x31673a);})[_0x8a49('0x21')](function(_0xfad17b){_0x1b181b[_0x8a49('0x43')]=_0xfad17b;return _0x1b181b;})[_0x8a49('0x21')](respondWithFilteredResult(_0x1dc14a,_0x31673a))[_0x8a49('0x44')](handleError(_0x1dc14a,null));};exports[_0x8a49('0x45')]=function(_0xa8fbc2,_0xde8f5d){var _0x42225f={'raw':!![],'where':{'id':_0xa8fbc2['params']['id']}},_0x5d1d55={};_0x5d1d55[_0x8a49('0x2e')]=_[_0x8a49('0x30')](db[_0x8a49('0x2a')]['rawAttributes']);_0x5d1d55[_0x8a49('0x2f')]=_['keys'](_0xa8fbc2[_0x8a49('0x2f')]);_0x5d1d55[_0x8a49('0x31')]=_[_0x8a49('0x33')](_0x5d1d55[_0x8a49('0x2e')],_0x5d1d55[_0x8a49('0x2f')]);_0x42225f[_0x8a49('0x32')]=_[_0x8a49('0x33')](_0x5d1d55[_0x8a49('0x2e')],qs[_0x8a49('0x34')](_0xa8fbc2[_0x8a49('0x2f')][_0x8a49('0x34')]));_0x42225f['attributes']=_0x42225f[_0x8a49('0x32')][_0x8a49('0x35')]?_0x42225f[_0x8a49('0x32')]:_0x5d1d55[_0x8a49('0x2e')];if(_0xa8fbc2[_0x8a49('0x2f')]['includeAll']){_0x42225f[_0x8a49('0x41')]=[{'all':!![]}];}_0x42225f=_[_0x8a49('0x3d')]({},_0x42225f,_0xa8fbc2[_0x8a49('0x3f')]);return db['ChatQueueReport']['find'](_0x42225f)[_0x8a49('0x21')](handleEntityNotFound(_0xde8f5d,null))[_0x8a49('0x21')](respondWithResult(_0xde8f5d,null))['catch'](handleError(_0xde8f5d,null));};exports[_0x8a49('0x46')]=function(_0x34aeb9,_0x3c7b36){return db[_0x8a49('0x2a')][_0x8a49('0x46')](_0x34aeb9[_0x8a49('0x47')],{})[_0x8a49('0x21')](respondWithResult(_0x3c7b36,0xc9))[_0x8a49('0x44')](handleError(_0x3c7b36,null));};exports[_0x8a49('0x20')]=function(_0x362d8f,_0x5e727e){if(_0x362d8f['body']['id']){delete _0x362d8f[_0x8a49('0x47')]['id'];}return db[_0x8a49('0x2a')][_0x8a49('0x48')]({'where':{'id':_0x362d8f[_0x8a49('0x49')]['id']}})[_0x8a49('0x21')](handleEntityNotFound(_0x5e727e,null))[_0x8a49('0x21')](saveUpdates(_0x362d8f[_0x8a49('0x47')],null))[_0x8a49('0x21')](respondWithResult(_0x5e727e,null))[_0x8a49('0x44')](handleError(_0x5e727e,null));};exports[_0x8a49('0x22')]=function(_0x5d2dbb,_0x1923a5){return db[_0x8a49('0x2a')][_0x8a49('0x48')]({'where':{'id':_0x5d2dbb[_0x8a49('0x49')]['id']}})['then'](handleEntityNotFound(_0x1923a5,null))[_0x8a49('0x21')](removeEntity(_0x1923a5,null))[_0x8a49('0x44')](handleError(_0x1923a5,null));};exports[_0x8a49('0x4a')]=function(_0xa78845,_0x458b26){return db[_0x8a49('0x2a')][_0x8a49('0x4a')]()['then'](respondWithResult(_0x458b26,null))['catch'](handleError(_0x458b26,null));}; \ No newline at end of file +var _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x33d913,_0x7adb23){var _0x3c093e=function(_0x3263fe){while(--_0x3263fe){_0x33d913['push'](_0x33d913['shift']());}};_0x3c093e(++_0x7adb23);}(_0xdf55,0x83));var _0x5df5=function(_0x149a41,_0x3cbb44){_0x149a41=_0x149a41-0x0;var _0x10132c=_0xdf55[_0x149a41];return _0x10132c;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['ChatQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 4dabc74..d7ff573 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0xe706,0xa3));var _0x6e70=function(_0xeb0035,_0x2c3d9a){_0xeb0035=_0xeb0035-0x0;var _0x190e57=_0xe706[_0xeb0035];return _0x190e57;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x450de6,_0x513b1d){var _0x341350=function(_0x5a94b9){while(--_0x5a94b9){_0x450de6['push'](_0x450de6['shift']());}};_0x341350(++_0x513b1d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c1c5db2..ba20a3d 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 _0xf289=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatQueueReport','create','body','catch','UpdateChatQueueReport','ChatQueueReport','update','options','raw','where','limit'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xf289,0x132));var _0x9f28=function(_0x114d21,_0x2dd56c){_0x114d21=_0x114d21-0x0;var _0x189038=_0xf289[_0x114d21];return _0x189038;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f28('0x2'));var fs=require('fs');var Redis=require(_0x9f28('0x3'));var db=require(_0x9f28('0x4'))['db'];var utils=require(_0x9f28('0x5'));var logger=require(_0x9f28('0x6'))(_0x9f28('0x7'));var config=require(_0x9f28('0x8'));var jayson=require(_0x9f28('0x9'));var client=jayson[_0x9f28('0xa')][_0x9f28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c5ae5,_0x233e1d,_0x8e5cde){return new BPromise(function(_0x183370,_0x235ae9){return client[_0x9f28('0xc')](_0x1c5ae5,_0x8e5cde)[_0x9f28('0xd')](function(_0x4e018c){logger[_0x9f28('0xe')](_0x9f28('0xf'),_0x233e1d,_0x9f28('0x10'));logger[_0x9f28('0x11')](_0x9f28('0x12'),_0x233e1d,_0x9f28('0x10'),JSON[_0x9f28('0x13')](_0x4e018c));if(_0x4e018c[_0x9f28('0x14')]){if(_0x4e018c[_0x9f28('0x14')][_0x9f28('0x15')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x233e1d,_0x4e018c[_0x9f28('0x14')]['message']);return _0x235ae9(_0x4e018c['error'][_0x9f28('0x16')]);}logger[_0x9f28('0x14')](_0x9f28('0xf'),_0x233e1d,_0x4e018c[_0x9f28('0x14')][_0x9f28('0x16')]);return _0x183370(_0x4e018c[_0x9f28('0x14')][_0x9f28('0x16')]);}else{logger[_0x9f28('0xe')](_0x9f28('0xf'),_0x233e1d,_0x9f28('0x10'));_0x183370(_0x4e018c['result']['message']);}})['catch'](function(_0x2ae20f){logger[_0x9f28('0x14')](_0x9f28('0xf'),_0x233e1d,_0x2ae20f);_0x235ae9(_0x2ae20f);});});}exports[_0x9f28('0x17')]=function(_0x3bb71){var _0x1c71e2=this;return new Promise(function(_0xbe0cb8,_0x55f210){return db['ChatQueueReport'][_0x9f28('0x18')](_0x3bb71[_0x9f28('0x19')],{'raw':_0x3bb71['options']?_0x3bb71['options']['raw']===undefined?!![]:![]:!![]})[_0x9f28('0xd')](function(_0x8f491e){logger['info'](_0x9f28('0x17'),_0x3bb71);logger[_0x9f28('0x11')](_0x9f28('0x17'),_0x3bb71,JSON['stringify'](_0x8f491e));_0xbe0cb8(_0x8f491e);})[_0x9f28('0x1a')](function(_0x2b9b63){logger[_0x9f28('0x14')](_0x9f28('0x17'),_0x2b9b63[_0x9f28('0x16')],_0x3bb71);_0x55f210(_0x1c71e2['error'](0x1f4,_0x2b9b63[_0x9f28('0x16')]));});});};exports[_0x9f28('0x1b')]=function(_0x5d6ff4){var _0x487c94=this;return new Promise(function(_0x4f461f,_0x15682d){return db[_0x9f28('0x1c')][_0x9f28('0x1d')](_0x5d6ff4['body'],{'raw':_0x5d6ff4[_0x9f28('0x1e')]?_0x5d6ff4[_0x9f28('0x1e')][_0x9f28('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d6ff4[_0x9f28('0x1e')]?_0x5d6ff4[_0x9f28('0x1e')][_0x9f28('0x20')]||null:null,'attributes':_0x5d6ff4[_0x9f28('0x1e')]?_0x5d6ff4[_0x9f28('0x1e')]['attributes']||null:null,'limit':_0x5d6ff4['options']?_0x5d6ff4['options'][_0x9f28('0x21')]||null:null})[_0x9f28('0xd')](function(_0x3e68ba){logger[_0x9f28('0xe')](_0x9f28('0x1b'),_0x5d6ff4);logger[_0x9f28('0x11')](_0x9f28('0x1b'),_0x5d6ff4,JSON['stringify'](_0x3e68ba));_0x4f461f(_0x3e68ba);})[_0x9f28('0x1a')](function(_0x4633d5){logger[_0x9f28('0x14')](_0x9f28('0x1b'),_0x4633d5[_0x9f28('0x16')],_0x5d6ff4);_0x15682d(_0x487c94[_0x9f28('0x14')](0x1f4,_0x4633d5[_0x9f28('0x16')]));});});}; \ No newline at end of file +var _0x4ed8=['create','body','options','raw','then','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x29faad,_0x104fe6){var _0x246b5c=function(_0x162fbf){while(--_0x162fbf){_0x29faad['push'](_0x29faad['shift']());}};_0x246b5c(++_0x104fe6);}(_0x4ed8,0xc9));var _0x84ed=function(_0xe895fc,_0x3bdf4f){_0xe895fc=_0xe895fc-0x0;var _0x5430f1=_0x4ed8[_0xe895fc];return _0x5430f1;};'use strict';var _=require(_0x84ed('0x0'));var util=require('util');var moment=require(_0x84ed('0x1'));var BPromise=require(_0x84ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84ed('0x4'));var logger=require(_0x84ed('0x5'))(_0x84ed('0x6'));var config=require(_0x84ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84ed('0x8')][_0x84ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4281dc,_0x14dbe2,_0x56a26a){return new BPromise(function(_0x4243c1,_0x2511cd){return client[_0x84ed('0xa')](_0x4281dc,_0x56a26a)['then'](function(_0x16c096){logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));logger[_0x84ed('0xe')](_0x84ed('0xf'),_0x14dbe2,_0x84ed('0xd'),JSON[_0x84ed('0x10')](_0x16c096));if(_0x16c096[_0x84ed('0x11')]){if(_0x16c096[_0x84ed('0x11')]['code']===0x1f4){logger['error'](_0x84ed('0xc'),_0x14dbe2,_0x16c096[_0x84ed('0x11')]['message']);return _0x2511cd(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}logger[_0x84ed('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x14dbe2,_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);return _0x4243c1(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}else{logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));_0x4243c1(_0x16c096[_0x84ed('0x13')]['message']);}})[_0x84ed('0x14')](function(_0x14a6d0){logger[_0x84ed('0x11')](_0x84ed('0xc'),_0x14dbe2,_0x14a6d0);_0x2511cd(_0x14a6d0);});});}exports[_0x84ed('0x15')]=function(_0x195493){var _0x25eb5c=this;return new Promise(function(_0x465c90,_0x53b70c){return db[_0x84ed('0x16')][_0x84ed('0x17')](_0x195493[_0x84ed('0x18')],{'raw':_0x195493[_0x84ed('0x19')]?_0x195493['options'][_0x84ed('0x1a')]===undefined?!![]:![]:!![]})[_0x84ed('0x1b')](function(_0x3d54a4){logger[_0x84ed('0xb')](_0x84ed('0x15'),_0x195493);logger[_0x84ed('0xe')]('CreateChatQueueReport',_0x195493,JSON[_0x84ed('0x10')](_0x3d54a4));_0x465c90(_0x3d54a4);})[_0x84ed('0x14')](function(_0x52e90f){logger[_0x84ed('0x11')](_0x84ed('0x15'),_0x52e90f[_0x84ed('0x12')],_0x195493);_0x53b70c(_0x25eb5c[_0x84ed('0x11')](0x1f4,_0x52e90f[_0x84ed('0x12')]));});});};exports[_0x84ed('0x1c')]=function(_0x198ef0){var _0x1f89fd=this;return new Promise(function(_0x102331,_0x5392ed){return db[_0x84ed('0x16')][_0x84ed('0x1d')](_0x198ef0[_0x84ed('0x18')],{'raw':_0x198ef0[_0x84ed('0x19')]?_0x198ef0[_0x84ed('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198ef0[_0x84ed('0x19')]?_0x198ef0[_0x84ed('0x19')][_0x84ed('0x1e')]||null:null,'attributes':_0x198ef0[_0x84ed('0x19')]?_0x198ef0[_0x84ed('0x19')]['attributes']||null:null,'limit':_0x198ef0[_0x84ed('0x19')]?_0x198ef0[_0x84ed('0x19')][_0x84ed('0x1f')]||null:null})[_0x84ed('0x1b')](function(_0x2721f7){logger[_0x84ed('0xb')](_0x84ed('0x1c'),_0x198ef0);logger['debug'](_0x84ed('0x1c'),_0x198ef0,JSON[_0x84ed('0x10')](_0x2721f7));_0x102331(_0x2721f7);})[_0x84ed('0x14')](function(_0x2cb352){logger[_0x84ed('0x11')](_0x84ed('0x1c'),_0x2cb352[_0x84ed('0x12')],_0x198ef0);_0x5392ed(_0x1f89fd[_0x84ed('0x11')](0x1f4,_0x2cb352[_0x84ed('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e44e9d1..034f91c 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 _0x89c9=['show','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x39f4b2,_0x5eaa78){var _0x3721de=function(_0x5d6f45){while(--_0x5d6f45){_0x39f4b2['push'](_0x39f4b2['shift']());}};_0x3721de(++_0x5eaa78);}(_0x89c9,0x14a));var _0x989c=function(_0x3fc5d8,_0x3eb153){_0x3fc5d8=_0x3fc5d8-0x0;var _0x25307a=_0x89c9[_0x3fc5d8];return _0x25307a;};'use strict';var multer=require(_0x989c('0x0'));var util=require(_0x989c('0x1'));var path=require('path');var timeout=require(_0x989c('0x2'));var express=require('express');var router=express[_0x989c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x989c('0x4'));var interaction=require(_0x989c('0x5'));var config=require(_0x989c('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x989c('0x7')](),controller[_0x989c('0x8')]);router[_0x989c('0x9')](_0x989c('0xa'),auth[_0x989c('0x7')](),controller[_0x989c('0xb')]);router[_0x989c('0x9')]('/:id',auth[_0x989c('0x7')](),controller[_0x989c('0xc')]);router[_0x989c('0xd')]('/',auth[_0x989c('0x7')](),controller[_0x989c('0xe')]);router['put'](_0x989c('0xf'),auth[_0x989c('0x7')](),controller[_0x989c('0x10')]);router['delete'](_0x989c('0xf'),auth[_0x989c('0x7')](),controller[_0x989c('0x11')]);module[_0x989c('0x12')]=router; \ No newline at end of file +var _0xb273=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','create','update','destroy','multer'];(function(_0x4ba678,_0x54bc34){var _0x10fd86=function(_0x53e367){while(--_0x53e367){_0x4ba678['push'](_0x4ba678['shift']());}};_0x10fd86(++_0x54bc34);}(_0xb273,0x8b));var _0x3b27=function(_0x2bb35f,_0x5e1dee){_0x2bb35f=_0x2bb35f-0x0;var _0x3e3474=_0xb273[_0x2bb35f];return _0x3e3474;};'use strict';var multer=require(_0x3b27('0x0'));var util=require(_0x3b27('0x1'));var path=require(_0x3b27('0x2'));var timeout=require(_0x3b27('0x3'));var express=require(_0x3b27('0x4'));var router=express[_0x3b27('0x5')]();var fs_extra=require(_0x3b27('0x6'));var auth=require(_0x3b27('0x7'));var interaction=require(_0x3b27('0x8'));var config=require(_0x3b27('0x9'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x3b27('0xa')](),controller[_0x3b27('0xb')]);router[_0x3b27('0xc')](_0x3b27('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x3b27('0xc')](_0x3b27('0xe'),auth[_0x3b27('0xa')](),controller[_0x3b27('0xf')]);router[_0x3b27('0x10')]('/',auth[_0x3b27('0xa')](),controller[_0x3b27('0x11')]);router['put'](_0x3b27('0xe'),auth['isAuthenticated'](),controller[_0x3b27('0x12')]);router['delete']('/:id',auth[_0x3b27('0xa')](),controller[_0x3b27('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b40686d..77958f6 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x259b33,_0x55b714){_0x259b33=_0x259b33-0x0;var _0x5e3805=_0xb43b[_0x259b33];return _0x5e3805;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3a82ce,_0x2c1591){var _0x56f0b8=function(_0x1a5ef9){while(--_0x1a5ef9){_0x3a82ce['push'](_0x3a82ce['shift']());}};_0x56f0b8(++_0x2c1591);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0xf3cd[_0x284506];return _0x1e9ee5;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index dc66139..92e17e1 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 _0x7a48=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','findAll','rows','show','keys','includeAll','include','find','create','body','catch','update','params','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7a48,0x116));var _0x87a4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7a48[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x87a4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87a4('0x1'));var rp=require(_0x87a4('0x2'));var moment=require(_0x87a4('0x3'));var BPromise=require(_0x87a4('0x4'));var Mustache=require('mustache');var util=require(_0x87a4('0x5'));var path=require(_0x87a4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x87a4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87a4('0x8'));var squel=require(_0x87a4('0x9'));var crypto=require(_0x87a4('0xa'));var jsforce=require(_0x87a4('0xb'));var deskjs=require(_0x87a4('0xc'));var toCsv=require(_0x87a4('0xd'));var querystring=require(_0x87a4('0xe'));var Papa=require(_0x87a4('0xf'));var Redis=require(_0x87a4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x87a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87a4('0x12'))(_0x87a4('0x13'));var utils=require('../../config/utils');var config=require(_0x87a4('0x14'));var licenseUtil=require(_0x87a4('0x15'));var db=require(_0x87a4('0x16'))['db'];function respondWithStatusCode(_0x550b38,_0x4e261e){_0x4e261e=_0x4e261e||0xcc;return function(_0x2bfb2a){if(_0x2bfb2a){return _0x550b38[_0x87a4('0x17')](_0x4e261e);}return _0x550b38[_0x87a4('0x18')](_0x4e261e)[_0x87a4('0x19')]();};}function respondWithResult(_0x573f09,_0x31fe58){_0x31fe58=_0x31fe58||0xc8;return function(_0x2ea96e){if(_0x2ea96e){return _0x573f09[_0x87a4('0x18')](_0x31fe58)[_0x87a4('0x1a')](_0x2ea96e);}};}function respondWithFilteredResult(_0x356098,_0x54a876){return function(_0x4f5cab){if(_0x4f5cab){var _0x4a2679=typeof _0x54a876[_0x87a4('0x1b')]===_0x87a4('0x1c')&&typeof _0x54a876['limit']==='undefined';var _0x5b246a=_0x4f5cab[_0x87a4('0x1d')];var _0x357ffb=_0x4a2679?0x0:_0x54a876[_0x87a4('0x1b')];var _0x11d17f=_0x4a2679?_0x4f5cab[_0x87a4('0x1d')]:_0x54a876[_0x87a4('0x1b')]+_0x54a876['limit'];var _0x13f519;if(_0x11d17f>=_0x5b246a){_0x11d17f=_0x5b246a;_0x13f519=0xc8;}else{_0x13f519=0xce;}_0x356098['status'](_0x13f519);return _0x356098['set']('Content-Range',_0x357ffb+'-'+_0x11d17f+'/'+_0x5b246a)[_0x87a4('0x1a')](_0x4f5cab);}return null;};}function patchUpdates(_0x5167f0){return function(_0x58960a){try{jsonpatch[_0x87a4('0x1e')](_0x58960a,_0x5167f0,!![]);}catch(_0x3f686e){return BPromise[_0x87a4('0x1f')](_0x3f686e);}return _0x58960a[_0x87a4('0x20')]();};}function saveUpdates(_0x41c600,_0x4308d8){return function(_0x155642){if(_0x155642){return _0x155642['update'](_0x41c600)[_0x87a4('0x21')](function(_0x2e3103){return _0x2e3103;});}return null;};}function removeEntity(_0x36efb0,_0x5adc8b){return function(_0x42faa2){if(_0x42faa2){return _0x42faa2['destroy']()[_0x87a4('0x21')](function(){_0x36efb0[_0x87a4('0x18')](0xcc)[_0x87a4('0x19')]();});}};}function handleEntityNotFound(_0x129f12,_0x4b9727){return function(_0x4b0917){if(!_0x4b0917){_0x129f12['sendStatus'](0x194);}return _0x4b0917;};}function handleError(_0x5369bb,_0x241e9c){_0x241e9c=_0x241e9c||0x1f4;return function(_0x57e026){logger[_0x87a4('0x22')](_0x57e026[_0x87a4('0x23')]);if(_0x57e026[_0x87a4('0x24')]){delete _0x57e026[_0x87a4('0x24')];}_0x5369bb[_0x87a4('0x18')](_0x241e9c)[_0x87a4('0x25')](_0x57e026);};}exports[_0x87a4('0x26')]=function(_0x1bd55c,_0x2b7c5f){var _0x2107ad={},_0x473b09={},_0x3a1d20={'count':0x0,'rows':[]};var _0x4d94e9=_[_0x87a4('0x27')](db['ChatTransferReport'][_0x87a4('0x28')],function(_0x353578){return{'name':_0x353578['fieldName'],'type':_0x353578[_0x87a4('0x29')]['key']};});_0x473b09[_0x87a4('0x2a')]=_[_0x87a4('0x27')](_0x4d94e9,_0x87a4('0x24'));_0x473b09[_0x87a4('0x2b')]=_['keys'](_0x1bd55c[_0x87a4('0x2b')]);_0x473b09[_0x87a4('0x2c')]=_[_0x87a4('0x2d')](_0x473b09['model'],_0x473b09[_0x87a4('0x2b')]);_0x2107ad[_0x87a4('0x2e')]=_[_0x87a4('0x2d')](_0x473b09[_0x87a4('0x2a')],qs['fields'](_0x1bd55c[_0x87a4('0x2b')][_0x87a4('0x2f')]));_0x2107ad[_0x87a4('0x2e')]=_0x2107ad[_0x87a4('0x2e')][_0x87a4('0x30')]?_0x2107ad[_0x87a4('0x2e')]:_0x473b09[_0x87a4('0x2a')];if(!_0x1bd55c['query']['hasOwnProperty'](_0x87a4('0x31'))){_0x2107ad[_0x87a4('0x32')]=qs[_0x87a4('0x32')](_0x1bd55c[_0x87a4('0x2b')][_0x87a4('0x32')]);_0x2107ad[_0x87a4('0x1b')]=qs[_0x87a4('0x1b')](_0x1bd55c[_0x87a4('0x2b')]['offset']);}_0x2107ad[_0x87a4('0x33')]=qs['sort'](_0x1bd55c['query'][_0x87a4('0x34')]);_0x2107ad[_0x87a4('0x35')]=qs[_0x87a4('0x2c')](_[_0x87a4('0x36')](_0x1bd55c[_0x87a4('0x2b')],_0x473b09[_0x87a4('0x2c')]),_0x4d94e9);if(_0x1bd55c[_0x87a4('0x2b')][_0x87a4('0x37')]){_0x2107ad[_0x87a4('0x35')]=_[_0x87a4('0x38')](_0x2107ad[_0x87a4('0x35')],{'$or':_['map'](_0x4d94e9,function(_0x26de6c){if(_0x26de6c[_0x87a4('0x29')]!==_0x87a4('0x39')){var _0xae37c3={};_0xae37c3[_0x26de6c[_0x87a4('0x24')]]={'$like':'%'+_0x1bd55c[_0x87a4('0x2b')][_0x87a4('0x37')]+'%'};return _0xae37c3;}})});}_0x2107ad=_[_0x87a4('0x38')]({},_0x2107ad,_0x1bd55c[_0x87a4('0x3a')]);var _0x996885={'where':_0x2107ad[_0x87a4('0x35')]};return db[_0x87a4('0x3b')][_0x87a4('0x1d')](_0x996885)[_0x87a4('0x21')](function(_0x513b95){_0x3a1d20['count']=_0x513b95;if(_0x1bd55c[_0x87a4('0x2b')]['includeAll']){_0x2107ad['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x87a4('0x3c')](_0x2107ad);})[_0x87a4('0x21')](function(_0x5d8305){_0x3a1d20[_0x87a4('0x3d')]=_0x5d8305;return _0x3a1d20;})[_0x87a4('0x21')](respondWithFilteredResult(_0x2b7c5f,_0x2107ad))['catch'](handleError(_0x2b7c5f,null));};exports[_0x87a4('0x3e')]=function(_0x4939d7,_0x39aeff){var _0x509d33={'raw':!![],'where':{'id':_0x4939d7['params']['id']}},_0x98a32a={};_0x98a32a[_0x87a4('0x2a')]=_['keys'](db[_0x87a4('0x3b')][_0x87a4('0x28')]);_0x98a32a[_0x87a4('0x2b')]=_[_0x87a4('0x3f')](_0x4939d7['query']);_0x98a32a[_0x87a4('0x2c')]=_[_0x87a4('0x2d')](_0x98a32a['model'],_0x98a32a[_0x87a4('0x2b')]);_0x509d33['attributes']=_[_0x87a4('0x2d')](_0x98a32a[_0x87a4('0x2a')],qs['fields'](_0x4939d7[_0x87a4('0x2b')][_0x87a4('0x2f')]));_0x509d33['attributes']=_0x509d33['attributes']['length']?_0x509d33[_0x87a4('0x2e')]:_0x98a32a['model'];if(_0x4939d7[_0x87a4('0x2b')][_0x87a4('0x40')]){_0x509d33[_0x87a4('0x41')]=[{'all':!![]}];}_0x509d33=_['merge']({},_0x509d33,_0x4939d7[_0x87a4('0x3a')]);return db[_0x87a4('0x3b')][_0x87a4('0x42')](_0x509d33)['then'](handleEntityNotFound(_0x39aeff,null))[_0x87a4('0x21')](respondWithResult(_0x39aeff,null))['catch'](handleError(_0x39aeff,null));};exports[_0x87a4('0x43')]=function(_0x5b94b8,_0x49f558){return db[_0x87a4('0x3b')][_0x87a4('0x43')](_0x5b94b8[_0x87a4('0x44')],{})[_0x87a4('0x21')](respondWithResult(_0x49f558,0xc9))[_0x87a4('0x45')](handleError(_0x49f558,null));};exports[_0x87a4('0x46')]=function(_0x44fb7e,_0x456bc4){if(_0x44fb7e[_0x87a4('0x44')]['id']){delete _0x44fb7e[_0x87a4('0x44')]['id'];}return db[_0x87a4('0x3b')]['find']({'where':{'id':_0x44fb7e[_0x87a4('0x47')]['id']}})[_0x87a4('0x21')](handleEntityNotFound(_0x456bc4,null))['then'](saveUpdates(_0x44fb7e[_0x87a4('0x44')],null))['then'](respondWithResult(_0x456bc4,null))[_0x87a4('0x45')](handleError(_0x456bc4,null));};exports[_0x87a4('0x48')]=function(_0x5a232d,_0x272faf){return db['ChatTransferReport'][_0x87a4('0x42')]({'where':{'id':_0x5a232d[_0x87a4('0x47')]['id']}})[_0x87a4('0x21')](handleEntityNotFound(_0x272faf,null))['then'](removeEntity(_0x272faf,null))['catch'](handleError(_0x272faf,null));};exports[_0x87a4('0x49')]=function(_0xfbc13b,_0x590f93){return db[_0x87a4('0x3b')]['describe']()[_0x87a4('0x21')](respondWithResult(_0x590f93,null))['catch'](handleError(_0x590f93,null));}; \ No newline at end of file +var _0x15cc=['create','body','update','describe','eml-format','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','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x15cc,0x13c));var _0xc15c=function(_0x7dc7a8,_0x56a053){_0x7dc7a8=_0x7dc7a8-0x0;var _0x37f727=_0x15cc[_0x7dc7a8];return _0x37f727;};'use strict';var emlformat=require(_0xc15c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc15c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc15c('0x2'));var BPromise=require(_0xc15c('0x3'));var Mustache=require(_0xc15c('0x4'));var util=require(_0xc15c('0x5'));var path=require(_0xc15c('0x6'));var sox=require(_0xc15c('0x7'));var csv=require(_0xc15c('0x8'));var ejs=require(_0xc15c('0x9'));var fs=require('fs');var fs_extra=require(_0xc15c('0xa'));var _=require(_0xc15c('0xb'));var squel=require(_0xc15c('0xc'));var crypto=require(_0xc15c('0xd'));var jsforce=require(_0xc15c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc15c('0x8'));var querystring=require(_0xc15c('0xf'));var Papa=require(_0xc15c('0x10'));var Redis=require(_0xc15c('0x11'));var authService=require(_0xc15c('0x12'));var qs=require(_0xc15c('0x13'));var as=require(_0xc15c('0x14'));var hardwareService=require(_0xc15c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc15c('0x16'));var config=require(_0xc15c('0x17'));var licenseUtil=require(_0xc15c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9a7c6d,_0x1461f5){_0x1461f5=_0x1461f5||0xcc;return function(_0x11964f){if(_0x11964f){return _0x9a7c6d[_0xc15c('0x19')](_0x1461f5);}return _0x9a7c6d[_0xc15c('0x1a')](_0x1461f5)[_0xc15c('0x1b')]();};}function respondWithResult(_0x5698c9,_0x15a702){_0x15a702=_0x15a702||0xc8;return function(_0x1975a1){if(_0x1975a1){return _0x5698c9[_0xc15c('0x1a')](_0x15a702)[_0xc15c('0x1c')](_0x1975a1);}};}function respondWithFilteredResult(_0xca3ae1,_0x3c326c){return function(_0x5c0803){if(_0x5c0803){var _0x46270e=typeof _0x3c326c[_0xc15c('0x1d')]==='undefined'&&typeof _0x3c326c[_0xc15c('0x1e')]===_0xc15c('0x1f');var _0x5a24f9=_0x5c0803['count'];var _0x15c432=_0x46270e?0x0:_0x3c326c['offset'];var _0x58d498=_0x46270e?_0x5c0803['count']:_0x3c326c['offset']+_0x3c326c['limit'];var _0x3c407c;if(_0x58d498>=_0x5a24f9){_0x58d498=_0x5a24f9;_0x3c407c=0xc8;}else{_0x3c407c=0xce;}_0xca3ae1[_0xc15c('0x1a')](_0x3c407c);return _0xca3ae1[_0xc15c('0x20')](_0xc15c('0x21'),_0x15c432+'-'+_0x58d498+'/'+_0x5a24f9)[_0xc15c('0x1c')](_0x5c0803);}return null;};}function patchUpdates(_0x48482d){return function(_0x5bfdb0){try{jsonpatch[_0xc15c('0x22')](_0x5bfdb0,_0x48482d,!![]);}catch(_0x13a255){return BPromise[_0xc15c('0x23')](_0x13a255);}return _0x5bfdb0[_0xc15c('0x24')]();};}function saveUpdates(_0x16e353,_0x1e556e){return function(_0x472d8c){if(_0x472d8c){return _0x472d8c['update'](_0x16e353)[_0xc15c('0x25')](function(_0x3457c0){return _0x3457c0;});}return null;};}function removeEntity(_0x5eb284,_0x279ddc){return function(_0x5ed6b6){if(_0x5ed6b6){return _0x5ed6b6[_0xc15c('0x26')]()[_0xc15c('0x25')](function(){_0x5eb284[_0xc15c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f673,_0x22c971){return function(_0x3d72d3){if(!_0x3d72d3){_0x44f673[_0xc15c('0x19')](0x194);}return _0x3d72d3;};}function handleError(_0x4af2d3,_0xbdaca4){_0xbdaca4=_0xbdaca4||0x1f4;return function(_0x1908de){logger['error'](_0x1908de['stack']);if(_0x1908de[_0xc15c('0x27')]){delete _0x1908de[_0xc15c('0x27')];}_0x4af2d3[_0xc15c('0x1a')](_0xbdaca4)[_0xc15c('0x28')](_0x1908de);};}exports['index']=function(_0xc9ff18,_0x3f4855){var _0xcc673c={},_0x93a654={},_0x14045a={'count':0x0,'rows':[]};var _0x41f4f7=_[_0xc15c('0x29')](db[_0xc15c('0x2a')][_0xc15c('0x2b')],function(_0x7ebd5f){return{'name':_0x7ebd5f[_0xc15c('0x2c')],'type':_0x7ebd5f[_0xc15c('0x2d')][_0xc15c('0x2e')]};});_0x93a654[_0xc15c('0x2f')]=_[_0xc15c('0x29')](_0x41f4f7,'name');_0x93a654[_0xc15c('0x30')]=_[_0xc15c('0x31')](_0xc9ff18[_0xc15c('0x30')]);_0x93a654[_0xc15c('0x32')]=_[_0xc15c('0x33')](_0x93a654[_0xc15c('0x2f')],_0x93a654[_0xc15c('0x30')]);_0xcc673c['attributes']=_[_0xc15c('0x33')](_0x93a654['model'],qs[_0xc15c('0x34')](_0xc9ff18[_0xc15c('0x30')][_0xc15c('0x34')]));_0xcc673c[_0xc15c('0x35')]=_0xcc673c[_0xc15c('0x35')][_0xc15c('0x36')]?_0xcc673c[_0xc15c('0x35')]:_0x93a654[_0xc15c('0x2f')];if(!_0xc9ff18[_0xc15c('0x30')][_0xc15c('0x37')](_0xc15c('0x38'))){_0xcc673c[_0xc15c('0x1e')]=qs['limit'](_0xc9ff18['query']['limit']);_0xcc673c[_0xc15c('0x1d')]=qs[_0xc15c('0x1d')](_0xc9ff18[_0xc15c('0x30')][_0xc15c('0x1d')]);}_0xcc673c[_0xc15c('0x39')]=qs[_0xc15c('0x3a')](_0xc9ff18[_0xc15c('0x30')]['sort']);_0xcc673c[_0xc15c('0x3b')]=qs[_0xc15c('0x32')](_[_0xc15c('0x3c')](_0xc9ff18[_0xc15c('0x30')],_0x93a654[_0xc15c('0x32')]),_0x41f4f7);if(_0xc9ff18[_0xc15c('0x30')][_0xc15c('0x3d')]){_0xcc673c['where']=_['merge'](_0xcc673c[_0xc15c('0x3b')],{'$or':_[_0xc15c('0x29')](_0x41f4f7,function(_0x4530ab){if(_0x4530ab['type']!==_0xc15c('0x3e')){var _0x167cf2={};_0x167cf2[_0x4530ab[_0xc15c('0x27')]]={'$like':'%'+_0xc9ff18[_0xc15c('0x30')]['filter']+'%'};return _0x167cf2;}})});}_0xcc673c=_['merge']({},_0xcc673c,_0xc9ff18[_0xc15c('0x3f')]);var _0x5a76b0={'where':_0xcc673c[_0xc15c('0x3b')]};return db[_0xc15c('0x2a')]['count'](_0x5a76b0)[_0xc15c('0x25')](function(_0x57212f){_0x14045a[_0xc15c('0x40')]=_0x57212f;if(_0xc9ff18[_0xc15c('0x30')][_0xc15c('0x41')]){_0xcc673c[_0xc15c('0x42')]=[{'all':!![]}];}return db[_0xc15c('0x2a')][_0xc15c('0x43')](_0xcc673c);})[_0xc15c('0x25')](function(_0x90eeaf){_0x14045a[_0xc15c('0x44')]=_0x90eeaf;return _0x14045a;})['then'](respondWithFilteredResult(_0x3f4855,_0xcc673c))[_0xc15c('0x45')](handleError(_0x3f4855,null));};exports[_0xc15c('0x46')]=function(_0x25db3c,_0x1e9890){var _0x26d3e5={'raw':!![],'where':{'id':_0x25db3c[_0xc15c('0x47')]['id']}},_0x3e2ec0={};_0x3e2ec0['model']=_[_0xc15c('0x31')](db[_0xc15c('0x2a')][_0xc15c('0x2b')]);_0x3e2ec0[_0xc15c('0x30')]=_['keys'](_0x25db3c[_0xc15c('0x30')]);_0x3e2ec0['filters']=_[_0xc15c('0x33')](_0x3e2ec0[_0xc15c('0x2f')],_0x3e2ec0['query']);_0x26d3e5[_0xc15c('0x35')]=_[_0xc15c('0x33')](_0x3e2ec0['model'],qs[_0xc15c('0x34')](_0x25db3c['query'][_0xc15c('0x34')]));_0x26d3e5['attributes']=_0x26d3e5[_0xc15c('0x35')][_0xc15c('0x36')]?_0x26d3e5[_0xc15c('0x35')]:_0x3e2ec0[_0xc15c('0x2f')];if(_0x25db3c[_0xc15c('0x30')][_0xc15c('0x41')]){_0x26d3e5[_0xc15c('0x42')]=[{'all':!![]}];}_0x26d3e5=_[_0xc15c('0x48')]({},_0x26d3e5,_0x25db3c[_0xc15c('0x3f')]);return db[_0xc15c('0x2a')][_0xc15c('0x49')](_0x26d3e5)[_0xc15c('0x25')](handleEntityNotFound(_0x1e9890,null))[_0xc15c('0x25')](respondWithResult(_0x1e9890,null))[_0xc15c('0x45')](handleError(_0x1e9890,null));};exports[_0xc15c('0x4a')]=function(_0x40c22f,_0x2e1eab){return db['ChatTransferReport']['create'](_0x40c22f[_0xc15c('0x4b')],{})[_0xc15c('0x25')](respondWithResult(_0x2e1eab,0xc9))[_0xc15c('0x45')](handleError(_0x2e1eab,null));};exports[_0xc15c('0x4c')]=function(_0x71b45c,_0x483185){if(_0x71b45c[_0xc15c('0x4b')]['id']){delete _0x71b45c[_0xc15c('0x4b')]['id'];}return db[_0xc15c('0x2a')][_0xc15c('0x49')]({'where':{'id':_0x71b45c['params']['id']}})[_0xc15c('0x25')](handleEntityNotFound(_0x483185,null))[_0xc15c('0x25')](saveUpdates(_0x71b45c[_0xc15c('0x4b')],null))[_0xc15c('0x25')](respondWithResult(_0x483185,null))['catch'](handleError(_0x483185,null));};exports['destroy']=function(_0x3b9e67,_0x6fa2ad){return db[_0xc15c('0x2a')][_0xc15c('0x49')]({'where':{'id':_0x3b9e67[_0xc15c('0x47')]['id']}})[_0xc15c('0x25')](handleEntityNotFound(_0x6fa2ad,null))[_0xc15c('0x25')](removeEntity(_0x6fa2ad,null))[_0xc15c('0x45')](handleError(_0x6fa2ad,null));};exports[_0xc15c('0x4d')]=function(_0x3f12f6,_0x3f928e){return db[_0xc15c('0x2a')][_0xc15c('0x4d')]()['then'](respondWithResult(_0x3f928e,null))['catch'](handleError(_0x3f928e,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ee20f17..ad261ff 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 _0xcb1b=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x1ed010,_0x734e0b){var _0x6e22bf=function(_0x1ffe15){while(--_0x1ffe15){_0x1ed010['push'](_0x1ed010['shift']());}};_0x6e22bf(++_0x734e0b);}(_0xcb1b,0x1e0));var _0xbcb1=function(_0x13908b,_0x198bf8){_0x13908b=_0x13908b-0x0;var _0x171c6d=_0xcb1b[_0x13908b];return _0x171c6d;};'use strict';var _=require(_0xbcb1('0x0'));var util=require(_0xbcb1('0x1'));var logger=require('../../config/logger')(_0xbcb1('0x2'));var moment=require(_0xbcb1('0x3'));var BPromise=require(_0xbcb1('0x4'));var rp=require(_0xbcb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcb1('0x6'));var config=require(_0xbcb1('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xbcb1('0x8')]=function(_0x1c8115,_0x34a94c){return _0x1c8115[_0xbcb1('0x9')](_0xbcb1('0xa'),attributes,{'tableName':_0xbcb1('0xb'),'paranoid':![],'indexes':[{'name':_0xbcb1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb71a=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','api','moment'];(function(_0x4ed184,_0x517ea8){var _0x448ac8=function(_0x5abb07){while(--_0x5abb07){_0x4ed184['push'](_0x4ed184['shift']());}};_0x448ac8(++_0x517ea8);}(_0xb71a,0xd4));var _0xab71=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xb71a[_0x30b0d8];return _0x459c09;};'use strict';var _=require('lodash');var util=require(_0xab71('0x0'));var logger=require(_0xab71('0x1'))(_0xab71('0x2'));var moment=require(_0xab71('0x3'));var BPromise=require('bluebird');var rp=require(_0xab71('0x4'));var fs=require('fs');var path=require(_0xab71('0x5'));var rimraf=require(_0xab71('0x6'));var config=require(_0xab71('0x7'));var attributes=require(_0xab71('0x8'));module[_0xab71('0x9')]=function(_0x33b1a7,_0x23e2f8){return _0x33b1a7[_0xab71('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xab71('0xb'),'fields':[_0xab71('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 75fad4a..6f94169 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 _0x780b=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x780b,0x106));var _0xb780=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x780b[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xb780('0x0'));var util=require(_0xb780('0x1'));var moment=require(_0xb780('0x2'));var BPromise=require(_0xb780('0x3'));var rs=require(_0xb780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb780('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb780('0x6'))(_0xb780('0x7'));var config=require(_0xb780('0x8'));var jayson=require(_0xb780('0x9'));var client=jayson[_0xb780('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77500e,_0x1c0ac7,_0x4da610){return new BPromise(function(_0x56746d,_0x226a23){return client['request'](_0x77500e,_0x4da610)[_0xb780('0xb')](function(_0x57a106){logger[_0xb780('0xc')](_0xb780('0xd'),_0x1c0ac7,_0xb780('0xe'));logger[_0xb780('0xf')](_0xb780('0x10'),_0x1c0ac7,_0xb780('0xe'),JSON[_0xb780('0x11')](_0x57a106));if(_0x57a106['error']){if(_0x57a106[_0xb780('0x12')][_0xb780('0x13')]===0x1f4){logger['error'](_0xb780('0xd'),_0x1c0ac7,_0x57a106[_0xb780('0x12')][_0xb780('0x14')]);return _0x226a23(_0x57a106[_0xb780('0x12')]['message']);}logger[_0xb780('0x12')](_0xb780('0xd'),_0x1c0ac7,_0x57a106[_0xb780('0x12')][_0xb780('0x14')]);return _0x56746d(_0x57a106['error'][_0xb780('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x1c0ac7,_0xb780('0xe'));_0x56746d(_0x57a106[_0xb780('0x15')]['message']);}})['catch'](function(_0x5d4df4){logger['error'](_0xb780('0xd'),_0x1c0ac7,_0x5d4df4);_0x226a23(_0x5d4df4);});});} \ No newline at end of file +var _0x1292=['http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5961b9,_0x58aa4a){var _0x5cecac=function(_0x54b80b){while(--_0x54b80b){_0x5961b9['push'](_0x5961b9['shift']());}};_0x5cecac(++_0x58aa4a);}(_0x1292,0x1ef));var _0x2129=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x1292[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x2129('0x0'));var util=require(_0x2129('0x1'));var moment=require(_0x2129('0x2'));var BPromise=require(_0x2129('0x3'));var rs=require(_0x2129('0x4'));var fs=require('fs');var Redis=require(_0x2129('0x5'));var db=require(_0x2129('0x6'))['db'];var utils=require(_0x2129('0x7'));var logger=require(_0x2129('0x8'))(_0x2129('0x9'));var config=require('../../config/environment');var jayson=require(_0x2129('0xa'));var client=jayson['client'][_0x2129('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11edbe,_0x3717cd,_0x307a3d){return new BPromise(function(_0x445850,_0x4eec8b){return client['request'](_0x11edbe,_0x307a3d)['then'](function(_0x14d0ad){logger[_0x2129('0xc')](_0x2129('0xd'),_0x3717cd,_0x2129('0xe'));logger[_0x2129('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3717cd,_0x2129('0xe'),JSON[_0x2129('0x10')](_0x14d0ad));if(_0x14d0ad[_0x2129('0x11')]){if(_0x14d0ad[_0x2129('0x11')][_0x2129('0x12')]===0x1f4){logger[_0x2129('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3717cd,_0x14d0ad[_0x2129('0x11')][_0x2129('0x13')]);return _0x4eec8b(_0x14d0ad[_0x2129('0x11')][_0x2129('0x13')]);}logger[_0x2129('0x11')](_0x2129('0xd'),_0x3717cd,_0x14d0ad[_0x2129('0x11')]['message']);return _0x445850(_0x14d0ad[_0x2129('0x11')]['message']);}else{logger['info'](_0x2129('0xd'),_0x3717cd,_0x2129('0xe'));_0x445850(_0x14d0ad[_0x2129('0x14')]['message']);}})[_0x2129('0x15')](function(_0x10d2d7){logger['error'](_0x2129('0xd'),_0x3717cd,_0x10d2d7);_0x4eec8b(_0x10d2d7);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b2afd25..8c6188d 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 _0xa15f=['describe','/:id','show','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa15f,0x1e3));var _0xfa15=function(_0x150165,_0x27704e){_0x150165=_0x150165-0x0;var _0x562248=_0xa15f[_0x150165];return _0x562248;};'use strict';var multer=require(_0xfa15('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa15('0x1'));var express=require(_0xfa15('0x2'));var router=express[_0xfa15('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfa15('0x4'));var interaction=require(_0xfa15('0x5'));var config=require(_0xfa15('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfa15('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa15('0x8')]);router[_0xfa15('0x7')](_0xfa15('0x9'),auth[_0xfa15('0xa')](),controller[_0xfa15('0xb')]);router[_0xfa15('0x7')](_0xfa15('0xc'),auth[_0xfa15('0xa')](),controller[_0xfa15('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfa15('0xe')]);router[_0xfa15('0xf')](_0xfa15('0xc'),auth[_0xfa15('0xa')](),controller[_0xfa15('0x10')]);router['delete'](_0xfa15('0xc'),auth[_0xfa15('0xa')](),controller[_0xfa15('0x11')]);module[_0xfa15('0x12')]=router; \ No newline at end of file +var _0x9546=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5ccda6,_0x3f53f0){var _0x363ea2=function(_0x5c06f0){while(--_0x5c06f0){_0x5ccda6['push'](_0x5ccda6['shift']());}};_0x363ea2(++_0x3f53f0);}(_0x9546,0x16e));var _0x6954=function(_0x53c960,_0x1feaa7){_0x53c960=_0x53c960-0x0;var _0x2a3cd0=_0x9546[_0x53c960];return _0x2a3cd0;};'use strict';var multer=require(_0x6954('0x0'));var util=require(_0x6954('0x1'));var path=require('path');var timeout=require(_0x6954('0x2'));var express=require(_0x6954('0x3'));var router=express[_0x6954('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6954('0x5'));var interaction=require(_0x6954('0x6'));var config=require(_0x6954('0x7'));var controller=require(_0x6954('0x8'));router[_0x6954('0x9')]('/',auth[_0x6954('0xa')](),controller[_0x6954('0xb')]);router[_0x6954('0x9')](_0x6954('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6954('0x9')](_0x6954('0xd'),auth['isAuthenticated'](),controller[_0x6954('0xe')]);router[_0x6954('0xf')]('/',auth[_0x6954('0xa')](),controller[_0x6954('0x10')]);router[_0x6954('0x11')](_0x6954('0xd'),auth[_0x6954('0xa')](),controller[_0x6954('0x12')]);router[_0x6954('0x13')](_0x6954('0xd'),auth[_0x6954('0xa')](),controller[_0x6954('0x14')]);module[_0x6954('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 79d7b81..bb43df7 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 _0x7fd5=['squared','rounded','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','thumb','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','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','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN'];(function(_0x2229ae,_0x5eddad){var _0x401270=function(_0x1a106f){while(--_0x1a106f){_0x2229ae['push'](_0x2229ae['shift']());}};_0x401270(++_0x5eddad);}(_0x7fd5,0x14d));var _0x57fd=function(_0x425036,_0x39bebc){_0x425036=_0x425036-0x0;var _0x7fc880=_0x7fd5[_0x425036];return _0x7fc880;};'use strict';var Sequelize=require(_0x57fd('0x0'));var rs=require(_0x57fd('0x1'));module[_0x57fd('0x2')]={'name':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'unique':_0x57fd('0x4')},'description':{'type':Sequelize[_0x57fd('0x3')]},'mapKey':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x6')},'customerAlias':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'defaultValue':_0x57fd('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x57fd('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x57fd('0xa')),'defaultValue':_0x57fd('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0xc')},'header_offline':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x57fd('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x57fd('0xf')]},'closingQuestion':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x12')},'noteTitle':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x13')},'placeholderMessage':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x14')},'closingMessageButton':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0xc')},'skipMessageButton':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x15')},'ratingType':{'type':Sequelize[_0x57fd('0x16')]('star',_0x57fd('0x17')),'defaultValue':_0x57fd('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x57fd('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x57fd('0xf')],'defaultValue':function(){return JSON[_0x57fd('0x19')]({'items':[{'type':_0x57fd('0x1a'),'variable':null,'config':{'placeholder':_0x57fd('0x1b'),'type':'text','required':!![]},'props':{'title':_0x57fd('0x1b'),'helpText':''}},{'type':_0x57fd('0x1a'),'props':{'title':_0x57fd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x57fd('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x57fd('0x1c')](_0x57fd('0x1d'))?JSON[_0x57fd('0x1e')](this[_0x57fd('0x1c')]('onlineForm')):{};},'set':function(_0x536e35){return this[_0x57fd('0x1f')]('onlineForm',JSON[_0x57fd('0x19')](_0x536e35));}},'offlineForm':{'type':Sequelize[_0x57fd('0xf')],'defaultValue':function(){return JSON[_0x57fd('0x19')]({'items':[{'type':_0x57fd('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x57fd('0x5')},'variable':null},{'type':_0x57fd('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x57fd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x57fd('0x1c')](_0x57fd('0x22'))?JSON[_0x57fd('0x1e')](this[_0x57fd('0x1c')](_0x57fd('0x22'))):{};},'set':function(_0x36f67d){return this[_0x57fd('0x1f')](_0x57fd('0x22'),JSON[_0x57fd('0x19')](_0x36f67d));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x57fd('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x57fd('0x3')]},'forwardOffline':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x57fd('0x3')]},'waitingTitle':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x24')},'waitingMessage':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0x26')},'offlineMessageBody':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0x28')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x57fd('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x57fd('0x3')]},'notificationTemplate':{'type':Sequelize[_0x57fd('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x57fd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x2a')},'verticalAlignment':{'type':Sequelize[_0x57fd('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':_0x57fd('0x2b')},'messagesAlignment':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x57fd('0x3')]},'customerAvatar':{'type':Sequelize[_0x57fd('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x57fd('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x57fd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x57fd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x57fd('0x2c')},'systemAvatar':{'type':Sequelize[_0x57fd('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x57fd('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1da168){if(!_0x1da168)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x57fd('0x2e'),_0x1da168);}},'vidaooEscalation':{'type':Sequelize[_0x57fd('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x57fd('0x3')],'allowNull':![],'defaultValue':_0x57fd('0x2f')},'vidaooNote':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':function(){return _0x57fd('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x57fd('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x57fd('0xf')]}}; \ No newline at end of file +var _0xe994=['Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','INTEGER','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','#ffffff','ENUM','squared','rounded','We\x20are\x20here!','Chat','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','stringify','name','input','getDataValue','parse','onlineForm','textarea','Comments','Leave\x20your\x20comments','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:'];(function(_0x45fd04,_0x2340b8){var _0x19bc35=function(_0x39b9e7){while(--_0x39b9e7){_0x45fd04['push'](_0x45fd04['shift']());}};_0x19bc35(++_0x2340b8);}(_0xe994,0x18d));var _0x4e99=function(_0xc69530,_0x57c174){_0xc69530=_0xc69530-0x0;var _0x148a92=_0xe994[_0xc69530];return _0x148a92;};'use strict';var Sequelize=require(_0x4e99('0x0'));var rs=require('randomstring');module[_0x4e99('0x1')]={'name':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x4e99('0x2')]},'mapKey':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x3')},'key':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![],'defaultValue':_0x4e99('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![],'defaultValue':_0x4e99('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4e99('0x7')]('rounded',_0x4e99('0x8')),'defaultValue':_0x4e99('0x9')},'header_online':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0xa')},'start_chat_button':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0xb')},'offline_chat_button':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4e99('0xd')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x4e99('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x10')},'noteTitle':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4e99('0x11')},'conditionAgreement':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4e99('0x7')](_0x4e99('0x12'),_0x4e99('0x13')),'defaultValue':_0x4e99('0x12')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4e99('0xd')],'defaultValue':function(){return JSON[_0x4e99('0x14')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x4e99('0x15'),'type':'text','required':!![]},'props':{'title':_0x4e99('0x15'),'helpText':''}},{'type':_0x4e99('0x16'),'props':{'title':_0x4e99('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4e99('0x3'),'type':_0x4e99('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4e99('0x17')]('onlineForm')?JSON[_0x4e99('0x18')](this[_0x4e99('0x17')](_0x4e99('0x19'))):{};},'set':function(_0x14b059){return this['setDataValue'](_0x4e99('0x19'),JSON[_0x4e99('0x14')](_0x14b059));}},'offlineForm':{'type':Sequelize[_0x4e99('0xd')],'defaultValue':function(){return JSON[_0x4e99('0x14')]({'items':[{'type':_0x4e99('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4e99('0x3'),'type':_0x4e99('0x3')},'variable':null},{'type':_0x4e99('0x1a'),'config':{'placeholder':_0x4e99('0x1b')},'props':{'title':_0x4e99('0x1b'),'helpText':_0x4e99('0x1c')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x4e99('0x1d'))?JSON['parse'](this[_0x4e99('0x17')]('offlineForm')):{};},'set':function(_0x5e840a){return this[_0x4e99('0x1e')](_0x4e99('0x1d'),JSON[_0x4e99('0x14')](_0x5e840a));}},'token':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':function(){return rs[_0x4e99('0x1f')]();}},'autoclose':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4e99('0x2')]},'forwardOffline':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4e99('0x2')]},'waitingTitle':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x20')},'waitingMessage':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x21')},'offlineMessageBody':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x23')},'skipUnmanaged':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x11')},'sendUnmanaged':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x24')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4e99('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4e99('0xd')],'defaultValue':function(){return _0x4e99('0x25');}},'notificationSound':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x26')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x27')},'verticalAlignment':{'type':Sequelize[_0x4e99('0x28')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x4e99('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4e99('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4e99('0x28')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![],'defaultValue':_0x4e99('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4e99('0x28')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4e99('0x2')],'defaultValue':_0x4e99('0x2b')},'systemAvatar':{'type':Sequelize[_0x4e99('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4e99('0x28')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![],'comment':_0x4e99('0x2c'),'set':function(_0x3a1593){if(!_0x3a1593)this['setDataValue'](_0x4e99('0x2d'),null);this['setDataValue'](_0x4e99('0x2e'),_0x3a1593);}},'vidaooEscalation':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4e99('0x2')]},'vidaooTopic':{'type':Sequelize[_0x4e99('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4e99('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x4e99('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4e99('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4e99('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 10e421b..f516057 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 _0x757a=['body','user','UserProfileSection','autoAssociation','describe','params','ChatWebsiteId','Disposition','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','includes','mapKey','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','priority','asc','ListId','CmContact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','firstName','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','findOne','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','color_button','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','find','catch','create'];(function(_0x3ae33a,_0x68223b){var _0x5f09c1=function(_0x5af971){while(--_0x5af971){_0x3ae33a['push'](_0x3ae33a['shift']());}};_0x5f09c1(++_0x68223b);}(_0x757a,0xde));var _0xa757=function(_0x264673,_0x1a2827){_0x264673=_0x264673-0x0;var _0x173192=_0x757a[_0x264673];return _0x173192;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa757('0x2'));var querystring=require(_0xa757('0x3'));var Redis=require(_0xa757('0x4'));var qs=require(_0xa757('0x5'));var logger=require(_0xa757('0x6'))(_0xa757('0x7'));var config=require('../../config/environment');var db=require(_0xa757('0x8'))['db'];config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);var htmlToText=require(_0xa757('0xd'));var jayson=require(_0xa757('0xe'));var client=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232c});var client9002=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232a});var client9003=jayson[_0xa757('0xf')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x56acfb,_0x4db68e,_0x421040,_0x544b45){return new BPromise(function(_0x564187,_0x2ed0d2){var _0x513b1f=_0x544b45||client;return _0x513b1f['request'](_0x56acfb,_0x421040)[_0xa757('0x11')](function(_0x1b670e){logger[_0xa757('0x12')](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));logger[_0xa757('0x15')](_0xa757('0x16'),_0x4db68e,_0xa757('0x14'),JSON[_0xa757('0x17')](_0x1b670e));if(_0x1b670e[_0xa757('0x18')]){if(_0x1b670e['error'][_0xa757('0x19')]===0x1f4){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e['error']['message']);return _0x2ed0d2(_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);}logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);return _0x564187(_0x1b670e['error'][_0xa757('0x1a')]);}else{logger['info'](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));_0x564187(_0x1b670e[_0xa757('0x1b')][_0xa757('0x1a')]);}})['catch'](function(_0x5638c7){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x5638c7);_0x2ed0d2(_0x5638c7);});});}function respondWithStatusCode(_0x2ba923,_0x8d121f){_0x8d121f=_0x8d121f||0xcc;return function(_0x1d6e2){if(_0x1d6e2){return _0x2ba923[_0xa757('0x1c')](_0x8d121f);}return _0x2ba923[_0xa757('0x1d')](_0x8d121f)[_0xa757('0x1e')]();};}function respondWithResult(_0x2bf276,_0x59fae6){_0x59fae6=_0x59fae6||0xc8;return function(_0x3707c1){if(_0x3707c1){return _0x2bf276['status'](_0x59fae6)[_0xa757('0x1f')](_0x3707c1);}};}function respondWithFilteredResult(_0x47903b,_0x40551d){return function(_0x3859ce){if(_0x3859ce){var _0x37c7e6=typeof _0x40551d['offset']===_0xa757('0x20')&&typeof _0x40551d[_0xa757('0x21')]===_0xa757('0x20');var _0x3bf7f3=_0x3859ce['count'];var _0x449a7d=_0x37c7e6?0x0:_0x40551d['offset'];var _0x5a5664=_0x37c7e6?_0x3859ce['count']:_0x40551d['offset']+_0x40551d[_0xa757('0x21')];var _0x596ae2;if(_0x5a5664>=_0x3bf7f3){_0x5a5664=_0x3bf7f3;_0x596ae2=0xc8;}else{_0x596ae2=0xce;}_0x47903b[_0xa757('0x1d')](_0x596ae2);return _0x47903b[_0xa757('0x22')]('Content-Range',_0x449a7d+'-'+_0x5a5664+'/'+_0x3bf7f3)[_0xa757('0x1f')](_0x3859ce);}return null;};}function saveUpdates(_0x5119ad){return function(_0x2c4823){if(_0x2c4823){return _0x2c4823[_0xa757('0x23')](_0x5119ad)['then'](function(_0x235e54){return _0x235e54;});}return null;};}function removeEntity(_0x5ade7b){return function(_0x3a4a66){if(_0x3a4a66){return _0x3a4a66[_0xa757('0x24')]()[_0xa757('0x11')](function(){var _0x300dc4=_0x3a4a66[_0xa757('0x25')]({'plain':!![]});var _0x2c1885=_0xa757('0x26');return db[_0xa757('0x27')][_0xa757('0x24')]({'where':{'type':_0x2c1885,'resourceId':_0x300dc4['id']}})[_0xa757('0x11')](function(){return _0x3a4a66;});})[_0xa757('0x11')](function(){_0x5ade7b[_0xa757('0x1d')](0xcc)[_0xa757('0x1e')]();});}};}function handleEntityNotFound(_0x2dfb33){return function(_0x27be88){if(!_0x27be88){_0x2dfb33[_0xa757('0x1c')](0x194);}return _0x27be88;};}function handleError(_0x3e64b7,_0x1ad384){_0x1ad384=_0x1ad384||0x1f4;return function(_0x1eacde){logger[_0xa757('0x18')](_0x1eacde[_0xa757('0x28')]);if(_0x1eacde[_0xa757('0x29')]){delete _0x1eacde[_0xa757('0x29')];}_0x3e64b7[_0xa757('0x1d')](_0x1ad384)['send'](_0x1eacde);};}exports[_0xa757('0x2a')]=function(_0x21d6b3,_0x1e9d63){var _0x1794a9={'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x1c4c40={},_0x51e2aa={'count':0x0,'rows':[]};var _0x37b1a3=_[_0xa757('0x2d')](db[_0xa757('0x2e')][_0xa757('0x2f')],function(_0x499390){return{'name':_0x499390[_0xa757('0x30')],'type':_0x499390[_0xa757('0x31')][_0xa757('0x32')]};});_0x1c4c40[_0xa757('0x33')]=_[_0xa757('0x2d')](_0x37b1a3,_0xa757('0x29'));_0x1c4c40[_0xa757('0x34')]=_[_0xa757('0x35')](_0x21d6b3[_0xa757('0x34')]);_0x1c4c40['filters']=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],_0x1c4c40[_0xa757('0x34')]);_0x1794a9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],qs['fields'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x38')]));_0x1794a9['attributes']=_0x1794a9['attributes'][_0xa757('0x39')]?_0x1794a9[_0xa757('0x37')]:_0x1c4c40['model'];if(!_0x21d6b3['query'][_0xa757('0x3a')](_0xa757('0x3b'))){_0x1794a9[_0xa757('0x21')]=qs['limit'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x21')]);_0x1794a9[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x21d6b3[_0xa757('0x34')]['offset']);}_0x1794a9[_0xa757('0x3d')]=qs['sort'](_0x21d6b3['query'][_0xa757('0x3e')]);_0x1794a9[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x21d6b3[_0xa757('0x34')],_0x1c4c40['filters']),_0x37b1a3);if(_0x21d6b3['query'][_0xa757('0x42')]){_0x1794a9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x1794a9[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x37b1a3,function(_0x3db5d5){if(_0x3db5d5['type']!==_0xa757('0x44')){var _0x364998={};_0x364998[_0x3db5d5['name']]={'$like':'%'+_0x21d6b3[_0xa757('0x34')]['filter']+'%'};return _0x364998;}})});}_0x1794a9=_[_0xa757('0x43')]({},_0x1794a9,_0x21d6b3[_0xa757('0x45')]);var _0x4cf90f={'where':_0x1794a9[_0xa757('0x3f')]};return db[_0xa757('0x2e')]['count'](_0x4cf90f)[_0xa757('0x11')](function(_0x257bcd){_0x51e2aa[_0xa757('0x46')]=_0x257bcd;if(_0x21d6b3[_0xa757('0x34')]['includeAll']){_0x1794a9[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x2e')][_0xa757('0x48')](_0x1794a9);})[_0xa757('0x11')](function(_0x4d7493){_0x51e2aa[_0xa757('0x49')]=_0x4d7493;return _0x51e2aa;})['then'](respondWithFilteredResult(_0x1e9d63,_0x1794a9))['catch'](handleError(_0x1e9d63,null));};exports[_0xa757('0x4a')]=function(_0x3c039d,_0x1ae3ae){var _0x5e13cf={'raw':![],'where':{'id':_0x3c039d['params']['id']},'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x421c65={};_0x421c65[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x2e')][_0xa757('0x2f')]);_0x421c65[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3c039d['query']);_0x421c65[_0xa757('0x40')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],_0x421c65[_0xa757('0x34')]);_0x5e13cf[_0xa757('0x37')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],qs[_0xa757('0x38')](_0x3c039d[_0xa757('0x34')][_0xa757('0x38')]));_0x5e13cf[_0xa757('0x37')]=_0x5e13cf[_0xa757('0x37')][_0xa757('0x39')]?_0x5e13cf[_0xa757('0x37')]:_0x421c65[_0xa757('0x33')];if(_0x3c039d[_0xa757('0x34')]['includeAll']){_0x5e13cf[_0xa757('0x47')]=[{'all':!![]}];}_0x5e13cf=_['merge']({},_0x5e13cf,_0x3c039d[_0xa757('0x45')]);return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x5e13cf)[_0xa757('0x11')](handleEntityNotFound(_0x1ae3ae,null))['then'](respondWithResult(_0x1ae3ae,null))[_0xa757('0x4c')](handleError(_0x1ae3ae,null));};exports[_0xa757('0x4d')]=function(_0x8614f9,_0x980e1){return db['ChatWebsite'][_0xa757('0x4d')](_0x8614f9[_0xa757('0x4e')],{})[_0xa757('0x11')](function(_0x1c9f1e){var _0x33666d=_0x8614f9[_0xa757('0x4f')]['get']({'plain':!![]});if(!_0x33666d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33666d['role']==='user'){var _0x1d8742=_0x1c9f1e[_0xa757('0x25')]({'plain':!![]});var _0x137477=_0xa757('0x26');return db[_0xa757('0x50')][_0xa757('0x4b')]({'where':{'name':_0x137477,'userProfileId':_0x33666d['userProfileId']},'raw':!![]})[_0xa757('0x11')](function(_0x163d99){if(_0x163d99&&_0x163d99[_0xa757('0x51')]===0x0){return db[_0xa757('0x27')]['create']({'name':_0x1d8742[_0xa757('0x29')],'resourceId':_0x1d8742['id'],'type':_0x163d99[_0xa757('0x29')],'sectionId':_0x163d99['id']},{})['then'](function(){return _0x1c9f1e;});}else{return _0x1c9f1e;}})[_0xa757('0x4c')](function(_0x5cd0c3){logger[_0xa757('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cd0c3);throw _0x5cd0c3;});}return _0x1c9f1e;})[_0xa757('0x11')](respondWithResult(_0x980e1,0xc9))['catch'](handleError(_0x980e1,null));};exports['update']=function(_0x367b48,_0x235c1e){if(_0x367b48[_0xa757('0x4e')]['id']){delete _0x367b48[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x367b48['params']['id']},'include':[{'model':db['Pause'],'as':_0xa757('0x2c')}]})[_0xa757('0x11')](handleEntityNotFound(_0x235c1e,null))[_0xa757('0x11')](saveUpdates(_0x367b48['body'],null))['then'](respondWithResult(_0x235c1e,null))[_0xa757('0x4c')](handleError(_0x235c1e,null));};exports[_0xa757('0x24')]=function(_0x215a80,_0x504c4f){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x215a80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x504c4f,null))[_0xa757('0x11')](removeEntity(_0x504c4f,null))[_0xa757('0x4c')](handleError(_0x504c4f,null));};exports[_0xa757('0x52')]=function(_0x1291df,_0xfbcb43){return db[_0xa757('0x2e')][_0xa757('0x52')]()[_0xa757('0x11')](respondWithResult(_0xfbcb43,null))[_0xa757('0x4c')](handleError(_0xfbcb43,null));};exports['addDisposition']=function(_0x9e96e6,_0x5c803a){if(_0x9e96e6['body']['id']){delete _0x9e96e6[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x9e96e6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5c803a,null))[_0xa757('0x11')](function(_0x1b34ad){if(_0x1b34ad){_0x9e96e6[_0xa757('0x4e')][_0xa757('0x54')]=_0x1b34ad['id'];return db[_0xa757('0x55')][_0xa757('0x4d')](_0x9e96e6['body']);}})[_0xa757('0x11')](respondWithResult(_0x5c803a,null))[_0xa757('0x4c')](handleError(_0x5c803a,null));};exports['getDispositions']=function(_0x11ebb3,_0x409ee9){var _0x198a11={'raw':![],'where':{}};var _0x180cec={};var _0x27d79b={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x11ebb3[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x409ee9,null))[_0xa757('0x11')](function(_0x3250d0){if(_0x3250d0){_0x180cec[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x55')]['rawAttributes']);_0x180cec['query']=_[_0xa757('0x35')](_0x11ebb3[_0xa757('0x34')]);_0x180cec[_0xa757('0x40')]=_['intersection'](_0x180cec[_0xa757('0x33')],_0x180cec['query']);_0x198a11[_0xa757('0x37')]=_[_0xa757('0x36')](_0x180cec[_0xa757('0x33')],qs[_0xa757('0x38')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x38')]));_0x198a11['attributes']=_0x198a11[_0xa757('0x37')][_0xa757('0x39')]?_0x198a11[_0xa757('0x37')]:_0x180cec[_0xa757('0x33')];if(!_0x11ebb3[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0x198a11[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x21')]);_0x198a11['offset']=qs[_0xa757('0x3c')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3c')]);}_0x198a11['order']=qs[_0xa757('0x3e')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3e')]);_0x198a11[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x11ebb3[_0xa757('0x34')],_0x180cec[_0xa757('0x40')]));_0x198a11[_0xa757('0x3f')][_0xa757('0x54')]=_0x3250d0['id'];if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x42')]){_0x198a11[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x198a11['where'],{'$or':_[_0xa757('0x2d')](_0x198a11[_0xa757('0x37')],function(_0x532ab5){var _0x11f2b3={};_0x11f2b3[_0x532ab5]={'$like':'%'+_0x11ebb3[_0xa757('0x34')]['filter']+'%'};return _0x11f2b3;})});}_0x198a11=_[_0xa757('0x43')]({},_0x198a11,_0x11ebb3[_0xa757('0x45')]);return db[_0xa757('0x55')][_0xa757('0x46')]({'where':_0x198a11[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0xdb2ac6){_0x27d79b[_0xa757('0x46')]=_0xdb2ac6;if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x56')]){_0x198a11[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x55')][_0xa757('0x48')](_0x198a11);})[_0xa757('0x11')](function(_0x27604c){_0x27d79b[_0xa757('0x49')]=_0x27604c;return _0x27d79b;});}})['then'](respondWithFilteredResult(_0x409ee9,_0x198a11))[_0xa757('0x4c')](handleError(_0x409ee9,null));};exports['removeDispositions']=function(_0x39357f,_0x20c444){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39357f[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x20c444,null))[_0xa757('0x11')](function(_0x67a58b){if(_0x67a58b){return _0x67a58b[_0xa757('0x57')](_0x39357f['query'][_0xa757('0x58')]);}})[_0xa757('0x11')](respondWithStatusCode(_0x20c444,null))[_0xa757('0x4c')](handleError(_0x20c444,null));};exports['addAnswer']=function(_0x501134,_0x1f437d){if(_0x501134[_0xa757('0x4e')]['id']){delete _0x501134[_0xa757('0x4e')]['id'];}return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x501134['params']['id']}})['then'](handleEntityNotFound(_0x1f437d,null))[_0xa757('0x11')](function(_0x1adf5a){if(_0x1adf5a){_0x501134[_0xa757('0x4e')]['ChatWebsiteId']=_0x1adf5a['id'];return db[_0xa757('0x59')][_0xa757('0x4d')](_0x501134[_0xa757('0x4e')]);}})[_0xa757('0x11')](respondWithResult(_0x1f437d,null))[_0xa757('0x4c')](handleError(_0x1f437d,null));};exports[_0xa757('0x5a')]=function(_0x26dcec,_0x44c681){var _0xe38e76={'raw':![],'where':{}};var _0x35c1aa={};var _0x180fee={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x26dcec[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x44c681,null))[_0xa757('0x11')](function(_0x346a4a){if(_0x346a4a){_0x35c1aa[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x59')][_0xa757('0x2f')]);_0x35c1aa[_0xa757('0x34')]=_[_0xa757('0x35')](_0x26dcec[_0xa757('0x34')]);_0x35c1aa[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],_0x35c1aa[_0xa757('0x34')]);_0xe38e76[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],qs[_0xa757('0x38')](_0x26dcec[_0xa757('0x34')][_0xa757('0x38')]));_0xe38e76[_0xa757('0x37')]=_0xe38e76['attributes'][_0xa757('0x39')]?_0xe38e76[_0xa757('0x37')]:_0x35c1aa['model'];if(!_0x26dcec[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0xe38e76[_0xa757('0x21')]=qs['limit'](_0x26dcec[_0xa757('0x34')][_0xa757('0x21')]);_0xe38e76[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x26dcec['query'][_0xa757('0x3c')]);}_0xe38e76[_0xa757('0x3d')]=qs['sort'](_0x26dcec[_0xa757('0x34')][_0xa757('0x3e')]);_0xe38e76['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x26dcec[_0xa757('0x34')],_0x35c1aa[_0xa757('0x40')]));_0xe38e76[_0xa757('0x3f')][_0xa757('0x54')]=_0x346a4a['id'];if(_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]){_0xe38e76[_0xa757('0x3f')]=_['merge'](_0xe38e76['where'],{'$or':_[_0xa757('0x2d')](_0xe38e76[_0xa757('0x37')],function(_0x11baf9){var _0x234855={};_0x234855[_0x11baf9]={'$like':'%'+_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x234855;})});}_0xe38e76=_[_0xa757('0x43')]({},_0xe38e76,_0x26dcec['options']);return db[_0xa757('0x59')]['count']({'where':_0xe38e76[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x365a0d){_0x180fee[_0xa757('0x46')]=_0x365a0d;if(_0x26dcec[_0xa757('0x34')]['includeAll']){_0xe38e76[_0xa757('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa757('0x48')](_0xe38e76);})[_0xa757('0x11')](function(_0x183097){_0x180fee[_0xa757('0x49')]=_0x183097;return _0x180fee;});}})['then'](respondWithFilteredResult(_0x44c681,_0xe38e76))[_0xa757('0x4c')](handleError(_0x44c681,null));};exports[_0xa757('0x5b')]=function(_0x187681,_0x3c6d51){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x187681[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c6d51,null))['then'](function(_0x24fd9c){if(_0x24fd9c){return _0x24fd9c[_0xa757('0x5b')](_0x187681[_0xa757('0x34')][_0xa757('0x58')]);}})['then'](respondWithStatusCode(_0x3c6d51,null))[_0xa757('0x4c')](handleError(_0x3c6d51,null));};exports[_0xa757('0x5c')]=function(_0x441f80,_0x9b5432){_0x441f80[_0xa757('0x4e')][_0xa757('0x5d')]=_0x441f80[_0xa757('0x5e')]['filename'];return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x441f80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x9b5432,null))['then'](saveUpdates(_0x441f80['body'],null))[_0xa757('0x11')](respondWithResult(_0x9b5432,null))[_0xa757('0x4c')](handleError(_0x9b5432,null));};exports[_0xa757('0x5f')]=function(_0x218030,_0xb95266){_0x218030[_0xa757('0x4e')][_0xa757('0x60')]=_0x218030[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')]['find']({'where':{'id':_0x218030[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0xb95266,null))[_0xa757('0x11')](saveUpdates(_0x218030[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0xb95266,null))[_0xa757('0x4c')](handleError(_0xb95266,null));};exports['addCustomerAvatar']=function(_0x3738f9,_0x3ba04e){_0x3738f9[_0xa757('0x4e')][_0xa757('0x62')]=_0x3738f9[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x3738f9[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3ba04e,null))[_0xa757('0x11')](saveUpdates(_0x3738f9[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x3ba04e,null))[_0xa757('0x4c')](handleError(_0x3ba04e,null));};exports[_0xa757('0x63')]=function(_0x56a060,_0x4af060){_0x56a060[_0xa757('0x4e')]['systemAvatar']=_0x56a060[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x56a060['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4af060,null))[_0xa757('0x11')](saveUpdates(_0x56a060[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x4af060,null))[_0xa757('0x4c')](handleError(_0x4af060,null));};exports[_0xa757('0x64')]=function(_0x526b82,_0x3cb1ec){var _0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x67'));var _0x4b1c4c={'where':{'id':_0x526b82['params']['id']},'attributes':['id',_0xa757('0x5d')],'raw':!![]};var _0x531cba=![];return require(_0xa757('0x68'))['getLicense']()[_0xa757('0x11')](function(_0x1dee22){if(_0x1dee22){_0x531cba=_0x1dee22[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x4b1c4c);})[_0xa757('0x11')](handleEntityNotFound(_0x3cb1ec,null))[_0xa757('0x11')](function(_0x2ac258){if(_0x2ac258){if(!_[_0xa757('0x6a')](_0x2ac258[_0xa757('0x5d')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6b'),_0x2ac258[_0xa757('0x5d')]))&&_0x531cba){_0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/logos/',_0x2ac258[_0xa757('0x5d')]);}}return _0x3cb1ec[_0xa757('0x6c')](_0x3cca3e);}})['catch'](handleError(_0x3cb1ec,null));};exports[_0xa757('0x6d')]=function(_0x68a80b,_0x1f4782){var _0x5e6171=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6e'));var _0xfdd493={'where':{'id':_0x68a80b[_0xa757('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0xfdd493)['then'](handleEntityNotFound(_0x1f4782,null))[_0xa757('0x11')](function(_0x544ed2){if(_0x544ed2){if(!_['isNil'](_0x544ed2[_0xa757('0x60')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x544ed2[_0xa757('0x60')]))){_0x5e6171=path['join'](config['root'],'server/files/images/avatars/',_0x544ed2['agentAvatar']);}}return _0x1f4782['download'](_0x5e6171);}})['catch'](handleError(_0x1f4782,null));};exports['getCustomerAvatar']=function(_0x1c9b81,_0x536b96){var _0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x71'));var _0x46fd6b={'where':{'id':_0x1c9b81[_0xa757('0x53')]['id']},'attributes':['id',_0xa757('0x62'),_0xa757('0x72')],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0x46fd6b)['then'](handleEntityNotFound(_0x536b96,null))[_0xa757('0x11')](function(_0x3147eb){if(_0x3147eb){if(!_[_0xa757('0x6a')](_0x3147eb[_0xa757('0x62')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x3147eb[_0xa757('0x62')]))&&_0x3147eb[_0xa757('0x72')]){_0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/avatars/',_0x3147eb[_0xa757('0x62')]);}}return _0x536b96[_0xa757('0x6c')](_0x1ba0df);}})['catch'](handleError(_0x536b96,null));};exports[_0xa757('0x73')]=function(_0x3924af,_0x332c68){var _0x18fa30=path[_0xa757('0x65')](config['root'],_0xa757('0x74'));var _0x237c6f={'where':{'id':_0x3924af[_0xa757('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x237c6f)[_0xa757('0x11')](handleEntityNotFound(_0x332c68,null))['then'](function(_0x21aeae){if(_0x21aeae){if(!_[_0xa757('0x6a')](_0x21aeae[_0xa757('0x75')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config['root'],_0xa757('0x70'),_0x21aeae['systemAvatar']))){_0x18fa30=path['join'](config[_0xa757('0x66')],_0xa757('0x70'),_0x21aeae[_0xa757('0x75')]);}}return _0x332c68[_0xa757('0x6c')](_0x18fa30);}})['catch'](handleError(_0x332c68,null));};exports[_0xa757('0x76')]=function(_0x36c462,_0x4735a9){var _0x2aa91b=require(_0xa757('0x77'));var _0x3e660e=new _0x2aa91b();var _0x182d4f=_0x3e660e[_0xa757('0x78')](_0x36c462['headers'][_0xa757('0x79')])[_0xa757('0x7a')]();var _0x1e6f99={'body':_0x36c462[_0xa757('0x4e')],'channel':_0xa757('0x7b')};var _0x182d71=[];var _0x3addae=[];var _0x4024d1={};var _0x160872=![];return db['CmContact']['describe']()[_0xa757('0x11')](function(_0x59b351){if(!_0x59b351){throw new db['Sequelize'][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x182d71=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f')]);_0x3addae=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),'ListId']);if(_0x36c462[_0xa757('0x4e')]['id']){delete _0x36c462[_0xa757('0x4e')]['id'];}if(_['isNil'](_0x36c462[_0xa757('0x4e')][_0xa757('0x81')])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0x83'));}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')])||_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')]['mapKey'])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}if(!_[_0xa757('0x84')](_0x3addae,_0x36c462[_0xa757('0x4e')][_0xa757('0x85')])){throw new db[(_0xa757('0x82'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}_0x4024d1[_0x36c462[_0xa757('0x4e')]['mapKey']]=_0x36c462[_0xa757('0x4e')]['from'];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x36c462[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa757('0x87'),'where':_0x4024d1,'limit':0x1,'order':[[_0xa757('0x7f'),_0xa757('0x88')]]}]},{'model':db[_0xa757('0x89')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x4735a9,null))[_0xa757('0x11')](function(_0x50ff83){if(_0x50ff83&&_0x50ff83[_0xa757('0x8a')]){_0x1e6f99[_0xa757('0x8b')]=_0x50ff83;_0x1e6f99[_0xa757('0x8c')]=_0x50ff83[_0xa757('0x8d')];_0x1e6f99[_0xa757('0x8e')]=_0x50ff83[_0xa757('0x8a')];_0x1e6f99[_0xa757('0x8c')]=_['orderBy'](_0x1e6f99[_0xa757('0x8c')],[_0xa757('0x8f')],[_0xa757('0x90')]);if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')]){delete _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')];}if(_0x1e6f99['account']['List']&&_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')][_0xa757('0x87')][_0xa757('0x39')]){return _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')]['Contacts'][0x0];}var _0x244c9b=_['defaults'](_0x36c462[_0xa757('0x4e')],{'firstName':_0x36c462[_0xa757('0x4e')][_0xa757('0x81')],'ListId':_0x50ff83[_0xa757('0x91')]});_0x244c9b[_0x36c462[_0xa757('0x4e')][_0xa757('0x85')]]=_0x36c462[_0xa757('0x4e')][_0xa757('0x81')];return db[_0xa757('0x92')][_0xa757('0x4d')](_0x244c9b,{'fields':_0x182d71,'raw':!![]});}})['then'](handleEntityNotFound(_0x4735a9,null))['then'](function(_0x3e025a){_0x1e6f99['contact']=_0x3e025a;var _0x4bd0a6=_0x36c462[_0xa757('0x4e')][_0xa757('0x93')];if(_0x36c462['headers'][_0xa757('0x94')]){_0x4bd0a6=_0x36c462['headers'][_0xa757('0x94')];}else if(_0x36c462[_0xa757('0x95')][_0xa757('0x96')]){_0x4bd0a6=_[_0xa757('0x97')](_0x36c462[_0xa757('0x95')][_0xa757('0x96')][_0xa757('0x98')](','));}if(_0x3e025a){var _0x44d742={'ContactId':_0x3e025a['id'],'ChatWebsiteId':_0x36c462['params']['id'],'from':(_0x3e025a['firstName']||'')+'\x20'+(_0x3e025a[_0xa757('0x99')]||''),'customerIp':_0x4bd0a6,'customerPort':_0x36c462['headers'][_0xa757('0x9a')]?_0x36c462[_0xa757('0x95')][_0xa757('0x9a')]:null,'referer':_0x36c462[_0xa757('0x4e')][_0xa757('0x9b')],'browserName':_0x182d4f[_0xa757('0x9c')][_0xa757('0x29')]&&_0x182d4f[_0xa757('0x9c')]['version']?util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['browser'][_0xa757('0x29')],_0x182d4f[_0xa757('0x9c')][_0xa757('0x9e')]):_0xa757('0x9f'),'browserVersion':_0x182d4f['browser'][_0xa757('0x9e')]||'unknown','osName':util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['os'][_0xa757('0x29')],_0x182d4f['os'][_0xa757('0x9e')]),'osVersion':_0x182d4f['os']['version'],'deviceModel':_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')]&&_0x182d4f['device'][_0xa757('0xa1')]?util[_0xa757('0x9d')](_0xa757('0xa2'),_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')],_0x182d4f[_0xa757('0xa0')][_0xa757('0xa1')],_0x182d4f['device'][_0xa757('0x31')]):null,'deviceVendor':_0x182d4f[_0xa757('0xa0')]['vendor'],'deviceType':_0x182d4f['device'][_0xa757('0x31')],'formData':JSON[_0xa757('0x17')](_0x36c462[_0xa757('0x4e')])};var _0x1612d5={'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'closed':![]};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]){_0x1612d5[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x5758db){if(_0x5758db){return[_0x5758db,![]];}_0x44d742[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];_0x44d742['externalUrl']=_0x36c462['body'][_0xa757('0xa5')];return db[_0xa757('0xa4')]['create'](_0x44d742)[_0xa757('0x11')](function(_0xa50160){return[_0xa50160,!![]];});});}_0x1612d5['ContactId']=_0x3e025a['id'];if(_0x36c462[_0xa757('0x4e')]['interaction']&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id']){_0x1612d5['id']=_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id'];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x69af1f){if(_0x69af1f){return[_0x69af1f,![]];}return db['ChatInteraction'][_0xa757('0x4d')](_0x44d742)['then'](function(_0x49f140){return[_0x49f140,!![]];});});}return db[_0xa757('0xa4')][_0xa757('0x4d')](_0x44d742)['then'](function(_0x488019){return[_0x488019,!![]];});}})['spread'](function(_0x31084d,_0x1f0e18){if(_0x31084d){_0x160872=_0x1f0e18;if(!_0x1f0e18){var _0x10cf3b={'from':(_0x1e6f99['contact'][_0xa757('0xa7')]||'')+'\x20'+(_0x1e6f99[_0xa757('0xa8')][_0xa757('0x99')]||'')};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')]&&_0x36c462[_0xa757('0x4e')]['threadId']!=_0x36c462[_0xa757('0x4e')]['messageId']){_0x10cf3b[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')];}return _0x31084d[_0xa757('0x23')](_0x10cf3b);}else{return _0x31084d;}}})[_0xa757('0x11')](function(_0x56c40e){_0x1e6f99[_0xa757('0xa6')]=_0x56c40e['get']({'plain':!![]});_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]=_0x160872;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]){if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0xab')]){_0x1e6f99[_0xa757('0x8c')][_0xa757('0xac')]({'id':0x0,'priority':_0x1e6f99[_0xa757('0x8c')]['length']+0x1,'app':'close','appdata':_0xa757('0xad'),'interval':_0xa757('0xae')});}}return db['ChatMessage'][_0xa757('0x4d')]({'body':_0x36c462[_0xa757('0x4e')]['body'],'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'ChatInteractionId':_0x56c40e['id'],'direction':'in','ContactId':_0x1e6f99['contact']['id'],'AttachmentId':_0x36c462[_0xa757('0x4e')][_0xa757('0xaf')]});})[_0xa757('0x11')](function(_0x2bdbdf){_0x1e6f99[_0xa757('0x1a')]=_0x2bdbdf;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]){return db[_0xa757('0xb1')][_0xa757('0x4b')]({'attributes':['id',_0xa757('0x29')],'where':{'id':_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]}})[_0xa757('0x11')](function(_0x5005fa){if(_0x5005fa){_0x1e6f99['applications'][_0xa757('0xb2')]({'id':0x0,'priority':0x0,'app':_0xa757('0xb3'),'appdata':_0x5005fa[_0xa757('0x29')]+','+(_0x1e6f99['account'][_0xa757('0xb4')]||0xa),'interval':_0xa757('0xae')});_0x1e6f99[_0xa757('0xb5')]=!![];}return respondWithRpcPromise(_0xa757('0xb6'),_0xa757('0xb7'),_0x1e6f99);});}return respondWithRpcPromise('Start','startRouting',_0x1e6f99);})[_0xa757('0x11')](function(_0x4606e1){respondWithRpcPromise(_0xa757('0xb8'),'EventManager',{'event':_0xa757('0x76'),'message':_0x4606e1},client9002);return _0x4606e1;})[_0xa757('0x11')](respondWithResult(_0x4735a9,null))['catch'](handleError(_0x4735a9,null));};exports[_0xa757('0xb9')]=function(_0x39527f,_0x257371){var _0x4f8908,_0x41d5d1,_0x5ae589;var _0x1b702f=[];var _0x3540ca={};var _0x22939e=_0x39527f[_0xa757('0xba')]||[];var _0x36ea16=[];var _0x53949c;return db[_0xa757('0x92')]['describe']()[_0xa757('0x11')](function(_0x439650){if(!_0x439650){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x1b702f=_['difference'](_[_0xa757('0x35')](_0x439650),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),_0xa757('0x91')]);if(_0x39527f['body']['id']){delete _0x39527f['body']['id'];}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')][_0xa757('0x81')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))]['ValidationError'](_0xa757('0x83')));}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')]['body'])||_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbc')));}if(_['isNil'](_0x39527f[_0xa757('0x4e')][_0xa757('0xbd')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbe')+_0x1b702f));}if(!_['includes'](_0x1b702f,_0x39527f[_0xa757('0x4e')]['mapKeyOffline'])){throw _0x257371[_0xa757('0x1d')](0x1f4)['send'](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbf')+_0x1b702f));}_0x3540ca[_0x39527f['body']['mapKeyOffline']]=_0x39527f['body'][_0xa757('0x81')];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39527f['params']['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List'},{'model':db[_0xa757('0xc0')],'as':_0xa757('0xc0')}]});})[_0xa757('0x11')](handleEntityNotFound(_0x257371,null))['then'](function(_0x42d869){if(_0x42d869&&_0x42d869['List']){_0x41d5d1=_0x42d869;var _0x2cd549=_[_0xa757('0xc1')](_0x39527f['body'],{'firstName':_0x39527f[_0xa757('0x4e')][_0xa757('0x81')],'phone':_0x39527f[_0xa757('0x4e')]['from'],'ListId':_0x42d869['ListId']});_0x2cd549[_0x39527f['body'][_0xa757('0xbd')]]=_0x39527f[_0xa757('0x4e')]['from'];return db['CmContact'][_0xa757('0xc2')]({'where':_0x3540ca,'defaults':_0x2cd549});}})[_0xa757('0xc3')](function(_0x1b7a7b){if(_0x1b7a7b){_0x5ae589=_0x1b7a7b;var _0x4da912=fs['readFileSync'](path['join'](config[_0xa757('0x66')],_0xa757('0xc4')),_0xa757('0xc5'));var _0x330523=ejs[_0xa757('0xc6')](_0x4da912,{'body':_[_0xa757('0xc7')](_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]),'bodyTitle':_0x41d5d1['offlineMessageBody']});return db[_0xa757('0xc8')][_0xa757('0x4d')]({'body':_0x330523,'plainBody':htmlToText['fromString'](_0x330523),'ContactId':_0x1b7a7b['id'],'ChatWebsiteId':_0x41d5d1['id']});}})[_0xa757('0x11')](function(_0x28ef9c){_0x53949c=_0x28ef9c;if(_0x22939e[_0xa757('0x39')]){var _0x34b501=_0x22939e[_0xa757('0x2d')](function(_0x9b7857){return{'name':_0x9b7857[_0xa757('0xc9')],'basename':_0x9b7857[_0xa757('0x61')],'type':_0x9b7857[_0xa757('0xca')],'ChatOfflineMessageId':_0x28ef9c['id']};});_0x36ea16=_0x34b501[_0xa757('0x2d')](_0x39afb0=>{var _0x1c55ad={'filename':_0x39afb0['name'],'path':path['join'](config[_0xa757('0x66')],_0xa757('0xcb'),_0xa757('0xba'),_0xa757('0xcc'),_0xa757('0xcd'),_0x39afb0[_0xa757('0xce')])};return _0x1c55ad;});if(!_0x41d5d1[_0xa757('0xcf')]){return db['sequelize'][_0xa757('0xd0')](function(_0x2266db){return db[_0xa757('0xd1')][_0xa757('0xd2')](_0x34b501,{'transaction':_0x2266db});});}}})[_0xa757('0x11')](function(){if(_0x53949c){_0x4f8908=_0x53949c;return db[_0xa757('0xc0')][_0xa757('0xd3')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xa757('0xd4'),'raw':!![]}]});}})[_0xa757('0x11')](function(_0x4ddabe){if(_0x4ddabe&&_0x4ddabe['Smtp']&&_0x41d5d1['forwardOffline']&&_0x41d5d1[_0xa757('0xd5')]){var _0x50f3e3={'tls':{'rejectUnauthorized':![]}};if(_0x4ddabe['Smtp'][_0xa757('0xd6')]){_0x50f3e3[_0xa757('0xd6')]=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd6')];}else{_0x50f3e3['host']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd7')];_0x50f3e3['port']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd8')];_0x50f3e3[_0xa757('0xd9')]=_0x4ddabe[_0xa757('0xd4')]['secure'];}if(_0x4ddabe[_0xa757('0xd4')][_0xa757('0xda')]){_0x50f3e3[_0xa757('0xdb')]={'user':_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')],'pass':_0x4ddabe[_0xa757('0xd4')][_0xa757('0xdc')]};}return respondWithRpcPromise(_0xa757('0xdd'),_0xa757('0xde'),{'account':_0x50f3e3,'message':{'from':util['format'](_0xa757('0xdf'),_0x4ddabe[_0xa757('0x29')],_0x4ddabe[_0xa757('0xe0')]||_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')]),'to':_0x41d5d1[_0xa757('0xd5')],'subject':_0x41d5d1[_0xa757('0xe1')],'html':_0x4f8908['body'],'attachments':_0x36ea16}},client9003)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2fa389){console[_0xa757('0x18')](_0x2fa389);});}})[_0xa757('0x11')](function(){if(_0x41d5d1&&_0x41d5d1[_0xa757('0xcf')]&&_0x41d5d1[_0xa757('0xe2')]){var _0x1eeff5=[];if(_0x22939e[_0xa757('0x39')]){_0x1eeff5=_0x22939e['map'](function(_0xe4b4ab){return{'name':_0xe4b4ab['originalname'],'basename':_0xe4b4ab['filename'],'type':_0xe4b4ab[_0xa757('0xca')],'ChatOfflineMessageId':_0x53949c['id']};});}var _0x48cf01;if(!_[_0xa757('0x6a')](_0x41d5d1[_0xa757('0xe3')])){var _0x54f4ca=_[_0xa757('0x2d')](_0x39527f['body'],function(_0x522478){return _0x522478;});var _0x451ca7=_['toPairsIn'](_0x54f4ca)[0x0];var _0x5730f3=_['mapValues'](_0x451ca7,function(_0x52aed8){return _0x52aed8;});_0x48cf01=_0x5730f3[0x1][_0x41d5d1['subjectOffline']];}var _0x3a98f9={'from':_0x5ae589[_0xa757('0xe0')],'firstName':_0x5ae589[_0xa757('0xa7')],'lastName':_0x5ae589[_0xa757('0x99')],'mapKey':'email','message':{'from':_0x5ae589[_0xa757('0xe0')],'to':_0x41d5d1[_0xa757('0xc0')][_0xa757('0xe0')],'cc':'','subject':_[_0xa757('0x6a')](_0x48cf01)?_0x41d5d1[_0xa757('0xe1')]:_0x48cf01,'messageId':'','sentAt':new Date(),'attach':_0x1eeff5[_0xa757('0x39')],'attachments':_0x1eeff5,'originChannel':_0xa757('0xe4'),'ChatWebsiteId':_0x41d5d1['id'],'ChatOfflineMessageId':_0x4f8908['id'],'originTo':_0x41d5d1['MailAccount'][_0xa757('0xe0')]},'body':_0x4f8908[_0xa757('0x4e')]};var _0x5be779={'account':{'id':_0x41d5d1[_0xa757('0xe2')]},'body':_0x3a98f9,'log':_0xa757('0xe5')};return respondWithRpcPromise('NotifyMailAccount',_0xa757('0xe6'),_0x5be779,client9001)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2aaf2a){console[_0xa757('0x18')](_0x2aaf2a);});}return;})[_0xa757('0x11')](function(){if(_0x4f8908){return _0x4f8908;}})[_0xa757('0x11')](respondWithResult(_0x257371,null))['catch'](function(_0x3d79d4){console[_0xa757('0x18')](_0xa757('0x4c'),_0x3d79d4);for(var _0x2f667c of _0x22939e){var _0x531b88=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0xcb'),'files',_0xa757('0xcc'),_0xa757('0xcd'),_0x2f667c['filename']);fs_extra[_0xa757('0xe7')](_0x531b88)['catch'](function(_0x1c38cb){console['error'](_0xa757('0xe8'),_0x531b88,_0x1c38cb);});}});};exports[_0xa757('0xe9')]=function(_0x3039d7,_0x58f20d){return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':{'id':_0x3039d7[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x58f20d,null))[_0xa757('0x11')](function(_0x4b274f){if(_0x4b274f){return _0x4b274f[_0xa757('0xe9')](_0x3039d7[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x3039d7[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0x58f20d,null))[_0xa757('0x4c')](handleError(_0x58f20d,null));};exports[_0xa757('0xeb')]=function(_0x35a0d8,_0x430ed6){var _0x31dba9={'raw':![],'where':{}};var _0x3eb7d4={};var _0x1b8b13={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa757('0xd3')]({'where':{'id':_0x35a0d8['params']['id']}})['then'](handleEntityNotFound(_0x430ed6,null))[_0xa757('0x11')](function(_0x3655fa){if(_0x3655fa){_0x3eb7d4[_0xa757('0x33')]=_['keys'](db[_0xa757('0xa4')]['rawAttributes']);_0x3eb7d4[_0xa757('0x34')]=_[_0xa757('0x35')](_0x35a0d8['query']);_0x3eb7d4[_0xa757('0x40')]=_['intersection'](_0x3eb7d4[_0xa757('0x33')],_0x3eb7d4[_0xa757('0x34')]);_0x31dba9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x3eb7d4[_0xa757('0x33')],qs[_0xa757('0x38')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x38')]));_0x31dba9[_0xa757('0x37')]=_0x31dba9[_0xa757('0x37')][_0xa757('0x39')]?_0x31dba9['attributes']:_0x3eb7d4[_0xa757('0x33')];if(!_0x35a0d8[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x31dba9[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x21')]);_0x31dba9['offset']=qs[_0xa757('0x3c')](_0x35a0d8['query'][_0xa757('0x3c')]);}_0x31dba9[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x3e')]);_0x31dba9['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x35a0d8[_0xa757('0x34')],_0x3eb7d4['filters']));_0x31dba9[_0xa757('0x3f')]['ChatWebsiteId']=_0x3655fa['id'];if(_0x35a0d8['query'][_0xa757('0x42')]){_0x31dba9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x31dba9[_0xa757('0x3f')],{'$or':_['map'](_0x31dba9[_0xa757('0x37')],function(_0xdc5215){var _0x41c5ec={};_0x41c5ec[_0xdc5215]={'$like':'%'+_0x35a0d8[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x41c5ec;})});}_0x31dba9=_['merge']({},_0x31dba9,_0x35a0d8['options']);return db['ChatInteraction']['count']({'where':_0x31dba9[_0xa757('0x3f')]})['then'](function(_0xb64ce5){_0x1b8b13[_0xa757('0x46')]=_0xb64ce5;if(_0x35a0d8[_0xa757('0x34')][_0xa757('0x56')]){_0x31dba9[_0xa757('0x47')]=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xb1')],'as':_0xa757('0xed'),'attributes':[_0xa757('0x29'),_0xa757('0xee'),_0xa757('0xef')],'required':![]},{'model':db[_0xa757('0xf0')],'as':_0xa757('0xf1'),'attributes':['id',_0xa757('0x29'),_0xa757('0xf2')],'where':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?{'id':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]}:undefined,'required':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?!![]:![]}];}return db[_0xa757('0xa4')][_0xa757('0x48')](_0x31dba9);})[_0xa757('0x11')](function(_0x1f0f82){_0x1b8b13[_0xa757('0x49')]=_0x1f0f82;return _0x1b8b13;});}})[_0xa757('0x11')](respondWithFilteredResult(_0x430ed6,_0x31dba9))['catch'](handleError(_0x430ed6,null));};function iftimePromise(_0x3bd029,_0x2f37ca){return respondWithRpcPromise(_0xa757('0xf4'),_0xa757('0xf5'),{'command':_0x2f37ca['timezone']?util[_0xa757('0x9d')](_0xa757('0xf6'),_0x3bd029[_0xa757('0xf7')],_0x2f37ca[_0xa757('0xf8')]):util[_0xa757('0x9d')](_0xa757('0xf9'),_0x3bd029[_0xa757('0xf7')])},client9002)[_0xa757('0x11')](function(_0x7e03ff){var _0x1bb7ed=_0x7e03ff&&_0x7e03ff[_0xa757('0xfa')](_0xa757('0xfb'))>=0x0?!![]:![];logger[_0xa757('0x12')](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029['interval'],_0x1bb7ed?_0xa757('0xfd'):_0xa757('0xfe'),_0x2f37ca['timezone']?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return _0x1bb7ed;})[_0xa757('0x4c')](function(_0x466f7b){logger['error'](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029[_0xa757('0xf7')],util[_0xa757('0x100')](_0x466f7b,{'showHidden':![],'depth':null}),_0x2f37ca[_0xa757('0xf8')]?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return![];});}exports[_0xa757('0xf5')]=function(_0x195707,_0x32311d){var _0x1d83a8=0x0;var _0x2da3b2=0x0;var _0x4f10fc=![];var _0x5d427d;var _0x5ad837;return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x195707[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x101'),'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x102'),'attributes':['id',_0xa757('0xf7')],'raw':!![]}]}]})[_0xa757('0x11')](handleEntityNotFound(_0x32311d,null))[_0xa757('0x11')](function(_0x46c664){if(_0x46c664){_0x5d427d=_0x46c664;return _0x46c664[_0xa757('0x103')]({'raw':!![]});}})[_0xa757('0x11')](function(_0x7af4cd){if(_0x5d427d){if(_0x7af4cd){_0x5ad837=_0x7af4cd;}}return require(_0xa757('0x68'))[_0xa757('0x104')]();})[_0xa757('0x11')](function(_0x38727a){if(_0x38727a){_0x2da3b2=_0x38727a[_0xa757('0x105')];_0x4f10fc=_0x38727a[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0xa4')][_0xa757('0x46')]({'where':{'closed':![]}});})[_0xa757('0x11')](function(_0x196823){_0x1d83a8=_0x196823;if(_0x2da3b2&&_0x196823>_0x2da3b2){return db['License'][_0xa757('0xd3')]({'where':{'id':0x1}})[_0xa757('0x11')](function(_0x2328eb){if(_0x2328eb){_0x2328eb[_0xa757('0x106')]('chatLicenseExceeded');}});}})[_0xa757('0x11')](function(){if(_0x5d427d['Interval']&&_0x5d427d[_0xa757('0x101')][_0xa757('0x102')]){var _0x1a2818=[];for(var _0x56b7f3=0x0;_0x56b7f3<_0x5d427d[_0xa757('0x101')]['Intervals']['length'];_0x56b7f3++){var _0x411c88=_0x5d427d[_0xa757('0x101')]['Intervals'][_0x56b7f3][_0xa757('0x25')]({'plain':!![]});_0x1a2818[_0xa757('0xac')](iftimePromise(_0x411c88,_0x5d427d));}return BPromise[_0xa757('0x107')](_0x1a2818)[_0xa757('0x11')](function(_0x39442a){return _[_0xa757('0x108')](_0x39442a);});}else{return!![];}})[_0xa757('0x11')](function(_0x3ef371){var _0x46465a=fs[_0xa757('0x109')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x10a')),_0xa757('0xc5'));var _0x466b78={'remote':_0x5d427d[_0xa757('0x10b')],'query':querystring[_0xa757('0x17')](_[_0xa757('0x43')](_0x5d427d[_0xa757('0x25')]({'plain':!![]}),{'customerIp':_0x195707['headers']['x-forwarded-for']||_0x195707[_0xa757('0x95')][_0xa757('0x10c')]||_0x195707[_0xa757('0x10d')][_0xa757('0x10e')]||_0x195707['ip'],'referer':_0x195707[_0xa757('0x95')][_0xa757('0x9b')],'openedInteractions':_0x1d83a8,'maxInteractions':_0x2da3b2,'virtual':_0x4f10fc[_0xa757('0x105')],'online':_0x3ef371,'custom':_0x4f10fc}))['replace'](/'/g,'\x5c\x27')};_0x32311d[_0xa757('0xbb')](ejs[_0xa757('0xc6')](Mustache[_0xa757('0xc6')](_0x46465a,_0x466b78),{'proactiveActions':_0x5ad837,'alignment':_0x5d427d[_0xa757('0x10f')],'verticalAlignment':_0x5d427d[_0xa757('0x110')],'div_color':_0x5d427d['color'],'labelText':_0x5d427d[_0xa757('0x111')],'text_color':_0x5d427d['textColor'],'button_color':_0x5d427d[_0xa757('0x112')],'background_color':_0x5d427d['backgroundColor']}));})[_0xa757('0x4c')](handleError(_0x32311d,null));};exports[_0xa757('0x113')]=function(_0x52a8a8,_0x59039a){var _0x2892a7=_0x52a8a8[_0xa757('0x53')]['id'];var _0x54a489=_0x52a8a8[_0xa757('0x4e')];var _0xe21512=0xc8;var _0x25aad1=null;return db[_0xa757('0x114')][_0xa757('0xd0')]({'isolationLevel':db[_0xa757('0x114')]['Transaction'][_0xa757('0x115')][_0xa757('0x116')]},function(_0x1132f2){return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(_0x1e3ee8){if(_0x1e3ee8){return db[_0xa757('0x89')][_0xa757('0x24')]({'where':{'ChatWebsiteId':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(){var _0x17135b=_[_0xa757('0x2d')](_0x54a489,function(_0x4ebd06){_0x4ebd06[_0xa757('0x54')]=_0x2892a7;return _0x4ebd06;});return db[_0xa757('0x89')][_0xa757('0xd2')](_0x17135b,{'transaction':_0x1132f2});});}else{_0xe21512=0x194;_0x25aad1=[];}});})[_0xa757('0x11')](function(){if(_0xe21512!==0x194){return db['ChatApplication'][_0xa757('0x117')]({'where':{'ChatWebsiteId':_0x2892a7},'order':_0xa757('0x8f')})[_0xa757('0x11')](function(_0x141d20){_0x25aad1=_0x141d20;});}})[_0xa757('0x4c')](function(_0x54f67c){_0xe21512=0x1f4;logger[_0xa757('0x18')](_0x54f67c[_0xa757('0x28')]);if(_0x54f67c[_0xa757('0x29')]){delete _0x54f67c[_0xa757('0x29')];}_0x25aad1=_0x54f67c;})[_0xa757('0x118')](function(){if(_0x25aad1===null){_0x59039a[_0xa757('0x1c')](_0xe21512);}else{if(_0xe21512===0x1f4){_0x59039a[_0xa757('0x1d')](_0xe21512)[_0xa757('0xbb')](_0x25aad1);}else{_0x59039a[_0xa757('0x1d')](_0xe21512)['json'](_0x25aad1);}}});};exports[_0xa757('0x119')]=function(_0x505a2a,_0x344d13){var _0x5836cd={};var _0x35fe4e={};var _0x418eeb;var _0xc25de1;return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x505a2a[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x344d13,null))[_0xa757('0x11')](function(_0x16a500){if(_0x16a500){_0x418eeb=_0x16a500;_0x35fe4e[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x89')][_0xa757('0x2f')]);_0x35fe4e[_0xa757('0x34')]=_[_0xa757('0x35')](_0x505a2a[_0xa757('0x34')]);_0x35fe4e[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],_0x35fe4e[_0xa757('0x34')]);_0x5836cd[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],qs[_0xa757('0x38')](_0x505a2a[_0xa757('0x34')][_0xa757('0x38')]));_0x5836cd[_0xa757('0x37')]=_0x5836cd[_0xa757('0x37')]['length']?_0x5836cd[_0xa757('0x37')]:_0x35fe4e[_0xa757('0x33')];_0x5836cd[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x505a2a[_0xa757('0x34')][_0xa757('0x3e')]);_0x5836cd[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x505a2a[_0xa757('0x34')],_0x35fe4e['filters']));if(_0x505a2a['query'][_0xa757('0x42')]){_0x5836cd[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x5836cd[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x5836cd['attributes'],function(_0xf19c44){var _0x648a92={};_0x648a92[_0xf19c44]={'$like':'%'+_0x505a2a[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x648a92;})});}_0x5836cd=_[_0xa757('0x43')]({},_0x5836cd,_0x505a2a[_0xa757('0x45')]);return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x4c53e3){if(_0x4c53e3){_0xc25de1=_0x4c53e3[_0xa757('0x39')];if(!_0x505a2a[_0xa757('0x34')]['hasOwnProperty']('nolimit')){_0x5836cd['limit']=qs[_0xa757('0x21')](_0x505a2a[_0xa757('0x34')][_0xa757('0x21')]);_0x5836cd[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x505a2a[_0xa757('0x34')]['offset']);}return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x14ab00){if(_0x14ab00){return _0x14ab00?{'count':_0xc25de1,'rows':_0x14ab00}:null;}})[_0xa757('0x11')](respondWithResult(_0x344d13,null))[_0xa757('0x4c')](handleError(_0x344d13,null));};exports['addProactiveActions']=function(_0x34cd11,_0xd8ff77){return db[_0xa757('0x11a')][_0xa757('0x4b')]({'where':{'id':_0x34cd11[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0xd8ff77,null))[_0xa757('0x11')](function(_0x5da427){if(_0x5da427){return _0x5da427[_0xa757('0x11b')](_0x34cd11[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x34cd11[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0xd8ff77,null))[_0xa757('0x4c')](handleError(_0xd8ff77,null));};exports[_0xa757('0x103')]=function(_0x4067a2,_0x2e8eb6){var _0x3e454d={};var _0x265365={};var _0x3b12e9;var _0x1b753b;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x4067a2[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e8eb6,null))[_0xa757('0x11')](function(_0x119e10){if(_0x119e10){_0x3b12e9=_0x119e10;_0x265365['model']=_[_0xa757('0x35')](db[_0xa757('0x11c')]['rawAttributes']);_0x265365['query']=_[_0xa757('0x35')](_0x4067a2[_0xa757('0x34')]);_0x265365[_0xa757('0x40')]=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],_0x265365[_0xa757('0x34')]);_0x3e454d['attributes']=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],qs['fields'](_0x4067a2[_0xa757('0x34')][_0xa757('0x38')]));_0x3e454d['attributes']=_0x3e454d['attributes']['length']?_0x3e454d[_0xa757('0x37')]:_0x265365[_0xa757('0x33')];_0x3e454d['order']=qs[_0xa757('0x3e')](_0x4067a2['query'][_0xa757('0x3e')]);_0x3e454d[_0xa757('0x3f')]=qs['filters'](_['pick'](_0x4067a2[_0xa757('0x34')],_0x265365[_0xa757('0x40')]));if(_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]){_0x3e454d[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x3e454d['where'],{'$or':_[_0xa757('0x2d')](_0x3e454d[_0xa757('0x37')],function(_0x5c371b){var _0x5c1bae={};_0x5c1bae[_0x5c371b]={'$like':'%'+_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x5c1bae;})});}_0x3e454d=_['merge']({},_0x3e454d,_0x4067a2['options']);return _0x3b12e9['getProactiveActions'](_0x3e454d);}})[_0xa757('0x11')](function(_0x21a21d){if(_0x21a21d){_0x1b753b=_0x21a21d[_0xa757('0x39')];if(!_0x4067a2[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3e454d[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x4067a2['query']['limit']);_0x3e454d[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x4067a2['query'][_0xa757('0x3c')]);}return _0x3b12e9[_0xa757('0x103')](_0x3e454d);}})[_0xa757('0x11')](function(_0x2d94f8){if(_0x2d94f8){return _0x2d94f8?{'count':_0x1b753b,'rows':_0x2d94f8}:null;}})[_0xa757('0x11')](respondWithResult(_0x2e8eb6,null))[_0xa757('0x4c')](handleError(_0x2e8eb6,null));};exports[_0xa757('0x11d')]=function(_0x26957f,_0x3c7bf7){var _0x1d431e=_0x26957f[_0xa757('0x34')]['online']===_0xa757('0x11e')?_0xa757('0x11f'):_0xa757('0x120');return db['ChatWebsite'][_0xa757('0x4b')]({'attributes':['id',_0x1d431e],'where':{'id':_0x26957f[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c7bf7,null))[_0xa757('0x11')](function(_0x325afa){if(_0x325afa){var _0x4be11c=_0x325afa[_0x1d431e];var _0x2c06d5=_0x4be11c&&_0x4be11c[_0xa757('0x121')]?_0x4be11c[_0xa757('0x121')]:[];_0x3c7bf7[_0xa757('0xbb')]({'fromKey':_[_0xa757('0x6a')](_0x4be11c[_0xa757('0x122')])?undefined:_0x4be11c['fromKey'],'count':_0x2c06d5[_0xa757('0x39')],'rows':_0x2c06d5});}})[_0xa757('0x4c')](handleError(_0x3c7bf7,null));};exports[_0xa757('0x123')]=function(_0x193bd6,_0x4ed18b){var _0x3ae2d6={'raw':![],'where':{}};var _0x1f687b={};var _0x40d442={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x193bd6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4ed18b,null))['then'](function(_0x5cce3e){if(_0x5cce3e){_0x1f687b[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0xc8')][_0xa757('0x2f')]);_0x1f687b['query']=_[_0xa757('0x35')](_0x193bd6[_0xa757('0x34')]);_0x1f687b[_0xa757('0x40')]=_[_0xa757('0x36')](_0x1f687b['model'],_0x1f687b[_0xa757('0x34')]);_0x3ae2d6[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1f687b[_0xa757('0x33')],qs[_0xa757('0x38')](_0x193bd6[_0xa757('0x34')][_0xa757('0x38')]));_0x3ae2d6[_0xa757('0x37')]=_0x3ae2d6[_0xa757('0x37')][_0xa757('0x39')]?_0x3ae2d6[_0xa757('0x37')]:_0x1f687b[_0xa757('0x33')];if(!_0x193bd6[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3ae2d6[_0xa757('0x21')]=qs['limit'](_0x193bd6[_0xa757('0x34')][_0xa757('0x21')]);_0x3ae2d6['offset']=qs[_0xa757('0x3c')](_0x193bd6[_0xa757('0x34')][_0xa757('0x3c')]);}_0x3ae2d6[_0xa757('0x3d')]=qs['sort'](_0x193bd6[_0xa757('0x34')][_0xa757('0x3e')]);_0x3ae2d6['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x193bd6[_0xa757('0x34')],_0x1f687b[_0xa757('0x40')]));_0x3ae2d6['where'][_0xa757('0x54')]=_0x5cce3e['id'];if(_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]){_0x3ae2d6['where']=_['merge'](_0x3ae2d6[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x3ae2d6[_0xa757('0x37')],function(_0x5df3a1){var _0x3949b5={};_0x3949b5[_0x5df3a1]={'$like':'%'+_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x3949b5;})});}_0x3ae2d6=_['merge']({},_0x3ae2d6,_0x193bd6[_0xa757('0x45')]);return db['ChatOfflineMessage'][_0xa757('0x46')]({'where':_0x3ae2d6[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x3d3fbe){_0x40d442[_0xa757('0x46')]=_0x3d3fbe;if(_0x193bd6['query'][_0xa757('0x56')]){_0x3ae2d6[_0xa757('0x47')]=[{'all':!![]}];}else{_0x3ae2d6['include']=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xd1')],'as':_0xa757('0x124'),'required':![]}];}return db[_0xa757('0xc8')][_0xa757('0x48')](_0x3ae2d6);})[_0xa757('0x11')](function(_0x4779a1){_0x40d442[_0xa757('0x49')]=_0x4779a1;return _0x40d442;});}})['then'](respondWithFilteredResult(_0x4ed18b,_0x3ae2d6))[_0xa757('0x4c')](handleError(_0x4ed18b,null));};exports['addAgents']=function(_0x153d6e,_0x5cce1a){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x153d6e[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5cce1a,null))['then'](function(_0x19d612){if(_0x19d612){return _0x19d612[_0xa757('0x125')](_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x153d6e[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{})['spread'](function(_0x2dd360){for(var _0x17a46c=0x0;_0x17a46c<_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0xa757('0x39')];_0x17a46c+=0x1){socket['emit'](_0xa757('0x126'),{'UserId':Number(_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0x17a46c]),'ChatWebsiteId':Number(_0x153d6e[_0xa757('0x53')]['id'])});}return _0x2dd360;});}})[_0xa757('0x11')](respondWithResult(_0x5cce1a,null))[_0xa757('0x4c')](handleError(_0x5cce1a,null));};exports[_0xa757('0x127')]=function(_0x509030,_0x20c801){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x509030[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x20c801,null))[_0xa757('0x11')](function(_0x2f435e){if(_0x2f435e){return _0x2f435e[_0xa757('0x127')](_0x509030['query'][_0xa757('0x58')])[_0xa757('0x11')](function(){if(_[_0xa757('0x128')](_0x509030['query']['ids'])){for(var _0x38ebb2=0x0;_0x38ebb2<_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0xa757('0x39')];_0x38ebb2+=0x1){socket[_0xa757('0x129')](_0xa757('0x12a'),{'UserId':Number(_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0x38ebb2]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}}else{socket['emit'](_0xa757('0x12a'),{'UserId':Number(_0x509030['query'][_0xa757('0x58')]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}});}})[_0xa757('0x11')](respondWithStatusCode(_0x20c801,null))['catch'](handleError(_0x20c801,null));};exports[_0xa757('0x12b')]=function(_0x13dd20,_0x42a68c){var _0x35b73f={};var _0x45249e={};var _0x381ec6;var _0x29ebb3;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x13dd20[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x42a68c,null))[_0xa757('0x11')](function(_0x39ee36){if(_0x39ee36){_0x381ec6=_0x39ee36;_0x45249e[_0xa757('0x33')]=_['keys'](db['User'][_0xa757('0x2f')]);_0x45249e['query']=_[_0xa757('0x35')](_0x13dd20['query']);_0x45249e['filters']=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],_0x45249e[_0xa757('0x34')]);_0x35b73f[_0xa757('0x37')]=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],qs['fields'](_0x13dd20['query'][_0xa757('0x38')]));_0x35b73f[_0xa757('0x37')]=_0x35b73f['attributes']['length']?_0x35b73f['attributes']:_0x45249e[_0xa757('0x33')];_0x35b73f[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x13dd20['query'][_0xa757('0x3e')]);_0x35b73f[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x13dd20[_0xa757('0x34')],_0x45249e[_0xa757('0x40')]));if(_0x13dd20[_0xa757('0x34')][_0xa757('0x42')]){_0x35b73f[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x35b73f[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x35b73f[_0xa757('0x37')],function(_0x32f78f){var _0x4fc399={};_0x4fc399[_0x32f78f]={'$like':'%'+_0x13dd20[_0xa757('0x34')]['filter']+'%'};return _0x4fc399;})});}_0x35b73f=_[_0xa757('0x43')]({},_0x35b73f,_0x13dd20[_0xa757('0x45')]);return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0xe79266){if(_0xe79266){_0x29ebb3=_0xe79266[_0xa757('0x39')];if(!_0x13dd20[_0xa757('0x34')][_0xa757('0x3a')]('nolimit')){_0x35b73f[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x13dd20[_0xa757('0x34')][_0xa757('0x21')]);_0x35b73f[_0xa757('0x3c')]=qs['offset'](_0x13dd20[_0xa757('0x34')][_0xa757('0x3c')]);}return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0x2a5c0a){if(_0x2a5c0a){return _0x2a5c0a?{'count':_0x29ebb3,'rows':_0x2a5c0a}:null;}})[_0xa757('0x11')](respondWithResult(_0x42a68c,null))[_0xa757('0x4c')](handleError(_0x42a68c,null));}; \ No newline at end of file +var _0x0b0e=['mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','forwardOffline','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','getInteractions','User','Owner','internal','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','omit','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','http','client','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','ChatWebsiteId','Disposition','getDispositions','rawAttributes','findAll','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','existsSync','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','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','DESC','ChatApplication','Applications','account','applications','orderBy','defaults','ListId','CmContact','contact','customerIp','cf-connecting-ip','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','interaction','ChatInteraction','spread','lastName','messageId','created','push','*,*,*,*','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline'];(function(_0x40f180,_0x352e69){var _0x15612e=function(_0x109ee8){while(--_0x109ee8){_0x40f180['push'](_0x40f180['shift']());}};_0x15612e(++_0x352e69);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x0b0e[_0xa28b1a];return _0x4c9b78;};'use strict';var BPromise=require(_0xe0b0('0x0'));var Mustache=require('mustache');var util=require(_0xe0b0('0x1'));var path=require('path');var ejs=require(_0xe0b0('0x2'));var fs=require('fs');var fs_extra=require(_0xe0b0('0x3'));var _=require(_0xe0b0('0x4'));var querystring=require(_0xe0b0('0x5'));var Redis=require(_0xe0b0('0x6'));var qs=require(_0xe0b0('0x7'));var logger=require(_0xe0b0('0x8'))(_0xe0b0('0x9'));var config=require(_0xe0b0('0xa'));var db=require(_0xe0b0('0xb'))['db'];config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);var htmlToText=require(_0xe0b0('0x10'));var jayson=require(_0xe0b0('0x11'));var client=jayson['client'][_0xe0b0('0x12')]({'port':0x232c});var client9002=jayson[_0xe0b0('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xe0b0('0x13')][_0xe0b0('0x12')]({'port':0x232b});var client9001=jayson[_0xe0b0('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3068c0,_0x1c358a,_0x3cc19a,_0x45f914){return new BPromise(function(_0x34fed4,_0x4d2bf7){var _0x3782be=_0x45f914||client;return _0x3782be[_0xe0b0('0x14')](_0x3068c0,_0x3cc19a)[_0xe0b0('0x15')](function(_0x24babd){logger[_0xe0b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0xe0b0('0x17'));logger['debug'](_0xe0b0('0x18'),_0x1c358a,_0xe0b0('0x17'),JSON['stringify'](_0x24babd));if(_0x24babd[_0xe0b0('0x19')]){if(_0x24babd['error'][_0xe0b0('0x1a')]===0x1f4){logger[_0xe0b0('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0x24babd['error'][_0xe0b0('0x1b')]);return _0x4d2bf7(_0x24babd['error']['message']);}logger['error'](_0xe0b0('0x1c'),_0x1c358a,_0x24babd['error']['message']);return _0x34fed4(_0x24babd[_0xe0b0('0x19')]['message']);}else{logger[_0xe0b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0xe0b0('0x17'));_0x34fed4(_0x24babd[_0xe0b0('0x1d')][_0xe0b0('0x1b')]);}})[_0xe0b0('0x1e')](function(_0x2cf6a1){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0x2cf6a1);_0x4d2bf7(_0x2cf6a1);});});}function respondWithStatusCode(_0x2fa820,_0x5512bb){_0x5512bb=_0x5512bb||0xcc;return function(_0x12b260){if(_0x12b260){return _0x2fa820[_0xe0b0('0x1f')](_0x5512bb);}return _0x2fa820['status'](_0x5512bb)[_0xe0b0('0x20')]();};}function respondWithResult(_0x503883,_0x2208d0){_0x2208d0=_0x2208d0||0xc8;return function(_0x49a727){if(_0x49a727){return _0x503883[_0xe0b0('0x21')](_0x2208d0)['json'](_0x49a727);}};}function respondWithFilteredResult(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(_0x4700cc){var _0x4aafbe=typeof _0x4de537[_0xe0b0('0x22')]==='undefined'&&typeof _0x4de537[_0xe0b0('0x23')]===_0xe0b0('0x24');var _0x1f1ebd=_0x4700cc[_0xe0b0('0x25')];var _0x3ec2=_0x4aafbe?0x0:_0x4de537[_0xe0b0('0x22')];var _0x5200a6=_0x4aafbe?_0x4700cc[_0xe0b0('0x25')]:_0x4de537[_0xe0b0('0x22')]+_0x4de537['limit'];var _0x15e13b;if(_0x5200a6>=_0x1f1ebd){_0x5200a6=_0x1f1ebd;_0x15e13b=0xc8;}else{_0x15e13b=0xce;}_0x3e5c88[_0xe0b0('0x21')](_0x15e13b);return _0x3e5c88[_0xe0b0('0x26')](_0xe0b0('0x27'),_0x3ec2+'-'+_0x5200a6+'/'+_0x1f1ebd)[_0xe0b0('0x28')](_0x4700cc);}return null;};}function saveUpdates(_0x254cad){return function(_0x136bd4){if(_0x136bd4){return _0x136bd4['update'](_0x254cad)[_0xe0b0('0x15')](function(_0x3c0109){return _0x3c0109;});}return null;};}function removeEntity(_0x48a9b5){return function(_0x4fe400){if(_0x4fe400){return _0x4fe400[_0xe0b0('0x29')]()[_0xe0b0('0x15')](function(){var _0x422575=_0x4fe400[_0xe0b0('0x2a')]({'plain':!![]});var _0x2ab1b1='ChatWebsites';return db[_0xe0b0('0x2b')][_0xe0b0('0x29')]({'where':{'type':_0x2ab1b1,'resourceId':_0x422575['id']}})[_0xe0b0('0x15')](function(){return _0x4fe400;});})[_0xe0b0('0x15')](function(){_0x48a9b5[_0xe0b0('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ebf2a){return function(_0x208945){if(!_0x208945){_0x3ebf2a[_0xe0b0('0x1f')](0x194);}return _0x208945;};}function handleError(_0x31c6f5,_0x3575bc){_0x3575bc=_0x3575bc||0x1f4;return function(_0x12eeb8){logger[_0xe0b0('0x19')](_0x12eeb8[_0xe0b0('0x2c')]);if(_0x12eeb8[_0xe0b0('0x2d')]){delete _0x12eeb8[_0xe0b0('0x2d')];}_0x31c6f5[_0xe0b0('0x21')](_0x3575bc)[_0xe0b0('0x2e')](_0x12eeb8);};}exports[_0xe0b0('0x2f')]=function(_0x2a1c44,_0xca25d){var _0x4cf80c={'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]},_0x121608={},_0x135be5={'count':0x0,'rows':[]};var _0x1a2d24=_[_0xe0b0('0x32')](db[_0xe0b0('0x33')]['rawAttributes'],function(_0x521243){return{'name':_0x521243['fieldName'],'type':_0x521243['type'][_0xe0b0('0x34')]};});_0x121608[_0xe0b0('0x35')]=_[_0xe0b0('0x32')](_0x1a2d24,'name');_0x121608[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x2a1c44[_0xe0b0('0x36')]);_0x121608[_0xe0b0('0x38')]=_['intersection'](_0x121608[_0xe0b0('0x35')],_0x121608[_0xe0b0('0x36')]);_0x4cf80c[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x121608[_0xe0b0('0x35')],qs[_0xe0b0('0x3b')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x4cf80c[_0xe0b0('0x39')]=_0x4cf80c['attributes'][_0xe0b0('0x3c')]?_0x4cf80c['attributes']:_0x121608[_0xe0b0('0x35')];if(!_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x4cf80c['limit']=qs[_0xe0b0('0x23')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x4cf80c[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x22')]);}_0x4cf80c[_0xe0b0('0x3f')]=qs['sort'](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x4cf80c['where']=qs['filters'](_[_0xe0b0('0x41')](_0x2a1c44[_0xe0b0('0x36')],_0x121608['filters']),_0x1a2d24);if(_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x4cf80c[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x4cf80c[_0xe0b0('0x43')],{'$or':_['map'](_0x1a2d24,function(_0x5d2fa2){if(_0x5d2fa2['type']!==_0xe0b0('0x45')){var _0x38e715={};_0x38e715[_0x5d2fa2['name']]={'$like':'%'+_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x38e715;}})});}_0x4cf80c=_[_0xe0b0('0x44')]({},_0x4cf80c,_0x2a1c44[_0xe0b0('0x46')]);var _0x16ccca={'where':_0x4cf80c['where']};return db['ChatWebsite'][_0xe0b0('0x25')](_0x16ccca)[_0xe0b0('0x15')](function(_0x393218){_0x135be5[_0xe0b0('0x25')]=_0x393218;if(_0x2a1c44[_0xe0b0('0x36')]['includeAll']){_0x4cf80c[_0xe0b0('0x47')]=[{'all':!![]}];}return db[_0xe0b0('0x33')]['findAll'](_0x4cf80c);})['then'](function(_0x5ddad1){_0x135be5[_0xe0b0('0x48')]=_0x5ddad1;return _0x135be5;})[_0xe0b0('0x15')](respondWithFilteredResult(_0xca25d,_0x4cf80c))[_0xe0b0('0x1e')](handleError(_0xca25d,null));};exports[_0xe0b0('0x49')]=function(_0x5b1756,_0x2e2b10){var _0x87d8f3={'raw':![],'where':{'id':_0x5b1756['params']['id']},'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]},_0x483f12={};_0x483f12['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x33')]['rawAttributes']);_0x483f12['query']=_[_0xe0b0('0x37')](_0x5b1756['query']);_0x483f12[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x483f12[_0xe0b0('0x35')],_0x483f12[_0xe0b0('0x36')]);_0x87d8f3[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x483f12['model'],qs['fields'](_0x5b1756[_0xe0b0('0x36')]['fields']));_0x87d8f3['attributes']=_0x87d8f3[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x87d8f3['attributes']:_0x483f12['model'];if(_0x5b1756[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x87d8f3[_0xe0b0('0x47')]=[{'all':!![]}];}_0x87d8f3=_[_0xe0b0('0x44')]({},_0x87d8f3,_0x5b1756[_0xe0b0('0x46')]);return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x87d8f3)['then'](handleEntityNotFound(_0x2e2b10,null))[_0xe0b0('0x15')](respondWithResult(_0x2e2b10,null))['catch'](handleError(_0x2e2b10,null));};exports[_0xe0b0('0x4c')]=function(_0x54106c,_0x5b2055){return db[_0xe0b0('0x33')][_0xe0b0('0x4c')](_0x54106c[_0xe0b0('0x4d')],{})[_0xe0b0('0x15')](function(_0x3d8013){var _0x2a588d=_0x54106c[_0xe0b0('0x4e')][_0xe0b0('0x2a')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x4f'));if(_0x2a588d['role']===_0xe0b0('0x4e')){var _0x57ccc9=_0x3d8013[_0xe0b0('0x2a')]({'plain':!![]});var _0x3ae36e=_0xe0b0('0x50');return db[_0xe0b0('0x51')][_0xe0b0('0x4b')]({'where':{'name':_0x3ae36e,'userProfileId':_0x2a588d[_0xe0b0('0x52')]},'raw':!![]})['then'](function(_0x1a057c){if(_0x1a057c&&_0x1a057c[_0xe0b0('0x53')]===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x4c')]({'name':_0x57ccc9[_0xe0b0('0x2d')],'resourceId':_0x57ccc9['id'],'type':_0x1a057c[_0xe0b0('0x2d')],'sectionId':_0x1a057c['id']},{})[_0xe0b0('0x15')](function(){return _0x3d8013;});}else{return _0x3d8013;}})[_0xe0b0('0x1e')](function(_0x85824c){logger[_0xe0b0('0x19')](_0xe0b0('0x54'),_0x85824c);throw _0x85824c;});}return _0x3d8013;})[_0xe0b0('0x15')](respondWithResult(_0x5b2055,0xc9))[_0xe0b0('0x1e')](handleError(_0x5b2055,null));};exports[_0xe0b0('0x55')]=function(_0xcdf97,_0x34c642){if(_0xcdf97[_0xe0b0('0x4d')]['id']){delete _0xcdf97[_0xe0b0('0x4d')]['id'];}return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0xcdf97[_0xe0b0('0x56')]['id']},'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]})[_0xe0b0('0x15')](handleEntityNotFound(_0x34c642,null))[_0xe0b0('0x15')](saveUpdates(_0xcdf97[_0xe0b0('0x4d')],null))['then'](respondWithResult(_0x34c642,null))['catch'](handleError(_0x34c642,null));};exports[_0xe0b0('0x29')]=function(_0x2a0415,_0x157556){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x2a0415[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x157556,null))[_0xe0b0('0x15')](removeEntity(_0x157556,null))[_0xe0b0('0x1e')](handleError(_0x157556,null));};exports['describe']=function(_0x370f8c,_0x242120){return db[_0xe0b0('0x33')]['describe']()[_0xe0b0('0x15')](respondWithResult(_0x242120,null))[_0xe0b0('0x1e')](handleError(_0x242120,null));};exports['addDisposition']=function(_0x1bd249,_0x4c5478){if(_0x1bd249['body']['id']){delete _0x1bd249[_0xe0b0('0x4d')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x1bd249[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x4c5478,null))[_0xe0b0('0x15')](function(_0x1a4fad){if(_0x1a4fad){_0x1bd249['body'][_0xe0b0('0x57')]=_0x1a4fad['id'];return db[_0xe0b0('0x58')][_0xe0b0('0x4c')](_0x1bd249[_0xe0b0('0x4d')]);}})[_0xe0b0('0x15')](respondWithResult(_0x4c5478,null))[_0xe0b0('0x1e')](handleError(_0x4c5478,null));};exports[_0xe0b0('0x59')]=function(_0x224f1e,_0x514df5){var _0x51940f={'raw':![],'where':{}};var _0x4b41a={};var _0x35144f={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')]['findOne']({'where':{'id':_0x224f1e['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x514df5,null))[_0xe0b0('0x15')](function(_0x5d7cf4){if(_0x5d7cf4){_0x4b41a['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x58')][_0xe0b0('0x5a')]);_0x4b41a[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x224f1e[_0xe0b0('0x36')]);_0x4b41a[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x4b41a['model'],_0x4b41a[_0xe0b0('0x36')]);_0x51940f[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x4b41a['model'],qs['fields'](_0x224f1e['query']['fields']));_0x51940f['attributes']=_0x51940f['attributes'][_0xe0b0('0x3c')]?_0x51940f['attributes']:_0x4b41a['model'];if(!_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x51940f[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x51940f[_0xe0b0('0x22')]=qs['offset'](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x22')]);}_0x51940f[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x51940f[_0xe0b0('0x43')]=qs['filters'](_[_0xe0b0('0x41')](_0x224f1e['query'],_0x4b41a[_0xe0b0('0x38')]));_0x51940f[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x5d7cf4['id'];if(_0x224f1e[_0xe0b0('0x36')]['filter']){_0x51940f[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x51940f['where'],{'$or':_['map'](_0x51940f[_0xe0b0('0x39')],function(_0x30adc5){var _0x196625={};_0x196625[_0x30adc5]={'$like':'%'+_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x196625;})});}_0x51940f=_[_0xe0b0('0x44')]({},_0x51940f,_0x224f1e[_0xe0b0('0x46')]);return db[_0xe0b0('0x58')][_0xe0b0('0x25')]({'where':_0x51940f[_0xe0b0('0x43')]})['then'](function(_0x4c512b){_0x35144f[_0xe0b0('0x25')]=_0x4c512b;if(_0x224f1e['query']['includeAll']){_0x51940f['include']=[{'all':!![]}];}return db['Disposition'][_0xe0b0('0x5b')](_0x51940f);})['then'](function(_0x654d2b){_0x35144f[_0xe0b0('0x48')]=_0x654d2b;return _0x35144f;});}})[_0xe0b0('0x15')](respondWithFilteredResult(_0x514df5,_0x51940f))[_0xe0b0('0x1e')](handleError(_0x514df5,null));};exports['removeDispositions']=function(_0x31b218,_0x948708){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x31b218[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x948708,null))[_0xe0b0('0x15')](function(_0x27af09){if(_0x27af09){return _0x27af09['removeDispositions'](_0x31b218['query']['ids']);}})['then'](respondWithStatusCode(_0x948708,null))['catch'](handleError(_0x948708,null));};exports[_0xe0b0('0x5c')]=function(_0x567e1a,_0x3c09af){if(_0x567e1a['body']['id']){delete _0x567e1a[_0xe0b0('0x4d')]['id'];}return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x567e1a[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x3c09af,null))[_0xe0b0('0x15')](function(_0x58da19){if(_0x58da19){_0x567e1a['body']['ChatWebsiteId']=_0x58da19['id'];return db['CannedAnswer'][_0xe0b0('0x4c')](_0x567e1a[_0xe0b0('0x4d')]);}})[_0xe0b0('0x15')](respondWithResult(_0x3c09af,null))[_0xe0b0('0x1e')](handleError(_0x3c09af,null));};exports[_0xe0b0('0x5d')]=function(_0x534881,_0x234716){var _0x39a07b={'raw':![],'where':{}};var _0xf77616={};var _0xc6090e={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x534881[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x234716,null))[_0xe0b0('0x15')](function(_0x5565ef){if(_0x5565ef){_0xf77616['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x5f')]['rawAttributes']);_0xf77616[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x534881[_0xe0b0('0x36')]);_0xf77616[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0xf77616[_0xe0b0('0x35')],_0xf77616[_0xe0b0('0x36')]);_0x39a07b[_0xe0b0('0x39')]=_['intersection'](_0xf77616['model'],qs['fields'](_0x534881[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x39a07b['attributes']=_0x39a07b[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x39a07b[_0xe0b0('0x39')]:_0xf77616[_0xe0b0('0x35')];if(!_0x534881['query']['hasOwnProperty']('nolimit')){_0x39a07b[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x534881['query'][_0xe0b0('0x23')]);_0x39a07b[_0xe0b0('0x22')]=qs['offset'](_0x534881['query'][_0xe0b0('0x22')]);}_0x39a07b['order']=qs[_0xe0b0('0x40')](_0x534881['query'][_0xe0b0('0x40')]);_0x39a07b[_0xe0b0('0x43')]=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x534881[_0xe0b0('0x36')],_0xf77616[_0xe0b0('0x38')]));_0x39a07b[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x5565ef['id'];if(_0x534881[_0xe0b0('0x36')]['filter']){_0x39a07b[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x39a07b[_0xe0b0('0x43')],{'$or':_['map'](_0x39a07b[_0xe0b0('0x39')],function(_0x4ad24f){var _0x328c96={};_0x328c96[_0x4ad24f]={'$like':'%'+_0x534881[_0xe0b0('0x36')]['filter']+'%'};return _0x328c96;})});}_0x39a07b=_[_0xe0b0('0x44')]({},_0x39a07b,_0x534881['options']);return db['CannedAnswer'][_0xe0b0('0x25')]({'where':_0x39a07b['where']})['then'](function(_0x4f027c){_0xc6090e[_0xe0b0('0x25')]=_0x4f027c;if(_0x534881[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x39a07b[_0xe0b0('0x47')]=[{'all':!![]}];}return db[_0xe0b0('0x5f')]['findAll'](_0x39a07b);})[_0xe0b0('0x15')](function(_0x4609d5){_0xc6090e[_0xe0b0('0x48')]=_0x4609d5;return _0xc6090e;});}})['then'](respondWithFilteredResult(_0x234716,_0x39a07b))[_0xe0b0('0x1e')](handleError(_0x234716,null));};exports[_0xe0b0('0x60')]=function(_0x5817aa,_0x5854ea){return db[_0xe0b0('0x33')]['find']({'where':{'id':_0x5817aa[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5854ea,null))[_0xe0b0('0x15')](function(_0x7ae597){if(_0x7ae597){return _0x7ae597[_0xe0b0('0x60')](_0x5817aa[_0xe0b0('0x36')][_0xe0b0('0x61')]);}})['then'](respondWithStatusCode(_0x5854ea,null))[_0xe0b0('0x1e')](handleError(_0x5854ea,null));};exports[_0xe0b0('0x62')]=function(_0x135fec,_0x42add7){_0x135fec[_0xe0b0('0x4d')]['sitepic']=_0x135fec['file'][_0xe0b0('0x63')];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x135fec[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x42add7,null))[_0xe0b0('0x15')](saveUpdates(_0x135fec[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x42add7,null))[_0xe0b0('0x1e')](handleError(_0x42add7,null));};exports[_0xe0b0('0x64')]=function(_0x4fe048,_0xac45e6){_0x4fe048[_0xe0b0('0x4d')][_0xe0b0('0x65')]=_0x4fe048[_0xe0b0('0x66')]['filename'];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x4fe048[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0xac45e6,null))[_0xe0b0('0x15')](saveUpdates(_0x4fe048['body'],null))[_0xe0b0('0x15')](respondWithResult(_0xac45e6,null))['catch'](handleError(_0xac45e6,null));};exports[_0xe0b0('0x67')]=function(_0x196ab7,_0x3d8f17){_0x196ab7[_0xe0b0('0x4d')][_0xe0b0('0x68')]=_0x196ab7['file']['filename'];return db[_0xe0b0('0x33')]['find']({'where':{'id':_0x196ab7[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d8f17,null))[_0xe0b0('0x15')](saveUpdates(_0x196ab7[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x3d8f17,null))[_0xe0b0('0x1e')](handleError(_0x3d8f17,null));};exports[_0xe0b0('0x69')]=function(_0x1bb4da,_0x43ff30){_0x1bb4da['body']['systemAvatar']=_0x1bb4da[_0xe0b0('0x66')][_0xe0b0('0x63')];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x1bb4da[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x43ff30,null))[_0xe0b0('0x15')](saveUpdates(_0x1bb4da[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x43ff30,null))[_0xe0b0('0x1e')](handleError(_0x43ff30,null));};exports['getLogo']=function(_0x4a4880,_0x3dd34e){var _0x26caf8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x6c'));var _0x43c2bb={'where':{'id':_0x4a4880[_0xe0b0('0x56')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4c4748=![];return require(_0xe0b0('0x6d'))[_0xe0b0('0x6e')]()[_0xe0b0('0x15')](function(_0x467f0e){if(_0x467f0e){_0x4c4748=_0x467f0e[_0xe0b0('0x6f')];}})[_0xe0b0('0x15')](function(){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x43c2bb);})[_0xe0b0('0x15')](handleEntityNotFound(_0x3dd34e,null))[_0xe0b0('0x15')](function(_0x4cbe35){if(_0x4cbe35){if(!_[_0xe0b0('0x70')](_0x4cbe35[_0xe0b0('0x71')])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x72'),_0x4cbe35[_0xe0b0('0x71')]))&&_0x4c4748){_0x26caf8=path[_0xe0b0('0x6a')](config['root'],_0xe0b0('0x72'),_0x4cbe35[_0xe0b0('0x71')]);}}return _0x3dd34e[_0xe0b0('0x73')](_0x26caf8);}})[_0xe0b0('0x1e')](handleError(_0x3dd34e,null));};exports[_0xe0b0('0x74')]=function(_0x5f1fd3,_0x475404){var _0x58d61b=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x75'));var _0x539a12={'where':{'id':_0x5f1fd3['params']['id']},'attributes':['id',_0xe0b0('0x65')],'raw':!![]};return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x539a12)['then'](handleEntityNotFound(_0x475404,null))['then'](function(_0x5da5eb){if(_0x5da5eb){if(!_['isNil'](_0x5da5eb['agentAvatar'])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x5da5eb[_0xe0b0('0x65')]))){_0x58d61b=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x5da5eb[_0xe0b0('0x65')]);}}return _0x475404['download'](_0x58d61b);}})['catch'](handleError(_0x475404,null));};exports[_0xe0b0('0x77')]=function(_0xd2dd5a,_0x3e592c){var _0x52dfd8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x78'));var _0xd231c4={'where':{'id':_0xd2dd5a[_0xe0b0('0x56')]['id']},'attributes':['id',_0xe0b0('0x68'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0xd231c4)[_0xe0b0('0x15')](handleEntityNotFound(_0x3e592c,null))[_0xe0b0('0x15')](function(_0x9f9d8d){if(_0x9f9d8d){if(!_[_0xe0b0('0x70')](_0x9f9d8d[_0xe0b0('0x68')])){if(fs[_0xe0b0('0x79')](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x9f9d8d['customerAvatar']))&&_0x9f9d8d[_0xe0b0('0x7a')]){_0x52dfd8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x9f9d8d[_0xe0b0('0x68')]);}}return _0x3e592c[_0xe0b0('0x73')](_0x52dfd8);}})[_0xe0b0('0x1e')](handleError(_0x3e592c,null));};exports['getSystemAvatar']=function(_0x36fa1f,_0x4d2ca9){var _0x74693e=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x7b'));var _0x3b133a={'where':{'id':_0x36fa1f[_0xe0b0('0x56')]['id']},'attributes':['id',_0xe0b0('0x7c')],'raw':!![]};return db['ChatWebsite'][_0xe0b0('0x4b')](_0x3b133a)[_0xe0b0('0x15')](handleEntityNotFound(_0x4d2ca9,null))['then'](function(_0x44e4a8){if(_0x44e4a8){if(!_[_0xe0b0('0x70')](_0x44e4a8[_0xe0b0('0x7c')])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x44e4a8['systemAvatar']))){_0x74693e=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x44e4a8[_0xe0b0('0x7c')]);}}return _0x4d2ca9[_0xe0b0('0x73')](_0x74693e);}})[_0xe0b0('0x1e')](handleError(_0x4d2ca9,null));};exports['notify']=function(_0x44da91,_0x701ba){var _0x21db87=require(_0xe0b0('0x7d'));var _0x11452e=new _0x21db87();var _0xaca03c=_0x11452e[_0xe0b0('0x7e')](_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x80')])[_0xe0b0('0x81')]();var _0xde3bca={'body':_0x44da91['body'],'channel':_0xe0b0('0x82')};var _0x51bab6=[];var _0x56c497=[];var _0x1d1981={};var _0x1c29dd=![];return db['CmContact'][_0xe0b0('0x83')]()[_0xe0b0('0x15')](function(_0x141b38){if(!_0x141b38){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x86'));}_0x51bab6=_[_0xe0b0('0x87')](_[_0xe0b0('0x37')](_0x141b38),[_0xe0b0('0x88'),'updatedAt']);_0x56c497=_[_0xe0b0('0x87')](_[_0xe0b0('0x37')](_0x141b38),[_0xe0b0('0x88'),_0xe0b0('0x89'),'CompanyId','ListId']);if(_0x44da91[_0xe0b0('0x4d')]['id']){delete _0x44da91[_0xe0b0('0x4d')]['id'];}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')])){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8b'));}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')])||_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')]===''){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8c'));}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8d')])){throw new db['Sequelize'][(_0xe0b0('0x85'))](_0xe0b0('0x8e')+_0x56c497);}if(!_[_0xe0b0('0x8f')](_0x56c497,_0x44da91['body'][_0xe0b0('0x8d')])){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x90')+_0x56c497);}_0x1d1981[_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8d')]]=_0x44da91[_0xe0b0('0x4d')]['from'];})[_0xe0b0('0x15')](function(){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x44da91['params']['id']},'include':[{'model':db[_0xe0b0('0x91')],'as':_0xe0b0('0x92'),'include':[{'model':db['CmContact'],'as':_0xe0b0('0x93'),'where':_0x1d1981,'limit':0x1,'order':[['updatedAt',_0xe0b0('0x94')]]}]},{'model':db[_0xe0b0('0x95')],'as':_0xe0b0('0x96')}]});})[_0xe0b0('0x15')](handleEntityNotFound(_0x701ba,null))[_0xe0b0('0x15')](function(_0x13199b){if(_0x13199b&&_0x13199b[_0xe0b0('0x92')]){_0xde3bca[_0xe0b0('0x97')]=_0x13199b;_0xde3bca['applications']=_0x13199b[_0xe0b0('0x96')];_0xde3bca['list']=_0x13199b['List'];_0xde3bca[_0xe0b0('0x98')]=_[_0xe0b0('0x99')](_0xde3bca[_0xe0b0('0x98')],['priority'],['asc']);if(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x96')]){delete _0xde3bca['account'][_0xe0b0('0x96')];}if(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')]&&_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')][_0xe0b0('0x93')][_0xe0b0('0x3c')]){return _0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')]['Contacts'][0x0];}var _0x569400=_[_0xe0b0('0x9a')](_0x44da91[_0xe0b0('0x4d')],{'firstName':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')],'ListId':_0x13199b[_0xe0b0('0x9b')]});_0x569400[_0x44da91[_0xe0b0('0x4d')]['mapKey']]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')];return db[_0xe0b0('0x9c')][_0xe0b0('0x4c')](_0x569400,{'fields':_0x51bab6,'raw':!![]});}})[_0xe0b0('0x15')](handleEntityNotFound(_0x701ba,null))['then'](function(_0x3ae295){_0xde3bca[_0xe0b0('0x9d')]=_0x3ae295;var _0x321b0b=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x9e')];if(_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x9f')]){_0x321b0b=_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x9f')];}else if(_0x44da91[_0xe0b0('0x7f')]['x-forwarded-for']){_0x321b0b=_[_0xe0b0('0xa0')](_0x44da91[_0xe0b0('0x7f')]['x-forwarded-for'][_0xe0b0('0xa1')](','));}if(_0x3ae295){var _0x494567={'ContactId':_0x3ae295['id'],'ChatWebsiteId':_0x44da91[_0xe0b0('0x56')]['id'],'from':(_0x3ae295[_0xe0b0('0xa2')]||'')+'\x20'+(_0x3ae295['lastName']||''),'customerIp':_0x321b0b,'customerPort':_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0xa3')]?_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0xa3')]:null,'referer':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xa4')],'browserName':_0xaca03c[_0xe0b0('0xa5')]['name']&&_0xaca03c['browser'][_0xe0b0('0xa6')]?util[_0xe0b0('0xa7')](_0xe0b0('0xa8'),_0xaca03c['browser'][_0xe0b0('0x2d')],_0xaca03c[_0xe0b0('0xa5')][_0xe0b0('0xa6')]):_0xe0b0('0xa9'),'browserVersion':_0xaca03c[_0xe0b0('0xa5')][_0xe0b0('0xa6')]||_0xe0b0('0xa9'),'osName':util[_0xe0b0('0xa7')](_0xe0b0('0xa8'),_0xaca03c['os'][_0xe0b0('0x2d')],_0xaca03c['os']['version']),'osVersion':_0xaca03c['os']['version'],'deviceModel':_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0x35')]&&_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')]?util[_0xe0b0('0xa7')](_0xe0b0('0xac'),_0xaca03c[_0xe0b0('0xaa')]['model'],_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')],_0xaca03c[_0xe0b0('0xaa')]['type']):null,'deviceVendor':_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')],'deviceType':_0xaca03c['device']['type'],'formData':JSON[_0xe0b0('0xad')](_0x44da91['body'])};var _0x7eef44={'ChatWebsiteId':_0x44da91['params']['id'],'closed':![]};if(_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')]){_0x7eef44['threadId']=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')];return db['ChatInteraction'][_0xe0b0('0x4b')]({'where':_0x7eef44})['then'](function(_0x1395be){if(_0x1395be){return[_0x1395be,![]];}_0x494567[_0xe0b0('0xae')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')];_0x494567[_0xe0b0('0xaf')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xaf')];return db['ChatInteraction'][_0xe0b0('0x4c')](_0x494567)[_0xe0b0('0x15')](function(_0x5e1db2){return[_0x5e1db2,!![]];});});}_0x7eef44['ContactId']=_0x3ae295['id'];if(_0x44da91[_0xe0b0('0x4d')]['interaction']&&_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb0')]['id']){_0x7eef44['id']=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb0')]['id'];return db[_0xe0b0('0xb1')][_0xe0b0('0x4b')]({'where':_0x7eef44})[_0xe0b0('0x15')](function(_0x8364b0){if(_0x8364b0){return[_0x8364b0,![]];}return db[_0xe0b0('0xb1')][_0xe0b0('0x4c')](_0x494567)[_0xe0b0('0x15')](function(_0x3fc0d6){return[_0x3fc0d6,!![]];});});}return db[_0xe0b0('0xb1')][_0xe0b0('0x4c')](_0x494567)['then'](function(_0x180b6c){return[_0x180b6c,!![]];});}})[_0xe0b0('0xb2')](function(_0x2cd15d,_0x3e82b4){if(_0x2cd15d){_0x1c29dd=_0x3e82b4;if(!_0x3e82b4){var _0x3cbf47={'from':(_0xde3bca['contact'][_0xe0b0('0xa2')]||'')+'\x20'+(_0xde3bca[_0xe0b0('0x9d')][_0xe0b0('0xb3')]||'')};if(_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')]&&_0x44da91[_0xe0b0('0x4d')]['messageId']&&_0x44da91[_0xe0b0('0x4d')]['threadId']!=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb4')]){_0x3cbf47[_0xe0b0('0xae')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb4')];}return _0x2cd15d[_0xe0b0('0x55')](_0x3cbf47);}else{return _0x2cd15d;}}})['then'](function(_0xe574f1){_0xde3bca[_0xe0b0('0xb0')]=_0xe574f1[_0xe0b0('0x2a')]({'plain':!![]});_0xde3bca[_0xe0b0('0xb0')][_0xe0b0('0xb5')]=_0x1c29dd;if(_0xde3bca[_0xe0b0('0xb0')][_0xe0b0('0xb5')]){if(_0xde3bca[_0xe0b0('0x97')]['autoclose']){_0xde3bca['applications'][_0xe0b0('0xb6')]({'id':0x0,'priority':_0xde3bca['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xe0b0('0xb7')});}}return db['ChatMessage']['create']({'body':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')],'ChatWebsiteId':_0x44da91[_0xe0b0('0x56')]['id'],'ChatInteractionId':_0xe574f1['id'],'direction':'in','ContactId':_0xde3bca[_0xe0b0('0x9d')]['id'],'AttachmentId':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb8')]});})[_0xe0b0('0x15')](function(_0x450b09){_0xde3bca[_0xe0b0('0x1b')]=_0x450b09;if(_0xde3bca[_0xe0b0('0xb0')]['UserId']){return db['User'][_0xe0b0('0x4b')]({'attributes':['id',_0xe0b0('0x2d')],'where':{'id':_0xde3bca[_0xe0b0('0xb0')]['UserId']}})['then'](function(_0x254691){if(_0x254691){_0xde3bca['applications'][_0xe0b0('0xb9')]({'id':0x0,'priority':0x0,'app':_0xe0b0('0xba'),'appdata':_0x254691['name']+','+(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0xbb')]||0xa),'interval':_0xe0b0('0xb7')});_0xde3bca[_0xe0b0('0xbc')]=!![];}return respondWithRpcPromise(_0xe0b0('0xbd'),_0xe0b0('0xbe'),_0xde3bca);});}return respondWithRpcPromise(_0xe0b0('0xbd'),'startRouting',_0xde3bca);})[_0xe0b0('0x15')](function(_0xea6b40){respondWithRpcPromise(_0xe0b0('0xbf'),_0xe0b0('0xbf'),{'event':_0xe0b0('0xc0'),'message':_0xea6b40},client9002);return _0xea6b40;})['then'](respondWithResult(_0x701ba,null))['catch'](handleError(_0x701ba,null));};exports[_0xe0b0('0xc1')]=function(_0x4a8dfc,_0x4bfa22){var _0x3df5c8,_0x588a19,_0x36901a;var _0x151da2=[];var _0x330ed5={};var _0x35f5c1=_0x4a8dfc['files']||[];var _0x50b163=[];var _0x42affa;return db[_0xe0b0('0x9c')][_0xe0b0('0x83')]()[_0xe0b0('0x15')](function(_0xbafa53){if(!_0xbafa53){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x86'));}_0x151da2=_['difference'](_[_0xe0b0('0x37')](_0xbafa53),[_0xe0b0('0x88'),_0xe0b0('0x89'),'CompanyId',_0xe0b0('0x9b')]);if(_0x4a8dfc[_0xe0b0('0x4d')]['id']){delete _0x4a8dfc[_0xe0b0('0x4d')]['id'];}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x8a')])){throw _0x4bfa22['status'](0x1f4)[_0xe0b0('0x2e')](new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))]('from\x20is\x20mandatory'));}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x4d')])||_0x4a8dfc[_0xe0b0('0x4d')]['body']===''){throw _0x4bfa22[_0xe0b0('0x21')](0x1f4)[_0xe0b0('0x2e')](new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8c')));}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0xc2')])){throw _0x4bfa22['status'](0x1f4)[_0xe0b0('0x2e')](new db['Sequelize']['ValidationError'](_0xe0b0('0xc3')+_0x151da2));}if(!_[_0xe0b0('0x8f')](_0x151da2,_0x4a8dfc[_0xe0b0('0x4d')]['mapKeyOffline'])){throw _0x4bfa22[_0xe0b0('0x21')](0x1f4)['send'](new db[(_0xe0b0('0x84'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x151da2));}_0x330ed5[_0x4a8dfc['body'][_0xe0b0('0xc2')]]=_0x4a8dfc[_0xe0b0('0x4d')]['from'];})[_0xe0b0('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4a8dfc[_0xe0b0('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xe0b0('0x92')},{'model':db[_0xe0b0('0xc4')],'as':_0xe0b0('0xc4')}]});})[_0xe0b0('0x15')](handleEntityNotFound(_0x4bfa22,null))['then'](function(_0x2fe1ab){if(_0x2fe1ab&&_0x2fe1ab[_0xe0b0('0x92')]){_0x588a19=_0x2fe1ab;var _0x4187aa=_[_0xe0b0('0x9a')](_0x4a8dfc[_0xe0b0('0x4d')],{'firstName':_0x4a8dfc['body'][_0xe0b0('0x8a')],'phone':_0x4a8dfc[_0xe0b0('0x4d')]['from'],'ListId':_0x2fe1ab[_0xe0b0('0x9b')]});_0x4187aa[_0x4a8dfc['body'][_0xe0b0('0xc2')]]=_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x8a')];return db[_0xe0b0('0x9c')][_0xe0b0('0xc5')]({'where':_0x330ed5,'defaults':_0x4187aa});}})[_0xe0b0('0xb2')](function(_0x403f30){if(_0x403f30){_0x36901a=_0x403f30;var _0x5b7b02=fs['readFileSync'](path[_0xe0b0('0x6a')](config['root'],_0xe0b0('0xc6')),_0xe0b0('0xc7'));var _0xdde041=ejs[_0xe0b0('0xc8')](_0x5b7b02,{'body':_[_0xe0b0('0xc9')](_0x4a8dfc[_0xe0b0('0x4d')]['body']),'bodyTitle':_0x588a19['offlineMessageBody']});return db[_0xe0b0('0xca')][_0xe0b0('0x4c')]({'body':_0xdde041,'plainBody':htmlToText['fromString'](_0xdde041),'ContactId':_0x403f30['id'],'ChatWebsiteId':_0x588a19['id']});}})[_0xe0b0('0x15')](function(_0x2d0ba8){_0x42affa=_0x2d0ba8;if(_0x35f5c1['length']){var _0x2ad35d=_0x35f5c1[_0xe0b0('0x32')](function(_0x337db8){return{'name':_0x337db8['originalname'],'basename':_0x337db8[_0xe0b0('0x63')],'type':_0x337db8[_0xe0b0('0xcb')],'ChatOfflineMessageId':_0x2d0ba8['id']};});_0x50b163=_0x2ad35d[_0xe0b0('0x32')](_0x24d9ee=>{var _0x57e90f={'filename':_0x24d9ee[_0xe0b0('0x2d')],'path':path['join'](config[_0xe0b0('0x6b')],_0xe0b0('0xcc'),_0xe0b0('0xcd'),'attachments',_0xe0b0('0xce'),_0x24d9ee[_0xe0b0('0xcf')])};return _0x57e90f;});if(!_0x588a19[_0xe0b0('0xd0')]){return db[_0xe0b0('0xd1')]['transaction'](function(_0x1266c8){return db[_0xe0b0('0xd2')][_0xe0b0('0xd3')](_0x2ad35d,{'transaction':_0x1266c8});});}}})[_0xe0b0('0x15')](function(){if(_0x42affa){_0x3df5c8=_0x42affa;return db[_0xe0b0('0xc4')][_0xe0b0('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x25d3fe){if(_0x25d3fe&&_0x25d3fe['Smtp']&&_0x588a19[_0xe0b0('0xd4')]&&_0x588a19['forwardOfflineAddress']){var _0x47d689={'tls':{'rejectUnauthorized':![]}};if(_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd6')]){_0x47d689[_0xe0b0('0xd6')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd6')];}else{_0x47d689[_0xe0b0('0xd7')]=_0x25d3fe[_0xe0b0('0xd5')]['host'];_0x47d689[_0xe0b0('0xd8')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd8')];_0x47d689[_0xe0b0('0xd9')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd9')];}if(_0x25d3fe['Smtp']['authentication']){_0x47d689[_0xe0b0('0xda')]={'user':_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0x4e')],'pass':_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xdb')]};}return respondWithRpcPromise(_0xe0b0('0xdc'),_0xe0b0('0xdd'),{'account':_0x47d689,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x25d3fe[_0xe0b0('0x2d')],_0x25d3fe[_0xe0b0('0xde')]||_0x25d3fe[_0xe0b0('0xd5')]['user']),'to':_0x588a19['forwardOfflineAddress'],'subject':_0x588a19[_0xe0b0('0xdf')],'html':_0x3df5c8[_0xe0b0('0x4d')],'attachments':_0x50b163}},client9003)[_0xe0b0('0x15')](function(){return _0x3df5c8;})[_0xe0b0('0x1e')](function(_0x1427a9){console[_0xe0b0('0x19')](_0x1427a9);});}})[_0xe0b0('0x15')](function(){if(_0x588a19&&_0x588a19[_0xe0b0('0xd0')]&&_0x588a19[_0xe0b0('0xe0')]){var _0x233c95=[];if(_0x35f5c1['length']){_0x233c95=_0x35f5c1[_0xe0b0('0x32')](function(_0x4a577b){return{'name':_0x4a577b[_0xe0b0('0xe1')],'basename':_0x4a577b['filename'],'type':_0x4a577b[_0xe0b0('0xcb')],'ChatOfflineMessageId':_0x42affa['id']};});}var _0x326470;if(!_['isNil'](_0x588a19[_0xe0b0('0xe2')])){var _0x41fd0e=_[_0xe0b0('0x32')](_0x4a8dfc['body'],function(_0x172318){return _0x172318;});var _0xb3018b=_['toPairsIn'](_0x41fd0e)[0x0];var _0x34338e=_[_0xe0b0('0xe3')](_0xb3018b,function(_0x50828f){return _0x50828f;});_0x326470=_0x34338e[0x1][_0x588a19['subjectOffline']];}var _0x33c97b={'from':_0x36901a[_0xe0b0('0xde')],'firstName':_0x36901a['firstName'],'lastName':_0x36901a['lastName'],'mapKey':_0xe0b0('0xde'),'message':{'from':_0x36901a['email'],'to':_0x588a19[_0xe0b0('0xc4')][_0xe0b0('0xde')],'cc':'','subject':_[_0xe0b0('0x70')](_0x326470)?_0x588a19[_0xe0b0('0xdf')]:_0x326470,'messageId':'','sentAt':new Date(),'attach':_0x233c95[_0xe0b0('0x3c')],'attachments':_0x233c95,'originChannel':_0xe0b0('0xe4'),'ChatWebsiteId':_0x588a19['id'],'ChatOfflineMessageId':_0x3df5c8['id'],'originTo':_0x588a19[_0xe0b0('0xc4')]['email']},'body':_0x3df5c8[_0xe0b0('0x4d')]};var _0x5f059f={'account':{'id':_0x588a19['MailAccountId']},'body':_0x33c97b,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe0b0('0xe5'),_0xe0b0('0xe6'),_0x5f059f,client9001)[_0xe0b0('0x15')](function(){return _0x3df5c8;})[_0xe0b0('0x1e')](function(_0x21ccfe){console['error'](_0x21ccfe);});}return;})['then'](function(){if(_0x3df5c8){return _0x3df5c8;}})['then'](respondWithResult(_0x4bfa22,null))['catch'](function(_0x41b52){console[_0xe0b0('0x19')](_0xe0b0('0x1e'),_0x41b52);for(var _0x5d8613 of _0x35f5c1){var _0x2c18b9=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0xcc'),_0xe0b0('0xcd'),_0xe0b0('0xe7'),_0xe0b0('0xce'),_0x5d8613['filename']);fs_extra[_0xe0b0('0xe8')](_0x2c18b9)[_0xe0b0('0x1e')](function(_0x2bb49d){console[_0xe0b0('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x2c18b9,_0x2bb49d);});}});};exports[_0xe0b0('0xe9')]=function(_0x20f040,_0x3eb643){return db[_0xe0b0('0xb1')]['find']({'where':{'id':_0x20f040['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x3eb643,null))[_0xe0b0('0x15')](function(_0x26bd6c){if(_0x26bd6c){return _0x26bd6c[_0xe0b0('0xe9')](_0x20f040[_0xe0b0('0x4d')][_0xe0b0('0x61')],_['omit'](_0x20f040[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{});}})[_0xe0b0('0x15')](respondWithResult(_0x3eb643,null))[_0xe0b0('0x1e')](handleError(_0x3eb643,null));};exports[_0xe0b0('0xea')]=function(_0x48706b,_0x164b25){var _0x51afab={'raw':![],'where':{}};var _0x49632d={};var _0x257dda={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x48706b[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x164b25,null))['then'](function(_0x5a04c8){if(_0x5a04c8){_0x49632d[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db['ChatInteraction'][_0xe0b0('0x5a')]);_0x49632d['query']=_[_0xe0b0('0x37')](_0x48706b[_0xe0b0('0x36')]);_0x49632d[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x49632d['model'],_0x49632d['query']);_0x51afab['attributes']=_[_0xe0b0('0x3a')](_0x49632d[_0xe0b0('0x35')],qs['fields'](_0x48706b['query'][_0xe0b0('0x3b')]));_0x51afab[_0xe0b0('0x39')]=_0x51afab[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x51afab['attributes']:_0x49632d['model'];if(!_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x3d')]('nolimit')){_0x51afab[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x48706b['query']['limit']);_0x51afab['offset']=qs[_0xe0b0('0x22')](_0x48706b[_0xe0b0('0x36')]['offset']);}_0x51afab[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x51afab['where']=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x48706b['query'],_0x49632d['filters']));_0x51afab['where'][_0xe0b0('0x57')]=_0x5a04c8['id'];if(_0x48706b['query'][_0xe0b0('0x42')]){_0x51afab['where']=_['merge'](_0x51afab[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x51afab[_0xe0b0('0x39')],function(_0xe1891c){var _0x4cfd4f={};_0x4cfd4f[_0xe1891c]={'$like':'%'+_0x48706b['query']['filter']+'%'};return _0x4cfd4f;})});}_0x51afab=_['merge']({},_0x51afab,_0x48706b[_0xe0b0('0x46')]);return db[_0xe0b0('0xb1')][_0xe0b0('0x25')]({'where':_0x51afab['where']})[_0xe0b0('0x15')](function(_0x1f1133){_0x257dda['count']=_0x1f1133;if(_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x51afab[_0xe0b0('0x47')]=[{'model':db[_0xe0b0('0x9c')],'as':'Contact','required':![]},{'model':db[_0xe0b0('0xeb')],'as':_0xe0b0('0xec'),'attributes':[_0xe0b0('0x2d'),'fullname',_0xe0b0('0xed')],'required':![]},{'model':db[_0xe0b0('0xee')],'as':_0xe0b0('0xef'),'attributes':['id',_0xe0b0('0x2d'),'color'],'where':_0x48706b[_0xe0b0('0x36')][_0xe0b0('0xf0')]?{'id':_0x48706b[_0xe0b0('0x36')][_0xe0b0('0xf0')]}:undefined,'required':_0x48706b[_0xe0b0('0x36')]['tag']?!![]:![]}];}return db[_0xe0b0('0xb1')][_0xe0b0('0x5b')](_0x51afab);})['then'](function(_0xb263f6){_0x257dda[_0xe0b0('0x48')]=_0xb263f6;return _0x257dda;});}})[_0xe0b0('0x15')](respondWithFilteredResult(_0x164b25,_0x51afab))[_0xe0b0('0x1e')](handleError(_0x164b25,null));};function iftimePromise(_0x1ffc75,_0x3a39d7){return respondWithRpcPromise('Command',_0xe0b0('0xf1'),{'command':_0x3a39d7[_0xe0b0('0xf2')]?util[_0xe0b0('0xa7')](_0xe0b0('0xf3'),_0x1ffc75[_0xe0b0('0xf4')],_0x3a39d7[_0xe0b0('0xf2')]):util[_0xe0b0('0xa7')](_0xe0b0('0xf5'),_0x1ffc75[_0xe0b0('0xf4')])},client9002)[_0xe0b0('0x15')](function(_0x4d12b2){var _0xeeff22=_0x4d12b2&&_0x4d12b2['indexOf'](_0xe0b0('0xf6'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3a39d7['id'],_0x1ffc75['id'],_0x1ffc75[_0xe0b0('0xf4')],_0xeeff22?_0xe0b0('0xf7'):'OFFLINE',_0x3a39d7['timezone']?_0x3a39d7[_0xe0b0('0xf2')]:_0xe0b0('0xf8'));return _0xeeff22;})['catch'](function(_0x5501c2){logger[_0xe0b0('0x19')](_0xe0b0('0xf9'),_0x3a39d7['id'],_0x1ffc75['id'],_0x1ffc75['interval'],util[_0xe0b0('0xfa')](_0x5501c2,{'showHidden':![],'depth':null}),_0x3a39d7[_0xe0b0('0xf2')]?_0x3a39d7[_0xe0b0('0xf2')]:_0xe0b0('0xf8'));return![];});}exports['getSnippet']=function(_0x230ff2,_0x22d53d){var _0x2251c2=0x0;var _0x24271d=0x0;var _0x385ffb=![];var _0x594eaa;var _0x2932c3;return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x230ff2['params']['id']},'include':[{'model':db[_0xe0b0('0xfb')],'as':_0xe0b0('0xfb'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xe0b0('0xf4')],'raw':!![]}]}]})[_0xe0b0('0x15')](handleEntityNotFound(_0x22d53d,null))[_0xe0b0('0x15')](function(_0x46fbdc){if(_0x46fbdc){_0x594eaa=_0x46fbdc;return _0x46fbdc[_0xe0b0('0xfc')]({'raw':!![]});}})[_0xe0b0('0x15')](function(_0x34e1bf){if(_0x594eaa){if(_0x34e1bf){_0x2932c3=_0x34e1bf;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x5c001a){if(_0x5c001a){_0x24271d=_0x5c001a[_0xe0b0('0xfd')];_0x385ffb=_0x5c001a[_0xe0b0('0x6f')];}})[_0xe0b0('0x15')](function(){return db['ChatInteraction'][_0xe0b0('0x25')]({'where':{'closed':![]}});})[_0xe0b0('0x15')](function(_0x1a5a0f){_0x2251c2=_0x1a5a0f;if(_0x24271d&&_0x1a5a0f>_0x24271d){return db[_0xe0b0('0xfe')][_0xe0b0('0x5e')]({'where':{'id':0x1}})[_0xe0b0('0x15')](function(_0x5910e6){if(_0x5910e6){_0x5910e6['increment'](_0xe0b0('0xff'));}});}})[_0xe0b0('0x15')](function(){if(_0x594eaa[_0xe0b0('0xfb')]&&_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')]){var _0x55e2ba=[];for(var _0x1e4f9d=0x0;_0x1e4f9d<_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')][_0xe0b0('0x3c')];_0x1e4f9d++){var _0x224e67=_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')][_0x1e4f9d][_0xe0b0('0x2a')]({'plain':!![]});_0x55e2ba[_0xe0b0('0xb6')](iftimePromise(_0x224e67,_0x594eaa));}return BPromise[_0xe0b0('0x101')](_0x55e2ba)['then'](function(_0x5bc9dc){return _['some'](_0x5bc9dc);});}else{return!![];}})[_0xe0b0('0x15')](function(_0x344877){var _0xa604c3=fs[_0xe0b0('0x102')](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x103')),'utf8');var _0xa6e316={'remote':_0x594eaa[_0xe0b0('0x104')],'query':querystring[_0xe0b0('0xad')](_['merge'](_0x594eaa[_0xe0b0('0x2a')]({'plain':!![]}),{'customerIp':_0x230ff2[_0xe0b0('0x7f')]['x-forwarded-for']||_0x230ff2[_0xe0b0('0x7f')][_0xe0b0('0x105')]||_0x230ff2[_0xe0b0('0x106')][_0xe0b0('0x107')]||_0x230ff2['ip'],'referer':_0x230ff2['headers']['referer'],'openedInteractions':_0x2251c2,'maxInteractions':_0x24271d,'virtual':_0x385ffb[_0xe0b0('0xfd')],'online':_0x344877,'custom':_0x385ffb}))['replace'](/'/g,'\x5c\x27')};_0x22d53d[_0xe0b0('0x2e')](ejs['render'](Mustache[_0xe0b0('0xc8')](_0xa604c3,_0xa6e316),{'proactiveActions':_0x2932c3,'alignment':_0x594eaa[_0xe0b0('0x108')],'verticalAlignment':_0x594eaa[_0xe0b0('0x109')],'div_color':_0x594eaa['color'],'labelText':_0x594eaa[_0xe0b0('0x10a')],'text_color':_0x594eaa['textColor'],'button_color':_0x594eaa[_0xe0b0('0x10b')],'background_color':_0x594eaa[_0xe0b0('0x10c')]}));})['catch'](handleError(_0x22d53d,null));};exports[_0xe0b0('0x10d')]=function(_0x3888d7,_0x2ed835){var _0x8c9efb=_0x3888d7['params']['id'];var _0x161a8c=_0x3888d7[_0xe0b0('0x4d')];var _0x2522f7=0xc8;var _0x523818=null;return db[_0xe0b0('0xd1')]['transaction']({'isolationLevel':db[_0xe0b0('0xd1')]['Transaction'][_0xe0b0('0x10e')][_0xe0b0('0x10f')]},function(_0x18d0eb){return db['ChatWebsite'][_0xe0b0('0x5e')]({'where':{'id':_0x8c9efb},'transaction':_0x18d0eb})[_0xe0b0('0x15')](function(_0x2eb954){if(_0x2eb954){return db[_0xe0b0('0x95')][_0xe0b0('0x29')]({'where':{'ChatWebsiteId':_0x8c9efb},'transaction':_0x18d0eb})[_0xe0b0('0x15')](function(){var _0x2961c1=_['map'](_0x161a8c,function(_0x31063b){_0x31063b['ChatWebsiteId']=_0x8c9efb;return _0x31063b;});return db[_0xe0b0('0x95')]['bulkCreate'](_0x2961c1,{'transaction':_0x18d0eb});});}else{_0x2522f7=0x194;_0x523818=[];}});})[_0xe0b0('0x15')](function(){if(_0x2522f7!==0x194){return db[_0xe0b0('0x95')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x8c9efb},'order':'priority'})[_0xe0b0('0x15')](function(_0x32c330){_0x523818=_0x32c330;});}})[_0xe0b0('0x1e')](function(_0x299f82){_0x2522f7=0x1f4;logger[_0xe0b0('0x19')](_0x299f82[_0xe0b0('0x2c')]);if(_0x299f82['name']){delete _0x299f82[_0xe0b0('0x2d')];}_0x523818=_0x299f82;})[_0xe0b0('0x110')](function(){if(_0x523818===null){_0x2ed835['sendStatus'](_0x2522f7);}else{if(_0x2522f7===0x1f4){_0x2ed835[_0xe0b0('0x21')](_0x2522f7)[_0xe0b0('0x2e')](_0x523818);}else{_0x2ed835[_0xe0b0('0x21')](_0x2522f7)[_0xe0b0('0x28')](_0x523818);}}});};exports[_0xe0b0('0x111')]=function(_0x5ac9af,_0x220bb1){var _0x51fab9={};var _0x2309cf={};var _0x436d2c;var _0x3b6cac;return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x5ac9af['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x220bb1,null))[_0xe0b0('0x15')](function(_0x49da50){if(_0x49da50){_0x436d2c=_0x49da50;_0x2309cf[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0x95')][_0xe0b0('0x5a')]);_0x2309cf[_0xe0b0('0x36')]=_['keys'](_0x5ac9af['query']);_0x2309cf['filters']=_[_0xe0b0('0x3a')](_0x2309cf[_0xe0b0('0x35')],_0x2309cf[_0xe0b0('0x36')]);_0x51fab9['attributes']=_[_0xe0b0('0x3a')](_0x2309cf['model'],qs[_0xe0b0('0x3b')](_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x51fab9[_0xe0b0('0x39')]=_0x51fab9[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x51fab9['attributes']:_0x2309cf[_0xe0b0('0x35')];_0x51fab9[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x5ac9af['query'][_0xe0b0('0x40')]);_0x51fab9[_0xe0b0('0x43')]=qs['filters'](_[_0xe0b0('0x41')](_0x5ac9af['query'],_0x2309cf[_0xe0b0('0x38')]));if(_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x51fab9[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x51fab9[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x51fab9[_0xe0b0('0x39')],function(_0x41e4be){var _0x3338bb={};_0x3338bb[_0x41e4be]={'$like':'%'+_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x3338bb;})});}_0x51fab9=_[_0xe0b0('0x44')]({},_0x51fab9,_0x5ac9af[_0xe0b0('0x46')]);return _0x436d2c['getApplications'](_0x51fab9);}})[_0xe0b0('0x15')](function(_0xce17d3){if(_0xce17d3){_0x3b6cac=_0xce17d3[_0xe0b0('0x3c')];if(!_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x51fab9[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x51fab9[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x5ac9af['query'][_0xe0b0('0x22')]);}return _0x436d2c['getApplications'](_0x51fab9);}})['then'](function(_0xd60c40){if(_0xd60c40){return _0xd60c40?{'count':_0x3b6cac,'rows':_0xd60c40}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x220bb1,null))['catch'](handleError(_0x220bb1,null));};exports[_0xe0b0('0x112')]=function(_0x1ebfdc,_0x5d1b30){return db[_0xe0b0('0x113')][_0xe0b0('0x4b')]({'where':{'id':_0x1ebfdc[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5d1b30,null))[_0xe0b0('0x15')](function(_0x4ba58d){if(_0x4ba58d){return _0x4ba58d[_0xe0b0('0x112')](_0x1ebfdc[_0xe0b0('0x4d')][_0xe0b0('0x61')],_['omit'](_0x1ebfdc[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{});}})[_0xe0b0('0x15')](respondWithResult(_0x5d1b30,null))[_0xe0b0('0x1e')](handleError(_0x5d1b30,null));};exports[_0xe0b0('0xfc')]=function(_0x15373d,_0x207b52){var _0x421f85={};var _0x7a18d8={};var _0x245796;var _0x51d6f0;return db['ChatWebsite'][_0xe0b0('0x5e')]({'where':{'id':_0x15373d['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x207b52,null))['then'](function(_0xaad4b4){if(_0xaad4b4){_0x245796=_0xaad4b4;_0x7a18d8[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db['ChatProactiveAction']['rawAttributes']);_0x7a18d8['query']=_[_0xe0b0('0x37')](_0x15373d[_0xe0b0('0x36')]);_0x7a18d8['filters']=_[_0xe0b0('0x3a')](_0x7a18d8[_0xe0b0('0x35')],_0x7a18d8[_0xe0b0('0x36')]);_0x421f85[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x7a18d8[_0xe0b0('0x35')],qs[_0xe0b0('0x3b')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x421f85[_0xe0b0('0x39')]=_0x421f85[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x421f85[_0xe0b0('0x39')]:_0x7a18d8['model'];_0x421f85[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x421f85[_0xe0b0('0x43')]=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x15373d[_0xe0b0('0x36')],_0x7a18d8[_0xe0b0('0x38')]));if(_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x421f85[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x421f85[_0xe0b0('0x43')],{'$or':_['map'](_0x421f85[_0xe0b0('0x39')],function(_0x12fec1){var _0x1fc2ba={};_0x1fc2ba[_0x12fec1]={'$like':'%'+_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x1fc2ba;})});}_0x421f85=_['merge']({},_0x421f85,_0x15373d[_0xe0b0('0x46')]);return _0x245796[_0xe0b0('0xfc')](_0x421f85);}})['then'](function(_0x4ed950){if(_0x4ed950){_0x51d6f0=_0x4ed950['length'];if(!_0x15373d[_0xe0b0('0x36')]['hasOwnProperty'](_0xe0b0('0x3e'))){_0x421f85[_0xe0b0('0x23')]=qs['limit'](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x421f85['offset']=qs[_0xe0b0('0x22')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x22')]);}return _0x245796['getProactiveActions'](_0x421f85);}})[_0xe0b0('0x15')](function(_0xac72b0){if(_0xac72b0){return _0xac72b0?{'count':_0x51d6f0,'rows':_0xac72b0}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x207b52,null))[_0xe0b0('0x1e')](handleError(_0x207b52,null));};exports[_0xe0b0('0x114')]=function(_0x806731,_0x5632cd){var _0x454673=_0x806731[_0xe0b0('0x36')][_0xe0b0('0x115')]===_0xe0b0('0x116')?_0xe0b0('0x117'):_0xe0b0('0x118');return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'attributes':['id',_0x454673],'where':{'id':_0x806731['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5632cd,null))[_0xe0b0('0x15')](function(_0xc88c18){if(_0xc88c18){var _0x3ea089=_0xc88c18[_0x454673];var _0x30af0e=_0x3ea089&&_0x3ea089[_0xe0b0('0x119')]?_0x3ea089[_0xe0b0('0x119')]:[];_0x5632cd[_0xe0b0('0x2e')]({'fromKey':_['isNil'](_0x3ea089[_0xe0b0('0x11a')])?undefined:_0x3ea089[_0xe0b0('0x11a')],'count':_0x30af0e['length'],'rows':_0x30af0e});}})[_0xe0b0('0x1e')](handleError(_0x5632cd,null));};exports[_0xe0b0('0x11b')]=function(_0x443352,_0x404b24){var _0x1654d4={'raw':![],'where':{}};var _0x1214bd={};var _0x150f88={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x443352[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x404b24,null))['then'](function(_0x2bafbe){if(_0x2bafbe){_0x1214bd[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0xca')][_0xe0b0('0x5a')]);_0x1214bd['query']=_[_0xe0b0('0x37')](_0x443352['query']);_0x1214bd['filters']=_[_0xe0b0('0x3a')](_0x1214bd[_0xe0b0('0x35')],_0x1214bd[_0xe0b0('0x36')]);_0x1654d4[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x1214bd[_0xe0b0('0x35')],qs['fields'](_0x443352[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x1654d4[_0xe0b0('0x39')]=_0x1654d4[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x1654d4[_0xe0b0('0x39')]:_0x1214bd[_0xe0b0('0x35')];if(!_0x443352['query'][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x1654d4[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x443352['query']['limit']);_0x1654d4[_0xe0b0('0x22')]=qs['offset'](_0x443352[_0xe0b0('0x36')]['offset']);}_0x1654d4[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x443352[_0xe0b0('0x36')]['sort']);_0x1654d4['where']=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x443352[_0xe0b0('0x36')],_0x1214bd['filters']));_0x1654d4[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x2bafbe['id'];if(_0x443352[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x1654d4[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x1654d4[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x1654d4[_0xe0b0('0x39')],function(_0x5815f5){var _0x1eacdf={};_0x1eacdf[_0x5815f5]={'$like':'%'+_0x443352[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x1eacdf;})});}_0x1654d4=_[_0xe0b0('0x44')]({},_0x1654d4,_0x443352[_0xe0b0('0x46')]);return db[_0xe0b0('0xca')][_0xe0b0('0x25')]({'where':_0x1654d4[_0xe0b0('0x43')]})[_0xe0b0('0x15')](function(_0x4496d0){_0x150f88[_0xe0b0('0x25')]=_0x4496d0;if(_0x443352['query']['includeAll']){_0x1654d4['include']=[{'all':!![]}];}else{_0x1654d4['include']=[{'model':db[_0xe0b0('0x9c')],'as':_0xe0b0('0x11c'),'required':![]},{'model':db[_0xe0b0('0xd2')],'as':_0xe0b0('0x11d'),'required':![]}];}return db[_0xe0b0('0xca')][_0xe0b0('0x5b')](_0x1654d4);})[_0xe0b0('0x15')](function(_0x306f80){_0x150f88[_0xe0b0('0x48')]=_0x306f80;return _0x150f88;});}})['then'](respondWithFilteredResult(_0x404b24,_0x1654d4))['catch'](handleError(_0x404b24,null));};exports[_0xe0b0('0x11e')]=function(_0x2c6de2,_0x49f1df){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x2c6de2[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x49f1df,null))['then'](function(_0x1612e9){if(_0x1612e9){return _0x1612e9['addAgents'](_0x2c6de2[_0xe0b0('0x4d')][_0xe0b0('0x61')],_[_0xe0b0('0x11f')](_0x2c6de2[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{})[_0xe0b0('0xb2')](function(_0x9d6a15){for(var _0x2601ab=0x0;_0x2601ab<_0x2c6de2[_0xe0b0('0x4d')]['ids']['length'];_0x2601ab+=0x1){socket[_0xe0b0('0x120')]('userChatWebsite:save',{'UserId':Number(_0x2c6de2[_0xe0b0('0x4d')][_0xe0b0('0x61')][_0x2601ab]),'ChatWebsiteId':Number(_0x2c6de2[_0xe0b0('0x56')]['id'])});}return _0x9d6a15;});}})[_0xe0b0('0x15')](respondWithResult(_0x49f1df,null))[_0xe0b0('0x1e')](handleError(_0x49f1df,null));};exports[_0xe0b0('0x121')]=function(_0x3c3bc2,_0x285e1d){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x3c3bc2['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x285e1d,null))['then'](function(_0x1a6915){if(_0x1a6915){return _0x1a6915['removeAgents'](_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')])[_0xe0b0('0x15')](function(){if(_[_0xe0b0('0x122')](_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')])){for(var _0x82d32f=0x0;_0x82d32f<_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')][_0xe0b0('0x3c')];_0x82d32f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')][_0x82d32f]),'ChatWebsiteId':Number(_0x3c3bc2[_0xe0b0('0x56')]['id'])});}}else{socket[_0xe0b0('0x120')](_0xe0b0('0x123'),{'UserId':Number(_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')]),'ChatWebsiteId':Number(_0x3c3bc2[_0xe0b0('0x56')]['id'])});}});}})[_0xe0b0('0x15')](respondWithStatusCode(_0x285e1d,null))[_0xe0b0('0x1e')](handleError(_0x285e1d,null));};exports[_0xe0b0('0x124')]=function(_0x54e11c,_0x4d6351){var _0x2e872b={};var _0x1f9b27={};var _0x229485;var _0x21a549;return db[_0xe0b0('0x33')]['findOne']({'where':{'id':_0x54e11c[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d6351,null))[_0xe0b0('0x15')](function(_0x4d04bf){if(_0x4d04bf){_0x229485=_0x4d04bf;_0x1f9b27[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0xeb')][_0xe0b0('0x5a')]);_0x1f9b27[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x54e11c[_0xe0b0('0x36')]);_0x1f9b27['filters']=_['intersection'](_0x1f9b27['model'],_0x1f9b27['query']);_0x2e872b[_0xe0b0('0x39')]=_['intersection'](_0x1f9b27['model'],qs['fields'](_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x2e872b[_0xe0b0('0x39')]=_0x2e872b[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x2e872b['attributes']:_0x1f9b27['model'];_0x2e872b[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x2e872b[_0xe0b0('0x43')]=qs['filters'](_['pick'](_0x54e11c[_0xe0b0('0x36')],_0x1f9b27[_0xe0b0('0x38')]));if(_0x54e11c[_0xe0b0('0x36')]['filter']){_0x2e872b['where']=_[_0xe0b0('0x44')](_0x2e872b[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x2e872b[_0xe0b0('0x39')],function(_0x9a8a0d){var _0x938810={};_0x938810[_0x9a8a0d]={'$like':'%'+_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x938810;})});}_0x2e872b=_['merge']({},_0x2e872b,_0x54e11c['options']);return _0x229485[_0xe0b0('0x124')](_0x2e872b);}})[_0xe0b0('0x15')](function(_0x1717d3){if(_0x1717d3){_0x21a549=_0x1717d3[_0xe0b0('0x3c')];if(!_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x2e872b[_0xe0b0('0x23')]=qs['limit'](_0x54e11c[_0xe0b0('0x36')]['limit']);_0x2e872b[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x54e11c[_0xe0b0('0x36')]['offset']);}return _0x229485[_0xe0b0('0x124')](_0x2e872b);}})[_0xe0b0('0x15')](function(_0x7d6993){if(_0x7d6993){return _0x7d6993?{'count':_0x21a549,'rows':_0x7d6993}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x4d6351,null))[_0xe0b0('0x1e')](handleError(_0x4d6351,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 48f382a..c2ff47c 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 _0x7d86=['emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x12ca7a,_0x3295bf){var _0x2249df=function(_0x48b046){while(--_0x48b046){_0x12ca7a['push'](_0x12ca7a['shift']());}};_0x2249df(++_0x3295bf);}(_0x7d86,0x86));var _0x67d8=function(_0x374fc6,_0x164861){_0x374fc6=_0x374fc6-0x0;var _0x39deb1=_0x7d86[_0x374fc6];return _0x39deb1;};'use strict';var EventEmitter=require(_0x67d8('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x67d8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x67d8('0x2')](0x0);var events={'afterCreate':_0x67d8('0x3'),'afterUpdate':_0x67d8('0x4'),'afterDestroy':_0x67d8('0x5')};function emitEvent(_0x431294){return function(_0x3f58a1,_0x517caf,_0x3679f5){ChatWebsiteEvents[_0x67d8('0x6')](_0x431294+':'+_0x3f58a1['id'],_0x3f58a1);ChatWebsiteEvents[_0x67d8('0x6')](_0x431294,_0x3f58a1);_0x3679f5(null);};}for(var e in events){if(events[_0x67d8('0x7')](e)){var event=events[e];ChatWebsite[_0x67d8('0x8')](e,emitEvent(event));}}module[_0x67d8('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x455d=['hook','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3ecd91,_0x4379de){var _0x4ba19d=function(_0x17905f){while(--_0x17905f){_0x3ecd91['push'](_0x3ecd91['shift']());}};_0x4ba19d(++_0x4379de);}(_0x455d,0x190));var _0xd455=function(_0x31703c,_0x3f7398){_0x31703c=_0x31703c-0x0;var _0x2803b5=_0x455d[_0x31703c];return _0x2803b5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xd455('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd455('0x1')](0x0);var events={'afterCreate':_0xd455('0x2'),'afterUpdate':'update','afterDestroy':_0xd455('0x3')};function emitEvent(_0x365b39){return function(_0x325e88,_0xbe452a,_0xb206c2){ChatWebsiteEvents[_0xd455('0x4')](_0x365b39+':'+_0x325e88['id'],_0x325e88);ChatWebsiteEvents[_0xd455('0x4')](_0x365b39,_0x325e88);_0xb206c2(null);};}for(var e in events){if(events[_0xd455('0x5')](e)){var event=events[e];ChatWebsite[_0xd455('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1684167..641b5c6 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 _0x6ee5=['util','../../config/logger','api','bluebird','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x6b5dff,_0x5784fd){var _0x52e0d4=function(_0x338860){while(--_0x338860){_0x6b5dff['push'](_0x6b5dff['shift']());}};_0x52e0d4(++_0x5784fd);}(_0x6ee5,0x188));var _0x56ee=function(_0x2da923,_0x56a642){_0x2da923=_0x2da923-0x0;var _0x3f24b7=_0x6ee5[_0x2da923];return _0x3f24b7;};'use strict';var _=require('lodash');var util=require(_0x56ee('0x0'));var logger=require(_0x56ee('0x1'))(_0x56ee('0x2'));var moment=require('moment');var BPromise=require(_0x56ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56ee('0x4'));var attributes=require(_0x56ee('0x5'));module[_0x56ee('0x6')]=function(_0x8d8cc7,_0x2f85dc){return _0x8d8cc7[_0x56ee('0x7')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb577=['./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb577,0x1f2));var _0x7b57=function(_0x50150f,_0x92b2ca){_0x50150f=_0x50150f-0x0;var _0x3f3764=_0xb577[_0x50150f];return _0x3f3764;};'use strict';var _=require(_0x7b57('0x0'));var util=require(_0x7b57('0x1'));var logger=require(_0x7b57('0x2'))(_0x7b57('0x3'));var moment=require(_0x7b57('0x4'));var BPromise=require(_0x7b57('0x5'));var rp=require(_0x7b57('0x6'));var fs=require('fs');var path=require(_0x7b57('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b57('0x8'));module[_0x7b57('0x9')]=function(_0x4d3abe,_0x228055){return _0x4d3abe[_0x7b57('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 11a7052..88a110b 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 _0x97a7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1eca06,_0x2eebe7){var _0x2b95d6=function(_0x13b109){while(--_0x13b109){_0x1eca06['push'](_0x1eca06['shift']());}};_0x2b95d6(++_0x2eebe7);}(_0x97a7,0x1a6));var _0x797a=function(_0x4ed255,_0x5d09e1){_0x4ed255=_0x4ed255-0x0;var _0x5adc21=_0x97a7[_0x4ed255];return _0x5adc21;};'use strict';var _=require(_0x797a('0x0'));var util=require(_0x797a('0x1'));var moment=require(_0x797a('0x2'));var BPromise=require(_0x797a('0x3'));var rs=require(_0x797a('0x4'));var fs=require('fs');var Redis=require(_0x797a('0x5'));var db=require(_0x797a('0x6'))['db'];var utils=require(_0x797a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x797a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x797a('0x9')][_0x797a('0xa')]({'port':0x232a});config[_0x797a('0xb')]=_[_0x797a('0xc')](config[_0x797a('0xb')],{'host':_0x797a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x797a('0xb')]));require(_0x797a('0xe'))[_0x797a('0xf')](socket);function respondWithRpcPromise(_0x404d0f,_0x5ba2a6,_0x45942a){return new BPromise(function(_0x25f3c2,_0x5d75c1){return client[_0x797a('0x10')](_0x404d0f,_0x45942a)[_0x797a('0x11')](function(_0x265971){logger[_0x797a('0x12')](_0x797a('0x13'),_0x5ba2a6,_0x797a('0x14'));logger['debug'](_0x797a('0x15'),_0x5ba2a6,'request\x20sent',JSON[_0x797a('0x16')](_0x265971));if(_0x265971[_0x797a('0x17')]){if(_0x265971[_0x797a('0x17')][_0x797a('0x18')]===0x1f4){logger[_0x797a('0x17')](_0x797a('0x13'),_0x5ba2a6,_0x265971[_0x797a('0x17')][_0x797a('0x19')]);return _0x5d75c1(_0x265971['error']['message']);}logger[_0x797a('0x17')](_0x797a('0x13'),_0x5ba2a6,_0x265971[_0x797a('0x17')]['message']);return _0x25f3c2(_0x265971[_0x797a('0x17')][_0x797a('0x19')]);}else{logger[_0x797a('0x12')](_0x797a('0x13'),_0x5ba2a6,_0x797a('0x14'));_0x25f3c2(_0x265971[_0x797a('0x1a')][_0x797a('0x19')]);}})[_0x797a('0x1b')](function(_0x4eb8ec){logger[_0x797a('0x17')](_0x797a('0x13'),_0x5ba2a6,_0x4eb8ec);_0x5d75c1(_0x4eb8ec);});});} \ No newline at end of file +var _0xec87=['jayson/promise','redis','defaults','localhost','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xec87,0x180));var _0x7ec8=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xec87[_0x1f7201];return _0x289fd2;};'use strict';var _=require('lodash');var util=require(_0x7ec8('0x0'));var moment=require('moment');var BPromise=require(_0x7ec8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ec8('0x2'));var db=require(_0x7ec8('0x3'))['db'];var utils=require(_0x7ec8('0x4'));var logger=require('../../config/logger')(_0x7ec8('0x5'));var config=require(_0x7ec8('0x6'));var jayson=require(_0x7ec8('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7ec8('0x8')]=_[_0x7ec8('0x9')](config[_0x7ec8('0x8')],{'host':_0x7ec8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ec8('0x8')]));require('./chatWebsite.socket')[_0x7ec8('0xb')](socket);function respondWithRpcPromise(_0x5dedb3,_0x434455,_0xfb9720){return new BPromise(function(_0x536034,_0x5a657d){return client[_0x7ec8('0xc')](_0x5dedb3,_0xfb9720)[_0x7ec8('0xd')](function(_0x112397){logger[_0x7ec8('0xe')](_0x7ec8('0xf'),_0x434455,_0x7ec8('0x10'));logger[_0x7ec8('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x434455,'request\x20sent',JSON[_0x7ec8('0x12')](_0x112397));if(_0x112397[_0x7ec8('0x13')]){if(_0x112397[_0x7ec8('0x13')][_0x7ec8('0x14')]===0x1f4){logger[_0x7ec8('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x434455,_0x112397[_0x7ec8('0x13')]['message']);return _0x5a657d(_0x112397[_0x7ec8('0x13')][_0x7ec8('0x15')]);}logger[_0x7ec8('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x434455,_0x112397[_0x7ec8('0x13')][_0x7ec8('0x15')]);return _0x536034(_0x112397[_0x7ec8('0x13')][_0x7ec8('0x15')]);}else{logger[_0x7ec8('0xe')](_0x7ec8('0xf'),_0x434455,_0x7ec8('0x10'));_0x536034(_0x112397[_0x7ec8('0x16')][_0x7ec8('0x15')]);}})['catch'](function(_0x2b264f){logger['error'](_0x7ec8('0xf'),_0x434455,_0x2b264f);_0x5a657d(_0x2b264f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3af3e27..a8319e8 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 _0xa61a=['emit','removeListener','register','length','./chatWebsite.events','save','remove'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xa61a,0xac));var _0xaa61=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xa61a[_0x416cdc];return _0x1931ce;};'use strict';var ChatWebsiteEvents=require(_0xaa61('0x0'));var events=[_0xaa61('0x1'),_0xaa61('0x2'),'update'];function createListener(_0x193b25,_0x135db2){return function(_0x2cbaee){_0x135db2[_0xaa61('0x3')](_0x193b25,_0x2cbaee);};}function removeListener(_0x28c263,_0x35b578){return function(){ChatWebsiteEvents[_0xaa61('0x4')](_0x28c263,_0x35b578);};}exports[_0xaa61('0x5')]=function(_0x562204){for(var _0x1c4f4d=0x0,_0x1c6367=events[_0xaa61('0x6')];_0x1c4f4d<_0x1c6367;_0x1c4f4d++){var _0x165d62=events[_0x1c4f4d];var _0x592cdd=createListener('chatWebsite:'+_0x165d62,_0x562204);ChatWebsiteEvents['on'](_0x165d62,_0x592cdd);}}; \ No newline at end of file +var _0xf3d3=['register','./chatWebsite.events','save','emit','removeListener'];(function(_0x4bd76e,_0x260c31){var _0x96a285=function(_0x28176d){while(--_0x28176d){_0x4bd76e['push'](_0x4bd76e['shift']());}};_0x96a285(++_0x260c31);}(_0xf3d3,0x146));var _0x3f3d=function(_0x515f78,_0x3b69be){_0x515f78=_0x515f78-0x0;var _0x506f6c=_0xf3d3[_0x515f78];return _0x506f6c;};'use strict';var ChatWebsiteEvents=require(_0x3f3d('0x0'));var events=[_0x3f3d('0x1'),'remove','update'];function createListener(_0x29e309,_0x1eaa7e){return function(_0x4954bd){_0x1eaa7e[_0x3f3d('0x2')](_0x29e309,_0x4954bd);};}function removeListener(_0x4655cf,_0xb7911f){return function(){ChatWebsiteEvents[_0x3f3d('0x3')](_0x4655cf,_0xb7911f);};}exports[_0x3f3d('0x4')]=function(_0x410d4d){for(var _0x3fcede=0x0,_0x333d1b=events['length'];_0x3fcede<_0x333d1b;_0x3fcede++){var _0x4bd4b5=events[_0x3fcede];var _0x4c41de=createListener('chatWebsite:'+_0x4bd4b5,_0x410d4d);ChatWebsiteEvents['on'](_0x4bd4b5,_0x4c41de);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 1e013ad..108cff0 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 _0x8517=['../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','single','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x164b1d,_0x4a9f81){var _0xb29999=function(_0x2c6e02){while(--_0x2c6e02){_0x164b1d['push'](_0x164b1d['shift']());}};_0xb29999(++_0x4a9f81);}(_0x8517,0x15e));var _0x7851=function(_0x6b0651,_0x319ae3){_0x6b0651=_0x6b0651-0x0;var _0x229252=_0x8517[_0x6b0651];return _0x229252;};'use strict';var multer=require('multer');var util=require(_0x7851('0x0'));var path=require(_0x7851('0x1'));var timeout=require(_0x7851('0x2'));var express=require(_0x7851('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7851('0x4'));var interaction=require(_0x7851('0x5'));var config=require(_0x7851('0x6'));var controller=require(_0x7851('0x7'));router['get']('/',auth[_0x7851('0x8')](),controller[_0x7851('0x9')]);router['get'](_0x7851('0xa'),auth[_0x7851('0x8')](),controller['describe']);router[_0x7851('0xb')](_0x7851('0xc'),auth[_0x7851('0x8')](),controller[_0x7851('0xd')]);router[_0x7851('0xb')](_0x7851('0xe'),auth[_0x7851('0x8')](),controller[_0x7851('0xf')]);router['get'](_0x7851('0x10'),auth[_0x7851('0x8')](),controller[_0x7851('0x11')]);router[_0x7851('0xb')](_0x7851('0x12'),controller['getLogo']);router[_0x7851('0xb')](_0x7851('0x13'),controller['getAvatar']);router[_0x7851('0xb')](_0x7851('0x14'),controller[_0x7851('0x15')]);router['get'](_0x7851('0x16'),controller[_0x7851('0x17')]);router[_0x7851('0xb')](_0x7851('0x18'),auth[_0x7851('0x8')](),controller[_0x7851('0x19')]);router['get'](_0x7851('0x1a'),controller[_0x7851('0x1b')]);router[_0x7851('0xb')](_0x7851('0x1c'),auth[_0x7851('0x8')](),controller[_0x7851('0x1d')]);router[_0x7851('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x7851('0x1e')]);router[_0x7851('0xb')]('/:id/fields',controller[_0x7851('0x1f')]);router[_0x7851('0xb')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x7851('0xb')](_0x7851('0x20'),auth[_0x7851('0x8')](),controller[_0x7851('0x21')]);router[_0x7851('0x22')]('/',auth[_0x7851('0x8')](),controller[_0x7851('0x23')]);router['post'](_0x7851('0xe'),auth[_0x7851('0x8')](),controller[_0x7851('0x24')]);router['post']('/:id/canned_answers',auth[_0x7851('0x8')](),controller[_0x7851('0x25')]);var upload=multer({'storage':multer[_0x7851('0x26')]({'destination':function(_0x1c02ab,_0x3863f9,_0x1f2aaf){_0x1f2aaf(null,path[_0x7851('0x27')](config[_0x7851('0x28')],_0x7851('0x29')));},'filename':function(_0x4f819f,_0x1476d7,_0x5533fd){_0x5533fd(null,util[_0x7851('0x2a')](_0x7851('0x2b'),Date[_0x7851('0x2c')](),_0x1476d7[_0x7851('0x2d')]));}})});router[_0x7851('0x22')]('/:id/logo',upload['single'](_0x7851('0x2e')),controller[_0x7851('0x2f')]);var upload=multer({'storage':multer[_0x7851('0x26')]({'destination':function(_0x3767f9,_0xb4eb6,_0x317ebe){_0x317ebe(null,path[_0x7851('0x27')](config['root'],_0x7851('0x30')));},'filename':function(_0xd3b129,_0x230363,_0x4df40d){_0x4df40d(null,util[_0x7851('0x2a')]('%s-%s',Date[_0x7851('0x2c')](),_0x230363[_0x7851('0x2d')]));}})});router[_0x7851('0x22')]('/:id/avatar',upload[_0x7851('0x31')](_0x7851('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x7851('0x26')]({'destination':function(_0x1db3d1,_0x18f9e4,_0x38cc5e){_0x38cc5e(null,path[_0x7851('0x27')](config[_0x7851('0x28')],_0x7851('0x30')));},'filename':function(_0x297b1d,_0x73b809,_0x576bcd){_0x576bcd(null,util[_0x7851('0x2a')]('%s-%s',Date[_0x7851('0x2c')](),_0x73b809[_0x7851('0x2d')]));}})});router[_0x7851('0x22')]('/:id/customer_avatar',upload['single'](_0x7851('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd1ecf6,_0x1f7ba8,_0x152004){_0x152004(null,path['join'](config[_0x7851('0x28')],_0x7851('0x30')));},'filename':function(_0x4c3d4b,_0x552e3f,_0x1a6ded){_0x1a6ded(null,util[_0x7851('0x2a')](_0x7851('0x2b'),Date[_0x7851('0x2c')](),_0x552e3f[_0x7851('0x2d')]));}})});router[_0x7851('0x22')]('/:id/system_avatar',upload[_0x7851('0x31')](_0x7851('0x2e')),controller[_0x7851('0x32')]);router['post'](_0x7851('0x33'),controller[_0x7851('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x7851('0x26')]({'destination':function(_0x5aaf92,_0x4f2f49,_0x2a3fe4){const _0x482f0c=path[_0x7851('0x27')](config[_0x7851('0x28')],_0x7851('0x35'),_0x7851('0x36'),_0x7851('0x37'));fs_extra[_0x7851('0x38')](_0x482f0c,function(){_0x2a3fe4(null,_0x482f0c);});},'filename':function(_0x427725,_0x44eeb7,_0x7962e6){const _0x51d2a3=_0x44eeb7['originalname'][_0x7851('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8c510f=path[_0x7851('0x3a')](_0x51d2a3);const _0x188bde=Date[_0x7851('0x2c')]()+'-'+_0x51d2a3[_0x7851('0x39')](_0x8c510f,'')+_0x8c510f;_0x7962e6(null,_0x188bde);}})});router[_0x7851('0x22')](_0x7851('0x3b'),offlineUploadMulter['any'](),controller['offline']);router[_0x7851('0x22')](_0x7851('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x7851('0x22')](_0x7851('0x1c'),auth['isAuthenticated'](),controller[_0x7851('0x3c')]);router['post'](_0x7851('0x3d'),auth[_0x7851('0x8')](),controller[_0x7851('0x3e')]);router['post'](_0x7851('0x20'),auth[_0x7851('0x8')](),controller[_0x7851('0x3f')]);router[_0x7851('0x40')](_0x7851('0xc'),auth[_0x7851('0x8')](),controller[_0x7851('0x41')]);router[_0x7851('0x42')](_0x7851('0xc'),auth[_0x7851('0x8')](),controller[_0x7851('0x43')]);router[_0x7851('0x42')](_0x7851('0xe'),auth[_0x7851('0x8')](),controller[_0x7851('0x44')]);router[_0x7851('0x42')]('/:id/canned_answers',auth[_0x7851('0x8')](),controller[_0x7851('0x45')]);router[_0x7851('0x42')](_0x7851('0x20'),auth[_0x7851('0x8')](),controller[_0x7851('0x46')]);module['exports']=router; \ No newline at end of file +var _0x4630=['/:id/avatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','now','file','server/files/images/avatars/','%s-%s','originalname','single','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo'];(function(_0x4291b4,_0x19e8af){var _0x4efa01=function(_0x3e5fdc){while(--_0x3e5fdc){_0x4291b4['push'](_0x4291b4['shift']());}};_0x4efa01(++_0x19e8af);}(_0x4630,0x73));var _0x0463=function(_0x1ade6d,_0x28f61f){_0x1ade6d=_0x1ade6d-0x0;var _0x132841=_0x4630[_0x1ade6d];return _0x132841;};'use strict';var multer=require('multer');var util=require(_0x0463('0x0'));var path=require(_0x0463('0x1'));var timeout=require(_0x0463('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0463('0x3'));var auth=require(_0x0463('0x4'));var interaction=require(_0x0463('0x5'));var config=require(_0x0463('0x6'));var controller=require(_0x0463('0x7'));router[_0x0463('0x8')]('/',auth[_0x0463('0x9')](),controller[_0x0463('0xa')]);router['get']('/describe',auth[_0x0463('0x9')](),controller['describe']);router[_0x0463('0x8')](_0x0463('0xb'),auth[_0x0463('0x9')](),controller[_0x0463('0xc')]);router['get'](_0x0463('0xd'),auth['isAuthenticated'](),controller[_0x0463('0xe')]);router[_0x0463('0x8')](_0x0463('0xf'),auth[_0x0463('0x9')](),controller[_0x0463('0x10')]);router[_0x0463('0x8')](_0x0463('0x11'),controller[_0x0463('0x12')]);router[_0x0463('0x8')](_0x0463('0x13'),controller['getAvatar']);router['get'](_0x0463('0x14'),controller['getCustomerAvatar']);router['get'](_0x0463('0x15'),controller['getSystemAvatar']);router[_0x0463('0x8')](_0x0463('0x16'),auth[_0x0463('0x9')](),controller[_0x0463('0x17')]);router['get'](_0x0463('0x18'),controller['getSnippet']);router['get']('/:id/applications',auth[_0x0463('0x9')](),controller[_0x0463('0x19')]);router[_0x0463('0x8')]('/:id/proactive_actions',auth[_0x0463('0x9')](),controller['getProactiveActions']);router[_0x0463('0x8')](_0x0463('0x1a'),controller[_0x0463('0x1b')]);router['get'](_0x0463('0x1c'),auth[_0x0463('0x9')](),controller[_0x0463('0x1d')]);router[_0x0463('0x8')](_0x0463('0x1e'),auth['isAuthenticated'](),controller[_0x0463('0x1f')]);router[_0x0463('0x20')]('/',auth['isAuthenticated'](),controller[_0x0463('0x21')]);router[_0x0463('0x20')](_0x0463('0xd'),auth[_0x0463('0x9')](),controller[_0x0463('0x22')]);router['post'](_0x0463('0xf'),auth[_0x0463('0x9')](),controller[_0x0463('0x23')]);var upload=multer({'storage':multer[_0x0463('0x24')]({'destination':function(_0x28d300,_0x207503,_0xbec684){_0xbec684(null,path[_0x0463('0x25')](config[_0x0463('0x26')],'server/files/images/logos/'));},'filename':function(_0x4b9a93,_0x5a0bcf,_0x69b70a){_0x69b70a(null,util[_0x0463('0x27')]('%s-%s',Date[_0x0463('0x28')](),_0x5a0bcf['originalname']));}})});router[_0x0463('0x20')]('/:id/logo',upload['single'](_0x0463('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x0463('0x24')]({'destination':function(_0x5b9873,_0x1c3616,_0x41e09b){_0x41e09b(null,path[_0x0463('0x25')](config[_0x0463('0x26')],_0x0463('0x2a')));},'filename':function(_0x499394,_0x322f67,_0x2f8459){_0x2f8459(null,util[_0x0463('0x27')](_0x0463('0x2b'),Date[_0x0463('0x28')](),_0x322f67[_0x0463('0x2c')]));}})});router['post'](_0x0463('0x13'),upload[_0x0463('0x2d')](_0x0463('0x29')),controller[_0x0463('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x13d3db,_0x4ae86a,_0x2b5e1c){_0x2b5e1c(null,path[_0x0463('0x25')](config[_0x0463('0x26')],_0x0463('0x2a')));},'filename':function(_0x52a8a2,_0x2c7d0f,_0x448291){_0x448291(null,util[_0x0463('0x27')](_0x0463('0x2b'),Date[_0x0463('0x28')](),_0x2c7d0f[_0x0463('0x2c')]));}})});router[_0x0463('0x20')](_0x0463('0x14'),upload[_0x0463('0x2d')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x0463('0x24')]({'destination':function(_0xeec1be,_0x70d4ac,_0x252b8f){_0x252b8f(null,path[_0x0463('0x25')](config[_0x0463('0x26')],_0x0463('0x2a')));},'filename':function(_0x4f3f47,_0x173f15,_0x2f7cce){_0x2f7cce(null,util['format'](_0x0463('0x2b'),Date[_0x0463('0x28')](),_0x173f15[_0x0463('0x2c')]));}})});router['post']('/:id/system_avatar',upload['single']('file'),controller[_0x0463('0x2f')]);router[_0x0463('0x20')](_0x0463('0x30'),controller[_0x0463('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x0463('0x24')]({'destination':function(_0x436d73,_0x33a9d9,_0x2c06a9){const _0x54f80c=path[_0x0463('0x25')](config[_0x0463('0x26')],_0x0463('0x32'),_0x0463('0x33'),_0x0463('0x34'));fs_extra[_0x0463('0x35')](_0x54f80c,function(){_0x2c06a9(null,_0x54f80c);});},'filename':function(_0x5f390e,_0x264d14,_0x4c03f6){const _0x134315=_0x264d14[_0x0463('0x2c')][_0x0463('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x505406=path['extname'](_0x134315);const _0x1f575b=Date[_0x0463('0x28')]()+'-'+_0x134315[_0x0463('0x36')](_0x505406,'')+_0x505406;_0x4c03f6(null,_0x1f575b);}})});router[_0x0463('0x20')](_0x0463('0x37'),offlineUploadMulter['any'](),controller['offline']);router[_0x0463('0x20')]('/:id/interactions',auth[_0x0463('0x9')](),controller[_0x0463('0x38')]);router[_0x0463('0x20')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0463('0x39')]);router[_0x0463('0x20')](_0x0463('0x3a'),auth[_0x0463('0x9')](),controller[_0x0463('0x3b')]);router[_0x0463('0x20')](_0x0463('0x1e'),auth[_0x0463('0x9')](),controller[_0x0463('0x3c')]);router[_0x0463('0x3d')](_0x0463('0xb'),auth[_0x0463('0x9')](),controller[_0x0463('0x3e')]);router[_0x0463('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x0463('0x40')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x0463('0x3f')](_0x0463('0xf'),auth[_0x0463('0x9')](),controller[_0x0463('0x41')]);router[_0x0463('0x3f')](_0x0463('0x1e'),auth[_0x0463('0x9')](),controller['removeAgents']);module[_0x0463('0x42')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index e003f12..47ad6bf 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 _0x0141=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','express','../config/environment','Router','app','client-side-logger'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x0141,0x100));var _0x1014=function(_0x41dcf5,_0x4ebf9e){_0x41dcf5=_0x41dcf5-0x0;var _0x3b4f85=_0x0141[_0x41dcf5];return _0x3b4f85;};var beaverLogger=require('beaver-logger/server');var express=require(_0x1014('0x0'));var auth=require('../components/auth/service');var config=require(_0x1014('0x1'));var router=express[_0x1014('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x3ebca3,_0x3daa9d,_0x4feb4e){var _0x5cc64c=_0x3ebca3[_0x1014('0x3')]['get'](_0x1014('0x4'));if(!_0x5cc64c){throw new Error(_0x1014('0x5'));}return beaverLogger[_0x1014('0x6')]({'uri':_0x1014('0x7'),'logger':_0x5cc64c,'enableCors':!isProduction})(_0x3ebca3,_0x3daa9d,_0x4feb4e);}router['use'](auth[_0x1014('0x8')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x4035=['exports','../components/auth/service','env','production','client-side-logger','expressEndpoint','/client-logs','isAuthenticated'];(function(_0x541484,_0x4a5cee){var _0x20c231=function(_0x32d6a2){while(--_0x32d6a2){_0x541484['push'](_0x541484['shift']());}};_0x20c231(++_0x4a5cee);}(_0x4035,0x99));var _0x5403=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x4035[_0x4b2863];return _0x567d67;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x5403('0x0'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x5403('0x1')]===_0x5403('0x2')||![];function clientSideLogs(_0x220291,_0x4dfc0d,_0x20ebfe){var _0x2c9583=_0x220291['app']['get'](_0x5403('0x3'));if(!_0x2c9583){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x5403('0x4')]({'uri':_0x5403('0x5'),'logger':_0x2c9583,'enableCors':!isProduction})(_0x220291,_0x4dfc0d,_0x20ebfe);}router['use'](auth[_0x5403('0x6')](),clientSideLogs);module[_0x5403('0x7')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c7956d5..9070dfb 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 _0x3005=['AmazonAWS','Google','MicrosoftAzure','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM'];(function(_0x3d1886,_0x28aba8){var _0x154776=function(_0x522465){while(--_0x522465){_0x3d1886['push'](_0x3d1886['shift']());}};_0x154776(++_0x28aba8);}(_0x3005,0x1d1));var _0x5300=function(_0x1d098c,_0x85b526){_0x1d098c=_0x1d098c-0x0;var _0x27b7c1=_0x3005[_0x1d098c];return _0x27b7c1;};'use strict';var Sequelize=require(_0x5300('0x0'));module[_0x5300('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5300('0x2')](_0x5300('0x3'),_0x5300('0x4'),_0x5300('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x5300('0x6'))},'data1':{'type':Sequelize[_0x5300('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x5300('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x5300('0x8')},'data4':{'type':Sequelize[_0x5300('0x7')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x5300('0x9')},'data6':{'type':Sequelize[_0x5300('0xa')],'comment':_0x5300('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0x5300('0xc')}}; \ No newline at end of file +var _0xdcbe=['MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x756fc2,_0x459927){var _0x4ed5c0=function(_0x54fa01){while(--_0x54fa01){_0x756fc2['push'](_0x756fc2['shift']());}};_0x4ed5c0(++_0x459927);}(_0xdcbe,0x140));var _0xedcb=function(_0x5a7c3e,_0x52efa1){_0x5a7c3e=_0x5a7c3e-0x0;var _0x4c2b6b=_0xdcbe[_0x5a7c3e];return _0x4c2b6b;};'use strict';var Sequelize=require(_0xedcb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xedcb('0x1')](_0xedcb('0x2'),_0xedcb('0x3'),_0xedcb('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xedcb('0x5'),_0xedcb('0x6'))},'data1':{'type':Sequelize[_0xedcb('0x7')],'comment':_0xedcb('0x8')},'data2':{'type':Sequelize[_0xedcb('0x7')],'comment':_0xedcb('0x9')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xedcb('0x7')],'comment':_0xedcb('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xedcb('0xb')},'data6':{'type':Sequelize[_0xedcb('0xc')],'comment':_0xedcb('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0xedcb('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 59e766f..437146e 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 _0x0c81=['message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','padEnd','slice','rawAttributes','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','CloudProvider','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','keys','length','includeAll','find','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data6','data5','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x0c81,0xb2));var _0x10c8=function(_0x4d2abc,_0x29b228){_0x4d2abc=_0x4d2abc-0x0;var _0x5c4540=_0x0c81[_0x4d2abc];return _0x5c4540;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x10c8('0x0'));var config=require(_0x10c8('0x1'));var logger=require(_0x10c8('0x2'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x10c8('0x3'));config[_0x10c8('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x10c8('0x5'))(new Redis(config[_0x10c8('0x4')]));var redis=new Redis(config[_0x10c8('0x4')]);function respondWithStatusCode(_0x2ca168,_0x401a49){_0x401a49=_0x401a49||0xcc;return function(_0x786f7f){if(_0x786f7f){return _0x2ca168[_0x10c8('0x6')](_0x401a49);}return _0x2ca168['status'](_0x401a49)[_0x10c8('0x7')]();};}function respondWithResult(_0x2fddb1,_0x368cab){_0x368cab=_0x368cab||0xc8;return function(_0x23cb8f){if(_0x23cb8f){return _0x2fddb1[_0x10c8('0x8')](_0x368cab)['json'](_0x23cb8f);}};}function respondWithFilteredResult(_0x847113,_0x4eb2ae){return function(_0x537117){if(_0x537117){var _0x205805=typeof _0x4eb2ae[_0x10c8('0x9')]===_0x10c8('0xa')&&typeof _0x4eb2ae[_0x10c8('0xb')]===_0x10c8('0xa');var _0x3dbceb=_0x537117[_0x10c8('0xc')];var _0x500990=_0x205805?0x0:_0x4eb2ae['offset'];var _0x1bed06=_0x205805?_0x537117[_0x10c8('0xc')]:_0x4eb2ae[_0x10c8('0x9')]+_0x4eb2ae[_0x10c8('0xb')];var _0x380a0e;if(_0x1bed06>=_0x3dbceb){_0x1bed06=_0x3dbceb;_0x380a0e=0xc8;}else{_0x380a0e=0xce;}_0x847113['status'](_0x380a0e);return _0x847113[_0x10c8('0xd')](_0x10c8('0xe'),_0x500990+'-'+_0x1bed06+'/'+_0x3dbceb)[_0x10c8('0xf')](_0x537117);}return null;};}function saveUpdates(_0x251ade){return function(_0xd7996b){if(_0xd7996b){return _0xd7996b[_0x10c8('0x10')](_0x251ade)[_0x10c8('0x11')](function(_0x2a7e9e){return _0x2a7e9e;});}return null;};}function removeEntity(_0x4e8004){return function(_0x3db9c2){if(_0x3db9c2){return _0x3db9c2[_0x10c8('0x12')]()['then'](function(){_0x4e8004[_0x10c8('0x8')](0xcc)[_0x10c8('0x7')]();});}};}function handleEntityNotFound(_0x462d22){return function(_0x331623){if(!_0x331623){_0x462d22['sendStatus'](0x194);}return _0x331623;};}function handleError(_0x47b02e,_0xab0ac5){_0xab0ac5=_0xab0ac5||0x1f4;return function(_0x403ab6){logger[_0x10c8('0x13')](_0x403ab6[_0x10c8('0x14')]);if(_0x403ab6[_0x10c8('0x15')]){delete _0x403ab6['name'];}_0x47b02e[_0x10c8('0x8')](_0xab0ac5)[_0x10c8('0x16')](_0x403ab6);};}function maskClientSecret(_0x4bb565){return _[_0x10c8('0x17')](_0x4bb565[_0x10c8('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x169ff6,_0x5c6d76){var _0x2fd2a7={},_0x34ab28={},_0x457c7e={'count':0x0,'rows':[]};var _0x86278a=_['map'](db['CloudProvider'][_0x10c8('0x19')],function(_0x1d5d31){return{'name':_0x1d5d31['fieldName'],'type':_0x1d5d31['type'][_0x10c8('0x1a')]};});_0x34ab28['model']=_[_0x10c8('0x1b')](_0x86278a,_0x10c8('0x15'));_0x34ab28[_0x10c8('0x1c')]=_['keys'](_0x169ff6[_0x10c8('0x1c')]);_0x34ab28[_0x10c8('0x1d')]=_[_0x10c8('0x1e')](_0x34ab28[_0x10c8('0x1f')],_0x34ab28[_0x10c8('0x1c')]);_0x2fd2a7['attributes']=_[_0x10c8('0x1e')](_0x34ab28[_0x10c8('0x1f')],qs[_0x10c8('0x20')](_0x169ff6[_0x10c8('0x1c')][_0x10c8('0x20')]));_0x2fd2a7[_0x10c8('0x21')]=_0x2fd2a7['attributes']['length']?_0x2fd2a7[_0x10c8('0x21')]:_0x34ab28[_0x10c8('0x1f')];if(!_0x169ff6[_0x10c8('0x1c')][_0x10c8('0x22')]('nolimit')){_0x2fd2a7['limit']=qs[_0x10c8('0xb')](_0x169ff6[_0x10c8('0x1c')][_0x10c8('0xb')]);_0x2fd2a7[_0x10c8('0x9')]=qs[_0x10c8('0x9')](_0x169ff6[_0x10c8('0x1c')][_0x10c8('0x9')]);}_0x2fd2a7[_0x10c8('0x23')]=qs[_0x10c8('0x24')](_0x169ff6['query'][_0x10c8('0x24')]);_0x2fd2a7['where']=qs['filters'](_[_0x10c8('0x25')](_0x169ff6[_0x10c8('0x1c')],_0x34ab28[_0x10c8('0x1d')]),_0x86278a);if(_0x169ff6[_0x10c8('0x1c')][_0x10c8('0x26')]){_0x2fd2a7[_0x10c8('0x27')]=_[_0x10c8('0x28')](_0x2fd2a7[_0x10c8('0x27')],{'$or':_[_0x10c8('0x1b')](_0x86278a,function(_0x231321){if(_0x231321[_0x10c8('0x29')]!==_0x10c8('0x2a')){var _0x167377={};_0x167377[_0x231321[_0x10c8('0x15')]]={'$like':'%'+_0x169ff6[_0x10c8('0x1c')][_0x10c8('0x26')]+'%'};return _0x167377;}})});}_0x2fd2a7=_[_0x10c8('0x28')]({},_0x2fd2a7,_0x169ff6[_0x10c8('0x2b')]);var _0x554d27={'where':_0x2fd2a7['where']};return db[_0x10c8('0x2c')][_0x10c8('0xc')](_0x554d27)['then'](function(_0x513f06){_0x457c7e[_0x10c8('0xc')]=_0x513f06;if(_0x169ff6['query']['includeAll']){_0x2fd2a7[_0x10c8('0x2d')]=[{'all':!![]}];}return db[_0x10c8('0x2c')][_0x10c8('0x2e')](_0x2fd2a7);})['then'](function(_0x191bd2){_0x457c7e[_0x10c8('0x2f')]=_[_0x10c8('0x1b')](_0x191bd2,function(_0x2b7ad4){if(_0x2b7ad4[_0x10c8('0x30')]===_0x10c8('0x31')){var _0x42f666=encryptor[_0x10c8('0x32')](_0x2b7ad4['data3']);_0x2b7ad4[_0x10c8('0x33')]=maskClientSecret(_0x42f666);}return _0x2b7ad4;});return _0x457c7e;})[_0x10c8('0x11')](respondWithFilteredResult(_0x5c6d76,_0x2fd2a7))[_0x10c8('0x34')](handleError(_0x5c6d76,null));};exports['show']=function(_0x2ba0ac,_0x14b2ba){var _0x551809={'raw':!![],'where':{'id':_0x2ba0ac[_0x10c8('0x35')]['id']}},_0x1b9192={};_0x1b9192[_0x10c8('0x1f')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x1b9192['query']=_[_0x10c8('0x36')](_0x2ba0ac[_0x10c8('0x1c')]);_0x1b9192[_0x10c8('0x1d')]=_['intersection'](_0x1b9192[_0x10c8('0x1f')],_0x1b9192[_0x10c8('0x1c')]);_0x551809[_0x10c8('0x21')]=_['intersection'](_0x1b9192[_0x10c8('0x1f')],qs[_0x10c8('0x20')](_0x2ba0ac['query'][_0x10c8('0x20')]));_0x551809[_0x10c8('0x21')]=_0x551809[_0x10c8('0x21')][_0x10c8('0x37')]?_0x551809['attributes']:_0x1b9192[_0x10c8('0x1f')];if(_0x2ba0ac[_0x10c8('0x1c')][_0x10c8('0x38')]){_0x551809['include']=[{'all':!![]}];}_0x551809=_[_0x10c8('0x28')]({},_0x551809,_0x2ba0ac['options']);return db[_0x10c8('0x2c')][_0x10c8('0x39')](_0x551809)[_0x10c8('0x11')](handleEntityNotFound(_0x14b2ba,null))[_0x10c8('0x11')](function(_0x42b3a0){if(_0x42b3a0[_0x10c8('0x30')]===_0x10c8('0x31')){var _0x8a7128=encryptor[_0x10c8('0x32')](_0x42b3a0['data3']);_0x42b3a0[_0x10c8('0x33')]=maskClientSecret(_0x8a7128);}return _0x42b3a0;})[_0x10c8('0x11')](respondWithResult(_0x14b2ba,null))[_0x10c8('0x34')](handleError(_0x14b2ba,null));};exports[_0x10c8('0x3a')]=function(_0x1c2fd1,_0x4ed6dd){if(!_0x1c2fd1['body'][_0x10c8('0x15')])throw new Error(_0x10c8('0x3b'));if(!_0x1c2fd1['body'][_0x10c8('0x30')])throw new Error(_0x10c8('0x3c'));var _0x17c864=db[_0x10c8('0x2c')][_0x10c8('0x19')][_0x10c8('0x30')]['values'];if(!_0x17c864[_0x10c8('0x3d')](_0x1c2fd1[_0x10c8('0x3e')][_0x10c8('0x30')]))throw new Error(_0x10c8('0x3f')+_0x17c864[_0x10c8('0x40')](',\x20'));if(_0x1c2fd1[_0x10c8('0x3e')][_0x10c8('0x30')]===_0x10c8('0x31')&&_0x1c2fd1[_0x10c8('0x3e')][_0x10c8('0x33')]){_0x1c2fd1[_0x10c8('0x3e')][_0x10c8('0x33')]=encryptor[_0x10c8('0x41')](_0x1c2fd1[_0x10c8('0x3e')]['data3']);}return db['CloudProvider'][_0x10c8('0x3a')](_0x1c2fd1['body'],{})[_0x10c8('0x11')](respondWithResult(_0x4ed6dd,0xc9))['catch'](handleError(_0x4ed6dd,null));};exports['update']=function(_0x58e34f,_0xcfa66f){if(_0x58e34f[_0x10c8('0x3e')]['id']){delete _0x58e34f[_0x10c8('0x3e')]['id'];}return db['CloudProvider'][_0x10c8('0x39')]({'where':{'id':_0x58e34f[_0x10c8('0x35')]['id']}})[_0x10c8('0x11')](handleEntityNotFound(_0xcfa66f,null))[_0x10c8('0x11')](function(_0x15e38d){if(_0x15e38d['service']===_0x10c8('0x31')&&_0x58e34f[_0x10c8('0x3e')][_0x10c8('0x33')]){_0x58e34f[_0x10c8('0x3e')][_0x10c8('0x33')]=encryptor['encryptString'](_0x58e34f['body'][_0x10c8('0x33')]);}return _0x15e38d;})[_0x10c8('0x11')](saveUpdates(_0x58e34f['body'],null))[_0x10c8('0x11')](respondWithResult(_0xcfa66f,null))[_0x10c8('0x34')](handleError(_0xcfa66f,null));};exports['destroy']=function(_0x55ade2,_0x35bbac){return db[_0x10c8('0x2c')]['find']({'where':{'id':_0x55ade2[_0x10c8('0x35')]['id']}})[_0x10c8('0x11')](handleEntityNotFound(_0x35bbac,null))[_0x10c8('0x11')](removeEntity(_0x35bbac,null))[_0x10c8('0x34')](handleError(_0x35bbac,null));};exports['oauth2MicrosoftAuthorize']=function(_0x25c451,_0x2e2071){return db[_0x10c8('0x2c')][_0x10c8('0x42')]({'where':{'id':_0x25c451[_0x10c8('0x35')]['id']},'raw':!![]})[_0x10c8('0x11')](function(_0x2e0240){if(!_0x2e0240)return _0x2e2071[_0x10c8('0x6')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2e0240,_0x25c451[_0x10c8('0x43')]['id'])};})[_0x10c8('0x11')](respondWithResult(_0x2e2071,null))[_0x10c8('0x34')](handleError(_0x2e2071,null));};exports[_0x10c8('0x44')]=function(_0x2b9cd3,_0x513415){var _0x1c0c6a=_0x2b9cd3[_0x10c8('0x3e')];var _0x23ed26;var _0x463841;if(_0x1c0c6a[_0x10c8('0x13')])throw _0x1c0c6a;redis[_0x10c8('0x45')](_0x1c0c6a['state'])['then'](function(_0x2fb4f4){if(!_0x2fb4f4)throw new Error(_0x10c8('0x46'));_0x23ed26=JSON[_0x10c8('0x47')](_0x2fb4f4);var _0x2ff0b2=Buffer[_0x10c8('0x48')](_0x1c0c6a[_0x10c8('0x49')],_0x10c8('0x4a'))[_0x10c8('0x4b')](_0x10c8('0x4c'));_0x463841=JSON[_0x10c8('0x47')](_0x2ff0b2);if(!oauth['isValidIdToken'](_0x1c0c6a[_0x10c8('0x4d')],_0x23ed26[_0x10c8('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x1c0c6a[_0x10c8('0x49')]);return oauth[_0x10c8('0x4f')](_0x1c0c6a[_0x10c8('0x50')],_0x23ed26);})[_0x10c8('0x11')](function(_0x5094a3){_0x23ed26['data5']=_0x5094a3['access_token'];_0x23ed26[_0x10c8('0x51')]=_0x5094a3['refresh_token'];return db[_0x10c8('0x2c')][_0x10c8('0x10')]({'data5':_0x23ed26[_0x10c8('0x52')],'data6':_0x23ed26[_0x10c8('0x51')]},{'where':{'id':_0x23ed26['id']}});})[_0x10c8('0x11')](function(){oauth['startRefreshInterval'](_0x23ed26);socket['emit'](_0x10c8('0x53'),{'id':_0x463841['id']});return;})['then'](respondWithStatusCode(_0x513415,null))[_0x10c8('0x34')](function(_0x25aacd){if(_0x463841){socket['emit'](_0x10c8('0x54'),{'id':_0x463841['id']});}if(!_0x23ed26){logger[_0x10c8('0x13')](_0x10c8('0x55'),_0x25aacd);return _0x513415['status'](0x1f4)[_0x10c8('0x16')](_0x25aacd[_0x10c8('0x56')]);}logger['error'](_0x10c8('0x57'),_0x23ed26['id'],_0x25aacd);});}; \ No newline at end of file +var _0x5c11=['find','catch','body','Name\x20parameter\x20not\x20specified','values','includes','join','create','params','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','limit','undefined','offset','count','Content-Range','json','update','then','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','options'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0x5c11,0x1a9));var _0x15c1=function(_0x3bd3d2,_0x413068){_0x3bd3d2=_0x3bd3d2-0x0;var _0x569624=_0x5c11[_0x3bd3d2];return _0x569624;};'use strict';var _=require(_0x15c1('0x0'));var Redis=require(_0x15c1('0x1'));var qs=require(_0x15c1('0x2'));var encryptor=require(_0x15c1('0x3'));var config=require(_0x15c1('0x4'));var logger=require(_0x15c1('0x5'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x15c1('0x6'));config['redis']=_[_0x15c1('0x7')](config[_0x15c1('0x8')],{'host':_0x15c1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15c1('0x8')]));var redis=new Redis(config[_0x15c1('0x8')]);function respondWithStatusCode(_0x504527,_0x99a5d8){_0x99a5d8=_0x99a5d8||0xcc;return function(_0x1e4512){if(_0x1e4512){return _0x504527[_0x15c1('0xa')](_0x99a5d8);}return _0x504527[_0x15c1('0xb')](_0x99a5d8)[_0x15c1('0xc')]();};}function respondWithResult(_0x5a3092,_0x31edba){_0x31edba=_0x31edba||0xc8;return function(_0x318d35){if(_0x318d35){return _0x5a3092['status'](_0x31edba)['json'](_0x318d35);}};}function respondWithFilteredResult(_0x44b6ff,_0x623cd1){return function(_0x41ebb6){if(_0x41ebb6){var _0x51157b=typeof _0x623cd1['offset']==='undefined'&&typeof _0x623cd1[_0x15c1('0xd')]===_0x15c1('0xe');var _0x396ed7=_0x41ebb6['count'];var _0x4a1efb=_0x51157b?0x0:_0x623cd1[_0x15c1('0xf')];var _0x1ab802=_0x51157b?_0x41ebb6[_0x15c1('0x10')]:_0x623cd1[_0x15c1('0xf')]+_0x623cd1['limit'];var _0x49380d;if(_0x1ab802>=_0x396ed7){_0x1ab802=_0x396ed7;_0x49380d=0xc8;}else{_0x49380d=0xce;}_0x44b6ff[_0x15c1('0xb')](_0x49380d);return _0x44b6ff['set'](_0x15c1('0x11'),_0x4a1efb+'-'+_0x1ab802+'/'+_0x396ed7)[_0x15c1('0x12')](_0x41ebb6);}return null;};}function saveUpdates(_0x422abc){return function(_0x5ba601){if(_0x5ba601){return _0x5ba601[_0x15c1('0x13')](_0x422abc)[_0x15c1('0x14')](function(_0x568707){return _0x568707;});}return null;};}function removeEntity(_0x4e3f90){return function(_0x3f37ba){if(_0x3f37ba){return _0x3f37ba[_0x15c1('0x15')]()[_0x15c1('0x14')](function(){_0x4e3f90[_0x15c1('0xb')](0xcc)[_0x15c1('0xc')]();});}};}function handleEntityNotFound(_0x2ddf12){return function(_0x130986){if(!_0x130986){_0x2ddf12[_0x15c1('0xa')](0x194);}return _0x130986;};}function handleError(_0x53148d,_0xd335eb){_0xd335eb=_0xd335eb||0x1f4;return function(_0x3ebbe8){logger[_0x15c1('0x16')](_0x3ebbe8[_0x15c1('0x17')]);if(_0x3ebbe8[_0x15c1('0x18')]){delete _0x3ebbe8[_0x15c1('0x18')];}_0x53148d[_0x15c1('0xb')](_0xd335eb)[_0x15c1('0x19')](_0x3ebbe8);};}function maskClientSecret(_0x182109){return _[_0x15c1('0x1a')](_0x182109['slice'](0x0,0x3),0x14,'*');}exports[_0x15c1('0x1b')]=function(_0x27d5c1,_0xe624dc){var _0x264b23={},_0x223441={},_0x2ffe21={'count':0x0,'rows':[]};var _0x201712=_[_0x15c1('0x1c')](db[_0x15c1('0x1d')][_0x15c1('0x1e')],function(_0x15c7ce){return{'name':_0x15c7ce[_0x15c1('0x1f')],'type':_0x15c7ce[_0x15c1('0x20')][_0x15c1('0x21')]};});_0x223441[_0x15c1('0x22')]=_[_0x15c1('0x1c')](_0x201712,'name');_0x223441[_0x15c1('0x23')]=_[_0x15c1('0x24')](_0x27d5c1[_0x15c1('0x23')]);_0x223441[_0x15c1('0x25')]=_[_0x15c1('0x26')](_0x223441[_0x15c1('0x22')],_0x223441[_0x15c1('0x23')]);_0x264b23[_0x15c1('0x27')]=_[_0x15c1('0x26')](_0x223441[_0x15c1('0x22')],qs[_0x15c1('0x28')](_0x27d5c1[_0x15c1('0x23')][_0x15c1('0x28')]));_0x264b23[_0x15c1('0x27')]=_0x264b23[_0x15c1('0x27')][_0x15c1('0x29')]?_0x264b23[_0x15c1('0x27')]:_0x223441[_0x15c1('0x22')];if(!_0x27d5c1[_0x15c1('0x23')][_0x15c1('0x2a')](_0x15c1('0x2b'))){_0x264b23[_0x15c1('0xd')]=qs[_0x15c1('0xd')](_0x27d5c1[_0x15c1('0x23')][_0x15c1('0xd')]);_0x264b23[_0x15c1('0xf')]=qs[_0x15c1('0xf')](_0x27d5c1[_0x15c1('0x23')]['offset']);}_0x264b23[_0x15c1('0x2c')]=qs['sort'](_0x27d5c1[_0x15c1('0x23')]['sort']);_0x264b23[_0x15c1('0x2d')]=qs[_0x15c1('0x25')](_[_0x15c1('0x2e')](_0x27d5c1[_0x15c1('0x23')],_0x223441[_0x15c1('0x25')]),_0x201712);if(_0x27d5c1[_0x15c1('0x23')][_0x15c1('0x2f')]){_0x264b23['where']=_['merge'](_0x264b23[_0x15c1('0x2d')],{'$or':_[_0x15c1('0x1c')](_0x201712,function(_0x52acba){if(_0x52acba[_0x15c1('0x20')]!==_0x15c1('0x30')){var _0x16b3ab={};_0x16b3ab[_0x52acba[_0x15c1('0x18')]]={'$like':'%'+_0x27d5c1[_0x15c1('0x23')][_0x15c1('0x2f')]+'%'};return _0x16b3ab;}})});}_0x264b23=_[_0x15c1('0x31')]({},_0x264b23,_0x27d5c1['options']);var _0x3cec0b={'where':_0x264b23['where']};return db[_0x15c1('0x1d')][_0x15c1('0x10')](_0x3cec0b)['then'](function(_0x45e261){_0x2ffe21[_0x15c1('0x10')]=_0x45e261;if(_0x27d5c1[_0x15c1('0x23')][_0x15c1('0x32')]){_0x264b23[_0x15c1('0x33')]=[{'all':!![]}];}return db[_0x15c1('0x1d')][_0x15c1('0x34')](_0x264b23);})[_0x15c1('0x14')](function(_0x835e5a){_0x2ffe21[_0x15c1('0x35')]=_[_0x15c1('0x1c')](_0x835e5a,function(_0x4c97fa){if(_0x4c97fa[_0x15c1('0x36')]===_0x15c1('0x37')){var _0x2df6af=encryptor[_0x15c1('0x38')](_0x4c97fa[_0x15c1('0x39')]);_0x4c97fa[_0x15c1('0x39')]=maskClientSecret(_0x2df6af);}return _0x4c97fa;});return _0x2ffe21;})[_0x15c1('0x14')](respondWithFilteredResult(_0xe624dc,_0x264b23))['catch'](handleError(_0xe624dc,null));};exports[_0x15c1('0x3a')]=function(_0x396cc0,_0x2e9bae){var _0x283a4c={'raw':!![],'where':{'id':_0x396cc0['params']['id']}},_0x1284ab={};_0x1284ab[_0x15c1('0x22')]=_[_0x15c1('0x24')](db[_0x15c1('0x1d')][_0x15c1('0x1e')]);_0x1284ab['query']=_[_0x15c1('0x24')](_0x396cc0[_0x15c1('0x23')]);_0x1284ab[_0x15c1('0x25')]=_[_0x15c1('0x26')](_0x1284ab[_0x15c1('0x22')],_0x1284ab[_0x15c1('0x23')]);_0x283a4c[_0x15c1('0x27')]=_[_0x15c1('0x26')](_0x1284ab[_0x15c1('0x22')],qs[_0x15c1('0x28')](_0x396cc0[_0x15c1('0x23')][_0x15c1('0x28')]));_0x283a4c['attributes']=_0x283a4c[_0x15c1('0x27')][_0x15c1('0x29')]?_0x283a4c['attributes']:_0x1284ab[_0x15c1('0x22')];if(_0x396cc0[_0x15c1('0x23')]['includeAll']){_0x283a4c[_0x15c1('0x33')]=[{'all':!![]}];}_0x283a4c=_[_0x15c1('0x31')]({},_0x283a4c,_0x396cc0[_0x15c1('0x3b')]);return db[_0x15c1('0x1d')][_0x15c1('0x3c')](_0x283a4c)['then'](handleEntityNotFound(_0x2e9bae,null))[_0x15c1('0x14')](function(_0x2aedff){if(_0x2aedff[_0x15c1('0x36')]==='MicrosoftAzure'){var _0x4528dc=encryptor[_0x15c1('0x38')](_0x2aedff[_0x15c1('0x39')]);_0x2aedff[_0x15c1('0x39')]=maskClientSecret(_0x4528dc);}return _0x2aedff;})[_0x15c1('0x14')](respondWithResult(_0x2e9bae,null))[_0x15c1('0x3d')](handleError(_0x2e9bae,null));};exports['create']=function(_0xe242ae,_0x30622c){if(!_0xe242ae[_0x15c1('0x3e')][_0x15c1('0x18')])throw new Error(_0x15c1('0x3f'));if(!_0xe242ae['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1ef9e2=db['CloudProvider'][_0x15c1('0x1e')][_0x15c1('0x36')][_0x15c1('0x40')];if(!_0x1ef9e2[_0x15c1('0x41')](_0xe242ae[_0x15c1('0x3e')][_0x15c1('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x1ef9e2[_0x15c1('0x42')](',\x20'));if(_0xe242ae[_0x15c1('0x3e')][_0x15c1('0x36')]==='MicrosoftAzure'&&_0xe242ae['body']['data3']){_0xe242ae['body']['data3']=encryptor['encryptString'](_0xe242ae[_0x15c1('0x3e')]['data3']);}return db[_0x15c1('0x1d')][_0x15c1('0x43')](_0xe242ae[_0x15c1('0x3e')],{})[_0x15c1('0x14')](respondWithResult(_0x30622c,0xc9))[_0x15c1('0x3d')](handleError(_0x30622c,null));};exports[_0x15c1('0x13')]=function(_0x4b213c,_0x1df114){if(_0x4b213c[_0x15c1('0x3e')]['id']){delete _0x4b213c[_0x15c1('0x3e')]['id'];}return db[_0x15c1('0x1d')][_0x15c1('0x3c')]({'where':{'id':_0x4b213c[_0x15c1('0x44')]['id']}})[_0x15c1('0x14')](handleEntityNotFound(_0x1df114,null))[_0x15c1('0x14')](function(_0x3e1862){if(_0x3e1862[_0x15c1('0x36')]===_0x15c1('0x37')&&_0x4b213c[_0x15c1('0x3e')]['data3']){_0x4b213c[_0x15c1('0x3e')][_0x15c1('0x39')]=encryptor[_0x15c1('0x45')](_0x4b213c['body']['data3']);}return _0x3e1862;})['then'](saveUpdates(_0x4b213c[_0x15c1('0x3e')],null))[_0x15c1('0x14')](respondWithResult(_0x1df114,null))[_0x15c1('0x3d')](handleError(_0x1df114,null));};exports[_0x15c1('0x15')]=function(_0x4e1252,_0x4e55d3){return db[_0x15c1('0x1d')][_0x15c1('0x3c')]({'where':{'id':_0x4e1252[_0x15c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e55d3,null))[_0x15c1('0x14')](removeEntity(_0x4e55d3,null))[_0x15c1('0x3d')](handleError(_0x4e55d3,null));};exports[_0x15c1('0x46')]=function(_0x41d906,_0x11d055){return db[_0x15c1('0x1d')]['findOne']({'where':{'id':_0x41d906[_0x15c1('0x44')]['id']},'raw':!![]})[_0x15c1('0x14')](function(_0x5d471c){if(!_0x5d471c)return _0x11d055[_0x15c1('0xa')](0x194);return{'url':oauth[_0x15c1('0x47')](_0x5d471c,_0x41d906[_0x15c1('0x48')]['id'])};})[_0x15c1('0x14')](respondWithResult(_0x11d055,null))['catch'](handleError(_0x11d055,null));};exports[_0x15c1('0x49')]=function(_0x5e259e,_0xc7cf3a){var _0xa200f3=_0x5e259e[_0x15c1('0x3e')];var _0x219f69;var _0x5e5abb;if(_0xa200f3[_0x15c1('0x16')])throw _0xa200f3;redis['get'](_0xa200f3['state'])[_0x15c1('0x14')](function(_0x177179){if(!_0x177179)throw new Error(_0x15c1('0x4a'));_0x219f69=JSON[_0x15c1('0x4b')](_0x177179);var _0x5bfcdd=Buffer[_0x15c1('0x4c')](_0xa200f3[_0x15c1('0x4d')],_0x15c1('0x4e'))[_0x15c1('0x4f')](_0x15c1('0x50'));_0x5e5abb=JSON[_0x15c1('0x4b')](_0x5bfcdd);if(!oauth['isValidIdToken'](_0xa200f3[_0x15c1('0x51')],_0x219f69[_0x15c1('0x52')]))throw new Error(_0x15c1('0x53'));redis[_0x15c1('0x54')](_0xa200f3[_0x15c1('0x4d')]);return oauth[_0x15c1('0x55')](_0xa200f3[_0x15c1('0x56')],_0x219f69);})[_0x15c1('0x14')](function(_0x59824c){_0x219f69['data5']=_0x59824c[_0x15c1('0x57')];_0x219f69[_0x15c1('0x58')]=_0x59824c[_0x15c1('0x59')];return db['CloudProvider']['update']({'data5':_0x219f69[_0x15c1('0x5a')],'data6':_0x219f69[_0x15c1('0x58')]},{'where':{'id':_0x219f69['id']}});})[_0x15c1('0x14')](function(){oauth[_0x15c1('0x5b')](_0x219f69);socket[_0x15c1('0x5c')](_0x15c1('0x5d'),{'id':_0x5e5abb['id']});return;})[_0x15c1('0x14')](respondWithStatusCode(_0xc7cf3a,null))[_0x15c1('0x3d')](function(_0x31cef4){if(_0x5e5abb){socket['emit']('microsoftAuthorization:error',{'id':_0x5e5abb['id']});}if(!_0x219f69){logger[_0x15c1('0x16')](_0x15c1('0x5e'),_0x31cef4);return _0xc7cf3a[_0x15c1('0xb')](0x1f4)[_0x15c1('0x19')](_0x31cef4[_0x15c1('0x5f')]);}logger[_0x15c1('0x16')](_0x15c1('0x60'),_0x219f69['id'],_0x31cef4);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 2ef05f1..ed95e8a 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 _0xbdfb=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cloudProvider.attributes'];(function(_0x551aa6,_0x35abf8){var _0x555c10=function(_0x393d9a){while(--_0x393d9a){_0x551aa6['push'](_0x551aa6['shift']());}};_0x555c10(++_0x35abf8);}(_0xbdfb,0x108));var _0xbbdf=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0xbdfb[_0x3af6d3];return _0xf0c5a8;};'use strict';var _=require(_0xbbdf('0x0'));var util=require(_0xbbdf('0x1'));var logger=require(_0xbbdf('0x2'))(_0xbbdf('0x3'));var moment=require(_0xbbdf('0x4'));var BPromise=require(_0xbbdf('0x5'));var rp=require(_0xbbdf('0x6'));var fs=require('fs');var path=require(_0xbbdf('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbbdf('0x8'));module[_0xbbdf('0x9')]=function(_0xcae17e,_0x2d4a5e){return _0xcae17e[_0xbbdf('0xa')](_0xbbdf('0xb'),attributes,{'tableName':_0xbbdf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30c4=['path','rimraf','exports','define','CloudProvider','cloud_providers','lodash','bluebird','request-promise'];(function(_0x1de7fb,_0x4391fb){var _0x34c18e=function(_0x93aa2f){while(--_0x93aa2f){_0x1de7fb['push'](_0x1de7fb['shift']());}};_0x34c18e(++_0x4391fb);}(_0x30c4,0x11d));var _0x430c=function(_0x1358b9,_0x1b9608){_0x1358b9=_0x1358b9-0x0;var _0xc72b8e=_0x30c4[_0x1358b9];return _0xc72b8e;};'use strict';var _=require(_0x430c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x430c('0x1'));var rp=require(_0x430c('0x2'));var fs=require('fs');var path=require(_0x430c('0x3'));var rimraf=require(_0x430c('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x430c('0x5')]=function(_0x52562,_0xac0c11){return _0x52562[_0x430c('0x6')](_0x430c('0x7'),attributes,{'tableName':_0x430c('0x8'),'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 15cb1a9..c712f83 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 _0xc4aa=['defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','redirect_uri','response_mode','form_post','scope','state','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','nonce','isAfter','resolve','then','data3','findOne','refresh_token','data6','data4','decryptString','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','bind','all','inspect','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis'];(function(_0x1f504c,_0x319b4f){var _0x50d2e6=function(_0x47f98d){while(--_0x47f98d){_0x1f504c['push'](_0x1f504c['shift']());}};_0x50d2e6(++_0x319b4f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var crypto=require(_0xac4a('0x1'));var jwt=require(_0xac4a('0x2'));var moment=require(_0xac4a('0x3'));var Redis=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xac4a('0x6'))(_0xac4a('0x7'));var schedule=require(_0xac4a('0x8'));var db=require(_0xac4a('0x9'))['db'];config[_0xac4a('0xa')]=_[_0xac4a('0xb')](config[_0xac4a('0xa')],{'host':_0xac4a('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xac4a('0xd'),_0xac4a('0xe'),_0xac4a('0xf'),'offline_access',_0xac4a('0x10'),_0xac4a('0x11'),_0xac4a('0x12')],'Dynamics365':['openid',_0xac4a('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xac4a('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4855b6){var _0x333ca5=_[_0xac4a('0x15')](AZURE_AUTH_SCOPES[_0x4855b6[_0xac4a('0x16')]]);if(_0x4855b6['type']===_0xac4a('0x17'))_0x333ca5[_0xac4a('0x18')](_0x4855b6[_0xac4a('0x19')]+_0xac4a('0x1a'));return _0x333ca5[_0xac4a('0x1b')]('\x20');}function getAccessTokenScope(_0x3b71c0){if(_0x3b71c0[_0xac4a('0x16')]===_0xac4a('0x1c'))return _0xac4a('0x10');if(_0x3b71c0[_0xac4a('0x16')]===_0xac4a('0x17'))return _0x3b71c0[_0xac4a('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x402fff,_0x34d797){var _0x23eb66=MICROSOFT_AUTH_URL[_0xac4a('0x1d')](_0xac4a('0x1e'),_0x402fff[_0xac4a('0x1f')]);var _0x28e304=[_0xac4a('0x20'),'id_token'];var _0x5ac21e=Buffer[_0xac4a('0x21')](JSON[_0xac4a('0x22')]({'id':_0x34d797}))[_0xac4a('0x23')]('base64');var _0x39e83e=crypto[_0xac4a('0x24')](0x10)[_0xac4a('0x23')](_0xac4a('0x25'));var _0x123694=getAuthorizationScopes(_0x402fff);var _0x3e829c=[{'key':_0xac4a('0x26'),'value':_0x402fff[_0xac4a('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x28e304[_0xac4a('0x1b')]('\x20'))},{'key':_0xac4a('0x28'),'value':_0x402fff['data4']},{'key':_0xac4a('0x29'),'value':_0xac4a('0x2a')},{'key':_0xac4a('0x2b'),'value':encodeURIComponent(_0x123694)},{'key':_0xac4a('0x2c'),'value':_0x5ac21e},{'key':'nonce','value':_0x39e83e},{'key':_0xac4a('0x2d'),'value':_0xac4a('0x2e')}];var _0x15435c=_0x23eb66+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xac4a('0x15')](_0x3e829c,function(_0x594f36){return _0x594f36[_0xac4a('0x2f')]+'='+_0x594f36[_0xac4a('0x30')];})[_0xac4a('0x1b')]('&');_0x402fff[_0xac4a('0x31')]={'issuer':_0x23eb66[_0xac4a('0x1d')](_0xac4a('0x32'),''),'audience':_0x402fff[_0xac4a('0x27')],'state':_0x5ac21e,'nonce':_0x39e83e};redis[_0xac4a('0x33')](_0x5ac21e,JSON[_0xac4a('0x22')](_0x402fff));return _0x15435c;}function isValidIdToken(_0x1c13dc,_0x20202c){try{var _0x4e17ce=jwt[_0xac4a('0x34')](_0x1c13dc,{'complete':!![]});var _0x267a22=_0x4e17ce[_0xac4a('0x35')];if(_0x267a22[_0xac4a('0x36')]!==_0x20202c[_0xac4a('0x37')])return![];if(_0x267a22['aud']!==_0x20202c['audience'])return![];if(_0x267a22[_0xac4a('0x38')]!==_0x20202c[_0xac4a('0x38')])return![];if(moment()[_0xac4a('0x39')](moment['unix'](_0x267a22['exp'])))return![];return!![];}catch(_0x355755){throw _0x355755;}}function refreshOauth2MicrosoftAccessToken(_0x2896bc){return Promise[_0xac4a('0x3a')]()[_0xac4a('0x3b')](function(){if(_0x2896bc[_0xac4a('0x3c')])return _0x2896bc;return db['CloudProvider'][_0xac4a('0x3d')]({'where':{'id':_0x2896bc['id']},'raw':!![]});})['then'](function(_0x30364b){var _0x57adcf={'grant_type':_0xac4a('0x3e'),'refresh_token':_0x30364b[_0xac4a('0x3f')],'scope':getAccessTokenScope(_0x30364b),'redirect_uri':_0x30364b[_0xac4a('0x40')],'client_id':_0x30364b[_0xac4a('0x27')],'client_secret':encryptor[_0xac4a('0x41')](_0x30364b[_0xac4a('0x3c')])};var _0xbd4591={'method':_0xac4a('0x42'),'uri':MICROSOFT_AUTH_URL[_0xac4a('0x1d')](_0xac4a('0x1e'),_0x30364b[_0xac4a('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57adcf,'json':!![]};return rp(_0xbd4591);})[_0xac4a('0x3b')](function(_0x1a9be2){_0x2896bc[_0xac4a('0x43')]=_0x1a9be2['access_token'];_0x2896bc[_0xac4a('0x3f')]=_0x1a9be2[_0xac4a('0x3e')];return db['CloudProvider'][_0xac4a('0x44')]({'data5':_0x2896bc[_0xac4a('0x43')],'data6':_0x2896bc['data6']},{'where':{'id':_0x2896bc['id']}});})['then'](function(){return _0x2896bc;})[_0xac4a('0x45')](function(_0x1ba096){logger[_0xac4a('0x46')](_0xac4a('0x47'),_0x2896bc['id'],_0x1ba096);});}function getOauth2MicrosoftAccessToken(_0x4f5986,_0x453d02){var _0x2e56c6={'grant_type':'authorization_code','code':_0x4f5986,'scope':getAccessTokenScope(_0x453d02),'redirect_uri':_0x453d02[_0xac4a('0x40')],'client_id':_0x453d02[_0xac4a('0x27')],'client_secret':encryptor[_0xac4a('0x41')](_0x453d02['data3'])};var _0x121328={'method':_0xac4a('0x42'),'uri':MICROSOFT_AUTH_URL[_0xac4a('0x1d')]('{TENANT_ID}',_0x453d02[_0xac4a('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e56c6,'json':!![]};return rp(_0x121328);}function startRefreshInterval(_0x2e76e3){var _0x4b9faf=schedule['intervals'];if(_0x4b9faf[_0x2e76e3['id']])clearInterval(_0x4b9faf[_0x2e76e3['id']]);_0x4b9faf[_0x2e76e3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xac4a('0x48')](this,{'id':_0x2e76e3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4b9faf;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x41b757){var _0x2bf8e8=_0x41b757[_0xac4a('0x15')](function(_0x472484){return refreshOauth2MicrosoftAccessToken(_0x472484)[_0xac4a('0x3b')](function(_0x415f31){startRefreshInterval(_0x415f31);});});return Promise[_0xac4a('0x49')](_0x2bf8e8);})[_0xac4a('0x45')](function(_0x28292c){var _0x1f7721=_0x28292c?util[_0xac4a('0x4a')](_0x28292c,{'showHidden':![],'depth':null}):'';logger[_0xac4a('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart',_0x1f7721);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7a54=['data3','CloudProvider','findOne','refresh_token','decryptString','replace','access_token','data6','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','POST','data2','bind','intervals','findAll','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','join','Outlook365','Dynamics365','{TENANT_ID}','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','exp','then'];(function(_0xd6b74a,_0x5e0561){var _0x1695d6=function(_0x3afc3f){while(--_0x3afc3f){_0xd6b74a['push'](_0xd6b74a['shift']());}};_0x1695d6(++_0x5e0561);}(_0x7a54,0x106));var _0x47a5=function(_0x233c18,_0x2cd857){_0x233c18=_0x233c18-0x0;var _0x5a5845=_0x7a54[_0x233c18];return _0x5a5845;};'use strict';var _=require(_0x47a5('0x0'));var crypto=require(_0x47a5('0x1'));var jwt=require(_0x47a5('0x2'));var moment=require('moment');var Redis=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var util=require('util');var encryptor=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var logger=require(_0x47a5('0x7'))(_0x47a5('0x8'));var schedule=require(_0x47a5('0x9'));var db=require('../../mysqldb')['db'];config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x47a5('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile','email',_0x47a5('0xd'),_0x47a5('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x47a5('0xf')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x47a5('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x47a5('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2f399b){var _0x250fad=_[_0x47a5('0x12')](AZURE_AUTH_SCOPES[_0x2f399b[_0x47a5('0x13')]]);if(_0x2f399b[_0x47a5('0x13')]==='Dynamics365')_0x250fad[_0x47a5('0x14')](_0x2f399b[_0x47a5('0x15')]+_0x47a5('0x16'));return _0x250fad[_0x47a5('0x17')]('\x20');}function getAccessTokenScope(_0x139f25){if(_0x139f25[_0x47a5('0x13')]===_0x47a5('0x18'))return _0x47a5('0xe');if(_0x139f25['type']===_0x47a5('0x19'))return _0x139f25[_0x47a5('0x15')]+_0x47a5('0x16');}function generateMicrosoftAuthorizationUrl(_0x2a2cbb,_0x1ef44c){var _0x574af6=MICROSOFT_AUTH_URL['replace'](_0x47a5('0x1a'),_0x2a2cbb['data2']);var _0x5247fd=[_0x47a5('0x1b'),_0x47a5('0x1c')];var _0x2ce454=Buffer[_0x47a5('0x1d')](JSON[_0x47a5('0x1e')]({'id':_0x1ef44c}))[_0x47a5('0x1f')](_0x47a5('0x20'));var _0xe3c618=crypto[_0x47a5('0x21')](0x10)['toString'](_0x47a5('0x22'));var _0xf160ba=getAuthorizationScopes(_0x2a2cbb);var _0x47cf3c=[{'key':_0x47a5('0x23'),'value':_0x2a2cbb[_0x47a5('0x24')]},{'key':_0x47a5('0x25'),'value':encodeURIComponent(_0x5247fd['join']('\x20'))},{'key':_0x47a5('0x26'),'value':_0x2a2cbb[_0x47a5('0x27')]},{'key':_0x47a5('0x28'),'value':_0x47a5('0x29')},{'key':'scope','value':encodeURIComponent(_0xf160ba)},{'key':_0x47a5('0x2a'),'value':_0x2ce454},{'key':_0x47a5('0x2b'),'value':_0xe3c618},{'key':'prompt','value':_0x47a5('0x2c')}];var _0xc4cd63=_0x574af6+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x47a5('0x12')](_0x47cf3c,function(_0x129ce5){return _0x129ce5[_0x47a5('0x2d')]+'='+_0x129ce5['value'];})['join']('&');_0x2a2cbb[_0x47a5('0x2e')]={'issuer':_0x574af6['replace'](_0x47a5('0x2f'),''),'audience':_0x2a2cbb['data1'],'state':_0x2ce454,'nonce':_0xe3c618};redis[_0x47a5('0x30')](_0x2ce454,JSON[_0x47a5('0x1e')](_0x2a2cbb));return _0xc4cd63;}function isValidIdToken(_0x36ad34,_0x1dac65){try{var _0x21f296=jwt[_0x47a5('0x31')](_0x36ad34,{'complete':!![]});var _0x24b162=_0x21f296[_0x47a5('0x32')];if(_0x24b162[_0x47a5('0x33')]!==_0x1dac65[_0x47a5('0x34')])return![];if(_0x24b162[_0x47a5('0x35')]!==_0x1dac65[_0x47a5('0x36')])return![];if(_0x24b162[_0x47a5('0x2b')]!==_0x1dac65['nonce'])return![];if(moment()[_0x47a5('0x37')](moment['unix'](_0x24b162[_0x47a5('0x38')])))return![];return!![];}catch(_0x9ac908){throw _0x9ac908;}}function refreshOauth2MicrosoftAccessToken(_0x16901f){return Promise['resolve']()[_0x47a5('0x39')](function(){if(_0x16901f[_0x47a5('0x3a')])return _0x16901f;return db[_0x47a5('0x3b')][_0x47a5('0x3c')]({'where':{'id':_0x16901f['id']},'raw':!![]});})['then'](function(_0x50d875){var _0x6f9a12={'grant_type':_0x47a5('0x3d'),'refresh_token':_0x50d875['data6'],'scope':getAccessTokenScope(_0x50d875),'redirect_uri':_0x50d875['data4'],'client_id':_0x50d875[_0x47a5('0x24')],'client_secret':encryptor[_0x47a5('0x3e')](_0x50d875['data3'])};var _0x42f70c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x47a5('0x3f')](_0x47a5('0x1a'),_0x50d875['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x6f9a12,'json':!![]};return rp(_0x42f70c);})['then'](function(_0x274e34){_0x16901f['data5']=_0x274e34[_0x47a5('0x40')];_0x16901f[_0x47a5('0x41')]=_0x274e34[_0x47a5('0x3d')];return db['CloudProvider'][_0x47a5('0x42')]({'data5':_0x16901f['data5'],'data6':_0x16901f['data6']},{'where':{'id':_0x16901f['id']}});})[_0x47a5('0x39')](function(){return _0x16901f;})['catch'](function(_0x25cce0){logger['error'](_0x47a5('0x43'),_0x16901f['id'],_0x25cce0);});}function getOauth2MicrosoftAccessToken(_0x3534cb,_0x38c8d4){var _0x199698={'grant_type':_0x47a5('0x44'),'code':_0x3534cb,'scope':getAccessTokenScope(_0x38c8d4),'redirect_uri':_0x38c8d4[_0x47a5('0x27')],'client_id':_0x38c8d4[_0x47a5('0x24')],'client_secret':encryptor[_0x47a5('0x3e')](_0x38c8d4[_0x47a5('0x3a')])};var _0x4caed5={'method':_0x47a5('0x45'),'uri':MICROSOFT_AUTH_URL[_0x47a5('0x3f')]('{TENANT_ID}',_0x38c8d4[_0x47a5('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x199698,'json':!![]};return rp(_0x4caed5);}function startRefreshInterval(_0x2bf53d){var _0x1d4348=schedule['intervals'];if(_0x1d4348[_0x2bf53d['id']])clearInterval(_0x1d4348[_0x2bf53d['id']]);_0x1d4348[_0x2bf53d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x47a5('0x47')](this,{'id':_0x2bf53d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x47a5('0x48')]=_0x1d4348;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x47a5('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x47a5('0x39')](function(_0x54ae35){var _0x55c5eb=_0x54ae35['map'](function(_0x12d9f2){return refreshOauth2MicrosoftAccessToken(_0x12d9f2)['then'](function(_0x9b5eaf){startRefreshInterval(_0x9b5eaf);});});return Promise[_0x47a5('0x4a')](_0x55c5eb);})[_0x47a5('0x4b')](function(_0x111f0d){var _0x1b2c80=_0x111f0d?util[_0x47a5('0x4c')](_0x111f0d,{'showHidden':![],'depth':null}):'';logger[_0x47a5('0x4d')](_0x47a5('0x4e'),_0x1b2c80);});}module[_0x47a5('0x4f')]={'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 b586dc0..3fa14a1 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3a351a,_0x1e949b){var _0x46f124=function(_0x2e9133){while(--_0x2e9133){_0x3a351a['push'](_0x3a351a['shift']());}};_0x46f124(++_0x1e949b);}(_0xb10b,0x12a));var _0xbb10=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb10b[_0x45d55e];return _0x29812a;};'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);});});} \ No newline at end of file +var _0xabad=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xabad,0x150));var _0xdaba=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0xabad[_0x498b38];return _0x10feb7;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var moment=require(_0xdaba('0x1'));var BPromise=require(_0xdaba('0x2'));var rs=require(_0xdaba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x4'))['db'];var utils=require(_0xdaba('0x5'));var logger=require('../../config/logger')(_0xdaba('0x6'));var config=require(_0xdaba('0x7'));var jayson=require(_0xdaba('0x8'));var client=jayson[_0xdaba('0x9')][_0xdaba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ae0f,_0x4045f5,_0x352a74){return new BPromise(function(_0x5214dc,_0x2344d1){return client[_0xdaba('0xb')](_0x23ae0f,_0x352a74)[_0xdaba('0xc')](function(_0x1e22ba){logger['info'](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x4045f5,_0xdaba('0xe'),JSON[_0xdaba('0x11')](_0x1e22ba));if(_0x1e22ba[_0xdaba('0x12')]){if(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x13')]===0x1f4){logger['error'](_0xdaba('0xd'),_0x4045f5,_0x1e22ba['error'][_0xdaba('0x14')]);return _0x2344d1(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);}logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);return _0x5214dc(_0x1e22ba['error'][_0xdaba('0x14')]);}else{logger[_0xdaba('0x15')](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));_0x5214dc(_0x1e22ba[_0xdaba('0x16')][_0xdaba('0x14')]);}})[_0xdaba('0x17')](function(_0x5c4ec1){logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x5c4ec1);_0x2344d1(_0x5c4ec1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 34e1e33..1740505 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2691ba,_0x478d7d){_0x2691ba=_0x2691ba-0x0;var _0x5e18a4=_0x5f2f[_0x2691ba];return _0x5e18a4;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x2dda09,_0x9ec757){_0x2dda09=_0x2dda09-0x0;var _0x388dd4=_0x7a54[_0x2dda09];return _0x388dd4;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 3847f7d..30f4df6 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 _0x6b24=['STRING','sequelize','exports'];(function(_0x3a8a72,_0x543462){var _0x3ad0a0=function(_0xcce9c){while(--_0xcce9c){_0x3a8a72['push'](_0x3a8a72['shift']());}};_0x3ad0a0(++_0x543462);}(_0x6b24,0x196));var _0x46b2=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x6b24[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require(_0x46b2('0x0'));module[_0x46b2('0x1')]={'name':{'type':Sequelize[_0x46b2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x46b2('0x2')]},'website':{'type':Sequelize[_0x46b2('0x2')]},'phone':{'type':Sequelize[_0x46b2('0x2')]},'fax':{'type':Sequelize[_0x46b2('0x2')]},'type':{'type':Sequelize[_0x46b2('0x2')]},'street':{'type':Sequelize[_0x46b2('0x2')]},'postalCode':{'type':Sequelize[_0x46b2('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x46b2('0x2')]},'sPostalCode':{'type':Sequelize[_0x46b2('0x2')]},'sCity':{'type':Sequelize[_0x46b2('0x2')]},'sCountry':{'type':Sequelize[_0x46b2('0x2')]},'description':{'type':Sequelize[_0x46b2('0x2')]}}; \ No newline at end of file +var _0x7dba=['exports','STRING','name','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dba,0x133));var _0xa7db=function(_0x5ee20e,_0x1c17ab){_0x5ee20e=_0x5ee20e-0x0;var _0x3fea9e=_0x7dba[_0x5ee20e];return _0x3fea9e;};'use strict';var Sequelize=require(_0xa7db('0x0'));module[_0xa7db('0x1')]={'name':{'type':Sequelize[_0xa7db('0x2')],'unique':_0xa7db('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa7db('0x2')]},'companyId':{'type':Sequelize[_0xa7db('0x2')]},'website':{'type':Sequelize[_0xa7db('0x2')]},'phone':{'type':Sequelize[_0xa7db('0x2')]},'fax':{'type':Sequelize[_0xa7db('0x2')]},'type':{'type':Sequelize[_0xa7db('0x2')]},'street':{'type':Sequelize[_0xa7db('0x2')]},'postalCode':{'type':Sequelize[_0xa7db('0x2')]},'city':{'type':Sequelize[_0xa7db('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa7db('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xa7db('0x2')]},'sCity':{'type':Sequelize[_0xa7db('0x2')]},'sCountry':{'type':Sequelize[_0xa7db('0x2')]},'description':{'type':Sequelize[_0xa7db('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e8e82af..db92507 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 _0x593c=['../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x221902,_0x3d46c1){var _0x79fde9=function(_0x506c17){while(--_0x506c17){_0x221902['push'](_0x221902['shift']());}};_0x79fde9(++_0x3d46c1);}(_0x593c,0xf6));var _0xc593=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x593c[_0x6a0266];return _0x309e00;};'use strict';var emlformat=require(_0xc593('0x0'));var rimraf=require(_0xc593('0x1'));var zipdir=require(_0xc593('0x2'));var jsonpatch=require(_0xc593('0x3'));var rp=require('request-promise');var moment=require(_0xc593('0x4'));var BPromise=require(_0xc593('0x5'));var Mustache=require(_0xc593('0x6'));var util=require(_0xc593('0x7'));var path=require(_0xc593('0x8'));var sox=require(_0xc593('0x9'));var csv=require('to-csv');var ejs=require(_0xc593('0xa'));var fs=require('fs');var fs_extra=require(_0xc593('0xb'));var _=require(_0xc593('0xc'));var squel=require(_0xc593('0xd'));var crypto=require(_0xc593('0xe'));var jsforce=require(_0xc593('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc593('0x10'));var querystring=require('querystring');var Papa=require(_0xc593('0x11'));var Redis=require(_0xc593('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc593('0x13'));var as=require(_0xc593('0x14'));var hardwareService=require(_0xc593('0x15'));var logger=require(_0xc593('0x16'))(_0xc593('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc593('0x18'));var db=require(_0xc593('0x19'))['db'];function respondWithStatusCode(_0xc09b59,_0x5c8d79){_0x5c8d79=_0x5c8d79||0xcc;return function(_0x348cb2){if(_0x348cb2){return _0xc09b59['sendStatus'](_0x5c8d79);}return _0xc09b59[_0xc593('0x1a')](_0x5c8d79)[_0xc593('0x1b')]();};}function respondWithResult(_0x4e89e2,_0x4144e0){_0x4144e0=_0x4144e0||0xc8;return function(_0x2a5dfc){if(_0x2a5dfc){return _0x4e89e2[_0xc593('0x1a')](_0x4144e0)[_0xc593('0x1c')](_0x2a5dfc);}};}function respondWithFilteredResult(_0x24ab73,_0x181fa8){return function(_0x25f1b9){if(_0x25f1b9){var _0x22c485=typeof _0x181fa8[_0xc593('0x1d')]==='undefined'&&typeof _0x181fa8[_0xc593('0x1e')]==='undefined';var _0x20af78=_0x25f1b9[_0xc593('0x1f')];var _0x56b950=_0x22c485?0x0:_0x181fa8[_0xc593('0x1d')];var _0x141d97=_0x22c485?_0x25f1b9[_0xc593('0x1f')]:_0x181fa8[_0xc593('0x1d')]+_0x181fa8[_0xc593('0x1e')];var _0x463b93;if(_0x141d97>=_0x20af78){_0x141d97=_0x20af78;_0x463b93=0xc8;}else{_0x463b93=0xce;}_0x24ab73[_0xc593('0x1a')](_0x463b93);return _0x24ab73[_0xc593('0x20')]('Content-Range',_0x56b950+'-'+_0x141d97+'/'+_0x20af78)[_0xc593('0x1c')](_0x25f1b9);}return null;};}function patchUpdates(_0x549b3f){return function(_0x6b4616){try{jsonpatch[_0xc593('0x21')](_0x6b4616,_0x549b3f,!![]);}catch(_0x2a55bf){return BPromise[_0xc593('0x22')](_0x2a55bf);}return _0x6b4616[_0xc593('0x23')]();};}function saveUpdates(_0x287e6e,_0x2ac3c3){return function(_0x5551f1){if(_0x5551f1){return _0x5551f1[_0xc593('0x24')](_0x287e6e)[_0xc593('0x25')](function(_0x257c86){return _0x257c86;});}return null;};}function removeEntity(_0x3b2daf,_0x251187){return function(_0x3bb71f){if(_0x3bb71f){return _0x3bb71f[_0xc593('0x26')]()[_0xc593('0x25')](function(){var _0x3e7f8a=_0x3bb71f[_0xc593('0x27')]({'plain':!![]});var _0x238c08=_0xc593('0x28');return db[_0xc593('0x29')][_0xc593('0x26')]({'where':{'type':_0x238c08,'resourceId':_0x3e7f8a['id']}})[_0xc593('0x25')](function(){return _0x3bb71f;});})['then'](function(){_0x3b2daf[_0xc593('0x1a')](0xcc)[_0xc593('0x1b')]();});}};}function handleEntityNotFound(_0x472916,_0x71f2cb){return function(_0x4627d7){if(!_0x4627d7){_0x472916[_0xc593('0x2a')](0x194);}return _0x4627d7;};}function handleError(_0x1120ed,_0x261955){_0x261955=_0x261955||0x1f4;return function(_0x4f966d){logger[_0xc593('0x2b')](_0x4f966d[_0xc593('0x2c')]);if(_0x4f966d[_0xc593('0x2d')]){delete _0x4f966d[_0xc593('0x2d')];}_0x1120ed[_0xc593('0x1a')](_0x261955)[_0xc593('0x2e')](_0x4f966d);};}exports[_0xc593('0x2f')]=function(_0x464aff,_0xe74f29){var _0x609ab8={},_0x4baa46={},_0x5e7744={'count':0x0,'rows':[]};return db[_0xc593('0x30')][_0xc593('0x31')]()['then'](function(_0x5718a6){_0x4baa46['model']=_[_0xc593('0x32')](_0x5718a6);_0x4baa46['query']=_[_0xc593('0x32')](_0x464aff[_0xc593('0x33')]);_0x4baa46[_0xc593('0x34')]=_[_0xc593('0x35')](_0x4baa46['model'],_0x4baa46[_0xc593('0x33')]);_0x609ab8[_0xc593('0x36')]=_[_0xc593('0x35')](_0x4baa46[_0xc593('0x37')],qs['fields'](_0x464aff['query'][_0xc593('0x38')]));_0x609ab8[_0xc593('0x36')]=_0x609ab8[_0xc593('0x36')]['length']?_0x609ab8[_0xc593('0x36')]:_0x4baa46[_0xc593('0x37')];if(!_0x464aff[_0xc593('0x33')][_0xc593('0x39')](_0xc593('0x3a'))){_0x609ab8[_0xc593('0x1e')]=qs['limit'](_0x464aff[_0xc593('0x33')][_0xc593('0x1e')]);_0x609ab8[_0xc593('0x1d')]=qs[_0xc593('0x1d')](_0x464aff[_0xc593('0x33')][_0xc593('0x1d')]);}_0x609ab8[_0xc593('0x3b')]=qs[_0xc593('0x3c')](_0x464aff[_0xc593('0x33')][_0xc593('0x3c')]);_0x609ab8[_0xc593('0x3d')]=qs[_0xc593('0x34')](_[_0xc593('0x3e')](_0x464aff[_0xc593('0x33')],_0x4baa46['filters']),_0x5718a6);if(_0x464aff['query']['filter']){_0x609ab8[_0xc593('0x3d')]=_[_0xc593('0x3f')](_0x609ab8[_0xc593('0x3d')],{'$or':_['map'](_0x609ab8[_0xc593('0x36')],function(_0x356a35){var _0x3a959d={};_0x3a959d[_0x356a35]={'$like':'%'+_0x464aff['query'][_0xc593('0x40')]+'%'};return _0x3a959d;})});}_0x609ab8=_[_0xc593('0x3f')]({},_0x609ab8,_0x464aff['options']);var _0x82e9c5={'where':_0x609ab8['where']};return db[_0xc593('0x30')]['count'](_0x82e9c5)['then'](function(_0x366061){_0x5e7744[_0xc593('0x1f')]=_0x366061;if(_0x464aff[_0xc593('0x33')][_0xc593('0x41')]){_0x609ab8[_0xc593('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xc593('0x43')](_0x609ab8);})[_0xc593('0x25')](function(_0x3230e6){_0x5e7744[_0xc593('0x44')]=_0x3230e6;return _0x5e7744;})['then'](respondWithFilteredResult(_0xe74f29,_0x609ab8))[_0xc593('0x45')](handleError(_0xe74f29,null));})['catch'](handleError(_0xe74f29,null));};exports[_0xc593('0x46')]=function(_0x2472a2,_0x5c89b2){var _0x1223f2={'raw':![],'where':{'id':_0x2472a2[_0xc593('0x47')]['id']}},_0x4092fa={};_0x4092fa[_0xc593('0x37')]=_[_0xc593('0x32')](db[_0xc593('0x30')][_0xc593('0x48')]);_0x4092fa[_0xc593('0x33')]=_[_0xc593('0x32')](_0x2472a2[_0xc593('0x33')]);_0x4092fa[_0xc593('0x34')]=_[_0xc593('0x35')](_0x4092fa[_0xc593('0x37')],_0x4092fa[_0xc593('0x33')]);_0x1223f2['attributes']=_[_0xc593('0x35')](_0x4092fa[_0xc593('0x37')],qs[_0xc593('0x38')](_0x2472a2[_0xc593('0x33')]['fields']));_0x1223f2[_0xc593('0x36')]=_0x1223f2[_0xc593('0x36')][_0xc593('0x49')]?_0x1223f2['attributes']:_0x4092fa[_0xc593('0x37')];if(_0x2472a2['query']['includeAll']){_0x1223f2[_0xc593('0x42')]=[{'all':!![]}];}_0x1223f2=_['merge']({},_0x1223f2,_0x2472a2[_0xc593('0x4a')]);return db[_0xc593('0x30')][_0xc593('0x4b')](_0x1223f2)[_0xc593('0x25')](handleEntityNotFound(_0x5c89b2,null))[_0xc593('0x25')](respondWithResult(_0x5c89b2,null))[_0xc593('0x45')](handleError(_0x5c89b2,null));};exports[_0xc593('0x4c')]=function(_0x35dafb,_0x336879){return db['CmCompany'][_0xc593('0x4c')](_0x35dafb[_0xc593('0x4d')],{})[_0xc593('0x25')](function(_0x359ead){var _0x12dd23=_0x35dafb[_0xc593('0x4e')][_0xc593('0x27')]({'plain':!![]});if(!_0x12dd23)throw new Error(_0xc593('0x4f'));if(_0x12dd23[_0xc593('0x50')]==='user'){var _0x271f9f=_0x359ead[_0xc593('0x27')]({'plain':!![]});var _0x4a820e=_0xc593('0x28');return db['UserProfileSection'][_0xc593('0x4b')]({'where':{'name':_0x4a820e,'userProfileId':_0x12dd23[_0xc593('0x51')]},'raw':!![]})[_0xc593('0x25')](function(_0x12014c){if(_0x12014c&&_0x12014c[_0xc593('0x52')]===0x0){return db['UserProfileResource'][_0xc593('0x4c')]({'name':_0x271f9f[_0xc593('0x2d')],'resourceId':_0x271f9f['id'],'type':_0x12014c[_0xc593('0x2d')],'sectionId':_0x12014c['id']},{})[_0xc593('0x25')](function(){return _0x359ead;});}else{return _0x359ead;}})[_0xc593('0x45')](function(_0x3c59bd){logger[_0xc593('0x2b')](_0xc593('0x53'),_0x3c59bd);throw _0x3c59bd;});}return _0x359ead;})[_0xc593('0x25')](respondWithResult(_0x336879,0xc9))[_0xc593('0x45')](handleError(_0x336879,null));};exports[_0xc593('0x24')]=function(_0x3fffa2,_0x45ecfc){if(_0x3fffa2['body']['id']){delete _0x3fffa2['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x3fffa2[_0xc593('0x47')]['id']}})['then'](handleEntityNotFound(_0x45ecfc,null))['then'](saveUpdates(_0x3fffa2[_0xc593('0x4d')],null))[_0xc593('0x25')](respondWithResult(_0x45ecfc,null))['catch'](handleError(_0x45ecfc,null));};exports[_0xc593('0x26')]=function(_0x2fd6dc,_0x582f7d){return db[_0xc593('0x30')][_0xc593('0x4b')]({'where':{'id':_0x2fd6dc[_0xc593('0x47')]['id']}})[_0xc593('0x25')](handleEntityNotFound(_0x582f7d,null))[_0xc593('0x25')](removeEntity(_0x582f7d,null))[_0xc593('0x45')](handleError(_0x582f7d,null));};exports[_0xc593('0x31')]=function(_0x17bc0b,_0x50c100){return db[_0xc593('0x30')]['describe']()[_0xc593('0x25')](respondWithResult(_0x50c100,null))[_0xc593('0x45')](handleError(_0x50c100,null));};exports['addContacts']=function(_0x220c28,_0x1358de,_0x1c9a6a){return db['CmContact'][_0xc593('0x4b')]({'where':{'id':_0x220c28['params']['id']}})[_0xc593('0x25')](handleEntityNotFound(_0x1358de,null))[_0xc593('0x25')](function(_0x2659f5){if(_0x2659f5){return _0x2659f5[_0xc593('0x54')](_0x220c28[_0xc593('0x4d')][_0xc593('0x55')],_[_0xc593('0x56')](_0x220c28[_0xc593('0x4d')],['ids','id'])||{});}})[_0xc593('0x25')](respondWithResult(_0x1358de,null))[_0xc593('0x45')](handleError(_0x1358de,null));};exports[_0xc593('0x57')]=function(_0x582fe5,_0xeaed9f,_0x43130f){var _0x30293a={};var _0xe74ee7={};var _0x5aa131;var _0x19f26e;return db[_0xc593('0x30')][_0xc593('0x58')]({'where':{'id':_0x582fe5[_0xc593('0x47')]['id']}})[_0xc593('0x25')](handleEntityNotFound(_0xeaed9f,null))[_0xc593('0x25')](function(_0x27224a){if(_0x27224a){_0x5aa131=_0x27224a;_0xe74ee7[_0xc593('0x37')]=_[_0xc593('0x32')](db[_0xc593('0x59')]['rawAttributes']);_0xe74ee7['query']=_['keys'](_0x582fe5[_0xc593('0x33')]);_0xe74ee7[_0xc593('0x34')]=_[_0xc593('0x35')](_0xe74ee7['model'],_0xe74ee7['query']);_0x30293a['attributes']=_[_0xc593('0x35')](_0xe74ee7['model'],qs[_0xc593('0x38')](_0x582fe5[_0xc593('0x33')][_0xc593('0x38')]));_0x30293a[_0xc593('0x36')]=_0x30293a[_0xc593('0x36')]['length']?_0x30293a[_0xc593('0x36')]:_0xe74ee7[_0xc593('0x37')];_0x30293a[_0xc593('0x3b')]=qs[_0xc593('0x3c')](_0x582fe5[_0xc593('0x33')][_0xc593('0x3c')]);_0x30293a[_0xc593('0x3d')]=qs['filters'](_['pick'](_0x582fe5[_0xc593('0x33')],_0xe74ee7['filters']));if(_0x582fe5['query'][_0xc593('0x40')]){_0x30293a[_0xc593('0x3d')]=_['merge'](_0x30293a[_0xc593('0x3d')],{'$or':_['map'](_0x30293a['attributes'],function(_0x584b45){var _0x43a72c={};_0x43a72c[_0x584b45]={'$like':'%'+_0x582fe5[_0xc593('0x33')]['filter']+'%'};return _0x43a72c;})});}_0x30293a=_[_0xc593('0x3f')]({},_0x30293a,_0x582fe5[_0xc593('0x4a')]);return _0x5aa131[_0xc593('0x57')](_0x30293a);}})[_0xc593('0x25')](function(_0x2bfe61){if(_0x2bfe61){_0x19f26e=_0x2bfe61['length'];if(!_0x582fe5[_0xc593('0x33')][_0xc593('0x39')]('nolimit')){_0x30293a['limit']=qs[_0xc593('0x1e')](_0x582fe5[_0xc593('0x33')][_0xc593('0x1e')]);_0x30293a['offset']=qs[_0xc593('0x1d')](_0x582fe5[_0xc593('0x33')][_0xc593('0x1d')]);}return _0x5aa131[_0xc593('0x57')](_0x30293a);}})[_0xc593('0x25')](function(_0x4340af){if(_0x4340af){return _0x4340af?{'count':_0x19f26e,'rows':_0x4340af}:null;}})[_0xc593('0x25')](respondWithResult(_0xeaed9f,null))[_0xc593('0x45')](handleError(_0xeaed9f,null));}; \ No newline at end of file +var _0x5ae9=['fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','map','eml-format','rimraf','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/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes'];(function(_0x138345,_0x3e18b3){var _0x370d1f=function(_0x56c49f){while(--_0x56c49f){_0x138345['push'](_0x138345['shift']());}};_0x370d1f(++_0x3e18b3);}(_0x5ae9,0x1ec));var _0x95ae=function(_0x48c2e9,_0x2ba941){_0x48c2e9=_0x48c2e9-0x0;var _0x3e6c24=_0x5ae9[_0x48c2e9];return _0x3e6c24;};'use strict';var emlformat=require(_0x95ae('0x0'));var rimraf=require(_0x95ae('0x1'));var zipdir=require(_0x95ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95ae('0x3'));var moment=require(_0x95ae('0x4'));var BPromise=require(_0x95ae('0x5'));var Mustache=require(_0x95ae('0x6'));var util=require(_0x95ae('0x7'));var path=require(_0x95ae('0x8'));var sox=require(_0x95ae('0x9'));var csv=require(_0x95ae('0xa'));var ejs=require(_0x95ae('0xb'));var fs=require('fs');var fs_extra=require(_0x95ae('0xc'));var _=require(_0x95ae('0xd'));var squel=require('squel');var crypto=require(_0x95ae('0xe'));var jsforce=require(_0x95ae('0xf'));var deskjs=require(_0x95ae('0x10'));var toCsv=require(_0x95ae('0xa'));var querystring=require(_0x95ae('0x11'));var Papa=require(_0x95ae('0x12'));var Redis=require(_0x95ae('0x13'));var authService=require(_0x95ae('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x95ae('0x15'));var hardwareService=require(_0x95ae('0x16'));var logger=require('../../config/logger')(_0x95ae('0x17'));var utils=require(_0x95ae('0x18'));var config=require(_0x95ae('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x95ae('0x1a'))['db'];function respondWithStatusCode(_0x1a4275,_0x3d7dcb){_0x3d7dcb=_0x3d7dcb||0xcc;return function(_0x1be759){if(_0x1be759){return _0x1a4275['sendStatus'](_0x3d7dcb);}return _0x1a4275[_0x95ae('0x1b')](_0x3d7dcb)[_0x95ae('0x1c')]();};}function respondWithResult(_0x12c2d0,_0x49900d){_0x49900d=_0x49900d||0xc8;return function(_0x4c3f38){if(_0x4c3f38){return _0x12c2d0[_0x95ae('0x1b')](_0x49900d)[_0x95ae('0x1d')](_0x4c3f38);}};}function respondWithFilteredResult(_0x5c85d6,_0x48f338){return function(_0x2f39d2){if(_0x2f39d2){var _0x398932=typeof _0x48f338[_0x95ae('0x1e')]===_0x95ae('0x1f')&&typeof _0x48f338[_0x95ae('0x20')]===_0x95ae('0x1f');var _0x342be2=_0x2f39d2['count'];var _0x4d277f=_0x398932?0x0:_0x48f338[_0x95ae('0x1e')];var _0xe08559=_0x398932?_0x2f39d2[_0x95ae('0x21')]:_0x48f338[_0x95ae('0x1e')]+_0x48f338[_0x95ae('0x20')];var _0x4c22ef;if(_0xe08559>=_0x342be2){_0xe08559=_0x342be2;_0x4c22ef=0xc8;}else{_0x4c22ef=0xce;}_0x5c85d6[_0x95ae('0x1b')](_0x4c22ef);return _0x5c85d6[_0x95ae('0x22')](_0x95ae('0x23'),_0x4d277f+'-'+_0xe08559+'/'+_0x342be2)[_0x95ae('0x1d')](_0x2f39d2);}return null;};}function patchUpdates(_0x15f82c){return function(_0x4ae52d){try{jsonpatch['apply'](_0x4ae52d,_0x15f82c,!![]);}catch(_0x306d1e){return BPromise['reject'](_0x306d1e);}return _0x4ae52d[_0x95ae('0x24')]();};}function saveUpdates(_0x72d30f,_0x5c9e34){return function(_0x83c7d5){if(_0x83c7d5){return _0x83c7d5['update'](_0x72d30f)[_0x95ae('0x25')](function(_0x443ab4){return _0x443ab4;});}return null;};}function removeEntity(_0x1b4275,_0x60ff54){return function(_0x1230e3){if(_0x1230e3){return _0x1230e3[_0x95ae('0x26')]()[_0x95ae('0x25')](function(){var _0x279ea7=_0x1230e3[_0x95ae('0x27')]({'plain':!![]});var _0x11caad='Companies';return db[_0x95ae('0x28')]['destroy']({'where':{'type':_0x11caad,'resourceId':_0x279ea7['id']}})[_0x95ae('0x25')](function(){return _0x1230e3;});})[_0x95ae('0x25')](function(){_0x1b4275[_0x95ae('0x1b')](0xcc)[_0x95ae('0x1c')]();});}};}function handleEntityNotFound(_0x408af3,_0x3ac7bd){return function(_0x7e65e8){if(!_0x7e65e8){_0x408af3['sendStatus'](0x194);}return _0x7e65e8;};}function handleError(_0x15e915,_0x157b49){_0x157b49=_0x157b49||0x1f4;return function(_0x3a84cb){logger[_0x95ae('0x29')](_0x3a84cb[_0x95ae('0x2a')]);if(_0x3a84cb['name']){delete _0x3a84cb[_0x95ae('0x2b')];}_0x15e915[_0x95ae('0x1b')](_0x157b49)[_0x95ae('0x2c')](_0x3a84cb);};}exports[_0x95ae('0x2d')]=function(_0x2cac20,_0x3e4447){var _0x31c262={},_0x5deb85={},_0x4d1af2={'count':0x0,'rows':[]};return db[_0x95ae('0x2e')][_0x95ae('0x2f')]()['then'](function(_0x537836){_0x5deb85['model']=_[_0x95ae('0x30')](_0x537836);_0x5deb85[_0x95ae('0x31')]=_[_0x95ae('0x30')](_0x2cac20['query']);_0x5deb85[_0x95ae('0x32')]=_[_0x95ae('0x33')](_0x5deb85[_0x95ae('0x34')],_0x5deb85[_0x95ae('0x31')]);_0x31c262[_0x95ae('0x35')]=_[_0x95ae('0x33')](_0x5deb85['model'],qs[_0x95ae('0x36')](_0x2cac20[_0x95ae('0x31')][_0x95ae('0x36')]));_0x31c262[_0x95ae('0x35')]=_0x31c262[_0x95ae('0x35')][_0x95ae('0x37')]?_0x31c262[_0x95ae('0x35')]:_0x5deb85[_0x95ae('0x34')];if(!_0x2cac20[_0x95ae('0x31')][_0x95ae('0x38')]('nolimit')){_0x31c262[_0x95ae('0x20')]=qs['limit'](_0x2cac20[_0x95ae('0x31')]['limit']);_0x31c262[_0x95ae('0x1e')]=qs['offset'](_0x2cac20[_0x95ae('0x31')][_0x95ae('0x1e')]);}_0x31c262[_0x95ae('0x39')]=qs[_0x95ae('0x3a')](_0x2cac20[_0x95ae('0x31')]['sort']);_0x31c262['where']=qs[_0x95ae('0x32')](_[_0x95ae('0x3b')](_0x2cac20[_0x95ae('0x31')],_0x5deb85['filters']),_0x537836);if(_0x2cac20['query'][_0x95ae('0x3c')]){_0x31c262[_0x95ae('0x3d')]=_[_0x95ae('0x3e')](_0x31c262[_0x95ae('0x3d')],{'$or':_['map'](_0x31c262['attributes'],function(_0x4f6e29){var _0x5c48c9={};_0x5c48c9[_0x4f6e29]={'$like':'%'+_0x2cac20[_0x95ae('0x31')][_0x95ae('0x3c')]+'%'};return _0x5c48c9;})});}_0x31c262=_[_0x95ae('0x3e')]({},_0x31c262,_0x2cac20[_0x95ae('0x3f')]);var _0xa370bd={'where':_0x31c262[_0x95ae('0x3d')]};return db[_0x95ae('0x2e')][_0x95ae('0x21')](_0xa370bd)[_0x95ae('0x25')](function(_0x581575){_0x4d1af2['count']=_0x581575;if(_0x2cac20[_0x95ae('0x31')]['includeAll']){_0x31c262[_0x95ae('0x40')]=[{'all':!![]}];}return db[_0x95ae('0x2e')][_0x95ae('0x41')](_0x31c262);})['then'](function(_0x3d59da){_0x4d1af2[_0x95ae('0x42')]=_0x3d59da;return _0x4d1af2;})[_0x95ae('0x25')](respondWithFilteredResult(_0x3e4447,_0x31c262))[_0x95ae('0x43')](handleError(_0x3e4447,null));})[_0x95ae('0x43')](handleError(_0x3e4447,null));};exports[_0x95ae('0x44')]=function(_0x21831e,_0x2c270f){var _0x41e7f4={'raw':![],'where':{'id':_0x21831e[_0x95ae('0x45')]['id']}},_0x3a9c5f={};_0x3a9c5f[_0x95ae('0x34')]=_[_0x95ae('0x30')](db[_0x95ae('0x2e')]['rawAttributes']);_0x3a9c5f['query']=_[_0x95ae('0x30')](_0x21831e[_0x95ae('0x31')]);_0x3a9c5f[_0x95ae('0x32')]=_[_0x95ae('0x33')](_0x3a9c5f[_0x95ae('0x34')],_0x3a9c5f[_0x95ae('0x31')]);_0x41e7f4['attributes']=_[_0x95ae('0x33')](_0x3a9c5f['model'],qs['fields'](_0x21831e[_0x95ae('0x31')][_0x95ae('0x36')]));_0x41e7f4[_0x95ae('0x35')]=_0x41e7f4[_0x95ae('0x35')][_0x95ae('0x37')]?_0x41e7f4['attributes']:_0x3a9c5f[_0x95ae('0x34')];if(_0x21831e[_0x95ae('0x31')][_0x95ae('0x46')]){_0x41e7f4[_0x95ae('0x40')]=[{'all':!![]}];}_0x41e7f4=_[_0x95ae('0x3e')]({},_0x41e7f4,_0x21831e['options']);return db[_0x95ae('0x2e')][_0x95ae('0x47')](_0x41e7f4)['then'](handleEntityNotFound(_0x2c270f,null))['then'](respondWithResult(_0x2c270f,null))['catch'](handleError(_0x2c270f,null));};exports[_0x95ae('0x48')]=function(_0x511b19,_0x16000a){return db[_0x95ae('0x2e')]['create'](_0x511b19[_0x95ae('0x49')],{})['then'](function(_0x5e0f86){var _0xcd356=_0x511b19[_0x95ae('0x4a')][_0x95ae('0x27')]({'plain':!![]});if(!_0xcd356)throw new Error(_0x95ae('0x4b'));if(_0xcd356[_0x95ae('0x4c')]===_0x95ae('0x4a')){var _0x56c009=_0x5e0f86['get']({'plain':!![]});var _0x7349cd=_0x95ae('0x4d');return db[_0x95ae('0x4e')]['find']({'where':{'name':_0x7349cd,'userProfileId':_0xcd356[_0x95ae('0x4f')]},'raw':!![]})['then'](function(_0x3bcbea){if(_0x3bcbea&&_0x3bcbea[_0x95ae('0x50')]===0x0){return db[_0x95ae('0x28')][_0x95ae('0x48')]({'name':_0x56c009[_0x95ae('0x2b')],'resourceId':_0x56c009['id'],'type':_0x3bcbea[_0x95ae('0x2b')],'sectionId':_0x3bcbea['id']},{})[_0x95ae('0x25')](function(){return _0x5e0f86;});}else{return _0x5e0f86;}})[_0x95ae('0x43')](function(_0x10f205){logger[_0x95ae('0x29')](_0x95ae('0x51'),_0x10f205);throw _0x10f205;});}return _0x5e0f86;})['then'](respondWithResult(_0x16000a,0xc9))[_0x95ae('0x43')](handleError(_0x16000a,null));};exports[_0x95ae('0x52')]=function(_0x27c1d8,_0x30d49d){if(_0x27c1d8[_0x95ae('0x49')]['id']){delete _0x27c1d8['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x27c1d8[_0x95ae('0x45')]['id']}})[_0x95ae('0x25')](handleEntityNotFound(_0x30d49d,null))[_0x95ae('0x25')](saveUpdates(_0x27c1d8[_0x95ae('0x49')],null))['then'](respondWithResult(_0x30d49d,null))[_0x95ae('0x43')](handleError(_0x30d49d,null));};exports[_0x95ae('0x26')]=function(_0x14f314,_0x2a65b6){return db['CmCompany'][_0x95ae('0x47')]({'where':{'id':_0x14f314[_0x95ae('0x45')]['id']}})[_0x95ae('0x25')](handleEntityNotFound(_0x2a65b6,null))['then'](removeEntity(_0x2a65b6,null))['catch'](handleError(_0x2a65b6,null));};exports[_0x95ae('0x2f')]=function(_0x109753,_0x66bd8b){return db[_0x95ae('0x2e')][_0x95ae('0x2f')]()['then'](respondWithResult(_0x66bd8b,null))[_0x95ae('0x43')](handleError(_0x66bd8b,null));};exports[_0x95ae('0x53')]=function(_0x4c43eb,_0x17bfd1,_0x171253){return db[_0x95ae('0x54')][_0x95ae('0x47')]({'where':{'id':_0x4c43eb['params']['id']}})['then'](handleEntityNotFound(_0x17bfd1,null))[_0x95ae('0x25')](function(_0x16c18b){if(_0x16c18b){return _0x16c18b[_0x95ae('0x53')](_0x4c43eb['body'][_0x95ae('0x55')],_[_0x95ae('0x56')](_0x4c43eb[_0x95ae('0x49')],[_0x95ae('0x55'),'id'])||{});}})[_0x95ae('0x25')](respondWithResult(_0x17bfd1,null))[_0x95ae('0x43')](handleError(_0x17bfd1,null));};exports[_0x95ae('0x57')]=function(_0x469518,_0x40af8a,_0x146bd1){var _0x5dd4e6={};var _0x1afcfd={};var _0x1c1471;var _0x1185d6;return db[_0x95ae('0x2e')][_0x95ae('0x58')]({'where':{'id':_0x469518['params']['id']}})[_0x95ae('0x25')](handleEntityNotFound(_0x40af8a,null))[_0x95ae('0x25')](function(_0x42a96a){if(_0x42a96a){_0x1c1471=_0x42a96a;_0x1afcfd[_0x95ae('0x34')]=_[_0x95ae('0x30')](db[_0x95ae('0x54')][_0x95ae('0x59')]);_0x1afcfd[_0x95ae('0x31')]=_[_0x95ae('0x30')](_0x469518['query']);_0x1afcfd[_0x95ae('0x32')]=_['intersection'](_0x1afcfd[_0x95ae('0x34')],_0x1afcfd['query']);_0x5dd4e6[_0x95ae('0x35')]=_[_0x95ae('0x33')](_0x1afcfd[_0x95ae('0x34')],qs['fields'](_0x469518['query'][_0x95ae('0x36')]));_0x5dd4e6[_0x95ae('0x35')]=_0x5dd4e6[_0x95ae('0x35')][_0x95ae('0x37')]?_0x5dd4e6[_0x95ae('0x35')]:_0x1afcfd[_0x95ae('0x34')];_0x5dd4e6['order']=qs['sort'](_0x469518[_0x95ae('0x31')][_0x95ae('0x3a')]);_0x5dd4e6[_0x95ae('0x3d')]=qs[_0x95ae('0x32')](_[_0x95ae('0x3b')](_0x469518['query'],_0x1afcfd[_0x95ae('0x32')]));if(_0x469518['query']['filter']){_0x5dd4e6[_0x95ae('0x3d')]=_['merge'](_0x5dd4e6['where'],{'$or':_[_0x95ae('0x5a')](_0x5dd4e6[_0x95ae('0x35')],function(_0x2c4287){var _0x33615a={};_0x33615a[_0x2c4287]={'$like':'%'+_0x469518[_0x95ae('0x31')][_0x95ae('0x3c')]+'%'};return _0x33615a;})});}_0x5dd4e6=_[_0x95ae('0x3e')]({},_0x5dd4e6,_0x469518[_0x95ae('0x3f')]);return _0x1c1471[_0x95ae('0x57')](_0x5dd4e6);}})[_0x95ae('0x25')](function(_0x52c889){if(_0x52c889){_0x1185d6=_0x52c889[_0x95ae('0x37')];if(!_0x469518['query'][_0x95ae('0x38')]('nolimit')){_0x5dd4e6['limit']=qs[_0x95ae('0x20')](_0x469518[_0x95ae('0x31')][_0x95ae('0x20')]);_0x5dd4e6[_0x95ae('0x1e')]=qs[_0x95ae('0x1e')](_0x469518[_0x95ae('0x31')]['offset']);}return _0x1c1471[_0x95ae('0x57')](_0x5dd4e6);}})[_0x95ae('0x25')](function(_0x883400){if(_0x883400){return _0x883400?{'count':_0x1185d6,'rows':_0x883400}:null;}})['then'](respondWithResult(_0x40af8a,null))[_0x95ae('0x43')](handleError(_0x40af8a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e66ce85..22792b8 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 _0x3a73=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','api'];(function(_0x31e794,_0x2c83e1){var _0xefee37=function(_0x1b17d5){while(--_0x1b17d5){_0x31e794['push'](_0x31e794['shift']());}};_0xefee37(++_0x2c83e1);}(_0x3a73,0xe8));var _0x33a7=function(_0x56e625,_0x315aa2){_0x56e625=_0x56e625-0x0;var _0x42d64f=_0x3a73[_0x56e625];return _0x42d64f;};'use strict';var _=require(_0x33a7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x33a7('0x2'));var rimraf=require(_0x33a7('0x3'));var config=require(_0x33a7('0x4'));var attributes=require(_0x33a7('0x5'));module[_0x33a7('0x6')]=function(_0x2a5f46,_0x5732b9){return _0x2a5f46[_0x33a7('0x7')](_0x33a7('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8df9=['rimraf','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x23b528,_0x2a8cab){var _0x4ac11a=function(_0x4b3e3e){while(--_0x4b3e3e){_0x23b528['push'](_0x23b528['shift']());}};_0x4ac11a(++_0x2a8cab);}(_0x8df9,0x139));var _0x98df=function(_0x2677fc,_0x76bb7a){_0x2677fc=_0x2677fc-0x0;var _0xd800f9=_0x8df9[_0x2677fc];return _0xd800f9;};'use strict';var _=require(_0x98df('0x0'));var util=require(_0x98df('0x1'));var logger=require(_0x98df('0x2'))('api');var moment=require(_0x98df('0x3'));var BPromise=require(_0x98df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98df('0x5'));var rimraf=require(_0x98df('0x6'));var config=require('../../config/environment');var attributes=require(_0x98df('0x7'));module['exports']=function(_0x2b1cf5,_0x13f1d7){return _0x2b1cf5[_0x98df('0x8')](_0x98df('0x9'),attributes,{'tableName':_0x98df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 1a1a7cc..722922b 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 _0x86e5=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5bda9b,_0x5ea719){var _0x4c2a55=function(_0x73f642){while(--_0x73f642){_0x5bda9b['push'](_0x5bda9b['shift']());}};_0x4c2a55(++_0x5ea719);}(_0x86e5,0x6a));var _0x586e=function(_0x593f72,_0x24896f){_0x593f72=_0x593f72-0x0;var _0x27df1c=_0x86e5[_0x593f72];return _0x27df1c;};'use strict';var _=require('lodash');var util=require(_0x586e('0x0'));var moment=require(_0x586e('0x1'));var BPromise=require(_0x586e('0x2'));var rs=require(_0x586e('0x3'));var fs=require('fs');var Redis=require(_0x586e('0x4'));var db=require(_0x586e('0x5'))['db'];var utils=require(_0x586e('0x6'));var logger=require(_0x586e('0x7'))(_0x586e('0x8'));var config=require(_0x586e('0x9'));var jayson=require(_0x586e('0xa'));var client=jayson[_0x586e('0xb')][_0x586e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe378b6,_0x19d94d,_0xf7c4f7){return new BPromise(function(_0xe6ab13,_0x3d087f){return client[_0x586e('0xd')](_0xe378b6,_0xf7c4f7)[_0x586e('0xe')](function(_0x29df0a){logger[_0x586e('0xf')](_0x586e('0x10'),_0x19d94d,_0x586e('0x11'));logger[_0x586e('0x12')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x19d94d,_0x586e('0x11'),JSON[_0x586e('0x13')](_0x29df0a));if(_0x29df0a[_0x586e('0x14')]){if(_0x29df0a[_0x586e('0x14')][_0x586e('0x15')]===0x1f4){logger[_0x586e('0x14')](_0x586e('0x10'),_0x19d94d,_0x29df0a[_0x586e('0x14')][_0x586e('0x16')]);return _0x3d087f(_0x29df0a[_0x586e('0x14')]['message']);}logger[_0x586e('0x14')](_0x586e('0x10'),_0x19d94d,_0x29df0a[_0x586e('0x14')][_0x586e('0x16')]);return _0xe6ab13(_0x29df0a[_0x586e('0x14')][_0x586e('0x16')]);}else{logger[_0x586e('0xf')](_0x586e('0x10'),_0x19d94d,_0x586e('0x11'));_0xe6ab13(_0x29df0a[_0x586e('0x17')][_0x586e('0x16')]);}})[_0x586e('0x18')](function(_0x27b845){logger[_0x586e('0x14')](_0x586e('0x10'),_0x19d94d,_0x27b845);_0x3d087f(_0x27b845);});});} \ No newline at end of file +var _0xb559=['request\x20sent','debug','stringify','error','code','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x4206cd,_0x16efc2){var _0xea5a62=function(_0x21d56e){while(--_0x21d56e){_0x4206cd['push'](_0x4206cd['shift']());}};_0xea5a62(++_0x16efc2);}(_0xb559,0xf8));var _0x9b55=function(_0x2ea8fe,_0x13a71f){_0x2ea8fe=_0x2ea8fe-0x0;var _0x138e9f=_0xb559[_0x2ea8fe];return _0x138e9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9b55('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b55('0x1'));var db=require(_0x9b55('0x2'))['db'];var utils=require(_0x9b55('0x3'));var logger=require(_0x9b55('0x4'))(_0x9b55('0x5'));var config=require(_0x9b55('0x6'));var jayson=require(_0x9b55('0x7'));var client=jayson['client'][_0x9b55('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40bd9a,_0x3de4f4,_0x1b178f){return new BPromise(function(_0x4a5274,_0x3bbab5){return client['request'](_0x40bd9a,_0x1b178f)[_0x9b55('0x9')](function(_0x2281a9){logger[_0x9b55('0xa')](_0x9b55('0xb'),_0x3de4f4,_0x9b55('0xc'));logger[_0x9b55('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3de4f4,'request\x20sent',JSON[_0x9b55('0xe')](_0x2281a9));if(_0x2281a9['error']){if(_0x2281a9[_0x9b55('0xf')][_0x9b55('0x10')]===0x1f4){logger[_0x9b55('0xf')](_0x9b55('0xb'),_0x3de4f4,_0x2281a9[_0x9b55('0xf')][_0x9b55('0x11')]);return _0x3bbab5(_0x2281a9[_0x9b55('0xf')]['message']);}logger[_0x9b55('0xf')](_0x9b55('0xb'),_0x3de4f4,_0x2281a9[_0x9b55('0xf')]['message']);return _0x4a5274(_0x2281a9[_0x9b55('0xf')]['message']);}else{logger[_0x9b55('0xa')](_0x9b55('0xb'),_0x3de4f4,_0x9b55('0xc'));_0x4a5274(_0x2281a9[_0x9b55('0x12')][_0x9b55('0x11')]);}})[_0x9b55('0x13')](function(_0x884563){logger[_0x9b55('0xf')](_0x9b55('0xb'),_0x3de4f4,_0x884563);_0x3bbab5(_0x884563);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 42dd848..fb29a8c 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 _0xbf16=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','addContacts','put','update','delete','exports','multer'];(function(_0x9a7d5b,_0x50327f){var _0xe2a5b3=function(_0x98ad8d){while(--_0x98ad8d){_0x9a7d5b['push'](_0x9a7d5b['shift']());}};_0xe2a5b3(++_0x50327f);}(_0xbf16,0x95));var _0x6bf1=function(_0x31893e,_0x47fc31){_0x31893e=_0x31893e-0x0;var _0x4ad29c=_0xbf16[_0x31893e];return _0x4ad29c;};'use strict';var multer=require(_0x6bf1('0x0'));var util=require(_0x6bf1('0x1'));var path=require(_0x6bf1('0x2'));var timeout=require(_0x6bf1('0x3'));var express=require(_0x6bf1('0x4'));var router=express[_0x6bf1('0x5')]();var fs_extra=require(_0x6bf1('0x6'));var auth=require(_0x6bf1('0x7'));var interaction=require(_0x6bf1('0x8'));var config=require(_0x6bf1('0x9'));var controller=require(_0x6bf1('0xa'));router[_0x6bf1('0xb')]('/',auth['isAuthenticated'](),controller[_0x6bf1('0xc')]);router['get'](_0x6bf1('0xd'),auth[_0x6bf1('0xe')](),controller[_0x6bf1('0xf')]);router[_0x6bf1('0xb')](_0x6bf1('0x10'),auth[_0x6bf1('0xe')](),controller[_0x6bf1('0x11')]);router[_0x6bf1('0xb')]('/:id/contacts',auth[_0x6bf1('0xe')](),controller['getContacts']);router[_0x6bf1('0x12')]('/',auth['isAuthenticated'](),controller[_0x6bf1('0x13')]);router['post']('/:id/contacts',auth[_0x6bf1('0xe')](),controller[_0x6bf1('0x14')]);router[_0x6bf1('0x15')](_0x6bf1('0x10'),auth[_0x6bf1('0xe')](),controller[_0x6bf1('0x16')]);router[_0x6bf1('0x17')](_0x6bf1('0x10'),auth[_0x6bf1('0xe')](),controller['destroy']);module[_0x6bf1('0x18')]=router; \ No newline at end of file +var _0xab53=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/contacts','post','create','addContacts','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x4d121d,_0x3fe733){var _0xffa031=function(_0x1fec1b){while(--_0x1fec1b){_0x4d121d['push'](_0x4d121d['shift']());}};_0xffa031(++_0x3fe733);}(_0xab53,0xdf));var _0x3ab5=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xab53[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0x3ab5('0x0'));var util=require(_0x3ab5('0x1'));var path=require(_0x3ab5('0x2'));var timeout=require(_0x3ab5('0x3'));var express=require(_0x3ab5('0x4'));var router=express[_0x3ab5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3ab5('0x6'));var interaction=require(_0x3ab5('0x7'));var config=require(_0x3ab5('0x8'));var controller=require('./cmCompany.controller');router[_0x3ab5('0x9')]('/',auth['isAuthenticated'](),controller[_0x3ab5('0xa')]);router[_0x3ab5('0x9')]('/describe',auth[_0x3ab5('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3ab5('0xb')](),controller['show']);router[_0x3ab5('0x9')](_0x3ab5('0xc'),auth[_0x3ab5('0xb')](),controller['getContacts']);router[_0x3ab5('0xd')]('/',auth['isAuthenticated'](),controller[_0x3ab5('0xe')]);router['post'](_0x3ab5('0xc'),auth['isAuthenticated'](),controller[_0x3ab5('0xf')]);router[_0x3ab5('0x10')](_0x3ab5('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x3ab5('0x12')]('/:id',auth[_0x3ab5('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6d0e4f6..1677fb5 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 _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x51446b,_0x4723f8){var _0x50346c=function(_0x3993b4){while(--_0x3993b4){_0x51446b['push'](_0x51446b['shift']());}};_0x50346c(++_0x4723f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x9ca21f,_0x437553){_0x9ca21f=_0x9ca21f-0x0;var _0x9ef54b=_0xb10b[_0x9ca21f];return _0x9ef54b;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x2da8c4,_0x27adda){var _0x3ee006=function(_0x4b9d7c){while(--_0x4b9d7c){_0x2da8c4['push'](_0x2da8c4['shift']());}};_0x3ee006(++_0x27adda);}(_0x0b0e,0x187));var _0xe0b0=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x0b0e[_0x422be2];return _0x1b820e;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index be1a78f..870fc28 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 _0x63f1=['CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','dialTimezone','utcOffset','timezones','create','bulkCreate','each','duplicates','$or','spread','show','$and','omit','pickBy','format','table','setFields','phone','getTags','pick','options','setTags','ids','getHoppers','rawAttributes','ContactId','includeAll','getHopperHistories','include','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','binding_values','socket_timestamp','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','voice','source','destination','starttime','endtime','note','createdAt','userDisposition','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','secondDisposition','thirdDisposition','UserId','key','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','substatus','externalUrl','Owner','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','json','update','then','end','sendStatus','error','send','index','describe','length','keys','startsWith','push','CmCustomField','findOne','trimStart','all','cf_','fieldType','type','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','field','name','color','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','DATE','buildExpression','text','value','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','user','agent','some','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','catch','params','tags','columnName','analytics','displayName','alias','custom','values','body','findAll','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage'];(function(_0x81fe53,_0x5b8f05){var _0x56f7a7=function(_0x1e7846){while(--_0x1e7846){_0x81fe53['push'](_0x81fe53['shift']());}};_0x56f7a7(++_0x5b8f05);}(_0x63f1,0x71));var _0x163f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x63f1[_0x4a53d];return _0x27410e;};'use strict';var moment=require(_0x163f('0x0'));var BPromise=require(_0x163f('0x1'));var util=require(_0x163f('0x2'));var path=require(_0x163f('0x3'));var fs=require('fs');var _=require(_0x163f('0x4'));var squel=require(_0x163f('0x5'));var Papa=require(_0x163f('0x6'));var Redis=require('ioredis');var qs=require(_0x163f('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x163f('0x8'))(_0x163f('0x9'));var config=require(_0x163f('0xa'));var shared=require(_0x163f('0xb'));var db=require(_0x163f('0xc'))['db'];config[_0x163f('0xd')]=_[_0x163f('0xe')](config[_0x163f('0xd')],{'host':_0x163f('0xf'),'port':0x18eb});var socket=require(_0x163f('0x10'))(new Redis(config[_0x163f('0xd')]));require(_0x163f('0x11'))[_0x163f('0x12')](socket);function respondWithResult(_0x366b66,_0x3711d7){_0x3711d7=_0x3711d7||0xc8;return function(_0x193c7a){if(_0x193c7a){return _0x366b66[_0x163f('0x13')](_0x3711d7)['json'](_0x193c7a);}};}function respondWithFilteredResult(_0x3285d9,_0x5db172){return function(_0x150074){if(_0x150074){var _0x18738d=typeof _0x5db172[_0x163f('0x14')]===_0x163f('0x15')&&typeof _0x5db172[_0x163f('0x16')]===_0x163f('0x15');var _0x4c7493=_0x150074[_0x163f('0x17')];var _0x36039b=_0x18738d?0x0:_0x5db172['offset'];var _0x504af6=_0x18738d?_0x150074[_0x163f('0x17')]:_0x5db172['offset']+_0x5db172['limit'];var _0x52fd5d;if(_0x504af6>=_0x4c7493){_0x504af6=_0x4c7493;_0x52fd5d=0xc8;}else{_0x52fd5d=0xce;}_0x3285d9[_0x163f('0x13')](_0x52fd5d);return _0x3285d9['set'](_0x163f('0x18'),_0x36039b+'-'+_0x504af6+'/'+_0x4c7493)[_0x163f('0x19')](_0x150074);}return null;};}function saveUpdates(_0x27b4b2){return function(_0x385e4c){if(_0x385e4c){return _0x385e4c[_0x163f('0x1a')](_0x27b4b2)['then'](function(_0x545946){return _0x545946;});}return null;};}function removeEntity(_0x11d761){return function(_0x749ba4){if(_0x749ba4){return _0x749ba4['destroy']()[_0x163f('0x1b')](function(){_0x11d761[_0x163f('0x13')](0xcc)[_0x163f('0x1c')]();});}};}function handleEntityNotFound(_0x5a713d){return function(_0x559202){if(!_0x559202){_0x5a713d[_0x163f('0x1d')](0x194);}return _0x559202;};}function handleError(_0x4ada88,_0x3fbfc1){_0x3fbfc1=_0x3fbfc1||0x1f4;return function(_0x1299ad){logger[_0x163f('0x1e')](_0x1299ad['stack']);if(_0x1299ad['name']){delete _0x1299ad['name'];}_0x4ada88[_0x163f('0x13')](_0x3fbfc1)[_0x163f('0x1f')](_0x1299ad);};}exports[_0x163f('0x20')]=function(_0x33ec2a,_0x185043){var _0x5bee02={},_0x4ca5d4={},_0x128e64={'count':0x0,'rows':[]};return db['CmContact'][_0x163f('0x21')]()[_0x163f('0x1b')](function(_0x1d2fd3){var _0x2573fc=[];for(var _0x5dc6f8=0x0;_0x5dc6f80x1){_0x577470['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x163f('0x61')](_0x50a7ec),null);}else{if(qs[_0x163f('0x62')](_0x50a7ec)){_0x577470['or']('c.id\x20LIKE\x20?',_0x50a7ec+'%');_0x577470['or'](_0x163f('0x63'),_0x50a7ec+'%');_0x577470['or']('c.mobile\x20LIKE\x20?',_0x50a7ec+'%');_0x577470['or'](_0x163f('0x64'),_0x50a7ec+'%');}else if(qs['isEmail'](_0x50a7ec)){_0x577470['or'](_0x163f('0x65'),_0x50a7ec+'%');}else{_0x577470['or'](_0x163f('0x66'),'%'+_0x50a7ec+'%');_0x577470['or'](_0x163f('0x67'),'%'+_0x50a7ec+'%');_0x577470['or']('c.email\x20LIKE\x20?','%'+_0x50a7ec+'%');}}}}_0x3aee46['where'](_0x577470);_0x3aee46['group'](_0x163f('0x68'));var _0x446911={'type':db[_0x163f('0x69')][_0x163f('0x6a')][_0x163f('0x6b')],'raw':!![]};var _0x262c37=_0x3aee46[_0x163f('0x6c')]()[_0x163f('0x38')](_0x163f('0x68'));if(_0x5bee02[_0x163f('0x35')]){_0x5bee02[_0x163f('0x35')]['forEach'](function(_0x582b4b){_0x3aee46[_0x163f('0x35')]('c.'+_0x582b4b[0x0],_0x582b4b[0x1]===_0x163f('0x6d')?![]:!![]);});}if(!_[_0x163f('0x5b')](_0x2eacef)){_0x3aee46[_0x163f('0x6e')](_0x4c94bf);_0x262c37[_0x163f('0x37')](_0x163f('0x6f'),_0x2eacef);}BPromise['resolve']()[_0x163f('0x1b')](function(){if(!_0x166082)return;if(_0x33ec2a[_0x163f('0x70')]['role']!==_0x163f('0x71'))return;if(!_[_0x163f('0x72')](_0x166082[_0x163f('0x48')],[_0x163f('0x38'),_0x163f('0x50')])){return _0x33ec2a[_0x163f('0x70')]['getLists']({'attributes':['id'],'raw':!![]})['then'](function(_0xa05ab5){if(_['isEmpty'](_0xa05ab5)){_0x262c37[_0x163f('0x37')](_0x163f('0x73'));_0x3aee46[_0x163f('0x37')]('c.ListId\x20IS\x20NULL');}else{_0x262c37[_0x163f('0x37')](_0x163f('0x5c'),_[_0x163f('0x4c')](_0xa05ab5,'id'));_0x3aee46[_0x163f('0x37')]('c.ListId\x20IN\x20?',_[_0x163f('0x4c')](_0xa05ab5,'id'));}});}})[_0x163f('0x1b')](function(){if(_0x33ec2a[_0x163f('0x70')]['role']===_0x163f('0x71')&&!_0x166082&&!_0x33ec2a['query'][_0x163f('0x74')])return[];return db[_0x163f('0x75')][_0x163f('0x2f')](_0x262c37[_0x163f('0x76')](),_0x446911);})[_0x163f('0x1b')](function(_0x596981){_0x128e64[_0x163f('0x17')]=_0x596981['length'];if(_0x128e64['count']===0x0)return[];return db['sequelize'][_0x163f('0x2f')](_0x56e530['toString'](),_0x446911)[_0x163f('0x1b')](function(_0x1ab764){_0x8fd182=_[_0x163f('0x77')](_0x1ab764,'id');_0x446911=_[_0x163f('0x78')](_0x446911,{'model':db[_0x163f('0x79')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x33ec2a['query'][_0x163f('0x32')]){_0x5bee02['attributes']['forEach'](function(_0x3d9042){_0x3aee46[_0x163f('0x38')]('c.'+_0x3d9042);});}else{_0x3aee46['field']('c.id');_0x3aee46[_0x163f('0x38')](_0x163f('0x7a'));_0x3aee46['field'](_0x163f('0x7b'));_0x3aee46[_0x163f('0x38')](_0x163f('0x7c'));_0x3aee46[_0x163f('0x38')](_0x163f('0x7d'));_0x3aee46[_0x163f('0x38')](_0x163f('0x7e'));_0x3aee46['field'](_0x163f('0x7f'));_0x3aee46[_0x163f('0x38')](_0x163f('0x80'));_0x3aee46[_0x163f('0x38')](_0x163f('0x81'));_0x3aee46[_0x163f('0x38')](_0x163f('0x82'));_0x3aee46[_0x163f('0x38')](_0x163f('0x83'));_0x3aee46[_0x163f('0x38')](_0x163f('0x84'),'TagIds');}if(_0x5bee02[_0x163f('0x16')])_0x3aee46[_0x163f('0x16')](_0x5bee02[_0x163f('0x16')]);if(_0x5bee02[_0x163f('0x14')])_0x3aee46[_0x163f('0x14')](_0x5bee02[_0x163f('0x14')]);return db[_0x163f('0x75')][_0x163f('0x2f')](_0x3aee46['toString'](),_0x446911);});})[_0x163f('0x1b')](function(_0x529674){_0x529674[_0x163f('0x4d')](function(_0x27c52c){if(_0x27c52c['TagIds']){_0x27c52c[_0x163f('0x85')]=[];_0x27c52c[_0x163f('0x86')]['split'](',')[_0x163f('0x4d')](function(_0xef5fcf){_0x27c52c[_0x163f('0x85')][_0x163f('0x25')](_0x8fd182[_0xef5fcf]);});}delete _0x27c52c[_0x163f('0x86')];});_0x128e64[_0x163f('0x87')]=_0x529674;return _0x128e64;})[_0x163f('0x1b')](respondWithFilteredResult(_0x185043,_0x5bee02));})[_0x163f('0x88')](handleError(_0x185043,null));};exports['destroy']=function(_0x25669d,_0x1f56e1){return db[_0x163f('0x79')][_0x163f('0x49')]({'where':{'id':_0x25669d[_0x163f('0x89')]['id']}})[_0x163f('0x1b')](handleEntityNotFound(_0x1f56e1,null))[_0x163f('0x1b')](removeEntity(_0x1f56e1,null))[_0x163f('0x88')](handleError(_0x1f56e1,null));};exports[_0x163f('0x21')]=function(_0x51e11e,_0x1a9707){return db[_0x163f('0x79')][_0x163f('0x21')]()[_0x163f('0x1b')](function(_0xbd9d42){delete _0xbd9d42[_0x163f('0x8a')];for(var _0x4b9436=0x0;_0x4b9436=_0x48dced){_0x342fec=_0x48dced;_0x43224d=0xc8;}else{_0x43224d=0xce;}_0x7e9d6b['status'](_0x43224d);return _0x7e9d6b[_0x5b93('0x16')](_0x5b93('0x17'),_0x23b1f6+'-'+_0x342fec+'/'+_0x48dced)[_0x5b93('0x18')](_0x52f1df);}return null;};}function saveUpdates(_0x87bf72){return function(_0x101da9){if(_0x101da9){return _0x101da9['update'](_0x87bf72)[_0x5b93('0x19')](function(_0x480605){return _0x480605;});}return null;};}function removeEntity(_0x4678b8){return function(_0x432654){if(_0x432654){return _0x432654[_0x5b93('0x1a')]()['then'](function(){_0x4678b8[_0x5b93('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x291102){return function(_0x2b7cf0){if(!_0x2b7cf0){_0x291102[_0x5b93('0x1b')](0x194);}return _0x2b7cf0;};}function handleError(_0xe2d99c,_0x318e45){_0x318e45=_0x318e45||0x1f4;return function(_0x529bc6){logger[_0x5b93('0x1c')](_0x529bc6['stack']);if(_0x529bc6[_0x5b93('0x1d')]){delete _0x529bc6[_0x5b93('0x1d')];}_0xe2d99c[_0x5b93('0x12')](_0x318e45)[_0x5b93('0x1e')](_0x529bc6);};}exports[_0x5b93('0x1f')]=function(_0x23acbf,_0x281875){var _0x50952e={},_0x51575d={},_0x49389b={'count':0x0,'rows':[]};return db[_0x5b93('0x20')][_0x5b93('0x21')]()[_0x5b93('0x19')](function(_0xa09780){var _0x33dd73=[];for(var _0x3e19ad=0x0;_0x3e19ad0x1){_0x588590['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5b93('0x62')](_0x482bda),null);}else{if(qs['isNumeric'](_0x482bda)){_0x588590['or']('c.id\x20LIKE\x20?',_0x482bda+'%');_0x588590['or'](_0x5b93('0x63'),_0x482bda+'%');_0x588590['or'](_0x5b93('0x64'),_0x482bda+'%');_0x588590['or'](_0x5b93('0x65'),_0x482bda+'%');}else if(qs[_0x5b93('0x66')](_0x482bda)){_0x588590['or'](_0x5b93('0x67'),_0x482bda+'%');}else{_0x588590['or'](_0x5b93('0x68'),'%'+_0x482bda+'%');_0x588590['or'](_0x5b93('0x69'),'%'+_0x482bda+'%');_0x588590['or'](_0x5b93('0x67'),'%'+_0x482bda+'%');}}}}_0x1532ff[_0x5b93('0x33')](_0x588590);_0x1532ff[_0x5b93('0x6a')](_0x5b93('0x6b'));var _0x181c9f={'type':db['Sequelize'][_0x5b93('0x6c')][_0x5b93('0x6d')],'raw':!![]};var _0xe08d0e=_0x1532ff[_0x5b93('0x6e')]()[_0x5b93('0x36')](_0x5b93('0x6b'));if(_0x50952e['order']){_0x50952e[_0x5b93('0x31')]['forEach'](function(_0x4838f5){_0x1532ff[_0x5b93('0x31')]('c.'+_0x4838f5[0x0],_0x4838f5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5b93('0x5a')](_0x595854)){_0x1532ff[_0x5b93('0x6f')](_0x1f1876);_0xe08d0e['where'](_0x5b93('0x70'),_0x595854);}BPromise[_0x5b93('0x71')]()['then'](function(){if(!_0x6ef8ac)return;if(_0x23acbf[_0x5b93('0x72')][_0x5b93('0x73')]!==_0x5b93('0x74'))return;if(!_[_0x5b93('0x75')](_0x6ef8ac[_0x5b93('0x45')],['field',_0x5b93('0x4d')])){return _0x23acbf[_0x5b93('0x72')][_0x5b93('0x76')]({'attributes':['id'],'raw':!![]})[_0x5b93('0x19')](function(_0xe1b870){if(_[_0x5b93('0x5a')](_0xe1b870)){_0xe08d0e[_0x5b93('0x33')](_0x5b93('0x77'));_0x1532ff[_0x5b93('0x33')](_0x5b93('0x77'));}else{_0xe08d0e['where'](_0x5b93('0x5c'),_[_0x5b93('0x4a')](_0xe1b870,'id'));_0x1532ff['where'](_0x5b93('0x5c'),_[_0x5b93('0x4a')](_0xe1b870,'id'));}});}})[_0x5b93('0x19')](function(){if(_0x23acbf[_0x5b93('0x72')][_0x5b93('0x73')]===_0x5b93('0x74')&&!_0x6ef8ac&&!_0x23acbf[_0x5b93('0x2b')][_0x5b93('0x5b')])return[];return db[_0x5b93('0x78')][_0x5b93('0x2b')](_0xe08d0e[_0x5b93('0x79')](),_0x181c9f);})['then'](function(_0x3d86d1){_0x49389b[_0x5b93('0x7a')]=_0x3d86d1[_0x5b93('0x23')];if(_0x49389b[_0x5b93('0x7a')]===0x0)return[];return db['sequelize']['query'](_0x184777['toString'](),_0x181c9f)[_0x5b93('0x19')](function(_0x191b1b){_0x41d629=_['keyBy'](_0x191b1b,'id');_0x181c9f=_['merge'](_0x181c9f,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23acbf['query']['fields']){_0x50952e[_0x5b93('0x2e')][_0x5b93('0x4b')](function(_0x2d765c){_0x1532ff[_0x5b93('0x36')]('c.'+_0x2d765c);});}else{_0x1532ff[_0x5b93('0x36')]('c.id');_0x1532ff[_0x5b93('0x36')](_0x5b93('0x7b'));_0x1532ff[_0x5b93('0x36')]('c.lastName');_0x1532ff[_0x5b93('0x36')](_0x5b93('0x7c'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x7d'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x7e'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x7f'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x80'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x81'));_0x1532ff[_0x5b93('0x36')](_0x5b93('0x82'));_0x1532ff[_0x5b93('0x36')]('c.CompanyId');_0x1532ff[_0x5b93('0x36')](_0x5b93('0x83'),_0x5b93('0x84'));}if(_0x50952e[_0x5b93('0x15')])_0x1532ff[_0x5b93('0x15')](_0x50952e[_0x5b93('0x15')]);if(_0x50952e[_0x5b93('0x13')])_0x1532ff['offset'](_0x50952e[_0x5b93('0x13')]);return db[_0x5b93('0x78')][_0x5b93('0x2b')](_0x1532ff[_0x5b93('0x79')](),_0x181c9f);});})['then'](function(_0x58c57f){_0x58c57f[_0x5b93('0x4b')](function(_0x416a31){if(_0x416a31['TagIds']){_0x416a31[_0x5b93('0x85')]=[];_0x416a31[_0x5b93('0x84')][_0x5b93('0x49')](',')[_0x5b93('0x4b')](function(_0x5a0ac5){_0x416a31[_0x5b93('0x85')][_0x5b93('0x26')](_0x41d629[_0x5a0ac5]);});}delete _0x416a31[_0x5b93('0x84')];});_0x49389b[_0x5b93('0x86')]=_0x58c57f;return _0x49389b;})[_0x5b93('0x19')](respondWithFilteredResult(_0x281875,_0x50952e));})[_0x5b93('0x87')](handleError(_0x281875,null));};exports['destroy']=function(_0x108e17,_0xb27164){return db[_0x5b93('0x20')][_0x5b93('0x46')]({'where':{'id':_0x108e17['params']['id']}})[_0x5b93('0x19')](handleEntityNotFound(_0xb27164,null))[_0x5b93('0x19')](removeEntity(_0xb27164,null))[_0x5b93('0x87')](handleError(_0xb27164,null));};exports[_0x5b93('0x21')]=function(_0x397624,_0x15451d){return db['CmContact']['describe']()[_0x5b93('0x19')](function(_0x5ce578){delete _0x5ce578['tags'];for(var _0x5f2125=0x0;_0x5f2125{}\s\\|]/g,'-');_0x18ebb5(null,util[_0x9a04('0x21')](_0x9a04('0x22'),path['basename'](_0x5d3219[_0x9a04('0x1f')],path[_0x9a04('0x23')](_0x5d3219['originalname'])),Date['now'](),path[_0x9a04('0x23')](_0x5d3219[_0x9a04('0x1f')])));}})});router[_0x9a04('0x18')](_0x9a04('0x24'),upload['single'](_0x9a04('0x25')),controller[_0x9a04('0x26')]);var upload=multer({'storage':multer[_0x9a04('0x1d')]({'destination':function(_0x59eb1f,_0x50a1bb,_0x1ea65c){_0x1ea65c(null,path[_0x9a04('0x27')](config[_0x9a04('0x1e')],_0x9a04('0x28')));},'filename':function(_0x2ad3e6,_0x4c2efd,_0x585204){_0x4c2efd[_0x9a04('0x1f')]=_0x4c2efd[_0x9a04('0x1f')][_0x9a04('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x585204(null,util[_0x9a04('0x21')](_0x9a04('0x22'),path[_0x9a04('0x29')](_0x4c2efd[_0x9a04('0x1f')],path['extname'](_0x4c2efd[_0x9a04('0x1f')])),Date[_0x9a04('0x2a')](),path['extname'](_0x4c2efd[_0x9a04('0x1f')])));}})});router[_0x9a04('0x18')](_0x9a04('0x2b'),upload[_0x9a04('0x2c')](_0x9a04('0x25')),controller[_0x9a04('0x2d')]);router[_0x9a04('0x18')](_0x9a04('0x2e'),auth['isAuthenticated'](),controller['import']);router[_0x9a04('0x2f')](_0x9a04('0x30'),auth[_0x9a04('0x8')](),controller[_0x9a04('0x31')]);router[_0x9a04('0x32')](_0x9a04('0x30'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6cdb=['basename','now','extname','single','file','format','/upload','/upload/:id','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s'];(function(_0xf02f79,_0x486c8b){var _0x5ca5cd=function(_0x596631){while(--_0x596631){_0xf02f79['push'](_0xf02f79['shift']());}};_0x5ca5cd(++_0x486c8b);}(_0x6cdb,0x1eb));var _0xb6cd=function(_0x48715e,_0x103c9e){_0x48715e=_0x48715e-0x0;var _0x32a705=_0x6cdb[_0x48715e];return _0x32a705;};'use strict';var multer=require(_0xb6cd('0x0'));var util=require(_0xb6cd('0x1'));var path=require(_0xb6cd('0x2'));var timeout=require(_0xb6cd('0x3'));var express=require('express');var router=express[_0xb6cd('0x4')]();var fs_extra=require(_0xb6cd('0x5'));var auth=require(_0xb6cd('0x6'));var interaction=require(_0xb6cd('0x7'));var config=require(_0xb6cd('0x8'));var controller=require(_0xb6cd('0x9'));router[_0xb6cd('0xa')]('/',auth[_0xb6cd('0xb')](),controller[_0xb6cd('0xc')]);router[_0xb6cd('0xa')](_0xb6cd('0xd'),auth['isAuthenticated'](),controller[_0xb6cd('0xe')]);router[_0xb6cd('0xa')](_0xb6cd('0xf'),auth[_0xb6cd('0xb')](),controller['show']);router[_0xb6cd('0xa')](_0xb6cd('0x10'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x11')]);router[_0xb6cd('0xa')](_0xb6cd('0x12'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x13')]);router[_0xb6cd('0xa')]('/:id/hopper_histories',auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x14')]);router[_0xb6cd('0xa')]('/:id/hopper_finals',auth[_0xb6cd('0xb')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x15')]);router['get'](_0xb6cd('0x16'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x17')]);router[_0xb6cd('0x18')](_0xb6cd('0x19'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x1a')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb6cd('0x18')](_0xb6cd('0x1b'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x1c')]);router['post'](_0xb6cd('0x10'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x1d')]);var upload=multer({'storage':multer[_0xb6cd('0x1e')]({'destination':function(_0x229e96,_0x2cceb7,_0x56447f){_0x56447f(null,path[_0xb6cd('0x1f')](config[_0xb6cd('0x20')],_0xb6cd('0x21')));},'filename':function(_0x148837,_0x2851c2,_0x551db8){_0x2851c2[_0xb6cd('0x22')]=_0x2851c2['originalname'][_0xb6cd('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x551db8(null,util['format'](_0xb6cd('0x24'),path[_0xb6cd('0x25')](_0x2851c2[_0xb6cd('0x22')],path['extname'](_0x2851c2[_0xb6cd('0x22')])),Date[_0xb6cd('0x26')](),path[_0xb6cd('0x27')](_0x2851c2[_0xb6cd('0x22')])));}})});router[_0xb6cd('0x18')]('/csv',upload[_0xb6cd('0x28')](_0xb6cd('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xb6cd('0x1e')]({'destination':function(_0x4577f9,_0x366ede,_0xa3d2dc){_0xa3d2dc(null,path[_0xb6cd('0x1f')](config['root'],_0xb6cd('0x21')));},'filename':function(_0x2d2b4d,_0x1f8e96,_0x63513b){_0x1f8e96[_0xb6cd('0x22')]=_0x1f8e96[_0xb6cd('0x22')][_0xb6cd('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x63513b(null,util[_0xb6cd('0x2a')]('%s-%s%s',path[_0xb6cd('0x25')](_0x1f8e96[_0xb6cd('0x22')],path[_0xb6cd('0x27')](_0x1f8e96['originalname'])),Date['now'](),path[_0xb6cd('0x27')](_0x1f8e96['originalname'])));}})});router[_0xb6cd('0x18')](_0xb6cd('0x2b'),upload[_0xb6cd('0x28')](_0xb6cd('0x29')),controller['upload']);router[_0xb6cd('0x18')](_0xb6cd('0x2c'),auth[_0xb6cd('0xb')](),controller['import']);router[_0xb6cd('0x2d')](_0xb6cd('0xf'),auth[_0xb6cd('0xb')](),controller[_0xb6cd('0x2e')]);router[_0xb6cd('0x2f')](_0xb6cd('0xf'),auth[_0xb6cd('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 30d4e34..015e706 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 _0x53ff=['stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','values'];(function(_0x52f9e0,_0x19bef6){var _0x284efb=function(_0x173aef){while(--_0x173aef){_0x52f9e0['push'](_0x52f9e0['shift']());}};_0x284efb(++_0x19bef6);}(_0x53ff,0x145));var _0xf53f=function(_0x383a00,_0x1dcecf){_0x383a00=_0x383a00-0x0;var _0x582a75=_0x53ff[_0x383a00];return _0x582a75;};'use strict';var Sequelize=require(_0xf53f('0x0'));var _=require(_0xf53f('0x1'));module[_0xf53f('0x2')]={'name':{'type':Sequelize[_0xf53f('0x3')],'get':function(_0x13d601){return this[_0xf53f('0x4')](_0xf53f('0x5'));}},'alias':{'type':Sequelize[_0xf53f('0x6')],'allowNull':![],'set':function(_0x504a7c){this[_0xf53f('0x7')](_0xf53f('0x5'),_0x504a7c?_0x504a7c:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xf53f('0x8')](_0xf53f('0x9')),'get':function(){if(this[_0xf53f('0x4')]('type')==='select'){return JSON['parse'](this[_0xf53f('0x4')](_0xf53f('0xa')));}else{return this['getDataValue'](_0xf53f('0xa'));}},'set':function(_0x35e853){if(Array['isArray'](_0x35e853)){this[_0xf53f('0x7')]('values',JSON[_0xf53f('0xb')](_0x35e853));}else{this[_0xf53f('0x7')](_0xf53f('0xa'),_0x35e853);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf53f('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xf53f('0xd'))}}; \ No newline at end of file +var _0x0500=['exports','getDataValue','alias','STRING','name','TEXT','long','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0500,0x167));var _0x0050=function(_0x5ba341,_0xa35b53){_0x5ba341=_0x5ba341-0x0;var _0x5ecfe5=_0x0500[_0x5ba341];return _0x5ecfe5;};'use strict';var Sequelize=require(_0x0050('0x0'));var _=require(_0x0050('0x1'));module[_0x0050('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x162419){return this[_0x0050('0x3')](_0x0050('0x4'));}},'alias':{'type':Sequelize[_0x0050('0x5')],'allowNull':![],'set':function(_0x20aeff){this['setDataValue'](_0x0050('0x4'),_0x20aeff?_0x20aeff:this[_0x0050('0x3')](_0x0050('0x6')));}},'type':{'type':Sequelize[_0x0050('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x0050('0x7')](_0x0050('0x8')),'get':function(){if(this[_0x0050('0x3')](_0x0050('0x9'))===_0x0050('0xa')){return JSON[_0x0050('0xb')](this[_0x0050('0x3')](_0x0050('0xc')));}else{return this[_0x0050('0x3')]('values');}},'set':function(_0x5115b1){if(Array[_0x0050('0xd')](_0x5115b1)){this[_0x0050('0xe')](_0x0050('0xc'),JSON[_0x0050('0xf')](_0x5115b1));}else{this[_0x0050('0xe')](_0x0050('0xc'),_0x5115b1);}}},'required':{'type':Sequelize[_0x0050('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0050('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0050('0x11')](_0x0050('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4c2f356..48750e5 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 _0xbaf2=['end','undefined','limit','offset','count','Content-Range','apply','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','CmCustomField','includeAll','findAll','rows','show','params','length','find','catch','update','create','transaction','Sequelize','body','INTEGER','switch','BOOLEAN','defaultValue','sequelize','format','cf_%d','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xbaf2,0x1c3));var _0x2baf=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xbaf2[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0x2baf('0x0'));var rimraf=require(_0x2baf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2baf('0x2'));var moment=require(_0x2baf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2baf('0x4'));var util=require(_0x2baf('0x5'));var path=require('path');var sox=require(_0x2baf('0x6'));var csv=require(_0x2baf('0x7'));var ejs=require(_0x2baf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2baf('0x9'));var squel=require('squel');var crypto=require(_0x2baf('0xa'));var jsforce=require(_0x2baf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2baf('0x7'));var querystring=require(_0x2baf('0xc'));var Papa=require(_0x2baf('0xd'));var Redis=require(_0x2baf('0xe'));var authService=require(_0x2baf('0xf'));var qs=require(_0x2baf('0x10'));var as=require(_0x2baf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2baf('0x12'))(_0x2baf('0x13'));var utils=require(_0x2baf('0x14'));var config=require(_0x2baf('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2b9d,_0x2a03e0){_0x2a03e0=_0x2a03e0||0xcc;return function(_0x1e5a08){if(_0x1e5a08){return _0x3d2b9d['sendStatus'](_0x2a03e0);}return _0x3d2b9d[_0x2baf('0x16')](_0x2a03e0)[_0x2baf('0x17')]();};}function respondWithResult(_0x4e6570,_0x1b2189){_0x1b2189=_0x1b2189||0xc8;return function(_0x13f0ce){if(_0x13f0ce){return _0x4e6570[_0x2baf('0x16')](_0x1b2189)['json'](_0x13f0ce);}};}function respondWithFilteredResult(_0x1bfdaf,_0x304169){return function(_0x17cbf9){if(_0x17cbf9){var _0x6e9866=typeof _0x304169['offset']===_0x2baf('0x18')&&typeof _0x304169[_0x2baf('0x19')]===_0x2baf('0x18');var _0x3ff113=_0x17cbf9['count'];var _0xb670d3=_0x6e9866?0x0:_0x304169[_0x2baf('0x1a')];var _0x147467=_0x6e9866?_0x17cbf9[_0x2baf('0x1b')]:_0x304169[_0x2baf('0x1a')]+_0x304169[_0x2baf('0x19')];var _0xf48bf3;if(_0x147467>=_0x3ff113){_0x147467=_0x3ff113;_0xf48bf3=0xc8;}else{_0xf48bf3=0xce;}_0x1bfdaf[_0x2baf('0x16')](_0xf48bf3);return _0x1bfdaf['set'](_0x2baf('0x1c'),_0xb670d3+'-'+_0x147467+'/'+_0x3ff113)['json'](_0x17cbf9);}return null;};}function patchUpdates(_0x5e1eb1){return function(_0xc945){try{jsonpatch[_0x2baf('0x1d')](_0xc945,_0x5e1eb1,!![]);}catch(_0x330245){return BPromise['reject'](_0x330245);}return _0xc945[_0x2baf('0x1e')]();};}function saveUpdates(_0x597c56,_0x15c3ac){return function(_0x514dc7){if(_0x514dc7){return _0x514dc7['update'](_0x597c56)[_0x2baf('0x1f')](function(_0x502bff){return _0x502bff;});}return null;};}function removeEntity(_0x2efea2,_0x544986){return function(_0x231986){if(_0x231986){return _0x231986[_0x2baf('0x20')]()[_0x2baf('0x1f')](function(){_0x2efea2[_0x2baf('0x16')](0xcc)[_0x2baf('0x17')]();});}};}function handleEntityNotFound(_0x16bd66,_0x5460a3){return function(_0x54cb35){if(!_0x54cb35){_0x16bd66['sendStatus'](0x194);}return _0x54cb35;};}function handleError(_0x58e781,_0x3ec74e){_0x3ec74e=_0x3ec74e||0x1f4;return function(_0xe9258a){logger[_0x2baf('0x21')](_0xe9258a['stack']);if(_0xe9258a[_0x2baf('0x22')]){delete _0xe9258a[_0x2baf('0x22')];}_0x58e781[_0x2baf('0x16')](_0x3ec74e)[_0x2baf('0x23')](_0xe9258a);};}exports[_0x2baf('0x24')]=function(_0x5b4d32,_0x444e07){var _0x3f27c0={},_0x12a8aa={},_0x712d33={'count':0x0,'rows':[]};var _0x458a6f=_[_0x2baf('0x25')](db['CmCustomField'][_0x2baf('0x26')],function(_0x29a70e){return{'name':_0x29a70e[_0x2baf('0x27')],'type':_0x29a70e[_0x2baf('0x28')][_0x2baf('0x29')]};});_0x12a8aa['model']=_['differenceBy'](_[_0x2baf('0x25')](_0x458a6f,_0x2baf('0x22')),[_0x2baf('0x22')]);_0x12a8aa[_0x2baf('0x2a')]=_[_0x2baf('0x2b')](_0x5b4d32[_0x2baf('0x2a')]);_0x12a8aa[_0x2baf('0x2c')]=_[_0x2baf('0x2d')](_0x12a8aa[_0x2baf('0x2e')],_0x12a8aa[_0x2baf('0x2a')]);_0x3f27c0[_0x2baf('0x2f')]=_[_0x2baf('0x2d')](_0x12a8aa[_0x2baf('0x2e')],qs[_0x2baf('0x30')](_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x30')]));_0x3f27c0[_0x2baf('0x2f')]=_0x3f27c0[_0x2baf('0x2f')]['length']?_0x3f27c0[_0x2baf('0x2f')]:_0x12a8aa[_0x2baf('0x2e')];if(!_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x31')]('nolimit')){_0x3f27c0[_0x2baf('0x19')]=qs[_0x2baf('0x19')](_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x19')]);_0x3f27c0['offset']=qs[_0x2baf('0x1a')](_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x1a')]);}_0x3f27c0[_0x2baf('0x32')]=qs[_0x2baf('0x33')](_0x5b4d32[_0x2baf('0x2a')]['sort']);_0x3f27c0['where']=qs[_0x2baf('0x2c')](_[_0x2baf('0x34')](_0x5b4d32[_0x2baf('0x2a')],_0x12a8aa['filters']),_0x458a6f);if(_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x35')]){_0x3f27c0[_0x2baf('0x36')]=_['merge'](_0x3f27c0[_0x2baf('0x36')],{'$or':_[_0x2baf('0x25')](_0x458a6f,function(_0x2498db){if(_0x2498db['type']!==_0x2baf('0x37')){var _0x334c82={};_0x334c82[_0x2498db[_0x2baf('0x22')]]={'$like':'%'+_0x5b4d32[_0x2baf('0x2a')][_0x2baf('0x35')]+'%'};return _0x334c82;}})});}_0x3f27c0=_[_0x2baf('0x38')]({},_0x3f27c0,_0x5b4d32[_0x2baf('0x39')]);var _0x1d6a28={'where':_0x3f27c0[_0x2baf('0x36')]};return db[_0x2baf('0x3a')][_0x2baf('0x1b')](_0x1d6a28)[_0x2baf('0x1f')](function(_0x2693de){_0x712d33['count']=_0x2693de;if(_0x5b4d32['query'][_0x2baf('0x3b')]){_0x3f27c0['include']=[{'all':!![]}];}return db[_0x2baf('0x3a')][_0x2baf('0x3c')](_0x3f27c0);})['then'](function(_0x174563){_0x712d33[_0x2baf('0x3d')]=_0x174563;return _0x712d33;})[_0x2baf('0x1f')](respondWithFilteredResult(_0x444e07,_0x3f27c0))['catch'](handleError(_0x444e07,null));};exports[_0x2baf('0x3e')]=function(_0x6e5d47,_0x1ea6fd){var _0x4d2690={'raw':!![],'where':{'id':_0x6e5d47[_0x2baf('0x3f')]['id']}},_0x3d1135={};_0x3d1135['model']=_[_0x2baf('0x2b')](db[_0x2baf('0x3a')][_0x2baf('0x26')]);_0x3d1135[_0x2baf('0x2a')]=_[_0x2baf('0x2b')](_0x6e5d47[_0x2baf('0x2a')]);_0x3d1135[_0x2baf('0x2c')]=_[_0x2baf('0x2d')](_0x3d1135[_0x2baf('0x2e')],_0x3d1135[_0x2baf('0x2a')]);_0x4d2690[_0x2baf('0x2f')]=_[_0x2baf('0x2d')](_0x3d1135[_0x2baf('0x2e')],qs[_0x2baf('0x30')](_0x6e5d47['query'][_0x2baf('0x30')]));_0x4d2690['attributes']=_0x4d2690['attributes'][_0x2baf('0x40')]?_0x4d2690['attributes']:_0x3d1135[_0x2baf('0x2e')];if(_0x6e5d47[_0x2baf('0x2a')]['includeAll']){_0x4d2690['include']=[{'all':!![]}];}_0x4d2690=_[_0x2baf('0x38')]({},_0x4d2690,_0x6e5d47[_0x2baf('0x39')]);return db[_0x2baf('0x3a')][_0x2baf('0x41')](_0x4d2690)[_0x2baf('0x1f')](handleEntityNotFound(_0x1ea6fd,null))[_0x2baf('0x1f')](respondWithResult(_0x1ea6fd,null))[_0x2baf('0x42')](handleError(_0x1ea6fd,null));};exports[_0x2baf('0x43')]=function(_0x35ca70,_0x432df3){if(_0x35ca70['body']['id']){delete _0x35ca70['body']['id'];}return db[_0x2baf('0x3a')]['find']({'where':{'id':_0x35ca70[_0x2baf('0x3f')]['id']}})[_0x2baf('0x1f')](handleEntityNotFound(_0x432df3,null))[_0x2baf('0x1f')](saveUpdates(_0x35ca70['body'],null))['then'](respondWithResult(_0x432df3,null))[_0x2baf('0x42')](handleError(_0x432df3,null));};exports['destroy']=function(_0x16237f,_0x270d2c){return db[_0x2baf('0x3a')][_0x2baf('0x41')]({'where':{'id':_0x16237f['params']['id']}})[_0x2baf('0x1f')](handleEntityNotFound(_0x270d2c,null))['then'](removeEntity(_0x270d2c,null))['catch'](handleError(_0x270d2c,null));};exports[_0x2baf('0x44')]=function(_0x42e64e,_0x55e36b){var _0x1182dc;return db['sequelize'][_0x2baf('0x45')](function(_0x420a45){return db['CmCustomField'][_0x2baf('0x44')](_0x42e64e['body'],{'transaction':_0x420a45})[_0x2baf('0x1f')](function(_0x5aefb1){_0x1182dc=_0x5aefb1;var _0x3a7953={'type':db[_0x2baf('0x46')]['TEXT'],'transaction':_0x420a45};switch(_0x42e64e[_0x2baf('0x47')][_0x2baf('0x28')]){case'text':_0x3a7953['type']=db['Sequelize']['TEXT'];break;case'number':_0x3a7953[_0x2baf('0x28')]=db['Sequelize'][_0x2baf('0x48')];break;case _0x2baf('0x49'):_0x3a7953[_0x2baf('0x28')]=db[_0x2baf('0x46')][_0x2baf('0x4a')];_0x3a7953[_0x2baf('0x4b')]=![];break;default:}return db[_0x2baf('0x4c')]['queryInterface']['addColumn']('cm_contacts',util[_0x2baf('0x4d')](_0x2baf('0x4e'),_0x1182dc['id']),_0x3a7953);})[_0x2baf('0x1f')](function(){return _0x1182dc;});})['then'](respondWithResult(_0x55e36b,0xc9))['catch'](handleError(_0x55e36b,null));}; \ No newline at end of file +var _0xf3ca=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','find','body','params','create','transaction','Sequelize','TEXT','text','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2cc0f1,_0xd9d389){var _0x2fb1b6=function(_0x43e115){while(--_0x43e115){_0x2cc0f1['push'](_0x2cc0f1['shift']());}};_0x2fb1b6(++_0xd9d389);}(_0xf3ca,0x195));var _0xaf3c=function(_0x393ac2,_0x1ead24){_0x393ac2=_0x393ac2-0x0;var _0x5352e=_0xf3ca[_0x393ac2];return _0x5352e;};'use strict';var emlformat=require(_0xaf3c('0x0'));var rimraf=require(_0xaf3c('0x1'));var zipdir=require(_0xaf3c('0x2'));var jsonpatch=require(_0xaf3c('0x3'));var rp=require(_0xaf3c('0x4'));var moment=require(_0xaf3c('0x5'));var BPromise=require(_0xaf3c('0x6'));var Mustache=require(_0xaf3c('0x7'));var util=require(_0xaf3c('0x8'));var path=require(_0xaf3c('0x9'));var sox=require('sox');var csv=require(_0xaf3c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf3c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaf3c('0xc'));var jsforce=require(_0xaf3c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaf3c('0xa'));var querystring=require(_0xaf3c('0xe'));var Papa=require(_0xaf3c('0xf'));var Redis=require(_0xaf3c('0x10'));var authService=require(_0xaf3c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf3c('0x12'));var hardwareService=require(_0xaf3c('0x13'));var logger=require(_0xaf3c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xaf3c('0x15'));var licenseUtil=require(_0xaf3c('0x16'));var db=require(_0xaf3c('0x17'))['db'];function respondWithStatusCode(_0x5d5001,_0x41c728){_0x41c728=_0x41c728||0xcc;return function(_0x4e95a3){if(_0x4e95a3){return _0x5d5001[_0xaf3c('0x18')](_0x41c728);}return _0x5d5001[_0xaf3c('0x19')](_0x41c728)[_0xaf3c('0x1a')]();};}function respondWithResult(_0x47d29a,_0x4f3f64){_0x4f3f64=_0x4f3f64||0xc8;return function(_0x39f5b9){if(_0x39f5b9){return _0x47d29a[_0xaf3c('0x19')](_0x4f3f64)[_0xaf3c('0x1b')](_0x39f5b9);}};}function respondWithFilteredResult(_0x42ff63,_0x654dc8){return function(_0x3560e7){if(_0x3560e7){var _0x17e8f9=typeof _0x654dc8['offset']===_0xaf3c('0x1c')&&typeof _0x654dc8[_0xaf3c('0x1d')]===_0xaf3c('0x1c');var _0x5454bc=_0x3560e7[_0xaf3c('0x1e')];var _0x135d34=_0x17e8f9?0x0:_0x654dc8[_0xaf3c('0x1f')];var _0x2483e9=_0x17e8f9?_0x3560e7[_0xaf3c('0x1e')]:_0x654dc8[_0xaf3c('0x1f')]+_0x654dc8['limit'];var _0x4d5222;if(_0x2483e9>=_0x5454bc){_0x2483e9=_0x5454bc;_0x4d5222=0xc8;}else{_0x4d5222=0xce;}_0x42ff63[_0xaf3c('0x19')](_0x4d5222);return _0x42ff63[_0xaf3c('0x20')]('Content-Range',_0x135d34+'-'+_0x2483e9+'/'+_0x5454bc)[_0xaf3c('0x1b')](_0x3560e7);}return null;};}function patchUpdates(_0x1c0a25){return function(_0x294dd5){try{jsonpatch[_0xaf3c('0x21')](_0x294dd5,_0x1c0a25,!![]);}catch(_0x5cdc39){return BPromise[_0xaf3c('0x22')](_0x5cdc39);}return _0x294dd5[_0xaf3c('0x23')]();};}function saveUpdates(_0x2b0a84,_0x21c3bb){return function(_0x19c657){if(_0x19c657){return _0x19c657[_0xaf3c('0x24')](_0x2b0a84)[_0xaf3c('0x25')](function(_0xb32a94){return _0xb32a94;});}return null;};}function removeEntity(_0x1ba1c3,_0x270892){return function(_0x773f33){if(_0x773f33){return _0x773f33[_0xaf3c('0x26')]()[_0xaf3c('0x25')](function(){_0x1ba1c3[_0xaf3c('0x19')](0xcc)[_0xaf3c('0x1a')]();});}};}function handleEntityNotFound(_0x47071b,_0xa9ca89){return function(_0x3dc822){if(!_0x3dc822){_0x47071b[_0xaf3c('0x18')](0x194);}return _0x3dc822;};}function handleError(_0x30be37,_0x1ff435){_0x1ff435=_0x1ff435||0x1f4;return function(_0x1ce497){logger[_0xaf3c('0x27')](_0x1ce497[_0xaf3c('0x28')]);if(_0x1ce497[_0xaf3c('0x29')]){delete _0x1ce497[_0xaf3c('0x29')];}_0x30be37['status'](_0x1ff435)['send'](_0x1ce497);};}exports[_0xaf3c('0x2a')]=function(_0xfe4fe2,_0x1ecd16){var _0x23d2f0={},_0x116f66={},_0x2b311e={'count':0x0,'rows':[]};var _0x6d9507=_[_0xaf3c('0x2b')](db[_0xaf3c('0x2c')][_0xaf3c('0x2d')],function(_0x3de4f7){return{'name':_0x3de4f7[_0xaf3c('0x2e')],'type':_0x3de4f7[_0xaf3c('0x2f')][_0xaf3c('0x30')]};});_0x116f66[_0xaf3c('0x31')]=_[_0xaf3c('0x32')](_[_0xaf3c('0x2b')](_0x6d9507,'name'),[_0xaf3c('0x29')]);_0x116f66[_0xaf3c('0x33')]=_[_0xaf3c('0x34')](_0xfe4fe2[_0xaf3c('0x33')]);_0x116f66[_0xaf3c('0x35')]=_[_0xaf3c('0x36')](_0x116f66['model'],_0x116f66[_0xaf3c('0x33')]);_0x23d2f0[_0xaf3c('0x37')]=_[_0xaf3c('0x36')](_0x116f66[_0xaf3c('0x31')],qs[_0xaf3c('0x38')](_0xfe4fe2[_0xaf3c('0x33')]['fields']));_0x23d2f0[_0xaf3c('0x37')]=_0x23d2f0[_0xaf3c('0x37')]['length']?_0x23d2f0[_0xaf3c('0x37')]:_0x116f66['model'];if(!_0xfe4fe2[_0xaf3c('0x33')]['hasOwnProperty'](_0xaf3c('0x39'))){_0x23d2f0['limit']=qs[_0xaf3c('0x1d')](_0xfe4fe2[_0xaf3c('0x33')][_0xaf3c('0x1d')]);_0x23d2f0[_0xaf3c('0x1f')]=qs['offset'](_0xfe4fe2[_0xaf3c('0x33')][_0xaf3c('0x1f')]);}_0x23d2f0[_0xaf3c('0x3a')]=qs['sort'](_0xfe4fe2[_0xaf3c('0x33')][_0xaf3c('0x3b')]);_0x23d2f0[_0xaf3c('0x3c')]=qs[_0xaf3c('0x35')](_[_0xaf3c('0x3d')](_0xfe4fe2['query'],_0x116f66[_0xaf3c('0x35')]),_0x6d9507);if(_0xfe4fe2['query'][_0xaf3c('0x3e')]){_0x23d2f0[_0xaf3c('0x3c')]=_[_0xaf3c('0x3f')](_0x23d2f0[_0xaf3c('0x3c')],{'$or':_[_0xaf3c('0x2b')](_0x6d9507,function(_0x13881c){if(_0x13881c[_0xaf3c('0x2f')]!=='VIRTUAL'){var _0xe189bd={};_0xe189bd[_0x13881c[_0xaf3c('0x29')]]={'$like':'%'+_0xfe4fe2['query']['filter']+'%'};return _0xe189bd;}})});}_0x23d2f0=_[_0xaf3c('0x3f')]({},_0x23d2f0,_0xfe4fe2[_0xaf3c('0x40')]);var _0x33e43d={'where':_0x23d2f0['where']};return db[_0xaf3c('0x2c')][_0xaf3c('0x1e')](_0x33e43d)['then'](function(_0x2cde5c){_0x2b311e[_0xaf3c('0x1e')]=_0x2cde5c;if(_0xfe4fe2[_0xaf3c('0x33')][_0xaf3c('0x41')]){_0x23d2f0['include']=[{'all':!![]}];}return db[_0xaf3c('0x2c')][_0xaf3c('0x42')](_0x23d2f0);})[_0xaf3c('0x25')](function(_0x347786){_0x2b311e[_0xaf3c('0x43')]=_0x347786;return _0x2b311e;})['then'](respondWithFilteredResult(_0x1ecd16,_0x23d2f0))[_0xaf3c('0x44')](handleError(_0x1ecd16,null));};exports['show']=function(_0x2662d3,_0x1edc4f){var _0x575b06={'raw':!![],'where':{'id':_0x2662d3['params']['id']}},_0x1c193b={};_0x1c193b[_0xaf3c('0x31')]=_[_0xaf3c('0x34')](db[_0xaf3c('0x2c')]['rawAttributes']);_0x1c193b[_0xaf3c('0x33')]=_[_0xaf3c('0x34')](_0x2662d3[_0xaf3c('0x33')]);_0x1c193b[_0xaf3c('0x35')]=_[_0xaf3c('0x36')](_0x1c193b[_0xaf3c('0x31')],_0x1c193b[_0xaf3c('0x33')]);_0x575b06['attributes']=_[_0xaf3c('0x36')](_0x1c193b[_0xaf3c('0x31')],qs[_0xaf3c('0x38')](_0x2662d3[_0xaf3c('0x33')][_0xaf3c('0x38')]));_0x575b06[_0xaf3c('0x37')]=_0x575b06[_0xaf3c('0x37')]['length']?_0x575b06[_0xaf3c('0x37')]:_0x1c193b[_0xaf3c('0x31')];if(_0x2662d3['query'][_0xaf3c('0x41')]){_0x575b06['include']=[{'all':!![]}];}_0x575b06=_[_0xaf3c('0x3f')]({},_0x575b06,_0x2662d3[_0xaf3c('0x40')]);return db['CmCustomField'][_0xaf3c('0x45')](_0x575b06)['then'](handleEntityNotFound(_0x1edc4f,null))[_0xaf3c('0x25')](respondWithResult(_0x1edc4f,null))['catch'](handleError(_0x1edc4f,null));};exports[_0xaf3c('0x24')]=function(_0x53220f,_0x5bdff8){if(_0x53220f[_0xaf3c('0x46')]['id']){delete _0x53220f[_0xaf3c('0x46')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x53220f[_0xaf3c('0x47')]['id']}})[_0xaf3c('0x25')](handleEntityNotFound(_0x5bdff8,null))[_0xaf3c('0x25')](saveUpdates(_0x53220f[_0xaf3c('0x46')],null))[_0xaf3c('0x25')](respondWithResult(_0x5bdff8,null))[_0xaf3c('0x44')](handleError(_0x5bdff8,null));};exports[_0xaf3c('0x26')]=function(_0x5bf4e1,_0x49a148){return db['CmCustomField']['find']({'where':{'id':_0x5bf4e1[_0xaf3c('0x47')]['id']}})[_0xaf3c('0x25')](handleEntityNotFound(_0x49a148,null))[_0xaf3c('0x25')](removeEntity(_0x49a148,null))[_0xaf3c('0x44')](handleError(_0x49a148,null));};exports[_0xaf3c('0x48')]=function(_0x5724f2,_0x294848){var _0x5f0e8e;return db['sequelize'][_0xaf3c('0x49')](function(_0x7c56fd){return db[_0xaf3c('0x2c')]['create'](_0x5724f2[_0xaf3c('0x46')],{'transaction':_0x7c56fd})[_0xaf3c('0x25')](function(_0x47773f){_0x5f0e8e=_0x47773f;var _0x539398={'type':db[_0xaf3c('0x4a')][_0xaf3c('0x4b')],'transaction':_0x7c56fd};switch(_0x5724f2[_0xaf3c('0x46')][_0xaf3c('0x2f')]){case _0xaf3c('0x4c'):_0x539398['type']=db[_0xaf3c('0x4a')][_0xaf3c('0x4b')];break;case'number':_0x539398['type']=db['Sequelize']['INTEGER'];break;case _0xaf3c('0x4d'):_0x539398[_0xaf3c('0x2f')]=db[_0xaf3c('0x4a')]['BOOLEAN'];_0x539398[_0xaf3c('0x4e')]=![];break;default:}return db[_0xaf3c('0x4f')][_0xaf3c('0x50')][_0xaf3c('0x51')](_0xaf3c('0x52'),util[_0xaf3c('0x53')](_0xaf3c('0x54'),_0x5f0e8e['id']),_0x539398);})['then'](function(){return _0x5f0e8e;});})[_0xaf3c('0x25')](respondWithResult(_0x294848,0xc9))[_0xaf3c('0x44')](handleError(_0x294848,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0d4f8f2..164e3d8 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 _0x4593=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','util','../../config/logger','api'];(function(_0x13be43,_0x1261e8){var _0x2b5d2f=function(_0x4a979f){while(--_0x4a979f){_0x13be43['push'](_0x13be43['shift']());}};_0x2b5d2f(++_0x1261e8);}(_0x4593,0xd5));var _0x3459=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x4593[_0x359bbe];return _0x1b3353;};'use strict';var _=require('lodash');var util=require(_0x3459('0x0'));var logger=require(_0x3459('0x1'))(_0x3459('0x2'));var moment=require(_0x3459('0x3'));var BPromise=require(_0x3459('0x4'));var rp=require(_0x3459('0x5'));var fs=require('fs');var path=require(_0x3459('0x6'));var rimraf=require(_0x3459('0x7'));var config=require(_0x3459('0x8'));var attributes=require(_0x3459('0x9'));module['exports']=function(_0x46a751,_0x7114cc){return _0x46a751['define'](_0x3459('0xa'),attributes,{'tableName':_0x3459('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05bf=['CmCustomField','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0xaf2427,_0x504859){var _0x67addb=function(_0x14b655){while(--_0x14b655){_0xaf2427['push'](_0xaf2427['shift']());}};_0x67addb(++_0x504859);}(_0x05bf,0x17d));var _0xf05b=function(_0x213806,_0x86c4b2){_0x213806=_0x213806-0x0;var _0x56f901=_0x05bf[_0x213806];return _0x56f901;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var logger=require(_0xf05b('0x2'))('api');var moment=require(_0xf05b('0x3'));var BPromise=require('bluebird');var rp=require(_0xf05b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf05b('0x5'));var attributes=require(_0xf05b('0x6'));module[_0xf05b('0x7')]=function(_0x1c1f6f,_0x161ba5){return _0x1c1f6f[_0xf05b('0x8')](_0xf05b('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 77d0539..e67d5ab 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 _0x14cf=['request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x14cf,0xba));var _0xf14c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x14cf[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xf14c('0x0'));var util=require('util');var moment=require(_0xf14c('0x1'));var BPromise=require(_0xf14c('0x2'));var rs=require(_0xf14c('0x3'));var fs=require('fs');var Redis=require(_0xf14c('0x4'));var db=require(_0xf14c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf14c('0x6'))(_0xf14c('0x7'));var config=require(_0xf14c('0x8'));var jayson=require(_0xf14c('0x9'));var client=jayson[_0xf14c('0xa')][_0xf14c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cd319,_0x4943a9,_0x2ba1cb){return new BPromise(function(_0x5894c8,_0x42d534){return client[_0xf14c('0xc')](_0x1cd319,_0x2ba1cb)[_0xf14c('0xd')](function(_0x4083ae){logger[_0xf14c('0xe')](_0xf14c('0xf'),_0x4943a9,'request\x20sent');logger['debug'](_0xf14c('0x10'),_0x4943a9,'request\x20sent',JSON[_0xf14c('0x11')](_0x4083ae));if(_0x4083ae[_0xf14c('0x12')]){if(_0x4083ae[_0xf14c('0x12')][_0xf14c('0x13')]===0x1f4){logger[_0xf14c('0x12')]('CmCustomField,\x20%s,\x20%s',_0x4943a9,_0x4083ae[_0xf14c('0x12')][_0xf14c('0x14')]);return _0x42d534(_0x4083ae['error'][_0xf14c('0x14')]);}logger['error'](_0xf14c('0xf'),_0x4943a9,_0x4083ae[_0xf14c('0x12')][_0xf14c('0x14')]);return _0x5894c8(_0x4083ae[_0xf14c('0x12')][_0xf14c('0x14')]);}else{logger[_0xf14c('0xe')](_0xf14c('0xf'),_0x4943a9,_0xf14c('0x15'));_0x5894c8(_0x4083ae['result'][_0xf14c('0x14')]);}})[_0xf14c('0x16')](function(_0x5566eb){logger['error'](_0xf14c('0xf'),_0x4943a9,_0x5566eb);_0x42d534(_0x5566eb);});});} \ No newline at end of file +var _0x1cf3=['bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x361e80,_0x21c8dd){var _0x3c2f1f=function(_0x10df70){while(--_0x10df70){_0x361e80['push'](_0x361e80['shift']());}};_0x3c2f1f(++_0x21c8dd);}(_0x1cf3,0x1b6));var _0x31cf=function(_0x5366b9,_0x4b512d){_0x5366b9=_0x5366b9-0x0;var _0xce01df=_0x1cf3[_0x5366b9];return _0xce01df;};'use strict';var _=require(_0x31cf('0x0'));var util=require('util');var moment=require(_0x31cf('0x1'));var BPromise=require(_0x31cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31cf('0x3'));var db=require(_0x31cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31cf('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31cf('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa6f916,_0x5e778b,_0x2f9af4){return new BPromise(function(_0x2e191c,_0x21004f){return client[_0x31cf('0x7')](_0xa6f916,_0x2f9af4)[_0x31cf('0x8')](function(_0x57c73c){logger[_0x31cf('0x9')](_0x31cf('0xa'),_0x5e778b,_0x31cf('0xb'));logger[_0x31cf('0xc')](_0x31cf('0xd'),_0x5e778b,_0x31cf('0xb'),JSON[_0x31cf('0xe')](_0x57c73c));if(_0x57c73c['error']){if(_0x57c73c[_0x31cf('0xf')][_0x31cf('0x10')]===0x1f4){logger[_0x31cf('0xf')](_0x31cf('0xa'),_0x5e778b,_0x57c73c['error'][_0x31cf('0x11')]);return _0x21004f(_0x57c73c['error'][_0x31cf('0x11')]);}logger[_0x31cf('0xf')](_0x31cf('0xa'),_0x5e778b,_0x57c73c[_0x31cf('0xf')]['message']);return _0x2e191c(_0x57c73c[_0x31cf('0xf')][_0x31cf('0x11')]);}else{logger[_0x31cf('0x9')](_0x31cf('0xa'),_0x5e778b,'request\x20sent');_0x2e191c(_0x57c73c[_0x31cf('0x12')][_0x31cf('0x11')]);}})[_0x31cf('0x13')](function(_0x18c534){logger[_0x31cf('0xf')](_0x31cf('0xa'),_0x5e778b,_0x18c534);_0x21004f(_0x18c534);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0d4c69c..3a71309 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 _0x544f=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','update'];(function(_0x3b8a05,_0xe57766){var _0x1345c3=function(_0xae5862){while(--_0xae5862){_0x3b8a05['push'](_0x3b8a05['shift']());}};_0x1345c3(++_0xe57766);}(_0x544f,0x14c));var _0xf544=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x544f[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0xf544('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf544('0x1'));var express=require(_0xf544('0x2'));var router=express[_0xf544('0x3')]();var fs_extra=require(_0xf544('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf544('0x5'));var config=require(_0xf544('0x6'));var controller=require('./cmCustomField.controller');router[_0xf544('0x7')]('/',auth[_0xf544('0x8')](),controller['index']);router[_0xf544('0x7')](_0xf544('0x9'),auth[_0xf544('0x8')](),controller['show']);router[_0xf544('0xa')]('/',auth['isAuthenticated'](),controller[_0xf544('0xb')]);router['put'](_0xf544('0x9'),auth['isAuthenticated'](),controller[_0xf544('0xc')]);router['delete'](_0xf544('0x9'),auth[_0xf544('0x8')](),controller[_0xf544('0xd')]);module[_0xf544('0xe')]=router; \ No newline at end of file +var _0x34aa=['index','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x22e012,_0x48a505){var _0x5a6bf2=function(_0xc93ec2){while(--_0xc93ec2){_0x22e012['push'](_0x22e012['shift']());}};_0x5a6bf2(++_0x48a505);}(_0x34aa,0x171));var _0xa34a=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x34aa[_0x261522];return _0x98a25a;};'use strict';var multer=require(_0xa34a('0x0'));var util=require('util');var path=require(_0xa34a('0x1'));var timeout=require(_0xa34a('0x2'));var express=require(_0xa34a('0x3'));var router=express[_0xa34a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa34a('0x5'));var interaction=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var controller=require(_0xa34a('0x8'));router[_0xa34a('0x9')]('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xb')]);router[_0xa34a('0x9')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0xd')]);router['post']('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xe')]);router[_0xa34a('0xf')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller['update']);router[_0xa34a('0x10')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0x11')]);module[_0xa34a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 91b7327..4eaae87 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 _0x1a85=['exports','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x334604,_0x2ea84b){var _0x259674=function(_0x56c6a7){while(--_0x56c6a7){_0x334604['push'](_0x334604['shift']());}};_0x259674(++_0x2ea84b);}(_0x1a85,0x178));var _0x51a8=function(_0x5ea451,_0x133637){_0x5ea451=_0x5ea451-0x0;var _0x37a06a=_0x1a85[_0x5ea451];return _0x37a06a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x51a8('0x0')]={'phone':{'type':Sequelize[_0x51a8('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x51a8('0x3'))},'countbusyretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x51a8('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x51a8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x51a8('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x51a8('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x51a8('0x4')],'unique':_0x51a8('0x7')},'CampaignId':{'type':Sequelize[_0x51a8('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x51a8('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x51a8('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x51a8('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x9f0e=['sequelize','exports','STRING','BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x40d8fc,_0x7f3dd7){var _0x55971c=function(_0x1f5dcb){while(--_0x1f5dcb){_0x40d8fc['push'](_0x40d8fc['shift']());}};_0x55971c(++_0x7f3dd7);}(_0x9f0e,0x116));var _0xe9f0=function(_0xf462b3,_0x39b7d5){_0xf462b3=_0xf462b3-0x0;var _0x1f0e8e=_0x9f0e[_0xf462b3];return _0x1f0e8e;};'use strict';var moment=require(_0xe9f0('0x0'));var Sequelize=require(_0xe9f0('0x1'));module[_0xe9f0('0x2')]={'phone':{'type':Sequelize[_0xe9f0('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xe9f0('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xe9f0('0x5'))},'countbusyretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe9f0('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xe9f0('0x6')](0x2)[_0xe9f0('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe9f0('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe9f0('0x8')},'ListId':{'type':Sequelize[_0xe9f0('0x6')],'unique':_0xe9f0('0x8')},'UserId':{'type':Sequelize[_0xe9f0('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xe9f0('0x6')],'unique':_0xe9f0('0x8')},'CampaignId':{'type':Sequelize[_0xe9f0('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe9f0('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe9f0('0x3')]},'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 595b82c..62ca1f5 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 _0xb315=['keys','filters','intersection','model','concat','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','options','where','CmHopper','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','VoiceQueueId','VoiceQueue','CampaignId','omit','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','length','format','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','preview','transaction','hopperId','LOCK','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','getTimezone','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','query'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xb315,0x6f));var _0x5b31=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xb315[_0x5caf7e];return _0x5c3435;};'use strict';var emlformat=require(_0x5b31('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b31('0x1'));var rp=require(_0x5b31('0x2'));var moment=require(_0x5b31('0x3'));var BPromise=require(_0x5b31('0x4'));var Mustache=require('mustache');var util=require(_0x5b31('0x5'));var path=require(_0x5b31('0x6'));var sox=require(_0x5b31('0x7'));var csv=require(_0x5b31('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b31('0x9'));var _=require(_0x5b31('0xa'));var squel=require(_0x5b31('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b31('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5b31('0x8'));var querystring=require(_0x5b31('0xd'));var Papa=require(_0x5b31('0xe'));var Redis=require(_0x5b31('0xf'));var authService=require(_0x5b31('0x10'));var qs=require(_0x5b31('0x11'));var as=require(_0x5b31('0x12'));var hardwareService=require(_0x5b31('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5b31('0x14'));var shared=require('../../config/environment');var licenseUtil=require(_0x5b31('0x15'));var db=require(_0x5b31('0x16'))['db'];function respondWithStatusCode(_0x641d48,_0x221168){_0x221168=_0x221168||0xcc;return function(_0x7f12d){if(_0x7f12d){return _0x641d48[_0x5b31('0x17')](_0x221168);}return _0x641d48[_0x5b31('0x18')](_0x221168)['end']();};}function respondWithResult(_0x2b0cbd,_0x3fba58){_0x3fba58=_0x3fba58||0xc8;return function(_0xea0f76){if(_0xea0f76){return _0x2b0cbd[_0x5b31('0x18')](_0x3fba58)[_0x5b31('0x19')](_0xea0f76);}};}function respondWithFilteredResult(_0x24adab,_0x34dae0){return function(_0x160842){if(_0x160842){var _0x2010d3=typeof _0x34dae0[_0x5b31('0x1a')]===_0x5b31('0x1b')&&typeof _0x34dae0['limit']==='undefined';var _0x41f3a1=_0x160842[_0x5b31('0x1c')];var _0xb1d337=_0x2010d3?0x0:_0x34dae0[_0x5b31('0x1a')];var _0x3e875b=_0x2010d3?_0x160842['count']:_0x34dae0['offset']+_0x34dae0['limit'];var _0x45ac12;if(_0x3e875b>=_0x41f3a1){_0x3e875b=_0x41f3a1;_0x45ac12=0xc8;}else{_0x45ac12=0xce;}_0x24adab[_0x5b31('0x18')](_0x45ac12);return _0x24adab[_0x5b31('0x1d')]('Content-Range',_0xb1d337+'-'+_0x3e875b+'/'+_0x41f3a1)['json'](_0x160842);}return null;};}function patchUpdates(_0x59548c){return function(_0x109f2b){try{jsonpatch[_0x5b31('0x1e')](_0x109f2b,_0x59548c,!![]);}catch(_0x87da5b){return BPromise['reject'](_0x87da5b);}return _0x109f2b['save']();};}function saveUpdates(_0x454cdb,_0x2992b2){return function(_0x5bea9e){if(_0x5bea9e){return _0x5bea9e[_0x5b31('0x1f')](_0x454cdb)[_0x5b31('0x20')](function(_0x433714){return _0x433714;});}return null;};}function removeEntity(_0x2148e9,_0x5a866d){return function(_0x2893d9){if(_0x2893d9){return _0x2893d9[_0x5b31('0x21')]()[_0x5b31('0x20')](function(){_0x2148e9[_0x5b31('0x18')](0xcc)[_0x5b31('0x22')]();});}};}function handleEntityNotFound(_0xdb6a96,_0x160f65){return function(_0x5a3271){if(!_0x5a3271){_0xdb6a96[_0x5b31('0x17')](0x194);}return _0x5a3271;};}function handleError(_0x1f234f,_0x1304ab){_0x1304ab=_0x1304ab||0x1f4;return function(_0xf5792b){logger[_0x5b31('0x23')](_0xf5792b['stack']);if(_0xf5792b['name']){delete _0xf5792b[_0x5b31('0x24')];}_0x1f234f[_0x5b31('0x18')](_0x1304ab)[_0x5b31('0x25')](_0xf5792b);};}exports['index']=function(_0x5d1ba2,_0x35035d){var _0x1ee8a5={},_0x556561={},_0xda9640={'count':0x0,'rows':[]};var _0x1611ca=_[_0x5b31('0x26')](db['CmHopper'][_0x5b31('0x27')],function(_0x7b8779){return{'name':_0x7b8779[_0x5b31('0x28')],'type':_0x7b8779[_0x5b31('0x29')][_0x5b31('0x2a')]};});_0x556561['model']=_[_0x5b31('0x26')](_0x1611ca,'name');_0x556561[_0x5b31('0x2b')]=_[_0x5b31('0x2c')](_0x5d1ba2[_0x5b31('0x2b')]);_0x556561[_0x5b31('0x2d')]=_[_0x5b31('0x2e')](_0x556561[_0x5b31('0x2f')],_0x556561[_0x5b31('0x2b')]);_0x556561[_0x5b31('0x2d')]=_[_0x5b31('0x30')](_0x556561[_0x5b31('0x2d')],['$and',_0x5b31('0x31'),_0x5b31('0x32'),_0x5b31('0x33'),'$lt',_0x5b31('0x34'),_0x5b31('0x35'),_0x5b31('0x36'),'$not',_0x5b31('0x37'),_0x5b31('0x38'),_0x5b31('0x39'),_0x5b31('0x3a'),_0x5b31('0x3b'),_0x5b31('0x3c'),_0x5b31('0x3d'),'$notILike','$like',_0x5b31('0x3e'),_0x5b31('0x3f'),_0x5b31('0x40'),_0x5b31('0x41')]);_0x1ee8a5['attributes']=_[_0x5b31('0x2e')](_0x556561[_0x5b31('0x2f')],qs[_0x5b31('0x42')](_0x5d1ba2[_0x5b31('0x2b')][_0x5b31('0x42')]));_0x1ee8a5[_0x5b31('0x43')]=_0x1ee8a5['attributes']['length']?_0x1ee8a5[_0x5b31('0x43')]:_0x556561[_0x5b31('0x2f')];if(!_0x5d1ba2['query'][_0x5b31('0x44')](_0x5b31('0x45'))){_0x1ee8a5[_0x5b31('0x46')]=qs['limit'](_0x5d1ba2[_0x5b31('0x2b')][_0x5b31('0x46')]);_0x1ee8a5['offset']=qs[_0x5b31('0x1a')](_0x5d1ba2['query'][_0x5b31('0x1a')]);}_0x1ee8a5[_0x5b31('0x47')]=qs[_0x5b31('0x48')](_0x5d1ba2[_0x5b31('0x2b')][_0x5b31('0x48')]);_0x1ee8a5['where']=qs[_0x5b31('0x2d')](_[_0x5b31('0x49')](_0x5d1ba2[_0x5b31('0x2b')],_0x556561['filters']),_0x1611ca);if(_0x5d1ba2[_0x5b31('0x2b')][_0x5b31('0x4a')]){_0x1ee8a5['where']=_[_0x5b31('0x4b')](_0x1ee8a5['where'],{'$or':_[_0x5b31('0x26')](_0x1611ca,function(_0x3bdf98){if(_0x3bdf98['type']!==_0x5b31('0x4c')){var _0xad1449={};_0xad1449[_0x3bdf98['name']]={'$like':'%'+_0x5d1ba2['query'][_0x5b31('0x4a')]+'%'};return _0xad1449;}})});}_0x1ee8a5=_[_0x5b31('0x4b')]({},_0x1ee8a5,_0x5d1ba2[_0x5b31('0x4d')]);var _0x24d22c={'where':_0x1ee8a5[_0x5b31('0x4e')]};return db[_0x5b31('0x4f')]['count'](_0x24d22c)[_0x5b31('0x20')](function(_0x349a66){_0xda9640['count']=_0x349a66;if(_0x5d1ba2['query'][_0x5b31('0x50')]){_0x1ee8a5[_0x5b31('0x51')]=[{'all':!![]}];}return db[_0x5b31('0x4f')][_0x5b31('0x52')](_0x1ee8a5);})[_0x5b31('0x20')](function(_0xe19346){_0xda9640[_0x5b31('0x53')]=_0xe19346;return _0xda9640;})[_0x5b31('0x20')](respondWithFilteredResult(_0x35035d,_0x1ee8a5))[_0x5b31('0x54')](handleError(_0x35035d,null));};exports[_0x5b31('0x55')]=function(_0x5ccea3,_0x1ac981){var _0x657cbf={'raw':!![],'where':{'id':_0x5ccea3[_0x5b31('0x56')]['id']}},_0x27554c={};_0x27554c[_0x5b31('0x2f')]=_['keys'](db['CmHopper']['rawAttributes']);_0x27554c[_0x5b31('0x2b')]=_['keys'](_0x5ccea3[_0x5b31('0x2b')]);_0x27554c[_0x5b31('0x2d')]=_['intersection'](_0x27554c[_0x5b31('0x2f')],_0x27554c[_0x5b31('0x2b')]);_0x657cbf[_0x5b31('0x43')]=_[_0x5b31('0x2e')](_0x27554c[_0x5b31('0x2f')],qs[_0x5b31('0x42')](_0x5ccea3[_0x5b31('0x2b')][_0x5b31('0x42')]));_0x657cbf[_0x5b31('0x43')]=_0x657cbf[_0x5b31('0x43')]['length']?_0x657cbf[_0x5b31('0x43')]:_0x27554c['model'];if(_0x5ccea3['query']['includeAll']){_0x657cbf['include']=[{'all':!![]}];}_0x657cbf=_[_0x5b31('0x4b')]({},_0x657cbf,_0x5ccea3[_0x5b31('0x4d')]);return db[_0x5b31('0x4f')]['find'](_0x657cbf)[_0x5b31('0x20')](handleEntityNotFound(_0x1ac981,null))['then'](respondWithResult(_0x1ac981,null))[_0x5b31('0x54')](handleError(_0x1ac981,null));};exports[_0x5b31('0x57')]=function(_0x3a04ac,_0x42eae1){return db[_0x5b31('0x4f')][_0x5b31('0x57')](_0x3a04ac['body'],{})[_0x5b31('0x20')](respondWithResult(_0x42eae1,0xc9))[_0x5b31('0x54')](handleError(_0x42eae1,null));};exports[_0x5b31('0x1f')]=function(_0x20f383,_0x5e36e0){if(_0x20f383[_0x5b31('0x58')]['id']){delete _0x20f383['body']['id'];}return db[_0x5b31('0x4f')][_0x5b31('0x59')]({'where':{'id':_0x20f383[_0x5b31('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e36e0,null))[_0x5b31('0x20')](saveUpdates(_0x20f383[_0x5b31('0x58')],null))[_0x5b31('0x20')](respondWithResult(_0x5e36e0,null))[_0x5b31('0x54')](handleError(_0x5e36e0,null));};exports['describe']=function(_0x1fe2e7,_0x1394ca){return db['CmHopper'][_0x5b31('0x5a')]()[_0x5b31('0x20')](respondWithResult(_0x1394ca,null))[_0x5b31('0x54')](handleError(_0x1394ca,null));};exports[_0x5b31('0x21')]=function(_0x51138e,_0x699fbd){var _0x99e632;return db['CmHopper'][_0x5b31('0x59')]({'where':{'id':_0x51138e[_0x5b31('0x56')]['id']}})[_0x5b31('0x20')](handleEntityNotFound(_0x699fbd,null))['then'](function(_0x165b13){if(_0x165b13){return _0x165b13[_0x5b31('0x21')]()[_0x5b31('0x20')](function(_0x2510bc){return _0x2510bc;});}})[_0x5b31('0x20')](function(_0x563942){_0x99e632=_0x563942;if(_0x563942){if(_0x563942['VoiceQueueId']||_0x563942['CampaignId']){return db[_0x563942[_0x5b31('0x5b')]?_0x5b31('0x5c'):'Campaign'][_0x5b31('0x59')]({'where':{'id':_0x563942['VoiceQueueId']?_0x563942[_0x5b31('0x5b')]:_0x563942[_0x5b31('0x5d')]},'attributes':['id',_0x5b31('0x24')],'raw':!![]});}}})[_0x5b31('0x20')](function(_0x4e4ce8){var _0x2306a4={};if(_0x4e4ce8){_[_0x5b31('0x4b')](_0x2306a4,_[_0x5b31('0x5e')](_0x99e632['dataValues'],['createdAt',_0x5b31('0x5f'),'id']));_0x2306a4[_0x5b31('0x60')]=0x15;_0x2306a4['statedesc']=_0x5b31('0x61');_0x2306a4[_0x5b31('0x62')]=_0x4e4ce8[_0x5b31('0x24')];_0x2306a4[_0x5b31('0x63')]=_0x51138e[_0x5b31('0x64')][_0x5b31('0x24')];_0x2306a4[_0x5b31('0x65')]=_0x51138e['user']['id'];_0x2306a4[_0x5b31('0x61')]=!![];_0x2306a4[_0x5b31('0x66')]=moment()['format'](_0x5b31('0x67'));_0x2306a4[_0x5b31('0x68')]=_0x99e632[_0x5b31('0x69')];_0x2306a4[_0x5b31('0x6a')]=_0x99e632[_0x5b31('0x5b')]?_0x5b31('0x6b'):_0x5b31('0x6c');return db[_0x5b31('0x6d')]['find']({'where':{'id':_0x2306a4[_0x5b31('0x6e')]},'attributes':[_0x5b31('0x6f'),_0x5b31('0x70')]})[_0x5b31('0x20')](function(_0x1ce6b7){if(!_[_0x5b31('0x71')](_0x699fbd)&&!_[_0x5b31('0x71')](_0x1ce6b7[_0x5b31('0x6f')])){_0x2306a4['calleridname']=_0x1ce6b7['firstName'];if(!_[_0x5b31('0x71')](_0x1ce6b7[_0x5b31('0x70')])){_0x2306a4[_0x5b31('0x72')]+='\x20'+_0x1ce6b7[_0x5b31('0x70')];}}})['finally'](function(){return db[_0x5b31('0x73')][_0x5b31('0x57')](_0x2306a4);});}})['then'](function(){return _0x699fbd['status'](0xcc)['end']();})[_0x5b31('0x54')](handleError(_0x699fbd,null));};exports[_0x5b31('0x74')]=function(_0x3f042a,_0x1d69e5,_0x357a52){var _0x1737c4=[];return db['CmContact'][_0x5b31('0x5a')]()['then'](function(_0x34d244){_0x1737c4=_['keys'](_0x34d244);return _0x3f042a['user'][_0x5b31('0x75')]({'where':{'type':_0x5b31('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x5b31('0x77'),_0x5b31('0x78')],'raw':!![]});})['then'](function(_0x9146ad){if(_0x9146ad&&_0x9146ad[_0x5b31('0x79')]){return db['sequelize']['transaction'](function(_0x3e0503){var _0x34ace3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5b31('0x7a')](_0x5b31('0x67'))},'VoiceQueueId':{'$in':_[_0x5b31('0x26')](_0x9146ad,'id')},'$or':[{'UserId':null},{'UserId':_0x3f042a[_0x5b31('0x64')]['id']}]};var _0x4f127d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x9146ad)[_0x5b31('0x4a')]([_0x5b31('0x78'),0x0])['map']('id')[_0x5b31('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x3f042a['user']['id']}]};var _0x585ace={'$or':[_0x34ace3,_0x4f127d]};var _0x1db39b=[];if(_0x3f042a['body'][_0x5b31('0x7c')]&&_0x3f042a[_0x5b31('0x58')]['direction']==='prev'){if(!_[_0x5b31('0x7d')](_0x3f042a['body'][_0x5b31('0x7e')])){_0x585ace['id']={'$in':_0x3f042a['body']['hopperIds']};}_0x1db39b=[[_0x5b31('0x7f'),_0x5b31('0x80')],[_0x5b31('0x81'),_0x9146ad[0x0]['dialOrderByScheduledAt']===_0x5b31('0x80')?_0x5b31('0x82'):_0x5b31('0x80')],db[_0x5b31('0x83')][_0x5b31('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5b31('0x82')]];}else{if(!_['isEmpty'](_0x3f042a['body'][_0x5b31('0x7e')])){_0x585ace['id']={'$notIn':_0x3f042a[_0x5b31('0x58')][_0x5b31('0x7e')]};}_0x1db39b=[[_0x5b31('0x7f'),_0x5b31('0x82')],[_0x5b31('0x81'),_0x9146ad[0x0]['dialOrderByScheduledAt']],db[_0x5b31('0x83')][_0x5b31('0x84')](_0x5b31('0x85')),['id',_0x5b31('0x80')]];}return db[_0x5b31('0x4f')][_0x5b31('0x86')]({'attributes':['id',_0x5b31('0x87'),_0x5b31('0x88')],'where':_0x585ace,'order':_0x1db39b,'transaction':_0x3e0503,'lock':_0x3e0503['LOCK'][_0x5b31('0x89')],'include':[{'model':db[_0x5b31('0x6d')],'as':_0x5b31('0x8a'),'attributes':_0x1737c4,'include':[{'model':db[_0x5b31('0x8b')],'as':_0x5b31('0x8c'),'attributes':['id',_0x5b31('0x24')]}]},{'model':db['CmList'],'as':_0x5b31('0x8d'),'attributes':['id',_0x5b31('0x24')]},{'model':db[_0x5b31('0x5c')],'as':_0x5b31('0x8e'),'attributes':['id',_0x5b31('0x24'),_0x5b31('0x8f')]}]})[_0x5b31('0x20')](function(_0x1c12a0){if(_0x1c12a0){return _0x1c12a0['update']({'UserId':_0x3f042a[_0x5b31('0x64')]['id']},{'transaction':_0x3e0503});}});});}})[_0x5b31('0x20')](handleEntityNotFound(_0x1d69e5,null))[_0x5b31('0x20')](respondWithResult(_0x1d69e5,null))[_0x5b31('0x54')](handleError(_0x1d69e5,null));};exports['getPreviewRecall']=function(_0x5acbf1,_0x3d8e21,_0x2c4d94){var _0x450ca2=[];return db[_0x5b31('0x6d')]['describe']()['then'](function(_0x223505){_0x450ca2=_['keys'](_0x223505);return _0x5acbf1[_0x5b31('0x64')]['getVoiceQueues']({'where':{'type':_0x5b31('0x76'),'dialActive':!![],'dialMethod':_0x5b31('0x90')},'attributes':['id',_0x5b31('0x77'),_0x5b31('0x78')],'raw':!![]});})[_0x5b31('0x20')](function(_0x4dfc7f){if(_0x4dfc7f&&_0x4dfc7f[_0x5b31('0x79')]){return db[_0x5b31('0x83')][_0x5b31('0x91')](function(_0x3e5b2c){var _0x1c48f2={'active':![],'recallme':!![],'id':_0x5acbf1[_0x5b31('0x58')][_0x5b31('0x92')]};return db[_0x5b31('0x4f')][_0x5b31('0x86')]({'attributes':['id',_0x5b31('0x87'),'recallme'],'where':_0x1c48f2,'transaction':_0x3e5b2c,'lock':_0x3e5b2c[_0x5b31('0x93')][_0x5b31('0x89')],'include':[{'model':db[_0x5b31('0x6d')],'as':'Contact','attributes':_0x450ca2,'include':[{'model':db[_0x5b31('0x8b')],'as':_0x5b31('0x8c'),'attributes':['id',_0x5b31('0x24')]}]},{'model':db[_0x5b31('0x94')],'as':_0x5b31('0x8d'),'attributes':['id','name']},{'model':db[_0x5b31('0x5c')],'as':_0x5b31('0x8e'),'attributes':['id',_0x5b31('0x24'),'dialActive']}]})[_0x5b31('0x20')](function(_0x284ad){if(_0x284ad){return _0x284ad['update']({'UserId':_0x5acbf1[_0x5b31('0x64')]['id']},{'transaction':_0x3e5b2c});}});});}})[_0x5b31('0x20')](handleEntityNotFound(_0x3d8e21,null))[_0x5b31('0x20')](respondWithResult(_0x3d8e21,null))[_0x5b31('0x54')](handleError(_0x3d8e21,null));};exports[_0x5b31('0x95')]=function(_0x3889f6,_0x59dd8a,_0x2f1724){return _0x3889f6['user'][_0x5b31('0x75')]({'where':{'type':_0x5b31('0x76'),'dialActive':!![],'dialMethod':_0x5b31('0x90')},'attributes':['id'],'raw':!![]})[_0x5b31('0x20')](function(_0x7af008){if(_0x7af008&&_0x7af008[_0x5b31('0x79')]){return db[_0x5b31('0x4f')][_0x5b31('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5b31('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5b31('0x26')](_0x7af008,'id')},'$or':[{'UserId':null},{'UserId':_0x3889f6['user']['id']}]}});}return 0x0;})[_0x5b31('0x20')](function(_0x25b474){if(!_[_0x5b31('0x71')](_0x25b474)&&_[_0x5b31('0x96')](_0x25b474)){return _0x59dd8a[_0x5b31('0x18')](0xc8)[_0x5b31('0x19')]({'contacts':_0x25b474});}else{logger[_0x5b31('0x23')](_0x5b31('0x97'),_0x5b31('0x95'),0x194,'entity\x20not\x20found');_0x59dd8a[_0x5b31('0x17')](0x194);}})[_0x5b31('0x54')](handleError(_0x59dd8a,null));};exports['getTimezones']=function(_0x598830,_0x308e50,_0x52418a){var _0x4a594f=shared[_0x5b31('0x98')];var _0x30f02b=[];_[_0x5b31('0x26')](_0x4a594f,function(_0x49ff7c){_0x30f02b[_0x5b31('0x99')]({'id':_0x49ff7c['name'],'name':_0x49ff7c[_0x5b31('0x24')],'utcOffset':_0x49ff7c['utcOffset']});});return _0x308e50[_0x5b31('0x18')](0xc8)[_0x5b31('0x19')]({'tz':_0x30f02b});};exports[_0x5b31('0x9a')]=function(_0x5451d2,_0x33e0c5,_0x26413b){var _0x3cb460=shared['timezones'];var _0x18bcdf={};if(!_[_0x5b31('0x71')](_0x3cb460[_0x5451d2['body']['id']]))_0x18bcdf=_0x3cb460[_0x5451d2['body']['id']];return _0x33e0c5[_0x5b31('0x18')](0xc8)[_0x5b31('0x19')](_0x18bcdf);}; \ No newline at end of file +var _0xc389=['campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','ivr','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList','List','dialActive','getPreviewRecall','hopperId','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','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','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','CmHopper','fieldName','key','model','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$eq','$between','$in','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','create','body','find','params','describe','CampaignId','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted'];(function(_0x42926e,_0x5e5295){var _0x302fec=function(_0x19ea54){while(--_0x19ea54){_0x42926e['push'](_0x42926e['shift']());}};_0x302fec(++_0x5e5295);}(_0xc389,0x180));var _0x9c38=function(_0xd95fc,_0x542ccd){_0xd95fc=_0xd95fc-0x0;var _0x40e106=_0xc389[_0xd95fc];return _0x40e106;};'use strict';var emlformat=require(_0x9c38('0x0'));var rimraf=require(_0x9c38('0x1'));var zipdir=require(_0x9c38('0x2'));var jsonpatch=require(_0x9c38('0x3'));var rp=require(_0x9c38('0x4'));var moment=require(_0x9c38('0x5'));var BPromise=require(_0x9c38('0x6'));var Mustache=require(_0x9c38('0x7'));var util=require(_0x9c38('0x8'));var path=require(_0x9c38('0x9'));var sox=require(_0x9c38('0xa'));var csv=require(_0x9c38('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c38('0xc'));var _=require(_0x9c38('0xd'));var squel=require(_0x9c38('0xe'));var crypto=require(_0x9c38('0xf'));var jsforce=require(_0x9c38('0x10'));var deskjs=require(_0x9c38('0x11'));var toCsv=require(_0x9c38('0xb'));var querystring=require(_0x9c38('0x12'));var Papa=require(_0x9c38('0x13'));var Redis=require(_0x9c38('0x14'));var authService=require(_0x9c38('0x15'));var qs=require(_0x9c38('0x16'));var as=require(_0x9c38('0x17'));var hardwareService=require(_0x9c38('0x18'));var logger=require(_0x9c38('0x19'))(_0x9c38('0x1a'));var utils=require(_0x9c38('0x1b'));var config=require(_0x9c38('0x1c'));var shared=require(_0x9c38('0x1c'));var licenseUtil=require(_0x9c38('0x1d'));var db=require(_0x9c38('0x1e'))['db'];function respondWithStatusCode(_0x28dbef,_0x44a8ef){_0x44a8ef=_0x44a8ef||0xcc;return function(_0xc09ab3){if(_0xc09ab3){return _0x28dbef[_0x9c38('0x1f')](_0x44a8ef);}return _0x28dbef[_0x9c38('0x20')](_0x44a8ef)['end']();};}function respondWithResult(_0xe1f4bb,_0x13c4fe){_0x13c4fe=_0x13c4fe||0xc8;return function(_0x220564){if(_0x220564){return _0xe1f4bb[_0x9c38('0x20')](_0x13c4fe)['json'](_0x220564);}};}function respondWithFilteredResult(_0x20e697,_0x1c4283){return function(_0x491c8e){if(_0x491c8e){var _0x1e250b=typeof _0x1c4283[_0x9c38('0x21')]===_0x9c38('0x22')&&typeof _0x1c4283['limit']===_0x9c38('0x22');var _0x36fede=_0x491c8e[_0x9c38('0x23')];var _0x957189=_0x1e250b?0x0:_0x1c4283['offset'];var _0x3855fa=_0x1e250b?_0x491c8e['count']:_0x1c4283[_0x9c38('0x21')]+_0x1c4283[_0x9c38('0x24')];var _0x462bc4;if(_0x3855fa>=_0x36fede){_0x3855fa=_0x36fede;_0x462bc4=0xc8;}else{_0x462bc4=0xce;}_0x20e697[_0x9c38('0x20')](_0x462bc4);return _0x20e697[_0x9c38('0x25')](_0x9c38('0x26'),_0x957189+'-'+_0x3855fa+'/'+_0x36fede)[_0x9c38('0x27')](_0x491c8e);}return null;};}function patchUpdates(_0x504b0b){return function(_0x3ed1b9){try{jsonpatch['apply'](_0x3ed1b9,_0x504b0b,!![]);}catch(_0x5b478b){return BPromise[_0x9c38('0x28')](_0x5b478b);}return _0x3ed1b9[_0x9c38('0x29')]();};}function saveUpdates(_0x133c2a,_0x998fc6){return function(_0xa56bf1){if(_0xa56bf1){return _0xa56bf1[_0x9c38('0x2a')](_0x133c2a)[_0x9c38('0x2b')](function(_0x4112c4){return _0x4112c4;});}return null;};}function removeEntity(_0x3c3eb5,_0x252d3d){return function(_0x2cacb5){if(_0x2cacb5){return _0x2cacb5[_0x9c38('0x2c')]()['then'](function(){_0x3c3eb5[_0x9c38('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff28d2,_0x1f9ff8){return function(_0x50981){if(!_0x50981){_0xff28d2[_0x9c38('0x1f')](0x194);}return _0x50981;};}function handleError(_0xd470e6,_0x18d397){_0x18d397=_0x18d397||0x1f4;return function(_0x49f32d){logger[_0x9c38('0x2d')](_0x49f32d[_0x9c38('0x2e')]);if(_0x49f32d[_0x9c38('0x2f')]){delete _0x49f32d[_0x9c38('0x2f')];}_0xd470e6[_0x9c38('0x20')](_0x18d397)['send'](_0x49f32d);};}exports[_0x9c38('0x30')]=function(_0x49ad3c,_0x58ebfe){var _0x57d75b={},_0x12a337={},_0x3f9155={'count':0x0,'rows':[]};var _0xe17595=_[_0x9c38('0x31')](db[_0x9c38('0x32')]['rawAttributes'],function(_0x35840f){return{'name':_0x35840f[_0x9c38('0x33')],'type':_0x35840f['type'][_0x9c38('0x34')]};});_0x12a337[_0x9c38('0x35')]=_['map'](_0xe17595,_0x9c38('0x2f'));_0x12a337[_0x9c38('0x36')]=_[_0x9c38('0x37')](_0x49ad3c[_0x9c38('0x36')]);_0x12a337[_0x9c38('0x38')]=_['intersection'](_0x12a337[_0x9c38('0x35')],_0x12a337['query']);_0x12a337['filters']=_[_0x9c38('0x39')](_0x12a337[_0x9c38('0x38')],[_0x9c38('0x3a'),_0x9c38('0x3b'),_0x9c38('0x3c'),_0x9c38('0x3d'),_0x9c38('0x3e'),'$lte','$ne',_0x9c38('0x3f'),'$not',_0x9c38('0x40'),'$notBetween',_0x9c38('0x41'),'$notIn',_0x9c38('0x42'),_0x9c38('0x43'),'$iLike',_0x9c38('0x44'),_0x9c38('0x42'),_0x9c38('0x45'),_0x9c38('0x46'),_0x9c38('0x47'),_0x9c38('0x48')]);_0x57d75b[_0x9c38('0x49')]=_[_0x9c38('0x4a')](_0x12a337[_0x9c38('0x35')],qs['fields'](_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x4b')]));_0x57d75b['attributes']=_0x57d75b[_0x9c38('0x49')][_0x9c38('0x4c')]?_0x57d75b[_0x9c38('0x49')]:_0x12a337[_0x9c38('0x35')];if(!_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x4d')](_0x9c38('0x4e'))){_0x57d75b[_0x9c38('0x24')]=qs[_0x9c38('0x24')](_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x24')]);_0x57d75b[_0x9c38('0x21')]=qs[_0x9c38('0x21')](_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x21')]);}_0x57d75b[_0x9c38('0x4f')]=qs[_0x9c38('0x50')](_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x50')]);_0x57d75b[_0x9c38('0x51')]=qs[_0x9c38('0x38')](_[_0x9c38('0x52')](_0x49ad3c['query'],_0x12a337['filters']),_0xe17595);if(_0x49ad3c[_0x9c38('0x36')]['filter']){_0x57d75b[_0x9c38('0x51')]=_[_0x9c38('0x53')](_0x57d75b[_0x9c38('0x51')],{'$or':_[_0x9c38('0x31')](_0xe17595,function(_0x5184bc){if(_0x5184bc[_0x9c38('0x54')]!=='VIRTUAL'){var _0x12fd00={};_0x12fd00[_0x5184bc[_0x9c38('0x2f')]]={'$like':'%'+_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x55')]+'%'};return _0x12fd00;}})});}_0x57d75b=_[_0x9c38('0x53')]({},_0x57d75b,_0x49ad3c['options']);var _0x2aafd1={'where':_0x57d75b[_0x9c38('0x51')]};return db['CmHopper'][_0x9c38('0x23')](_0x2aafd1)[_0x9c38('0x2b')](function(_0x255d4c){_0x3f9155[_0x9c38('0x23')]=_0x255d4c;if(_0x49ad3c[_0x9c38('0x36')][_0x9c38('0x56')]){_0x57d75b[_0x9c38('0x57')]=[{'all':!![]}];}return db[_0x9c38('0x32')]['findAll'](_0x57d75b);})[_0x9c38('0x2b')](function(_0x51a0d6){_0x3f9155[_0x9c38('0x58')]=_0x51a0d6;return _0x3f9155;})[_0x9c38('0x2b')](respondWithFilteredResult(_0x58ebfe,_0x57d75b))[_0x9c38('0x59')](handleError(_0x58ebfe,null));};exports[_0x9c38('0x5a')]=function(_0xaa73f0,_0x49f9ed){var _0x75dce8={'raw':!![],'where':{'id':_0xaa73f0['params']['id']}},_0x4ce9af={};_0x4ce9af[_0x9c38('0x35')]=_[_0x9c38('0x37')](db['CmHopper']['rawAttributes']);_0x4ce9af['query']=_[_0x9c38('0x37')](_0xaa73f0[_0x9c38('0x36')]);_0x4ce9af[_0x9c38('0x38')]=_[_0x9c38('0x4a')](_0x4ce9af[_0x9c38('0x35')],_0x4ce9af['query']);_0x75dce8['attributes']=_[_0x9c38('0x4a')](_0x4ce9af[_0x9c38('0x35')],qs['fields'](_0xaa73f0['query'][_0x9c38('0x4b')]));_0x75dce8[_0x9c38('0x49')]=_0x75dce8[_0x9c38('0x49')][_0x9c38('0x4c')]?_0x75dce8[_0x9c38('0x49')]:_0x4ce9af[_0x9c38('0x35')];if(_0xaa73f0[_0x9c38('0x36')][_0x9c38('0x56')]){_0x75dce8[_0x9c38('0x57')]=[{'all':!![]}];}_0x75dce8=_[_0x9c38('0x53')]({},_0x75dce8,_0xaa73f0['options']);return db['CmHopper']['find'](_0x75dce8)[_0x9c38('0x2b')](handleEntityNotFound(_0x49f9ed,null))[_0x9c38('0x2b')](respondWithResult(_0x49f9ed,null))[_0x9c38('0x59')](handleError(_0x49f9ed,null));};exports[_0x9c38('0x5b')]=function(_0x52edb4,_0x3f683c){return db[_0x9c38('0x32')]['create'](_0x52edb4[_0x9c38('0x5c')],{})[_0x9c38('0x2b')](respondWithResult(_0x3f683c,0xc9))[_0x9c38('0x59')](handleError(_0x3f683c,null));};exports['update']=function(_0x31cc72,_0x2aa69e){if(_0x31cc72[_0x9c38('0x5c')]['id']){delete _0x31cc72['body']['id'];}return db[_0x9c38('0x32')][_0x9c38('0x5d')]({'where':{'id':_0x31cc72[_0x9c38('0x5e')]['id']}})[_0x9c38('0x2b')](handleEntityNotFound(_0x2aa69e,null))[_0x9c38('0x2b')](saveUpdates(_0x31cc72[_0x9c38('0x5c')],null))['then'](respondWithResult(_0x2aa69e,null))[_0x9c38('0x59')](handleError(_0x2aa69e,null));};exports[_0x9c38('0x5f')]=function(_0x525b7c,_0x239ef6){return db[_0x9c38('0x32')][_0x9c38('0x5f')]()[_0x9c38('0x2b')](respondWithResult(_0x239ef6,null))[_0x9c38('0x59')](handleError(_0x239ef6,null));};exports[_0x9c38('0x2c')]=function(_0x3b22cc,_0x180ef0){var _0x170210;return db[_0x9c38('0x32')]['find']({'where':{'id':_0x3b22cc[_0x9c38('0x5e')]['id']}})[_0x9c38('0x2b')](handleEntityNotFound(_0x180ef0,null))[_0x9c38('0x2b')](function(_0x106449){if(_0x106449){return _0x106449[_0x9c38('0x2c')]()[_0x9c38('0x2b')](function(_0x496eb7){return _0x496eb7;});}})[_0x9c38('0x2b')](function(_0x4ad85f){_0x170210=_0x4ad85f;if(_0x4ad85f){if(_0x4ad85f['VoiceQueueId']||_0x4ad85f[_0x9c38('0x60')]){return db[_0x4ad85f[_0x9c38('0x61')]?'VoiceQueue':'Campaign']['find']({'where':{'id':_0x4ad85f[_0x9c38('0x61')]?_0x4ad85f[_0x9c38('0x61')]:_0x4ad85f['CampaignId']},'attributes':['id',_0x9c38('0x2f')],'raw':!![]});}}})[_0x9c38('0x2b')](function(_0x4f9bf3){var _0x5b3500={};if(_0x4f9bf3){_[_0x9c38('0x53')](_0x5b3500,_[_0x9c38('0x62')](_0x170210[_0x9c38('0x63')],[_0x9c38('0x64'),_0x9c38('0x65'),'id']));_0x5b3500[_0x9c38('0x66')]=0x15;_0x5b3500[_0x9c38('0x67')]=_0x9c38('0x68');_0x5b3500[_0x9c38('0x69')]=_0x4f9bf3[_0x9c38('0x2f')];_0x5b3500[_0x9c38('0x6a')]=_0x3b22cc[_0x9c38('0x6b')][_0x9c38('0x2f')];_0x5b3500[_0x9c38('0x6c')]=_0x3b22cc[_0x9c38('0x6b')]['id'];_0x5b3500[_0x9c38('0x68')]=!![];_0x5b3500[_0x9c38('0x6d')]=moment()[_0x9c38('0x6e')](_0x9c38('0x6f'));_0x5b3500[_0x9c38('0x70')]=_0x170210['phone'];_0x5b3500[_0x9c38('0x71')]=_0x170210[_0x9c38('0x61')]?'queue':_0x9c38('0x72');return db['CmContact'][_0x9c38('0x5d')]({'where':{'id':_0x5b3500['ContactId']},'attributes':['firstName','lastName']})[_0x9c38('0x2b')](function(_0xa48099){if(!_[_0x9c38('0x73')](_0x180ef0)&&!_[_0x9c38('0x73')](_0xa48099[_0x9c38('0x74')])){_0x5b3500[_0x9c38('0x75')]=_0xa48099[_0x9c38('0x74')];if(!_['isNil'](_0xa48099[_0x9c38('0x76')])){_0x5b3500['calleridname']+='\x20'+_0xa48099[_0x9c38('0x76')];}}})[_0x9c38('0x77')](function(){return db[_0x9c38('0x78')]['create'](_0x5b3500);});}})['then'](function(){return _0x180ef0[_0x9c38('0x20')](0xcc)['end']();})['catch'](handleError(_0x180ef0,null));};exports[_0x9c38('0x79')]=function(_0xd2b98e,_0x8754bd,_0x1865b0){var _0x1fcd9a=[];return db[_0x9c38('0x7a')]['describe']()['then'](function(_0x5bcca5){_0x1fcd9a=_[_0x9c38('0x37')](_0x5bcca5);return _0xd2b98e[_0x9c38('0x6b')][_0x9c38('0x7b')]({'where':{'type':_0x9c38('0x7c'),'dialActive':!![],'dialMethod':_0x9c38('0x7d')},'attributes':['id','dialOrderByScheduledAt',_0x9c38('0x7e')],'raw':!![]});})[_0x9c38('0x2b')](function(_0x1980d2){if(_0x1980d2&&_0x1980d2[_0x9c38('0x4c')]){return db[_0x9c38('0x7f')][_0x9c38('0x80')](function(_0x5a6112){var _0x18fb1e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c38('0x6e')](_0x9c38('0x6f'))},'VoiceQueueId':{'$in':_[_0x9c38('0x31')](_0x1980d2,'id')},'$or':[{'UserId':null},{'UserId':_0xd2b98e[_0x9c38('0x6b')]['id']}]};var _0x2b5b5f={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1980d2)['filter']([_0x9c38('0x7e'),0x0])['map']('id')[_0x9c38('0x81')]()},'$or':[{'UserId':null},{'UserId':_0xd2b98e['user']['id']}]};var _0x87c3e3={'$or':[_0x18fb1e,_0x2b5b5f]};var _0x53e10a=[];if(_0xd2b98e['body'][_0x9c38('0x82')]&&_0xd2b98e['body']['direction']===_0x9c38('0x83')){if(!_[_0x9c38('0x84')](_0xd2b98e[_0x9c38('0x5c')][_0x9c38('0x85')])){_0x87c3e3['id']={'$in':_0xd2b98e[_0x9c38('0x5c')][_0x9c38('0x85')]};}_0x53e10a=[[_0x9c38('0x86'),_0x9c38('0x87')],[_0x9c38('0x88'),_0x1980d2[0x0][_0x9c38('0x89')]==='ASC'?'DESC':'ASC'],db[_0x9c38('0x7f')][_0x9c38('0x8a')](_0x9c38('0x8b')),['id',_0x9c38('0x8c')]];}else{if(!_[_0x9c38('0x84')](_0xd2b98e[_0x9c38('0x5c')][_0x9c38('0x85')])){_0x87c3e3['id']={'$notIn':_0xd2b98e['body']['hopperIds']};}_0x53e10a=[[_0x9c38('0x86'),_0x9c38('0x8c')],[_0x9c38('0x88'),_0x1980d2[0x0][_0x9c38('0x89')]],db[_0x9c38('0x7f')][_0x9c38('0x8a')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x9c38('0x87')]];}return db['CmHopper'][_0x9c38('0x8d')]({'attributes':['id',_0x9c38('0x8e'),_0x9c38('0x8f')],'where':_0x87c3e3,'order':_0x53e10a,'transaction':_0x5a6112,'lock':_0x5a6112[_0x9c38('0x90')][_0x9c38('0x91')],'include':[{'model':db[_0x9c38('0x7a')],'as':_0x9c38('0x92'),'attributes':_0x1fcd9a,'include':[{'model':db['CmCompany'],'as':_0x9c38('0x93'),'attributes':['id',_0x9c38('0x2f')]}]},{'model':db[_0x9c38('0x94')],'as':_0x9c38('0x95'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x9c38('0x2f'),_0x9c38('0x96')]}]})[_0x9c38('0x2b')](function(_0x51b7bc){if(_0x51b7bc){return _0x51b7bc[_0x9c38('0x2a')]({'UserId':_0xd2b98e[_0x9c38('0x6b')]['id']},{'transaction':_0x5a6112});}});});}})[_0x9c38('0x2b')](handleEntityNotFound(_0x8754bd,null))[_0x9c38('0x2b')](respondWithResult(_0x8754bd,null))[_0x9c38('0x59')](handleError(_0x8754bd,null));};exports[_0x9c38('0x97')]=function(_0x534eb7,_0x1a576f,_0x53e52d){var _0x150aca=[];return db[_0x9c38('0x7a')][_0x9c38('0x5f')]()['then'](function(_0x571f60){_0x150aca=_['keys'](_0x571f60);return _0x534eb7[_0x9c38('0x6b')][_0x9c38('0x7b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9c38('0x7d')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x9c38('0x2b')](function(_0x131bf4){if(_0x131bf4&&_0x131bf4[_0x9c38('0x4c')]){return db[_0x9c38('0x7f')]['transaction'](function(_0x3489d4){var _0x1e71b1={'active':![],'recallme':!![],'id':_0x534eb7[_0x9c38('0x5c')][_0x9c38('0x98')]};return db[_0x9c38('0x32')][_0x9c38('0x8d')]({'attributes':['id',_0x9c38('0x8e'),_0x9c38('0x8f')],'where':_0x1e71b1,'transaction':_0x3489d4,'lock':_0x3489d4[_0x9c38('0x90')][_0x9c38('0x91')],'include':[{'model':db[_0x9c38('0x7a')],'as':_0x9c38('0x92'),'attributes':_0x150aca,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x9c38('0x2f')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x9c38('0x2f')]},{'model':db['VoiceQueue'],'as':_0x9c38('0x99'),'attributes':['id',_0x9c38('0x2f'),_0x9c38('0x96')]}]})[_0x9c38('0x2b')](function(_0x3f9dae){if(_0x3f9dae){return _0x3f9dae['update']({'UserId':_0x534eb7[_0x9c38('0x6b')]['id']},{'transaction':_0x3489d4});}});});}})[_0x9c38('0x2b')](handleEntityNotFound(_0x1a576f,null))[_0x9c38('0x2b')](respondWithResult(_0x1a576f,null))[_0x9c38('0x59')](handleError(_0x1a576f,null));};exports[_0x9c38('0x9a')]=function(_0xc25d1b,_0x1b255a,_0x18309f){return _0xc25d1b[_0x9c38('0x6b')]['getVoiceQueues']({'where':{'type':_0x9c38('0x7c'),'dialActive':!![],'dialMethod':_0x9c38('0x7d')},'attributes':['id'],'raw':!![]})[_0x9c38('0x2b')](function(_0x561270){if(_0x561270&&_0x561270[_0x9c38('0x4c')]){return db[_0x9c38('0x32')][_0x9c38('0x23')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c38('0x6e')](_0x9c38('0x6f'))},'VoiceQueueId':{'$in':_[_0x9c38('0x31')](_0x561270,'id')},'$or':[{'UserId':null},{'UserId':_0xc25d1b[_0x9c38('0x6b')]['id']}]}});}return 0x0;})[_0x9c38('0x2b')](function(_0x14be1c){if(!_['isNil'](_0x14be1c)&&_[_0x9c38('0x9b')](_0x14be1c)){return _0x1b255a[_0x9c38('0x20')](0xc8)[_0x9c38('0x27')]({'contacts':_0x14be1c});}else{logger[_0x9c38('0x2d')](_0x9c38('0x9c'),_0x9c38('0x9a'),0x194,_0x9c38('0x9d'));_0x1b255a[_0x9c38('0x1f')](0x194);}})[_0x9c38('0x59')](handleError(_0x1b255a,null));};exports[_0x9c38('0x9e')]=function(_0x4e5c09,_0x214cdd,_0x3104be){var _0x32db5f=shared[_0x9c38('0x9f')];var _0x47725b=[];_[_0x9c38('0x31')](_0x32db5f,function(_0x4dfe55){_0x47725b[_0x9c38('0xa0')]({'id':_0x4dfe55[_0x9c38('0x2f')],'name':_0x4dfe55[_0x9c38('0x2f')],'utcOffset':_0x4dfe55[_0x9c38('0xa1')]});});return _0x214cdd[_0x9c38('0x20')](0xc8)[_0x9c38('0x27')]({'tz':_0x47725b});};exports[_0x9c38('0xa2')]=function(_0x973c32,_0x16017e,_0x19f7ca){var _0x23e880=shared[_0x9c38('0x9f')];var _0x3abfdc={};if(!_['isNil'](_0x23e880[_0x973c32[_0x9c38('0x5c')]['id']]))_0x3abfdc=_0x23e880[_0x973c32[_0x9c38('0x5c')]['id']];return _0x16017e['status'](0xc8)[_0x9c38('0x27')](_0x3abfdc);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index df82e5d..79af1c6 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 _0xc4aa=['define','CmHopper','cm_hopper','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopper.attributes','exports'];(function(_0x2bdf88,_0x515fec){var _0x487520=function(_0x161037){while(--_0x161037){_0x2bdf88['push'](_0x2bdf88['shift']());}};_0x487520(++_0x515fec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xac4a('0xc'),'fields':[_0xac4a('0xc')]},{'name':_0xac4a('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x159aaf,_0x146b4c){var _0xdbfb79=function(_0xb9e47f){while(--_0xb9e47f){_0x159aaf['push'](_0x159aaf['shift']());}};_0xdbfb79(++_0x146b4c);}(_0xafc4,0x69));var _0x4afc=function(_0x400774,_0x19c624){_0x400774=_0x400774-0x0;var _0x295c13=_0xafc4[_0x400774];return _0x295c13;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index fddc7d4..d24bfa8 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 _0xe515=['contactsRescheduled','GetContactRecallMe','UPDATE','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','twilio/lib/webhooks/webhooks','client','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetCmHopper','CmHopper','options','raw','where','limit','map','include','model','attributes','catch','ShowCmHopper','find','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','findAll','order','LOCK','CmContact','Contact','User','Agent','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null'];(function(_0x5574e5,_0x2287ce){var _0x47d890=function(_0x4a85c6){while(--_0x4a85c6){_0x5574e5['push'](_0x5574e5['shift']());}};_0x47d890(++_0x2287ce);}(_0xe515,0x16b));var _0x5e51=function(_0x252577,_0xb65db8){_0x252577=_0x252577-0x0;var _0x12dd5c=_0xe515[_0x252577];return _0x12dd5c;};'use strict';var _=require('lodash');var util=require(_0x5e51('0x0'));var moment=require(_0x5e51('0x1'));var BPromise=require(_0x5e51('0x2'));var rs=require(_0x5e51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e51('0x4'));var logger=require('../../config/logger')(_0x5e51('0x5'));var config=require('../../config/environment');var jayson=require(_0x5e51('0x6'));const {validateExpressRequest}=require(_0x5e51('0x7'));var client=jayson[_0x5e51('0x8')][_0x5e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54d314,_0x419637,_0x37780b){return new BPromise(function(_0x1a7833,_0x2be285){return client['request'](_0x54d314,_0x37780b)[_0x5e51('0xa')](function(_0x297886){logger['info'](_0x5e51('0xb'),_0x419637,_0x5e51('0xc'));logger[_0x5e51('0xd')](_0x5e51('0xe'),_0x419637,'request\x20sent',JSON[_0x5e51('0xf')](_0x297886));if(_0x297886[_0x5e51('0x10')]){if(_0x297886[_0x5e51('0x10')]['code']===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x419637,_0x297886['error']['message']);return _0x2be285(_0x297886[_0x5e51('0x10')][_0x5e51('0x11')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x419637,_0x297886['error'][_0x5e51('0x11')]);return _0x1a7833(_0x297886[_0x5e51('0x10')][_0x5e51('0x11')]);}else{logger[_0x5e51('0x12')]('CmHopper,\x20%s,\x20%s',_0x419637,_0x5e51('0xc'));_0x1a7833(_0x297886[_0x5e51('0x13')]['message']);}})['catch'](function(_0x197555){logger[_0x5e51('0x10')](_0x5e51('0xb'),_0x419637,_0x197555);_0x2be285(_0x197555);});});}exports[_0x5e51('0x14')]=function(_0x3d89c2){var _0x4b4f92=this;return new Promise(function(_0x3eaefc,_0x566771){return db[_0x5e51('0x15')]['findAll']({'raw':_0x3d89c2['options']?_0x3d89c2[_0x5e51('0x16')][_0x5e51('0x17')]===undefined?!![]:![]:!![],'where':_0x3d89c2['options']?_0x3d89c2[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0x3d89c2[_0x5e51('0x16')]?_0x3d89c2[_0x5e51('0x16')]['attributes']||null:null,'limit':_0x3d89c2[_0x5e51('0x16')]?_0x3d89c2[_0x5e51('0x16')][_0x5e51('0x19')]||null:null,'include':_0x3d89c2[_0x5e51('0x16')]?_0x3d89c2[_0x5e51('0x16')]['include']?_[_0x5e51('0x1a')](_0x3d89c2[_0x5e51('0x16')][_0x5e51('0x1b')],function(_0x1e9bc4){return{'model':db[_0x1e9bc4[_0x5e51('0x1c')]],'as':_0x1e9bc4['as'],'attributes':_0x1e9bc4[_0x5e51('0x1d')],'include':_0x1e9bc4[_0x5e51('0x1b')]?_[_0x5e51('0x1a')](_0x1e9bc4['include'],function(_0x5d98c9){return{'model':db[_0x5d98c9[_0x5e51('0x1c')]],'as':_0x5d98c9['as'],'attributes':_0x5d98c9[_0x5e51('0x1d')],'include':_0x5d98c9['include']?_[_0x5e51('0x1a')](_0x5d98c9[_0x5e51('0x1b')],function(_0x528668){return{'model':db[_0x528668[_0x5e51('0x1c')]],'as':_0x528668['as'],'attributes':_0x528668[_0x5e51('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e51('0xa')](function(_0x456bbf){logger[_0x5e51('0x12')](_0x5e51('0x14'),_0x3d89c2);logger[_0x5e51('0xd')](_0x5e51('0x14'),_0x3d89c2,JSON[_0x5e51('0xf')](_0x456bbf));_0x3eaefc(_0x456bbf);})[_0x5e51('0x1e')](function(_0x3e5e0b){logger['error']('GetCmHopper',_0x3e5e0b[_0x5e51('0x11')],_0x3d89c2);_0x566771(_0x4b4f92[_0x5e51('0x10')](0x1f4,_0x3e5e0b[_0x5e51('0x11')]));});});};exports[_0x5e51('0x1f')]=function(_0x86e686){var _0x295a2b=this;return new Promise(function(_0x3444e9,_0x3f389b){return db[_0x5e51('0x15')][_0x5e51('0x20')]({'raw':_0x86e686[_0x5e51('0x16')]?_0x86e686['options']['raw']===undefined?!![]:![]:!![],'where':_0x86e686[_0x5e51('0x16')]?_0x86e686[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0x86e686[_0x5e51('0x16')]?_0x86e686[_0x5e51('0x16')][_0x5e51('0x1d')]||null:null,'include':_0x86e686['options']?_0x86e686[_0x5e51('0x16')][_0x5e51('0x1b')]?_['map'](_0x86e686[_0x5e51('0x16')][_0x5e51('0x1b')],function(_0x2000a0){return{'model':db[_0x2000a0[_0x5e51('0x1c')]],'as':_0x2000a0['as'],'attributes':_0x2000a0[_0x5e51('0x1d')],'include':_0x2000a0[_0x5e51('0x1b')]?_[_0x5e51('0x1a')](_0x2000a0[_0x5e51('0x1b')],function(_0x31f767){return{'model':db[_0x31f767[_0x5e51('0x1c')]],'as':_0x31f767['as'],'attributes':_0x31f767[_0x5e51('0x1d')],'include':_0x31f767['include']?_[_0x5e51('0x1a')](_0x31f767['include'],function(_0x1adffa){return{'model':db[_0x1adffa['model']],'as':_0x1adffa['as'],'attributes':_0x1adffa[_0x5e51('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e51('0xa')](function(_0x4f9dac){logger[_0x5e51('0x12')](_0x5e51('0x1f'),_0x86e686);logger[_0x5e51('0xd')]('ShowCmHopper',_0x86e686,JSON[_0x5e51('0xf')](_0x4f9dac));_0x3444e9(_0x4f9dac);})['catch'](function(_0x895521){logger[_0x5e51('0x10')]('ShowCmHopper',_0x895521[_0x5e51('0x11')],_0x86e686);_0x3f389b(_0x295a2b['error'](0x1f4,_0x895521[_0x5e51('0x11')]));});});};exports['CreateCmHopper']=function(_0x28445c){var _0x4c5099=this;return new Promise(function(_0x2489ba,_0x13e3f6){return db[_0x5e51('0x15')][_0x5e51('0x21')](_0x28445c[_0x5e51('0x22')],{'raw':_0x28445c[_0x5e51('0x16')]?_0x28445c[_0x5e51('0x16')][_0x5e51('0x17')]===undefined?!![]:![]:!![]})[_0x5e51('0xa')](function(_0x329e7c){logger[_0x5e51('0x12')]('CreateCmHopper',_0x28445c);logger['debug'](_0x5e51('0x23'),_0x28445c,JSON['stringify'](_0x329e7c));_0x2489ba(_0x329e7c);})[_0x5e51('0x1e')](function(_0x5949f7){logger['error'](_0x5e51('0x23'),_0x5949f7[_0x5e51('0x11')],_0x28445c);_0x13e3f6(_0x4c5099[_0x5e51('0x10')](0x1f4,_0x5949f7[_0x5e51('0x11')]));});});};exports[_0x5e51('0x24')]=function(_0xa9f290){var _0x2cec46=this;return new Promise(function(_0x5387ef,_0x1bb2b9){return db[_0x5e51('0x15')][_0x5e51('0x25')](_0xa9f290[_0x5e51('0x22')],{'raw':_0xa9f290[_0x5e51('0x16')]?_0xa9f290[_0x5e51('0x16')][_0x5e51('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa9f290['options']?_0xa9f290[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0xa9f290[_0x5e51('0x16')]?_0xa9f290[_0x5e51('0x16')][_0x5e51('0x1d')]||null:null,'limit':_0xa9f290[_0x5e51('0x16')]?_0xa9f290[_0x5e51('0x16')][_0x5e51('0x19')]||null:null})['then'](function(_0x438c7f){logger['info'](_0x5e51('0x24'),_0xa9f290);logger[_0x5e51('0x12')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xa9f290['options'][_0x5e51('0x18')]),_0xa9f290[_0x5e51('0x22')]['active']);logger[_0x5e51('0xd')](_0x5e51('0x24'),_0xa9f290,JSON[_0x5e51('0xf')](_0x438c7f));_0x5387ef(_0x438c7f);})[_0x5e51('0x1e')](function(_0x294ce8){logger[_0x5e51('0x10')]('UpdateCmHopper',_0x294ce8['message'],_0xa9f290);_0x1bb2b9(_0x2cec46[_0x5e51('0x10')](0x1f4,_0x294ce8[_0x5e51('0x11')]));});});};exports[_0x5e51('0x26')]=function(_0x4426c4){var _0x1f5720=this;return new Promise(function(_0x4d9460,_0x8a427a){return db[_0x5e51('0x15')][_0x5e51('0x27')]({'where':_0x4426c4[_0x5e51('0x16')]?_0x4426c4['options'][_0x5e51('0x18')]||null:null})[_0x5e51('0xa')](function(_0xfb8de5){logger['info'](_0x5e51('0x26'),_0x4426c4);logger[_0x5e51('0xd')](_0x5e51('0x26'),_0x4426c4,JSON[_0x5e51('0xf')](_0xfb8de5));_0x4d9460(_0xfb8de5);})[_0x5e51('0x1e')](function(_0x2aa40c){logger[_0x5e51('0x10')](_0x5e51('0x26'),_0x2aa40c['message'],_0x4426c4);_0x8a427a(_0x1f5720[_0x5e51('0x10')](0x1f4,_0x2aa40c[_0x5e51('0x11')]));});});};exports[_0x5e51('0x28')]=function(_0x5851dc){var _0x11ff0f=this;return new Promise(function(_0x486148,_0x4ebd3b){return db['CmContact'][_0x5e51('0x29')]()[_0x5e51('0xa')](function(_0x14c806){return db[_0x5e51('0x2a')][_0x5e51('0x2b')](function(_0x169d48){return db[_0x5e51('0x15')][_0x5e51('0x2c')]({'where':_0x5851dc[_0x5e51('0x16')]?_0x5851dc[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0x5851dc[_0x5e51('0x16')]?_0x5851dc['options'][_0x5e51('0x1d')]||null:null,'limit':_0x5851dc[_0x5e51('0x16')]?_0x5851dc['options'][_0x5e51('0x19')]||null:null,'order':_0x5851dc[_0x5e51('0x16')]?_0x5851dc[_0x5e51('0x16')][_0x5e51('0x2d')]||null:null,'transaction':_0x169d48,'lock':_0x169d48[_0x5e51('0x2e')]['UPDATE'],'include':[{'model':db[_0x5e51('0x2f')],'as':_0x5e51('0x30'),'attributes':_['keys'](_0x14c806)},{'model':db[_0x5e51('0x31')],'as':_0x5e51('0x32'),'attributes':['id','name','voicePause']}]})[_0x5e51('0xa')](function(_0x1e3402){var _0x35b2b5=[];var _0x3cb667=[];for(var _0x57c54e=0x0;_0x57c54e<_0x1e3402[_0x5e51('0x33')];_0x57c54e+=0x1){var _0x5e6984=_0x1e3402[_0x57c54e][_0x5e51('0x34')];if(_0x5e6984===null){_0x35b2b5[_0x5e51('0x35')](_0x1e3402[_0x57c54e][_0x5e51('0x25')](_0x5851dc[_0x5e51('0x22')],{'transaction':_0x169d48}));}else if(!_0x3cb667['includes'](_0x5e6984)){_0x3cb667[_0x5e51('0x35')](_0x5e6984);_0x35b2b5[_0x5e51('0x35')](_0x1e3402[_0x57c54e][_0x5e51('0x25')](_0x5851dc['body'],{'transaction':_0x169d48}));}}return BPromise[_0x5e51('0x36')](_0x35b2b5);});})['then'](function(_0x552d35){logger[_0x5e51('0x12')](_0x5e51('0x28'),_0x5851dc);if(_0x552d35[_0x5e51('0x33')]>0x0){logger['info'](_0x5e51('0x37'),_0x552d35[0x0][_0x5e51('0x38')]['id'],_0x552d35[0x0][_0x5e51('0x38')][_0x5e51('0x39')],_0x552d35[0x0][_0x5e51('0x38')][_0x5e51('0x3a')]);}logger[_0x5e51('0xd')]('GetContactDialer',_0x5851dc,JSON[_0x5e51('0xf')](_0x552d35));_0x486148(_0x552d35);})[_0x5e51('0x1e')](function(_0x233ab1){logger['error'](_0x5e51('0x28'),_0x233ab1[_0x5e51('0x11')],_0x5851dc);_0x4ebd3b(_0x11ff0f[_0x5e51('0x10')](0x1f4,_0x233ab1[_0x5e51('0x11')]));});});});};exports[_0x5e51('0x3b')]=function(_0x321cbf){var _0x495f25=this;return new Promise(function(_0x1789fd,_0x49ba2){return db[_0x5e51('0x2a')]['transaction'](function(_0x1edb55){return db['CmHopperFinal'][_0x5e51('0x21')](_0x321cbf[_0x5e51('0x22')],{'raw':_0x321cbf['options']?_0x321cbf[_0x5e51('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1edb55})[_0x5e51('0xa')](function(){logger['info'](_0x5e51('0x3c'),JSON[_0x5e51('0xf')](_0x321cbf[_0x5e51('0x16')][_0x5e51('0x18')]),_0x321cbf['options'][_0x5e51('0x18')][_0x5e51('0x3a')]);return db[_0x5e51('0x15')][_0x5e51('0x27')]({'where':_0x321cbf['options']?_0x321cbf[_0x5e51('0x16')]['where']||null:null,'transaction':_0x1edb55});});})[_0x5e51('0xa')](function(_0x408633){logger[_0x5e51('0x12')]('MoveContactManagedDialer',_0x321cbf);logger[_0x5e51('0xd')](_0x5e51('0x3b'),_0x321cbf,JSON[_0x5e51('0xf')](_0x408633));_0x1789fd(_0x408633);})[_0x5e51('0x1e')](function(_0xc1f2bd){logger[_0x5e51('0x10')](_0x5e51('0x3b'),_0xc1f2bd[_0x5e51('0x11')],_0x321cbf);_0x49ba2(_0x495f25[_0x5e51('0x10')](0x1f4,_0xc1f2bd['message']));});});};exports[_0x5e51('0x3d')]=function(_0x26e6a1){var _0x25fc90=this;return new Promise(function(_0x30b85e,_0x4711b2){return db[_0x5e51('0x15')]['findAll']({'raw':_0x26e6a1[_0x5e51('0x16')]?_0x26e6a1['options'][_0x5e51('0x17')]===undefined?!![]:![]:!![],'where':_0x26e6a1[_0x5e51('0x16')]?_0x26e6a1[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':[[db[_0x5e51('0x2a')]['fn']('COUNT',db[_0x5e51('0x2a')]['fn']('IF',db[_0x5e51('0x2a')][_0x5e51('0x3e')](_0x5e51('0x3f')+util['format'](_0x5e51('0x40'),moment()['format'](_0x5e51('0x41')))+_0x5e51('0x42')))),_0x5e51('0x43')]]})['then'](function(_0x15bede){logger['info'](_0x5e51('0x3d'),_0x26e6a1);logger['debug'](_0x5e51('0x3d'),_0x26e6a1,JSON[_0x5e51('0xf')](_0x15bede));_0x30b85e(_0x15bede);})[_0x5e51('0x1e')](function(_0x35ac69){logger[_0x5e51('0x10')](_0x5e51('0x3d'),_0x35ac69[_0x5e51('0x11')],_0x26e6a1);_0x4711b2(_0x25fc90[_0x5e51('0x10')](0x1f4,_0x35ac69[_0x5e51('0x11')]));});});};exports[_0x5e51('0x44')]=function(_0x487039){var _0x5489f5=this;return new Promise(function(_0x49d68d,_0x3d5c24){return db[_0x5e51('0x2f')][_0x5e51('0x29')]()[_0x5e51('0xa')](function(_0x24697e){return db[_0x5e51('0x2a')][_0x5e51('0x2b')](function(_0x439d0e){return db[_0x5e51('0x15')][_0x5e51('0x2c')]({'where':_0x487039[_0x5e51('0x16')]?_0x487039[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0x487039[_0x5e51('0x16')]?_0x487039[_0x5e51('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x487039['options']?_0x487039[_0x5e51('0x16')][_0x5e51('0x2d')]||null:null,'group':db[_0x5e51('0x15')]['UserId'],'transaction':_0x439d0e,'lock':_0x439d0e[_0x5e51('0x2e')][_0x5e51('0x45')],'include':_0x487039[_0x5e51('0x16')]?_0x487039[_0x5e51('0x16')]['include']?_['map'](_0x487039[_0x5e51('0x16')][_0x5e51('0x1b')],function(_0x19f26b){return{'model':db[_0x19f26b[_0x5e51('0x1c')]],'as':_0x19f26b['as'],'attributes':_0x19f26b[_0x5e51('0x1d')],'include':_0x19f26b[_0x5e51('0x1b')]?_[_0x5e51('0x1a')](_0x19f26b[_0x5e51('0x1b')],function(_0x1390a8){return{'model':db[_0x1390a8[_0x5e51('0x1c')]],'as':_0x1390a8['as'],'attributes':_0x1390a8[_0x5e51('0x1d')],'include':_0x1390a8[_0x5e51('0x1b')]?_[_0x5e51('0x1a')](_0x1390a8[_0x5e51('0x1b')],function(_0x21b224){return{'model':db[_0x21b224[_0x5e51('0x1c')]],'as':_0x21b224['as'],'attributes':_0x21b224['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e51('0xa')](function(_0x5c208e){var _0x5417c3=[];for(var _0x5e112b=0x0;_0x5e112b<_0x5c208e[_0x5e51('0x33')];_0x5e112b+=0x1){_0x5417c3[_0x5e51('0x35')](_0x5c208e[_0x5e112b][_0x5e51('0x25')](_0x487039['body'],{'transaction':_0x439d0e}));}return BPromise[_0x5e51('0x36')](_0x5417c3);});})[_0x5e51('0xa')](function(_0x5dd77f){logger[_0x5e51('0x12')](_0x5e51('0x44'),_0x487039);logger[_0x5e51('0xd')](_0x5e51('0x44'),_0x487039,JSON[_0x5e51('0xf')](_0x5dd77f));_0x49d68d(_0x5dd77f);})[_0x5e51('0x1e')](function(_0x5a6c64){logger[_0x5e51('0x10')]('GetContactRecallMe',_0x5a6c64['message'],_0x487039);_0x3d5c24(_0x5489f5[_0x5e51('0x10')](0x1f4,_0x5a6c64[_0x5e51('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x24bae5){var _0xe2172e=this;return new Promise(function(_0x4ab578,_0x5d4d05){db[_0x5e51('0x2f')][_0x5e51('0x29')]()[_0x5e51('0xa')](function(_0xebb07f){return db[_0x5e51('0x15')][_0x5e51('0x2c')]({'raw':_0x24bae5['options']?_0x24bae5[_0x5e51('0x16')][_0x5e51('0x17')]===undefined?!![]:![]:!![],'where':_0x24bae5[_0x5e51('0x16')]?_0x24bae5[_0x5e51('0x16')][_0x5e51('0x18')]||null:null,'attributes':_0x24bae5['options']?_0x24bae5['options'][_0x5e51('0x1d')]||null:null,'limit':_0x24bae5[_0x5e51('0x16')]?_0x24bae5[_0x5e51('0x16')][_0x5e51('0x19')]||null:null,'include':_0x24bae5[_0x5e51('0x16')]?_0x24bae5['options'][_0x5e51('0x1b')]?_['map'](_0x24bae5[_0x5e51('0x16')][_0x5e51('0x1b')],function(_0x2de91d){return{'model':db[_0x2de91d[_0x5e51('0x1c')]],'as':_0x2de91d['as'],'attributes':_0x2de91d['as']==='Contact'?_[_0x5e51('0x46')](_0xebb07f):_0x2de91d[_0x5e51('0x1d')],'include':_0x2de91d[_0x5e51('0x1b')]?_[_0x5e51('0x1a')](_0x2de91d['include'],function(_0x4b398c){return{'model':db[_0x4b398c['model']],'as':_0x4b398c['as'],'attributes':_0x4b398c[_0x5e51('0x1d')],'include':_0x4b398c['include']?_[_0x5e51('0x1a')](_0x4b398c['include'],function(_0x3dd932){return{'model':db[_0x3dd932['model']],'as':_0x3dd932['as'],'attributes':_0x3dd932[_0x5e51('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e51('0xa')](function(_0xc653cd){logger['info'](_0x5e51('0x14'),_0x24bae5);logger[_0x5e51('0xd')](_0x5e51('0x14'),_0x24bae5,JSON['stringify'](_0xc653cd));_0x4ab578(_0xc653cd);})[_0x5e51('0x1e')](function(_0x6da072){logger['error'](_0x5e51('0x14'),_0x6da072[_0x5e51('0x11')],_0x24bae5);_0x5d4d05(_0xe2172e[_0x5e51('0x10')](0x1f4,_0x6da072[_0x5e51('0x11')]));});});});};exports[_0x5e51('0x47')]=function(_0x5b2000){var _0x8658d7=this;return new Promise(function(_0x7a1707,_0x2a9bac){return db[_0x5e51('0x2f')][_0x5e51('0x48')]({'raw':!![],'where':{'phone':_0x5b2000[_0x5e51('0x16')][_0x5e51('0x18')]['phone']},'attributes':['id',_0x5e51('0x49')],'order':[['id',_0x5e51('0x4a')]]})[_0x5e51('0xa')](function(_0x26e56e){logger['info'](_0x5e51('0x4b'),_0x5b2000);logger[_0x5e51('0xd')](_0x5e51('0x4b'),_0x5b2000,JSON[_0x5e51('0xf')](_0x26e56e));_0x7a1707(_0x26e56e);})['catch'](function(_0x3786ba){logger[_0x5e51('0x10')](_0x5e51('0x4b'),_0x3786ba[_0x5e51('0x11')],_0x5b2000);_0x2a9bac(_0x8658d7['error'](0x1f4,_0x3786ba[_0x5e51('0x11')]));});});};exports['ResetActiveCalls']=function(_0x3e623d){var _0xecb883=this;return new Promise(function(_0x283029,_0x35b554){return db[_0x5e51('0x2a')][_0x5e51('0x2b')](function(_0x4f41a2){return db['CmHopper'][_0x5e51('0x25')]({'active':![]},{'where':{},'transaction':_0x4f41a2})['then'](function(_0x358b46){logger[_0x5e51('0x12')]('ResetActiveCalls',_0x3e623d);logger['debug'](_0x5e51('0x4c'),_0x3e623d,JSON[_0x5e51('0xf')](_0x358b46));_0x283029(_0x358b46);})[_0x5e51('0x1e')](function(_0x113391){logger[_0x5e51('0x10')](_0x5e51('0x4c'),_0x113391[_0x5e51('0x11')],_0x3e623d);_0x35b554(_0xecb883[_0x5e51('0x10')](0x1f4,_0x113391[_0x5e51('0x11')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3ffaae){var _0x541f52=this;var _0x3fe851=_0x3ffaae[_0x5e51('0x22')][_0x5e51('0x18')][_0x5e51('0x4d')];var _0x1aacce=_0x3ffaae[_0x5e51('0x22')][_0x5e51('0x18')][_0x5e51('0x4e')];return new Promise(function(_0x55d8b1,_0x224535){return db['CmHopper'][_0x5e51('0x2c')]({'where':{'voiceQueueId':_0x3fe851,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x5e51('0x3e')](_0x5e51('0x4f')+_0x1aacce+_0x5e51('0x50'))}},'include':[{'model':db[_0x5e51('0x2f')],'as':_0x5e51('0x30')},{'model':db[_0x5e51('0x31')],'as':'Agent','attributes':['id',_0x5e51('0x51'),_0x5e51('0x52')]},{'model':db[_0x5e51('0x53')],'as':_0x5e51('0x54')}]})[_0x5e51('0xa')](function(_0x3bde25){return db[_0x5e51('0x2a')][_0x5e51('0x2b')](function(_0x390b87){return db[_0x5e51('0x15')][_0x5e51('0x25')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x3fe851,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x5e51('0x2a')]['literal'](_0x5e51('0x4f')+_0x1aacce+'\x20MINUTE')}},'transaction':_0x390b87})['then'](function(_0x556b38){_0x55d8b1(_0x3bde25);})[_0x5e51('0x1e')](function(_0x146d86){logger[_0x5e51('0x10')](_0x5e51('0x55'),_0x146d86['message'],_0x3ffaae);_0x224535(validateExpressRequest);});});})[_0x5e51('0x1e')](function(_0xbbff56){logger[_0x5e51('0x10')](_0x5e51('0x55'),_0xbbff56[_0x5e51('0x11')],_0x3ffaae);_0x224535(_0x541f52[_0x5e51('0x10')](0x1f4,_0xbbff56[_0x5e51('0x11')]));});});}; \ No newline at end of file +var _0x439c=['User','name','CmList','literal','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','twilio/lib/webhooks/webhooks','http','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','attributes','include','map','model','GetCmHopper','ShowCmHopper','where','then','CreateCmHopper','CmHopper','create','body','raw','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','CmContact','describe','sequelize','transaction','limit','LOCK','Contact','keys','Agent','voicePause','length','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UserId','UPDATE','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueId','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x439c,0x104));var _0xc439=function(_0x4212ca,_0xdc14f3){_0x4212ca=_0x4212ca-0x0;var _0x1acf47=_0x439c[_0x4212ca];return _0x1acf47;};'use strict';var _=require(_0xc439('0x0'));var util=require(_0xc439('0x1'));var moment=require(_0xc439('0x2'));var BPromise=require('bluebird');var rs=require(_0xc439('0x3'));var fs=require('fs');var Redis=require(_0xc439('0x4'));var db=require(_0xc439('0x5'))['db'];var utils=require(_0xc439('0x6'));var logger=require(_0xc439('0x7'))(_0xc439('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0xc439('0x9'));var client=jayson['client'][_0xc439('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f960c,_0x5e38be,_0x432a43){return new BPromise(function(_0x178951,_0x393761){return client['request'](_0x1f960c,_0x432a43)['then'](function(_0x231aa0){logger[_0xc439('0xb')](_0xc439('0xc'),_0x5e38be,'request\x20sent');logger[_0xc439('0xd')](_0xc439('0xe'),_0x5e38be,_0xc439('0xf'),JSON[_0xc439('0x10')](_0x231aa0));if(_0x231aa0['error']){if(_0x231aa0[_0xc439('0x11')][_0xc439('0x12')]===0x1f4){logger['error'](_0xc439('0xc'),_0x5e38be,_0x231aa0[_0xc439('0x11')]['message']);return _0x393761(_0x231aa0[_0xc439('0x11')]['message']);}logger[_0xc439('0x11')](_0xc439('0xc'),_0x5e38be,_0x231aa0[_0xc439('0x11')][_0xc439('0x13')]);return _0x178951(_0x231aa0[_0xc439('0x11')]['message']);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x5e38be,_0xc439('0xf'));_0x178951(_0x231aa0['result'][_0xc439('0x13')]);}})[_0xc439('0x14')](function(_0x9fc805){logger[_0xc439('0x11')](_0xc439('0xc'),_0x5e38be,_0x9fc805);_0x393761(_0x9fc805);});});}exports['GetCmHopper']=function(_0x45ecfc){var _0x1bddef=this;return new Promise(function(_0x3a3701,_0x1d9a2d){return db['CmHopper'][_0xc439('0x15')]({'raw':_0x45ecfc[_0xc439('0x16')]?_0x45ecfc[_0xc439('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x45ecfc[_0xc439('0x16')]?_0x45ecfc[_0xc439('0x16')]['where']||null:null,'attributes':_0x45ecfc[_0xc439('0x16')]?_0x45ecfc[_0xc439('0x16')][_0xc439('0x17')]||null:null,'limit':_0x45ecfc[_0xc439('0x16')]?_0x45ecfc[_0xc439('0x16')]['limit']||null:null,'include':_0x45ecfc[_0xc439('0x16')]?_0x45ecfc[_0xc439('0x16')][_0xc439('0x18')]?_[_0xc439('0x19')](_0x45ecfc[_0xc439('0x16')]['include'],function(_0x3c23fd){return{'model':db[_0x3c23fd['model']],'as':_0x3c23fd['as'],'attributes':_0x3c23fd[_0xc439('0x17')],'include':_0x3c23fd[_0xc439('0x18')]?_['map'](_0x3c23fd[_0xc439('0x18')],function(_0x50fbfb){return{'model':db[_0x50fbfb[_0xc439('0x1a')]],'as':_0x50fbfb['as'],'attributes':_0x50fbfb[_0xc439('0x17')],'include':_0x50fbfb[_0xc439('0x18')]?_[_0xc439('0x19')](_0x50fbfb[_0xc439('0x18')],function(_0x3bcc79){return{'model':db[_0x3bcc79[_0xc439('0x1a')]],'as':_0x3bcc79['as'],'attributes':_0x3bcc79['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5104f6){logger[_0xc439('0xb')](_0xc439('0x1b'),_0x45ecfc);logger[_0xc439('0xd')](_0xc439('0x1b'),_0x45ecfc,JSON['stringify'](_0x5104f6));_0x3a3701(_0x5104f6);})['catch'](function(_0x3b7704){logger[_0xc439('0x11')]('GetCmHopper',_0x3b7704[_0xc439('0x13')],_0x45ecfc);_0x1d9a2d(_0x1bddef[_0xc439('0x11')](0x1f4,_0x3b7704['message']));});});};exports[_0xc439('0x1c')]=function(_0x2d4cb7){var _0x438898=this;return new Promise(function(_0x1922f7,_0x3fdf01){return db['CmHopper']['find']({'raw':_0x2d4cb7[_0xc439('0x16')]?_0x2d4cb7[_0xc439('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2d4cb7['options']?_0x2d4cb7[_0xc439('0x16')][_0xc439('0x1d')]||null:null,'attributes':_0x2d4cb7[_0xc439('0x16')]?_0x2d4cb7[_0xc439('0x16')][_0xc439('0x17')]||null:null,'include':_0x2d4cb7[_0xc439('0x16')]?_0x2d4cb7[_0xc439('0x16')][_0xc439('0x18')]?_[_0xc439('0x19')](_0x2d4cb7[_0xc439('0x16')]['include'],function(_0x592b3e){return{'model':db[_0x592b3e[_0xc439('0x1a')]],'as':_0x592b3e['as'],'attributes':_0x592b3e[_0xc439('0x17')],'include':_0x592b3e[_0xc439('0x18')]?_[_0xc439('0x19')](_0x592b3e[_0xc439('0x18')],function(_0x4a29ff){return{'model':db[_0x4a29ff['model']],'as':_0x4a29ff['as'],'attributes':_0x4a29ff[_0xc439('0x17')],'include':_0x4a29ff[_0xc439('0x18')]?_['map'](_0x4a29ff[_0xc439('0x18')],function(_0x24823d){return{'model':db[_0x24823d['model']],'as':_0x24823d['as'],'attributes':_0x24823d[_0xc439('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc439('0x1e')](function(_0x5c836c){logger[_0xc439('0xb')](_0xc439('0x1c'),_0x2d4cb7);logger[_0xc439('0xd')](_0xc439('0x1c'),_0x2d4cb7,JSON['stringify'](_0x5c836c));_0x1922f7(_0x5c836c);})[_0xc439('0x14')](function(_0x628b5f){logger['error']('ShowCmHopper',_0x628b5f['message'],_0x2d4cb7);_0x3fdf01(_0x438898[_0xc439('0x11')](0x1f4,_0x628b5f[_0xc439('0x13')]));});});};exports[_0xc439('0x1f')]=function(_0x45841c){var _0x6a21ca=this;return new Promise(function(_0x2d239f,_0xa42f58){return db[_0xc439('0x20')][_0xc439('0x21')](_0x45841c[_0xc439('0x22')],{'raw':_0x45841c[_0xc439('0x16')]?_0x45841c[_0xc439('0x16')][_0xc439('0x23')]===undefined?!![]:![]:!![]})[_0xc439('0x1e')](function(_0x588590){logger['info'](_0xc439('0x1f'),_0x45841c);logger[_0xc439('0xd')](_0xc439('0x1f'),_0x45841c,JSON[_0xc439('0x10')](_0x588590));_0x2d239f(_0x588590);})['catch'](function(_0x5c0c7c){logger[_0xc439('0x11')]('CreateCmHopper',_0x5c0c7c[_0xc439('0x13')],_0x45841c);_0xa42f58(_0x6a21ca['error'](0x1f4,_0x5c0c7c['message']));});});};exports[_0xc439('0x24')]=function(_0x2e4ff9){var _0x2188aa=this;return new Promise(function(_0x4f3e8a,_0x4b593a){return db[_0xc439('0x20')][_0xc439('0x25')](_0x2e4ff9[_0xc439('0x22')],{'raw':_0x2e4ff9['options']?_0x2e4ff9[_0xc439('0x16')][_0xc439('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e4ff9[_0xc439('0x16')]?_0x2e4ff9[_0xc439('0x16')][_0xc439('0x1d')]||null:null,'attributes':_0x2e4ff9[_0xc439('0x16')]?_0x2e4ff9[_0xc439('0x16')][_0xc439('0x17')]||null:null,'limit':_0x2e4ff9[_0xc439('0x16')]?_0x2e4ff9[_0xc439('0x16')]['limit']||null:null})[_0xc439('0x1e')](function(_0x265dbf){logger[_0xc439('0xb')](_0xc439('0x24'),_0x2e4ff9);logger[_0xc439('0xb')](_0xc439('0x26'),JSON[_0xc439('0x10')](_0x2e4ff9[_0xc439('0x16')]['where']),_0x2e4ff9[_0xc439('0x22')]['active']);logger[_0xc439('0xd')](_0xc439('0x24'),_0x2e4ff9,JSON[_0xc439('0x10')](_0x265dbf));_0x4f3e8a(_0x265dbf);})[_0xc439('0x14')](function(_0x3d37fa){logger['error'](_0xc439('0x24'),_0x3d37fa['message'],_0x2e4ff9);_0x4b593a(_0x2188aa[_0xc439('0x11')](0x1f4,_0x3d37fa[_0xc439('0x13')]));});});};exports['DestroyCmHopper']=function(_0x13592f){var _0x36f726=this;return new Promise(function(_0x16f33e,_0x2377cd){return db[_0xc439('0x20')][_0xc439('0x27')]({'where':_0x13592f['options']?_0x13592f['options'][_0xc439('0x1d')]||null:null})[_0xc439('0x1e')](function(_0x2d2b61){logger[_0xc439('0xb')]('DestroyCmHopper',_0x13592f);logger[_0xc439('0xd')]('DestroyCmHopper',_0x13592f,JSON[_0xc439('0x10')](_0x2d2b61));_0x16f33e(_0x2d2b61);})[_0xc439('0x14')](function(_0x155e67){logger['error'](_0xc439('0x28'),_0x155e67[_0xc439('0x13')],_0x13592f);_0x2377cd(_0x36f726[_0xc439('0x11')](0x1f4,_0x155e67[_0xc439('0x13')]));});});};exports['GetContactDialer']=function(_0x101157){var _0x5c33c5=this;return new Promise(function(_0x36b0f3,_0xa0e322){return db[_0xc439('0x29')][_0xc439('0x2a')]()[_0xc439('0x1e')](function(_0x3b7a11){return db[_0xc439('0x2b')][_0xc439('0x2c')](function(_0x2a21fd){return db[_0xc439('0x20')]['findAll']({'where':_0x101157[_0xc439('0x16')]?_0x101157['options'][_0xc439('0x1d')]||null:null,'attributes':_0x101157[_0xc439('0x16')]?_0x101157[_0xc439('0x16')]['attributes']||null:null,'limit':_0x101157[_0xc439('0x16')]?_0x101157[_0xc439('0x16')][_0xc439('0x2d')]||null:null,'order':_0x101157[_0xc439('0x16')]?_0x101157[_0xc439('0x16')]['order']||null:null,'transaction':_0x2a21fd,'lock':_0x2a21fd[_0xc439('0x2e')]['UPDATE'],'include':[{'model':db[_0xc439('0x29')],'as':_0xc439('0x2f'),'attributes':_[_0xc439('0x30')](_0x3b7a11)},{'model':db['User'],'as':_0xc439('0x31'),'attributes':['id','name',_0xc439('0x32')]}]})[_0xc439('0x1e')](function(_0x8c6769){var _0x1b47d9=[];var _0x2161c0=[];for(var _0x8b3c40=0x0;_0x8b3c40<_0x8c6769[_0xc439('0x33')];_0x8b3c40+=0x1){var _0x1248a9=_0x8c6769[_0x8b3c40]['UserId'];if(_0x1248a9===null){_0x1b47d9[_0xc439('0x34')](_0x8c6769[_0x8b3c40][_0xc439('0x25')](_0x101157['body'],{'transaction':_0x2a21fd}));}else if(!_0x2161c0[_0xc439('0x35')](_0x1248a9)){_0x2161c0[_0xc439('0x34')](_0x1248a9);_0x1b47d9[_0xc439('0x34')](_0x8c6769[_0x8b3c40][_0xc439('0x25')](_0x101157[_0xc439('0x22')],{'transaction':_0x2a21fd}));}}return BPromise[_0xc439('0x36')](_0x1b47d9);});})[_0xc439('0x1e')](function(_0x31b263){logger['info'](_0xc439('0x37'),_0x101157);if(_0x31b263[_0xc439('0x33')]>0x0){logger[_0xc439('0xb')](_0xc439('0x38'),_0x31b263[0x0][_0xc439('0x39')]['id'],_0x31b263[0x0]['dataValues'][_0xc439('0x3a')],_0x31b263[0x0][_0xc439('0x39')][_0xc439('0x3b')]);}logger['debug'](_0xc439('0x37'),_0x101157,JSON['stringify'](_0x31b263));_0x36b0f3(_0x31b263);})['catch'](function(_0x3a6a97){logger[_0xc439('0x11')](_0xc439('0x37'),_0x3a6a97[_0xc439('0x13')],_0x101157);_0xa0e322(_0x5c33c5[_0xc439('0x11')](0x1f4,_0x3a6a97['message']));});});});};exports['MoveContactManagedDialer']=function(_0xbac50c){var _0x489005=this;return new Promise(function(_0x20e601,_0x547b6f){return db[_0xc439('0x2b')][_0xc439('0x2c')](function(_0x16f2fc){return db['CmHopperFinal'][_0xc439('0x21')](_0xbac50c[_0xc439('0x22')],{'raw':_0xbac50c[_0xc439('0x16')]?_0xbac50c[_0xc439('0x16')][_0xc439('0x23')]===undefined?!![]:![]:!![],'transaction':_0x16f2fc})[_0xc439('0x1e')](function(){logger[_0xc439('0xb')](_0xc439('0x3c'),JSON[_0xc439('0x10')](_0xbac50c['options'][_0xc439('0x1d')]),_0xbac50c['options'][_0xc439('0x1d')][_0xc439('0x3b')]);return db[_0xc439('0x20')][_0xc439('0x27')]({'where':_0xbac50c[_0xc439('0x16')]?_0xbac50c[_0xc439('0x16')][_0xc439('0x1d')]||null:null,'transaction':_0x16f2fc});});})[_0xc439('0x1e')](function(_0xbbdddc){logger[_0xc439('0xb')](_0xc439('0x3d'),_0xbac50c);logger[_0xc439('0xd')](_0xc439('0x3d'),_0xbac50c,JSON[_0xc439('0x10')](_0xbbdddc));_0x20e601(_0xbbdddc);})[_0xc439('0x14')](function(_0x509ce2){logger[_0xc439('0x11')](_0xc439('0x3d'),_0x509ce2[_0xc439('0x13')],_0xbac50c);_0x547b6f(_0x489005[_0xc439('0x11')](0x1f4,_0x509ce2[_0xc439('0x13')]));});});};exports[_0xc439('0x3e')]=function(_0x24adf6){var _0x3ebb9f=this;return new Promise(function(_0x17f06b,_0x93c29f){return db[_0xc439('0x20')][_0xc439('0x15')]({'raw':_0x24adf6[_0xc439('0x16')]?_0x24adf6[_0xc439('0x16')][_0xc439('0x23')]===undefined?!![]:![]:!![],'where':_0x24adf6[_0xc439('0x16')]?_0x24adf6[_0xc439('0x16')][_0xc439('0x1d')]||null:null,'attributes':[[db[_0xc439('0x2b')]['fn'](_0xc439('0x3f'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util['format'](_0xc439('0x40'),moment()[_0xc439('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xc439('0x42')))),_0xc439('0x43')]]})['then'](function(_0x815d2c){logger['info'](_0xc439('0x3e'),_0x24adf6);logger[_0xc439('0xd')]('CountReScheduled',_0x24adf6,JSON['stringify'](_0x815d2c));_0x17f06b(_0x815d2c);})[_0xc439('0x14')](function(_0x547242){logger[_0xc439('0x11')](_0xc439('0x3e'),_0x547242[_0xc439('0x13')],_0x24adf6);_0x93c29f(_0x3ebb9f[_0xc439('0x11')](0x1f4,_0x547242['message']));});});};exports[_0xc439('0x44')]=function(_0x6496a9){var _0x39ad44=this;return new Promise(function(_0x632179,_0x402bf7){return db[_0xc439('0x29')][_0xc439('0x2a')]()['then'](function(_0x56fb71){return db['sequelize'][_0xc439('0x2c')](function(_0x12bf73){return db['CmHopper']['findAll']({'where':_0x6496a9[_0xc439('0x16')]?_0x6496a9[_0xc439('0x16')]['where']||null:null,'attributes':_0x6496a9['options']?_0x6496a9['options'][_0xc439('0x17')]||null:null,'limit':0x1,'order':_0x6496a9[_0xc439('0x16')]?_0x6496a9['options'][_0xc439('0x45')]||null:null,'group':db[_0xc439('0x20')][_0xc439('0x46')],'transaction':_0x12bf73,'lock':_0x12bf73['LOCK'][_0xc439('0x47')],'include':_0x6496a9[_0xc439('0x16')]?_0x6496a9['options']['include']?_[_0xc439('0x19')](_0x6496a9[_0xc439('0x16')]['include'],function(_0x30e027){return{'model':db[_0x30e027[_0xc439('0x1a')]],'as':_0x30e027['as'],'attributes':_0x30e027[_0xc439('0x17')],'include':_0x30e027['include']?_[_0xc439('0x19')](_0x30e027[_0xc439('0x18')],function(_0x667d4b){return{'model':db[_0x667d4b['model']],'as':_0x667d4b['as'],'attributes':_0x667d4b[_0xc439('0x17')],'include':_0x667d4b[_0xc439('0x18')]?_[_0xc439('0x19')](_0x667d4b[_0xc439('0x18')],function(_0x311252){return{'model':db[_0x311252['model']],'as':_0x311252['as'],'attributes':_0x311252[_0xc439('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc439('0x1e')](function(_0x8c77d){var _0x1fd9c8=[];for(var _0x382a04=0x0;_0x382a04<_0x8c77d[_0xc439('0x33')];_0x382a04+=0x1){_0x1fd9c8[_0xc439('0x34')](_0x8c77d[_0x382a04][_0xc439('0x25')](_0x6496a9[_0xc439('0x22')],{'transaction':_0x12bf73}));}return BPromise[_0xc439('0x36')](_0x1fd9c8);});})['then'](function(_0x1e72e9){logger[_0xc439('0xb')](_0xc439('0x44'),_0x6496a9);logger['debug'](_0xc439('0x44'),_0x6496a9,JSON['stringify'](_0x1e72e9));_0x632179(_0x1e72e9);})['catch'](function(_0x227584){logger[_0xc439('0x11')](_0xc439('0x44'),_0x227584[_0xc439('0x13')],_0x6496a9);_0x402bf7(_0x39ad44[_0xc439('0x11')](0x1f4,_0x227584[_0xc439('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x349bdd){var _0x3d1bf1=this;return new Promise(function(_0x51e4c4,_0x3a8732){db['CmContact'][_0xc439('0x2a')]()[_0xc439('0x1e')](function(_0x28c0da){return db[_0xc439('0x20')][_0xc439('0x15')]({'raw':_0x349bdd['options']?_0x349bdd['options'][_0xc439('0x23')]===undefined?!![]:![]:!![],'where':_0x349bdd[_0xc439('0x16')]?_0x349bdd['options'][_0xc439('0x1d')]||null:null,'attributes':_0x349bdd[_0xc439('0x16')]?_0x349bdd['options'][_0xc439('0x17')]||null:null,'limit':_0x349bdd['options']?_0x349bdd[_0xc439('0x16')][_0xc439('0x2d')]||null:null,'include':_0x349bdd[_0xc439('0x16')]?_0x349bdd['options']['include']?_['map'](_0x349bdd[_0xc439('0x16')][_0xc439('0x18')],function(_0x53ce4a){return{'model':db[_0x53ce4a[_0xc439('0x1a')]],'as':_0x53ce4a['as'],'attributes':_0x53ce4a['as']==='Contact'?_[_0xc439('0x30')](_0x28c0da):_0x53ce4a[_0xc439('0x17')],'include':_0x53ce4a[_0xc439('0x18')]?_[_0xc439('0x19')](_0x53ce4a['include'],function(_0x1f5dd0){return{'model':db[_0x1f5dd0['model']],'as':_0x1f5dd0['as'],'attributes':_0x1f5dd0[_0xc439('0x17')],'include':_0x1f5dd0[_0xc439('0x18')]?_['map'](_0x1f5dd0[_0xc439('0x18')],function(_0x3c1bb5){return{'model':db[_0x3c1bb5['model']],'as':_0x3c1bb5['as'],'attributes':_0x3c1bb5['attributes']};}):[]};}):[]};}):[]:[]})[_0xc439('0x1e')](function(_0x372846){logger['info'](_0xc439('0x1b'),_0x349bdd);logger[_0xc439('0xd')](_0xc439('0x1b'),_0x349bdd,JSON[_0xc439('0x10')](_0x372846));_0x51e4c4(_0x372846);})['catch'](function(_0x3b1436){logger[_0xc439('0x11')](_0xc439('0x1b'),_0x3b1436['message'],_0x349bdd);_0x3a8732(_0x3d1bf1[_0xc439('0x11')](0x1f4,_0x3b1436[_0xc439('0x13')]));});});});};exports['GetContactByPhone']=function(_0x2a7b92){var _0xaebda8=this;return new Promise(function(_0x4d1278,_0x6ae1b1){return db[_0xc439('0x29')]['findOne']({'raw':!![],'where':{'phone':_0x2a7b92['options'][_0xc439('0x1d')][_0xc439('0x48')]},'attributes':['id',_0xc439('0x49')],'order':[['id',_0xc439('0x4a')]]})[_0xc439('0x1e')](function(_0x16515c){logger[_0xc439('0xb')]('getContactByPhone',_0x2a7b92);logger[_0xc439('0xd')](_0xc439('0x4b'),_0x2a7b92,JSON[_0xc439('0x10')](_0x16515c));_0x4d1278(_0x16515c);})[_0xc439('0x14')](function(_0x277520){logger[_0xc439('0x11')]('getContactByPhone',_0x277520[_0xc439('0x13')],_0x2a7b92);_0x6ae1b1(_0xaebda8[_0xc439('0x11')](0x1f4,_0x277520[_0xc439('0x13')]));});});};exports[_0xc439('0x4c')]=function(_0x18b38b){var _0x48bed0=this;return new Promise(function(_0xbc9e07,_0x5e012f){return db['sequelize'][_0xc439('0x2c')](function(_0x1a5c33){return db[_0xc439('0x20')][_0xc439('0x25')]({'active':![]},{'where':{},'transaction':_0x1a5c33})['then'](function(_0x5c2a88){logger[_0xc439('0xb')](_0xc439('0x4c'),_0x18b38b);logger[_0xc439('0xd')](_0xc439('0x4c'),_0x18b38b,JSON[_0xc439('0x10')](_0x5c2a88));_0xbc9e07(_0x5c2a88);})[_0xc439('0x14')](function(_0x2df013){logger[_0xc439('0x11')]('ResetActiveCalls',_0x2df013['message'],_0x18b38b);_0x5e012f(_0x48bed0[_0xc439('0x11')](0x1f4,_0x2df013[_0xc439('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3f876){var _0x276703=this;var _0x2f4739=_0x3f876[_0xc439('0x22')][_0xc439('0x1d')][_0xc439('0x4d')];var _0xe32cd1=_0x3f876[_0xc439('0x22')][_0xc439('0x1d')]['interval'];return new Promise(function(_0x2ef8da,_0x14d5cf){return db[_0xc439('0x20')][_0xc439('0x15')]({'where':{'voiceQueueId':_0x2f4739,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xc439('0x2b')]['literal'](_0xc439('0x4e')+_0xe32cd1+_0xc439('0x4f'))}},'include':[{'model':db[_0xc439('0x29')],'as':'Contact'},{'model':db[_0xc439('0x50')],'as':_0xc439('0x31'),'attributes':['id',_0xc439('0x51'),_0xc439('0x32')]},{'model':db[_0xc439('0x52')],'as':'List'}]})['then'](function(_0x460c4c){return db[_0xc439('0x2b')][_0xc439('0x2c')](function(_0x3acd8b){return db['CmHopper']['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x2f4739,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xc439('0x2b')][_0xc439('0x53')](_0xc439('0x4e')+_0xe32cd1+_0xc439('0x4f'))}},'transaction':_0x3acd8b})[_0xc439('0x1e')](function(_0x31d009){_0x2ef8da(_0x460c4c);})[_0xc439('0x14')](function(_0x3eae7b){logger[_0xc439('0x11')](_0xc439('0x54'),_0x3eae7b[_0xc439('0x13')],_0x3f876);_0x14d5cf(validateExpressRequest);});});})['catch'](function(_0x3828c8){logger[_0xc439('0x11')](_0xc439('0x54'),_0x3828c8['message'],_0x3f876);_0x14d5cf(_0x276703[_0xc439('0x11')](0x1f4,_0x3828c8[_0xc439('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4806f54..1153d3c 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 _0xc44d=['index','isAuthenticated','/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xc44d,0xc6));var _0xdc44=function(_0x5f4e8c,_0x4f2b92){_0x5f4e8c=_0x5f4e8c-0x0;var _0x388477=_0xc44d[_0x5f4e8c];return _0x388477;};'use strict';var multer=require(_0xdc44('0x0'));var util=require('util');var path=require(_0xdc44('0x1'));var timeout=require(_0xdc44('0x2'));var express=require(_0xdc44('0x3'));var router=express['Router']();var fs_extra=require(_0xdc44('0x4'));var auth=require(_0xdc44('0x5'));var interaction=require(_0xdc44('0x6'));var config=require(_0xdc44('0x7'));var controller=require('./cmHopper.controller');router[_0xdc44('0x8')]('/',auth['isAuthenticated'](),controller[_0xdc44('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xdc44('0x8')]('/opencontacts',auth[_0xdc44('0xa')](),controller['getOpenContacts']);router[_0xdc44('0x8')]('/timezones',auth[_0xdc44('0xa')](),controller['getTimezones']);router[_0xdc44('0x8')](_0xdc44('0xb'),auth[_0xdc44('0xa')](),controller[_0xdc44('0xc')]);router[_0xdc44('0xd')]('/',auth['isAuthenticated'](),controller[_0xdc44('0xe')]);router[_0xdc44('0xd')](_0xdc44('0xf'),auth['isAuthenticated'](),controller[_0xdc44('0x10')]);router['post'](_0xdc44('0x11'),auth[_0xdc44('0xa')](),controller[_0xdc44('0x12')]);router['post'](_0xdc44('0x13'),auth[_0xdc44('0xa')](),controller[_0xdc44('0x14')]);router['put'](_0xdc44('0xb'),auth[_0xdc44('0xa')](),controller['update']);router[_0xdc44('0x15')](_0xdc44('0xb'),auth[_0xdc44('0xa')](),controller['destroy']);module[_0xdc44('0x16')]=router; \ No newline at end of file +var _0x61b8=['/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','put','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones'];(function(_0x35b477,_0x540956){var _0x3129fe=function(_0x445502){while(--_0x445502){_0x35b477['push'](_0x35b477['shift']());}};_0x3129fe(++_0x540956);}(_0x61b8,0x169));var _0x861b=function(_0x80fef4,_0x2bc941){_0x80fef4=_0x80fef4-0x0;var _0x52e729=_0x61b8[_0x80fef4];return _0x52e729;};'use strict';var multer=require(_0x861b('0x0'));var util=require(_0x861b('0x1'));var path=require(_0x861b('0x2'));var timeout=require('connect-timeout');var express=require(_0x861b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x861b('0x4'));var interaction=require(_0x861b('0x5'));var config=require(_0x861b('0x6'));var controller=require('./cmHopper.controller');router[_0x861b('0x7')]('/',auth[_0x861b('0x8')](),controller[_0x861b('0x9')]);router[_0x861b('0x7')](_0x861b('0xa'),auth[_0x861b('0x8')](),controller[_0x861b('0xb')]);router[_0x861b('0x7')](_0x861b('0xc'),auth[_0x861b('0x8')](),controller[_0x861b('0xd')]);router['get'](_0x861b('0xe'),auth[_0x861b('0x8')](),controller[_0x861b('0xf')]);router['get'](_0x861b('0x10'),auth['isAuthenticated'](),controller[_0x861b('0x11')]);router[_0x861b('0x12')]('/',auth['isAuthenticated'](),controller[_0x861b('0x13')]);router[_0x861b('0x12')](_0x861b('0x14'),auth[_0x861b('0x8')](),controller[_0x861b('0x15')]);router[_0x861b('0x12')](_0x861b('0x16'),auth[_0x861b('0x8')](),controller[_0x861b('0x17')]);router[_0x861b('0x12')](_0x861b('0x18'),auth[_0x861b('0x8')](),controller[_0x861b('0x19')]);router[_0x861b('0x1a')](_0x861b('0x10'),auth[_0x861b('0x8')](),controller['update']);router[_0x861b('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x861b('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index d565214..6d7c0ad 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 _0xf939=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x463e0a,_0x33759d){var _0x1421fb=function(_0xabe2de){while(--_0xabe2de){_0x463e0a['push'](_0x463e0a['shift']());}};_0x1421fb(++_0x33759d);}(_0xf939,0x1b8));var _0x9f93=function(_0x332d96,_0x14f151){_0x332d96=_0x332d96-0x0;var _0x23fb32=_0xf939[_0x332d96];return _0x23fb32;};'use strict';var moment=require(_0x9f93('0x0'));var Sequelize=require('sequelize');module[_0x9f93('0x1')]={'phone':{'type':Sequelize[_0x9f93('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9f93('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x9f93('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9f93('0x3')],'unique':_0x9f93('0x4')}}; \ No newline at end of file +var _0xe5e0=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x4ae179,_0x16858c){var _0x35a254=function(_0x2a7c6c){while(--_0x2a7c6c){_0x4ae179['push'](_0x4ae179['shift']());}};_0x35a254(++_0x16858c);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x438c2f,_0x2dfc44){_0x438c2f=_0x438c2f-0x0;var _0x272147=_0xe5e0[_0x438c2f];return _0x272147;};'use strict';var moment=require(_0x0e5e('0x0'));var Sequelize=require(_0x0e5e('0x1'));module[_0x0e5e('0x2')]={'phone':{'type':Sequelize[_0x0e5e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0e5e('0x4')],'unique':_0x0e5e('0x5')},'ListId':{'type':Sequelize[_0x0e5e('0x4')],'unique':_0x0e5e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x0e5e('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9778fb1..d8b1b31 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 _0xc7e3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperBlack','includeAll','findAll','rows','catch','show','rawAttributes','include','find','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0xff9ce4,_0x583317){var _0x29ebe1=function(_0x2dab13){while(--_0x2dab13){_0xff9ce4['push'](_0xff9ce4['shift']());}};_0x29ebe1(++_0x583317);}(_0xc7e3,0x15c));var _0x3c7e=function(_0xec0fbd,_0x4dbcdb){_0xec0fbd=_0xec0fbd-0x0;var _0x24a373=_0xc7e3[_0xec0fbd];return _0x24a373;};'use strict';var emlformat=require(_0x3c7e('0x0'));var rimraf=require(_0x3c7e('0x1'));var zipdir=require(_0x3c7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3c7e('0x3'));var BPromise=require(_0x3c7e('0x4'));var Mustache=require(_0x3c7e('0x5'));var util=require(_0x3c7e('0x6'));var path=require(_0x3c7e('0x7'));var sox=require(_0x3c7e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c7e('0x9'));var _=require(_0x3c7e('0xa'));var squel=require(_0x3c7e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c7e('0xc'));var toCsv=require(_0x3c7e('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c7e('0xe'));var authService=require(_0x3c7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3c7e('0x10'));var hardwareService=require(_0x3c7e('0x11'));var logger=require(_0x3c7e('0x12'))(_0x3c7e('0x13'));var utils=require(_0x3c7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3c7e('0x15'));var db=require(_0x3c7e('0x16'))['db'];function respondWithStatusCode(_0x124bf1,_0xbfeaca){_0xbfeaca=_0xbfeaca||0xcc;return function(_0x16e335){if(_0x16e335){return _0x124bf1[_0x3c7e('0x17')](_0xbfeaca);}return _0x124bf1[_0x3c7e('0x18')](_0xbfeaca)[_0x3c7e('0x19')]();};}function respondWithResult(_0x57a65a,_0x487d22){_0x487d22=_0x487d22||0xc8;return function(_0x3e3447){if(_0x3e3447){return _0x57a65a[_0x3c7e('0x18')](_0x487d22)[_0x3c7e('0x1a')](_0x3e3447);}};}function respondWithFilteredResult(_0xae2f51,_0x389921){return function(_0x2a0f77){if(_0x2a0f77){var _0x3e4f7b=typeof _0x389921[_0x3c7e('0x1b')]===_0x3c7e('0x1c')&&typeof _0x389921[_0x3c7e('0x1d')]===_0x3c7e('0x1c');var _0x1b0176=_0x2a0f77[_0x3c7e('0x1e')];var _0xcdcfd3=_0x3e4f7b?0x0:_0x389921[_0x3c7e('0x1b')];var _0x1c1795=_0x3e4f7b?_0x2a0f77[_0x3c7e('0x1e')]:_0x389921[_0x3c7e('0x1b')]+_0x389921[_0x3c7e('0x1d')];var _0x275fc4;if(_0x1c1795>=_0x1b0176){_0x1c1795=_0x1b0176;_0x275fc4=0xc8;}else{_0x275fc4=0xce;}_0xae2f51[_0x3c7e('0x18')](_0x275fc4);return _0xae2f51[_0x3c7e('0x1f')](_0x3c7e('0x20'),_0xcdcfd3+'-'+_0x1c1795+'/'+_0x1b0176)[_0x3c7e('0x1a')](_0x2a0f77);}return null;};}function patchUpdates(_0x5e7b09){return function(_0x3acf00){try{jsonpatch[_0x3c7e('0x21')](_0x3acf00,_0x5e7b09,!![]);}catch(_0x2523e6){return BPromise[_0x3c7e('0x22')](_0x2523e6);}return _0x3acf00['save']();};}function saveUpdates(_0x1c20cf,_0x57a032){return function(_0x4a50d7){if(_0x4a50d7){return _0x4a50d7[_0x3c7e('0x23')](_0x1c20cf)[_0x3c7e('0x24')](function(_0x55ff9b){return _0x55ff9b;});}return null;};}function removeEntity(_0x538530,_0x26e85a){return function(_0x32ed0b){if(_0x32ed0b){return _0x32ed0b[_0x3c7e('0x25')]()[_0x3c7e('0x24')](function(){_0x538530[_0x3c7e('0x18')](0xcc)[_0x3c7e('0x19')]();});}};}function handleEntityNotFound(_0x5e9c92,_0x10311e){return function(_0x5b935d){if(!_0x5b935d){_0x5e9c92[_0x3c7e('0x17')](0x194);}return _0x5b935d;};}function handleError(_0x1eec40,_0x45379f){_0x45379f=_0x45379f||0x1f4;return function(_0x29c471){logger['error'](_0x29c471[_0x3c7e('0x26')]);if(_0x29c471['name']){delete _0x29c471[_0x3c7e('0x27')];}_0x1eec40[_0x3c7e('0x18')](_0x45379f)['send'](_0x29c471);};}exports['index']=function(_0x45e813,_0x40a264){var _0x1f0788={},_0xe8f7f7={},_0x1f5910={'count':0x0,'rows':[]};var _0x199785=_[_0x3c7e('0x28')](db['CmHopperBlack']['rawAttributes'],function(_0x37bc2b){return{'name':_0x37bc2b[_0x3c7e('0x29')],'type':_0x37bc2b[_0x3c7e('0x2a')][_0x3c7e('0x2b')]};});_0xe8f7f7[_0x3c7e('0x2c')]=_['map'](_0x199785,_0x3c7e('0x27'));_0xe8f7f7['query']=_[_0x3c7e('0x2d')](_0x45e813[_0x3c7e('0x2e')]);_0xe8f7f7[_0x3c7e('0x2f')]=_[_0x3c7e('0x30')](_0xe8f7f7[_0x3c7e('0x2c')],_0xe8f7f7[_0x3c7e('0x2e')]);_0x1f0788[_0x3c7e('0x31')]=_[_0x3c7e('0x30')](_0xe8f7f7[_0x3c7e('0x2c')],qs[_0x3c7e('0x32')](_0x45e813[_0x3c7e('0x2e')][_0x3c7e('0x32')]));_0x1f0788[_0x3c7e('0x31')]=_0x1f0788[_0x3c7e('0x31')][_0x3c7e('0x33')]?_0x1f0788[_0x3c7e('0x31')]:_0xe8f7f7[_0x3c7e('0x2c')];if(!_0x45e813['query'][_0x3c7e('0x34')](_0x3c7e('0x35'))){_0x1f0788[_0x3c7e('0x1d')]=qs[_0x3c7e('0x1d')](_0x45e813[_0x3c7e('0x2e')][_0x3c7e('0x1d')]);_0x1f0788[_0x3c7e('0x1b')]=qs['offset'](_0x45e813[_0x3c7e('0x2e')]['offset']);}_0x1f0788[_0x3c7e('0x36')]=qs[_0x3c7e('0x37')](_0x45e813[_0x3c7e('0x2e')][_0x3c7e('0x37')]);_0x1f0788[_0x3c7e('0x38')]=qs[_0x3c7e('0x2f')](_[_0x3c7e('0x39')](_0x45e813['query'],_0xe8f7f7[_0x3c7e('0x2f')]),_0x199785);if(_0x45e813[_0x3c7e('0x2e')][_0x3c7e('0x3a')]){_0x1f0788[_0x3c7e('0x38')]=_['merge'](_0x1f0788[_0x3c7e('0x38')],{'$or':_['map'](_0x199785,function(_0x2c8126){if(_0x2c8126[_0x3c7e('0x2a')]!==_0x3c7e('0x3b')){var _0x440b55={};_0x440b55[_0x2c8126[_0x3c7e('0x27')]]={'$like':'%'+_0x45e813[_0x3c7e('0x2e')]['filter']+'%'};return _0x440b55;}})});}_0x1f0788=_[_0x3c7e('0x3c')]({},_0x1f0788,_0x45e813[_0x3c7e('0x3d')]);var _0x37c23e={'where':_0x1f0788[_0x3c7e('0x38')]};return db[_0x3c7e('0x3e')]['count'](_0x37c23e)[_0x3c7e('0x24')](function(_0x26cfa2){_0x1f5910['count']=_0x26cfa2;if(_0x45e813[_0x3c7e('0x2e')][_0x3c7e('0x3f')]){_0x1f0788['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3c7e('0x40')](_0x1f0788);})['then'](function(_0x1b0126){_0x1f5910[_0x3c7e('0x41')]=_0x1b0126;return _0x1f5910;})[_0x3c7e('0x24')](respondWithFilteredResult(_0x40a264,_0x1f0788))[_0x3c7e('0x42')](handleError(_0x40a264,null));};exports[_0x3c7e('0x43')]=function(_0xf773bb,_0x82779c){var _0x7f7957={'raw':!![],'where':{'id':_0xf773bb['params']['id']}},_0x351822={};_0x351822[_0x3c7e('0x2c')]=_[_0x3c7e('0x2d')](db[_0x3c7e('0x3e')][_0x3c7e('0x44')]);_0x351822['query']=_[_0x3c7e('0x2d')](_0xf773bb[_0x3c7e('0x2e')]);_0x351822['filters']=_['intersection'](_0x351822[_0x3c7e('0x2c')],_0x351822['query']);_0x7f7957[_0x3c7e('0x31')]=_[_0x3c7e('0x30')](_0x351822[_0x3c7e('0x2c')],qs[_0x3c7e('0x32')](_0xf773bb[_0x3c7e('0x2e')][_0x3c7e('0x32')]));_0x7f7957['attributes']=_0x7f7957[_0x3c7e('0x31')]['length']?_0x7f7957[_0x3c7e('0x31')]:_0x351822[_0x3c7e('0x2c')];if(_0xf773bb[_0x3c7e('0x2e')][_0x3c7e('0x3f')]){_0x7f7957[_0x3c7e('0x45')]=[{'all':!![]}];}_0x7f7957=_['merge']({},_0x7f7957,_0xf773bb[_0x3c7e('0x3d')]);return db[_0x3c7e('0x3e')][_0x3c7e('0x46')](_0x7f7957)[_0x3c7e('0x24')](handleEntityNotFound(_0x82779c,null))[_0x3c7e('0x24')](respondWithResult(_0x82779c,null))[_0x3c7e('0x42')](handleError(_0x82779c,null));};exports['update']=function(_0x27f6e5,_0x33d348){if(_0x27f6e5[_0x3c7e('0x47')]['id']){delete _0x27f6e5['body']['id'];}return db[_0x3c7e('0x3e')]['find']({'where':{'id':_0x27f6e5['params']['id']}})[_0x3c7e('0x24')](handleEntityNotFound(_0x33d348,null))['then'](saveUpdates(_0x27f6e5['body'],null))[_0x3c7e('0x24')](respondWithResult(_0x33d348,null))['catch'](handleError(_0x33d348,null));};exports[_0x3c7e('0x25')]=function(_0x50448a,_0x530510){return db[_0x3c7e('0x3e')][_0x3c7e('0x46')]({'where':{'id':_0x50448a[_0x3c7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x530510,null))[_0x3c7e('0x24')](removeEntity(_0x530510,null))[_0x3c7e('0x42')](handleError(_0x530510,null));};exports['describe']=function(_0x1d8a14,_0x184c44){return db[_0x3c7e('0x3e')][_0x3c7e('0x49')]()[_0x3c7e('0x24')](respondWithResult(_0x184c44,null))[_0x3c7e('0x42')](handleError(_0x184c44,null));}; \ No newline at end of file +var _0x2a34=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0xaaf060,_0x1297c5){var _0x5f4ed6=function(_0x35d38f){while(--_0x35d38f){_0xaaf060['push'](_0xaaf060['shift']());}};_0x5f4ed6(++_0x1297c5);}(_0x2a34,0x78));var _0x42a3=function(_0x3be887,_0x591013){_0x3be887=_0x3be887-0x0;var _0x214fc8=_0x2a34[_0x3be887];return _0x214fc8;};'use strict';var emlformat=require(_0x42a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42a3('0x1'));var jsonpatch=require(_0x42a3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x42a3('0x3'));var Mustache=require('mustache');var util=require(_0x42a3('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x42a3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42a3('0x6'));var _=require(_0x42a3('0x7'));var squel=require(_0x42a3('0x8'));var crypto=require(_0x42a3('0x9'));var jsforce=require(_0x42a3('0xa'));var deskjs=require(_0x42a3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x42a3('0xc'));var Papa=require(_0x42a3('0xd'));var Redis=require('ioredis');var authService=require(_0x42a3('0xe'));var qs=require(_0x42a3('0xf'));var as=require(_0x42a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42a3('0x11'))(_0x42a3('0x12'));var utils=require('../../config/utils');var config=require(_0x42a3('0x13'));var licenseUtil=require(_0x42a3('0x14'));var db=require(_0x42a3('0x15'))['db'];function respondWithStatusCode(_0x49bd48,_0x2d5f2c){_0x2d5f2c=_0x2d5f2c||0xcc;return function(_0x422ee6){if(_0x422ee6){return _0x49bd48[_0x42a3('0x16')](_0x2d5f2c);}return _0x49bd48[_0x42a3('0x17')](_0x2d5f2c)[_0x42a3('0x18')]();};}function respondWithResult(_0x369ea1,_0xbddba){_0xbddba=_0xbddba||0xc8;return function(_0x39c805){if(_0x39c805){return _0x369ea1[_0x42a3('0x17')](_0xbddba)[_0x42a3('0x19')](_0x39c805);}};}function respondWithFilteredResult(_0x542d81,_0x5e8eb6){return function(_0x3e4c04){if(_0x3e4c04){var _0x3093a0=typeof _0x5e8eb6['offset']==='undefined'&&typeof _0x5e8eb6[_0x42a3('0x1a')]===_0x42a3('0x1b');var _0x53b559=_0x3e4c04[_0x42a3('0x1c')];var _0x1dab60=_0x3093a0?0x0:_0x5e8eb6[_0x42a3('0x1d')];var _0x339978=_0x3093a0?_0x3e4c04[_0x42a3('0x1c')]:_0x5e8eb6[_0x42a3('0x1d')]+_0x5e8eb6[_0x42a3('0x1a')];var _0x1db849;if(_0x339978>=_0x53b559){_0x339978=_0x53b559;_0x1db849=0xc8;}else{_0x1db849=0xce;}_0x542d81[_0x42a3('0x17')](_0x1db849);return _0x542d81[_0x42a3('0x1e')](_0x42a3('0x1f'),_0x1dab60+'-'+_0x339978+'/'+_0x53b559)[_0x42a3('0x19')](_0x3e4c04);}return null;};}function patchUpdates(_0x5aefc1){return function(_0xc5f631){try{jsonpatch[_0x42a3('0x20')](_0xc5f631,_0x5aefc1,!![]);}catch(_0x104c68){return BPromise[_0x42a3('0x21')](_0x104c68);}return _0xc5f631[_0x42a3('0x22')]();};}function saveUpdates(_0x3bc715,_0xc2aaa7){return function(_0x5d1343){if(_0x5d1343){return _0x5d1343[_0x42a3('0x23')](_0x3bc715)[_0x42a3('0x24')](function(_0x44c2bd){return _0x44c2bd;});}return null;};}function removeEntity(_0x2c170d,_0x1b0bc5){return function(_0xddf3a){if(_0xddf3a){return _0xddf3a['destroy']()[_0x42a3('0x24')](function(){_0x2c170d['status'](0xcc)[_0x42a3('0x18')]();});}};}function handleEntityNotFound(_0x3badd2,_0x3f1b77){return function(_0x2687bd){if(!_0x2687bd){_0x3badd2[_0x42a3('0x16')](0x194);}return _0x2687bd;};}function handleError(_0x47f922,_0x417531){_0x417531=_0x417531||0x1f4;return function(_0x6731de){logger[_0x42a3('0x25')](_0x6731de['stack']);if(_0x6731de['name']){delete _0x6731de[_0x42a3('0x26')];}_0x47f922['status'](_0x417531)[_0x42a3('0x27')](_0x6731de);};}exports[_0x42a3('0x28')]=function(_0x28b1c6,_0x3fa1c5){var _0x3eb9f6={},_0x417ea1={},_0x2d4a45={'count':0x0,'rows':[]};var _0x45983d=_[_0x42a3('0x29')](db[_0x42a3('0x2a')][_0x42a3('0x2b')],function(_0x362fe5){return{'name':_0x362fe5[_0x42a3('0x2c')],'type':_0x362fe5['type'][_0x42a3('0x2d')]};});_0x417ea1['model']=_[_0x42a3('0x29')](_0x45983d,_0x42a3('0x26'));_0x417ea1['query']=_[_0x42a3('0x2e')](_0x28b1c6[_0x42a3('0x2f')]);_0x417ea1[_0x42a3('0x30')]=_[_0x42a3('0x31')](_0x417ea1['model'],_0x417ea1['query']);_0x3eb9f6[_0x42a3('0x32')]=_[_0x42a3('0x31')](_0x417ea1[_0x42a3('0x33')],qs[_0x42a3('0x34')](_0x28b1c6[_0x42a3('0x2f')]['fields']));_0x3eb9f6[_0x42a3('0x32')]=_0x3eb9f6['attributes']['length']?_0x3eb9f6[_0x42a3('0x32')]:_0x417ea1[_0x42a3('0x33')];if(!_0x28b1c6[_0x42a3('0x2f')]['hasOwnProperty']('nolimit')){_0x3eb9f6[_0x42a3('0x1a')]=qs['limit'](_0x28b1c6[_0x42a3('0x2f')]['limit']);_0x3eb9f6[_0x42a3('0x1d')]=qs[_0x42a3('0x1d')](_0x28b1c6['query']['offset']);}_0x3eb9f6[_0x42a3('0x35')]=qs[_0x42a3('0x36')](_0x28b1c6[_0x42a3('0x2f')][_0x42a3('0x36')]);_0x3eb9f6[_0x42a3('0x37')]=qs['filters'](_[_0x42a3('0x38')](_0x28b1c6['query'],_0x417ea1[_0x42a3('0x30')]),_0x45983d);if(_0x28b1c6['query'][_0x42a3('0x39')]){_0x3eb9f6['where']=_[_0x42a3('0x3a')](_0x3eb9f6[_0x42a3('0x37')],{'$or':_['map'](_0x45983d,function(_0x96c3a4){if(_0x96c3a4['type']!==_0x42a3('0x3b')){var _0x3dd815={};_0x3dd815[_0x96c3a4[_0x42a3('0x26')]]={'$like':'%'+_0x28b1c6[_0x42a3('0x2f')][_0x42a3('0x39')]+'%'};return _0x3dd815;}})});}_0x3eb9f6=_[_0x42a3('0x3a')]({},_0x3eb9f6,_0x28b1c6[_0x42a3('0x3c')]);var _0x359c6c={'where':_0x3eb9f6[_0x42a3('0x37')]};return db['CmHopperBlack'][_0x42a3('0x1c')](_0x359c6c)[_0x42a3('0x24')](function(_0x5afeb4){_0x2d4a45['count']=_0x5afeb4;if(_0x28b1c6[_0x42a3('0x2f')][_0x42a3('0x3d')]){_0x3eb9f6[_0x42a3('0x3e')]=[{'all':!![]}];}return db[_0x42a3('0x2a')]['findAll'](_0x3eb9f6);})[_0x42a3('0x24')](function(_0x474f3e){_0x2d4a45[_0x42a3('0x3f')]=_0x474f3e;return _0x2d4a45;})[_0x42a3('0x24')](respondWithFilteredResult(_0x3fa1c5,_0x3eb9f6))[_0x42a3('0x40')](handleError(_0x3fa1c5,null));};exports['show']=function(_0x3ac34d,_0x490f21){var _0x25bc88={'raw':!![],'where':{'id':_0x3ac34d[_0x42a3('0x41')]['id']}},_0x5a47b7={};_0x5a47b7[_0x42a3('0x33')]=_[_0x42a3('0x2e')](db['CmHopperBlack']['rawAttributes']);_0x5a47b7[_0x42a3('0x2f')]=_[_0x42a3('0x2e')](_0x3ac34d['query']);_0x5a47b7['filters']=_['intersection'](_0x5a47b7[_0x42a3('0x33')],_0x5a47b7[_0x42a3('0x2f')]);_0x25bc88[_0x42a3('0x32')]=_[_0x42a3('0x31')](_0x5a47b7[_0x42a3('0x33')],qs[_0x42a3('0x34')](_0x3ac34d[_0x42a3('0x2f')][_0x42a3('0x34')]));_0x25bc88['attributes']=_0x25bc88['attributes'][_0x42a3('0x42')]?_0x25bc88[_0x42a3('0x32')]:_0x5a47b7[_0x42a3('0x33')];if(_0x3ac34d[_0x42a3('0x2f')][_0x42a3('0x3d')]){_0x25bc88[_0x42a3('0x3e')]=[{'all':!![]}];}_0x25bc88=_[_0x42a3('0x3a')]({},_0x25bc88,_0x3ac34d['options']);return db[_0x42a3('0x2a')][_0x42a3('0x43')](_0x25bc88)[_0x42a3('0x24')](handleEntityNotFound(_0x490f21,null))['then'](respondWithResult(_0x490f21,null))[_0x42a3('0x40')](handleError(_0x490f21,null));};exports[_0x42a3('0x23')]=function(_0x3c9c8e,_0xb141c4){if(_0x3c9c8e[_0x42a3('0x44')]['id']){delete _0x3c9c8e[_0x42a3('0x44')]['id'];}return db[_0x42a3('0x2a')][_0x42a3('0x43')]({'where':{'id':_0x3c9c8e[_0x42a3('0x41')]['id']}})[_0x42a3('0x24')](handleEntityNotFound(_0xb141c4,null))['then'](saveUpdates(_0x3c9c8e[_0x42a3('0x44')],null))['then'](respondWithResult(_0xb141c4,null))['catch'](handleError(_0xb141c4,null));};exports['destroy']=function(_0x35bba7,_0x53463e){return db[_0x42a3('0x2a')][_0x42a3('0x43')]({'where':{'id':_0x35bba7[_0x42a3('0x41')]['id']}})[_0x42a3('0x24')](handleEntityNotFound(_0x53463e,null))[_0x42a3('0x24')](removeEntity(_0x53463e,null))[_0x42a3('0x40')](handleError(_0x53463e,null));};exports[_0x42a3('0x45')]=function(_0x202139,_0x18666a){return db[_0x42a3('0x2a')][_0x42a3('0x45')]()[_0x42a3('0x24')](respondWithResult(_0x18666a,null))[_0x42a3('0x40')](handleError(_0x18666a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9c4b7e8..9fc555a 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 _0xbcc9=['bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','moment'];(function(_0x2197c1,_0x5d09a5){var _0x438d1e=function(_0x184bcd){while(--_0x184bcd){_0x2197c1['push'](_0x2197c1['shift']());}};_0x438d1e(++_0x5d09a5);}(_0xbcc9,0xd9));var _0x9bcc=function(_0x1263c1,_0x287a24){_0x1263c1=_0x1263c1-0x0;var _0x59639e=_0xbcc9[_0x1263c1];return _0x59639e;};'use strict';var _=require(_0x9bcc('0x0'));var util=require(_0x9bcc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9bcc('0x2'));var BPromise=require(_0x9bcc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bcc('0x4'));var rimraf=require(_0x9bcc('0x5'));var config=require(_0x9bcc('0x6'));var attributes=require(_0x9bcc('0x7'));module[_0x9bcc('0x8')]=function(_0x1668de,_0x347750){return _0x1668de[_0x9bcc('0x9')]('CmHopperBlack',attributes,{'tableName':_0x9bcc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c28=['./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x561102,_0xb249e){var _0x5d56e0=function(_0x179fae){while(--_0x179fae){_0x561102['push'](_0x561102['shift']());}};_0x5d56e0(++_0xb249e);}(_0x5c28,0x170));var _0x85c2=function(_0x1873f7,_0x410287){_0x1873f7=_0x1873f7-0x0;var _0x64ca5b=_0x5c28[_0x1873f7];return _0x64ca5b;};'use strict';var _=require(_0x85c2('0x0'));var util=require(_0x85c2('0x1'));var logger=require(_0x85c2('0x2'))(_0x85c2('0x3'));var moment=require(_0x85c2('0x4'));var BPromise=require(_0x85c2('0x5'));var rp=require(_0x85c2('0x6'));var fs=require('fs');var path=require(_0x85c2('0x7'));var rimraf=require(_0x85c2('0x8'));var config=require(_0x85c2('0x9'));var attributes=require(_0x85c2('0xa'));module[_0x85c2('0xb')]=function(_0x2d867d,_0x14b9b9){return _0x2d867d['define'](_0x85c2('0xc'),attributes,{'tableName':_0x85c2('0xd'),'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 12d62eb..da3dc35 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 _0x5fd9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','body','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash'];(function(_0x1fa19c,_0x5c740b){var _0x5b332d=function(_0x289cb8){while(--_0x289cb8){_0x1fa19c['push'](_0x1fa19c['shift']());}};_0x5b332d(++_0x5c740b);}(_0x5fd9,0x74));var _0x95fd=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x5fd9[_0x2c534a];return _0x3f5c99;};'use strict';var _=require(_0x95fd('0x0'));var util=require(_0x95fd('0x1'));var moment=require(_0x95fd('0x2'));var BPromise=require(_0x95fd('0x3'));var rs=require(_0x95fd('0x4'));var fs=require('fs');var Redis=require(_0x95fd('0x5'));var db=require(_0x95fd('0x6'))['db'];var utils=require(_0x95fd('0x7'));var logger=require(_0x95fd('0x8'))(_0x95fd('0x9'));var config=require('../../config/environment');var jayson=require(_0x95fd('0xa'));var client=jayson[_0x95fd('0xb')][_0x95fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b8774,_0x38ee4b,_0x1b1d8b){return new BPromise(function(_0x4a1345,_0x37a66b){return client['request'](_0x2b8774,_0x1b1d8b)[_0x95fd('0xd')](function(_0x388c06){logger['info'](_0x95fd('0xe'),_0x38ee4b,_0x95fd('0xf'));logger[_0x95fd('0x10')](_0x95fd('0x11'),_0x38ee4b,'request\x20sent',JSON[_0x95fd('0x12')](_0x388c06));if(_0x388c06[_0x95fd('0x13')]){if(_0x388c06['error']['code']===0x1f4){logger['error'](_0x95fd('0xe'),_0x38ee4b,_0x388c06[_0x95fd('0x13')][_0x95fd('0x14')]);return _0x37a66b(_0x388c06[_0x95fd('0x13')][_0x95fd('0x14')]);}logger['error'](_0x95fd('0xe'),_0x38ee4b,_0x388c06[_0x95fd('0x13')]['message']);return _0x4a1345(_0x388c06[_0x95fd('0x13')][_0x95fd('0x14')]);}else{logger[_0x95fd('0x15')]('CmHopperBlack,\x20%s,\x20%s',_0x38ee4b,_0x95fd('0xf'));_0x4a1345(_0x388c06[_0x95fd('0x16')][_0x95fd('0x14')]);}})['catch'](function(_0x4eb0b0){logger[_0x95fd('0x13')](_0x95fd('0xe'),_0x38ee4b,_0x4eb0b0);_0x37a66b(_0x4eb0b0);});});}exports[_0x95fd('0x17')]=function(_0x366c62){var _0x398aa6=this;return new Promise(function(_0x1f4958,_0x4d0502){return db[_0x95fd('0x18')][_0x95fd('0x19')]({'raw':_0x366c62['options']?_0x366c62[_0x95fd('0x1a')][_0x95fd('0x1b')]===undefined?!![]:![]:!![],'where':_0x366c62[_0x95fd('0x1a')]?_0x366c62[_0x95fd('0x1a')][_0x95fd('0x1c')]||null:null,'attributes':_0x366c62[_0x95fd('0x1a')]?_0x366c62[_0x95fd('0x1a')][_0x95fd('0x1d')]||null:null,'limit':_0x366c62[_0x95fd('0x1a')]?_0x366c62['options'][_0x95fd('0x1e')]||null:null,'include':_0x366c62[_0x95fd('0x1a')]?_0x366c62['options'][_0x95fd('0x1f')]?_[_0x95fd('0x20')](_0x366c62[_0x95fd('0x1a')][_0x95fd('0x1f')],function(_0x45d3cd){return{'model':db[_0x45d3cd[_0x95fd('0x21')]],'as':_0x45d3cd['as'],'attributes':_0x45d3cd[_0x95fd('0x1d')],'include':_0x45d3cd[_0x95fd('0x1f')]?_[_0x95fd('0x20')](_0x45d3cd['include'],function(_0x4013a1){return{'model':db[_0x4013a1[_0x95fd('0x21')]],'as':_0x4013a1['as'],'attributes':_0x4013a1[_0x95fd('0x1d')],'include':_0x4013a1[_0x95fd('0x1f')]?_[_0x95fd('0x20')](_0x4013a1[_0x95fd('0x1f')],function(_0x4e707f){return{'model':db[_0x4e707f[_0x95fd('0x21')]],'as':_0x4e707f['as'],'attributes':_0x4e707f['attributes']};}):[]};}):[]};}):[]:[]})[_0x95fd('0xd')](function(_0x32e9cd){logger['info'](_0x95fd('0x17'),_0x366c62);logger['debug'](_0x95fd('0x17'),_0x366c62,JSON['stringify'](_0x32e9cd));_0x1f4958(_0x32e9cd);})[_0x95fd('0x22')](function(_0x54ff3d){logger[_0x95fd('0x13')](_0x95fd('0x17'),_0x54ff3d[_0x95fd('0x14')],_0x366c62);_0x4d0502(_0x398aa6[_0x95fd('0x13')](0x1f4,_0x54ff3d[_0x95fd('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x34458a){var _0x4b1a56=this;return new Promise(function(_0xa152d,_0x4e9a56){return db[_0x95fd('0x18')]['update'](_0x34458a[_0x95fd('0x23')],{'raw':_0x34458a[_0x95fd('0x1a')]?_0x34458a[_0x95fd('0x1a')][_0x95fd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34458a[_0x95fd('0x1a')]?_0x34458a[_0x95fd('0x1a')][_0x95fd('0x1c')]||null:null,'attributes':_0x34458a['options']?_0x34458a['options'][_0x95fd('0x1d')]||null:null,'limit':_0x34458a[_0x95fd('0x1a')]?_0x34458a[_0x95fd('0x1a')][_0x95fd('0x1e')]||null:null})[_0x95fd('0xd')](function(_0x3e024d){logger[_0x95fd('0x15')](_0x95fd('0x24'),_0x34458a);logger[_0x95fd('0x10')]('UpdateCmHopperBlack',_0x34458a,JSON[_0x95fd('0x12')](_0x3e024d));_0xa152d(_0x3e024d);})['catch'](function(_0x56964d){logger[_0x95fd('0x13')](_0x95fd('0x24'),_0x56964d['message'],_0x34458a);_0x4e9a56(_0x4b1a56[_0x95fd('0x13')](0x1f4,_0x56964d[_0x95fd('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x5e1a54){var _0x2070d6=this;return new Promise(function(_0x4cd4b0,_0x1c67be){return db[_0x95fd('0x18')][_0x95fd('0x25')]({'where':_0x5e1a54['options']?_0x5e1a54['options']['where']||null:null})[_0x95fd('0xd')](function(_0x36fd9b){logger['info'](_0x95fd('0x26'),_0x5e1a54);logger[_0x95fd('0x10')](_0x95fd('0x26'),_0x5e1a54,JSON[_0x95fd('0x12')](_0x36fd9b));_0x4cd4b0(_0x36fd9b);})[_0x95fd('0x22')](function(_0x3eb740){logger[_0x95fd('0x13')](_0x95fd('0x26'),_0x3eb740[_0x95fd('0x14')],_0x5e1a54);_0x1c67be(_0x2070d6[_0x95fd('0x13')](0x1f4,_0x3eb740[_0x95fd('0x14')]));});});}; \ No newline at end of file +var _0x84e8=['destroy','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','body','DestroyCmHopperBlack','CmHopperBlack'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x84e8,0x169));var _0x884e=function(_0x666bd8,_0x4766ac){_0x666bd8=_0x666bd8-0x0;var _0x35ec20=_0x84e8[_0x666bd8];return _0x35ec20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x884e('0x0'));var BPromise=require(_0x884e('0x1'));var rs=require(_0x884e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x884e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x884e('0x4'));var config=require(_0x884e('0x5'));var jayson=require(_0x884e('0x6'));var client=jayson[_0x884e('0x7')][_0x884e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x486def,_0x5bd441,_0x4e240f){return new BPromise(function(_0x12c390,_0x3d50f9){return client['request'](_0x486def,_0x4e240f)[_0x884e('0x9')](function(_0x20896a){logger[_0x884e('0xa')](_0x884e('0xb'),_0x5bd441,_0x884e('0xc'));logger[_0x884e('0xd')](_0x884e('0xe'),_0x5bd441,_0x884e('0xc'),JSON['stringify'](_0x20896a));if(_0x20896a[_0x884e('0xf')]){if(_0x20896a[_0x884e('0xf')][_0x884e('0x10')]===0x1f4){logger[_0x884e('0xf')](_0x884e('0xb'),_0x5bd441,_0x20896a[_0x884e('0xf')][_0x884e('0x11')]);return _0x3d50f9(_0x20896a[_0x884e('0xf')][_0x884e('0x11')]);}logger[_0x884e('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x5bd441,_0x20896a[_0x884e('0xf')][_0x884e('0x11')]);return _0x12c390(_0x20896a['error']['message']);}else{logger[_0x884e('0xa')](_0x884e('0xb'),_0x5bd441,_0x884e('0xc'));_0x12c390(_0x20896a[_0x884e('0x12')][_0x884e('0x11')]);}})[_0x884e('0x13')](function(_0x21b661){logger['error'](_0x884e('0xb'),_0x5bd441,_0x21b661);_0x3d50f9(_0x21b661);});});}exports[_0x884e('0x14')]=function(_0x1b9ab1){var _0x45e5c4=this;return new Promise(function(_0x422d8b,_0x4c9523){return db['CmHopperBlack'][_0x884e('0x15')]({'raw':_0x1b9ab1[_0x884e('0x16')]?_0x1b9ab1[_0x884e('0x16')][_0x884e('0x17')]===undefined?!![]:![]:!![],'where':_0x1b9ab1[_0x884e('0x16')]?_0x1b9ab1[_0x884e('0x16')][_0x884e('0x18')]||null:null,'attributes':_0x1b9ab1[_0x884e('0x16')]?_0x1b9ab1[_0x884e('0x16')][_0x884e('0x19')]||null:null,'limit':_0x1b9ab1[_0x884e('0x16')]?_0x1b9ab1[_0x884e('0x16')][_0x884e('0x1a')]||null:null,'include':_0x1b9ab1[_0x884e('0x16')]?_0x1b9ab1[_0x884e('0x16')][_0x884e('0x1b')]?_[_0x884e('0x1c')](_0x1b9ab1[_0x884e('0x16')][_0x884e('0x1b')],function(_0xe002c4){return{'model':db[_0xe002c4[_0x884e('0x1d')]],'as':_0xe002c4['as'],'attributes':_0xe002c4[_0x884e('0x19')],'include':_0xe002c4[_0x884e('0x1b')]?_[_0x884e('0x1c')](_0xe002c4['include'],function(_0x1b9fbd){return{'model':db[_0x1b9fbd['model']],'as':_0x1b9fbd['as'],'attributes':_0x1b9fbd[_0x884e('0x19')],'include':_0x1b9fbd[_0x884e('0x1b')]?_[_0x884e('0x1c')](_0x1b9fbd[_0x884e('0x1b')],function(_0x3fa8a6){return{'model':db[_0x3fa8a6[_0x884e('0x1d')]],'as':_0x3fa8a6['as'],'attributes':_0x3fa8a6['attributes']};}):[]};}):[]};}):[]:[]})[_0x884e('0x9')](function(_0x31bf40){logger['info']('GetCmHopperBlack',_0x1b9ab1);logger[_0x884e('0xd')](_0x884e('0x14'),_0x1b9ab1,JSON[_0x884e('0x1e')](_0x31bf40));_0x422d8b(_0x31bf40);})[_0x884e('0x13')](function(_0x467c78){logger[_0x884e('0xf')](_0x884e('0x14'),_0x467c78['message'],_0x1b9ab1);_0x4c9523(_0x45e5c4[_0x884e('0xf')](0x1f4,_0x467c78[_0x884e('0x11')]));});});};exports[_0x884e('0x1f')]=function(_0x1d9d04){var _0x3212da=this;return new Promise(function(_0x5e64d5,_0x401f61){return db['CmHopperBlack']['update'](_0x1d9d04[_0x884e('0x20')],{'raw':_0x1d9d04[_0x884e('0x16')]?_0x1d9d04[_0x884e('0x16')][_0x884e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9d04['options']?_0x1d9d04['options'][_0x884e('0x18')]||null:null,'attributes':_0x1d9d04[_0x884e('0x16')]?_0x1d9d04['options'][_0x884e('0x19')]||null:null,'limit':_0x1d9d04[_0x884e('0x16')]?_0x1d9d04[_0x884e('0x16')][_0x884e('0x1a')]||null:null})[_0x884e('0x9')](function(_0x155f3d){logger[_0x884e('0xa')](_0x884e('0x1f'),_0x1d9d04);logger[_0x884e('0xd')](_0x884e('0x1f'),_0x1d9d04,JSON[_0x884e('0x1e')](_0x155f3d));_0x5e64d5(_0x155f3d);})[_0x884e('0x13')](function(_0x218fac){logger[_0x884e('0xf')](_0x884e('0x1f'),_0x218fac[_0x884e('0x11')],_0x1d9d04);_0x401f61(_0x3212da[_0x884e('0xf')](0x1f4,_0x218fac[_0x884e('0x11')]));});});};exports[_0x884e('0x21')]=function(_0x2dd960){var _0x29e575=this;return new Promise(function(_0x3afa9c,_0x23ea7d){return db[_0x884e('0x22')][_0x884e('0x23')]({'where':_0x2dd960[_0x884e('0x16')]?_0x2dd960[_0x884e('0x16')][_0x884e('0x18')]||null:null})[_0x884e('0x9')](function(_0x5cffd7){logger[_0x884e('0xa')](_0x884e('0x21'),_0x2dd960);logger[_0x884e('0xd')](_0x884e('0x21'),_0x2dd960,JSON[_0x884e('0x1e')](_0x5cffd7));_0x3afa9c(_0x5cffd7);})['catch'](function(_0x125164){logger[_0x884e('0xf')](_0x884e('0x21'),_0x125164[_0x884e('0x11')],_0x2dd960);_0x23ea7d(_0x29e575[_0x884e('0xf')](0x1f4,_0x125164[_0x884e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 99669f0..892d61f 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 _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x7d67f0,_0x241e0a){var _0x1bb0a5=function(_0x164b9c){while(--_0x164b9c){_0x7d67f0['push'](_0x7d67f0['shift']());}};_0x1bb0a5(++_0x241e0a);}(_0xf072,0x1cf));var _0x2f07=function(_0x57a65e,_0x33a406){_0x57a65e=_0x57a65e-0x0;var _0x3cfaf8=_0xf072[_0x57a65e];return _0x3cfaf8;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router; \ No newline at end of file +var _0xabce=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe'];(function(_0x13de3c,_0x38eb9f){var _0x2860f7=function(_0x1495aa){while(--_0x1495aa){_0x13de3c['push'](_0x13de3c['shift']());}};_0x2860f7(++_0x38eb9f);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xe')]);router[_0xeabc('0xf')](_0xeabc('0xd'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);module[_0xeabc('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 2793593..f59f9cf 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 _0x0c4b=['getDataValue','endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x558146,_0x26ee6d){var _0x565a12=function(_0x4c2543){while(--_0x4c2543){_0x558146['push'](_0x558146['shift']());}};_0x565a12(++_0x26ee6d);}(_0x0c4b,0x96));var _0xb0c4=function(_0x4ab7a6,_0x32b113){_0x4ab7a6=_0x4ab7a6-0x0;var _0x38d525=_0x0c4b[_0x4ab7a6];return _0x38d525;};'use strict';var Sequelize=require(_0xb0c4('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xb0c4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb0c4('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb0c4('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb0c4('0x2')]},'calleridnum':{'type':Sequelize[_0xb0c4('0x2')]},'calleridname':{'type':Sequelize[_0xb0c4('0x2')]},'starttime':{'type':Sequelize[_0xb0c4('0x3')]},'responsetime':{'type':Sequelize[_0xb0c4('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb0c4('0x3')]},'ringtime':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb0c4('0x2')]},'campaign':{'type':Sequelize[_0xb0c4('0x2')]},'campaigntype':{'type':Sequelize[_0xb0c4('0x2')]},'membername':{'type':Sequelize[_0xb0c4('0x2')]},'reason':{'type':Sequelize[_0xb0c4('0x2')]},'disposition':{'type':Sequelize[_0xb0c4('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb0c4('0x2')]},'dispositionat':{'type':Sequelize[_0xb0c4('0x3')],'set':function(_0xad22ac){var _0x1885d4=this[_0xb0c4('0x4')](_0xb0c4('0x5'));if(_0x1885d4&&_0xad22ac){this[_0xb0c4('0x6')]('followuptime',moment(_0xad22ac)[_0xb0c4('0x7')](moment(_0x1885d4),_0xb0c4('0x8')));}return this[_0xb0c4('0x6')](_0xb0c4('0x9'),_0xad22ac);}},'amd':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb0c4('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xb0c4('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb0c4('0x3')]},'recallme':{'type':Sequelize[_0xb0c4('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb0c4('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb0c4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5660=['INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x795414,_0x3e0fbf){var _0x40a4f9=function(_0x373828){while(--_0x373828){_0x795414['push'](_0x795414['shift']());}};_0x40a4f9(++_0x3e0fbf);}(_0x5660,0x72));var _0x0566=function(_0x175ea2,_0x172956){_0x175ea2=_0x175ea2-0x0;var _0x2bb788=_0x5660[_0x175ea2];return _0x2bb788;};'use strict';var Sequelize=require(_0x0566('0x0'));var moment=require(_0x0566('0x1'));module[_0x0566('0x2')]={'state':{'type':Sequelize[_0x0566('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0566('0x4')]},'countbusyretry':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0566('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x0566('0x5')]},'calleridnum':{'type':Sequelize[_0x0566('0x5')]},'calleridname':{'type':Sequelize[_0x0566('0x5')]},'starttime':{'type':Sequelize[_0x0566('0x4')]},'responsetime':{'type':Sequelize[_0x0566('0x4')]},'answertime':{'type':Sequelize[_0x0566('0x4')]},'droptime':{'type':Sequelize[_0x0566('0x4')]},'endtime':{'type':Sequelize[_0x0566('0x4')]},'ringtime':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0566('0x5')]},'campaigntype':{'type':Sequelize[_0x0566('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0566('0x5')]},'disposition':{'type':Sequelize[_0x0566('0x5')]},'secondDisposition':{'type':Sequelize[_0x0566('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0566('0x5')]},'dispositionat':{'type':Sequelize[_0x0566('0x4')],'set':function(_0x21b361){var _0x1f24ee=this[_0x0566('0x6')](_0x0566('0x7'));if(_0x1f24ee&&_0x21b361){this[_0x0566('0x8')](_0x0566('0x9'),moment(_0x21b361)['diff'](moment(_0x1f24ee),_0x0566('0xa')));}return this[_0x0566('0x8')](_0x0566('0xb'),_0x21b361);}},'amd':{'type':Sequelize[_0x0566('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0566('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0566('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0566('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0566('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0566('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0566('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0566('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0566('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0566('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 5308d8f..4753ccb 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 _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x187d,0x93));var _0xd187=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x187d[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file +var _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x433da7,_0x46c20a){var _0x4a465e=function(_0x24a1d4){while(--_0x24a1d4){_0x433da7['push'](_0x433da7['shift']());}};_0x4a465e(++_0x46c20a);}(_0x1623,0xab));var _0x3162=function(_0x437017,_0x244e4c){_0x437017=_0x437017-0x0;var _0x406e24=_0x1623[_0x437017];return _0x406e24;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['CmHopperFinal'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 060ff89..14c9796 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 _0xcda8=['exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./cmHopperFinal.attributes'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xcda8,0x1d9));var _0x8cda=function(_0x1118e6,_0x4be56f){_0x1118e6=_0x1118e6-0x0;var _0x1da930=_0xcda8[_0x1118e6];return _0x1da930;};'use strict';var _=require(_0x8cda('0x0'));var util=require(_0x8cda('0x1'));var logger=require(_0x8cda('0x2'))(_0x8cda('0x3'));var moment=require(_0x8cda('0x4'));var BPromise=require(_0x8cda('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cda('0x6'));var config=require('../../config/environment');var attributes=require(_0x8cda('0x7'));module[_0x8cda('0x8')]=function(_0xd78aa5,_0x1d0db0){return _0xd78aa5[_0x8cda('0x9')](_0x8cda('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x8cda('0xb'),'fields':['calleridnum']},{'name':_0x8cda('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9d4=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xb9d4,0x1d1));var _0x4b9d=function(_0x1c1b35,_0x136315){_0x1c1b35=_0x1c1b35-0x0;var _0xb05c35=_0xb9d4[_0x1c1b35];return _0xb05c35;};'use strict';var _=require(_0x4b9d('0x0'));var util=require(_0x4b9d('0x1'));var logger=require(_0x4b9d('0x2'))('api');var moment=require(_0x4b9d('0x3'));var BPromise=require(_0x4b9d('0x4'));var rp=require(_0x4b9d('0x5'));var fs=require('fs');var path=require(_0x4b9d('0x6'));var rimraf=require(_0x4b9d('0x7'));var config=require(_0x4b9d('0x8'));var attributes=require(_0x4b9d('0x9'));module[_0x4b9d('0xa')]=function(_0x21d8ca,_0x551b4d){return _0x21d8ca[_0x4b9d('0xb')]('CmHopperFinal',attributes,{'tableName':_0x4b9d('0xc'),'paranoid':![],'indexes':[{'name':_0x4b9d('0xd'),'fields':[_0x4b9d('0xd')]},{'name':_0x4b9d('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 30cd436..21c5ce9 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(_0x2664d9,_0x48bd0b){var _0x5a4343=function(_0x374cb4){while(--_0x374cb4){_0x2664d9['push'](_0x2664d9['shift']());}};_0x5a4343(++_0x48bd0b);}(_0x7a54,0x106));var _0x47a5=function(_0x53acf9,_0x49aebe){_0x53acf9=_0x53acf9-0x0;var _0x2d9705=_0x7a54[_0x53acf9];return _0x2d9705;};'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(_0x2c67ba,_0x2ad819){var _0x22f5df=function(_0x3815fc){while(--_0x3815fc){_0x2c67ba['push'](_0x2c67ba['shift']());}};_0x22f5df(++_0x2ad819);}(_0xb10b,0x12a));var _0xbb10=function(_0x77ae89,_0x2b65a7){_0x77ae89=_0x77ae89-0x0;var _0x19d79c=_0xb10b[_0x77ae89];return _0x19d79c;};'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 2ca1cbb..bc8e951 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 _0xabf4=['show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x18dead,_0xc44380){var _0x228372=function(_0x48106e){while(--_0x48106e){_0x18dead['push'](_0x18dead['shift']());}};_0x228372(++_0xc44380);}(_0xabf4,0x196));var _0x4abf=function(_0x21c1f2,_0x1c307c){_0x21c1f2=_0x21c1f2-0x0;var _0x54d10e=_0xabf4[_0x21c1f2];return _0x54d10e;};'use strict';var multer=require(_0x4abf('0x0'));var util=require(_0x4abf('0x1'));var path=require(_0x4abf('0x2'));var timeout=require(_0x4abf('0x3'));var express=require(_0x4abf('0x4'));var router=express[_0x4abf('0x5')]();var fs_extra=require(_0x4abf('0x6'));var auth=require(_0x4abf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4abf('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x4abf('0x9')]('/',auth[_0x4abf('0xa')](),controller[_0x4abf('0xb')]);router['get'](_0x4abf('0xc'),auth[_0x4abf('0xa')](),controller[_0x4abf('0xd')]);router['get']('/:id',auth[_0x4abf('0xa')](),controller[_0x4abf('0xe')]);router[_0x4abf('0x9')](_0x4abf('0xf'),auth[_0x4abf('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x4abf('0x10'),auth['isAuthenticated'](),controller[_0x4abf('0x11')]);router[_0x4abf('0x12')](_0x4abf('0x13'),auth[_0x4abf('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x4abf('0x12')](_0x4abf('0x14'),auth[_0x4abf('0xa')](),controller[_0x4abf('0x15')]);router[_0x4abf('0x12')](_0x4abf('0x16'),auth[_0x4abf('0xa')](),controller[_0x4abf('0x17')]);router[_0x4abf('0x18')](_0x4abf('0x19'),auth[_0x4abf('0xa')](),controller[_0x4abf('0x1a')]);module[_0x4abf('0x1b')]=router; \ No newline at end of file +var _0x3c1f=['/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x391154,_0x40fb12){var _0x4b7767=function(_0x3b1573){while(--_0x3b1573){_0x391154['push'](_0x391154['shift']());}};_0x4b7767(++_0x40fb12);}(_0x3c1f,0x1ce));var _0xf3c1=function(_0x1955f4,_0x2a9204){_0x1955f4=_0x1955f4-0x0;var _0x2369a5=_0x3c1f[_0x1955f4];return _0x2369a5;};'use strict';var multer=require(_0xf3c1('0x0'));var util=require('util');var path=require(_0xf3c1('0x1'));var timeout=require(_0xf3c1('0x2'));var express=require(_0xf3c1('0x3'));var router=express['Router']();var fs_extra=require(_0xf3c1('0x4'));var auth=require(_0xf3c1('0x5'));var interaction=require(_0xf3c1('0x6'));var config=require(_0xf3c1('0x7'));var controller=require(_0xf3c1('0x8'));router[_0xf3c1('0x9')]('/',auth[_0xf3c1('0xa')](),controller[_0xf3c1('0xb')]);router[_0xf3c1('0x9')](_0xf3c1('0xc'),auth['isAuthenticated'](),controller[_0xf3c1('0xd')]);router[_0xf3c1('0x9')](_0xf3c1('0xe'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0xf')]);router[_0xf3c1('0x9')](_0xf3c1('0x10'),auth[_0xf3c1('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xf3c1('0x9')](_0xf3c1('0x11'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x12')]);router[_0xf3c1('0x13')](_0xf3c1('0x14'),auth[_0xf3c1('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xf3c1('0x13')](_0xf3c1('0x15'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x16')]);router[_0xf3c1('0x13')](_0xf3c1('0x17'),auth['isAuthenticated'](),controller[_0xf3c1('0x18')]);router[_0xf3c1('0x19')](_0xf3c1('0xe'),auth[_0xf3c1('0xa')](),controller[_0xf3c1('0x1a')]);module[_0xf3c1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 190935d..c7fdf5d 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 _0x5aac=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x147040,_0x4db71a){var _0x3cab3c=function(_0x5248c2){while(--_0x5248c2){_0x147040['push'](_0x147040['shift']());}};_0x3cab3c(++_0x4db71a);}(_0x5aac,0x72));var _0xc5aa=function(_0x1f06fd,_0x12fbda){_0x1f06fd=_0x1f06fd-0x0;var _0x4b20d9=_0x5aac[_0x1f06fd];return _0x4b20d9;};'use strict';var Sequelize=require(_0xc5aa('0x0'));module[_0xc5aa('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xc5aa('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc5aa('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc5aa('0x2')]},'originatecalleridname':{'type':Sequelize[_0xc5aa('0x2')]},'calleridnum':{'type':Sequelize[_0xc5aa('0x2')]},'calleridname':{'type':Sequelize[_0xc5aa('0x2')]},'starttime':{'type':Sequelize[_0xc5aa('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xc5aa('0x4')]},'droptime':{'type':Sequelize[_0xc5aa('0x4')]},'endtime':{'type':Sequelize[_0xc5aa('0x4')]},'ringtime':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc5aa('0x2')]},'campaign':{'type':Sequelize[_0xc5aa('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc5aa('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xc5aa('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc5aa('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc5aa('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc5aa('0x4')]},'recallme':{'type':Sequelize[_0xc5aa('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc5aa('0x4')]},'edited':{'type':Sequelize[_0xc5aa('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc5aa('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc5aa('0x2')]}}; \ No newline at end of file +var _0x0c3a=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x2f2535,_0x3ebc6d){var _0x3c97c5=function(_0x1de394){while(--_0x1de394){_0x2f2535['push'](_0x2f2535['shift']());}};_0x3c97c5(++_0x3ebc6d);}(_0x0c3a,0x171));var _0xa0c3=function(_0x2876b5,_0x455b2d){_0x2876b5=_0x2876b5-0x0;var _0x4054e5=_0x0c3a[_0x2876b5];return _0x4054e5;};'use strict';var Sequelize=require(_0xa0c3('0x0'));module[_0xa0c3('0x1')]={'state':{'type':Sequelize[_0xa0c3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa0c3('0x3')]},'scheduledat':{'type':Sequelize[_0xa0c3('0x4')]},'countbusyretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa0c3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa0c3('0x3')]},'calleridnum':{'type':Sequelize[_0xa0c3('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa0c3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa0c3('0x4')]},'endtime':{'type':Sequelize[_0xa0c3('0x4')]},'ringtime':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa0c3('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa0c3('0x3')]},'reason':{'type':Sequelize[_0xa0c3('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa0c3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa0c3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa0c3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa0c3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa0c3('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa0c3('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa0c3('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 82782f5..d91d24a 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 _0x5930=['Content-Range','save','update','then','send','index','map','CmHopperHistory','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','order','sort','where','pick','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','find','create','body','describe','uniqueid','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','offset','undefined','limit','count'];(function(_0x3ba813,_0x4acfd9){var _0x499b77=function(_0x1aaef8){while(--_0x1aaef8){_0x3ba813['push'](_0x3ba813['shift']());}};_0x499b77(++_0x4acfd9);}(_0x5930,0x184));var _0x0593=function(_0xaec7bb,_0x53dfb9){_0xaec7bb=_0xaec7bb-0x0;var _0x35174b=_0x5930[_0xaec7bb];return _0x35174b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0593('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0593('0x1'));var BPromise=require(_0x0593('0x2'));var Mustache=require(_0x0593('0x3'));var util=require(_0x0593('0x4'));var path=require(_0x0593('0x5'));var sox=require(_0x0593('0x6'));var csv=require(_0x0593('0x7'));var ejs=require(_0x0593('0x8'));var fs=require('fs');var fs_extra=require(_0x0593('0x9'));var _=require('lodash');var squel=require(_0x0593('0xa'));var crypto=require('crypto');var jsforce=require(_0x0593('0xb'));var deskjs=require(_0x0593('0xc'));var toCsv=require(_0x0593('0x7'));var querystring=require(_0x0593('0xd'));var Papa=require(_0x0593('0xe'));var Redis=require(_0x0593('0xf'));var authService=require(_0x0593('0x10'));var qs=require(_0x0593('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0593('0x12'));var logger=require(_0x0593('0x13'))(_0x0593('0x14'));var utils=require(_0x0593('0x15'));var config=require(_0x0593('0x16'));var licenseUtil=require(_0x0593('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17b243,_0x1172b9){_0x1172b9=_0x1172b9||0xcc;return function(_0x342582){if(_0x342582){return _0x17b243[_0x0593('0x18')](_0x1172b9);}return _0x17b243[_0x0593('0x19')](_0x1172b9)[_0x0593('0x1a')]();};}function respondWithResult(_0x409383,_0x1743ec){_0x1743ec=_0x1743ec||0xc8;return function(_0x4b63de){if(_0x4b63de){return _0x409383[_0x0593('0x19')](_0x1743ec)[_0x0593('0x1b')](_0x4b63de);}};}function respondWithFilteredResult(_0x5db5a8,_0x5dac3c){return function(_0x21c2c3){if(_0x21c2c3){var _0x128111=typeof _0x5dac3c[_0x0593('0x1c')]===_0x0593('0x1d')&&typeof _0x5dac3c[_0x0593('0x1e')]===_0x0593('0x1d');var _0x2fb192=_0x21c2c3[_0x0593('0x1f')];var _0x2df151=_0x128111?0x0:_0x5dac3c[_0x0593('0x1c')];var _0x393327=_0x128111?_0x21c2c3[_0x0593('0x1f')]:_0x5dac3c[_0x0593('0x1c')]+_0x5dac3c[_0x0593('0x1e')];var _0x9353c6;if(_0x393327>=_0x2fb192){_0x393327=_0x2fb192;_0x9353c6=0xc8;}else{_0x9353c6=0xce;}_0x5db5a8[_0x0593('0x19')](_0x9353c6);return _0x5db5a8['set'](_0x0593('0x20'),_0x2df151+'-'+_0x393327+'/'+_0x2fb192)[_0x0593('0x1b')](_0x21c2c3);}return null;};}function patchUpdates(_0x45e1b3){return function(_0xc40f5b){try{jsonpatch['apply'](_0xc40f5b,_0x45e1b3,!![]);}catch(_0x4699c3){return BPromise['reject'](_0x4699c3);}return _0xc40f5b[_0x0593('0x21')]();};}function saveUpdates(_0x3ae61e,_0x184b80){return function(_0x144f09){if(_0x144f09){return _0x144f09[_0x0593('0x22')](_0x3ae61e)[_0x0593('0x23')](function(_0x566735){return _0x566735;});}return null;};}function removeEntity(_0xb3e784,_0x58cbd8){return function(_0x18e74d){if(_0x18e74d){return _0x18e74d['destroy']()[_0x0593('0x23')](function(){_0xb3e784[_0x0593('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6c028,_0x3ac260){return function(_0x10ad0b){if(!_0x10ad0b){_0xd6c028[_0x0593('0x18')](0x194);}return _0x10ad0b;};}function handleError(_0x505855,_0x546ed2){_0x546ed2=_0x546ed2||0x1f4;return function(_0x2e93b7){logger['error'](_0x2e93b7['stack']);if(_0x2e93b7['name']){delete _0x2e93b7['name'];}_0x505855[_0x0593('0x19')](_0x546ed2)[_0x0593('0x24')](_0x2e93b7);};}exports[_0x0593('0x25')]=function(_0x31e41b,_0x34b912){var _0x36d2a5={},_0x27472e={},_0x3fa12c={'count':0x0,'rows':[]};var _0x25f2c1=_[_0x0593('0x26')](db[_0x0593('0x27')]['rawAttributes'],function(_0x49a046){return{'name':_0x49a046[_0x0593('0x28')],'type':_0x49a046[_0x0593('0x29')]['key']};});_0x27472e[_0x0593('0x2a')]=_['map'](_0x25f2c1,_0x0593('0x2b'));_0x27472e[_0x0593('0x2c')]=_['keys'](_0x31e41b[_0x0593('0x2c')]);_0x27472e[_0x0593('0x2d')]=_[_0x0593('0x2e')](_0x27472e[_0x0593('0x2a')],_0x27472e[_0x0593('0x2c')]);_0x36d2a5[_0x0593('0x2f')]=_[_0x0593('0x2e')](_0x27472e[_0x0593('0x2a')],qs[_0x0593('0x30')](_0x31e41b[_0x0593('0x2c')]['fields']));_0x36d2a5[_0x0593('0x2f')]=_0x36d2a5['attributes'][_0x0593('0x31')]?_0x36d2a5[_0x0593('0x2f')]:_0x27472e[_0x0593('0x2a')];if(!_0x31e41b[_0x0593('0x2c')]['hasOwnProperty']('nolimit')){_0x36d2a5[_0x0593('0x1e')]=qs[_0x0593('0x1e')](_0x31e41b['query']['limit']);_0x36d2a5['offset']=qs[_0x0593('0x1c')](_0x31e41b['query']['offset']);}_0x36d2a5[_0x0593('0x32')]=qs[_0x0593('0x33')](_0x31e41b['query'][_0x0593('0x33')]);_0x36d2a5[_0x0593('0x34')]=qs['filters'](_[_0x0593('0x35')](_0x31e41b[_0x0593('0x2c')],_0x27472e[_0x0593('0x2d')]),_0x25f2c1);if(_0x31e41b[_0x0593('0x2c')]['filter']){_0x36d2a5['where']=_['merge'](_0x36d2a5[_0x0593('0x34')],{'$or':_['map'](_0x25f2c1,function(_0x224b45){if(_0x224b45[_0x0593('0x29')]!=='VIRTUAL'){var _0x8ec9ac={};_0x8ec9ac[_0x224b45[_0x0593('0x2b')]]={'$like':'%'+_0x31e41b[_0x0593('0x2c')]['filter']+'%'};return _0x8ec9ac;}})});}_0x36d2a5=_['merge']({},_0x36d2a5,_0x31e41b[_0x0593('0x36')]);var _0x52dcb2={'where':_0x36d2a5[_0x0593('0x34')]};return db[_0x0593('0x27')][_0x0593('0x1f')](_0x52dcb2)['then'](function(_0x1705b4){_0x3fa12c[_0x0593('0x1f')]=_0x1705b4;if(_0x31e41b[_0x0593('0x2c')][_0x0593('0x37')]){_0x36d2a5[_0x0593('0x38')]=[{'all':!![]}];}return db[_0x0593('0x27')][_0x0593('0x39')](_0x36d2a5);})[_0x0593('0x23')](function(_0x575a19){_0x3fa12c[_0x0593('0x3a')]=_0x575a19;return _0x3fa12c;})[_0x0593('0x23')](respondWithFilteredResult(_0x34b912,_0x36d2a5))[_0x0593('0x3b')](handleError(_0x34b912,null));};exports[_0x0593('0x3c')]=function(_0x68326,_0x45021d){var _0x5346e6={'raw':!![],'where':{'id':_0x68326[_0x0593('0x3d')]['id']}},_0x5136e2={};_0x5136e2['model']=_[_0x0593('0x3e')](db[_0x0593('0x27')][_0x0593('0x3f')]);_0x5136e2['query']=_['keys'](_0x68326[_0x0593('0x2c')]);_0x5136e2[_0x0593('0x2d')]=_[_0x0593('0x2e')](_0x5136e2[_0x0593('0x2a')],_0x5136e2[_0x0593('0x2c')]);_0x5346e6[_0x0593('0x2f')]=_[_0x0593('0x2e')](_0x5136e2[_0x0593('0x2a')],qs[_0x0593('0x30')](_0x68326[_0x0593('0x2c')]['fields']));_0x5346e6[_0x0593('0x2f')]=_0x5346e6[_0x0593('0x2f')][_0x0593('0x31')]?_0x5346e6['attributes']:_0x5136e2[_0x0593('0x2a')];if(_0x68326[_0x0593('0x2c')][_0x0593('0x37')]){_0x5346e6['include']=[{'all':!![]}];}_0x5346e6=_[_0x0593('0x40')]({},_0x5346e6,_0x68326[_0x0593('0x36')]);return db['CmHopperHistory'][_0x0593('0x41')](_0x5346e6)[_0x0593('0x23')](handleEntityNotFound(_0x45021d,null))['then'](respondWithResult(_0x45021d,null))['catch'](handleError(_0x45021d,null));};exports[_0x0593('0x42')]=function(_0x4138d9,_0x8f9e8f){return db[_0x0593('0x27')]['create'](_0x4138d9[_0x0593('0x43')],{})['then'](respondWithResult(_0x8f9e8f,0xc9))['catch'](handleError(_0x8f9e8f,null));};exports[_0x0593('0x44')]=function(_0x2ef643,_0x4d18bc){return db['CmHopperHistory'][_0x0593('0x44')]()[_0x0593('0x23')](respondWithResult(_0x4d18bc,null))['catch'](handleError(_0x4d18bc,null));};exports['update']=function(_0x161b0e,_0x30bfe7){if(_0x161b0e['body'][_0x0593('0x45')]){delete _0x161b0e['body'][_0x0593('0x45')];}return db[_0x0593('0x27')][_0x0593('0x41')]({'where':{'uniqueid':_0x161b0e[_0x0593('0x3d')]['id']}})[_0x0593('0x23')](handleEntityNotFound(_0x30bfe7,null))[_0x0593('0x23')](saveUpdates(_0x161b0e[_0x0593('0x43')],null))[_0x0593('0x23')](respondWithResult(_0x30bfe7,null))[_0x0593('0x3b')](handleError(_0x30bfe7,null));}; \ No newline at end of file +var _0x1add=['attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','options','findAll','rows','catch','params','model','includeAll','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','map','query','keys','filters','intersection'];(function(_0x551aef,_0x3a75be){var _0x4b5526=function(_0x486c73){while(--_0x486c73){_0x551aef['push'](_0x551aef['shift']());}};_0x4b5526(++_0x3a75be);}(_0x1add,0x197));var _0xd1ad=function(_0x1537d4,_0x3ac57a){_0x1537d4=_0x1537d4-0x0;var _0x5228bb=_0x1add[_0x1537d4];return _0x5228bb;};'use strict';var emlformat=require(_0xd1ad('0x0'));var rimraf=require(_0xd1ad('0x1'));var zipdir=require(_0xd1ad('0x2'));var jsonpatch=require(_0xd1ad('0x3'));var rp=require('request-promise');var moment=require(_0xd1ad('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd1ad('0x5'));var path=require(_0xd1ad('0x6'));var sox=require(_0xd1ad('0x7'));var csv=require(_0xd1ad('0x8'));var ejs=require(_0xd1ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1ad('0xa'));var squel=require(_0xd1ad('0xb'));var crypto=require(_0xd1ad('0xc'));var jsforce=require(_0xd1ad('0xd'));var deskjs=require(_0xd1ad('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd1ad('0xf'));var Papa=require(_0xd1ad('0x10'));var Redis=require(_0xd1ad('0x11'));var authService=require(_0xd1ad('0x12'));var qs=require(_0xd1ad('0x13'));var as=require(_0xd1ad('0x14'));var hardwareService=require(_0xd1ad('0x15'));var logger=require(_0xd1ad('0x16'))('api');var utils=require(_0xd1ad('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd1ad('0x18'));var db=require(_0xd1ad('0x19'))['db'];function respondWithStatusCode(_0x57964b,_0x259274){_0x259274=_0x259274||0xcc;return function(_0x16b27c){if(_0x16b27c){return _0x57964b[_0xd1ad('0x1a')](_0x259274);}return _0x57964b[_0xd1ad('0x1b')](_0x259274)[_0xd1ad('0x1c')]();};}function respondWithResult(_0x3f6935,_0x1757e9){_0x1757e9=_0x1757e9||0xc8;return function(_0x5cba40){if(_0x5cba40){return _0x3f6935[_0xd1ad('0x1b')](_0x1757e9)['json'](_0x5cba40);}};}function respondWithFilteredResult(_0x5ea962,_0x414d35){return function(_0x18892a){if(_0x18892a){var _0x3b0e24=typeof _0x414d35['offset']==='undefined'&&typeof _0x414d35[_0xd1ad('0x1d')]===_0xd1ad('0x1e');var _0x21104c=_0x18892a[_0xd1ad('0x1f')];var _0x3dfa87=_0x3b0e24?0x0:_0x414d35[_0xd1ad('0x20')];var _0x3a2fa9=_0x3b0e24?_0x18892a[_0xd1ad('0x1f')]:_0x414d35[_0xd1ad('0x20')]+_0x414d35['limit'];var _0x4a0df9;if(_0x3a2fa9>=_0x21104c){_0x3a2fa9=_0x21104c;_0x4a0df9=0xc8;}else{_0x4a0df9=0xce;}_0x5ea962[_0xd1ad('0x1b')](_0x4a0df9);return _0x5ea962[_0xd1ad('0x21')]('Content-Range',_0x3dfa87+'-'+_0x3a2fa9+'/'+_0x21104c)[_0xd1ad('0x22')](_0x18892a);}return null;};}function patchUpdates(_0x9befc){return function(_0x450578){try{jsonpatch[_0xd1ad('0x23')](_0x450578,_0x9befc,!![]);}catch(_0x35226f){return BPromise[_0xd1ad('0x24')](_0x35226f);}return _0x450578[_0xd1ad('0x25')]();};}function saveUpdates(_0x1f1b95,_0x95eabd){return function(_0x162ed5){if(_0x162ed5){return _0x162ed5[_0xd1ad('0x26')](_0x1f1b95)[_0xd1ad('0x27')](function(_0x2f1f69){return _0x2f1f69;});}return null;};}function removeEntity(_0x14ab92,_0x4088bd){return function(_0x198f23){if(_0x198f23){return _0x198f23[_0xd1ad('0x28')]()[_0xd1ad('0x27')](function(){_0x14ab92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49cf0e,_0x131980){return function(_0xba95ef){if(!_0xba95ef){_0x49cf0e[_0xd1ad('0x1a')](0x194);}return _0xba95ef;};}function handleError(_0x2c15ff,_0x5c84fd){_0x5c84fd=_0x5c84fd||0x1f4;return function(_0x4f85b3){logger[_0xd1ad('0x29')](_0x4f85b3[_0xd1ad('0x2a')]);if(_0x4f85b3[_0xd1ad('0x2b')]){delete _0x4f85b3[_0xd1ad('0x2b')];}_0x2c15ff[_0xd1ad('0x1b')](_0x5c84fd)[_0xd1ad('0x2c')](_0x4f85b3);};}exports[_0xd1ad('0x2d')]=function(_0x3bc4ca,_0x56c531){var _0x1ff248={},_0x58dccf={},_0xc259d6={'count':0x0,'rows':[]};var _0x367d2e=_['map'](db[_0xd1ad('0x2e')][_0xd1ad('0x2f')],function(_0x4386f3){return{'name':_0x4386f3[_0xd1ad('0x30')],'type':_0x4386f3[_0xd1ad('0x31')]['key']};});_0x58dccf['model']=_[_0xd1ad('0x32')](_0x367d2e,_0xd1ad('0x2b'));_0x58dccf[_0xd1ad('0x33')]=_[_0xd1ad('0x34')](_0x3bc4ca[_0xd1ad('0x33')]);_0x58dccf[_0xd1ad('0x35')]=_[_0xd1ad('0x36')](_0x58dccf['model'],_0x58dccf[_0xd1ad('0x33')]);_0x1ff248[_0xd1ad('0x37')]=_[_0xd1ad('0x36')](_0x58dccf['model'],qs['fields'](_0x3bc4ca['query'][_0xd1ad('0x38')]));_0x1ff248['attributes']=_0x1ff248[_0xd1ad('0x37')][_0xd1ad('0x39')]?_0x1ff248[_0xd1ad('0x37')]:_0x58dccf['model'];if(!_0x3bc4ca[_0xd1ad('0x33')]['hasOwnProperty'](_0xd1ad('0x3a'))){_0x1ff248['limit']=qs['limit'](_0x3bc4ca['query']['limit']);_0x1ff248['offset']=qs[_0xd1ad('0x20')](_0x3bc4ca['query'][_0xd1ad('0x20')]);}_0x1ff248[_0xd1ad('0x3b')]=qs[_0xd1ad('0x3c')](_0x3bc4ca[_0xd1ad('0x33')][_0xd1ad('0x3c')]);_0x1ff248[_0xd1ad('0x3d')]=qs[_0xd1ad('0x35')](_['pick'](_0x3bc4ca['query'],_0x58dccf['filters']),_0x367d2e);if(_0x3bc4ca[_0xd1ad('0x33')]['filter']){_0x1ff248[_0xd1ad('0x3d')]=_['merge'](_0x1ff248[_0xd1ad('0x3d')],{'$or':_[_0xd1ad('0x32')](_0x367d2e,function(_0x334b1a){if(_0x334b1a[_0xd1ad('0x31')]!==_0xd1ad('0x3e')){var _0x1ad873={};_0x1ad873[_0x334b1a[_0xd1ad('0x2b')]]={'$like':'%'+_0x3bc4ca[_0xd1ad('0x33')][_0xd1ad('0x3f')]+'%'};return _0x1ad873;}})});}_0x1ff248=_['merge']({},_0x1ff248,_0x3bc4ca[_0xd1ad('0x40')]);var _0x4cf791={'where':_0x1ff248['where']};return db[_0xd1ad('0x2e')][_0xd1ad('0x1f')](_0x4cf791)[_0xd1ad('0x27')](function(_0x2de2a2){_0xc259d6['count']=_0x2de2a2;if(_0x3bc4ca['query']['includeAll']){_0x1ff248['include']=[{'all':!![]}];}return db[_0xd1ad('0x2e')][_0xd1ad('0x41')](_0x1ff248);})['then'](function(_0x494d05){_0xc259d6[_0xd1ad('0x42')]=_0x494d05;return _0xc259d6;})[_0xd1ad('0x27')](respondWithFilteredResult(_0x56c531,_0x1ff248))[_0xd1ad('0x43')](handleError(_0x56c531,null));};exports['show']=function(_0x40eee2,_0x3dd3a7){var _0x332500={'raw':!![],'where':{'id':_0x40eee2[_0xd1ad('0x44')]['id']}},_0x59d553={};_0x59d553['model']=_[_0xd1ad('0x34')](db[_0xd1ad('0x2e')][_0xd1ad('0x2f')]);_0x59d553[_0xd1ad('0x33')]=_[_0xd1ad('0x34')](_0x40eee2[_0xd1ad('0x33')]);_0x59d553[_0xd1ad('0x35')]=_['intersection'](_0x59d553['model'],_0x59d553[_0xd1ad('0x33')]);_0x332500[_0xd1ad('0x37')]=_[_0xd1ad('0x36')](_0x59d553['model'],qs[_0xd1ad('0x38')](_0x40eee2['query'][_0xd1ad('0x38')]));_0x332500[_0xd1ad('0x37')]=_0x332500[_0xd1ad('0x37')]['length']?_0x332500['attributes']:_0x59d553[_0xd1ad('0x45')];if(_0x40eee2[_0xd1ad('0x33')][_0xd1ad('0x46')]){_0x332500[_0xd1ad('0x47')]=[{'all':!![]}];}_0x332500=_['merge']({},_0x332500,_0x40eee2['options']);return db[_0xd1ad('0x2e')][_0xd1ad('0x48')](_0x332500)['then'](handleEntityNotFound(_0x3dd3a7,null))[_0xd1ad('0x27')](respondWithResult(_0x3dd3a7,null))[_0xd1ad('0x43')](handleError(_0x3dd3a7,null));};exports[_0xd1ad('0x49')]=function(_0x20c4c5,_0x3eb620){return db[_0xd1ad('0x2e')]['create'](_0x20c4c5[_0xd1ad('0x4a')],{})['then'](respondWithResult(_0x3eb620,0xc9))[_0xd1ad('0x43')](handleError(_0x3eb620,null));};exports['describe']=function(_0x13049d,_0x48c188){return db['CmHopperHistory'][_0xd1ad('0x4b')]()['then'](respondWithResult(_0x48c188,null))[_0xd1ad('0x43')](handleError(_0x48c188,null));};exports[_0xd1ad('0x26')]=function(_0x27f13d,_0x3c0a0c){if(_0x27f13d['body'][_0xd1ad('0x4c')]){delete _0x27f13d[_0xd1ad('0x4a')][_0xd1ad('0x4c')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x27f13d[_0xd1ad('0x44')]['id']}})[_0xd1ad('0x27')](handleEntityNotFound(_0x3c0a0c,null))[_0xd1ad('0x27')](saveUpdates(_0x27f13d[_0xd1ad('0x4a')],null))[_0xd1ad('0x27')](respondWithResult(_0x3c0a0c,null))[_0xd1ad('0x43')](handleError(_0x3c0a0c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 45cf495..9294a18 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 _0xb296=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x111802,_0x47fe60){var _0x34f278=function(_0x310e2f){while(--_0x310e2f){_0x111802['push'](_0x111802['shift']());}};_0x34f278(++_0x47fe60);}(_0xb296,0xa3));var _0x6b29=function(_0x5ec2bc,_0x44f078){_0x5ec2bc=_0x5ec2bc-0x0;var _0x32c55c=_0xb296[_0x5ec2bc];return _0x32c55c;};'use strict';var _=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var logger=require(_0x6b29('0x2'))(_0x6b29('0x3'));var moment=require(_0x6b29('0x4'));var BPromise=require(_0x6b29('0x5'));var rp=require(_0x6b29('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b29('0x8'));module[_0x6b29('0x9')]=function(_0x5e0aa1,_0x327329){return _0x5e0aa1[_0x6b29('0xa')](_0x6b29('0xb'),attributes,{'tableName':_0x6b29('0xc'),'paranoid':![],'indexes':[{'name':_0x6b29('0xd'),'fields':['endtime']},{'name':_0x6b29('0xe'),'fields':[_0x6b29('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79a3=['endtime','uniqueid','lodash','../../config/logger','api','bluebird','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x37f748,_0x2086d5){var _0x257918=function(_0x5e3b29){while(--_0x5e3b29){_0x37f748['push'](_0x37f748['shift']());}};_0x257918(++_0x2086d5);}(_0x79a3,0x80));var _0x379a=function(_0x558ce9,_0x44c442){_0x558ce9=_0x558ce9-0x0;var _0x2c2903=_0x79a3[_0x558ce9];return _0x2c2903;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var logger=require(_0x379a('0x1'))(_0x379a('0x2'));var moment=require('moment');var BPromise=require(_0x379a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x379a('0x4'));var attributes=require(_0x379a('0x5'));module[_0x379a('0x6')]=function(_0x14907a,_0x9e6da6){return _0x14907a['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x379a('0x7'),'fields':[_0x379a('0x7')]},{'name':_0x379a('0x8'),'fields':[_0x379a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 69a17e7..7650d9a 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 _0x4157=['outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay'];(function(_0x3604f0,_0x465f1e){var _0x31bfd1=function(_0x1329a1){while(--_0x1329a1){_0x3604f0['push'](_0x3604f0['shift']());}};_0x31bfd1(++_0x465f1e);}(_0x4157,0xf3));var _0x7415=function(_0x6cff0f,_0x140556){_0x6cff0f=_0x6cff0f-0x0;var _0x1ff0f3=_0x4157[_0x6cff0f];return _0x1ff0f3;};'use strict';var _=require(_0x7415('0x0'));var util=require(_0x7415('0x1'));var moment=require(_0x7415('0x2'));var BPromise=require(_0x7415('0x3'));var rs=require(_0x7415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7415('0x5'))['db'];var utils=require(_0x7415('0x6'));var logger=require(_0x7415('0x7'))(_0x7415('0x8'));var config=require(_0x7415('0x9'));var jayson=require(_0x7415('0xa'));var client=jayson[_0x7415('0xb')][_0x7415('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c7980,_0x49b694,_0x26fe93){return new BPromise(function(_0x588c5a,_0x972b02){return client['request'](_0x3c7980,_0x26fe93)[_0x7415('0xd')](function(_0x1a42df){logger[_0x7415('0xe')](_0x7415('0xf'),_0x49b694,_0x7415('0x10'));logger[_0x7415('0x11')](_0x7415('0x12'),_0x49b694,'request\x20sent',JSON[_0x7415('0x13')](_0x1a42df));if(_0x1a42df[_0x7415('0x14')]){if(_0x1a42df[_0x7415('0x14')][_0x7415('0x15')]===0x1f4){logger[_0x7415('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x49b694,_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);return _0x972b02(_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);}logger[_0x7415('0x14')](_0x7415('0xf'),_0x49b694,_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);return _0x588c5a(_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);}else{logger[_0x7415('0xe')](_0x7415('0xf'),_0x49b694,_0x7415('0x10'));_0x588c5a(_0x1a42df['result'][_0x7415('0x16')]);}})[_0x7415('0x17')](function(_0x2398d1){logger[_0x7415('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x49b694,_0x2398d1);_0x972b02(_0x2398d1);});});}exports[_0x7415('0x18')]=function(_0x2543f1){var _0x51efee=this;return new Promise(function(_0x302a2b,_0x510ae1){return db[_0x7415('0x19')][_0x7415('0x1a')](_0x2543f1[_0x7415('0x1b')],{'raw':_0x2543f1[_0x7415('0x1c')]?_0x2543f1[_0x7415('0x1c')][_0x7415('0x1d')]===undefined?!![]:![]:!![]})[_0x7415('0xd')](function(_0x36a934){logger[_0x7415('0xe')](_0x7415('0x18'),_0x2543f1);logger[_0x7415('0x11')]('CreateCmHopperHistory',_0x2543f1,JSON['stringify'](_0x36a934));_0x302a2b(_0x36a934);})[_0x7415('0x17')](function(_0x43df4a){logger[_0x7415('0x14')](_0x7415('0x18'),_0x43df4a['message'],_0x2543f1);_0x510ae1(_0x51efee[_0x7415('0x14')](0x1f4,_0x43df4a['message']));});});};exports['AvgHandleTime']=function(_0xca366e){var _0x31d6e5=this;return new Promise(function(_0x804d07,_0x1271ca){return db[_0x7415('0x19')][_0x7415('0x1e')]({'raw':_0xca366e[_0x7415('0x1c')]?_0xca366e[_0x7415('0x1c')][_0x7415('0x1d')]===undefined?!![]:![]:!![],'where':_0xca366e[_0x7415('0x1c')]?_0xca366e['options'][_0x7415('0x1f')]||null:null,'attributes':[[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')][_0x7415('0x22')]('id')),'predictiveIntervalTotalCalls'],[db[_0x7415('0x20')]['fn']('COUNT',db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x24')))),'predictiveIntervalAnsweredCalls'],[db[_0x7415('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x25')))),_0x7415('0x26')],[db['sequelize']['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x27')))),_0x7415('0x28')],[db[_0x7415('0x20')]['fn'](_0x7415('0x29'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x7415('0x2a')],[db[_0x7415('0x20')]['fn']('AVG',db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x2b')))),_0x7415('0x2c')]]})[_0x7415('0xd')](function(_0xbce78b){logger['info'](_0x7415('0x2d'),_0xca366e);logger[_0x7415('0x11')](_0x7415('0x2d'),_0xca366e,JSON[_0x7415('0x13')](_0xbce78b));_0x804d07(_0xbce78b);})[_0x7415('0x17')](function(_0x9bdee3){logger[_0x7415('0x14')]('AvgHandleTime',_0x9bdee3['message'],_0xca366e);_0x1271ca(_0x31d6e5[_0x7415('0x14')](0x1f4,_0x9bdee3['message']));});});};exports[_0x7415('0x2e')]=function(_0x385855){var _0x4fc53b=this;return new Promise(function(_0x488ea0,_0x51af31){return db[_0x7415('0x19')]['findAll']({'raw':_0x385855[_0x7415('0x1c')]?_0x385855[_0x7415('0x1c')][_0x7415('0x1d')]===undefined?!![]:![]:!![],'where':_0x385855['options']?_0x385855[_0x7415('0x1c')][_0x7415('0x1f')]||null:null,'attributes':[[_0x7415('0x2f'),_0x7415('0x30')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x31')))),_0x7415('0x32')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db['sequelize']['literal'](_0x7415('0x33')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x7415('0x34')],[db[_0x7415('0x20')]['fn']('COUNT',db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')]('`state`\x20=\x205,\x201,\x20null'))),_0x7415('0x35')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db['sequelize'][_0x7415('0x23')](_0x7415('0x36')))),_0x7415('0x37')],[db[_0x7415('0x20')]['fn']('COUNT',db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x7415('0x38')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db['sequelize'][_0x7415('0x23')](_0x7415('0x39')))),_0x7415('0x3a')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x3b')))),_0x7415('0x3c')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')]['literal'](_0x7415('0x3d')))),_0x7415('0x3e')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db['sequelize']['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x3f')))),_0x7415('0x40')],[db[_0x7415('0x20')]['fn']('COUNT',db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x41')))),_0x7415('0x42')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x7415('0x23')](_0x7415('0x43')))),_0x7415('0x44')],[db['sequelize']['fn']('COUNT',db[_0x7415('0x20')]['fn']('IF',db['sequelize']['literal'](_0x7415('0x45')))),'outboundRejectCallsDay'],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')]['fn']('IF',db[_0x7415('0x20')][_0x7415('0x23')](_0x7415('0x46')))),'outboundReCallsDay']],'group':[_0x7415('0x2f')]})[_0x7415('0xd')](function(_0x51c42d){logger[_0x7415('0xe')](_0x7415('0x2e'),_0x385855);logger[_0x7415('0x11')](_0x7415('0x2e'),_0x385855,JSON[_0x7415('0x13')](_0x51c42d));_0x488ea0(_0x51c42d);})[_0x7415('0x17')](function(_0x4c52ab){logger[_0x7415('0x14')](_0x7415('0x2e'),_0x4c52ab['message'],_0x385855);_0x51af31(_0x4fc53b[_0x7415('0x14')](0x1f4,_0x4c52ab['message']));});});};exports['GetCampaignHopperHistory']=function(_0x22b925){var _0x348ec6=this;return new Promise(function(_0x2a4dc5,_0x35f16e){return db[_0x7415('0x19')][_0x7415('0x1e')]({'raw':_0x22b925['options']?_0x22b925[_0x7415('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22b925[_0x7415('0x1c')]?_0x22b925[_0x7415('0x1c')][_0x7415('0x1f')]||null:null,'attributes':[[_0x7415('0x2f'),_0x7415('0x30')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db[_0x7415('0x20')][_0x7415('0x22')]('id')),_0x7415('0x47')],[db[_0x7415('0x20')]['fn'](_0x7415('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7415('0x24')))),_0x7415('0x48')]],'group':[_0x7415('0x2f')]})[_0x7415('0xd')](function(_0x2d662c){logger[_0x7415('0xe')]('GetCampaignHopperHistory',_0x22b925);logger[_0x7415('0x11')](_0x7415('0x49'),_0x22b925,JSON['stringify'](_0x2d662c));_0x2a4dc5(_0x2d662c);})['catch'](function(_0x2b551f){logger[_0x7415('0x14')]('GetCampaignHopperHistory',_0x2b551f[_0x7415('0x16')],_0x22b925);_0x35f16e(_0x348ec6[_0x7415('0x14')](0x1f4,_0x2b551f['message']));});});}; \ No newline at end of file +var _0x8bc8=['outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../config/environment','client','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null'];(function(_0x34c7d,_0x3dca7a){var _0x5a0167=function(_0x54932f){while(--_0x54932f){_0x34c7d['push'](_0x34c7d['shift']());}};_0x5a0167(++_0x3dca7a);}(_0x8bc8,0xc4));var _0x88bc=function(_0x4e38fd,_0x13d776){_0x4e38fd=_0x4e38fd-0x0;var _0x2fe8b7=_0x8bc8[_0x4e38fd];return _0x2fe8b7;};'use strict';var _=require(_0x88bc('0x0'));var util=require(_0x88bc('0x1'));var moment=require(_0x88bc('0x2'));var BPromise=require(_0x88bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x88bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x88bc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461948,_0x337252,_0x30e9d7){return new BPromise(function(_0x206a6c,_0x35e7f5){return client['request'](_0x461948,_0x30e9d7)[_0x88bc('0x7')](function(_0x223dba){logger['info'](_0x88bc('0x8'),_0x337252,_0x88bc('0x9'));logger[_0x88bc('0xa')](_0x88bc('0xb'),_0x337252,_0x88bc('0x9'),JSON[_0x88bc('0xc')](_0x223dba));if(_0x223dba[_0x88bc('0xd')]){if(_0x223dba[_0x88bc('0xd')][_0x88bc('0xe')]===0x1f4){logger['error'](_0x88bc('0x8'),_0x337252,_0x223dba[_0x88bc('0xd')][_0x88bc('0xf')]);return _0x35e7f5(_0x223dba[_0x88bc('0xd')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x337252,_0x223dba[_0x88bc('0xd')][_0x88bc('0xf')]);return _0x206a6c(_0x223dba['error']['message']);}else{logger[_0x88bc('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x337252,_0x88bc('0x9'));_0x206a6c(_0x223dba[_0x88bc('0x11')][_0x88bc('0xf')]);}})[_0x88bc('0x12')](function(_0x2dcfa0){logger[_0x88bc('0xd')](_0x88bc('0x8'),_0x337252,_0x2dcfa0);_0x35e7f5(_0x2dcfa0);});});}exports['CreateCmHopperHistory']=function(_0x1c555f){var _0x475ab8=this;return new Promise(function(_0xf1d1cb,_0x1c642f){return db[_0x88bc('0x13')][_0x88bc('0x14')](_0x1c555f[_0x88bc('0x15')],{'raw':_0x1c555f[_0x88bc('0x16')]?_0x1c555f[_0x88bc('0x16')][_0x88bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3e94e5){logger[_0x88bc('0x10')](_0x88bc('0x18'),_0x1c555f);logger['debug'](_0x88bc('0x18'),_0x1c555f,JSON['stringify'](_0x3e94e5));_0xf1d1cb(_0x3e94e5);})[_0x88bc('0x12')](function(_0x1998d1){logger['error'](_0x88bc('0x18'),_0x1998d1[_0x88bc('0xf')],_0x1c555f);_0x1c642f(_0x475ab8['error'](0x1f4,_0x1998d1[_0x88bc('0xf')]));});});};exports[_0x88bc('0x19')]=function(_0x538450){var _0x48c4f1=this;return new Promise(function(_0x5c5172,_0x339616){return db['CmHopperHistory'][_0x88bc('0x1a')]({'raw':_0x538450[_0x88bc('0x16')]?_0x538450[_0x88bc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x538450['options']?_0x538450[_0x88bc('0x16')][_0x88bc('0x1b')]||null:null,'attributes':[[db[_0x88bc('0x1c')]['fn']('COUNT',db[_0x88bc('0x1c')][_0x88bc('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db['sequelize'][_0x88bc('0x1f')](_0x88bc('0x20')))),_0x88bc('0x21')],[db['sequelize']['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')]['literal'](_0x88bc('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x88bc('0x23')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x24'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x25')))),'predictiveIntervalAvgHoldtime'],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x24'),db[_0x88bc('0x1c')]['fn']('IF',db['sequelize'][_0x88bc('0x1f')](_0x88bc('0x26')))),'predictiveIntervalAvgTalktime']]})[_0x88bc('0x7')](function(_0x5d3e82){logger['info']('AvgHandleTime',_0x538450);logger[_0x88bc('0xa')](_0x88bc('0x19'),_0x538450,JSON['stringify'](_0x5d3e82));_0x5c5172(_0x5d3e82);})[_0x88bc('0x12')](function(_0x6ba72d){logger[_0x88bc('0xd')]('AvgHandleTime',_0x6ba72d[_0x88bc('0xf')],_0x538450);_0x339616(_0x48c4f1['error'](0x1f4,_0x6ba72d[_0x88bc('0xf')]));});});};exports[_0x88bc('0x27')]=function(_0x368b7d){var _0x2e2e0c=this;return new Promise(function(_0x318588,_0xcf5d2c){return db[_0x88bc('0x13')]['findAll']({'raw':_0x368b7d['options']?_0x368b7d[_0x88bc('0x16')][_0x88bc('0x17')]===undefined?!![]:![]:!![],'where':_0x368b7d['options']?_0x368b7d[_0x88bc('0x16')]['where']||null:null,'attributes':[[_0x88bc('0x28'),_0x88bc('0x29')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x88bc('0x2a')],[db[_0x88bc('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x88bc('0x1f')](_0x88bc('0x2b')))),_0x88bc('0x2c')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db['sequelize'][_0x88bc('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x88bc('0x2d')],[db['sequelize']['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')]('`state`\x20=\x205,\x201,\x20null'))),_0x88bc('0x2e')],[db['sequelize']['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')]['literal'](_0x88bc('0x2f')))),'outboundCongestionCallsDay'],[db[_0x88bc('0x1c')]['fn']('COUNT',db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x88bc('0x30')],[db['sequelize']['fn']('COUNT',db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x31')))),_0x88bc('0x32')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x33')))),_0x88bc('0x34')],[db[_0x88bc('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x88bc('0x1f')](_0x88bc('0x35')))),_0x88bc('0x36')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x37')))),'outboundOriginateFailureCallsDay'],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db['sequelize']['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0x88bc('0x38')],[db[_0x88bc('0x1c')]['fn']('COUNT',db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x39')))),_0x88bc('0x3a')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x3b')))),_0x88bc('0x38')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x88bc('0x3c')]],'group':[_0x88bc('0x28')]})[_0x88bc('0x7')](function(_0x19a5c5){logger[_0x88bc('0x10')]('GetVoiceQueueHopperHistory',_0x368b7d);logger['debug'](_0x88bc('0x27'),_0x368b7d,JSON[_0x88bc('0xc')](_0x19a5c5));_0x318588(_0x19a5c5);})[_0x88bc('0x12')](function(_0x387b66){logger[_0x88bc('0xd')](_0x88bc('0x27'),_0x387b66[_0x88bc('0xf')],_0x368b7d);_0xcf5d2c(_0x2e2e0c['error'](0x1f4,_0x387b66[_0x88bc('0xf')]));});});};exports[_0x88bc('0x3d')]=function(_0x563446){var _0x460a2d=this;return new Promise(function(_0x5dd84c,_0x416b1e){return db[_0x88bc('0x13')][_0x88bc('0x1a')]({'raw':_0x563446[_0x88bc('0x16')]?_0x563446[_0x88bc('0x16')][_0x88bc('0x17')]===undefined?!![]:![]:!![],'where':_0x563446['options']?_0x563446['options'][_0x88bc('0x1b')]||null:null,'attributes':[[_0x88bc('0x28'),_0x88bc('0x29')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')][_0x88bc('0x1d')]('id')),_0x88bc('0x3e')],[db[_0x88bc('0x1c')]['fn'](_0x88bc('0x1e'),db[_0x88bc('0x1c')]['fn']('IF',db[_0x88bc('0x1c')][_0x88bc('0x1f')](_0x88bc('0x20')))),_0x88bc('0x3f')]],'group':[_0x88bc('0x28')]})[_0x88bc('0x7')](function(_0x55e340){logger[_0x88bc('0x10')](_0x88bc('0x3d'),_0x563446);logger[_0x88bc('0xa')](_0x88bc('0x3d'),_0x563446,JSON[_0x88bc('0xc')](_0x55e340));_0x5dd84c(_0x55e340);})[_0x88bc('0x12')](function(_0x4b9bed){logger[_0x88bc('0xd')](_0x88bc('0x3d'),_0x4b9bed[_0x88bc('0xf')],_0x563446);_0x416b1e(_0x460a2d[_0x88bc('0xd')](0x1f4,_0x4b9bed[_0x88bc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 94b920a..e9a31a4 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 _0xc00d=['post','create','put','/:id','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x497948,_0x4ca60c){var _0x39bb36=function(_0x2ec88e){while(--_0x2ec88e){_0x497948['push'](_0x497948['shift']());}};_0x39bb36(++_0x4ca60c);}(_0xc00d,0x149));var _0xdc00=function(_0x27b8e9,_0xc4eb5f){_0x27b8e9=_0x27b8e9-0x0;var _0x1af1ac=_0xc00d[_0x27b8e9];return _0x1af1ac;};'use strict';var multer=require(_0xdc00('0x0'));var util=require(_0xdc00('0x1'));var path=require('path');var timeout=require(_0xdc00('0x2'));var express=require('express');var router=express[_0xdc00('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc00('0x4'));var interaction=require(_0xdc00('0x5'));var config=require(_0xdc00('0x6'));var controller=require(_0xdc00('0x7'));router[_0xdc00('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc00('0x8')](_0xdc00('0x9'),auth[_0xdc00('0xa')](),controller[_0xdc00('0xb')]);router[_0xdc00('0x8')]('/:id',auth[_0xdc00('0xa')](),controller[_0xdc00('0xc')]);router[_0xdc00('0xd')]('/',auth[_0xdc00('0xa')](),controller[_0xdc00('0xe')]);router[_0xdc00('0xf')](_0xdc00('0x10'),auth['isAuthenticated'](),controller[_0xdc00('0x11')]);module[_0xdc00('0x12')]=router; \ No newline at end of file +var _0xfbaf=['describe','/:id','show','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x6648f8,_0x59c2cf){var _0x56bdb6=function(_0x5dc547){while(--_0x5dc547){_0x6648f8['push'](_0x6648f8['shift']());}};_0x56bdb6(++_0x59c2cf);}(_0xfbaf,0x195));var _0xffba=function(_0x14de91,_0x14a7dc){_0x14de91=_0x14de91-0x0;var _0xe5d0c8=_0xfbaf[_0x14de91];return _0xe5d0c8;};'use strict';var multer=require(_0xffba('0x0'));var util=require(_0xffba('0x1'));var path=require(_0xffba('0x2'));var timeout=require(_0xffba('0x3'));var express=require(_0xffba('0x4'));var router=express[_0xffba('0x5')]();var fs_extra=require(_0xffba('0x6'));var auth=require(_0xffba('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xffba('0x8'));var controller=require(_0xffba('0x9'));router[_0xffba('0xa')]('/',auth[_0xffba('0xb')](),controller[_0xffba('0xc')]);router[_0xffba('0xa')]('/describe',auth[_0xffba('0xb')](),controller[_0xffba('0xd')]);router['get'](_0xffba('0xe'),auth[_0xffba('0xb')](),controller[_0xffba('0xf')]);router['post']('/',auth[_0xffba('0xb')](),controller['create']);router[_0xffba('0x10')](_0xffba('0xe'),auth['isAuthenticated'](),controller[_0xffba('0x11')]);module[_0xffba('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 3868573..c761545 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 _0x2bd6=['sequelize','exports','STRING','name'];(function(_0x1e4151,_0x470174){var _0x1dc64c=function(_0x481112){while(--_0x481112){_0x1e4151['push'](_0x1e4151['shift']());}};_0x1dc64c(++_0x470174);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x2bd6[_0x25efdf];return _0x22c495;};'use strict';var Sequelize=require(_0x62bd('0x0'));module[_0x62bd('0x1')]={'name':{'type':Sequelize[_0x62bd('0x2')],'unique':_0x62bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x62bd('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4986=['exports','STRING','sequelize'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x4986,0x6e));var _0x6498=function(_0x2cbb9b,_0x1ea6fc){_0x2cbb9b=_0x2cbb9b-0x0;var _0x5f3169=_0x4986[_0x2cbb9b];return _0x5f3169;};'use strict';var Sequelize=require(_0x6498('0x0'));module[_0x6498('0x1')]={'name':{'type':Sequelize[_0x6498('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x6498('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 2c40d8f..d41c3eb 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 _0x5a16=['getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','transaction','Sequelize','TEXT','type','text','number','INTEGER','BOOLEAN','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','end','stack','name','send','map','CmList','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','length','hasOwnProperty','pick','filter','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5a16,0x14c));var _0x65a1=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0x5a16[_0x4450b1];return _0x399b0b;};'use strict';var emlformat=require(_0x65a1('0x0'));var rimraf=require(_0x65a1('0x1'));var zipdir=require(_0x65a1('0x2'));var jsonpatch=require(_0x65a1('0x3'));var rp=require('request-promise');var moment=require(_0x65a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65a1('0x5'));var util=require(_0x65a1('0x6'));var path=require('path');var sox=require(_0x65a1('0x7'));var csv=require(_0x65a1('0x8'));var ejs=require(_0x65a1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65a1('0xa'));var crypto=require(_0x65a1('0xb'));var jsforce=require(_0x65a1('0xc'));var deskjs=require(_0x65a1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x65a1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x65a1('0xf'));var as=require(_0x65a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65a1('0x11'))(_0x65a1('0x12'));var utils=require(_0x65a1('0x13'));var config=require(_0x65a1('0x14'));var licenseUtil=require(_0x65a1('0x15'));var db=require(_0x65a1('0x16'))['db'];config[_0x65a1('0x17')]=_['defaults'](config[_0x65a1('0x17')],{'host':_0x65a1('0x18'),'port':0x18eb});var socket=require(_0x65a1('0x19'))(new Redis(config[_0x65a1('0x17')]));require(_0x65a1('0x1a'))['register'](socket);function respondWithStatusCode(_0x3601b6,_0x380743){_0x380743=_0x380743||0xcc;return function(_0x4e4124){if(_0x4e4124){return _0x3601b6[_0x65a1('0x1b')](_0x380743);}return _0x3601b6[_0x65a1('0x1c')](_0x380743)['end']();};}function respondWithResult(_0x87a4b9,_0x526fce){_0x526fce=_0x526fce||0xc8;return function(_0x368604){if(_0x368604){return _0x87a4b9[_0x65a1('0x1c')](_0x526fce)['json'](_0x368604);}};}function respondWithFilteredResult(_0x3bc6e3,_0x2f2651){return function(_0x2e3937){if(_0x2e3937){var _0x1aa283=typeof _0x2f2651[_0x65a1('0x1d')]==='undefined'&&typeof _0x2f2651['limit']===_0x65a1('0x1e');var _0xf0d4=_0x2e3937[_0x65a1('0x1f')];var _0x12aa3b=_0x1aa283?0x0:_0x2f2651['offset'];var _0x1de1d8=_0x1aa283?_0x2e3937[_0x65a1('0x1f')]:_0x2f2651[_0x65a1('0x1d')]+_0x2f2651[_0x65a1('0x20')];var _0xce7821;if(_0x1de1d8>=_0xf0d4){_0x1de1d8=_0xf0d4;_0xce7821=0xc8;}else{_0xce7821=0xce;}_0x3bc6e3[_0x65a1('0x1c')](_0xce7821);return _0x3bc6e3[_0x65a1('0x21')](_0x65a1('0x22'),_0x12aa3b+'-'+_0x1de1d8+'/'+_0xf0d4)[_0x65a1('0x23')](_0x2e3937);}return null;};}function patchUpdates(_0x5b04eb){return function(_0x1725d3){try{jsonpatch[_0x65a1('0x24')](_0x1725d3,_0x5b04eb,!![]);}catch(_0x53044a){return BPromise['reject'](_0x53044a);}return _0x1725d3[_0x65a1('0x25')]();};}function saveUpdates(_0x4bb6b2,_0x30dd60){return function(_0x5995e8){if(_0x5995e8){return _0x5995e8[_0x65a1('0x26')](_0x4bb6b2)[_0x65a1('0x27')](function(_0x4e5ed4){return _0x4e5ed4;});}return null;};}function removeEntity(_0x33c802,_0x55c6ad){return function(_0x48367d){if(_0x48367d){return _0x48367d[_0x65a1('0x28')]()['then'](function(){var _0x52532e=_0x48367d[_0x65a1('0x29')]({'plain':!![]});var _0x3047de=_0x65a1('0x2a');return db[_0x65a1('0x2b')]['destroy']({'where':{'type':_0x3047de,'resourceId':_0x52532e['id']}})[_0x65a1('0x27')](function(){return _0x48367d;});})[_0x65a1('0x27')](function(){_0x33c802[_0x65a1('0x1c')](0xcc)[_0x65a1('0x2c')]();});}};}function handleEntityNotFound(_0x50b288,_0x3e0cd0){return function(_0x348c14){if(!_0x348c14){_0x50b288['sendStatus'](0x194);}return _0x348c14;};}function handleError(_0x5bb53c,_0x42cec0){_0x42cec0=_0x42cec0||0x1f4;return function(_0x1deb9e){logger['error'](_0x1deb9e[_0x65a1('0x2d')]);if(_0x1deb9e[_0x65a1('0x2e')]){delete _0x1deb9e[_0x65a1('0x2e')];}_0x5bb53c[_0x65a1('0x1c')](_0x42cec0)[_0x65a1('0x2f')](_0x1deb9e);};}exports['index']=function(_0x218f1f,_0xf959ca){var _0x4660a0={},_0x43ed65={},_0x39afe9={'count':0x0,'rows':[]};var _0x14fbe6=_[_0x65a1('0x30')](db[_0x65a1('0x31')][_0x65a1('0x32')],function(_0x3ebfe8){return{'name':_0x3ebfe8[_0x65a1('0x33')],'type':_0x3ebfe8['type']['key']};});_0x43ed65[_0x65a1('0x34')]=_[_0x65a1('0x30')](_0x14fbe6,_0x65a1('0x2e'));_0x43ed65[_0x65a1('0x35')]=_['keys'](_0x218f1f[_0x65a1('0x35')]);_0x43ed65[_0x65a1('0x36')]=_[_0x65a1('0x37')](_0x43ed65['model'],_0x43ed65[_0x65a1('0x35')]);_0x4660a0[_0x65a1('0x38')]=_[_0x65a1('0x37')](_0x43ed65[_0x65a1('0x34')],qs[_0x65a1('0x39')](_0x218f1f[_0x65a1('0x35')]['fields']));_0x4660a0[_0x65a1('0x38')]=_0x4660a0[_0x65a1('0x38')]['length']?_0x4660a0[_0x65a1('0x38')]:_0x43ed65[_0x65a1('0x34')];if(!_0x218f1f[_0x65a1('0x35')]['hasOwnProperty'](_0x65a1('0x3a'))){_0x4660a0['limit']=qs[_0x65a1('0x20')](_0x218f1f[_0x65a1('0x35')][_0x65a1('0x20')]);_0x4660a0[_0x65a1('0x1d')]=qs[_0x65a1('0x1d')](_0x218f1f[_0x65a1('0x35')]['offset']);}_0x4660a0[_0x65a1('0x3b')]=qs[_0x65a1('0x3c')](_0x218f1f[_0x65a1('0x35')][_0x65a1('0x3c')]);_0x4660a0[_0x65a1('0x3d')]=qs[_0x65a1('0x36')](_['pick'](_0x218f1f[_0x65a1('0x35')],_0x43ed65[_0x65a1('0x36')]),_0x14fbe6);if(_0x218f1f[_0x65a1('0x35')]['filter']){_0x4660a0[_0x65a1('0x3d')]=_[_0x65a1('0x3e')](_0x4660a0['where'],{'$or':_[_0x65a1('0x30')](_0x14fbe6,function(_0x2843c3){if(_0x2843c3['type']!==_0x65a1('0x3f')){var _0x2bf6db={};_0x2bf6db[_0x2843c3[_0x65a1('0x2e')]]={'$like':'%'+_0x218f1f['query']['filter']+'%'};return _0x2bf6db;}})});}_0x4660a0=_[_0x65a1('0x3e')]({},_0x4660a0,_0x218f1f[_0x65a1('0x40')]);var _0x1b921e={'where':_0x4660a0[_0x65a1('0x3d')]};return db[_0x65a1('0x31')][_0x65a1('0x1f')](_0x1b921e)[_0x65a1('0x27')](function(_0x31a302){_0x39afe9[_0x65a1('0x1f')]=_0x31a302;if(_0x218f1f[_0x65a1('0x35')][_0x65a1('0x41')]){_0x4660a0['include']=[{'all':!![]}];}return db[_0x65a1('0x31')]['findAll'](_0x4660a0);})[_0x65a1('0x27')](function(_0x7a6f9a){_0x39afe9[_0x65a1('0x42')]=_0x7a6f9a;return _0x39afe9;})[_0x65a1('0x27')](respondWithFilteredResult(_0xf959ca,_0x4660a0))[_0x65a1('0x43')](handleError(_0xf959ca,null));};exports[_0x65a1('0x44')]=function(_0x527a17,_0x17207f){var _0x9f0c59={'raw':![],'where':{'id':_0x527a17[_0x65a1('0x45')]['id']}},_0x14e115={};_0x14e115[_0x65a1('0x34')]=_[_0x65a1('0x46')](db['CmList'][_0x65a1('0x32')]);_0x14e115[_0x65a1('0x35')]=_[_0x65a1('0x46')](_0x527a17[_0x65a1('0x35')]);_0x14e115[_0x65a1('0x36')]=_['intersection'](_0x14e115[_0x65a1('0x34')],_0x14e115[_0x65a1('0x35')]);_0x9f0c59[_0x65a1('0x38')]=_[_0x65a1('0x37')](_0x14e115['model'],qs['fields'](_0x527a17['query'][_0x65a1('0x39')]));_0x9f0c59[_0x65a1('0x38')]=_0x9f0c59[_0x65a1('0x38')]['length']?_0x9f0c59['attributes']:_0x14e115[_0x65a1('0x34')];if(_0x527a17[_0x65a1('0x35')][_0x65a1('0x41')]){_0x9f0c59[_0x65a1('0x47')]=[{'all':!![]}];}_0x9f0c59=_['merge']({},_0x9f0c59,_0x527a17['options']);return db[_0x65a1('0x31')][_0x65a1('0x48')](_0x9f0c59)[_0x65a1('0x27')](handleEntityNotFound(_0x17207f,null))[_0x65a1('0x27')](respondWithResult(_0x17207f,null))[_0x65a1('0x43')](handleError(_0x17207f,null));};exports['create']=function(_0x3da698,_0x896f2e){return db['CmList'][_0x65a1('0x49')](_0x3da698[_0x65a1('0x4a')],{})['then'](function(_0x199d31){var _0x12ed7b=_0x3da698[_0x65a1('0x4b')][_0x65a1('0x29')]({'plain':!![]});if(!_0x12ed7b)throw new Error(_0x65a1('0x4c'));if(_0x12ed7b[_0x65a1('0x4d')]==='user'){var _0x264807=_0x199d31[_0x65a1('0x29')]({'plain':!![]});var _0x35d394=_0x65a1('0x2a');return db[_0x65a1('0x4e')]['find']({'where':{'name':_0x35d394,'userProfileId':_0x12ed7b[_0x65a1('0x4f')]},'raw':!![]})[_0x65a1('0x27')](function(_0x3329de){if(_0x3329de&&_0x3329de[_0x65a1('0x50')]===0x0){return db[_0x65a1('0x2b')][_0x65a1('0x49')]({'name':_0x264807[_0x65a1('0x2e')],'resourceId':_0x264807['id'],'type':_0x3329de[_0x65a1('0x2e')],'sectionId':_0x3329de['id']},{})[_0x65a1('0x27')](function(){return _0x199d31;});}else{return _0x199d31;}})[_0x65a1('0x43')](function(_0x351800){logger[_0x65a1('0x51')](_0x65a1('0x52'),_0x351800);throw _0x351800;});}return _0x199d31;})[_0x65a1('0x27')](respondWithResult(_0x896f2e,0xc9))[_0x65a1('0x43')](handleError(_0x896f2e,null));};exports['update']=function(_0x5bbb0c,_0x19b68b){if(_0x5bbb0c[_0x65a1('0x4a')]['id']){delete _0x5bbb0c[_0x65a1('0x4a')]['id'];}return db['CmList']['find']({'where':{'id':_0x5bbb0c[_0x65a1('0x45')]['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x19b68b,null))[_0x65a1('0x27')](saveUpdates(_0x5bbb0c[_0x65a1('0x4a')],null))[_0x65a1('0x27')](respondWithResult(_0x19b68b,null))[_0x65a1('0x43')](handleError(_0x19b68b,null));};exports[_0x65a1('0x28')]=function(_0x15cb93,_0x3cdf85){return db['CmList'][_0x65a1('0x48')]({'where':{'id':_0x15cb93[_0x65a1('0x45')]['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x3cdf85,null))['then'](removeEntity(_0x3cdf85,null))[_0x65a1('0x43')](handleError(_0x3cdf85,null));};exports[_0x65a1('0x53')]=function(_0x564fff,_0xa9b9c){return db[_0x65a1('0x31')]['describe']()['then'](respondWithResult(_0xa9b9c,null))['catch'](handleError(_0xa9b9c,null));};exports['addDisposition']=function(_0x4b4a42,_0x370001,_0x3d36c3){if(_0x4b4a42[_0x65a1('0x4a')]['id']){delete _0x4b4a42[_0x65a1('0x4a')]['id'];}return db['CmList'][_0x65a1('0x48')]({'where':{'id':_0x4b4a42[_0x65a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x370001,null))[_0x65a1('0x27')](function(_0x2106c4){if(_0x2106c4){_0x4b4a42[_0x65a1('0x4a')][_0x65a1('0x54')]=_0x2106c4['id'];return db[_0x65a1('0x55')][_0x65a1('0x49')](_0x4b4a42[_0x65a1('0x4a')]);}})[_0x65a1('0x27')](respondWithResult(_0x370001,null))[_0x65a1('0x43')](handleError(_0x370001,null));};exports['getDispositions']=function(_0x35edcf,_0x551539,_0xf0218d){var _0x10fae4={'raw':![],'where':{}};var _0x36b604={};var _0x2b8536={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x35edcf[_0x65a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x551539,null))[_0x65a1('0x27')](function(_0x4d20db){if(_0x4d20db){_0x36b604[_0x65a1('0x34')]=_[_0x65a1('0x46')](db[_0x65a1('0x55')][_0x65a1('0x32')]);_0x36b604[_0x65a1('0x35')]=_[_0x65a1('0x46')](_0x35edcf[_0x65a1('0x35')]);_0x36b604[_0x65a1('0x36')]=_['intersection'](_0x36b604[_0x65a1('0x34')],_0x36b604[_0x65a1('0x35')]);_0x10fae4['attributes']=_[_0x65a1('0x37')](_0x36b604[_0x65a1('0x34')],qs[_0x65a1('0x39')](_0x35edcf['query'][_0x65a1('0x39')]));_0x10fae4[_0x65a1('0x38')]=_0x10fae4[_0x65a1('0x38')][_0x65a1('0x56')]?_0x10fae4[_0x65a1('0x38')]:_0x36b604['model'];if(!_0x35edcf[_0x65a1('0x35')][_0x65a1('0x57')]('nolimit')){_0x10fae4[_0x65a1('0x20')]=qs['limit'](_0x35edcf['query']['limit']);_0x10fae4[_0x65a1('0x1d')]=qs['offset'](_0x35edcf[_0x65a1('0x35')][_0x65a1('0x1d')]);}_0x10fae4[_0x65a1('0x3b')]=qs[_0x65a1('0x3c')](_0x35edcf[_0x65a1('0x35')][_0x65a1('0x3c')]);_0x10fae4[_0x65a1('0x3d')]=qs[_0x65a1('0x36')](_[_0x65a1('0x58')](_0x35edcf[_0x65a1('0x35')],_0x36b604[_0x65a1('0x36')]));_0x10fae4['where'][_0x65a1('0x54')]=_0x4d20db['id'];if(_0x35edcf[_0x65a1('0x35')][_0x65a1('0x59')]){_0x10fae4[_0x65a1('0x3d')]=_['merge'](_0x10fae4[_0x65a1('0x3d')],{'$or':_['map'](_0x10fae4[_0x65a1('0x38')],function(_0x15a0c3){var _0x4d86d8={};_0x4d86d8[_0x15a0c3]={'$like':'%'+_0x35edcf[_0x65a1('0x35')]['filter']+'%'};return _0x4d86d8;})});}_0x10fae4=_['merge']({},_0x10fae4,_0x35edcf[_0x65a1('0x40')]);return db['Disposition'][_0x65a1('0x1f')]({'where':_0x10fae4[_0x65a1('0x3d')]})[_0x65a1('0x27')](function(_0x3a4f29){_0x2b8536[_0x65a1('0x1f')]=_0x3a4f29;if(_0x35edcf[_0x65a1('0x35')][_0x65a1('0x41')]){_0x10fae4[_0x65a1('0x47')]=[{'all':!![]}];}return db[_0x65a1('0x55')][_0x65a1('0x5a')](_0x10fae4);})[_0x65a1('0x27')](function(_0x38e711){_0x2b8536[_0x65a1('0x42')]=_0x38e711;return _0x2b8536;});}})[_0x65a1('0x27')](respondWithFilteredResult(_0x551539,_0x10fae4))[_0x65a1('0x43')](handleError(_0x551539,null));};exports[_0x65a1('0x5b')]=function(_0xee757a,_0x3af41e,_0x170e3e){return db['CmList'][_0x65a1('0x48')]({'where':{'id':_0xee757a[_0x65a1('0x45')]['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x3af41e,null))['then'](function(_0x223633){if(_0x223633){return _0x223633[_0x65a1('0x5b')](_0xee757a[_0x65a1('0x35')][_0x65a1('0x5c')]);}})[_0x65a1('0x27')](respondWithStatusCode(_0x3af41e,null))[_0x65a1('0x43')](handleError(_0x3af41e,null));};exports[_0x65a1('0x5d')]=function(_0x524c4f,_0x3b13d6,_0x52da37){return db[_0x65a1('0x31')][_0x65a1('0x48')]({'where':{'id':_0x524c4f[_0x65a1('0x45')]['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x3b13d6,null))[_0x65a1('0x27')](function(_0xd0234c){if(_0xd0234c){var _0x32d44c=[];var _0x35cead={'success':[],'errors':[]};return db[_0x65a1('0x5e')]['describe']()['then'](function(_0x52dd6b){if(_0x524c4f[_0x65a1('0x4a')][_0x65a1('0x5f')]&&_[_0x65a1('0x60')](_0x524c4f[_0x65a1('0x4a')][_0x65a1('0x5f')])){if(_0x524c4f[_0x65a1('0x4a')]['tags']['length']){_0x524c4f[_0x65a1('0x4a')][_0x65a1('0x5f')]=_0x524c4f['body']['tags'][_0x65a1('0x61')](';')+';';}else{_0x524c4f[_0x65a1('0x4a')][_0x65a1('0x5f')]=null;}}else{_0x524c4f['body'][_0x65a1('0x5f')]=null;}if(_0x524c4f[_0x65a1('0x4a')]&&_[_0x65a1('0x60')](_0x524c4f[_0x65a1('0x4a')])){for(var _0x4af439=0x0;_0x4af439<_0x524c4f[_0x65a1('0x4a')][_0x65a1('0x56')];_0x4af439+=0x1){_0x524c4f[_0x65a1('0x4a')][_0x4af439]['ListId']=_0x524c4f['params']['id'];_0x32d44c[_0x65a1('0x62')](_0x524c4f[_0x65a1('0x4a')][_0x4af439]);}return BPromise[_0x65a1('0x63')](_0x32d44c,function(_0x32572b){return db['CmContact'][_0x65a1('0x49')](_[_0x65a1('0x64')](_0x32572b,[_0x65a1('0x5c'),'id'])||{},{'fields':_[_0x65a1('0x46')](_0x52dd6b),'raw':!![]})[_0x65a1('0x27')](function(_0x5ba3d6){_0x35cead[_0x65a1('0x65')]['push'](_0x5ba3d6[_0x65a1('0x66')]);})[_0x65a1('0x43')](function(_0x5175e5){_0x35cead[_0x65a1('0x67')][_0x65a1('0x62')]({'data':_0x32572b,'error':_0x5175e5[_0x65a1('0x68')]});});})[_0x65a1('0x27')](function(_0x5b191){return _0x35cead;})[_0x65a1('0x43')](function(_0x2f84de){return _0x2f84de;});}else{_0x3b13d6['status'](0x190)['json']({'message':_0x65a1('0x69')});}});}})[_0x65a1('0x27')](respondWithResult(_0x3b13d6,null))[_0x65a1('0x43')](handleError(_0x3b13d6,null));};exports[_0x65a1('0x6a')]=function(_0x234f8b,_0x25a605,_0x376bcb){var _0x12a8fe;return db[_0x65a1('0x31')][_0x65a1('0x48')]({'where':{'id':_0x234f8b[_0x65a1('0x45')]['id']},'include':[{'model':db[_0x65a1('0x6b')],'as':_0x65a1('0x6c')}]})[_0x65a1('0x27')](handleEntityNotFound(_0x25a605,null))[_0x65a1('0x27')](function(_0x8bab85){if(_0x8bab85){_0x12a8fe=_0x8bab85;return db[_0x65a1('0x5e')][_0x65a1('0x32')];}})[_0x65a1('0x27')](function(_0x102018){if(_0x102018){var _0x192983={};var _0x208c0d={};_0x208c0d[_0x65a1('0x34')]=_[_0x65a1('0x6d')](_[_0x65a1('0x46')](_0x102018),_['map'](_0x12a8fe[_0x65a1('0x6c')],function(_0x2ebfdc){return util[_0x65a1('0x6e')](_0x65a1('0x6f'),_0x2ebfdc['id']);}));_0x208c0d[_0x65a1('0x35')]=_[_0x65a1('0x46')](_0x234f8b[_0x65a1('0x35')]);_0x208c0d[_0x65a1('0x36')]=_['intersection'](_0x208c0d[_0x65a1('0x34')],_0x208c0d[_0x65a1('0x35')]);_0x192983[_0x65a1('0x38')]=_[_0x65a1('0x37')](_0x208c0d['model'],qs['fields'](_0x234f8b[_0x65a1('0x35')][_0x65a1('0x39')]));_0x192983[_0x65a1('0x38')]=_0x192983[_0x65a1('0x38')][_0x65a1('0x56')]?_0x192983[_0x65a1('0x38')]:_0x208c0d[_0x65a1('0x34')];if(!_0x234f8b[_0x65a1('0x35')][_0x65a1('0x57')]('nolimit')){_0x192983[_0x65a1('0x20')]=qs[_0x65a1('0x20')](_0x234f8b[_0x65a1('0x35')][_0x65a1('0x20')]);_0x192983[_0x65a1('0x1d')]=qs[_0x65a1('0x1d')](_0x234f8b[_0x65a1('0x35')][_0x65a1('0x1d')]);}_0x192983[_0x65a1('0x3b')]=qs[_0x65a1('0x3c')](_0x234f8b[_0x65a1('0x35')]['sort']);_0x192983[_0x65a1('0x3d')]=qs[_0x65a1('0x36')](_[_0x65a1('0x58')](_0x234f8b['query'],_0x208c0d[_0x65a1('0x36')]));_0x192983[_0x65a1('0x70')]=!![];if(_0x234f8b[_0x65a1('0x35')]['filter']){_0x192983[_0x65a1('0x3d')]=_[_0x65a1('0x3e')](_0x192983[_0x65a1('0x3d')],{'$or':_[_0x65a1('0x30')](_0x192983[_0x65a1('0x38')],function(_0xb53d68){var _0x189fca={};_0x189fca[_0xb53d68]={'$like':'%'+_0x234f8b[_0x65a1('0x35')]['filter']+'%'};return _0x189fca;})});}_0x192983=_['merge']({},_0x192983,_0x234f8b[_0x65a1('0x40')]);return _0x12a8fe[_0x65a1('0x6a')](_0x192983);}})[_0x65a1('0x27')](respondWithResult(_0x25a605,null))['catch'](handleError(_0x25a605,null));};exports[_0x65a1('0x71')]=function(_0x5bde3a,_0x5c09c1,_0x4380da){var _0x44370a;return db[_0x65a1('0x31')][_0x65a1('0x48')]({'where':{'id':_0x5bde3a[_0x65a1('0x45')]['id']},'include':[{'model':db[_0x65a1('0x6b')],'as':_0x65a1('0x6c')}]})[_0x65a1('0x27')](handleEntityNotFound(_0x5c09c1,null))[_0x65a1('0x27')](function(_0x4dc21c){if(_0x4dc21c){_0x44370a=_0x4dc21c;return db[_0x65a1('0x5e')][_0x65a1('0x32')];}})[_0x65a1('0x27')](function(_0x941654){if(_0x941654){var _0x372842={};var _0xd38889={};_0xd38889[_0x65a1('0x34')]=_[_0x65a1('0x6d')](_[_0x65a1('0x46')](_0x941654),_[_0x65a1('0x30')](_0x44370a[_0x65a1('0x6c')],function(_0xbbab20){return util[_0x65a1('0x6e')](_0x65a1('0x6f'),_0xbbab20['id']);}));_0xd38889['query']=_[_0x65a1('0x46')](_0x5bde3a[_0x65a1('0x35')]);_0xd38889[_0x65a1('0x36')]=_[_0x65a1('0x37')](_0xd38889['model'],_0xd38889['query']);_0x372842[_0x65a1('0x38')]=_[_0x65a1('0x37')](_0xd38889[_0x65a1('0x34')],qs['fields'](_0x5bde3a[_0x65a1('0x35')][_0x65a1('0x39')]));_0x372842[_0x65a1('0x38')]=_0x372842['attributes']['length']?_0x372842[_0x65a1('0x38')]:_0xd38889[_0x65a1('0x34')];if(!_0x5bde3a[_0x65a1('0x35')]['hasOwnProperty'](_0x65a1('0x3a'))){_0x372842[_0x65a1('0x20')]=qs[_0x65a1('0x20')](_0x5bde3a['query'][_0x65a1('0x20')]);_0x372842['offset']=qs[_0x65a1('0x1d')](_0x5bde3a[_0x65a1('0x35')]['offset']);}_0x372842[_0x65a1('0x3b')]=qs[_0x65a1('0x3c')](_0x5bde3a['query']['sort']);_0x372842[_0x65a1('0x3d')]=qs[_0x65a1('0x36')](_[_0x65a1('0x58')](_0x5bde3a[_0x65a1('0x35')],_0xd38889[_0x65a1('0x36')]));_0x372842[_0x65a1('0x70')]=!![];if(_0x5bde3a[_0x65a1('0x35')][_0x65a1('0x59')]){_0x372842[_0x65a1('0x3d')]=_['merge'](_0x372842[_0x65a1('0x3d')],{'$or':_[_0x65a1('0x30')](_0x372842['attributes'],function(_0x32f7f2){var _0x2a621e={};_0x2a621e[_0x32f7f2]={'$like':'%'+_0x5bde3a[_0x65a1('0x35')][_0x65a1('0x59')]+'%'};return _0x2a621e;})});}_0x372842=_['merge']({},_0x372842,_0x5bde3a[_0x65a1('0x40')]);return _0x44370a[_0x65a1('0x6a')](_0x372842);}})[_0x65a1('0x27')](function(_0x2dcc8c){if(!_[_0x65a1('0x72')](_0x2dcc8c)){var _0xcd2035=toCsv(_0x2dcc8c);var _0x5412da=Date[_0x65a1('0x73')]();fs[_0x65a1('0x74')](util['format'](_0x65a1('0x75'),_0x44370a['id'],_0x5412da),_0xcd2035);_0x5c09c1[_0x65a1('0x76')](_0x65a1('0x77'),_0x65a1('0x78')+util[_0x65a1('0x6e')](_0x65a1('0x79'),_0x44370a['id'],_0x5412da));_0x5c09c1[_0x65a1('0x76')](_0x65a1('0x7a'),_0x65a1('0x7b'));return _0x5c09c1[_0x65a1('0x7c')](util['format'](_0x65a1('0x75'),_0x44370a['id'],_0x5412da));}else{return _0x5c09c1['sendStatus'](0xcc);}})[_0x65a1('0x43')](handleError(_0x5c09c1,null));};exports[_0x65a1('0x7d')]=function(_0x7f021c,_0x44be89,_0x2829d2){var _0x126ad2;delete _0x7f021c[_0x65a1('0x4a')]['id'];return db[_0x65a1('0x31')][_0x65a1('0x7e')]({'where':{'id':_0x7f021c['params']['id']}})['then'](handleEntityNotFound(_0x44be89,null))[_0x65a1('0x27')](function(_0x3e896c){if(_0x3e896c){return db[_0x65a1('0x7f')][_0x65a1('0x80')](function(_0x58bc1f){return db[_0x65a1('0x6b')][_0x65a1('0x49')](_0x7f021c['body'],{'transaction':_0x58bc1f})['then'](function(_0x6a9e2){_0x126ad2=_0x6a9e2;return _0x3e896c['addCustomFields'](_0x6a9e2,{'transaction':_0x58bc1f});})['then'](function(){var _0x71c642={'type':db[_0x65a1('0x81')][_0x65a1('0x82')],'transaction':_0x58bc1f};switch(_0x7f021c[_0x65a1('0x4a')][_0x65a1('0x83')]){case _0x65a1('0x84'):_0x71c642['type']=db[_0x65a1('0x81')][_0x65a1('0x82')];break;case _0x65a1('0x85'):_0x71c642[_0x65a1('0x83')]=db[_0x65a1('0x81')][_0x65a1('0x86')];break;case'switch':_0x71c642['type']=db[_0x65a1('0x81')][_0x65a1('0x87')];_0x71c642['defaultValue']=![];break;default:}return db[_0x65a1('0x7f')]['queryInterface'][_0x65a1('0x88')]('cm_contacts',util[_0x65a1('0x6e')](_0x65a1('0x89'),_0x126ad2['id']),_0x71c642);})[_0x65a1('0x27')](function(){return _0x126ad2;});});}})[_0x65a1('0x27')](respondWithResult(_0x44be89,null))['catch'](handleError(_0x44be89,null));};exports[_0x65a1('0x8a')]=function(_0x30d82e,_0x437bb9,_0x52cd74){var _0x5dad01={};var _0x2ffd8b={};var _0x54d7ad;var _0x26dc6f;return db[_0x65a1('0x31')][_0x65a1('0x7e')]({'where':{'id':_0x30d82e['params']['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x437bb9,null))[_0x65a1('0x27')](function(_0x3ce783){if(_0x3ce783){_0x54d7ad=_0x3ce783;_0x2ffd8b[_0x65a1('0x34')]=_[_0x65a1('0x46')](db[_0x65a1('0x6b')][_0x65a1('0x32')]);_0x2ffd8b['query']=_[_0x65a1('0x46')](_0x30d82e[_0x65a1('0x35')]);_0x2ffd8b['filters']=_['intersection'](_0x2ffd8b[_0x65a1('0x34')],_0x2ffd8b['query']);_0x5dad01[_0x65a1('0x38')]=_[_0x65a1('0x37')](_0x2ffd8b['model'],qs[_0x65a1('0x39')](_0x30d82e[_0x65a1('0x35')]['fields']));_0x5dad01['attributes']=_0x5dad01[_0x65a1('0x38')][_0x65a1('0x56')]?_0x5dad01['attributes']:_0x2ffd8b[_0x65a1('0x34')];_0x5dad01['order']=qs['sort'](_0x30d82e[_0x65a1('0x35')]['sort']);_0x5dad01[_0x65a1('0x3d')]=qs[_0x65a1('0x36')](_[_0x65a1('0x58')](_0x30d82e[_0x65a1('0x35')],_0x2ffd8b['filters']));_0x5dad01['where']=_[_0x65a1('0x3e')](_0x5dad01[_0x65a1('0x3d')],{'$or':[{'ListId':_0x3ce783['id']},{'ListId':null}]});if(_0x30d82e[_0x65a1('0x35')]['filter']){_0x5dad01[_0x65a1('0x3d')]=_[_0x65a1('0x3e')](_0x5dad01['where'],{'$or':_['map'](_0x5dad01[_0x65a1('0x38')],function(_0x522043){var _0x7cb47f={};_0x7cb47f[_0x522043]={'$like':'%'+_0x30d82e['query'][_0x65a1('0x59')]+'%'};return _0x7cb47f;})});}_0x5dad01=_[_0x65a1('0x3e')]({},_0x5dad01,_0x30d82e[_0x65a1('0x40')]);return db[_0x65a1('0x6b')][_0x65a1('0x8b')](_0x5dad01);}})[_0x65a1('0x27')](respondWithResult(_0x437bb9,null))[_0x65a1('0x43')](handleError(_0x437bb9,null));};exports[_0x65a1('0x8c')]=function(_0x50826f,_0x30209c,_0x5f1c06){return db['CmList']['find']({'where':{'id':_0x50826f[_0x65a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x30209c,null))['then'](function(_0x3d5b40){if(_0x3d5b40){return _0x3d5b40[_0x65a1('0x8c')](_0x50826f[_0x65a1('0x4a')][_0x65a1('0x5c')],_[_0x65a1('0x64')](_0x50826f[_0x65a1('0x4a')],[_0x65a1('0x5c'),'id'])||{})['spread'](function(_0x3742e8){for(var _0x53c87d=0x0;_0x53c87d<_0x50826f['body'][_0x65a1('0x5c')][_0x65a1('0x56')];_0x53c87d+=0x1){socket[_0x65a1('0x8d')]('userCmList:save',{'UserId':Number(_0x50826f[_0x65a1('0x4a')]['ids'][_0x53c87d]),'CmListId':Number(_0x50826f[_0x65a1('0x45')]['id'])});}return _0x3742e8;});}})[_0x65a1('0x27')](respondWithResult(_0x30209c,null))['catch'](handleError(_0x30209c,null));};exports[_0x65a1('0x8e')]=function(_0x1fa8b2,_0x87644f,_0x124c03){return db[_0x65a1('0x31')][_0x65a1('0x48')]({'where':{'id':_0x1fa8b2[_0x65a1('0x45')]['id']}})[_0x65a1('0x27')](handleEntityNotFound(_0x87644f,null))[_0x65a1('0x27')](function(_0x117c6a){if(_0x117c6a){return _0x117c6a['removeAgents'](_0x1fa8b2[_0x65a1('0x35')][_0x65a1('0x5c')])['then'](function(){if(_[_0x65a1('0x60')](_0x1fa8b2[_0x65a1('0x35')][_0x65a1('0x5c')])){for(var _0x458133=0x0;_0x458133<_0x1fa8b2[_0x65a1('0x35')][_0x65a1('0x5c')][_0x65a1('0x56')];_0x458133+=0x1){socket[_0x65a1('0x8d')](_0x65a1('0x8f'),{'UserId':Number(_0x1fa8b2['query'][_0x65a1('0x5c')][_0x458133]),'CmListId':Number(_0x1fa8b2[_0x65a1('0x45')]['id'])});}}else{socket[_0x65a1('0x8d')]('userCmList:remove',{'UserId':Number(_0x1fa8b2[_0x65a1('0x35')]['ids']),'CmListId':Number(_0x1fa8b2[_0x65a1('0x45')]['id'])});}});}})[_0x65a1('0x27')](respondWithStatusCode(_0x87644f,null))[_0x65a1('0x43')](handleError(_0x87644f,null));};exports['getAgents']=function(_0x476b94,_0x49a801,_0x52fb7c){var _0x285a99={};var _0x3abdb3={};var _0x2ff1c4;var _0x3e7d2e;return db['CmList'][_0x65a1('0x7e')]({'where':{'id':_0x476b94[_0x65a1('0x45')]['id']}})['then'](handleEntityNotFound(_0x49a801,null))['then'](function(_0x218c64){if(_0x218c64){_0x2ff1c4=_0x218c64;_0x3abdb3[_0x65a1('0x34')]=_['keys'](db[_0x65a1('0x90')]['rawAttributes']);_0x3abdb3[_0x65a1('0x35')]=_[_0x65a1('0x46')](_0x476b94[_0x65a1('0x35')]);_0x3abdb3['filters']=_[_0x65a1('0x37')](_0x3abdb3[_0x65a1('0x34')],_0x3abdb3['query']);_0x285a99[_0x65a1('0x38')]=_['intersection'](_0x3abdb3[_0x65a1('0x34')],qs[_0x65a1('0x39')](_0x476b94[_0x65a1('0x35')][_0x65a1('0x39')]));_0x285a99[_0x65a1('0x38')]=_0x285a99[_0x65a1('0x38')][_0x65a1('0x56')]?_0x285a99[_0x65a1('0x38')]:_0x3abdb3[_0x65a1('0x34')];_0x285a99[_0x65a1('0x3b')]=qs[_0x65a1('0x3c')](_0x476b94[_0x65a1('0x35')][_0x65a1('0x3c')]);_0x285a99['where']=qs[_0x65a1('0x36')](_[_0x65a1('0x58')](_0x476b94[_0x65a1('0x35')],_0x3abdb3['filters']));if(_0x476b94[_0x65a1('0x35')][_0x65a1('0x59')]){_0x285a99[_0x65a1('0x3d')]=_[_0x65a1('0x3e')](_0x285a99[_0x65a1('0x3d')],{'$or':_[_0x65a1('0x30')](_0x285a99[_0x65a1('0x38')],function(_0xf109c0){var _0x2ce108={};_0x2ce108[_0xf109c0]={'$like':'%'+_0x476b94[_0x65a1('0x35')]['filter']+'%'};return _0x2ce108;})});}_0x285a99=_[_0x65a1('0x3e')]({},_0x285a99,_0x476b94[_0x65a1('0x40')]);return _0x2ff1c4[_0x65a1('0x91')](_0x285a99);}})[_0x65a1('0x27')](function(_0x39925d){if(_0x39925d){_0x3e7d2e=_0x39925d['length'];if(!_0x476b94[_0x65a1('0x35')]['hasOwnProperty'](_0x65a1('0x3a'))){_0x285a99[_0x65a1('0x20')]=qs[_0x65a1('0x20')](_0x476b94['query'][_0x65a1('0x20')]);_0x285a99[_0x65a1('0x1d')]=qs[_0x65a1('0x1d')](_0x476b94['query'][_0x65a1('0x1d')]);}return _0x2ff1c4[_0x65a1('0x91')](_0x285a99);}})[_0x65a1('0x27')](function(_0x30c830){if(_0x30c830){return _0x30c830?{'count':_0x3e7d2e,'rows':_0x30c830}:null;}})['then'](respondWithResult(_0x49a801,null))[_0x65a1('0x43')](handleError(_0x49a801,null));}; \ No newline at end of file +var _0x50ea=['sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','Lists','UserProfileResource','error','stack','name','send','map','CmList','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','tags','isArray','join','push','each','CmContact','omit','success','message','getContacts','CmCustomField','CustomFields','concat','cf_%d','getContactsCsv','isEmpty','now','writeFileSync','format','setHeader','text/csv','download','/tmp/list_%d_%s.csv','addCustomField'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x50ea,0x1ca));var _0xa50e=function(_0x5ea48d,_0xcf315e){_0x5ea48d=_0x5ea48d-0x0;var _0x43a6ae=_0x50ea[_0x5ea48d];return _0x43a6ae;};'use strict';var emlformat=require(_0xa50e('0x0'));var rimraf=require(_0xa50e('0x1'));var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa50e('0x8'));var csv=require(_0xa50e('0x9'));var ejs=require(_0xa50e('0xa'));var fs=require('fs');var fs_extra=require(_0xa50e('0xb'));var _=require(_0xa50e('0xc'));var squel=require(_0xa50e('0xd'));var crypto=require(_0xa50e('0xe'));var jsforce=require(_0xa50e('0xf'));var deskjs=require(_0xa50e('0x10'));var toCsv=require(_0xa50e('0x9'));var querystring=require(_0xa50e('0x11'));var Papa=require(_0xa50e('0x12'));var Redis=require(_0xa50e('0x13'));var authService=require(_0xa50e('0x14'));var qs=require(_0xa50e('0x15'));var as=require(_0xa50e('0x16'));var hardwareService=require(_0xa50e('0x17'));var logger=require(_0xa50e('0x18'))(_0xa50e('0x19'));var utils=require(_0xa50e('0x1a'));var config=require(_0xa50e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa50e('0x1c'))['db'];config[_0xa50e('0x1d')]=_[_0xa50e('0x1e')](config[_0xa50e('0x1d')],{'host':_0xa50e('0x1f'),'port':0x18eb});var socket=require(_0xa50e('0x20'))(new Redis(config['redis']));require(_0xa50e('0x21'))['register'](socket);function respondWithStatusCode(_0x11e8d,_0x562456){_0x562456=_0x562456||0xcc;return function(_0x2a9836){if(_0x2a9836){return _0x11e8d[_0xa50e('0x22')](_0x562456);}return _0x11e8d['status'](_0x562456)[_0xa50e('0x23')]();};}function respondWithResult(_0x3627cc,_0x1a1323){_0x1a1323=_0x1a1323||0xc8;return function(_0x4858c6){if(_0x4858c6){return _0x3627cc['status'](_0x1a1323)['json'](_0x4858c6);}};}function respondWithFilteredResult(_0x35edc4,_0x2648e6){return function(_0x48a610){if(_0x48a610){var _0x58587f=typeof _0x2648e6[_0xa50e('0x24')]===_0xa50e('0x25')&&typeof _0x2648e6[_0xa50e('0x26')]==='undefined';var _0x343174=_0x48a610['count'];var _0x4a52c7=_0x58587f?0x0:_0x2648e6[_0xa50e('0x24')];var _0x37a509=_0x58587f?_0x48a610[_0xa50e('0x27')]:_0x2648e6['offset']+_0x2648e6[_0xa50e('0x26')];var _0x5b4d66;if(_0x37a509>=_0x343174){_0x37a509=_0x343174;_0x5b4d66=0xc8;}else{_0x5b4d66=0xce;}_0x35edc4[_0xa50e('0x28')](_0x5b4d66);return _0x35edc4[_0xa50e('0x29')](_0xa50e('0x2a'),_0x4a52c7+'-'+_0x37a509+'/'+_0x343174)[_0xa50e('0x2b')](_0x48a610);}return null;};}function patchUpdates(_0x3ecfa7){return function(_0x53bd3d){try{jsonpatch[_0xa50e('0x2c')](_0x53bd3d,_0x3ecfa7,!![]);}catch(_0xff0918){return BPromise[_0xa50e('0x2d')](_0xff0918);}return _0x53bd3d[_0xa50e('0x2e')]();};}function saveUpdates(_0xbb3cc3,_0x2e82c7){return function(_0x4ee9c0){if(_0x4ee9c0){return _0x4ee9c0['update'](_0xbb3cc3)[_0xa50e('0x2f')](function(_0x2cc0ac){return _0x2cc0ac;});}return null;};}function removeEntity(_0xbb3463,_0xbde460){return function(_0x4c7606){if(_0x4c7606){return _0x4c7606[_0xa50e('0x30')]()['then'](function(){var _0x1b10a2=_0x4c7606['get']({'plain':!![]});var _0x15304a=_0xa50e('0x31');return db[_0xa50e('0x32')]['destroy']({'where':{'type':_0x15304a,'resourceId':_0x1b10a2['id']}})[_0xa50e('0x2f')](function(){return _0x4c7606;});})['then'](function(){_0xbb3463[_0xa50e('0x28')](0xcc)[_0xa50e('0x23')]();});}};}function handleEntityNotFound(_0x48a530,_0x419253){return function(_0x121682){if(!_0x121682){_0x48a530['sendStatus'](0x194);}return _0x121682;};}function handleError(_0x5f2db3,_0x322191){_0x322191=_0x322191||0x1f4;return function(_0xc8cb1a){logger[_0xa50e('0x33')](_0xc8cb1a[_0xa50e('0x34')]);if(_0xc8cb1a[_0xa50e('0x35')]){delete _0xc8cb1a[_0xa50e('0x35')];}_0x5f2db3['status'](_0x322191)[_0xa50e('0x36')](_0xc8cb1a);};}exports['index']=function(_0x53901a,_0x2bd4db){var _0x1db1a7={},_0x54901b={},_0x2719df={'count':0x0,'rows':[]};var _0x25b328=_[_0xa50e('0x37')](db[_0xa50e('0x38')][_0xa50e('0x39')],function(_0x4b1265){return{'name':_0x4b1265['fieldName'],'type':_0x4b1265[_0xa50e('0x3a')][_0xa50e('0x3b')]};});_0x54901b['model']=_['map'](_0x25b328,_0xa50e('0x35'));_0x54901b[_0xa50e('0x3c')]=_[_0xa50e('0x3d')](_0x53901a[_0xa50e('0x3c')]);_0x54901b[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x54901b[_0xa50e('0x40')],_0x54901b[_0xa50e('0x3c')]);_0x1db1a7[_0xa50e('0x41')]=_[_0xa50e('0x3f')](_0x54901b[_0xa50e('0x40')],qs[_0xa50e('0x42')](_0x53901a[_0xa50e('0x3c')]['fields']));_0x1db1a7['attributes']=_0x1db1a7[_0xa50e('0x41')][_0xa50e('0x43')]?_0x1db1a7[_0xa50e('0x41')]:_0x54901b['model'];if(!_0x53901a[_0xa50e('0x3c')][_0xa50e('0x44')]('nolimit')){_0x1db1a7[_0xa50e('0x26')]=qs['limit'](_0x53901a['query'][_0xa50e('0x26')]);_0x1db1a7['offset']=qs[_0xa50e('0x24')](_0x53901a[_0xa50e('0x3c')][_0xa50e('0x24')]);}_0x1db1a7[_0xa50e('0x45')]=qs[_0xa50e('0x46')](_0x53901a['query'][_0xa50e('0x46')]);_0x1db1a7[_0xa50e('0x47')]=qs['filters'](_[_0xa50e('0x48')](_0x53901a[_0xa50e('0x3c')],_0x54901b[_0xa50e('0x3e')]),_0x25b328);if(_0x53901a['query'][_0xa50e('0x49')]){_0x1db1a7[_0xa50e('0x47')]=_[_0xa50e('0x4a')](_0x1db1a7['where'],{'$or':_['map'](_0x25b328,function(_0x994991){if(_0x994991['type']!=='VIRTUAL'){var _0x5746e5={};_0x5746e5[_0x994991[_0xa50e('0x35')]]={'$like':'%'+_0x53901a[_0xa50e('0x3c')][_0xa50e('0x49')]+'%'};return _0x5746e5;}})});}_0x1db1a7=_[_0xa50e('0x4a')]({},_0x1db1a7,_0x53901a[_0xa50e('0x4b')]);var _0x51dcdd={'where':_0x1db1a7[_0xa50e('0x47')]};return db[_0xa50e('0x38')][_0xa50e('0x27')](_0x51dcdd)[_0xa50e('0x2f')](function(_0x69713a){_0x2719df[_0xa50e('0x27')]=_0x69713a;if(_0x53901a['query'][_0xa50e('0x4c')]){_0x1db1a7['include']=[{'all':!![]}];}return db[_0xa50e('0x38')][_0xa50e('0x4d')](_0x1db1a7);})['then'](function(_0x1d518e){_0x2719df[_0xa50e('0x4e')]=_0x1d518e;return _0x2719df;})[_0xa50e('0x2f')](respondWithFilteredResult(_0x2bd4db,_0x1db1a7))[_0xa50e('0x4f')](handleError(_0x2bd4db,null));};exports['show']=function(_0xf50b60,_0x3b2ae7){var _0x33f811={'raw':![],'where':{'id':_0xf50b60[_0xa50e('0x50')]['id']}},_0x1244ba={};_0x1244ba['model']=_[_0xa50e('0x3d')](db[_0xa50e('0x38')][_0xa50e('0x39')]);_0x1244ba[_0xa50e('0x3c')]=_[_0xa50e('0x3d')](_0xf50b60[_0xa50e('0x3c')]);_0x1244ba[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x1244ba['model'],_0x1244ba[_0xa50e('0x3c')]);_0x33f811[_0xa50e('0x41')]=_[_0xa50e('0x3f')](_0x1244ba[_0xa50e('0x40')],qs[_0xa50e('0x42')](_0xf50b60[_0xa50e('0x3c')][_0xa50e('0x42')]));_0x33f811[_0xa50e('0x41')]=_0x33f811[_0xa50e('0x41')][_0xa50e('0x43')]?_0x33f811[_0xa50e('0x41')]:_0x1244ba[_0xa50e('0x40')];if(_0xf50b60[_0xa50e('0x3c')][_0xa50e('0x4c')]){_0x33f811[_0xa50e('0x51')]=[{'all':!![]}];}_0x33f811=_['merge']({},_0x33f811,_0xf50b60[_0xa50e('0x4b')]);return db[_0xa50e('0x38')][_0xa50e('0x52')](_0x33f811)[_0xa50e('0x2f')](handleEntityNotFound(_0x3b2ae7,null))[_0xa50e('0x2f')](respondWithResult(_0x3b2ae7,null))[_0xa50e('0x4f')](handleError(_0x3b2ae7,null));};exports[_0xa50e('0x53')]=function(_0x189b54,_0x556438){return db[_0xa50e('0x38')][_0xa50e('0x53')](_0x189b54[_0xa50e('0x54')],{})[_0xa50e('0x2f')](function(_0x2a9817){var _0x6112d4=_0x189b54[_0xa50e('0x55')][_0xa50e('0x56')]({'plain':!![]});if(!_0x6112d4)throw new Error(_0xa50e('0x57'));if(_0x6112d4['role']===_0xa50e('0x55')){var _0x29192a=_0x2a9817[_0xa50e('0x56')]({'plain':!![]});var _0x239db0='Lists';return db[_0xa50e('0x58')][_0xa50e('0x52')]({'where':{'name':_0x239db0,'userProfileId':_0x6112d4[_0xa50e('0x59')]},'raw':!![]})['then'](function(_0x31a089){if(_0x31a089&&_0x31a089[_0xa50e('0x5a')]===0x0){return db[_0xa50e('0x32')][_0xa50e('0x53')]({'name':_0x29192a['name'],'resourceId':_0x29192a['id'],'type':_0x31a089['name'],'sectionId':_0x31a089['id']},{})[_0xa50e('0x2f')](function(){return _0x2a9817;});}else{return _0x2a9817;}})[_0xa50e('0x4f')](function(_0x20ac48){logger[_0xa50e('0x33')](_0xa50e('0x5b'),_0x20ac48);throw _0x20ac48;});}return _0x2a9817;})['then'](respondWithResult(_0x556438,0xc9))[_0xa50e('0x4f')](handleError(_0x556438,null));};exports[_0xa50e('0x5c')]=function(_0x2102cf,_0x1d1dda){if(_0x2102cf[_0xa50e('0x54')]['id']){delete _0x2102cf[_0xa50e('0x54')]['id'];}return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x2102cf[_0xa50e('0x50')]['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x1d1dda,null))[_0xa50e('0x2f')](saveUpdates(_0x2102cf[_0xa50e('0x54')],null))[_0xa50e('0x2f')](respondWithResult(_0x1d1dda,null))['catch'](handleError(_0x1d1dda,null));};exports[_0xa50e('0x30')]=function(_0x218760,_0x35d616){return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x218760[_0xa50e('0x50')]['id']}})['then'](handleEntityNotFound(_0x35d616,null))[_0xa50e('0x2f')](removeEntity(_0x35d616,null))[_0xa50e('0x4f')](handleError(_0x35d616,null));};exports[_0xa50e('0x5d')]=function(_0x2670b9,_0x55b684){return db[_0xa50e('0x38')]['describe']()['then'](respondWithResult(_0x55b684,null))[_0xa50e('0x4f')](handleError(_0x55b684,null));};exports[_0xa50e('0x5e')]=function(_0x3fa428,_0x3f6bf0,_0x5801c0){if(_0x3fa428[_0xa50e('0x54')]['id']){delete _0x3fa428[_0xa50e('0x54')]['id'];}return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x3fa428[_0xa50e('0x50')]['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x3f6bf0,null))[_0xa50e('0x2f')](function(_0x49c0f4){if(_0x49c0f4){_0x3fa428[_0xa50e('0x54')][_0xa50e('0x5f')]=_0x49c0f4['id'];return db[_0xa50e('0x60')][_0xa50e('0x53')](_0x3fa428[_0xa50e('0x54')]);}})[_0xa50e('0x2f')](respondWithResult(_0x3f6bf0,null))[_0xa50e('0x4f')](handleError(_0x3f6bf0,null));};exports[_0xa50e('0x61')]=function(_0x5dc238,_0x400bee,_0x1f52f1){var _0x524f5b={'raw':![],'where':{}};var _0x96689b={};var _0x243105={'count':0x0,'rows':[]};return db[_0xa50e('0x38')][_0xa50e('0x62')]({'where':{'id':_0x5dc238[_0xa50e('0x50')]['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x400bee,null))[_0xa50e('0x2f')](function(_0x4b294a){if(_0x4b294a){_0x96689b[_0xa50e('0x40')]=_[_0xa50e('0x3d')](db[_0xa50e('0x60')][_0xa50e('0x39')]);_0x96689b[_0xa50e('0x3c')]=_[_0xa50e('0x3d')](_0x5dc238[_0xa50e('0x3c')]);_0x96689b['filters']=_[_0xa50e('0x3f')](_0x96689b[_0xa50e('0x40')],_0x96689b[_0xa50e('0x3c')]);_0x524f5b['attributes']=_[_0xa50e('0x3f')](_0x96689b[_0xa50e('0x40')],qs[_0xa50e('0x42')](_0x5dc238[_0xa50e('0x3c')]['fields']));_0x524f5b['attributes']=_0x524f5b[_0xa50e('0x41')][_0xa50e('0x43')]?_0x524f5b['attributes']:_0x96689b[_0xa50e('0x40')];if(!_0x5dc238[_0xa50e('0x3c')][_0xa50e('0x44')](_0xa50e('0x63'))){_0x524f5b[_0xa50e('0x26')]=qs[_0xa50e('0x26')](_0x5dc238[_0xa50e('0x3c')][_0xa50e('0x26')]);_0x524f5b[_0xa50e('0x24')]=qs[_0xa50e('0x24')](_0x5dc238['query'][_0xa50e('0x24')]);}_0x524f5b[_0xa50e('0x45')]=qs[_0xa50e('0x46')](_0x5dc238[_0xa50e('0x3c')][_0xa50e('0x46')]);_0x524f5b[_0xa50e('0x47')]=qs[_0xa50e('0x3e')](_['pick'](_0x5dc238[_0xa50e('0x3c')],_0x96689b[_0xa50e('0x3e')]));_0x524f5b[_0xa50e('0x47')][_0xa50e('0x5f')]=_0x4b294a['id'];if(_0x5dc238[_0xa50e('0x3c')][_0xa50e('0x49')]){_0x524f5b[_0xa50e('0x47')]=_[_0xa50e('0x4a')](_0x524f5b[_0xa50e('0x47')],{'$or':_[_0xa50e('0x37')](_0x524f5b['attributes'],function(_0x25af05){var _0x5867ee={};_0x5867ee[_0x25af05]={'$like':'%'+_0x5dc238[_0xa50e('0x3c')][_0xa50e('0x49')]+'%'};return _0x5867ee;})});}_0x524f5b=_[_0xa50e('0x4a')]({},_0x524f5b,_0x5dc238[_0xa50e('0x4b')]);return db[_0xa50e('0x60')][_0xa50e('0x27')]({'where':_0x524f5b['where']})[_0xa50e('0x2f')](function(_0x281eab){_0x243105[_0xa50e('0x27')]=_0x281eab;if(_0x5dc238['query'][_0xa50e('0x4c')]){_0x524f5b['include']=[{'all':!![]}];}return db[_0xa50e('0x60')][_0xa50e('0x4d')](_0x524f5b);})[_0xa50e('0x2f')](function(_0x3e1090){_0x243105['rows']=_0x3e1090;return _0x243105;});}})[_0xa50e('0x2f')](respondWithFilteredResult(_0x400bee,_0x524f5b))[_0xa50e('0x4f')](handleError(_0x400bee,null));};exports['removeDispositions']=function(_0x57ebf2,_0x24f1af,_0x2c939b){return db[_0xa50e('0x38')]['find']({'where':{'id':_0x57ebf2[_0xa50e('0x50')]['id']}})['then'](handleEntityNotFound(_0x24f1af,null))[_0xa50e('0x2f')](function(_0x98ad34){if(_0x98ad34){return _0x98ad34[_0xa50e('0x64')](_0x57ebf2[_0xa50e('0x3c')][_0xa50e('0x65')]);}})['then'](respondWithStatusCode(_0x24f1af,null))[_0xa50e('0x4f')](handleError(_0x24f1af,null));};exports['addContacts']=function(_0x34f7c9,_0x5a78e4,_0x5cc5a9){return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x34f7c9[_0xa50e('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a78e4,null))[_0xa50e('0x2f')](function(_0xe910b){if(_0xe910b){var _0x244927=[];var _0x1ad4c0={'success':[],'errors':[]};return db['CmContact'][_0xa50e('0x5d')]()[_0xa50e('0x2f')](function(_0x3c1971){if(_0x34f7c9[_0xa50e('0x54')][_0xa50e('0x66')]&&_[_0xa50e('0x67')](_0x34f7c9['body'][_0xa50e('0x66')])){if(_0x34f7c9[_0xa50e('0x54')][_0xa50e('0x66')][_0xa50e('0x43')]){_0x34f7c9[_0xa50e('0x54')][_0xa50e('0x66')]=_0x34f7c9['body'][_0xa50e('0x66')][_0xa50e('0x68')](';')+';';}else{_0x34f7c9['body'][_0xa50e('0x66')]=null;}}else{_0x34f7c9['body'][_0xa50e('0x66')]=null;}if(_0x34f7c9[_0xa50e('0x54')]&&_[_0xa50e('0x67')](_0x34f7c9[_0xa50e('0x54')])){for(var _0x2396a2=0x0;_0x2396a2<_0x34f7c9['body'][_0xa50e('0x43')];_0x2396a2+=0x1){_0x34f7c9['body'][_0x2396a2][_0xa50e('0x5f')]=_0x34f7c9['params']['id'];_0x244927[_0xa50e('0x69')](_0x34f7c9[_0xa50e('0x54')][_0x2396a2]);}return BPromise[_0xa50e('0x6a')](_0x244927,function(_0x1fae72){return db[_0xa50e('0x6b')][_0xa50e('0x53')](_[_0xa50e('0x6c')](_0x1fae72,['ids','id'])||{},{'fields':_[_0xa50e('0x3d')](_0x3c1971),'raw':!![]})[_0xa50e('0x2f')](function(_0x213ef8){_0x1ad4c0[_0xa50e('0x6d')][_0xa50e('0x69')](_0x213ef8['dataValues']);})[_0xa50e('0x4f')](function(_0x2ef82){_0x1ad4c0['errors'][_0xa50e('0x69')]({'data':_0x1fae72,'error':_0x2ef82[_0xa50e('0x6e')]});});})['then'](function(_0x21a6ad){return _0x1ad4c0;})[_0xa50e('0x4f')](function(_0x5c0f83){return _0x5c0f83;});}else{_0x5a78e4[_0xa50e('0x28')](0x190)[_0xa50e('0x2b')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa50e('0x2f')](respondWithResult(_0x5a78e4,null))[_0xa50e('0x4f')](handleError(_0x5a78e4,null));};exports[_0xa50e('0x6f')]=function(_0x21b771,_0x1a2030,_0x50f8c3){var _0xd49fe8;return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x21b771['params']['id']},'include':[{'model':db[_0xa50e('0x70')],'as':_0xa50e('0x71')}]})[_0xa50e('0x2f')](handleEntityNotFound(_0x1a2030,null))['then'](function(_0x3c521f){if(_0x3c521f){_0xd49fe8=_0x3c521f;return db[_0xa50e('0x6b')][_0xa50e('0x39')];}})[_0xa50e('0x2f')](function(_0x5433bb){if(_0x5433bb){var _0x46aef0={};var _0x452c78={};_0x452c78[_0xa50e('0x40')]=_[_0xa50e('0x72')](_['keys'](_0x5433bb),_[_0xa50e('0x37')](_0xd49fe8['CustomFields'],function(_0x2344ad){return util['format'](_0xa50e('0x73'),_0x2344ad['id']);}));_0x452c78['query']=_[_0xa50e('0x3d')](_0x21b771['query']);_0x452c78[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x452c78[_0xa50e('0x40')],_0x452c78[_0xa50e('0x3c')]);_0x46aef0[_0xa50e('0x41')]=_[_0xa50e('0x3f')](_0x452c78[_0xa50e('0x40')],qs[_0xa50e('0x42')](_0x21b771[_0xa50e('0x3c')][_0xa50e('0x42')]));_0x46aef0[_0xa50e('0x41')]=_0x46aef0[_0xa50e('0x41')][_0xa50e('0x43')]?_0x46aef0['attributes']:_0x452c78[_0xa50e('0x40')];if(!_0x21b771[_0xa50e('0x3c')][_0xa50e('0x44')](_0xa50e('0x63'))){_0x46aef0[_0xa50e('0x26')]=qs[_0xa50e('0x26')](_0x21b771[_0xa50e('0x3c')][_0xa50e('0x26')]);_0x46aef0['offset']=qs['offset'](_0x21b771['query']['offset']);}_0x46aef0['order']=qs[_0xa50e('0x46')](_0x21b771[_0xa50e('0x3c')][_0xa50e('0x46')]);_0x46aef0[_0xa50e('0x47')]=qs[_0xa50e('0x3e')](_[_0xa50e('0x48')](_0x21b771[_0xa50e('0x3c')],_0x452c78[_0xa50e('0x3e')]));_0x46aef0['raw']=!![];if(_0x21b771[_0xa50e('0x3c')][_0xa50e('0x49')]){_0x46aef0['where']=_[_0xa50e('0x4a')](_0x46aef0[_0xa50e('0x47')],{'$or':_[_0xa50e('0x37')](_0x46aef0[_0xa50e('0x41')],function(_0x3f30eb){var _0x4e36e3={};_0x4e36e3[_0x3f30eb]={'$like':'%'+_0x21b771['query'][_0xa50e('0x49')]+'%'};return _0x4e36e3;})});}_0x46aef0=_[_0xa50e('0x4a')]({},_0x46aef0,_0x21b771['options']);return _0xd49fe8[_0xa50e('0x6f')](_0x46aef0);}})[_0xa50e('0x2f')](respondWithResult(_0x1a2030,null))[_0xa50e('0x4f')](handleError(_0x1a2030,null));};exports[_0xa50e('0x74')]=function(_0x5a474c,_0x21e89f,_0xbe1087){var _0xf296a4;return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x5a474c[_0xa50e('0x50')]['id']},'include':[{'model':db[_0xa50e('0x70')],'as':_0xa50e('0x71')}]})[_0xa50e('0x2f')](handleEntityNotFound(_0x21e89f,null))[_0xa50e('0x2f')](function(_0x175b02){if(_0x175b02){_0xf296a4=_0x175b02;return db[_0xa50e('0x6b')][_0xa50e('0x39')];}})[_0xa50e('0x2f')](function(_0x3d454d){if(_0x3d454d){var _0x246f94={};var _0x41d651={};_0x41d651[_0xa50e('0x40')]=_[_0xa50e('0x72')](_[_0xa50e('0x3d')](_0x3d454d),_['map'](_0xf296a4[_0xa50e('0x71')],function(_0x294154){return util['format'](_0xa50e('0x73'),_0x294154['id']);}));_0x41d651[_0xa50e('0x3c')]=_[_0xa50e('0x3d')](_0x5a474c['query']);_0x41d651[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x41d651[_0xa50e('0x40')],_0x41d651[_0xa50e('0x3c')]);_0x246f94['attributes']=_['intersection'](_0x41d651['model'],qs[_0xa50e('0x42')](_0x5a474c[_0xa50e('0x3c')][_0xa50e('0x42')]));_0x246f94[_0xa50e('0x41')]=_0x246f94['attributes'][_0xa50e('0x43')]?_0x246f94[_0xa50e('0x41')]:_0x41d651[_0xa50e('0x40')];if(!_0x5a474c[_0xa50e('0x3c')][_0xa50e('0x44')]('nolimit')){_0x246f94[_0xa50e('0x26')]=qs[_0xa50e('0x26')](_0x5a474c['query']['limit']);_0x246f94[_0xa50e('0x24')]=qs[_0xa50e('0x24')](_0x5a474c[_0xa50e('0x3c')][_0xa50e('0x24')]);}_0x246f94['order']=qs[_0xa50e('0x46')](_0x5a474c[_0xa50e('0x3c')][_0xa50e('0x46')]);_0x246f94[_0xa50e('0x47')]=qs[_0xa50e('0x3e')](_[_0xa50e('0x48')](_0x5a474c[_0xa50e('0x3c')],_0x41d651[_0xa50e('0x3e')]));_0x246f94['raw']=!![];if(_0x5a474c[_0xa50e('0x3c')][_0xa50e('0x49')]){_0x246f94['where']=_['merge'](_0x246f94[_0xa50e('0x47')],{'$or':_[_0xa50e('0x37')](_0x246f94['attributes'],function(_0x287e44){var _0x466f86={};_0x466f86[_0x287e44]={'$like':'%'+_0x5a474c[_0xa50e('0x3c')]['filter']+'%'};return _0x466f86;})});}_0x246f94=_['merge']({},_0x246f94,_0x5a474c[_0xa50e('0x4b')]);return _0xf296a4[_0xa50e('0x6f')](_0x246f94);}})[_0xa50e('0x2f')](function(_0xfed86a){if(!_[_0xa50e('0x75')](_0xfed86a)){var _0x40409d=toCsv(_0xfed86a);var _0x1775e1=Date[_0xa50e('0x76')]();fs[_0xa50e('0x77')](util[_0xa50e('0x78')]('/tmp/list_%d_%s.csv',_0xf296a4['id'],_0x1775e1),_0x40409d);_0x21e89f[_0xa50e('0x79')]('Content-disposition','attachment;\x20filename='+util[_0xa50e('0x78')]('list_%d_%s.csv',_0xf296a4['id'],_0x1775e1));_0x21e89f[_0xa50e('0x79')]('Content-type',_0xa50e('0x7a'));return _0x21e89f[_0xa50e('0x7b')](util[_0xa50e('0x78')](_0xa50e('0x7c'),_0xf296a4['id'],_0x1775e1));}else{return _0x21e89f['sendStatus'](0xcc);}})[_0xa50e('0x4f')](handleError(_0x21e89f,null));};exports[_0xa50e('0x7d')]=function(_0x28d73e,_0x3645da,_0x113196){var _0x4eb450;delete _0x28d73e[_0xa50e('0x54')]['id'];return db[_0xa50e('0x38')][_0xa50e('0x62')]({'where':{'id':_0x28d73e['params']['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x3645da,null))['then'](function(_0x40a3b8){if(_0x40a3b8){return db[_0xa50e('0x7e')][_0xa50e('0x7f')](function(_0x2f9ac8){return db[_0xa50e('0x70')]['create'](_0x28d73e['body'],{'transaction':_0x2f9ac8})[_0xa50e('0x2f')](function(_0x9ebd7e){_0x4eb450=_0x9ebd7e;return _0x40a3b8['addCustomFields'](_0x9ebd7e,{'transaction':_0x2f9ac8});})['then'](function(){var _0x1409ee={'type':db[_0xa50e('0x80')][_0xa50e('0x81')],'transaction':_0x2f9ac8};switch(_0x28d73e[_0xa50e('0x54')]['type']){case _0xa50e('0x82'):_0x1409ee['type']=db[_0xa50e('0x80')][_0xa50e('0x81')];break;case _0xa50e('0x83'):_0x1409ee[_0xa50e('0x3a')]=db[_0xa50e('0x80')][_0xa50e('0x84')];break;case'switch':_0x1409ee[_0xa50e('0x3a')]=db['Sequelize'][_0xa50e('0x85')];_0x1409ee['defaultValue']=![];break;default:}return db[_0xa50e('0x7e')][_0xa50e('0x86')]['addColumn'](_0xa50e('0x87'),util[_0xa50e('0x78')](_0xa50e('0x88'),_0x4eb450['id']),_0x1409ee);})[_0xa50e('0x2f')](function(){return _0x4eb450;});});}})['then'](respondWithResult(_0x3645da,null))['catch'](handleError(_0x3645da,null));};exports[_0xa50e('0x89')]=function(_0x296831,_0x5a5365,_0x5296a6){var _0x471e57={};var _0x386fa3={};var _0x2efccc;var _0x185d2f;return db[_0xa50e('0x38')][_0xa50e('0x62')]({'where':{'id':_0x296831[_0xa50e('0x50')]['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x5a5365,null))[_0xa50e('0x2f')](function(_0x2dc03a){if(_0x2dc03a){_0x2efccc=_0x2dc03a;_0x386fa3['model']=_[_0xa50e('0x3d')](db[_0xa50e('0x70')][_0xa50e('0x39')]);_0x386fa3[_0xa50e('0x3c')]=_[_0xa50e('0x3d')](_0x296831[_0xa50e('0x3c')]);_0x386fa3[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x386fa3['model'],_0x386fa3[_0xa50e('0x3c')]);_0x471e57['attributes']=_[_0xa50e('0x3f')](_0x386fa3[_0xa50e('0x40')],qs[_0xa50e('0x42')](_0x296831[_0xa50e('0x3c')][_0xa50e('0x42')]));_0x471e57[_0xa50e('0x41')]=_0x471e57[_0xa50e('0x41')]['length']?_0x471e57[_0xa50e('0x41')]:_0x386fa3[_0xa50e('0x40')];_0x471e57[_0xa50e('0x45')]=qs[_0xa50e('0x46')](_0x296831[_0xa50e('0x3c')][_0xa50e('0x46')]);_0x471e57['where']=qs[_0xa50e('0x3e')](_[_0xa50e('0x48')](_0x296831['query'],_0x386fa3[_0xa50e('0x3e')]));_0x471e57[_0xa50e('0x47')]=_[_0xa50e('0x4a')](_0x471e57[_0xa50e('0x47')],{'$or':[{'ListId':_0x2dc03a['id']},{'ListId':null}]});if(_0x296831[_0xa50e('0x3c')][_0xa50e('0x49')]){_0x471e57[_0xa50e('0x47')]=_['merge'](_0x471e57[_0xa50e('0x47')],{'$or':_[_0xa50e('0x37')](_0x471e57[_0xa50e('0x41')],function(_0x7a45c3){var _0x2a3144={};_0x2a3144[_0x7a45c3]={'$like':'%'+_0x296831['query'][_0xa50e('0x49')]+'%'};return _0x2a3144;})});}_0x471e57=_[_0xa50e('0x4a')]({},_0x471e57,_0x296831[_0xa50e('0x4b')]);return db[_0xa50e('0x70')][_0xa50e('0x8a')](_0x471e57);}})[_0xa50e('0x2f')](respondWithResult(_0x5a5365,null))[_0xa50e('0x4f')](handleError(_0x5a5365,null));};exports[_0xa50e('0x8b')]=function(_0x22dd7c,_0x3062fc,_0x5a7fa5){return db[_0xa50e('0x38')][_0xa50e('0x52')]({'where':{'id':_0x22dd7c[_0xa50e('0x50')]['id']}})['then'](handleEntityNotFound(_0x3062fc,null))['then'](function(_0x426d80){if(_0x426d80){return _0x426d80[_0xa50e('0x8b')](_0x22dd7c[_0xa50e('0x54')][_0xa50e('0x65')],_[_0xa50e('0x6c')](_0x22dd7c['body'],['ids','id'])||{})[_0xa50e('0x8c')](function(_0x35a6c5){for(var _0x161280=0x0;_0x161280<_0x22dd7c[_0xa50e('0x54')][_0xa50e('0x65')][_0xa50e('0x43')];_0x161280+=0x1){socket[_0xa50e('0x8d')]('userCmList:save',{'UserId':Number(_0x22dd7c[_0xa50e('0x54')][_0xa50e('0x65')][_0x161280]),'CmListId':Number(_0x22dd7c['params']['id'])});}return _0x35a6c5;});}})[_0xa50e('0x2f')](respondWithResult(_0x3062fc,null))['catch'](handleError(_0x3062fc,null));};exports[_0xa50e('0x8e')]=function(_0x1e1fab,_0x371da3,_0x3ee623){return db[_0xa50e('0x38')]['find']({'where':{'id':_0x1e1fab['params']['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0x371da3,null))[_0xa50e('0x2f')](function(_0xeae287){if(_0xeae287){return _0xeae287[_0xa50e('0x8e')](_0x1e1fab['query'][_0xa50e('0x65')])[_0xa50e('0x2f')](function(){if(_[_0xa50e('0x67')](_0x1e1fab[_0xa50e('0x3c')][_0xa50e('0x65')])){for(var _0x1370f5=0x0;_0x1370f5<_0x1e1fab[_0xa50e('0x3c')]['ids'][_0xa50e('0x43')];_0x1370f5+=0x1){socket[_0xa50e('0x8d')]('userCmList:remove',{'UserId':Number(_0x1e1fab[_0xa50e('0x3c')][_0xa50e('0x65')][_0x1370f5]),'CmListId':Number(_0x1e1fab[_0xa50e('0x50')]['id'])});}}else{socket[_0xa50e('0x8d')](_0xa50e('0x8f'),{'UserId':Number(_0x1e1fab[_0xa50e('0x3c')][_0xa50e('0x65')]),'CmListId':Number(_0x1e1fab['params']['id'])});}});}})[_0xa50e('0x2f')](respondWithStatusCode(_0x371da3,null))[_0xa50e('0x4f')](handleError(_0x371da3,null));};exports[_0xa50e('0x90')]=function(_0x52e4cb,_0xbd9ab8,_0x1f99d9){var _0x23df8b={};var _0x3c5ecf={};var _0x27359f;var _0xc3f96a;return db[_0xa50e('0x38')][_0xa50e('0x62')]({'where':{'id':_0x52e4cb['params']['id']}})[_0xa50e('0x2f')](handleEntityNotFound(_0xbd9ab8,null))['then'](function(_0x297665){if(_0x297665){_0x27359f=_0x297665;_0x3c5ecf[_0xa50e('0x40')]=_['keys'](db[_0xa50e('0x91')][_0xa50e('0x39')]);_0x3c5ecf['query']=_[_0xa50e('0x3d')](_0x52e4cb[_0xa50e('0x3c')]);_0x3c5ecf[_0xa50e('0x3e')]=_[_0xa50e('0x3f')](_0x3c5ecf[_0xa50e('0x40')],_0x3c5ecf[_0xa50e('0x3c')]);_0x23df8b[_0xa50e('0x41')]=_[_0xa50e('0x3f')](_0x3c5ecf[_0xa50e('0x40')],qs['fields'](_0x52e4cb[_0xa50e('0x3c')]['fields']));_0x23df8b['attributes']=_0x23df8b[_0xa50e('0x41')][_0xa50e('0x43')]?_0x23df8b[_0xa50e('0x41')]:_0x3c5ecf[_0xa50e('0x40')];_0x23df8b[_0xa50e('0x45')]=qs[_0xa50e('0x46')](_0x52e4cb['query'][_0xa50e('0x46')]);_0x23df8b[_0xa50e('0x47')]=qs[_0xa50e('0x3e')](_[_0xa50e('0x48')](_0x52e4cb[_0xa50e('0x3c')],_0x3c5ecf['filters']));if(_0x52e4cb['query'][_0xa50e('0x49')]){_0x23df8b[_0xa50e('0x47')]=_['merge'](_0x23df8b[_0xa50e('0x47')],{'$or':_['map'](_0x23df8b['attributes'],function(_0x22f953){var _0x9a7e75={};_0x9a7e75[_0x22f953]={'$like':'%'+_0x52e4cb['query'][_0xa50e('0x49')]+'%'};return _0x9a7e75;})});}_0x23df8b=_['merge']({},_0x23df8b,_0x52e4cb[_0xa50e('0x4b')]);return _0x27359f['getAgents'](_0x23df8b);}})[_0xa50e('0x2f')](function(_0x498744){if(_0x498744){_0xc3f96a=_0x498744[_0xa50e('0x43')];if(!_0x52e4cb[_0xa50e('0x3c')][_0xa50e('0x44')](_0xa50e('0x63'))){_0x23df8b['limit']=qs[_0xa50e('0x26')](_0x52e4cb['query'][_0xa50e('0x26')]);_0x23df8b[_0xa50e('0x24')]=qs[_0xa50e('0x24')](_0x52e4cb[_0xa50e('0x3c')][_0xa50e('0x24')]);}return _0x27359f[_0xa50e('0x90')](_0x23df8b);}})[_0xa50e('0x2f')](function(_0x21b912){if(_0x21b912){return _0x21b912?{'count':_0xc3f96a,'rows':_0x21b912}:null;}})[_0xa50e('0x2f')](respondWithResult(_0xbd9ab8,null))[_0xa50e('0x4f')](handleError(_0xbd9ab8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index aaafd51..ac89a08 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x5fc3[_0x5447aa];return _0xb21e53;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'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 2264ba2..278fae1 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 _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x21e4d8,_0x16e4a2){var _0x25a486=function(_0x268487){while(--_0x268487){_0x21e4d8['push'](_0x21e4d8['shift']());}};_0x25a486(++_0x16e4a2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x12f5b4,_0x4366ba){_0x12f5b4=_0x12f5b4-0x0;var _0x33ea75=_0xa8a8[_0x12f5b4];return _0x33ea75;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x264204,_0x44466b){var _0x1d310c=function(_0x39fde0){while(--_0x39fde0){_0x264204['push'](_0x264204['shift']());}};_0x1d310c(++_0x44466b);}(_0xaa88,0x137));var _0x8aa8=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xaa88[_0x10e983];return _0x324138;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'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 8b9b413..0e1a89d 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 _0xf316=['request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','debug'];(function(_0x47c9b5,_0x30cf3d){var _0x6580e1=function(_0x52a368){while(--_0x52a368){_0x47c9b5['push'](_0x47c9b5['shift']());}};_0x6580e1(++_0x30cf3d);}(_0xf316,0x1c8));var _0x6f31=function(_0x231e04,_0x233506){_0x231e04=_0x231e04-0x0;var _0x58a8f8=_0xf316[_0x231e04];return _0x58a8f8;};'use strict';var _=require(_0x6f31('0x0'));var util=require('util');var moment=require(_0x6f31('0x1'));var BPromise=require(_0x6f31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f31('0x3'));var db=require(_0x6f31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f31('0x5'))('rpc');var config=require(_0x6f31('0x6'));var jayson=require(_0x6f31('0x7'));var client=jayson['client'][_0x6f31('0x8')]({'port':0x232a});config[_0x6f31('0x9')]=_[_0x6f31('0xa')](config[_0x6f31('0x9')],{'host':_0x6f31('0xb'),'port':0x18eb});var socket=require(_0x6f31('0xc'))(new Redis(config[_0x6f31('0x9')]));require(_0x6f31('0xd'))[_0x6f31('0xe')](socket);function respondWithRpcPromise(_0x3f0ee3,_0x4d2029,_0x209269){return new BPromise(function(_0x360931,_0x31a74c){return client['request'](_0x3f0ee3,_0x209269)[_0x6f31('0xf')](function(_0x340036){logger[_0x6f31('0x10')](_0x6f31('0x11'),_0x4d2029,'request\x20sent');logger[_0x6f31('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x4d2029,_0x6f31('0x13'),JSON[_0x6f31('0x14')](_0x340036));if(_0x340036[_0x6f31('0x15')]){if(_0x340036['error'][_0x6f31('0x16')]===0x1f4){logger[_0x6f31('0x15')](_0x6f31('0x11'),_0x4d2029,_0x340036['error'][_0x6f31('0x17')]);return _0x31a74c(_0x340036[_0x6f31('0x15')][_0x6f31('0x17')]);}logger[_0x6f31('0x15')](_0x6f31('0x11'),_0x4d2029,_0x340036[_0x6f31('0x15')][_0x6f31('0x17')]);return _0x360931(_0x340036[_0x6f31('0x15')]['message']);}else{logger[_0x6f31('0x10')](_0x6f31('0x11'),_0x4d2029,_0x6f31('0x13'));_0x360931(_0x340036['result'][_0x6f31('0x17')]);}})[_0x6f31('0x18')](function(_0x4027fb){logger[_0x6f31('0x15')](_0x6f31('0x11'),_0x4d2029,_0x4027fb);_0x31a74c(_0x4027fb);});});} \ No newline at end of file +var _0xb16c=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb16c,0x137));var _0xcb16=function(_0x307055,_0x3e0068){_0x307055=_0x307055-0x0;var _0x50970c=_0xb16c[_0x307055];return _0x50970c;};'use strict';var _=require(_0xcb16('0x0'));var util=require('util');var moment=require(_0xcb16('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb16('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb16('0x3'))['db'];var utils=require(_0xcb16('0x4'));var logger=require(_0xcb16('0x5'))(_0xcb16('0x6'));var config=require(_0xcb16('0x7'));var jayson=require(_0xcb16('0x8'));var client=jayson[_0xcb16('0x9')]['http']({'port':0x232a});config[_0xcb16('0xa')]=_[_0xcb16('0xb')](config[_0xcb16('0xa')],{'host':_0xcb16('0xc'),'port':0x18eb});var socket=require(_0xcb16('0xd'))(new Redis(config[_0xcb16('0xa')]));require(_0xcb16('0xe'))[_0xcb16('0xf')](socket);function respondWithRpcPromise(_0x5cf4ce,_0x44646f,_0x1494e7){return new BPromise(function(_0x49bfb1,_0x2de786){return client['request'](_0x5cf4ce,_0x1494e7)['then'](function(_0x3569a4){logger['info'](_0xcb16('0x10'),_0x44646f,_0xcb16('0x11'));logger[_0xcb16('0x12')](_0xcb16('0x13'),_0x44646f,_0xcb16('0x11'),JSON[_0xcb16('0x14')](_0x3569a4));if(_0x3569a4[_0xcb16('0x15')]){if(_0x3569a4[_0xcb16('0x15')][_0xcb16('0x16')]===0x1f4){logger[_0xcb16('0x15')](_0xcb16('0x10'),_0x44646f,_0x3569a4[_0xcb16('0x15')][_0xcb16('0x17')]);return _0x2de786(_0x3569a4['error']['message']);}logger[_0xcb16('0x15')](_0xcb16('0x10'),_0x44646f,_0x3569a4['error'][_0xcb16('0x17')]);return _0x49bfb1(_0x3569a4['error'][_0xcb16('0x17')]);}else{logger['info'](_0xcb16('0x10'),_0x44646f,_0xcb16('0x11'));_0x49bfb1(_0x3569a4[_0xcb16('0x18')]['message']);}})[_0xcb16('0x19')](function(_0x27aaa4){logger[_0xcb16('0x15')]('CmList,\x20%s,\x20%s',_0x44646f,_0x27aaa4);_0x2de786(_0x27aaa4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 8a2e658..d1795e2 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 _0xca9e=['./cmList.events','remove','update','removeListener','length'];(function(_0x561c2f,_0x1c533c){var _0x64d086=function(_0x44dbe2){while(--_0x44dbe2){_0x561c2f['push'](_0x561c2f['shift']());}};_0x64d086(++_0x1c533c);}(_0xca9e,0x127));var _0xeca9=function(_0x222951,_0xc9e506){_0x222951=_0x222951-0x0;var _0x1679f2=_0xca9e[_0x222951];return _0x1679f2;};'use strict';var CmListEvents=require(_0xeca9('0x0'));var events=['save',_0xeca9('0x1'),_0xeca9('0x2')];function createListener(_0x3c88bb,_0x4ee956){return function(_0x1ed90b){_0x4ee956['emit'](_0x3c88bb,_0x1ed90b);};}function removeListener(_0x2ee9d8,_0x4bf6e7){return function(){CmListEvents[_0xeca9('0x3')](_0x2ee9d8,_0x4bf6e7);};}exports['register']=function(_0x249538){for(var _0x529cb9=0x0,_0xcc0317=events[_0xeca9('0x4')];_0x529cb9<_0xcc0317;_0x529cb9++){var _0x1238e4=events[_0x529cb9];var _0x4c2f03=createListener('cmList:'+_0x1238e4,_0x249538);CmListEvents['on'](_0x1238e4,_0x4c2f03);}}; \ No newline at end of file +var _0x315e=['removeListener','register','length','cmList:','./cmList.events','remove','update','emit'];(function(_0x191412,_0x5810d3){var _0x16e3bf=function(_0x14a01e){while(--_0x14a01e){_0x191412['push'](_0x191412['shift']());}};_0x16e3bf(++_0x5810d3);}(_0x315e,0x15c));var _0xe315=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x315e[_0x14add3];return _0x4a174f;};'use strict';var CmListEvents=require(_0xe315('0x0'));var events=['save',_0xe315('0x1'),_0xe315('0x2')];function createListener(_0x2b3824,_0x3ac3c1){return function(_0x54cd43){_0x3ac3c1[_0xe315('0x3')](_0x2b3824,_0x54cd43);};}function removeListener(_0x51213d,_0x3bef5e){return function(){CmListEvents[_0xe315('0x4')](_0x51213d,_0x3bef5e);};}exports[_0xe315('0x5')]=function(_0xf67f02){for(var _0x385b46=0x0,_0x336aa6=events[_0xe315('0x6')];_0x385b46<_0x336aa6;_0x385b46++){var _0x28379e=events[_0x385b46];var _0x4f919e=createListener(_0xe315('0x7')+_0x28379e,_0xf67f02);CmListEvents['on'](_0x28379e,_0x4f919e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0668314..306c6d8 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 _0x22ad=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','getDispositions','/:id/contacts/csv','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/contacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','multer','util','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x22ad,0x193));var _0xd22a=function(_0x36a239,_0x5d6d54){_0x36a239=_0x36a239-0x0;var _0x4b8e8c=_0x22ad[_0x36a239];return _0x4b8e8c;};'use strict';var multer=require(_0xd22a('0x0'));var util=require(_0xd22a('0x1'));var path=require(_0xd22a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd22a('0x3')]();var fs_extra=require(_0xd22a('0x4'));var auth=require(_0xd22a('0x5'));var interaction=require(_0xd22a('0x6'));var config=require(_0xd22a('0x7'));var controller=require(_0xd22a('0x8'));router[_0xd22a('0x9')]('/',auth[_0xd22a('0xa')](),controller['index']);router['get']('/describe',auth[_0xd22a('0xa')](),controller['describe']);router[_0xd22a('0x9')]('/:id',auth[_0xd22a('0xa')](),controller['show']);router[_0xd22a('0x9')]('/:id/dispositions',auth[_0xd22a('0xa')](),controller[_0xd22a('0xb')]);router[_0xd22a('0x9')]('/:id/contacts',auth[_0xd22a('0xa')](),controller['getContacts']);router[_0xd22a('0x9')](_0xd22a('0xc'),auth[_0xd22a('0xa')](),controller['getContactsCsv']);router['get']('/:id/fields',auth[_0xd22a('0xa')](),controller['getCustomFields']);router[_0xd22a('0x9')](_0xd22a('0xd'),auth['isAuthenticated'](),controller[_0xd22a('0xe')]);router[_0xd22a('0xf')]('/',auth[_0xd22a('0xa')](),controller[_0xd22a('0x10')]);router[_0xd22a('0xf')](_0xd22a('0x11'),auth['isAuthenticated'](),controller[_0xd22a('0x12')]);router['post'](_0xd22a('0x13'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xd22a('0x14')]);router[_0xd22a('0xf')](_0xd22a('0xd'),auth[_0xd22a('0xa')](),controller[_0xd22a('0x15')]);router[_0xd22a('0x16')](_0xd22a('0x17'),auth['isAuthenticated'](),controller[_0xd22a('0x18')]);router['delete'](_0xd22a('0x17'),auth[_0xd22a('0xa')](),controller[_0xd22a('0x19')]);router[_0xd22a('0x1a')]('/:id/dispositions',auth[_0xd22a('0xa')](),controller[_0xd22a('0x1b')]);router[_0xd22a('0x1a')](_0xd22a('0xd'),auth[_0xd22a('0xa')](),controller[_0xd22a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xf5ed=['getContactsCsv','getCustomFields','create','post','addDisposition','/:id/fields','addCustomField','/:id/users','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv'];(function(_0x5cc88d,_0x281adc){var _0x1135d2=function(_0x72c2a9){while(--_0x72c2a9){_0x5cc88d['push'](_0x5cc88d['shift']());}};_0x1135d2(++_0x281adc);}(_0xf5ed,0x154));var _0xdf5e=function(_0x50ded7,_0x1aa5e2){_0x50ded7=_0x50ded7-0x0;var _0x46f377=_0xf5ed[_0x50ded7];return _0x46f377;};'use strict';var multer=require(_0xdf5e('0x0'));var util=require(_0xdf5e('0x1'));var path=require(_0xdf5e('0x2'));var timeout=require(_0xdf5e('0x3'));var express=require('express');var router=express[_0xdf5e('0x4')]();var fs_extra=require(_0xdf5e('0x5'));var auth=require(_0xdf5e('0x6'));var interaction=require(_0xdf5e('0x7'));var config=require(_0xdf5e('0x8'));var controller=require(_0xdf5e('0x9'));router[_0xdf5e('0xa')]('/',auth[_0xdf5e('0xb')](),controller[_0xdf5e('0xc')]);router[_0xdf5e('0xa')](_0xdf5e('0xd'),auth['isAuthenticated'](),controller[_0xdf5e('0xe')]);router[_0xdf5e('0xa')](_0xdf5e('0xf'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x10')]);router[_0xdf5e('0xa')](_0xdf5e('0x11'),auth[_0xdf5e('0xb')](),controller['getDispositions']);router[_0xdf5e('0xa')](_0xdf5e('0x12'),auth[_0xdf5e('0xb')](),controller['getContacts']);router[_0xdf5e('0xa')](_0xdf5e('0x13'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x14')]);router[_0xdf5e('0xa')]('/:id/fields',auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x15')]);router[_0xdf5e('0xa')]('/:id/users',auth[_0xdf5e('0xb')](),controller['getAgents']);router['post']('/',auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x16')]);router[_0xdf5e('0x17')](_0xdf5e('0x11'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x18')]);router[_0xdf5e('0x17')](_0xdf5e('0x12'),auth[_0xdf5e('0xb')](),controller['addContacts']);router['post'](_0xdf5e('0x19'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x1a')]);router[_0xdf5e('0x17')](_0xdf5e('0x1b'),auth['isAuthenticated'](),controller[_0xdf5e('0x1c')]);router[_0xdf5e('0x1d')](_0xdf5e('0xf'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x1e')]);router['delete'](_0xdf5e('0xf'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x1f')]);router[_0xdf5e('0x20')](_0xdf5e('0x11'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x21')]);router['delete'](_0xdf5e('0x1b'),auth[_0xdf5e('0xb')](),controller[_0xdf5e('0x22')]);module[_0xdf5e('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 054c7ec..05809e6 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 _0x0f71=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x13aad0,_0x63ead7){var _0xff1a8a=function(_0x5c96fe){while(--_0x5c96fe){_0x13aad0['push'](_0x13aad0['shift']());}};_0xff1a8a(++_0x63ead7);}(_0x0f71,0x1be));var _0x10f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f71[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x10f7('0x0')]={'name':{'type':Sequelize[_0x10f7('0x1')],'get':function(_0x391ed2){return this[_0x10f7('0x2')](_0x10f7('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x10f7('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x10f7('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xb9db=['VIRTUAL','STRING','sequelize'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0xb9db,0x104));var _0xbb9d=function(_0x1cd2bd,_0x34adea){_0x1cd2bd=_0x1cd2bd-0x0;var _0x1d2e1c=_0xb9db[_0x1cd2bd];return _0x1d2e1c;};'use strict';var Sequelize=require(_0xbb9d('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb9d('0x1')],'get':function(_0xc148b5){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xbb9d('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0xbb9d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xbb9d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 1a79cd3..d05fa9b 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x54755a,_0x48fb80){var _0x269c66=function(_0x129137){while(--_0x129137){_0x54755a['push'](_0x54755a['shift']());}};_0x269c66(++_0x48fb80);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x5492fd,_0x2f16c8){var _0x563e88=function(_0x4045dd){while(--_0x4045dd){_0x5492fd['push'](_0x5492fd['shift']());}};_0x563e88(++_0x2f16c8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 3873db1..fdbe0c3 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 _0xe1a9=['bluebird','rimraf','../../config/environment','exports','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0x34caef,_0x433250){var _0x4b90a4=function(_0x4b9856){while(--_0x4b9856){_0x34caef['push'](_0x34caef['shift']());}};_0x4b90a4(++_0x433250);}(_0xe1a9,0x191));var _0x9e1a=function(_0x2f7e63,_0x4d3f22){_0x2f7e63=_0x2f7e63-0x0;var _0x19464a=_0xe1a9[_0x2f7e63];return _0x19464a;};'use strict';var _=require(_0x9e1a('0x0'));var util=require('util');var logger=require(_0x9e1a('0x1'))(_0x9e1a('0x2'));var moment=require(_0x9e1a('0x3'));var BPromise=require(_0x9e1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e1a('0x5'));var config=require(_0x9e1a('0x6'));var attributes=require('./condition.attributes');module[_0x9e1a('0x7')]=function(_0x2cdb7c,_0x55afe2){return _0x2cdb7c['define']('Condition',attributes,{'tableName':_0x9e1a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8f9=['tools_conditions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Condition'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf8f9,0x17a));var _0x9f8f=function(_0x34e924,_0x296744){_0x34e924=_0x34e924-0x0;var _0x4ec07b=_0xf8f9[_0x34e924];return _0x4ec07b;};'use strict';var _=require('lodash');var util=require(_0x9f8f('0x0'));var logger=require(_0x9f8f('0x1'))(_0x9f8f('0x2'));var moment=require(_0x9f8f('0x3'));var BPromise=require(_0x9f8f('0x4'));var rp=require(_0x9f8f('0x5'));var fs=require('fs');var path=require(_0x9f8f('0x6'));var rimraf=require(_0x9f8f('0x7'));var config=require(_0x9f8f('0x8'));var attributes=require('./condition.attributes');module[_0x9f8f('0x9')]=function(_0x4491ed,_0xb92715){return _0x4491ed[_0x9f8f('0xa')](_0x9f8f('0xb'),attributes,{'tableName':_0x9f8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 0c7ee20..7781400 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 _0xa33d=['../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x15c039,_0x25f3d6){var _0x177c37=function(_0x25cdc7){while(--_0x25cdc7){_0x15c039['push'](_0x15c039['shift']());}};_0x177c37(++_0x25f3d6);}(_0xa33d,0xfe));var _0xda33=function(_0x33addb,_0x517707){_0x33addb=_0x33addb-0x0;var _0x3249e5=_0xa33d[_0x33addb];return _0x3249e5;};'use strict';var _=require(_0xda33('0x0'));var util=require(_0xda33('0x1'));var moment=require(_0xda33('0x2'));var BPromise=require(_0xda33('0x3'));var rs=require(_0xda33('0x4'));var fs=require('fs');var Redis=require(_0xda33('0x5'));var db=require(_0xda33('0x6'))['db'];var utils=require(_0xda33('0x7'));var logger=require(_0xda33('0x8'))(_0xda33('0x9'));var config=require(_0xda33('0xa'));var jayson=require(_0xda33('0xb'));var client=jayson[_0xda33('0xc')][_0xda33('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20f5dc,_0x102629,_0x5b1067){return new BPromise(function(_0x5a2287,_0x2e73cf){return client[_0xda33('0xe')](_0x20f5dc,_0x5b1067)['then'](function(_0x4acc4d){logger[_0xda33('0xf')](_0xda33('0x10'),_0x102629,'request\x20sent');logger['debug'](_0xda33('0x11'),_0x102629,'request\x20sent',JSON[_0xda33('0x12')](_0x4acc4d));if(_0x4acc4d[_0xda33('0x13')]){if(_0x4acc4d[_0xda33('0x13')]['code']===0x1f4){logger[_0xda33('0x13')](_0xda33('0x10'),_0x102629,_0x4acc4d[_0xda33('0x13')][_0xda33('0x14')]);return _0x2e73cf(_0x4acc4d[_0xda33('0x13')][_0xda33('0x14')]);}logger[_0xda33('0x13')](_0xda33('0x10'),_0x102629,_0x4acc4d[_0xda33('0x13')][_0xda33('0x14')]);return _0x5a2287(_0x4acc4d['error']['message']);}else{logger[_0xda33('0xf')](_0xda33('0x10'),_0x102629,_0xda33('0x15'));_0x5a2287(_0x4acc4d[_0xda33('0x16')][_0xda33('0x14')]);}})[_0xda33('0x17')](function(_0x14ad31){logger['error'](_0xda33('0x10'),_0x102629,_0x14ad31);_0x2e73cf(_0x14ad31);});});} \ No newline at end of file +var _0x59ea=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','ioredis'];(function(_0x564f37,_0x33a738){var _0x26a5d2=function(_0x112d11){while(--_0x112d11){_0x564f37['push'](_0x564f37['shift']());}};_0x26a5d2(++_0x33a738);}(_0x59ea,0x9c));var _0xa59e=function(_0x5d21df,_0x5db715){_0x5d21df=_0x5d21df-0x0;var _0x3c2172=_0x59ea[_0x5d21df];return _0x3c2172;};'use strict';var _=require(_0xa59e('0x0'));var util=require(_0xa59e('0x1'));var moment=require('moment');var BPromise=require(_0xa59e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa59e('0x3'));var db=require(_0xa59e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa59e('0x5'))('rpc');var config=require(_0xa59e('0x6'));var jayson=require(_0xa59e('0x7'));var client=jayson[_0xa59e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x517b89,_0xd1db63,_0x2f1fd7){return new BPromise(function(_0x326706,_0x203b4c){return client['request'](_0x517b89,_0x2f1fd7)[_0xa59e('0x9')](function(_0x7d9c1b){logger[_0xa59e('0xa')](_0xa59e('0xb'),_0xd1db63,'request\x20sent');logger['debug'](_0xa59e('0xc'),_0xd1db63,'request\x20sent',JSON['stringify'](_0x7d9c1b));if(_0x7d9c1b['error']){if(_0x7d9c1b['error']['code']===0x1f4){logger[_0xa59e('0xd')]('Condition,\x20%s,\x20%s',_0xd1db63,_0x7d9c1b['error']['message']);return _0x203b4c(_0x7d9c1b[_0xa59e('0xd')]['message']);}logger['error']('Condition,\x20%s,\x20%s',_0xd1db63,_0x7d9c1b['error'][_0xa59e('0xe')]);return _0x326706(_0x7d9c1b[_0xa59e('0xd')][_0xa59e('0xe')]);}else{logger[_0xa59e('0xa')](_0xa59e('0xb'),_0xd1db63,'request\x20sent');_0x326706(_0x7d9c1b[_0xa59e('0xf')][_0xa59e('0xe')]);}})['catch'](function(_0x8d0a2e){logger[_0xa59e('0xd')](_0xa59e('0xb'),_0xd1db63,_0x8d0a2e);_0x203b4c(_0x8d0a2e);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 54a5443..c03e412 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 _0x5079=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','update','delete','destroy'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x5079,0x13c));var _0x9507=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x5079[_0x1df7b8];return _0x29d911;};'use strict';var multer=require(_0x9507('0x0'));var util=require(_0x9507('0x1'));var path=require(_0x9507('0x2'));var timeout=require(_0x9507('0x3'));var express=require(_0x9507('0x4'));var router=express[_0x9507('0x5')]();var fs_extra=require(_0x9507('0x6'));var auth=require(_0x9507('0x7'));var interaction=require(_0x9507('0x8'));var config=require(_0x9507('0x9'));var controller=require('./condition.controller');router['put'](_0x9507('0xa'),auth['isAuthenticated'](),controller[_0x9507('0xb')]);router[_0x9507('0xc')](_0x9507('0xa'),auth['isAuthenticated'](),controller[_0x9507('0xd')]);module[_0x9507('0xe')]=router; \ No newline at end of file +var _0x3cb5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x532c55,_0x4dab9a){var _0x1eefe9=function(_0x13b8cb){while(--_0x13b8cb){_0x532c55['push'](_0x532c55['shift']());}};_0x1eefe9(++_0x4dab9a);}(_0x3cb5,0x13f));var _0x53cb=function(_0x313938,_0x534202){_0x313938=_0x313938-0x0;var _0x514d3f=_0x3cb5[_0x313938];return _0x514d3f;};'use strict';var multer=require(_0x53cb('0x0'));var util=require(_0x53cb('0x1'));var path=require(_0x53cb('0x2'));var timeout=require(_0x53cb('0x3'));var express=require(_0x53cb('0x4'));var router=express[_0x53cb('0x5')]();var fs_extra=require(_0x53cb('0x6'));var auth=require(_0x53cb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x53cb('0x8'));var controller=require('./condition.controller');router['put'](_0x53cb('0x9'),auth[_0x53cb('0xa')](),controller[_0x53cb('0xb')]);router['delete'](_0x53cb('0x9'),auth[_0x53cb('0xa')](),controller[_0x53cb('0xc')]);module[_0x53cb('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 928b040..8471fcf 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x2d6d60,_0xd16046){var _0x32e585=function(_0x34f0b4){while(--_0x34f0b4){_0x2d6d60['push'](_0x2d6d60['shift']());}};_0x32e585(++_0xd16046);}(_0x2032,0xd9));var _0x2203=function(_0x148cc5,_0xc7bb3f){_0x148cc5=_0x148cc5-0x0;var _0x5c7db7=_0x2032[_0x148cc5];return _0x5c7db7;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x52535e,_0x3a0239){var _0x3aa6cd=function(_0x5522da){while(--_0x5522da){_0x52535e['push'](_0x52535e['shift']());}};_0x3aa6cd(++_0x3a0239);}(_0x2032,0xd9));var _0x2203=function(_0x99a8f7,_0x184052){_0x99a8f7=_0x99a8f7-0x0;var _0x2d43bd=_0x2032[_0x99a8f7];return _0x2d43bd;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index bfb16a9..6794cad 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 _0xc375=['value','https://','custom','clock','attrHourFormat','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','sort','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','omit','createdAt','updatedAt','update','iframe','attrUrl','attrs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc375,0x1a1));var _0x5c37=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xc375[_0x4cd690];return _0x4a74a9;};'use strict';var emlformat=require(_0x5c37('0x0'));var rimraf=require(_0x5c37('0x1'));var zipdir=require(_0x5c37('0x2'));var jsonpatch=require(_0x5c37('0x3'));var rp=require('request-promise');var moment=require(_0x5c37('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5c37('0x5'));var util=require(_0x5c37('0x6'));var path=require(_0x5c37('0x7'));var sox=require(_0x5c37('0x8'));var csv=require(_0x5c37('0x9'));var ejs=require(_0x5c37('0xa'));var fs=require('fs');var fs_extra=require(_0x5c37('0xb'));var _=require(_0x5c37('0xc'));var squel=require(_0x5c37('0xd'));var crypto=require('crypto');var jsforce=require(_0x5c37('0xe'));var deskjs=require(_0x5c37('0xf'));var toCsv=require(_0x5c37('0x9'));var querystring=require('querystring');var Papa=require(_0x5c37('0x10'));var Redis=require(_0x5c37('0x11'));var authService=require(_0x5c37('0x12'));var qs=require(_0x5c37('0x13'));var as=require(_0x5c37('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c37('0x15'))('api');var utils=require(_0x5c37('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5c37('0x17'));var db=require('../../mysqldb')['db'];config[_0x5c37('0x18')]=_['defaults'](config[_0x5c37('0x18')],{'host':_0x5c37('0x19'),'port':0x18eb});var socket=require(_0x5c37('0x1a'))(new Redis(config[_0x5c37('0x18')]));require(_0x5c37('0x1b'))[_0x5c37('0x1c')](socket);function respondWithStatusCode(_0x4698a6,_0x53e1b0){_0x53e1b0=_0x53e1b0||0xcc;return function(_0x4b4742){if(_0x4b4742){return _0x4698a6[_0x5c37('0x1d')](_0x53e1b0);}return _0x4698a6[_0x5c37('0x1e')](_0x53e1b0)[_0x5c37('0x1f')]();};}function respondWithResult(_0x574544,_0x3802b7){_0x3802b7=_0x3802b7||0xc8;return function(_0x5b1662){if(_0x5b1662){return _0x574544[_0x5c37('0x1e')](_0x3802b7)[_0x5c37('0x20')](_0x5b1662);}};}function respondWithFilteredResult(_0x2e9522,_0x3e9237){return function(_0xb20863){if(_0xb20863){var _0x32b7ee=typeof _0x3e9237[_0x5c37('0x21')]==='undefined'&&typeof _0x3e9237[_0x5c37('0x22')]===_0x5c37('0x23');var _0x5313b7=_0xb20863[_0x5c37('0x24')];var _0x48e605=_0x32b7ee?0x0:_0x3e9237['offset'];var _0x151ce5=_0x32b7ee?_0xb20863[_0x5c37('0x24')]:_0x3e9237[_0x5c37('0x21')]+_0x3e9237[_0x5c37('0x22')];var _0x29ee95;if(_0x151ce5>=_0x5313b7){_0x151ce5=_0x5313b7;_0x29ee95=0xc8;}else{_0x29ee95=0xce;}_0x2e9522['status'](_0x29ee95);return _0x2e9522[_0x5c37('0x25')](_0x5c37('0x26'),_0x48e605+'-'+_0x151ce5+'/'+_0x5313b7)[_0x5c37('0x20')](_0xb20863);}return null;};}function patchUpdates(_0xa09249){return function(_0x58b45c){try{jsonpatch[_0x5c37('0x27')](_0x58b45c,_0xa09249,!![]);}catch(_0x5c3bcb){return BPromise[_0x5c37('0x28')](_0x5c3bcb);}return _0x58b45c[_0x5c37('0x29')]();};}function saveUpdates(_0x2bdcd0,_0x259e2e){return function(_0x43142f){if(_0x43142f){return _0x43142f['update'](_0x2bdcd0)['then'](function(_0x21494e){return _0x21494e;});}return null;};}function removeEntity(_0xf06f60,_0x25b031){return function(_0x1041c1){if(_0x1041c1){return _0x1041c1['destroy']()[_0x5c37('0x2a')](function(){var _0x440ed3=_0x1041c1['get']({'plain':!![]});var _0x360176=_0x5c37('0x2b');return db[_0x5c37('0x2c')][_0x5c37('0x2d')]({'where':{'type':_0x360176,'resourceId':_0x440ed3['id']}})[_0x5c37('0x2a')](function(){return _0x1041c1;});})[_0x5c37('0x2a')](function(){_0xf06f60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb9be4c,_0x6533df){return function(_0x320b65){if(!_0x320b65){_0xb9be4c[_0x5c37('0x1d')](0x194);}return _0x320b65;};}function handleError(_0x23772b,_0x3d39e8){_0x3d39e8=_0x3d39e8||0x1f4;return function(_0x5dfac2){logger[_0x5c37('0x2e')](_0x5dfac2[_0x5c37('0x2f')]);if(_0x5dfac2[_0x5c37('0x30')]){delete _0x5dfac2[_0x5c37('0x30')];}_0x23772b['status'](_0x3d39e8)[_0x5c37('0x31')](_0x5dfac2);};}exports[_0x5c37('0x32')]=function(_0x3063c3,_0x850cc1){var _0x21c789={},_0xe8dca0={},_0x4c3114={'count':0x0,'rows':[]};var _0x507516=_[_0x5c37('0x33')](db[_0x5c37('0x34')][_0x5c37('0x35')],function(_0x3616c7){return{'name':_0x3616c7[_0x5c37('0x36')],'type':_0x3616c7[_0x5c37('0x37')][_0x5c37('0x38')]};});_0xe8dca0[_0x5c37('0x39')]=_['map'](_0x507516,_0x5c37('0x30'));_0xe8dca0[_0x5c37('0x3a')]=_['keys'](_0x3063c3[_0x5c37('0x3a')]);_0xe8dca0[_0x5c37('0x3b')]=_[_0x5c37('0x3c')](_0xe8dca0['model'],_0xe8dca0['query']);_0x21c789[_0x5c37('0x3d')]=_[_0x5c37('0x3c')](_0xe8dca0['model'],qs['fields'](_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x3e')]));_0x21c789[_0x5c37('0x3d')]=_0x21c789[_0x5c37('0x3d')]['length']?_0x21c789[_0x5c37('0x3d')]:_0xe8dca0['model'];if(!_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x3f')]('nolimit')){_0x21c789[_0x5c37('0x22')]=qs[_0x5c37('0x22')](_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x22')]);_0x21c789['offset']=qs[_0x5c37('0x21')](_0x3063c3['query'][_0x5c37('0x21')]);}_0x21c789[_0x5c37('0x40')]=qs['sort'](_0x3063c3['query']['sort']);_0x21c789[_0x5c37('0x41')]=qs[_0x5c37('0x3b')](_[_0x5c37('0x42')](_0x3063c3['query'],_0xe8dca0[_0x5c37('0x3b')]),_0x507516);if(_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x43')]){_0x21c789[_0x5c37('0x41')]=_[_0x5c37('0x44')](_0x21c789['where'],{'$or':_[_0x5c37('0x33')](_0x507516,function(_0x284d23){if(_0x284d23[_0x5c37('0x37')]!==_0x5c37('0x45')){var _0x1631a3={};_0x1631a3[_0x284d23[_0x5c37('0x30')]]={'$like':'%'+_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x43')]+'%'};return _0x1631a3;}})});}_0x21c789=_[_0x5c37('0x44')]({},_0x21c789,_0x3063c3[_0x5c37('0x46')]);var _0x48ec14={'where':_0x21c789['where']};return db[_0x5c37('0x34')]['count'](_0x48ec14)[_0x5c37('0x2a')](function(_0x1f25d9){_0x4c3114['count']=_0x1f25d9;if(_0x3063c3[_0x5c37('0x3a')][_0x5c37('0x47')]){_0x21c789['include']=[{'all':!![]}];}return db[_0x5c37('0x34')][_0x5c37('0x48')](_0x21c789);})['then'](function(_0x1ed07f){_0x4c3114[_0x5c37('0x49')]=_0x1ed07f;return _0x4c3114;})[_0x5c37('0x2a')](respondWithFilteredResult(_0x850cc1,_0x21c789))[_0x5c37('0x4a')](handleError(_0x850cc1,null));};exports[_0x5c37('0x4b')]=function(_0x5d74fd,_0x1c47f7){var _0x4d803d={'raw':![],'where':{'id':_0x5d74fd[_0x5c37('0x4c')]['id']}},_0x1c49cb={};_0x1c49cb[_0x5c37('0x39')]=_[_0x5c37('0x4d')](db[_0x5c37('0x34')][_0x5c37('0x35')]);_0x1c49cb[_0x5c37('0x3a')]=_[_0x5c37('0x4d')](_0x5d74fd[_0x5c37('0x3a')]);_0x1c49cb[_0x5c37('0x3b')]=_['intersection'](_0x1c49cb[_0x5c37('0x39')],_0x1c49cb[_0x5c37('0x3a')]);_0x4d803d[_0x5c37('0x3d')]=_['intersection'](_0x1c49cb[_0x5c37('0x39')],qs[_0x5c37('0x3e')](_0x5d74fd[_0x5c37('0x3a')]['fields']));_0x4d803d['attributes']=_0x4d803d[_0x5c37('0x3d')]['length']?_0x4d803d['attributes']:_0x1c49cb[_0x5c37('0x39')];if(_0x5d74fd[_0x5c37('0x3a')][_0x5c37('0x47')]){_0x4d803d['include']=[{'all':!![]}];}_0x4d803d=_['merge']({},_0x4d803d,_0x5d74fd[_0x5c37('0x46')]);return db[_0x5c37('0x34')][_0x5c37('0x4e')](_0x4d803d)['then'](handleEntityNotFound(_0x1c47f7,null))[_0x5c37('0x2a')](respondWithResult(_0x1c47f7,null))['catch'](handleError(_0x1c47f7,null));};exports[_0x5c37('0x4f')]=function(_0x2a524e,_0x4e0444){return db['Dashboard']['create'](_0x2a524e[_0x5c37('0x50')],{})[_0x5c37('0x2a')](function(_0x2ef350){var _0x26b8eb=_0x2a524e['user']['get']({'plain':!![]});if(!_0x26b8eb)throw new Error(_0x5c37('0x51'));if(_0x26b8eb[_0x5c37('0x52')]===_0x5c37('0x53')){var _0x5ac4be=_0x2ef350[_0x5c37('0x54')]({'plain':!![]});var _0x25a194=_0x5c37('0x2b');return db[_0x5c37('0x55')]['find']({'where':{'name':_0x25a194,'userProfileId':_0x26b8eb[_0x5c37('0x56')]},'raw':!![]})[_0x5c37('0x2a')](function(_0x52f766){if(_0x52f766&&_0x52f766[_0x5c37('0x57')]===0x0){return db[_0x5c37('0x2c')]['create']({'name':_0x5ac4be[_0x5c37('0x30')],'resourceId':_0x5ac4be['id'],'type':_0x52f766[_0x5c37('0x30')],'sectionId':_0x52f766['id']},{})[_0x5c37('0x2a')](function(){return _0x2ef350;});}else{return _0x2ef350;}})['catch'](function(_0x48260d){logger['error'](_0x5c37('0x58'),_0x48260d);throw _0x48260d;});}return _0x2ef350;})[_0x5c37('0x2a')](respondWithResult(_0x4e0444,0xc9))[_0x5c37('0x4a')](handleError(_0x4e0444,null));};exports[_0x5c37('0x59')]=function(_0x47e5ed,_0x262c8d){var _0x525913={'where':{'id':_0x47e5ed[_0x5c37('0x4c')]['id']}},_0x3e5ddd={};_0x3e5ddd[_0x5c37('0x39')]=_[_0x5c37('0x4d')](db[_0x5c37('0x34')][_0x5c37('0x35')]);_0x525913['attributes']=_[_0x5c37('0x3c')](_0x3e5ddd['model'],qs[_0x5c37('0x3e')](_0x47e5ed[_0x5c37('0x3a')][_0x5c37('0x3e')]));_0x525913[_0x5c37('0x3d')]=_0x525913['attributes'][_0x5c37('0x5a')]?_0x525913[_0x5c37('0x3d')]:_0x3e5ddd[_0x5c37('0x39')];if(_0x47e5ed[_0x5c37('0x3a')][_0x5c37('0x47')]){_0x525913[_0x5c37('0x5b')]=[{'all':!![]}];}_0x525913=_[_0x5c37('0x44')]({},_0x525913,_0x47e5ed[_0x5c37('0x46')]);return db['Dashboard'][_0x5c37('0x4e')](_0x525913)['then'](handleEntityNotFound(_0x262c8d,null))[_0x5c37('0x2a')](function(_0x2c3b80){if(_0x2c3b80){var _0xc28e42=_0x2c3b80[_0x5c37('0x54')]({'plain':!![]});_0xc28e42=qs[_0x5c37('0x5c')](_0xc28e42,['id',_0x5c37('0x5d'),_0x5c37('0x5e')]);_0x47e5ed[_0x5c37('0x50')]=_['omit'](_0x47e5ed['body'],['id',_0x5c37('0x5d'),_0x5c37('0x5e')]);return db[_0x5c37('0x34')]['create'](_[_0x5c37('0x44')](_0xc28e42,_0x47e5ed['body']),{'include':_0x47e5ed[_0x5c37('0x3a')][_0x5c37('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8a783c){var _0xd9abf1=_0x47e5ed[_0x5c37('0x53')]['get']({'plain':!![]});if(!_0xd9abf1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd9abf1['role']===_0x5c37('0x53')){var _0x387866=_0x8a783c[_0x5c37('0x54')]({'plain':!![]});var _0x163250=_0x5c37('0x2b');return db['UserProfileSection'][_0x5c37('0x4e')]({'where':{'name':_0x163250,'userProfileId':_0xd9abf1[_0x5c37('0x56')]},'raw':!![]})[_0x5c37('0x2a')](function(_0x2c9935){if(_0x2c9935&&_0x2c9935[_0x5c37('0x57')]===0x0){return db[_0x5c37('0x2c')][_0x5c37('0x4f')]({'name':_0x387866[_0x5c37('0x30')],'resourceId':_0x387866['id'],'type':_0x2c9935[_0x5c37('0x30')],'sectionId':_0x2c9935['id']},{})[_0x5c37('0x2a')](function(){return _0x8a783c;});}else{return _0x8a783c;}})[_0x5c37('0x4a')](function(_0x266b8d){logger['error'](_0x5c37('0x58'),_0x266b8d);throw _0x266b8d;});}return _0x8a783c;});}})[_0x5c37('0x2a')](respondWithResult(_0x262c8d,0xc9))[_0x5c37('0x4a')](handleError(_0x262c8d,null));};exports[_0x5c37('0x5f')]=function(_0x128419,_0x35aa57){if(_0x128419[_0x5c37('0x50')]['id']){delete _0x128419[_0x5c37('0x50')]['id'];}return db[_0x5c37('0x34')][_0x5c37('0x4e')]({'where':{'id':_0x128419['params']['id']}})['then'](handleEntityNotFound(_0x35aa57,null))[_0x5c37('0x2a')](saveUpdates(_0x128419[_0x5c37('0x50')],null))[_0x5c37('0x2a')](respondWithResult(_0x35aa57,null))[_0x5c37('0x4a')](handleError(_0x35aa57,null));};exports['destroy']=function(_0x10c175,_0x272fe9){return db[_0x5c37('0x34')][_0x5c37('0x4e')]({'where':{'id':_0x10c175[_0x5c37('0x4c')]['id']}})['then'](handleEntityNotFound(_0x272fe9,null))[_0x5c37('0x2a')](removeEntity(_0x272fe9,null))['catch'](handleError(_0x272fe9,null));};function widgetAttributes(_0x517d5d){try{switch(_0x517d5d['type']){case _0x5c37('0x60'):return[{'name':_0x5c37('0x61'),'value':_0x517d5d[_0x5c37('0x61')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x0]?_0x517d5d[_0x5c37('0x62')][0x0][_0x5c37('0x63')]:undefined)||_0x5c37('0x64')}];case _0x5c37('0x65'):return[{'name':'attrPath','value':_0x517d5d['attrPath']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x0]?_0x517d5d['attrs'][0x0][_0x5c37('0x63')]:undefined)||''}];case _0x5c37('0x66'):return[{'name':_0x5c37('0x67'),'value':_0x517d5d[_0x5c37('0x67')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x0]?_0x517d5d[_0x5c37('0x62')][0x0][_0x5c37('0x63')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x517d5d['attrTimezone']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x1]?_0x517d5d['attrs'][0x1]['value']:undefined)||_0x5c37('0x68')},{'name':'attrFontSize','value':_0x517d5d['attrFontSize']||(_0x517d5d['attrs']&&_0x517d5d[_0x5c37('0x62')][0x2]?_0x517d5d[_0x5c37('0x62')][0x2]['value']:undefined)||0xc}];case _0x5c37('0x69'):return[{'name':_0x5c37('0x6a'),'value':_0x517d5d['attrMetric']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x0]?_0x517d5d['attrs'][0x0][_0x5c37('0x63')]:undefined)||_0x5c37('0x6b')},{'name':_0x5c37('0x6c'),'value':_0x517d5d[_0x5c37('0x6c')]||(_0x517d5d['attrs']&&_0x517d5d[_0x5c37('0x62')][0x1]?_0x517d5d[_0x5c37('0x62')][0x1]['value']:undefined)||[]},{'name':_0x5c37('0x6d'),'value':_0x517d5d[_0x5c37('0x6d')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x2]?_0x517d5d[_0x5c37('0x62')][0x2][_0x5c37('0x63')]:undefined)||0x14},{'name':_0x5c37('0x6e'),'value':_0x517d5d[_0x5c37('0x6e')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x3]?_0x517d5d[_0x5c37('0x62')][0x3][_0x5c37('0x63')]:undefined)||_0x5c37('0x6f')},{'name':'attrEmailAccounts','value':_0x517d5d[_0x5c37('0x70')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x4]?_0x517d5d[_0x5c37('0x62')][0x4][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x71'),'value':_0x517d5d['attrFaxAccounts']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x5]?_0x517d5d[_0x5c37('0x62')][0x5][_0x5c37('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x517d5d[_0x5c37('0x72')]||(_0x517d5d['attrs']&&_0x517d5d[_0x5c37('0x62')][0x6]?_0x517d5d[_0x5c37('0x62')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x517d5d[_0x5c37('0x73')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x7]?_0x517d5d[_0x5c37('0x62')][0x7][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x74'),'value':_0x517d5d['attrWhatsappAccounts']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x8]?_0x517d5d[_0x5c37('0x62')][0x8][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x75'),'value':_0x517d5d['attrChatWebsites']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x9]?_0x517d5d[_0x5c37('0x62')][0x9][_0x5c37('0x63')]:undefined)||''}];case _0x5c37('0x76'):case'pie-chart':return[{'name':_0x5c37('0x77'),'value':_0x517d5d[_0x5c37('0x77')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x0]?_0x517d5d['attrs'][0x0]['value']:undefined)||_0x5c37('0x6b')},{'name':'attrSerie2','value':_0x517d5d[_0x5c37('0x78')]||(_0x517d5d['attrs']&&_0x517d5d[_0x5c37('0x62')][0x1]?_0x517d5d['attrs'][0x1][_0x5c37('0x63')]:undefined)||null},{'name':'attrSerie3','value':_0x517d5d['attrSerie3']||(_0x517d5d['attrs']&&_0x517d5d[_0x5c37('0x62')][0x2]?_0x517d5d[_0x5c37('0x62')][0x2][_0x5c37('0x63')]:undefined)||null},{'name':_0x5c37('0x6c'),'value':_0x517d5d[_0x5c37('0x6c')]||(_0x517d5d['attrs']&&_0x517d5d['attrs'][0x3]?_0x517d5d[_0x5c37('0x62')][0x3]['value']:undefined)||[]},{'name':_0x5c37('0x6e'),'value':_0x517d5d[_0x5c37('0x6e')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x4]?_0x517d5d[_0x5c37('0x62')][0x4][_0x5c37('0x63')]:undefined)||_0x5c37('0x6f')},{'name':_0x5c37('0x70'),'value':_0x517d5d[_0x5c37('0x70')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x5]?_0x517d5d[_0x5c37('0x62')][0x5][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x71'),'value':_0x517d5d[_0x5c37('0x71')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x6]?_0x517d5d['attrs'][0x6][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x72'),'value':_0x517d5d['attrSmsAccounts']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x7]?_0x517d5d['attrs'][0x7][_0x5c37('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x517d5d[_0x5c37('0x73')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x8]?_0x517d5d['attrs'][0x8][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x74'),'value':_0x517d5d[_0x5c37('0x74')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x9]?_0x517d5d[_0x5c37('0x62')][0x9][_0x5c37('0x63')]:undefined)||''},{'name':_0x5c37('0x75'),'value':_0x517d5d[_0x5c37('0x75')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0xa]?_0x517d5d[_0x5c37('0x62')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x5c37('0x79'),'type':_0x517d5d['reportType']||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x0]?_0x517d5d[_0x5c37('0x62')][0x0][_0x5c37('0x37')]:undefined)||null,'value':_0x517d5d[_0x5c37('0x79')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d[_0x5c37('0x62')][0x0]?_0x517d5d['attrs'][0x0][_0x5c37('0x63')]:undefined)||null},{'name':_0x5c37('0x7a'),'value':_0x517d5d[_0x5c37('0x7a')]||(_0x517d5d[_0x5c37('0x62')]&&_0x517d5d['attrs'][0x1]?_0x517d5d[_0x5c37('0x62')][0x1][_0x5c37('0x63')]:undefined)||0x0}];default:return[];}}catch(_0xf1e13c){logger[_0x5c37('0x2e')]('widgetAttributes:\x20%s',JSON[_0x5c37('0x7b')](_0xf1e13c));return[];}}exports['addItem']=function(_0x24463c,_0x1fa3b9,_0x1ebd38){if(_0x24463c[_0x5c37('0x50')]['id']){delete _0x24463c['body']['id'];}return db[_0x5c37('0x34')]['find']({'where':{'id':_0x24463c[_0x5c37('0x4c')]['id']}})[_0x5c37('0x2a')](handleEntityNotFound(_0x1fa3b9,null))['then'](function(_0x298a7c){if(_0x298a7c){_0x24463c['body'][_0x5c37('0x7c')]=_0x298a7c['id'];_0x24463c[_0x5c37('0x50')][_0x5c37('0x62')]=widgetAttributes(_0x24463c[_0x5c37('0x50')]);return db[_0x5c37('0x7d')][_0x5c37('0x4f')](_0x24463c[_0x5c37('0x50')]);}})[_0x5c37('0x2a')](respondWithResult(_0x1fa3b9,null))[_0x5c37('0x4a')](handleError(_0x1fa3b9,null));};exports[_0x5c37('0x7e')]=function(_0x5827f9,_0x46cf0b,_0x3eefc7){var _0x49a099={};var _0x357f3d={};var _0x112229;var _0x404a18;return db[_0x5c37('0x34')]['findOne']({'where':{'id':_0x5827f9['params']['id']}})[_0x5c37('0x2a')](handleEntityNotFound(_0x46cf0b,null))[_0x5c37('0x2a')](function(_0xecd439){if(_0xecd439){_0x112229=_0xecd439;_0x357f3d[_0x5c37('0x39')]=_[_0x5c37('0x4d')](db[_0x5c37('0x7d')]['rawAttributes']);_0x357f3d['query']=_[_0x5c37('0x4d')](_0x5827f9[_0x5c37('0x3a')]);_0x357f3d['filters']=_[_0x5c37('0x3c')](_0x357f3d[_0x5c37('0x39')],_0x357f3d[_0x5c37('0x3a')]);_0x49a099[_0x5c37('0x3d')]=_[_0x5c37('0x3c')](_0x357f3d[_0x5c37('0x39')],qs[_0x5c37('0x3e')](_0x5827f9['query'][_0x5c37('0x3e')]));_0x49a099[_0x5c37('0x3d')]=_0x49a099[_0x5c37('0x3d')][_0x5c37('0x5a')]?_0x49a099[_0x5c37('0x3d')]:_0x357f3d['model'];_0x49a099[_0x5c37('0x40')]=qs[_0x5c37('0x7f')](_0x5827f9['query'][_0x5c37('0x7f')]);_0x49a099[_0x5c37('0x41')]=qs[_0x5c37('0x3b')](_[_0x5c37('0x42')](_0x5827f9[_0x5c37('0x3a')],_0x357f3d[_0x5c37('0x3b')]));if(_0x5827f9[_0x5c37('0x3a')]['filter']){_0x49a099['where']=_['merge'](_0x49a099[_0x5c37('0x41')],{'$or':_[_0x5c37('0x33')](_0x49a099['attributes'],function(_0x35c771){var _0x3779d6={};_0x3779d6[_0x35c771]={'$like':'%'+_0x5827f9[_0x5c37('0x3a')][_0x5c37('0x43')]+'%'};return _0x3779d6;})});}_0x49a099=_[_0x5c37('0x44')]({},_0x49a099,_0x5827f9[_0x5c37('0x46')]);return _0x112229[_0x5c37('0x7e')](_0x49a099);}})[_0x5c37('0x2a')](function(_0x237225){if(_0x237225){_0x404a18=_0x237225['length'];if(!_0x5827f9[_0x5c37('0x3a')][_0x5c37('0x3f')](_0x5c37('0x80'))){_0x49a099[_0x5c37('0x22')]=qs[_0x5c37('0x22')](_0x5827f9[_0x5c37('0x3a')]['limit']);_0x49a099[_0x5c37('0x21')]=qs[_0x5c37('0x21')](_0x5827f9[_0x5c37('0x3a')][_0x5c37('0x21')]);}return _0x112229[_0x5c37('0x7e')](_0x49a099);}})[_0x5c37('0x2a')](function(_0x41ab19){if(_0x41ab19){return _0x41ab19?{'count':_0x404a18,'rows':_0x41ab19}:null;}})[_0x5c37('0x2a')](respondWithResult(_0x46cf0b,null))[_0x5c37('0x4a')](handleError(_0x46cf0b,null));}; \ No newline at end of file +var _0xd856=['Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','Dashboard','findAll','rows','show','params','find','catch','create','body','user','get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','voice','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','hasOwnProperty','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x367546,_0x5cc53f){var _0x4a5b0b=function(_0xe95e41){while(--_0xe95e41){_0x367546['push'](_0x367546['shift']());}};_0x4a5b0b(++_0x5cc53f);}(_0xd856,0x15c));var _0x6d85=function(_0x282028,_0x151f9a){_0x282028=_0x282028-0x0;var _0x229ff2=_0xd856[_0x282028];return _0x229ff2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d85('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d85('0x1'));var moment=require(_0x6d85('0x2'));var BPromise=require(_0x6d85('0x3'));var Mustache=require(_0x6d85('0x4'));var util=require(_0x6d85('0x5'));var path=require(_0x6d85('0x6'));var sox=require(_0x6d85('0x7'));var csv=require(_0x6d85('0x8'));var ejs=require(_0x6d85('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d85('0xa'));var squel=require(_0x6d85('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d85('0x8'));var querystring=require(_0x6d85('0xc'));var Papa=require('papaparse');var Redis=require(_0x6d85('0xd'));var authService=require(_0x6d85('0xe'));var qs=require(_0x6d85('0xf'));var as=require(_0x6d85('0x10'));var hardwareService=require(_0x6d85('0x11'));var logger=require(_0x6d85('0x12'))(_0x6d85('0x13'));var utils=require('../../config/utils');var config=require(_0x6d85('0x14'));var licenseUtil=require(_0x6d85('0x15'));var db=require(_0x6d85('0x16'))['db'];config[_0x6d85('0x17')]=_['defaults'](config[_0x6d85('0x17')],{'host':_0x6d85('0x18'),'port':0x18eb});var socket=require(_0x6d85('0x19'))(new Redis(config[_0x6d85('0x17')]));require(_0x6d85('0x1a'))['register'](socket);function respondWithStatusCode(_0x48f33c,_0x539b20){_0x539b20=_0x539b20||0xcc;return function(_0x8f4aaa){if(_0x8f4aaa){return _0x48f33c[_0x6d85('0x1b')](_0x539b20);}return _0x48f33c[_0x6d85('0x1c')](_0x539b20)[_0x6d85('0x1d')]();};}function respondWithResult(_0x1dd421,_0x2db2c1){_0x2db2c1=_0x2db2c1||0xc8;return function(_0x141bf6){if(_0x141bf6){return _0x1dd421[_0x6d85('0x1c')](_0x2db2c1)[_0x6d85('0x1e')](_0x141bf6);}};}function respondWithFilteredResult(_0x16fb43,_0x4b261a){return function(_0x304ca9){if(_0x304ca9){var _0x159cc3=typeof _0x4b261a[_0x6d85('0x1f')]===_0x6d85('0x20')&&typeof _0x4b261a[_0x6d85('0x21')]===_0x6d85('0x20');var _0x20fbde=_0x304ca9[_0x6d85('0x22')];var _0x5b6c0c=_0x159cc3?0x0:_0x4b261a['offset'];var _0x421fd5=_0x159cc3?_0x304ca9[_0x6d85('0x22')]:_0x4b261a['offset']+_0x4b261a[_0x6d85('0x21')];var _0x218f4b;if(_0x421fd5>=_0x20fbde){_0x421fd5=_0x20fbde;_0x218f4b=0xc8;}else{_0x218f4b=0xce;}_0x16fb43[_0x6d85('0x1c')](_0x218f4b);return _0x16fb43[_0x6d85('0x23')](_0x6d85('0x24'),_0x5b6c0c+'-'+_0x421fd5+'/'+_0x20fbde)[_0x6d85('0x1e')](_0x304ca9);}return null;};}function patchUpdates(_0x253094){return function(_0x3f9898){try{jsonpatch[_0x6d85('0x25')](_0x3f9898,_0x253094,!![]);}catch(_0x2ef2cc){return BPromise[_0x6d85('0x26')](_0x2ef2cc);}return _0x3f9898[_0x6d85('0x27')]();};}function saveUpdates(_0x4100af,_0x5693a2){return function(_0x57c779){if(_0x57c779){return _0x57c779[_0x6d85('0x28')](_0x4100af)[_0x6d85('0x29')](function(_0xa3061c){return _0xa3061c;});}return null;};}function removeEntity(_0x3b6f7d,_0x221e13){return function(_0xc3743){if(_0xc3743){return _0xc3743[_0x6d85('0x2a')]()['then'](function(){var _0x50aa03=_0xc3743['get']({'plain':!![]});var _0x13fc1c=_0x6d85('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x13fc1c,'resourceId':_0x50aa03['id']}})['then'](function(){return _0xc3743;});})[_0x6d85('0x29')](function(){_0x3b6f7d[_0x6d85('0x1c')](0xcc)[_0x6d85('0x1d')]();});}};}function handleEntityNotFound(_0x240ab8,_0x57820e){return function(_0x3dd511){if(!_0x3dd511){_0x240ab8[_0x6d85('0x1b')](0x194);}return _0x3dd511;};}function handleError(_0x1addd6,_0x17eb01){_0x17eb01=_0x17eb01||0x1f4;return function(_0x506519){logger[_0x6d85('0x2c')](_0x506519['stack']);if(_0x506519[_0x6d85('0x2d')]){delete _0x506519[_0x6d85('0x2d')];}_0x1addd6[_0x6d85('0x1c')](_0x17eb01)['send'](_0x506519);};}exports['index']=function(_0x35c676,_0x3dcaa6){var _0x1b4192={},_0x43e4dc={},_0x4d7fdc={'count':0x0,'rows':[]};var _0x1b5d2a=_[_0x6d85('0x2e')](db['Dashboard'][_0x6d85('0x2f')],function(_0x4507ec){return{'name':_0x4507ec[_0x6d85('0x30')],'type':_0x4507ec[_0x6d85('0x31')]['key']};});_0x43e4dc[_0x6d85('0x32')]=_[_0x6d85('0x2e')](_0x1b5d2a,'name');_0x43e4dc[_0x6d85('0x33')]=_[_0x6d85('0x34')](_0x35c676[_0x6d85('0x33')]);_0x43e4dc[_0x6d85('0x35')]=_['intersection'](_0x43e4dc[_0x6d85('0x32')],_0x43e4dc[_0x6d85('0x33')]);_0x1b4192[_0x6d85('0x36')]=_[_0x6d85('0x37')](_0x43e4dc[_0x6d85('0x32')],qs[_0x6d85('0x38')](_0x35c676[_0x6d85('0x33')]['fields']));_0x1b4192[_0x6d85('0x36')]=_0x1b4192[_0x6d85('0x36')][_0x6d85('0x39')]?_0x1b4192['attributes']:_0x43e4dc[_0x6d85('0x32')];if(!_0x35c676[_0x6d85('0x33')]['hasOwnProperty'](_0x6d85('0x3a'))){_0x1b4192['limit']=qs[_0x6d85('0x21')](_0x35c676[_0x6d85('0x33')][_0x6d85('0x21')]);_0x1b4192[_0x6d85('0x1f')]=qs['offset'](_0x35c676[_0x6d85('0x33')][_0x6d85('0x1f')]);}_0x1b4192[_0x6d85('0x3b')]=qs['sort'](_0x35c676[_0x6d85('0x33')][_0x6d85('0x3c')]);_0x1b4192['where']=qs['filters'](_[_0x6d85('0x3d')](_0x35c676['query'],_0x43e4dc[_0x6d85('0x35')]),_0x1b5d2a);if(_0x35c676['query'][_0x6d85('0x3e')]){_0x1b4192[_0x6d85('0x3f')]=_[_0x6d85('0x40')](_0x1b4192[_0x6d85('0x3f')],{'$or':_[_0x6d85('0x2e')](_0x1b5d2a,function(_0xc0ffc2){if(_0xc0ffc2[_0x6d85('0x31')]!==_0x6d85('0x41')){var _0x25c1e8={};_0x25c1e8[_0xc0ffc2[_0x6d85('0x2d')]]={'$like':'%'+_0x35c676[_0x6d85('0x33')][_0x6d85('0x3e')]+'%'};return _0x25c1e8;}})});}_0x1b4192=_[_0x6d85('0x40')]({},_0x1b4192,_0x35c676[_0x6d85('0x42')]);var _0x33d000={'where':_0x1b4192[_0x6d85('0x3f')]};return db['Dashboard'][_0x6d85('0x22')](_0x33d000)[_0x6d85('0x29')](function(_0x2efeeb){_0x4d7fdc[_0x6d85('0x22')]=_0x2efeeb;if(_0x35c676[_0x6d85('0x33')][_0x6d85('0x43')]){_0x1b4192[_0x6d85('0x44')]=[{'all':!![]}];}return db[_0x6d85('0x45')][_0x6d85('0x46')](_0x1b4192);})['then'](function(_0x28c7e1){_0x4d7fdc[_0x6d85('0x47')]=_0x28c7e1;return _0x4d7fdc;})[_0x6d85('0x29')](respondWithFilteredResult(_0x3dcaa6,_0x1b4192))['catch'](handleError(_0x3dcaa6,null));};exports[_0x6d85('0x48')]=function(_0x37f66d,_0x2fb8b4){var _0x23635c={'raw':![],'where':{'id':_0x37f66d[_0x6d85('0x49')]['id']}},_0x3838bf={};_0x3838bf[_0x6d85('0x32')]=_['keys'](db[_0x6d85('0x45')][_0x6d85('0x2f')]);_0x3838bf['query']=_[_0x6d85('0x34')](_0x37f66d[_0x6d85('0x33')]);_0x3838bf[_0x6d85('0x35')]=_[_0x6d85('0x37')](_0x3838bf['model'],_0x3838bf[_0x6d85('0x33')]);_0x23635c[_0x6d85('0x36')]=_['intersection'](_0x3838bf['model'],qs['fields'](_0x37f66d['query']['fields']));_0x23635c[_0x6d85('0x36')]=_0x23635c[_0x6d85('0x36')][_0x6d85('0x39')]?_0x23635c[_0x6d85('0x36')]:_0x3838bf[_0x6d85('0x32')];if(_0x37f66d[_0x6d85('0x33')][_0x6d85('0x43')]){_0x23635c[_0x6d85('0x44')]=[{'all':!![]}];}_0x23635c=_[_0x6d85('0x40')]({},_0x23635c,_0x37f66d['options']);return db[_0x6d85('0x45')][_0x6d85('0x4a')](_0x23635c)['then'](handleEntityNotFound(_0x2fb8b4,null))['then'](respondWithResult(_0x2fb8b4,null))[_0x6d85('0x4b')](handleError(_0x2fb8b4,null));};exports[_0x6d85('0x4c')]=function(_0x249f9b,_0x5c3106){return db[_0x6d85('0x45')][_0x6d85('0x4c')](_0x249f9b[_0x6d85('0x4d')],{})[_0x6d85('0x29')](function(_0x3d41aa){var _0x1e8e03=_0x249f9b[_0x6d85('0x4e')][_0x6d85('0x4f')]({'plain':!![]});if(!_0x1e8e03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e8e03[_0x6d85('0x50')]==='user'){var _0x3fc3a4=_0x3d41aa[_0x6d85('0x4f')]({'plain':!![]});var _0x380688=_0x6d85('0x2b');return db['UserProfileSection'][_0x6d85('0x4a')]({'where':{'name':_0x380688,'userProfileId':_0x1e8e03[_0x6d85('0x51')]},'raw':!![]})[_0x6d85('0x29')](function(_0x2dc900){if(_0x2dc900&&_0x2dc900[_0x6d85('0x52')]===0x0){return db[_0x6d85('0x53')][_0x6d85('0x4c')]({'name':_0x3fc3a4['name'],'resourceId':_0x3fc3a4['id'],'type':_0x2dc900['name'],'sectionId':_0x2dc900['id']},{})[_0x6d85('0x29')](function(){return _0x3d41aa;});}else{return _0x3d41aa;}})['catch'](function(_0x526899){logger[_0x6d85('0x2c')](_0x6d85('0x54'),_0x526899);throw _0x526899;});}return _0x3d41aa;})['then'](respondWithResult(_0x5c3106,0xc9))[_0x6d85('0x4b')](handleError(_0x5c3106,null));};exports['clone']=function(_0x13d0b8,_0x17eccf){var _0x1db4fb={'where':{'id':_0x13d0b8[_0x6d85('0x49')]['id']}},_0x243885={};_0x243885[_0x6d85('0x32')]=_[_0x6d85('0x34')](db['Dashboard'][_0x6d85('0x2f')]);_0x1db4fb[_0x6d85('0x36')]=_['intersection'](_0x243885[_0x6d85('0x32')],qs[_0x6d85('0x38')](_0x13d0b8['query'][_0x6d85('0x38')]));_0x1db4fb[_0x6d85('0x36')]=_0x1db4fb[_0x6d85('0x36')][_0x6d85('0x39')]?_0x1db4fb[_0x6d85('0x36')]:_0x243885['model'];if(_0x13d0b8[_0x6d85('0x33')][_0x6d85('0x43')]){_0x1db4fb[_0x6d85('0x44')]=[{'all':!![]}];}_0x1db4fb=_[_0x6d85('0x40')]({},_0x1db4fb,_0x13d0b8[_0x6d85('0x42')]);return db[_0x6d85('0x45')][_0x6d85('0x4a')](_0x1db4fb)[_0x6d85('0x29')](handleEntityNotFound(_0x17eccf,null))[_0x6d85('0x29')](function(_0x5587fa){if(_0x5587fa){var _0x164ce8=_0x5587fa[_0x6d85('0x4f')]({'plain':!![]});_0x164ce8=qs[_0x6d85('0x55')](_0x164ce8,['id',_0x6d85('0x56'),'updatedAt']);_0x13d0b8['body']=_['omit'](_0x13d0b8[_0x6d85('0x4d')],['id',_0x6d85('0x56'),_0x6d85('0x57')]);return db[_0x6d85('0x45')]['create'](_[_0x6d85('0x40')](_0x164ce8,_0x13d0b8[_0x6d85('0x4d')]),{'include':_0x13d0b8['query']['includeAll']?[{'all':!![]}]:undefined})[_0x6d85('0x29')](function(_0x470797){var _0x68297e=_0x13d0b8[_0x6d85('0x4e')][_0x6d85('0x4f')]({'plain':!![]});if(!_0x68297e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x68297e[_0x6d85('0x50')]===_0x6d85('0x4e')){var _0x32b6e3=_0x470797[_0x6d85('0x4f')]({'plain':!![]});var _0x35618d=_0x6d85('0x2b');return db[_0x6d85('0x58')]['find']({'where':{'name':_0x35618d,'userProfileId':_0x68297e[_0x6d85('0x51')]},'raw':!![]})[_0x6d85('0x29')](function(_0x3b897a){if(_0x3b897a&&_0x3b897a[_0x6d85('0x52')]===0x0){return db[_0x6d85('0x53')]['create']({'name':_0x32b6e3['name'],'resourceId':_0x32b6e3['id'],'type':_0x3b897a['name'],'sectionId':_0x3b897a['id']},{})[_0x6d85('0x29')](function(){return _0x470797;});}else{return _0x470797;}})['catch'](function(_0x575300){logger[_0x6d85('0x2c')](_0x6d85('0x54'),_0x575300);throw _0x575300;});}return _0x470797;});}})[_0x6d85('0x29')](respondWithResult(_0x17eccf,0xc9))[_0x6d85('0x4b')](handleError(_0x17eccf,null));};exports[_0x6d85('0x28')]=function(_0x57ec23,_0x5ce63e){if(_0x57ec23['body']['id']){delete _0x57ec23['body']['id'];}return db['Dashboard'][_0x6d85('0x4a')]({'where':{'id':_0x57ec23[_0x6d85('0x49')]['id']}})[_0x6d85('0x29')](handleEntityNotFound(_0x5ce63e,null))[_0x6d85('0x29')](saveUpdates(_0x57ec23[_0x6d85('0x4d')],null))[_0x6d85('0x29')](respondWithResult(_0x5ce63e,null))[_0x6d85('0x4b')](handleError(_0x5ce63e,null));};exports[_0x6d85('0x2a')]=function(_0x2e2a28,_0x53c321){return db[_0x6d85('0x45')][_0x6d85('0x4a')]({'where':{'id':_0x2e2a28['params']['id']}})[_0x6d85('0x29')](handleEntityNotFound(_0x53c321,null))[_0x6d85('0x29')](removeEntity(_0x53c321,null))[_0x6d85('0x4b')](handleError(_0x53c321,null));};function widgetAttributes(_0x227b58){try{switch(_0x227b58[_0x6d85('0x31')]){case _0x6d85('0x59'):return[{'name':_0x6d85('0x5a'),'value':_0x227b58[_0x6d85('0x5a')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x0]?_0x227b58[_0x6d85('0x5b')][0x0][_0x6d85('0x5c')]:undefined)||_0x6d85('0x5d')}];case _0x6d85('0x5e'):return[{'name':_0x6d85('0x5f'),'value':_0x227b58[_0x6d85('0x5f')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x0]?_0x227b58[_0x6d85('0x5b')][0x0]['value']:undefined)||''}];case _0x6d85('0x60'):return[{'name':_0x6d85('0x61'),'value':_0x227b58[_0x6d85('0x61')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x0]?_0x227b58[_0x6d85('0x5b')][0x0]['value']:undefined)||_0x6d85('0x62')},{'name':_0x6d85('0x63'),'value':_0x227b58[_0x6d85('0x63')]||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x1]?_0x227b58[_0x6d85('0x5b')][0x1][_0x6d85('0x5c')]:undefined)||_0x6d85('0x64')},{'name':'attrFontSize','value':_0x227b58[_0x6d85('0x65')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x2]?_0x227b58[_0x6d85('0x5b')][0x2][_0x6d85('0x5c')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x227b58[_0x6d85('0x66')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x0]?_0x227b58[_0x6d85('0x5b')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x227b58['attrVoiceQueues']||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x1]?_0x227b58['attrs'][0x1][_0x6d85('0x5c')]:undefined)||[]},{'name':_0x6d85('0x65'),'value':_0x227b58[_0x6d85('0x65')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x2]?_0x227b58['attrs'][0x2][_0x6d85('0x5c')]:undefined)||0x14},{'name':_0x6d85('0x67'),'value':_0x227b58[_0x6d85('0x67')]||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x3]?_0x227b58[_0x6d85('0x5b')][0x3][_0x6d85('0x5c')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x227b58[_0x6d85('0x68')]||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x4]?_0x227b58['attrs'][0x4][_0x6d85('0x5c')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x227b58[_0x6d85('0x69')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x5]?_0x227b58[_0x6d85('0x5b')][0x5]['value']:undefined)||''},{'name':_0x6d85('0x6a'),'value':_0x227b58['attrSmsAccounts']||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x6]?_0x227b58[_0x6d85('0x5b')][0x6][_0x6d85('0x5c')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x227b58[_0x6d85('0x6b')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x7]?_0x227b58[_0x6d85('0x5b')][0x7][_0x6d85('0x5c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x227b58['attrWhatsappAccounts']||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x8]?_0x227b58[_0x6d85('0x5b')][0x8][_0x6d85('0x5c')]:undefined)||''},{'name':'attrChatWebsites','value':_0x227b58[_0x6d85('0x6c')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x9]?_0x227b58['attrs'][0x9][_0x6d85('0x5c')]:undefined)||''}];case _0x6d85('0x6d'):case _0x6d85('0x6e'):return[{'name':_0x6d85('0x6f'),'value':_0x227b58['attrSerie1']||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x0]?_0x227b58[_0x6d85('0x5b')][0x0][_0x6d85('0x5c')]:undefined)||_0x6d85('0x70')},{'name':_0x6d85('0x71'),'value':_0x227b58[_0x6d85('0x71')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x1]?_0x227b58['attrs'][0x1][_0x6d85('0x5c')]:undefined)||null},{'name':_0x6d85('0x72'),'value':_0x227b58['attrSerie3']||(_0x227b58['attrs']&&_0x227b58[_0x6d85('0x5b')][0x2]?_0x227b58[_0x6d85('0x5b')][0x2][_0x6d85('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x227b58[_0x6d85('0x73')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x3]?_0x227b58[_0x6d85('0x5b')][0x3][_0x6d85('0x5c')]:undefined)||[]},{'name':_0x6d85('0x67'),'value':_0x227b58[_0x6d85('0x67')]||(_0x227b58['attrs']&&_0x227b58['attrs'][0x4]?_0x227b58[_0x6d85('0x5b')][0x4][_0x6d85('0x5c')]:undefined)||_0x6d85('0x74')},{'name':'attrEmailAccounts','value':_0x227b58['attrEmailAccounts']||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x5]?_0x227b58[_0x6d85('0x5b')][0x5][_0x6d85('0x5c')]:undefined)||''},{'name':_0x6d85('0x69'),'value':_0x227b58[_0x6d85('0x69')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x6]?_0x227b58['attrs'][0x6][_0x6d85('0x5c')]:undefined)||''},{'name':_0x6d85('0x6a'),'value':_0x227b58[_0x6d85('0x6a')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x7]?_0x227b58[_0x6d85('0x5b')][0x7][_0x6d85('0x5c')]:undefined)||''},{'name':_0x6d85('0x6b'),'value':_0x227b58['attrOpenchannelAccounts']||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x8]?_0x227b58[_0x6d85('0x5b')][0x8]['value']:undefined)||''},{'name':_0x6d85('0x75'),'value':_0x227b58[_0x6d85('0x75')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x9]?_0x227b58['attrs'][0x9][_0x6d85('0x5c')]:undefined)||''},{'name':'attrChatWebsites','value':_0x227b58[_0x6d85('0x6c')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0xa]?_0x227b58[_0x6d85('0x5b')][0xa][_0x6d85('0x5c')]:undefined)||''}];case _0x6d85('0x76'):return[{'name':_0x6d85('0x77'),'type':_0x227b58[_0x6d85('0x78')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x0]?_0x227b58['attrs'][0x0][_0x6d85('0x31')]:undefined)||null,'value':_0x227b58[_0x6d85('0x77')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58['attrs'][0x0]?_0x227b58['attrs'][0x0][_0x6d85('0x5c')]:undefined)||null},{'name':_0x6d85('0x79'),'value':_0x227b58[_0x6d85('0x79')]||(_0x227b58[_0x6d85('0x5b')]&&_0x227b58[_0x6d85('0x5b')][0x1]?_0x227b58[_0x6d85('0x5b')][0x1][_0x6d85('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x22a145){logger[_0x6d85('0x2c')](_0x6d85('0x7a'),JSON[_0x6d85('0x7b')](_0x22a145));return[];}}exports['addItem']=function(_0x58d512,_0x577ea4,_0x3ac6e5){if(_0x58d512[_0x6d85('0x4d')]['id']){delete _0x58d512[_0x6d85('0x4d')]['id'];}return db['Dashboard'][_0x6d85('0x4a')]({'where':{'id':_0x58d512[_0x6d85('0x49')]['id']}})[_0x6d85('0x29')](handleEntityNotFound(_0x577ea4,null))[_0x6d85('0x29')](function(_0x1cf6ca){if(_0x1cf6ca){_0x58d512[_0x6d85('0x4d')]['DashboardId']=_0x1cf6ca['id'];_0x58d512[_0x6d85('0x4d')][_0x6d85('0x5b')]=widgetAttributes(_0x58d512['body']);return db[_0x6d85('0x7c')][_0x6d85('0x4c')](_0x58d512[_0x6d85('0x4d')]);}})['then'](respondWithResult(_0x577ea4,null))[_0x6d85('0x4b')](handleError(_0x577ea4,null));};exports[_0x6d85('0x7d')]=function(_0x5a7dfa,_0x37154b,_0x551d22){var _0x12dcc7={};var _0x329df3={};var _0x364c66;var _0x304c3a;return db[_0x6d85('0x45')][_0x6d85('0x7e')]({'where':{'id':_0x5a7dfa[_0x6d85('0x49')]['id']}})[_0x6d85('0x29')](handleEntityNotFound(_0x37154b,null))['then'](function(_0x2feea){if(_0x2feea){_0x364c66=_0x2feea;_0x329df3[_0x6d85('0x32')]=_[_0x6d85('0x34')](db[_0x6d85('0x7c')][_0x6d85('0x2f')]);_0x329df3[_0x6d85('0x33')]=_[_0x6d85('0x34')](_0x5a7dfa['query']);_0x329df3['filters']=_[_0x6d85('0x37')](_0x329df3[_0x6d85('0x32')],_0x329df3[_0x6d85('0x33')]);_0x12dcc7[_0x6d85('0x36')]=_[_0x6d85('0x37')](_0x329df3[_0x6d85('0x32')],qs[_0x6d85('0x38')](_0x5a7dfa[_0x6d85('0x33')][_0x6d85('0x38')]));_0x12dcc7['attributes']=_0x12dcc7[_0x6d85('0x36')][_0x6d85('0x39')]?_0x12dcc7['attributes']:_0x329df3[_0x6d85('0x32')];_0x12dcc7[_0x6d85('0x3b')]=qs[_0x6d85('0x3c')](_0x5a7dfa['query']['sort']);_0x12dcc7[_0x6d85('0x3f')]=qs[_0x6d85('0x35')](_[_0x6d85('0x3d')](_0x5a7dfa[_0x6d85('0x33')],_0x329df3[_0x6d85('0x35')]));if(_0x5a7dfa[_0x6d85('0x33')][_0x6d85('0x3e')]){_0x12dcc7[_0x6d85('0x3f')]=_[_0x6d85('0x40')](_0x12dcc7['where'],{'$or':_['map'](_0x12dcc7['attributes'],function(_0x3f88d2){var _0x285fee={};_0x285fee[_0x3f88d2]={'$like':'%'+_0x5a7dfa[_0x6d85('0x33')][_0x6d85('0x3e')]+'%'};return _0x285fee;})});}_0x12dcc7=_['merge']({},_0x12dcc7,_0x5a7dfa[_0x6d85('0x42')]);return _0x364c66[_0x6d85('0x7d')](_0x12dcc7);}})[_0x6d85('0x29')](function(_0x13da51){if(_0x13da51){_0x304c3a=_0x13da51['length'];if(!_0x5a7dfa['query'][_0x6d85('0x7f')](_0x6d85('0x3a'))){_0x12dcc7[_0x6d85('0x21')]=qs['limit'](_0x5a7dfa['query']['limit']);_0x12dcc7[_0x6d85('0x1f')]=qs['offset'](_0x5a7dfa[_0x6d85('0x33')]['offset']);}return _0x364c66['getItems'](_0x12dcc7);}})[_0x6d85('0x29')](function(_0x5d156f){if(_0x5d156f){return _0x5d156f?{'count':_0x304c3a,'rows':_0x5d156f}:null;}})[_0x6d85('0x29')](respondWithResult(_0x37154b,null))[_0x6d85('0x4b')](handleError(_0x37154b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 5073af1..fa187d6 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 _0xc1d3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x57c701,_0x18ee4d){var _0xd624f1=function(_0x1231c5){while(--_0x1231c5){_0x57c701['push'](_0x57c701['shift']());}};_0xd624f1(++_0x18ee4d);}(_0xc1d3,0x147));var _0x3c1d=function(_0x505942,_0x1db575){_0x505942=_0x505942-0x0;var _0x5dd4af=_0xc1d3[_0x505942];return _0x5dd4af;};'use strict';var EventEmitter=require(_0x3c1d('0x0'));var Dashboard=require(_0x3c1d('0x1'))['db'][_0x3c1d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3c1d('0x3')](0x0);var events={'afterCreate':_0x3c1d('0x4'),'afterUpdate':_0x3c1d('0x5'),'afterDestroy':_0x3c1d('0x6')};function emitEvent(_0x555102){return function(_0x492440,_0x280eb3,_0x25cdae){DashboardEvents[_0x3c1d('0x7')](_0x555102+':'+_0x492440['id'],_0x492440);DashboardEvents['emit'](_0x555102,_0x492440);_0x25cdae(null);};}for(var e in events){if(events[_0x3c1d('0x8')](e)){var event=events[e];Dashboard[_0x3c1d('0x9')](e,emitEvent(event));}}module[_0x3c1d('0xa')]=DashboardEvents; \ No newline at end of file +var _0x50ed=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xf11a6,_0x4a8abd){var _0xb0a2c4=function(_0x1ff9ab){while(--_0x1ff9ab){_0xf11a6['push'](_0xf11a6['shift']());}};_0xb0a2c4(++_0x4a8abd);}(_0x50ed,0x14a));var _0xd50e=function(_0x1d147b,_0xbe6dfe){_0x1d147b=_0x1d147b-0x0;var _0x1d0ab5=_0x50ed[_0x1d147b];return _0x1d0ab5;};'use strict';var EventEmitter=require(_0xd50e('0x0'));var Dashboard=require(_0xd50e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd50e('0x2')](0x0);var events={'afterCreate':_0xd50e('0x3'),'afterUpdate':_0xd50e('0x4'),'afterDestroy':_0xd50e('0x5')};function emitEvent(_0x5de757){return function(_0x4b1292,_0x3daecc,_0x1a1b59){DashboardEvents[_0xd50e('0x6')](_0x5de757+':'+_0x4b1292['id'],_0x4b1292);DashboardEvents[_0xd50e('0x6')](_0x5de757,_0x4b1292);_0x1a1b59(null);};}for(var e in events){if(events[_0xd50e('0x7')](e)){var event=events[e];Dashboard[_0xd50e('0x8')](e,emitEvent(event));}}module[_0xd50e('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 614787b..df9f011 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 _0xa415=['dashboards','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0xa415,0x121));var _0x5a41=function(_0x626c4b,_0x5becc7){_0x626c4b=_0x626c4b-0x0;var _0x68d101=_0xa415[_0x626c4b];return _0x68d101;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a41('0x0'))(_0x5a41('0x1'));var moment=require(_0x5a41('0x2'));var BPromise=require(_0x5a41('0x3'));var rp=require(_0x5a41('0x4'));var fs=require('fs');var path=require(_0x5a41('0x5'));var rimraf=require(_0x5a41('0x6'));var config=require(_0x5a41('0x7'));var attributes=require(_0x5a41('0x8'));module[_0x5a41('0x9')]=function(_0xac23a2,_0x3fd9f1){return _0xac23a2['define'](_0x5a41('0xa'),attributes,{'tableName':_0x5a41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa93b=['bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x3c85ee,_0x2592d6){var _0x387a45=function(_0x5ef8f0){while(--_0x5ef8f0){_0x3c85ee['push'](_0x3c85ee['shift']());}};_0x387a45(++_0x2592d6);}(_0xa93b,0x105));var _0xba93=function(_0x5220d0,_0x236c9c){_0x5220d0=_0x5220d0-0x0;var _0x3549e1=_0xa93b[_0x5220d0];return _0x3549e1;};'use strict';var _=require(_0xba93('0x0'));var util=require(_0xba93('0x1'));var logger=require(_0xba93('0x2'))(_0xba93('0x3'));var moment=require(_0xba93('0x4'));var BPromise=require(_0xba93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba93('0x6'));var rimraf=require(_0xba93('0x7'));var config=require(_0xba93('0x8'));var attributes=require(_0xba93('0x9'));module[_0xba93('0xa')]=function(_0xa30f93,_0x1a2824){return _0xa30f93[_0xba93('0xb')](_0xba93('0xc'),attributes,{'tableName':_0xba93('0xd'),'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 56c9e6d..4d57d7e 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 _0xbb48=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x29e428,_0x5469a6){var _0xe6ba2f=function(_0x5e95b7){while(--_0x5e95b7){_0x29e428['push'](_0x29e428['shift']());}};_0xe6ba2f(++_0x5469a6);}(_0xbb48,0xbd));var _0x8bb4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbb48[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8bb4('0x0'));var util=require('util');var moment=require(_0x8bb4('0x1'));var BPromise=require(_0x8bb4('0x2'));var rs=require(_0x8bb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bb4('0x4'))['db'];var utils=require(_0x8bb4('0x5'));var logger=require(_0x8bb4('0x6'))(_0x8bb4('0x7'));var config=require(_0x8bb4('0x8'));var jayson=require(_0x8bb4('0x9'));var client=jayson[_0x8bb4('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8bb4('0xb')](config[_0x8bb4('0xc')],{'host':_0x8bb4('0xd'),'port':0x18eb});var socket=require(_0x8bb4('0xe'))(new Redis(config[_0x8bb4('0xc')]));require('./dashboard.socket')[_0x8bb4('0xf')](socket);function respondWithRpcPromise(_0x1e74af,_0x56d6aa,_0x52e8f1){return new BPromise(function(_0x397a19,_0x2e53f5){return client[_0x8bb4('0x10')](_0x1e74af,_0x52e8f1)[_0x8bb4('0x11')](function(_0x2a69f0){logger[_0x8bb4('0x12')](_0x8bb4('0x13'),_0x56d6aa,_0x8bb4('0x14'));logger[_0x8bb4('0x15')](_0x8bb4('0x16'),_0x56d6aa,_0x8bb4('0x14'),JSON['stringify'](_0x2a69f0));if(_0x2a69f0[_0x8bb4('0x17')]){if(_0x2a69f0[_0x8bb4('0x17')][_0x8bb4('0x18')]===0x1f4){logger[_0x8bb4('0x17')](_0x8bb4('0x13'),_0x56d6aa,_0x2a69f0[_0x8bb4('0x17')][_0x8bb4('0x19')]);return _0x2e53f5(_0x2a69f0[_0x8bb4('0x17')]['message']);}logger[_0x8bb4('0x17')](_0x8bb4('0x13'),_0x56d6aa,_0x2a69f0[_0x8bb4('0x17')][_0x8bb4('0x19')]);return _0x397a19(_0x2a69f0[_0x8bb4('0x17')]['message']);}else{logger[_0x8bb4('0x12')](_0x8bb4('0x13'),_0x56d6aa,_0x8bb4('0x14'));_0x397a19(_0x2a69f0[_0x8bb4('0x1a')]['message']);}})[_0x8bb4('0x1b')](function(_0x33d8c0){logger[_0x8bb4('0x17')](_0x8bb4('0x13'),_0x56d6aa,_0x33d8c0);_0x2e53f5(_0x33d8c0);});});} \ No newline at end of file +var _0x7a7b=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0x5343c8,_0x1dfc94){var _0x52259b=function(_0x52d083){while(--_0x52d083){_0x5343c8['push'](_0x5343c8['shift']());}};_0x52259b(++_0x1dfc94);}(_0x7a7b,0x7b));var _0xb7a7=function(_0xf2725b,_0x41557e){_0xf2725b=_0xf2725b-0x0;var _0x560c1b=_0x7a7b[_0xf2725b];return _0x560c1b;};'use strict';var _=require(_0xb7a7('0x0'));var util=require(_0xb7a7('0x1'));var moment=require(_0xb7a7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb7a7('0x3'));var fs=require('fs');var Redis=require(_0xb7a7('0x4'));var db=require(_0xb7a7('0x5'))['db'];var utils=require(_0xb7a7('0x6'));var logger=require(_0xb7a7('0x7'))(_0xb7a7('0x8'));var config=require(_0xb7a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb7a7('0xa')]['http']({'port':0x232a});config[_0xb7a7('0xb')]=_['defaults'](config[_0xb7a7('0xb')],{'host':_0xb7a7('0xc'),'port':0x18eb});var socket=require(_0xb7a7('0xd'))(new Redis(config[_0xb7a7('0xb')]));require(_0xb7a7('0xe'))[_0xb7a7('0xf')](socket);function respondWithRpcPromise(_0x472f96,_0xca8919,_0x51364d){return new BPromise(function(_0x1e2360,_0x5f0111){return client['request'](_0x472f96,_0x51364d)[_0xb7a7('0x10')](function(_0x188107){logger[_0xb7a7('0x11')](_0xb7a7('0x12'),_0xca8919,_0xb7a7('0x13'));logger['debug'](_0xb7a7('0x14'),_0xca8919,_0xb7a7('0x13'),JSON[_0xb7a7('0x15')](_0x188107));if(_0x188107[_0xb7a7('0x16')]){if(_0x188107['error']['code']===0x1f4){logger[_0xb7a7('0x16')]('Dashboard,\x20%s,\x20%s',_0xca8919,_0x188107[_0xb7a7('0x16')]['message']);return _0x5f0111(_0x188107[_0xb7a7('0x16')]['message']);}logger[_0xb7a7('0x16')]('Dashboard,\x20%s,\x20%s',_0xca8919,_0x188107[_0xb7a7('0x16')][_0xb7a7('0x17')]);return _0x1e2360(_0x188107[_0xb7a7('0x16')][_0xb7a7('0x17')]);}else{logger[_0xb7a7('0x11')]('Dashboard,\x20%s,\x20%s',_0xca8919,_0xb7a7('0x13'));_0x1e2360(_0x188107[_0xb7a7('0x18')]['message']);}})['catch'](function(_0xbbd8b7){logger[_0xb7a7('0x16')](_0xb7a7('0x12'),_0xca8919,_0xbbd8b7);_0x5f0111(_0xbbd8b7);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3b4ef0b..c7ca1f3 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 _0xcaec=['remove','update','emit','removeListener','register','./dashboard.events'];(function(_0x8461e0,_0x999f9d){var _0x2a8854=function(_0x51c74a){while(--_0x51c74a){_0x8461e0['push'](_0x8461e0['shift']());}};_0x2a8854(++_0x999f9d);}(_0xcaec,0x173));var _0xccae=function(_0x3fef19,_0x12bd0e){_0x3fef19=_0x3fef19-0x0;var _0x28fe22=_0xcaec[_0x3fef19];return _0x28fe22;};'use strict';var DashboardEvents=require(_0xccae('0x0'));var events=['save',_0xccae('0x1'),_0xccae('0x2')];function createListener(_0x2e4083,_0x1266e8){return function(_0xa84ef8){_0x1266e8[_0xccae('0x3')](_0x2e4083,_0xa84ef8);};}function removeListener(_0x18563f,_0x3a8ae1){return function(){DashboardEvents[_0xccae('0x4')](_0x18563f,_0x3a8ae1);};}exports[_0xccae('0x5')]=function(_0x401ecd){for(var _0x48d2e9=0x0,_0x5e7e01=events['length'];_0x48d2e9<_0x5e7e01;_0x48d2e9++){var _0x5815f9=events[_0x48d2e9];var _0x28c74a=createListener('dashboard:'+_0x5815f9,_0x401ecd);DashboardEvents['on'](_0x5815f9,_0x28c74a);}}; \ No newline at end of file +var _0xe0c2=['removeListener','dashboard:','./dashboard.events','save','update','emit'];(function(_0x22e690,_0x5f570e){var _0x2b515f=function(_0x2bd741){while(--_0x2bd741){_0x22e690['push'](_0x22e690['shift']());}};_0x2b515f(++_0x5f570e);}(_0xe0c2,0x1ac));var _0x2e0c=function(_0x36aa79,_0x13d6f4){_0x36aa79=_0x36aa79-0x0;var _0x53c302=_0xe0c2[_0x36aa79];return _0x53c302;};'use strict';var DashboardEvents=require(_0x2e0c('0x0'));var events=[_0x2e0c('0x1'),'remove',_0x2e0c('0x2')];function createListener(_0x505df3,_0x5dccc8){return function(_0x5c305e){_0x5dccc8[_0x2e0c('0x3')](_0x505df3,_0x5c305e);};}function removeListener(_0x5d34dc,_0xb4f6c7){return function(){DashboardEvents[_0x2e0c('0x4')](_0x5d34dc,_0xb4f6c7);};}exports['register']=function(_0x3e698c){for(var _0x1faaf3=0x0,_0x7c6c3d=events['length'];_0x1faaf3<_0x7c6c3d;_0x1faaf3++){var _0x5d2a15=events[_0x1faaf3];var _0x15508f=createListener(_0x2e0c('0x5')+_0x5d2a15,_0x3e698c);DashboardEvents['on'](_0x5d2a15,_0x15508f);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8ff0cff..810a8cc 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 _0xec9d=['./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','addItem','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xec9d,0x76));var _0xdec9=function(_0xd9b032,_0x37af18){_0xd9b032=_0xd9b032-0x0;var _0x550b42=_0xec9d[_0xd9b032];return _0x550b42;};'use strict';var multer=require('multer');var util=require(_0xdec9('0x0'));var path=require(_0xdec9('0x1'));var timeout=require(_0xdec9('0x2'));var express=require(_0xdec9('0x3'));var router=express[_0xdec9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdec9('0x5'));var interaction=require(_0xdec9('0x6'));var config=require(_0xdec9('0x7'));var controller=require(_0xdec9('0x8'));router[_0xdec9('0x9')]('/',auth[_0xdec9('0xa')](),controller[_0xdec9('0xb')]);router[_0xdec9('0x9')](_0xdec9('0xc'),auth[_0xdec9('0xa')](),controller[_0xdec9('0xd')]);router[_0xdec9('0x9')](_0xdec9('0xe'),auth[_0xdec9('0xa')](),controller[_0xdec9('0xf')]);router[_0xdec9('0x10')]('/',auth[_0xdec9('0xa')](),controller[_0xdec9('0x11')]);router[_0xdec9('0x10')](_0xdec9('0x12'),auth[_0xdec9('0xa')](),controller['clone']);router[_0xdec9('0x10')](_0xdec9('0xe'),auth[_0xdec9('0xa')](),controller[_0xdec9('0x13')]);router['put'](_0xdec9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xdec9('0x14')](_0xdec9('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfe4a=['addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','clone'];(function(_0x9f6e5a,_0x596878){var _0x3f7958=function(_0x11744c){while(--_0x11744c){_0x9f6e5a['push'](_0x9f6e5a['shift']());}};_0x3f7958(++_0x596878);}(_0xfe4a,0xbc));var _0xafe4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xfe4a[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xafe4('0x0'));var util=require(_0xafe4('0x1'));var path=require(_0xafe4('0x2'));var timeout=require(_0xafe4('0x3'));var express=require(_0xafe4('0x4'));var router=express[_0xafe4('0x5')]();var fs_extra=require(_0xafe4('0x6'));var auth=require(_0xafe4('0x7'));var interaction=require(_0xafe4('0x8'));var config=require('../../config/environment');var controller=require(_0xafe4('0x9'));router[_0xafe4('0xa')]('/',auth[_0xafe4('0xb')](),controller[_0xafe4('0xc')]);router[_0xafe4('0xa')](_0xafe4('0xd'),auth[_0xafe4('0xb')](),controller[_0xafe4('0xe')]);router[_0xafe4('0xa')](_0xafe4('0xf'),auth[_0xafe4('0xb')](),controller['getItems']);router[_0xafe4('0x10')]('/',auth[_0xafe4('0xb')](),controller[_0xafe4('0x11')]);router[_0xafe4('0x10')](_0xafe4('0x12'),auth['isAuthenticated'](),controller[_0xafe4('0x13')]);router['post'](_0xafe4('0xf'),auth[_0xafe4('0xb')](),controller[_0xafe4('0x14')]);router[_0xafe4('0x15')](_0xafe4('0xd'),auth[_0xafe4('0xb')](),controller[_0xafe4('0x16')]);router[_0xafe4('0x17')](_0xafe4('0xd'),auth[_0xafe4('0xb')](),controller[_0xafe4('0x18')]);module[_0xafe4('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 52e1fdf..147d9b4 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 _0x2eb2=['STRING','TEXT','parse','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','lodash','exports'];(function(_0x966c03,_0x283d91){var _0x419b38=function(_0x3d755a){while(--_0x3d755a){_0x966c03['push'](_0x966c03['shift']());}};_0x419b38(++_0x283d91);}(_0x2eb2,0x19f));var _0x22eb=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x2eb2[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));module[_0x22eb('0x2')]={'title':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x22eb('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x22eb('0x4')]('long'),'get':function(){try{return JSON[_0x22eb('0x5')](this['getDataValue']('attrs'));}catch(_0x1dfef7){return[];}},'set':function(_0x10e116){try{this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')](_0x10e116));}catch(_0x396806){this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x22eb('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x22eb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x22eb('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xfdbd[_0x33c9f8];return _0x2d7004;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 1164141..a80b904 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 _0x287e=['attrEmailAccounts','web-report','attrReport','attrRefresh','error','widgetAttributes:\x20%s','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','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','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','stack','name','show','params','model','DashboardItem','rawAttributes','query','keys','filters','attributes','fields','length','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x133f4c,_0x1ab854){var _0x5de610=function(_0x55bcff){while(--_0x55bcff){_0x133f4c['push'](_0x133f4c['shift']());}};_0x5de610(++_0x1ab854);}(_0x287e,0x1e3));var _0xe287=function(_0x163856,_0x541e5f){_0x163856=_0x163856-0x0;var _0x40742d=_0x287e[_0x163856];return _0x40742d;};'use strict';var emlformat=require(_0xe287('0x0'));var rimraf=require(_0xe287('0x1'));var zipdir=require(_0xe287('0x2'));var jsonpatch=require(_0xe287('0x3'));var rp=require(_0xe287('0x4'));var moment=require(_0xe287('0x5'));var BPromise=require(_0xe287('0x6'));var Mustache=require(_0xe287('0x7'));var util=require(_0xe287('0x8'));var path=require('path');var sox=require(_0xe287('0x9'));var csv=require(_0xe287('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe287('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe287('0xc'));var toCsv=require(_0xe287('0xa'));var querystring=require(_0xe287('0xd'));var Papa=require(_0xe287('0xe'));var Redis=require(_0xe287('0xf'));var authService=require(_0xe287('0x10'));var qs=require(_0xe287('0x11'));var as=require(_0xe287('0x12'));var hardwareService=require(_0xe287('0x13'));var logger=require(_0xe287('0x14'))(_0xe287('0x15'));var utils=require(_0xe287('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe287('0x17'));var db=require('../../mysqldb')['db'];config[_0xe287('0x18')]=_['defaults'](config[_0xe287('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe287('0x19'))(new Redis(config[_0xe287('0x18')]));require(_0xe287('0x1a'))[_0xe287('0x1b')](socket);function respondWithStatusCode(_0x279281,_0x497f73){_0x497f73=_0x497f73||0xcc;return function(_0x298641){if(_0x298641){return _0x279281['sendStatus'](_0x497f73);}return _0x279281[_0xe287('0x1c')](_0x497f73)[_0xe287('0x1d')]();};}function respondWithResult(_0x5c1dea,_0x336ff3){_0x336ff3=_0x336ff3||0xc8;return function(_0x5053e0){if(_0x5053e0){return _0x5c1dea['status'](_0x336ff3)[_0xe287('0x1e')](_0x5053e0);}};}function respondWithFilteredResult(_0x31370b,_0x2f27a5){return function(_0x5ece64){if(_0x5ece64){var _0x2c4ef3=typeof _0x2f27a5['offset']==='undefined'&&typeof _0x2f27a5[_0xe287('0x1f')]===_0xe287('0x20');var _0x58ca20=_0x5ece64[_0xe287('0x21')];var _0x509877=_0x2c4ef3?0x0:_0x2f27a5[_0xe287('0x22')];var _0x219b2f=_0x2c4ef3?_0x5ece64[_0xe287('0x21')]:_0x2f27a5['offset']+_0x2f27a5[_0xe287('0x1f')];var _0x477a45;if(_0x219b2f>=_0x58ca20){_0x219b2f=_0x58ca20;_0x477a45=0xc8;}else{_0x477a45=0xce;}_0x31370b[_0xe287('0x1c')](_0x477a45);return _0x31370b[_0xe287('0x23')](_0xe287('0x24'),_0x509877+'-'+_0x219b2f+'/'+_0x58ca20)[_0xe287('0x1e')](_0x5ece64);}return null;};}function patchUpdates(_0x3e971a){return function(_0x496076){try{jsonpatch['apply'](_0x496076,_0x3e971a,!![]);}catch(_0x41288c){return BPromise[_0xe287('0x25')](_0x41288c);}return _0x496076['save']();};}function saveUpdates(_0x76665f,_0x4da623){return function(_0x1d5e88){if(_0x1d5e88){return _0x1d5e88[_0xe287('0x26')](_0x76665f)[_0xe287('0x27')](function(_0x4ff2ee){return _0x4ff2ee;});}return null;};}function removeEntity(_0x58f4f1,_0x21b1aa){return function(_0x244e8a){if(_0x244e8a){return _0x244e8a[_0xe287('0x28')]()[_0xe287('0x27')](function(){_0x58f4f1[_0xe287('0x1c')](0xcc)[_0xe287('0x1d')]();});}};}function handleEntityNotFound(_0x34549e,_0x17fda2){return function(_0x55c97a){if(!_0x55c97a){_0x34549e[_0xe287('0x29')](0x194);}return _0x55c97a;};}function handleError(_0x5499e2,_0x34d583){_0x34d583=_0x34d583||0x1f4;return function(_0x220175){logger['error'](_0x220175[_0xe287('0x2a')]);if(_0x220175[_0xe287('0x2b')]){delete _0x220175[_0xe287('0x2b')];}_0x5499e2[_0xe287('0x1c')](_0x34d583)['send'](_0x220175);};}exports[_0xe287('0x2c')]=function(_0x7e8dd8,_0x46e4e4){var _0x5c93b8={'raw':![],'where':{'id':_0x7e8dd8[_0xe287('0x2d')]['id']}},_0x811e53={};_0x811e53[_0xe287('0x2e')]=_['keys'](db[_0xe287('0x2f')][_0xe287('0x30')]);_0x811e53[_0xe287('0x31')]=_[_0xe287('0x32')](_0x7e8dd8[_0xe287('0x31')]);_0x811e53[_0xe287('0x33')]=_['intersection'](_0x811e53[_0xe287('0x2e')],_0x811e53['query']);_0x5c93b8[_0xe287('0x34')]=_['intersection'](_0x811e53[_0xe287('0x2e')],qs[_0xe287('0x35')](_0x7e8dd8[_0xe287('0x31')][_0xe287('0x35')]));_0x5c93b8['attributes']=_0x5c93b8['attributes'][_0xe287('0x36')]?_0x5c93b8[_0xe287('0x34')]:_0x811e53['model'];if(_0x7e8dd8['query']['includeAll']){_0x5c93b8['include']=[{'all':!![]}];}_0x5c93b8=_['merge']({},_0x5c93b8,_0x7e8dd8[_0xe287('0x37')]);return db[_0xe287('0x2f')][_0xe287('0x38')](_0x5c93b8)[_0xe287('0x27')](handleEntityNotFound(_0x46e4e4,null))[_0xe287('0x27')](respondWithResult(_0x46e4e4,null))[_0xe287('0x39')](handleError(_0x46e4e4,null));};exports['destroy']=function(_0x39741f,_0x444b87){return db[_0xe287('0x2f')]['find']({'where':{'id':_0x39741f[_0xe287('0x2d')]['id']}})[_0xe287('0x27')](handleEntityNotFound(_0x444b87,null))[_0xe287('0x27')](removeEntity(_0x444b87,null))[_0xe287('0x39')](handleError(_0x444b87,null));};function widgetAttributes(_0x49d930){try{switch(_0x49d930[_0xe287('0x3a')]){case _0xe287('0x3b'):return[{'name':_0xe287('0x3c'),'value':_0x49d930[_0xe287('0x3c')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0][_0xe287('0x3e')]:undefined)||_0xe287('0x3f')}];case _0xe287('0x40'):return[{'name':_0xe287('0x41'),'value':_0x49d930[_0xe287('0x41')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0]['value']:undefined)||''}];case _0xe287('0x42'):return[{'name':'attrHourFormat','value':_0x49d930[_0xe287('0x43')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0][_0xe287('0x3e')]:undefined)||_0xe287('0x44')},{'name':_0xe287('0x45'),'value':_0x49d930[_0xe287('0x45')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x1]?_0x49d930[_0xe287('0x3d')][0x1][_0xe287('0x3e')]:undefined)||_0xe287('0x46')},{'name':_0xe287('0x47'),'value':_0x49d930['attrFontSize']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x2]?_0x49d930[_0xe287('0x3d')][0x2][_0xe287('0x3e')]:undefined)||0xc}];case'counter':return[{'name':_0xe287('0x48'),'value':_0x49d930[_0xe287('0x48')]||(_0x49d930['attrs']&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0][_0xe287('0x3e')]:undefined)||_0xe287('0x49')},{'name':_0xe287('0x4a'),'value':_0x49d930[_0xe287('0x4a')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x1]?_0x49d930[_0xe287('0x3d')][0x1][_0xe287('0x3e')]:undefined)||[]},{'name':_0xe287('0x47'),'value':_0x49d930[_0xe287('0x47')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x2]?_0x49d930[_0xe287('0x3d')][0x2][_0xe287('0x3e')]:undefined)||0x14},{'name':_0xe287('0x4b'),'value':_0x49d930[_0xe287('0x4b')]||(_0x49d930['attrs']&&_0x49d930['attrs'][0x3]?_0x49d930[_0xe287('0x3d')][0x3][_0xe287('0x3e')]:undefined)||_0xe287('0x4c')},{'name':'attrEmailAccounts','value':_0x49d930['attrEmailAccounts']||(_0x49d930['attrs']&&_0x49d930['attrs'][0x4]?_0x49d930[_0xe287('0x3d')][0x4][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x4d'),'value':_0x49d930[_0xe287('0x4d')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x5]?_0x49d930[_0xe287('0x3d')][0x5][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x4e'),'value':_0x49d930[_0xe287('0x4e')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x6]?_0x49d930['attrs'][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x49d930[_0xe287('0x4f')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x7]?_0x49d930['attrs'][0x7][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x50'),'value':_0x49d930[_0xe287('0x50')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x8]?_0x49d930[_0xe287('0x3d')][0x8][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x51'),'value':_0x49d930['attrChatWebsites']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x9]?_0x49d930[_0xe287('0x3d')][0x9][_0xe287('0x3e')]:undefined)||''}];case _0xe287('0x52'):case _0xe287('0x53'):return[{'name':_0xe287('0x54'),'value':_0x49d930[_0xe287('0x54')]||(_0x49d930['attrs']&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0][_0xe287('0x3e')]:undefined)||_0xe287('0x49')},{'name':_0xe287('0x55'),'value':_0x49d930['attrSerie2']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x1]?_0x49d930['attrs'][0x1][_0xe287('0x3e')]:undefined)||null},{'name':_0xe287('0x56'),'value':_0x49d930[_0xe287('0x56')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x2]?_0x49d930['attrs'][0x2][_0xe287('0x3e')]:undefined)||null},{'name':_0xe287('0x4a'),'value':_0x49d930[_0xe287('0x4a')]||(_0x49d930['attrs']&&_0x49d930[_0xe287('0x3d')][0x3]?_0x49d930['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x49d930['attrChannel']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x4]?_0x49d930[_0xe287('0x3d')][0x4][_0xe287('0x3e')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x49d930[_0xe287('0x57')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x5]?_0x49d930[_0xe287('0x3d')][0x5][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x4d'),'value':_0x49d930[_0xe287('0x4d')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x6]?_0x49d930[_0xe287('0x3d')][0x6]['value']:undefined)||''},{'name':_0xe287('0x4e'),'value':_0x49d930[_0xe287('0x4e')]||(_0x49d930['attrs']&&_0x49d930['attrs'][0x7]?_0x49d930[_0xe287('0x3d')][0x7][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x4f'),'value':_0x49d930['attrOpenchannelAccounts']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x8]?_0x49d930['attrs'][0x8][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x50'),'value':_0x49d930[_0xe287('0x50')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x9]?_0x49d930[_0xe287('0x3d')][0x9][_0xe287('0x3e')]:undefined)||''},{'name':_0xe287('0x51'),'value':_0x49d930['attrChatWebsites']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0xa]?_0x49d930[_0xe287('0x3d')][0xa]['value']:undefined)||''}];case _0xe287('0x58'):return[{'name':_0xe287('0x59'),'type':_0x49d930['reportType']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x0]?_0x49d930[_0xe287('0x3d')][0x0][_0xe287('0x3a')]:undefined)||null,'value':_0x49d930[_0xe287('0x59')]||(_0x49d930[_0xe287('0x3d')]&&_0x49d930[_0xe287('0x3d')][0x0]?_0x49d930[_0xe287('0x3d')][0x0]['value']:undefined)||null},{'name':_0xe287('0x5a'),'value':_0x49d930['attrRefresh']||(_0x49d930[_0xe287('0x3d')]&&_0x49d930['attrs'][0x1]?_0x49d930['attrs'][0x1][_0xe287('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x585f9d){logger[_0xe287('0x5b')](_0xe287('0x5c'),JSON['stringify'](_0x585f9d));return[];}}exports['create']=function(_0x3eafd2,_0x5311ac){if(_0x3eafd2[_0xe287('0x5d')]){_0x3eafd2[_0xe287('0x5d')][_0xe287('0x3d')]=widgetAttributes(_0x3eafd2[_0xe287('0x5d')]);}return db[_0xe287('0x2f')][_0xe287('0x5e')](_0x3eafd2[_0xe287('0x5d')],{})['then'](respondWithResult(_0x5311ac,0xc9))[_0xe287('0x39')](handleError(_0x5311ac,null));};exports['update']=function(_0xe461e9,_0xf0a628){if(_0xe461e9[_0xe287('0x5d')]['id']){delete _0xe461e9[_0xe287('0x5d')]['id'];}_0xe461e9[_0xe287('0x5d')][_0xe287('0x3d')]=widgetAttributes(_0xe461e9[_0xe287('0x5d')]);return db[_0xe287('0x2f')][_0xe287('0x38')]({'where':{'id':_0xe461e9[_0xe287('0x2d')]['id']}})[_0xe287('0x27')](handleEntityNotFound(_0xf0a628,null))['then'](saveUpdates(_0xe461e9[_0xe287('0x5d')],null))[_0xe287('0x27')](respondWithResult(_0xf0a628,null))[_0xe287('0x39')](handleError(_0xf0a628,null));}; \ No newline at end of file +var _0xb145=['localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','name','show','model','keys','query','intersection','attributes','fields','include','options','DashboardItem','find','params','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x440c5e,_0x3df543){var _0x2f2c1a=function(_0x3728f9){while(--_0x3728f9){_0x440c5e['push'](_0x440c5e['shift']());}};_0x2f2c1a(++_0x3df543);}(_0xb145,0xa3));var _0x5b14=function(_0x6f855d,_0x1b5b1a){_0x6f855d=_0x6f855d-0x0;var _0x238111=_0xb145[_0x6f855d];return _0x238111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];config[_0x5b14('0x19')]=_[_0x5b14('0x1a')](config[_0x5b14('0x19')],{'host':_0x5b14('0x1b'),'port':0x18eb});var socket=require(_0x5b14('0x1c'))(new Redis(config['redis']));require(_0x5b14('0x1d'))[_0x5b14('0x1e')](socket);function respondWithStatusCode(_0x35fb8b,_0x1dfa26){_0x1dfa26=_0x1dfa26||0xcc;return function(_0xba7e13){if(_0xba7e13){return _0x35fb8b[_0x5b14('0x1f')](_0x1dfa26);}return _0x35fb8b[_0x5b14('0x20')](_0x1dfa26)[_0x5b14('0x21')]();};}function respondWithResult(_0x183b0a,_0x287bb7){_0x287bb7=_0x287bb7||0xc8;return function(_0x221344){if(_0x221344){return _0x183b0a[_0x5b14('0x20')](_0x287bb7)['json'](_0x221344);}};}function respondWithFilteredResult(_0x24cfd0,_0x50866a){return function(_0x48d395){if(_0x48d395){var _0x58bf3c=typeof _0x50866a[_0x5b14('0x22')]===_0x5b14('0x23')&&typeof _0x50866a[_0x5b14('0x24')]===_0x5b14('0x23');var _0x3786f7=_0x48d395[_0x5b14('0x25')];var _0x19e6f8=_0x58bf3c?0x0:_0x50866a['offset'];var _0x525176=_0x58bf3c?_0x48d395['count']:_0x50866a[_0x5b14('0x22')]+_0x50866a[_0x5b14('0x24')];var _0x9a9495;if(_0x525176>=_0x3786f7){_0x525176=_0x3786f7;_0x9a9495=0xc8;}else{_0x9a9495=0xce;}_0x24cfd0[_0x5b14('0x20')](_0x9a9495);return _0x24cfd0['set'](_0x5b14('0x26'),_0x19e6f8+'-'+_0x525176+'/'+_0x3786f7)[_0x5b14('0x27')](_0x48d395);}return null;};}function patchUpdates(_0x4857c7){return function(_0x2d7b38){try{jsonpatch[_0x5b14('0x28')](_0x2d7b38,_0x4857c7,!![]);}catch(_0x50951f){return BPromise[_0x5b14('0x29')](_0x50951f);}return _0x2d7b38['save']();};}function saveUpdates(_0x59282c,_0x5e0780){return function(_0x4def4b){if(_0x4def4b){return _0x4def4b[_0x5b14('0x2a')](_0x59282c)[_0x5b14('0x2b')](function(_0x153a25){return _0x153a25;});}return null;};}function removeEntity(_0x5da505,_0x46f86a){return function(_0x3bf8e5){if(_0x3bf8e5){return _0x3bf8e5[_0x5b14('0x2c')]()[_0x5b14('0x2b')](function(){_0x5da505[_0x5b14('0x20')](0xcc)[_0x5b14('0x21')]();});}};}function handleEntityNotFound(_0x422d22,_0x205842){return function(_0x296d65){if(!_0x296d65){_0x422d22[_0x5b14('0x1f')](0x194);}return _0x296d65;};}function handleError(_0xbe39bc,_0x1ab33f){_0x1ab33f=_0x1ab33f||0x1f4;return function(_0x1c3c52){logger[_0x5b14('0x2d')](_0x1c3c52['stack']);if(_0x1c3c52[_0x5b14('0x2e')]){delete _0x1c3c52[_0x5b14('0x2e')];}_0xbe39bc['status'](_0x1ab33f)['send'](_0x1c3c52);};}exports[_0x5b14('0x2f')]=function(_0x3fb23b,_0x5dca4f){var _0x4c1f0e={'raw':![],'where':{'id':_0x3fb23b['params']['id']}},_0x21b43b={};_0x21b43b[_0x5b14('0x30')]=_[_0x5b14('0x31')](db['DashboardItem']['rawAttributes']);_0x21b43b[_0x5b14('0x32')]=_[_0x5b14('0x31')](_0x3fb23b[_0x5b14('0x32')]);_0x21b43b['filters']=_[_0x5b14('0x33')](_0x21b43b['model'],_0x21b43b[_0x5b14('0x32')]);_0x4c1f0e[_0x5b14('0x34')]=_[_0x5b14('0x33')](_0x21b43b[_0x5b14('0x30')],qs['fields'](_0x3fb23b[_0x5b14('0x32')][_0x5b14('0x35')]));_0x4c1f0e[_0x5b14('0x34')]=_0x4c1f0e[_0x5b14('0x34')]['length']?_0x4c1f0e[_0x5b14('0x34')]:_0x21b43b[_0x5b14('0x30')];if(_0x3fb23b[_0x5b14('0x32')]['includeAll']){_0x4c1f0e[_0x5b14('0x36')]=[{'all':!![]}];}_0x4c1f0e=_['merge']({},_0x4c1f0e,_0x3fb23b[_0x5b14('0x37')]);return db[_0x5b14('0x38')]['find'](_0x4c1f0e)[_0x5b14('0x2b')](handleEntityNotFound(_0x5dca4f,null))[_0x5b14('0x2b')](respondWithResult(_0x5dca4f,null))['catch'](handleError(_0x5dca4f,null));};exports[_0x5b14('0x2c')]=function(_0x53e829,_0x1ce6bb){return db[_0x5b14('0x38')][_0x5b14('0x39')]({'where':{'id':_0x53e829[_0x5b14('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1ce6bb,null))[_0x5b14('0x2b')](removeEntity(_0x1ce6bb,null))[_0x5b14('0x3b')](handleError(_0x1ce6bb,null));};function widgetAttributes(_0x15d4c4){try{switch(_0x15d4c4[_0x5b14('0x3c')]){case _0x5b14('0x3d'):return[{'name':_0x5b14('0x3e'),'value':_0x15d4c4[_0x5b14('0x3e')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0][_0x5b14('0x40')]:undefined)||_0x5b14('0x41')}];case _0x5b14('0x42'):return[{'name':_0x5b14('0x43'),'value':_0x15d4c4[_0x5b14('0x43')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4['attrs'][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0]['value']:undefined)||''}];case _0x5b14('0x44'):return[{'name':_0x5b14('0x45'),'value':_0x15d4c4['attrHourFormat']||(_0x15d4c4['attrs']&&_0x15d4c4['attrs'][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0][_0x5b14('0x40')]:undefined)||'HH:mm:ss'},{'name':_0x5b14('0x46'),'value':_0x15d4c4[_0x5b14('0x46')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x1]?_0x15d4c4[_0x5b14('0x3f')][0x1]['value']:undefined)||_0x5b14('0x47')},{'name':_0x5b14('0x48'),'value':_0x15d4c4['attrFontSize']||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x2]?_0x15d4c4[_0x5b14('0x3f')][0x2][_0x5b14('0x40')]:undefined)||0xc}];case'counter':return[{'name':_0x5b14('0x49'),'value':_0x15d4c4[_0x5b14('0x49')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x0]?_0x15d4c4['attrs'][0x0][_0x5b14('0x40')]:undefined)||_0x5b14('0x4a')},{'name':_0x5b14('0x4b'),'value':_0x15d4c4[_0x5b14('0x4b')]||(_0x15d4c4['attrs']&&_0x15d4c4['attrs'][0x1]?_0x15d4c4[_0x5b14('0x3f')][0x1][_0x5b14('0x40')]:undefined)||[]},{'name':'attrFontSize','value':_0x15d4c4[_0x5b14('0x48')]||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x2]?_0x15d4c4[_0x5b14('0x3f')][0x2][_0x5b14('0x40')]:undefined)||0x14},{'name':_0x5b14('0x4c'),'value':_0x15d4c4[_0x5b14('0x4c')]||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x3]?_0x15d4c4[_0x5b14('0x3f')][0x3][_0x5b14('0x40')]:undefined)||_0x5b14('0x4d')},{'name':_0x5b14('0x4e'),'value':_0x15d4c4['attrEmailAccounts']||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x4]?_0x15d4c4['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x15d4c4[_0x5b14('0x4f')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x5]?_0x15d4c4[_0x5b14('0x3f')][0x5][_0x5b14('0x40')]:undefined)||''},{'name':_0x5b14('0x50'),'value':_0x15d4c4[_0x5b14('0x50')]||(_0x15d4c4['attrs']&&_0x15d4c4['attrs'][0x6]?_0x15d4c4['attrs'][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x15d4c4[_0x5b14('0x51')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x7]?_0x15d4c4[_0x5b14('0x3f')][0x7][_0x5b14('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x15d4c4['attrWhatsappAccounts']||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x8]?_0x15d4c4['attrs'][0x8][_0x5b14('0x40')]:undefined)||''},{'name':_0x5b14('0x52'),'value':_0x15d4c4['attrChatWebsites']||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x9]?_0x15d4c4[_0x5b14('0x3f')][0x9][_0x5b14('0x40')]:undefined)||''}];case'multibar-chart':case _0x5b14('0x53'):return[{'name':_0x5b14('0x54'),'value':_0x15d4c4[_0x5b14('0x54')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0][_0x5b14('0x40')]:undefined)||'total'},{'name':_0x5b14('0x55'),'value':_0x15d4c4['attrSerie2']||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x1]?_0x15d4c4[_0x5b14('0x3f')][0x1][_0x5b14('0x40')]:undefined)||null},{'name':_0x5b14('0x56'),'value':_0x15d4c4[_0x5b14('0x56')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x2]?_0x15d4c4[_0x5b14('0x3f')][0x2][_0x5b14('0x40')]:undefined)||null},{'name':_0x5b14('0x4b'),'value':_0x15d4c4[_0x5b14('0x4b')]||(_0x15d4c4['attrs']&&_0x15d4c4['attrs'][0x3]?_0x15d4c4['attrs'][0x3][_0x5b14('0x40')]:undefined)||[]},{'name':_0x5b14('0x4c'),'value':_0x15d4c4[_0x5b14('0x4c')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x4]?_0x15d4c4[_0x5b14('0x3f')][0x4][_0x5b14('0x40')]:undefined)||'voice'},{'name':_0x5b14('0x4e'),'value':_0x15d4c4[_0x5b14('0x4e')]||(_0x15d4c4['attrs']&&_0x15d4c4['attrs'][0x5]?_0x15d4c4[_0x5b14('0x3f')][0x5][_0x5b14('0x40')]:undefined)||''},{'name':_0x5b14('0x4f'),'value':_0x15d4c4[_0x5b14('0x4f')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x6]?_0x15d4c4['attrs'][0x6][_0x5b14('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x15d4c4[_0x5b14('0x50')]||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x7]?_0x15d4c4[_0x5b14('0x3f')][0x7][_0x5b14('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x15d4c4[_0x5b14('0x51')]||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x8]?_0x15d4c4[_0x5b14('0x3f')][0x8][_0x5b14('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x15d4c4[_0x5b14('0x57')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x9]?_0x15d4c4[_0x5b14('0x3f')][0x9]['value']:undefined)||''},{'name':_0x5b14('0x52'),'value':_0x15d4c4['attrChatWebsites']||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0xa]?_0x15d4c4['attrs'][0xa]['value']:undefined)||''}];case _0x5b14('0x58'):return[{'name':_0x5b14('0x59'),'type':_0x15d4c4[_0x5b14('0x5a')]||(_0x15d4c4['attrs']&&_0x15d4c4[_0x5b14('0x3f')][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0]['type']:undefined)||null,'value':_0x15d4c4[_0x5b14('0x59')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4[_0x5b14('0x3f')][0x0]?_0x15d4c4[_0x5b14('0x3f')][0x0][_0x5b14('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x15d4c4[_0x5b14('0x5b')]||(_0x15d4c4[_0x5b14('0x3f')]&&_0x15d4c4['attrs'][0x1]?_0x15d4c4['attrs'][0x1][_0x5b14('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x1b25e1){logger['error']('widgetAttributes:\x20%s',JSON[_0x5b14('0x5c')](_0x1b25e1));return[];}}exports[_0x5b14('0x5d')]=function(_0x327b7e,_0x5b4831){if(_0x327b7e[_0x5b14('0x5e')]){_0x327b7e[_0x5b14('0x5e')][_0x5b14('0x3f')]=widgetAttributes(_0x327b7e['body']);}return db[_0x5b14('0x38')][_0x5b14('0x5d')](_0x327b7e[_0x5b14('0x5e')],{})['then'](respondWithResult(_0x5b4831,0xc9))[_0x5b14('0x3b')](handleError(_0x5b4831,null));};exports[_0x5b14('0x2a')]=function(_0x215072,_0x2ca6dd){if(_0x215072[_0x5b14('0x5e')]['id']){delete _0x215072[_0x5b14('0x5e')]['id'];}_0x215072[_0x5b14('0x5e')]['attrs']=widgetAttributes(_0x215072['body']);return db['DashboardItem']['find']({'where':{'id':_0x215072[_0x5b14('0x3a')]['id']}})[_0x5b14('0x2b')](handleEntityNotFound(_0x2ca6dd,null))[_0x5b14('0x2b')](saveUpdates(_0x215072[_0x5b14('0x5e')],null))[_0x5b14('0x2b')](respondWithResult(_0x2ca6dd,null))['catch'](handleError(_0x2ca6dd,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 65c9220..19f4347 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 _0xbf4a=['../../mysqldb','DashboardItem','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1a63a7,_0x135783){var _0x4e66bc=function(_0x346182){while(--_0x346182){_0x1a63a7['push'](_0x1a63a7['shift']());}};_0x4e66bc(++_0x135783);}(_0xbf4a,0x104));var _0xabf4=function(_0x4f8784,_0x21dc05){_0x4f8784=_0x4f8784-0x0;var _0x4ec172=_0xbf4a[_0x4f8784];return _0x4ec172;};'use strict';var EventEmitter=require(_0xabf4('0x0'));var DashboardItem=require(_0xabf4('0x1'))['db'][_0xabf4('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabf4('0x3'),'afterUpdate':'update','afterDestroy':_0xabf4('0x4')};function emitEvent(_0x1a593c){return function(_0x416fc9,_0x126e11,_0x698454){DashboardItemEvents['emit'](_0x1a593c+':'+_0x416fc9['id'],_0x416fc9);DashboardItemEvents[_0xabf4('0x5')](_0x1a593c,_0x416fc9);_0x698454(null);};}for(var e in events){if(events[_0xabf4('0x6')](e)){var event=events[e];DashboardItem[_0xabf4('0x7')](e,emitEvent(event));}}module[_0xabf4('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x36bc=['save','remove','emit','exports','events','DashboardItem','setMaxListeners'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x36bc,0x1a8));var _0xc36b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x36bc[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0xc36b('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xc36b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc36b('0x2')](0x0);var events={'afterCreate':_0xc36b('0x3'),'afterUpdate':'update','afterDestroy':_0xc36b('0x4')};function emitEvent(_0x42d4b3){return function(_0x2f42f8,_0x5c09d8,_0x9a3e23){DashboardItemEvents['emit'](_0x42d4b3+':'+_0x2f42f8['id'],_0x2f42f8);DashboardItemEvents[_0xc36b('0x5')](_0x42d4b3,_0x2f42f8);_0x9a3e23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xc36b('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 97aee80..0c00574 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 _0x465b=['request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird'];(function(_0x46a294,_0xdbbcea){var _0x23ad18=function(_0x46840d){while(--_0x46840d){_0x46a294['push'](_0x46a294['shift']());}};_0x23ad18(++_0xdbbcea);}(_0x465b,0x1dc));var _0xb465=function(_0x593bb6,_0x31033a){_0x593bb6=_0x593bb6-0x0;var _0x4bebc5=_0x465b[_0x593bb6];return _0x4bebc5;};'use strict';var _=require(_0xb465('0x0'));var util=require(_0xb465('0x1'));var logger=require('../../config/logger')(_0xb465('0x2'));var moment=require(_0xb465('0x3'));var BPromise=require(_0xb465('0x4'));var rp=require(_0xb465('0x5'));var fs=require('fs');var path=require(_0xb465('0x6'));var rimraf=require('rimraf');var config=require(_0xb465('0x7'));var attributes=require(_0xb465('0x8'));module[_0xb465('0x9')]=function(_0x96948b,_0x48c5f5){return _0x96948b[_0xb465('0xa')](_0xb465('0xb'),attributes,{'tableName':_0xb465('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bbd=['api','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bbd,0x11f));var _0xd7bb=function(_0xc48ef9,_0x442ef5){_0xc48ef9=_0xc48ef9-0x0;var _0x9e3619=_0x7bbd[_0xc48ef9];return _0x9e3619;};'use strict';var _=require(_0xd7bb('0x0'));var util=require(_0xd7bb('0x1'));var logger=require(_0xd7bb('0x2'))(_0xd7bb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd7bb('0x4'));var config=require(_0xd7bb('0x5'));var attributes=require('./dashboardItem.attributes');module[_0xd7bb('0x6')]=function(_0x269764,_0x18095d){return _0x269764[_0xd7bb('0x7')](_0xd7bb('0x8'),attributes,{'tableName':_0xd7bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index f0368cc..109fea4 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 _0xf981=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf981,0xbe));var _0x1f98=function(_0x3169d9,_0xcd812f){_0x3169d9=_0x3169d9-0x0;var _0x2f6399=_0xf981[_0x3169d9];return _0x2f6399;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var moment=require(_0x1f98('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f98('0x3'));var fs=require('fs');var Redis=require(_0x1f98('0x4'));var db=require(_0x1f98('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f98('0x6'));var config=require(_0x1f98('0x7'));var jayson=require(_0x1f98('0x8'));var client=jayson[_0x1f98('0x9')]['http']({'port':0x232a});config[_0x1f98('0xa')]=_[_0x1f98('0xb')](config[_0x1f98('0xa')],{'host':_0x1f98('0xc'),'port':0x18eb});var socket=require(_0x1f98('0xd'))(new Redis(config[_0x1f98('0xa')]));require('./dashboardItem.socket')[_0x1f98('0xe')](socket);function respondWithRpcPromise(_0x41907d,_0x1d4478,_0x1ac7ee){return new BPromise(function(_0x367004,_0x4fae4b){return client[_0x1f98('0xf')](_0x41907d,_0x1ac7ee)['then'](function(_0x560661){logger[_0x1f98('0x10')](_0x1f98('0x11'),_0x1d4478,'request\x20sent');logger[_0x1f98('0x12')](_0x1f98('0x13'),_0x1d4478,_0x1f98('0x14'),JSON[_0x1f98('0x15')](_0x560661));if(_0x560661[_0x1f98('0x16')]){if(_0x560661[_0x1f98('0x16')][_0x1f98('0x17')]===0x1f4){logger[_0x1f98('0x16')](_0x1f98('0x11'),_0x1d4478,_0x560661[_0x1f98('0x16')]['message']);return _0x4fae4b(_0x560661[_0x1f98('0x16')][_0x1f98('0x18')]);}logger[_0x1f98('0x16')]('DashboardItem,\x20%s,\x20%s',_0x1d4478,_0x560661['error']['message']);return _0x367004(_0x560661[_0x1f98('0x16')][_0x1f98('0x18')]);}else{logger[_0x1f98('0x10')]('DashboardItem,\x20%s,\x20%s',_0x1d4478,_0x1f98('0x14'));_0x367004(_0x560661['result'][_0x1f98('0x18')]);}})[_0x1f98('0x19')](function(_0x5d88f3){logger['error'](_0x1f98('0x11'),_0x1d4478,_0x5d88f3);_0x4fae4b(_0x5d88f3);});});} \ No newline at end of file +var _0x5b31=['stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x5b31,0x1f3));var _0x15b3=function(_0x137749,_0x26d2fc){_0x137749=_0x137749-0x0;var _0x9023d2=_0x5b31[_0x137749];return _0x9023d2;};'use strict';var _=require(_0x15b3('0x0'));var util=require(_0x15b3('0x1'));var moment=require(_0x15b3('0x2'));var BPromise=require(_0x15b3('0x3'));var rs=require(_0x15b3('0x4'));var fs=require('fs');var Redis=require(_0x15b3('0x5'));var db=require(_0x15b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x15b3('0x7'))(_0x15b3('0x8'));var config=require(_0x15b3('0x9'));var jayson=require(_0x15b3('0xa'));var client=jayson[_0x15b3('0xb')][_0x15b3('0xc')]({'port':0x232a});config[_0x15b3('0xd')]=_[_0x15b3('0xe')](config[_0x15b3('0xd')],{'host':_0x15b3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15b3('0xd')]));require(_0x15b3('0x10'))[_0x15b3('0x11')](socket);function respondWithRpcPromise(_0x4c502c,_0x439ac1,_0x4ece9b){return new BPromise(function(_0x1e825b,_0x11d48b){return client[_0x15b3('0x12')](_0x4c502c,_0x4ece9b)['then'](function(_0x4be92d){logger[_0x15b3('0x13')](_0x15b3('0x14'),_0x439ac1,'request\x20sent');logger[_0x15b3('0x15')](_0x15b3('0x16'),_0x439ac1,'request\x20sent',JSON[_0x15b3('0x17')](_0x4be92d));if(_0x4be92d[_0x15b3('0x18')]){if(_0x4be92d[_0x15b3('0x18')]['code']===0x1f4){logger['error'](_0x15b3('0x14'),_0x439ac1,_0x4be92d[_0x15b3('0x18')]['message']);return _0x11d48b(_0x4be92d[_0x15b3('0x18')][_0x15b3('0x19')]);}logger[_0x15b3('0x18')](_0x15b3('0x14'),_0x439ac1,_0x4be92d[_0x15b3('0x18')]['message']);return _0x1e825b(_0x4be92d['error'][_0x15b3('0x19')]);}else{logger[_0x15b3('0x13')]('DashboardItem,\x20%s,\x20%s',_0x439ac1,_0x15b3('0x1a'));_0x1e825b(_0x4be92d[_0x15b3('0x1b')]['message']);}})[_0x15b3('0x1c')](function(_0x9ee4bb){logger[_0x15b3('0x18')](_0x15b3('0x14'),_0x439ac1,_0x9ee4bb);_0x11d48b(_0x9ee4bb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5866839..678d88c 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 _0x31de=['update','length','./dashboardItem.events','save','remove'];(function(_0x2e22c5,_0x1bb995){var _0x2819d9=function(_0x59bab7){while(--_0x59bab7){_0x2e22c5['push'](_0x2e22c5['shift']());}};_0x2819d9(++_0x1bb995);}(_0x31de,0x16a));var _0xe31d=function(_0x15bd66,_0x2d074d){_0x15bd66=_0x15bd66-0x0;var _0x451225=_0x31de[_0x15bd66];return _0x451225;};'use strict';var DashboardItemEvents=require(_0xe31d('0x0'));var events=[_0xe31d('0x1'),_0xe31d('0x2'),_0xe31d('0x3')];function createListener(_0x5018fc,_0x1524e3){return function(_0x8fe327){_0x1524e3['emit'](_0x5018fc,_0x8fe327);};}function removeListener(_0x1b2f83,_0x4dd093){return function(){DashboardItemEvents['removeListener'](_0x1b2f83,_0x4dd093);};}exports['register']=function(_0x4b6920){for(var _0x57cd43=0x0,_0x4ea51d=events[_0xe31d('0x4')];_0x57cd43<_0x4ea51d;_0x57cd43++){var _0x181a9b=events[_0x57cd43];var _0x3fdfb4=createListener('dashboardItem:'+_0x181a9b,_0x4b6920);DashboardItemEvents['on'](_0x181a9b,_0x3fdfb4);}}; \ No newline at end of file +var _0x65b7=['register','dashboardItem:','save','remove'];(function(_0x287391,_0x4124e7){var _0x1d978b=function(_0x4137e9){while(--_0x4137e9){_0x287391['push'](_0x287391['shift']());}};_0x1d978b(++_0x4124e7);}(_0x65b7,0xf6));var _0x765b=function(_0x227e63,_0xd11ca2){_0x227e63=_0x227e63-0x0;var _0x2967c4=_0x65b7[_0x227e63];return _0x2967c4;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x765b('0x0'),_0x765b('0x1'),'update'];function createListener(_0x4d5a48,_0x2a23c9){return function(_0x4cac18){_0x2a23c9['emit'](_0x4d5a48,_0x4cac18);};}function removeListener(_0x446527,_0x30106c){return function(){DashboardItemEvents['removeListener'](_0x446527,_0x30106c);};}exports[_0x765b('0x2')]=function(_0xad1226){for(var _0x409f97=0x0,_0x4e0c48=events['length'];_0x409f97<_0x4e0c48;_0x409f97++){var _0x2e301e=events[_0x409f97];var _0x5639ca=createListener(_0x765b('0x3')+_0x2e301e,_0xad1226);DashboardItemEvents['on'](_0x2e301e,_0x5639ca);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 8a39f6e..6b2d0d2 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 _0xa8df=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','create','put','isAuthenticated','update','exports','multer'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0xa8df,0x1df));var _0xfa8d=function(_0x542cf4,_0x1dd665){_0x542cf4=_0x542cf4-0x0;var _0x12866e=_0xa8df[_0x542cf4];return _0x12866e;};'use strict';var multer=require(_0xfa8d('0x0'));var util=require(_0xfa8d('0x1'));var path=require(_0xfa8d('0x2'));var timeout=require('connect-timeout');var express=require(_0xfa8d('0x3'));var router=express['Router']();var fs_extra=require(_0xfa8d('0x4'));var auth=require(_0xfa8d('0x5'));var interaction=require(_0xfa8d('0x6'));var config=require(_0xfa8d('0x7'));var controller=require(_0xfa8d('0x8'));router[_0xfa8d('0x9')](_0xfa8d('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfa8d('0xb')]);router[_0xfa8d('0xc')](_0xfa8d('0xa'),auth[_0xfa8d('0xd')](),controller[_0xfa8d('0xe')]);router['delete'](_0xfa8d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa8d('0xf')]=router; \ No newline at end of file +var _0xac29=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','update','delete'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xac29,0x1d1));var _0x9ac2=function(_0x304236,_0x59a6fb){_0x304236=_0x304236-0x0;var _0x3ec03d=_0xac29[_0x304236];return _0x3ec03d;};'use strict';var multer=require(_0x9ac2('0x0'));var util=require(_0x9ac2('0x1'));var path=require('path');var timeout=require(_0x9ac2('0x2'));var express=require('express');var router=express[_0x9ac2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ac2('0x4'));var interaction=require(_0x9ac2('0x5'));var config=require(_0x9ac2('0x6'));var controller=require(_0x9ac2('0x7'));router[_0x9ac2('0x8')](_0x9ac2('0x9'),auth[_0x9ac2('0xa')](),controller['show']);router[_0x9ac2('0xb')]('/',auth[_0x9ac2('0xa')](),controller[_0x9ac2('0xc')]);router['put'](_0x9ac2('0x9'),auth['isAuthenticated'](),controller[_0x9ac2('0xd')]);router[_0x9ac2('0xe')]('/:id',auth[_0x9ac2('0xa')](),controller['destroy']);module[_0x9ac2('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f13a40b..3d1ad51 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 _0x8786=['STRING','ENUM','first','second','third','sequelize'];(function(_0x1231b9,_0x48a493){var _0x2e669a=function(_0x5be94d){while(--_0x5be94d){_0x1231b9['push'](_0x1231b9['shift']());}};_0x2e669a(++_0x48a493);}(_0x8786,0x13d));var _0x6878=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8786[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x6878('0x0'));module['exports']={'name':{'type':Sequelize[_0x6878('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x6878('0x2')](_0x6878('0x3'),_0x6878('0x4'),_0x6878('0x5')),'allowNull':![],'defaultValue':_0x6878('0x3')},'description':{'type':Sequelize[_0x6878('0x1')]}}; \ No newline at end of file +var _0xd057=['sequelize','first','second','third'];(function(_0x1b905f,_0x2de70c){var _0x4b5fbb=function(_0x4a2491){while(--_0x4a2491){_0x1b905f['push'](_0x1b905f['shift']());}};_0x4b5fbb(++_0x2de70c);}(_0xd057,0x88));var _0x7d05=function(_0x5a6d9a,_0x367442){_0x5a6d9a=_0x5a6d9a-0x0;var _0x1b11d5=_0xd057[_0x5a6d9a];return _0x1b11d5;};'use strict';var Sequelize=require(_0x7d05('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x7d05('0x1'),_0x7d05('0x2'),_0x7d05('0x3')),'allowNull':![],'defaultValue':_0x7d05('0x1')},'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 253b56e..48a130b 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 _0xcf6a=['keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x4f6a85,_0x41b2a0){var _0x53bc61=function(_0x1c72d8){while(--_0x1c72d8){_0x4f6a85['push'](_0x4f6a85['shift']());}};_0x53bc61(++_0x41b2a0);}(_0xcf6a,0xbb));var _0xacf6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xcf6a[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0xacf6('0x0'));var rimraf=require(_0xacf6('0x1'));var zipdir=require(_0xacf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xacf6('0x3'));var BPromise=require(_0xacf6('0x4'));var Mustache=require(_0xacf6('0x5'));var util=require(_0xacf6('0x6'));var path=require(_0xacf6('0x7'));var sox=require('sox');var csv=require(_0xacf6('0x8'));var ejs=require(_0xacf6('0x9'));var fs=require('fs');var fs_extra=require(_0xacf6('0xa'));var _=require(_0xacf6('0xb'));var squel=require(_0xacf6('0xc'));var crypto=require('crypto');var jsforce=require(_0xacf6('0xd'));var deskjs=require(_0xacf6('0xe'));var toCsv=require(_0xacf6('0x8'));var querystring=require(_0xacf6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xacf6('0x10'));var as=require(_0xacf6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacf6('0x12'))(_0xacf6('0x13'));var utils=require(_0xacf6('0x14'));var config=require(_0xacf6('0x15'));var licenseUtil=require(_0xacf6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fb086,_0x488bc5){_0x488bc5=_0x488bc5||0xcc;return function(_0x134ef6){if(_0x134ef6){return _0x1fb086[_0xacf6('0x17')](_0x488bc5);}return _0x1fb086['status'](_0x488bc5)[_0xacf6('0x18')]();};}function respondWithResult(_0xc07764,_0x543d29){_0x543d29=_0x543d29||0xc8;return function(_0x1658c2){if(_0x1658c2){return _0xc07764['status'](_0x543d29)['json'](_0x1658c2);}};}function respondWithFilteredResult(_0x591687,_0xcd9514){return function(_0x3ab6f1){if(_0x3ab6f1){var _0xfb0fb5=typeof _0xcd9514[_0xacf6('0x19')]===_0xacf6('0x1a')&&typeof _0xcd9514[_0xacf6('0x1b')]===_0xacf6('0x1a');var _0x2354e5=_0x3ab6f1['count'];var _0x45a875=_0xfb0fb5?0x0:_0xcd9514[_0xacf6('0x19')];var _0x2191ab=_0xfb0fb5?_0x3ab6f1[_0xacf6('0x1c')]:_0xcd9514[_0xacf6('0x19')]+_0xcd9514['limit'];var _0x2180ef;if(_0x2191ab>=_0x2354e5){_0x2191ab=_0x2354e5;_0x2180ef=0xc8;}else{_0x2180ef=0xce;}_0x591687[_0xacf6('0x1d')](_0x2180ef);return _0x591687[_0xacf6('0x1e')](_0xacf6('0x1f'),_0x45a875+'-'+_0x2191ab+'/'+_0x2354e5)['json'](_0x3ab6f1);}return null;};}function patchUpdates(_0x5ebf1e){return function(_0x4e00eb){try{jsonpatch['apply'](_0x4e00eb,_0x5ebf1e,!![]);}catch(_0x2ae333){return BPromise[_0xacf6('0x20')](_0x2ae333);}return _0x4e00eb[_0xacf6('0x21')]();};}function saveUpdates(_0x51ac6d,_0x26a795){return function(_0x50fc67){if(_0x50fc67){return _0x50fc67[_0xacf6('0x22')](_0x51ac6d)[_0xacf6('0x23')](function(_0x2056e9){return _0x2056e9;});}return null;};}function removeEntity(_0x366a8b,_0x3d27a0){return function(_0x446018){if(_0x446018){return _0x446018[_0xacf6('0x24')]()['then'](function(){var _0x1976b3=_0x446018[_0xacf6('0x25')]({'plain':!![]});var _0xdd2c3c=_0xacf6('0x26');return db[_0xacf6('0x27')]['destroy']({'where':{'type':_0xdd2c3c,'resourceId':_0x1976b3['id']}})['then'](function(){return _0x446018;});})[_0xacf6('0x23')](function(){_0x366a8b[_0xacf6('0x1d')](0xcc)[_0xacf6('0x18')]();});}};}function handleEntityNotFound(_0x4b3c9b,_0x2b262a){return function(_0x1e7130){if(!_0x1e7130){_0x4b3c9b[_0xacf6('0x17')](0x194);}return _0x1e7130;};}function handleError(_0xcacd7a,_0x19bc65){_0x19bc65=_0x19bc65||0x1f4;return function(_0x442f46){logger[_0xacf6('0x28')](_0x442f46[_0xacf6('0x29')]);if(_0x442f46[_0xacf6('0x2a')]){delete _0x442f46[_0xacf6('0x2a')];}_0xcacd7a['status'](_0x19bc65)[_0xacf6('0x2b')](_0x442f46);};}exports[_0xacf6('0x2c')]=function(_0xf97fdd,_0x3d05c8){var _0x1af2af={},_0x2e77f1={},_0x3d857a={'count':0x0,'rows':[]};var _0xfed42e=_['map'](db[_0xacf6('0x2d')][_0xacf6('0x2e')],function(_0x484d6a){return{'name':_0x484d6a[_0xacf6('0x2f')],'type':_0x484d6a[_0xacf6('0x30')][_0xacf6('0x31')]};});_0x2e77f1[_0xacf6('0x32')]=_[_0xacf6('0x33')](_0xfed42e,_0xacf6('0x2a'));_0x2e77f1[_0xacf6('0x34')]=_[_0xacf6('0x35')](_0xf97fdd[_0xacf6('0x34')]);_0x2e77f1['filters']=_[_0xacf6('0x36')](_0x2e77f1['model'],_0x2e77f1[_0xacf6('0x34')]);_0x1af2af[_0xacf6('0x37')]=_[_0xacf6('0x36')](_0x2e77f1[_0xacf6('0x32')],qs[_0xacf6('0x38')](_0xf97fdd['query'][_0xacf6('0x38')]));_0x1af2af[_0xacf6('0x37')]=_0x1af2af[_0xacf6('0x37')][_0xacf6('0x39')]?_0x1af2af[_0xacf6('0x37')]:_0x2e77f1['model'];if(!_0xf97fdd['query']['hasOwnProperty'](_0xacf6('0x3a'))){_0x1af2af[_0xacf6('0x1b')]=qs[_0xacf6('0x1b')](_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x1b')]);_0x1af2af[_0xacf6('0x19')]=qs[_0xacf6('0x19')](_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x19')]);}_0x1af2af['order']=qs[_0xacf6('0x3b')](_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x3b')]);_0x1af2af[_0xacf6('0x3c')]=qs[_0xacf6('0x3d')](_[_0xacf6('0x3e')](_0xf97fdd['query'],_0x2e77f1['filters']),_0xfed42e);if(_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x3f')]){_0x1af2af[_0xacf6('0x3c')]=_[_0xacf6('0x40')](_0x1af2af[_0xacf6('0x3c')],{'$or':_[_0xacf6('0x33')](_0xfed42e,function(_0x4d8e00){if(_0x4d8e00[_0xacf6('0x30')]!==_0xacf6('0x41')){var _0x1133d0={};_0x1133d0[_0x4d8e00[_0xacf6('0x2a')]]={'$like':'%'+_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x3f')]+'%'};return _0x1133d0;}})});}_0x1af2af=_[_0xacf6('0x40')]({},_0x1af2af,_0xf97fdd[_0xacf6('0x42')]);var _0xf2032c={'where':_0x1af2af[_0xacf6('0x3c')]};return db[_0xacf6('0x2d')][_0xacf6('0x1c')](_0xf2032c)[_0xacf6('0x23')](function(_0x276f86){_0x3d857a['count']=_0x276f86;if(_0xf97fdd[_0xacf6('0x34')][_0xacf6('0x43')]){_0x1af2af[_0xacf6('0x44')]=[{'all':!![]}];}return db[_0xacf6('0x2d')][_0xacf6('0x45')](_0x1af2af);})[_0xacf6('0x23')](function(_0xf46453){_0x3d857a[_0xacf6('0x46')]=_0xf46453;return _0x3d857a;})[_0xacf6('0x23')](respondWithFilteredResult(_0x3d05c8,_0x1af2af))[_0xacf6('0x47')](handleError(_0x3d05c8,null));};exports[_0xacf6('0x48')]=function(_0x2c41a7,_0x5e72e5){var _0x5d7391={'raw':!![],'where':{'id':_0x2c41a7[_0xacf6('0x49')]['id']}},_0x312a64={};_0x312a64[_0xacf6('0x32')]=_[_0xacf6('0x35')](db[_0xacf6('0x2d')]['rawAttributes']);_0x312a64['query']=_[_0xacf6('0x35')](_0x2c41a7[_0xacf6('0x34')]);_0x312a64[_0xacf6('0x3d')]=_[_0xacf6('0x36')](_0x312a64['model'],_0x312a64[_0xacf6('0x34')]);_0x5d7391[_0xacf6('0x37')]=_[_0xacf6('0x36')](_0x312a64['model'],qs[_0xacf6('0x38')](_0x2c41a7['query']['fields']));_0x5d7391[_0xacf6('0x37')]=_0x5d7391[_0xacf6('0x37')][_0xacf6('0x39')]?_0x5d7391['attributes']:_0x312a64[_0xacf6('0x32')];if(_0x2c41a7[_0xacf6('0x34')][_0xacf6('0x43')]){_0x5d7391['include']=[{'all':!![]}];}_0x5d7391=_['merge']({},_0x5d7391,_0x2c41a7[_0xacf6('0x42')]);return db[_0xacf6('0x2d')]['find'](_0x5d7391)[_0xacf6('0x23')](handleEntityNotFound(_0x5e72e5,null))['then'](respondWithResult(_0x5e72e5,null))[_0xacf6('0x47')](handleError(_0x5e72e5,null));};exports[_0xacf6('0x4a')]=function(_0x1e00ea,_0x20ebac){return db[_0xacf6('0x2d')]['create'](_0x1e00ea[_0xacf6('0x4b')],{})[_0xacf6('0x23')](function(_0x4edb35){var _0x1abb5a=_0x1e00ea[_0xacf6('0x4c')][_0xacf6('0x25')]({'plain':!![]});if(!_0x1abb5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1abb5a[_0xacf6('0x4d')]===_0xacf6('0x4c')){var _0x326288=_0x4edb35[_0xacf6('0x25')]({'plain':!![]});var _0x348003=_0xacf6('0x26');return db['UserProfileSection'][_0xacf6('0x4e')]({'where':{'name':_0x348003,'userProfileId':_0x1abb5a['userProfileId']},'raw':!![]})[_0xacf6('0x23')](function(_0x4b8115){if(_0x4b8115&&_0x4b8115['autoAssociation']===0x0){return db[_0xacf6('0x27')][_0xacf6('0x4a')]({'name':_0x326288[_0xacf6('0x2a')],'resourceId':_0x326288['id'],'type':_0x4b8115[_0xacf6('0x2a')],'sectionId':_0x4b8115['id']},{})[_0xacf6('0x23')](function(){return _0x4edb35;});}else{return _0x4edb35;}})[_0xacf6('0x47')](function(_0xd9726){logger[_0xacf6('0x28')](_0xacf6('0x4f'),_0xd9726);throw _0xd9726;});}return _0x4edb35;})[_0xacf6('0x23')](respondWithResult(_0x20ebac,0xc9))[_0xacf6('0x47')](handleError(_0x20ebac,null));};exports['update']=function(_0x315803,_0x2294a0){if(_0x315803[_0xacf6('0x4b')]['id']){delete _0x315803[_0xacf6('0x4b')]['id'];}return db[_0xacf6('0x2d')][_0xacf6('0x4e')]({'where':{'id':_0x315803[_0xacf6('0x49')]['id']}})[_0xacf6('0x23')](handleEntityNotFound(_0x2294a0,null))[_0xacf6('0x23')](saveUpdates(_0x315803['body'],null))[_0xacf6('0x23')](respondWithResult(_0x2294a0,null))['catch'](handleError(_0x2294a0,null));};exports[_0xacf6('0x24')]=function(_0x9a6a16,_0x25b875){return db[_0xacf6('0x2d')][_0xacf6('0x4e')]({'where':{'id':_0x9a6a16[_0xacf6('0x49')]['id']}})[_0xacf6('0x23')](handleEntityNotFound(_0x25b875,null))['then'](removeEntity(_0x25b875,null))[_0xacf6('0x47')](handleError(_0x25b875,null));}; \ No newline at end of file +var _0x9485=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x29891b,_0x471829){var _0x5dbd25=function(_0x82f3a7){while(--_0x82f3a7){_0x29891b['push'](_0x29891b['shift']());}};_0x5dbd25(++_0x471829);}(_0x9485,0x8b));var _0x5948=function(_0x108ade,_0x44e29d){_0x108ade=_0x108ade-0x0;var _0x1aee7f=_0x9485[_0x108ade];return _0x1aee7f;};'use strict';var emlformat=require(_0x5948('0x0'));var rimraf=require(_0x5948('0x1'));var zipdir=require(_0x5948('0x2'));var jsonpatch=require(_0x5948('0x3'));var rp=require('request-promise');var moment=require(_0x5948('0x4'));var BPromise=require(_0x5948('0x5'));var Mustache=require(_0x5948('0x6'));var util=require('util');var path=require(_0x5948('0x7'));var sox=require(_0x5948('0x8'));var csv=require(_0x5948('0x9'));var ejs=require(_0x5948('0xa'));var fs=require('fs');var fs_extra=require(_0x5948('0xb'));var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0x9'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var hardwareService=require(_0x5948('0x13'));var logger=require(_0x5948('0x14'))(_0x5948('0x15'));var utils=require(_0x5948('0x16'));var config=require(_0x5948('0x17'));var licenseUtil=require(_0x5948('0x18'));var db=require(_0x5948('0x19'))['db'];function respondWithStatusCode(_0x35af62,_0x3070f5){_0x3070f5=_0x3070f5||0xcc;return function(_0x5cc3db){if(_0x5cc3db){return _0x35af62[_0x5948('0x1a')](_0x3070f5);}return _0x35af62[_0x5948('0x1b')](_0x3070f5)[_0x5948('0x1c')]();};}function respondWithResult(_0x23a656,_0xe55911){_0xe55911=_0xe55911||0xc8;return function(_0x2fdc7d){if(_0x2fdc7d){return _0x23a656[_0x5948('0x1b')](_0xe55911)[_0x5948('0x1d')](_0x2fdc7d);}};}function respondWithFilteredResult(_0x4691fc,_0x3565df){return function(_0x281324){if(_0x281324){var _0x203968=typeof _0x3565df[_0x5948('0x1e')]===_0x5948('0x1f')&&typeof _0x3565df[_0x5948('0x20')]==='undefined';var _0x4d711a=_0x281324['count'];var _0xbdd336=_0x203968?0x0:_0x3565df[_0x5948('0x1e')];var _0xd4331f=_0x203968?_0x281324[_0x5948('0x21')]:_0x3565df[_0x5948('0x1e')]+_0x3565df[_0x5948('0x20')];var _0x4d64ea;if(_0xd4331f>=_0x4d711a){_0xd4331f=_0x4d711a;_0x4d64ea=0xc8;}else{_0x4d64ea=0xce;}_0x4691fc[_0x5948('0x1b')](_0x4d64ea);return _0x4691fc[_0x5948('0x22')](_0x5948('0x23'),_0xbdd336+'-'+_0xd4331f+'/'+_0x4d711a)[_0x5948('0x1d')](_0x281324);}return null;};}function patchUpdates(_0x4a4edf){return function(_0x40410c){try{jsonpatch[_0x5948('0x24')](_0x40410c,_0x4a4edf,!![]);}catch(_0xfd26da){return BPromise[_0x5948('0x25')](_0xfd26da);}return _0x40410c[_0x5948('0x26')]();};}function saveUpdates(_0x416e76,_0x31110a){return function(_0x319876){if(_0x319876){return _0x319876[_0x5948('0x27')](_0x416e76)[_0x5948('0x28')](function(_0x5b5061){return _0x5b5061;});}return null;};}function removeEntity(_0x1f2571,_0x5e0f16){return function(_0x255228){if(_0x255228){return _0x255228[_0x5948('0x29')]()[_0x5948('0x28')](function(){var _0x2cd86e=_0x255228[_0x5948('0x2a')]({'plain':!![]});var _0x4164bf=_0x5948('0x2b');return db[_0x5948('0x2c')]['destroy']({'where':{'type':_0x4164bf,'resourceId':_0x2cd86e['id']}})['then'](function(){return _0x255228;});})['then'](function(){_0x1f2571[_0x5948('0x1b')](0xcc)[_0x5948('0x1c')]();});}};}function handleEntityNotFound(_0xe4629a,_0x499c35){return function(_0x4a9630){if(!_0x4a9630){_0xe4629a[_0x5948('0x1a')](0x194);}return _0x4a9630;};}function handleError(_0x47b55e,_0xc03d2c){_0xc03d2c=_0xc03d2c||0x1f4;return function(_0x5e5ef3){logger[_0x5948('0x2d')](_0x5e5ef3[_0x5948('0x2e')]);if(_0x5e5ef3[_0x5948('0x2f')]){delete _0x5e5ef3[_0x5948('0x2f')];}_0x47b55e[_0x5948('0x1b')](_0xc03d2c)[_0x5948('0x30')](_0x5e5ef3);};}exports['index']=function(_0x47e0b6,_0x2c9219){var _0x67d341={},_0x4a6740={},_0x4ff572={'count':0x0,'rows':[]};var _0x5d9ca0=_[_0x5948('0x31')](db[_0x5948('0x32')][_0x5948('0x33')],function(_0x1be3ea){return{'name':_0x1be3ea['fieldName'],'type':_0x1be3ea['type'][_0x5948('0x34')]};});_0x4a6740['model']=_[_0x5948('0x31')](_0x5d9ca0,'name');_0x4a6740[_0x5948('0x35')]=_[_0x5948('0x36')](_0x47e0b6[_0x5948('0x35')]);_0x4a6740[_0x5948('0x37')]=_[_0x5948('0x38')](_0x4a6740[_0x5948('0x39')],_0x4a6740[_0x5948('0x35')]);_0x67d341[_0x5948('0x3a')]=_[_0x5948('0x38')](_0x4a6740[_0x5948('0x39')],qs['fields'](_0x47e0b6[_0x5948('0x35')][_0x5948('0x3b')]));_0x67d341['attributes']=_0x67d341[_0x5948('0x3a')]['length']?_0x67d341[_0x5948('0x3a')]:_0x4a6740[_0x5948('0x39')];if(!_0x47e0b6['query'][_0x5948('0x3c')]('nolimit')){_0x67d341[_0x5948('0x20')]=qs[_0x5948('0x20')](_0x47e0b6[_0x5948('0x35')][_0x5948('0x20')]);_0x67d341[_0x5948('0x1e')]=qs[_0x5948('0x1e')](_0x47e0b6[_0x5948('0x35')][_0x5948('0x1e')]);}_0x67d341[_0x5948('0x3d')]=qs[_0x5948('0x3e')](_0x47e0b6[_0x5948('0x35')]['sort']);_0x67d341['where']=qs['filters'](_['pick'](_0x47e0b6['query'],_0x4a6740[_0x5948('0x37')]),_0x5d9ca0);if(_0x47e0b6[_0x5948('0x35')][_0x5948('0x3f')]){_0x67d341['where']=_[_0x5948('0x40')](_0x67d341[_0x5948('0x41')],{'$or':_['map'](_0x5d9ca0,function(_0x3d603d){if(_0x3d603d['type']!==_0x5948('0x42')){var _0x34b36f={};_0x34b36f[_0x3d603d[_0x5948('0x2f')]]={'$like':'%'+_0x47e0b6[_0x5948('0x35')]['filter']+'%'};return _0x34b36f;}})});}_0x67d341=_[_0x5948('0x40')]({},_0x67d341,_0x47e0b6['options']);var _0x1490ad={'where':_0x67d341[_0x5948('0x41')]};return db[_0x5948('0x32')][_0x5948('0x21')](_0x1490ad)[_0x5948('0x28')](function(_0xba70a9){_0x4ff572[_0x5948('0x21')]=_0xba70a9;if(_0x47e0b6[_0x5948('0x35')][_0x5948('0x43')]){_0x67d341[_0x5948('0x44')]=[{'all':!![]}];}return db[_0x5948('0x32')]['findAll'](_0x67d341);})[_0x5948('0x28')](function(_0x17d5d3){_0x4ff572[_0x5948('0x45')]=_0x17d5d3;return _0x4ff572;})[_0x5948('0x28')](respondWithFilteredResult(_0x2c9219,_0x67d341))[_0x5948('0x46')](handleError(_0x2c9219,null));};exports[_0x5948('0x47')]=function(_0x196e26,_0x271c43){var _0x369c6d={'raw':!![],'where':{'id':_0x196e26[_0x5948('0x48')]['id']}},_0x389f24={};_0x389f24['model']=_[_0x5948('0x36')](db[_0x5948('0x32')][_0x5948('0x33')]);_0x389f24[_0x5948('0x35')]=_['keys'](_0x196e26['query']);_0x389f24[_0x5948('0x37')]=_[_0x5948('0x38')](_0x389f24['model'],_0x389f24[_0x5948('0x35')]);_0x369c6d['attributes']=_[_0x5948('0x38')](_0x389f24[_0x5948('0x39')],qs[_0x5948('0x3b')](_0x196e26[_0x5948('0x35')]['fields']));_0x369c6d[_0x5948('0x3a')]=_0x369c6d[_0x5948('0x3a')][_0x5948('0x49')]?_0x369c6d['attributes']:_0x389f24[_0x5948('0x39')];if(_0x196e26[_0x5948('0x35')]['includeAll']){_0x369c6d[_0x5948('0x44')]=[{'all':!![]}];}_0x369c6d=_[_0x5948('0x40')]({},_0x369c6d,_0x196e26[_0x5948('0x4a')]);return db[_0x5948('0x32')][_0x5948('0x4b')](_0x369c6d)['then'](handleEntityNotFound(_0x271c43,null))[_0x5948('0x28')](respondWithResult(_0x271c43,null))['catch'](handleError(_0x271c43,null));};exports[_0x5948('0x4c')]=function(_0x4cb9ed,_0xeaf4ab){return db[_0x5948('0x32')][_0x5948('0x4c')](_0x4cb9ed[_0x5948('0x4d')],{})[_0x5948('0x28')](function(_0xfc4eec){var _0x35cb5d=_0x4cb9ed[_0x5948('0x4e')][_0x5948('0x2a')]({'plain':!![]});if(!_0x35cb5d)throw new Error(_0x5948('0x4f'));if(_0x35cb5d[_0x5948('0x50')]===_0x5948('0x4e')){var _0x15a6d9=_0xfc4eec[_0x5948('0x2a')]({'plain':!![]});var _0x27cf8b=_0x5948('0x2b');return db[_0x5948('0x51')][_0x5948('0x4b')]({'where':{'name':_0x27cf8b,'userProfileId':_0x35cb5d[_0x5948('0x52')]},'raw':!![]})[_0x5948('0x28')](function(_0x3d84e2){if(_0x3d84e2&&_0x3d84e2[_0x5948('0x53')]===0x0){return db[_0x5948('0x2c')][_0x5948('0x4c')]({'name':_0x15a6d9['name'],'resourceId':_0x15a6d9['id'],'type':_0x3d84e2[_0x5948('0x2f')],'sectionId':_0x3d84e2['id']},{})[_0x5948('0x28')](function(){return _0xfc4eec;});}else{return _0xfc4eec;}})['catch'](function(_0xb2dafe){logger['error'](_0x5948('0x54'),_0xb2dafe);throw _0xb2dafe;});}return _0xfc4eec;})[_0x5948('0x28')](respondWithResult(_0xeaf4ab,0xc9))['catch'](handleError(_0xeaf4ab,null));};exports[_0x5948('0x27')]=function(_0x81dd38,_0x5f3965){if(_0x81dd38[_0x5948('0x4d')]['id']){delete _0x81dd38[_0x5948('0x4d')]['id'];}return db[_0x5948('0x32')][_0x5948('0x4b')]({'where':{'id':_0x81dd38[_0x5948('0x48')]['id']}})[_0x5948('0x28')](handleEntityNotFound(_0x5f3965,null))['then'](saveUpdates(_0x81dd38['body'],null))[_0x5948('0x28')](respondWithResult(_0x5f3965,null))[_0x5948('0x46')](handleError(_0x5f3965,null));};exports['destroy']=function(_0x2ac84d,_0x1b288d){return db['Disposition'][_0x5948('0x4b')]({'where':{'id':_0x2ac84d[_0x5948('0x48')]['id']}})[_0x5948('0x28')](handleEntityNotFound(_0x1b288d,null))[_0x5948('0x28')](removeEntity(_0x1b288d,null))['catch'](handleError(_0x1b288d,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 10609d9..2acec5d 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 _0x60dd=['../../config/logger','api','bluebird','path','rimraf','exports','define','tools_dispositions','name','ListId','name_chat','MailAccountId','name_sms','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util'];(function(_0x2ae090,_0x4424e2){var _0x31b10f=function(_0x580272){while(--_0x580272){_0x2ae090['push'](_0x2ae090['shift']());}};_0x31b10f(++_0x4424e2);}(_0x60dd,0x1b9));var _0xd60d=function(_0xc2335a,_0x2dc8c6){_0xc2335a=_0xc2335a-0x0;var _0x36e129=_0x60dd[_0xc2335a];return _0x36e129;};'use strict';var _=require('lodash');var util=require(_0xd60d('0x0'));var logger=require(_0xd60d('0x1'))(_0xd60d('0x2'));var moment=require('moment');var BPromise=require(_0xd60d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd60d('0x4'));var rimraf=require(_0xd60d('0x5'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xd60d('0x6')]=function(_0x3d5fa3,_0x8180a4){return _0x3d5fa3[_0xd60d('0x7')]('Disposition',attributes,{'tableName':_0xd60d('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xd60d('0x9'),_0xd60d('0xa')]},{'unique':!![],'name':_0xd60d('0xb'),'fields':[_0xd60d('0x9'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name',_0xd60d('0xc')]},{'unique':!![],'name':_0xd60d('0xd'),'fields':[_0xd60d('0x9'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xd60d('0x9'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xd60d('0x9'),_0xd60d('0xe')]},{'unique':!![],'name':_0xd60d('0xf'),'fields':[_0xd60d('0x9'),_0xd60d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae79=['name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','api','moment','request-promise','path','./disposition.attributes','exports','define','tools_dispositions','name','ListId','name_chat','ChatWebsiteId'];(function(_0x2b3194,_0x5c953f){var _0x519853=function(_0x317cec){while(--_0x317cec){_0x2b3194['push'](_0x2b3194['shift']());}};_0x519853(++_0x5c953f);}(_0xae79,0x152));var _0x9ae7=function(_0x1e8094,_0x44c529){_0x1e8094=_0x1e8094-0x0;var _0x275867=_0xae79[_0x1e8094];return _0x275867;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var logger=require('../../config/logger')(_0x9ae7('0x2'));var moment=require(_0x9ae7('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ae7('0x4'));var fs=require('fs');var path=require(_0x9ae7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9ae7('0x6'));module[_0x9ae7('0x7')]=function(_0x3c7809,_0x272c17){return _0x3c7809[_0x9ae7('0x8')]('Disposition',attributes,{'tableName':_0x9ae7('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x9ae7('0xa'),_0x9ae7('0xb')]},{'unique':!![],'name':_0x9ae7('0xc'),'fields':[_0x9ae7('0xa'),_0x9ae7('0xd')]},{'unique':!![],'name':_0x9ae7('0xe'),'fields':[_0x9ae7('0xa'),_0x9ae7('0xf')]},{'unique':!![],'name':_0x9ae7('0x10'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0x9ae7('0x11'),'fields':[_0x9ae7('0xa'),_0x9ae7('0x12')]},{'unique':!![],'name':_0x9ae7('0x13'),'fields':[_0x9ae7('0xa'),_0x9ae7('0x14')]},{'unique':!![],'name':_0x9ae7('0x15'),'fields':[_0x9ae7('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 708163d..272e3bb 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(_0x474b6e,_0x285f6a){var _0x357c98=function(_0x40b0c0){while(--_0x40b0c0){_0x474b6e['push'](_0x474b6e['shift']());}};_0x357c98(++_0x285f6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x436e79,_0x364c17){var _0x22e507=function(_0x37064d){while(--_0x37064d){_0x436e79['push'](_0x436e79['shift']());}};_0x22e507(++_0x364c17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 ccd4a3e..ddf7e8b 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 _0xaf55=['index','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xaf55,0x1e3));var _0x5af5=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xaf55[_0x456fb1];return _0x4083d6;};'use strict';var multer=require(_0x5af5('0x0'));var util=require(_0x5af5('0x1'));var path=require(_0x5af5('0x2'));var timeout=require(_0x5af5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5af5('0x4'));var auth=require(_0x5af5('0x5'));var interaction=require(_0x5af5('0x6'));var config=require(_0x5af5('0x7'));var controller=require(_0x5af5('0x8'));router['get']('/',auth[_0x5af5('0x9')](),controller[_0x5af5('0xa')]);router['get'](_0x5af5('0xb'),auth[_0x5af5('0x9')](),controller['show']);router[_0x5af5('0xc')]('/',auth['isAuthenticated'](),controller[_0x5af5('0xd')]);router['put'](_0x5af5('0xb'),auth[_0x5af5('0x9')](),controller[_0x5af5('0xe')]);router[_0x5af5('0xf')](_0x5af5('0xb'),auth['isAuthenticated'](),controller[_0x5af5('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd49c=['post','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index'];(function(_0x11f6aa,_0x309b2e){var _0x50cf20=function(_0x2cee8e){while(--_0x2cee8e){_0x11f6aa['push'](_0x11f6aa['shift']());}};_0x50cf20(++_0x309b2e);}(_0xd49c,0x145));var _0xcd49=function(_0x39b65c,_0x1d79fe){_0x39b65c=_0x39b65c-0x0;var _0xd5d925=_0xd49c[_0x39b65c];return _0xd5d925;};'use strict';var multer=require(_0xcd49('0x0'));var util=require(_0xcd49('0x1'));var path=require('path');var timeout=require(_0xcd49('0x2'));var express=require(_0xcd49('0x3'));var router=express['Router']();var fs_extra=require(_0xcd49('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd49('0x5'));var config=require(_0xcd49('0x6'));var controller=require(_0xcd49('0x7'));router[_0xcd49('0x8')]('/',auth[_0xcd49('0x9')](),controller[_0xcd49('0xa')]);router[_0xcd49('0x8')]('/:id',auth[_0xcd49('0x9')](),controller['show']);router[_0xcd49('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcd49('0xc')]);router[_0xcd49('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcd49('0xe')]);module[_0xcd49('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 78510ea..eb8fbc4 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 _0xf64e=['yes','2400','7200','12000','14400','4800','9600','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x2e3ae8,_0x3611b9){var _0x314157=function(_0x41b483){while(--_0x41b483){_0x2e3ae8['push'](_0x2e3ae8['shift']());}};_0x314157(++_0x3611b9);}(_0xf64e,0x6f));var _0xef64=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf64e[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xef64('0x0'));module[_0xef64('0x1')]={'name':{'type':Sequelize[_0xef64('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xef64('0x2')]},'ecm':{'type':Sequelize[_0xef64('0x3')](_0xef64('0x4'),'no'),'defaultValue':_0xef64('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xef64('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xef64('0x3')](_0xef64('0x5'),'4800',_0xef64('0x6'),'9600',_0xef64('0x7'),_0xef64('0x8')),'defaultValue':_0xef64('0x9')},'maxrate':{'type':Sequelize[_0xef64('0x3')](_0xef64('0x5'),_0xef64('0x9'),'7200',_0xef64('0xa'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xef64('0x2')],'defaultValue':_0xef64('0xb')},'gateway':{'type':Sequelize[_0xef64('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xef64('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xef64('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xef64('0x3')](_0xef64('0xd'),'IAX',_0xef64('0xe'),_0xef64('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xef64('0x10')],'defaultValue':function(){return _0xef64('0x11');}},'notificationSound':{'type':Sequelize[_0xef64('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef64('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef64('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef64('0x13'),'set':function(_0x52dff8){if(!_0x52dff8)this[_0xef64('0x14')](_0xef64('0x15'),null);this[_0xef64('0x14')](_0xef64('0x16'),_0x52dff8);}}}; \ No newline at end of file +var _0xb2af=['exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','14400','12000','v17,v27,v29','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition'];(function(_0x53d36b,_0x1d07a3){var _0x3ae455=function(_0x2aa7ed){while(--_0x2aa7ed){_0x53d36b['push'](_0x53d36b['shift']());}};_0x3ae455(++_0x1d07a3);}(_0xb2af,0x1a2));var _0xfb2a=function(_0x4c0ebc,_0x4c8f8f){_0x4c0ebc=_0x4c0ebc-0x0;var _0x8d02fc=_0xb2af[_0x4c0ebc];return _0x8d02fc;};'use strict';var Sequelize=require('sequelize');module[_0xfb2a('0x0')]={'name':{'type':Sequelize[_0xfb2a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb2a('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xfb2a('0x2'),'no'),'defaultValue':_0xfb2a('0x2')},'headerinfo':{'type':Sequelize[_0xfb2a('0x1')],'defaultValue':_0xfb2a('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xfb2a('0x4')},'minrate':{'type':Sequelize[_0xfb2a('0x5')]('2400',_0xfb2a('0x6'),'7200','9600','12000',_0xfb2a('0x7')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xfb2a('0x5')]('2400',_0xfb2a('0x6'),'7200','9600',_0xfb2a('0x8'),_0xfb2a('0x7')),'defaultValue':_0xfb2a('0x7')},'modem':{'type':Sequelize[_0xfb2a('0x1')],'defaultValue':_0xfb2a('0x9')},'gateway':{'type':Sequelize[_0xfb2a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfb2a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xfb2a('0xa'),_0xfb2a('0xb'),_0xfb2a('0xc'),_0xfb2a('0xd')),'defaultValue':_0xfb2a('0xa')},'key':{'type':Sequelize[_0xfb2a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfb2a('0xe');}},'notificationSound':{'type':Sequelize[_0xfb2a('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb2a('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb2a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb2a('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb2a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb2a('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb2a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb2a('0x10')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfb2a('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x12be52){if(!_0x12be52)this[_0xfb2a('0x11')]('mandatoryDispositionPauseId',null);this[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x12be52);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ae91eb3..d1c79ba 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 _0x9a6f=['defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','find','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','Disposition','getDispositions','findOne','FaxAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x185514,_0x1cfef2){var _0x3d3945=function(_0x26df83){while(--_0x26df83){_0x185514['push'](_0x185514['shift']());}};_0x3d3945(++_0x1cfef2);}(_0x9a6f,0xb3));var _0xf9a6=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x9a6f[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9a6('0x0'));var zipdir=require(_0xf9a6('0x1'));var jsonpatch=require(_0xf9a6('0x2'));var rp=require('request-promise');var moment=require(_0xf9a6('0x3'));var BPromise=require(_0xf9a6('0x4'));var Mustache=require('mustache');var util=require(_0xf9a6('0x5'));var path=require(_0xf9a6('0x6'));var sox=require('sox');var csv=require(_0xf9a6('0x7'));var ejs=require(_0xf9a6('0x8'));var fs=require('fs');var fs_extra=require(_0xf9a6('0x9'));var _=require(_0xf9a6('0xa'));var squel=require(_0xf9a6('0xb'));var crypto=require(_0xf9a6('0xc'));var jsforce=require(_0xf9a6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9a6('0xe'));var Papa=require(_0xf9a6('0xf'));var Redis=require(_0xf9a6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf9a6('0x11'));var hardwareService=require(_0xf9a6('0x12'));var logger=require(_0xf9a6('0x13'))(_0xf9a6('0x14'));var utils=require(_0xf9a6('0x15'));var config=require(_0xf9a6('0x16'));var licenseUtil=require(_0xf9a6('0x17'));var db=require('../../mysqldb')['db'];config[_0xf9a6('0x18')]=_[_0xf9a6('0x19')](config[_0xf9a6('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9a6('0x1a'))(new Redis(config[_0xf9a6('0x18')]));require(_0xf9a6('0x1b'))[_0xf9a6('0x1c')](socket);var jayson=require(_0xf9a6('0x1d'));var client=jayson[_0xf9a6('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf9a6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44c149,_0x15313d,_0x598617,_0x2850f4){return new BPromise(function(_0x34741c,_0x48c03e){var _0x198c75=_0x2850f4||client;return _0x198c75[_0xf9a6('0x20')](_0x44c149,_0x598617)[_0xf9a6('0x21')](function(_0x360088){logger['info']('FaxAccount,\x20%s,\x20%s',_0x15313d,_0xf9a6('0x22'));logger[_0xf9a6('0x23')](_0xf9a6('0x24'),_0x15313d,'request\x20sent',JSON[_0xf9a6('0x25')](_0x360088));if(_0x360088[_0xf9a6('0x26')]){if(_0x360088[_0xf9a6('0x26')][_0xf9a6('0x27')]===0x1f4){logger[_0xf9a6('0x26')](_0xf9a6('0x28'),_0x15313d,_0x360088[_0xf9a6('0x26')][_0xf9a6('0x29')]);return _0x48c03e(_0x360088[_0xf9a6('0x26')]['message']);}logger[_0xf9a6('0x26')](_0xf9a6('0x28'),_0x15313d,_0x360088['error']['message']);return _0x34741c(_0x360088[_0xf9a6('0x26')][_0xf9a6('0x29')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x15313d,_0xf9a6('0x22'));_0x34741c(_0x360088[_0xf9a6('0x2a')][_0xf9a6('0x29')]);}})['catch'](function(_0x3cf7bb){logger[_0xf9a6('0x26')](_0xf9a6('0x28'),_0x15313d,_0x3cf7bb);_0x48c03e(_0x3cf7bb);});});}function respondWithStatusCode(_0x685b35,_0x5e14a8){_0x5e14a8=_0x5e14a8||0xcc;return function(_0x377051){if(_0x377051){return _0x685b35[_0xf9a6('0x2b')](_0x5e14a8);}return _0x685b35[_0xf9a6('0x2c')](_0x5e14a8)[_0xf9a6('0x2d')]();};}function respondWithResult(_0xd67320,_0x582a26){_0x582a26=_0x582a26||0xc8;return function(_0x47f0a6){if(_0x47f0a6){return _0xd67320[_0xf9a6('0x2c')](_0x582a26)[_0xf9a6('0x2e')](_0x47f0a6);}};}function respondWithFilteredResult(_0x1b7083,_0x25c76b){return function(_0x3cacee){if(_0x3cacee){var _0x54c77a=typeof _0x25c76b[_0xf9a6('0x2f')]===_0xf9a6('0x30')&&typeof _0x25c76b[_0xf9a6('0x31')]===_0xf9a6('0x30');var _0x5c1d84=_0x3cacee[_0xf9a6('0x32')];var _0x4a97e8=_0x54c77a?0x0:_0x25c76b[_0xf9a6('0x2f')];var _0x515384=_0x54c77a?_0x3cacee[_0xf9a6('0x32')]:_0x25c76b[_0xf9a6('0x2f')]+_0x25c76b[_0xf9a6('0x31')];var _0x5b9ea7;if(_0x515384>=_0x5c1d84){_0x515384=_0x5c1d84;_0x5b9ea7=0xc8;}else{_0x5b9ea7=0xce;}_0x1b7083['status'](_0x5b9ea7);return _0x1b7083[_0xf9a6('0x33')](_0xf9a6('0x34'),_0x4a97e8+'-'+_0x515384+'/'+_0x5c1d84)[_0xf9a6('0x2e')](_0x3cacee);}return null;};}function patchUpdates(_0x255be3){return function(_0x5f330a){try{jsonpatch['apply'](_0x5f330a,_0x255be3,!![]);}catch(_0xe78f22){return BPromise[_0xf9a6('0x35')](_0xe78f22);}return _0x5f330a[_0xf9a6('0x36')]();};}function saveUpdates(_0x146561,_0x2108c7){return function(_0x59a457){if(_0x59a457){return _0x59a457['update'](_0x146561)[_0xf9a6('0x21')](function(_0x350750){return _0x350750;});}return null;};}function removeEntity(_0x561d26,_0x33bde7){return function(_0x159c7d){if(_0x159c7d){return _0x159c7d['destroy']()['then'](function(){var _0xdc7924=_0x159c7d[_0xf9a6('0x37')]({'plain':!![]});var _0x455eb7='FaxAccounts';return db[_0xf9a6('0x38')]['destroy']({'where':{'type':_0x455eb7,'resourceId':_0xdc7924['id']}})['then'](function(){return _0x159c7d;});})[_0xf9a6('0x21')](function(){_0x561d26[_0xf9a6('0x2c')](0xcc)[_0xf9a6('0x2d')]();});}};}function handleEntityNotFound(_0x2dc6ff,_0x41b3ac){return function(_0x21eb20){if(!_0x21eb20){_0x2dc6ff[_0xf9a6('0x2b')](0x194);}return _0x21eb20;};}function handleError(_0x1f4cb0,_0x54a56b){_0x54a56b=_0x54a56b||0x1f4;return function(_0x255031){logger[_0xf9a6('0x26')](_0x255031[_0xf9a6('0x39')]);if(_0x255031[_0xf9a6('0x3a')]){delete _0x255031[_0xf9a6('0x3a')];}_0x1f4cb0[_0xf9a6('0x2c')](_0x54a56b)[_0xf9a6('0x3b')](_0x255031);};}exports[_0xf9a6('0x3c')]=function(_0x3fe401,_0x4fc9f2){var _0x211dbb={'include':[{'model':db[_0xf9a6('0x3d')],'as':_0xf9a6('0x3e')}]},_0x3f65c8={},_0x57d16d={'count':0x0,'rows':[]};var _0x4d6d7d=_[_0xf9a6('0x3f')](db[_0xf9a6('0x40')]['rawAttributes'],function(_0x4b8da6){return{'name':_0x4b8da6[_0xf9a6('0x41')],'type':_0x4b8da6[_0xf9a6('0x42')][_0xf9a6('0x43')]};});_0x3f65c8[_0xf9a6('0x44')]=_['map'](_0x4d6d7d,'name');_0x3f65c8[_0xf9a6('0x45')]=_['keys'](_0x3fe401[_0xf9a6('0x45')]);_0x3f65c8[_0xf9a6('0x46')]=_[_0xf9a6('0x47')](_0x3f65c8['model'],_0x3f65c8[_0xf9a6('0x45')]);_0x211dbb[_0xf9a6('0x48')]=_[_0xf9a6('0x47')](_0x3f65c8[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x3fe401['query'][_0xf9a6('0x49')]));_0x211dbb[_0xf9a6('0x48')]=_0x211dbb[_0xf9a6('0x48')][_0xf9a6('0x4a')]?_0x211dbb['attributes']:_0x3f65c8[_0xf9a6('0x44')];if(!_0x3fe401[_0xf9a6('0x45')][_0xf9a6('0x4b')](_0xf9a6('0x4c'))){_0x211dbb['limit']=qs['limit'](_0x3fe401[_0xf9a6('0x45')]['limit']);_0x211dbb[_0xf9a6('0x2f')]=qs[_0xf9a6('0x2f')](_0x3fe401[_0xf9a6('0x45')]['offset']);}_0x211dbb['order']=qs[_0xf9a6('0x4d')](_0x3fe401[_0xf9a6('0x45')][_0xf9a6('0x4d')]);_0x211dbb['where']=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x3fe401[_0xf9a6('0x45')],_0x3f65c8['filters']),_0x4d6d7d);if(_0x3fe401[_0xf9a6('0x45')][_0xf9a6('0x4f')]){_0x211dbb[_0xf9a6('0x50')]=_[_0xf9a6('0x51')](_0x211dbb[_0xf9a6('0x50')],{'$or':_['map'](_0x4d6d7d,function(_0x3644cb){if(_0x3644cb['type']!==_0xf9a6('0x52')){var _0x5e265a={};_0x5e265a[_0x3644cb[_0xf9a6('0x3a')]]={'$like':'%'+_0x3fe401[_0xf9a6('0x45')][_0xf9a6('0x4f')]+'%'};return _0x5e265a;}})});}_0x211dbb=_[_0xf9a6('0x51')]({},_0x211dbb,_0x3fe401[_0xf9a6('0x53')]);var _0x6c9cd6={'where':_0x211dbb['where']};return db['FaxAccount'][_0xf9a6('0x32')](_0x6c9cd6)[_0xf9a6('0x21')](function(_0x45cc07){_0x57d16d[_0xf9a6('0x32')]=_0x45cc07;if(_0x3fe401[_0xf9a6('0x45')][_0xf9a6('0x54')]){_0x211dbb['include']=[{'all':!![]}];}return db[_0xf9a6('0x40')][_0xf9a6('0x55')](_0x211dbb);})[_0xf9a6('0x21')](function(_0x15e7c1){_0x57d16d[_0xf9a6('0x56')]=_0x15e7c1;return _0x57d16d;})['then'](respondWithFilteredResult(_0x4fc9f2,_0x211dbb))[_0xf9a6('0x57')](handleError(_0x4fc9f2,null));};exports[_0xf9a6('0x58')]=function(_0x1c5182,_0x19abee){var _0x35673b={'raw':![],'where':{'id':_0x1c5182[_0xf9a6('0x59')]['id']},'include':[{'model':db[_0xf9a6('0x3d')],'as':_0xf9a6('0x3e')}]},_0x1f809b={};_0x1f809b[_0xf9a6('0x44')]=_[_0xf9a6('0x5a')](db[_0xf9a6('0x40')][_0xf9a6('0x5b')]);_0x1f809b[_0xf9a6('0x45')]=_[_0xf9a6('0x5a')](_0x1c5182[_0xf9a6('0x45')]);_0x1f809b[_0xf9a6('0x46')]=_['intersection'](_0x1f809b[_0xf9a6('0x44')],_0x1f809b[_0xf9a6('0x45')]);_0x35673b['attributes']=_[_0xf9a6('0x47')](_0x1f809b[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x1c5182[_0xf9a6('0x45')][_0xf9a6('0x49')]));_0x35673b[_0xf9a6('0x48')]=_0x35673b['attributes'][_0xf9a6('0x4a')]?_0x35673b['attributes']:_0x1f809b[_0xf9a6('0x44')];if(_0x1c5182['query']['includeAll']){_0x35673b[_0xf9a6('0x5c')]=[{'all':!![]}];}_0x35673b=_[_0xf9a6('0x51')]({},_0x35673b,_0x1c5182['options']);return db[_0xf9a6('0x40')]['find'](_0x35673b)[_0xf9a6('0x21')](handleEntityNotFound(_0x19abee,null))[_0xf9a6('0x21')](respondWithResult(_0x19abee,null))[_0xf9a6('0x57')](handleError(_0x19abee,null));};exports['create']=function(_0x877266,_0x248da5){return db[_0xf9a6('0x40')]['create'](_0x877266[_0xf9a6('0x5d')],{})[_0xf9a6('0x21')](function(_0x43938a){var _0x2da431=_0x877266[_0xf9a6('0x5e')][_0xf9a6('0x37')]({'plain':!![]});if(!_0x2da431)throw new Error(_0xf9a6('0x5f'));if(_0x2da431['role']===_0xf9a6('0x5e')){var _0x1d40cf=_0x43938a[_0xf9a6('0x37')]({'plain':!![]});var _0x330590=_0xf9a6('0x60');return db[_0xf9a6('0x61')][_0xf9a6('0x62')]({'where':{'name':_0x330590,'userProfileId':_0x2da431['userProfileId']},'raw':!![]})['then'](function(_0x4dd856){if(_0x4dd856&&_0x4dd856['autoAssociation']===0x0){return db[_0xf9a6('0x38')][_0xf9a6('0x63')]({'name':_0x1d40cf[_0xf9a6('0x3a')],'resourceId':_0x1d40cf['id'],'type':_0x4dd856['name'],'sectionId':_0x4dd856['id']},{})[_0xf9a6('0x21')](function(){return _0x43938a;});}else{return _0x43938a;}})[_0xf9a6('0x57')](function(_0x42f47a){logger['error'](_0xf9a6('0x64'),_0x42f47a);throw _0x42f47a;});}return _0x43938a;})[_0xf9a6('0x21')](respondWithResult(_0x248da5,0xc9))[_0xf9a6('0x57')](handleError(_0x248da5,null));};exports[_0xf9a6('0x65')]=function(_0x254424,_0x402172){if(_0x254424[_0xf9a6('0x5d')]['id']){delete _0x254424[_0xf9a6('0x5d')]['id'];}return db[_0xf9a6('0x40')]['find']({'where':{'id':_0x254424[_0xf9a6('0x59')]['id']},'include':[{'model':db[_0xf9a6('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x402172,null))[_0xf9a6('0x21')](saveUpdates(_0x254424['body'],null))[_0xf9a6('0x21')](respondWithResult(_0x402172,null))[_0xf9a6('0x57')](handleError(_0x402172,null));};exports[_0xf9a6('0x66')]=function(_0x30f69d,_0x3e1f47){return db[_0xf9a6('0x40')][_0xf9a6('0x62')]({'where':{'id':_0x30f69d[_0xf9a6('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e1f47,null))[_0xf9a6('0x21')](removeEntity(_0x3e1f47,null))[_0xf9a6('0x57')](handleError(_0x3e1f47,null));};exports['describe']=function(_0x3a4915,_0x454906){return db['FaxAccount'][_0xf9a6('0x67')]()[_0xf9a6('0x21')](respondWithResult(_0x454906,null))[_0xf9a6('0x57')](handleError(_0x454906,null));};exports[_0xf9a6('0x68')]=function(_0x275175,_0x16e07a,_0x5c653b){if(_0x275175['body']['id']){delete _0x275175['body']['id'];}return db[_0xf9a6('0x40')][_0xf9a6('0x62')]({'where':{'id':_0x275175[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x16e07a,null))[_0xf9a6('0x21')](function(_0x425a1a){if(_0x425a1a){_0x275175['body']['FaxAccountId']=_0x425a1a['id'];return db[_0xf9a6('0x69')][_0xf9a6('0x63')](_0x275175['body']);}})[_0xf9a6('0x21')](respondWithResult(_0x16e07a,null))['catch'](handleError(_0x16e07a,null));};exports[_0xf9a6('0x6a')]=function(_0x1b2e1c,_0x3e7a5e,_0x1bce3f){var _0x2348fa={'raw':![],'where':{}};var _0x519cc3={};var _0x336d85={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf9a6('0x6b')]({'where':{'id':_0x1b2e1c[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x3e7a5e,null))[_0xf9a6('0x21')](function(_0x14e031){if(_0x14e031){_0x519cc3['model']=_[_0xf9a6('0x5a')](db[_0xf9a6('0x69')][_0xf9a6('0x5b')]);_0x519cc3['query']=_['keys'](_0x1b2e1c[_0xf9a6('0x45')]);_0x519cc3[_0xf9a6('0x46')]=_[_0xf9a6('0x47')](_0x519cc3[_0xf9a6('0x44')],_0x519cc3[_0xf9a6('0x45')]);_0x2348fa[_0xf9a6('0x48')]=_['intersection'](_0x519cc3['model'],qs['fields'](_0x1b2e1c[_0xf9a6('0x45')]['fields']));_0x2348fa[_0xf9a6('0x48')]=_0x2348fa[_0xf9a6('0x48')][_0xf9a6('0x4a')]?_0x2348fa['attributes']:_0x519cc3['model'];if(!_0x1b2e1c[_0xf9a6('0x45')][_0xf9a6('0x4b')]('nolimit')){_0x2348fa['limit']=qs['limit'](_0x1b2e1c[_0xf9a6('0x45')][_0xf9a6('0x31')]);_0x2348fa[_0xf9a6('0x2f')]=qs[_0xf9a6('0x2f')](_0x1b2e1c['query'][_0xf9a6('0x2f')]);}_0x2348fa['order']=qs[_0xf9a6('0x4d')](_0x1b2e1c[_0xf9a6('0x45')][_0xf9a6('0x4d')]);_0x2348fa[_0xf9a6('0x50')]=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x1b2e1c[_0xf9a6('0x45')],_0x519cc3[_0xf9a6('0x46')]));_0x2348fa[_0xf9a6('0x50')][_0xf9a6('0x6c')]=_0x14e031['id'];if(_0x1b2e1c[_0xf9a6('0x45')]['filter']){_0x2348fa[_0xf9a6('0x50')]=_[_0xf9a6('0x51')](_0x2348fa[_0xf9a6('0x50')],{'$or':_[_0xf9a6('0x3f')](_0x2348fa[_0xf9a6('0x48')],function(_0x458090){var _0xf2dc1e={};_0xf2dc1e[_0x458090]={'$like':'%'+_0x1b2e1c['query'][_0xf9a6('0x4f')]+'%'};return _0xf2dc1e;})});}_0x2348fa=_[_0xf9a6('0x51')]({},_0x2348fa,_0x1b2e1c[_0xf9a6('0x53')]);return db[_0xf9a6('0x69')][_0xf9a6('0x32')]({'where':_0x2348fa[_0xf9a6('0x50')]})[_0xf9a6('0x21')](function(_0x12ea21){_0x336d85[_0xf9a6('0x32')]=_0x12ea21;if(_0x1b2e1c[_0xf9a6('0x45')][_0xf9a6('0x54')]){_0x2348fa[_0xf9a6('0x5c')]=[{'all':!![]}];}return db[_0xf9a6('0x69')][_0xf9a6('0x55')](_0x2348fa);})['then'](function(_0x3fef20){_0x336d85['rows']=_0x3fef20;return _0x336d85;});}})[_0xf9a6('0x21')](respondWithFilteredResult(_0x3e7a5e,_0x2348fa))[_0xf9a6('0x57')](handleError(_0x3e7a5e,null));};exports[_0xf9a6('0x6d')]=function(_0x3e521b,_0x4572c6,_0x2d8693){return db[_0xf9a6('0x40')][_0xf9a6('0x62')]({'where':{'id':_0x3e521b[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x4572c6,null))[_0xf9a6('0x21')](function(_0x565655){if(_0x565655){return _0x565655[_0xf9a6('0x6d')](_0x3e521b[_0xf9a6('0x45')][_0xf9a6('0x6e')]);}})[_0xf9a6('0x21')](respondWithStatusCode(_0x4572c6,null))['catch'](handleError(_0x4572c6,null));};exports[_0xf9a6('0x6f')]=function(_0x4ccc76,_0x5770c5,_0x613535){if(_0x4ccc76[_0xf9a6('0x5d')]['id']){delete _0x4ccc76[_0xf9a6('0x5d')]['id'];}return db[_0xf9a6('0x40')]['find']({'where':{'id':_0x4ccc76[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x5770c5,null))[_0xf9a6('0x21')](function(_0x45c034){if(_0x45c034){_0x4ccc76['body'][_0xf9a6('0x6c')]=_0x45c034['id'];return db['CannedAnswer'][_0xf9a6('0x63')](_0x4ccc76['body']);}})[_0xf9a6('0x21')](respondWithResult(_0x5770c5,null))['catch'](handleError(_0x5770c5,null));};exports[_0xf9a6('0x70')]=function(_0x23e738,_0x2fe5b2,_0x4ef61e){var _0x5c2efa={'raw':![],'where':{}};var _0x52f9be={};var _0x32feb9={'count':0x0,'rows':[]};return db[_0xf9a6('0x40')]['findOne']({'where':{'id':_0x23e738['params']['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x2fe5b2,null))[_0xf9a6('0x21')](function(_0x5b4ea1){if(_0x5b4ea1){_0x52f9be['model']=_['keys'](db[_0xf9a6('0x71')][_0xf9a6('0x5b')]);_0x52f9be['query']=_[_0xf9a6('0x5a')](_0x23e738[_0xf9a6('0x45')]);_0x52f9be[_0xf9a6('0x46')]=_[_0xf9a6('0x47')](_0x52f9be[_0xf9a6('0x44')],_0x52f9be[_0xf9a6('0x45')]);_0x5c2efa['attributes']=_['intersection'](_0x52f9be[_0xf9a6('0x44')],qs['fields'](_0x23e738['query'][_0xf9a6('0x49')]));_0x5c2efa[_0xf9a6('0x48')]=_0x5c2efa[_0xf9a6('0x48')]['length']?_0x5c2efa[_0xf9a6('0x48')]:_0x52f9be[_0xf9a6('0x44')];if(!_0x23e738[_0xf9a6('0x45')][_0xf9a6('0x4b')]('nolimit')){_0x5c2efa[_0xf9a6('0x31')]=qs[_0xf9a6('0x31')](_0x23e738[_0xf9a6('0x45')][_0xf9a6('0x31')]);_0x5c2efa[_0xf9a6('0x2f')]=qs[_0xf9a6('0x2f')](_0x23e738['query']['offset']);}_0x5c2efa[_0xf9a6('0x72')]=qs[_0xf9a6('0x4d')](_0x23e738[_0xf9a6('0x45')]['sort']);_0x5c2efa[_0xf9a6('0x50')]=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x23e738[_0xf9a6('0x45')],_0x52f9be[_0xf9a6('0x46')]));_0x5c2efa[_0xf9a6('0x50')][_0xf9a6('0x6c')]=_0x5b4ea1['id'];if(_0x23e738[_0xf9a6('0x45')][_0xf9a6('0x4f')]){_0x5c2efa[_0xf9a6('0x50')]=_['merge'](_0x5c2efa[_0xf9a6('0x50')],{'$or':_[_0xf9a6('0x3f')](_0x5c2efa[_0xf9a6('0x48')],function(_0x129d9f){var _0x2ad88b={};_0x2ad88b[_0x129d9f]={'$like':'%'+_0x23e738[_0xf9a6('0x45')][_0xf9a6('0x4f')]+'%'};return _0x2ad88b;})});}_0x5c2efa=_[_0xf9a6('0x51')]({},_0x5c2efa,_0x23e738[_0xf9a6('0x53')]);return db['CannedAnswer'][_0xf9a6('0x32')]({'where':_0x5c2efa[_0xf9a6('0x50')]})[_0xf9a6('0x21')](function(_0x6d3de1){_0x32feb9[_0xf9a6('0x32')]=_0x6d3de1;if(_0x23e738[_0xf9a6('0x45')]['includeAll']){_0x5c2efa[_0xf9a6('0x5c')]=[{'all':!![]}];}return db[_0xf9a6('0x71')][_0xf9a6('0x55')](_0x5c2efa);})['then'](function(_0x2f1a76){_0x32feb9[_0xf9a6('0x56')]=_0x2f1a76;return _0x32feb9;});}})[_0xf9a6('0x21')](respondWithFilteredResult(_0x2fe5b2,_0x5c2efa))['catch'](handleError(_0x2fe5b2,null));};exports[_0xf9a6('0x73')]=function(_0x282b75,_0x2fdbf7,_0x2ea4dd){return db['FaxAccount'][_0xf9a6('0x62')]({'where':{'id':_0x282b75['params']['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x2fdbf7,null))[_0xf9a6('0x21')](function(_0x4feac3){if(_0x4feac3){return _0x4feac3['removeAnswers'](_0x282b75[_0xf9a6('0x45')][_0xf9a6('0x6e')]);}})['then'](respondWithStatusCode(_0x2fdbf7,null))['catch'](handleError(_0x2fdbf7,null));};exports[_0xf9a6('0x74')]=function(_0xd5fe92,_0x435541,_0x1e3f06){return db[_0xf9a6('0x75')][_0xf9a6('0x62')]({'where':{'id':_0xd5fe92['params']['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x435541,null))['then'](function(_0x2a1e19){if(_0x2a1e19){return _0x2a1e19['addInteraction'](_0xd5fe92['body'][_0xf9a6('0x6e')],_['omit'](_0xd5fe92[_0xf9a6('0x5d')],[_0xf9a6('0x6e'),'id'])||{});}})[_0xf9a6('0x21')](respondWithResult(_0x435541,null))[_0xf9a6('0x57')](handleError(_0x435541,null));};exports['getInteractions']=function(_0x4cea74,_0x4f1843,_0x3967b1){var _0x2191c4={'raw':![],'where':{}};var _0x303226={};var _0x2fb6cd={'count':0x0,'rows':[]};return db[_0xf9a6('0x40')][_0xf9a6('0x6b')]({'where':{'id':_0x4cea74[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x4f1843,null))[_0xf9a6('0x21')](function(_0x129b09){if(_0x129b09){_0x303226[_0xf9a6('0x44')]=_['keys'](db['FaxInteraction'][_0xf9a6('0x5b')]);_0x303226[_0xf9a6('0x45')]=_[_0xf9a6('0x5a')](_0x4cea74[_0xf9a6('0x45')]);_0x303226[_0xf9a6('0x46')]=_[_0xf9a6('0x47')](_0x303226['model'],_0x303226[_0xf9a6('0x45')]);_0x2191c4[_0xf9a6('0x48')]=_['intersection'](_0x303226[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x49')]));_0x2191c4['attributes']=_0x2191c4[_0xf9a6('0x48')]['length']?_0x2191c4[_0xf9a6('0x48')]:_0x303226[_0xf9a6('0x44')];if(!_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x4b')]('nolimit')){_0x2191c4[_0xf9a6('0x31')]=qs[_0xf9a6('0x31')](_0x4cea74['query'][_0xf9a6('0x31')]);_0x2191c4['offset']=qs[_0xf9a6('0x2f')](_0x4cea74['query']['offset']);}_0x2191c4[_0xf9a6('0x72')]=qs[_0xf9a6('0x4d')](_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x4d')]);_0x2191c4['where']=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x4cea74[_0xf9a6('0x45')],_0x303226[_0xf9a6('0x46')]));_0x2191c4[_0xf9a6('0x50')][_0xf9a6('0x6c')]=_0x129b09['id'];if(_0x4cea74['query']['filter']){_0x2191c4['where']=_['merge'](_0x2191c4['where'],{'$or':_['map'](_0x2191c4[_0xf9a6('0x48')],function(_0x27ddef){var _0x16d544={};_0x16d544[_0x27ddef]={'$like':'%'+_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x4f')]+'%'};return _0x16d544;})});}_0x2191c4=_[_0xf9a6('0x51')]({},_0x2191c4,_0x4cea74[_0xf9a6('0x53')]);return db[_0xf9a6('0x75')][_0xf9a6('0x32')]({'where':_0x2191c4['where']})['then'](function(_0x415d8d){_0x2fb6cd[_0xf9a6('0x32')]=_0x415d8d;if(_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x54')]){_0x2191c4[_0xf9a6('0x5c')]=[{'model':db[_0xf9a6('0x76')],'as':_0xf9a6('0x77'),'required':![]},{'model':db[_0xf9a6('0x78')],'as':_0xf9a6('0x79'),'attributes':[_0xf9a6('0x3a'),_0xf9a6('0x7a'),_0xf9a6('0x7b')],'required':![]},{'model':db[_0xf9a6('0x7c')],'as':_0xf9a6('0x7d'),'attributes':['id','name',_0xf9a6('0x7e')],'where':_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x7f')]?{'id':_0x4cea74[_0xf9a6('0x45')]['tag']}:undefined,'required':_0x4cea74[_0xf9a6('0x45')][_0xf9a6('0x7f')]?!![]:![]}];}return db[_0xf9a6('0x75')]['findAll'](_0x2191c4);})[_0xf9a6('0x21')](function(_0x35865a){_0x2fb6cd[_0xf9a6('0x56')]=_0x35865a;return _0x2fb6cd;});}})[_0xf9a6('0x21')](respondWithFilteredResult(_0x4f1843,_0x2191c4))[_0xf9a6('0x57')](handleError(_0x4f1843,null));};exports[_0xf9a6('0x80')]=function(_0x331a9d,_0x4c60e3){var _0x1d84d8=_0x331a9d[_0xf9a6('0x59')]['id'];var _0x1d24d5=_0x331a9d[_0xf9a6('0x5d')];var _0x354f88=0xc8;var _0x359444=null;return db[_0xf9a6('0x81')][_0xf9a6('0x82')]({'isolationLevel':db[_0xf9a6('0x81')][_0xf9a6('0x83')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5726c0){return db[_0xf9a6('0x40')][_0xf9a6('0x6b')]({'where':{'id':_0x1d84d8},'transaction':_0x5726c0})['then'](function(_0x3ad384){if(_0x3ad384){return db[_0xf9a6('0x84')]['destroy']({'where':{'FaxAccountId':_0x1d84d8},'transaction':_0x5726c0})[_0xf9a6('0x21')](function(){var _0x376f27=_[_0xf9a6('0x3f')](_0x1d24d5,function(_0x484b4f){_0x484b4f[_0xf9a6('0x6c')]=_0x1d84d8;return _0x484b4f;});return db[_0xf9a6('0x84')][_0xf9a6('0x85')](_0x376f27,{'transaction':_0x5726c0});});}else{_0x354f88=0x194;_0x359444=[];}});})['then'](function(){if(_0x354f88!==0x194){return db['FaxApplication'][_0xf9a6('0x86')]({'where':{'FaxAccountId':_0x1d84d8},'order':_0xf9a6('0x87')})[_0xf9a6('0x21')](function(_0x228dd2){_0x359444=_0x228dd2;});}})['catch'](function(_0x30ac41){_0x354f88=0x1f4;logger[_0xf9a6('0x26')](_0x30ac41[_0xf9a6('0x39')]);if(_0x30ac41[_0xf9a6('0x3a')]){delete _0x30ac41['name'];}_0x359444=_0x30ac41;})[_0xf9a6('0x88')](function(){if(_0x359444===null){_0x4c60e3[_0xf9a6('0x2b')](_0x354f88);}else{if(_0x354f88===0x1f4){_0x4c60e3['status'](_0x354f88)['send'](_0x359444);}else{_0x4c60e3['status'](_0x354f88)[_0xf9a6('0x2e')](_0x359444);}}});};exports['getApplications']=function(_0x446bf8,_0x1253cb,_0xf4e742){var _0x4c533f={};var _0x56dc6c={};var _0x47ea2d;var _0x43ae1d;return db[_0xf9a6('0x40')][_0xf9a6('0x6b')]({'where':{'id':_0x446bf8[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x1253cb,null))[_0xf9a6('0x21')](function(_0x2d6f28){if(_0x2d6f28){_0x47ea2d=_0x2d6f28;_0x56dc6c['model']=_[_0xf9a6('0x5a')](db[_0xf9a6('0x84')][_0xf9a6('0x5b')]);_0x56dc6c[_0xf9a6('0x45')]=_['keys'](_0x446bf8[_0xf9a6('0x45')]);_0x56dc6c[_0xf9a6('0x46')]=_[_0xf9a6('0x47')](_0x56dc6c[_0xf9a6('0x44')],_0x56dc6c['query']);_0x4c533f[_0xf9a6('0x48')]=_[_0xf9a6('0x47')](_0x56dc6c[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x446bf8[_0xf9a6('0x45')]['fields']));_0x4c533f[_0xf9a6('0x48')]=_0x4c533f[_0xf9a6('0x48')]['length']?_0x4c533f[_0xf9a6('0x48')]:_0x56dc6c[_0xf9a6('0x44')];_0x4c533f[_0xf9a6('0x72')]=qs[_0xf9a6('0x4d')](_0x446bf8[_0xf9a6('0x45')]['sort']);_0x4c533f[_0xf9a6('0x50')]=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x446bf8['query'],_0x56dc6c[_0xf9a6('0x46')]));if(_0x446bf8[_0xf9a6('0x45')][_0xf9a6('0x4f')]){_0x4c533f['where']=_[_0xf9a6('0x51')](_0x4c533f[_0xf9a6('0x50')],{'$or':_[_0xf9a6('0x3f')](_0x4c533f[_0xf9a6('0x48')],function(_0x27ee4f){var _0xa1f59e={};_0xa1f59e[_0x27ee4f]={'$like':'%'+_0x446bf8[_0xf9a6('0x45')]['filter']+'%'};return _0xa1f59e;})});}_0x4c533f=_[_0xf9a6('0x51')]({},_0x4c533f,_0x446bf8[_0xf9a6('0x53')]);return _0x47ea2d[_0xf9a6('0x89')](_0x4c533f);}})[_0xf9a6('0x21')](function(_0x379d99){if(_0x379d99){_0x43ae1d=_0x379d99[_0xf9a6('0x4a')];if(!_0x446bf8[_0xf9a6('0x45')][_0xf9a6('0x4b')](_0xf9a6('0x4c'))){_0x4c533f['limit']=qs[_0xf9a6('0x31')](_0x446bf8[_0xf9a6('0x45')][_0xf9a6('0x31')]);_0x4c533f[_0xf9a6('0x2f')]=qs[_0xf9a6('0x2f')](_0x446bf8[_0xf9a6('0x45')][_0xf9a6('0x2f')]);}return _0x47ea2d[_0xf9a6('0x89')](_0x4c533f);}})[_0xf9a6('0x21')](function(_0x18f228){if(_0x18f228){return _0x18f228?{'count':_0x43ae1d,'rows':_0x18f228}:null;}})[_0xf9a6('0x21')](respondWithResult(_0x1253cb,null))['catch'](handleError(_0x1253cb,null));};function Extension(_0x4fc94c,_0x5b6de5,_0x44044e,_0xf16738){this[_0xf9a6('0x8a')]=_0xf9a6('0x8b');this['exten']=_0x4fc94c[_0xf9a6('0x8c')];this[_0xf9a6('0x8d')]=_0xf16738;this[_0xf9a6('0x42')]=_0xf9a6('0x8e');this[_0xf9a6('0x8f')]='Fax\x20Extension';this[_0xf9a6('0x6c')]=_0x4fc94c['id'];this[_0xf9a6('0x87')]=_0x5b6de5;this[_0xf9a6('0x90')]=_0x44044e;}function createExtensionsReciveFax(_0x343571){var _0x2e9668=0x1;var _0x2f866f=[];_0x2f866f[_0xf9a6('0x91')](new Extension(_0x343571,_0x2e9668,'','Answer'));_0x2e9668+=0x1;_0x2f866f[_0xf9a6('0x91')](new Extension(_0x343571,_0x2e9668,_0xf9a6('0x92'),_0xf9a6('0x93')));_0x2e9668+=0x1;for(var _0x4b3cad in _0x343571){if(_0x343571[_0xf9a6('0x4b')](_0x4b3cad)&&(_0x4b3cad==='ecm'||_0x4b3cad===_0xf9a6('0x8c')||_0x4b3cad===_0xf9a6('0x94')||_0x4b3cad===_0xf9a6('0x95')||_0x4b3cad===_0xf9a6('0x96')||_0x4b3cad===_0xf9a6('0x97')||_0x4b3cad==='minrate'||_0x4b3cad===_0xf9a6('0x98')||_0x4b3cad===_0xf9a6('0x99'))){_0x2f866f[_0xf9a6('0x91')](new Extension(_0x343571,_0x2e9668,_0xf9a6('0x9a')+_0x4b3cad+')='+_0x343571[_0x4b3cad],_0xf9a6('0x93')));_0x2e9668+=0x1;}}_0x2f866f[_0xf9a6('0x91')](new Extension(_0x343571,_0x2e9668,'6',_0xf9a6('0x9b')));_0x2e9668+=0x1;_0x2f866f[_0xf9a6('0x91')](new Extension(_0x343571,_0x2e9668,_0xf9a6('0x9c'),_0xf9a6('0x9d')));_0x2e9668=0x0;return _0x2f866f;}exports[_0xf9a6('0x9e')]=function(_0xe9d7d1,_0x5591fb,_0xd6b71){var _0x5c1149;return db['sequelize'][_0xf9a6('0x82')](function(_0x456990){return db[_0xf9a6('0x40')][_0xf9a6('0x63')](_0xe9d7d1[_0xf9a6('0x5d')],{'transaction':_0x456990})['then'](function(_0x72dbcf){_0x5c1149=_0x72dbcf[_0xf9a6('0x37')]({'plain':!![]});return db[_0xf9a6('0x9f')]['bulkCreate'](createExtensionsReciveFax(_0x5c1149),{'transaction':_0x456990});});})[_0xf9a6('0x21')](function(){return _0x5c1149;})[_0xf9a6('0x21')](respondWithResult(_0x5591fb,null))[_0xf9a6('0x57')](handleError(_0x5591fb,null));};exports['updateAccountApplications']=function(_0x3a6d22,_0x248f78,_0x539c7f){var _0x165ccc;return db['sequelize'][_0xf9a6('0x82')](function(_0x68139d){return db['FaxAccount'][_0xf9a6('0x65')](_0x3a6d22[_0xf9a6('0x5d')],{'where':{'id':_0x3a6d22[_0xf9a6('0x5d')]['id']},'transaction':_0x68139d})['then'](function(_0x4b5dad){return db[_0xf9a6('0x9f')][_0xf9a6('0x66')]({'where':{'FaxAccountId':_0x3a6d22[_0xf9a6('0x5d')]['id']},'transaction':_0x68139d})[_0xf9a6('0x21')](function(_0x4a04b7){return db['VoiceExtension'][_0xf9a6('0x85')](createExtensionsReciveFax(_['omit'](_0x3a6d22[_0xf9a6('0x5d')],[_0xf9a6('0xa0'),'key',_0xf9a6('0xa1'),_0xf9a6('0xa2'),_0xf9a6('0xa3'),_0xf9a6('0xa4')])),{'transaction':_0x68139d});});});})['then'](function(){return db[_0xf9a6('0x40')][_0xf9a6('0xa5')](_0x3a6d22[_0xf9a6('0x5d')]['id']);})[_0xf9a6('0x21')](respondWithResult(_0x248f78,null))['catch'](handleError(_0x248f78,null));};exports['getMessages']=function(_0x2bd17c,_0x9ff8da,_0xa745ea){var _0x1c209b={'raw':!![],'where':{}};var _0x186a17={};var _0x381455={'count':0x0,'rows':[]};return db[_0xf9a6('0x40')][_0xf9a6('0x6b')]({'where':{'id':_0x2bd17c['params']['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x9ff8da,null))[_0xf9a6('0x21')](function(_0x139407){if(_0x139407){_0x186a17[_0xf9a6('0x44')]=_['keys'](db[_0xf9a6('0xa6')][_0xf9a6('0x5b')]);_0x186a17['query']=_[_0xf9a6('0x5a')](_0x2bd17c[_0xf9a6('0x45')]);_0x186a17[_0xf9a6('0x46')]=_['intersection'](_0x186a17[_0xf9a6('0x44')],_0x186a17['query']);_0x1c209b[_0xf9a6('0x48')]=_[_0xf9a6('0x47')](_0x186a17[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x2bd17c[_0xf9a6('0x45')]['fields']));_0x1c209b[_0xf9a6('0x48')]=_0x1c209b[_0xf9a6('0x48')][_0xf9a6('0x4a')]?_0x1c209b[_0xf9a6('0x48')]:_0x186a17[_0xf9a6('0x44')];if(!_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x4b')](_0xf9a6('0x4c'))){_0x1c209b['limit']=qs[_0xf9a6('0x31')](_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x31')]);_0x1c209b['offset']=qs['offset'](_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x2f')]);}_0x1c209b[_0xf9a6('0x72')]=qs[_0xf9a6('0x4d')](_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x4d')]);_0x1c209b[_0xf9a6('0x50')]=qs[_0xf9a6('0x46')](_[_0xf9a6('0x4e')](_0x2bd17c[_0xf9a6('0x45')],_0x186a17[_0xf9a6('0x46')]));_0x1c209b[_0xf9a6('0x50')][_0xf9a6('0x6c')]=_0x139407['id'];if(_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x4f')]){_0x1c209b['where']=_['merge'](_0x1c209b[_0xf9a6('0x50')],{'$or':_[_0xf9a6('0x3f')](_0x1c209b[_0xf9a6('0x48')],function(_0x3d0ec1){var _0x208e29={};_0x208e29[_0x3d0ec1]={'$like':'%'+_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x4f')]+'%'};return _0x208e29;})});}if(_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0xa7')]){var _0x181f1d=_0x2bd17c['query']['$gte'][_0xf9a6('0xa8')](',');var _0x3527c5={};_0x3527c5[_0x181f1d[0x0]]={'$gte':moment(_0x181f1d[0x1])[_0xf9a6('0xa9')](_0xf9a6('0xaa'))};_0x1c209b[_0xf9a6('0x50')]=_['merge'](_0x1c209b[_0xf9a6('0x50')],_0x3527c5);}_0x1c209b=_[_0xf9a6('0x51')]({},_0x1c209b,_0x2bd17c[_0xf9a6('0x53')]);return db[_0xf9a6('0xa6')][_0xf9a6('0x32')]({'where':_0x1c209b[_0xf9a6('0x50')]})['then'](function(_0x12ba44){_0x381455[_0xf9a6('0x32')]=_0x12ba44;if(_0x2bd17c[_0xf9a6('0x45')][_0xf9a6('0x54')]){_0x1c209b[_0xf9a6('0x5c')]=[{'all':!![]}];}return db[_0xf9a6('0xa6')][_0xf9a6('0x55')](_0x1c209b);})[_0xf9a6('0x21')](function(_0x31d4dc){_0x381455['rows']=_0x31d4dc;return _0x381455;});}})['then'](respondWithFilteredResult(_0x9ff8da,_0x1c209b))[_0xf9a6('0x57')](handleError(_0x9ff8da,null));};exports[_0xf9a6('0x3b')]=function(_0x2db52c,_0x2f8e9a,_0x5e0447){var _0x20169c,_0x5d183e={},_0x3478fe;if(_0x2db52c[_0xf9a6('0x5d')]['to']){_0x3478fe=_0x2db52c['body']['to'][0x0];}return db['FaxAccount'][_0xf9a6('0x62')]({'where':{'id':_0x2db52c[_0xf9a6('0x59')]['id']},'include':[{'model':db[_0xf9a6('0xab')],'as':_0xf9a6('0xac'),'include':[{'model':db[_0xf9a6('0x76')],'as':_0xf9a6('0xad'),'where':{'fax':_0x3478fe},'limit':0x1,'order':[[_0xf9a6('0xa2'),_0xf9a6('0xae')]]}]}]})['then'](handleEntityNotFound(_0x2f8e9a,null))[_0xf9a6('0x21')](function(_0x9c6cd){_0x20169c=_0x9c6cd;if(_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')]&&_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')]['length']){for(var _0x5a7fcb=0x0;_0x5a7fcb<_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][_0xf9a6('0x4a')];_0x5a7fcb+=0x1){_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][_0x5a7fcb]={'filename':_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][_0x5a7fcb]['name'],'id':_0x2db52c[_0xf9a6('0x5d')]['attachments'][_0x5a7fcb]['id'],'path':path[_0xf9a6('0xb0')](config[_0xf9a6('0xb1')],_0xf9a6('0xb2'),_0x2db52c['body']['attachments'][_0x5a7fcb][_0xf9a6('0xb3')])};}}return respondWithRpcPromise(_0xf9a6('0xb4'),_0xf9a6('0xb4'),{'FaxAccountId':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x59')]['id'])?undefined:_0x2db52c[_0xf9a6('0x59')]['id'],'path':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][0x0]['path'])?undefined:_0x2db52c[_0xf9a6('0x5d')]['attachments'][0x0]['path'],'fax':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x5d')]['to'][0x0])?undefined:_0x2db52c[_0xf9a6('0x5d')]['to'][0x0]},client9002);})[_0xf9a6('0x21')](function(){if(_0x20169c){if(_['isNil'](_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xb6')])){_0x2db52c[_0xf9a6('0x5d')]['from']=util[_0xf9a6('0xa9')](_0xf9a6('0xb7'),_0x20169c[_0xf9a6('0x3a')],_0x20169c[_0xf9a6('0xb8')]);}if(_0x20169c[_0xf9a6('0xac')]){if(_0x20169c['List'][_0xf9a6('0xad')][_0xf9a6('0x4a')]){return _0x20169c['List'][_0xf9a6('0xad')][0x0];}else{return db[_0xf9a6('0x76')]['create'](_[_0xf9a6('0x19')](_0x2db52c[_0xf9a6('0x5d')],{'firstName':_0x2db52c[_0xf9a6('0x5d')]['to'][0x0],'phone':_0x2db52c[_0xf9a6('0x5d')]['to'][0x0],'fax':_0x2db52c['body']['to'][0x0],'ListId':_0x20169c['ListId']}));}}else{throw new Error(_0xf9a6('0xb9'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0xc2243a){if(_0xc2243a){return db[_0xf9a6('0x75')][_0xf9a6('0x62')]({'where':{'ContactId':_0xc2243a['id'],'closed':![],'FaxAccountId':_0x20169c['id']}})[_0xf9a6('0x21')](function(_0x368169){if(_0x368169){return[_0x368169,![]];}return db['FaxInteraction'][_0xf9a6('0x63')]({'UserId':_0x2db52c[_0xf9a6('0x5e')]['id'],'ContactId':_0xc2243a['id'],'FaxAccountId':_0x20169c['id'],'fax':_0x2db52c[_0xf9a6('0x5d')]['to'][0x0],'firstMsgDirection':_0xf9a6('0xba'),'Messages':[_[_0xf9a6('0x51')](_0x2db52c['body'],{'read':![],'body':_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][0x0][_0xf9a6('0xbb')],'FaxAccountId':_0x20169c['id'],'UserId':_0x2db52c[_0xf9a6('0x5e')]['id'],'ContactId':_0xc2243a['id'],'AttachmentId':_0x2db52c['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xf9a6('0xa6')],'as':_0xf9a6('0xbc')}]})['then'](function(_0x4a0cc5){return[_0x4a0cc5,!![]];});});}else{throw new Error(_0xf9a6('0xbd'));}})[_0xf9a6('0xbe')](function(_0x43c389,_0x2caa11){if(_0x2caa11){return _0x43c389;}return db[_0xf9a6('0xa6')]['create']({'direction':_0xf9a6('0xba'),'read':![],'body':_0x2db52c[_0xf9a6('0x5d')]['attachments'][0x0][_0xf9a6('0xbb')],'FaxAccountId':_0x20169c['id'],'FaxInteractionId':_0x43c389['id'],'UserId':_0x2db52c['user']['id'],'ContactId':_0x43c389[_0xf9a6('0xbf')],'AttachmentId':_0x2db52c[_0xf9a6('0x5d')]['attachments'][0x0]['id']})['then'](function(_0x4ca5b7){_0x43c389[_0xf9a6('0xc0')][_0xf9a6('0xbc')]=[];_0x43c389[_0xf9a6('0xc0')][_0xf9a6('0xbc')][_0xf9a6('0x91')](_0x4ca5b7['dataValues']);return _0x43c389;});})[_0xf9a6('0x21')](function(_0x38bb25){respondWithRpcPromise(_0xf9a6('0xc1'),_0xf9a6('0xc1'),{'FaxAccountId':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x59')]['id'])?undefined:_0x2db52c[_0xf9a6('0x59')]['id'],'path':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][0x0]['path'])?undefined:_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][0x0][_0xf9a6('0x6')],'fax':_[_0xf9a6('0xb5')](_0x2db52c[_0xf9a6('0x5d')]['to'][0x0])?undefined:_0x2db52c[_0xf9a6('0x5d')]['to'][0x0],'AttachmentId':_0x2db52c[_0xf9a6('0x5d')][_0xf9a6('0xaf')][0x0]['id']},client9002)[_0xf9a6('0x21')](function(_0x30eeb5){logger[_0xf9a6('0xc2')](_0xf9a6('0xc3'),_0x30eeb5);})[_0xf9a6('0x57')](function(_0x1ecefa){logger[_0xf9a6('0xc2')](_0xf9a6('0xc3'),_0x1ecefa);});return _0x38bb25;})[_0xf9a6('0x21')](respondWithResult(_0x2f8e9a,null))[_0xf9a6('0x57')](handleError(_0x2f8e9a,null));};exports[_0xf9a6('0xc4')]=function(_0x428e4c,_0xa82820,_0x38cb93){return db['FaxAccount'][_0xf9a6('0x62')]({'where':{'id':_0x428e4c[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0xa82820,null))[_0xf9a6('0x21')](function(_0x1cf9cf){if(_0x1cf9cf){return _0x1cf9cf['addAgents'](_0x428e4c[_0xf9a6('0x5d')][_0xf9a6('0x6e')],_[_0xf9a6('0xc5')](_0x428e4c[_0xf9a6('0x5d')],['ids','id'])||{})[_0xf9a6('0xbe')](function(_0xa100ed){for(var _0x4caad2=0x0;_0x4caad2<_0x428e4c['body'][_0xf9a6('0x6e')][_0xf9a6('0x4a')];_0x4caad2+=0x1){socket[_0xf9a6('0xc6')](_0xf9a6('0xc7'),{'UserId':Number(_0x428e4c['body']['ids'][_0x4caad2]),'FaxAccountId':Number(_0x428e4c[_0xf9a6('0x59')]['id'])});}return _0xa100ed;});}})[_0xf9a6('0x21')](respondWithResult(_0xa82820,null))[_0xf9a6('0x57')](handleError(_0xa82820,null));};exports['removeAgents']=function(_0x23af11,_0x2b8ba4,_0x12251c){return db[_0xf9a6('0x40')][_0xf9a6('0x62')]({'where':{'id':_0x23af11[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x2b8ba4,null))['then'](function(_0x33085d){if(_0x33085d){return _0x33085d[_0xf9a6('0xc8')](_0x23af11[_0xf9a6('0x45')][_0xf9a6('0x6e')])[_0xf9a6('0x21')](function(){if(_[_0xf9a6('0xc9')](_0x23af11[_0xf9a6('0x45')][_0xf9a6('0x6e')])){for(var _0x446aa4=0x0;_0x446aa4<_0x23af11[_0xf9a6('0x45')]['ids'][_0xf9a6('0x4a')];_0x446aa4+=0x1){socket[_0xf9a6('0xc6')](_0xf9a6('0xca'),{'UserId':Number(_0x23af11[_0xf9a6('0x45')][_0xf9a6('0x6e')][_0x446aa4]),'FaxAccountId':Number(_0x23af11[_0xf9a6('0x59')]['id'])});}}else{socket[_0xf9a6('0xc6')](_0xf9a6('0xca'),{'UserId':Number(_0x23af11[_0xf9a6('0x45')]['ids']),'FaxAccountId':Number(_0x23af11[_0xf9a6('0x59')]['id'])});}});}})[_0xf9a6('0x21')](respondWithStatusCode(_0x2b8ba4,null))[_0xf9a6('0x57')](handleError(_0x2b8ba4,null));};exports['getAgents']=function(_0x372a12,_0x5b35ba,_0x1849a8){var _0x49b2a0={};var _0x53aa24={};var _0x516e49;var _0x1a4257;return db['FaxAccount']['findOne']({'where':{'id':_0x372a12[_0xf9a6('0x59')]['id']}})[_0xf9a6('0x21')](handleEntityNotFound(_0x5b35ba,null))[_0xf9a6('0x21')](function(_0xe6766e){if(_0xe6766e){_0x516e49=_0xe6766e;_0x53aa24[_0xf9a6('0x44')]=_['keys'](db[_0xf9a6('0x78')]['rawAttributes']);_0x53aa24[_0xf9a6('0x45')]=_[_0xf9a6('0x5a')](_0x372a12[_0xf9a6('0x45')]);_0x53aa24[_0xf9a6('0x46')]=_['intersection'](_0x53aa24[_0xf9a6('0x44')],_0x53aa24[_0xf9a6('0x45')]);_0x49b2a0['attributes']=_[_0xf9a6('0x47')](_0x53aa24[_0xf9a6('0x44')],qs[_0xf9a6('0x49')](_0x372a12[_0xf9a6('0x45')][_0xf9a6('0x49')]));_0x49b2a0['attributes']=_0x49b2a0['attributes']['length']?_0x49b2a0[_0xf9a6('0x48')]:_0x53aa24['model'];_0x49b2a0[_0xf9a6('0x72')]=qs['sort'](_0x372a12[_0xf9a6('0x45')][_0xf9a6('0x4d')]);_0x49b2a0['where']=qs[_0xf9a6('0x46')](_['pick'](_0x372a12['query'],_0x53aa24[_0xf9a6('0x46')]));if(_0x372a12[_0xf9a6('0x45')]['filter']){_0x49b2a0[_0xf9a6('0x50')]=_[_0xf9a6('0x51')](_0x49b2a0[_0xf9a6('0x50')],{'$or':_[_0xf9a6('0x3f')](_0x49b2a0[_0xf9a6('0x48')],function(_0x4e24b1){var _0x258535={};_0x258535[_0x4e24b1]={'$like':'%'+_0x372a12['query']['filter']+'%'};return _0x258535;})});}_0x49b2a0=_[_0xf9a6('0x51')]({},_0x49b2a0,_0x372a12[_0xf9a6('0x53')]);return _0x516e49[_0xf9a6('0xcb')](_0x49b2a0);}})['then'](function(_0x4988c2){if(_0x4988c2){_0x1a4257=_0x4988c2[_0xf9a6('0x4a')];if(!_0x372a12['query'][_0xf9a6('0x4b')](_0xf9a6('0x4c'))){_0x49b2a0[_0xf9a6('0x31')]=qs[_0xf9a6('0x31')](_0x372a12[_0xf9a6('0x45')][_0xf9a6('0x31')]);_0x49b2a0['offset']=qs['offset'](_0x372a12[_0xf9a6('0x45')][_0xf9a6('0x2f')]);}return _0x516e49['getAgents'](_0x49b2a0);}})[_0xf9a6('0x21')](function(_0x12ffe7){if(_0x12ffe7){return _0x12ffe7?{'count':_0x1a4257,'rows':_0x12ffe7}:null;}})[_0xf9a6('0x21')](respondWithResult(_0x5b35ba,null))[_0xf9a6('0x57')](handleError(_0x5b35ba,null));}; \ No newline at end of file +var _0xfe42=['Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','info','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','jayson/promise','client','http','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','then','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','include','findAll','rows','show','params','includeAll','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','options','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','fullname','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','stack','finally','getApplications','context','from-voip-provider','exten','app','description','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','minrate','modem','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','updateAccountApplications','omit','tech','createdAt','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','attachments','root','CheckAfterSend','isNil','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages'];(function(_0x9ef628,_0xcf4922){var _0x5cd439=function(_0x3a583f){while(--_0x3a583f){_0x9ef628['push'](_0x9ef628['shift']());}};_0x5cd439(++_0xcf4922);}(_0xfe42,0xcc));var _0x2fe4=function(_0x16c0a2,_0x247756){_0x16c0a2=_0x16c0a2-0x0;var _0x22ca95=_0xfe42[_0x16c0a2];return _0x22ca95;};'use strict';var emlformat=require(_0x2fe4('0x0'));var rimraf=require(_0x2fe4('0x1'));var zipdir=require(_0x2fe4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fe4('0x3'));var moment=require('moment');var BPromise=require(_0x2fe4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2fe4('0x5'));var sox=require(_0x2fe4('0x6'));var csv=require(_0x2fe4('0x7'));var ejs=require(_0x2fe4('0x8'));var fs=require('fs');var fs_extra=require(_0x2fe4('0x9'));var _=require('lodash');var squel=require(_0x2fe4('0xa'));var crypto=require(_0x2fe4('0xb'));var jsforce=require(_0x2fe4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2fe4('0x7'));var querystring=require(_0x2fe4('0xd'));var Papa=require(_0x2fe4('0xe'));var Redis=require('ioredis');var authService=require(_0x2fe4('0xf'));var qs=require(_0x2fe4('0x10'));var as=require(_0x2fe4('0x11'));var hardwareService=require(_0x2fe4('0x12'));var logger=require(_0x2fe4('0x13'))(_0x2fe4('0x14'));var utils=require('../../config/utils');var config=require(_0x2fe4('0x15'));var licenseUtil=require(_0x2fe4('0x16'));var db=require(_0x2fe4('0x17'))['db'];config[_0x2fe4('0x18')]=_['defaults'](config['redis'],{'host':_0x2fe4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fe4('0x18')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x2fe4('0x1a'));var client=jayson[_0x2fe4('0x1b')][_0x2fe4('0x1c')]({'port':0x232c});var client9002=jayson[_0x2fe4('0x1b')][_0x2fe4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x357b6c,_0x47b1c5,_0x2ce672,_0x1357b7){return new BPromise(function(_0x476b8c,_0x50615e){var _0x2827b9=_0x1357b7||client;return _0x2827b9['request'](_0x357b6c,_0x2ce672)['then'](function(_0x5de679){logger['info'](_0x2fe4('0x1d'),_0x47b1c5,'request\x20sent');logger[_0x2fe4('0x1e')](_0x2fe4('0x1f'),_0x47b1c5,_0x2fe4('0x20'),JSON[_0x2fe4('0x21')](_0x5de679));if(_0x5de679['error']){if(_0x5de679['error'][_0x2fe4('0x22')]===0x1f4){logger['error'](_0x2fe4('0x1d'),_0x47b1c5,_0x5de679[_0x2fe4('0x23')][_0x2fe4('0x24')]);return _0x50615e(_0x5de679['error'][_0x2fe4('0x24')]);}logger['error'](_0x2fe4('0x1d'),_0x47b1c5,_0x5de679['error'][_0x2fe4('0x24')]);return _0x476b8c(_0x5de679[_0x2fe4('0x23')][_0x2fe4('0x24')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x47b1c5,'request\x20sent');_0x476b8c(_0x5de679[_0x2fe4('0x25')][_0x2fe4('0x24')]);}})[_0x2fe4('0x26')](function(_0x5e1e46){logger['error'](_0x2fe4('0x1d'),_0x47b1c5,_0x5e1e46);_0x50615e(_0x5e1e46);});});}function respondWithStatusCode(_0x23f615,_0x1abee3){_0x1abee3=_0x1abee3||0xcc;return function(_0x2925c2){if(_0x2925c2){return _0x23f615[_0x2fe4('0x27')](_0x1abee3);}return _0x23f615['status'](_0x1abee3)['end']();};}function respondWithResult(_0x199a25,_0xb8bfa){_0xb8bfa=_0xb8bfa||0xc8;return function(_0xd6582b){if(_0xd6582b){return _0x199a25[_0x2fe4('0x28')](_0xb8bfa)[_0x2fe4('0x29')](_0xd6582b);}};}function respondWithFilteredResult(_0xc1281d,_0x2c3c5b){return function(_0x496920){if(_0x496920){var _0x4e5f1e=typeof _0x2c3c5b[_0x2fe4('0x2a')]==='undefined'&&typeof _0x2c3c5b['limit']===_0x2fe4('0x2b');var _0x23588c=_0x496920['count'];var _0xa4c8af=_0x4e5f1e?0x0:_0x2c3c5b[_0x2fe4('0x2a')];var _0x475587=_0x4e5f1e?_0x496920[_0x2fe4('0x2c')]:_0x2c3c5b[_0x2fe4('0x2a')]+_0x2c3c5b['limit'];var _0x283a39;if(_0x475587>=_0x23588c){_0x475587=_0x23588c;_0x283a39=0xc8;}else{_0x283a39=0xce;}_0xc1281d[_0x2fe4('0x28')](_0x283a39);return _0xc1281d[_0x2fe4('0x2d')](_0x2fe4('0x2e'),_0xa4c8af+'-'+_0x475587+'/'+_0x23588c)[_0x2fe4('0x29')](_0x496920);}return null;};}function patchUpdates(_0x14090c){return function(_0x116a5f){try{jsonpatch[_0x2fe4('0x2f')](_0x116a5f,_0x14090c,!![]);}catch(_0x45f616){return BPromise[_0x2fe4('0x30')](_0x45f616);}return _0x116a5f[_0x2fe4('0x31')]();};}function saveUpdates(_0x4567fc,_0x4d5938){return function(_0x354e4d){if(_0x354e4d){return _0x354e4d['update'](_0x4567fc)['then'](function(_0x49c8d8){return _0x49c8d8;});}return null;};}function removeEntity(_0x24dc4b,_0x547aaa){return function(_0x273f93){if(_0x273f93){return _0x273f93[_0x2fe4('0x32')]()['then'](function(){var _0x5d0058=_0x273f93[_0x2fe4('0x33')]({'plain':!![]});var _0x342822=_0x2fe4('0x34');return db[_0x2fe4('0x35')][_0x2fe4('0x32')]({'where':{'type':_0x342822,'resourceId':_0x5d0058['id']}})[_0x2fe4('0x36')](function(){return _0x273f93;});})[_0x2fe4('0x36')](function(){_0x24dc4b[_0x2fe4('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe681f1,_0x173310){return function(_0x505da4){if(!_0x505da4){_0xe681f1['sendStatus'](0x194);}return _0x505da4;};}function handleError(_0x51f4bf,_0x3ad33b){_0x3ad33b=_0x3ad33b||0x1f4;return function(_0x55065e){logger['error'](_0x55065e['stack']);if(_0x55065e[_0x2fe4('0x37')]){delete _0x55065e['name'];}_0x51f4bf['status'](_0x3ad33b)[_0x2fe4('0x38')](_0x55065e);};}exports[_0x2fe4('0x39')]=function(_0x544458,_0x2b9eca){var _0x2d6e41={'include':[{'model':db[_0x2fe4('0x3a')],'as':_0x2fe4('0x3b')}]},_0x173e17={},_0x358471={'count':0x0,'rows':[]};var _0x2efa89=_[_0x2fe4('0x3c')](db[_0x2fe4('0x3d')][_0x2fe4('0x3e')],function(_0x2fecbb){return{'name':_0x2fecbb['fieldName'],'type':_0x2fecbb[_0x2fe4('0x3f')][_0x2fe4('0x40')]};});_0x173e17[_0x2fe4('0x41')]=_[_0x2fe4('0x3c')](_0x2efa89,'name');_0x173e17[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x544458[_0x2fe4('0x42')]);_0x173e17[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x173e17['model'],_0x173e17[_0x2fe4('0x42')]);_0x2d6e41['attributes']=_[_0x2fe4('0x45')](_0x173e17[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x544458[_0x2fe4('0x42')]['fields']));_0x2d6e41[_0x2fe4('0x47')]=_0x2d6e41[_0x2fe4('0x47')][_0x2fe4('0x48')]?_0x2d6e41['attributes']:_0x173e17[_0x2fe4('0x41')];if(!_0x544458[_0x2fe4('0x42')][_0x2fe4('0x49')](_0x2fe4('0x4a'))){_0x2d6e41[_0x2fe4('0x4b')]=qs[_0x2fe4('0x4b')](_0x544458[_0x2fe4('0x42')][_0x2fe4('0x4b')]);_0x2d6e41[_0x2fe4('0x2a')]=qs[_0x2fe4('0x2a')](_0x544458[_0x2fe4('0x42')]['offset']);}_0x2d6e41[_0x2fe4('0x4c')]=qs[_0x2fe4('0x4d')](_0x544458[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0x2d6e41['where']=qs[_0x2fe4('0x44')](_[_0x2fe4('0x4e')](_0x544458['query'],_0x173e17[_0x2fe4('0x44')]),_0x2efa89);if(_0x544458['query'][_0x2fe4('0x4f')]){_0x2d6e41[_0x2fe4('0x50')]=_['merge'](_0x2d6e41['where'],{'$or':_['map'](_0x2efa89,function(_0x2e3a6a){if(_0x2e3a6a[_0x2fe4('0x3f')]!==_0x2fe4('0x51')){var _0x182457={};_0x182457[_0x2e3a6a[_0x2fe4('0x37')]]={'$like':'%'+_0x544458['query'][_0x2fe4('0x4f')]+'%'};return _0x182457;}})});}_0x2d6e41=_['merge']({},_0x2d6e41,_0x544458['options']);var _0xcaac33={'where':_0x2d6e41[_0x2fe4('0x50')]};return db[_0x2fe4('0x3d')][_0x2fe4('0x2c')](_0xcaac33)[_0x2fe4('0x36')](function(_0x34b517){_0x358471[_0x2fe4('0x2c')]=_0x34b517;if(_0x544458[_0x2fe4('0x42')]['includeAll']){_0x2d6e41[_0x2fe4('0x52')]=[{'all':!![]}];}return db[_0x2fe4('0x3d')][_0x2fe4('0x53')](_0x2d6e41);})[_0x2fe4('0x36')](function(_0x30f47d){_0x358471[_0x2fe4('0x54')]=_0x30f47d;return _0x358471;})[_0x2fe4('0x36')](respondWithFilteredResult(_0x2b9eca,_0x2d6e41))['catch'](handleError(_0x2b9eca,null));};exports[_0x2fe4('0x55')]=function(_0x5a1518,_0x4f574a){var _0x5ad549={'raw':![],'where':{'id':_0x5a1518[_0x2fe4('0x56')]['id']},'include':[{'model':db[_0x2fe4('0x3a')],'as':_0x2fe4('0x3b')}]},_0xc702da={};_0xc702da[_0x2fe4('0x41')]=_[_0x2fe4('0x43')](db[_0x2fe4('0x3d')][_0x2fe4('0x3e')]);_0xc702da[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x5a1518[_0x2fe4('0x42')]);_0xc702da[_0x2fe4('0x44')]=_['intersection'](_0xc702da[_0x2fe4('0x41')],_0xc702da[_0x2fe4('0x42')]);_0x5ad549[_0x2fe4('0x47')]=_[_0x2fe4('0x45')](_0xc702da[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x5a1518[_0x2fe4('0x42')][_0x2fe4('0x46')]));_0x5ad549[_0x2fe4('0x47')]=_0x5ad549['attributes'][_0x2fe4('0x48')]?_0x5ad549[_0x2fe4('0x47')]:_0xc702da[_0x2fe4('0x41')];if(_0x5a1518[_0x2fe4('0x42')][_0x2fe4('0x57')]){_0x5ad549[_0x2fe4('0x52')]=[{'all':!![]}];}_0x5ad549=_[_0x2fe4('0x58')]({},_0x5ad549,_0x5a1518['options']);return db[_0x2fe4('0x3d')][_0x2fe4('0x59')](_0x5ad549)['then'](handleEntityNotFound(_0x4f574a,null))['then'](respondWithResult(_0x4f574a,null))[_0x2fe4('0x26')](handleError(_0x4f574a,null));};exports[_0x2fe4('0x5a')]=function(_0x3590a4,_0x4206ea){return db[_0x2fe4('0x3d')]['create'](_0x3590a4[_0x2fe4('0x5b')],{})['then'](function(_0x107158){var _0x1e4c81=_0x3590a4[_0x2fe4('0x5c')][_0x2fe4('0x33')]({'plain':!![]});if(!_0x1e4c81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e4c81[_0x2fe4('0x5d')]===_0x2fe4('0x5c')){var _0x16a8ef=_0x107158[_0x2fe4('0x33')]({'plain':!![]});var _0x478d40='FaxAccounts';return db[_0x2fe4('0x5e')][_0x2fe4('0x59')]({'where':{'name':_0x478d40,'userProfileId':_0x1e4c81[_0x2fe4('0x5f')]},'raw':!![]})[_0x2fe4('0x36')](function(_0x300b54){if(_0x300b54&&_0x300b54[_0x2fe4('0x60')]===0x0){return db[_0x2fe4('0x35')]['create']({'name':_0x16a8ef[_0x2fe4('0x37')],'resourceId':_0x16a8ef['id'],'type':_0x300b54[_0x2fe4('0x37')],'sectionId':_0x300b54['id']},{})[_0x2fe4('0x36')](function(){return _0x107158;});}else{return _0x107158;}})[_0x2fe4('0x26')](function(_0x3a78e8){logger[_0x2fe4('0x23')](_0x2fe4('0x61'),_0x3a78e8);throw _0x3a78e8;});}return _0x107158;})[_0x2fe4('0x36')](respondWithResult(_0x4206ea,0xc9))[_0x2fe4('0x26')](handleError(_0x4206ea,null));};exports[_0x2fe4('0x62')]=function(_0x348d8e,_0x12cd3a){if(_0x348d8e[_0x2fe4('0x5b')]['id']){delete _0x348d8e['body']['id'];}return db[_0x2fe4('0x3d')][_0x2fe4('0x59')]({'where':{'id':_0x348d8e[_0x2fe4('0x56')]['id']},'include':[{'model':db[_0x2fe4('0x3a')],'as':_0x2fe4('0x3b')}]})[_0x2fe4('0x36')](handleEntityNotFound(_0x12cd3a,null))[_0x2fe4('0x36')](saveUpdates(_0x348d8e['body'],null))[_0x2fe4('0x36')](respondWithResult(_0x12cd3a,null))['catch'](handleError(_0x12cd3a,null));};exports[_0x2fe4('0x32')]=function(_0x278009,_0x114522){return db['FaxAccount'][_0x2fe4('0x59')]({'where':{'id':_0x278009[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x114522,null))['then'](removeEntity(_0x114522,null))[_0x2fe4('0x26')](handleError(_0x114522,null));};exports['describe']=function(_0x157736,_0x4e2b5e){return db[_0x2fe4('0x3d')][_0x2fe4('0x63')]()[_0x2fe4('0x36')](respondWithResult(_0x4e2b5e,null))[_0x2fe4('0x26')](handleError(_0x4e2b5e,null));};exports[_0x2fe4('0x64')]=function(_0x9cfd45,_0x46044c,_0x2eef1a){if(_0x9cfd45[_0x2fe4('0x5b')]['id']){delete _0x9cfd45['body']['id'];}return db[_0x2fe4('0x3d')][_0x2fe4('0x59')]({'where':{'id':_0x9cfd45[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x46044c,null))[_0x2fe4('0x36')](function(_0x449b2a){if(_0x449b2a){_0x9cfd45['body'][_0x2fe4('0x65')]=_0x449b2a['id'];return db[_0x2fe4('0x66')][_0x2fe4('0x5a')](_0x9cfd45['body']);}})[_0x2fe4('0x36')](respondWithResult(_0x46044c,null))[_0x2fe4('0x26')](handleError(_0x46044c,null));};exports[_0x2fe4('0x67')]=function(_0x13db32,_0x5d2cc6,_0x111399){var _0xac7dc7={'raw':![],'where':{}};var _0x508d6e={};var _0x3ea97d={'count':0x0,'rows':[]};return db[_0x2fe4('0x3d')][_0x2fe4('0x68')]({'where':{'id':_0x13db32[_0x2fe4('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d2cc6,null))['then'](function(_0x3c71e9){if(_0x3c71e9){_0x508d6e[_0x2fe4('0x41')]=_[_0x2fe4('0x43')](db[_0x2fe4('0x66')]['rawAttributes']);_0x508d6e[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x13db32[_0x2fe4('0x42')]);_0x508d6e[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x508d6e['model'],_0x508d6e[_0x2fe4('0x42')]);_0xac7dc7[_0x2fe4('0x47')]=_['intersection'](_0x508d6e[_0x2fe4('0x41')],qs['fields'](_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x46')]));_0xac7dc7[_0x2fe4('0x47')]=_0xac7dc7[_0x2fe4('0x47')][_0x2fe4('0x48')]?_0xac7dc7['attributes']:_0x508d6e['model'];if(!_0x13db32['query']['hasOwnProperty'](_0x2fe4('0x4a'))){_0xac7dc7[_0x2fe4('0x4b')]=qs[_0x2fe4('0x4b')](_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x4b')]);_0xac7dc7['offset']=qs[_0x2fe4('0x2a')](_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x2a')]);}_0xac7dc7['order']=qs[_0x2fe4('0x4d')](_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0xac7dc7[_0x2fe4('0x50')]=qs['filters'](_[_0x2fe4('0x4e')](_0x13db32['query'],_0x508d6e[_0x2fe4('0x44')]));_0xac7dc7[_0x2fe4('0x50')][_0x2fe4('0x65')]=_0x3c71e9['id'];if(_0x13db32[_0x2fe4('0x42')]['filter']){_0xac7dc7[_0x2fe4('0x50')]=_['merge'](_0xac7dc7[_0x2fe4('0x50')],{'$or':_[_0x2fe4('0x3c')](_0xac7dc7[_0x2fe4('0x47')],function(_0x4adb03){var _0x2304df={};_0x2304df[_0x4adb03]={'$like':'%'+_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x4f')]+'%'};return _0x2304df;})});}_0xac7dc7=_[_0x2fe4('0x58')]({},_0xac7dc7,_0x13db32[_0x2fe4('0x69')]);return db['Disposition'][_0x2fe4('0x2c')]({'where':_0xac7dc7[_0x2fe4('0x50')]})[_0x2fe4('0x36')](function(_0x1e70a8){_0x3ea97d[_0x2fe4('0x2c')]=_0x1e70a8;if(_0x13db32[_0x2fe4('0x42')][_0x2fe4('0x57')]){_0xac7dc7[_0x2fe4('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x2fe4('0x53')](_0xac7dc7);})[_0x2fe4('0x36')](function(_0x7334f2){_0x3ea97d[_0x2fe4('0x54')]=_0x7334f2;return _0x3ea97d;});}})['then'](respondWithFilteredResult(_0x5d2cc6,_0xac7dc7))[_0x2fe4('0x26')](handleError(_0x5d2cc6,null));};exports['removeDispositions']=function(_0x5a5b0f,_0x2c6dec,_0x105d25){return db[_0x2fe4('0x3d')][_0x2fe4('0x59')]({'where':{'id':_0x5a5b0f[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x2c6dec,null))[_0x2fe4('0x36')](function(_0x572e30){if(_0x572e30){return _0x572e30[_0x2fe4('0x6a')](_0x5a5b0f[_0x2fe4('0x42')]['ids']);}})[_0x2fe4('0x36')](respondWithStatusCode(_0x2c6dec,null))[_0x2fe4('0x26')](handleError(_0x2c6dec,null));};exports['addAnswer']=function(_0x4a2a1c,_0x597bce,_0x433987){if(_0x4a2a1c['body']['id']){delete _0x4a2a1c[_0x2fe4('0x5b')]['id'];}return db['FaxAccount'][_0x2fe4('0x59')]({'where':{'id':_0x4a2a1c[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x597bce,null))['then'](function(_0x3fa4e4){if(_0x3fa4e4){_0x4a2a1c[_0x2fe4('0x5b')][_0x2fe4('0x65')]=_0x3fa4e4['id'];return db['CannedAnswer']['create'](_0x4a2a1c['body']);}})['then'](respondWithResult(_0x597bce,null))['catch'](handleError(_0x597bce,null));};exports[_0x2fe4('0x6b')]=function(_0x5846c3,_0x185b4e,_0xd14cae){var _0xe56d4b={'raw':![],'where':{}};var _0x27b6e3={};var _0x416e49={'count':0x0,'rows':[]};return db[_0x2fe4('0x3d')][_0x2fe4('0x68')]({'where':{'id':_0x5846c3['params']['id']}})['then'](handleEntityNotFound(_0x185b4e,null))[_0x2fe4('0x36')](function(_0x28073a){if(_0x28073a){_0x27b6e3[_0x2fe4('0x41')]=_[_0x2fe4('0x43')](db[_0x2fe4('0x6c')][_0x2fe4('0x3e')]);_0x27b6e3[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x5846c3[_0x2fe4('0x42')]);_0x27b6e3[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x27b6e3[_0x2fe4('0x41')],_0x27b6e3[_0x2fe4('0x42')]);_0xe56d4b['attributes']=_[_0x2fe4('0x45')](_0x27b6e3[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x5846c3[_0x2fe4('0x42')][_0x2fe4('0x46')]));_0xe56d4b[_0x2fe4('0x47')]=_0xe56d4b['attributes'][_0x2fe4('0x48')]?_0xe56d4b[_0x2fe4('0x47')]:_0x27b6e3[_0x2fe4('0x41')];if(!_0x5846c3[_0x2fe4('0x42')][_0x2fe4('0x49')]('nolimit')){_0xe56d4b['limit']=qs[_0x2fe4('0x4b')](_0x5846c3[_0x2fe4('0x42')]['limit']);_0xe56d4b[_0x2fe4('0x2a')]=qs['offset'](_0x5846c3['query'][_0x2fe4('0x2a')]);}_0xe56d4b[_0x2fe4('0x4c')]=qs['sort'](_0x5846c3[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0xe56d4b[_0x2fe4('0x50')]=qs[_0x2fe4('0x44')](_['pick'](_0x5846c3[_0x2fe4('0x42')],_0x27b6e3[_0x2fe4('0x44')]));_0xe56d4b[_0x2fe4('0x50')][_0x2fe4('0x65')]=_0x28073a['id'];if(_0x5846c3['query'][_0x2fe4('0x4f')]){_0xe56d4b['where']=_[_0x2fe4('0x58')](_0xe56d4b[_0x2fe4('0x50')],{'$or':_['map'](_0xe56d4b[_0x2fe4('0x47')],function(_0x9bbce1){var _0x358b65={};_0x358b65[_0x9bbce1]={'$like':'%'+_0x5846c3[_0x2fe4('0x42')][_0x2fe4('0x4f')]+'%'};return _0x358b65;})});}_0xe56d4b=_[_0x2fe4('0x58')]({},_0xe56d4b,_0x5846c3['options']);return db['CannedAnswer'][_0x2fe4('0x2c')]({'where':_0xe56d4b['where']})[_0x2fe4('0x36')](function(_0x23c94a){_0x416e49['count']=_0x23c94a;if(_0x5846c3[_0x2fe4('0x42')][_0x2fe4('0x57')]){_0xe56d4b['include']=[{'all':!![]}];}return db[_0x2fe4('0x6c')]['findAll'](_0xe56d4b);})[_0x2fe4('0x36')](function(_0x49655c){_0x416e49[_0x2fe4('0x54')]=_0x49655c;return _0x416e49;});}})['then'](respondWithFilteredResult(_0x185b4e,_0xe56d4b))[_0x2fe4('0x26')](handleError(_0x185b4e,null));};exports[_0x2fe4('0x6d')]=function(_0x8877b8,_0x20cc4e,_0x55ddbc){return db[_0x2fe4('0x3d')]['find']({'where':{'id':_0x8877b8[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x20cc4e,null))[_0x2fe4('0x36')](function(_0x1d7eee){if(_0x1d7eee){return _0x1d7eee[_0x2fe4('0x6d')](_0x8877b8[_0x2fe4('0x42')][_0x2fe4('0x6e')]);}})[_0x2fe4('0x36')](respondWithStatusCode(_0x20cc4e,null))[_0x2fe4('0x26')](handleError(_0x20cc4e,null));};exports[_0x2fe4('0x6f')]=function(_0x5e1cf1,_0x2bf857,_0x1e0907){return db[_0x2fe4('0x70')][_0x2fe4('0x59')]({'where':{'id':_0x5e1cf1[_0x2fe4('0x56')]['id']}})['then'](handleEntityNotFound(_0x2bf857,null))[_0x2fe4('0x36')](function(_0xf6eaa){if(_0xf6eaa){return _0xf6eaa[_0x2fe4('0x6f')](_0x5e1cf1[_0x2fe4('0x5b')]['ids'],_['omit'](_0x5e1cf1[_0x2fe4('0x5b')],[_0x2fe4('0x6e'),'id'])||{});}})[_0x2fe4('0x36')](respondWithResult(_0x2bf857,null))[_0x2fe4('0x26')](handleError(_0x2bf857,null));};exports[_0x2fe4('0x71')]=function(_0x2f992d,_0x277693,_0x21b13a){var _0x88aeec={'raw':![],'where':{}};var _0x264c3d={};var _0xd9e04={'count':0x0,'rows':[]};return db[_0x2fe4('0x3d')][_0x2fe4('0x68')]({'where':{'id':_0x2f992d[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x277693,null))[_0x2fe4('0x36')](function(_0x284097){if(_0x284097){_0x264c3d['model']=_[_0x2fe4('0x43')](db['FaxInteraction'][_0x2fe4('0x3e')]);_0x264c3d['query']=_[_0x2fe4('0x43')](_0x2f992d[_0x2fe4('0x42')]);_0x264c3d[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x264c3d[_0x2fe4('0x41')],_0x264c3d['query']);_0x88aeec['attributes']=_[_0x2fe4('0x45')](_0x264c3d[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x46')]));_0x88aeec['attributes']=_0x88aeec['attributes'][_0x2fe4('0x48')]?_0x88aeec['attributes']:_0x264c3d[_0x2fe4('0x41')];if(!_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x49')](_0x2fe4('0x4a'))){_0x88aeec[_0x2fe4('0x4b')]=qs[_0x2fe4('0x4b')](_0x2f992d[_0x2fe4('0x42')]['limit']);_0x88aeec[_0x2fe4('0x2a')]=qs['offset'](_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x2a')]);}_0x88aeec[_0x2fe4('0x4c')]=qs[_0x2fe4('0x4d')](_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0x88aeec[_0x2fe4('0x50')]=qs[_0x2fe4('0x44')](_['pick'](_0x2f992d[_0x2fe4('0x42')],_0x264c3d[_0x2fe4('0x44')]));_0x88aeec['where']['FaxAccountId']=_0x284097['id'];if(_0x2f992d[_0x2fe4('0x42')]['filter']){_0x88aeec[_0x2fe4('0x50')]=_[_0x2fe4('0x58')](_0x88aeec['where'],{'$or':_[_0x2fe4('0x3c')](_0x88aeec[_0x2fe4('0x47')],function(_0x215efd){var _0x52553c={};_0x52553c[_0x215efd]={'$like':'%'+_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x4f')]+'%'};return _0x52553c;})});}_0x88aeec=_[_0x2fe4('0x58')]({},_0x88aeec,_0x2f992d[_0x2fe4('0x69')]);return db['FaxInteraction']['count']({'where':_0x88aeec[_0x2fe4('0x50')]})[_0x2fe4('0x36')](function(_0x385860){_0xd9e04[_0x2fe4('0x2c')]=_0x385860;if(_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x57')]){_0x88aeec[_0x2fe4('0x52')]=[{'model':db[_0x2fe4('0x72')],'as':_0x2fe4('0x73'),'required':![]},{'model':db[_0x2fe4('0x74')],'as':'Owner','attributes':[_0x2fe4('0x37'),_0x2fe4('0x75'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x2fe4('0x37'),_0x2fe4('0x76')],'where':_0x2f992d['query'][_0x2fe4('0x77')]?{'id':_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x77')]}:undefined,'required':_0x2f992d[_0x2fe4('0x42')][_0x2fe4('0x77')]?!![]:![]}];}return db[_0x2fe4('0x70')][_0x2fe4('0x53')](_0x88aeec);})[_0x2fe4('0x36')](function(_0x162076){_0xd9e04[_0x2fe4('0x54')]=_0x162076;return _0xd9e04;});}})[_0x2fe4('0x36')](respondWithFilteredResult(_0x277693,_0x88aeec))[_0x2fe4('0x26')](handleError(_0x277693,null));};exports[_0x2fe4('0x78')]=function(_0x145c1d,_0x51ce87){var _0x837dd5=_0x145c1d[_0x2fe4('0x56')]['id'];var _0x394653=_0x145c1d[_0x2fe4('0x5b')];var _0x342665=0xc8;var _0x8e73ff=null;return db[_0x2fe4('0x79')][_0x2fe4('0x7a')]({'isolationLevel':db[_0x2fe4('0x79')][_0x2fe4('0x7b')][_0x2fe4('0x7c')][_0x2fe4('0x7d')]},function(_0xefc662){return db['FaxAccount'][_0x2fe4('0x68')]({'where':{'id':_0x837dd5},'transaction':_0xefc662})[_0x2fe4('0x36')](function(_0x1e7c74){if(_0x1e7c74){return db[_0x2fe4('0x7e')][_0x2fe4('0x32')]({'where':{'FaxAccountId':_0x837dd5},'transaction':_0xefc662})[_0x2fe4('0x36')](function(){var _0x5ed72d=_[_0x2fe4('0x3c')](_0x394653,function(_0x2cfd3a){_0x2cfd3a[_0x2fe4('0x65')]=_0x837dd5;return _0x2cfd3a;});return db[_0x2fe4('0x7e')][_0x2fe4('0x7f')](_0x5ed72d,{'transaction':_0xefc662});});}else{_0x342665=0x194;_0x8e73ff=[];}});})[_0x2fe4('0x36')](function(){if(_0x342665!==0x194){return db[_0x2fe4('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x837dd5},'order':_0x2fe4('0x80')})[_0x2fe4('0x36')](function(_0x184e91){_0x8e73ff=_0x184e91;});}})[_0x2fe4('0x26')](function(_0x139580){_0x342665=0x1f4;logger[_0x2fe4('0x23')](_0x139580[_0x2fe4('0x81')]);if(_0x139580[_0x2fe4('0x37')]){delete _0x139580['name'];}_0x8e73ff=_0x139580;})[_0x2fe4('0x82')](function(){if(_0x8e73ff===null){_0x51ce87[_0x2fe4('0x27')](_0x342665);}else{if(_0x342665===0x1f4){_0x51ce87[_0x2fe4('0x28')](_0x342665)[_0x2fe4('0x38')](_0x8e73ff);}else{_0x51ce87[_0x2fe4('0x28')](_0x342665)[_0x2fe4('0x29')](_0x8e73ff);}}});};exports[_0x2fe4('0x83')]=function(_0x5b2155,_0x4509bf,_0x3be60c){var _0x40cb5b={};var _0x144ef7={};var _0x3af6b6;var _0x81d3ce;return db[_0x2fe4('0x3d')]['findOne']({'where':{'id':_0x5b2155[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x4509bf,null))[_0x2fe4('0x36')](function(_0xb80d22){if(_0xb80d22){_0x3af6b6=_0xb80d22;_0x144ef7[_0x2fe4('0x41')]=_[_0x2fe4('0x43')](db[_0x2fe4('0x7e')][_0x2fe4('0x3e')]);_0x144ef7[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x5b2155[_0x2fe4('0x42')]);_0x144ef7[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x144ef7[_0x2fe4('0x41')],_0x144ef7[_0x2fe4('0x42')]);_0x40cb5b['attributes']=_[_0x2fe4('0x45')](_0x144ef7[_0x2fe4('0x41')],qs['fields'](_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x46')]));_0x40cb5b[_0x2fe4('0x47')]=_0x40cb5b['attributes'][_0x2fe4('0x48')]?_0x40cb5b[_0x2fe4('0x47')]:_0x144ef7['model'];_0x40cb5b[_0x2fe4('0x4c')]=qs[_0x2fe4('0x4d')](_0x5b2155[_0x2fe4('0x42')]['sort']);_0x40cb5b[_0x2fe4('0x50')]=qs[_0x2fe4('0x44')](_['pick'](_0x5b2155['query'],_0x144ef7[_0x2fe4('0x44')]));if(_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x4f')]){_0x40cb5b[_0x2fe4('0x50')]=_['merge'](_0x40cb5b[_0x2fe4('0x50')],{'$or':_[_0x2fe4('0x3c')](_0x40cb5b['attributes'],function(_0x4c0c6f){var _0x11c9f6={};_0x11c9f6[_0x4c0c6f]={'$like':'%'+_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x4f')]+'%'};return _0x11c9f6;})});}_0x40cb5b=_[_0x2fe4('0x58')]({},_0x40cb5b,_0x5b2155[_0x2fe4('0x69')]);return _0x3af6b6[_0x2fe4('0x83')](_0x40cb5b);}})[_0x2fe4('0x36')](function(_0x44d679){if(_0x44d679){_0x81d3ce=_0x44d679[_0x2fe4('0x48')];if(!_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x49')](_0x2fe4('0x4a'))){_0x40cb5b[_0x2fe4('0x4b')]=qs[_0x2fe4('0x4b')](_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x4b')]);_0x40cb5b['offset']=qs[_0x2fe4('0x2a')](_0x5b2155[_0x2fe4('0x42')][_0x2fe4('0x2a')]);}return _0x3af6b6[_0x2fe4('0x83')](_0x40cb5b);}})['then'](function(_0x38bcde){if(_0x38bcde){return _0x38bcde?{'count':_0x81d3ce,'rows':_0x38bcde}:null;}})[_0x2fe4('0x36')](respondWithResult(_0x4509bf,null))[_0x2fe4('0x26')](handleError(_0x4509bf,null));};function Extension(_0x55f776,_0x1130d5,_0x1bc40b,_0x51f4ab){this[_0x2fe4('0x84')]=_0x2fe4('0x85');this[_0x2fe4('0x86')]=_0x55f776['localstationid'];this[_0x2fe4('0x87')]=_0x51f4ab;this[_0x2fe4('0x3f')]='system';this[_0x2fe4('0x88')]='Fax\x20Extension';this[_0x2fe4('0x65')]=_0x55f776['id'];this[_0x2fe4('0x80')]=_0x1130d5;this[_0x2fe4('0x89')]=_0x1bc40b;}function createExtensionsReciveFax(_0x4e1e59){var _0x3d53de=0x1;var _0x30ff37=[];_0x30ff37[_0x2fe4('0x8a')](new Extension(_0x4e1e59,_0x3d53de,'',_0x2fe4('0x8b')));_0x3d53de+=0x1;_0x30ff37[_0x2fe4('0x8a')](new Extension(_0x4e1e59,_0x3d53de,_0x2fe4('0x8c'),'Set'));_0x3d53de+=0x1;for(var _0x1c431b in _0x4e1e59){if(_0x4e1e59[_0x2fe4('0x49')](_0x1c431b)&&(_0x1c431b===_0x2fe4('0x8d')||_0x1c431b==='localstationid'||_0x1c431b===_0x2fe4('0x8e')||_0x1c431b===_0x2fe4('0x8f')||_0x1c431b==='headerinfo'||_0x1c431b==='maxrate'||_0x1c431b===_0x2fe4('0x90')||_0x1c431b===_0x2fe4('0x91')||_0x1c431b==='t38timeout')){_0x30ff37['push'](new Extension(_0x4e1e59,_0x3d53de,_0x2fe4('0x92')+_0x1c431b+')='+_0x4e1e59[_0x1c431b],'Set'));_0x3d53de+=0x1;}}_0x30ff37[_0x2fe4('0x8a')](new Extension(_0x4e1e59,_0x3d53de,'6',_0x2fe4('0x93')));_0x3d53de+=0x1;_0x30ff37['push'](new Extension(_0x4e1e59,_0x3d53de,_0x2fe4('0x94'),_0x2fe4('0x95')));_0x3d53de=0x0;return _0x30ff37;}exports[_0x2fe4('0x96')]=function(_0x3ebf59,_0x549e85,_0x33631a){var _0x293521;return db[_0x2fe4('0x79')][_0x2fe4('0x7a')](function(_0x5908d2){return db['FaxAccount']['create'](_0x3ebf59[_0x2fe4('0x5b')],{'transaction':_0x5908d2})['then'](function(_0x157c68){_0x293521=_0x157c68[_0x2fe4('0x33')]({'plain':!![]});return db[_0x2fe4('0x97')]['bulkCreate'](createExtensionsReciveFax(_0x293521),{'transaction':_0x5908d2});});})[_0x2fe4('0x36')](function(){return _0x293521;})['then'](respondWithResult(_0x549e85,null))[_0x2fe4('0x26')](handleError(_0x549e85,null));};exports[_0x2fe4('0x98')]=function(_0x3fe2a4,_0x192984,_0x1e6202){var _0x415653;return db[_0x2fe4('0x79')][_0x2fe4('0x7a')](function(_0x46d9c9){return db[_0x2fe4('0x3d')][_0x2fe4('0x62')](_0x3fe2a4[_0x2fe4('0x5b')],{'where':{'id':_0x3fe2a4[_0x2fe4('0x5b')]['id']},'transaction':_0x46d9c9})['then'](function(_0x172619){return db[_0x2fe4('0x97')][_0x2fe4('0x32')]({'where':{'FaxAccountId':_0x3fe2a4[_0x2fe4('0x5b')]['id']},'transaction':_0x46d9c9})['then'](function(_0x310e8d){return db[_0x2fe4('0x97')][_0x2fe4('0x7f')](createExtensionsReciveFax(_[_0x2fe4('0x99')](_0x3fe2a4[_0x2fe4('0x5b')],[_0x2fe4('0x9a'),_0x2fe4('0x40'),_0x2fe4('0x9b'),'updatedAt','TrunkId',_0x2fe4('0x9c')])),{'transaction':_0x46d9c9});});});})[_0x2fe4('0x36')](function(){return db[_0x2fe4('0x3d')]['findById'](_0x3fe2a4[_0x2fe4('0x5b')]['id']);})[_0x2fe4('0x36')](respondWithResult(_0x192984,null))[_0x2fe4('0x26')](handleError(_0x192984,null));};exports[_0x2fe4('0x9d')]=function(_0x4dbbeb,_0x5ca57c,_0x2610aa){var _0x224a5e={'raw':!![],'where':{}};var _0x320ec3={};var _0x29b759={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2fe4('0x68')]({'where':{'id':_0x4dbbeb['params']['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x5ca57c,null))[_0x2fe4('0x36')](function(_0x5f1eff){if(_0x5f1eff){_0x320ec3['model']=_['keys'](db[_0x2fe4('0x9e')][_0x2fe4('0x3e')]);_0x320ec3[_0x2fe4('0x42')]=_[_0x2fe4('0x43')](_0x4dbbeb[_0x2fe4('0x42')]);_0x320ec3[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x320ec3[_0x2fe4('0x41')],_0x320ec3['query']);_0x224a5e[_0x2fe4('0x47')]=_[_0x2fe4('0x45')](_0x320ec3[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x4dbbeb['query']['fields']));_0x224a5e['attributes']=_0x224a5e[_0x2fe4('0x47')][_0x2fe4('0x48')]?_0x224a5e[_0x2fe4('0x47')]:_0x320ec3[_0x2fe4('0x41')];if(!_0x4dbbeb['query'][_0x2fe4('0x49')](_0x2fe4('0x4a'))){_0x224a5e['limit']=qs['limit'](_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x4b')]);_0x224a5e['offset']=qs['offset'](_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x2a')]);}_0x224a5e[_0x2fe4('0x4c')]=qs['sort'](_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0x224a5e[_0x2fe4('0x50')]=qs['filters'](_[_0x2fe4('0x4e')](_0x4dbbeb[_0x2fe4('0x42')],_0x320ec3['filters']));_0x224a5e[_0x2fe4('0x50')][_0x2fe4('0x65')]=_0x5f1eff['id'];if(_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x4f')]){_0x224a5e[_0x2fe4('0x50')]=_[_0x2fe4('0x58')](_0x224a5e[_0x2fe4('0x50')],{'$or':_['map'](_0x224a5e[_0x2fe4('0x47')],function(_0xc8b8d4){var _0x3427b7={};_0x3427b7[_0xc8b8d4]={'$like':'%'+_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x4f')]+'%'};return _0x3427b7;})});}if(_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x9f')]){var _0x3cb21f=_0x4dbbeb[_0x2fe4('0x42')][_0x2fe4('0x9f')][_0x2fe4('0xa0')](',');var _0x18107f={};_0x18107f[_0x3cb21f[0x0]]={'$gte':moment(_0x3cb21f[0x1])['format'](_0x2fe4('0xa1'))};_0x224a5e[_0x2fe4('0x50')]=_[_0x2fe4('0x58')](_0x224a5e[_0x2fe4('0x50')],_0x18107f);}_0x224a5e=_[_0x2fe4('0x58')]({},_0x224a5e,_0x4dbbeb['options']);return db[_0x2fe4('0x9e')][_0x2fe4('0x2c')]({'where':_0x224a5e['where']})['then'](function(_0x5c4ddc){_0x29b759[_0x2fe4('0x2c')]=_0x5c4ddc;if(_0x4dbbeb[_0x2fe4('0x42')]['includeAll']){_0x224a5e[_0x2fe4('0x52')]=[{'all':!![]}];}return db[_0x2fe4('0x9e')]['findAll'](_0x224a5e);})[_0x2fe4('0x36')](function(_0x4b08dd){_0x29b759[_0x2fe4('0x54')]=_0x4b08dd;return _0x29b759;});}})[_0x2fe4('0x36')](respondWithFilteredResult(_0x5ca57c,_0x224a5e))[_0x2fe4('0x26')](handleError(_0x5ca57c,null));};exports[_0x2fe4('0x38')]=function(_0x27e939,_0x2349f6,_0x59c95a){var _0x524303,_0x448afa={},_0x309d2e;if(_0x27e939[_0x2fe4('0x5b')]['to']){_0x309d2e=_0x27e939[_0x2fe4('0x5b')]['to'][0x0];}return db[_0x2fe4('0x3d')]['find']({'where':{'id':_0x27e939[_0x2fe4('0x56')]['id']},'include':[{'model':db[_0x2fe4('0xa2')],'as':_0x2fe4('0xa3'),'include':[{'model':db[_0x2fe4('0x72')],'as':_0x2fe4('0xa4'),'where':{'fax':_0x309d2e},'limit':0x1,'order':[[_0x2fe4('0xa5'),'DESC']]}]}]})[_0x2fe4('0x36')](handleEntityNotFound(_0x2349f6,null))[_0x2fe4('0x36')](function(_0x1b730f){_0x524303=_0x1b730f;if(_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')]&&_0x27e939['body'][_0x2fe4('0xa6')]['length']){for(var _0x476cd8=0x0;_0x476cd8<_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][_0x2fe4('0x48')];_0x476cd8+=0x1){_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][_0x476cd8]={'filename':_0x27e939[_0x2fe4('0x5b')]['attachments'][_0x476cd8]['name'],'id':_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][_0x476cd8]['id'],'path':path['join'](config[_0x2fe4('0xa7')],'server/files/attachments',_0x27e939['body'][_0x2fe4('0xa6')][_0x476cd8]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x2fe4('0xa8'),{'FaxAccountId':_['isNil'](_0x27e939['params']['id'])?undefined:_0x27e939['params']['id'],'path':_[_0x2fe4('0xa9')](_0x27e939[_0x2fe4('0x5b')]['attachments'][0x0][_0x2fe4('0x5')])?undefined:_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0][_0x2fe4('0x5')],'fax':_[_0x2fe4('0xa9')](_0x27e939['body']['to'][0x0])?undefined:_0x27e939['body']['to'][0x0]},client9002);})[_0x2fe4('0x36')](function(){if(_0x524303){if(_[_0x2fe4('0xa9')](_0x27e939['body']['from'])){_0x27e939['body']['from']=util[_0x2fe4('0xaa')](_0x2fe4('0xab'),_0x524303['name'],_0x524303[_0x2fe4('0xac')]);}if(_0x524303[_0x2fe4('0xa3')]){if(_0x524303['List'][_0x2fe4('0xa4')][_0x2fe4('0x48')]){return _0x524303['List'][_0x2fe4('0xa4')][0x0];}else{return db[_0x2fe4('0x72')][_0x2fe4('0x5a')](_['defaults'](_0x27e939[_0x2fe4('0x5b')],{'firstName':_0x27e939[_0x2fe4('0x5b')]['to'][0x0],'phone':_0x27e939[_0x2fe4('0x5b')]['to'][0x0],'fax':_0x27e939[_0x2fe4('0x5b')]['to'][0x0],'ListId':_0x524303[_0x2fe4('0x9c')]}));}}else{throw new Error(_0x2fe4('0xad'));}}else{throw new Error(_0x2fe4('0xae'));}})[_0x2fe4('0x36')](function(_0x638632){if(_0x638632){return db[_0x2fe4('0x70')][_0x2fe4('0x59')]({'where':{'ContactId':_0x638632['id'],'closed':![],'FaxAccountId':_0x524303['id']}})[_0x2fe4('0x36')](function(_0x3ae938){if(_0x3ae938){return[_0x3ae938,![]];}return db[_0x2fe4('0x70')][_0x2fe4('0x5a')]({'UserId':_0x27e939[_0x2fe4('0x5c')]['id'],'ContactId':_0x638632['id'],'FaxAccountId':_0x524303['id'],'fax':_0x27e939[_0x2fe4('0x5b')]['to'][0x0],'firstMsgDirection':_0x2fe4('0xaf'),'Messages':[_[_0x2fe4('0x58')](_0x27e939[_0x2fe4('0x5b')],{'read':![],'body':_0x27e939['body'][_0x2fe4('0xa6')][0x0][_0x2fe4('0xb0')],'FaxAccountId':_0x524303['id'],'UserId':_0x27e939[_0x2fe4('0x5c')]['id'],'ContactId':_0x638632['id'],'AttachmentId':_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0x2fe4('0x9e')],'as':_0x2fe4('0xb1')}]})[_0x2fe4('0x36')](function(_0x1c28e5){return[_0x1c28e5,!![]];});});}else{throw new Error(_0x2fe4('0xb2'));}})[_0x2fe4('0xb3')](function(_0x93a7fc,_0x7eb507){if(_0x7eb507){return _0x93a7fc;}return db[_0x2fe4('0x9e')][_0x2fe4('0x5a')]({'direction':_0x2fe4('0xaf'),'read':![],'body':_0x27e939[_0x2fe4('0x5b')]['attachments'][0x0]['filename'],'FaxAccountId':_0x524303['id'],'FaxInteractionId':_0x93a7fc['id'],'UserId':_0x27e939[_0x2fe4('0x5c')]['id'],'ContactId':_0x93a7fc[_0x2fe4('0xb4')],'AttachmentId':_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0]['id']})[_0x2fe4('0x36')](function(_0x549a0c){_0x93a7fc['dataValues']['Messages']=[];_0x93a7fc['dataValues'][_0x2fe4('0xb1')][_0x2fe4('0x8a')](_0x549a0c[_0x2fe4('0xb5')]);return _0x93a7fc;});})['then'](function(_0x3c9e43){respondWithRpcPromise(_0x2fe4('0xb6'),_0x2fe4('0xb6'),{'FaxAccountId':_[_0x2fe4('0xa9')](_0x27e939[_0x2fe4('0x56')]['id'])?undefined:_0x27e939[_0x2fe4('0x56')]['id'],'path':_['isNil'](_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0][_0x2fe4('0x5')])?undefined:_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0][_0x2fe4('0x5')],'fax':_[_0x2fe4('0xa9')](_0x27e939[_0x2fe4('0x5b')]['to'][0x0])?undefined:_0x27e939[_0x2fe4('0x5b')]['to'][0x0],'AttachmentId':_0x27e939[_0x2fe4('0x5b')][_0x2fe4('0xa6')][0x0]['id']},client9002)['then'](function(_0x5440bc){logger['info'](_0x2fe4('0xb7'),_0x5440bc);})[_0x2fe4('0x26')](function(_0xb8bafc){logger[_0x2fe4('0xb8')](_0x2fe4('0xb7'),_0xb8bafc);});return _0x3c9e43;})[_0x2fe4('0x36')](respondWithResult(_0x2349f6,null))[_0x2fe4('0x26')](handleError(_0x2349f6,null));};exports[_0x2fe4('0xb9')]=function(_0xb7cb5e,_0x10eedd,_0x582979){return db[_0x2fe4('0x3d')]['find']({'where':{'id':_0xb7cb5e[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x10eedd,null))[_0x2fe4('0x36')](function(_0x21df5c){if(_0x21df5c){return _0x21df5c[_0x2fe4('0xb9')](_0xb7cb5e['body'][_0x2fe4('0x6e')],_[_0x2fe4('0x99')](_0xb7cb5e[_0x2fe4('0x5b')],[_0x2fe4('0x6e'),'id'])||{})[_0x2fe4('0xb3')](function(_0x47c18a){for(var _0x2a95f1=0x0;_0x2a95f1<_0xb7cb5e['body'][_0x2fe4('0x6e')]['length'];_0x2a95f1+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0xb7cb5e[_0x2fe4('0x5b')][_0x2fe4('0x6e')][_0x2a95f1]),'FaxAccountId':Number(_0xb7cb5e[_0x2fe4('0x56')]['id'])});}return _0x47c18a;});}})[_0x2fe4('0x36')](respondWithResult(_0x10eedd,null))[_0x2fe4('0x26')](handleError(_0x10eedd,null));};exports[_0x2fe4('0xba')]=function(_0x43e81a,_0x5d34aa,_0x22480f){return db['FaxAccount']['find']({'where':{'id':_0x43e81a[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x5d34aa,null))[_0x2fe4('0x36')](function(_0x3644ad){if(_0x3644ad){return _0x3644ad[_0x2fe4('0xba')](_0x43e81a['query'][_0x2fe4('0x6e')])['then'](function(){if(_[_0x2fe4('0xbb')](_0x43e81a[_0x2fe4('0x42')]['ids'])){for(var _0x2cb82e=0x0;_0x2cb82e<_0x43e81a['query'][_0x2fe4('0x6e')][_0x2fe4('0x48')];_0x2cb82e+=0x1){socket[_0x2fe4('0xbc')](_0x2fe4('0xbd'),{'UserId':Number(_0x43e81a[_0x2fe4('0x42')][_0x2fe4('0x6e')][_0x2cb82e]),'FaxAccountId':Number(_0x43e81a[_0x2fe4('0x56')]['id'])});}}else{socket[_0x2fe4('0xbc')](_0x2fe4('0xbd'),{'UserId':Number(_0x43e81a['query'][_0x2fe4('0x6e')]),'FaxAccountId':Number(_0x43e81a[_0x2fe4('0x56')]['id'])});}});}})[_0x2fe4('0x36')](respondWithStatusCode(_0x5d34aa,null))[_0x2fe4('0x26')](handleError(_0x5d34aa,null));};exports[_0x2fe4('0xbe')]=function(_0x321392,_0x20839c,_0x108012){var _0x48d777={};var _0x4d8e4a={};var _0x1ea49f;var _0x3cf2cc;return db['FaxAccount'][_0x2fe4('0x68')]({'where':{'id':_0x321392[_0x2fe4('0x56')]['id']}})[_0x2fe4('0x36')](handleEntityNotFound(_0x20839c,null))[_0x2fe4('0x36')](function(_0x501da7){if(_0x501da7){_0x1ea49f=_0x501da7;_0x4d8e4a[_0x2fe4('0x41')]=_[_0x2fe4('0x43')](db['User']['rawAttributes']);_0x4d8e4a[_0x2fe4('0x42')]=_['keys'](_0x321392[_0x2fe4('0x42')]);_0x4d8e4a[_0x2fe4('0x44')]=_[_0x2fe4('0x45')](_0x4d8e4a[_0x2fe4('0x41')],_0x4d8e4a[_0x2fe4('0x42')]);_0x48d777[_0x2fe4('0x47')]=_[_0x2fe4('0x45')](_0x4d8e4a[_0x2fe4('0x41')],qs[_0x2fe4('0x46')](_0x321392[_0x2fe4('0x42')]['fields']));_0x48d777[_0x2fe4('0x47')]=_0x48d777[_0x2fe4('0x47')]['length']?_0x48d777[_0x2fe4('0x47')]:_0x4d8e4a[_0x2fe4('0x41')];_0x48d777[_0x2fe4('0x4c')]=qs[_0x2fe4('0x4d')](_0x321392[_0x2fe4('0x42')][_0x2fe4('0x4d')]);_0x48d777[_0x2fe4('0x50')]=qs[_0x2fe4('0x44')](_['pick'](_0x321392[_0x2fe4('0x42')],_0x4d8e4a[_0x2fe4('0x44')]));if(_0x321392['query'][_0x2fe4('0x4f')]){_0x48d777[_0x2fe4('0x50')]=_[_0x2fe4('0x58')](_0x48d777[_0x2fe4('0x50')],{'$or':_['map'](_0x48d777[_0x2fe4('0x47')],function(_0x343a86){var _0x37056c={};_0x37056c[_0x343a86]={'$like':'%'+_0x321392['query']['filter']+'%'};return _0x37056c;})});}_0x48d777=_['merge']({},_0x48d777,_0x321392[_0x2fe4('0x69')]);return _0x1ea49f[_0x2fe4('0xbe')](_0x48d777);}})[_0x2fe4('0x36')](function(_0x6ed170){if(_0x6ed170){_0x3cf2cc=_0x6ed170[_0x2fe4('0x48')];if(!_0x321392[_0x2fe4('0x42')][_0x2fe4('0x49')](_0x2fe4('0x4a'))){_0x48d777[_0x2fe4('0x4b')]=qs[_0x2fe4('0x4b')](_0x321392[_0x2fe4('0x42')][_0x2fe4('0x4b')]);_0x48d777[_0x2fe4('0x2a')]=qs['offset'](_0x321392['query']['offset']);}return _0x1ea49f[_0x2fe4('0xbe')](_0x48d777);}})[_0x2fe4('0x36')](function(_0x7a061a){if(_0x7a061a){return _0x7a061a?{'count':_0x3cf2cc,'rows':_0x7a061a}:null;}})[_0x2fe4('0x36')](respondWithResult(_0x20839c,null))[_0x2fe4('0x26')](handleError(_0x20839c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 25a3de5..aec9b38 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 _0xdea1=['hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x543217,_0x35f5af){var _0x1e39cb=function(_0x33e611){while(--_0x33e611){_0x543217['push'](_0x543217['shift']());}};_0x1e39cb(++_0x35f5af);}(_0xdea1,0xdf));var _0x1dea=function(_0x124296,_0x313fe4){_0x124296=_0x124296-0x0;var _0x4a5921=_0xdea1[_0x124296];return _0x4a5921;};'use strict';var EventEmitter=require(_0x1dea('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x1dea('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1dea('0x2')](0x0);var events={'afterCreate':_0x1dea('0x3'),'afterUpdate':_0x1dea('0x4'),'afterDestroy':_0x1dea('0x5')};function emitEvent(_0xa59c3){return function(_0x5dddfa,_0x4d9dff,_0x3a79f3){FaxAccountEvents[_0x1dea('0x6')](_0xa59c3+':'+_0x5dddfa['id'],_0x5dddfa);FaxAccountEvents[_0x1dea('0x6')](_0xa59c3,_0x5dddfa);_0x3a79f3(null);};}for(var e in events){if(events[_0x1dea('0x7')](e)){var event=events[e];FaxAccount[_0x1dea('0x8')](e,emitEvent(event));}}module[_0x1dea('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x3feb=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x2c0934,_0x5e03a6){var _0x5f54b6=function(_0x3eb74c){while(--_0x3eb74c){_0x2c0934['push'](_0x2c0934['shift']());}};_0x5f54b6(++_0x5e03a6);}(_0x3feb,0x1ce));var _0xb3fe=function(_0x155830,_0x343f5e){_0x155830=_0x155830-0x0;var _0x5c33d3=_0x3feb[_0x155830];return _0x5c33d3;};'use strict';var EventEmitter=require(_0xb3fe('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb3fe('0x1')](0x0);var events={'afterCreate':_0xb3fe('0x2'),'afterUpdate':_0xb3fe('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3be8d5){return function(_0x4debf3,_0x281933,_0x575ff7){FaxAccountEvents['emit'](_0x3be8d5+':'+_0x4debf3['id'],_0x4debf3);FaxAccountEvents[_0xb3fe('0x4')](_0x3be8d5,_0x4debf3);_0x575ff7(null);};}for(var e in events){if(events[_0xb3fe('0x5')](e)){var event=events[e];FaxAccount[_0xb3fe('0x6')](e,emitEvent(event));}}module[_0xb3fe('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 9ebc37b..a0ada14 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 _0x7fae=['exports','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x1f787a,_0x57ca00){var _0x400cbf=function(_0xb5801e){while(--_0xb5801e){_0x1f787a['push'](_0x1f787a['shift']());}};_0x400cbf(++_0x57ca00);}(_0x7fae,0x162));var _0xe7fa=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7fae[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xe7fa('0x0'));var util=require(_0xe7fa('0x1'));var logger=require(_0xe7fa('0x2'))(_0xe7fa('0x3'));var moment=require('moment');var BPromise=require(_0xe7fa('0x4'));var rp=require(_0xe7fa('0x5'));var fs=require('fs');var path=require(_0xe7fa('0x6'));var rimraf=require(_0xe7fa('0x7'));var config=require(_0xe7fa('0x8'));var attributes=require(_0xe7fa('0x9'));module[_0xe7fa('0xa')]=function(_0x5e7301,_0x1ac172){return _0x5e7301['define'](_0xe7fa('0xb'),attributes,{'tableName':_0xe7fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1955=['bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxAccount','lodash','api','moment'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0x1955,0x18d));var _0x5195=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x1955[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x5195('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5195('0x1'));var moment=require(_0x5195('0x2'));var BPromise=require(_0x5195('0x3'));var rp=require(_0x5195('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5195('0x5'));var config=require(_0x5195('0x6'));var attributes=require('./faxAccount.attributes');module[_0x5195('0x7')]=function(_0x4222ba,_0x44177c){return _0x4222ba[_0x5195('0x8')](_0x5195('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 8f64351..13babf9 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 _0x2f7f=['applications','list','priority','asc','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','AttachmentId','interaction','UserId','User','name','unshift','waitForTheAssignedAgent','startRouting','Start','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','DESC','Applications','get','account'];(function(_0x2062f8,_0x2f259d){var _0x2495b3=function(_0x4d2b92){while(--_0x4d2b92){_0x2062f8['push'](_0x2062f8['shift']());}};_0x2495b3(++_0x2f259d);}(_0x2f7f,0x181));var _0xf2f7=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0x2f7f[_0x35d3a8];return _0x182378;};'use strict';var _=require('lodash');var util=require(_0xf2f7('0x0'));var moment=require('moment');var BPromise=require(_0xf2f7('0x1'));var rs=require(_0xf2f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2f7('0x4'))('rpc');var config=require(_0xf2f7('0x5'));var jayson=require(_0xf2f7('0x6'));var client=jayson[_0xf2f7('0x7')][_0xf2f7('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0xf2f7('0x9')],{'host':_0xf2f7('0xa'),'port':0x18eb});var socket=require(_0xf2f7('0xb'))(new Redis(config['redis']));require(_0xf2f7('0xc'))[_0xf2f7('0xd')](socket);function respondWithRpcPromise(_0x1ce153,_0x4f6ded,_0x365d72){return new BPromise(function(_0x3e753b,_0x3c0410){return client[_0xf2f7('0xe')](_0x1ce153,_0x365d72)[_0xf2f7('0xf')](function(_0x475db1){logger[_0xf2f7('0x10')](_0xf2f7('0x11'),_0x4f6ded,_0xf2f7('0x12'));logger[_0xf2f7('0x13')](_0xf2f7('0x14'),_0x4f6ded,'request\x20sent',JSON[_0xf2f7('0x15')](_0x475db1));if(_0x475db1['error']){if(_0x475db1[_0xf2f7('0x16')]['code']===0x1f4){logger[_0xf2f7('0x16')](_0xf2f7('0x11'),_0x4f6ded,_0x475db1[_0xf2f7('0x16')]['message']);return _0x3c0410(_0x475db1[_0xf2f7('0x16')][_0xf2f7('0x17')]);}logger['error'](_0xf2f7('0x11'),_0x4f6ded,_0x475db1['error'][_0xf2f7('0x17')]);return _0x3e753b(_0x475db1['error']['message']);}else{logger[_0xf2f7('0x10')](_0xf2f7('0x11'),_0x4f6ded,_0xf2f7('0x12'));_0x3e753b(_0x475db1[_0xf2f7('0x18')]['message']);}})[_0xf2f7('0x19')](function(_0x21b428){logger['error'](_0xf2f7('0x11'),_0x4f6ded,_0x21b428);_0x3c0410(_0x21b428);});});}exports['GetFaxAccount']=function(_0x1ee8d9){var _0xbb5755=this;return new Promise(function(_0x2db7e4,_0x3e9407){return db[_0xf2f7('0x1a')][_0xf2f7('0x1b')]({'raw':_0x1ee8d9[_0xf2f7('0x1c')]?_0x1ee8d9[_0xf2f7('0x1c')][_0xf2f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ee8d9[_0xf2f7('0x1c')]?_0x1ee8d9[_0xf2f7('0x1c')][_0xf2f7('0x1e')]||null:null,'attributes':_0x1ee8d9['options']?_0x1ee8d9[_0xf2f7('0x1c')][_0xf2f7('0x1f')]||null:null,'limit':_0x1ee8d9[_0xf2f7('0x1c')]?_0x1ee8d9[_0xf2f7('0x1c')]['limit']||null:null,'include':_0x1ee8d9[_0xf2f7('0x1c')]?_0x1ee8d9[_0xf2f7('0x1c')][_0xf2f7('0x20')]?_[_0xf2f7('0x21')](_0x1ee8d9['options'][_0xf2f7('0x20')],function(_0x4f0342){return{'model':db[_0x4f0342['model']],'as':_0x4f0342['as'],'attributes':_0x4f0342[_0xf2f7('0x1f')],'include':_0x4f0342['include']?_[_0xf2f7('0x21')](_0x4f0342[_0xf2f7('0x20')],function(_0x2e5978){return{'model':db[_0x2e5978[_0xf2f7('0x22')]],'as':_0x2e5978['as'],'attributes':_0x2e5978[_0xf2f7('0x1f')],'include':_0x2e5978['include']?_['map'](_0x2e5978[_0xf2f7('0x20')],function(_0x4552d6){return{'model':db[_0x4552d6['model']],'as':_0x4552d6['as'],'attributes':_0x4552d6[_0xf2f7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf2f7('0xf')](function(_0x323c64){logger[_0xf2f7('0x10')](_0xf2f7('0x23'),_0x1ee8d9);logger[_0xf2f7('0x13')](_0xf2f7('0x23'),_0x1ee8d9,JSON[_0xf2f7('0x15')](_0x323c64));_0x2db7e4(_0x323c64);})[_0xf2f7('0x19')](function(_0x1289df){logger[_0xf2f7('0x16')](_0xf2f7('0x23'),_0x1289df[_0xf2f7('0x17')],_0x1ee8d9);_0x3e9407(_0xbb5755['error'](0x1f4,_0x1289df[_0xf2f7('0x17')]));});});};exports[_0xf2f7('0x24')]=function(_0x4b761c,_0x3ebb4c,_0x37c42d){var _0x372f6d=this;return new Promise(function(_0x471817,_0x39a7ab){var _0x21688b={'body':_0x4b761c[_0xf2f7('0x25')],'channel':_0xf2f7('0x26')};var _0x5d922e=[];var _0x18c0d2=[];var _0x3eddcf={};return db[_0xf2f7('0x27')][_0xf2f7('0x28')]()[_0xf2f7('0xf')](function(_0x1e2468){if(!_0x1e2468){throw new db['Sequelize']['ValidationError'](_0xf2f7('0x29'));}_0x5d922e=_[_0xf2f7('0x2a')](_['keys'](_0x1e2468),[_0xf2f7('0x2b'),_0xf2f7('0x2c')]);_0x18c0d2=_[_0xf2f7('0x2a')](_[_0xf2f7('0x2d')](_0x1e2468),['createdAt',_0xf2f7('0x2c'),_0xf2f7('0x2e'),_0xf2f7('0x2f')]);if(_0x4b761c[_0xf2f7('0x25')]['id']){delete _0x4b761c['body']['id'];}if(_[_0xf2f7('0x30')](_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x31')])){throw new db[(_0xf2f7('0x32'))][(_0xf2f7('0x33'))](_0xf2f7('0x34'));}if(_[_0xf2f7('0x30')](_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x25')])||_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x25')]===''){throw new db[(_0xf2f7('0x32'))][(_0xf2f7('0x33'))](_0xf2f7('0x35'));}if(_[_0xf2f7('0x30')](_0x4b761c['body'][_0xf2f7('0x36')])){throw new db[(_0xf2f7('0x32'))]['ValidationError'](_0xf2f7('0x37')+_0x18c0d2);}if(!_[_0xf2f7('0x38')](_0x18c0d2,_0x4b761c[_0xf2f7('0x25')]['mapKey'])){throw new db['Sequelize'][(_0xf2f7('0x33'))](_0xf2f7('0x39')+_0x18c0d2);}_0x3eddcf[_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x36')]]=_0x4b761c['body'][_0xf2f7('0x31')];})[_0xf2f7('0xf')](function(){return db['FaxAccount'][_0xf2f7('0x3a')]({'where':{'id':_0x4b761c['account']['id']},'include':[{'model':db['CmList'],'as':_0xf2f7('0x3b'),'include':[{'model':db[_0xf2f7('0x27')],'as':_0xf2f7('0x3c'),'where':_0x3eddcf,'limit':0x1,'order':[['updatedAt',_0xf2f7('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0xf2f7('0x3e')}]});})['then'](function(_0x2e02fe){if(_0x2e02fe&&_0x2e02fe[_0xf2f7('0x3b')]){var _0x52580e=_0x2e02fe[_0xf2f7('0x3f')]({'plain':!![]});_0x21688b[_0xf2f7('0x40')]=_0x52580e;_0x21688b[_0xf2f7('0x41')]=_0x52580e['Applications'];_0x21688b[_0xf2f7('0x42')]=_0x52580e[_0xf2f7('0x3b')];_0x21688b[_0xf2f7('0x41')]=_['orderBy'](_0x21688b[_0xf2f7('0x41')],[_0xf2f7('0x43')],[_0xf2f7('0x44')]);if(_0x21688b[_0xf2f7('0x40')][_0xf2f7('0x3e')]){delete _0x21688b[_0xf2f7('0x40')][_0xf2f7('0x3e')];}if(_0x21688b[_0xf2f7('0x40')][_0xf2f7('0x3b')]&&_0x21688b['account'][_0xf2f7('0x3b')][_0xf2f7('0x3c')][_0xf2f7('0x45')]){return _0x21688b[_0xf2f7('0x40')][_0xf2f7('0x3b')][_0xf2f7('0x3c')][0x0];}var _0x597be5=_[_0xf2f7('0x46')](_0x4b761c[_0xf2f7('0x25')],{'firstName':_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x31')],'ListId':_0x52580e[_0xf2f7('0x2f')]});_0x597be5[_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x36')]]=_0x4b761c[_0xf2f7('0x25')]['from'];return db[_0xf2f7('0x27')][_0xf2f7('0x47')](_0x597be5,{'fields':_0x5d922e,'raw':!![]});}})[_0xf2f7('0xf')](function(_0x177312){_0x21688b[_0xf2f7('0x48')]=_0x177312;if(_0x177312){var _0x2a81f6={'ContactId':_0x177312['id'],'FaxAccountId':_0x4b761c[_0xf2f7('0x40')]['id'],'fax':_0x177312['fax']};return db[_0xf2f7('0x49')][_0xf2f7('0x3a')]({'where':{'ContactId':_0x177312['id'],'closed':![],'FaxAccountId':_0x4b761c[_0xf2f7('0x40')]['id']}})[_0xf2f7('0xf')](function(_0xe4246b){if(_0xe4246b){return[_0xe4246b,![]];}return db[_0xf2f7('0x49')][_0xf2f7('0x47')](_0x2a81f6)[_0xf2f7('0xf')](function(_0x161f7b){return[_0x161f7b,!![]];});});}else{throw new Error(_0xf2f7('0x4a'));}})[_0xf2f7('0x4b')](function(_0x1492e0,_0x426385){var _0x476f80=_0x1492e0[_0xf2f7('0x3f')]({'plain':!![]});if(_0x426385){if(_0x21688b[_0xf2f7('0x40')]['autoclose']){_0x21688b['applications'][_0xf2f7('0x4c')]({'id':0x0,'priority':_0x21688b['applications'][_0xf2f7('0x45')]+0x1,'app':_0xf2f7('0x4d'),'appdata':_0xf2f7('0x4e'),'interval':_0xf2f7('0x4f')});}_0x476f80[_0xf2f7('0x50')]=!![];}else{_0x476f80[_0xf2f7('0x50')]=![];}_0x21688b['interaction']=_0x476f80;return db['FaxMessage'][_0xf2f7('0x47')]({'body':_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x25')],'FaxAccountId':_0x4b761c[_0xf2f7('0x40')]['id'],'FaxInteractionId':_0x1492e0['id'],'direction':'in','ContactId':_0x1492e0['ContactId'],'AttachmentId':_0x4b761c[_0xf2f7('0x25')][_0xf2f7('0x51')]});})[_0xf2f7('0xf')](function(_0xb6b9cc){_0x21688b[_0xf2f7('0x17')]=_0xb6b9cc;if(_0x21688b[_0xf2f7('0x52')][_0xf2f7('0x53')]){return db[_0xf2f7('0x54')][_0xf2f7('0x3a')]({'attributes':['id',_0xf2f7('0x55')],'where':{'id':_0x21688b[_0xf2f7('0x52')][_0xf2f7('0x53')]}})[_0xf2f7('0xf')](function(_0x45c71e){if(_0x45c71e){_0x21688b[_0xf2f7('0x41')][_0xf2f7('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x45c71e[_0xf2f7('0x55')]+','+(_0x21688b['account'][_0xf2f7('0x57')]||0xa),'interval':_0xf2f7('0x4f')});}return respondWithRpcPromise('Start',_0xf2f7('0x58'),_0x21688b);});}return respondWithRpcPromise(_0xf2f7('0x59'),_0xf2f7('0x58'),_0x21688b);})[_0xf2f7('0xf')](function(_0x4db0b5){_0x471817(_0x4db0b5);})[_0xf2f7('0x19')](function(_0x70cc28){_0x39a7ab(_0x372f6d[_0xf2f7('0x16')](0x1f4,_0x70cc28['message']));});});}; \ No newline at end of file +var _0xbcc8=['Contacts','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','find','name','unshift','agent','Start','startRouting','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','findAll','raw','options','where','attributes','limit','include','map','model','debug','GetFaxAccount','catch','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','FaxAccount','account','CmList','List','FaxApplication','get','applications','Applications','list','priority','asc'];(function(_0x319fae,_0x45877b){var _0x5bea31=function(_0xdc28bc){while(--_0xdc28bc){_0x319fae['push'](_0x319fae['shift']());}};_0x5bea31(++_0x45877b);}(_0xbcc8,0xcc));var _0x8bcc=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xbcc8[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x8bcc('0x0'));var util=require('util');var moment=require(_0x8bcc('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bcc('0x2'));var fs=require('fs');var Redis=require(_0x8bcc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bcc('0x4'));var logger=require(_0x8bcc('0x5'))(_0x8bcc('0x6'));var config=require(_0x8bcc('0x7'));var jayson=require(_0x8bcc('0x8'));var client=jayson[_0x8bcc('0x9')][_0x8bcc('0xa')]({'port':0x232c});config[_0x8bcc('0xb')]=_['defaults'](config[_0x8bcc('0xb')],{'host':_0x8bcc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1f5ae3,_0x3bc8dd,_0x28f138){return new BPromise(function(_0x41e0f9,_0x9fe522){return client[_0x8bcc('0xd')](_0x1f5ae3,_0x28f138)[_0x8bcc('0xe')](function(_0x1dac3d){logger[_0x8bcc('0xf')]('FaxAccount,\x20%s,\x20%s',_0x3bc8dd,_0x8bcc('0x10'));logger['debug'](_0x8bcc('0x11'),_0x3bc8dd,_0x8bcc('0x10'),JSON[_0x8bcc('0x12')](_0x1dac3d));if(_0x1dac3d[_0x8bcc('0x13')]){if(_0x1dac3d[_0x8bcc('0x13')][_0x8bcc('0x14')]===0x1f4){logger['error'](_0x8bcc('0x15'),_0x3bc8dd,_0x1dac3d[_0x8bcc('0x13')][_0x8bcc('0x16')]);return _0x9fe522(_0x1dac3d[_0x8bcc('0x13')]['message']);}logger['error'](_0x8bcc('0x15'),_0x3bc8dd,_0x1dac3d['error'][_0x8bcc('0x16')]);return _0x41e0f9(_0x1dac3d['error'][_0x8bcc('0x16')]);}else{logger[_0x8bcc('0xf')]('FaxAccount,\x20%s,\x20%s',_0x3bc8dd,'request\x20sent');_0x41e0f9(_0x1dac3d[_0x8bcc('0x17')][_0x8bcc('0x16')]);}})['catch'](function(_0x29e94){logger[_0x8bcc('0x13')](_0x8bcc('0x15'),_0x3bc8dd,_0x29e94);_0x9fe522(_0x29e94);});});}exports['GetFaxAccount']=function(_0x2cdea9){var _0x5d6df1=this;return new Promise(function(_0x2100f9,_0x392fb6){return db['FaxAccount'][_0x8bcc('0x18')]({'raw':_0x2cdea9['options']?_0x2cdea9['options'][_0x8bcc('0x19')]===undefined?!![]:![]:!![],'where':_0x2cdea9[_0x8bcc('0x1a')]?_0x2cdea9[_0x8bcc('0x1a')][_0x8bcc('0x1b')]||null:null,'attributes':_0x2cdea9['options']?_0x2cdea9[_0x8bcc('0x1a')][_0x8bcc('0x1c')]||null:null,'limit':_0x2cdea9[_0x8bcc('0x1a')]?_0x2cdea9[_0x8bcc('0x1a')][_0x8bcc('0x1d')]||null:null,'include':_0x2cdea9[_0x8bcc('0x1a')]?_0x2cdea9[_0x8bcc('0x1a')][_0x8bcc('0x1e')]?_[_0x8bcc('0x1f')](_0x2cdea9[_0x8bcc('0x1a')]['include'],function(_0xea75ab){return{'model':db[_0xea75ab[_0x8bcc('0x20')]],'as':_0xea75ab['as'],'attributes':_0xea75ab[_0x8bcc('0x1c')],'include':_0xea75ab[_0x8bcc('0x1e')]?_[_0x8bcc('0x1f')](_0xea75ab[_0x8bcc('0x1e')],function(_0x306eba){return{'model':db[_0x306eba['model']],'as':_0x306eba['as'],'attributes':_0x306eba[_0x8bcc('0x1c')],'include':_0x306eba[_0x8bcc('0x1e')]?_['map'](_0x306eba['include'],function(_0x3870ae){return{'model':db[_0x3870ae[_0x8bcc('0x20')]],'as':_0x3870ae['as'],'attributes':_0x3870ae['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x245e6f){logger[_0x8bcc('0xf')]('GetFaxAccount',_0x2cdea9);logger[_0x8bcc('0x21')](_0x8bcc('0x22'),_0x2cdea9,JSON[_0x8bcc('0x12')](_0x245e6f));_0x2100f9(_0x245e6f);})[_0x8bcc('0x23')](function(_0x50e60b){logger[_0x8bcc('0x13')](_0x8bcc('0x22'),_0x50e60b[_0x8bcc('0x16')],_0x2cdea9);_0x392fb6(_0x5d6df1[_0x8bcc('0x13')](0x1f4,_0x50e60b[_0x8bcc('0x16')]));});});};exports[_0x8bcc('0x24')]=function(_0x119e00,_0x54163c,_0x2eaabd){var _0x46df00=this;return new Promise(function(_0x530624,_0x57bb8d){var _0x34b57f={'body':_0x119e00['body'],'channel':_0x8bcc('0x25')};var _0x114c91=[];var _0x5b7cb6=[];var _0x319f6e={};return db[_0x8bcc('0x26')][_0x8bcc('0x27')]()[_0x8bcc('0xe')](function(_0x57041f){if(!_0x57041f){throw new db[(_0x8bcc('0x28'))][(_0x8bcc('0x29'))](_0x8bcc('0x2a'));}_0x114c91=_[_0x8bcc('0x2b')](_['keys'](_0x57041f),[_0x8bcc('0x2c'),_0x8bcc('0x2d')]);_0x5b7cb6=_['difference'](_[_0x8bcc('0x2e')](_0x57041f),[_0x8bcc('0x2c'),_0x8bcc('0x2d'),_0x8bcc('0x2f'),_0x8bcc('0x30')]);if(_0x119e00[_0x8bcc('0x31')]['id']){delete _0x119e00[_0x8bcc('0x31')]['id'];}if(_['isNil'](_0x119e00['body'][_0x8bcc('0x32')])){throw new db[(_0x8bcc('0x28'))]['ValidationError'](_0x8bcc('0x33'));}if(_['isNil'](_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x31')])||_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x31')]===''){throw new db[(_0x8bcc('0x28'))][(_0x8bcc('0x29'))](_0x8bcc('0x34'));}if(_[_0x8bcc('0x35')](_0x119e00[_0x8bcc('0x31')]['mapKey'])){throw new db[(_0x8bcc('0x28'))][(_0x8bcc('0x29'))](_0x8bcc('0x36')+_0x5b7cb6);}if(!_[_0x8bcc('0x37')](_0x5b7cb6,_0x119e00[_0x8bcc('0x31')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x8bcc('0x38')+_0x5b7cb6);}_0x319f6e[_0x119e00['body'][_0x8bcc('0x39')]]=_0x119e00[_0x8bcc('0x31')]['from'];})[_0x8bcc('0xe')](function(){return db[_0x8bcc('0x3a')]['find']({'where':{'id':_0x119e00[_0x8bcc('0x3b')]['id']},'include':[{'model':db[_0x8bcc('0x3c')],'as':_0x8bcc('0x3d'),'include':[{'model':db[_0x8bcc('0x26')],'as':'Contacts','where':_0x319f6e,'limit':0x1,'order':[[_0x8bcc('0x2d'),'DESC']]}]},{'model':db[_0x8bcc('0x3e')],'as':'Applications'}]});})[_0x8bcc('0xe')](function(_0x39ed33){if(_0x39ed33&&_0x39ed33[_0x8bcc('0x3d')]){var _0x9c034f=_0x39ed33[_0x8bcc('0x3f')]({'plain':!![]});_0x34b57f[_0x8bcc('0x3b')]=_0x9c034f;_0x34b57f[_0x8bcc('0x40')]=_0x9c034f[_0x8bcc('0x41')];_0x34b57f[_0x8bcc('0x42')]=_0x9c034f[_0x8bcc('0x3d')];_0x34b57f['applications']=_['orderBy'](_0x34b57f[_0x8bcc('0x40')],[_0x8bcc('0x43')],[_0x8bcc('0x44')]);if(_0x34b57f['account'][_0x8bcc('0x41')]){delete _0x34b57f[_0x8bcc('0x3b')]['Applications'];}if(_0x34b57f[_0x8bcc('0x3b')][_0x8bcc('0x3d')]&&_0x34b57f[_0x8bcc('0x3b')][_0x8bcc('0x3d')][_0x8bcc('0x45')]['length']){return _0x34b57f[_0x8bcc('0x3b')][_0x8bcc('0x3d')]['Contacts'][0x0];}var _0x54412e=_[_0x8bcc('0x46')](_0x119e00[_0x8bcc('0x31')],{'firstName':_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x32')],'ListId':_0x9c034f['ListId']});_0x54412e[_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x39')]]=_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x32')];return db[_0x8bcc('0x26')][_0x8bcc('0x47')](_0x54412e,{'fields':_0x114c91,'raw':!![]});}})[_0x8bcc('0xe')](function(_0xcca8fe){_0x34b57f[_0x8bcc('0x48')]=_0xcca8fe;if(_0xcca8fe){var _0x9aee85={'ContactId':_0xcca8fe['id'],'FaxAccountId':_0x119e00[_0x8bcc('0x3b')]['id'],'fax':_0xcca8fe[_0x8bcc('0x25')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0xcca8fe['id'],'closed':![],'FaxAccountId':_0x119e00[_0x8bcc('0x3b')]['id']}})[_0x8bcc('0xe')](function(_0x4ea90f){if(_0x4ea90f){return[_0x4ea90f,![]];}return db[_0x8bcc('0x49')]['create'](_0x9aee85)['then'](function(_0x1d028e){return[_0x1d028e,!![]];});});}else{throw new Error(_0x8bcc('0x4a'));}})[_0x8bcc('0x4b')](function(_0x2d0431,_0x4c58aa){var _0xb13b10=_0x2d0431[_0x8bcc('0x3f')]({'plain':!![]});if(_0x4c58aa){if(_0x34b57f[_0x8bcc('0x3b')][_0x8bcc('0x4c')]){_0x34b57f[_0x8bcc('0x40')]['push']({'id':0x0,'priority':_0x34b57f[_0x8bcc('0x40')]['length']+0x1,'app':_0x8bcc('0x4d'),'appdata':_0x8bcc('0x4e'),'interval':_0x8bcc('0x4f')});}_0xb13b10[_0x8bcc('0x50')]=!![];}else{_0xb13b10[_0x8bcc('0x50')]=![];}_0x34b57f[_0x8bcc('0x51')]=_0xb13b10;return db[_0x8bcc('0x52')][_0x8bcc('0x47')]({'body':_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x31')],'FaxAccountId':_0x119e00[_0x8bcc('0x3b')]['id'],'FaxInteractionId':_0x2d0431['id'],'direction':'in','ContactId':_0x2d0431['ContactId'],'AttachmentId':_0x119e00[_0x8bcc('0x31')][_0x8bcc('0x53')]});})['then'](function(_0x29ed7d){_0x34b57f['message']=_0x29ed7d;if(_0x34b57f[_0x8bcc('0x51')][_0x8bcc('0x54')]){return db['User'][_0x8bcc('0x55')]({'attributes':['id',_0x8bcc('0x56')],'where':{'id':_0x34b57f[_0x8bcc('0x51')][_0x8bcc('0x54')]}})[_0x8bcc('0xe')](function(_0x2ce1a6){if(_0x2ce1a6){_0x34b57f[_0x8bcc('0x40')][_0x8bcc('0x57')]({'id':0x0,'priority':0x0,'app':_0x8bcc('0x58'),'appdata':_0x2ce1a6['name']+','+(_0x34b57f['account']['waitForTheAssignedAgent']||0xa),'interval':_0x8bcc('0x4f')});}return respondWithRpcPromise(_0x8bcc('0x59'),'startRouting',_0x34b57f);});}return respondWithRpcPromise(_0x8bcc('0x59'),_0x8bcc('0x5a'),_0x34b57f);})['then'](function(_0x16e0d1){_0x530624(_0x16e0d1);})[_0x8bcc('0x23')](function(_0x5e1d62){_0x57bb8d(_0x46df00[_0x8bcc('0x13')](0x1f4,_0x5e1d62[_0x8bcc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e82d6a7..5c9ed14 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 _0xa889=['length','faxAccount:','./faxAccount.events','remove','emit','register'];(function(_0x105b65,_0x3b7d21){var _0xd8ff8c=function(_0x5acaf9){while(--_0x5acaf9){_0x105b65['push'](_0x105b65['shift']());}};_0xd8ff8c(++_0x3b7d21);}(_0xa889,0xc2));var _0x9a88=function(_0x2de869,_0xda6014){_0x2de869=_0x2de869-0x0;var _0x2b6241=_0xa889[_0x2de869];return _0x2b6241;};'use strict';var FaxAccountEvents=require(_0x9a88('0x0'));var events=['save',_0x9a88('0x1'),'update'];function createListener(_0x80f55e,_0xd372f7){return function(_0x36526e){_0xd372f7[_0x9a88('0x2')](_0x80f55e,_0x36526e);};}function removeListener(_0x5685cf,_0x5a0bd8){return function(){FaxAccountEvents['removeListener'](_0x5685cf,_0x5a0bd8);};}exports[_0x9a88('0x3')]=function(_0x1800ed){for(var _0x385837=0x0,_0x47b89d=events[_0x9a88('0x4')];_0x385837<_0x47b89d;_0x385837++){var _0x2ab013=events[_0x385837];var _0x4e5a4e=createListener(_0x9a88('0x5')+_0x2ab013,_0x1800ed);FaxAccountEvents['on'](_0x2ab013,_0x4e5a4e);}}; \ No newline at end of file +var _0xd032=['faxAccount:','save','remove','emit','length'];(function(_0x5010cc,_0x36dcac){var _0x557001=function(_0x8eb0b2){while(--_0x8eb0b2){_0x5010cc['push'](_0x5010cc['shift']());}};_0x557001(++_0x36dcac);}(_0xd032,0x1a5));var _0x2d03=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xd032[_0x5f3f88];return _0xd08119;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x2d03('0x0'),_0x2d03('0x1'),'update'];function createListener(_0x39cc3c,_0x147951){return function(_0x250027){_0x147951[_0x2d03('0x2')](_0x39cc3c,_0x250027);};}function removeListener(_0x36c4ef,_0x5659cc){return function(){FaxAccountEvents['removeListener'](_0x36c4ef,_0x5659cc);};}exports['register']=function(_0x435bc2){for(var _0x493032=0x0,_0xd6a5c2=events[_0x2d03('0x3')];_0x493032<_0xd6a5c2;_0x493032++){var _0x276cec=events[_0x493032];var _0x2e428d=createListener(_0x2d03('0x4')+_0x276cec,_0x435bc2);FaxAccountEvents['on'](_0x276cec,_0x2e428d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index fe8abcf..c702f84 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(_0x4d9c59,_0x4e44c8){var _0x166b0b=function(_0x2c26bf){while(--_0x2c26bf){_0x4d9c59['push'](_0x4d9c59['shift']());}};_0x166b0b(++_0x4e44c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x4515dd,_0x436dad){var _0x3d49b5=function(_0x19fe92){while(--_0x19fe92){_0x4515dd['push'](_0x4515dd['shift']());}};_0x3d49b5(++_0x436dad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 7dbb2da..14c8964 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 _0x7a26=['STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x3bb14a,_0x57329f){var _0x29fc8a=function(_0x202739){while(--_0x202739){_0x3bb14a['push'](_0x3bb14a['shift']());}};_0x29fc8a(++_0x57329f);}(_0x7a26,0x102));var _0x67a2=function(_0x348221,_0x52898e){_0x348221=_0x348221-0x0;var _0x463526=_0x7a26[_0x348221];return _0x463526;};'use strict';var Sequelize=require(_0x67a2('0x0'));module[_0x67a2('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x67a2('0x2')],'allowNull':![],'defaultValue':_0x67a2('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x67a2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x67a2('0x4')}}; \ No newline at end of file +var _0x7bae=['TEXT','*,*,*,*','exports','INTEGER'];(function(_0x59db0f,_0x466ec8){var _0x2d3a0c=function(_0x5a1a4d){while(--_0x5a1a4d){_0x59db0f['push'](_0x59db0f['shift']());}};_0x2d3a0c(++_0x466ec8);}(_0x7bae,0x176));var _0xe7ba=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7bae[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require('sequelize');module[_0xe7ba('0x0')]={'priority':{'type':Sequelize[_0xe7ba('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe7ba('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe7ba('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 26bbcb1..08d461e 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 _0xa864=['includeAll','include','findAll','rows','show','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where'];(function(_0x62b0dd,_0x3011a4){var _0x4f874c=function(_0x5624e4){while(--_0x5624e4){_0x62b0dd['push'](_0x62b0dd['shift']());}};_0x4f874c(++_0x3011a4);}(_0xa864,0xa6));var _0x4a86=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xa864[_0x492535];return _0x256620;};'use strict';var emlformat=require(_0x4a86('0x0'));var rimraf=require(_0x4a86('0x1'));var zipdir=require(_0x4a86('0x2'));var jsonpatch=require(_0x4a86('0x3'));var rp=require(_0x4a86('0x4'));var moment=require(_0x4a86('0x5'));var BPromise=require(_0x4a86('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a86('0x7'));var sox=require(_0x4a86('0x8'));var csv=require(_0x4a86('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a86('0xa'));var _=require(_0x4a86('0xb'));var squel=require(_0x4a86('0xc'));var crypto=require(_0x4a86('0xd'));var jsforce=require(_0x4a86('0xe'));var deskjs=require(_0x4a86('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a86('0x10'));var Papa=require(_0x4a86('0x11'));var Redis=require(_0x4a86('0x12'));var authService=require(_0x4a86('0x13'));var qs=require(_0x4a86('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a86('0x15'));var logger=require(_0x4a86('0x16'))(_0x4a86('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a86('0x18'));var db=require(_0x4a86('0x19'))['db'];function respondWithStatusCode(_0x14083f,_0x280d1a){_0x280d1a=_0x280d1a||0xcc;return function(_0x1a280f){if(_0x1a280f){return _0x14083f[_0x4a86('0x1a')](_0x280d1a);}return _0x14083f['status'](_0x280d1a)[_0x4a86('0x1b')]();};}function respondWithResult(_0x217784,_0x3f28e1){_0x3f28e1=_0x3f28e1||0xc8;return function(_0x38846d){if(_0x38846d){return _0x217784[_0x4a86('0x1c')](_0x3f28e1)[_0x4a86('0x1d')](_0x38846d);}};}function respondWithFilteredResult(_0x29cfa5,_0x5df5ce){return function(_0x58cff3){if(_0x58cff3){var _0x4eb2e5=typeof _0x5df5ce[_0x4a86('0x1e')]===_0x4a86('0x1f')&&typeof _0x5df5ce['limit']===_0x4a86('0x1f');var _0x2220a8=_0x58cff3[_0x4a86('0x20')];var _0x48aa5b=_0x4eb2e5?0x0:_0x5df5ce[_0x4a86('0x1e')];var _0x98855e=_0x4eb2e5?_0x58cff3['count']:_0x5df5ce[_0x4a86('0x1e')]+_0x5df5ce[_0x4a86('0x21')];var _0x41601f;if(_0x98855e>=_0x2220a8){_0x98855e=_0x2220a8;_0x41601f=0xc8;}else{_0x41601f=0xce;}_0x29cfa5['status'](_0x41601f);return _0x29cfa5['set'](_0x4a86('0x22'),_0x48aa5b+'-'+_0x98855e+'/'+_0x2220a8)[_0x4a86('0x1d')](_0x58cff3);}return null;};}function patchUpdates(_0x3144b4){return function(_0x3a1c2f){try{jsonpatch['apply'](_0x3a1c2f,_0x3144b4,!![]);}catch(_0x3faef9){return BPromise[_0x4a86('0x23')](_0x3faef9);}return _0x3a1c2f['save']();};}function saveUpdates(_0x5b9dd6,_0x2fde91){return function(_0x3268aa){if(_0x3268aa){return _0x3268aa[_0x4a86('0x24')](_0x5b9dd6)[_0x4a86('0x25')](function(_0x5e8ca1){return _0x5e8ca1;});}return null;};}function removeEntity(_0xf42ba8,_0x19c370){return function(_0x5901f1){if(_0x5901f1){return _0x5901f1[_0x4a86('0x26')]()[_0x4a86('0x25')](function(){_0xf42ba8[_0x4a86('0x1c')](0xcc)[_0x4a86('0x1b')]();});}};}function handleEntityNotFound(_0x1953d3,_0x113d87){return function(_0x35eb60){if(!_0x35eb60){_0x1953d3[_0x4a86('0x1a')](0x194);}return _0x35eb60;};}function handleError(_0x557da5,_0xf355a5){_0xf355a5=_0xf355a5||0x1f4;return function(_0x97f09a){logger[_0x4a86('0x27')](_0x97f09a[_0x4a86('0x28')]);if(_0x97f09a['name']){delete _0x97f09a[_0x4a86('0x29')];}_0x557da5[_0x4a86('0x1c')](_0xf355a5)[_0x4a86('0x2a')](_0x97f09a);};}exports[_0x4a86('0x2b')]=function(_0x25e48b,_0xe1c7ab){var _0x5757e6={},_0x40df9d={},_0xcda655={'count':0x0,'rows':[]};var _0x590108=_['map'](db[_0x4a86('0x2c')][_0x4a86('0x2d')],function(_0x5938c6){return{'name':_0x5938c6[_0x4a86('0x2e')],'type':_0x5938c6[_0x4a86('0x2f')][_0x4a86('0x30')]};});_0x40df9d['model']=_[_0x4a86('0x31')](_0x590108,_0x4a86('0x29'));_0x40df9d['query']=_[_0x4a86('0x32')](_0x25e48b[_0x4a86('0x33')]);_0x40df9d['filters']=_[_0x4a86('0x34')](_0x40df9d[_0x4a86('0x35')],_0x40df9d[_0x4a86('0x33')]);_0x5757e6[_0x4a86('0x36')]=_[_0x4a86('0x34')](_0x40df9d[_0x4a86('0x35')],qs[_0x4a86('0x37')](_0x25e48b[_0x4a86('0x33')][_0x4a86('0x37')]));_0x5757e6[_0x4a86('0x36')]=_0x5757e6[_0x4a86('0x36')][_0x4a86('0x38')]?_0x5757e6[_0x4a86('0x36')]:_0x40df9d[_0x4a86('0x35')];if(!_0x25e48b[_0x4a86('0x33')][_0x4a86('0x39')](_0x4a86('0x3a'))){_0x5757e6['limit']=qs['limit'](_0x25e48b[_0x4a86('0x33')][_0x4a86('0x21')]);_0x5757e6[_0x4a86('0x1e')]=qs[_0x4a86('0x1e')](_0x25e48b['query'][_0x4a86('0x1e')]);}_0x5757e6[_0x4a86('0x3b')]=qs[_0x4a86('0x3c')](_0x25e48b['query'][_0x4a86('0x3c')]);_0x5757e6['where']=qs[_0x4a86('0x3d')](_[_0x4a86('0x3e')](_0x25e48b[_0x4a86('0x33')],_0x40df9d[_0x4a86('0x3d')]),_0x590108);if(_0x25e48b[_0x4a86('0x33')][_0x4a86('0x3f')]){_0x5757e6['where']=_[_0x4a86('0x40')](_0x5757e6['where'],{'$or':_[_0x4a86('0x31')](_0x590108,function(_0x1a37a2){if(_0x1a37a2[_0x4a86('0x2f')]!==_0x4a86('0x41')){var _0x266f30={};_0x266f30[_0x1a37a2[_0x4a86('0x29')]]={'$like':'%'+_0x25e48b[_0x4a86('0x33')][_0x4a86('0x3f')]+'%'};return _0x266f30;}})});}_0x5757e6=_[_0x4a86('0x40')]({},_0x5757e6,_0x25e48b[_0x4a86('0x42')]);var _0x48ab91={'where':_0x5757e6[_0x4a86('0x43')]};return db[_0x4a86('0x2c')][_0x4a86('0x20')](_0x48ab91)[_0x4a86('0x25')](function(_0x3f6f69){_0xcda655[_0x4a86('0x20')]=_0x3f6f69;if(_0x25e48b[_0x4a86('0x33')][_0x4a86('0x44')]){_0x5757e6[_0x4a86('0x45')]=[{'all':!![]}];}return db[_0x4a86('0x2c')][_0x4a86('0x46')](_0x5757e6);})[_0x4a86('0x25')](function(_0x27e278){_0xcda655[_0x4a86('0x47')]=_0x27e278;return _0xcda655;})[_0x4a86('0x25')](respondWithFilteredResult(_0xe1c7ab,_0x5757e6))['catch'](handleError(_0xe1c7ab,null));};exports[_0x4a86('0x48')]=function(_0x2598fb,_0x485ffc){var _0x3ba562={'raw':!![],'where':{'id':_0x2598fb['params']['id']}},_0x804c19={};_0x804c19['model']=_['keys'](db[_0x4a86('0x2c')]['rawAttributes']);_0x804c19[_0x4a86('0x33')]=_[_0x4a86('0x32')](_0x2598fb[_0x4a86('0x33')]);_0x804c19[_0x4a86('0x3d')]=_[_0x4a86('0x34')](_0x804c19[_0x4a86('0x35')],_0x804c19['query']);_0x3ba562['attributes']=_['intersection'](_0x804c19[_0x4a86('0x35')],qs['fields'](_0x2598fb[_0x4a86('0x33')]['fields']));_0x3ba562['attributes']=_0x3ba562['attributes'][_0x4a86('0x38')]?_0x3ba562['attributes']:_0x804c19[_0x4a86('0x35')];if(_0x2598fb[_0x4a86('0x33')][_0x4a86('0x44')]){_0x3ba562[_0x4a86('0x45')]=[{'all':!![]}];}_0x3ba562=_[_0x4a86('0x40')]({},_0x3ba562,_0x2598fb['options']);return db[_0x4a86('0x2c')]['find'](_0x3ba562)[_0x4a86('0x25')](handleEntityNotFound(_0x485ffc,null))[_0x4a86('0x25')](respondWithResult(_0x485ffc,null))[_0x4a86('0x49')](handleError(_0x485ffc,null));};exports[_0x4a86('0x4a')]=function(_0x560ba5,_0x474c79){return db[_0x4a86('0x2c')]['create'](_0x560ba5['body'],{})[_0x4a86('0x25')](respondWithResult(_0x474c79,0xc9))[_0x4a86('0x49')](handleError(_0x474c79,null));};exports[_0x4a86('0x24')]=function(_0x1d16de,_0xd8dbca){if(_0x1d16de[_0x4a86('0x4b')]['id']){delete _0x1d16de[_0x4a86('0x4b')]['id'];}return db[_0x4a86('0x2c')][_0x4a86('0x4c')]({'where':{'id':_0x1d16de['params']['id']}})[_0x4a86('0x25')](handleEntityNotFound(_0xd8dbca,null))[_0x4a86('0x25')](saveUpdates(_0x1d16de[_0x4a86('0x4b')],null))[_0x4a86('0x25')](respondWithResult(_0xd8dbca,null))['catch'](handleError(_0xd8dbca,null));};exports[_0x4a86('0x26')]=function(_0x4356ae,_0x3888c2){return db[_0x4a86('0x2c')][_0x4a86('0x4c')]({'where':{'id':_0x4356ae[_0x4a86('0x4d')]['id']}})[_0x4a86('0x25')](handleEntityNotFound(_0x3888c2,null))[_0x4a86('0x25')](removeEntity(_0x3888c2,null))['catch'](handleError(_0x3888c2,null));}; \ No newline at end of file +var _0x16ad=['where','include','findAll','rows','catch','show','create','body','find','params','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','FaxApplication','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options'];(function(_0x18c0bf,_0x3c14fb){var _0x3db625=function(_0x5bfd3e){while(--_0x5bfd3e){_0x18c0bf['push'](_0x18c0bf['shift']());}};_0x3db625(++_0x3c14fb);}(_0x16ad,0x17c));var _0xd16a=function(_0x1bab70,_0x399ccf){_0x1bab70=_0x1bab70-0x0;var _0x44a639=_0x16ad[_0x1bab70];return _0x44a639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd16a('0x0'));var zipdir=require(_0xd16a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd16a('0x2'));var moment=require(_0xd16a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd16a('0x4'));var sox=require('sox');var csv=require(_0xd16a('0x5'));var ejs=require(_0xd16a('0x6'));var fs=require('fs');var fs_extra=require(_0xd16a('0x7'));var _=require(_0xd16a('0x8'));var squel=require(_0xd16a('0x9'));var crypto=require(_0xd16a('0xa'));var jsforce=require(_0xd16a('0xb'));var deskjs=require(_0xd16a('0xc'));var toCsv=require(_0xd16a('0x5'));var querystring=require(_0xd16a('0xd'));var Papa=require(_0xd16a('0xe'));var Redis=require(_0xd16a('0xf'));var authService=require(_0xd16a('0x10'));var qs=require(_0xd16a('0x11'));var as=require(_0xd16a('0x12'));var hardwareService=require(_0xd16a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd16a('0x14'));var config=require(_0xd16a('0x15'));var licenseUtil=require(_0xd16a('0x16'));var db=require(_0xd16a('0x17'))['db'];function respondWithStatusCode(_0x1b4733,_0x3a7735){_0x3a7735=_0x3a7735||0xcc;return function(_0x1111bf){if(_0x1111bf){return _0x1b4733['sendStatus'](_0x3a7735);}return _0x1b4733['status'](_0x3a7735)[_0xd16a('0x18')]();};}function respondWithResult(_0x427271,_0x4ab47e){_0x4ab47e=_0x4ab47e||0xc8;return function(_0x22980a){if(_0x22980a){return _0x427271['status'](_0x4ab47e)[_0xd16a('0x19')](_0x22980a);}};}function respondWithFilteredResult(_0x13735d,_0x533771){return function(_0x4b6cd3){if(_0x4b6cd3){var _0xb634ab=typeof _0x533771[_0xd16a('0x1a')]==='undefined'&&typeof _0x533771[_0xd16a('0x1b')]===_0xd16a('0x1c');var _0x7b0ece=_0x4b6cd3[_0xd16a('0x1d')];var _0x528d77=_0xb634ab?0x0:_0x533771[_0xd16a('0x1a')];var _0x535156=_0xb634ab?_0x4b6cd3[_0xd16a('0x1d')]:_0x533771[_0xd16a('0x1a')]+_0x533771['limit'];var _0x4aa4dd;if(_0x535156>=_0x7b0ece){_0x535156=_0x7b0ece;_0x4aa4dd=0xc8;}else{_0x4aa4dd=0xce;}_0x13735d[_0xd16a('0x1e')](_0x4aa4dd);return _0x13735d[_0xd16a('0x1f')]('Content-Range',_0x528d77+'-'+_0x535156+'/'+_0x7b0ece)['json'](_0x4b6cd3);}return null;};}function patchUpdates(_0x3359d9){return function(_0x27f76f){try{jsonpatch[_0xd16a('0x20')](_0x27f76f,_0x3359d9,!![]);}catch(_0x3dd26c){return BPromise[_0xd16a('0x21')](_0x3dd26c);}return _0x27f76f[_0xd16a('0x22')]();};}function saveUpdates(_0x51fcb7,_0x26c7e4){return function(_0x3776e7){if(_0x3776e7){return _0x3776e7[_0xd16a('0x23')](_0x51fcb7)[_0xd16a('0x24')](function(_0x3bff22){return _0x3bff22;});}return null;};}function removeEntity(_0x10201c,_0x28c99e){return function(_0x107737){if(_0x107737){return _0x107737[_0xd16a('0x25')]()[_0xd16a('0x24')](function(){_0x10201c['status'](0xcc)[_0xd16a('0x18')]();});}};}function handleEntityNotFound(_0x5e6819,_0x4180b1){return function(_0xa6c89a){if(!_0xa6c89a){_0x5e6819[_0xd16a('0x26')](0x194);}return _0xa6c89a;};}function handleError(_0x280503,_0x4f0548){_0x4f0548=_0x4f0548||0x1f4;return function(_0x1364f4){logger[_0xd16a('0x27')](_0x1364f4['stack']);if(_0x1364f4[_0xd16a('0x28')]){delete _0x1364f4[_0xd16a('0x28')];}_0x280503[_0xd16a('0x1e')](_0x4f0548)[_0xd16a('0x29')](_0x1364f4);};}exports[_0xd16a('0x2a')]=function(_0x2e9193,_0x1f892e){var _0x2ad97a={},_0xecda11={},_0x179046={'count':0x0,'rows':[]};var _0x12adab=_['map'](db[_0xd16a('0x2b')]['rawAttributes'],function(_0x2b07e9){return{'name':_0x2b07e9[_0xd16a('0x2c')],'type':_0x2b07e9[_0xd16a('0x2d')]['key']};});_0xecda11[_0xd16a('0x2e')]=_[_0xd16a('0x2f')](_0x12adab,'name');_0xecda11[_0xd16a('0x30')]=_[_0xd16a('0x31')](_0x2e9193['query']);_0xecda11[_0xd16a('0x32')]=_[_0xd16a('0x33')](_0xecda11[_0xd16a('0x2e')],_0xecda11[_0xd16a('0x30')]);_0x2ad97a[_0xd16a('0x34')]=_[_0xd16a('0x33')](_0xecda11[_0xd16a('0x2e')],qs['fields'](_0x2e9193[_0xd16a('0x30')][_0xd16a('0x35')]));_0x2ad97a[_0xd16a('0x34')]=_0x2ad97a[_0xd16a('0x34')][_0xd16a('0x36')]?_0x2ad97a[_0xd16a('0x34')]:_0xecda11['model'];if(!_0x2e9193[_0xd16a('0x30')][_0xd16a('0x37')](_0xd16a('0x38'))){_0x2ad97a['limit']=qs[_0xd16a('0x1b')](_0x2e9193[_0xd16a('0x30')]['limit']);_0x2ad97a[_0xd16a('0x1a')]=qs[_0xd16a('0x1a')](_0x2e9193['query']['offset']);}_0x2ad97a[_0xd16a('0x39')]=qs[_0xd16a('0x3a')](_0x2e9193['query'][_0xd16a('0x3a')]);_0x2ad97a['where']=qs[_0xd16a('0x32')](_[_0xd16a('0x3b')](_0x2e9193[_0xd16a('0x30')],_0xecda11[_0xd16a('0x32')]),_0x12adab);if(_0x2e9193[_0xd16a('0x30')][_0xd16a('0x3c')]){_0x2ad97a['where']=_[_0xd16a('0x3d')](_0x2ad97a['where'],{'$or':_[_0xd16a('0x2f')](_0x12adab,function(_0x16b096){if(_0x16b096[_0xd16a('0x2d')]!==_0xd16a('0x3e')){var _0x2ac27a={};_0x2ac27a[_0x16b096[_0xd16a('0x28')]]={'$like':'%'+_0x2e9193[_0xd16a('0x30')][_0xd16a('0x3c')]+'%'};return _0x2ac27a;}})});}_0x2ad97a=_[_0xd16a('0x3d')]({},_0x2ad97a,_0x2e9193[_0xd16a('0x3f')]);var _0x2d354c={'where':_0x2ad97a[_0xd16a('0x40')]};return db[_0xd16a('0x2b')][_0xd16a('0x1d')](_0x2d354c)[_0xd16a('0x24')](function(_0x5e1e91){_0x179046[_0xd16a('0x1d')]=_0x5e1e91;if(_0x2e9193[_0xd16a('0x30')]['includeAll']){_0x2ad97a[_0xd16a('0x41')]=[{'all':!![]}];}return db[_0xd16a('0x2b')][_0xd16a('0x42')](_0x2ad97a);})[_0xd16a('0x24')](function(_0x31428e){_0x179046[_0xd16a('0x43')]=_0x31428e;return _0x179046;})[_0xd16a('0x24')](respondWithFilteredResult(_0x1f892e,_0x2ad97a))[_0xd16a('0x44')](handleError(_0x1f892e,null));};exports[_0xd16a('0x45')]=function(_0xd8e097,_0x5ace2c){var _0x1193a4={'raw':!![],'where':{'id':_0xd8e097['params']['id']}},_0x4ebf3a={};_0x4ebf3a['model']=_[_0xd16a('0x31')](db[_0xd16a('0x2b')]['rawAttributes']);_0x4ebf3a[_0xd16a('0x30')]=_[_0xd16a('0x31')](_0xd8e097['query']);_0x4ebf3a[_0xd16a('0x32')]=_[_0xd16a('0x33')](_0x4ebf3a[_0xd16a('0x2e')],_0x4ebf3a[_0xd16a('0x30')]);_0x1193a4[_0xd16a('0x34')]=_[_0xd16a('0x33')](_0x4ebf3a[_0xd16a('0x2e')],qs[_0xd16a('0x35')](_0xd8e097[_0xd16a('0x30')][_0xd16a('0x35')]));_0x1193a4[_0xd16a('0x34')]=_0x1193a4[_0xd16a('0x34')][_0xd16a('0x36')]?_0x1193a4[_0xd16a('0x34')]:_0x4ebf3a[_0xd16a('0x2e')];if(_0xd8e097[_0xd16a('0x30')]['includeAll']){_0x1193a4[_0xd16a('0x41')]=[{'all':!![]}];}_0x1193a4=_[_0xd16a('0x3d')]({},_0x1193a4,_0xd8e097['options']);return db[_0xd16a('0x2b')]['find'](_0x1193a4)['then'](handleEntityNotFound(_0x5ace2c,null))[_0xd16a('0x24')](respondWithResult(_0x5ace2c,null))[_0xd16a('0x44')](handleError(_0x5ace2c,null));};exports[_0xd16a('0x46')]=function(_0x114af,_0x4575b5){return db[_0xd16a('0x2b')]['create'](_0x114af[_0xd16a('0x47')],{})[_0xd16a('0x24')](respondWithResult(_0x4575b5,0xc9))[_0xd16a('0x44')](handleError(_0x4575b5,null));};exports[_0xd16a('0x23')]=function(_0x901d24,_0x185443){if(_0x901d24[_0xd16a('0x47')]['id']){delete _0x901d24['body']['id'];}return db[_0xd16a('0x2b')][_0xd16a('0x48')]({'where':{'id':_0x901d24[_0xd16a('0x49')]['id']}})[_0xd16a('0x24')](handleEntityNotFound(_0x185443,null))['then'](saveUpdates(_0x901d24[_0xd16a('0x47')],null))[_0xd16a('0x24')](respondWithResult(_0x185443,null))['catch'](handleError(_0x185443,null));};exports[_0xd16a('0x25')]=function(_0x422359,_0x5046d3){return db[_0xd16a('0x2b')][_0xd16a('0x48')]({'where':{'id':_0x422359[_0xd16a('0x49')]['id']}})['then'](handleEntityNotFound(_0x5046d3,null))[_0xd16a('0x24')](removeEntity(_0x5046d3,null))['catch'](handleError(_0x5046d3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6dcdf51..a48a4e9 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 _0x7780=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./faxApplication.attributes','define'];(function(_0x5b1362,_0x4f7fa1){var _0x49cf4e=function(_0x57bd71){while(--_0x57bd71){_0x5b1362['push'](_0x5b1362['shift']());}};_0x49cf4e(++_0x4f7fa1);}(_0x7780,0x117));var _0x0778=function(_0x34756e,_0x3c036a){_0x34756e=_0x34756e-0x0;var _0x365e63=_0x7780[_0x34756e];return _0x365e63;};'use strict';var _=require(_0x0778('0x0'));var util=require(_0x0778('0x1'));var logger=require(_0x0778('0x2'))(_0x0778('0x3'));var moment=require(_0x0778('0x4'));var BPromise=require('bluebird');var rp=require(_0x0778('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0778('0x6'));var config=require('../../config/environment');var attributes=require(_0x0778('0x7'));module['exports']=function(_0x1ef992,_0x4010d6){return _0x1ef992[_0x0778('0x8')]('FaxApplication',attributes,{'tableName':_0x0778('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0778('0xa'),'collate':_0x0778('0xb')});}; \ No newline at end of file +var _0x6425=['./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ef26b,_0x3f8ef8){var _0x20bcf1=function(_0x51e806){while(--_0x51e806){_0x3ef26b['push'](_0x3ef26b['shift']());}};_0x20bcf1(++_0x3f8ef8);}(_0x6425,0xad));var _0x5642=function(_0x411875,_0x1030cd){_0x411875=_0x411875-0x0;var _0x4161c3=_0x6425[_0x411875];return _0x4161c3;};'use strict';var _=require(_0x5642('0x0'));var util=require(_0x5642('0x1'));var logger=require(_0x5642('0x2'))(_0x5642('0x3'));var moment=require(_0x5642('0x4'));var BPromise=require(_0x5642('0x5'));var rp=require(_0x5642('0x6'));var fs=require('fs');var path=require(_0x5642('0x7'));var rimraf=require(_0x5642('0x8'));var config=require('../../config/environment');var attributes=require(_0x5642('0x9'));module[_0x5642('0xa')]=function(_0x4c0871,_0x751992){return _0x4c0871[_0x5642('0xb')]('FaxApplication',attributes,{'tableName':_0x5642('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5642('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index eb53576..7b4bb5e 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 _0xe4cb=['request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateFaxApplication','update','options','raw','where','limit','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xe4cb,0x12f));var _0xbe4c=function(_0x56d653,_0x52b010){_0x56d653=_0x56d653-0x0;var _0x5bea9c=_0xe4cb[_0x56d653];return _0x5bea9c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe4c('0x0'));var BPromise=require('bluebird');var rs=require(_0xbe4c('0x1'));var fs=require('fs');var Redis=require(_0xbe4c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe4c('0x3'));var logger=require(_0xbe4c('0x4'))(_0xbe4c('0x5'));var config=require(_0xbe4c('0x6'));var jayson=require(_0xbe4c('0x7'));var client=jayson[_0xbe4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x404027,_0x10a291,_0x3eb484){return new BPromise(function(_0x2b3a27,_0x3d8c3d){return client[_0xbe4c('0x9')](_0x404027,_0x3eb484)['then'](function(_0x10576f){logger[_0xbe4c('0xa')](_0xbe4c('0xb'),_0x10a291,_0xbe4c('0xc'));logger[_0xbe4c('0xd')](_0xbe4c('0xe'),_0x10a291,_0xbe4c('0xc'),JSON[_0xbe4c('0xf')](_0x10576f));if(_0x10576f[_0xbe4c('0x10')]){if(_0x10576f[_0xbe4c('0x10')]['code']===0x1f4){logger['error'](_0xbe4c('0xb'),_0x10a291,_0x10576f[_0xbe4c('0x10')][_0xbe4c('0x11')]);return _0x3d8c3d(_0x10576f[_0xbe4c('0x10')][_0xbe4c('0x11')]);}logger[_0xbe4c('0x10')](_0xbe4c('0xb'),_0x10a291,_0x10576f[_0xbe4c('0x10')][_0xbe4c('0x11')]);return _0x2b3a27(_0x10576f[_0xbe4c('0x10')]['message']);}else{logger[_0xbe4c('0xa')](_0xbe4c('0xb'),_0x10a291,'request\x20sent');_0x2b3a27(_0x10576f[_0xbe4c('0x12')][_0xbe4c('0x11')]);}})['catch'](function(_0x23a1d7){logger[_0xbe4c('0x10')](_0xbe4c('0xb'),_0x10a291,_0x23a1d7);_0x3d8c3d(_0x23a1d7);});});}exports[_0xbe4c('0x13')]=function(_0x1c4753){var _0x18fe39=this;return new Promise(function(_0x1d4f2d,_0xf92b98){return db['FaxApplication'][_0xbe4c('0x14')](_0x1c4753['body'],{'raw':_0x1c4753['options']?_0x1c4753[_0xbe4c('0x15')][_0xbe4c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c4753[_0xbe4c('0x15')]?_0x1c4753['options'][_0xbe4c('0x17')]||null:null,'attributes':_0x1c4753['options']?_0x1c4753[_0xbe4c('0x15')]['attributes']||null:null,'limit':_0x1c4753[_0xbe4c('0x15')]?_0x1c4753['options'][_0xbe4c('0x18')]||null:null})['then'](function(_0x18e750){logger[_0xbe4c('0xa')](_0xbe4c('0x13'),_0x1c4753);logger[_0xbe4c('0xd')](_0xbe4c('0x13'),_0x1c4753,JSON['stringify'](_0x18e750));_0x1d4f2d(_0x18e750);})[_0xbe4c('0x19')](function(_0x28a7ff){logger[_0xbe4c('0x10')](_0xbe4c('0x13'),_0x28a7ff[_0xbe4c('0x11')],_0x1c4753);_0xf92b98(_0x18fe39[_0xbe4c('0x10')](0x1f4,_0x28a7ff[_0xbe4c('0x11')]));});});}; \ No newline at end of file +var _0x6110=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxApplication','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x4d5f4f,_0x5f2b46){var _0x3c1734=function(_0x3b21b1){while(--_0x3b21b1){_0x4d5f4f['push'](_0x4d5f4f['shift']());}};_0x3c1734(++_0x5f2b46);}(_0x6110,0x199));var _0x0611=function(_0x59abc4,_0x1b746a){_0x59abc4=_0x59abc4-0x0;var _0xf8056b=_0x6110[_0x59abc4];return _0xf8056b;};'use strict';var _=require(_0x0611('0x0'));var util=require(_0x0611('0x1'));var moment=require(_0x0611('0x2'));var BPromise=require(_0x0611('0x3'));var rs=require(_0x0611('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0611('0x5'))('rpc');var config=require(_0x0611('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0611('0x7')][_0x0611('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9de499,_0x4db5e1,_0x1e0d9b){return new BPromise(function(_0x31df61,_0x1baabe){return client[_0x0611('0x9')](_0x9de499,_0x1e0d9b)[_0x0611('0xa')](function(_0x182ed8){logger[_0x0611('0xb')](_0x0611('0xc'),_0x4db5e1,_0x0611('0xd'));logger[_0x0611('0xe')](_0x0611('0xf'),_0x4db5e1,_0x0611('0xd'),JSON[_0x0611('0x10')](_0x182ed8));if(_0x182ed8[_0x0611('0x11')]){if(_0x182ed8[_0x0611('0x11')][_0x0611('0x12')]===0x1f4){logger[_0x0611('0x11')](_0x0611('0xc'),_0x4db5e1,_0x182ed8[_0x0611('0x11')][_0x0611('0x13')]);return _0x1baabe(_0x182ed8['error'][_0x0611('0x13')]);}logger[_0x0611('0x11')](_0x0611('0xc'),_0x4db5e1,_0x182ed8['error'][_0x0611('0x13')]);return _0x31df61(_0x182ed8[_0x0611('0x11')]['message']);}else{logger['info'](_0x0611('0xc'),_0x4db5e1,_0x0611('0xd'));_0x31df61(_0x182ed8['result'][_0x0611('0x13')]);}})['catch'](function(_0xd98f81){logger[_0x0611('0x11')](_0x0611('0xc'),_0x4db5e1,_0xd98f81);_0x1baabe(_0xd98f81);});});}exports[_0x0611('0x14')]=function(_0x376807){var _0x27b18c=this;return new Promise(function(_0x269271,_0x2b315e){return db['FaxApplication']['update'](_0x376807[_0x0611('0x15')],{'raw':_0x376807[_0x0611('0x16')]?_0x376807[_0x0611('0x16')][_0x0611('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x376807['options']?_0x376807[_0x0611('0x16')][_0x0611('0x18')]||null:null,'attributes':_0x376807[_0x0611('0x16')]?_0x376807[_0x0611('0x16')][_0x0611('0x19')]||null:null,'limit':_0x376807[_0x0611('0x16')]?_0x376807[_0x0611('0x16')][_0x0611('0x1a')]||null:null})[_0x0611('0xa')](function(_0x305466){logger[_0x0611('0xb')](_0x0611('0x14'),_0x376807);logger[_0x0611('0xe')]('UpdateFaxApplication',_0x376807,JSON[_0x0611('0x10')](_0x305466));_0x269271(_0x305466);})[_0x0611('0x1b')](function(_0x4f46b5){logger[_0x0611('0x11')](_0x0611('0x14'),_0x4f46b5[_0x0611('0x13')],_0x376807);_0x2b315e(_0x27b18c[_0x0611('0x11')](0x1f4,_0x4f46b5[_0x0611('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0713f86..8ad5a84 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 _0xe5b5=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3410eb,_0x4613b8){var _0xe5ec6d=function(_0x49f8df){while(--_0x49f8df){_0x3410eb['push'](_0x3410eb['shift']());}};_0xe5ec6d(++_0x4613b8);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xe5b5[_0xa388a2];return _0x7ce7f6;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0x10')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0x12')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x13')]);router['delete'](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x14')]);module[_0x5e5b('0x15')]=router; \ No newline at end of file +var _0x96cc=['isAuthenticated','/:id','show','post','create','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x96cc,0x16c));var _0xc96c=function(_0x2bfe36,_0x5a2522){_0x2bfe36=_0x2bfe36-0x0;var _0x31d3e8=_0x96cc[_0x2bfe36];return _0x31d3e8;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0xd')]('/',auth[_0xc96c('0xa')](),controller[_0xc96c('0xe')]);router['put'](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xf')]);router['delete'](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x10')]);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 e34ffc4..2bd0e48 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 _0xad04=['ENUM','sequelize','exports','DATE','STRING'];(function(_0x829616,_0x5d9318){var _0x35857a=function(_0x502cb9){while(--_0x502cb9){_0x829616['push'](_0x829616['shift']());}};_0x35857a(++_0x5d9318);}(_0xad04,0x92));var _0x4ad0=function(_0x3aced2,_0x33fd66){_0x3aced2=_0x3aced2-0x0;var _0x2e9bce=_0xad04[_0x3aced2];return _0x2e9bce;};'use strict';var Sequelize=require(_0x4ad0('0x0'));module[_0x4ad0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4ad0('0x2')]},'disposition':{'type':Sequelize[_0x4ad0('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4ad0('0x3')]},'note':{'type':Sequelize[_0x4ad0('0x3')]},'read1stAt':{'type':Sequelize[_0x4ad0('0x2')]},'fax':{'type':Sequelize[_0x4ad0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4ad0('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4ad0('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xc418=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2f7f47,_0x4477e1){var _0x1bbef9=function(_0x8b16dc){while(--_0x8b16dc){_0x2f7f47['push'](_0x2f7f47['shift']());}};_0x1bbef9(++_0x4477e1);}(_0xc418,0x69));var _0x8c41=function(_0x1e7eeb,_0x263f8c){_0x1e7eeb=_0x1e7eeb-0x0;var _0x42409a=_0xc418[_0x1e7eeb];return _0x42409a;};'use strict';var Sequelize=require(_0x8c41('0x0'));module[_0x8c41('0x1')]={'closed':{'type':Sequelize[_0x8c41('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8c41('0x3')]},'disposition':{'type':Sequelize[_0x8c41('0x4')]},'secondDisposition':{'type':Sequelize[_0x8c41('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8c41('0x4')]},'note':{'type':Sequelize[_0x8c41('0x4')]},'read1stAt':{'type':Sequelize[_0x8c41('0x3')]},'fax':{'type':Sequelize[_0x8c41('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8c41('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8c41('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8c41('0x5')]('in',_0x8c41('0x6')),'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 b35c69e..5f5c654 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 _0x02b8=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','undefined','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','total','closed','UserId','unmanaged','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','left_join','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','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?','body','buildExpression','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','count','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','fields','includeAll','options','create','catch','describe','FaxMessage','addMessage','ids','omit','findOne','pick','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','emit','removeTags','download','join','root','tmp','files','transcript-%d-%s.zip','Attachment','get','basename','existsSync','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv'];(function(_0x3fe8c2,_0x26abad){var _0x3256ce=function(_0x445985){while(--_0x445985){_0x3fe8c2['push'](_0x3fe8c2['shift']());}};_0x3256ce(++_0x26abad);}(_0x02b8,0x1a5));var _0x802b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02b8[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x802b('0x0'));var rimraf=require(_0x802b('0x1'));var zipdir=require(_0x802b('0x2'));var jsonpatch=require(_0x802b('0x3'));var rp=require(_0x802b('0x4'));var moment=require(_0x802b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x802b('0x6'));var util=require('util');var path=require(_0x802b('0x7'));var sox=require('sox');var csv=require(_0x802b('0x8'));var ejs=require(_0x802b('0x9'));var fs=require('fs');var fs_extra=require(_0x802b('0xa'));var _=require(_0x802b('0xb'));var squel=require(_0x802b('0xc'));var crypto=require('crypto');var jsforce=require(_0x802b('0xd'));var deskjs=require(_0x802b('0xe'));var toCsv=require(_0x802b('0x8'));var querystring=require(_0x802b('0xf'));var Papa=require(_0x802b('0x10'));var Redis=require(_0x802b('0x11'));var authService=require(_0x802b('0x12'));var qs=require(_0x802b('0x13'));var as=require(_0x802b('0x14'));var hardwareService=require(_0x802b('0x15'));var logger=require(_0x802b('0x16'))('api');var utils=require(_0x802b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x802b('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x802b('0x19')](config[_0x802b('0x1a')],{'host':_0x802b('0x1b'),'port':0x18eb});var socket=require(_0x802b('0x1c'))(new Redis(config[_0x802b('0x1a')]));require(_0x802b('0x1d'))[_0x802b('0x1e')](socket);function respondWithStatusCode(_0x200771,_0x49a18d){_0x49a18d=_0x49a18d||0xcc;return function(_0xf939b5){if(_0xf939b5){return _0x200771['sendStatus'](_0x49a18d);}return _0x200771[_0x802b('0x1f')](_0x49a18d)[_0x802b('0x20')]();};}function respondWithResult(_0x22c11c,_0x15544c){_0x15544c=_0x15544c||0xc8;return function(_0x25ee2a){if(_0x25ee2a){return _0x22c11c[_0x802b('0x1f')](_0x15544c)[_0x802b('0x21')](_0x25ee2a);}};}function respondWithFilteredResult(_0x577a99,_0x21987c){return function(_0xea2322){if(_0xea2322){var _0x277f74=typeof _0x21987c['offset']==='undefined'&&typeof _0x21987c['limit']===_0x802b('0x22');var _0x256c2b=_0xea2322['count'];var _0xe9e61a=_0x277f74?0x0:_0x21987c['offset'];var _0x5cd6d6=_0x277f74?_0xea2322['count']:_0x21987c[_0x802b('0x23')]+_0x21987c[_0x802b('0x24')];var _0x39d82f;if(_0x5cd6d6>=_0x256c2b){_0x5cd6d6=_0x256c2b;_0x39d82f=0xc8;}else{_0x39d82f=0xce;}_0x577a99['status'](_0x39d82f);return _0x577a99['set'](_0x802b('0x25'),_0xe9e61a+'-'+_0x5cd6d6+'/'+_0x256c2b)[_0x802b('0x21')](_0xea2322);}return null;};}function patchUpdates(_0x2bb3dd){return function(_0x482408){try{jsonpatch[_0x802b('0x26')](_0x482408,_0x2bb3dd,!![]);}catch(_0x22b41f){return BPromise[_0x802b('0x27')](_0x22b41f);}return _0x482408['save']();};}function saveUpdates(_0x4c74f8,_0x2aceaf){return function(_0x59769d){if(_0x59769d){return _0x59769d[_0x802b('0x28')](_0x4c74f8)[_0x802b('0x29')](function(_0x1300e8){return _0x1300e8;});}return null;};}function removeEntity(_0x5c72ee,_0x55e40e){return function(_0x515cd5){if(_0x515cd5){return _0x515cd5[_0x802b('0x2a')]()['then'](function(){_0x5c72ee[_0x802b('0x1f')](0xcc)[_0x802b('0x20')]();});}};}function handleEntityNotFound(_0x3bd0f0,_0x46c608){return function(_0x4ff396){if(!_0x4ff396){_0x3bd0f0[_0x802b('0x2b')](0x194);}return _0x4ff396;};}function handleError(_0x33fd74,_0x2678f9){_0x2678f9=_0x2678f9||0x1f4;return function(_0x66a6c){logger[_0x802b('0x2c')](_0x66a6c['stack']);if(_0x66a6c[_0x802b('0x2d')]){delete _0x66a6c[_0x802b('0x2d')];}_0x33fd74[_0x802b('0x1f')](_0x2678f9)[_0x802b('0x2e')](_0x66a6c);};}function getInteractionUsers(_0x24bdba,_0x34d05b){return new BPromise(function(_0x14548b,_0x4f040c){try{if(_0x34d05b[_0x24bdba['id']]){_0x24bdba['Users']=_[_0x802b('0x2f')](_0x34d05b[_0x24bdba['id']],function(_0x2cdce7){return{'id':_0x2cdce7['id'],'fullname':_0x2cdce7[_0x802b('0x30')]};});}}catch(_0x2d8db4){_0x4f040c(_0x2d8db4);}_0x14548b(_0x24bdba);});}function getInteractionTags(_0x15eeac,_0xae8457){return new BPromise(function(_0x42d7c9,_0x10f43f){try{if(_0x15eeac[_0x802b('0x31')]){_0x15eeac[_0x802b('0x32')]=[];_0x15eeac[_0x802b('0x31')][_0x802b('0x33')](',')[_0x802b('0x34')](function(_0x4e5287){_0x15eeac[_0x802b('0x32')][_0x802b('0x35')](_0xae8457[_0x4e5287]);});}delete _0x15eeac[_0x802b('0x31')];}catch(_0x1ffcdd){_0x10f43f(_0x1ffcdd);}_0x42d7c9(_0x15eeac);});}function updateFaxInteraction(_0x3d5ef5,_0x116030,_0x7cc837){return new BPromise(function(_0xf2f2f2,_0x2fda9a){return getInteractionUsers(_0x3d5ef5,_0x7cc837)[_0x802b('0x29')](function(_0x46de7d){return getInteractionTags(_0x46de7d,_0x116030);})[_0x802b('0x29')](function(_0x18861b){return getStateInteraction(_0x18861b);})[_0x802b('0x29')](function(_0x3469d3){_0xf2f2f2(_0x3469d3);})['catch'](function(_0x26d109){_0x2fda9a(_0x26d109);});});}function getStateInteraction(_0x16863d){return new BPromise(function(_0x3d8c20){_0x16863d[_0x802b('0x36')]=0x0;_0x16863d[_0x802b('0x37')]=0x0;_0x16863d[_0x802b('0x38')]=0x0;_0x16863d['unmanaged']=0x0;_0x16863d[_0x802b('0x39')]=0x0;if(!_0x16863d[_0x802b('0x3a')]&&!_0x16863d[_0x802b('0x3b')]){_0x16863d['waiting']+=0x1;}if(!_0x16863d[_0x802b('0x3a')]&&_0x16863d[_0x802b('0x3b')]){_0x16863d['talking']+=0x1;if(_0x16863d[_0x802b('0x36')]){_0x16863d[_0x802b('0x36')]-=0x1;}}if(_0x16863d[_0x802b('0x3a')]&&_0x16863d['UserId']){_0x16863d[_0x802b('0x38')]+=0x1;if(_0x16863d[_0x802b('0x37')]){_0x16863d[_0x802b('0x37')]-=0x1;}}if(_0x16863d[_0x802b('0x3a')]&&!_0x16863d[_0x802b('0x3b')]){_0x16863d[_0x802b('0x3c')]+=0x1;if(_0x16863d[_0x802b('0x36')]){_0x16863d[_0x802b('0x36')]-=0x1;}}_0x16863d[_0x802b('0x39')]+=0x1;_0x3d8c20(_0x16863d);});}exports['index']=function(_0x25114c,_0x4c43a8){var _0x53f5fb={},_0x217911={},_0x164eda={'count':0x0,'rows':[]};var _0x29c174=_['map'](db[_0x802b('0x3d')][_0x802b('0x3e')],function(_0x151cd3){return{'name':_0x151cd3[_0x802b('0x3f')],'type':_0x151cd3[_0x802b('0x40')][_0x802b('0x41')]};});_0x217911['model']=_['map'](_0x29c174,'name');_0x217911[_0x802b('0x42')]=_[_0x802b('0x43')](_0x25114c[_0x802b('0x42')]);_0x217911[_0x802b('0x44')]=_[_0x802b('0x45')](_0x217911['model'],_0x217911['query']);_0x53f5fb[_0x802b('0x46')]=_[_0x802b('0x45')](_0x217911[_0x802b('0x47')],qs['fields'](_0x25114c[_0x802b('0x42')]['fields']));_0x53f5fb[_0x802b('0x46')]=_0x53f5fb[_0x802b('0x46')][_0x802b('0x48')]?_0x53f5fb[_0x802b('0x46')]:_0x217911['model'];if(!_0x25114c['query'][_0x802b('0x49')](_0x802b('0x4a'))){_0x53f5fb[_0x802b('0x24')]=qs[_0x802b('0x24')](_0x25114c[_0x802b('0x42')][_0x802b('0x24')]);_0x53f5fb[_0x802b('0x23')]=qs[_0x802b('0x23')](_0x25114c['query'][_0x802b('0x23')]);}_0x53f5fb[_0x802b('0x4b')]=qs['sort'](_0x25114c[_0x802b('0x42')][_0x802b('0x4c')]);_0x53f5fb[_0x802b('0x4d')]=qs[_0x802b('0x44')](_['pick'](_0x25114c['query'],_0x217911[_0x802b('0x44')]),_0x29c174);var _0x34ca09=[];var _0x20d5cc=squel[_0x802b('0x4e')]()[_0x802b('0x4f')]('id')['field'](_0x802b('0x2d'))[_0x802b('0x4f')](_0x802b('0x50'))[_0x802b('0x51')](_0x802b('0x52'));var _0x2ccfc0=squel[_0x802b('0x4e')]()[_0x802b('0x4f')]('u.id')['field']('u.fullname')[_0x802b('0x4f')](_0x802b('0x53'))['from'](_0x802b('0x54'),'ui')['left_join'](_0x802b('0x55'),'u',_0x802b('0x56'));var _0x4fc335=squel['select']()[_0x802b('0x51')]('fax_interactions','i')[_0x802b('0x57')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x802b('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x802b('0x57')](_0x802b('0x58'),'a',_0x802b('0x59'))[_0x802b('0x57')](_0x802b('0x5a'),'me',_0x802b('0x5b'))[_0x802b('0x57')]('fax_interaction_has_tags','it',_0x802b('0x5c'))[_0x802b('0x57')](_0x802b('0x52'),'t',_0x802b('0x5d'));var _0xc0a71f=squel[_0x802b('0x5e')]();var _0x99b6d5=[];var _0x39d6c4=squel[_0x802b('0x5e')]();var _0x10fd3c;if(_0x25114c['query'][_0x802b('0x5f')]){_0x10fd3c=as[_0x802b('0x60')](_0x25114c[_0x802b('0x42')][_0x802b('0x5f')]);var _0x2ba05a=_0x10fd3c['sqlOperator'];for(var _0x284d05=0x0;_0x284d05<_0x10fd3c[_0x802b('0x61')][_0x802b('0x48')];_0x284d05++){var _0x3afcc0=_0x10fd3c['conditions'][_0x284d05];var _0x59b708='i';var _0x208f73=_[_0x802b('0x62')](_0x29c174,['name',_0x3afcc0[_0x802b('0x4f')]]);if(!_0x208f73){switch(_0x3afcc0['field']){case _0x802b('0x63'):if(_0x3afcc0['value']==0x1){_0x4fc335[_0x802b('0x64')]('`'+_0x3afcc0[_0x802b('0x4f')]+_0x802b('0x65'));}else{_0x4fc335[_0x802b('0x64')]('`'+_0x3afcc0[_0x802b('0x4f')]+_0x802b('0x66'));}break;case _0x802b('0x67'):if(_0x3afcc0['operator']===_0x802b('0x68')){if(_0x3afcc0['value']['split']('\x20')['length']>0x1){_0xc0a71f[_0x2ba05a](_0x802b('0x69'),qs[_0x802b('0x6a')](_0x3afcc0[_0x802b('0x6b')]),null);}else{var _0x483ca0='%'+_0x3afcc0[_0x802b('0x6b')]+'%';_0xc0a71f[_0x2ba05a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x483ca0,_0x483ca0,_0x483ca0);}}else{_0x208f73=_[_0x802b('0x62')](_0x29c174,['name',_0x802b('0x6c')]);_0x3afcc0[_0x802b('0x4f')]=_0x802b('0x6c');_0x37f878=as['buildExpression'](_0x59b708,_0x208f73[_0x802b('0x40')],_0x3afcc0);_0xc0a71f[_0x2ba05a](_0x37f878[_0x802b('0x6d')],_0x37f878[_0x802b('0x6b')][_0x802b('0x6e')],_0x37f878[_0x802b('0x6b')][_0x802b('0x20')]);}break;case'Tag':var _0x2fc4a3=_0x3afcc0[_0x802b('0x6b')][_0x802b('0x33')](',')[_0x802b('0x2f')](function(_0x3d8475){return Number(_0x3d8475);});_0x2fc4a3[_0x802b('0x34')](function(_0x4bccf2){_0x39d6c4['or'](_0x802b('0x6f'),'%,'+_0x4bccf2+',%');});_0x99b6d5=_[_0x802b('0x70')](_0x99b6d5,_0x2fc4a3);break;case _0x802b('0x71'):if(_0x3afcc0['operator']==='$substring'){_0xc0a71f[_0x2ba05a](_0x802b('0x72'),'%'+_0x3afcc0[_0x802b('0x6b')]+'%',null);}else{_0x208f73=_[_0x802b('0x62')](_0x29c174,[_0x802b('0x2d'),_0x802b('0x3b')]);_0x3afcc0['field']='UserId';_0x37f878=as['buildExpression'](_0x59b708,_0x208f73['type'],_0x3afcc0);_0xc0a71f[_0x2ba05a](_0x37f878[_0x802b('0x6d')],_0x37f878[_0x802b('0x6b')][_0x802b('0x6e')],_0x37f878['value'][_0x802b('0x20')]);}break;case _0x802b('0x73'):_0x37f878=as[_0x802b('0x74')]('me',null,_0x3afcc0);_0xc0a71f[_0x2ba05a](_0x37f878[_0x802b('0x6d')],_0x37f878['value']['start'],_0x37f878[_0x802b('0x6b')][_0x802b('0x20')]);break;}}else{var _0x37f878=as['buildExpression'](_0x59b708,_0x208f73[_0x802b('0x40')],_0x3afcc0);_0xc0a71f[_0x2ba05a](_0x37f878['text'],_0x37f878[_0x802b('0x6b')]['start'],_0x37f878[_0x802b('0x6b')]['end']);}}}else{var _0x4447cd=_(_0x25114c['query'])[_0x802b('0x43')]()[_0x802b('0x2f')](function(_0x12b399){return _[_0x802b('0x75')](_0x29c174,[_0x802b('0x2d'),_0x12b399])?_0x12b399:undefined;})[_0x802b('0x76')]()[_0x802b('0x6b')]();if(!_[_0x802b('0x77')](_0x4447cd)){_0x4447cd[_0x802b('0x34')](function(_0x1ac681){if(_0x1ac681===_0x802b('0x78')){_0x4fc335[_0x802b('0x4d')](_0x802b('0x79'),[]['concat'](_0x25114c[_0x802b('0x42')][_0x1ac681]));}else if(_0x1ac681===_0x802b('0x7a')){var _0x34fb02=JSON['parse'](_0x25114c[_0x802b('0x42')][_0x1ac681])['$gte'];var _0xf155d2=JSON[_0x802b('0x7b')](_0x25114c[_0x802b('0x42')][_0x1ac681])[_0x802b('0x7c')];_0x4fc335[_0x802b('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x34fb02,_0xf155d2);}else{if(_0x25114c[_0x802b('0x42')][_0x1ac681]===_0x802b('0x7d')){_0x4fc335[_0x802b('0x4d')]('i.'+_0x1ac681+_0x802b('0x7e'));}else{_0x4fc335[_0x802b('0x4d')]('i.'+_0x1ac681+_0x802b('0x7f'),_0x25114c['query'][_0x1ac681]);}}});}if(_0x25114c['query'][_0x802b('0x80')]){if(_0x25114c[_0x802b('0x42')][_0x802b('0x80')]==0x1){_0x4fc335[_0x802b('0x64')](_0x802b('0x81'));}else{_0x4fc335['having'](_0x802b('0x82'));}}if(_0x25114c['query'][_0x802b('0x83')]){_0x99b6d5=_[_0x802b('0x84')](_0x25114c[_0x802b('0x42')][_0x802b('0x83')])?_0x25114c[_0x802b('0x42')][_0x802b('0x83')]:new Array(_0x25114c['query'][_0x802b('0x83')]);_0x99b6d5['forEach'](function(_0x1a6ef7){_0x39d6c4['or'](_0x802b('0x6f'),'%,'+_0x1a6ef7+',%');});}if(_0x25114c[_0x802b('0x42')][_0x802b('0x85')]){var _0xf2a42=_0x25114c[_0x802b('0x42')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x802b('0x86')](_0xf2a42)){_0xc0a71f['or'](_0x802b('0x87'),_0xf2a42+'%')['or'](_0x802b('0x88'),_0xf2a42+'%');}_0xc0a71f['or'](_0x802b('0x89'),_0xf2a42+'%');}}_0x4fc335[_0x802b('0x4d')](_0xc0a71f);_0x4fc335[_0x802b('0x8a')]('i.id');var _0x415c79={'type':db['Sequelize'][_0x802b('0x8b')]['SELECT'],'raw':!![]};var _0x1468a0=_0x4fc335[_0x802b('0x8c')]();_0x1468a0[_0x802b('0x4f')](_0x802b('0x8d'));_0x1468a0['field'](_0x802b('0x8e'),'unreadMessages');if(_0x53f5fb[_0x802b('0x4b')]){_0x53f5fb[_0x802b('0x4b')][_0x802b('0x34')](function(_0x2a1ed9){var _0x35a3a9=_0x2a1ed9[0x0]===_0x802b('0x8f')?_0x2a1ed9[0x0]:'i.'+_0x2a1ed9[0x0];_0x4fc335['order'](_0x35a3a9,_0x2a1ed9[0x1]===_0x802b('0x90')?![]:!![]);});}if(!_[_0x802b('0x77')](_0x99b6d5)){_0x4fc335[_0x802b('0x64')](_0x39d6c4);_0x1468a0[_0x802b('0x4d')](_0x802b('0x91'),_0x99b6d5);}BPromise[_0x802b('0x92')]()[_0x802b('0x29')](function(){if(!_0x10fd3c){if(_0x25114c[_0x802b('0x42')][_0x802b('0x78')])return;_0x1468a0['where'](_0x802b('0x93'));_0x4fc335[_0x802b('0x4d')](_0x802b('0x93'));return;}if(_0x25114c[_0x802b('0x94')][_0x802b('0x95')]!=='agent')return;return _0x25114c[_0x802b('0x94')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x802b('0x29')](function(_0x54d7d2){if(_[_0x802b('0x77')](_0x54d7d2)){_0x1468a0['where'](_0x802b('0x96'));_0x4fc335['where'](_0x802b('0x96'));}else{_0x1468a0[_0x802b('0x4d')]('i.FaxAccountId\x20IN\x20?',_[_0x802b('0x2f')](_0x54d7d2,'id'));_0x4fc335[_0x802b('0x4d')](_0x802b('0x79'),_[_0x802b('0x2f')](_0x54d7d2,'id'));}});})[_0x802b('0x29')](function(){if(_0x25114c[_0x802b('0x94')]['role']===_0x802b('0x97')&&!_0x10fd3c&&!_0x25114c[_0x802b('0x42')][_0x802b('0x78')])return[];return db[_0x802b('0x98')]['query'](_0x1468a0[_0x802b('0x99')](),_0x415c79);})['then'](function(_0x3c49a4){_0x164eda[_0x802b('0x9a')]=_0x3c49a4['length'];if(_0x164eda['count']===0x0)return[];return db[_0x802b('0x98')][_0x802b('0x42')](_0x20d5cc['toString'](),_0x415c79)[_0x802b('0x29')](function(_0x15468b){_0x34ca09=_[_0x802b('0x9b')](_0x15468b,'id');_0x415c79=_[_0x802b('0x9c')](_0x415c79,{'model':db[_0x802b('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25114c[_0x802b('0x42')]['fields']){_0x53f5fb[_0x802b('0x46')][_0x802b('0x34')](function(_0x52acf3){_0x4fc335[_0x802b('0x4f')]('i.'+_0x52acf3);});}else{_0x4fc335[_0x802b('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x802b('0x63'));_0x4fc335[_0x802b('0x4f')](_0x802b('0x9d'),_0x802b('0x9e'));_0x4fc335[_0x802b('0x4f')](_0x802b('0x9f'),_0x802b('0xa0'));_0x4fc335[_0x802b('0x4f')](_0x802b('0xa1'),'contactName');_0x4fc335['field']('i.*');_0x4fc335[_0x802b('0x4f')](_0x802b('0xa2'),_0x802b('0xa3'));_0x4fc335['field'](_0x802b('0xa4'),_0x802b('0xa5'));_0x4fc335[_0x802b('0x4f')](_0x802b('0xa6'),_0x802b('0xa7'));_0x4fc335[_0x802b('0x4f')](_0x802b('0xa8'),'Contact.phone');_0x4fc335[_0x802b('0x4f')](_0x802b('0xa9'),_0x802b('0xaa'));_0x4fc335[_0x802b('0x4f')](_0x802b('0xab'),_0x802b('0xac'));_0x4fc335[_0x802b('0x4f')]('o.fullname','Owner.fullname');_0x4fc335['field'](_0x802b('0xad'),_0x802b('0xae'));_0x4fc335[_0x802b('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x802b('0x31'));}if(_0x53f5fb['limit'])_0x4fc335['limit'](_0x53f5fb[_0x802b('0x24')]);if(_0x53f5fb[_0x802b('0x23')])_0x4fc335['offset'](_0x53f5fb[_0x802b('0x23')]);return db[_0x802b('0x98')][_0x802b('0x42')](_0x4fc335[_0x802b('0x99')](),_0x415c79);})['then'](function(_0x37400f){if(_0x37400f[_0x802b('0x48')]>0x0)_0x2ccfc0['where'](_0x802b('0xaf'),_[_0x802b('0x2f')](_0x37400f,'id'));return db[_0x802b('0x98')]['query'](_0x2ccfc0['toString'](),_0x415c79)[_0x802b('0x29')](function(_0x585875){var _0x4c8076=_['groupBy'](_0x585875,'FaxInteractionId');var _0x36536f=[];_0x37400f[_0x802b('0x34')](function(_0x18cbc1){_0x36536f[_0x802b('0x35')](updateFaxInteraction(_0x18cbc1,_0x34ca09,_0x4c8076));});return BPromise[_0x802b('0xb0')](_0x36536f);});});})[_0x802b('0x29')](function(_0x46b91b){_0x164eda[_0x802b('0xb1')]=_0x46b91b;return _0x164eda;})['then'](respondWithFilteredResult(_0x4c43a8,_0x53f5fb))['catch'](handleError(_0x4c43a8,null));};exports[_0x802b('0xb2')]=function(_0x54e2c6,_0x5bd9af){var _0x55797d={'raw':![],'where':{'id':_0x54e2c6[_0x802b('0xb3')]['id']}},_0x442b92={};_0x442b92[_0x802b('0x47')]=_[_0x802b('0x43')](db[_0x802b('0x3d')][_0x802b('0x3e')]);_0x442b92[_0x802b('0x42')]=_[_0x802b('0x43')](_0x54e2c6['query']);_0x442b92['filters']=_[_0x802b('0x45')](_0x442b92[_0x802b('0x47')],_0x442b92[_0x802b('0x42')]);_0x55797d[_0x802b('0x46')]=_[_0x802b('0x45')](_0x442b92[_0x802b('0x47')],qs[_0x802b('0xb4')](_0x54e2c6[_0x802b('0x42')][_0x802b('0xb4')]));_0x55797d[_0x802b('0x46')]=_0x55797d['attributes']['length']?_0x55797d[_0x802b('0x46')]:_0x442b92['model'];if(_0x54e2c6[_0x802b('0x42')][_0x802b('0xb5')]){_0x55797d['include']=[{'all':!![]}];}_0x55797d=_['merge']({},_0x55797d,_0x54e2c6[_0x802b('0xb6')]);return db[_0x802b('0x3d')][_0x802b('0x62')](_0x55797d)['then'](handleEntityNotFound(_0x5bd9af,null))['then'](respondWithResult(_0x5bd9af,null))['catch'](handleError(_0x5bd9af,null));};exports[_0x802b('0xb7')]=function(_0x4ca918,_0x3b3b5c){return db['FaxInteraction'][_0x802b('0xb7')](_0x4ca918['body'],{})[_0x802b('0x29')](respondWithResult(_0x3b3b5c,0xc9))[_0x802b('0xb8')](handleError(_0x3b3b5c,null));};exports['update']=function(_0x40da6c,_0x57af95){if(_0x40da6c[_0x802b('0x73')]['id']){delete _0x40da6c['body']['id'];}return db[_0x802b('0x3d')][_0x802b('0x62')]({'where':{'id':_0x40da6c[_0x802b('0xb3')]['id']}})[_0x802b('0x29')](handleEntityNotFound(_0x57af95,null))[_0x802b('0x29')](saveUpdates(_0x40da6c['body'],null))[_0x802b('0x29')](respondWithResult(_0x57af95,null))[_0x802b('0xb8')](handleError(_0x57af95,null));};exports[_0x802b('0x2a')]=function(_0x5adc25,_0x330439){return db['FaxInteraction']['find']({'where':{'id':_0x5adc25[_0x802b('0xb3')]['id']}})[_0x802b('0x29')](handleEntityNotFound(_0x330439,null))['then'](removeEntity(_0x330439,null))[_0x802b('0xb8')](handleError(_0x330439,null));};exports[_0x802b('0xb9')]=function(_0x9a637e,_0x366bdc){return db[_0x802b('0x3d')]['describe']()[_0x802b('0x29')](respondWithResult(_0x366bdc,null))[_0x802b('0xb8')](handleError(_0x366bdc,null));};exports['addMessage']=function(_0x38366f,_0x1ac136,_0x49d326){return db[_0x802b('0xba')][_0x802b('0x62')]({'where':{'id':_0x38366f[_0x802b('0xb3')]['id']}})[_0x802b('0x29')](handleEntityNotFound(_0x1ac136,null))[_0x802b('0x29')](function(_0x555917){if(_0x555917){return _0x555917[_0x802b('0xbb')](_0x38366f[_0x802b('0x73')][_0x802b('0xbc')],_[_0x802b('0xbd')](_0x38366f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1ac136,null))[_0x802b('0xb8')](handleError(_0x1ac136,null));};exports['getMessages']=function(_0x314f48,_0x12a736,_0x5c82da){var _0x25d82a={'raw':![],'where':{}};var _0x352215={};var _0x15b25f={'count':0x0,'rows':[]};return db[_0x802b('0x3d')][_0x802b('0xbe')]({'where':{'id':_0x314f48[_0x802b('0xb3')]['id']}})[_0x802b('0x29')](handleEntityNotFound(_0x12a736,null))[_0x802b('0x29')](function(_0xc8d344){if(_0xc8d344){_0x352215[_0x802b('0x47')]=_[_0x802b('0x43')](db[_0x802b('0xba')][_0x802b('0x3e')]);_0x352215['query']=_['keys'](_0x314f48[_0x802b('0x42')]);_0x352215[_0x802b('0x44')]=_['intersection'](_0x352215[_0x802b('0x47')],_0x352215[_0x802b('0x42')]);_0x25d82a[_0x802b('0x46')]=_[_0x802b('0x45')](_0x352215['model'],qs[_0x802b('0xb4')](_0x314f48[_0x802b('0x42')][_0x802b('0xb4')]));_0x25d82a[_0x802b('0x46')]=_0x25d82a['attributes'][_0x802b('0x48')]?_0x25d82a[_0x802b('0x46')]:_0x352215[_0x802b('0x47')];if(!_0x314f48[_0x802b('0x42')][_0x802b('0x49')]('nolimit')){_0x25d82a[_0x802b('0x24')]=qs[_0x802b('0x24')](_0x314f48[_0x802b('0x42')][_0x802b('0x24')]);_0x25d82a[_0x802b('0x23')]=qs[_0x802b('0x23')](_0x314f48['query'][_0x802b('0x23')]);}_0x25d82a[_0x802b('0x4b')]=qs[_0x802b('0x4c')](_0x314f48[_0x802b('0x42')][_0x802b('0x4c')]);_0x25d82a[_0x802b('0x4d')]=qs[_0x802b('0x44')](_[_0x802b('0xbf')](_0x314f48['query'],_0x352215['filters']));_0x25d82a['where'][_0x802b('0xc0')]=_0xc8d344['id'];if(_0x314f48[_0x802b('0x42')][_0x802b('0x85')]){_0x25d82a['where']=_[_0x802b('0x9c')](_0x25d82a[_0x802b('0x4d')],{'$or':_['map'](_0x25d82a[_0x802b('0x46')],function(_0x192c60){var _0x1ca9ee={};_0x1ca9ee[_0x192c60]={'$like':'%'+_0x314f48[_0x802b('0x42')]['filter']+'%'};return _0x1ca9ee;})});}if(_0x314f48[_0x802b('0x42')][_0x802b('0xc1')]){var _0x57c072=_0x314f48[_0x802b('0x42')][_0x802b('0xc1')][_0x802b('0x33')](',');var _0x231d62={};_0x231d62[_0x57c072[0x0]]={'$gte':moment(_0x57c072[0x1])[_0x802b('0xc2')](_0x802b('0xc3'))};_0x25d82a[_0x802b('0x4d')]=_[_0x802b('0x9c')](_0x25d82a[_0x802b('0x4d')],_0x231d62);}_0x25d82a=_[_0x802b('0x9c')]({},_0x25d82a,_0x314f48[_0x802b('0xb6')]);return db['FaxMessage']['count']({'where':_0x25d82a[_0x802b('0x4d')]})[_0x802b('0x29')](function(_0x46fe22){_0x15b25f['count']=_0x46fe22;if(_0x314f48[_0x802b('0x42')][_0x802b('0xb5')]){_0x25d82a[_0x802b('0xc4')]=[{'all':!![]}];}return db[_0x802b('0xba')][_0x802b('0xc5')](_0x25d82a);})[_0x802b('0x29')](function(_0x37f512){_0x15b25f[_0x802b('0xb1')]=_0x37f512;return _0x15b25f;});}})[_0x802b('0x29')](respondWithFilteredResult(_0x12a736,_0x25d82a))[_0x802b('0xb8')](handleError(_0x12a736,null));};exports[_0x802b('0xc6')]=function(_0x137b0a,_0x226348,_0x3feb08){return db[_0x802b('0x3d')]['find']({'where':{'id':_0x137b0a[_0x802b('0xb3')]['id']}})['then'](handleEntityNotFound(_0x226348,null))[_0x802b('0x29')](function(_0x469974){if(_0x469974){return _0x469974[_0x802b('0xc7')](_0x137b0a[_0x802b('0x73')]['ids'],_[_0x802b('0xbd')](_0x137b0a[_0x802b('0x73')],[_0x802b('0xbc'),'id'])||{})['spread'](function(){return db['Tag'][_0x802b('0xc5')]({'attributes':['id',_0x802b('0x2d'),_0x802b('0x50')],'where':{'id':_0x137b0a['body'][_0x802b('0xbc')]}});})[_0x802b('0x29')](function(_0x518592){socket[_0x802b('0xc8')]('faxInteractionTags:save',{'id':Number(_0x137b0a[_0x802b('0xb3')]['id']),'tags':_0x518592||[]});return{'id':Number(_0x137b0a[_0x802b('0xb3')]['id']),'tags':_0x518592||[]};});}})[_0x802b('0x29')](respondWithResult(_0x226348,null))[_0x802b('0xb8')](handleError(_0x226348,null));};exports[_0x802b('0xc9')]=function(_0x5465ee,_0x5777ae,_0x864ca3){return db['FaxInteraction'][_0x802b('0x62')]({'where':{'id':_0x5465ee[_0x802b('0xb3')]['id']}})[_0x802b('0x29')](handleEntityNotFound(_0x5777ae,null))[_0x802b('0x29')](function(_0x15cb85){if(_0x15cb85){return _0x15cb85[_0x802b('0xc9')](_0x5465ee[_0x802b('0x42')][_0x802b('0xbc')]);}})['then'](respondWithStatusCode(_0x5777ae,null))[_0x802b('0xb8')](handleError(_0x5777ae,null));};exports[_0x802b('0xca')]=function(_0x3bbcda,_0x51f8cf){var _0xb29554=moment()['unix']()[_0x802b('0x99')]();var _0x4e4ddd=path[_0x802b('0xcb')](config[_0x802b('0xcc')],'server','files',_0x802b('0xcd'));var _0x1f04d2=path[_0x802b('0xcb')](config[_0x802b('0xcc')],'server',_0x802b('0xce'),'attachments');var _0x5e3c54=path[_0x802b('0xcb')](_0x4e4ddd,_0xb29554);var _0x3452a9=util[_0x802b('0xc2')](_0x802b('0xcf'),_0x3bbcda[_0x802b('0xb3')]['id'],_0xb29554);var _0x19686b=path['join'](_0x4e4ddd,_0x3452a9);var _0x512a92=[];_0x512a92['push']({'model':db['Attachment'],'as':_0x802b('0xd0'),'raw':!![]});var _0x1ad23a=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x802b('0x7a')],'include':_0x512a92}];return db[_0x802b('0x3d')][_0x802b('0x62')]({'where':{'id':_0x3bbcda[_0x802b('0xb3')]['id']},'include':_0x1ad23a})[_0x802b('0x29')](handleEntityNotFound(_0x51f8cf,null))[_0x802b('0x29')](function(_0x39f596){if(_0x39f596&&_0x39f596['Messages']){var _0x39d3bc=_0x39f596[_0x802b('0xd1')]({'plain':!![]});fs['mkdirSync'](_0x5e3c54);for(var _0x3dd628=0x0;_0x3dd628<_0x39d3bc['Messages'][_0x802b('0x48')];_0x3dd628++){var _0x2f91ce=_0x39d3bc['Messages'][_0x3dd628][_0x802b('0xd0')];if(_0x2f91ce){var _0x33a527=path[_0x802b('0xcb')](_0x1f04d2,_0x2f91ce[_0x802b('0xd2')]);if(fs[_0x802b('0xd3')](_0x33a527)){fs['createReadStream'](_0x33a527)['pipe'](fs[_0x802b('0xd4')](path['join'](_0x5e3c54,_0x2f91ce[_0x802b('0xd2')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x1def7e,_0x130465){zipdir(_0x5e3c54,{'saveTo':_0x19686b},function(_0x395d2b,_0x2b32b4){if(_0x395d2b)return _0x130465(_0x395d2b);return _0x1def7e(_0x2b32b4);});})['then'](function(){return new BPromise(function(_0x148449,_0x331c48){rimraf(_0x5e3c54,function(_0x4cf5bb){if(_0x4cf5bb)_0x331c48(_0x4cf5bb);return _0x148449();});});})[_0x802b('0x29')](function(){return _0x51f8cf[_0x802b('0xca')](_0x19686b,_0x3452a9,function(_0x4a1923){if(_0x4a1923){console[_0x802b('0xd5')]('err',_0x4a1923);}else{fs[_0x802b('0xd6')](_0x19686b);}});});});}else{return _0x51f8cf['sendStatus'](0xc8);}})['catch'](handleError(_0x51f8cf,null));}; \ No newline at end of file +var _0xa930=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','fax_interactions','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','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','buildExpression','text','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','toString','merge','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','sendStatus','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','push','catch','unmanaged','total','closed','UserId','waiting','answered','talking','index','FaxInteraction','fieldName','key','model','query','keys','filters'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0xa930,0x182));var _0x0a93=function(_0x2e7c8b,_0x54d1ae){_0x2e7c8b=_0x2e7c8b-0x0;var _0x1e1710=_0xa930[_0x2e7c8b];return _0x1e1710;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a93('0x0'));var jsonpatch=require(_0x0a93('0x1'));var rp=require('request-promise');var moment=require(_0x0a93('0x2'));var BPromise=require(_0x0a93('0x3'));var Mustache=require(_0x0a93('0x4'));var util=require(_0x0a93('0x5'));var path=require(_0x0a93('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0a93('0x7'));var fs=require('fs');var fs_extra=require(_0x0a93('0x8'));var _=require(_0x0a93('0x9'));var squel=require('squel');var crypto=require(_0x0a93('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0a93('0xb'));var toCsv=require(_0x0a93('0xc'));var querystring=require(_0x0a93('0xd'));var Papa=require('papaparse');var Redis=require(_0x0a93('0xe'));var authService=require(_0x0a93('0xf'));var qs=require(_0x0a93('0x10'));var as=require(_0x0a93('0x11'));var hardwareService=require(_0x0a93('0x12'));var logger=require(_0x0a93('0x13'))('api');var utils=require(_0x0a93('0x14'));var config=require(_0x0a93('0x15'));var licenseUtil=require(_0x0a93('0x16'));var db=require(_0x0a93('0x17'))['db'];config[_0x0a93('0x18')]=_[_0x0a93('0x19')](config[_0x0a93('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a93('0x1a'))(new Redis(config[_0x0a93('0x18')]));require(_0x0a93('0x1b'))[_0x0a93('0x1c')](socket);function respondWithStatusCode(_0x4151d6,_0x28c1f9){_0x28c1f9=_0x28c1f9||0xcc;return function(_0x5744ab){if(_0x5744ab){return _0x4151d6['sendStatus'](_0x28c1f9);}return _0x4151d6[_0x0a93('0x1d')](_0x28c1f9)[_0x0a93('0x1e')]();};}function respondWithResult(_0x26a75c,_0x1da516){_0x1da516=_0x1da516||0xc8;return function(_0x1cb710){if(_0x1cb710){return _0x26a75c[_0x0a93('0x1d')](_0x1da516)[_0x0a93('0x1f')](_0x1cb710);}};}function respondWithFilteredResult(_0x4146fa,_0x24ea97){return function(_0x247855){if(_0x247855){var _0x2c5280=typeof _0x24ea97['offset']==='undefined'&&typeof _0x24ea97[_0x0a93('0x20')]===_0x0a93('0x21');var _0x12f75b=_0x247855[_0x0a93('0x22')];var _0x3e6270=_0x2c5280?0x0:_0x24ea97['offset'];var _0x5bc02f=_0x2c5280?_0x247855[_0x0a93('0x22')]:_0x24ea97[_0x0a93('0x23')]+_0x24ea97[_0x0a93('0x20')];var _0xd4e635;if(_0x5bc02f>=_0x12f75b){_0x5bc02f=_0x12f75b;_0xd4e635=0xc8;}else{_0xd4e635=0xce;}_0x4146fa[_0x0a93('0x1d')](_0xd4e635);return _0x4146fa[_0x0a93('0x24')](_0x0a93('0x25'),_0x3e6270+'-'+_0x5bc02f+'/'+_0x12f75b)[_0x0a93('0x1f')](_0x247855);}return null;};}function patchUpdates(_0x368e80){return function(_0x2c69b4){try{jsonpatch[_0x0a93('0x26')](_0x2c69b4,_0x368e80,!![]);}catch(_0x2112b8){return BPromise[_0x0a93('0x27')](_0x2112b8);}return _0x2c69b4[_0x0a93('0x28')]();};}function saveUpdates(_0x4c39a1,_0x179cc9){return function(_0x5070b8){if(_0x5070b8){return _0x5070b8[_0x0a93('0x29')](_0x4c39a1)[_0x0a93('0x2a')](function(_0x159a88){return _0x159a88;});}return null;};}function removeEntity(_0x3e70e4,_0x36e143){return function(_0x52b991){if(_0x52b991){return _0x52b991[_0x0a93('0x2b')]()[_0x0a93('0x2a')](function(){_0x3e70e4[_0x0a93('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff3f8,_0x9a722a){return function(_0x2967f1){if(!_0x2967f1){_0x3ff3f8['sendStatus'](0x194);}return _0x2967f1;};}function handleError(_0x4753ff,_0x4fe9f8){_0x4fe9f8=_0x4fe9f8||0x1f4;return function(_0x160a76){logger['error'](_0x160a76[_0x0a93('0x2c')]);if(_0x160a76[_0x0a93('0x2d')]){delete _0x160a76[_0x0a93('0x2d')];}_0x4753ff[_0x0a93('0x1d')](_0x4fe9f8)[_0x0a93('0x2e')](_0x160a76);};}function getInteractionUsers(_0x22325f,_0x4b5661){return new BPromise(function(_0x413bb0,_0x45547a){try{if(_0x4b5661[_0x22325f['id']]){_0x22325f[_0x0a93('0x2f')]=_[_0x0a93('0x30')](_0x4b5661[_0x22325f['id']],function(_0x3e0170){return{'id':_0x3e0170['id'],'fullname':_0x3e0170[_0x0a93('0x31')]};});}}catch(_0x48dae1){_0x45547a(_0x48dae1);}_0x413bb0(_0x22325f);});}function getInteractionTags(_0x3f47f3,_0xd527fb){return new BPromise(function(_0x4c358d,_0x21b8f5){try{if(_0x3f47f3[_0x0a93('0x32')]){_0x3f47f3['Tags']=[];_0x3f47f3[_0x0a93('0x32')]['split'](',')[_0x0a93('0x33')](function(_0x1c6af8){_0x3f47f3[_0x0a93('0x34')][_0x0a93('0x35')](_0xd527fb[_0x1c6af8]);});}delete _0x3f47f3['TagIds'];}catch(_0x33e65a){_0x21b8f5(_0x33e65a);}_0x4c358d(_0x3f47f3);});}function updateFaxInteraction(_0x599227,_0x4a21d2,_0x5621c1){return new BPromise(function(_0x496a13,_0x1f4091){return getInteractionUsers(_0x599227,_0x5621c1)[_0x0a93('0x2a')](function(_0x5a999a){return getInteractionTags(_0x5a999a,_0x4a21d2);})['then'](function(_0x4cbed3){return getStateInteraction(_0x4cbed3);})[_0x0a93('0x2a')](function(_0x5ab35d){_0x496a13(_0x5ab35d);})[_0x0a93('0x36')](function(_0x5b1c69){_0x1f4091(_0x5b1c69);});});}function getStateInteraction(_0x293aa1){return new BPromise(function(_0x3a79f0){_0x293aa1['waiting']=0x0;_0x293aa1['talking']=0x0;_0x293aa1['answered']=0x0;_0x293aa1[_0x0a93('0x37')]=0x0;_0x293aa1[_0x0a93('0x38')]=0x0;if(!_0x293aa1[_0x0a93('0x39')]&&!_0x293aa1[_0x0a93('0x3a')]){_0x293aa1[_0x0a93('0x3b')]+=0x1;}if(!_0x293aa1[_0x0a93('0x39')]&&_0x293aa1[_0x0a93('0x3a')]){_0x293aa1['talking']+=0x1;if(_0x293aa1[_0x0a93('0x3b')]){_0x293aa1['waiting']-=0x1;}}if(_0x293aa1[_0x0a93('0x39')]&&_0x293aa1[_0x0a93('0x3a')]){_0x293aa1[_0x0a93('0x3c')]+=0x1;if(_0x293aa1[_0x0a93('0x3d')]){_0x293aa1['talking']-=0x1;}}if(_0x293aa1[_0x0a93('0x39')]&&!_0x293aa1[_0x0a93('0x3a')]){_0x293aa1[_0x0a93('0x37')]+=0x1;if(_0x293aa1[_0x0a93('0x3b')]){_0x293aa1[_0x0a93('0x3b')]-=0x1;}}_0x293aa1[_0x0a93('0x38')]+=0x1;_0x3a79f0(_0x293aa1);});}exports[_0x0a93('0x3e')]=function(_0x1f09e6,_0x5e02f5){var _0x6cc0e9={},_0x23e487={},_0x2c6f9f={'count':0x0,'rows':[]};var _0x209e07=_[_0x0a93('0x30')](db[_0x0a93('0x3f')]['rawAttributes'],function(_0x53ff8c){return{'name':_0x53ff8c[_0x0a93('0x40')],'type':_0x53ff8c['type'][_0x0a93('0x41')]};});_0x23e487[_0x0a93('0x42')]=_[_0x0a93('0x30')](_0x209e07,_0x0a93('0x2d'));_0x23e487[_0x0a93('0x43')]=_[_0x0a93('0x44')](_0x1f09e6[_0x0a93('0x43')]);_0x23e487[_0x0a93('0x45')]=_[_0x0a93('0x46')](_0x23e487[_0x0a93('0x42')],_0x23e487[_0x0a93('0x43')]);_0x6cc0e9[_0x0a93('0x47')]=_[_0x0a93('0x46')](_0x23e487[_0x0a93('0x42')],qs[_0x0a93('0x48')](_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x48')]));_0x6cc0e9['attributes']=_0x6cc0e9['attributes']['length']?_0x6cc0e9[_0x0a93('0x47')]:_0x23e487[_0x0a93('0x42')];if(!_0x1f09e6['query'][_0x0a93('0x49')](_0x0a93('0x4a'))){_0x6cc0e9[_0x0a93('0x20')]=qs[_0x0a93('0x20')](_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x20')]);_0x6cc0e9[_0x0a93('0x23')]=qs[_0x0a93('0x23')](_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x23')]);}_0x6cc0e9[_0x0a93('0x4b')]=qs[_0x0a93('0x4c')](_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x4c')]);_0x6cc0e9[_0x0a93('0x4d')]=qs[_0x0a93('0x45')](_['pick'](_0x1f09e6['query'],_0x23e487[_0x0a93('0x45')]),_0x209e07);var _0x2102bb=[];var _0x29712e=squel[_0x0a93('0x4e')]()[_0x0a93('0x4f')]('id')[_0x0a93('0x4f')](_0x0a93('0x2d'))[_0x0a93('0x4f')](_0x0a93('0x50'))['from'](_0x0a93('0x51'));var _0x221451=squel[_0x0a93('0x4e')]()['field'](_0x0a93('0x52'))['field'](_0x0a93('0x53'))['field'](_0x0a93('0x54'))['from'](_0x0a93('0x55'),'ui')[_0x0a93('0x56')]('users','u','u.id\x20=\x20ui.UserId');var _0x2374af=squel['select']()['from'](_0x0a93('0x57'),'i')[_0x0a93('0x56')](_0x0a93('0x58'),'c',_0x0a93('0x59'))[_0x0a93('0x56')](_0x0a93('0x5a'),'o',_0x0a93('0x5b'))[_0x0a93('0x56')](_0x0a93('0x5c'),'a',_0x0a93('0x5d'))[_0x0a93('0x56')](_0x0a93('0x5e'),'me',_0x0a93('0x5f'))[_0x0a93('0x56')](_0x0a93('0x60'),'it',_0x0a93('0x61'))[_0x0a93('0x56')](_0x0a93('0x51'),'t',_0x0a93('0x62'));var _0x418d94=squel[_0x0a93('0x63')]();var _0x34e28b=[];var _0xc6a211=squel['expr']();var _0x5bf93d;if(_0x1f09e6['query'][_0x0a93('0x64')]){_0x5bf93d=as[_0x0a93('0x65')](_0x1f09e6[_0x0a93('0x43')]['search']);var _0xf440d4=_0x5bf93d['sqlOperator'];for(var _0x1b86cd=0x0;_0x1b86cd<_0x5bf93d[_0x0a93('0x66')][_0x0a93('0x67')];_0x1b86cd++){var _0x4a09e1=_0x5bf93d['conditions'][_0x1b86cd];var _0x30252d='i';var _0x4a2a59=_[_0x0a93('0x68')](_0x209e07,[_0x0a93('0x2d'),_0x4a09e1[_0x0a93('0x4f')]]);if(!_0x4a2a59){switch(_0x4a09e1[_0x0a93('0x4f')]){case _0x0a93('0x69'):if(_0x4a09e1['value']==0x1){_0x2374af[_0x0a93('0x6a')]('`'+_0x4a09e1['field']+_0x0a93('0x6b'));}else{_0x2374af[_0x0a93('0x6a')]('`'+_0x4a09e1['field']+_0x0a93('0x6c'));}break;case _0x0a93('0x6d'):if(_0x4a09e1[_0x0a93('0x6e')]===_0x0a93('0x6f')){if(_0x4a09e1[_0x0a93('0x70')][_0x0a93('0x71')]('\x20')[_0x0a93('0x67')]>0x1){_0x418d94[_0xf440d4](_0x0a93('0x72'),qs[_0x0a93('0x73')](_0x4a09e1[_0x0a93('0x70')]),null);}else{var _0xa5a638='%'+_0x4a09e1['value']+'%';_0x418d94[_0xf440d4]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xa5a638,_0xa5a638,_0xa5a638);}}else{_0x4a2a59=_['find'](_0x209e07,[_0x0a93('0x2d'),_0x0a93('0x74')]);_0x4a09e1['field']=_0x0a93('0x74');_0x10d7ae=as['buildExpression'](_0x30252d,_0x4a2a59[_0x0a93('0x75')],_0x4a09e1);_0x418d94[_0xf440d4](_0x10d7ae['text'],_0x10d7ae[_0x0a93('0x70')]['start'],_0x10d7ae['value'][_0x0a93('0x1e')]);}break;case _0x0a93('0x76'):var _0x16bc55=_0x4a09e1[_0x0a93('0x70')][_0x0a93('0x71')](',')[_0x0a93('0x30')](function(_0x5a7276){return Number(_0x5a7276);});_0x16bc55[_0x0a93('0x33')](function(_0x25a84d){_0xc6a211['or'](_0x0a93('0x77'),'%,'+_0x25a84d+',%');});_0x34e28b=_['union'](_0x34e28b,_0x16bc55);break;case'User':if(_0x4a09e1[_0x0a93('0x6e')]===_0x0a93('0x6f')){_0x418d94[_0xf440d4](_0x0a93('0x78'),'%'+_0x4a09e1['value']+'%',null);}else{_0x4a2a59=_['find'](_0x209e07,[_0x0a93('0x2d'),_0x0a93('0x3a')]);_0x4a09e1[_0x0a93('0x4f')]='UserId';_0x10d7ae=as['buildExpression'](_0x30252d,_0x4a2a59[_0x0a93('0x75')],_0x4a09e1);_0x418d94[_0xf440d4](_0x10d7ae['text'],_0x10d7ae[_0x0a93('0x70')][_0x0a93('0x79')],_0x10d7ae[_0x0a93('0x70')][_0x0a93('0x1e')]);}break;case _0x0a93('0x7a'):_0x10d7ae=as['buildExpression']('me',null,_0x4a09e1);_0x418d94[_0xf440d4](_0x10d7ae['text'],_0x10d7ae[_0x0a93('0x70')]['start'],_0x10d7ae[_0x0a93('0x70')][_0x0a93('0x1e')]);break;}}else{var _0x10d7ae=as[_0x0a93('0x7b')](_0x30252d,_0x4a2a59['type'],_0x4a09e1);_0x418d94[_0xf440d4](_0x10d7ae[_0x0a93('0x7c')],_0x10d7ae['value'][_0x0a93('0x79')],_0x10d7ae[_0x0a93('0x70')][_0x0a93('0x1e')]);}}}else{var _0x206fc2=_(_0x1f09e6[_0x0a93('0x43')])[_0x0a93('0x44')]()['map'](function(_0x100d00){return _['some'](_0x209e07,[_0x0a93('0x2d'),_0x100d00])?_0x100d00:undefined;})['compact']()['value']();if(!_[_0x0a93('0x7d')](_0x206fc2)){_0x206fc2['forEach'](function(_0x4e97c1){if(_0x4e97c1==='FaxAccountId'){_0x2374af['where'](_0x0a93('0x7e'),[][_0x0a93('0x7f')](_0x1f09e6[_0x0a93('0x43')][_0x4e97c1]));}else if(_0x4e97c1===_0x0a93('0x80')){var _0x27dcd5=JSON['parse'](_0x1f09e6[_0x0a93('0x43')][_0x4e97c1])[_0x0a93('0x81')];var _0x4f2498=JSON[_0x0a93('0x82')](_0x1f09e6[_0x0a93('0x43')][_0x4e97c1])[_0x0a93('0x83')];_0x2374af[_0x0a93('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x27dcd5,_0x4f2498);}else{if(_0x1f09e6[_0x0a93('0x43')][_0x4e97c1]===_0x0a93('0x84')){_0x2374af[_0x0a93('0x4d')]('i.'+_0x4e97c1+_0x0a93('0x85'));}else{_0x2374af[_0x0a93('0x4d')]('i.'+_0x4e97c1+_0x0a93('0x86'),_0x1f09e6['query'][_0x4e97c1]);}}});}if(_0x1f09e6['query'][_0x0a93('0x87')]){if(_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x87')]==0x1){_0x2374af[_0x0a93('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x2374af['having'](_0x0a93('0x88'));}}if(_0x1f09e6['query'][_0x0a93('0x89')]){_0x34e28b=_[_0x0a93('0x8a')](_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x89')])?_0x1f09e6[_0x0a93('0x43')]['tag']:new Array(_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x89')]);_0x34e28b[_0x0a93('0x33')](function(_0x115918){_0xc6a211['or'](_0x0a93('0x77'),'%,'+_0x115918+',%');});}if(_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x8b')]){var _0x2e68c4=_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x8b')][_0x0a93('0x8c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a93('0x8d')](_0x2e68c4)){_0x418d94['or'](_0x0a93('0x8e'),_0x2e68c4+'%')['or'](_0x0a93('0x8f'),_0x2e68c4+'%');}_0x418d94['or'](_0x0a93('0x90'),_0x2e68c4+'%');}}_0x2374af[_0x0a93('0x4d')](_0x418d94);_0x2374af[_0x0a93('0x91')]('i.id');var _0x341284={'type':db[_0x0a93('0x92')][_0x0a93('0x93')][_0x0a93('0x94')],'raw':!![]};var _0x4fd32d=_0x2374af[_0x0a93('0x95')]();_0x4fd32d['field']('i.id');_0x4fd32d[_0x0a93('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x6cc0e9['order']){_0x6cc0e9[_0x0a93('0x4b')][_0x0a93('0x33')](function(_0x5a74fc){var _0x335992=_0x5a74fc[0x0]===_0x0a93('0x96')?_0x5a74fc[0x0]:'i.'+_0x5a74fc[0x0];_0x2374af[_0x0a93('0x4b')](_0x335992,_0x5a74fc[0x1]===_0x0a93('0x97')?![]:!![]);});}if(!_[_0x0a93('0x7d')](_0x34e28b)){_0x2374af['having'](_0xc6a211);_0x4fd32d[_0x0a93('0x4d')](_0x0a93('0x98'),_0x34e28b);}BPromise[_0x0a93('0x99')]()[_0x0a93('0x2a')](function(){if(!_0x5bf93d){if(_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x9a')])return;_0x4fd32d['where'](_0x0a93('0x9b'));_0x2374af[_0x0a93('0x4d')](_0x0a93('0x9b'));return;}if(_0x1f09e6['user']['role']!=='agent')return;return _0x1f09e6[_0x0a93('0x9c')][_0x0a93('0x9d')]({'attributes':['id'],'raw':!![]})[_0x0a93('0x2a')](function(_0xdad6f){if(_[_0x0a93('0x7d')](_0xdad6f)){_0x4fd32d[_0x0a93('0x4d')](_0x0a93('0x9e'));_0x2374af[_0x0a93('0x4d')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4fd32d[_0x0a93('0x4d')](_0x0a93('0x7e'),_[_0x0a93('0x30')](_0xdad6f,'id'));_0x2374af['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0xdad6f,'id'));}});})[_0x0a93('0x2a')](function(){if(_0x1f09e6[_0x0a93('0x9c')][_0x0a93('0x9f')]==='agent'&&!_0x5bf93d&&!_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x9a')])return[];return db['sequelize'][_0x0a93('0x43')](_0x4fd32d['toString'](),_0x341284);})['then'](function(_0x593550){_0x2c6f9f[_0x0a93('0x22')]=_0x593550[_0x0a93('0x67')];if(_0x2c6f9f[_0x0a93('0x22')]===0x0)return[];return db['sequelize'][_0x0a93('0x43')](_0x29712e[_0x0a93('0xa0')](),_0x341284)[_0x0a93('0x2a')](function(_0x231535){_0x2102bb=_['keyBy'](_0x231535,'id');_0x341284=_[_0x0a93('0xa1')](_0x341284,{'model':db[_0x0a93('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1f09e6[_0x0a93('0x43')][_0x0a93('0x48')]){_0x6cc0e9[_0x0a93('0x47')][_0x0a93('0x33')](function(_0x5ac4a9){_0x2374af[_0x0a93('0x4f')]('i.'+_0x5ac4a9);});}else{_0x2374af['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a93('0x69'));_0x2374af['field'](_0x0a93('0xa2'),'Account.key');_0x2374af[_0x0a93('0x4f')](_0x0a93('0xa3'),'Account.mandatoryDisposition');_0x2374af[_0x0a93('0x4f')]('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',_0x0a93('0x96'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xa4'));_0x2374af['field'](_0x0a93('0xa5'),_0x0a93('0xa6'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xa7'),_0x0a93('0xa8'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xa9'),_0x0a93('0xaa'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xab'),_0x0a93('0xac'));_0x2374af[_0x0a93('0x4f')]('c.mobile',_0x0a93('0xad'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xae'),_0x0a93('0xaf'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xb0'),_0x0a93('0xb1'));_0x2374af[_0x0a93('0x4f')](_0x0a93('0xb2'),'Owner.internal');_0x2374af[_0x0a93('0x4f')](_0x0a93('0xb3'),_0x0a93('0x32'));}if(_0x6cc0e9[_0x0a93('0x20')])_0x2374af[_0x0a93('0x20')](_0x6cc0e9[_0x0a93('0x20')]);if(_0x6cc0e9[_0x0a93('0x23')])_0x2374af[_0x0a93('0x23')](_0x6cc0e9[_0x0a93('0x23')]);return db[_0x0a93('0xb4')][_0x0a93('0x43')](_0x2374af[_0x0a93('0xa0')](),_0x341284);})[_0x0a93('0x2a')](function(_0x4480da){if(_0x4480da[_0x0a93('0x67')]>0x0)_0x221451[_0x0a93('0x4d')](_0x0a93('0xb5'),_[_0x0a93('0x30')](_0x4480da,'id'));return db['sequelize'][_0x0a93('0x43')](_0x221451[_0x0a93('0xa0')](),_0x341284)[_0x0a93('0x2a')](function(_0x44ba31){var _0x21ee28=_['groupBy'](_0x44ba31,_0x0a93('0xb6'));var _0x497aab=[];_0x4480da[_0x0a93('0x33')](function(_0x1b8483){_0x497aab[_0x0a93('0x35')](updateFaxInteraction(_0x1b8483,_0x2102bb,_0x21ee28));});return BPromise[_0x0a93('0xb7')](_0x497aab);});});})[_0x0a93('0x2a')](function(_0x8bd1bf){_0x2c6f9f[_0x0a93('0xb8')]=_0x8bd1bf;return _0x2c6f9f;})[_0x0a93('0x2a')](respondWithFilteredResult(_0x5e02f5,_0x6cc0e9))[_0x0a93('0x36')](handleError(_0x5e02f5,null));};exports[_0x0a93('0xb9')]=function(_0x15b0d0,_0x3a74c5){var _0x407c6e={'raw':![],'where':{'id':_0x15b0d0[_0x0a93('0xba')]['id']}},_0x16c33c={};_0x16c33c[_0x0a93('0x42')]=_['keys'](db[_0x0a93('0x3f')]['rawAttributes']);_0x16c33c[_0x0a93('0x43')]=_['keys'](_0x15b0d0['query']);_0x16c33c['filters']=_[_0x0a93('0x46')](_0x16c33c[_0x0a93('0x42')],_0x16c33c[_0x0a93('0x43')]);_0x407c6e['attributes']=_[_0x0a93('0x46')](_0x16c33c[_0x0a93('0x42')],qs[_0x0a93('0x48')](_0x15b0d0[_0x0a93('0x43')][_0x0a93('0x48')]));_0x407c6e[_0x0a93('0x47')]=_0x407c6e[_0x0a93('0x47')][_0x0a93('0x67')]?_0x407c6e['attributes']:_0x16c33c['model'];if(_0x15b0d0['query']['includeAll']){_0x407c6e[_0x0a93('0xbb')]=[{'all':!![]}];}_0x407c6e=_[_0x0a93('0xa1')]({},_0x407c6e,_0x15b0d0[_0x0a93('0xbc')]);return db[_0x0a93('0x3f')][_0x0a93('0x68')](_0x407c6e)[_0x0a93('0x2a')](handleEntityNotFound(_0x3a74c5,null))[_0x0a93('0x2a')](respondWithResult(_0x3a74c5,null))[_0x0a93('0x36')](handleError(_0x3a74c5,null));};exports[_0x0a93('0xbd')]=function(_0x4b2f19,_0x438fdf){return db[_0x0a93('0x3f')][_0x0a93('0xbd')](_0x4b2f19[_0x0a93('0x7a')],{})['then'](respondWithResult(_0x438fdf,0xc9))[_0x0a93('0x36')](handleError(_0x438fdf,null));};exports['update']=function(_0x23efdf,_0x2bcc34){if(_0x23efdf[_0x0a93('0x7a')]['id']){delete _0x23efdf['body']['id'];}return db[_0x0a93('0x3f')][_0x0a93('0x68')]({'where':{'id':_0x23efdf[_0x0a93('0xba')]['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x2bcc34,null))[_0x0a93('0x2a')](saveUpdates(_0x23efdf['body'],null))[_0x0a93('0x2a')](respondWithResult(_0x2bcc34,null))[_0x0a93('0x36')](handleError(_0x2bcc34,null));};exports[_0x0a93('0x2b')]=function(_0x3a4c48,_0x3bf879){return db['FaxInteraction']['find']({'where':{'id':_0x3a4c48['params']['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x3bf879,null))['then'](removeEntity(_0x3bf879,null))[_0x0a93('0x36')](handleError(_0x3bf879,null));};exports[_0x0a93('0xbe')]=function(_0x37d37c,_0x1eb3d2){return db['FaxInteraction'][_0x0a93('0xbe')]()[_0x0a93('0x2a')](respondWithResult(_0x1eb3d2,null))[_0x0a93('0x36')](handleError(_0x1eb3d2,null));};exports[_0x0a93('0xbf')]=function(_0xe078e4,_0x1276a6,_0x3f38f1){return db[_0x0a93('0xc0')][_0x0a93('0x68')]({'where':{'id':_0xe078e4[_0x0a93('0xba')]['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x1276a6,null))[_0x0a93('0x2a')](function(_0x5d3cc4){if(_0x5d3cc4){return _0x5d3cc4[_0x0a93('0xbf')](_0xe078e4[_0x0a93('0x7a')][_0x0a93('0xc1')],_[_0x0a93('0xc2')](_0xe078e4[_0x0a93('0x7a')],[_0x0a93('0xc1'),'id'])||{});}})[_0x0a93('0x2a')](respondWithResult(_0x1276a6,null))['catch'](handleError(_0x1276a6,null));};exports[_0x0a93('0xc3')]=function(_0x53bcaf,_0x28f587,_0x2be4cf){var _0x3de8dc={'raw':![],'where':{}};var _0x5a2de3={};var _0x1afd00={'count':0x0,'rows':[]};return db[_0x0a93('0x3f')][_0x0a93('0xc4')]({'where':{'id':_0x53bcaf['params']['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x28f587,null))[_0x0a93('0x2a')](function(_0x4c0c52){if(_0x4c0c52){_0x5a2de3[_0x0a93('0x42')]=_[_0x0a93('0x44')](db[_0x0a93('0xc0')][_0x0a93('0xc5')]);_0x5a2de3[_0x0a93('0x43')]=_[_0x0a93('0x44')](_0x53bcaf[_0x0a93('0x43')]);_0x5a2de3[_0x0a93('0x45')]=_[_0x0a93('0x46')](_0x5a2de3[_0x0a93('0x42')],_0x5a2de3[_0x0a93('0x43')]);_0x3de8dc[_0x0a93('0x47')]=_['intersection'](_0x5a2de3[_0x0a93('0x42')],qs['fields'](_0x53bcaf['query'][_0x0a93('0x48')]));_0x3de8dc[_0x0a93('0x47')]=_0x3de8dc[_0x0a93('0x47')][_0x0a93('0x67')]?_0x3de8dc[_0x0a93('0x47')]:_0x5a2de3['model'];if(!_0x53bcaf['query'][_0x0a93('0x49')]('nolimit')){_0x3de8dc['limit']=qs[_0x0a93('0x20')](_0x53bcaf['query'][_0x0a93('0x20')]);_0x3de8dc[_0x0a93('0x23')]=qs[_0x0a93('0x23')](_0x53bcaf[_0x0a93('0x43')][_0x0a93('0x23')]);}_0x3de8dc['order']=qs['sort'](_0x53bcaf['query'][_0x0a93('0x4c')]);_0x3de8dc[_0x0a93('0x4d')]=qs[_0x0a93('0x45')](_['pick'](_0x53bcaf['query'],_0x5a2de3[_0x0a93('0x45')]));_0x3de8dc[_0x0a93('0x4d')][_0x0a93('0xb6')]=_0x4c0c52['id'];if(_0x53bcaf[_0x0a93('0x43')][_0x0a93('0x8b')]){_0x3de8dc[_0x0a93('0x4d')]=_[_0x0a93('0xa1')](_0x3de8dc['where'],{'$or':_[_0x0a93('0x30')](_0x3de8dc[_0x0a93('0x47')],function(_0x3841b8){var _0x37f03c={};_0x37f03c[_0x3841b8]={'$like':'%'+_0x53bcaf[_0x0a93('0x43')]['filter']+'%'};return _0x37f03c;})});}if(_0x53bcaf[_0x0a93('0x43')][_0x0a93('0x81')]){var _0x7ca26c=_0x53bcaf[_0x0a93('0x43')][_0x0a93('0x81')][_0x0a93('0x71')](',');var _0x205aa2={};_0x205aa2[_0x7ca26c[0x0]]={'$gte':moment(_0x7ca26c[0x1])[_0x0a93('0xc6')](_0x0a93('0xc7'))};_0x3de8dc['where']=_[_0x0a93('0xa1')](_0x3de8dc[_0x0a93('0x4d')],_0x205aa2);}_0x3de8dc=_[_0x0a93('0xa1')]({},_0x3de8dc,_0x53bcaf[_0x0a93('0xbc')]);return db[_0x0a93('0xc0')][_0x0a93('0x22')]({'where':_0x3de8dc[_0x0a93('0x4d')]})['then'](function(_0x930d96){_0x1afd00[_0x0a93('0x22')]=_0x930d96;if(_0x53bcaf['query'][_0x0a93('0xc8')]){_0x3de8dc[_0x0a93('0xbb')]=[{'all':!![]}];}return db[_0x0a93('0xc0')][_0x0a93('0xc9')](_0x3de8dc);})[_0x0a93('0x2a')](function(_0x2f3095){_0x1afd00[_0x0a93('0xb8')]=_0x2f3095;return _0x1afd00;});}})[_0x0a93('0x2a')](respondWithFilteredResult(_0x28f587,_0x3de8dc))[_0x0a93('0x36')](handleError(_0x28f587,null));};exports[_0x0a93('0xca')]=function(_0x5d12f0,_0x1b60ac,_0x1a8020){return db[_0x0a93('0x3f')][_0x0a93('0x68')]({'where':{'id':_0x5d12f0[_0x0a93('0xba')]['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x1b60ac,null))[_0x0a93('0x2a')](function(_0x43d363){if(_0x43d363){return _0x43d363['setTags'](_0x5d12f0[_0x0a93('0x7a')][_0x0a93('0xc1')],_['omit'](_0x5d12f0[_0x0a93('0x7a')],[_0x0a93('0xc1'),'id'])||{})[_0x0a93('0xcb')](function(){return db[_0x0a93('0x76')][_0x0a93('0xc9')]({'attributes':['id',_0x0a93('0x2d'),_0x0a93('0x50')],'where':{'id':_0x5d12f0[_0x0a93('0x7a')][_0x0a93('0xc1')]}});})[_0x0a93('0x2a')](function(_0x285f01){socket[_0x0a93('0xcc')](_0x0a93('0xcd'),{'id':Number(_0x5d12f0[_0x0a93('0xba')]['id']),'tags':_0x285f01||[]});return{'id':Number(_0x5d12f0[_0x0a93('0xba')]['id']),'tags':_0x285f01||[]};});}})[_0x0a93('0x2a')](respondWithResult(_0x1b60ac,null))[_0x0a93('0x36')](handleError(_0x1b60ac,null));};exports[_0x0a93('0xce')]=function(_0x5e2505,_0x7e37ae,_0x4c6dd8){return db[_0x0a93('0x3f')]['find']({'where':{'id':_0x5e2505[_0x0a93('0xba')]['id']}})[_0x0a93('0x2a')](handleEntityNotFound(_0x7e37ae,null))[_0x0a93('0x2a')](function(_0x68dac9){if(_0x68dac9){return _0x68dac9[_0x0a93('0xce')](_0x5e2505[_0x0a93('0x43')][_0x0a93('0xc1')]);}})[_0x0a93('0x2a')](respondWithStatusCode(_0x7e37ae,null))['catch'](handleError(_0x7e37ae,null));};exports[_0x0a93('0xcf')]=function(_0x19bc36,_0x1a32f0){var _0x4d4598=moment()[_0x0a93('0xd0')]()['toString']();var _0x9064e4=path[_0x0a93('0xd1')](config[_0x0a93('0xd2')],_0x0a93('0xd3'),_0x0a93('0xd4'),_0x0a93('0xd5'));var _0x1c1cc0=path[_0x0a93('0xd1')](config[_0x0a93('0xd2')],_0x0a93('0xd3'),'files',_0x0a93('0xd6'));var _0x42a68d=path[_0x0a93('0xd1')](_0x9064e4,_0x4d4598);var _0x2cb291=util[_0x0a93('0xc6')](_0x0a93('0xd7'),_0x19bc36[_0x0a93('0xba')]['id'],_0x4d4598);var _0x18e948=path[_0x0a93('0xd1')](_0x9064e4,_0x2cb291);var _0x56f6a1=[];_0x56f6a1[_0x0a93('0x35')]({'model':db[_0x0a93('0xd8')],'as':_0x0a93('0xd8'),'raw':!![]});var _0x44c5b7=[{'model':db[_0x0a93('0xc0')],'as':_0x0a93('0xd9'),'attributes':['id',_0x0a93('0x7a'),_0x0a93('0x80')],'include':_0x56f6a1}];return db['FaxInteraction']['find']({'where':{'id':_0x19bc36['params']['id']},'include':_0x44c5b7})['then'](handleEntityNotFound(_0x1a32f0,null))[_0x0a93('0x2a')](function(_0x3d0865){if(_0x3d0865&&_0x3d0865[_0x0a93('0xd9')]){var _0x2ff22d=_0x3d0865[_0x0a93('0xda')]({'plain':!![]});fs[_0x0a93('0xdb')](_0x42a68d);for(var _0x14e4f2=0x0;_0x14e4f2<_0x2ff22d[_0x0a93('0xd9')][_0x0a93('0x67')];_0x14e4f2++){var _0x45b0f7=_0x2ff22d['Messages'][_0x14e4f2][_0x0a93('0xd8')];if(_0x45b0f7){var _0xf51ce6=path[_0x0a93('0xd1')](_0x1c1cc0,_0x45b0f7[_0x0a93('0xdc')]);if(fs[_0x0a93('0xdd')](_0xf51ce6)){fs['createReadStream'](_0xf51ce6)[_0x0a93('0xde')](fs[_0x0a93('0xdf')](path[_0x0a93('0xd1')](_0x42a68d,_0x45b0f7[_0x0a93('0xdc')])));}}}return BPromise['resolve']()[_0x0a93('0x2a')](function(){return new BPromise(function(_0x34fe66,_0x54ce8e){zipdir(_0x42a68d,{'saveTo':_0x18e948},function(_0x296cf0,_0x557cd7){if(_0x296cf0)return _0x54ce8e(_0x296cf0);return _0x34fe66(_0x557cd7);});})[_0x0a93('0x2a')](function(){return new BPromise(function(_0x517e7a,_0x364c75){rimraf(_0x42a68d,function(_0x4efda5){if(_0x4efda5)_0x364c75(_0x4efda5);return _0x517e7a();});});})[_0x0a93('0x2a')](function(){return _0x1a32f0[_0x0a93('0xcf')](_0x18e948,_0x2cb291,function(_0x3b0bfc){if(_0x3b0bfc){console[_0x0a93('0xe0')](_0x0a93('0xe1'),_0x3b0bfc);}else{fs[_0x0a93('0xe2')](_0x18e948);}});});});}else{return _0x1a32f0[_0x0a93('0xe3')](0xc8);}})[_0x0a93('0x36')](handleError(_0x1a32f0,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b81e628..d565d79 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 _0x20b3=['hook','events','../../mysqldb','FaxMessage','save','update','remove','then','setDataValue','Users','map','emit','hasOwnProperty'];(function(_0x5ab90e,_0x9d6d92){var _0x546739=function(_0x131d06){while(--_0x131d06){_0x5ab90e['push'](_0x5ab90e['shift']());}};_0x546739(++_0x9d6d92);}(_0x20b3,0xc4));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x320b('0x0'));var FaxInteraction=require(_0x320b('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x320b('0x1'))['db'][_0x320b('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x320b('0x3'),'afterUpdate':_0x320b('0x4'),'afterDestroy':_0x320b('0x5')};function emitEvent(_0x527c64){return function(_0x2a38f4,_0x5135fe,_0xbcea6a){_0x2a38f4['getUsers']({'attributes':['id'],'raw':!![]})[_0x320b('0x6')](function(_0x4feb53){_0x2a38f4[_0x320b('0x7')](_0x320b('0x8'),_0x4feb53[_0x320b('0x9')](function(_0x5c025d){return{'id':_0x5c025d['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x2a38f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x320b('0x6')](function(_0x3197fa){_0x2a38f4[_0x320b('0x7')]('unreadMessages',_0x3197fa['length']);FaxInteractionEvents[_0x320b('0xa')](_0x527c64+':'+_0x2a38f4['id'],_0x2a38f4);FaxInteractionEvents[_0x320b('0xa')](_0x527c64,_0x2a38f4);_0xbcea6a(null);})['catch'](_0xbcea6a(null));};}for(var e in events){if(events[_0x320b('0xb')](e)){var event=events[e];FaxInteraction[_0x320b('0xc')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xd289=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x150810,_0x237a75){var _0x37779d=function(_0x69eca5){while(--_0x69eca5){_0x150810['push'](_0x150810['shift']());}};_0x37779d(++_0x237a75);}(_0xd289,0x96));var _0x9d28=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xd289[_0x168127];return _0x4c99ad;};'use strict';var EventEmitter=require(_0x9d28('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x9d28('0x1')];var FaxMessage=require(_0x9d28('0x2'))['db'][_0x9d28('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9d28('0x4')](0x0);var events={'afterCreate':_0x9d28('0x5'),'afterUpdate':_0x9d28('0x6'),'afterDestroy':_0x9d28('0x7')};function emitEvent(_0x1c9f26){return function(_0x441527,_0x401213,_0x52ae7e){_0x441527['getUsers']({'attributes':['id'],'raw':!![]})[_0x9d28('0x8')](function(_0x3e9513){_0x441527[_0x9d28('0x9')](_0x9d28('0xa'),_0x3e9513[_0x9d28('0xb')](function(_0x1b917c){return{'id':_0x1b917c['id']};}));return FaxMessage[_0x9d28('0xc')]({'where':{'FaxInteractionId':_0x441527['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5813b5){_0x441527[_0x9d28('0x9')](_0x9d28('0xd'),_0x5813b5[_0x9d28('0xe')]);FaxInteractionEvents[_0x9d28('0xf')](_0x1c9f26+':'+_0x441527['id'],_0x441527);FaxInteractionEvents[_0x9d28('0xf')](_0x1c9f26,_0x441527);_0x52ae7e(null);})[_0x9d28('0x10')](_0x52ae7e(null));};}for(var e in events){if(events[_0x9d28('0x11')](e)){var event=events[e];FaxInteraction[_0x9d28('0x12')](e,emitEvent(event));}}module[_0x9d28('0x13')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 244649b..9dd2881 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 _0xe2a7=['../../config/environment','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xe2a7,0x12e));var _0x7e2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e2a('0x0'));var util=require(_0x7e2a('0x1'));var logger=require('../../config/logger')(_0x7e2a('0x2'));var moment=require(_0x7e2a('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e2a('0x4'));var fs=require('fs');var path=require(_0x7e2a('0x5'));var rimraf=require('rimraf');var config=require(_0x7e2a('0x6'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0xa9a5a0,_0x2a30c0){return _0xa9a5a0[_0x7e2a('0x7')](_0x7e2a('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43ce14,_0x59fcef,_0x1a4af1){if(_0x43ce14[_0x7e2a('0x9')](_0x7e2a('0xa'))){_0x43ce14[_0x7e2a('0xb')]=moment()[_0x7e2a('0xc')](_0x7e2a('0xd'));}_0x1a4af1(null,_0x43ce14);}}});}; \ No newline at end of file +var _0x4cd3=['request-promise','path','exports','FaxInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0x4cd3,0x1ca));var _0x34cd=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0x4cd3[_0x48a928];return _0x11c1e9;};'use strict';var _=require(_0x34cd('0x0'));var util=require(_0x34cd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x34cd('0x2'));var fs=require('fs');var path=require(_0x34cd('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x34cd('0x4')]=function(_0x53c9d9,_0x5be3b4){return _0x53c9d9['define'](_0x34cd('0x5'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a4905,_0x133e0b,_0x64346c){if(_0x3a4905['changed'](_0x34cd('0x6'))){_0x3a4905[_0x34cd('0x7')]=moment()[_0x34cd('0x8')](_0x34cd('0x9'));}_0x64346c(null,_0x3a4905);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 07a2403..0a1273a 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 _0x7baa=['result','catch','FaxInteraction','update','body','options','where','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x295a97,_0x4723bc){var _0x36d761=function(_0x14ceae){while(--_0x14ceae){_0x295a97['push'](_0x295a97['shift']());}};_0x36d761(++_0x4723bc);}(_0x7baa,0x181));var _0xa7ba=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x7baa[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0xa7ba('0x0'));var util=require(_0xa7ba('0x1'));var moment=require(_0xa7ba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7ba('0x3'));var db=require(_0xa7ba('0x4'))['db'];var utils=require(_0xa7ba('0x5'));var logger=require(_0xa7ba('0x6'))(_0xa7ba('0x7'));var config=require(_0xa7ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7ba('0x9')][_0xa7ba('0xa')]({'port':0x232a});config[_0xa7ba('0xb')]=_[_0xa7ba('0xc')](config[_0xa7ba('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7ba('0xd'))(new Redis(config[_0xa7ba('0xb')]));require(_0xa7ba('0xe'))[_0xa7ba('0xf')](socket);function respondWithRpcPromise(_0xb33f43,_0x422f66,_0x53ce3e){return new BPromise(function(_0x1425f9,_0x31342c){return client[_0xa7ba('0x10')](_0xb33f43,_0x53ce3e)[_0xa7ba('0x11')](function(_0x5578c3){logger['info'](_0xa7ba('0x12'),_0x422f66,_0xa7ba('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x422f66,_0xa7ba('0x13'),JSON[_0xa7ba('0x14')](_0x5578c3));if(_0x5578c3[_0xa7ba('0x15')]){if(_0x5578c3[_0xa7ba('0x15')][_0xa7ba('0x16')]===0x1f4){logger[_0xa7ba('0x15')](_0xa7ba('0x12'),_0x422f66,_0x5578c3['error']['message']);return _0x31342c(_0x5578c3[_0xa7ba('0x15')]['message']);}logger[_0xa7ba('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x422f66,_0x5578c3[_0xa7ba('0x15')]['message']);return _0x1425f9(_0x5578c3[_0xa7ba('0x15')][_0xa7ba('0x17')]);}else{logger[_0xa7ba('0x18')](_0xa7ba('0x12'),_0x422f66,_0xa7ba('0x13'));_0x1425f9(_0x5578c3[_0xa7ba('0x19')][_0xa7ba('0x17')]);}})[_0xa7ba('0x1a')](function(_0xe8b3b){logger[_0xa7ba('0x15')](_0xa7ba('0x12'),_0x422f66,_0xe8b3b);_0x31342c(_0xe8b3b);});});}exports['UpdateFaxInteraction']=function(_0x517e0a){var _0x16a15b=this;return new Promise(function(_0x360932,_0x52a6ca){return db[_0xa7ba('0x1b')][_0xa7ba('0x1c')](_0x517e0a[_0xa7ba('0x1d')],{'raw':_0x517e0a[_0xa7ba('0x1e')]?_0x517e0a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517e0a[_0xa7ba('0x1e')]?_0x517e0a[_0xa7ba('0x1e')][_0xa7ba('0x1f')]||null:null,'attributes':_0x517e0a['options']?_0x517e0a[_0xa7ba('0x1e')]['attributes']||null:null,'limit':_0x517e0a['options']?_0x517e0a[_0xa7ba('0x1e')][_0xa7ba('0x20')]||null:null})[_0xa7ba('0x11')](function(_0x27dba9){logger['info'](_0xa7ba('0x21'),_0x517e0a);logger['debug'](_0xa7ba('0x21'),_0x517e0a,JSON[_0xa7ba('0x14')](_0x27dba9));_0x360932(_0x27dba9);})['catch'](function(_0x2f7f63){logger['error'](_0xa7ba('0x21'),_0x2f7f63[_0xa7ba('0x17')],_0x517e0a);_0x52a6ca(_0x16a15b[_0xa7ba('0x15')](0x1f4,_0x2f7f63[_0xa7ba('0x17')]));});});};exports[_0xa7ba('0x22')]=function(_0x318a55){return new Promise(function(_0x201345,_0x25c503){return db[_0xa7ba('0x1b')][_0xa7ba('0x23')]({'where':_0x318a55[_0xa7ba('0x1e')]?_0x318a55['options'][_0xa7ba('0x1f')]||null:null})[_0xa7ba('0x11')](function(_0x53c73e){if(_0x53c73e){return _0x53c73e[_0xa7ba('0x24')](_0x318a55['body'][_0xa7ba('0x25')],_[_0xa7ba('0x26')](_0x318a55['body'],[_0xa7ba('0x25'),'id'])||{});}})[_0xa7ba('0x27')](function(_0x5861ca){logger[_0xa7ba('0x18')](_0xa7ba('0x28'),_0x318a55);logger['debug'](_0xa7ba('0x28'),_0x318a55,JSON[_0xa7ba('0x14')](_0x5861ca));_0x201345(_0x5861ca);})[_0xa7ba('0x1a')](function(_0x4c1d73){logger[_0xa7ba('0x15')](_0xa7ba('0x28'),_0x4c1d73[_0xa7ba('0x17')],_0x318a55);_0x25c503(_this[_0xa7ba('0x15')](0x1f4,_0x4c1d73['message']));});});}; \ No newline at end of file +var _0x861e=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x2bc4f9,_0xbc16c8){var _0x562378=function(_0x567914){while(--_0x567914){_0x2bc4f9['push'](_0x2bc4f9['shift']());}};_0x562378(++_0xbc16c8);}(_0x861e,0xdb));var _0xe861=function(_0x25267f,_0x41f66b){_0x25267f=_0x25267f-0x0;var _0x48e95c=_0x861e[_0x25267f];return _0x48e95c;};'use strict';var _=require('lodash');var util=require(_0xe861('0x0'));var moment=require(_0xe861('0x1'));var BPromise=require('bluebird');var rs=require(_0xe861('0x2'));var fs=require('fs');var Redis=require(_0xe861('0x3'));var db=require(_0xe861('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe861('0x5'));var config=require(_0xe861('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe861('0x7')][_0xe861('0x8')]({'port':0x232a});config[_0xe861('0x9')]=_[_0xe861('0xa')](config[_0xe861('0x9')],{'host':_0xe861('0xb'),'port':0x18eb});var socket=require(_0xe861('0xc'))(new Redis(config['redis']));require(_0xe861('0xd'))[_0xe861('0xe')](socket);function respondWithRpcPromise(_0x1b6102,_0xfd681,_0x40eb44){return new BPromise(function(_0x13eb8b,_0x41cd19){return client[_0xe861('0xf')](_0x1b6102,_0x40eb44)[_0xe861('0x10')](function(_0x3afd6e){logger[_0xe861('0x11')](_0xe861('0x12'),_0xfd681,_0xe861('0x13'));logger[_0xe861('0x14')](_0xe861('0x15'),_0xfd681,_0xe861('0x13'),JSON['stringify'](_0x3afd6e));if(_0x3afd6e[_0xe861('0x16')]){if(_0x3afd6e[_0xe861('0x16')][_0xe861('0x17')]===0x1f4){logger[_0xe861('0x16')](_0xe861('0x12'),_0xfd681,_0x3afd6e['error']['message']);return _0x41cd19(_0x3afd6e[_0xe861('0x16')][_0xe861('0x18')]);}logger[_0xe861('0x16')](_0xe861('0x12'),_0xfd681,_0x3afd6e[_0xe861('0x16')][_0xe861('0x18')]);return _0x13eb8b(_0x3afd6e[_0xe861('0x16')][_0xe861('0x18')]);}else{logger[_0xe861('0x11')](_0xe861('0x12'),_0xfd681,_0xe861('0x13'));_0x13eb8b(_0x3afd6e[_0xe861('0x19')][_0xe861('0x18')]);}})[_0xe861('0x1a')](function(_0x4f7253){logger[_0xe861('0x16')](_0xe861('0x12'),_0xfd681,_0x4f7253);_0x41cd19(_0x4f7253);});});}exports[_0xe861('0x1b')]=function(_0xd7d990){var _0xcc6ebc=this;return new Promise(function(_0x9513e4,_0xdb6995){return db[_0xe861('0x1c')]['update'](_0xd7d990[_0xe861('0x1d')],{'raw':_0xd7d990[_0xe861('0x1e')]?_0xd7d990[_0xe861('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7d990[_0xe861('0x1e')]?_0xd7d990[_0xe861('0x1e')][_0xe861('0x1f')]||null:null,'attributes':_0xd7d990[_0xe861('0x1e')]?_0xd7d990['options']['attributes']||null:null,'limit':_0xd7d990[_0xe861('0x1e')]?_0xd7d990[_0xe861('0x1e')]['limit']||null:null})[_0xe861('0x10')](function(_0x2af135){logger[_0xe861('0x11')](_0xe861('0x1b'),_0xd7d990);logger['debug']('UpdateFaxInteraction',_0xd7d990,JSON[_0xe861('0x20')](_0x2af135));_0x9513e4(_0x2af135);})[_0xe861('0x1a')](function(_0xd2ad93){logger['error'](_0xe861('0x1b'),_0xd2ad93[_0xe861('0x18')],_0xd7d990);_0xdb6995(_0xcc6ebc[_0xe861('0x16')](0x1f4,_0xd2ad93['message']));});});};exports[_0xe861('0x21')]=function(_0x41794f){return new Promise(function(_0x33a19e,_0x2e1a07){return db[_0xe861('0x1c')][_0xe861('0x22')]({'where':_0x41794f[_0xe861('0x1e')]?_0x41794f['options'][_0xe861('0x1f')]||null:null})[_0xe861('0x10')](function(_0x248800){if(_0x248800){return _0x248800[_0xe861('0x23')](_0x41794f['body'][_0xe861('0x24')],_[_0xe861('0x25')](_0x41794f[_0xe861('0x1d')],[_0xe861('0x24'),'id'])||{});}})['spread'](function(_0x269e3){logger[_0xe861('0x11')](_0xe861('0x26'),_0x41794f);logger[_0xe861('0x14')](_0xe861('0x26'),_0x41794f,JSON[_0xe861('0x20')](_0x269e3));_0x33a19e(_0x269e3);})[_0xe861('0x1a')](function(_0x508d79){logger[_0xe861('0x16')](_0xe861('0x26'),_0x508d79[_0xe861('0x18')],_0x41794f);_0x2e1a07(_this[_0xe861('0x16')](0x1f4,_0x508d79[_0xe861('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ca70b16..7015837 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 _0x31e6=['./faxInteraction.events','save','remove','update','register','length','faxInteraction:'];(function(_0x16ee2c,_0x6cc549){var _0x33153c=function(_0x198046){while(--_0x198046){_0x16ee2c['push'](_0x16ee2c['shift']());}};_0x33153c(++_0x6cc549);}(_0x31e6,0xf5));var _0x631e=function(_0x3f1635,_0x31eaf8){_0x3f1635=_0x3f1635-0x0;var _0x5d8c33=_0x31e6[_0x3f1635];return _0x5d8c33;};'use strict';var FaxInteractionEvents=require(_0x631e('0x0'));var events=[_0x631e('0x1'),_0x631e('0x2'),_0x631e('0x3')];function createListener(_0x23dff9,_0x5564ee){return function(_0x3d844d){_0x5564ee['emit'](_0x23dff9,_0x3d844d);};}function removeListener(_0x25a3cf,_0x1fb9d1){return function(){FaxInteractionEvents['removeListener'](_0x25a3cf,_0x1fb9d1);};}exports[_0x631e('0x4')]=function(_0xb3a2c1){for(var _0x89e2d4=0x0,_0x5505b5=events[_0x631e('0x5')];_0x89e2d4<_0x5505b5;_0x89e2d4++){var _0x54c113=events[_0x89e2d4];var _0x11f4a4=createListener(_0x631e('0x6')+_0x54c113,_0xb3a2c1);FaxInteractionEvents['on'](_0x54c113,_0x11f4a4);}}; \ No newline at end of file +var _0x4606=['emit','length','faxInteraction:','./faxInteraction.events','save','update'];(function(_0x4692a1,_0x41f54f){var _0x128700=function(_0x2661dc){while(--_0x2661dc){_0x4692a1['push'](_0x4692a1['shift']());}};_0x128700(++_0x41f54f);}(_0x4606,0xf9));var _0x6460=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4606[_0x2dafbe];return _0x58a45a;};'use strict';var FaxInteractionEvents=require(_0x6460('0x0'));var events=[_0x6460('0x1'),'remove',_0x6460('0x2')];function createListener(_0x355881,_0x2e81b9){return function(_0x4e4eef){_0x2e81b9[_0x6460('0x3')](_0x355881,_0x4e4eef);};}function removeListener(_0x473567,_0x859fc){return function(){FaxInteractionEvents['removeListener'](_0x473567,_0x859fc);};}exports['register']=function(_0x583367){for(var _0x3805d7=0x0,_0x5540a2=events[_0x6460('0x4')];_0x3805d7<_0x5540a2;_0x3805d7++){var _0x142393=events[_0x3805d7];var _0x3071fb=createListener(_0x6460('0x5')+_0x142393,_0x583367);FaxInteractionEvents['on'](_0x142393,_0x3071fb);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 29ffa31..ca6a9c5 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 _0xdf10=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','post','addMessage','tracked','fax','faxinteraction:addtags','update','delete','faxinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x37cd68,_0x394d1f){var _0x3c3090=function(_0x5a2847){while(--_0x5a2847){_0x37cd68['push'](_0x37cd68['shift']());}};_0x3c3090(++_0x394d1f);}(_0xdf10,0x8c));var _0x0df1=function(_0x7df06a,_0x10ee7d){_0x7df06a=_0x7df06a-0x0;var _0x532abf=_0xdf10[_0x7df06a];return _0x532abf;};'use strict';var multer=require(_0x0df1('0x0'));var util=require(_0x0df1('0x1'));var path=require(_0x0df1('0x2'));var timeout=require(_0x0df1('0x3'));var express=require(_0x0df1('0x4'));var router=express['Router']();var fs_extra=require(_0x0df1('0x5'));var auth=require(_0x0df1('0x6'));var interaction=require(_0x0df1('0x7'));var config=require(_0x0df1('0x8'));var controller=require(_0x0df1('0x9'));router[_0x0df1('0xa')]('/',auth[_0x0df1('0xb')](),controller[_0x0df1('0xc')]);router[_0x0df1('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x0df1('0xd')]);router[_0x0df1('0xa')](_0x0df1('0xe'),auth[_0x0df1('0xb')](),controller[_0x0df1('0xf')]);router[_0x0df1('0xa')](_0x0df1('0x10'),auth[_0x0df1('0xb')](),controller['getMessages']);router['get'](_0x0df1('0x11'),auth[_0x0df1('0xb')](),controller['download']);router[_0x0df1('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0df1('0x12')](_0x0df1('0x10'),auth[_0x0df1('0xb')](),controller[_0x0df1('0x13')]);router[_0x0df1('0x12')]('/:id/tags',auth[_0x0df1('0xb')](),interaction[_0x0df1('0x14')](_0x0df1('0x15'),_0x0df1('0x16')),controller['addTags']);router['put'](_0x0df1('0xe'),auth[_0x0df1('0xb')](),interaction['tracked'](_0x0df1('0x15'),'faxinteraction:update'),controller[_0x0df1('0x17')]);router[_0x0df1('0x18')](_0x0df1('0xe'),auth['isAuthenticated'](),interaction[_0x0df1('0x14')](_0x0df1('0x15'),_0x0df1('0x19')),controller['destroy']);router[_0x0df1('0x18')](_0x0df1('0x1a'),auth[_0x0df1('0xb')](),controller[_0x0df1('0x1b')]);module[_0x0df1('0x1c')]=router; \ No newline at end of file +var _0x6135=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','multer'];(function(_0x36f899,_0x98a9ab){var _0xbbb5a9=function(_0x331fc2){while(--_0x331fc2){_0x36f899['push'](_0x36f899['shift']());}};_0xbbb5a9(++_0x98a9ab);}(_0x6135,0x18b));var _0x5613=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x6135[_0x1d6a82];return _0x5834ac;};'use strict';var multer=require(_0x5613('0x0'));var util=require(_0x5613('0x1'));var path=require(_0x5613('0x2'));var timeout=require(_0x5613('0x3'));var express=require(_0x5613('0x4'));var router=express['Router']();var fs_extra=require(_0x5613('0x5'));var auth=require(_0x5613('0x6'));var interaction=require(_0x5613('0x7'));var config=require(_0x5613('0x8'));var controller=require(_0x5613('0x9'));router['get']('/',auth[_0x5613('0xa')](),controller[_0x5613('0xb')]);router[_0x5613('0xc')](_0x5613('0xd'),auth[_0x5613('0xa')](),controller['describe']);router[_0x5613('0xc')](_0x5613('0xe'),auth[_0x5613('0xa')](),controller['show']);router['get'](_0x5613('0xf'),auth['isAuthenticated'](),controller[_0x5613('0x10')]);router[_0x5613('0xc')](_0x5613('0x11'),auth[_0x5613('0xa')](),controller[_0x5613('0x12')]);router['post']('/',auth[_0x5613('0xa')](),controller[_0x5613('0x13')]);router[_0x5613('0x14')]('/:id/messages',auth[_0x5613('0xa')](),controller[_0x5613('0x15')]);router[_0x5613('0x14')](_0x5613('0x16'),auth[_0x5613('0xa')](),interaction[_0x5613('0x17')](_0x5613('0x18'),'faxinteraction:addtags'),controller[_0x5613('0x19')]);router[_0x5613('0x1a')](_0x5613('0xe'),auth[_0x5613('0xa')](),interaction[_0x5613('0x17')](_0x5613('0x18'),_0x5613('0x1b')),controller[_0x5613('0x1c')]);router['delete'](_0x5613('0xe'),auth[_0x5613('0xa')](),interaction[_0x5613('0x17')]('fax',_0x5613('0x1d')),controller[_0x5613('0x1e')]);router[_0x5613('0x1f')](_0x5613('0x16'),auth['isAuthenticated'](),controller[_0x5613('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d4ac384..64ab88c 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 _0x684c=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x26effa,_0x205eff){var _0x2a747b=function(_0x33a521){while(--_0x33a521){_0x26effa['push'](_0x26effa['shift']());}};_0x2a747b(++_0x205eff);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc684('0x0'));module[_0xc684('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc684('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc684('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc684('0x4')]('in',_0xc684('0x5')),'defaultValue':_0xc684('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xc684('0x6')]}}; \ No newline at end of file +var _0xbe31=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x8147a8,_0x2da33f){var _0x4a00c1=function(_0x4a35a3){while(--_0x4a35a3){_0x8147a8['push'](_0x8147a8['shift']());}};_0x4a00c1(++_0x2da33f);}(_0xbe31,0x83));var _0x1be3=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xbe31[_0x54b062];return _0x255e41;};'use strict';var Sequelize=require('sequelize');module[_0x1be3('0x0')]={'body':{'type':Sequelize[_0x1be3('0x1')](_0x1be3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1be3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1be3('0x4')]('in',_0x1be3('0x5')),'defaultValue':_0x1be3('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1be3('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1be3('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2982afc..5549204 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 _0xc5df=['find','body','describe','fax-interactions','accept','fax','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','Sequelize','interface','rejectmessage','CmContact','findOne','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','attachments','Attachment','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','http','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','intersection','include'];(function(_0x5dbb08,_0x34050e){var _0x10acdd=function(_0x22a538){while(--_0x22a538){_0x5dbb08['push'](_0x5dbb08['shift']());}};_0x10acdd(++_0x34050e);}(_0xc5df,0x14d));var _0xfc5d=function(_0x3d8c62,_0x107316){_0x3d8c62=_0x3d8c62-0x0;var _0x31deec=_0xc5df[_0x3d8c62];return _0x31deec;};'use strict';var emlformat=require(_0xfc5d('0x0'));var rimraf=require(_0xfc5d('0x1'));var zipdir=require(_0xfc5d('0x2'));var jsonpatch=require(_0xfc5d('0x3'));var rp=require(_0xfc5d('0x4'));var moment=require(_0xfc5d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfc5d('0x6'));var util=require(_0xfc5d('0x7'));var path=require('path');var sox=require(_0xfc5d('0x8'));var csv=require(_0xfc5d('0x9'));var ejs=require(_0xfc5d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc5d('0xb'));var crypto=require(_0xfc5d('0xc'));var jsforce=require(_0xfc5d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfc5d('0x9'));var querystring=require(_0xfc5d('0xe'));var Papa=require(_0xfc5d('0xf'));var Redis=require(_0xfc5d('0x10'));var authService=require(_0xfc5d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfc5d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc5d('0x13'))(_0xfc5d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfc5d('0x15'))['db'];config[_0xfc5d('0x16')]=_['defaults'](config[_0xfc5d('0x16')],{'host':_0xfc5d('0x17'),'port':0x18eb});var socket=require(_0xfc5d('0x18'))(new Redis(config[_0xfc5d('0x16')]));require('./faxMessage.socket')[_0xfc5d('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfc5d('0x1a')]({'port':0x232c});var client9002=jayson[_0xfc5d('0x1b')][_0xfc5d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x30035b,_0x2bfeeb,_0x5736d3,_0x2399f4){return new BPromise(function(_0x45445d,_0x1e52a4){var _0x7f857b=_0x2399f4||client;return _0x7f857b[_0xfc5d('0x1c')](_0x30035b,_0x5736d3)['then'](function(_0x438cff){logger[_0xfc5d('0x1d')](_0xfc5d('0x1e'),_0x2bfeeb,_0xfc5d('0x1f'));logger[_0xfc5d('0x20')](_0xfc5d('0x21'),_0x2bfeeb,_0xfc5d('0x1f'),JSON['stringify'](_0x438cff));if(_0x438cff[_0xfc5d('0x22')]){if(_0x438cff[_0xfc5d('0x22')][_0xfc5d('0x23')]===0x1f4){logger[_0xfc5d('0x22')](_0xfc5d('0x1e'),_0x2bfeeb,_0x438cff[_0xfc5d('0x22')][_0xfc5d('0x24')]);return _0x1e52a4(_0x438cff[_0xfc5d('0x22')]['message']);}logger[_0xfc5d('0x22')]('FaxMessage,\x20%s,\x20%s',_0x2bfeeb,_0x438cff[_0xfc5d('0x22')]['message']);return _0x45445d(_0x438cff[_0xfc5d('0x22')][_0xfc5d('0x24')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x2bfeeb,_0xfc5d('0x1f'));_0x45445d(_0x438cff['result'][_0xfc5d('0x24')]);}})[_0xfc5d('0x25')](function(_0x57d1ea){logger[_0xfc5d('0x22')](_0xfc5d('0x1e'),_0x2bfeeb,_0x57d1ea);_0x1e52a4(_0x57d1ea);});});}function respondWithStatusCode(_0x2c4e2c,_0x185634){_0x185634=_0x185634||0xcc;return function(_0x15152e){if(_0x15152e){return _0x2c4e2c[_0xfc5d('0x26')](_0x185634);}return _0x2c4e2c[_0xfc5d('0x27')](_0x185634)[_0xfc5d('0x28')]();};}function respondWithResult(_0x3ed8e5,_0x2a8460){_0x2a8460=_0x2a8460||0xc8;return function(_0x18a64e){if(_0x18a64e){return _0x3ed8e5[_0xfc5d('0x27')](_0x2a8460)[_0xfc5d('0x29')](_0x18a64e);}};}function respondWithFilteredResult(_0x580e88,_0xc4bc6e){return function(_0x46800c){if(_0x46800c){var _0x5c31fa=typeof _0xc4bc6e['offset']===_0xfc5d('0x2a')&&typeof _0xc4bc6e[_0xfc5d('0x2b')]===_0xfc5d('0x2a');var _0x404703=_0x46800c[_0xfc5d('0x2c')];var _0xc4ba8f=_0x5c31fa?0x0:_0xc4bc6e[_0xfc5d('0x2d')];var _0x4c1d43=_0x5c31fa?_0x46800c[_0xfc5d('0x2c')]:_0xc4bc6e[_0xfc5d('0x2d')]+_0xc4bc6e['limit'];var _0x45a710;if(_0x4c1d43>=_0x404703){_0x4c1d43=_0x404703;_0x45a710=0xc8;}else{_0x45a710=0xce;}_0x580e88[_0xfc5d('0x27')](_0x45a710);return _0x580e88[_0xfc5d('0x2e')](_0xfc5d('0x2f'),_0xc4ba8f+'-'+_0x4c1d43+'/'+_0x404703)[_0xfc5d('0x29')](_0x46800c);}return null;};}function patchUpdates(_0x2ae3cd){return function(_0xda7ce){try{jsonpatch['apply'](_0xda7ce,_0x2ae3cd,!![]);}catch(_0x5180d5){return BPromise[_0xfc5d('0x30')](_0x5180d5);}return _0xda7ce[_0xfc5d('0x31')]();};}function saveUpdates(_0x5dfcac,_0xcf8b58){return function(_0xeffe74){if(_0xeffe74){return _0xeffe74[_0xfc5d('0x32')](_0x5dfcac)[_0xfc5d('0x33')](function(_0x14249b){return _0x14249b;});}return null;};}function removeEntity(_0x252245,_0xe85219){return function(_0xcad453){if(_0xcad453){return _0xcad453[_0xfc5d('0x34')]()[_0xfc5d('0x33')](function(){_0x252245[_0xfc5d('0x27')](0xcc)[_0xfc5d('0x28')]();});}};}function handleEntityNotFound(_0x11dfa1,_0x501251){return function(_0xc9bd84){if(!_0xc9bd84){_0x11dfa1['sendStatus'](0x194);}return _0xc9bd84;};}function handleError(_0xc88154,_0x5cb887){_0x5cb887=_0x5cb887||0x1f4;return function(_0x13cbfa){logger[_0xfc5d('0x22')](_0x13cbfa[_0xfc5d('0x35')]);if(_0x13cbfa[_0xfc5d('0x36')]){delete _0x13cbfa[_0xfc5d('0x36')];}_0xc88154[_0xfc5d('0x27')](_0x5cb887)['send'](_0x13cbfa);};}exports[_0xfc5d('0x37')]=function(_0x53c37c,_0x597a76){var _0x235f13={},_0x316a5c={},_0x55b6cc={'count':0x0,'rows':[]};var _0x430a67=_[_0xfc5d('0x38')](db[_0xfc5d('0x39')][_0xfc5d('0x3a')],function(_0x367d1b){return{'name':_0x367d1b[_0xfc5d('0x3b')],'type':_0x367d1b[_0xfc5d('0x3c')]['key']};});_0x316a5c['model']=_[_0xfc5d('0x38')](_0x430a67,_0xfc5d('0x36'));_0x316a5c[_0xfc5d('0x3d')]=_['keys'](_0x53c37c[_0xfc5d('0x3d')]);_0x316a5c[_0xfc5d('0x3e')]=_['intersection'](_0x316a5c[_0xfc5d('0x3f')],_0x316a5c['query']);_0x235f13[_0xfc5d('0x40')]=_['intersection'](_0x316a5c['model'],qs[_0xfc5d('0x41')](_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x41')]));_0x235f13[_0xfc5d('0x40')]=_0x235f13[_0xfc5d('0x40')]['length']?_0x235f13['attributes']:_0x316a5c[_0xfc5d('0x3f')];if(!_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x42')](_0xfc5d('0x43'))){_0x235f13[_0xfc5d('0x2b')]=qs[_0xfc5d('0x2b')](_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x2b')]);_0x235f13[_0xfc5d('0x2d')]=qs['offset'](_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x2d')]);}_0x235f13[_0xfc5d('0x44')]=qs[_0xfc5d('0x45')](_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x45')]);_0x235f13[_0xfc5d('0x46')]=qs['filters'](_[_0xfc5d('0x47')](_0x53c37c[_0xfc5d('0x3d')],_0x316a5c[_0xfc5d('0x3e')]),_0x430a67);if(_0x53c37c['query'][_0xfc5d('0x48')]){_0x235f13[_0xfc5d('0x46')]=_[_0xfc5d('0x49')](_0x235f13[_0xfc5d('0x46')],{'$or':_[_0xfc5d('0x38')](_0x430a67,function(_0x385b67){if(_0x385b67[_0xfc5d('0x3c')]!==_0xfc5d('0x4a')){var _0x4c6000={};_0x4c6000[_0x385b67[_0xfc5d('0x36')]]={'$like':'%'+_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x48')]+'%'};return _0x4c6000;}})});}_0x235f13=_[_0xfc5d('0x49')]({},_0x235f13,_0x53c37c[_0xfc5d('0x4b')]);var _0x2c29a6={'where':_0x235f13[_0xfc5d('0x46')]};return db['FaxMessage'][_0xfc5d('0x2c')](_0x2c29a6)['then'](function(_0x542173){_0x55b6cc[_0xfc5d('0x2c')]=_0x542173;if(_0x53c37c[_0xfc5d('0x3d')][_0xfc5d('0x4c')]){_0x235f13['include']=[{'all':!![]}];}return db[_0xfc5d('0x39')][_0xfc5d('0x4d')](_0x235f13);})['then'](function(_0x2f4682){_0x55b6cc[_0xfc5d('0x4e')]=_0x2f4682;return _0x55b6cc;})[_0xfc5d('0x33')](respondWithFilteredResult(_0x597a76,_0x235f13))[_0xfc5d('0x25')](handleError(_0x597a76,null));};exports[_0xfc5d('0x4f')]=function(_0x5166af,_0x10f031){var _0x4bf918={'raw':!![],'where':{'id':_0x5166af[_0xfc5d('0x50')]['id']}},_0x539ec5={};_0x539ec5[_0xfc5d('0x3f')]=_[_0xfc5d('0x51')](db[_0xfc5d('0x39')][_0xfc5d('0x3a')]);_0x539ec5[_0xfc5d('0x3d')]=_[_0xfc5d('0x51')](_0x5166af[_0xfc5d('0x3d')]);_0x539ec5[_0xfc5d('0x3e')]=_[_0xfc5d('0x52')](_0x539ec5[_0xfc5d('0x3f')],_0x539ec5[_0xfc5d('0x3d')]);_0x4bf918['attributes']=_[_0xfc5d('0x52')](_0x539ec5[_0xfc5d('0x3f')],qs[_0xfc5d('0x41')](_0x5166af['query'][_0xfc5d('0x41')]));_0x4bf918[_0xfc5d('0x40')]=_0x4bf918[_0xfc5d('0x40')]['length']?_0x4bf918['attributes']:_0x539ec5[_0xfc5d('0x3f')];if(_0x5166af[_0xfc5d('0x3d')]['includeAll']){_0x4bf918[_0xfc5d('0x53')]=[{'all':!![]}];}_0x4bf918=_[_0xfc5d('0x49')]({},_0x4bf918,_0x5166af[_0xfc5d('0x4b')]);return db[_0xfc5d('0x39')][_0xfc5d('0x54')](_0x4bf918)[_0xfc5d('0x33')](handleEntityNotFound(_0x10f031,null))[_0xfc5d('0x33')](respondWithResult(_0x10f031,null))['catch'](handleError(_0x10f031,null));};exports[_0xfc5d('0x32')]=function(_0x119e07,_0x18495a){if(_0x119e07[_0xfc5d('0x55')]['id']){delete _0x119e07[_0xfc5d('0x55')]['id'];}return db[_0xfc5d('0x39')][_0xfc5d('0x54')]({'where':{'id':_0x119e07[_0xfc5d('0x50')]['id']}})['then'](handleEntityNotFound(_0x18495a,null))[_0xfc5d('0x33')](saveUpdates(_0x119e07[_0xfc5d('0x55')],null))[_0xfc5d('0x33')](respondWithResult(_0x18495a,null))['catch'](handleError(_0x18495a,null));};exports[_0xfc5d('0x34')]=function(_0x2af663,_0x20125a){return db[_0xfc5d('0x39')][_0xfc5d('0x54')]({'where':{'id':_0x2af663['params']['id']}})[_0xfc5d('0x33')](handleEntityNotFound(_0x20125a,null))[_0xfc5d('0x33')](removeEntity(_0x20125a,null))[_0xfc5d('0x25')](handleError(_0x20125a,null));};exports[_0xfc5d('0x56')]=function(_0x3afb0b,_0x134eb6){return db[_0xfc5d('0x39')][_0xfc5d('0x56')]()[_0xfc5d('0x33')](respondWithResult(_0x134eb6,null))[_0xfc5d('0x25')](handleError(_0x134eb6,null));};var interaction_log=require(_0xfc5d('0x13'))(_0xfc5d('0x57'));exports[_0xfc5d('0x58')]=function(_0x53335a,_0x488ef9,_0x46b0df){var _0x3f7d42={'agent':{},'channel':_0xfc5d('0x59')};if(_0x53335a[_0xfc5d('0x55')]['id']){delete _0x53335a['body']['id'];}_0x53335a[_0xfc5d('0x55')]['read']=!![];_0x53335a[_0xfc5d('0x55')]['readAt']=moment()[_0xfc5d('0x5a')](_0xfc5d('0x5b'));_0x53335a[_0xfc5d('0x55')][_0xfc5d('0x5c')]=_0x53335a['body']['UserId']||_0x53335a['user']['id'];_0x3f7d42[_0xfc5d('0x5d')]['id']=_0x53335a['body'][_0xfc5d('0x5c')];return db[_0xfc5d('0x39')]['find']({'where':{'id':_0x53335a[_0xfc5d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x488ef9,null))[_0xfc5d('0x33')](saveUpdates(_0x53335a[_0xfc5d('0x55')],null))[_0xfc5d('0x33')](function(_0x379300){if(_0x379300){_0x3f7d42[_0xfc5d('0x24')]=_0x379300[_0xfc5d('0x5e')]({'plain':!![]});return db[_0xfc5d('0x5f')][_0xfc5d('0x54')]({'where':{'id':_0x379300[_0xfc5d('0x60')]}});}return null;})[_0xfc5d('0x33')](handleEntityNotFound(_0x488ef9,null))[_0xfc5d('0x33')](function(_0x2b50b4){if(_0x2b50b4){return _0x2b50b4[_0xfc5d('0x32')]({'UserId':_0x53335a[_0xfc5d('0x55')][_0xfc5d('0x5c')],'read1stAt':_[_0xfc5d('0x61')](_0x2b50b4['read1stAt'])?moment()[_0xfc5d('0x5a')](_0xfc5d('0x5b')):undefined});}return null;})[_0xfc5d('0x33')](function(_0x4e4b6b){if(_0x4e4b6b){_0x3f7d42[_0xfc5d('0x62')]=_0x4e4b6b[_0xfc5d('0x5e')]({'plain':!![]});interaction_log[_0xfc5d('0x1d')](_0xfc5d('0x63'),_0x53335a[_0xfc5d('0x64')]['id'],_0x53335a['user'][_0xfc5d('0x36')],_0x53335a[_0xfc5d('0x64')][_0xfc5d('0x65')],_0x3f7d42[_0xfc5d('0x62')]['id'],_0x53335a[_0xfc5d('0x55')]?JSON[_0xfc5d('0x66')](_0x53335a[_0xfc5d('0x55')]):'null');return respondWithRpcPromise(_0xfc5d('0x67'),_0xfc5d('0x68'),_0x3f7d42);}return null;})[_0xfc5d('0x33')](function(_0x4e1890){var _0x5460f6=_0xfc5d('0x69')+_0x4e1890[_0xfc5d('0x24')]['ContactId'];return db[_0xfc5d('0x6a')]['query'](_0x5460f6,{'type':db['Sequelize'][_0xfc5d('0x6b')][_0xfc5d('0x6c')],'raw':!![]})[_0xfc5d('0x33')](function(_0x293d78){return _0x293d78;});})[_0xfc5d('0x33')](function(_0x2dd74b){if(_0x2dd74b){_0x3f7d42[_0xfc5d('0x24')]['contact']=_0x2dd74b[0x0];if(!_0x53335a[_0xfc5d('0x55')][_0xfc5d('0x5c')])return;return db[_0xfc5d('0x6d')][_0xfc5d('0x54')]({'where':{'id':_0x53335a['body'][_0xfc5d('0x5c')],'role':_0xfc5d('0x5d')},'attributes':['id',_0xfc5d('0x36'),_0xfc5d('0x6e'),_0xfc5d('0x6f'),'internal'],'raw':!![]});}return null;})[_0xfc5d('0x33')](function(_0xe8078b){if(!_0xe8078b)return null;_0x3f7d42[_0xfc5d('0x24')][_0xfc5d('0x5d')]=_0xe8078b;return _0x3f7d42;})[_0xfc5d('0x33')](function(_0x2b46ad){if(_0x2b46ad){if(_0x53335a[_0xfc5d('0x55')][_0xfc5d('0x70')]){_0x3f7d42[_0xfc5d('0x24')]['interface']=util['format'](_0xfc5d('0x71'),_0x53335a[_0xfc5d('0x64')][_0xfc5d('0x36')]);_0x3f7d42['message'][_0xfc5d('0x72')]=_0x3f7d42[_0xfc5d('0x72')];_0x3f7d42[_0xfc5d('0x24')][_0xfc5d('0x73')]=_0x3f7d42['channel'];_0x3f7d42[_0xfc5d('0x24')][_0xfc5d('0x74')]=_0xfc5d('0x58');return respondWithRpcPromise('EventManager',_0xfc5d('0x75'),{'event':_0xfc5d('0x76'),'message':_0x3f7d42[_0xfc5d('0x24')]},client9002)[_0xfc5d('0x33')](function(){return _0x3f7d42;});}return _0x3f7d42;}return null;})[_0xfc5d('0x33')](respondWithResult(_0x488ef9,null))[_0xfc5d('0x25')](handleError(_0x488ef9,null));};var interaction_log=require(_0xfc5d('0x13'))(_0xfc5d('0x57'));exports[_0xfc5d('0x30')]=function(_0x1efcb0,_0x4d92ef,_0x58890a){var _0x2a8165={'agent':{},'channel':'fax'};if(_0x1efcb0['body']['id']){delete _0x1efcb0[_0xfc5d('0x55')]['id'];}_0x1efcb0[_0xfc5d('0x55')][_0xfc5d('0x5c')]=_0x1efcb0[_0xfc5d('0x55')][_0xfc5d('0x5c')]||_0x1efcb0['user']['id'];_0x2a8165['agent']['id']=_0x1efcb0[_0xfc5d('0x55')][_0xfc5d('0x5c')];return db[_0xfc5d('0x39')]['find']({'where':{'id':_0x1efcb0[_0xfc5d('0x50')]['id'],'UserId':null}})[_0xfc5d('0x33')](handleEntityNotFound(_0x4d92ef,null))[_0xfc5d('0x33')](function(_0x3bedfe){if(_0x3bedfe){_0x2a8165[_0xfc5d('0x24')]=_0x3bedfe['get']({'plain':!![]});return db[_0xfc5d('0x5f')][_0xfc5d('0x54')]({'where':{'id':_0x3bedfe[_0xfc5d('0x60')]}});}return null;})[_0xfc5d('0x33')](handleEntityNotFound(_0x4d92ef,null))[_0xfc5d('0x33')](function(_0x58b054){if(_0x58b054){_0x2a8165[_0xfc5d('0x62')]=_0x58b054[_0xfc5d('0x5e')]({'plain':!![]});interaction_log['info'](_0xfc5d('0x77'),_0x1efcb0[_0xfc5d('0x64')]['id'],_0x1efcb0[_0xfc5d('0x64')][_0xfc5d('0x36')],_0x1efcb0[_0xfc5d('0x64')][_0xfc5d('0x65')],_0x2a8165['interaction']['id'],_0x1efcb0[_0xfc5d('0x55')]?JSON['stringify'](_0x1efcb0[_0xfc5d('0x55')]):_0xfc5d('0x78'));return respondWithRpcPromise(_0xfc5d('0x79'),_0xfc5d('0x7a'),_0x2a8165);}return null;})[_0xfc5d('0x33')](function(_0x2b1939){var _0x9b8c65=_0xfc5d('0x69')+_0x2b1939[_0xfc5d('0x24')][_0xfc5d('0x7b')];return db['sequelize'][_0xfc5d('0x3d')](_0x9b8c65,{'type':db[_0xfc5d('0x7c')][_0xfc5d('0x6b')][_0xfc5d('0x6c')],'raw':!![]})[_0xfc5d('0x33')](function(_0x43765c){return _0x43765c;});})[_0xfc5d('0x33')](function(_0x5e597a){if(_0x5e597a){_0x2a8165['message']['contact']=_0x5e597a[0x0];if(!_0x1efcb0['body'][_0xfc5d('0x5c')])return;return db[_0xfc5d('0x6d')][_0xfc5d('0x54')]({'where':{'id':_0x1efcb0[_0xfc5d('0x55')]['UserId'],'role':_0xfc5d('0x5d')},'attributes':['id',_0xfc5d('0x36'),_0xfc5d('0x6e'),_0xfc5d('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5e9664){if(!_0x5e9664)return null;_0x2a8165[_0xfc5d('0x24')][_0xfc5d('0x5d')]=_0x5e9664;return _0x2a8165;})['then'](function(_0x5f3132){if(_0x5f3132){_0x5f3132[_0xfc5d('0x24')][_0xfc5d('0x7d')]=util['format']('SIP/%s',_0x1efcb0[_0xfc5d('0x64')][_0xfc5d('0x36')]);_0x5f3132[_0xfc5d('0x24')]['channel']=_0x2a8165['channel'];_0x5f3132['message'][_0xfc5d('0x73')]=_0x2a8165[_0xfc5d('0x72')];_0x5f3132[_0xfc5d('0x24')][_0xfc5d('0x74')]=_0xfc5d('0x30');respondWithRpcPromise(_0xfc5d('0x75'),'EventManager',{'event':_0xfc5d('0x7e'),'message':_0x5f3132[_0xfc5d('0x24')]},client9002);return _0x2a8165;}return null;})[_0xfc5d('0x33')](respondWithResult(_0x4d92ef,null))[_0xfc5d('0x25')](handleError(_0x4d92ef,null));};exports['create']=function(_0x17beb9,_0x332240){var _0x36a2a1;return db[_0xfc5d('0x39')]['create'](_0x17beb9[_0xfc5d('0x55')],{})[_0xfc5d('0x33')](function(_0x38e14c){_0x36a2a1=_0x38e14c;return db[_0xfc5d('0x7f')][_0xfc5d('0x80')]({'where':{'id':_0x36a2a1[_0xfc5d('0x7b')]}});})[_0xfc5d('0x33')](function(_0x28e20e){if(_[_0xfc5d('0x61')](_0x28e20e)){return;}else{_0x36a2a1['fax']=_0x28e20e[_0xfc5d('0x59')];return db['Attachment'][_0xfc5d('0x80')]({'where':{'id':_0x36a2a1['AttachmentId']}});}})[_0xfc5d('0x33')](function(_0x3937f5){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xfc5d('0x61')](_0x17beb9[_0xfc5d('0x55')])?undefined:_0x17beb9[_0xfc5d('0x55')][_0xfc5d('0x81')],'path':_['isNil'](_0x3937f5)?undefined:util[_0xfc5d('0x5a')](_0xfc5d('0x82'),_0x3937f5['basename']),'fax':_['isNil'](_0x36a2a1[_0xfc5d('0x59')])?undefined:_0x36a2a1['fax'],'AttachmentId':_0x36a2a1[_0xfc5d('0x83')]},client9002);})['then'](respondWithResult(_0x332240,0xc9))['catch'](handleError(_0x332240,null));};exports[_0xfc5d('0x84')]=function(_0x9888f5,_0x2a624c){var _0x21d003=path[_0xfc5d('0x85')](config[_0xfc5d('0x86')],_0xfc5d('0x87'),'files',_0xfc5d('0x88'));return db[_0xfc5d('0x39')][_0xfc5d('0x54')]({'where':{'id':_0x9888f5[_0xfc5d('0x50')]['id']},'include':[{'model':db[_0xfc5d('0x89')],'as':_0xfc5d('0x89')}]})['then'](handleEntityNotFound(_0x2a624c,null))[_0xfc5d('0x33')](function(_0xd608de){if(_0xd608de){return _0x2a624c[_0xfc5d('0x84')](path[_0xfc5d('0x85')](_0x21d003,_0xd608de[_0xfc5d('0x89')][_0xfc5d('0x8a')]));}})[_0xfc5d('0x25')](handleError(_0x2a624c,null));}; \ No newline at end of file +var _0xf15f=['channel','motionChannel','event','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','interface','rejectmessage','create','findOne','isNil','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','attachments','Attachment','join','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','info','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','FaxMessage','include','rows','show','params','keys','includeAll','options','find','body','describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','email','internal','agent','SIP/%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf15f,0x138));var _0xff15=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf15f[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xff15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff15('0x1'));var jsonpatch=require(_0xff15('0x2'));var rp=require('request-promise');var moment=require(_0xff15('0x3'));var BPromise=require(_0xff15('0x4'));var Mustache=require('mustache');var util=require(_0xff15('0x5'));var path=require(_0xff15('0x6'));var sox=require('sox');var csv=require(_0xff15('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff15('0x8'));var _=require('lodash');var squel=require(_0xff15('0x9'));var crypto=require(_0xff15('0xa'));var jsforce=require(_0xff15('0xb'));var deskjs=require(_0xff15('0xc'));var toCsv=require(_0xff15('0x7'));var querystring=require(_0xff15('0xd'));var Papa=require(_0xff15('0xe'));var Redis=require(_0xff15('0xf'));var authService=require(_0xff15('0x10'));var qs=require(_0xff15('0x11'));var as=require(_0xff15('0x12'));var hardwareService=require(_0xff15('0x13'));var logger=require(_0xff15('0x14'))(_0xff15('0x15'));var utils=require(_0xff15('0x16'));var config=require(_0xff15('0x17'));var licenseUtil=require(_0xff15('0x18'));var db=require('../../mysqldb')['db'];config[_0xff15('0x19')]=_['defaults'](config[_0xff15('0x19')],{'host':_0xff15('0x1a'),'port':0x18eb});var socket=require(_0xff15('0x1b'))(new Redis(config['redis']));require(_0xff15('0x1c'))[_0xff15('0x1d')](socket);var jayson=require(_0xff15('0x1e'));var client=jayson[_0xff15('0x1f')][_0xff15('0x20')]({'port':0x232c});var client9002=jayson[_0xff15('0x1f')][_0xff15('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x26a98e,_0x16c7ee,_0x250858,_0x45047a){return new BPromise(function(_0x4384ca,_0x29634a){var _0x3772b1=_0x45047a||client;return _0x3772b1[_0xff15('0x21')](_0x26a98e,_0x250858)[_0xff15('0x22')](function(_0x531931){logger['info']('FaxMessage,\x20%s,\x20%s',_0x16c7ee,_0xff15('0x23'));logger[_0xff15('0x24')](_0xff15('0x25'),_0x16c7ee,_0xff15('0x23'),JSON[_0xff15('0x26')](_0x531931));if(_0x531931[_0xff15('0x27')]){if(_0x531931[_0xff15('0x27')]['code']===0x1f4){logger[_0xff15('0x27')](_0xff15('0x28'),_0x16c7ee,_0x531931['error'][_0xff15('0x29')]);return _0x29634a(_0x531931[_0xff15('0x27')][_0xff15('0x29')]);}logger[_0xff15('0x27')](_0xff15('0x28'),_0x16c7ee,_0x531931[_0xff15('0x27')][_0xff15('0x29')]);return _0x4384ca(_0x531931[_0xff15('0x27')][_0xff15('0x29')]);}else{logger[_0xff15('0x2a')](_0xff15('0x28'),_0x16c7ee,_0xff15('0x23'));_0x4384ca(_0x531931['result'][_0xff15('0x29')]);}})[_0xff15('0x2b')](function(_0x2d2940){logger['error']('FaxMessage,\x20%s,\x20%s',_0x16c7ee,_0x2d2940);_0x29634a(_0x2d2940);});});}function respondWithStatusCode(_0x56f64c,_0x37386a){_0x37386a=_0x37386a||0xcc;return function(_0x3e6e1d){if(_0x3e6e1d){return _0x56f64c['sendStatus'](_0x37386a);}return _0x56f64c[_0xff15('0x2c')](_0x37386a)['end']();};}function respondWithResult(_0x24e92e,_0x1fd82d){_0x1fd82d=_0x1fd82d||0xc8;return function(_0xcaf0f2){if(_0xcaf0f2){return _0x24e92e[_0xff15('0x2c')](_0x1fd82d)[_0xff15('0x2d')](_0xcaf0f2);}};}function respondWithFilteredResult(_0x230dbe,_0x521a14){return function(_0x1fa40f){if(_0x1fa40f){var _0x5d0671=typeof _0x521a14[_0xff15('0x2e')]===_0xff15('0x2f')&&typeof _0x521a14[_0xff15('0x30')]===_0xff15('0x2f');var _0x1bff02=_0x1fa40f[_0xff15('0x31')];var _0x27a5ec=_0x5d0671?0x0:_0x521a14[_0xff15('0x2e')];var _0x406991=_0x5d0671?_0x1fa40f[_0xff15('0x31')]:_0x521a14['offset']+_0x521a14[_0xff15('0x30')];var _0x54faa6;if(_0x406991>=_0x1bff02){_0x406991=_0x1bff02;_0x54faa6=0xc8;}else{_0x54faa6=0xce;}_0x230dbe['status'](_0x54faa6);return _0x230dbe[_0xff15('0x32')](_0xff15('0x33'),_0x27a5ec+'-'+_0x406991+'/'+_0x1bff02)[_0xff15('0x2d')](_0x1fa40f);}return null;};}function patchUpdates(_0x3d62ff){return function(_0x394f59){try{jsonpatch['apply'](_0x394f59,_0x3d62ff,!![]);}catch(_0x3f3a72){return BPromise[_0xff15('0x34')](_0x3f3a72);}return _0x394f59[_0xff15('0x35')]();};}function saveUpdates(_0x2d347c,_0x3ada94){return function(_0x3d0c08){if(_0x3d0c08){return _0x3d0c08[_0xff15('0x36')](_0x2d347c)[_0xff15('0x22')](function(_0x5aa874){return _0x5aa874;});}return null;};}function removeEntity(_0x53dc84,_0xdfc5f6){return function(_0x4b8701){if(_0x4b8701){return _0x4b8701[_0xff15('0x37')]()['then'](function(){_0x53dc84[_0xff15('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47aa0a,_0x1bbd72){return function(_0x331fb6){if(!_0x331fb6){_0x47aa0a[_0xff15('0x38')](0x194);}return _0x331fb6;};}function handleError(_0x15cab5,_0x4401eb){_0x4401eb=_0x4401eb||0x1f4;return function(_0x4c4bc2){logger[_0xff15('0x27')](_0x4c4bc2[_0xff15('0x39')]);if(_0x4c4bc2['name']){delete _0x4c4bc2[_0xff15('0x3a')];}_0x15cab5[_0xff15('0x2c')](_0x4401eb)['send'](_0x4c4bc2);};}exports[_0xff15('0x3b')]=function(_0x176571,_0x38d168){var _0x373707={},_0x4ddfd2={},_0x56e152={'count':0x0,'rows':[]};var _0x47f2c6=_[_0xff15('0x3c')](db['FaxMessage'][_0xff15('0x3d')],function(_0x59efab){return{'name':_0x59efab[_0xff15('0x3e')],'type':_0x59efab[_0xff15('0x3f')]['key']};});_0x4ddfd2[_0xff15('0x40')]=_[_0xff15('0x3c')](_0x47f2c6,'name');_0x4ddfd2['query']=_['keys'](_0x176571['query']);_0x4ddfd2[_0xff15('0x41')]=_[_0xff15('0x42')](_0x4ddfd2[_0xff15('0x40')],_0x4ddfd2[_0xff15('0x43')]);_0x373707['attributes']=_[_0xff15('0x42')](_0x4ddfd2[_0xff15('0x40')],qs[_0xff15('0x44')](_0x176571[_0xff15('0x43')][_0xff15('0x44')]));_0x373707['attributes']=_0x373707[_0xff15('0x45')][_0xff15('0x46')]?_0x373707['attributes']:_0x4ddfd2[_0xff15('0x40')];if(!_0x176571[_0xff15('0x43')][_0xff15('0x47')](_0xff15('0x48'))){_0x373707[_0xff15('0x30')]=qs[_0xff15('0x30')](_0x176571[_0xff15('0x43')][_0xff15('0x30')]);_0x373707[_0xff15('0x2e')]=qs[_0xff15('0x2e')](_0x176571['query'][_0xff15('0x2e')]);}_0x373707[_0xff15('0x49')]=qs[_0xff15('0x4a')](_0x176571[_0xff15('0x43')][_0xff15('0x4a')]);_0x373707[_0xff15('0x4b')]=qs['filters'](_['pick'](_0x176571['query'],_0x4ddfd2[_0xff15('0x41')]),_0x47f2c6);if(_0x176571[_0xff15('0x43')][_0xff15('0x4c')]){_0x373707[_0xff15('0x4b')]=_[_0xff15('0x4d')](_0x373707[_0xff15('0x4b')],{'$or':_['map'](_0x47f2c6,function(_0x485235){if(_0x485235[_0xff15('0x3f')]!=='VIRTUAL'){var _0x43d6cd={};_0x43d6cd[_0x485235[_0xff15('0x3a')]]={'$like':'%'+_0x176571[_0xff15('0x43')]['filter']+'%'};return _0x43d6cd;}})});}_0x373707=_[_0xff15('0x4d')]({},_0x373707,_0x176571['options']);var _0x289554={'where':_0x373707[_0xff15('0x4b')]};return db[_0xff15('0x4e')][_0xff15('0x31')](_0x289554)[_0xff15('0x22')](function(_0x58fc11){_0x56e152[_0xff15('0x31')]=_0x58fc11;if(_0x176571[_0xff15('0x43')]['includeAll']){_0x373707[_0xff15('0x4f')]=[{'all':!![]}];}return db[_0xff15('0x4e')]['findAll'](_0x373707);})[_0xff15('0x22')](function(_0x3f0090){_0x56e152[_0xff15('0x50')]=_0x3f0090;return _0x56e152;})[_0xff15('0x22')](respondWithFilteredResult(_0x38d168,_0x373707))[_0xff15('0x2b')](handleError(_0x38d168,null));};exports[_0xff15('0x51')]=function(_0x309c8e,_0x5550e0){var _0x9b06e1={'raw':!![],'where':{'id':_0x309c8e[_0xff15('0x52')]['id']}},_0x3d7559={};_0x3d7559[_0xff15('0x40')]=_['keys'](db[_0xff15('0x4e')][_0xff15('0x3d')]);_0x3d7559['query']=_[_0xff15('0x53')](_0x309c8e[_0xff15('0x43')]);_0x3d7559[_0xff15('0x41')]=_[_0xff15('0x42')](_0x3d7559[_0xff15('0x40')],_0x3d7559[_0xff15('0x43')]);_0x9b06e1[_0xff15('0x45')]=_[_0xff15('0x42')](_0x3d7559[_0xff15('0x40')],qs[_0xff15('0x44')](_0x309c8e['query'][_0xff15('0x44')]));_0x9b06e1['attributes']=_0x9b06e1[_0xff15('0x45')][_0xff15('0x46')]?_0x9b06e1[_0xff15('0x45')]:_0x3d7559['model'];if(_0x309c8e[_0xff15('0x43')][_0xff15('0x54')]){_0x9b06e1[_0xff15('0x4f')]=[{'all':!![]}];}_0x9b06e1=_[_0xff15('0x4d')]({},_0x9b06e1,_0x309c8e[_0xff15('0x55')]);return db[_0xff15('0x4e')][_0xff15('0x56')](_0x9b06e1)[_0xff15('0x22')](handleEntityNotFound(_0x5550e0,null))[_0xff15('0x22')](respondWithResult(_0x5550e0,null))[_0xff15('0x2b')](handleError(_0x5550e0,null));};exports[_0xff15('0x36')]=function(_0x3f792b,_0x312e23){if(_0x3f792b[_0xff15('0x57')]['id']){delete _0x3f792b[_0xff15('0x57')]['id'];}return db[_0xff15('0x4e')]['find']({'where':{'id':_0x3f792b['params']['id']}})['then'](handleEntityNotFound(_0x312e23,null))[_0xff15('0x22')](saveUpdates(_0x3f792b[_0xff15('0x57')],null))[_0xff15('0x22')](respondWithResult(_0x312e23,null))[_0xff15('0x2b')](handleError(_0x312e23,null));};exports[_0xff15('0x37')]=function(_0xfd5194,_0x14399a){return db[_0xff15('0x4e')]['find']({'where':{'id':_0xfd5194[_0xff15('0x52')]['id']}})[_0xff15('0x22')](handleEntityNotFound(_0x14399a,null))[_0xff15('0x22')](removeEntity(_0x14399a,null))['catch'](handleError(_0x14399a,null));};exports[_0xff15('0x58')]=function(_0x1c3ea4,_0x1609f6){return db[_0xff15('0x4e')][_0xff15('0x58')]()[_0xff15('0x22')](respondWithResult(_0x1609f6,null))[_0xff15('0x2b')](handleError(_0x1609f6,null));};var interaction_log=require(_0xff15('0x14'))(_0xff15('0x59'));exports[_0xff15('0x5a')]=function(_0x59f28a,_0x5a4d1c,_0x414be3){var _0x5c7433={'agent':{},'channel':'fax'};if(_0x59f28a[_0xff15('0x57')]['id']){delete _0x59f28a['body']['id'];}_0x59f28a[_0xff15('0x57')][_0xff15('0x5b')]=!![];_0x59f28a[_0xff15('0x57')][_0xff15('0x5c')]=moment()[_0xff15('0x5d')](_0xff15('0x5e'));_0x59f28a['body']['UserId']=_0x59f28a[_0xff15('0x57')]['UserId']||_0x59f28a[_0xff15('0x5f')]['id'];_0x5c7433['agent']['id']=_0x59f28a['body'][_0xff15('0x60')];return db[_0xff15('0x4e')][_0xff15('0x56')]({'where':{'id':_0x59f28a[_0xff15('0x52')]['id'],'UserId':null}})[_0xff15('0x22')](handleEntityNotFound(_0x5a4d1c,null))[_0xff15('0x22')](saveUpdates(_0x59f28a[_0xff15('0x57')],null))['then'](function(_0x562933){if(_0x562933){_0x5c7433[_0xff15('0x29')]=_0x562933[_0xff15('0x61')]({'plain':!![]});return db[_0xff15('0x62')]['find']({'where':{'id':_0x562933[_0xff15('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5a4d1c,null))['then'](function(_0x21c118){if(_0x21c118){return _0x21c118['update']({'UserId':_0x59f28a[_0xff15('0x57')][_0xff15('0x60')],'read1stAt':_['isNil'](_0x21c118[_0xff15('0x64')])?moment()[_0xff15('0x5d')](_0xff15('0x5e')):undefined});}return null;})['then'](function(_0x3082d6){if(_0x3082d6){_0x5c7433['interaction']=_0x3082d6[_0xff15('0x61')]({'plain':!![]});interaction_log[_0xff15('0x2a')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59f28a[_0xff15('0x5f')]['id'],_0x59f28a['user'][_0xff15('0x3a')],_0x59f28a[_0xff15('0x5f')]['role'],_0x5c7433[_0xff15('0x65')]['id'],_0x59f28a[_0xff15('0x57')]?JSON[_0xff15('0x26')](_0x59f28a[_0xff15('0x57')]):_0xff15('0x66'));return respondWithRpcPromise(_0xff15('0x67'),_0xff15('0x68'),_0x5c7433);}return null;})[_0xff15('0x22')](function(_0x19cf62){var _0x575348=_0xff15('0x69')+_0x19cf62[_0xff15('0x29')][_0xff15('0x6a')];return db[_0xff15('0x6b')][_0xff15('0x43')](_0x575348,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xff15('0x22')](function(_0x46274e){return _0x46274e;});})[_0xff15('0x22')](function(_0x5aeabb){if(_0x5aeabb){_0x5c7433[_0xff15('0x29')][_0xff15('0x6c')]=_0x5aeabb[0x0];if(!_0x59f28a[_0xff15('0x57')]['UserId'])return;return db[_0xff15('0x6d')][_0xff15('0x56')]({'where':{'id':_0x59f28a[_0xff15('0x57')][_0xff15('0x60')],'role':'agent'},'attributes':['id',_0xff15('0x3a'),'fullname',_0xff15('0x6e'),_0xff15('0x6f')],'raw':!![]});}return null;})[_0xff15('0x22')](function(_0x309e89){if(!_0x309e89)return null;_0x5c7433[_0xff15('0x29')][_0xff15('0x70')]=_0x309e89;return _0x5c7433;})[_0xff15('0x22')](function(_0x153e7e){if(_0x153e7e){if(_0x59f28a[_0xff15('0x57')]['manual']){_0x5c7433['message']['interface']=util[_0xff15('0x5d')](_0xff15('0x71'),_0x59f28a[_0xff15('0x5f')][_0xff15('0x3a')]);_0x5c7433[_0xff15('0x29')]['channel']=_0x5c7433[_0xff15('0x72')];_0x5c7433['message'][_0xff15('0x73')]=_0x5c7433[_0xff15('0x72')];_0x5c7433[_0xff15('0x29')][_0xff15('0x74')]=_0xff15('0x5a');return respondWithRpcPromise(_0xff15('0x75'),_0xff15('0x75'),{'event':_0xff15('0x76'),'message':_0x5c7433['message']},client9002)[_0xff15('0x22')](function(){return _0x5c7433;});}return _0x5c7433;}return null;})[_0xff15('0x22')](respondWithResult(_0x5a4d1c,null))[_0xff15('0x2b')](handleError(_0x5a4d1c,null));};var interaction_log=require(_0xff15('0x14'))(_0xff15('0x59'));exports[_0xff15('0x34')]=function(_0x4d335b,_0x5d083f,_0x1e27f9){var _0x1551a0={'agent':{},'channel':_0xff15('0x77')};if(_0x4d335b[_0xff15('0x57')]['id']){delete _0x4d335b[_0xff15('0x57')]['id'];}_0x4d335b[_0xff15('0x57')][_0xff15('0x60')]=_0x4d335b[_0xff15('0x57')][_0xff15('0x60')]||_0x4d335b[_0xff15('0x5f')]['id'];_0x1551a0[_0xff15('0x70')]['id']=_0x4d335b[_0xff15('0x57')][_0xff15('0x60')];return db[_0xff15('0x4e')][_0xff15('0x56')]({'where':{'id':_0x4d335b[_0xff15('0x52')]['id'],'UserId':null}})[_0xff15('0x22')](handleEntityNotFound(_0x5d083f,null))[_0xff15('0x22')](function(_0x4cd72b){if(_0x4cd72b){_0x1551a0[_0xff15('0x29')]=_0x4cd72b[_0xff15('0x61')]({'plain':!![]});return db['FaxInteraction'][_0xff15('0x56')]({'where':{'id':_0x4cd72b['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5d083f,null))[_0xff15('0x22')](function(_0x1e2887){if(_0x1e2887){_0x1551a0['interaction']=_0x1e2887[_0xff15('0x61')]({'plain':!![]});interaction_log[_0xff15('0x2a')](_0xff15('0x78'),_0x4d335b['user']['id'],_0x4d335b[_0xff15('0x5f')][_0xff15('0x3a')],_0x4d335b[_0xff15('0x5f')][_0xff15('0x79')],_0x1551a0[_0xff15('0x65')]['id'],_0x4d335b[_0xff15('0x57')]?JSON[_0xff15('0x26')](_0x4d335b[_0xff15('0x57')]):_0xff15('0x66'));return respondWithRpcPromise(_0xff15('0x7a'),_0xff15('0x7b'),_0x1551a0);}return null;})[_0xff15('0x22')](function(_0x444e62){var _0x4f8a1f=_0xff15('0x69')+_0x444e62[_0xff15('0x29')]['ContactId'];return db['sequelize'][_0xff15('0x43')](_0x4f8a1f,{'type':db[_0xff15('0x7c')][_0xff15('0x7d')]['SELECT'],'raw':!![]})['then'](function(_0xd95ef6){return _0xd95ef6;});})[_0xff15('0x22')](function(_0x2d4f89){if(_0x2d4f89){_0x1551a0['message'][_0xff15('0x6c')]=_0x2d4f89[0x0];if(!_0x4d335b[_0xff15('0x57')]['UserId'])return;return db[_0xff15('0x6d')][_0xff15('0x56')]({'where':{'id':_0x4d335b['body']['UserId'],'role':_0xff15('0x70')},'attributes':['id',_0xff15('0x3a'),_0xff15('0x7e'),_0xff15('0x6e'),_0xff15('0x6f')],'raw':!![]});}return null;})[_0xff15('0x22')](function(_0x1a4c75){if(!_0x1a4c75)return null;_0x1551a0[_0xff15('0x29')][_0xff15('0x70')]=_0x1a4c75;return _0x1551a0;})[_0xff15('0x22')](function(_0x24eff4){if(_0x24eff4){_0x24eff4['message'][_0xff15('0x7f')]=util[_0xff15('0x5d')](_0xff15('0x71'),_0x4d335b[_0xff15('0x5f')][_0xff15('0x3a')]);_0x24eff4['message'][_0xff15('0x72')]=_0x1551a0['channel'];_0x24eff4[_0xff15('0x29')][_0xff15('0x73')]=_0x1551a0[_0xff15('0x72')];_0x24eff4[_0xff15('0x29')][_0xff15('0x74')]=_0xff15('0x34');respondWithRpcPromise(_0xff15('0x75'),_0xff15('0x75'),{'event':_0xff15('0x80'),'message':_0x24eff4['message']},client9002);return _0x1551a0;}return null;})['then'](respondWithResult(_0x5d083f,null))[_0xff15('0x2b')](handleError(_0x5d083f,null));};exports[_0xff15('0x81')]=function(_0x561694,_0x338ba8){var _0x40ddb2;return db['FaxMessage']['create'](_0x561694['body'],{})[_0xff15('0x22')](function(_0x2d6c87){_0x40ddb2=_0x2d6c87;return db['CmContact'][_0xff15('0x82')]({'where':{'id':_0x40ddb2['ContactId']}});})[_0xff15('0x22')](function(_0x3fc80f){if(_[_0xff15('0x83')](_0x3fc80f)){return;}else{_0x40ddb2[_0xff15('0x77')]=_0x3fc80f[_0xff15('0x77')];return db['Attachment']['findOne']({'where':{'id':_0x40ddb2[_0xff15('0x84')]}});}})[_0xff15('0x22')](function(_0x4c602d){return respondWithRpcPromise(_0xff15('0x85'),_0xff15('0x85'),{'FaxAccountId':_[_0xff15('0x83')](_0x561694[_0xff15('0x57')])?undefined:_0x561694[_0xff15('0x57')][_0xff15('0x86')],'path':_[_0xff15('0x83')](_0x4c602d)?undefined:util['format'](_0xff15('0x87'),_0x4c602d[_0xff15('0x88')]),'fax':_[_0xff15('0x83')](_0x40ddb2[_0xff15('0x77')])?undefined:_0x40ddb2[_0xff15('0x77')],'AttachmentId':_0x40ddb2[_0xff15('0x84')]},client9002);})[_0xff15('0x22')](respondWithResult(_0x338ba8,0xc9))[_0xff15('0x2b')](handleError(_0x338ba8,null));};exports[_0xff15('0x89')]=function(_0x32e88e,_0x412581){var _0x2796a6=path['join'](config[_0xff15('0x8a')],'server','files',_0xff15('0x8b'));return db[_0xff15('0x4e')][_0xff15('0x56')]({'where':{'id':_0x32e88e['params']['id']},'include':[{'model':db[_0xff15('0x8c')],'as':_0xff15('0x8c')}]})[_0xff15('0x22')](handleEntityNotFound(_0x412581,null))[_0xff15('0x22')](function(_0x4635e3){if(_0x4635e3){return _0x412581[_0xff15('0x89')](path[_0xff15('0x8d')](_0x2796a6,_0x4635e3['Attachment'][_0xff15('0x88')]));}})[_0xff15('0x2b')](handleError(_0x412581,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 4be6f65..15aae41 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 _0xfc4f=['save','update','remove','emit','hook','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x1c79a7,_0x38220e){var _0x4de69f=function(_0x569582){while(--_0x569582){_0x1c79a7['push'](_0x1c79a7['shift']());}};_0x4de69f(++_0x38220e);}(_0xfc4f,0x192));var _0xffc4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfc4f[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xffc4('0x0'))['db'][_0xffc4('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xffc4('0x2')](0x0);var events={'afterCreate':_0xffc4('0x3'),'afterUpdate':_0xffc4('0x4'),'afterDestroy':_0xffc4('0x5')};function emitEvent(_0x27bcf3){return function(_0x5943be,_0x289659,_0x211cfa){FaxMessageEvents[_0xffc4('0x6')](_0x27bcf3+':'+_0x5943be['id'],_0x5943be);FaxMessageEvents[_0xffc4('0x6')](_0x27bcf3,_0x5943be);_0x211cfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xffc4('0x7')](e,emitEvent(event));}}module[_0xffc4('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x7ed1=['emit','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x2e5197,_0x4689f8){var _0xe73af3=function(_0x2c8c77){while(--_0x2c8c77){_0x2e5197['push'](_0x2e5197['shift']());}};_0xe73af3(++_0x4689f8);}(_0x7ed1,0xca));var _0x17ed=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x7ed1[_0x2fc012];return _0x2891f9;};'use strict';var EventEmitter=require(_0x17ed('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x17ed('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x17ed('0x2')](0x0);var events={'afterCreate':_0x17ed('0x3'),'afterUpdate':_0x17ed('0x4'),'afterDestroy':_0x17ed('0x5')};function emitEvent(_0x3dc540){return function(_0x54bf1f,_0x2fdcd3,_0x7b29db){FaxMessageEvents[_0x17ed('0x6')](_0x3dc540+':'+_0x54bf1f['id'],_0x54bf1f);FaxMessageEvents[_0x17ed('0x6')](_0x3dc540,_0x54bf1f);_0x7b29db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x17ed('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index fc2038f..ee732fd 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 _0x9719=['get','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x397ecb,_0x411b9b){var _0x3e9af1=function(_0x5e6871){while(--_0x5e6871){_0x397ecb['push'](_0x397ecb['shift']());}};_0x3e9af1(++_0x411b9b);}(_0x9719,0x139));var _0x9971=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9719[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var logger=require(_0x9971('0x2'))(_0x9971('0x3'));var moment=require(_0x9971('0x4'));var BPromise=require('bluebird');var rp=require(_0x9971('0x5'));var fs=require('fs');var path=require(_0x9971('0x6'));var rimraf=require(_0x9971('0x7'));var config=require(_0x9971('0x8'));var attributes=require(_0x9971('0x9'));module['exports']=function(_0x16dc7c,_0x35cd98){return _0x16dc7c[_0x9971('0xa')](_0x9971('0xb'),attributes,{'tableName':_0x9971('0xc'),'paranoid':![],'indexes':[{'name':_0x9971('0xd'),'fields':[_0x9971('0xe')],'type':_0x9971('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa32783,_0x338d57,_0x4b12bb){var _0x5cb7a8=_0x16dc7c[_0x9971('0x10')];var _0x5af02b=_0xa32783[_0x9971('0x11')]({'plain':!![]});if(_0x5af02b['direction']['toLowerCase']()==='in'||_0x5af02b[_0x9971('0x12')]['toLowerCase']()===_0x9971('0x13')&&!_0x5af02b[_0x9971('0x14')]&&!_[_0x9971('0x15')](_0x5af02b[_0x9971('0x16')])){_0x5cb7a8[_0x9971('0x17')][_0x9971('0x18')]({'where':{'id':_0x5af02b[_0x9971('0x19')]}})[_0x9971('0x1a')](function(_0x218ece){if(_0x218ece){_0x218ece[_0x9971('0x1b')]({'lastMsgAt':_0x5af02b[_0x9971('0x1c')],'lastMsgDirection':_0x5af02b['direction'][_0x9971('0x1d')]()});}})[_0x9971('0x1e')](function(_0x171e36){console[_0x9971('0x1f')](_0x171e36);});}_0x4b12bb();}},'charset':_0x9971('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x99e5=['direction','toLowerCase','out','secret','UserId','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','models'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x99e5,0xe4));var _0x599e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x99e5[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x599e('0x0'));var util=require(_0x599e('0x1'));var logger=require('../../config/logger')(_0x599e('0x2'));var moment=require('moment');var BPromise=require(_0x599e('0x3'));var rp=require(_0x599e('0x4'));var fs=require('fs');var path=require(_0x599e('0x5'));var rimraf=require(_0x599e('0x6'));var config=require(_0x599e('0x7'));var attributes=require(_0x599e('0x8'));module[_0x599e('0x9')]=function(_0x2da9df,_0x5799c2){return _0x2da9df[_0x599e('0xa')](_0x599e('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x599e('0xc'),'fields':[_0x599e('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x268f39,_0x134e71,_0x42c827){var _0x2e0146=_0x2da9df[_0x599e('0xe')];var _0x518ce3=_0x268f39['get']({'plain':!![]});if(_0x518ce3[_0x599e('0xf')][_0x599e('0x10')]()==='in'||_0x518ce3[_0x599e('0xf')]['toLowerCase']()===_0x599e('0x11')&&!_0x518ce3[_0x599e('0x12')]&&!_['isNil'](_0x518ce3[_0x599e('0x13')])){_0x2e0146['FaxInteraction']['findOne']({'where':{'id':_0x518ce3[_0x599e('0x14')]}})[_0x599e('0x15')](function(_0x27fdbd){if(_0x27fdbd){_0x27fdbd[_0x599e('0x16')]({'lastMsgAt':_0x518ce3[_0x599e('0x17')],'lastMsgDirection':_0x518ce3[_0x599e('0xf')][_0x599e('0x10')]()});}})[_0x599e('0x18')](function(_0x4110bd){console['error'](_0x4110bd);});}_0x42c827();}},'charset':_0x599e('0x19'),'collate':_0x599e('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5c513bd..17806c1 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x22c747,_0x40d99f){var _0x182960=function(_0xf3db4a){while(--_0xf3db4a){_0x22c747['push'](_0x22c747['shift']());}};_0x182960(++_0x40d99f);}(_0x55e0,0xdc));var _0x055e=function(_0xca531b,_0x2768eb){_0xca531b=_0xca531b-0x0;var _0x4c5ea0=_0x55e0[_0xca531b];return _0x4c5ea0;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file +var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x1d78db,_0xaf609a){var _0x167e1d=function(_0x3f4033){while(--_0x3f4033){_0x1d78db['push'](_0x1d78db['shift']());}};_0x167e1d(++_0xaf609a);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2e5069,_0x3a1115){_0x2e5069=_0x2e5069-0x0;var _0x2f00ad=_0xeec6[_0x2e5069];return _0x2f00ad;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 4aa2407..a66b9f6 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 _0x15db=['faxMessage:','save','remove','emit','removeListener','register','length'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x15db,0xcc));var _0xb15d=function(_0x4e0996,_0x3e552c){_0x4e0996=_0x4e0996-0x0;var _0x2e8e75=_0x15db[_0x4e0996];return _0x2e8e75;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xb15d('0x0'),_0xb15d('0x1'),'update'];function createListener(_0x3438b1,_0x2ba314){return function(_0x5e0a8c){_0x2ba314[_0xb15d('0x2')](_0x3438b1,_0x5e0a8c);};}function removeListener(_0x5c4d26,_0x4ef4d6){return function(){FaxMessageEvents[_0xb15d('0x3')](_0x5c4d26,_0x4ef4d6);};}exports[_0xb15d('0x4')]=function(_0x2d06d7){for(var _0x46ad7e=0x0,_0x50fdaf=events[_0xb15d('0x5')];_0x46ad7e<_0x50fdaf;_0x46ad7e++){var _0x25ee1e=events[_0x46ad7e];var _0x28a104=createListener(_0xb15d('0x6')+_0x25ee1e,_0x2d06d7);FaxMessageEvents['on'](_0x25ee1e,_0x28a104);}}; \ No newline at end of file +var _0x3bee=['save','remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x14b195,_0x460868){var _0x42f003=function(_0x266e88){while(--_0x266e88){_0x14b195['push'](_0x14b195['shift']());}};_0x42f003(++_0x460868);}(_0x3bee,0x11f));var _0xe3be=function(_0x52c9dc,_0x3a0167){_0x52c9dc=_0x52c9dc-0x0;var _0x5966d7=_0x3bee[_0x52c9dc];return _0x5966d7;};'use strict';var FaxMessageEvents=require(_0xe3be('0x0'));var events=[_0xe3be('0x1'),_0xe3be('0x2'),_0xe3be('0x3')];function createListener(_0x2d3c47,_0x37e6e9){return function(_0x50cb39){_0x37e6e9[_0xe3be('0x4')](_0x2d3c47,_0x50cb39);};}function removeListener(_0x3dc9ff,_0x3d16b3){return function(){FaxMessageEvents[_0xe3be('0x5')](_0x3dc9ff,_0x3d16b3);};}exports[_0xe3be('0x6')]=function(_0x5ebaad){for(var _0x4a4c73=0x0,_0x40ea39=events[_0xe3be('0x7')];_0x4a4c73<_0x40ea39;_0x4a4c73++){var _0x6965d1=events[_0x4a4c73];var _0x4dbc10=createListener(_0xe3be('0x8')+_0x6965d1,_0x5ebaad);FaxMessageEvents['on'](_0x6965d1,_0x4dbc10);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e82365a..5cc95a1 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 _0xd404=['/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe'];(function(_0x2223f4,_0x277f80){var _0x840e7=function(_0x758837){while(--_0x758837){_0x2223f4['push'](_0x2223f4['shift']());}};_0x840e7(++_0x277f80);}(_0xd404,0x15b));var _0x4d40=function(_0x53cf4e,_0x580539){_0x53cf4e=_0x53cf4e-0x0;var _0x5bd484=_0xd404[_0x53cf4e];return _0x5bd484;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/describe',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),interaction[_0x4d40('0x11')](_0x4d40('0x12'),_0x4d40('0x13')),controller[_0x4d40('0x14')]);router[_0x4d40('0x15')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);router['put'](_0x4d40('0x17'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x18')]);router[_0x4d40('0x15')](_0x4d40('0x19'),auth['isAuthenticated'](),controller[_0x4d40('0x1a')]);router[_0x4d40('0x1b')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x1c')]);module[_0x4d40('0x1d')]=router; \ No newline at end of file +var _0xda3f=['create','put','/:id/accept','/:id/reject','destroy','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create'];(function(_0x22b969,_0x3867f5){var _0x424a93=function(_0x1ec3fb){while(--_0x1ec3fb){_0x22b969['push'](_0x22b969['shift']());}};_0x424a93(++_0x3867f5);}(_0xda3f,0xec));var _0xfda3=function(_0x8c8561,_0x3a8db2){_0x8c8561=_0x8c8561-0x0;var _0xc197e=_0xda3f[_0x8c8561];return _0xc197e;};'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('./faxMessage.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('0xd')]('/',auth['isAuthenticated'](),interaction[_0xfda3('0xe')](_0xfda3('0xf'),_0xfda3('0x10')),controller[_0xfda3('0x11')]);router[_0xfda3('0x12')]('/:id',auth[_0xfda3('0x6')](),controller['update']);router[_0xfda3('0x12')](_0xfda3('0x13'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xfda3('0x14'),auth[_0xfda3('0x6')](),controller['reject']);router['delete']('/:id',auth[_0xfda3('0x6')](),controller[_0xfda3('0x15')]);module[_0xfda3('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 238328a..dfeea68 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 _0xbddb=['INTEGER','ENUM','rrmemory','exports','name','STRING'];(function(_0x2ddf50,_0x5c58d9){var _0x168625=function(_0x444a2e){while(--_0x444a2e){_0x2ddf50['push'](_0x2ddf50['shift']());}};_0x168625(++_0x5c58d9);}(_0xbddb,0x11d));var _0xbbdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbddb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xbbdd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbbdd('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbbdd('0x2')]},'timeout':{'type':Sequelize[_0xbbdd('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbbdd('0x4')](_0xbbdd('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbbdd('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4405=['roundrobin','INTEGER','sequelize','exports','STRING','name'];(function(_0x429753,_0xe1899b){var _0x44c1db=function(_0x23b5a8){while(--_0x23b5a8){_0x429753['push'](_0x429753['shift']());}};_0x44c1db(++_0xe1899b);}(_0x4405,0xce));var _0x5440=function(_0x4d7468,_0x4f7276){_0x4d7468=_0x4d7468-0x0;var _0x33315d=_0x4405[_0x4d7468];return _0x33315d;};'use strict';var Sequelize=require(_0x5440('0x0'));module[_0x5440('0x1')]={'name':{'type':Sequelize[_0x5440('0x2')],'unique':_0x5440('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5440('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5440('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5440('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 2bd1dbb..abdd44a 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 _0xc24d=['desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','keys','length','include','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','params','describe','UserFaxQueue','nolimit','pick','User','findAndCountAll','UserId','updatedAt','createdAt','format','findOne','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','userFaxQueue:remove','addAgents','userFaxQueue:save','removeAgents','isArray','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x4c7dd2,_0x40f6d5){var _0x563573=function(_0x3d6524){while(--_0x3d6524){_0x4c7dd2['push'](_0x4c7dd2['shift']());}};_0x563573(++_0x40f6d5);}(_0xc24d,0x106));var _0xdc24=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xc24d[_0x547add];return _0x2ed1f3;};'use strict';var emlformat=require(_0xdc24('0x0'));var rimraf=require(_0xdc24('0x1'));var zipdir=require(_0xdc24('0x2'));var jsonpatch=require(_0xdc24('0x3'));var rp=require('request-promise');var moment=require(_0xdc24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdc24('0x5'));var util=require('util');var path=require(_0xdc24('0x6'));var sox=require(_0xdc24('0x7'));var csv=require(_0xdc24('0x8'));var ejs=require(_0xdc24('0x9'));var fs=require('fs');var fs_extra=require(_0xdc24('0xa'));var _=require('lodash');var squel=require(_0xdc24('0xb'));var crypto=require(_0xdc24('0xc'));var jsforce=require(_0xdc24('0xd'));var deskjs=require(_0xdc24('0xe'));var toCsv=require(_0xdc24('0x8'));var querystring=require('querystring');var Papa=require(_0xdc24('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdc24('0x10'));var as=require(_0xdc24('0x11'));var hardwareService=require(_0xdc24('0x12'));var logger=require(_0xdc24('0x13'))('api');var utils=require(_0xdc24('0x14'));var config=require(_0xdc24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc24('0x16'))['db'];config['redis']=_['defaults'](config[_0xdc24('0x17')],{'host':_0xdc24('0x18'),'port':0x18eb});var socket=require(_0xdc24('0x19'))(new Redis(config[_0xdc24('0x17')]));require(_0xdc24('0x1a'))[_0xdc24('0x1b')](socket);function respondWithStatusCode(_0x3309e2,_0x239a45){_0x239a45=_0x239a45||0xcc;return function(_0x373cfb){if(_0x373cfb){return _0x3309e2[_0xdc24('0x1c')](_0x239a45);}return _0x3309e2[_0xdc24('0x1d')](_0x239a45)[_0xdc24('0x1e')]();};}function respondWithResult(_0x305e46,_0x59d573){_0x59d573=_0x59d573||0xc8;return function(_0x5510ea){if(_0x5510ea){return _0x305e46['status'](_0x59d573)[_0xdc24('0x1f')](_0x5510ea);}};}function respondWithFilteredResult(_0x533ac5,_0x3a6373){return function(_0x5136ac){if(_0x5136ac){var _0x25c9e0=typeof _0x3a6373['offset']==='undefined'&&typeof _0x3a6373[_0xdc24('0x20')]===_0xdc24('0x21');var _0x3a33d0=_0x5136ac[_0xdc24('0x22')];var _0x431f1e=_0x25c9e0?0x0:_0x3a6373[_0xdc24('0x23')];var _0xdf376a=_0x25c9e0?_0x5136ac['count']:_0x3a6373['offset']+_0x3a6373[_0xdc24('0x20')];var _0x21fc3e;if(_0xdf376a>=_0x3a33d0){_0xdf376a=_0x3a33d0;_0x21fc3e=0xc8;}else{_0x21fc3e=0xce;}_0x533ac5[_0xdc24('0x1d')](_0x21fc3e);return _0x533ac5[_0xdc24('0x24')]('Content-Range',_0x431f1e+'-'+_0xdf376a+'/'+_0x3a33d0)[_0xdc24('0x1f')](_0x5136ac);}return null;};}function patchUpdates(_0x6c2e9d){return function(_0x7a9dee){try{jsonpatch[_0xdc24('0x25')](_0x7a9dee,_0x6c2e9d,!![]);}catch(_0x394e40){return BPromise[_0xdc24('0x26')](_0x394e40);}return _0x7a9dee[_0xdc24('0x27')]();};}function saveUpdates(_0x59b7ec,_0x21222d){return function(_0x52d9c3){if(_0x52d9c3){return _0x52d9c3[_0xdc24('0x28')](_0x59b7ec)[_0xdc24('0x29')](function(_0x4ee8d9){return _0x4ee8d9;});}return null;};}function removeEntity(_0x1405a2,_0x4c055e){return function(_0x1c2471){if(_0x1c2471){return _0x1c2471[_0xdc24('0x2a')]()[_0xdc24('0x29')](function(){var _0x339c84=_0x1c2471['get']({'plain':!![]});var _0x216482=_0xdc24('0x2b');return db[_0xdc24('0x2c')][_0xdc24('0x2a')]({'where':{'type':_0x216482,'resourceId':_0x339c84['id']}})[_0xdc24('0x29')](function(){return _0x1c2471;});})[_0xdc24('0x29')](function(){_0x1405a2['status'](0xcc)[_0xdc24('0x1e')]();});}};}function handleEntityNotFound(_0x2e1efd,_0x371dd7){return function(_0x16ad90){if(!_0x16ad90){_0x2e1efd[_0xdc24('0x1c')](0x194);}return _0x16ad90;};}function handleError(_0x1c6b45,_0x2d0c70){_0x2d0c70=_0x2d0c70||0x1f4;return function(_0x45af0c){logger[_0xdc24('0x2d')](_0x45af0c[_0xdc24('0x2e')]);if(_0x45af0c[_0xdc24('0x2f')]){delete _0x45af0c[_0xdc24('0x2f')];}_0x1c6b45[_0xdc24('0x1d')](_0x2d0c70)[_0xdc24('0x30')](_0x45af0c);};}exports[_0xdc24('0x31')]=function(_0x54b694,_0xbe8e61){var _0x5f15d7={},_0x4566c4={},_0x399657={'count':0x0,'rows':[]};var _0x193007=_['map'](db[_0xdc24('0x32')][_0xdc24('0x33')],function(_0x3d77cb){return{'name':_0x3d77cb[_0xdc24('0x34')],'type':_0x3d77cb[_0xdc24('0x35')][_0xdc24('0x36')]};});_0x4566c4[_0xdc24('0x37')]=_[_0xdc24('0x38')](_0x193007,_0xdc24('0x2f'));_0x4566c4[_0xdc24('0x39')]=_['keys'](_0x54b694['query']);_0x4566c4[_0xdc24('0x3a')]=_['intersection'](_0x4566c4[_0xdc24('0x37')],_0x4566c4[_0xdc24('0x39')]);_0x5f15d7['attributes']=_[_0xdc24('0x3b')](_0x4566c4[_0xdc24('0x37')],qs[_0xdc24('0x3c')](_0x54b694[_0xdc24('0x39')]['fields']));_0x5f15d7[_0xdc24('0x3d')]=_0x5f15d7['attributes']['length']?_0x5f15d7[_0xdc24('0x3d')]:_0x4566c4['model'];if(!_0x54b694[_0xdc24('0x39')]['hasOwnProperty']('nolimit')){_0x5f15d7[_0xdc24('0x20')]=qs[_0xdc24('0x20')](_0x54b694[_0xdc24('0x39')]['limit']);_0x5f15d7[_0xdc24('0x23')]=qs['offset'](_0x54b694[_0xdc24('0x39')]['offset']);}_0x5f15d7[_0xdc24('0x3e')]=qs[_0xdc24('0x3f')](_0x54b694[_0xdc24('0x39')][_0xdc24('0x3f')]);_0x5f15d7[_0xdc24('0x40')]=qs[_0xdc24('0x3a')](_['pick'](_0x54b694[_0xdc24('0x39')],_0x4566c4[_0xdc24('0x3a')]),_0x193007);if(_0x54b694[_0xdc24('0x39')][_0xdc24('0x41')]){_0x5f15d7[_0xdc24('0x40')]=_[_0xdc24('0x42')](_0x5f15d7[_0xdc24('0x40')],{'$or':_[_0xdc24('0x38')](_0x193007,function(_0x2d3d9e){if(_0x2d3d9e[_0xdc24('0x35')]!==_0xdc24('0x43')){var _0x28b5c3={};_0x28b5c3[_0x2d3d9e[_0xdc24('0x2f')]]={'$like':'%'+_0x54b694[_0xdc24('0x39')]['filter']+'%'};return _0x28b5c3;}})});}_0x5f15d7=_[_0xdc24('0x42')]({},_0x5f15d7,_0x54b694['options']);var _0x532cac={'where':_0x5f15d7[_0xdc24('0x40')]};return db[_0xdc24('0x32')][_0xdc24('0x22')](_0x532cac)[_0xdc24('0x29')](function(_0x47eff8){_0x399657[_0xdc24('0x22')]=_0x47eff8;if(_0x54b694[_0xdc24('0x39')][_0xdc24('0x44')]){_0x5f15d7['include']=[{'all':!![]}];}return db['FaxQueue'][_0xdc24('0x45')](_0x5f15d7);})[_0xdc24('0x29')](function(_0x45a59b){_0x399657[_0xdc24('0x46')]=_0x45a59b;return _0x399657;})[_0xdc24('0x29')](respondWithFilteredResult(_0xbe8e61,_0x5f15d7))['catch'](handleError(_0xbe8e61,null));};exports[_0xdc24('0x47')]=function(_0x50833b,_0x1def9e){var _0x2d2b56={'raw':!![],'where':{'id':_0x50833b['params']['id']}},_0x3a7ba4={};_0x3a7ba4[_0xdc24('0x37')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x3a7ba4[_0xdc24('0x39')]=_[_0xdc24('0x48')](_0x50833b[_0xdc24('0x39')]);_0x3a7ba4[_0xdc24('0x3a')]=_['intersection'](_0x3a7ba4[_0xdc24('0x37')],_0x3a7ba4[_0xdc24('0x39')]);_0x2d2b56[_0xdc24('0x3d')]=_[_0xdc24('0x3b')](_0x3a7ba4[_0xdc24('0x37')],qs[_0xdc24('0x3c')](_0x50833b[_0xdc24('0x39')][_0xdc24('0x3c')]));_0x2d2b56[_0xdc24('0x3d')]=_0x2d2b56[_0xdc24('0x3d')][_0xdc24('0x49')]?_0x2d2b56['attributes']:_0x3a7ba4['model'];if(_0x50833b['query'][_0xdc24('0x44')]){_0x2d2b56[_0xdc24('0x4a')]=[{'all':!![]}];}_0x2d2b56=_[_0xdc24('0x42')]({},_0x2d2b56,_0x50833b[_0xdc24('0x4b')]);return db['FaxQueue']['find'](_0x2d2b56)['then'](handleEntityNotFound(_0x1def9e,null))[_0xdc24('0x29')](respondWithResult(_0x1def9e,null))[_0xdc24('0x4c')](handleError(_0x1def9e,null));};exports[_0xdc24('0x4d')]=function(_0x5375b1,_0x289d15){return db[_0xdc24('0x32')][_0xdc24('0x4d')](_0x5375b1[_0xdc24('0x4e')],{})[_0xdc24('0x29')](function(_0x5ead6a){var _0x1b1532=_0x5375b1[_0xdc24('0x4f')][_0xdc24('0x50')]({'plain':!![]});if(!_0x1b1532)throw new Error(_0xdc24('0x51'));if(_0x1b1532[_0xdc24('0x52')]===_0xdc24('0x4f')){var _0x56f308=_0x5ead6a[_0xdc24('0x50')]({'plain':!![]});var _0x1438e7=_0xdc24('0x2b');return db[_0xdc24('0x53')][_0xdc24('0x54')]({'where':{'name':_0x1438e7,'userProfileId':_0x1b1532['userProfileId']},'raw':!![]})[_0xdc24('0x29')](function(_0x57c5b3){if(_0x57c5b3&&_0x57c5b3[_0xdc24('0x55')]===0x0){return db[_0xdc24('0x2c')][_0xdc24('0x4d')]({'name':_0x56f308['name'],'resourceId':_0x56f308['id'],'type':_0x57c5b3[_0xdc24('0x2f')],'sectionId':_0x57c5b3['id']},{})[_0xdc24('0x29')](function(){return _0x5ead6a;});}else{return _0x5ead6a;}})['catch'](function(_0x3ab0f3){logger[_0xdc24('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f3);throw _0x3ab0f3;});}return _0x5ead6a;})[_0xdc24('0x29')](respondWithResult(_0x289d15,0xc9))[_0xdc24('0x4c')](handleError(_0x289d15,null));};exports[_0xdc24('0x28')]=function(_0x23f05b,_0xd091d7){if(_0x23f05b['body']['id']){delete _0x23f05b[_0xdc24('0x4e')]['id'];}return db[_0xdc24('0x32')][_0xdc24('0x54')]({'where':{'id':_0x23f05b[_0xdc24('0x56')]['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0xd091d7,null))[_0xdc24('0x29')](saveUpdates(_0x23f05b[_0xdc24('0x4e')],null))[_0xdc24('0x29')](respondWithResult(_0xd091d7,null))[_0xdc24('0x4c')](handleError(_0xd091d7,null));};exports[_0xdc24('0x2a')]=function(_0x13f678,_0x39f09c){return db[_0xdc24('0x32')][_0xdc24('0x54')]({'where':{'id':_0x13f678[_0xdc24('0x56')]['id']}})['then'](handleEntityNotFound(_0x39f09c,null))[_0xdc24('0x29')](removeEntity(_0x39f09c,null))[_0xdc24('0x4c')](handleError(_0x39f09c,null));};exports[_0xdc24('0x57')]=function(_0x536c8c,_0x1390eb){return db[_0xdc24('0x32')][_0xdc24('0x57')]()[_0xdc24('0x29')](respondWithResult(_0x1390eb,null))[_0xdc24('0x4c')](handleError(_0x1390eb,null));};exports['getMembers']=function(_0x2c6810,_0x3c5aab,_0x24a3c5){var _0x19bfd8={'raw':!![],'where':{}},_0x19643b={},_0x4acfd3;return db['FaxQueue']['findOne']({'where':{'id':_0x2c6810[_0xdc24('0x56')]['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0x3c5aab,null))[_0xdc24('0x29')](function(_0xa4c518){if(_0xa4c518){_0x4acfd3=_0xa4c518[_0xdc24('0x50')]({'plain':!![]});_0x19643b[_0xdc24('0x37')]=_['keys'](db[_0xdc24('0x58')]['rawAttributes']);_0x19643b[_0xdc24('0x39')]=_[_0xdc24('0x48')](_0x2c6810[_0xdc24('0x39')]);_0x19643b[_0xdc24('0x3a')]=_[_0xdc24('0x3b')](_0x19643b[_0xdc24('0x37')],_0x19643b[_0xdc24('0x39')]);_0x19bfd8['attributes']=_[_0xdc24('0x3b')](_0x19643b[_0xdc24('0x37')],qs[_0xdc24('0x3c')](_0x2c6810[_0xdc24('0x39')][_0xdc24('0x3c')]));_0x19bfd8[_0xdc24('0x3d')]=_0x19bfd8['attributes'][_0xdc24('0x49')]?_0x19bfd8[_0xdc24('0x3d')]:_0x19643b['model'];if(!_0x2c6810[_0xdc24('0x39')]['hasOwnProperty'](_0xdc24('0x59'))){_0x19bfd8['limit']=qs[_0xdc24('0x20')](_0x2c6810['query'][_0xdc24('0x20')]);_0x19bfd8[_0xdc24('0x23')]=qs[_0xdc24('0x23')](_0x2c6810[_0xdc24('0x39')][_0xdc24('0x23')]);}_0x19bfd8[_0xdc24('0x3e')]=qs[_0xdc24('0x3f')](_0x2c6810[_0xdc24('0x39')][_0xdc24('0x3f')]);_0x19bfd8['where']=qs['filters'](_[_0xdc24('0x5a')](_0x2c6810[_0xdc24('0x39')],_0x19643b[_0xdc24('0x3a')]));_0x19bfd8[_0xdc24('0x40')]['FaxQueueId']=_0xa4c518['id'];if(_0x2c6810[_0xdc24('0x39')][_0xdc24('0x41')]){_0x19bfd8[_0xdc24('0x40')]=_['merge'](_0x19bfd8['where'],{'$or':_[_0xdc24('0x38')](_0x19bfd8[_0xdc24('0x3d')],function(_0x3ea5d4){var _0x58ac66={};_0x58ac66[_0x3ea5d4]={'$like':'%'+_0x2c6810[_0xdc24('0x39')][_0xdc24('0x41')]+'%'};return _0x58ac66;})});}_0x19bfd8=_[_0xdc24('0x42')]({},_0x19bfd8,_0x2c6810[_0xdc24('0x4b')]);return db[_0xdc24('0x58')][_0xdc24('0x45')](_0x19bfd8);}})[_0xdc24('0x29')](function(_0x26d921){if(_0x26d921){return db[_0xdc24('0x5b')][_0xdc24('0x5c')]({'where':{'id':_['map'](_0x26d921,_0xdc24('0x5d')),'role':'agent'},'attributes':['id','name','faxPause',_0xdc24('0x5e'),_0xdc24('0x5f')]});}})['then'](function(_0x3f894c){if(_0x3f894c){return{'count':_0x3f894c[_0xdc24('0x22')],'rows':_[_0xdc24('0x38')](_0x3f894c['rows'],function(_0x2e5048){return{'membername':_0x2e5048[_0xdc24('0x2f')],'UserId':_0x2e5048['id'],'queue_name':_0x4acfd3['name'],'FaxQueueId':_0x4acfd3['id'],'interface':util[_0xdc24('0x60')]('%s/%s','SIP',_0x2e5048['name']),'penalty':0x0,'paused':_0x2e5048['faxPause'],'createdAt':_0x2e5048[_0xdc24('0x5f')],'updatedAt':_0x2e5048[_0xdc24('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3c5aab,_0x19bfd8))[_0xdc24('0x4c')](handleError(_0x3c5aab,null));};exports['getTeams']=function(_0xcf10a,_0x469e98,_0x18cd06){var _0x2d5fa2={};var _0x5dc0d8={};var _0x4167ba;var _0x1c99f6;return db['FaxQueue'][_0xdc24('0x61')]({'where':{'id':_0xcf10a['params']['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0x469e98,null))[_0xdc24('0x29')](function(_0x5a78d8){if(_0x5a78d8){_0x4167ba=_0x5a78d8;_0x5dc0d8['model']=_[_0xdc24('0x48')](db[_0xdc24('0x62')]['rawAttributes']);_0x5dc0d8[_0xdc24('0x39')]=_[_0xdc24('0x48')](_0xcf10a[_0xdc24('0x39')]);_0x5dc0d8['filters']=_['intersection'](_0x5dc0d8[_0xdc24('0x37')],_0x5dc0d8['query']);_0x2d5fa2[_0xdc24('0x3d')]=_[_0xdc24('0x3b')](_0x5dc0d8['model'],qs[_0xdc24('0x3c')](_0xcf10a[_0xdc24('0x39')][_0xdc24('0x3c')]));_0x2d5fa2[_0xdc24('0x3d')]=_0x2d5fa2[_0xdc24('0x3d')][_0xdc24('0x49')]?_0x2d5fa2[_0xdc24('0x3d')]:_0x5dc0d8['model'];_0x2d5fa2[_0xdc24('0x3e')]=qs[_0xdc24('0x3f')](_0xcf10a[_0xdc24('0x39')]['sort']);_0x2d5fa2['where']=qs[_0xdc24('0x3a')](_[_0xdc24('0x5a')](_0xcf10a[_0xdc24('0x39')],_0x5dc0d8['filters']));if(_0xcf10a[_0xdc24('0x39')]['filter']){_0x2d5fa2[_0xdc24('0x40')]=_[_0xdc24('0x42')](_0x2d5fa2['where'],{'$or':_[_0xdc24('0x38')](_0x2d5fa2[_0xdc24('0x3d')],function(_0x1d28cc){var _0x5530b7={};_0x5530b7[_0x1d28cc]={'$like':'%'+_0xcf10a[_0xdc24('0x39')][_0xdc24('0x41')]+'%'};return _0x5530b7;})});}_0x2d5fa2=_[_0xdc24('0x42')]({},_0x2d5fa2,_0xcf10a[_0xdc24('0x4b')]);return _0x4167ba[_0xdc24('0x63')](_0x2d5fa2);}})['then'](function(_0x5446ff){if(_0x5446ff){_0x1c99f6=_0x5446ff['length'];if(!_0xcf10a['query']['hasOwnProperty'](_0xdc24('0x59'))){_0x2d5fa2[_0xdc24('0x20')]=qs[_0xdc24('0x20')](_0xcf10a['query'][_0xdc24('0x20')]);_0x2d5fa2['offset']=qs[_0xdc24('0x23')](_0xcf10a[_0xdc24('0x39')][_0xdc24('0x23')]);}return _0x4167ba[_0xdc24('0x63')](_0x2d5fa2);}})[_0xdc24('0x29')](function(_0x100358){if(_0x100358){return _0x100358?{'count':_0x1c99f6,'rows':_0x100358}:null;}})['then'](respondWithResult(_0x469e98,null))[_0xdc24('0x4c')](handleError(_0x469e98,null));};exports['addTeams']=function(_0x328de9,_0xbb051e,_0x13939d){var _0x545059=_0x328de9[_0xdc24('0x4e')][_0xdc24('0x64')];return db['Team'][_0xdc24('0x45')]({'where':{'id':_0x545059},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdc24('0x65'),'attributes':['id',_0xdc24('0x2f'),_0xdc24('0x66'),_0xdc24('0x67'),_0xdc24('0x68')],'raw':!![]}]})[_0xdc24('0x29')](function(_0x2836a9){if(_0x2836a9){var _0x26a693=_[_0xdc24('0x69')](_0x2836a9,function(_0x1ba032){var _0x182280=_0x1ba032[_0xdc24('0x50')]({'plain':!![]});return _0x182280[_0xdc24('0x65')];});return db[_0xdc24('0x32')][_0xdc24('0x54')]({'where':{'id':_0x328de9[_0xdc24('0x56')]['id']}})[_0xdc24('0x29')](function(_0x1e2d70){return db['sequelize'][_0xdc24('0x6a')](function(_0x4a6ecc){return _0x1e2d70[_0xdc24('0x6b')](_0x545059,{'transaction':_0x4a6ecc})['then'](function(){return BPromise[_0xdc24('0x6c')](_0x26a693,function(_0x11c0a8){return db[_0xdc24('0x58')][_0xdc24('0x6d')]({'where':{'UserId':_0x11c0a8['id'],'FaxQueueId':_0x328de9[_0xdc24('0x56')]['id']},'transaction':_0x4a6ecc});});})[_0xdc24('0x29')](function(){_0x26a693[_0xdc24('0x6e')](function(_0x586d68){socket[_0xdc24('0x6f')]('userFaxQueue:save',{'UserId':_0x586d68['id'],'FaxQueueId':_0x1e2d70['id']});});});});});}})[_0xdc24('0x29')](respondWithStatusCode(_0xbb051e,null))[_0xdc24('0x4c')](handleError(_0xbb051e,null));};exports['removeTeams']=function(_0x2bf7e7,_0x41c03d,_0x416abd){return db[_0xdc24('0x62')]['findAll']({'where':{'id':_0x2bf7e7[_0xdc24('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdc24('0x5b')],'as':_0xdc24('0x65'),'attributes':['id'],'raw':!![]}]})[_0xdc24('0x29')](handleEntityNotFound(_0x41c03d,null))[_0xdc24('0x29')](function(_0x5c529e){var _0x1de575=_[_0xdc24('0x38')](_0x5c529e,'id');var _0x328d01=[];var _0x3a9551=[];var _0x1aa388=squel['select']();_0x1aa388['field'](_0xdc24('0x70'))[_0xdc24('0x71')]('team_has_fax_queues','tq')[_0xdc24('0x72')](_0xdc24('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdc24('0x40')]('FaxQueueId\x20=\x20?',_0x2bf7e7[_0xdc24('0x56')]['id']);for(var _0x5bb143=0x0;_0x5bb143<_0x5c529e[_0xdc24('0x49')];_0x5bb143+=0x1){let _0x3252c7=_0x5c529e[_0x5bb143];for(var _0x17e2c3=0x0;_0x17e2c3<_0x3252c7[_0xdc24('0x65')][_0xdc24('0x49')];_0x17e2c3+=0x1){let _0x1a64c9=_0x3252c7['Agents'][_0x17e2c3];var _0x12d14d=_0x1aa388[_0xdc24('0x74')]();_0x12d14d[_0xdc24('0x40')](_0xdc24('0x75'),_0x1a64c9['id']);_0x3a9551[_0xdc24('0x76')](db[_0xdc24('0x77')][_0xdc24('0x39')](_0x12d14d[_0xdc24('0x78')](),{'type':db['sequelize'][_0xdc24('0x79')][_0xdc24('0x7a')]})[_0xdc24('0x29')](function(_0x19f497){if(_0x19f497[_0xdc24('0x49')]===0x1){return _0x1a64c9['id'];}else{var _0xc7942d=_[_0xdc24('0x7b')](_[_0xdc24('0x38')](_0x19f497,_0xdc24('0x7c')),function(_0x5766dc){return _[_0xdc24('0x7d')](_0x1de575,_0x5766dc);});if(_0xc7942d){return _0x1a64c9['id'];}}}));}}return BPromise[_0xdc24('0x7e')](_0x3a9551)[_0xdc24('0x29')](function(_0x34791d){_0x328d01=_(_0x328d01)[_0xdc24('0x7f')](_0x34791d)[_0xdc24('0x80')]()[_0xdc24('0x81')]();return db[_0xdc24('0x32')]['find']({'where':{'id':_0x2bf7e7['params']['id']}})[_0xdc24('0x29')](function(_0x31c94b){return db[_0xdc24('0x77')][_0xdc24('0x6a')](function(_0x44466b){return _0x31c94b[_0xdc24('0x82')](_0x2bf7e7['query'][_0xdc24('0x64')],{'transaction':_0x44466b})[_0xdc24('0x29')](function(){if(!_['isEmpty'](_0x328d01)){return _0x31c94b['removeAgents'](_0x328d01,{'transaction':_0x44466b});}})[_0xdc24('0x29')](function(){_0x328d01[_0xdc24('0x6e')](function(_0xdb5c88){socket[_0xdc24('0x6f')](_0xdc24('0x83'),{'UserId':_0xdb5c88,'FaxQueueId':_0x31c94b['id']});});});});});});})[_0xdc24('0x29')](respondWithStatusCode(_0x41c03d,null))['catch'](handleError(_0x41c03d,null));};exports[_0xdc24('0x84')]=function(_0x2f27f6,_0x99a77d,_0x1866b9){return db['FaxQueue'][_0xdc24('0x54')]({'where':{'id':_0x2f27f6['params']['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0x99a77d,null))[_0xdc24('0x29')](function(_0x336680){if(_0x336680){return _0x336680[_0xdc24('0x84')](_0x2f27f6['body'][_0xdc24('0x64')],_['omit'](_0x2f27f6[_0xdc24('0x4e')],[_0xdc24('0x64'),'id'])||{})['spread'](function(_0x38c4ee){for(var _0x90934b=0x0;_0x90934b<_0x2f27f6[_0xdc24('0x4e')][_0xdc24('0x64')][_0xdc24('0x49')];_0x90934b+=0x1){socket[_0xdc24('0x6f')](_0xdc24('0x85'),{'UserId':Number(_0x2f27f6[_0xdc24('0x4e')][_0xdc24('0x64')][_0x90934b]),'FaxQueueId':Number(_0x2f27f6[_0xdc24('0x56')]['id'])});}return _0x38c4ee;});}})[_0xdc24('0x29')](respondWithResult(_0x99a77d,null))[_0xdc24('0x4c')](handleError(_0x99a77d,null));};exports[_0xdc24('0x86')]=function(_0x1c08be,_0xa73fb2,_0x46bd55){return db[_0xdc24('0x32')][_0xdc24('0x54')]({'where':{'id':_0x1c08be[_0xdc24('0x56')]['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0xa73fb2,null))[_0xdc24('0x29')](function(_0x274f55){if(_0x274f55){return _0x274f55[_0xdc24('0x86')](_0x1c08be['query'][_0xdc24('0x64')])[_0xdc24('0x29')](function(){if(_[_0xdc24('0x87')](_0x1c08be['query']['ids'])){for(var _0x2f3b6f=0x0;_0x2f3b6f<_0x1c08be['query'][_0xdc24('0x64')][_0xdc24('0x49')];_0x2f3b6f+=0x1){socket['emit'](_0xdc24('0x83'),{'UserId':Number(_0x1c08be[_0xdc24('0x39')][_0xdc24('0x64')][_0x2f3b6f]),'FaxQueueId':Number(_0x1c08be[_0xdc24('0x56')]['id'])});}}else{socket['emit'](_0xdc24('0x83'),{'UserId':Number(_0x1c08be['query'][_0xdc24('0x64')]),'FaxQueueId':Number(_0x1c08be[_0xdc24('0x56')]['id'])});}});}})[_0xdc24('0x29')](respondWithStatusCode(_0xa73fb2,null))[_0xdc24('0x4c')](handleError(_0xa73fb2,null));};exports[_0xdc24('0x88')]=function(_0x5eca57,_0x9abaac,_0x25924c){var _0x9e1574={};var _0x31b3b3={};var _0x53914f;var _0x450736;return db[_0xdc24('0x32')][_0xdc24('0x61')]({'where':{'id':_0x5eca57['params']['id']}})[_0xdc24('0x29')](handleEntityNotFound(_0x9abaac,null))['then'](function(_0x518673){if(_0x518673){_0x53914f=_0x518673;_0x31b3b3[_0xdc24('0x37')]=_[_0xdc24('0x48')](db[_0xdc24('0x5b')][_0xdc24('0x33')]);_0x31b3b3[_0xdc24('0x39')]=_[_0xdc24('0x48')](_0x5eca57[_0xdc24('0x39')]);_0x31b3b3[_0xdc24('0x3a')]=_[_0xdc24('0x3b')](_0x31b3b3[_0xdc24('0x37')],_0x31b3b3[_0xdc24('0x39')]);_0x9e1574['attributes']=_[_0xdc24('0x3b')](_0x31b3b3[_0xdc24('0x37')],qs['fields'](_0x5eca57[_0xdc24('0x39')][_0xdc24('0x3c')]));_0x9e1574[_0xdc24('0x3d')]=_0x9e1574[_0xdc24('0x3d')][_0xdc24('0x49')]?_0x9e1574[_0xdc24('0x3d')]:_0x31b3b3[_0xdc24('0x37')];_0x9e1574[_0xdc24('0x3e')]=qs[_0xdc24('0x3f')](_0x5eca57[_0xdc24('0x39')]['sort']);_0x9e1574['where']=qs['filters'](_['pick'](_0x5eca57[_0xdc24('0x39')],_0x31b3b3['filters']));if(_0x5eca57[_0xdc24('0x39')]['filter']){_0x9e1574[_0xdc24('0x40')]=_[_0xdc24('0x42')](_0x9e1574[_0xdc24('0x40')],{'$or':_[_0xdc24('0x38')](_0x9e1574['attributes'],function(_0x228d4e){var _0x3e5743={};_0x3e5743[_0x228d4e]={'$like':'%'+_0x5eca57[_0xdc24('0x39')][_0xdc24('0x41')]+'%'};return _0x3e5743;})});}_0x9e1574=_[_0xdc24('0x42')]({},_0x9e1574,_0x5eca57[_0xdc24('0x4b')]);return _0x53914f['getAgents'](_0x9e1574);}})[_0xdc24('0x29')](function(_0x3428ce){if(_0x3428ce){_0x450736=_0x3428ce[_0xdc24('0x49')];if(!_0x5eca57[_0xdc24('0x39')][_0xdc24('0x89')]('nolimit')){_0x9e1574['limit']=qs[_0xdc24('0x20')](_0x5eca57['query'][_0xdc24('0x20')]);_0x9e1574[_0xdc24('0x23')]=qs[_0xdc24('0x23')](_0x5eca57[_0xdc24('0x39')][_0xdc24('0x23')]);}return _0x53914f[_0xdc24('0x88')](_0x9e1574);}})['then'](function(_0x5da59c){if(_0x5da59c){return _0x5da59c?{'count':_0x450736,'rows':_0x5da59c}:null;}})[_0xdc24('0x29')](respondWithResult(_0x9abaac,null))[_0xdc24('0x4c')](handleError(_0x9abaac,null));}; \ No newline at end of file +var _0xe68e=['./faxQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','keys','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Team','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xe68e,0x74));var _0xee68=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xe68e[_0x5a6961];return _0x4af0a6;};'use strict';var emlformat=require(_0xee68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee68('0x1'));var jsonpatch=require(_0xee68('0x2'));var rp=require('request-promise');var moment=require(_0xee68('0x3'));var BPromise=require(_0xee68('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee68('0x5'));var sox=require(_0xee68('0x6'));var csv=require(_0xee68('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee68('0x8'));var _=require(_0xee68('0x9'));var squel=require(_0xee68('0xa'));var crypto=require('crypto');var jsforce=require(_0xee68('0xb'));var deskjs=require(_0xee68('0xc'));var toCsv=require(_0xee68('0x7'));var querystring=require(_0xee68('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee68('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee68('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xee68('0x10'));var config=require(_0xee68('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xee68('0x12'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xee68('0x13'),'port':0x18eb});var socket=require(_0xee68('0x14'))(new Redis(config['redis']));require(_0xee68('0x15'))[_0xee68('0x16')](socket);function respondWithStatusCode(_0x5c8a80,_0x5e49e9){_0x5e49e9=_0x5e49e9||0xcc;return function(_0x3ff38c){if(_0x3ff38c){return _0x5c8a80[_0xee68('0x17')](_0x5e49e9);}return _0x5c8a80['status'](_0x5e49e9)[_0xee68('0x18')]();};}function respondWithResult(_0x89b508,_0x26ca7){_0x26ca7=_0x26ca7||0xc8;return function(_0x24ee02){if(_0x24ee02){return _0x89b508[_0xee68('0x19')](_0x26ca7)[_0xee68('0x1a')](_0x24ee02);}};}function respondWithFilteredResult(_0x9e0921,_0x5e3b9b){return function(_0x393c24){if(_0x393c24){var _0x3da614=typeof _0x5e3b9b['offset']===_0xee68('0x1b')&&typeof _0x5e3b9b[_0xee68('0x1c')]===_0xee68('0x1b');var _0x29f034=_0x393c24['count'];var _0x98c850=_0x3da614?0x0:_0x5e3b9b[_0xee68('0x1d')];var _0x5ca5ab=_0x3da614?_0x393c24['count']:_0x5e3b9b[_0xee68('0x1d')]+_0x5e3b9b[_0xee68('0x1c')];var _0x5dbd5a;if(_0x5ca5ab>=_0x29f034){_0x5ca5ab=_0x29f034;_0x5dbd5a=0xc8;}else{_0x5dbd5a=0xce;}_0x9e0921[_0xee68('0x19')](_0x5dbd5a);return _0x9e0921[_0xee68('0x1e')](_0xee68('0x1f'),_0x98c850+'-'+_0x5ca5ab+'/'+_0x29f034)['json'](_0x393c24);}return null;};}function patchUpdates(_0x9fe70d){return function(_0x56458e){try{jsonpatch[_0xee68('0x20')](_0x56458e,_0x9fe70d,!![]);}catch(_0x391c3a){return BPromise['reject'](_0x391c3a);}return _0x56458e[_0xee68('0x21')]();};}function saveUpdates(_0x228110,_0x196846){return function(_0x2a1350){if(_0x2a1350){return _0x2a1350[_0xee68('0x22')](_0x228110)[_0xee68('0x23')](function(_0x2ce6c8){return _0x2ce6c8;});}return null;};}function removeEntity(_0x5c752d,_0x47a7ba){return function(_0x3e5b42){if(_0x3e5b42){return _0x3e5b42[_0xee68('0x24')]()[_0xee68('0x23')](function(){var _0x52c8ce=_0x3e5b42[_0xee68('0x25')]({'plain':!![]});var _0x12c9b7=_0xee68('0x26');return db[_0xee68('0x27')][_0xee68('0x24')]({'where':{'type':_0x12c9b7,'resourceId':_0x52c8ce['id']}})['then'](function(){return _0x3e5b42;});})[_0xee68('0x23')](function(){_0x5c752d['status'](0xcc)[_0xee68('0x18')]();});}};}function handleEntityNotFound(_0x1d8b5a,_0x15b1d5){return function(_0x20fb18){if(!_0x20fb18){_0x1d8b5a[_0xee68('0x17')](0x194);}return _0x20fb18;};}function handleError(_0x3822da,_0x33157a){_0x33157a=_0x33157a||0x1f4;return function(_0x3c056f){logger['error'](_0x3c056f['stack']);if(_0x3c056f[_0xee68('0x28')]){delete _0x3c056f['name'];}_0x3822da[_0xee68('0x19')](_0x33157a)[_0xee68('0x29')](_0x3c056f);};}exports[_0xee68('0x2a')]=function(_0x432508,_0x14f4e1){var _0x41ae24={},_0x30c927={},_0x57a58b={'count':0x0,'rows':[]};var _0x7888ea=_[_0xee68('0x2b')](db[_0xee68('0x2c')][_0xee68('0x2d')],function(_0x3b7758){return{'name':_0x3b7758[_0xee68('0x2e')],'type':_0x3b7758['type'][_0xee68('0x2f')]};});_0x30c927['model']=_[_0xee68('0x2b')](_0x7888ea,_0xee68('0x28'));_0x30c927[_0xee68('0x30')]=_['keys'](_0x432508[_0xee68('0x30')]);_0x30c927[_0xee68('0x31')]=_[_0xee68('0x32')](_0x30c927[_0xee68('0x33')],_0x30c927[_0xee68('0x30')]);_0x41ae24[_0xee68('0x34')]=_[_0xee68('0x32')](_0x30c927[_0xee68('0x33')],qs[_0xee68('0x35')](_0x432508[_0xee68('0x30')][_0xee68('0x35')]));_0x41ae24[_0xee68('0x34')]=_0x41ae24[_0xee68('0x34')][_0xee68('0x36')]?_0x41ae24[_0xee68('0x34')]:_0x30c927[_0xee68('0x33')];if(!_0x432508[_0xee68('0x30')][_0xee68('0x37')](_0xee68('0x38'))){_0x41ae24['limit']=qs[_0xee68('0x1c')](_0x432508[_0xee68('0x30')][_0xee68('0x1c')]);_0x41ae24[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x432508['query']['offset']);}_0x41ae24[_0xee68('0x39')]=qs[_0xee68('0x3a')](_0x432508[_0xee68('0x30')]['sort']);_0x41ae24[_0xee68('0x3b')]=qs[_0xee68('0x31')](_[_0xee68('0x3c')](_0x432508[_0xee68('0x30')],_0x30c927[_0xee68('0x31')]),_0x7888ea);if(_0x432508[_0xee68('0x30')][_0xee68('0x3d')]){_0x41ae24[_0xee68('0x3b')]=_[_0xee68('0x3e')](_0x41ae24[_0xee68('0x3b')],{'$or':_['map'](_0x7888ea,function(_0x35e21f){if(_0x35e21f[_0xee68('0x3f')]!==_0xee68('0x40')){var _0x16076e={};_0x16076e[_0x35e21f['name']]={'$like':'%'+_0x432508['query'][_0xee68('0x3d')]+'%'};return _0x16076e;}})});}_0x41ae24=_[_0xee68('0x3e')]({},_0x41ae24,_0x432508['options']);var _0x2966c7={'where':_0x41ae24[_0xee68('0x3b')]};return db[_0xee68('0x2c')][_0xee68('0x41')](_0x2966c7)[_0xee68('0x23')](function(_0x1308ef){_0x57a58b[_0xee68('0x41')]=_0x1308ef;if(_0x432508[_0xee68('0x30')][_0xee68('0x42')]){_0x41ae24[_0xee68('0x43')]=[{'all':!![]}];}return db[_0xee68('0x2c')][_0xee68('0x44')](_0x41ae24);})[_0xee68('0x23')](function(_0x3ab023){_0x57a58b[_0xee68('0x45')]=_0x3ab023;return _0x57a58b;})[_0xee68('0x23')](respondWithFilteredResult(_0x14f4e1,_0x41ae24))[_0xee68('0x46')](handleError(_0x14f4e1,null));};exports[_0xee68('0x47')]=function(_0x1f1f70,_0x2f3847){var _0x1b3f22={'raw':!![],'where':{'id':_0x1f1f70[_0xee68('0x48')]['id']}},_0x30b917={};_0x30b917['model']=_['keys'](db[_0xee68('0x2c')]['rawAttributes']);_0x30b917[_0xee68('0x30')]=_['keys'](_0x1f1f70[_0xee68('0x30')]);_0x30b917[_0xee68('0x31')]=_[_0xee68('0x32')](_0x30b917[_0xee68('0x33')],_0x30b917['query']);_0x1b3f22[_0xee68('0x34')]=_['intersection'](_0x30b917[_0xee68('0x33')],qs[_0xee68('0x35')](_0x1f1f70[_0xee68('0x30')][_0xee68('0x35')]));_0x1b3f22['attributes']=_0x1b3f22['attributes'][_0xee68('0x36')]?_0x1b3f22['attributes']:_0x30b917[_0xee68('0x33')];if(_0x1f1f70[_0xee68('0x30')][_0xee68('0x42')]){_0x1b3f22[_0xee68('0x43')]=[{'all':!![]}];}_0x1b3f22=_[_0xee68('0x3e')]({},_0x1b3f22,_0x1f1f70[_0xee68('0x49')]);return db[_0xee68('0x2c')][_0xee68('0x4a')](_0x1b3f22)['then'](handleEntityNotFound(_0x2f3847,null))[_0xee68('0x23')](respondWithResult(_0x2f3847,null))[_0xee68('0x46')](handleError(_0x2f3847,null));};exports[_0xee68('0x4b')]=function(_0x318bfb,_0x3ba412){return db['FaxQueue']['create'](_0x318bfb[_0xee68('0x4c')],{})[_0xee68('0x23')](function(_0x25ab08){var _0x3b5876=_0x318bfb['user']['get']({'plain':!![]});if(!_0x3b5876)throw new Error(_0xee68('0x4d'));if(_0x3b5876[_0xee68('0x4e')]==='user'){var _0x3eaf01=_0x25ab08[_0xee68('0x25')]({'plain':!![]});var _0x5c5b25=_0xee68('0x26');return db['UserProfileSection'][_0xee68('0x4a')]({'where':{'name':_0x5c5b25,'userProfileId':_0x3b5876['userProfileId']},'raw':!![]})[_0xee68('0x23')](function(_0x1ee94a){if(_0x1ee94a&&_0x1ee94a[_0xee68('0x4f')]===0x0){return db[_0xee68('0x27')][_0xee68('0x4b')]({'name':_0x3eaf01[_0xee68('0x28')],'resourceId':_0x3eaf01['id'],'type':_0x1ee94a[_0xee68('0x28')],'sectionId':_0x1ee94a['id']},{})[_0xee68('0x23')](function(){return _0x25ab08;});}else{return _0x25ab08;}})[_0xee68('0x46')](function(_0x1fb657){logger[_0xee68('0x50')](_0xee68('0x51'),_0x1fb657);throw _0x1fb657;});}return _0x25ab08;})['then'](respondWithResult(_0x3ba412,0xc9))[_0xee68('0x46')](handleError(_0x3ba412,null));};exports[_0xee68('0x22')]=function(_0x536076,_0x19e81c){if(_0x536076[_0xee68('0x4c')]['id']){delete _0x536076[_0xee68('0x4c')]['id'];}return db[_0xee68('0x2c')]['find']({'where':{'id':_0x536076[_0xee68('0x48')]['id']}})['then'](handleEntityNotFound(_0x19e81c,null))[_0xee68('0x23')](saveUpdates(_0x536076[_0xee68('0x4c')],null))[_0xee68('0x23')](respondWithResult(_0x19e81c,null))[_0xee68('0x46')](handleError(_0x19e81c,null));};exports[_0xee68('0x24')]=function(_0x1f49ca,_0x2a5298){return db[_0xee68('0x2c')][_0xee68('0x4a')]({'where':{'id':_0x1f49ca['params']['id']}})[_0xee68('0x23')](handleEntityNotFound(_0x2a5298,null))['then'](removeEntity(_0x2a5298,null))[_0xee68('0x46')](handleError(_0x2a5298,null));};exports[_0xee68('0x52')]=function(_0x5736a7,_0x2ca917){return db[_0xee68('0x2c')]['describe']()[_0xee68('0x23')](respondWithResult(_0x2ca917,null))[_0xee68('0x46')](handleError(_0x2ca917,null));};exports['getMembers']=function(_0x59dab9,_0x21a607,_0x5b36d7){var _0x5027fd={'raw':!![],'where':{}},_0x1a8b40={},_0x2e7a67;return db[_0xee68('0x2c')]['findOne']({'where':{'id':_0x59dab9[_0xee68('0x48')]['id']}})[_0xee68('0x23')](handleEntityNotFound(_0x21a607,null))[_0xee68('0x23')](function(_0xc91889){if(_0xc91889){_0x2e7a67=_0xc91889[_0xee68('0x25')]({'plain':!![]});_0x1a8b40[_0xee68('0x33')]=_[_0xee68('0x53')](db[_0xee68('0x54')][_0xee68('0x2d')]);_0x1a8b40[_0xee68('0x30')]=_[_0xee68('0x53')](_0x59dab9[_0xee68('0x30')]);_0x1a8b40[_0xee68('0x31')]=_['intersection'](_0x1a8b40[_0xee68('0x33')],_0x1a8b40[_0xee68('0x30')]);_0x5027fd['attributes']=_[_0xee68('0x32')](_0x1a8b40['model'],qs[_0xee68('0x35')](_0x59dab9[_0xee68('0x30')][_0xee68('0x35')]));_0x5027fd[_0xee68('0x34')]=_0x5027fd[_0xee68('0x34')][_0xee68('0x36')]?_0x5027fd[_0xee68('0x34')]:_0x1a8b40['model'];if(!_0x59dab9[_0xee68('0x30')][_0xee68('0x37')](_0xee68('0x38'))){_0x5027fd[_0xee68('0x1c')]=qs[_0xee68('0x1c')](_0x59dab9['query'][_0xee68('0x1c')]);_0x5027fd[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x59dab9[_0xee68('0x30')][_0xee68('0x1d')]);}_0x5027fd[_0xee68('0x39')]=qs[_0xee68('0x3a')](_0x59dab9['query']['sort']);_0x5027fd['where']=qs['filters'](_[_0xee68('0x3c')](_0x59dab9[_0xee68('0x30')],_0x1a8b40[_0xee68('0x31')]));_0x5027fd[_0xee68('0x3b')][_0xee68('0x55')]=_0xc91889['id'];if(_0x59dab9[_0xee68('0x30')]['filter']){_0x5027fd[_0xee68('0x3b')]=_[_0xee68('0x3e')](_0x5027fd['where'],{'$or':_[_0xee68('0x2b')](_0x5027fd[_0xee68('0x34')],function(_0x1bc576){var _0x32ffe6={};_0x32ffe6[_0x1bc576]={'$like':'%'+_0x59dab9[_0xee68('0x30')][_0xee68('0x3d')]+'%'};return _0x32ffe6;})});}_0x5027fd=_[_0xee68('0x3e')]({},_0x5027fd,_0x59dab9[_0xee68('0x49')]);return db[_0xee68('0x54')]['findAll'](_0x5027fd);}})['then'](function(_0x3799a3){if(_0x3799a3){return db[_0xee68('0x56')][_0xee68('0x57')]({'where':{'id':_[_0xee68('0x2b')](_0x3799a3,_0xee68('0x58')),'role':_0xee68('0x59')},'attributes':['id','name',_0xee68('0x5a'),_0xee68('0x5b'),_0xee68('0x5c')]});}})[_0xee68('0x23')](function(_0x4badc8){if(_0x4badc8){return{'count':_0x4badc8[_0xee68('0x41')],'rows':_[_0xee68('0x2b')](_0x4badc8[_0xee68('0x45')],function(_0x1f2408){return{'membername':_0x1f2408[_0xee68('0x28')],'UserId':_0x1f2408['id'],'queue_name':_0x2e7a67[_0xee68('0x28')],'FaxQueueId':_0x2e7a67['id'],'interface':util[_0xee68('0x5d')](_0xee68('0x5e'),_0xee68('0x5f'),_0x1f2408[_0xee68('0x28')]),'penalty':0x0,'paused':_0x1f2408['faxPause'],'createdAt':_0x1f2408['createdAt'],'updatedAt':_0x1f2408[_0xee68('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x21a607,_0x5027fd))[_0xee68('0x46')](handleError(_0x21a607,null));};exports[_0xee68('0x60')]=function(_0x2cdabf,_0x36b83c,_0x126c08){var _0x7b3080={};var _0xcd9060={};var _0x4023ba;var _0x3f059f;return db[_0xee68('0x2c')][_0xee68('0x61')]({'where':{'id':_0x2cdabf[_0xee68('0x48')]['id']}})[_0xee68('0x23')](handleEntityNotFound(_0x36b83c,null))[_0xee68('0x23')](function(_0x4a3711){if(_0x4a3711){_0x4023ba=_0x4a3711;_0xcd9060['model']=_[_0xee68('0x53')](db['Team'][_0xee68('0x2d')]);_0xcd9060[_0xee68('0x30')]=_[_0xee68('0x53')](_0x2cdabf[_0xee68('0x30')]);_0xcd9060[_0xee68('0x31')]=_[_0xee68('0x32')](_0xcd9060[_0xee68('0x33')],_0xcd9060[_0xee68('0x30')]);_0x7b3080[_0xee68('0x34')]=_[_0xee68('0x32')](_0xcd9060[_0xee68('0x33')],qs[_0xee68('0x35')](_0x2cdabf[_0xee68('0x30')][_0xee68('0x35')]));_0x7b3080[_0xee68('0x34')]=_0x7b3080['attributes'][_0xee68('0x36')]?_0x7b3080['attributes']:_0xcd9060[_0xee68('0x33')];_0x7b3080[_0xee68('0x39')]=qs[_0xee68('0x3a')](_0x2cdabf[_0xee68('0x30')]['sort']);_0x7b3080[_0xee68('0x3b')]=qs[_0xee68('0x31')](_[_0xee68('0x3c')](_0x2cdabf['query'],_0xcd9060[_0xee68('0x31')]));if(_0x2cdabf['query'][_0xee68('0x3d')]){_0x7b3080['where']=_[_0xee68('0x3e')](_0x7b3080[_0xee68('0x3b')],{'$or':_['map'](_0x7b3080[_0xee68('0x34')],function(_0x3d7e8e){var _0x450d53={};_0x450d53[_0x3d7e8e]={'$like':'%'+_0x2cdabf[_0xee68('0x30')][_0xee68('0x3d')]+'%'};return _0x450d53;})});}_0x7b3080=_[_0xee68('0x3e')]({},_0x7b3080,_0x2cdabf[_0xee68('0x49')]);return _0x4023ba['getTeams'](_0x7b3080);}})['then'](function(_0x2fd573){if(_0x2fd573){_0x3f059f=_0x2fd573[_0xee68('0x36')];if(!_0x2cdabf[_0xee68('0x30')][_0xee68('0x37')](_0xee68('0x38'))){_0x7b3080[_0xee68('0x1c')]=qs[_0xee68('0x1c')](_0x2cdabf[_0xee68('0x30')][_0xee68('0x1c')]);_0x7b3080[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x2cdabf[_0xee68('0x30')][_0xee68('0x1d')]);}return _0x4023ba[_0xee68('0x60')](_0x7b3080);}})[_0xee68('0x23')](function(_0x2923f6){if(_0x2923f6){return _0x2923f6?{'count':_0x3f059f,'rows':_0x2923f6}:null;}})[_0xee68('0x23')](respondWithResult(_0x36b83c,null))[_0xee68('0x46')](handleError(_0x36b83c,null));};exports[_0xee68('0x62')]=function(_0x3ef0f4,_0x41835b,_0x343699){var _0x4d0823=_0x3ef0f4[_0xee68('0x4c')][_0xee68('0x63')];return db[_0xee68('0x64')][_0xee68('0x44')]({'where':{'id':_0x4d0823},'attributes':['id'],'include':[{'model':db[_0xee68('0x56')],'as':_0xee68('0x65'),'attributes':['id',_0xee68('0x28'),_0xee68('0x66'),'voicePause',_0xee68('0x67')],'raw':!![]}]})[_0xee68('0x23')](function(_0x1fdcf6){if(_0x1fdcf6){var _0x505176=_['flatMap'](_0x1fdcf6,function(_0x337023){var _0x3899ae=_0x337023[_0xee68('0x25')]({'plain':!![]});return _0x3899ae[_0xee68('0x65')];});return db[_0xee68('0x2c')][_0xee68('0x4a')]({'where':{'id':_0x3ef0f4[_0xee68('0x48')]['id']}})[_0xee68('0x23')](function(_0x567f25){return db[_0xee68('0x68')][_0xee68('0x69')](function(_0x3c007a){return _0x567f25[_0xee68('0x62')](_0x4d0823,{'transaction':_0x3c007a})['then'](function(){return BPromise[_0xee68('0x6a')](_0x505176,function(_0x4cac48){return db[_0xee68('0x54')][_0xee68('0x6b')]({'where':{'UserId':_0x4cac48['id'],'FaxQueueId':_0x3ef0f4[_0xee68('0x48')]['id']},'transaction':_0x3c007a});});})[_0xee68('0x23')](function(){_0x505176[_0xee68('0x6c')](function(_0x2abd11){socket[_0xee68('0x6d')](_0xee68('0x6e'),{'UserId':_0x2abd11['id'],'FaxQueueId':_0x567f25['id']});});});});});}})[_0xee68('0x23')](respondWithStatusCode(_0x41835b,null))[_0xee68('0x46')](handleError(_0x41835b,null));};exports[_0xee68('0x6f')]=function(_0x461912,_0x5a30a6,_0x2ffd72){return db[_0xee68('0x64')][_0xee68('0x44')]({'where':{'id':_0x461912[_0xee68('0x30')][_0xee68('0x63')]},'attributes':['id'],'include':[{'model':db[_0xee68('0x56')],'as':_0xee68('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a30a6,null))[_0xee68('0x23')](function(_0x5c6531){var _0x3cfa1c=_[_0xee68('0x2b')](_0x5c6531,'id');var _0x40e57b=[];var _0x13e019=[];var _0x67e832=squel['select']();_0x67e832[_0xee68('0x70')](_0xee68('0x71'))[_0xee68('0x72')]('team_has_fax_queues','tq')[_0xee68('0x73')](_0xee68('0x74'),'ut',_0xee68('0x75'))[_0xee68('0x3b')](_0xee68('0x76'),_0x461912[_0xee68('0x48')]['id']);for(var _0x5647fe=0x0;_0x5647fe<_0x5c6531[_0xee68('0x36')];_0x5647fe+=0x1){let _0x82be32=_0x5c6531[_0x5647fe];for(var _0x377c44=0x0;_0x377c44<_0x82be32[_0xee68('0x65')][_0xee68('0x36')];_0x377c44+=0x1){let _0x3f9950=_0x82be32[_0xee68('0x65')][_0x377c44];var _0x2bf60e=_0x67e832[_0xee68('0x77')]();_0x2bf60e[_0xee68('0x3b')](_0xee68('0x78'),_0x3f9950['id']);_0x13e019['push'](db['sequelize']['query'](_0x2bf60e[_0xee68('0x79')](),{'type':db[_0xee68('0x68')][_0xee68('0x7a')][_0xee68('0x7b')]})[_0xee68('0x23')](function(_0x3fa537){if(_0x3fa537['length']===0x1){return _0x3f9950['id'];}else{var _0x3b0d6b=_[_0xee68('0x7c')](_['map'](_0x3fa537,_0xee68('0x7d')),function(_0x3b210f){return _[_0xee68('0x7e')](_0x3cfa1c,_0x3b210f);});if(_0x3b0d6b){return _0x3f9950['id'];}}}));}}return BPromise['all'](_0x13e019)[_0xee68('0x23')](function(_0x4da1){_0x40e57b=_(_0x40e57b)[_0xee68('0x7f')](_0x4da1)[_0xee68('0x80')]()[_0xee68('0x81')]();return db['FaxQueue'][_0xee68('0x4a')]({'where':{'id':_0x461912[_0xee68('0x48')]['id']}})[_0xee68('0x23')](function(_0x4ca6e2){return db[_0xee68('0x68')][_0xee68('0x69')](function(_0x40aae2){return _0x4ca6e2[_0xee68('0x6f')](_0x461912[_0xee68('0x30')][_0xee68('0x63')],{'transaction':_0x40aae2})['then'](function(){if(!_['isEmpty'](_0x40e57b)){return _0x4ca6e2['removeAgents'](_0x40e57b,{'transaction':_0x40aae2});}})[_0xee68('0x23')](function(){_0x40e57b[_0xee68('0x6c')](function(_0x1b67c5){socket[_0xee68('0x6d')]('userFaxQueue:remove',{'UserId':_0x1b67c5,'FaxQueueId':_0x4ca6e2['id']});});});});});});})['then'](respondWithStatusCode(_0x5a30a6,null))[_0xee68('0x46')](handleError(_0x5a30a6,null));};exports[_0xee68('0x82')]=function(_0x1f4ad8,_0x20d035,_0x347526){return db[_0xee68('0x2c')]['find']({'where':{'id':_0x1f4ad8['params']['id']}})[_0xee68('0x23')](handleEntityNotFound(_0x20d035,null))[_0xee68('0x23')](function(_0x2c070c){if(_0x2c070c){return _0x2c070c[_0xee68('0x82')](_0x1f4ad8[_0xee68('0x4c')][_0xee68('0x63')],_[_0xee68('0x83')](_0x1f4ad8[_0xee68('0x4c')],['ids','id'])||{})[_0xee68('0x84')](function(_0x3b6698){for(var _0x2c6346=0x0;_0x2c6346<_0x1f4ad8['body']['ids'][_0xee68('0x36')];_0x2c6346+=0x1){socket[_0xee68('0x6d')]('userFaxQueue:save',{'UserId':Number(_0x1f4ad8[_0xee68('0x4c')][_0xee68('0x63')][_0x2c6346]),'FaxQueueId':Number(_0x1f4ad8[_0xee68('0x48')]['id'])});}return _0x3b6698;});}})[_0xee68('0x23')](respondWithResult(_0x20d035,null))[_0xee68('0x46')](handleError(_0x20d035,null));};exports[_0xee68('0x85')]=function(_0x4942e6,_0xc62143,_0x332c44){return db[_0xee68('0x2c')][_0xee68('0x4a')]({'where':{'id':_0x4942e6[_0xee68('0x48')]['id']}})['then'](handleEntityNotFound(_0xc62143,null))[_0xee68('0x23')](function(_0x536d4c){if(_0x536d4c){return _0x536d4c[_0xee68('0x85')](_0x4942e6[_0xee68('0x30')][_0xee68('0x63')])[_0xee68('0x23')](function(){if(_[_0xee68('0x86')](_0x4942e6[_0xee68('0x30')][_0xee68('0x63')])){for(var _0x34b4fc=0x0;_0x34b4fc<_0x4942e6[_0xee68('0x30')][_0xee68('0x63')][_0xee68('0x36')];_0x34b4fc+=0x1){socket[_0xee68('0x6d')](_0xee68('0x87'),{'UserId':Number(_0x4942e6['query'][_0xee68('0x63')][_0x34b4fc]),'FaxQueueId':Number(_0x4942e6[_0xee68('0x48')]['id'])});}}else{socket['emit'](_0xee68('0x87'),{'UserId':Number(_0x4942e6[_0xee68('0x30')][_0xee68('0x63')]),'FaxQueueId':Number(_0x4942e6[_0xee68('0x48')]['id'])});}});}})[_0xee68('0x23')](respondWithStatusCode(_0xc62143,null))[_0xee68('0x46')](handleError(_0xc62143,null));};exports['getAgents']=function(_0x59ab2f,_0x5e00d5,_0x2653f8){var _0x28dcb3={};var _0x44886e={};var _0x3f6f02;var _0x1868cc;return db[_0xee68('0x2c')][_0xee68('0x61')]({'where':{'id':_0x59ab2f[_0xee68('0x48')]['id']}})[_0xee68('0x23')](handleEntityNotFound(_0x5e00d5,null))['then'](function(_0x5f4be2){if(_0x5f4be2){_0x3f6f02=_0x5f4be2;_0x44886e[_0xee68('0x33')]=_[_0xee68('0x53')](db[_0xee68('0x56')][_0xee68('0x2d')]);_0x44886e['query']=_[_0xee68('0x53')](_0x59ab2f['query']);_0x44886e['filters']=_[_0xee68('0x32')](_0x44886e['model'],_0x44886e[_0xee68('0x30')]);_0x28dcb3['attributes']=_[_0xee68('0x32')](_0x44886e[_0xee68('0x33')],qs[_0xee68('0x35')](_0x59ab2f[_0xee68('0x30')][_0xee68('0x35')]));_0x28dcb3[_0xee68('0x34')]=_0x28dcb3[_0xee68('0x34')][_0xee68('0x36')]?_0x28dcb3[_0xee68('0x34')]:_0x44886e[_0xee68('0x33')];_0x28dcb3['order']=qs[_0xee68('0x3a')](_0x59ab2f[_0xee68('0x30')][_0xee68('0x3a')]);_0x28dcb3[_0xee68('0x3b')]=qs[_0xee68('0x31')](_['pick'](_0x59ab2f[_0xee68('0x30')],_0x44886e[_0xee68('0x31')]));if(_0x59ab2f['query'][_0xee68('0x3d')]){_0x28dcb3[_0xee68('0x3b')]=_['merge'](_0x28dcb3[_0xee68('0x3b')],{'$or':_[_0xee68('0x2b')](_0x28dcb3[_0xee68('0x34')],function(_0x47b222){var _0x1b0241={};_0x1b0241[_0x47b222]={'$like':'%'+_0x59ab2f['query'][_0xee68('0x3d')]+'%'};return _0x1b0241;})});}_0x28dcb3=_['merge']({},_0x28dcb3,_0x59ab2f[_0xee68('0x49')]);return _0x3f6f02[_0xee68('0x88')](_0x28dcb3);}})['then'](function(_0x21e271){if(_0x21e271){_0x1868cc=_0x21e271[_0xee68('0x36')];if(!_0x59ab2f[_0xee68('0x30')][_0xee68('0x37')]('nolimit')){_0x28dcb3['limit']=qs[_0xee68('0x1c')](_0x59ab2f[_0xee68('0x30')][_0xee68('0x1c')]);_0x28dcb3[_0xee68('0x1d')]=qs[_0xee68('0x1d')](_0x59ab2f[_0xee68('0x30')][_0xee68('0x1d')]);}return _0x3f6f02[_0xee68('0x88')](_0x28dcb3);}})[_0xee68('0x23')](function(_0x65abec){if(_0x65abec){return _0x65abec?{'count':_0x1868cc,'rows':_0x65abec}:null;}})[_0xee68('0x23')](respondWithResult(_0x5e00d5,null))[_0xee68('0x46')](handleError(_0x5e00d5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index bda64c9..6b2939a 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 _0xe149=['FaxQueue','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x165873,_0xf4b08c){var _0x45923b=function(_0x383083){while(--_0x383083){_0x165873['push'](_0x165873['shift']());}};_0x45923b(++_0xf4b08c);}(_0xe149,0xb4));var _0x9e14=function(_0x64d162,_0x4428cb){_0x64d162=_0x64d162-0x0;var _0x2a1889=_0xe149[_0x64d162];return _0x2a1889;};'use strict';var EventEmitter=require(_0x9e14('0x0'));var FaxQueue=require(_0x9e14('0x1'))['db'][_0x9e14('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10284e){return function(_0x2d5114,_0x3e7a14,_0x5be035){FaxQueueEvents[_0x9e14('0x3')](_0x10284e+':'+_0x2d5114['id'],_0x2d5114);FaxQueueEvents['emit'](_0x10284e,_0x2d5114);_0x5be035(null);};}for(var e in events){if(events[_0x9e14('0x4')](e)){var event=events[e];FaxQueue[_0x9e14('0x5')](e,emitEvent(event));}}module[_0x9e14('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xd8d3=['hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','emit'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xd8d3,0x146));var _0x3d8d=function(_0x116be7,_0x489133){_0x116be7=_0x116be7-0x0;var _0x51435f=_0xd8d3[_0x116be7];return _0x51435f;};'use strict';var EventEmitter=require(_0x3d8d('0x0'));var FaxQueue=require(_0x3d8d('0x1'))['db'][_0x3d8d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3d8d('0x3')](0x0);var events={'afterCreate':_0x3d8d('0x4'),'afterUpdate':_0x3d8d('0x5'),'afterDestroy':'remove'};function emitEvent(_0xab1265){return function(_0x382eb5,_0x4cd333,_0xd159ec){FaxQueueEvents['emit'](_0xab1265+':'+_0x382eb5['id'],_0x382eb5);FaxQueueEvents[_0x3d8d('0x6')](_0xab1265,_0x382eb5);_0xd159ec(null);};}for(var e in events){if(events[_0x3d8d('0x7')](e)){var event=events[e];FaxQueue[_0x3d8d('0x8')](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 361de13..1561ab3 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 _0x6f1a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','lodash','../../config/logger'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x6f1a,0x8e));var _0xa6f1=function(_0x7e79bc,_0x795e31){_0x7e79bc=_0x7e79bc-0x0;var _0x49cd92=_0x6f1a[_0x7e79bc];return _0x49cd92;};'use strict';var _=require(_0xa6f1('0x0'));var util=require('util');var logger=require(_0xa6f1('0x1'))('api');var moment=require(_0xa6f1('0x2'));var BPromise=require(_0xa6f1('0x3'));var rp=require(_0xa6f1('0x4'));var fs=require('fs');var path=require(_0xa6f1('0x5'));var rimraf=require(_0xa6f1('0x6'));var config=require(_0xa6f1('0x7'));var attributes=require(_0xa6f1('0x8'));module[_0xa6f1('0x9')]=function(_0x416b1c,_0x5786b4){return _0x416b1c[_0xa6f1('0xa')](_0xa6f1('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67ae=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67ae,0x118));var _0xe67a=function(_0x2a0a2c,_0x547451){_0x2a0a2c=_0x2a0a2c-0x0;var _0x59e2ce=_0x67ae[_0x2a0a2c];return _0x59e2ce;};'use strict';var _=require(_0xe67a('0x0'));var util=require(_0xe67a('0x1'));var logger=require(_0xe67a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe67a('0x3'));var rp=require(_0xe67a('0x4'));var fs=require('fs');var path=require(_0xe67a('0x5'));var rimraf=require(_0xe67a('0x6'));var config=require(_0xe67a('0x7'));var attributes=require('./faxQueue.attributes');module[_0xe67a('0x8')]=function(_0x2897b1,_0x576660){return _0x2897b1[_0xe67a('0x9')](_0xe67a('0xa'),attributes,{'tableName':_0xe67a('0xb'),'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 db81625..46f39cf 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 _0xfe88=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetFaxQueue','ShowFaxQueue','find','stringify','lodash','util','moment','bluebird'];(function(_0x454bd3,_0x3e4d94){var _0x4eb066=function(_0x4478fa){while(--_0x4478fa){_0x454bd3['push'](_0x454bd3['shift']());}};_0x4eb066(++_0x3e4d94);}(_0xfe88,0xac));var _0x8fe8=function(_0x578a80,_0x412698){_0x578a80=_0x578a80-0x0;var _0x4b4ba8=_0xfe88[_0x578a80];return _0x4b4ba8;};'use strict';var _=require(_0x8fe8('0x0'));var util=require(_0x8fe8('0x1'));var moment=require(_0x8fe8('0x2'));var BPromise=require(_0x8fe8('0x3'));var rs=require(_0x8fe8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fe8('0x5'))['db'];var utils=require(_0x8fe8('0x6'));var logger=require(_0x8fe8('0x7'))(_0x8fe8('0x8'));var config=require(_0x8fe8('0x9'));var jayson=require(_0x8fe8('0xa'));var client=jayson[_0x8fe8('0xb')][_0x8fe8('0xc')]({'port':0x232a});config[_0x8fe8('0xd')]=_[_0x8fe8('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8fe8('0xf'))(new Redis(config[_0x8fe8('0xd')]));require(_0x8fe8('0x10'))[_0x8fe8('0x11')](socket);function respondWithRpcPromise(_0x58c197,_0x2ccd92,_0x215e38){return new BPromise(function(_0x3071e9,_0x4e30dd){return client[_0x8fe8('0x12')](_0x58c197,_0x215e38)[_0x8fe8('0x13')](function(_0x5c0dca){logger[_0x8fe8('0x14')](_0x8fe8('0x15'),_0x2ccd92,_0x8fe8('0x16'));logger[_0x8fe8('0x17')](_0x8fe8('0x18'),_0x2ccd92,_0x8fe8('0x16'),JSON['stringify'](_0x5c0dca));if(_0x5c0dca[_0x8fe8('0x19')]){if(_0x5c0dca[_0x8fe8('0x19')][_0x8fe8('0x1a')]===0x1f4){logger[_0x8fe8('0x19')](_0x8fe8('0x15'),_0x2ccd92,_0x5c0dca[_0x8fe8('0x19')][_0x8fe8('0x1b')]);return _0x4e30dd(_0x5c0dca[_0x8fe8('0x19')][_0x8fe8('0x1b')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x2ccd92,_0x5c0dca['error'][_0x8fe8('0x1b')]);return _0x3071e9(_0x5c0dca[_0x8fe8('0x19')]['message']);}else{logger[_0x8fe8('0x14')]('FaxQueue,\x20%s,\x20%s',_0x2ccd92,_0x8fe8('0x16'));_0x3071e9(_0x5c0dca[_0x8fe8('0x1c')]['message']);}})[_0x8fe8('0x1d')](function(_0x68ba2a){logger[_0x8fe8('0x19')](_0x8fe8('0x15'),_0x2ccd92,_0x68ba2a);_0x4e30dd(_0x68ba2a);});});}exports['GetFaxQueue']=function(_0x5f114c){var _0x2e8f9c=this;return new Promise(function(_0x363aa6,_0x3ec439){return db[_0x8fe8('0x1e')][_0x8fe8('0x1f')]({'raw':_0x5f114c[_0x8fe8('0x20')]?_0x5f114c[_0x8fe8('0x20')][_0x8fe8('0x21')]===undefined?!![]:![]:!![],'where':_0x5f114c[_0x8fe8('0x20')]?_0x5f114c['options'][_0x8fe8('0x22')]||null:null,'attributes':_0x5f114c['options']?_0x5f114c[_0x8fe8('0x20')][_0x8fe8('0x23')]||null:null,'limit':_0x5f114c[_0x8fe8('0x20')]?_0x5f114c[_0x8fe8('0x20')][_0x8fe8('0x24')]||null:null,'include':_0x5f114c[_0x8fe8('0x20')]?_0x5f114c[_0x8fe8('0x20')][_0x8fe8('0x25')]?_['map'](_0x5f114c[_0x8fe8('0x20')][_0x8fe8('0x25')],function(_0xff2f9a){return{'model':db[_0xff2f9a[_0x8fe8('0x26')]],'as':_0xff2f9a['as'],'attributes':_0xff2f9a[_0x8fe8('0x23')],'include':_0xff2f9a[_0x8fe8('0x25')]?_[_0x8fe8('0x27')](_0xff2f9a['include'],function(_0x36ca4d){return{'model':db[_0x36ca4d['model']],'as':_0x36ca4d['as'],'attributes':_0x36ca4d['attributes'],'include':_0x36ca4d['include']?_[_0x8fe8('0x27')](_0x36ca4d[_0x8fe8('0x25')],function(_0x400c98){return{'model':db[_0x400c98[_0x8fe8('0x26')]],'as':_0x400c98['as'],'attributes':_0x400c98[_0x8fe8('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8fe8('0x13')](function(_0x557e74){logger[_0x8fe8('0x14')](_0x8fe8('0x28'),_0x5f114c);logger[_0x8fe8('0x17')]('GetFaxQueue',_0x5f114c,JSON['stringify'](_0x557e74));_0x363aa6(_0x557e74);})[_0x8fe8('0x1d')](function(_0x13a4d0){logger[_0x8fe8('0x19')]('GetFaxQueue',_0x13a4d0[_0x8fe8('0x1b')],_0x5f114c);_0x3ec439(_0x2e8f9c['error'](0x1f4,_0x13a4d0[_0x8fe8('0x1b')]));});});};exports[_0x8fe8('0x29')]=function(_0x51728b){var _0x4e8682=this;return new Promise(function(_0x1b9f11,_0x159632){return db[_0x8fe8('0x1e')][_0x8fe8('0x2a')]({'raw':_0x51728b[_0x8fe8('0x20')]?_0x51728b[_0x8fe8('0x20')][_0x8fe8('0x21')]===undefined?!![]:![]:!![],'where':_0x51728b[_0x8fe8('0x20')]?_0x51728b[_0x8fe8('0x20')][_0x8fe8('0x22')]||null:null,'attributes':_0x51728b[_0x8fe8('0x20')]?_0x51728b['options'][_0x8fe8('0x23')]||null:null,'include':_0x51728b['options']?_0x51728b['options']['include']?_[_0x8fe8('0x27')](_0x51728b[_0x8fe8('0x20')][_0x8fe8('0x25')],function(_0x173ade){return{'model':db[_0x173ade[_0x8fe8('0x26')]],'as':_0x173ade['as'],'attributes':_0x173ade[_0x8fe8('0x23')],'include':_0x173ade[_0x8fe8('0x25')]?_['map'](_0x173ade[_0x8fe8('0x25')],function(_0xe97600){return{'model':db[_0xe97600[_0x8fe8('0x26')]],'as':_0xe97600['as'],'attributes':_0xe97600['attributes'],'include':_0xe97600[_0x8fe8('0x25')]?_[_0x8fe8('0x27')](_0xe97600[_0x8fe8('0x25')],function(_0xa74cf1){return{'model':db[_0xa74cf1[_0x8fe8('0x26')]],'as':_0xa74cf1['as'],'attributes':_0xa74cf1['attributes']};}):[]};}):[]};}):[]:[]})[_0x8fe8('0x13')](function(_0x1663eb){logger[_0x8fe8('0x14')](_0x8fe8('0x29'),_0x51728b);logger[_0x8fe8('0x17')](_0x8fe8('0x29'),_0x51728b,JSON[_0x8fe8('0x2b')](_0x1663eb));_0x1b9f11(_0x1663eb);})['catch'](function(_0x4ef346){logger['error'](_0x8fe8('0x29'),_0x4ef346['message'],_0x51728b);_0x159632(_0x4e8682['error'](0x1f4,_0x4ef346['message']));});});}; \ No newline at end of file +var _0x6f11=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFaxQueue','options','raw','where','include','map','model','attributes','ShowFaxQueue','find'];(function(_0x36ecde,_0x3e66e3){var _0x4bf6e5=function(_0xe0c55e){while(--_0xe0c55e){_0x36ecde['push'](_0x36ecde['shift']());}};_0x4bf6e5(++_0x3e66e3);}(_0x6f11,0x90));var _0x16f1=function(_0x6bdfa4,_0x3184c3){_0x6bdfa4=_0x6bdfa4-0x0;var _0x58615d=_0x6f11[_0x6bdfa4];return _0x58615d;};'use strict';var _=require('lodash');var util=require(_0x16f1('0x0'));var moment=require(_0x16f1('0x1'));var BPromise=require(_0x16f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16f1('0x3'));var db=require(_0x16f1('0x4'))['db'];var utils=require(_0x16f1('0x5'));var logger=require(_0x16f1('0x6'))(_0x16f1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x16f1('0x8')]({'port':0x232a});config[_0x16f1('0x9')]=_[_0x16f1('0xa')](config[_0x16f1('0x9')],{'host':_0x16f1('0xb'),'port':0x18eb});var socket=require(_0x16f1('0xc'))(new Redis(config[_0x16f1('0x9')]));require(_0x16f1('0xd'))[_0x16f1('0xe')](socket);function respondWithRpcPromise(_0x1e00f5,_0x428ec0,_0xdd15b6){return new BPromise(function(_0x45066,_0x13a493){return client[_0x16f1('0xf')](_0x1e00f5,_0xdd15b6)[_0x16f1('0x10')](function(_0xeed292){logger['info'](_0x16f1('0x11'),_0x428ec0,_0x16f1('0x12'));logger[_0x16f1('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x428ec0,'request\x20sent',JSON[_0x16f1('0x14')](_0xeed292));if(_0xeed292[_0x16f1('0x15')]){if(_0xeed292[_0x16f1('0x15')][_0x16f1('0x16')]===0x1f4){logger[_0x16f1('0x15')]('FaxQueue,\x20%s,\x20%s',_0x428ec0,_0xeed292['error'][_0x16f1('0x17')]);return _0x13a493(_0xeed292[_0x16f1('0x15')][_0x16f1('0x17')]);}logger[_0x16f1('0x15')](_0x16f1('0x11'),_0x428ec0,_0xeed292['error'][_0x16f1('0x17')]);return _0x45066(_0xeed292[_0x16f1('0x15')][_0x16f1('0x17')]);}else{logger[_0x16f1('0x18')]('FaxQueue,\x20%s,\x20%s',_0x428ec0,_0x16f1('0x12'));_0x45066(_0xeed292['result']['message']);}})[_0x16f1('0x19')](function(_0x4932ba){logger['error'](_0x16f1('0x11'),_0x428ec0,_0x4932ba);_0x13a493(_0x4932ba);});});}exports[_0x16f1('0x1a')]=function(_0x33da40){var _0x19fdc5=this;return new Promise(function(_0x152eb4,_0x17d984){return db['FaxQueue']['findAll']({'raw':_0x33da40['options']?_0x33da40[_0x16f1('0x1b')][_0x16f1('0x1c')]===undefined?!![]:![]:!![],'where':_0x33da40[_0x16f1('0x1b')]?_0x33da40['options'][_0x16f1('0x1d')]||null:null,'attributes':_0x33da40[_0x16f1('0x1b')]?_0x33da40['options']['attributes']||null:null,'limit':_0x33da40[_0x16f1('0x1b')]?_0x33da40[_0x16f1('0x1b')]['limit']||null:null,'include':_0x33da40[_0x16f1('0x1b')]?_0x33da40[_0x16f1('0x1b')][_0x16f1('0x1e')]?_[_0x16f1('0x1f')](_0x33da40['options'][_0x16f1('0x1e')],function(_0x11723a){return{'model':db[_0x11723a[_0x16f1('0x20')]],'as':_0x11723a['as'],'attributes':_0x11723a[_0x16f1('0x21')],'include':_0x11723a['include']?_['map'](_0x11723a[_0x16f1('0x1e')],function(_0x35a459){return{'model':db[_0x35a459[_0x16f1('0x20')]],'as':_0x35a459['as'],'attributes':_0x35a459[_0x16f1('0x21')],'include':_0x35a459['include']?_[_0x16f1('0x1f')](_0x35a459[_0x16f1('0x1e')],function(_0x1cad13){return{'model':db[_0x1cad13[_0x16f1('0x20')]],'as':_0x1cad13['as'],'attributes':_0x1cad13[_0x16f1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x16f1('0x10')](function(_0x2c7e89){logger[_0x16f1('0x18')]('GetFaxQueue',_0x33da40);logger['debug']('GetFaxQueue',_0x33da40,JSON['stringify'](_0x2c7e89));_0x152eb4(_0x2c7e89);})[_0x16f1('0x19')](function(_0x43b950){logger[_0x16f1('0x15')](_0x16f1('0x1a'),_0x43b950[_0x16f1('0x17')],_0x33da40);_0x17d984(_0x19fdc5[_0x16f1('0x15')](0x1f4,_0x43b950[_0x16f1('0x17')]));});});};exports[_0x16f1('0x22')]=function(_0x38faca){var _0x24fb61=this;return new Promise(function(_0x2d57e4,_0x2ebc40){return db['FaxQueue'][_0x16f1('0x23')]({'raw':_0x38faca[_0x16f1('0x1b')]?_0x38faca[_0x16f1('0x1b')][_0x16f1('0x1c')]===undefined?!![]:![]:!![],'where':_0x38faca[_0x16f1('0x1b')]?_0x38faca['options'][_0x16f1('0x1d')]||null:null,'attributes':_0x38faca[_0x16f1('0x1b')]?_0x38faca[_0x16f1('0x1b')][_0x16f1('0x21')]||null:null,'include':_0x38faca['options']?_0x38faca[_0x16f1('0x1b')][_0x16f1('0x1e')]?_[_0x16f1('0x1f')](_0x38faca[_0x16f1('0x1b')][_0x16f1('0x1e')],function(_0x19f328){return{'model':db[_0x19f328[_0x16f1('0x20')]],'as':_0x19f328['as'],'attributes':_0x19f328['attributes'],'include':_0x19f328[_0x16f1('0x1e')]?_[_0x16f1('0x1f')](_0x19f328[_0x16f1('0x1e')],function(_0x36b7ba){return{'model':db[_0x36b7ba[_0x16f1('0x20')]],'as':_0x36b7ba['as'],'attributes':_0x36b7ba['attributes'],'include':_0x36b7ba[_0x16f1('0x1e')]?_[_0x16f1('0x1f')](_0x36b7ba[_0x16f1('0x1e')],function(_0x42e71e){return{'model':db[_0x42e71e[_0x16f1('0x20')]],'as':_0x42e71e['as'],'attributes':_0x42e71e['attributes']};}):[]};}):[]};}):[]:[]})[_0x16f1('0x10')](function(_0x1bc651){logger['info'](_0x16f1('0x22'),_0x38faca);logger[_0x16f1('0x13')](_0x16f1('0x22'),_0x38faca,JSON['stringify'](_0x1bc651));_0x2d57e4(_0x1bc651);})[_0x16f1('0x19')](function(_0x66d69e){logger[_0x16f1('0x15')](_0x16f1('0x22'),_0x66d69e['message'],_0x38faca);_0x2ebc40(_0x24fb61['error'](0x1f4,_0x66d69e[_0x16f1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 7de5960..e0e0512 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 _0xfd20=['register','faxQueue:','save','emit','removeListener'];(function(_0x5edeab,_0x50e246){var _0x19a78e=function(_0x4964e5){while(--_0x4964e5){_0x5edeab['push'](_0x5edeab['shift']());}};_0x19a78e(++_0x50e246);}(_0xfd20,0x66));var _0x0fd2=function(_0xa46cc9,_0x327f7d){_0xa46cc9=_0xa46cc9-0x0;var _0x5683ed=_0xfd20[_0xa46cc9];return _0x5683ed;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x0fd2('0x0'),'remove','update'];function createListener(_0x429df4,_0x28eb77){return function(_0x53caa3){_0x28eb77[_0x0fd2('0x1')](_0x429df4,_0x53caa3);};}function removeListener(_0x4c4975,_0x3661d3){return function(){FaxQueueEvents[_0x0fd2('0x2')](_0x4c4975,_0x3661d3);};}exports[_0x0fd2('0x3')]=function(_0xf25991){for(var _0x247d6e=0x0,_0x4d114c=events['length'];_0x247d6e<_0x4d114c;_0x247d6e++){var _0x32d460=events[_0x247d6e];var _0x15ba86=createListener(_0x0fd2('0x4')+_0x32d460,_0xf25991);FaxQueueEvents['on'](_0x32d460,_0x15ba86);}}; \ No newline at end of file +var _0x5fc3=['./faxQueue.events','save','update','emit','removeListener','register','faxQueue:'];(function(_0x4f9bfb,_0x40fc01){var _0x380598=function(_0x4aad9d){while(--_0x4aad9d){_0x4f9bfb['push'](_0x4f9bfb['shift']());}};_0x380598(++_0x40fc01);}(_0x5fc3,0xa8));var _0x35fc=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x5fc3[_0x149ca0];return _0x56b6b9;};'use strict';var FaxQueueEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){FaxQueueEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);FaxQueueEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 2515cc9..5677c61 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 _0x77a9=['../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x462c95,_0x4fca9c){var _0x2a99f5=function(_0x571bc4){while(--_0x571bc4){_0x462c95['push'](_0x462c95['shift']());}};_0x2a99f5(++_0x4fca9c);}(_0x77a9,0x19e));var _0x977a=function(_0x1cc197,_0xf3ac01){_0x1cc197=_0x1cc197-0x0;var _0x336d9f=_0x77a9[_0x1cc197];return _0x336d9f;};'use strict';var multer=require(_0x977a('0x0'));var util=require('util');var path=require(_0x977a('0x1'));var timeout=require('connect-timeout');var express=require(_0x977a('0x2'));var router=express[_0x977a('0x3')]();var fs_extra=require(_0x977a('0x4'));var auth=require(_0x977a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x977a('0x6'));var controller=require(_0x977a('0x7'));router[_0x977a('0x8')]('/',auth[_0x977a('0x9')](),controller[_0x977a('0xa')]);router['get']('/describe',auth[_0x977a('0x9')](),controller[_0x977a('0xb')]);router['get'](_0x977a('0xc'),auth[_0x977a('0x9')](),controller[_0x977a('0xd')]);router[_0x977a('0x8')](_0x977a('0xe'),auth[_0x977a('0x9')](),controller[_0x977a('0xf')]);router[_0x977a('0x8')](_0x977a('0x10'),auth[_0x977a('0x9')](),controller['getTeams']);router[_0x977a('0x8')](_0x977a('0x11'),auth[_0x977a('0x9')](),controller[_0x977a('0x12')]);router[_0x977a('0x13')]('/',auth[_0x977a('0x9')](),controller[_0x977a('0x14')]);router[_0x977a('0x13')](_0x977a('0x10'),auth[_0x977a('0x9')](),controller['addTeams']);router[_0x977a('0x13')]('/:id/users',auth[_0x977a('0x9')](),controller[_0x977a('0x15')]);router['put'](_0x977a('0xc'),auth[_0x977a('0x9')](),controller[_0x977a('0x16')]);router[_0x977a('0x17')]('/:id',auth[_0x977a('0x9')](),controller[_0x977a('0x18')]);router[_0x977a('0x17')]('/:id/teams',auth[_0x977a('0x9')](),controller[_0x977a('0x19')]);router['delete'](_0x977a('0x11'),auth['isAuthenticated'](),controller[_0x977a('0x1a')]);module[_0x977a('0x1b')]=router; \ No newline at end of file +var _0x187d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','/:id/users','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout'];(function(_0x9ecaaa,_0x5046c9){var _0x475fbc=function(_0x5ed52b){while(--_0x5ed52b){_0x9ecaaa['push'](_0x9ecaaa['shift']());}};_0x475fbc(++_0x5046c9);}(_0x187d,0x93));var _0xd187=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x187d[_0x2dafbe];return _0x58a45a;};'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('0xb')](_0xd187('0x10'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0xb')]('/:id/teams',auth[_0xd187('0x9')](),controller[_0xd187('0x12')]);router[_0xd187('0xb')]('/:id/users',auth[_0xd187('0x9')](),controller[_0xd187('0x13')]);router[_0xd187('0x14')]('/',auth['isAuthenticated'](),controller[_0xd187('0x15')]);router[_0xd187('0x14')](_0xd187('0x16'),auth[_0xd187('0x9')](),controller['addTeams']);router[_0xd187('0x14')](_0xd187('0x17'),auth[_0xd187('0x9')](),controller[_0xd187('0x18')]);router['put'](_0xd187('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xd187('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xd187('0x1a')]);router[_0xd187('0x19')](_0xd187('0x16'),auth[_0xd187('0x9')](),controller[_0xd187('0x1b')]);router[_0xd187('0x19')](_0xd187('0x17'),auth[_0xd187('0x9')](),controller[_0xd187('0x1c')]);module[_0xd187('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 7b0f805..8f1e90f 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 _0xf0cc=['exports','STRING','DATE','moment','sequelize'];(function(_0xb3c087,_0x1ccd90){var _0x4c0769=function(_0x293d7d){while(--_0x293d7d){_0xb3c087['push'](_0xb3c087['shift']());}};_0x4c0769(++_0x1ccd90);}(_0xf0cc,0xf3));var _0xcf0c=function(_0x565699,_0x1f6b75){_0x565699=_0x565699-0x0;var _0x425b8c=_0xf0cc[_0x565699];return _0x425b8c;};'use strict';var moment=require(_0xcf0c('0x0'));var Sequelize=require(_0xcf0c('0x1'));module[_0xcf0c('0x2')]={'uniqueid':{'type':Sequelize[_0xcf0c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcf0c('0x4')]},'leaveAt':{'type':Sequelize[_0xcf0c('0x4')]},'acceptAt':{'type':Sequelize[_0xcf0c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xcf0c('0x3')]}}; \ No newline at end of file +var _0x37c3=['sequelize','exports','STRING','DATE','moment'];(function(_0x61018e,_0x55b3b8){var _0x3e7d77=function(_0x3e79e7){while(--_0x3e79e7){_0x61018e['push'](_0x61018e['shift']());}};_0x3e7d77(++_0x55b3b8);}(_0x37c3,0xd1));var _0x337c=function(_0x114771,_0x54f43c){_0x114771=_0x114771-0x0;var _0x1aa2fc=_0x37c3[_0x114771];return _0x1aa2fc;};'use strict';var moment=require(_0x337c('0x0'));var Sequelize=require(_0x337c('0x1'));module[_0x337c('0x2')]={'uniqueid':{'type':Sequelize[_0x337c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x337c('0x3')]},'joinAt':{'type':Sequelize[_0x337c('0x4')]},'leaveAt':{'type':Sequelize[_0x337c('0x4')]},'acceptAt':{'type':Sequelize[_0x337c('0x4')]},'exitAt':{'type':Sequelize[_0x337c('0x4')]},'reason':{'type':Sequelize[_0x337c('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 627504e..5236e90 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 _0x22a4=['fields','length','nolimit','order','sort','where','pick','merge','type','options','include','FaxQueueReport','findAll','catch','params','keys','rawAttributes','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','index','map','key','model','query','filters','intersection','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22a4,0x1cb));var _0x422a=function(_0x7ea44a,_0x401d2f){_0x7ea44a=_0x7ea44a-0x0;var _0x388deb=_0x22a4[_0x7ea44a];return _0x388deb;};'use strict';var emlformat=require(_0x422a('0x0'));var rimraf=require(_0x422a('0x1'));var zipdir=require(_0x422a('0x2'));var jsonpatch=require(_0x422a('0x3'));var rp=require(_0x422a('0x4'));var moment=require(_0x422a('0x5'));var BPromise=require(_0x422a('0x6'));var Mustache=require(_0x422a('0x7'));var util=require('util');var path=require(_0x422a('0x8'));var sox=require(_0x422a('0x9'));var csv=require(_0x422a('0xa'));var ejs=require(_0x422a('0xb'));var fs=require('fs');var fs_extra=require(_0x422a('0xc'));var _=require('lodash');var squel=require(_0x422a('0xd'));var crypto=require(_0x422a('0xe'));var jsforce=require(_0x422a('0xf'));var deskjs=require(_0x422a('0x10'));var toCsv=require(_0x422a('0xa'));var querystring=require(_0x422a('0x11'));var Papa=require(_0x422a('0x12'));var Redis=require(_0x422a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x422a('0x14'));var hardwareService=require(_0x422a('0x15'));var logger=require(_0x422a('0x16'))(_0x422a('0x17'));var utils=require(_0x422a('0x18'));var config=require(_0x422a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xebe70d,_0x4dbed1){_0x4dbed1=_0x4dbed1||0xcc;return function(_0x5a0c59){if(_0x5a0c59){return _0xebe70d['sendStatus'](_0x4dbed1);}return _0xebe70d[_0x422a('0x1a')](_0x4dbed1)[_0x422a('0x1b')]();};}function respondWithResult(_0x11af1f,_0x2dc9b2){_0x2dc9b2=_0x2dc9b2||0xc8;return function(_0x147af5){if(_0x147af5){return _0x11af1f[_0x422a('0x1a')](_0x2dc9b2)[_0x422a('0x1c')](_0x147af5);}};}function respondWithFilteredResult(_0x3504bb,_0xf9fcf7){return function(_0x2ba53b){if(_0x2ba53b){var _0x30b6e9=typeof _0xf9fcf7[_0x422a('0x1d')]===_0x422a('0x1e')&&typeof _0xf9fcf7[_0x422a('0x1f')]===_0x422a('0x1e');var _0x2e8163=_0x2ba53b[_0x422a('0x20')];var _0x5e2507=_0x30b6e9?0x0:_0xf9fcf7[_0x422a('0x1d')];var _0x3c5d86=_0x30b6e9?_0x2ba53b['count']:_0xf9fcf7[_0x422a('0x1d')]+_0xf9fcf7['limit'];var _0x552048;if(_0x3c5d86>=_0x2e8163){_0x3c5d86=_0x2e8163;_0x552048=0xc8;}else{_0x552048=0xce;}_0x3504bb[_0x422a('0x1a')](_0x552048);return _0x3504bb[_0x422a('0x21')](_0x422a('0x22'),_0x5e2507+'-'+_0x3c5d86+'/'+_0x2e8163)[_0x422a('0x1c')](_0x2ba53b);}return null;};}function patchUpdates(_0x194c25){return function(_0x5f9720){try{jsonpatch[_0x422a('0x23')](_0x5f9720,_0x194c25,!![]);}catch(_0x26922a){return BPromise['reject'](_0x26922a);}return _0x5f9720[_0x422a('0x24')]();};}function saveUpdates(_0x3284ed,_0x211d93){return function(_0x3d3213){if(_0x3d3213){return _0x3d3213[_0x422a('0x25')](_0x3284ed)['then'](function(_0x837c81){return _0x837c81;});}return null;};}function removeEntity(_0x33bc88,_0x6e209d){return function(_0x5e3138){if(_0x5e3138){return _0x5e3138[_0x422a('0x26')]()[_0x422a('0x27')](function(){_0x33bc88[_0x422a('0x1a')](0xcc)[_0x422a('0x1b')]();});}};}function handleEntityNotFound(_0xfc8699,_0xa7e1dd){return function(_0xca7e3c){if(!_0xca7e3c){_0xfc8699[_0x422a('0x28')](0x194);}return _0xca7e3c;};}function handleError(_0x535888,_0x911cc9){_0x911cc9=_0x911cc9||0x1f4;return function(_0x15d2ab){logger['error'](_0x15d2ab[_0x422a('0x29')]);if(_0x15d2ab['name']){delete _0x15d2ab[_0x422a('0x2a')];}_0x535888[_0x422a('0x1a')](_0x911cc9)[_0x422a('0x2b')](_0x15d2ab);};}exports[_0x422a('0x2c')]=function(_0x4badf8,_0x3cb362){var _0x2f833e={},_0x50cc29={},_0x5826ac={'count':0x0,'rows':[]};var _0x3414ad=_[_0x422a('0x2d')](db['FaxQueueReport']['rawAttributes'],function(_0x4903d1){return{'name':_0x4903d1['fieldName'],'type':_0x4903d1['type'][_0x422a('0x2e')]};});_0x50cc29[_0x422a('0x2f')]=_[_0x422a('0x2d')](_0x3414ad,_0x422a('0x2a'));_0x50cc29[_0x422a('0x30')]=_['keys'](_0x4badf8[_0x422a('0x30')]);_0x50cc29[_0x422a('0x31')]=_[_0x422a('0x32')](_0x50cc29[_0x422a('0x2f')],_0x50cc29[_0x422a('0x30')]);_0x2f833e[_0x422a('0x33')]=_[_0x422a('0x32')](_0x50cc29['model'],qs[_0x422a('0x34')](_0x4badf8[_0x422a('0x30')][_0x422a('0x34')]));_0x2f833e[_0x422a('0x33')]=_0x2f833e['attributes'][_0x422a('0x35')]?_0x2f833e['attributes']:_0x50cc29[_0x422a('0x2f')];if(!_0x4badf8[_0x422a('0x30')]['hasOwnProperty'](_0x422a('0x36'))){_0x2f833e[_0x422a('0x1f')]=qs['limit'](_0x4badf8[_0x422a('0x30')][_0x422a('0x1f')]);_0x2f833e[_0x422a('0x1d')]=qs[_0x422a('0x1d')](_0x4badf8[_0x422a('0x30')][_0x422a('0x1d')]);}_0x2f833e[_0x422a('0x37')]=qs[_0x422a('0x38')](_0x4badf8['query']['sort']);_0x2f833e[_0x422a('0x39')]=qs[_0x422a('0x31')](_[_0x422a('0x3a')](_0x4badf8['query'],_0x50cc29[_0x422a('0x31')]),_0x3414ad);if(_0x4badf8[_0x422a('0x30')]['filter']){_0x2f833e['where']=_[_0x422a('0x3b')](_0x2f833e['where'],{'$or':_[_0x422a('0x2d')](_0x3414ad,function(_0x311fa7){if(_0x311fa7[_0x422a('0x3c')]!=='VIRTUAL'){var _0x36661b={};_0x36661b[_0x311fa7[_0x422a('0x2a')]]={'$like':'%'+_0x4badf8[_0x422a('0x30')]['filter']+'%'};return _0x36661b;}})});}_0x2f833e=_['merge']({},_0x2f833e,_0x4badf8[_0x422a('0x3d')]);var _0x424716={'where':_0x2f833e[_0x422a('0x39')]};return db['FaxQueueReport'][_0x422a('0x20')](_0x424716)[_0x422a('0x27')](function(_0x254f3f){_0x5826ac[_0x422a('0x20')]=_0x254f3f;if(_0x4badf8[_0x422a('0x30')]['includeAll']){_0x2f833e[_0x422a('0x3e')]=[{'all':!![]}];}return db[_0x422a('0x3f')][_0x422a('0x40')](_0x2f833e);})[_0x422a('0x27')](function(_0xfd39fa){_0x5826ac['rows']=_0xfd39fa;return _0x5826ac;})['then'](respondWithFilteredResult(_0x3cb362,_0x2f833e))[_0x422a('0x41')](handleError(_0x3cb362,null));};exports['show']=function(_0x4c2e63,_0x42bbc1){var _0x7a59f8={'raw':!![],'where':{'id':_0x4c2e63[_0x422a('0x42')]['id']}},_0x10302c={};_0x10302c[_0x422a('0x2f')]=_[_0x422a('0x43')](db['FaxQueueReport'][_0x422a('0x44')]);_0x10302c[_0x422a('0x30')]=_[_0x422a('0x43')](_0x4c2e63[_0x422a('0x30')]);_0x10302c[_0x422a('0x31')]=_[_0x422a('0x32')](_0x10302c[_0x422a('0x2f')],_0x10302c['query']);_0x7a59f8[_0x422a('0x33')]=_[_0x422a('0x32')](_0x10302c['model'],qs[_0x422a('0x34')](_0x4c2e63[_0x422a('0x30')][_0x422a('0x34')]));_0x7a59f8[_0x422a('0x33')]=_0x7a59f8[_0x422a('0x33')][_0x422a('0x35')]?_0x7a59f8[_0x422a('0x33')]:_0x10302c['model'];if(_0x4c2e63[_0x422a('0x30')][_0x422a('0x45')]){_0x7a59f8[_0x422a('0x3e')]=[{'all':!![]}];}_0x7a59f8=_[_0x422a('0x3b')]({},_0x7a59f8,_0x4c2e63[_0x422a('0x3d')]);return db[_0x422a('0x3f')][_0x422a('0x46')](_0x7a59f8)[_0x422a('0x27')](handleEntityNotFound(_0x42bbc1,null))[_0x422a('0x27')](respondWithResult(_0x42bbc1,null))[_0x422a('0x41')](handleError(_0x42bbc1,null));};exports['create']=function(_0x48917f,_0x3fd514){return db[_0x422a('0x3f')]['create'](_0x48917f[_0x422a('0x47')],{})[_0x422a('0x27')](respondWithResult(_0x3fd514,0xc9))[_0x422a('0x41')](handleError(_0x3fd514,null));};exports[_0x422a('0x25')]=function(_0x706497,_0x792783){if(_0x706497[_0x422a('0x47')]['id']){delete _0x706497[_0x422a('0x47')]['id'];}return db[_0x422a('0x3f')][_0x422a('0x46')]({'where':{'id':_0x706497['params']['id']}})['then'](handleEntityNotFound(_0x792783,null))[_0x422a('0x27')](saveUpdates(_0x706497[_0x422a('0x47')],null))['then'](respondWithResult(_0x792783,null))[_0x422a('0x41')](handleError(_0x792783,null));};exports[_0x422a('0x26')]=function(_0x20b4d3,_0x10de41){return db[_0x422a('0x3f')][_0x422a('0x46')]({'where':{'id':_0x20b4d3[_0x422a('0x42')]['id']}})['then'](handleEntityNotFound(_0x10de41,null))[_0x422a('0x27')](removeEntity(_0x10de41,null))[_0x422a('0x41')](handleError(_0x10de41,null));};exports[_0x422a('0x48')]=function(_0x41deb3,_0x139d54){return db[_0x422a('0x3f')]['describe']()['then'](respondWithResult(_0x139d54,null))[_0x422a('0x41')](handleError(_0x139d54,null));}; \ No newline at end of file +var _0x68fc=['pick','type','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','end','error','name','send','map','FaxQueueReport','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x68fc,0xa5));var _0xc68f=function(_0x44547f,_0x4dd3c9){_0x44547f=_0x44547f-0x0;var _0x478c44=_0x68fc[_0x44547f];return _0x478c44;};'use strict';var emlformat=require(_0xc68f('0x0'));var rimraf=require(_0xc68f('0x1'));var zipdir=require(_0xc68f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc68f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc68f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc68f('0x5'));var csv=require(_0xc68f('0x6'));var ejs=require(_0xc68f('0x7'));var fs=require('fs');var fs_extra=require(_0xc68f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0x6'));var querystring=require(_0xc68f('0xc'));var Papa=require(_0xc68f('0xd'));var Redis=require(_0xc68f('0xe'));var authService=require(_0xc68f('0xf'));var qs=require(_0xc68f('0x10'));var as=require(_0xc68f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68f('0x12'))(_0xc68f('0x13'));var utils=require(_0xc68f('0x14'));var config=require(_0xc68f('0x15'));var licenseUtil=require(_0xc68f('0x16'));var db=require(_0xc68f('0x17'))['db'];function respondWithStatusCode(_0x3ccebe,_0x41aeb8){_0x41aeb8=_0x41aeb8||0xcc;return function(_0x151bde){if(_0x151bde){return _0x3ccebe[_0xc68f('0x18')](_0x41aeb8);}return _0x3ccebe[_0xc68f('0x19')](_0x41aeb8)['end']();};}function respondWithResult(_0x2ea1c4,_0x90ccbd){_0x90ccbd=_0x90ccbd||0xc8;return function(_0x2b1d30){if(_0x2b1d30){return _0x2ea1c4[_0xc68f('0x19')](_0x90ccbd)[_0xc68f('0x1a')](_0x2b1d30);}};}function respondWithFilteredResult(_0x2673b4,_0x3d1406){return function(_0x209d16){if(_0x209d16){var _0x4648c6=typeof _0x3d1406['offset']==='undefined'&&typeof _0x3d1406[_0xc68f('0x1b')]===_0xc68f('0x1c');var _0x171eea=_0x209d16[_0xc68f('0x1d')];var _0x2d9d85=_0x4648c6?0x0:_0x3d1406[_0xc68f('0x1e')];var _0x50fab4=_0x4648c6?_0x209d16[_0xc68f('0x1d')]:_0x3d1406[_0xc68f('0x1e')]+_0x3d1406[_0xc68f('0x1b')];var _0x2c058c;if(_0x50fab4>=_0x171eea){_0x50fab4=_0x171eea;_0x2c058c=0xc8;}else{_0x2c058c=0xce;}_0x2673b4[_0xc68f('0x19')](_0x2c058c);return _0x2673b4[_0xc68f('0x1f')](_0xc68f('0x20'),_0x2d9d85+'-'+_0x50fab4+'/'+_0x171eea)[_0xc68f('0x1a')](_0x209d16);}return null;};}function patchUpdates(_0x582301){return function(_0xcc11a3){try{jsonpatch[_0xc68f('0x21')](_0xcc11a3,_0x582301,!![]);}catch(_0x2e27b9){return BPromise['reject'](_0x2e27b9);}return _0xcc11a3[_0xc68f('0x22')]();};}function saveUpdates(_0x1daac5,_0x116203){return function(_0x2064db){if(_0x2064db){return _0x2064db[_0xc68f('0x23')](_0x1daac5)[_0xc68f('0x24')](function(_0x2412a9){return _0x2412a9;});}return null;};}function removeEntity(_0x547d46,_0x38c3a0){return function(_0x288957){if(_0x288957){return _0x288957['destroy']()[_0xc68f('0x24')](function(){_0x547d46[_0xc68f('0x19')](0xcc)[_0xc68f('0x25')]();});}};}function handleEntityNotFound(_0x44c4b2,_0x39419a){return function(_0x48d797){if(!_0x48d797){_0x44c4b2[_0xc68f('0x18')](0x194);}return _0x48d797;};}function handleError(_0x417de2,_0x5d4632){_0x5d4632=_0x5d4632||0x1f4;return function(_0x38b935){logger[_0xc68f('0x26')](_0x38b935['stack']);if(_0x38b935[_0xc68f('0x27')]){delete _0x38b935[_0xc68f('0x27')];}_0x417de2[_0xc68f('0x19')](_0x5d4632)[_0xc68f('0x28')](_0x38b935);};}exports['index']=function(_0x477a1c,_0x1cc5b2){var _0x26003a={},_0x435482={},_0x1ba1ac={'count':0x0,'rows':[]};var _0x11b203=_[_0xc68f('0x29')](db[_0xc68f('0x2a')]['rawAttributes'],function(_0x37f947){return{'name':_0x37f947[_0xc68f('0x2b')],'type':_0x37f947['type'][_0xc68f('0x2c')]};});_0x435482[_0xc68f('0x2d')]=_[_0xc68f('0x29')](_0x11b203,_0xc68f('0x27'));_0x435482['query']=_[_0xc68f('0x2e')](_0x477a1c[_0xc68f('0x2f')]);_0x435482['filters']=_[_0xc68f('0x30')](_0x435482[_0xc68f('0x2d')],_0x435482[_0xc68f('0x2f')]);_0x26003a[_0xc68f('0x31')]=_[_0xc68f('0x30')](_0x435482['model'],qs['fields'](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x32')]));_0x26003a[_0xc68f('0x31')]=_0x26003a[_0xc68f('0x31')][_0xc68f('0x33')]?_0x26003a['attributes']:_0x435482['model'];if(!_0x477a1c[_0xc68f('0x2f')]['hasOwnProperty'](_0xc68f('0x34'))){_0x26003a[_0xc68f('0x1b')]=qs[_0xc68f('0x1b')](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x1b')]);_0x26003a[_0xc68f('0x1e')]=qs[_0xc68f('0x1e')](_0x477a1c['query'][_0xc68f('0x1e')]);}_0x26003a[_0xc68f('0x35')]=qs[_0xc68f('0x36')](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x36')]);_0x26003a[_0xc68f('0x37')]=qs[_0xc68f('0x38')](_[_0xc68f('0x39')](_0x477a1c[_0xc68f('0x2f')],_0x435482[_0xc68f('0x38')]),_0x11b203);if(_0x477a1c[_0xc68f('0x2f')]['filter']){_0x26003a['where']=_['merge'](_0x26003a[_0xc68f('0x37')],{'$or':_[_0xc68f('0x29')](_0x11b203,function(_0x268649){if(_0x268649[_0xc68f('0x3a')]!=='VIRTUAL'){var _0x10c664={};_0x10c664[_0x268649[_0xc68f('0x27')]]={'$like':'%'+_0x477a1c[_0xc68f('0x2f')]['filter']+'%'};return _0x10c664;}})});}_0x26003a=_[_0xc68f('0x3b')]({},_0x26003a,_0x477a1c[_0xc68f('0x3c')]);var _0x4a8883={'where':_0x26003a[_0xc68f('0x37')]};return db[_0xc68f('0x2a')][_0xc68f('0x1d')](_0x4a8883)['then'](function(_0x2702ac){_0x1ba1ac[_0xc68f('0x1d')]=_0x2702ac;if(_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x3d')]){_0x26003a[_0xc68f('0x3e')]=[{'all':!![]}];}return db[_0xc68f('0x2a')][_0xc68f('0x3f')](_0x26003a);})['then'](function(_0x192942){_0x1ba1ac[_0xc68f('0x40')]=_0x192942;return _0x1ba1ac;})[_0xc68f('0x24')](respondWithFilteredResult(_0x1cc5b2,_0x26003a))[_0xc68f('0x41')](handleError(_0x1cc5b2,null));};exports[_0xc68f('0x42')]=function(_0x1e4f50,_0x1d4619){var _0x335b52={'raw':!![],'where':{'id':_0x1e4f50['params']['id']}},_0x1e8141={};_0x1e8141[_0xc68f('0x2d')]=_[_0xc68f('0x2e')](db[_0xc68f('0x2a')][_0xc68f('0x43')]);_0x1e8141[_0xc68f('0x2f')]=_[_0xc68f('0x2e')](_0x1e4f50[_0xc68f('0x2f')]);_0x1e8141['filters']=_[_0xc68f('0x30')](_0x1e8141['model'],_0x1e8141['query']);_0x335b52[_0xc68f('0x31')]=_[_0xc68f('0x30')](_0x1e8141['model'],qs['fields'](_0x1e4f50[_0xc68f('0x2f')][_0xc68f('0x32')]));_0x335b52[_0xc68f('0x31')]=_0x335b52[_0xc68f('0x31')][_0xc68f('0x33')]?_0x335b52[_0xc68f('0x31')]:_0x1e8141[_0xc68f('0x2d')];if(_0x1e4f50[_0xc68f('0x2f')][_0xc68f('0x3d')]){_0x335b52[_0xc68f('0x3e')]=[{'all':!![]}];}_0x335b52=_[_0xc68f('0x3b')]({},_0x335b52,_0x1e4f50['options']);return db[_0xc68f('0x2a')]['find'](_0x335b52)[_0xc68f('0x24')](handleEntityNotFound(_0x1d4619,null))[_0xc68f('0x24')](respondWithResult(_0x1d4619,null))['catch'](handleError(_0x1d4619,null));};exports[_0xc68f('0x44')]=function(_0x3f4537,_0x28e8ef){return db[_0xc68f('0x2a')][_0xc68f('0x44')](_0x3f4537[_0xc68f('0x45')],{})[_0xc68f('0x24')](respondWithResult(_0x28e8ef,0xc9))[_0xc68f('0x41')](handleError(_0x28e8ef,null));};exports['update']=function(_0x2920d5,_0x15eaa2){if(_0x2920d5[_0xc68f('0x45')]['id']){delete _0x2920d5['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2920d5[_0xc68f('0x46')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x15eaa2,null))['then'](saveUpdates(_0x2920d5[_0xc68f('0x45')],null))['then'](respondWithResult(_0x15eaa2,null))[_0xc68f('0x41')](handleError(_0x15eaa2,null));};exports[_0xc68f('0x47')]=function(_0x44efa8,_0x26ac9a){return db[_0xc68f('0x2a')][_0xc68f('0x48')]({'where':{'id':_0x44efa8[_0xc68f('0x46')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x26ac9a,null))[_0xc68f('0x24')](removeEntity(_0x26ac9a,null))[_0xc68f('0x41')](handleError(_0x26ac9a,null));};exports[_0xc68f('0x49')]=function(_0x5e36c7,_0x2e4ebc){return db[_0xc68f('0x2a')]['describe']()['then'](respondWithResult(_0x2e4ebc,null))[_0xc68f('0x41')](handleError(_0x2e4ebc,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 64e87ab..3559645 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x39c867,_0x256214){var _0x411aa2=function(_0x421bb9){while(--_0x421bb9){_0x39c867['push'](_0x39c867['shift']());}};_0x411aa2(++_0x256214);}(_0x1261,0x144));var _0x1126=function(_0x436073,_0x11b1d6){_0x436073=_0x436073-0x0;var _0x564463=_0x1261[_0x436073];return _0x564463;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x30a2c5,_0x4aaaa4){var _0x1e8ed1=function(_0x405215){while(--_0x405215){_0x30a2c5['push'](_0x30a2c5['shift']());}};_0x1e8ed1(++_0x4aaaa4);}(_0xe14b,0x93));var _0xbe14=function(_0x50fd90,_0x122469){_0x50fd90=_0x50fd90-0x0;var _0x1d0113=_0xe14b[_0x50fd90];return _0x1d0113;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 0a53024..5db1ad4 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 _0xafca=['info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','update','raw','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message'];(function(_0x57c501,_0x319f03){var _0x4f15ba=function(_0x52e0c1){while(--_0x52e0c1){_0x57c501['push'](_0x57c501['shift']());}};_0x4f15ba(++_0x319f03);}(_0xafca,0x1cc));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xaafc('0x0'));var moment=require(_0xaafc('0x1'));var BPromise=require('bluebird');var rs=require(_0xaafc('0x2'));var fs=require('fs');var Redis=require(_0xaafc('0x3'));var db=require(_0xaafc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaafc('0x5'))(_0xaafc('0x6'));var config=require(_0xaafc('0x7'));var jayson=require(_0xaafc('0x8'));var client=jayson[_0xaafc('0x9')][_0xaafc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bcbe8,_0x1da2f5,_0x7f50e2){return new BPromise(function(_0x4e6e62,_0x257076){return client[_0xaafc('0xb')](_0x3bcbe8,_0x7f50e2)[_0xaafc('0xc')](function(_0x2f75dc){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x1da2f5,_0xaafc('0xd'));logger[_0xaafc('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1da2f5,'request\x20sent',JSON[_0xaafc('0xf')](_0x2f75dc));if(_0x2f75dc[_0xaafc('0x10')]){if(_0x2f75dc['error'][_0xaafc('0x11')]===0x1f4){logger[_0xaafc('0x10')](_0xaafc('0x12'),_0x1da2f5,_0x2f75dc[_0xaafc('0x10')][_0xaafc('0x13')]);return _0x257076(_0x2f75dc[_0xaafc('0x10')][_0xaafc('0x13')]);}logger[_0xaafc('0x10')](_0xaafc('0x12'),_0x1da2f5,_0x2f75dc[_0xaafc('0x10')][_0xaafc('0x13')]);return _0x4e6e62(_0x2f75dc[_0xaafc('0x10')][_0xaafc('0x13')]);}else{logger[_0xaafc('0x14')](_0xaafc('0x12'),_0x1da2f5,_0xaafc('0xd'));_0x4e6e62(_0x2f75dc[_0xaafc('0x15')][_0xaafc('0x13')]);}})[_0xaafc('0x16')](function(_0x55a0fa){logger[_0xaafc('0x10')](_0xaafc('0x12'),_0x1da2f5,_0x55a0fa);_0x257076(_0x55a0fa);});});}exports[_0xaafc('0x17')]=function(_0x29072d){var _0x1fe750=this;return new Promise(function(_0x2d755c,_0x42dfa7){return db[_0xaafc('0x18')][_0xaafc('0x19')](_0x29072d[_0xaafc('0x1a')],{'raw':_0x29072d[_0xaafc('0x1b')]?_0x29072d[_0xaafc('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28f193){logger[_0xaafc('0x14')](_0xaafc('0x17'),_0x29072d);logger[_0xaafc('0xe')](_0xaafc('0x17'),_0x29072d,JSON[_0xaafc('0xf')](_0x28f193));_0x2d755c(_0x28f193);})[_0xaafc('0x16')](function(_0x571104){logger[_0xaafc('0x10')](_0xaafc('0x17'),_0x571104[_0xaafc('0x13')],_0x29072d);_0x42dfa7(_0x1fe750[_0xaafc('0x10')](0x1f4,_0x571104[_0xaafc('0x13')]));});});};exports[_0xaafc('0x1c')]=function(_0x1f69d1){var _0x55a672=this;return new Promise(function(_0x144baf,_0x47d1f5){return db[_0xaafc('0x18')][_0xaafc('0x1d')](_0x1f69d1['body'],{'raw':_0x1f69d1[_0xaafc('0x1b')]?_0x1f69d1[_0xaafc('0x1b')][_0xaafc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f69d1[_0xaafc('0x1b')]?_0x1f69d1[_0xaafc('0x1b')][_0xaafc('0x1f')]||null:null,'attributes':_0x1f69d1[_0xaafc('0x1b')]?_0x1f69d1[_0xaafc('0x1b')]['attributes']||null:null,'limit':_0x1f69d1[_0xaafc('0x1b')]?_0x1f69d1[_0xaafc('0x1b')]['limit']||null:null})['then'](function(_0x86bc5f){logger[_0xaafc('0x14')]('UpdateFaxQueueReport',_0x1f69d1);logger[_0xaafc('0xe')](_0xaafc('0x1c'),_0x1f69d1,JSON[_0xaafc('0xf')](_0x86bc5f));_0x144baf(_0x86bc5f);})[_0xaafc('0x16')](function(_0x216546){logger[_0xaafc('0x10')](_0xaafc('0x1c'),_0x216546[_0xaafc('0x13')],_0x1f69d1);_0x47d1f5(_0x55a672['error'](0x1f4,_0x216546[_0xaafc('0x13')]));});});}; \ No newline at end of file +var _0xceb7=['catch','UpdateFaxQueueReport','update','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','info','FaxQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','stringify'];(function(_0x46344f,_0x5c0b71){var _0x1c9fc4=function(_0x188768){while(--_0x188768){_0x46344f['push'](_0x46344f['shift']());}};_0x1c9fc4(++_0x5c0b71);}(_0xceb7,0x161));var _0x7ceb=function(_0x2b5027,_0x3b8fd4){_0x2b5027=_0x2b5027-0x0;var _0x33ac2c=_0xceb7[_0x2b5027];return _0x33ac2c;};'use strict';var _=require(_0x7ceb('0x0'));var util=require(_0x7ceb('0x1'));var moment=require('moment');var BPromise=require(_0x7ceb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ceb('0x3'));var db=require(_0x7ceb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ceb('0x5'))(_0x7ceb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7ceb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc2bb,_0x573c7f,_0x3e0388){return new BPromise(function(_0x54c224,_0x1aa2aa){return client['request'](_0x3dc2bb,_0x3e0388)['then'](function(_0x42a5e4){logger[_0x7ceb('0x8')](_0x7ceb('0x9'),_0x573c7f,'request\x20sent');logger[_0x7ceb('0xa')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x573c7f,'request\x20sent',JSON['stringify'](_0x42a5e4));if(_0x42a5e4[_0x7ceb('0xb')]){if(_0x42a5e4[_0x7ceb('0xb')][_0x7ceb('0xc')]===0x1f4){logger[_0x7ceb('0xb')](_0x7ceb('0x9'),_0x573c7f,_0x42a5e4['error']['message']);return _0x1aa2aa(_0x42a5e4[_0x7ceb('0xb')][_0x7ceb('0xd')]);}logger[_0x7ceb('0xb')](_0x7ceb('0x9'),_0x573c7f,_0x42a5e4[_0x7ceb('0xb')]['message']);return _0x54c224(_0x42a5e4['error'][_0x7ceb('0xd')]);}else{logger[_0x7ceb('0x8')](_0x7ceb('0x9'),_0x573c7f,_0x7ceb('0xe'));_0x54c224(_0x42a5e4[_0x7ceb('0xf')][_0x7ceb('0xd')]);}})['catch'](function(_0x284a0a){logger[_0x7ceb('0xb')](_0x7ceb('0x9'),_0x573c7f,_0x284a0a);_0x1aa2aa(_0x284a0a);});});}exports[_0x7ceb('0x10')]=function(_0x2ae47c){var _0x170919=this;return new Promise(function(_0x3c199c,_0x18639e){return db[_0x7ceb('0x11')][_0x7ceb('0x12')](_0x2ae47c[_0x7ceb('0x13')],{'raw':_0x2ae47c[_0x7ceb('0x14')]?_0x2ae47c[_0x7ceb('0x14')][_0x7ceb('0x15')]===undefined?!![]:![]:!![]})[_0x7ceb('0x16')](function(_0xe19241){logger[_0x7ceb('0x8')](_0x7ceb('0x10'),_0x2ae47c);logger[_0x7ceb('0xa')](_0x7ceb('0x10'),_0x2ae47c,JSON[_0x7ceb('0x17')](_0xe19241));_0x3c199c(_0xe19241);})[_0x7ceb('0x18')](function(_0x9181d0){logger[_0x7ceb('0xb')](_0x7ceb('0x10'),_0x9181d0[_0x7ceb('0xd')],_0x2ae47c);_0x18639e(_0x170919[_0x7ceb('0xb')](0x1f4,_0x9181d0['message']));});});};exports[_0x7ceb('0x19')]=function(_0x18fc9c){var _0xc734b5=this;return new Promise(function(_0x1b5c6c,_0x4df448){return db[_0x7ceb('0x11')][_0x7ceb('0x1a')](_0x18fc9c['body'],{'raw':_0x18fc9c['options']?_0x18fc9c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18fc9c[_0x7ceb('0x14')]?_0x18fc9c[_0x7ceb('0x14')]['where']||null:null,'attributes':_0x18fc9c[_0x7ceb('0x14')]?_0x18fc9c[_0x7ceb('0x14')][_0x7ceb('0x1b')]||null:null,'limit':_0x18fc9c[_0x7ceb('0x14')]?_0x18fc9c['options'][_0x7ceb('0x1c')]||null:null})[_0x7ceb('0x16')](function(_0x19c538){logger[_0x7ceb('0x8')](_0x7ceb('0x19'),_0x18fc9c);logger[_0x7ceb('0xa')](_0x7ceb('0x19'),_0x18fc9c,JSON[_0x7ceb('0x17')](_0x19c538));_0x1b5c6c(_0x19c538);})[_0x7ceb('0x18')](function(_0x4cb92b){logger[_0x7ceb('0xb')]('UpdateFaxQueueReport',_0x4cb92b[_0x7ceb('0xd')],_0x18fc9c);_0x4df448(_0xc734b5[_0x7ceb('0xb')](0x1f4,_0x4cb92b[_0x7ceb('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a965422..adf17c9 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 _0xe4c3=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','update','delete','destroy','multer','util'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe4c3,0x154));var _0x3e4c=function(_0x50b4b6,_0x56b825){_0x50b4b6=_0x50b4b6-0x0;var _0x1b4c8c=_0xe4c3[_0x50b4b6];return _0x1b4c8c;};'use strict';var multer=require(_0x3e4c('0x0'));var util=require(_0x3e4c('0x1'));var path=require(_0x3e4c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e4c('0x3'));var router=express[_0x3e4c('0x4')]();var fs_extra=require(_0x3e4c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e4c('0x6'));var config=require(_0x3e4c('0x7'));var controller=require('./faxQueueReport.controller');router[_0x3e4c('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e4c('0x9')]);router[_0x3e4c('0x8')](_0x3e4c('0xa'),auth[_0x3e4c('0xb')](),controller[_0x3e4c('0xc')]);router[_0x3e4c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3e4c('0xd')]);router[_0x3e4c('0xe')]('/',auth[_0x3e4c('0xb')](),controller['create']);router['put']('/:id',auth[_0x3e4c('0xb')](),controller[_0x3e4c('0xf')]);router[_0x3e4c('0x10')]('/:id',auth[_0x3e4c('0xb')](),controller[_0x3e4c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8a0b=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put'];(function(_0x1dce00,_0xdee283){var _0x39fb26=function(_0x24361c){while(--_0x24361c){_0x1dce00['push'](_0x1dce00['shift']());}};_0x39fb26(++_0xdee283);}(_0x8a0b,0xbd));var _0xb8a0=function(_0x11c08a,_0x283f32){_0x11c08a=_0x11c08a-0x0;var _0x5e8b47=_0x8a0b[_0x11c08a];return _0x5e8b47;};'use strict';var multer=require(_0xb8a0('0x0'));var util=require(_0xb8a0('0x1'));var path=require(_0xb8a0('0x2'));var timeout=require(_0xb8a0('0x3'));var express=require('express');var router=express[_0xb8a0('0x4')]();var fs_extra=require(_0xb8a0('0x5'));var auth=require(_0xb8a0('0x6'));var interaction=require(_0xb8a0('0x7'));var config=require(_0xb8a0('0x8'));var controller=require(_0xb8a0('0x9'));router[_0xb8a0('0xa')]('/',auth[_0xb8a0('0xb')](),controller[_0xb8a0('0xc')]);router[_0xb8a0('0xa')](_0xb8a0('0xd'),auth[_0xb8a0('0xb')](),controller[_0xb8a0('0xe')]);router[_0xb8a0('0xa')]('/:id',auth[_0xb8a0('0xb')](),controller[_0xb8a0('0xf')]);router[_0xb8a0('0x10')]('/',auth[_0xb8a0('0xb')](),controller['create']);router[_0xb8a0('0x11')](_0xb8a0('0x12'),auth[_0xb8a0('0xb')](),controller[_0xb8a0('0x13')]);router[_0xb8a0('0x14')]('/:id',auth[_0xb8a0('0xb')](),controller[_0xb8a0('0x15')]);module[_0xb8a0('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2de6bc2..812378f 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x314587,_0x1aed9f){var _0x3f6c2f=function(_0x5c9938){while(--_0x5c9938){_0x314587['push'](_0x314587['shift']());}};_0x3f6c2f(++_0x1aed9f);}(_0xedd9,0xfc));var _0x9edd=function(_0x52e862,_0x51b8dd){_0x52e862=_0x52e862-0x0;var _0x1cab0d=_0xedd9[_0x52e862];return _0x1cab0d;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4f9f37,_0x1c2b67){var _0x370c88=function(_0x37641b){while(--_0x37641b){_0x4f9f37['push'](_0x4f9f37['shift']());}};_0x370c88(++_0x1c2b67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ec6aedc..3342e9b 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 _0xa229=['VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0xa229,0x16b));var _0x9a22=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa229[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a22('0x0'));var rimraf=require(_0x9a22('0x1'));var zipdir=require(_0x9a22('0x2'));var jsonpatch=require(_0x9a22('0x3'));var rp=require(_0x9a22('0x4'));var moment=require(_0x9a22('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a22('0x6'));var util=require(_0x9a22('0x7'));var path=require('path');var sox=require(_0x9a22('0x8'));var csv=require(_0x9a22('0x9'));var ejs=require(_0x9a22('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a22('0xb'));var jsforce=require(_0x9a22('0xc'));var deskjs=require(_0x9a22('0xd'));var toCsv=require(_0x9a22('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9a22('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9a22('0xf'));var as=require(_0x9a22('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a22('0x11'))(_0x9a22('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9a22('0x13'));var db=require(_0x9a22('0x14'))['db'];function respondWithStatusCode(_0x115d31,_0x258a32){_0x258a32=_0x258a32||0xcc;return function(_0x376d00){if(_0x376d00){return _0x115d31[_0x9a22('0x15')](_0x258a32);}return _0x115d31['status'](_0x258a32)[_0x9a22('0x16')]();};}function respondWithResult(_0x4e974a,_0x203275){_0x203275=_0x203275||0xc8;return function(_0x397061){if(_0x397061){return _0x4e974a['status'](_0x203275)[_0x9a22('0x17')](_0x397061);}};}function respondWithFilteredResult(_0x16b5cc,_0x6c6c55){return function(_0x39cbe8){if(_0x39cbe8){var _0x4de43e=typeof _0x6c6c55['offset']==='undefined'&&typeof _0x6c6c55[_0x9a22('0x18')]==='undefined';var _0x355f31=_0x39cbe8[_0x9a22('0x19')];var _0x61ed3=_0x4de43e?0x0:_0x6c6c55[_0x9a22('0x1a')];var _0x591295=_0x4de43e?_0x39cbe8['count']:_0x6c6c55[_0x9a22('0x1a')]+_0x6c6c55[_0x9a22('0x18')];var _0x1f5684;if(_0x591295>=_0x355f31){_0x591295=_0x355f31;_0x1f5684=0xc8;}else{_0x1f5684=0xce;}_0x16b5cc['status'](_0x1f5684);return _0x16b5cc[_0x9a22('0x1b')](_0x9a22('0x1c'),_0x61ed3+'-'+_0x591295+'/'+_0x355f31)[_0x9a22('0x17')](_0x39cbe8);}return null;};}function patchUpdates(_0x2f6faf){return function(_0x60c002){try{jsonpatch[_0x9a22('0x1d')](_0x60c002,_0x2f6faf,!![]);}catch(_0x559513){return BPromise[_0x9a22('0x1e')](_0x559513);}return _0x60c002[_0x9a22('0x1f')]();};}function saveUpdates(_0xf801eb,_0x304367){return function(_0x43afd8){if(_0x43afd8){return _0x43afd8['update'](_0xf801eb)[_0x9a22('0x20')](function(_0x54918f){return _0x54918f;});}return null;};}function removeEntity(_0x5209bb,_0xea4d5c){return function(_0x319eb7){if(_0x319eb7){return _0x319eb7['destroy']()['then'](function(){_0x5209bb['status'](0xcc)[_0x9a22('0x16')]();});}};}function handleEntityNotFound(_0x2a6581,_0x3a23b4){return function(_0x215de3){if(!_0x215de3){_0x2a6581['sendStatus'](0x194);}return _0x215de3;};}function handleError(_0x3012e0,_0x33bdb6){_0x33bdb6=_0x33bdb6||0x1f4;return function(_0x4d7cdd){logger[_0x9a22('0x21')](_0x4d7cdd['stack']);if(_0x4d7cdd[_0x9a22('0x22')]){delete _0x4d7cdd['name'];}_0x3012e0['status'](_0x33bdb6)['send'](_0x4d7cdd);};}exports[_0x9a22('0x23')]=function(_0x41c085,_0x3d93cf){var _0x55ab17={},_0x153abe={},_0x378e11={'count':0x0,'rows':[]};var _0x84f4d7=_[_0x9a22('0x24')](db[_0x9a22('0x25')][_0x9a22('0x26')],function(_0xd2ed05){return{'name':_0xd2ed05[_0x9a22('0x27')],'type':_0xd2ed05[_0x9a22('0x28')][_0x9a22('0x29')]};});_0x153abe[_0x9a22('0x2a')]=_[_0x9a22('0x24')](_0x84f4d7,_0x9a22('0x22'));_0x153abe[_0x9a22('0x2b')]=_[_0x9a22('0x2c')](_0x41c085['query']);_0x153abe[_0x9a22('0x2d')]=_[_0x9a22('0x2e')](_0x153abe[_0x9a22('0x2a')],_0x153abe[_0x9a22('0x2b')]);_0x55ab17[_0x9a22('0x2f')]=_['intersection'](_0x153abe['model'],qs[_0x9a22('0x30')](_0x41c085[_0x9a22('0x2b')][_0x9a22('0x30')]));_0x55ab17[_0x9a22('0x2f')]=_0x55ab17[_0x9a22('0x2f')][_0x9a22('0x31')]?_0x55ab17['attributes']:_0x153abe['model'];if(!_0x41c085['query'][_0x9a22('0x32')](_0x9a22('0x33'))){_0x55ab17[_0x9a22('0x18')]=qs[_0x9a22('0x18')](_0x41c085[_0x9a22('0x2b')][_0x9a22('0x18')]);_0x55ab17[_0x9a22('0x1a')]=qs[_0x9a22('0x1a')](_0x41c085['query']['offset']);}_0x55ab17[_0x9a22('0x34')]=qs['sort'](_0x41c085[_0x9a22('0x2b')][_0x9a22('0x35')]);_0x55ab17[_0x9a22('0x36')]=qs[_0x9a22('0x2d')](_['pick'](_0x41c085['query'],_0x153abe[_0x9a22('0x2d')]),_0x84f4d7);if(_0x41c085['query'][_0x9a22('0x37')]){_0x55ab17['where']=_[_0x9a22('0x38')](_0x55ab17[_0x9a22('0x36')],{'$or':_['map'](_0x84f4d7,function(_0x48fdf5){if(_0x48fdf5[_0x9a22('0x28')]!==_0x9a22('0x39')){var _0xd40a46={};_0xd40a46[_0x48fdf5['name']]={'$like':'%'+_0x41c085[_0x9a22('0x2b')][_0x9a22('0x37')]+'%'};return _0xd40a46;}})});}_0x55ab17=_[_0x9a22('0x38')]({},_0x55ab17,_0x41c085[_0x9a22('0x3a')]);var _0x1b674f={'where':_0x55ab17['where']};return db[_0x9a22('0x25')][_0x9a22('0x19')](_0x1b674f)['then'](function(_0x2152e0){_0x378e11[_0x9a22('0x19')]=_0x2152e0;if(_0x41c085[_0x9a22('0x2b')][_0x9a22('0x3b')]){_0x55ab17[_0x9a22('0x3c')]=[{'all':!![]}];}return db[_0x9a22('0x25')][_0x9a22('0x3d')](_0x55ab17);})[_0x9a22('0x20')](function(_0x556e7f){_0x378e11[_0x9a22('0x3e')]=_0x556e7f;return _0x378e11;})[_0x9a22('0x20')](respondWithFilteredResult(_0x3d93cf,_0x55ab17))[_0x9a22('0x3f')](handleError(_0x3d93cf,null));};exports['show']=function(_0x34a03e,_0x3c2363){var _0x198a4f={'raw':!![],'where':{'id':_0x34a03e['params']['id']}},_0x530358={};_0x530358[_0x9a22('0x2a')]=_[_0x9a22('0x2c')](db['FaxTransferReport'][_0x9a22('0x26')]);_0x530358[_0x9a22('0x2b')]=_[_0x9a22('0x2c')](_0x34a03e['query']);_0x530358[_0x9a22('0x2d')]=_['intersection'](_0x530358['model'],_0x530358[_0x9a22('0x2b')]);_0x198a4f[_0x9a22('0x2f')]=_[_0x9a22('0x2e')](_0x530358[_0x9a22('0x2a')],qs['fields'](_0x34a03e[_0x9a22('0x2b')][_0x9a22('0x30')]));_0x198a4f[_0x9a22('0x2f')]=_0x198a4f[_0x9a22('0x2f')][_0x9a22('0x31')]?_0x198a4f[_0x9a22('0x2f')]:_0x530358[_0x9a22('0x2a')];if(_0x34a03e[_0x9a22('0x2b')][_0x9a22('0x3b')]){_0x198a4f[_0x9a22('0x3c')]=[{'all':!![]}];}_0x198a4f=_[_0x9a22('0x38')]({},_0x198a4f,_0x34a03e[_0x9a22('0x3a')]);return db[_0x9a22('0x25')][_0x9a22('0x40')](_0x198a4f)['then'](handleEntityNotFound(_0x3c2363,null))[_0x9a22('0x20')](respondWithResult(_0x3c2363,null))[_0x9a22('0x3f')](handleError(_0x3c2363,null));};exports[_0x9a22('0x41')]=function(_0x33b0d2,_0x47610a){return db['FaxTransferReport']['create'](_0x33b0d2['body'],{})['then'](respondWithResult(_0x47610a,0xc9))[_0x9a22('0x3f')](handleError(_0x47610a,null));};exports[_0x9a22('0x42')]=function(_0x2b67f2,_0x3f5128){if(_0x2b67f2[_0x9a22('0x43')]['id']){delete _0x2b67f2[_0x9a22('0x43')]['id'];}return db[_0x9a22('0x25')][_0x9a22('0x40')]({'where':{'id':_0x2b67f2[_0x9a22('0x44')]['id']}})[_0x9a22('0x20')](handleEntityNotFound(_0x3f5128,null))[_0x9a22('0x20')](saveUpdates(_0x2b67f2['body'],null))[_0x9a22('0x20')](respondWithResult(_0x3f5128,null))['catch'](handleError(_0x3f5128,null));};exports['destroy']=function(_0x300829,_0x306361){return db[_0x9a22('0x25')]['find']({'where':{'id':_0x300829[_0x9a22('0x44')]['id']}})[_0x9a22('0x20')](handleEntityNotFound(_0x306361,null))[_0x9a22('0x20')](removeEntity(_0x306361,null))[_0x9a22('0x3f')](handleError(_0x306361,null));};exports[_0x9a22('0x45')]=function(_0x4cbac7,_0x314451){return db[_0x9a22('0x25')][_0x9a22('0x45')]()[_0x9a22('0x20')](respondWithResult(_0x314451,null))[_0x9a22('0x3f')](handleError(_0x314451,null));}; \ No newline at end of file +var _0xc8a0=['name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x331b6e,_0x523810){var _0x3ef276=function(_0x366d1f){while(--_0x366d1f){_0x331b6e['push'](_0x331b6e['shift']());}};_0x3ef276(++_0x523810);}(_0xc8a0,0xbc));var _0x0c8a=function(_0x107d17,_0xe87874){_0x107d17=_0x107d17-0x0;var _0xb2c06a=_0xc8a0[_0x107d17];return _0xb2c06a;};'use strict';var emlformat=require(_0x0c8a('0x0'));var rimraf=require(_0x0c8a('0x1'));var zipdir=require(_0x0c8a('0x2'));var jsonpatch=require(_0x0c8a('0x3'));var rp=require(_0x0c8a('0x4'));var moment=require('moment');var BPromise=require(_0x0c8a('0x5'));var Mustache=require(_0x0c8a('0x6'));var util=require(_0x0c8a('0x7'));var path=require(_0x0c8a('0x8'));var sox=require(_0x0c8a('0x9'));var csv=require(_0x0c8a('0xa'));var ejs=require(_0x0c8a('0xb'));var fs=require('fs');var fs_extra=require(_0x0c8a('0xc'));var _=require(_0x0c8a('0xd'));var squel=require(_0x0c8a('0xe'));var crypto=require(_0x0c8a('0xf'));var jsforce=require(_0x0c8a('0x10'));var deskjs=require(_0x0c8a('0x11'));var toCsv=require(_0x0c8a('0xa'));var querystring=require(_0x0c8a('0x12'));var Papa=require('papaparse');var Redis=require(_0x0c8a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0c8a('0x14'));var as=require(_0x0c8a('0x15'));var hardwareService=require(_0x0c8a('0x16'));var logger=require(_0x0c8a('0x17'))('api');var utils=require(_0x0c8a('0x18'));var config=require(_0x0c8a('0x19'));var licenseUtil=require(_0x0c8a('0x1a'));var db=require(_0x0c8a('0x1b'))['db'];function respondWithStatusCode(_0x34d95e,_0x36b684){_0x36b684=_0x36b684||0xcc;return function(_0x366485){if(_0x366485){return _0x34d95e[_0x0c8a('0x1c')](_0x36b684);}return _0x34d95e[_0x0c8a('0x1d')](_0x36b684)[_0x0c8a('0x1e')]();};}function respondWithResult(_0x545dd2,_0xe6ff5c){_0xe6ff5c=_0xe6ff5c||0xc8;return function(_0x5242a7){if(_0x5242a7){return _0x545dd2[_0x0c8a('0x1d')](_0xe6ff5c)[_0x0c8a('0x1f')](_0x5242a7);}};}function respondWithFilteredResult(_0x547dfb,_0x3071d1){return function(_0x765999){if(_0x765999){var _0x28c3b2=typeof _0x3071d1[_0x0c8a('0x20')]===_0x0c8a('0x21')&&typeof _0x3071d1[_0x0c8a('0x22')]===_0x0c8a('0x21');var _0xb75bd1=_0x765999[_0x0c8a('0x23')];var _0xe8245a=_0x28c3b2?0x0:_0x3071d1[_0x0c8a('0x20')];var _0x2f2729=_0x28c3b2?_0x765999['count']:_0x3071d1[_0x0c8a('0x20')]+_0x3071d1[_0x0c8a('0x22')];var _0x5efe80;if(_0x2f2729>=_0xb75bd1){_0x2f2729=_0xb75bd1;_0x5efe80=0xc8;}else{_0x5efe80=0xce;}_0x547dfb[_0x0c8a('0x1d')](_0x5efe80);return _0x547dfb[_0x0c8a('0x24')](_0x0c8a('0x25'),_0xe8245a+'-'+_0x2f2729+'/'+_0xb75bd1)[_0x0c8a('0x1f')](_0x765999);}return null;};}function patchUpdates(_0x2136f0){return function(_0x1b89fc){try{jsonpatch[_0x0c8a('0x26')](_0x1b89fc,_0x2136f0,!![]);}catch(_0x13d249){return BPromise[_0x0c8a('0x27')](_0x13d249);}return _0x1b89fc[_0x0c8a('0x28')]();};}function saveUpdates(_0x3f4d47,_0x2e0f15){return function(_0x53b077){if(_0x53b077){return _0x53b077[_0x0c8a('0x29')](_0x3f4d47)[_0x0c8a('0x2a')](function(_0x4b373c){return _0x4b373c;});}return null;};}function removeEntity(_0x6e52ec,_0x424ea0){return function(_0x1c1387){if(_0x1c1387){return _0x1c1387['destroy']()['then'](function(){_0x6e52ec[_0x0c8a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22fa63,_0x53b23c){return function(_0x4d0e2c){if(!_0x4d0e2c){_0x22fa63[_0x0c8a('0x1c')](0x194);}return _0x4d0e2c;};}function handleError(_0x2bc910,_0xb8c7f){_0xb8c7f=_0xb8c7f||0x1f4;return function(_0xbcfffb){logger['error'](_0xbcfffb['stack']);if(_0xbcfffb['name']){delete _0xbcfffb[_0x0c8a('0x2b')];}_0x2bc910[_0x0c8a('0x1d')](_0xb8c7f)[_0x0c8a('0x2c')](_0xbcfffb);};}exports[_0x0c8a('0x2d')]=function(_0x347b24,_0x30882f){var _0x36618e={},_0x537a2c={},_0x193053={'count':0x0,'rows':[]};var _0x299ecd=_[_0x0c8a('0x2e')](db[_0x0c8a('0x2f')][_0x0c8a('0x30')],function(_0x47f117){return{'name':_0x47f117[_0x0c8a('0x31')],'type':_0x47f117[_0x0c8a('0x32')]['key']};});_0x537a2c['model']=_['map'](_0x299ecd,_0x0c8a('0x2b'));_0x537a2c[_0x0c8a('0x33')]=_[_0x0c8a('0x34')](_0x347b24['query']);_0x537a2c['filters']=_[_0x0c8a('0x35')](_0x537a2c[_0x0c8a('0x36')],_0x537a2c[_0x0c8a('0x33')]);_0x36618e['attributes']=_[_0x0c8a('0x35')](_0x537a2c[_0x0c8a('0x36')],qs[_0x0c8a('0x37')](_0x347b24[_0x0c8a('0x33')]['fields']));_0x36618e[_0x0c8a('0x38')]=_0x36618e[_0x0c8a('0x38')][_0x0c8a('0x39')]?_0x36618e[_0x0c8a('0x38')]:_0x537a2c[_0x0c8a('0x36')];if(!_0x347b24[_0x0c8a('0x33')][_0x0c8a('0x3a')](_0x0c8a('0x3b'))){_0x36618e[_0x0c8a('0x22')]=qs[_0x0c8a('0x22')](_0x347b24['query'][_0x0c8a('0x22')]);_0x36618e[_0x0c8a('0x20')]=qs[_0x0c8a('0x20')](_0x347b24['query']['offset']);}_0x36618e[_0x0c8a('0x3c')]=qs[_0x0c8a('0x3d')](_0x347b24['query'][_0x0c8a('0x3d')]);_0x36618e['where']=qs[_0x0c8a('0x3e')](_['pick'](_0x347b24[_0x0c8a('0x33')],_0x537a2c['filters']),_0x299ecd);if(_0x347b24[_0x0c8a('0x33')][_0x0c8a('0x3f')]){_0x36618e[_0x0c8a('0x40')]=_[_0x0c8a('0x41')](_0x36618e[_0x0c8a('0x40')],{'$or':_[_0x0c8a('0x2e')](_0x299ecd,function(_0x10402d){if(_0x10402d['type']!=='VIRTUAL'){var _0x33f7fd={};_0x33f7fd[_0x10402d[_0x0c8a('0x2b')]]={'$like':'%'+_0x347b24[_0x0c8a('0x33')][_0x0c8a('0x3f')]+'%'};return _0x33f7fd;}})});}_0x36618e=_[_0x0c8a('0x41')]({},_0x36618e,_0x347b24[_0x0c8a('0x42')]);var _0x5ded7a={'where':_0x36618e['where']};return db[_0x0c8a('0x2f')][_0x0c8a('0x23')](_0x5ded7a)[_0x0c8a('0x2a')](function(_0x158b82){_0x193053['count']=_0x158b82;if(_0x347b24[_0x0c8a('0x33')][_0x0c8a('0x43')]){_0x36618e[_0x0c8a('0x44')]=[{'all':!![]}];}return db[_0x0c8a('0x2f')]['findAll'](_0x36618e);})[_0x0c8a('0x2a')](function(_0x3bd4ff){_0x193053[_0x0c8a('0x45')]=_0x3bd4ff;return _0x193053;})[_0x0c8a('0x2a')](respondWithFilteredResult(_0x30882f,_0x36618e))[_0x0c8a('0x46')](handleError(_0x30882f,null));};exports[_0x0c8a('0x47')]=function(_0x59f567,_0x2f97f7){var _0x3cee35={'raw':!![],'where':{'id':_0x59f567['params']['id']}},_0x44fc6c={};_0x44fc6c[_0x0c8a('0x36')]=_[_0x0c8a('0x34')](db[_0x0c8a('0x2f')]['rawAttributes']);_0x44fc6c[_0x0c8a('0x33')]=_[_0x0c8a('0x34')](_0x59f567[_0x0c8a('0x33')]);_0x44fc6c[_0x0c8a('0x3e')]=_[_0x0c8a('0x35')](_0x44fc6c[_0x0c8a('0x36')],_0x44fc6c['query']);_0x3cee35[_0x0c8a('0x38')]=_[_0x0c8a('0x35')](_0x44fc6c[_0x0c8a('0x36')],qs[_0x0c8a('0x37')](_0x59f567[_0x0c8a('0x33')][_0x0c8a('0x37')]));_0x3cee35[_0x0c8a('0x38')]=_0x3cee35[_0x0c8a('0x38')][_0x0c8a('0x39')]?_0x3cee35[_0x0c8a('0x38')]:_0x44fc6c[_0x0c8a('0x36')];if(_0x59f567[_0x0c8a('0x33')][_0x0c8a('0x43')]){_0x3cee35[_0x0c8a('0x44')]=[{'all':!![]}];}_0x3cee35=_['merge']({},_0x3cee35,_0x59f567[_0x0c8a('0x42')]);return db[_0x0c8a('0x2f')][_0x0c8a('0x48')](_0x3cee35)[_0x0c8a('0x2a')](handleEntityNotFound(_0x2f97f7,null))[_0x0c8a('0x2a')](respondWithResult(_0x2f97f7,null))[_0x0c8a('0x46')](handleError(_0x2f97f7,null));};exports[_0x0c8a('0x49')]=function(_0x1262d0,_0x3eb621){return db[_0x0c8a('0x2f')]['create'](_0x1262d0[_0x0c8a('0x4a')],{})[_0x0c8a('0x2a')](respondWithResult(_0x3eb621,0xc9))[_0x0c8a('0x46')](handleError(_0x3eb621,null));};exports['update']=function(_0x38e63f,_0x1286a6){if(_0x38e63f[_0x0c8a('0x4a')]['id']){delete _0x38e63f[_0x0c8a('0x4a')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x38e63f['params']['id']}})[_0x0c8a('0x2a')](handleEntityNotFound(_0x1286a6,null))[_0x0c8a('0x2a')](saveUpdates(_0x38e63f[_0x0c8a('0x4a')],null))[_0x0c8a('0x2a')](respondWithResult(_0x1286a6,null))[_0x0c8a('0x46')](handleError(_0x1286a6,null));};exports['destroy']=function(_0x2ae8f2,_0xfa0ea8){return db['FaxTransferReport'][_0x0c8a('0x48')]({'where':{'id':_0x2ae8f2[_0x0c8a('0x4b')]['id']}})[_0x0c8a('0x2a')](handleEntityNotFound(_0xfa0ea8,null))['then'](removeEntity(_0xfa0ea8,null))[_0x0c8a('0x46')](handleError(_0xfa0ea8,null));};exports[_0x0c8a('0x4c')]=function(_0x3ca736,_0x58e666){return db[_0x0c8a('0x2f')]['describe']()[_0x0c8a('0x2a')](respondWithResult(_0x58e666,null))[_0x0c8a('0x46')](handleError(_0x58e666,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f60b68b..393178c 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 _0xbfcf=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxTransferReport.attributes'];(function(_0x229ccd,_0x19abbc){var _0x4b6a73=function(_0x1910f4){while(--_0x1910f4){_0x229ccd['push'](_0x229ccd['shift']());}};_0x4b6a73(++_0x19abbc);}(_0xbfcf,0x1a9));var _0xfbfc=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xbfcf[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var logger=require(_0xfbfc('0x2'))(_0xfbfc('0x3'));var moment=require(_0xfbfc('0x4'));var BPromise=require('bluebird');var rp=require(_0xfbfc('0x5'));var fs=require('fs');var path=require(_0xfbfc('0x6'));var rimraf=require(_0xfbfc('0x7'));var config=require('../../config/environment');var attributes=require(_0xfbfc('0x8'));module[_0xfbfc('0x9')]=function(_0x16d76f,_0x18e501){return _0x16d76f[_0xfbfc('0xa')](_0xfbfc('0xb'),attributes,{'tableName':_0xfbfc('0xc'),'paranoid':![],'indexes':[{'name':_0xfbfc('0xd'),'fields':[_0xfbfc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb676=['uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','FaxTransferReport'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xb676,0xbc));var _0x6b67=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xb676[_0x1db251];return _0x56685a;};'use strict';var _=require(_0x6b67('0x0'));var util=require('util');var logger=require(_0x6b67('0x1'))(_0x6b67('0x2'));var moment=require(_0x6b67('0x3'));var BPromise=require(_0x6b67('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b67('0x5'));var config=require(_0x6b67('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x6b67('0x7')]=function(_0x58628e,_0x16597c){return _0x58628e[_0x6b67('0x8')](_0x6b67('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x6b67('0xa'),'fields':[_0x6b67('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index f3ebbb0..a4bf177 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 _0xdcf7=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x41fffd,_0x597cc0){var _0xef53d7=function(_0x53f727){while(--_0x53f727){_0x41fffd['push'](_0x41fffd['shift']());}};_0xef53d7(++_0x597cc0);}(_0xdcf7,0x1a0));var _0x7dcf=function(_0x45afb6,_0x182bf1){_0x45afb6=_0x45afb6-0x0;var _0x1f51e5=_0xdcf7[_0x45afb6];return _0x1f51e5;};'use strict';var _=require(_0x7dcf('0x0'));var util=require(_0x7dcf('0x1'));var moment=require(_0x7dcf('0x2'));var BPromise=require(_0x7dcf('0x3'));var rs=require(_0x7dcf('0x4'));var fs=require('fs');var Redis=require(_0x7dcf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7dcf('0x6'));var logger=require('../../config/logger')(_0x7dcf('0x7'));var config=require(_0x7dcf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7dcf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29cbe4,_0x56a2b8,_0x2d7e60){return new BPromise(function(_0x2d4ffe,_0x3efb2e){return client[_0x7dcf('0xa')](_0x29cbe4,_0x2d7e60)['then'](function(_0x40fa73){logger['info'](_0x7dcf('0xb'),_0x56a2b8,_0x7dcf('0xc'));logger['debug'](_0x7dcf('0xd'),_0x56a2b8,_0x7dcf('0xc'),JSON[_0x7dcf('0xe')](_0x40fa73));if(_0x40fa73[_0x7dcf('0xf')]){if(_0x40fa73['error'][_0x7dcf('0x10')]===0x1f4){logger['error'](_0x7dcf('0xb'),_0x56a2b8,_0x40fa73['error'][_0x7dcf('0x11')]);return _0x3efb2e(_0x40fa73[_0x7dcf('0xf')][_0x7dcf('0x11')]);}logger['error'](_0x7dcf('0xb'),_0x56a2b8,_0x40fa73[_0x7dcf('0xf')][_0x7dcf('0x11')]);return _0x2d4ffe(_0x40fa73['error']['message']);}else{logger['info'](_0x7dcf('0xb'),_0x56a2b8,_0x7dcf('0xc'));_0x2d4ffe(_0x40fa73['result'][_0x7dcf('0x11')]);}})[_0x7dcf('0x12')](function(_0x3ad21a){logger['error'](_0x7dcf('0xb'),_0x56a2b8,_0x3ad21a);_0x3efb2e(_0x3ad21a);});});} \ No newline at end of file +var _0x6d9c=['info','request\x20sent','debug','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x2aa6a5,_0x2240ea){var _0x2620ef=function(_0x54d4ab){while(--_0x54d4ab){_0x2aa6a5['push'](_0x2aa6a5['shift']());}};_0x2620ef(++_0x2240ea);}(_0x6d9c,0x87));var _0xc6d9=function(_0x17dc7f,_0x1d0580){_0x17dc7f=_0x17dc7f-0x0;var _0x4fd0a1=_0x6d9c[_0x17dc7f];return _0x4fd0a1;};'use strict';var _=require('lodash');var util=require(_0xc6d9('0x0'));var moment=require(_0xc6d9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6d9('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6d9('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6d9('0x4'));var client=jayson[_0xc6d9('0x5')][_0xc6d9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x20b5ba,_0x1c0ef4,_0x2b2e20){return new BPromise(function(_0x3ed29e,_0x2a3b0f){return client[_0xc6d9('0x7')](_0x20b5ba,_0x2b2e20)[_0xc6d9('0x8')](function(_0x22046c){logger[_0xc6d9('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x1c0ef4,_0xc6d9('0xa'));logger[_0xc6d9('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1c0ef4,'request\x20sent',JSON['stringify'](_0x22046c));if(_0x22046c[_0xc6d9('0xc')]){if(_0x22046c[_0xc6d9('0xc')][_0xc6d9('0xd')]===0x1f4){logger[_0xc6d9('0xc')](_0xc6d9('0xe'),_0x1c0ef4,_0x22046c[_0xc6d9('0xc')][_0xc6d9('0xf')]);return _0x2a3b0f(_0x22046c['error']['message']);}logger[_0xc6d9('0xc')](_0xc6d9('0xe'),_0x1c0ef4,_0x22046c[_0xc6d9('0xc')][_0xc6d9('0xf')]);return _0x3ed29e(_0x22046c['error'][_0xc6d9('0xf')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x1c0ef4,_0xc6d9('0xa'));_0x3ed29e(_0x22046c[_0xc6d9('0x10')]['message']);}})[_0xc6d9('0x11')](function(_0x53b667){logger[_0xc6d9('0xc')](_0xc6d9('0xe'),_0x1c0ef4,_0x53b667);_0x2a3b0f(_0x53b667);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8be1c69..016281f 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 _0x53f3=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update'];(function(_0x385f5a,_0x320f47){var _0x2eff02=function(_0x22c675){while(--_0x22c675){_0x385f5a['push'](_0x385f5a['shift']());}};_0x2eff02(++_0x320f47);}(_0x53f3,0x95));var _0x353f=function(_0x28d1df,_0x6ee609){_0x28d1df=_0x28d1df-0x0;var _0x48e249=_0x53f3[_0x28d1df];return _0x48e249;};'use strict';var multer=require(_0x353f('0x0'));var util=require(_0x353f('0x1'));var path=require(_0x353f('0x2'));var timeout=require('connect-timeout');var express=require(_0x353f('0x3'));var router=express[_0x353f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x353f('0x5'));var interaction=require(_0x353f('0x6'));var config=require(_0x353f('0x7'));var controller=require(_0x353f('0x8'));router['get']('/',auth[_0x353f('0x9')](),controller[_0x353f('0xa')]);router['get'](_0x353f('0xb'),auth[_0x353f('0x9')](),controller[_0x353f('0xc')]);router[_0x353f('0xd')](_0x353f('0xe'),auth[_0x353f('0x9')](),controller[_0x353f('0xf')]);router[_0x353f('0x10')]('/',auth[_0x353f('0x9')](),controller[_0x353f('0x11')]);router['put'](_0x353f('0xe'),auth['isAuthenticated'](),controller[_0x353f('0x12')]);router[_0x353f('0x13')]('/:id',auth[_0x353f('0x9')](),controller['destroy']);module[_0x353f('0x14')]=router; \ No newline at end of file +var _0xf886=['/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf886,0x183));var _0x6f88=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xf886[_0x2b737c];return _0x466ed5;};'use strict';var multer=require(_0x6f88('0x0'));var util=require(_0x6f88('0x1'));var path=require(_0x6f88('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f88('0x3'));var router=express[_0x6f88('0x4')]();var fs_extra=require(_0x6f88('0x5'));var auth=require(_0x6f88('0x6'));var interaction=require(_0x6f88('0x7'));var config=require(_0x6f88('0x8'));var controller=require(_0x6f88('0x9'));router[_0x6f88('0xa')]('/',auth[_0x6f88('0xb')](),controller['index']);router[_0x6f88('0xa')](_0x6f88('0xc'),auth[_0x6f88('0xb')](),controller['describe']);router['get'](_0x6f88('0xd'),auth[_0x6f88('0xb')](),controller[_0x6f88('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6f88('0xf')]);router[_0x6f88('0x10')](_0x6f88('0xd'),auth[_0x6f88('0xb')](),controller[_0x6f88('0x11')]);router[_0x6f88('0x12')](_0x6f88('0xd'),auth['isAuthenticated'](),controller[_0x6f88('0x13')]);module[_0x6f88('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index be0dc8b..628bb4f 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 _0x5517=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x5517,0x6a));var _0x7551=function(_0xc1cfb4,_0x147528){_0xc1cfb4=_0xc1cfb4-0x0;var _0x54aef6=_0x5517[_0xc1cfb4];return _0x54aef6;};'use strict';var multer=require(_0x7551('0x0'));var util=require('util');var path=require(_0x7551('0x1'));var timeout=require(_0x7551('0x2'));var express=require(_0x7551('0x3'));var router=express[_0x7551('0x4')]();var fs_extra=require(_0x7551('0x5'));var auth=require(_0x7551('0x6'));var interaction=require(_0x7551('0x7'));var config=require(_0x7551('0x8'));var controller=require(_0x7551('0x9'));router[_0x7551('0xa')]('/',auth[_0x7551('0xb')](),controller['index']);router[_0x7551('0xa')](_0x7551('0xc'),auth[_0x7551('0xb')](),controller['show']);router['get']('/:id/configurations',auth[_0x7551('0xb')](),controller[_0x7551('0xd')]);router[_0x7551('0xa')](_0x7551('0xe'),auth[_0x7551('0xb')](),controller[_0x7551('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7551('0x10')]);router[_0x7551('0x11')]('/:id/configurations',auth[_0x7551('0xb')](),controller[_0x7551('0x12')]);router['put'](_0x7551('0xc'),auth[_0x7551('0xb')](),controller[_0x7551('0x13')]);router[_0x7551('0x14')]('/:id',auth[_0x7551('0xb')](),controller[_0x7551('0x15')]);module['exports']=router; \ No newline at end of file +var _0x06f2=['exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x06f2,0x1e5));var _0x206f=function(_0x3da63f,_0x349418){_0x3da63f=_0x3da63f-0x0;var _0x2cb579=_0x06f2[_0x3da63f];return _0x2cb579;};'use strict';var multer=require(_0x206f('0x0'));var util=require(_0x206f('0x1'));var path=require(_0x206f('0x2'));var timeout=require('connect-timeout');var express=require(_0x206f('0x3'));var router=express[_0x206f('0x4')]();var fs_extra=require(_0x206f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x206f('0x6'));var controller=require(_0x206f('0x7'));router[_0x206f('0x8')]('/',auth[_0x206f('0x9')](),controller[_0x206f('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x206f('0x8')](_0x206f('0xb'),auth[_0x206f('0x9')](),controller[_0x206f('0xc')]);router[_0x206f('0x8')](_0x206f('0xd'),auth['isAuthenticated'](),controller[_0x206f('0xe')]);router[_0x206f('0xf')]('/',auth[_0x206f('0x9')](),controller[_0x206f('0x10')]);router['post'](_0x206f('0xb'),auth[_0x206f('0x9')](),controller[_0x206f('0x11')]);router[_0x206f('0x12')]('/:id',auth[_0x206f('0x9')](),controller[_0x206f('0x13')]);router[_0x206f('0x14')]('/:id',auth[_0x206f('0x9')](),controller['destroy']);module[_0x206f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 0bbefb2..58dc53e 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 _0xc3e7=['sequelize','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xc3e7,0x6c));var _0x7c3e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xc3e7[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x7c3e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c3e('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7c3e('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x7c3e('0x2')),'defaultValue':_0x7c3e('0x2')},'password':{'type':Sequelize[_0x7c3e('0x1')]},'consumerKey':{'type':Sequelize[_0x7c3e('0x1')]},'consumerSecret':{'type':Sequelize[_0x7c3e('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x7c3e('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7c3e('0x3')](_0x7c3e('0x4'),_0x7c3e('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd1f1=['exports','STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x22eff0,_0x437e0b){var _0x56e76b=function(_0x318949){while(--_0x318949){_0x22eff0['push'](_0x22eff0['shift']());}};_0x56e76b(++_0x437e0b);}(_0xd1f1,0x143));var _0x1d1f=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0xd1f1[_0x5a452e];return _0x2c4c43;};'use strict';var Sequelize=require(_0x1d1f('0x0'));module[_0x1d1f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1d1f('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x1d1f('0x3')]('basic'),'defaultValue':_0x1d1f('0x4')},'password':{'type':Sequelize[_0x1d1f('0x2')]},'consumerKey':{'type':Sequelize[_0x1d1f('0x2')]},'consumerSecret':{'type':Sequelize[_0x1d1f('0x2')]},'token':{'type':Sequelize[_0x1d1f('0x2')]},'tokenSecret':{'type':Sequelize[_0x1d1f('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x1d1f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b133af6..b609e69 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 _0x0c64=['then','destroy','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','findOne','remoteUri','authType','username','consumerKey','token','slice','GET','%s/custom_fields','application/json','basic','headers','format','Basic\x20%s','base64','_embedded','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','save','update'];(function(_0x680a2d,_0x4eb9d7){var _0x20ef0e=function(_0x45d9c9){while(--_0x45d9c9){_0x680a2d['push'](_0x680a2d['shift']());}};_0x20ef0e(++_0x4eb9d7);}(_0x0c64,0x18d));var _0x40c6=function(_0x17c097,_0x13a65d){_0x17c097=_0x17c097-0x0;var _0x1ac1ac=_0x0c64[_0x17c097];return _0x1ac1ac;};'use strict';var emlformat=require(_0x40c6('0x0'));var rimraf=require(_0x40c6('0x1'));var zipdir=require(_0x40c6('0x2'));var jsonpatch=require(_0x40c6('0x3'));var rp=require(_0x40c6('0x4'));var moment=require('moment');var BPromise=require(_0x40c6('0x5'));var Mustache=require(_0x40c6('0x6'));var util=require(_0x40c6('0x7'));var path=require(_0x40c6('0x8'));var sox=require(_0x40c6('0x9'));var csv=require(_0x40c6('0xa'));var ejs=require(_0x40c6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40c6('0xc'));var squel=require(_0x40c6('0xd'));var crypto=require(_0x40c6('0xe'));var jsforce=require(_0x40c6('0xf'));var deskjs=require(_0x40c6('0x10'));var toCsv=require(_0x40c6('0xa'));var querystring=require(_0x40c6('0x11'));var Papa=require(_0x40c6('0x12'));var Redis=require(_0x40c6('0x13'));var authService=require(_0x40c6('0x14'));var qs=require(_0x40c6('0x15'));var as=require(_0x40c6('0x16'));var hardwareService=require(_0x40c6('0x17'));var logger=require(_0x40c6('0x18'))(_0x40c6('0x19'));var utils=require('../../config/utils');var config=require(_0x40c6('0x1a'));var licenseUtil=require(_0x40c6('0x1b'));var db=require(_0x40c6('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59f5bf,_0x43fece){_0x43fece=_0x43fece||0xcc;return function(_0x4f3401){if(_0x4f3401){return _0x59f5bf['sendStatus'](_0x43fece);}return _0x59f5bf[_0x40c6('0x1d')](_0x43fece)[_0x40c6('0x1e')]();};}function respondWithResult(_0x52d99a,_0x4be5b5){_0x4be5b5=_0x4be5b5||0xc8;return function(_0x5bcca6){if(_0x5bcca6){return _0x52d99a[_0x40c6('0x1d')](_0x4be5b5)['json'](_0x5bcca6);}};}function respondWithFilteredResult(_0x423003,_0x2923ef){return function(_0x5e1b26){if(_0x5e1b26){var _0x49f703=typeof _0x2923ef[_0x40c6('0x1f')]===_0x40c6('0x20')&&typeof _0x2923ef['limit']===_0x40c6('0x20');var _0x5aa483=_0x5e1b26[_0x40c6('0x21')];var _0x5dbaef=_0x49f703?0x0:_0x2923ef['offset'];var _0x8929=_0x49f703?_0x5e1b26[_0x40c6('0x21')]:_0x2923ef[_0x40c6('0x1f')]+_0x2923ef[_0x40c6('0x22')];var _0x1c41ba;if(_0x8929>=_0x5aa483){_0x8929=_0x5aa483;_0x1c41ba=0xc8;}else{_0x1c41ba=0xce;}_0x423003[_0x40c6('0x1d')](_0x1c41ba);return _0x423003[_0x40c6('0x23')]('Content-Range',_0x5dbaef+'-'+_0x8929+'/'+_0x5aa483)[_0x40c6('0x24')](_0x5e1b26);}return null;};}function patchUpdates(_0x24d4dd){return function(_0x15580f){try{jsonpatch['apply'](_0x15580f,_0x24d4dd,!![]);}catch(_0x1c24f0){return BPromise['reject'](_0x1c24f0);}return _0x15580f[_0x40c6('0x25')]();};}function saveUpdates(_0x1f9006,_0x2bde3d){return function(_0x53d96e){if(_0x53d96e){return _0x53d96e[_0x40c6('0x26')](_0x1f9006)[_0x40c6('0x27')](function(_0x424024){return _0x424024;});}return null;};}function removeEntity(_0x481cd8,_0x51bb83){return function(_0x414ff6){if(_0x414ff6){return _0x414ff6[_0x40c6('0x28')]()['then'](function(){_0x481cd8[_0x40c6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7603,_0x171615){return function(_0x18bdcf){if(!_0x18bdcf){_0x5d7603[_0x40c6('0x29')](0x194);}return _0x18bdcf;};}function handleError(_0xd557ee,_0x210ce1){_0x210ce1=_0x210ce1||0x1f4;return function(_0x110c14){logger[_0x40c6('0x2a')](_0x110c14[_0x40c6('0x2b')]);if(_0x110c14[_0x40c6('0x2c')]){delete _0x110c14[_0x40c6('0x2c')];}_0xd557ee['status'](_0x210ce1)[_0x40c6('0x2d')](_0x110c14);};}exports['index']=function(_0x91bfdb,_0x2d21e5){var _0x590537={},_0x3365e2={},_0x5bc85d={'count':0x0,'rows':[]};var _0x4f24f1=_[_0x40c6('0x2e')](db[_0x40c6('0x2f')][_0x40c6('0x30')],function(_0x5b05fe){return{'name':_0x5b05fe[_0x40c6('0x31')],'type':_0x5b05fe['type']['key']};});_0x3365e2['model']=_['map'](_0x4f24f1,'name');_0x3365e2[_0x40c6('0x32')]=_['keys'](_0x91bfdb[_0x40c6('0x32')]);_0x3365e2['filters']=_[_0x40c6('0x33')](_0x3365e2[_0x40c6('0x34')],_0x3365e2['query']);_0x590537['attributes']=_[_0x40c6('0x33')](_0x3365e2['model'],qs['fields'](_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x35')]));_0x590537[_0x40c6('0x36')]=_0x590537[_0x40c6('0x36')][_0x40c6('0x37')]?_0x590537[_0x40c6('0x36')]:_0x3365e2[_0x40c6('0x34')];if(!_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x38')](_0x40c6('0x39'))){_0x590537[_0x40c6('0x22')]=qs[_0x40c6('0x22')](_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x22')]);_0x590537[_0x40c6('0x1f')]=qs[_0x40c6('0x1f')](_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x1f')]);}_0x590537[_0x40c6('0x3a')]=qs[_0x40c6('0x3b')](_0x91bfdb['query'][_0x40c6('0x3b')]);_0x590537[_0x40c6('0x3c')]=qs[_0x40c6('0x3d')](_[_0x40c6('0x3e')](_0x91bfdb[_0x40c6('0x32')],_0x3365e2[_0x40c6('0x3d')]),_0x4f24f1);if(_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x3f')]){_0x590537[_0x40c6('0x3c')]=_[_0x40c6('0x40')](_0x590537[_0x40c6('0x3c')],{'$or':_[_0x40c6('0x2e')](_0x4f24f1,function(_0x2bc7f3){if(_0x2bc7f3[_0x40c6('0x41')]!==_0x40c6('0x42')){var _0x510f6a={};_0x510f6a[_0x2bc7f3[_0x40c6('0x2c')]]={'$like':'%'+_0x91bfdb[_0x40c6('0x32')][_0x40c6('0x3f')]+'%'};return _0x510f6a;}})});}_0x590537=_[_0x40c6('0x40')]({},_0x590537,_0x91bfdb[_0x40c6('0x43')]);var _0x244798={'where':_0x590537[_0x40c6('0x3c')]};return db['DeskAccount'][_0x40c6('0x21')](_0x244798)[_0x40c6('0x27')](function(_0x38c65f){_0x5bc85d[_0x40c6('0x21')]=_0x38c65f;if(_0x91bfdb['query'][_0x40c6('0x44')]){_0x590537[_0x40c6('0x45')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x590537);})['then'](function(_0x1356fe){_0x5bc85d['rows']=_0x1356fe;return _0x5bc85d;})[_0x40c6('0x27')](respondWithFilteredResult(_0x2d21e5,_0x590537))[_0x40c6('0x46')](handleError(_0x2d21e5,null));};exports[_0x40c6('0x47')]=function(_0x7f7ba3,_0x36a4a8){var _0x2f7e35={'raw':![],'where':{'id':_0x7f7ba3[_0x40c6('0x48')]['id']}},_0x325b36={};_0x325b36[_0x40c6('0x34')]=_[_0x40c6('0x49')](db[_0x40c6('0x2f')][_0x40c6('0x30')]);_0x325b36['query']=_['keys'](_0x7f7ba3[_0x40c6('0x32')]);_0x325b36[_0x40c6('0x3d')]=_[_0x40c6('0x33')](_0x325b36[_0x40c6('0x34')],_0x325b36[_0x40c6('0x32')]);_0x2f7e35[_0x40c6('0x36')]=_[_0x40c6('0x33')](_0x325b36['model'],qs[_0x40c6('0x35')](_0x7f7ba3['query']['fields']));_0x2f7e35[_0x40c6('0x36')]=_0x2f7e35['attributes']['length']?_0x2f7e35['attributes']:_0x325b36['model'];if(_0x7f7ba3[_0x40c6('0x32')]['includeAll']){_0x2f7e35['include']=[{'all':!![]}];}_0x2f7e35=_[_0x40c6('0x40')]({},_0x2f7e35,_0x7f7ba3[_0x40c6('0x43')]);return db['DeskAccount'][_0x40c6('0x4a')](_0x2f7e35)[_0x40c6('0x27')](handleEntityNotFound(_0x36a4a8,null))['then'](respondWithResult(_0x36a4a8,null))[_0x40c6('0x46')](handleError(_0x36a4a8,null));};exports['create']=function(_0x4c9106,_0x42ad5f){return db[_0x40c6('0x2f')][_0x40c6('0x4b')](_0x4c9106[_0x40c6('0x4c')],{})[_0x40c6('0x27')](respondWithResult(_0x42ad5f,0xc9))['catch'](handleError(_0x42ad5f,null));};exports['update']=function(_0x2227fb,_0x2c4b44){if(_0x2227fb['body']['id']){delete _0x2227fb[_0x40c6('0x4c')]['id'];}return db[_0x40c6('0x2f')]['find']({'where':{'id':_0x2227fb[_0x40c6('0x48')]['id']}})[_0x40c6('0x27')](handleEntityNotFound(_0x2c4b44,null))[_0x40c6('0x27')](saveUpdates(_0x2227fb[_0x40c6('0x4c')],null))['then'](respondWithResult(_0x2c4b44,null))[_0x40c6('0x46')](handleError(_0x2c4b44,null));};exports['destroy']=function(_0x108e3d,_0x96f145){return db[_0x40c6('0x2f')][_0x40c6('0x4a')]({'where':{'id':_0x108e3d[_0x40c6('0x48')]['id']}})[_0x40c6('0x27')](handleEntityNotFound(_0x96f145,null))[_0x40c6('0x27')](removeEntity(_0x96f145,null))[_0x40c6('0x46')](handleError(_0x96f145,null));};exports['getConfigurations']=function(_0x31a91b,_0x1489c7,_0x57b1c1){var _0x33eaaf={};var _0x19157b={};var _0x5233df;var _0x5afd68;return db['DeskAccount']['findOne']({'where':{'id':_0x31a91b[_0x40c6('0x48')]['id']}})['then'](handleEntityNotFound(_0x1489c7,null))[_0x40c6('0x27')](function(_0x38ef9c){if(_0x38ef9c){_0x5233df=_0x38ef9c;_0x19157b[_0x40c6('0x34')]=_[_0x40c6('0x49')](db['DeskConfiguration'][_0x40c6('0x30')]);_0x19157b[_0x40c6('0x32')]=_[_0x40c6('0x49')](_0x31a91b[_0x40c6('0x32')]);_0x19157b[_0x40c6('0x3d')]=_['intersection'](_0x19157b['model'],_0x19157b['query']);_0x33eaaf[_0x40c6('0x36')]=_['intersection'](_0x19157b[_0x40c6('0x34')],qs[_0x40c6('0x35')](_0x31a91b[_0x40c6('0x32')][_0x40c6('0x35')]));_0x33eaaf[_0x40c6('0x36')]=_0x33eaaf[_0x40c6('0x36')]['length']?_0x33eaaf['attributes']:_0x19157b['model'];_0x33eaaf[_0x40c6('0x3a')]=qs[_0x40c6('0x3b')](_0x31a91b[_0x40c6('0x32')]['sort']);_0x33eaaf[_0x40c6('0x3c')]=qs[_0x40c6('0x3d')](_[_0x40c6('0x3e')](_0x31a91b[_0x40c6('0x32')],_0x19157b[_0x40c6('0x3d')]));if(_0x31a91b[_0x40c6('0x32')][_0x40c6('0x3f')]){_0x33eaaf[_0x40c6('0x3c')]=_[_0x40c6('0x40')](_0x33eaaf[_0x40c6('0x3c')],{'$or':_[_0x40c6('0x2e')](_0x33eaaf[_0x40c6('0x36')],function(_0x2a0c05){var _0x299845={};_0x299845[_0x2a0c05]={'$like':'%'+_0x31a91b[_0x40c6('0x32')][_0x40c6('0x3f')]+'%'};return _0x299845;})});}_0x33eaaf=_[_0x40c6('0x40')]({},_0x33eaaf,_0x31a91b['options']);return _0x5233df[_0x40c6('0x4d')](_0x33eaaf);}})[_0x40c6('0x27')](function(_0x26eced){if(_0x26eced){_0x5afd68=_0x26eced[_0x40c6('0x37')];if(!_0x31a91b[_0x40c6('0x32')][_0x40c6('0x38')](_0x40c6('0x39'))){_0x33eaaf['limit']=qs[_0x40c6('0x22')](_0x31a91b[_0x40c6('0x32')][_0x40c6('0x22')]);_0x33eaaf['offset']=qs[_0x40c6('0x1f')](_0x31a91b[_0x40c6('0x32')][_0x40c6('0x1f')]);}return _0x5233df['getConfigurations'](_0x33eaaf);}})[_0x40c6('0x27')](function(_0x3c82c9){if(_0x3c82c9){return _0x3c82c9?{'count':_0x5afd68,'rows':_0x3c82c9}:null;}})[_0x40c6('0x27')](respondWithResult(_0x1489c7,null))[_0x40c6('0x46')](handleError(_0x1489c7,null));};exports[_0x40c6('0x4e')]=function(_0x306e31,_0x55a798,_0x2c78e6){if(_0x306e31[_0x40c6('0x4c')]['id']){delete _0x306e31['body']['id'];}return db[_0x40c6('0x2f')]['findOne']({'where':{'id':_0x306e31[_0x40c6('0x48')]['id']}})[_0x40c6('0x27')](handleEntityNotFound(_0x55a798,null))['then'](function(_0x2abf1f){if(_0x2abf1f){_0x306e31[_0x40c6('0x4c')][_0x40c6('0x4f')]=_0x2abf1f['id'];_0x306e31[_0x40c6('0x4c')][_0x40c6('0x50')]=integrations['getSubjects'](_0x306e31[_0x40c6('0x4c')]['channel'],_0x306e31[_0x40c6('0x4c')][_0x40c6('0x41')]);_0x306e31['body'][_0x40c6('0x51')]=integrations[_0x40c6('0x52')](_0x306e31[_0x40c6('0x4c')][_0x40c6('0x53')],_0x306e31[_0x40c6('0x4c')][_0x40c6('0x41')]);return db['DeskConfiguration'][_0x40c6('0x4b')](_0x306e31['body'],{'include':[{'model':db[_0x40c6('0x54')],'as':_0x40c6('0x50')},{'model':db[_0x40c6('0x54')],'as':_0x40c6('0x51')}]});}return null;})[_0x40c6('0x27')](respondWithResult(_0x55a798,null))['catch'](handleError(_0x55a798,null));};exports[_0x40c6('0x55')]=function(_0x20a9cd,_0x3510e5,_0x53b196){var _0x5f5d63=[{'name':_0x40c6('0x56'),'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 _0x194c40='';return db[_0x40c6('0x2f')][_0x40c6('0x57')]({'where':{'id':_0x20a9cd[_0x40c6('0x48')]['id']},'attributes':['id',_0x40c6('0x58'),_0x40c6('0x59'),_0x40c6('0x5a'),'password',_0x40c6('0x5b'),'consumerSecret',_0x40c6('0x5c'),'tokenSecret']})[_0x40c6('0x27')](handleEntityNotFound(_0x3510e5,null))[_0x40c6('0x27')](function(_0x102ca0){if(_0x102ca0){_0x194c40=_0x102ca0['remoteUri'];var _0x2ac6cc=_0x194c40[_0x40c6('0x5d')](-0x1);if(_0x2ac6cc==='/'){_0x194c40=_0x194c40['substring'](0x0,_0x194c40['lastIndexOf'](_0x2ac6cc));}var _0x4484c0={'method':_0x40c6('0x5e'),'uri':util['format'](_0x40c6('0x5f'),_0x194c40),'headers':{'Content-Type':'application/json','Accept':_0x40c6('0x60')},'json':!![]};if(_0x102ca0[_0x40c6('0x59')]===_0x40c6('0x61')){_0x4484c0[_0x40c6('0x62')]['Authorization']=util[_0x40c6('0x63')](_0x40c6('0x64'),new Buffer(util['format']('%s:%s',_0x102ca0[_0x40c6('0x5a')],_0x102ca0['password']))['toString'](_0x40c6('0x65')));}return rp(_0x4484c0)[_0x40c6('0x27')](function(_0x5e071b){return _0x5f5d63['concat'](_['map'](_0x5e071b[_0x40c6('0x66')]['entries'],function(_0x50e6f9){return{'id':_0x50e6f9['name'],'name':_0x50e6f9['name'],'type':_0x50e6f9[_0x40c6('0x41')],'active':_0x50e6f9[_0x40c6('0x67')],'label':_0x50e6f9[_0x40c6('0x68')],'custom':!![]};}));});}})['then'](function(_0x37f84d){return{'count':_0x37f84d[_0x40c6('0x37')],'rows':_0x37f84d};})[_0x40c6('0x27')](respondWithResult(_0x3510e5,null))[_0x40c6('0x46')](function(_0x1f86ba){var _0x2cfdad=_0x20a9cd[_0x40c6('0x32')][_0x40c6('0x69')]?0x1f4:_0x1f86ba[_0x40c6('0x6a')]||0x1f4;logger[_0x40c6('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x40c6('0x55'),_0x2cfdad,JSON[_0x40c6('0x6b')](_0x1f86ba));delete _0x1f86ba[_0x40c6('0x2c')];if(_0x2cfdad===0x191){_0x2cfdad=0x190;}_0x3510e5['status'](_0x2cfdad)[_0x40c6('0x2d')](_0x20a9cd[_0x40c6('0x32')]['test']?{'message':_0x40c6('0x6c'),'statusCode':_0x1f86ba['statusCode']}:_0x1f86ba);});}; \ No newline at end of file +var _0x78b7=['password','slice','substring','GET','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','username','toString','base64','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','end','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','getConfigurations','findOne','DeskConfiguration','length','order','sort','addConfiguration','Subjects','getSubjects','channel','type','getDescriptions','DeskField','Descriptions','priority','remoteUri','authType'];(function(_0x5b7119,_0x50b8a3){var _0x3e58b6=function(_0x13043d){while(--_0x13043d){_0x5b7119['push'](_0x5b7119['shift']());}};_0x3e58b6(++_0x50b8a3);}(_0x78b7,0x1d9));var _0x778b=function(_0x1ca4ea,_0x2e44d4){_0x1ca4ea=_0x1ca4ea-0x0;var _0x2d9acc=_0x78b7[_0x1ca4ea];return _0x2d9acc;};'use strict';var emlformat=require(_0x778b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x778b('0x1'));var jsonpatch=require(_0x778b('0x2'));var rp=require('request-promise');var moment=require(_0x778b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x778b('0x4'));var util=require(_0x778b('0x5'));var path=require(_0x778b('0x6'));var sox=require(_0x778b('0x7'));var csv=require(_0x778b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x778b('0x9'));var _=require(_0x778b('0xa'));var squel=require(_0x778b('0xb'));var crypto=require(_0x778b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x778b('0xd'));var toCsv=require(_0x778b('0x8'));var querystring=require(_0x778b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x778b('0xf'));var qs=require(_0x778b('0x10'));var as=require(_0x778b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x778b('0x12'))('api');var utils=require(_0x778b('0x13'));var config=require(_0x778b('0x14'));var licenseUtil=require(_0x778b('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x778b('0x16'));function respondWithStatusCode(_0xa14081,_0x446797){_0x446797=_0x446797||0xcc;return function(_0x8ee42f){if(_0x8ee42f){return _0xa14081['sendStatus'](_0x446797);}return _0xa14081[_0x778b('0x17')](_0x446797)['end']();};}function respondWithResult(_0x2eab86,_0xff3ea0){_0xff3ea0=_0xff3ea0||0xc8;return function(_0x5345f5){if(_0x5345f5){return _0x2eab86[_0x778b('0x17')](_0xff3ea0)[_0x778b('0x18')](_0x5345f5);}};}function respondWithFilteredResult(_0x1bddc7,_0x239d33){return function(_0x132342){if(_0x132342){var _0x28a610=typeof _0x239d33[_0x778b('0x19')]===_0x778b('0x1a')&&typeof _0x239d33['limit']===_0x778b('0x1a');var _0x52c0d4=_0x132342['count'];var _0x162fbf=_0x28a610?0x0:_0x239d33[_0x778b('0x19')];var _0x1fa80b=_0x28a610?_0x132342[_0x778b('0x1b')]:_0x239d33['offset']+_0x239d33[_0x778b('0x1c')];var _0x51620e;if(_0x1fa80b>=_0x52c0d4){_0x1fa80b=_0x52c0d4;_0x51620e=0xc8;}else{_0x51620e=0xce;}_0x1bddc7[_0x778b('0x17')](_0x51620e);return _0x1bddc7[_0x778b('0x1d')](_0x778b('0x1e'),_0x162fbf+'-'+_0x1fa80b+'/'+_0x52c0d4)[_0x778b('0x18')](_0x132342);}return null;};}function patchUpdates(_0x3940d4){return function(_0xea9c6c){try{jsonpatch['apply'](_0xea9c6c,_0x3940d4,!![]);}catch(_0x2620e7){return BPromise['reject'](_0x2620e7);}return _0xea9c6c[_0x778b('0x1f')]();};}function saveUpdates(_0x43b6f8,_0xd2d4d6){return function(_0x43c2a1){if(_0x43c2a1){return _0x43c2a1['update'](_0x43b6f8)[_0x778b('0x20')](function(_0x54db76){return _0x54db76;});}return null;};}function removeEntity(_0x398cdc,_0xd39560){return function(_0xae697){if(_0xae697){return _0xae697[_0x778b('0x21')]()['then'](function(){_0x398cdc[_0x778b('0x17')](0xcc)[_0x778b('0x22')]();});}};}function handleEntityNotFound(_0x99ba55,_0x389feb){return function(_0x4ea005){if(!_0x4ea005){_0x99ba55['sendStatus'](0x194);}return _0x4ea005;};}function handleError(_0x29d764,_0x3590da){_0x3590da=_0x3590da||0x1f4;return function(_0x1b5685){logger[_0x778b('0x23')](_0x1b5685[_0x778b('0x24')]);if(_0x1b5685[_0x778b('0x25')]){delete _0x1b5685[_0x778b('0x25')];}_0x29d764[_0x778b('0x17')](_0x3590da)[_0x778b('0x26')](_0x1b5685);};}exports[_0x778b('0x27')]=function(_0x391f85,_0x17c8bb){var _0x4c75dc={},_0x4c4c58={},_0x1bfd45={'count':0x0,'rows':[]};var _0x2eb5d6=_['map'](db[_0x778b('0x28')][_0x778b('0x29')],function(_0x3a596b){return{'name':_0x3a596b[_0x778b('0x2a')],'type':_0x3a596b['type']['key']};});_0x4c4c58[_0x778b('0x2b')]=_[_0x778b('0x2c')](_0x2eb5d6,_0x778b('0x25'));_0x4c4c58[_0x778b('0x2d')]=_[_0x778b('0x2e')](_0x391f85[_0x778b('0x2d')]);_0x4c4c58[_0x778b('0x2f')]=_[_0x778b('0x30')](_0x4c4c58['model'],_0x4c4c58[_0x778b('0x2d')]);_0x4c75dc[_0x778b('0x31')]=_['intersection'](_0x4c4c58[_0x778b('0x2b')],qs[_0x778b('0x32')](_0x391f85[_0x778b('0x2d')][_0x778b('0x32')]));_0x4c75dc[_0x778b('0x31')]=_0x4c75dc[_0x778b('0x31')]['length']?_0x4c75dc[_0x778b('0x31')]:_0x4c4c58['model'];if(!_0x391f85[_0x778b('0x2d')][_0x778b('0x33')](_0x778b('0x34'))){_0x4c75dc[_0x778b('0x1c')]=qs[_0x778b('0x1c')](_0x391f85[_0x778b('0x2d')][_0x778b('0x1c')]);_0x4c75dc[_0x778b('0x19')]=qs[_0x778b('0x19')](_0x391f85[_0x778b('0x2d')]['offset']);}_0x4c75dc['order']=qs['sort'](_0x391f85['query']['sort']);_0x4c75dc[_0x778b('0x35')]=qs[_0x778b('0x2f')](_[_0x778b('0x36')](_0x391f85[_0x778b('0x2d')],_0x4c4c58['filters']),_0x2eb5d6);if(_0x391f85['query'][_0x778b('0x37')]){_0x4c75dc['where']=_[_0x778b('0x38')](_0x4c75dc[_0x778b('0x35')],{'$or':_[_0x778b('0x2c')](_0x2eb5d6,function(_0x40029d){if(_0x40029d['type']!==_0x778b('0x39')){var _0x489b4e={};_0x489b4e[_0x40029d[_0x778b('0x25')]]={'$like':'%'+_0x391f85[_0x778b('0x2d')][_0x778b('0x37')]+'%'};return _0x489b4e;}})});}_0x4c75dc=_['merge']({},_0x4c75dc,_0x391f85[_0x778b('0x3a')]);var _0x332ba2={'where':_0x4c75dc['where']};return db[_0x778b('0x28')][_0x778b('0x1b')](_0x332ba2)[_0x778b('0x20')](function(_0x3e2ea4){_0x1bfd45[_0x778b('0x1b')]=_0x3e2ea4;if(_0x391f85[_0x778b('0x2d')][_0x778b('0x3b')]){_0x4c75dc[_0x778b('0x3c')]=[{'all':!![]}];}return db['DeskAccount'][_0x778b('0x3d')](_0x4c75dc);})[_0x778b('0x20')](function(_0x4057a3){_0x1bfd45[_0x778b('0x3e')]=_0x4057a3;return _0x1bfd45;})[_0x778b('0x20')](respondWithFilteredResult(_0x17c8bb,_0x4c75dc))[_0x778b('0x3f')](handleError(_0x17c8bb,null));};exports[_0x778b('0x40')]=function(_0x2fa39d,_0x326ce8){var _0x11f9eb={'raw':![],'where':{'id':_0x2fa39d[_0x778b('0x41')]['id']}},_0x49232f={};_0x49232f[_0x778b('0x2b')]=_['keys'](db[_0x778b('0x28')][_0x778b('0x29')]);_0x49232f[_0x778b('0x2d')]=_[_0x778b('0x2e')](_0x2fa39d[_0x778b('0x2d')]);_0x49232f['filters']=_['intersection'](_0x49232f[_0x778b('0x2b')],_0x49232f[_0x778b('0x2d')]);_0x11f9eb[_0x778b('0x31')]=_['intersection'](_0x49232f[_0x778b('0x2b')],qs['fields'](_0x2fa39d[_0x778b('0x2d')][_0x778b('0x32')]));_0x11f9eb['attributes']=_0x11f9eb[_0x778b('0x31')]['length']?_0x11f9eb[_0x778b('0x31')]:_0x49232f[_0x778b('0x2b')];if(_0x2fa39d[_0x778b('0x2d')][_0x778b('0x3b')]){_0x11f9eb[_0x778b('0x3c')]=[{'all':!![]}];}_0x11f9eb=_[_0x778b('0x38')]({},_0x11f9eb,_0x2fa39d[_0x778b('0x3a')]);return db['DeskAccount']['find'](_0x11f9eb)[_0x778b('0x20')](handleEntityNotFound(_0x326ce8,null))['then'](respondWithResult(_0x326ce8,null))[_0x778b('0x3f')](handleError(_0x326ce8,null));};exports[_0x778b('0x42')]=function(_0x598014,_0x44ae06){return db[_0x778b('0x28')][_0x778b('0x42')](_0x598014[_0x778b('0x43')],{})[_0x778b('0x20')](respondWithResult(_0x44ae06,0xc9))[_0x778b('0x3f')](handleError(_0x44ae06,null));};exports[_0x778b('0x44')]=function(_0x27a97b,_0x32a8d5){if(_0x27a97b[_0x778b('0x43')]['id']){delete _0x27a97b[_0x778b('0x43')]['id'];}return db['DeskAccount'][_0x778b('0x45')]({'where':{'id':_0x27a97b[_0x778b('0x41')]['id']}})[_0x778b('0x20')](handleEntityNotFound(_0x32a8d5,null))[_0x778b('0x20')](saveUpdates(_0x27a97b['body'],null))['then'](respondWithResult(_0x32a8d5,null))[_0x778b('0x3f')](handleError(_0x32a8d5,null));};exports[_0x778b('0x21')]=function(_0x28e017,_0x55631a){return db[_0x778b('0x28')][_0x778b('0x45')]({'where':{'id':_0x28e017['params']['id']}})[_0x778b('0x20')](handleEntityNotFound(_0x55631a,null))[_0x778b('0x20')](removeEntity(_0x55631a,null))['catch'](handleError(_0x55631a,null));};exports[_0x778b('0x46')]=function(_0x3e1d02,_0x60790f,_0x543618){var _0x5cc731={};var _0x1a4938={};var _0x3f108d;var _0x205083;return db[_0x778b('0x28')][_0x778b('0x47')]({'where':{'id':_0x3e1d02[_0x778b('0x41')]['id']}})[_0x778b('0x20')](handleEntityNotFound(_0x60790f,null))[_0x778b('0x20')](function(_0x16747c){if(_0x16747c){_0x3f108d=_0x16747c;_0x1a4938[_0x778b('0x2b')]=_[_0x778b('0x2e')](db[_0x778b('0x48')][_0x778b('0x29')]);_0x1a4938[_0x778b('0x2d')]=_[_0x778b('0x2e')](_0x3e1d02[_0x778b('0x2d')]);_0x1a4938[_0x778b('0x2f')]=_[_0x778b('0x30')](_0x1a4938['model'],_0x1a4938[_0x778b('0x2d')]);_0x5cc731['attributes']=_['intersection'](_0x1a4938[_0x778b('0x2b')],qs[_0x778b('0x32')](_0x3e1d02[_0x778b('0x2d')][_0x778b('0x32')]));_0x5cc731[_0x778b('0x31')]=_0x5cc731[_0x778b('0x31')][_0x778b('0x49')]?_0x5cc731[_0x778b('0x31')]:_0x1a4938[_0x778b('0x2b')];_0x5cc731[_0x778b('0x4a')]=qs['sort'](_0x3e1d02[_0x778b('0x2d')][_0x778b('0x4b')]);_0x5cc731[_0x778b('0x35')]=qs[_0x778b('0x2f')](_['pick'](_0x3e1d02[_0x778b('0x2d')],_0x1a4938[_0x778b('0x2f')]));if(_0x3e1d02[_0x778b('0x2d')][_0x778b('0x37')]){_0x5cc731[_0x778b('0x35')]=_[_0x778b('0x38')](_0x5cc731['where'],{'$or':_[_0x778b('0x2c')](_0x5cc731[_0x778b('0x31')],function(_0x143fd8){var _0x59dc21={};_0x59dc21[_0x143fd8]={'$like':'%'+_0x3e1d02[_0x778b('0x2d')][_0x778b('0x37')]+'%'};return _0x59dc21;})});}_0x5cc731=_[_0x778b('0x38')]({},_0x5cc731,_0x3e1d02[_0x778b('0x3a')]);return _0x3f108d['getConfigurations'](_0x5cc731);}})[_0x778b('0x20')](function(_0x51da36){if(_0x51da36){_0x205083=_0x51da36[_0x778b('0x49')];if(!_0x3e1d02[_0x778b('0x2d')][_0x778b('0x33')]('nolimit')){_0x5cc731['limit']=qs[_0x778b('0x1c')](_0x3e1d02[_0x778b('0x2d')]['limit']);_0x5cc731[_0x778b('0x19')]=qs[_0x778b('0x19')](_0x3e1d02[_0x778b('0x2d')][_0x778b('0x19')]);}return _0x3f108d[_0x778b('0x46')](_0x5cc731);}})[_0x778b('0x20')](function(_0x303aaf){if(_0x303aaf){return _0x303aaf?{'count':_0x205083,'rows':_0x303aaf}:null;}})[_0x778b('0x20')](respondWithResult(_0x60790f,null))[_0x778b('0x3f')](handleError(_0x60790f,null));};exports[_0x778b('0x4c')]=function(_0x370a9e,_0x49de8c,_0xf211d){if(_0x370a9e[_0x778b('0x43')]['id']){delete _0x370a9e[_0x778b('0x43')]['id'];}return db[_0x778b('0x28')]['findOne']({'where':{'id':_0x370a9e['params']['id']}})[_0x778b('0x20')](handleEntityNotFound(_0x49de8c,null))[_0x778b('0x20')](function(_0x529ca3){if(_0x529ca3){_0x370a9e[_0x778b('0x43')]['AccountId']=_0x529ca3['id'];_0x370a9e[_0x778b('0x43')][_0x778b('0x4d')]=integrations[_0x778b('0x4e')](_0x370a9e[_0x778b('0x43')][_0x778b('0x4f')],_0x370a9e['body'][_0x778b('0x50')]);_0x370a9e[_0x778b('0x43')]['Descriptions']=integrations[_0x778b('0x51')](_0x370a9e[_0x778b('0x43')][_0x778b('0x4f')],_0x370a9e[_0x778b('0x43')]['type']);return db['DeskConfiguration'][_0x778b('0x42')](_0x370a9e[_0x778b('0x43')],{'include':[{'model':db[_0x778b('0x52')],'as':_0x778b('0x4d')},{'model':db[_0x778b('0x52')],'as':_0x778b('0x53')}]});}return null;})[_0x778b('0x20')](respondWithResult(_0x49de8c,null))[_0x778b('0x3f')](handleError(_0x49de8c,null));};exports['getFields']=function(_0x3b0df7,_0x48a91b,_0x48b37e){var _0x5e71bd=[{'name':_0x778b('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x411758='';return db[_0x778b('0x28')]['findOne']({'where':{'id':_0x3b0df7[_0x778b('0x41')]['id']},'attributes':['id',_0x778b('0x55'),_0x778b('0x56'),'username',_0x778b('0x57'),'consumerKey','consumerSecret','token','tokenSecret']})[_0x778b('0x20')](handleEntityNotFound(_0x48a91b,null))[_0x778b('0x20')](function(_0x4c2a15){if(_0x4c2a15){_0x411758=_0x4c2a15[_0x778b('0x55')];var _0x1ec593=_0x411758[_0x778b('0x58')](-0x1);if(_0x1ec593==='/'){_0x411758=_0x411758[_0x778b('0x59')](0x0,_0x411758['lastIndexOf'](_0x1ec593));}var _0x332b28={'method':_0x778b('0x5a'),'uri':util['format'](_0x778b('0x5b'),_0x411758),'headers':{'Content-Type':_0x778b('0x5c'),'Accept':_0x778b('0x5c')},'json':!![]};if(_0x4c2a15[_0x778b('0x56')]===_0x778b('0x5d')){_0x332b28[_0x778b('0x5e')][_0x778b('0x5f')]=util['format'](_0x778b('0x60'),new Buffer(util[_0x778b('0x61')](_0x778b('0x62'),_0x4c2a15[_0x778b('0x63')],_0x4c2a15[_0x778b('0x57')]))[_0x778b('0x64')](_0x778b('0x65')));}return rp(_0x332b28)[_0x778b('0x20')](function(_0x3ed110){return _0x5e71bd[_0x778b('0x66')](_['map'](_0x3ed110[_0x778b('0x67')]['entries'],function(_0x342895){return{'id':_0x342895['name'],'name':_0x342895['name'],'type':_0x342895['type'],'active':_0x342895[_0x778b('0x68')],'label':_0x342895[_0x778b('0x69')],'custom':!![]};}));});}})[_0x778b('0x20')](function(_0x36a467){return{'count':_0x36a467[_0x778b('0x49')],'rows':_0x36a467};})['then'](respondWithResult(_0x48a91b,null))[_0x778b('0x3f')](function(_0x27e94e){var _0x249032=_0x3b0df7[_0x778b('0x2d')]['test']?0x1f4:_0x27e94e['statusCode']||0x1f4;logger[_0x778b('0x23')](_0x778b('0x6a'),_0x778b('0x6b'),_0x249032,JSON[_0x778b('0x6c')](_0x27e94e));delete _0x27e94e['name'];if(_0x249032===0x191){_0x249032=0x190;}_0x48a91b['status'](_0x249032)[_0x778b('0x26')](_0x3b0df7['query'][_0x778b('0x6d')]?{'message':_0x778b('0x6e'),'statusCode':_0x27e94e[_0x778b('0x6f')]}:_0x27e94e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 5062726..3a25709 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 _0x21d2=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','api','request-promise'];(function(_0x5a357f,_0x3b5448){var _0x2e623f=function(_0xcef30b){while(--_0xcef30b){_0x5a357f['push'](_0x5a357f['shift']());}};_0x2e623f(++_0x3b5448);}(_0x21d2,0x178));var _0x221d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x21d2[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x221d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x221d('0x1'));var fs=require('fs');var path=require(_0x221d('0x2'));var rimraf=require(_0x221d('0x3'));var config=require(_0x221d('0x4'));var attributes=require(_0x221d('0x5'));var integrations=require(_0x221d('0x6'));module[_0x221d('0x7')]=function(_0x4a8dc0,_0x598e92){return _0x4a8dc0[_0x221d('0x8')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4f9=['util','api','moment','bluebird','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x19b406,_0x424edb){var _0x8c813b=function(_0x44bb95){while(--_0x44bb95){_0x19b406['push'](_0x19b406['shift']());}};_0x8c813b(++_0x424edb);}(_0xf4f9,0x154));var _0x9f4f=function(_0x508a0a,_0x3ed316){_0x508a0a=_0x508a0a-0x0;var _0x4acf06=_0xf4f9[_0x508a0a];return _0x4acf06;};'use strict';var _=require(_0x9f4f('0x0'));var util=require(_0x9f4f('0x1'));var logger=require('../../config/logger')(_0x9f4f('0x2'));var moment=require(_0x9f4f('0x3'));var BPromise=require(_0x9f4f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f4f('0x5'));var config=require('../../config/environment');var attributes=require(_0x9f4f('0x6'));var integrations=require(_0x9f4f('0x7'));module['exports']=function(_0x27b280,_0x48e0df){return _0x27b280[_0x9f4f('0x8')](_0x9f4f('0x9'),attributes,{'tableName':_0x9f4f('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 0c56363..ed06082 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 _0x7d22=['../../config/logger','rpc','../../config/environment','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','lodash','util','bluebird','ioredis'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x7d22,0xb6));var _0x27d2=function(_0x509caa,_0xf6214f){_0x509caa=_0x509caa-0x0;var _0x231cb1=_0x7d22[_0x509caa];return _0x231cb1;};'use strict';var _=require(_0x27d2('0x0'));var util=require(_0x27d2('0x1'));var moment=require('moment');var BPromise=require(_0x27d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27d2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x27d2('0x4'))(_0x27d2('0x5'));var config=require(_0x27d2('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x69cf71,_0x1a220a,_0xcec9de){return new BPromise(function(_0x22d319,_0x3ab34e){return client[_0x27d2('0x7')](_0x69cf71,_0xcec9de)[_0x27d2('0x8')](function(_0x48fb8c){logger[_0x27d2('0x9')](_0x27d2('0xa'),_0x1a220a,_0x27d2('0xb'));logger[_0x27d2('0xc')](_0x27d2('0xd'),_0x1a220a,_0x27d2('0xb'),JSON[_0x27d2('0xe')](_0x48fb8c));if(_0x48fb8c[_0x27d2('0xf')]){if(_0x48fb8c['error'][_0x27d2('0x10')]===0x1f4){logger[_0x27d2('0xf')]('DeskAccount,\x20%s,\x20%s',_0x1a220a,_0x48fb8c['error'][_0x27d2('0x11')]);return _0x3ab34e(_0x48fb8c['error']['message']);}logger[_0x27d2('0xf')](_0x27d2('0xa'),_0x1a220a,_0x48fb8c[_0x27d2('0xf')]['message']);return _0x22d319(_0x48fb8c[_0x27d2('0xf')]['message']);}else{logger[_0x27d2('0x9')](_0x27d2('0xa'),_0x1a220a,'request\x20sent');_0x22d319(_0x48fb8c['result'][_0x27d2('0x11')]);}})[_0x27d2('0x12')](function(_0x4d9ce4){logger['error'](_0x27d2('0xa'),_0x1a220a,_0x4d9ce4);_0x3ab34e(_0x4d9ce4);});});}exports[_0x27d2('0x13')]=function(_0x908f1){var _0xdaafce=this;return new Promise(function(_0x55e687,_0x4dc072){return db[_0x27d2('0x14')][_0x27d2('0x15')]({'raw':_0x908f1[_0x27d2('0x16')]?_0x908f1[_0x27d2('0x16')][_0x27d2('0x17')]===undefined?!![]:![]:!![],'where':_0x908f1['options']?_0x908f1['options'][_0x27d2('0x18')]||null:null,'attributes':_0x908f1[_0x27d2('0x16')]?_0x908f1['options'][_0x27d2('0x19')]||null:null,'limit':_0x908f1['options']?_0x908f1[_0x27d2('0x16')][_0x27d2('0x1a')]||null:null,'include':_0x908f1[_0x27d2('0x16')]?_0x908f1[_0x27d2('0x16')][_0x27d2('0x1b')]?_[_0x27d2('0x1c')](_0x908f1[_0x27d2('0x16')][_0x27d2('0x1b')],function(_0xf8b6b0){return{'model':db[_0xf8b6b0[_0x27d2('0x1d')]],'as':_0xf8b6b0['as'],'attributes':_0xf8b6b0[_0x27d2('0x19')],'include':_0xf8b6b0[_0x27d2('0x1b')]?_['map'](_0xf8b6b0[_0x27d2('0x1b')],function(_0x1a9bf6){return{'model':db[_0x1a9bf6['model']],'as':_0x1a9bf6['as'],'attributes':_0x1a9bf6[_0x27d2('0x19')],'include':_0x1a9bf6['include']?_['map'](_0x1a9bf6['include'],function(_0x2627cc){return{'model':db[_0x2627cc[_0x27d2('0x1d')]],'as':_0x2627cc['as'],'attributes':_0x2627cc[_0x27d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x27d2('0x8')](function(_0x1fff9e){logger[_0x27d2('0x9')]('GetDeskAccount',_0x908f1);logger[_0x27d2('0xc')](_0x27d2('0x13'),_0x908f1,JSON[_0x27d2('0xe')](_0x1fff9e));_0x55e687(_0x1fff9e);})['catch'](function(_0x24e2ba){logger[_0x27d2('0xf')]('GetDeskAccount',_0x24e2ba[_0x27d2('0x11')],_0x908f1);_0x4dc072(_0xdaafce['error'](0x1f4,_0x24e2ba['message']));});});};exports[_0x27d2('0x1e')]=function(_0x5aaabc){var _0x42ca96=this;return new Promise(function(_0x37ec82,_0x3b56e7){return db['DeskAccount']['find']({'raw':_0x5aaabc['options']?_0x5aaabc[_0x27d2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5aaabc[_0x27d2('0x16')]?_0x5aaabc[_0x27d2('0x16')][_0x27d2('0x18')]||null:null,'attributes':_0x5aaabc['options']?_0x5aaabc['options'][_0x27d2('0x19')]||null:null,'include':_0x5aaabc['options']?_0x5aaabc[_0x27d2('0x16')][_0x27d2('0x1b')]?_[_0x27d2('0x1c')](_0x5aaabc[_0x27d2('0x16')][_0x27d2('0x1b')],function(_0x21fbc6){return{'model':db[_0x21fbc6['model']],'as':_0x21fbc6['as'],'attributes':_0x21fbc6[_0x27d2('0x19')],'include':_0x21fbc6[_0x27d2('0x1b')]?_[_0x27d2('0x1c')](_0x21fbc6[_0x27d2('0x1b')],function(_0x5b01f3){return{'model':db[_0x5b01f3[_0x27d2('0x1d')]],'as':_0x5b01f3['as'],'attributes':_0x5b01f3[_0x27d2('0x19')],'include':_0x5b01f3[_0x27d2('0x1b')]?_['map'](_0x5b01f3['include'],function(_0x57a90b){return{'model':db[_0x57a90b[_0x27d2('0x1d')]],'as':_0x57a90b['as'],'attributes':_0x57a90b[_0x27d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x27d2('0x8')](function(_0x437012){logger['info'](_0x27d2('0x1e'),_0x5aaabc);logger[_0x27d2('0xc')](_0x27d2('0x1e'),_0x5aaabc,JSON[_0x27d2('0xe')](_0x437012));_0x37ec82(_0x437012);})[_0x27d2('0x12')](function(_0x45e405){logger['error'](_0x27d2('0x1e'),_0x45e405[_0x27d2('0x11')],_0x5aaabc);_0x3b56e7(_0x42ca96[_0x27d2('0xf')](0x1f4,_0x45e405[_0x27d2('0x11')]));});});}; \ No newline at end of file +var _0xb404=['client','request','request\x20sent','debug','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','options','raw','attributes','limit','include','map','model','then','ShowDeskAccount','DeskAccount','find','where','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x542e14,_0x5dfd4b){var _0xe3bbb=function(_0x5c2ac7){while(--_0x5c2ac7){_0x542e14['push'](_0x542e14['shift']());}};_0xe3bbb(++_0x5dfd4b);}(_0xb404,0x1d9));var _0x4b40=function(_0x2e3a6a,_0x2c6658){_0x2e3a6a=_0x2e3a6a-0x0;var _0x17d03f=_0xb404[_0x2e3a6a];return _0x17d03f;};'use strict';var _=require('lodash');var util=require(_0x4b40('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4b40('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b40('0x2'))['db'];var utils=require(_0x4b40('0x3'));var logger=require(_0x4b40('0x4'))('rpc');var config=require(_0x4b40('0x5'));var jayson=require(_0x4b40('0x6'));var client=jayson[_0x4b40('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54bf62,_0x434df6,_0x5e8f8b){return new BPromise(function(_0x153d49,_0x10e4e3){return client[_0x4b40('0x8')](_0x54bf62,_0x5e8f8b)['then'](function(_0x30571d){logger['info']('DeskAccount,\x20%s,\x20%s',_0x434df6,_0x4b40('0x9'));logger[_0x4b40('0xa')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x434df6,_0x4b40('0x9'),JSON['stringify'](_0x30571d));if(_0x30571d[_0x4b40('0xb')]){if(_0x30571d[_0x4b40('0xb')][_0x4b40('0xc')]===0x1f4){logger[_0x4b40('0xb')](_0x4b40('0xd'),_0x434df6,_0x30571d[_0x4b40('0xb')][_0x4b40('0xe')]);return _0x10e4e3(_0x30571d[_0x4b40('0xb')][_0x4b40('0xe')]);}logger[_0x4b40('0xb')](_0x4b40('0xd'),_0x434df6,_0x30571d['error'][_0x4b40('0xe')]);return _0x153d49(_0x30571d['error']['message']);}else{logger[_0x4b40('0xf')](_0x4b40('0xd'),_0x434df6,_0x4b40('0x9'));_0x153d49(_0x30571d[_0x4b40('0x10')][_0x4b40('0xe')]);}})[_0x4b40('0x11')](function(_0x10a15b){logger[_0x4b40('0xb')](_0x4b40('0xd'),_0x434df6,_0x10a15b);_0x10e4e3(_0x10a15b);});});}exports[_0x4b40('0x12')]=function(_0x4aa6dc){var _0x4fb546=this;return new Promise(function(_0x2c35e5,_0x51b1a1){return db['DeskAccount']['findAll']({'raw':_0x4aa6dc[_0x4b40('0x13')]?_0x4aa6dc[_0x4b40('0x13')][_0x4b40('0x14')]===undefined?!![]:![]:!![],'where':_0x4aa6dc['options']?_0x4aa6dc['options']['where']||null:null,'attributes':_0x4aa6dc['options']?_0x4aa6dc['options'][_0x4b40('0x15')]||null:null,'limit':_0x4aa6dc[_0x4b40('0x13')]?_0x4aa6dc['options'][_0x4b40('0x16')]||null:null,'include':_0x4aa6dc[_0x4b40('0x13')]?_0x4aa6dc[_0x4b40('0x13')][_0x4b40('0x17')]?_[_0x4b40('0x18')](_0x4aa6dc[_0x4b40('0x13')][_0x4b40('0x17')],function(_0x1a20f6){return{'model':db[_0x1a20f6['model']],'as':_0x1a20f6['as'],'attributes':_0x1a20f6['attributes'],'include':_0x1a20f6[_0x4b40('0x17')]?_['map'](_0x1a20f6[_0x4b40('0x17')],function(_0x3dfb48){return{'model':db[_0x3dfb48['model']],'as':_0x3dfb48['as'],'attributes':_0x3dfb48['attributes'],'include':_0x3dfb48[_0x4b40('0x17')]?_[_0x4b40('0x18')](_0x3dfb48[_0x4b40('0x17')],function(_0x500567){return{'model':db[_0x500567[_0x4b40('0x19')]],'as':_0x500567['as'],'attributes':_0x500567['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b40('0x1a')](function(_0x217123){logger[_0x4b40('0xf')](_0x4b40('0x12'),_0x4aa6dc);logger[_0x4b40('0xa')](_0x4b40('0x12'),_0x4aa6dc,JSON['stringify'](_0x217123));_0x2c35e5(_0x217123);})[_0x4b40('0x11')](function(_0x678dc5){logger['error'](_0x4b40('0x12'),_0x678dc5[_0x4b40('0xe')],_0x4aa6dc);_0x51b1a1(_0x4fb546[_0x4b40('0xb')](0x1f4,_0x678dc5[_0x4b40('0xe')]));});});};exports[_0x4b40('0x1b')]=function(_0x440521){var _0x355b53=this;return new Promise(function(_0x12f1d1,_0x198857){return db[_0x4b40('0x1c')][_0x4b40('0x1d')]({'raw':_0x440521['options']?_0x440521['options'][_0x4b40('0x14')]===undefined?!![]:![]:!![],'where':_0x440521[_0x4b40('0x13')]?_0x440521[_0x4b40('0x13')][_0x4b40('0x1e')]||null:null,'attributes':_0x440521[_0x4b40('0x13')]?_0x440521[_0x4b40('0x13')][_0x4b40('0x15')]||null:null,'include':_0x440521[_0x4b40('0x13')]?_0x440521['options']['include']?_['map'](_0x440521[_0x4b40('0x13')][_0x4b40('0x17')],function(_0x23371a){return{'model':db[_0x23371a[_0x4b40('0x19')]],'as':_0x23371a['as'],'attributes':_0x23371a[_0x4b40('0x15')],'include':_0x23371a[_0x4b40('0x17')]?_[_0x4b40('0x18')](_0x23371a[_0x4b40('0x17')],function(_0x145959){return{'model':db[_0x145959['model']],'as':_0x145959['as'],'attributes':_0x145959[_0x4b40('0x15')],'include':_0x145959[_0x4b40('0x17')]?_['map'](_0x145959[_0x4b40('0x17')],function(_0x47533d){return{'model':db[_0x47533d[_0x4b40('0x19')]],'as':_0x47533d['as'],'attributes':_0x47533d[_0x4b40('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x307af6){logger['info'](_0x4b40('0x1b'),_0x440521);logger[_0x4b40('0xa')](_0x4b40('0x1b'),_0x440521,JSON[_0x4b40('0x1f')](_0x307af6));_0x12f1d1(_0x307af6);})['catch'](function(_0x251616){logger[_0x4b40('0xb')](_0x4b40('0x1b'),_0x251616[_0x4b40('0xe')],_0x440521);_0x198857(_0x355b53['error'](0x1f4,_0x251616['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d35e9c4..79886f7 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(_0x935388,_0x472019){var _0x5b1752=function(_0x362727){while(--_0x362727){_0x935388['push'](_0x935388['shift']());}};_0x5b1752(++_0x472019);}(_0x008c,0x188));var _0xc008=function(_0x1eeb45,_0x526bf0){_0x1eeb45=_0x1eeb45-0x0;var _0x541ed5=_0x008c[_0x1eeb45];return _0x541ed5;};'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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x4b42fe,_0x2ac5e7){var _0x40e878=function(_0x23d73e){while(--_0x23d73e){_0x4b42fe['push'](_0x4b42fe['shift']());}};_0x40e878(++_0x2ac5e7);}(_0xedd9,0xfc));var _0x9edd=function(_0x17ffa4,_0xfc95e7){_0x17ffa4=_0x17ffa4-0x0;var _0x35d9b8=_0xedd9[_0x17ffa4];return _0x35d9b8;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 46de9cc..f4e746f 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 _0xa2da=['STRING','sequelize'];(function(_0x4d5672,_0x4517e7){var _0x4a7aec=function(_0x29cd05){while(--_0x29cd05){_0x4d5672['push'](_0x4d5672['shift']());}};_0x4a7aec(++_0x4517e7);}(_0xa2da,0x75));var _0xaa2d=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0xa2da[_0x4812e0];return _0x252e0f;};'use strict';var Sequelize=require(_0xaa2d('0x0'));module['exports']={'name':{'type':Sequelize[_0xaa2d('0x1')]},'description':{'type':Sequelize[_0xaa2d('0x1')]}}; \ No newline at end of file +var _0x62c9=['sequelize','exports'];(function(_0x33c3fc,_0x129441){var _0x16ca56=function(_0xb7c912){while(--_0xb7c912){_0x33c3fc['push'](_0x33c3fc['shift']());}};_0x16ca56(++_0x129441);}(_0x62c9,0x6c));var _0x962c=function(_0x31bd12,_0x24ba7c){_0x31bd12=_0x31bd12-0x0;var _0x2ce74c=_0x62c9[_0x31bd12];return _0x2ce74c;};'use strict';var Sequelize=require(_0x962c('0x0'));module[_0x962c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1177265..32ef526 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 _0xacee=['catch','create','body','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','show','params','find'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacee,0xb1));var _0xeace=function(_0x5ced40,_0x5b5799){_0x5ced40=_0x5ced40-0x0;var _0x315605=_0xacee[_0x5ced40];return _0x315605;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeace('0x0'));var zipdir=require(_0xeace('0x1'));var jsonpatch=require(_0xeace('0x2'));var rp=require(_0xeace('0x3'));var moment=require('moment');var BPromise=require(_0xeace('0x4'));var Mustache=require(_0xeace('0x5'));var util=require(_0xeace('0x6'));var path=require(_0xeace('0x7'));var sox=require(_0xeace('0x8'));var csv=require(_0xeace('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeace('0xa'));var crypto=require(_0xeace('0xb'));var jsforce=require(_0xeace('0xc'));var deskjs=require(_0xeace('0xd'));var toCsv=require(_0xeace('0x9'));var querystring=require(_0xeace('0xe'));var Papa=require(_0xeace('0xf'));var Redis=require(_0xeace('0x10'));var authService=require(_0xeace('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeace('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeace('0x13'))(_0xeace('0x14'));var utils=require(_0xeace('0x15'));var config=require(_0xeace('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b0a3c,_0x555b04){_0x555b04=_0x555b04||0xcc;return function(_0x117fbc){if(_0x117fbc){return _0x1b0a3c[_0xeace('0x17')](_0x555b04);}return _0x1b0a3c[_0xeace('0x18')](_0x555b04)[_0xeace('0x19')]();};}function respondWithResult(_0x308e18,_0x3546af){_0x3546af=_0x3546af||0xc8;return function(_0x977a2){if(_0x977a2){return _0x308e18['status'](_0x3546af)[_0xeace('0x1a')](_0x977a2);}};}function respondWithFilteredResult(_0x1c312d,_0x49fa76){return function(_0x24f6ee){if(_0x24f6ee){var _0x13d514=typeof _0x49fa76['offset']===_0xeace('0x1b')&&typeof _0x49fa76['limit']===_0xeace('0x1b');var _0x2428cd=_0x24f6ee[_0xeace('0x1c')];var _0x10dcef=_0x13d514?0x0:_0x49fa76[_0xeace('0x1d')];var _0x316934=_0x13d514?_0x24f6ee[_0xeace('0x1c')]:_0x49fa76[_0xeace('0x1d')]+_0x49fa76['limit'];var _0xad8cf4;if(_0x316934>=_0x2428cd){_0x316934=_0x2428cd;_0xad8cf4=0xc8;}else{_0xad8cf4=0xce;}_0x1c312d['status'](_0xad8cf4);return _0x1c312d[_0xeace('0x1e')](_0xeace('0x1f'),_0x10dcef+'-'+_0x316934+'/'+_0x2428cd)[_0xeace('0x1a')](_0x24f6ee);}return null;};}function patchUpdates(_0x5b04ca){return function(_0x5e4af9){try{jsonpatch['apply'](_0x5e4af9,_0x5b04ca,!![]);}catch(_0x5e33e9){return BPromise[_0xeace('0x20')](_0x5e33e9);}return _0x5e4af9[_0xeace('0x21')]();};}function saveUpdates(_0x18bf0c,_0x33acc7){return function(_0xf71086){if(_0xf71086){return _0xf71086[_0xeace('0x22')](_0x18bf0c)[_0xeace('0x23')](function(_0x50d179){return _0x50d179;});}return null;};}function removeEntity(_0x5c899f,_0x176fd0){return function(_0x2b26ce){if(_0x2b26ce){return _0x2b26ce['destroy']()['then'](function(){_0x5c899f[_0xeace('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da585,_0x4f83d8){return function(_0xf24faa){if(!_0xf24faa){_0x4da585[_0xeace('0x17')](0x194);}return _0xf24faa;};}function handleError(_0x4406a4,_0x5962ac){_0x5962ac=_0x5962ac||0x1f4;return function(_0x5b8a8f){logger['error'](_0x5b8a8f[_0xeace('0x24')]);if(_0x5b8a8f[_0xeace('0x25')]){delete _0x5b8a8f['name'];}_0x4406a4['status'](_0x5962ac)[_0xeace('0x26')](_0x5b8a8f);};}exports[_0xeace('0x27')]=function(_0x2bad26,_0x1c04fa){var _0x34c203={},_0x6c6dfb={},_0x1d1e12={'count':0x0,'rows':[]};var _0xed5a99=_[_0xeace('0x28')](db['DeskConfiguration'][_0xeace('0x29')],function(_0x2b4d7f){return{'name':_0x2b4d7f[_0xeace('0x2a')],'type':_0x2b4d7f[_0xeace('0x2b')][_0xeace('0x2c')]};});_0x6c6dfb['model']=_[_0xeace('0x28')](_0xed5a99,_0xeace('0x25'));_0x6c6dfb[_0xeace('0x2d')]=_[_0xeace('0x2e')](_0x2bad26[_0xeace('0x2d')]);_0x6c6dfb[_0xeace('0x2f')]=_['intersection'](_0x6c6dfb[_0xeace('0x30')],_0x6c6dfb[_0xeace('0x2d')]);_0x34c203['attributes']=_[_0xeace('0x31')](_0x6c6dfb['model'],qs[_0xeace('0x32')](_0x2bad26[_0xeace('0x2d')]['fields']));_0x34c203['attributes']=_0x34c203[_0xeace('0x33')][_0xeace('0x34')]?_0x34c203[_0xeace('0x33')]:_0x6c6dfb['model'];if(!_0x2bad26[_0xeace('0x2d')][_0xeace('0x35')](_0xeace('0x36'))){_0x34c203['limit']=qs[_0xeace('0x37')](_0x2bad26[_0xeace('0x2d')]['limit']);_0x34c203[_0xeace('0x1d')]=qs[_0xeace('0x1d')](_0x2bad26[_0xeace('0x2d')]['offset']);}_0x34c203[_0xeace('0x38')]=qs['sort'](_0x2bad26[_0xeace('0x2d')][_0xeace('0x39')]);_0x34c203[_0xeace('0x3a')]=qs['filters'](_[_0xeace('0x3b')](_0x2bad26[_0xeace('0x2d')],_0x6c6dfb[_0xeace('0x2f')]),_0xed5a99);if(_0x2bad26[_0xeace('0x2d')][_0xeace('0x3c')]){_0x34c203[_0xeace('0x3a')]=_[_0xeace('0x3d')](_0x34c203['where'],{'$or':_['map'](_0xed5a99,function(_0x3537f6){if(_0x3537f6[_0xeace('0x2b')]!==_0xeace('0x3e')){var _0x10da80={};_0x10da80[_0x3537f6[_0xeace('0x25')]]={'$like':'%'+_0x2bad26['query'][_0xeace('0x3c')]+'%'};return _0x10da80;}})});}_0x34c203=_['merge']({},_0x34c203,_0x2bad26[_0xeace('0x3f')]);var _0x3e81c4={'where':_0x34c203['where']};return db[_0xeace('0x40')][_0xeace('0x1c')](_0x3e81c4)['then'](function(_0x13c094){_0x1d1e12[_0xeace('0x1c')]=_0x13c094;if(_0x2bad26['query'][_0xeace('0x41')]){_0x34c203[_0xeace('0x42')]=[{'all':!![]}];}return db[_0xeace('0x40')][_0xeace('0x43')](_0x34c203);})[_0xeace('0x23')](function(_0x252411){_0x1d1e12[_0xeace('0x44')]=_0x252411;return _0x1d1e12;})[_0xeace('0x23')](respondWithFilteredResult(_0x1c04fa,_0x34c203))['catch'](handleError(_0x1c04fa,null));};exports[_0xeace('0x45')]=function(_0x5d9d30,_0x42cf5d){var _0x1fc68d={'raw':![],'where':{'id':_0x5d9d30[_0xeace('0x46')]['id']}},_0x35a52a={};_0x35a52a[_0xeace('0x30')]=_['keys'](db[_0xeace('0x40')][_0xeace('0x29')]);_0x35a52a[_0xeace('0x2d')]=_[_0xeace('0x2e')](_0x5d9d30[_0xeace('0x2d')]);_0x35a52a[_0xeace('0x2f')]=_[_0xeace('0x31')](_0x35a52a['model'],_0x35a52a['query']);_0x1fc68d['attributes']=_[_0xeace('0x31')](_0x35a52a['model'],qs[_0xeace('0x32')](_0x5d9d30[_0xeace('0x2d')][_0xeace('0x32')]));_0x1fc68d[_0xeace('0x33')]=_0x1fc68d[_0xeace('0x33')][_0xeace('0x34')]?_0x1fc68d[_0xeace('0x33')]:_0x35a52a[_0xeace('0x30')];if(_0x5d9d30[_0xeace('0x2d')][_0xeace('0x41')]){_0x1fc68d[_0xeace('0x42')]=[{'all':!![]}];}_0x1fc68d=_[_0xeace('0x3d')]({},_0x1fc68d,_0x5d9d30[_0xeace('0x3f')]);return db[_0xeace('0x40')][_0xeace('0x47')](_0x1fc68d)[_0xeace('0x23')](handleEntityNotFound(_0x42cf5d,null))[_0xeace('0x23')](respondWithResult(_0x42cf5d,null))[_0xeace('0x48')](handleError(_0x42cf5d,null));};exports[_0xeace('0x49')]=function(_0x5e629a,_0x3813d3){return db[_0xeace('0x40')][_0xeace('0x49')](_0x5e629a[_0xeace('0x4a')],{})[_0xeace('0x23')](respondWithResult(_0x3813d3,0xc9))['catch'](handleError(_0x3813d3,null));};exports[_0xeace('0x22')]=function(_0x340e12,_0x5d7825){if(_0x340e12['body']['id']){delete _0x340e12[_0xeace('0x4a')]['id'];}return db[_0xeace('0x40')][_0xeace('0x47')]({'where':{'id':_0x340e12['params']['id']}})[_0xeace('0x23')](handleEntityNotFound(_0x5d7825,null))[_0xeace('0x23')](saveUpdates(_0x340e12[_0xeace('0x4a')],null))['then'](respondWithResult(_0x5d7825,null))[_0xeace('0x48')](handleError(_0x5d7825,null));};exports[_0xeace('0x4b')]=function(_0x562330,_0x2b4fe2){return db['DeskConfiguration'][_0xeace('0x47')]({'where':{'id':_0x562330[_0xeace('0x46')]['id']}})[_0xeace('0x23')](handleEntityNotFound(_0x2b4fe2,null))[_0xeace('0x23')](removeEntity(_0x2b4fe2,null))['catch'](handleError(_0x2b4fe2,null));};exports[_0xeace('0x4c')]=function(_0x1438d0,_0x54d13b,_0x2c7f42){var _0x1475e5={};var _0x1131d9={};var _0x2f104a;var _0xb7f837;return db[_0xeace('0x40')][_0xeace('0x4d')]({'where':{'id':_0x1438d0['params']['id']}})[_0xeace('0x23')](handleEntityNotFound(_0x54d13b,null))[_0xeace('0x23')](function(_0x298e3b){if(_0x298e3b){_0x2f104a=_0x298e3b;_0x1131d9[_0xeace('0x30')]=_['keys'](db[_0xeace('0x4e')][_0xeace('0x29')]);_0x1131d9['query']=_[_0xeace('0x2e')](_0x1438d0['query']);_0x1131d9[_0xeace('0x2f')]=_[_0xeace('0x31')](_0x1131d9[_0xeace('0x30')],_0x1131d9['query']);_0x1475e5[_0xeace('0x33')]=_['intersection'](_0x1131d9[_0xeace('0x30')],qs[_0xeace('0x32')](_0x1438d0[_0xeace('0x2d')][_0xeace('0x32')]));_0x1475e5['attributes']=_0x1475e5['attributes']['length']?_0x1475e5[_0xeace('0x33')]:_0x1131d9[_0xeace('0x30')];_0x1475e5[_0xeace('0x38')]=qs[_0xeace('0x39')](_0x1438d0[_0xeace('0x2d')][_0xeace('0x39')]);_0x1475e5[_0xeace('0x3a')]=qs[_0xeace('0x2f')](_[_0xeace('0x3b')](_0x1438d0[_0xeace('0x2d')],_0x1131d9[_0xeace('0x2f')]));if(_0x1438d0[_0xeace('0x2d')][_0xeace('0x3c')]){_0x1475e5[_0xeace('0x3a')]=_[_0xeace('0x3d')](_0x1475e5[_0xeace('0x3a')],{'$or':_['map'](_0x1475e5[_0xeace('0x33')],function(_0x3e543a){var _0x2c2da5={};_0x2c2da5[_0x3e543a]={'$like':'%'+_0x1438d0[_0xeace('0x2d')][_0xeace('0x3c')]+'%'};return _0x2c2da5;})});}_0x1475e5=_[_0xeace('0x3d')]({},_0x1475e5,_0x1438d0[_0xeace('0x3f')]);return _0x2f104a['getFields'](_0x1475e5);}})[_0xeace('0x23')](function(_0x130e89){if(_0x130e89){_0xb7f837=_0x130e89[_0xeace('0x34')];if(!_0x1438d0[_0xeace('0x2d')][_0xeace('0x35')](_0xeace('0x36'))){_0x1475e5[_0xeace('0x37')]=qs['limit'](_0x1438d0['query']['limit']);_0x1475e5[_0xeace('0x1d')]=qs[_0xeace('0x1d')](_0x1438d0[_0xeace('0x2d')][_0xeace('0x1d')]);}return _0x2f104a['getFields'](_0x1475e5);}})[_0xeace('0x23')](function(_0x301ce4){if(_0x301ce4){return _0x301ce4?{'count':_0xb7f837,'rows':_0x301ce4}:null;}})['then'](respondWithResult(_0x54d13b,null))['catch'](handleError(_0x54d13b,null));};exports['getSubjects']=function(_0xe03cb7,_0x36d88c,_0x2cc32b){var _0x3f49c0={};var _0x1b8113={};var _0x176874;var _0x595e34;return db['DeskConfiguration'][_0xeace('0x4d')]({'where':{'id':_0xe03cb7[_0xeace('0x46')]['id']}})[_0xeace('0x23')](handleEntityNotFound(_0x36d88c,null))[_0xeace('0x23')](function(_0x5bc235){if(_0x5bc235){_0x176874=_0x5bc235;_0x1b8113[_0xeace('0x30')]=_[_0xeace('0x2e')](db['DeskField'][_0xeace('0x29')]);_0x1b8113[_0xeace('0x2d')]=_[_0xeace('0x2e')](_0xe03cb7[_0xeace('0x2d')]);_0x1b8113[_0xeace('0x2f')]=_[_0xeace('0x31')](_0x1b8113[_0xeace('0x30')],_0x1b8113[_0xeace('0x2d')]);_0x3f49c0['attributes']=_[_0xeace('0x31')](_0x1b8113['model'],qs['fields'](_0xe03cb7['query'][_0xeace('0x32')]));_0x3f49c0[_0xeace('0x33')]=_0x3f49c0['attributes'][_0xeace('0x34')]?_0x3f49c0[_0xeace('0x33')]:_0x1b8113['model'];_0x3f49c0[_0xeace('0x38')]=qs[_0xeace('0x39')](_0xe03cb7[_0xeace('0x2d')]['sort']);_0x3f49c0[_0xeace('0x3a')]=qs[_0xeace('0x2f')](_[_0xeace('0x3b')](_0xe03cb7[_0xeace('0x2d')],_0x1b8113['filters']));if(_0xe03cb7[_0xeace('0x2d')][_0xeace('0x3c')]){_0x3f49c0[_0xeace('0x3a')]=_[_0xeace('0x3d')](_0x3f49c0[_0xeace('0x3a')],{'$or':_[_0xeace('0x28')](_0x3f49c0['attributes'],function(_0x57704c){var _0x135a9d={};_0x135a9d[_0x57704c]={'$like':'%'+_0xe03cb7[_0xeace('0x2d')][_0xeace('0x3c')]+'%'};return _0x135a9d;})});}_0x3f49c0=_[_0xeace('0x3d')]({},_0x3f49c0,_0xe03cb7[_0xeace('0x3f')]);return _0x176874[_0xeace('0x4f')](_0x3f49c0);}})['then'](function(_0x291981){if(_0x291981){_0x595e34=_0x291981[_0xeace('0x34')];if(!_0xe03cb7[_0xeace('0x2d')][_0xeace('0x35')]('nolimit')){_0x3f49c0[_0xeace('0x37')]=qs[_0xeace('0x37')](_0xe03cb7[_0xeace('0x2d')][_0xeace('0x37')]);_0x3f49c0[_0xeace('0x1d')]=qs[_0xeace('0x1d')](_0xe03cb7[_0xeace('0x2d')][_0xeace('0x1d')]);}return _0x176874[_0xeace('0x4f')](_0x3f49c0);}})['then'](function(_0x135f75){if(_0x135f75){return _0x135f75?{'count':_0x595e34,'rows':_0x135f75}:null;}})[_0xeace('0x23')](respondWithResult(_0x36d88c,null))['catch'](handleError(_0x36d88c,null));};exports[_0xeace('0x50')]=function(_0x1521ca,_0x26a58b,_0x3ef75e){var _0x475f94={};var _0x3f6de6={};var _0x101ea8;var _0x14daf6;return db[_0xeace('0x40')]['findOne']({'where':{'id':_0x1521ca['params']['id']}})['then'](handleEntityNotFound(_0x26a58b,null))[_0xeace('0x23')](function(_0x23e0ea){if(_0x23e0ea){_0x101ea8=_0x23e0ea;_0x3f6de6['model']=_[_0xeace('0x2e')](db[_0xeace('0x4e')][_0xeace('0x29')]);_0x3f6de6[_0xeace('0x2d')]=_['keys'](_0x1521ca['query']);_0x3f6de6[_0xeace('0x2f')]=_[_0xeace('0x31')](_0x3f6de6['model'],_0x3f6de6[_0xeace('0x2d')]);_0x475f94[_0xeace('0x33')]=_[_0xeace('0x31')](_0x3f6de6[_0xeace('0x30')],qs[_0xeace('0x32')](_0x1521ca['query'][_0xeace('0x32')]));_0x475f94[_0xeace('0x33')]=_0x475f94[_0xeace('0x33')][_0xeace('0x34')]?_0x475f94[_0xeace('0x33')]:_0x3f6de6[_0xeace('0x30')];_0x475f94[_0xeace('0x38')]=qs[_0xeace('0x39')](_0x1521ca[_0xeace('0x2d')][_0xeace('0x39')]);_0x475f94[_0xeace('0x3a')]=qs[_0xeace('0x2f')](_[_0xeace('0x3b')](_0x1521ca[_0xeace('0x2d')],_0x3f6de6[_0xeace('0x2f')]));if(_0x1521ca[_0xeace('0x2d')][_0xeace('0x3c')]){_0x475f94[_0xeace('0x3a')]=_['merge'](_0x475f94[_0xeace('0x3a')],{'$or':_[_0xeace('0x28')](_0x475f94[_0xeace('0x33')],function(_0x46bc41){var _0x27a5b2={};_0x27a5b2[_0x46bc41]={'$like':'%'+_0x1521ca[_0xeace('0x2d')][_0xeace('0x3c')]+'%'};return _0x27a5b2;})});}_0x475f94=_['merge']({},_0x475f94,_0x1521ca[_0xeace('0x3f')]);return _0x101ea8[_0xeace('0x50')](_0x475f94);}})[_0xeace('0x23')](function(_0x1b7301){if(_0x1b7301){_0x14daf6=_0x1b7301[_0xeace('0x34')];if(!_0x1521ca[_0xeace('0x2d')][_0xeace('0x35')]('nolimit')){_0x475f94[_0xeace('0x37')]=qs[_0xeace('0x37')](_0x1521ca[_0xeace('0x2d')]['limit']);_0x475f94[_0xeace('0x1d')]=qs[_0xeace('0x1d')](_0x1521ca[_0xeace('0x2d')][_0xeace('0x1d')]);}return _0x101ea8[_0xeace('0x50')](_0x475f94);}})[_0xeace('0x23')](function(_0x1f02e8){if(_0x1f02e8){return _0x1f02e8?{'count':_0x14daf6,'rows':_0x1f02e8}:null;}})[_0xeace('0x23')](respondWithResult(_0x26a58b,null))['catch'](handleError(_0x26a58b,null));};exports[_0xeace('0x51')]=function(_0x2964e4,_0x16c17c,_0x15b057){var _0x4fba4a={};var _0x369875={};var _0x5011db;var _0x5b54bd;return db[_0xeace('0x40')][_0xeace('0x4d')]({'where':{'id':_0x2964e4[_0xeace('0x46')]['id']}})[_0xeace('0x23')](handleEntityNotFound(_0x16c17c,null))[_0xeace('0x23')](function(_0x315a8c){if(_0x315a8c){_0x5011db=_0x315a8c;_0x369875[_0xeace('0x30')]=_[_0xeace('0x2e')](db['Tag']['rawAttributes']);_0x369875['query']=_[_0xeace('0x2e')](_0x2964e4[_0xeace('0x2d')]);_0x369875['filters']=_[_0xeace('0x31')](_0x369875[_0xeace('0x30')],_0x369875['query']);_0x4fba4a[_0xeace('0x33')]=_[_0xeace('0x31')](_0x369875[_0xeace('0x30')],qs[_0xeace('0x32')](_0x2964e4[_0xeace('0x2d')]['fields']));_0x4fba4a[_0xeace('0x33')]=_0x4fba4a[_0xeace('0x33')][_0xeace('0x34')]?_0x4fba4a['attributes']:_0x369875[_0xeace('0x30')];_0x4fba4a['order']=qs[_0xeace('0x39')](_0x2964e4[_0xeace('0x2d')][_0xeace('0x39')]);_0x4fba4a[_0xeace('0x3a')]=qs[_0xeace('0x2f')](_[_0xeace('0x3b')](_0x2964e4[_0xeace('0x2d')],_0x369875[_0xeace('0x2f')]));if(_0x2964e4[_0xeace('0x2d')][_0xeace('0x3c')]){_0x4fba4a[_0xeace('0x3a')]=_[_0xeace('0x3d')](_0x4fba4a[_0xeace('0x3a')],{'$or':_['map'](_0x4fba4a[_0xeace('0x33')],function(_0x93b76c){var _0x3623a8={};_0x3623a8[_0x93b76c]={'$like':'%'+_0x2964e4[_0xeace('0x2d')][_0xeace('0x3c')]+'%'};return _0x3623a8;})});}_0x4fba4a=_[_0xeace('0x3d')]({},_0x4fba4a,_0x2964e4['options']);return _0x5011db[_0xeace('0x51')](_0x4fba4a);}})['then'](function(_0x7153bd){if(_0x7153bd){_0x5b54bd=_0x7153bd[_0xeace('0x34')];if(!_0x2964e4[_0xeace('0x2d')][_0xeace('0x35')](_0xeace('0x36'))){_0x4fba4a[_0xeace('0x37')]=qs['limit'](_0x2964e4[_0xeace('0x2d')][_0xeace('0x37')]);_0x4fba4a[_0xeace('0x1d')]=qs[_0xeace('0x1d')](_0x2964e4[_0xeace('0x2d')]['offset']);}return _0x5011db[_0xeace('0x51')](_0x4fba4a);}})[_0xeace('0x23')](function(_0x54e9d5){if(_0x54e9d5){return _0x54e9d5?{'count':_0x5b54bd,'rows':_0x54e9d5}:null;}})[_0xeace('0x23')](respondWithResult(_0x16c17c,null))[_0xeace('0x48')](handleError(_0x16c17c,null));};exports[_0xeace('0x52')]=function(_0x271724,_0x2cc45b,_0x3c682c){if(_0x271724[_0xeace('0x4a')]['id']){delete _0x271724['body']['id'];}return db['DeskConfiguration'][_0xeace('0x4d')]({'where':{'id':_0x271724[_0xeace('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cc45b,null))[_0xeace('0x23')](function(_0x1d5690){if(_0x1d5690){return _0x1d5690[_0xeace('0x52')](_0x271724['body']['ids']||[]);}return null;})[_0xeace('0x23')](respondWithResult(_0x2cc45b,null))[_0xeace('0x48')](handleError(_0x2cc45b,null));}; \ No newline at end of file +var _0xe923=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','body','params','getFields','getSubjects','findOne','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key'];(function(_0x292e87,_0x9b2eb5){var _0x5186f6=function(_0x2eb5b6){while(--_0x2eb5b6){_0x292e87['push'](_0x292e87['shift']());}};_0x5186f6(++_0x9b2eb5);}(_0xe923,0x1bb));var _0x3e92=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xe923[_0x4c260a];return _0x17bbdd;};'use strict';var emlformat=require(_0x3e92('0x0'));var rimraf=require(_0x3e92('0x1'));var zipdir=require(_0x3e92('0x2'));var jsonpatch=require(_0x3e92('0x3'));var rp=require('request-promise');var moment=require(_0x3e92('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3e92('0x5'));var path=require(_0x3e92('0x6'));var sox=require(_0x3e92('0x7'));var csv=require(_0x3e92('0x8'));var ejs=require(_0x3e92('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e92('0xa'));var squel=require(_0x3e92('0xb'));var crypto=require(_0x3e92('0xc'));var jsforce=require(_0x3e92('0xd'));var deskjs=require(_0x3e92('0xe'));var toCsv=require(_0x3e92('0x8'));var querystring=require(_0x3e92('0xf'));var Papa=require(_0x3e92('0x10'));var Redis=require(_0x3e92('0x11'));var authService=require(_0x3e92('0x12'));var qs=require(_0x3e92('0x13'));var as=require(_0x3e92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e92('0x15'));var utils=require('../../config/utils');var config=require(_0x3e92('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e92('0x17'))['db'];function respondWithStatusCode(_0x367ab6,_0x1b951e){_0x1b951e=_0x1b951e||0xcc;return function(_0x5ad52d){if(_0x5ad52d){return _0x367ab6[_0x3e92('0x18')](_0x1b951e);}return _0x367ab6[_0x3e92('0x19')](_0x1b951e)['end']();};}function respondWithResult(_0xa5e97a,_0x211808){_0x211808=_0x211808||0xc8;return function(_0x3e0592){if(_0x3e0592){return _0xa5e97a['status'](_0x211808)[_0x3e92('0x1a')](_0x3e0592);}};}function respondWithFilteredResult(_0x10e02d,_0xa7f7ef){return function(_0x56d307){if(_0x56d307){var _0x30ca07=typeof _0xa7f7ef[_0x3e92('0x1b')]===_0x3e92('0x1c')&&typeof _0xa7f7ef[_0x3e92('0x1d')]===_0x3e92('0x1c');var _0x58f37d=_0x56d307[_0x3e92('0x1e')];var _0x36d89f=_0x30ca07?0x0:_0xa7f7ef[_0x3e92('0x1b')];var _0x4bafc2=_0x30ca07?_0x56d307[_0x3e92('0x1e')]:_0xa7f7ef[_0x3e92('0x1b')]+_0xa7f7ef[_0x3e92('0x1d')];var _0x4a55be;if(_0x4bafc2>=_0x58f37d){_0x4bafc2=_0x58f37d;_0x4a55be=0xc8;}else{_0x4a55be=0xce;}_0x10e02d[_0x3e92('0x19')](_0x4a55be);return _0x10e02d[_0x3e92('0x1f')]('Content-Range',_0x36d89f+'-'+_0x4bafc2+'/'+_0x58f37d)['json'](_0x56d307);}return null;};}function patchUpdates(_0x5b8e62){return function(_0x1c2204){try{jsonpatch[_0x3e92('0x20')](_0x1c2204,_0x5b8e62,!![]);}catch(_0x202fbe){return BPromise[_0x3e92('0x21')](_0x202fbe);}return _0x1c2204[_0x3e92('0x22')]();};}function saveUpdates(_0x4e30c2,_0x1a1884){return function(_0x35b9d7){if(_0x35b9d7){return _0x35b9d7[_0x3e92('0x23')](_0x4e30c2)[_0x3e92('0x24')](function(_0xcb90c){return _0xcb90c;});}return null;};}function removeEntity(_0x4d3bfd,_0x572887){return function(_0x4b99ff){if(_0x4b99ff){return _0x4b99ff[_0x3e92('0x25')]()[_0x3e92('0x24')](function(){_0x4d3bfd[_0x3e92('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2be6f9,_0x3c6248){return function(_0x3eba84){if(!_0x3eba84){_0x2be6f9[_0x3e92('0x18')](0x194);}return _0x3eba84;};}function handleError(_0x4c5229,_0x3c84b8){_0x3c84b8=_0x3c84b8||0x1f4;return function(_0xf76256){logger[_0x3e92('0x26')](_0xf76256[_0x3e92('0x27')]);if(_0xf76256['name']){delete _0xf76256[_0x3e92('0x28')];}_0x4c5229[_0x3e92('0x19')](_0x3c84b8)[_0x3e92('0x29')](_0xf76256);};}exports[_0x3e92('0x2a')]=function(_0x1a3771,_0x316d06){var _0x3cff5c={},_0x3915ef={},_0x5cae84={'count':0x0,'rows':[]};var _0x3e8f06=_[_0x3e92('0x2b')](db[_0x3e92('0x2c')][_0x3e92('0x2d')],function(_0x1ab417){return{'name':_0x1ab417[_0x3e92('0x2e')],'type':_0x1ab417[_0x3e92('0x2f')][_0x3e92('0x30')]};});_0x3915ef['model']=_['map'](_0x3e8f06,_0x3e92('0x28'));_0x3915ef[_0x3e92('0x31')]=_[_0x3e92('0x32')](_0x1a3771[_0x3e92('0x31')]);_0x3915ef[_0x3e92('0x33')]=_[_0x3e92('0x34')](_0x3915ef[_0x3e92('0x35')],_0x3915ef[_0x3e92('0x31')]);_0x3cff5c[_0x3e92('0x36')]=_[_0x3e92('0x34')](_0x3915ef['model'],qs[_0x3e92('0x37')](_0x1a3771[_0x3e92('0x31')][_0x3e92('0x37')]));_0x3cff5c['attributes']=_0x3cff5c[_0x3e92('0x36')][_0x3e92('0x38')]?_0x3cff5c[_0x3e92('0x36')]:_0x3915ef[_0x3e92('0x35')];if(!_0x1a3771[_0x3e92('0x31')][_0x3e92('0x39')](_0x3e92('0x3a'))){_0x3cff5c['limit']=qs['limit'](_0x1a3771[_0x3e92('0x31')][_0x3e92('0x1d')]);_0x3cff5c['offset']=qs[_0x3e92('0x1b')](_0x1a3771[_0x3e92('0x31')][_0x3e92('0x1b')]);}_0x3cff5c[_0x3e92('0x3b')]=qs[_0x3e92('0x3c')](_0x1a3771[_0x3e92('0x31')]['sort']);_0x3cff5c[_0x3e92('0x3d')]=qs[_0x3e92('0x33')](_[_0x3e92('0x3e')](_0x1a3771[_0x3e92('0x31')],_0x3915ef['filters']),_0x3e8f06);if(_0x1a3771[_0x3e92('0x31')][_0x3e92('0x3f')]){_0x3cff5c[_0x3e92('0x3d')]=_[_0x3e92('0x40')](_0x3cff5c['where'],{'$or':_[_0x3e92('0x2b')](_0x3e8f06,function(_0x3cb6fc){if(_0x3cb6fc[_0x3e92('0x2f')]!==_0x3e92('0x41')){var _0x1326bc={};_0x1326bc[_0x3cb6fc['name']]={'$like':'%'+_0x1a3771[_0x3e92('0x31')][_0x3e92('0x3f')]+'%'};return _0x1326bc;}})});}_0x3cff5c=_[_0x3e92('0x40')]({},_0x3cff5c,_0x1a3771[_0x3e92('0x42')]);var _0x3c3b21={'where':_0x3cff5c['where']};return db['DeskConfiguration'][_0x3e92('0x1e')](_0x3c3b21)[_0x3e92('0x24')](function(_0x44f6c1){_0x5cae84[_0x3e92('0x1e')]=_0x44f6c1;if(_0x1a3771['query'][_0x3e92('0x43')]){_0x3cff5c[_0x3e92('0x44')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x3cff5c);})[_0x3e92('0x24')](function(_0x4ea3c2){_0x5cae84['rows']=_0x4ea3c2;return _0x5cae84;})[_0x3e92('0x24')](respondWithFilteredResult(_0x316d06,_0x3cff5c))[_0x3e92('0x45')](handleError(_0x316d06,null));};exports[_0x3e92('0x46')]=function(_0x50cf5d,_0x182704){var _0x401fa8={'raw':![],'where':{'id':_0x50cf5d['params']['id']}},_0x16e9a3={};_0x16e9a3['model']=_[_0x3e92('0x32')](db[_0x3e92('0x2c')][_0x3e92('0x2d')]);_0x16e9a3['query']=_[_0x3e92('0x32')](_0x50cf5d[_0x3e92('0x31')]);_0x16e9a3[_0x3e92('0x33')]=_[_0x3e92('0x34')](_0x16e9a3[_0x3e92('0x35')],_0x16e9a3[_0x3e92('0x31')]);_0x401fa8['attributes']=_[_0x3e92('0x34')](_0x16e9a3[_0x3e92('0x35')],qs['fields'](_0x50cf5d[_0x3e92('0x31')][_0x3e92('0x37')]));_0x401fa8[_0x3e92('0x36')]=_0x401fa8['attributes'][_0x3e92('0x38')]?_0x401fa8[_0x3e92('0x36')]:_0x16e9a3[_0x3e92('0x35')];if(_0x50cf5d['query'][_0x3e92('0x43')]){_0x401fa8[_0x3e92('0x44')]=[{'all':!![]}];}_0x401fa8=_[_0x3e92('0x40')]({},_0x401fa8,_0x50cf5d[_0x3e92('0x42')]);return db[_0x3e92('0x2c')][_0x3e92('0x47')](_0x401fa8)['then'](handleEntityNotFound(_0x182704,null))[_0x3e92('0x24')](respondWithResult(_0x182704,null))['catch'](handleError(_0x182704,null));};exports['create']=function(_0x1f51c7,_0x494396){return db[_0x3e92('0x2c')]['create'](_0x1f51c7[_0x3e92('0x48')],{})[_0x3e92('0x24')](respondWithResult(_0x494396,0xc9))['catch'](handleError(_0x494396,null));};exports['update']=function(_0x4e0feb,_0x29e240){if(_0x4e0feb[_0x3e92('0x48')]['id']){delete _0x4e0feb[_0x3e92('0x48')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x4e0feb[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x29e240,null))[_0x3e92('0x24')](saveUpdates(_0x4e0feb['body'],null))['then'](respondWithResult(_0x29e240,null))[_0x3e92('0x45')](handleError(_0x29e240,null));};exports[_0x3e92('0x25')]=function(_0x58b451,_0xe35e20){return db[_0x3e92('0x2c')][_0x3e92('0x47')]({'where':{'id':_0x58b451[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0xe35e20,null))[_0x3e92('0x24')](removeEntity(_0xe35e20,null))[_0x3e92('0x45')](handleError(_0xe35e20,null));};exports['getFields']=function(_0xffaf83,_0x3aae11,_0x3b976d){var _0x7e0d3={};var _0x30f395={};var _0x54d6e9;var _0x530c68;return db[_0x3e92('0x2c')]['findOne']({'where':{'id':_0xffaf83['params']['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x3aae11,null))[_0x3e92('0x24')](function(_0x4766b3){if(_0x4766b3){_0x54d6e9=_0x4766b3;_0x30f395['model']=_[_0x3e92('0x32')](db['DeskField']['rawAttributes']);_0x30f395[_0x3e92('0x31')]=_[_0x3e92('0x32')](_0xffaf83[_0x3e92('0x31')]);_0x30f395[_0x3e92('0x33')]=_['intersection'](_0x30f395[_0x3e92('0x35')],_0x30f395['query']);_0x7e0d3['attributes']=_[_0x3e92('0x34')](_0x30f395[_0x3e92('0x35')],qs['fields'](_0xffaf83[_0x3e92('0x31')][_0x3e92('0x37')]));_0x7e0d3[_0x3e92('0x36')]=_0x7e0d3[_0x3e92('0x36')][_0x3e92('0x38')]?_0x7e0d3[_0x3e92('0x36')]:_0x30f395['model'];_0x7e0d3[_0x3e92('0x3b')]=qs[_0x3e92('0x3c')](_0xffaf83[_0x3e92('0x31')][_0x3e92('0x3c')]);_0x7e0d3[_0x3e92('0x3d')]=qs[_0x3e92('0x33')](_['pick'](_0xffaf83[_0x3e92('0x31')],_0x30f395['filters']));if(_0xffaf83[_0x3e92('0x31')][_0x3e92('0x3f')]){_0x7e0d3['where']=_[_0x3e92('0x40')](_0x7e0d3[_0x3e92('0x3d')],{'$or':_[_0x3e92('0x2b')](_0x7e0d3[_0x3e92('0x36')],function(_0x162b17){var _0x230388={};_0x230388[_0x162b17]={'$like':'%'+_0xffaf83[_0x3e92('0x31')][_0x3e92('0x3f')]+'%'};return _0x230388;})});}_0x7e0d3=_[_0x3e92('0x40')]({},_0x7e0d3,_0xffaf83['options']);return _0x54d6e9[_0x3e92('0x4a')](_0x7e0d3);}})['then'](function(_0x31ab42){if(_0x31ab42){_0x530c68=_0x31ab42[_0x3e92('0x38')];if(!_0xffaf83['query'][_0x3e92('0x39')](_0x3e92('0x3a'))){_0x7e0d3[_0x3e92('0x1d')]=qs[_0x3e92('0x1d')](_0xffaf83[_0x3e92('0x31')]['limit']);_0x7e0d3[_0x3e92('0x1b')]=qs['offset'](_0xffaf83['query'][_0x3e92('0x1b')]);}return _0x54d6e9['getFields'](_0x7e0d3);}})[_0x3e92('0x24')](function(_0x499f14){if(_0x499f14){return _0x499f14?{'count':_0x530c68,'rows':_0x499f14}:null;}})[_0x3e92('0x24')](respondWithResult(_0x3aae11,null))[_0x3e92('0x45')](handleError(_0x3aae11,null));};exports[_0x3e92('0x4b')]=function(_0x12b93f,_0x286575,_0x324894){var _0x470bbd={};var _0x279406={};var _0x3a965d;var _0x536387;return db[_0x3e92('0x2c')][_0x3e92('0x4c')]({'where':{'id':_0x12b93f[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x286575,null))[_0x3e92('0x24')](function(_0x58933d){if(_0x58933d){_0x3a965d=_0x58933d;_0x279406[_0x3e92('0x35')]=_['keys'](db[_0x3e92('0x4d')]['rawAttributes']);_0x279406[_0x3e92('0x31')]=_[_0x3e92('0x32')](_0x12b93f[_0x3e92('0x31')]);_0x279406[_0x3e92('0x33')]=_['intersection'](_0x279406[_0x3e92('0x35')],_0x279406[_0x3e92('0x31')]);_0x470bbd['attributes']=_[_0x3e92('0x34')](_0x279406[_0x3e92('0x35')],qs['fields'](_0x12b93f[_0x3e92('0x31')][_0x3e92('0x37')]));_0x470bbd[_0x3e92('0x36')]=_0x470bbd[_0x3e92('0x36')][_0x3e92('0x38')]?_0x470bbd['attributes']:_0x279406[_0x3e92('0x35')];_0x470bbd[_0x3e92('0x3b')]=qs['sort'](_0x12b93f[_0x3e92('0x31')][_0x3e92('0x3c')]);_0x470bbd['where']=qs[_0x3e92('0x33')](_['pick'](_0x12b93f['query'],_0x279406[_0x3e92('0x33')]));if(_0x12b93f[_0x3e92('0x31')][_0x3e92('0x3f')]){_0x470bbd[_0x3e92('0x3d')]=_[_0x3e92('0x40')](_0x470bbd[_0x3e92('0x3d')],{'$or':_[_0x3e92('0x2b')](_0x470bbd['attributes'],function(_0x504071){var _0x32d138={};_0x32d138[_0x504071]={'$like':'%'+_0x12b93f['query'][_0x3e92('0x3f')]+'%'};return _0x32d138;})});}_0x470bbd=_[_0x3e92('0x40')]({},_0x470bbd,_0x12b93f[_0x3e92('0x42')]);return _0x3a965d[_0x3e92('0x4b')](_0x470bbd);}})[_0x3e92('0x24')](function(_0x2a02ac){if(_0x2a02ac){_0x536387=_0x2a02ac[_0x3e92('0x38')];if(!_0x12b93f[_0x3e92('0x31')]['hasOwnProperty']('nolimit')){_0x470bbd[_0x3e92('0x1d')]=qs['limit'](_0x12b93f[_0x3e92('0x31')]['limit']);_0x470bbd[_0x3e92('0x1b')]=qs[_0x3e92('0x1b')](_0x12b93f['query']['offset']);}return _0x3a965d['getSubjects'](_0x470bbd);}})[_0x3e92('0x24')](function(_0x25bdbd){if(_0x25bdbd){return _0x25bdbd?{'count':_0x536387,'rows':_0x25bdbd}:null;}})[_0x3e92('0x24')](respondWithResult(_0x286575,null))[_0x3e92('0x45')](handleError(_0x286575,null));};exports[_0x3e92('0x4e')]=function(_0x173881,_0x3f3952,_0xb05b45){var _0x297d1e={};var _0x30d8d3={};var _0x25e213;var _0x3298f4;return db[_0x3e92('0x2c')][_0x3e92('0x4c')]({'where':{'id':_0x173881[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x3f3952,null))[_0x3e92('0x24')](function(_0x566659){if(_0x566659){_0x25e213=_0x566659;_0x30d8d3[_0x3e92('0x35')]=_[_0x3e92('0x32')](db[_0x3e92('0x4d')][_0x3e92('0x2d')]);_0x30d8d3['query']=_[_0x3e92('0x32')](_0x173881[_0x3e92('0x31')]);_0x30d8d3[_0x3e92('0x33')]=_[_0x3e92('0x34')](_0x30d8d3[_0x3e92('0x35')],_0x30d8d3[_0x3e92('0x31')]);_0x297d1e['attributes']=_[_0x3e92('0x34')](_0x30d8d3[_0x3e92('0x35')],qs[_0x3e92('0x37')](_0x173881[_0x3e92('0x31')]['fields']));_0x297d1e[_0x3e92('0x36')]=_0x297d1e[_0x3e92('0x36')]['length']?_0x297d1e[_0x3e92('0x36')]:_0x30d8d3['model'];_0x297d1e[_0x3e92('0x3b')]=qs[_0x3e92('0x3c')](_0x173881[_0x3e92('0x31')][_0x3e92('0x3c')]);_0x297d1e[_0x3e92('0x3d')]=qs[_0x3e92('0x33')](_[_0x3e92('0x3e')](_0x173881[_0x3e92('0x31')],_0x30d8d3[_0x3e92('0x33')]));if(_0x173881[_0x3e92('0x31')][_0x3e92('0x3f')]){_0x297d1e[_0x3e92('0x3d')]=_[_0x3e92('0x40')](_0x297d1e[_0x3e92('0x3d')],{'$or':_[_0x3e92('0x2b')](_0x297d1e[_0x3e92('0x36')],function(_0x370433){var _0x3b290b={};_0x3b290b[_0x370433]={'$like':'%'+_0x173881[_0x3e92('0x31')][_0x3e92('0x3f')]+'%'};return _0x3b290b;})});}_0x297d1e=_[_0x3e92('0x40')]({},_0x297d1e,_0x173881[_0x3e92('0x42')]);return _0x25e213[_0x3e92('0x4e')](_0x297d1e);}})[_0x3e92('0x24')](function(_0x1c0bcf){if(_0x1c0bcf){_0x3298f4=_0x1c0bcf[_0x3e92('0x38')];if(!_0x173881[_0x3e92('0x31')]['hasOwnProperty'](_0x3e92('0x3a'))){_0x297d1e[_0x3e92('0x1d')]=qs[_0x3e92('0x1d')](_0x173881[_0x3e92('0x31')]['limit']);_0x297d1e[_0x3e92('0x1b')]=qs[_0x3e92('0x1b')](_0x173881['query'][_0x3e92('0x1b')]);}return _0x25e213['getDescriptions'](_0x297d1e);}})[_0x3e92('0x24')](function(_0x3be60f){if(_0x3be60f){return _0x3be60f?{'count':_0x3298f4,'rows':_0x3be60f}:null;}})[_0x3e92('0x24')](respondWithResult(_0x3f3952,null))[_0x3e92('0x45')](handleError(_0x3f3952,null));};exports[_0x3e92('0x4f')]=function(_0x27d871,_0x5e3bcb,_0x4ccada){var _0x5e4326={};var _0xc911eb={};var _0x41d64b;var _0x2da62c;return db['DeskConfiguration']['findOne']({'where':{'id':_0x27d871[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x5e3bcb,null))[_0x3e92('0x24')](function(_0xb3b37){if(_0xb3b37){_0x41d64b=_0xb3b37;_0xc911eb[_0x3e92('0x35')]=_[_0x3e92('0x32')](db[_0x3e92('0x50')]['rawAttributes']);_0xc911eb['query']=_[_0x3e92('0x32')](_0x27d871[_0x3e92('0x31')]);_0xc911eb[_0x3e92('0x33')]=_[_0x3e92('0x34')](_0xc911eb[_0x3e92('0x35')],_0xc911eb[_0x3e92('0x31')]);_0x5e4326[_0x3e92('0x36')]=_[_0x3e92('0x34')](_0xc911eb[_0x3e92('0x35')],qs[_0x3e92('0x37')](_0x27d871['query'][_0x3e92('0x37')]));_0x5e4326[_0x3e92('0x36')]=_0x5e4326[_0x3e92('0x36')][_0x3e92('0x38')]?_0x5e4326[_0x3e92('0x36')]:_0xc911eb[_0x3e92('0x35')];_0x5e4326[_0x3e92('0x3b')]=qs[_0x3e92('0x3c')](_0x27d871[_0x3e92('0x31')][_0x3e92('0x3c')]);_0x5e4326[_0x3e92('0x3d')]=qs[_0x3e92('0x33')](_[_0x3e92('0x3e')](_0x27d871[_0x3e92('0x31')],_0xc911eb[_0x3e92('0x33')]));if(_0x27d871['query'][_0x3e92('0x3f')]){_0x5e4326[_0x3e92('0x3d')]=_[_0x3e92('0x40')](_0x5e4326['where'],{'$or':_[_0x3e92('0x2b')](_0x5e4326[_0x3e92('0x36')],function(_0x1b4e64){var _0x5e27a5={};_0x5e27a5[_0x1b4e64]={'$like':'%'+_0x27d871[_0x3e92('0x31')][_0x3e92('0x3f')]+'%'};return _0x5e27a5;})});}_0x5e4326=_[_0x3e92('0x40')]({},_0x5e4326,_0x27d871[_0x3e92('0x42')]);return _0x41d64b[_0x3e92('0x4f')](_0x5e4326);}})[_0x3e92('0x24')](function(_0x2e83ef){if(_0x2e83ef){_0x2da62c=_0x2e83ef[_0x3e92('0x38')];if(!_0x27d871[_0x3e92('0x31')][_0x3e92('0x39')](_0x3e92('0x3a'))){_0x5e4326[_0x3e92('0x1d')]=qs[_0x3e92('0x1d')](_0x27d871[_0x3e92('0x31')]['limit']);_0x5e4326[_0x3e92('0x1b')]=qs[_0x3e92('0x1b')](_0x27d871[_0x3e92('0x31')][_0x3e92('0x1b')]);}return _0x41d64b[_0x3e92('0x4f')](_0x5e4326);}})[_0x3e92('0x24')](function(_0x2115be){if(_0x2115be){return _0x2115be?{'count':_0x2da62c,'rows':_0x2115be}:null;}})[_0x3e92('0x24')](respondWithResult(_0x5e3bcb,null))[_0x3e92('0x45')](handleError(_0x5e3bcb,null));};exports[_0x3e92('0x51')]=function(_0x55a1f,_0x139f13,_0x28fd76){if(_0x55a1f[_0x3e92('0x48')]['id']){delete _0x55a1f[_0x3e92('0x48')]['id'];}return db[_0x3e92('0x2c')][_0x3e92('0x4c')]({'where':{'id':_0x55a1f[_0x3e92('0x49')]['id']}})[_0x3e92('0x24')](handleEntityNotFound(_0x139f13,null))['then'](function(_0x56fb2c){if(_0x56fb2c){return _0x56fb2c[_0x3e92('0x51')](_0x55a1f[_0x3e92('0x48')]['ids']||[]);}return null;})[_0x3e92('0x24')](respondWithResult(_0x139f13,null))[_0x3e92('0x45')](handleError(_0x139f13,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2d83026..eb0fdd3 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 _0x7ef0=['define','DeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports'];(function(_0x1a4c39,_0x13aade){var _0x55b641=function(_0x222d9f){while(--_0x222d9f){_0x1a4c39['push'](_0x1a4c39['shift']());}};_0x55b641(++_0x13aade);}(_0x7ef0,0x122));var _0x07ef=function(_0x5ea73e,_0x95f262){_0x5ea73e=_0x5ea73e-0x0;var _0x9b7f32=_0x7ef0[_0x5ea73e];return _0x9b7f32;};'use strict';var _=require(_0x07ef('0x0'));var util=require(_0x07ef('0x1'));var logger=require(_0x07ef('0x2'))(_0x07ef('0x3'));var moment=require('moment');var BPromise=require(_0x07ef('0x4'));var rp=require(_0x07ef('0x5'));var fs=require('fs');var path=require(_0x07ef('0x6'));var rimraf=require(_0x07ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x07ef('0x8'));module[_0x07ef('0x9')]=function(_0x5081f7,_0x44e2e9){return _0x5081f7[_0x07ef('0xa')](_0x07ef('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f3d=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f3d,0xd6));var _0xd2f3=function(_0x55762c,_0xe4b3d5){_0x55762c=_0x55762c-0x0;var _0x43db5b=_0x2f3d[_0x55762c];return _0x43db5b;};'use strict';var _=require(_0xd2f3('0x0'));var util=require(_0xd2f3('0x1'));var logger=require(_0xd2f3('0x2'))(_0xd2f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2f3('0x4'));var fs=require('fs');var path=require(_0xd2f3('0x5'));var rimraf=require(_0xd2f3('0x6'));var config=require(_0xd2f3('0x7'));var attributes=require(_0xd2f3('0x8'));module[_0xd2f3('0x9')]=function(_0x169237,_0x14b005){return _0x169237['define'](_0xd2f3('0xa'),attributes,{'tableName':_0xd2f3('0xb'),'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 0cb6de2..ee8d0a0 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 _0x6a18=['then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0x6a18,0x114));var _0x86a1=function(_0xb8d4b,_0x34f61c){_0xb8d4b=_0xb8d4b-0x0;var _0xf7f0b2=_0x6a18[_0xb8d4b];return _0xf7f0b2;};'use strict';var _=require(_0x86a1('0x0'));var util=require(_0x86a1('0x1'));var moment=require(_0x86a1('0x2'));var BPromise=require(_0x86a1('0x3'));var rs=require(_0x86a1('0x4'));var fs=require('fs');var Redis=require(_0x86a1('0x5'));var db=require(_0x86a1('0x6'))['db'];var utils=require(_0x86a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x86a1('0x8'));var jayson=require(_0x86a1('0x9'));var client=jayson[_0x86a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a5210,_0x189a52,_0xa44f84){return new BPromise(function(_0x4e93de,_0x228791){return client[_0x86a1('0xb')](_0x2a5210,_0xa44f84)[_0x86a1('0xc')](function(_0x37f26f){logger[_0x86a1('0xd')](_0x86a1('0xe'),_0x189a52,'request\x20sent');logger[_0x86a1('0xf')](_0x86a1('0x10'),_0x189a52,_0x86a1('0x11'),JSON[_0x86a1('0x12')](_0x37f26f));if(_0x37f26f[_0x86a1('0x13')]){if(_0x37f26f[_0x86a1('0x13')][_0x86a1('0x14')]===0x1f4){logger[_0x86a1('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x189a52,_0x37f26f[_0x86a1('0x13')][_0x86a1('0x15')]);return _0x228791(_0x37f26f[_0x86a1('0x13')]['message']);}logger[_0x86a1('0x13')](_0x86a1('0xe'),_0x189a52,_0x37f26f[_0x86a1('0x13')][_0x86a1('0x15')]);return _0x4e93de(_0x37f26f[_0x86a1('0x13')]['message']);}else{logger[_0x86a1('0xd')](_0x86a1('0xe'),_0x189a52,'request\x20sent');_0x4e93de(_0x37f26f[_0x86a1('0x16')][_0x86a1('0x15')]);}})[_0x86a1('0x17')](function(_0x10a995){logger[_0x86a1('0x13')](_0x86a1('0xe'),_0x189a52,_0x10a995);_0x228791(_0x10a995);});});} \ No newline at end of file +var _0xb9ed=['code','message','DeskConfiguration,\x20%s,\x20%s','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2f4e46,_0x1dbc95){var _0x33f0bc=function(_0x323b05){while(--_0x323b05){_0x2f4e46['push'](_0x2f4e46['shift']());}};_0x33f0bc(++_0x1dbc95);}(_0xb9ed,0x1bc));var _0xdb9e=function(_0x28ae33,_0x53cd48){_0x28ae33=_0x28ae33-0x0;var _0x20d7e0=_0xb9ed[_0x28ae33];return _0x20d7e0;};'use strict';var _=require(_0xdb9e('0x0'));var util=require('util');var moment=require(_0xdb9e('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb9e('0x2'));var fs=require('fs');var Redis=require(_0xdb9e('0x3'));var db=require(_0xdb9e('0x4'))['db'];var utils=require(_0xdb9e('0x5'));var logger=require(_0xdb9e('0x6'))(_0xdb9e('0x7'));var config=require(_0xdb9e('0x8'));var jayson=require(_0xdb9e('0x9'));var client=jayson['client'][_0xdb9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53309a,_0x45e22b,_0x57ab79){return new BPromise(function(_0xd9de78,_0x59451a){return client[_0xdb9e('0xb')](_0x53309a,_0x57ab79)['then'](function(_0x1b3b52){logger[_0xdb9e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x45e22b,'request\x20sent');logger[_0xdb9e('0xd')](_0xdb9e('0xe'),_0x45e22b,_0xdb9e('0xf'),JSON[_0xdb9e('0x10')](_0x1b3b52));if(_0x1b3b52[_0xdb9e('0x11')]){if(_0x1b3b52[_0xdb9e('0x11')][_0xdb9e('0x12')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x45e22b,_0x1b3b52[_0xdb9e('0x11')][_0xdb9e('0x13')]);return _0x59451a(_0x1b3b52['error']['message']);}logger[_0xdb9e('0x11')](_0xdb9e('0x14'),_0x45e22b,_0x1b3b52['error'][_0xdb9e('0x13')]);return _0xd9de78(_0x1b3b52['error'][_0xdb9e('0x13')]);}else{logger[_0xdb9e('0xc')](_0xdb9e('0x14'),_0x45e22b,_0xdb9e('0xf'));_0xd9de78(_0x1b3b52[_0xdb9e('0x15')][_0xdb9e('0x13')]);}})['catch'](function(_0x4a3459){logger[_0xdb9e('0x11')](_0xdb9e('0x14'),_0x45e22b,_0x4a3459);_0x59451a(_0x4a3459);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bdbbf71..6081668 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 _0xcdc2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','show','post','create','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x53bfdb,_0x8ecab3){var _0x469b15=function(_0x27f761){while(--_0x27f761){_0x53bfdb['push'](_0x53bfdb['shift']());}};_0x469b15(++_0x8ecab3);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x455c0b,_0x49f8fc){_0x455c0b=_0x455c0b-0x0;var _0x56245d=_0xcdc2[_0x455c0b];return _0x56245d;};'use strict';var multer=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var path=require(_0x2cdc('0x2'));var timeout=require(_0x2cdc('0x3'));var express=require(_0x2cdc('0x4'));var router=express[_0x2cdc('0x5')]();var fs_extra=require(_0x2cdc('0x6'));var auth=require(_0x2cdc('0x7'));var interaction=require(_0x2cdc('0x8'));var config=require(_0x2cdc('0x9'));var controller=require(_0x2cdc('0xa'));router[_0x2cdc('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2cdc('0xb')]('/:id',auth[_0x2cdc('0xc')](),controller[_0x2cdc('0xd')]);router[_0x2cdc('0xe')]('/',auth['isAuthenticated'](),controller[_0x2cdc('0xf')]);router['put']('/:id',auth[_0x2cdc('0xc')](),controller['update']);router['delete'](_0x2cdc('0x10'),auth['isAuthenticated'](),controller[_0x2cdc('0x11')]);module[_0x2cdc('0x12')]=router; \ No newline at end of file +var _0x4760=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer'];(function(_0x34947e,_0x45c404){var _0x87404f=function(_0x5e5027){while(--_0x5e5027){_0x34947e['push'](_0x34947e['shift']());}};_0x87404f(++_0x45c404);}(_0x4760,0x120));var _0x0476=function(_0xed2c14,_0x38e615){_0xed2c14=_0xed2c14-0x0;var _0x23992c=_0x4760[_0xed2c14];return _0x23992c;};'use strict';var multer=require(_0x0476('0x0'));var util=require(_0x0476('0x1'));var path=require('path');var timeout=require(_0x0476('0x2'));var express=require(_0x0476('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0476('0x4'));var interaction=require(_0x0476('0x5'));var config=require(_0x0476('0x6'));var controller=require(_0x0476('0x7'));router[_0x0476('0x8')]('/',auth[_0x0476('0x9')](),controller[_0x0476('0xa')]);router[_0x0476('0x8')](_0x0476('0xb'),auth[_0x0476('0x9')](),controller['show']);router['post']('/',auth[_0x0476('0x9')](),controller[_0x0476('0xc')]);router['put'](_0x0476('0xb'),auth[_0x0476('0x9')](),controller[_0x0476('0xd')]);router[_0x0476('0xe')]('/:id',auth[_0x0476('0x9')](),controller[_0x0476('0xf')]);module[_0x0476('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 9a72bd8..cfa1fb4 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 _0x0dd4=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x18be7e,_0x32fd6c){var _0x44139b=function(_0x219c43){while(--_0x219c43){_0x18be7e['push'](_0x18be7e['shift']());}};_0x44139b(++_0x32fd6c);}(_0x0dd4,0x1dd));var _0x40dd=function(_0x459d87,_0x3b193a){_0x459d87=_0x459d87-0x0;var _0x20d5d1=_0x0dd4[_0x459d87];return _0x20d5d1;};'use strict';var Sequelize=require(_0x40dd('0x0'));module[_0x40dd('0x1')]={'type':{'type':Sequelize[_0x40dd('0x2')]('string','variable',_0x40dd('0x3'),'keyValue',_0x40dd('0x4')),'defaultValue':_0x40dd('0x5')},'content':{'type':Sequelize[_0x40dd('0x6')]},'key':{'type':Sequelize[_0x40dd('0x6')]},'keyType':{'type':Sequelize[_0x40dd('0x2')]('string','variable',_0x40dd('0x3'))},'keyContent':{'type':Sequelize[_0x40dd('0x6')]},'idField':{'type':Sequelize[_0x40dd('0x6')]},'nameField':{'type':Sequelize[_0x40dd('0x6')]},'customField':{'type':Sequelize[_0x40dd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x40dd('0x6')]}}; \ No newline at end of file +var _0xf588=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xf588,0x185));var _0x8f58=function(_0x1f66fd,_0x497ad2){_0x1f66fd=_0x1f66fd-0x0;var _0x3031e7=_0xf588[_0x1f66fd];return _0x3031e7;};'use strict';var Sequelize=require(_0x8f58('0x0'));module[_0x8f58('0x1')]={'type':{'type':Sequelize[_0x8f58('0x2')](_0x8f58('0x3'),_0x8f58('0x4'),_0x8f58('0x5'),_0x8f58('0x6'),_0x8f58('0x7')),'defaultValue':_0x8f58('0x3')},'content':{'type':Sequelize[_0x8f58('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8f58('0x2')](_0x8f58('0x3'),'variable',_0x8f58('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8f58('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8f58('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f58('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9f87741..3ba48b7 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 _0xcf30=['catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','include','options'];(function(_0x3685ef,_0x4f22cf){var _0x4df8e9=function(_0x345870){while(--_0x345870){_0x3685ef['push'](_0x3685ef['shift']());}};_0x4df8e9(++_0x4f22cf);}(_0xcf30,0x128));var _0x0cf3=function(_0x10883c,_0x1bce5c){_0x10883c=_0x10883c-0x0;var _0x3e7fe3=_0xcf30[_0x10883c];return _0x3e7fe3;};'use strict';var emlformat=require(_0x0cf3('0x0'));var rimraf=require(_0x0cf3('0x1'));var zipdir=require(_0x0cf3('0x2'));var jsonpatch=require(_0x0cf3('0x3'));var rp=require('request-promise');var moment=require(_0x0cf3('0x4'));var BPromise=require(_0x0cf3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0cf3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cf3('0x7'));var squel=require(_0x0cf3('0x8'));var crypto=require(_0x0cf3('0x9'));var jsforce=require(_0x0cf3('0xa'));var deskjs=require(_0x0cf3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0cf3('0xc'));var Papa=require('papaparse');var Redis=require(_0x0cf3('0xd'));var authService=require(_0x0cf3('0xe'));var qs=require(_0x0cf3('0xf'));var as=require(_0x0cf3('0x10'));var hardwareService=require(_0x0cf3('0x11'));var logger=require(_0x0cf3('0x12'))(_0x0cf3('0x13'));var utils=require(_0x0cf3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0cf3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50df01,_0x5ecbe5){_0x5ecbe5=_0x5ecbe5||0xcc;return function(_0x24d1d4){if(_0x24d1d4){return _0x50df01[_0x0cf3('0x16')](_0x5ecbe5);}return _0x50df01['status'](_0x5ecbe5)['end']();};}function respondWithResult(_0x4d145c,_0x33a7a3){_0x33a7a3=_0x33a7a3||0xc8;return function(_0x20b7b0){if(_0x20b7b0){return _0x4d145c[_0x0cf3('0x17')](_0x33a7a3)[_0x0cf3('0x18')](_0x20b7b0);}};}function respondWithFilteredResult(_0x41d672,_0x4a5b42){return function(_0xdcaf22){if(_0xdcaf22){var _0x86f0d5=typeof _0x4a5b42['offset']===_0x0cf3('0x19')&&typeof _0x4a5b42[_0x0cf3('0x1a')]===_0x0cf3('0x19');var _0x431fde=_0xdcaf22[_0x0cf3('0x1b')];var _0x2ab930=_0x86f0d5?0x0:_0x4a5b42[_0x0cf3('0x1c')];var _0x139325=_0x86f0d5?_0xdcaf22['count']:_0x4a5b42[_0x0cf3('0x1c')]+_0x4a5b42[_0x0cf3('0x1a')];var _0x4e06f6;if(_0x139325>=_0x431fde){_0x139325=_0x431fde;_0x4e06f6=0xc8;}else{_0x4e06f6=0xce;}_0x41d672[_0x0cf3('0x17')](_0x4e06f6);return _0x41d672[_0x0cf3('0x1d')](_0x0cf3('0x1e'),_0x2ab930+'-'+_0x139325+'/'+_0x431fde)[_0x0cf3('0x18')](_0xdcaf22);}return null;};}function patchUpdates(_0x327694){return function(_0x5bb14e){try{jsonpatch[_0x0cf3('0x1f')](_0x5bb14e,_0x327694,!![]);}catch(_0x5cf070){return BPromise[_0x0cf3('0x20')](_0x5cf070);}return _0x5bb14e[_0x0cf3('0x21')]();};}function saveUpdates(_0x306307,_0x5ed4ba){return function(_0x267c28){if(_0x267c28){return _0x267c28[_0x0cf3('0x22')](_0x306307)['then'](function(_0x46d85a){return _0x46d85a;});}return null;};}function removeEntity(_0x5b9024,_0x45ae4f){return function(_0x4a6ed1){if(_0x4a6ed1){return _0x4a6ed1[_0x0cf3('0x23')]()[_0x0cf3('0x24')](function(){_0x5b9024['status'](0xcc)[_0x0cf3('0x25')]();});}};}function handleEntityNotFound(_0x3205c0,_0x57dc10){return function(_0x28c81){if(!_0x28c81){_0x3205c0[_0x0cf3('0x16')](0x194);}return _0x28c81;};}function handleError(_0x5be8c9,_0x5aed05){_0x5aed05=_0x5aed05||0x1f4;return function(_0x2ce8d9){logger[_0x0cf3('0x26')](_0x2ce8d9[_0x0cf3('0x27')]);if(_0x2ce8d9[_0x0cf3('0x28')]){delete _0x2ce8d9['name'];}_0x5be8c9[_0x0cf3('0x17')](_0x5aed05)[_0x0cf3('0x29')](_0x2ce8d9);};}exports['index']=function(_0x1a1e94,_0x19f1cf){var _0x4b78a0={},_0x1c2c1c={},_0x38a3c9={'count':0x0,'rows':[]};var _0x23707d=_[_0x0cf3('0x2a')](db[_0x0cf3('0x2b')][_0x0cf3('0x2c')],function(_0x4bd471){return{'name':_0x4bd471[_0x0cf3('0x2d')],'type':_0x4bd471[_0x0cf3('0x2e')][_0x0cf3('0x2f')]};});_0x1c2c1c[_0x0cf3('0x30')]=_['map'](_0x23707d,_0x0cf3('0x28'));_0x1c2c1c[_0x0cf3('0x31')]=_[_0x0cf3('0x32')](_0x1a1e94[_0x0cf3('0x31')]);_0x1c2c1c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],_0x1c2c1c[_0x0cf3('0x31')]);_0x4b78a0['attributes']=_[_0x0cf3('0x34')](_0x1c2c1c[_0x0cf3('0x30')],qs['fields'](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4b78a0['attributes']=_0x4b78a0[_0x0cf3('0x36')]['length']?_0x4b78a0['attributes']:_0x1c2c1c['model'];if(!_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x37')]('nolimit')){_0x4b78a0['limit']=qs[_0x0cf3('0x1a')](_0x1a1e94['query']['limit']);_0x4b78a0[_0x0cf3('0x1c')]=qs[_0x0cf3('0x1c')](_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x1c')]);}_0x4b78a0[_0x0cf3('0x38')]=qs['sort'](_0x1a1e94['query'][_0x0cf3('0x39')]);_0x4b78a0[_0x0cf3('0x3a')]=qs['filters'](_[_0x0cf3('0x3b')](_0x1a1e94['query'],_0x1c2c1c[_0x0cf3('0x33')]),_0x23707d);if(_0x1a1e94['query'][_0x0cf3('0x3c')]){_0x4b78a0[_0x0cf3('0x3a')]=_['merge'](_0x4b78a0[_0x0cf3('0x3a')],{'$or':_[_0x0cf3('0x2a')](_0x23707d,function(_0x21dd80){if(_0x21dd80[_0x0cf3('0x2e')]!=='VIRTUAL'){var _0x2c3c89={};_0x2c3c89[_0x21dd80[_0x0cf3('0x28')]]={'$like':'%'+_0x1a1e94['query'][_0x0cf3('0x3c')]+'%'};return _0x2c3c89;}})});}_0x4b78a0=_[_0x0cf3('0x3d')]({},_0x4b78a0,_0x1a1e94['options']);var _0x15ee24={'where':_0x4b78a0['where']};return db['DeskField']['count'](_0x15ee24)[_0x0cf3('0x24')](function(_0x4dac1b){_0x38a3c9[_0x0cf3('0x1b')]=_0x4dac1b;if(_0x1a1e94[_0x0cf3('0x31')][_0x0cf3('0x3e')]){_0x4b78a0['include']=[{'all':!![]}];}return db[_0x0cf3('0x2b')][_0x0cf3('0x3f')](_0x4b78a0);})[_0x0cf3('0x24')](function(_0xc6da07){_0x38a3c9[_0x0cf3('0x40')]=_0xc6da07;return _0x38a3c9;})[_0x0cf3('0x24')](respondWithFilteredResult(_0x19f1cf,_0x4b78a0))['catch'](handleError(_0x19f1cf,null));};exports[_0x0cf3('0x41')]=function(_0x434158,_0x2b29eb){var _0x4198ec={'raw':!![],'where':{'id':_0x434158[_0x0cf3('0x42')]['id']}},_0x3a487c={};_0x3a487c[_0x0cf3('0x30')]=_[_0x0cf3('0x32')](db['DeskField'][_0x0cf3('0x2c')]);_0x3a487c['query']=_['keys'](_0x434158['query']);_0x3a487c[_0x0cf3('0x33')]=_[_0x0cf3('0x34')](_0x3a487c[_0x0cf3('0x30')],_0x3a487c[_0x0cf3('0x31')]);_0x4198ec[_0x0cf3('0x36')]=_[_0x0cf3('0x34')](_0x3a487c['model'],qs[_0x0cf3('0x35')](_0x434158[_0x0cf3('0x31')][_0x0cf3('0x35')]));_0x4198ec[_0x0cf3('0x36')]=_0x4198ec[_0x0cf3('0x36')]['length']?_0x4198ec[_0x0cf3('0x36')]:_0x3a487c[_0x0cf3('0x30')];if(_0x434158[_0x0cf3('0x31')]['includeAll']){_0x4198ec[_0x0cf3('0x43')]=[{'all':!![]}];}_0x4198ec=_[_0x0cf3('0x3d')]({},_0x4198ec,_0x434158[_0x0cf3('0x44')]);return db['DeskField']['find'](_0x4198ec)['then'](handleEntityNotFound(_0x2b29eb,null))[_0x0cf3('0x24')](respondWithResult(_0x2b29eb,null))[_0x0cf3('0x45')](handleError(_0x2b29eb,null));};exports[_0x0cf3('0x46')]=function(_0x2c4819,_0xafeb5){return db['DeskField'][_0x0cf3('0x46')](_0x2c4819[_0x0cf3('0x47')],{})[_0x0cf3('0x24')](respondWithResult(_0xafeb5,0xc9))[_0x0cf3('0x45')](handleError(_0xafeb5,null));};exports['update']=function(_0x533f94,_0x1a3ef1){if(_0x533f94[_0x0cf3('0x47')]['id']){delete _0x533f94[_0x0cf3('0x47')]['id'];}return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x533f94['params']['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x1a3ef1,null))[_0x0cf3('0x24')](saveUpdates(_0x533f94[_0x0cf3('0x47')],null))['then'](respondWithResult(_0x1a3ef1,null))[_0x0cf3('0x45')](handleError(_0x1a3ef1,null));};exports[_0x0cf3('0x23')]=function(_0x270a59,_0x4eb29a){return db[_0x0cf3('0x2b')][_0x0cf3('0x48')]({'where':{'id':_0x270a59[_0x0cf3('0x42')]['id']}})[_0x0cf3('0x24')](handleEntityNotFound(_0x4eb29a,null))['then'](removeEntity(_0x4eb29a,null))[_0x0cf3('0x45')](handleError(_0x4eb29a,null));}; \ No newline at end of file +var _0xacd0=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','status','error','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x46c91d,_0x1c57a5){var _0x8d029e=function(_0xfa581f){while(--_0xfa581f){_0x46c91d['push'](_0x46c91d['shift']());}};_0x8d029e(++_0x1c57a5);}(_0xacd0,0xc9));var _0x0acd=function(_0x177e72,_0x28bf32){_0x177e72=_0x177e72-0x0;var _0x392698=_0xacd0[_0x177e72];return _0x392698;};'use strict';var emlformat=require(_0x0acd('0x0'));var rimraf=require(_0x0acd('0x1'));var zipdir=require(_0x0acd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0acd('0x3'));var moment=require('moment');var BPromise=require(_0x0acd('0x4'));var Mustache=require('mustache');var util=require(_0x0acd('0x5'));var path=require('path');var sox=require(_0x0acd('0x6'));var csv=require(_0x0acd('0x7'));var ejs=require(_0x0acd('0x8'));var fs=require('fs');var fs_extra=require(_0x0acd('0x9'));var _=require(_0x0acd('0xa'));var squel=require(_0x0acd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0acd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0acd('0xd'));var Papa=require(_0x0acd('0xe'));var Redis=require('ioredis');var authService=require(_0x0acd('0xf'));var qs=require(_0x0acd('0x10'));var as=require(_0x0acd('0x11'));var hardwareService=require(_0x0acd('0x12'));var logger=require(_0x0acd('0x13'))(_0x0acd('0x14'));var utils=require('../../config/utils');var config=require(_0x0acd('0x15'));var licenseUtil=require(_0x0acd('0x16'));var db=require(_0x0acd('0x17'))['db'];function respondWithStatusCode(_0x42083a,_0x53d921){_0x53d921=_0x53d921||0xcc;return function(_0xbd1a54){if(_0xbd1a54){return _0x42083a[_0x0acd('0x18')](_0x53d921);}return _0x42083a['status'](_0x53d921)[_0x0acd('0x19')]();};}function respondWithResult(_0x232c56,_0x10d812){_0x10d812=_0x10d812||0xc8;return function(_0xc8c76c){if(_0xc8c76c){return _0x232c56['status'](_0x10d812)['json'](_0xc8c76c);}};}function respondWithFilteredResult(_0xa03d02,_0x1ace4f){return function(_0x204eab){if(_0x204eab){var _0x1dec38=typeof _0x1ace4f[_0x0acd('0x1a')]===_0x0acd('0x1b')&&typeof _0x1ace4f[_0x0acd('0x1c')]===_0x0acd('0x1b');var _0x48329a=_0x204eab['count'];var _0x22713e=_0x1dec38?0x0:_0x1ace4f['offset'];var _0x5b25e5=_0x1dec38?_0x204eab[_0x0acd('0x1d')]:_0x1ace4f[_0x0acd('0x1a')]+_0x1ace4f[_0x0acd('0x1c')];var _0x793185;if(_0x5b25e5>=_0x48329a){_0x5b25e5=_0x48329a;_0x793185=0xc8;}else{_0x793185=0xce;}_0xa03d02['status'](_0x793185);return _0xa03d02[_0x0acd('0x1e')](_0x0acd('0x1f'),_0x22713e+'-'+_0x5b25e5+'/'+_0x48329a)['json'](_0x204eab);}return null;};}function patchUpdates(_0x5e85c1){return function(_0x308000){try{jsonpatch[_0x0acd('0x20')](_0x308000,_0x5e85c1,!![]);}catch(_0x23f8bc){return BPromise[_0x0acd('0x21')](_0x23f8bc);}return _0x308000[_0x0acd('0x22')]();};}function saveUpdates(_0x17bf1c,_0x3acb0c){return function(_0x96c087){if(_0x96c087){return _0x96c087[_0x0acd('0x23')](_0x17bf1c)['then'](function(_0x5f04be){return _0x5f04be;});}return null;};}function removeEntity(_0x1c8094,_0x45dd0b){return function(_0x28f014){if(_0x28f014){return _0x28f014[_0x0acd('0x24')]()[_0x0acd('0x25')](function(){_0x1c8094[_0x0acd('0x26')](0xcc)[_0x0acd('0x19')]();});}};}function handleEntityNotFound(_0x22d2ce,_0x46040d){return function(_0x2f5cf5){if(!_0x2f5cf5){_0x22d2ce[_0x0acd('0x18')](0x194);}return _0x2f5cf5;};}function handleError(_0x55260a,_0x139da9){_0x139da9=_0x139da9||0x1f4;return function(_0x446328){logger[_0x0acd('0x27')](_0x446328['stack']);if(_0x446328['name']){delete _0x446328[_0x0acd('0x28')];}_0x55260a['status'](_0x139da9)[_0x0acd('0x29')](_0x446328);};}exports['index']=function(_0x18f5f6,_0x171b81){var _0x4fdb68={},_0x43ec88={},_0x353808={'count':0x0,'rows':[]};var _0x35d29e=_[_0x0acd('0x2a')](db[_0x0acd('0x2b')][_0x0acd('0x2c')],function(_0x38070e){return{'name':_0x38070e[_0x0acd('0x2d')],'type':_0x38070e[_0x0acd('0x2e')]['key']};});_0x43ec88[_0x0acd('0x2f')]=_['map'](_0x35d29e,_0x0acd('0x28'));_0x43ec88[_0x0acd('0x30')]=_[_0x0acd('0x31')](_0x18f5f6[_0x0acd('0x30')]);_0x43ec88[_0x0acd('0x32')]=_[_0x0acd('0x33')](_0x43ec88[_0x0acd('0x2f')],_0x43ec88[_0x0acd('0x30')]);_0x4fdb68[_0x0acd('0x34')]=_['intersection'](_0x43ec88[_0x0acd('0x2f')],qs[_0x0acd('0x35')](_0x18f5f6['query'][_0x0acd('0x35')]));_0x4fdb68[_0x0acd('0x34')]=_0x4fdb68[_0x0acd('0x34')][_0x0acd('0x36')]?_0x4fdb68[_0x0acd('0x34')]:_0x43ec88[_0x0acd('0x2f')];if(!_0x18f5f6['query'][_0x0acd('0x37')](_0x0acd('0x38'))){_0x4fdb68['limit']=qs[_0x0acd('0x1c')](_0x18f5f6[_0x0acd('0x30')][_0x0acd('0x1c')]);_0x4fdb68[_0x0acd('0x1a')]=qs[_0x0acd('0x1a')](_0x18f5f6[_0x0acd('0x30')][_0x0acd('0x1a')]);}_0x4fdb68['order']=qs[_0x0acd('0x39')](_0x18f5f6['query'][_0x0acd('0x39')]);_0x4fdb68['where']=qs[_0x0acd('0x32')](_[_0x0acd('0x3a')](_0x18f5f6[_0x0acd('0x30')],_0x43ec88[_0x0acd('0x32')]),_0x35d29e);if(_0x18f5f6['query'][_0x0acd('0x3b')]){_0x4fdb68[_0x0acd('0x3c')]=_['merge'](_0x4fdb68[_0x0acd('0x3c')],{'$or':_[_0x0acd('0x2a')](_0x35d29e,function(_0x1a1b55){if(_0x1a1b55['type']!==_0x0acd('0x3d')){var _0x5b65cb={};_0x5b65cb[_0x1a1b55['name']]={'$like':'%'+_0x18f5f6[_0x0acd('0x30')][_0x0acd('0x3b')]+'%'};return _0x5b65cb;}})});}_0x4fdb68=_[_0x0acd('0x3e')]({},_0x4fdb68,_0x18f5f6['options']);var _0x4f8843={'where':_0x4fdb68[_0x0acd('0x3c')]};return db['DeskField'][_0x0acd('0x1d')](_0x4f8843)[_0x0acd('0x25')](function(_0x475b40){_0x353808[_0x0acd('0x1d')]=_0x475b40;if(_0x18f5f6[_0x0acd('0x30')][_0x0acd('0x3f')]){_0x4fdb68[_0x0acd('0x40')]=[{'all':!![]}];}return db['DeskField'][_0x0acd('0x41')](_0x4fdb68);})[_0x0acd('0x25')](function(_0x3e52fe){_0x353808[_0x0acd('0x42')]=_0x3e52fe;return _0x353808;})[_0x0acd('0x25')](respondWithFilteredResult(_0x171b81,_0x4fdb68))['catch'](handleError(_0x171b81,null));};exports[_0x0acd('0x43')]=function(_0x3838f0,_0x30c591){var _0x4cb0b2={'raw':!![],'where':{'id':_0x3838f0['params']['id']}},_0x1200c4={};_0x1200c4[_0x0acd('0x2f')]=_['keys'](db[_0x0acd('0x2b')]['rawAttributes']);_0x1200c4[_0x0acd('0x30')]=_[_0x0acd('0x31')](_0x3838f0[_0x0acd('0x30')]);_0x1200c4['filters']=_[_0x0acd('0x33')](_0x1200c4[_0x0acd('0x2f')],_0x1200c4['query']);_0x4cb0b2[_0x0acd('0x34')]=_[_0x0acd('0x33')](_0x1200c4['model'],qs[_0x0acd('0x35')](_0x3838f0['query']['fields']));_0x4cb0b2[_0x0acd('0x34')]=_0x4cb0b2[_0x0acd('0x34')][_0x0acd('0x36')]?_0x4cb0b2[_0x0acd('0x34')]:_0x1200c4['model'];if(_0x3838f0[_0x0acd('0x30')][_0x0acd('0x3f')]){_0x4cb0b2[_0x0acd('0x40')]=[{'all':!![]}];}_0x4cb0b2=_[_0x0acd('0x3e')]({},_0x4cb0b2,_0x3838f0[_0x0acd('0x44')]);return db[_0x0acd('0x2b')][_0x0acd('0x45')](_0x4cb0b2)['then'](handleEntityNotFound(_0x30c591,null))[_0x0acd('0x25')](respondWithResult(_0x30c591,null))[_0x0acd('0x46')](handleError(_0x30c591,null));};exports[_0x0acd('0x47')]=function(_0x31f2cf,_0x3ab91f){return db['DeskField'][_0x0acd('0x47')](_0x31f2cf['body'],{})[_0x0acd('0x25')](respondWithResult(_0x3ab91f,0xc9))[_0x0acd('0x46')](handleError(_0x3ab91f,null));};exports[_0x0acd('0x23')]=function(_0x23e64d,_0x5abe43){if(_0x23e64d[_0x0acd('0x48')]['id']){delete _0x23e64d['body']['id'];}return db[_0x0acd('0x2b')][_0x0acd('0x45')]({'where':{'id':_0x23e64d[_0x0acd('0x49')]['id']}})[_0x0acd('0x25')](handleEntityNotFound(_0x5abe43,null))[_0x0acd('0x25')](saveUpdates(_0x23e64d[_0x0acd('0x48')],null))[_0x0acd('0x25')](respondWithResult(_0x5abe43,null))[_0x0acd('0x46')](handleError(_0x5abe43,null));};exports[_0x0acd('0x24')]=function(_0x1d20d6,_0x74c42d){return db[_0x0acd('0x2b')][_0x0acd('0x45')]({'where':{'id':_0x1d20d6['params']['id']}})[_0x0acd('0x25')](handleEntityNotFound(_0x74c42d,null))[_0x0acd('0x25')](removeEntity(_0x74c42d,null))['catch'](handleError(_0x74c42d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index adb86ee..b4ef858 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 _0xc84a=['FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField'];(function(_0x1f7f53,_0x349898){var _0x80c7d=function(_0x225af0){while(--_0x225af0){_0x1f7f53['push'](_0x1f7f53['shift']());}};_0x80c7d(++_0x349898);}(_0xc84a,0x13c));var _0xac84=function(_0x1f373e,_0x529f26){_0x1f373e=_0x1f373e-0x0;var _0x499e3c=_0xc84a[_0x1f373e];return _0x499e3c;};'use strict';var _=require(_0xac84('0x0'));var util=require(_0xac84('0x1'));var logger=require('../../config/logger')(_0xac84('0x2'));var moment=require(_0xac84('0x3'));var BPromise=require('bluebird');var rp=require(_0xac84('0x4'));var fs=require('fs');var path=require(_0xac84('0x5'));var rimraf=require(_0xac84('0x6'));var config=require(_0xac84('0x7'));var attributes=require(_0xac84('0x8'));module[_0xac84('0x9')]=function(_0x4d1cb1,_0x261e07){return _0x4d1cb1[_0xac84('0xa')](_0xac84('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xac84('0xc'),'fields':[_0xac84('0xd'),_0xac84('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa430=['./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3c514f,_0x1729c7){var _0x33b908=function(_0x5bdf77){while(--_0x5bdf77){_0x3c514f['push'](_0x3c514f['shift']());}};_0x33b908(++_0x1729c7);}(_0xa430,0x1e5));var _0x0a43=function(_0x3157bf,_0x1cb17b){_0x3157bf=_0x3157bf-0x0;var _0x13db51=_0xa430[_0x3157bf];return _0x13db51;};'use strict';var _=require(_0x0a43('0x0'));var util=require('util');var logger=require(_0x0a43('0x1'))(_0x0a43('0x2'));var moment=require(_0x0a43('0x3'));var BPromise=require(_0x0a43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a43('0x5'));var rimraf=require(_0x0a43('0x6'));var config=require('../../config/environment');var attributes=require(_0x0a43('0x7'));module['exports']=function(_0x22a729,_0x5c7413){return _0x22a729['define'](_0x0a43('0x8'),attributes,{'tableName':_0x0a43('0x9'),'paranoid':![],'indexes':[{'name':_0x0a43('0xa'),'fields':[_0x0a43('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index b21279b..a27399a 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 _0xe022=['../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c2e87,_0x53bba1){var _0x11932a=function(_0x2bdbb6){while(--_0x2bdbb6){_0x5c2e87['push'](_0x5c2e87['shift']());}};_0x11932a(++_0x53bba1);}(_0xe022,0x70));var _0x2e02=function(_0xbd998a,_0x17fb80){_0xbd998a=_0xbd998a-0x0;var _0x2d2709=_0xe022[_0xbd998a];return _0x2d2709;};'use strict';var _=require(_0x2e02('0x0'));var util=require(_0x2e02('0x1'));var moment=require(_0x2e02('0x2'));var BPromise=require(_0x2e02('0x3'));var rs=require(_0x2e02('0x4'));var fs=require('fs');var Redis=require(_0x2e02('0x5'));var db=require(_0x2e02('0x6'))['db'];var utils=require(_0x2e02('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2e02('0x8'));var jayson=require(_0x2e02('0x9'));var client=jayson[_0x2e02('0xa')][_0x2e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52687b,_0x4b328d,_0x11703e){return new BPromise(function(_0x321371,_0x524199){return client[_0x2e02('0xc')](_0x52687b,_0x11703e)[_0x2e02('0xd')](function(_0xbb30f9){logger[_0x2e02('0xe')](_0x2e02('0xf'),_0x4b328d,_0x2e02('0x10'));logger['debug'](_0x2e02('0x11'),_0x4b328d,_0x2e02('0x10'),JSON[_0x2e02('0x12')](_0xbb30f9));if(_0xbb30f9[_0x2e02('0x13')]){if(_0xbb30f9[_0x2e02('0x13')][_0x2e02('0x14')]===0x1f4){logger[_0x2e02('0x13')]('DeskField,\x20%s,\x20%s',_0x4b328d,_0xbb30f9[_0x2e02('0x13')][_0x2e02('0x15')]);return _0x524199(_0xbb30f9[_0x2e02('0x13')][_0x2e02('0x15')]);}logger['error'](_0x2e02('0xf'),_0x4b328d,_0xbb30f9[_0x2e02('0x13')][_0x2e02('0x15')]);return _0x321371(_0xbb30f9[_0x2e02('0x13')][_0x2e02('0x15')]);}else{logger[_0x2e02('0xe')](_0x2e02('0xf'),_0x4b328d,_0x2e02('0x10'));_0x321371(_0xbb30f9[_0x2e02('0x16')]['message']);}})[_0x2e02('0x17')](function(_0x4da3d9){logger['error'](_0x2e02('0xf'),_0x4b328d,_0x4da3d9);_0x524199(_0x4da3d9);});});} \ No newline at end of file +var _0x4cd6=['client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3ca4b1,_0x313fdc){var _0x235ebb=function(_0x34c341){while(--_0x34c341){_0x3ca4b1['push'](_0x3ca4b1['shift']());}};_0x235ebb(++_0x313fdc);}(_0x4cd6,0x1c2));var _0x64cd=function(_0x491631,_0x50ed39){_0x491631=_0x491631-0x0;var _0x18a693=_0x4cd6[_0x491631];return _0x18a693;};'use strict';var _=require(_0x64cd('0x0'));var util=require(_0x64cd('0x1'));var moment=require(_0x64cd('0x2'));var BPromise=require(_0x64cd('0x3'));var rs=require(_0x64cd('0x4'));var fs=require('fs');var Redis=require(_0x64cd('0x5'));var db=require(_0x64cd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x64cd('0x7'))('rpc');var config=require(_0x64cd('0x8'));var jayson=require(_0x64cd('0x9'));var client=jayson[_0x64cd('0xa')][_0x64cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5132c2,_0x18aa98,_0x1dc990){return new BPromise(function(_0x2add62,_0x4c0410){return client[_0x64cd('0xc')](_0x5132c2,_0x1dc990)[_0x64cd('0xd')](function(_0x49b682){logger[_0x64cd('0xe')](_0x64cd('0xf'),_0x18aa98,_0x64cd('0x10'));logger[_0x64cd('0x11')](_0x64cd('0x12'),_0x18aa98,_0x64cd('0x10'),JSON['stringify'](_0x49b682));if(_0x49b682['error']){if(_0x49b682[_0x64cd('0x13')][_0x64cd('0x14')]===0x1f4){logger[_0x64cd('0x13')](_0x64cd('0xf'),_0x18aa98,_0x49b682[_0x64cd('0x13')][_0x64cd('0x15')]);return _0x4c0410(_0x49b682[_0x64cd('0x13')][_0x64cd('0x15')]);}logger[_0x64cd('0x13')](_0x64cd('0xf'),_0x18aa98,_0x49b682['error']['message']);return _0x2add62(_0x49b682[_0x64cd('0x13')][_0x64cd('0x15')]);}else{logger['info'](_0x64cd('0xf'),_0x18aa98,_0x64cd('0x10'));_0x2add62(_0x49b682[_0x64cd('0x16')][_0x64cd('0x15')]);}})['catch'](function(_0x2a1fd4){logger[_0x64cd('0x13')](_0x64cd('0xf'),_0x18aa98,_0x2a1fd4);_0x4c0410(_0x2a1fd4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 0458783..a66d8c6 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 _0x2ace=['exports','util','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x2ace,0x190));var _0xe2ac=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x2ace[_0x3a2e49];return _0x257140;};'use strict';var multer=require('multer');var util=require(_0xe2ac('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe2ac('0x1'));var router=express[_0xe2ac('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe2ac('0x3'));var interaction=require(_0xe2ac('0x4'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe2ac('0x5')]);router[_0xe2ac('0x6')](_0xe2ac('0x7'),auth[_0xe2ac('0x8')](),controller[_0xe2ac('0x9')]);router[_0xe2ac('0x6')](_0xe2ac('0xa'),auth[_0xe2ac('0x8')](),controller[_0xe2ac('0xb')]);router[_0xe2ac('0x6')](_0xe2ac('0xc'),auth[_0xe2ac('0x8')](),controller['getFields']);router[_0xe2ac('0xd')]('/',auth[_0xe2ac('0x8')](),controller[_0xe2ac('0xe')]);router['post'](_0xe2ac('0xa'),auth[_0xe2ac('0x8')](),controller[_0xe2ac('0xf')]);router[_0xe2ac('0x10')](_0xe2ac('0x7'),auth[_0xe2ac('0x8')](),controller[_0xe2ac('0x11')]);router[_0xe2ac('0x12')]('/:id',auth[_0xe2ac('0x8')](),controller[_0xe2ac('0x13')]);module[_0xe2ac('0x14')]=router; \ No newline at end of file +var _0xcf17=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','delete'];(function(_0x2abeee,_0x1d7879){var _0x17929b=function(_0x3e54c9){while(--_0x3e54c9){_0x2abeee['push'](_0x2abeee['shift']());}};_0x17929b(++_0x1d7879);}(_0xcf17,0xb1));var _0x7cf1=function(_0x50d418,_0xc3f0a6){_0x50d418=_0x50d418-0x0;var _0x233647=_0xcf17[_0x50d418];return _0x233647;};'use strict';var multer=require(_0x7cf1('0x0'));var util=require(_0x7cf1('0x1'));var path=require(_0x7cf1('0x2'));var timeout=require(_0x7cf1('0x3'));var express=require(_0x7cf1('0x4'));var router=express[_0x7cf1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7cf1('0x6'));var interaction=require(_0x7cf1('0x7'));var config=require(_0x7cf1('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x7cf1('0x9')]('/',auth[_0x7cf1('0xa')](),controller['index']);router[_0x7cf1('0x9')](_0x7cf1('0xb'),auth['isAuthenticated'](),controller[_0x7cf1('0xc')]);router[_0x7cf1('0x9')](_0x7cf1('0xd'),auth[_0x7cf1('0xa')](),controller[_0x7cf1('0xe')]);router['get'](_0x7cf1('0xf'),auth[_0x7cf1('0xa')](),controller[_0x7cf1('0x10')]);router[_0x7cf1('0x11')]('/',auth[_0x7cf1('0xa')](),controller[_0x7cf1('0x12')]);router[_0x7cf1('0x11')](_0x7cf1('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x7cf1('0xb'),auth[_0x7cf1('0xa')](),controller[_0x7cf1('0x13')]);router[_0x7cf1('0x14')](_0x7cf1('0xb'),auth[_0x7cf1('0xa')](),controller[_0x7cf1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 839929a..4c193f9 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 _0x240b=['STRING'];(function(_0x539724,_0x555dd1){var _0x51b522=function(_0x2aa9c4){while(--_0x2aa9c4){_0x539724['push'](_0x539724['shift']());}};_0x51b522(++_0x555dd1);}(_0x240b,0x19e));var _0xb240=function(_0x23f6ba,_0x42f22e){_0x23f6ba=_0x23f6ba-0x0;var _0x1d1df4=_0x240b[_0x23f6ba];return _0x1d1df4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb240('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb240('0x0')]},'remoteUri':{'type':Sequelize[_0xb240('0x0')]},'tenantId':{'type':Sequelize[_0xb240('0x0')]},'clientId':{'type':Sequelize[_0xb240('0x0')]},'clientSecret':{'type':Sequelize[_0xb240('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5477=['STRING','exports'];(function(_0x2456b0,_0x38ef24){var _0xbd99e2=function(_0x4e4e31){while(--_0x4e4e31){_0x2456b0['push'](_0x2456b0['shift']());}};_0xbd99e2(++_0x38ef24);}(_0x5477,0x1eb));var _0x7547=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x5477[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0x7547('0x0')]={'name':{'type':Sequelize[_0x7547('0x1')]},'username':{'type':Sequelize[_0x7547('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7547('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x7547('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7547('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7547('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index b103253..c3dc130 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 _0xad53=['modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','clientSecret','slice','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','MetadataId','forEach','isNil','substring','lastIndexOf','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','error','stack','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','name','index','map','Dynamics365Account','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','create','Subjects','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','influencescore','modifiedbyexternalpartyyominame','modifiedbyname'];(function(_0x4d459f,_0x39cf57){var _0x2d4882=function(_0x4bb830){while(--_0x4bb830){_0x4d459f['push'](_0x4d459f['shift']());}};_0x2d4882(++_0x39cf57);}(_0xad53,0x1ea));var _0x3ad5=function(_0x455c44,_0x490d0a){_0x455c44=_0x455c44-0x0;var _0x5be916=_0xad53[_0x455c44];return _0x5be916;};'use strict';var emlformat=require(_0x3ad5('0x0'));var rimraf=require(_0x3ad5('0x1'));var zipdir=require(_0x3ad5('0x2'));var jsonpatch=require(_0x3ad5('0x3'));var rp=require(_0x3ad5('0x4'));var moment=require(_0x3ad5('0x5'));var BPromise=require(_0x3ad5('0x6'));var Mustache=require(_0x3ad5('0x7'));var util=require('util');var path=require(_0x3ad5('0x8'));var sox=require(_0x3ad5('0x9'));var csv=require(_0x3ad5('0xa'));var ejs=require(_0x3ad5('0xb'));var fs=require('fs');var fs_extra=require(_0x3ad5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ad5('0xd'));var deskjs=require(_0x3ad5('0xe'));var toCsv=require(_0x3ad5('0xa'));var querystring=require(_0x3ad5('0xf'));var Papa=require(_0x3ad5('0x10'));var Redis=require(_0x3ad5('0x11'));var authService=require(_0x3ad5('0x12'));var qs=require(_0x3ad5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ad5('0x14'));var logger=require(_0x3ad5('0x15'))(_0x3ad5('0x16'));var utils=require(_0x3ad5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3ad5('0x18'));var db=require(_0x3ad5('0x19'))['db'];var integrations=require(_0x3ad5('0x1a'));function respondWithStatusCode(_0x542e82,_0x1bd82f){_0x1bd82f=_0x1bd82f||0xcc;return function(_0xfbc961){if(_0xfbc961){return _0x542e82[_0x3ad5('0x1b')](_0x1bd82f);}return _0x542e82[_0x3ad5('0x1c')](_0x1bd82f)[_0x3ad5('0x1d')]();};}function respondWithResult(_0x28d6ad,_0x50758e){_0x50758e=_0x50758e||0xc8;return function(_0x5bdecb){if(_0x5bdecb){return _0x28d6ad[_0x3ad5('0x1c')](_0x50758e)[_0x3ad5('0x1e')](_0x5bdecb);}};}function respondWithFilteredResult(_0xabcbc0,_0x70aec9){return function(_0x1d5868){if(_0x1d5868){var _0x365f38=typeof _0x70aec9['offset']==='undefined'&&typeof _0x70aec9[_0x3ad5('0x1f')]===_0x3ad5('0x20');var _0x5df744=_0x1d5868['count'];var _0x445741=_0x365f38?0x0:_0x70aec9[_0x3ad5('0x21')];var _0x179cda=_0x365f38?_0x1d5868[_0x3ad5('0x22')]:_0x70aec9['offset']+_0x70aec9[_0x3ad5('0x1f')];var _0x36780a;if(_0x179cda>=_0x5df744){_0x179cda=_0x5df744;_0x36780a=0xc8;}else{_0x36780a=0xce;}_0xabcbc0[_0x3ad5('0x1c')](_0x36780a);return _0xabcbc0[_0x3ad5('0x23')](_0x3ad5('0x24'),_0x445741+'-'+_0x179cda+'/'+_0x5df744)[_0x3ad5('0x1e')](_0x1d5868);}return null;};}function patchUpdates(_0x3aaef8){return function(_0x3a8960){try{jsonpatch[_0x3ad5('0x25')](_0x3a8960,_0x3aaef8,!![]);}catch(_0x5721e8){return BPromise[_0x3ad5('0x26')](_0x5721e8);}return _0x3a8960['save']();};}function saveUpdates(_0x936a29,_0x58a06f){return function(_0x88a840){if(_0x88a840){return _0x88a840[_0x3ad5('0x27')](_0x936a29)[_0x3ad5('0x28')](function(_0xeaf8f7){return _0xeaf8f7;});}return null;};}function removeEntity(_0x24d2ee,_0x26b402){return function(_0x4c59dc){if(_0x4c59dc){return _0x4c59dc[_0x3ad5('0x29')]()[_0x3ad5('0x28')](function(){_0x24d2ee['status'](0xcc)[_0x3ad5('0x1d')]();});}};}function handleEntityNotFound(_0x24f7e1,_0x42c242){return function(_0x494adf){if(!_0x494adf){_0x24f7e1[_0x3ad5('0x1b')](0x194);}return _0x494adf;};}function handleError(_0x429ea6,_0x40da5d){_0x40da5d=_0x40da5d||0x1f4;return function(_0x4d73b1){logger['error'](_0x4d73b1['stack']);if(_0x4d73b1[_0x3ad5('0x2a')]){delete _0x4d73b1[_0x3ad5('0x2a')];}_0x429ea6[_0x3ad5('0x1c')](_0x40da5d)['send'](_0x4d73b1);};}exports[_0x3ad5('0x2b')]=function(_0x1724fc,_0x489de6){var _0x4c66f7={},_0x2a402c={},_0x5c2d1e={'count':0x0,'rows':[]};var _0x180729=_[_0x3ad5('0x2c')](db[_0x3ad5('0x2d')][_0x3ad5('0x2e')],function(_0x1fb6f3){return{'name':_0x1fb6f3['fieldName'],'type':_0x1fb6f3['type'][_0x3ad5('0x2f')]};});_0x2a402c[_0x3ad5('0x30')]=_[_0x3ad5('0x2c')](_0x180729,_0x3ad5('0x2a'));_0x2a402c['query']=_[_0x3ad5('0x31')](_0x1724fc[_0x3ad5('0x32')]);_0x2a402c[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x2a402c[_0x3ad5('0x30')],_0x2a402c[_0x3ad5('0x32')]);_0x4c66f7[_0x3ad5('0x35')]=_[_0x3ad5('0x34')](_0x2a402c[_0x3ad5('0x30')],qs[_0x3ad5('0x36')](_0x1724fc['query'][_0x3ad5('0x36')]));_0x4c66f7[_0x3ad5('0x35')]=_0x4c66f7[_0x3ad5('0x35')][_0x3ad5('0x37')]?_0x4c66f7[_0x3ad5('0x35')]:_0x2a402c[_0x3ad5('0x30')];if(!_0x1724fc[_0x3ad5('0x32')]['hasOwnProperty']('nolimit')){_0x4c66f7[_0x3ad5('0x1f')]=qs[_0x3ad5('0x1f')](_0x1724fc['query'][_0x3ad5('0x1f')]);_0x4c66f7[_0x3ad5('0x21')]=qs[_0x3ad5('0x21')](_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x21')]);}_0x4c66f7[_0x3ad5('0x38')]=qs[_0x3ad5('0x39')](_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x39')]);_0x4c66f7[_0x3ad5('0x3a')]=qs[_0x3ad5('0x33')](_[_0x3ad5('0x3b')](_0x1724fc[_0x3ad5('0x32')],_0x2a402c['filters']),_0x180729);if(_0x1724fc[_0x3ad5('0x32')]['filter']){_0x4c66f7[_0x3ad5('0x3a')]=_[_0x3ad5('0x3c')](_0x4c66f7[_0x3ad5('0x3a')],{'$or':_[_0x3ad5('0x2c')](_0x180729,function(_0x1d9393){if(_0x1d9393[_0x3ad5('0x3d')]!==_0x3ad5('0x3e')){var _0x4a462f={};_0x4a462f[_0x1d9393['name']]={'$like':'%'+_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x3f')]+'%'};return _0x4a462f;}})});}_0x4c66f7=_[_0x3ad5('0x3c')]({},_0x4c66f7,_0x1724fc[_0x3ad5('0x40')]);var _0x35e090={'where':_0x4c66f7[_0x3ad5('0x3a')]};return db[_0x3ad5('0x2d')][_0x3ad5('0x22')](_0x35e090)[_0x3ad5('0x28')](function(_0x135fa0){_0x5c2d1e[_0x3ad5('0x22')]=_0x135fa0;if(_0x1724fc[_0x3ad5('0x32')][_0x3ad5('0x41')]){_0x4c66f7[_0x3ad5('0x42')]=[{'all':!![]}];}return db[_0x3ad5('0x2d')][_0x3ad5('0x43')](_0x4c66f7);})[_0x3ad5('0x28')](function(_0x29726b){_0x5c2d1e['rows']=_0x29726b;return _0x5c2d1e;})['then'](respondWithFilteredResult(_0x489de6,_0x4c66f7))[_0x3ad5('0x44')](handleError(_0x489de6,null));};exports[_0x3ad5('0x45')]=function(_0x550c1c,_0x6a73f3){var _0x47f797={'raw':![],'where':{'id':_0x550c1c[_0x3ad5('0x46')]['id']}},_0x543529={};_0x543529[_0x3ad5('0x30')]=_[_0x3ad5('0x31')](db[_0x3ad5('0x2d')][_0x3ad5('0x2e')]);_0x543529[_0x3ad5('0x32')]=_[_0x3ad5('0x31')](_0x550c1c['query']);_0x543529[_0x3ad5('0x33')]=_[_0x3ad5('0x34')](_0x543529[_0x3ad5('0x30')],_0x543529[_0x3ad5('0x32')]);_0x47f797[_0x3ad5('0x35')]=_['intersection'](_0x543529[_0x3ad5('0x30')],qs[_0x3ad5('0x36')](_0x550c1c[_0x3ad5('0x32')][_0x3ad5('0x36')]));_0x47f797['attributes']=_0x47f797['attributes']['length']?_0x47f797[_0x3ad5('0x35')]:_0x543529[_0x3ad5('0x30')];if(_0x550c1c[_0x3ad5('0x32')][_0x3ad5('0x41')]){_0x47f797['include']=[{'all':!![]}];}_0x47f797=_['merge']({},_0x47f797,_0x550c1c[_0x3ad5('0x40')]);return db[_0x3ad5('0x2d')][_0x3ad5('0x47')](_0x47f797)['then'](handleEntityNotFound(_0x6a73f3,null))[_0x3ad5('0x28')](respondWithResult(_0x6a73f3,null))[_0x3ad5('0x44')](handleError(_0x6a73f3,null));};exports['create']=function(_0x26acf4,_0x31f25c){return db[_0x3ad5('0x2d')]['create'](_0x26acf4['body'],{})[_0x3ad5('0x28')](respondWithResult(_0x31f25c,0xc9))['catch'](handleError(_0x31f25c,null));};exports[_0x3ad5('0x27')]=function(_0x5351d9,_0x2efc15){if(_0x5351d9[_0x3ad5('0x48')]['id']){delete _0x5351d9['body']['id'];}return db[_0x3ad5('0x2d')][_0x3ad5('0x47')]({'where':{'id':_0x5351d9[_0x3ad5('0x46')]['id']}})['then'](handleEntityNotFound(_0x2efc15,null))['then'](saveUpdates(_0x5351d9[_0x3ad5('0x48')],null))[_0x3ad5('0x28')](respondWithResult(_0x2efc15,null))[_0x3ad5('0x44')](handleError(_0x2efc15,null));};exports[_0x3ad5('0x29')]=function(_0x1b423c,_0x4e82c0){return db[_0x3ad5('0x2d')][_0x3ad5('0x47')]({'where':{'id':_0x1b423c['params']['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x4e82c0,null))['then'](removeEntity(_0x4e82c0,null))[_0x3ad5('0x44')](handleError(_0x4e82c0,null));};exports[_0x3ad5('0x49')]=function(_0x28ca27,_0x13f65b,_0x38634a){var _0x204bae={};var _0x386f76={};var _0x3b4609;var _0x4506f6;return db[_0x3ad5('0x2d')]['findOne']({'where':{'id':_0x28ca27[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x13f65b,null))['then'](function(_0x137b1d){if(_0x137b1d){_0x3b4609=_0x137b1d;_0x386f76['model']=_[_0x3ad5('0x31')](db['Dynamics365Configuration'][_0x3ad5('0x2e')]);_0x386f76[_0x3ad5('0x32')]=_['keys'](_0x28ca27[_0x3ad5('0x32')]);_0x386f76['filters']=_[_0x3ad5('0x34')](_0x386f76[_0x3ad5('0x30')],_0x386f76[_0x3ad5('0x32')]);_0x204bae['attributes']=_[_0x3ad5('0x34')](_0x386f76['model'],qs[_0x3ad5('0x36')](_0x28ca27['query'][_0x3ad5('0x36')]));_0x204bae[_0x3ad5('0x35')]=_0x204bae[_0x3ad5('0x35')][_0x3ad5('0x37')]?_0x204bae['attributes']:_0x386f76['model'];_0x204bae[_0x3ad5('0x38')]=qs[_0x3ad5('0x39')](_0x28ca27[_0x3ad5('0x32')]['sort']);_0x204bae['where']=qs[_0x3ad5('0x33')](_[_0x3ad5('0x3b')](_0x28ca27[_0x3ad5('0x32')],_0x386f76[_0x3ad5('0x33')]));if(_0x28ca27['query'][_0x3ad5('0x3f')]){_0x204bae[_0x3ad5('0x3a')]=_[_0x3ad5('0x3c')](_0x204bae[_0x3ad5('0x3a')],{'$or':_[_0x3ad5('0x2c')](_0x204bae[_0x3ad5('0x35')],function(_0x5b5845){var _0x49bb31={};_0x49bb31[_0x5b5845]={'$like':'%'+_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x3f')]+'%'};return _0x49bb31;})});}_0x204bae=_[_0x3ad5('0x3c')]({},_0x204bae,_0x28ca27['options']);return _0x3b4609['getConfigurations'](_0x204bae);}})['then'](function(_0x4b321e){if(_0x4b321e){_0x4506f6=_0x4b321e['length'];if(!_0x28ca27['query'][_0x3ad5('0x4a')]('nolimit')){_0x204bae[_0x3ad5('0x1f')]=qs['limit'](_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x1f')]);_0x204bae[_0x3ad5('0x21')]=qs[_0x3ad5('0x21')](_0x28ca27[_0x3ad5('0x32')][_0x3ad5('0x21')]);}return _0x3b4609['getConfigurations'](_0x204bae);}})[_0x3ad5('0x28')](function(_0x4801cd){if(_0x4801cd){return _0x4801cd?{'count':_0x4506f6,'rows':_0x4801cd}:null;}})['then'](respondWithResult(_0x13f65b,null))['catch'](handleError(_0x13f65b,null));};exports[_0x3ad5('0x4b')]=function(_0x3121d1,_0x24f4fa,_0x15bf13){if(_0x3121d1[_0x3ad5('0x48')]['id']){delete _0x3121d1[_0x3ad5('0x48')]['id'];}return db['Dynamics365Account'][_0x3ad5('0x4c')]({'where':{'id':_0x3121d1[_0x3ad5('0x46')]['id']}})[_0x3ad5('0x28')](handleEntityNotFound(_0x24f4fa,null))[_0x3ad5('0x28')](function(_0x395f10){if(_0x395f10){_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x4d')]=_0x395f10['id'];_0x3121d1[_0x3ad5('0x48')]['Subjects']=integrations[_0x3ad5('0x4e')](_0x3121d1['body'][_0x3ad5('0x4f')],_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x3d')]);_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x50')]=integrations[_0x3ad5('0x51')](_0x3121d1[_0x3ad5('0x48')][_0x3ad5('0x4f')],_0x3121d1['body']['type']);return db[_0x3ad5('0x52')][_0x3ad5('0x53')](_0x3121d1['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x3ad5('0x54')},{'model':db[_0x3ad5('0x55')],'as':_0x3ad5('0x50')}]});}return null;})['then'](respondWithResult(_0x24f4fa,null))[_0x3ad5('0x44')](handleError(_0x24f4fa,null));};exports[_0x3ad5('0x56')]=function(_0x45ace8,_0x50f562,_0x5777df){var _0x41ed33=_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0x57')];var _0x45de70=_0x41ed33===_0x3ad5('0x58')?_0x3ad5('0x59'):_0x3ad5('0x5a');var _0x2d0670='';var _0x269ee1='';var _0x41e409='';var _0x220335='';var _0x6dd459='';var _0x7a08dd='';var _0x473e66='';var _0x35619b='';var _0x2d483b=['title',_0x3ad5('0x5b'),_0x3ad5('0x5c'),'ownerid',_0x3ad5('0x5d'),_0x3ad5('0x5e'),_0x3ad5('0x5f'),_0x3ad5('0x60'),_0x3ad5('0x61'),'phonecall_activity_parties'];var _0x120a09=['accountidname','accountidyominame',_0x3ad5('0x62'),'billedserviceunits',_0x3ad5('0x63'),'contactidyominame',_0x3ad5('0x64'),_0x3ad5('0x65'),_0x3ad5('0x66'),_0x3ad5('0x67'),_0x3ad5('0x68'),'createdbyyominame','createdon',_0x3ad5('0x69'),_0x3ad5('0x6a'),_0x3ad5('0x6b'),_0x3ad5('0x6c'),'customeridyominame',_0x3ad5('0x6d'),_0x3ad5('0x6e'),_0x3ad5('0x6f'),_0x3ad5('0x70'),_0x3ad5('0x71'),_0x3ad5('0x72'),_0x3ad5('0x73'),'followupby','importsequencenumber',_0x3ad5('0x74'),'kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname',_0x3ad5('0x75'),_0x3ad5('0x76'),_0x3ad5('0x77'),_0x3ad5('0x78'),_0x3ad5('0x79'),_0x3ad5('0x7a'),_0x3ad5('0x7b'),_0x3ad5('0x7c'),_0x3ad5('0x7d'),'onholdtime',_0x3ad5('0x7e'),_0x3ad5('0x7f'),_0x3ad5('0x80'),_0x3ad5('0x81'),_0x3ad5('0x82'),_0x3ad5('0x83'),_0x3ad5('0x84'),_0x3ad5('0x85'),_0x3ad5('0x86'),'productserialnumber',_0x3ad5('0x87'),'resolvebykpiidname',_0x3ad5('0x88'),_0x3ad5('0x89'),_0x3ad5('0x8a'),_0x3ad5('0x8b'),_0x3ad5('0x8c'),'slaname','socialprofileidname',_0x3ad5('0x8d'),_0x3ad5('0x8e'),_0x3ad5('0x8f'),_0x3ad5('0x90'),'timezoneruleversionnumber',_0x3ad5('0x91'),_0x3ad5('0x92'),'utcconversiontimezonecode',_0x3ad5('0x93')];var _0xcff7d3=_0x2d483b[_0x3ad5('0x94')](_0x120a09);return db['Dynamics365Account'][_0x3ad5('0x4c')]({'where':{'id':_0x45ace8['params']['id']},'attributes':['id',_0x3ad5('0x95'),_0x3ad5('0x96'),_0x3ad5('0x97'),'tenantId','clientId',_0x3ad5('0x98')]})[_0x3ad5('0x28')](handleEntityNotFound(_0x50f562,null))['then'](function(_0x594b92){if(_0x594b92){_0x35619b=_0x594b92[_0x3ad5('0x97')];var _0x3c007c=_0x35619b[_0x3ad5('0x99')](-0x1);if(_0x3c007c==='/'){_0x35619b=_0x35619b['substring'](0x0,_0x35619b['lastIndexOf'](_0x3c007c));}_0x473e66=util['format'](_0x3ad5('0x9a'),_0x35619b);var _0x1954d4={'method':_0x3ad5('0x9b'),'uri':_0x3ad5('0x9c')+_0x594b92[_0x3ad5('0x9d')]+_0x3ad5('0x9e'),'form':{'client_id':_0x594b92[_0x3ad5('0x9f')],'resource':_0x35619b,'username':_0x594b92[_0x3ad5('0x95')],'password':_0x594b92[_0x3ad5('0x96')],'grant_type':'password','client_secret':_0x594b92[_0x3ad5('0x98')]},'json':!![]};return rp(_0x1954d4);}})[_0x3ad5('0x28')](function(_0x28e800){_0x7a08dd=_0x28e800['access_token'];var _0x595879={'method':_0x3ad5('0xa0'),'uri':encodeURI(_0x473e66+_0x3ad5('0xa1')+_0x45de70+'\x27'),'headers':{'Authorization':_0x3ad5('0xa2')+_0x7a08dd,'If-None-Match':null,'OData-Version':_0x3ad5('0xa3')},'json':!![]};return rp(_0x595879);})[_0x3ad5('0x28')](function(_0x32e899){var _0x372afb=_0x32e899[_0x3ad5('0xa4')][0x0];var _0xa3fe7c=_0x372afb['MetadataId'];var _0x16947f={'method':_0x3ad5('0xa0'),'uri':_0x473e66+_0x3ad5('0xa5')+_0xa3fe7c+_0x3ad5('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x7a08dd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x16947f);})[_0x3ad5('0x28')](function(_0x114b4d){_0x2d0670=_0x114b4d;_0x269ee1=_0x2d0670['Attributes'];_0x269ee1=_[_0x3ad5('0xa7')](_0x269ee1,function(_0x56709e){return!_0xcff7d3[_0x3ad5('0xa8')](_0x56709e[_0x3ad5('0xa9')]);});var _0x1a3f57=[];var _0x16f6e4=[];_0x269ee1['forEach'](function(_0x37c35c){if(_0x37c35c[_0x3ad5('0xaa')]){var _0x52eebb=_0x37c35c['@odata.type']['substring'](_0x37c35c[_0x3ad5('0xaa')]['lastIndexOf']('.')+0x1);if(_0x52eebb===_0x3ad5('0xab')){_0x1a3f57['push'](getSelectList(_0x473e66,_0x41ed33,_0x16f6e4,_0x2d0670['MetadataId'],_0x37c35c[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x1a3f57);})[_0x3ad5('0x28')](function(_0x2a8f1){_0x41e409=_0x2a8f1[0x0];var _0x375747=[];var _0x39b461=[];_0x269ee1[_0x3ad5('0xad')](function(_0x34f6d2){if(!_[_0x3ad5('0xae')](_0x34f6d2[_0x3ad5('0xaa')])){var _0x4c9994=_0x34f6d2[_0x3ad5('0xaa')][_0x3ad5('0xaf')](_0x34f6d2[_0x3ad5('0xaa')][_0x3ad5('0xb0')]('.')+0x1);if(_0x4c9994===_0x3ad5('0xb1')){_0x375747[_0x3ad5('0xb2')](getBooleanList(_0x473e66,_0x41ed33,_0x39b461,_0x2d0670[_0x3ad5('0xac')],_0x34f6d2[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x375747);})[_0x3ad5('0x28')](function(_0x196d83){_0x220335=_0x196d83[0x0];var _0x5c9049=[];var _0x58b706=[];_0x269ee1[_0x3ad5('0xad')](function(_0x55abe3){if(_0x55abe3[_0x3ad5('0xaa')]){var _0x500ace=_0x55abe3[_0x3ad5('0xaa')][_0x3ad5('0xaf')](_0x55abe3['@odata.type'][_0x3ad5('0xb0')]('.')+0x1);if(_0x500ace==='StringAttributeMetadata'||_0x500ace===_0x3ad5('0xb3')||_0x500ace===_0x3ad5('0xb4')||_0x500ace===_0x3ad5('0xb5')||_0x500ace===_0x3ad5('0xb6')||_0x500ace==='DateTimeAttributeMetadata'||_0x500ace===_0x3ad5('0xb7')||_0x500ace===_0x3ad5('0xb8')||_0x500ace===_0x3ad5('0xb9')||_0x500ace==='DecimalAttributeMetadata'){_0x5c9049[_0x3ad5('0xb2')](getInputList(_0x473e66,_0x41ed33,_0x500ace,_0x58b706,_0x2d0670['MetadataId'],_0x55abe3[_0x3ad5('0xac')],_0x7a08dd));}}});return Promise['all'](_0x5c9049);})[_0x3ad5('0x28')](function(_0x373818){_0x6dd459=_0x373818[0x0];var _0x2c06ac=_0x41e409[_0x3ad5('0x94')](_0x220335)['concat'](_0x6dd459);var _0x20f75a={'count':_0x2c06ac[_0x3ad5('0x37')],'rows':_0x2c06ac};return _0x20f75a;})[_0x3ad5('0x28')](respondWithResult(_0x50f562,null))[_0x3ad5('0x44')](function(_0x4009e7){var _0x38fc64=_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0xba')]?0x1f4:_0x4009e7['statusCode']||0x1f4;logger[_0x3ad5('0xbb')](_0x4009e7[_0x3ad5('0xbc')]);delete _0x4009e7['name'];if(_0x38fc64===0x191){_0x38fc64=0x190;}_0x50f562[_0x3ad5('0x1c')](_0x38fc64)[_0x3ad5('0xbd')](_0x45ace8[_0x3ad5('0x32')][_0x3ad5('0xba')]?{'message':_0x3ad5('0xbe'),'statusCode':_0x4009e7[_0x3ad5('0xbf')]}:_0x4009e7);});};function getSelectList(_0x509f71,_0x194030,_0x42e3f8,_0x4970d6,_0xb7b958,_0x227dcb){var _0x43de5b={'method':_0x3ad5('0xa0'),'uri':_0x509f71+_0x3ad5('0xa5')+_0x4970d6+_0x3ad5('0xc0')+_0xb7b958+_0x3ad5('0xc1')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x227dcb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43de5b)[_0x3ad5('0x28')](function(_0x57f1ae){var _0x20b6af=[];var _0x58fb0c=_0x57f1ae[_0x3ad5('0xc2')]['Options'];_0x58fb0c[_0x3ad5('0xad')](function(_0x3c3d6c){_0x20b6af['push']({'name':_0x3c3d6c[_0x3ad5('0xc3')][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':String(_0x3c3d6c['Value'])});});var _0x253b7d={'id':_0x194030+'_'+_0x57f1ae[_0x3ad5('0xa9')],'name':_0x57f1ae[_0x3ad5('0xc5')]['UserLocalizedLabel'][_0x3ad5('0xc3')],'custom':![],'options':_0x20b6af};_0x42e3f8['push'](_0x253b7d);return _0x42e3f8;});}function getBooleanList(_0x5ab6d3,_0x26e149,_0x320b88,_0x22b548,_0x5dee23,_0xe66d9a){var _0x3dad={'method':_0x3ad5('0xa0'),'uri':_0x5ab6d3+_0x3ad5('0xa5')+_0x22b548+')/Attributes('+_0x5dee23+_0x3ad5('0xc6'),'headers':{'Authorization':_0x3ad5('0xa2')+_0xe66d9a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3dad)[_0x3ad5('0x28')](function(_0xf362c2){var _0x387fc2=[];_0x387fc2[_0x3ad5('0xb2')]({'name':_0xf362c2[_0x3ad5('0xc2')][_0x3ad5('0xc7')]['Label'][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':_0x3ad5('0xc8')},{'name':_0xf362c2['OptionSet'][_0x3ad5('0xc9')][_0x3ad5('0xc3')][_0x3ad5('0xc4')][_0x3ad5('0xc3')],'value':'false'});var _0x53829d={'id':_0x26e149+'_'+_0xf362c2[_0x3ad5('0xa9')],'name':_0xf362c2[_0x3ad5('0xc5')][_0x3ad5('0xc4')]['Label'],'custom':![],'options':_0x387fc2};_0x320b88[_0x3ad5('0xb2')](_0x53829d);return _0x320b88;});}function getInputList(_0x55db44,_0x1048a4,_0x11a02a,_0x411225,_0x4bb705,_0x23e856,_0x112841){var _0x59c4ce={'method':'GET','uri':_0x55db44+_0x3ad5('0xa5')+_0x4bb705+_0x3ad5('0xc0')+_0x23e856+')/Microsoft.Dynamics.CRM.'+_0x11a02a+_0x3ad5('0xca'),'headers':{'Authorization':'Bearer\x20'+_0x112841,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x59c4ce)[_0x3ad5('0x28')](function(_0xa0f010){var _0x1ec706={'id':_0x1048a4+'_'+_0xa0f010[_0x3ad5('0xa9')],'name':_0xa0f010[_0x3ad5('0xc5')][_0x3ad5('0xc4')]?_0xa0f010[_0x3ad5('0xc5')][_0x3ad5('0xc4')]['Label']:_0xa0f010[_0x3ad5('0xa9')],'custom':![],'options':[]};_0x411225[_0x3ad5('0xb2')](_0x1ec706);return _0x411225;});} \ No newline at end of file +var _0xeea0=['type','query','keys','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','findOne','filter','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','createdbyexternalpartyyominame','createdbyyominame','createdon','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','concat','username','password','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeea0,0x91));var _0x0eea=function(_0x5efe69,_0x10881a){_0x5efe69=_0x5efe69-0x0;var _0x51b69a=_0xeea0[_0x5efe69];return _0x51b69a;};'use strict';var emlformat=require(_0x0eea('0x0'));var rimraf=require(_0x0eea('0x1'));var zipdir=require(_0x0eea('0x2'));var jsonpatch=require(_0x0eea('0x3'));var rp=require(_0x0eea('0x4'));var moment=require('moment');var BPromise=require(_0x0eea('0x5'));var Mustache=require(_0x0eea('0x6'));var util=require(_0x0eea('0x7'));var path=require(_0x0eea('0x8'));var sox=require(_0x0eea('0x9'));var csv=require(_0x0eea('0xa'));var ejs=require(_0x0eea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eea('0xc'));var squel=require(_0x0eea('0xd'));var crypto=require(_0x0eea('0xe'));var jsforce=require(_0x0eea('0xf'));var deskjs=require(_0x0eea('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0eea('0x11'));var Papa=require(_0x0eea('0x12'));var Redis=require(_0x0eea('0x13'));var authService=require(_0x0eea('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eea('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0eea('0x16'));var config=require(_0x0eea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0eea('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd28ad5,_0x5e99b7){_0x5e99b7=_0x5e99b7||0xcc;return function(_0x413915){if(_0x413915){return _0xd28ad5['sendStatus'](_0x5e99b7);}return _0xd28ad5['status'](_0x5e99b7)[_0x0eea('0x19')]();};}function respondWithResult(_0xdf39bd,_0x5f2d5c){_0x5f2d5c=_0x5f2d5c||0xc8;return function(_0x4c001f){if(_0x4c001f){return _0xdf39bd['status'](_0x5f2d5c)[_0x0eea('0x1a')](_0x4c001f);}};}function respondWithFilteredResult(_0x1f5fbc,_0x2aa745){return function(_0x2255ed){if(_0x2255ed){var _0x2cfedf=typeof _0x2aa745[_0x0eea('0x1b')]==='undefined'&&typeof _0x2aa745[_0x0eea('0x1c')]===_0x0eea('0x1d');var _0x354183=_0x2255ed[_0x0eea('0x1e')];var _0x57f89c=_0x2cfedf?0x0:_0x2aa745[_0x0eea('0x1b')];var _0xe683ce=_0x2cfedf?_0x2255ed[_0x0eea('0x1e')]:_0x2aa745[_0x0eea('0x1b')]+_0x2aa745[_0x0eea('0x1c')];var _0x1a9b6d;if(_0xe683ce>=_0x354183){_0xe683ce=_0x354183;_0x1a9b6d=0xc8;}else{_0x1a9b6d=0xce;}_0x1f5fbc['status'](_0x1a9b6d);return _0x1f5fbc[_0x0eea('0x1f')](_0x0eea('0x20'),_0x57f89c+'-'+_0xe683ce+'/'+_0x354183)['json'](_0x2255ed);}return null;};}function patchUpdates(_0x36e670){return function(_0x3a3deb){try{jsonpatch[_0x0eea('0x21')](_0x3a3deb,_0x36e670,!![]);}catch(_0x41a01a){return BPromise['reject'](_0x41a01a);}return _0x3a3deb[_0x0eea('0x22')]();};}function saveUpdates(_0x578576,_0x3b1856){return function(_0x491ac9){if(_0x491ac9){return _0x491ac9[_0x0eea('0x23')](_0x578576)[_0x0eea('0x24')](function(_0x2e2a7b){return _0x2e2a7b;});}return null;};}function removeEntity(_0x5af003,_0x4fd7f7){return function(_0x4466f4){if(_0x4466f4){return _0x4466f4[_0x0eea('0x25')]()[_0x0eea('0x24')](function(){_0x5af003[_0x0eea('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f79c5,_0x364bb8){return function(_0x2b6808){if(!_0x2b6808){_0x5f79c5[_0x0eea('0x27')](0x194);}return _0x2b6808;};}function handleError(_0x124058,_0x22db32){_0x22db32=_0x22db32||0x1f4;return function(_0x1269c8){logger[_0x0eea('0x28')](_0x1269c8[_0x0eea('0x29')]);if(_0x1269c8[_0x0eea('0x2a')]){delete _0x1269c8[_0x0eea('0x2a')];}_0x124058[_0x0eea('0x26')](_0x22db32)[_0x0eea('0x2b')](_0x1269c8);};}exports[_0x0eea('0x2c')]=function(_0x134ead,_0x15269c){var _0x1c8d8d={},_0x59ea6b={},_0xcc9aa8={'count':0x0,'rows':[]};var _0x3b694f=_[_0x0eea('0x2d')](db[_0x0eea('0x2e')][_0x0eea('0x2f')],function(_0x22ec61){return{'name':_0x22ec61[_0x0eea('0x30')],'type':_0x22ec61[_0x0eea('0x31')]['key']};});_0x59ea6b['model']=_[_0x0eea('0x2d')](_0x3b694f,_0x0eea('0x2a'));_0x59ea6b[_0x0eea('0x32')]=_[_0x0eea('0x33')](_0x134ead[_0x0eea('0x32')]);_0x59ea6b['filters']=_['intersection'](_0x59ea6b['model'],_0x59ea6b[_0x0eea('0x32')]);_0x1c8d8d['attributes']=_[_0x0eea('0x34')](_0x59ea6b['model'],qs['fields'](_0x134ead[_0x0eea('0x32')][_0x0eea('0x35')]));_0x1c8d8d[_0x0eea('0x36')]=_0x1c8d8d[_0x0eea('0x36')]['length']?_0x1c8d8d[_0x0eea('0x36')]:_0x59ea6b[_0x0eea('0x37')];if(!_0x134ead[_0x0eea('0x32')][_0x0eea('0x38')](_0x0eea('0x39'))){_0x1c8d8d[_0x0eea('0x1c')]=qs[_0x0eea('0x1c')](_0x134ead[_0x0eea('0x32')][_0x0eea('0x1c')]);_0x1c8d8d[_0x0eea('0x1b')]=qs['offset'](_0x134ead['query']['offset']);}_0x1c8d8d[_0x0eea('0x3a')]=qs[_0x0eea('0x3b')](_0x134ead[_0x0eea('0x32')][_0x0eea('0x3b')]);_0x1c8d8d[_0x0eea('0x3c')]=qs['filters'](_[_0x0eea('0x3d')](_0x134ead['query'],_0x59ea6b[_0x0eea('0x3e')]),_0x3b694f);if(_0x134ead['query']['filter']){_0x1c8d8d[_0x0eea('0x3c')]=_[_0x0eea('0x3f')](_0x1c8d8d[_0x0eea('0x3c')],{'$or':_[_0x0eea('0x2d')](_0x3b694f,function(_0x44dd93){if(_0x44dd93[_0x0eea('0x31')]!==_0x0eea('0x40')){var _0x5c98fc={};_0x5c98fc[_0x44dd93[_0x0eea('0x2a')]]={'$like':'%'+_0x134ead[_0x0eea('0x32')]['filter']+'%'};return _0x5c98fc;}})});}_0x1c8d8d=_[_0x0eea('0x3f')]({},_0x1c8d8d,_0x134ead[_0x0eea('0x41')]);var _0x185030={'where':_0x1c8d8d['where']};return db[_0x0eea('0x2e')][_0x0eea('0x1e')](_0x185030)['then'](function(_0x259a11){_0xcc9aa8['count']=_0x259a11;if(_0x134ead[_0x0eea('0x32')]['includeAll']){_0x1c8d8d[_0x0eea('0x42')]=[{'all':!![]}];}return db[_0x0eea('0x2e')][_0x0eea('0x43')](_0x1c8d8d);})[_0x0eea('0x24')](function(_0xe51e79){_0xcc9aa8[_0x0eea('0x44')]=_0xe51e79;return _0xcc9aa8;})[_0x0eea('0x24')](respondWithFilteredResult(_0x15269c,_0x1c8d8d))['catch'](handleError(_0x15269c,null));};exports[_0x0eea('0x45')]=function(_0x5009e9,_0x14ab80){var _0x1460e8={'raw':![],'where':{'id':_0x5009e9[_0x0eea('0x46')]['id']}},_0x1eb849={};_0x1eb849[_0x0eea('0x37')]=_[_0x0eea('0x33')](db[_0x0eea('0x2e')][_0x0eea('0x2f')]);_0x1eb849[_0x0eea('0x32')]=_[_0x0eea('0x33')](_0x5009e9[_0x0eea('0x32')]);_0x1eb849[_0x0eea('0x3e')]=_[_0x0eea('0x34')](_0x1eb849['model'],_0x1eb849[_0x0eea('0x32')]);_0x1460e8[_0x0eea('0x36')]=_[_0x0eea('0x34')](_0x1eb849['model'],qs[_0x0eea('0x35')](_0x5009e9[_0x0eea('0x32')][_0x0eea('0x35')]));_0x1460e8['attributes']=_0x1460e8[_0x0eea('0x36')][_0x0eea('0x47')]?_0x1460e8[_0x0eea('0x36')]:_0x1eb849[_0x0eea('0x37')];if(_0x5009e9[_0x0eea('0x32')][_0x0eea('0x48')]){_0x1460e8[_0x0eea('0x42')]=[{'all':!![]}];}_0x1460e8=_[_0x0eea('0x3f')]({},_0x1460e8,_0x5009e9['options']);return db['Dynamics365Account'][_0x0eea('0x49')](_0x1460e8)[_0x0eea('0x24')](handleEntityNotFound(_0x14ab80,null))[_0x0eea('0x24')](respondWithResult(_0x14ab80,null))[_0x0eea('0x4a')](handleError(_0x14ab80,null));};exports[_0x0eea('0x4b')]=function(_0xb53f1e,_0x5aa925){return db[_0x0eea('0x2e')][_0x0eea('0x4b')](_0xb53f1e[_0x0eea('0x4c')],{})[_0x0eea('0x24')](respondWithResult(_0x5aa925,0xc9))[_0x0eea('0x4a')](handleError(_0x5aa925,null));};exports['update']=function(_0xb266c4,_0x570f9e){if(_0xb266c4['body']['id']){delete _0xb266c4[_0x0eea('0x4c')]['id'];}return db[_0x0eea('0x2e')][_0x0eea('0x49')]({'where':{'id':_0xb266c4[_0x0eea('0x46')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x570f9e,null))['then'](saveUpdates(_0xb266c4[_0x0eea('0x4c')],null))[_0x0eea('0x24')](respondWithResult(_0x570f9e,null))[_0x0eea('0x4a')](handleError(_0x570f9e,null));};exports[_0x0eea('0x25')]=function(_0xc088bc,_0x1814c6){return db['Dynamics365Account']['find']({'where':{'id':_0xc088bc[_0x0eea('0x46')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x1814c6,null))[_0x0eea('0x24')](removeEntity(_0x1814c6,null))[_0x0eea('0x4a')](handleError(_0x1814c6,null));};exports['getConfigurations']=function(_0x1e0315,_0x2d4bbe,_0x562e6f){var _0x2a3a4e={};var _0x217dac={};var _0x30e6c9;var _0x126278;return db['Dynamics365Account'][_0x0eea('0x4d')]({'where':{'id':_0x1e0315[_0x0eea('0x46')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x2d4bbe,null))[_0x0eea('0x24')](function(_0x2f57ee){if(_0x2f57ee){_0x30e6c9=_0x2f57ee;_0x217dac[_0x0eea('0x37')]=_[_0x0eea('0x33')](db['Dynamics365Configuration'][_0x0eea('0x2f')]);_0x217dac[_0x0eea('0x32')]=_['keys'](_0x1e0315[_0x0eea('0x32')]);_0x217dac[_0x0eea('0x3e')]=_[_0x0eea('0x34')](_0x217dac[_0x0eea('0x37')],_0x217dac[_0x0eea('0x32')]);_0x2a3a4e[_0x0eea('0x36')]=_['intersection'](_0x217dac[_0x0eea('0x37')],qs[_0x0eea('0x35')](_0x1e0315[_0x0eea('0x32')]['fields']));_0x2a3a4e[_0x0eea('0x36')]=_0x2a3a4e[_0x0eea('0x36')][_0x0eea('0x47')]?_0x2a3a4e[_0x0eea('0x36')]:_0x217dac[_0x0eea('0x37')];_0x2a3a4e['order']=qs[_0x0eea('0x3b')](_0x1e0315[_0x0eea('0x32')][_0x0eea('0x3b')]);_0x2a3a4e[_0x0eea('0x3c')]=qs['filters'](_['pick'](_0x1e0315[_0x0eea('0x32')],_0x217dac[_0x0eea('0x3e')]));if(_0x1e0315[_0x0eea('0x32')][_0x0eea('0x4e')]){_0x2a3a4e['where']=_[_0x0eea('0x3f')](_0x2a3a4e[_0x0eea('0x3c')],{'$or':_[_0x0eea('0x2d')](_0x2a3a4e['attributes'],function(_0x275ab0){var _0x3fc188={};_0x3fc188[_0x275ab0]={'$like':'%'+_0x1e0315[_0x0eea('0x32')][_0x0eea('0x4e')]+'%'};return _0x3fc188;})});}_0x2a3a4e=_[_0x0eea('0x3f')]({},_0x2a3a4e,_0x1e0315[_0x0eea('0x41')]);return _0x30e6c9[_0x0eea('0x4f')](_0x2a3a4e);}})['then'](function(_0x47864d){if(_0x47864d){_0x126278=_0x47864d['length'];if(!_0x1e0315[_0x0eea('0x32')][_0x0eea('0x38')](_0x0eea('0x39'))){_0x2a3a4e[_0x0eea('0x1c')]=qs[_0x0eea('0x1c')](_0x1e0315['query'][_0x0eea('0x1c')]);_0x2a3a4e[_0x0eea('0x1b')]=qs['offset'](_0x1e0315[_0x0eea('0x32')]['offset']);}return _0x30e6c9['getConfigurations'](_0x2a3a4e);}})['then'](function(_0x3205af){if(_0x3205af){return _0x3205af?{'count':_0x126278,'rows':_0x3205af}:null;}})[_0x0eea('0x24')](respondWithResult(_0x2d4bbe,null))['catch'](handleError(_0x2d4bbe,null));};exports[_0x0eea('0x50')]=function(_0x5211f2,_0x1570fc,_0x172ac2){if(_0x5211f2[_0x0eea('0x4c')]['id']){delete _0x5211f2['body']['id'];}return db[_0x0eea('0x2e')]['findOne']({'where':{'id':_0x5211f2[_0x0eea('0x46')]['id']}})[_0x0eea('0x24')](handleEntityNotFound(_0x1570fc,null))[_0x0eea('0x24')](function(_0x352ba3){if(_0x352ba3){_0x5211f2['body']['AccountId']=_0x352ba3['id'];_0x5211f2[_0x0eea('0x4c')][_0x0eea('0x51')]=integrations[_0x0eea('0x52')](_0x5211f2[_0x0eea('0x4c')][_0x0eea('0x53')],_0x5211f2[_0x0eea('0x4c')][_0x0eea('0x31')]);_0x5211f2['body'][_0x0eea('0x54')]=integrations[_0x0eea('0x55')](_0x5211f2['body'][_0x0eea('0x53')],_0x5211f2[_0x0eea('0x4c')]['type']);return db['Dynamics365Configuration'][_0x0eea('0x4b')](_0x5211f2[_0x0eea('0x4c')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x0eea('0x56')],'as':_0x0eea('0x54')}]});}return null;})[_0x0eea('0x24')](respondWithResult(_0x1570fc,null))[_0x0eea('0x4a')](handleError(_0x1570fc,null));};exports['getFields']=function(_0x21a44d,_0x3b95ec,_0x1dc3ff){var _0x2351a1=_0x21a44d[_0x0eea('0x32')][_0x0eea('0x57')];var _0x23d168=_0x2351a1===_0x0eea('0x58')?_0x0eea('0x59'):_0x0eea('0x5a');var _0x1dd3ad='';var _0x30a881='';var _0x2fd85d='';var _0x3a0cff='';var _0x247a94='';var _0x11cd76='';var _0x517a9b='';var _0x33f54b='';var _0x75d97c=[_0x0eea('0x5b'),_0x0eea('0x5c'),_0x0eea('0x5d'),_0x0eea('0x5e'),_0x0eea('0x5f'),_0x0eea('0x60'),_0x0eea('0x61'),_0x0eea('0x62'),'directioncode',_0x0eea('0x63')];var _0x3fbab1=[_0x0eea('0x64'),_0x0eea('0x65'),_0x0eea('0x66'),_0x0eea('0x67'),_0x0eea('0x68'),'contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname',_0x0eea('0x69'),'createdbyname',_0x0eea('0x6a'),_0x0eea('0x6b'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype',_0x0eea('0x6c'),_0x0eea('0x6d'),_0x0eea('0x6e'),_0x0eea('0x6f'),_0x0eea('0x70'),'escalatedon',_0x0eea('0x71'),'firstresponsebykpiidname',_0x0eea('0x72'),_0x0eea('0x73'),'influencescore','kbarticleidname',_0x0eea('0x74'),_0x0eea('0x75'),_0x0eea('0x76'),_0x0eea('0x77'),_0x0eea('0x78'),'modifiedbyyominame','modifiedon','modifiedonbehalfbyname',_0x0eea('0x79'),_0x0eea('0x7a'),_0x0eea('0x7b'),_0x0eea('0x7c'),_0x0eea('0x7d'),_0x0eea('0x7e'),'owneridname','owneridtype',_0x0eea('0x7f'),_0x0eea('0x80'),'primarycontactidname','primarycontactidyominame',_0x0eea('0x81'),_0x0eea('0x82'),_0x0eea('0x83'),_0x0eea('0x84'),_0x0eea('0x85'),'responseby','responsiblecontactidname',_0x0eea('0x86'),_0x0eea('0x87'),'slainvokedidname',_0x0eea('0x88'),_0x0eea('0x89'),_0x0eea('0x8a'),_0x0eea('0x8b'),_0x0eea('0x8c'),'ticketnumber','timezoneruleversionnumber',_0x0eea('0x8d'),'traversedpath','utcconversiontimezonecode','versionnumber'];var _0x1cecbb=_0x75d97c[_0x0eea('0x8e')](_0x3fbab1);return db[_0x0eea('0x2e')][_0x0eea('0x4d')]({'where':{'id':_0x21a44d['params']['id']},'attributes':['id',_0x0eea('0x8f'),_0x0eea('0x90'),'remoteUri','tenantId',_0x0eea('0x91'),_0x0eea('0x92')]})[_0x0eea('0x24')](handleEntityNotFound(_0x3b95ec,null))[_0x0eea('0x24')](function(_0x2553fe){if(_0x2553fe){_0x33f54b=_0x2553fe['remoteUri'];var _0x23fbfb=_0x33f54b[_0x0eea('0x93')](-0x1);if(_0x23fbfb==='/'){_0x33f54b=_0x33f54b[_0x0eea('0x94')](0x0,_0x33f54b[_0x0eea('0x95')](_0x23fbfb));}_0x517a9b=util[_0x0eea('0x96')](_0x0eea('0x97'),_0x33f54b);var _0x360d4f={'method':_0x0eea('0x98'),'uri':_0x0eea('0x99')+_0x2553fe[_0x0eea('0x9a')]+_0x0eea('0x9b'),'form':{'client_id':_0x2553fe['clientId'],'resource':_0x33f54b,'username':_0x2553fe['username'],'password':_0x2553fe['password'],'grant_type':_0x0eea('0x90'),'client_secret':_0x2553fe[_0x0eea('0x92')]},'json':!![]};return rp(_0x360d4f);}})[_0x0eea('0x24')](function(_0x43e918){_0x11cd76=_0x43e918[_0x0eea('0x9c')];var _0x2d03b8={'method':_0x0eea('0x9d'),'uri':encodeURI(_0x517a9b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x23d168+'\x27'),'headers':{'Authorization':_0x0eea('0x9e')+_0x11cd76,'If-None-Match':null,'OData-Version':_0x0eea('0x9f')},'json':!![]};return rp(_0x2d03b8);})['then'](function(_0x5a19de){var _0x409020=_0x5a19de[_0x0eea('0xa0')][0x0];var _0x48663b=_0x409020['MetadataId'];var _0x5d8804={'method':'GET','uri':_0x517a9b+_0x0eea('0xa1')+_0x48663b+_0x0eea('0xa2'),'headers':{'Authorization':_0x0eea('0x9e')+_0x11cd76,'If-None-Match':null,'OData-Version':_0x0eea('0x9f')},'json':!![]};return rp(_0x5d8804);})[_0x0eea('0x24')](function(_0x207edb){_0x1dd3ad=_0x207edb;_0x30a881=_0x1dd3ad['Attributes'];_0x30a881=_[_0x0eea('0xa3')](_0x30a881,function(_0x34dfc2){return!_0x1cecbb[_0x0eea('0xa4')](_0x34dfc2[_0x0eea('0xa5')]);});var _0x46aff0=[];var _0x5a1f82=[];_0x30a881[_0x0eea('0xa6')](function(_0x5dc0b9){if(_0x5dc0b9[_0x0eea('0xa7')]){var _0x40da5f=_0x5dc0b9[_0x0eea('0xa7')][_0x0eea('0x94')](_0x5dc0b9['@odata.type']['lastIndexOf']('.')+0x1);if(_0x40da5f===_0x0eea('0xa8')){_0x46aff0['push'](getSelectList(_0x517a9b,_0x2351a1,_0x5a1f82,_0x1dd3ad[_0x0eea('0xa9')],_0x5dc0b9['MetadataId'],_0x11cd76));}}});return Promise[_0x0eea('0xaa')](_0x46aff0);})['then'](function(_0x1d9391){_0x2fd85d=_0x1d9391[0x0];var _0x59d8af=[];var _0x45b865=[];_0x30a881[_0x0eea('0xa6')](function(_0x25eae4){if(!_[_0x0eea('0xab')](_0x25eae4[_0x0eea('0xa7')])){var _0x43df3e=_0x25eae4[_0x0eea('0xa7')][_0x0eea('0x94')](_0x25eae4[_0x0eea('0xa7')][_0x0eea('0x95')]('.')+0x1);if(_0x43df3e==='BooleanAttributeMetadata'){_0x59d8af[_0x0eea('0xac')](getBooleanList(_0x517a9b,_0x2351a1,_0x45b865,_0x1dd3ad[_0x0eea('0xa9')],_0x25eae4[_0x0eea('0xa9')],_0x11cd76));}}});return Promise[_0x0eea('0xaa')](_0x59d8af);})[_0x0eea('0x24')](function(_0x104d7e){_0x3a0cff=_0x104d7e[0x0];var _0xe00ad1=[];var _0x4414b9=[];_0x30a881[_0x0eea('0xa6')](function(_0x42b9a5){if(_0x42b9a5[_0x0eea('0xa7')]){var _0x1e7c9f=_0x42b9a5[_0x0eea('0xa7')][_0x0eea('0x94')](_0x42b9a5[_0x0eea('0xa7')]['lastIndexOf']('.')+0x1);if(_0x1e7c9f===_0x0eea('0xad')||_0x1e7c9f===_0x0eea('0xae')||_0x1e7c9f===_0x0eea('0xaf')||_0x1e7c9f==='IntegerAttributeMetadata'||_0x1e7c9f===_0x0eea('0xb0')||_0x1e7c9f==='DateTimeAttributeMetadata'||_0x1e7c9f===_0x0eea('0xb1')||_0x1e7c9f==='EntityNameAttributeMetadata'||_0x1e7c9f==='StateAttributeMetadata'||_0x1e7c9f==='DecimalAttributeMetadata'){_0xe00ad1['push'](getInputList(_0x517a9b,_0x2351a1,_0x1e7c9f,_0x4414b9,_0x1dd3ad[_0x0eea('0xa9')],_0x42b9a5[_0x0eea('0xa9')],_0x11cd76));}}});return Promise['all'](_0xe00ad1);})[_0x0eea('0x24')](function(_0x3c8a81){_0x247a94=_0x3c8a81[0x0];var _0x5e243f=_0x2fd85d['concat'](_0x3a0cff)[_0x0eea('0x8e')](_0x247a94);var _0x1e23b7={'count':_0x5e243f[_0x0eea('0x47')],'rows':_0x5e243f};return _0x1e23b7;})[_0x0eea('0x24')](respondWithResult(_0x3b95ec,null))[_0x0eea('0x4a')](function(_0x266e40){var _0xe30ab7=_0x21a44d[_0x0eea('0x32')][_0x0eea('0xb2')]?0x1f4:_0x266e40[_0x0eea('0xb3')]||0x1f4;logger[_0x0eea('0x28')](_0x266e40[_0x0eea('0x29')]);delete _0x266e40[_0x0eea('0x2a')];if(_0xe30ab7===0x191){_0xe30ab7=0x190;}_0x3b95ec[_0x0eea('0x26')](_0xe30ab7)[_0x0eea('0x2b')](_0x21a44d['query'][_0x0eea('0xb2')]?{'message':_0x0eea('0xb4'),'statusCode':_0x266e40[_0x0eea('0xb3')]}:_0x266e40);});};function getSelectList(_0x5810d5,_0x453a2e,_0x5575b9,_0x5dc262,_0x327654,_0x56c302){var _0x1435e9={'method':_0x0eea('0x9d'),'uri':_0x5810d5+'EntityDefinitions('+_0x5dc262+_0x0eea('0xb5')+_0x327654+_0x0eea('0xb6')+_0x0eea('0xb7'),'headers':{'Authorization':_0x0eea('0x9e')+_0x56c302,'If-None-Match':null,'OData-Version':_0x0eea('0x9f')},'json':!![]};return rp(_0x1435e9)[_0x0eea('0x24')](function(_0x5a27c3){var _0x771f34=[];var _0x41e97d=_0x5a27c3[_0x0eea('0xb8')][_0x0eea('0xb9')];_0x41e97d[_0x0eea('0xa6')](function(_0x9462c3){_0x771f34[_0x0eea('0xac')]({'name':_0x9462c3[_0x0eea('0xba')][_0x0eea('0xbb')][_0x0eea('0xba')],'value':String(_0x9462c3['Value'])});});var _0x1ebc69={'id':_0x453a2e+'_'+_0x5a27c3[_0x0eea('0xa5')],'name':_0x5a27c3[_0x0eea('0xbc')][_0x0eea('0xbb')][_0x0eea('0xba')],'custom':![],'options':_0x771f34};_0x5575b9[_0x0eea('0xac')](_0x1ebc69);return _0x5575b9;});}function getBooleanList(_0x150ebe,_0x22a99a,_0x145a69,_0x4d97e4,_0x321405,_0x23e46c){var _0x104283={'method':_0x0eea('0x9d'),'uri':_0x150ebe+_0x0eea('0xa1')+_0x4d97e4+')/Attributes('+_0x321405+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x23e46c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x104283)[_0x0eea('0x24')](function(_0x43b610){var _0x365b1f=[];_0x365b1f['push']({'name':_0x43b610[_0x0eea('0xb8')]['TrueOption'][_0x0eea('0xba')]['UserLocalizedLabel']['Label'],'value':_0x0eea('0xbd')},{'name':_0x43b610[_0x0eea('0xb8')][_0x0eea('0xbe')][_0x0eea('0xba')][_0x0eea('0xbb')][_0x0eea('0xba')],'value':_0x0eea('0xbf')});var _0x41f26f={'id':_0x22a99a+'_'+_0x43b610[_0x0eea('0xa5')],'name':_0x43b610[_0x0eea('0xbc')]['UserLocalizedLabel'][_0x0eea('0xba')],'custom':![],'options':_0x365b1f};_0x145a69[_0x0eea('0xac')](_0x41f26f);return _0x145a69;});}function getInputList(_0x4854e4,_0x37caf5,_0x3081fc,_0x448422,_0x2795a4,_0x2d119d,_0x1ad21c){var _0x356245={'method':_0x0eea('0x9d'),'uri':_0x4854e4+_0x0eea('0xa1')+_0x2795a4+_0x0eea('0xb5')+_0x2d119d+_0x0eea('0xc0')+_0x3081fc+_0x0eea('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x1ad21c,'If-None-Match':null,'OData-Version':_0x0eea('0x9f')},'json':!![]};return rp(_0x356245)[_0x0eea('0x24')](function(_0x336c49){var _0x1a9348={'id':_0x37caf5+'_'+_0x336c49[_0x0eea('0xa5')],'name':_0x336c49['DisplayName']['UserLocalizedLabel']?_0x336c49[_0x0eea('0xbc')][_0x0eea('0xbb')][_0x0eea('0xba')]:_0x336c49[_0x0eea('0xa5')],'custom':![],'options':[]};_0x448422[_0x0eea('0xac')](_0x1a9348);return _0x448422;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 85b155f..c6a2436 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(_0x103a7e,_0x5b8ac5){var _0x49f447=function(_0x52a522){while(--_0x52a522){_0x103a7e['push'](_0x103a7e['shift']());}};_0x49f447(++_0x5b8ac5);}(_0x757a,0xde));var _0xa757=function(_0x29a267,_0x15f9e0){_0x29a267=_0x29a267-0x0;var _0x467410=_0x757a[_0x29a267];return _0x467410;};'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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x359ca0,_0x138087){var _0x10214f=function(_0x26c2d8){while(--_0x26c2d8){_0x359ca0['push'](_0x359ca0['shift']());}};_0x10214f(++_0x138087);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 63103a3..14a8847 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 _0x1794=['where','attributes','limit','map','include','model','debug','catch','Dynamics365Account','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','GetDynamics365Account','findAll','options','raw'];(function(_0x4873fa,_0x373a5c){var _0x525fd6=function(_0x3791f4){while(--_0x3791f4){_0x4873fa['push'](_0x4873fa['shift']());}};_0x525fd6(++_0x373a5c);}(_0x1794,0x1ba));var _0x4179=function(_0x39a6a6,_0x5ef86e){_0x39a6a6=_0x39a6a6-0x0;var _0x34489e=_0x1794[_0x39a6a6];return _0x34489e;};'use strict';var _=require(_0x4179('0x0'));var util=require(_0x4179('0x1'));var moment=require(_0x4179('0x2'));var BPromise=require(_0x4179('0x3'));var rs=require(_0x4179('0x4'));var fs=require('fs');var Redis=require(_0x4179('0x5'));var db=require(_0x4179('0x6'))['db'];var utils=require(_0x4179('0x7'));var logger=require(_0x4179('0x8'))(_0x4179('0x9'));var config=require(_0x4179('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4179('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43ee02,_0x511624,_0x1e9d33){return new BPromise(function(_0x4dfef9,_0x388e18){return client['request'](_0x43ee02,_0x1e9d33)[_0x4179('0xc')](function(_0x1b6c41){logger[_0x4179('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x511624,_0x4179('0xe'));logger['debug'](_0x4179('0xf'),_0x511624,_0x4179('0xe'),JSON[_0x4179('0x10')](_0x1b6c41));if(_0x1b6c41[_0x4179('0x11')]){if(_0x1b6c41[_0x4179('0x11')][_0x4179('0x12')]===0x1f4){logger[_0x4179('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x511624,_0x1b6c41[_0x4179('0x11')][_0x4179('0x13')]);return _0x388e18(_0x1b6c41[_0x4179('0x11')][_0x4179('0x13')]);}logger[_0x4179('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x511624,_0x1b6c41[_0x4179('0x11')][_0x4179('0x13')]);return _0x4dfef9(_0x1b6c41[_0x4179('0x11')][_0x4179('0x13')]);}else{logger[_0x4179('0xd')](_0x4179('0x14'),_0x511624,'request\x20sent');_0x4dfef9(_0x1b6c41[_0x4179('0x15')]['message']);}})['catch'](function(_0x5cf637){logger[_0x4179('0x11')](_0x4179('0x14'),_0x511624,_0x5cf637);_0x388e18(_0x5cf637);});});}exports[_0x4179('0x16')]=function(_0x314369){var _0x307100=this;return new Promise(function(_0x82b83b,_0x45223f){return db['Dynamics365Account'][_0x4179('0x17')]({'raw':_0x314369[_0x4179('0x18')]?_0x314369[_0x4179('0x18')][_0x4179('0x19')]===undefined?!![]:![]:!![],'where':_0x314369[_0x4179('0x18')]?_0x314369[_0x4179('0x18')][_0x4179('0x1a')]||null:null,'attributes':_0x314369[_0x4179('0x18')]?_0x314369[_0x4179('0x18')][_0x4179('0x1b')]||null:null,'limit':_0x314369[_0x4179('0x18')]?_0x314369[_0x4179('0x18')][_0x4179('0x1c')]||null:null,'include':_0x314369['options']?_0x314369[_0x4179('0x18')]['include']?_[_0x4179('0x1d')](_0x314369[_0x4179('0x18')][_0x4179('0x1e')],function(_0xeb549f){return{'model':db[_0xeb549f[_0x4179('0x1f')]],'as':_0xeb549f['as'],'attributes':_0xeb549f[_0x4179('0x1b')],'include':_0xeb549f[_0x4179('0x1e')]?_[_0x4179('0x1d')](_0xeb549f['include'],function(_0x5cb433){return{'model':db[_0x5cb433[_0x4179('0x1f')]],'as':_0x5cb433['as'],'attributes':_0x5cb433[_0x4179('0x1b')],'include':_0x5cb433[_0x4179('0x1e')]?_[_0x4179('0x1d')](_0x5cb433[_0x4179('0x1e')],function(_0x2b681b){return{'model':db[_0x2b681b[_0x4179('0x1f')]],'as':_0x2b681b['as'],'attributes':_0x2b681b[_0x4179('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4179('0xc')](function(_0x4a9f65){logger[_0x4179('0xd')]('GetDynamics365Account',_0x314369);logger[_0x4179('0x20')]('GetDynamics365Account',_0x314369,JSON[_0x4179('0x10')](_0x4a9f65));_0x82b83b(_0x4a9f65);})[_0x4179('0x21')](function(_0x545bc4){logger[_0x4179('0x11')](_0x4179('0x16'),_0x545bc4['message'],_0x314369);_0x45223f(_0x307100[_0x4179('0x11')](0x1f4,_0x545bc4[_0x4179('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x57576a){var _0x28f636=this;return new Promise(function(_0x6ff2,_0x4f9e73){return db[_0x4179('0x22')]['find']({'raw':_0x57576a['options']?_0x57576a['options'][_0x4179('0x19')]===undefined?!![]:![]:!![],'where':_0x57576a['options']?_0x57576a[_0x4179('0x18')][_0x4179('0x1a')]||null:null,'attributes':_0x57576a[_0x4179('0x18')]?_0x57576a['options'][_0x4179('0x1b')]||null:null,'include':_0x57576a[_0x4179('0x18')]?_0x57576a[_0x4179('0x18')][_0x4179('0x1e')]?_['map'](_0x57576a[_0x4179('0x18')][_0x4179('0x1e')],function(_0x554174){return{'model':db[_0x554174['model']],'as':_0x554174['as'],'attributes':_0x554174['attributes'],'include':_0x554174[_0x4179('0x1e')]?_[_0x4179('0x1d')](_0x554174[_0x4179('0x1e')],function(_0x10333d){return{'model':db[_0x10333d['model']],'as':_0x10333d['as'],'attributes':_0x10333d['attributes'],'include':_0x10333d['include']?_[_0x4179('0x1d')](_0x10333d[_0x4179('0x1e')],function(_0x43cc9){return{'model':db[_0x43cc9[_0x4179('0x1f')]],'as':_0x43cc9['as'],'attributes':_0x43cc9[_0x4179('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x72e104){logger[_0x4179('0xd')](_0x4179('0x23'),_0x57576a);logger['debug'](_0x4179('0x23'),_0x57576a,JSON[_0x4179('0x10')](_0x72e104));_0x6ff2(_0x72e104);})[_0x4179('0x21')](function(_0x4a3ce7){logger['error'](_0x4179('0x23'),_0x4a3ce7[_0x4179('0x13')],_0x57576a);_0x4f9e73(_0x28f636[_0x4179('0x11')](0x1f4,_0x4a3ce7[_0x4179('0x13')]));});});}; \ No newline at end of file +var _0x0dcb=['then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowDynamics365Account','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request'];(function(_0x20db5c,_0x3e2079){var _0x299b65=function(_0x4d38bd){while(--_0x4d38bd){_0x20db5c['push'](_0x20db5c['shift']());}};_0x299b65(++_0x3e2079);}(_0x0dcb,0x120));var _0xb0dc=function(_0x498b68,_0x7fb561){_0x498b68=_0x498b68-0x0;var _0x446426=_0x0dcb[_0x498b68];return _0x446426;};'use strict';var _=require(_0xb0dc('0x0'));var util=require(_0xb0dc('0x1'));var moment=require('moment');var BPromise=require(_0xb0dc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0dc('0x3'));var db=require(_0xb0dc('0x4'))['db'];var utils=require(_0xb0dc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb0dc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb0dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26d181,_0x1ff4eb,_0x24c658){return new BPromise(function(_0x149593,_0x22ef2){return client[_0xb0dc('0x8')](_0x26d181,_0x24c658)[_0xb0dc('0x9')](function(_0x34881f){logger['info'](_0xb0dc('0xa'),_0x1ff4eb,_0xb0dc('0xb'));logger['debug'](_0xb0dc('0xc'),_0x1ff4eb,_0xb0dc('0xb'),JSON['stringify'](_0x34881f));if(_0x34881f[_0xb0dc('0xd')]){if(_0x34881f['error'][_0xb0dc('0xe')]===0x1f4){logger[_0xb0dc('0xd')](_0xb0dc('0xa'),_0x1ff4eb,_0x34881f[_0xb0dc('0xd')][_0xb0dc('0xf')]);return _0x22ef2(_0x34881f['error'][_0xb0dc('0xf')]);}logger[_0xb0dc('0xd')](_0xb0dc('0xa'),_0x1ff4eb,_0x34881f[_0xb0dc('0xd')][_0xb0dc('0xf')]);return _0x149593(_0x34881f[_0xb0dc('0xd')]['message']);}else{logger[_0xb0dc('0x10')](_0xb0dc('0xa'),_0x1ff4eb,_0xb0dc('0xb'));_0x149593(_0x34881f[_0xb0dc('0x11')][_0xb0dc('0xf')]);}})[_0xb0dc('0x12')](function(_0x305e61){logger[_0xb0dc('0xd')](_0xb0dc('0xa'),_0x1ff4eb,_0x305e61);_0x22ef2(_0x305e61);});});}exports[_0xb0dc('0x13')]=function(_0x47ff35){var _0x5aee7a=this;return new Promise(function(_0x2c5585,_0x37966d){return db[_0xb0dc('0x14')][_0xb0dc('0x15')]({'raw':_0x47ff35[_0xb0dc('0x16')]?_0x47ff35['options'][_0xb0dc('0x17')]===undefined?!![]:![]:!![],'where':_0x47ff35['options']?_0x47ff35['options'][_0xb0dc('0x18')]||null:null,'attributes':_0x47ff35['options']?_0x47ff35[_0xb0dc('0x16')][_0xb0dc('0x19')]||null:null,'limit':_0x47ff35[_0xb0dc('0x16')]?_0x47ff35[_0xb0dc('0x16')][_0xb0dc('0x1a')]||null:null,'include':_0x47ff35[_0xb0dc('0x16')]?_0x47ff35['options'][_0xb0dc('0x1b')]?_[_0xb0dc('0x1c')](_0x47ff35['options'][_0xb0dc('0x1b')],function(_0x257e79){return{'model':db[_0x257e79[_0xb0dc('0x1d')]],'as':_0x257e79['as'],'attributes':_0x257e79['attributes'],'include':_0x257e79[_0xb0dc('0x1b')]?_[_0xb0dc('0x1c')](_0x257e79[_0xb0dc('0x1b')],function(_0x4d74b2){return{'model':db[_0x4d74b2[_0xb0dc('0x1d')]],'as':_0x4d74b2['as'],'attributes':_0x4d74b2[_0xb0dc('0x19')],'include':_0x4d74b2['include']?_[_0xb0dc('0x1c')](_0x4d74b2[_0xb0dc('0x1b')],function(_0x21b5c4){return{'model':db[_0x21b5c4['model']],'as':_0x21b5c4['as'],'attributes':_0x21b5c4[_0xb0dc('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb0dc('0x9')](function(_0x5ce54c){logger[_0xb0dc('0x10')](_0xb0dc('0x13'),_0x47ff35);logger[_0xb0dc('0x1e')](_0xb0dc('0x13'),_0x47ff35,JSON[_0xb0dc('0x1f')](_0x5ce54c));_0x2c5585(_0x5ce54c);})['catch'](function(_0x6d76c){logger[_0xb0dc('0xd')](_0xb0dc('0x13'),_0x6d76c[_0xb0dc('0xf')],_0x47ff35);_0x37966d(_0x5aee7a[_0xb0dc('0xd')](0x1f4,_0x6d76c['message']));});});};exports['ShowDynamics365Account']=function(_0x1f1e6d){var _0x598bfe=this;return new Promise(function(_0x91e1ee,_0x2a1616){return db[_0xb0dc('0x14')]['find']({'raw':_0x1f1e6d[_0xb0dc('0x16')]?_0x1f1e6d['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f1e6d[_0xb0dc('0x16')]?_0x1f1e6d[_0xb0dc('0x16')]['where']||null:null,'attributes':_0x1f1e6d[_0xb0dc('0x16')]?_0x1f1e6d[_0xb0dc('0x16')][_0xb0dc('0x19')]||null:null,'include':_0x1f1e6d[_0xb0dc('0x16')]?_0x1f1e6d[_0xb0dc('0x16')]['include']?_['map'](_0x1f1e6d[_0xb0dc('0x16')]['include'],function(_0x3dcd26){return{'model':db[_0x3dcd26['model']],'as':_0x3dcd26['as'],'attributes':_0x3dcd26[_0xb0dc('0x19')],'include':_0x3dcd26[_0xb0dc('0x1b')]?_[_0xb0dc('0x1c')](_0x3dcd26[_0xb0dc('0x1b')],function(_0x5af97a){return{'model':db[_0x5af97a[_0xb0dc('0x1d')]],'as':_0x5af97a['as'],'attributes':_0x5af97a['attributes'],'include':_0x5af97a[_0xb0dc('0x1b')]?_[_0xb0dc('0x1c')](_0x5af97a[_0xb0dc('0x1b')],function(_0x8db08){return{'model':db[_0x8db08[_0xb0dc('0x1d')]],'as':_0x8db08['as'],'attributes':_0x8db08[_0xb0dc('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f429e){logger[_0xb0dc('0x10')]('ShowDynamics365Account',_0x1f1e6d);logger[_0xb0dc('0x1e')](_0xb0dc('0x20'),_0x1f1e6d,JSON[_0xb0dc('0x1f')](_0x1f429e));_0x91e1ee(_0x1f429e);})[_0xb0dc('0x12')](function(_0x533079){logger['error'](_0xb0dc('0x20'),_0x533079[_0xb0dc('0xf')],_0x1f1e6d);_0x2a1616(_0x598bfe[_0xb0dc('0xd')](0x1f4,_0x533079[_0xb0dc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c45380a..b334749 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 _0x0e5a=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update'];(function(_0x28e8df,_0x31367c){var _0x561dbf=function(_0x2950a7){while(--_0x2950a7){_0x28e8df['push'](_0x28e8df['shift']());}};_0x561dbf(++_0x31367c);}(_0x0e5a,0x70));var _0xa0e5=function(_0x2e85f8,_0x44753c){_0x2e85f8=_0x2e85f8-0x0;var _0xb91c44=_0x0e5a[_0x2e85f8];return _0xb91c44;};'use strict';var multer=require(_0xa0e5('0x0'));var util=require(_0xa0e5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa0e5('0x2'));var router=express[_0xa0e5('0x3')]();var fs_extra=require(_0xa0e5('0x4'));var auth=require(_0xa0e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa0e5('0x6'));var controller=require(_0xa0e5('0x7'));router[_0xa0e5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0e5('0x8')](_0xa0e5('0x9'),auth[_0xa0e5('0xa')](),controller[_0xa0e5('0xb')]);router[_0xa0e5('0x8')](_0xa0e5('0xc'),auth[_0xa0e5('0xa')](),controller[_0xa0e5('0xd')]);router[_0xa0e5('0x8')](_0xa0e5('0xe'),auth['isAuthenticated'](),controller[_0xa0e5('0xf')]);router[_0xa0e5('0x8')](_0xa0e5('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xa0e5('0xa')](),controller[_0xa0e5('0x11')]);router[_0xa0e5('0x12')](_0xa0e5('0x9'),auth['isAuthenticated'](),controller[_0xa0e5('0x13')]);router['delete'](_0xa0e5('0x9'),auth[_0xa0e5('0xa')](),controller[_0xa0e5('0x14')]);module[_0xa0e5('0x15')]=router; \ No newline at end of file +var _0xd844=['../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x51e6fb,_0x1c0b7e){var _0x4e30a7=function(_0x2446c2){while(--_0x2446c2){_0x51e6fb['push'](_0x51e6fb['shift']());}};_0x4e30a7(++_0x1c0b7e);}(_0xd844,0x6d));var _0x4d84=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd844[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x4d84('0x0'));var util=require(_0x4d84('0x1'));var path=require('path');var timeout=require(_0x4d84('0x2'));var express=require(_0x4d84('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d84('0x4'));var interaction=require(_0x4d84('0x5'));var config=require(_0x4d84('0x6'));var controller=require(_0x4d84('0x7'));router['get']('/',auth[_0x4d84('0x8')](),controller['index']);router['get'](_0x4d84('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4d84('0xa')](_0x4d84('0xb'),auth['isAuthenticated'](),controller[_0x4d84('0xc')]);router['get'](_0x4d84('0xd'),auth[_0x4d84('0x8')](),controller[_0x4d84('0xe')]);router['get'](_0x4d84('0xf'),auth[_0x4d84('0x8')](),controller[_0x4d84('0x10')]);router[_0x4d84('0x11')]('/',auth[_0x4d84('0x8')](),controller[_0x4d84('0x12')]);router[_0x4d84('0x13')](_0x4d84('0x9'),auth[_0x4d84('0x8')](),controller[_0x4d84('0x14')]);router[_0x4d84('0x15')]('/:id',auth[_0x4d84('0x8')](),controller['destroy']);module[_0x4d84('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 95eb175..075fa22 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 _0xeaa8=['phonecall','incident','contact','exports','STRING','ENUM'];(function(_0x1ee04b,_0x554b3d){var _0x412848=function(_0x11917a){while(--_0x11917a){_0x1ee04b['push'](_0x1ee04b['shift']());}};_0x412848(++_0x554b3d);}(_0xeaa8,0xe1));var _0x8eaa=function(_0x54cc5f,_0x4ca651){_0x54cc5f=_0x54cc5f-0x0;var _0x2578de=_0xeaa8[_0x54cc5f];return _0x2578de;};'use strict';var Sequelize=require('sequelize');module[_0x8eaa('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8eaa('0x1')]},'ticketType':{'type':Sequelize[_0x8eaa('0x2')]('incident',_0x8eaa('0x3')),'defaultValue':_0x8eaa('0x4')},'moduleCreate':{'type':Sequelize[_0x8eaa('0x2')](_0x8eaa('0x5'),'nothing'),'defaultValue':_0x8eaa('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x5d9f=['phonecall','contact','nothing','sequelize','STRING','ENUM','incident'];(function(_0x291a8f,_0x29703e){var _0xedebbb=function(_0x460618){while(--_0x460618){_0x291a8f['push'](_0x291a8f['shift']());}};_0xedebbb(++_0x29703e);}(_0x5d9f,0x1d1));var _0xf5d9=function(_0xc6f24c,_0x2d8a38){_0xc6f24c=_0xc6f24c-0x0;var _0x283936=_0x5d9f[_0xc6f24c];return _0x283936;};'use strict';var Sequelize=require(_0xf5d9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5d9('0x1')]},'ticketType':{'type':Sequelize[_0xf5d9('0x2')](_0xf5d9('0x3'),_0xf5d9('0x4')),'defaultValue':_0xf5d9('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xf5d9('0x5'),_0xf5d9('0x6')),'defaultValue':_0xf5d9('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7f3a881..6e1c8cd 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 _0xd4b3=['getFields','Dynamics365Field','order','sort','getSubjects','findOne','getDescriptions','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','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body'];(function(_0x27d771,_0x1a50b2){var _0x2ba087=function(_0x1fcfa4){while(--_0x1fcfa4){_0x27d771['push'](_0x27d771['shift']());}};_0x2ba087(++_0x1a50b2);}(_0xd4b3,0x163));var _0x3d4b=function(_0x2ad873,_0x2ec8e8){_0x2ad873=_0x2ad873-0x0;var _0x1e218f=_0xd4b3[_0x2ad873];return _0x1e218f;};'use strict';var emlformat=require(_0x3d4b('0x0'));var rimraf=require(_0x3d4b('0x1'));var zipdir=require(_0x3d4b('0x2'));var jsonpatch=require(_0x3d4b('0x3'));var rp=require(_0x3d4b('0x4'));var moment=require(_0x3d4b('0x5'));var BPromise=require(_0x3d4b('0x6'));var Mustache=require(_0x3d4b('0x7'));var util=require(_0x3d4b('0x8'));var path=require(_0x3d4b('0x9'));var sox=require(_0x3d4b('0xa'));var csv=require(_0x3d4b('0xb'));var ejs=require(_0x3d4b('0xc'));var fs=require('fs');var fs_extra=require(_0x3d4b('0xd'));var _=require(_0x3d4b('0xe'));var squel=require(_0x3d4b('0xf'));var crypto=require(_0x3d4b('0x10'));var jsforce=require(_0x3d4b('0x11'));var deskjs=require(_0x3d4b('0x12'));var toCsv=require(_0x3d4b('0xb'));var querystring=require(_0x3d4b('0x13'));var Papa=require(_0x3d4b('0x14'));var Redis=require('ioredis');var authService=require(_0x3d4b('0x15'));var qs=require(_0x3d4b('0x16'));var as=require(_0x3d4b('0x17'));var hardwareService=require(_0x3d4b('0x18'));var logger=require('../../config/logger')(_0x3d4b('0x19'));var utils=require(_0x3d4b('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x3d4b('0x1b'));var db=require(_0x3d4b('0x1c'))['db'];function respondWithStatusCode(_0x12301a,_0x1d04d1){_0x1d04d1=_0x1d04d1||0xcc;return function(_0x37c55d){if(_0x37c55d){return _0x12301a['sendStatus'](_0x1d04d1);}return _0x12301a[_0x3d4b('0x1d')](_0x1d04d1)[_0x3d4b('0x1e')]();};}function respondWithResult(_0x489fe9,_0x2f9529){_0x2f9529=_0x2f9529||0xc8;return function(_0x225393){if(_0x225393){return _0x489fe9[_0x3d4b('0x1d')](_0x2f9529)[_0x3d4b('0x1f')](_0x225393);}};}function respondWithFilteredResult(_0x17bc29,_0x1cc872){return function(_0x508db6){if(_0x508db6){var _0x33ba8c=typeof _0x1cc872[_0x3d4b('0x20')]===_0x3d4b('0x21')&&typeof _0x1cc872[_0x3d4b('0x22')]===_0x3d4b('0x21');var _0x746391=_0x508db6['count'];var _0x56454a=_0x33ba8c?0x0:_0x1cc872['offset'];var _0x505b96=_0x33ba8c?_0x508db6['count']:_0x1cc872[_0x3d4b('0x20')]+_0x1cc872[_0x3d4b('0x22')];var _0x16ee8f;if(_0x505b96>=_0x746391){_0x505b96=_0x746391;_0x16ee8f=0xc8;}else{_0x16ee8f=0xce;}_0x17bc29['status'](_0x16ee8f);return _0x17bc29[_0x3d4b('0x23')](_0x3d4b('0x24'),_0x56454a+'-'+_0x505b96+'/'+_0x746391)[_0x3d4b('0x1f')](_0x508db6);}return null;};}function patchUpdates(_0x12104d){return function(_0x47f707){try{jsonpatch[_0x3d4b('0x25')](_0x47f707,_0x12104d,!![]);}catch(_0xcde918){return BPromise[_0x3d4b('0x26')](_0xcde918);}return _0x47f707['save']();};}function saveUpdates(_0x445ea0,_0x449205){return function(_0x3f1019){if(_0x3f1019){return _0x3f1019['update'](_0x445ea0)[_0x3d4b('0x27')](function(_0x4774e4){return _0x4774e4;});}return null;};}function removeEntity(_0x49133f,_0x3597fc){return function(_0x31fe71){if(_0x31fe71){return _0x31fe71[_0x3d4b('0x28')]()[_0x3d4b('0x27')](function(){_0x49133f[_0x3d4b('0x1d')](0xcc)[_0x3d4b('0x1e')]();});}};}function handleEntityNotFound(_0x780dd7,_0x1a6021){return function(_0xa56a09){if(!_0xa56a09){_0x780dd7[_0x3d4b('0x29')](0x194);}return _0xa56a09;};}function handleError(_0x46270b,_0x40b57e){_0x40b57e=_0x40b57e||0x1f4;return function(_0x310cea){logger[_0x3d4b('0x2a')](_0x310cea[_0x3d4b('0x2b')]);if(_0x310cea['name']){delete _0x310cea['name'];}_0x46270b['status'](_0x40b57e)[_0x3d4b('0x2c')](_0x310cea);};}exports[_0x3d4b('0x2d')]=function(_0x2e6e6c,_0xadd959){var _0x4b9ab2={},_0x425b76={},_0x35878e={'count':0x0,'rows':[]};var _0x187ae3=_[_0x3d4b('0x2e')](db[_0x3d4b('0x2f')][_0x3d4b('0x30')],function(_0x5710b7){return{'name':_0x5710b7[_0x3d4b('0x31')],'type':_0x5710b7[_0x3d4b('0x32')][_0x3d4b('0x33')]};});_0x425b76['model']=_[_0x3d4b('0x2e')](_0x187ae3,_0x3d4b('0x34'));_0x425b76[_0x3d4b('0x35')]=_[_0x3d4b('0x36')](_0x2e6e6c[_0x3d4b('0x35')]);_0x425b76[_0x3d4b('0x37')]=_[_0x3d4b('0x38')](_0x425b76['model'],_0x425b76[_0x3d4b('0x35')]);_0x4b9ab2[_0x3d4b('0x39')]=_[_0x3d4b('0x38')](_0x425b76[_0x3d4b('0x3a')],qs[_0x3d4b('0x3b')](_0x2e6e6c[_0x3d4b('0x35')]['fields']));_0x4b9ab2[_0x3d4b('0x39')]=_0x4b9ab2['attributes']['length']?_0x4b9ab2[_0x3d4b('0x39')]:_0x425b76[_0x3d4b('0x3a')];if(!_0x2e6e6c[_0x3d4b('0x35')][_0x3d4b('0x3c')](_0x3d4b('0x3d'))){_0x4b9ab2[_0x3d4b('0x22')]=qs[_0x3d4b('0x22')](_0x2e6e6c[_0x3d4b('0x35')][_0x3d4b('0x22')]);_0x4b9ab2[_0x3d4b('0x20')]=qs[_0x3d4b('0x20')](_0x2e6e6c[_0x3d4b('0x35')][_0x3d4b('0x20')]);}_0x4b9ab2['order']=qs['sort'](_0x2e6e6c[_0x3d4b('0x35')]['sort']);_0x4b9ab2[_0x3d4b('0x3e')]=qs['filters'](_[_0x3d4b('0x3f')](_0x2e6e6c[_0x3d4b('0x35')],_0x425b76[_0x3d4b('0x37')]),_0x187ae3);if(_0x2e6e6c[_0x3d4b('0x35')][_0x3d4b('0x40')]){_0x4b9ab2[_0x3d4b('0x3e')]=_['merge'](_0x4b9ab2['where'],{'$or':_[_0x3d4b('0x2e')](_0x187ae3,function(_0x2122ac){if(_0x2122ac[_0x3d4b('0x32')]!==_0x3d4b('0x41')){var _0x5b1265={};_0x5b1265[_0x2122ac[_0x3d4b('0x34')]]={'$like':'%'+_0x2e6e6c[_0x3d4b('0x35')]['filter']+'%'};return _0x5b1265;}})});}_0x4b9ab2=_[_0x3d4b('0x42')]({},_0x4b9ab2,_0x2e6e6c['options']);var _0x1e40f3={'where':_0x4b9ab2[_0x3d4b('0x3e')]};return db[_0x3d4b('0x2f')]['count'](_0x1e40f3)[_0x3d4b('0x27')](function(_0x51d29d){_0x35878e[_0x3d4b('0x43')]=_0x51d29d;if(_0x2e6e6c[_0x3d4b('0x35')][_0x3d4b('0x44')]){_0x4b9ab2[_0x3d4b('0x45')]=[{'all':!![]}];}return db[_0x3d4b('0x2f')][_0x3d4b('0x46')](_0x4b9ab2);})[_0x3d4b('0x27')](function(_0x4b9273){_0x35878e[_0x3d4b('0x47')]=_0x4b9273;return _0x35878e;})['then'](respondWithFilteredResult(_0xadd959,_0x4b9ab2))[_0x3d4b('0x48')](handleError(_0xadd959,null));};exports[_0x3d4b('0x49')]=function(_0x41d529,_0x42d8e8){var _0x282f8c={'raw':![],'where':{'id':_0x41d529[_0x3d4b('0x4a')]['id']}},_0x47a10d={};_0x47a10d[_0x3d4b('0x3a')]=_[_0x3d4b('0x36')](db[_0x3d4b('0x2f')][_0x3d4b('0x30')]);_0x47a10d[_0x3d4b('0x35')]=_[_0x3d4b('0x36')](_0x41d529[_0x3d4b('0x35')]);_0x47a10d['filters']=_[_0x3d4b('0x38')](_0x47a10d[_0x3d4b('0x3a')],_0x47a10d[_0x3d4b('0x35')]);_0x282f8c[_0x3d4b('0x39')]=_['intersection'](_0x47a10d[_0x3d4b('0x3a')],qs['fields'](_0x41d529['query'][_0x3d4b('0x3b')]));_0x282f8c[_0x3d4b('0x39')]=_0x282f8c[_0x3d4b('0x39')][_0x3d4b('0x4b')]?_0x282f8c[_0x3d4b('0x39')]:_0x47a10d[_0x3d4b('0x3a')];if(_0x41d529[_0x3d4b('0x35')]['includeAll']){_0x282f8c[_0x3d4b('0x45')]=[{'all':!![]}];}_0x282f8c=_['merge']({},_0x282f8c,_0x41d529[_0x3d4b('0x4c')]);return db[_0x3d4b('0x2f')][_0x3d4b('0x4d')](_0x282f8c)[_0x3d4b('0x27')](handleEntityNotFound(_0x42d8e8,null))[_0x3d4b('0x27')](respondWithResult(_0x42d8e8,null))['catch'](handleError(_0x42d8e8,null));};exports[_0x3d4b('0x4e')]=function(_0x409acd,_0x298842){return db[_0x3d4b('0x2f')][_0x3d4b('0x4e')](_0x409acd[_0x3d4b('0x4f')],{})['then'](respondWithResult(_0x298842,0xc9))['catch'](handleError(_0x298842,null));};exports['update']=function(_0x19c1f0,_0x98bc96){if(_0x19c1f0[_0x3d4b('0x4f')]['id']){delete _0x19c1f0[_0x3d4b('0x4f')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x19c1f0[_0x3d4b('0x4a')]['id']}})[_0x3d4b('0x27')](handleEntityNotFound(_0x98bc96,null))[_0x3d4b('0x27')](saveUpdates(_0x19c1f0['body'],null))[_0x3d4b('0x27')](respondWithResult(_0x98bc96,null))[_0x3d4b('0x48')](handleError(_0x98bc96,null));};exports[_0x3d4b('0x28')]=function(_0x277fe1,_0x3a93a2){return db[_0x3d4b('0x2f')][_0x3d4b('0x4d')]({'where':{'id':_0x277fe1[_0x3d4b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a93a2,null))[_0x3d4b('0x27')](removeEntity(_0x3a93a2,null))['catch'](handleError(_0x3a93a2,null));};exports[_0x3d4b('0x50')]=function(_0x32e46b,_0x603995,_0x482e27){var _0x455a34={};var _0x198509={};var _0x41e2b6;var _0x282c50;return db[_0x3d4b('0x2f')]['findOne']({'where':{'id':_0x32e46b[_0x3d4b('0x4a')]['id']}})[_0x3d4b('0x27')](handleEntityNotFound(_0x603995,null))[_0x3d4b('0x27')](function(_0x267150){if(_0x267150){_0x41e2b6=_0x267150;_0x198509[_0x3d4b('0x3a')]=_[_0x3d4b('0x36')](db[_0x3d4b('0x51')]['rawAttributes']);_0x198509[_0x3d4b('0x35')]=_[_0x3d4b('0x36')](_0x32e46b['query']);_0x198509[_0x3d4b('0x37')]=_[_0x3d4b('0x38')](_0x198509['model'],_0x198509[_0x3d4b('0x35')]);_0x455a34['attributes']=_[_0x3d4b('0x38')](_0x198509[_0x3d4b('0x3a')],qs[_0x3d4b('0x3b')](_0x32e46b[_0x3d4b('0x35')][_0x3d4b('0x3b')]));_0x455a34[_0x3d4b('0x39')]=_0x455a34[_0x3d4b('0x39')][_0x3d4b('0x4b')]?_0x455a34[_0x3d4b('0x39')]:_0x198509[_0x3d4b('0x3a')];_0x455a34[_0x3d4b('0x52')]=qs[_0x3d4b('0x53')](_0x32e46b[_0x3d4b('0x35')]['sort']);_0x455a34[_0x3d4b('0x3e')]=qs[_0x3d4b('0x37')](_['pick'](_0x32e46b[_0x3d4b('0x35')],_0x198509[_0x3d4b('0x37')]));if(_0x32e46b[_0x3d4b('0x35')][_0x3d4b('0x40')]){_0x455a34[_0x3d4b('0x3e')]=_[_0x3d4b('0x42')](_0x455a34[_0x3d4b('0x3e')],{'$or':_['map'](_0x455a34[_0x3d4b('0x39')],function(_0x3649af){var _0x33b34f={};_0x33b34f[_0x3649af]={'$like':'%'+_0x32e46b['query'][_0x3d4b('0x40')]+'%'};return _0x33b34f;})});}_0x455a34=_['merge']({},_0x455a34,_0x32e46b[_0x3d4b('0x4c')]);return _0x41e2b6[_0x3d4b('0x50')](_0x455a34);}})[_0x3d4b('0x27')](function(_0x142586){if(_0x142586){_0x282c50=_0x142586[_0x3d4b('0x4b')];if(!_0x32e46b['query']['hasOwnProperty'](_0x3d4b('0x3d'))){_0x455a34['limit']=qs[_0x3d4b('0x22')](_0x32e46b[_0x3d4b('0x35')][_0x3d4b('0x22')]);_0x455a34[_0x3d4b('0x20')]=qs[_0x3d4b('0x20')](_0x32e46b[_0x3d4b('0x35')][_0x3d4b('0x20')]);}return _0x41e2b6[_0x3d4b('0x50')](_0x455a34);}})[_0x3d4b('0x27')](function(_0x47f81){if(_0x47f81){return _0x47f81?{'count':_0x282c50,'rows':_0x47f81}:null;}})[_0x3d4b('0x27')](respondWithResult(_0x603995,null))[_0x3d4b('0x48')](handleError(_0x603995,null));};exports[_0x3d4b('0x54')]=function(_0x52b639,_0x4b559a,_0x46ba6d){var _0x116adb={};var _0x19ad3e={};var _0x1d212f;var _0x2c1f00;return db[_0x3d4b('0x2f')][_0x3d4b('0x55')]({'where':{'id':_0x52b639[_0x3d4b('0x4a')]['id']}})[_0x3d4b('0x27')](handleEntityNotFound(_0x4b559a,null))[_0x3d4b('0x27')](function(_0x2c9a7f){if(_0x2c9a7f){_0x1d212f=_0x2c9a7f;_0x19ad3e[_0x3d4b('0x3a')]=_[_0x3d4b('0x36')](db[_0x3d4b('0x51')][_0x3d4b('0x30')]);_0x19ad3e[_0x3d4b('0x35')]=_[_0x3d4b('0x36')](_0x52b639[_0x3d4b('0x35')]);_0x19ad3e['filters']=_[_0x3d4b('0x38')](_0x19ad3e[_0x3d4b('0x3a')],_0x19ad3e['query']);_0x116adb[_0x3d4b('0x39')]=_[_0x3d4b('0x38')](_0x19ad3e['model'],qs[_0x3d4b('0x3b')](_0x52b639[_0x3d4b('0x35')][_0x3d4b('0x3b')]));_0x116adb[_0x3d4b('0x39')]=_0x116adb[_0x3d4b('0x39')]['length']?_0x116adb[_0x3d4b('0x39')]:_0x19ad3e[_0x3d4b('0x3a')];_0x116adb[_0x3d4b('0x52')]=qs[_0x3d4b('0x53')](_0x52b639['query'][_0x3d4b('0x53')]);_0x116adb[_0x3d4b('0x3e')]=qs[_0x3d4b('0x37')](_[_0x3d4b('0x3f')](_0x52b639[_0x3d4b('0x35')],_0x19ad3e['filters']));if(_0x52b639[_0x3d4b('0x35')][_0x3d4b('0x40')]){_0x116adb['where']=_[_0x3d4b('0x42')](_0x116adb['where'],{'$or':_['map'](_0x116adb[_0x3d4b('0x39')],function(_0x545c6a){var _0x138575={};_0x138575[_0x545c6a]={'$like':'%'+_0x52b639['query'][_0x3d4b('0x40')]+'%'};return _0x138575;})});}_0x116adb=_[_0x3d4b('0x42')]({},_0x116adb,_0x52b639['options']);return _0x1d212f['getSubjects'](_0x116adb);}})[_0x3d4b('0x27')](function(_0x2a46e8){if(_0x2a46e8){_0x2c1f00=_0x2a46e8[_0x3d4b('0x4b')];if(!_0x52b639['query'][_0x3d4b('0x3c')](_0x3d4b('0x3d'))){_0x116adb['limit']=qs[_0x3d4b('0x22')](_0x52b639[_0x3d4b('0x35')][_0x3d4b('0x22')]);_0x116adb[_0x3d4b('0x20')]=qs['offset'](_0x52b639[_0x3d4b('0x35')][_0x3d4b('0x20')]);}return _0x1d212f[_0x3d4b('0x54')](_0x116adb);}})[_0x3d4b('0x27')](function(_0x4e389a){if(_0x4e389a){return _0x4e389a?{'count':_0x2c1f00,'rows':_0x4e389a}:null;}})[_0x3d4b('0x27')](respondWithResult(_0x4b559a,null))[_0x3d4b('0x48')](handleError(_0x4b559a,null));};exports[_0x3d4b('0x56')]=function(_0x39a121,_0xa2fb20,_0x27fd6b){var _0x41b6fb={};var _0x57f883={};var _0x35a8f5;var _0x379c90;return db[_0x3d4b('0x2f')][_0x3d4b('0x55')]({'where':{'id':_0x39a121['params']['id']}})[_0x3d4b('0x27')](handleEntityNotFound(_0xa2fb20,null))[_0x3d4b('0x27')](function(_0x532b34){if(_0x532b34){_0x35a8f5=_0x532b34;_0x57f883[_0x3d4b('0x3a')]=_[_0x3d4b('0x36')](db[_0x3d4b('0x51')][_0x3d4b('0x30')]);_0x57f883[_0x3d4b('0x35')]=_[_0x3d4b('0x36')](_0x39a121[_0x3d4b('0x35')]);_0x57f883['filters']=_['intersection'](_0x57f883['model'],_0x57f883[_0x3d4b('0x35')]);_0x41b6fb[_0x3d4b('0x39')]=_[_0x3d4b('0x38')](_0x57f883[_0x3d4b('0x3a')],qs['fields'](_0x39a121[_0x3d4b('0x35')][_0x3d4b('0x3b')]));_0x41b6fb[_0x3d4b('0x39')]=_0x41b6fb[_0x3d4b('0x39')][_0x3d4b('0x4b')]?_0x41b6fb[_0x3d4b('0x39')]:_0x57f883[_0x3d4b('0x3a')];_0x41b6fb[_0x3d4b('0x52')]=qs[_0x3d4b('0x53')](_0x39a121['query']['sort']);_0x41b6fb[_0x3d4b('0x3e')]=qs[_0x3d4b('0x37')](_[_0x3d4b('0x3f')](_0x39a121[_0x3d4b('0x35')],_0x57f883[_0x3d4b('0x37')]));if(_0x39a121[_0x3d4b('0x35')]['filter']){_0x41b6fb[_0x3d4b('0x3e')]=_['merge'](_0x41b6fb[_0x3d4b('0x3e')],{'$or':_['map'](_0x41b6fb[_0x3d4b('0x39')],function(_0xa06b4b){var _0x2d808a={};_0x2d808a[_0xa06b4b]={'$like':'%'+_0x39a121[_0x3d4b('0x35')][_0x3d4b('0x40')]+'%'};return _0x2d808a;})});}_0x41b6fb=_['merge']({},_0x41b6fb,_0x39a121['options']);return _0x35a8f5[_0x3d4b('0x56')](_0x41b6fb);}})[_0x3d4b('0x27')](function(_0xde90e8){if(_0xde90e8){_0x379c90=_0xde90e8[_0x3d4b('0x4b')];if(!_0x39a121[_0x3d4b('0x35')][_0x3d4b('0x3c')](_0x3d4b('0x3d'))){_0x41b6fb[_0x3d4b('0x22')]=qs['limit'](_0x39a121['query'][_0x3d4b('0x22')]);_0x41b6fb['offset']=qs['offset'](_0x39a121[_0x3d4b('0x35')][_0x3d4b('0x20')]);}return _0x35a8f5[_0x3d4b('0x56')](_0x41b6fb);}})[_0x3d4b('0x27')](function(_0xe31ec8){if(_0xe31ec8){return _0xe31ec8?{'count':_0x379c90,'rows':_0xe31ec8}:null;}})[_0x3d4b('0x27')](respondWithResult(_0xa2fb20,null))[_0x3d4b('0x48')](handleError(_0xa2fb20,null));}; \ No newline at end of file +var _0x003d=['fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getFields','findOne','Dynamics365Field','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','index','map','Dynamics365Configuration'];(function(_0x5566fe,_0xb283a1){var _0x11b0c7=function(_0x1ca8f0){while(--_0x1ca8f0){_0x5566fe['push'](_0x5566fe['shift']());}};_0x11b0c7(++_0xb283a1);}(_0x003d,0x161));var _0xd003=function(_0x302b2e,_0x2dd196){_0x302b2e=_0x302b2e-0x0;var _0x57a8d0=_0x003d[_0x302b2e];return _0x57a8d0;};'use strict';var emlformat=require(_0xd003('0x0'));var rimraf=require(_0xd003('0x1'));var zipdir=require(_0xd003('0x2'));var jsonpatch=require(_0xd003('0x3'));var rp=require(_0xd003('0x4'));var moment=require(_0xd003('0x5'));var BPromise=require(_0xd003('0x6'));var Mustache=require(_0xd003('0x7'));var util=require('util');var path=require(_0xd003('0x8'));var sox=require('sox');var csv=require(_0xd003('0x9'));var ejs=require(_0xd003('0xa'));var fs=require('fs');var fs_extra=require(_0xd003('0xb'));var _=require(_0xd003('0xc'));var squel=require('squel');var crypto=require(_0xd003('0xd'));var jsforce=require(_0xd003('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd003('0x9'));var querystring=require(_0xd003('0xf'));var Papa=require(_0xd003('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd003('0x11'));var hardwareService=require(_0xd003('0x12'));var logger=require(_0xd003('0x13'))(_0xd003('0x14'));var utils=require('../../config/utils');var config=require(_0xd003('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd003('0x16'))['db'];function respondWithStatusCode(_0x30cbc7,_0x288f56){_0x288f56=_0x288f56||0xcc;return function(_0x543ad2){if(_0x543ad2){return _0x30cbc7['sendStatus'](_0x288f56);}return _0x30cbc7[_0xd003('0x17')](_0x288f56)[_0xd003('0x18')]();};}function respondWithResult(_0x3afa90,_0x5370ad){_0x5370ad=_0x5370ad||0xc8;return function(_0x4a6216){if(_0x4a6216){return _0x3afa90[_0xd003('0x17')](_0x5370ad)[_0xd003('0x19')](_0x4a6216);}};}function respondWithFilteredResult(_0x41ea00,_0x2860cc){return function(_0x41a07b){if(_0x41a07b){var _0x44d8d9=typeof _0x2860cc[_0xd003('0x1a')]==='undefined'&&typeof _0x2860cc['limit']===_0xd003('0x1b');var _0x1f397a=_0x41a07b[_0xd003('0x1c')];var _0x39bab5=_0x44d8d9?0x0:_0x2860cc[_0xd003('0x1a')];var _0x169eda=_0x44d8d9?_0x41a07b[_0xd003('0x1c')]:_0x2860cc[_0xd003('0x1a')]+_0x2860cc['limit'];var _0x5cf0cf;if(_0x169eda>=_0x1f397a){_0x169eda=_0x1f397a;_0x5cf0cf=0xc8;}else{_0x5cf0cf=0xce;}_0x41ea00[_0xd003('0x17')](_0x5cf0cf);return _0x41ea00[_0xd003('0x1d')](_0xd003('0x1e'),_0x39bab5+'-'+_0x169eda+'/'+_0x1f397a)[_0xd003('0x19')](_0x41a07b);}return null;};}function patchUpdates(_0x6658b7){return function(_0x4e9453){try{jsonpatch[_0xd003('0x1f')](_0x4e9453,_0x6658b7,!![]);}catch(_0x5df3db){return BPromise['reject'](_0x5df3db);}return _0x4e9453['save']();};}function saveUpdates(_0x28fec6,_0x26e6e2){return function(_0x4c0866){if(_0x4c0866){return _0x4c0866[_0xd003('0x20')](_0x28fec6)[_0xd003('0x21')](function(_0x37596a){return _0x37596a;});}return null;};}function removeEntity(_0x71d8ac,_0xfeb071){return function(_0x393c05){if(_0x393c05){return _0x393c05[_0xd003('0x22')]()[_0xd003('0x21')](function(){_0x71d8ac[_0xd003('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc323c9,_0x55e16c){return function(_0x5dd6a7){if(!_0x5dd6a7){_0xc323c9[_0xd003('0x23')](0x194);}return _0x5dd6a7;};}function handleError(_0x53b855,_0x16bf72){_0x16bf72=_0x16bf72||0x1f4;return function(_0x574149){logger[_0xd003('0x24')](_0x574149[_0xd003('0x25')]);if(_0x574149[_0xd003('0x26')]){delete _0x574149['name'];}_0x53b855[_0xd003('0x17')](_0x16bf72)['send'](_0x574149);};}exports[_0xd003('0x27')]=function(_0x1e76f7,_0x4da14b){var _0x58f7b3={},_0xb934a2={},_0x6db9f9={'count':0x0,'rows':[]};var _0x59f0a3=_[_0xd003('0x28')](db[_0xd003('0x29')]['rawAttributes'],function(_0x1b28f6){return{'name':_0x1b28f6[_0xd003('0x2a')],'type':_0x1b28f6[_0xd003('0x2b')]['key']};});_0xb934a2[_0xd003('0x2c')]=_[_0xd003('0x28')](_0x59f0a3,_0xd003('0x26'));_0xb934a2['query']=_['keys'](_0x1e76f7[_0xd003('0x2d')]);_0xb934a2[_0xd003('0x2e')]=_[_0xd003('0x2f')](_0xb934a2[_0xd003('0x2c')],_0xb934a2['query']);_0x58f7b3['attributes']=_[_0xd003('0x2f')](_0xb934a2['model'],qs[_0xd003('0x30')](_0x1e76f7[_0xd003('0x2d')]['fields']));_0x58f7b3[_0xd003('0x31')]=_0x58f7b3[_0xd003('0x31')][_0xd003('0x32')]?_0x58f7b3[_0xd003('0x31')]:_0xb934a2[_0xd003('0x2c')];if(!_0x1e76f7[_0xd003('0x2d')]['hasOwnProperty'](_0xd003('0x33'))){_0x58f7b3[_0xd003('0x34')]=qs[_0xd003('0x34')](_0x1e76f7['query'][_0xd003('0x34')]);_0x58f7b3['offset']=qs[_0xd003('0x1a')](_0x1e76f7['query'][_0xd003('0x1a')]);}_0x58f7b3[_0xd003('0x35')]=qs[_0xd003('0x36')](_0x1e76f7[_0xd003('0x2d')][_0xd003('0x36')]);_0x58f7b3['where']=qs['filters'](_['pick'](_0x1e76f7[_0xd003('0x2d')],_0xb934a2[_0xd003('0x2e')]),_0x59f0a3);if(_0x1e76f7['query'][_0xd003('0x37')]){_0x58f7b3[_0xd003('0x38')]=_[_0xd003('0x39')](_0x58f7b3['where'],{'$or':_[_0xd003('0x28')](_0x59f0a3,function(_0x5aa775){if(_0x5aa775['type']!==_0xd003('0x3a')){var _0x1cd531={};_0x1cd531[_0x5aa775['name']]={'$like':'%'+_0x1e76f7[_0xd003('0x2d')][_0xd003('0x37')]+'%'};return _0x1cd531;}})});}_0x58f7b3=_[_0xd003('0x39')]({},_0x58f7b3,_0x1e76f7[_0xd003('0x3b')]);var _0x516d8a={'where':_0x58f7b3['where']};return db[_0xd003('0x29')][_0xd003('0x1c')](_0x516d8a)[_0xd003('0x21')](function(_0x18225b){_0x6db9f9['count']=_0x18225b;if(_0x1e76f7[_0xd003('0x2d')]['includeAll']){_0x58f7b3[_0xd003('0x3c')]=[{'all':!![]}];}return db[_0xd003('0x29')][_0xd003('0x3d')](_0x58f7b3);})['then'](function(_0x28a6b5){_0x6db9f9[_0xd003('0x3e')]=_0x28a6b5;return _0x6db9f9;})[_0xd003('0x21')](respondWithFilteredResult(_0x4da14b,_0x58f7b3))[_0xd003('0x3f')](handleError(_0x4da14b,null));};exports[_0xd003('0x40')]=function(_0x5f0488,_0x5bf26d){var _0x3a9386={'raw':![],'where':{'id':_0x5f0488[_0xd003('0x41')]['id']}},_0x134d89={};_0x134d89['model']=_[_0xd003('0x42')](db['Dynamics365Configuration']['rawAttributes']);_0x134d89[_0xd003('0x2d')]=_[_0xd003('0x42')](_0x5f0488[_0xd003('0x2d')]);_0x134d89[_0xd003('0x2e')]=_[_0xd003('0x2f')](_0x134d89[_0xd003('0x2c')],_0x134d89[_0xd003('0x2d')]);_0x3a9386[_0xd003('0x31')]=_[_0xd003('0x2f')](_0x134d89[_0xd003('0x2c')],qs[_0xd003('0x30')](_0x5f0488['query'][_0xd003('0x30')]));_0x3a9386[_0xd003('0x31')]=_0x3a9386[_0xd003('0x31')][_0xd003('0x32')]?_0x3a9386['attributes']:_0x134d89[_0xd003('0x2c')];if(_0x5f0488[_0xd003('0x2d')][_0xd003('0x43')]){_0x3a9386[_0xd003('0x3c')]=[{'all':!![]}];}_0x3a9386=_['merge']({},_0x3a9386,_0x5f0488['options']);return db[_0xd003('0x29')][_0xd003('0x44')](_0x3a9386)[_0xd003('0x21')](handleEntityNotFound(_0x5bf26d,null))['then'](respondWithResult(_0x5bf26d,null))[_0xd003('0x3f')](handleError(_0x5bf26d,null));};exports[_0xd003('0x45')]=function(_0x29419b,_0x1f784d){return db['Dynamics365Configuration'][_0xd003('0x45')](_0x29419b[_0xd003('0x46')],{})['then'](respondWithResult(_0x1f784d,0xc9))[_0xd003('0x3f')](handleError(_0x1f784d,null));};exports[_0xd003('0x20')]=function(_0x54be74,_0xe705ce){if(_0x54be74[_0xd003('0x46')]['id']){delete _0x54be74['body']['id'];}return db[_0xd003('0x29')]['find']({'where':{'id':_0x54be74['params']['id']}})[_0xd003('0x21')](handleEntityNotFound(_0xe705ce,null))[_0xd003('0x21')](saveUpdates(_0x54be74[_0xd003('0x46')],null))[_0xd003('0x21')](respondWithResult(_0xe705ce,null))[_0xd003('0x3f')](handleError(_0xe705ce,null));};exports[_0xd003('0x22')]=function(_0x35ee05,_0x913395){return db[_0xd003('0x29')][_0xd003('0x44')]({'where':{'id':_0x35ee05[_0xd003('0x41')]['id']}})[_0xd003('0x21')](handleEntityNotFound(_0x913395,null))['then'](removeEntity(_0x913395,null))['catch'](handleError(_0x913395,null));};exports[_0xd003('0x47')]=function(_0x484164,_0x5ee48a,_0x15659b){var _0x347c89={};var _0x3a5136={};var _0x376a0d;var _0x213cb8;return db[_0xd003('0x29')][_0xd003('0x48')]({'where':{'id':_0x484164[_0xd003('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ee48a,null))[_0xd003('0x21')](function(_0x16ab49){if(_0x16ab49){_0x376a0d=_0x16ab49;_0x3a5136['model']=_[_0xd003('0x42')](db[_0xd003('0x49')][_0xd003('0x4a')]);_0x3a5136[_0xd003('0x2d')]=_[_0xd003('0x42')](_0x484164[_0xd003('0x2d')]);_0x3a5136[_0xd003('0x2e')]=_[_0xd003('0x2f')](_0x3a5136['model'],_0x3a5136[_0xd003('0x2d')]);_0x347c89[_0xd003('0x31')]=_[_0xd003('0x2f')](_0x3a5136[_0xd003('0x2c')],qs[_0xd003('0x30')](_0x484164[_0xd003('0x2d')][_0xd003('0x30')]));_0x347c89[_0xd003('0x31')]=_0x347c89[_0xd003('0x31')][_0xd003('0x32')]?_0x347c89[_0xd003('0x31')]:_0x3a5136[_0xd003('0x2c')];_0x347c89[_0xd003('0x35')]=qs[_0xd003('0x36')](_0x484164[_0xd003('0x2d')][_0xd003('0x36')]);_0x347c89[_0xd003('0x38')]=qs['filters'](_['pick'](_0x484164[_0xd003('0x2d')],_0x3a5136[_0xd003('0x2e')]));if(_0x484164['query']['filter']){_0x347c89[_0xd003('0x38')]=_['merge'](_0x347c89[_0xd003('0x38')],{'$or':_['map'](_0x347c89[_0xd003('0x31')],function(_0x2b30df){var _0x53d8f1={};_0x53d8f1[_0x2b30df]={'$like':'%'+_0x484164[_0xd003('0x2d')][_0xd003('0x37')]+'%'};return _0x53d8f1;})});}_0x347c89=_[_0xd003('0x39')]({},_0x347c89,_0x484164[_0xd003('0x3b')]);return _0x376a0d[_0xd003('0x47')](_0x347c89);}})[_0xd003('0x21')](function(_0x4a693a){if(_0x4a693a){_0x213cb8=_0x4a693a[_0xd003('0x32')];if(!_0x484164['query'][_0xd003('0x4b')]('nolimit')){_0x347c89[_0xd003('0x34')]=qs[_0xd003('0x34')](_0x484164[_0xd003('0x2d')][_0xd003('0x34')]);_0x347c89[_0xd003('0x1a')]=qs[_0xd003('0x1a')](_0x484164[_0xd003('0x2d')][_0xd003('0x1a')]);}return _0x376a0d[_0xd003('0x47')](_0x347c89);}})['then'](function(_0x29308f){if(_0x29308f){return _0x29308f?{'count':_0x213cb8,'rows':_0x29308f}:null;}})[_0xd003('0x21')](respondWithResult(_0x5ee48a,null))['catch'](handleError(_0x5ee48a,null));};exports[_0xd003('0x4c')]=function(_0xeefcad,_0x25693e,_0x1ccf1e){var _0x1cb478={};var _0x50a1e4={};var _0x2034f5;var _0x2ad21c;return db[_0xd003('0x29')][_0xd003('0x48')]({'where':{'id':_0xeefcad[_0xd003('0x41')]['id']}})[_0xd003('0x21')](handleEntityNotFound(_0x25693e,null))[_0xd003('0x21')](function(_0x4eedbb){if(_0x4eedbb){_0x2034f5=_0x4eedbb;_0x50a1e4[_0xd003('0x2c')]=_['keys'](db[_0xd003('0x49')][_0xd003('0x4a')]);_0x50a1e4['query']=_[_0xd003('0x42')](_0xeefcad[_0xd003('0x2d')]);_0x50a1e4['filters']=_[_0xd003('0x2f')](_0x50a1e4[_0xd003('0x2c')],_0x50a1e4[_0xd003('0x2d')]);_0x1cb478[_0xd003('0x31')]=_[_0xd003('0x2f')](_0x50a1e4['model'],qs[_0xd003('0x30')](_0xeefcad['query'][_0xd003('0x30')]));_0x1cb478['attributes']=_0x1cb478[_0xd003('0x31')][_0xd003('0x32')]?_0x1cb478[_0xd003('0x31')]:_0x50a1e4[_0xd003('0x2c')];_0x1cb478[_0xd003('0x35')]=qs['sort'](_0xeefcad[_0xd003('0x2d')][_0xd003('0x36')]);_0x1cb478['where']=qs['filters'](_['pick'](_0xeefcad[_0xd003('0x2d')],_0x50a1e4[_0xd003('0x2e')]));if(_0xeefcad[_0xd003('0x2d')][_0xd003('0x37')]){_0x1cb478[_0xd003('0x38')]=_[_0xd003('0x39')](_0x1cb478[_0xd003('0x38')],{'$or':_[_0xd003('0x28')](_0x1cb478[_0xd003('0x31')],function(_0x89186b){var _0x2466fb={};_0x2466fb[_0x89186b]={'$like':'%'+_0xeefcad[_0xd003('0x2d')][_0xd003('0x37')]+'%'};return _0x2466fb;})});}_0x1cb478=_[_0xd003('0x39')]({},_0x1cb478,_0xeefcad[_0xd003('0x3b')]);return _0x2034f5['getSubjects'](_0x1cb478);}})['then'](function(_0x39447c){if(_0x39447c){_0x2ad21c=_0x39447c[_0xd003('0x32')];if(!_0xeefcad[_0xd003('0x2d')][_0xd003('0x4b')](_0xd003('0x33'))){_0x1cb478[_0xd003('0x34')]=qs[_0xd003('0x34')](_0xeefcad[_0xd003('0x2d')][_0xd003('0x34')]);_0x1cb478[_0xd003('0x1a')]=qs['offset'](_0xeefcad[_0xd003('0x2d')]['offset']);}return _0x2034f5[_0xd003('0x4c')](_0x1cb478);}})[_0xd003('0x21')](function(_0x1ae7f8){if(_0x1ae7f8){return _0x1ae7f8?{'count':_0x2ad21c,'rows':_0x1ae7f8}:null;}})[_0xd003('0x21')](respondWithResult(_0x25693e,null))[_0xd003('0x3f')](handleError(_0x25693e,null));};exports[_0xd003('0x4d')]=function(_0x278563,_0x4eab66,_0x46c0cc){var _0x5a8cb2={};var _0x2ca550={};var _0x532206;var _0x2256d6;return db['Dynamics365Configuration'][_0xd003('0x48')]({'where':{'id':_0x278563[_0xd003('0x41')]['id']}})['then'](handleEntityNotFound(_0x4eab66,null))[_0xd003('0x21')](function(_0x1ead0e){if(_0x1ead0e){_0x532206=_0x1ead0e;_0x2ca550[_0xd003('0x2c')]=_[_0xd003('0x42')](db['Dynamics365Field']['rawAttributes']);_0x2ca550[_0xd003('0x2d')]=_['keys'](_0x278563['query']);_0x2ca550[_0xd003('0x2e')]=_[_0xd003('0x2f')](_0x2ca550[_0xd003('0x2c')],_0x2ca550[_0xd003('0x2d')]);_0x5a8cb2['attributes']=_[_0xd003('0x2f')](_0x2ca550[_0xd003('0x2c')],qs[_0xd003('0x30')](_0x278563[_0xd003('0x2d')][_0xd003('0x30')]));_0x5a8cb2[_0xd003('0x31')]=_0x5a8cb2[_0xd003('0x31')][_0xd003('0x32')]?_0x5a8cb2['attributes']:_0x2ca550[_0xd003('0x2c')];_0x5a8cb2[_0xd003('0x35')]=qs['sort'](_0x278563['query'][_0xd003('0x36')]);_0x5a8cb2[_0xd003('0x38')]=qs[_0xd003('0x2e')](_[_0xd003('0x4e')](_0x278563['query'],_0x2ca550[_0xd003('0x2e')]));if(_0x278563[_0xd003('0x2d')][_0xd003('0x37')]){_0x5a8cb2['where']=_[_0xd003('0x39')](_0x5a8cb2[_0xd003('0x38')],{'$or':_[_0xd003('0x28')](_0x5a8cb2['attributes'],function(_0x1369c5){var _0x37cebe={};_0x37cebe[_0x1369c5]={'$like':'%'+_0x278563[_0xd003('0x2d')][_0xd003('0x37')]+'%'};return _0x37cebe;})});}_0x5a8cb2=_[_0xd003('0x39')]({},_0x5a8cb2,_0x278563[_0xd003('0x3b')]);return _0x532206[_0xd003('0x4d')](_0x5a8cb2);}})[_0xd003('0x21')](function(_0x347d3c){if(_0x347d3c){_0x2256d6=_0x347d3c[_0xd003('0x32')];if(!_0x278563[_0xd003('0x2d')][_0xd003('0x4b')](_0xd003('0x33'))){_0x5a8cb2[_0xd003('0x34')]=qs[_0xd003('0x34')](_0x278563['query'][_0xd003('0x34')]);_0x5a8cb2['offset']=qs['offset'](_0x278563[_0xd003('0x2d')]['offset']);}return _0x532206[_0xd003('0x4d')](_0x5a8cb2);}})[_0xd003('0x21')](function(_0x2046da){if(_0x2046da){return _0x2046da?{'count':_0x2256d6,'rows':_0x2046da}:null;}})[_0xd003('0x21')](respondWithResult(_0x4eab66,null))[_0xd003('0x3f')](handleError(_0x4eab66,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5914461..87bdc12 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 _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x2cf676,_0x528711){var _0x55ba=function(_0x22e9a9){while(--_0x22e9a9){_0x2cf676['push'](_0x2cf676['shift']());}};_0x55ba(++_0x528711);}(_0x34e8,0x12c));var _0x834e=function(_0x170332,_0x571e7c){_0x170332=_0x170332-0x0;var _0xa14191=_0x34e8[_0x170332];return _0xa14191;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xf77b8c,_0x339ce8){var _0x2a78ce=function(_0x531d15){while(--_0x531d15){_0xf77b8c['push'](_0xf77b8c['shift']());}};_0x2a78ce(++_0x339ce8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'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 f4e9652..485fd70 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 _0xdb0e=['error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb0e,0xa6));var _0xedb0=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xdb0e[_0x516927];return _0x30749b;};'use strict';var _=require(_0xedb0('0x0'));var util=require(_0xedb0('0x1'));var moment=require(_0xedb0('0x2'));var BPromise=require(_0xedb0('0x3'));var rs=require(_0xedb0('0x4'));var fs=require('fs');var Redis=require(_0xedb0('0x5'));var db=require(_0xedb0('0x6'))['db'];var utils=require(_0xedb0('0x7'));var logger=require(_0xedb0('0x8'))('rpc');var config=require(_0xedb0('0x9'));var jayson=require(_0xedb0('0xa'));var client=jayson['client'][_0xedb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412cec,_0xf1161,_0x172262){return new BPromise(function(_0x5c6389,_0x4b9caa){return client[_0xedb0('0xc')](_0x412cec,_0x172262)[_0xedb0('0xd')](function(_0x45e020){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0xf1161,_0xedb0('0xe'));logger[_0xedb0('0xf')](_0xedb0('0x10'),_0xf1161,_0xedb0('0xe'),JSON[_0xedb0('0x11')](_0x45e020));if(_0x45e020[_0xedb0('0x12')]){if(_0x45e020[_0xedb0('0x12')][_0xedb0('0x13')]===0x1f4){logger['error'](_0xedb0('0x14'),_0xf1161,_0x45e020[_0xedb0('0x12')]['message']);return _0x4b9caa(_0x45e020['error'][_0xedb0('0x15')]);}logger[_0xedb0('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0xf1161,_0x45e020[_0xedb0('0x12')]['message']);return _0x5c6389(_0x45e020['error']['message']);}else{logger['info'](_0xedb0('0x14'),_0xf1161,_0xedb0('0xe'));_0x5c6389(_0x45e020['result'][_0xedb0('0x15')]);}})[_0xedb0('0x16')](function(_0x53097d){logger[_0xedb0('0x12')](_0xedb0('0x14'),_0xf1161,_0x53097d);_0x4b9caa(_0x53097d);});});} \ No newline at end of file +var _0x47c1=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x23bd05,_0x409ba8){var _0x2ea842=function(_0x55ff6d){while(--_0x55ff6d){_0x23bd05['push'](_0x23bd05['shift']());}};_0x2ea842(++_0x409ba8);}(_0x47c1,0x1e3));var _0x147c=function(_0xba2d3b,_0x1f1746){_0xba2d3b=_0xba2d3b-0x0;var _0x2f4275=_0x47c1[_0xba2d3b];return _0x2f4275;};'use strict';var _=require(_0x147c('0x0'));var util=require(_0x147c('0x1'));var moment=require(_0x147c('0x2'));var BPromise=require(_0x147c('0x3'));var rs=require(_0x147c('0x4'));var fs=require('fs');var Redis=require(_0x147c('0x5'));var db=require(_0x147c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x147c('0x7'))(_0x147c('0x8'));var config=require(_0x147c('0x9'));var jayson=require(_0x147c('0xa'));var client=jayson[_0x147c('0xb')][_0x147c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x396aad,_0x1a9ff5,_0x4b5783){return new BPromise(function(_0x5d6fef,_0x543d3e){return client[_0x147c('0xd')](_0x396aad,_0x4b5783)[_0x147c('0xe')](function(_0x2aae3a){logger[_0x147c('0xf')](_0x147c('0x10'),_0x1a9ff5,_0x147c('0x11'));logger[_0x147c('0x12')](_0x147c('0x13'),_0x1a9ff5,_0x147c('0x11'),JSON[_0x147c('0x14')](_0x2aae3a));if(_0x2aae3a['error']){if(_0x2aae3a[_0x147c('0x15')]['code']===0x1f4){logger[_0x147c('0x15')](_0x147c('0x10'),_0x1a9ff5,_0x2aae3a[_0x147c('0x15')]['message']);return _0x543d3e(_0x2aae3a[_0x147c('0x15')][_0x147c('0x16')]);}logger[_0x147c('0x15')](_0x147c('0x10'),_0x1a9ff5,_0x2aae3a[_0x147c('0x15')][_0x147c('0x16')]);return _0x5d6fef(_0x2aae3a[_0x147c('0x15')][_0x147c('0x16')]);}else{logger[_0x147c('0xf')](_0x147c('0x10'),_0x1a9ff5,_0x147c('0x11'));_0x5d6fef(_0x2aae3a[_0x147c('0x17')][_0x147c('0x16')]);}})[_0x147c('0x18')](function(_0xfddc18){logger[_0x147c('0x15')](_0x147c('0x10'),_0x1a9ff5,_0xfddc18);_0x543d3e(_0xfddc18);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 1009a8a..96aef3c 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 _0xf746=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x50cea6,_0x5e4421){var _0x46d5c9=function(_0x23b449){while(--_0x23b449){_0x50cea6['push'](_0x50cea6['shift']());}};_0x46d5c9(++_0x5e4421);}(_0xf746,0x1b6));var _0x6f74=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf746[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x6f74('0x0'));var util=require(_0x6f74('0x1'));var path=require(_0x6f74('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f74('0x3'));var router=express[_0x6f74('0x4')]();var fs_extra=require(_0x6f74('0x5'));var auth=require(_0x6f74('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f74('0x7'));var controller=require(_0x6f74('0x8'));router[_0x6f74('0x9')]('/',auth[_0x6f74('0xa')](),controller['index']);router['get']('/:id',auth[_0x6f74('0xa')](),controller[_0x6f74('0xb')]);router[_0x6f74('0xc')]('/',auth[_0x6f74('0xa')](),controller[_0x6f74('0xd')]);router[_0x6f74('0xe')](_0x6f74('0xf'),auth[_0x6f74('0xa')](),controller[_0x6f74('0x10')]);router[_0x6f74('0x11')](_0x6f74('0xf'),auth[_0x6f74('0xa')](),controller[_0x6f74('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa165=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x212aad,_0x143b4b){var _0x269964=function(_0x129ff8){while(--_0x129ff8){_0x212aad['push'](_0x212aad['shift']());}};_0x269964(++_0x143b4b);}(_0xa165,0x83));var _0x5a16=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa165[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x5a16('0x0'));var util=require(_0x5a16('0x1'));var path=require('path');var timeout=require(_0x5a16('0x2'));var express=require(_0x5a16('0x3'));var router=express[_0x5a16('0x4')]();var fs_extra=require(_0x5a16('0x5'));var auth=require(_0x5a16('0x6'));var interaction=require(_0x5a16('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x5a16('0x8')]('/',auth[_0x5a16('0x9')](),controller[_0x5a16('0xa')]);router[_0x5a16('0x8')](_0x5a16('0xb'),auth[_0x5a16('0x9')](),controller[_0x5a16('0xc')]);router['post']('/',auth[_0x5a16('0x9')](),controller['create']);router[_0x5a16('0xd')](_0x5a16('0xb'),auth[_0x5a16('0x9')](),controller[_0x5a16('0xe')]);router[_0x5a16('0xf')](_0x5a16('0xb'),auth['isAuthenticated'](),controller[_0x5a16('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 14a838a..fd29735 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 _0xeb1d=['keyValue','picklist','ENUM','variable','STRING','exports','string','customVariable'];(function(_0x5e2be0,_0x51090e){var _0x23d711=function(_0x397316){while(--_0x397316){_0x5e2be0['push'](_0x5e2be0['shift']());}};_0x23d711(++_0x51090e);}(_0xeb1d,0x16d));var _0xdeb1=function(_0x27834e,_0x5146c3){_0x27834e=_0x27834e-0x0;var _0x45943b=_0xeb1d[_0x27834e];return _0x45943b;};'use strict';var Sequelize=require('sequelize');module[_0xdeb1('0x0')]={'type':{'type':Sequelize['ENUM'](_0xdeb1('0x1'),'variable',_0xdeb1('0x2'),_0xdeb1('0x3'),_0xdeb1('0x4')),'defaultValue':_0xdeb1('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdeb1('0x5')](_0xdeb1('0x1'),_0xdeb1('0x6'),_0xdeb1('0x2'))},'keyContent':{'type':Sequelize[_0xdeb1('0x7')]},'idField':{'type':Sequelize[_0xdeb1('0x7')]},'nameField':{'type':Sequelize[_0xdeb1('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdeb1('0x7')]}}; \ No newline at end of file +var _0xabb1=['string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x2f478e,_0x2430f7){var _0x7f1ecf=function(_0x3a14de){while(--_0x3a14de){_0x2f478e['push'](_0x2f478e['shift']());}};_0x7f1ecf(++_0x2430f7);}(_0xabb1,0x1ca));var _0x1abb=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xabb1[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x1abb('0x0'));module['exports']={'type':{'type':Sequelize[_0x1abb('0x1')]('string',_0x1abb('0x2'),_0x1abb('0x3'),'keyValue','picklist'),'defaultValue':_0x1abb('0x4')},'content':{'type':Sequelize[_0x1abb('0x5')]},'key':{'type':Sequelize[_0x1abb('0x5')]},'keyType':{'type':Sequelize[_0x1abb('0x1')](_0x1abb('0x4'),_0x1abb('0x2'),_0x1abb('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1abb('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1abb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index de81a4c..d107b25 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 _0x4408=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','map','Dynamics365Field','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x52b7d7,_0x33855e){var _0x1cfa69=function(_0x287247){while(--_0x287247){_0x52b7d7['push'](_0x52b7d7['shift']());}};_0x1cfa69(++_0x33855e);}(_0x4408,0xd5));var _0x8440=function(_0x5234f6,_0x22937c){_0x5234f6=_0x5234f6-0x0;var _0x481bbf=_0x4408[_0x5234f6];return _0x481bbf;};'use strict';var emlformat=require(_0x8440('0x0'));var rimraf=require(_0x8440('0x1'));var zipdir=require(_0x8440('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8440('0x3'));var moment=require(_0x8440('0x4'));var BPromise=require(_0x8440('0x5'));var Mustache=require(_0x8440('0x6'));var util=require(_0x8440('0x7'));var path=require(_0x8440('0x8'));var sox=require(_0x8440('0x9'));var csv=require(_0x8440('0xa'));var ejs=require(_0x8440('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8440('0xc'));var squel=require(_0x8440('0xd'));var crypto=require(_0x8440('0xe'));var jsforce=require(_0x8440('0xf'));var deskjs=require(_0x8440('0x10'));var toCsv=require(_0x8440('0xa'));var querystring=require('querystring');var Papa=require(_0x8440('0x11'));var Redis=require(_0x8440('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8440('0x13'));var as=require(_0x8440('0x14'));var hardwareService=require(_0x8440('0x15'));var logger=require(_0x8440('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8440('0x17'));var licenseUtil=require(_0x8440('0x18'));var db=require(_0x8440('0x19'))['db'];function respondWithStatusCode(_0x53e093,_0x43f7c3){_0x43f7c3=_0x43f7c3||0xcc;return function(_0x348888){if(_0x348888){return _0x53e093[_0x8440('0x1a')](_0x43f7c3);}return _0x53e093[_0x8440('0x1b')](_0x43f7c3)[_0x8440('0x1c')]();};}function respondWithResult(_0x51c6d9,_0x3bf027){_0x3bf027=_0x3bf027||0xc8;return function(_0x270021){if(_0x270021){return _0x51c6d9['status'](_0x3bf027)[_0x8440('0x1d')](_0x270021);}};}function respondWithFilteredResult(_0x48c767,_0x327cf5){return function(_0x1b3a70){if(_0x1b3a70){var _0x1ec001=typeof _0x327cf5[_0x8440('0x1e')]==='undefined'&&typeof _0x327cf5[_0x8440('0x1f')]==='undefined';var _0x434203=_0x1b3a70[_0x8440('0x20')];var _0x34debd=_0x1ec001?0x0:_0x327cf5[_0x8440('0x1e')];var _0x519428=_0x1ec001?_0x1b3a70[_0x8440('0x20')]:_0x327cf5[_0x8440('0x1e')]+_0x327cf5[_0x8440('0x1f')];var _0x532e7d;if(_0x519428>=_0x434203){_0x519428=_0x434203;_0x532e7d=0xc8;}else{_0x532e7d=0xce;}_0x48c767[_0x8440('0x1b')](_0x532e7d);return _0x48c767[_0x8440('0x21')](_0x8440('0x22'),_0x34debd+'-'+_0x519428+'/'+_0x434203)[_0x8440('0x1d')](_0x1b3a70);}return null;};}function patchUpdates(_0x1910d7){return function(_0x469dae){try{jsonpatch[_0x8440('0x23')](_0x469dae,_0x1910d7,!![]);}catch(_0x330f82){return BPromise['reject'](_0x330f82);}return _0x469dae[_0x8440('0x24')]();};}function saveUpdates(_0x268549,_0x466bf6){return function(_0x988d21){if(_0x988d21){return _0x988d21[_0x8440('0x25')](_0x268549)[_0x8440('0x26')](function(_0x3a35c8){return _0x3a35c8;});}return null;};}function removeEntity(_0x5e9af2,_0x34c38d){return function(_0x365fe7){if(_0x365fe7){return _0x365fe7[_0x8440('0x27')]()['then'](function(){_0x5e9af2[_0x8440('0x1b')](0xcc)[_0x8440('0x1c')]();});}};}function handleEntityNotFound(_0x1d6cc2,_0x41a4a9){return function(_0x38268a){if(!_0x38268a){_0x1d6cc2[_0x8440('0x1a')](0x194);}return _0x38268a;};}function handleError(_0x19abce,_0x2de07e){_0x2de07e=_0x2de07e||0x1f4;return function(_0x17dad0){logger['error'](_0x17dad0['stack']);if(_0x17dad0[_0x8440('0x28')]){delete _0x17dad0['name'];}_0x19abce[_0x8440('0x1b')](_0x2de07e)[_0x8440('0x29')](_0x17dad0);};}exports['index']=function(_0x4a32b2,_0x4df401){var _0x2b6ec1={},_0x5292df={},_0x1ea2d4={'count':0x0,'rows':[]};var _0x554b2f=_[_0x8440('0x2a')](db[_0x8440('0x2b')][_0x8440('0x2c')],function(_0x1f9874){return{'name':_0x1f9874['fieldName'],'type':_0x1f9874['type'][_0x8440('0x2d')]};});_0x5292df[_0x8440('0x2e')]=_[_0x8440('0x2a')](_0x554b2f,_0x8440('0x28'));_0x5292df[_0x8440('0x2f')]=_['keys'](_0x4a32b2[_0x8440('0x2f')]);_0x5292df['filters']=_[_0x8440('0x30')](_0x5292df[_0x8440('0x2e')],_0x5292df[_0x8440('0x2f')]);_0x2b6ec1[_0x8440('0x31')]=_[_0x8440('0x30')](_0x5292df[_0x8440('0x2e')],qs[_0x8440('0x32')](_0x4a32b2[_0x8440('0x2f')]['fields']));_0x2b6ec1[_0x8440('0x31')]=_0x2b6ec1[_0x8440('0x31')][_0x8440('0x33')]?_0x2b6ec1['attributes']:_0x5292df[_0x8440('0x2e')];if(!_0x4a32b2[_0x8440('0x2f')][_0x8440('0x34')](_0x8440('0x35'))){_0x2b6ec1['limit']=qs[_0x8440('0x1f')](_0x4a32b2[_0x8440('0x2f')][_0x8440('0x1f')]);_0x2b6ec1[_0x8440('0x1e')]=qs[_0x8440('0x1e')](_0x4a32b2['query'][_0x8440('0x1e')]);}_0x2b6ec1[_0x8440('0x36')]=qs[_0x8440('0x37')](_0x4a32b2['query'][_0x8440('0x37')]);_0x2b6ec1[_0x8440('0x38')]=qs[_0x8440('0x39')](_[_0x8440('0x3a')](_0x4a32b2[_0x8440('0x2f')],_0x5292df[_0x8440('0x39')]),_0x554b2f);if(_0x4a32b2[_0x8440('0x2f')][_0x8440('0x3b')]){_0x2b6ec1['where']=_[_0x8440('0x3c')](_0x2b6ec1[_0x8440('0x38')],{'$or':_[_0x8440('0x2a')](_0x554b2f,function(_0x32d205){if(_0x32d205[_0x8440('0x3d')]!==_0x8440('0x3e')){var _0x472b0e={};_0x472b0e[_0x32d205[_0x8440('0x28')]]={'$like':'%'+_0x4a32b2[_0x8440('0x2f')]['filter']+'%'};return _0x472b0e;}})});}_0x2b6ec1=_[_0x8440('0x3c')]({},_0x2b6ec1,_0x4a32b2[_0x8440('0x3f')]);var _0x4fa060={'where':_0x2b6ec1[_0x8440('0x38')]};return db[_0x8440('0x2b')][_0x8440('0x20')](_0x4fa060)[_0x8440('0x26')](function(_0x176f1c){_0x1ea2d4['count']=_0x176f1c;if(_0x4a32b2[_0x8440('0x2f')][_0x8440('0x40')]){_0x2b6ec1[_0x8440('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x2b6ec1);})[_0x8440('0x26')](function(_0x4ff6bc){_0x1ea2d4[_0x8440('0x42')]=_0x4ff6bc;return _0x1ea2d4;})[_0x8440('0x26')](respondWithFilteredResult(_0x4df401,_0x2b6ec1))[_0x8440('0x43')](handleError(_0x4df401,null));};exports[_0x8440('0x44')]=function(_0x8116f7,_0xda1c23){var _0x35508c={'raw':!![],'where':{'id':_0x8116f7['params']['id']}},_0x5cd725={};_0x5cd725[_0x8440('0x2e')]=_[_0x8440('0x45')](db[_0x8440('0x2b')]['rawAttributes']);_0x5cd725[_0x8440('0x2f')]=_['keys'](_0x8116f7[_0x8440('0x2f')]);_0x5cd725['filters']=_['intersection'](_0x5cd725[_0x8440('0x2e')],_0x5cd725['query']);_0x35508c[_0x8440('0x31')]=_['intersection'](_0x5cd725[_0x8440('0x2e')],qs[_0x8440('0x32')](_0x8116f7[_0x8440('0x2f')][_0x8440('0x32')]));_0x35508c[_0x8440('0x31')]=_0x35508c[_0x8440('0x31')][_0x8440('0x33')]?_0x35508c[_0x8440('0x31')]:_0x5cd725['model'];if(_0x8116f7['query']['includeAll']){_0x35508c['include']=[{'all':!![]}];}_0x35508c=_[_0x8440('0x3c')]({},_0x35508c,_0x8116f7[_0x8440('0x3f')]);return db[_0x8440('0x2b')][_0x8440('0x46')](_0x35508c)[_0x8440('0x26')](handleEntityNotFound(_0xda1c23,null))[_0x8440('0x26')](respondWithResult(_0xda1c23,null))[_0x8440('0x43')](handleError(_0xda1c23,null));};exports[_0x8440('0x47')]=function(_0x32009e,_0x3c32c2){return db[_0x8440('0x2b')][_0x8440('0x47')](_0x32009e[_0x8440('0x48')],{})[_0x8440('0x26')](respondWithResult(_0x3c32c2,0xc9))[_0x8440('0x43')](handleError(_0x3c32c2,null));};exports[_0x8440('0x25')]=function(_0x302967,_0x3c8633){if(_0x302967[_0x8440('0x48')]['id']){delete _0x302967[_0x8440('0x48')]['id'];}return db[_0x8440('0x2b')]['find']({'where':{'id':_0x302967[_0x8440('0x49')]['id']}})[_0x8440('0x26')](handleEntityNotFound(_0x3c8633,null))[_0x8440('0x26')](saveUpdates(_0x302967[_0x8440('0x48')],null))['then'](respondWithResult(_0x3c8633,null))[_0x8440('0x43')](handleError(_0x3c8633,null));};exports[_0x8440('0x27')]=function(_0x4c14db,_0x51eab6){return db['Dynamics365Field']['find']({'where':{'id':_0x4c14db[_0x8440('0x49')]['id']}})[_0x8440('0x26')](handleEntityNotFound(_0x51eab6,null))[_0x8440('0x26')](removeEntity(_0x51eab6,null))[_0x8440('0x43')](handleError(_0x51eab6,null));}; \ No newline at end of file +var _0x2b79=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x4fcb22,_0x21b460){var _0x11e37e=function(_0x10eec9){while(--_0x10eec9){_0x4fcb22['push'](_0x4fcb22['shift']());}};_0x11e37e(++_0x21b460);}(_0x2b79,0x1a2));var _0x92b7=function(_0x285c85,_0x132c21){_0x285c85=_0x285c85-0x0;var _0x2f81cd=_0x2b79[_0x285c85];return _0x2f81cd;};'use strict';var emlformat=require(_0x92b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92b7('0x1'));var jsonpatch=require(_0x92b7('0x2'));var rp=require(_0x92b7('0x3'));var moment=require(_0x92b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x92b7('0x5'));var util=require(_0x92b7('0x6'));var path=require('path');var sox=require(_0x92b7('0x7'));var csv=require(_0x92b7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92b7('0x9'));var squel=require(_0x92b7('0xa'));var crypto=require(_0x92b7('0xb'));var jsforce=require(_0x92b7('0xc'));var deskjs=require(_0x92b7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x92b7('0xe'));var Redis=require('ioredis');var authService=require(_0x92b7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x92b7('0x10'));var hardwareService=require(_0x92b7('0x11'));var logger=require(_0x92b7('0x12'))(_0x92b7('0x13'));var utils=require(_0x92b7('0x14'));var config=require(_0x92b7('0x15'));var licenseUtil=require(_0x92b7('0x16'));var db=require(_0x92b7('0x17'))['db'];function respondWithStatusCode(_0x358081,_0x612e00){_0x612e00=_0x612e00||0xcc;return function(_0x5d410e){if(_0x5d410e){return _0x358081[_0x92b7('0x18')](_0x612e00);}return _0x358081[_0x92b7('0x19')](_0x612e00)['end']();};}function respondWithResult(_0x545c92,_0x574b33){_0x574b33=_0x574b33||0xc8;return function(_0xcfe9da){if(_0xcfe9da){return _0x545c92[_0x92b7('0x19')](_0x574b33)[_0x92b7('0x1a')](_0xcfe9da);}};}function respondWithFilteredResult(_0x2b7c1d,_0x690253){return function(_0x143d65){if(_0x143d65){var _0x5297e2=typeof _0x690253[_0x92b7('0x1b')]===_0x92b7('0x1c')&&typeof _0x690253[_0x92b7('0x1d')]===_0x92b7('0x1c');var _0x15e4db=_0x143d65[_0x92b7('0x1e')];var _0x47bc17=_0x5297e2?0x0:_0x690253[_0x92b7('0x1b')];var _0x3cc94d=_0x5297e2?_0x143d65[_0x92b7('0x1e')]:_0x690253[_0x92b7('0x1b')]+_0x690253[_0x92b7('0x1d')];var _0x30ef4f;if(_0x3cc94d>=_0x15e4db){_0x3cc94d=_0x15e4db;_0x30ef4f=0xc8;}else{_0x30ef4f=0xce;}_0x2b7c1d[_0x92b7('0x19')](_0x30ef4f);return _0x2b7c1d[_0x92b7('0x1f')](_0x92b7('0x20'),_0x47bc17+'-'+_0x3cc94d+'/'+_0x15e4db)[_0x92b7('0x1a')](_0x143d65);}return null;};}function patchUpdates(_0x2fbb65){return function(_0x2909ec){try{jsonpatch[_0x92b7('0x21')](_0x2909ec,_0x2fbb65,!![]);}catch(_0x5b20e4){return BPromise[_0x92b7('0x22')](_0x5b20e4);}return _0x2909ec['save']();};}function saveUpdates(_0x2a83a2,_0x13db27){return function(_0x366aab){if(_0x366aab){return _0x366aab[_0x92b7('0x23')](_0x2a83a2)[_0x92b7('0x24')](function(_0x462fce){return _0x462fce;});}return null;};}function removeEntity(_0x5f215b,_0x4a8eaf){return function(_0x2851d5){if(_0x2851d5){return _0x2851d5[_0x92b7('0x25')]()[_0x92b7('0x24')](function(){_0x5f215b[_0x92b7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a3d9,_0xd44cb8){return function(_0x542819){if(!_0x542819){_0x58a3d9[_0x92b7('0x18')](0x194);}return _0x542819;};}function handleError(_0x445b64,_0x5ad47b){_0x5ad47b=_0x5ad47b||0x1f4;return function(_0x5ea0c6){logger[_0x92b7('0x26')](_0x5ea0c6['stack']);if(_0x5ea0c6[_0x92b7('0x27')]){delete _0x5ea0c6[_0x92b7('0x27')];}_0x445b64[_0x92b7('0x19')](_0x5ad47b)['send'](_0x5ea0c6);};}exports[_0x92b7('0x28')]=function(_0x4d8126,_0x4d3d63){var _0x1a8419={},_0x3fc8f7={},_0x53b665={'count':0x0,'rows':[]};var _0x4c80b3=_[_0x92b7('0x29')](db[_0x92b7('0x2a')][_0x92b7('0x2b')],function(_0x1ab25a){return{'name':_0x1ab25a[_0x92b7('0x2c')],'type':_0x1ab25a[_0x92b7('0x2d')][_0x92b7('0x2e')]};});_0x3fc8f7['model']=_[_0x92b7('0x29')](_0x4c80b3,_0x92b7('0x27'));_0x3fc8f7[_0x92b7('0x2f')]=_[_0x92b7('0x30')](_0x4d8126[_0x92b7('0x2f')]);_0x3fc8f7[_0x92b7('0x31')]=_[_0x92b7('0x32')](_0x3fc8f7['model'],_0x3fc8f7[_0x92b7('0x2f')]);_0x1a8419[_0x92b7('0x33')]=_[_0x92b7('0x32')](_0x3fc8f7[_0x92b7('0x34')],qs['fields'](_0x4d8126[_0x92b7('0x2f')]['fields']));_0x1a8419[_0x92b7('0x33')]=_0x1a8419[_0x92b7('0x33')][_0x92b7('0x35')]?_0x1a8419['attributes']:_0x3fc8f7[_0x92b7('0x34')];if(!_0x4d8126[_0x92b7('0x2f')][_0x92b7('0x36')](_0x92b7('0x37'))){_0x1a8419[_0x92b7('0x1d')]=qs[_0x92b7('0x1d')](_0x4d8126['query']['limit']);_0x1a8419[_0x92b7('0x1b')]=qs[_0x92b7('0x1b')](_0x4d8126['query'][_0x92b7('0x1b')]);}_0x1a8419[_0x92b7('0x38')]=qs['sort'](_0x4d8126['query'][_0x92b7('0x39')]);_0x1a8419[_0x92b7('0x3a')]=qs[_0x92b7('0x31')](_[_0x92b7('0x3b')](_0x4d8126[_0x92b7('0x2f')],_0x3fc8f7[_0x92b7('0x31')]),_0x4c80b3);if(_0x4d8126[_0x92b7('0x2f')][_0x92b7('0x3c')]){_0x1a8419[_0x92b7('0x3a')]=_[_0x92b7('0x3d')](_0x1a8419[_0x92b7('0x3a')],{'$or':_[_0x92b7('0x29')](_0x4c80b3,function(_0x52472a){if(_0x52472a[_0x92b7('0x2d')]!==_0x92b7('0x3e')){var _0x14e217={};_0x14e217[_0x52472a['name']]={'$like':'%'+_0x4d8126[_0x92b7('0x2f')][_0x92b7('0x3c')]+'%'};return _0x14e217;}})});}_0x1a8419=_['merge']({},_0x1a8419,_0x4d8126[_0x92b7('0x3f')]);var _0x53df01={'where':_0x1a8419[_0x92b7('0x3a')]};return db[_0x92b7('0x2a')]['count'](_0x53df01)[_0x92b7('0x24')](function(_0x5b5912){_0x53b665[_0x92b7('0x1e')]=_0x5b5912;if(_0x4d8126[_0x92b7('0x2f')][_0x92b7('0x40')]){_0x1a8419[_0x92b7('0x41')]=[{'all':!![]}];}return db[_0x92b7('0x2a')][_0x92b7('0x42')](_0x1a8419);})[_0x92b7('0x24')](function(_0x763f63){_0x53b665[_0x92b7('0x43')]=_0x763f63;return _0x53b665;})[_0x92b7('0x24')](respondWithFilteredResult(_0x4d3d63,_0x1a8419))['catch'](handleError(_0x4d3d63,null));};exports[_0x92b7('0x44')]=function(_0x178de4,_0x5bb936){var _0xbb907a={'raw':!![],'where':{'id':_0x178de4[_0x92b7('0x45')]['id']}},_0x54a60d={};_0x54a60d['model']=_[_0x92b7('0x30')](db[_0x92b7('0x2a')]['rawAttributes']);_0x54a60d[_0x92b7('0x2f')]=_[_0x92b7('0x30')](_0x178de4[_0x92b7('0x2f')]);_0x54a60d[_0x92b7('0x31')]=_[_0x92b7('0x32')](_0x54a60d['model'],_0x54a60d['query']);_0xbb907a[_0x92b7('0x33')]=_[_0x92b7('0x32')](_0x54a60d[_0x92b7('0x34')],qs[_0x92b7('0x46')](_0x178de4[_0x92b7('0x2f')][_0x92b7('0x46')]));_0xbb907a[_0x92b7('0x33')]=_0xbb907a['attributes']['length']?_0xbb907a[_0x92b7('0x33')]:_0x54a60d['model'];if(_0x178de4['query']['includeAll']){_0xbb907a[_0x92b7('0x41')]=[{'all':!![]}];}_0xbb907a=_[_0x92b7('0x3d')]({},_0xbb907a,_0x178de4[_0x92b7('0x3f')]);return db[_0x92b7('0x2a')][_0x92b7('0x47')](_0xbb907a)['then'](handleEntityNotFound(_0x5bb936,null))[_0x92b7('0x24')](respondWithResult(_0x5bb936,null))[_0x92b7('0x48')](handleError(_0x5bb936,null));};exports['create']=function(_0x27e5f4,_0x4f1a09){return db['Dynamics365Field']['create'](_0x27e5f4[_0x92b7('0x49')],{})['then'](respondWithResult(_0x4f1a09,0xc9))['catch'](handleError(_0x4f1a09,null));};exports[_0x92b7('0x23')]=function(_0xf00fc2,_0x1c0212){if(_0xf00fc2['body']['id']){delete _0xf00fc2[_0x92b7('0x49')]['id'];}return db[_0x92b7('0x2a')][_0x92b7('0x47')]({'where':{'id':_0xf00fc2[_0x92b7('0x45')]['id']}})[_0x92b7('0x24')](handleEntityNotFound(_0x1c0212,null))[_0x92b7('0x24')](saveUpdates(_0xf00fc2['body'],null))['then'](respondWithResult(_0x1c0212,null))['catch'](handleError(_0x1c0212,null));};exports['destroy']=function(_0x2daa4c,_0x9d42c6){return db[_0x92b7('0x2a')]['find']({'where':{'id':_0x2daa4c[_0x92b7('0x45')]['id']}})['then'](handleEntityNotFound(_0x9d42c6,null))[_0x92b7('0x24')](removeEntity(_0x9d42c6,null))['catch'](handleError(_0x9d42c6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2765384..39daea6 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 _0xe3e7=['util','../../config/logger','api','moment','bluebird','path','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x481e7a,_0x414bd0){var _0x4fc986=function(_0x5c38b1){while(--_0x5c38b1){_0x481e7a['push'](_0x481e7a['shift']());}};_0x4fc986(++_0x414bd0);}(_0xe3e7,0x16b));var _0x7e3e=function(_0x11e6cc,_0x2ed9fa){_0x11e6cc=_0x11e6cc-0x0;var _0x9f0348=_0xe3e7[_0x11e6cc];return _0x9f0348;};'use strict';var _=require(_0x7e3e('0x0'));var util=require(_0x7e3e('0x1'));var logger=require(_0x7e3e('0x2'))(_0x7e3e('0x3'));var moment=require(_0x7e3e('0x4'));var BPromise=require(_0x7e3e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e3e('0x6'));var rimraf=require(_0x7e3e('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e3e('0x8'));module['exports']=function(_0x1508dc,_0x2194ff){return _0x1508dc[_0x7e3e('0x9')](_0x7e3e('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7e3e('0xb'),'fields':[_0x7e3e('0xc'),_0x7e3e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39b3=['define','Dynamics365Field','int_dynamics365_fields','idField','lodash','util','api','bluebird','request-promise','path','./intDynamics365Field.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x39b3,0x1dd));var _0x339b=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x39b3[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x339b('0x0'));var util=require(_0x339b('0x1'));var logger=require('../../config/logger')(_0x339b('0x2'));var moment=require('moment');var BPromise=require(_0x339b('0x3'));var rp=require(_0x339b('0x4'));var fs=require('fs');var path=require(_0x339b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x339b('0x6'));module['exports']=function(_0x3ff701,_0x2dde0e){return _0x3ff701[_0x339b('0x7')](_0x339b('0x8'),attributes,{'tableName':_0x339b('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x339b('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index bea932a..676408d 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 _0xed74=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x532bc6,_0x5cb4fc){var _0x3a45d=function(_0x1dcb6b){while(--_0x1dcb6b){_0x532bc6['push'](_0x532bc6['shift']());}};_0x3a45d(++_0x5cb4fc);}(_0xed74,0x9d));var _0x4ed7=function(_0x5e8897,_0x299e79){_0x5e8897=_0x5e8897-0x0;var _0x271b50=_0xed74[_0x5e8897];return _0x271b50;};'use strict';var _=require(_0x4ed7('0x0'));var util=require(_0x4ed7('0x1'));var moment=require(_0x4ed7('0x2'));var BPromise=require(_0x4ed7('0x3'));var rs=require(_0x4ed7('0x4'));var fs=require('fs');var Redis=require(_0x4ed7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ed7('0x6'));var logger=require('../../config/logger')(_0x4ed7('0x7'));var config=require(_0x4ed7('0x8'));var jayson=require(_0x4ed7('0x9'));var client=jayson[_0x4ed7('0xa')][_0x4ed7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x321657,_0x5de95a,_0xa4be13){return new BPromise(function(_0x49aad8,_0x2dfd26){return client['request'](_0x321657,_0xa4be13)[_0x4ed7('0xc')](function(_0x58b019){logger[_0x4ed7('0xd')](_0x4ed7('0xe'),_0x5de95a,_0x4ed7('0xf'));logger[_0x4ed7('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5de95a,_0x4ed7('0xf'),JSON[_0x4ed7('0x11')](_0x58b019));if(_0x58b019[_0x4ed7('0x12')]){if(_0x58b019['error'][_0x4ed7('0x13')]===0x1f4){logger[_0x4ed7('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5de95a,_0x58b019['error'][_0x4ed7('0x14')]);return _0x2dfd26(_0x58b019[_0x4ed7('0x12')]['message']);}logger[_0x4ed7('0x12')](_0x4ed7('0xe'),_0x5de95a,_0x58b019[_0x4ed7('0x12')][_0x4ed7('0x14')]);return _0x49aad8(_0x58b019[_0x4ed7('0x12')][_0x4ed7('0x14')]);}else{logger[_0x4ed7('0xd')](_0x4ed7('0xe'),_0x5de95a,_0x4ed7('0xf'));_0x49aad8(_0x58b019[_0x4ed7('0x15')][_0x4ed7('0x14')]);}})[_0x4ed7('0x16')](function(_0x5b3849){logger[_0x4ed7('0x12')](_0x4ed7('0xe'),_0x5de95a,_0x5b3849);_0x2dfd26(_0x5b3849);});});} \ No newline at end of file +var _0x106c=['info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Field,\x20%s,\x20%s','stringify','error','message'];(function(_0x3a06fe,_0x11352a){var _0x4c73a1=function(_0x518cbd){while(--_0x518cbd){_0x3a06fe['push'](_0x3a06fe['shift']());}};_0x4c73a1(++_0x11352a);}(_0x106c,0x10d));var _0xc106=function(_0x52f547,_0x249e63){_0x52f547=_0x52f547-0x0;var _0x6670d8=_0x106c[_0x52f547];return _0x6670d8;};'use strict';var _=require(_0xc106('0x0'));var util=require(_0xc106('0x1'));var moment=require(_0xc106('0x2'));var BPromise=require(_0xc106('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc106('0x4'))['db'];var utils=require(_0xc106('0x5'));var logger=require(_0xc106('0x6'))(_0xc106('0x7'));var config=require(_0xc106('0x8'));var jayson=require(_0xc106('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48b592,_0x5aea11,_0x7a6738){return new BPromise(function(_0x49a337,_0x5cb58b){return client[_0xc106('0xa')](_0x48b592,_0x7a6738)[_0xc106('0xb')](function(_0x5a91b9){logger['info'](_0xc106('0xc'),_0x5aea11,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5aea11,'request\x20sent',JSON[_0xc106('0xd')](_0x5a91b9));if(_0x5a91b9[_0xc106('0xe')]){if(_0x5a91b9[_0xc106('0xe')]['code']===0x1f4){logger['error'](_0xc106('0xc'),_0x5aea11,_0x5a91b9[_0xc106('0xe')]['message']);return _0x5cb58b(_0x5a91b9['error'][_0xc106('0xf')]);}logger[_0xc106('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x5aea11,_0x5a91b9[_0xc106('0xe')][_0xc106('0xf')]);return _0x49a337(_0x5a91b9[_0xc106('0xe')][_0xc106('0xf')]);}else{logger[_0xc106('0x10')](_0xc106('0xc'),_0x5aea11,'request\x20sent');_0x49a337(_0x5a91b9[_0xc106('0x11')][_0xc106('0xf')]);}})[_0xc106('0x12')](function(_0x1eddff){logger[_0xc106('0xe')](_0xc106('0xc'),_0x5aea11,_0x1eddff);_0x5cb58b(_0x1eddff);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4e5b617..eef453e 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 _0x2155=['index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller'];(function(_0x161754,_0x6bb7e1){var _0x51c22a=function(_0x81c350){while(--_0x81c350){_0x161754['push'](_0x161754['shift']());}};_0x51c22a(++_0x6bb7e1);}(_0x2155,0x17f));var _0x5215=function(_0x2b3a98,_0x3796c6){_0x2b3a98=_0x2b3a98-0x0;var _0xdf53c0=_0x2155[_0x2b3a98];return _0xdf53c0;};'use strict';var multer=require(_0x5215('0x0'));var util=require(_0x5215('0x1'));var path=require('path');var timeout=require(_0x5215('0x2'));var express=require(_0x5215('0x3'));var router=express[_0x5215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5215('0x5'));var interaction=require(_0x5215('0x6'));var config=require('../../config/environment');var controller=require(_0x5215('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5215('0x8')]);router[_0x5215('0x9')](_0x5215('0xa'),auth[_0x5215('0xb')](),controller[_0x5215('0xc')]);router[_0x5215('0x9')](_0x5215('0xd'),auth['isAuthenticated'](),controller[_0x5215('0xe')]);router[_0x5215('0x9')](_0x5215('0xf'),auth[_0x5215('0xb')](),controller['getFields']);router[_0x5215('0x10')]('/',auth['isAuthenticated'](),controller[_0x5215('0x11')]);router['post']('/:id/configurations',auth[_0x5215('0xb')](),controller[_0x5215('0x12')]);router[_0x5215('0x13')](_0x5215('0xa'),auth[_0x5215('0xb')](),controller['update']);router[_0x5215('0x14')](_0x5215('0xa'),auth[_0x5215('0xb')](),controller[_0x5215('0x15')]);module[_0x5215('0x16')]=router; \ No newline at end of file +var _0xc56e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put'];(function(_0x1797b0,_0xec2368){var _0x3e4814=function(_0x415889){while(--_0x415889){_0x1797b0['push'](_0x1797b0['shift']());}};_0x3e4814(++_0xec2368);}(_0xc56e,0xa1));var _0xec56=function(_0x32f95c,_0x343356){_0x32f95c=_0x32f95c-0x0;var _0x527e38=_0xc56e[_0x32f95c];return _0x527e38;};'use strict';var multer=require(_0xec56('0x0'));var util=require(_0xec56('0x1'));var path=require(_0xec56('0x2'));var timeout=require(_0xec56('0x3'));var express=require(_0xec56('0x4'));var router=express['Router']();var fs_extra=require(_0xec56('0x5'));var auth=require(_0xec56('0x6'));var interaction=require(_0xec56('0x7'));var config=require(_0xec56('0x8'));var controller=require(_0xec56('0x9'));router[_0xec56('0xa')]('/',auth[_0xec56('0xb')](),controller[_0xec56('0xc')]);router[_0xec56('0xa')]('/:id',auth[_0xec56('0xb')](),controller[_0xec56('0xd')]);router[_0xec56('0xa')]('/:id/configurations',auth[_0xec56('0xb')](),controller[_0xec56('0xe')]);router[_0xec56('0xa')](_0xec56('0xf'),auth['isAuthenticated'](),controller[_0xec56('0x10')]);router[_0xec56('0x11')]('/',auth['isAuthenticated'](),controller[_0xec56('0x12')]);router[_0xec56('0x11')](_0xec56('0x13'),auth[_0xec56('0xb')](),controller['addConfiguration']);router[_0xec56('0x14')](_0xec56('0x15'),auth['isAuthenticated'](),controller[_0xec56('0x16')]);router[_0xec56('0x17')](_0xec56('0x15'),auth[_0xec56('0xb')](),controller[_0xec56('0x18')]);module[_0xec56('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 3716290..0fbc8d8 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 _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x21e107,_0x5c175f){var _0x71323b=function(_0x69e61a){while(--_0x69e61a){_0x21e107['push'](_0x21e107['shift']());}};_0x71323b(++_0x5c175f);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1d7f2f,_0x2d79b5){_0x1d7f2f=_0x1d7f2f-0x0;var _0x56e59e=_0xe5af[_0x1d7f2f];return _0x56e59e;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4325=['exports','STRING','username','remoteUri','sequelize'];(function(_0x29e6f8,_0x5822c6){var _0x4d3389=function(_0x495f6c){while(--_0x495f6c){_0x29e6f8['push'](_0x29e6f8['shift']());}};_0x4d3389(++_0x5822c6);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5432('0x2')]},'username':{'type':Sequelize[_0x5432('0x2')],'unique':_0x5432('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5432('0x4')},'serverUrl':{'type':Sequelize[_0x5432('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 f74531e..69d6aad 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 _0x477a=['getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','apiKey','toString','base64','requester','agent','priority','group','source','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa477('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa477('0x1'));var jsonpatch=require(_0xa477('0x2'));var rp=require('request-promise');var moment=require(_0xa477('0x3'));var BPromise=require(_0xa477('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa477('0x5'));var sox=require(_0xa477('0x6'));var csv=require('to-csv');var ejs=require(_0xa477('0x7'));var fs=require('fs');var fs_extra=require(_0xa477('0x8'));var _=require(_0xa477('0x9'));var squel=require(_0xa477('0xa'));var crypto=require(_0xa477('0xb'));var jsforce=require(_0xa477('0xc'));var deskjs=require(_0xa477('0xd'));var toCsv=require(_0xa477('0xe'));var querystring=require(_0xa477('0xf'));var Papa=require('papaparse');var Redis=require(_0xa477('0x10'));var authService=require(_0xa477('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa477('0x12'));var config=require(_0xa477('0x13'));var licenseUtil=require(_0xa477('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa477('0x15'));function respondWithStatusCode(_0x3d2a17,_0x70e1c1){_0x70e1c1=_0x70e1c1||0xcc;return function(_0x5e09ef){if(_0x5e09ef){return _0x3d2a17[_0xa477('0x16')](_0x70e1c1);}return _0x3d2a17[_0xa477('0x17')](_0x70e1c1)[_0xa477('0x18')]();};}function respondWithResult(_0x185c76,_0xe878a){_0xe878a=_0xe878a||0xc8;return function(_0x484706){if(_0x484706){return _0x185c76[_0xa477('0x17')](_0xe878a)[_0xa477('0x19')](_0x484706);}};}function respondWithFilteredResult(_0xa607d0,_0x45ecc1){return function(_0x22a156){if(_0x22a156){var _0x1659cb=typeof _0x45ecc1[_0xa477('0x1a')]===_0xa477('0x1b')&&typeof _0x45ecc1[_0xa477('0x1c')]===_0xa477('0x1b');var _0xc21f88=_0x22a156[_0xa477('0x1d')];var _0xd9cdae=_0x1659cb?0x0:_0x45ecc1['offset'];var _0x6d645=_0x1659cb?_0x22a156[_0xa477('0x1d')]:_0x45ecc1[_0xa477('0x1a')]+_0x45ecc1[_0xa477('0x1c')];var _0x4596bd;if(_0x6d645>=_0xc21f88){_0x6d645=_0xc21f88;_0x4596bd=0xc8;}else{_0x4596bd=0xce;}_0xa607d0[_0xa477('0x17')](_0x4596bd);return _0xa607d0[_0xa477('0x1e')](_0xa477('0x1f'),_0xd9cdae+'-'+_0x6d645+'/'+_0xc21f88)['json'](_0x22a156);}return null;};}function patchUpdates(_0x434ef1){return function(_0x240956){try{jsonpatch[_0xa477('0x20')](_0x240956,_0x434ef1,!![]);}catch(_0x5ed526){return BPromise['reject'](_0x5ed526);}return _0x240956['save']();};}function saveUpdates(_0x14d01e,_0x2debae){return function(_0x571501){if(_0x571501){return _0x571501[_0xa477('0x21')](_0x14d01e)['then'](function(_0x5b6e98){return _0x5b6e98;});}return null;};}function removeEntity(_0x7aa4ac,_0x166694){return function(_0x1bb568){if(_0x1bb568){return _0x1bb568[_0xa477('0x22')]()[_0xa477('0x23')](function(){_0x7aa4ac[_0xa477('0x17')](0xcc)[_0xa477('0x18')]();});}};}function handleEntityNotFound(_0x48209e,_0x3cafd9){return function(_0x1e444e){if(!_0x1e444e){_0x48209e[_0xa477('0x16')](0x194);}return _0x1e444e;};}function handleError(_0x236416,_0x18e8c3){_0x18e8c3=_0x18e8c3||0x1f4;return function(_0x27ec39){logger[_0xa477('0x24')](_0x27ec39['stack']);if(_0x27ec39[_0xa477('0x25')]){delete _0x27ec39[_0xa477('0x25')];}_0x236416[_0xa477('0x17')](_0x18e8c3)[_0xa477('0x26')](_0x27ec39);};}exports[_0xa477('0x27')]=function(_0xdb15a9,_0x14b0e8){var _0x5aed5d={},_0x169089={},_0x5819c8={'count':0x0,'rows':[]};var _0x599371=_[_0xa477('0x28')](db[_0xa477('0x29')]['rawAttributes'],function(_0x15e476){return{'name':_0x15e476[_0xa477('0x2a')],'type':_0x15e476[_0xa477('0x2b')][_0xa477('0x2c')]};});_0x169089[_0xa477('0x2d')]=_[_0xa477('0x28')](_0x599371,_0xa477('0x25'));_0x169089[_0xa477('0x2e')]=_[_0xa477('0x2f')](_0xdb15a9[_0xa477('0x2e')]);_0x169089[_0xa477('0x30')]=_[_0xa477('0x31')](_0x169089[_0xa477('0x2d')],_0x169089['query']);_0x5aed5d[_0xa477('0x32')]=_[_0xa477('0x31')](_0x169089[_0xa477('0x2d')],qs[_0xa477('0x33')](_0xdb15a9[_0xa477('0x2e')][_0xa477('0x33')]));_0x5aed5d[_0xa477('0x32')]=_0x5aed5d[_0xa477('0x32')]['length']?_0x5aed5d[_0xa477('0x32')]:_0x169089[_0xa477('0x2d')];if(!_0xdb15a9[_0xa477('0x2e')][_0xa477('0x34')](_0xa477('0x35'))){_0x5aed5d[_0xa477('0x1c')]=qs[_0xa477('0x1c')](_0xdb15a9[_0xa477('0x2e')][_0xa477('0x1c')]);_0x5aed5d[_0xa477('0x1a')]=qs[_0xa477('0x1a')](_0xdb15a9[_0xa477('0x2e')][_0xa477('0x1a')]);}_0x5aed5d[_0xa477('0x36')]=qs[_0xa477('0x37')](_0xdb15a9[_0xa477('0x2e')][_0xa477('0x37')]);_0x5aed5d[_0xa477('0x38')]=qs[_0xa477('0x30')](_['pick'](_0xdb15a9[_0xa477('0x2e')],_0x169089[_0xa477('0x30')]),_0x599371);if(_0xdb15a9[_0xa477('0x2e')][_0xa477('0x39')]){_0x5aed5d[_0xa477('0x38')]=_[_0xa477('0x3a')](_0x5aed5d['where'],{'$or':_['map'](_0x599371,function(_0x3065e7){if(_0x3065e7[_0xa477('0x2b')]!==_0xa477('0x3b')){var _0x764cef={};_0x764cef[_0x3065e7['name']]={'$like':'%'+_0xdb15a9['query'][_0xa477('0x39')]+'%'};return _0x764cef;}})});}_0x5aed5d=_[_0xa477('0x3a')]({},_0x5aed5d,_0xdb15a9[_0xa477('0x3c')]);var _0x3db1a6={'where':_0x5aed5d[_0xa477('0x38')]};return db[_0xa477('0x29')][_0xa477('0x1d')](_0x3db1a6)[_0xa477('0x23')](function(_0x365f1a){_0x5819c8['count']=_0x365f1a;if(_0xdb15a9[_0xa477('0x2e')][_0xa477('0x3d')]){_0x5aed5d[_0xa477('0x3e')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xa477('0x3f')](_0x5aed5d);})['then'](function(_0x3d9ba0){_0x5819c8[_0xa477('0x40')]=_0x3d9ba0;return _0x5819c8;})['then'](respondWithFilteredResult(_0x14b0e8,_0x5aed5d))[_0xa477('0x41')](handleError(_0x14b0e8,null));};exports[_0xa477('0x42')]=function(_0x5c1e58,_0x240ad9){var _0x37f18c={'raw':![],'where':{'id':_0x5c1e58[_0xa477('0x43')]['id']}},_0x289080={};_0x289080[_0xa477('0x2d')]=_[_0xa477('0x2f')](db[_0xa477('0x29')][_0xa477('0x44')]);_0x289080[_0xa477('0x2e')]=_[_0xa477('0x2f')](_0x5c1e58['query']);_0x289080[_0xa477('0x30')]=_[_0xa477('0x31')](_0x289080[_0xa477('0x2d')],_0x289080[_0xa477('0x2e')]);_0x37f18c[_0xa477('0x32')]=_['intersection'](_0x289080[_0xa477('0x2d')],qs['fields'](_0x5c1e58[_0xa477('0x2e')][_0xa477('0x33')]));_0x37f18c[_0xa477('0x32')]=_0x37f18c['attributes'][_0xa477('0x45')]?_0x37f18c[_0xa477('0x32')]:_0x289080[_0xa477('0x2d')];if(_0x5c1e58[_0xa477('0x2e')][_0xa477('0x3d')]){_0x37f18c[_0xa477('0x3e')]=[{'all':!![]}];}_0x37f18c=_[_0xa477('0x3a')]({},_0x37f18c,_0x5c1e58[_0xa477('0x3c')]);return db[_0xa477('0x29')][_0xa477('0x46')](_0x37f18c)[_0xa477('0x23')](handleEntityNotFound(_0x240ad9,null))['then'](respondWithResult(_0x240ad9,null))[_0xa477('0x41')](handleError(_0x240ad9,null));};exports[_0xa477('0x47')]=function(_0xeacd33,_0x545410){return db[_0xa477('0x29')][_0xa477('0x47')](_0xeacd33['body'],{})[_0xa477('0x23')](respondWithResult(_0x545410,0xc9))[_0xa477('0x41')](handleError(_0x545410,null));};exports[_0xa477('0x21')]=function(_0x543a19,_0xcb8c41){if(_0x543a19['body']['id']){delete _0x543a19[_0xa477('0x48')]['id'];}return db['FreshdeskAccount'][_0xa477('0x46')]({'where':{'id':_0x543a19[_0xa477('0x43')]['id']}})[_0xa477('0x23')](handleEntityNotFound(_0xcb8c41,null))[_0xa477('0x23')](saveUpdates(_0x543a19['body'],null))[_0xa477('0x23')](respondWithResult(_0xcb8c41,null))[_0xa477('0x41')](handleError(_0xcb8c41,null));};exports[_0xa477('0x22')]=function(_0x59b17a,_0x4fb38b){return db[_0xa477('0x29')][_0xa477('0x46')]({'where':{'id':_0x59b17a[_0xa477('0x43')]['id']}})[_0xa477('0x23')](handleEntityNotFound(_0x4fb38b,null))[_0xa477('0x23')](removeEntity(_0x4fb38b,null))[_0xa477('0x41')](handleError(_0x4fb38b,null));};exports[_0xa477('0x49')]=function(_0x3f03c0,_0x596eb5,_0x53e55e){var _0x4052e0={};var _0x16f491={};var _0x2c1d27;var _0xadf7b9;return db[_0xa477('0x29')][_0xa477('0x4a')]({'where':{'id':_0x3f03c0['params']['id']}})[_0xa477('0x23')](handleEntityNotFound(_0x596eb5,null))[_0xa477('0x23')](function(_0x219417){if(_0x219417){_0x2c1d27=_0x219417;_0x16f491[_0xa477('0x2d')]=_[_0xa477('0x2f')](db[_0xa477('0x4b')][_0xa477('0x44')]);_0x16f491['query']=_['keys'](_0x3f03c0[_0xa477('0x2e')]);_0x16f491[_0xa477('0x30')]=_[_0xa477('0x31')](_0x16f491['model'],_0x16f491[_0xa477('0x2e')]);_0x4052e0[_0xa477('0x32')]=_[_0xa477('0x31')](_0x16f491['model'],qs[_0xa477('0x33')](_0x3f03c0[_0xa477('0x2e')][_0xa477('0x33')]));_0x4052e0[_0xa477('0x32')]=_0x4052e0[_0xa477('0x32')][_0xa477('0x45')]?_0x4052e0[_0xa477('0x32')]:_0x16f491[_0xa477('0x2d')];_0x4052e0['order']=qs['sort'](_0x3f03c0[_0xa477('0x2e')][_0xa477('0x37')]);_0x4052e0[_0xa477('0x38')]=qs[_0xa477('0x30')](_['pick'](_0x3f03c0['query'],_0x16f491[_0xa477('0x30')]));if(_0x3f03c0[_0xa477('0x2e')][_0xa477('0x39')]){_0x4052e0[_0xa477('0x38')]=_['merge'](_0x4052e0[_0xa477('0x38')],{'$or':_['map'](_0x4052e0['attributes'],function(_0x460ccf){var _0x2e20ca={};_0x2e20ca[_0x460ccf]={'$like':'%'+_0x3f03c0[_0xa477('0x2e')]['filter']+'%'};return _0x2e20ca;})});}_0x4052e0=_[_0xa477('0x3a')]({},_0x4052e0,_0x3f03c0['options']);return _0x2c1d27[_0xa477('0x49')](_0x4052e0);}})['then'](function(_0x1a0b6b){if(_0x1a0b6b){_0xadf7b9=_0x1a0b6b[_0xa477('0x45')];if(!_0x3f03c0[_0xa477('0x2e')]['hasOwnProperty'](_0xa477('0x35'))){_0x4052e0[_0xa477('0x1c')]=qs[_0xa477('0x1c')](_0x3f03c0[_0xa477('0x2e')][_0xa477('0x1c')]);_0x4052e0[_0xa477('0x1a')]=qs[_0xa477('0x1a')](_0x3f03c0[_0xa477('0x2e')]['offset']);}return _0x2c1d27[_0xa477('0x49')](_0x4052e0);}})[_0xa477('0x23')](function(_0x31cde3){if(_0x31cde3){return _0x31cde3?{'count':_0xadf7b9,'rows':_0x31cde3}:null;}})[_0xa477('0x23')](respondWithResult(_0x596eb5,null))['catch'](handleError(_0x596eb5,null));};exports[_0xa477('0x4c')]=function(_0x5a4eb2,_0x48189b,_0x3df3bf){if(_0x5a4eb2[_0xa477('0x48')]['id']){delete _0x5a4eb2['body']['id'];}return db[_0xa477('0x29')][_0xa477('0x4a')]({'where':{'id':_0x5a4eb2[_0xa477('0x43')]['id']}})['then'](handleEntityNotFound(_0x48189b,null))[_0xa477('0x23')](function(_0x578d64){if(_0x578d64){_0x5a4eb2[_0xa477('0x48')][_0xa477('0x4d')]=_0x578d64['id'];_0x5a4eb2[_0xa477('0x48')][_0xa477('0x4e')]=integrations[_0xa477('0x4f')](_0x5a4eb2['body']['channel'],_0x5a4eb2[_0xa477('0x48')][_0xa477('0x2b')]);_0x5a4eb2[_0xa477('0x48')]['Descriptions']=integrations[_0xa477('0x50')](_0x5a4eb2['body']['channel'],_0x5a4eb2[_0xa477('0x48')]['type']);return db['FreshdeskConfiguration']['create'](_0x5a4eb2[_0xa477('0x48')],{'include':[{'model':db[_0xa477('0x51')],'as':_0xa477('0x4e')},{'model':db[_0xa477('0x51')],'as':_0xa477('0x52')}]});}return null;})[_0xa477('0x23')](respondWithResult(_0x48189b,null))['catch'](handleError(_0x48189b,null));};exports[_0xa477('0x53')]=function(_0x3378a1,_0x1254fd,_0x4eb045){var _0x2b9139='';return db[_0xa477('0x29')][_0xa477('0x4a')]({'where':{'id':_0x3378a1['params']['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x1254fd,null))[_0xa477('0x23')](function(_0x452834){if(_0x452834){_0x2b9139=_0x452834[_0xa477('0x54')];var _0x1a48a4=_0x2b9139[_0xa477('0x55')](-0x1);if(_0x1a48a4==='/'){_0x2b9139=_0x2b9139[_0xa477('0x56')](0x0,_0x2b9139['lastIndexOf'](_0x1a48a4));}return rp({'method':_0xa477('0x57'),'uri':util['format'](_0xa477('0x58'),_0x2b9139,_0xa477('0x59')),'headers':{'Authorization':util[_0xa477('0x5a')](_0xa477('0x5b'),new Buffer(util[_0xa477('0x5a')](_0xa477('0x5c'),_0x452834[_0xa477('0x5d')]))[_0xa477('0x5e')](_0xa477('0x5f')))},'json':!![]});}})['then'](function(_0x16fcec){if(_0x16fcec){var _0x47be0a=[_0xa477('0x60'),'subject',_0xa477('0x61'),'description',_0xa477('0x17'),_0xa477('0x62'),_0xa477('0x63'),_0xa477('0x64'),'ticket_type',_0xa477('0x63'),'company'];_[_0xa477('0x65')](_0x16fcec,function(_0x3c8b35){return _0x47be0a['includes'](_0x3c8b35[_0xa477('0x25')])||!_0x3c8b35[_0xa477('0x66')]&&_0x3c8b35[_0xa477('0x2b')]!==_0xa477('0x67')&&_0x3c8b35['type']!==_0xa477('0x68');});return{'count':_0x16fcec[_0xa477('0x45')],'rows':_[_0xa477('0x28')](_0x16fcec,function(_0x4596ce){return{'id':_0x4596ce[_0xa477('0x25')],'name':_0x4596ce[_0xa477('0x69')],'custom':!_0x4596ce[_0xa477('0x66')],'options':_0x4596ce['choices']?_[_0xa477('0x28')](_0x4596ce[_0xa477('0x6a')],function(_0x7a28a7){return{'name':_[_0xa477('0x6b')](_0x7a28a7),'value':_0x7a28a7};}):[]};})};}})['then'](respondWithResult(_0x1254fd,null))[_0xa477('0x41')](function(_0x23dd79){var _0xa25710=_0x3378a1[_0xa477('0x2e')][_0xa477('0x6c')]?0x1f4:_0x23dd79[_0xa477('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xa477('0x53'),_0xa25710,JSON['stringify'](_0x23dd79));delete _0x23dd79['name'];if(_0xa25710===0x191){_0xa25710=0x190;}_0x1254fd[_0xa477('0x17')](_0xa25710)[_0xa477('0x26')](_0x3378a1[_0xa477('0x2e')][_0xa477('0x6c')]?{'message':_0xa477('0x6e'),'statusCode':_0x23dd79[_0xa477('0x6d')]}:_0x23dd79);});}; \ No newline at end of file +var _0x928c=['index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','where','filters','pick','merge','VIRTUAL','rows','catch','show','include','options','create','body','update','find','params','destroy','getConfigurations','findOne','order','sort','filter','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','GET','format','%s/%s','Basic\x20%s','%s:X','subject','agent','priority','group','ticket_type','company','remove','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','then','end','error','stack','name','send'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x928c,0x17f));var _0xc928=function(_0x4496c4,_0x3d0c2c){_0x4496c4=_0x4496c4-0x0;var _0x144c89=_0x928c[_0x4496c4];return _0x144c89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc928('0x0'));var jsonpatch=require(_0xc928('0x1'));var rp=require('request-promise');var moment=require(_0xc928('0x2'));var BPromise=require(_0xc928('0x3'));var Mustache=require(_0xc928('0x4'));var util=require(_0xc928('0x5'));var path=require(_0xc928('0x6'));var sox=require('sox');var csv=require(_0xc928('0x7'));var ejs=require(_0xc928('0x8'));var fs=require('fs');var fs_extra=require(_0xc928('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc928('0xa'));var deskjs=require(_0xc928('0xb'));var toCsv=require(_0xc928('0x7'));var querystring=require(_0xc928('0xc'));var Papa=require(_0xc928('0xd'));var Redis=require(_0xc928('0xe'));var authService=require(_0xc928('0xf'));var qs=require(_0xc928('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc928('0x11'));var logger=require(_0xc928('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc928('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc928('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x425750,_0x2e3a6f){_0x2e3a6f=_0x2e3a6f||0xcc;return function(_0x4f3b5a){if(_0x4f3b5a){return _0x425750[_0xc928('0x15')](_0x2e3a6f);}return _0x425750[_0xc928('0x16')](_0x2e3a6f)['end']();};}function respondWithResult(_0x3b5e4d,_0x3ae32f){_0x3ae32f=_0x3ae32f||0xc8;return function(_0x10f3cd){if(_0x10f3cd){return _0x3b5e4d[_0xc928('0x16')](_0x3ae32f)[_0xc928('0x17')](_0x10f3cd);}};}function respondWithFilteredResult(_0x23a005,_0x546cfe){return function(_0x16dd14){if(_0x16dd14){var _0x331e02=typeof _0x546cfe[_0xc928('0x18')]===_0xc928('0x19')&&typeof _0x546cfe[_0xc928('0x1a')]===_0xc928('0x19');var _0x1b9097=_0x16dd14[_0xc928('0x1b')];var _0x3f858d=_0x331e02?0x0:_0x546cfe[_0xc928('0x18')];var _0x16485d=_0x331e02?_0x16dd14[_0xc928('0x1b')]:_0x546cfe['offset']+_0x546cfe[_0xc928('0x1a')];var _0x329285;if(_0x16485d>=_0x1b9097){_0x16485d=_0x1b9097;_0x329285=0xc8;}else{_0x329285=0xce;}_0x23a005[_0xc928('0x16')](_0x329285);return _0x23a005[_0xc928('0x1c')]('Content-Range',_0x3f858d+'-'+_0x16485d+'/'+_0x1b9097)[_0xc928('0x17')](_0x16dd14);}return null;};}function patchUpdates(_0x2a7214){return function(_0x21a400){try{jsonpatch['apply'](_0x21a400,_0x2a7214,!![]);}catch(_0x4b2823){return BPromise[_0xc928('0x1d')](_0x4b2823);}return _0x21a400[_0xc928('0x1e')]();};}function saveUpdates(_0x375ec6,_0x16ed73){return function(_0x585749){if(_0x585749){return _0x585749['update'](_0x375ec6)[_0xc928('0x1f')](function(_0xbd5d43){return _0xbd5d43;});}return null;};}function removeEntity(_0x3ce74d,_0x1a5dc2){return function(_0x2090f8){if(_0x2090f8){return _0x2090f8['destroy']()[_0xc928('0x1f')](function(){_0x3ce74d[_0xc928('0x16')](0xcc)[_0xc928('0x20')]();});}};}function handleEntityNotFound(_0x4a3ceb,_0x5906a8){return function(_0x1548fa){if(!_0x1548fa){_0x4a3ceb[_0xc928('0x15')](0x194);}return _0x1548fa;};}function handleError(_0x58bbe5,_0x3d8f30){_0x3d8f30=_0x3d8f30||0x1f4;return function(_0x1c80f8){logger[_0xc928('0x21')](_0x1c80f8[_0xc928('0x22')]);if(_0x1c80f8['name']){delete _0x1c80f8[_0xc928('0x23')];}_0x58bbe5[_0xc928('0x16')](_0x3d8f30)[_0xc928('0x24')](_0x1c80f8);};}exports[_0xc928('0x25')]=function(_0x12b617,_0x44d6c2){var _0x9deef4={},_0x41f8bd={},_0x28d6ce={'count':0x0,'rows':[]};var _0x2f0cc9=_[_0xc928('0x26')](db[_0xc928('0x27')][_0xc928('0x28')],function(_0x322643){return{'name':_0x322643[_0xc928('0x29')],'type':_0x322643[_0xc928('0x2a')][_0xc928('0x2b')]};});_0x41f8bd[_0xc928('0x2c')]=_['map'](_0x2f0cc9,_0xc928('0x23'));_0x41f8bd[_0xc928('0x2d')]=_[_0xc928('0x2e')](_0x12b617['query']);_0x41f8bd['filters']=_[_0xc928('0x2f')](_0x41f8bd[_0xc928('0x2c')],_0x41f8bd[_0xc928('0x2d')]);_0x9deef4[_0xc928('0x30')]=_[_0xc928('0x2f')](_0x41f8bd[_0xc928('0x2c')],qs[_0xc928('0x31')](_0x12b617[_0xc928('0x2d')][_0xc928('0x31')]));_0x9deef4[_0xc928('0x30')]=_0x9deef4[_0xc928('0x30')][_0xc928('0x32')]?_0x9deef4[_0xc928('0x30')]:_0x41f8bd['model'];if(!_0x12b617[_0xc928('0x2d')][_0xc928('0x33')]('nolimit')){_0x9deef4[_0xc928('0x1a')]=qs[_0xc928('0x1a')](_0x12b617[_0xc928('0x2d')][_0xc928('0x1a')]);_0x9deef4[_0xc928('0x18')]=qs[_0xc928('0x18')](_0x12b617[_0xc928('0x2d')][_0xc928('0x18')]);}_0x9deef4['order']=qs['sort'](_0x12b617[_0xc928('0x2d')]['sort']);_0x9deef4[_0xc928('0x34')]=qs[_0xc928('0x35')](_[_0xc928('0x36')](_0x12b617[_0xc928('0x2d')],_0x41f8bd[_0xc928('0x35')]),_0x2f0cc9);if(_0x12b617[_0xc928('0x2d')]['filter']){_0x9deef4[_0xc928('0x34')]=_[_0xc928('0x37')](_0x9deef4[_0xc928('0x34')],{'$or':_['map'](_0x2f0cc9,function(_0x17a2db){if(_0x17a2db[_0xc928('0x2a')]!==_0xc928('0x38')){var _0x3fdb14={};_0x3fdb14[_0x17a2db[_0xc928('0x23')]]={'$like':'%'+_0x12b617[_0xc928('0x2d')]['filter']+'%'};return _0x3fdb14;}})});}_0x9deef4=_[_0xc928('0x37')]({},_0x9deef4,_0x12b617['options']);var _0x4076e6={'where':_0x9deef4[_0xc928('0x34')]};return db[_0xc928('0x27')][_0xc928('0x1b')](_0x4076e6)[_0xc928('0x1f')](function(_0x53ba6c){_0x28d6ce[_0xc928('0x1b')]=_0x53ba6c;if(_0x12b617[_0xc928('0x2d')]['includeAll']){_0x9deef4['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x9deef4);})[_0xc928('0x1f')](function(_0x4bb65f){_0x28d6ce[_0xc928('0x39')]=_0x4bb65f;return _0x28d6ce;})[_0xc928('0x1f')](respondWithFilteredResult(_0x44d6c2,_0x9deef4))[_0xc928('0x3a')](handleError(_0x44d6c2,null));};exports[_0xc928('0x3b')]=function(_0x29017c,_0x54f288){var _0x1be61a={'raw':![],'where':{'id':_0x29017c['params']['id']}},_0x19c732={};_0x19c732['model']=_[_0xc928('0x2e')](db[_0xc928('0x27')][_0xc928('0x28')]);_0x19c732[_0xc928('0x2d')]=_[_0xc928('0x2e')](_0x29017c[_0xc928('0x2d')]);_0x19c732['filters']=_[_0xc928('0x2f')](_0x19c732['model'],_0x19c732[_0xc928('0x2d')]);_0x1be61a[_0xc928('0x30')]=_[_0xc928('0x2f')](_0x19c732[_0xc928('0x2c')],qs[_0xc928('0x31')](_0x29017c['query']['fields']));_0x1be61a[_0xc928('0x30')]=_0x1be61a[_0xc928('0x30')]['length']?_0x1be61a[_0xc928('0x30')]:_0x19c732[_0xc928('0x2c')];if(_0x29017c[_0xc928('0x2d')]['includeAll']){_0x1be61a[_0xc928('0x3c')]=[{'all':!![]}];}_0x1be61a=_[_0xc928('0x37')]({},_0x1be61a,_0x29017c[_0xc928('0x3d')]);return db[_0xc928('0x27')]['find'](_0x1be61a)[_0xc928('0x1f')](handleEntityNotFound(_0x54f288,null))[_0xc928('0x1f')](respondWithResult(_0x54f288,null))['catch'](handleError(_0x54f288,null));};exports[_0xc928('0x3e')]=function(_0x354c8c,_0x4da2e6){return db[_0xc928('0x27')][_0xc928('0x3e')](_0x354c8c[_0xc928('0x3f')],{})['then'](respondWithResult(_0x4da2e6,0xc9))[_0xc928('0x3a')](handleError(_0x4da2e6,null));};exports[_0xc928('0x40')]=function(_0x528786,_0x5051d9){if(_0x528786[_0xc928('0x3f')]['id']){delete _0x528786[_0xc928('0x3f')]['id'];}return db[_0xc928('0x27')][_0xc928('0x41')]({'where':{'id':_0x528786[_0xc928('0x42')]['id']}})[_0xc928('0x1f')](handleEntityNotFound(_0x5051d9,null))[_0xc928('0x1f')](saveUpdates(_0x528786['body'],null))['then'](respondWithResult(_0x5051d9,null))[_0xc928('0x3a')](handleError(_0x5051d9,null));};exports[_0xc928('0x43')]=function(_0x2cc0cd,_0x495f60){return db[_0xc928('0x27')][_0xc928('0x41')]({'where':{'id':_0x2cc0cd['params']['id']}})[_0xc928('0x1f')](handleEntityNotFound(_0x495f60,null))[_0xc928('0x1f')](removeEntity(_0x495f60,null))[_0xc928('0x3a')](handleError(_0x495f60,null));};exports[_0xc928('0x44')]=function(_0x404d01,_0x1fe140,_0x1de4ab){var _0x39f94e={};var _0x17ad20={};var _0x396ecc;var _0xd22c11;return db[_0xc928('0x27')][_0xc928('0x45')]({'where':{'id':_0x404d01[_0xc928('0x42')]['id']}})[_0xc928('0x1f')](handleEntityNotFound(_0x1fe140,null))[_0xc928('0x1f')](function(_0x2fd37e){if(_0x2fd37e){_0x396ecc=_0x2fd37e;_0x17ad20[_0xc928('0x2c')]=_[_0xc928('0x2e')](db['FreshdeskConfiguration'][_0xc928('0x28')]);_0x17ad20[_0xc928('0x2d')]=_[_0xc928('0x2e')](_0x404d01[_0xc928('0x2d')]);_0x17ad20[_0xc928('0x35')]=_[_0xc928('0x2f')](_0x17ad20[_0xc928('0x2c')],_0x17ad20[_0xc928('0x2d')]);_0x39f94e[_0xc928('0x30')]=_[_0xc928('0x2f')](_0x17ad20[_0xc928('0x2c')],qs[_0xc928('0x31')](_0x404d01[_0xc928('0x2d')][_0xc928('0x31')]));_0x39f94e[_0xc928('0x30')]=_0x39f94e[_0xc928('0x30')][_0xc928('0x32')]?_0x39f94e[_0xc928('0x30')]:_0x17ad20[_0xc928('0x2c')];_0x39f94e[_0xc928('0x46')]=qs[_0xc928('0x47')](_0x404d01[_0xc928('0x2d')][_0xc928('0x47')]);_0x39f94e['where']=qs['filters'](_[_0xc928('0x36')](_0x404d01['query'],_0x17ad20[_0xc928('0x35')]));if(_0x404d01[_0xc928('0x2d')][_0xc928('0x48')]){_0x39f94e['where']=_[_0xc928('0x37')](_0x39f94e['where'],{'$or':_['map'](_0x39f94e['attributes'],function(_0xd3ac16){var _0x568ff0={};_0x568ff0[_0xd3ac16]={'$like':'%'+_0x404d01['query'][_0xc928('0x48')]+'%'};return _0x568ff0;})});}_0x39f94e=_['merge']({},_0x39f94e,_0x404d01[_0xc928('0x3d')]);return _0x396ecc[_0xc928('0x44')](_0x39f94e);}})[_0xc928('0x1f')](function(_0x33ee41){if(_0x33ee41){_0xd22c11=_0x33ee41[_0xc928('0x32')];if(!_0x404d01['query']['hasOwnProperty'](_0xc928('0x49'))){_0x39f94e[_0xc928('0x1a')]=qs[_0xc928('0x1a')](_0x404d01[_0xc928('0x2d')][_0xc928('0x1a')]);_0x39f94e[_0xc928('0x18')]=qs['offset'](_0x404d01[_0xc928('0x2d')][_0xc928('0x18')]);}return _0x396ecc[_0xc928('0x44')](_0x39f94e);}})[_0xc928('0x1f')](function(_0x2136c5){if(_0x2136c5){return _0x2136c5?{'count':_0xd22c11,'rows':_0x2136c5}:null;}})[_0xc928('0x1f')](respondWithResult(_0x1fe140,null))[_0xc928('0x3a')](handleError(_0x1fe140,null));};exports[_0xc928('0x4a')]=function(_0x45d168,_0x2a2873,_0x282a97){if(_0x45d168[_0xc928('0x3f')]['id']){delete _0x45d168['body']['id'];}return db[_0xc928('0x27')][_0xc928('0x45')]({'where':{'id':_0x45d168[_0xc928('0x42')]['id']}})[_0xc928('0x1f')](handleEntityNotFound(_0x2a2873,null))[_0xc928('0x1f')](function(_0x134a3b){if(_0x134a3b){_0x45d168[_0xc928('0x3f')][_0xc928('0x4b')]=_0x134a3b['id'];_0x45d168['body'][_0xc928('0x4c')]=integrations['getSubjects'](_0x45d168['body'][_0xc928('0x4d')],_0x45d168[_0xc928('0x3f')]['type']);_0x45d168[_0xc928('0x3f')][_0xc928('0x4e')]=integrations['getDescriptions'](_0x45d168[_0xc928('0x3f')]['channel'],_0x45d168[_0xc928('0x3f')][_0xc928('0x2a')]);return db[_0xc928('0x4f')][_0xc928('0x3e')](_0x45d168['body'],{'include':[{'model':db[_0xc928('0x50')],'as':_0xc928('0x4c')},{'model':db[_0xc928('0x50')],'as':_0xc928('0x4e')}]});}return null;})[_0xc928('0x1f')](respondWithResult(_0x2a2873,null))['catch'](handleError(_0x2a2873,null));};exports[_0xc928('0x51')]=function(_0x55d501,_0x2bdad7,_0x15fa85){var _0x2084e9='';return db[_0xc928('0x27')]['findOne']({'where':{'id':_0x55d501[_0xc928('0x42')]['id']},'attributes':['id',_0xc928('0x52'),_0xc928('0x53')]})[_0xc928('0x1f')](handleEntityNotFound(_0x2bdad7,null))[_0xc928('0x1f')](function(_0x1db9f4){if(_0x1db9f4){_0x2084e9=_0x1db9f4[_0xc928('0x52')];var _0x37989c=_0x2084e9[_0xc928('0x54')](-0x1);if(_0x37989c==='/'){_0x2084e9=_0x2084e9['substring'](0x0,_0x2084e9['lastIndexOf'](_0x37989c));}return rp({'method':_0xc928('0x55'),'uri':util[_0xc928('0x56')](_0xc928('0x57'),_0x2084e9,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xc928('0x56')](_0xc928('0x58'),new Buffer(util[_0xc928('0x56')](_0xc928('0x59'),_0x1db9f4[_0xc928('0x53')]))['toString']('base64'))},'json':!![]});}})[_0xc928('0x1f')](function(_0x25c07d){if(_0x25c07d){var _0x339925=['requester',_0xc928('0x5a'),_0xc928('0x5b'),'description',_0xc928('0x16'),_0xc928('0x5c'),_0xc928('0x5d'),'source',_0xc928('0x5e'),'group',_0xc928('0x5f')];_[_0xc928('0x60')](_0x25c07d,function(_0x1c9d48){return _0x339925['includes'](_0x1c9d48['name'])||!_0x1c9d48['default']&&_0x1c9d48[_0xc928('0x2a')]!==_0xc928('0x61')&&_0x1c9d48[_0xc928('0x2a')]!==_0xc928('0x62');});return{'count':_0x25c07d[_0xc928('0x32')],'rows':_[_0xc928('0x26')](_0x25c07d,function(_0xc54f43){return{'id':_0xc54f43[_0xc928('0x23')],'name':_0xc54f43[_0xc928('0x63')],'custom':!_0xc54f43['default'],'options':_0xc54f43[_0xc928('0x64')]?_['map'](_0xc54f43['choices'],function(_0x5abcdf){return{'name':_[_0xc928('0x65')](_0x5abcdf),'value':_0x5abcdf};}):[]};})};}})[_0xc928('0x1f')](respondWithResult(_0x2bdad7,null))[_0xc928('0x3a')](function(_0x2086d0){var _0x3b22e6=_0x55d501['query'][_0xc928('0x66')]?0x1f4:_0x2086d0[_0xc928('0x67')]||0x1f4;logger[_0xc928('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0xc928('0x51'),_0x3b22e6,JSON[_0xc928('0x68')](_0x2086d0));delete _0x2086d0[_0xc928('0x23')];if(_0x3b22e6===0x191){_0x3b22e6=0x190;}_0x2bdad7[_0xc928('0x16')](_0x3b22e6)['send'](_0x55d501[_0xc928('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2086d0[_0xc928('0x67')]}:_0x2086d0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a0296dd..305f3f2 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 _0x3c57=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount'];(function(_0x1d6777,_0xaa85e){var _0x5cdef1=function(_0x411e8b){while(--_0x411e8b){_0x1d6777['push'](_0x1d6777['shift']());}};_0x5cdef1(++_0xaa85e);}(_0x3c57,0x1c8));var _0x73c5=function(_0x270ae1,_0xd6e2a3){_0x270ae1=_0x270ae1-0x0;var _0x1f6729=_0x3c57[_0x270ae1];return _0x1f6729;};'use strict';var _=require(_0x73c5('0x0'));var util=require(_0x73c5('0x1'));var logger=require(_0x73c5('0x2'))(_0x73c5('0x3'));var moment=require(_0x73c5('0x4'));var BPromise=require(_0x73c5('0x5'));var rp=require(_0x73c5('0x6'));var fs=require('fs');var path=require(_0x73c5('0x7'));var rimraf=require('rimraf');var config=require(_0x73c5('0x8'));var attributes=require(_0x73c5('0x9'));var integrations=require(_0x73c5('0xa'));module['exports']=function(_0x6fbe2e,_0x3b4662){return _0x6fbe2e['define'](_0x73c5('0xb'),attributes,{'tableName':_0x73c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd37b=['FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x220f66,_0x32eb1){var _0x35b738=function(_0x1c9538){while(--_0x1c9538){_0x220f66['push'](_0x220f66['shift']());}};_0x35b738(++_0x32eb1);}(_0xd37b,0x98));var _0xbd37=function(_0x13f631,_0x3f41b5){_0x13f631=_0x13f631-0x0;var _0x18732d=_0xd37b[_0x13f631];return _0x18732d;};'use strict';var _=require(_0xbd37('0x0'));var util=require('util');var logger=require(_0xbd37('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd37('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd37('0x3'));var config=require('../../config/environment');var attributes=require(_0xbd37('0x4'));var integrations=require(_0xbd37('0x5'));module[_0xbd37('0x6')]=function(_0x15595e,_0x15f3d0){return _0x15595e[_0xbd37('0x7')](_0xbd37('0x8'),attributes,{'tableName':_0xbd37('0x9'),'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 4387567..d117daa 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 _0x8d94=['FreshdeskAccount','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','limit','map','include','attributes','model','GetFreshdeskAccount','ShowFreshdeskAccount'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8d94,0x9c));var _0x48d9=function(_0x4fc699,_0x2f8b1b){_0x4fc699=_0x4fc699-0x0;var _0x501826=_0x8d94[_0x4fc699];return _0x501826;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x48d9('0x0'));var fs=require('fs');var Redis=require(_0x48d9('0x1'));var db=require(_0x48d9('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x48d9('0x3'))(_0x48d9('0x4'));var config=require(_0x48d9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x48d9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd20a,_0x109962,_0x5b45b2){return new BPromise(function(_0x508baa,_0x2f512c){return client['request'](_0x1bd20a,_0x5b45b2)[_0x48d9('0x7')](function(_0x213339){logger[_0x48d9('0x8')]('FreshdeskAccount,\x20%s,\x20%s',_0x109962,_0x48d9('0x9'));logger[_0x48d9('0xa')](_0x48d9('0xb'),_0x109962,'request\x20sent',JSON[_0x48d9('0xc')](_0x213339));if(_0x213339['error']){if(_0x213339[_0x48d9('0xd')][_0x48d9('0xe')]===0x1f4){logger[_0x48d9('0xd')](_0x48d9('0xf'),_0x109962,_0x213339[_0x48d9('0xd')][_0x48d9('0x10')]);return _0x2f512c(_0x213339[_0x48d9('0xd')][_0x48d9('0x10')]);}logger[_0x48d9('0xd')](_0x48d9('0xf'),_0x109962,_0x213339[_0x48d9('0xd')]['message']);return _0x508baa(_0x213339[_0x48d9('0xd')][_0x48d9('0x10')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x109962,_0x48d9('0x9'));_0x508baa(_0x213339[_0x48d9('0x11')][_0x48d9('0x10')]);}})[_0x48d9('0x12')](function(_0x340878){logger[_0x48d9('0xd')](_0x48d9('0xf'),_0x109962,_0x340878);_0x2f512c(_0x340878);});});}exports['GetFreshdeskAccount']=function(_0xf94448){var _0xa1f839=this;return new Promise(function(_0x58f2ac,_0x1cb3fb){return db['FreshdeskAccount'][_0x48d9('0x13')]({'raw':_0xf94448[_0x48d9('0x14')]?_0xf94448[_0x48d9('0x14')][_0x48d9('0x15')]===undefined?!![]:![]:!![],'where':_0xf94448['options']?_0xf94448[_0x48d9('0x14')][_0x48d9('0x16')]||null:null,'attributes':_0xf94448[_0x48d9('0x14')]?_0xf94448[_0x48d9('0x14')]['attributes']||null:null,'limit':_0xf94448[_0x48d9('0x14')]?_0xf94448['options'][_0x48d9('0x17')]||null:null,'include':_0xf94448[_0x48d9('0x14')]?_0xf94448['options']['include']?_[_0x48d9('0x18')](_0xf94448[_0x48d9('0x14')][_0x48d9('0x19')],function(_0x4b7e1a){return{'model':db[_0x4b7e1a['model']],'as':_0x4b7e1a['as'],'attributes':_0x4b7e1a[_0x48d9('0x1a')],'include':_0x4b7e1a[_0x48d9('0x19')]?_[_0x48d9('0x18')](_0x4b7e1a['include'],function(_0x4f58fd){return{'model':db[_0x4f58fd[_0x48d9('0x1b')]],'as':_0x4f58fd['as'],'attributes':_0x4f58fd[_0x48d9('0x1a')],'include':_0x4f58fd[_0x48d9('0x19')]?_[_0x48d9('0x18')](_0x4f58fd['include'],function(_0x266545){return{'model':db[_0x266545[_0x48d9('0x1b')]],'as':_0x266545['as'],'attributes':_0x266545['attributes']};}):[]};}):[]};}):[]:[]})[_0x48d9('0x7')](function(_0x5c793d){logger[_0x48d9('0x8')](_0x48d9('0x1c'),_0xf94448);logger[_0x48d9('0xa')](_0x48d9('0x1c'),_0xf94448,JSON[_0x48d9('0xc')](_0x5c793d));_0x58f2ac(_0x5c793d);})[_0x48d9('0x12')](function(_0x46d35a){logger[_0x48d9('0xd')]('GetFreshdeskAccount',_0x46d35a[_0x48d9('0x10')],_0xf94448);_0x1cb3fb(_0xa1f839[_0x48d9('0xd')](0x1f4,_0x46d35a[_0x48d9('0x10')]));});});};exports[_0x48d9('0x1d')]=function(_0x2d17b5){var _0x5e3b58=this;return new Promise(function(_0x1f518d,_0x4381d9){return db[_0x48d9('0x1e')]['find']({'raw':_0x2d17b5['options']?_0x2d17b5[_0x48d9('0x14')][_0x48d9('0x15')]===undefined?!![]:![]:!![],'where':_0x2d17b5[_0x48d9('0x14')]?_0x2d17b5['options'][_0x48d9('0x16')]||null:null,'attributes':_0x2d17b5[_0x48d9('0x14')]?_0x2d17b5[_0x48d9('0x14')]['attributes']||null:null,'include':_0x2d17b5['options']?_0x2d17b5[_0x48d9('0x14')][_0x48d9('0x19')]?_[_0x48d9('0x18')](_0x2d17b5[_0x48d9('0x14')][_0x48d9('0x19')],function(_0x1ebe97){return{'model':db[_0x1ebe97[_0x48d9('0x1b')]],'as':_0x1ebe97['as'],'attributes':_0x1ebe97[_0x48d9('0x1a')],'include':_0x1ebe97[_0x48d9('0x19')]?_[_0x48d9('0x18')](_0x1ebe97[_0x48d9('0x19')],function(_0x1a7bf2){return{'model':db[_0x1a7bf2['model']],'as':_0x1a7bf2['as'],'attributes':_0x1a7bf2['attributes'],'include':_0x1a7bf2[_0x48d9('0x19')]?_[_0x48d9('0x18')](_0x1a7bf2[_0x48d9('0x19')],function(_0x371ade){return{'model':db[_0x371ade[_0x48d9('0x1b')]],'as':_0x371ade['as'],'attributes':_0x371ade[_0x48d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x48d9('0x7')](function(_0x18d864){logger[_0x48d9('0x8')](_0x48d9('0x1d'),_0x2d17b5);logger['debug']('ShowFreshdeskAccount',_0x2d17b5,JSON[_0x48d9('0xc')](_0x18d864));_0x1f518d(_0x18d864);})[_0x48d9('0x12')](function(_0x38f3bb){logger['error'](_0x48d9('0x1d'),_0x38f3bb['message'],_0x2d17b5);_0x4381d9(_0x5e3b58['error'](0x1f4,_0x38f3bb['message']));});});}; \ No newline at end of file +var _0x0993=['rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','limit','map','include','model','attributes','stringify','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x34f7ca,_0x3b88f2){var _0x48447f=function(_0x1a00b6){while(--_0x1a00b6){_0x34f7ca['push'](_0x34f7ca['shift']());}};_0x48447f(++_0x3b88f2);}(_0x0993,0x13c));var _0x3099=function(_0x1d2176,_0x53d5ae){_0x1d2176=_0x1d2176-0x0;var _0x3d99fc=_0x0993[_0x1d2176];return _0x3d99fc;};'use strict';var _=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var moment=require(_0x3099('0x2'));var BPromise=require(_0x3099('0x3'));var rs=require(_0x3099('0x4'));var fs=require('fs');var Redis=require(_0x3099('0x5'));var db=require(_0x3099('0x6'))['db'];var utils=require(_0x3099('0x7'));var logger=require('../../config/logger')(_0x3099('0x8'));var config=require(_0x3099('0x9'));var jayson=require(_0x3099('0xa'));var client=jayson[_0x3099('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6fe5,_0x2e0233,_0x2d1785){return new BPromise(function(_0x5ceb4d,_0x316d46){return client[_0x3099('0xc')](_0x5c6fe5,_0x2d1785)[_0x3099('0xd')](function(_0x26cdff){logger[_0x3099('0xe')](_0x3099('0xf'),_0x2e0233,'request\x20sent');logger[_0x3099('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2e0233,_0x3099('0x11'),JSON['stringify'](_0x26cdff));if(_0x26cdff[_0x3099('0x12')]){if(_0x26cdff[_0x3099('0x12')][_0x3099('0x13')]===0x1f4){logger[_0x3099('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x2e0233,_0x26cdff[_0x3099('0x12')]['message']);return _0x316d46(_0x26cdff['error'][_0x3099('0x14')]);}logger[_0x3099('0x12')](_0x3099('0xf'),_0x2e0233,_0x26cdff[_0x3099('0x12')][_0x3099('0x14')]);return _0x5ceb4d(_0x26cdff['error']['message']);}else{logger['info'](_0x3099('0xf'),_0x2e0233,'request\x20sent');_0x5ceb4d(_0x26cdff[_0x3099('0x15')][_0x3099('0x14')]);}})[_0x3099('0x16')](function(_0x4550dc){logger[_0x3099('0x12')](_0x3099('0xf'),_0x2e0233,_0x4550dc);_0x316d46(_0x4550dc);});});}exports[_0x3099('0x17')]=function(_0x2a27f4){var _0x54ec7a=this;return new Promise(function(_0x4b7d13,_0x420686){return db[_0x3099('0x18')]['findAll']({'raw':_0x2a27f4[_0x3099('0x19')]?_0x2a27f4[_0x3099('0x19')][_0x3099('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a27f4['options']?_0x2a27f4[_0x3099('0x19')]['where']||null:null,'attributes':_0x2a27f4['options']?_0x2a27f4[_0x3099('0x19')]['attributes']||null:null,'limit':_0x2a27f4[_0x3099('0x19')]?_0x2a27f4[_0x3099('0x19')][_0x3099('0x1b')]||null:null,'include':_0x2a27f4['options']?_0x2a27f4['options']['include']?_[_0x3099('0x1c')](_0x2a27f4[_0x3099('0x19')][_0x3099('0x1d')],function(_0x2f9ae6){return{'model':db[_0x2f9ae6[_0x3099('0x1e')]],'as':_0x2f9ae6['as'],'attributes':_0x2f9ae6[_0x3099('0x1f')],'include':_0x2f9ae6[_0x3099('0x1d')]?_['map'](_0x2f9ae6[_0x3099('0x1d')],function(_0x122b35){return{'model':db[_0x122b35[_0x3099('0x1e')]],'as':_0x122b35['as'],'attributes':_0x122b35[_0x3099('0x1f')],'include':_0x122b35[_0x3099('0x1d')]?_['map'](_0x122b35[_0x3099('0x1d')],function(_0x6cc5bc){return{'model':db[_0x6cc5bc[_0x3099('0x1e')]],'as':_0x6cc5bc['as'],'attributes':_0x6cc5bc[_0x3099('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e6d3a){logger[_0x3099('0xe')](_0x3099('0x17'),_0x2a27f4);logger[_0x3099('0x10')]('GetFreshdeskAccount',_0x2a27f4,JSON[_0x3099('0x20')](_0x4e6d3a));_0x4b7d13(_0x4e6d3a);})[_0x3099('0x16')](function(_0x57d563){logger['error'](_0x3099('0x17'),_0x57d563[_0x3099('0x14')],_0x2a27f4);_0x420686(_0x54ec7a['error'](0x1f4,_0x57d563[_0x3099('0x14')]));});});};exports[_0x3099('0x21')]=function(_0x5b96fe){var _0x2ae62f=this;return new Promise(function(_0x280def,_0x25c4d2){return db[_0x3099('0x18')][_0x3099('0x22')]({'raw':_0x5b96fe[_0x3099('0x19')]?_0x5b96fe['options'][_0x3099('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b96fe[_0x3099('0x19')]?_0x5b96fe['options'][_0x3099('0x23')]||null:null,'attributes':_0x5b96fe[_0x3099('0x19')]?_0x5b96fe[_0x3099('0x19')][_0x3099('0x1f')]||null:null,'include':_0x5b96fe[_0x3099('0x19')]?_0x5b96fe[_0x3099('0x19')][_0x3099('0x1d')]?_['map'](_0x5b96fe[_0x3099('0x19')][_0x3099('0x1d')],function(_0x3f77b7){return{'model':db[_0x3f77b7[_0x3099('0x1e')]],'as':_0x3f77b7['as'],'attributes':_0x3f77b7[_0x3099('0x1f')],'include':_0x3f77b7[_0x3099('0x1d')]?_[_0x3099('0x1c')](_0x3f77b7[_0x3099('0x1d')],function(_0x40c8e0){return{'model':db[_0x40c8e0[_0x3099('0x1e')]],'as':_0x40c8e0['as'],'attributes':_0x40c8e0['attributes'],'include':_0x40c8e0[_0x3099('0x1d')]?_[_0x3099('0x1c')](_0x40c8e0[_0x3099('0x1d')],function(_0x365079){return{'model':db[_0x365079[_0x3099('0x1e')]],'as':_0x365079['as'],'attributes':_0x365079[_0x3099('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3099('0xd')](function(_0xf4f3a0){logger['info'](_0x3099('0x21'),_0x5b96fe);logger[_0x3099('0x10')](_0x3099('0x21'),_0x5b96fe,JSON[_0x3099('0x20')](_0xf4f3a0));_0x280def(_0xf4f3a0);})[_0x3099('0x16')](function(_0x5d0958){logger['error'](_0x3099('0x21'),_0x5d0958[_0x3099('0x14')],_0x5b96fe);_0x25c4d2(_0x2ae62f[_0x3099('0x12')](0x1f4,_0x5d0958[_0x3099('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 00bd6e2..b1a07f9 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 _0xfe58=['getTags','post','create','setTags','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x1046ba,_0x17699d){var _0x31ae08=function(_0x4c737d){while(--_0x4c737d){_0x1046ba['push'](_0x1046ba['shift']());}};_0x31ae08(++_0x17699d);}(_0xfe58,0x1e8));var _0x8fe5=function(_0x5ad5ca,_0x5f33fa){_0x5ad5ca=_0x5ad5ca-0x0;var _0x54f99b=_0xfe58[_0x5ad5ca];return _0x54f99b;};'use strict';var multer=require(_0x8fe5('0x0'));var util=require('util');var path=require(_0x8fe5('0x1'));var timeout=require(_0x8fe5('0x2'));var express=require('express');var router=express[_0x8fe5('0x3')]();var fs_extra=require(_0x8fe5('0x4'));var auth=require(_0x8fe5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8fe5('0x6'));router[_0x8fe5('0x7')]('/',auth[_0x8fe5('0x8')](),controller['index']);router[_0x8fe5('0x7')](_0x8fe5('0x9'),auth[_0x8fe5('0x8')](),controller['show']);router['get'](_0x8fe5('0xa'),auth[_0x8fe5('0x8')](),controller[_0x8fe5('0xb')]);router[_0x8fe5('0x7')](_0x8fe5('0xc'),auth[_0x8fe5('0x8')](),controller[_0x8fe5('0xd')]);router[_0x8fe5('0x7')](_0x8fe5('0xe'),auth[_0x8fe5('0x8')](),controller['getDescriptions']);router[_0x8fe5('0x7')](_0x8fe5('0xf'),auth[_0x8fe5('0x8')](),controller[_0x8fe5('0x10')]);router[_0x8fe5('0x11')]('/',auth[_0x8fe5('0x8')](),controller[_0x8fe5('0x12')]);router[_0x8fe5('0x11')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8fe5('0x13')]);router[_0x8fe5('0x14')](_0x8fe5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8fe5('0x15')](_0x8fe5('0x9'),auth[_0x8fe5('0x8')](),controller[_0x8fe5('0x16')]);module[_0x8fe5('0x17')]=router; \ No newline at end of file +var _0x871d=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getTags','post','/:id/tags','setTags','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x47341c,_0x1d4de7){var _0x27ffad=function(_0x30167b){while(--_0x30167b){_0x47341c['push'](_0x47341c['shift']());}};_0x27ffad(++_0x1d4de7);}(_0x871d,0xa9));var _0xd871=function(_0x2c9c09,_0x501a2a){_0x2c9c09=_0x2c9c09-0x0;var _0x55085f=_0x871d[_0x2c9c09];return _0x55085f;};'use strict';var multer=require(_0xd871('0x0'));var util=require(_0xd871('0x1'));var path=require('path');var timeout=require(_0xd871('0x2'));var express=require(_0xd871('0x3'));var router=express[_0xd871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd871('0x5'));var interaction=require(_0xd871('0x6'));var config=require(_0xd871('0x7'));var controller=require(_0xd871('0x8'));router[_0xd871('0x9')]('/',auth[_0xd871('0xa')](),controller['index']);router['get'](_0xd871('0xb'),auth['isAuthenticated'](),controller[_0xd871('0xc')]);router[_0xd871('0x9')](_0xd871('0xd'),auth['isAuthenticated'](),controller[_0xd871('0xe')]);router[_0xd871('0x9')](_0xd871('0xf'),auth['isAuthenticated'](),controller[_0xd871('0x10')]);router[_0xd871('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd871('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd871('0x11')]);router[_0xd871('0x12')]('/',auth[_0xd871('0xa')](),controller['create']);router[_0xd871('0x12')](_0xd871('0x13'),auth['isAuthenticated'](),controller[_0xd871('0x14')]);router['put'](_0xd871('0xb'),auth[_0xd871('0xa')](),controller[_0xd871('0x15')]);router[_0xd871('0x16')](_0xd871('0xb'),auth['isAuthenticated'](),controller[_0xd871('0x17')]);module[_0xd871('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 63047a4..aa2135c 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 _0xa1a6=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1a6,0x77));var _0x6a1a=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xa1a6[_0xe7281f];return _0x90dc99;};'use strict';var Sequelize=require(_0x6a1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a1a('0x1')]},'description':{'type':Sequelize[_0x6a1a('0x1')]}}; \ No newline at end of file +var _0xa083=['STRING','exports'];(function(_0x2cd1b5,_0x416894){var _0x7bbbe1=function(_0x233425){while(--_0x233425){_0x2cd1b5['push'](_0x2cd1b5['shift']());}};_0x7bbbe1(++_0x416894);}(_0xa083,0x13f));var _0x3a08=function(_0x594e8d,_0x18cc66){_0x594e8d=_0x594e8d-0x0;var _0xfd0b48=_0xa083[_0x594e8d];return _0xfd0b48;};'use strict';var Sequelize=require('sequelize');module[_0x3a08('0x0')]={'name':{'type':Sequelize[_0x3a08('0x1')]},'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 7edbea5..de60a38 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 _0x0ca4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','undefined','count','offset','set','Content-Range','apply','then','destroy','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','key','query','filters','model','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','attributes','find','body','update','findOne','FreshdeskField','getFields','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','rimraf','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4c978c,_0xbd7d69){var _0x48db9c=function(_0x4127c8){while(--_0x4127c8){_0x4c978c['push'](_0x4c978c['shift']());}};_0x48db9c(++_0xbd7d69);}(_0x0ca4,0x1c4));var _0x40ca=function(_0x2ca6db,_0x11094d){_0x2ca6db=_0x2ca6db-0x0;var _0x526a86=_0x0ca4[_0x2ca6db];return _0x526a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40ca('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x40ca('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40ca('0x2'));var path=require('path');var sox=require(_0x40ca('0x3'));var csv=require(_0x40ca('0x4'));var ejs=require(_0x40ca('0x5'));var fs=require('fs');var fs_extra=require(_0x40ca('0x6'));var _=require(_0x40ca('0x7'));var squel=require('squel');var crypto=require(_0x40ca('0x8'));var jsforce=require(_0x40ca('0x9'));var deskjs=require(_0x40ca('0xa'));var toCsv=require('to-csv');var querystring=require(_0x40ca('0xb'));var Papa=require(_0x40ca('0xc'));var Redis=require(_0x40ca('0xd'));var authService=require(_0x40ca('0xe'));var qs=require(_0x40ca('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40ca('0x10'));var logger=require(_0x40ca('0x11'))(_0x40ca('0x12'));var utils=require(_0x40ca('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x40ca('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0e38a,_0xd78c24){_0xd78c24=_0xd78c24||0xcc;return function(_0xde102e){if(_0xde102e){return _0xd0e38a[_0x40ca('0x15')](_0xd78c24);}return _0xd0e38a['status'](_0xd78c24)[_0x40ca('0x16')]();};}function respondWithResult(_0x269928,_0x3c6be3){_0x3c6be3=_0x3c6be3||0xc8;return function(_0x4a77ed){if(_0x4a77ed){return _0x269928[_0x40ca('0x17')](_0x3c6be3)['json'](_0x4a77ed);}};}function respondWithFilteredResult(_0x572d41,_0x2744a2){return function(_0x8a5022){if(_0x8a5022){var _0x564c80=typeof _0x2744a2['offset']===_0x40ca('0x18')&&typeof _0x2744a2['limit']===_0x40ca('0x18');var _0x12013e=_0x8a5022[_0x40ca('0x19')];var _0x315db9=_0x564c80?0x0:_0x2744a2[_0x40ca('0x1a')];var _0xcb2ade=_0x564c80?_0x8a5022['count']:_0x2744a2[_0x40ca('0x1a')]+_0x2744a2['limit'];var _0x40c7ca;if(_0xcb2ade>=_0x12013e){_0xcb2ade=_0x12013e;_0x40c7ca=0xc8;}else{_0x40c7ca=0xce;}_0x572d41[_0x40ca('0x17')](_0x40c7ca);return _0x572d41[_0x40ca('0x1b')](_0x40ca('0x1c'),_0x315db9+'-'+_0xcb2ade+'/'+_0x12013e)['json'](_0x8a5022);}return null;};}function patchUpdates(_0x21a033){return function(_0x3c7b94){try{jsonpatch[_0x40ca('0x1d')](_0x3c7b94,_0x21a033,!![]);}catch(_0x595432){return BPromise['reject'](_0x595432);}return _0x3c7b94['save']();};}function saveUpdates(_0x30744c,_0x1352e7){return function(_0x4fe841){if(_0x4fe841){return _0x4fe841['update'](_0x30744c)[_0x40ca('0x1e')](function(_0x3ce2a0){return _0x3ce2a0;});}return null;};}function removeEntity(_0x283d55,_0x409816){return function(_0x1958cc){if(_0x1958cc){return _0x1958cc[_0x40ca('0x1f')]()[_0x40ca('0x1e')](function(){_0x283d55['status'](0xcc)[_0x40ca('0x16')]();});}};}function handleEntityNotFound(_0x2f6e85,_0x120816){return function(_0x430d79){if(!_0x430d79){_0x2f6e85[_0x40ca('0x15')](0x194);}return _0x430d79;};}function handleError(_0x170cd0,_0xf2e9c4){_0xf2e9c4=_0xf2e9c4||0x1f4;return function(_0x579f1a){logger['error'](_0x579f1a[_0x40ca('0x20')]);if(_0x579f1a[_0x40ca('0x21')]){delete _0x579f1a[_0x40ca('0x21')];}_0x170cd0[_0x40ca('0x17')](_0xf2e9c4)['send'](_0x579f1a);};}exports[_0x40ca('0x22')]=function(_0x1cf1ae,_0x4458c4){var _0xc24fad={},_0x97b6d1={},_0x25a8ef={'count':0x0,'rows':[]};var _0x50d807=_['map'](db[_0x40ca('0x23')][_0x40ca('0x24')],function(_0x1bc0d4){return{'name':_0x1bc0d4[_0x40ca('0x25')],'type':_0x1bc0d4['type'][_0x40ca('0x26')]};});_0x97b6d1['model']=_['map'](_0x50d807,_0x40ca('0x21'));_0x97b6d1['query']=_['keys'](_0x1cf1ae[_0x40ca('0x27')]);_0x97b6d1[_0x40ca('0x28')]=_['intersection'](_0x97b6d1[_0x40ca('0x29')],_0x97b6d1[_0x40ca('0x27')]);_0xc24fad['attributes']=_[_0x40ca('0x2a')](_0x97b6d1[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0x1cf1ae[_0x40ca('0x27')]['fields']));_0xc24fad['attributes']=_0xc24fad['attributes'][_0x40ca('0x2c')]?_0xc24fad['attributes']:_0x97b6d1[_0x40ca('0x29')];if(!_0x1cf1ae[_0x40ca('0x27')][_0x40ca('0x2d')](_0x40ca('0x2e'))){_0xc24fad[_0x40ca('0x2f')]=qs[_0x40ca('0x2f')](_0x1cf1ae[_0x40ca('0x27')][_0x40ca('0x2f')]);_0xc24fad['offset']=qs[_0x40ca('0x1a')](_0x1cf1ae[_0x40ca('0x27')]['offset']);}_0xc24fad['order']=qs[_0x40ca('0x30')](_0x1cf1ae[_0x40ca('0x27')][_0x40ca('0x30')]);_0xc24fad[_0x40ca('0x31')]=qs['filters'](_[_0x40ca('0x32')](_0x1cf1ae['query'],_0x97b6d1['filters']),_0x50d807);if(_0x1cf1ae['query'][_0x40ca('0x33')]){_0xc24fad[_0x40ca('0x31')]=_[_0x40ca('0x34')](_0xc24fad[_0x40ca('0x31')],{'$or':_[_0x40ca('0x35')](_0x50d807,function(_0x48c023){if(_0x48c023[_0x40ca('0x36')]!==_0x40ca('0x37')){var _0x274310={};_0x274310[_0x48c023[_0x40ca('0x21')]]={'$like':'%'+_0x1cf1ae['query'][_0x40ca('0x33')]+'%'};return _0x274310;}})});}_0xc24fad=_[_0x40ca('0x34')]({},_0xc24fad,_0x1cf1ae[_0x40ca('0x38')]);var _0x31eef0={'where':_0xc24fad['where']};return db[_0x40ca('0x23')][_0x40ca('0x19')](_0x31eef0)[_0x40ca('0x1e')](function(_0x4dd893){_0x25a8ef[_0x40ca('0x19')]=_0x4dd893;if(_0x1cf1ae['query'][_0x40ca('0x39')]){_0xc24fad[_0x40ca('0x3a')]=[{'all':!![]}];}return db[_0x40ca('0x23')]['findAll'](_0xc24fad);})[_0x40ca('0x1e')](function(_0x2f9726){_0x25a8ef[_0x40ca('0x3b')]=_0x2f9726;return _0x25a8ef;})[_0x40ca('0x1e')](respondWithFilteredResult(_0x4458c4,_0xc24fad))[_0x40ca('0x3c')](handleError(_0x4458c4,null));};exports[_0x40ca('0x3d')]=function(_0x398d88,_0x5b299a){var _0x5aee4d={'raw':![],'where':{'id':_0x398d88[_0x40ca('0x3e')]['id']}},_0x434729={};_0x434729[_0x40ca('0x29')]=_[_0x40ca('0x3f')](db[_0x40ca('0x23')][_0x40ca('0x24')]);_0x434729[_0x40ca('0x27')]=_[_0x40ca('0x3f')](_0x398d88[_0x40ca('0x27')]);_0x434729[_0x40ca('0x28')]=_[_0x40ca('0x2a')](_0x434729[_0x40ca('0x29')],_0x434729[_0x40ca('0x27')]);_0x5aee4d[_0x40ca('0x40')]=_[_0x40ca('0x2a')](_0x434729[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0x398d88[_0x40ca('0x27')][_0x40ca('0x2b')]));_0x5aee4d[_0x40ca('0x40')]=_0x5aee4d[_0x40ca('0x40')][_0x40ca('0x2c')]?_0x5aee4d[_0x40ca('0x40')]:_0x434729[_0x40ca('0x29')];if(_0x398d88[_0x40ca('0x27')][_0x40ca('0x39')]){_0x5aee4d['include']=[{'all':!![]}];}_0x5aee4d=_[_0x40ca('0x34')]({},_0x5aee4d,_0x398d88[_0x40ca('0x38')]);return db['FreshdeskConfiguration'][_0x40ca('0x41')](_0x5aee4d)['then'](handleEntityNotFound(_0x5b299a,null))[_0x40ca('0x1e')](respondWithResult(_0x5b299a,null))[_0x40ca('0x3c')](handleError(_0x5b299a,null));};exports['create']=function(_0x1e7662,_0x21d609){return db[_0x40ca('0x23')]['create'](_0x1e7662[_0x40ca('0x42')],{})[_0x40ca('0x1e')](respondWithResult(_0x21d609,0xc9))[_0x40ca('0x3c')](handleError(_0x21d609,null));};exports[_0x40ca('0x43')]=function(_0x382b3e,_0x13651a){if(_0x382b3e[_0x40ca('0x42')]['id']){delete _0x382b3e[_0x40ca('0x42')]['id'];}return db[_0x40ca('0x23')][_0x40ca('0x41')]({'where':{'id':_0x382b3e[_0x40ca('0x3e')]['id']}})[_0x40ca('0x1e')](handleEntityNotFound(_0x13651a,null))[_0x40ca('0x1e')](saveUpdates(_0x382b3e['body'],null))['then'](respondWithResult(_0x13651a,null))[_0x40ca('0x3c')](handleError(_0x13651a,null));};exports['destroy']=function(_0x4f321a,_0x58634c){return db['FreshdeskConfiguration'][_0x40ca('0x41')]({'where':{'id':_0x4f321a[_0x40ca('0x3e')]['id']}})[_0x40ca('0x1e')](handleEntityNotFound(_0x58634c,null))['then'](removeEntity(_0x58634c,null))[_0x40ca('0x3c')](handleError(_0x58634c,null));};exports['getFields']=function(_0xc3b52b,_0x31f80f,_0x2811c9){var _0x18ace0={};var _0x2ff5ba={};var _0x1464a9;var _0x32afd8;return db[_0x40ca('0x23')][_0x40ca('0x44')]({'where':{'id':_0xc3b52b[_0x40ca('0x3e')]['id']}})[_0x40ca('0x1e')](handleEntityNotFound(_0x31f80f,null))[_0x40ca('0x1e')](function(_0x154d27){if(_0x154d27){_0x1464a9=_0x154d27;_0x2ff5ba[_0x40ca('0x29')]=_['keys'](db[_0x40ca('0x45')]['rawAttributes']);_0x2ff5ba[_0x40ca('0x27')]=_[_0x40ca('0x3f')](_0xc3b52b[_0x40ca('0x27')]);_0x2ff5ba[_0x40ca('0x28')]=_['intersection'](_0x2ff5ba[_0x40ca('0x29')],_0x2ff5ba['query']);_0x18ace0[_0x40ca('0x40')]=_[_0x40ca('0x2a')](_0x2ff5ba[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0xc3b52b[_0x40ca('0x27')][_0x40ca('0x2b')]));_0x18ace0[_0x40ca('0x40')]=_0x18ace0[_0x40ca('0x40')]['length']?_0x18ace0[_0x40ca('0x40')]:_0x2ff5ba[_0x40ca('0x29')];_0x18ace0['order']=qs['sort'](_0xc3b52b[_0x40ca('0x27')]['sort']);_0x18ace0[_0x40ca('0x31')]=qs[_0x40ca('0x28')](_[_0x40ca('0x32')](_0xc3b52b[_0x40ca('0x27')],_0x2ff5ba[_0x40ca('0x28')]));if(_0xc3b52b[_0x40ca('0x27')]['filter']){_0x18ace0[_0x40ca('0x31')]=_[_0x40ca('0x34')](_0x18ace0['where'],{'$or':_[_0x40ca('0x35')](_0x18ace0[_0x40ca('0x40')],function(_0x2354ec){var _0x2b150e={};_0x2b150e[_0x2354ec]={'$like':'%'+_0xc3b52b['query'][_0x40ca('0x33')]+'%'};return _0x2b150e;})});}_0x18ace0=_[_0x40ca('0x34')]({},_0x18ace0,_0xc3b52b[_0x40ca('0x38')]);return _0x1464a9['getFields'](_0x18ace0);}})[_0x40ca('0x1e')](function(_0x5604f4){if(_0x5604f4){_0x32afd8=_0x5604f4['length'];if(!_0xc3b52b[_0x40ca('0x27')]['hasOwnProperty'](_0x40ca('0x2e'))){_0x18ace0['limit']=qs[_0x40ca('0x2f')](_0xc3b52b[_0x40ca('0x27')][_0x40ca('0x2f')]);_0x18ace0[_0x40ca('0x1a')]=qs['offset'](_0xc3b52b[_0x40ca('0x27')]['offset']);}return _0x1464a9[_0x40ca('0x46')](_0x18ace0);}})[_0x40ca('0x1e')](function(_0x1c3e15){if(_0x1c3e15){return _0x1c3e15?{'count':_0x32afd8,'rows':_0x1c3e15}:null;}})[_0x40ca('0x1e')](respondWithResult(_0x31f80f,null))[_0x40ca('0x3c')](handleError(_0x31f80f,null));};exports[_0x40ca('0x47')]=function(_0x4aebf5,_0x2854fb,_0x446532){var _0x43a23f={};var _0x1a17d5={};var _0x161450;var _0x18fd6a;return db[_0x40ca('0x23')][_0x40ca('0x44')]({'where':{'id':_0x4aebf5[_0x40ca('0x3e')]['id']}})[_0x40ca('0x1e')](handleEntityNotFound(_0x2854fb,null))[_0x40ca('0x1e')](function(_0x2a0d07){if(_0x2a0d07){_0x161450=_0x2a0d07;_0x1a17d5[_0x40ca('0x29')]=_[_0x40ca('0x3f')](db[_0x40ca('0x45')][_0x40ca('0x24')]);_0x1a17d5[_0x40ca('0x27')]=_['keys'](_0x4aebf5['query']);_0x1a17d5[_0x40ca('0x28')]=_[_0x40ca('0x2a')](_0x1a17d5[_0x40ca('0x29')],_0x1a17d5[_0x40ca('0x27')]);_0x43a23f[_0x40ca('0x40')]=_[_0x40ca('0x2a')](_0x1a17d5[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0x4aebf5[_0x40ca('0x27')][_0x40ca('0x2b')]));_0x43a23f[_0x40ca('0x40')]=_0x43a23f[_0x40ca('0x40')]['length']?_0x43a23f['attributes']:_0x1a17d5[_0x40ca('0x29')];_0x43a23f[_0x40ca('0x48')]=qs['sort'](_0x4aebf5[_0x40ca('0x27')][_0x40ca('0x30')]);_0x43a23f[_0x40ca('0x31')]=qs['filters'](_[_0x40ca('0x32')](_0x4aebf5[_0x40ca('0x27')],_0x1a17d5[_0x40ca('0x28')]));if(_0x4aebf5[_0x40ca('0x27')][_0x40ca('0x33')]){_0x43a23f[_0x40ca('0x31')]=_[_0x40ca('0x34')](_0x43a23f[_0x40ca('0x31')],{'$or':_[_0x40ca('0x35')](_0x43a23f[_0x40ca('0x40')],function(_0x330cbe){var _0x5cc8f3={};_0x5cc8f3[_0x330cbe]={'$like':'%'+_0x4aebf5[_0x40ca('0x27')]['filter']+'%'};return _0x5cc8f3;})});}_0x43a23f=_[_0x40ca('0x34')]({},_0x43a23f,_0x4aebf5['options']);return _0x161450[_0x40ca('0x47')](_0x43a23f);}})[_0x40ca('0x1e')](function(_0x253222){if(_0x253222){_0x18fd6a=_0x253222[_0x40ca('0x2c')];if(!_0x4aebf5[_0x40ca('0x27')]['hasOwnProperty'](_0x40ca('0x2e'))){_0x43a23f[_0x40ca('0x2f')]=qs[_0x40ca('0x2f')](_0x4aebf5[_0x40ca('0x27')][_0x40ca('0x2f')]);_0x43a23f['offset']=qs[_0x40ca('0x1a')](_0x4aebf5[_0x40ca('0x27')][_0x40ca('0x1a')]);}return _0x161450[_0x40ca('0x47')](_0x43a23f);}})[_0x40ca('0x1e')](function(_0x419222){if(_0x419222){return _0x419222?{'count':_0x18fd6a,'rows':_0x419222}:null;}})[_0x40ca('0x1e')](respondWithResult(_0x2854fb,null))['catch'](handleError(_0x2854fb,null));};exports[_0x40ca('0x49')]=function(_0x3954a7,_0x264524,_0x10c1fb){var _0x4be344={};var _0x3dba2b={};var _0x2ea023;var _0x33b254;return db[_0x40ca('0x23')][_0x40ca('0x44')]({'where':{'id':_0x3954a7[_0x40ca('0x3e')]['id']}})[_0x40ca('0x1e')](handleEntityNotFound(_0x264524,null))[_0x40ca('0x1e')](function(_0x452e13){if(_0x452e13){_0x2ea023=_0x452e13;_0x3dba2b['model']=_[_0x40ca('0x3f')](db[_0x40ca('0x45')][_0x40ca('0x24')]);_0x3dba2b[_0x40ca('0x27')]=_[_0x40ca('0x3f')](_0x3954a7[_0x40ca('0x27')]);_0x3dba2b[_0x40ca('0x28')]=_[_0x40ca('0x2a')](_0x3dba2b[_0x40ca('0x29')],_0x3dba2b[_0x40ca('0x27')]);_0x4be344['attributes']=_[_0x40ca('0x2a')](_0x3dba2b[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0x3954a7[_0x40ca('0x27')][_0x40ca('0x2b')]));_0x4be344['attributes']=_0x4be344[_0x40ca('0x40')][_0x40ca('0x2c')]?_0x4be344[_0x40ca('0x40')]:_0x3dba2b[_0x40ca('0x29')];_0x4be344[_0x40ca('0x48')]=qs['sort'](_0x3954a7['query']['sort']);_0x4be344[_0x40ca('0x31')]=qs['filters'](_['pick'](_0x3954a7[_0x40ca('0x27')],_0x3dba2b[_0x40ca('0x28')]));if(_0x3954a7[_0x40ca('0x27')][_0x40ca('0x33')]){_0x4be344['where']=_[_0x40ca('0x34')](_0x4be344['where'],{'$or':_[_0x40ca('0x35')](_0x4be344[_0x40ca('0x40')],function(_0x56dab1){var _0x38f0e7={};_0x38f0e7[_0x56dab1]={'$like':'%'+_0x3954a7['query'][_0x40ca('0x33')]+'%'};return _0x38f0e7;})});}_0x4be344=_['merge']({},_0x4be344,_0x3954a7[_0x40ca('0x38')]);return _0x2ea023[_0x40ca('0x49')](_0x4be344);}})[_0x40ca('0x1e')](function(_0xef4941){if(_0xef4941){_0x33b254=_0xef4941[_0x40ca('0x2c')];if(!_0x3954a7[_0x40ca('0x27')][_0x40ca('0x2d')](_0x40ca('0x2e'))){_0x4be344[_0x40ca('0x2f')]=qs[_0x40ca('0x2f')](_0x3954a7[_0x40ca('0x27')][_0x40ca('0x2f')]);_0x4be344['offset']=qs[_0x40ca('0x1a')](_0x3954a7[_0x40ca('0x27')][_0x40ca('0x1a')]);}return _0x2ea023[_0x40ca('0x49')](_0x4be344);}})[_0x40ca('0x1e')](function(_0x56145a){if(_0x56145a){return _0x56145a?{'count':_0x33b254,'rows':_0x56145a}:null;}})[_0x40ca('0x1e')](respondWithResult(_0x264524,null))['catch'](handleError(_0x264524,null));};exports[_0x40ca('0x4a')]=function(_0x176447,_0x1256b4,_0x948e07){var _0x313b5d={};var _0x18aa4d={};var _0x51ef53;var _0x3cec86;return db[_0x40ca('0x23')][_0x40ca('0x44')]({'where':{'id':_0x176447[_0x40ca('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1256b4,null))[_0x40ca('0x1e')](function(_0xc2acf1){if(_0xc2acf1){_0x51ef53=_0xc2acf1;_0x18aa4d['model']=_[_0x40ca('0x3f')](db[_0x40ca('0x4b')][_0x40ca('0x24')]);_0x18aa4d['query']=_['keys'](_0x176447[_0x40ca('0x27')]);_0x18aa4d[_0x40ca('0x28')]=_[_0x40ca('0x2a')](_0x18aa4d[_0x40ca('0x29')],_0x18aa4d['query']);_0x313b5d[_0x40ca('0x40')]=_[_0x40ca('0x2a')](_0x18aa4d[_0x40ca('0x29')],qs[_0x40ca('0x2b')](_0x176447['query']['fields']));_0x313b5d[_0x40ca('0x40')]=_0x313b5d['attributes'][_0x40ca('0x2c')]?_0x313b5d[_0x40ca('0x40')]:_0x18aa4d[_0x40ca('0x29')];_0x313b5d[_0x40ca('0x48')]=qs[_0x40ca('0x30')](_0x176447[_0x40ca('0x27')][_0x40ca('0x30')]);_0x313b5d[_0x40ca('0x31')]=qs[_0x40ca('0x28')](_[_0x40ca('0x32')](_0x176447[_0x40ca('0x27')],_0x18aa4d[_0x40ca('0x28')]));if(_0x176447[_0x40ca('0x27')][_0x40ca('0x33')]){_0x313b5d[_0x40ca('0x31')]=_[_0x40ca('0x34')](_0x313b5d['where'],{'$or':_[_0x40ca('0x35')](_0x313b5d[_0x40ca('0x40')],function(_0x73bdcc){var _0x2d4b71={};_0x2d4b71[_0x73bdcc]={'$like':'%'+_0x176447[_0x40ca('0x27')][_0x40ca('0x33')]+'%'};return _0x2d4b71;})});}_0x313b5d=_['merge']({},_0x313b5d,_0x176447['options']);return _0x51ef53[_0x40ca('0x4a')](_0x313b5d);}})[_0x40ca('0x1e')](function(_0x50f877){if(_0x50f877){_0x3cec86=_0x50f877['length'];if(!_0x176447[_0x40ca('0x27')][_0x40ca('0x2d')](_0x40ca('0x2e'))){_0x313b5d[_0x40ca('0x2f')]=qs[_0x40ca('0x2f')](_0x176447[_0x40ca('0x27')][_0x40ca('0x2f')]);_0x313b5d[_0x40ca('0x1a')]=qs[_0x40ca('0x1a')](_0x176447[_0x40ca('0x27')][_0x40ca('0x1a')]);}return _0x51ef53[_0x40ca('0x4a')](_0x313b5d);}})[_0x40ca('0x1e')](function(_0x506266){if(_0x506266){return _0x506266?{'count':_0x3cec86,'rows':_0x506266}:null;}})[_0x40ca('0x1e')](respondWithResult(_0x1256b4,null))[_0x40ca('0x3c')](handleError(_0x1256b4,null));};exports[_0x40ca('0x4c')]=function(_0x1e2696,_0x59156a,_0x410693){if(_0x1e2696[_0x40ca('0x42')]['id']){delete _0x1e2696[_0x40ca('0x42')]['id'];}return db['FreshdeskConfiguration'][_0x40ca('0x44')]({'where':{'id':_0x1e2696[_0x40ca('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59156a,null))[_0x40ca('0x1e')](function(_0x288b0a){if(_0x288b0a){return _0x288b0a['setTags'](_0x1e2696[_0x40ca('0x42')][_0x40ca('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x59156a,null))[_0x40ca('0x3c')](handleError(_0x59156a,null));}; \ No newline at end of file +var _0xe3e2=['to-csv','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/environment','../../config/license/util','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','body','params','getFields','order','nolimit','getSubjects','findOne','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3e2,0xa4));var _0x2e3e=function(_0x55e9f3,_0x317e19){_0x55e9f3=_0x55e9f3-0x0;var _0x474b6d=_0xe3e2[_0x55e9f3];return _0x474b6d;};'use strict';var emlformat=require(_0x2e3e('0x0'));var rimraf=require(_0x2e3e('0x1'));var zipdir=require(_0x2e3e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e3e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e3e('0x4'));var util=require(_0x2e3e('0x5'));var path=require(_0x2e3e('0x6'));var sox=require(_0x2e3e('0x7'));var csv=require(_0x2e3e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e3e('0x9'));var _=require(_0x2e3e('0xa'));var squel=require(_0x2e3e('0xb'));var crypto=require(_0x2e3e('0xc'));var jsforce=require(_0x2e3e('0xd'));var deskjs=require(_0x2e3e('0xe'));var toCsv=require(_0x2e3e('0x8'));var querystring=require(_0x2e3e('0xf'));var Papa=require(_0x2e3e('0x10'));var Redis=require('ioredis');var authService=require(_0x2e3e('0x11'));var qs=require(_0x2e3e('0x12'));var as=require(_0x2e3e('0x13'));var hardwareService=require(_0x2e3e('0x14'));var logger=require(_0x2e3e('0x15'))(_0x2e3e('0x16'));var utils=require(_0x2e3e('0x17'));var config=require(_0x2e3e('0x18'));var licenseUtil=require(_0x2e3e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6e96,_0x41980b){_0x41980b=_0x41980b||0xcc;return function(_0x29f2aa){if(_0x29f2aa){return _0x5a6e96['sendStatus'](_0x41980b);}return _0x5a6e96['status'](_0x41980b)['end']();};}function respondWithResult(_0x4175a9,_0x4c8747){_0x4c8747=_0x4c8747||0xc8;return function(_0x4b0c22){if(_0x4b0c22){return _0x4175a9[_0x2e3e('0x1a')](_0x4c8747)['json'](_0x4b0c22);}};}function respondWithFilteredResult(_0x152257,_0x1c3f19){return function(_0x2b05fe){if(_0x2b05fe){var _0x4442f0=typeof _0x1c3f19[_0x2e3e('0x1b')]==='undefined'&&typeof _0x1c3f19[_0x2e3e('0x1c')]===_0x2e3e('0x1d');var _0x510dd0=_0x2b05fe[_0x2e3e('0x1e')];var _0x55e5ac=_0x4442f0?0x0:_0x1c3f19['offset'];var _0x3cfbeb=_0x4442f0?_0x2b05fe[_0x2e3e('0x1e')]:_0x1c3f19[_0x2e3e('0x1b')]+_0x1c3f19['limit'];var _0xa0febc;if(_0x3cfbeb>=_0x510dd0){_0x3cfbeb=_0x510dd0;_0xa0febc=0xc8;}else{_0xa0febc=0xce;}_0x152257['status'](_0xa0febc);return _0x152257[_0x2e3e('0x1f')](_0x2e3e('0x20'),_0x55e5ac+'-'+_0x3cfbeb+'/'+_0x510dd0)[_0x2e3e('0x21')](_0x2b05fe);}return null;};}function patchUpdates(_0x6fed32){return function(_0x388566){try{jsonpatch[_0x2e3e('0x22')](_0x388566,_0x6fed32,!![]);}catch(_0x59fe94){return BPromise[_0x2e3e('0x23')](_0x59fe94);}return _0x388566[_0x2e3e('0x24')]();};}function saveUpdates(_0x382b33,_0xc567b){return function(_0x4005fd){if(_0x4005fd){return _0x4005fd[_0x2e3e('0x25')](_0x382b33)[_0x2e3e('0x26')](function(_0x26c693){return _0x26c693;});}return null;};}function removeEntity(_0x356e6f,_0x344d89){return function(_0x4748af){if(_0x4748af){return _0x4748af[_0x2e3e('0x27')]()[_0x2e3e('0x26')](function(){_0x356e6f[_0x2e3e('0x1a')](0xcc)[_0x2e3e('0x28')]();});}};}function handleEntityNotFound(_0x5703f6,_0x41b6de){return function(_0x447831){if(!_0x447831){_0x5703f6['sendStatus'](0x194);}return _0x447831;};}function handleError(_0x25e600,_0x47ec5e){_0x47ec5e=_0x47ec5e||0x1f4;return function(_0xc35e9e){logger[_0x2e3e('0x29')](_0xc35e9e[_0x2e3e('0x2a')]);if(_0xc35e9e['name']){delete _0xc35e9e[_0x2e3e('0x2b')];}_0x25e600[_0x2e3e('0x1a')](_0x47ec5e)['send'](_0xc35e9e);};}exports[_0x2e3e('0x2c')]=function(_0xd37cb1,_0x4e2162){var _0x109552={},_0x3335e5={},_0x2552f6={'count':0x0,'rows':[]};var _0x4814ae=_['map'](db[_0x2e3e('0x2d')][_0x2e3e('0x2e')],function(_0x1124cf){return{'name':_0x1124cf[_0x2e3e('0x2f')],'type':_0x1124cf[_0x2e3e('0x30')][_0x2e3e('0x31')]};});_0x3335e5['model']=_[_0x2e3e('0x32')](_0x4814ae,_0x2e3e('0x2b'));_0x3335e5[_0x2e3e('0x33')]=_[_0x2e3e('0x34')](_0xd37cb1[_0x2e3e('0x33')]);_0x3335e5['filters']=_['intersection'](_0x3335e5[_0x2e3e('0x35')],_0x3335e5[_0x2e3e('0x33')]);_0x109552['attributes']=_[_0x2e3e('0x36')](_0x3335e5['model'],qs['fields'](_0xd37cb1['query'][_0x2e3e('0x37')]));_0x109552[_0x2e3e('0x38')]=_0x109552[_0x2e3e('0x38')][_0x2e3e('0x39')]?_0x109552['attributes']:_0x3335e5[_0x2e3e('0x35')];if(!_0xd37cb1['query'][_0x2e3e('0x3a')]('nolimit')){_0x109552['limit']=qs[_0x2e3e('0x1c')](_0xd37cb1[_0x2e3e('0x33')][_0x2e3e('0x1c')]);_0x109552[_0x2e3e('0x1b')]=qs[_0x2e3e('0x1b')](_0xd37cb1[_0x2e3e('0x33')]['offset']);}_0x109552['order']=qs[_0x2e3e('0x3b')](_0xd37cb1[_0x2e3e('0x33')][_0x2e3e('0x3b')]);_0x109552[_0x2e3e('0x3c')]=qs[_0x2e3e('0x3d')](_[_0x2e3e('0x3e')](_0xd37cb1[_0x2e3e('0x33')],_0x3335e5['filters']),_0x4814ae);if(_0xd37cb1[_0x2e3e('0x33')][_0x2e3e('0x3f')]){_0x109552[_0x2e3e('0x3c')]=_[_0x2e3e('0x40')](_0x109552['where'],{'$or':_[_0x2e3e('0x32')](_0x4814ae,function(_0xe9c817){if(_0xe9c817[_0x2e3e('0x30')]!==_0x2e3e('0x41')){var _0x30982c={};_0x30982c[_0xe9c817[_0x2e3e('0x2b')]]={'$like':'%'+_0xd37cb1['query'][_0x2e3e('0x3f')]+'%'};return _0x30982c;}})});}_0x109552=_[_0x2e3e('0x40')]({},_0x109552,_0xd37cb1[_0x2e3e('0x42')]);var _0x468733={'where':_0x109552['where']};return db['FreshdeskConfiguration'][_0x2e3e('0x1e')](_0x468733)[_0x2e3e('0x26')](function(_0x3db5e){_0x2552f6[_0x2e3e('0x1e')]=_0x3db5e;if(_0xd37cb1[_0x2e3e('0x33')][_0x2e3e('0x43')]){_0x109552[_0x2e3e('0x44')]=[{'all':!![]}];}return db[_0x2e3e('0x2d')][_0x2e3e('0x45')](_0x109552);})[_0x2e3e('0x26')](function(_0x4e43c0){_0x2552f6['rows']=_0x4e43c0;return _0x2552f6;})[_0x2e3e('0x26')](respondWithFilteredResult(_0x4e2162,_0x109552))['catch'](handleError(_0x4e2162,null));};exports[_0x2e3e('0x46')]=function(_0x5e80a9,_0x227c66){var _0x380275={'raw':![],'where':{'id':_0x5e80a9['params']['id']}},_0x431df3={};_0x431df3['model']=_[_0x2e3e('0x34')](db[_0x2e3e('0x2d')]['rawAttributes']);_0x431df3[_0x2e3e('0x33')]=_[_0x2e3e('0x34')](_0x5e80a9[_0x2e3e('0x33')]);_0x431df3[_0x2e3e('0x3d')]=_['intersection'](_0x431df3[_0x2e3e('0x35')],_0x431df3[_0x2e3e('0x33')]);_0x380275['attributes']=_[_0x2e3e('0x36')](_0x431df3['model'],qs['fields'](_0x5e80a9[_0x2e3e('0x33')]['fields']));_0x380275[_0x2e3e('0x38')]=_0x380275[_0x2e3e('0x38')][_0x2e3e('0x39')]?_0x380275[_0x2e3e('0x38')]:_0x431df3['model'];if(_0x5e80a9[_0x2e3e('0x33')]['includeAll']){_0x380275[_0x2e3e('0x44')]=[{'all':!![]}];}_0x380275=_[_0x2e3e('0x40')]({},_0x380275,_0x5e80a9[_0x2e3e('0x42')]);return db[_0x2e3e('0x2d')][_0x2e3e('0x47')](_0x380275)[_0x2e3e('0x26')](handleEntityNotFound(_0x227c66,null))[_0x2e3e('0x26')](respondWithResult(_0x227c66,null))[_0x2e3e('0x48')](handleError(_0x227c66,null));};exports[_0x2e3e('0x49')]=function(_0x1b5fcd,_0x573c74){return db[_0x2e3e('0x2d')]['create'](_0x1b5fcd[_0x2e3e('0x4a')],{})['then'](respondWithResult(_0x573c74,0xc9))[_0x2e3e('0x48')](handleError(_0x573c74,null));};exports[_0x2e3e('0x25')]=function(_0x5e9c9e,_0x30fb61){if(_0x5e9c9e[_0x2e3e('0x4a')]['id']){delete _0x5e9c9e[_0x2e3e('0x4a')]['id'];}return db[_0x2e3e('0x2d')]['find']({'where':{'id':_0x5e9c9e[_0x2e3e('0x4b')]['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0x30fb61,null))[_0x2e3e('0x26')](saveUpdates(_0x5e9c9e[_0x2e3e('0x4a')],null))[_0x2e3e('0x26')](respondWithResult(_0x30fb61,null))['catch'](handleError(_0x30fb61,null));};exports[_0x2e3e('0x27')]=function(_0x2c94e0,_0xc99d18){return db['FreshdeskConfiguration'][_0x2e3e('0x47')]({'where':{'id':_0x2c94e0['params']['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0xc99d18,null))[_0x2e3e('0x26')](removeEntity(_0xc99d18,null))[_0x2e3e('0x48')](handleError(_0xc99d18,null));};exports[_0x2e3e('0x4c')]=function(_0x457405,_0x3ead0f,_0xd8328b){var _0x2d340a={};var _0x4297fa={};var _0x394098;var _0x3ee9b7;return db[_0x2e3e('0x2d')]['findOne']({'where':{'id':_0x457405[_0x2e3e('0x4b')]['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0x3ead0f,null))[_0x2e3e('0x26')](function(_0x28a498){if(_0x28a498){_0x394098=_0x28a498;_0x4297fa[_0x2e3e('0x35')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x4297fa[_0x2e3e('0x33')]=_[_0x2e3e('0x34')](_0x457405['query']);_0x4297fa[_0x2e3e('0x3d')]=_[_0x2e3e('0x36')](_0x4297fa[_0x2e3e('0x35')],_0x4297fa[_0x2e3e('0x33')]);_0x2d340a[_0x2e3e('0x38')]=_[_0x2e3e('0x36')](_0x4297fa[_0x2e3e('0x35')],qs['fields'](_0x457405[_0x2e3e('0x33')][_0x2e3e('0x37')]));_0x2d340a[_0x2e3e('0x38')]=_0x2d340a['attributes']['length']?_0x2d340a[_0x2e3e('0x38')]:_0x4297fa[_0x2e3e('0x35')];_0x2d340a[_0x2e3e('0x4d')]=qs['sort'](_0x457405[_0x2e3e('0x33')][_0x2e3e('0x3b')]);_0x2d340a['where']=qs['filters'](_[_0x2e3e('0x3e')](_0x457405[_0x2e3e('0x33')],_0x4297fa[_0x2e3e('0x3d')]));if(_0x457405[_0x2e3e('0x33')][_0x2e3e('0x3f')]){_0x2d340a[_0x2e3e('0x3c')]=_[_0x2e3e('0x40')](_0x2d340a[_0x2e3e('0x3c')],{'$or':_[_0x2e3e('0x32')](_0x2d340a[_0x2e3e('0x38')],function(_0x169b9f){var _0x1f1607={};_0x1f1607[_0x169b9f]={'$like':'%'+_0x457405[_0x2e3e('0x33')][_0x2e3e('0x3f')]+'%'};return _0x1f1607;})});}_0x2d340a=_[_0x2e3e('0x40')]({},_0x2d340a,_0x457405[_0x2e3e('0x42')]);return _0x394098[_0x2e3e('0x4c')](_0x2d340a);}})['then'](function(_0x1b5a6f){if(_0x1b5a6f){_0x3ee9b7=_0x1b5a6f[_0x2e3e('0x39')];if(!_0x457405[_0x2e3e('0x33')][_0x2e3e('0x3a')](_0x2e3e('0x4e'))){_0x2d340a[_0x2e3e('0x1c')]=qs[_0x2e3e('0x1c')](_0x457405[_0x2e3e('0x33')]['limit']);_0x2d340a[_0x2e3e('0x1b')]=qs[_0x2e3e('0x1b')](_0x457405[_0x2e3e('0x33')][_0x2e3e('0x1b')]);}return _0x394098[_0x2e3e('0x4c')](_0x2d340a);}})[_0x2e3e('0x26')](function(_0x2a27f3){if(_0x2a27f3){return _0x2a27f3?{'count':_0x3ee9b7,'rows':_0x2a27f3}:null;}})['then'](respondWithResult(_0x3ead0f,null))[_0x2e3e('0x48')](handleError(_0x3ead0f,null));};exports[_0x2e3e('0x4f')]=function(_0x20d01f,_0x21da8a,_0x2731d3){var _0x53310f={};var _0x7b300c={};var _0x48b09f;var _0x5920ec;return db['FreshdeskConfiguration'][_0x2e3e('0x50')]({'where':{'id':_0x20d01f[_0x2e3e('0x4b')]['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0x21da8a,null))[_0x2e3e('0x26')](function(_0x2a5955){if(_0x2a5955){_0x48b09f=_0x2a5955;_0x7b300c[_0x2e3e('0x35')]=_[_0x2e3e('0x34')](db[_0x2e3e('0x51')]['rawAttributes']);_0x7b300c[_0x2e3e('0x33')]=_[_0x2e3e('0x34')](_0x20d01f[_0x2e3e('0x33')]);_0x7b300c[_0x2e3e('0x3d')]=_[_0x2e3e('0x36')](_0x7b300c[_0x2e3e('0x35')],_0x7b300c[_0x2e3e('0x33')]);_0x53310f[_0x2e3e('0x38')]=_[_0x2e3e('0x36')](_0x7b300c[_0x2e3e('0x35')],qs['fields'](_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x37')]));_0x53310f[_0x2e3e('0x38')]=_0x53310f[_0x2e3e('0x38')][_0x2e3e('0x39')]?_0x53310f[_0x2e3e('0x38')]:_0x7b300c[_0x2e3e('0x35')];_0x53310f['order']=qs[_0x2e3e('0x3b')](_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x3b')]);_0x53310f[_0x2e3e('0x3c')]=qs[_0x2e3e('0x3d')](_['pick'](_0x20d01f[_0x2e3e('0x33')],_0x7b300c['filters']));if(_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x3f')]){_0x53310f[_0x2e3e('0x3c')]=_['merge'](_0x53310f[_0x2e3e('0x3c')],{'$or':_[_0x2e3e('0x32')](_0x53310f[_0x2e3e('0x38')],function(_0x24cf74){var _0xc5152c={};_0xc5152c[_0x24cf74]={'$like':'%'+_0x20d01f['query'][_0x2e3e('0x3f')]+'%'};return _0xc5152c;})});}_0x53310f=_[_0x2e3e('0x40')]({},_0x53310f,_0x20d01f[_0x2e3e('0x42')]);return _0x48b09f[_0x2e3e('0x4f')](_0x53310f);}})['then'](function(_0x3898ef){if(_0x3898ef){_0x5920ec=_0x3898ef[_0x2e3e('0x39')];if(!_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x3a')](_0x2e3e('0x4e'))){_0x53310f[_0x2e3e('0x1c')]=qs['limit'](_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x1c')]);_0x53310f[_0x2e3e('0x1b')]=qs[_0x2e3e('0x1b')](_0x20d01f[_0x2e3e('0x33')][_0x2e3e('0x1b')]);}return _0x48b09f[_0x2e3e('0x4f')](_0x53310f);}})['then'](function(_0x49c760){if(_0x49c760){return _0x49c760?{'count':_0x5920ec,'rows':_0x49c760}:null;}})[_0x2e3e('0x26')](respondWithResult(_0x21da8a,null))[_0x2e3e('0x48')](handleError(_0x21da8a,null));};exports[_0x2e3e('0x52')]=function(_0x301e88,_0x12bd26,_0x5ab622){var _0x35d78e={};var _0x1e20cf={};var _0x3ee215;var _0x79bb57;return db[_0x2e3e('0x2d')][_0x2e3e('0x50')]({'where':{'id':_0x301e88[_0x2e3e('0x4b')]['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0x12bd26,null))[_0x2e3e('0x26')](function(_0x3581f6){if(_0x3581f6){_0x3ee215=_0x3581f6;_0x1e20cf[_0x2e3e('0x35')]=_['keys'](db[_0x2e3e('0x51')]['rawAttributes']);_0x1e20cf[_0x2e3e('0x33')]=_['keys'](_0x301e88['query']);_0x1e20cf[_0x2e3e('0x3d')]=_[_0x2e3e('0x36')](_0x1e20cf[_0x2e3e('0x35')],_0x1e20cf[_0x2e3e('0x33')]);_0x35d78e[_0x2e3e('0x38')]=_[_0x2e3e('0x36')](_0x1e20cf[_0x2e3e('0x35')],qs['fields'](_0x301e88[_0x2e3e('0x33')][_0x2e3e('0x37')]));_0x35d78e['attributes']=_0x35d78e[_0x2e3e('0x38')]['length']?_0x35d78e['attributes']:_0x1e20cf[_0x2e3e('0x35')];_0x35d78e['order']=qs['sort'](_0x301e88[_0x2e3e('0x33')][_0x2e3e('0x3b')]);_0x35d78e[_0x2e3e('0x3c')]=qs[_0x2e3e('0x3d')](_['pick'](_0x301e88['query'],_0x1e20cf[_0x2e3e('0x3d')]));if(_0x301e88[_0x2e3e('0x33')][_0x2e3e('0x3f')]){_0x35d78e[_0x2e3e('0x3c')]=_['merge'](_0x35d78e[_0x2e3e('0x3c')],{'$or':_[_0x2e3e('0x32')](_0x35d78e[_0x2e3e('0x38')],function(_0x1480d3){var _0x125bb9={};_0x125bb9[_0x1480d3]={'$like':'%'+_0x301e88['query'][_0x2e3e('0x3f')]+'%'};return _0x125bb9;})});}_0x35d78e=_['merge']({},_0x35d78e,_0x301e88[_0x2e3e('0x42')]);return _0x3ee215['getDescriptions'](_0x35d78e);}})[_0x2e3e('0x26')](function(_0x585d71){if(_0x585d71){_0x79bb57=_0x585d71['length'];if(!_0x301e88[_0x2e3e('0x33')][_0x2e3e('0x3a')](_0x2e3e('0x4e'))){_0x35d78e[_0x2e3e('0x1c')]=qs[_0x2e3e('0x1c')](_0x301e88['query'][_0x2e3e('0x1c')]);_0x35d78e[_0x2e3e('0x1b')]=qs[_0x2e3e('0x1b')](_0x301e88['query'][_0x2e3e('0x1b')]);}return _0x3ee215['getDescriptions'](_0x35d78e);}})['then'](function(_0x2d77c8){if(_0x2d77c8){return _0x2d77c8?{'count':_0x79bb57,'rows':_0x2d77c8}:null;}})[_0x2e3e('0x26')](respondWithResult(_0x12bd26,null))[_0x2e3e('0x48')](handleError(_0x12bd26,null));};exports[_0x2e3e('0x53')]=function(_0xfc8125,_0x31e019,_0x892389){var _0x38ecfe={};var _0x1dbf2e={};var _0x52534f;var _0x172baf;return db[_0x2e3e('0x2d')][_0x2e3e('0x50')]({'where':{'id':_0xfc8125[_0x2e3e('0x4b')]['id']}})[_0x2e3e('0x26')](handleEntityNotFound(_0x31e019,null))[_0x2e3e('0x26')](function(_0x209f68){if(_0x209f68){_0x52534f=_0x209f68;_0x1dbf2e[_0x2e3e('0x35')]=_['keys'](db[_0x2e3e('0x54')][_0x2e3e('0x2e')]);_0x1dbf2e['query']=_[_0x2e3e('0x34')](_0xfc8125['query']);_0x1dbf2e[_0x2e3e('0x3d')]=_[_0x2e3e('0x36')](_0x1dbf2e[_0x2e3e('0x35')],_0x1dbf2e[_0x2e3e('0x33')]);_0x38ecfe[_0x2e3e('0x38')]=_[_0x2e3e('0x36')](_0x1dbf2e[_0x2e3e('0x35')],qs[_0x2e3e('0x37')](_0xfc8125[_0x2e3e('0x33')][_0x2e3e('0x37')]));_0x38ecfe[_0x2e3e('0x38')]=_0x38ecfe[_0x2e3e('0x38')][_0x2e3e('0x39')]?_0x38ecfe[_0x2e3e('0x38')]:_0x1dbf2e[_0x2e3e('0x35')];_0x38ecfe[_0x2e3e('0x4d')]=qs[_0x2e3e('0x3b')](_0xfc8125[_0x2e3e('0x33')][_0x2e3e('0x3b')]);_0x38ecfe[_0x2e3e('0x3c')]=qs['filters'](_['pick'](_0xfc8125[_0x2e3e('0x33')],_0x1dbf2e[_0x2e3e('0x3d')]));if(_0xfc8125[_0x2e3e('0x33')][_0x2e3e('0x3f')]){_0x38ecfe[_0x2e3e('0x3c')]=_['merge'](_0x38ecfe[_0x2e3e('0x3c')],{'$or':_[_0x2e3e('0x32')](_0x38ecfe[_0x2e3e('0x38')],function(_0x4bc004){var _0x41a16c={};_0x41a16c[_0x4bc004]={'$like':'%'+_0xfc8125[_0x2e3e('0x33')]['filter']+'%'};return _0x41a16c;})});}_0x38ecfe=_[_0x2e3e('0x40')]({},_0x38ecfe,_0xfc8125['options']);return _0x52534f[_0x2e3e('0x53')](_0x38ecfe);}})['then'](function(_0x3aae64){if(_0x3aae64){_0x172baf=_0x3aae64[_0x2e3e('0x39')];if(!_0xfc8125[_0x2e3e('0x33')][_0x2e3e('0x3a')](_0x2e3e('0x4e'))){_0x38ecfe['limit']=qs[_0x2e3e('0x1c')](_0xfc8125[_0x2e3e('0x33')][_0x2e3e('0x1c')]);_0x38ecfe[_0x2e3e('0x1b')]=qs['offset'](_0xfc8125[_0x2e3e('0x33')]['offset']);}return _0x52534f['getTags'](_0x38ecfe);}})['then'](function(_0x5a3b19){if(_0x5a3b19){return _0x5a3b19?{'count':_0x172baf,'rows':_0x5a3b19}:null;}})[_0x2e3e('0x26')](respondWithResult(_0x31e019,null))[_0x2e3e('0x48')](handleError(_0x31e019,null));};exports[_0x2e3e('0x55')]=function(_0x48c1e3,_0x50032e,_0x29980b){if(_0x48c1e3['body']['id']){delete _0x48c1e3[_0x2e3e('0x4a')]['id'];}return db[_0x2e3e('0x2d')][_0x2e3e('0x50')]({'where':{'id':_0x48c1e3[_0x2e3e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50032e,null))[_0x2e3e('0x26')](function(_0x2bb3f8){if(_0x2bb3f8){return _0x2bb3f8[_0x2e3e('0x55')](_0x48c1e3['body']['ids']||[]);}return null;})[_0x2e3e('0x26')](respondWithResult(_0x50032e,null))[_0x2e3e('0x48')](handleError(_0x50032e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index eb1b84e..27d6ba5 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 _0x3f47=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','rimraf'];(function(_0x1b3a53,_0x7ff46){var _0x3edd9a=function(_0x16a83f){while(--_0x16a83f){_0x1b3a53['push'](_0x1b3a53['shift']());}};_0x3edd9a(++_0x7ff46);}(_0x3f47,0x109));var _0x73f4=function(_0x28d8ee,_0x5869c7){_0x28d8ee=_0x28d8ee-0x0;var _0x51b217=_0x3f47[_0x28d8ee];return _0x51b217;};'use strict';var _=require(_0x73f4('0x0'));var util=require('util');var logger=require(_0x73f4('0x1'))('api');var moment=require(_0x73f4('0x2'));var BPromise=require(_0x73f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x73f4('0x4'));var config=require(_0x73f4('0x5'));var attributes=require(_0x73f4('0x6'));module[_0x73f4('0x7')]=function(_0x5e6dd0,_0x177ebd){return _0x5e6dd0[_0x73f4('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0x73f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0757=['FreshdeskConfiguration','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x5a20d5,_0x33a069){var _0x104307=function(_0x35606a){while(--_0x35606a){_0x5a20d5['push'](_0x5a20d5['shift']());}};_0x104307(++_0x33a069);}(_0x0757,0x12d));var _0x7075=function(_0x596053,_0x1a9efd){_0x596053=_0x596053-0x0;var _0x1fb180=_0x0757[_0x596053];return _0x1fb180;};'use strict';var _=require('lodash');var util=require(_0x7075('0x0'));var logger=require(_0x7075('0x1'))(_0x7075('0x2'));var moment=require(_0x7075('0x3'));var BPromise=require('bluebird');var rp=require(_0x7075('0x4'));var fs=require('fs');var path=require(_0x7075('0x5'));var rimraf=require(_0x7075('0x6'));var config=require(_0x7075('0x7'));var attributes=require(_0x7075('0x8'));module[_0x7075('0x9')]=function(_0x4a3b48,_0x1cd97d){return _0x4a3b48[_0x7075('0xa')](_0x7075('0xb'),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 0d2b905..edc2192 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 _0x3aca=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3aca,0xe6));var _0xa3ac=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x3aca[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0xa3ac('0x0'));var util=require('util');var moment=require(_0xa3ac('0x1'));var BPromise=require(_0xa3ac('0x2'));var rs=require(_0xa3ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3ac('0x4'))['db'];var utils=require(_0xa3ac('0x5'));var logger=require(_0xa3ac('0x6'))(_0xa3ac('0x7'));var config=require(_0xa3ac('0x8'));var jayson=require(_0xa3ac('0x9'));var client=jayson[_0xa3ac('0xa')][_0xa3ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fcbab,_0x252a22,_0x5366d9){return new BPromise(function(_0x84a4e3,_0x580f63){return client['request'](_0x1fcbab,_0x5366d9)['then'](function(_0x31c69f){logger[_0xa3ac('0xc')](_0xa3ac('0xd'),_0x252a22,_0xa3ac('0xe'));logger[_0xa3ac('0xf')](_0xa3ac('0x10'),_0x252a22,_0xa3ac('0xe'),JSON[_0xa3ac('0x11')](_0x31c69f));if(_0x31c69f['error']){if(_0x31c69f['error'][_0xa3ac('0x12')]===0x1f4){logger[_0xa3ac('0x13')](_0xa3ac('0xd'),_0x252a22,_0x31c69f[_0xa3ac('0x13')][_0xa3ac('0x14')]);return _0x580f63(_0x31c69f[_0xa3ac('0x13')][_0xa3ac('0x14')]);}logger[_0xa3ac('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x252a22,_0x31c69f[_0xa3ac('0x13')]['message']);return _0x84a4e3(_0x31c69f['error'][_0xa3ac('0x14')]);}else{logger[_0xa3ac('0xc')](_0xa3ac('0xd'),_0x252a22,_0xa3ac('0xe'));_0x84a4e3(_0x31c69f[_0xa3ac('0x15')]['message']);}})[_0xa3ac('0x16')](function(_0x18ee16){logger[_0xa3ac('0x13')](_0xa3ac('0xd'),_0x252a22,_0x18ee16);_0x580f63(_0x18ee16);});});} \ No newline at end of file +var _0x3d14=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../mysqldb'];(function(_0x141c5c,_0x3e7a04){var _0x696596=function(_0x525a68){while(--_0x525a68){_0x141c5c['push'](_0x141c5c['shift']());}};_0x696596(++_0x3e7a04);}(_0x3d14,0x140));var _0x43d1=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x3d14[_0x13c70c];return _0x50f0f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43d1('0x0'));var BPromise=require('bluebird');var rs=require(_0x43d1('0x1'));var fs=require('fs');var Redis=require(_0x43d1('0x2'));var db=require(_0x43d1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x43d1('0x4'))(_0x43d1('0x5'));var config=require(_0x43d1('0x6'));var jayson=require(_0x43d1('0x7'));var client=jayson[_0x43d1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dcf46,_0x160a71,_0x23c575){return new BPromise(function(_0x884cc0,_0xe22775){return client[_0x43d1('0x9')](_0x3dcf46,_0x23c575)['then'](function(_0x2cd058){logger[_0x43d1('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x160a71,_0x43d1('0xb'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x160a71,_0x43d1('0xb'),JSON[_0x43d1('0xc')](_0x2cd058));if(_0x2cd058[_0x43d1('0xd')]){if(_0x2cd058['error'][_0x43d1('0xe')]===0x1f4){logger['error'](_0x43d1('0xf'),_0x160a71,_0x2cd058[_0x43d1('0xd')]['message']);return _0xe22775(_0x2cd058['error']['message']);}logger[_0x43d1('0xd')](_0x43d1('0xf'),_0x160a71,_0x2cd058['error'][_0x43d1('0x10')]);return _0x884cc0(_0x2cd058['error'][_0x43d1('0x10')]);}else{logger[_0x43d1('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x160a71,_0x43d1('0xb'));_0x884cc0(_0x2cd058[_0x43d1('0x11')]['message']);}})['catch'](function(_0x354b01){logger['error'](_0x43d1('0xf'),_0x160a71,_0x354b01);_0xe22775(_0x354b01);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d1b3056..ec6b921 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 _0xfa6f=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','index','/:id','show','post','create','put','delete','isAuthenticated','destroy'];(function(_0x5ed3b5,_0x43e211){var _0x477dc2=function(_0x192d00){while(--_0x192d00){_0x5ed3b5['push'](_0x5ed3b5['shift']());}};_0x477dc2(++_0x43e211);}(_0xfa6f,0x1c9));var _0xffa6=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xfa6f[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0xffa6('0x0'));var util=require(_0xffa6('0x1'));var path=require('path');var timeout=require(_0xffa6('0x2'));var express=require(_0xffa6('0x3'));var router=express[_0xffa6('0x4')]();var fs_extra=require(_0xffa6('0x5'));var auth=require(_0xffa6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xffa6('0x7'));router[_0xffa6('0x8')]('/',auth['isAuthenticated'](),controller[_0xffa6('0x9')]);router[_0xffa6('0x8')](_0xffa6('0xa'),auth['isAuthenticated'](),controller[_0xffa6('0xb')]);router[_0xffa6('0xc')]('/',auth['isAuthenticated'](),controller[_0xffa6('0xd')]);router[_0xffa6('0xe')](_0xffa6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xffa6('0xf')](_0xffa6('0xa'),auth[_0xffa6('0x10')](),controller[_0xffa6('0x11')]);module[_0xffa6('0x12')]=router; \ No newline at end of file +var _0xc5d7=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x46261b,_0xd68542){var _0x31e36f=function(_0xf5ed2b){while(--_0xf5ed2b){_0x46261b['push'](_0x46261b['shift']());}};_0x31e36f(++_0xd68542);}(_0xc5d7,0x10f));var _0x7c5d=function(_0x3f0eb6,_0xfedefb){_0x3f0eb6=_0x3f0eb6-0x0;var _0x519964=_0xc5d7[_0x3f0eb6];return _0x519964;};'use strict';var multer=require(_0x7c5d('0x0'));var util=require(_0x7c5d('0x1'));var path=require(_0x7c5d('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c5d('0x3'));var router=express[_0x7c5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c5d('0x5'));var interaction=require(_0x7c5d('0x6'));var config=require('../../config/environment');var controller=require(_0x7c5d('0x7'));router[_0x7c5d('0x8')]('/',auth[_0x7c5d('0x9')](),controller[_0x7c5d('0xa')]);router['get'](_0x7c5d('0xb'),auth[_0x7c5d('0x9')](),controller[_0x7c5d('0xc')]);router['post']('/',auth[_0x7c5d('0x9')](),controller[_0x7c5d('0xd')]);router[_0x7c5d('0xe')](_0x7c5d('0xb'),auth['isAuthenticated'](),controller[_0x7c5d('0xf')]);router[_0x7c5d('0x10')]('/:id',auth[_0x7c5d('0x9')](),controller[_0x7c5d('0x11')]);module[_0x7c5d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index f11eabd..199b5b2 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 _0xa088=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','variable','STRING'];(function(_0x5830db,_0x5a3fd6){var _0x438b32=function(_0x1b948c){while(--_0x1b948c){_0x5830db['push'](_0x5830db['shift']());}};_0x438b32(++_0x5a3fd6);}(_0xa088,0x145));var _0x8a08=function(_0x7b5a6d,_0x1e8af7){_0x7b5a6d=_0x7b5a6d-0x0;var _0x46ae40=_0xa088[_0x7b5a6d];return _0x46ae40;};'use strict';var Sequelize=require(_0x8a08('0x0'));module[_0x8a08('0x1')]={'type':{'type':Sequelize[_0x8a08('0x2')](_0x8a08('0x3'),'variable',_0x8a08('0x4'),_0x8a08('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8a08('0x2')](_0x8a08('0x3'),_0x8a08('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x8a08('0x7')]},'idField':{'type':Sequelize[_0x8a08('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8a08('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a08('0x7')]}}; \ No newline at end of file +var _0xb648=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0xebf4a2,_0x31dc8d){var _0x57ed03=function(_0x581de5){while(--_0x581de5){_0xebf4a2['push'](_0xebf4a2['shift']());}};_0x57ed03(++_0x31dc8d);}(_0xb648,0x124));var _0x8b64=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0xb648[_0x3d8ca8];return _0x517e45;};'use strict';var Sequelize=require(_0x8b64('0x0'));module[_0x8b64('0x1')]={'type':{'type':Sequelize[_0x8b64('0x2')](_0x8b64('0x3'),_0x8b64('0x4'),_0x8b64('0x5'),_0x8b64('0x6'),_0x8b64('0x7')),'defaultValue':_0x8b64('0x3')},'content':{'type':Sequelize[_0x8b64('0x8')]},'key':{'type':Sequelize[_0x8b64('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8b64('0x4'),_0x8b64('0x5'))},'keyContent':{'type':Sequelize[_0x8b64('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8b64('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b64('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index d79c29a..29a2588 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 _0x6308=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util'];(function(_0xf443fb,_0x486026){var _0x1174e5=function(_0x37174e){while(--_0x37174e){_0xf443fb['push'](_0xf443fb['shift']());}};_0x1174e5(++_0x486026);}(_0x6308,0x1f2));var _0x8630=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x6308[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={},_0xbb1a58={},_0x190216={'count':0x0,'rows':[]};var _0x2d3f0b=_['map'](db[_0x8630('0x29')][_0x8630('0x2a')],function(_0x24d85d){return{'name':_0x24d85d[_0x8630('0x2b')],'type':_0x24d85d['type'][_0x8630('0x2c')]};});_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x2d3f0b,_0x8630('0x26'));_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x31')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],_0xbb1a58['query']);_0x4285ee[_0x8630('0x33')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],qs[_0x8630('0x34')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x34')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x33')][_0x8630('0x35')]?_0x4285ee[_0x8630('0x33')]:_0xbb1a58[_0x8630('0x2d')];if(!_0x41f74c[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0x4285ee[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1d')]);_0x4285ee[_0x8630('0x1c')]=qs[_0x8630('0x1c')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1c')]);}_0x4285ee[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x41f74c['query'][_0x8630('0x39')]);_0x4285ee[_0x8630('0x3a')]=qs['filters'](_['pick'](_0x41f74c[_0x8630('0x2f')],_0xbb1a58[_0x8630('0x31')]),_0x2d3f0b);if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]){_0x4285ee[_0x8630('0x3a')]=_['merge'](_0x4285ee[_0x8630('0x3a')],{'$or':_[_0x8630('0x2e')](_0x2d3f0b,function(_0x38ee10){if(_0x38ee10[_0x8630('0x3c')]!=='VIRTUAL'){var _0xac2876={};_0xac2876[_0x38ee10[_0x8630('0x26')]]={'$like':'%'+_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0xac2876;}})});}_0x4285ee=_[_0x8630('0x3d')]({},_0x4285ee,_0x41f74c[_0x8630('0x3e')]);var _0x2fbb8c={'where':_0x4285ee['where']};return db[_0x8630('0x29')][_0x8630('0x1b')](_0x2fbb8c)[_0x8630('0x22')](function(_0xe3f392){_0x190216[_0x8630('0x1b')]=_0xe3f392;if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3f')]){_0x4285ee[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x29')][_0x8630('0x41')](_0x4285ee);})['then'](function(_0x358431){_0x190216['rows']=_0x358431;return _0x190216;})[_0x8630('0x22')](respondWithFilteredResult(_0xc18164,_0x4285ee))[_0x8630('0x42')](handleError(_0xc18164,null));};exports[_0x8630('0x43')]=function(_0x7c3dc5,_0x193bae){var _0x2f1fec={'raw':!![],'where':{'id':_0x7c3dc5[_0x8630('0x44')]['id']}},_0x5bcf39={};_0x5bcf39[_0x8630('0x2d')]=_[_0x8630('0x30')](db['FreshdeskField'][_0x8630('0x2a')]);_0x5bcf39[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x7c3dc5[_0x8630('0x2f')]);_0x5bcf39[_0x8630('0x31')]=_[_0x8630('0x32')](_0x5bcf39['model'],_0x5bcf39[_0x8630('0x2f')]);_0x2f1fec[_0x8630('0x33')]=_[_0x8630('0x32')](_0x5bcf39['model'],qs[_0x8630('0x34')](_0x7c3dc5[_0x8630('0x2f')]['fields']));_0x2f1fec[_0x8630('0x33')]=_0x2f1fec[_0x8630('0x33')][_0x8630('0x35')]?_0x2f1fec['attributes']:_0x5bcf39['model'];if(_0x7c3dc5[_0x8630('0x2f')]['includeAll']){_0x2f1fec['include']=[{'all':!![]}];}_0x2f1fec=_[_0x8630('0x3d')]({},_0x2f1fec,_0x7c3dc5['options']);return db[_0x8630('0x29')][_0x8630('0x45')](_0x2f1fec)['then'](handleEntityNotFound(_0x193bae,null))[_0x8630('0x22')](respondWithResult(_0x193bae,null))[_0x8630('0x42')](handleError(_0x193bae,null));};exports[_0x8630('0x46')]=function(_0x5d8149,_0x121e83){return db['FreshdeskField'][_0x8630('0x46')](_0x5d8149[_0x8630('0x47')],{})['then'](respondWithResult(_0x121e83,0xc9))[_0x8630('0x42')](handleError(_0x121e83,null));};exports[_0x8630('0x21')]=function(_0x3ff20b,_0x47aa03){if(_0x3ff20b[_0x8630('0x47')]['id']){delete _0x3ff20b[_0x8630('0x47')]['id'];}return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x3ff20b[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x47aa03,null))[_0x8630('0x22')](saveUpdates(_0x3ff20b[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x47aa03,null))['catch'](handleError(_0x47aa03,null));};exports['destroy']=function(_0x1b8328,_0x13326d){return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x1b8328[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x13326d,null))[_0x8630('0x22')](removeEntity(_0x13326d,null))['catch'](handleError(_0x13326d,null));}; \ No newline at end of file +var _0xa699=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','FreshdeskField','includeAll','include','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send'];(function(_0x47aa4f,_0x3e302a){var _0x2908a1=function(_0x37989b){while(--_0x37989b){_0x47aa4f['push'](_0x47aa4f['shift']());}};_0x2908a1(++_0x3e302a);}(_0xa699,0x6b));var _0x9a69=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xa699[_0x1f5143];return _0x383a38;};'use strict';var emlformat=require(_0x9a69('0x0'));var rimraf=require(_0x9a69('0x1'));var zipdir=require(_0x9a69('0x2'));var jsonpatch=require(_0x9a69('0x3'));var rp=require(_0x9a69('0x4'));var moment=require(_0x9a69('0x5'));var BPromise=require(_0x9a69('0x6'));var Mustache=require(_0x9a69('0x7'));var util=require(_0x9a69('0x8'));var path=require(_0x9a69('0x9'));var sox=require(_0x9a69('0xa'));var csv=require(_0x9a69('0xb'));var ejs=require(_0x9a69('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a69('0xd'));var squel=require(_0x9a69('0xe'));var crypto=require(_0x9a69('0xf'));var jsforce=require(_0x9a69('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9a69('0xb'));var querystring=require(_0x9a69('0x11'));var Papa=require(_0x9a69('0x12'));var Redis=require(_0x9a69('0x13'));var authService=require(_0x9a69('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a69('0x15'));var logger=require('../../config/logger')(_0x9a69('0x16'));var utils=require(_0x9a69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x18'));var db=require(_0x9a69('0x19'))['db'];function respondWithStatusCode(_0x56e43f,_0x81dfb1){_0x81dfb1=_0x81dfb1||0xcc;return function(_0x2e613e){if(_0x2e613e){return _0x56e43f[_0x9a69('0x1a')](_0x81dfb1);}return _0x56e43f[_0x9a69('0x1b')](_0x81dfb1)[_0x9a69('0x1c')]();};}function respondWithResult(_0x70475b,_0x34b5b0){_0x34b5b0=_0x34b5b0||0xc8;return function(_0x2a5b83){if(_0x2a5b83){return _0x70475b[_0x9a69('0x1b')](_0x34b5b0)['json'](_0x2a5b83);}};}function respondWithFilteredResult(_0x2323ae,_0x17de41){return function(_0x2be3ec){if(_0x2be3ec){var _0x5e982d=typeof _0x17de41[_0x9a69('0x1d')]===_0x9a69('0x1e')&&typeof _0x17de41[_0x9a69('0x1f')]===_0x9a69('0x1e');var _0xed2c19=_0x2be3ec['count'];var _0x2e4264=_0x5e982d?0x0:_0x17de41[_0x9a69('0x1d')];var _0x186a5a=_0x5e982d?_0x2be3ec[_0x9a69('0x20')]:_0x17de41[_0x9a69('0x1d')]+_0x17de41[_0x9a69('0x1f')];var _0x2633d5;if(_0x186a5a>=_0xed2c19){_0x186a5a=_0xed2c19;_0x2633d5=0xc8;}else{_0x2633d5=0xce;}_0x2323ae[_0x9a69('0x1b')](_0x2633d5);return _0x2323ae[_0x9a69('0x21')](_0x9a69('0x22'),_0x2e4264+'-'+_0x186a5a+'/'+_0xed2c19)['json'](_0x2be3ec);}return null;};}function patchUpdates(_0x4d8db9){return function(_0x5ebb09){try{jsonpatch[_0x9a69('0x23')](_0x5ebb09,_0x4d8db9,!![]);}catch(_0x12ebe5){return BPromise['reject'](_0x12ebe5);}return _0x5ebb09[_0x9a69('0x24')]();};}function saveUpdates(_0x527ca6,_0x265291){return function(_0x4d6a93){if(_0x4d6a93){return _0x4d6a93['update'](_0x527ca6)['then'](function(_0x189989){return _0x189989;});}return null;};}function removeEntity(_0x5f4138,_0x140cbe){return function(_0x28f5f7){if(_0x28f5f7){return _0x28f5f7[_0x9a69('0x25')]()[_0x9a69('0x26')](function(){_0x5f4138['status'](0xcc)[_0x9a69('0x1c')]();});}};}function handleEntityNotFound(_0x5130b2,_0x203d32){return function(_0x4ef126){if(!_0x4ef126){_0x5130b2['sendStatus'](0x194);}return _0x4ef126;};}function handleError(_0xbcdcd9,_0xf6fea2){_0xf6fea2=_0xf6fea2||0x1f4;return function(_0x268cef){logger[_0x9a69('0x27')](_0x268cef[_0x9a69('0x28')]);if(_0x268cef[_0x9a69('0x29')]){delete _0x268cef[_0x9a69('0x29')];}_0xbcdcd9[_0x9a69('0x1b')](_0xf6fea2)[_0x9a69('0x2a')](_0x268cef);};}exports[_0x9a69('0x2b')]=function(_0x47916a,_0x1ff48e){var _0x165a87={},_0x5433b3={},_0x54e643={'count':0x0,'rows':[]};var _0x4b3539=_[_0x9a69('0x2c')](db['FreshdeskField'][_0x9a69('0x2d')],function(_0x2d15e3){return{'name':_0x2d15e3[_0x9a69('0x2e')],'type':_0x2d15e3[_0x9a69('0x2f')][_0x9a69('0x30')]};});_0x5433b3[_0x9a69('0x31')]=_[_0x9a69('0x2c')](_0x4b3539,_0x9a69('0x29'));_0x5433b3[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x47916a[_0x9a69('0x32')]);_0x5433b3[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x5433b3[_0x9a69('0x31')],_0x5433b3[_0x9a69('0x32')]);_0x165a87[_0x9a69('0x36')]=_[_0x9a69('0x35')](_0x5433b3['model'],qs['fields'](_0x47916a[_0x9a69('0x32')][_0x9a69('0x37')]));_0x165a87[_0x9a69('0x36')]=_0x165a87[_0x9a69('0x36')][_0x9a69('0x38')]?_0x165a87['attributes']:_0x5433b3['model'];if(!_0x47916a['query']['hasOwnProperty'](_0x9a69('0x39'))){_0x165a87[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x47916a[_0x9a69('0x32')][_0x9a69('0x1f')]);_0x165a87[_0x9a69('0x1d')]=qs['offset'](_0x47916a['query'][_0x9a69('0x1d')]);}_0x165a87[_0x9a69('0x3a')]=qs[_0x9a69('0x3b')](_0x47916a['query'][_0x9a69('0x3b')]);_0x165a87[_0x9a69('0x3c')]=qs[_0x9a69('0x34')](_[_0x9a69('0x3d')](_0x47916a[_0x9a69('0x32')],_0x5433b3[_0x9a69('0x34')]),_0x4b3539);if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]){_0x165a87[_0x9a69('0x3c')]=_[_0x9a69('0x3f')](_0x165a87[_0x9a69('0x3c')],{'$or':_['map'](_0x4b3539,function(_0x1ac0b7){if(_0x1ac0b7['type']!=='VIRTUAL'){var _0x4cc399={};_0x4cc399[_0x1ac0b7['name']]={'$like':'%'+_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]+'%'};return _0x4cc399;}})});}_0x165a87=_['merge']({},_0x165a87,_0x47916a['options']);var _0x5a1e62={'where':_0x165a87[_0x9a69('0x3c')]};return db[_0x9a69('0x40')][_0x9a69('0x20')](_0x5a1e62)['then'](function(_0x2ff507){_0x54e643[_0x9a69('0x20')]=_0x2ff507;if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x41')]){_0x165a87[_0x9a69('0x42')]=[{'all':!![]}];}return db[_0x9a69('0x40')]['findAll'](_0x165a87);})[_0x9a69('0x26')](function(_0x27d0db){_0x54e643[_0x9a69('0x43')]=_0x27d0db;return _0x54e643;})[_0x9a69('0x26')](respondWithFilteredResult(_0x1ff48e,_0x165a87))['catch'](handleError(_0x1ff48e,null));};exports[_0x9a69('0x44')]=function(_0x373939,_0x5b309a){var _0x318de1={'raw':!![],'where':{'id':_0x373939[_0x9a69('0x45')]['id']}},_0x3c78e2={};_0x3c78e2['model']=_['keys'](db['FreshdeskField'][_0x9a69('0x2d')]);_0x3c78e2[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x373939[_0x9a69('0x32')]);_0x3c78e2['filters']=_[_0x9a69('0x35')](_0x3c78e2[_0x9a69('0x31')],_0x3c78e2[_0x9a69('0x32')]);_0x318de1[_0x9a69('0x36')]=_['intersection'](_0x3c78e2[_0x9a69('0x31')],qs[_0x9a69('0x37')](_0x373939[_0x9a69('0x32')][_0x9a69('0x37')]));_0x318de1['attributes']=_0x318de1[_0x9a69('0x36')]['length']?_0x318de1[_0x9a69('0x36')]:_0x3c78e2['model'];if(_0x373939[_0x9a69('0x32')]['includeAll']){_0x318de1[_0x9a69('0x42')]=[{'all':!![]}];}_0x318de1=_['merge']({},_0x318de1,_0x373939[_0x9a69('0x46')]);return db[_0x9a69('0x40')][_0x9a69('0x47')](_0x318de1)[_0x9a69('0x26')](handleEntityNotFound(_0x5b309a,null))['then'](respondWithResult(_0x5b309a,null))[_0x9a69('0x48')](handleError(_0x5b309a,null));};exports[_0x9a69('0x49')]=function(_0x77781d,_0x2537b0){return db[_0x9a69('0x40')][_0x9a69('0x49')](_0x77781d[_0x9a69('0x4a')],{})[_0x9a69('0x26')](respondWithResult(_0x2537b0,0xc9))[_0x9a69('0x48')](handleError(_0x2537b0,null));};exports['update']=function(_0x281ef0,_0x6046a7){if(_0x281ef0[_0x9a69('0x4a')]['id']){delete _0x281ef0[_0x9a69('0x4a')]['id'];}return db[_0x9a69('0x40')][_0x9a69('0x47')]({'where':{'id':_0x281ef0[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x6046a7,null))[_0x9a69('0x26')](saveUpdates(_0x281ef0[_0x9a69('0x4a')],null))[_0x9a69('0x26')](respondWithResult(_0x6046a7,null))[_0x9a69('0x48')](handleError(_0x6046a7,null));};exports[_0x9a69('0x25')]=function(_0x43b084,_0x18ab7a){return db['FreshdeskField'][_0x9a69('0x47')]({'where':{'id':_0x43b084[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x18ab7a,null))[_0x9a69('0x26')](removeEntity(_0x18ab7a,null))[_0x9a69('0x48')](handleError(_0x18ab7a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 9ba4ac1..e96ba5c 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 _0x7edf=['FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x96f0f5,_0x3153e6){var _0xc8606a=function(_0x492f33){while(--_0x492f33){_0x96f0f5['push'](_0x96f0f5['shift']());}};_0xc8606a(++_0x3153e6);}(_0x7edf,0x71));var _0xf7ed=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x7edf[_0x1f7839];return _0x36b42e;};'use strict';var _=require(_0xf7ed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf7ed('0x1'));var moment=require(_0xf7ed('0x2'));var BPromise=require(_0xf7ed('0x3'));var rp=require(_0xf7ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7ed('0x5'));var config=require(_0xf7ed('0x6'));var attributes=require(_0xf7ed('0x7'));module['exports']=function(_0x5eae52,_0x2981c8){return _0x5eae52[_0xf7ed('0x8')](_0xf7ed('0x9'),attributes,{'tableName':_0xf7ed('0xa'),'paranoid':![],'indexes':[{'name':_0xf7ed('0xb'),'fields':[_0xf7ed('0xc'),_0xf7ed('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cca=['bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5a8087,_0x16ae13){var _0x510cfc=function(_0x295071){while(--_0x295071){_0x5a8087['push'](_0x5a8087['shift']());}};_0x510cfc(++_0x16ae13);}(_0x2cca,0xa4));var _0xa2cc=function(_0x37e3b4,_0x59e004){_0x37e3b4=_0x37e3b4-0x0;var _0x37f82b=_0x2cca[_0x37e3b4];return _0x37f82b;};'use strict';var _=require(_0xa2cc('0x0'));var util=require('util');var logger=require(_0xa2cc('0x1'))(_0xa2cc('0x2'));var moment=require(_0xa2cc('0x3'));var BPromise=require(_0xa2cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa2cc('0x5'));var config=require(_0xa2cc('0x6'));var attributes=require(_0xa2cc('0x7'));module[_0xa2cc('0x8')]=function(_0xcaf068,_0xcd8c32){return _0xcaf068['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa2cc('0x9'),'fields':[_0xa2cc('0xa'),_0xa2cc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 1cbdf5f..8bb5906 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 _0x17fc=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x33553a,_0x3e3d4a){var _0x3da1fa=function(_0x794a1c){while(--_0x794a1c){_0x33553a['push'](_0x33553a['shift']());}};_0x3da1fa(++_0x3e3d4a);}(_0x17fc,0x1e3));var _0xc17f=function(_0x2c112a,_0x4cfa30){_0x2c112a=_0x2c112a-0x0;var _0x13bfd1=_0x17fc[_0x2c112a];return _0x13bfd1;};'use strict';var _=require(_0xc17f('0x0'));var util=require(_0xc17f('0x1'));var moment=require('moment');var BPromise=require(_0xc17f('0x2'));var rs=require(_0xc17f('0x3'));var fs=require('fs');var Redis=require(_0xc17f('0x4'));var db=require(_0xc17f('0x5'))['db'];var utils=require(_0xc17f('0x6'));var logger=require('../../config/logger')(_0xc17f('0x7'));var config=require(_0xc17f('0x8'));var jayson=require(_0xc17f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6df30,_0x2be0a8,_0x25c1ba){return new BPromise(function(_0x267fdb,_0xae0d01){return client[_0xc17f('0xa')](_0x6df30,_0x25c1ba)[_0xc17f('0xb')](function(_0x4944a1){logger[_0xc17f('0xc')](_0xc17f('0xd'),_0x2be0a8,_0xc17f('0xe'));logger[_0xc17f('0xf')](_0xc17f('0x10'),_0x2be0a8,_0xc17f('0xe'),JSON[_0xc17f('0x11')](_0x4944a1));if(_0x4944a1['error']){if(_0x4944a1[_0xc17f('0x12')][_0xc17f('0x13')]===0x1f4){logger[_0xc17f('0x12')](_0xc17f('0xd'),_0x2be0a8,_0x4944a1[_0xc17f('0x12')]['message']);return _0xae0d01(_0x4944a1[_0xc17f('0x12')]['message']);}logger[_0xc17f('0x12')](_0xc17f('0xd'),_0x2be0a8,_0x4944a1[_0xc17f('0x12')]['message']);return _0x267fdb(_0x4944a1[_0xc17f('0x12')][_0xc17f('0x14')]);}else{logger[_0xc17f('0xc')](_0xc17f('0xd'),_0x2be0a8,'request\x20sent');_0x267fdb(_0x4944a1[_0xc17f('0x15')][_0xc17f('0x14')]);}})['catch'](function(_0x5691dc){logger[_0xc17f('0x12')](_0xc17f('0xd'),_0x2be0a8,_0x5691dc);_0xae0d01(_0x5691dc);});});} \ No newline at end of file +var _0xd1e8=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3546c2,_0x4f7867){var _0x558341=function(_0x57bf1d){while(--_0x57bf1d){_0x3546c2['push'](_0x3546c2['shift']());}};_0x558341(++_0x4f7867);}(_0xd1e8,0xb3));var _0x8d1e=function(_0x4f8072,_0x490a73){_0x4f8072=_0x4f8072-0x0;var _0xb2d4ba=_0xd1e8[_0x4f8072];return _0xb2d4ba;};'use strict';var _=require(_0x8d1e('0x0'));var util=require('util');var moment=require(_0x8d1e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d1e('0x2'));var db=require(_0x8d1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d1e('0x4'))(_0x8d1e('0x5'));var config=require(_0x8d1e('0x6'));var jayson=require(_0x8d1e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f2296,_0x516a4c,_0x1dc53b){return new BPromise(function(_0xe0ee11,_0xff302){return client[_0x8d1e('0x8')](_0x4f2296,_0x1dc53b)['then'](function(_0x1e1a36){logger[_0x8d1e('0x9')](_0x8d1e('0xa'),_0x516a4c,_0x8d1e('0xb'));logger[_0x8d1e('0xc')](_0x8d1e('0xd'),_0x516a4c,'request\x20sent',JSON[_0x8d1e('0xe')](_0x1e1a36));if(_0x1e1a36[_0x8d1e('0xf')]){if(_0x1e1a36[_0x8d1e('0xf')][_0x8d1e('0x10')]===0x1f4){logger[_0x8d1e('0xf')](_0x8d1e('0xa'),_0x516a4c,_0x1e1a36[_0x8d1e('0xf')][_0x8d1e('0x11')]);return _0xff302(_0x1e1a36['error'][_0x8d1e('0x11')]);}logger[_0x8d1e('0xf')](_0x8d1e('0xa'),_0x516a4c,_0x1e1a36[_0x8d1e('0xf')][_0x8d1e('0x11')]);return _0xe0ee11(_0x1e1a36[_0x8d1e('0xf')]['message']);}else{logger[_0x8d1e('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x516a4c,'request\x20sent');_0xe0ee11(_0x1e1a36[_0x8d1e('0x12')][_0x8d1e('0x11')]);}})[_0x8d1e('0x13')](function(_0x2599b2){logger['error'](_0x8d1e('0xa'),_0x516a4c,_0x2599b2);_0xff302(_0x2599b2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0c65423..62c81f1 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0xf29579,_0x1af46f){var _0x275338=function(_0x50cff7){while(--_0x50cff7){_0xf29579['push'](_0xf29579['shift']());}};_0x275338(++_0x1af46f);}(_0x7334,0x184));var _0x4733=function(_0x369bde,_0x20f03c){_0x369bde=_0x369bde-0x0;var _0x172bf4=_0x7334[_0x369bde];return _0x172bf4;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router; \ No newline at end of file +var _0x4ded=['./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30d1ff,_0x2e5990){var _0x48c2f4=function(_0x1c4767){while(--_0x1c4767){_0x30d1ff['push'](_0x30d1ff['shift']());}};_0x48c2f4(++_0x2e5990);}(_0x4ded,0x116));var _0xd4de=function(_0x35230f,_0x367882){_0x35230f=_0x35230f-0x0;var _0x1bcf16=_0x4ded[_0x35230f];return _0x1bcf16;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id/configurations',auth[_0xd4de('0xe')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd4de('0x11')]('/:id/configurations',auth[_0xd4de('0xe')](),controller[_0xd4de('0x12')]);router[_0xd4de('0x13')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x14')]);router[_0xd4de('0x15')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x16')]);module[_0xd4de('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 16acb0c..a541080 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 _0x9f0e=['STRING','remoteUri','sequelize','exports'];(function(_0x39a754,_0x2c3d44){var _0x13c655=function(_0x4002cc){while(--_0x4002cc){_0x39a754['push'](_0x39a754['shift']());}};_0x13c655(++_0x2c3d44);}(_0x9f0e,0x116));var _0xe9f0=function(_0xcb34c0,_0x43fefe){_0xcb34c0=_0xcb34c0-0x0;var _0x2bcce3=_0x9f0e[_0xcb34c0];return _0x2bcce3;};'use strict';var Sequelize=require(_0xe9f0('0x0'));module[_0xe9f0('0x1')]={'name':{'type':Sequelize[_0xe9f0('0x2')]},'description':{'type':Sequelize[_0xe9f0('0x2')]},'username':{'type':Sequelize[_0xe9f0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe9f0('0x2')],'unique':_0xe9f0('0x3')},'serverUrl':{'type':Sequelize[_0xe9f0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a85=['STRING','remoteUri'];(function(_0x30631b,_0x50799b){var _0x3d57c6=function(_0x3ecce0){while(--_0x3ecce0){_0x30631b['push'](_0x30631b['shift']());}};_0x3d57c6(++_0x50799b);}(_0x1a85,0x178));var _0x51a8=function(_0x21d2a6,_0x44c6cc){_0x21d2a6=_0x21d2a6-0x0;var _0x3a5b9f=_0x1a85[_0x21d2a6];return _0x3a5b9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 828c711..94991f9 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 _0x145a=['eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','then','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','slice','substring','GET','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x145a,0x132));var _0xa145=function(_0x4ea96b,_0x383d5b){_0x4ea96b=_0x4ea96b-0x0;var _0x1334c1=_0x145a[_0x4ea96b];return _0x1334c1;};'use strict';var emlformat=require(_0xa145('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa145('0x1'));var rp=require(_0xa145('0x2'));var moment=require(_0xa145('0x3'));var BPromise=require(_0xa145('0x4'));var Mustache=require('mustache');var util=require(_0xa145('0x5'));var path=require(_0xa145('0x6'));var sox=require('sox');var csv=require(_0xa145('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa145('0x8'));var _=require('lodash');var squel=require(_0xa145('0x9'));var crypto=require(_0xa145('0xa'));var jsforce=require(_0xa145('0xb'));var deskjs=require(_0xa145('0xc'));var toCsv=require(_0xa145('0x7'));var querystring=require('querystring');var Papa=require(_0xa145('0xd'));var Redis=require(_0xa145('0xe'));var authService=require(_0xa145('0xf'));var qs=require(_0xa145('0x10'));var as=require(_0xa145('0x11'));var hardwareService=require(_0xa145('0x12'));var logger=require(_0xa145('0x13'))('api');var utils=require(_0xa145('0x14'));var config=require(_0xa145('0x15'));var licenseUtil=require(_0xa145('0x16'));var db=require(_0xa145('0x17'))['db'];var integrations=require(_0xa145('0x18'));function respondWithStatusCode(_0x4640d0,_0xe8e75){_0xe8e75=_0xe8e75||0xcc;return function(_0x5567ae){if(_0x5567ae){return _0x4640d0[_0xa145('0x19')](_0xe8e75);}return _0x4640d0[_0xa145('0x1a')](_0xe8e75)[_0xa145('0x1b')]();};}function respondWithResult(_0x425e70,_0x49e36d){_0x49e36d=_0x49e36d||0xc8;return function(_0x5ebf05){if(_0x5ebf05){return _0x425e70[_0xa145('0x1a')](_0x49e36d)[_0xa145('0x1c')](_0x5ebf05);}};}function respondWithFilteredResult(_0x1557f5,_0x955df1){return function(_0x461174){if(_0x461174){var _0x550b9b=typeof _0x955df1[_0xa145('0x1d')]===_0xa145('0x1e')&&typeof _0x955df1[_0xa145('0x1f')]===_0xa145('0x1e');var _0x49ae08=_0x461174['count'];var _0x16cd45=_0x550b9b?0x0:_0x955df1['offset'];var _0x4005b8=_0x550b9b?_0x461174[_0xa145('0x20')]:_0x955df1[_0xa145('0x1d')]+_0x955df1[_0xa145('0x1f')];var _0x4690fd;if(_0x4005b8>=_0x49ae08){_0x4005b8=_0x49ae08;_0x4690fd=0xc8;}else{_0x4690fd=0xce;}_0x1557f5['status'](_0x4690fd);return _0x1557f5[_0xa145('0x21')](_0xa145('0x22'),_0x16cd45+'-'+_0x4005b8+'/'+_0x49ae08)[_0xa145('0x1c')](_0x461174);}return null;};}function patchUpdates(_0x22e37f){return function(_0xd00ae){try{jsonpatch[_0xa145('0x23')](_0xd00ae,_0x22e37f,!![]);}catch(_0x2d8730){return BPromise[_0xa145('0x24')](_0x2d8730);}return _0xd00ae['save']();};}function saveUpdates(_0xfd4fb,_0x5ef18d){return function(_0x5bb87a){if(_0x5bb87a){return _0x5bb87a[_0xa145('0x25')](_0xfd4fb)['then'](function(_0x3418d4){return _0x3418d4;});}return null;};}function removeEntity(_0xc1fc51,_0x19dd62){return function(_0x21f7a1){if(_0x21f7a1){return _0x21f7a1[_0xa145('0x26')]()['then'](function(){_0xc1fc51[_0xa145('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdcac18,_0x3c91c2){return function(_0x1d0dd1){if(!_0x1d0dd1){_0xdcac18[_0xa145('0x19')](0x194);}return _0x1d0dd1;};}function handleError(_0xc4a318,_0x1e5d30){_0x1e5d30=_0x1e5d30||0x1f4;return function(_0x128204){logger['error'](_0x128204[_0xa145('0x27')]);if(_0x128204[_0xa145('0x28')]){delete _0x128204['name'];}_0xc4a318[_0xa145('0x1a')](_0x1e5d30)[_0xa145('0x29')](_0x128204);};}exports[_0xa145('0x2a')]=function(_0x358a2a,_0x244f33){var _0x5c9603={},_0x242797={},_0x197dbd={'count':0x0,'rows':[]};var _0x1adf0b=_[_0xa145('0x2b')](db[_0xa145('0x2c')][_0xa145('0x2d')],function(_0x1b76be){return{'name':_0x1b76be[_0xa145('0x2e')],'type':_0x1b76be[_0xa145('0x2f')][_0xa145('0x30')]};});_0x242797['model']=_[_0xa145('0x2b')](_0x1adf0b,'name');_0x242797[_0xa145('0x31')]=_['keys'](_0x358a2a[_0xa145('0x31')]);_0x242797[_0xa145('0x32')]=_[_0xa145('0x33')](_0x242797['model'],_0x242797['query']);_0x5c9603[_0xa145('0x34')]=_[_0xa145('0x33')](_0x242797[_0xa145('0x35')],qs[_0xa145('0x36')](_0x358a2a['query'][_0xa145('0x36')]));_0x5c9603[_0xa145('0x34')]=_0x5c9603[_0xa145('0x34')][_0xa145('0x37')]?_0x5c9603[_0xa145('0x34')]:_0x242797[_0xa145('0x35')];if(!_0x358a2a[_0xa145('0x31')][_0xa145('0x38')](_0xa145('0x39'))){_0x5c9603[_0xa145('0x1f')]=qs[_0xa145('0x1f')](_0x358a2a[_0xa145('0x31')]['limit']);_0x5c9603['offset']=qs[_0xa145('0x1d')](_0x358a2a[_0xa145('0x31')][_0xa145('0x1d')]);}_0x5c9603['order']=qs[_0xa145('0x3a')](_0x358a2a[_0xa145('0x31')][_0xa145('0x3a')]);_0x5c9603['where']=qs[_0xa145('0x32')](_[_0xa145('0x3b')](_0x358a2a[_0xa145('0x31')],_0x242797[_0xa145('0x32')]),_0x1adf0b);if(_0x358a2a['query']['filter']){_0x5c9603[_0xa145('0x3c')]=_[_0xa145('0x3d')](_0x5c9603[_0xa145('0x3c')],{'$or':_[_0xa145('0x2b')](_0x1adf0b,function(_0x181111){if(_0x181111[_0xa145('0x2f')]!=='VIRTUAL'){var _0x5ba32d={};_0x5ba32d[_0x181111['name']]={'$like':'%'+_0x358a2a[_0xa145('0x31')][_0xa145('0x3e')]+'%'};return _0x5ba32d;}})});}_0x5c9603=_[_0xa145('0x3d')]({},_0x5c9603,_0x358a2a[_0xa145('0x3f')]);var _0x33554c={'where':_0x5c9603['where']};return db['FreshsalesAccount'][_0xa145('0x20')](_0x33554c)[_0xa145('0x40')](function(_0x68b2d2){_0x197dbd['count']=_0x68b2d2;if(_0x358a2a[_0xa145('0x31')]['includeAll']){_0x5c9603[_0xa145('0x41')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xa145('0x42')](_0x5c9603);})[_0xa145('0x40')](function(_0x17ebab){_0x197dbd[_0xa145('0x43')]=_0x17ebab;return _0x197dbd;})[_0xa145('0x40')](respondWithFilteredResult(_0x244f33,_0x5c9603))[_0xa145('0x44')](handleError(_0x244f33,null));};exports[_0xa145('0x45')]=function(_0x3d7c03,_0x4c9671){var _0x3753d1={'raw':![],'where':{'id':_0x3d7c03[_0xa145('0x46')]['id']}},_0x254166={};_0x254166['model']=_[_0xa145('0x47')](db[_0xa145('0x2c')][_0xa145('0x2d')]);_0x254166[_0xa145('0x31')]=_[_0xa145('0x47')](_0x3d7c03[_0xa145('0x31')]);_0x254166[_0xa145('0x32')]=_[_0xa145('0x33')](_0x254166[_0xa145('0x35')],_0x254166['query']);_0x3753d1[_0xa145('0x34')]=_['intersection'](_0x254166[_0xa145('0x35')],qs['fields'](_0x3d7c03[_0xa145('0x31')][_0xa145('0x36')]));_0x3753d1[_0xa145('0x34')]=_0x3753d1[_0xa145('0x34')][_0xa145('0x37')]?_0x3753d1['attributes']:_0x254166[_0xa145('0x35')];if(_0x3d7c03[_0xa145('0x31')][_0xa145('0x48')]){_0x3753d1['include']=[{'all':!![]}];}_0x3753d1=_[_0xa145('0x3d')]({},_0x3753d1,_0x3d7c03[_0xa145('0x3f')]);return db[_0xa145('0x2c')][_0xa145('0x49')](_0x3753d1)[_0xa145('0x40')](handleEntityNotFound(_0x4c9671,null))['then'](respondWithResult(_0x4c9671,null))[_0xa145('0x44')](handleError(_0x4c9671,null));};exports[_0xa145('0x4a')]=function(_0x4aeab6,_0x4ff7ad){return db['FreshsalesAccount'][_0xa145('0x4a')](_0x4aeab6[_0xa145('0x4b')],{})[_0xa145('0x40')](respondWithResult(_0x4ff7ad,0xc9))['catch'](handleError(_0x4ff7ad,null));};exports['update']=function(_0xc23543,_0x828074){if(_0xc23543[_0xa145('0x4b')]['id']){delete _0xc23543[_0xa145('0x4b')]['id'];}return db[_0xa145('0x2c')]['find']({'where':{'id':_0xc23543[_0xa145('0x46')]['id']}})[_0xa145('0x40')](handleEntityNotFound(_0x828074,null))[_0xa145('0x40')](saveUpdates(_0xc23543[_0xa145('0x4b')],null))[_0xa145('0x40')](respondWithResult(_0x828074,null))['catch'](handleError(_0x828074,null));};exports['destroy']=function(_0x5b3dfe,_0x26a4f9){return db[_0xa145('0x2c')][_0xa145('0x49')]({'where':{'id':_0x5b3dfe[_0xa145('0x46')]['id']}})[_0xa145('0x40')](handleEntityNotFound(_0x26a4f9,null))['then'](removeEntity(_0x26a4f9,null))[_0xa145('0x44')](handleError(_0x26a4f9,null));};exports[_0xa145('0x4c')]=function(_0x1f93ed,_0x5d066f,_0x13e5a5){var _0x3c991a={};var _0x393c8e={};var _0x2415ef;var _0x258c66;return db[_0xa145('0x2c')][_0xa145('0x4d')]({'where':{'id':_0x1f93ed[_0xa145('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d066f,null))[_0xa145('0x40')](function(_0x1c9e4f){if(_0x1c9e4f){_0x2415ef=_0x1c9e4f;_0x393c8e[_0xa145('0x35')]=_[_0xa145('0x47')](db['FreshsalesConfiguration'][_0xa145('0x2d')]);_0x393c8e[_0xa145('0x31')]=_[_0xa145('0x47')](_0x1f93ed[_0xa145('0x31')]);_0x393c8e[_0xa145('0x32')]=_[_0xa145('0x33')](_0x393c8e['model'],_0x393c8e[_0xa145('0x31')]);_0x3c991a[_0xa145('0x34')]=_[_0xa145('0x33')](_0x393c8e[_0xa145('0x35')],qs['fields'](_0x1f93ed[_0xa145('0x31')][_0xa145('0x36')]));_0x3c991a[_0xa145('0x34')]=_0x3c991a[_0xa145('0x34')]['length']?_0x3c991a['attributes']:_0x393c8e[_0xa145('0x35')];_0x3c991a[_0xa145('0x4e')]=qs[_0xa145('0x3a')](_0x1f93ed[_0xa145('0x31')][_0xa145('0x3a')]);_0x3c991a['where']=qs['filters'](_[_0xa145('0x3b')](_0x1f93ed[_0xa145('0x31')],_0x393c8e[_0xa145('0x32')]));if(_0x1f93ed[_0xa145('0x31')][_0xa145('0x3e')]){_0x3c991a[_0xa145('0x3c')]=_[_0xa145('0x3d')](_0x3c991a[_0xa145('0x3c')],{'$or':_[_0xa145('0x2b')](_0x3c991a[_0xa145('0x34')],function(_0x4284d9){var _0x47f171={};_0x47f171[_0x4284d9]={'$like':'%'+_0x1f93ed[_0xa145('0x31')]['filter']+'%'};return _0x47f171;})});}_0x3c991a=_[_0xa145('0x3d')]({},_0x3c991a,_0x1f93ed['options']);return _0x2415ef['getConfigurations'](_0x3c991a);}})['then'](function(_0x2e0186){if(_0x2e0186){_0x258c66=_0x2e0186[_0xa145('0x37')];if(!_0x1f93ed[_0xa145('0x31')][_0xa145('0x38')](_0xa145('0x39'))){_0x3c991a[_0xa145('0x1f')]=qs[_0xa145('0x1f')](_0x1f93ed[_0xa145('0x31')][_0xa145('0x1f')]);_0x3c991a[_0xa145('0x1d')]=qs['offset'](_0x1f93ed[_0xa145('0x31')][_0xa145('0x1d')]);}return _0x2415ef[_0xa145('0x4c')](_0x3c991a);}})[_0xa145('0x40')](function(_0x5ca1e6){if(_0x5ca1e6){return _0x5ca1e6?{'count':_0x258c66,'rows':_0x5ca1e6}:null;}})['then'](respondWithResult(_0x5d066f,null))['catch'](handleError(_0x5d066f,null));};exports[_0xa145('0x4f')]=function(_0x4d6827,_0x37281a,_0x21ce09){if(_0x4d6827['body']['id']){delete _0x4d6827[_0xa145('0x4b')]['id'];}return db[_0xa145('0x2c')]['findOne']({'where':{'id':_0x4d6827[_0xa145('0x46')]['id']}})[_0xa145('0x40')](handleEntityNotFound(_0x37281a,null))[_0xa145('0x40')](function(_0x43badd){if(_0x43badd){_0x4d6827[_0xa145('0x4b')][_0xa145('0x50')]=_0x43badd['id'];_0x4d6827['body'][_0xa145('0x51')]=integrations[_0xa145('0x52')](_0x4d6827['body']['channel'],_0x4d6827['body'][_0xa145('0x2f')]);_0x4d6827['body'][_0xa145('0x53')]=integrations[_0xa145('0x54')](_0x4d6827[_0xa145('0x4b')][_0xa145('0x55')],_0x4d6827[_0xa145('0x4b')]['type']);return db[_0xa145('0x56')]['create'](_0x4d6827[_0xa145('0x4b')],{'include':[{'model':db['FreshsalesField'],'as':_0xa145('0x51')},{'model':db[_0xa145('0x57')],'as':_0xa145('0x53')}]});}return null;})[_0xa145('0x40')](respondWithResult(_0x37281a,null))[_0xa145('0x44')](handleError(_0x37281a,null));};exports['getFields']=function(_0x17cfff,_0x212b8a,_0x4c01cf){var _0xe91265='';var _0x5b1f49='';return db[_0xa145('0x2c')][_0xa145('0x4d')]({'where':{'id':_0x17cfff[_0xa145('0x46')]['id']},'attributes':['id',_0xa145('0x58'),_0xa145('0x59'),_0xa145('0x5a')]})[_0xa145('0x40')](handleEntityNotFound(_0x212b8a,null))['then'](function(_0xa49664){if(_0xa49664){_0x5b1f49=_0xa49664['username'];_0xe91265=_0xa49664[_0xa145('0x59')];var _0x262eeb=_0xa49664[_0xa145('0x59')][_0xa145('0x5b')](-0x1);if(_0x262eeb==='/'){_0xe91265=_0xe91265[_0xa145('0x5c')](0x0,_0xe91265['lastIndexOf'](_0x262eeb));}return rp({'method':_0xa145('0x5d'),'uri':util['format'](_0xa145('0x5e'),_0xe91265,'/api/selector/owners'),'headers':{'Authorization':_0xa145('0x5f')+_0xa49664['apiKey']},'json':!![]});}})[_0xa145('0x40')](function(_0x939740){if(_0x939740){var _0x54061c=_0x939740['users'];var _0x34e253=![];var _0x45ec01=null;for(_0x45ec01=0x0;_0x45ec01<_0x54061c[_0xa145('0x37')];_0x45ec01++){if(_0x54061c[_0x45ec01][_0xa145('0x60')]===_0x5b1f49){_0x34e253=!![];}}if(_0x34e253){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa145('0x61')});}}})[_0xa145('0x40')](respondWithResult(_0x212b8a,null))['catch'](function(_0x37ec75){var _0xa23afd=_0x17cfff[_0xa145('0x31')]['test']?0x1f4:_0x37ec75[_0xa145('0x62')]||0x1f4;logger['error'](_0xa145('0x63'),_0xa145('0x64'),_0xa23afd,JSON['stringify'](_0x37ec75));delete _0x37ec75['name'];if(_0xa23afd===0x191){_0xa23afd=0x190;}_0x212b8a[_0xa145('0x1a')](_0xa23afd)['send'](_0x17cfff[_0xa145('0x31')]['test']?{'message':_0xa145('0x65'),'statusCode':_0x37ec75[_0xa145('0x62')]}:_0x37ec75);});}; \ No newline at end of file +var _0x1c69=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','options','create','body','update','find','FreshsalesConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','/api/selector/owners','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FreshsalesAccount','type','key','keys','query','filters','intersection','model'];(function(_0x36d415,_0x1cfbad){var _0x9ad7f0=function(_0x1de3d0){while(--_0x1de3d0){_0x36d415['push'](_0x36d415['shift']());}};_0x9ad7f0(++_0x1cfbad);}(_0x1c69,0x169));var _0x91c6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x1c69[_0x101e7b];return _0x4995c0;};'use strict';var emlformat=require(_0x91c6('0x0'));var rimraf=require(_0x91c6('0x1'));var zipdir=require(_0x91c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91c6('0x3'));var moment=require(_0x91c6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91c6('0x5'));var util=require(_0x91c6('0x6'));var path=require('path');var sox=require(_0x91c6('0x7'));var csv=require(_0x91c6('0x8'));var ejs=require(_0x91c6('0x9'));var fs=require('fs');var fs_extra=require(_0x91c6('0xa'));var _=require(_0x91c6('0xb'));var squel=require(_0x91c6('0xc'));var crypto=require(_0x91c6('0xd'));var jsforce=require(_0x91c6('0xe'));var deskjs=require(_0x91c6('0xf'));var toCsv=require(_0x91c6('0x8'));var querystring=require(_0x91c6('0x10'));var Papa=require(_0x91c6('0x11'));var Redis=require(_0x91c6('0x12'));var authService=require(_0x91c6('0x13'));var qs=require(_0x91c6('0x14'));var as=require(_0x91c6('0x15'));var hardwareService=require(_0x91c6('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x91c6('0x17'));var config=require(_0x91c6('0x18'));var licenseUtil=require(_0x91c6('0x19'));var db=require(_0x91c6('0x1a'))['db'];var integrations=require(_0x91c6('0x1b'));function respondWithStatusCode(_0xa4aedc,_0x4d7c23){_0x4d7c23=_0x4d7c23||0xcc;return function(_0x1959c5){if(_0x1959c5){return _0xa4aedc[_0x91c6('0x1c')](_0x4d7c23);}return _0xa4aedc[_0x91c6('0x1d')](_0x4d7c23)[_0x91c6('0x1e')]();};}function respondWithResult(_0x22e53c,_0x3c6700){_0x3c6700=_0x3c6700||0xc8;return function(_0x36f78f){if(_0x36f78f){return _0x22e53c[_0x91c6('0x1d')](_0x3c6700)['json'](_0x36f78f);}};}function respondWithFilteredResult(_0x1df061,_0x34841f){return function(_0x583dd0){if(_0x583dd0){var _0x472f56=typeof _0x34841f['offset']===_0x91c6('0x1f')&&typeof _0x34841f[_0x91c6('0x20')]===_0x91c6('0x1f');var _0x24e9c6=_0x583dd0[_0x91c6('0x21')];var _0x11d1da=_0x472f56?0x0:_0x34841f['offset'];var _0x2d7fa1=_0x472f56?_0x583dd0['count']:_0x34841f[_0x91c6('0x22')]+_0x34841f[_0x91c6('0x20')];var _0x1f1c5b;if(_0x2d7fa1>=_0x24e9c6){_0x2d7fa1=_0x24e9c6;_0x1f1c5b=0xc8;}else{_0x1f1c5b=0xce;}_0x1df061[_0x91c6('0x1d')](_0x1f1c5b);return _0x1df061[_0x91c6('0x23')](_0x91c6('0x24'),_0x11d1da+'-'+_0x2d7fa1+'/'+_0x24e9c6)['json'](_0x583dd0);}return null;};}function patchUpdates(_0x1a34d6){return function(_0x22fc2e){try{jsonpatch[_0x91c6('0x25')](_0x22fc2e,_0x1a34d6,!![]);}catch(_0x3745cd){return BPromise[_0x91c6('0x26')](_0x3745cd);}return _0x22fc2e[_0x91c6('0x27')]();};}function saveUpdates(_0x3eb160,_0x479e78){return function(_0xb18067){if(_0xb18067){return _0xb18067['update'](_0x3eb160)[_0x91c6('0x28')](function(_0x4057f8){return _0x4057f8;});}return null;};}function removeEntity(_0x47b689,_0x3b1ffb){return function(_0x47c678){if(_0x47c678){return _0x47c678[_0x91c6('0x29')]()[_0x91c6('0x28')](function(){_0x47b689['status'](0xcc)[_0x91c6('0x1e')]();});}};}function handleEntityNotFound(_0x280c78,_0x5062cc){return function(_0x5ad3a6){if(!_0x5ad3a6){_0x280c78[_0x91c6('0x1c')](0x194);}return _0x5ad3a6;};}function handleError(_0x299430,_0x40ac8c){_0x40ac8c=_0x40ac8c||0x1f4;return function(_0x408aea){logger[_0x91c6('0x2a')](_0x408aea['stack']);if(_0x408aea[_0x91c6('0x2b')]){delete _0x408aea[_0x91c6('0x2b')];}_0x299430[_0x91c6('0x1d')](_0x40ac8c)[_0x91c6('0x2c')](_0x408aea);};}exports[_0x91c6('0x2d')]=function(_0x29a69f,_0x3694b5){var _0x1ed2ae={},_0x51b010={},_0x3a80b7={'count':0x0,'rows':[]};var _0x1ae007=_[_0x91c6('0x2e')](db[_0x91c6('0x2f')]['rawAttributes'],function(_0x1309bc){return{'name':_0x1309bc['fieldName'],'type':_0x1309bc[_0x91c6('0x30')][_0x91c6('0x31')]};});_0x51b010['model']=_[_0x91c6('0x2e')](_0x1ae007,_0x91c6('0x2b'));_0x51b010['query']=_[_0x91c6('0x32')](_0x29a69f[_0x91c6('0x33')]);_0x51b010[_0x91c6('0x34')]=_[_0x91c6('0x35')](_0x51b010[_0x91c6('0x36')],_0x51b010[_0x91c6('0x33')]);_0x1ed2ae[_0x91c6('0x37')]=_[_0x91c6('0x35')](_0x51b010[_0x91c6('0x36')],qs[_0x91c6('0x38')](_0x29a69f['query']['fields']));_0x1ed2ae[_0x91c6('0x37')]=_0x1ed2ae[_0x91c6('0x37')][_0x91c6('0x39')]?_0x1ed2ae[_0x91c6('0x37')]:_0x51b010[_0x91c6('0x36')];if(!_0x29a69f['query'][_0x91c6('0x3a')](_0x91c6('0x3b'))){_0x1ed2ae[_0x91c6('0x20')]=qs['limit'](_0x29a69f[_0x91c6('0x33')][_0x91c6('0x20')]);_0x1ed2ae[_0x91c6('0x22')]=qs[_0x91c6('0x22')](_0x29a69f[_0x91c6('0x33')][_0x91c6('0x22')]);}_0x1ed2ae[_0x91c6('0x3c')]=qs[_0x91c6('0x3d')](_0x29a69f[_0x91c6('0x33')][_0x91c6('0x3d')]);_0x1ed2ae[_0x91c6('0x3e')]=qs['filters'](_[_0x91c6('0x3f')](_0x29a69f[_0x91c6('0x33')],_0x51b010[_0x91c6('0x34')]),_0x1ae007);if(_0x29a69f[_0x91c6('0x33')][_0x91c6('0x40')]){_0x1ed2ae[_0x91c6('0x3e')]=_[_0x91c6('0x41')](_0x1ed2ae[_0x91c6('0x3e')],{'$or':_[_0x91c6('0x2e')](_0x1ae007,function(_0x7f288d){if(_0x7f288d['type']!==_0x91c6('0x42')){var _0x492548={};_0x492548[_0x7f288d['name']]={'$like':'%'+_0x29a69f[_0x91c6('0x33')]['filter']+'%'};return _0x492548;}})});}_0x1ed2ae=_[_0x91c6('0x41')]({},_0x1ed2ae,_0x29a69f['options']);var _0x41ac5b={'where':_0x1ed2ae[_0x91c6('0x3e')]};return db[_0x91c6('0x2f')][_0x91c6('0x21')](_0x41ac5b)[_0x91c6('0x28')](function(_0xfd741b){_0x3a80b7[_0x91c6('0x21')]=_0xfd741b;if(_0x29a69f['query'][_0x91c6('0x43')]){_0x1ed2ae['include']=[{'all':!![]}];}return db[_0x91c6('0x2f')][_0x91c6('0x44')](_0x1ed2ae);})[_0x91c6('0x28')](function(_0x3703de){_0x3a80b7[_0x91c6('0x45')]=_0x3703de;return _0x3a80b7;})[_0x91c6('0x28')](respondWithFilteredResult(_0x3694b5,_0x1ed2ae))[_0x91c6('0x46')](handleError(_0x3694b5,null));};exports[_0x91c6('0x47')]=function(_0x5774a1,_0x48001a){var _0x2bc096={'raw':![],'where':{'id':_0x5774a1[_0x91c6('0x48')]['id']}},_0x4293e6={};_0x4293e6['model']=_[_0x91c6('0x32')](db[_0x91c6('0x2f')][_0x91c6('0x49')]);_0x4293e6['query']=_[_0x91c6('0x32')](_0x5774a1['query']);_0x4293e6[_0x91c6('0x34')]=_['intersection'](_0x4293e6['model'],_0x4293e6[_0x91c6('0x33')]);_0x2bc096[_0x91c6('0x37')]=_[_0x91c6('0x35')](_0x4293e6[_0x91c6('0x36')],qs[_0x91c6('0x38')](_0x5774a1[_0x91c6('0x33')][_0x91c6('0x38')]));_0x2bc096[_0x91c6('0x37')]=_0x2bc096[_0x91c6('0x37')][_0x91c6('0x39')]?_0x2bc096[_0x91c6('0x37')]:_0x4293e6['model'];if(_0x5774a1[_0x91c6('0x33')][_0x91c6('0x43')]){_0x2bc096['include']=[{'all':!![]}];}_0x2bc096=_[_0x91c6('0x41')]({},_0x2bc096,_0x5774a1[_0x91c6('0x4a')]);return db[_0x91c6('0x2f')]['find'](_0x2bc096)['then'](handleEntityNotFound(_0x48001a,null))[_0x91c6('0x28')](respondWithResult(_0x48001a,null))['catch'](handleError(_0x48001a,null));};exports['create']=function(_0x5030e1,_0x4ba5d1){return db['FreshsalesAccount'][_0x91c6('0x4b')](_0x5030e1[_0x91c6('0x4c')],{})[_0x91c6('0x28')](respondWithResult(_0x4ba5d1,0xc9))[_0x91c6('0x46')](handleError(_0x4ba5d1,null));};exports[_0x91c6('0x4d')]=function(_0x18f13a,_0x2c8754){if(_0x18f13a[_0x91c6('0x4c')]['id']){delete _0x18f13a[_0x91c6('0x4c')]['id'];}return db[_0x91c6('0x2f')]['find']({'where':{'id':_0x18f13a[_0x91c6('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c8754,null))[_0x91c6('0x28')](saveUpdates(_0x18f13a[_0x91c6('0x4c')],null))[_0x91c6('0x28')](respondWithResult(_0x2c8754,null))[_0x91c6('0x46')](handleError(_0x2c8754,null));};exports[_0x91c6('0x29')]=function(_0x14c373,_0x507d9a){return db[_0x91c6('0x2f')][_0x91c6('0x4e')]({'where':{'id':_0x14c373[_0x91c6('0x48')]['id']}})['then'](handleEntityNotFound(_0x507d9a,null))['then'](removeEntity(_0x507d9a,null))[_0x91c6('0x46')](handleError(_0x507d9a,null));};exports['getConfigurations']=function(_0x13c290,_0x3588fe,_0xc95a2f){var _0x310ce4={};var _0x4b8524={};var _0x5dc395;var _0x3ecbe8;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x13c290['params']['id']}})[_0x91c6('0x28')](handleEntityNotFound(_0x3588fe,null))['then'](function(_0x5d0fc7){if(_0x5d0fc7){_0x5dc395=_0x5d0fc7;_0x4b8524[_0x91c6('0x36')]=_[_0x91c6('0x32')](db[_0x91c6('0x4f')][_0x91c6('0x49')]);_0x4b8524['query']=_['keys'](_0x13c290[_0x91c6('0x33')]);_0x4b8524[_0x91c6('0x34')]=_[_0x91c6('0x35')](_0x4b8524[_0x91c6('0x36')],_0x4b8524[_0x91c6('0x33')]);_0x310ce4[_0x91c6('0x37')]=_[_0x91c6('0x35')](_0x4b8524['model'],qs[_0x91c6('0x38')](_0x13c290[_0x91c6('0x33')]['fields']));_0x310ce4[_0x91c6('0x37')]=_0x310ce4[_0x91c6('0x37')]['length']?_0x310ce4[_0x91c6('0x37')]:_0x4b8524[_0x91c6('0x36')];_0x310ce4[_0x91c6('0x3c')]=qs['sort'](_0x13c290[_0x91c6('0x33')][_0x91c6('0x3d')]);_0x310ce4[_0x91c6('0x3e')]=qs[_0x91c6('0x34')](_[_0x91c6('0x3f')](_0x13c290[_0x91c6('0x33')],_0x4b8524[_0x91c6('0x34')]));if(_0x13c290[_0x91c6('0x33')]['filter']){_0x310ce4[_0x91c6('0x3e')]=_[_0x91c6('0x41')](_0x310ce4[_0x91c6('0x3e')],{'$or':_['map'](_0x310ce4[_0x91c6('0x37')],function(_0x46a81b){var _0x36a4ea={};_0x36a4ea[_0x46a81b]={'$like':'%'+_0x13c290[_0x91c6('0x33')][_0x91c6('0x40')]+'%'};return _0x36a4ea;})});}_0x310ce4=_['merge']({},_0x310ce4,_0x13c290[_0x91c6('0x4a')]);return _0x5dc395[_0x91c6('0x50')](_0x310ce4);}})['then'](function(_0x363650){if(_0x363650){_0x3ecbe8=_0x363650['length'];if(!_0x13c290[_0x91c6('0x33')][_0x91c6('0x3a')](_0x91c6('0x3b'))){_0x310ce4[_0x91c6('0x20')]=qs[_0x91c6('0x20')](_0x13c290[_0x91c6('0x33')][_0x91c6('0x20')]);_0x310ce4[_0x91c6('0x22')]=qs[_0x91c6('0x22')](_0x13c290[_0x91c6('0x33')][_0x91c6('0x22')]);}return _0x5dc395[_0x91c6('0x50')](_0x310ce4);}})[_0x91c6('0x28')](function(_0x183c48){if(_0x183c48){return _0x183c48?{'count':_0x3ecbe8,'rows':_0x183c48}:null;}})['then'](respondWithResult(_0x3588fe,null))[_0x91c6('0x46')](handleError(_0x3588fe,null));};exports[_0x91c6('0x51')]=function(_0x19ef32,_0x37ca7c,_0x35c5a0){if(_0x19ef32[_0x91c6('0x4c')]['id']){delete _0x19ef32[_0x91c6('0x4c')]['id'];}return db[_0x91c6('0x2f')][_0x91c6('0x52')]({'where':{'id':_0x19ef32[_0x91c6('0x48')]['id']}})[_0x91c6('0x28')](handleEntityNotFound(_0x37ca7c,null))['then'](function(_0x4c05ce){if(_0x4c05ce){_0x19ef32[_0x91c6('0x4c')][_0x91c6('0x53')]=_0x4c05ce['id'];_0x19ef32[_0x91c6('0x4c')][_0x91c6('0x54')]=integrations[_0x91c6('0x55')](_0x19ef32[_0x91c6('0x4c')][_0x91c6('0x56')],_0x19ef32[_0x91c6('0x4c')]['type']);_0x19ef32['body'][_0x91c6('0x57')]=integrations[_0x91c6('0x58')](_0x19ef32['body'][_0x91c6('0x56')],_0x19ef32[_0x91c6('0x4c')][_0x91c6('0x30')]);return db[_0x91c6('0x4f')][_0x91c6('0x4b')](_0x19ef32['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x91c6('0x54')},{'model':db[_0x91c6('0x59')],'as':_0x91c6('0x57')}]});}return null;})['then'](respondWithResult(_0x37ca7c,null))[_0x91c6('0x46')](handleError(_0x37ca7c,null));};exports[_0x91c6('0x5a')]=function(_0x6e56fb,_0x5bfacf,_0x56baf6){var _0x21d3a4='';var _0x14f4c9='';return db[_0x91c6('0x2f')][_0x91c6('0x52')]({'where':{'id':_0x6e56fb['params']['id']},'attributes':['id',_0x91c6('0x5b'),_0x91c6('0x5c'),_0x91c6('0x5d')]})[_0x91c6('0x28')](handleEntityNotFound(_0x5bfacf,null))[_0x91c6('0x28')](function(_0x5019cf){if(_0x5019cf){_0x14f4c9=_0x5019cf['username'];_0x21d3a4=_0x5019cf[_0x91c6('0x5c')];var _0x56d7aa=_0x5019cf[_0x91c6('0x5c')][_0x91c6('0x5e')](-0x1);if(_0x56d7aa==='/'){_0x21d3a4=_0x21d3a4['substring'](0x0,_0x21d3a4[_0x91c6('0x5f')](_0x56d7aa));}return rp({'method':'GET','uri':util[_0x91c6('0x60')]('%s%s',_0x21d3a4,_0x91c6('0x61')),'headers':{'Authorization':'Token\x20token='+_0x5019cf[_0x91c6('0x5d')]},'json':!![]});}})[_0x91c6('0x28')](function(_0x9d3537){if(_0x9d3537){var _0x10114b=_0x9d3537['users'];var _0x10fc95=![];var _0x336337=null;for(_0x336337=0x0;_0x336337<_0x10114b['length'];_0x336337++){if(_0x10114b[_0x336337][_0x91c6('0x62')]===_0x14f4c9){_0x10fc95=!![];}}if(_0x10fc95){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x91c6('0x28')](respondWithResult(_0x5bfacf,null))[_0x91c6('0x46')](function(_0x3b5b73){var _0xa1c34b=_0x6e56fb['query'][_0x91c6('0x63')]?0x1f4:_0x3b5b73[_0x91c6('0x64')]||0x1f4;logger[_0x91c6('0x2a')](_0x91c6('0x65'),_0x91c6('0x5a'),_0xa1c34b,JSON[_0x91c6('0x66')](_0x3b5b73));delete _0x3b5b73[_0x91c6('0x2b')];if(_0xa1c34b===0x191){_0xa1c34b=0x190;}_0x5bfacf[_0x91c6('0x1d')](_0xa1c34b)['send'](_0x6e56fb[_0x91c6('0x33')]['test']?{'message':_0x91c6('0x67'),'statusCode':_0x3b5b73[_0x91c6('0x64')]}:_0x3b5b73);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6aeee5a..0aae957 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 _0xffd6=['path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4fc55b,_0xcfe664){var _0x4a0f37=function(_0x57d8b6){while(--_0x57d8b6){_0x4fc55b['push'](_0x4fc55b['shift']());}};_0x4a0f37(++_0xcfe664);}(_0xffd6,0x97));var _0x6ffd=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0xffd6[_0x5192de];return _0x4e287e;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var logger=require(_0x6ffd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ffd('0x3'));var rp=require(_0x6ffd('0x4'));var fs=require('fs');var path=require(_0x6ffd('0x5'));var rimraf=require('rimraf');var config=require(_0x6ffd('0x6'));var attributes=require(_0x6ffd('0x7'));var integrations=require(_0x6ffd('0x8'));module[_0x6ffd('0x9')]=function(_0x561055,_0x122b71){return _0x561055[_0x6ffd('0xa')](_0x6ffd('0xb'),attributes,{'tableName':_0x6ffd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ace=['request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x17a28d,_0x48bda8){_0x17a28d=_0x17a28d-0x0;var _0x636d2d=_0x8ace[_0x17a28d];return _0x636d2d;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));var integrations=require(_0xe8ac('0xb'));module[_0xe8ac('0xc')]=function(_0x2b48ec,_0x4eb087){return _0x2b48ec[_0xe8ac('0xd')](_0xe8ac('0xe'),attributes,{'tableName':'int_freshsales_accounts','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 403846a..1f99f53 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 _0x7ee1=['attributes','limit','include','map','model','info','ShowFreshsalesAccount','find','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7ee1,0x8d));var _0x17ee=function(_0x189a5a,_0x51c41e){_0x189a5a=_0x189a5a-0x0;var _0x22e5b7=_0x7ee1[_0x189a5a];return _0x22e5b7;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ee('0x1'));var fs=require('fs');var Redis=require(_0x17ee('0x2'));var db=require(_0x17ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x4'))(_0x17ee('0x5'));var config=require(_0x17ee('0x6'));var jayson=require(_0x17ee('0x7'));var client=jayson['client'][_0x17ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b9eb,_0x54b4f6,_0x3f61af){return new BPromise(function(_0x57e1d1,_0x3d767b){return client[_0x17ee('0x9')](_0x29b9eb,_0x3f61af)[_0x17ee('0xa')](function(_0x4af369){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x54b4f6,_0x17ee('0xb'));logger['debug'](_0x17ee('0xc'),_0x54b4f6,_0x17ee('0xb'),JSON[_0x17ee('0xd')](_0x4af369));if(_0x4af369[_0x17ee('0xe')]){if(_0x4af369['error'][_0x17ee('0xf')]===0x1f4){logger['error'](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x3d767b(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x57e1d1(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x54b4f6,'request\x20sent');_0x57e1d1(_0x4af369['result'][_0x17ee('0x11')]);}})[_0x17ee('0x12')](function(_0x1b87c3){logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x1b87c3);_0x3d767b(_0x1b87c3);});});}exports[_0x17ee('0x13')]=function(_0x63d27f){var _0x587ca7=this;return new Promise(function(_0x44fe58,_0x1118a3){return db[_0x17ee('0x14')][_0x17ee('0x15')]({'raw':_0x63d27f[_0x17ee('0x16')]?_0x63d27f['options'][_0x17ee('0x17')]===undefined?!![]:![]:!![],'where':_0x63d27f['options']?_0x63d27f[_0x17ee('0x16')]['where']||null:null,'attributes':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'limit':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x19')]||null:null,'include':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x63d27f[_0x17ee('0x16')]['include'],function(_0x4b7bfe){return{'model':db[_0x4b7bfe[_0x17ee('0x1c')]],'as':_0x4b7bfe['as'],'attributes':_0x4b7bfe[_0x17ee('0x18')],'include':_0x4b7bfe[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x4b7bfe[_0x17ee('0x1a')],function(_0xea358f){return{'model':db[_0xea358f[_0x17ee('0x1c')]],'as':_0xea358f['as'],'attributes':_0xea358f[_0x17ee('0x18')],'include':_0xea358f[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0xea358f[_0x17ee('0x1a')],function(_0x2a332f){return{'model':db[_0x2a332f['model']],'as':_0x2a332f['as'],'attributes':_0x2a332f[_0x17ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17ee('0xa')](function(_0x11ce7e){logger[_0x17ee('0x1d')](_0x17ee('0x13'),_0x63d27f);logger['debug'](_0x17ee('0x13'),_0x63d27f,JSON[_0x17ee('0xd')](_0x11ce7e));_0x44fe58(_0x11ce7e);})[_0x17ee('0x12')](function(_0x4c461b){logger[_0x17ee('0xe')](_0x17ee('0x13'),_0x4c461b['message'],_0x63d27f);_0x1118a3(_0x587ca7[_0x17ee('0xe')](0x1f4,_0x4c461b['message']));});});};exports[_0x17ee('0x1e')]=function(_0x5a44c4){var _0x141ac9=this;return new Promise(function(_0x23ca2e,_0x373c20){return db['FreshsalesAccount'][_0x17ee('0x1f')]({'raw':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4['options'][_0x17ee('0x17')]===undefined?!![]:![]:!![],'where':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4[_0x17ee('0x16')]['where']||null:null,'attributes':_0x5a44c4['options']?_0x5a44c4[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'include':_0x5a44c4[_0x17ee('0x16')]?_0x5a44c4[_0x17ee('0x16')]['include']?_['map'](_0x5a44c4[_0x17ee('0x16')][_0x17ee('0x1a')],function(_0x23578a){return{'model':db[_0x23578a[_0x17ee('0x1c')]],'as':_0x23578a['as'],'attributes':_0x23578a[_0x17ee('0x18')],'include':_0x23578a[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x23578a['include'],function(_0x4a6bc9){return{'model':db[_0x4a6bc9['model']],'as':_0x4a6bc9['as'],'attributes':_0x4a6bc9[_0x17ee('0x18')],'include':_0x4a6bc9['include']?_[_0x17ee('0x1b')](_0x4a6bc9[_0x17ee('0x1a')],function(_0xed7e8a){return{'model':db[_0xed7e8a['model']],'as':_0xed7e8a['as'],'attributes':_0xed7e8a[_0x17ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17ee('0xa')](function(_0x590d27){logger['info'](_0x17ee('0x1e'),_0x5a44c4);logger[_0x17ee('0x20')](_0x17ee('0x1e'),_0x5a44c4,JSON[_0x17ee('0xd')](_0x590d27));_0x23ca2e(_0x590d27);})[_0x17ee('0x12')](function(_0x5a2c08){logger['error'](_0x17ee('0x1e'),_0x5a2c08[_0x17ee('0x11')],_0x5a44c4);_0x373c20(_0x141ac9[_0x17ee('0xe')](0x1f4,_0x5a2c08[_0x17ee('0x11')]));});});}; \ No newline at end of file +var _0x687b=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','lodash','util','moment'];(function(_0x5c4196,_0x59a506){var _0x2001c7=function(_0x13af0a){while(--_0x13af0a){_0x5c4196['push'](_0x5c4196['shift']());}};_0x2001c7(++_0x59a506);}(_0x687b,0x14a));var _0xb687=function(_0xe7a4b5,_0x200412){_0xe7a4b5=_0xe7a4b5-0x0;var _0xe5bb55=_0x687b[_0xe7a4b5];return _0xe5bb55;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}exports[_0xb687('0x18')]=function(_0x30d370){var _0x5eb9b9=this;return new Promise(function(_0x48958d,_0x12eff1){return db[_0xb687('0x19')][_0xb687('0x1a')]({'raw':_0x30d370['options']?_0x30d370[_0xb687('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x30d370[_0xb687('0x1b')]?_0x30d370[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1d')]||null:null,'limit':_0x30d370['options']?_0x30d370[_0xb687('0x1b')][_0xb687('0x1e')]||null:null,'include':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x30d370[_0xb687('0x1b')][_0xb687('0x1f')],function(_0xbf6c58){return{'model':db[_0xbf6c58[_0xb687('0x21')]],'as':_0xbf6c58['as'],'attributes':_0xbf6c58[_0xb687('0x1d')],'include':_0xbf6c58[_0xb687('0x1f')]?_['map'](_0xbf6c58[_0xb687('0x1f')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x21')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1d')],'include':_0x129347[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x129347[_0xb687('0x1f')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x21')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3712cf){logger[_0xb687('0xd')](_0xb687('0x18'),_0x30d370);logger[_0xb687('0x10')](_0xb687('0x18'),_0x30d370,JSON[_0xb687('0x12')](_0x3712cf));_0x48958d(_0x3712cf);})['catch'](function(_0x28b69a){logger['error'](_0xb687('0x18'),_0x28b69a[_0xb687('0x15')],_0x30d370);_0x12eff1(_0x5eb9b9[_0xb687('0x13')](0x1f4,_0x28b69a[_0xb687('0x15')]));});});};exports[_0xb687('0x22')]=function(_0x43d20d){var _0xf1f0dd=this;return new Promise(function(_0x556815,_0x3da2be){return db[_0xb687('0x19')][_0xb687('0x23')]({'raw':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x24')]===undefined?!![]:![]:!![],'where':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')]['attributes']||null:null,'include':_0x43d20d['options']?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x43d20d[_0xb687('0x1b')]['include'],function(_0x4f0b28){return{'model':db[_0x4f0b28[_0xb687('0x21')]],'as':_0x4f0b28['as'],'attributes':_0x4f0b28[_0xb687('0x1d')],'include':_0x4f0b28['include']?_[_0xb687('0x20')](_0x4f0b28[_0xb687('0x1f')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x21')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x548b83[_0xb687('0x1f')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x21')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529b1a){logger[_0xb687('0xd')](_0xb687('0x22'),_0x43d20d);logger[_0xb687('0x10')]('ShowFreshsalesAccount',_0x43d20d,JSON[_0xb687('0x12')](_0x529b1a));_0x556815(_0x529b1a);})[_0xb687('0x17')](function(_0x1f1c88){logger[_0xb687('0x13')](_0xb687('0x22'),_0x1f1c88['message'],_0x43d20d);_0x3da2be(_0xf1f0dd[_0xb687('0x13')](0x1f4,_0x1f1c88[_0xb687('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index cbd1ff9..64d1b80 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 _0x8f71=['index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getFields','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated'];(function(_0x6020c7,_0x9ed152){var _0x2ea5cb=function(_0x509bce){while(--_0x509bce){_0x6020c7['push'](_0x6020c7['shift']());}};_0x2ea5cb(++_0x9ed152);}(_0x8f71,0x113));var _0x18f7=function(_0x372dd5,_0x23c1d5){_0x372dd5=_0x372dd5-0x0;var _0x3c935e=_0x8f71[_0x372dd5];return _0x3c935e;};'use strict';var multer=require(_0x18f7('0x0'));var util=require(_0x18f7('0x1'));var path=require(_0x18f7('0x2'));var timeout=require(_0x18f7('0x3'));var express=require(_0x18f7('0x4'));var router=express[_0x18f7('0x5')]();var fs_extra=require(_0x18f7('0x6'));var auth=require(_0x18f7('0x7'));var interaction=require(_0x18f7('0x8'));var config=require(_0x18f7('0x9'));var controller=require(_0x18f7('0xa'));router[_0x18f7('0xb')]('/',auth[_0x18f7('0xc')](),controller[_0x18f7('0xd')]);router['get'](_0x18f7('0xe'),auth[_0x18f7('0xc')](),controller['show']);router[_0x18f7('0xb')](_0x18f7('0xf'),auth[_0x18f7('0xc')](),controller[_0x18f7('0x10')]);router[_0x18f7('0xb')](_0x18f7('0x11'),auth[_0x18f7('0xc')](),controller['getDescriptions']);router[_0x18f7('0xb')]('/:id/fields',auth[_0x18f7('0xc')](),controller[_0x18f7('0x12')]);router[_0x18f7('0x13')]('/',auth['isAuthenticated'](),controller[_0x18f7('0x14')]);router['put'](_0x18f7('0xe'),auth['isAuthenticated'](),controller[_0x18f7('0x15')]);router[_0x18f7('0x16')]('/:id',auth[_0x18f7('0xc')](),controller[_0x18f7('0x17')]);module['exports']=router; \ No newline at end of file +var _0x1927=['index','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1927,0x19b));var _0x7192=function(_0x35cf05,_0x801e3a){_0x35cf05=_0x35cf05-0x0;var _0x57ca7c=_0x1927[_0x35cf05];return _0x57ca7c;};'use strict';var multer=require(_0x7192('0x0'));var util=require('util');var path=require(_0x7192('0x1'));var timeout=require(_0x7192('0x2'));var express=require('express');var router=express[_0x7192('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7192('0x4'));var config=require('../../config/environment');var controller=require(_0x7192('0x5'));router['get']('/',auth[_0x7192('0x6')](),controller[_0x7192('0x7')]);router[_0x7192('0x8')](_0x7192('0x9'),auth[_0x7192('0x6')](),controller[_0x7192('0xa')]);router[_0x7192('0x8')](_0x7192('0xb'),auth[_0x7192('0x6')](),controller['getSubjects']);router[_0x7192('0x8')](_0x7192('0xc'),auth[_0x7192('0x6')](),controller[_0x7192('0xd')]);router[_0x7192('0x8')](_0x7192('0xe'),auth[_0x7192('0x6')](),controller[_0x7192('0xf')]);router[_0x7192('0x10')]('/',auth[_0x7192('0x6')](),controller['create']);router[_0x7192('0x11')](_0x7192('0x9'),auth[_0x7192('0x6')](),controller[_0x7192('0x12')]);router[_0x7192('0x13')](_0x7192('0x9'),auth['isAuthenticated'](),controller[_0x7192('0x14')]);module[_0x7192('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d55db55..ae8e8f9 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 _0x76b6=['exports','STRING'];(function(_0x86e96f,_0x2ebc1b){var _0x335d08=function(_0x2773a4){while(--_0x2773a4){_0x86e96f['push'](_0x86e96f['shift']());}};_0x335d08(++_0x2ebc1b);}(_0x76b6,0x138));var _0x676b=function(_0x50d2d3,_0x4da9ee){_0x50d2d3=_0x50d2d3-0x0;var _0x12f6ac=_0x76b6[_0x50d2d3];return _0x12f6ac;};'use strict';var Sequelize=require('sequelize');module[_0x676b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x676b('0x1')]}}; \ No newline at end of file +var _0x4956=['sequelize','exports','STRING'];(function(_0x2125cb,_0x36b97d){var _0x586a38=function(_0x29b57d){while(--_0x29b57d){_0x2125cb['push'](_0x2125cb['shift']());}};_0x586a38(++_0x36b97d);}(_0x4956,0x1bf));var _0x6495=function(_0x82a062,_0x3d7838){_0x82a062=_0x82a062-0x0;var _0x11e753=_0x4956[_0x82a062];return _0x11e753;};'use strict';var Sequelize=require(_0x6495('0x0'));module[_0x6495('0x1')]={'name':{'type':Sequelize[_0x6495('0x2')]},'description':{'type':Sequelize[_0x6495('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0793496..196d2dc 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 _0x8456=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','destroy','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','body','update','params','getSubjects','findOne','FreshsalesField','pick','filter','getDescriptions','getFields','eml-format','rimraf'];(function(_0x171797,_0x1e596c){var _0x4c3dd4=function(_0xbdf365){while(--_0xbdf365){_0x171797['push'](_0x171797['shift']());}};_0x4c3dd4(++_0x1e596c);}(_0x8456,0x189));var _0x6845=function(_0x76dc95,_0x41df3e){_0x76dc95=_0x76dc95-0x0;var _0x124fb5=_0x8456[_0x76dc95];return _0x124fb5;};'use strict';var emlformat=require(_0x6845('0x0'));var rimraf=require(_0x6845('0x1'));var zipdir=require(_0x6845('0x2'));var jsonpatch=require(_0x6845('0x3'));var rp=require(_0x6845('0x4'));var moment=require(_0x6845('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6845('0x6'));var util=require(_0x6845('0x7'));var path=require('path');var sox=require(_0x6845('0x8'));var csv=require(_0x6845('0x9'));var ejs=require(_0x6845('0xa'));var fs=require('fs');var fs_extra=require(_0x6845('0xb'));var _=require(_0x6845('0xc'));var squel=require(_0x6845('0xd'));var crypto=require(_0x6845('0xe'));var jsforce=require(_0x6845('0xf'));var deskjs=require(_0x6845('0x10'));var toCsv=require(_0x6845('0x9'));var querystring=require('querystring');var Papa=require(_0x6845('0x11'));var Redis=require(_0x6845('0x12'));var authService=require(_0x6845('0x13'));var qs=require(_0x6845('0x14'));var as=require(_0x6845('0x15'));var hardwareService=require(_0x6845('0x16'));var logger=require('../../config/logger')(_0x6845('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6845('0x18'));var db=require(_0x6845('0x19'))['db'];function respondWithStatusCode(_0x14d296,_0x5d0961){_0x5d0961=_0x5d0961||0xcc;return function(_0x3898d3){if(_0x3898d3){return _0x14d296[_0x6845('0x1a')](_0x5d0961);}return _0x14d296[_0x6845('0x1b')](_0x5d0961)[_0x6845('0x1c')]();};}function respondWithResult(_0x1cb4ab,_0x1578d3){_0x1578d3=_0x1578d3||0xc8;return function(_0x3b544c){if(_0x3b544c){return _0x1cb4ab['status'](_0x1578d3)[_0x6845('0x1d')](_0x3b544c);}};}function respondWithFilteredResult(_0x58f9c1,_0x10f53d){return function(_0x4cc893){if(_0x4cc893){var _0x523424=typeof _0x10f53d['offset']===_0x6845('0x1e')&&typeof _0x10f53d[_0x6845('0x1f')]===_0x6845('0x1e');var _0x37f24d=_0x4cc893[_0x6845('0x20')];var _0x2a4525=_0x523424?0x0:_0x10f53d[_0x6845('0x21')];var _0x402889=_0x523424?_0x4cc893[_0x6845('0x20')]:_0x10f53d[_0x6845('0x21')]+_0x10f53d[_0x6845('0x1f')];var _0x2c9820;if(_0x402889>=_0x37f24d){_0x402889=_0x37f24d;_0x2c9820=0xc8;}else{_0x2c9820=0xce;}_0x58f9c1['status'](_0x2c9820);return _0x58f9c1['set'](_0x6845('0x22'),_0x2a4525+'-'+_0x402889+'/'+_0x37f24d)[_0x6845('0x1d')](_0x4cc893);}return null;};}function patchUpdates(_0x22267b){return function(_0x1942a0){try{jsonpatch[_0x6845('0x23')](_0x1942a0,_0x22267b,!![]);}catch(_0x307877){return BPromise['reject'](_0x307877);}return _0x1942a0['save']();};}function saveUpdates(_0x5abe40,_0x9f3979){return function(_0x55e5ba){if(_0x55e5ba){return _0x55e5ba['update'](_0x5abe40)['then'](function(_0x3edb7f){return _0x3edb7f;});}return null;};}function removeEntity(_0x500f5d,_0x2da7cd){return function(_0x1d493e){if(_0x1d493e){return _0x1d493e[_0x6845('0x24')]()[_0x6845('0x25')](function(){_0x500f5d[_0x6845('0x1b')](0xcc)[_0x6845('0x1c')]();});}};}function handleEntityNotFound(_0x51442f,_0x3c981d){return function(_0x18f070){if(!_0x18f070){_0x51442f[_0x6845('0x1a')](0x194);}return _0x18f070;};}function handleError(_0x544369,_0x3b52ea){_0x3b52ea=_0x3b52ea||0x1f4;return function(_0x480549){logger['error'](_0x480549[_0x6845('0x26')]);if(_0x480549[_0x6845('0x27')]){delete _0x480549['name'];}_0x544369[_0x6845('0x1b')](_0x3b52ea)[_0x6845('0x28')](_0x480549);};}exports[_0x6845('0x29')]=function(_0x52b340,_0x10d5f0){var _0x13e6cb={},_0x111a53={},_0x1880a4={'count':0x0,'rows':[]};var _0x3ed715=_[_0x6845('0x2a')](db[_0x6845('0x2b')][_0x6845('0x2c')],function(_0x4ac714){return{'name':_0x4ac714['fieldName'],'type':_0x4ac714[_0x6845('0x2d')][_0x6845('0x2e')]};});_0x111a53[_0x6845('0x2f')]=_['map'](_0x3ed715,_0x6845('0x27'));_0x111a53[_0x6845('0x30')]=_[_0x6845('0x31')](_0x52b340['query']);_0x111a53[_0x6845('0x32')]=_[_0x6845('0x33')](_0x111a53['model'],_0x111a53['query']);_0x13e6cb[_0x6845('0x34')]=_[_0x6845('0x33')](_0x111a53[_0x6845('0x2f')],qs['fields'](_0x52b340[_0x6845('0x30')][_0x6845('0x35')]));_0x13e6cb[_0x6845('0x34')]=_0x13e6cb[_0x6845('0x34')][_0x6845('0x36')]?_0x13e6cb[_0x6845('0x34')]:_0x111a53[_0x6845('0x2f')];if(!_0x52b340[_0x6845('0x30')][_0x6845('0x37')](_0x6845('0x38'))){_0x13e6cb[_0x6845('0x1f')]=qs[_0x6845('0x1f')](_0x52b340[_0x6845('0x30')][_0x6845('0x1f')]);_0x13e6cb['offset']=qs[_0x6845('0x21')](_0x52b340[_0x6845('0x30')][_0x6845('0x21')]);}_0x13e6cb[_0x6845('0x39')]=qs[_0x6845('0x3a')](_0x52b340['query'][_0x6845('0x3a')]);_0x13e6cb[_0x6845('0x3b')]=qs[_0x6845('0x32')](_['pick'](_0x52b340[_0x6845('0x30')],_0x111a53[_0x6845('0x32')]),_0x3ed715);if(_0x52b340[_0x6845('0x30')]['filter']){_0x13e6cb[_0x6845('0x3b')]=_[_0x6845('0x3c')](_0x13e6cb['where'],{'$or':_[_0x6845('0x2a')](_0x3ed715,function(_0x50d28f){if(_0x50d28f[_0x6845('0x2d')]!==_0x6845('0x3d')){var _0x3680de={};_0x3680de[_0x50d28f[_0x6845('0x27')]]={'$like':'%'+_0x52b340[_0x6845('0x30')]['filter']+'%'};return _0x3680de;}})});}_0x13e6cb=_['merge']({},_0x13e6cb,_0x52b340[_0x6845('0x3e')]);var _0xe6d0c6={'where':_0x13e6cb[_0x6845('0x3b')]};return db[_0x6845('0x2b')][_0x6845('0x20')](_0xe6d0c6)[_0x6845('0x25')](function(_0x1bbf43){_0x1880a4[_0x6845('0x20')]=_0x1bbf43;if(_0x52b340[_0x6845('0x30')]['includeAll']){_0x13e6cb[_0x6845('0x3f')]=[{'all':!![]}];}return db[_0x6845('0x2b')]['findAll'](_0x13e6cb);})[_0x6845('0x25')](function(_0x3b9364){_0x1880a4[_0x6845('0x40')]=_0x3b9364;return _0x1880a4;})['then'](respondWithFilteredResult(_0x10d5f0,_0x13e6cb))[_0x6845('0x41')](handleError(_0x10d5f0,null));};exports[_0x6845('0x42')]=function(_0x4471b1,_0x5406c4){var _0x545884={'raw':![],'where':{'id':_0x4471b1['params']['id']}},_0x28dde4={};_0x28dde4[_0x6845('0x2f')]=_[_0x6845('0x31')](db[_0x6845('0x2b')][_0x6845('0x2c')]);_0x28dde4[_0x6845('0x30')]=_[_0x6845('0x31')](_0x4471b1['query']);_0x28dde4[_0x6845('0x32')]=_[_0x6845('0x33')](_0x28dde4[_0x6845('0x2f')],_0x28dde4[_0x6845('0x30')]);_0x545884[_0x6845('0x34')]=_[_0x6845('0x33')](_0x28dde4[_0x6845('0x2f')],qs[_0x6845('0x35')](_0x4471b1[_0x6845('0x30')][_0x6845('0x35')]));_0x545884['attributes']=_0x545884[_0x6845('0x34')][_0x6845('0x36')]?_0x545884['attributes']:_0x28dde4[_0x6845('0x2f')];if(_0x4471b1[_0x6845('0x30')][_0x6845('0x43')]){_0x545884['include']=[{'all':!![]}];}_0x545884=_[_0x6845('0x3c')]({},_0x545884,_0x4471b1['options']);return db[_0x6845('0x2b')][_0x6845('0x44')](_0x545884)['then'](handleEntityNotFound(_0x5406c4,null))[_0x6845('0x25')](respondWithResult(_0x5406c4,null))[_0x6845('0x41')](handleError(_0x5406c4,null));};exports['create']=function(_0x42b053,_0x14425b){return db[_0x6845('0x2b')]['create'](_0x42b053[_0x6845('0x45')],{})[_0x6845('0x25')](respondWithResult(_0x14425b,0xc9))[_0x6845('0x41')](handleError(_0x14425b,null));};exports[_0x6845('0x46')]=function(_0x2c3745,_0x56ccbd){if(_0x2c3745[_0x6845('0x45')]['id']){delete _0x2c3745['body']['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x2c3745[_0x6845('0x47')]['id']}})['then'](handleEntityNotFound(_0x56ccbd,null))[_0x6845('0x25')](saveUpdates(_0x2c3745[_0x6845('0x45')],null))['then'](respondWithResult(_0x56ccbd,null))[_0x6845('0x41')](handleError(_0x56ccbd,null));};exports[_0x6845('0x24')]=function(_0x1110ee,_0x4da8ed){return db[_0x6845('0x2b')][_0x6845('0x44')]({'where':{'id':_0x1110ee[_0x6845('0x47')]['id']}})[_0x6845('0x25')](handleEntityNotFound(_0x4da8ed,null))[_0x6845('0x25')](removeEntity(_0x4da8ed,null))[_0x6845('0x41')](handleError(_0x4da8ed,null));};exports[_0x6845('0x48')]=function(_0x3dc34a,_0x60178e,_0xcfc1f2){var _0x4d80c2={};var _0x1a7d5f={};var _0x1e56ce;var _0x15a3d8;return db[_0x6845('0x2b')][_0x6845('0x49')]({'where':{'id':_0x3dc34a[_0x6845('0x47')]['id']}})[_0x6845('0x25')](handleEntityNotFound(_0x60178e,null))[_0x6845('0x25')](function(_0x2faef4){if(_0x2faef4){_0x1e56ce=_0x2faef4;_0x1a7d5f[_0x6845('0x2f')]=_[_0x6845('0x31')](db[_0x6845('0x4a')]['rawAttributes']);_0x1a7d5f[_0x6845('0x30')]=_[_0x6845('0x31')](_0x3dc34a['query']);_0x1a7d5f['filters']=_[_0x6845('0x33')](_0x1a7d5f[_0x6845('0x2f')],_0x1a7d5f[_0x6845('0x30')]);_0x4d80c2[_0x6845('0x34')]=_['intersection'](_0x1a7d5f[_0x6845('0x2f')],qs['fields'](_0x3dc34a['query'][_0x6845('0x35')]));_0x4d80c2[_0x6845('0x34')]=_0x4d80c2['attributes'][_0x6845('0x36')]?_0x4d80c2[_0x6845('0x34')]:_0x1a7d5f[_0x6845('0x2f')];_0x4d80c2[_0x6845('0x39')]=qs[_0x6845('0x3a')](_0x3dc34a[_0x6845('0x30')]['sort']);_0x4d80c2[_0x6845('0x3b')]=qs[_0x6845('0x32')](_[_0x6845('0x4b')](_0x3dc34a[_0x6845('0x30')],_0x1a7d5f[_0x6845('0x32')]));if(_0x3dc34a[_0x6845('0x30')][_0x6845('0x4c')]){_0x4d80c2[_0x6845('0x3b')]=_[_0x6845('0x3c')](_0x4d80c2[_0x6845('0x3b')],{'$or':_[_0x6845('0x2a')](_0x4d80c2[_0x6845('0x34')],function(_0x1ee3dc){var _0x53756f={};_0x53756f[_0x1ee3dc]={'$like':'%'+_0x3dc34a[_0x6845('0x30')]['filter']+'%'};return _0x53756f;})});}_0x4d80c2=_['merge']({},_0x4d80c2,_0x3dc34a[_0x6845('0x3e')]);return _0x1e56ce[_0x6845('0x48')](_0x4d80c2);}})[_0x6845('0x25')](function(_0x170264){if(_0x170264){_0x15a3d8=_0x170264[_0x6845('0x36')];if(!_0x3dc34a[_0x6845('0x30')][_0x6845('0x37')]('nolimit')){_0x4d80c2[_0x6845('0x1f')]=qs['limit'](_0x3dc34a['query'][_0x6845('0x1f')]);_0x4d80c2[_0x6845('0x21')]=qs[_0x6845('0x21')](_0x3dc34a[_0x6845('0x30')][_0x6845('0x21')]);}return _0x1e56ce[_0x6845('0x48')](_0x4d80c2);}})[_0x6845('0x25')](function(_0x7720cb){if(_0x7720cb){return _0x7720cb?{'count':_0x15a3d8,'rows':_0x7720cb}:null;}})[_0x6845('0x25')](respondWithResult(_0x60178e,null))['catch'](handleError(_0x60178e,null));};exports[_0x6845('0x4d')]=function(_0x54b7d2,_0xc95f0f,_0x25cf53){var _0x3b53ba={};var _0x4f3e18={};var _0x41b347;var _0x206cc6;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x54b7d2[_0x6845('0x47')]['id']}})['then'](handleEntityNotFound(_0xc95f0f,null))[_0x6845('0x25')](function(_0x4c1e95){if(_0x4c1e95){_0x41b347=_0x4c1e95;_0x4f3e18['model']=_[_0x6845('0x31')](db[_0x6845('0x4a')]['rawAttributes']);_0x4f3e18[_0x6845('0x30')]=_[_0x6845('0x31')](_0x54b7d2[_0x6845('0x30')]);_0x4f3e18['filters']=_[_0x6845('0x33')](_0x4f3e18['model'],_0x4f3e18[_0x6845('0x30')]);_0x3b53ba[_0x6845('0x34')]=_[_0x6845('0x33')](_0x4f3e18[_0x6845('0x2f')],qs[_0x6845('0x35')](_0x54b7d2[_0x6845('0x30')][_0x6845('0x35')]));_0x3b53ba[_0x6845('0x34')]=_0x3b53ba[_0x6845('0x34')][_0x6845('0x36')]?_0x3b53ba[_0x6845('0x34')]:_0x4f3e18[_0x6845('0x2f')];_0x3b53ba['order']=qs[_0x6845('0x3a')](_0x54b7d2[_0x6845('0x30')][_0x6845('0x3a')]);_0x3b53ba['where']=qs['filters'](_[_0x6845('0x4b')](_0x54b7d2[_0x6845('0x30')],_0x4f3e18[_0x6845('0x32')]));if(_0x54b7d2[_0x6845('0x30')][_0x6845('0x4c')]){_0x3b53ba[_0x6845('0x3b')]=_[_0x6845('0x3c')](_0x3b53ba[_0x6845('0x3b')],{'$or':_['map'](_0x3b53ba[_0x6845('0x34')],function(_0x50a9ff){var _0x4e7ad3={};_0x4e7ad3[_0x50a9ff]={'$like':'%'+_0x54b7d2[_0x6845('0x30')][_0x6845('0x4c')]+'%'};return _0x4e7ad3;})});}_0x3b53ba=_[_0x6845('0x3c')]({},_0x3b53ba,_0x54b7d2[_0x6845('0x3e')]);return _0x41b347['getDescriptions'](_0x3b53ba);}})[_0x6845('0x25')](function(_0x543ad3){if(_0x543ad3){_0x206cc6=_0x543ad3[_0x6845('0x36')];if(!_0x54b7d2[_0x6845('0x30')][_0x6845('0x37')](_0x6845('0x38'))){_0x3b53ba[_0x6845('0x1f')]=qs['limit'](_0x54b7d2[_0x6845('0x30')][_0x6845('0x1f')]);_0x3b53ba[_0x6845('0x21')]=qs[_0x6845('0x21')](_0x54b7d2['query'][_0x6845('0x21')]);}return _0x41b347[_0x6845('0x4d')](_0x3b53ba);}})['then'](function(_0x186a85){if(_0x186a85){return _0x186a85?{'count':_0x206cc6,'rows':_0x186a85}:null;}})[_0x6845('0x25')](respondWithResult(_0xc95f0f,null))[_0x6845('0x41')](handleError(_0xc95f0f,null));};exports[_0x6845('0x4e')]=function(_0x10c896,_0x2efed4,_0x7d09f8){var _0xb49361={};var _0x237d03={};var _0x313a27;var _0x2ed53f;return db[_0x6845('0x2b')]['findOne']({'where':{'id':_0x10c896['params']['id']}})[_0x6845('0x25')](handleEntityNotFound(_0x2efed4,null))['then'](function(_0x50f5eb){if(_0x50f5eb){_0x313a27=_0x50f5eb;_0x237d03['model']=_[_0x6845('0x31')](db[_0x6845('0x4a')][_0x6845('0x2c')]);_0x237d03['query']=_[_0x6845('0x31')](_0x10c896[_0x6845('0x30')]);_0x237d03[_0x6845('0x32')]=_[_0x6845('0x33')](_0x237d03['model'],_0x237d03['query']);_0xb49361[_0x6845('0x34')]=_['intersection'](_0x237d03[_0x6845('0x2f')],qs[_0x6845('0x35')](_0x10c896[_0x6845('0x30')][_0x6845('0x35')]));_0xb49361[_0x6845('0x34')]=_0xb49361[_0x6845('0x34')]['length']?_0xb49361[_0x6845('0x34')]:_0x237d03[_0x6845('0x2f')];_0xb49361['order']=qs[_0x6845('0x3a')](_0x10c896[_0x6845('0x30')][_0x6845('0x3a')]);_0xb49361[_0x6845('0x3b')]=qs[_0x6845('0x32')](_[_0x6845('0x4b')](_0x10c896[_0x6845('0x30')],_0x237d03[_0x6845('0x32')]));if(_0x10c896[_0x6845('0x30')][_0x6845('0x4c')]){_0xb49361['where']=_['merge'](_0xb49361[_0x6845('0x3b')],{'$or':_['map'](_0xb49361[_0x6845('0x34')],function(_0x3e7cd1){var _0x80f096={};_0x80f096[_0x3e7cd1]={'$like':'%'+_0x10c896['query'][_0x6845('0x4c')]+'%'};return _0x80f096;})});}_0xb49361=_[_0x6845('0x3c')]({},_0xb49361,_0x10c896['options']);return _0x313a27[_0x6845('0x4e')](_0xb49361);}})[_0x6845('0x25')](function(_0x1f73a7){if(_0x1f73a7){_0x2ed53f=_0x1f73a7['length'];if(!_0x10c896['query'][_0x6845('0x37')]('nolimit')){_0xb49361['limit']=qs['limit'](_0x10c896[_0x6845('0x30')][_0x6845('0x1f')]);_0xb49361[_0x6845('0x21')]=qs['offset'](_0x10c896[_0x6845('0x30')][_0x6845('0x21')]);}return _0x313a27['getFields'](_0xb49361);}})['then'](function(_0x1eaa26){if(_0x1eaa26){return _0x1eaa26?{'count':_0x2ed53f,'rows':_0x1eaa26}:null;}})[_0x6845('0x25')](respondWithResult(_0x2efed4,null))[_0x6845('0x41')](handleError(_0x2efed4,null));}; \ No newline at end of file +var _0x43f9=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','FreshsalesConfiguration','include','rows','catch','show','params','length','includeAll','find','create','body','update','getSubjects','nolimit','getDescriptions','findOne','FreshsalesField','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then'];(function(_0x14aeba,_0x3cfee9){var _0x195273=function(_0x102565){while(--_0x102565){_0x14aeba['push'](_0x14aeba['shift']());}};_0x195273(++_0x3cfee9);}(_0x43f9,0x167));var _0x943f=function(_0x2b51c9,_0xad42a4){_0x2b51c9=_0x2b51c9-0x0;var _0x25b347=_0x43f9[_0x2b51c9];return _0x25b347;};'use strict';var emlformat=require(_0x943f('0x0'));var rimraf=require(_0x943f('0x1'));var zipdir=require(_0x943f('0x2'));var jsonpatch=require(_0x943f('0x3'));var rp=require(_0x943f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x943f('0x5'));var util=require(_0x943f('0x6'));var path=require(_0x943f('0x7'));var sox=require(_0x943f('0x8'));var csv=require(_0x943f('0x9'));var ejs=require(_0x943f('0xa'));var fs=require('fs');var fs_extra=require(_0x943f('0xb'));var _=require(_0x943f('0xc'));var squel=require(_0x943f('0xd'));var crypto=require('crypto');var jsforce=require(_0x943f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x943f('0x9'));var querystring=require(_0x943f('0xf'));var Papa=require(_0x943f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x943f('0x11'));var hardwareService=require(_0x943f('0x12'));var logger=require('../../config/logger')(_0x943f('0x13'));var utils=require('../../config/utils');var config=require(_0x943f('0x14'));var licenseUtil=require(_0x943f('0x15'));var db=require(_0x943f('0x16'))['db'];function respondWithStatusCode(_0x59c883,_0x3bfcbc){_0x3bfcbc=_0x3bfcbc||0xcc;return function(_0x12c7ee){if(_0x12c7ee){return _0x59c883[_0x943f('0x17')](_0x3bfcbc);}return _0x59c883[_0x943f('0x18')](_0x3bfcbc)[_0x943f('0x19')]();};}function respondWithResult(_0x14a65e,_0x50bf67){_0x50bf67=_0x50bf67||0xc8;return function(_0x284a7d){if(_0x284a7d){return _0x14a65e[_0x943f('0x18')](_0x50bf67)[_0x943f('0x1a')](_0x284a7d);}};}function respondWithFilteredResult(_0x4395b8,_0x333e25){return function(_0x1a2456){if(_0x1a2456){var _0x56851b=typeof _0x333e25[_0x943f('0x1b')]===_0x943f('0x1c')&&typeof _0x333e25[_0x943f('0x1d')]==='undefined';var _0x5d4b6e=_0x1a2456[_0x943f('0x1e')];var _0x49c0b2=_0x56851b?0x0:_0x333e25['offset'];var _0x318073=_0x56851b?_0x1a2456[_0x943f('0x1e')]:_0x333e25[_0x943f('0x1b')]+_0x333e25[_0x943f('0x1d')];var _0x230d4f;if(_0x318073>=_0x5d4b6e){_0x318073=_0x5d4b6e;_0x230d4f=0xc8;}else{_0x230d4f=0xce;}_0x4395b8[_0x943f('0x18')](_0x230d4f);return _0x4395b8['set'](_0x943f('0x1f'),_0x49c0b2+'-'+_0x318073+'/'+_0x5d4b6e)[_0x943f('0x1a')](_0x1a2456);}return null;};}function patchUpdates(_0x2ecb13){return function(_0xb3cec4){try{jsonpatch[_0x943f('0x20')](_0xb3cec4,_0x2ecb13,!![]);}catch(_0x444ecf){return BPromise[_0x943f('0x21')](_0x444ecf);}return _0xb3cec4[_0x943f('0x22')]();};}function saveUpdates(_0x323ef6,_0x3f93aa){return function(_0x3d949b){if(_0x3d949b){return _0x3d949b['update'](_0x323ef6)[_0x943f('0x23')](function(_0x31309c){return _0x31309c;});}return null;};}function removeEntity(_0x4a8072,_0x3f9907){return function(_0x3f57c){if(_0x3f57c){return _0x3f57c[_0x943f('0x24')]()[_0x943f('0x23')](function(){_0x4a8072[_0x943f('0x18')](0xcc)[_0x943f('0x19')]();});}};}function handleEntityNotFound(_0x9cfcec,_0x362e41){return function(_0x1d39d6){if(!_0x1d39d6){_0x9cfcec[_0x943f('0x17')](0x194);}return _0x1d39d6;};}function handleError(_0x1103e8,_0x4c2ce9){_0x4c2ce9=_0x4c2ce9||0x1f4;return function(_0x3a3bac){logger[_0x943f('0x25')](_0x3a3bac[_0x943f('0x26')]);if(_0x3a3bac['name']){delete _0x3a3bac[_0x943f('0x27')];}_0x1103e8[_0x943f('0x18')](_0x4c2ce9)[_0x943f('0x28')](_0x3a3bac);};}exports[_0x943f('0x29')]=function(_0x5add85,_0x18b434){var _0x13ff09={},_0x254ac0={},_0x504509={'count':0x0,'rows':[]};var _0x16a877=_[_0x943f('0x2a')](db['FreshsalesConfiguration'][_0x943f('0x2b')],function(_0x139f43){return{'name':_0x139f43[_0x943f('0x2c')],'type':_0x139f43[_0x943f('0x2d')]['key']};});_0x254ac0['model']=_[_0x943f('0x2a')](_0x16a877,_0x943f('0x27'));_0x254ac0[_0x943f('0x2e')]=_[_0x943f('0x2f')](_0x5add85[_0x943f('0x2e')]);_0x254ac0[_0x943f('0x30')]=_[_0x943f('0x31')](_0x254ac0[_0x943f('0x32')],_0x254ac0['query']);_0x13ff09[_0x943f('0x33')]=_[_0x943f('0x31')](_0x254ac0[_0x943f('0x32')],qs[_0x943f('0x34')](_0x5add85[_0x943f('0x2e')][_0x943f('0x34')]));_0x13ff09['attributes']=_0x13ff09[_0x943f('0x33')]['length']?_0x13ff09[_0x943f('0x33')]:_0x254ac0[_0x943f('0x32')];if(!_0x5add85[_0x943f('0x2e')][_0x943f('0x35')]('nolimit')){_0x13ff09[_0x943f('0x1d')]=qs[_0x943f('0x1d')](_0x5add85[_0x943f('0x2e')][_0x943f('0x1d')]);_0x13ff09[_0x943f('0x1b')]=qs['offset'](_0x5add85[_0x943f('0x2e')][_0x943f('0x1b')]);}_0x13ff09[_0x943f('0x36')]=qs[_0x943f('0x37')](_0x5add85[_0x943f('0x2e')][_0x943f('0x37')]);_0x13ff09['where']=qs['filters'](_['pick'](_0x5add85[_0x943f('0x2e')],_0x254ac0[_0x943f('0x30')]),_0x16a877);if(_0x5add85[_0x943f('0x2e')][_0x943f('0x38')]){_0x13ff09[_0x943f('0x39')]=_[_0x943f('0x3a')](_0x13ff09[_0x943f('0x39')],{'$or':_['map'](_0x16a877,function(_0x5ccf26){if(_0x5ccf26['type']!=='VIRTUAL'){var _0x501a28={};_0x501a28[_0x5ccf26[_0x943f('0x27')]]={'$like':'%'+_0x5add85['query'][_0x943f('0x38')]+'%'};return _0x501a28;}})});}_0x13ff09=_[_0x943f('0x3a')]({},_0x13ff09,_0x5add85[_0x943f('0x3b')]);var _0x27e303={'where':_0x13ff09[_0x943f('0x39')]};return db[_0x943f('0x3c')][_0x943f('0x1e')](_0x27e303)[_0x943f('0x23')](function(_0xc8c115){_0x504509[_0x943f('0x1e')]=_0xc8c115;if(_0x5add85[_0x943f('0x2e')]['includeAll']){_0x13ff09[_0x943f('0x3d')]=[{'all':!![]}];}return db[_0x943f('0x3c')]['findAll'](_0x13ff09);})[_0x943f('0x23')](function(_0x1859ff){_0x504509[_0x943f('0x3e')]=_0x1859ff;return _0x504509;})['then'](respondWithFilteredResult(_0x18b434,_0x13ff09))[_0x943f('0x3f')](handleError(_0x18b434,null));};exports[_0x943f('0x40')]=function(_0x1d6591,_0x5b05ab){var _0x1ca1ec={'raw':![],'where':{'id':_0x1d6591[_0x943f('0x41')]['id']}},_0x51f200={};_0x51f200[_0x943f('0x32')]=_['keys'](db[_0x943f('0x3c')][_0x943f('0x2b')]);_0x51f200['query']=_[_0x943f('0x2f')](_0x1d6591['query']);_0x51f200[_0x943f('0x30')]=_[_0x943f('0x31')](_0x51f200[_0x943f('0x32')],_0x51f200[_0x943f('0x2e')]);_0x1ca1ec['attributes']=_['intersection'](_0x51f200[_0x943f('0x32')],qs[_0x943f('0x34')](_0x1d6591[_0x943f('0x2e')][_0x943f('0x34')]));_0x1ca1ec[_0x943f('0x33')]=_0x1ca1ec[_0x943f('0x33')][_0x943f('0x42')]?_0x1ca1ec[_0x943f('0x33')]:_0x51f200[_0x943f('0x32')];if(_0x1d6591[_0x943f('0x2e')][_0x943f('0x43')]){_0x1ca1ec['include']=[{'all':!![]}];}_0x1ca1ec=_['merge']({},_0x1ca1ec,_0x1d6591[_0x943f('0x3b')]);return db[_0x943f('0x3c')][_0x943f('0x44')](_0x1ca1ec)[_0x943f('0x23')](handleEntityNotFound(_0x5b05ab,null))[_0x943f('0x23')](respondWithResult(_0x5b05ab,null))[_0x943f('0x3f')](handleError(_0x5b05ab,null));};exports[_0x943f('0x45')]=function(_0x4c2dbd,_0x2cd329){return db['FreshsalesConfiguration'][_0x943f('0x45')](_0x4c2dbd[_0x943f('0x46')],{})[_0x943f('0x23')](respondWithResult(_0x2cd329,0xc9))[_0x943f('0x3f')](handleError(_0x2cd329,null));};exports[_0x943f('0x47')]=function(_0xe74013,_0x267834){if(_0xe74013[_0x943f('0x46')]['id']){delete _0xe74013[_0x943f('0x46')]['id'];}return db[_0x943f('0x3c')][_0x943f('0x44')]({'where':{'id':_0xe74013[_0x943f('0x41')]['id']}})[_0x943f('0x23')](handleEntityNotFound(_0x267834,null))[_0x943f('0x23')](saveUpdates(_0xe74013[_0x943f('0x46')],null))[_0x943f('0x23')](respondWithResult(_0x267834,null))[_0x943f('0x3f')](handleError(_0x267834,null));};exports[_0x943f('0x24')]=function(_0x19ce7d,_0x1c9c48){return db[_0x943f('0x3c')][_0x943f('0x44')]({'where':{'id':_0x19ce7d[_0x943f('0x41')]['id']}})[_0x943f('0x23')](handleEntityNotFound(_0x1c9c48,null))[_0x943f('0x23')](removeEntity(_0x1c9c48,null))['catch'](handleError(_0x1c9c48,null));};exports['getSubjects']=function(_0x3cce77,_0x200221,_0x44dabd){var _0x9c9234={};var _0x92c320={};var _0x13998;var _0x29bebb;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3cce77[_0x943f('0x41')]['id']}})['then'](handleEntityNotFound(_0x200221,null))[_0x943f('0x23')](function(_0x33c38e){if(_0x33c38e){_0x13998=_0x33c38e;_0x92c320['model']=_[_0x943f('0x2f')](db['FreshsalesField'][_0x943f('0x2b')]);_0x92c320[_0x943f('0x2e')]=_[_0x943f('0x2f')](_0x3cce77[_0x943f('0x2e')]);_0x92c320[_0x943f('0x30')]=_[_0x943f('0x31')](_0x92c320[_0x943f('0x32')],_0x92c320[_0x943f('0x2e')]);_0x9c9234[_0x943f('0x33')]=_[_0x943f('0x31')](_0x92c320[_0x943f('0x32')],qs[_0x943f('0x34')](_0x3cce77[_0x943f('0x2e')][_0x943f('0x34')]));_0x9c9234[_0x943f('0x33')]=_0x9c9234[_0x943f('0x33')]['length']?_0x9c9234[_0x943f('0x33')]:_0x92c320[_0x943f('0x32')];_0x9c9234[_0x943f('0x36')]=qs[_0x943f('0x37')](_0x3cce77[_0x943f('0x2e')][_0x943f('0x37')]);_0x9c9234[_0x943f('0x39')]=qs[_0x943f('0x30')](_['pick'](_0x3cce77[_0x943f('0x2e')],_0x92c320['filters']));if(_0x3cce77['query'][_0x943f('0x38')]){_0x9c9234['where']=_['merge'](_0x9c9234[_0x943f('0x39')],{'$or':_[_0x943f('0x2a')](_0x9c9234[_0x943f('0x33')],function(_0x132ef2){var _0x4cecc2={};_0x4cecc2[_0x132ef2]={'$like':'%'+_0x3cce77[_0x943f('0x2e')][_0x943f('0x38')]+'%'};return _0x4cecc2;})});}_0x9c9234=_[_0x943f('0x3a')]({},_0x9c9234,_0x3cce77[_0x943f('0x3b')]);return _0x13998[_0x943f('0x48')](_0x9c9234);}})[_0x943f('0x23')](function(_0x5e17a9){if(_0x5e17a9){_0x29bebb=_0x5e17a9[_0x943f('0x42')];if(!_0x3cce77[_0x943f('0x2e')]['hasOwnProperty'](_0x943f('0x49'))){_0x9c9234[_0x943f('0x1d')]=qs[_0x943f('0x1d')](_0x3cce77[_0x943f('0x2e')][_0x943f('0x1d')]);_0x9c9234[_0x943f('0x1b')]=qs[_0x943f('0x1b')](_0x3cce77[_0x943f('0x2e')][_0x943f('0x1b')]);}return _0x13998[_0x943f('0x48')](_0x9c9234);}})[_0x943f('0x23')](function(_0x1dcb01){if(_0x1dcb01){return _0x1dcb01?{'count':_0x29bebb,'rows':_0x1dcb01}:null;}})[_0x943f('0x23')](respondWithResult(_0x200221,null))[_0x943f('0x3f')](handleError(_0x200221,null));};exports[_0x943f('0x4a')]=function(_0x3ddb70,_0x48ad83,_0x30af4e){var _0x1d4239={};var _0x103e25={};var _0x1dd935;var _0x13dad7;return db[_0x943f('0x3c')][_0x943f('0x4b')]({'where':{'id':_0x3ddb70['params']['id']}})[_0x943f('0x23')](handleEntityNotFound(_0x48ad83,null))['then'](function(_0x442b3c){if(_0x442b3c){_0x1dd935=_0x442b3c;_0x103e25[_0x943f('0x32')]=_[_0x943f('0x2f')](db[_0x943f('0x4c')]['rawAttributes']);_0x103e25[_0x943f('0x2e')]=_[_0x943f('0x2f')](_0x3ddb70[_0x943f('0x2e')]);_0x103e25[_0x943f('0x30')]=_[_0x943f('0x31')](_0x103e25['model'],_0x103e25[_0x943f('0x2e')]);_0x1d4239[_0x943f('0x33')]=_['intersection'](_0x103e25[_0x943f('0x32')],qs[_0x943f('0x34')](_0x3ddb70[_0x943f('0x2e')][_0x943f('0x34')]));_0x1d4239[_0x943f('0x33')]=_0x1d4239[_0x943f('0x33')][_0x943f('0x42')]?_0x1d4239['attributes']:_0x103e25[_0x943f('0x32')];_0x1d4239[_0x943f('0x36')]=qs['sort'](_0x3ddb70['query']['sort']);_0x1d4239[_0x943f('0x39')]=qs['filters'](_[_0x943f('0x4d')](_0x3ddb70[_0x943f('0x2e')],_0x103e25[_0x943f('0x30')]));if(_0x3ddb70[_0x943f('0x2e')]['filter']){_0x1d4239[_0x943f('0x39')]=_[_0x943f('0x3a')](_0x1d4239[_0x943f('0x39')],{'$or':_[_0x943f('0x2a')](_0x1d4239[_0x943f('0x33')],function(_0x832cc4){var _0x102275={};_0x102275[_0x832cc4]={'$like':'%'+_0x3ddb70[_0x943f('0x2e')]['filter']+'%'};return _0x102275;})});}_0x1d4239=_[_0x943f('0x3a')]({},_0x1d4239,_0x3ddb70[_0x943f('0x3b')]);return _0x1dd935[_0x943f('0x4a')](_0x1d4239);}})[_0x943f('0x23')](function(_0x485036){if(_0x485036){_0x13dad7=_0x485036[_0x943f('0x42')];if(!_0x3ddb70['query'][_0x943f('0x35')](_0x943f('0x49'))){_0x1d4239['limit']=qs[_0x943f('0x1d')](_0x3ddb70['query'][_0x943f('0x1d')]);_0x1d4239[_0x943f('0x1b')]=qs[_0x943f('0x1b')](_0x3ddb70['query']['offset']);}return _0x1dd935[_0x943f('0x4a')](_0x1d4239);}})[_0x943f('0x23')](function(_0x152529){if(_0x152529){return _0x152529?{'count':_0x13dad7,'rows':_0x152529}:null;}})[_0x943f('0x23')](respondWithResult(_0x48ad83,null))[_0x943f('0x3f')](handleError(_0x48ad83,null));};exports[_0x943f('0x4e')]=function(_0x4025e5,_0x585c98,_0x3d5460){var _0x567454={};var _0x55263b={};var _0x263107;var _0x27ed93;return db['FreshsalesConfiguration'][_0x943f('0x4b')]({'where':{'id':_0x4025e5[_0x943f('0x41')]['id']}})[_0x943f('0x23')](handleEntityNotFound(_0x585c98,null))[_0x943f('0x23')](function(_0x49a8fa){if(_0x49a8fa){_0x263107=_0x49a8fa;_0x55263b['model']=_[_0x943f('0x2f')](db['FreshsalesField']['rawAttributes']);_0x55263b['query']=_[_0x943f('0x2f')](_0x4025e5[_0x943f('0x2e')]);_0x55263b[_0x943f('0x30')]=_['intersection'](_0x55263b[_0x943f('0x32')],_0x55263b['query']);_0x567454[_0x943f('0x33')]=_['intersection'](_0x55263b['model'],qs[_0x943f('0x34')](_0x4025e5[_0x943f('0x2e')]['fields']));_0x567454[_0x943f('0x33')]=_0x567454[_0x943f('0x33')]['length']?_0x567454[_0x943f('0x33')]:_0x55263b[_0x943f('0x32')];_0x567454[_0x943f('0x36')]=qs['sort'](_0x4025e5[_0x943f('0x2e')]['sort']);_0x567454[_0x943f('0x39')]=qs[_0x943f('0x30')](_['pick'](_0x4025e5[_0x943f('0x2e')],_0x55263b[_0x943f('0x30')]));if(_0x4025e5[_0x943f('0x2e')][_0x943f('0x38')]){_0x567454[_0x943f('0x39')]=_['merge'](_0x567454['where'],{'$or':_[_0x943f('0x2a')](_0x567454[_0x943f('0x33')],function(_0x1ee1c9){var _0x5a066b={};_0x5a066b[_0x1ee1c9]={'$like':'%'+_0x4025e5[_0x943f('0x2e')][_0x943f('0x38')]+'%'};return _0x5a066b;})});}_0x567454=_['merge']({},_0x567454,_0x4025e5[_0x943f('0x3b')]);return _0x263107[_0x943f('0x4e')](_0x567454);}})[_0x943f('0x23')](function(_0x1b8fcb){if(_0x1b8fcb){_0x27ed93=_0x1b8fcb['length'];if(!_0x4025e5[_0x943f('0x2e')][_0x943f('0x35')](_0x943f('0x49'))){_0x567454[_0x943f('0x1d')]=qs[_0x943f('0x1d')](_0x4025e5[_0x943f('0x2e')][_0x943f('0x1d')]);_0x567454['offset']=qs[_0x943f('0x1b')](_0x4025e5['query'][_0x943f('0x1b')]);}return _0x263107['getFields'](_0x567454);}})[_0x943f('0x23')](function(_0x5cfd6c){if(_0x5cfd6c){return _0x5cfd6c?{'count':_0x27ed93,'rows':_0x5cfd6c}:null;}})[_0x943f('0x23')](respondWithResult(_0x585c98,null))['catch'](handleError(_0x585c98,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 4d44522..d2a0388 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 _0x3c1c=['define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x18df07,_0x23e441){var _0xe4eab9=function(_0x29e5ae){while(--_0x29e5ae){_0x18df07['push'](_0x18df07['shift']());}};_0xe4eab9(++_0x23e441);}(_0x3c1c,0xd4));var _0xc3c1=function(_0x79b53e,_0x108f8d){_0x79b53e=_0x79b53e-0x0;var _0x2d4d6c=_0x3c1c[_0x79b53e];return _0x2d4d6c;};'use strict';var _=require(_0xc3c1('0x0'));var util=require(_0xc3c1('0x1'));var logger=require(_0xc3c1('0x2'))(_0xc3c1('0x3'));var moment=require(_0xc3c1('0x4'));var BPromise=require(_0xc3c1('0x5'));var rp=require(_0xc3c1('0x6'));var fs=require('fs');var path=require(_0xc3c1('0x7'));var rimraf=require(_0xc3c1('0x8'));var config=require(_0xc3c1('0x9'));var attributes=require(_0xc3c1('0xa'));module[_0xc3c1('0xb')]=function(_0x5bd63c,_0x55631d){return _0x5bd63c[_0xc3c1('0xc')]('FreshsalesConfiguration',attributes,{'tableName':_0xc3c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cdb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x2b531c,_0x1cdbd4){var _0x276f51=function(_0x430111){while(--_0x430111){_0x2b531c['push'](_0x2b531c['shift']());}};_0x276f51(++_0x1cdbd4);}(_0x1cdb,0x1eb));var _0xb1cd=function(_0x5bb6ba,_0x3b4bd9){_0x5bb6ba=_0x5bb6ba-0x0;var _0x2bdf7f=_0x1cdb[_0x5bb6ba];return _0x2bdf7f;};'use strict';var _=require(_0xb1cd('0x0'));var util=require(_0xb1cd('0x1'));var logger=require(_0xb1cd('0x2'))(_0xb1cd('0x3'));var moment=require(_0xb1cd('0x4'));var BPromise=require(_0xb1cd('0x5'));var rp=require(_0xb1cd('0x6'));var fs=require('fs');var path=require(_0xb1cd('0x7'));var rimraf=require(_0xb1cd('0x8'));var config=require(_0xb1cd('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb1cd('0xa')]=function(_0x5455d4,_0xa4b40c){return _0x5455d4[_0xb1cd('0xb')](_0xb1cd('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 469f319..cd1544b 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 _0x0a44=['jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x36efd8,_0x4923cf){var _0x500c8a=function(_0x2fccc9){while(--_0x2fccc9){_0x36efd8['push'](_0x36efd8['shift']());}};_0x500c8a(++_0x4923cf);}(_0x0a44,0xbd));var _0x40a4=function(_0x59e45a,_0x4d704f){_0x59e45a=_0x59e45a-0x0;var _0x3e1c91=_0x0a44[_0x59e45a];return _0x3e1c91;};'use strict';var _=require(_0x40a4('0x0'));var util=require('util');var moment=require(_0x40a4('0x1'));var BPromise=require(_0x40a4('0x2'));var rs=require(_0x40a4('0x3'));var fs=require('fs');var Redis=require(_0x40a4('0x4'));var db=require(_0x40a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40a4('0x6'))(_0x40a4('0x7'));var config=require(_0x40a4('0x8'));var jayson=require(_0x40a4('0x9'));var client=jayson[_0x40a4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50304b,_0x59c867,_0x263dc2){return new BPromise(function(_0x33c0fa,_0x2bfa17){return client['request'](_0x50304b,_0x263dc2)['then'](function(_0x8d6bce){logger[_0x40a4('0xb')](_0x40a4('0xc'),_0x59c867,_0x40a4('0xd'));logger[_0x40a4('0xe')](_0x40a4('0xf'),_0x59c867,_0x40a4('0xd'),JSON[_0x40a4('0x10')](_0x8d6bce));if(_0x8d6bce[_0x40a4('0x11')]){if(_0x8d6bce[_0x40a4('0x11')][_0x40a4('0x12')]===0x1f4){logger[_0x40a4('0x11')](_0x40a4('0xc'),_0x59c867,_0x8d6bce[_0x40a4('0x11')][_0x40a4('0x13')]);return _0x2bfa17(_0x8d6bce['error'][_0x40a4('0x13')]);}logger[_0x40a4('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x59c867,_0x8d6bce[_0x40a4('0x11')]['message']);return _0x33c0fa(_0x8d6bce[_0x40a4('0x11')]['message']);}else{logger[_0x40a4('0xb')](_0x40a4('0xc'),_0x59c867,'request\x20sent');_0x33c0fa(_0x8d6bce[_0x40a4('0x14')]['message']);}})[_0x40a4('0x15')](function(_0x3c478d){logger[_0x40a4('0x11')](_0x40a4('0xc'),_0x59c867,_0x3c478d);_0x2bfa17(_0x3c478d);});});} \ No newline at end of file +var _0x3e1c=['code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3e1c,0x116));var _0xc3e1=function(_0x9c123e,_0x2c8bff){_0x9c123e=_0x9c123e-0x0;var _0x2157df=_0x3e1c[_0x9c123e];return _0x2157df;};'use strict';var _=require(_0xc3e1('0x0'));var util=require(_0xc3e1('0x1'));var moment=require(_0xc3e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3e1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3e1('0x5'))(_0xc3e1('0x6'));var config=require(_0xc3e1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc3e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2782d5,_0x417251,_0x2eee2c){return new BPromise(function(_0x4180bb,_0xecdbb8){return client[_0xc3e1('0x9')](_0x2782d5,_0x2eee2c)['then'](function(_0x5901ce){logger[_0xc3e1('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x417251,_0xc3e1('0xb'));logger[_0xc3e1('0xc')](_0xc3e1('0xd'),_0x417251,_0xc3e1('0xb'),JSON[_0xc3e1('0xe')](_0x5901ce));if(_0x5901ce[_0xc3e1('0xf')]){if(_0x5901ce[_0xc3e1('0xf')][_0xc3e1('0x10')]===0x1f4){logger[_0xc3e1('0xf')](_0xc3e1('0x11'),_0x417251,_0x5901ce[_0xc3e1('0xf')]['message']);return _0xecdbb8(_0x5901ce['error']['message']);}logger[_0xc3e1('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x417251,_0x5901ce[_0xc3e1('0xf')][_0xc3e1('0x12')]);return _0x4180bb(_0x5901ce[_0xc3e1('0xf')][_0xc3e1('0x12')]);}else{logger[_0xc3e1('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x417251,_0xc3e1('0xb'));_0x4180bb(_0x5901ce[_0xc3e1('0x13')][_0xc3e1('0x12')]);}})[_0xc3e1('0x14')](function(_0x203ca2){logger[_0xc3e1('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x417251,_0x203ca2);_0xecdbb8(_0x203ca2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 64504fb..b2e4a56 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 _0x4bd1=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','exports'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4bd1,0x90));var _0x14bd=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0x4bd1[_0x4cba56];return _0x3cc9f3;};'use strict';var multer=require('multer');var util=require(_0x14bd('0x0'));var path=require('path');var timeout=require(_0x14bd('0x1'));var express=require(_0x14bd('0x2'));var router=express['Router']();var fs_extra=require(_0x14bd('0x3'));var auth=require(_0x14bd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x14bd('0x5'));var controller=require(_0x14bd('0x6'));router[_0x14bd('0x7')]('/',auth[_0x14bd('0x8')](),controller['index']);router[_0x14bd('0x7')](_0x14bd('0x9'),auth[_0x14bd('0x8')](),controller[_0x14bd('0xa')]);router[_0x14bd('0xb')]('/',auth[_0x14bd('0x8')](),controller[_0x14bd('0xc')]);router[_0x14bd('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x14bd('0xe')](_0x14bd('0x9'),auth[_0x14bd('0x8')](),controller['destroy']);module[_0x14bd('0xf')]=router; \ No newline at end of file +var _0xbb53=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update'];(function(_0x28157f,_0x47acac){var _0x2b91f9=function(_0x594148){while(--_0x594148){_0x28157f['push'](_0x28157f['shift']());}};_0x2b91f9(++_0x47acac);}(_0xbb53,0x121));var _0x3bb5=function(_0xf755a9,_0x21ff0d){_0xf755a9=_0xf755a9-0x0;var _0x1aa2cc=_0xbb53[_0xf755a9];return _0x1aa2cc;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),auth[_0x3bb5('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3bb5('0xe')]);router[_0x3bb5('0xf')](_0x3bb5('0xd'),auth['isAuthenticated'](),controller[_0x3bb5('0x10')]);router['delete']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 757a250..60c3e9c 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 _0x33cb=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x33cb,0xc6));var _0xb33c=function(_0x2812d7,_0x139e6f){_0x2812d7=_0x2812d7-0x0;var _0x39bc1e=_0x33cb[_0x2812d7];return _0x39bc1e;};'use strict';var Sequelize=require(_0xb33c('0x0'));module['exports']={'type':{'type':Sequelize[_0xb33c('0x1')](_0xb33c('0x2'),_0xb33c('0x3'),_0xb33c('0x4'),'keyValue',_0xb33c('0x5')),'defaultValue':_0xb33c('0x2')},'content':{'type':Sequelize[_0xb33c('0x6')]},'key':{'type':Sequelize[_0xb33c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xb33c('0x2'),'variable',_0xb33c('0x4'))},'keyContent':{'type':Sequelize[_0xb33c('0x6')]},'idField':{'type':Sequelize[_0xb33c('0x6')]},'nameField':{'type':Sequelize[_0xb33c('0x6')]},'customField':{'type':Sequelize[_0xb33c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb33c('0x6')]}}; \ No newline at end of file +var _0x34c5=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x532667,_0x2215b2){var _0x4aa8d2=function(_0x2fb45b){while(--_0x2fb45b){_0x532667['push'](_0x532667['shift']());}};_0x4aa8d2(++_0x2215b2);}(_0x34c5,0x12d));var _0x534c=function(_0x56ebb1,_0x486a4d){_0x56ebb1=_0x56ebb1-0x0;var _0x11ddde=_0x34c5[_0x56ebb1];return _0x11ddde;};'use strict';var Sequelize=require(_0x534c('0x0'));module[_0x534c('0x1')]={'type':{'type':Sequelize[_0x534c('0x2')]('string',_0x534c('0x3'),'customVariable',_0x534c('0x4'),'picklist'),'defaultValue':_0x534c('0x5')},'content':{'type':Sequelize[_0x534c('0x6')]},'key':{'type':Sequelize[_0x534c('0x6')]},'keyType':{'type':Sequelize[_0x534c('0x2')]('string',_0x534c('0x3'),_0x534c('0x7'))},'keyContent':{'type':Sequelize[_0x534c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x534c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x534c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 8ac9f9e..abc3483 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 _0xa354=['length','find','create','body','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2438b9,_0x39cfaa){var _0x1206cd=function(_0x3e2ef2){while(--_0x3e2ef2){_0x2438b9['push'](_0x2438b9['shift']());}};_0x1206cd(++_0x39cfaa);}(_0xa354,0x9a));var _0x4a35=function(_0x4f699c,_0x2f7136){_0x4f699c=_0x4f699c-0x0;var _0x29cc21=_0xa354[_0x4f699c];return _0x29cc21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a35('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a35('0x2'));var Mustache=require(_0x4a35('0x3'));var util=require(_0x4a35('0x4'));var path=require('path');var sox=require(_0x4a35('0x5'));var csv=require(_0x4a35('0x6'));var ejs=require(_0x4a35('0x7'));var fs=require('fs');var fs_extra=require(_0x4a35('0x8'));var _=require(_0x4a35('0x9'));var squel=require(_0x4a35('0xa'));var crypto=require(_0x4a35('0xb'));var jsforce=require(_0x4a35('0xc'));var deskjs=require(_0x4a35('0xd'));var toCsv=require(_0x4a35('0x6'));var querystring=require('querystring');var Papa=require(_0x4a35('0xe'));var Redis=require(_0x4a35('0xf'));var authService=require(_0x4a35('0x10'));var qs=require(_0x4a35('0x11'));var as=require(_0x4a35('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a35('0x13'))(_0x4a35('0x14'));var utils=require(_0x4a35('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a35('0x16'))['db'];function respondWithStatusCode(_0x4fbebd,_0x758d6c){_0x758d6c=_0x758d6c||0xcc;return function(_0x52d3b4){if(_0x52d3b4){return _0x4fbebd[_0x4a35('0x17')](_0x758d6c);}return _0x4fbebd['status'](_0x758d6c)[_0x4a35('0x18')]();};}function respondWithResult(_0x215376,_0x2b5710){_0x2b5710=_0x2b5710||0xc8;return function(_0x219d49){if(_0x219d49){return _0x215376[_0x4a35('0x19')](_0x2b5710)[_0x4a35('0x1a')](_0x219d49);}};}function respondWithFilteredResult(_0xf92732,_0xb55b97){return function(_0x217a83){if(_0x217a83){var _0x440d22=typeof _0xb55b97[_0x4a35('0x1b')]===_0x4a35('0x1c')&&typeof _0xb55b97[_0x4a35('0x1d')]==='undefined';var _0x53f162=_0x217a83[_0x4a35('0x1e')];var _0x5dbe80=_0x440d22?0x0:_0xb55b97[_0x4a35('0x1b')];var _0x27ce9a=_0x440d22?_0x217a83[_0x4a35('0x1e')]:_0xb55b97['offset']+_0xb55b97[_0x4a35('0x1d')];var _0x328c58;if(_0x27ce9a>=_0x53f162){_0x27ce9a=_0x53f162;_0x328c58=0xc8;}else{_0x328c58=0xce;}_0xf92732[_0x4a35('0x19')](_0x328c58);return _0xf92732[_0x4a35('0x1f')]('Content-Range',_0x5dbe80+'-'+_0x27ce9a+'/'+_0x53f162)[_0x4a35('0x1a')](_0x217a83);}return null;};}function patchUpdates(_0x1e1220){return function(_0x5b2f51){try{jsonpatch[_0x4a35('0x20')](_0x5b2f51,_0x1e1220,!![]);}catch(_0x3f3d16){return BPromise['reject'](_0x3f3d16);}return _0x5b2f51[_0x4a35('0x21')]();};}function saveUpdates(_0x1f4e42,_0x11ed4b){return function(_0x1c8fe7){if(_0x1c8fe7){return _0x1c8fe7[_0x4a35('0x22')](_0x1f4e42)['then'](function(_0x5f2183){return _0x5f2183;});}return null;};}function removeEntity(_0xdc717,_0x4a3d39){return function(_0x24426f){if(_0x24426f){return _0x24426f[_0x4a35('0x23')]()[_0x4a35('0x24')](function(){_0xdc717[_0x4a35('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48d7e0,_0x46caff){return function(_0xe662eb){if(!_0xe662eb){_0x48d7e0[_0x4a35('0x17')](0x194);}return _0xe662eb;};}function handleError(_0x5b5ec7,_0x56e334){_0x56e334=_0x56e334||0x1f4;return function(_0xa06fb0){logger[_0x4a35('0x25')](_0xa06fb0[_0x4a35('0x26')]);if(_0xa06fb0[_0x4a35('0x27')]){delete _0xa06fb0['name'];}_0x5b5ec7[_0x4a35('0x19')](_0x56e334)[_0x4a35('0x28')](_0xa06fb0);};}exports[_0x4a35('0x29')]=function(_0x57c85a,_0x3c160a){var _0x4165fc={},_0x4dc2e4={},_0x3fbb3c={'count':0x0,'rows':[]};var _0x83a139=_[_0x4a35('0x2a')](db[_0x4a35('0x2b')][_0x4a35('0x2c')],function(_0x5360a4){return{'name':_0x5360a4[_0x4a35('0x2d')],'type':_0x5360a4[_0x4a35('0x2e')][_0x4a35('0x2f')]};});_0x4dc2e4[_0x4a35('0x30')]=_['map'](_0x83a139,_0x4a35('0x27'));_0x4dc2e4[_0x4a35('0x31')]=_[_0x4a35('0x32')](_0x57c85a['query']);_0x4dc2e4[_0x4a35('0x33')]=_[_0x4a35('0x34')](_0x4dc2e4[_0x4a35('0x30')],_0x4dc2e4[_0x4a35('0x31')]);_0x4165fc[_0x4a35('0x35')]=_[_0x4a35('0x34')](_0x4dc2e4[_0x4a35('0x30')],qs[_0x4a35('0x36')](_0x57c85a[_0x4a35('0x31')][_0x4a35('0x36')]));_0x4165fc[_0x4a35('0x35')]=_0x4165fc[_0x4a35('0x35')]['length']?_0x4165fc[_0x4a35('0x35')]:_0x4dc2e4['model'];if(!_0x57c85a[_0x4a35('0x31')][_0x4a35('0x37')](_0x4a35('0x38'))){_0x4165fc['limit']=qs['limit'](_0x57c85a[_0x4a35('0x31')][_0x4a35('0x1d')]);_0x4165fc[_0x4a35('0x1b')]=qs[_0x4a35('0x1b')](_0x57c85a[_0x4a35('0x31')][_0x4a35('0x1b')]);}_0x4165fc[_0x4a35('0x39')]=qs['sort'](_0x57c85a['query'][_0x4a35('0x3a')]);_0x4165fc[_0x4a35('0x3b')]=qs[_0x4a35('0x33')](_[_0x4a35('0x3c')](_0x57c85a[_0x4a35('0x31')],_0x4dc2e4[_0x4a35('0x33')]),_0x83a139);if(_0x57c85a['query']['filter']){_0x4165fc[_0x4a35('0x3b')]=_[_0x4a35('0x3d')](_0x4165fc['where'],{'$or':_[_0x4a35('0x2a')](_0x83a139,function(_0x224347){if(_0x224347[_0x4a35('0x2e')]!=='VIRTUAL'){var _0x44d0e3={};_0x44d0e3[_0x224347[_0x4a35('0x27')]]={'$like':'%'+_0x57c85a[_0x4a35('0x31')][_0x4a35('0x3e')]+'%'};return _0x44d0e3;}})});}_0x4165fc=_[_0x4a35('0x3d')]({},_0x4165fc,_0x57c85a[_0x4a35('0x3f')]);var _0xb39a01={'where':_0x4165fc[_0x4a35('0x3b')]};return db[_0x4a35('0x2b')]['count'](_0xb39a01)[_0x4a35('0x24')](function(_0x2b9993){_0x3fbb3c[_0x4a35('0x1e')]=_0x2b9993;if(_0x57c85a[_0x4a35('0x31')][_0x4a35('0x40')]){_0x4165fc[_0x4a35('0x41')]=[{'all':!![]}];}return db[_0x4a35('0x2b')][_0x4a35('0x42')](_0x4165fc);})['then'](function(_0x20aa26){_0x3fbb3c[_0x4a35('0x43')]=_0x20aa26;return _0x3fbb3c;})[_0x4a35('0x24')](respondWithFilteredResult(_0x3c160a,_0x4165fc))[_0x4a35('0x44')](handleError(_0x3c160a,null));};exports[_0x4a35('0x45')]=function(_0x28df5b,_0x14d8d6){var _0x511f82={'raw':!![],'where':{'id':_0x28df5b[_0x4a35('0x46')]['id']}},_0xf9a1b0={};_0xf9a1b0['model']=_[_0x4a35('0x32')](db[_0x4a35('0x2b')]['rawAttributes']);_0xf9a1b0[_0x4a35('0x31')]=_[_0x4a35('0x32')](_0x28df5b[_0x4a35('0x31')]);_0xf9a1b0[_0x4a35('0x33')]=_[_0x4a35('0x34')](_0xf9a1b0['model'],_0xf9a1b0[_0x4a35('0x31')]);_0x511f82['attributes']=_[_0x4a35('0x34')](_0xf9a1b0[_0x4a35('0x30')],qs[_0x4a35('0x36')](_0x28df5b[_0x4a35('0x31')][_0x4a35('0x36')]));_0x511f82[_0x4a35('0x35')]=_0x511f82['attributes'][_0x4a35('0x47')]?_0x511f82[_0x4a35('0x35')]:_0xf9a1b0[_0x4a35('0x30')];if(_0x28df5b[_0x4a35('0x31')][_0x4a35('0x40')]){_0x511f82[_0x4a35('0x41')]=[{'all':!![]}];}_0x511f82=_[_0x4a35('0x3d')]({},_0x511f82,_0x28df5b[_0x4a35('0x3f')]);return db[_0x4a35('0x2b')][_0x4a35('0x48')](_0x511f82)['then'](handleEntityNotFound(_0x14d8d6,null))[_0x4a35('0x24')](respondWithResult(_0x14d8d6,null))['catch'](handleError(_0x14d8d6,null));};exports[_0x4a35('0x49')]=function(_0x3a2dbf,_0x3a547d){return db['FreshsalesField']['create'](_0x3a2dbf[_0x4a35('0x4a')],{})['then'](respondWithResult(_0x3a547d,0xc9))[_0x4a35('0x44')](handleError(_0x3a547d,null));};exports[_0x4a35('0x22')]=function(_0x3b178f,_0x991b04){if(_0x3b178f[_0x4a35('0x4a')]['id']){delete _0x3b178f[_0x4a35('0x4a')]['id'];}return db[_0x4a35('0x2b')][_0x4a35('0x48')]({'where':{'id':_0x3b178f[_0x4a35('0x46')]['id']}})[_0x4a35('0x24')](handleEntityNotFound(_0x991b04,null))['then'](saveUpdates(_0x3b178f[_0x4a35('0x4a')],null))[_0x4a35('0x24')](respondWithResult(_0x991b04,null))[_0x4a35('0x44')](handleError(_0x991b04,null));};exports[_0x4a35('0x23')]=function(_0x2c6ca2,_0x8bac02){return db[_0x4a35('0x2b')][_0x4a35('0x48')]({'where':{'id':_0x2c6ca2['params']['id']}})[_0x4a35('0x24')](handleEntityNotFound(_0x8bac02,null))[_0x4a35('0x24')](removeEntity(_0x8bac02,null))[_0x4a35('0x44')](handleError(_0x8bac02,null));}; \ No newline at end of file +var _0x66cd=['send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','filter','merge','options','catch','params','length','includeAll','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name'];(function(_0x2c7bf8,_0x56638d){var _0x215fb8=function(_0x389d34){while(--_0x389d34){_0x2c7bf8['push'](_0x2c7bf8['shift']());}};_0x215fb8(++_0x56638d);}(_0x66cd,0x185));var _0xd66c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66cd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xd66c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd66c('0x1'));var jsonpatch=require(_0xd66c('0x2'));var rp=require(_0xd66c('0x3'));var moment=require(_0xd66c('0x4'));var BPromise=require(_0xd66c('0x5'));var Mustache=require(_0xd66c('0x6'));var util=require(_0xd66c('0x7'));var path=require('path');var sox=require(_0xd66c('0x8'));var csv=require(_0xd66c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd66c('0xa'));var squel=require('squel');var crypto=require(_0xd66c('0xb'));var jsforce=require(_0xd66c('0xc'));var deskjs=require(_0xd66c('0xd'));var toCsv=require(_0xd66c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd66c('0xe'));var authService=require(_0xd66c('0xf'));var qs=require(_0xd66c('0x10'));var as=require(_0xd66c('0x11'));var hardwareService=require(_0xd66c('0x12'));var logger=require('../../config/logger')(_0xd66c('0x13'));var utils=require(_0xd66c('0x14'));var config=require(_0xd66c('0x15'));var licenseUtil=require(_0xd66c('0x16'));var db=require(_0xd66c('0x17'))['db'];function respondWithStatusCode(_0x590747,_0x21d029){_0x21d029=_0x21d029||0xcc;return function(_0x31bc4f){if(_0x31bc4f){return _0x590747[_0xd66c('0x18')](_0x21d029);}return _0x590747[_0xd66c('0x19')](_0x21d029)['end']();};}function respondWithResult(_0xb07ce6,_0x1015f0){_0x1015f0=_0x1015f0||0xc8;return function(_0xa2d41a){if(_0xa2d41a){return _0xb07ce6[_0xd66c('0x19')](_0x1015f0)[_0xd66c('0x1a')](_0xa2d41a);}};}function respondWithFilteredResult(_0x2442db,_0x2c4822){return function(_0x2c0e97){if(_0x2c0e97){var _0x42189a=typeof _0x2c4822['offset']==='undefined'&&typeof _0x2c4822[_0xd66c('0x1b')]===_0xd66c('0x1c');var _0x27176e=_0x2c0e97[_0xd66c('0x1d')];var _0x5d9f22=_0x42189a?0x0:_0x2c4822[_0xd66c('0x1e')];var _0x3ceee6=_0x42189a?_0x2c0e97[_0xd66c('0x1d')]:_0x2c4822['offset']+_0x2c4822['limit'];var _0x16917d;if(_0x3ceee6>=_0x27176e){_0x3ceee6=_0x27176e;_0x16917d=0xc8;}else{_0x16917d=0xce;}_0x2442db[_0xd66c('0x19')](_0x16917d);return _0x2442db[_0xd66c('0x1f')](_0xd66c('0x20'),_0x5d9f22+'-'+_0x3ceee6+'/'+_0x27176e)[_0xd66c('0x1a')](_0x2c0e97);}return null;};}function patchUpdates(_0x582172){return function(_0x13ee78){try{jsonpatch[_0xd66c('0x21')](_0x13ee78,_0x582172,!![]);}catch(_0x3c06dc){return BPromise[_0xd66c('0x22')](_0x3c06dc);}return _0x13ee78[_0xd66c('0x23')]();};}function saveUpdates(_0x1650f6,_0x14abf8){return function(_0x3335fe){if(_0x3335fe){return _0x3335fe[_0xd66c('0x24')](_0x1650f6)['then'](function(_0x66b643){return _0x66b643;});}return null;};}function removeEntity(_0x16bebb,_0x21033a){return function(_0x5c374b){if(_0x5c374b){return _0x5c374b[_0xd66c('0x25')]()[_0xd66c('0x26')](function(){_0x16bebb[_0xd66c('0x19')](0xcc)[_0xd66c('0x27')]();});}};}function handleEntityNotFound(_0x1484c1,_0x526dff){return function(_0x2a3509){if(!_0x2a3509){_0x1484c1[_0xd66c('0x18')](0x194);}return _0x2a3509;};}function handleError(_0xee1138,_0xadadde){_0xadadde=_0xadadde||0x1f4;return function(_0x1d23f7){logger[_0xd66c('0x28')](_0x1d23f7[_0xd66c('0x29')]);if(_0x1d23f7['name']){delete _0x1d23f7[_0xd66c('0x2a')];}_0xee1138[_0xd66c('0x19')](_0xadadde)[_0xd66c('0x2b')](_0x1d23f7);};}exports['index']=function(_0x48021d,_0x21e02f){var _0x33d3f0={},_0x595fd8={},_0xe6ee1f={'count':0x0,'rows':[]};var _0x559158=_[_0xd66c('0x2c')](db[_0xd66c('0x2d')][_0xd66c('0x2e')],function(_0x3db530){return{'name':_0x3db530[_0xd66c('0x2f')],'type':_0x3db530[_0xd66c('0x30')][_0xd66c('0x31')]};});_0x595fd8[_0xd66c('0x32')]=_['map'](_0x559158,_0xd66c('0x2a'));_0x595fd8['query']=_[_0xd66c('0x33')](_0x48021d[_0xd66c('0x34')]);_0x595fd8['filters']=_[_0xd66c('0x35')](_0x595fd8[_0xd66c('0x32')],_0x595fd8['query']);_0x33d3f0['attributes']=_[_0xd66c('0x35')](_0x595fd8['model'],qs['fields'](_0x48021d[_0xd66c('0x34')][_0xd66c('0x36')]));_0x33d3f0[_0xd66c('0x37')]=_0x33d3f0[_0xd66c('0x37')]['length']?_0x33d3f0[_0xd66c('0x37')]:_0x595fd8[_0xd66c('0x32')];if(!_0x48021d[_0xd66c('0x34')]['hasOwnProperty'](_0xd66c('0x38'))){_0x33d3f0['limit']=qs[_0xd66c('0x1b')](_0x48021d[_0xd66c('0x34')][_0xd66c('0x1b')]);_0x33d3f0[_0xd66c('0x1e')]=qs['offset'](_0x48021d[_0xd66c('0x34')][_0xd66c('0x1e')]);}_0x33d3f0[_0xd66c('0x39')]=qs[_0xd66c('0x3a')](_0x48021d[_0xd66c('0x34')][_0xd66c('0x3a')]);_0x33d3f0[_0xd66c('0x3b')]=qs[_0xd66c('0x3c')](_['pick'](_0x48021d['query'],_0x595fd8[_0xd66c('0x3c')]),_0x559158);if(_0x48021d[_0xd66c('0x34')][_0xd66c('0x3d')]){_0x33d3f0[_0xd66c('0x3b')]=_['merge'](_0x33d3f0[_0xd66c('0x3b')],{'$or':_[_0xd66c('0x2c')](_0x559158,function(_0x185f4d){if(_0x185f4d[_0xd66c('0x30')]!=='VIRTUAL'){var _0x2cc18f={};_0x2cc18f[_0x185f4d[_0xd66c('0x2a')]]={'$like':'%'+_0x48021d[_0xd66c('0x34')]['filter']+'%'};return _0x2cc18f;}})});}_0x33d3f0=_[_0xd66c('0x3e')]({},_0x33d3f0,_0x48021d[_0xd66c('0x3f')]);var _0x1869e6={'where':_0x33d3f0['where']};return db['FreshsalesField']['count'](_0x1869e6)['then'](function(_0x4950cb){_0xe6ee1f[_0xd66c('0x1d')]=_0x4950cb;if(_0x48021d[_0xd66c('0x34')]['includeAll']){_0x33d3f0['include']=[{'all':!![]}];}return db[_0xd66c('0x2d')]['findAll'](_0x33d3f0);})[_0xd66c('0x26')](function(_0x56122f){_0xe6ee1f['rows']=_0x56122f;return _0xe6ee1f;})[_0xd66c('0x26')](respondWithFilteredResult(_0x21e02f,_0x33d3f0))[_0xd66c('0x40')](handleError(_0x21e02f,null));};exports['show']=function(_0x433ee0,_0x2cffdf){var _0x2169bc={'raw':!![],'where':{'id':_0x433ee0[_0xd66c('0x41')]['id']}},_0x7beb24={};_0x7beb24[_0xd66c('0x32')]=_['keys'](db[_0xd66c('0x2d')]['rawAttributes']);_0x7beb24['query']=_[_0xd66c('0x33')](_0x433ee0[_0xd66c('0x34')]);_0x7beb24[_0xd66c('0x3c')]=_['intersection'](_0x7beb24[_0xd66c('0x32')],_0x7beb24[_0xd66c('0x34')]);_0x2169bc[_0xd66c('0x37')]=_[_0xd66c('0x35')](_0x7beb24[_0xd66c('0x32')],qs[_0xd66c('0x36')](_0x433ee0[_0xd66c('0x34')]['fields']));_0x2169bc[_0xd66c('0x37')]=_0x2169bc[_0xd66c('0x37')][_0xd66c('0x42')]?_0x2169bc['attributes']:_0x7beb24[_0xd66c('0x32')];if(_0x433ee0[_0xd66c('0x34')][_0xd66c('0x43')]){_0x2169bc[_0xd66c('0x44')]=[{'all':!![]}];}_0x2169bc=_['merge']({},_0x2169bc,_0x433ee0[_0xd66c('0x3f')]);return db[_0xd66c('0x2d')][_0xd66c('0x45')](_0x2169bc)[_0xd66c('0x26')](handleEntityNotFound(_0x2cffdf,null))[_0xd66c('0x26')](respondWithResult(_0x2cffdf,null))[_0xd66c('0x40')](handleError(_0x2cffdf,null));};exports['create']=function(_0x298927,_0x31d365){return db[_0xd66c('0x2d')][_0xd66c('0x46')](_0x298927[_0xd66c('0x47')],{})['then'](respondWithResult(_0x31d365,0xc9))['catch'](handleError(_0x31d365,null));};exports['update']=function(_0x11a589,_0x10889b){if(_0x11a589[_0xd66c('0x47')]['id']){delete _0x11a589['body']['id'];}return db[_0xd66c('0x2d')][_0xd66c('0x45')]({'where':{'id':_0x11a589['params']['id']}})['then'](handleEntityNotFound(_0x10889b,null))[_0xd66c('0x26')](saveUpdates(_0x11a589[_0xd66c('0x47')],null))[_0xd66c('0x26')](respondWithResult(_0x10889b,null))[_0xd66c('0x40')](handleError(_0x10889b,null));};exports['destroy']=function(_0x56e3ce,_0x350371){return db['FreshsalesField']['find']({'where':{'id':_0x56e3ce[_0xd66c('0x41')]['id']}})[_0xd66c('0x26')](handleEntityNotFound(_0x350371,null))[_0xd66c('0x26')](removeEntity(_0x350371,null))[_0xd66c('0x40')](handleError(_0x350371,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index a9bea96..85666b6 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 _0xd5a2=['freshsales_unique_index','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x4c3a86,_0x344c87){var _0x46dcf9=function(_0x4a5991){while(--_0x4a5991){_0x4c3a86['push'](_0x4c3a86['shift']());}};_0x46dcf9(++_0x344c87);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x2a9859,_0x42003b){_0x2a9859=_0x2a9859-0x0;var _0x58d5ec=_0xd5a2[_0x2a9859];return _0x58d5ec;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x1187b5,_0x923c29){return _0x1187b5[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('0xc'),'paranoid':![],'indexes':[{'name':_0x2d5a('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fb3=['FreshsalesField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x7fb3,0xf9));var _0x37fb=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x7fb3[_0x2fa457];return _0x4f250a;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var logger=require(_0x37fb('0x2'))(_0x37fb('0x3'));var moment=require('moment');var BPromise=require(_0x37fb('0x4'));var rp=require(_0x37fb('0x5'));var fs=require('fs');var path=require(_0x37fb('0x6'));var rimraf=require(_0x37fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x37fb('0x8'));module[_0x37fb('0x9')]=function(_0x2443bd,_0x23a839){return _0x2443bd[_0x37fb('0xa')](_0x37fb('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x37fb('0xc')],'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 fee1a08..b5961a7 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 _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x20574a,_0x546324){var _0x445590=function(_0x3845c9){while(--_0x3845c9){_0x20574a['push'](_0x20574a['shift']());}};_0x445590(++_0x546324);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1b76be,_0x2db988){_0x1b76be=_0x1b76be-0x0;var _0xdea8e1=_0xb4c7[_0x1b76be];return _0xdea8e1;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x8adb4c,_0x401a42){var _0x10f093=function(_0x331c4d){while(--_0x331c4d){_0x8adb4c['push'](_0x8adb4c['shift']());}};_0x10f093(++_0x401a42);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x491d81,_0x25087d){_0x491d81=_0x491d81-0x0;var _0x2bc303=_0xc6ac[_0x491d81];return _0x2bc303;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 7bc3428..710ae24 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(_0x3ca233,_0x1ea7b9){var _0x353e98=function(_0x137357){while(--_0x137357){_0x3ca233['push'](_0x3ca233['shift']());}};_0x353e98(++_0x1ea7b9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x2390ec,_0x3c67b0){var _0x2f2f4c=function(_0x1f7bba){while(--_0x1f7bba){_0x2390ec['push'](_0x2390ec['shift']());}};_0x2f2f4c(++_0x3c67b0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9135d30..2762065 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 _0xeb0f=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x50726c,_0x4fdec4){var _0x325e0c=function(_0x4ef3cb){while(--_0x4ef3cb){_0x50726c['push'](_0x50726c['shift']());}};_0x325e0c(++_0x4fdec4);}(_0xeb0f,0x176));var _0xfeb0=function(_0x251379,_0x534ae4){_0x251379=_0x251379-0x0;var _0x194816=_0xeb0f[_0x251379];return _0x194816;};'use strict';var Sequelize=require(_0xfeb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfeb0('0x1')]},'description':{'type':Sequelize[_0xfeb0('0x1')]},'username':{'type':Sequelize[_0xfeb0('0x1')],'unique':_0xfeb0('0x2')},'remoteUri':{'type':Sequelize[_0xfeb0('0x1')]},'password':{'type':Sequelize[_0xfeb0('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xfeb0('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfeb0('0x3')](_0xfeb0('0x4'),_0xfeb0('0x5')),'defaultValue':_0xfeb0('0x4')}}; \ No newline at end of file +var _0x1c01=['STRING','username','ENUM','newTab','sequelize','exports'];(function(_0x8c1fb1,_0xa4f801){var _0x871af0=function(_0x110da5){while(--_0x110da5){_0x8c1fb1['push'](_0x8c1fb1['shift']());}};_0x871af0(++_0xa4f801);}(_0x1c01,0x190));var _0x11c0=function(_0x4ce265,_0x3897eb){_0x4ce265=_0x4ce265-0x0;var _0x72ca95=_0x1c01[_0x4ce265];return _0x72ca95;};'use strict';var Sequelize=require(_0x11c0('0x0'));module[_0x11c0('0x1')]={'name':{'type':Sequelize[_0x11c0('0x2')]},'description':{'type':Sequelize[_0x11c0('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x11c0('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x11c0('0x2')]},'clientSecret':{'type':Sequelize[_0x11c0('0x2')]},'securityToken':{'type':Sequelize[_0x11c0('0x2')]},'serverUrl':{'type':Sequelize[_0x11c0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x11c0('0x4')]('integrationTab',_0x11c0('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 6e46afb..cc35750 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 _0x436f=['email','textarea','remove','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','sendStatus','error','name','send','SalesforceAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','filter','type','merge','options','includeAll','include','rows','show','params','find','create','body','catch','destroy','getConfigurations','findOne','SalesforceConfiguration','filters','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','username','password','slice','lastIndexOf','Connection','clientSecret','login','concat','securityToken','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','picklist','boolean'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x436f,0x175));var _0xf436=function(_0x3eace8,_0x28bc1c){_0x3eace8=_0x3eace8-0x0;var _0x4372d6=_0x436f[_0x3eace8];return _0x4372d6;};'use strict';var emlformat=require(_0xf436('0x0'));var rimraf=require(_0xf436('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf436('0x2'));var rp=require('request-promise');var moment=require(_0xf436('0x3'));var BPromise=require(_0xf436('0x4'));var Mustache=require('mustache');var util=require(_0xf436('0x5'));var path=require(_0xf436('0x6'));var sox=require(_0xf436('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf436('0x8'));var _=require(_0xf436('0x9'));var squel=require(_0xf436('0xa'));var crypto=require('crypto');var jsforce=require(_0xf436('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf436('0xc'));var querystring=require(_0xf436('0xd'));var Papa=require(_0xf436('0xe'));var Redis=require(_0xf436('0xf'));var authService=require(_0xf436('0x10'));var qs=require(_0xf436('0x11'));var as=require(_0xf436('0x12'));var hardwareService=require(_0xf436('0x13'));var logger=require(_0xf436('0x14'))('api');var utils=require(_0xf436('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf436('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf436('0x17'));function respondWithStatusCode(_0x2b4e0c,_0x29a833){_0x29a833=_0x29a833||0xcc;return function(_0x20b6d1){if(_0x20b6d1){return _0x2b4e0c['sendStatus'](_0x29a833);}return _0x2b4e0c[_0xf436('0x18')](_0x29a833)[_0xf436('0x19')]();};}function respondWithResult(_0x208e0b,_0x3d4366){_0x3d4366=_0x3d4366||0xc8;return function(_0x152ace){if(_0x152ace){return _0x208e0b['status'](_0x3d4366)[_0xf436('0x1a')](_0x152ace);}};}function respondWithFilteredResult(_0x3abbc1,_0x6e38f5){return function(_0x525e15){if(_0x525e15){var _0xd96880=typeof _0x6e38f5[_0xf436('0x1b')]===_0xf436('0x1c')&&typeof _0x6e38f5[_0xf436('0x1d')]==='undefined';var _0x74f433=_0x525e15[_0xf436('0x1e')];var _0x23bb3e=_0xd96880?0x0:_0x6e38f5['offset'];var _0xff094a=_0xd96880?_0x525e15['count']:_0x6e38f5[_0xf436('0x1b')]+_0x6e38f5[_0xf436('0x1d')];var _0x538914;if(_0xff094a>=_0x74f433){_0xff094a=_0x74f433;_0x538914=0xc8;}else{_0x538914=0xce;}_0x3abbc1[_0xf436('0x18')](_0x538914);return _0x3abbc1[_0xf436('0x1f')](_0xf436('0x20'),_0x23bb3e+'-'+_0xff094a+'/'+_0x74f433)[_0xf436('0x1a')](_0x525e15);}return null;};}function patchUpdates(_0x557356){return function(_0xef401){try{jsonpatch['apply'](_0xef401,_0x557356,!![]);}catch(_0xcd632e){return BPromise[_0xf436('0x21')](_0xcd632e);}return _0xef401['save']();};}function saveUpdates(_0x23184b,_0x590c3f){return function(_0x55bc51){if(_0x55bc51){return _0x55bc51['update'](_0x23184b)[_0xf436('0x22')](function(_0x172592){return _0x172592;});}return null;};}function removeEntity(_0x454e68,_0x239c3f){return function(_0x42a97a){if(_0x42a97a){return _0x42a97a['destroy']()['then'](function(){_0x454e68['status'](0xcc)[_0xf436('0x19')]();});}};}function handleEntityNotFound(_0x20cd8c,_0xaed663){return function(_0x39fd58){if(!_0x39fd58){_0x20cd8c[_0xf436('0x23')](0x194);}return _0x39fd58;};}function handleError(_0x2bec3c,_0x437ec7){_0x437ec7=_0x437ec7||0x1f4;return function(_0x59afb2){logger[_0xf436('0x24')](_0x59afb2['stack']);if(_0x59afb2[_0xf436('0x25')]){delete _0x59afb2[_0xf436('0x25')];}_0x2bec3c['status'](_0x437ec7)[_0xf436('0x26')](_0x59afb2);};}exports['index']=function(_0x2210bd,_0xe5b4d2){var _0x4e0f46={},_0x28ed1e={},_0x5ebdad={'count':0x0,'rows':[]};var _0x1505d6=_['map'](db[_0xf436('0x27')][_0xf436('0x28')],function(_0x1c5daa){return{'name':_0x1c5daa[_0xf436('0x29')],'type':_0x1c5daa['type'][_0xf436('0x2a')]};});_0x28ed1e[_0xf436('0x2b')]=_[_0xf436('0x2c')](_0x1505d6,'name');_0x28ed1e[_0xf436('0x2d')]=_[_0xf436('0x2e')](_0x2210bd[_0xf436('0x2d')]);_0x28ed1e['filters']=_[_0xf436('0x2f')](_0x28ed1e[_0xf436('0x2b')],_0x28ed1e[_0xf436('0x2d')]);_0x4e0f46[_0xf436('0x30')]=_[_0xf436('0x2f')](_0x28ed1e[_0xf436('0x2b')],qs[_0xf436('0x31')](_0x2210bd['query']['fields']));_0x4e0f46[_0xf436('0x30')]=_0x4e0f46['attributes'][_0xf436('0x32')]?_0x4e0f46[_0xf436('0x30')]:_0x28ed1e['model'];if(!_0x2210bd[_0xf436('0x2d')]['hasOwnProperty']('nolimit')){_0x4e0f46[_0xf436('0x1d')]=qs[_0xf436('0x1d')](_0x2210bd[_0xf436('0x2d')]['limit']);_0x4e0f46['offset']=qs[_0xf436('0x1b')](_0x2210bd[_0xf436('0x2d')][_0xf436('0x1b')]);}_0x4e0f46[_0xf436('0x33')]=qs[_0xf436('0x34')](_0x2210bd[_0xf436('0x2d')]['sort']);_0x4e0f46[_0xf436('0x35')]=qs['filters'](_['pick'](_0x2210bd[_0xf436('0x2d')],_0x28ed1e['filters']),_0x1505d6);if(_0x2210bd[_0xf436('0x2d')][_0xf436('0x36')]){_0x4e0f46[_0xf436('0x35')]=_['merge'](_0x4e0f46['where'],{'$or':_[_0xf436('0x2c')](_0x1505d6,function(_0xc553d6){if(_0xc553d6[_0xf436('0x37')]!=='VIRTUAL'){var _0x316409={};_0x316409[_0xc553d6[_0xf436('0x25')]]={'$like':'%'+_0x2210bd[_0xf436('0x2d')]['filter']+'%'};return _0x316409;}})});}_0x4e0f46=_[_0xf436('0x38')]({},_0x4e0f46,_0x2210bd[_0xf436('0x39')]);var _0x29b085={'where':_0x4e0f46['where']};return db[_0xf436('0x27')][_0xf436('0x1e')](_0x29b085)['then'](function(_0x578504){_0x5ebdad[_0xf436('0x1e')]=_0x578504;if(_0x2210bd[_0xf436('0x2d')][_0xf436('0x3a')]){_0x4e0f46[_0xf436('0x3b')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x4e0f46);})[_0xf436('0x22')](function(_0xdfe61f){_0x5ebdad[_0xf436('0x3c')]=_0xdfe61f;return _0x5ebdad;})[_0xf436('0x22')](respondWithFilteredResult(_0xe5b4d2,_0x4e0f46))['catch'](handleError(_0xe5b4d2,null));};exports[_0xf436('0x3d')]=function(_0x23c811,_0x56d2ba){var _0x18c0f5={'raw':![],'where':{'id':_0x23c811[_0xf436('0x3e')]['id']}},_0x28e077={};_0x28e077[_0xf436('0x2b')]=_[_0xf436('0x2e')](db[_0xf436('0x27')]['rawAttributes']);_0x28e077[_0xf436('0x2d')]=_[_0xf436('0x2e')](_0x23c811[_0xf436('0x2d')]);_0x28e077['filters']=_[_0xf436('0x2f')](_0x28e077['model'],_0x28e077[_0xf436('0x2d')]);_0x18c0f5[_0xf436('0x30')]=_[_0xf436('0x2f')](_0x28e077[_0xf436('0x2b')],qs[_0xf436('0x31')](_0x23c811[_0xf436('0x2d')][_0xf436('0x31')]));_0x18c0f5[_0xf436('0x30')]=_0x18c0f5[_0xf436('0x30')][_0xf436('0x32')]?_0x18c0f5[_0xf436('0x30')]:_0x28e077[_0xf436('0x2b')];if(_0x23c811[_0xf436('0x2d')]['includeAll']){_0x18c0f5[_0xf436('0x3b')]=[{'all':!![]}];}_0x18c0f5=_[_0xf436('0x38')]({},_0x18c0f5,_0x23c811[_0xf436('0x39')]);return db['SalesforceAccount'][_0xf436('0x3f')](_0x18c0f5)[_0xf436('0x22')](handleEntityNotFound(_0x56d2ba,null))[_0xf436('0x22')](respondWithResult(_0x56d2ba,null))['catch'](handleError(_0x56d2ba,null));};exports[_0xf436('0x40')]=function(_0x3739f0,_0x2abc22){return db[_0xf436('0x27')][_0xf436('0x40')](_0x3739f0[_0xf436('0x41')],{})[_0xf436('0x22')](respondWithResult(_0x2abc22,0xc9))[_0xf436('0x42')](handleError(_0x2abc22,null));};exports['update']=function(_0xa940e4,_0x37e4f8){if(_0xa940e4[_0xf436('0x41')]['id']){delete _0xa940e4[_0xf436('0x41')]['id'];}return db[_0xf436('0x27')]['find']({'where':{'id':_0xa940e4[_0xf436('0x3e')]['id']}})[_0xf436('0x22')](handleEntityNotFound(_0x37e4f8,null))[_0xf436('0x22')](saveUpdates(_0xa940e4['body'],null))[_0xf436('0x22')](respondWithResult(_0x37e4f8,null))[_0xf436('0x42')](handleError(_0x37e4f8,null));};exports[_0xf436('0x43')]=function(_0x203e9f,_0x5dedde){return db[_0xf436('0x27')][_0xf436('0x3f')]({'where':{'id':_0x203e9f['params']['id']}})[_0xf436('0x22')](handleEntityNotFound(_0x5dedde,null))['then'](removeEntity(_0x5dedde,null))[_0xf436('0x42')](handleError(_0x5dedde,null));};exports[_0xf436('0x44')]=function(_0x1aa928,_0x4e3dca,_0x3d7bec){var _0x5689d8={};var _0x49293f={};var _0x532fa0;var _0x27677e;return db[_0xf436('0x27')][_0xf436('0x45')]({'where':{'id':_0x1aa928[_0xf436('0x3e')]['id']}})[_0xf436('0x22')](handleEntityNotFound(_0x4e3dca,null))['then'](function(_0x39c4ea){if(_0x39c4ea){_0x532fa0=_0x39c4ea;_0x49293f[_0xf436('0x2b')]=_[_0xf436('0x2e')](db[_0xf436('0x46')][_0xf436('0x28')]);_0x49293f[_0xf436('0x2d')]=_['keys'](_0x1aa928[_0xf436('0x2d')]);_0x49293f['filters']=_[_0xf436('0x2f')](_0x49293f[_0xf436('0x2b')],_0x49293f[_0xf436('0x2d')]);_0x5689d8[_0xf436('0x30')]=_[_0xf436('0x2f')](_0x49293f[_0xf436('0x2b')],qs[_0xf436('0x31')](_0x1aa928[_0xf436('0x2d')]['fields']));_0x5689d8[_0xf436('0x30')]=_0x5689d8[_0xf436('0x30')][_0xf436('0x32')]?_0x5689d8[_0xf436('0x30')]:_0x49293f[_0xf436('0x2b')];_0x5689d8[_0xf436('0x33')]=qs['sort'](_0x1aa928[_0xf436('0x2d')][_0xf436('0x34')]);_0x5689d8[_0xf436('0x35')]=qs[_0xf436('0x47')](_[_0xf436('0x48')](_0x1aa928['query'],_0x49293f['filters']));if(_0x1aa928[_0xf436('0x2d')][_0xf436('0x36')]){_0x5689d8[_0xf436('0x35')]=_[_0xf436('0x38')](_0x5689d8[_0xf436('0x35')],{'$or':_[_0xf436('0x2c')](_0x5689d8[_0xf436('0x30')],function(_0x4434dd){var _0x561e9d={};_0x561e9d[_0x4434dd]={'$like':'%'+_0x1aa928[_0xf436('0x2d')][_0xf436('0x36')]+'%'};return _0x561e9d;})});}_0x5689d8=_[_0xf436('0x38')]({},_0x5689d8,_0x1aa928[_0xf436('0x39')]);return _0x532fa0[_0xf436('0x44')](_0x5689d8);}})[_0xf436('0x22')](function(_0xdb7a40){if(_0xdb7a40){_0x27677e=_0xdb7a40['length'];if(!_0x1aa928['query'][_0xf436('0x49')](_0xf436('0x4a'))){_0x5689d8[_0xf436('0x1d')]=qs[_0xf436('0x1d')](_0x1aa928[_0xf436('0x2d')]['limit']);_0x5689d8[_0xf436('0x1b')]=qs[_0xf436('0x1b')](_0x1aa928[_0xf436('0x2d')]['offset']);}return _0x532fa0['getConfigurations'](_0x5689d8);}})[_0xf436('0x22')](function(_0x4641d7){if(_0x4641d7){return _0x4641d7?{'count':_0x27677e,'rows':_0x4641d7}:null;}})['then'](respondWithResult(_0x4e3dca,null))[_0xf436('0x42')](handleError(_0x4e3dca,null));};exports[_0xf436('0x4b')]=function(_0x1703fc,_0x19087e,_0x31b3c7){if(_0x1703fc[_0xf436('0x41')]['id']){delete _0x1703fc[_0xf436('0x41')]['id'];}return db['SalesforceAccount'][_0xf436('0x45')]({'where':{'id':_0x1703fc[_0xf436('0x3e')]['id']}})[_0xf436('0x22')](handleEntityNotFound(_0x19087e,null))[_0xf436('0x22')](function(_0xbd0274){if(_0xbd0274){_0x1703fc[_0xf436('0x41')][_0xf436('0x4c')]=_0xbd0274['id'];_0x1703fc[_0xf436('0x41')][_0xf436('0x4d')]=integrations['getSubjects'](_0x1703fc[_0xf436('0x41')][_0xf436('0x4e')],_0x1703fc[_0xf436('0x41')][_0xf436('0x37')]);_0x1703fc[_0xf436('0x41')]['Descriptions']=integrations[_0xf436('0x4f')](_0x1703fc[_0xf436('0x41')][_0xf436('0x4e')],_0x1703fc[_0xf436('0x41')][_0xf436('0x37')]);return db[_0xf436('0x46')][_0xf436('0x40')](_0x1703fc[_0xf436('0x41')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xf436('0x50')],'as':_0xf436('0x51')}]});}return null;})['then'](respondWithResult(_0x19087e,null))[_0xf436('0x42')](handleError(_0x19087e,null));};exports[_0xf436('0x52')]=function(_0x13142f,_0x149f39,_0x1f33e6){var _0x3fa9fc;var _0x3e20d9='';var _0x2b5bd2='Task';return db[_0xf436('0x27')]['findOne']({'where':{'id':_0x13142f[_0xf436('0x3e')]['id']},'attributes':['id',_0xf436('0x53'),_0xf436('0x54'),'clientSecret',_0xf436('0x55'),_0xf436('0x56'),'securityToken']})[_0xf436('0x22')](handleEntityNotFound(_0x149f39,null))['then'](function(_0x4bd6cf){if(_0x4bd6cf){_0x3e20d9=_0x4bd6cf['remoteUri'];var _0x5547f4=_0x3e20d9[_0xf436('0x57')](-0x1);if(_0x5547f4==='/'){_0x3e20d9=_0x3e20d9['substring'](0x0,_0x3e20d9[_0xf436('0x58')](_0x5547f4));}_0x3fa9fc=new jsforce[(_0xf436('0x59'))]({'oauth2':{'loginUrl':_0x3e20d9,'clientId':_0x4bd6cf[_0xf436('0x54')],'clientSecret':_0x4bd6cf[_0xf436('0x5a')]}});return _0x3fa9fc[_0xf436('0x5b')](_0x4bd6cf[_0xf436('0x55')],_0x4bd6cf['password'][_0xf436('0x5c')](_0x4bd6cf[_0xf436('0x5d')]));}})[_0xf436('0x22')](function(_0x18b698){if(_0x18b698){if(!_['isNil'](_0x13142f[_0xf436('0x2d')]['ticketType'])){_0x2b5bd2=_0x13142f[_0xf436('0x2d')]['ticketType'];}return _0x3fa9fc['sobject'](_0x2b5bd2)[_0xf436('0x5e')]();}})['then'](function(_0x5e43a5){var _0x399f00=[_0xf436('0x5f'),_0xf436('0x60'),_0xf436('0x61'),_0xf436('0x62'),_0xf436('0x63'),'Description'];var _0x3bed3f=[_0xf436('0x64'),'int',_0xf436('0x65'),_0xf436('0x66'),_0xf436('0x67'),_0xf436('0x68'),'phone'];if(_0x5e43a5){_[_0xf436('0x69')](_0x5e43a5[_0xf436('0x31')],function(_0x3dc1f3){return _0x399f00['includes'](_0x3dc1f3[_0xf436('0x25')])||!_0x3bed3f['includes'](_0x3dc1f3['type']);});return{'count':_0x5e43a5[_0xf436('0x31')][_0xf436('0x32')],'rows':_[_0xf436('0x2c')](_0x5e43a5['fields'],function(_0x457f3d){return{'id':_0x457f3d[_0xf436('0x25')],'name':_0x457f3d[_0xf436('0x6a')],'custom':_0x457f3d[_0xf436('0x6b')],'options':_0x457f3d[_0xf436('0x6c')][_0xf436('0x32')]>0x0?_[_0xf436('0x2c')](_0x457f3d[_0xf436('0x6c')],function(_0x480b7b){return{'name':_0x480b7b[_0xf436('0x6a')],'value':_0x480b7b[_0xf436('0x6d')]};}):_0x457f3d[_0xf436('0x37')]==_0xf436('0x66')?[{'name':_0xf436('0x6e'),'value':_0xf436('0x6f')},{'name':_0xf436('0x70'),'value':_0xf436('0x71')}]:[]};})};}})[_0xf436('0x22')](respondWithResult(_0x149f39,null))['catch'](function(_0x14e567){var _0x2b5695=_0x13142f[_0xf436('0x2d')][_0xf436('0x72')]?0x1f4:_0x14e567[_0xf436('0x73')]||0x1f4;logger[_0xf436('0x24')](_0xf436('0x74'),'getFields',_0x2b5695,JSON[_0xf436('0x75')](_0x14e567));delete _0x14e567[_0xf436('0x25')];if(_0x2b5695===0x191){_0x2b5695=0x190;}_0x149f39['status'](_0x2b5695)[_0xf436('0x26')](_0x13142f[_0xf436('0x2d')][_0xf436('0x72')]?{'message':_0xf436('0x76'),'statusCode':_0x14e567[_0xf436('0x73')]}:_0x14e567);});}; \ No newline at end of file +var _0x47f7=['count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SalesforceAccount','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','email','textarea','phone','includes','label','picklistValues','value','boolean','false','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','offset','undefined','limit'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0x47f7,0x1c4));var _0x747f=function(_0x39c547,_0x241a80){_0x39c547=_0x39c547-0x0;var _0x2f3439=_0x47f7[_0x39c547];return _0x2f3439;};'use strict';var emlformat=require(_0x747f('0x0'));var rimraf=require(_0x747f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x747f('0x2'));var moment=require(_0x747f('0x3'));var BPromise=require(_0x747f('0x4'));var Mustache=require('mustache');var util=require(_0x747f('0x5'));var path=require(_0x747f('0x6'));var sox=require(_0x747f('0x7'));var csv=require(_0x747f('0x8'));var ejs=require(_0x747f('0x9'));var fs=require('fs');var fs_extra=require(_0x747f('0xa'));var _=require(_0x747f('0xb'));var squel=require(_0x747f('0xc'));var crypto=require(_0x747f('0xd'));var jsforce=require(_0x747f('0xe'));var deskjs=require(_0x747f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x747f('0x10'));var Papa=require('papaparse');var Redis=require(_0x747f('0x11'));var authService=require(_0x747f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x747f('0x13'));var hardwareService=require(_0x747f('0x14'));var logger=require(_0x747f('0x15'))('api');var utils=require(_0x747f('0x16'));var config=require(_0x747f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e16ff,_0x55431a){_0x55431a=_0x55431a||0xcc;return function(_0x2178f1){if(_0x2178f1){return _0x2e16ff['sendStatus'](_0x55431a);}return _0x2e16ff['status'](_0x55431a)[_0x747f('0x18')]();};}function respondWithResult(_0x3f966f,_0x15f738){_0x15f738=_0x15f738||0xc8;return function(_0x122e11){if(_0x122e11){return _0x3f966f['status'](_0x15f738)['json'](_0x122e11);}};}function respondWithFilteredResult(_0x3390cf,_0x4a555f){return function(_0xe7d7f8){if(_0xe7d7f8){var _0x2ad270=typeof _0x4a555f[_0x747f('0x19')]===_0x747f('0x1a')&&typeof _0x4a555f[_0x747f('0x1b')]===_0x747f('0x1a');var _0x52b7db=_0xe7d7f8['count'];var _0x1d21a9=_0x2ad270?0x0:_0x4a555f[_0x747f('0x19')];var _0x9c0c4c=_0x2ad270?_0xe7d7f8[_0x747f('0x1c')]:_0x4a555f[_0x747f('0x19')]+_0x4a555f[_0x747f('0x1b')];var _0xd17702;if(_0x9c0c4c>=_0x52b7db){_0x9c0c4c=_0x52b7db;_0xd17702=0xc8;}else{_0xd17702=0xce;}_0x3390cf[_0x747f('0x1d')](_0xd17702);return _0x3390cf[_0x747f('0x1e')](_0x747f('0x1f'),_0x1d21a9+'-'+_0x9c0c4c+'/'+_0x52b7db)[_0x747f('0x20')](_0xe7d7f8);}return null;};}function patchUpdates(_0x2041b6){return function(_0x4e2637){try{jsonpatch[_0x747f('0x21')](_0x4e2637,_0x2041b6,!![]);}catch(_0x5f45e0){return BPromise[_0x747f('0x22')](_0x5f45e0);}return _0x4e2637[_0x747f('0x23')]();};}function saveUpdates(_0x5f5d47,_0x10b008){return function(_0x296c){if(_0x296c){return _0x296c[_0x747f('0x24')](_0x5f5d47)[_0x747f('0x25')](function(_0x7cd974){return _0x7cd974;});}return null;};}function removeEntity(_0xd63675,_0x40d42b){return function(_0x3c6a16){if(_0x3c6a16){return _0x3c6a16[_0x747f('0x26')]()['then'](function(){_0xd63675['status'](0xcc)[_0x747f('0x18')]();});}};}function handleEntityNotFound(_0x32a227,_0x131bfc){return function(_0x5ea078){if(!_0x5ea078){_0x32a227[_0x747f('0x27')](0x194);}return _0x5ea078;};}function handleError(_0x531573,_0x72ce52){_0x72ce52=_0x72ce52||0x1f4;return function(_0x4e5d27){logger['error'](_0x4e5d27[_0x747f('0x28')]);if(_0x4e5d27[_0x747f('0x29')]){delete _0x4e5d27[_0x747f('0x29')];}_0x531573['status'](_0x72ce52)[_0x747f('0x2a')](_0x4e5d27);};}exports[_0x747f('0x2b')]=function(_0x40a338,_0x411715){var _0x4e1930={},_0x56cc47={},_0x58aaa8={'count':0x0,'rows':[]};var _0x40591b=_[_0x747f('0x2c')](db[_0x747f('0x2d')]['rawAttributes'],function(_0x15f280){return{'name':_0x15f280[_0x747f('0x2e')],'type':_0x15f280[_0x747f('0x2f')]['key']};});_0x56cc47[_0x747f('0x30')]=_[_0x747f('0x2c')](_0x40591b,'name');_0x56cc47[_0x747f('0x31')]=_[_0x747f('0x32')](_0x40a338[_0x747f('0x31')]);_0x56cc47['filters']=_[_0x747f('0x33')](_0x56cc47[_0x747f('0x30')],_0x56cc47[_0x747f('0x31')]);_0x4e1930['attributes']=_['intersection'](_0x56cc47['model'],qs['fields'](_0x40a338[_0x747f('0x31')][_0x747f('0x34')]));_0x4e1930[_0x747f('0x35')]=_0x4e1930[_0x747f('0x35')][_0x747f('0x36')]?_0x4e1930['attributes']:_0x56cc47[_0x747f('0x30')];if(!_0x40a338[_0x747f('0x31')][_0x747f('0x37')]('nolimit')){_0x4e1930[_0x747f('0x1b')]=qs[_0x747f('0x1b')](_0x40a338[_0x747f('0x31')][_0x747f('0x1b')]);_0x4e1930[_0x747f('0x19')]=qs[_0x747f('0x19')](_0x40a338['query'][_0x747f('0x19')]);}_0x4e1930[_0x747f('0x38')]=qs[_0x747f('0x39')](_0x40a338[_0x747f('0x31')][_0x747f('0x39')]);_0x4e1930['where']=qs[_0x747f('0x3a')](_[_0x747f('0x3b')](_0x40a338['query'],_0x56cc47[_0x747f('0x3a')]),_0x40591b);if(_0x40a338[_0x747f('0x31')][_0x747f('0x3c')]){_0x4e1930[_0x747f('0x3d')]=_[_0x747f('0x3e')](_0x4e1930['where'],{'$or':_[_0x747f('0x2c')](_0x40591b,function(_0x23a4f7){if(_0x23a4f7['type']!=='VIRTUAL'){var _0x19f449={};_0x19f449[_0x23a4f7[_0x747f('0x29')]]={'$like':'%'+_0x40a338[_0x747f('0x31')][_0x747f('0x3c')]+'%'};return _0x19f449;}})});}_0x4e1930=_[_0x747f('0x3e')]({},_0x4e1930,_0x40a338[_0x747f('0x3f')]);var _0x5ebd07={'where':_0x4e1930[_0x747f('0x3d')]};return db['SalesforceAccount'][_0x747f('0x1c')](_0x5ebd07)[_0x747f('0x25')](function(_0x344d2f){_0x58aaa8[_0x747f('0x1c')]=_0x344d2f;if(_0x40a338['query'][_0x747f('0x40')]){_0x4e1930[_0x747f('0x41')]=[{'all':!![]}];}return db[_0x747f('0x2d')][_0x747f('0x42')](_0x4e1930);})[_0x747f('0x25')](function(_0xafeeef){_0x58aaa8[_0x747f('0x43')]=_0xafeeef;return _0x58aaa8;})[_0x747f('0x25')](respondWithFilteredResult(_0x411715,_0x4e1930))[_0x747f('0x44')](handleError(_0x411715,null));};exports['show']=function(_0x94a644,_0x24dfe4){var _0x5b6889={'raw':![],'where':{'id':_0x94a644[_0x747f('0x45')]['id']}},_0x3e38ec={};_0x3e38ec[_0x747f('0x30')]=_[_0x747f('0x32')](db[_0x747f('0x2d')][_0x747f('0x46')]);_0x3e38ec[_0x747f('0x31')]=_[_0x747f('0x32')](_0x94a644['query']);_0x3e38ec[_0x747f('0x3a')]=_[_0x747f('0x33')](_0x3e38ec[_0x747f('0x30')],_0x3e38ec[_0x747f('0x31')]);_0x5b6889[_0x747f('0x35')]=_[_0x747f('0x33')](_0x3e38ec[_0x747f('0x30')],qs['fields'](_0x94a644[_0x747f('0x31')]['fields']));_0x5b6889[_0x747f('0x35')]=_0x5b6889[_0x747f('0x35')]['length']?_0x5b6889['attributes']:_0x3e38ec[_0x747f('0x30')];if(_0x94a644[_0x747f('0x31')][_0x747f('0x40')]){_0x5b6889['include']=[{'all':!![]}];}_0x5b6889=_['merge']({},_0x5b6889,_0x94a644[_0x747f('0x3f')]);return db['SalesforceAccount'][_0x747f('0x47')](_0x5b6889)['then'](handleEntityNotFound(_0x24dfe4,null))[_0x747f('0x25')](respondWithResult(_0x24dfe4,null))[_0x747f('0x44')](handleError(_0x24dfe4,null));};exports[_0x747f('0x48')]=function(_0x400836,_0x11245f){return db[_0x747f('0x2d')][_0x747f('0x48')](_0x400836['body'],{})[_0x747f('0x25')](respondWithResult(_0x11245f,0xc9))[_0x747f('0x44')](handleError(_0x11245f,null));};exports[_0x747f('0x24')]=function(_0x49144e,_0x30004a){if(_0x49144e[_0x747f('0x49')]['id']){delete _0x49144e[_0x747f('0x49')]['id'];}return db[_0x747f('0x2d')]['find']({'where':{'id':_0x49144e[_0x747f('0x45')]['id']}})[_0x747f('0x25')](handleEntityNotFound(_0x30004a,null))[_0x747f('0x25')](saveUpdates(_0x49144e['body'],null))[_0x747f('0x25')](respondWithResult(_0x30004a,null))[_0x747f('0x44')](handleError(_0x30004a,null));};exports[_0x747f('0x26')]=function(_0x4c868f,_0x280b6d){return db['SalesforceAccount'][_0x747f('0x47')]({'where':{'id':_0x4c868f[_0x747f('0x45')]['id']}})['then'](handleEntityNotFound(_0x280b6d,null))[_0x747f('0x25')](removeEntity(_0x280b6d,null))['catch'](handleError(_0x280b6d,null));};exports[_0x747f('0x4a')]=function(_0x34fbf0,_0x4bdb08,_0x2e6919){var _0x1f8477={};var _0x52973d={};var _0x531991;var _0xc54171;return db[_0x747f('0x2d')]['findOne']({'where':{'id':_0x34fbf0[_0x747f('0x45')]['id']}})[_0x747f('0x25')](handleEntityNotFound(_0x4bdb08,null))[_0x747f('0x25')](function(_0x2cb906){if(_0x2cb906){_0x531991=_0x2cb906;_0x52973d[_0x747f('0x30')]=_[_0x747f('0x32')](db[_0x747f('0x4b')][_0x747f('0x46')]);_0x52973d[_0x747f('0x31')]=_[_0x747f('0x32')](_0x34fbf0[_0x747f('0x31')]);_0x52973d[_0x747f('0x3a')]=_[_0x747f('0x33')](_0x52973d[_0x747f('0x30')],_0x52973d[_0x747f('0x31')]);_0x1f8477[_0x747f('0x35')]=_['intersection'](_0x52973d[_0x747f('0x30')],qs[_0x747f('0x34')](_0x34fbf0[_0x747f('0x31')]['fields']));_0x1f8477['attributes']=_0x1f8477[_0x747f('0x35')][_0x747f('0x36')]?_0x1f8477['attributes']:_0x52973d[_0x747f('0x30')];_0x1f8477['order']=qs[_0x747f('0x39')](_0x34fbf0[_0x747f('0x31')][_0x747f('0x39')]);_0x1f8477['where']=qs[_0x747f('0x3a')](_[_0x747f('0x3b')](_0x34fbf0[_0x747f('0x31')],_0x52973d[_0x747f('0x3a')]));if(_0x34fbf0['query']['filter']){_0x1f8477[_0x747f('0x3d')]=_[_0x747f('0x3e')](_0x1f8477[_0x747f('0x3d')],{'$or':_[_0x747f('0x2c')](_0x1f8477[_0x747f('0x35')],function(_0x1da491){var _0x22ccc6={};_0x22ccc6[_0x1da491]={'$like':'%'+_0x34fbf0[_0x747f('0x31')]['filter']+'%'};return _0x22ccc6;})});}_0x1f8477=_[_0x747f('0x3e')]({},_0x1f8477,_0x34fbf0[_0x747f('0x3f')]);return _0x531991[_0x747f('0x4a')](_0x1f8477);}})['then'](function(_0x4ab819){if(_0x4ab819){_0xc54171=_0x4ab819['length'];if(!_0x34fbf0[_0x747f('0x31')]['hasOwnProperty']('nolimit')){_0x1f8477[_0x747f('0x1b')]=qs[_0x747f('0x1b')](_0x34fbf0[_0x747f('0x31')]['limit']);_0x1f8477['offset']=qs[_0x747f('0x19')](_0x34fbf0[_0x747f('0x31')][_0x747f('0x19')]);}return _0x531991[_0x747f('0x4a')](_0x1f8477);}})['then'](function(_0xe4698a){if(_0xe4698a){return _0xe4698a?{'count':_0xc54171,'rows':_0xe4698a}:null;}})[_0x747f('0x25')](respondWithResult(_0x4bdb08,null))[_0x747f('0x44')](handleError(_0x4bdb08,null));};exports[_0x747f('0x4c')]=function(_0x56860a,_0x24c0de,_0x3db9d7){if(_0x56860a[_0x747f('0x49')]['id']){delete _0x56860a['body']['id'];}return db[_0x747f('0x2d')]['findOne']({'where':{'id':_0x56860a[_0x747f('0x45')]['id']}})[_0x747f('0x25')](handleEntityNotFound(_0x24c0de,null))[_0x747f('0x25')](function(_0x528068){if(_0x528068){_0x56860a[_0x747f('0x49')][_0x747f('0x4d')]=_0x528068['id'];_0x56860a['body'][_0x747f('0x4e')]=integrations[_0x747f('0x4f')](_0x56860a[_0x747f('0x49')][_0x747f('0x50')],_0x56860a[_0x747f('0x49')][_0x747f('0x2f')]);_0x56860a[_0x747f('0x49')]['Descriptions']=integrations[_0x747f('0x51')](_0x56860a[_0x747f('0x49')][_0x747f('0x50')],_0x56860a[_0x747f('0x49')][_0x747f('0x2f')]);return db[_0x747f('0x4b')]['create'](_0x56860a[_0x747f('0x49')],{'include':[{'model':db[_0x747f('0x52')],'as':_0x747f('0x4e')},{'model':db[_0x747f('0x52')],'as':_0x747f('0x53')}]});}return null;})[_0x747f('0x25')](respondWithResult(_0x24c0de,null))[_0x747f('0x44')](handleError(_0x24c0de,null));};exports['getFields']=function(_0x5bab40,_0x2611f3,_0x433cda){var _0xc8cc85;var _0x439e65='';var _0x3e5448=_0x747f('0x54');return db['SalesforceAccount']['findOne']({'where':{'id':_0x5bab40[_0x747f('0x45')]['id']},'attributes':['id',_0x747f('0x55'),_0x747f('0x56'),_0x747f('0x57'),_0x747f('0x58'),_0x747f('0x59'),_0x747f('0x5a')]})['then'](handleEntityNotFound(_0x2611f3,null))[_0x747f('0x25')](function(_0x4c147f){if(_0x4c147f){_0x439e65=_0x4c147f[_0x747f('0x55')];var _0x395589=_0x439e65['slice'](-0x1);if(_0x395589==='/'){_0x439e65=_0x439e65[_0x747f('0x5b')](0x0,_0x439e65[_0x747f('0x5c')](_0x395589));}_0xc8cc85=new jsforce[(_0x747f('0x5d'))]({'oauth2':{'loginUrl':_0x439e65,'clientId':_0x4c147f[_0x747f('0x56')],'clientSecret':_0x4c147f['clientSecret']}});return _0xc8cc85[_0x747f('0x5e')](_0x4c147f[_0x747f('0x58')],_0x4c147f[_0x747f('0x59')][_0x747f('0x5f')](_0x4c147f[_0x747f('0x5a')]));}})['then'](function(_0x4f193e){if(_0x4f193e){if(!_['isNil'](_0x5bab40[_0x747f('0x31')][_0x747f('0x60')])){_0x3e5448=_0x5bab40[_0x747f('0x31')]['ticketType'];}return _0xc8cc85[_0x747f('0x61')](_0x3e5448)['describe']();}})['then'](function(_0x92b9b0){var _0x209098=[_0x747f('0x62'),_0x747f('0x63'),_0x747f('0x64'),_0x747f('0x65'),'Subject',_0x747f('0x66')];var _0x394cba=[_0x747f('0x67'),_0x747f('0x68'),_0x747f('0x69'),'boolean',_0x747f('0x6a'),_0x747f('0x6b'),_0x747f('0x6c')];if(_0x92b9b0){_['remove'](_0x92b9b0[_0x747f('0x34')],function(_0x2f8e23){return _0x209098[_0x747f('0x6d')](_0x2f8e23[_0x747f('0x29')])||!_0x394cba[_0x747f('0x6d')](_0x2f8e23[_0x747f('0x2f')]);});return{'count':_0x92b9b0[_0x747f('0x34')][_0x747f('0x36')],'rows':_[_0x747f('0x2c')](_0x92b9b0[_0x747f('0x34')],function(_0x4171ac){return{'id':_0x4171ac['name'],'name':_0x4171ac[_0x747f('0x6e')],'custom':_0x4171ac['custom'],'options':_0x4171ac[_0x747f('0x6f')][_0x747f('0x36')]>0x0?_['map'](_0x4171ac[_0x747f('0x6f')],function(_0x598217){return{'name':_0x598217[_0x747f('0x6e')],'value':_0x598217[_0x747f('0x70')]};}):_0x4171ac[_0x747f('0x2f')]==_0x747f('0x71')?[{'name':'True','value':'true'},{'name':'False','value':_0x747f('0x72')}]:[]};})};}})[_0x747f('0x25')](respondWithResult(_0x2611f3,null))[_0x747f('0x44')](function(_0x5dfefc){var _0x2becd6=_0x5bab40[_0x747f('0x31')][_0x747f('0x73')]?0x1f4:_0x5dfefc[_0x747f('0x74')]||0x1f4;logger[_0x747f('0x75')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2becd6,JSON[_0x747f('0x76')](_0x5dfefc));delete _0x5dfefc['name'];if(_0x2becd6===0x191){_0x2becd6=0x190;}_0x2611f3[_0x747f('0x1d')](_0x2becd6)[_0x747f('0x2a')](_0x5bab40[_0x747f('0x31')][_0x747f('0x73')]?{'message':_0x747f('0x77'),'statusCode':_0x5dfefc[_0x747f('0x74')]}:_0x5dfefc);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index da0437e..04a7561 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 _0xe14b=['util','api','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x340d75,_0x561cb0){var _0x3f1114=function(_0x2e2bcf){while(--_0x2e2bcf){_0x340d75['push'](_0x340d75['shift']());}};_0x3f1114(++_0x561cb0);}(_0xe14b,0xbf));var _0xbe14=function(_0x5ec193,_0x24ee84){_0x5ec193=_0x5ec193-0x0;var _0x1cb2c5=_0xe14b[_0x5ec193];return _0x1cb2c5;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require(_0xbe14('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x5'));var rimraf=require(_0xbe14('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xbe14('0x7'));module[_0xbe14('0x8')]=function(_0x489cfb,_0x2e51eb){return _0x489cfb[_0xbe14('0x9')](_0xbe14('0xa'),attributes,{'tableName':_0xbe14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x737c=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','util','../../config/logger'];(function(_0xc85a84,_0x582d2c){var _0xfb2f9b=function(_0x521cd3){while(--_0x521cd3){_0xc85a84['push'](_0xc85a84['shift']());}};_0xfb2f9b(++_0x582d2c);}(_0x737c,0x148));var _0xc737=function(_0x2c0abe,_0x2a14c4){_0x2c0abe=_0x2c0abe-0x0;var _0x1b0041=_0x737c[_0x2c0abe];return _0x1b0041;};'use strict';var _=require('lodash');var util=require(_0xc737('0x0'));var logger=require(_0xc737('0x1'))(_0xc737('0x2'));var moment=require(_0xc737('0x3'));var BPromise=require(_0xc737('0x4'));var rp=require(_0xc737('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc737('0x6'));var config=require(_0xc737('0x7'));var attributes=require(_0xc737('0x8'));var integrations=require(_0xc737('0x9'));module[_0xc737('0xa')]=function(_0x12f4f4,_0x3570dd){return _0x12f4f4['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 c5360e7..23cbeba 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 _0x77d6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','SalesforceAccount','find','moment','bluebird'];(function(_0xb25437,_0x5b1b42){var _0x105ba2=function(_0x2c9873){while(--_0x2c9873){_0xb25437['push'](_0xb25437['shift']());}};_0x105ba2(++_0x5b1b42);}(_0x77d6,0x17f));var _0x677d=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x77d6[_0x56ba92];return _0x8fe94d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x677d('0x0'));var BPromise=require(_0x677d('0x1'));var rs=require(_0x677d('0x2'));var fs=require('fs');var Redis=require(_0x677d('0x3'));var db=require(_0x677d('0x4'))['db'];var utils=require(_0x677d('0x5'));var logger=require('../../config/logger')(_0x677d('0x6'));var config=require(_0x677d('0x7'));var jayson=require(_0x677d('0x8'));var client=jayson[_0x677d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30ceb1,_0x1e888f,_0x50e45b){return new BPromise(function(_0x11bdf3,_0x1d73d9){return client[_0x677d('0xa')](_0x30ceb1,_0x50e45b)[_0x677d('0xb')](function(_0x5b42b5){logger[_0x677d('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1e888f,_0x677d('0xd'));logger[_0x677d('0xe')](_0x677d('0xf'),_0x1e888f,'request\x20sent',JSON[_0x677d('0x10')](_0x5b42b5));if(_0x5b42b5['error']){if(_0x5b42b5['error'][_0x677d('0x11')]===0x1f4){logger[_0x677d('0x12')](_0x677d('0x13'),_0x1e888f,_0x5b42b5['error'][_0x677d('0x14')]);return _0x1d73d9(_0x5b42b5[_0x677d('0x12')][_0x677d('0x14')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1e888f,_0x5b42b5[_0x677d('0x12')]['message']);return _0x11bdf3(_0x5b42b5['error'][_0x677d('0x14')]);}else{logger[_0x677d('0xc')](_0x677d('0x13'),_0x1e888f,_0x677d('0xd'));_0x11bdf3(_0x5b42b5['result'][_0x677d('0x14')]);}})[_0x677d('0x15')](function(_0x1e0d9a){logger[_0x677d('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x1e888f,_0x1e0d9a);_0x1d73d9(_0x1e0d9a);});});}exports[_0x677d('0x16')]=function(_0x1ca474){var _0x26ee74=this;return new Promise(function(_0x3c54c4,_0x1616e8){return db['SalesforceAccount'][_0x677d('0x17')]({'raw':_0x1ca474[_0x677d('0x18')]?_0x1ca474[_0x677d('0x18')][_0x677d('0x19')]===undefined?!![]:![]:!![],'where':_0x1ca474['options']?_0x1ca474[_0x677d('0x18')][_0x677d('0x1a')]||null:null,'attributes':_0x1ca474[_0x677d('0x18')]?_0x1ca474[_0x677d('0x18')][_0x677d('0x1b')]||null:null,'limit':_0x1ca474['options']?_0x1ca474[_0x677d('0x18')][_0x677d('0x1c')]||null:null,'include':_0x1ca474[_0x677d('0x18')]?_0x1ca474[_0x677d('0x18')][_0x677d('0x1d')]?_[_0x677d('0x1e')](_0x1ca474[_0x677d('0x18')][_0x677d('0x1d')],function(_0x184d37){return{'model':db[_0x184d37[_0x677d('0x1f')]],'as':_0x184d37['as'],'attributes':_0x184d37[_0x677d('0x1b')],'include':_0x184d37[_0x677d('0x1d')]?_[_0x677d('0x1e')](_0x184d37[_0x677d('0x1d')],function(_0x4da507){return{'model':db[_0x4da507[_0x677d('0x1f')]],'as':_0x4da507['as'],'attributes':_0x4da507[_0x677d('0x1b')],'include':_0x4da507[_0x677d('0x1d')]?_[_0x677d('0x1e')](_0x4da507['include'],function(_0x23ffce){return{'model':db[_0x23ffce['model']],'as':_0x23ffce['as'],'attributes':_0x23ffce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e2eb7){logger[_0x677d('0xc')](_0x677d('0x16'),_0x1ca474);logger[_0x677d('0xe')]('GetSalesforceAccount',_0x1ca474,JSON['stringify'](_0x5e2eb7));_0x3c54c4(_0x5e2eb7);})['catch'](function(_0x62e060){logger['error'](_0x677d('0x16'),_0x62e060['message'],_0x1ca474);_0x1616e8(_0x26ee74[_0x677d('0x12')](0x1f4,_0x62e060[_0x677d('0x14')]));});});};exports[_0x677d('0x20')]=function(_0x3e8674){var _0x3f3a1e=this;return new Promise(function(_0x28174e,_0x366ab0){return db[_0x677d('0x21')][_0x677d('0x22')]({'raw':_0x3e8674['options']?_0x3e8674[_0x677d('0x18')][_0x677d('0x19')]===undefined?!![]:![]:!![],'where':_0x3e8674[_0x677d('0x18')]?_0x3e8674['options'][_0x677d('0x1a')]||null:null,'attributes':_0x3e8674['options']?_0x3e8674[_0x677d('0x18')]['attributes']||null:null,'include':_0x3e8674[_0x677d('0x18')]?_0x3e8674[_0x677d('0x18')]['include']?_[_0x677d('0x1e')](_0x3e8674[_0x677d('0x18')][_0x677d('0x1d')],function(_0x12e81d){return{'model':db[_0x12e81d[_0x677d('0x1f')]],'as':_0x12e81d['as'],'attributes':_0x12e81d[_0x677d('0x1b')],'include':_0x12e81d[_0x677d('0x1d')]?_[_0x677d('0x1e')](_0x12e81d[_0x677d('0x1d')],function(_0x113f36){return{'model':db[_0x113f36['model']],'as':_0x113f36['as'],'attributes':_0x113f36[_0x677d('0x1b')],'include':_0x113f36[_0x677d('0x1d')]?_[_0x677d('0x1e')](_0x113f36[_0x677d('0x1d')],function(_0x314a35){return{'model':db[_0x314a35[_0x677d('0x1f')]],'as':_0x314a35['as'],'attributes':_0x314a35['attributes']};}):[]};}):[]};}):[]:[]})[_0x677d('0xb')](function(_0x38650d){logger[_0x677d('0xc')](_0x677d('0x20'),_0x3e8674);logger[_0x677d('0xe')](_0x677d('0x20'),_0x3e8674,JSON[_0x677d('0x10')](_0x38650d));_0x28174e(_0x38650d);})[_0x677d('0x15')](function(_0x56ab43){logger[_0x677d('0x12')](_0x677d('0x20'),_0x56ab43[_0x677d('0x14')],_0x3e8674);_0x366ab0(_0x3f3a1e[_0x677d('0x12')](0x1f4,_0x56ab43[_0x677d('0x14')]));});});}; \ No newline at end of file +var _0x734f=['limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x42c404,_0x5af235){var _0x161cc4=function(_0x9f407e){while(--_0x9f407e){_0x42c404['push'](_0x42c404['shift']());}};_0x161cc4(++_0x5af235);}(_0x734f,0xd3));var _0xf734=function(_0x17558f,_0x42f9f5){_0x17558f=_0x17558f-0x0;var _0x4a81a5=_0x734f[_0x17558f];return _0x4a81a5;};'use strict';var _=require(_0xf734('0x0'));var util=require(_0xf734('0x1'));var moment=require(_0xf734('0x2'));var BPromise=require('bluebird');var rs=require(_0xf734('0x3'));var fs=require('fs');var Redis=require(_0xf734('0x4'));var db=require(_0xf734('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf734('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf734('0x7')][_0xf734('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xeec18a,_0x55ee48,_0x17cbf2){return new BPromise(function(_0x2285f3,_0x4bc1ca){return client['request'](_0xeec18a,_0x17cbf2)[_0xf734('0x9')](function(_0x5a288b){logger[_0xf734('0xa')](_0xf734('0xb'),_0x55ee48,'request\x20sent');logger[_0xf734('0xc')](_0xf734('0xd'),_0x55ee48,_0xf734('0xe'),JSON[_0xf734('0xf')](_0x5a288b));if(_0x5a288b[_0xf734('0x10')]){if(_0x5a288b[_0xf734('0x10')][_0xf734('0x11')]===0x1f4){logger['error'](_0xf734('0xb'),_0x55ee48,_0x5a288b[_0xf734('0x10')][_0xf734('0x12')]);return _0x4bc1ca(_0x5a288b['error'][_0xf734('0x12')]);}logger[_0xf734('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x55ee48,_0x5a288b[_0xf734('0x10')]['message']);return _0x2285f3(_0x5a288b[_0xf734('0x10')][_0xf734('0x12')]);}else{logger['info'](_0xf734('0xb'),_0x55ee48,'request\x20sent');_0x2285f3(_0x5a288b[_0xf734('0x13')][_0xf734('0x12')]);}})[_0xf734('0x14')](function(_0x37d6ca){logger['error'](_0xf734('0xb'),_0x55ee48,_0x37d6ca);_0x4bc1ca(_0x37d6ca);});});}exports['GetSalesforceAccount']=function(_0x1cb7b3){var _0x4ee6ed=this;return new Promise(function(_0x115f2e,_0x5b4eed){return db[_0xf734('0x15')][_0xf734('0x16')]({'raw':_0x1cb7b3[_0xf734('0x17')]?_0x1cb7b3[_0xf734('0x17')][_0xf734('0x18')]===undefined?!![]:![]:!![],'where':_0x1cb7b3[_0xf734('0x17')]?_0x1cb7b3['options'][_0xf734('0x19')]||null:null,'attributes':_0x1cb7b3[_0xf734('0x17')]?_0x1cb7b3[_0xf734('0x17')][_0xf734('0x1a')]||null:null,'limit':_0x1cb7b3[_0xf734('0x17')]?_0x1cb7b3['options'][_0xf734('0x1b')]||null:null,'include':_0x1cb7b3[_0xf734('0x17')]?_0x1cb7b3[_0xf734('0x17')][_0xf734('0x1c')]?_[_0xf734('0x1d')](_0x1cb7b3[_0xf734('0x17')][_0xf734('0x1c')],function(_0x32d0a3){return{'model':db[_0x32d0a3['model']],'as':_0x32d0a3['as'],'attributes':_0x32d0a3[_0xf734('0x1a')],'include':_0x32d0a3[_0xf734('0x1c')]?_[_0xf734('0x1d')](_0x32d0a3[_0xf734('0x1c')],function(_0x277570){return{'model':db[_0x277570[_0xf734('0x1e')]],'as':_0x277570['as'],'attributes':_0x277570[_0xf734('0x1a')],'include':_0x277570[_0xf734('0x1c')]?_[_0xf734('0x1d')](_0x277570[_0xf734('0x1c')],function(_0x879fb5){return{'model':db[_0x879fb5[_0xf734('0x1e')]],'as':_0x879fb5['as'],'attributes':_0x879fb5['attributes']};}):[]};}):[]};}):[]:[]})[_0xf734('0x9')](function(_0x5ac318){logger['info'](_0xf734('0x1f'),_0x1cb7b3);logger[_0xf734('0xc')]('GetSalesforceAccount',_0x1cb7b3,JSON[_0xf734('0xf')](_0x5ac318));_0x115f2e(_0x5ac318);})['catch'](function(_0x2c48bd){logger['error'](_0xf734('0x1f'),_0x2c48bd[_0xf734('0x12')],_0x1cb7b3);_0x5b4eed(_0x4ee6ed[_0xf734('0x10')](0x1f4,_0x2c48bd[_0xf734('0x12')]));});});};exports[_0xf734('0x20')]=function(_0x2e56c9){var _0x568c60=this;return new Promise(function(_0xa240dc,_0x3d33b3){return db[_0xf734('0x15')][_0xf734('0x21')]({'raw':_0x2e56c9[_0xf734('0x17')]?_0x2e56c9[_0xf734('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e56c9['options']?_0x2e56c9['options']['where']||null:null,'attributes':_0x2e56c9[_0xf734('0x17')]?_0x2e56c9[_0xf734('0x17')][_0xf734('0x1a')]||null:null,'include':_0x2e56c9[_0xf734('0x17')]?_0x2e56c9[_0xf734('0x17')]['include']?_[_0xf734('0x1d')](_0x2e56c9[_0xf734('0x17')][_0xf734('0x1c')],function(_0x2f1a32){return{'model':db[_0x2f1a32[_0xf734('0x1e')]],'as':_0x2f1a32['as'],'attributes':_0x2f1a32[_0xf734('0x1a')],'include':_0x2f1a32['include']?_[_0xf734('0x1d')](_0x2f1a32[_0xf734('0x1c')],function(_0x379527){return{'model':db[_0x379527[_0xf734('0x1e')]],'as':_0x379527['as'],'attributes':_0x379527[_0xf734('0x1a')],'include':_0x379527['include']?_['map'](_0x379527[_0xf734('0x1c')],function(_0x2fd1c9){return{'model':db[_0x2fd1c9[_0xf734('0x1e')]],'as':_0x2fd1c9['as'],'attributes':_0x2fd1c9[_0xf734('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x524dc6){logger['info'](_0xf734('0x20'),_0x2e56c9);logger[_0xf734('0xc')](_0xf734('0x20'),_0x2e56c9,JSON['stringify'](_0x524dc6));_0xa240dc(_0x524dc6);})[_0xf734('0x14')](function(_0x5569d7){logger[_0xf734('0x10')](_0xf734('0x20'),_0x5569d7[_0xf734('0x12')],_0x2e56c9);_0x3d33b3(_0x568c60[_0xf734('0x10')](0x1f4,_0x5569d7[_0xf734('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index fc6fc2e..aceb09a 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x0b0e[_0x3c0dcc];return _0x1a224c;};'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['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x5b7386,_0x232305){_0x5b7386=_0x5b7386-0x0;var _0x48e591=_0x2032[_0x5b7386];return _0x48e591;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index dbed2df..00594d8 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 _0xf642=['ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing','STRING','sequelize','exports','Task','Case'];(function(_0x6e1bb0,_0x20a43e){var _0x469e2c=function(_0x2ca5db){while(--_0x2ca5db){_0x6e1bb0['push'](_0x6e1bb0['shift']());}};_0x469e2c(++_0x20a43e);}(_0xf642,0xbc));var _0x2f64=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xf642[_0x361d3f];return _0x320229;};'use strict';var Sequelize=require(_0x2f64('0x0'));module[_0x2f64('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x2f64('0x2'),_0x2f64('0x3')),'defaultValue':_0x2f64('0x2')},'moduleSearch':{'type':Sequelize[_0x2f64('0x4')](_0x2f64('0x5'),_0x2f64('0x6'),_0x2f64('0x7'),_0x2f64('0x8'),_0x2f64('0x9')),'defaultValue':_0x2f64('0x5')},'moduleCreate':{'type':Sequelize[_0x2f64('0x4')](_0x2f64('0xa'),_0x2f64('0x6'),_0x2f64('0x7'),'account'),'defaultValue':_0x2f64('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x2f64('0xb')]},'additionalSearchContact':{'type':Sequelize[_0x2f64('0xb')]},'additionalSearchLead':{'type':Sequelize[_0x2f64('0xb')]}}; \ No newline at end of file +var _0xaa12=['contact','lead','account_contact_lead','account','nothing','sequelize','STRING','Task','Case','ENUM','contact_lead'];(function(_0x205268,_0x573ed4){var _0x1e67a4=function(_0x1f18f8){while(--_0x1f18f8){_0x205268['push'](_0x205268['shift']());}};_0x1e67a4(++_0x573ed4);}(_0xaa12,0xec));var _0x2aa1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaa12[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x2aa1('0x0'));module['exports']={'name':{'type':Sequelize[_0x2aa1('0x1')]},'description':{'type':Sequelize[_0x2aa1('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x2aa1('0x2'),_0x2aa1('0x3')),'defaultValue':_0x2aa1('0x2')},'moduleSearch':{'type':Sequelize[_0x2aa1('0x4')](_0x2aa1('0x5'),_0x2aa1('0x6'),_0x2aa1('0x7'),_0x2aa1('0x8'),_0x2aa1('0x9')),'defaultValue':_0x2aa1('0x5')},'moduleCreate':{'type':Sequelize[_0x2aa1('0x4')](_0x2aa1('0xa'),_0x2aa1('0x6'),'lead',_0x2aa1('0x9')),'defaultValue':_0x2aa1('0x7')},'leadId':{'type':Sequelize[_0x2aa1('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x2aa1('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x2aa1('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x2aa1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1d7fafa..2b4b010 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 _0x8ae8=['model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','fields','find','create','body','params','findOne','SalesforceField','sort','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','then','end','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x8ae8,0x163));var _0x88ae=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0x8ae8[_0x11d684];return _0x78a301;};'use strict';var emlformat=require(_0x88ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88ae('0x1'));var jsonpatch=require(_0x88ae('0x2'));var rp=require(_0x88ae('0x3'));var moment=require(_0x88ae('0x4'));var BPromise=require(_0x88ae('0x5'));var Mustache=require(_0x88ae('0x6'));var util=require(_0x88ae('0x7'));var path=require(_0x88ae('0x8'));var sox=require('sox');var csv=require(_0x88ae('0x9'));var ejs=require(_0x88ae('0xa'));var fs=require('fs');var fs_extra=require(_0x88ae('0xb'));var _=require(_0x88ae('0xc'));var squel=require(_0x88ae('0xd'));var crypto=require('crypto');var jsforce=require(_0x88ae('0xe'));var deskjs=require(_0x88ae('0xf'));var toCsv=require(_0x88ae('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x88ae('0x10'));var authService=require(_0x88ae('0x11'));var qs=require(_0x88ae('0x12'));var as=require(_0x88ae('0x13'));var hardwareService=require(_0x88ae('0x14'));var logger=require(_0x88ae('0x15'))(_0x88ae('0x16'));var utils=require('../../config/utils');var config=require(_0x88ae('0x17'));var licenseUtil=require(_0x88ae('0x18'));var db=require(_0x88ae('0x19'))['db'];function respondWithStatusCode(_0x2488e1,_0x8c98db){_0x8c98db=_0x8c98db||0xcc;return function(_0x3cafbc){if(_0x3cafbc){return _0x2488e1[_0x88ae('0x1a')](_0x8c98db);}return _0x2488e1['status'](_0x8c98db)['end']();};}function respondWithResult(_0x3ba575,_0x4adcd4){_0x4adcd4=_0x4adcd4||0xc8;return function(_0x5b6840){if(_0x5b6840){return _0x3ba575[_0x88ae('0x1b')](_0x4adcd4)[_0x88ae('0x1c')](_0x5b6840);}};}function respondWithFilteredResult(_0xd5dc86,_0x281fba){return function(_0x2ac4f6){if(_0x2ac4f6){var _0x3c3e1e=typeof _0x281fba['offset']===_0x88ae('0x1d')&&typeof _0x281fba[_0x88ae('0x1e')]===_0x88ae('0x1d');var _0x5af0f3=_0x2ac4f6[_0x88ae('0x1f')];var _0x15806e=_0x3c3e1e?0x0:_0x281fba[_0x88ae('0x20')];var _0x2c800e=_0x3c3e1e?_0x2ac4f6[_0x88ae('0x1f')]:_0x281fba[_0x88ae('0x20')]+_0x281fba[_0x88ae('0x1e')];var _0x1a6de1;if(_0x2c800e>=_0x5af0f3){_0x2c800e=_0x5af0f3;_0x1a6de1=0xc8;}else{_0x1a6de1=0xce;}_0xd5dc86[_0x88ae('0x1b')](_0x1a6de1);return _0xd5dc86['set'](_0x88ae('0x21'),_0x15806e+'-'+_0x2c800e+'/'+_0x5af0f3)[_0x88ae('0x1c')](_0x2ac4f6);}return null;};}function patchUpdates(_0x20f50e){return function(_0x1f4eeb){try{jsonpatch[_0x88ae('0x22')](_0x1f4eeb,_0x20f50e,!![]);}catch(_0x54337c){return BPromise['reject'](_0x54337c);}return _0x1f4eeb['save']();};}function saveUpdates(_0x558811,_0xac525c){return function(_0x28c839){if(_0x28c839){return _0x28c839[_0x88ae('0x23')](_0x558811)['then'](function(_0x50011e){return _0x50011e;});}return null;};}function removeEntity(_0x460088,_0x1805cd){return function(_0x24c4fb){if(_0x24c4fb){return _0x24c4fb[_0x88ae('0x24')]()[_0x88ae('0x25')](function(){_0x460088['status'](0xcc)[_0x88ae('0x26')]();});}};}function handleEntityNotFound(_0x29fa02,_0x59cd77){return function(_0x2814f4){if(!_0x2814f4){_0x29fa02['sendStatus'](0x194);}return _0x2814f4;};}function handleError(_0x266b8b,_0x31a7cf){_0x31a7cf=_0x31a7cf||0x1f4;return function(_0xb4263b){logger[_0x88ae('0x27')](_0xb4263b[_0x88ae('0x28')]);if(_0xb4263b[_0x88ae('0x29')]){delete _0xb4263b[_0x88ae('0x29')];}_0x266b8b[_0x88ae('0x1b')](_0x31a7cf)[_0x88ae('0x2a')](_0xb4263b);};}exports[_0x88ae('0x2b')]=function(_0x16e444,_0x49e6e3){var _0x489d80={},_0x21e2ac={},_0x2756ee={'count':0x0,'rows':[]};var _0x4da5ec=_[_0x88ae('0x2c')](db[_0x88ae('0x2d')][_0x88ae('0x2e')],function(_0x552f47){return{'name':_0x552f47[_0x88ae('0x2f')],'type':_0x552f47[_0x88ae('0x30')][_0x88ae('0x31')]};});_0x21e2ac[_0x88ae('0x32')]=_[_0x88ae('0x2c')](_0x4da5ec,_0x88ae('0x29'));_0x21e2ac[_0x88ae('0x33')]=_['keys'](_0x16e444[_0x88ae('0x33')]);_0x21e2ac['filters']=_[_0x88ae('0x34')](_0x21e2ac[_0x88ae('0x32')],_0x21e2ac[_0x88ae('0x33')]);_0x489d80[_0x88ae('0x35')]=_['intersection'](_0x21e2ac[_0x88ae('0x32')],qs['fields'](_0x16e444[_0x88ae('0x33')]['fields']));_0x489d80[_0x88ae('0x35')]=_0x489d80[_0x88ae('0x35')][_0x88ae('0x36')]?_0x489d80['attributes']:_0x21e2ac[_0x88ae('0x32')];if(!_0x16e444[_0x88ae('0x33')][_0x88ae('0x37')](_0x88ae('0x38'))){_0x489d80['limit']=qs[_0x88ae('0x1e')](_0x16e444[_0x88ae('0x33')][_0x88ae('0x1e')]);_0x489d80[_0x88ae('0x20')]=qs[_0x88ae('0x20')](_0x16e444['query'][_0x88ae('0x20')]);}_0x489d80[_0x88ae('0x39')]=qs['sort'](_0x16e444['query']['sort']);_0x489d80[_0x88ae('0x3a')]=qs['filters'](_[_0x88ae('0x3b')](_0x16e444['query'],_0x21e2ac[_0x88ae('0x3c')]),_0x4da5ec);if(_0x16e444[_0x88ae('0x33')][_0x88ae('0x3d')]){_0x489d80[_0x88ae('0x3a')]=_[_0x88ae('0x3e')](_0x489d80[_0x88ae('0x3a')],{'$or':_['map'](_0x4da5ec,function(_0x4c0b46){if(_0x4c0b46[_0x88ae('0x30')]!==_0x88ae('0x3f')){var _0x386531={};_0x386531[_0x4c0b46[_0x88ae('0x29')]]={'$like':'%'+_0x16e444['query'][_0x88ae('0x3d')]+'%'};return _0x386531;}})});}_0x489d80=_[_0x88ae('0x3e')]({},_0x489d80,_0x16e444[_0x88ae('0x40')]);var _0x209aa9={'where':_0x489d80['where']};return db[_0x88ae('0x2d')]['count'](_0x209aa9)[_0x88ae('0x25')](function(_0x5a6922){_0x2756ee[_0x88ae('0x1f')]=_0x5a6922;if(_0x16e444[_0x88ae('0x33')][_0x88ae('0x41')]){_0x489d80['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x88ae('0x42')](_0x489d80);})['then'](function(_0x43e882){_0x2756ee['rows']=_0x43e882;return _0x2756ee;})[_0x88ae('0x25')](respondWithFilteredResult(_0x49e6e3,_0x489d80))[_0x88ae('0x43')](handleError(_0x49e6e3,null));};exports[_0x88ae('0x44')]=function(_0x2cefd3,_0x2f3ebb){var _0x2a3bc1={'raw':![],'where':{'id':_0x2cefd3['params']['id']}},_0x5e4b9d={};_0x5e4b9d[_0x88ae('0x32')]=_[_0x88ae('0x45')](db[_0x88ae('0x2d')][_0x88ae('0x2e')]);_0x5e4b9d[_0x88ae('0x33')]=_[_0x88ae('0x45')](_0x2cefd3[_0x88ae('0x33')]);_0x5e4b9d[_0x88ae('0x3c')]=_[_0x88ae('0x34')](_0x5e4b9d[_0x88ae('0x32')],_0x5e4b9d['query']);_0x2a3bc1['attributes']=_[_0x88ae('0x34')](_0x5e4b9d[_0x88ae('0x32')],qs[_0x88ae('0x46')](_0x2cefd3[_0x88ae('0x33')][_0x88ae('0x46')]));_0x2a3bc1[_0x88ae('0x35')]=_0x2a3bc1[_0x88ae('0x35')]['length']?_0x2a3bc1[_0x88ae('0x35')]:_0x5e4b9d[_0x88ae('0x32')];if(_0x2cefd3[_0x88ae('0x33')][_0x88ae('0x41')]){_0x2a3bc1['include']=[{'all':!![]}];}_0x2a3bc1=_[_0x88ae('0x3e')]({},_0x2a3bc1,_0x2cefd3[_0x88ae('0x40')]);return db[_0x88ae('0x2d')][_0x88ae('0x47')](_0x2a3bc1)[_0x88ae('0x25')](handleEntityNotFound(_0x2f3ebb,null))['then'](respondWithResult(_0x2f3ebb,null))['catch'](handleError(_0x2f3ebb,null));};exports['create']=function(_0x12ee0d,_0x55a2d9){return db[_0x88ae('0x2d')][_0x88ae('0x48')](_0x12ee0d[_0x88ae('0x49')],{})[_0x88ae('0x25')](respondWithResult(_0x55a2d9,0xc9))[_0x88ae('0x43')](handleError(_0x55a2d9,null));};exports[_0x88ae('0x23')]=function(_0x38b4c4,_0x3c899b){if(_0x38b4c4['body']['id']){delete _0x38b4c4[_0x88ae('0x49')]['id'];}return db[_0x88ae('0x2d')][_0x88ae('0x47')]({'where':{'id':_0x38b4c4[_0x88ae('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c899b,null))[_0x88ae('0x25')](saveUpdates(_0x38b4c4['body'],null))[_0x88ae('0x25')](respondWithResult(_0x3c899b,null))['catch'](handleError(_0x3c899b,null));};exports[_0x88ae('0x24')]=function(_0x5ecefe,_0x13acc9){return db[_0x88ae('0x2d')][_0x88ae('0x47')]({'where':{'id':_0x5ecefe['params']['id']}})[_0x88ae('0x25')](handleEntityNotFound(_0x13acc9,null))[_0x88ae('0x25')](removeEntity(_0x13acc9,null))['catch'](handleError(_0x13acc9,null));};exports['getFields']=function(_0xabd65d,_0x5e7e40,_0x37baa5){var _0x2a06f1={};var _0x75dff4={};var _0x1c08ae;var _0x1db605;return db[_0x88ae('0x2d')][_0x88ae('0x4b')]({'where':{'id':_0xabd65d['params']['id']}})['then'](handleEntityNotFound(_0x5e7e40,null))[_0x88ae('0x25')](function(_0x47bcc0){if(_0x47bcc0){_0x1c08ae=_0x47bcc0;_0x75dff4['model']=_[_0x88ae('0x45')](db[_0x88ae('0x4c')][_0x88ae('0x2e')]);_0x75dff4['query']=_['keys'](_0xabd65d[_0x88ae('0x33')]);_0x75dff4[_0x88ae('0x3c')]=_[_0x88ae('0x34')](_0x75dff4[_0x88ae('0x32')],_0x75dff4[_0x88ae('0x33')]);_0x2a06f1['attributes']=_[_0x88ae('0x34')](_0x75dff4[_0x88ae('0x32')],qs['fields'](_0xabd65d[_0x88ae('0x33')][_0x88ae('0x46')]));_0x2a06f1[_0x88ae('0x35')]=_0x2a06f1[_0x88ae('0x35')][_0x88ae('0x36')]?_0x2a06f1[_0x88ae('0x35')]:_0x75dff4[_0x88ae('0x32')];_0x2a06f1[_0x88ae('0x39')]=qs['sort'](_0xabd65d[_0x88ae('0x33')][_0x88ae('0x4d')]);_0x2a06f1[_0x88ae('0x3a')]=qs[_0x88ae('0x3c')](_[_0x88ae('0x3b')](_0xabd65d[_0x88ae('0x33')],_0x75dff4[_0x88ae('0x3c')]));if(_0xabd65d[_0x88ae('0x33')]['filter']){_0x2a06f1[_0x88ae('0x3a')]=_[_0x88ae('0x3e')](_0x2a06f1[_0x88ae('0x3a')],{'$or':_[_0x88ae('0x2c')](_0x2a06f1['attributes'],function(_0x3dda1f){var _0x7d331f={};_0x7d331f[_0x3dda1f]={'$like':'%'+_0xabd65d[_0x88ae('0x33')][_0x88ae('0x3d')]+'%'};return _0x7d331f;})});}_0x2a06f1=_[_0x88ae('0x3e')]({},_0x2a06f1,_0xabd65d[_0x88ae('0x40')]);return _0x1c08ae[_0x88ae('0x4e')](_0x2a06f1);}})['then'](function(_0x41070b){if(_0x41070b){_0x1db605=_0x41070b[_0x88ae('0x36')];if(!_0xabd65d['query'][_0x88ae('0x37')](_0x88ae('0x38'))){_0x2a06f1[_0x88ae('0x1e')]=qs[_0x88ae('0x1e')](_0xabd65d['query'][_0x88ae('0x1e')]);_0x2a06f1[_0x88ae('0x20')]=qs['offset'](_0xabd65d[_0x88ae('0x33')]['offset']);}return _0x1c08ae[_0x88ae('0x4e')](_0x2a06f1);}})[_0x88ae('0x25')](function(_0x2f55d6){if(_0x2f55d6){return _0x2f55d6?{'count':_0x1db605,'rows':_0x2f55d6}:null;}})[_0x88ae('0x25')](respondWithResult(_0x5e7e40,null))[_0x88ae('0x43')](handleError(_0x5e7e40,null));};exports['getSubjects']=function(_0x5ca070,_0x2bc7ec,_0x29d44e){var _0x4f213c={};var _0x4d0f63={};var _0x2280ad;var _0x58d7f9;return db[_0x88ae('0x2d')]['findOne']({'where':{'id':_0x5ca070[_0x88ae('0x4a')]['id']}})[_0x88ae('0x25')](handleEntityNotFound(_0x2bc7ec,null))[_0x88ae('0x25')](function(_0x517703){if(_0x517703){_0x2280ad=_0x517703;_0x4d0f63[_0x88ae('0x32')]=_[_0x88ae('0x45')](db[_0x88ae('0x4c')][_0x88ae('0x2e')]);_0x4d0f63[_0x88ae('0x33')]=_[_0x88ae('0x45')](_0x5ca070[_0x88ae('0x33')]);_0x4d0f63['filters']=_[_0x88ae('0x34')](_0x4d0f63['model'],_0x4d0f63[_0x88ae('0x33')]);_0x4f213c[_0x88ae('0x35')]=_[_0x88ae('0x34')](_0x4d0f63['model'],qs[_0x88ae('0x46')](_0x5ca070[_0x88ae('0x33')]['fields']));_0x4f213c[_0x88ae('0x35')]=_0x4f213c[_0x88ae('0x35')]['length']?_0x4f213c['attributes']:_0x4d0f63['model'];_0x4f213c[_0x88ae('0x39')]=qs[_0x88ae('0x4d')](_0x5ca070['query'][_0x88ae('0x4d')]);_0x4f213c[_0x88ae('0x3a')]=qs[_0x88ae('0x3c')](_[_0x88ae('0x3b')](_0x5ca070[_0x88ae('0x33')],_0x4d0f63[_0x88ae('0x3c')]));if(_0x5ca070[_0x88ae('0x33')][_0x88ae('0x3d')]){_0x4f213c[_0x88ae('0x3a')]=_['merge'](_0x4f213c[_0x88ae('0x3a')],{'$or':_[_0x88ae('0x2c')](_0x4f213c[_0x88ae('0x35')],function(_0x10fe34){var _0x4ec7d4={};_0x4ec7d4[_0x10fe34]={'$like':'%'+_0x5ca070[_0x88ae('0x33')][_0x88ae('0x3d')]+'%'};return _0x4ec7d4;})});}_0x4f213c=_[_0x88ae('0x3e')]({},_0x4f213c,_0x5ca070[_0x88ae('0x40')]);return _0x2280ad[_0x88ae('0x4f')](_0x4f213c);}})['then'](function(_0x36b3cb){if(_0x36b3cb){_0x58d7f9=_0x36b3cb[_0x88ae('0x36')];if(!_0x5ca070[_0x88ae('0x33')][_0x88ae('0x37')](_0x88ae('0x38'))){_0x4f213c[_0x88ae('0x1e')]=qs[_0x88ae('0x1e')](_0x5ca070[_0x88ae('0x33')]['limit']);_0x4f213c[_0x88ae('0x20')]=qs[_0x88ae('0x20')](_0x5ca070[_0x88ae('0x33')][_0x88ae('0x20')]);}return _0x2280ad[_0x88ae('0x4f')](_0x4f213c);}})['then'](function(_0x308537){if(_0x308537){return _0x308537?{'count':_0x58d7f9,'rows':_0x308537}:null;}})['then'](respondWithResult(_0x2bc7ec,null))[_0x88ae('0x43')](handleError(_0x2bc7ec,null));};exports[_0x88ae('0x50')]=function(_0x340b1f,_0x1b3cde,_0x6b34e9){var _0x478630={};var _0x2f0216={};var _0x27ba32;var _0x3405a3;return db[_0x88ae('0x2d')][_0x88ae('0x4b')]({'where':{'id':_0x340b1f['params']['id']}})[_0x88ae('0x25')](handleEntityNotFound(_0x1b3cde,null))['then'](function(_0x63f653){if(_0x63f653){_0x27ba32=_0x63f653;_0x2f0216[_0x88ae('0x32')]=_['keys'](db[_0x88ae('0x4c')][_0x88ae('0x2e')]);_0x2f0216[_0x88ae('0x33')]=_[_0x88ae('0x45')](_0x340b1f['query']);_0x2f0216[_0x88ae('0x3c')]=_[_0x88ae('0x34')](_0x2f0216[_0x88ae('0x32')],_0x2f0216[_0x88ae('0x33')]);_0x478630[_0x88ae('0x35')]=_['intersection'](_0x2f0216[_0x88ae('0x32')],qs['fields'](_0x340b1f[_0x88ae('0x33')][_0x88ae('0x46')]));_0x478630[_0x88ae('0x35')]=_0x478630[_0x88ae('0x35')]['length']?_0x478630[_0x88ae('0x35')]:_0x2f0216[_0x88ae('0x32')];_0x478630[_0x88ae('0x39')]=qs[_0x88ae('0x4d')](_0x340b1f[_0x88ae('0x33')][_0x88ae('0x4d')]);_0x478630[_0x88ae('0x3a')]=qs['filters'](_[_0x88ae('0x3b')](_0x340b1f['query'],_0x2f0216[_0x88ae('0x3c')]));if(_0x340b1f['query'][_0x88ae('0x3d')]){_0x478630[_0x88ae('0x3a')]=_['merge'](_0x478630['where'],{'$or':_[_0x88ae('0x2c')](_0x478630[_0x88ae('0x35')],function(_0x42471a){var _0x14ccf0={};_0x14ccf0[_0x42471a]={'$like':'%'+_0x340b1f['query']['filter']+'%'};return _0x14ccf0;})});}_0x478630=_[_0x88ae('0x3e')]({},_0x478630,_0x340b1f[_0x88ae('0x40')]);return _0x27ba32[_0x88ae('0x50')](_0x478630);}})[_0x88ae('0x25')](function(_0x2b3e49){if(_0x2b3e49){_0x3405a3=_0x2b3e49[_0x88ae('0x36')];if(!_0x340b1f[_0x88ae('0x33')]['hasOwnProperty'](_0x88ae('0x38'))){_0x478630[_0x88ae('0x1e')]=qs[_0x88ae('0x1e')](_0x340b1f[_0x88ae('0x33')][_0x88ae('0x1e')]);_0x478630[_0x88ae('0x20')]=qs[_0x88ae('0x20')](_0x340b1f[_0x88ae('0x33')][_0x88ae('0x20')]);}return _0x27ba32[_0x88ae('0x50')](_0x478630);}})[_0x88ae('0x25')](function(_0x1b0b21){if(_0x1b0b21){return _0x1b0b21?{'count':_0x3405a3,'rows':_0x1b0b21}:null;}})[_0x88ae('0x25')](respondWithResult(_0x1b3cde,null))[_0x88ae('0x43')](handleError(_0x1b3cde,null));}; \ No newline at end of file +var _0x8075=['keys','create','body','catch','destroy','getFields','findOne','SalesforceField','getSubjects','getDescriptions','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','save','update','then','error','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x8075,0xab));var _0x5807=function(_0x39de79,_0x4894a0){_0x39de79=_0x39de79-0x0;var _0x641d7e=_0x8075[_0x39de79];return _0x641d7e;};'use strict';var emlformat=require(_0x5807('0x0'));var rimraf=require(_0x5807('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5807('0x2'));var rp=require('request-promise');var moment=require(_0x5807('0x3'));var BPromise=require(_0x5807('0x4'));var Mustache=require('mustache');var util=require(_0x5807('0x5'));var path=require(_0x5807('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5807('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5807('0x8'));var squel=require(_0x5807('0x9'));var crypto=require(_0x5807('0xa'));var jsforce=require(_0x5807('0xb'));var deskjs=require(_0x5807('0xc'));var toCsv=require(_0x5807('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5807('0xe'));var authService=require(_0x5807('0xf'));var qs=require(_0x5807('0x10'));var as=require(_0x5807('0x11'));var hardwareService=require(_0x5807('0x12'));var logger=require(_0x5807('0x13'))(_0x5807('0x14'));var utils=require(_0x5807('0x15'));var config=require(_0x5807('0x16'));var licenseUtil=require(_0x5807('0x17'));var db=require(_0x5807('0x18'))['db'];function respondWithStatusCode(_0x50ea31,_0x147959){_0x147959=_0x147959||0xcc;return function(_0xf02be4){if(_0xf02be4){return _0x50ea31[_0x5807('0x19')](_0x147959);}return _0x50ea31[_0x5807('0x1a')](_0x147959)[_0x5807('0x1b')]();};}function respondWithResult(_0xbf1de,_0x193918){_0x193918=_0x193918||0xc8;return function(_0x3586a6){if(_0x3586a6){return _0xbf1de[_0x5807('0x1a')](_0x193918)[_0x5807('0x1c')](_0x3586a6);}};}function respondWithFilteredResult(_0x24f54a,_0x178ab0){return function(_0x20f8c9){if(_0x20f8c9){var _0x3ae845=typeof _0x178ab0[_0x5807('0x1d')]===_0x5807('0x1e')&&typeof _0x178ab0[_0x5807('0x1f')]===_0x5807('0x1e');var _0x563d44=_0x20f8c9[_0x5807('0x20')];var _0x24dec8=_0x3ae845?0x0:_0x178ab0[_0x5807('0x1d')];var _0x9c184c=_0x3ae845?_0x20f8c9[_0x5807('0x20')]:_0x178ab0['offset']+_0x178ab0[_0x5807('0x1f')];var _0x3af9f6;if(_0x9c184c>=_0x563d44){_0x9c184c=_0x563d44;_0x3af9f6=0xc8;}else{_0x3af9f6=0xce;}_0x24f54a[_0x5807('0x1a')](_0x3af9f6);return _0x24f54a[_0x5807('0x21')]('Content-Range',_0x24dec8+'-'+_0x9c184c+'/'+_0x563d44)[_0x5807('0x1c')](_0x20f8c9);}return null;};}function patchUpdates(_0x1d19f1){return function(_0x4710a2){try{jsonpatch[_0x5807('0x22')](_0x4710a2,_0x1d19f1,!![]);}catch(_0x2abcd4){return BPromise[_0x5807('0x23')](_0x2abcd4);}return _0x4710a2[_0x5807('0x24')]();};}function saveUpdates(_0x24ee3f,_0x5d0aa7){return function(_0x5874bb){if(_0x5874bb){return _0x5874bb[_0x5807('0x25')](_0x24ee3f)[_0x5807('0x26')](function(_0x39c8e9){return _0x39c8e9;});}return null;};}function removeEntity(_0x5b2aa6,_0x32360e){return function(_0xbbbf22){if(_0xbbbf22){return _0xbbbf22['destroy']()[_0x5807('0x26')](function(){_0x5b2aa6[_0x5807('0x1a')](0xcc)[_0x5807('0x1b')]();});}};}function handleEntityNotFound(_0x50dac1,_0x4410ca){return function(_0x2f8393){if(!_0x2f8393){_0x50dac1[_0x5807('0x19')](0x194);}return _0x2f8393;};}function handleError(_0x528fe2,_0x5a42b9){_0x5a42b9=_0x5a42b9||0x1f4;return function(_0x5ccaf1){logger[_0x5807('0x27')](_0x5ccaf1['stack']);if(_0x5ccaf1[_0x5807('0x28')]){delete _0x5ccaf1[_0x5807('0x28')];}_0x528fe2[_0x5807('0x1a')](_0x5a42b9)['send'](_0x5ccaf1);};}exports[_0x5807('0x29')]=function(_0x58e9ab,_0x4c7550){var _0x35e500={},_0x4966fa={},_0x347a08={'count':0x0,'rows':[]};var _0x5640ec=_[_0x5807('0x2a')](db[_0x5807('0x2b')][_0x5807('0x2c')],function(_0x1186ab){return{'name':_0x1186ab[_0x5807('0x2d')],'type':_0x1186ab[_0x5807('0x2e')][_0x5807('0x2f')]};});_0x4966fa['model']=_[_0x5807('0x2a')](_0x5640ec,_0x5807('0x28'));_0x4966fa['query']=_['keys'](_0x58e9ab[_0x5807('0x30')]);_0x4966fa[_0x5807('0x31')]=_[_0x5807('0x32')](_0x4966fa[_0x5807('0x33')],_0x4966fa[_0x5807('0x30')]);_0x35e500[_0x5807('0x34')]=_['intersection'](_0x4966fa[_0x5807('0x33')],qs[_0x5807('0x35')](_0x58e9ab[_0x5807('0x30')][_0x5807('0x35')]));_0x35e500['attributes']=_0x35e500[_0x5807('0x34')][_0x5807('0x36')]?_0x35e500[_0x5807('0x34')]:_0x4966fa[_0x5807('0x33')];if(!_0x58e9ab[_0x5807('0x30')][_0x5807('0x37')]('nolimit')){_0x35e500[_0x5807('0x1f')]=qs[_0x5807('0x1f')](_0x58e9ab[_0x5807('0x30')][_0x5807('0x1f')]);_0x35e500[_0x5807('0x1d')]=qs[_0x5807('0x1d')](_0x58e9ab[_0x5807('0x30')]['offset']);}_0x35e500[_0x5807('0x38')]=qs[_0x5807('0x39')](_0x58e9ab['query'][_0x5807('0x39')]);_0x35e500[_0x5807('0x3a')]=qs['filters'](_[_0x5807('0x3b')](_0x58e9ab[_0x5807('0x30')],_0x4966fa[_0x5807('0x31')]),_0x5640ec);if(_0x58e9ab['query']['filter']){_0x35e500['where']=_['merge'](_0x35e500[_0x5807('0x3a')],{'$or':_[_0x5807('0x2a')](_0x5640ec,function(_0x22bf0b){if(_0x22bf0b[_0x5807('0x2e')]!==_0x5807('0x3c')){var _0x20daf2={};_0x20daf2[_0x22bf0b[_0x5807('0x28')]]={'$like':'%'+_0x58e9ab[_0x5807('0x30')][_0x5807('0x3d')]+'%'};return _0x20daf2;}})});}_0x35e500=_[_0x5807('0x3e')]({},_0x35e500,_0x58e9ab[_0x5807('0x3f')]);var _0x4cc2e2={'where':_0x35e500[_0x5807('0x3a')]};return db[_0x5807('0x2b')][_0x5807('0x20')](_0x4cc2e2)[_0x5807('0x26')](function(_0x2e572b){_0x347a08[_0x5807('0x20')]=_0x2e572b;if(_0x58e9ab[_0x5807('0x30')][_0x5807('0x40')]){_0x35e500[_0x5807('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x5807('0x42')](_0x35e500);})[_0x5807('0x26')](function(_0x484179){_0x347a08[_0x5807('0x43')]=_0x484179;return _0x347a08;})[_0x5807('0x26')](respondWithFilteredResult(_0x4c7550,_0x35e500))['catch'](handleError(_0x4c7550,null));};exports['show']=function(_0x37769a,_0x3dfaa7){var _0x214b06={'raw':![],'where':{'id':_0x37769a[_0x5807('0x44')]['id']}},_0x46f6d7={};_0x46f6d7[_0x5807('0x33')]=_[_0x5807('0x45')](db[_0x5807('0x2b')]['rawAttributes']);_0x46f6d7[_0x5807('0x30')]=_[_0x5807('0x45')](_0x37769a[_0x5807('0x30')]);_0x46f6d7[_0x5807('0x31')]=_[_0x5807('0x32')](_0x46f6d7[_0x5807('0x33')],_0x46f6d7['query']);_0x214b06['attributes']=_[_0x5807('0x32')](_0x46f6d7[_0x5807('0x33')],qs[_0x5807('0x35')](_0x37769a[_0x5807('0x30')]['fields']));_0x214b06[_0x5807('0x34')]=_0x214b06['attributes'][_0x5807('0x36')]?_0x214b06['attributes']:_0x46f6d7[_0x5807('0x33')];if(_0x37769a[_0x5807('0x30')][_0x5807('0x40')]){_0x214b06[_0x5807('0x41')]=[{'all':!![]}];}_0x214b06=_[_0x5807('0x3e')]({},_0x214b06,_0x37769a[_0x5807('0x3f')]);return db[_0x5807('0x2b')]['find'](_0x214b06)[_0x5807('0x26')](handleEntityNotFound(_0x3dfaa7,null))[_0x5807('0x26')](respondWithResult(_0x3dfaa7,null))['catch'](handleError(_0x3dfaa7,null));};exports[_0x5807('0x46')]=function(_0x2077fd,_0x4689b1){return db[_0x5807('0x2b')][_0x5807('0x46')](_0x2077fd[_0x5807('0x47')],{})[_0x5807('0x26')](respondWithResult(_0x4689b1,0xc9))[_0x5807('0x48')](handleError(_0x4689b1,null));};exports['update']=function(_0x3fd805,_0x2d2382){if(_0x3fd805[_0x5807('0x47')]['id']){delete _0x3fd805['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x3fd805['params']['id']}})['then'](handleEntityNotFound(_0x2d2382,null))[_0x5807('0x26')](saveUpdates(_0x3fd805[_0x5807('0x47')],null))['then'](respondWithResult(_0x2d2382,null))[_0x5807('0x48')](handleError(_0x2d2382,null));};exports[_0x5807('0x49')]=function(_0x2a94b9,_0xd7ee58){return db[_0x5807('0x2b')]['find']({'where':{'id':_0x2a94b9['params']['id']}})[_0x5807('0x26')](handleEntityNotFound(_0xd7ee58,null))[_0x5807('0x26')](removeEntity(_0xd7ee58,null))[_0x5807('0x48')](handleError(_0xd7ee58,null));};exports[_0x5807('0x4a')]=function(_0x5e1b99,_0x16cee4,_0x7104c2){var _0x29f152={};var _0x4116c5={};var _0x54ba22;var _0x54b8b7;return db['SalesforceConfiguration'][_0x5807('0x4b')]({'where':{'id':_0x5e1b99[_0x5807('0x44')]['id']}})[_0x5807('0x26')](handleEntityNotFound(_0x16cee4,null))['then'](function(_0x5f1ba6){if(_0x5f1ba6){_0x54ba22=_0x5f1ba6;_0x4116c5[_0x5807('0x33')]=_[_0x5807('0x45')](db[_0x5807('0x4c')][_0x5807('0x2c')]);_0x4116c5['query']=_[_0x5807('0x45')](_0x5e1b99[_0x5807('0x30')]);_0x4116c5['filters']=_[_0x5807('0x32')](_0x4116c5[_0x5807('0x33')],_0x4116c5[_0x5807('0x30')]);_0x29f152['attributes']=_[_0x5807('0x32')](_0x4116c5[_0x5807('0x33')],qs[_0x5807('0x35')](_0x5e1b99[_0x5807('0x30')][_0x5807('0x35')]));_0x29f152[_0x5807('0x34')]=_0x29f152[_0x5807('0x34')][_0x5807('0x36')]?_0x29f152['attributes']:_0x4116c5[_0x5807('0x33')];_0x29f152[_0x5807('0x38')]=qs[_0x5807('0x39')](_0x5e1b99[_0x5807('0x30')][_0x5807('0x39')]);_0x29f152[_0x5807('0x3a')]=qs[_0x5807('0x31')](_[_0x5807('0x3b')](_0x5e1b99[_0x5807('0x30')],_0x4116c5[_0x5807('0x31')]));if(_0x5e1b99['query'][_0x5807('0x3d')]){_0x29f152[_0x5807('0x3a')]=_[_0x5807('0x3e')](_0x29f152['where'],{'$or':_[_0x5807('0x2a')](_0x29f152[_0x5807('0x34')],function(_0x3adebd){var _0x423928={};_0x423928[_0x3adebd]={'$like':'%'+_0x5e1b99[_0x5807('0x30')][_0x5807('0x3d')]+'%'};return _0x423928;})});}_0x29f152=_[_0x5807('0x3e')]({},_0x29f152,_0x5e1b99[_0x5807('0x3f')]);return _0x54ba22[_0x5807('0x4a')](_0x29f152);}})[_0x5807('0x26')](function(_0x557931){if(_0x557931){_0x54b8b7=_0x557931[_0x5807('0x36')];if(!_0x5e1b99[_0x5807('0x30')][_0x5807('0x37')]('nolimit')){_0x29f152[_0x5807('0x1f')]=qs[_0x5807('0x1f')](_0x5e1b99[_0x5807('0x30')]['limit']);_0x29f152['offset']=qs['offset'](_0x5e1b99[_0x5807('0x30')]['offset']);}return _0x54ba22[_0x5807('0x4a')](_0x29f152);}})[_0x5807('0x26')](function(_0x131a8e){if(_0x131a8e){return _0x131a8e?{'count':_0x54b8b7,'rows':_0x131a8e}:null;}})[_0x5807('0x26')](respondWithResult(_0x16cee4,null))[_0x5807('0x48')](handleError(_0x16cee4,null));};exports[_0x5807('0x4d')]=function(_0x11d951,_0x38a0ff,_0x3f2eff){var _0x2a9aab={};var _0xb82b9a={};var _0x3445ba;var _0x183dec;return db[_0x5807('0x2b')][_0x5807('0x4b')]({'where':{'id':_0x11d951['params']['id']}})['then'](handleEntityNotFound(_0x38a0ff,null))[_0x5807('0x26')](function(_0xcd7e3f){if(_0xcd7e3f){_0x3445ba=_0xcd7e3f;_0xb82b9a[_0x5807('0x33')]=_[_0x5807('0x45')](db['SalesforceField'][_0x5807('0x2c')]);_0xb82b9a[_0x5807('0x30')]=_[_0x5807('0x45')](_0x11d951[_0x5807('0x30')]);_0xb82b9a[_0x5807('0x31')]=_['intersection'](_0xb82b9a[_0x5807('0x33')],_0xb82b9a['query']);_0x2a9aab[_0x5807('0x34')]=_['intersection'](_0xb82b9a[_0x5807('0x33')],qs[_0x5807('0x35')](_0x11d951[_0x5807('0x30')][_0x5807('0x35')]));_0x2a9aab[_0x5807('0x34')]=_0x2a9aab['attributes'][_0x5807('0x36')]?_0x2a9aab[_0x5807('0x34')]:_0xb82b9a[_0x5807('0x33')];_0x2a9aab[_0x5807('0x38')]=qs[_0x5807('0x39')](_0x11d951[_0x5807('0x30')][_0x5807('0x39')]);_0x2a9aab[_0x5807('0x3a')]=qs[_0x5807('0x31')](_[_0x5807('0x3b')](_0x11d951[_0x5807('0x30')],_0xb82b9a['filters']));if(_0x11d951[_0x5807('0x30')][_0x5807('0x3d')]){_0x2a9aab[_0x5807('0x3a')]=_[_0x5807('0x3e')](_0x2a9aab[_0x5807('0x3a')],{'$or':_[_0x5807('0x2a')](_0x2a9aab[_0x5807('0x34')],function(_0x12ada9){var _0x46585b={};_0x46585b[_0x12ada9]={'$like':'%'+_0x11d951[_0x5807('0x30')][_0x5807('0x3d')]+'%'};return _0x46585b;})});}_0x2a9aab=_[_0x5807('0x3e')]({},_0x2a9aab,_0x11d951[_0x5807('0x3f')]);return _0x3445ba[_0x5807('0x4d')](_0x2a9aab);}})['then'](function(_0x314579){if(_0x314579){_0x183dec=_0x314579['length'];if(!_0x11d951[_0x5807('0x30')][_0x5807('0x37')]('nolimit')){_0x2a9aab[_0x5807('0x1f')]=qs[_0x5807('0x1f')](_0x11d951[_0x5807('0x30')]['limit']);_0x2a9aab[_0x5807('0x1d')]=qs[_0x5807('0x1d')](_0x11d951[_0x5807('0x30')]['offset']);}return _0x3445ba[_0x5807('0x4d')](_0x2a9aab);}})['then'](function(_0x5296c7){if(_0x5296c7){return _0x5296c7?{'count':_0x183dec,'rows':_0x5296c7}:null;}})[_0x5807('0x26')](respondWithResult(_0x38a0ff,null))['catch'](handleError(_0x38a0ff,null));};exports[_0x5807('0x4e')]=function(_0xd8a4ea,_0x1d83dd,_0x25944a){var _0xf899dd={};var _0x566dc1={};var _0x847485;var _0x1c05bd;return db['SalesforceConfiguration'][_0x5807('0x4b')]({'where':{'id':_0xd8a4ea[_0x5807('0x44')]['id']}})[_0x5807('0x26')](handleEntityNotFound(_0x1d83dd,null))['then'](function(_0x201cfd){if(_0x201cfd){_0x847485=_0x201cfd;_0x566dc1[_0x5807('0x33')]=_[_0x5807('0x45')](db[_0x5807('0x4c')][_0x5807('0x2c')]);_0x566dc1[_0x5807('0x30')]=_['keys'](_0xd8a4ea[_0x5807('0x30')]);_0x566dc1['filters']=_[_0x5807('0x32')](_0x566dc1['model'],_0x566dc1[_0x5807('0x30')]);_0xf899dd[_0x5807('0x34')]=_['intersection'](_0x566dc1['model'],qs['fields'](_0xd8a4ea[_0x5807('0x30')][_0x5807('0x35')]));_0xf899dd['attributes']=_0xf899dd[_0x5807('0x34')]['length']?_0xf899dd[_0x5807('0x34')]:_0x566dc1[_0x5807('0x33')];_0xf899dd[_0x5807('0x38')]=qs['sort'](_0xd8a4ea[_0x5807('0x30')][_0x5807('0x39')]);_0xf899dd[_0x5807('0x3a')]=qs[_0x5807('0x31')](_[_0x5807('0x3b')](_0xd8a4ea[_0x5807('0x30')],_0x566dc1[_0x5807('0x31')]));if(_0xd8a4ea['query'][_0x5807('0x3d')]){_0xf899dd[_0x5807('0x3a')]=_[_0x5807('0x3e')](_0xf899dd[_0x5807('0x3a')],{'$or':_[_0x5807('0x2a')](_0xf899dd[_0x5807('0x34')],function(_0x238efc){var _0x410611={};_0x410611[_0x238efc]={'$like':'%'+_0xd8a4ea[_0x5807('0x30')][_0x5807('0x3d')]+'%'};return _0x410611;})});}_0xf899dd=_['merge']({},_0xf899dd,_0xd8a4ea[_0x5807('0x3f')]);return _0x847485[_0x5807('0x4e')](_0xf899dd);}})[_0x5807('0x26')](function(_0xbec4f){if(_0xbec4f){_0x1c05bd=_0xbec4f['length'];if(!_0xd8a4ea['query'][_0x5807('0x37')](_0x5807('0x4f'))){_0xf899dd[_0x5807('0x1f')]=qs[_0x5807('0x1f')](_0xd8a4ea[_0x5807('0x30')][_0x5807('0x1f')]);_0xf899dd[_0x5807('0x1d')]=qs[_0x5807('0x1d')](_0xd8a4ea[_0x5807('0x30')][_0x5807('0x1d')]);}return _0x847485[_0x5807('0x4e')](_0xf899dd);}})['then'](function(_0x346d7f){if(_0x346d7f){return _0x346d7f?{'count':_0x1c05bd,'rows':_0x346d7f}:null;}})['then'](respondWithResult(_0x1d83dd,null))[_0x5807('0x48')](handleError(_0x1d83dd,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3532860..a3cee6b 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 _0x718c=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0x2d16f8,_0x3f7013){var _0x257ac1=function(_0x34aa46){while(--_0x34aa46){_0x2d16f8['push'](_0x2d16f8['shift']());}};_0x257ac1(++_0x3f7013);}(_0x718c,0xd0));var _0xc718=function(_0x23bc17,_0x12336c){_0x23bc17=_0x23bc17-0x0;var _0x3afcde=_0x718c[_0x23bc17];return _0x3afcde;};'use strict';var _=require(_0xc718('0x0'));var util=require(_0xc718('0x1'));var logger=require('../../config/logger')(_0xc718('0x2'));var moment=require(_0xc718('0x3'));var BPromise=require(_0xc718('0x4'));var rp=require(_0xc718('0x5'));var fs=require('fs');var path=require(_0xc718('0x6'));var rimraf=require(_0xc718('0x7'));var config=require(_0xc718('0x8'));var attributes=require(_0xc718('0x9'));module[_0xc718('0xa')]=function(_0x111667,_0x41bc31){return _0x111667[_0xc718('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0xc718('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1789=['define','SalesforceConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x457bb7,_0x3b9f44){var _0x24276d=function(_0x5f38b2){while(--_0x5f38b2){_0x457bb7['push'](_0x457bb7['shift']());}};_0x24276d(++_0x3b9f44);}(_0x1789,0xfe));var _0x9178=function(_0x148c1d,_0x537052){_0x148c1d=_0x148c1d-0x0;var _0xed1bda=_0x1789[_0x148c1d];return _0xed1bda;};'use strict';var _=require(_0x9178('0x0'));var util=require('util');var logger=require(_0x9178('0x1'))(_0x9178('0x2'));var moment=require(_0x9178('0x3'));var BPromise=require(_0x9178('0x4'));var rp=require(_0x9178('0x5'));var fs=require('fs');var path=require(_0x9178('0x6'));var rimraf=require('rimraf');var config=require(_0x9178('0x7'));var attributes=require(_0x9178('0x8'));module[_0x9178('0x9')]=function(_0x561c08,_0x7fedb1){return _0x561c08[_0x9178('0xa')](_0x9178('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 65b2540..0e988de 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 _0xee69=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x40ec4e,_0x5d8b1b){var _0x333401=function(_0x348098){while(--_0x348098){_0x40ec4e['push'](_0x40ec4e['shift']());}};_0x333401(++_0x5d8b1b);}(_0xee69,0x10b));var _0x9ee6=function(_0x23853f,_0x4b7199){_0x23853f=_0x23853f-0x0;var _0x2cc339=_0xee69[_0x23853f];return _0x2cc339;};'use strict';var _=require(_0x9ee6('0x0'));var util=require('util');var moment=require(_0x9ee6('0x1'));var BPromise=require(_0x9ee6('0x2'));var rs=require(_0x9ee6('0x3'));var fs=require('fs');var Redis=require(_0x9ee6('0x4'));var db=require(_0x9ee6('0x5'))['db'];var utils=require(_0x9ee6('0x6'));var logger=require('../../config/logger')(_0x9ee6('0x7'));var config=require('../../config/environment');var jayson=require(_0x9ee6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59f736,_0x7a7edd,_0x14e24c){return new BPromise(function(_0x2c54a6,_0x17b7c1){return client[_0x9ee6('0x9')](_0x59f736,_0x14e24c)[_0x9ee6('0xa')](function(_0x28dbbc){logger[_0x9ee6('0xb')](_0x9ee6('0xc'),_0x7a7edd,_0x9ee6('0xd'));logger[_0x9ee6('0xe')](_0x9ee6('0xf'),_0x7a7edd,_0x9ee6('0xd'),JSON[_0x9ee6('0x10')](_0x28dbbc));if(_0x28dbbc[_0x9ee6('0x11')]){if(_0x28dbbc[_0x9ee6('0x11')]['code']===0x1f4){logger[_0x9ee6('0x11')](_0x9ee6('0xc'),_0x7a7edd,_0x28dbbc[_0x9ee6('0x11')]['message']);return _0x17b7c1(_0x28dbbc[_0x9ee6('0x11')]['message']);}logger[_0x9ee6('0x11')](_0x9ee6('0xc'),_0x7a7edd,_0x28dbbc['error'][_0x9ee6('0x12')]);return _0x2c54a6(_0x28dbbc[_0x9ee6('0x11')][_0x9ee6('0x12')]);}else{logger[_0x9ee6('0xb')](_0x9ee6('0xc'),_0x7a7edd,'request\x20sent');_0x2c54a6(_0x28dbbc['result'][_0x9ee6('0x12')]);}})[_0x9ee6('0x13')](function(_0x3ed1f8){logger['error'](_0x9ee6('0xc'),_0x7a7edd,_0x3ed1f8);_0x17b7c1(_0x3ed1f8);});});} \ No newline at end of file +var _0x23a5=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1c8518,_0x20d857){var _0x1f20d5=function(_0x4488d9){while(--_0x4488d9){_0x1c8518['push'](_0x1c8518['shift']());}};_0x1f20d5(++_0x20d857);}(_0x23a5,0xb4));var _0x523a=function(_0x262f47,_0x300945){_0x262f47=_0x262f47-0x0;var _0x557f7c=_0x23a5[_0x262f47];return _0x557f7c;};'use strict';var _=require('lodash');var util=require(_0x523a('0x0'));var moment=require(_0x523a('0x1'));var BPromise=require(_0x523a('0x2'));var rs=require(_0x523a('0x3'));var fs=require('fs');var Redis=require(_0x523a('0x4'));var db=require(_0x523a('0x5'))['db'];var utils=require(_0x523a('0x6'));var logger=require(_0x523a('0x7'))(_0x523a('0x8'));var config=require('../../config/environment');var jayson=require(_0x523a('0x9'));var client=jayson[_0x523a('0xa')][_0x523a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf615f9,_0x4a79a1,_0x5d07e3){return new BPromise(function(_0x5a0767,_0x58e8aa){return client['request'](_0xf615f9,_0x5d07e3)[_0x523a('0xc')](function(_0x18e35c){logger[_0x523a('0xd')](_0x523a('0xe'),_0x4a79a1,_0x523a('0xf'));logger[_0x523a('0x10')](_0x523a('0x11'),_0x4a79a1,_0x523a('0xf'),JSON[_0x523a('0x12')](_0x18e35c));if(_0x18e35c[_0x523a('0x13')]){if(_0x18e35c[_0x523a('0x13')][_0x523a('0x14')]===0x1f4){logger[_0x523a('0x13')](_0x523a('0xe'),_0x4a79a1,_0x18e35c[_0x523a('0x13')][_0x523a('0x15')]);return _0x58e8aa(_0x18e35c[_0x523a('0x13')][_0x523a('0x15')]);}logger[_0x523a('0x13')](_0x523a('0xe'),_0x4a79a1,_0x18e35c[_0x523a('0x13')][_0x523a('0x15')]);return _0x5a0767(_0x18e35c[_0x523a('0x13')][_0x523a('0x15')]);}else{logger[_0x523a('0xd')](_0x523a('0xe'),_0x4a79a1,_0x523a('0xf'));_0x5a0767(_0x18e35c[_0x523a('0x16')][_0x523a('0x15')]);}})[_0x523a('0x17')](function(_0x2a261e){logger[_0x523a('0x13')](_0x523a('0xe'),_0x4a79a1,_0x2a261e);_0x58e8aa(_0x2a261e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 8ed2410..5eed8b6 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 _0xaf23=['connect-timeout','express','Router','fs-extra','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','util'];(function(_0x400eb6,_0x75423a){var _0x27d855=function(_0x4aa412){while(--_0x4aa412){_0x400eb6['push'](_0x400eb6['shift']());}};_0x27d855(++_0x75423a);}(_0xaf23,0x164));var _0x3af2=function(_0x37fff5,_0x2e32a4){_0x37fff5=_0x37fff5-0x0;var _0x51c788=_0xaf23[_0x37fff5];return _0x51c788;};'use strict';var multer=require('multer');var util=require(_0x3af2('0x0'));var path=require('path');var timeout=require(_0x3af2('0x1'));var express=require(_0x3af2('0x2'));var router=express[_0x3af2('0x3')]();var fs_extra=require(_0x3af2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3af2('0x5'));var controller=require(_0x3af2('0x6'));router[_0x3af2('0x7')]('/',auth[_0x3af2('0x8')](),controller[_0x3af2('0x9')]);router[_0x3af2('0x7')](_0x3af2('0xa'),auth[_0x3af2('0x8')](),controller['show']);router[_0x3af2('0xb')]('/',auth['isAuthenticated'](),controller[_0x3af2('0xc')]);router[_0x3af2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3af2('0xe')]);router[_0x3af2('0xf')]('/:id',auth[_0x3af2('0x8')](),controller['destroy']);module[_0x3af2('0x10')]=router; \ No newline at end of file +var _0x604a=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x5cdacf,_0x7c82b1){var _0xa68a8b=function(_0x4b3818){while(--_0x4b3818){_0x5cdacf['push'](_0x5cdacf['shift']());}};_0xa68a8b(++_0x7c82b1);}(_0x604a,0x1c5));var _0xa604=function(_0x35abaa,_0x20546f){_0x35abaa=_0x35abaa-0x0;var _0x58c2ed=_0x604a[_0x35abaa];return _0x58c2ed;};'use strict';var multer=require(_0xa604('0x0'));var util=require(_0xa604('0x1'));var path=require(_0xa604('0x2'));var timeout=require(_0xa604('0x3'));var express=require(_0xa604('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa604('0x5'));var interaction=require(_0xa604('0x6'));var config=require(_0xa604('0x7'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xa604('0x8')](),controller[_0xa604('0x9')]);router[_0xa604('0xa')](_0xa604('0xb'),auth[_0xa604('0x8')](),controller['show']);router[_0xa604('0xc')]('/',auth[_0xa604('0x8')](),controller[_0xa604('0xd')]);router[_0xa604('0xe')](_0xa604('0xb'),auth[_0xa604('0x8')](),controller[_0xa604('0xf')]);router['delete'](_0xa604('0xb'),auth[_0xa604('0x8')](),controller[_0xa604('0x10')]);module[_0xa604('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1a50570..b9ba663 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 _0x504b=['customVariable','sequelize','exports','ENUM','string','picklist','STRING','variable'];(function(_0x3371fd,_0x138183){var _0x9a94f2=function(_0x3797ee){while(--_0x3797ee){_0x3371fd['push'](_0x3371fd['shift']());}};_0x9a94f2(++_0x138183);}(_0x504b,0x1b9));var _0xb504=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x504b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb504('0x0'));module[_0xb504('0x1')]={'type':{'type':Sequelize[_0xb504('0x2')](_0xb504('0x3'),'variable','customVariable','keyValue',_0xb504('0x4')),'defaultValue':_0xb504('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb504('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb504('0x3'),_0xb504('0x6'),_0xb504('0x7'))},'keyContent':{'type':Sequelize[_0xb504('0x5')]},'idField':{'type':Sequelize[_0xb504('0x5')]},'variableName':{'type':Sequelize[_0xb504('0x5')]}}; \ No newline at end of file +var _0x67bf=['STRING','ENUM','sequelize','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x476fd2,_0xcd0bc4){var _0x4cfdcd=function(_0x25ab1a){while(--_0x25ab1a){_0x476fd2['push'](_0x476fd2['shift']());}};_0x4cfdcd(++_0xcd0bc4);}(_0x67bf,0xec));var _0xf67b=function(_0x2cf7a5,_0x44dd28){_0x2cf7a5=_0x2cf7a5-0x0;var _0x241fba=_0x67bf[_0x2cf7a5];return _0x241fba;};'use strict';var Sequelize=require(_0xf67b('0x0'));module[_0xf67b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf67b('0x2'),_0xf67b('0x3'),_0xf67b('0x4'),_0xf67b('0x5')),'defaultValue':_0xf67b('0x6')},'content':{'type':Sequelize[_0xf67b('0x7')]},'key':{'type':Sequelize[_0xf67b('0x7')]},'keyType':{'type':Sequelize[_0xf67b('0x8')](_0xf67b('0x6'),_0xf67b('0x2'),_0xf67b('0x3'))},'keyContent':{'type':Sequelize[_0xf67b('0x7')]},'idField':{'type':Sequelize[_0xf67b('0x7')]},'variableName':{'type':Sequelize[_0xf67b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f8b19ee..5cad7be 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 _0x2fb1=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','reject','save','update','then','destroy','error','stack','name','send','SalesforceField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis'];(function(_0x386623,_0xe07904){var _0x52bacc=function(_0x4d39dc){while(--_0x4d39dc){_0x386623['push'](_0x386623['shift']());}};_0x52bacc(++_0xe07904);}(_0x2fb1,0xcb));var _0x12fb=function(_0x563021,_0x266b80){_0x563021=_0x563021-0x0;var _0x22d77d=_0x2fb1[_0x563021];return _0x22d77d;};'use strict';var emlformat=require(_0x12fb('0x0'));var rimraf=require(_0x12fb('0x1'));var zipdir=require(_0x12fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12fb('0x3'));var moment=require(_0x12fb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12fb('0x5'));var path=require(_0x12fb('0x6'));var sox=require(_0x12fb('0x7'));var csv=require(_0x12fb('0x8'));var ejs=require(_0x12fb('0x9'));var fs=require('fs');var fs_extra=require(_0x12fb('0xa'));var _=require(_0x12fb('0xb'));var squel=require(_0x12fb('0xc'));var crypto=require(_0x12fb('0xd'));var jsforce=require(_0x12fb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x12fb('0xf'));var authService=require(_0x12fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x12fb('0x11'));var hardwareService=require(_0x12fb('0x12'));var logger=require(_0x12fb('0x13'))(_0x12fb('0x14'));var utils=require(_0x12fb('0x15'));var config=require(_0x12fb('0x16'));var licenseUtil=require(_0x12fb('0x17'));var db=require(_0x12fb('0x18'))['db'];function respondWithStatusCode(_0x250f03,_0x4874cc){_0x4874cc=_0x4874cc||0xcc;return function(_0x480b91){if(_0x480b91){return _0x250f03[_0x12fb('0x19')](_0x4874cc);}return _0x250f03['status'](_0x4874cc)['end']();};}function respondWithResult(_0x2f962b,_0x137e0e){_0x137e0e=_0x137e0e||0xc8;return function(_0x1c936c){if(_0x1c936c){return _0x2f962b['status'](_0x137e0e)[_0x12fb('0x1a')](_0x1c936c);}};}function respondWithFilteredResult(_0x5162bb,_0x3da624){return function(_0x3b64e8){if(_0x3b64e8){var _0x5a3eae=typeof _0x3da624[_0x12fb('0x1b')]==='undefined'&&typeof _0x3da624['limit']===_0x12fb('0x1c');var _0x4a68c9=_0x3b64e8[_0x12fb('0x1d')];var _0x86af2a=_0x5a3eae?0x0:_0x3da624[_0x12fb('0x1b')];var _0x190f28=_0x5a3eae?_0x3b64e8[_0x12fb('0x1d')]:_0x3da624[_0x12fb('0x1b')]+_0x3da624[_0x12fb('0x1e')];var _0x43fcec;if(_0x190f28>=_0x4a68c9){_0x190f28=_0x4a68c9;_0x43fcec=0xc8;}else{_0x43fcec=0xce;}_0x5162bb[_0x12fb('0x1f')](_0x43fcec);return _0x5162bb[_0x12fb('0x20')]('Content-Range',_0x86af2a+'-'+_0x190f28+'/'+_0x4a68c9)[_0x12fb('0x1a')](_0x3b64e8);}return null;};}function patchUpdates(_0x5e5cba){return function(_0x12f24b){try{jsonpatch['apply'](_0x12f24b,_0x5e5cba,!![]);}catch(_0x1baa2c){return BPromise[_0x12fb('0x21')](_0x1baa2c);}return _0x12f24b[_0x12fb('0x22')]();};}function saveUpdates(_0x315ca1,_0x46b338){return function(_0x202902){if(_0x202902){return _0x202902[_0x12fb('0x23')](_0x315ca1)[_0x12fb('0x24')](function(_0x5cb775){return _0x5cb775;});}return null;};}function removeEntity(_0x168cf5,_0x4272ec){return function(_0xba2d7a){if(_0xba2d7a){return _0xba2d7a[_0x12fb('0x25')]()['then'](function(){_0x168cf5[_0x12fb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ece4,_0x5ec7f8){return function(_0x59595f){if(!_0x59595f){_0x31ece4[_0x12fb('0x19')](0x194);}return _0x59595f;};}function handleError(_0x132bb0,_0x3c7a31){_0x3c7a31=_0x3c7a31||0x1f4;return function(_0x3ea29b){logger[_0x12fb('0x26')](_0x3ea29b[_0x12fb('0x27')]);if(_0x3ea29b[_0x12fb('0x28')]){delete _0x3ea29b[_0x12fb('0x28')];}_0x132bb0[_0x12fb('0x1f')](_0x3c7a31)[_0x12fb('0x29')](_0x3ea29b);};}exports['index']=function(_0x456769,_0xabf281){var _0x3fdacd={},_0x362445={},_0x3c1278={'count':0x0,'rows':[]};var _0x5828dd=_['map'](db[_0x12fb('0x2a')][_0x12fb('0x2b')],function(_0x365a52){return{'name':_0x365a52[_0x12fb('0x2c')],'type':_0x365a52[_0x12fb('0x2d')][_0x12fb('0x2e')]};});_0x362445[_0x12fb('0x2f')]=_[_0x12fb('0x30')](_0x5828dd,'name');_0x362445[_0x12fb('0x31')]=_['keys'](_0x456769[_0x12fb('0x31')]);_0x362445[_0x12fb('0x32')]=_[_0x12fb('0x33')](_0x362445[_0x12fb('0x2f')],_0x362445[_0x12fb('0x31')]);_0x3fdacd['attributes']=_[_0x12fb('0x33')](_0x362445[_0x12fb('0x2f')],qs[_0x12fb('0x34')](_0x456769[_0x12fb('0x31')]['fields']));_0x3fdacd[_0x12fb('0x35')]=_0x3fdacd[_0x12fb('0x35')][_0x12fb('0x36')]?_0x3fdacd[_0x12fb('0x35')]:_0x362445[_0x12fb('0x2f')];if(!_0x456769['query'][_0x12fb('0x37')]('nolimit')){_0x3fdacd[_0x12fb('0x1e')]=qs[_0x12fb('0x1e')](_0x456769['query'][_0x12fb('0x1e')]);_0x3fdacd[_0x12fb('0x1b')]=qs['offset'](_0x456769[_0x12fb('0x31')][_0x12fb('0x1b')]);}_0x3fdacd[_0x12fb('0x38')]=qs['sort'](_0x456769[_0x12fb('0x31')][_0x12fb('0x39')]);_0x3fdacd[_0x12fb('0x3a')]=qs['filters'](_[_0x12fb('0x3b')](_0x456769[_0x12fb('0x31')],_0x362445[_0x12fb('0x32')]),_0x5828dd);if(_0x456769[_0x12fb('0x31')][_0x12fb('0x3c')]){_0x3fdacd[_0x12fb('0x3a')]=_['merge'](_0x3fdacd[_0x12fb('0x3a')],{'$or':_[_0x12fb('0x30')](_0x5828dd,function(_0x56bfcb){if(_0x56bfcb[_0x12fb('0x2d')]!=='VIRTUAL'){var _0x5dfef3={};_0x5dfef3[_0x56bfcb[_0x12fb('0x28')]]={'$like':'%'+_0x456769[_0x12fb('0x31')][_0x12fb('0x3c')]+'%'};return _0x5dfef3;}})});}_0x3fdacd=_[_0x12fb('0x3d')]({},_0x3fdacd,_0x456769[_0x12fb('0x3e')]);var _0x3c4b4d={'where':_0x3fdacd[_0x12fb('0x3a')]};return db['SalesforceField'][_0x12fb('0x1d')](_0x3c4b4d)['then'](function(_0x14ce26){_0x3c1278[_0x12fb('0x1d')]=_0x14ce26;if(_0x456769['query'][_0x12fb('0x3f')]){_0x3fdacd[_0x12fb('0x40')]=[{'all':!![]}];}return db[_0x12fb('0x2a')]['findAll'](_0x3fdacd);})[_0x12fb('0x24')](function(_0x57b6e6){_0x3c1278[_0x12fb('0x41')]=_0x57b6e6;return _0x3c1278;})[_0x12fb('0x24')](respondWithFilteredResult(_0xabf281,_0x3fdacd))[_0x12fb('0x42')](handleError(_0xabf281,null));};exports[_0x12fb('0x43')]=function(_0x4036a6,_0x1d7440){var _0x34d872={'raw':!![],'where':{'id':_0x4036a6[_0x12fb('0x44')]['id']}},_0x57678b={};_0x57678b['model']=_[_0x12fb('0x45')](db[_0x12fb('0x2a')]['rawAttributes']);_0x57678b[_0x12fb('0x31')]=_[_0x12fb('0x45')](_0x4036a6[_0x12fb('0x31')]);_0x57678b['filters']=_['intersection'](_0x57678b['model'],_0x57678b[_0x12fb('0x31')]);_0x34d872[_0x12fb('0x35')]=_['intersection'](_0x57678b['model'],qs['fields'](_0x4036a6[_0x12fb('0x31')][_0x12fb('0x34')]));_0x34d872['attributes']=_0x34d872[_0x12fb('0x35')][_0x12fb('0x36')]?_0x34d872[_0x12fb('0x35')]:_0x57678b[_0x12fb('0x2f')];if(_0x4036a6['query'][_0x12fb('0x3f')]){_0x34d872[_0x12fb('0x40')]=[{'all':!![]}];}_0x34d872=_[_0x12fb('0x3d')]({},_0x34d872,_0x4036a6['options']);return db[_0x12fb('0x2a')][_0x12fb('0x46')](_0x34d872)[_0x12fb('0x24')](handleEntityNotFound(_0x1d7440,null))[_0x12fb('0x24')](respondWithResult(_0x1d7440,null))[_0x12fb('0x42')](handleError(_0x1d7440,null));};exports['create']=function(_0x247571,_0x2cec03){return db[_0x12fb('0x2a')][_0x12fb('0x47')](_0x247571[_0x12fb('0x48')],{})[_0x12fb('0x24')](respondWithResult(_0x2cec03,0xc9))['catch'](handleError(_0x2cec03,null));};exports['update']=function(_0x2aa0c0,_0x40efae){if(_0x2aa0c0[_0x12fb('0x48')]['id']){delete _0x2aa0c0[_0x12fb('0x48')]['id'];}return db[_0x12fb('0x2a')][_0x12fb('0x46')]({'where':{'id':_0x2aa0c0[_0x12fb('0x44')]['id']}})[_0x12fb('0x24')](handleEntityNotFound(_0x40efae,null))[_0x12fb('0x24')](saveUpdates(_0x2aa0c0[_0x12fb('0x48')],null))[_0x12fb('0x24')](respondWithResult(_0x40efae,null))['catch'](handleError(_0x40efae,null));};exports['destroy']=function(_0x389e59,_0x49dc8e){return db[_0x12fb('0x2a')][_0x12fb('0x46')]({'where':{'id':_0x389e59['params']['id']}})['then'](handleEntityNotFound(_0x49dc8e,null))[_0x12fb('0x24')](removeEntity(_0x49dc8e,null))[_0x12fb('0x42')](handleError(_0x49dc8e,null));}; \ No newline at end of file +var _0xfa17=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','filters','intersection','attributes','fields','query','length','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x17715e,_0x59401c){var _0x1ab8b1=function(_0x404370){while(--_0x404370){_0x17715e['push'](_0x17715e['shift']());}};_0x1ab8b1(++_0x59401c);}(_0xfa17,0x81));var _0x7fa1=function(_0x505782,_0x468547){_0x505782=_0x505782-0x0;var _0x594910=_0xfa17[_0x505782];return _0x594910;};'use strict';var emlformat=require(_0x7fa1('0x0'));var rimraf=require(_0x7fa1('0x1'));var zipdir=require(_0x7fa1('0x2'));var jsonpatch=require(_0x7fa1('0x3'));var rp=require(_0x7fa1('0x4'));var moment=require('moment');var BPromise=require(_0x7fa1('0x5'));var Mustache=require('mustache');var util=require(_0x7fa1('0x6'));var path=require(_0x7fa1('0x7'));var sox=require(_0x7fa1('0x8'));var csv=require(_0x7fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fa1('0xa'));var _=require(_0x7fa1('0xb'));var squel=require(_0x7fa1('0xc'));var crypto=require(_0x7fa1('0xd'));var jsforce=require(_0x7fa1('0xe'));var deskjs=require(_0x7fa1('0xf'));var toCsv=require(_0x7fa1('0x9'));var querystring=require('querystring');var Papa=require(_0x7fa1('0x10'));var Redis=require(_0x7fa1('0x11'));var authService=require(_0x7fa1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fa1('0x13'));var hardwareService=require(_0x7fa1('0x14'));var logger=require('../../config/logger')(_0x7fa1('0x15'));var utils=require(_0x7fa1('0x16'));var config=require(_0x7fa1('0x17'));var licenseUtil=require(_0x7fa1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9aca44,_0x367069){_0x367069=_0x367069||0xcc;return function(_0x43c6a3){if(_0x43c6a3){return _0x9aca44[_0x7fa1('0x19')](_0x367069);}return _0x9aca44[_0x7fa1('0x1a')](_0x367069)[_0x7fa1('0x1b')]();};}function respondWithResult(_0x37e012,_0x72c7ca){_0x72c7ca=_0x72c7ca||0xc8;return function(_0x457579){if(_0x457579){return _0x37e012['status'](_0x72c7ca)[_0x7fa1('0x1c')](_0x457579);}};}function respondWithFilteredResult(_0xd26008,_0x1738fa){return function(_0x5c7f68){if(_0x5c7f68){var _0x1e5b2c=typeof _0x1738fa[_0x7fa1('0x1d')]===_0x7fa1('0x1e')&&typeof _0x1738fa[_0x7fa1('0x1f')]==='undefined';var _0x27d022=_0x5c7f68[_0x7fa1('0x20')];var _0x23d747=_0x1e5b2c?0x0:_0x1738fa['offset'];var _0x33f8ab=_0x1e5b2c?_0x5c7f68[_0x7fa1('0x20')]:_0x1738fa[_0x7fa1('0x1d')]+_0x1738fa[_0x7fa1('0x1f')];var _0x547870;if(_0x33f8ab>=_0x27d022){_0x33f8ab=_0x27d022;_0x547870=0xc8;}else{_0x547870=0xce;}_0xd26008[_0x7fa1('0x1a')](_0x547870);return _0xd26008['set'](_0x7fa1('0x21'),_0x23d747+'-'+_0x33f8ab+'/'+_0x27d022)[_0x7fa1('0x1c')](_0x5c7f68);}return null;};}function patchUpdates(_0x520512){return function(_0x39abf0){try{jsonpatch[_0x7fa1('0x22')](_0x39abf0,_0x520512,!![]);}catch(_0x1e7b2f){return BPromise[_0x7fa1('0x23')](_0x1e7b2f);}return _0x39abf0[_0x7fa1('0x24')]();};}function saveUpdates(_0x44f76c,_0x14958e){return function(_0x2027ab){if(_0x2027ab){return _0x2027ab['update'](_0x44f76c)[_0x7fa1('0x25')](function(_0x33aa41){return _0x33aa41;});}return null;};}function removeEntity(_0x32981e,_0x18818c){return function(_0xc9e80f){if(_0xc9e80f){return _0xc9e80f['destroy']()[_0x7fa1('0x25')](function(){_0x32981e[_0x7fa1('0x1a')](0xcc)[_0x7fa1('0x1b')]();});}};}function handleEntityNotFound(_0x5d6dee,_0xce715e){return function(_0x1c79ee){if(!_0x1c79ee){_0x5d6dee[_0x7fa1('0x19')](0x194);}return _0x1c79ee;};}function handleError(_0x1c3baf,_0xa7464f){_0xa7464f=_0xa7464f||0x1f4;return function(_0x39b6c0){logger[_0x7fa1('0x26')](_0x39b6c0[_0x7fa1('0x27')]);if(_0x39b6c0[_0x7fa1('0x28')]){delete _0x39b6c0[_0x7fa1('0x28')];}_0x1c3baf[_0x7fa1('0x1a')](_0xa7464f)[_0x7fa1('0x29')](_0x39b6c0);};}exports[_0x7fa1('0x2a')]=function(_0x133392,_0x1cfca4){var _0x54dba7={},_0x3121bd={},_0x426844={'count':0x0,'rows':[]};var _0x4616a1=_[_0x7fa1('0x2b')](db[_0x7fa1('0x2c')][_0x7fa1('0x2d')],function(_0x229da6){return{'name':_0x229da6[_0x7fa1('0x2e')],'type':_0x229da6[_0x7fa1('0x2f')]['key']};});_0x3121bd[_0x7fa1('0x30')]=_[_0x7fa1('0x2b')](_0x4616a1,'name');_0x3121bd['query']=_['keys'](_0x133392['query']);_0x3121bd[_0x7fa1('0x31')]=_[_0x7fa1('0x32')](_0x3121bd[_0x7fa1('0x30')],_0x3121bd['query']);_0x54dba7[_0x7fa1('0x33')]=_[_0x7fa1('0x32')](_0x3121bd['model'],qs[_0x7fa1('0x34')](_0x133392[_0x7fa1('0x35')]['fields']));_0x54dba7[_0x7fa1('0x33')]=_0x54dba7[_0x7fa1('0x33')][_0x7fa1('0x36')]?_0x54dba7[_0x7fa1('0x33')]:_0x3121bd[_0x7fa1('0x30')];if(!_0x133392['query']['hasOwnProperty']('nolimit')){_0x54dba7[_0x7fa1('0x1f')]=qs['limit'](_0x133392['query']['limit']);_0x54dba7[_0x7fa1('0x1d')]=qs[_0x7fa1('0x1d')](_0x133392['query'][_0x7fa1('0x1d')]);}_0x54dba7[_0x7fa1('0x37')]=qs['sort'](_0x133392['query']['sort']);_0x54dba7[_0x7fa1('0x38')]=qs[_0x7fa1('0x31')](_[_0x7fa1('0x39')](_0x133392[_0x7fa1('0x35')],_0x3121bd[_0x7fa1('0x31')]),_0x4616a1);if(_0x133392[_0x7fa1('0x35')]['filter']){_0x54dba7[_0x7fa1('0x38')]=_[_0x7fa1('0x3a')](_0x54dba7[_0x7fa1('0x38')],{'$or':_[_0x7fa1('0x2b')](_0x4616a1,function(_0x69c72e){if(_0x69c72e[_0x7fa1('0x2f')]!==_0x7fa1('0x3b')){var _0x427ef6={};_0x427ef6[_0x69c72e['name']]={'$like':'%'+_0x133392[_0x7fa1('0x35')][_0x7fa1('0x3c')]+'%'};return _0x427ef6;}})});}_0x54dba7=_[_0x7fa1('0x3a')]({},_0x54dba7,_0x133392['options']);var _0x2eee8b={'where':_0x54dba7[_0x7fa1('0x38')]};return db[_0x7fa1('0x2c')][_0x7fa1('0x20')](_0x2eee8b)[_0x7fa1('0x25')](function(_0x114252){_0x426844[_0x7fa1('0x20')]=_0x114252;if(_0x133392[_0x7fa1('0x35')][_0x7fa1('0x3d')]){_0x54dba7[_0x7fa1('0x3e')]=[{'all':!![]}];}return db['SalesforceField'][_0x7fa1('0x3f')](_0x54dba7);})[_0x7fa1('0x25')](function(_0x195b63){_0x426844['rows']=_0x195b63;return _0x426844;})[_0x7fa1('0x25')](respondWithFilteredResult(_0x1cfca4,_0x54dba7))[_0x7fa1('0x40')](handleError(_0x1cfca4,null));};exports[_0x7fa1('0x41')]=function(_0x3f610f,_0x106202){var _0x458155={'raw':!![],'where':{'id':_0x3f610f[_0x7fa1('0x42')]['id']}},_0xf24310={};_0xf24310[_0x7fa1('0x30')]=_['keys'](db[_0x7fa1('0x2c')][_0x7fa1('0x2d')]);_0xf24310['query']=_['keys'](_0x3f610f[_0x7fa1('0x35')]);_0xf24310[_0x7fa1('0x31')]=_['intersection'](_0xf24310['model'],_0xf24310[_0x7fa1('0x35')]);_0x458155[_0x7fa1('0x33')]=_['intersection'](_0xf24310['model'],qs[_0x7fa1('0x34')](_0x3f610f['query'][_0x7fa1('0x34')]));_0x458155[_0x7fa1('0x33')]=_0x458155[_0x7fa1('0x33')][_0x7fa1('0x36')]?_0x458155[_0x7fa1('0x33')]:_0xf24310['model'];if(_0x3f610f[_0x7fa1('0x35')][_0x7fa1('0x3d')]){_0x458155['include']=[{'all':!![]}];}_0x458155=_['merge']({},_0x458155,_0x3f610f[_0x7fa1('0x43')]);return db[_0x7fa1('0x2c')][_0x7fa1('0x44')](_0x458155)[_0x7fa1('0x25')](handleEntityNotFound(_0x106202,null))[_0x7fa1('0x25')](respondWithResult(_0x106202,null))['catch'](handleError(_0x106202,null));};exports[_0x7fa1('0x45')]=function(_0x1588f9,_0x54065f){return db['SalesforceField'][_0x7fa1('0x45')](_0x1588f9[_0x7fa1('0x46')],{})['then'](respondWithResult(_0x54065f,0xc9))[_0x7fa1('0x40')](handleError(_0x54065f,null));};exports[_0x7fa1('0x47')]=function(_0x2b049f,_0x5e4fd9){if(_0x2b049f['body']['id']){delete _0x2b049f[_0x7fa1('0x46')]['id'];}return db['SalesforceField'][_0x7fa1('0x44')]({'where':{'id':_0x2b049f[_0x7fa1('0x42')]['id']}})[_0x7fa1('0x25')](handleEntityNotFound(_0x5e4fd9,null))[_0x7fa1('0x25')](saveUpdates(_0x2b049f[_0x7fa1('0x46')],null))[_0x7fa1('0x25')](respondWithResult(_0x5e4fd9,null))[_0x7fa1('0x40')](handleError(_0x5e4fd9,null));};exports[_0x7fa1('0x48')]=function(_0x7cfc1,_0x3ca928){return db[_0x7fa1('0x2c')][_0x7fa1('0x44')]({'where':{'id':_0x7cfc1[_0x7fa1('0x42')]['id']}})[_0x7fa1('0x25')](handleEntityNotFound(_0x3ca928,null))[_0x7fa1('0x25')](removeEntity(_0x3ca928,null))[_0x7fa1('0x40')](handleError(_0x3ca928,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b248665..b76a186 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 _0x56bc=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SalesforceField','int_salesforce_fields','idField'];(function(_0x59bbba,_0x17d18f){var _0x31e930=function(_0x4e8708){while(--_0x4e8708){_0x59bbba['push'](_0x59bbba['shift']());}};_0x31e930(++_0x17d18f);}(_0x56bc,0xc5));var _0xc56b=function(_0xcc2d5b,_0x2e5c9e){_0xcc2d5b=_0xcc2d5b-0x0;var _0x55c377=_0x56bc[_0xcc2d5b];return _0x55c377;};'use strict';var _=require('lodash');var util=require(_0xc56b('0x0'));var logger=require(_0xc56b('0x1'))(_0xc56b('0x2'));var moment=require(_0xc56b('0x3'));var BPromise=require(_0xc56b('0x4'));var rp=require(_0xc56b('0x5'));var fs=require('fs');var path=require(_0xc56b('0x6'));var rimraf=require(_0xc56b('0x7'));var config=require(_0xc56b('0x8'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0xd866b7,_0x266aa7){return _0xd866b7[_0xc56b('0x9')](_0xc56b('0xa'),attributes,{'tableName':_0xc56b('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xc56b('0xc'),_0xc56b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd176=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd176,0xb9));var _0x6d17=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xd176[_0x57fa7e];return _0x320671;};'use strict';var _=require(_0x6d17('0x0'));var util=require(_0x6d17('0x1'));var logger=require(_0x6d17('0x2'))(_0x6d17('0x3'));var moment=require(_0x6d17('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d17('0x5'));var fs=require('fs');var path=require(_0x6d17('0x6'));var rimraf=require(_0x6d17('0x7'));var config=require(_0x6d17('0x8'));var attributes=require(_0x6d17('0x9'));module[_0x6d17('0xa')]=function(_0x5bfaeb,_0x246b5e){return _0x5bfaeb['define'](_0x6d17('0xb'),attributes,{'tableName':_0x6d17('0xc'),'paranoid':![],'indexes':[{'name':_0x6d17('0xd'),'fields':[_0x6d17('0xe'),_0x6d17('0xf')],'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 17204c2..da87777 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 _0x9931=['stringify','error','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x226e55,_0x2b4262){var _0xff48a5=function(_0xb7f95b){while(--_0xb7f95b){_0x226e55['push'](_0x226e55['shift']());}};_0xff48a5(++_0x2b4262);}(_0x9931,0x77));var _0x1993=function(_0x214aed,_0x3fcbc5){_0x214aed=_0x214aed-0x0;var _0x95e18e=_0x9931[_0x214aed];return _0x95e18e;};'use strict';var _=require(_0x1993('0x0'));var util=require(_0x1993('0x1'));var moment=require('moment');var BPromise=require(_0x1993('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1993('0x3'));var logger=require(_0x1993('0x4'))('rpc');var config=require(_0x1993('0x5'));var jayson=require(_0x1993('0x6'));var client=jayson[_0x1993('0x7')][_0x1993('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x240b84,_0x493c84,_0xd5c67c){return new BPromise(function(_0x266930,_0x43f346){return client[_0x1993('0x9')](_0x240b84,_0xd5c67c)['then'](function(_0x5985fe){logger[_0x1993('0xa')](_0x1993('0xb'),_0x493c84,_0x1993('0xc'));logger['debug'](_0x1993('0xd'),_0x493c84,_0x1993('0xc'),JSON[_0x1993('0xe')](_0x5985fe));if(_0x5985fe[_0x1993('0xf')]){if(_0x5985fe[_0x1993('0xf')]['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x493c84,_0x5985fe[_0x1993('0xf')][_0x1993('0x10')]);return _0x43f346(_0x5985fe[_0x1993('0xf')][_0x1993('0x10')]);}logger['error'](_0x1993('0xb'),_0x493c84,_0x5985fe['error'][_0x1993('0x10')]);return _0x266930(_0x5985fe[_0x1993('0xf')][_0x1993('0x10')]);}else{logger[_0x1993('0xa')]('SalesforceField,\x20%s,\x20%s',_0x493c84,'request\x20sent');_0x266930(_0x5985fe[_0x1993('0x11')]['message']);}})[_0x1993('0x12')](function(_0x4c01a7){logger['error'](_0x1993('0xb'),_0x493c84,_0x4c01a7);_0x43f346(_0x4c01a7);});});} \ No newline at end of file +var _0x2ec7=['client','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','SalesforceField,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x2ec7,0x173));var _0x72ec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2ec7[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x72ec('0x0'));var moment=require(_0x72ec('0x1'));var BPromise=require(_0x72ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72ec('0x3'));var db=require(_0x72ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x72ec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x72ec('0x6'));var client=jayson[_0x72ec('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x436fbf,_0x465325,_0x1ee880){return new BPromise(function(_0x3fdb1e,_0x320938){return client[_0x72ec('0x8')](_0x436fbf,_0x1ee880)[_0x72ec('0x9')](function(_0x2c994c){logger[_0x72ec('0xa')]('SalesforceField,\x20%s,\x20%s',_0x465325,'request\x20sent');logger[_0x72ec('0xb')](_0x72ec('0xc'),_0x465325,_0x72ec('0xd'),JSON['stringify'](_0x2c994c));if(_0x2c994c['error']){if(_0x2c994c[_0x72ec('0xe')]['code']===0x1f4){logger['error'](_0x72ec('0xf'),_0x465325,_0x2c994c[_0x72ec('0xe')][_0x72ec('0x10')]);return _0x320938(_0x2c994c[_0x72ec('0xe')][_0x72ec('0x10')]);}logger[_0x72ec('0xe')](_0x72ec('0xf'),_0x465325,_0x2c994c[_0x72ec('0xe')][_0x72ec('0x10')]);return _0x3fdb1e(_0x2c994c['error'][_0x72ec('0x10')]);}else{logger[_0x72ec('0xa')](_0x72ec('0xf'),_0x465325,_0x72ec('0xd'));_0x3fdb1e(_0x2c994c['result'][_0x72ec('0x10')]);}})[_0x72ec('0x11')](function(_0x47c7a0){logger['error']('SalesforceField,\x20%s,\x20%s',_0x465325,_0x47c7a0);_0x320938(_0x47c7a0);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1c8c262..eb65b99 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 _0xd0ae=['/:id','show','/:id/configurations','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xd0ae,0x1ae));var _0xed0a=function(_0x4c3022,_0x1b3a71){_0x4c3022=_0x4c3022-0x0;var _0x260223=_0xd0ae[_0x4c3022];return _0x260223;};'use strict';var multer=require(_0xed0a('0x0'));var util=require(_0xed0a('0x1'));var path=require(_0xed0a('0x2'));var timeout=require(_0xed0a('0x3'));var express=require('express');var router=express[_0xed0a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed0a('0x5'));var interaction=require(_0xed0a('0x6'));var config=require(_0xed0a('0x7'));var controller=require(_0xed0a('0x8'));router[_0xed0a('0x9')]('/',auth[_0xed0a('0xa')](),controller['index']);router[_0xed0a('0x9')](_0xed0a('0xb'),auth[_0xed0a('0xa')](),controller[_0xed0a('0xc')]);router[_0xed0a('0x9')](_0xed0a('0xd'),auth[_0xed0a('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xed0a('0xe')]);router[_0xed0a('0xf')]('/',auth[_0xed0a('0xa')](),controller[_0xed0a('0x10')]);router['post'](_0xed0a('0xd'),auth[_0xed0a('0xa')](),controller['addConfiguration']);router[_0xed0a('0x11')](_0xed0a('0xb'),auth['isAuthenticated'](),controller[_0xed0a('0x12')]);router[_0xed0a('0x13')](_0xed0a('0xb'),auth[_0xed0a('0xa')](),controller[_0xed0a('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd807=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x30cfcc,_0x340db8){var _0x28691f=function(_0x5ae6d0){while(--_0x5ae6d0){_0x30cfcc['push'](_0x30cfcc['shift']());}};_0x28691f(++_0x340db8);}(_0xd807,0x90));var _0x7d80=function(_0x1c01f1,_0x2f06a2){_0x1c01f1=_0x1c01f1-0x0;var _0x458562=_0xd807[_0x1c01f1];return _0x458562;};'use strict';var multer=require(_0x7d80('0x0'));var util=require(_0x7d80('0x1'));var path=require(_0x7d80('0x2'));var timeout=require(_0x7d80('0x3'));var express=require(_0x7d80('0x4'));var router=express[_0x7d80('0x5')]();var fs_extra=require(_0x7d80('0x6'));var auth=require(_0x7d80('0x7'));var interaction=require(_0x7d80('0x8'));var config=require(_0x7d80('0x9'));var controller=require(_0x7d80('0xa'));router[_0x7d80('0xb')]('/',auth[_0x7d80('0xc')](),controller[_0x7d80('0xd')]);router[_0x7d80('0xb')](_0x7d80('0xe'),auth[_0x7d80('0xc')](),controller['show']);router['get'](_0x7d80('0xf'),auth[_0x7d80('0xc')](),controller[_0x7d80('0x10')]);router['get'](_0x7d80('0x11'),auth[_0x7d80('0xc')](),controller[_0x7d80('0x12')]);router[_0x7d80('0x13')]('/',auth[_0x7d80('0xc')](),controller[_0x7d80('0x14')]);router['post'](_0x7d80('0xf'),auth[_0x7d80('0xc')](),controller[_0x7d80('0x15')]);router[_0x7d80('0x16')](_0x7d80('0xe'),auth[_0x7d80('0xc')](),controller['update']);router[_0x7d80('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7d80('0x18')]);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 1628749..3d9bcba 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 _0x870b=['remoteUri','sequelize','exports','STRING','username'];(function(_0x58cc8d,_0x40bbd6){var _0xdbe727=function(_0x1c8dcd){while(--_0x1c8dcd){_0x58cc8d['push'](_0x58cc8d['shift']());}};_0xdbe727(++_0x40bbd6);}(_0x870b,0xce));var _0xb870=function(_0x28e633,_0x36a77e){_0x28e633=_0x28e633-0x0;var _0x24cd64=_0x870b[_0x28e633];return _0x24cd64;};'use strict';var Sequelize=require(_0xb870('0x0'));module[_0xb870('0x1')]={'name':{'type':Sequelize[_0xb870('0x2')]},'description':{'type':Sequelize[_0xb870('0x2')]},'username':{'type':Sequelize[_0xb870('0x2')],'unique':_0xb870('0x3')},'password':{'type':Sequelize[_0xb870('0x2')]},'email':{'type':Sequelize[_0xb870('0x2')]},'remoteUri':{'type':Sequelize[_0xb870('0x2')],'unique':_0xb870('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6f52=['remoteUri','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f52,0x7d));var _0x26f5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6f52[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x26f5('0x0'));module[_0x26f5('0x1')]={'name':{'type':Sequelize[_0x26f5('0x2')]},'description':{'type':Sequelize[_0x26f5('0x2')]},'username':{'type':Sequelize[_0x26f5('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x26f5('0x2')]},'email':{'type':Sequelize[_0x26f5('0x2')]},'remoteUri':{'type':Sequelize[_0x26f5('0x2')],'unique':_0x26f5('0x3')},'serverUrl':{'type':Sequelize[_0x26f5('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 57bfa05..9c413fa 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 _0xf161=['user_input','sys_created_on','state','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','escalation','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','forEach','internalType','label','assign','log','TCL:\x20_object','includes','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','False','false','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','destroy','then','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','ServicenowConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by'];(function(_0x3c57c7,_0x18e494){var _0x9c2cbb=function(_0x4195d0){while(--_0x4195d0){_0x3c57c7['push'](_0x3c57c7['shift']());}};_0x9c2cbb(++_0x18e494);}(_0xf161,0x1bc));var _0x1f16=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xf161[_0x519756];return _0x37047e;};'use strict';var emlformat=require(_0x1f16('0x0'));var rimraf=require(_0x1f16('0x1'));var zipdir=require(_0x1f16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f16('0x3'));var moment=require(_0x1f16('0x4'));var BPromise=require(_0x1f16('0x5'));var Mustache=require(_0x1f16('0x6'));var util=require(_0x1f16('0x7'));var path=require(_0x1f16('0x8'));var sox=require(_0x1f16('0x9'));var csv=require(_0x1f16('0xa'));var ejs=require(_0x1f16('0xb'));var fs=require('fs');var fs_extra=require(_0x1f16('0xc'));var _=require(_0x1f16('0xd'));var squel=require(_0x1f16('0xe'));var crypto=require('crypto');var jsforce=require(_0x1f16('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1f16('0xa'));var querystring=require(_0x1f16('0x10'));var Papa=require(_0x1f16('0x11'));var Redis=require(_0x1f16('0x12'));var authService=require(_0x1f16('0x13'));var qs=require(_0x1f16('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f16('0x15'));var logger=require(_0x1f16('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1f16('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f16('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x498f8d,_0x2159c8){_0x2159c8=_0x2159c8||0xcc;return function(_0x3d7993){if(_0x3d7993){return _0x498f8d[_0x1f16('0x19')](_0x2159c8);}return _0x498f8d[_0x1f16('0x1a')](_0x2159c8)[_0x1f16('0x1b')]();};}function respondWithResult(_0x11e3b4,_0x1c9c8a){_0x1c9c8a=_0x1c9c8a||0xc8;return function(_0x28cf2d){if(_0x28cf2d){return _0x11e3b4[_0x1f16('0x1a')](_0x1c9c8a)[_0x1f16('0x1c')](_0x28cf2d);}};}function respondWithFilteredResult(_0x10e4f9,_0x26e742){return function(_0x4c317d){if(_0x4c317d){var _0x48f799=typeof _0x26e742['offset']===_0x1f16('0x1d')&&typeof _0x26e742[_0x1f16('0x1e')]===_0x1f16('0x1d');var _0x543018=_0x4c317d['count'];var _0x416e23=_0x48f799?0x0:_0x26e742['offset'];var _0xd8b56f=_0x48f799?_0x4c317d[_0x1f16('0x1f')]:_0x26e742[_0x1f16('0x20')]+_0x26e742[_0x1f16('0x1e')];var _0x1023cc;if(_0xd8b56f>=_0x543018){_0xd8b56f=_0x543018;_0x1023cc=0xc8;}else{_0x1023cc=0xce;}_0x10e4f9['status'](_0x1023cc);return _0x10e4f9[_0x1f16('0x21')]('Content-Range',_0x416e23+'-'+_0xd8b56f+'/'+_0x543018)[_0x1f16('0x1c')](_0x4c317d);}return null;};}function patchUpdates(_0x457e31){return function(_0x427d6f){try{jsonpatch['apply'](_0x427d6f,_0x457e31,!![]);}catch(_0x2da782){return BPromise[_0x1f16('0x22')](_0x2da782);}return _0x427d6f[_0x1f16('0x23')]();};}function saveUpdates(_0x5aebe0,_0x2c7ade){return function(_0x22cc9a){if(_0x22cc9a){return _0x22cc9a['update'](_0x5aebe0)['then'](function(_0x58c033){return _0x58c033;});}return null;};}function removeEntity(_0x41e8ba,_0xc94658){return function(_0x292b50){if(_0x292b50){return _0x292b50[_0x1f16('0x24')]()[_0x1f16('0x25')](function(){_0x41e8ba['status'](0xcc)[_0x1f16('0x1b')]();});}};}function handleEntityNotFound(_0x333947,_0x35bf84){return function(_0x23733f){if(!_0x23733f){_0x333947['sendStatus'](0x194);}return _0x23733f;};}function handleError(_0x207b72,_0x4ee37d){_0x4ee37d=_0x4ee37d||0x1f4;return function(_0x33e7c7){logger['error'](_0x33e7c7[_0x1f16('0x26')]);if(_0x33e7c7['name']){delete _0x33e7c7[_0x1f16('0x27')];}_0x207b72[_0x1f16('0x1a')](_0x4ee37d)[_0x1f16('0x28')](_0x33e7c7);};}exports['index']=function(_0x17f79e,_0x24376e){var _0x46903c={},_0x1a812f={},_0x4edcf3={'count':0x0,'rows':[]};var _0x12acf5=_[_0x1f16('0x29')](db[_0x1f16('0x2a')][_0x1f16('0x2b')],function(_0x259c2a){return{'name':_0x259c2a[_0x1f16('0x2c')],'type':_0x259c2a[_0x1f16('0x2d')][_0x1f16('0x2e')]};});_0x1a812f[_0x1f16('0x2f')]=_[_0x1f16('0x29')](_0x12acf5,_0x1f16('0x27'));_0x1a812f[_0x1f16('0x30')]=_[_0x1f16('0x31')](_0x17f79e[_0x1f16('0x30')]);_0x1a812f['filters']=_[_0x1f16('0x32')](_0x1a812f['model'],_0x1a812f[_0x1f16('0x30')]);_0x46903c[_0x1f16('0x33')]=_[_0x1f16('0x32')](_0x1a812f['model'],qs[_0x1f16('0x34')](_0x17f79e['query']['fields']));_0x46903c[_0x1f16('0x33')]=_0x46903c[_0x1f16('0x33')][_0x1f16('0x35')]?_0x46903c['attributes']:_0x1a812f[_0x1f16('0x2f')];if(!_0x17f79e[_0x1f16('0x30')][_0x1f16('0x36')](_0x1f16('0x37'))){_0x46903c[_0x1f16('0x1e')]=qs[_0x1f16('0x1e')](_0x17f79e[_0x1f16('0x30')][_0x1f16('0x1e')]);_0x46903c[_0x1f16('0x20')]=qs[_0x1f16('0x20')](_0x17f79e[_0x1f16('0x30')]['offset']);}_0x46903c[_0x1f16('0x38')]=qs['sort'](_0x17f79e[_0x1f16('0x30')][_0x1f16('0x39')]);_0x46903c[_0x1f16('0x3a')]=qs[_0x1f16('0x3b')](_['pick'](_0x17f79e[_0x1f16('0x30')],_0x1a812f[_0x1f16('0x3b')]),_0x12acf5);if(_0x17f79e[_0x1f16('0x30')][_0x1f16('0x3c')]){_0x46903c[_0x1f16('0x3a')]=_[_0x1f16('0x3d')](_0x46903c[_0x1f16('0x3a')],{'$or':_[_0x1f16('0x29')](_0x12acf5,function(_0x1900eb){if(_0x1900eb[_0x1f16('0x2d')]!=='VIRTUAL'){var _0x79c44a={};_0x79c44a[_0x1900eb[_0x1f16('0x27')]]={'$like':'%'+_0x17f79e[_0x1f16('0x30')][_0x1f16('0x3c')]+'%'};return _0x79c44a;}})});}_0x46903c=_[_0x1f16('0x3d')]({},_0x46903c,_0x17f79e[_0x1f16('0x3e')]);var _0x1a1552={'where':_0x46903c[_0x1f16('0x3a')]};return db['ServicenowAccount']['count'](_0x1a1552)['then'](function(_0x9fb7){_0x4edcf3[_0x1f16('0x1f')]=_0x9fb7;if(_0x17f79e[_0x1f16('0x30')][_0x1f16('0x3f')]){_0x46903c['include']=[{'all':!![]}];}return db[_0x1f16('0x2a')][_0x1f16('0x40')](_0x46903c);})[_0x1f16('0x25')](function(_0x3d8c42){_0x4edcf3[_0x1f16('0x41')]=_0x3d8c42;return _0x4edcf3;})['then'](respondWithFilteredResult(_0x24376e,_0x46903c))['catch'](handleError(_0x24376e,null));};exports[_0x1f16('0x42')]=function(_0x3f41f3,_0x1f5ddf){var _0x5198b0={'raw':![],'where':{'id':_0x3f41f3[_0x1f16('0x43')]['id']}},_0x5e82df={};_0x5e82df['model']=_[_0x1f16('0x31')](db[_0x1f16('0x2a')][_0x1f16('0x2b')]);_0x5e82df[_0x1f16('0x30')]=_['keys'](_0x3f41f3['query']);_0x5e82df[_0x1f16('0x3b')]=_[_0x1f16('0x32')](_0x5e82df[_0x1f16('0x2f')],_0x5e82df[_0x1f16('0x30')]);_0x5198b0[_0x1f16('0x33')]=_['intersection'](_0x5e82df['model'],qs[_0x1f16('0x34')](_0x3f41f3['query'][_0x1f16('0x34')]));_0x5198b0['attributes']=_0x5198b0[_0x1f16('0x33')]['length']?_0x5198b0[_0x1f16('0x33')]:_0x5e82df[_0x1f16('0x2f')];if(_0x3f41f3[_0x1f16('0x30')]['includeAll']){_0x5198b0[_0x1f16('0x44')]=[{'all':!![]}];}_0x5198b0=_[_0x1f16('0x3d')]({},_0x5198b0,_0x3f41f3[_0x1f16('0x3e')]);return db['ServicenowAccount'][_0x1f16('0x45')](_0x5198b0)[_0x1f16('0x25')](handleEntityNotFound(_0x1f5ddf,null))[_0x1f16('0x25')](respondWithResult(_0x1f5ddf,null))[_0x1f16('0x46')](handleError(_0x1f5ddf,null));};exports['create']=function(_0x204f33,_0x18016a){return db[_0x1f16('0x2a')][_0x1f16('0x47')](_0x204f33[_0x1f16('0x48')],{})[_0x1f16('0x25')](respondWithResult(_0x18016a,0xc9))[_0x1f16('0x46')](handleError(_0x18016a,null));};exports['update']=function(_0x13d201,_0x40d7a5){if(_0x13d201[_0x1f16('0x48')]['id']){delete _0x13d201[_0x1f16('0x48')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x13d201[_0x1f16('0x43')]['id']}})[_0x1f16('0x25')](handleEntityNotFound(_0x40d7a5,null))[_0x1f16('0x25')](saveUpdates(_0x13d201['body'],null))[_0x1f16('0x25')](respondWithResult(_0x40d7a5,null))[_0x1f16('0x46')](handleError(_0x40d7a5,null));};exports[_0x1f16('0x24')]=function(_0x4c6df5,_0x818b89){return db[_0x1f16('0x2a')]['find']({'where':{'id':_0x4c6df5[_0x1f16('0x43')]['id']}})[_0x1f16('0x25')](handleEntityNotFound(_0x818b89,null))[_0x1f16('0x25')](removeEntity(_0x818b89,null))[_0x1f16('0x46')](handleError(_0x818b89,null));};exports[_0x1f16('0x49')]=function(_0x29cda0,_0x59b56f,_0x1fa85f){var _0x3c98dc={};var _0x4f1f65={};var _0x414e0d;var _0x327d7c;return db['ServicenowAccount']['findOne']({'where':{'id':_0x29cda0[_0x1f16('0x43')]['id']}})[_0x1f16('0x25')](handleEntityNotFound(_0x59b56f,null))[_0x1f16('0x25')](function(_0xea2695){if(_0xea2695){_0x414e0d=_0xea2695;_0x4f1f65[_0x1f16('0x2f')]=_['keys'](db[_0x1f16('0x4a')][_0x1f16('0x2b')]);_0x4f1f65['query']=_['keys'](_0x29cda0['query']);_0x4f1f65[_0x1f16('0x3b')]=_[_0x1f16('0x32')](_0x4f1f65[_0x1f16('0x2f')],_0x4f1f65['query']);_0x3c98dc[_0x1f16('0x33')]=_[_0x1f16('0x32')](_0x4f1f65[_0x1f16('0x2f')],qs[_0x1f16('0x34')](_0x29cda0[_0x1f16('0x30')]['fields']));_0x3c98dc[_0x1f16('0x33')]=_0x3c98dc[_0x1f16('0x33')]['length']?_0x3c98dc[_0x1f16('0x33')]:_0x4f1f65[_0x1f16('0x2f')];_0x3c98dc[_0x1f16('0x38')]=qs[_0x1f16('0x39')](_0x29cda0[_0x1f16('0x30')][_0x1f16('0x39')]);_0x3c98dc[_0x1f16('0x3a')]=qs['filters'](_[_0x1f16('0x4b')](_0x29cda0[_0x1f16('0x30')],_0x4f1f65[_0x1f16('0x3b')]));if(_0x29cda0[_0x1f16('0x30')][_0x1f16('0x3c')]){_0x3c98dc[_0x1f16('0x3a')]=_[_0x1f16('0x3d')](_0x3c98dc['where'],{'$or':_[_0x1f16('0x29')](_0x3c98dc['attributes'],function(_0x240e27){var _0x6ee8de={};_0x6ee8de[_0x240e27]={'$like':'%'+_0x29cda0[_0x1f16('0x30')][_0x1f16('0x3c')]+'%'};return _0x6ee8de;})});}_0x3c98dc=_[_0x1f16('0x3d')]({},_0x3c98dc,_0x29cda0[_0x1f16('0x3e')]);return _0x414e0d[_0x1f16('0x49')](_0x3c98dc);}})[_0x1f16('0x25')](function(_0x3e5936){if(_0x3e5936){_0x327d7c=_0x3e5936[_0x1f16('0x35')];if(!_0x29cda0['query'][_0x1f16('0x36')](_0x1f16('0x37'))){_0x3c98dc[_0x1f16('0x1e')]=qs[_0x1f16('0x1e')](_0x29cda0[_0x1f16('0x30')][_0x1f16('0x1e')]);_0x3c98dc[_0x1f16('0x20')]=qs[_0x1f16('0x20')](_0x29cda0[_0x1f16('0x30')][_0x1f16('0x20')]);}return _0x414e0d[_0x1f16('0x49')](_0x3c98dc);}})[_0x1f16('0x25')](function(_0x2225b0){if(_0x2225b0){return _0x2225b0?{'count':_0x327d7c,'rows':_0x2225b0}:null;}})[_0x1f16('0x25')](respondWithResult(_0x59b56f,null))[_0x1f16('0x46')](handleError(_0x59b56f,null));};exports[_0x1f16('0x4c')]=function(_0x5901fb,_0x4e4157,_0x3770c2){if(_0x5901fb['body']['id']){delete _0x5901fb[_0x1f16('0x48')]['id'];}return db[_0x1f16('0x2a')][_0x1f16('0x4d')]({'where':{'id':_0x5901fb[_0x1f16('0x43')]['id']}})[_0x1f16('0x25')](handleEntityNotFound(_0x4e4157,null))['then'](function(_0x3b5620){if(_0x3b5620){_0x5901fb[_0x1f16('0x48')][_0x1f16('0x4e')]=_0x3b5620['id'];_0x5901fb[_0x1f16('0x48')]['Subjects']=integrations[_0x1f16('0x4f')](_0x5901fb[_0x1f16('0x48')][_0x1f16('0x50')],_0x5901fb[_0x1f16('0x48')][_0x1f16('0x2d')]);_0x5901fb['body'][_0x1f16('0x51')]=integrations[_0x1f16('0x52')](_0x5901fb['body'][_0x1f16('0x50')],_0x5901fb[_0x1f16('0x48')]['type']);return db[_0x1f16('0x4a')][_0x1f16('0x47')](_0x5901fb[_0x1f16('0x48')],{'include':[{'model':db[_0x1f16('0x53')],'as':_0x1f16('0x54')},{'model':db[_0x1f16('0x53')],'as':_0x1f16('0x51')}]});}return null;})[_0x1f16('0x25')](respondWithResult(_0x4e4157,null))[_0x1f16('0x46')](handleError(_0x4e4157,null));};exports[_0x1f16('0x55')]=function(_0x165ecd,_0x3f2ed6,_0x3cc104){var _0x450ccd=[_0x1f16('0x56'),_0x1f16('0x57'),_0x1f16('0x58'),_0x1f16('0x59'),_0x1f16('0x5a'),_0x1f16('0x5b'),_0x1f16('0x5c'),_0x1f16('0x5d'),'category'];var _0x34e722=[_0x1f16('0x5e'),_0x1f16('0x56'),_0x1f16('0x5f'),'watch_list','upon_reject',_0x1f16('0x60'),_0x1f16('0x61'),_0x1f16('0x57'),_0x1f16('0x62'),_0x1f16('0x63'),_0x1f16('0x64'),'sys_updated_by',_0x1f16('0x65'),_0x1f16('0x66'),_0x1f16('0x67'),'sys_domain',_0x1f16('0x68'),'sys_created_by','knowledge',_0x1f16('0x38'),'calendar_stc',_0x1f16('0x69'),_0x1f16('0x6a'),_0x1f16('0x6b'),_0x1f16('0x6c'),_0x1f16('0x6d'),'work_notes_list',_0x1f16('0x6e'),_0x1f16('0x6f'),_0x1f16('0x70'),'rfc',_0x1f16('0x71'),_0x1f16('0x72'),_0x1f16('0x73'),_0x1f16('0x74'),'group_list',_0x1f16('0x75'),_0x1f16('0x76'),'resolved_at',_0x1f16('0x77'),_0x1f16('0x78'),_0x1f16('0x59'),_0x1f16('0x79'),_0x1f16('0x7a'),_0x1f16('0x5a'),_0x1f16('0x7b'),_0x1f16('0x7c'),_0x1f16('0x7d'),'assignment_group',_0x1f16('0x7e'),_0x1f16('0x7f'),'description',_0x1f16('0x80'),_0x1f16('0x5b'),_0x1f16('0x81'),_0x1f16('0x82'),_0x1f16('0x83'),_0x1f16('0x84'),_0x1f16('0x85'),_0x1f16('0x86'),_0x1f16('0x87'),_0x1f16('0x88'),_0x1f16('0x5c'),'urgency',_0x1f16('0x89'),_0x1f16('0x8a'),'reassignment_count',_0x1f16('0x8b'),_0x1f16('0x8c'),'severity',_0x1f16('0x8d'),_0x1f16('0x8e'),_0x1f16('0x8f'),_0x1f16('0x90'),_0x1f16('0x91'),'sys_mod_count',_0x1f16('0x92'),'sys_tags',_0x1f16('0x93'),'upon_approval',_0x1f16('0x94'),_0x1f16('0x95'),'category'];var _0xb9d56d='';var _0x3303ec='';var _0x2b00e6=[];var _0x2d4762='';var _0x13d2d9='';var _0x1dc9e7=[];var _0x2559f6='';var _0x4f09f6='';var _0x3378ba={};var _0x304039='';return db[_0x1f16('0x2a')][_0x1f16('0x4d')]({'where':{'id':_0x165ecd[_0x1f16('0x43')]['id']},'attributes':['id',_0x1f16('0x96'),_0x1f16('0x97'),'email',_0x1f16('0x98'),_0x1f16('0x99')]})[_0x1f16('0x25')](handleEntityNotFound(_0x3f2ed6,null))[_0x1f16('0x25')](function(_0x2e0dd8){if(_0x2e0dd8){_0x304039=_0x2e0dd8['remoteUri'];var _0x43f92d=_0x304039[_0x1f16('0x9a')](-0x1);if(_0x43f92d==='/'){_0x304039=_0x304039[_0x1f16('0x9b')](0x0,_0x304039[_0x1f16('0x9c')](_0x43f92d));}_0x4f09f6=util[_0x1f16('0x9d')](_0x1f16('0x9e'),_0x304039);_0x2559f6=util[_0x1f16('0x9d')]('%s/api/now/table/',_0x304039);_0x3378ba={'user':_0x2e0dd8[_0x1f16('0x96')],'pass':_0x2e0dd8[_0x1f16('0x97')]};var _0x4b9bfa={'method':_0x1f16('0x9f'),'uri':_0x4f09f6+_0x1f16('0xa0'),'auth':_0x3378ba,'json':!![]};return rp(_0x4b9bfa);}})['then'](function(_0x3df6ba){if(_0x3df6ba[_0x1f16('0xa1')][_0x1f16('0x35')]>0x0){_0xb9d56d=_0x3df6ba[_0x1f16('0xa1')];}console['log'](_0x1f16('0xa2'),_0xb9d56d);_0x1dc9e7=[];_0x3303ec=Object['assign']([],_0xb9d56d);_['remove'](_0x3303ec,function(_0x5c156d){return!_0x450ccd['includes'](_0x5c156d['name']);});_0x3303ec[_0x1f16('0xa3')](function(_0x5c4ba8){var _0xd934ca=createFieldObject(_0x2559f6,_0x3378ba,_0x5c4ba8[_0x1f16('0xa4')],_0x5c4ba8[_0x1f16('0x27')],_0x5c4ba8[_0x1f16('0xa5')],![]);_0x1dc9e7['push'](_0xd934ca);});return Promise['all'](_0x1dc9e7);})['then'](function(_0x5d87e2){_0x2b00e6=_0x5d87e2;_0x2d4762=Object[_0x1f16('0xa6')]([],_0xb9d56d);console[_0x1f16('0xa7')](_0x1f16('0xa8'),_0xb9d56d);_['remove'](_0x2d4762,function(_0x287895){return _0x34e722[_0x1f16('0xa9')](_0x287895['name']);});console[_0x1f16('0xa7')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2d4762);_0x1dc9e7=[];_0x2d4762[_0x1f16('0xa3')](function(_0xf5adfe){var _0x470e9e=createFieldObject(_0x2559f6,_0x3378ba,_0xf5adfe[_0x1f16('0xa4')],_0xf5adfe[_0x1f16('0x27')],_0xf5adfe[_0x1f16('0xa5')],!![]);_0x1dc9e7[_0x1f16('0xaa')](_0x470e9e);});return Promise['all'](_0x1dc9e7);})['then'](function(_0x2da884){_0x13d2d9=_0x2da884;var _0x158e98=_0x2b00e6[_0x1f16('0xab')](_0x13d2d9);return{'count':_0x158e98['length'],'rows':_0x158e98};})[_0x1f16('0x25')](respondWithResult(_0x3f2ed6,null))['catch'](function(_0x5d0bf1){console[_0x1f16('0xa7')](_0x1f16('0xac')+_0x5d0bf1);var _0x50cb28=_0x165ecd[_0x1f16('0x30')][_0x1f16('0xad')]?0x1f4:_0x5d0bf1[_0x1f16('0xae')]||0x1f4;logger[_0x1f16('0xaf')](_0x5d0bf1[_0x1f16('0x26')]);delete _0x5d0bf1['name'];if(_0x50cb28===0x191){_0x50cb28=0x190;}_0x3f2ed6[_0x1f16('0x1a')](_0x50cb28)[_0x1f16('0x28')](_0x165ecd[_0x1f16('0x30')]['test']?{'message':_0x1f16('0xb0'),'statusCode':_0x5d0bf1[_0x1f16('0xae')]}:_0x5d0bf1);});};function createFieldObject(_0x5803cf,_0x2e233d,_0x4ee886,_0x25791d,_0x10be27,_0x3ff5d0){return new Promise(function(_0x39e0c8,_0x16c807){var _0xa8b8fc={'id':_0x25791d,'name':_0x10be27,'custom':_0x3ff5d0};if(_0x4ee886===_0x1f16('0xb1')){_0xa8b8fc[_0x1f16('0x3e')]=[{'name':_0x1f16('0xb2'),'value':'true'},{'name':_0x1f16('0xb3'),'value':_0x1f16('0xb4')}];_0x39e0c8(_0xa8b8fc);}else{var _0x536b0f={'method':_0x1f16('0x9f'),'uri':_0x5803cf+'sys_choice?sysparm_query=name=incident^element='+_0x25791d,'auth':_0x2e233d,'json':!![]};return rp(_0x536b0f)['then'](function(_0xc2ad79){var _0x5a2528=[];if(_0xc2ad79['result'][_0x1f16('0x35')]>0x0){_0xc2ad79['result'][_0x1f16('0xa3')](function(_0x411a48){if(_0x411a48['inactive']===_0x1f16('0xb4')){var _0x2e2150={'name':_0x411a48['label'],'value':_0x411a48[_0x1f16('0xb5')]};_0x5a2528[_0x1f16('0xaa')](_0x2e2150);}});}_0xa8b8fc[_0x1f16('0x3e')]=_0x5a2528;if(_0xa8b8fc[_0x1f16('0x3e')][_0x1f16('0x35')]>0x0){_0x39e0c8(_0xa8b8fc);}else{if(_0x3ff5d0==![]){_0x39e0c8();}else{_0x39e0c8(_0xa8b8fc);}}});}});} \ No newline at end of file +var _0x29c8=['internalType','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','send','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','rows','catch','show','length','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','close_notes','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','correlation_id','location','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0x29c8,0xd8));var _0x829c=function(_0x4e50b8,_0x5d6c56){_0x4e50b8=_0x4e50b8-0x0;var _0x26e207=_0x29c8[_0x4e50b8];return _0x26e207;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x829c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x829c('0x1'));var rp=require(_0x829c('0x2'));var moment=require(_0x829c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x829c('0x4'));var util=require(_0x829c('0x5'));var path=require(_0x829c('0x6'));var sox=require(_0x829c('0x7'));var csv=require(_0x829c('0x8'));var ejs=require(_0x829c('0x9'));var fs=require('fs');var fs_extra=require(_0x829c('0xa'));var _=require(_0x829c('0xb'));var squel=require(_0x829c('0xc'));var crypto=require('crypto');var jsforce=require(_0x829c('0xd'));var deskjs=require(_0x829c('0xe'));var toCsv=require(_0x829c('0x8'));var querystring=require(_0x829c('0xf'));var Papa=require(_0x829c('0x10'));var Redis=require('ioredis');var authService=require(_0x829c('0x11'));var qs=require(_0x829c('0x12'));var as=require(_0x829c('0x13'));var hardwareService=require(_0x829c('0x14'));var logger=require(_0x829c('0x15'))('api');var utils=require(_0x829c('0x16'));var config=require(_0x829c('0x17'));var licenseUtil=require(_0x829c('0x18'));var db=require(_0x829c('0x19'))['db'];var integrations=require(_0x829c('0x1a'));function respondWithStatusCode(_0x1fbf38,_0x7a8fe3){_0x7a8fe3=_0x7a8fe3||0xcc;return function(_0x21db86){if(_0x21db86){return _0x1fbf38['sendStatus'](_0x7a8fe3);}return _0x1fbf38[_0x829c('0x1b')](_0x7a8fe3)['end']();};}function respondWithResult(_0x1a5f8b,_0x402c57){_0x402c57=_0x402c57||0xc8;return function(_0x167b6a){if(_0x167b6a){return _0x1a5f8b['status'](_0x402c57)[_0x829c('0x1c')](_0x167b6a);}};}function respondWithFilteredResult(_0x38bc8f,_0x3acd62){return function(_0x549360){if(_0x549360){var _0x323312=typeof _0x3acd62['offset']==='undefined'&&typeof _0x3acd62[_0x829c('0x1d')]===_0x829c('0x1e');var _0xa4130b=_0x549360[_0x829c('0x1f')];var _0xe8e3a3=_0x323312?0x0:_0x3acd62[_0x829c('0x20')];var _0x3faa56=_0x323312?_0x549360['count']:_0x3acd62['offset']+_0x3acd62[_0x829c('0x1d')];var _0x31b8d1;if(_0x3faa56>=_0xa4130b){_0x3faa56=_0xa4130b;_0x31b8d1=0xc8;}else{_0x31b8d1=0xce;}_0x38bc8f[_0x829c('0x1b')](_0x31b8d1);return _0x38bc8f['set'](_0x829c('0x21'),_0xe8e3a3+'-'+_0x3faa56+'/'+_0xa4130b)['json'](_0x549360);}return null;};}function patchUpdates(_0x19c964){return function(_0x1c20aa){try{jsonpatch[_0x829c('0x22')](_0x1c20aa,_0x19c964,!![]);}catch(_0x375242){return BPromise[_0x829c('0x23')](_0x375242);}return _0x1c20aa[_0x829c('0x24')]();};}function saveUpdates(_0x5b8414,_0x11502c){return function(_0x1ef5f8){if(_0x1ef5f8){return _0x1ef5f8[_0x829c('0x25')](_0x5b8414)[_0x829c('0x26')](function(_0x5d7188){return _0x5d7188;});}return null;};}function removeEntity(_0x1d2232,_0x14cd6f){return function(_0x40c34f){if(_0x40c34f){return _0x40c34f[_0x829c('0x27')]()[_0x829c('0x26')](function(){_0x1d2232['status'](0xcc)[_0x829c('0x28')]();});}};}function handleEntityNotFound(_0x5734bb,_0x300861){return function(_0x2c7b4c){if(!_0x2c7b4c){_0x5734bb[_0x829c('0x29')](0x194);}return _0x2c7b4c;};}function handleError(_0x3c18a7,_0x3037e2){_0x3037e2=_0x3037e2||0x1f4;return function(_0xf09504){logger[_0x829c('0x2a')](_0xf09504[_0x829c('0x2b')]);if(_0xf09504[_0x829c('0x2c')]){delete _0xf09504[_0x829c('0x2c')];}_0x3c18a7[_0x829c('0x1b')](_0x3037e2)['send'](_0xf09504);};}exports[_0x829c('0x2d')]=function(_0x222110,_0x305764){var _0x3deca4={},_0x21cc68={},_0x3680a8={'count':0x0,'rows':[]};var _0x173c6a=_[_0x829c('0x2e')](db[_0x829c('0x2f')][_0x829c('0x30')],function(_0x5e32c7){return{'name':_0x5e32c7[_0x829c('0x31')],'type':_0x5e32c7['type'][_0x829c('0x32')]};});_0x21cc68[_0x829c('0x33')]=_[_0x829c('0x2e')](_0x173c6a,_0x829c('0x2c'));_0x21cc68[_0x829c('0x34')]=_[_0x829c('0x35')](_0x222110[_0x829c('0x34')]);_0x21cc68['filters']=_[_0x829c('0x36')](_0x21cc68[_0x829c('0x33')],_0x21cc68['query']);_0x3deca4[_0x829c('0x37')]=_[_0x829c('0x36')](_0x21cc68['model'],qs[_0x829c('0x38')](_0x222110[_0x829c('0x34')][_0x829c('0x38')]));_0x3deca4[_0x829c('0x37')]=_0x3deca4[_0x829c('0x37')]['length']?_0x3deca4['attributes']:_0x21cc68[_0x829c('0x33')];if(!_0x222110[_0x829c('0x34')][_0x829c('0x39')](_0x829c('0x3a'))){_0x3deca4['limit']=qs['limit'](_0x222110['query'][_0x829c('0x1d')]);_0x3deca4[_0x829c('0x20')]=qs[_0x829c('0x20')](_0x222110[_0x829c('0x34')][_0x829c('0x20')]);}_0x3deca4[_0x829c('0x3b')]=qs[_0x829c('0x3c')](_0x222110[_0x829c('0x34')][_0x829c('0x3c')]);_0x3deca4[_0x829c('0x3d')]=qs[_0x829c('0x3e')](_[_0x829c('0x3f')](_0x222110[_0x829c('0x34')],_0x21cc68[_0x829c('0x3e')]),_0x173c6a);if(_0x222110[_0x829c('0x34')][_0x829c('0x40')]){_0x3deca4[_0x829c('0x3d')]=_[_0x829c('0x41')](_0x3deca4[_0x829c('0x3d')],{'$or':_['map'](_0x173c6a,function(_0x1f98f4){if(_0x1f98f4[_0x829c('0x42')]!=='VIRTUAL'){var _0x95ec9e={};_0x95ec9e[_0x1f98f4[_0x829c('0x2c')]]={'$like':'%'+_0x222110[_0x829c('0x34')][_0x829c('0x40')]+'%'};return _0x95ec9e;}})});}_0x3deca4=_[_0x829c('0x41')]({},_0x3deca4,_0x222110[_0x829c('0x43')]);var _0x3cdf4a={'where':_0x3deca4[_0x829c('0x3d')]};return db[_0x829c('0x2f')][_0x829c('0x1f')](_0x3cdf4a)[_0x829c('0x26')](function(_0x1af0f5){_0x3680a8[_0x829c('0x1f')]=_0x1af0f5;if(_0x222110[_0x829c('0x34')][_0x829c('0x44')]){_0x3deca4[_0x829c('0x45')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x3deca4);})[_0x829c('0x26')](function(_0x2c00d7){_0x3680a8[_0x829c('0x46')]=_0x2c00d7;return _0x3680a8;})[_0x829c('0x26')](respondWithFilteredResult(_0x305764,_0x3deca4))[_0x829c('0x47')](handleError(_0x305764,null));};exports[_0x829c('0x48')]=function(_0x2b93b9,_0x1495be){var _0x3bf5ac={'raw':![],'where':{'id':_0x2b93b9['params']['id']}},_0x34434e={};_0x34434e[_0x829c('0x33')]=_['keys'](db[_0x829c('0x2f')][_0x829c('0x30')]);_0x34434e['query']=_['keys'](_0x2b93b9[_0x829c('0x34')]);_0x34434e[_0x829c('0x3e')]=_[_0x829c('0x36')](_0x34434e[_0x829c('0x33')],_0x34434e[_0x829c('0x34')]);_0x3bf5ac[_0x829c('0x37')]=_[_0x829c('0x36')](_0x34434e[_0x829c('0x33')],qs[_0x829c('0x38')](_0x2b93b9[_0x829c('0x34')][_0x829c('0x38')]));_0x3bf5ac['attributes']=_0x3bf5ac[_0x829c('0x37')][_0x829c('0x49')]?_0x3bf5ac[_0x829c('0x37')]:_0x34434e['model'];if(_0x2b93b9[_0x829c('0x34')][_0x829c('0x44')]){_0x3bf5ac[_0x829c('0x45')]=[{'all':!![]}];}_0x3bf5ac=_[_0x829c('0x41')]({},_0x3bf5ac,_0x2b93b9['options']);return db[_0x829c('0x2f')]['find'](_0x3bf5ac)[_0x829c('0x26')](handleEntityNotFound(_0x1495be,null))['then'](respondWithResult(_0x1495be,null))[_0x829c('0x47')](handleError(_0x1495be,null));};exports[_0x829c('0x4a')]=function(_0x4f2996,_0x2b0876){return db['ServicenowAccount']['create'](_0x4f2996[_0x829c('0x4b')],{})[_0x829c('0x26')](respondWithResult(_0x2b0876,0xc9))[_0x829c('0x47')](handleError(_0x2b0876,null));};exports[_0x829c('0x25')]=function(_0x2a8d70,_0x435e57){if(_0x2a8d70[_0x829c('0x4b')]['id']){delete _0x2a8d70['body']['id'];}return db[_0x829c('0x2f')][_0x829c('0x4c')]({'where':{'id':_0x2a8d70[_0x829c('0x4d')]['id']}})[_0x829c('0x26')](handleEntityNotFound(_0x435e57,null))[_0x829c('0x26')](saveUpdates(_0x2a8d70[_0x829c('0x4b')],null))[_0x829c('0x26')](respondWithResult(_0x435e57,null))[_0x829c('0x47')](handleError(_0x435e57,null));};exports[_0x829c('0x27')]=function(_0x54cba9,_0x36be09){return db[_0x829c('0x2f')][_0x829c('0x4c')]({'where':{'id':_0x54cba9[_0x829c('0x4d')]['id']}})[_0x829c('0x26')](handleEntityNotFound(_0x36be09,null))[_0x829c('0x26')](removeEntity(_0x36be09,null))[_0x829c('0x47')](handleError(_0x36be09,null));};exports[_0x829c('0x4e')]=function(_0x34093f,_0x52cee8,_0x5c36fe){var _0x4c77bc={};var _0x1e4ebb={};var _0x5b9b73;var _0x44ee37;return db[_0x829c('0x2f')][_0x829c('0x4f')]({'where':{'id':_0x34093f['params']['id']}})[_0x829c('0x26')](handleEntityNotFound(_0x52cee8,null))[_0x829c('0x26')](function(_0x1a212a){if(_0x1a212a){_0x5b9b73=_0x1a212a;_0x1e4ebb[_0x829c('0x33')]=_['keys'](db[_0x829c('0x50')][_0x829c('0x30')]);_0x1e4ebb[_0x829c('0x34')]=_['keys'](_0x34093f[_0x829c('0x34')]);_0x1e4ebb[_0x829c('0x3e')]=_[_0x829c('0x36')](_0x1e4ebb[_0x829c('0x33')],_0x1e4ebb[_0x829c('0x34')]);_0x4c77bc[_0x829c('0x37')]=_[_0x829c('0x36')](_0x1e4ebb[_0x829c('0x33')],qs[_0x829c('0x38')](_0x34093f[_0x829c('0x34')][_0x829c('0x38')]));_0x4c77bc[_0x829c('0x37')]=_0x4c77bc['attributes'][_0x829c('0x49')]?_0x4c77bc['attributes']:_0x1e4ebb[_0x829c('0x33')];_0x4c77bc['order']=qs['sort'](_0x34093f[_0x829c('0x34')][_0x829c('0x3c')]);_0x4c77bc[_0x829c('0x3d')]=qs[_0x829c('0x3e')](_[_0x829c('0x3f')](_0x34093f[_0x829c('0x34')],_0x1e4ebb['filters']));if(_0x34093f[_0x829c('0x34')][_0x829c('0x40')]){_0x4c77bc['where']=_[_0x829c('0x41')](_0x4c77bc['where'],{'$or':_[_0x829c('0x2e')](_0x4c77bc[_0x829c('0x37')],function(_0xe1f8cc){var _0x1b06b6={};_0x1b06b6[_0xe1f8cc]={'$like':'%'+_0x34093f[_0x829c('0x34')]['filter']+'%'};return _0x1b06b6;})});}_0x4c77bc=_[_0x829c('0x41')]({},_0x4c77bc,_0x34093f[_0x829c('0x43')]);return _0x5b9b73[_0x829c('0x4e')](_0x4c77bc);}})['then'](function(_0x30101f){if(_0x30101f){_0x44ee37=_0x30101f[_0x829c('0x49')];if(!_0x34093f[_0x829c('0x34')][_0x829c('0x39')](_0x829c('0x3a'))){_0x4c77bc[_0x829c('0x1d')]=qs['limit'](_0x34093f['query']['limit']);_0x4c77bc[_0x829c('0x20')]=qs[_0x829c('0x20')](_0x34093f[_0x829c('0x34')][_0x829c('0x20')]);}return _0x5b9b73[_0x829c('0x4e')](_0x4c77bc);}})['then'](function(_0xb6673){if(_0xb6673){return _0xb6673?{'count':_0x44ee37,'rows':_0xb6673}:null;}})[_0x829c('0x26')](respondWithResult(_0x52cee8,null))[_0x829c('0x47')](handleError(_0x52cee8,null));};exports[_0x829c('0x51')]=function(_0x3882b1,_0x8a7db0,_0x2a9c55){if(_0x3882b1[_0x829c('0x4b')]['id']){delete _0x3882b1[_0x829c('0x4b')]['id'];}return db[_0x829c('0x2f')][_0x829c('0x4f')]({'where':{'id':_0x3882b1[_0x829c('0x4d')]['id']}})[_0x829c('0x26')](handleEntityNotFound(_0x8a7db0,null))[_0x829c('0x26')](function(_0x25ca67){if(_0x25ca67){_0x3882b1['body']['AccountId']=_0x25ca67['id'];_0x3882b1[_0x829c('0x4b')][_0x829c('0x52')]=integrations[_0x829c('0x53')](_0x3882b1[_0x829c('0x4b')][_0x829c('0x54')],_0x3882b1[_0x829c('0x4b')][_0x829c('0x42')]);_0x3882b1['body'][_0x829c('0x55')]=integrations[_0x829c('0x56')](_0x3882b1[_0x829c('0x4b')][_0x829c('0x54')],_0x3882b1[_0x829c('0x4b')][_0x829c('0x42')]);return db['ServicenowConfiguration']['create'](_0x3882b1[_0x829c('0x4b')],{'include':[{'model':db[_0x829c('0x57')],'as':_0x829c('0x52')},{'model':db[_0x829c('0x57')],'as':_0x829c('0x55')}]});}return null;})[_0x829c('0x26')](respondWithResult(_0x8a7db0,null))[_0x829c('0x47')](handleError(_0x8a7db0,null));};exports[_0x829c('0x58')]=function(_0x3641ec,_0xc93f8e,_0x136561){var _0x35c506=[_0x829c('0x59'),_0x829c('0x5a'),_0x829c('0x5b'),_0x829c('0x5c'),_0x829c('0x5d'),'notify',_0x829c('0x5e'),_0x829c('0x5f'),_0x829c('0x60')];var _0x318087=['parent',_0x829c('0x59'),'caused_by','watch_list',_0x829c('0x61'),_0x829c('0x62'),_0x829c('0x63'),'hold_reason',_0x829c('0x64'),_0x829c('0x65'),_0x829c('0x66'),_0x829c('0x67'),_0x829c('0x68'),_0x829c('0x69'),_0x829c('0x6a'),_0x829c('0x6b'),_0x829c('0x6c'),_0x829c('0x6d'),_0x829c('0x5b'),_0x829c('0x3b'),_0x829c('0x6e'),_0x829c('0x6f'),_0x829c('0x70'),_0x829c('0x71'),_0x829c('0x72'),'active',_0x829c('0x73'),_0x829c('0x74'),_0x829c('0x75'),_0x829c('0x76'),_0x829c('0x77'),_0x829c('0x78'),'expected_start',_0x829c('0x79'),_0x829c('0x7a'),_0x829c('0x7b'),_0x829c('0x7c'),_0x829c('0x7d'),_0x829c('0x7e'),'caller_id',_0x829c('0x7f'),_0x829c('0x5c'),'work_notes',_0x829c('0x80'),_0x829c('0x5d'),_0x829c('0x81'),_0x829c('0x82'),'work_start',_0x829c('0x83'),_0x829c('0x84'),_0x829c('0x85'),'description',_0x829c('0x86'),_0x829c('0x87'),_0x829c('0x88'),_0x829c('0x89'),'closed_by',_0x829c('0x8a'),_0x829c('0x8b'),'sys_id',_0x829c('0x8c'),_0x829c('0x8d'),_0x829c('0x5e'),_0x829c('0x8e'),_0x829c('0x8f'),_0x829c('0x90'),_0x829c('0x91'),_0x829c('0x92'),_0x829c('0x93'),_0x829c('0x5f'),'comments','sla_due',_0x829c('0x94'),_0x829c('0x95'),_0x829c('0x96'),_0x829c('0x97'),'reopen_count',_0x829c('0x98'),'escalation',_0x829c('0x99'),_0x829c('0x9a'),_0x829c('0x9b'),'category'];var _0xdbfcdf='';var _0x31edf2='';var _0x4500ef=[];var _0x2e4526='';var _0x19df9f='';var _0x183e2b=[];var _0x12a0b7='';var _0x2b07f6='';var _0x3d7757={};var _0x25f6d3='';return db[_0x829c('0x2f')][_0x829c('0x4f')]({'where':{'id':_0x3641ec['params']['id']},'attributes':['id','username','password','email',_0x829c('0x9c'),_0x829c('0x9d')]})[_0x829c('0x26')](handleEntityNotFound(_0xc93f8e,null))['then'](function(_0x40ad45){if(_0x40ad45){_0x25f6d3=_0x40ad45[_0x829c('0x9c')];var _0x1d4f55=_0x25f6d3[_0x829c('0x9e')](-0x1);if(_0x1d4f55==='/'){_0x25f6d3=_0x25f6d3[_0x829c('0x9f')](0x0,_0x25f6d3['lastIndexOf'](_0x1d4f55));}_0x2b07f6=util[_0x829c('0xa0')](_0x829c('0xa1'),_0x25f6d3);_0x12a0b7=util[_0x829c('0xa0')](_0x829c('0xa2'),_0x25f6d3);_0x3d7757={'user':_0x40ad45[_0x829c('0xa3')],'pass':_0x40ad45[_0x829c('0xa4')]};var _0x543bbd={'method':'GET','uri':_0x2b07f6+_0x829c('0xa5'),'auth':_0x3d7757,'json':!![]};return rp(_0x543bbd);}})[_0x829c('0x26')](function(_0x1f7e29){if(_0x1f7e29[_0x829c('0xa6')][_0x829c('0x49')]>0x0){_0xdbfcdf=_0x1f7e29[_0x829c('0xa6')];}console[_0x829c('0xa7')](_0x829c('0xa8'),_0xdbfcdf);_0x183e2b=[];_0x31edf2=Object['assign']([],_0xdbfcdf);_[_0x829c('0xa9')](_0x31edf2,function(_0x4cf60e){return!_0x35c506[_0x829c('0xaa')](_0x4cf60e['name']);});_0x31edf2[_0x829c('0xab')](function(_0x241699){var _0x1c1bde=createFieldObject(_0x12a0b7,_0x3d7757,_0x241699[_0x829c('0xac')],_0x241699['name'],_0x241699['label'],![]);_0x183e2b[_0x829c('0xad')](_0x1c1bde);});return Promise[_0x829c('0xae')](_0x183e2b);})[_0x829c('0x26')](function(_0x49fe3a){_0x4500ef=_0x49fe3a;_0x2e4526=Object[_0x829c('0xaf')]([],_0xdbfcdf);console['log'](_0x829c('0xb0'),_0xdbfcdf);_[_0x829c('0xa9')](_0x2e4526,function(_0x5c8ab3){return _0x318087[_0x829c('0xaa')](_0x5c8ab3[_0x829c('0x2c')]);});console[_0x829c('0xa7')](_0x829c('0xb1'),_0x2e4526);_0x183e2b=[];_0x2e4526['forEach'](function(_0x4a7c77){var _0x7968d7=createFieldObject(_0x12a0b7,_0x3d7757,_0x4a7c77['internalType'],_0x4a7c77[_0x829c('0x2c')],_0x4a7c77[_0x829c('0xb2')],!![]);_0x183e2b[_0x829c('0xad')](_0x7968d7);});return Promise[_0x829c('0xae')](_0x183e2b);})[_0x829c('0x26')](function(_0x2b05de){_0x19df9f=_0x2b05de;var _0x2a0baa=_0x4500ef[_0x829c('0xb3')](_0x19df9f);return{'count':_0x2a0baa[_0x829c('0x49')],'rows':_0x2a0baa};})[_0x829c('0x26')](respondWithResult(_0xc93f8e,null))[_0x829c('0x47')](function(_0x14b966){console['log'](_0x829c('0xb4')+_0x14b966);var _0x1cffec=_0x3641ec[_0x829c('0x34')]['test']?0x1f4:_0x14b966[_0x829c('0xb5')]||0x1f4;logger['error'](_0x14b966[_0x829c('0x2b')]);delete _0x14b966[_0x829c('0x2c')];if(_0x1cffec===0x191){_0x1cffec=0x190;}_0xc93f8e['status'](_0x1cffec)[_0x829c('0xb6')](_0x3641ec['query'][_0x829c('0xb7')]?{'message':_0x829c('0xb8'),'statusCode':_0x14b966[_0x829c('0xb5')]}:_0x14b966);});};function createFieldObject(_0x538240,_0x41e56d,_0x31f3be,_0x2e3081,_0x3aa402,_0x23b979){return new Promise(function(_0x1e1547,_0x41033a){var _0x11117c={'id':_0x2e3081,'name':_0x3aa402,'custom':_0x23b979};if(_0x31f3be===_0x829c('0xb9')){_0x11117c[_0x829c('0x43')]=[{'name':_0x829c('0xba'),'value':_0x829c('0xbb')},{'name':_0x829c('0xbc'),'value':_0x829c('0xbd')}];_0x1e1547(_0x11117c);}else{var _0x3cbfcd={'method':_0x829c('0xbe'),'uri':_0x538240+_0x829c('0xbf')+_0x2e3081,'auth':_0x41e56d,'json':!![]};return rp(_0x3cbfcd)['then'](function(_0x5dcbe7){var _0x438619=[];if(_0x5dcbe7['result'][_0x829c('0x49')]>0x0){_0x5dcbe7[_0x829c('0xa6')][_0x829c('0xab')](function(_0x1a64be){if(_0x1a64be[_0x829c('0xc0')]===_0x829c('0xbd')){var _0x369035={'name':_0x1a64be['label'],'value':_0x1a64be[_0x829c('0xc1')]};_0x438619['push'](_0x369035);}});}_0x11117c[_0x829c('0x43')]=_0x438619;if(_0x11117c['options'][_0x829c('0x49')]>0x0){_0x1e1547(_0x11117c);}else{if(_0x23b979==![]){_0x1e1547();}else{_0x1e1547(_0x11117c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 0d99c91..cc72731 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x2b39af,_0x5562f1){var _0x5a5c60=function(_0x4fd7a5){while(--_0x4fd7a5){_0x2b39af['push'](_0x2b39af['shift']());}};_0x5a5c60(++_0x5562f1);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));var integrations=require(_0xd7df('0xb'));module[_0xd7df('0xc')]=function(_0x39ce98,_0x354ea7){return _0x39ce98[_0xd7df('0xd')](_0xd7df('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa630=['moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x21a760,_0x50ffdf){var _0x426e31=function(_0x1f8348){while(--_0x1f8348){_0x21a760['push'](_0x21a760['shift']());}};_0x426e31(++_0x50ffdf);}(_0xa630,0xbe));var _0x0a63=function(_0x6e3c39,_0x6a7a10){_0x6e3c39=_0x6e3c39-0x0;var _0x20669f=_0xa630[_0x6e3c39];return _0x20669f;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));var integrations=require(_0x0a63('0x7'));module[_0x0a63('0x8')]=function(_0x4b7474,_0x2760b0){return _0x4b7474[_0x0a63('0x9')](_0x0a63('0xa'),attributes,{'tableName':_0x0a63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index dbdbeb3..86956d4 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 _0xe57c=['model','attributes','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ServicenowAccount','findAll','options','raw','where','limit','include','map'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe57c,0x91));var _0xce57=function(_0x7862d6,_0x317528){_0x7862d6=_0x7862d6-0x0;var _0x44251e=_0xe57c[_0x7862d6];return _0x44251e;};'use strict';var _=require(_0xce57('0x0'));var util=require(_0xce57('0x1'));var moment=require('moment');var BPromise=require(_0xce57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce57('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce57('0x4'));var logger=require(_0xce57('0x5'))(_0xce57('0x6'));var config=require(_0xce57('0x7'));var jayson=require(_0xce57('0x8'));var client=jayson[_0xce57('0x9')][_0xce57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a905b,_0x4123d8,_0xa2805c){return new BPromise(function(_0x52f06f,_0x70b011){return client[_0xce57('0xb')](_0x2a905b,_0xa2805c)[_0xce57('0xc')](function(_0x38151d){logger['info'](_0xce57('0xd'),_0x4123d8,_0xce57('0xe'));logger[_0xce57('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4123d8,'request\x20sent',JSON['stringify'](_0x38151d));if(_0x38151d[_0xce57('0x10')]){if(_0x38151d['error'][_0xce57('0x11')]===0x1f4){logger[_0xce57('0x10')](_0xce57('0xd'),_0x4123d8,_0x38151d[_0xce57('0x10')]['message']);return _0x70b011(_0x38151d[_0xce57('0x10')][_0xce57('0x12')]);}logger['error'](_0xce57('0xd'),_0x4123d8,_0x38151d[_0xce57('0x10')][_0xce57('0x12')]);return _0x52f06f(_0x38151d['error'][_0xce57('0x12')]);}else{logger[_0xce57('0x13')](_0xce57('0xd'),_0x4123d8,'request\x20sent');_0x52f06f(_0x38151d[_0xce57('0x14')][_0xce57('0x12')]);}})[_0xce57('0x15')](function(_0x4997d9){logger['error'](_0xce57('0xd'),_0x4123d8,_0x4997d9);_0x70b011(_0x4997d9);});});}exports['GetServicenowAccount']=function(_0x4fb00d){var _0x16d10c=this;return new Promise(function(_0x55192e,_0x4762b9){return db[_0xce57('0x16')][_0xce57('0x17')]({'raw':_0x4fb00d[_0xce57('0x18')]?_0x4fb00d[_0xce57('0x18')][_0xce57('0x19')]===undefined?!![]:![]:!![],'where':_0x4fb00d[_0xce57('0x18')]?_0x4fb00d['options'][_0xce57('0x1a')]||null:null,'attributes':_0x4fb00d['options']?_0x4fb00d[_0xce57('0x18')]['attributes']||null:null,'limit':_0x4fb00d[_0xce57('0x18')]?_0x4fb00d['options'][_0xce57('0x1b')]||null:null,'include':_0x4fb00d[_0xce57('0x18')]?_0x4fb00d['options'][_0xce57('0x1c')]?_[_0xce57('0x1d')](_0x4fb00d[_0xce57('0x18')][_0xce57('0x1c')],function(_0x343c21){return{'model':db[_0x343c21[_0xce57('0x1e')]],'as':_0x343c21['as'],'attributes':_0x343c21[_0xce57('0x1f')],'include':_0x343c21[_0xce57('0x1c')]?_['map'](_0x343c21[_0xce57('0x1c')],function(_0x442f7f){return{'model':db[_0x442f7f['model']],'as':_0x442f7f['as'],'attributes':_0x442f7f[_0xce57('0x1f')],'include':_0x442f7f[_0xce57('0x1c')]?_[_0xce57('0x1d')](_0x442f7f[_0xce57('0x1c')],function(_0x3e05f0){return{'model':db[_0x3e05f0[_0xce57('0x1e')]],'as':_0x3e05f0['as'],'attributes':_0x3e05f0[_0xce57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xce57('0xc')](function(_0x1b50b6){logger[_0xce57('0x13')](_0xce57('0x20'),_0x4fb00d);logger[_0xce57('0xf')](_0xce57('0x20'),_0x4fb00d,JSON['stringify'](_0x1b50b6));_0x55192e(_0x1b50b6);})[_0xce57('0x15')](function(_0xa6cb91){logger['error']('GetServicenowAccount',_0xa6cb91[_0xce57('0x12')],_0x4fb00d);_0x4762b9(_0x16d10c[_0xce57('0x10')](0x1f4,_0xa6cb91[_0xce57('0x12')]));});});};exports[_0xce57('0x21')]=function(_0x5a9a4b){var _0x5548ef=this;return new Promise(function(_0x2fb818,_0x568b5c){return db[_0xce57('0x16')][_0xce57('0x22')]({'raw':_0x5a9a4b[_0xce57('0x18')]?_0x5a9a4b[_0xce57('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5a9a4b[_0xce57('0x18')]?_0x5a9a4b[_0xce57('0x18')]['where']||null:null,'attributes':_0x5a9a4b[_0xce57('0x18')]?_0x5a9a4b[_0xce57('0x18')][_0xce57('0x1f')]||null:null,'include':_0x5a9a4b[_0xce57('0x18')]?_0x5a9a4b[_0xce57('0x18')][_0xce57('0x1c')]?_[_0xce57('0x1d')](_0x5a9a4b[_0xce57('0x18')][_0xce57('0x1c')],function(_0x4e575f){return{'model':db[_0x4e575f[_0xce57('0x1e')]],'as':_0x4e575f['as'],'attributes':_0x4e575f[_0xce57('0x1f')],'include':_0x4e575f[_0xce57('0x1c')]?_['map'](_0x4e575f[_0xce57('0x1c')],function(_0xef29ec){return{'model':db[_0xef29ec[_0xce57('0x1e')]],'as':_0xef29ec['as'],'attributes':_0xef29ec[_0xce57('0x1f')],'include':_0xef29ec['include']?_[_0xce57('0x1d')](_0xef29ec[_0xce57('0x1c')],function(_0x5f109a){return{'model':db[_0x5f109a[_0xce57('0x1e')]],'as':_0x5f109a['as'],'attributes':_0x5f109a[_0xce57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xce57('0xc')](function(_0x3d789f){logger['info'](_0xce57('0x21'),_0x5a9a4b);logger[_0xce57('0xf')](_0xce57('0x21'),_0x5a9a4b,JSON['stringify'](_0x3d789f));_0x2fb818(_0x3d789f);})['catch'](function(_0x4a23b4){logger['error'](_0xce57('0x21'),_0x4a23b4[_0xce57('0x12')],_0x5a9a4b);_0x568b5c(_0x5548ef[_0xce57('0x10')](0x1f4,_0x4a23b4['message']));});});}; \ No newline at end of file +var _0x8aa2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','model','map','GetServicenowAccount','ShowServicenowAccount','find','lodash','moment'];(function(_0x31719b,_0x2cb3a4){var _0xf417c6=function(_0x44add8){while(--_0x44add8){_0x31719b['push'](_0x31719b['shift']());}};_0xf417c6(++_0x2cb3a4);}(_0x8aa2,0x6a));var _0x28aa=function(_0x371cc4,_0x57adca){_0x371cc4=_0x371cc4-0x0;var _0x14be24=_0x8aa2[_0x371cc4];return _0x14be24;};'use strict';var _=require(_0x28aa('0x0'));var util=require('util');var moment=require(_0x28aa('0x1'));var BPromise=require(_0x28aa('0x2'));var rs=require(_0x28aa('0x3'));var fs=require('fs');var Redis=require(_0x28aa('0x4'));var db=require(_0x28aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28aa('0x6'))(_0x28aa('0x7'));var config=require('../../config/environment');var jayson=require(_0x28aa('0x8'));var client=jayson[_0x28aa('0x9')][_0x28aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8a5d,_0x4dc4f0,_0x7eb541){return new BPromise(function(_0x473b96,_0x62175e){return client[_0x28aa('0xb')](_0x2b8a5d,_0x7eb541)[_0x28aa('0xc')](function(_0x2e3b66){logger[_0x28aa('0xd')](_0x28aa('0xe'),_0x4dc4f0,'request\x20sent');logger[_0x28aa('0xf')](_0x28aa('0x10'),_0x4dc4f0,_0x28aa('0x11'),JSON[_0x28aa('0x12')](_0x2e3b66));if(_0x2e3b66[_0x28aa('0x13')]){if(_0x2e3b66['error'][_0x28aa('0x14')]===0x1f4){logger[_0x28aa('0x13')](_0x28aa('0xe'),_0x4dc4f0,_0x2e3b66['error'][_0x28aa('0x15')]);return _0x62175e(_0x2e3b66[_0x28aa('0x13')][_0x28aa('0x15')]);}logger['error'](_0x28aa('0xe'),_0x4dc4f0,_0x2e3b66[_0x28aa('0x13')]['message']);return _0x473b96(_0x2e3b66[_0x28aa('0x13')]['message']);}else{logger['info'](_0x28aa('0xe'),_0x4dc4f0,_0x28aa('0x11'));_0x473b96(_0x2e3b66[_0x28aa('0x16')]['message']);}})[_0x28aa('0x17')](function(_0x55a16f){logger[_0x28aa('0x13')](_0x28aa('0xe'),_0x4dc4f0,_0x55a16f);_0x62175e(_0x55a16f);});});}exports['GetServicenowAccount']=function(_0x577275){var _0x2baabe=this;return new Promise(function(_0x50b364,_0x1b0f69){return db[_0x28aa('0x18')][_0x28aa('0x19')]({'raw':_0x577275[_0x28aa('0x1a')]?_0x577275[_0x28aa('0x1a')][_0x28aa('0x1b')]===undefined?!![]:![]:!![],'where':_0x577275['options']?_0x577275[_0x28aa('0x1a')][_0x28aa('0x1c')]||null:null,'attributes':_0x577275['options']?_0x577275['options'][_0x28aa('0x1d')]||null:null,'limit':_0x577275[_0x28aa('0x1a')]?_0x577275[_0x28aa('0x1a')]['limit']||null:null,'include':_0x577275[_0x28aa('0x1a')]?_0x577275[_0x28aa('0x1a')][_0x28aa('0x1e')]?_['map'](_0x577275[_0x28aa('0x1a')][_0x28aa('0x1e')],function(_0x334c59){return{'model':db[_0x334c59['model']],'as':_0x334c59['as'],'attributes':_0x334c59['attributes'],'include':_0x334c59[_0x28aa('0x1e')]?_['map'](_0x334c59[_0x28aa('0x1e')],function(_0x39e9ee){return{'model':db[_0x39e9ee[_0x28aa('0x1f')]],'as':_0x39e9ee['as'],'attributes':_0x39e9ee[_0x28aa('0x1d')],'include':_0x39e9ee['include']?_[_0x28aa('0x20')](_0x39e9ee['include'],function(_0x1b5494){return{'model':db[_0x1b5494[_0x28aa('0x1f')]],'as':_0x1b5494['as'],'attributes':_0x1b5494[_0x28aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x28aa('0xc')](function(_0x1f2481){logger['info'](_0x28aa('0x21'),_0x577275);logger['debug'](_0x28aa('0x21'),_0x577275,JSON['stringify'](_0x1f2481));_0x50b364(_0x1f2481);})[_0x28aa('0x17')](function(_0x18cc35){logger[_0x28aa('0x13')](_0x28aa('0x21'),_0x18cc35[_0x28aa('0x15')],_0x577275);_0x1b0f69(_0x2baabe[_0x28aa('0x13')](0x1f4,_0x18cc35['message']));});});};exports[_0x28aa('0x22')]=function(_0x330b2e){var _0x1b8927=this;return new Promise(function(_0x1a2944,_0x337074){return db['ServicenowAccount'][_0x28aa('0x23')]({'raw':_0x330b2e[_0x28aa('0x1a')]?_0x330b2e['options'][_0x28aa('0x1b')]===undefined?!![]:![]:!![],'where':_0x330b2e['options']?_0x330b2e['options']['where']||null:null,'attributes':_0x330b2e[_0x28aa('0x1a')]?_0x330b2e[_0x28aa('0x1a')][_0x28aa('0x1d')]||null:null,'include':_0x330b2e['options']?_0x330b2e[_0x28aa('0x1a')]['include']?_[_0x28aa('0x20')](_0x330b2e[_0x28aa('0x1a')][_0x28aa('0x1e')],function(_0x3d26e8){return{'model':db[_0x3d26e8['model']],'as':_0x3d26e8['as'],'attributes':_0x3d26e8[_0x28aa('0x1d')],'include':_0x3d26e8[_0x28aa('0x1e')]?_[_0x28aa('0x20')](_0x3d26e8[_0x28aa('0x1e')],function(_0x214d55){return{'model':db[_0x214d55[_0x28aa('0x1f')]],'as':_0x214d55['as'],'attributes':_0x214d55[_0x28aa('0x1d')],'include':_0x214d55[_0x28aa('0x1e')]?_[_0x28aa('0x20')](_0x214d55[_0x28aa('0x1e')],function(_0x574fbd){return{'model':db[_0x574fbd[_0x28aa('0x1f')]],'as':_0x574fbd['as'],'attributes':_0x574fbd[_0x28aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x28aa('0xc')](function(_0x45e73e){logger[_0x28aa('0xd')](_0x28aa('0x22'),_0x330b2e);logger['debug'](_0x28aa('0x22'),_0x330b2e,JSON[_0x28aa('0x12')](_0x45e73e));_0x1a2944(_0x45e73e);})[_0x28aa('0x17')](function(_0x209e25){logger['error'](_0x28aa('0x22'),_0x209e25['message'],_0x330b2e);_0x337074(_0x1b8927[_0x28aa('0x13')](0x1f4,_0x209e25[_0x28aa('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b7d43b9..f08bd63 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 _0xd608=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x105d0d,_0x2b9b29){var _0x5eb3b8=function(_0x34a1fe){while(--_0x34a1fe){_0x105d0d['push'](_0x105d0d['shift']());}};_0x5eb3b8(++_0x2b9b29);}(_0xd608,0x10f));var _0x8d60=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd608[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8d60('0x0'));var util=require(_0x8d60('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8d60('0x2'));var router=express['Router']();var fs_extra=require(_0x8d60('0x3'));var auth=require(_0x8d60('0x4'));var interaction=require(_0x8d60('0x5'));var config=require(_0x8d60('0x6'));var controller=require(_0x8d60('0x7'));router[_0x8d60('0x8')]('/',auth[_0x8d60('0x9')](),controller[_0x8d60('0xa')]);router[_0x8d60('0x8')](_0x8d60('0xb'),auth['isAuthenticated'](),controller[_0x8d60('0xc')]);router[_0x8d60('0x8')](_0x8d60('0xd'),auth[_0x8d60('0x9')](),controller[_0x8d60('0xe')]);router[_0x8d60('0x8')](_0x8d60('0xf'),auth[_0x8d60('0x9')](),controller[_0x8d60('0x10')]);router[_0x8d60('0x8')](_0x8d60('0x11'),auth['isAuthenticated'](),controller[_0x8d60('0x12')]);router[_0x8d60('0x13')]('/',auth[_0x8d60('0x9')](),controller[_0x8d60('0x14')]);router[_0x8d60('0x15')](_0x8d60('0xb'),auth[_0x8d60('0x9')](),controller[_0x8d60('0x16')]);router[_0x8d60('0x17')](_0x8d60('0xb'),auth[_0x8d60('0x9')](),controller[_0x8d60('0x18')]);module[_0x8d60('0x19')]=router; \ No newline at end of file +var _0xd5f9=['get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x560cd0,_0x4f543b){var _0x1cfcd9=function(_0x19a3c6){while(--_0x19a3c6){_0x560cd0['push'](_0x560cd0['shift']());}};_0x1cfcd9(++_0x4f543b);}(_0xd5f9,0x93));var _0x9d5f=function(_0x3ae812,_0x104449){_0x3ae812=_0x3ae812-0x0;var _0x4dd965=_0xd5f9[_0x3ae812];return _0x4dd965;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9d5f('0x0'));var express=require(_0x9d5f('0x1'));var router=express[_0x9d5f('0x2')]();var fs_extra=require(_0x9d5f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9d5f('0x4'));var config=require(_0x9d5f('0x5'));var controller=require(_0x9d5f('0x6'));router[_0x9d5f('0x7')]('/',auth[_0x9d5f('0x8')](),controller['index']);router[_0x9d5f('0x7')](_0x9d5f('0x9'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0xa')]);router[_0x9d5f('0x7')](_0x9d5f('0xb'),auth[_0x9d5f('0x8')](),controller['getFields']);router[_0x9d5f('0x7')](_0x9d5f('0xc'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0xd')]);router[_0x9d5f('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9d5f('0xe')]);router[_0x9d5f('0xf')]('/',auth['isAuthenticated'](),controller[_0x9d5f('0x10')]);router[_0x9d5f('0x11')](_0x9d5f('0x9'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0x12')]);router[_0x9d5f('0x13')](_0x9d5f('0x9'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0x14')]);module[_0x9d5f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 779d60e..fed3845 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 _0xcc04=['exports','STRING','sequelize'];(function(_0x59fb57,_0x39b3b1){var _0x38c111=function(_0x1ec183){while(--_0x1ec183){_0x59fb57['push'](_0x59fb57['shift']());}};_0x38c111(++_0x39b3b1);}(_0xcc04,0x1b2));var _0x4cc0=function(_0x3ea19a,_0x54dc41){_0x3ea19a=_0x3ea19a-0x0;var _0x1f821d=_0xcc04[_0x3ea19a];return _0x1f821d;};'use strict';var Sequelize=require(_0x4cc0('0x0'));module[_0x4cc0('0x1')]={'name':{'type':Sequelize[_0x4cc0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b72=['STRING'];(function(_0x12751e,_0x18d605){var _0x26ac32=function(_0x8a7fee){while(--_0x8a7fee){_0x12751e['push'](_0x12751e['shift']());}};_0x26ac32(++_0x18d605);}(_0x4b72,0x124));var _0x24b7=function(_0x3ff018,_0x25e509){_0x3ff018=_0x3ff018-0x0;var _0x212176=_0x4b72[_0x3ff018];return _0x212176;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x24b7('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 65e9ab3..8bb2ec6 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 _0xf6de=['json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','status','error','name','send','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xf4a6f3,_0x557061){var _0x1be067=function(_0x59bd76){while(--_0x59bd76){_0xf4a6f3['push'](_0xf4a6f3['shift']());}};_0x1be067(++_0x557061);}(_0xf6de,0x1ca));var _0xef6d=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xf6de[_0x59145a];return _0xf04d7;};'use strict';var emlformat=require(_0xef6d('0x0'));var rimraf=require(_0xef6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef6d('0x2'));var rp=require(_0xef6d('0x3'));var moment=require(_0xef6d('0x4'));var BPromise=require(_0xef6d('0x5'));var Mustache=require(_0xef6d('0x6'));var util=require('util');var path=require(_0xef6d('0x7'));var sox=require(_0xef6d('0x8'));var csv=require(_0xef6d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef6d('0xa'));var _=require(_0xef6d('0xb'));var squel=require(_0xef6d('0xc'));var crypto=require(_0xef6d('0xd'));var jsforce=require(_0xef6d('0xe'));var deskjs=require(_0xef6d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xef6d('0x10'));var Papa=require(_0xef6d('0x11'));var Redis=require(_0xef6d('0x12'));var authService=require(_0xef6d('0x13'));var qs=require(_0xef6d('0x14'));var as=require(_0xef6d('0x15'));var hardwareService=require(_0xef6d('0x16'));var logger=require(_0xef6d('0x17'))('api');var utils=require(_0xef6d('0x18'));var config=require(_0xef6d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xef6d('0x1a'))['db'];function respondWithStatusCode(_0x429d45,_0x593eea){_0x593eea=_0x593eea||0xcc;return function(_0x17ab1d){if(_0x17ab1d){return _0x429d45[_0xef6d('0x1b')](_0x593eea);}return _0x429d45['status'](_0x593eea)['end']();};}function respondWithResult(_0x274cbc,_0x4e29e5){_0x4e29e5=_0x4e29e5||0xc8;return function(_0x6435cd){if(_0x6435cd){return _0x274cbc['status'](_0x4e29e5)[_0xef6d('0x1c')](_0x6435cd);}};}function respondWithFilteredResult(_0x462558,_0x3fd83f){return function(_0x4a72b3){if(_0x4a72b3){var _0x3e8eb5=typeof _0x3fd83f['offset']==='undefined'&&typeof _0x3fd83f[_0xef6d('0x1d')]===_0xef6d('0x1e');var _0xede4cc=_0x4a72b3[_0xef6d('0x1f')];var _0xf859c5=_0x3e8eb5?0x0:_0x3fd83f['offset'];var _0x848155=_0x3e8eb5?_0x4a72b3[_0xef6d('0x1f')]:_0x3fd83f[_0xef6d('0x20')]+_0x3fd83f[_0xef6d('0x1d')];var _0x10d20c;if(_0x848155>=_0xede4cc){_0x848155=_0xede4cc;_0x10d20c=0xc8;}else{_0x10d20c=0xce;}_0x462558['status'](_0x10d20c);return _0x462558[_0xef6d('0x21')](_0xef6d('0x22'),_0xf859c5+'-'+_0x848155+'/'+_0xede4cc)['json'](_0x4a72b3);}return null;};}function patchUpdates(_0x12531d){return function(_0x20ca20){try{jsonpatch['apply'](_0x20ca20,_0x12531d,!![]);}catch(_0x4fe203){return BPromise[_0xef6d('0x23')](_0x4fe203);}return _0x20ca20[_0xef6d('0x24')]();};}function saveUpdates(_0x46d821,_0x4f3796){return function(_0x11a05f){if(_0x11a05f){return _0x11a05f[_0xef6d('0x25')](_0x46d821)[_0xef6d('0x26')](function(_0xf8b78d){return _0xf8b78d;});}return null;};}function removeEntity(_0x1e9c2b,_0x3387e){return function(_0x15fbf8){if(_0x15fbf8){return _0x15fbf8[_0xef6d('0x27')]()[_0xef6d('0x26')](function(){_0x1e9c2b[_0xef6d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a38b2,_0xb9416b){return function(_0x14eee4){if(!_0x14eee4){_0x3a38b2[_0xef6d('0x1b')](0x194);}return _0x14eee4;};}function handleError(_0x491d21,_0x1f6e83){_0x1f6e83=_0x1f6e83||0x1f4;return function(_0x23f66e){logger[_0xef6d('0x29')](_0x23f66e['stack']);if(_0x23f66e['name']){delete _0x23f66e[_0xef6d('0x2a')];}_0x491d21[_0xef6d('0x28')](_0x1f6e83)[_0xef6d('0x2b')](_0x23f66e);};}exports['index']=function(_0x2854fb,_0x2565bc){var _0x299bbe={},_0x2a8776={},_0x1b7305={'count':0x0,'rows':[]};var _0x2186d4=_[_0xef6d('0x2c')](db[_0xef6d('0x2d')]['rawAttributes'],function(_0x176ba7){return{'name':_0x176ba7[_0xef6d('0x2e')],'type':_0x176ba7[_0xef6d('0x2f')][_0xef6d('0x30')]};});_0x2a8776[_0xef6d('0x31')]=_[_0xef6d('0x2c')](_0x2186d4,_0xef6d('0x2a'));_0x2a8776[_0xef6d('0x32')]=_[_0xef6d('0x33')](_0x2854fb['query']);_0x2a8776[_0xef6d('0x34')]=_[_0xef6d('0x35')](_0x2a8776[_0xef6d('0x31')],_0x2a8776[_0xef6d('0x32')]);_0x299bbe[_0xef6d('0x36')]=_['intersection'](_0x2a8776[_0xef6d('0x31')],qs[_0xef6d('0x37')](_0x2854fb[_0xef6d('0x32')][_0xef6d('0x37')]));_0x299bbe['attributes']=_0x299bbe[_0xef6d('0x36')][_0xef6d('0x38')]?_0x299bbe['attributes']:_0x2a8776[_0xef6d('0x31')];if(!_0x2854fb[_0xef6d('0x32')][_0xef6d('0x39')](_0xef6d('0x3a'))){_0x299bbe['limit']=qs['limit'](_0x2854fb[_0xef6d('0x32')]['limit']);_0x299bbe['offset']=qs[_0xef6d('0x20')](_0x2854fb[_0xef6d('0x32')][_0xef6d('0x20')]);}_0x299bbe[_0xef6d('0x3b')]=qs[_0xef6d('0x3c')](_0x2854fb[_0xef6d('0x32')][_0xef6d('0x3c')]);_0x299bbe[_0xef6d('0x3d')]=qs['filters'](_[_0xef6d('0x3e')](_0x2854fb[_0xef6d('0x32')],_0x2a8776[_0xef6d('0x34')]),_0x2186d4);if(_0x2854fb[_0xef6d('0x32')][_0xef6d('0x3f')]){_0x299bbe[_0xef6d('0x3d')]=_['merge'](_0x299bbe[_0xef6d('0x3d')],{'$or':_[_0xef6d('0x2c')](_0x2186d4,function(_0x53be05){if(_0x53be05[_0xef6d('0x2f')]!=='VIRTUAL'){var _0x5a253={};_0x5a253[_0x53be05[_0xef6d('0x2a')]]={'$like':'%'+_0x2854fb['query'][_0xef6d('0x3f')]+'%'};return _0x5a253;}})});}_0x299bbe=_[_0xef6d('0x40')]({},_0x299bbe,_0x2854fb[_0xef6d('0x41')]);var _0x360e0b={'where':_0x299bbe['where']};return db[_0xef6d('0x2d')][_0xef6d('0x1f')](_0x360e0b)[_0xef6d('0x26')](function(_0x4ca672){_0x1b7305[_0xef6d('0x1f')]=_0x4ca672;if(_0x2854fb[_0xef6d('0x32')][_0xef6d('0x42')]){_0x299bbe[_0xef6d('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xef6d('0x44')](_0x299bbe);})['then'](function(_0x5df818){_0x1b7305['rows']=_0x5df818;return _0x1b7305;})[_0xef6d('0x26')](respondWithFilteredResult(_0x2565bc,_0x299bbe))['catch'](handleError(_0x2565bc,null));};exports[_0xef6d('0x45')]=function(_0x1d90f8,_0x1638f6){var _0x15807b={'raw':![],'where':{'id':_0x1d90f8[_0xef6d('0x46')]['id']}},_0x2214ae={};_0x2214ae[_0xef6d('0x31')]=_[_0xef6d('0x33')](db[_0xef6d('0x2d')][_0xef6d('0x47')]);_0x2214ae['query']=_[_0xef6d('0x33')](_0x1d90f8['query']);_0x2214ae[_0xef6d('0x34')]=_[_0xef6d('0x35')](_0x2214ae[_0xef6d('0x31')],_0x2214ae[_0xef6d('0x32')]);_0x15807b[_0xef6d('0x36')]=_[_0xef6d('0x35')](_0x2214ae['model'],qs[_0xef6d('0x37')](_0x1d90f8[_0xef6d('0x32')][_0xef6d('0x37')]));_0x15807b[_0xef6d('0x36')]=_0x15807b['attributes'][_0xef6d('0x38')]?_0x15807b[_0xef6d('0x36')]:_0x2214ae[_0xef6d('0x31')];if(_0x1d90f8['query'][_0xef6d('0x42')]){_0x15807b[_0xef6d('0x43')]=[{'all':!![]}];}_0x15807b=_[_0xef6d('0x40')]({},_0x15807b,_0x1d90f8['options']);return db[_0xef6d('0x2d')][_0xef6d('0x48')](_0x15807b)[_0xef6d('0x26')](handleEntityNotFound(_0x1638f6,null))[_0xef6d('0x26')](respondWithResult(_0x1638f6,null))[_0xef6d('0x49')](handleError(_0x1638f6,null));};exports[_0xef6d('0x4a')]=function(_0x25fa92,_0x16ead4){return db[_0xef6d('0x2d')][_0xef6d('0x4a')](_0x25fa92[_0xef6d('0x4b')],{})[_0xef6d('0x26')](respondWithResult(_0x16ead4,0xc9))[_0xef6d('0x49')](handleError(_0x16ead4,null));};exports[_0xef6d('0x25')]=function(_0x394d96,_0x41ebc1){if(_0x394d96[_0xef6d('0x4b')]['id']){delete _0x394d96['body']['id'];}return db[_0xef6d('0x2d')][_0xef6d('0x48')]({'where':{'id':_0x394d96[_0xef6d('0x46')]['id']}})[_0xef6d('0x26')](handleEntityNotFound(_0x41ebc1,null))[_0xef6d('0x26')](saveUpdates(_0x394d96[_0xef6d('0x4b')],null))[_0xef6d('0x26')](respondWithResult(_0x41ebc1,null))[_0xef6d('0x49')](handleError(_0x41ebc1,null));};exports['destroy']=function(_0x245325,_0x526fa7){return db[_0xef6d('0x2d')][_0xef6d('0x48')]({'where':{'id':_0x245325['params']['id']}})[_0xef6d('0x26')](handleEntityNotFound(_0x526fa7,null))[_0xef6d('0x26')](removeEntity(_0x526fa7,null))[_0xef6d('0x49')](handleError(_0x526fa7,null));};exports['getFields']=function(_0x4f6e0a,_0x992734,_0x318187){var _0x5d39fc={};var _0x37ec94={};var _0x412405;var _0x4984c1;return db[_0xef6d('0x2d')][_0xef6d('0x4c')]({'where':{'id':_0x4f6e0a[_0xef6d('0x46')]['id']}})[_0xef6d('0x26')](handleEntityNotFound(_0x992734,null))[_0xef6d('0x26')](function(_0x360d0b){if(_0x360d0b){_0x412405=_0x360d0b;_0x37ec94[_0xef6d('0x31')]=_[_0xef6d('0x33')](db[_0xef6d('0x4d')]['rawAttributes']);_0x37ec94['query']=_[_0xef6d('0x33')](_0x4f6e0a[_0xef6d('0x32')]);_0x37ec94['filters']=_[_0xef6d('0x35')](_0x37ec94[_0xef6d('0x31')],_0x37ec94['query']);_0x5d39fc[_0xef6d('0x36')]=_[_0xef6d('0x35')](_0x37ec94[_0xef6d('0x31')],qs[_0xef6d('0x37')](_0x4f6e0a[_0xef6d('0x32')][_0xef6d('0x37')]));_0x5d39fc[_0xef6d('0x36')]=_0x5d39fc[_0xef6d('0x36')]['length']?_0x5d39fc[_0xef6d('0x36')]:_0x37ec94[_0xef6d('0x31')];_0x5d39fc[_0xef6d('0x3b')]=qs['sort'](_0x4f6e0a['query'][_0xef6d('0x3c')]);_0x5d39fc['where']=qs[_0xef6d('0x34')](_[_0xef6d('0x3e')](_0x4f6e0a[_0xef6d('0x32')],_0x37ec94[_0xef6d('0x34')]));if(_0x4f6e0a[_0xef6d('0x32')][_0xef6d('0x3f')]){_0x5d39fc[_0xef6d('0x3d')]=_['merge'](_0x5d39fc[_0xef6d('0x3d')],{'$or':_[_0xef6d('0x2c')](_0x5d39fc[_0xef6d('0x36')],function(_0x555344){var _0x46dbb7={};_0x46dbb7[_0x555344]={'$like':'%'+_0x4f6e0a[_0xef6d('0x32')][_0xef6d('0x3f')]+'%'};return _0x46dbb7;})});}_0x5d39fc=_[_0xef6d('0x40')]({},_0x5d39fc,_0x4f6e0a[_0xef6d('0x41')]);return _0x412405[_0xef6d('0x4e')](_0x5d39fc);}})['then'](function(_0x319739){if(_0x319739){_0x4984c1=_0x319739[_0xef6d('0x38')];if(!_0x4f6e0a['query'][_0xef6d('0x39')](_0xef6d('0x3a'))){_0x5d39fc[_0xef6d('0x1d')]=qs[_0xef6d('0x1d')](_0x4f6e0a[_0xef6d('0x32')][_0xef6d('0x1d')]);_0x5d39fc[_0xef6d('0x20')]=qs[_0xef6d('0x20')](_0x4f6e0a[_0xef6d('0x32')][_0xef6d('0x20')]);}return _0x412405[_0xef6d('0x4e')](_0x5d39fc);}})[_0xef6d('0x26')](function(_0x1751e3){if(_0x1751e3){return _0x1751e3?{'count':_0x4984c1,'rows':_0x1751e3}:null;}})['then'](respondWithResult(_0x992734,null))['catch'](handleError(_0x992734,null));};exports[_0xef6d('0x4f')]=function(_0x16353b,_0x3175ce,_0xe72568){var _0x22770e={};var _0x37af42={};var _0x43b34f;var _0x2b33f1;return db[_0xef6d('0x2d')][_0xef6d('0x4c')]({'where':{'id':_0x16353b[_0xef6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3175ce,null))['then'](function(_0x26388e){if(_0x26388e){_0x43b34f=_0x26388e;_0x37af42[_0xef6d('0x31')]=_[_0xef6d('0x33')](db[_0xef6d('0x4d')][_0xef6d('0x47')]);_0x37af42['query']=_['keys'](_0x16353b[_0xef6d('0x32')]);_0x37af42[_0xef6d('0x34')]=_[_0xef6d('0x35')](_0x37af42[_0xef6d('0x31')],_0x37af42[_0xef6d('0x32')]);_0x22770e['attributes']=_['intersection'](_0x37af42[_0xef6d('0x31')],qs[_0xef6d('0x37')](_0x16353b[_0xef6d('0x32')]['fields']));_0x22770e[_0xef6d('0x36')]=_0x22770e[_0xef6d('0x36')][_0xef6d('0x38')]?_0x22770e[_0xef6d('0x36')]:_0x37af42[_0xef6d('0x31')];_0x22770e[_0xef6d('0x3b')]=qs[_0xef6d('0x3c')](_0x16353b[_0xef6d('0x32')][_0xef6d('0x3c')]);_0x22770e[_0xef6d('0x3d')]=qs[_0xef6d('0x34')](_[_0xef6d('0x3e')](_0x16353b['query'],_0x37af42[_0xef6d('0x34')]));if(_0x16353b[_0xef6d('0x32')][_0xef6d('0x3f')]){_0x22770e['where']=_[_0xef6d('0x40')](_0x22770e['where'],{'$or':_[_0xef6d('0x2c')](_0x22770e[_0xef6d('0x36')],function(_0x3c1649){var _0x3f0c6c={};_0x3f0c6c[_0x3c1649]={'$like':'%'+_0x16353b[_0xef6d('0x32')][_0xef6d('0x3f')]+'%'};return _0x3f0c6c;})});}_0x22770e=_[_0xef6d('0x40')]({},_0x22770e,_0x16353b[_0xef6d('0x41')]);return _0x43b34f['getSubjects'](_0x22770e);}})[_0xef6d('0x26')](function(_0xf27386){if(_0xf27386){_0x2b33f1=_0xf27386[_0xef6d('0x38')];if(!_0x16353b[_0xef6d('0x32')][_0xef6d('0x39')](_0xef6d('0x3a'))){_0x22770e['limit']=qs[_0xef6d('0x1d')](_0x16353b[_0xef6d('0x32')][_0xef6d('0x1d')]);_0x22770e[_0xef6d('0x20')]=qs[_0xef6d('0x20')](_0x16353b[_0xef6d('0x32')][_0xef6d('0x20')]);}return _0x43b34f[_0xef6d('0x4f')](_0x22770e);}})[_0xef6d('0x26')](function(_0x97a041){if(_0x97a041){return _0x97a041?{'count':_0x2b33f1,'rows':_0x97a041}:null;}})[_0xef6d('0x26')](respondWithResult(_0x3175ce,null))[_0xef6d('0x49')](handleError(_0x3175ce,null));};exports[_0xef6d('0x50')]=function(_0x227433,_0x2fa704,_0x424d1d){var _0x41c45d={};var _0x3d6c26={};var _0x48929f;var _0x2e104e;return db['ServicenowConfiguration'][_0xef6d('0x4c')]({'where':{'id':_0x227433[_0xef6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fa704,null))[_0xef6d('0x26')](function(_0x15d0af){if(_0x15d0af){_0x48929f=_0x15d0af;_0x3d6c26[_0xef6d('0x31')]=_[_0xef6d('0x33')](db[_0xef6d('0x4d')]['rawAttributes']);_0x3d6c26[_0xef6d('0x32')]=_[_0xef6d('0x33')](_0x227433[_0xef6d('0x32')]);_0x3d6c26[_0xef6d('0x34')]=_['intersection'](_0x3d6c26['model'],_0x3d6c26[_0xef6d('0x32')]);_0x41c45d['attributes']=_[_0xef6d('0x35')](_0x3d6c26['model'],qs[_0xef6d('0x37')](_0x227433[_0xef6d('0x32')]['fields']));_0x41c45d[_0xef6d('0x36')]=_0x41c45d[_0xef6d('0x36')][_0xef6d('0x38')]?_0x41c45d['attributes']:_0x3d6c26[_0xef6d('0x31')];_0x41c45d[_0xef6d('0x3b')]=qs[_0xef6d('0x3c')](_0x227433[_0xef6d('0x32')][_0xef6d('0x3c')]);_0x41c45d[_0xef6d('0x3d')]=qs[_0xef6d('0x34')](_[_0xef6d('0x3e')](_0x227433['query'],_0x3d6c26[_0xef6d('0x34')]));if(_0x227433[_0xef6d('0x32')][_0xef6d('0x3f')]){_0x41c45d[_0xef6d('0x3d')]=_[_0xef6d('0x40')](_0x41c45d['where'],{'$or':_['map'](_0x41c45d[_0xef6d('0x36')],function(_0x46d27d){var _0x4aab04={};_0x4aab04[_0x46d27d]={'$like':'%'+_0x227433[_0xef6d('0x32')][_0xef6d('0x3f')]+'%'};return _0x4aab04;})});}_0x41c45d=_[_0xef6d('0x40')]({},_0x41c45d,_0x227433['options']);return _0x48929f[_0xef6d('0x50')](_0x41c45d);}})[_0xef6d('0x26')](function(_0x49a720){if(_0x49a720){_0x2e104e=_0x49a720[_0xef6d('0x38')];if(!_0x227433[_0xef6d('0x32')]['hasOwnProperty']('nolimit')){_0x41c45d[_0xef6d('0x1d')]=qs[_0xef6d('0x1d')](_0x227433[_0xef6d('0x32')][_0xef6d('0x1d')]);_0x41c45d[_0xef6d('0x20')]=qs[_0xef6d('0x20')](_0x227433[_0xef6d('0x32')]['offset']);}return _0x48929f[_0xef6d('0x50')](_0x41c45d);}})[_0xef6d('0x26')](function(_0x4c495d){if(_0x4c495d){return _0x4c495d?{'count':_0x2e104e,'rows':_0x4c495d}:null;}})[_0xef6d('0x26')](respondWithResult(_0x2fa704,null))[_0xef6d('0x49')](handleError(_0x2fa704,null));}; \ No newline at end of file +var _0xded5=['create','body','destroy','getFields','findOne','order','hasOwnProperty','getSubjects','getDescriptions','ServicenowField','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','sendStatus','name','send','index','map','ServicenowConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xded5,0x190));var _0x5ded=function(_0x4252bf,_0xc977d7){_0x4252bf=_0x4252bf-0x0;var _0x32a218=_0xded5[_0x4252bf];return _0x32a218;};'use strict';var emlformat=require(_0x5ded('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ded('0x1'));var rp=require(_0x5ded('0x2'));var moment=require(_0x5ded('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ded('0x4'));var util=require('util');var path=require(_0x5ded('0x5'));var sox=require(_0x5ded('0x6'));var csv=require(_0x5ded('0x7'));var ejs=require(_0x5ded('0x8'));var fs=require('fs');var fs_extra=require(_0x5ded('0x9'));var _=require(_0x5ded('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ded('0xb'));var deskjs=require(_0x5ded('0xc'));var toCsv=require(_0x5ded('0x7'));var querystring=require(_0x5ded('0xd'));var Papa=require(_0x5ded('0xe'));var Redis=require(_0x5ded('0xf'));var authService=require(_0x5ded('0x10'));var qs=require(_0x5ded('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ded('0x12'))(_0x5ded('0x13'));var utils=require(_0x5ded('0x14'));var config=require(_0x5ded('0x15'));var licenseUtil=require(_0x5ded('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa8e2d,_0x5c88f1){_0x5c88f1=_0x5c88f1||0xcc;return function(_0x58da87){if(_0x58da87){return _0xa8e2d['sendStatus'](_0x5c88f1);}return _0xa8e2d['status'](_0x5c88f1)[_0x5ded('0x17')]();};}function respondWithResult(_0x100fb6,_0x353a1f){_0x353a1f=_0x353a1f||0xc8;return function(_0x5973cc){if(_0x5973cc){return _0x100fb6[_0x5ded('0x18')](_0x353a1f)[_0x5ded('0x19')](_0x5973cc);}};}function respondWithFilteredResult(_0x407e0f,_0x41d580){return function(_0x547dbe){if(_0x547dbe){var _0x574483=typeof _0x41d580[_0x5ded('0x1a')]==='undefined'&&typeof _0x41d580[_0x5ded('0x1b')]===_0x5ded('0x1c');var _0x5d1614=_0x547dbe[_0x5ded('0x1d')];var _0xf48351=_0x574483?0x0:_0x41d580[_0x5ded('0x1a')];var _0x3b88f5=_0x574483?_0x547dbe[_0x5ded('0x1d')]:_0x41d580['offset']+_0x41d580[_0x5ded('0x1b')];var _0x451449;if(_0x3b88f5>=_0x5d1614){_0x3b88f5=_0x5d1614;_0x451449=0xc8;}else{_0x451449=0xce;}_0x407e0f['status'](_0x451449);return _0x407e0f['set'](_0x5ded('0x1e'),_0xf48351+'-'+_0x3b88f5+'/'+_0x5d1614)[_0x5ded('0x19')](_0x547dbe);}return null;};}function patchUpdates(_0x21fe8b){return function(_0x44292b){try{jsonpatch['apply'](_0x44292b,_0x21fe8b,!![]);}catch(_0x4a18b3){return BPromise[_0x5ded('0x1f')](_0x4a18b3);}return _0x44292b[_0x5ded('0x20')]();};}function saveUpdates(_0x1b726c,_0x3f6587){return function(_0x1f46ec){if(_0x1f46ec){return _0x1f46ec[_0x5ded('0x21')](_0x1b726c)[_0x5ded('0x22')](function(_0x143801){return _0x143801;});}return null;};}function removeEntity(_0x397c5b,_0x375cdd){return function(_0xdd41cd){if(_0xdd41cd){return _0xdd41cd['destroy']()['then'](function(){_0x397c5b[_0x5ded('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224572,_0x56b1d2){return function(_0x2c33b1){if(!_0x2c33b1){_0x224572[_0x5ded('0x23')](0x194);}return _0x2c33b1;};}function handleError(_0x2abdde,_0x52d57b){_0x52d57b=_0x52d57b||0x1f4;return function(_0x25ade5){logger['error'](_0x25ade5['stack']);if(_0x25ade5[_0x5ded('0x24')]){delete _0x25ade5['name'];}_0x2abdde['status'](_0x52d57b)[_0x5ded('0x25')](_0x25ade5);};}exports[_0x5ded('0x26')]=function(_0x100695,_0x581d8d){var _0x86177e={},_0x2002ba={},_0x252618={'count':0x0,'rows':[]};var _0x56ea83=_[_0x5ded('0x27')](db[_0x5ded('0x28')]['rawAttributes'],function(_0x38f813){return{'name':_0x38f813[_0x5ded('0x29')],'type':_0x38f813[_0x5ded('0x2a')]['key']};});_0x2002ba[_0x5ded('0x2b')]=_['map'](_0x56ea83,'name');_0x2002ba[_0x5ded('0x2c')]=_[_0x5ded('0x2d')](_0x100695[_0x5ded('0x2c')]);_0x2002ba[_0x5ded('0x2e')]=_[_0x5ded('0x2f')](_0x2002ba[_0x5ded('0x2b')],_0x2002ba[_0x5ded('0x2c')]);_0x86177e[_0x5ded('0x30')]=_['intersection'](_0x2002ba[_0x5ded('0x2b')],qs[_0x5ded('0x31')](_0x100695[_0x5ded('0x2c')]['fields']));_0x86177e['attributes']=_0x86177e[_0x5ded('0x30')][_0x5ded('0x32')]?_0x86177e['attributes']:_0x2002ba[_0x5ded('0x2b')];if(!_0x100695[_0x5ded('0x2c')]['hasOwnProperty'](_0x5ded('0x33'))){_0x86177e[_0x5ded('0x1b')]=qs[_0x5ded('0x1b')](_0x100695['query'][_0x5ded('0x1b')]);_0x86177e['offset']=qs[_0x5ded('0x1a')](_0x100695['query'][_0x5ded('0x1a')]);}_0x86177e['order']=qs['sort'](_0x100695[_0x5ded('0x2c')][_0x5ded('0x34')]);_0x86177e[_0x5ded('0x35')]=qs['filters'](_[_0x5ded('0x36')](_0x100695[_0x5ded('0x2c')],_0x2002ba['filters']),_0x56ea83);if(_0x100695['query'][_0x5ded('0x37')]){_0x86177e[_0x5ded('0x35')]=_[_0x5ded('0x38')](_0x86177e[_0x5ded('0x35')],{'$or':_[_0x5ded('0x27')](_0x56ea83,function(_0x3c5903){if(_0x3c5903['type']!==_0x5ded('0x39')){var _0x21f7bf={};_0x21f7bf[_0x3c5903[_0x5ded('0x24')]]={'$like':'%'+_0x100695['query']['filter']+'%'};return _0x21f7bf;}})});}_0x86177e=_[_0x5ded('0x38')]({},_0x86177e,_0x100695[_0x5ded('0x3a')]);var _0x27a179={'where':_0x86177e[_0x5ded('0x35')]};return db[_0x5ded('0x28')]['count'](_0x27a179)[_0x5ded('0x22')](function(_0x4b6c71){_0x252618[_0x5ded('0x1d')]=_0x4b6c71;if(_0x100695[_0x5ded('0x2c')][_0x5ded('0x3b')]){_0x86177e[_0x5ded('0x3c')]=[{'all':!![]}];}return db[_0x5ded('0x28')][_0x5ded('0x3d')](_0x86177e);})[_0x5ded('0x22')](function(_0x483d79){_0x252618[_0x5ded('0x3e')]=_0x483d79;return _0x252618;})['then'](respondWithFilteredResult(_0x581d8d,_0x86177e))[_0x5ded('0x3f')](handleError(_0x581d8d,null));};exports[_0x5ded('0x40')]=function(_0x2e9853,_0x257fcc){var _0x1eb5ba={'raw':![],'where':{'id':_0x2e9853[_0x5ded('0x41')]['id']}},_0xc46db6={};_0xc46db6[_0x5ded('0x2b')]=_[_0x5ded('0x2d')](db['ServicenowConfiguration'][_0x5ded('0x42')]);_0xc46db6[_0x5ded('0x2c')]=_['keys'](_0x2e9853[_0x5ded('0x2c')]);_0xc46db6[_0x5ded('0x2e')]=_[_0x5ded('0x2f')](_0xc46db6['model'],_0xc46db6[_0x5ded('0x2c')]);_0x1eb5ba[_0x5ded('0x30')]=_['intersection'](_0xc46db6[_0x5ded('0x2b')],qs['fields'](_0x2e9853[_0x5ded('0x2c')][_0x5ded('0x31')]));_0x1eb5ba[_0x5ded('0x30')]=_0x1eb5ba[_0x5ded('0x30')][_0x5ded('0x32')]?_0x1eb5ba['attributes']:_0xc46db6[_0x5ded('0x2b')];if(_0x2e9853[_0x5ded('0x2c')]['includeAll']){_0x1eb5ba[_0x5ded('0x3c')]=[{'all':!![]}];}_0x1eb5ba=_[_0x5ded('0x38')]({},_0x1eb5ba,_0x2e9853[_0x5ded('0x3a')]);return db[_0x5ded('0x28')][_0x5ded('0x43')](_0x1eb5ba)[_0x5ded('0x22')](handleEntityNotFound(_0x257fcc,null))[_0x5ded('0x22')](respondWithResult(_0x257fcc,null))[_0x5ded('0x3f')](handleError(_0x257fcc,null));};exports[_0x5ded('0x44')]=function(_0x3e041c,_0x5ce3e2){return db[_0x5ded('0x28')]['create'](_0x3e041c[_0x5ded('0x45')],{})[_0x5ded('0x22')](respondWithResult(_0x5ce3e2,0xc9))[_0x5ded('0x3f')](handleError(_0x5ce3e2,null));};exports['update']=function(_0x6a801,_0x363993){if(_0x6a801[_0x5ded('0x45')]['id']){delete _0x6a801[_0x5ded('0x45')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x6a801[_0x5ded('0x41')]['id']}})[_0x5ded('0x22')](handleEntityNotFound(_0x363993,null))[_0x5ded('0x22')](saveUpdates(_0x6a801[_0x5ded('0x45')],null))[_0x5ded('0x22')](respondWithResult(_0x363993,null))[_0x5ded('0x3f')](handleError(_0x363993,null));};exports[_0x5ded('0x46')]=function(_0xec64ee,_0x2cd83f){return db['ServicenowConfiguration']['find']({'where':{'id':_0xec64ee[_0x5ded('0x41')]['id']}})[_0x5ded('0x22')](handleEntityNotFound(_0x2cd83f,null))[_0x5ded('0x22')](removeEntity(_0x2cd83f,null))[_0x5ded('0x3f')](handleError(_0x2cd83f,null));};exports[_0x5ded('0x47')]=function(_0x5a4f83,_0x324d57,_0x254607){var _0xfe4cfe={};var _0x12bf69={};var _0x42d816;var _0x29c924;return db[_0x5ded('0x28')][_0x5ded('0x48')]({'where':{'id':_0x5a4f83[_0x5ded('0x41')]['id']}})['then'](handleEntityNotFound(_0x324d57,null))['then'](function(_0x40aa16){if(_0x40aa16){_0x42d816=_0x40aa16;_0x12bf69[_0x5ded('0x2b')]=_[_0x5ded('0x2d')](db['ServicenowField'][_0x5ded('0x42')]);_0x12bf69[_0x5ded('0x2c')]=_[_0x5ded('0x2d')](_0x5a4f83[_0x5ded('0x2c')]);_0x12bf69[_0x5ded('0x2e')]=_[_0x5ded('0x2f')](_0x12bf69[_0x5ded('0x2b')],_0x12bf69['query']);_0xfe4cfe['attributes']=_[_0x5ded('0x2f')](_0x12bf69['model'],qs[_0x5ded('0x31')](_0x5a4f83[_0x5ded('0x2c')][_0x5ded('0x31')]));_0xfe4cfe['attributes']=_0xfe4cfe[_0x5ded('0x30')][_0x5ded('0x32')]?_0xfe4cfe[_0x5ded('0x30')]:_0x12bf69[_0x5ded('0x2b')];_0xfe4cfe[_0x5ded('0x49')]=qs[_0x5ded('0x34')](_0x5a4f83['query']['sort']);_0xfe4cfe['where']=qs[_0x5ded('0x2e')](_[_0x5ded('0x36')](_0x5a4f83['query'],_0x12bf69['filters']));if(_0x5a4f83[_0x5ded('0x2c')][_0x5ded('0x37')]){_0xfe4cfe['where']=_[_0x5ded('0x38')](_0xfe4cfe[_0x5ded('0x35')],{'$or':_[_0x5ded('0x27')](_0xfe4cfe[_0x5ded('0x30')],function(_0x1e5335){var _0x49dbae={};_0x49dbae[_0x1e5335]={'$like':'%'+_0x5a4f83[_0x5ded('0x2c')][_0x5ded('0x37')]+'%'};return _0x49dbae;})});}_0xfe4cfe=_['merge']({},_0xfe4cfe,_0x5a4f83[_0x5ded('0x3a')]);return _0x42d816[_0x5ded('0x47')](_0xfe4cfe);}})['then'](function(_0x1b539f){if(_0x1b539f){_0x29c924=_0x1b539f[_0x5ded('0x32')];if(!_0x5a4f83[_0x5ded('0x2c')][_0x5ded('0x4a')](_0x5ded('0x33'))){_0xfe4cfe['limit']=qs['limit'](_0x5a4f83['query'][_0x5ded('0x1b')]);_0xfe4cfe['offset']=qs[_0x5ded('0x1a')](_0x5a4f83[_0x5ded('0x2c')][_0x5ded('0x1a')]);}return _0x42d816[_0x5ded('0x47')](_0xfe4cfe);}})['then'](function(_0x28e274){if(_0x28e274){return _0x28e274?{'count':_0x29c924,'rows':_0x28e274}:null;}})[_0x5ded('0x22')](respondWithResult(_0x324d57,null))[_0x5ded('0x3f')](handleError(_0x324d57,null));};exports['getSubjects']=function(_0x95ce1e,_0x3483fa,_0x2d989c){var _0xa9f8a4={};var _0x5defcd={};var _0x225e26;var _0x46c38d;return db[_0x5ded('0x28')][_0x5ded('0x48')]({'where':{'id':_0x95ce1e[_0x5ded('0x41')]['id']}})[_0x5ded('0x22')](handleEntityNotFound(_0x3483fa,null))[_0x5ded('0x22')](function(_0x583955){if(_0x583955){_0x225e26=_0x583955;_0x5defcd[_0x5ded('0x2b')]=_[_0x5ded('0x2d')](db['ServicenowField'][_0x5ded('0x42')]);_0x5defcd[_0x5ded('0x2c')]=_[_0x5ded('0x2d')](_0x95ce1e[_0x5ded('0x2c')]);_0x5defcd[_0x5ded('0x2e')]=_[_0x5ded('0x2f')](_0x5defcd[_0x5ded('0x2b')],_0x5defcd[_0x5ded('0x2c')]);_0xa9f8a4['attributes']=_[_0x5ded('0x2f')](_0x5defcd[_0x5ded('0x2b')],qs[_0x5ded('0x31')](_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x31')]));_0xa9f8a4[_0x5ded('0x30')]=_0xa9f8a4[_0x5ded('0x30')][_0x5ded('0x32')]?_0xa9f8a4['attributes']:_0x5defcd[_0x5ded('0x2b')];_0xa9f8a4['order']=qs[_0x5ded('0x34')](_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x34')]);_0xa9f8a4[_0x5ded('0x35')]=qs[_0x5ded('0x2e')](_[_0x5ded('0x36')](_0x95ce1e[_0x5ded('0x2c')],_0x5defcd[_0x5ded('0x2e')]));if(_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x37')]){_0xa9f8a4[_0x5ded('0x35')]=_['merge'](_0xa9f8a4[_0x5ded('0x35')],{'$or':_[_0x5ded('0x27')](_0xa9f8a4[_0x5ded('0x30')],function(_0x2180cc){var _0x250801={};_0x250801[_0x2180cc]={'$like':'%'+_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x37')]+'%'};return _0x250801;})});}_0xa9f8a4=_[_0x5ded('0x38')]({},_0xa9f8a4,_0x95ce1e['options']);return _0x225e26[_0x5ded('0x4b')](_0xa9f8a4);}})[_0x5ded('0x22')](function(_0x46860b){if(_0x46860b){_0x46c38d=_0x46860b[_0x5ded('0x32')];if(!_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x4a')](_0x5ded('0x33'))){_0xa9f8a4[_0x5ded('0x1b')]=qs['limit'](_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x1b')]);_0xa9f8a4[_0x5ded('0x1a')]=qs[_0x5ded('0x1a')](_0x95ce1e[_0x5ded('0x2c')][_0x5ded('0x1a')]);}return _0x225e26['getSubjects'](_0xa9f8a4);}})[_0x5ded('0x22')](function(_0x2af204){if(_0x2af204){return _0x2af204?{'count':_0x46c38d,'rows':_0x2af204}:null;}})['then'](respondWithResult(_0x3483fa,null))['catch'](handleError(_0x3483fa,null));};exports[_0x5ded('0x4c')]=function(_0x45b682,_0x27e763,_0x5d24fe){var _0x25635a={};var _0x521553={};var _0xc948c3;var _0x5b1671;return db[_0x5ded('0x28')][_0x5ded('0x48')]({'where':{'id':_0x45b682['params']['id']}})[_0x5ded('0x22')](handleEntityNotFound(_0x27e763,null))[_0x5ded('0x22')](function(_0x1ba922){if(_0x1ba922){_0xc948c3=_0x1ba922;_0x521553[_0x5ded('0x2b')]=_[_0x5ded('0x2d')](db[_0x5ded('0x4d')][_0x5ded('0x42')]);_0x521553[_0x5ded('0x2c')]=_[_0x5ded('0x2d')](_0x45b682[_0x5ded('0x2c')]);_0x521553['filters']=_[_0x5ded('0x2f')](_0x521553[_0x5ded('0x2b')],_0x521553[_0x5ded('0x2c')]);_0x25635a['attributes']=_[_0x5ded('0x2f')](_0x521553[_0x5ded('0x2b')],qs[_0x5ded('0x31')](_0x45b682['query'][_0x5ded('0x31')]));_0x25635a[_0x5ded('0x30')]=_0x25635a['attributes'][_0x5ded('0x32')]?_0x25635a[_0x5ded('0x30')]:_0x521553[_0x5ded('0x2b')];_0x25635a[_0x5ded('0x49')]=qs['sort'](_0x45b682['query']['sort']);_0x25635a[_0x5ded('0x35')]=qs[_0x5ded('0x2e')](_[_0x5ded('0x36')](_0x45b682[_0x5ded('0x2c')],_0x521553[_0x5ded('0x2e')]));if(_0x45b682[_0x5ded('0x2c')][_0x5ded('0x37')]){_0x25635a['where']=_['merge'](_0x25635a['where'],{'$or':_['map'](_0x25635a[_0x5ded('0x30')],function(_0x4ec01a){var _0x41e83f={};_0x41e83f[_0x4ec01a]={'$like':'%'+_0x45b682[_0x5ded('0x2c')][_0x5ded('0x37')]+'%'};return _0x41e83f;})});}_0x25635a=_['merge']({},_0x25635a,_0x45b682[_0x5ded('0x3a')]);return _0xc948c3[_0x5ded('0x4c')](_0x25635a);}})[_0x5ded('0x22')](function(_0x4515cc){if(_0x4515cc){_0x5b1671=_0x4515cc[_0x5ded('0x32')];if(!_0x45b682[_0x5ded('0x2c')][_0x5ded('0x4a')](_0x5ded('0x33'))){_0x25635a['limit']=qs[_0x5ded('0x1b')](_0x45b682[_0x5ded('0x2c')]['limit']);_0x25635a[_0x5ded('0x1a')]=qs[_0x5ded('0x1a')](_0x45b682[_0x5ded('0x2c')][_0x5ded('0x1a')]);}return _0xc948c3['getDescriptions'](_0x25635a);}})[_0x5ded('0x22')](function(_0x58a189){if(_0x58a189){return _0x58a189?{'count':_0x5b1671,'rows':_0x58a189}:null;}})[_0x5ded('0x22')](respondWithResult(_0x27e763,null))[_0x5ded('0x3f')](handleError(_0x27e763,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 452b5d4..139c697 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 _0xf4c9=['rimraf','./intServicenowConfiguration.attributes','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3c0ee1,_0x3702ce){var _0x35d80f=function(_0x5cec83){while(--_0x5cec83){_0x3c0ee1['push'](_0x3c0ee1['shift']());}};_0x35d80f(++_0x3702ce);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf4c9[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var logger=require(_0x9f4c('0x2'))('api');var moment=require(_0x9f4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f4c('0x4'));var fs=require('fs');var path=require(_0x9f4c('0x5'));var rimraf=require(_0x9f4c('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f4c('0x7'));module['exports']=function(_0x42cd40,_0x48dc53){return _0x42cd40['define']('ServicenowConfiguration',attributes,{'tableName':_0x9f4c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb299=['request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0xb299,0x19b));var _0x9b29=function(_0x1add43,_0x29621b){_0x1add43=_0x1add43-0x0;var _0x1dd028=_0xb299[_0x1add43];return _0x1dd028;};'use strict';var _=require(_0x9b29('0x0'));var util=require('util');var logger=require(_0x9b29('0x1'))(_0x9b29('0x2'));var moment=require(_0x9b29('0x3'));var BPromise=require(_0x9b29('0x4'));var rp=require(_0x9b29('0x5'));var fs=require('fs');var path=require(_0x9b29('0x6'));var rimraf=require(_0x9b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b29('0x8'));module[_0x9b29('0x9')]=function(_0x4da7ce,_0x321436){return _0x4da7ce[_0x9b29('0xa')](_0x9b29('0xb'),attributes,{'tableName':_0x9b29('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 4f5c59a..0e1325b 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 _0xa9e5=['client','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4280dd,_0x20749e){var _0xbd785c=function(_0x3795e1){while(--_0x3795e1){_0x4280dd['push'](_0x4280dd['shift']());}};_0xbd785c(++_0x20749e);}(_0xa9e5,0xfc));var _0x5a9e=function(_0x3cf80a,_0x3ac05a){_0x3cf80a=_0x3cf80a-0x0;var _0x3dc131=_0xa9e5[_0x3cf80a];return _0x3dc131;};'use strict';var _=require('lodash');var util=require(_0x5a9e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a9e('0x1'));var fs=require('fs');var Redis=require(_0x5a9e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a9e('0x3'));var logger=require(_0x5a9e('0x4'))(_0x5a9e('0x5'));var config=require(_0x5a9e('0x6'));var jayson=require(_0x5a9e('0x7'));var client=jayson[_0x5a9e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x334e05,_0x2f5428,_0x2e2d97){return new BPromise(function(_0x3bbcbd,_0x5018f7){return client[_0x5a9e('0x9')](_0x334e05,_0x2e2d97)[_0x5a9e('0xa')](function(_0xf1139){logger[_0x5a9e('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f5428,'request\x20sent');logger[_0x5a9e('0xc')](_0x5a9e('0xd'),_0x2f5428,_0x5a9e('0xe'),JSON['stringify'](_0xf1139));if(_0xf1139['error']){if(_0xf1139['error'][_0x5a9e('0xf')]===0x1f4){logger[_0x5a9e('0x10')](_0x5a9e('0x11'),_0x2f5428,_0xf1139[_0x5a9e('0x10')][_0x5a9e('0x12')]);return _0x5018f7(_0xf1139[_0x5a9e('0x10')][_0x5a9e('0x12')]);}logger['error'](_0x5a9e('0x11'),_0x2f5428,_0xf1139[_0x5a9e('0x10')]['message']);return _0x3bbcbd(_0xf1139['error'][_0x5a9e('0x12')]);}else{logger[_0x5a9e('0xb')](_0x5a9e('0x11'),_0x2f5428,_0x5a9e('0xe'));_0x3bbcbd(_0xf1139['result'][_0x5a9e('0x12')]);}})[_0x5a9e('0x13')](function(_0x120cfa){logger[_0x5a9e('0x10')](_0x5a9e('0x11'),_0x2f5428,_0x120cfa);_0x5018f7(_0x120cfa);});});} \ No newline at end of file +var _0x0095=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x54635c,_0x497563){var _0x6e0e2b=function(_0x4ec452){while(--_0x4ec452){_0x54635c['push'](_0x54635c['shift']());}};_0x6e0e2b(++_0x497563);}(_0x0095,0xaa));var _0x5009=function(_0x5a8c9d,_0x5e108e){_0x5a8c9d=_0x5a8c9d-0x0;var _0x47d44b=_0x0095[_0x5a8c9d];return _0x47d44b;};'use strict';var _=require('lodash');var util=require(_0x5009('0x0'));var moment=require(_0x5009('0x1'));var BPromise=require(_0x5009('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5009('0x3'));var db=require(_0x5009('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5009('0x5'))('rpc');var config=require(_0x5009('0x6'));var jayson=require(_0x5009('0x7'));var client=jayson[_0x5009('0x8')][_0x5009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38e96b,_0x2bc1bf,_0x203627){return new BPromise(function(_0xef3b3c,_0x1bef9e){return client['request'](_0x38e96b,_0x203627)[_0x5009('0xa')](function(_0x2f916f){logger[_0x5009('0xb')](_0x5009('0xc'),_0x2bc1bf,'request\x20sent');logger['debug'](_0x5009('0xd'),_0x2bc1bf,_0x5009('0xe'),JSON[_0x5009('0xf')](_0x2f916f));if(_0x2f916f[_0x5009('0x10')]){if(_0x2f916f['error'][_0x5009('0x11')]===0x1f4){logger[_0x5009('0x10')](_0x5009('0xc'),_0x2bc1bf,_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);return _0x1bef9e(_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);}logger['error'](_0x5009('0xc'),_0x2bc1bf,_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);return _0xef3b3c(_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);}else{logger[_0x5009('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2bc1bf,_0x5009('0xe'));_0xef3b3c(_0x2f916f[_0x5009('0x13')]['message']);}})[_0x5009('0x14')](function(_0x2a4729){logger['error'](_0x5009('0xc'),_0x2bc1bf,_0x2a4729);_0x1bef9e(_0x2a4729);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f6c682c..5d2b8c2 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 _0x33f1=['put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','create'];(function(_0x591366,_0x16d636){var _0x2a9146=function(_0x9ac84f){while(--_0x9ac84f){_0x591366['push'](_0x591366['shift']());}};_0x2a9146(++_0x16d636);}(_0x33f1,0x85));var _0x133f=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x33f1[_0x99ff94];return _0x1b5bc0;};'use strict';var multer=require(_0x133f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x133f('0x1'));var express=require(_0x133f('0x2'));var router=express['Router']();var fs_extra=require(_0x133f('0x3'));var auth=require(_0x133f('0x4'));var interaction=require(_0x133f('0x5'));var config=require(_0x133f('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x133f('0x7')]);router['get'](_0x133f('0x8'),auth[_0x133f('0x9')](),controller['show']);router['post']('/',auth[_0x133f('0x9')](),controller[_0x133f('0xa')]);router[_0x133f('0xb')]('/:id',auth[_0x133f('0x9')](),controller[_0x133f('0xc')]);router[_0x133f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x133f('0xe')]);module[_0x133f('0xf')]=router; \ No newline at end of file +var _0xf6d8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','get','isAuthenticated','post','create','put','/:id','update','delete','destroy'];(function(_0x588ae7,_0x5ed88e){var _0x1ea5d9=function(_0x39b4c3){while(--_0x39b4c3){_0x588ae7['push'](_0x588ae7['shift']());}};_0x1ea5d9(++_0x5ed88e);}(_0xf6d8,0x18d));var _0x8f6d=function(_0x5a137f,_0x532d37){_0x5a137f=_0x5a137f-0x0;var _0x51204c=_0xf6d8[_0x5a137f];return _0x51204c;};'use strict';var multer=require(_0x8f6d('0x0'));var util=require(_0x8f6d('0x1'));var path=require(_0x8f6d('0x2'));var timeout=require(_0x8f6d('0x3'));var express=require(_0x8f6d('0x4'));var router=express[_0x8f6d('0x5')]();var fs_extra=require(_0x8f6d('0x6'));var auth=require(_0x8f6d('0x7'));var interaction=require(_0x8f6d('0x8'));var config=require(_0x8f6d('0x9'));var controller=require(_0x8f6d('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x8f6d('0xb')]);router[_0x8f6d('0xc')]('/:id',auth[_0x8f6d('0xd')](),controller['show']);router[_0x8f6d('0xe')]('/',auth['isAuthenticated'](),controller[_0x8f6d('0xf')]);router[_0x8f6d('0x10')](_0x8f6d('0x11'),auth[_0x8f6d('0xd')](),controller[_0x8f6d('0x12')]);router[_0x8f6d('0x13')]('/:id',auth[_0x8f6d('0xd')](),controller[_0x8f6d('0x14')]);module[_0x8f6d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index a7e379f..9f9929d 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 _0x2904=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x3dc440,_0x21a7f2){var _0x141de0=function(_0xa26b2){while(--_0xa26b2){_0x3dc440['push'](_0x3dc440['shift']());}};_0x141de0(++_0x21a7f2);}(_0x2904,0xca));var _0x4290=function(_0x2b9df5,_0x3a2d86){_0x2b9df5=_0x2b9df5-0x0;var _0x8b77a8=_0x2904[_0x2b9df5];return _0x8b77a8;};'use strict';var Sequelize=require(_0x4290('0x0'));module[_0x4290('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4290('0x2'),_0x4290('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0x4290('0x2')},'content':{'type':Sequelize[_0x4290('0x4')]},'key':{'type':Sequelize[_0x4290('0x4')]},'keyType':{'type':Sequelize[_0x4290('0x5')](_0x4290('0x2'),_0x4290('0x3'),_0x4290('0x6'))},'keyContent':{'type':Sequelize[_0x4290('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4290('0x4')]},'customField':{'type':Sequelize[_0x4290('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4290('0x4')]}}; \ No newline at end of file +var _0x6a51=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x5e0e20,_0x1ff3e0){var _0x1d6f97=function(_0x3f4bab){while(--_0x3f4bab){_0x5e0e20['push'](_0x5e0e20['shift']());}};_0x1d6f97(++_0x1ff3e0);}(_0x6a51,0x8e));var _0x16a5=function(_0x3d2012,_0x3d02b9){_0x3d2012=_0x3d2012-0x0;var _0x53d542=_0x6a51[_0x3d2012];return _0x53d542;};'use strict';var Sequelize=require(_0x16a5('0x0'));module[_0x16a5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x16a5('0x2'),_0x16a5('0x3'),_0x16a5('0x4'),'keyValue',_0x16a5('0x5')),'defaultValue':_0x16a5('0x2')},'content':{'type':Sequelize[_0x16a5('0x6')]},'key':{'type':Sequelize[_0x16a5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x16a5('0x2'),_0x16a5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x16a5('0x6')]},'idField':{'type':Sequelize[_0x16a5('0x6')]},'nameField':{'type':Sequelize[_0x16a5('0x6')]},'customField':{'type':Sequelize[_0x16a5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index db701d7..5b89d96 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 _0xae52=['destroy','name','send','index','map','ServicenowField','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then'];(function(_0x182efc,_0x481dad){var _0x215115=function(_0x10919b){while(--_0x10919b){_0x182efc['push'](_0x182efc['shift']());}};_0x215115(++_0x481dad);}(_0xae52,0x18c));var _0x2ae5=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0xae52[_0x3df223];return _0x562d11;};'use strict';var emlformat=require(_0x2ae5('0x0'));var rimraf=require(_0x2ae5('0x1'));var zipdir=require(_0x2ae5('0x2'));var jsonpatch=require(_0x2ae5('0x3'));var rp=require('request-promise');var moment=require(_0x2ae5('0x4'));var BPromise=require(_0x2ae5('0x5'));var Mustache=require(_0x2ae5('0x6'));var util=require(_0x2ae5('0x7'));var path=require(_0x2ae5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2ae5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ae5('0xa'));var squel=require(_0x2ae5('0xb'));var crypto=require(_0x2ae5('0xc'));var jsforce=require(_0x2ae5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2ae5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ae5('0xf'));var qs=require(_0x2ae5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ae5('0x11'));var logger=require(_0x2ae5('0x12'))(_0x2ae5('0x13'));var utils=require(_0x2ae5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2ae5('0x15'));var db=require(_0x2ae5('0x16'))['db'];function respondWithStatusCode(_0x18498a,_0x539a8b){_0x539a8b=_0x539a8b||0xcc;return function(_0x41bacc){if(_0x41bacc){return _0x18498a[_0x2ae5('0x17')](_0x539a8b);}return _0x18498a['status'](_0x539a8b)[_0x2ae5('0x18')]();};}function respondWithResult(_0x4a5cc3,_0x53a5ce){_0x53a5ce=_0x53a5ce||0xc8;return function(_0x57ac12){if(_0x57ac12){return _0x4a5cc3[_0x2ae5('0x19')](_0x53a5ce)[_0x2ae5('0x1a')](_0x57ac12);}};}function respondWithFilteredResult(_0x34de98,_0x219aa3){return function(_0x5981c6){if(_0x5981c6){var _0xc8b4e1=typeof _0x219aa3[_0x2ae5('0x1b')]===_0x2ae5('0x1c')&&typeof _0x219aa3[_0x2ae5('0x1d')]===_0x2ae5('0x1c');var _0x2ded34=_0x5981c6['count'];var _0x89ab77=_0xc8b4e1?0x0:_0x219aa3[_0x2ae5('0x1b')];var _0x118cd9=_0xc8b4e1?_0x5981c6[_0x2ae5('0x1e')]:_0x219aa3[_0x2ae5('0x1b')]+_0x219aa3[_0x2ae5('0x1d')];var _0x598bb1;if(_0x118cd9>=_0x2ded34){_0x118cd9=_0x2ded34;_0x598bb1=0xc8;}else{_0x598bb1=0xce;}_0x34de98[_0x2ae5('0x19')](_0x598bb1);return _0x34de98[_0x2ae5('0x1f')](_0x2ae5('0x20'),_0x89ab77+'-'+_0x118cd9+'/'+_0x2ded34)[_0x2ae5('0x1a')](_0x5981c6);}return null;};}function patchUpdates(_0x53aa4b){return function(_0x2faf88){try{jsonpatch['apply'](_0x2faf88,_0x53aa4b,!![]);}catch(_0x4d8d31){return BPromise['reject'](_0x4d8d31);}return _0x2faf88[_0x2ae5('0x21')]();};}function saveUpdates(_0x25604e,_0x1ec57b){return function(_0x49b950){if(_0x49b950){return _0x49b950[_0x2ae5('0x22')](_0x25604e)[_0x2ae5('0x23')](function(_0x220b14){return _0x220b14;});}return null;};}function removeEntity(_0x4e05db,_0x4f7c29){return function(_0x51176b){if(_0x51176b){return _0x51176b[_0x2ae5('0x24')]()[_0x2ae5('0x23')](function(){_0x4e05db['status'](0xcc)[_0x2ae5('0x18')]();});}};}function handleEntityNotFound(_0x89ee84,_0x2f965b){return function(_0x2c5e56){if(!_0x2c5e56){_0x89ee84[_0x2ae5('0x17')](0x194);}return _0x2c5e56;};}function handleError(_0x46d62c,_0x3b15e7){_0x3b15e7=_0x3b15e7||0x1f4;return function(_0x40001b){logger['error'](_0x40001b['stack']);if(_0x40001b[_0x2ae5('0x25')]){delete _0x40001b['name'];}_0x46d62c['status'](_0x3b15e7)[_0x2ae5('0x26')](_0x40001b);};}exports[_0x2ae5('0x27')]=function(_0x5549e1,_0x7fcf47){var _0x507a80={},_0x2b4718={},_0x29383d={'count':0x0,'rows':[]};var _0x19350d=_[_0x2ae5('0x28')](db[_0x2ae5('0x29')]['rawAttributes'],function(_0x1286fe){return{'name':_0x1286fe['fieldName'],'type':_0x1286fe['type'][_0x2ae5('0x2a')]};});_0x2b4718[_0x2ae5('0x2b')]=_[_0x2ae5('0x28')](_0x19350d,_0x2ae5('0x25'));_0x2b4718[_0x2ae5('0x2c')]=_[_0x2ae5('0x2d')](_0x5549e1[_0x2ae5('0x2c')]);_0x2b4718[_0x2ae5('0x2e')]=_['intersection'](_0x2b4718[_0x2ae5('0x2b')],_0x2b4718['query']);_0x507a80['attributes']=_['intersection'](_0x2b4718[_0x2ae5('0x2b')],qs[_0x2ae5('0x2f')](_0x5549e1['query'][_0x2ae5('0x2f')]));_0x507a80['attributes']=_0x507a80[_0x2ae5('0x30')][_0x2ae5('0x31')]?_0x507a80[_0x2ae5('0x30')]:_0x2b4718[_0x2ae5('0x2b')];if(!_0x5549e1['query'][_0x2ae5('0x32')](_0x2ae5('0x33'))){_0x507a80['limit']=qs[_0x2ae5('0x1d')](_0x5549e1['query'][_0x2ae5('0x1d')]);_0x507a80['offset']=qs[_0x2ae5('0x1b')](_0x5549e1[_0x2ae5('0x2c')][_0x2ae5('0x1b')]);}_0x507a80['order']=qs['sort'](_0x5549e1['query'][_0x2ae5('0x34')]);_0x507a80[_0x2ae5('0x35')]=qs[_0x2ae5('0x2e')](_[_0x2ae5('0x36')](_0x5549e1[_0x2ae5('0x2c')],_0x2b4718[_0x2ae5('0x2e')]),_0x19350d);if(_0x5549e1['query'][_0x2ae5('0x37')]){_0x507a80[_0x2ae5('0x35')]=_['merge'](_0x507a80[_0x2ae5('0x35')],{'$or':_['map'](_0x19350d,function(_0x28b3bf){if(_0x28b3bf[_0x2ae5('0x38')]!==_0x2ae5('0x39')){var _0x23602c={};_0x23602c[_0x28b3bf['name']]={'$like':'%'+_0x5549e1[_0x2ae5('0x2c')]['filter']+'%'};return _0x23602c;}})});}_0x507a80=_[_0x2ae5('0x3a')]({},_0x507a80,_0x5549e1[_0x2ae5('0x3b')]);var _0x189b7f={'where':_0x507a80['where']};return db[_0x2ae5('0x29')][_0x2ae5('0x1e')](_0x189b7f)[_0x2ae5('0x23')](function(_0x2a6907){_0x29383d[_0x2ae5('0x1e')]=_0x2a6907;if(_0x5549e1['query'][_0x2ae5('0x3c')]){_0x507a80['include']=[{'all':!![]}];}return db['ServicenowField'][_0x2ae5('0x3d')](_0x507a80);})[_0x2ae5('0x23')](function(_0xa2d5f3){_0x29383d[_0x2ae5('0x3e')]=_0xa2d5f3;return _0x29383d;})[_0x2ae5('0x23')](respondWithFilteredResult(_0x7fcf47,_0x507a80))[_0x2ae5('0x3f')](handleError(_0x7fcf47,null));};exports[_0x2ae5('0x40')]=function(_0x17c8b6,_0x3af92a){var _0x4c02a4={'raw':!![],'where':{'id':_0x17c8b6[_0x2ae5('0x41')]['id']}},_0x5563dc={};_0x5563dc[_0x2ae5('0x2b')]=_[_0x2ae5('0x2d')](db[_0x2ae5('0x29')][_0x2ae5('0x42')]);_0x5563dc[_0x2ae5('0x2c')]=_['keys'](_0x17c8b6[_0x2ae5('0x2c')]);_0x5563dc['filters']=_['intersection'](_0x5563dc[_0x2ae5('0x2b')],_0x5563dc[_0x2ae5('0x2c')]);_0x4c02a4[_0x2ae5('0x30')]=_[_0x2ae5('0x43')](_0x5563dc[_0x2ae5('0x2b')],qs[_0x2ae5('0x2f')](_0x17c8b6[_0x2ae5('0x2c')]['fields']));_0x4c02a4[_0x2ae5('0x30')]=_0x4c02a4['attributes'][_0x2ae5('0x31')]?_0x4c02a4[_0x2ae5('0x30')]:_0x5563dc['model'];if(_0x17c8b6[_0x2ae5('0x2c')][_0x2ae5('0x3c')]){_0x4c02a4[_0x2ae5('0x44')]=[{'all':!![]}];}_0x4c02a4=_[_0x2ae5('0x3a')]({},_0x4c02a4,_0x17c8b6[_0x2ae5('0x3b')]);return db['ServicenowField'][_0x2ae5('0x45')](_0x4c02a4)[_0x2ae5('0x23')](handleEntityNotFound(_0x3af92a,null))[_0x2ae5('0x23')](respondWithResult(_0x3af92a,null))[_0x2ae5('0x3f')](handleError(_0x3af92a,null));};exports[_0x2ae5('0x46')]=function(_0x39465d,_0x220343){return db[_0x2ae5('0x29')]['create'](_0x39465d[_0x2ae5('0x47')],{})[_0x2ae5('0x23')](respondWithResult(_0x220343,0xc9))[_0x2ae5('0x3f')](handleError(_0x220343,null));};exports['update']=function(_0x55f03d,_0x2c7736){if(_0x55f03d[_0x2ae5('0x47')]['id']){delete _0x55f03d[_0x2ae5('0x47')]['id'];}return db[_0x2ae5('0x29')]['find']({'where':{'id':_0x55f03d['params']['id']}})[_0x2ae5('0x23')](handleEntityNotFound(_0x2c7736,null))[_0x2ae5('0x23')](saveUpdates(_0x55f03d['body'],null))[_0x2ae5('0x23')](respondWithResult(_0x2c7736,null))[_0x2ae5('0x3f')](handleError(_0x2c7736,null));};exports[_0x2ae5('0x24')]=function(_0x14b62d,_0x64817){return db['ServicenowField']['find']({'where':{'id':_0x14b62d[_0x2ae5('0x41')]['id']}})[_0x2ae5('0x23')](handleEntityNotFound(_0x64817,null))['then'](removeEntity(_0x64817,null))[_0x2ae5('0x3f')](handleError(_0x64817,null));}; \ No newline at end of file +var _0xe10c=['update','destroy','then','end','sendStatus','error','stack','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xe10c,0x1eb));var _0xce10=function(_0x597c41,_0x2da074){_0x597c41=_0x597c41-0x0;var _0x4f407b=_0xe10c[_0x597c41];return _0x4f407b;};'use strict';var emlformat=require(_0xce10('0x0'));var rimraf=require(_0xce10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce10('0x2'));var rp=require(_0xce10('0x3'));var moment=require('moment');var BPromise=require(_0xce10('0x4'));var Mustache=require(_0xce10('0x5'));var util=require('util');var path=require(_0xce10('0x6'));var sox=require(_0xce10('0x7'));var csv=require(_0xce10('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce10('0x9'));var _=require(_0xce10('0xa'));var squel=require(_0xce10('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce10('0xc'));var toCsv=require(_0xce10('0x8'));var querystring=require(_0xce10('0xd'));var Papa=require('papaparse');var Redis=require(_0xce10('0xe'));var authService=require(_0xce10('0xf'));var qs=require(_0xce10('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce10('0x11'));var logger=require(_0xce10('0x12'))(_0xce10('0x13'));var utils=require(_0xce10('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce10('0x15'));var db=require(_0xce10('0x16'))['db'];function respondWithStatusCode(_0x459254,_0x441abe){_0x441abe=_0x441abe||0xcc;return function(_0x5ecdb5){if(_0x5ecdb5){return _0x459254['sendStatus'](_0x441abe);}return _0x459254[_0xce10('0x17')](_0x441abe)['end']();};}function respondWithResult(_0x12f386,_0x10ae3d){_0x10ae3d=_0x10ae3d||0xc8;return function(_0x1de5c5){if(_0x1de5c5){return _0x12f386[_0xce10('0x17')](_0x10ae3d)[_0xce10('0x18')](_0x1de5c5);}};}function respondWithFilteredResult(_0x4a8b14,_0x23a482){return function(_0xa69567){if(_0xa69567){var _0x405849=typeof _0x23a482[_0xce10('0x19')]===_0xce10('0x1a')&&typeof _0x23a482[_0xce10('0x1b')]==='undefined';var _0x583c04=_0xa69567[_0xce10('0x1c')];var _0x33943b=_0x405849?0x0:_0x23a482[_0xce10('0x19')];var _0xc15545=_0x405849?_0xa69567[_0xce10('0x1c')]:_0x23a482[_0xce10('0x19')]+_0x23a482[_0xce10('0x1b')];var _0x2067c9;if(_0xc15545>=_0x583c04){_0xc15545=_0x583c04;_0x2067c9=0xc8;}else{_0x2067c9=0xce;}_0x4a8b14[_0xce10('0x17')](_0x2067c9);return _0x4a8b14[_0xce10('0x1d')](_0xce10('0x1e'),_0x33943b+'-'+_0xc15545+'/'+_0x583c04)['json'](_0xa69567);}return null;};}function patchUpdates(_0xb8c14e){return function(_0x2a9f70){try{jsonpatch[_0xce10('0x1f')](_0x2a9f70,_0xb8c14e,!![]);}catch(_0x1fe2e7){return BPromise[_0xce10('0x20')](_0x1fe2e7);}return _0x2a9f70[_0xce10('0x21')]();};}function saveUpdates(_0x3bf777,_0xb57e13){return function(_0x24a277){if(_0x24a277){return _0x24a277[_0xce10('0x22')](_0x3bf777)['then'](function(_0x18fbeb){return _0x18fbeb;});}return null;};}function removeEntity(_0x4b8b0b,_0x11b5bc){return function(_0x1523b9){if(_0x1523b9){return _0x1523b9[_0xce10('0x23')]()[_0xce10('0x24')](function(){_0x4b8b0b[_0xce10('0x17')](0xcc)[_0xce10('0x25')]();});}};}function handleEntityNotFound(_0x4ddee8,_0x51897c){return function(_0x1ba61c){if(!_0x1ba61c){_0x4ddee8[_0xce10('0x26')](0x194);}return _0x1ba61c;};}function handleError(_0x3c3a14,_0x592511){_0x592511=_0x592511||0x1f4;return function(_0x515a24){logger[_0xce10('0x27')](_0x515a24[_0xce10('0x28')]);if(_0x515a24['name']){delete _0x515a24['name'];}_0x3c3a14['status'](_0x592511)[_0xce10('0x29')](_0x515a24);};}exports[_0xce10('0x2a')]=function(_0x31fe5d,_0x396ef9){var _0x38ac18={},_0x7c54d8={},_0x1e140d={'count':0x0,'rows':[]};var _0x332453=_[_0xce10('0x2b')](db[_0xce10('0x2c')][_0xce10('0x2d')],function(_0x1f5ef2){return{'name':_0x1f5ef2[_0xce10('0x2e')],'type':_0x1f5ef2[_0xce10('0x2f')][_0xce10('0x30')]};});_0x7c54d8[_0xce10('0x31')]=_[_0xce10('0x2b')](_0x332453,_0xce10('0x32'));_0x7c54d8[_0xce10('0x33')]=_[_0xce10('0x34')](_0x31fe5d[_0xce10('0x33')]);_0x7c54d8[_0xce10('0x35')]=_[_0xce10('0x36')](_0x7c54d8[_0xce10('0x31')],_0x7c54d8['query']);_0x38ac18[_0xce10('0x37')]=_[_0xce10('0x36')](_0x7c54d8[_0xce10('0x31')],qs[_0xce10('0x38')](_0x31fe5d[_0xce10('0x33')][_0xce10('0x38')]));_0x38ac18['attributes']=_0x38ac18[_0xce10('0x37')][_0xce10('0x39')]?_0x38ac18[_0xce10('0x37')]:_0x7c54d8[_0xce10('0x31')];if(!_0x31fe5d[_0xce10('0x33')][_0xce10('0x3a')]('nolimit')){_0x38ac18[_0xce10('0x1b')]=qs['limit'](_0x31fe5d[_0xce10('0x33')][_0xce10('0x1b')]);_0x38ac18[_0xce10('0x19')]=qs[_0xce10('0x19')](_0x31fe5d[_0xce10('0x33')][_0xce10('0x19')]);}_0x38ac18[_0xce10('0x3b')]=qs[_0xce10('0x3c')](_0x31fe5d[_0xce10('0x33')][_0xce10('0x3c')]);_0x38ac18[_0xce10('0x3d')]=qs['filters'](_[_0xce10('0x3e')](_0x31fe5d[_0xce10('0x33')],_0x7c54d8[_0xce10('0x35')]),_0x332453);if(_0x31fe5d[_0xce10('0x33')][_0xce10('0x3f')]){_0x38ac18['where']=_[_0xce10('0x40')](_0x38ac18[_0xce10('0x3d')],{'$or':_[_0xce10('0x2b')](_0x332453,function(_0x2ef451){if(_0x2ef451[_0xce10('0x2f')]!==_0xce10('0x41')){var _0x590e66={};_0x590e66[_0x2ef451[_0xce10('0x32')]]={'$like':'%'+_0x31fe5d[_0xce10('0x33')][_0xce10('0x3f')]+'%'};return _0x590e66;}})});}_0x38ac18=_[_0xce10('0x40')]({},_0x38ac18,_0x31fe5d[_0xce10('0x42')]);var _0x40ebad={'where':_0x38ac18[_0xce10('0x3d')]};return db[_0xce10('0x2c')][_0xce10('0x1c')](_0x40ebad)['then'](function(_0x224b7d){_0x1e140d['count']=_0x224b7d;if(_0x31fe5d[_0xce10('0x33')][_0xce10('0x43')]){_0x38ac18[_0xce10('0x44')]=[{'all':!![]}];}return db['ServicenowField'][_0xce10('0x45')](_0x38ac18);})['then'](function(_0x295b61){_0x1e140d['rows']=_0x295b61;return _0x1e140d;})[_0xce10('0x24')](respondWithFilteredResult(_0x396ef9,_0x38ac18))['catch'](handleError(_0x396ef9,null));};exports[_0xce10('0x46')]=function(_0x34baa5,_0x3d90ea){var _0x22da39={'raw':!![],'where':{'id':_0x34baa5['params']['id']}},_0x3c7531={};_0x3c7531[_0xce10('0x31')]=_[_0xce10('0x34')](db[_0xce10('0x2c')][_0xce10('0x2d')]);_0x3c7531[_0xce10('0x33')]=_[_0xce10('0x34')](_0x34baa5['query']);_0x3c7531[_0xce10('0x35')]=_[_0xce10('0x36')](_0x3c7531[_0xce10('0x31')],_0x3c7531[_0xce10('0x33')]);_0x22da39[_0xce10('0x37')]=_[_0xce10('0x36')](_0x3c7531[_0xce10('0x31')],qs['fields'](_0x34baa5['query']['fields']));_0x22da39[_0xce10('0x37')]=_0x22da39[_0xce10('0x37')][_0xce10('0x39')]?_0x22da39[_0xce10('0x37')]:_0x3c7531[_0xce10('0x31')];if(_0x34baa5[_0xce10('0x33')][_0xce10('0x43')]){_0x22da39[_0xce10('0x44')]=[{'all':!![]}];}_0x22da39=_[_0xce10('0x40')]({},_0x22da39,_0x34baa5[_0xce10('0x42')]);return db[_0xce10('0x2c')][_0xce10('0x47')](_0x22da39)[_0xce10('0x24')](handleEntityNotFound(_0x3d90ea,null))[_0xce10('0x24')](respondWithResult(_0x3d90ea,null))[_0xce10('0x48')](handleError(_0x3d90ea,null));};exports['create']=function(_0x3d80cb,_0x51c3e8){return db[_0xce10('0x2c')]['create'](_0x3d80cb['body'],{})[_0xce10('0x24')](respondWithResult(_0x51c3e8,0xc9))[_0xce10('0x48')](handleError(_0x51c3e8,null));};exports['update']=function(_0x20bada,_0x29b19f){if(_0x20bada['body']['id']){delete _0x20bada[_0xce10('0x49')]['id'];}return db[_0xce10('0x2c')][_0xce10('0x47')]({'where':{'id':_0x20bada[_0xce10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29b19f,null))[_0xce10('0x24')](saveUpdates(_0x20bada[_0xce10('0x49')],null))[_0xce10('0x24')](respondWithResult(_0x29b19f,null))[_0xce10('0x48')](handleError(_0x29b19f,null));};exports[_0xce10('0x23')]=function(_0x2439fd,_0x35da5f){return db[_0xce10('0x2c')][_0xce10('0x47')]({'where':{'id':_0x2439fd[_0xce10('0x4a')]['id']}})[_0xce10('0x24')](handleEntityNotFound(_0x35da5f,null))[_0xce10('0x24')](removeEntity(_0x35da5f,null))[_0xce10('0x48')](handleError(_0x35da5f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8add1fa..53b6313 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 _0x2ab5=['../../config/environment','./intServicenowField.attributes','exports','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x2ab5,0x95));var _0x52ab=function(_0x1e2efe,_0x49137a){_0x1e2efe=_0x1e2efe-0x0;var _0x3a6bce=_0x2ab5[_0x1e2efe];return _0x3a6bce;};'use strict';var _=require(_0x52ab('0x0'));var util=require(_0x52ab('0x1'));var logger=require(_0x52ab('0x2'))('api');var moment=require(_0x52ab('0x3'));var BPromise=require(_0x52ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52ab('0x5'));var rimraf=require(_0x52ab('0x6'));var config=require(_0x52ab('0x7'));var attributes=require(_0x52ab('0x8'));module[_0x52ab('0x9')]=function(_0x4d2125,_0x474204){return _0x4d2125['define']('ServicenowField',attributes,{'tableName':_0x52ab('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x52ab('0xb'),_0x52ab('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7671=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_servicenow_fields','idField','FieldId','lodash','util'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x7671,0xec));var _0x1767=function(_0xab632,_0x100609){_0xab632=_0xab632-0x0;var _0x45aa86=_0x7671[_0xab632];return _0x45aa86;};'use strict';var _=require(_0x1767('0x0'));var util=require(_0x1767('0x1'));var logger=require(_0x1767('0x2'))(_0x1767('0x3'));var moment=require(_0x1767('0x4'));var BPromise=require(_0x1767('0x5'));var rp=require(_0x1767('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1767('0x7'));var config=require(_0x1767('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x1767('0x9')]=function(_0x4606ac,_0x26e4bc){return _0x4606ac[_0x1767('0xa')]('ServicenowField',attributes,{'tableName':_0x1767('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x1767('0xc'),_0x1767('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index f0ae4c1..10d72ae 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2e4179,_0x4ab147){var _0x2470db=function(_0x20e31d){while(--_0x20e31d){_0x2e4179['push'](_0x2e4179['shift']());}};_0x2470db(++_0x4ab147);}(_0xb43b,0x1b2));var _0xbb43=function(_0x308e8e,_0x12b5b6){_0x308e8e=_0x308e8e-0x0;var _0x132b1f=_0xb43b[_0x308e8e];return _0x132b1f;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7ed71b8..63c7427 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x31d4f0,_0x8dbb91){var _0x25833c=function(_0xc33b53){while(--_0xc33b53){_0x31d4f0['push'](_0x31d4f0['shift']());}};_0x25833c(++_0x8dbb91);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x342bc6,_0x5c40f9){var _0x88ba79=function(_0x3c48f0){while(--_0x3c48f0){_0x342bc6['push'](_0x342bc6['shift']());}};_0x88ba79(++_0x5c40f9);}(_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/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index acb24d7..5618019 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(_0x5b6e7e,_0x4c4295){var _0x5b8cc5=function(_0x672525){while(--_0x672525){_0x5b6e7e['push'](_0x5b6e7e['shift']());}};_0x5b8cc5(++_0x4c4295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x33cdc9,_0x37fd27){var _0x334faf=function(_0x35beab){while(--_0x35beab){_0x33cdc9['push'](_0x33cdc9['shift']());}};_0x334faf(++_0x37fd27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 2721310..f0fb050 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 _0x4930=['model','query','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','catch','show','keys','intersection','find','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','length','order','getSubjects','getDescriptions','channel','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','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','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key'];(function(_0x2c0f35,_0x14db9a){var _0x185496=function(_0x5b6e37){while(--_0x5b6e37){_0x2c0f35['push'](_0x2c0f35['shift']());}};_0x185496(++_0x14db9a);}(_0x4930,0x1b1));var _0x0493=function(_0x490bb3,_0x6665ab){_0x490bb3=_0x490bb3-0x0;var _0x26bd46=_0x4930[_0x490bb3];return _0x26bd46;};'use strict';var emlformat=require(_0x0493('0x0'));var rimraf=require(_0x0493('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0493('0x2'));var rp=require(_0x0493('0x3'));var moment=require(_0x0493('0x4'));var BPromise=require(_0x0493('0x5'));var Mustache=require(_0x0493('0x6'));var util=require(_0x0493('0x7'));var path=require(_0x0493('0x8'));var sox=require(_0x0493('0x9'));var csv=require(_0x0493('0xa'));var ejs=require(_0x0493('0xb'));var fs=require('fs');var fs_extra=require(_0x0493('0xc'));var _=require(_0x0493('0xd'));var squel=require('squel');var crypto=require(_0x0493('0xe'));var jsforce=require(_0x0493('0xf'));var deskjs=require(_0x0493('0x10'));var toCsv=require(_0x0493('0xa'));var querystring=require(_0x0493('0x11'));var Papa=require(_0x0493('0x12'));var Redis=require(_0x0493('0x13'));var authService=require(_0x0493('0x14'));var qs=require(_0x0493('0x15'));var as=require(_0x0493('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0493('0x17'));var utils=require(_0x0493('0x18'));var config=require(_0x0493('0x19'));var licenseUtil=require(_0x0493('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0493('0x1b'));function respondWithStatusCode(_0x2b774c,_0x156a23){_0x156a23=_0x156a23||0xcc;return function(_0x16220b){if(_0x16220b){return _0x2b774c['sendStatus'](_0x156a23);}return _0x2b774c[_0x0493('0x1c')](_0x156a23)[_0x0493('0x1d')]();};}function respondWithResult(_0x1bd13b,_0xa8280f){_0xa8280f=_0xa8280f||0xc8;return function(_0x5026a8){if(_0x5026a8){return _0x1bd13b['status'](_0xa8280f)[_0x0493('0x1e')](_0x5026a8);}};}function respondWithFilteredResult(_0x83107e,_0x4c81f3){return function(_0x128546){if(_0x128546){var _0x2e189f=typeof _0x4c81f3['offset']===_0x0493('0x1f')&&typeof _0x4c81f3[_0x0493('0x20')]===_0x0493('0x1f');var _0x1d78c6=_0x128546['count'];var _0x3acc00=_0x2e189f?0x0:_0x4c81f3[_0x0493('0x21')];var _0x418ed1=_0x2e189f?_0x128546[_0x0493('0x22')]:_0x4c81f3[_0x0493('0x21')]+_0x4c81f3['limit'];var _0x21a84c;if(_0x418ed1>=_0x1d78c6){_0x418ed1=_0x1d78c6;_0x21a84c=0xc8;}else{_0x21a84c=0xce;}_0x83107e[_0x0493('0x1c')](_0x21a84c);return _0x83107e[_0x0493('0x23')](_0x0493('0x24'),_0x3acc00+'-'+_0x418ed1+'/'+_0x1d78c6)['json'](_0x128546);}return null;};}function patchUpdates(_0x5888fe){return function(_0x4046a2){try{jsonpatch[_0x0493('0x25')](_0x4046a2,_0x5888fe,!![]);}catch(_0x3d4ce6){return BPromise[_0x0493('0x26')](_0x3d4ce6);}return _0x4046a2['save']();};}function saveUpdates(_0x1e4af4,_0x5514c5){return function(_0x350122){if(_0x350122){return _0x350122[_0x0493('0x27')](_0x1e4af4)['then'](function(_0x1eb5a8){return _0x1eb5a8;});}return null;};}function removeEntity(_0x4fc155,_0x177d8f){return function(_0x31e022){if(_0x31e022){return _0x31e022['destroy']()[_0x0493('0x28')](function(){_0x4fc155['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51250c,_0xd490f){return function(_0x15d140){if(!_0x15d140){_0x51250c['sendStatus'](0x194);}return _0x15d140;};}function handleError(_0x42ba74,_0x136ebb){_0x136ebb=_0x136ebb||0x1f4;return function(_0xb2cdde){logger[_0x0493('0x29')](_0xb2cdde[_0x0493('0x2a')]);if(_0xb2cdde['name']){delete _0xb2cdde[_0x0493('0x2b')];}_0x42ba74['status'](_0x136ebb)[_0x0493('0x2c')](_0xb2cdde);};}exports[_0x0493('0x2d')]=function(_0x2ca685,_0x590679){var _0x4a8e25={},_0x33d428={},_0x4716e7={'count':0x0,'rows':[]};var _0x467663=_[_0x0493('0x2e')](db[_0x0493('0x2f')][_0x0493('0x30')],function(_0x1194b5){return{'name':_0x1194b5['fieldName'],'type':_0x1194b5[_0x0493('0x31')][_0x0493('0x32')]};});_0x33d428[_0x0493('0x33')]=_['map'](_0x467663,_0x0493('0x2b'));_0x33d428[_0x0493('0x34')]=_['keys'](_0x2ca685[_0x0493('0x34')]);_0x33d428['filters']=_['intersection'](_0x33d428['model'],_0x33d428[_0x0493('0x34')]);_0x4a8e25[_0x0493('0x35')]=_['intersection'](_0x33d428['model'],qs[_0x0493('0x36')](_0x2ca685[_0x0493('0x34')]['fields']));_0x4a8e25['attributes']=_0x4a8e25[_0x0493('0x35')]['length']?_0x4a8e25[_0x0493('0x35')]:_0x33d428[_0x0493('0x33')];if(!_0x2ca685[_0x0493('0x34')][_0x0493('0x37')](_0x0493('0x38'))){_0x4a8e25[_0x0493('0x20')]=qs['limit'](_0x2ca685[_0x0493('0x34')][_0x0493('0x20')]);_0x4a8e25[_0x0493('0x21')]=qs[_0x0493('0x21')](_0x2ca685[_0x0493('0x34')][_0x0493('0x21')]);}_0x4a8e25['order']=qs[_0x0493('0x39')](_0x2ca685[_0x0493('0x34')][_0x0493('0x39')]);_0x4a8e25['where']=qs[_0x0493('0x3a')](_[_0x0493('0x3b')](_0x2ca685['query'],_0x33d428['filters']),_0x467663);if(_0x2ca685[_0x0493('0x34')]['filter']){_0x4a8e25[_0x0493('0x3c')]=_['merge'](_0x4a8e25[_0x0493('0x3c')],{'$or':_[_0x0493('0x2e')](_0x467663,function(_0x4a25ed){if(_0x4a25ed[_0x0493('0x31')]!==_0x0493('0x3d')){var _0x32ab8e={};_0x32ab8e[_0x4a25ed['name']]={'$like':'%'+_0x2ca685[_0x0493('0x34')][_0x0493('0x3e')]+'%'};return _0x32ab8e;}})});}_0x4a8e25=_[_0x0493('0x3f')]({},_0x4a8e25,_0x2ca685[_0x0493('0x40')]);var _0x415e34={'where':_0x4a8e25['where']};return db['SugarcrmAccount'][_0x0493('0x22')](_0x415e34)[_0x0493('0x28')](function(_0x197c94){_0x4716e7[_0x0493('0x22')]=_0x197c94;if(_0x2ca685['query'][_0x0493('0x41')]){_0x4a8e25[_0x0493('0x42')]=[{'all':!![]}];}return db[_0x0493('0x2f')]['findAll'](_0x4a8e25);})[_0x0493('0x28')](function(_0x305fa6){_0x4716e7['rows']=_0x305fa6;return _0x4716e7;})[_0x0493('0x28')](respondWithFilteredResult(_0x590679,_0x4a8e25))[_0x0493('0x43')](handleError(_0x590679,null));};exports[_0x0493('0x44')]=function(_0x11b262,_0x2aebfe){var _0x139d79={'raw':![],'where':{'id':_0x11b262['params']['id']}},_0x556a4c={};_0x556a4c[_0x0493('0x33')]=_[_0x0493('0x45')](db[_0x0493('0x2f')][_0x0493('0x30')]);_0x556a4c[_0x0493('0x34')]=_['keys'](_0x11b262[_0x0493('0x34')]);_0x556a4c[_0x0493('0x3a')]=_['intersection'](_0x556a4c[_0x0493('0x33')],_0x556a4c[_0x0493('0x34')]);_0x139d79[_0x0493('0x35')]=_[_0x0493('0x46')](_0x556a4c['model'],qs[_0x0493('0x36')](_0x11b262[_0x0493('0x34')]['fields']));_0x139d79[_0x0493('0x35')]=_0x139d79[_0x0493('0x35')]['length']?_0x139d79[_0x0493('0x35')]:_0x556a4c[_0x0493('0x33')];if(_0x11b262[_0x0493('0x34')][_0x0493('0x41')]){_0x139d79['include']=[{'all':!![]}];}_0x139d79=_['merge']({},_0x139d79,_0x11b262[_0x0493('0x40')]);return db[_0x0493('0x2f')][_0x0493('0x47')](_0x139d79)[_0x0493('0x28')](handleEntityNotFound(_0x2aebfe,null))[_0x0493('0x28')](respondWithResult(_0x2aebfe,null))['catch'](handleError(_0x2aebfe,null));};exports[_0x0493('0x48')]=function(_0x4eb3bc,_0xf7a9e7){return db[_0x0493('0x2f')][_0x0493('0x48')](_0x4eb3bc[_0x0493('0x49')],{})[_0x0493('0x28')](respondWithResult(_0xf7a9e7,0xc9))[_0x0493('0x43')](handleError(_0xf7a9e7,null));};exports['update']=function(_0x4409c7,_0x2d3109){if(_0x4409c7[_0x0493('0x49')]['id']){delete _0x4409c7[_0x0493('0x49')]['id'];}return db[_0x0493('0x2f')]['find']({'where':{'id':_0x4409c7[_0x0493('0x4a')]['id']}})[_0x0493('0x28')](handleEntityNotFound(_0x2d3109,null))[_0x0493('0x28')](saveUpdates(_0x4409c7[_0x0493('0x49')],null))[_0x0493('0x28')](respondWithResult(_0x2d3109,null))[_0x0493('0x43')](handleError(_0x2d3109,null));};exports[_0x0493('0x4b')]=function(_0x509759,_0xd9b085){return db[_0x0493('0x2f')][_0x0493('0x47')]({'where':{'id':_0x509759[_0x0493('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd9b085,null))[_0x0493('0x28')](removeEntity(_0xd9b085,null))[_0x0493('0x43')](handleError(_0xd9b085,null));};exports[_0x0493('0x4c')]=function(_0x418d9d,_0x410548,_0x30226a){var _0x906969={};var _0x5fb7db={};var _0x252df6;var _0x1453c5;return db[_0x0493('0x2f')]['findOne']({'where':{'id':_0x418d9d[_0x0493('0x4a')]['id']}})[_0x0493('0x28')](handleEntityNotFound(_0x410548,null))[_0x0493('0x28')](function(_0x270959){if(_0x270959){_0x252df6=_0x270959;_0x5fb7db[_0x0493('0x33')]=_[_0x0493('0x45')](db[_0x0493('0x4d')]['rawAttributes']);_0x5fb7db['query']=_['keys'](_0x418d9d['query']);_0x5fb7db[_0x0493('0x3a')]=_[_0x0493('0x46')](_0x5fb7db['model'],_0x5fb7db[_0x0493('0x34')]);_0x906969[_0x0493('0x35')]=_[_0x0493('0x46')](_0x5fb7db[_0x0493('0x33')],qs[_0x0493('0x36')](_0x418d9d[_0x0493('0x34')]['fields']));_0x906969[_0x0493('0x35')]=_0x906969['attributes'][_0x0493('0x4e')]?_0x906969[_0x0493('0x35')]:_0x5fb7db[_0x0493('0x33')];_0x906969[_0x0493('0x4f')]=qs[_0x0493('0x39')](_0x418d9d[_0x0493('0x34')][_0x0493('0x39')]);_0x906969[_0x0493('0x3c')]=qs[_0x0493('0x3a')](_[_0x0493('0x3b')](_0x418d9d[_0x0493('0x34')],_0x5fb7db[_0x0493('0x3a')]));if(_0x418d9d['query'][_0x0493('0x3e')]){_0x906969['where']=_[_0x0493('0x3f')](_0x906969[_0x0493('0x3c')],{'$or':_[_0x0493('0x2e')](_0x906969[_0x0493('0x35')],function(_0x1b61e3){var _0x4fa20f={};_0x4fa20f[_0x1b61e3]={'$like':'%'+_0x418d9d['query'][_0x0493('0x3e')]+'%'};return _0x4fa20f;})});}_0x906969=_['merge']({},_0x906969,_0x418d9d[_0x0493('0x40')]);return _0x252df6[_0x0493('0x4c')](_0x906969);}})[_0x0493('0x28')](function(_0x2df5ba){if(_0x2df5ba){_0x1453c5=_0x2df5ba[_0x0493('0x4e')];if(!_0x418d9d[_0x0493('0x34')][_0x0493('0x37')]('nolimit')){_0x906969[_0x0493('0x20')]=qs[_0x0493('0x20')](_0x418d9d['query'][_0x0493('0x20')]);_0x906969[_0x0493('0x21')]=qs[_0x0493('0x21')](_0x418d9d[_0x0493('0x34')]['offset']);}return _0x252df6[_0x0493('0x4c')](_0x906969);}})[_0x0493('0x28')](function(_0x9ebe68){if(_0x9ebe68){return _0x9ebe68?{'count':_0x1453c5,'rows':_0x9ebe68}:null;}})[_0x0493('0x28')](respondWithResult(_0x410548,null))['catch'](handleError(_0x410548,null));};exports['addConfiguration']=function(_0x703efc,_0xe4712c,_0x45d1f8){if(_0x703efc[_0x0493('0x49')]['id']){delete _0x703efc[_0x0493('0x49')]['id'];}return db[_0x0493('0x2f')]['findOne']({'where':{'id':_0x703efc[_0x0493('0x4a')]['id']}})[_0x0493('0x28')](handleEntityNotFound(_0xe4712c,null))[_0x0493('0x28')](function(_0x2b761f){if(_0x2b761f){_0x703efc['body']['AccountId']=_0x2b761f['id'];_0x703efc[_0x0493('0x49')]['Subjects']=integrations[_0x0493('0x50')](_0x703efc['body']['channel'],_0x703efc[_0x0493('0x49')][_0x0493('0x31')]);_0x703efc[_0x0493('0x49')]['Descriptions']=integrations[_0x0493('0x51')](_0x703efc[_0x0493('0x49')][_0x0493('0x52')],_0x703efc[_0x0493('0x49')][_0x0493('0x31')]);return db[_0x0493('0x4d')][_0x0493('0x48')](_0x703efc[_0x0493('0x49')],{'include':[{'model':db[_0x0493('0x53')],'as':_0x0493('0x54')},{'model':db[_0x0493('0x53')],'as':_0x0493('0x55')}]});}return null;})['then'](respondWithResult(_0xe4712c,null))[_0x0493('0x43')](handleError(_0xe4712c,null));};exports[_0x0493('0x56')]=function(_0xc3ecf8,_0x160891,_0x7dc3fe){var _0x18c1c4='';var _0x489fe1=['id',_0x0493('0x2b'),_0x0493('0x57'),_0x0493('0x58'),_0x0493('0x59'),_0x0493('0x5a'),_0x0493('0x5b'),_0x0493('0x5c'),_0x0493('0x5d'),_0x0493('0x5e'),_0x0493('0x5f'),_0x0493('0x60')];return db[_0x0493('0x2f')][_0x0493('0x61')]({'where':{'id':_0xc3ecf8[_0x0493('0x4a')]['id']},'attributes':['id',_0x0493('0x62'),_0x0493('0x63'),_0x0493('0x64')]})['then'](handleEntityNotFound(_0x160891,null))['then'](function(_0x13e0ca){if(_0x13e0ca){_0x18c1c4=_0x13e0ca['remoteUri'];var _0x4d1e44=_0x18c1c4['slice'](-0x1);if(_0x4d1e44==='/'){_0x18c1c4=_0x18c1c4[_0x0493('0x65')](0x0,_0x18c1c4['lastIndexOf'](_0x4d1e44));}return rp({'method':_0x0493('0x66'),'uri':util[_0x0493('0x67')](_0x0493('0x68'),_0x18c1c4,_0x0493('0x69')),'json':!![],'form':{'method':_0x0493('0x6a'),'input_type':_0x0493('0x6b'),'response_type':'JSON','rest_data':JSON[_0x0493('0x6c')]({'user_auth':{'user_name':_0x13e0ca[_0x0493('0x62')],'password':_0x13e0ca['password'],'encryption':'PLAIN'},'application':_0x0493('0x6d')})}});}})[_0x0493('0x28')](function(_0x2c4ce4){if(_0x2c4ce4&&_0x2c4ce4[_0x0493('0x2b')]!=='Invalid\x20Login'&&_0x2c4ce4[_0x0493('0x2b')]!==_0x0493('0x6e')){return rp({'method':_0x0493('0x66'),'uri':util['format'](_0x0493('0x68'),_0x18c1c4,_0x0493('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x0493('0x6b'),'response_type':_0x0493('0x6b'),'rest_data':JSON[_0x0493('0x6c')]({'session':_0x2c4ce4['id'],'module_name':_0x0493('0x6f')})}})[_0x0493('0x28')](function(_0x12fb21){if(_0x12fb21){var _0x4e7e07=_[_0x0493('0x70')](_0x12fb21[_0x0493('0x71')]);_['remove'](_0x4e7e07,function(_0x2144aa){return _0x489fe1['includes'](_0x2144aa[_0x0493('0x2b')]);});return{'count':_0x4e7e07[_0x0493('0x4e')],'rows':_[_0x0493('0x2e')](_0x4e7e07,function(_0x856155){return{'id':_0x856155[_0x0493('0x2b')],'name':_0x856155[_0x0493('0x72')],'custom':_[_0x0493('0x73')](_0x856155['name'],'_c')?!![]:![],'options':_0x856155[_0x0493('0x40')]?_[_0x0493('0x2e')](_[_0x0493('0x70')](_0x856155[_0x0493('0x40')]),function(_0x48c2bd){return{'name':_0x48c2bd[_0x0493('0x74')],'value':_0x48c2bd[_0x0493('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x160891,null))[_0x0493('0x43')](function(_0x16ceab){var _0x231571=_0xc3ecf8['query'][_0x0493('0x75')]?0x1f4:_0x16ceab[_0x0493('0x76')]||0x1f4;logger[_0x0493('0x29')](_0x0493('0x77'),_0x0493('0x56'),_0x231571,JSON[_0x0493('0x6c')](_0x16ceab));delete _0x16ceab['name'];if(_0x231571===0x191){_0x231571=0x190;}_0x160891[_0x0493('0x1c')](_0x231571)[_0x0493('0x2c')](_0xc3ecf8['query']['test']?{'message':_0x0493('0x78'),'statusCode':_0x16ceab[_0x0493('0x76')]}:_0x16ceab);});}else{var _0xe9dbad=0x1f4;_0x160891[_0x0493('0x1c')](_0xe9dbad)[_0x0493('0x2c')]({'message':_0x0493('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xdf0c=['options','SugarcrmAccount','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','getConfigurations','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x54995e,_0x55b080){var _0x35d8e3=function(_0x5a096a){while(--_0x5a096a){_0x54995e['push'](_0x54995e['shift']());}};_0x35d8e3(++_0x55b080);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0x4c5a24,_0x5ef60c){_0x4c5a24=_0x4c5a24-0x0;var _0x4b067e=_0xdf0c[_0x4c5a24];return _0x4b067e;};'use strict';var emlformat=require(_0xcdf0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdf0('0x1'));var jsonpatch=require(_0xcdf0('0x2'));var rp=require(_0xcdf0('0x3'));var moment=require(_0xcdf0('0x4'));var BPromise=require(_0xcdf0('0x5'));var Mustache=require(_0xcdf0('0x6'));var util=require(_0xcdf0('0x7'));var path=require('path');var sox=require(_0xcdf0('0x8'));var csv=require(_0xcdf0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdf0('0xa'));var _=require(_0xcdf0('0xb'));var squel=require(_0xcdf0('0xc'));var crypto=require('crypto');var jsforce=require(_0xcdf0('0xd'));var deskjs=require(_0xcdf0('0xe'));var toCsv=require(_0xcdf0('0x9'));var querystring=require(_0xcdf0('0xf'));var Papa=require('papaparse');var Redis=require(_0xcdf0('0x10'));var authService=require(_0xcdf0('0x11'));var qs=require(_0xcdf0('0x12'));var as=require(_0xcdf0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdf0('0x14'))(_0xcdf0('0x15'));var utils=require(_0xcdf0('0x16'));var config=require(_0xcdf0('0x17'));var licenseUtil=require(_0xcdf0('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcdf0('0x19'));function respondWithStatusCode(_0x3da121,_0x3a402a){_0x3a402a=_0x3a402a||0xcc;return function(_0x5077ff){if(_0x5077ff){return _0x3da121[_0xcdf0('0x1a')](_0x3a402a);}return _0x3da121['status'](_0x3a402a)['end']();};}function respondWithResult(_0x29429b,_0x2c654c){_0x2c654c=_0x2c654c||0xc8;return function(_0x50440e){if(_0x50440e){return _0x29429b[_0xcdf0('0x1b')](_0x2c654c)[_0xcdf0('0x1c')](_0x50440e);}};}function respondWithFilteredResult(_0x25d136,_0x22acb4){return function(_0x14df00){if(_0x14df00){var _0x4d6829=typeof _0x22acb4[_0xcdf0('0x1d')]===_0xcdf0('0x1e')&&typeof _0x22acb4[_0xcdf0('0x1f')]===_0xcdf0('0x1e');var _0x3afa74=_0x14df00[_0xcdf0('0x20')];var _0x227fc4=_0x4d6829?0x0:_0x22acb4[_0xcdf0('0x1d')];var _0x5e8b54=_0x4d6829?_0x14df00[_0xcdf0('0x20')]:_0x22acb4[_0xcdf0('0x1d')]+_0x22acb4['limit'];var _0x5e2d6e;if(_0x5e8b54>=_0x3afa74){_0x5e8b54=_0x3afa74;_0x5e2d6e=0xc8;}else{_0x5e2d6e=0xce;}_0x25d136[_0xcdf0('0x1b')](_0x5e2d6e);return _0x25d136[_0xcdf0('0x21')](_0xcdf0('0x22'),_0x227fc4+'-'+_0x5e8b54+'/'+_0x3afa74)[_0xcdf0('0x1c')](_0x14df00);}return null;};}function patchUpdates(_0x32e860){return function(_0x1d1ff3){try{jsonpatch[_0xcdf0('0x23')](_0x1d1ff3,_0x32e860,!![]);}catch(_0x5b0458){return BPromise[_0xcdf0('0x24')](_0x5b0458);}return _0x1d1ff3['save']();};}function saveUpdates(_0x4e08d6,_0x1a3c71){return function(_0x309e14){if(_0x309e14){return _0x309e14[_0xcdf0('0x25')](_0x4e08d6)['then'](function(_0x2359d2){return _0x2359d2;});}return null;};}function removeEntity(_0x37bb32,_0x446a8f){return function(_0x37a564){if(_0x37a564){return _0x37a564[_0xcdf0('0x26')]()[_0xcdf0('0x27')](function(){_0x37bb32[_0xcdf0('0x1b')](0xcc)[_0xcdf0('0x28')]();});}};}function handleEntityNotFound(_0x5b3485,_0x77e3e6){return function(_0xc3ee79){if(!_0xc3ee79){_0x5b3485[_0xcdf0('0x1a')](0x194);}return _0xc3ee79;};}function handleError(_0x479db5,_0x1844dc){_0x1844dc=_0x1844dc||0x1f4;return function(_0x5d96ea){logger[_0xcdf0('0x29')](_0x5d96ea[_0xcdf0('0x2a')]);if(_0x5d96ea['name']){delete _0x5d96ea[_0xcdf0('0x2b')];}_0x479db5['status'](_0x1844dc)[_0xcdf0('0x2c')](_0x5d96ea);};}exports[_0xcdf0('0x2d')]=function(_0x3158b8,_0x36a4a9){var _0xa0a7d1={},_0x38b383={},_0x2e4e50={'count':0x0,'rows':[]};var _0x30ba4f=_[_0xcdf0('0x2e')](db['SugarcrmAccount']['rawAttributes'],function(_0x215b67){return{'name':_0x215b67['fieldName'],'type':_0x215b67[_0xcdf0('0x2f')]['key']};});_0x38b383[_0xcdf0('0x30')]=_['map'](_0x30ba4f,_0xcdf0('0x2b'));_0x38b383[_0xcdf0('0x31')]=_[_0xcdf0('0x32')](_0x3158b8[_0xcdf0('0x31')]);_0x38b383[_0xcdf0('0x33')]=_[_0xcdf0('0x34')](_0x38b383[_0xcdf0('0x30')],_0x38b383['query']);_0xa0a7d1[_0xcdf0('0x35')]=_[_0xcdf0('0x34')](_0x38b383[_0xcdf0('0x30')],qs[_0xcdf0('0x36')](_0x3158b8['query']['fields']));_0xa0a7d1['attributes']=_0xa0a7d1[_0xcdf0('0x35')][_0xcdf0('0x37')]?_0xa0a7d1[_0xcdf0('0x35')]:_0x38b383[_0xcdf0('0x30')];if(!_0x3158b8['query'][_0xcdf0('0x38')](_0xcdf0('0x39'))){_0xa0a7d1[_0xcdf0('0x1f')]=qs[_0xcdf0('0x1f')](_0x3158b8[_0xcdf0('0x31')][_0xcdf0('0x1f')]);_0xa0a7d1[_0xcdf0('0x1d')]=qs[_0xcdf0('0x1d')](_0x3158b8[_0xcdf0('0x31')]['offset']);}_0xa0a7d1[_0xcdf0('0x3a')]=qs[_0xcdf0('0x3b')](_0x3158b8[_0xcdf0('0x31')][_0xcdf0('0x3b')]);_0xa0a7d1['where']=qs[_0xcdf0('0x33')](_[_0xcdf0('0x3c')](_0x3158b8['query'],_0x38b383[_0xcdf0('0x33')]),_0x30ba4f);if(_0x3158b8['query'][_0xcdf0('0x3d')]){_0xa0a7d1[_0xcdf0('0x3e')]=_[_0xcdf0('0x3f')](_0xa0a7d1['where'],{'$or':_['map'](_0x30ba4f,function(_0x4e2e8a){if(_0x4e2e8a['type']!==_0xcdf0('0x40')){var _0x50c9b3={};_0x50c9b3[_0x4e2e8a[_0xcdf0('0x2b')]]={'$like':'%'+_0x3158b8['query'][_0xcdf0('0x3d')]+'%'};return _0x50c9b3;}})});}_0xa0a7d1=_[_0xcdf0('0x3f')]({},_0xa0a7d1,_0x3158b8[_0xcdf0('0x41')]);var _0x4903b9={'where':_0xa0a7d1['where']};return db[_0xcdf0('0x42')][_0xcdf0('0x20')](_0x4903b9)[_0xcdf0('0x27')](function(_0x1713c8){_0x2e4e50[_0xcdf0('0x20')]=_0x1713c8;if(_0x3158b8[_0xcdf0('0x31')][_0xcdf0('0x43')]){_0xa0a7d1['include']=[{'all':!![]}];}return db[_0xcdf0('0x42')]['findAll'](_0xa0a7d1);})[_0xcdf0('0x27')](function(_0x7d4c71){_0x2e4e50[_0xcdf0('0x44')]=_0x7d4c71;return _0x2e4e50;})[_0xcdf0('0x27')](respondWithFilteredResult(_0x36a4a9,_0xa0a7d1))['catch'](handleError(_0x36a4a9,null));};exports[_0xcdf0('0x45')]=function(_0x4c8f3d,_0x2cb592){var _0x43a7f={'raw':![],'where':{'id':_0x4c8f3d[_0xcdf0('0x46')]['id']}},_0xe02974={};_0xe02974[_0xcdf0('0x30')]=_[_0xcdf0('0x32')](db[_0xcdf0('0x42')][_0xcdf0('0x47')]);_0xe02974[_0xcdf0('0x31')]=_[_0xcdf0('0x32')](_0x4c8f3d[_0xcdf0('0x31')]);_0xe02974[_0xcdf0('0x33')]=_[_0xcdf0('0x34')](_0xe02974[_0xcdf0('0x30')],_0xe02974[_0xcdf0('0x31')]);_0x43a7f['attributes']=_[_0xcdf0('0x34')](_0xe02974[_0xcdf0('0x30')],qs['fields'](_0x4c8f3d[_0xcdf0('0x31')][_0xcdf0('0x36')]));_0x43a7f[_0xcdf0('0x35')]=_0x43a7f['attributes'][_0xcdf0('0x37')]?_0x43a7f[_0xcdf0('0x35')]:_0xe02974[_0xcdf0('0x30')];if(_0x4c8f3d[_0xcdf0('0x31')]['includeAll']){_0x43a7f[_0xcdf0('0x48')]=[{'all':!![]}];}_0x43a7f=_[_0xcdf0('0x3f')]({},_0x43a7f,_0x4c8f3d[_0xcdf0('0x41')]);return db[_0xcdf0('0x42')][_0xcdf0('0x49')](_0x43a7f)['then'](handleEntityNotFound(_0x2cb592,null))['then'](respondWithResult(_0x2cb592,null))[_0xcdf0('0x4a')](handleError(_0x2cb592,null));};exports[_0xcdf0('0x4b')]=function(_0x1ae251,_0x5d5257){return db[_0xcdf0('0x42')][_0xcdf0('0x4b')](_0x1ae251[_0xcdf0('0x4c')],{})[_0xcdf0('0x27')](respondWithResult(_0x5d5257,0xc9))[_0xcdf0('0x4a')](handleError(_0x5d5257,null));};exports[_0xcdf0('0x25')]=function(_0x374b37,_0x252663){if(_0x374b37[_0xcdf0('0x4c')]['id']){delete _0x374b37[_0xcdf0('0x4c')]['id'];}return db[_0xcdf0('0x42')]['find']({'where':{'id':_0x374b37[_0xcdf0('0x46')]['id']}})[_0xcdf0('0x27')](handleEntityNotFound(_0x252663,null))[_0xcdf0('0x27')](saveUpdates(_0x374b37[_0xcdf0('0x4c')],null))[_0xcdf0('0x27')](respondWithResult(_0x252663,null))[_0xcdf0('0x4a')](handleError(_0x252663,null));};exports[_0xcdf0('0x26')]=function(_0x409ca8,_0x394f95){return db[_0xcdf0('0x42')][_0xcdf0('0x49')]({'where':{'id':_0x409ca8[_0xcdf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x394f95,null))[_0xcdf0('0x27')](removeEntity(_0x394f95,null))[_0xcdf0('0x4a')](handleError(_0x394f95,null));};exports[_0xcdf0('0x4d')]=function(_0x462db6,_0x3e4724,_0x1d492a){var _0x56d35e={};var _0x2680d5={};var _0x5b4b9b;var _0x5784a0;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x462db6[_0xcdf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e4724,null))[_0xcdf0('0x27')](function(_0x310c50){if(_0x310c50){_0x5b4b9b=_0x310c50;_0x2680d5[_0xcdf0('0x30')]=_[_0xcdf0('0x32')](db[_0xcdf0('0x4e')][_0xcdf0('0x47')]);_0x2680d5[_0xcdf0('0x31')]=_[_0xcdf0('0x32')](_0x462db6[_0xcdf0('0x31')]);_0x2680d5[_0xcdf0('0x33')]=_['intersection'](_0x2680d5[_0xcdf0('0x30')],_0x2680d5[_0xcdf0('0x31')]);_0x56d35e[_0xcdf0('0x35')]=_[_0xcdf0('0x34')](_0x2680d5[_0xcdf0('0x30')],qs[_0xcdf0('0x36')](_0x462db6[_0xcdf0('0x31')][_0xcdf0('0x36')]));_0x56d35e[_0xcdf0('0x35')]=_0x56d35e['attributes'][_0xcdf0('0x37')]?_0x56d35e[_0xcdf0('0x35')]:_0x2680d5[_0xcdf0('0x30')];_0x56d35e[_0xcdf0('0x3a')]=qs[_0xcdf0('0x3b')](_0x462db6[_0xcdf0('0x31')][_0xcdf0('0x3b')]);_0x56d35e[_0xcdf0('0x3e')]=qs[_0xcdf0('0x33')](_[_0xcdf0('0x3c')](_0x462db6['query'],_0x2680d5[_0xcdf0('0x33')]));if(_0x462db6['query'][_0xcdf0('0x3d')]){_0x56d35e[_0xcdf0('0x3e')]=_[_0xcdf0('0x3f')](_0x56d35e[_0xcdf0('0x3e')],{'$or':_[_0xcdf0('0x2e')](_0x56d35e['attributes'],function(_0x1f16ed){var _0x3bb533={};_0x3bb533[_0x1f16ed]={'$like':'%'+_0x462db6[_0xcdf0('0x31')]['filter']+'%'};return _0x3bb533;})});}_0x56d35e=_[_0xcdf0('0x3f')]({},_0x56d35e,_0x462db6[_0xcdf0('0x41')]);return _0x5b4b9b[_0xcdf0('0x4d')](_0x56d35e);}})[_0xcdf0('0x27')](function(_0x12672f){if(_0x12672f){_0x5784a0=_0x12672f[_0xcdf0('0x37')];if(!_0x462db6[_0xcdf0('0x31')][_0xcdf0('0x38')](_0xcdf0('0x39'))){_0x56d35e[_0xcdf0('0x1f')]=qs[_0xcdf0('0x1f')](_0x462db6[_0xcdf0('0x31')][_0xcdf0('0x1f')]);_0x56d35e['offset']=qs[_0xcdf0('0x1d')](_0x462db6[_0xcdf0('0x31')]['offset']);}return _0x5b4b9b['getConfigurations'](_0x56d35e);}})['then'](function(_0x1db05d){if(_0x1db05d){return _0x1db05d?{'count':_0x5784a0,'rows':_0x1db05d}:null;}})[_0xcdf0('0x27')](respondWithResult(_0x3e4724,null))[_0xcdf0('0x4a')](handleError(_0x3e4724,null));};exports[_0xcdf0('0x4f')]=function(_0x295d0a,_0x5a75ce,_0x4a7b2e){if(_0x295d0a[_0xcdf0('0x4c')]['id']){delete _0x295d0a[_0xcdf0('0x4c')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x295d0a['params']['id']}})[_0xcdf0('0x27')](handleEntityNotFound(_0x5a75ce,null))[_0xcdf0('0x27')](function(_0x1143d9){if(_0x1143d9){_0x295d0a[_0xcdf0('0x4c')][_0xcdf0('0x50')]=_0x1143d9['id'];_0x295d0a['body'][_0xcdf0('0x51')]=integrations[_0xcdf0('0x52')](_0x295d0a['body'][_0xcdf0('0x53')],_0x295d0a[_0xcdf0('0x4c')][_0xcdf0('0x2f')]);_0x295d0a[_0xcdf0('0x4c')][_0xcdf0('0x54')]=integrations['getDescriptions'](_0x295d0a[_0xcdf0('0x4c')][_0xcdf0('0x53')],_0x295d0a[_0xcdf0('0x4c')]['type']);return db[_0xcdf0('0x4e')][_0xcdf0('0x4b')](_0x295d0a[_0xcdf0('0x4c')],{'include':[{'model':db[_0xcdf0('0x55')],'as':_0xcdf0('0x51')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xcdf0('0x27')](respondWithResult(_0x5a75ce,null))[_0xcdf0('0x4a')](handleError(_0x5a75ce,null));};exports[_0xcdf0('0x56')]=function(_0x2ce5c2,_0x20d61f,_0x2933e5){var _0x40f219='';var _0x48e0f0=['id','name',_0xcdf0('0x57'),_0xcdf0('0x58'),_0xcdf0('0x59'),_0xcdf0('0x5a'),_0xcdf0('0x5b'),'duration_minutes',_0xcdf0('0x5c'),_0xcdf0('0x5d'),'parent_name',_0xcdf0('0x5e')];return db[_0xcdf0('0x42')]['findOne']({'where':{'id':_0x2ce5c2[_0xcdf0('0x46')]['id']},'attributes':['id',_0xcdf0('0x5f'),_0xcdf0('0x60'),'remoteUri']})[_0xcdf0('0x27')](handleEntityNotFound(_0x20d61f,null))[_0xcdf0('0x27')](function(_0x12ea31){if(_0x12ea31){_0x40f219=_0x12ea31[_0xcdf0('0x61')];var _0xfb5bd6=_0x40f219[_0xcdf0('0x62')](-0x1);if(_0xfb5bd6==='/'){_0x40f219=_0x40f219['substring'](0x0,_0x40f219[_0xcdf0('0x63')](_0xfb5bd6));}return rp({'method':_0xcdf0('0x64'),'uri':util[_0xcdf0('0x65')](_0xcdf0('0x66'),_0x40f219,_0xcdf0('0x67')),'json':!![],'form':{'method':'login','input_type':_0xcdf0('0x68'),'response_type':_0xcdf0('0x68'),'rest_data':JSON[_0xcdf0('0x69')]({'user_auth':{'user_name':_0x12ea31[_0xcdf0('0x5f')],'password':_0x12ea31[_0xcdf0('0x60')],'encryption':_0xcdf0('0x6a')},'application':_0xcdf0('0x6b')})}});}})[_0xcdf0('0x27')](function(_0x502577){if(_0x502577&&_0x502577[_0xcdf0('0x2b')]!==_0xcdf0('0x6c')&&_0x502577['name']!==_0xcdf0('0x6d')){return rp({'method':'POST','uri':util[_0xcdf0('0x65')](_0xcdf0('0x66'),_0x40f219,_0xcdf0('0x67')),'json':!![],'form':{'method':_0xcdf0('0x6e'),'input_type':_0xcdf0('0x68'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x502577['id'],'module_name':_0xcdf0('0x6f')})}})[_0xcdf0('0x27')](function(_0x2d60bb){if(_0x2d60bb){var _0x398db1=_[_0xcdf0('0x70')](_0x2d60bb[_0xcdf0('0x71')]);_[_0xcdf0('0x72')](_0x398db1,function(_0x2edfc6){return _0x48e0f0[_0xcdf0('0x73')](_0x2edfc6[_0xcdf0('0x2b')]);});return{'count':_0x398db1[_0xcdf0('0x37')],'rows':_[_0xcdf0('0x2e')](_0x398db1,function(_0x33ce50){return{'id':_0x33ce50[_0xcdf0('0x2b')],'name':_0x33ce50[_0xcdf0('0x74')],'custom':_[_0xcdf0('0x75')](_0x33ce50['name'],'_c')?!![]:![],'options':_0x33ce50[_0xcdf0('0x41')]?_[_0xcdf0('0x2e')](_[_0xcdf0('0x70')](_0x33ce50[_0xcdf0('0x41')]),function(_0x4e0671){return{'name':_0x4e0671[_0xcdf0('0x76')],'value':_0x4e0671[_0xcdf0('0x2b')]};}):[]};})};}})[_0xcdf0('0x27')](respondWithResult(_0x20d61f,null))[_0xcdf0('0x4a')](function(_0x150225){var _0x44392a=_0x2ce5c2[_0xcdf0('0x31')][_0xcdf0('0x77')]?0x1f4:_0x150225[_0xcdf0('0x78')]||0x1f4;logger[_0xcdf0('0x29')](_0xcdf0('0x79'),_0xcdf0('0x56'),_0x44392a,JSON[_0xcdf0('0x69')](_0x150225));delete _0x150225['name'];if(_0x44392a===0x191){_0x44392a=0x190;}_0x20d61f['status'](_0x44392a)[_0xcdf0('0x2c')](_0x2ce5c2[_0xcdf0('0x31')][_0xcdf0('0x77')]?{'message':_0xcdf0('0x7a'),'statusCode':_0x150225['statusCode']}:_0x150225);});}else{var _0x3b51bb=0x1f4;_0x20d61f[_0xcdf0('0x1b')](_0x3b51bb)['send']({'message':_0xcdf0('0x7a'),'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 aa331b9..3405909 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 _0xfc9a=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x269261,_0x4b38f2){var _0x4b80c6=function(_0x1dfda2){while(--_0x1dfda2){_0x269261['push'](_0x269261['shift']());}};_0x4b80c6(++_0x4b38f2);}(_0xfc9a,0x83));var _0xafc9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc9a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xafc9('0x0'));var util=require(_0xafc9('0x1'));var logger=require(_0xafc9('0x2'))(_0xafc9('0x3'));var moment=require(_0xafc9('0x4'));var BPromise=require(_0xafc9('0x5'));var rp=require(_0xafc9('0x6'));var fs=require('fs');var path=require(_0xafc9('0x7'));var rimraf=require(_0xafc9('0x8'));var config=require(_0xafc9('0x9'));var attributes=require(_0xafc9('0xa'));var integrations=require(_0xafc9('0xb'));module[_0xafc9('0xc')]=function(_0x35e4b5,_0x5c0db2){return _0x35e4b5[_0xafc9('0xd')](_0xafc9('0xe'),attributes,{'tableName':_0xafc9('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0d1=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x397847,_0x5cb8d5){var _0x4a546c=function(_0x5d69c0){while(--_0x5d69c0){_0x397847['push'](_0x397847['shift']());}};_0x4a546c(++_0x5cb8d5);}(_0xa0d1,0x144));var _0x1a0d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa0d1[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a0d('0x0'))('api');var moment=require(_0x1a0d('0x1'));var BPromise=require(_0x1a0d('0x2'));var rp=require(_0x1a0d('0x3'));var fs=require('fs');var path=require(_0x1a0d('0x4'));var rimraf=require(_0x1a0d('0x5'));var config=require('../../config/environment');var attributes=require(_0x1a0d('0x6'));var integrations=require(_0x1a0d('0x7'));module[_0x1a0d('0x8')]=function(_0xcb35a0,_0x439ca0){return _0xcb35a0[_0x1a0d('0x9')](_0x1a0d('0xa'),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 f7f2d39..136ab07 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 _0xcc24=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount','options','raw','attributes','limit','include','map','model','GetSugarcrmAccount','catch','ShowSugarcrmAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xcc24,0x1e0));var _0x4cc2=function(_0x50f502,_0x5921ea){_0x50f502=_0x50f502-0x0;var _0x357226=_0xcc24[_0x50f502];return _0x357226;};'use strict';var _=require(_0x4cc2('0x0'));var util=require(_0x4cc2('0x1'));var moment=require(_0x4cc2('0x2'));var BPromise=require(_0x4cc2('0x3'));var rs=require(_0x4cc2('0x4'));var fs=require('fs');var Redis=require(_0x4cc2('0x5'));var db=require(_0x4cc2('0x6'))['db'];var utils=require(_0x4cc2('0x7'));var logger=require(_0x4cc2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4cc2('0x9'));var client=jayson['client'][_0x4cc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2d8d,_0xb80f33,_0x5c8b5d){return new BPromise(function(_0x5721fc,_0x54b160){return client['request'](_0x3a2d8d,_0x5c8b5d)[_0x4cc2('0xb')](function(_0xc28b82){logger[_0x4cc2('0xc')](_0x4cc2('0xd'),_0xb80f33,_0x4cc2('0xe'));logger[_0x4cc2('0xf')](_0x4cc2('0x10'),_0xb80f33,_0x4cc2('0xe'),JSON[_0x4cc2('0x11')](_0xc28b82));if(_0xc28b82['error']){if(_0xc28b82['error']['code']===0x1f4){logger[_0x4cc2('0x12')](_0x4cc2('0xd'),_0xb80f33,_0xc28b82[_0x4cc2('0x12')][_0x4cc2('0x13')]);return _0x54b160(_0xc28b82[_0x4cc2('0x12')][_0x4cc2('0x13')]);}logger['error'](_0x4cc2('0xd'),_0xb80f33,_0xc28b82['error'][_0x4cc2('0x13')]);return _0x5721fc(_0xc28b82['error'][_0x4cc2('0x13')]);}else{logger[_0x4cc2('0xc')](_0x4cc2('0xd'),_0xb80f33,_0x4cc2('0xe'));_0x5721fc(_0xc28b82['result'][_0x4cc2('0x13')]);}})['catch'](function(_0x4610e6){logger[_0x4cc2('0x12')](_0x4cc2('0xd'),_0xb80f33,_0x4610e6);_0x54b160(_0x4610e6);});});}exports['GetSugarcrmAccount']=function(_0x56388b){var _0x3a6b97=this;return new Promise(function(_0x3334bb,_0x6ce446){return db[_0x4cc2('0x14')]['findAll']({'raw':_0x56388b[_0x4cc2('0x15')]?_0x56388b[_0x4cc2('0x15')][_0x4cc2('0x16')]===undefined?!![]:![]:!![],'where':_0x56388b['options']?_0x56388b[_0x4cc2('0x15')]['where']||null:null,'attributes':_0x56388b[_0x4cc2('0x15')]?_0x56388b[_0x4cc2('0x15')][_0x4cc2('0x17')]||null:null,'limit':_0x56388b[_0x4cc2('0x15')]?_0x56388b[_0x4cc2('0x15')][_0x4cc2('0x18')]||null:null,'include':_0x56388b[_0x4cc2('0x15')]?_0x56388b[_0x4cc2('0x15')][_0x4cc2('0x19')]?_[_0x4cc2('0x1a')](_0x56388b[_0x4cc2('0x15')]['include'],function(_0x33a40c){return{'model':db[_0x33a40c['model']],'as':_0x33a40c['as'],'attributes':_0x33a40c[_0x4cc2('0x17')],'include':_0x33a40c[_0x4cc2('0x19')]?_['map'](_0x33a40c[_0x4cc2('0x19')],function(_0x4eec55){return{'model':db[_0x4eec55[_0x4cc2('0x1b')]],'as':_0x4eec55['as'],'attributes':_0x4eec55[_0x4cc2('0x17')],'include':_0x4eec55[_0x4cc2('0x19')]?_[_0x4cc2('0x1a')](_0x4eec55[_0x4cc2('0x19')],function(_0x1e73b6){return{'model':db[_0x1e73b6[_0x4cc2('0x1b')]],'as':_0x1e73b6['as'],'attributes':_0x1e73b6[_0x4cc2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x419977){logger['info'](_0x4cc2('0x1c'),_0x56388b);logger[_0x4cc2('0xf')](_0x4cc2('0x1c'),_0x56388b,JSON[_0x4cc2('0x11')](_0x419977));_0x3334bb(_0x419977);})[_0x4cc2('0x1d')](function(_0x234c63){logger[_0x4cc2('0x12')]('GetSugarcrmAccount',_0x234c63['message'],_0x56388b);_0x6ce446(_0x3a6b97[_0x4cc2('0x12')](0x1f4,_0x234c63['message']));});});};exports[_0x4cc2('0x1e')]=function(_0x165c51){var _0x3938ee=this;return new Promise(function(_0x53dd41,_0x4ec9b9){return db[_0x4cc2('0x14')][_0x4cc2('0x1f')]({'raw':_0x165c51[_0x4cc2('0x15')]?_0x165c51[_0x4cc2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x165c51['options']?_0x165c51[_0x4cc2('0x15')][_0x4cc2('0x20')]||null:null,'attributes':_0x165c51[_0x4cc2('0x15')]?_0x165c51[_0x4cc2('0x15')]['attributes']||null:null,'include':_0x165c51['options']?_0x165c51['options'][_0x4cc2('0x19')]?_[_0x4cc2('0x1a')](_0x165c51['options'][_0x4cc2('0x19')],function(_0x646642){return{'model':db[_0x646642['model']],'as':_0x646642['as'],'attributes':_0x646642[_0x4cc2('0x17')],'include':_0x646642['include']?_['map'](_0x646642[_0x4cc2('0x19')],function(_0x573dc9){return{'model':db[_0x573dc9[_0x4cc2('0x1b')]],'as':_0x573dc9['as'],'attributes':_0x573dc9[_0x4cc2('0x17')],'include':_0x573dc9[_0x4cc2('0x19')]?_[_0x4cc2('0x1a')](_0x573dc9['include'],function(_0x1ac7c5){return{'model':db[_0x1ac7c5['model']],'as':_0x1ac7c5['as'],'attributes':_0x1ac7c5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x507668){logger[_0x4cc2('0xc')]('ShowSugarcrmAccount',_0x165c51);logger['debug']('ShowSugarcrmAccount',_0x165c51,JSON[_0x4cc2('0x11')](_0x507668));_0x53dd41(_0x507668);})[_0x4cc2('0x1d')](function(_0x42c373){logger[_0x4cc2('0x12')](_0x4cc2('0x1e'),_0x42c373[_0x4cc2('0x13')],_0x165c51);_0x4ec9b9(_0x3938ee['error'](0x1f4,_0x42c373[_0x4cc2('0x13')]));});});}; \ No newline at end of file +var _0x756b=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','map','include','model','catch','ShowSugarcrmAccount','find','raw','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x505df9,_0x22402b){var _0x35a622=function(_0x10504a){while(--_0x10504a){_0x505df9['push'](_0x505df9['shift']());}};_0x35a622(++_0x22402b);}(_0x756b,0x127));var _0xb756=function(_0x22af4e,_0x1cb6b8){_0x22af4e=_0x22af4e-0x0;var _0xb518e2=_0x756b[_0x22af4e];return _0xb518e2;};'use strict';var _=require(_0xb756('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb756('0x1'));var rs=require(_0xb756('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb756('0x3'));var logger=require(_0xb756('0x4'))('rpc');var config=require(_0xb756('0x5'));var jayson=require(_0xb756('0x6'));var client=jayson[_0xb756('0x7')][_0xb756('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ba137,_0x5827e9,_0x381abd){return new BPromise(function(_0x32deb9,_0x3f6b7e){return client[_0xb756('0x9')](_0x5ba137,_0x381abd)[_0xb756('0xa')](function(_0xa37c4a){logger[_0xb756('0xb')](_0xb756('0xc'),_0x5827e9,_0xb756('0xd'));logger[_0xb756('0xe')](_0xb756('0xf'),_0x5827e9,_0xb756('0xd'),JSON[_0xb756('0x10')](_0xa37c4a));if(_0xa37c4a[_0xb756('0x11')]){if(_0xa37c4a[_0xb756('0x11')][_0xb756('0x12')]===0x1f4){logger[_0xb756('0x11')](_0xb756('0xc'),_0x5827e9,_0xa37c4a[_0xb756('0x11')][_0xb756('0x13')]);return _0x3f6b7e(_0xa37c4a[_0xb756('0x11')][_0xb756('0x13')]);}logger[_0xb756('0x11')](_0xb756('0xc'),_0x5827e9,_0xa37c4a[_0xb756('0x11')][_0xb756('0x13')]);return _0x32deb9(_0xa37c4a[_0xb756('0x11')][_0xb756('0x13')]);}else{logger['info'](_0xb756('0xc'),_0x5827e9,'request\x20sent');_0x32deb9(_0xa37c4a[_0xb756('0x14')]['message']);}})['catch'](function(_0x1c909d){logger[_0xb756('0x11')](_0xb756('0xc'),_0x5827e9,_0x1c909d);_0x3f6b7e(_0x1c909d);});});}exports[_0xb756('0x15')]=function(_0xd2102d){var _0x2a5dec=this;return new Promise(function(_0x546315,_0x2c4e42){return db[_0xb756('0x16')][_0xb756('0x17')]({'raw':_0xd2102d[_0xb756('0x18')]?_0xd2102d['options']['raw']===undefined?!![]:![]:!![],'where':_0xd2102d['options']?_0xd2102d['options'][_0xb756('0x19')]||null:null,'attributes':_0xd2102d[_0xb756('0x18')]?_0xd2102d[_0xb756('0x18')][_0xb756('0x1a')]||null:null,'limit':_0xd2102d['options']?_0xd2102d[_0xb756('0x18')]['limit']||null:null,'include':_0xd2102d['options']?_0xd2102d[_0xb756('0x18')]['include']?_[_0xb756('0x1b')](_0xd2102d[_0xb756('0x18')][_0xb756('0x1c')],function(_0x10b5dc){return{'model':db[_0x10b5dc[_0xb756('0x1d')]],'as':_0x10b5dc['as'],'attributes':_0x10b5dc[_0xb756('0x1a')],'include':_0x10b5dc[_0xb756('0x1c')]?_[_0xb756('0x1b')](_0x10b5dc[_0xb756('0x1c')],function(_0x9d3ff){return{'model':db[_0x9d3ff[_0xb756('0x1d')]],'as':_0x9d3ff['as'],'attributes':_0x9d3ff[_0xb756('0x1a')],'include':_0x9d3ff[_0xb756('0x1c')]?_[_0xb756('0x1b')](_0x9d3ff['include'],function(_0x1ebcc0){return{'model':db[_0x1ebcc0['model']],'as':_0x1ebcc0['as'],'attributes':_0x1ebcc0[_0xb756('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb756('0xa')](function(_0x3e69a1){logger[_0xb756('0xb')]('GetSugarcrmAccount',_0xd2102d);logger[_0xb756('0xe')](_0xb756('0x15'),_0xd2102d,JSON[_0xb756('0x10')](_0x3e69a1));_0x546315(_0x3e69a1);})[_0xb756('0x1e')](function(_0x3a7c97){logger[_0xb756('0x11')](_0xb756('0x15'),_0x3a7c97['message'],_0xd2102d);_0x2c4e42(_0x2a5dec[_0xb756('0x11')](0x1f4,_0x3a7c97['message']));});});};exports[_0xb756('0x1f')]=function(_0x30898b){var _0x1165f9=this;return new Promise(function(_0x9daaef,_0x36c959){return db[_0xb756('0x16')][_0xb756('0x20')]({'raw':_0x30898b[_0xb756('0x18')]?_0x30898b['options'][_0xb756('0x21')]===undefined?!![]:![]:!![],'where':_0x30898b[_0xb756('0x18')]?_0x30898b['options'][_0xb756('0x19')]||null:null,'attributes':_0x30898b['options']?_0x30898b[_0xb756('0x18')][_0xb756('0x1a')]||null:null,'include':_0x30898b['options']?_0x30898b[_0xb756('0x18')][_0xb756('0x1c')]?_[_0xb756('0x1b')](_0x30898b[_0xb756('0x18')][_0xb756('0x1c')],function(_0x537a29){return{'model':db[_0x537a29[_0xb756('0x1d')]],'as':_0x537a29['as'],'attributes':_0x537a29[_0xb756('0x1a')],'include':_0x537a29[_0xb756('0x1c')]?_[_0xb756('0x1b')](_0x537a29[_0xb756('0x1c')],function(_0x55a82d){return{'model':db[_0x55a82d[_0xb756('0x1d')]],'as':_0x55a82d['as'],'attributes':_0x55a82d[_0xb756('0x1a')],'include':_0x55a82d[_0xb756('0x1c')]?_[_0xb756('0x1b')](_0x55a82d['include'],function(_0x2c862d){return{'model':db[_0x2c862d[_0xb756('0x1d')]],'as':_0x2c862d['as'],'attributes':_0x2c862d[_0xb756('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb756('0xa')](function(_0x182bbc){logger[_0xb756('0xb')](_0xb756('0x1f'),_0x30898b);logger[_0xb756('0xe')](_0xb756('0x1f'),_0x30898b,JSON[_0xb756('0x10')](_0x182bbc));_0x9daaef(_0x182bbc);})[_0xb756('0x1e')](function(_0x1dea7a){logger['error']('ShowSugarcrmAccount',_0x1dea7a[_0xb756('0x13')],_0x30898b);_0x36c959(_0x1165f9[_0xb756('0x11')](0x1f4,_0x1dea7a[_0xb756('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9b76be2..e12c230 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 _0x8ed2=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','isAuthenticated'];(function(_0x2806f6,_0x294105){var _0x32ebb1=function(_0x5e875d){while(--_0x5e875d){_0x2806f6['push'](_0x2806f6['shift']());}};_0x32ebb1(++_0x294105);}(_0x8ed2,0x1da));var _0x28ed=function(_0x1fe556,_0x3df54b){_0x1fe556=_0x1fe556-0x0;var _0x362598=_0x8ed2[_0x1fe556];return _0x362598;};'use strict';var multer=require('multer');var util=require(_0x28ed('0x0'));var path=require(_0x28ed('0x1'));var timeout=require(_0x28ed('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x28ed('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x28ed('0x4'));var config=require(_0x28ed('0x5'));var controller=require(_0x28ed('0x6'));router[_0x28ed('0x7')]('/',auth['isAuthenticated'](),controller[_0x28ed('0x8')]);router[_0x28ed('0x7')]('/:id',auth[_0x28ed('0x9')](),controller[_0x28ed('0xa')]);router[_0x28ed('0x7')](_0x28ed('0xb'),auth['isAuthenticated'](),controller[_0x28ed('0xc')]);router[_0x28ed('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x28ed('0xd')]);router['get'](_0x28ed('0xe'),auth[_0x28ed('0x9')](),controller['getDescriptions']);router[_0x28ed('0xf')]('/',auth['isAuthenticated'](),controller[_0x28ed('0x10')]);router[_0x28ed('0x11')]('/:id',auth[_0x28ed('0x9')](),controller[_0x28ed('0x12')]);router['delete'](_0x28ed('0x13'),auth[_0x28ed('0x9')](),controller[_0x28ed('0x14')]);module[_0x28ed('0x15')]=router; \ No newline at end of file +var _0x8f0f=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy'];(function(_0x55ea7e,_0x37e6fc){var _0x56f21c=function(_0x211bf9){while(--_0x211bf9){_0x55ea7e['push'](_0x55ea7e['shift']());}};_0x56f21c(++_0x37e6fc);}(_0x8f0f,0x19f));var _0xf8f0=function(_0x42d736,_0x44a2ce){_0x42d736=_0x42d736-0x0;var _0x40dd29=_0x8f0f[_0x42d736];return _0x40dd29;};'use strict';var multer=require(_0xf8f0('0x0'));var util=require(_0xf8f0('0x1'));var path=require(_0xf8f0('0x2'));var timeout=require(_0xf8f0('0x3'));var express=require('express');var router=express[_0xf8f0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf8f0('0x5'));var interaction=require(_0xf8f0('0x6'));var config=require(_0xf8f0('0x7'));var controller=require(_0xf8f0('0x8'));router[_0xf8f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf8f0('0x9')](_0xf8f0('0xa'),auth[_0xf8f0('0xb')](),controller['show']);router[_0xf8f0('0x9')](_0xf8f0('0xc'),auth['isAuthenticated'](),controller[_0xf8f0('0xd')]);router[_0xf8f0('0x9')](_0xf8f0('0xe'),auth['isAuthenticated'](),controller[_0xf8f0('0xf')]);router[_0xf8f0('0x9')](_0xf8f0('0x10'),auth[_0xf8f0('0xb')](),controller[_0xf8f0('0x11')]);router[_0xf8f0('0x12')]('/',auth[_0xf8f0('0xb')](),controller[_0xf8f0('0x13')]);router[_0xf8f0('0x14')](_0xf8f0('0xa'),auth[_0xf8f0('0xb')](),controller['update']);router['delete'](_0xf8f0('0xa'),auth[_0xf8f0('0xb')](),controller[_0xf8f0('0x15')]);module[_0xf8f0('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 ea884ed..4a1ec30 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 _0x45eb=['STRING','sequelize'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x45eb,0x159));var _0xb45e=function(_0xcdf822,_0x9baffe){_0xcdf822=_0xcdf822-0x0;var _0x28fe0e=_0x45eb[_0xcdf822];return _0x28fe0e;};'use strict';var Sequelize=require(_0xb45e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb45e('0x1')]}}; \ No newline at end of file +var _0x29f2=['sequelize','exports','STRING'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x29f2,0x19e));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x229f('0x0'));module[_0x229f('0x1')]={'name':{'type':Sequelize[_0x229f('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 c1caedf..19ef81b 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 _0x6722=['sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order'];(function(_0x55e3d9,_0x29c5c4){var _0x2b16c8=function(_0xf6c00f){while(--_0xf6c00f){_0x55e3d9['push'](_0x55e3d9['shift']());}};_0x2b16c8(++_0x29c5c4);}(_0x6722,0x108));var _0x2672=function(_0x5cfdad,_0x1864ca){_0x5cfdad=_0x5cfdad-0x0;var _0x485874=_0x6722[_0x5cfdad];return _0x485874;};'use strict';var emlformat=require(_0x2672('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2672('0x1'));var jsonpatch=require(_0x2672('0x2'));var rp=require(_0x2672('0x3'));var moment=require(_0x2672('0x4'));var BPromise=require(_0x2672('0x5'));var Mustache=require(_0x2672('0x6'));var util=require(_0x2672('0x7'));var path=require(_0x2672('0x8'));var sox=require(_0x2672('0x9'));var csv=require(_0x2672('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2672('0xb'));var _=require(_0x2672('0xc'));var squel=require('squel');var crypto=require(_0x2672('0xd'));var jsforce=require(_0x2672('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2672('0xa'));var querystring=require('querystring');var Papa=require(_0x2672('0xf'));var Redis=require(_0x2672('0x10'));var authService=require(_0x2672('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2672('0x12'))(_0x2672('0x13'));var utils=require('../../config/utils');var config=require(_0x2672('0x14'));var licenseUtil=require(_0x2672('0x15'));var db=require(_0x2672('0x16'))['db'];function respondWithStatusCode(_0xcf6597,_0x304a49){_0x304a49=_0x304a49||0xcc;return function(_0x260f29){if(_0x260f29){return _0xcf6597[_0x2672('0x17')](_0x304a49);}return _0xcf6597[_0x2672('0x18')](_0x304a49)[_0x2672('0x19')]();};}function respondWithResult(_0x482df8,_0x273630){_0x273630=_0x273630||0xc8;return function(_0x22a9d1){if(_0x22a9d1){return _0x482df8[_0x2672('0x18')](_0x273630)['json'](_0x22a9d1);}};}function respondWithFilteredResult(_0x1738e2,_0x182e5e){return function(_0x1a425a){if(_0x1a425a){var _0x28fb89=typeof _0x182e5e[_0x2672('0x1a')]===_0x2672('0x1b')&&typeof _0x182e5e[_0x2672('0x1c')]==='undefined';var _0x4b242f=_0x1a425a[_0x2672('0x1d')];var _0x385647=_0x28fb89?0x0:_0x182e5e['offset'];var _0x3a57eb=_0x28fb89?_0x1a425a[_0x2672('0x1d')]:_0x182e5e[_0x2672('0x1a')]+_0x182e5e[_0x2672('0x1c')];var _0x583f8b;if(_0x3a57eb>=_0x4b242f){_0x3a57eb=_0x4b242f;_0x583f8b=0xc8;}else{_0x583f8b=0xce;}_0x1738e2[_0x2672('0x18')](_0x583f8b);return _0x1738e2[_0x2672('0x1e')](_0x2672('0x1f'),_0x385647+'-'+_0x3a57eb+'/'+_0x4b242f)[_0x2672('0x20')](_0x1a425a);}return null;};}function patchUpdates(_0x52d08e){return function(_0xc1f627){try{jsonpatch['apply'](_0xc1f627,_0x52d08e,!![]);}catch(_0x4fed73){return BPromise[_0x2672('0x21')](_0x4fed73);}return _0xc1f627[_0x2672('0x22')]();};}function saveUpdates(_0xd33ebd,_0x419d2f){return function(_0x225bdf){if(_0x225bdf){return _0x225bdf[_0x2672('0x23')](_0xd33ebd)['then'](function(_0xf990a9){return _0xf990a9;});}return null;};}function removeEntity(_0x43a7b1,_0x98461f){return function(_0x291902){if(_0x291902){return _0x291902[_0x2672('0x24')]()[_0x2672('0x25')](function(){_0x43a7b1[_0x2672('0x18')](0xcc)[_0x2672('0x19')]();});}};}function handleEntityNotFound(_0x314211,_0x58a620){return function(_0xafc094){if(!_0xafc094){_0x314211['sendStatus'](0x194);}return _0xafc094;};}function handleError(_0x13fda8,_0x4de834){_0x4de834=_0x4de834||0x1f4;return function(_0x11999b){logger[_0x2672('0x26')](_0x11999b[_0x2672('0x27')]);if(_0x11999b[_0x2672('0x28')]){delete _0x11999b[_0x2672('0x28')];}_0x13fda8['status'](_0x4de834)['send'](_0x11999b);};}exports[_0x2672('0x29')]=function(_0x33a4b3,_0x3f7439){var _0x71fe33={},_0x2983b4={},_0x100502={'count':0x0,'rows':[]};var _0x5b4fde=_[_0x2672('0x2a')](db[_0x2672('0x2b')][_0x2672('0x2c')],function(_0x499145){return{'name':_0x499145['fieldName'],'type':_0x499145[_0x2672('0x2d')][_0x2672('0x2e')]};});_0x2983b4[_0x2672('0x2f')]=_['map'](_0x5b4fde,_0x2672('0x28'));_0x2983b4['query']=_[_0x2672('0x30')](_0x33a4b3[_0x2672('0x31')]);_0x2983b4['filters']=_[_0x2672('0x32')](_0x2983b4[_0x2672('0x2f')],_0x2983b4[_0x2672('0x31')]);_0x71fe33[_0x2672('0x33')]=_[_0x2672('0x32')](_0x2983b4[_0x2672('0x2f')],qs[_0x2672('0x34')](_0x33a4b3['query']['fields']));_0x71fe33[_0x2672('0x33')]=_0x71fe33['attributes'][_0x2672('0x35')]?_0x71fe33[_0x2672('0x33')]:_0x2983b4[_0x2672('0x2f')];if(!_0x33a4b3[_0x2672('0x31')]['hasOwnProperty'](_0x2672('0x36'))){_0x71fe33['limit']=qs['limit'](_0x33a4b3['query'][_0x2672('0x1c')]);_0x71fe33[_0x2672('0x1a')]=qs[_0x2672('0x1a')](_0x33a4b3[_0x2672('0x31')][_0x2672('0x1a')]);}_0x71fe33[_0x2672('0x37')]=qs['sort'](_0x33a4b3['query'][_0x2672('0x38')]);_0x71fe33['where']=qs[_0x2672('0x39')](_[_0x2672('0x3a')](_0x33a4b3[_0x2672('0x31')],_0x2983b4[_0x2672('0x39')]),_0x5b4fde);if(_0x33a4b3[_0x2672('0x31')][_0x2672('0x3b')]){_0x71fe33[_0x2672('0x3c')]=_[_0x2672('0x3d')](_0x71fe33[_0x2672('0x3c')],{'$or':_[_0x2672('0x2a')](_0x5b4fde,function(_0x5551f6){if(_0x5551f6[_0x2672('0x2d')]!==_0x2672('0x3e')){var _0xcef96={};_0xcef96[_0x5551f6[_0x2672('0x28')]]={'$like':'%'+_0x33a4b3[_0x2672('0x31')][_0x2672('0x3b')]+'%'};return _0xcef96;}})});}_0x71fe33=_[_0x2672('0x3d')]({},_0x71fe33,_0x33a4b3[_0x2672('0x3f')]);var _0xa2fccd={'where':_0x71fe33[_0x2672('0x3c')]};return db[_0x2672('0x2b')]['count'](_0xa2fccd)[_0x2672('0x25')](function(_0x599eb7){_0x100502['count']=_0x599eb7;if(_0x33a4b3[_0x2672('0x31')]['includeAll']){_0x71fe33[_0x2672('0x40')]=[{'all':!![]}];}return db[_0x2672('0x2b')][_0x2672('0x41')](_0x71fe33);})['then'](function(_0x562b3a){_0x100502[_0x2672('0x42')]=_0x562b3a;return _0x100502;})[_0x2672('0x25')](respondWithFilteredResult(_0x3f7439,_0x71fe33))[_0x2672('0x43')](handleError(_0x3f7439,null));};exports[_0x2672('0x44')]=function(_0x2d9894,_0x479d38){var _0x14ec95={'raw':![],'where':{'id':_0x2d9894['params']['id']}},_0x102f43={};_0x102f43[_0x2672('0x2f')]=_['keys'](db[_0x2672('0x2b')][_0x2672('0x2c')]);_0x102f43[_0x2672('0x31')]=_['keys'](_0x2d9894['query']);_0x102f43[_0x2672('0x39')]=_[_0x2672('0x32')](_0x102f43['model'],_0x102f43[_0x2672('0x31')]);_0x14ec95[_0x2672('0x33')]=_[_0x2672('0x32')](_0x102f43[_0x2672('0x2f')],qs['fields'](_0x2d9894['query'][_0x2672('0x34')]));_0x14ec95[_0x2672('0x33')]=_0x14ec95[_0x2672('0x33')][_0x2672('0x35')]?_0x14ec95[_0x2672('0x33')]:_0x102f43[_0x2672('0x2f')];if(_0x2d9894[_0x2672('0x31')][_0x2672('0x45')]){_0x14ec95['include']=[{'all':!![]}];}_0x14ec95=_[_0x2672('0x3d')]({},_0x14ec95,_0x2d9894[_0x2672('0x3f')]);return db['SugarcrmConfiguration']['find'](_0x14ec95)[_0x2672('0x25')](handleEntityNotFound(_0x479d38,null))['then'](respondWithResult(_0x479d38,null))['catch'](handleError(_0x479d38,null));};exports[_0x2672('0x46')]=function(_0x471f11,_0x5a2d44){return db[_0x2672('0x2b')][_0x2672('0x46')](_0x471f11['body'],{})[_0x2672('0x25')](respondWithResult(_0x5a2d44,0xc9))[_0x2672('0x43')](handleError(_0x5a2d44,null));};exports[_0x2672('0x23')]=function(_0xee2ebe,_0x51bc8a){if(_0xee2ebe[_0x2672('0x47')]['id']){delete _0xee2ebe[_0x2672('0x47')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0xee2ebe[_0x2672('0x48')]['id']}})[_0x2672('0x25')](handleEntityNotFound(_0x51bc8a,null))['then'](saveUpdates(_0xee2ebe[_0x2672('0x47')],null))[_0x2672('0x25')](respondWithResult(_0x51bc8a,null))[_0x2672('0x43')](handleError(_0x51bc8a,null));};exports[_0x2672('0x24')]=function(_0x614cf6,_0xce7368){return db[_0x2672('0x2b')][_0x2672('0x49')]({'where':{'id':_0x614cf6[_0x2672('0x48')]['id']}})[_0x2672('0x25')](handleEntityNotFound(_0xce7368,null))[_0x2672('0x25')](removeEntity(_0xce7368,null))['catch'](handleError(_0xce7368,null));};exports[_0x2672('0x4a')]=function(_0x1d6d01,_0x4d13bc,_0x3fd836){var _0x446ca6={};var _0x491351={};var _0x40de31;var _0x34ff5c;return db[_0x2672('0x2b')][_0x2672('0x4b')]({'where':{'id':_0x1d6d01[_0x2672('0x48')]['id']}})[_0x2672('0x25')](handleEntityNotFound(_0x4d13bc,null))[_0x2672('0x25')](function(_0x5902b8){if(_0x5902b8){_0x40de31=_0x5902b8;_0x491351[_0x2672('0x2f')]=_[_0x2672('0x30')](db[_0x2672('0x4c')]['rawAttributes']);_0x491351[_0x2672('0x31')]=_[_0x2672('0x30')](_0x1d6d01[_0x2672('0x31')]);_0x491351[_0x2672('0x39')]=_['intersection'](_0x491351[_0x2672('0x2f')],_0x491351[_0x2672('0x31')]);_0x446ca6[_0x2672('0x33')]=_[_0x2672('0x32')](_0x491351[_0x2672('0x2f')],qs[_0x2672('0x34')](_0x1d6d01[_0x2672('0x31')][_0x2672('0x34')]));_0x446ca6['attributes']=_0x446ca6[_0x2672('0x33')][_0x2672('0x35')]?_0x446ca6[_0x2672('0x33')]:_0x491351[_0x2672('0x2f')];_0x446ca6[_0x2672('0x37')]=qs[_0x2672('0x38')](_0x1d6d01[_0x2672('0x31')][_0x2672('0x38')]);_0x446ca6[_0x2672('0x3c')]=qs[_0x2672('0x39')](_[_0x2672('0x3a')](_0x1d6d01['query'],_0x491351[_0x2672('0x39')]));if(_0x1d6d01[_0x2672('0x31')]['filter']){_0x446ca6[_0x2672('0x3c')]=_['merge'](_0x446ca6['where'],{'$or':_[_0x2672('0x2a')](_0x446ca6[_0x2672('0x33')],function(_0x230fee){var _0x50e40d={};_0x50e40d[_0x230fee]={'$like':'%'+_0x1d6d01[_0x2672('0x31')][_0x2672('0x3b')]+'%'};return _0x50e40d;})});}_0x446ca6=_[_0x2672('0x3d')]({},_0x446ca6,_0x1d6d01[_0x2672('0x3f')]);return _0x40de31['getFields'](_0x446ca6);}})[_0x2672('0x25')](function(_0x49eb53){if(_0x49eb53){_0x34ff5c=_0x49eb53['length'];if(!_0x1d6d01[_0x2672('0x31')][_0x2672('0x4d')](_0x2672('0x36'))){_0x446ca6[_0x2672('0x1c')]=qs[_0x2672('0x1c')](_0x1d6d01[_0x2672('0x31')][_0x2672('0x1c')]);_0x446ca6[_0x2672('0x1a')]=qs[_0x2672('0x1a')](_0x1d6d01['query'][_0x2672('0x1a')]);}return _0x40de31['getFields'](_0x446ca6);}})[_0x2672('0x25')](function(_0x1d5dc5){if(_0x1d5dc5){return _0x1d5dc5?{'count':_0x34ff5c,'rows':_0x1d5dc5}:null;}})[_0x2672('0x25')](respondWithResult(_0x4d13bc,null))[_0x2672('0x43')](handleError(_0x4d13bc,null));};exports[_0x2672('0x4e')]=function(_0x121c61,_0xf7465b,_0xd5155e){var _0x4dd545={};var _0x2055ee={};var _0x2fa42b;var _0x2b353f;return db[_0x2672('0x2b')][_0x2672('0x4b')]({'where':{'id':_0x121c61[_0x2672('0x48')]['id']}})[_0x2672('0x25')](handleEntityNotFound(_0xf7465b,null))['then'](function(_0x1ff91d){if(_0x1ff91d){_0x2fa42b=_0x1ff91d;_0x2055ee[_0x2672('0x2f')]=_[_0x2672('0x30')](db[_0x2672('0x4c')][_0x2672('0x2c')]);_0x2055ee['query']=_[_0x2672('0x30')](_0x121c61[_0x2672('0x31')]);_0x2055ee[_0x2672('0x39')]=_[_0x2672('0x32')](_0x2055ee[_0x2672('0x2f')],_0x2055ee['query']);_0x4dd545['attributes']=_[_0x2672('0x32')](_0x2055ee[_0x2672('0x2f')],qs[_0x2672('0x34')](_0x121c61[_0x2672('0x31')][_0x2672('0x34')]));_0x4dd545[_0x2672('0x33')]=_0x4dd545[_0x2672('0x33')][_0x2672('0x35')]?_0x4dd545['attributes']:_0x2055ee[_0x2672('0x2f')];_0x4dd545[_0x2672('0x37')]=qs[_0x2672('0x38')](_0x121c61[_0x2672('0x31')]['sort']);_0x4dd545[_0x2672('0x3c')]=qs['filters'](_[_0x2672('0x3a')](_0x121c61[_0x2672('0x31')],_0x2055ee['filters']));if(_0x121c61[_0x2672('0x31')][_0x2672('0x3b')]){_0x4dd545[_0x2672('0x3c')]=_['merge'](_0x4dd545[_0x2672('0x3c')],{'$or':_['map'](_0x4dd545[_0x2672('0x33')],function(_0x1c9e22){var _0x3d9f1f={};_0x3d9f1f[_0x1c9e22]={'$like':'%'+_0x121c61['query'][_0x2672('0x3b')]+'%'};return _0x3d9f1f;})});}_0x4dd545=_['merge']({},_0x4dd545,_0x121c61[_0x2672('0x3f')]);return _0x2fa42b['getSubjects'](_0x4dd545);}})[_0x2672('0x25')](function(_0x4c4ffc){if(_0x4c4ffc){_0x2b353f=_0x4c4ffc[_0x2672('0x35')];if(!_0x121c61[_0x2672('0x31')][_0x2672('0x4d')](_0x2672('0x36'))){_0x4dd545['limit']=qs['limit'](_0x121c61[_0x2672('0x31')][_0x2672('0x1c')]);_0x4dd545[_0x2672('0x1a')]=qs['offset'](_0x121c61[_0x2672('0x31')][_0x2672('0x1a')]);}return _0x2fa42b['getSubjects'](_0x4dd545);}})['then'](function(_0x789101){if(_0x789101){return _0x789101?{'count':_0x2b353f,'rows':_0x789101}:null;}})[_0x2672('0x25')](respondWithResult(_0xf7465b,null))[_0x2672('0x43')](handleError(_0xf7465b,null));};exports[_0x2672('0x4f')]=function(_0x2f472c,_0x34839a,_0x5dabe7){var _0x3fc3a3={};var _0x4d8812={};var _0x4b347d;var _0x197c82;return db[_0x2672('0x2b')][_0x2672('0x4b')]({'where':{'id':_0x2f472c[_0x2672('0x48')]['id']}})[_0x2672('0x25')](handleEntityNotFound(_0x34839a,null))[_0x2672('0x25')](function(_0xe86ad4){if(_0xe86ad4){_0x4b347d=_0xe86ad4;_0x4d8812['model']=_[_0x2672('0x30')](db['SugarcrmField'][_0x2672('0x2c')]);_0x4d8812[_0x2672('0x31')]=_[_0x2672('0x30')](_0x2f472c[_0x2672('0x31')]);_0x4d8812['filters']=_['intersection'](_0x4d8812[_0x2672('0x2f')],_0x4d8812[_0x2672('0x31')]);_0x3fc3a3[_0x2672('0x33')]=_['intersection'](_0x4d8812['model'],qs[_0x2672('0x34')](_0x2f472c['query'][_0x2672('0x34')]));_0x3fc3a3[_0x2672('0x33')]=_0x3fc3a3['attributes'][_0x2672('0x35')]?_0x3fc3a3[_0x2672('0x33')]:_0x4d8812[_0x2672('0x2f')];_0x3fc3a3[_0x2672('0x37')]=qs['sort'](_0x2f472c[_0x2672('0x31')][_0x2672('0x38')]);_0x3fc3a3[_0x2672('0x3c')]=qs[_0x2672('0x39')](_[_0x2672('0x3a')](_0x2f472c[_0x2672('0x31')],_0x4d8812[_0x2672('0x39')]));if(_0x2f472c[_0x2672('0x31')][_0x2672('0x3b')]){_0x3fc3a3[_0x2672('0x3c')]=_[_0x2672('0x3d')](_0x3fc3a3[_0x2672('0x3c')],{'$or':_[_0x2672('0x2a')](_0x3fc3a3[_0x2672('0x33')],function(_0x50d158){var _0x252238={};_0x252238[_0x50d158]={'$like':'%'+_0x2f472c['query'][_0x2672('0x3b')]+'%'};return _0x252238;})});}_0x3fc3a3=_[_0x2672('0x3d')]({},_0x3fc3a3,_0x2f472c[_0x2672('0x3f')]);return _0x4b347d['getDescriptions'](_0x3fc3a3);}})[_0x2672('0x25')](function(_0x14a2b3){if(_0x14a2b3){_0x197c82=_0x14a2b3[_0x2672('0x35')];if(!_0x2f472c['query'][_0x2672('0x4d')]('nolimit')){_0x3fc3a3[_0x2672('0x1c')]=qs[_0x2672('0x1c')](_0x2f472c[_0x2672('0x31')][_0x2672('0x1c')]);_0x3fc3a3['offset']=qs[_0x2672('0x1a')](_0x2f472c[_0x2672('0x31')]['offset']);}return _0x4b347d[_0x2672('0x4f')](_0x3fc3a3);}})[_0x2672('0x25')](function(_0xb0914d){if(_0xb0914d){return _0xb0914d?{'count':_0x197c82,'rows':_0xb0914d}:null;}})['then'](respondWithResult(_0x34839a,null))[_0x2672('0x43')](handleError(_0x34839a,null));}; \ No newline at end of file +var _0xbcfe=['count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','SugarcrmConfiguration','find','create','body','destroy','getFields','findOne','SugarcrmField','getSubjects','order','filter','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xbcfe,0x89));var _0xebcf=function(_0x4e5191,_0x172ea5){_0x4e5191=_0x4e5191-0x0;var _0x4a51bb=_0xbcfe[_0x4e5191];return _0x4a51bb;};'use strict';var emlformat=require(_0xebcf('0x0'));var rimraf=require(_0xebcf('0x1'));var zipdir=require(_0xebcf('0x2'));var jsonpatch=require(_0xebcf('0x3'));var rp=require(_0xebcf('0x4'));var moment=require(_0xebcf('0x5'));var BPromise=require(_0xebcf('0x6'));var Mustache=require(_0xebcf('0x7'));var util=require(_0xebcf('0x8'));var path=require(_0xebcf('0x9'));var sox=require(_0xebcf('0xa'));var csv=require(_0xebcf('0xb'));var ejs=require(_0xebcf('0xc'));var fs=require('fs');var fs_extra=require(_0xebcf('0xd'));var _=require(_0xebcf('0xe'));var squel=require(_0xebcf('0xf'));var crypto=require(_0xebcf('0x10'));var jsforce=require(_0xebcf('0x11'));var deskjs=require(_0xebcf('0x12'));var toCsv=require(_0xebcf('0xb'));var querystring=require(_0xebcf('0x13'));var Papa=require(_0xebcf('0x14'));var Redis=require(_0xebcf('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xebcf('0x16'));var hardwareService=require(_0xebcf('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xebcf('0x18'));var licenseUtil=require(_0xebcf('0x19'));var db=require(_0xebcf('0x1a'))['db'];function respondWithStatusCode(_0x4bd5cc,_0x423bd6){_0x423bd6=_0x423bd6||0xcc;return function(_0x39a759){if(_0x39a759){return _0x4bd5cc['sendStatus'](_0x423bd6);}return _0x4bd5cc[_0xebcf('0x1b')](_0x423bd6)[_0xebcf('0x1c')]();};}function respondWithResult(_0x18e5a8,_0x45b141){_0x45b141=_0x45b141||0xc8;return function(_0x3986ee){if(_0x3986ee){return _0x18e5a8['status'](_0x45b141)[_0xebcf('0x1d')](_0x3986ee);}};}function respondWithFilteredResult(_0x27da7e,_0x4f4f2a){return function(_0x1010d4){if(_0x1010d4){var _0x529bc9=typeof _0x4f4f2a[_0xebcf('0x1e')]===_0xebcf('0x1f')&&typeof _0x4f4f2a[_0xebcf('0x20')]===_0xebcf('0x1f');var _0x2ef25b=_0x1010d4[_0xebcf('0x21')];var _0x57b469=_0x529bc9?0x0:_0x4f4f2a[_0xebcf('0x1e')];var _0x22eac2=_0x529bc9?_0x1010d4[_0xebcf('0x21')]:_0x4f4f2a['offset']+_0x4f4f2a[_0xebcf('0x20')];var _0x1a5163;if(_0x22eac2>=_0x2ef25b){_0x22eac2=_0x2ef25b;_0x1a5163=0xc8;}else{_0x1a5163=0xce;}_0x27da7e[_0xebcf('0x1b')](_0x1a5163);return _0x27da7e[_0xebcf('0x22')](_0xebcf('0x23'),_0x57b469+'-'+_0x22eac2+'/'+_0x2ef25b)['json'](_0x1010d4);}return null;};}function patchUpdates(_0x251c96){return function(_0x3e4660){try{jsonpatch[_0xebcf('0x24')](_0x3e4660,_0x251c96,!![]);}catch(_0x37819a){return BPromise[_0xebcf('0x25')](_0x37819a);}return _0x3e4660[_0xebcf('0x26')]();};}function saveUpdates(_0x315aab,_0x339378){return function(_0x473ac5){if(_0x473ac5){return _0x473ac5[_0xebcf('0x27')](_0x315aab)[_0xebcf('0x28')](function(_0x5a6c70){return _0x5a6c70;});}return null;};}function removeEntity(_0x32459a,_0x1983b4){return function(_0x438be1){if(_0x438be1){return _0x438be1['destroy']()['then'](function(){_0x32459a[_0xebcf('0x1b')](0xcc)[_0xebcf('0x1c')]();});}};}function handleEntityNotFound(_0x36b327,_0x1877f4){return function(_0x1feccb){if(!_0x1feccb){_0x36b327[_0xebcf('0x29')](0x194);}return _0x1feccb;};}function handleError(_0x542ee8,_0x349b1b){_0x349b1b=_0x349b1b||0x1f4;return function(_0x29677b){logger[_0xebcf('0x2a')](_0x29677b[_0xebcf('0x2b')]);if(_0x29677b[_0xebcf('0x2c')]){delete _0x29677b['name'];}_0x542ee8[_0xebcf('0x1b')](_0x349b1b)['send'](_0x29677b);};}exports[_0xebcf('0x2d')]=function(_0x130790,_0x20c9cb){var _0xedb6ea={},_0x3bcb00={},_0x4511da={'count':0x0,'rows':[]};var _0x540bad=_[_0xebcf('0x2e')](db['SugarcrmConfiguration'][_0xebcf('0x2f')],function(_0x24964a){return{'name':_0x24964a[_0xebcf('0x30')],'type':_0x24964a['type'][_0xebcf('0x31')]};});_0x3bcb00['model']=_[_0xebcf('0x2e')](_0x540bad,_0xebcf('0x2c'));_0x3bcb00[_0xebcf('0x32')]=_[_0xebcf('0x33')](_0x130790[_0xebcf('0x32')]);_0x3bcb00[_0xebcf('0x34')]=_[_0xebcf('0x35')](_0x3bcb00[_0xebcf('0x36')],_0x3bcb00['query']);_0xedb6ea[_0xebcf('0x37')]=_['intersection'](_0x3bcb00[_0xebcf('0x36')],qs[_0xebcf('0x38')](_0x130790[_0xebcf('0x32')][_0xebcf('0x38')]));_0xedb6ea[_0xebcf('0x37')]=_0xedb6ea[_0xebcf('0x37')][_0xebcf('0x39')]?_0xedb6ea[_0xebcf('0x37')]:_0x3bcb00[_0xebcf('0x36')];if(!_0x130790[_0xebcf('0x32')][_0xebcf('0x3a')](_0xebcf('0x3b'))){_0xedb6ea['limit']=qs[_0xebcf('0x20')](_0x130790[_0xebcf('0x32')][_0xebcf('0x20')]);_0xedb6ea[_0xebcf('0x1e')]=qs[_0xebcf('0x1e')](_0x130790['query'][_0xebcf('0x1e')]);}_0xedb6ea['order']=qs[_0xebcf('0x3c')](_0x130790[_0xebcf('0x32')]['sort']);_0xedb6ea['where']=qs[_0xebcf('0x34')](_[_0xebcf('0x3d')](_0x130790[_0xebcf('0x32')],_0x3bcb00[_0xebcf('0x34')]),_0x540bad);if(_0x130790['query']['filter']){_0xedb6ea['where']=_[_0xebcf('0x3e')](_0xedb6ea[_0xebcf('0x3f')],{'$or':_['map'](_0x540bad,function(_0x276b4c){if(_0x276b4c[_0xebcf('0x40')]!==_0xebcf('0x41')){var _0x271773={};_0x271773[_0x276b4c[_0xebcf('0x2c')]]={'$like':'%'+_0x130790[_0xebcf('0x32')]['filter']+'%'};return _0x271773;}})});}_0xedb6ea=_[_0xebcf('0x3e')]({},_0xedb6ea,_0x130790[_0xebcf('0x42')]);var _0x20d630={'where':_0xedb6ea[_0xebcf('0x3f')]};return db['SugarcrmConfiguration'][_0xebcf('0x21')](_0x20d630)['then'](function(_0xc7981d){_0x4511da[_0xebcf('0x21')]=_0xc7981d;if(_0x130790[_0xebcf('0x32')][_0xebcf('0x43')]){_0xedb6ea[_0xebcf('0x44')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xebcf('0x45')](_0xedb6ea);})[_0xebcf('0x28')](function(_0x50be1d){_0x4511da['rows']=_0x50be1d;return _0x4511da;})[_0xebcf('0x28')](respondWithFilteredResult(_0x20c9cb,_0xedb6ea))[_0xebcf('0x46')](handleError(_0x20c9cb,null));};exports[_0xebcf('0x47')]=function(_0x1f8c3c,_0x35df96){var _0x45213c={'raw':![],'where':{'id':_0x1f8c3c[_0xebcf('0x48')]['id']}},_0x255edc={};_0x255edc[_0xebcf('0x36')]=_[_0xebcf('0x33')](db[_0xebcf('0x49')][_0xebcf('0x2f')]);_0x255edc[_0xebcf('0x32')]=_[_0xebcf('0x33')](_0x1f8c3c[_0xebcf('0x32')]);_0x255edc[_0xebcf('0x34')]=_['intersection'](_0x255edc[_0xebcf('0x36')],_0x255edc[_0xebcf('0x32')]);_0x45213c[_0xebcf('0x37')]=_[_0xebcf('0x35')](_0x255edc[_0xebcf('0x36')],qs[_0xebcf('0x38')](_0x1f8c3c['query'][_0xebcf('0x38')]));_0x45213c[_0xebcf('0x37')]=_0x45213c[_0xebcf('0x37')]['length']?_0x45213c[_0xebcf('0x37')]:_0x255edc[_0xebcf('0x36')];if(_0x1f8c3c['query'][_0xebcf('0x43')]){_0x45213c[_0xebcf('0x44')]=[{'all':!![]}];}_0x45213c=_[_0xebcf('0x3e')]({},_0x45213c,_0x1f8c3c['options']);return db[_0xebcf('0x49')][_0xebcf('0x4a')](_0x45213c)['then'](handleEntityNotFound(_0x35df96,null))['then'](respondWithResult(_0x35df96,null))['catch'](handleError(_0x35df96,null));};exports[_0xebcf('0x4b')]=function(_0x527a77,_0x3b5937){return db[_0xebcf('0x49')][_0xebcf('0x4b')](_0x527a77[_0xebcf('0x4c')],{})['then'](respondWithResult(_0x3b5937,0xc9))[_0xebcf('0x46')](handleError(_0x3b5937,null));};exports[_0xebcf('0x27')]=function(_0x27be3d,_0x2033cb){if(_0x27be3d['body']['id']){delete _0x27be3d[_0xebcf('0x4c')]['id'];}return db['SugarcrmConfiguration'][_0xebcf('0x4a')]({'where':{'id':_0x27be3d[_0xebcf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2033cb,null))[_0xebcf('0x28')](saveUpdates(_0x27be3d[_0xebcf('0x4c')],null))[_0xebcf('0x28')](respondWithResult(_0x2033cb,null))[_0xebcf('0x46')](handleError(_0x2033cb,null));};exports[_0xebcf('0x4d')]=function(_0x2ed183,_0x4ddf91){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2ed183[_0xebcf('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ddf91,null))[_0xebcf('0x28')](removeEntity(_0x4ddf91,null))[_0xebcf('0x46')](handleError(_0x4ddf91,null));};exports[_0xebcf('0x4e')]=function(_0x5c9103,_0x48327f,_0x1ee2e0){var _0x35f4b1={};var _0x456058={};var _0x2589c7;var _0x19d1ab;return db[_0xebcf('0x49')][_0xebcf('0x4f')]({'where':{'id':_0x5c9103[_0xebcf('0x48')]['id']}})[_0xebcf('0x28')](handleEntityNotFound(_0x48327f,null))[_0xebcf('0x28')](function(_0x5bf79c){if(_0x5bf79c){_0x2589c7=_0x5bf79c;_0x456058[_0xebcf('0x36')]=_[_0xebcf('0x33')](db[_0xebcf('0x50')][_0xebcf('0x2f')]);_0x456058[_0xebcf('0x32')]=_[_0xebcf('0x33')](_0x5c9103[_0xebcf('0x32')]);_0x456058[_0xebcf('0x34')]=_[_0xebcf('0x35')](_0x456058[_0xebcf('0x36')],_0x456058[_0xebcf('0x32')]);_0x35f4b1[_0xebcf('0x37')]=_[_0xebcf('0x35')](_0x456058[_0xebcf('0x36')],qs[_0xebcf('0x38')](_0x5c9103['query'][_0xebcf('0x38')]));_0x35f4b1[_0xebcf('0x37')]=_0x35f4b1[_0xebcf('0x37')][_0xebcf('0x39')]?_0x35f4b1[_0xebcf('0x37')]:_0x456058[_0xebcf('0x36')];_0x35f4b1['order']=qs[_0xebcf('0x3c')](_0x5c9103[_0xebcf('0x32')][_0xebcf('0x3c')]);_0x35f4b1[_0xebcf('0x3f')]=qs['filters'](_[_0xebcf('0x3d')](_0x5c9103[_0xebcf('0x32')],_0x456058[_0xebcf('0x34')]));if(_0x5c9103[_0xebcf('0x32')]['filter']){_0x35f4b1[_0xebcf('0x3f')]=_['merge'](_0x35f4b1['where'],{'$or':_[_0xebcf('0x2e')](_0x35f4b1[_0xebcf('0x37')],function(_0x6bca1c){var _0x1f127d={};_0x1f127d[_0x6bca1c]={'$like':'%'+_0x5c9103[_0xebcf('0x32')]['filter']+'%'};return _0x1f127d;})});}_0x35f4b1=_[_0xebcf('0x3e')]({},_0x35f4b1,_0x5c9103[_0xebcf('0x42')]);return _0x2589c7[_0xebcf('0x4e')](_0x35f4b1);}})[_0xebcf('0x28')](function(_0x223586){if(_0x223586){_0x19d1ab=_0x223586['length'];if(!_0x5c9103['query'][_0xebcf('0x3a')](_0xebcf('0x3b'))){_0x35f4b1['limit']=qs[_0xebcf('0x20')](_0x5c9103[_0xebcf('0x32')]['limit']);_0x35f4b1[_0xebcf('0x1e')]=qs[_0xebcf('0x1e')](_0x5c9103[_0xebcf('0x32')]['offset']);}return _0x2589c7['getFields'](_0x35f4b1);}})['then'](function(_0x4d6933){if(_0x4d6933){return _0x4d6933?{'count':_0x19d1ab,'rows':_0x4d6933}:null;}})['then'](respondWithResult(_0x48327f,null))[_0xebcf('0x46')](handleError(_0x48327f,null));};exports[_0xebcf('0x51')]=function(_0x312ae2,_0x475ab7,_0xa09ec1){var _0x3adaab={};var _0x3055eb={};var _0x294be5;var _0xb8fb0a;return db[_0xebcf('0x49')]['findOne']({'where':{'id':_0x312ae2[_0xebcf('0x48')]['id']}})[_0xebcf('0x28')](handleEntityNotFound(_0x475ab7,null))[_0xebcf('0x28')](function(_0x16ca9e){if(_0x16ca9e){_0x294be5=_0x16ca9e;_0x3055eb[_0xebcf('0x36')]=_[_0xebcf('0x33')](db[_0xebcf('0x50')]['rawAttributes']);_0x3055eb[_0xebcf('0x32')]=_['keys'](_0x312ae2[_0xebcf('0x32')]);_0x3055eb[_0xebcf('0x34')]=_['intersection'](_0x3055eb[_0xebcf('0x36')],_0x3055eb['query']);_0x3adaab[_0xebcf('0x37')]=_['intersection'](_0x3055eb[_0xebcf('0x36')],qs[_0xebcf('0x38')](_0x312ae2['query'][_0xebcf('0x38')]));_0x3adaab[_0xebcf('0x37')]=_0x3adaab['attributes'][_0xebcf('0x39')]?_0x3adaab[_0xebcf('0x37')]:_0x3055eb[_0xebcf('0x36')];_0x3adaab[_0xebcf('0x52')]=qs[_0xebcf('0x3c')](_0x312ae2[_0xebcf('0x32')][_0xebcf('0x3c')]);_0x3adaab[_0xebcf('0x3f')]=qs[_0xebcf('0x34')](_['pick'](_0x312ae2[_0xebcf('0x32')],_0x3055eb[_0xebcf('0x34')]));if(_0x312ae2['query'][_0xebcf('0x53')]){_0x3adaab['where']=_[_0xebcf('0x3e')](_0x3adaab[_0xebcf('0x3f')],{'$or':_['map'](_0x3adaab[_0xebcf('0x37')],function(_0xfd2110){var _0x1829f7={};_0x1829f7[_0xfd2110]={'$like':'%'+_0x312ae2[_0xebcf('0x32')][_0xebcf('0x53')]+'%'};return _0x1829f7;})});}_0x3adaab=_['merge']({},_0x3adaab,_0x312ae2[_0xebcf('0x42')]);return _0x294be5[_0xebcf('0x51')](_0x3adaab);}})[_0xebcf('0x28')](function(_0x37f5ff){if(_0x37f5ff){_0xb8fb0a=_0x37f5ff[_0xebcf('0x39')];if(!_0x312ae2[_0xebcf('0x32')][_0xebcf('0x3a')]('nolimit')){_0x3adaab[_0xebcf('0x20')]=qs[_0xebcf('0x20')](_0x312ae2[_0xebcf('0x32')][_0xebcf('0x20')]);_0x3adaab['offset']=qs[_0xebcf('0x1e')](_0x312ae2['query']['offset']);}return _0x294be5[_0xebcf('0x51')](_0x3adaab);}})[_0xebcf('0x28')](function(_0x5ae035){if(_0x5ae035){return _0x5ae035?{'count':_0xb8fb0a,'rows':_0x5ae035}:null;}})['then'](respondWithResult(_0x475ab7,null))[_0xebcf('0x46')](handleError(_0x475ab7,null));};exports['getDescriptions']=function(_0x4be9b6,_0xabfe82,_0x4ebb27){var _0x2a40d2={};var _0x36cc8f={};var _0x30289b;var _0xad9111;return db[_0xebcf('0x49')]['findOne']({'where':{'id':_0x4be9b6[_0xebcf('0x48')]['id']}})[_0xebcf('0x28')](handleEntityNotFound(_0xabfe82,null))[_0xebcf('0x28')](function(_0x472238){if(_0x472238){_0x30289b=_0x472238;_0x36cc8f[_0xebcf('0x36')]=_[_0xebcf('0x33')](db[_0xebcf('0x50')][_0xebcf('0x2f')]);_0x36cc8f[_0xebcf('0x32')]=_['keys'](_0x4be9b6[_0xebcf('0x32')]);_0x36cc8f[_0xebcf('0x34')]=_['intersection'](_0x36cc8f[_0xebcf('0x36')],_0x36cc8f[_0xebcf('0x32')]);_0x2a40d2[_0xebcf('0x37')]=_['intersection'](_0x36cc8f[_0xebcf('0x36')],qs['fields'](_0x4be9b6[_0xebcf('0x32')][_0xebcf('0x38')]));_0x2a40d2[_0xebcf('0x37')]=_0x2a40d2['attributes']['length']?_0x2a40d2[_0xebcf('0x37')]:_0x36cc8f['model'];_0x2a40d2[_0xebcf('0x52')]=qs[_0xebcf('0x3c')](_0x4be9b6[_0xebcf('0x32')][_0xebcf('0x3c')]);_0x2a40d2[_0xebcf('0x3f')]=qs[_0xebcf('0x34')](_[_0xebcf('0x3d')](_0x4be9b6[_0xebcf('0x32')],_0x36cc8f[_0xebcf('0x34')]));if(_0x4be9b6[_0xebcf('0x32')][_0xebcf('0x53')]){_0x2a40d2[_0xebcf('0x3f')]=_[_0xebcf('0x3e')](_0x2a40d2[_0xebcf('0x3f')],{'$or':_[_0xebcf('0x2e')](_0x2a40d2['attributes'],function(_0x3beb4d){var _0x1f80ca={};_0x1f80ca[_0x3beb4d]={'$like':'%'+_0x4be9b6[_0xebcf('0x32')][_0xebcf('0x53')]+'%'};return _0x1f80ca;})});}_0x2a40d2=_[_0xebcf('0x3e')]({},_0x2a40d2,_0x4be9b6[_0xebcf('0x42')]);return _0x30289b[_0xebcf('0x54')](_0x2a40d2);}})[_0xebcf('0x28')](function(_0xed2bcb){if(_0xed2bcb){_0xad9111=_0xed2bcb['length'];if(!_0x4be9b6[_0xebcf('0x32')]['hasOwnProperty'](_0xebcf('0x3b'))){_0x2a40d2[_0xebcf('0x20')]=qs[_0xebcf('0x20')](_0x4be9b6[_0xebcf('0x32')][_0xebcf('0x20')]);_0x2a40d2[_0xebcf('0x1e')]=qs[_0xebcf('0x1e')](_0x4be9b6[_0xebcf('0x32')]['offset']);}return _0x30289b[_0xebcf('0x54')](_0x2a40d2);}})[_0xebcf('0x28')](function(_0x4c2c29){if(_0x4c2c29){return _0x4c2c29?{'count':_0xad9111,'rows':_0x4c2c29}:null;}})['then'](respondWithResult(_0xabfe82,null))[_0xebcf('0x46')](handleError(_0xabfe82,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 33b187b..141f11f 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 _0xb344=['request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','../../config/logger','api','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb344,0x150));var _0x4b34=function(_0x3fe05c,_0x325126){_0x3fe05c=_0x3fe05c-0x0;var _0x166aac=_0xb344[_0x3fe05c];return _0x166aac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b34('0x0'))(_0x4b34('0x1'));var moment=require(_0x4b34('0x2'));var BPromise=require(_0x4b34('0x3'));var rp=require(_0x4b34('0x4'));var fs=require('fs');var path=require(_0x4b34('0x5'));var rimraf=require(_0x4b34('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b34('0x7'));module[_0x4b34('0x8')]=function(_0xa09244,_0x20f445){return _0xa09244['define'](_0x4b34('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f41=['request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7f41,0x1b7));var _0x17f4=function(_0x391b6f,_0x3355c5){_0x391b6f=_0x391b6f-0x0;var _0x4843d3=_0x7f41[_0x391b6f];return _0x4843d3;};'use strict';var _=require(_0x17f4('0x0'));var util=require(_0x17f4('0x1'));var logger=require('../../config/logger')(_0x17f4('0x2'));var moment=require(_0x17f4('0x3'));var BPromise=require(_0x17f4('0x4'));var rp=require(_0x17f4('0x5'));var fs=require('fs');var path=require(_0x17f4('0x6'));var rimraf=require('rimraf');var config=require(_0x17f4('0x7'));var attributes=require(_0x17f4('0x8'));module[_0x17f4('0x9')]=function(_0x4015ec,_0x35911d){return _0x4015ec['define'](_0x17f4('0xa'),attributes,{'tableName':_0x17f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index af7822d..0e48117 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 _0x10f8=['SugarcrmConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x44de03,_0x28e6d6){var _0x320e3a=function(_0x564d04){while(--_0x564d04){_0x44de03['push'](_0x44de03['shift']());}};_0x320e3a(++_0x28e6d6);}(_0x10f8,0x7c));var _0x810f=function(_0x501695,_0xda9d02){_0x501695=_0x501695-0x0;var _0xca4b6c=_0x10f8[_0x501695];return _0xca4b6c;};'use strict';var _=require(_0x810f('0x0'));var util=require(_0x810f('0x1'));var moment=require('moment');var BPromise=require(_0x810f('0x2'));var rs=require(_0x810f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x810f('0x4'));var logger=require(_0x810f('0x5'))(_0x810f('0x6'));var config=require(_0x810f('0x7'));var jayson=require(_0x810f('0x8'));var client=jayson[_0x810f('0x9')][_0x810f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdedb4,_0x3d0de3,_0x4e41c8){return new BPromise(function(_0x45db18,_0x2127fb){return client[_0x810f('0xb')](_0xbdedb4,_0x4e41c8)[_0x810f('0xc')](function(_0x51748f){logger[_0x810f('0xd')](_0x810f('0xe'),_0x3d0de3,'request\x20sent');logger[_0x810f('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3d0de3,'request\x20sent',JSON[_0x810f('0x10')](_0x51748f));if(_0x51748f[_0x810f('0x11')]){if(_0x51748f[_0x810f('0x11')][_0x810f('0x12')]===0x1f4){logger[_0x810f('0x11')](_0x810f('0xe'),_0x3d0de3,_0x51748f['error']['message']);return _0x2127fb(_0x51748f[_0x810f('0x11')][_0x810f('0x13')]);}logger[_0x810f('0x11')](_0x810f('0xe'),_0x3d0de3,_0x51748f[_0x810f('0x11')][_0x810f('0x13')]);return _0x45db18(_0x51748f[_0x810f('0x11')]['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3d0de3,_0x810f('0x14'));_0x45db18(_0x51748f[_0x810f('0x15')][_0x810f('0x13')]);}})[_0x810f('0x16')](function(_0x30f846){logger['error'](_0x810f('0xe'),_0x3d0de3,_0x30f846);_0x2127fb(_0x30f846);});});} \ No newline at end of file +var _0x8d39=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x8d39,0x1d4));var _0x98d3=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x8d39[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x98d3('0x0'));var util=require('util');var moment=require(_0x98d3('0x1'));var BPromise=require(_0x98d3('0x2'));var rs=require(_0x98d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98d3('0x4'))['db'];var utils=require(_0x98d3('0x5'));var logger=require(_0x98d3('0x6'))(_0x98d3('0x7'));var config=require(_0x98d3('0x8'));var jayson=require(_0x98d3('0x9'));var client=jayson[_0x98d3('0xa')][_0x98d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f287,_0x34d5fc,_0x2eeac2){return new BPromise(function(_0x167a35,_0x4f9e22){return client[_0x98d3('0xc')](_0x17f287,_0x2eeac2)[_0x98d3('0xd')](function(_0x495dea){logger['info'](_0x98d3('0xe'),_0x34d5fc,_0x98d3('0xf'));logger[_0x98d3('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x34d5fc,_0x98d3('0xf'),JSON[_0x98d3('0x11')](_0x495dea));if(_0x495dea[_0x98d3('0x12')]){if(_0x495dea[_0x98d3('0x12')][_0x98d3('0x13')]===0x1f4){logger['error'](_0x98d3('0xe'),_0x34d5fc,_0x495dea[_0x98d3('0x12')][_0x98d3('0x14')]);return _0x4f9e22(_0x495dea[_0x98d3('0x12')][_0x98d3('0x14')]);}logger[_0x98d3('0x12')](_0x98d3('0xe'),_0x34d5fc,_0x495dea['error'][_0x98d3('0x14')]);return _0x167a35(_0x495dea['error']['message']);}else{logger[_0x98d3('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x34d5fc,'request\x20sent');_0x167a35(_0x495dea[_0x98d3('0x16')][_0x98d3('0x14')]);}})[_0x98d3('0x17')](function(_0x4f5591){logger[_0x98d3('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x34d5fc,_0x4f5591);_0x4f9e22(_0x4f5591);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 497e78c..876c133 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 _0x05e0=['../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5411d6,_0x2fac44){var _0x1d7a86=function(_0x363ec3){while(--_0x363ec3){_0x5411d6['push'](_0x5411d6['shift']());}};_0x1d7a86(++_0x2fac44);}(_0x05e0,0x1f2));var _0x005e=function(_0x7dfb21,_0x54cbb5){_0x7dfb21=_0x7dfb21-0x0;var _0x544f45=_0x05e0[_0x7dfb21];return _0x544f45;};'use strict';var multer=require(_0x005e('0x0'));var util=require(_0x005e('0x1'));var path=require(_0x005e('0x2'));var timeout=require(_0x005e('0x3'));var express=require(_0x005e('0x4'));var router=express['Router']();var fs_extra=require(_0x005e('0x5'));var auth=require(_0x005e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x005e('0x7'));var controller=require(_0x005e('0x8'));router[_0x005e('0x9')]('/',auth['isAuthenticated'](),controller[_0x005e('0xa')]);router[_0x005e('0x9')](_0x005e('0xb'),auth[_0x005e('0xc')](),controller['show']);router[_0x005e('0xd')]('/',auth[_0x005e('0xc')](),controller[_0x005e('0xe')]);router[_0x005e('0xf')](_0x005e('0xb'),auth[_0x005e('0xc')](),controller['update']);router['delete'](_0x005e('0xb'),auth[_0x005e('0xc')](),controller[_0x005e('0x10')]);module[_0x005e('0x11')]=router; \ No newline at end of file +var _0x960c=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id'];(function(_0x187886,_0x465cfd){var _0xbfdafd=function(_0x4b573b){while(--_0x4b573b){_0x187886['push'](_0x187886['shift']());}};_0xbfdafd(++_0x465cfd);}(_0x960c,0x9e));var _0xc960=function(_0x399e36,_0x4a1dc7){_0x399e36=_0x399e36-0x0;var _0x1c3f89=_0x960c[_0x399e36];return _0x1c3f89;};'use strict';var multer=require(_0xc960('0x0'));var util=require(_0xc960('0x1'));var path=require(_0xc960('0x2'));var timeout=require(_0xc960('0x3'));var express=require(_0xc960('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc960('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc960('0x6'));var controller=require(_0xc960('0x7'));router[_0xc960('0x8')]('/',auth[_0xc960('0x9')](),controller[_0xc960('0xa')]);router[_0xc960('0x8')](_0xc960('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc960('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc960('0xb'),auth['isAuthenticated'](),controller[_0xc960('0xd')]);router[_0xc960('0xe')](_0xc960('0xb'),auth[_0xc960('0x9')](),controller[_0xc960('0xf')]);module[_0xc960('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 ac1cdc0..7e13422 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 _0x8d15=['variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x172127,_0x2cd369){var _0x37187b=function(_0x2da0e2){while(--_0x2da0e2){_0x172127['push'](_0x172127['shift']());}};_0x37187b(++_0x2cd369);}(_0x8d15,0x85));var _0x58d1=function(_0x5683c8,_0x1b4d8c){_0x5683c8=_0x5683c8-0x0;var _0x27f4aa=_0x8d15[_0x5683c8];return _0x27f4aa;};'use strict';var Sequelize=require('sequelize');module[_0x58d1('0x0')]={'type':{'type':Sequelize[_0x58d1('0x1')](_0x58d1('0x2'),_0x58d1('0x3'),_0x58d1('0x4'),_0x58d1('0x5'),'picklist'),'defaultValue':_0x58d1('0x2')},'content':{'type':Sequelize[_0x58d1('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x58d1('0x2'),'variable',_0x58d1('0x4'))},'keyContent':{'type':Sequelize[_0x58d1('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x58d1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x58d1('0x6')]}}; \ No newline at end of file +var _0x8dbf=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','customVariable'];(function(_0x1eeadd,_0x9a8127){var _0x5decf0=function(_0x3ef50c){while(--_0x3ef50c){_0x1eeadd['push'](_0x1eeadd['shift']());}};_0x5decf0(++_0x9a8127);}(_0x8dbf,0x16a));var _0xf8db=function(_0x46e7f9,_0x2bf955){_0x46e7f9=_0x46e7f9-0x0;var _0x87bf33=_0x8dbf[_0x46e7f9];return _0x87bf33;};'use strict';var Sequelize=require(_0xf8db('0x0'));module[_0xf8db('0x1')]={'type':{'type':Sequelize[_0xf8db('0x2')]('string',_0xf8db('0x3'),'customVariable',_0xf8db('0x4'),_0xf8db('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xf8db('0x3'),_0xf8db('0x6'))},'keyContent':{'type':Sequelize[_0xf8db('0x7')]},'idField':{'type':Sequelize[_0xf8db('0x7')]},'nameField':{'type':Sequelize[_0xf8db('0x7')]},'customField':{'type':Sequelize[_0xf8db('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf8db('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3de8cb5..2f9fe39 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 _0xc34e=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','end','error','stack','name','send','map','SugarcrmField','rawAttributes','type','key'];(function(_0x434c79,_0x2cf957){var _0x3224b1=function(_0x245118){while(--_0x245118){_0x434c79['push'](_0x434c79['shift']());}};_0x3224b1(++_0x2cf957);}(_0xc34e,0xb6));var _0xec34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xec34('0x0'));var rimraf=require(_0xec34('0x1'));var zipdir=require(_0xec34('0x2'));var jsonpatch=require(_0xec34('0x3'));var rp=require(_0xec34('0x4'));var moment=require(_0xec34('0x5'));var BPromise=require(_0xec34('0x6'));var Mustache=require(_0xec34('0x7'));var util=require('util');var path=require('path');var sox=require(_0xec34('0x8'));var csv=require(_0xec34('0x9'));var ejs=require(_0xec34('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec34('0xb'));var squel=require(_0xec34('0xc'));var crypto=require(_0xec34('0xd'));var jsforce=require(_0xec34('0xe'));var deskjs=require(_0xec34('0xf'));var toCsv=require(_0xec34('0x9'));var querystring=require(_0xec34('0x10'));var Papa=require('papaparse');var Redis=require(_0xec34('0x11'));var authService=require(_0xec34('0x12'));var qs=require(_0xec34('0x13'));var as=require(_0xec34('0x14'));var hardwareService=require(_0xec34('0x15'));var logger=require('../../config/logger')(_0xec34('0x16'));var utils=require(_0xec34('0x17'));var config=require(_0xec34('0x18'));var licenseUtil=require(_0xec34('0x19'));var db=require(_0xec34('0x1a'))['db'];function respondWithStatusCode(_0x2e1370,_0x1ac2cb){_0x1ac2cb=_0x1ac2cb||0xcc;return function(_0x12f1fb){if(_0x12f1fb){return _0x2e1370[_0xec34('0x1b')](_0x1ac2cb);}return _0x2e1370[_0xec34('0x1c')](_0x1ac2cb)['end']();};}function respondWithResult(_0xd56814,_0x334943){_0x334943=_0x334943||0xc8;return function(_0x1fb364){if(_0x1fb364){return _0xd56814[_0xec34('0x1c')](_0x334943)[_0xec34('0x1d')](_0x1fb364);}};}function respondWithFilteredResult(_0x1b6a89,_0xd6505d){return function(_0x214878){if(_0x214878){var _0x31172b=typeof _0xd6505d['offset']===_0xec34('0x1e')&&typeof _0xd6505d[_0xec34('0x1f')]===_0xec34('0x1e');var _0x106bb4=_0x214878[_0xec34('0x20')];var _0x5678cd=_0x31172b?0x0:_0xd6505d['offset'];var _0x26bc98=_0x31172b?_0x214878[_0xec34('0x20')]:_0xd6505d[_0xec34('0x21')]+_0xd6505d['limit'];var _0x26f4c1;if(_0x26bc98>=_0x106bb4){_0x26bc98=_0x106bb4;_0x26f4c1=0xc8;}else{_0x26f4c1=0xce;}_0x1b6a89[_0xec34('0x1c')](_0x26f4c1);return _0x1b6a89[_0xec34('0x22')](_0xec34('0x23'),_0x5678cd+'-'+_0x26bc98+'/'+_0x106bb4)['json'](_0x214878);}return null;};}function patchUpdates(_0x3bb924){return function(_0x572819){try{jsonpatch['apply'](_0x572819,_0x3bb924,!![]);}catch(_0x3f769f){return BPromise[_0xec34('0x24')](_0x3f769f);}return _0x572819['save']();};}function saveUpdates(_0x586c3a,_0xe3449c){return function(_0x263b51){if(_0x263b51){return _0x263b51[_0xec34('0x25')](_0x586c3a)[_0xec34('0x26')](function(_0x12380c){return _0x12380c;});}return null;};}function removeEntity(_0x1b6b58,_0x2a6785){return function(_0x5c4ca1){if(_0x5c4ca1){return _0x5c4ca1['destroy']()[_0xec34('0x26')](function(){_0x1b6b58[_0xec34('0x1c')](0xcc)[_0xec34('0x27')]();});}};}function handleEntityNotFound(_0x58bcb8,_0x86b494){return function(_0x3c10f3){if(!_0x3c10f3){_0x58bcb8[_0xec34('0x1b')](0x194);}return _0x3c10f3;};}function handleError(_0x13ed47,_0x508096){_0x508096=_0x508096||0x1f4;return function(_0x2cbe6b){logger[_0xec34('0x28')](_0x2cbe6b[_0xec34('0x29')]);if(_0x2cbe6b[_0xec34('0x2a')]){delete _0x2cbe6b[_0xec34('0x2a')];}_0x13ed47[_0xec34('0x1c')](_0x508096)[_0xec34('0x2b')](_0x2cbe6b);};}exports['index']=function(_0x4c07fa,_0xc35aae){var _0x22d515={},_0x2dc0b1={},_0x5b733c={'count':0x0,'rows':[]};var _0x372b2e=_[_0xec34('0x2c')](db[_0xec34('0x2d')][_0xec34('0x2e')],function(_0x4d6f8b){return{'name':_0x4d6f8b['fieldName'],'type':_0x4d6f8b[_0xec34('0x2f')][_0xec34('0x30')]};});_0x2dc0b1[_0xec34('0x31')]=_['map'](_0x372b2e,_0xec34('0x2a'));_0x2dc0b1[_0xec34('0x32')]=_[_0xec34('0x33')](_0x4c07fa['query']);_0x2dc0b1[_0xec34('0x34')]=_[_0xec34('0x35')](_0x2dc0b1[_0xec34('0x31')],_0x2dc0b1[_0xec34('0x32')]);_0x22d515['attributes']=_[_0xec34('0x35')](_0x2dc0b1[_0xec34('0x31')],qs['fields'](_0x4c07fa[_0xec34('0x32')][_0xec34('0x36')]));_0x22d515[_0xec34('0x37')]=_0x22d515[_0xec34('0x37')][_0xec34('0x38')]?_0x22d515[_0xec34('0x37')]:_0x2dc0b1[_0xec34('0x31')];if(!_0x4c07fa[_0xec34('0x32')][_0xec34('0x39')](_0xec34('0x3a'))){_0x22d515[_0xec34('0x1f')]=qs['limit'](_0x4c07fa[_0xec34('0x32')][_0xec34('0x1f')]);_0x22d515['offset']=qs[_0xec34('0x21')](_0x4c07fa[_0xec34('0x32')]['offset']);}_0x22d515[_0xec34('0x3b')]=qs[_0xec34('0x3c')](_0x4c07fa[_0xec34('0x32')][_0xec34('0x3c')]);_0x22d515[_0xec34('0x3d')]=qs[_0xec34('0x34')](_[_0xec34('0x3e')](_0x4c07fa[_0xec34('0x32')],_0x2dc0b1[_0xec34('0x34')]),_0x372b2e);if(_0x4c07fa['query'][_0xec34('0x3f')]){_0x22d515['where']=_[_0xec34('0x40')](_0x22d515[_0xec34('0x3d')],{'$or':_['map'](_0x372b2e,function(_0xef8852){if(_0xef8852[_0xec34('0x2f')]!==_0xec34('0x41')){var _0x3c81eb={};_0x3c81eb[_0xef8852[_0xec34('0x2a')]]={'$like':'%'+_0x4c07fa[_0xec34('0x32')]['filter']+'%'};return _0x3c81eb;}})});}_0x22d515=_[_0xec34('0x40')]({},_0x22d515,_0x4c07fa[_0xec34('0x42')]);var _0x510584={'where':_0x22d515[_0xec34('0x3d')]};return db['SugarcrmField'][_0xec34('0x20')](_0x510584)[_0xec34('0x26')](function(_0x5c1f63){_0x5b733c['count']=_0x5c1f63;if(_0x4c07fa[_0xec34('0x32')]['includeAll']){_0x22d515[_0xec34('0x43')]=[{'all':!![]}];}return db[_0xec34('0x2d')]['findAll'](_0x22d515);})['then'](function(_0x2de781){_0x5b733c[_0xec34('0x44')]=_0x2de781;return _0x5b733c;})['then'](respondWithFilteredResult(_0xc35aae,_0x22d515))[_0xec34('0x45')](handleError(_0xc35aae,null));};exports[_0xec34('0x46')]=function(_0x54f4ec,_0x14c816){var _0x506e04={'raw':!![],'where':{'id':_0x54f4ec['params']['id']}},_0x917524={};_0x917524[_0xec34('0x31')]=_[_0xec34('0x33')](db[_0xec34('0x2d')][_0xec34('0x2e')]);_0x917524[_0xec34('0x32')]=_[_0xec34('0x33')](_0x54f4ec['query']);_0x917524[_0xec34('0x34')]=_[_0xec34('0x35')](_0x917524[_0xec34('0x31')],_0x917524[_0xec34('0x32')]);_0x506e04[_0xec34('0x37')]=_[_0xec34('0x35')](_0x917524[_0xec34('0x31')],qs[_0xec34('0x36')](_0x54f4ec['query'][_0xec34('0x36')]));_0x506e04[_0xec34('0x37')]=_0x506e04[_0xec34('0x37')]['length']?_0x506e04[_0xec34('0x37')]:_0x917524[_0xec34('0x31')];if(_0x54f4ec[_0xec34('0x32')][_0xec34('0x47')]){_0x506e04['include']=[{'all':!![]}];}_0x506e04=_[_0xec34('0x40')]({},_0x506e04,_0x54f4ec[_0xec34('0x42')]);return db[_0xec34('0x2d')][_0xec34('0x48')](_0x506e04)['then'](handleEntityNotFound(_0x14c816,null))[_0xec34('0x26')](respondWithResult(_0x14c816,null))[_0xec34('0x45')](handleError(_0x14c816,null));};exports[_0xec34('0x49')]=function(_0x56897e,_0x5328ee){return db[_0xec34('0x2d')][_0xec34('0x49')](_0x56897e['body'],{})[_0xec34('0x26')](respondWithResult(_0x5328ee,0xc9))[_0xec34('0x45')](handleError(_0x5328ee,null));};exports[_0xec34('0x25')]=function(_0x1074c2,_0x9a6e29){if(_0x1074c2[_0xec34('0x4a')]['id']){delete _0x1074c2[_0xec34('0x4a')]['id'];}return db['SugarcrmField'][_0xec34('0x48')]({'where':{'id':_0x1074c2[_0xec34('0x4b')]['id']}})[_0xec34('0x26')](handleEntityNotFound(_0x9a6e29,null))[_0xec34('0x26')](saveUpdates(_0x1074c2[_0xec34('0x4a')],null))[_0xec34('0x26')](respondWithResult(_0x9a6e29,null))['catch'](handleError(_0x9a6e29,null));};exports[_0xec34('0x4c')]=function(_0x5c1ef7,_0x2e9bf1){return db['SugarcrmField']['find']({'where':{'id':_0x5c1ef7['params']['id']}})[_0xec34('0x26')](handleEntityNotFound(_0x2e9bf1,null))['then'](removeEntity(_0x2e9bf1,null))['catch'](handleError(_0x2e9bf1,null));}; \ No newline at end of file +var _0xc26c=['sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','SugarcrmField','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xc26c,0x15c));var _0xcc26=function(_0x546971,_0xea4dae){_0x546971=_0x546971-0x0;var _0x586824=_0xc26c[_0x546971];return _0x586824;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc26('0x0'));var zipdir=require(_0xcc26('0x1'));var jsonpatch=require(_0xcc26('0x2'));var rp=require(_0xcc26('0x3'));var moment=require(_0xcc26('0x4'));var BPromise=require(_0xcc26('0x5'));var Mustache=require('mustache');var util=require(_0xcc26('0x6'));var path=require(_0xcc26('0x7'));var sox=require(_0xcc26('0x8'));var csv=require(_0xcc26('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc26('0xa'));var _=require(_0xcc26('0xb'));var squel=require(_0xcc26('0xc'));var crypto=require(_0xcc26('0xd'));var jsforce=require(_0xcc26('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcc26('0xf'));var Papa=require(_0xcc26('0x10'));var Redis=require(_0xcc26('0x11'));var authService=require(_0xcc26('0x12'));var qs=require(_0xcc26('0x13'));var as=require(_0xcc26('0x14'));var hardwareService=require(_0xcc26('0x15'));var logger=require('../../config/logger')(_0xcc26('0x16'));var utils=require(_0xcc26('0x17'));var config=require(_0xcc26('0x18'));var licenseUtil=require(_0xcc26('0x19'));var db=require(_0xcc26('0x1a'))['db'];function respondWithStatusCode(_0x48f017,_0x2b082c){_0x2b082c=_0x2b082c||0xcc;return function(_0x17e20c){if(_0x17e20c){return _0x48f017[_0xcc26('0x1b')](_0x2b082c);}return _0x48f017[_0xcc26('0x1c')](_0x2b082c)[_0xcc26('0x1d')]();};}function respondWithResult(_0x31238c,_0x321416){_0x321416=_0x321416||0xc8;return function(_0x16f9dd){if(_0x16f9dd){return _0x31238c[_0xcc26('0x1c')](_0x321416)['json'](_0x16f9dd);}};}function respondWithFilteredResult(_0x28001e,_0x5c4c63){return function(_0x21526e){if(_0x21526e){var _0x5d9e4e=typeof _0x5c4c63[_0xcc26('0x1e')]===_0xcc26('0x1f')&&typeof _0x5c4c63['limit']===_0xcc26('0x1f');var _0x44ef87=_0x21526e[_0xcc26('0x20')];var _0x38d0df=_0x5d9e4e?0x0:_0x5c4c63[_0xcc26('0x1e')];var _0x4b995b=_0x5d9e4e?_0x21526e[_0xcc26('0x20')]:_0x5c4c63[_0xcc26('0x1e')]+_0x5c4c63['limit'];var _0x42ed61;if(_0x4b995b>=_0x44ef87){_0x4b995b=_0x44ef87;_0x42ed61=0xc8;}else{_0x42ed61=0xce;}_0x28001e[_0xcc26('0x1c')](_0x42ed61);return _0x28001e['set'](_0xcc26('0x21'),_0x38d0df+'-'+_0x4b995b+'/'+_0x44ef87)[_0xcc26('0x22')](_0x21526e);}return null;};}function patchUpdates(_0x43c8e3){return function(_0x30f43a){try{jsonpatch[_0xcc26('0x23')](_0x30f43a,_0x43c8e3,!![]);}catch(_0x240fff){return BPromise[_0xcc26('0x24')](_0x240fff);}return _0x30f43a[_0xcc26('0x25')]();};}function saveUpdates(_0x135229,_0x240d9f){return function(_0x385e2c){if(_0x385e2c){return _0x385e2c[_0xcc26('0x26')](_0x135229)[_0xcc26('0x27')](function(_0x41996b){return _0x41996b;});}return null;};}function removeEntity(_0x3bdf64,_0x4d63c2){return function(_0x1bb496){if(_0x1bb496){return _0x1bb496[_0xcc26('0x28')]()[_0xcc26('0x27')](function(){_0x3bdf64[_0xcc26('0x1c')](0xcc)[_0xcc26('0x1d')]();});}};}function handleEntityNotFound(_0x2c3462,_0x370149){return function(_0x5827d1){if(!_0x5827d1){_0x2c3462[_0xcc26('0x1b')](0x194);}return _0x5827d1;};}function handleError(_0x2737f5,_0x360349){_0x360349=_0x360349||0x1f4;return function(_0x37f003){logger['error'](_0x37f003[_0xcc26('0x29')]);if(_0x37f003[_0xcc26('0x2a')]){delete _0x37f003['name'];}_0x2737f5[_0xcc26('0x1c')](_0x360349)['send'](_0x37f003);};}exports[_0xcc26('0x2b')]=function(_0x2984ac,_0x1b44af){var _0x5c606e={},_0x477161={},_0x31d809={'count':0x0,'rows':[]};var _0x1e50e2=_[_0xcc26('0x2c')](db['SugarcrmField'][_0xcc26('0x2d')],function(_0x50acf7){return{'name':_0x50acf7['fieldName'],'type':_0x50acf7[_0xcc26('0x2e')]['key']};});_0x477161[_0xcc26('0x2f')]=_[_0xcc26('0x2c')](_0x1e50e2,_0xcc26('0x2a'));_0x477161[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x2984ac[_0xcc26('0x30')]);_0x477161[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x477161[_0xcc26('0x2f')],_0x477161[_0xcc26('0x30')]);_0x5c606e['attributes']=_[_0xcc26('0x33')](_0x477161[_0xcc26('0x2f')],qs[_0xcc26('0x34')](_0x2984ac['query'][_0xcc26('0x34')]));_0x5c606e[_0xcc26('0x35')]=_0x5c606e[_0xcc26('0x35')][_0xcc26('0x36')]?_0x5c606e[_0xcc26('0x35')]:_0x477161[_0xcc26('0x2f')];if(!_0x2984ac['query']['hasOwnProperty']('nolimit')){_0x5c606e[_0xcc26('0x37')]=qs[_0xcc26('0x37')](_0x2984ac['query']['limit']);_0x5c606e['offset']=qs[_0xcc26('0x1e')](_0x2984ac[_0xcc26('0x30')][_0xcc26('0x1e')]);}_0x5c606e[_0xcc26('0x38')]=qs[_0xcc26('0x39')](_0x2984ac['query'][_0xcc26('0x39')]);_0x5c606e[_0xcc26('0x3a')]=qs[_0xcc26('0x32')](_[_0xcc26('0x3b')](_0x2984ac['query'],_0x477161[_0xcc26('0x32')]),_0x1e50e2);if(_0x2984ac[_0xcc26('0x30')]['filter']){_0x5c606e['where']=_[_0xcc26('0x3c')](_0x5c606e[_0xcc26('0x3a')],{'$or':_[_0xcc26('0x2c')](_0x1e50e2,function(_0x1136fe){if(_0x1136fe[_0xcc26('0x2e')]!==_0xcc26('0x3d')){var _0x4e4e61={};_0x4e4e61[_0x1136fe['name']]={'$like':'%'+_0x2984ac[_0xcc26('0x30')][_0xcc26('0x3e')]+'%'};return _0x4e4e61;}})});}_0x5c606e=_['merge']({},_0x5c606e,_0x2984ac[_0xcc26('0x3f')]);var _0x1ff193={'where':_0x5c606e[_0xcc26('0x3a')]};return db[_0xcc26('0x40')][_0xcc26('0x20')](_0x1ff193)[_0xcc26('0x27')](function(_0x265086){_0x31d809[_0xcc26('0x20')]=_0x265086;if(_0x2984ac['query'][_0xcc26('0x41')]){_0x5c606e[_0xcc26('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0xcc26('0x43')](_0x5c606e);})[_0xcc26('0x27')](function(_0x430bb8){_0x31d809[_0xcc26('0x44')]=_0x430bb8;return _0x31d809;})[_0xcc26('0x27')](respondWithFilteredResult(_0x1b44af,_0x5c606e))[_0xcc26('0x45')](handleError(_0x1b44af,null));};exports[_0xcc26('0x46')]=function(_0x5a13f4,_0x6a7b2){var _0x132851={'raw':!![],'where':{'id':_0x5a13f4[_0xcc26('0x47')]['id']}},_0x198d2d={};_0x198d2d[_0xcc26('0x2f')]=_[_0xcc26('0x31')](db[_0xcc26('0x40')][_0xcc26('0x2d')]);_0x198d2d[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x5a13f4[_0xcc26('0x30')]);_0x198d2d[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x198d2d[_0xcc26('0x2f')],_0x198d2d[_0xcc26('0x30')]);_0x132851[_0xcc26('0x35')]=_['intersection'](_0x198d2d[_0xcc26('0x2f')],qs[_0xcc26('0x34')](_0x5a13f4[_0xcc26('0x30')][_0xcc26('0x34')]));_0x132851['attributes']=_0x132851['attributes'][_0xcc26('0x36')]?_0x132851[_0xcc26('0x35')]:_0x198d2d[_0xcc26('0x2f')];if(_0x5a13f4['query'][_0xcc26('0x41')]){_0x132851[_0xcc26('0x42')]=[{'all':!![]}];}_0x132851=_[_0xcc26('0x3c')]({},_0x132851,_0x5a13f4['options']);return db[_0xcc26('0x40')][_0xcc26('0x48')](_0x132851)[_0xcc26('0x27')](handleEntityNotFound(_0x6a7b2,null))[_0xcc26('0x27')](respondWithResult(_0x6a7b2,null))['catch'](handleError(_0x6a7b2,null));};exports[_0xcc26('0x49')]=function(_0xff19fa,_0x3adff0){return db[_0xcc26('0x40')]['create'](_0xff19fa[_0xcc26('0x4a')],{})[_0xcc26('0x27')](respondWithResult(_0x3adff0,0xc9))[_0xcc26('0x45')](handleError(_0x3adff0,null));};exports[_0xcc26('0x26')]=function(_0x523c77,_0x49442a){if(_0x523c77[_0xcc26('0x4a')]['id']){delete _0x523c77[_0xcc26('0x4a')]['id'];}return db[_0xcc26('0x40')]['find']({'where':{'id':_0x523c77['params']['id']}})[_0xcc26('0x27')](handleEntityNotFound(_0x49442a,null))[_0xcc26('0x27')](saveUpdates(_0x523c77[_0xcc26('0x4a')],null))[_0xcc26('0x27')](respondWithResult(_0x49442a,null))[_0xcc26('0x45')](handleError(_0x49442a,null));};exports['destroy']=function(_0x16ae79,_0x4475c2){return db[_0xcc26('0x40')][_0xcc26('0x48')]({'where':{'id':_0x16ae79[_0xcc26('0x47')]['id']}})['then'](handleEntityNotFound(_0x4475c2,null))[_0xcc26('0x27')](removeEntity(_0x4475c2,null))[_0xcc26('0x45')](handleError(_0x4475c2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 58b2430..9c14544 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 _0x9928=['moment','request-promise','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api'];(function(_0x4080a2,_0x322e13){var _0x5b89b6=function(_0xbc8191){while(--_0xbc8191){_0x4080a2['push'](_0x4080a2['shift']());}};_0x5b89b6(++_0x322e13);}(_0x9928,0xc0));var _0x8992=function(_0x545e86,_0x46a2ed){_0x545e86=_0x545e86-0x0;var _0xa98055=_0x9928[_0x545e86];return _0xa98055;};'use strict';var _=require(_0x8992('0x0'));var util=require(_0x8992('0x1'));var logger=require('../../config/logger')(_0x8992('0x2'));var moment=require(_0x8992('0x3'));var BPromise=require('bluebird');var rp=require(_0x8992('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8992('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x8992('0x6')]=function(_0x311f1b,_0x4dddee){return _0x311f1b[_0x8992('0x7')](_0x8992('0x8'),attributes,{'tableName':_0x8992('0x9'),'paranoid':![],'indexes':[{'name':_0x8992('0xa'),'fields':[_0x8992('0xb'),_0x8992('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0bc=['path','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x39202a,_0xf1138){var _0x2f02e7=function(_0x116aa4){while(--_0x116aa4){_0x39202a['push'](_0x39202a['shift']());}};_0x2f02e7(++_0xf1138);}(_0xb0bc,0x111));var _0xcb0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb0bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var logger=require(_0xcb0b('0x2'))(_0xcb0b('0x3'));var moment=require(_0xcb0b('0x4'));var BPromise=require(_0xcb0b('0x5'));var rp=require(_0xcb0b('0x6'));var fs=require('fs');var path=require(_0xcb0b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb0b('0x8'));module[_0xcb0b('0x9')]=function(_0x57cae1,_0x24c86b){return _0x57cae1['define'](_0xcb0b('0xa'),attributes,{'tableName':_0xcb0b('0xb'),'paranoid':![],'indexes':[{'name':_0xcb0b('0xc'),'fields':[_0xcb0b('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 006d04d..f363a98 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 _0x9e7c=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x4ae5e4,_0x101e79){var _0x46ba7b=function(_0x3c8b75){while(--_0x3c8b75){_0x4ae5e4['push'](_0x4ae5e4['shift']());}};_0x46ba7b(++_0x101e79);}(_0x9e7c,0x1d0));var _0xc9e7=function(_0x32b94e,_0x113a65){_0x32b94e=_0x32b94e-0x0;var _0x4e8544=_0x9e7c[_0x32b94e];return _0x4e8544;};'use strict';var _=require(_0xc9e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc9e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9e7('0x2'))['db'];var utils=require(_0xc9e7('0x3'));var logger=require(_0xc9e7('0x4'))('rpc');var config=require(_0xc9e7('0x5'));var jayson=require(_0xc9e7('0x6'));var client=jayson['client'][_0xc9e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ee7a0,_0xe8d76d,_0x3aee28){return new BPromise(function(_0x5a5d5a,_0x4c770d){return client[_0xc9e7('0x8')](_0x4ee7a0,_0x3aee28)[_0xc9e7('0x9')](function(_0x5c8da2){logger[_0xc9e7('0xa')](_0xc9e7('0xb'),_0xe8d76d,_0xc9e7('0xc'));logger[_0xc9e7('0xd')](_0xc9e7('0xe'),_0xe8d76d,_0xc9e7('0xc'),JSON['stringify'](_0x5c8da2));if(_0x5c8da2[_0xc9e7('0xf')]){if(_0x5c8da2['error'][_0xc9e7('0x10')]===0x1f4){logger[_0xc9e7('0xf')](_0xc9e7('0xb'),_0xe8d76d,_0x5c8da2[_0xc9e7('0xf')][_0xc9e7('0x11')]);return _0x4c770d(_0x5c8da2[_0xc9e7('0xf')][_0xc9e7('0x11')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0xe8d76d,_0x5c8da2[_0xc9e7('0xf')][_0xc9e7('0x11')]);return _0x5a5d5a(_0x5c8da2['error'][_0xc9e7('0x11')]);}else{logger[_0xc9e7('0xa')](_0xc9e7('0xb'),_0xe8d76d,'request\x20sent');_0x5a5d5a(_0x5c8da2['result']['message']);}})[_0xc9e7('0x12')](function(_0x3509bf){logger[_0xc9e7('0xf')](_0xc9e7('0xb'),_0xe8d76d,_0x3509bf);_0x4c770d(_0x3509bf);});});} \ No newline at end of file +var _0x8b5e=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4704a1,_0x3c2642){var _0x194ae4=function(_0x50233d){while(--_0x50233d){_0x4704a1['push'](_0x4704a1['shift']());}};_0x194ae4(++_0x3c2642);}(_0x8b5e,0x14c));var _0xe8b5=function(_0x363fde,_0x31637e){_0x363fde=_0x363fde-0x0;var _0x4b6c7d=_0x8b5e[_0x363fde];return _0x4b6c7d;};'use strict';var _=require(_0xe8b5('0x0'));var util=require(_0xe8b5('0x1'));var moment=require(_0xe8b5('0x2'));var BPromise=require(_0xe8b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8b5('0x4'));var db=require(_0xe8b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8b5('0x6'))(_0xe8b5('0x7'));var config=require(_0xe8b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8b5('0x9')][_0xe8b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27e9af,_0x179f7a,_0x2725a8){return new BPromise(function(_0x58830f,_0x28b2ee){return client[_0xe8b5('0xb')](_0x27e9af,_0x2725a8)[_0xe8b5('0xc')](function(_0x4b6eb0){logger[_0xe8b5('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x179f7a,'request\x20sent');logger[_0xe8b5('0xe')](_0xe8b5('0xf'),_0x179f7a,_0xe8b5('0x10'),JSON[_0xe8b5('0x11')](_0x4b6eb0));if(_0x4b6eb0[_0xe8b5('0x12')]){if(_0x4b6eb0[_0xe8b5('0x12')][_0xe8b5('0x13')]===0x1f4){logger[_0xe8b5('0x12')](_0xe8b5('0x14'),_0x179f7a,_0x4b6eb0[_0xe8b5('0x12')][_0xe8b5('0x15')]);return _0x28b2ee(_0x4b6eb0['error'][_0xe8b5('0x15')]);}logger[_0xe8b5('0x12')](_0xe8b5('0x14'),_0x179f7a,_0x4b6eb0['error']['message']);return _0x58830f(_0x4b6eb0[_0xe8b5('0x12')]['message']);}else{logger[_0xe8b5('0xd')](_0xe8b5('0x14'),_0x179f7a,'request\x20sent');_0x58830f(_0x4b6eb0[_0xe8b5('0x16')][_0xe8b5('0x15')]);}})[_0xe8b5('0x17')](function(_0x1bff70){logger[_0xe8b5('0x12')](_0xe8b5('0x14'),_0x179f7a,_0x1bff70);_0x28b2ee(_0x1bff70);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 48be3db..b2bd141 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 _0xb0b9=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb0e41e,_0x3a9a70){var _0x4ee7bc=function(_0xc139dd){while(--_0xc139dd){_0xb0e41e['push'](_0xb0e41e['shift']());}};_0x4ee7bc(++_0x3a9a70);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x379fc3,_0x3a3e2b){_0x379fc3=_0x379fc3-0x0;var _0x301660=_0xb0b9[_0x379fc3];return _0x301660;};'use strict';var multer=require(_0x9b0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b0b('0x1'));var express=require(_0x9b0b('0x2'));var router=express[_0x9b0b('0x3')]();var fs_extra=require(_0x9b0b('0x4'));var auth=require(_0x9b0b('0x5'));var interaction=require(_0x9b0b('0x6'));var config=require(_0x9b0b('0x7'));var controller=require(_0x9b0b('0x8'));router[_0x9b0b('0x9')]('/',auth[_0x9b0b('0xa')](),controller[_0x9b0b('0xb')]);router[_0x9b0b('0x9')](_0x9b0b('0xc'),auth[_0x9b0b('0xa')](),controller['show']);router['get'](_0x9b0b('0xd'),auth[_0x9b0b('0xa')](),controller[_0x9b0b('0xe')]);router[_0x9b0b('0x9')](_0x9b0b('0xf'),auth[_0x9b0b('0xa')](),controller['getFields']);router[_0x9b0b('0x10')]('/',auth[_0x9b0b('0xa')](),controller[_0x9b0b('0x11')]);router[_0x9b0b('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9b0b('0x12')]);router['put'](_0x9b0b('0xc'),auth['isAuthenticated'](),controller[_0x9b0b('0x13')]);router[_0x9b0b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9b0b('0x15')]);module[_0x9b0b('0x16')]=router; \ No newline at end of file +var _0x1af3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0x1609e5,_0x39f054){var _0x5f361a=function(_0x16d6d8){while(--_0x16d6d8){_0x1609e5['push'](_0x1609e5['shift']());}};_0x5f361a(++_0x39f054);}(_0x1af3,0x1ca));var _0x31af=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x1af3[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var path=require(_0x31af('0x2'));var timeout=require(_0x31af('0x3'));var express=require(_0x31af('0x4'));var router=express[_0x31af('0x5')]();var fs_extra=require(_0x31af('0x6'));var auth=require(_0x31af('0x7'));var interaction=require(_0x31af('0x8'));var config=require(_0x31af('0x9'));var controller=require('./intVtigerAccount.controller');router[_0x31af('0xa')]('/',auth[_0x31af('0xb')](),controller[_0x31af('0xc')]);router[_0x31af('0xa')]('/:id',auth[_0x31af('0xb')](),controller[_0x31af('0xd')]);router[_0x31af('0xa')]('/:id/configurations',auth[_0x31af('0xb')](),controller[_0x31af('0xe')]);router[_0x31af('0xa')](_0x31af('0xf'),auth[_0x31af('0xb')](),controller[_0x31af('0x10')]);router[_0x31af('0x11')]('/',auth[_0x31af('0xb')](),controller['create']);router[_0x31af('0x11')](_0x31af('0x12'),auth[_0x31af('0xb')](),controller[_0x31af('0x13')]);router[_0x31af('0x14')]('/:id',auth[_0x31af('0xb')](),controller[_0x31af('0x15')]);router['delete']('/:id',auth[_0x31af('0xb')](),controller[_0x31af('0x16')]);module[_0x31af('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e598603..a210274 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 _0x58cf=['HelpDesk','sequelize','exports','STRING'];(function(_0x3d0fcc,_0x31174f){var _0x578c5b=function(_0x237680){while(--_0x237680){_0x3d0fcc['push'](_0x3d0fcc['shift']());}};_0x578c5b(++_0x31174f);}(_0x58cf,0x1dd));var _0xf58c=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x58cf[_0x20b29c];return _0x20d81b;};'use strict';var Sequelize=require(_0xf58c('0x0'));module[_0xf58c('0x1')]={'name':{'type':Sequelize[_0xf58c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf58c('0x2')]},'username':{'type':Sequelize[_0xf58c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf58c('0x3')},'remoteUri':{'type':Sequelize[_0xf58c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfeef=['HelpDesk','sequelize','exports','STRING'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xfeef,0x6d));var _0xffee=function(_0x3ee869,_0x4541da){_0x3ee869=_0x3ee869-0x0;var _0x3f145f=_0xfeef[_0x3ee869];return _0x3f145f;};'use strict';var Sequelize=require(_0xffee('0x0'));module[_0xffee('0x1')]={'name':{'type':Sequelize[_0xffee('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xffee('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xffee('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xffee('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index a20192f..33561c7 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 _0x2167=['Content-Range','apply','update','then','destroy','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','nolimit','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','body','getConfigurations','findOne','order','sort','pick','addConfiguration','getSubjects','channel','type','Descriptions','create','VtigerField','Subjects','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','result','describe','sessionName','autogenerated','reference','owner','includes','editable','label','startsWith','cf_','picklistValues','log','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','limit','count','set'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0x2167,0x136));var _0x7216=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x2167[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0x7216('0x0'));var rimraf=require(_0x7216('0x1'));var zipdir=require(_0x7216('0x2'));var jsonpatch=require(_0x7216('0x3'));var rp=require(_0x7216('0x4'));var moment=require(_0x7216('0x5'));var BPromise=require(_0x7216('0x6'));var Mustache=require('mustache');var util=require(_0x7216('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7216('0x8'));var ejs=require(_0x7216('0x9'));var fs=require('fs');var fs_extra=require(_0x7216('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7216('0xb'));var jsforce=require(_0x7216('0xc'));var deskjs=require(_0x7216('0xd'));var toCsv=require(_0x7216('0x8'));var querystring=require(_0x7216('0xe'));var Papa=require(_0x7216('0xf'));var Redis=require(_0x7216('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7216('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7216('0x12'));var logger=require(_0x7216('0x13'))('api');var utils=require(_0x7216('0x14'));var config=require(_0x7216('0x15'));var licenseUtil=require(_0x7216('0x16'));var db=require(_0x7216('0x17'))['db'];var integrations=require(_0x7216('0x18'));function respondWithStatusCode(_0x608017,_0x224cda){_0x224cda=_0x224cda||0xcc;return function(_0x2d3041){if(_0x2d3041){return _0x608017[_0x7216('0x19')](_0x224cda);}return _0x608017['status'](_0x224cda)[_0x7216('0x1a')]();};}function respondWithResult(_0x333b52,_0x2a37e3){_0x2a37e3=_0x2a37e3||0xc8;return function(_0x13942d){if(_0x13942d){return _0x333b52[_0x7216('0x1b')](_0x2a37e3)['json'](_0x13942d);}};}function respondWithFilteredResult(_0x9dee89,_0x4aea53){return function(_0x4e13f1){if(_0x4e13f1){var _0x4c0c58=typeof _0x4aea53[_0x7216('0x1c')]==='undefined'&&typeof _0x4aea53[_0x7216('0x1d')]==='undefined';var _0xe1cbe6=_0x4e13f1[_0x7216('0x1e')];var _0x54a202=_0x4c0c58?0x0:_0x4aea53[_0x7216('0x1c')];var _0x1f189d=_0x4c0c58?_0x4e13f1['count']:_0x4aea53[_0x7216('0x1c')]+_0x4aea53[_0x7216('0x1d')];var _0x292bdf;if(_0x1f189d>=_0xe1cbe6){_0x1f189d=_0xe1cbe6;_0x292bdf=0xc8;}else{_0x292bdf=0xce;}_0x9dee89[_0x7216('0x1b')](_0x292bdf);return _0x9dee89[_0x7216('0x1f')](_0x7216('0x20'),_0x54a202+'-'+_0x1f189d+'/'+_0xe1cbe6)['json'](_0x4e13f1);}return null;};}function patchUpdates(_0x4528d2){return function(_0x4ce384){try{jsonpatch[_0x7216('0x21')](_0x4ce384,_0x4528d2,!![]);}catch(_0x39065f){return BPromise['reject'](_0x39065f);}return _0x4ce384['save']();};}function saveUpdates(_0x22b2d5,_0x2162b2){return function(_0x540882){if(_0x540882){return _0x540882[_0x7216('0x22')](_0x22b2d5)[_0x7216('0x23')](function(_0x4996d7){return _0x4996d7;});}return null;};}function removeEntity(_0x5c38fe,_0x2858ba){return function(_0x5565e7){if(_0x5565e7){return _0x5565e7[_0x7216('0x24')]()[_0x7216('0x23')](function(){_0x5c38fe[_0x7216('0x1b')](0xcc)[_0x7216('0x1a')]();});}};}function handleEntityNotFound(_0x32fd39,_0x16959b){return function(_0x4be723){if(!_0x4be723){_0x32fd39[_0x7216('0x19')](0x194);}return _0x4be723;};}function handleError(_0x410488,_0x4b7aef){_0x4b7aef=_0x4b7aef||0x1f4;return function(_0x2541f0){logger['error'](_0x2541f0['stack']);if(_0x2541f0[_0x7216('0x25')]){delete _0x2541f0['name'];}_0x410488['status'](_0x4b7aef)[_0x7216('0x26')](_0x2541f0);};}exports['index']=function(_0x2896a2,_0x2012c2){var _0x483dc4={},_0x34ef07={},_0x1942ed={'count':0x0,'rows':[]};var _0x7cc112=_[_0x7216('0x27')](db[_0x7216('0x28')][_0x7216('0x29')],function(_0x59c63f){return{'name':_0x59c63f[_0x7216('0x2a')],'type':_0x59c63f['type'][_0x7216('0x2b')]};});_0x34ef07[_0x7216('0x2c')]=_[_0x7216('0x27')](_0x7cc112,_0x7216('0x25'));_0x34ef07['query']=_[_0x7216('0x2d')](_0x2896a2[_0x7216('0x2e')]);_0x34ef07[_0x7216('0x2f')]=_['intersection'](_0x34ef07[_0x7216('0x2c')],_0x34ef07[_0x7216('0x2e')]);_0x483dc4[_0x7216('0x30')]=_['intersection'](_0x34ef07[_0x7216('0x2c')],qs['fields'](_0x2896a2[_0x7216('0x2e')][_0x7216('0x31')]));_0x483dc4[_0x7216('0x30')]=_0x483dc4[_0x7216('0x30')][_0x7216('0x32')]?_0x483dc4[_0x7216('0x30')]:_0x34ef07[_0x7216('0x2c')];if(!_0x2896a2[_0x7216('0x2e')]['hasOwnProperty'](_0x7216('0x33'))){_0x483dc4[_0x7216('0x1d')]=qs[_0x7216('0x1d')](_0x2896a2[_0x7216('0x2e')][_0x7216('0x1d')]);_0x483dc4['offset']=qs['offset'](_0x2896a2['query']['offset']);}_0x483dc4['order']=qs['sort'](_0x2896a2['query']['sort']);_0x483dc4[_0x7216('0x34')]=qs[_0x7216('0x2f')](_['pick'](_0x2896a2[_0x7216('0x2e')],_0x34ef07['filters']),_0x7cc112);if(_0x2896a2['query']['filter']){_0x483dc4['where']=_[_0x7216('0x35')](_0x483dc4[_0x7216('0x34')],{'$or':_['map'](_0x7cc112,function(_0x4bb3cc){if(_0x4bb3cc['type']!==_0x7216('0x36')){var _0x2aebec={};_0x2aebec[_0x4bb3cc['name']]={'$like':'%'+_0x2896a2[_0x7216('0x2e')][_0x7216('0x37')]+'%'};return _0x2aebec;}})});}_0x483dc4=_[_0x7216('0x35')]({},_0x483dc4,_0x2896a2[_0x7216('0x38')]);var _0x277ddb={'where':_0x483dc4['where']};return db[_0x7216('0x28')][_0x7216('0x1e')](_0x277ddb)[_0x7216('0x23')](function(_0x217373){_0x1942ed[_0x7216('0x1e')]=_0x217373;if(_0x2896a2[_0x7216('0x2e')][_0x7216('0x39')]){_0x483dc4[_0x7216('0x3a')]=[{'all':!![]}];}return db[_0x7216('0x28')][_0x7216('0x3b')](_0x483dc4);})[_0x7216('0x23')](function(_0x5d5b81){_0x1942ed[_0x7216('0x3c')]=_0x5d5b81;return _0x1942ed;})[_0x7216('0x23')](respondWithFilteredResult(_0x2012c2,_0x483dc4))[_0x7216('0x3d')](handleError(_0x2012c2,null));};exports[_0x7216('0x3e')]=function(_0x37eb77,_0x2145c5){var _0x30da43={'raw':![],'where':{'id':_0x37eb77[_0x7216('0x3f')]['id']}},_0x1c6fbc={};_0x1c6fbc[_0x7216('0x2c')]=_[_0x7216('0x2d')](db[_0x7216('0x28')][_0x7216('0x29')]);_0x1c6fbc['query']=_[_0x7216('0x2d')](_0x37eb77[_0x7216('0x2e')]);_0x1c6fbc[_0x7216('0x2f')]=_[_0x7216('0x40')](_0x1c6fbc[_0x7216('0x2c')],_0x1c6fbc['query']);_0x30da43['attributes']=_[_0x7216('0x40')](_0x1c6fbc[_0x7216('0x2c')],qs[_0x7216('0x31')](_0x37eb77[_0x7216('0x2e')][_0x7216('0x31')]));_0x30da43[_0x7216('0x30')]=_0x30da43[_0x7216('0x30')][_0x7216('0x32')]?_0x30da43[_0x7216('0x30')]:_0x1c6fbc[_0x7216('0x2c')];if(_0x37eb77[_0x7216('0x2e')][_0x7216('0x39')]){_0x30da43[_0x7216('0x3a')]=[{'all':!![]}];}_0x30da43=_[_0x7216('0x35')]({},_0x30da43,_0x37eb77[_0x7216('0x38')]);return db[_0x7216('0x28')][_0x7216('0x41')](_0x30da43)[_0x7216('0x23')](handleEntityNotFound(_0x2145c5,null))[_0x7216('0x23')](respondWithResult(_0x2145c5,null))[_0x7216('0x3d')](handleError(_0x2145c5,null));};exports['create']=function(_0x2661c4,_0xf08522){return db['VtigerAccount']['create'](_0x2661c4[_0x7216('0x42')],{})[_0x7216('0x23')](respondWithResult(_0xf08522,0xc9))[_0x7216('0x3d')](handleError(_0xf08522,null));};exports['update']=function(_0x3c0d9e,_0x587501){if(_0x3c0d9e['body']['id']){delete _0x3c0d9e[_0x7216('0x42')]['id'];}return db[_0x7216('0x28')]['find']({'where':{'id':_0x3c0d9e['params']['id']}})['then'](handleEntityNotFound(_0x587501,null))[_0x7216('0x23')](saveUpdates(_0x3c0d9e['body'],null))['then'](respondWithResult(_0x587501,null))[_0x7216('0x3d')](handleError(_0x587501,null));};exports['destroy']=function(_0x1b797f,_0x3e1985){return db[_0x7216('0x28')][_0x7216('0x41')]({'where':{'id':_0x1b797f[_0x7216('0x3f')]['id']}})[_0x7216('0x23')](handleEntityNotFound(_0x3e1985,null))[_0x7216('0x23')](removeEntity(_0x3e1985,null))[_0x7216('0x3d')](handleError(_0x3e1985,null));};exports[_0x7216('0x43')]=function(_0x2358ca,_0x4abf43,_0x3ba12a){var _0x904dde={};var _0x4f9dcc={};var _0x16a2e8;var _0x523bf9;return db[_0x7216('0x28')][_0x7216('0x44')]({'where':{'id':_0x2358ca[_0x7216('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4abf43,null))['then'](function(_0x8801c6){if(_0x8801c6){_0x16a2e8=_0x8801c6;_0x4f9dcc[_0x7216('0x2c')]=_[_0x7216('0x2d')](db['VtigerConfiguration'][_0x7216('0x29')]);_0x4f9dcc[_0x7216('0x2e')]=_[_0x7216('0x2d')](_0x2358ca[_0x7216('0x2e')]);_0x4f9dcc['filters']=_[_0x7216('0x40')](_0x4f9dcc[_0x7216('0x2c')],_0x4f9dcc[_0x7216('0x2e')]);_0x904dde[_0x7216('0x30')]=_[_0x7216('0x40')](_0x4f9dcc[_0x7216('0x2c')],qs[_0x7216('0x31')](_0x2358ca[_0x7216('0x2e')]['fields']));_0x904dde['attributes']=_0x904dde[_0x7216('0x30')][_0x7216('0x32')]?_0x904dde[_0x7216('0x30')]:_0x4f9dcc[_0x7216('0x2c')];_0x904dde[_0x7216('0x45')]=qs[_0x7216('0x46')](_0x2358ca[_0x7216('0x2e')][_0x7216('0x46')]);_0x904dde[_0x7216('0x34')]=qs['filters'](_[_0x7216('0x47')](_0x2358ca[_0x7216('0x2e')],_0x4f9dcc[_0x7216('0x2f')]));if(_0x2358ca[_0x7216('0x2e')][_0x7216('0x37')]){_0x904dde[_0x7216('0x34')]=_[_0x7216('0x35')](_0x904dde[_0x7216('0x34')],{'$or':_['map'](_0x904dde[_0x7216('0x30')],function(_0x21fff5){var _0x2c3b4d={};_0x2c3b4d[_0x21fff5]={'$like':'%'+_0x2358ca['query'][_0x7216('0x37')]+'%'};return _0x2c3b4d;})});}_0x904dde=_[_0x7216('0x35')]({},_0x904dde,_0x2358ca['options']);return _0x16a2e8[_0x7216('0x43')](_0x904dde);}})[_0x7216('0x23')](function(_0x30a6f8){if(_0x30a6f8){_0x523bf9=_0x30a6f8[_0x7216('0x32')];if(!_0x2358ca[_0x7216('0x2e')]['hasOwnProperty'](_0x7216('0x33'))){_0x904dde['limit']=qs[_0x7216('0x1d')](_0x2358ca[_0x7216('0x2e')]['limit']);_0x904dde[_0x7216('0x1c')]=qs[_0x7216('0x1c')](_0x2358ca[_0x7216('0x2e')][_0x7216('0x1c')]);}return _0x16a2e8[_0x7216('0x43')](_0x904dde);}})[_0x7216('0x23')](function(_0x51a998){if(_0x51a998){return _0x51a998?{'count':_0x523bf9,'rows':_0x51a998}:null;}})[_0x7216('0x23')](respondWithResult(_0x4abf43,null))['catch'](handleError(_0x4abf43,null));};exports[_0x7216('0x48')]=function(_0x58e783,_0x4038bb,_0x404f5e){if(_0x58e783[_0x7216('0x42')]['id']){delete _0x58e783[_0x7216('0x42')]['id'];}return db[_0x7216('0x28')]['findOne']({'where':{'id':_0x58e783[_0x7216('0x3f')]['id']}})[_0x7216('0x23')](handleEntityNotFound(_0x4038bb,null))[_0x7216('0x23')](function(_0x270a51){if(_0x270a51){_0x58e783[_0x7216('0x42')]['AccountId']=_0x270a51['id'];_0x58e783[_0x7216('0x42')]['Subjects']=integrations[_0x7216('0x49')](_0x58e783[_0x7216('0x42')][_0x7216('0x4a')],_0x58e783['body'][_0x7216('0x4b')]);_0x58e783[_0x7216('0x42')][_0x7216('0x4c')]=integrations['getDescriptions'](_0x58e783['body'][_0x7216('0x4a')],_0x58e783[_0x7216('0x42')][_0x7216('0x4b')]);return db['VtigerConfiguration'][_0x7216('0x4d')](_0x58e783[_0x7216('0x42')],{'include':[{'model':db[_0x7216('0x4e')],'as':_0x7216('0x4f')},{'model':db[_0x7216('0x4e')],'as':_0x7216('0x4c')}]});}return null;})['then'](respondWithResult(_0x4038bb,null))['catch'](handleError(_0x4038bb,null));};var md5=require('md5');exports['getFields']=function(_0x2a15be,_0xed3777,_0x1782e8){var _0x721fbb=null;var _0x4919bc=null;var _0x236441=null;var _0x367b1c=null;var _0x319ac8='';return db['VtigerAccount'][_0x7216('0x44')]({'where':{'id':_0x2a15be[_0x7216('0x3f')]['id']},'attributes':['id',_0x7216('0x25'),_0x7216('0x50'),_0x7216('0x51'),_0x7216('0x52'),_0x7216('0x53'),_0x7216('0x54'),'accessKey']})[_0x7216('0x23')](handleEntityNotFound(_0xed3777,null))[_0x7216('0x23')](function(_0x4c6866){if(_0x4c6866){_0x721fbb=_0x4c6866[_0x7216('0x50')];_0x4919bc=_0x4c6866[_0x7216('0x55')];_0x236441=_0x4c6866[_0x7216('0x52')];_0x319ac8=_0x4c6866[_0x7216('0x53')];var _0x259f2e=_0x319ac8['slice'](-0x1);if(_0x259f2e==='/'){_0x319ac8=_0x319ac8[_0x7216('0x56')](0x0,_0x319ac8[_0x7216('0x57')](_0x259f2e));}_0x367b1c=util[_0x7216('0x58')](_0x7216('0x59'),_0x319ac8);var _0x3144c4={'method':'GET','uri':_0x367b1c,'qs':{'operation':_0x7216('0x5a'),'username':_0x4c6866['username']},'json':!![]};return rp(_0x3144c4);}})[_0x7216('0x23')](function(_0x481ff1){if(_0x481ff1[_0x7216('0x5b')]){var _0x90e63a={'method':_0x7216('0x5c'),'uri':_0x367b1c,'form':{'operation':_0x7216('0x5d'),'username':_0x721fbb,'accessKey':md5(_0x481ff1[_0x7216('0x5e')]['token']+_0x4919bc)},'json':!![]};return rp(_0x90e63a);}})[_0x7216('0x23')](function(_0x52907a){if(_0x52907a['success']){var _0x2730da={'method':'GET','uri':_0x367b1c,'qs':{'operation':_0x7216('0x5f'),'username':_0x721fbb,'sessionName':_0x52907a[_0x7216('0x5e')][_0x7216('0x60')],'elementType':_0x236441},'json':!![]};return rp(_0x2730da);}})['then'](function(_0x3489c1){if(_0x3489c1['success']){var _0x15201f=[_0x7216('0x61'),_0x7216('0x62'),_0x7216('0x63')];_['remove'](_0x3489c1['result'][_0x7216('0x31')],function(_0x1db99b){return _0x15201f[_0x7216('0x64')](_0x1db99b[_0x7216('0x4b')][_0x7216('0x25')]);});_['remove'](_0x3489c1[_0x7216('0x5e')][_0x7216('0x31')],function(_0x40817c){return _0x40817c[_0x7216('0x65')]==='false';});return{'count':_0x3489c1[_0x7216('0x5e')][_0x7216('0x31')][_0x7216('0x32')],'rows':_['map'](_0x3489c1[_0x7216('0x5e')]['fields'],function(_0x12596d){return{'id':_0x12596d[_0x7216('0x25')],'name':_0x12596d[_0x7216('0x66')],'custom':_[_0x7216('0x67')](_0x12596d[_0x7216('0x25')],_0x7216('0x68'))?!![]:![],'options':_0x12596d[_0x7216('0x4b')][_0x7216('0x25')]==='picklist'&&_0x12596d[_0x7216('0x4b')][_0x7216('0x69')][_0x7216('0x32')]>0x0?_['map'](_0x12596d[_0x7216('0x4b')][_0x7216('0x69')],function(_0x38a300){return{'name':_0x38a300[_0x7216('0x66')],'value':_0x38a300['value']};}):[]};})};}})[_0x7216('0x23')](respondWithResult(_0xed3777,null))[_0x7216('0x3d')](function(_0x333b92){console[_0x7216('0x6a')]('vTiger\x20error:\x20'+_0x333b92);var _0x5b45b9=_0x2a15be['query'][_0x7216('0x6b')]?0x1f4:_0x333b92[_0x7216('0x6c')]||0x1f4;logger[_0x7216('0x6d')](_0x7216('0x6e'),_0x7216('0x6f'),_0x5b45b9,JSON[_0x7216('0x70')](_0x333b92));delete _0x333b92['name'];if(_0x5b45b9===0x191){_0x5b45b9=0x190;}_0xed3777['status'](_0x5b45b9)[_0x7216('0x26')](_0x2a15be[_0x7216('0x2e')][_0x7216('0x6b')]?{'message':_0x7216('0x71'),'statusCode':_0x333b92[_0x7216('0x6c')]}:_0x333b92);});}; \ No newline at end of file +var _0xda04=['set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','VtigerAccount','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','VtigerField','Descriptions','md5','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','success','login','result','token','describe','sessionName','autogenerated','owner','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','count','offset'];(function(_0x1ce8c8,_0x27a81b){var _0x462090=function(_0x564bd4){while(--_0x564bd4){_0x1ce8c8['push'](_0x1ce8c8['shift']());}};_0x462090(++_0x27a81b);}(_0xda04,0x14a));var _0x4da0=function(_0x49e8e2,_0x44d58c){_0x49e8e2=_0x49e8e2-0x0;var _0x1ee938=_0xda04[_0x49e8e2];return _0x1ee938;};'use strict';var emlformat=require(_0x4da0('0x0'));var rimraf=require(_0x4da0('0x1'));var zipdir=require(_0x4da0('0x2'));var jsonpatch=require(_0x4da0('0x3'));var rp=require(_0x4da0('0x4'));var moment=require(_0x4da0('0x5'));var BPromise=require(_0x4da0('0x6'));var Mustache=require(_0x4da0('0x7'));var util=require(_0x4da0('0x8'));var path=require(_0x4da0('0x9'));var sox=require(_0x4da0('0xa'));var csv=require(_0x4da0('0xb'));var ejs=require(_0x4da0('0xc'));var fs=require('fs');var fs_extra=require(_0x4da0('0xd'));var _=require('lodash');var squel=require(_0x4da0('0xe'));var crypto=require(_0x4da0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4da0('0xb'));var querystring=require(_0x4da0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4da0('0x11'));var qs=require(_0x4da0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4da0('0x13'));var logger=require(_0x4da0('0x14'))(_0x4da0('0x15'));var utils=require(_0x4da0('0x16'));var config=require(_0x4da0('0x17'));var licenseUtil=require(_0x4da0('0x18'));var db=require(_0x4da0('0x19'))['db'];var integrations=require(_0x4da0('0x1a'));function respondWithStatusCode(_0x4d2f9b,_0x16b21d){_0x16b21d=_0x16b21d||0xcc;return function(_0x23e22e){if(_0x23e22e){return _0x4d2f9b[_0x4da0('0x1b')](_0x16b21d);}return _0x4d2f9b[_0x4da0('0x1c')](_0x16b21d)[_0x4da0('0x1d')]();};}function respondWithResult(_0x2e6460,_0x5c2386){_0x5c2386=_0x5c2386||0xc8;return function(_0x82a480){if(_0x82a480){return _0x2e6460['status'](_0x5c2386)['json'](_0x82a480);}};}function respondWithFilteredResult(_0x78d2d9,_0x5b8eda){return function(_0x321ddd){if(_0x321ddd){var _0x2e979e=typeof _0x5b8eda['offset']==='undefined'&&typeof _0x5b8eda[_0x4da0('0x1e')]==='undefined';var _0x1eda67=_0x321ddd[_0x4da0('0x1f')];var _0x1bf082=_0x2e979e?0x0:_0x5b8eda[_0x4da0('0x20')];var _0x472501=_0x2e979e?_0x321ddd[_0x4da0('0x1f')]:_0x5b8eda[_0x4da0('0x20')]+_0x5b8eda[_0x4da0('0x1e')];var _0x359a8c;if(_0x472501>=_0x1eda67){_0x472501=_0x1eda67;_0x359a8c=0xc8;}else{_0x359a8c=0xce;}_0x78d2d9[_0x4da0('0x1c')](_0x359a8c);return _0x78d2d9[_0x4da0('0x21')](_0x4da0('0x22'),_0x1bf082+'-'+_0x472501+'/'+_0x1eda67)[_0x4da0('0x23')](_0x321ddd);}return null;};}function patchUpdates(_0x94f2bf){return function(_0x2e2e94){try{jsonpatch[_0x4da0('0x24')](_0x2e2e94,_0x94f2bf,!![]);}catch(_0x1ac4ca){return BPromise['reject'](_0x1ac4ca);}return _0x2e2e94[_0x4da0('0x25')]();};}function saveUpdates(_0x5515c1,_0x1307bc){return function(_0x245ad4){if(_0x245ad4){return _0x245ad4[_0x4da0('0x26')](_0x5515c1)[_0x4da0('0x27')](function(_0x2381a2){return _0x2381a2;});}return null;};}function removeEntity(_0x95974c,_0x18dea7){return function(_0xb32781){if(_0xb32781){return _0xb32781[_0x4da0('0x28')]()[_0x4da0('0x27')](function(){_0x95974c['status'](0xcc)[_0x4da0('0x1d')]();});}};}function handleEntityNotFound(_0x5100df,_0x3f420b){return function(_0x4c7d73){if(!_0x4c7d73){_0x5100df[_0x4da0('0x1b')](0x194);}return _0x4c7d73;};}function handleError(_0x1a34ea,_0x5b4d0d){_0x5b4d0d=_0x5b4d0d||0x1f4;return function(_0x1ac9e8){logger[_0x4da0('0x29')](_0x1ac9e8[_0x4da0('0x2a')]);if(_0x1ac9e8[_0x4da0('0x2b')]){delete _0x1ac9e8['name'];}_0x1a34ea['status'](_0x5b4d0d)[_0x4da0('0x2c')](_0x1ac9e8);};}exports['index']=function(_0x5d554f,_0x2b1c70){var _0x588b94={},_0x3b0ae5={},_0x3ff838={'count':0x0,'rows':[]};var _0x3b600f=_['map'](db['VtigerAccount'][_0x4da0('0x2d')],function(_0x4a5733){return{'name':_0x4a5733['fieldName'],'type':_0x4a5733['type'][_0x4da0('0x2e')]};});_0x3b0ae5[_0x4da0('0x2f')]=_[_0x4da0('0x30')](_0x3b600f,_0x4da0('0x2b'));_0x3b0ae5[_0x4da0('0x31')]=_['keys'](_0x5d554f[_0x4da0('0x31')]);_0x3b0ae5[_0x4da0('0x32')]=_[_0x4da0('0x33')](_0x3b0ae5[_0x4da0('0x2f')],_0x3b0ae5['query']);_0x588b94[_0x4da0('0x34')]=_['intersection'](_0x3b0ae5[_0x4da0('0x2f')],qs[_0x4da0('0x35')](_0x5d554f['query'][_0x4da0('0x35')]));_0x588b94[_0x4da0('0x34')]=_0x588b94[_0x4da0('0x34')][_0x4da0('0x36')]?_0x588b94['attributes']:_0x3b0ae5[_0x4da0('0x2f')];if(!_0x5d554f[_0x4da0('0x31')]['hasOwnProperty'](_0x4da0('0x37'))){_0x588b94[_0x4da0('0x1e')]=qs[_0x4da0('0x1e')](_0x5d554f[_0x4da0('0x31')][_0x4da0('0x1e')]);_0x588b94[_0x4da0('0x20')]=qs[_0x4da0('0x20')](_0x5d554f[_0x4da0('0x31')][_0x4da0('0x20')]);}_0x588b94[_0x4da0('0x38')]=qs[_0x4da0('0x39')](_0x5d554f[_0x4da0('0x31')]['sort']);_0x588b94[_0x4da0('0x3a')]=qs['filters'](_[_0x4da0('0x3b')](_0x5d554f[_0x4da0('0x31')],_0x3b0ae5['filters']),_0x3b600f);if(_0x5d554f[_0x4da0('0x31')]['filter']){_0x588b94[_0x4da0('0x3a')]=_[_0x4da0('0x3c')](_0x588b94[_0x4da0('0x3a')],{'$or':_[_0x4da0('0x30')](_0x3b600f,function(_0x1a2550){if(_0x1a2550[_0x4da0('0x3d')]!==_0x4da0('0x3e')){var _0x463dff={};_0x463dff[_0x1a2550[_0x4da0('0x2b')]]={'$like':'%'+_0x5d554f[_0x4da0('0x31')]['filter']+'%'};return _0x463dff;}})});}_0x588b94=_['merge']({},_0x588b94,_0x5d554f[_0x4da0('0x3f')]);var _0x5f4df0={'where':_0x588b94[_0x4da0('0x3a')]};return db['VtigerAccount'][_0x4da0('0x1f')](_0x5f4df0)[_0x4da0('0x27')](function(_0x48e6ce){_0x3ff838['count']=_0x48e6ce;if(_0x5d554f['query'][_0x4da0('0x40')]){_0x588b94[_0x4da0('0x41')]=[{'all':!![]}];}return db[_0x4da0('0x42')][_0x4da0('0x43')](_0x588b94);})['then'](function(_0x3933e5){_0x3ff838[_0x4da0('0x44')]=_0x3933e5;return _0x3ff838;})[_0x4da0('0x27')](respondWithFilteredResult(_0x2b1c70,_0x588b94))[_0x4da0('0x45')](handleError(_0x2b1c70,null));};exports[_0x4da0('0x46')]=function(_0x59cefc,_0x20f2d4){var _0x27f178={'raw':![],'where':{'id':_0x59cefc[_0x4da0('0x47')]['id']}},_0x5dcd14={};_0x5dcd14[_0x4da0('0x2f')]=_['keys'](db[_0x4da0('0x42')][_0x4da0('0x2d')]);_0x5dcd14[_0x4da0('0x31')]=_[_0x4da0('0x48')](_0x59cefc[_0x4da0('0x31')]);_0x5dcd14[_0x4da0('0x32')]=_[_0x4da0('0x33')](_0x5dcd14[_0x4da0('0x2f')],_0x5dcd14[_0x4da0('0x31')]);_0x27f178[_0x4da0('0x34')]=_['intersection'](_0x5dcd14[_0x4da0('0x2f')],qs[_0x4da0('0x35')](_0x59cefc['query'][_0x4da0('0x35')]));_0x27f178[_0x4da0('0x34')]=_0x27f178['attributes']['length']?_0x27f178[_0x4da0('0x34')]:_0x5dcd14[_0x4da0('0x2f')];if(_0x59cefc[_0x4da0('0x31')][_0x4da0('0x40')]){_0x27f178[_0x4da0('0x41')]=[{'all':!![]}];}_0x27f178=_['merge']({},_0x27f178,_0x59cefc['options']);return db[_0x4da0('0x42')][_0x4da0('0x49')](_0x27f178)[_0x4da0('0x27')](handleEntityNotFound(_0x20f2d4,null))[_0x4da0('0x27')](respondWithResult(_0x20f2d4,null))[_0x4da0('0x45')](handleError(_0x20f2d4,null));};exports[_0x4da0('0x4a')]=function(_0x396fe4,_0x24aac3){return db['VtigerAccount']['create'](_0x396fe4['body'],{})['then'](respondWithResult(_0x24aac3,0xc9))[_0x4da0('0x45')](handleError(_0x24aac3,null));};exports[_0x4da0('0x26')]=function(_0x5cb0f2,_0x44464c){if(_0x5cb0f2[_0x4da0('0x4b')]['id']){delete _0x5cb0f2['body']['id'];}return db[_0x4da0('0x42')][_0x4da0('0x49')]({'where':{'id':_0x5cb0f2['params']['id']}})[_0x4da0('0x27')](handleEntityNotFound(_0x44464c,null))['then'](saveUpdates(_0x5cb0f2[_0x4da0('0x4b')],null))[_0x4da0('0x27')](respondWithResult(_0x44464c,null))[_0x4da0('0x45')](handleError(_0x44464c,null));};exports[_0x4da0('0x28')]=function(_0x10797e,_0x603dc0){return db[_0x4da0('0x42')][_0x4da0('0x49')]({'where':{'id':_0x10797e[_0x4da0('0x47')]['id']}})['then'](handleEntityNotFound(_0x603dc0,null))[_0x4da0('0x27')](removeEntity(_0x603dc0,null))[_0x4da0('0x45')](handleError(_0x603dc0,null));};exports[_0x4da0('0x4c')]=function(_0x119094,_0x1743d3,_0x5f9135){var _0x3f200d={};var _0x25b279={};var _0x18a057;var _0x483bba;return db['VtigerAccount']['findOne']({'where':{'id':_0x119094[_0x4da0('0x47')]['id']}})[_0x4da0('0x27')](handleEntityNotFound(_0x1743d3,null))[_0x4da0('0x27')](function(_0x58efa8){if(_0x58efa8){_0x18a057=_0x58efa8;_0x25b279[_0x4da0('0x2f')]=_[_0x4da0('0x48')](db['VtigerConfiguration'][_0x4da0('0x2d')]);_0x25b279[_0x4da0('0x31')]=_['keys'](_0x119094[_0x4da0('0x31')]);_0x25b279[_0x4da0('0x32')]=_[_0x4da0('0x33')](_0x25b279[_0x4da0('0x2f')],_0x25b279[_0x4da0('0x31')]);_0x3f200d[_0x4da0('0x34')]=_[_0x4da0('0x33')](_0x25b279[_0x4da0('0x2f')],qs[_0x4da0('0x35')](_0x119094[_0x4da0('0x31')][_0x4da0('0x35')]));_0x3f200d['attributes']=_0x3f200d['attributes'][_0x4da0('0x36')]?_0x3f200d[_0x4da0('0x34')]:_0x25b279[_0x4da0('0x2f')];_0x3f200d[_0x4da0('0x38')]=qs[_0x4da0('0x39')](_0x119094['query'][_0x4da0('0x39')]);_0x3f200d['where']=qs['filters'](_[_0x4da0('0x3b')](_0x119094[_0x4da0('0x31')],_0x25b279[_0x4da0('0x32')]));if(_0x119094['query'][_0x4da0('0x4d')]){_0x3f200d[_0x4da0('0x3a')]=_[_0x4da0('0x3c')](_0x3f200d['where'],{'$or':_['map'](_0x3f200d['attributes'],function(_0x56d77d){var _0x44cb28={};_0x44cb28[_0x56d77d]={'$like':'%'+_0x119094[_0x4da0('0x31')][_0x4da0('0x4d')]+'%'};return _0x44cb28;})});}_0x3f200d=_[_0x4da0('0x3c')]({},_0x3f200d,_0x119094[_0x4da0('0x3f')]);return _0x18a057['getConfigurations'](_0x3f200d);}})[_0x4da0('0x27')](function(_0x5a2df9){if(_0x5a2df9){_0x483bba=_0x5a2df9['length'];if(!_0x119094['query']['hasOwnProperty'](_0x4da0('0x37'))){_0x3f200d[_0x4da0('0x1e')]=qs['limit'](_0x119094[_0x4da0('0x31')][_0x4da0('0x1e')]);_0x3f200d[_0x4da0('0x20')]=qs[_0x4da0('0x20')](_0x119094['query'][_0x4da0('0x20')]);}return _0x18a057[_0x4da0('0x4c')](_0x3f200d);}})[_0x4da0('0x27')](function(_0x5d1c77){if(_0x5d1c77){return _0x5d1c77?{'count':_0x483bba,'rows':_0x5d1c77}:null;}})[_0x4da0('0x27')](respondWithResult(_0x1743d3,null))[_0x4da0('0x45')](handleError(_0x1743d3,null));};exports[_0x4da0('0x4e')]=function(_0x16bc56,_0x2ead81,_0x140b21){if(_0x16bc56[_0x4da0('0x4b')]['id']){delete _0x16bc56[_0x4da0('0x4b')]['id'];}return db[_0x4da0('0x42')][_0x4da0('0x4f')]({'where':{'id':_0x16bc56[_0x4da0('0x47')]['id']}})[_0x4da0('0x27')](handleEntityNotFound(_0x2ead81,null))[_0x4da0('0x27')](function(_0x18353d){if(_0x18353d){_0x16bc56[_0x4da0('0x4b')][_0x4da0('0x50')]=_0x18353d['id'];_0x16bc56['body'][_0x4da0('0x51')]=integrations[_0x4da0('0x52')](_0x16bc56['body']['channel'],_0x16bc56[_0x4da0('0x4b')][_0x4da0('0x3d')]);_0x16bc56['body']['Descriptions']=integrations[_0x4da0('0x53')](_0x16bc56['body']['channel'],_0x16bc56[_0x4da0('0x4b')]['type']);return db['VtigerConfiguration']['create'](_0x16bc56[_0x4da0('0x4b')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x4da0('0x54')],'as':_0x4da0('0x55')}]});}return null;})[_0x4da0('0x27')](respondWithResult(_0x2ead81,null))['catch'](handleError(_0x2ead81,null));};var md5=require(_0x4da0('0x56'));exports['getFields']=function(_0xa2ad6c,_0x4dfa39,_0xa6fe42){var _0x3f1568=null;var _0x25cb1f=null;var _0x398c8b=null;var _0x397aab=null;var _0x1bbbb3='';return db[_0x4da0('0x42')]['findOne']({'where':{'id':_0xa2ad6c[_0x4da0('0x47')]['id']},'attributes':['id',_0x4da0('0x2b'),'username',_0x4da0('0x57'),_0x4da0('0x58'),_0x4da0('0x59'),_0x4da0('0x5a'),_0x4da0('0x5b')]})[_0x4da0('0x27')](handleEntityNotFound(_0x4dfa39,null))[_0x4da0('0x27')](function(_0x40652a){if(_0x40652a){_0x3f1568=_0x40652a[_0x4da0('0x5c')];_0x25cb1f=_0x40652a[_0x4da0('0x5b')];_0x398c8b=_0x40652a[_0x4da0('0x58')];_0x1bbbb3=_0x40652a['remoteUri'];var _0x3838d9=_0x1bbbb3[_0x4da0('0x5d')](-0x1);if(_0x3838d9==='/'){_0x1bbbb3=_0x1bbbb3['substring'](0x0,_0x1bbbb3[_0x4da0('0x5e')](_0x3838d9));}_0x397aab=util['format'](_0x4da0('0x5f'),_0x1bbbb3);var _0x5131fd={'method':_0x4da0('0x60'),'uri':_0x397aab,'qs':{'operation':_0x4da0('0x61'),'username':_0x40652a[_0x4da0('0x5c')]},'json':!![]};return rp(_0x5131fd);}})[_0x4da0('0x27')](function(_0x3b7d28){if(_0x3b7d28[_0x4da0('0x62')]){var _0x26e82e={'method':'POST','uri':_0x397aab,'form':{'operation':_0x4da0('0x63'),'username':_0x3f1568,'accessKey':md5(_0x3b7d28[_0x4da0('0x64')][_0x4da0('0x65')]+_0x25cb1f)},'json':!![]};return rp(_0x26e82e);}})[_0x4da0('0x27')](function(_0x3825f7){if(_0x3825f7[_0x4da0('0x62')]){var _0x30fd08={'method':'GET','uri':_0x397aab,'qs':{'operation':_0x4da0('0x66'),'username':_0x3f1568,'sessionName':_0x3825f7[_0x4da0('0x64')][_0x4da0('0x67')],'elementType':_0x398c8b},'json':!![]};return rp(_0x30fd08);}})[_0x4da0('0x27')](function(_0x5e227c){if(_0x5e227c['success']){var _0x4d2dec=[_0x4da0('0x68'),'reference',_0x4da0('0x69')];_[_0x4da0('0x6a')](_0x5e227c[_0x4da0('0x64')][_0x4da0('0x35')],function(_0x5c217b){return _0x4d2dec[_0x4da0('0x6b')](_0x5c217b[_0x4da0('0x3d')]['name']);});_[_0x4da0('0x6a')](_0x5e227c[_0x4da0('0x64')][_0x4da0('0x35')],function(_0x19ee6a){return _0x19ee6a[_0x4da0('0x6c')]==='false';});return{'count':_0x5e227c['result'][_0x4da0('0x35')]['length'],'rows':_[_0x4da0('0x30')](_0x5e227c[_0x4da0('0x64')][_0x4da0('0x35')],function(_0x381fe5){return{'id':_0x381fe5['name'],'name':_0x381fe5[_0x4da0('0x6d')],'custom':_[_0x4da0('0x6e')](_0x381fe5[_0x4da0('0x2b')],_0x4da0('0x6f'))?!![]:![],'options':_0x381fe5[_0x4da0('0x3d')][_0x4da0('0x2b')]===_0x4da0('0x70')&&_0x381fe5['type']['picklistValues']['length']>0x0?_['map'](_0x381fe5[_0x4da0('0x3d')][_0x4da0('0x71')],function(_0x124755){return{'name':_0x124755[_0x4da0('0x6d')],'value':_0x124755[_0x4da0('0x72')]};}):[]};})};}})[_0x4da0('0x27')](respondWithResult(_0x4dfa39,null))[_0x4da0('0x45')](function(_0x1e7b7b){console[_0x4da0('0x73')]('vTiger\x20error:\x20'+_0x1e7b7b);var _0x5ed175=_0xa2ad6c[_0x4da0('0x31')][_0x4da0('0x74')]?0x1f4:_0x1e7b7b[_0x4da0('0x75')]||0x1f4;logger[_0x4da0('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x4da0('0x76'),_0x5ed175,JSON[_0x4da0('0x77')](_0x1e7b7b));delete _0x1e7b7b[_0x4da0('0x2b')];if(_0x5ed175===0x191){_0x5ed175=0x190;}_0x4dfa39[_0x4da0('0x1c')](_0x5ed175)[_0x4da0('0x2c')](_0xa2ad6c[_0x4da0('0x31')]['test']?{'message':_0x4da0('0x78'),'statusCode':_0x1e7b7b['statusCode']}:_0x1e7b7b);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3d4b56b..3cba91e 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 _0xaef0=['VtigerAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x4b59cf,_0x11e2f5){var _0x4a9ca6=function(_0x40d895){while(--_0x40d895){_0x4b59cf['push'](_0x4b59cf['shift']());}};_0x4a9ca6(++_0x11e2f5);}(_0xaef0,0x1c8));var _0x0aef=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xaef0[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0x0aef('0x0'));var util=require('util');var logger=require(_0x0aef('0x1'))(_0x0aef('0x2'));var moment=require(_0x0aef('0x3'));var BPromise=require(_0x0aef('0x4'));var rp=require(_0x0aef('0x5'));var fs=require('fs');var path=require(_0x0aef('0x6'));var rimraf=require(_0x0aef('0x7'));var config=require(_0x0aef('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x0aef('0x9'));module[_0x0aef('0xa')]=function(_0x2b1ecc,_0x5b16cd){return _0x2b1ecc[_0x0aef('0xb')](_0x0aef('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e82=['api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','lodash','util','../../config/logger'];(function(_0xcbe294,_0x1b2baf){var _0x4fdaf2=function(_0x3ce956){while(--_0x3ce956){_0xcbe294['push'](_0xcbe294['shift']());}};_0x4fdaf2(++_0x1b2baf);}(_0x7e82,0x105));var _0x27e8=function(_0x409824,_0x183265){_0x409824=_0x409824-0x0;var _0x331383=_0x7e82[_0x409824];return _0x331383;};'use strict';var _=require(_0x27e8('0x0'));var util=require(_0x27e8('0x1'));var logger=require(_0x27e8('0x2'))(_0x27e8('0x3'));var moment=require('moment');var BPromise=require(_0x27e8('0x4'));var rp=require(_0x27e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27e8('0x6'));var config=require(_0x27e8('0x7'));var attributes=require(_0x27e8('0x8'));var integrations=require(_0x27e8('0x9'));module['exports']=function(_0x1ef359,_0x31a562){return _0x1ef359[_0x27e8('0xa')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1e7fe8e..1503fe3 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 _0x39cb=['request','then','info','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','map','include','model','debug','ShowVtigerAccount','raw','where','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3130a0,_0x58866e){var _0x59c1a6=function(_0x490f9d){while(--_0x490f9d){_0x3130a0['push'](_0x3130a0['shift']());}};_0x59c1a6(++_0x58866e);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')]({'raw':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['where']||null:null,'attributes':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1a')]||null:null,'limit':_0x4e02cf['options']?_0x4e02cf['options'][_0xb39c('0x1b')]||null:null,'include':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['include']?_[_0xb39c('0x1c')](_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x16f3b0){return{'model':db[_0x16f3b0[_0xb39c('0x1e')]],'as':_0x16f3b0['as'],'attributes':_0x16f3b0['attributes'],'include':_0x16f3b0[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x16f3b0['include'],function(_0x1fd145){return{'model':db[_0x1fd145[_0xb39c('0x1e')]],'as':_0x1fd145['as'],'attributes':_0x1fd145[_0xb39c('0x1a')],'include':_0x1fd145[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x1fd145['include'],function(_0x23a2f1){return{'model':db[_0x23a2f1[_0xb39c('0x1e')]],'as':_0x23a2f1['as'],'attributes':_0x23a2f1[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fff2){logger[_0xb39c('0xc')]('GetVtigerAccount',_0x4e02cf);logger[_0xb39c('0x1f')](_0xb39c('0x16'),_0x4e02cf,JSON[_0xb39c('0xf')](_0x41fff2));_0x2eeae6(_0x41fff2);})['catch'](function(_0x714d20){logger[_0xb39c('0x10')]('GetVtigerAccount',_0x714d20[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade['error'](0x1f4,_0x714d20[_0xb39c('0x13')]));});});};exports[_0xb39c('0x20')]=function(_0x309697){var _0x7339b4=this;return new Promise(function(_0x17eb7b,_0x52e642){return db[_0xb39c('0x17')]['find']({'raw':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x21')]===undefined?!![]:![]:!![],'where':_0x309697[_0xb39c('0x19')]?_0x309697[_0xb39c('0x19')][_0xb39c('0x22')]||null:null,'attributes':_0x309697['options']?_0x309697['options'][_0xb39c('0x1a')]||null:null,'include':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x309697[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x14a92f){return{'model':db[_0x14a92f[_0xb39c('0x1e')]],'as':_0x14a92f['as'],'attributes':_0x14a92f[_0xb39c('0x1a')],'include':_0x14a92f[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x14a92f[_0xb39c('0x1d')],function(_0x15882d){return{'model':db[_0x15882d[_0xb39c('0x1e')]],'as':_0x15882d['as'],'attributes':_0x15882d[_0xb39c('0x1a')],'include':_0x15882d[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x15882d[_0xb39c('0x1d')],function(_0x8e5a74){return{'model':db[_0x8e5a74[_0xb39c('0x1e')]],'as':_0x8e5a74['as'],'attributes':_0x8e5a74[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2b40){logger[_0xb39c('0xc')]('ShowVtigerAccount',_0x309697);logger['debug']('ShowVtigerAccount',_0x309697,JSON[_0xb39c('0xf')](_0x2c2b40));_0x17eb7b(_0x2c2b40);})[_0xb39c('0x15')](function(_0xe6bc2e){logger['error'](_0xb39c('0x20'),_0xe6bc2e[_0xb39c('0x13')],_0x309697);_0x52e642(_0x7339b4[_0xb39c('0x10')](0x1f4,_0xe6bc2e[_0xb39c('0x13')]));});});}; \ No newline at end of file +var _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0xda3f,0xec));var _0xfda3=function(_0xe17628,_0x12414d){_0xe17628=_0xe17628-0x0;var _0x519519=_0xda3f[_0xe17628];return _0x519519;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 984c1aa..6cc151a 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 _0x1b6c=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x2008cb,_0x4666cb){var _0x1f9647=function(_0x17f83c){while(--_0x17f83c){_0x2008cb['push'](_0x2008cb['shift']());}};_0x1f9647(++_0x4666cb);}(_0x1b6c,0x12c));var _0xc1b6=function(_0x39b007,_0x45f4a8){_0x39b007=_0x39b007-0x0;var _0x26f00d=_0x1b6c[_0x39b007];return _0x26f00d;};'use strict';var multer=require(_0xc1b6('0x0'));var util=require(_0xc1b6('0x1'));var path=require(_0xc1b6('0x2'));var timeout=require(_0xc1b6('0x3'));var express=require('express');var router=express[_0xc1b6('0x4')]();var fs_extra=require(_0xc1b6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc1b6('0x6'));var config=require(_0xc1b6('0x7'));var controller=require(_0xc1b6('0x8'));router[_0xc1b6('0x9')]('/',auth[_0xc1b6('0xa')](),controller[_0xc1b6('0xb')]);router['get'](_0xc1b6('0xc'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0xd')]);router[_0xc1b6('0x9')](_0xc1b6('0xe'),auth[_0xc1b6('0xa')](),controller['getFields']);router[_0xc1b6('0x9')](_0xc1b6('0xf'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0x10')]);router[_0xc1b6('0x9')](_0xc1b6('0x11'),auth[_0xc1b6('0xa')](),controller['getDescriptions']);router[_0xc1b6('0x12')]('/',auth[_0xc1b6('0xa')](),controller['create']);router[_0xc1b6('0x13')](_0xc1b6('0xc'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0x14')]);router[_0xc1b6('0x15')](_0xc1b6('0xc'),auth[_0xc1b6('0xa')](),controller[_0xc1b6('0x16')]);module[_0xc1b6('0x17')]=router; \ No newline at end of file +var _0x3ed9=['delete','/:id','destroy','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0x3ed9,0xcc));var _0x93ed=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x3ed9[_0x5beda8];return _0x2aa042;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x93ed('0x0'));var timeout=require(_0x93ed('0x1'));var express=require(_0x93ed('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x93ed('0x3'));var config=require(_0x93ed('0x4'));var controller=require(_0x93ed('0x5'));router['get']('/',auth[_0x93ed('0x6')](),controller['index']);router[_0x93ed('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x93ed('0x8'),auth[_0x93ed('0x6')](),controller[_0x93ed('0x9')]);router[_0x93ed('0x7')]('/:id/subjects',auth[_0x93ed('0x6')](),controller[_0x93ed('0xa')]);router[_0x93ed('0x7')](_0x93ed('0xb'),auth[_0x93ed('0x6')](),controller[_0x93ed('0xc')]);router[_0x93ed('0xd')]('/',auth[_0x93ed('0x6')](),controller['create']);router[_0x93ed('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x93ed('0xf')]);router[_0x93ed('0x10')](_0x93ed('0x11'),auth[_0x93ed('0x6')](),controller[_0x93ed('0x12')]);module[_0x93ed('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7ec03e1..a0df8d7 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 _0x736a=['STRING','exports'];(function(_0x1b8448,_0x47e0a4){var _0x8954e1=function(_0x4cecd4){while(--_0x4cecd4){_0x1b8448['push'](_0x1b8448['shift']());}};_0x8954e1(++_0x47e0a4);}(_0x736a,0x149));var _0xa736=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x736a[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require('sequelize');module[_0xa736('0x0')]={'name':{'type':Sequelize[_0xa736('0x1')]},'description':{'type':Sequelize[_0xa736('0x1')]}}; \ No newline at end of file +var _0x53b4=['STRING','exports'];(function(_0x2b4fce,_0x29c6cd){var _0x8385a=function(_0x3e171a){while(--_0x3e171a){_0x2b4fce['push'](_0x2b4fce['shift']());}};_0x8385a(++_0x29c6cd);}(_0x53b4,0x1bf));var _0x453b=function(_0x17c579,_0x1968f3){_0x17c579=_0x17c579-0x0;var _0xe506d7=_0x53b4[_0x17c579];return _0xe506d7;};'use strict';var Sequelize=require('sequelize');module[_0x453b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x453b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 008e49b..290f033 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 _0x0ccc=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','include','find','create','body','findOne','VtigerField','pick','getFields','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x58398b,_0x595eff){var _0x28f423=function(_0x53041f){while(--_0x53041f){_0x58398b['push'](_0x58398b['shift']());}};_0x28f423(++_0x595eff);}(_0x0ccc,0x90));var _0xc0cc=function(_0x5ad0b3,_0x4a2a52){_0x5ad0b3=_0x5ad0b3-0x0;var _0x5d0bb5=_0x0ccc[_0x5ad0b3];return _0x5d0bb5;};'use strict';var emlformat=require(_0xc0cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0cc('0x3'));var util=require(_0xc0cc('0x4'));var path=require(_0xc0cc('0x5'));var sox=require(_0xc0cc('0x6'));var csv=require(_0xc0cc('0x7'));var ejs=require(_0xc0cc('0x8'));var fs=require('fs');var fs_extra=require(_0xc0cc('0x9'));var _=require('lodash');var squel=require(_0xc0cc('0xa'));var crypto=require(_0xc0cc('0xb'));var jsforce=require(_0xc0cc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc0cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xc0cc('0xe'));var authService=require(_0xc0cc('0xf'));var qs=require(_0xc0cc('0x10'));var as=require(_0xc0cc('0x11'));var hardwareService=require(_0xc0cc('0x12'));var logger=require(_0xc0cc('0x13'))(_0xc0cc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc0cc('0x15'));var db=require(_0xc0cc('0x16'))['db'];function respondWithStatusCode(_0x278e28,_0x5ebcb9){_0x5ebcb9=_0x5ebcb9||0xcc;return function(_0x5578d9){if(_0x5578d9){return _0x278e28['sendStatus'](_0x5ebcb9);}return _0x278e28[_0xc0cc('0x17')](_0x5ebcb9)['end']();};}function respondWithResult(_0xdff6be,_0x143c7e){_0x143c7e=_0x143c7e||0xc8;return function(_0x497a92){if(_0x497a92){return _0xdff6be[_0xc0cc('0x17')](_0x143c7e)['json'](_0x497a92);}};}function respondWithFilteredResult(_0x3b3f59,_0x153034){return function(_0x552ab0){if(_0x552ab0){var _0x3b0a68=typeof _0x153034[_0xc0cc('0x18')]===_0xc0cc('0x19')&&typeof _0x153034[_0xc0cc('0x1a')]==='undefined';var _0x3f359c=_0x552ab0[_0xc0cc('0x1b')];var _0x1bfcb8=_0x3b0a68?0x0:_0x153034['offset'];var _0xc0a8af=_0x3b0a68?_0x552ab0[_0xc0cc('0x1b')]:_0x153034[_0xc0cc('0x18')]+_0x153034['limit'];var _0x1f5c38;if(_0xc0a8af>=_0x3f359c){_0xc0a8af=_0x3f359c;_0x1f5c38=0xc8;}else{_0x1f5c38=0xce;}_0x3b3f59['status'](_0x1f5c38);return _0x3b3f59[_0xc0cc('0x1c')](_0xc0cc('0x1d'),_0x1bfcb8+'-'+_0xc0a8af+'/'+_0x3f359c)[_0xc0cc('0x1e')](_0x552ab0);}return null;};}function patchUpdates(_0x2a7a84){return function(_0xf6fa8a){try{jsonpatch[_0xc0cc('0x1f')](_0xf6fa8a,_0x2a7a84,!![]);}catch(_0x59fb2d){return BPromise[_0xc0cc('0x20')](_0x59fb2d);}return _0xf6fa8a['save']();};}function saveUpdates(_0x402aa2,_0x3616f9){return function(_0x414e16){if(_0x414e16){return _0x414e16[_0xc0cc('0x21')](_0x402aa2)[_0xc0cc('0x22')](function(_0x5eca8){return _0x5eca8;});}return null;};}function removeEntity(_0x34b529,_0x46015d){return function(_0x145d3c){if(_0x145d3c){return _0x145d3c[_0xc0cc('0x23')]()['then'](function(){_0x34b529[_0xc0cc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x149926,_0x4d6cb5){return function(_0x357ed3){if(!_0x357ed3){_0x149926['sendStatus'](0x194);}return _0x357ed3;};}function handleError(_0x5b033f,_0xa8942d){_0xa8942d=_0xa8942d||0x1f4;return function(_0x58c308){logger[_0xc0cc('0x24')](_0x58c308[_0xc0cc('0x25')]);if(_0x58c308[_0xc0cc('0x26')]){delete _0x58c308['name'];}_0x5b033f[_0xc0cc('0x17')](_0xa8942d)['send'](_0x58c308);};}exports[_0xc0cc('0x27')]=function(_0x479f80,_0xc2f435){var _0x1e0b91={},_0x458e31={},_0x48f707={'count':0x0,'rows':[]};var _0x7bb30f=_[_0xc0cc('0x28')](db[_0xc0cc('0x29')][_0xc0cc('0x2a')],function(_0x3dda06){return{'name':_0x3dda06[_0xc0cc('0x2b')],'type':_0x3dda06[_0xc0cc('0x2c')][_0xc0cc('0x2d')]};});_0x458e31[_0xc0cc('0x2e')]=_[_0xc0cc('0x28')](_0x7bb30f,'name');_0x458e31[_0xc0cc('0x2f')]=_['keys'](_0x479f80[_0xc0cc('0x2f')]);_0x458e31[_0xc0cc('0x30')]=_['intersection'](_0x458e31[_0xc0cc('0x2e')],_0x458e31['query']);_0x1e0b91[_0xc0cc('0x31')]=_[_0xc0cc('0x32')](_0x458e31[_0xc0cc('0x2e')],qs['fields'](_0x479f80[_0xc0cc('0x2f')][_0xc0cc('0x33')]));_0x1e0b91[_0xc0cc('0x31')]=_0x1e0b91[_0xc0cc('0x31')]['length']?_0x1e0b91[_0xc0cc('0x31')]:_0x458e31[_0xc0cc('0x2e')];if(!_0x479f80[_0xc0cc('0x2f')][_0xc0cc('0x34')]('nolimit')){_0x1e0b91[_0xc0cc('0x1a')]=qs[_0xc0cc('0x1a')](_0x479f80['query']['limit']);_0x1e0b91[_0xc0cc('0x18')]=qs[_0xc0cc('0x18')](_0x479f80[_0xc0cc('0x2f')][_0xc0cc('0x18')]);}_0x1e0b91[_0xc0cc('0x35')]=qs[_0xc0cc('0x36')](_0x479f80[_0xc0cc('0x2f')][_0xc0cc('0x36')]);_0x1e0b91[_0xc0cc('0x37')]=qs['filters'](_['pick'](_0x479f80[_0xc0cc('0x2f')],_0x458e31['filters']),_0x7bb30f);if(_0x479f80['query'][_0xc0cc('0x38')]){_0x1e0b91['where']=_[_0xc0cc('0x39')](_0x1e0b91['where'],{'$or':_[_0xc0cc('0x28')](_0x7bb30f,function(_0x266290){if(_0x266290[_0xc0cc('0x2c')]!==_0xc0cc('0x3a')){var _0x5dfc06={};_0x5dfc06[_0x266290[_0xc0cc('0x26')]]={'$like':'%'+_0x479f80['query'][_0xc0cc('0x38')]+'%'};return _0x5dfc06;}})});}_0x1e0b91=_[_0xc0cc('0x39')]({},_0x1e0b91,_0x479f80[_0xc0cc('0x3b')]);var _0x332d52={'where':_0x1e0b91[_0xc0cc('0x37')]};return db[_0xc0cc('0x29')][_0xc0cc('0x1b')](_0x332d52)[_0xc0cc('0x22')](function(_0x20d67b){_0x48f707[_0xc0cc('0x1b')]=_0x20d67b;if(_0x479f80[_0xc0cc('0x2f')][_0xc0cc('0x3c')]){_0x1e0b91['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x1e0b91);})['then'](function(_0x340960){_0x48f707[_0xc0cc('0x3d')]=_0x340960;return _0x48f707;})[_0xc0cc('0x22')](respondWithFilteredResult(_0xc2f435,_0x1e0b91))[_0xc0cc('0x3e')](handleError(_0xc2f435,null));};exports[_0xc0cc('0x3f')]=function(_0x5bda84,_0x547ef6){var _0x13d9a9={'raw':![],'where':{'id':_0x5bda84[_0xc0cc('0x40')]['id']}},_0x5c1d1c={};_0x5c1d1c['model']=_[_0xc0cc('0x41')](db[_0xc0cc('0x29')]['rawAttributes']);_0x5c1d1c[_0xc0cc('0x2f')]=_[_0xc0cc('0x41')](_0x5bda84[_0xc0cc('0x2f')]);_0x5c1d1c['filters']=_[_0xc0cc('0x32')](_0x5c1d1c[_0xc0cc('0x2e')],_0x5c1d1c[_0xc0cc('0x2f')]);_0x13d9a9[_0xc0cc('0x31')]=_['intersection'](_0x5c1d1c[_0xc0cc('0x2e')],qs[_0xc0cc('0x33')](_0x5bda84[_0xc0cc('0x2f')][_0xc0cc('0x33')]));_0x13d9a9[_0xc0cc('0x31')]=_0x13d9a9[_0xc0cc('0x31')][_0xc0cc('0x42')]?_0x13d9a9['attributes']:_0x5c1d1c[_0xc0cc('0x2e')];if(_0x5bda84[_0xc0cc('0x2f')]['includeAll']){_0x13d9a9[_0xc0cc('0x43')]=[{'all':!![]}];}_0x13d9a9=_[_0xc0cc('0x39')]({},_0x13d9a9,_0x5bda84[_0xc0cc('0x3b')]);return db[_0xc0cc('0x29')][_0xc0cc('0x44')](_0x13d9a9)[_0xc0cc('0x22')](handleEntityNotFound(_0x547ef6,null))[_0xc0cc('0x22')](respondWithResult(_0x547ef6,null))[_0xc0cc('0x3e')](handleError(_0x547ef6,null));};exports[_0xc0cc('0x45')]=function(_0x1a4621,_0x247d2f){return db[_0xc0cc('0x29')]['create'](_0x1a4621[_0xc0cc('0x46')],{})['then'](respondWithResult(_0x247d2f,0xc9))[_0xc0cc('0x3e')](handleError(_0x247d2f,null));};exports['update']=function(_0x46eda2,_0x492732){if(_0x46eda2[_0xc0cc('0x46')]['id']){delete _0x46eda2[_0xc0cc('0x46')]['id'];}return db[_0xc0cc('0x29')]['find']({'where':{'id':_0x46eda2['params']['id']}})[_0xc0cc('0x22')](handleEntityNotFound(_0x492732,null))[_0xc0cc('0x22')](saveUpdates(_0x46eda2[_0xc0cc('0x46')],null))['then'](respondWithResult(_0x492732,null))['catch'](handleError(_0x492732,null));};exports['destroy']=function(_0x424809,_0x4c445c){return db[_0xc0cc('0x29')][_0xc0cc('0x44')]({'where':{'id':_0x424809['params']['id']}})[_0xc0cc('0x22')](handleEntityNotFound(_0x4c445c,null))[_0xc0cc('0x22')](removeEntity(_0x4c445c,null))[_0xc0cc('0x3e')](handleError(_0x4c445c,null));};exports['getFields']=function(_0x49cf34,_0xf85387,_0x114e85){var _0x52e766={};var _0x1e9852={};var _0x51f562;var _0x127d96;return db[_0xc0cc('0x29')][_0xc0cc('0x47')]({'where':{'id':_0x49cf34[_0xc0cc('0x40')]['id']}})[_0xc0cc('0x22')](handleEntityNotFound(_0xf85387,null))[_0xc0cc('0x22')](function(_0x58eaab){if(_0x58eaab){_0x51f562=_0x58eaab;_0x1e9852['model']=_[_0xc0cc('0x41')](db[_0xc0cc('0x48')][_0xc0cc('0x2a')]);_0x1e9852['query']=_[_0xc0cc('0x41')](_0x49cf34[_0xc0cc('0x2f')]);_0x1e9852[_0xc0cc('0x30')]=_[_0xc0cc('0x32')](_0x1e9852[_0xc0cc('0x2e')],_0x1e9852[_0xc0cc('0x2f')]);_0x52e766[_0xc0cc('0x31')]=_['intersection'](_0x1e9852[_0xc0cc('0x2e')],qs[_0xc0cc('0x33')](_0x49cf34[_0xc0cc('0x2f')]['fields']));_0x52e766[_0xc0cc('0x31')]=_0x52e766['attributes']['length']?_0x52e766[_0xc0cc('0x31')]:_0x1e9852['model'];_0x52e766['order']=qs[_0xc0cc('0x36')](_0x49cf34['query']['sort']);_0x52e766['where']=qs[_0xc0cc('0x30')](_[_0xc0cc('0x49')](_0x49cf34['query'],_0x1e9852['filters']));if(_0x49cf34[_0xc0cc('0x2f')][_0xc0cc('0x38')]){_0x52e766[_0xc0cc('0x37')]=_['merge'](_0x52e766['where'],{'$or':_[_0xc0cc('0x28')](_0x52e766[_0xc0cc('0x31')],function(_0x3038a7){var _0x4d0841={};_0x4d0841[_0x3038a7]={'$like':'%'+_0x49cf34[_0xc0cc('0x2f')]['filter']+'%'};return _0x4d0841;})});}_0x52e766=_[_0xc0cc('0x39')]({},_0x52e766,_0x49cf34['options']);return _0x51f562[_0xc0cc('0x4a')](_0x52e766);}})['then'](function(_0x402495){if(_0x402495){_0x127d96=_0x402495[_0xc0cc('0x42')];if(!_0x49cf34[_0xc0cc('0x2f')]['hasOwnProperty'](_0xc0cc('0x4b'))){_0x52e766[_0xc0cc('0x1a')]=qs['limit'](_0x49cf34[_0xc0cc('0x2f')]['limit']);_0x52e766[_0xc0cc('0x18')]=qs['offset'](_0x49cf34[_0xc0cc('0x2f')][_0xc0cc('0x18')]);}return _0x51f562[_0xc0cc('0x4a')](_0x52e766);}})[_0xc0cc('0x22')](function(_0x97ff0){if(_0x97ff0){return _0x97ff0?{'count':_0x127d96,'rows':_0x97ff0}:null;}})[_0xc0cc('0x22')](respondWithResult(_0xf85387,null))[_0xc0cc('0x3e')](handleError(_0xf85387,null));};exports[_0xc0cc('0x4c')]=function(_0x234764,_0x5e366b,_0xbe0cbe){var _0x5cc561={};var _0x59f464={};var _0x1d04d0;var _0x40478a;return db[_0xc0cc('0x29')][_0xc0cc('0x47')]({'where':{'id':_0x234764[_0xc0cc('0x40')]['id']}})[_0xc0cc('0x22')](handleEntityNotFound(_0x5e366b,null))[_0xc0cc('0x22')](function(_0x30b6e0){if(_0x30b6e0){_0x1d04d0=_0x30b6e0;_0x59f464[_0xc0cc('0x2e')]=_[_0xc0cc('0x41')](db['VtigerField'][_0xc0cc('0x2a')]);_0x59f464[_0xc0cc('0x2f')]=_[_0xc0cc('0x41')](_0x234764[_0xc0cc('0x2f')]);_0x59f464['filters']=_[_0xc0cc('0x32')](_0x59f464[_0xc0cc('0x2e')],_0x59f464['query']);_0x5cc561[_0xc0cc('0x31')]=_[_0xc0cc('0x32')](_0x59f464[_0xc0cc('0x2e')],qs[_0xc0cc('0x33')](_0x234764[_0xc0cc('0x2f')]['fields']));_0x5cc561['attributes']=_0x5cc561['attributes'][_0xc0cc('0x42')]?_0x5cc561['attributes']:_0x59f464['model'];_0x5cc561[_0xc0cc('0x35')]=qs[_0xc0cc('0x36')](_0x234764['query'][_0xc0cc('0x36')]);_0x5cc561[_0xc0cc('0x37')]=qs[_0xc0cc('0x30')](_[_0xc0cc('0x49')](_0x234764['query'],_0x59f464[_0xc0cc('0x30')]));if(_0x234764['query'][_0xc0cc('0x38')]){_0x5cc561[_0xc0cc('0x37')]=_[_0xc0cc('0x39')](_0x5cc561[_0xc0cc('0x37')],{'$or':_[_0xc0cc('0x28')](_0x5cc561['attributes'],function(_0x3fa456){var _0x1f8310={};_0x1f8310[_0x3fa456]={'$like':'%'+_0x234764[_0xc0cc('0x2f')][_0xc0cc('0x38')]+'%'};return _0x1f8310;})});}_0x5cc561=_[_0xc0cc('0x39')]({},_0x5cc561,_0x234764[_0xc0cc('0x3b')]);return _0x1d04d0[_0xc0cc('0x4c')](_0x5cc561);}})[_0xc0cc('0x22')](function(_0x2cd09f){if(_0x2cd09f){_0x40478a=_0x2cd09f[_0xc0cc('0x42')];if(!_0x234764[_0xc0cc('0x2f')][_0xc0cc('0x34')](_0xc0cc('0x4b'))){_0x5cc561[_0xc0cc('0x1a')]=qs['limit'](_0x234764[_0xc0cc('0x2f')][_0xc0cc('0x1a')]);_0x5cc561[_0xc0cc('0x18')]=qs[_0xc0cc('0x18')](_0x234764[_0xc0cc('0x2f')]['offset']);}return _0x1d04d0[_0xc0cc('0x4c')](_0x5cc561);}})[_0xc0cc('0x22')](function(_0x10eacc){if(_0x10eacc){return _0x10eacc?{'count':_0x40478a,'rows':_0x10eacc}:null;}})['then'](respondWithResult(_0x5e366b,null))['catch'](handleError(_0x5e366b,null));};exports['getDescriptions']=function(_0x334076,_0x546016,_0x520b9f){var _0x111991={};var _0x417533={};var _0x24984f;var _0x322ed0;return db['VtigerConfiguration'][_0xc0cc('0x47')]({'where':{'id':_0x334076[_0xc0cc('0x40')]['id']}})['then'](handleEntityNotFound(_0x546016,null))['then'](function(_0x4f3507){if(_0x4f3507){_0x24984f=_0x4f3507;_0x417533[_0xc0cc('0x2e')]=_[_0xc0cc('0x41')](db[_0xc0cc('0x48')]['rawAttributes']);_0x417533['query']=_[_0xc0cc('0x41')](_0x334076[_0xc0cc('0x2f')]);_0x417533[_0xc0cc('0x30')]=_[_0xc0cc('0x32')](_0x417533[_0xc0cc('0x2e')],_0x417533['query']);_0x111991[_0xc0cc('0x31')]=_[_0xc0cc('0x32')](_0x417533['model'],qs['fields'](_0x334076['query']['fields']));_0x111991[_0xc0cc('0x31')]=_0x111991[_0xc0cc('0x31')][_0xc0cc('0x42')]?_0x111991['attributes']:_0x417533[_0xc0cc('0x2e')];_0x111991[_0xc0cc('0x35')]=qs[_0xc0cc('0x36')](_0x334076[_0xc0cc('0x2f')]['sort']);_0x111991['where']=qs[_0xc0cc('0x30')](_[_0xc0cc('0x49')](_0x334076[_0xc0cc('0x2f')],_0x417533[_0xc0cc('0x30')]));if(_0x334076['query'][_0xc0cc('0x38')]){_0x111991[_0xc0cc('0x37')]=_[_0xc0cc('0x39')](_0x111991[_0xc0cc('0x37')],{'$or':_[_0xc0cc('0x28')](_0x111991['attributes'],function(_0x397101){var _0x5327f7={};_0x5327f7[_0x397101]={'$like':'%'+_0x334076['query'][_0xc0cc('0x38')]+'%'};return _0x5327f7;})});}_0x111991=_['merge']({},_0x111991,_0x334076[_0xc0cc('0x3b')]);return _0x24984f[_0xc0cc('0x4d')](_0x111991);}})[_0xc0cc('0x22')](function(_0x28936b){if(_0x28936b){_0x322ed0=_0x28936b[_0xc0cc('0x42')];if(!_0x334076[_0xc0cc('0x2f')][_0xc0cc('0x34')](_0xc0cc('0x4b'))){_0x111991[_0xc0cc('0x1a')]=qs['limit'](_0x334076[_0xc0cc('0x2f')][_0xc0cc('0x1a')]);_0x111991[_0xc0cc('0x18')]=qs['offset'](_0x334076[_0xc0cc('0x2f')][_0xc0cc('0x18')]);}return _0x24984f[_0xc0cc('0x4d')](_0x111991);}})[_0xc0cc('0x22')](function(_0x14b824){if(_0x14b824){return _0x14b824?{'count':_0x322ed0,'rows':_0x14b824}:null;}})[_0xc0cc('0x22')](respondWithResult(_0x546016,null))[_0xc0cc('0x3e')](handleError(_0x546016,null));}; \ No newline at end of file +var _0xb268=['fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','merge','options','where','include','findAll','rows','catch','intersection','includeAll','find','create','body','params','destroy','getFields','findOne','VtigerField','order','pick','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes'];(function(_0x4066c4,_0x4aff64){var _0x5febe9=function(_0xe9e693){while(--_0xe9e693){_0x4066c4['push'](_0x4066c4['shift']());}};_0x5febe9(++_0x4aff64);}(_0xb268,0x114));var _0x8b26=function(_0x417208,_0x538e3a){_0x417208=_0x417208-0x0;var _0x2713c3=_0xb268[_0x417208];return _0x2713c3;};'use strict';var emlformat=require(_0x8b26('0x0'));var rimraf=require(_0x8b26('0x1'));var zipdir=require(_0x8b26('0x2'));var jsonpatch=require(_0x8b26('0x3'));var rp=require(_0x8b26('0x4'));var moment=require(_0x8b26('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8b26('0x6'));var path=require(_0x8b26('0x7'));var sox=require(_0x8b26('0x8'));var csv=require(_0x8b26('0x9'));var ejs=require(_0x8b26('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b26('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8b26('0xc'));var deskjs=require(_0x8b26('0xd'));var toCsv=require(_0x8b26('0x9'));var querystring=require(_0x8b26('0xe'));var Papa=require(_0x8b26('0xf'));var Redis=require(_0x8b26('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b26('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b26('0x12'))(_0x8b26('0x13'));var utils=require(_0x8b26('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8b26('0x15'));var db=require(_0x8b26('0x16'))['db'];function respondWithStatusCode(_0x5d533c,_0x2a1674){_0x2a1674=_0x2a1674||0xcc;return function(_0x4cc1c3){if(_0x4cc1c3){return _0x5d533c['sendStatus'](_0x2a1674);}return _0x5d533c[_0x8b26('0x17')](_0x2a1674)[_0x8b26('0x18')]();};}function respondWithResult(_0x45acbb,_0x2f2a8a){_0x2f2a8a=_0x2f2a8a||0xc8;return function(_0x14bbe3){if(_0x14bbe3){return _0x45acbb[_0x8b26('0x17')](_0x2f2a8a)[_0x8b26('0x19')](_0x14bbe3);}};}function respondWithFilteredResult(_0x2b8291,_0x2c19ae){return function(_0x396b01){if(_0x396b01){var _0x373eab=typeof _0x2c19ae['offset']==='undefined'&&typeof _0x2c19ae['limit']===_0x8b26('0x1a');var _0x31b2ac=_0x396b01[_0x8b26('0x1b')];var _0x1239fa=_0x373eab?0x0:_0x2c19ae['offset'];var _0x405a3a=_0x373eab?_0x396b01[_0x8b26('0x1b')]:_0x2c19ae['offset']+_0x2c19ae[_0x8b26('0x1c')];var _0x5ae960;if(_0x405a3a>=_0x31b2ac){_0x405a3a=_0x31b2ac;_0x5ae960=0xc8;}else{_0x5ae960=0xce;}_0x2b8291['status'](_0x5ae960);return _0x2b8291[_0x8b26('0x1d')](_0x8b26('0x1e'),_0x1239fa+'-'+_0x405a3a+'/'+_0x31b2ac)[_0x8b26('0x19')](_0x396b01);}return null;};}function patchUpdates(_0x3966be){return function(_0x55077c){try{jsonpatch[_0x8b26('0x1f')](_0x55077c,_0x3966be,!![]);}catch(_0x5eaf38){return BPromise[_0x8b26('0x20')](_0x5eaf38);}return _0x55077c['save']();};}function saveUpdates(_0x1500f3,_0x2dfacf){return function(_0x5675f2){if(_0x5675f2){return _0x5675f2[_0x8b26('0x21')](_0x1500f3)['then'](function(_0x2bc054){return _0x2bc054;});}return null;};}function removeEntity(_0x32a228,_0x9a8c50){return function(_0x4c2715){if(_0x4c2715){return _0x4c2715['destroy']()[_0x8b26('0x22')](function(){_0x32a228[_0x8b26('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32bb00,_0x5a55dc){return function(_0x1e4b95){if(!_0x1e4b95){_0x32bb00[_0x8b26('0x23')](0x194);}return _0x1e4b95;};}function handleError(_0x1bbc9a,_0x526439){_0x526439=_0x526439||0x1f4;return function(_0x4a56d4){logger[_0x8b26('0x24')](_0x4a56d4[_0x8b26('0x25')]);if(_0x4a56d4[_0x8b26('0x26')]){delete _0x4a56d4[_0x8b26('0x26')];}_0x1bbc9a['status'](_0x526439)[_0x8b26('0x27')](_0x4a56d4);};}exports[_0x8b26('0x28')]=function(_0x47156a,_0xa14110){var _0x3c78fc={},_0x2bb247={},_0x2cc3b7={'count':0x0,'rows':[]};var _0x534441=_[_0x8b26('0x29')](db[_0x8b26('0x2a')][_0x8b26('0x2b')],function(_0x3a008e){return{'name':_0x3a008e[_0x8b26('0x2c')],'type':_0x3a008e[_0x8b26('0x2d')][_0x8b26('0x2e')]};});_0x2bb247[_0x8b26('0x2f')]=_[_0x8b26('0x29')](_0x534441,_0x8b26('0x26'));_0x2bb247['query']=_[_0x8b26('0x30')](_0x47156a['query']);_0x2bb247[_0x8b26('0x31')]=_['intersection'](_0x2bb247['model'],_0x2bb247[_0x8b26('0x32')]);_0x3c78fc[_0x8b26('0x33')]=_['intersection'](_0x2bb247['model'],qs[_0x8b26('0x34')](_0x47156a[_0x8b26('0x32')][_0x8b26('0x34')]));_0x3c78fc[_0x8b26('0x33')]=_0x3c78fc['attributes'][_0x8b26('0x35')]?_0x3c78fc[_0x8b26('0x33')]:_0x2bb247[_0x8b26('0x2f')];if(!_0x47156a[_0x8b26('0x32')][_0x8b26('0x36')](_0x8b26('0x37'))){_0x3c78fc[_0x8b26('0x1c')]=qs[_0x8b26('0x1c')](_0x47156a[_0x8b26('0x32')]['limit']);_0x3c78fc[_0x8b26('0x38')]=qs['offset'](_0x47156a['query'][_0x8b26('0x38')]);}_0x3c78fc['order']=qs[_0x8b26('0x39')](_0x47156a[_0x8b26('0x32')]['sort']);_0x3c78fc['where']=qs['filters'](_['pick'](_0x47156a['query'],_0x2bb247[_0x8b26('0x31')]),_0x534441);if(_0x47156a[_0x8b26('0x32')]['filter']){_0x3c78fc['where']=_[_0x8b26('0x3a')](_0x3c78fc['where'],{'$or':_['map'](_0x534441,function(_0x41aa06){if(_0x41aa06[_0x8b26('0x2d')]!=='VIRTUAL'){var _0x545524={};_0x545524[_0x41aa06['name']]={'$like':'%'+_0x47156a[_0x8b26('0x32')]['filter']+'%'};return _0x545524;}})});}_0x3c78fc=_[_0x8b26('0x3a')]({},_0x3c78fc,_0x47156a[_0x8b26('0x3b')]);var _0x4983ab={'where':_0x3c78fc[_0x8b26('0x3c')]};return db[_0x8b26('0x2a')]['count'](_0x4983ab)['then'](function(_0x27345d){_0x2cc3b7[_0x8b26('0x1b')]=_0x27345d;if(_0x47156a[_0x8b26('0x32')]['includeAll']){_0x3c78fc[_0x8b26('0x3d')]=[{'all':!![]}];}return db[_0x8b26('0x2a')][_0x8b26('0x3e')](_0x3c78fc);})['then'](function(_0xc14b94){_0x2cc3b7[_0x8b26('0x3f')]=_0xc14b94;return _0x2cc3b7;})[_0x8b26('0x22')](respondWithFilteredResult(_0xa14110,_0x3c78fc))[_0x8b26('0x40')](handleError(_0xa14110,null));};exports['show']=function(_0x5131a3,_0x5acdc2){var _0x1a6adf={'raw':![],'where':{'id':_0x5131a3['params']['id']}},_0x496e27={};_0x496e27['model']=_[_0x8b26('0x30')](db['VtigerConfiguration']['rawAttributes']);_0x496e27['query']=_['keys'](_0x5131a3[_0x8b26('0x32')]);_0x496e27[_0x8b26('0x31')]=_['intersection'](_0x496e27['model'],_0x496e27[_0x8b26('0x32')]);_0x1a6adf[_0x8b26('0x33')]=_[_0x8b26('0x41')](_0x496e27[_0x8b26('0x2f')],qs[_0x8b26('0x34')](_0x5131a3[_0x8b26('0x32')][_0x8b26('0x34')]));_0x1a6adf[_0x8b26('0x33')]=_0x1a6adf[_0x8b26('0x33')][_0x8b26('0x35')]?_0x1a6adf[_0x8b26('0x33')]:_0x496e27[_0x8b26('0x2f')];if(_0x5131a3['query'][_0x8b26('0x42')]){_0x1a6adf[_0x8b26('0x3d')]=[{'all':!![]}];}_0x1a6adf=_[_0x8b26('0x3a')]({},_0x1a6adf,_0x5131a3['options']);return db[_0x8b26('0x2a')][_0x8b26('0x43')](_0x1a6adf)['then'](handleEntityNotFound(_0x5acdc2,null))[_0x8b26('0x22')](respondWithResult(_0x5acdc2,null))[_0x8b26('0x40')](handleError(_0x5acdc2,null));};exports[_0x8b26('0x44')]=function(_0x1e04e2,_0x517328){return db['VtigerConfiguration'][_0x8b26('0x44')](_0x1e04e2['body'],{})[_0x8b26('0x22')](respondWithResult(_0x517328,0xc9))[_0x8b26('0x40')](handleError(_0x517328,null));};exports[_0x8b26('0x21')]=function(_0x3b3e0b,_0x30550f){if(_0x3b3e0b[_0x8b26('0x45')]['id']){delete _0x3b3e0b[_0x8b26('0x45')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x3b3e0b[_0x8b26('0x46')]['id']}})[_0x8b26('0x22')](handleEntityNotFound(_0x30550f,null))[_0x8b26('0x22')](saveUpdates(_0x3b3e0b[_0x8b26('0x45')],null))[_0x8b26('0x22')](respondWithResult(_0x30550f,null))[_0x8b26('0x40')](handleError(_0x30550f,null));};exports[_0x8b26('0x47')]=function(_0x555933,_0x531eff){return db[_0x8b26('0x2a')]['find']({'where':{'id':_0x555933[_0x8b26('0x46')]['id']}})[_0x8b26('0x22')](handleEntityNotFound(_0x531eff,null))['then'](removeEntity(_0x531eff,null))[_0x8b26('0x40')](handleError(_0x531eff,null));};exports[_0x8b26('0x48')]=function(_0x278d47,_0x5f186e,_0x2743ef){var _0x190cdf={};var _0x3258e3={};var _0x1d2d90;var _0x332536;return db['VtigerConfiguration'][_0x8b26('0x49')]({'where':{'id':_0x278d47['params']['id']}})[_0x8b26('0x22')](handleEntityNotFound(_0x5f186e,null))[_0x8b26('0x22')](function(_0x2833ef){if(_0x2833ef){_0x1d2d90=_0x2833ef;_0x3258e3[_0x8b26('0x2f')]=_[_0x8b26('0x30')](db[_0x8b26('0x4a')][_0x8b26('0x2b')]);_0x3258e3['query']=_[_0x8b26('0x30')](_0x278d47[_0x8b26('0x32')]);_0x3258e3['filters']=_[_0x8b26('0x41')](_0x3258e3[_0x8b26('0x2f')],_0x3258e3[_0x8b26('0x32')]);_0x190cdf['attributes']=_[_0x8b26('0x41')](_0x3258e3[_0x8b26('0x2f')],qs['fields'](_0x278d47[_0x8b26('0x32')][_0x8b26('0x34')]));_0x190cdf[_0x8b26('0x33')]=_0x190cdf[_0x8b26('0x33')]['length']?_0x190cdf['attributes']:_0x3258e3['model'];_0x190cdf[_0x8b26('0x4b')]=qs[_0x8b26('0x39')](_0x278d47[_0x8b26('0x32')][_0x8b26('0x39')]);_0x190cdf[_0x8b26('0x3c')]=qs['filters'](_[_0x8b26('0x4c')](_0x278d47[_0x8b26('0x32')],_0x3258e3[_0x8b26('0x31')]));if(_0x278d47[_0x8b26('0x32')][_0x8b26('0x4d')]){_0x190cdf[_0x8b26('0x3c')]=_[_0x8b26('0x3a')](_0x190cdf[_0x8b26('0x3c')],{'$or':_['map'](_0x190cdf['attributes'],function(_0x4fa33f){var _0x2d81d2={};_0x2d81d2[_0x4fa33f]={'$like':'%'+_0x278d47[_0x8b26('0x32')]['filter']+'%'};return _0x2d81d2;})});}_0x190cdf=_['merge']({},_0x190cdf,_0x278d47[_0x8b26('0x3b')]);return _0x1d2d90[_0x8b26('0x48')](_0x190cdf);}})[_0x8b26('0x22')](function(_0x4502d7){if(_0x4502d7){_0x332536=_0x4502d7[_0x8b26('0x35')];if(!_0x278d47[_0x8b26('0x32')][_0x8b26('0x36')](_0x8b26('0x37'))){_0x190cdf[_0x8b26('0x1c')]=qs[_0x8b26('0x1c')](_0x278d47[_0x8b26('0x32')][_0x8b26('0x1c')]);_0x190cdf[_0x8b26('0x38')]=qs['offset'](_0x278d47[_0x8b26('0x32')]['offset']);}return _0x1d2d90['getFields'](_0x190cdf);}})['then'](function(_0x45100f){if(_0x45100f){return _0x45100f?{'count':_0x332536,'rows':_0x45100f}:null;}})[_0x8b26('0x22')](respondWithResult(_0x5f186e,null))[_0x8b26('0x40')](handleError(_0x5f186e,null));};exports[_0x8b26('0x4e')]=function(_0x55a5bd,_0x167346,_0xdeba6b){var _0x2d8f67={};var _0x5d9dde={};var _0x2ead1d;var _0xdd70a7;return db[_0x8b26('0x2a')][_0x8b26('0x49')]({'where':{'id':_0x55a5bd[_0x8b26('0x46')]['id']}})[_0x8b26('0x22')](handleEntityNotFound(_0x167346,null))[_0x8b26('0x22')](function(_0x3e35f3){if(_0x3e35f3){_0x2ead1d=_0x3e35f3;_0x5d9dde['model']=_[_0x8b26('0x30')](db[_0x8b26('0x4a')][_0x8b26('0x2b')]);_0x5d9dde[_0x8b26('0x32')]=_[_0x8b26('0x30')](_0x55a5bd['query']);_0x5d9dde[_0x8b26('0x31')]=_[_0x8b26('0x41')](_0x5d9dde[_0x8b26('0x2f')],_0x5d9dde['query']);_0x2d8f67['attributes']=_[_0x8b26('0x41')](_0x5d9dde[_0x8b26('0x2f')],qs[_0x8b26('0x34')](_0x55a5bd[_0x8b26('0x32')]['fields']));_0x2d8f67[_0x8b26('0x33')]=_0x2d8f67['attributes'][_0x8b26('0x35')]?_0x2d8f67[_0x8b26('0x33')]:_0x5d9dde[_0x8b26('0x2f')];_0x2d8f67[_0x8b26('0x4b')]=qs[_0x8b26('0x39')](_0x55a5bd[_0x8b26('0x32')]['sort']);_0x2d8f67[_0x8b26('0x3c')]=qs[_0x8b26('0x31')](_[_0x8b26('0x4c')](_0x55a5bd[_0x8b26('0x32')],_0x5d9dde[_0x8b26('0x31')]));if(_0x55a5bd[_0x8b26('0x32')][_0x8b26('0x4d')]){_0x2d8f67[_0x8b26('0x3c')]=_[_0x8b26('0x3a')](_0x2d8f67[_0x8b26('0x3c')],{'$or':_['map'](_0x2d8f67[_0x8b26('0x33')],function(_0x4bc9b3){var _0x15f481={};_0x15f481[_0x4bc9b3]={'$like':'%'+_0x55a5bd[_0x8b26('0x32')][_0x8b26('0x4d')]+'%'};return _0x15f481;})});}_0x2d8f67=_[_0x8b26('0x3a')]({},_0x2d8f67,_0x55a5bd[_0x8b26('0x3b')]);return _0x2ead1d[_0x8b26('0x4e')](_0x2d8f67);}})[_0x8b26('0x22')](function(_0x5dd3d4){if(_0x5dd3d4){_0xdd70a7=_0x5dd3d4[_0x8b26('0x35')];if(!_0x55a5bd['query'][_0x8b26('0x36')](_0x8b26('0x37'))){_0x2d8f67[_0x8b26('0x1c')]=qs['limit'](_0x55a5bd[_0x8b26('0x32')][_0x8b26('0x1c')]);_0x2d8f67[_0x8b26('0x38')]=qs[_0x8b26('0x38')](_0x55a5bd[_0x8b26('0x32')][_0x8b26('0x38')]);}return _0x2ead1d['getSubjects'](_0x2d8f67);}})[_0x8b26('0x22')](function(_0x26b269){if(_0x26b269){return _0x26b269?{'count':_0xdd70a7,'rows':_0x26b269}:null;}})[_0x8b26('0x22')](respondWithResult(_0x167346,null))['catch'](handleError(_0x167346,null));};exports[_0x8b26('0x4f')]=function(_0x4968ea,_0x54a1b6,_0x5bcbdf){var _0x28a0f9={};var _0x58f8bf={};var _0x120c29;var _0x1bebe0;return db['VtigerConfiguration'][_0x8b26('0x49')]({'where':{'id':_0x4968ea['params']['id']}})[_0x8b26('0x22')](handleEntityNotFound(_0x54a1b6,null))['then'](function(_0x13f32c){if(_0x13f32c){_0x120c29=_0x13f32c;_0x58f8bf[_0x8b26('0x2f')]=_['keys'](db['VtigerField'][_0x8b26('0x2b')]);_0x58f8bf['query']=_[_0x8b26('0x30')](_0x4968ea['query']);_0x58f8bf[_0x8b26('0x31')]=_[_0x8b26('0x41')](_0x58f8bf[_0x8b26('0x2f')],_0x58f8bf['query']);_0x28a0f9['attributes']=_[_0x8b26('0x41')](_0x58f8bf[_0x8b26('0x2f')],qs[_0x8b26('0x34')](_0x4968ea[_0x8b26('0x32')][_0x8b26('0x34')]));_0x28a0f9[_0x8b26('0x33')]=_0x28a0f9[_0x8b26('0x33')]['length']?_0x28a0f9[_0x8b26('0x33')]:_0x58f8bf[_0x8b26('0x2f')];_0x28a0f9[_0x8b26('0x4b')]=qs[_0x8b26('0x39')](_0x4968ea['query'][_0x8b26('0x39')]);_0x28a0f9[_0x8b26('0x3c')]=qs[_0x8b26('0x31')](_[_0x8b26('0x4c')](_0x4968ea['query'],_0x58f8bf['filters']));if(_0x4968ea[_0x8b26('0x32')][_0x8b26('0x4d')]){_0x28a0f9[_0x8b26('0x3c')]=_[_0x8b26('0x3a')](_0x28a0f9[_0x8b26('0x3c')],{'$or':_[_0x8b26('0x29')](_0x28a0f9[_0x8b26('0x33')],function(_0x5a6747){var _0x59e0e5={};_0x59e0e5[_0x5a6747]={'$like':'%'+_0x4968ea[_0x8b26('0x32')][_0x8b26('0x4d')]+'%'};return _0x59e0e5;})});}_0x28a0f9=_[_0x8b26('0x3a')]({},_0x28a0f9,_0x4968ea['options']);return _0x120c29[_0x8b26('0x4f')](_0x28a0f9);}})[_0x8b26('0x22')](function(_0x3915cb){if(_0x3915cb){_0x1bebe0=_0x3915cb[_0x8b26('0x35')];if(!_0x4968ea[_0x8b26('0x32')][_0x8b26('0x36')](_0x8b26('0x37'))){_0x28a0f9[_0x8b26('0x1c')]=qs[_0x8b26('0x1c')](_0x4968ea[_0x8b26('0x32')][_0x8b26('0x1c')]);_0x28a0f9[_0x8b26('0x38')]=qs[_0x8b26('0x38')](_0x4968ea[_0x8b26('0x32')][_0x8b26('0x38')]);}return _0x120c29[_0x8b26('0x4f')](_0x28a0f9);}})[_0x8b26('0x22')](function(_0x5e0cc7){if(_0x5e0cc7){return _0x5e0cc7?{'count':_0x1bebe0,'rows':_0x5e0cc7}:null;}})[_0x8b26('0x22')](respondWithResult(_0x54a1b6,null))[_0x8b26('0x40')](handleError(_0x54a1b6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index fa7d233..6decc5f 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 _0xbcaa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xbcaa,0x1a3));var _0xabca=function(_0x4ed067,_0x4a63db){_0x4ed067=_0x4ed067-0x0;var _0x26c10f=_0xbcaa[_0x4ed067];return _0x26c10f;};'use strict';var _=require(_0xabca('0x0'));var util=require(_0xabca('0x1'));var logger=require(_0xabca('0x2'))('api');var moment=require(_0xabca('0x3'));var BPromise=require(_0xabca('0x4'));var rp=require(_0xabca('0x5'));var fs=require('fs');var path=require(_0xabca('0x6'));var rimraf=require(_0xabca('0x7'));var config=require(_0xabca('0x8'));var attributes=require(_0xabca('0x9'));module[_0xabca('0xa')]=function(_0x520c47,_0x4a95fb){return _0x520c47[_0xabca('0xb')](_0xabca('0xc'),attributes,{'tableName':_0xabca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07f3=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x17b967,_0xefd2f3){var _0xf9c35a=function(_0x3f7380){while(--_0x3f7380){_0x17b967['push'](_0x17b967['shift']());}};_0xf9c35a(++_0xefd2f3);}(_0x07f3,0x1c3));var _0x307f=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x07f3[_0x1deee5];return _0x1d6c3a;};'use strict';var _=require(_0x307f('0x0'));var util=require('util');var logger=require(_0x307f('0x1'))(_0x307f('0x2'));var moment=require(_0x307f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x307f('0x4'));var rimraf=require(_0x307f('0x5'));var config=require(_0x307f('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x307f('0x7')]=function(_0xccb723,_0x2f862c){return _0xccb723[_0x307f('0x8')](_0x307f('0x9'),attributes,{'tableName':_0x307f('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 ce40f32..908b4df 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 _0x0d98=['stringify','code','error','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2f1537,_0xd53627){var _0x57f27e=function(_0x5a4b73){while(--_0x5a4b73){_0x2f1537['push'](_0x2f1537['shift']());}};_0x57f27e(++_0xd53627);}(_0x0d98,0xae));var _0x80d9=function(_0x9a30be,_0x3194d4){_0x9a30be=_0x9a30be-0x0;var _0x4541d5=_0x0d98[_0x9a30be];return _0x4541d5;};'use strict';var _=require('lodash');var util=require(_0x80d9('0x0'));var moment=require(_0x80d9('0x1'));var BPromise=require(_0x80d9('0x2'));var rs=require(_0x80d9('0x3'));var fs=require('fs');var Redis=require(_0x80d9('0x4'));var db=require(_0x80d9('0x5'))['db'];var utils=require(_0x80d9('0x6'));var logger=require(_0x80d9('0x7'))(_0x80d9('0x8'));var config=require(_0x80d9('0x9'));var jayson=require(_0x80d9('0xa'));var client=jayson[_0x80d9('0xb')][_0x80d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22c417,_0x77fe13,_0x332b40){return new BPromise(function(_0x5f4c92,_0x42782d){return client[_0x80d9('0xd')](_0x22c417,_0x332b40)[_0x80d9('0xe')](function(_0x2bb30b){logger['info'](_0x80d9('0xf'),_0x77fe13,_0x80d9('0x10'));logger['debug'](_0x80d9('0x11'),_0x77fe13,'request\x20sent',JSON[_0x80d9('0x12')](_0x2bb30b));if(_0x2bb30b['error']){if(_0x2bb30b['error'][_0x80d9('0x13')]===0x1f4){logger[_0x80d9('0x14')](_0x80d9('0xf'),_0x77fe13,_0x2bb30b['error'][_0x80d9('0x15')]);return _0x42782d(_0x2bb30b['error'][_0x80d9('0x15')]);}logger['error'](_0x80d9('0xf'),_0x77fe13,_0x2bb30b[_0x80d9('0x14')][_0x80d9('0x15')]);return _0x5f4c92(_0x2bb30b[_0x80d9('0x14')][_0x80d9('0x15')]);}else{logger[_0x80d9('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x77fe13,'request\x20sent');_0x5f4c92(_0x2bb30b[_0x80d9('0x17')][_0x80d9('0x15')]);}})['catch'](function(_0x5e4726){logger[_0x80d9('0x14')](_0x80d9('0xf'),_0x77fe13,_0x5e4726);_0x42782d(_0x5e4726);});});} \ No newline at end of file +var _0xca64=['message','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x93f8a5,_0x719f1c){var _0x5c4ab7=function(_0x5b6556){while(--_0x5b6556){_0x93f8a5['push'](_0x93f8a5['shift']());}};_0x5c4ab7(++_0x719f1c);}(_0xca64,0x17c));var _0x4ca6=function(_0x85268c,_0x4cf5a9){_0x85268c=_0x85268c-0x0;var _0x5b4df7=_0xca64[_0x85268c];return _0x5b4df7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4ca6('0x0'));var fs=require('fs');var Redis=require(_0x4ca6('0x1'));var db=require(_0x4ca6('0x2'))['db'];var utils=require(_0x4ca6('0x3'));var logger=require('../../config/logger')(_0x4ca6('0x4'));var config=require('../../config/environment');var jayson=require(_0x4ca6('0x5'));var client=jayson[_0x4ca6('0x6')][_0x4ca6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1eaf65,_0x49afa0,_0x378297){return new BPromise(function(_0x2ba743,_0x4ef7a1){return client[_0x4ca6('0x8')](_0x1eaf65,_0x378297)['then'](function(_0x36bed0){logger['info'](_0x4ca6('0x9'),_0x49afa0,_0x4ca6('0xa'));logger[_0x4ca6('0xb')](_0x4ca6('0xc'),_0x49afa0,_0x4ca6('0xa'),JSON[_0x4ca6('0xd')](_0x36bed0));if(_0x36bed0[_0x4ca6('0xe')]){if(_0x36bed0[_0x4ca6('0xe')][_0x4ca6('0xf')]===0x1f4){logger[_0x4ca6('0xe')](_0x4ca6('0x9'),_0x49afa0,_0x36bed0[_0x4ca6('0xe')][_0x4ca6('0x10')]);return _0x4ef7a1(_0x36bed0[_0x4ca6('0xe')][_0x4ca6('0x10')]);}logger[_0x4ca6('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x49afa0,_0x36bed0['error']['message']);return _0x2ba743(_0x36bed0[_0x4ca6('0xe')][_0x4ca6('0x10')]);}else{logger['info'](_0x4ca6('0x9'),_0x49afa0,'request\x20sent');_0x2ba743(_0x36bed0['result'][_0x4ca6('0x10')]);}})[_0x4ca6('0x11')](function(_0x28bfa8){logger[_0x4ca6('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x49afa0,_0x28bfa8);_0x4ef7a1(_0x28bfa8);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 30a37dc..c322e23 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 _0x7e2f=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','put'];(function(_0x5f18d7,_0x15b0dc){var _0x4f0f58=function(_0x313ccd){while(--_0x313ccd){_0x5f18d7['push'](_0x5f18d7['shift']());}};_0x4f0f58(++_0x15b0dc);}(_0x7e2f,0x1c5));var _0xf7e2=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x7e2f[_0x1e9424];return _0x1bd96c;};'use strict';var multer=require(_0xf7e2('0x0'));var util=require(_0xf7e2('0x1'));var path=require('path');var timeout=require(_0xf7e2('0x2'));var express=require(_0xf7e2('0x3'));var router=express[_0xf7e2('0x4')]();var fs_extra=require(_0xf7e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf7e2('0x6'));var config=require(_0xf7e2('0x7'));var controller=require(_0xf7e2('0x8'));router[_0xf7e2('0x9')]('/',auth[_0xf7e2('0xa')](),controller['index']);router[_0xf7e2('0x9')](_0xf7e2('0xb'),auth[_0xf7e2('0xa')](),controller[_0xf7e2('0xc')]);router[_0xf7e2('0xd')]('/',auth[_0xf7e2('0xa')](),controller['create']);router[_0xf7e2('0xe')](_0xf7e2('0xb'),auth[_0xf7e2('0xa')](),controller[_0xf7e2('0xf')]);router['delete']('/:id',auth[_0xf7e2('0xa')](),controller[_0xf7e2('0x10')]);module[_0xf7e2('0x11')]=router; \ No newline at end of file +var _0x8a2e=['delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','put','update'];(function(_0x566856,_0x4d82d5){var _0x5da804=function(_0x51ffe1){while(--_0x51ffe1){_0x566856['push'](_0x566856['shift']());}};_0x5da804(++_0x4d82d5);}(_0x8a2e,0xae));var _0xe8a2=function(_0x1369a7,_0x33fce8){_0x1369a7=_0x1369a7-0x0;var _0x2e4104=_0x8a2e[_0x1369a7];return _0x2e4104;};'use strict';var multer=require('multer');var util=require(_0xe8a2('0x0'));var path=require('path');var timeout=require(_0xe8a2('0x1'));var express=require(_0xe8a2('0x2'));var router=express[_0xe8a2('0x3')]();var fs_extra=require(_0xe8a2('0x4'));var auth=require(_0xe8a2('0x5'));var interaction=require(_0xe8a2('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0xe8a2('0x7')]('/',auth[_0xe8a2('0x8')](),controller['index']);router[_0xe8a2('0x7')]('/:id',auth[_0xe8a2('0x8')](),controller[_0xe8a2('0x9')]);router[_0xe8a2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8a2('0xb')]('/:id',auth[_0xe8a2('0x8')](),controller[_0xe8a2('0xc')]);router[_0xe8a2('0xd')](_0xe8a2('0xe'),auth[_0xe8a2('0x8')](),controller[_0xe8a2('0xf')]);module[_0xe8a2('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 4adec43..5112c3c 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 _0x2d4b=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2d4b,0xc3));var _0xb2d4=function(_0x1ea551,_0x47616c){_0x1ea551=_0x1ea551-0x0;var _0x53112a=_0x2d4b[_0x1ea551];return _0x53112a;};'use strict';var Sequelize=require(_0xb2d4('0x0'));module[_0xb2d4('0x1')]={'type':{'type':Sequelize[_0xb2d4('0x2')](_0xb2d4('0x3'),'variable',_0xb2d4('0x4'),'keyValue',_0xb2d4('0x5')),'defaultValue':_0xb2d4('0x3')},'content':{'type':Sequelize[_0xb2d4('0x6')]},'key':{'type':Sequelize[_0xb2d4('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xb2d4('0x3'),'variable',_0xb2d4('0x4'))},'keyContent':{'type':Sequelize[_0xb2d4('0x6')]},'idField':{'type':Sequelize[_0xb2d4('0x6')]},'nameField':{'type':Sequelize[_0xb2d4('0x6')]},'customField':{'type':Sequelize[_0xb2d4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1f3f=['string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN'];(function(_0x2229d8,_0x534500){var _0x361924=function(_0x13fc37){while(--_0x13fc37){_0x2229d8['push'](_0x2229d8['shift']());}};_0x361924(++_0x534500);}(_0x1f3f,0x1e0));var _0xf1f3=function(_0xa201ee,_0x37da32){_0xa201ee=_0xa201ee-0x0;var _0x3e104d=_0x1f3f[_0xa201ee];return _0x3e104d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xf1f3('0x0'),'variable',_0xf1f3('0x1'),_0xf1f3('0x2'),_0xf1f3('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf1f3('0x4')]},'key':{'type':Sequelize[_0xf1f3('0x4')]},'keyType':{'type':Sequelize[_0xf1f3('0x5')](_0xf1f3('0x0'),_0xf1f3('0x6'),_0xf1f3('0x1'))},'keyContent':{'type':Sequelize[_0xf1f3('0x4')]},'idField':{'type':Sequelize[_0xf1f3('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf1f3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf1f3('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 807bb32..8f4fde2 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 _0xacfb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','error','stack','name','index','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','params','length','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x327e5e,_0x789c83){var _0x75f53d=function(_0x250a29){while(--_0x250a29){_0x327e5e['push'](_0x327e5e['shift']());}};_0x75f53d(++_0x789c83);}(_0xacfb,0xca));var _0xbacf=function(_0x39e8e0,_0x5aa6ed){_0x39e8e0=_0x39e8e0-0x0;var _0x415581=_0xacfb[_0x39e8e0];return _0x415581;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbacf('0x0'));var zipdir=require(_0xbacf('0x1'));var jsonpatch=require(_0xbacf('0x2'));var rp=require('request-promise');var moment=require(_0xbacf('0x3'));var BPromise=require(_0xbacf('0x4'));var Mustache=require(_0xbacf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbacf('0x6'));var csv=require(_0xbacf('0x7'));var ejs=require(_0xbacf('0x8'));var fs=require('fs');var fs_extra=require(_0xbacf('0x9'));var _=require('lodash');var squel=require(_0xbacf('0xa'));var crypto=require(_0xbacf('0xb'));var jsforce=require(_0xbacf('0xc'));var deskjs=require(_0xbacf('0xd'));var toCsv=require(_0xbacf('0x7'));var querystring=require('querystring');var Papa=require(_0xbacf('0xe'));var Redis=require(_0xbacf('0xf'));var authService=require(_0xbacf('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbacf('0x11'));var logger=require(_0xbacf('0x12'))(_0xbacf('0x13'));var utils=require(_0xbacf('0x14'));var config=require(_0xbacf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xbacf('0x16'))['db'];function respondWithStatusCode(_0x770e70,_0x6dbfec){_0x6dbfec=_0x6dbfec||0xcc;return function(_0x4f864c){if(_0x4f864c){return _0x770e70[_0xbacf('0x17')](_0x6dbfec);}return _0x770e70[_0xbacf('0x18')](_0x6dbfec)[_0xbacf('0x19')]();};}function respondWithResult(_0x443700,_0x2cd92a){_0x2cd92a=_0x2cd92a||0xc8;return function(_0x1941c9){if(_0x1941c9){return _0x443700[_0xbacf('0x18')](_0x2cd92a)['json'](_0x1941c9);}};}function respondWithFilteredResult(_0x4301e8,_0x308058){return function(_0x4de54d){if(_0x4de54d){var _0xe1ae9=typeof _0x308058[_0xbacf('0x1a')]===_0xbacf('0x1b')&&typeof _0x308058[_0xbacf('0x1c')]===_0xbacf('0x1b');var _0x105b46=_0x4de54d[_0xbacf('0x1d')];var _0x39b5e6=_0xe1ae9?0x0:_0x308058[_0xbacf('0x1a')];var _0x4d11ff=_0xe1ae9?_0x4de54d[_0xbacf('0x1d')]:_0x308058[_0xbacf('0x1a')]+_0x308058[_0xbacf('0x1c')];var _0xe2793c;if(_0x4d11ff>=_0x105b46){_0x4d11ff=_0x105b46;_0xe2793c=0xc8;}else{_0xe2793c=0xce;}_0x4301e8[_0xbacf('0x18')](_0xe2793c);return _0x4301e8[_0xbacf('0x1e')](_0xbacf('0x1f'),_0x39b5e6+'-'+_0x4d11ff+'/'+_0x105b46)[_0xbacf('0x20')](_0x4de54d);}return null;};}function patchUpdates(_0x4b9502){return function(_0x43ff73){try{jsonpatch[_0xbacf('0x21')](_0x43ff73,_0x4b9502,!![]);}catch(_0x4931bb){return BPromise['reject'](_0x4931bb);}return _0x43ff73[_0xbacf('0x22')]();};}function saveUpdates(_0x45a461,_0xd61369){return function(_0x12cba0){if(_0x12cba0){return _0x12cba0['update'](_0x45a461)['then'](function(_0x12bfec){return _0x12bfec;});}return null;};}function removeEntity(_0x2a9a0f,_0x425cd8){return function(_0x7951f3){if(_0x7951f3){return _0x7951f3[_0xbacf('0x23')]()[_0xbacf('0x24')](function(){_0x2a9a0f[_0xbacf('0x18')](0xcc)[_0xbacf('0x19')]();});}};}function handleEntityNotFound(_0x5ce98e,_0x4ce5ef){return function(_0x297b86){if(!_0x297b86){_0x5ce98e[_0xbacf('0x17')](0x194);}return _0x297b86;};}function handleError(_0x3b9938,_0x3f21d2){_0x3f21d2=_0x3f21d2||0x1f4;return function(_0x454aa3){logger[_0xbacf('0x25')](_0x454aa3[_0xbacf('0x26')]);if(_0x454aa3[_0xbacf('0x27')]){delete _0x454aa3[_0xbacf('0x27')];}_0x3b9938[_0xbacf('0x18')](_0x3f21d2)['send'](_0x454aa3);};}exports[_0xbacf('0x28')]=function(_0x510651,_0xb841b2){var _0x2b4187={},_0x291298={},_0x2d417f={'count':0x0,'rows':[]};var _0x4a28ed=_[_0xbacf('0x29')](db['VtigerField'][_0xbacf('0x2a')],function(_0x816248){return{'name':_0x816248['fieldName'],'type':_0x816248[_0xbacf('0x2b')][_0xbacf('0x2c')]};});_0x291298[_0xbacf('0x2d')]=_['map'](_0x4a28ed,_0xbacf('0x27'));_0x291298['query']=_[_0xbacf('0x2e')](_0x510651[_0xbacf('0x2f')]);_0x291298['filters']=_[_0xbacf('0x30')](_0x291298[_0xbacf('0x2d')],_0x291298[_0xbacf('0x2f')]);_0x2b4187[_0xbacf('0x31')]=_[_0xbacf('0x30')](_0x291298[_0xbacf('0x2d')],qs[_0xbacf('0x32')](_0x510651[_0xbacf('0x2f')][_0xbacf('0x32')]));_0x2b4187[_0xbacf('0x31')]=_0x2b4187[_0xbacf('0x31')]['length']?_0x2b4187[_0xbacf('0x31')]:_0x291298[_0xbacf('0x2d')];if(!_0x510651[_0xbacf('0x2f')][_0xbacf('0x33')](_0xbacf('0x34'))){_0x2b4187['limit']=qs[_0xbacf('0x1c')](_0x510651[_0xbacf('0x2f')]['limit']);_0x2b4187[_0xbacf('0x1a')]=qs['offset'](_0x510651[_0xbacf('0x2f')][_0xbacf('0x1a')]);}_0x2b4187[_0xbacf('0x35')]=qs['sort'](_0x510651[_0xbacf('0x2f')][_0xbacf('0x36')]);_0x2b4187['where']=qs['filters'](_['pick'](_0x510651[_0xbacf('0x2f')],_0x291298[_0xbacf('0x37')]),_0x4a28ed);if(_0x510651[_0xbacf('0x2f')][_0xbacf('0x38')]){_0x2b4187['where']=_[_0xbacf('0x39')](_0x2b4187[_0xbacf('0x3a')],{'$or':_[_0xbacf('0x29')](_0x4a28ed,function(_0x2b2394){if(_0x2b2394[_0xbacf('0x2b')]!==_0xbacf('0x3b')){var _0x47e9c3={};_0x47e9c3[_0x2b2394[_0xbacf('0x27')]]={'$like':'%'+_0x510651[_0xbacf('0x2f')][_0xbacf('0x38')]+'%'};return _0x47e9c3;}})});}_0x2b4187=_[_0xbacf('0x39')]({},_0x2b4187,_0x510651[_0xbacf('0x3c')]);var _0x281904={'where':_0x2b4187[_0xbacf('0x3a')]};return db[_0xbacf('0x3d')][_0xbacf('0x1d')](_0x281904)[_0xbacf('0x24')](function(_0x1cd901){_0x2d417f['count']=_0x1cd901;if(_0x510651[_0xbacf('0x2f')][_0xbacf('0x3e')]){_0x2b4187[_0xbacf('0x3f')]=[{'all':!![]}];}return db[_0xbacf('0x3d')][_0xbacf('0x40')](_0x2b4187);})['then'](function(_0x1d5cd8){_0x2d417f[_0xbacf('0x41')]=_0x1d5cd8;return _0x2d417f;})[_0xbacf('0x24')](respondWithFilteredResult(_0xb841b2,_0x2b4187))['catch'](handleError(_0xb841b2,null));};exports['show']=function(_0x568221,_0x22e959){var _0x8bce22={'raw':!![],'where':{'id':_0x568221[_0xbacf('0x42')]['id']}},_0xb58ef2={};_0xb58ef2[_0xbacf('0x2d')]=_[_0xbacf('0x2e')](db[_0xbacf('0x3d')][_0xbacf('0x2a')]);_0xb58ef2[_0xbacf('0x2f')]=_[_0xbacf('0x2e')](_0x568221[_0xbacf('0x2f')]);_0xb58ef2[_0xbacf('0x37')]=_[_0xbacf('0x30')](_0xb58ef2[_0xbacf('0x2d')],_0xb58ef2[_0xbacf('0x2f')]);_0x8bce22[_0xbacf('0x31')]=_[_0xbacf('0x30')](_0xb58ef2['model'],qs[_0xbacf('0x32')](_0x568221[_0xbacf('0x2f')][_0xbacf('0x32')]));_0x8bce22['attributes']=_0x8bce22[_0xbacf('0x31')][_0xbacf('0x43')]?_0x8bce22[_0xbacf('0x31')]:_0xb58ef2['model'];if(_0x568221[_0xbacf('0x2f')]['includeAll']){_0x8bce22[_0xbacf('0x3f')]=[{'all':!![]}];}_0x8bce22=_[_0xbacf('0x39')]({},_0x8bce22,_0x568221[_0xbacf('0x3c')]);return db[_0xbacf('0x3d')][_0xbacf('0x44')](_0x8bce22)[_0xbacf('0x24')](handleEntityNotFound(_0x22e959,null))[_0xbacf('0x24')](respondWithResult(_0x22e959,null))[_0xbacf('0x45')](handleError(_0x22e959,null));};exports[_0xbacf('0x46')]=function(_0x55abb3,_0x56f8b5){return db['VtigerField'][_0xbacf('0x46')](_0x55abb3[_0xbacf('0x47')],{})['then'](respondWithResult(_0x56f8b5,0xc9))['catch'](handleError(_0x56f8b5,null));};exports[_0xbacf('0x48')]=function(_0x5a5330,_0x279e30){if(_0x5a5330[_0xbacf('0x47')]['id']){delete _0x5a5330[_0xbacf('0x47')]['id'];}return db[_0xbacf('0x3d')][_0xbacf('0x44')]({'where':{'id':_0x5a5330[_0xbacf('0x42')]['id']}})['then'](handleEntityNotFound(_0x279e30,null))[_0xbacf('0x24')](saveUpdates(_0x5a5330['body'],null))[_0xbacf('0x24')](respondWithResult(_0x279e30,null))[_0xbacf('0x45')](handleError(_0x279e30,null));};exports['destroy']=function(_0x1616dc,_0x24b5b7){return db['VtigerField'][_0xbacf('0x44')]({'where':{'id':_0x1616dc[_0xbacf('0x42')]['id']}})[_0xbacf('0x24')](handleEntityNotFound(_0x24b5b7,null))['then'](removeEntity(_0x24b5b7,null))[_0xbacf('0x45')](handleError(_0x24b5b7,null));}; \ No newline at end of file +var _0x1d94=['then','destroy','error','name','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','filter','options','VtigerField','includeAll','include','rows','catch','show','params','keys','length','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','Content-Range','save','update'];(function(_0x4e4157,_0x3c53ac){var _0x570373=function(_0x195174){while(--_0x195174){_0x4e4157['push'](_0x4e4157['shift']());}};_0x570373(++_0x3c53ac);}(_0x1d94,0x187));var _0x41d9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d94[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x41d9('0x0'));var rimraf=require(_0x41d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41d9('0x2'));var rp=require(_0x41d9('0x3'));var moment=require(_0x41d9('0x4'));var BPromise=require(_0x41d9('0x5'));var Mustache=require(_0x41d9('0x6'));var util=require(_0x41d9('0x7'));var path=require(_0x41d9('0x8'));var sox=require(_0x41d9('0x9'));var csv=require(_0x41d9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41d9('0xb'));var squel=require(_0x41d9('0xc'));var crypto=require(_0x41d9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x41d9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x41d9('0xf'));var Papa=require(_0x41d9('0x10'));var Redis=require(_0x41d9('0x11'));var authService=require(_0x41d9('0x12'));var qs=require(_0x41d9('0x13'));var as=require(_0x41d9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x41d9('0x15'));var utils=require(_0x41d9('0x16'));var config=require(_0x41d9('0x17'));var licenseUtil=require(_0x41d9('0x18'));var db=require(_0x41d9('0x19'))['db'];function respondWithStatusCode(_0x42cadd,_0x1536f7){_0x1536f7=_0x1536f7||0xcc;return function(_0x19ac77){if(_0x19ac77){return _0x42cadd['sendStatus'](_0x1536f7);}return _0x42cadd['status'](_0x1536f7)[_0x41d9('0x1a')]();};}function respondWithResult(_0x480540,_0x44acd7){_0x44acd7=_0x44acd7||0xc8;return function(_0x13c520){if(_0x13c520){return _0x480540[_0x41d9('0x1b')](_0x44acd7)[_0x41d9('0x1c')](_0x13c520);}};}function respondWithFilteredResult(_0x95027b,_0x1601fe){return function(_0x1401a0){if(_0x1401a0){var _0x504e0a=typeof _0x1601fe[_0x41d9('0x1d')]===_0x41d9('0x1e')&&typeof _0x1601fe['limit']===_0x41d9('0x1e');var _0x80411=_0x1401a0[_0x41d9('0x1f')];var _0x57a257=_0x504e0a?0x0:_0x1601fe[_0x41d9('0x1d')];var _0x478f49=_0x504e0a?_0x1401a0[_0x41d9('0x1f')]:_0x1601fe[_0x41d9('0x1d')]+_0x1601fe['limit'];var _0x5e1cd0;if(_0x478f49>=_0x80411){_0x478f49=_0x80411;_0x5e1cd0=0xc8;}else{_0x5e1cd0=0xce;}_0x95027b[_0x41d9('0x1b')](_0x5e1cd0);return _0x95027b['set'](_0x41d9('0x20'),_0x57a257+'-'+_0x478f49+'/'+_0x80411)[_0x41d9('0x1c')](_0x1401a0);}return null;};}function patchUpdates(_0x86e19f){return function(_0xcba784){try{jsonpatch['apply'](_0xcba784,_0x86e19f,!![]);}catch(_0x3b92e6){return BPromise['reject'](_0x3b92e6);}return _0xcba784[_0x41d9('0x21')]();};}function saveUpdates(_0x26582b,_0x2ec915){return function(_0x5a5795){if(_0x5a5795){return _0x5a5795[_0x41d9('0x22')](_0x26582b)[_0x41d9('0x23')](function(_0x18346d){return _0x18346d;});}return null;};}function removeEntity(_0x15df89,_0x19a384){return function(_0x168fe8){if(_0x168fe8){return _0x168fe8[_0x41d9('0x24')]()[_0x41d9('0x23')](function(){_0x15df89[_0x41d9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d8c2,_0x30846d){return function(_0x443a15){if(!_0x443a15){_0x29d8c2['sendStatus'](0x194);}return _0x443a15;};}function handleError(_0x367228,_0x5368be){_0x5368be=_0x5368be||0x1f4;return function(_0x196a2b){logger[_0x41d9('0x25')](_0x196a2b['stack']);if(_0x196a2b[_0x41d9('0x26')]){delete _0x196a2b[_0x41d9('0x26')];}_0x367228['status'](_0x5368be)['send'](_0x196a2b);};}exports[_0x41d9('0x27')]=function(_0x5da427,_0x200a57){var _0x45bb86={},_0x10b88a={},_0x50a751={'count':0x0,'rows':[]};var _0x3c9a8b=_['map'](db['VtigerField'][_0x41d9('0x28')],function(_0x3ccbf7){return{'name':_0x3ccbf7['fieldName'],'type':_0x3ccbf7[_0x41d9('0x29')][_0x41d9('0x2a')]};});_0x10b88a[_0x41d9('0x2b')]=_[_0x41d9('0x2c')](_0x3c9a8b,'name');_0x10b88a[_0x41d9('0x2d')]=_['keys'](_0x5da427[_0x41d9('0x2d')]);_0x10b88a[_0x41d9('0x2e')]=_[_0x41d9('0x2f')](_0x10b88a['model'],_0x10b88a[_0x41d9('0x2d')]);_0x45bb86[_0x41d9('0x30')]=_[_0x41d9('0x2f')](_0x10b88a[_0x41d9('0x2b')],qs['fields'](_0x5da427[_0x41d9('0x2d')][_0x41d9('0x31')]));_0x45bb86[_0x41d9('0x30')]=_0x45bb86[_0x41d9('0x30')]['length']?_0x45bb86[_0x41d9('0x30')]:_0x10b88a[_0x41d9('0x2b')];if(!_0x5da427['query'][_0x41d9('0x32')](_0x41d9('0x33'))){_0x45bb86[_0x41d9('0x34')]=qs['limit'](_0x5da427['query'][_0x41d9('0x34')]);_0x45bb86[_0x41d9('0x1d')]=qs['offset'](_0x5da427[_0x41d9('0x2d')][_0x41d9('0x1d')]);}_0x45bb86['order']=qs[_0x41d9('0x35')](_0x5da427[_0x41d9('0x2d')][_0x41d9('0x35')]);_0x45bb86[_0x41d9('0x36')]=qs[_0x41d9('0x2e')](_[_0x41d9('0x37')](_0x5da427[_0x41d9('0x2d')],_0x10b88a[_0x41d9('0x2e')]),_0x3c9a8b);if(_0x5da427[_0x41d9('0x2d')]['filter']){_0x45bb86['where']=_[_0x41d9('0x38')](_0x45bb86[_0x41d9('0x36')],{'$or':_['map'](_0x3c9a8b,function(_0x5585a2){if(_0x5585a2[_0x41d9('0x29')]!=='VIRTUAL'){var _0xd28c68={};_0xd28c68[_0x5585a2[_0x41d9('0x26')]]={'$like':'%'+_0x5da427[_0x41d9('0x2d')][_0x41d9('0x39')]+'%'};return _0xd28c68;}})});}_0x45bb86=_[_0x41d9('0x38')]({},_0x45bb86,_0x5da427[_0x41d9('0x3a')]);var _0x4cb316={'where':_0x45bb86['where']};return db[_0x41d9('0x3b')][_0x41d9('0x1f')](_0x4cb316)['then'](function(_0xc373a2){_0x50a751['count']=_0xc373a2;if(_0x5da427[_0x41d9('0x2d')][_0x41d9('0x3c')]){_0x45bb86[_0x41d9('0x3d')]=[{'all':!![]}];}return db[_0x41d9('0x3b')]['findAll'](_0x45bb86);})[_0x41d9('0x23')](function(_0x3dd1ae){_0x50a751[_0x41d9('0x3e')]=_0x3dd1ae;return _0x50a751;})[_0x41d9('0x23')](respondWithFilteredResult(_0x200a57,_0x45bb86))[_0x41d9('0x3f')](handleError(_0x200a57,null));};exports[_0x41d9('0x40')]=function(_0x132d7a,_0x374ca0){var _0x136ce4={'raw':!![],'where':{'id':_0x132d7a[_0x41d9('0x41')]['id']}},_0xfde106={};_0xfde106[_0x41d9('0x2b')]=_[_0x41d9('0x42')](db[_0x41d9('0x3b')]['rawAttributes']);_0xfde106[_0x41d9('0x2d')]=_['keys'](_0x132d7a[_0x41d9('0x2d')]);_0xfde106['filters']=_[_0x41d9('0x2f')](_0xfde106['model'],_0xfde106[_0x41d9('0x2d')]);_0x136ce4['attributes']=_[_0x41d9('0x2f')](_0xfde106[_0x41d9('0x2b')],qs['fields'](_0x132d7a[_0x41d9('0x2d')][_0x41d9('0x31')]));_0x136ce4[_0x41d9('0x30')]=_0x136ce4[_0x41d9('0x30')][_0x41d9('0x43')]?_0x136ce4[_0x41d9('0x30')]:_0xfde106[_0x41d9('0x2b')];if(_0x132d7a[_0x41d9('0x2d')][_0x41d9('0x3c')]){_0x136ce4[_0x41d9('0x3d')]=[{'all':!![]}];}_0x136ce4=_[_0x41d9('0x38')]({},_0x136ce4,_0x132d7a['options']);return db[_0x41d9('0x3b')]['find'](_0x136ce4)[_0x41d9('0x23')](handleEntityNotFound(_0x374ca0,null))[_0x41d9('0x23')](respondWithResult(_0x374ca0,null))[_0x41d9('0x3f')](handleError(_0x374ca0,null));};exports[_0x41d9('0x44')]=function(_0x1b24b3,_0x56b60){return db[_0x41d9('0x3b')]['create'](_0x1b24b3[_0x41d9('0x45')],{})['then'](respondWithResult(_0x56b60,0xc9))[_0x41d9('0x3f')](handleError(_0x56b60,null));};exports[_0x41d9('0x22')]=function(_0x8eca53,_0x166122){if(_0x8eca53[_0x41d9('0x45')]['id']){delete _0x8eca53[_0x41d9('0x45')]['id'];}return db[_0x41d9('0x3b')]['find']({'where':{'id':_0x8eca53[_0x41d9('0x41')]['id']}})[_0x41d9('0x23')](handleEntityNotFound(_0x166122,null))['then'](saveUpdates(_0x8eca53[_0x41d9('0x45')],null))['then'](respondWithResult(_0x166122,null))[_0x41d9('0x3f')](handleError(_0x166122,null));};exports[_0x41d9('0x24')]=function(_0x442a85,_0x44a266){return db[_0x41d9('0x3b')][_0x41d9('0x46')]({'where':{'id':_0x442a85[_0x41d9('0x41')]['id']}})[_0x41d9('0x23')](handleEntityNotFound(_0x44a266,null))[_0x41d9('0x23')](removeEntity(_0x44a266,null))[_0x41d9('0x3f')](handleError(_0x44a266,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e843078..9c81324 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 _0xb022=['define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5cba6d,_0x16c6ca){var _0x57aae4=function(_0x2de051){while(--_0x2de051){_0x5cba6d['push'](_0x5cba6d['shift']());}};_0x57aae4(++_0x16c6ca);}(_0xb022,0xac));var _0x2b02=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb022[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x2b02('0x0'));var util=require(_0x2b02('0x1'));var logger=require(_0x2b02('0x2'))('api');var moment=require(_0x2b02('0x3'));var BPromise=require(_0x2b02('0x4'));var rp=require(_0x2b02('0x5'));var fs=require('fs');var path=require(_0x2b02('0x6'));var rimraf=require('rimraf');var config=require(_0x2b02('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x2308f2,_0x5d3b98){return _0x2308f2[_0x2b02('0x8')](_0x2b02('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x2b02('0xa'),'fields':[_0x2b02('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfc2=['api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x3025f1,_0xdb30b5){var _0x3c2de9=function(_0x36cfb7){while(--_0x36cfb7){_0x3025f1['push'](_0x3025f1['shift']());}};_0x3c2de9(++_0xdb30b5);}(_0xbfc2,0x13a));var _0x2bfc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbfc2[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2bfc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bfc('0x1'));var moment=require(_0x2bfc('0x2'));var BPromise=require(_0x2bfc('0x3'));var rp=require(_0x2bfc('0x4'));var fs=require('fs');var path=require(_0x2bfc('0x5'));var rimraf=require('rimraf');var config=require(_0x2bfc('0x6'));var attributes=require(_0x2bfc('0x7'));module[_0x2bfc('0x8')]=function(_0x2717dd,_0x5dfe16){return _0x2717dd[_0x2bfc('0x9')](_0x2bfc('0xa'),attributes,{'tableName':_0x2bfc('0xb'),'paranoid':![],'indexes':[{'name':_0x2bfc('0xc'),'fields':[_0x2bfc('0xd'),_0x2bfc('0xe')],'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 0d481a0..29a8e6c 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 _0xb201=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4dcfd5,_0x30c662){var _0xbaf1ec=function(_0x13e068){while(--_0x13e068){_0x4dcfd5['push'](_0x4dcfd5['shift']());}};_0xbaf1ec(++_0x30c662);}(_0xb201,0x1b1));var _0x1b20=function(_0x5cc294,_0x3cdfe9){_0x5cc294=_0x5cc294-0x0;var _0x247220=_0xb201[_0x5cc294];return _0x247220;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('VtigerField,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});} \ No newline at end of file +var _0x51ba=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xbc3ff0,_0x3eaaca){var _0x4cf6b5=function(_0x103b97){while(--_0x103b97){_0xbc3ff0['push'](_0xbc3ff0['shift']());}};_0x4cf6b5(++_0x3eaaca);}(_0x51ba,0x169));var _0xa51b=function(_0x5614b3,_0x2b4c9d){_0x5614b3=_0x5614b3-0x0;var _0x18a7c8=_0x51ba[_0x5614b3];return _0x18a7c8;};'use strict';var _=require('lodash');var util=require(_0xa51b('0x0'));var moment=require(_0xa51b('0x1'));var BPromise=require(_0xa51b('0x2'));var rs=require(_0xa51b('0x3'));var fs=require('fs');var Redis=require(_0xa51b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa51b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa51b('0x6'));var client=jayson[_0xa51b('0x7')][_0xa51b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb8cc99,_0x53af50,_0x15ab36){return new BPromise(function(_0x5cff86,_0x5c532d){return client[_0xa51b('0x9')](_0xb8cc99,_0x15ab36)[_0xa51b('0xa')](function(_0x4013f3){logger[_0xa51b('0xb')](_0xa51b('0xc'),_0x53af50,'request\x20sent');logger[_0xa51b('0xd')](_0xa51b('0xe'),_0x53af50,'request\x20sent',JSON[_0xa51b('0xf')](_0x4013f3));if(_0x4013f3[_0xa51b('0x10')]){if(_0x4013f3[_0xa51b('0x10')][_0xa51b('0x11')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x53af50,_0x4013f3[_0xa51b('0x10')][_0xa51b('0x12')]);return _0x5c532d(_0x4013f3['error'][_0xa51b('0x12')]);}logger[_0xa51b('0x10')](_0xa51b('0xc'),_0x53af50,_0x4013f3['error'][_0xa51b('0x12')]);return _0x5cff86(_0x4013f3['error'][_0xa51b('0x12')]);}else{logger[_0xa51b('0xb')](_0xa51b('0xc'),_0x53af50,'request\x20sent');_0x5cff86(_0x4013f3[_0xa51b('0x13')][_0xa51b('0x12')]);}})[_0xa51b('0x14')](function(_0x3a1ed7){logger[_0xa51b('0x10')](_0xa51b('0xc'),_0x53af50,_0x3a1ed7);_0x5c532d(_0x3a1ed7);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 11854dc..3db0ad5 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 _0x1cfe=['getFields','post','create','addConfiguration','put','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields'];(function(_0x136d4f,_0x187d63){var _0x5166b2=function(_0x569116){while(--_0x569116){_0x136d4f['push'](_0x136d4f['shift']());}};_0x5166b2(++_0x187d63);}(_0x1cfe,0xcf));var _0xe1cf=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x1cfe[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xe1cf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe1cf('0x1'));var express=require(_0xe1cf('0x2'));var router=express[_0xe1cf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe1cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe1cf('0x5'));var controller=require(_0xe1cf('0x6'));router[_0xe1cf('0x7')]('/',auth[_0xe1cf('0x8')](),controller[_0xe1cf('0x9')]);router[_0xe1cf('0x7')](_0xe1cf('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xe1cf('0xb'),auth[_0xe1cf('0x8')](),controller['getConfigurations']);router[_0xe1cf('0x7')](_0xe1cf('0xc'),auth[_0xe1cf('0x8')](),controller[_0xe1cf('0xd')]);router[_0xe1cf('0xe')]('/',auth[_0xe1cf('0x8')](),controller[_0xe1cf('0xf')]);router[_0xe1cf('0xe')](_0xe1cf('0xb'),auth[_0xe1cf('0x8')](),controller[_0xe1cf('0x10')]);router[_0xe1cf('0x11')](_0xe1cf('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe1cf('0x12')](_0xe1cf('0xa'),auth[_0xe1cf('0x8')](),controller['destroy']);module[_0xe1cf('0x13')]=router; \ No newline at end of file +var _0x39bd=['put','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x2ed4f4,_0x56f24f){var _0x58f9a0=function(_0x2519c9){while(--_0x2519c9){_0x2ed4f4['push'](_0x2ed4f4['shift']());}};_0x58f9a0(++_0x56f24f);}(_0x39bd,0x7c));var _0xd39b=function(_0x22fc81,_0x3ed3af){_0x22fc81=_0x22fc81-0x0;var _0x1eda88=_0x39bd[_0x22fc81];return _0x1eda88;};'use strict';var multer=require(_0xd39b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd39b('0x1'));var express=require('express');var router=express[_0xd39b('0x2')]();var fs_extra=require(_0xd39b('0x3'));var auth=require(_0xd39b('0x4'));var interaction=require(_0xd39b('0x5'));var config=require(_0xd39b('0x6'));var controller=require(_0xd39b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd39b('0x8')]);router[_0xd39b('0x9')](_0xd39b('0xa'),auth[_0xd39b('0xb')](),controller[_0xd39b('0xc')]);router[_0xd39b('0x9')](_0xd39b('0xd'),auth['isAuthenticated'](),controller[_0xd39b('0xe')]);router[_0xd39b('0x9')](_0xd39b('0xf'),auth[_0xd39b('0xb')](),controller[_0xd39b('0x10')]);router['post']('/',auth[_0xd39b('0xb')](),controller[_0xd39b('0x11')]);router[_0xd39b('0x12')](_0xd39b('0xd'),auth[_0xd39b('0xb')](),controller[_0xd39b('0x13')]);router[_0xd39b('0x14')](_0xd39b('0xa'),auth[_0xd39b('0xb')](),controller[_0xd39b('0x15')]);router[_0xd39b('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd39b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b966e6e..41148fc 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 _0x1623=['password','integrationTab','newTab','sequelize','STRING','username','ENUM','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x5697ab,_0x4a5c3c){_0x5697ab=_0x5697ab-0x0;var _0x33e5b4=_0x1623[_0x5697ab];return _0x33e5b4;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3162('0x1')]},'username':{'type':Sequelize[_0x3162('0x1')],'unique':_0x3162('0x2')},'password':{'type':Sequelize[_0x3162('0x1')]},'token':{'type':Sequelize[_0x3162('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3162('0x3')]('password',_0x3162('0x4')),'defaultValue':_0x3162('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x6'),_0x3162('0x7')),'defaultValue':_0x3162('0x6')}}; \ No newline at end of file +var _0x0958=['STRING','username','remoteUri','token','password','ENUM','integrationTab','sequelize','exports'];(function(_0xe103f4,_0x260d5c){var _0x3cf719=function(_0xe533aa){while(--_0xe533aa){_0xe103f4['push'](_0xe103f4['shift']());}};_0x3cf719(++_0x260d5c);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8095('0x0'));module[_0x8095('0x1')]={'name':{'type':Sequelize[_0x8095('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8095('0x2')],'unique':_0x8095('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8095('0x2')],'unique':_0x8095('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0x8095('0x5')),'defaultValue':_0x8095('0x6')},'serverUrl':{'type':Sequelize[_0x8095('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8095('0x7')](_0x8095('0x8'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2318c2d..0feb50e 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 _0x2f68=['find','create','body','catch','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:%s','username','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x17296b,_0x72a2b0){var _0x471c5f=function(_0x33b433){while(--_0x33b433){_0x17296b['push'](_0x17296b['shift']());}};_0x471c5f(++_0x72a2b0);}(_0x2f68,0x9a));var _0x82f6=function(_0xe55924,_0xf33e29){_0xe55924=_0xe55924-0x0;var _0x5d4663=_0x2f68[_0xe55924];return _0x5d4663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];var integrations=require(_0x82f6('0x15'));function respondWithStatusCode(_0x4cc967,_0x194da7){_0x194da7=_0x194da7||0xcc;return function(_0x1f8bf5){if(_0x1f8bf5){return _0x4cc967[_0x82f6('0x16')](_0x194da7);}return _0x4cc967[_0x82f6('0x17')](_0x194da7)[_0x82f6('0x18')]();};}function respondWithResult(_0xa00275,_0x115c7b){_0x115c7b=_0x115c7b||0xc8;return function(_0x171815){if(_0x171815){return _0xa00275[_0x82f6('0x17')](_0x115c7b)['json'](_0x171815);}};}function respondWithFilteredResult(_0x389949,_0x5d0827){return function(_0x249222){if(_0x249222){var _0x1d0263=typeof _0x5d0827[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x5d0827[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x326378=_0x249222[_0x82f6('0x1c')];var _0x4072f0=_0x1d0263?0x0:_0x5d0827[_0x82f6('0x19')];var _0x1c79f9=_0x1d0263?_0x249222[_0x82f6('0x1c')]:_0x5d0827[_0x82f6('0x19')]+_0x5d0827[_0x82f6('0x1b')];var _0x3a8269;if(_0x1c79f9>=_0x326378){_0x1c79f9=_0x326378;_0x3a8269=0xc8;}else{_0x3a8269=0xce;}_0x389949['status'](_0x3a8269);return _0x389949[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x4072f0+'-'+_0x1c79f9+'/'+_0x326378)['json'](_0x249222);}return null;};}function patchUpdates(_0x2b03ad){return function(_0x4b9f0){try{jsonpatch[_0x82f6('0x1f')](_0x4b9f0,_0x2b03ad,!![]);}catch(_0x25cae6){return BPromise['reject'](_0x25cae6);}return _0x4b9f0[_0x82f6('0x20')]();};}function saveUpdates(_0x4beccf,_0x8668bb){return function(_0x2a0ce6){if(_0x2a0ce6){return _0x2a0ce6['update'](_0x4beccf)['then'](function(_0x3af5f7){return _0x3af5f7;});}return null;};}function removeEntity(_0x1d96d5,_0x4c57c5){return function(_0x5a5059){if(_0x5a5059){return _0x5a5059[_0x82f6('0x21')]()[_0x82f6('0x22')](function(){_0x1d96d5['status'](0xcc)[_0x82f6('0x18')]();});}};}function handleEntityNotFound(_0x304e83,_0x5037f8){return function(_0x57ac0d){if(!_0x57ac0d){_0x304e83[_0x82f6('0x16')](0x194);}return _0x57ac0d;};}function handleError(_0x5187d0,_0x469b6b){_0x469b6b=_0x469b6b||0x1f4;return function(_0x5a6d69){logger['error'](_0x5a6d69[_0x82f6('0x23')]);if(_0x5a6d69[_0x82f6('0x24')]){delete _0x5a6d69[_0x82f6('0x24')];}_0x5187d0[_0x82f6('0x17')](_0x469b6b)['send'](_0x5a6d69);};}exports[_0x82f6('0x25')]=function(_0x1fb461,_0x14a309){var _0x400137={},_0x271c28={},_0x328707={'count':0x0,'rows':[]};var _0x27e473=_[_0x82f6('0x26')](db[_0x82f6('0x27')][_0x82f6('0x28')],function(_0x3c9419){return{'name':_0x3c9419[_0x82f6('0x29')],'type':_0x3c9419[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x271c28['model']=_[_0x82f6('0x26')](_0x27e473,_0x82f6('0x24'));_0x271c28[_0x82f6('0x2c')]=_['keys'](_0x1fb461[_0x82f6('0x2c')]);_0x271c28[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],_0x271c28[_0x82f6('0x2c')]);_0x400137[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x271c28[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x400137[_0x82f6('0x30')]=_0x400137[_0x82f6('0x30')][_0x82f6('0x32')]?_0x400137['attributes']:_0x271c28[_0x82f6('0x2f')];if(!_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x400137[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x1b')]);_0x400137[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x19')]);}_0x400137[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x1fb461['query'][_0x82f6('0x36')]);_0x400137['where']=qs['filters'](_[_0x82f6('0x37')](_0x1fb461[_0x82f6('0x2c')],_0x271c28['filters']),_0x27e473);if(_0x1fb461[_0x82f6('0x2c')][_0x82f6('0x38')]){_0x400137[_0x82f6('0x39')]=_['merge'](_0x400137[_0x82f6('0x39')],{'$or':_['map'](_0x27e473,function(_0x2be8cf){if(_0x2be8cf['type']!==_0x82f6('0x3a')){var _0x47ef9e={};_0x47ef9e[_0x2be8cf[_0x82f6('0x24')]]={'$like':'%'+_0x1fb461[_0x82f6('0x2c')]['filter']+'%'};return _0x47ef9e;}})});}_0x400137=_[_0x82f6('0x3b')]({},_0x400137,_0x1fb461[_0x82f6('0x3c')]);var _0x3e7c53={'where':_0x400137[_0x82f6('0x39')]};return db['ZendeskAccount'][_0x82f6('0x1c')](_0x3e7c53)[_0x82f6('0x22')](function(_0x23ea04){_0x328707[_0x82f6('0x1c')]=_0x23ea04;if(_0x1fb461['query'][_0x82f6('0x3d')]){_0x400137[_0x82f6('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x82f6('0x3f')](_0x400137);})[_0x82f6('0x22')](function(_0x2d7509){_0x328707[_0x82f6('0x40')]=_0x2d7509;return _0x328707;})[_0x82f6('0x22')](respondWithFilteredResult(_0x14a309,_0x400137))['catch'](handleError(_0x14a309,null));};exports[_0x82f6('0x41')]=function(_0x5786ce,_0x139614){var _0x38e82d={'raw':![],'where':{'id':_0x5786ce[_0x82f6('0x42')]['id']}},_0x32d6b5={};_0x32d6b5[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db[_0x82f6('0x27')]['rawAttributes']);_0x32d6b5[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x5786ce[_0x82f6('0x2c')]);_0x32d6b5[_0x82f6('0x2d')]=_['intersection'](_0x32d6b5[_0x82f6('0x2f')],_0x32d6b5['query']);_0x38e82d[_0x82f6('0x30')]=_[_0x82f6('0x2e')](_0x32d6b5[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x31')]));_0x38e82d['attributes']=_0x38e82d[_0x82f6('0x30')][_0x82f6('0x32')]?_0x38e82d[_0x82f6('0x30')]:_0x32d6b5[_0x82f6('0x2f')];if(_0x5786ce[_0x82f6('0x2c')][_0x82f6('0x3d')]){_0x38e82d[_0x82f6('0x3e')]=[{'all':!![]}];}_0x38e82d=_[_0x82f6('0x3b')]({},_0x38e82d,_0x5786ce['options']);return db[_0x82f6('0x27')][_0x82f6('0x44')](_0x38e82d)['then'](handleEntityNotFound(_0x139614,null))[_0x82f6('0x22')](respondWithResult(_0x139614,null))['catch'](handleError(_0x139614,null));};exports[_0x82f6('0x45')]=function(_0x5e3321,_0x227ab8){return db[_0x82f6('0x27')][_0x82f6('0x45')](_0x5e3321[_0x82f6('0x46')],{})[_0x82f6('0x22')](respondWithResult(_0x227ab8,0xc9))[_0x82f6('0x47')](handleError(_0x227ab8,null));};exports['update']=function(_0x3cb1f0,_0xdc77ca){if(_0x3cb1f0['body']['id']){delete _0x3cb1f0['body']['id'];}return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x3cb1f0[_0x82f6('0x42')]['id']}})['then'](handleEntityNotFound(_0xdc77ca,null))[_0x82f6('0x22')](saveUpdates(_0x3cb1f0[_0x82f6('0x46')],null))[_0x82f6('0x22')](respondWithResult(_0xdc77ca,null))[_0x82f6('0x47')](handleError(_0xdc77ca,null));};exports['destroy']=function(_0x495400,_0x1695ea){return db[_0x82f6('0x27')][_0x82f6('0x44')]({'where':{'id':_0x495400['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x1695ea,null))[_0x82f6('0x22')](removeEntity(_0x1695ea,null))['catch'](handleError(_0x1695ea,null));};exports['getConfigurations']=function(_0x4fa2ca,_0x2e6b03,_0x4a63a6){var _0x259d83={};var _0x57c023={};var _0x33c359;var _0x4f69de;return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x4fa2ca[_0x82f6('0x42')]['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x2e6b03,null))[_0x82f6('0x22')](function(_0x1633cf){if(_0x1633cf){_0x33c359=_0x1633cf;_0x57c023[_0x82f6('0x2f')]=_[_0x82f6('0x43')](db['ZendeskConfiguration'][_0x82f6('0x28')]);_0x57c023[_0x82f6('0x2c')]=_[_0x82f6('0x43')](_0x4fa2ca['query']);_0x57c023['filters']=_[_0x82f6('0x2e')](_0x57c023[_0x82f6('0x2f')],_0x57c023[_0x82f6('0x2c')]);_0x259d83[_0x82f6('0x30')]=_['intersection'](_0x57c023[_0x82f6('0x2f')],qs[_0x82f6('0x31')](_0x4fa2ca[_0x82f6('0x2c')]['fields']));_0x259d83['attributes']=_0x259d83['attributes'][_0x82f6('0x32')]?_0x259d83[_0x82f6('0x30')]:_0x57c023[_0x82f6('0x2f')];_0x259d83[_0x82f6('0x35')]=qs[_0x82f6('0x36')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x36')]);_0x259d83[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x37')](_0x4fa2ca[_0x82f6('0x2c')],_0x57c023[_0x82f6('0x2d')]));if(_0x4fa2ca[_0x82f6('0x2c')]['filter']){_0x259d83['where']=_[_0x82f6('0x3b')](_0x259d83[_0x82f6('0x39')],{'$or':_['map'](_0x259d83[_0x82f6('0x30')],function(_0xa12f6e){var _0x404d09={};_0x404d09[_0xa12f6e]={'$like':'%'+_0x4fa2ca['query'][_0x82f6('0x38')]+'%'};return _0x404d09;})});}_0x259d83=_[_0x82f6('0x3b')]({},_0x259d83,_0x4fa2ca[_0x82f6('0x3c')]);return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x41da7f){if(_0x41da7f){_0x4f69de=_0x41da7f['length'];if(!_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x33')](_0x82f6('0x34'))){_0x259d83[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x4fa2ca['query'][_0x82f6('0x1b')]);_0x259d83[_0x82f6('0x19')]=qs[_0x82f6('0x19')](_0x4fa2ca[_0x82f6('0x2c')][_0x82f6('0x19')]);}return _0x33c359[_0x82f6('0x48')](_0x259d83);}})[_0x82f6('0x22')](function(_0x17389a){if(_0x17389a){return _0x17389a?{'count':_0x4f69de,'rows':_0x17389a}:null;}})['then'](respondWithResult(_0x2e6b03,null))[_0x82f6('0x47')](handleError(_0x2e6b03,null));};exports['addConfiguration']=function(_0x3f0337,_0x85ea2e,_0x4e51a6){if(_0x3f0337[_0x82f6('0x46')]['id']){delete _0x3f0337[_0x82f6('0x46')]['id'];}return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x3f0337['params']['id']}})[_0x82f6('0x22')](handleEntityNotFound(_0x85ea2e,null))[_0x82f6('0x22')](function(_0x58b96b){if(_0x58b96b){_0x3f0337['body'][_0x82f6('0x49')]=_0x58b96b['id'];_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4a')]=integrations[_0x82f6('0x4b')](_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4c')],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);_0x3f0337[_0x82f6('0x46')][_0x82f6('0x4d')]=integrations[_0x82f6('0x4e')](_0x3f0337[_0x82f6('0x46')]['channel'],_0x3f0337[_0x82f6('0x46')][_0x82f6('0x2a')]);return db[_0x82f6('0x4f')][_0x82f6('0x45')](_0x3f0337[_0x82f6('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x82f6('0x4a')},{'model':db[_0x82f6('0x50')],'as':_0x82f6('0x4d')}]});}return null;})['then'](respondWithResult(_0x85ea2e,null))[_0x82f6('0x47')](handleError(_0x85ea2e,null));};exports[_0x82f6('0x51')]=function(_0x17924d,_0x27a79c,_0xeec407){var _0x39a4b3='';return db[_0x82f6('0x27')]['findOne']({'where':{'id':_0x17924d[_0x82f6('0x42')]['id']},'attributes':['id','username',_0x82f6('0x52'),_0x82f6('0x53'),_0x82f6('0x54'),_0x82f6('0x55')]})[_0x82f6('0x22')](handleEntityNotFound(_0x27a79c,null))[_0x82f6('0x22')](function(_0x2d8721){if(_0x2d8721){_0x39a4b3=_0x2d8721[_0x82f6('0x55')];var _0x30b903=_0x39a4b3['slice'](-0x1);if(_0x30b903==='/'){_0x39a4b3=_0x39a4b3[_0x82f6('0x56')](0x0,_0x39a4b3[_0x82f6('0x57')](_0x30b903));}var _0x33cc55={'method':_0x82f6('0x58'),'uri':util[_0x82f6('0x59')](_0x82f6('0x5a'),_0x39a4b3,'ticket_fields'),'json':!![]};switch(_0x2d8721[_0x82f6('0x54')]){case _0x82f6('0x52'):_0x33cc55['headers']={'Authorization':util['format'](_0x82f6('0x5b'),new Buffer(util[_0x82f6('0x59')](_0x82f6('0x5c'),_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x52')]))[_0x82f6('0x5e')]('base64'))};break;case _0x82f6('0x53'):_0x33cc55['headers']={'Authorization':util[_0x82f6('0x59')]('Basic\x20%s',new Buffer(util[_0x82f6('0x59')]('%s/token:%s',_0x2d8721[_0x82f6('0x5d')],_0x2d8721[_0x82f6('0x53')]))[_0x82f6('0x5e')]('base64'))};break;default:throw new db[(_0x82f6('0x5f'))]['ValidationError'](_0x82f6('0x60'));}return rp(_0x33cc55);}})[_0x82f6('0x22')](function(_0x3e69f6){if(_0x3e69f6){var _0x4d1bfd=[_0x82f6('0x61'),_0x82f6('0x62'),_0x82f6('0x63'),'assignee'];_['remove'](_0x3e69f6[_0x82f6('0x64')],function(_0x30327a){return _0x4d1bfd[_0x82f6('0x65')](_0x30327a[_0x82f6('0x2a')]);});return{'count':_0x3e69f6[_0x82f6('0x64')][_0x82f6('0x32')],'rows':_[_0x82f6('0x26')](_0x3e69f6[_0x82f6('0x64')],function(_0x4df767){return{'id':_0x4df767['id'],'name':_0x4df767[_0x82f6('0x66')]>0x7?_0x4df767[_0x82f6('0x67')]:_0x4df767['type'],'custom':_0x4df767[_0x82f6('0x66')]>0x7?!![]:![],'options':_0x4df767[_0x82f6('0x68')]?_0x4df767[_0x82f6('0x68')]:_0x4df767['custom_field_options']?_0x4df767[_0x82f6('0x69')]:[]};})};}})[_0x82f6('0x22')](respondWithResult(_0x27a79c,null))[_0x82f6('0x47')](function(_0x2cc906){var _0x50ab5c=_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?0x1f4:_0x2cc906[_0x82f6('0x6b')]||0x1f4;logger[_0x82f6('0x6c')](_0x82f6('0x6d'),_0x82f6('0x51'),_0x50ab5c,JSON['stringify'](_0x2cc906));delete _0x2cc906[_0x82f6('0x24')];if(_0x50ab5c===0x191){_0x50ab5c=0x190;}_0x27a79c[_0x82f6('0x17')](_0x50ab5c)[_0x82f6('0x6e')](_0x17924d[_0x82f6('0x2c')][_0x82f6('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x2cc906[_0x82f6('0x6b')]}:_0x2cc906);});}; \ No newline at end of file +var _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x50ee9c,_0x2af523){var _0x556132=function(_0x2b7eab){while(--_0x2b7eab){_0x50ee9c['push'](_0x50ee9c['shift']());}};_0x556132(++_0x2af523);}(_0x91a7,0xe7));var _0x791a=function(_0x2d418a,_0x31764e){_0x2d418a=_0x2d418a-0x0;var _0x125eb9=_0x91a7[_0x2d418a];return _0x125eb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 30408ec..80ecbe2 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 _0x9f39=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x499b72,_0x39ddd1){var _0x4c922e=function(_0x24dd8b){while(--_0x24dd8b){_0x499b72['push'](_0x499b72['shift']());}};_0x4c922e(++_0x39ddd1);}(_0x9f39,0x92));var _0x99f3=function(_0x4ca8b1,_0x383cb4){_0x4ca8b1=_0x4ca8b1-0x0;var _0x23757b=_0x9f39[_0x4ca8b1];return _0x23757b;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var logger=require(_0x99f3('0x2'))(_0x99f3('0x3'));var moment=require(_0x99f3('0x4'));var BPromise=require('bluebird');var rp=require(_0x99f3('0x5'));var fs=require('fs');var path=require(_0x99f3('0x6'));var rimraf=require(_0x99f3('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x99f3('0x8')]=function(_0x430b1d,_0x53ffd6){return _0x430b1d[_0x99f3('0x9')](_0x99f3('0xa'),attributes,{'tableName':_0x99f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82ec=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','exports'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x82ec,0x73));var _0xc82e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x82ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc82e('0x0'));var util=require(_0xc82e('0x1'));var logger=require(_0xc82e('0x2'))(_0xc82e('0x3'));var moment=require(_0xc82e('0x4'));var BPromise=require(_0xc82e('0x5'));var rp=require(_0xc82e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc82e('0x7'));var config=require(_0xc82e('0x8'));var attributes=require(_0xc82e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xc82e('0xa')]=function(_0x4513c8,_0x542354){return _0x4513c8[_0xc82e('0xb')](_0xc82e('0xc'),attributes,{'tableName':_0xc82e('0xd'),'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 ce75cbc..8a67dfd 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 _0x9583=['debug','catch','ShowZendeskAccount','find','raw','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','info','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9583,0xcb));var _0x3958=function(_0x26bbda,_0x530b36){_0x26bbda=_0x26bbda-0x0;var _0x2bf75c=_0x9583[_0x26bbda];return _0x2bf75c;};'use strict';var _=require(_0x3958('0x0'));var util=require(_0x3958('0x1'));var moment=require(_0x3958('0x2'));var BPromise=require('bluebird');var rs=require(_0x3958('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3958('0x4'))(_0x3958('0x5'));var config=require(_0x3958('0x6'));var jayson=require(_0x3958('0x7'));var client=jayson[_0x3958('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce826,_0x7e525e,_0x5d1980){return new BPromise(function(_0x1fed59,_0x3f362a){return client[_0x3958('0x9')](_0x1ce826,_0x5d1980)[_0x3958('0xa')](function(_0x40ce3d){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x7e525e,_0x3958('0xb'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x7e525e,_0x3958('0xb'),JSON[_0x3958('0xc')](_0x40ce3d));if(_0x40ce3d[_0x3958('0xd')]){if(_0x40ce3d['error']['code']===0x1f4){logger[_0x3958('0xd')](_0x3958('0xe'),_0x7e525e,_0x40ce3d['error']['message']);return _0x3f362a(_0x40ce3d[_0x3958('0xd')]['message']);}logger[_0x3958('0xd')](_0x3958('0xe'),_0x7e525e,_0x40ce3d['error'][_0x3958('0xf')]);return _0x1fed59(_0x40ce3d[_0x3958('0xd')][_0x3958('0xf')]);}else{logger[_0x3958('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7e525e,'request\x20sent');_0x1fed59(_0x40ce3d[_0x3958('0x11')][_0x3958('0xf')]);}})['catch'](function(_0x4d9839){logger[_0x3958('0xd')](_0x3958('0xe'),_0x7e525e,_0x4d9839);_0x3f362a(_0x4d9839);});});}exports[_0x3958('0x12')]=function(_0x20a6bc){var _0x50e1bf=this;return new Promise(function(_0x146a70,_0x27b13d){return db[_0x3958('0x13')][_0x3958('0x14')]({'raw':_0x20a6bc['options']?_0x20a6bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x20a6bc[_0x3958('0x15')]?_0x20a6bc[_0x3958('0x15')][_0x3958('0x16')]||null:null,'attributes':_0x20a6bc[_0x3958('0x15')]?_0x20a6bc[_0x3958('0x15')][_0x3958('0x17')]||null:null,'limit':_0x20a6bc[_0x3958('0x15')]?_0x20a6bc[_0x3958('0x15')][_0x3958('0x18')]||null:null,'include':_0x20a6bc[_0x3958('0x15')]?_0x20a6bc[_0x3958('0x15')][_0x3958('0x19')]?_['map'](_0x20a6bc['options'][_0x3958('0x19')],function(_0xb018db){return{'model':db[_0xb018db['model']],'as':_0xb018db['as'],'attributes':_0xb018db[_0x3958('0x17')],'include':_0xb018db[_0x3958('0x19')]?_[_0x3958('0x1a')](_0xb018db[_0x3958('0x19')],function(_0x131b33){return{'model':db[_0x131b33['model']],'as':_0x131b33['as'],'attributes':_0x131b33[_0x3958('0x17')],'include':_0x131b33['include']?_[_0x3958('0x1a')](_0x131b33['include'],function(_0x3c4ce9){return{'model':db[_0x3c4ce9[_0x3958('0x1b')]],'as':_0x3c4ce9['as'],'attributes':_0x3c4ce9[_0x3958('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3958('0xa')](function(_0x4c9db5){logger[_0x3958('0x10')](_0x3958('0x12'),_0x20a6bc);logger[_0x3958('0x1c')]('GetZendeskAccount',_0x20a6bc,JSON[_0x3958('0xc')](_0x4c9db5));_0x146a70(_0x4c9db5);})[_0x3958('0x1d')](function(_0x2e4599){logger[_0x3958('0xd')](_0x3958('0x12'),_0x2e4599[_0x3958('0xf')],_0x20a6bc);_0x27b13d(_0x50e1bf['error'](0x1f4,_0x2e4599[_0x3958('0xf')]));});});};exports[_0x3958('0x1e')]=function(_0x4d459f){var _0x663593=this;return new Promise(function(_0x3e3193,_0x1c2f79){return db[_0x3958('0x13')][_0x3958('0x1f')]({'raw':_0x4d459f['options']?_0x4d459f[_0x3958('0x15')][_0x3958('0x20')]===undefined?!![]:![]:!![],'where':_0x4d459f[_0x3958('0x15')]?_0x4d459f['options']['where']||null:null,'attributes':_0x4d459f['options']?_0x4d459f[_0x3958('0x15')][_0x3958('0x17')]||null:null,'include':_0x4d459f[_0x3958('0x15')]?_0x4d459f['options'][_0x3958('0x19')]?_['map'](_0x4d459f['options'][_0x3958('0x19')],function(_0x5cfd45){return{'model':db[_0x5cfd45[_0x3958('0x1b')]],'as':_0x5cfd45['as'],'attributes':_0x5cfd45['attributes'],'include':_0x5cfd45[_0x3958('0x19')]?_[_0x3958('0x1a')](_0x5cfd45['include'],function(_0x5abfba){return{'model':db[_0x5abfba[_0x3958('0x1b')]],'as':_0x5abfba['as'],'attributes':_0x5abfba[_0x3958('0x17')],'include':_0x5abfba[_0x3958('0x19')]?_[_0x3958('0x1a')](_0x5abfba[_0x3958('0x19')],function(_0x7f5309){return{'model':db[_0x7f5309[_0x3958('0x1b')]],'as':_0x7f5309['as'],'attributes':_0x7f5309[_0x3958('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13e529){logger[_0x3958('0x10')](_0x3958('0x1e'),_0x4d459f);logger['debug'](_0x3958('0x1e'),_0x4d459f,JSON[_0x3958('0xc')](_0x13e529));_0x3e3193(_0x13e529);})[_0x3958('0x1d')](function(_0x4705d3){logger['error'](_0x3958('0x1e'),_0x4705d3[_0x3958('0xf')],_0x4d459f);_0x1c2f79(_0x663593['error'](0x1f4,_0x4705d3[_0x3958('0xf')]));});});}; \ No newline at end of file +var _0xe824=['message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','model','attributes','map','then','ShowZendeskAccount','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38f5fe,_0x53da89){var _0x54ab60=function(_0x555f96){while(--_0x555f96){_0x38f5fe['push'](_0x38f5fe['shift']());}};_0x54ab60(++_0x53da89);}(_0xe824,0x1c2));var _0x4e82=function(_0x1f16de,_0x548eb9){_0x1f16de=_0x1f16de-0x0;var _0x36cd80=_0xe824[_0x1f16de];return _0x36cd80;};'use strict';var _=require(_0x4e82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e82('0x1'));var fs=require('fs');var Redis=require(_0x4e82('0x2'));var db=require(_0x4e82('0x3'))['db'];var utils=require(_0x4e82('0x4'));var logger=require(_0x4e82('0x5'))('rpc');var config=require(_0x4e82('0x6'));var jayson=require(_0x4e82('0x7'));var client=jayson[_0x4e82('0x8')][_0x4e82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4c41,_0x5d4ea3,_0x19e0f7){return new BPromise(function(_0x2e38bd,_0x194857){return client[_0x4e82('0xa')](_0x5d4c41,_0x19e0f7)['then'](function(_0x4d4a83){logger['info'](_0x4e82('0xb'),_0x5d4ea3,_0x4e82('0xc'));logger[_0x4e82('0xd')](_0x4e82('0xe'),_0x5d4ea3,_0x4e82('0xc'),JSON[_0x4e82('0xf')](_0x4d4a83));if(_0x4d4a83[_0x4e82('0x10')]){if(_0x4d4a83[_0x4e82('0x10')][_0x4e82('0x11')]===0x1f4){logger[_0x4e82('0x10')](_0x4e82('0xb'),_0x5d4ea3,_0x4d4a83[_0x4e82('0x10')][_0x4e82('0x12')]);return _0x194857(_0x4d4a83[_0x4e82('0x10')][_0x4e82('0x12')]);}logger['error'](_0x4e82('0xb'),_0x5d4ea3,_0x4d4a83[_0x4e82('0x10')][_0x4e82('0x12')]);return _0x2e38bd(_0x4d4a83['error'][_0x4e82('0x12')]);}else{logger[_0x4e82('0x13')](_0x4e82('0xb'),_0x5d4ea3,_0x4e82('0xc'));_0x2e38bd(_0x4d4a83[_0x4e82('0x14')][_0x4e82('0x12')]);}})[_0x4e82('0x15')](function(_0x2d8a34){logger[_0x4e82('0x10')](_0x4e82('0xb'),_0x5d4ea3,_0x2d8a34);_0x194857(_0x2d8a34);});});}exports[_0x4e82('0x16')]=function(_0x73a104){var _0x3bcfb9=this;return new Promise(function(_0x820748,_0x16cf7f){return db[_0x4e82('0x17')][_0x4e82('0x18')]({'raw':_0x73a104[_0x4e82('0x19')]?_0x73a104['options']['raw']===undefined?!![]:![]:!![],'where':_0x73a104[_0x4e82('0x19')]?_0x73a104[_0x4e82('0x19')][_0x4e82('0x1a')]||null:null,'attributes':_0x73a104[_0x4e82('0x19')]?_0x73a104[_0x4e82('0x19')]['attributes']||null:null,'limit':_0x73a104[_0x4e82('0x19')]?_0x73a104[_0x4e82('0x19')][_0x4e82('0x1b')]||null:null,'include':_0x73a104['options']?_0x73a104['options']['include']?_['map'](_0x73a104[_0x4e82('0x19')][_0x4e82('0x1c')],function(_0x2ba586){return{'model':db[_0x2ba586[_0x4e82('0x1d')]],'as':_0x2ba586['as'],'attributes':_0x2ba586[_0x4e82('0x1e')],'include':_0x2ba586[_0x4e82('0x1c')]?_[_0x4e82('0x1f')](_0x2ba586[_0x4e82('0x1c')],function(_0x38b02b){return{'model':db[_0x38b02b['model']],'as':_0x38b02b['as'],'attributes':_0x38b02b[_0x4e82('0x1e')],'include':_0x38b02b['include']?_[_0x4e82('0x1f')](_0x38b02b[_0x4e82('0x1c')],function(_0x2d6455){return{'model':db[_0x2d6455[_0x4e82('0x1d')]],'as':_0x2d6455['as'],'attributes':_0x2d6455['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e82('0x20')](function(_0x4b6b05){logger['info'](_0x4e82('0x16'),_0x73a104);logger[_0x4e82('0xd')](_0x4e82('0x16'),_0x73a104,JSON[_0x4e82('0xf')](_0x4b6b05));_0x820748(_0x4b6b05);})[_0x4e82('0x15')](function(_0x2cea30){logger[_0x4e82('0x10')](_0x4e82('0x16'),_0x2cea30[_0x4e82('0x12')],_0x73a104);_0x16cf7f(_0x3bcfb9[_0x4e82('0x10')](0x1f4,_0x2cea30[_0x4e82('0x12')]));});});};exports[_0x4e82('0x21')]=function(_0x17f1f0){var _0x4b2857=this;return new Promise(function(_0x5b71fa,_0x555bf0){return db[_0x4e82('0x17')][_0x4e82('0x22')]({'raw':_0x17f1f0[_0x4e82('0x19')]?_0x17f1f0[_0x4e82('0x19')][_0x4e82('0x23')]===undefined?!![]:![]:!![],'where':_0x17f1f0[_0x4e82('0x19')]?_0x17f1f0[_0x4e82('0x19')][_0x4e82('0x1a')]||null:null,'attributes':_0x17f1f0[_0x4e82('0x19')]?_0x17f1f0[_0x4e82('0x19')][_0x4e82('0x1e')]||null:null,'include':_0x17f1f0[_0x4e82('0x19')]?_0x17f1f0[_0x4e82('0x19')]['include']?_[_0x4e82('0x1f')](_0x17f1f0['options'][_0x4e82('0x1c')],function(_0x205f1b){return{'model':db[_0x205f1b[_0x4e82('0x1d')]],'as':_0x205f1b['as'],'attributes':_0x205f1b[_0x4e82('0x1e')],'include':_0x205f1b['include']?_[_0x4e82('0x1f')](_0x205f1b[_0x4e82('0x1c')],function(_0x11b7e){return{'model':db[_0x11b7e['model']],'as':_0x11b7e['as'],'attributes':_0x11b7e[_0x4e82('0x1e')],'include':_0x11b7e[_0x4e82('0x1c')]?_[_0x4e82('0x1f')](_0x11b7e['include'],function(_0x503a6d){return{'model':db[_0x503a6d[_0x4e82('0x1d')]],'as':_0x503a6d['as'],'attributes':_0x503a6d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x87a5d2){logger[_0x4e82('0x13')]('ShowZendeskAccount',_0x17f1f0);logger['debug'](_0x4e82('0x21'),_0x17f1f0,JSON[_0x4e82('0xf')](_0x87a5d2));_0x5b71fa(_0x87a5d2);})[_0x4e82('0x15')](function(_0xc1c1e2){logger[_0x4e82('0x10')]('ShowZendeskAccount',_0xc1c1e2['message'],_0x17f1f0);_0x555bf0(_0x4b2857[_0x4e82('0x10')](0x1f4,_0xc1c1e2[_0x4e82('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 79fa363..c2c55a3 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 _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x5c82f7,_0x55360f){var _0x192f84=function(_0x5d55d7){while(--_0x5d55d7){_0x5c82f7['push'](_0x5c82f7['shift']());}};_0x192f84(++_0x55360f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('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 1a18516..7255822 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 _0x5341=['STRING','exports'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x5341,0xf1));var _0x1534=function(_0x29e8f0,_0x116a12){_0x29e8f0=_0x29e8f0-0x0;var _0x18005c=_0x5341[_0x29e8f0];return _0x18005c;};'use strict';var Sequelize=require('sequelize');module[_0x1534('0x0')]={'name':{'type':Sequelize[_0x1534('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd997=['exports','STRING','sequelize'];(function(_0x2165b4,_0x3424c6){var _0xf3401b=function(_0x384b0b){while(--_0x384b0b){_0x2165b4['push'](_0x2165b4['shift']());}};_0xf3401b(++_0x3424c6);}(_0xd997,0x1a0));var _0x7d99=function(_0x14a3fa,_0x28c1bc){_0x14a3fa=_0x14a3fa-0x0;var _0x7d5827=_0xd997[_0x14a3fa];return _0x7d5827;};'use strict';var Sequelize=require(_0x7d99('0x0'));module[_0x7d99('0x1')]={'name':{'type':Sequelize[_0x7d99('0x2')]},'description':{'type':Sequelize[_0x7d99('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c7f94e1..3a71824 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 _0x7406=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','find','catch','create','body','params','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x2372b9,_0xccd0aa){var _0x181e26=function(_0x4bc5ca){while(--_0x4bc5ca){_0x2372b9['push'](_0x2372b9['shift']());}};_0x181e26(++_0xccd0aa);}(_0x7406,0x139));var _0x6740=function(_0x57f152,_0x34be17){_0x57f152=_0x57f152-0x0;var _0x283d82=_0x7406[_0x57f152];return _0x283d82;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6740('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6740('0x1'));var moment=require('moment');var BPromise=require(_0x6740('0x2'));var Mustache=require(_0x6740('0x3'));var util=require('util');var path=require(_0x6740('0x4'));var sox=require(_0x6740('0x5'));var csv=require(_0x6740('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6740('0x7'));var _=require('lodash');var squel=require(_0x6740('0x8'));var crypto=require(_0x6740('0x9'));var jsforce=require(_0x6740('0xa'));var deskjs=require(_0x6740('0xb'));var toCsv=require(_0x6740('0x6'));var querystring=require(_0x6740('0xc'));var Papa=require(_0x6740('0xd'));var Redis=require('ioredis');var authService=require(_0x6740('0xe'));var qs=require(_0x6740('0xf'));var as=require(_0x6740('0x10'));var hardwareService=require(_0x6740('0x11'));var logger=require(_0x6740('0x12'))(_0x6740('0x13'));var utils=require('../../config/utils');var config=require(_0x6740('0x14'));var licenseUtil=require(_0x6740('0x15'));var db=require(_0x6740('0x16'))['db'];function respondWithStatusCode(_0x31e00d,_0x5633ea){_0x5633ea=_0x5633ea||0xcc;return function(_0x30bb06){if(_0x30bb06){return _0x31e00d[_0x6740('0x17')](_0x5633ea);}return _0x31e00d[_0x6740('0x18')](_0x5633ea)[_0x6740('0x19')]();};}function respondWithResult(_0xfc5d77,_0x5422b1){_0x5422b1=_0x5422b1||0xc8;return function(_0x2c4f2a){if(_0x2c4f2a){return _0xfc5d77[_0x6740('0x18')](_0x5422b1)['json'](_0x2c4f2a);}};}function respondWithFilteredResult(_0x27106e,_0x1f5caf){return function(_0x2de476){if(_0x2de476){var _0x37ad42=typeof _0x1f5caf['offset']==='undefined'&&typeof _0x1f5caf['limit']===_0x6740('0x1a');var _0x78d66f=_0x2de476[_0x6740('0x1b')];var _0x17eb2d=_0x37ad42?0x0:_0x1f5caf[_0x6740('0x1c')];var _0xa620dc=_0x37ad42?_0x2de476['count']:_0x1f5caf[_0x6740('0x1c')]+_0x1f5caf[_0x6740('0x1d')];var _0x319c16;if(_0xa620dc>=_0x78d66f){_0xa620dc=_0x78d66f;_0x319c16=0xc8;}else{_0x319c16=0xce;}_0x27106e[_0x6740('0x18')](_0x319c16);return _0x27106e[_0x6740('0x1e')]('Content-Range',_0x17eb2d+'-'+_0xa620dc+'/'+_0x78d66f)[_0x6740('0x1f')](_0x2de476);}return null;};}function patchUpdates(_0x3fbe2d){return function(_0x2f1400){try{jsonpatch[_0x6740('0x20')](_0x2f1400,_0x3fbe2d,!![]);}catch(_0x4f3a9c){return BPromise[_0x6740('0x21')](_0x4f3a9c);}return _0x2f1400[_0x6740('0x22')]();};}function saveUpdates(_0xc0f600,_0x288c7d){return function(_0x56b088){if(_0x56b088){return _0x56b088[_0x6740('0x23')](_0xc0f600)[_0x6740('0x24')](function(_0x38eb57){return _0x38eb57;});}return null;};}function removeEntity(_0x2a3716,_0x4be36d){return function(_0x40a5dc){if(_0x40a5dc){return _0x40a5dc[_0x6740('0x25')]()[_0x6740('0x24')](function(){_0x2a3716['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48522b,_0x32f609){return function(_0x15d4a3){if(!_0x15d4a3){_0x48522b[_0x6740('0x17')](0x194);}return _0x15d4a3;};}function handleError(_0x22cc59,_0x291ce2){_0x291ce2=_0x291ce2||0x1f4;return function(_0x3e202c){logger[_0x6740('0x26')](_0x3e202c['stack']);if(_0x3e202c[_0x6740('0x27')]){delete _0x3e202c[_0x6740('0x27')];}_0x22cc59['status'](_0x291ce2)[_0x6740('0x28')](_0x3e202c);};}exports[_0x6740('0x29')]=function(_0x371033,_0x3474f8){var _0x1080b0={},_0x26ee48={},_0x198d41={'count':0x0,'rows':[]};var _0xd0b264=_[_0x6740('0x2a')](db[_0x6740('0x2b')][_0x6740('0x2c')],function(_0x38a823){return{'name':_0x38a823['fieldName'],'type':_0x38a823[_0x6740('0x2d')][_0x6740('0x2e')]};});_0x26ee48[_0x6740('0x2f')]=_[_0x6740('0x2a')](_0xd0b264,_0x6740('0x27'));_0x26ee48[_0x6740('0x30')]=_[_0x6740('0x31')](_0x371033[_0x6740('0x30')]);_0x26ee48[_0x6740('0x32')]=_[_0x6740('0x33')](_0x26ee48[_0x6740('0x2f')],_0x26ee48[_0x6740('0x30')]);_0x1080b0['attributes']=_[_0x6740('0x33')](_0x26ee48[_0x6740('0x2f')],qs[_0x6740('0x34')](_0x371033['query'][_0x6740('0x34')]));_0x1080b0['attributes']=_0x1080b0[_0x6740('0x35')][_0x6740('0x36')]?_0x1080b0['attributes']:_0x26ee48[_0x6740('0x2f')];if(!_0x371033[_0x6740('0x30')][_0x6740('0x37')](_0x6740('0x38'))){_0x1080b0[_0x6740('0x1d')]=qs[_0x6740('0x1d')](_0x371033[_0x6740('0x30')][_0x6740('0x1d')]);_0x1080b0[_0x6740('0x1c')]=qs[_0x6740('0x1c')](_0x371033[_0x6740('0x30')][_0x6740('0x1c')]);}_0x1080b0[_0x6740('0x39')]=qs['sort'](_0x371033[_0x6740('0x30')][_0x6740('0x3a')]);_0x1080b0[_0x6740('0x3b')]=qs[_0x6740('0x32')](_[_0x6740('0x3c')](_0x371033[_0x6740('0x30')],_0x26ee48[_0x6740('0x32')]),_0xd0b264);if(_0x371033[_0x6740('0x30')]['filter']){_0x1080b0[_0x6740('0x3b')]=_[_0x6740('0x3d')](_0x1080b0[_0x6740('0x3b')],{'$or':_[_0x6740('0x2a')](_0xd0b264,function(_0x104555){if(_0x104555[_0x6740('0x2d')]!==_0x6740('0x3e')){var _0x10ca1c={};_0x10ca1c[_0x104555[_0x6740('0x27')]]={'$like':'%'+_0x371033[_0x6740('0x30')][_0x6740('0x3f')]+'%'};return _0x10ca1c;}})});}_0x1080b0=_[_0x6740('0x3d')]({},_0x1080b0,_0x371033[_0x6740('0x40')]);var _0x21f55b={'where':_0x1080b0[_0x6740('0x3b')]};return db[_0x6740('0x2b')]['count'](_0x21f55b)[_0x6740('0x24')](function(_0x1a3ecd){_0x198d41['count']=_0x1a3ecd;if(_0x371033[_0x6740('0x30')][_0x6740('0x41')]){_0x1080b0[_0x6740('0x42')]=[{'all':!![]}];}return db[_0x6740('0x2b')]['findAll'](_0x1080b0);})['then'](function(_0x10ad7d){_0x198d41[_0x6740('0x43')]=_0x10ad7d;return _0x198d41;})[_0x6740('0x24')](respondWithFilteredResult(_0x3474f8,_0x1080b0))['catch'](handleError(_0x3474f8,null));};exports['show']=function(_0x4c9144,_0x1b3d28){var _0x1613d1={'raw':![],'where':{'id':_0x4c9144['params']['id']}},_0x614eeb={};_0x614eeb[_0x6740('0x2f')]=_[_0x6740('0x31')](db[_0x6740('0x2b')]['rawAttributes']);_0x614eeb[_0x6740('0x30')]=_[_0x6740('0x31')](_0x4c9144['query']);_0x614eeb['filters']=_[_0x6740('0x33')](_0x614eeb[_0x6740('0x2f')],_0x614eeb[_0x6740('0x30')]);_0x1613d1['attributes']=_[_0x6740('0x33')](_0x614eeb[_0x6740('0x2f')],qs['fields'](_0x4c9144[_0x6740('0x30')][_0x6740('0x34')]));_0x1613d1['attributes']=_0x1613d1[_0x6740('0x35')]['length']?_0x1613d1[_0x6740('0x35')]:_0x614eeb['model'];if(_0x4c9144['query'][_0x6740('0x41')]){_0x1613d1[_0x6740('0x42')]=[{'all':!![]}];}_0x1613d1=_[_0x6740('0x3d')]({},_0x1613d1,_0x4c9144[_0x6740('0x40')]);return db[_0x6740('0x2b')][_0x6740('0x44')](_0x1613d1)[_0x6740('0x24')](handleEntityNotFound(_0x1b3d28,null))['then'](respondWithResult(_0x1b3d28,null))[_0x6740('0x45')](handleError(_0x1b3d28,null));};exports[_0x6740('0x46')]=function(_0x433200,_0x1270c9){return db[_0x6740('0x2b')][_0x6740('0x46')](_0x433200[_0x6740('0x47')],{})[_0x6740('0x24')](respondWithResult(_0x1270c9,0xc9))[_0x6740('0x45')](handleError(_0x1270c9,null));};exports[_0x6740('0x23')]=function(_0x8fa7b,_0x302cc1){if(_0x8fa7b[_0x6740('0x47')]['id']){delete _0x8fa7b[_0x6740('0x47')]['id'];}return db[_0x6740('0x2b')][_0x6740('0x44')]({'where':{'id':_0x8fa7b['params']['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x302cc1,null))[_0x6740('0x24')](saveUpdates(_0x8fa7b[_0x6740('0x47')],null))[_0x6740('0x24')](respondWithResult(_0x302cc1,null))[_0x6740('0x45')](handleError(_0x302cc1,null));};exports[_0x6740('0x25')]=function(_0x361afa,_0x47b8df){return db[_0x6740('0x2b')][_0x6740('0x44')]({'where':{'id':_0x361afa[_0x6740('0x48')]['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x47b8df,null))[_0x6740('0x24')](removeEntity(_0x47b8df,null))[_0x6740('0x45')](handleError(_0x47b8df,null));};exports[_0x6740('0x49')]=function(_0x4f4068,_0x5365b1,_0x4c696b){var _0x17ffc2={};var _0x168592={};var _0x5ab95a;var _0x5ca65c;return db[_0x6740('0x2b')]['findOne']({'where':{'id':_0x4f4068[_0x6740('0x48')]['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x5365b1,null))[_0x6740('0x24')](function(_0xbc3422){if(_0xbc3422){_0x5ab95a=_0xbc3422;_0x168592[_0x6740('0x2f')]=_[_0x6740('0x31')](db[_0x6740('0x4a')][_0x6740('0x2c')]);_0x168592[_0x6740('0x30')]=_[_0x6740('0x31')](_0x4f4068['query']);_0x168592[_0x6740('0x32')]=_[_0x6740('0x33')](_0x168592['model'],_0x168592[_0x6740('0x30')]);_0x17ffc2[_0x6740('0x35')]=_[_0x6740('0x33')](_0x168592['model'],qs[_0x6740('0x34')](_0x4f4068[_0x6740('0x30')]['fields']));_0x17ffc2[_0x6740('0x35')]=_0x17ffc2[_0x6740('0x35')][_0x6740('0x36')]?_0x17ffc2[_0x6740('0x35')]:_0x168592[_0x6740('0x2f')];_0x17ffc2[_0x6740('0x39')]=qs[_0x6740('0x3a')](_0x4f4068['query'][_0x6740('0x3a')]);_0x17ffc2[_0x6740('0x3b')]=qs[_0x6740('0x32')](_['pick'](_0x4f4068[_0x6740('0x30')],_0x168592[_0x6740('0x32')]));if(_0x4f4068[_0x6740('0x30')][_0x6740('0x3f')]){_0x17ffc2[_0x6740('0x3b')]=_[_0x6740('0x3d')](_0x17ffc2['where'],{'$or':_[_0x6740('0x2a')](_0x17ffc2['attributes'],function(_0x849d1){var _0x3e72d2={};_0x3e72d2[_0x849d1]={'$like':'%'+_0x4f4068[_0x6740('0x30')]['filter']+'%'};return _0x3e72d2;})});}_0x17ffc2=_['merge']({},_0x17ffc2,_0x4f4068['options']);return _0x5ab95a['getFields'](_0x17ffc2);}})[_0x6740('0x24')](function(_0x58552f){if(_0x58552f){_0x5ca65c=_0x58552f[_0x6740('0x36')];if(!_0x4f4068[_0x6740('0x30')]['hasOwnProperty'](_0x6740('0x38'))){_0x17ffc2[_0x6740('0x1d')]=qs[_0x6740('0x1d')](_0x4f4068['query'][_0x6740('0x1d')]);_0x17ffc2[_0x6740('0x1c')]=qs[_0x6740('0x1c')](_0x4f4068[_0x6740('0x30')][_0x6740('0x1c')]);}return _0x5ab95a['getFields'](_0x17ffc2);}})[_0x6740('0x24')](function(_0x465a90){if(_0x465a90){return _0x465a90?{'count':_0x5ca65c,'rows':_0x465a90}:null;}})[_0x6740('0x24')](respondWithResult(_0x5365b1,null))['catch'](handleError(_0x5365b1,null));};exports[_0x6740('0x4b')]=function(_0x203360,_0x22078f,_0x2a7a38){var _0x850a27={};var _0xe950ce={};var _0x124eef;var _0x1dc7a8;return db[_0x6740('0x2b')][_0x6740('0x4c')]({'where':{'id':_0x203360[_0x6740('0x48')]['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x22078f,null))['then'](function(_0x24b653){if(_0x24b653){_0x124eef=_0x24b653;_0xe950ce[_0x6740('0x2f')]=_[_0x6740('0x31')](db['ZendeskField'][_0x6740('0x2c')]);_0xe950ce[_0x6740('0x30')]=_[_0x6740('0x31')](_0x203360[_0x6740('0x30')]);_0xe950ce['filters']=_[_0x6740('0x33')](_0xe950ce['model'],_0xe950ce['query']);_0x850a27[_0x6740('0x35')]=_['intersection'](_0xe950ce[_0x6740('0x2f')],qs['fields'](_0x203360[_0x6740('0x30')][_0x6740('0x34')]));_0x850a27[_0x6740('0x35')]=_0x850a27[_0x6740('0x35')][_0x6740('0x36')]?_0x850a27[_0x6740('0x35')]:_0xe950ce[_0x6740('0x2f')];_0x850a27[_0x6740('0x39')]=qs[_0x6740('0x3a')](_0x203360[_0x6740('0x30')][_0x6740('0x3a')]);_0x850a27[_0x6740('0x3b')]=qs[_0x6740('0x32')](_['pick'](_0x203360[_0x6740('0x30')],_0xe950ce[_0x6740('0x32')]));if(_0x203360[_0x6740('0x30')][_0x6740('0x3f')]){_0x850a27['where']=_[_0x6740('0x3d')](_0x850a27[_0x6740('0x3b')],{'$or':_[_0x6740('0x2a')](_0x850a27['attributes'],function(_0x2b29c1){var _0x3191a6={};_0x3191a6[_0x2b29c1]={'$like':'%'+_0x203360[_0x6740('0x30')][_0x6740('0x3f')]+'%'};return _0x3191a6;})});}_0x850a27=_[_0x6740('0x3d')]({},_0x850a27,_0x203360[_0x6740('0x40')]);return _0x124eef['getSubjects'](_0x850a27);}})['then'](function(_0x4a7956){if(_0x4a7956){_0x1dc7a8=_0x4a7956[_0x6740('0x36')];if(!_0x203360[_0x6740('0x30')][_0x6740('0x37')](_0x6740('0x38'))){_0x850a27['limit']=qs[_0x6740('0x1d')](_0x203360[_0x6740('0x30')][_0x6740('0x1d')]);_0x850a27[_0x6740('0x1c')]=qs['offset'](_0x203360[_0x6740('0x30')][_0x6740('0x1c')]);}return _0x124eef['getSubjects'](_0x850a27);}})[_0x6740('0x24')](function(_0x198c66){if(_0x198c66){return _0x198c66?{'count':_0x1dc7a8,'rows':_0x198c66}:null;}})[_0x6740('0x24')](respondWithResult(_0x22078f,null))[_0x6740('0x45')](handleError(_0x22078f,null));};exports['getDescriptions']=function(_0x40b83b,_0x12bb97,_0x37d4f1){var _0x116076={};var _0x2ccac2={};var _0x1e5c2c;var _0x5b64e1;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x40b83b[_0x6740('0x48')]['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x12bb97,null))['then'](function(_0xbdbfec){if(_0xbdbfec){_0x1e5c2c=_0xbdbfec;_0x2ccac2['model']=_[_0x6740('0x31')](db['ZendeskField'][_0x6740('0x2c')]);_0x2ccac2[_0x6740('0x30')]=_[_0x6740('0x31')](_0x40b83b[_0x6740('0x30')]);_0x2ccac2[_0x6740('0x32')]=_[_0x6740('0x33')](_0x2ccac2[_0x6740('0x2f')],_0x2ccac2[_0x6740('0x30')]);_0x116076[_0x6740('0x35')]=_[_0x6740('0x33')](_0x2ccac2[_0x6740('0x2f')],qs['fields'](_0x40b83b['query']['fields']));_0x116076[_0x6740('0x35')]=_0x116076[_0x6740('0x35')]['length']?_0x116076[_0x6740('0x35')]:_0x2ccac2[_0x6740('0x2f')];_0x116076[_0x6740('0x39')]=qs[_0x6740('0x3a')](_0x40b83b[_0x6740('0x30')]['sort']);_0x116076[_0x6740('0x3b')]=qs['filters'](_[_0x6740('0x3c')](_0x40b83b['query'],_0x2ccac2[_0x6740('0x32')]));if(_0x40b83b[_0x6740('0x30')][_0x6740('0x3f')]){_0x116076[_0x6740('0x3b')]=_['merge'](_0x116076[_0x6740('0x3b')],{'$or':_['map'](_0x116076[_0x6740('0x35')],function(_0x151948){var _0x533b93={};_0x533b93[_0x151948]={'$like':'%'+_0x40b83b[_0x6740('0x30')][_0x6740('0x3f')]+'%'};return _0x533b93;})});}_0x116076=_[_0x6740('0x3d')]({},_0x116076,_0x40b83b[_0x6740('0x40')]);return _0x1e5c2c[_0x6740('0x4d')](_0x116076);}})[_0x6740('0x24')](function(_0x42897e){if(_0x42897e){_0x5b64e1=_0x42897e['length'];if(!_0x40b83b['query'][_0x6740('0x37')]('nolimit')){_0x116076[_0x6740('0x1d')]=qs[_0x6740('0x1d')](_0x40b83b[_0x6740('0x30')]['limit']);_0x116076[_0x6740('0x1c')]=qs[_0x6740('0x1c')](_0x40b83b['query']['offset']);}return _0x1e5c2c[_0x6740('0x4d')](_0x116076);}})[_0x6740('0x24')](function(_0x4ea704){if(_0x4ea704){return _0x4ea704?{'count':_0x5b64e1,'rows':_0x4ea704}:null;}})[_0x6740('0x24')](respondWithResult(_0x12bb97,null))[_0x6740('0x45')](handleError(_0x12bb97,null));};exports[_0x6740('0x4e')]=function(_0xb38b0c,_0x3a635b,_0x473782){var _0x3b837f={};var _0x7e5ce2={};var _0x2dbfb8;var _0x29c1a5;return db['ZendeskConfiguration'][_0x6740('0x4c')]({'where':{'id':_0xb38b0c['params']['id']}})[_0x6740('0x24')](handleEntityNotFound(_0x3a635b,null))['then'](function(_0x3658bd){if(_0x3658bd){_0x2dbfb8=_0x3658bd;_0x7e5ce2[_0x6740('0x2f')]=_['keys'](db[_0x6740('0x4f')]['rawAttributes']);_0x7e5ce2['query']=_[_0x6740('0x31')](_0xb38b0c[_0x6740('0x30')]);_0x7e5ce2[_0x6740('0x32')]=_[_0x6740('0x33')](_0x7e5ce2[_0x6740('0x2f')],_0x7e5ce2[_0x6740('0x30')]);_0x3b837f[_0x6740('0x35')]=_[_0x6740('0x33')](_0x7e5ce2['model'],qs[_0x6740('0x34')](_0xb38b0c[_0x6740('0x30')]['fields']));_0x3b837f[_0x6740('0x35')]=_0x3b837f[_0x6740('0x35')]['length']?_0x3b837f[_0x6740('0x35')]:_0x7e5ce2[_0x6740('0x2f')];_0x3b837f[_0x6740('0x39')]=qs[_0x6740('0x3a')](_0xb38b0c[_0x6740('0x30')][_0x6740('0x3a')]);_0x3b837f[_0x6740('0x3b')]=qs[_0x6740('0x32')](_['pick'](_0xb38b0c[_0x6740('0x30')],_0x7e5ce2[_0x6740('0x32')]));if(_0xb38b0c[_0x6740('0x30')]['filter']){_0x3b837f[_0x6740('0x3b')]=_[_0x6740('0x3d')](_0x3b837f['where'],{'$or':_[_0x6740('0x2a')](_0x3b837f[_0x6740('0x35')],function(_0x5bcbb8){var _0x45aef5={};_0x45aef5[_0x5bcbb8]={'$like':'%'+_0xb38b0c[_0x6740('0x30')][_0x6740('0x3f')]+'%'};return _0x45aef5;})});}_0x3b837f=_[_0x6740('0x3d')]({},_0x3b837f,_0xb38b0c[_0x6740('0x40')]);return _0x2dbfb8[_0x6740('0x4e')](_0x3b837f);}})[_0x6740('0x24')](function(_0x2535ed){if(_0x2535ed){_0x29c1a5=_0x2535ed[_0x6740('0x36')];if(!_0xb38b0c['query'][_0x6740('0x37')]('nolimit')){_0x3b837f['limit']=qs[_0x6740('0x1d')](_0xb38b0c[_0x6740('0x30')][_0x6740('0x1d')]);_0x3b837f[_0x6740('0x1c')]=qs[_0x6740('0x1c')](_0xb38b0c[_0x6740('0x30')][_0x6740('0x1c')]);}return _0x2dbfb8['getTags'](_0x3b837f);}})[_0x6740('0x24')](function(_0x530a75){if(_0x530a75){return _0x530a75?{'count':_0x29c1a5,'rows':_0x530a75}:null;}})['then'](respondWithResult(_0x3a635b,null))[_0x6740('0x45')](handleError(_0x3a635b,null));};exports[_0x6740('0x50')]=function(_0x50c866,_0xb0bae1,_0x5c58fd){if(_0x50c866['body']['id']){delete _0x50c866[_0x6740('0x47')]['id'];}return db[_0x6740('0x2b')]['findOne']({'where':{'id':_0x50c866['params']['id']}})[_0x6740('0x24')](handleEntityNotFound(_0xb0bae1,null))[_0x6740('0x24')](function(_0x4ef6ce){if(_0x4ef6ce){return _0x4ef6ce['setTags'](_0x50c866[_0x6740('0x47')][_0x6740('0x51')]||[]);}return null;})[_0x6740('0x24')](respondWithResult(_0xb0bae1,null))[_0x6740('0x45')](handleError(_0xb0bae1,null));}; \ No newline at end of file +var _0xf46b=['include','body','find','catch','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','error','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','includeAll'];(function(_0x53fbee,_0x24ab62){var _0xbe753d=function(_0xcc4eb){while(--_0xcc4eb){_0x53fbee['push'](_0x53fbee['shift']());}};_0xbe753d(++_0x24ab62);}(_0xf46b,0xb2));var _0xbf46=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xf46b[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xbf46('0x0'));var rimraf=require(_0xbf46('0x1'));var zipdir=require(_0xbf46('0x2'));var jsonpatch=require(_0xbf46('0x3'));var rp=require(_0xbf46('0x4'));var moment=require(_0xbf46('0x5'));var BPromise=require(_0xbf46('0x6'));var Mustache=require(_0xbf46('0x7'));var util=require(_0xbf46('0x8'));var path=require('path');var sox=require(_0xbf46('0x9'));var csv=require(_0xbf46('0xa'));var ejs=require(_0xbf46('0xb'));var fs=require('fs');var fs_extra=require(_0xbf46('0xc'));var _=require(_0xbf46('0xd'));var squel=require(_0xbf46('0xe'));var crypto=require('crypto');var jsforce=require(_0xbf46('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbf46('0x10'));var authService=require(_0xbf46('0x11'));var qs=require(_0xbf46('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf46('0x13'));var logger=require('../../config/logger')(_0xbf46('0x14'));var utils=require(_0xbf46('0x15'));var config=require(_0xbf46('0x16'));var licenseUtil=require(_0xbf46('0x17'));var db=require(_0xbf46('0x18'))['db'];function respondWithStatusCode(_0x225d0e,_0x3470ab){_0x3470ab=_0x3470ab||0xcc;return function(_0x53c027){if(_0x53c027){return _0x225d0e[_0xbf46('0x19')](_0x3470ab);}return _0x225d0e[_0xbf46('0x1a')](_0x3470ab)[_0xbf46('0x1b')]();};}function respondWithResult(_0x2eb55e,_0x3bc3cc){_0x3bc3cc=_0x3bc3cc||0xc8;return function(_0x41578d){if(_0x41578d){return _0x2eb55e[_0xbf46('0x1a')](_0x3bc3cc)[_0xbf46('0x1c')](_0x41578d);}};}function respondWithFilteredResult(_0x96192b,_0x2f1758){return function(_0x4eb1ca){if(_0x4eb1ca){var _0x417ec3=typeof _0x2f1758['offset']==='undefined'&&typeof _0x2f1758[_0xbf46('0x1d')]===_0xbf46('0x1e');var _0x1b7cc8=_0x4eb1ca[_0xbf46('0x1f')];var _0x3b2d27=_0x417ec3?0x0:_0x2f1758[_0xbf46('0x20')];var _0x4c87fd=_0x417ec3?_0x4eb1ca[_0xbf46('0x1f')]:_0x2f1758[_0xbf46('0x20')]+_0x2f1758[_0xbf46('0x1d')];var _0x10bafe;if(_0x4c87fd>=_0x1b7cc8){_0x4c87fd=_0x1b7cc8;_0x10bafe=0xc8;}else{_0x10bafe=0xce;}_0x96192b['status'](_0x10bafe);return _0x96192b['set'](_0xbf46('0x21'),_0x3b2d27+'-'+_0x4c87fd+'/'+_0x1b7cc8)[_0xbf46('0x1c')](_0x4eb1ca);}return null;};}function patchUpdates(_0x5b3ad6){return function(_0x53e917){try{jsonpatch[_0xbf46('0x22')](_0x53e917,_0x5b3ad6,!![]);}catch(_0x151c89){return BPromise['reject'](_0x151c89);}return _0x53e917[_0xbf46('0x23')]();};}function saveUpdates(_0xca3ae3,_0x481207){return function(_0x1052f9){if(_0x1052f9){return _0x1052f9['update'](_0xca3ae3)[_0xbf46('0x24')](function(_0x4106ac){return _0x4106ac;});}return null;};}function removeEntity(_0x2916be,_0x3d7a48){return function(_0x41528b){if(_0x41528b){return _0x41528b[_0xbf46('0x25')]()[_0xbf46('0x24')](function(){_0x2916be[_0xbf46('0x1a')](0xcc)[_0xbf46('0x1b')]();});}};}function handleEntityNotFound(_0x5e4ee5,_0x156dee){return function(_0x21a575){if(!_0x21a575){_0x5e4ee5[_0xbf46('0x19')](0x194);}return _0x21a575;};}function handleError(_0x2f25d7,_0x1e88fa){_0x1e88fa=_0x1e88fa||0x1f4;return function(_0x1286a7){logger[_0xbf46('0x26')](_0x1286a7['stack']);if(_0x1286a7[_0xbf46('0x27')]){delete _0x1286a7[_0xbf46('0x27')];}_0x2f25d7[_0xbf46('0x1a')](_0x1e88fa)[_0xbf46('0x28')](_0x1286a7);};}exports['index']=function(_0x33c645,_0x51848c){var _0x401fad={},_0x3e3e85={},_0x5191e7={'count':0x0,'rows':[]};var _0x3ace1b=_[_0xbf46('0x29')](db[_0xbf46('0x2a')][_0xbf46('0x2b')],function(_0x525d2e){return{'name':_0x525d2e[_0xbf46('0x2c')],'type':_0x525d2e['type'][_0xbf46('0x2d')]};});_0x3e3e85[_0xbf46('0x2e')]=_[_0xbf46('0x29')](_0x3ace1b,_0xbf46('0x27'));_0x3e3e85[_0xbf46('0x2f')]=_['keys'](_0x33c645[_0xbf46('0x2f')]);_0x3e3e85[_0xbf46('0x30')]=_[_0xbf46('0x31')](_0x3e3e85['model'],_0x3e3e85['query']);_0x401fad['attributes']=_[_0xbf46('0x31')](_0x3e3e85[_0xbf46('0x2e')],qs[_0xbf46('0x32')](_0x33c645['query'][_0xbf46('0x32')]));_0x401fad[_0xbf46('0x33')]=_0x401fad['attributes'][_0xbf46('0x34')]?_0x401fad[_0xbf46('0x33')]:_0x3e3e85[_0xbf46('0x2e')];if(!_0x33c645['query']['hasOwnProperty'](_0xbf46('0x35'))){_0x401fad[_0xbf46('0x1d')]=qs['limit'](_0x33c645[_0xbf46('0x2f')][_0xbf46('0x1d')]);_0x401fad[_0xbf46('0x20')]=qs[_0xbf46('0x20')](_0x33c645[_0xbf46('0x2f')]['offset']);}_0x401fad[_0xbf46('0x36')]=qs[_0xbf46('0x37')](_0x33c645[_0xbf46('0x2f')][_0xbf46('0x37')]);_0x401fad[_0xbf46('0x38')]=qs['filters'](_[_0xbf46('0x39')](_0x33c645[_0xbf46('0x2f')],_0x3e3e85[_0xbf46('0x30')]),_0x3ace1b);if(_0x33c645[_0xbf46('0x2f')]['filter']){_0x401fad[_0xbf46('0x38')]=_[_0xbf46('0x3a')](_0x401fad[_0xbf46('0x38')],{'$or':_[_0xbf46('0x29')](_0x3ace1b,function(_0x33a66c){if(_0x33a66c['type']!==_0xbf46('0x3b')){var _0x1f9665={};_0x1f9665[_0x33a66c[_0xbf46('0x27')]]={'$like':'%'+_0x33c645['query'][_0xbf46('0x3c')]+'%'};return _0x1f9665;}})});}_0x401fad=_[_0xbf46('0x3a')]({},_0x401fad,_0x33c645[_0xbf46('0x3d')]);var _0x250405={'where':_0x401fad[_0xbf46('0x38')]};return db['ZendeskConfiguration']['count'](_0x250405)['then'](function(_0x1e5a8b){_0x5191e7[_0xbf46('0x1f')]=_0x1e5a8b;if(_0x33c645[_0xbf46('0x2f')]['includeAll']){_0x401fad['include']=[{'all':!![]}];}return db[_0xbf46('0x2a')][_0xbf46('0x3e')](_0x401fad);})[_0xbf46('0x24')](function(_0x588cad){_0x5191e7[_0xbf46('0x3f')]=_0x588cad;return _0x5191e7;})['then'](respondWithFilteredResult(_0x51848c,_0x401fad))['catch'](handleError(_0x51848c,null));};exports[_0xbf46('0x40')]=function(_0x2c8439,_0xcf57e3){var _0x4b09a8={'raw':![],'where':{'id':_0x2c8439[_0xbf46('0x41')]['id']}},_0x311d16={};_0x311d16[_0xbf46('0x2e')]=_[_0xbf46('0x42')](db[_0xbf46('0x2a')][_0xbf46('0x2b')]);_0x311d16['query']=_[_0xbf46('0x42')](_0x2c8439[_0xbf46('0x2f')]);_0x311d16['filters']=_[_0xbf46('0x31')](_0x311d16[_0xbf46('0x2e')],_0x311d16[_0xbf46('0x2f')]);_0x4b09a8[_0xbf46('0x33')]=_[_0xbf46('0x31')](_0x311d16[_0xbf46('0x2e')],qs[_0xbf46('0x32')](_0x2c8439[_0xbf46('0x2f')][_0xbf46('0x32')]));_0x4b09a8[_0xbf46('0x33')]=_0x4b09a8['attributes'][_0xbf46('0x34')]?_0x4b09a8[_0xbf46('0x33')]:_0x311d16['model'];if(_0x2c8439['query'][_0xbf46('0x43')]){_0x4b09a8[_0xbf46('0x44')]=[{'all':!![]}];}_0x4b09a8=_[_0xbf46('0x3a')]({},_0x4b09a8,_0x2c8439[_0xbf46('0x3d')]);return db[_0xbf46('0x2a')]['find'](_0x4b09a8)[_0xbf46('0x24')](handleEntityNotFound(_0xcf57e3,null))[_0xbf46('0x24')](respondWithResult(_0xcf57e3,null))['catch'](handleError(_0xcf57e3,null));};exports['create']=function(_0x964b0b,_0x5cb258){return db['ZendeskConfiguration']['create'](_0x964b0b[_0xbf46('0x45')],{})['then'](respondWithResult(_0x5cb258,0xc9))['catch'](handleError(_0x5cb258,null));};exports['update']=function(_0x16cdcb,_0x1d33da){if(_0x16cdcb['body']['id']){delete _0x16cdcb[_0xbf46('0x45')]['id'];}return db['ZendeskConfiguration'][_0xbf46('0x46')]({'where':{'id':_0x16cdcb[_0xbf46('0x41')]['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0x1d33da,null))[_0xbf46('0x24')](saveUpdates(_0x16cdcb[_0xbf46('0x45')],null))[_0xbf46('0x24')](respondWithResult(_0x1d33da,null))[_0xbf46('0x47')](handleError(_0x1d33da,null));};exports[_0xbf46('0x25')]=function(_0x572aad,_0xf8055){return db['ZendeskConfiguration'][_0xbf46('0x46')]({'where':{'id':_0x572aad['params']['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0xf8055,null))['then'](removeEntity(_0xf8055,null))[_0xbf46('0x47')](handleError(_0xf8055,null));};exports[_0xbf46('0x48')]=function(_0x577e77,_0x201edf,_0x446d85){var _0x5650df={};var _0x4c0d80={};var _0x5cf030;var _0x527c14;return db[_0xbf46('0x2a')][_0xbf46('0x49')]({'where':{'id':_0x577e77[_0xbf46('0x41')]['id']}})['then'](handleEntityNotFound(_0x201edf,null))[_0xbf46('0x24')](function(_0x2f1934){if(_0x2f1934){_0x5cf030=_0x2f1934;_0x4c0d80[_0xbf46('0x2e')]=_['keys'](db[_0xbf46('0x4a')][_0xbf46('0x2b')]);_0x4c0d80[_0xbf46('0x2f')]=_[_0xbf46('0x42')](_0x577e77['query']);_0x4c0d80[_0xbf46('0x30')]=_[_0xbf46('0x31')](_0x4c0d80[_0xbf46('0x2e')],_0x4c0d80[_0xbf46('0x2f')]);_0x5650df['attributes']=_[_0xbf46('0x31')](_0x4c0d80[_0xbf46('0x2e')],qs[_0xbf46('0x32')](_0x577e77[_0xbf46('0x2f')][_0xbf46('0x32')]));_0x5650df[_0xbf46('0x33')]=_0x5650df[_0xbf46('0x33')][_0xbf46('0x34')]?_0x5650df[_0xbf46('0x33')]:_0x4c0d80['model'];_0x5650df['order']=qs[_0xbf46('0x37')](_0x577e77['query'][_0xbf46('0x37')]);_0x5650df[_0xbf46('0x38')]=qs['filters'](_[_0xbf46('0x39')](_0x577e77[_0xbf46('0x2f')],_0x4c0d80['filters']));if(_0x577e77[_0xbf46('0x2f')][_0xbf46('0x3c')]){_0x5650df[_0xbf46('0x38')]=_['merge'](_0x5650df[_0xbf46('0x38')],{'$or':_[_0xbf46('0x29')](_0x5650df[_0xbf46('0x33')],function(_0x2b2f22){var _0x78e91f={};_0x78e91f[_0x2b2f22]={'$like':'%'+_0x577e77[_0xbf46('0x2f')]['filter']+'%'};return _0x78e91f;})});}_0x5650df=_['merge']({},_0x5650df,_0x577e77['options']);return _0x5cf030[_0xbf46('0x48')](_0x5650df);}})[_0xbf46('0x24')](function(_0x942e31){if(_0x942e31){_0x527c14=_0x942e31[_0xbf46('0x34')];if(!_0x577e77[_0xbf46('0x2f')][_0xbf46('0x4b')]('nolimit')){_0x5650df[_0xbf46('0x1d')]=qs['limit'](_0x577e77[_0xbf46('0x2f')][_0xbf46('0x1d')]);_0x5650df[_0xbf46('0x20')]=qs[_0xbf46('0x20')](_0x577e77[_0xbf46('0x2f')][_0xbf46('0x20')]);}return _0x5cf030[_0xbf46('0x48')](_0x5650df);}})['then'](function(_0x11904f){if(_0x11904f){return _0x11904f?{'count':_0x527c14,'rows':_0x11904f}:null;}})['then'](respondWithResult(_0x201edf,null))[_0xbf46('0x47')](handleError(_0x201edf,null));};exports[_0xbf46('0x4c')]=function(_0x11a9c4,_0x3b53d1,_0x5ca2b6){var _0x5757d1={};var _0xb8f115={};var _0x3e5e12;var _0xf75065;return db['ZendeskConfiguration'][_0xbf46('0x49')]({'where':{'id':_0x11a9c4['params']['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0x3b53d1,null))['then'](function(_0x15b7fa){if(_0x15b7fa){_0x3e5e12=_0x15b7fa;_0xb8f115[_0xbf46('0x2e')]=_[_0xbf46('0x42')](db['ZendeskField'][_0xbf46('0x2b')]);_0xb8f115[_0xbf46('0x2f')]=_[_0xbf46('0x42')](_0x11a9c4[_0xbf46('0x2f')]);_0xb8f115[_0xbf46('0x30')]=_[_0xbf46('0x31')](_0xb8f115['model'],_0xb8f115[_0xbf46('0x2f')]);_0x5757d1[_0xbf46('0x33')]=_[_0xbf46('0x31')](_0xb8f115[_0xbf46('0x2e')],qs['fields'](_0x11a9c4[_0xbf46('0x2f')][_0xbf46('0x32')]));_0x5757d1['attributes']=_0x5757d1[_0xbf46('0x33')]['length']?_0x5757d1[_0xbf46('0x33')]:_0xb8f115[_0xbf46('0x2e')];_0x5757d1[_0xbf46('0x36')]=qs['sort'](_0x11a9c4['query'][_0xbf46('0x37')]);_0x5757d1['where']=qs[_0xbf46('0x30')](_[_0xbf46('0x39')](_0x11a9c4['query'],_0xb8f115['filters']));if(_0x11a9c4[_0xbf46('0x2f')]['filter']){_0x5757d1[_0xbf46('0x38')]=_[_0xbf46('0x3a')](_0x5757d1[_0xbf46('0x38')],{'$or':_[_0xbf46('0x29')](_0x5757d1[_0xbf46('0x33')],function(_0x30a171){var _0x32f198={};_0x32f198[_0x30a171]={'$like':'%'+_0x11a9c4[_0xbf46('0x2f')][_0xbf46('0x3c')]+'%'};return _0x32f198;})});}_0x5757d1=_[_0xbf46('0x3a')]({},_0x5757d1,_0x11a9c4[_0xbf46('0x3d')]);return _0x3e5e12[_0xbf46('0x4c')](_0x5757d1);}})[_0xbf46('0x24')](function(_0x547b96){if(_0x547b96){_0xf75065=_0x547b96[_0xbf46('0x34')];if(!_0x11a9c4[_0xbf46('0x2f')][_0xbf46('0x4b')](_0xbf46('0x35'))){_0x5757d1[_0xbf46('0x1d')]=qs[_0xbf46('0x1d')](_0x11a9c4[_0xbf46('0x2f')][_0xbf46('0x1d')]);_0x5757d1[_0xbf46('0x20')]=qs['offset'](_0x11a9c4[_0xbf46('0x2f')][_0xbf46('0x20')]);}return _0x3e5e12['getSubjects'](_0x5757d1);}})[_0xbf46('0x24')](function(_0x5810a8){if(_0x5810a8){return _0x5810a8?{'count':_0xf75065,'rows':_0x5810a8}:null;}})['then'](respondWithResult(_0x3b53d1,null))[_0xbf46('0x47')](handleError(_0x3b53d1,null));};exports[_0xbf46('0x4d')]=function(_0x3a041a,_0x1078db,_0x20e49a){var _0xf1e261={};var _0x4942db={};var _0x19496d;var _0x85c86e;return db[_0xbf46('0x2a')][_0xbf46('0x49')]({'where':{'id':_0x3a041a[_0xbf46('0x41')]['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0x1078db,null))[_0xbf46('0x24')](function(_0x5346c5){if(_0x5346c5){_0x19496d=_0x5346c5;_0x4942db[_0xbf46('0x2e')]=_[_0xbf46('0x42')](db[_0xbf46('0x4a')][_0xbf46('0x2b')]);_0x4942db[_0xbf46('0x2f')]=_[_0xbf46('0x42')](_0x3a041a[_0xbf46('0x2f')]);_0x4942db[_0xbf46('0x30')]=_['intersection'](_0x4942db['model'],_0x4942db[_0xbf46('0x2f')]);_0xf1e261[_0xbf46('0x33')]=_['intersection'](_0x4942db[_0xbf46('0x2e')],qs[_0xbf46('0x32')](_0x3a041a[_0xbf46('0x2f')][_0xbf46('0x32')]));_0xf1e261['attributes']=_0xf1e261[_0xbf46('0x33')][_0xbf46('0x34')]?_0xf1e261['attributes']:_0x4942db[_0xbf46('0x2e')];_0xf1e261[_0xbf46('0x36')]=qs[_0xbf46('0x37')](_0x3a041a['query'][_0xbf46('0x37')]);_0xf1e261[_0xbf46('0x38')]=qs[_0xbf46('0x30')](_['pick'](_0x3a041a['query'],_0x4942db['filters']));if(_0x3a041a[_0xbf46('0x2f')][_0xbf46('0x3c')]){_0xf1e261[_0xbf46('0x38')]=_[_0xbf46('0x3a')](_0xf1e261['where'],{'$or':_['map'](_0xf1e261[_0xbf46('0x33')],function(_0x4c6e34){var _0x1ceb66={};_0x1ceb66[_0x4c6e34]={'$like':'%'+_0x3a041a[_0xbf46('0x2f')][_0xbf46('0x3c')]+'%'};return _0x1ceb66;})});}_0xf1e261=_[_0xbf46('0x3a')]({},_0xf1e261,_0x3a041a['options']);return _0x19496d[_0xbf46('0x4d')](_0xf1e261);}})['then'](function(_0x21005d){if(_0x21005d){_0x85c86e=_0x21005d[_0xbf46('0x34')];if(!_0x3a041a[_0xbf46('0x2f')]['hasOwnProperty']('nolimit')){_0xf1e261['limit']=qs[_0xbf46('0x1d')](_0x3a041a['query'][_0xbf46('0x1d')]);_0xf1e261[_0xbf46('0x20')]=qs['offset'](_0x3a041a['query'][_0xbf46('0x20')]);}return _0x19496d['getDescriptions'](_0xf1e261);}})[_0xbf46('0x24')](function(_0x1b235d){if(_0x1b235d){return _0x1b235d?{'count':_0x85c86e,'rows':_0x1b235d}:null;}})[_0xbf46('0x24')](respondWithResult(_0x1078db,null))[_0xbf46('0x47')](handleError(_0x1078db,null));};exports['getTags']=function(_0x5fb97,_0xdc01e3,_0x2a908b){var _0x139e45={};var _0x13c20d={};var _0x4330ae;var _0x8f0c63;return db[_0xbf46('0x2a')][_0xbf46('0x49')]({'where':{'id':_0x5fb97[_0xbf46('0x41')]['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0xdc01e3,null))[_0xbf46('0x24')](function(_0x4fade0){if(_0x4fade0){_0x4330ae=_0x4fade0;_0x13c20d[_0xbf46('0x2e')]=_['keys'](db[_0xbf46('0x4e')]['rawAttributes']);_0x13c20d[_0xbf46('0x2f')]=_[_0xbf46('0x42')](_0x5fb97[_0xbf46('0x2f')]);_0x13c20d[_0xbf46('0x30')]=_['intersection'](_0x13c20d[_0xbf46('0x2e')],_0x13c20d['query']);_0x139e45[_0xbf46('0x33')]=_[_0xbf46('0x31')](_0x13c20d[_0xbf46('0x2e')],qs['fields'](_0x5fb97['query']['fields']));_0x139e45[_0xbf46('0x33')]=_0x139e45[_0xbf46('0x33')][_0xbf46('0x34')]?_0x139e45[_0xbf46('0x33')]:_0x13c20d['model'];_0x139e45['order']=qs[_0xbf46('0x37')](_0x5fb97[_0xbf46('0x2f')]['sort']);_0x139e45['where']=qs['filters'](_[_0xbf46('0x39')](_0x5fb97[_0xbf46('0x2f')],_0x13c20d[_0xbf46('0x30')]));if(_0x5fb97[_0xbf46('0x2f')][_0xbf46('0x3c')]){_0x139e45[_0xbf46('0x38')]=_['merge'](_0x139e45[_0xbf46('0x38')],{'$or':_['map'](_0x139e45[_0xbf46('0x33')],function(_0x316cfa){var _0x45f861={};_0x45f861[_0x316cfa]={'$like':'%'+_0x5fb97[_0xbf46('0x2f')]['filter']+'%'};return _0x45f861;})});}_0x139e45=_[_0xbf46('0x3a')]({},_0x139e45,_0x5fb97[_0xbf46('0x3d')]);return _0x4330ae[_0xbf46('0x4f')](_0x139e45);}})[_0xbf46('0x24')](function(_0x30e0fa){if(_0x30e0fa){_0x8f0c63=_0x30e0fa[_0xbf46('0x34')];if(!_0x5fb97[_0xbf46('0x2f')]['hasOwnProperty']('nolimit')){_0x139e45[_0xbf46('0x1d')]=qs['limit'](_0x5fb97[_0xbf46('0x2f')][_0xbf46('0x1d')]);_0x139e45['offset']=qs[_0xbf46('0x20')](_0x5fb97[_0xbf46('0x2f')][_0xbf46('0x20')]);}return _0x4330ae[_0xbf46('0x4f')](_0x139e45);}})['then'](function(_0x30e7ad){if(_0x30e7ad){return _0x30e7ad?{'count':_0x8f0c63,'rows':_0x30e7ad}:null;}})[_0xbf46('0x24')](respondWithResult(_0xdc01e3,null))[_0xbf46('0x47')](handleError(_0xdc01e3,null));};exports[_0xbf46('0x50')]=function(_0x1c09d5,_0x490011,_0x9fb002){if(_0x1c09d5[_0xbf46('0x45')]['id']){delete _0x1c09d5[_0xbf46('0x45')]['id'];}return db[_0xbf46('0x2a')][_0xbf46('0x49')]({'where':{'id':_0x1c09d5['params']['id']}})[_0xbf46('0x24')](handleEntityNotFound(_0x490011,null))[_0xbf46('0x24')](function(_0x3bd7e1){if(_0x3bd7e1){return _0x3bd7e1['setTags'](_0x1c09d5[_0xbf46('0x45')][_0xbf46('0x51')]||[]);}return null;})[_0xbf46('0x24')](respondWithResult(_0x490011,null))['catch'](handleError(_0x490011,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 8be0df3..8ed80f9 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 _0xef0f=['moment','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x4281ab,_0x29af8d){var _0x4c3dbd=function(_0x5e893d){while(--_0x5e893d){_0x4281ab['push'](_0x4281ab['shift']());}};_0x4c3dbd(++_0x29af8d);}(_0xef0f,0x168));var _0xfef0=function(_0x4d1867,_0x2990d7){_0x4d1867=_0x4d1867-0x0;var _0x179ad3=_0xef0f[_0x4d1867];return _0x179ad3;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x282b=['moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0xe06b46,_0xf3f8c9){var _0x311033=function(_0x20a222){while(--_0x20a222){_0xe06b46['push'](_0xe06b46['shift']());}};_0x311033(++_0xf3f8c9);}(_0x282b,0xec));var _0xb282=function(_0x356d35,_0x26fe27){_0x356d35=_0x356d35-0x0;var _0x562300=_0x282b[_0x356d35];return _0x562300;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var logger=require(_0xb282('0x2'))(_0xb282('0x3'));var moment=require(_0xb282('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb282('0x5'));var rimraf=require('rimraf');var config=require(_0xb282('0x6'));var attributes=require(_0xb282('0x7'));module[_0xb282('0x8')]=function(_0x1dd19b,_0x3cad41){return _0x1dd19b[_0xb282('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 8a8b655..e84d9fa 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 _0xc7ae=['http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x4ee1ac,_0x5082d2){var _0x42a3a0=function(_0x40a43c){while(--_0x40a43c){_0x4ee1ac['push'](_0x4ee1ac['shift']());}};_0x42a3a0(++_0x5082d2);}(_0xc7ae,0x76));var _0xec7a=function(_0x2f5f8f,_0x58e168){_0x2f5f8f=_0x2f5f8f-0x0;var _0x252b9c=_0xc7ae[_0x2f5f8f];return _0x252b9c;};'use strict';var _=require(_0xec7a('0x0'));var util=require('util');var moment=require(_0xec7a('0x1'));var BPromise=require('bluebird');var rs=require(_0xec7a('0x2'));var fs=require('fs');var Redis=require(_0xec7a('0x3'));var db=require(_0xec7a('0x4'))['db'];var utils=require(_0xec7a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xec7a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec7a('0x7')][_0xec7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26ead1,_0x3f7e39,_0x447fa9){return new BPromise(function(_0xa1e88a,_0x4da25f){return client['request'](_0x26ead1,_0x447fa9)[_0xec7a('0x9')](function(_0x3afb04){logger['info'](_0xec7a('0xa'),_0x3f7e39,_0xec7a('0xb'));logger[_0xec7a('0xc')](_0xec7a('0xd'),_0x3f7e39,_0xec7a('0xb'),JSON[_0xec7a('0xe')](_0x3afb04));if(_0x3afb04[_0xec7a('0xf')]){if(_0x3afb04[_0xec7a('0xf')][_0xec7a('0x10')]===0x1f4){logger[_0xec7a('0xf')](_0xec7a('0xa'),_0x3f7e39,_0x3afb04[_0xec7a('0xf')]['message']);return _0x4da25f(_0x3afb04[_0xec7a('0xf')][_0xec7a('0x11')]);}logger[_0xec7a('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f7e39,_0x3afb04[_0xec7a('0xf')][_0xec7a('0x11')]);return _0xa1e88a(_0x3afb04['error'][_0xec7a('0x11')]);}else{logger[_0xec7a('0x12')](_0xec7a('0xa'),_0x3f7e39,_0xec7a('0xb'));_0xa1e88a(_0x3afb04[_0xec7a('0x13')][_0xec7a('0x11')]);}})[_0xec7a('0x14')](function(_0x4202d1){logger[_0xec7a('0xf')](_0xec7a('0xa'),_0x3f7e39,_0x4202d1);_0x4da25f(_0x4202d1);});});} \ No newline at end of file +var _0xd0ff=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x5a116d,_0x564079){var _0x399beb=function(_0x815420){while(--_0x815420){_0x5a116d['push'](_0x5a116d['shift']());}};_0x399beb(++_0x564079);}(_0xd0ff,0x19b));var _0xfd0f=function(_0x470ce2,_0x4b3815){_0x470ce2=_0x470ce2-0x0;var _0x739076=_0xd0ff[_0x470ce2];return _0x739076;};'use strict';var _=require(_0xfd0f('0x0'));var util=require(_0xfd0f('0x1'));var moment=require(_0xfd0f('0x2'));var BPromise=require(_0xfd0f('0x3'));var rs=require(_0xfd0f('0x4'));var fs=require('fs');var Redis=require(_0xfd0f('0x5'));var db=require(_0xfd0f('0x6'))['db'];var utils=require(_0xfd0f('0x7'));var logger=require(_0xfd0f('0x8'))(_0xfd0f('0x9'));var config=require(_0xfd0f('0xa'));var jayson=require(_0xfd0f('0xb'));var client=jayson[_0xfd0f('0xc')][_0xfd0f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3ffeb9,_0x5ba995,_0x1b3234){return new BPromise(function(_0x4ad453,_0x3fa4ac){return client['request'](_0x3ffeb9,_0x1b3234)['then'](function(_0x41a136){logger[_0xfd0f('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5ba995,_0xfd0f('0xf'));logger[_0xfd0f('0x10')](_0xfd0f('0x11'),_0x5ba995,_0xfd0f('0xf'),JSON[_0xfd0f('0x12')](_0x41a136));if(_0x41a136[_0xfd0f('0x13')]){if(_0x41a136[_0xfd0f('0x13')]['code']===0x1f4){logger[_0xfd0f('0x13')](_0xfd0f('0x14'),_0x5ba995,_0x41a136[_0xfd0f('0x13')][_0xfd0f('0x15')]);return _0x3fa4ac(_0x41a136['error'][_0xfd0f('0x15')]);}logger[_0xfd0f('0x13')](_0xfd0f('0x14'),_0x5ba995,_0x41a136['error']['message']);return _0x4ad453(_0x41a136[_0xfd0f('0x13')][_0xfd0f('0x15')]);}else{logger[_0xfd0f('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5ba995,'request\x20sent');_0x4ad453(_0x41a136[_0xfd0f('0x16')][_0xfd0f('0x15')]);}})['catch'](function(_0x3d92e7){logger[_0xfd0f('0x13')](_0xfd0f('0x14'),_0x5ba995,_0x3d92e7);_0x3fa4ac(_0x3d92e7);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 8997a8a..2afbf75 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 _0xe4dc=['multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports'];(function(_0x3e943f,_0xea1cc9){var _0x42e28f=function(_0x48a24f){while(--_0x48a24f){_0x3e943f['push'](_0x3e943f['shift']());}};_0x42e28f(++_0xea1cc9);}(_0xe4dc,0x66));var _0xce4d=function(_0x37a4d1,_0x5b5556){_0x37a4d1=_0x37a4d1-0x0;var _0x5237cf=_0xe4dc[_0x37a4d1];return _0x5237cf;};'use strict';var multer=require(_0xce4d('0x0'));var util=require('util');var path=require(_0xce4d('0x1'));var timeout=require('connect-timeout');var express=require(_0xce4d('0x2'));var router=express[_0xce4d('0x3')]();var fs_extra=require(_0xce4d('0x4'));var auth=require(_0xce4d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce4d('0x6'));var controller=require(_0xce4d('0x7'));router[_0xce4d('0x8')]('/',auth[_0xce4d('0x9')](),controller['index']);router[_0xce4d('0x8')](_0xce4d('0xa'),auth[_0xce4d('0x9')](),controller[_0xce4d('0xb')]);router[_0xce4d('0xc')]('/',auth[_0xce4d('0x9')](),controller['create']);router['put'](_0xce4d('0xa'),auth[_0xce4d('0x9')](),controller[_0xce4d('0xd')]);router[_0xce4d('0xe')](_0xce4d('0xa'),auth[_0xce4d('0x9')](),controller[_0xce4d('0xf')]);module[_0xce4d('0x10')]=router; \ No newline at end of file +var _0xd0e7=['exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0xd0e7,0x1d1));var _0x7d0e=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xd0e7[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var path=require(_0x7d0e('0x2'));var timeout=require(_0x7d0e('0x3'));var express=require(_0x7d0e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d0e('0x5'));var controller=require('./intZendeskField.controller');router[_0x7d0e('0x6')]('/',auth[_0x7d0e('0x7')](),controller[_0x7d0e('0x8')]);router['get'](_0x7d0e('0x9'),auth[_0x7d0e('0x7')](),controller[_0x7d0e('0xa')]);router[_0x7d0e('0xb')]('/',auth[_0x7d0e('0x7')](),controller[_0x7d0e('0xc')]);router[_0x7d0e('0xd')](_0x7d0e('0x9'),auth[_0x7d0e('0x7')](),controller['update']);router['delete'](_0x7d0e('0x9'),auth['isAuthenticated'](),controller[_0x7d0e('0xe')]);module[_0x7d0e('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5095feb..08beb9d 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 _0xc5bb=['keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xc5bb,0x92));var _0xbc5b=function(_0x475257,_0x59735f){_0x475257=_0x475257-0x0;var _0x33a403=_0xc5bb[_0x475257];return _0x33a403;};'use strict';var Sequelize=require(_0xbc5b('0x0'));module[_0xbc5b('0x1')]={'type':{'type':Sequelize[_0xbc5b('0x2')]('string',_0xbc5b('0x3'),'customVariable',_0xbc5b('0x4'),_0xbc5b('0x5')),'defaultValue':_0xbc5b('0x6')},'content':{'type':Sequelize[_0xbc5b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbc5b('0x2')](_0xbc5b('0x6'),_0xbc5b('0x3'),_0xbc5b('0x8'))},'keyContent':{'type':Sequelize[_0xbc5b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbc5b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8cf9=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x548f61,_0x3bb849){var _0x14ab82=function(_0x6947e6){while(--_0x6947e6){_0x548f61['push'](_0x548f61['shift']());}};_0x14ab82(++_0x3bb849);}(_0x8cf9,0x122));var _0x98cf=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x8cf9[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x98cf('0x0'));module['exports']={'type':{'type':Sequelize[_0x98cf('0x1')](_0x98cf('0x2'),_0x98cf('0x3'),_0x98cf('0x4'),_0x98cf('0x5'),_0x98cf('0x6')),'defaultValue':_0x98cf('0x2')},'content':{'type':Sequelize[_0x98cf('0x7')]},'key':{'type':Sequelize[_0x98cf('0x7')]},'keyType':{'type':Sequelize[_0x98cf('0x1')]('string',_0x98cf('0x3'),_0x98cf('0x4'))},'keyContent':{'type':Sequelize[_0x98cf('0x7')]},'idField':{'type':Sequelize[_0x98cf('0x7')]},'nameField':{'type':Sequelize[_0x98cf('0x7')]},'customField':{'type':Sequelize[_0x98cf('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98cf('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a40c0bf..b1fe146 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 _0xa5cb=['map','ZendeskField','rawAttributes','fieldName','type','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','send','index'];(function(_0x1bf8cd,_0x50c7b9){var _0x47d4f1=function(_0x24ec8a){while(--_0x24ec8a){_0x1bf8cd['push'](_0x1bf8cd['shift']());}};_0x47d4f1(++_0x50c7b9);}(_0xa5cb,0x17e));var _0xba5c=function(_0xb88256,_0x5afd55){_0xb88256=_0xb88256-0x0;var _0x460c54=_0xa5cb[_0xb88256];return _0x460c54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba5c('0x0'));var zipdir=require(_0xba5c('0x1'));var jsonpatch=require(_0xba5c('0x2'));var rp=require(_0xba5c('0x3'));var moment=require('moment');var BPromise=require(_0xba5c('0x4'));var Mustache=require(_0xba5c('0x5'));var util=require(_0xba5c('0x6'));var path=require('path');var sox=require(_0xba5c('0x7'));var csv=require(_0xba5c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba5c('0x9'));var _=require('lodash');var squel=require(_0xba5c('0xa'));var crypto=require(_0xba5c('0xb'));var jsforce=require(_0xba5c('0xc'));var deskjs=require(_0xba5c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba5c('0xe'));var Papa=require('papaparse');var Redis=require(_0xba5c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xba5c('0x10'));var as=require(_0xba5c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba5c('0x12'))(_0xba5c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba5c('0x14'));var db=require(_0xba5c('0x15'))['db'];function respondWithStatusCode(_0x439ed4,_0x2ac516){_0x2ac516=_0x2ac516||0xcc;return function(_0x39f1f9){if(_0x39f1f9){return _0x439ed4[_0xba5c('0x16')](_0x2ac516);}return _0x439ed4[_0xba5c('0x17')](_0x2ac516)[_0xba5c('0x18')]();};}function respondWithResult(_0x471427,_0x533b1d){_0x533b1d=_0x533b1d||0xc8;return function(_0x1452aa){if(_0x1452aa){return _0x471427['status'](_0x533b1d)[_0xba5c('0x19')](_0x1452aa);}};}function respondWithFilteredResult(_0x4dd1e5,_0x3eeb9f){return function(_0x43ce8d){if(_0x43ce8d){var _0x4e3c8f=typeof _0x3eeb9f[_0xba5c('0x1a')]===_0xba5c('0x1b')&&typeof _0x3eeb9f[_0xba5c('0x1c')]===_0xba5c('0x1b');var _0x128271=_0x43ce8d['count'];var _0x38c2b4=_0x4e3c8f?0x0:_0x3eeb9f['offset'];var _0x1c998e=_0x4e3c8f?_0x43ce8d[_0xba5c('0x1d')]:_0x3eeb9f[_0xba5c('0x1a')]+_0x3eeb9f['limit'];var _0x26b474;if(_0x1c998e>=_0x128271){_0x1c998e=_0x128271;_0x26b474=0xc8;}else{_0x26b474=0xce;}_0x4dd1e5[_0xba5c('0x17')](_0x26b474);return _0x4dd1e5[_0xba5c('0x1e')](_0xba5c('0x1f'),_0x38c2b4+'-'+_0x1c998e+'/'+_0x128271)['json'](_0x43ce8d);}return null;};}function patchUpdates(_0x224869){return function(_0x3b085c){try{jsonpatch[_0xba5c('0x20')](_0x3b085c,_0x224869,!![]);}catch(_0x41ccc0){return BPromise[_0xba5c('0x21')](_0x41ccc0);}return _0x3b085c['save']();};}function saveUpdates(_0x125eaf,_0x1b97d5){return function(_0x234c2){if(_0x234c2){return _0x234c2[_0xba5c('0x22')](_0x125eaf)['then'](function(_0x369866){return _0x369866;});}return null;};}function removeEntity(_0x4d76e8,_0x3073cb){return function(_0x19ef05){if(_0x19ef05){return _0x19ef05['destroy']()[_0xba5c('0x23')](function(){_0x4d76e8[_0xba5c('0x17')](0xcc)[_0xba5c('0x18')]();});}};}function handleEntityNotFound(_0x505780,_0x252585){return function(_0x5f386c){if(!_0x5f386c){_0x505780[_0xba5c('0x16')](0x194);}return _0x5f386c;};}function handleError(_0x1ca9fb,_0x48c035){_0x48c035=_0x48c035||0x1f4;return function(_0x40cfa1){logger['error'](_0x40cfa1['stack']);if(_0x40cfa1['name']){delete _0x40cfa1['name'];}_0x1ca9fb[_0xba5c('0x17')](_0x48c035)[_0xba5c('0x24')](_0x40cfa1);};}exports[_0xba5c('0x25')]=function(_0x23160e,_0x2f1739){var _0x559126={},_0x21f7dd={},_0x19e72d={'count':0x0,'rows':[]};var _0x5976a6=_[_0xba5c('0x26')](db[_0xba5c('0x27')][_0xba5c('0x28')],function(_0x44346b){return{'name':_0x44346b[_0xba5c('0x29')],'type':_0x44346b[_0xba5c('0x2a')]['key']};});_0x21f7dd[_0xba5c('0x2b')]=_[_0xba5c('0x26')](_0x5976a6,_0xba5c('0x2c'));_0x21f7dd[_0xba5c('0x2d')]=_['keys'](_0x23160e[_0xba5c('0x2d')]);_0x21f7dd['filters']=_[_0xba5c('0x2e')](_0x21f7dd['model'],_0x21f7dd['query']);_0x559126[_0xba5c('0x2f')]=_[_0xba5c('0x2e')](_0x21f7dd[_0xba5c('0x2b')],qs['fields'](_0x23160e['query'][_0xba5c('0x30')]));_0x559126[_0xba5c('0x2f')]=_0x559126['attributes'][_0xba5c('0x31')]?_0x559126[_0xba5c('0x2f')]:_0x21f7dd[_0xba5c('0x2b')];if(!_0x23160e[_0xba5c('0x2d')][_0xba5c('0x32')](_0xba5c('0x33'))){_0x559126[_0xba5c('0x1c')]=qs['limit'](_0x23160e['query'][_0xba5c('0x1c')]);_0x559126['offset']=qs[_0xba5c('0x1a')](_0x23160e[_0xba5c('0x2d')]['offset']);}_0x559126[_0xba5c('0x34')]=qs[_0xba5c('0x35')](_0x23160e[_0xba5c('0x2d')]['sort']);_0x559126[_0xba5c('0x36')]=qs[_0xba5c('0x37')](_[_0xba5c('0x38')](_0x23160e[_0xba5c('0x2d')],_0x21f7dd['filters']),_0x5976a6);if(_0x23160e[_0xba5c('0x2d')]['filter']){_0x559126[_0xba5c('0x36')]=_[_0xba5c('0x39')](_0x559126[_0xba5c('0x36')],{'$or':_[_0xba5c('0x26')](_0x5976a6,function(_0x3c909b){if(_0x3c909b[_0xba5c('0x2a')]!=='VIRTUAL'){var _0x485651={};_0x485651[_0x3c909b[_0xba5c('0x2c')]]={'$like':'%'+_0x23160e[_0xba5c('0x2d')]['filter']+'%'};return _0x485651;}})});}_0x559126=_[_0xba5c('0x39')]({},_0x559126,_0x23160e[_0xba5c('0x3a')]);var _0xeb5e11={'where':_0x559126['where']};return db[_0xba5c('0x27')]['count'](_0xeb5e11)[_0xba5c('0x23')](function(_0x2badef){_0x19e72d[_0xba5c('0x1d')]=_0x2badef;if(_0x23160e['query'][_0xba5c('0x3b')]){_0x559126[_0xba5c('0x3c')]=[{'all':!![]}];}return db[_0xba5c('0x27')][_0xba5c('0x3d')](_0x559126);})[_0xba5c('0x23')](function(_0x4ee074){_0x19e72d[_0xba5c('0x3e')]=_0x4ee074;return _0x19e72d;})['then'](respondWithFilteredResult(_0x2f1739,_0x559126))[_0xba5c('0x3f')](handleError(_0x2f1739,null));};exports['show']=function(_0x417589,_0x353e0d){var _0x5a097d={'raw':!![],'where':{'id':_0x417589[_0xba5c('0x40')]['id']}},_0x4896fc={};_0x4896fc[_0xba5c('0x2b')]=_[_0xba5c('0x41')](db[_0xba5c('0x27')][_0xba5c('0x28')]);_0x4896fc[_0xba5c('0x2d')]=_['keys'](_0x417589[_0xba5c('0x2d')]);_0x4896fc[_0xba5c('0x37')]=_['intersection'](_0x4896fc[_0xba5c('0x2b')],_0x4896fc[_0xba5c('0x2d')]);_0x5a097d['attributes']=_[_0xba5c('0x2e')](_0x4896fc[_0xba5c('0x2b')],qs['fields'](_0x417589[_0xba5c('0x2d')][_0xba5c('0x30')]));_0x5a097d[_0xba5c('0x2f')]=_0x5a097d[_0xba5c('0x2f')][_0xba5c('0x31')]?_0x5a097d[_0xba5c('0x2f')]:_0x4896fc[_0xba5c('0x2b')];if(_0x417589[_0xba5c('0x2d')]['includeAll']){_0x5a097d[_0xba5c('0x3c')]=[{'all':!![]}];}_0x5a097d=_[_0xba5c('0x39')]({},_0x5a097d,_0x417589[_0xba5c('0x3a')]);return db[_0xba5c('0x27')]['find'](_0x5a097d)[_0xba5c('0x23')](handleEntityNotFound(_0x353e0d,null))[_0xba5c('0x23')](respondWithResult(_0x353e0d,null))[_0xba5c('0x3f')](handleError(_0x353e0d,null));};exports[_0xba5c('0x42')]=function(_0x482500,_0x342580){return db['ZendeskField'][_0xba5c('0x42')](_0x482500[_0xba5c('0x43')],{})[_0xba5c('0x23')](respondWithResult(_0x342580,0xc9))[_0xba5c('0x3f')](handleError(_0x342580,null));};exports[_0xba5c('0x22')]=function(_0x55261a,_0x3512f8){if(_0x55261a[_0xba5c('0x43')]['id']){delete _0x55261a['body']['id'];}return db[_0xba5c('0x27')][_0xba5c('0x44')]({'where':{'id':_0x55261a[_0xba5c('0x40')]['id']}})[_0xba5c('0x23')](handleEntityNotFound(_0x3512f8,null))[_0xba5c('0x23')](saveUpdates(_0x55261a[_0xba5c('0x43')],null))[_0xba5c('0x23')](respondWithResult(_0x3512f8,null))['catch'](handleError(_0x3512f8,null));};exports[_0xba5c('0x45')]=function(_0x2b186b,_0x1bd5a5){return db[_0xba5c('0x27')][_0xba5c('0x44')]({'where':{'id':_0x2b186b[_0xba5c('0x40')]['id']}})[_0xba5c('0x23')](handleEntityNotFound(_0x1bd5a5,null))[_0xba5c('0x23')](removeEntity(_0x1bd5a5,null))[_0xba5c('0x3f')](handleError(_0x1bd5a5,null));}; \ No newline at end of file +var _0xc6eb=['merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','name','index','ZendeskField','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc6eb,0x118));var _0xbc6e=function(_0x1c14ae,_0x25ecce){_0x1c14ae=_0x1c14ae-0x0;var _0x24c7cf=_0xc6eb[_0x1c14ae];return _0x24c7cf;};'use strict';var emlformat=require(_0xbc6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc6e('0x1'));var jsonpatch=require(_0xbc6e('0x2'));var rp=require('request-promise');var moment=require(_0xbc6e('0x3'));var BPromise=require(_0xbc6e('0x4'));var Mustache=require(_0xbc6e('0x5'));var util=require(_0xbc6e('0x6'));var path=require(_0xbc6e('0x7'));var sox=require('sox');var csv=require(_0xbc6e('0x8'));var ejs=require(_0xbc6e('0x9'));var fs=require('fs');var fs_extra=require(_0xbc6e('0xa'));var _=require(_0xbc6e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbc6e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xbc6e('0xd'));var as=require(_0xbc6e('0xe'));var hardwareService=require(_0xbc6e('0xf'));var logger=require(_0xbc6e('0x10'))(_0xbc6e('0x11'));var utils=require(_0xbc6e('0x12'));var config=require(_0xbc6e('0x13'));var licenseUtil=require(_0xbc6e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee678e,_0x2a1145){_0x2a1145=_0x2a1145||0xcc;return function(_0x4f2b70){if(_0x4f2b70){return _0xee678e[_0xbc6e('0x15')](_0x2a1145);}return _0xee678e[_0xbc6e('0x16')](_0x2a1145)[_0xbc6e('0x17')]();};}function respondWithResult(_0x459133,_0x5b16f2){_0x5b16f2=_0x5b16f2||0xc8;return function(_0x5419f7){if(_0x5419f7){return _0x459133[_0xbc6e('0x16')](_0x5b16f2)[_0xbc6e('0x18')](_0x5419f7);}};}function respondWithFilteredResult(_0x5ab38e,_0x53ead4){return function(_0x4cd131){if(_0x4cd131){var _0x8b3074=typeof _0x53ead4[_0xbc6e('0x19')]===_0xbc6e('0x1a')&&typeof _0x53ead4[_0xbc6e('0x1b')]===_0xbc6e('0x1a');var _0x4049ac=_0x4cd131[_0xbc6e('0x1c')];var _0x1481c2=_0x8b3074?0x0:_0x53ead4['offset'];var _0x54b0a3=_0x8b3074?_0x4cd131[_0xbc6e('0x1c')]:_0x53ead4[_0xbc6e('0x19')]+_0x53ead4[_0xbc6e('0x1b')];var _0xe9f21a;if(_0x54b0a3>=_0x4049ac){_0x54b0a3=_0x4049ac;_0xe9f21a=0xc8;}else{_0xe9f21a=0xce;}_0x5ab38e[_0xbc6e('0x16')](_0xe9f21a);return _0x5ab38e[_0xbc6e('0x1d')]('Content-Range',_0x1481c2+'-'+_0x54b0a3+'/'+_0x4049ac)['json'](_0x4cd131);}return null;};}function patchUpdates(_0x587985){return function(_0x3aa5a9){try{jsonpatch['apply'](_0x3aa5a9,_0x587985,!![]);}catch(_0x3fd5e8){return BPromise[_0xbc6e('0x1e')](_0x3fd5e8);}return _0x3aa5a9[_0xbc6e('0x1f')]();};}function saveUpdates(_0x39abcc,_0x34f796){return function(_0x3bddbe){if(_0x3bddbe){return _0x3bddbe[_0xbc6e('0x20')](_0x39abcc)['then'](function(_0x2f59fe){return _0x2f59fe;});}return null;};}function removeEntity(_0x5d30af,_0x32f727){return function(_0x77b573){if(_0x77b573){return _0x77b573[_0xbc6e('0x21')]()[_0xbc6e('0x22')](function(){_0x5d30af[_0xbc6e('0x16')](0xcc)[_0xbc6e('0x17')]();});}};}function handleEntityNotFound(_0x289178,_0x330be3){return function(_0x531f49){if(!_0x531f49){_0x289178[_0xbc6e('0x15')](0x194);}return _0x531f49;};}function handleError(_0x349ea2,_0x314bea){_0x314bea=_0x314bea||0x1f4;return function(_0x1d1b11){logger[_0xbc6e('0x23')](_0x1d1b11['stack']);if(_0x1d1b11[_0xbc6e('0x24')]){delete _0x1d1b11['name'];}_0x349ea2['status'](_0x314bea)['send'](_0x1d1b11);};}exports[_0xbc6e('0x25')]=function(_0x22ad33,_0x4a9801){var _0x3664dd={},_0x520ae3={},_0x5afade={'count':0x0,'rows':[]};var _0x10d4e5=_['map'](db[_0xbc6e('0x26')][_0xbc6e('0x27')],function(_0x4341c6){return{'name':_0x4341c6['fieldName'],'type':_0x4341c6[_0xbc6e('0x28')][_0xbc6e('0x29')]};});_0x520ae3[_0xbc6e('0x2a')]=_[_0xbc6e('0x2b')](_0x10d4e5,'name');_0x520ae3['query']=_[_0xbc6e('0x2c')](_0x22ad33[_0xbc6e('0x2d')]);_0x520ae3[_0xbc6e('0x2e')]=_[_0xbc6e('0x2f')](_0x520ae3[_0xbc6e('0x2a')],_0x520ae3[_0xbc6e('0x2d')]);_0x3664dd[_0xbc6e('0x30')]=_['intersection'](_0x520ae3['model'],qs[_0xbc6e('0x31')](_0x22ad33['query']['fields']));_0x3664dd[_0xbc6e('0x30')]=_0x3664dd['attributes'][_0xbc6e('0x32')]?_0x3664dd[_0xbc6e('0x30')]:_0x520ae3[_0xbc6e('0x2a')];if(!_0x22ad33[_0xbc6e('0x2d')]['hasOwnProperty']('nolimit')){_0x3664dd['limit']=qs[_0xbc6e('0x1b')](_0x22ad33['query'][_0xbc6e('0x1b')]);_0x3664dd[_0xbc6e('0x19')]=qs[_0xbc6e('0x19')](_0x22ad33['query'][_0xbc6e('0x19')]);}_0x3664dd[_0xbc6e('0x33')]=qs[_0xbc6e('0x34')](_0x22ad33[_0xbc6e('0x2d')][_0xbc6e('0x34')]);_0x3664dd['where']=qs['filters'](_[_0xbc6e('0x35')](_0x22ad33[_0xbc6e('0x2d')],_0x520ae3[_0xbc6e('0x2e')]),_0x10d4e5);if(_0x22ad33[_0xbc6e('0x2d')][_0xbc6e('0x36')]){_0x3664dd['where']=_['merge'](_0x3664dd['where'],{'$or':_[_0xbc6e('0x2b')](_0x10d4e5,function(_0x347cce){if(_0x347cce[_0xbc6e('0x28')]!=='VIRTUAL'){var _0x947ff2={};_0x947ff2[_0x347cce['name']]={'$like':'%'+_0x22ad33['query'][_0xbc6e('0x36')]+'%'};return _0x947ff2;}})});}_0x3664dd=_[_0xbc6e('0x37')]({},_0x3664dd,_0x22ad33[_0xbc6e('0x38')]);var _0x9c0a2e={'where':_0x3664dd['where']};return db[_0xbc6e('0x26')]['count'](_0x9c0a2e)[_0xbc6e('0x22')](function(_0x5f4c29){_0x5afade[_0xbc6e('0x1c')]=_0x5f4c29;if(_0x22ad33[_0xbc6e('0x2d')][_0xbc6e('0x39')]){_0x3664dd[_0xbc6e('0x3a')]=[{'all':!![]}];}return db['ZendeskField'][_0xbc6e('0x3b')](_0x3664dd);})[_0xbc6e('0x22')](function(_0x346b3c){_0x5afade[_0xbc6e('0x3c')]=_0x346b3c;return _0x5afade;})[_0xbc6e('0x22')](respondWithFilteredResult(_0x4a9801,_0x3664dd))[_0xbc6e('0x3d')](handleError(_0x4a9801,null));};exports[_0xbc6e('0x3e')]=function(_0x55b274,_0x5a5f23){var _0x5bf0fe={'raw':!![],'where':{'id':_0x55b274[_0xbc6e('0x3f')]['id']}},_0x1b0cef={};_0x1b0cef[_0xbc6e('0x2a')]=_['keys'](db[_0xbc6e('0x26')][_0xbc6e('0x27')]);_0x1b0cef['query']=_[_0xbc6e('0x2c')](_0x55b274[_0xbc6e('0x2d')]);_0x1b0cef[_0xbc6e('0x2e')]=_[_0xbc6e('0x2f')](_0x1b0cef['model'],_0x1b0cef[_0xbc6e('0x2d')]);_0x5bf0fe[_0xbc6e('0x30')]=_['intersection'](_0x1b0cef[_0xbc6e('0x2a')],qs[_0xbc6e('0x31')](_0x55b274[_0xbc6e('0x2d')][_0xbc6e('0x31')]));_0x5bf0fe['attributes']=_0x5bf0fe['attributes'][_0xbc6e('0x32')]?_0x5bf0fe[_0xbc6e('0x30')]:_0x1b0cef[_0xbc6e('0x2a')];if(_0x55b274[_0xbc6e('0x2d')][_0xbc6e('0x39')]){_0x5bf0fe[_0xbc6e('0x3a')]=[{'all':!![]}];}_0x5bf0fe=_[_0xbc6e('0x37')]({},_0x5bf0fe,_0x55b274[_0xbc6e('0x38')]);return db['ZendeskField']['find'](_0x5bf0fe)[_0xbc6e('0x22')](handleEntityNotFound(_0x5a5f23,null))[_0xbc6e('0x22')](respondWithResult(_0x5a5f23,null))[_0xbc6e('0x3d')](handleError(_0x5a5f23,null));};exports[_0xbc6e('0x40')]=function(_0x3814b6,_0x281db1){return db[_0xbc6e('0x26')][_0xbc6e('0x40')](_0x3814b6[_0xbc6e('0x41')],{})['then'](respondWithResult(_0x281db1,0xc9))['catch'](handleError(_0x281db1,null));};exports['update']=function(_0x412301,_0x2483d8){if(_0x412301[_0xbc6e('0x41')]['id']){delete _0x412301['body']['id'];}return db[_0xbc6e('0x26')][_0xbc6e('0x42')]({'where':{'id':_0x412301[_0xbc6e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2483d8,null))[_0xbc6e('0x22')](saveUpdates(_0x412301[_0xbc6e('0x41')],null))[_0xbc6e('0x22')](respondWithResult(_0x2483d8,null))['catch'](handleError(_0x2483d8,null));};exports['destroy']=function(_0x2e7261,_0x196231){return db['ZendeskField']['find']({'where':{'id':_0x2e7261['params']['id']}})[_0xbc6e('0x22')](handleEntityNotFound(_0x196231,null))['then'](removeEntity(_0x196231,null))[_0xbc6e('0x3d')](handleError(_0x196231,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 834ead4..cde6d14 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 _0x4daa=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x47aff3,_0x44c5b2){var _0x41df14=function(_0x18fe17){while(--_0x18fe17){_0x47aff3['push'](_0x47aff3['shift']());}};_0x41df14(++_0x44c5b2);}(_0x4daa,0xf0));var _0xa4da=function(_0x43c3db,_0x36ea7b){_0x43c3db=_0x43c3db-0x0;var _0x45e6b0=_0x4daa[_0x43c3db];return _0x45e6b0;};'use strict';var _=require(_0xa4da('0x0'));var util=require(_0xa4da('0x1'));var logger=require(_0xa4da('0x2'))(_0xa4da('0x3'));var moment=require('moment');var BPromise=require(_0xa4da('0x4'));var rp=require(_0xa4da('0x5'));var fs=require('fs');var path=require(_0xa4da('0x6'));var rimraf=require(_0xa4da('0x7'));var config=require(_0xa4da('0x8'));var attributes=require(_0xa4da('0x9'));module[_0xa4da('0xa')]=function(_0x2f0e5b,_0x284ee8){return _0x2f0e5b[_0xa4da('0xb')](_0xa4da('0xc'),attributes,{'tableName':_0xa4da('0xd'),'paranoid':![],'indexes':[{'name':_0xa4da('0xe'),'fields':[_0xa4da('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30ef=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZendeskField'];(function(_0x1bbb99,_0x18b29c){var _0x7e5706=function(_0x2e7b5b){while(--_0x2e7b5b){_0x1bbb99['push'](_0x1bbb99['shift']());}};_0x7e5706(++_0x18b29c);}(_0x30ef,0xb8));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf30e('0x0'));var logger=require(_0xf30e('0x1'))(_0xf30e('0x2'));var moment=require(_0xf30e('0x3'));var BPromise=require(_0xf30e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf30e('0x5'));var rimraf=require(_0xf30e('0x6'));var config=require(_0xf30e('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xf30e('0x8')]=function(_0x4e8b3b,_0x321027){return _0x4e8b3b[_0xf30e('0x9')](_0xf30e('0xa'),attributes,{'tableName':_0xf30e('0xb'),'paranoid':![],'indexes':[{'name':_0xf30e('0xc'),'fields':[_0xf30e('0xd'),_0xf30e('0xe')],'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 313bcca..b0ffd81 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 _0x0839=['../../config/environment','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0839,0x134));var _0x9083=function(_0x1f47f4,_0x1d6631){_0x1f47f4=_0x1f47f4-0x0;var _0x175921=_0x0839[_0x1f47f4];return _0x175921;};'use strict';var _=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var moment=require(_0x9083('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9083('0x3'));var db=require(_0x9083('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9083('0x5'))(_0x9083('0x6'));var config=require(_0x9083('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9083('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d02e,_0x1c56a0,_0x5dd798){return new BPromise(function(_0x3b42e3,_0x36900b){return client[_0x9083('0x9')](_0x25d02e,_0x5dd798)[_0x9083('0xa')](function(_0x1899c9){logger[_0x9083('0xb')](_0x9083('0xc'),_0x1c56a0,_0x9083('0xd'));logger[_0x9083('0xe')](_0x9083('0xf'),_0x1c56a0,_0x9083('0xd'),JSON[_0x9083('0x10')](_0x1899c9));if(_0x1899c9[_0x9083('0x11')]){if(_0x1899c9[_0x9083('0x11')][_0x9083('0x12')]===0x1f4){logger[_0x9083('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1c56a0,_0x1899c9[_0x9083('0x11')]['message']);return _0x36900b(_0x1899c9['error']['message']);}logger[_0x9083('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1c56a0,_0x1899c9[_0x9083('0x11')][_0x9083('0x13')]);return _0x3b42e3(_0x1899c9['error'][_0x9083('0x13')]);}else{logger[_0x9083('0xb')](_0x9083('0xc'),_0x1c56a0,_0x9083('0xd'));_0x3b42e3(_0x1899c9[_0x9083('0x14')][_0x9083('0x13')]);}})['catch'](function(_0x48a2b5){logger[_0x9083('0x11')](_0x9083('0xc'),_0x1c56a0,_0x48a2b5);_0x36900b(_0x48a2b5);});});} \ No newline at end of file +var _0x436a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','ioredis'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x436a,0x12f));var _0xa436=function(_0x26163a,_0x11d8bf){_0x26163a=_0x26163a-0x0;var _0x2329eb=_0x436a[_0x26163a];return _0x2329eb;};'use strict';var _=require(_0xa436('0x0'));var util=require(_0xa436('0x1'));var moment=require(_0xa436('0x2'));var BPromise=require(_0xa436('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa436('0x4'));var db=require(_0xa436('0x5'))['db'];var utils=require(_0xa436('0x6'));var logger=require(_0xa436('0x7'))(_0xa436('0x8'));var config=require(_0xa436('0x9'));var jayson=require(_0xa436('0xa'));var client=jayson[_0xa436('0xb')][_0xa436('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dcedd,_0x5b57a9,_0x5933cb){return new BPromise(function(_0x14cb46,_0x1e4d33){return client['request'](_0x4dcedd,_0x5933cb)[_0xa436('0xd')](function(_0x501f9c){logger['info']('ZendeskField,\x20%s,\x20%s',_0x5b57a9,_0xa436('0xe'));logger[_0xa436('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5b57a9,_0xa436('0xe'),JSON[_0xa436('0x10')](_0x501f9c));if(_0x501f9c[_0xa436('0x11')]){if(_0x501f9c[_0xa436('0x11')][_0xa436('0x12')]===0x1f4){logger[_0xa436('0x11')](_0xa436('0x13'),_0x5b57a9,_0x501f9c[_0xa436('0x11')][_0xa436('0x14')]);return _0x1e4d33(_0x501f9c[_0xa436('0x11')]['message']);}logger[_0xa436('0x11')](_0xa436('0x13'),_0x5b57a9,_0x501f9c['error'][_0xa436('0x14')]);return _0x14cb46(_0x501f9c[_0xa436('0x11')][_0xa436('0x14')]);}else{logger[_0xa436('0x15')](_0xa436('0x13'),_0x5b57a9,_0xa436('0xe'));_0x14cb46(_0x501f9c['result'][_0xa436('0x14')]);}})['catch'](function(_0x5334cc){logger[_0xa436('0x11')]('ZendeskField,\x20%s,\x20%s',_0x5b57a9,_0x5334cc);_0x1e4d33(_0x5334cc);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ef33816..0fbf8d0 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 _0xa0cf=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','/:id','update','exports','multer'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa0cf,0x164));var _0xfa0c=function(_0x3df31d,_0x5081ff){_0x3df31d=_0x3df31d-0x0;var _0x352dbc=_0xa0cf[_0x3df31d];return _0x352dbc;};'use strict';var multer=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var path=require(_0xfa0c('0x2'));var timeout=require(_0xfa0c('0x3'));var express=require(_0xfa0c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfa0c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa0c('0x6'));var controller=require(_0xfa0c('0x7'));router[_0xfa0c('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa0c('0x9')]);router[_0xfa0c('0x8')]('/:id',auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xb')]);router[_0xfa0c('0x8')](_0xfa0c('0xc'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xd')]);router['get'](_0xfa0c('0xe'),auth[_0xfa0c('0xa')](),controller[_0xfa0c('0xf')]);router[_0xfa0c('0x10')]('/',auth[_0xfa0c('0xa')](),controller['create']);router[_0xfa0c('0x10')]('/:id/configurations',auth[_0xfa0c('0xa')](),controller['addConfiguration']);router[_0xfa0c('0x11')](_0xfa0c('0x12'),auth['isAuthenticated'](),controller[_0xfa0c('0x13')]);router['delete'](_0xfa0c('0x12'),auth[_0xfa0c('0xa')](),controller['destroy']);module[_0xfa0c('0x14')]=router; \ No newline at end of file +var _0xe676=['getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations'];(function(_0x407cc1,_0x289f09){var _0x23cc5b=function(_0x10b710){while(--_0x10b710){_0x407cc1['push'](_0x407cc1['shift']());}};_0x23cc5b(++_0x289f09);}(_0xe676,0x14f));var _0x6e67=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xe676[_0x100e36];return _0x1df0c9;};'use strict';var multer=require(_0x6e67('0x0'));var util=require('util');var path=require(_0x6e67('0x1'));var timeout=require(_0x6e67('0x2'));var express=require(_0x6e67('0x3'));var router=express['Router']();var fs_extra=require(_0x6e67('0x4'));var auth=require(_0x6e67('0x5'));var interaction=require(_0x6e67('0x6'));var config=require(_0x6e67('0x7'));var controller=require(_0x6e67('0x8'));router['get']('/',auth[_0x6e67('0x9')](),controller[_0x6e67('0xa')]);router[_0x6e67('0xb')](_0x6e67('0xc'),auth[_0x6e67('0x9')](),controller[_0x6e67('0xd')]);router[_0x6e67('0xb')](_0x6e67('0xe'),auth[_0x6e67('0x9')](),controller[_0x6e67('0xf')]);router[_0x6e67('0xb')](_0x6e67('0x10'),auth[_0x6e67('0x9')](),controller[_0x6e67('0x11')]);router['post']('/',auth[_0x6e67('0x9')](),controller[_0x6e67('0x12')]);router['post']('/:id/configurations',auth[_0x6e67('0x9')](),controller[_0x6e67('0x13')]);router[_0x6e67('0x14')](_0x6e67('0xc'),auth[_0x6e67('0x9')](),controller[_0x6e67('0x15')]);router[_0x6e67('0x16')](_0x6e67('0xc'),auth[_0x6e67('0x9')](),controller[_0x6e67('0x17')]);module[_0x6e67('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index b6dfe73..9f3f946 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 _0xe5b3=['STRING','exports'];(function(_0xd315d8,_0x5e5a96){var _0x506efe=function(_0x566199){while(--_0x566199){_0xd315d8['push'](_0xd315d8['shift']());}};_0x506efe(++_0x5e5a96);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2ed08e,_0x31e039){_0x2ed08e=_0x2ed08e-0x0;var _0x5d98cb=_0xe5b3[_0x2ed08e];return _0x5d98cb;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}}; \ No newline at end of file +var _0x5ff3=['STRING','exports'];(function(_0x1a7624,_0x1cc57d){var _0x228cd9=function(_0x5736f2){while(--_0x5736f2){_0x1a7624['push'](_0x1a7624['shift']());}};_0x228cd9(++_0x1cc57d);}(_0x5ff3,0x17d));var _0x35ff=function(_0x56b1b9,_0x32550f){_0x56b1b9=_0x56b1b9-0x0;var _0x95ce8b=_0x5ff3[_0x56b1b9];return _0x95ce8b;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3abf0de..3ca62fb 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 _0x9daf=['desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','show','params','include','catch','create','body','find','destroy','getConfigurations','findOne','nolimit','AccountId','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','clientId','clientSecret','refresh_token','access_token','getFields','host','zone','serverUrl','code','refreshToken','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9daf,0x16d));var _0xf9da=function(_0x2107a6,_0xe8360d){_0x2107a6=_0x2107a6-0x0;var _0x2f09ef=_0x9daf[_0x2107a6];return _0x2f09ef;};'use strict';var emlformat=require(_0xf9da('0x0'));var rimraf=require(_0xf9da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9da('0x2'));var rp=require(_0xf9da('0x3'));var moment=require(_0xf9da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf9da('0x5'));var util=require(_0xf9da('0x6'));var path=require(_0xf9da('0x7'));var sox=require(_0xf9da('0x8'));var csv=require(_0xf9da('0x9'));var ejs=require(_0xf9da('0xa'));var fs=require('fs');var fs_extra=require(_0xf9da('0xb'));var _=require(_0xf9da('0xc'));var squel=require(_0xf9da('0xd'));var crypto=require(_0xf9da('0xe'));var jsforce=require(_0xf9da('0xf'));var deskjs=require(_0xf9da('0x10'));var toCsv=require(_0xf9da('0x9'));var querystring=require(_0xf9da('0x11'));var Papa=require(_0xf9da('0x12'));var Redis=require(_0xf9da('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf9da('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9da('0x15'))(_0xf9da('0x16'));var utils=require(_0xf9da('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x250a01,_0x396adf){_0x396adf=_0x396adf||0xcc;return function(_0x32fabb){if(_0x32fabb){return _0x250a01['sendStatus'](_0x396adf);}return _0x250a01[_0xf9da('0x18')](_0x396adf)[_0xf9da('0x19')]();};}function respondWithResult(_0x11dcaa,_0x300e8c){_0x300e8c=_0x300e8c||0xc8;return function(_0x205a0a){if(_0x205a0a){return _0x11dcaa['status'](_0x300e8c)[_0xf9da('0x1a')](_0x205a0a);}};}function respondWithFilteredResult(_0x49762d,_0x41e86b){return function(_0x3f0a6a){if(_0x3f0a6a){var _0x29c5b1=typeof _0x41e86b[_0xf9da('0x1b')]===_0xf9da('0x1c')&&typeof _0x41e86b['limit']===_0xf9da('0x1c');var _0x601327=_0x3f0a6a[_0xf9da('0x1d')];var _0x48ac4c=_0x29c5b1?0x0:_0x41e86b['offset'];var _0x590076=_0x29c5b1?_0x3f0a6a[_0xf9da('0x1d')]:_0x41e86b[_0xf9da('0x1b')]+_0x41e86b[_0xf9da('0x1e')];var _0x147c1b;if(_0x590076>=_0x601327){_0x590076=_0x601327;_0x147c1b=0xc8;}else{_0x147c1b=0xce;}_0x49762d[_0xf9da('0x18')](_0x147c1b);return _0x49762d['set'](_0xf9da('0x1f'),_0x48ac4c+'-'+_0x590076+'/'+_0x601327)['json'](_0x3f0a6a);}return null;};}function patchUpdates(_0x4f72bc){return function(_0xdd9efc){try{jsonpatch[_0xf9da('0x20')](_0xdd9efc,_0x4f72bc,!![]);}catch(_0x266a0e){return BPromise[_0xf9da('0x21')](_0x266a0e);}return _0xdd9efc[_0xf9da('0x22')]();};}function saveUpdates(_0x47d605,_0x3c53aa){return function(_0x3e749c){if(_0x3e749c){return _0x3e749c[_0xf9da('0x23')](_0x47d605)[_0xf9da('0x24')](function(_0x55f477){return _0x55f477;});}return null;};}function removeEntity(_0x707ffe,_0x2f45a0){return function(_0x372ba8){if(_0x372ba8){return _0x372ba8['destroy']()['then'](function(){_0x707ffe[_0xf9da('0x18')](0xcc)[_0xf9da('0x19')]();});}};}function handleEntityNotFound(_0x38ba5f,_0x4aa092){return function(_0x303e96){if(!_0x303e96){_0x38ba5f[_0xf9da('0x25')](0x194);}return _0x303e96;};}function handleError(_0x27aa1b,_0xd04ea){_0xd04ea=_0xd04ea||0x1f4;return function(_0xa77ec4){logger[_0xf9da('0x26')](_0xa77ec4[_0xf9da('0x27')]);if(_0xa77ec4[_0xf9da('0x28')]){delete _0xa77ec4[_0xf9da('0x28')];}_0x27aa1b[_0xf9da('0x18')](_0xd04ea)[_0xf9da('0x29')](_0xa77ec4);};}exports[_0xf9da('0x2a')]=function(_0x442f51,_0x2a32ff){var _0x418f29={},_0x37d10d={},_0x4680af={'count':0x0,'rows':[]};var _0x150120=_[_0xf9da('0x2b')](db[_0xf9da('0x2c')][_0xf9da('0x2d')],function(_0x56324b){return{'name':_0x56324b[_0xf9da('0x2e')],'type':_0x56324b[_0xf9da('0x2f')]['key']};});_0x37d10d[_0xf9da('0x30')]=_[_0xf9da('0x2b')](_0x150120,_0xf9da('0x28'));_0x37d10d['query']=_[_0xf9da('0x31')](_0x442f51['query']);_0x37d10d[_0xf9da('0x32')]=_[_0xf9da('0x33')](_0x37d10d[_0xf9da('0x30')],_0x37d10d[_0xf9da('0x34')]);_0x418f29['attributes']=_[_0xf9da('0x33')](_0x37d10d[_0xf9da('0x30')],qs['fields'](_0x442f51[_0xf9da('0x34')][_0xf9da('0x35')]));_0x418f29[_0xf9da('0x36')]=_0x418f29[_0xf9da('0x36')][_0xf9da('0x37')]?_0x418f29[_0xf9da('0x36')]:_0x37d10d[_0xf9da('0x30')];if(!_0x442f51[_0xf9da('0x34')][_0xf9da('0x38')]('nolimit')){_0x418f29['limit']=qs[_0xf9da('0x1e')](_0x442f51['query'][_0xf9da('0x1e')]);_0x418f29[_0xf9da('0x1b')]=qs[_0xf9da('0x1b')](_0x442f51[_0xf9da('0x34')][_0xf9da('0x1b')]);}_0x418f29[_0xf9da('0x39')]=qs[_0xf9da('0x3a')](_0x442f51[_0xf9da('0x34')][_0xf9da('0x3a')]);_0x418f29[_0xf9da('0x3b')]=qs[_0xf9da('0x32')](_['pick'](_0x442f51[_0xf9da('0x34')],_0x37d10d['filters']),_0x150120);if(_0x442f51['query']['filter']){_0x418f29['where']=_[_0xf9da('0x3c')](_0x418f29[_0xf9da('0x3b')],{'$or':_[_0xf9da('0x2b')](_0x150120,function(_0x426e9c){if(_0x426e9c[_0xf9da('0x2f')]!=='VIRTUAL'){var _0x410e07={};_0x410e07[_0x426e9c[_0xf9da('0x28')]]={'$like':'%'+_0x442f51[_0xf9da('0x34')][_0xf9da('0x3d')]+'%'};return _0x410e07;}})});}_0x418f29=_[_0xf9da('0x3c')]({},_0x418f29,_0x442f51[_0xf9da('0x3e')]);var _0x445dd9={'where':_0x418f29[_0xf9da('0x3b')]};return db[_0xf9da('0x2c')]['count'](_0x445dd9)[_0xf9da('0x24')](function(_0xa6ea25){_0x4680af[_0xf9da('0x1d')]=_0xa6ea25;if(_0x442f51['query'][_0xf9da('0x3f')]){_0x418f29['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x418f29);})['then'](function(_0x4f7c9d){_0x4680af['rows']=_0x4f7c9d;return _0x4680af;})[_0xf9da('0x24')](respondWithFilteredResult(_0x2a32ff,_0x418f29))['catch'](handleError(_0x2a32ff,null));};exports[_0xf9da('0x40')]=function(_0x40ad5d,_0x7b9aba){var _0x3ef355={'raw':![],'where':{'id':_0x40ad5d[_0xf9da('0x41')]['id']}},_0x4cb749={};_0x4cb749['model']=_[_0xf9da('0x31')](db[_0xf9da('0x2c')][_0xf9da('0x2d')]);_0x4cb749[_0xf9da('0x34')]=_['keys'](_0x40ad5d[_0xf9da('0x34')]);_0x4cb749[_0xf9da('0x32')]=_[_0xf9da('0x33')](_0x4cb749[_0xf9da('0x30')],_0x4cb749[_0xf9da('0x34')]);_0x3ef355[_0xf9da('0x36')]=_['intersection'](_0x4cb749[_0xf9da('0x30')],qs[_0xf9da('0x35')](_0x40ad5d[_0xf9da('0x34')]['fields']));_0x3ef355[_0xf9da('0x36')]=_0x3ef355[_0xf9da('0x36')][_0xf9da('0x37')]?_0x3ef355[_0xf9da('0x36')]:_0x4cb749[_0xf9da('0x30')];if(_0x40ad5d['query'][_0xf9da('0x3f')]){_0x3ef355[_0xf9da('0x42')]=[{'all':!![]}];}_0x3ef355=_[_0xf9da('0x3c')]({},_0x3ef355,_0x40ad5d[_0xf9da('0x3e')]);return db[_0xf9da('0x2c')]['find'](_0x3ef355)[_0xf9da('0x24')](handleEntityNotFound(_0x7b9aba,null))[_0xf9da('0x24')](respondWithResult(_0x7b9aba,null))[_0xf9da('0x43')](handleError(_0x7b9aba,null));};exports[_0xf9da('0x44')]=function(_0x5de5f0,_0x3f13e1){return db['ZohoAccount']['create'](_0x5de5f0['body'],{})[_0xf9da('0x24')](respondWithResult(_0x3f13e1,0xc9))[_0xf9da('0x43')](handleError(_0x3f13e1,null));};exports[_0xf9da('0x23')]=function(_0x3d0377,_0x3d2fe9){if(_0x3d0377[_0xf9da('0x45')]['id']){delete _0x3d0377[_0xf9da('0x45')]['id'];}return db['ZohoAccount'][_0xf9da('0x46')]({'where':{'id':_0x3d0377[_0xf9da('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d2fe9,null))[_0xf9da('0x24')](saveUpdates(_0x3d0377['body'],null))[_0xf9da('0x24')](respondWithResult(_0x3d2fe9,null))[_0xf9da('0x43')](handleError(_0x3d2fe9,null));};exports[_0xf9da('0x47')]=function(_0x30277a,_0x1ae622){return db[_0xf9da('0x2c')][_0xf9da('0x46')]({'where':{'id':_0x30277a[_0xf9da('0x41')]['id']}})[_0xf9da('0x24')](handleEntityNotFound(_0x1ae622,null))['then'](removeEntity(_0x1ae622,null))[_0xf9da('0x43')](handleError(_0x1ae622,null));};exports[_0xf9da('0x48')]=function(_0x1c04f7,_0x4f6495,_0x1b8d76){var _0xa479bb={};var _0x3447f3={};var _0x5bd148;var _0x36d424;return db[_0xf9da('0x2c')][_0xf9da('0x49')]({'where':{'id':_0x1c04f7[_0xf9da('0x41')]['id']}})[_0xf9da('0x24')](handleEntityNotFound(_0x4f6495,null))[_0xf9da('0x24')](function(_0xe99000){if(_0xe99000){_0x5bd148=_0xe99000;_0x3447f3[_0xf9da('0x30')]=_[_0xf9da('0x31')](db['ZohoConfiguration'][_0xf9da('0x2d')]);_0x3447f3[_0xf9da('0x34')]=_[_0xf9da('0x31')](_0x1c04f7[_0xf9da('0x34')]);_0x3447f3[_0xf9da('0x32')]=_[_0xf9da('0x33')](_0x3447f3['model'],_0x3447f3[_0xf9da('0x34')]);_0xa479bb[_0xf9da('0x36')]=_[_0xf9da('0x33')](_0x3447f3[_0xf9da('0x30')],qs[_0xf9da('0x35')](_0x1c04f7[_0xf9da('0x34')][_0xf9da('0x35')]));_0xa479bb[_0xf9da('0x36')]=_0xa479bb[_0xf9da('0x36')][_0xf9da('0x37')]?_0xa479bb[_0xf9da('0x36')]:_0x3447f3[_0xf9da('0x30')];_0xa479bb['order']=qs['sort'](_0x1c04f7[_0xf9da('0x34')][_0xf9da('0x3a')]);_0xa479bb[_0xf9da('0x3b')]=qs['filters'](_['pick'](_0x1c04f7[_0xf9da('0x34')],_0x3447f3['filters']));if(_0x1c04f7['query'][_0xf9da('0x3d')]){_0xa479bb[_0xf9da('0x3b')]=_[_0xf9da('0x3c')](_0xa479bb[_0xf9da('0x3b')],{'$or':_[_0xf9da('0x2b')](_0xa479bb[_0xf9da('0x36')],function(_0x274e24){var _0x55ca89={};_0x55ca89[_0x274e24]={'$like':'%'+_0x1c04f7['query'][_0xf9da('0x3d')]+'%'};return _0x55ca89;})});}_0xa479bb=_[_0xf9da('0x3c')]({},_0xa479bb,_0x1c04f7['options']);return _0x5bd148['getConfigurations'](_0xa479bb);}})['then'](function(_0x3a4899){if(_0x3a4899){_0x36d424=_0x3a4899[_0xf9da('0x37')];if(!_0x1c04f7[_0xf9da('0x34')][_0xf9da('0x38')](_0xf9da('0x4a'))){_0xa479bb['limit']=qs[_0xf9da('0x1e')](_0x1c04f7[_0xf9da('0x34')][_0xf9da('0x1e')]);_0xa479bb[_0xf9da('0x1b')]=qs['offset'](_0x1c04f7[_0xf9da('0x34')][_0xf9da('0x1b')]);}return _0x5bd148[_0xf9da('0x48')](_0xa479bb);}})['then'](function(_0x925969){if(_0x925969){return _0x925969?{'count':_0x36d424,'rows':_0x925969}:null;}})[_0xf9da('0x24')](respondWithResult(_0x4f6495,null))[_0xf9da('0x43')](handleError(_0x4f6495,null));};exports['addConfiguration']=function(_0x1b0239,_0xbbc0bf,_0x55ec31){if(_0x1b0239['body']['id']){delete _0x1b0239['body']['id'];}return db[_0xf9da('0x2c')]['findOne']({'where':{'id':_0x1b0239[_0xf9da('0x41')]['id']}})[_0xf9da('0x24')](handleEntityNotFound(_0xbbc0bf,null))[_0xf9da('0x24')](function(_0x5f5b54){if(_0x5f5b54){_0x1b0239[_0xf9da('0x45')][_0xf9da('0x4b')]=_0x5f5b54['id'];_0x1b0239['body']['Subjects']=integrations[_0xf9da('0x4c')](_0x1b0239[_0xf9da('0x45')][_0xf9da('0x4d')],_0x1b0239['body']['type']);_0x1b0239['body']['Descriptions']=integrations[_0xf9da('0x4e')](_0x1b0239['body'][_0xf9da('0x4d')],_0x1b0239['body'][_0xf9da('0x2f')]);return db[_0xf9da('0x4f')][_0xf9da('0x44')](_0x1b0239['body'],{'include':[{'model':db[_0xf9da('0x50')],'as':_0xf9da('0x51')},{'model':db[_0xf9da('0x50')],'as':'Descriptions'}]});}return null;})[_0xf9da('0x24')](respondWithResult(_0xbbc0bf,null))[_0xf9da('0x43')](handleError(_0xbbc0bf,null));};function getAccessToken(_0x29c0f3){return new Promise(function(_0x1d4264,_0x2a39c6){var _0x25362d;switch(_0x29c0f3['zone']){case'US':_0x25362d=_0xf9da('0x52');break;case'AU':_0x25362d='https://accounts.zoho.com.au';break;case'EU':_0x25362d=_0xf9da('0x53');break;case'IN':_0x25362d='https://accounts.zoho.in';break;case'CN':_0x25362d=_0xf9da('0x54');break;default:_0x25362d=_0xf9da('0x53');break;}var _0x55ffff={'method':_0xf9da('0x55'),'uri':_0x25362d+'/oauth/v2/token','qs':{'refresh_token':_0x29c0f3['refreshToken'],'client_id':_0x29c0f3[_0xf9da('0x56')],'client_secret':_0x29c0f3[_0xf9da('0x57')],'grant_type':_0xf9da('0x58')},'json':!![]};return rp(_0x55ffff)[_0xf9da('0x24')](function(_0x3e2aa9){if(_0x3e2aa9['access_token']){_0x1d4264(_0x3e2aa9[_0xf9da('0x59')]);}else{_0x2a39c6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xf9da('0x43')](function(_0x5c1b8b){_0x2a39c6(_0x5c1b8b);});});}exports[_0xf9da('0x5a')]=function(_0x19492d,_0x1a2f4d,_0x2a1b71){var _0x49613d,_0x26f597,_0xa25481,_0x447ac0,_0x1b79b6;return db[_0xf9da('0x2c')]['findOne']({'where':{'id':_0x19492d[_0xf9da('0x41')]['id']},'attributes':['id',_0xf9da('0x5b'),_0xf9da('0x5c'),_0xf9da('0x56'),_0xf9da('0x57'),_0xf9da('0x5d'),_0xf9da('0x5e'),_0xf9da('0x5f')]})[_0xf9da('0x24')](handleEntityNotFound(_0x1a2f4d,null))['then'](function(_0x37ad38){_0x1b79b6=_0x37ad38;_0x49613d=_0x1b79b6['host'];_0x26f597=_0x49613d===_0xf9da('0x60')?'eu':'com';_0xa25481=_0x1b79b6['serverUrl'];var _0x922908=_0xa25481[_0xf9da('0x61')](-0x1);if(_0x922908==='/'||_0x922908==='\x5c'||_0x922908===':'){_0xa25481=_0xa25481['substring'](0x0,_0xa25481[_0xf9da('0x62')](_0x922908));}if(!_0x1b79b6[_0xf9da('0x5f')]){throw new Error(_0xf9da('0x63'));}return getAccessToken(_0x1b79b6);})[_0xf9da('0x24')](function(_0x1f474c){if(_0x1f474c){return rp({'method':'GET','uri':util[_0xf9da('0x64')](_0xf9da('0x65'),_0x26f597),'qs':{'module':_0xf9da('0x66')},'headers':{'Authorization':_0xf9da('0x67')+_0x1f474c},'json':!![]});}})[_0xf9da('0x24')](function(_0x53553b){if(_0x53553b){if(_0x53553b['response']&&_0x53553b['response'][_0xf9da('0x26')]){throw new Error(_0x53553b[_0xf9da('0x68')]['error'][_0xf9da('0x69')]);}var _0x2cd97b=[];var _0x55b3d1=[];var _0x151008=['Owner',_0xf9da('0x6a'),_0xf9da('0x6b'),_0xf9da('0x6c'),_0xf9da('0x6d'),_0xf9da('0x6e'),_0xf9da('0x6f'),_0xf9da('0x70')];_0x55b3d1=_[_0xf9da('0x71')](_0x53553b['fields'],function(_0x3c3b82){return _0x151008[_0xf9da('0x72')](_0x3c3b82[_0xf9da('0x73')]);});for(var _0x296799=0x0;_0x296799<_0x55b3d1[_0xf9da('0x37')];_0x296799++){if(_0x55b3d1[_0x296799][_0xf9da('0x74')]===![]){_0x2cd97b[_0xf9da('0x75')]({'id':_0x55b3d1[_0x296799]['id'],'name':_0x55b3d1[_0x296799]['display_label'],'custom':_0x55b3d1[_0x296799][_0xf9da('0x76')],'options':_0x55b3d1[_0x296799][_0xf9da('0x77')]===_0xf9da('0x78')&&_0x55b3d1[_0x296799][_0xf9da('0x79')][_0xf9da('0x37')]>-0x1?_[_0xf9da('0x2b')](_0x55b3d1[_0x296799][_0xf9da('0x79')],function(_0x5a6d22){return{'name':_0x5a6d22,'value':_0x5a6d22};}):[]});}}return{'count':_0x2cd97b['length'],'rows':_0x2cd97b};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1a2f4d,null))['catch'](function(_0x19b677){var _0x8e190a=_0x19492d[_0xf9da('0x34')][_0xf9da('0x7a')]?0x1f4:_0x19b677[_0xf9da('0x7b')]||0x1f4;logger['error'](_0xf9da('0x7c'),_0xf9da('0x5a'),_0x8e190a,JSON[_0xf9da('0x7d')](_0x19b677));delete _0x19b677['name'];if(_0x8e190a===0x191){_0x8e190a=0x190;}_0x1a2f4d[_0xf9da('0x18')](_0x8e190a)[_0xf9da('0x29')](_0x19492d['query'][_0xf9da('0x7a')]?{'message':_0xf9da('0x7e'),'statusCode':_0x19b677['statusCode']}:_0x19b677);});}; \ No newline at end of file +var _0xb06b=['Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','fields','find','catch','create','body','update','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','Description','Call_Duration','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1dcb61,_0x533143){var _0x275729=function(_0x1987eb){while(--_0x1987eb){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x275729(++_0x533143);}(_0xb06b,0xdf));var _0xbb06=function(_0x33a296,_0x20bbd2){_0x33a296=_0x33a296-0x0;var _0x50a8f2=_0xb06b[_0x33a296];return _0x50a8f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb06('0x0'));var zipdir=require(_0xbb06('0x1'));var jsonpatch=require(_0xbb06('0x2'));var rp=require(_0xbb06('0x3'));var moment=require('moment');var BPromise=require(_0xbb06('0x4'));var Mustache=require(_0xbb06('0x5'));var util=require('util');var path=require(_0xbb06('0x6'));var sox=require(_0xbb06('0x7'));var csv=require(_0xbb06('0x8'));var ejs=require(_0xbb06('0x9'));var fs=require('fs');var fs_extra=require(_0xbb06('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb06('0xb'));var jsforce=require(_0xbb06('0xc'));var deskjs=require(_0xbb06('0xd'));var toCsv=require(_0xbb06('0x8'));var querystring=require(_0xbb06('0xe'));var Papa=require(_0xbb06('0xf'));var Redis=require(_0xbb06('0x10'));var authService=require(_0xbb06('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbb06('0x12'));var hardwareService=require(_0xbb06('0x13'));var logger=require(_0xbb06('0x14'))(_0xbb06('0x15'));var utils=require(_0xbb06('0x16'));var config=require(_0xbb06('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb06('0x18'))['db'];var integrations=require(_0xbb06('0x19'));function respondWithStatusCode(_0x4bdad8,_0x2d07dc){_0x2d07dc=_0x2d07dc||0xcc;return function(_0x334ae3){if(_0x334ae3){return _0x4bdad8[_0xbb06('0x1a')](_0x2d07dc);}return _0x4bdad8[_0xbb06('0x1b')](_0x2d07dc)[_0xbb06('0x1c')]();};}function respondWithResult(_0x544212,_0x5c4549){_0x5c4549=_0x5c4549||0xc8;return function(_0x65aad8){if(_0x65aad8){return _0x544212[_0xbb06('0x1b')](_0x5c4549)[_0xbb06('0x1d')](_0x65aad8);}};}function respondWithFilteredResult(_0x290c01,_0x2b8ba4){return function(_0x3ed383){if(_0x3ed383){var _0x5682c8=typeof _0x2b8ba4[_0xbb06('0x1e')]===_0xbb06('0x1f')&&typeof _0x2b8ba4[_0xbb06('0x20')]==='undefined';var _0x7e7c03=_0x3ed383[_0xbb06('0x21')];var _0x3d3ca2=_0x5682c8?0x0:_0x2b8ba4['offset'];var _0x232998=_0x5682c8?_0x3ed383[_0xbb06('0x21')]:_0x2b8ba4['offset']+_0x2b8ba4[_0xbb06('0x20')];var _0x551b22;if(_0x232998>=_0x7e7c03){_0x232998=_0x7e7c03;_0x551b22=0xc8;}else{_0x551b22=0xce;}_0x290c01['status'](_0x551b22);return _0x290c01[_0xbb06('0x22')](_0xbb06('0x23'),_0x3d3ca2+'-'+_0x232998+'/'+_0x7e7c03)[_0xbb06('0x1d')](_0x3ed383);}return null;};}function patchUpdates(_0x3c4886){return function(_0x4ec2ec){try{jsonpatch[_0xbb06('0x24')](_0x4ec2ec,_0x3c4886,!![]);}catch(_0x1d349f){return BPromise['reject'](_0x1d349f);}return _0x4ec2ec[_0xbb06('0x25')]();};}function saveUpdates(_0x2f4970,_0x2bc230){return function(_0x2c20da){if(_0x2c20da){return _0x2c20da['update'](_0x2f4970)['then'](function(_0x4f5044){return _0x4f5044;});}return null;};}function removeEntity(_0x565a15,_0x518dc2){return function(_0xa49b49){if(_0xa49b49){return _0xa49b49[_0xbb06('0x26')]()[_0xbb06('0x27')](function(){_0x565a15[_0xbb06('0x1b')](0xcc)[_0xbb06('0x1c')]();});}};}function handleEntityNotFound(_0x4c7268,_0x46f463){return function(_0xbd7068){if(!_0xbd7068){_0x4c7268[_0xbb06('0x1a')](0x194);}return _0xbd7068;};}function handleError(_0x1cb995,_0x398e54){_0x398e54=_0x398e54||0x1f4;return function(_0x393cf5){logger[_0xbb06('0x28')](_0x393cf5[_0xbb06('0x29')]);if(_0x393cf5[_0xbb06('0x2a')]){delete _0x393cf5[_0xbb06('0x2a')];}_0x1cb995[_0xbb06('0x1b')](_0x398e54)[_0xbb06('0x2b')](_0x393cf5);};}exports[_0xbb06('0x2c')]=function(_0x187110,_0xdad5f7){var _0x5ac8ac={},_0x426011={},_0x3023df={'count':0x0,'rows':[]};var _0x4c4600=_[_0xbb06('0x2d')](db[_0xbb06('0x2e')][_0xbb06('0x2f')],function(_0x408470){return{'name':_0x408470['fieldName'],'type':_0x408470[_0xbb06('0x30')][_0xbb06('0x31')]};});_0x426011[_0xbb06('0x32')]=_[_0xbb06('0x2d')](_0x4c4600,_0xbb06('0x2a'));_0x426011[_0xbb06('0x33')]=_[_0xbb06('0x34')](_0x187110['query']);_0x426011[_0xbb06('0x35')]=_['intersection'](_0x426011[_0xbb06('0x32')],_0x426011[_0xbb06('0x33')]);_0x5ac8ac[_0xbb06('0x36')]=_[_0xbb06('0x37')](_0x426011[_0xbb06('0x32')],qs['fields'](_0x187110[_0xbb06('0x33')]['fields']));_0x5ac8ac['attributes']=_0x5ac8ac[_0xbb06('0x36')][_0xbb06('0x38')]?_0x5ac8ac[_0xbb06('0x36')]:_0x426011[_0xbb06('0x32')];if(!_0x187110[_0xbb06('0x33')]['hasOwnProperty'](_0xbb06('0x39'))){_0x5ac8ac[_0xbb06('0x20')]=qs[_0xbb06('0x20')](_0x187110['query'][_0xbb06('0x20')]);_0x5ac8ac[_0xbb06('0x1e')]=qs['offset'](_0x187110[_0xbb06('0x33')]['offset']);}_0x5ac8ac['order']=qs[_0xbb06('0x3a')](_0x187110[_0xbb06('0x33')][_0xbb06('0x3a')]);_0x5ac8ac[_0xbb06('0x3b')]=qs[_0xbb06('0x35')](_[_0xbb06('0x3c')](_0x187110[_0xbb06('0x33')],_0x426011[_0xbb06('0x35')]),_0x4c4600);if(_0x187110[_0xbb06('0x33')][_0xbb06('0x3d')]){_0x5ac8ac[_0xbb06('0x3b')]=_[_0xbb06('0x3e')](_0x5ac8ac[_0xbb06('0x3b')],{'$or':_[_0xbb06('0x2d')](_0x4c4600,function(_0x382023){if(_0x382023['type']!==_0xbb06('0x3f')){var _0x1aabae={};_0x1aabae[_0x382023[_0xbb06('0x2a')]]={'$like':'%'+_0x187110[_0xbb06('0x33')]['filter']+'%'};return _0x1aabae;}})});}_0x5ac8ac=_[_0xbb06('0x3e')]({},_0x5ac8ac,_0x187110[_0xbb06('0x40')]);var _0x437521={'where':_0x5ac8ac[_0xbb06('0x3b')]};return db[_0xbb06('0x2e')]['count'](_0x437521)['then'](function(_0x2c58c2){_0x3023df[_0xbb06('0x21')]=_0x2c58c2;if(_0x187110[_0xbb06('0x33')][_0xbb06('0x41')]){_0x5ac8ac[_0xbb06('0x42')]=[{'all':!![]}];}return db[_0xbb06('0x2e')]['findAll'](_0x5ac8ac);})[_0xbb06('0x27')](function(_0x235f59){_0x3023df['rows']=_0x235f59;return _0x3023df;})[_0xbb06('0x27')](respondWithFilteredResult(_0xdad5f7,_0x5ac8ac))['catch'](handleError(_0xdad5f7,null));};exports[_0xbb06('0x43')]=function(_0xbc2323,_0x3d0108){var _0x49eeb1={'raw':![],'where':{'id':_0xbc2323[_0xbb06('0x44')]['id']}},_0x3ce2f5={};_0x3ce2f5['model']=_[_0xbb06('0x34')](db[_0xbb06('0x2e')][_0xbb06('0x2f')]);_0x3ce2f5[_0xbb06('0x33')]=_[_0xbb06('0x34')](_0xbc2323[_0xbb06('0x33')]);_0x3ce2f5['filters']=_[_0xbb06('0x37')](_0x3ce2f5[_0xbb06('0x32')],_0x3ce2f5['query']);_0x49eeb1[_0xbb06('0x36')]=_[_0xbb06('0x37')](_0x3ce2f5[_0xbb06('0x32')],qs[_0xbb06('0x45')](_0xbc2323[_0xbb06('0x33')][_0xbb06('0x45')]));_0x49eeb1[_0xbb06('0x36')]=_0x49eeb1['attributes'][_0xbb06('0x38')]?_0x49eeb1[_0xbb06('0x36')]:_0x3ce2f5[_0xbb06('0x32')];if(_0xbc2323[_0xbb06('0x33')][_0xbb06('0x41')]){_0x49eeb1['include']=[{'all':!![]}];}_0x49eeb1=_['merge']({},_0x49eeb1,_0xbc2323[_0xbb06('0x40')]);return db[_0xbb06('0x2e')][_0xbb06('0x46')](_0x49eeb1)[_0xbb06('0x27')](handleEntityNotFound(_0x3d0108,null))['then'](respondWithResult(_0x3d0108,null))[_0xbb06('0x47')](handleError(_0x3d0108,null));};exports[_0xbb06('0x48')]=function(_0x101971,_0x413495){return db['ZohoAccount'][_0xbb06('0x48')](_0x101971[_0xbb06('0x49')],{})[_0xbb06('0x27')](respondWithResult(_0x413495,0xc9))[_0xbb06('0x47')](handleError(_0x413495,null));};exports[_0xbb06('0x4a')]=function(_0x525508,_0x3bf482){if(_0x525508[_0xbb06('0x49')]['id']){delete _0x525508[_0xbb06('0x49')]['id'];}return db['ZohoAccount'][_0xbb06('0x46')]({'where':{'id':_0x525508[_0xbb06('0x44')]['id']}})[_0xbb06('0x27')](handleEntityNotFound(_0x3bf482,null))[_0xbb06('0x27')](saveUpdates(_0x525508['body'],null))[_0xbb06('0x27')](respondWithResult(_0x3bf482,null))['catch'](handleError(_0x3bf482,null));};exports['destroy']=function(_0x165ff2,_0xf78272){return db[_0xbb06('0x2e')]['find']({'where':{'id':_0x165ff2[_0xbb06('0x44')]['id']}})[_0xbb06('0x27')](handleEntityNotFound(_0xf78272,null))['then'](removeEntity(_0xf78272,null))[_0xbb06('0x47')](handleError(_0xf78272,null));};exports[_0xbb06('0x4b')]=function(_0x263b84,_0x415ada,_0x198f2e){var _0x48e797={};var _0x126d6f={};var _0x51a3d8;var _0x47e87f;return db[_0xbb06('0x2e')][_0xbb06('0x4c')]({'where':{'id':_0x263b84['params']['id']}})['then'](handleEntityNotFound(_0x415ada,null))['then'](function(_0x24238b){if(_0x24238b){_0x51a3d8=_0x24238b;_0x126d6f[_0xbb06('0x32')]=_[_0xbb06('0x34')](db[_0xbb06('0x4d')][_0xbb06('0x2f')]);_0x126d6f[_0xbb06('0x33')]=_[_0xbb06('0x34')](_0x263b84['query']);_0x126d6f[_0xbb06('0x35')]=_[_0xbb06('0x37')](_0x126d6f[_0xbb06('0x32')],_0x126d6f['query']);_0x48e797['attributes']=_[_0xbb06('0x37')](_0x126d6f['model'],qs[_0xbb06('0x45')](_0x263b84['query'][_0xbb06('0x45')]));_0x48e797[_0xbb06('0x36')]=_0x48e797[_0xbb06('0x36')][_0xbb06('0x38')]?_0x48e797['attributes']:_0x126d6f[_0xbb06('0x32')];_0x48e797[_0xbb06('0x4e')]=qs[_0xbb06('0x3a')](_0x263b84['query'][_0xbb06('0x3a')]);_0x48e797[_0xbb06('0x3b')]=qs[_0xbb06('0x35')](_[_0xbb06('0x3c')](_0x263b84['query'],_0x126d6f[_0xbb06('0x35')]));if(_0x263b84[_0xbb06('0x33')]['filter']){_0x48e797['where']=_[_0xbb06('0x3e')](_0x48e797[_0xbb06('0x3b')],{'$or':_[_0xbb06('0x2d')](_0x48e797[_0xbb06('0x36')],function(_0x150691){var _0x1cc9f7={};_0x1cc9f7[_0x150691]={'$like':'%'+_0x263b84[_0xbb06('0x33')]['filter']+'%'};return _0x1cc9f7;})});}_0x48e797=_[_0xbb06('0x3e')]({},_0x48e797,_0x263b84['options']);return _0x51a3d8[_0xbb06('0x4b')](_0x48e797);}})[_0xbb06('0x27')](function(_0x5b1b18){if(_0x5b1b18){_0x47e87f=_0x5b1b18['length'];if(!_0x263b84['query']['hasOwnProperty']('nolimit')){_0x48e797[_0xbb06('0x20')]=qs[_0xbb06('0x20')](_0x263b84[_0xbb06('0x33')][_0xbb06('0x20')]);_0x48e797[_0xbb06('0x1e')]=qs[_0xbb06('0x1e')](_0x263b84['query'][_0xbb06('0x1e')]);}return _0x51a3d8['getConfigurations'](_0x48e797);}})[_0xbb06('0x27')](function(_0x2c9db2){if(_0x2c9db2){return _0x2c9db2?{'count':_0x47e87f,'rows':_0x2c9db2}:null;}})['then'](respondWithResult(_0x415ada,null))['catch'](handleError(_0x415ada,null));};exports[_0xbb06('0x4f')]=function(_0x5db8fb,_0x58b21d,_0x152ac2){if(_0x5db8fb[_0xbb06('0x49')]['id']){delete _0x5db8fb[_0xbb06('0x49')]['id'];}return db[_0xbb06('0x2e')][_0xbb06('0x4c')]({'where':{'id':_0x5db8fb[_0xbb06('0x44')]['id']}})[_0xbb06('0x27')](handleEntityNotFound(_0x58b21d,null))[_0xbb06('0x27')](function(_0x3b9b3d){if(_0x3b9b3d){_0x5db8fb[_0xbb06('0x49')]['AccountId']=_0x3b9b3d['id'];_0x5db8fb[_0xbb06('0x49')][_0xbb06('0x50')]=integrations[_0xbb06('0x51')](_0x5db8fb['body'][_0xbb06('0x52')],_0x5db8fb[_0xbb06('0x49')]['type']);_0x5db8fb['body'][_0xbb06('0x53')]=integrations[_0xbb06('0x54')](_0x5db8fb[_0xbb06('0x49')][_0xbb06('0x52')],_0x5db8fb['body']['type']);return db[_0xbb06('0x4d')]['create'](_0x5db8fb[_0xbb06('0x49')],{'include':[{'model':db[_0xbb06('0x55')],'as':_0xbb06('0x50')},{'model':db[_0xbb06('0x55')],'as':'Descriptions'}]});}return null;})[_0xbb06('0x27')](respondWithResult(_0x58b21d,null))[_0xbb06('0x47')](handleError(_0x58b21d,null));};function getAccessToken(_0x4beeff){return new Promise(function(_0x52a5b9,_0x2df27c){var _0x3d9ea2;switch(_0x4beeff[_0xbb06('0x56')]){case'US':_0x3d9ea2=_0xbb06('0x57');break;case'AU':_0x3d9ea2=_0xbb06('0x58');break;case'EU':_0x3d9ea2=_0xbb06('0x59');break;case'IN':_0x3d9ea2=_0xbb06('0x5a');break;case'CN':_0x3d9ea2=_0xbb06('0x5b');break;default:_0x3d9ea2=_0xbb06('0x59');break;}var _0x58d753={'method':_0xbb06('0x5c'),'uri':_0x3d9ea2+_0xbb06('0x5d'),'qs':{'refresh_token':_0x4beeff[_0xbb06('0x5e')],'client_id':_0x4beeff[_0xbb06('0x5f')],'client_secret':_0x4beeff[_0xbb06('0x60')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x58d753)[_0xbb06('0x27')](function(_0x5118cd){if(_0x5118cd[_0xbb06('0x61')]){_0x52a5b9(_0x5118cd[_0xbb06('0x61')]);}else{_0x2df27c(_0xbb06('0x62'));}})['catch'](function(_0x59dfaa){_0x2df27c(_0x59dfaa);});});}exports[_0xbb06('0x63')]=function(_0xa0ce15,_0x29249e,_0x12574a){var _0x4937ae,_0x9eae47,_0x44c174,_0x17e2ee,_0x220d53;return db[_0xbb06('0x2e')][_0xbb06('0x4c')]({'where':{'id':_0xa0ce15['params']['id']},'attributes':['id',_0xbb06('0x64'),_0xbb06('0x56'),_0xbb06('0x5f'),'clientSecret',_0xbb06('0x65'),_0xbb06('0x66'),_0xbb06('0x5e')]})[_0xbb06('0x27')](handleEntityNotFound(_0x29249e,null))[_0xbb06('0x27')](function(_0x5fbf5){_0x220d53=_0x5fbf5;_0x4937ae=_0x220d53[_0xbb06('0x64')];_0x9eae47=_0x4937ae===_0xbb06('0x67')?'eu':'com';_0x44c174=_0x220d53[_0xbb06('0x65')];var _0x9281d=_0x44c174[_0xbb06('0x68')](-0x1);if(_0x9281d==='/'||_0x9281d==='\x5c'||_0x9281d===':'){_0x44c174=_0x44c174[_0xbb06('0x69')](0x0,_0x44c174['lastIndexOf'](_0x9281d));}if(!_0x220d53[_0xbb06('0x5e')]){throw new Error(_0xbb06('0x6a'));}return getAccessToken(_0x220d53);})[_0xbb06('0x27')](function(_0x98772){if(_0x98772){return rp({'method':_0xbb06('0x6b'),'uri':util[_0xbb06('0x6c')](_0xbb06('0x6d'),_0x9eae47),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x98772},'json':!![]});}})[_0xbb06('0x27')](function(_0x12ccd3){if(_0x12ccd3){if(_0x12ccd3['response']&&_0x12ccd3['response'][_0xbb06('0x28')]){throw new Error(_0x12ccd3[_0xbb06('0x6e')]['error']['message']);}var _0x406916=[];var _0x2b46f3=[];var _0x44c862=[_0xbb06('0x6f'),_0xbb06('0x70'),_0xbb06('0x71'),'WhoId',_0xbb06('0x72'),'Call_Result',_0xbb06('0x73'),_0xbb06('0x74')];_0x2b46f3=_[_0xbb06('0x75')](_0x12ccd3[_0xbb06('0x45')],function(_0x3cacec){return _0x44c862[_0xbb06('0x76')](_0x3cacec['api_name']);});for(var _0x15ebca=0x0;_0x15ebca<_0x2b46f3[_0xbb06('0x38')];_0x15ebca++){if(_0x2b46f3[_0x15ebca][_0xbb06('0x77')]===![]){_0x406916[_0xbb06('0x78')]({'id':_0x2b46f3[_0x15ebca]['id'],'name':_0x2b46f3[_0x15ebca][_0xbb06('0x79')],'custom':_0x2b46f3[_0x15ebca][_0xbb06('0x7a')],'options':_0x2b46f3[_0x15ebca][_0xbb06('0x7b')]===_0xbb06('0x7c')&&_0x2b46f3[_0x15ebca][_0xbb06('0x7d')]['length']>-0x1?_[_0xbb06('0x2d')](_0x2b46f3[_0x15ebca][_0xbb06('0x7d')],function(_0x507637){return{'name':_0x507637,'value':_0x507637};}):[]});}}return{'count':_0x406916[_0xbb06('0x38')],'rows':_0x406916};}else{return{'count':0x0,'rows':[]};}})[_0xbb06('0x27')](respondWithResult(_0x29249e,null))[_0xbb06('0x47')](function(_0x1769cd){var _0x4dc282=_0xa0ce15[_0xbb06('0x33')][_0xbb06('0x7e')]?0x1f4:_0x1769cd['statusCode']||0x1f4;logger[_0xbb06('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4dc282,JSON[_0xbb06('0x7f')](_0x1769cd));delete _0x1769cd['name'];if(_0x4dc282===0x191){_0x4dc282=0x190;}_0x29249e[_0xbb06('0x1b')](_0x4dc282)['send'](_0xa0ce15[_0xbb06('0x33')][_0xbb06('0x7e')]?{'message':_0xbb06('0x80'),'statusCode':_0x1769cd['statusCode']}:_0x1769cd);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index d91de48..97086f2 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 _0x0ce5=['./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','clientId','then','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','host','https://accounts.zoho.com','https://accounts.zoho.eu','/oauth/v2/token','application/x-www-form-urlencoded','parse','refreshToken','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x35f6b4,_0x505966){var _0x10f072=function(_0x20e563){while(--_0x20e563){_0x35f6b4['push'](_0x35f6b4['shift']());}};_0x10f072(++_0x505966);}(_0x0ce5,0x79));var _0x50ce=function(_0x4f6610,_0x11d9ae){_0x4f6610=_0x4f6610-0x0;var _0x44e7d3=_0x0ce5[_0x4f6610];return _0x44e7d3;};'use strict';var _=require(_0x50ce('0x0'));var util=require('util');var logger=require(_0x50ce('0x1'))(_0x50ce('0x2'));var moment=require('moment');var BPromise=require(_0x50ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50ce('0x4'));var config=require('../../config/environment');var attributes=require(_0x50ce('0x5'));var integrations=require(_0x50ce('0x6'));module[_0x50ce('0x7')]=function(_0x39c876,_0x56a392){return _0x39c876[_0x50ce('0x8')](_0x50ce('0x9'),attributes,{'tableName':_0x50ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x214a07,_0x17ba1d,_0x1837d9){if(_0x214a07[_0x50ce('0xb')]('zone')||_0x214a07[_0x50ce('0xb')](_0x50ce('0xc'))||_0x214a07[_0x50ce('0xb')]('clientId')||_0x214a07[_0x50ce('0xb')](_0x50ce('0xd'))||_0x214a07[_0x50ce('0xb')](_0x50ce('0xe'))||_0x214a07[_0x50ce('0xb')]('host')){var _0x1f9d60,_0x37eab4;_0x1f9d60=_0x214a07[_0x50ce('0xc')];var _0x5ea215=_0x1f9d60[_0x50ce('0xf')](-0x1);if(_0x5ea215==='/'||_0x5ea215==='\x5c'||_0x5ea215===':'){_0x1f9d60=_0x1f9d60[_0x50ce('0x10')](0x0,_0x1f9d60[_0x50ce('0x11')](_0x5ea215));}switch(_0x214a07['zone']){case'US':_0x37eab4='https://accounts.zoho.com';break;case'AU':_0x37eab4=_0x50ce('0x12');break;case'IN':_0x37eab4=_0x50ce('0x13');break;case'CN':_0x37eab4=_0x50ce('0x14');break;default:_0x37eab4='https://accounts.zoho.eu';break;}var _0x364831={'method':_0x50ce('0x15'),'uri':_0x37eab4+'/oauth/v2/token','form':{'grant_type':_0x50ce('0x16'),'client_id':_0x214a07[_0x50ce('0x17')],'client_secret':_0x214a07[_0x50ce('0xd')],'redirect_uri':_0x214a07[_0x50ce('0xc')],'code':_0x214a07[_0x50ce('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x364831)[_0x50ce('0x18')](function(_0x433720){var _0x37e617=JSON['parse'](_0x433720);if(_0x37e617[_0x50ce('0x19')]){_0x214a07['refreshToken']=_0x37e617['refresh_token'];logger[_0x50ce('0x1a')](util[_0x50ce('0x1b')](_0x50ce('0x1c'),_0x214a07[_0x50ce('0x1d')],_0x214a07['id']));}else{logger[_0x50ce('0x1e')](util[_0x50ce('0x1b')](_0x50ce('0x1f'),_0x214a07[_0x50ce('0x1d')],_0x214a07['id']),util[_0x50ce('0x20')](_0x37e617,{'showHidden':![],'depth':null}));}return _0x1837d9(null,_0x17ba1d);})[_0x50ce('0x21')](function(_0x5a099b){logger[_0x50ce('0x1e')](util[_0x50ce('0x1b')](_0x50ce('0x1f'),_0x214a07[_0x50ce('0x1d')],_0x214a07['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1837d9(_0x5a099b);});}else{return _0x1837d9(null,_0x17ba1d);}},'beforeUpdate':function(_0x4e982f,_0x513c64,_0x1b281d){if(_0x4e982f[_0x50ce('0xb')](_0x50ce('0x22'))||_0x4e982f['changed'](_0x50ce('0xc'))||_0x4e982f[_0x50ce('0xb')]('clientId')||_0x4e982f['changed']('clientSecret')||_0x4e982f[_0x50ce('0xb')]('code')||_0x4e982f['changed'](_0x50ce('0x23'))){var _0x457490,_0xa326a3;_0x457490=_0x4e982f[_0x50ce('0xc')];var _0x5062d6=_0x457490[_0x50ce('0xf')](-0x1);if(_0x5062d6==='/'||_0x5062d6==='\x5c'||_0x5062d6===':'){_0x457490=_0x457490[_0x50ce('0x10')](0x0,_0x457490[_0x50ce('0x11')](_0x5062d6));}switch(_0x4e982f['zone']){case'US':_0xa326a3=_0x50ce('0x24');break;case'AU':_0xa326a3=_0x50ce('0x12');break;case'IN':_0xa326a3=_0x50ce('0x13');break;case'CN':_0xa326a3=_0x50ce('0x14');break;default:_0xa326a3=_0x50ce('0x25');break;}var _0x2d21de={'method':_0x50ce('0x15'),'uri':_0xa326a3+_0x50ce('0x26'),'form':{'grant_type':_0x50ce('0x16'),'client_id':_0x4e982f['clientId'],'client_secret':_0x4e982f[_0x50ce('0xd')],'redirect_uri':_0x4e982f[_0x50ce('0xc')],'code':_0x4e982f[_0x50ce('0xe')]},'headers':{'Content-Type':_0x50ce('0x27')}};return rp(_0x2d21de)['then'](function(_0x45ac7f){var _0x110d5b=JSON[_0x50ce('0x28')](_0x45ac7f);if(_0x110d5b[_0x50ce('0x19')]){_0x4e982f[_0x50ce('0x29')]=_0x110d5b['refresh_token'];logger[_0x50ce('0x1a')](util[_0x50ce('0x1b')](_0x50ce('0x1c'),_0x4e982f[_0x50ce('0x1d')],_0x4e982f['id']));}else{logger[_0x50ce('0x1e')](util[_0x50ce('0x1b')](_0x50ce('0x1f'),_0x4e982f[_0x50ce('0x1d')],_0x4e982f['id']),util[_0x50ce('0x20')](_0x110d5b,{'showHidden':![],'depth':null}));}return _0x1b281d(null,_0x513c64);})[_0x50ce('0x21')](function(_0x4167fc){logger['error'](util[_0x50ce('0x1b')](_0x50ce('0x1f'),_0x4e982f[_0x50ce('0x1d')],_0x4e982f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1b281d(_0x4167fc);});}else{return _0x1b281d(null,_0x513c64);}}}});}; \ No newline at end of file +var _0xdc9f=['zone','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','clientId','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','application/x-www-form-urlencoded','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','changed'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xdc9f,0x9c));var _0xfdc9=function(_0x126c50,_0x451250){_0x126c50=_0x126c50-0x0;var _0x58554b=_0xdc9f[_0x126c50];return _0x58554b;};'use strict';var _=require(_0xfdc9('0x0'));var util=require(_0xfdc9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfdc9('0x2'));var rp=require(_0xfdc9('0x3'));var fs=require('fs');var path=require(_0xfdc9('0x4'));var rimraf=require(_0xfdc9('0x5'));var config=require(_0xfdc9('0x6'));var attributes=require(_0xfdc9('0x7'));var integrations=require(_0xfdc9('0x8'));module['exports']=function(_0x3bbaad,_0x7ae1c6){return _0x3bbaad[_0xfdc9('0x9')](_0xfdc9('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c74dd,_0xfd08e3,_0xb61fd1){if(_0x1c74dd[_0xfdc9('0xb')](_0xfdc9('0xc'))||_0x1c74dd[_0xfdc9('0xb')](_0xfdc9('0xd'))||_0x1c74dd[_0xfdc9('0xb')]('clientId')||_0x1c74dd['changed'](_0xfdc9('0xe'))||_0x1c74dd[_0xfdc9('0xb')](_0xfdc9('0xf'))||_0x1c74dd[_0xfdc9('0xb')](_0xfdc9('0x10'))){var _0xa688e7,_0x2680af;_0xa688e7=_0x1c74dd[_0xfdc9('0xd')];var _0x2ab34e=_0xa688e7[_0xfdc9('0x11')](-0x1);if(_0x2ab34e==='/'||_0x2ab34e==='\x5c'||_0x2ab34e===':'){_0xa688e7=_0xa688e7[_0xfdc9('0x12')](0x0,_0xa688e7[_0xfdc9('0x13')](_0x2ab34e));}switch(_0x1c74dd['zone']){case'US':_0x2680af=_0xfdc9('0x14');break;case'AU':_0x2680af='https://accounts.zoho.com.au';break;case'IN':_0x2680af=_0xfdc9('0x15');break;case'CN':_0x2680af=_0xfdc9('0x16');break;default:_0x2680af='https://accounts.zoho.eu';break;}var _0x40f043={'method':'POST','uri':_0x2680af+_0xfdc9('0x17'),'form':{'grant_type':_0xfdc9('0x18'),'client_id':_0x1c74dd[_0xfdc9('0x19')],'client_secret':_0x1c74dd[_0xfdc9('0xe')],'redirect_uri':_0x1c74dd['serverUrl'],'code':_0x1c74dd['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x40f043)[_0xfdc9('0x1a')](function(_0x41e342){var _0x3908cd=JSON[_0xfdc9('0x1b')](_0x41e342);if(_0x3908cd[_0xfdc9('0x1c')]){_0x1c74dd[_0xfdc9('0x1d')]=_0x3908cd[_0xfdc9('0x1c')];logger[_0xfdc9('0x1e')](util[_0xfdc9('0x1f')](_0xfdc9('0x20'),_0x1c74dd[_0xfdc9('0x21')],_0x1c74dd['id']));}else{logger[_0xfdc9('0x22')](util[_0xfdc9('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1c74dd[_0xfdc9('0x21')],_0x1c74dd['id']),util[_0xfdc9('0x23')](_0x3908cd,{'showHidden':![],'depth':null}));}return _0xb61fd1(null,_0xfd08e3);})[_0xfdc9('0x24')](function(_0x243e0c){logger[_0xfdc9('0x22')](util[_0xfdc9('0x1f')](_0xfdc9('0x25'),_0x1c74dd['name'],_0x1c74dd['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xb61fd1(_0x243e0c);});}else{return _0xb61fd1(null,_0xfd08e3);}},'beforeUpdate':function(_0x4a879e,_0x360472,_0x565f49){if(_0x4a879e[_0xfdc9('0xb')](_0xfdc9('0xc'))||_0x4a879e[_0xfdc9('0xb')](_0xfdc9('0xd'))||_0x4a879e[_0xfdc9('0xb')]('clientId')||_0x4a879e[_0xfdc9('0xb')]('clientSecret')||_0x4a879e[_0xfdc9('0xb')](_0xfdc9('0xf'))||_0x4a879e[_0xfdc9('0xb')]('host')){var _0x462267,_0x379fc1;_0x462267=_0x4a879e[_0xfdc9('0xd')];var _0x189851=_0x462267[_0xfdc9('0x11')](-0x1);if(_0x189851==='/'||_0x189851==='\x5c'||_0x189851===':'){_0x462267=_0x462267[_0xfdc9('0x12')](0x0,_0x462267['lastIndexOf'](_0x189851));}switch(_0x4a879e[_0xfdc9('0xc')]){case'US':_0x379fc1=_0xfdc9('0x14');break;case'AU':_0x379fc1=_0xfdc9('0x26');break;case'IN':_0x379fc1=_0xfdc9('0x15');break;case'CN':_0x379fc1='https://accounts.zoho.com.cn';break;default:_0x379fc1=_0xfdc9('0x27');break;}var _0x504921={'method':_0xfdc9('0x28'),'uri':_0x379fc1+_0xfdc9('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x4a879e[_0xfdc9('0x19')],'client_secret':_0x4a879e[_0xfdc9('0xe')],'redirect_uri':_0x4a879e[_0xfdc9('0xd')],'code':_0x4a879e[_0xfdc9('0xf')]},'headers':{'Content-Type':_0xfdc9('0x29')}};return rp(_0x504921)[_0xfdc9('0x1a')](function(_0x578953){var _0x3cb754=JSON[_0xfdc9('0x1b')](_0x578953);if(_0x3cb754[_0xfdc9('0x1c')]){_0x4a879e[_0xfdc9('0x1d')]=_0x3cb754[_0xfdc9('0x1c')];logger[_0xfdc9('0x1e')](util[_0xfdc9('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4a879e['name'],_0x4a879e['id']));}else{logger[_0xfdc9('0x22')](util[_0xfdc9('0x1f')](_0xfdc9('0x25'),_0x4a879e[_0xfdc9('0x21')],_0x4a879e['id']),util[_0xfdc9('0x23')](_0x3cb754,{'showHidden':![],'depth':null}));}return _0x565f49(null,_0x360472);})['catch'](function(_0x47ef5d){logger[_0xfdc9('0x22')](util[_0xfdc9('0x1f')](_0xfdc9('0x25'),_0x4a879e['name'],_0x4a879e['id']),util[_0xfdc9('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x565f49(_0x47ef5d);});}else{return _0x565f49(null,_0x360472);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 52ae8f2..bcd7024 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 _0x762e=['raw','then','stringify','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZohoAccount','options','where','attributes','limit','include','model','map','ShowZohoAccount','ZohoAccount','find'];(function(_0x461f4e,_0x1aaa52){var _0x134807=function(_0x430881){while(--_0x430881){_0x461f4e['push'](_0x461f4e['shift']());}};_0x134807(++_0x1aaa52);}(_0x762e,0xea));var _0xe762=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0x762e[_0x26e0d9];return _0x3ed4bb;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe762('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe762('0x2'))['db'];var utils=require(_0xe762('0x3'));var logger=require(_0xe762('0x4'))('rpc');var config=require(_0xe762('0x5'));var jayson=require(_0xe762('0x6'));var client=jayson[_0xe762('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4726,_0x7a1740,_0x2511ad){return new BPromise(function(_0xf20548,_0x26a4fc){return client[_0xe762('0x8')](_0x1f4726,_0x2511ad)['then'](function(_0x50dd96){logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));logger[_0xe762('0xc')](_0xe762('0xd'),_0x7a1740,_0xe762('0xb'),JSON['stringify'](_0x50dd96));if(_0x50dd96[_0xe762('0xe')]){if(_0x50dd96[_0xe762('0xe')][_0xe762('0xf')]===0x1f4){logger['error'](_0xe762('0xa'),_0x7a1740,_0x50dd96['error'][_0xe762('0x10')]);return _0x26a4fc(_0x50dd96['error'][_0xe762('0x10')]);}logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x50dd96['error']['message']);return _0xf20548(_0x50dd96[_0xe762('0xe')][_0xe762('0x10')]);}else{logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));_0xf20548(_0x50dd96[_0xe762('0x11')][_0xe762('0x10')]);}})[_0xe762('0x12')](function(_0x531587){logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x531587);_0x26a4fc(_0x531587);});});}exports[_0xe762('0x13')]=function(_0x27c2cf){var _0x57850f=this;return new Promise(function(_0xd2cb26,_0x157de2){return db['ZohoAccount']['findAll']({'raw':_0x27c2cf['options']?_0x27c2cf[_0xe762('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x27c2cf[_0xe762('0x14')]?_0x27c2cf['options'][_0xe762('0x15')]||null:null,'attributes':_0x27c2cf['options']?_0x27c2cf[_0xe762('0x14')][_0xe762('0x16')]||null:null,'limit':_0x27c2cf[_0xe762('0x14')]?_0x27c2cf[_0xe762('0x14')][_0xe762('0x17')]||null:null,'include':_0x27c2cf['options']?_0x27c2cf['options']['include']?_['map'](_0x27c2cf[_0xe762('0x14')][_0xe762('0x18')],function(_0x31ac1a){return{'model':db[_0x31ac1a[_0xe762('0x19')]],'as':_0x31ac1a['as'],'attributes':_0x31ac1a[_0xe762('0x16')],'include':_0x31ac1a['include']?_[_0xe762('0x1a')](_0x31ac1a[_0xe762('0x18')],function(_0x407d1e){return{'model':db[_0x407d1e[_0xe762('0x19')]],'as':_0x407d1e['as'],'attributes':_0x407d1e[_0xe762('0x16')],'include':_0x407d1e[_0xe762('0x18')]?_[_0xe762('0x1a')](_0x407d1e[_0xe762('0x18')],function(_0xc05eb8){return{'model':db[_0xc05eb8[_0xe762('0x19')]],'as':_0xc05eb8['as'],'attributes':_0xc05eb8[_0xe762('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bfe46){logger[_0xe762('0x9')]('GetZohoAccount',_0x27c2cf);logger[_0xe762('0xc')](_0xe762('0x13'),_0x27c2cf,JSON['stringify'](_0x5bfe46));_0xd2cb26(_0x5bfe46);})[_0xe762('0x12')](function(_0xa39b64){logger[_0xe762('0xe')](_0xe762('0x13'),_0xa39b64[_0xe762('0x10')],_0x27c2cf);_0x157de2(_0x57850f[_0xe762('0xe')](0x1f4,_0xa39b64[_0xe762('0x10')]));});});};exports[_0xe762('0x1b')]=function(_0x26dbd3){var _0x79604b=this;return new Promise(function(_0x5f135b,_0x3bf093){return db[_0xe762('0x1c')][_0xe762('0x1d')]({'raw':_0x26dbd3[_0xe762('0x14')]?_0x26dbd3[_0xe762('0x14')][_0xe762('0x1e')]===undefined?!![]:![]:!![],'where':_0x26dbd3[_0xe762('0x14')]?_0x26dbd3[_0xe762('0x14')]['where']||null:null,'attributes':_0x26dbd3['options']?_0x26dbd3[_0xe762('0x14')][_0xe762('0x16')]||null:null,'include':_0x26dbd3[_0xe762('0x14')]?_0x26dbd3[_0xe762('0x14')][_0xe762('0x18')]?_[_0xe762('0x1a')](_0x26dbd3[_0xe762('0x14')]['include'],function(_0x40eedf){return{'model':db[_0x40eedf[_0xe762('0x19')]],'as':_0x40eedf['as'],'attributes':_0x40eedf[_0xe762('0x16')],'include':_0x40eedf['include']?_[_0xe762('0x1a')](_0x40eedf[_0xe762('0x18')],function(_0x249d01){return{'model':db[_0x249d01[_0xe762('0x19')]],'as':_0x249d01['as'],'attributes':_0x249d01[_0xe762('0x16')],'include':_0x249d01[_0xe762('0x18')]?_[_0xe762('0x1a')](_0x249d01[_0xe762('0x18')],function(_0x37cc8b){return{'model':db[_0x37cc8b[_0xe762('0x19')]],'as':_0x37cc8b['as'],'attributes':_0x37cc8b['attributes']};}):[]};}):[]};}):[]:[]})[_0xe762('0x1f')](function(_0x25ec08){logger[_0xe762('0x9')](_0xe762('0x1b'),_0x26dbd3);logger[_0xe762('0xc')](_0xe762('0x1b'),_0x26dbd3,JSON[_0xe762('0x20')](_0x25ec08));_0x5f135b(_0x25ec08);})[_0xe762('0x12')](function(_0x3e17d9){logger[_0xe762('0xe')](_0xe762('0x1b'),_0x3e17d9[_0xe762('0x10')],_0x26dbd3);_0x3bf093(_0x79604b[_0xe762('0xe')](0x1f4,_0x3e17d9[_0xe762('0x10')]));});});}; \ No newline at end of file +var _0x1b0e=['error','code','message','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','include','model','map','stringify','ZohoAccount','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s'];(function(_0x21f614,_0x3d2c98){var _0x3bb653=function(_0xe2739d){while(--_0xe2739d){_0x21f614['push'](_0x21f614['shift']());}};_0x3bb653(++_0x3d2c98);}(_0x1b0e,0x132));var _0xe1b0=function(_0x36e816,_0x5aad12){_0x36e816=_0x36e816-0x0;var _0x3ea513=_0x1b0e[_0x36e816];return _0x3ea513;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});}exports[_0xe1b0('0x17')]=function(_0x2928b6){var _0x349f90=this;return new Promise(function(_0x5c195f,_0x5b300e){return db['ZohoAccount'][_0xe1b0('0x18')]({'raw':_0x2928b6['options']?_0x2928b6[_0xe1b0('0x19')][_0xe1b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6['options'][_0xe1b0('0x1b')]||null:null,'attributes':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6['options'][_0xe1b0('0x1c')]||null:null,'limit':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6[_0xe1b0('0x19')]['limit']||null:null,'include':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6['options']['include']?_['map'](_0x2928b6['options'][_0xe1b0('0x1d')],function(_0x4a387d){return{'model':db[_0x4a387d[_0xe1b0('0x1e')]],'as':_0x4a387d['as'],'attributes':_0x4a387d[_0xe1b0('0x1c')],'include':_0x4a387d[_0xe1b0('0x1d')]?_['map'](_0x4a387d[_0xe1b0('0x1d')],function(_0x3ef159){return{'model':db[_0x3ef159['model']],'as':_0x3ef159['as'],'attributes':_0x3ef159[_0xe1b0('0x1c')],'include':_0x3ef159[_0xe1b0('0x1d')]?_[_0xe1b0('0x1f')](_0x3ef159[_0xe1b0('0x1d')],function(_0x11e4b2){return{'model':db[_0x11e4b2['model']],'as':_0x11e4b2['as'],'attributes':_0x11e4b2[_0xe1b0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe1b0('0xc')](function(_0x1a30d0){logger[_0xe1b0('0xd')](_0xe1b0('0x17'),_0x2928b6);logger[_0xe1b0('0x10')](_0xe1b0('0x17'),_0x2928b6,JSON[_0xe1b0('0x20')](_0x1a30d0));_0x5c195f(_0x1a30d0);})['catch'](function(_0x2f7b35){logger[_0xe1b0('0x12')]('GetZohoAccount',_0x2f7b35[_0xe1b0('0x14')],_0x2928b6);_0x5b300e(_0x349f90[_0xe1b0('0x12')](0x1f4,_0x2f7b35['message']));});});};exports['ShowZohoAccount']=function(_0x5cc8e3){var _0x9c4710=this;return new Promise(function(_0x3f2f25,_0xae9a36){return db[_0xe1b0('0x21')][_0xe1b0('0x22')]({'raw':_0x5cc8e3[_0xe1b0('0x19')]?_0x5cc8e3['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cc8e3[_0xe1b0('0x19')]?_0x5cc8e3[_0xe1b0('0x19')][_0xe1b0('0x1b')]||null:null,'attributes':_0x5cc8e3[_0xe1b0('0x19')]?_0x5cc8e3[_0xe1b0('0x19')][_0xe1b0('0x1c')]||null:null,'include':_0x5cc8e3[_0xe1b0('0x19')]?_0x5cc8e3[_0xe1b0('0x19')][_0xe1b0('0x1d')]?_[_0xe1b0('0x1f')](_0x5cc8e3['options']['include'],function(_0x58b897){return{'model':db[_0x58b897[_0xe1b0('0x1e')]],'as':_0x58b897['as'],'attributes':_0x58b897['attributes'],'include':_0x58b897[_0xe1b0('0x1d')]?_[_0xe1b0('0x1f')](_0x58b897[_0xe1b0('0x1d')],function(_0x3c414b){return{'model':db[_0x3c414b[_0xe1b0('0x1e')]],'as':_0x3c414b['as'],'attributes':_0x3c414b[_0xe1b0('0x1c')],'include':_0x3c414b[_0xe1b0('0x1d')]?_['map'](_0x3c414b['include'],function(_0x49df4d){return{'model':db[_0x49df4d[_0xe1b0('0x1e')]],'as':_0x49df4d['as'],'attributes':_0x49df4d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe1b0('0xc')](function(_0x518202){logger['info']('ShowZohoAccount',_0x5cc8e3);logger[_0xe1b0('0x10')](_0xe1b0('0x23'),_0x5cc8e3,JSON[_0xe1b0('0x20')](_0x518202));_0x3f2f25(_0x518202);})[_0xe1b0('0x16')](function(_0x15fd34){logger[_0xe1b0('0x12')]('ShowZohoAccount',_0x15fd34['message'],_0x5cc8e3);_0xae9a36(_0x9c4710[_0xe1b0('0x12')](0x1f4,_0x15fd34[_0xe1b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 39dc67e..6b8ada1 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 _0x6f8e=['./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d87ee,_0x5575e1){var _0x4badf9=function(_0x24a486){while(--_0x24a486){_0x5d87ee['push'](_0x5d87ee['shift']());}};_0x4badf9(++_0x5575e1);}(_0x6f8e,0xa8));var _0xe6f8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6f8e[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xe6f8('0x0'));var util=require(_0xe6f8('0x1'));var path=require(_0xe6f8('0x2'));var timeout=require(_0xe6f8('0x3'));var express=require('express');var router=express[_0xe6f8('0x4')]();var fs_extra=require(_0xe6f8('0x5'));var auth=require(_0xe6f8('0x6'));var interaction=require(_0xe6f8('0x7'));var config=require('../../config/environment');var controller=require(_0xe6f8('0x8'));router[_0xe6f8('0x9')]('/',auth[_0xe6f8('0xa')](),controller[_0xe6f8('0xb')]);router[_0xe6f8('0x9')](_0xe6f8('0xc'),auth[_0xe6f8('0xa')](),controller[_0xe6f8('0xd')]);router[_0xe6f8('0x9')](_0xe6f8('0xe'),auth[_0xe6f8('0xa')](),controller['getFields']);router[_0xe6f8('0x9')](_0xe6f8('0xf'),auth[_0xe6f8('0xa')](),controller[_0xe6f8('0x10')]);router['get']('/:id/descriptions',auth[_0xe6f8('0xa')](),controller['getDescriptions']);router[_0xe6f8('0x11')]('/',auth['isAuthenticated'](),controller[_0xe6f8('0x12')]);router[_0xe6f8('0x13')](_0xe6f8('0xc'),auth[_0xe6f8('0xa')](),controller['update']);router['delete']('/:id',auth[_0xe6f8('0xa')](),controller[_0xe6f8('0x14')]);module[_0xe6f8('0x15')]=router; \ No newline at end of file +var _0xa252=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x41038c,_0x15a130){var _0x4d12cb=function(_0x39a5cf){while(--_0x39a5cf){_0x41038c['push'](_0x41038c['shift']());}};_0x4d12cb(++_0x15a130);}(_0xa252,0x98));var _0x2a25=function(_0x300a99,_0x43720a){_0x300a99=_0x300a99-0x0;var _0x404150=_0xa252[_0x300a99];return _0x404150;};'use strict';var multer=require(_0x2a25('0x0'));var util=require(_0x2a25('0x1'));var path=require(_0x2a25('0x2'));var timeout=require(_0x2a25('0x3'));var express=require(_0x2a25('0x4'));var router=express[_0x2a25('0x5')]();var fs_extra=require(_0x2a25('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2a25('0x7'));var config=require(_0x2a25('0x8'));var controller=require('./intZohoConfiguration.controller');router[_0x2a25('0x9')]('/',auth[_0x2a25('0xa')](),controller[_0x2a25('0xb')]);router[_0x2a25('0x9')](_0x2a25('0xc'),auth[_0x2a25('0xa')](),controller[_0x2a25('0xd')]);router[_0x2a25('0x9')](_0x2a25('0xe'),auth[_0x2a25('0xa')](),controller[_0x2a25('0xf')]);router[_0x2a25('0x9')]('/:id/subjects',auth[_0x2a25('0xa')](),controller[_0x2a25('0x10')]);router[_0x2a25('0x9')](_0x2a25('0x11'),auth[_0x2a25('0xa')](),controller[_0x2a25('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2a25('0x13')](_0x2a25('0xc'),auth[_0x2a25('0xa')](),controller[_0x2a25('0x14')]);router[_0x2a25('0x15')](_0x2a25('0xc'),auth[_0x2a25('0xa')](),controller['destroy']);module[_0x2a25('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 154389a..734571a 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 _0xdf07=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xdf07,0x174));var _0x7df0=function(_0x3deae7,_0x3732f5){_0x3deae7=_0x3deae7-0x0;var _0x50479b=_0xdf07[_0x3deae7];return _0x50479b;};'use strict';var Sequelize=require(_0x7df0('0x0'));module[_0x7df0('0x1')]={'name':{'type':Sequelize[_0x7df0('0x2')]},'moduleCreate':{'type':Sequelize[_0x7df0('0x3')](_0x7df0('0x4'),_0x7df0('0x5'),_0x7df0('0x6')),'defaultValue':_0x7df0('0x4')},'moduleSearch':{'type':Sequelize[_0x7df0('0x3')](_0x7df0('0x7'),_0x7df0('0x5'),_0x7df0('0x4')),'defaultValue':_0x7df0('0x7')},'description':{'type':Sequelize[_0x7df0('0x2')]}}; \ No newline at end of file +var _0x9561=['STRING','sequelize','exports','ENUM','contact','nothing'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9561,0x109));var _0x1956=function(_0x168e6a,_0x2dc65e){_0x168e6a=_0x168e6a-0x0;var _0x481f3c=_0x9561[_0x168e6a];return _0x481f3c;};'use strict';var Sequelize=require(_0x1956('0x0'));module[_0x1956('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x1956('0x2')]('lead',_0x1956('0x3'),_0x1956('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x1956('0x2')]('contact_lead','contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x1956('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ec24840..e202117 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 _0x6080=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','include','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','findOne','filter','getFields','getSubjects','ZohoField','hasOwnProperty','getDescriptions','eml-format'];(function(_0x305c4f,_0x397f4e){var _0x4c858a=function(_0x397950){while(--_0x397950){_0x305c4f['push'](_0x305c4f['shift']());}};_0x4c858a(++_0x397f4e);}(_0x6080,0xf5));var _0x0608=function(_0x1ac206,_0x565166){_0x1ac206=_0x1ac206-0x0;var _0x1fec81=_0x6080[_0x1ac206];return _0x1fec81;};'use strict';var emlformat=require(_0x0608('0x0'));var rimraf=require(_0x0608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0608('0x2'));var rp=require('request-promise');var moment=require(_0x0608('0x3'));var BPromise=require(_0x0608('0x4'));var Mustache=require(_0x0608('0x5'));var util=require(_0x0608('0x6'));var path=require(_0x0608('0x7'));var sox=require(_0x0608('0x8'));var csv=require('to-csv');var ejs=require(_0x0608('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0608('0xa'));var squel=require(_0x0608('0xb'));var crypto=require(_0x0608('0xc'));var jsforce=require(_0x0608('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0608('0xe'));var querystring=require(_0x0608('0xf'));var Papa=require(_0x0608('0x10'));var Redis=require(_0x0608('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0608('0x12'));var hardwareService=require(_0x0608('0x13'));var logger=require(_0x0608('0x14'))('api');var utils=require(_0x0608('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0608('0x16'));var db=require(_0x0608('0x17'))['db'];function respondWithStatusCode(_0x5c6c7d,_0x3cf236){_0x3cf236=_0x3cf236||0xcc;return function(_0x1a270e){if(_0x1a270e){return _0x5c6c7d[_0x0608('0x18')](_0x3cf236);}return _0x5c6c7d[_0x0608('0x19')](_0x3cf236)[_0x0608('0x1a')]();};}function respondWithResult(_0x5a631f,_0x1828da){_0x1828da=_0x1828da||0xc8;return function(_0x172ee1){if(_0x172ee1){return _0x5a631f[_0x0608('0x19')](_0x1828da)[_0x0608('0x1b')](_0x172ee1);}};}function respondWithFilteredResult(_0x247a09,_0x4d6b2d){return function(_0x4c174a){if(_0x4c174a){var _0x160439=typeof _0x4d6b2d[_0x0608('0x1c')]==='undefined'&&typeof _0x4d6b2d[_0x0608('0x1d')]===_0x0608('0x1e');var _0x1fb0ad=_0x4c174a['count'];var _0x3b98e6=_0x160439?0x0:_0x4d6b2d[_0x0608('0x1c')];var _0x3ef496=_0x160439?_0x4c174a[_0x0608('0x1f')]:_0x4d6b2d['offset']+_0x4d6b2d[_0x0608('0x1d')];var _0x48181a;if(_0x3ef496>=_0x1fb0ad){_0x3ef496=_0x1fb0ad;_0x48181a=0xc8;}else{_0x48181a=0xce;}_0x247a09[_0x0608('0x19')](_0x48181a);return _0x247a09[_0x0608('0x20')](_0x0608('0x21'),_0x3b98e6+'-'+_0x3ef496+'/'+_0x1fb0ad)[_0x0608('0x1b')](_0x4c174a);}return null;};}function patchUpdates(_0x371566){return function(_0x364e09){try{jsonpatch[_0x0608('0x22')](_0x364e09,_0x371566,!![]);}catch(_0x35d4b0){return BPromise['reject'](_0x35d4b0);}return _0x364e09[_0x0608('0x23')]();};}function saveUpdates(_0x39778b,_0x12a2ef){return function(_0x2a997b){if(_0x2a997b){return _0x2a997b['update'](_0x39778b)[_0x0608('0x24')](function(_0x5689e3){return _0x5689e3;});}return null;};}function removeEntity(_0x4fc56f,_0x4250f6){return function(_0x18c8f2){if(_0x18c8f2){return _0x18c8f2[_0x0608('0x25')]()[_0x0608('0x24')](function(){_0x4fc56f[_0x0608('0x19')](0xcc)[_0x0608('0x1a')]();});}};}function handleEntityNotFound(_0x5f4f5a,_0x30e107){return function(_0x4a8b87){if(!_0x4a8b87){_0x5f4f5a[_0x0608('0x18')](0x194);}return _0x4a8b87;};}function handleError(_0x3c438c,_0x4eb122){_0x4eb122=_0x4eb122||0x1f4;return function(_0x102a4d){logger[_0x0608('0x26')](_0x102a4d[_0x0608('0x27')]);if(_0x102a4d[_0x0608('0x28')]){delete _0x102a4d[_0x0608('0x28')];}_0x3c438c['status'](_0x4eb122)[_0x0608('0x29')](_0x102a4d);};}exports[_0x0608('0x2a')]=function(_0x223688,_0x16cea5){var _0x4e2822={},_0x466806={},_0x15fb9b={'count':0x0,'rows':[]};var _0x3267cd=_[_0x0608('0x2b')](db[_0x0608('0x2c')][_0x0608('0x2d')],function(_0x633ac4){return{'name':_0x633ac4[_0x0608('0x2e')],'type':_0x633ac4[_0x0608('0x2f')][_0x0608('0x30')]};});_0x466806[_0x0608('0x31')]=_[_0x0608('0x2b')](_0x3267cd,_0x0608('0x28'));_0x466806[_0x0608('0x32')]=_[_0x0608('0x33')](_0x223688['query']);_0x466806[_0x0608('0x34')]=_[_0x0608('0x35')](_0x466806[_0x0608('0x31')],_0x466806['query']);_0x4e2822[_0x0608('0x36')]=_[_0x0608('0x35')](_0x466806[_0x0608('0x31')],qs[_0x0608('0x37')](_0x223688['query'][_0x0608('0x37')]));_0x4e2822[_0x0608('0x36')]=_0x4e2822[_0x0608('0x36')][_0x0608('0x38')]?_0x4e2822[_0x0608('0x36')]:_0x466806[_0x0608('0x31')];if(!_0x223688[_0x0608('0x32')]['hasOwnProperty'](_0x0608('0x39'))){_0x4e2822[_0x0608('0x1d')]=qs[_0x0608('0x1d')](_0x223688[_0x0608('0x32')][_0x0608('0x1d')]);_0x4e2822[_0x0608('0x1c')]=qs[_0x0608('0x1c')](_0x223688[_0x0608('0x32')]['offset']);}_0x4e2822[_0x0608('0x3a')]=qs[_0x0608('0x3b')](_0x223688[_0x0608('0x32')][_0x0608('0x3b')]);_0x4e2822[_0x0608('0x3c')]=qs[_0x0608('0x34')](_[_0x0608('0x3d')](_0x223688[_0x0608('0x32')],_0x466806['filters']),_0x3267cd);if(_0x223688[_0x0608('0x32')]['filter']){_0x4e2822['where']=_['merge'](_0x4e2822['where'],{'$or':_['map'](_0x3267cd,function(_0x21fe02){if(_0x21fe02[_0x0608('0x2f')]!=='VIRTUAL'){var _0x1a4934={};_0x1a4934[_0x21fe02[_0x0608('0x28')]]={'$like':'%'+_0x223688[_0x0608('0x32')]['filter']+'%'};return _0x1a4934;}})});}_0x4e2822=_[_0x0608('0x3e')]({},_0x4e2822,_0x223688['options']);var _0x20cc8d={'where':_0x4e2822[_0x0608('0x3c')]};return db['ZohoConfiguration']['count'](_0x20cc8d)['then'](function(_0x5973ed){_0x15fb9b[_0x0608('0x1f')]=_0x5973ed;if(_0x223688['query']['includeAll']){_0x4e2822[_0x0608('0x3f')]=[{'all':!![]}];}return db[_0x0608('0x2c')][_0x0608('0x40')](_0x4e2822);})[_0x0608('0x24')](function(_0x52f3bb){_0x15fb9b[_0x0608('0x41')]=_0x52f3bb;return _0x15fb9b;})[_0x0608('0x24')](respondWithFilteredResult(_0x16cea5,_0x4e2822))[_0x0608('0x42')](handleError(_0x16cea5,null));};exports[_0x0608('0x43')]=function(_0x26f3c6,_0x33c89c){var _0xef2816={'raw':![],'where':{'id':_0x26f3c6['params']['id']}},_0x2b427c={};_0x2b427c[_0x0608('0x31')]=_[_0x0608('0x33')](db[_0x0608('0x2c')][_0x0608('0x2d')]);_0x2b427c[_0x0608('0x32')]=_[_0x0608('0x33')](_0x26f3c6[_0x0608('0x32')]);_0x2b427c[_0x0608('0x34')]=_[_0x0608('0x35')](_0x2b427c[_0x0608('0x31')],_0x2b427c['query']);_0xef2816['attributes']=_['intersection'](_0x2b427c['model'],qs[_0x0608('0x37')](_0x26f3c6[_0x0608('0x32')][_0x0608('0x37')]));_0xef2816['attributes']=_0xef2816[_0x0608('0x36')][_0x0608('0x38')]?_0xef2816['attributes']:_0x2b427c[_0x0608('0x31')];if(_0x26f3c6[_0x0608('0x32')][_0x0608('0x44')]){_0xef2816[_0x0608('0x3f')]=[{'all':!![]}];}_0xef2816=_[_0x0608('0x3e')]({},_0xef2816,_0x26f3c6[_0x0608('0x45')]);return db[_0x0608('0x2c')][_0x0608('0x46')](_0xef2816)[_0x0608('0x24')](handleEntityNotFound(_0x33c89c,null))['then'](respondWithResult(_0x33c89c,null))[_0x0608('0x42')](handleError(_0x33c89c,null));};exports[_0x0608('0x47')]=function(_0x2490f9,_0x432d5d){return db[_0x0608('0x2c')][_0x0608('0x47')](_0x2490f9[_0x0608('0x48')],{})[_0x0608('0x24')](respondWithResult(_0x432d5d,0xc9))[_0x0608('0x42')](handleError(_0x432d5d,null));};exports[_0x0608('0x49')]=function(_0x283344,_0x3711f0){if(_0x283344['body']['id']){delete _0x283344[_0x0608('0x48')]['id'];}return db['ZohoConfiguration'][_0x0608('0x46')]({'where':{'id':_0x283344[_0x0608('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3711f0,null))[_0x0608('0x24')](saveUpdates(_0x283344['body'],null))[_0x0608('0x24')](respondWithResult(_0x3711f0,null))['catch'](handleError(_0x3711f0,null));};exports['destroy']=function(_0x3696e0,_0x405a35){return db[_0x0608('0x2c')][_0x0608('0x46')]({'where':{'id':_0x3696e0['params']['id']}})[_0x0608('0x24')](handleEntityNotFound(_0x405a35,null))[_0x0608('0x24')](removeEntity(_0x405a35,null))[_0x0608('0x42')](handleError(_0x405a35,null));};exports['getFields']=function(_0x186189,_0x29e4d7,_0x19cdcb){var _0x47365a={};var _0x4d1a54={};var _0x59bbf3;var _0x5529d0;return db['ZohoConfiguration'][_0x0608('0x4b')]({'where':{'id':_0x186189[_0x0608('0x4a')]['id']}})[_0x0608('0x24')](handleEntityNotFound(_0x29e4d7,null))['then'](function(_0x5143dd){if(_0x5143dd){_0x59bbf3=_0x5143dd;_0x4d1a54['model']=_['keys'](db['ZohoField'][_0x0608('0x2d')]);_0x4d1a54[_0x0608('0x32')]=_[_0x0608('0x33')](_0x186189[_0x0608('0x32')]);_0x4d1a54[_0x0608('0x34')]=_[_0x0608('0x35')](_0x4d1a54['model'],_0x4d1a54[_0x0608('0x32')]);_0x47365a['attributes']=_[_0x0608('0x35')](_0x4d1a54[_0x0608('0x31')],qs[_0x0608('0x37')](_0x186189['query'][_0x0608('0x37')]));_0x47365a[_0x0608('0x36')]=_0x47365a[_0x0608('0x36')][_0x0608('0x38')]?_0x47365a['attributes']:_0x4d1a54['model'];_0x47365a['order']=qs[_0x0608('0x3b')](_0x186189[_0x0608('0x32')][_0x0608('0x3b')]);_0x47365a[_0x0608('0x3c')]=qs[_0x0608('0x34')](_['pick'](_0x186189[_0x0608('0x32')],_0x4d1a54[_0x0608('0x34')]));if(_0x186189[_0x0608('0x32')][_0x0608('0x4c')]){_0x47365a['where']=_[_0x0608('0x3e')](_0x47365a[_0x0608('0x3c')],{'$or':_[_0x0608('0x2b')](_0x47365a[_0x0608('0x36')],function(_0x40fbcc){var _0x1c4c00={};_0x1c4c00[_0x40fbcc]={'$like':'%'+_0x186189['query'][_0x0608('0x4c')]+'%'};return _0x1c4c00;})});}_0x47365a=_[_0x0608('0x3e')]({},_0x47365a,_0x186189['options']);return _0x59bbf3[_0x0608('0x4d')](_0x47365a);}})['then'](function(_0x2cd619){if(_0x2cd619){_0x5529d0=_0x2cd619[_0x0608('0x38')];if(!_0x186189['query']['hasOwnProperty']('nolimit')){_0x47365a['limit']=qs[_0x0608('0x1d')](_0x186189['query'][_0x0608('0x1d')]);_0x47365a[_0x0608('0x1c')]=qs[_0x0608('0x1c')](_0x186189[_0x0608('0x32')]['offset']);}return _0x59bbf3['getFields'](_0x47365a);}})[_0x0608('0x24')](function(_0x1a66c1){if(_0x1a66c1){return _0x1a66c1?{'count':_0x5529d0,'rows':_0x1a66c1}:null;}})[_0x0608('0x24')](respondWithResult(_0x29e4d7,null))[_0x0608('0x42')](handleError(_0x29e4d7,null));};exports[_0x0608('0x4e')]=function(_0x2af993,_0x41782a,_0x13d610){var _0x286bc7={};var _0x2155a7={};var _0x3e73b6;var _0x1cca8b;return db[_0x0608('0x2c')][_0x0608('0x4b')]({'where':{'id':_0x2af993[_0x0608('0x4a')]['id']}})[_0x0608('0x24')](handleEntityNotFound(_0x41782a,null))['then'](function(_0x24248c){if(_0x24248c){_0x3e73b6=_0x24248c;_0x2155a7[_0x0608('0x31')]=_[_0x0608('0x33')](db[_0x0608('0x4f')][_0x0608('0x2d')]);_0x2155a7[_0x0608('0x32')]=_[_0x0608('0x33')](_0x2af993[_0x0608('0x32')]);_0x2155a7['filters']=_[_0x0608('0x35')](_0x2155a7[_0x0608('0x31')],_0x2155a7[_0x0608('0x32')]);_0x286bc7[_0x0608('0x36')]=_[_0x0608('0x35')](_0x2155a7[_0x0608('0x31')],qs['fields'](_0x2af993['query'][_0x0608('0x37')]));_0x286bc7[_0x0608('0x36')]=_0x286bc7[_0x0608('0x36')][_0x0608('0x38')]?_0x286bc7[_0x0608('0x36')]:_0x2155a7[_0x0608('0x31')];_0x286bc7['order']=qs[_0x0608('0x3b')](_0x2af993[_0x0608('0x32')]['sort']);_0x286bc7[_0x0608('0x3c')]=qs[_0x0608('0x34')](_[_0x0608('0x3d')](_0x2af993['query'],_0x2155a7[_0x0608('0x34')]));if(_0x2af993[_0x0608('0x32')][_0x0608('0x4c')]){_0x286bc7[_0x0608('0x3c')]=_[_0x0608('0x3e')](_0x286bc7[_0x0608('0x3c')],{'$or':_[_0x0608('0x2b')](_0x286bc7[_0x0608('0x36')],function(_0x4a99d6){var _0x4641d2={};_0x4641d2[_0x4a99d6]={'$like':'%'+_0x2af993['query'][_0x0608('0x4c')]+'%'};return _0x4641d2;})});}_0x286bc7=_[_0x0608('0x3e')]({},_0x286bc7,_0x2af993['options']);return _0x3e73b6[_0x0608('0x4e')](_0x286bc7);}})[_0x0608('0x24')](function(_0x4f4061){if(_0x4f4061){_0x1cca8b=_0x4f4061[_0x0608('0x38')];if(!_0x2af993[_0x0608('0x32')][_0x0608('0x50')](_0x0608('0x39'))){_0x286bc7[_0x0608('0x1d')]=qs[_0x0608('0x1d')](_0x2af993[_0x0608('0x32')][_0x0608('0x1d')]);_0x286bc7[_0x0608('0x1c')]=qs[_0x0608('0x1c')](_0x2af993[_0x0608('0x32')][_0x0608('0x1c')]);}return _0x3e73b6['getSubjects'](_0x286bc7);}})[_0x0608('0x24')](function(_0x1a6cd2){if(_0x1a6cd2){return _0x1a6cd2?{'count':_0x1cca8b,'rows':_0x1a6cd2}:null;}})[_0x0608('0x24')](respondWithResult(_0x41782a,null))[_0x0608('0x42')](handleError(_0x41782a,null));};exports[_0x0608('0x51')]=function(_0x131cfc,_0x459982,_0x442ae5){var _0x59ae4d={};var _0x481692={};var _0x1617b9;var _0x1400bc;return db[_0x0608('0x2c')]['findOne']({'where':{'id':_0x131cfc['params']['id']}})[_0x0608('0x24')](handleEntityNotFound(_0x459982,null))[_0x0608('0x24')](function(_0x303bfc){if(_0x303bfc){_0x1617b9=_0x303bfc;_0x481692[_0x0608('0x31')]=_[_0x0608('0x33')](db['ZohoField'][_0x0608('0x2d')]);_0x481692[_0x0608('0x32')]=_['keys'](_0x131cfc[_0x0608('0x32')]);_0x481692[_0x0608('0x34')]=_[_0x0608('0x35')](_0x481692['model'],_0x481692[_0x0608('0x32')]);_0x59ae4d[_0x0608('0x36')]=_[_0x0608('0x35')](_0x481692['model'],qs[_0x0608('0x37')](_0x131cfc[_0x0608('0x32')][_0x0608('0x37')]));_0x59ae4d[_0x0608('0x36')]=_0x59ae4d[_0x0608('0x36')]['length']?_0x59ae4d[_0x0608('0x36')]:_0x481692[_0x0608('0x31')];_0x59ae4d[_0x0608('0x3a')]=qs[_0x0608('0x3b')](_0x131cfc[_0x0608('0x32')][_0x0608('0x3b')]);_0x59ae4d[_0x0608('0x3c')]=qs[_0x0608('0x34')](_[_0x0608('0x3d')](_0x131cfc[_0x0608('0x32')],_0x481692[_0x0608('0x34')]));if(_0x131cfc[_0x0608('0x32')][_0x0608('0x4c')]){_0x59ae4d[_0x0608('0x3c')]=_[_0x0608('0x3e')](_0x59ae4d[_0x0608('0x3c')],{'$or':_[_0x0608('0x2b')](_0x59ae4d['attributes'],function(_0x3990db){var _0x58acfc={};_0x58acfc[_0x3990db]={'$like':'%'+_0x131cfc['query']['filter']+'%'};return _0x58acfc;})});}_0x59ae4d=_[_0x0608('0x3e')]({},_0x59ae4d,_0x131cfc[_0x0608('0x45')]);return _0x1617b9[_0x0608('0x51')](_0x59ae4d);}})[_0x0608('0x24')](function(_0x4716f4){if(_0x4716f4){_0x1400bc=_0x4716f4['length'];if(!_0x131cfc[_0x0608('0x32')][_0x0608('0x50')](_0x0608('0x39'))){_0x59ae4d['limit']=qs[_0x0608('0x1d')](_0x131cfc['query']['limit']);_0x59ae4d[_0x0608('0x1c')]=qs[_0x0608('0x1c')](_0x131cfc[_0x0608('0x32')]['offset']);}return _0x1617b9[_0x0608('0x51')](_0x59ae4d);}})[_0x0608('0x24')](function(_0x864749){if(_0x864749){return _0x864749?{'count':_0x1400bc,'rows':_0x864749}:null;}})[_0x0608('0x24')](respondWithResult(_0x459982,null))[_0x0608('0x42')](handleError(_0x459982,null));}; \ No newline at end of file +var _0xcc9c=['find','catch','create','body','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','json','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','ZohoConfiguration','rows','show','params','keys','include'];(function(_0x157c0d,_0x16cd75){var _0x3ff39f=function(_0x1d028b){while(--_0x1d028b){_0x157c0d['push'](_0x157c0d['shift']());}};_0x3ff39f(++_0x16cd75);}(_0xcc9c,0x13e));var _0xccc9=function(_0x53e46f,_0xdfb97d){_0x53e46f=_0x53e46f-0x0;var _0x36c6ac=_0xcc9c[_0x53e46f];return _0x36c6ac;};'use strict';var emlformat=require(_0xccc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccc9('0x1'));var jsonpatch=require(_0xccc9('0x2'));var rp=require('request-promise');var moment=require(_0xccc9('0x3'));var BPromise=require(_0xccc9('0x4'));var Mustache=require(_0xccc9('0x5'));var util=require(_0xccc9('0x6'));var path=require(_0xccc9('0x7'));var sox=require(_0xccc9('0x8'));var csv=require(_0xccc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccc9('0xa'));var squel=require('squel');var crypto=require(_0xccc9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xccc9('0xc'));var toCsv=require(_0xccc9('0x9'));var querystring=require(_0xccc9('0xd'));var Papa=require(_0xccc9('0xe'));var Redis=require('ioredis');var authService=require(_0xccc9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xccc9('0x10'));var hardwareService=require(_0xccc9('0x11'));var logger=require(_0xccc9('0x12'))(_0xccc9('0x13'));var utils=require(_0xccc9('0x14'));var config=require(_0xccc9('0x15'));var licenseUtil=require(_0xccc9('0x16'));var db=require(_0xccc9('0x17'))['db'];function respondWithStatusCode(_0x18e15b,_0x1c171c){_0x1c171c=_0x1c171c||0xcc;return function(_0x4dd1fb){if(_0x4dd1fb){return _0x18e15b[_0xccc9('0x18')](_0x1c171c);}return _0x18e15b[_0xccc9('0x19')](_0x1c171c)['end']();};}function respondWithResult(_0x2748e6,_0x453524){_0x453524=_0x453524||0xc8;return function(_0x24a639){if(_0x24a639){return _0x2748e6['status'](_0x453524)['json'](_0x24a639);}};}function respondWithFilteredResult(_0xdfe044,_0x563537){return function(_0x4412c6){if(_0x4412c6){var _0x5b3121=typeof _0x563537['offset']===_0xccc9('0x1a')&&typeof _0x563537[_0xccc9('0x1b')]==='undefined';var _0x43981f=_0x4412c6['count'];var _0x2bdac5=_0x5b3121?0x0:_0x563537['offset'];var _0x397627=_0x5b3121?_0x4412c6['count']:_0x563537[_0xccc9('0x1c')]+_0x563537[_0xccc9('0x1b')];var _0x4ddab2;if(_0x397627>=_0x43981f){_0x397627=_0x43981f;_0x4ddab2=0xc8;}else{_0x4ddab2=0xce;}_0xdfe044[_0xccc9('0x19')](_0x4ddab2);return _0xdfe044[_0xccc9('0x1d')](_0xccc9('0x1e'),_0x2bdac5+'-'+_0x397627+'/'+_0x43981f)[_0xccc9('0x1f')](_0x4412c6);}return null;};}function patchUpdates(_0x4fea20){return function(_0x1546fa){try{jsonpatch['apply'](_0x1546fa,_0x4fea20,!![]);}catch(_0x44a2e0){return BPromise['reject'](_0x44a2e0);}return _0x1546fa[_0xccc9('0x20')]();};}function saveUpdates(_0x28cfca,_0x3e6ce4){return function(_0x598028){if(_0x598028){return _0x598028[_0xccc9('0x21')](_0x28cfca)['then'](function(_0x1586cd){return _0x1586cd;});}return null;};}function removeEntity(_0x39c0af,_0x13f2d0){return function(_0x5b3db1){if(_0x5b3db1){return _0x5b3db1['destroy']()[_0xccc9('0x22')](function(){_0x39c0af[_0xccc9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fb01a,_0x26254b){return function(_0x259702){if(!_0x259702){_0x8fb01a[_0xccc9('0x18')](0x194);}return _0x259702;};}function handleError(_0x2725b3,_0x2a3bb0){_0x2a3bb0=_0x2a3bb0||0x1f4;return function(_0x7a5902){logger[_0xccc9('0x23')](_0x7a5902[_0xccc9('0x24')]);if(_0x7a5902[_0xccc9('0x25')]){delete _0x7a5902[_0xccc9('0x25')];}_0x2725b3[_0xccc9('0x19')](_0x2a3bb0)[_0xccc9('0x26')](_0x7a5902);};}exports[_0xccc9('0x27')]=function(_0x11b2a3,_0x3beacd){var _0x4f649d={},_0x547a91={},_0xb0c7f5={'count':0x0,'rows':[]};var _0x24f93e=_[_0xccc9('0x28')](db['ZohoConfiguration'][_0xccc9('0x29')],function(_0x2ca23b){return{'name':_0x2ca23b[_0xccc9('0x2a')],'type':_0x2ca23b[_0xccc9('0x2b')][_0xccc9('0x2c')]};});_0x547a91[_0xccc9('0x2d')]=_['map'](_0x24f93e,'name');_0x547a91[_0xccc9('0x2e')]=_['keys'](_0x11b2a3[_0xccc9('0x2e')]);_0x547a91['filters']=_[_0xccc9('0x2f')](_0x547a91[_0xccc9('0x2d')],_0x547a91[_0xccc9('0x2e')]);_0x4f649d[_0xccc9('0x30')]=_[_0xccc9('0x2f')](_0x547a91['model'],qs[_0xccc9('0x31')](_0x11b2a3[_0xccc9('0x2e')]['fields']));_0x4f649d[_0xccc9('0x30')]=_0x4f649d['attributes'][_0xccc9('0x32')]?_0x4f649d[_0xccc9('0x30')]:_0x547a91[_0xccc9('0x2d')];if(!_0x11b2a3[_0xccc9('0x2e')][_0xccc9('0x33')](_0xccc9('0x34'))){_0x4f649d[_0xccc9('0x1b')]=qs[_0xccc9('0x1b')](_0x11b2a3[_0xccc9('0x2e')]['limit']);_0x4f649d[_0xccc9('0x1c')]=qs['offset'](_0x11b2a3['query'][_0xccc9('0x1c')]);}_0x4f649d[_0xccc9('0x35')]=qs['sort'](_0x11b2a3[_0xccc9('0x2e')][_0xccc9('0x36')]);_0x4f649d[_0xccc9('0x37')]=qs['filters'](_['pick'](_0x11b2a3['query'],_0x547a91[_0xccc9('0x38')]),_0x24f93e);if(_0x11b2a3[_0xccc9('0x2e')][_0xccc9('0x39')]){_0x4f649d[_0xccc9('0x37')]=_['merge'](_0x4f649d[_0xccc9('0x37')],{'$or':_[_0xccc9('0x28')](_0x24f93e,function(_0x5b11ae){if(_0x5b11ae[_0xccc9('0x2b')]!=='VIRTUAL'){var _0x40a280={};_0x40a280[_0x5b11ae[_0xccc9('0x25')]]={'$like':'%'+_0x11b2a3[_0xccc9('0x2e')][_0xccc9('0x39')]+'%'};return _0x40a280;}})});}_0x4f649d=_[_0xccc9('0x3a')]({},_0x4f649d,_0x11b2a3[_0xccc9('0x3b')]);var _0x5b14c2={'where':_0x4f649d[_0xccc9('0x37')]};return db['ZohoConfiguration']['count'](_0x5b14c2)[_0xccc9('0x22')](function(_0x14d12f){_0xb0c7f5['count']=_0x14d12f;if(_0x11b2a3[_0xccc9('0x2e')][_0xccc9('0x3c')]){_0x4f649d['include']=[{'all':!![]}];}return db[_0xccc9('0x3d')]['findAll'](_0x4f649d);})['then'](function(_0x2da146){_0xb0c7f5[_0xccc9('0x3e')]=_0x2da146;return _0xb0c7f5;})[_0xccc9('0x22')](respondWithFilteredResult(_0x3beacd,_0x4f649d))['catch'](handleError(_0x3beacd,null));};exports[_0xccc9('0x3f')]=function(_0x38c40f,_0x97381c){var _0x5d16cd={'raw':![],'where':{'id':_0x38c40f[_0xccc9('0x40')]['id']}},_0x3c9e96={};_0x3c9e96['model']=_[_0xccc9('0x41')](db['ZohoConfiguration'][_0xccc9('0x29')]);_0x3c9e96[_0xccc9('0x2e')]=_[_0xccc9('0x41')](_0x38c40f['query']);_0x3c9e96[_0xccc9('0x38')]=_['intersection'](_0x3c9e96[_0xccc9('0x2d')],_0x3c9e96[_0xccc9('0x2e')]);_0x5d16cd[_0xccc9('0x30')]=_[_0xccc9('0x2f')](_0x3c9e96[_0xccc9('0x2d')],qs['fields'](_0x38c40f[_0xccc9('0x2e')][_0xccc9('0x31')]));_0x5d16cd[_0xccc9('0x30')]=_0x5d16cd['attributes'][_0xccc9('0x32')]?_0x5d16cd[_0xccc9('0x30')]:_0x3c9e96[_0xccc9('0x2d')];if(_0x38c40f[_0xccc9('0x2e')]['includeAll']){_0x5d16cd[_0xccc9('0x42')]=[{'all':!![]}];}_0x5d16cd=_[_0xccc9('0x3a')]({},_0x5d16cd,_0x38c40f['options']);return db[_0xccc9('0x3d')][_0xccc9('0x43')](_0x5d16cd)[_0xccc9('0x22')](handleEntityNotFound(_0x97381c,null))[_0xccc9('0x22')](respondWithResult(_0x97381c,null))[_0xccc9('0x44')](handleError(_0x97381c,null));};exports[_0xccc9('0x45')]=function(_0x1c0466,_0x12d1c4){return db['ZohoConfiguration'][_0xccc9('0x45')](_0x1c0466[_0xccc9('0x46')],{})['then'](respondWithResult(_0x12d1c4,0xc9))[_0xccc9('0x44')](handleError(_0x12d1c4,null));};exports['update']=function(_0x2884d8,_0xb69559){if(_0x2884d8['body']['id']){delete _0x2884d8[_0xccc9('0x46')]['id'];}return db[_0xccc9('0x3d')][_0xccc9('0x43')]({'where':{'id':_0x2884d8[_0xccc9('0x40')]['id']}})[_0xccc9('0x22')](handleEntityNotFound(_0xb69559,null))[_0xccc9('0x22')](saveUpdates(_0x2884d8[_0xccc9('0x46')],null))[_0xccc9('0x22')](respondWithResult(_0xb69559,null))[_0xccc9('0x44')](handleError(_0xb69559,null));};exports['destroy']=function(_0x48647e,_0x152535){return db[_0xccc9('0x3d')][_0xccc9('0x43')]({'where':{'id':_0x48647e['params']['id']}})[_0xccc9('0x22')](handleEntityNotFound(_0x152535,null))['then'](removeEntity(_0x152535,null))[_0xccc9('0x44')](handleError(_0x152535,null));};exports[_0xccc9('0x47')]=function(_0x49e7ef,_0x4a067b,_0x480ed7){var _0xfe9c21={};var _0xa980dd={};var _0x38bbb6;var _0x2193a9;return db[_0xccc9('0x3d')][_0xccc9('0x48')]({'where':{'id':_0x49e7ef['params']['id']}})[_0xccc9('0x22')](handleEntityNotFound(_0x4a067b,null))['then'](function(_0x2b300b){if(_0x2b300b){_0x38bbb6=_0x2b300b;_0xa980dd[_0xccc9('0x2d')]=_[_0xccc9('0x41')](db[_0xccc9('0x49')]['rawAttributes']);_0xa980dd[_0xccc9('0x2e')]=_[_0xccc9('0x41')](_0x49e7ef['query']);_0xa980dd[_0xccc9('0x38')]=_['intersection'](_0xa980dd['model'],_0xa980dd[_0xccc9('0x2e')]);_0xfe9c21['attributes']=_['intersection'](_0xa980dd['model'],qs['fields'](_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x31')]));_0xfe9c21['attributes']=_0xfe9c21[_0xccc9('0x30')][_0xccc9('0x32')]?_0xfe9c21[_0xccc9('0x30')]:_0xa980dd[_0xccc9('0x2d')];_0xfe9c21[_0xccc9('0x35')]=qs[_0xccc9('0x36')](_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x36')]);_0xfe9c21[_0xccc9('0x37')]=qs[_0xccc9('0x38')](_[_0xccc9('0x4a')](_0x49e7ef[_0xccc9('0x2e')],_0xa980dd['filters']));if(_0x49e7ef[_0xccc9('0x2e')]['filter']){_0xfe9c21[_0xccc9('0x37')]=_[_0xccc9('0x3a')](_0xfe9c21['where'],{'$or':_[_0xccc9('0x28')](_0xfe9c21['attributes'],function(_0x30a49e){var _0x1c2933={};_0x1c2933[_0x30a49e]={'$like':'%'+_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x39')]+'%'};return _0x1c2933;})});}_0xfe9c21=_['merge']({},_0xfe9c21,_0x49e7ef[_0xccc9('0x3b')]);return _0x38bbb6['getFields'](_0xfe9c21);}})[_0xccc9('0x22')](function(_0x9c7555){if(_0x9c7555){_0x2193a9=_0x9c7555[_0xccc9('0x32')];if(!_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x33')]('nolimit')){_0xfe9c21[_0xccc9('0x1b')]=qs['limit'](_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x1b')]);_0xfe9c21[_0xccc9('0x1c')]=qs['offset'](_0x49e7ef[_0xccc9('0x2e')][_0xccc9('0x1c')]);}return _0x38bbb6[_0xccc9('0x47')](_0xfe9c21);}})[_0xccc9('0x22')](function(_0x5c1696){if(_0x5c1696){return _0x5c1696?{'count':_0x2193a9,'rows':_0x5c1696}:null;}})[_0xccc9('0x22')](respondWithResult(_0x4a067b,null))['catch'](handleError(_0x4a067b,null));};exports[_0xccc9('0x4b')]=function(_0x55724a,_0xa3e396,_0x55b01a){var _0x152cb2={};var _0x2cb6ae={};var _0x499857;var _0x2dc9e1;return db['ZohoConfiguration'][_0xccc9('0x48')]({'where':{'id':_0x55724a[_0xccc9('0x40')]['id']}})[_0xccc9('0x22')](handleEntityNotFound(_0xa3e396,null))['then'](function(_0x38aa09){if(_0x38aa09){_0x499857=_0x38aa09;_0x2cb6ae[_0xccc9('0x2d')]=_[_0xccc9('0x41')](db['ZohoField'][_0xccc9('0x29')]);_0x2cb6ae[_0xccc9('0x2e')]=_[_0xccc9('0x41')](_0x55724a[_0xccc9('0x2e')]);_0x2cb6ae['filters']=_[_0xccc9('0x2f')](_0x2cb6ae['model'],_0x2cb6ae[_0xccc9('0x2e')]);_0x152cb2[_0xccc9('0x30')]=_['intersection'](_0x2cb6ae['model'],qs[_0xccc9('0x31')](_0x55724a[_0xccc9('0x2e')][_0xccc9('0x31')]));_0x152cb2['attributes']=_0x152cb2[_0xccc9('0x30')][_0xccc9('0x32')]?_0x152cb2[_0xccc9('0x30')]:_0x2cb6ae[_0xccc9('0x2d')];_0x152cb2['order']=qs['sort'](_0x55724a['query']['sort']);_0x152cb2[_0xccc9('0x37')]=qs[_0xccc9('0x38')](_[_0xccc9('0x4a')](_0x55724a[_0xccc9('0x2e')],_0x2cb6ae[_0xccc9('0x38')]));if(_0x55724a[_0xccc9('0x2e')][_0xccc9('0x39')]){_0x152cb2[_0xccc9('0x37')]=_[_0xccc9('0x3a')](_0x152cb2['where'],{'$or':_['map'](_0x152cb2[_0xccc9('0x30')],function(_0x2d7037){var _0x538f98={};_0x538f98[_0x2d7037]={'$like':'%'+_0x55724a[_0xccc9('0x2e')][_0xccc9('0x39')]+'%'};return _0x538f98;})});}_0x152cb2=_[_0xccc9('0x3a')]({},_0x152cb2,_0x55724a[_0xccc9('0x3b')]);return _0x499857[_0xccc9('0x4b')](_0x152cb2);}})['then'](function(_0x560242){if(_0x560242){_0x2dc9e1=_0x560242['length'];if(!_0x55724a['query'][_0xccc9('0x33')](_0xccc9('0x34'))){_0x152cb2[_0xccc9('0x1b')]=qs[_0xccc9('0x1b')](_0x55724a['query'][_0xccc9('0x1b')]);_0x152cb2[_0xccc9('0x1c')]=qs[_0xccc9('0x1c')](_0x55724a[_0xccc9('0x2e')][_0xccc9('0x1c')]);}return _0x499857[_0xccc9('0x4b')](_0x152cb2);}})[_0xccc9('0x22')](function(_0x8e2881){if(_0x8e2881){return _0x8e2881?{'count':_0x2dc9e1,'rows':_0x8e2881}:null;}})[_0xccc9('0x22')](respondWithResult(_0xa3e396,null))[_0xccc9('0x44')](handleError(_0xa3e396,null));};exports[_0xccc9('0x4c')]=function(_0x17147e,_0xc06e9f,_0x16c8d3){var _0x4d6a0a={};var _0x70c777={};var _0x5a8108;var _0x1047aa;return db[_0xccc9('0x3d')][_0xccc9('0x48')]({'where':{'id':_0x17147e['params']['id']}})['then'](handleEntityNotFound(_0xc06e9f,null))['then'](function(_0x4cffea){if(_0x4cffea){_0x5a8108=_0x4cffea;_0x70c777[_0xccc9('0x2d')]=_['keys'](db['ZohoField'][_0xccc9('0x29')]);_0x70c777[_0xccc9('0x2e')]=_[_0xccc9('0x41')](_0x17147e[_0xccc9('0x2e')]);_0x70c777[_0xccc9('0x38')]=_[_0xccc9('0x2f')](_0x70c777[_0xccc9('0x2d')],_0x70c777[_0xccc9('0x2e')]);_0x4d6a0a[_0xccc9('0x30')]=_[_0xccc9('0x2f')](_0x70c777[_0xccc9('0x2d')],qs[_0xccc9('0x31')](_0x17147e[_0xccc9('0x2e')][_0xccc9('0x31')]));_0x4d6a0a[_0xccc9('0x30')]=_0x4d6a0a['attributes'][_0xccc9('0x32')]?_0x4d6a0a['attributes']:_0x70c777['model'];_0x4d6a0a[_0xccc9('0x35')]=qs[_0xccc9('0x36')](_0x17147e[_0xccc9('0x2e')][_0xccc9('0x36')]);_0x4d6a0a[_0xccc9('0x37')]=qs[_0xccc9('0x38')](_[_0xccc9('0x4a')](_0x17147e[_0xccc9('0x2e')],_0x70c777[_0xccc9('0x38')]));if(_0x17147e[_0xccc9('0x2e')][_0xccc9('0x39')]){_0x4d6a0a[_0xccc9('0x37')]=_['merge'](_0x4d6a0a[_0xccc9('0x37')],{'$or':_[_0xccc9('0x28')](_0x4d6a0a[_0xccc9('0x30')],function(_0x31f415){var _0x50551b={};_0x50551b[_0x31f415]={'$like':'%'+_0x17147e[_0xccc9('0x2e')][_0xccc9('0x39')]+'%'};return _0x50551b;})});}_0x4d6a0a=_[_0xccc9('0x3a')]({},_0x4d6a0a,_0x17147e[_0xccc9('0x3b')]);return _0x5a8108[_0xccc9('0x4c')](_0x4d6a0a);}})[_0xccc9('0x22')](function(_0x332480){if(_0x332480){_0x1047aa=_0x332480[_0xccc9('0x32')];if(!_0x17147e[_0xccc9('0x2e')][_0xccc9('0x33')](_0xccc9('0x34'))){_0x4d6a0a['limit']=qs[_0xccc9('0x1b')](_0x17147e['query']['limit']);_0x4d6a0a[_0xccc9('0x1c')]=qs['offset'](_0x17147e['query'][_0xccc9('0x1c')]);}return _0x5a8108[_0xccc9('0x4c')](_0x4d6a0a);}})[_0xccc9('0x22')](function(_0x18dcfb){if(_0x18dcfb){return _0x18dcfb?{'count':_0x1047aa,'rows':_0x18dcfb}:null;}})[_0xccc9('0x22')](respondWithResult(_0xc06e9f,null))[_0xccc9('0x44')](handleError(_0xc06e9f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 72b4531..5c9eda6 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 _0x5a65=['int_zoho_configurations','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x1fac66,_0x54fc1a){var _0x45880f=function(_0x38732f){while(--_0x38732f){_0x1fac66['push'](_0x1fac66['shift']());}};_0x45880f(++_0x54fc1a);}(_0x5a65,0x18d));var _0x55a6=function(_0x5d010f,_0x3215e7){_0x5d010f=_0x5d010f-0x0;var _0x5ed276=_0x5a65[_0x5d010f];return _0x5ed276;};'use strict';var _=require(_0x55a6('0x0'));var util=require('util');var logger=require(_0x55a6('0x1'))('api');var moment=require(_0x55a6('0x2'));var BPromise=require('bluebird');var rp=require(_0x55a6('0x3'));var fs=require('fs');var path=require(_0x55a6('0x4'));var rimraf=require(_0x55a6('0x5'));var config=require(_0x55a6('0x6'));var attributes=require(_0x55a6('0x7'));module[_0x55a6('0x8')]=function(_0x2af432,_0x1ec569){return _0x2af432[_0x55a6('0x9')](_0x55a6('0xa'),attributes,{'tableName':_0x55a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a55=['define','int_zoho_configurations','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x1151d8,_0x2699ca){var _0x310005=function(_0x1e01ce){while(--_0x1e01ce){_0x1151d8['push'](_0x1151d8['shift']());}};_0x310005(++_0x2699ca);}(_0x3a55,0xbd));var _0x53a5=function(_0x5543d2,_0xabe6c4){_0x5543d2=_0x5543d2-0x0;var _0x561e05=_0x3a55[_0x5543d2];return _0x561e05;};'use strict';var _=require(_0x53a5('0x0'));var util=require(_0x53a5('0x1'));var logger=require(_0x53a5('0x2'))(_0x53a5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53a5('0x4'));var rimraf=require(_0x53a5('0x5'));var config=require(_0x53a5('0x6'));var attributes=require(_0x53a5('0x7'));module[_0x53a5('0x8')]=function(_0x5b56a2,_0x9b4cc4){return _0x5b56a2[_0x53a5('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x53a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 259d2f7..45e01c0 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 _0x94e6=['../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94e6,0xe0));var _0x694e=function(_0x906b6c,_0x475164){_0x906b6c=_0x906b6c-0x0;var _0x6146a8=_0x94e6[_0x906b6c];return _0x6146a8;};'use strict';var _=require('lodash');var util=require(_0x694e('0x0'));var moment=require(_0x694e('0x1'));var BPromise=require(_0x694e('0x2'));var rs=require(_0x694e('0x3'));var fs=require('fs');var Redis=require(_0x694e('0x4'));var db=require(_0x694e('0x5'))['db'];var utils=require(_0x694e('0x6'));var logger=require('../../config/logger')(_0x694e('0x7'));var config=require('../../config/environment');var jayson=require(_0x694e('0x8'));var client=jayson[_0x694e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4bc5,_0x4c0ccf,_0x560095){return new BPromise(function(_0x28628f,_0x132e86){return client[_0x694e('0xa')](_0x4f4bc5,_0x560095)[_0x694e('0xb')](function(_0x31247b){logger[_0x694e('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c0ccf,_0x694e('0xd'));logger[_0x694e('0xe')](_0x694e('0xf'),_0x4c0ccf,_0x694e('0xd'),JSON[_0x694e('0x10')](_0x31247b));if(_0x31247b['error']){if(_0x31247b['error'][_0x694e('0x11')]===0x1f4){logger[_0x694e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c0ccf,_0x31247b[_0x694e('0x12')][_0x694e('0x13')]);return _0x132e86(_0x31247b[_0x694e('0x12')][_0x694e('0x13')]);}logger[_0x694e('0x12')](_0x694e('0x14'),_0x4c0ccf,_0x31247b[_0x694e('0x12')][_0x694e('0x13')]);return _0x28628f(_0x31247b['error'][_0x694e('0x13')]);}else{logger[_0x694e('0xc')](_0x694e('0x14'),_0x4c0ccf,_0x694e('0xd'));_0x28628f(_0x31247b[_0x694e('0x15')][_0x694e('0x13')]);}})[_0x694e('0x16')](function(_0x1736ad){logger[_0x694e('0x12')](_0x694e('0x14'),_0x4c0ccf,_0x1736ad);_0x132e86(_0x1736ad);});});} \ No newline at end of file +var _0x5a4f=['request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5a4f,0x155));var _0xf5a4=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5a4f[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xf5a4('0x0'));var util=require(_0xf5a4('0x1'));var moment=require(_0xf5a4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5a4('0x3'));var db=require(_0xf5a4('0x4'))['db'];var utils=require(_0xf5a4('0x5'));var logger=require(_0xf5a4('0x6'))('rpc');var config=require(_0xf5a4('0x7'));var jayson=require(_0xf5a4('0x8'));var client=jayson[_0xf5a4('0x9')][_0xf5a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb0d04f,_0x55c957,_0x1f28fd){return new BPromise(function(_0xe25abc,_0x3fa7a0){return client[_0xf5a4('0xb')](_0xb0d04f,_0x1f28fd)['then'](function(_0x576495){logger['info'](_0xf5a4('0xc'),_0x55c957,_0xf5a4('0xd'));logger[_0xf5a4('0xe')](_0xf5a4('0xf'),_0x55c957,_0xf5a4('0xd'),JSON[_0xf5a4('0x10')](_0x576495));if(_0x576495['error']){if(_0x576495[_0xf5a4('0x11')][_0xf5a4('0x12')]===0x1f4){logger[_0xf5a4('0x11')](_0xf5a4('0xc'),_0x55c957,_0x576495['error'][_0xf5a4('0x13')]);return _0x3fa7a0(_0x576495[_0xf5a4('0x11')][_0xf5a4('0x13')]);}logger['error'](_0xf5a4('0xc'),_0x55c957,_0x576495[_0xf5a4('0x11')]['message']);return _0xe25abc(_0x576495[_0xf5a4('0x11')][_0xf5a4('0x13')]);}else{logger[_0xf5a4('0x14')](_0xf5a4('0xc'),_0x55c957,'request\x20sent');_0xe25abc(_0x576495['result'][_0xf5a4('0x13')]);}})[_0xf5a4('0x15')](function(_0x2d3914){logger[_0xf5a4('0x11')](_0xf5a4('0xc'),_0x55c957,_0x2d3914);_0x3fa7a0(_0x2d3914);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 5669a26..37c4832 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 _0x5e65=['get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x56a616,_0x5a3c7c){var _0xe94844=function(_0x1d3816){while(--_0x1d3816){_0x56a616['push'](_0x56a616['shift']());}};_0xe94844(++_0x5a3c7c);}(_0x5e65,0xdb));var _0x55e6=function(_0x5429bf,_0x559689){_0x5429bf=_0x5429bf-0x0;var _0x843559=_0x5e65[_0x5429bf];return _0x843559;};'use strict';var multer=require('multer');var util=require(_0x55e6('0x0'));var path=require(_0x55e6('0x1'));var timeout=require(_0x55e6('0x2'));var express=require('express');var router=express[_0x55e6('0x3')]();var fs_extra=require(_0x55e6('0x4'));var auth=require(_0x55e6('0x5'));var interaction=require(_0x55e6('0x6'));var config=require(_0x55e6('0x7'));var controller=require(_0x55e6('0x8'));router[_0x55e6('0x9')]('/',auth['isAuthenticated'](),controller[_0x55e6('0xa')]);router[_0x55e6('0x9')](_0x55e6('0xb'),auth[_0x55e6('0xc')](),controller[_0x55e6('0xd')]);router[_0x55e6('0xe')]('/',auth[_0x55e6('0xc')](),controller[_0x55e6('0xf')]);router[_0x55e6('0x10')](_0x55e6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x55e6('0x11')](_0x55e6('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x55e6('0x12')]=router; \ No newline at end of file +var _0x3ae2=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x2c2943,_0x385231){var _0x23a14f=function(_0x101fa2){while(--_0x101fa2){_0x2c2943['push'](_0x2c2943['shift']());}};_0x23a14f(++_0x385231);}(_0x3ae2,0xb8));var _0x23ae=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x3ae2[_0x51beba];return _0x167ee0;};'use strict';var multer=require(_0x23ae('0x0'));var util=require(_0x23ae('0x1'));var path=require(_0x23ae('0x2'));var timeout=require(_0x23ae('0x3'));var express=require(_0x23ae('0x4'));var router=express[_0x23ae('0x5')]();var fs_extra=require(_0x23ae('0x6'));var auth=require(_0x23ae('0x7'));var interaction=require(_0x23ae('0x8'));var config=require('../../config/environment');var controller=require(_0x23ae('0x9'));router[_0x23ae('0xa')]('/',auth[_0x23ae('0xb')](),controller[_0x23ae('0xc')]);router['get'](_0x23ae('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x23ae('0xe')]('/',auth['isAuthenticated'](),controller[_0x23ae('0xf')]);router['put'](_0x23ae('0xd'),auth[_0x23ae('0xb')](),controller[_0x23ae('0x10')]);router[_0x23ae('0x11')](_0x23ae('0xd'),auth[_0x23ae('0xb')](),controller[_0x23ae('0x12')]);module[_0x23ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index fdb611f..842714c 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 _0x9a05=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0xa41559,_0x30e1f6){var _0x46561b=function(_0x9bca54){while(--_0x9bca54){_0xa41559['push'](_0xa41559['shift']());}};_0x46561b(++_0x30e1f6);}(_0x9a05,0xb8));var _0x59a0=function(_0x590c79,_0x8e80ce){_0x590c79=_0x590c79-0x0;var _0x39431e=_0x9a05[_0x590c79];return _0x39431e;};'use strict';var Sequelize=require(_0x59a0('0x0'));module[_0x59a0('0x1')]={'type':{'type':Sequelize[_0x59a0('0x2')](_0x59a0('0x3'),_0x59a0('0x4'),_0x59a0('0x5'),'keyValue',_0x59a0('0x6')),'defaultValue':_0x59a0('0x3')},'content':{'type':Sequelize[_0x59a0('0x7')]},'key':{'type':Sequelize[_0x59a0('0x7')]},'keyType':{'type':Sequelize[_0x59a0('0x2')](_0x59a0('0x3'),_0x59a0('0x4'),_0x59a0('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x59a0('0x7')]}}; \ No newline at end of file +var _0x47eb=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x47eb,0x7b));var _0xb47e=function(_0x47f7ec,_0x369f9d){_0x47f7ec=_0x47f7ec-0x0;var _0x415101=_0x47eb[_0x47f7ec];return _0x415101;};'use strict';var Sequelize=require(_0xb47e('0x0'));module[_0xb47e('0x1')]={'type':{'type':Sequelize[_0xb47e('0x2')](_0xb47e('0x3'),_0xb47e('0x4'),_0xb47e('0x5'),'keyValue',_0xb47e('0x6')),'defaultValue':_0xb47e('0x3')},'content':{'type':Sequelize[_0xb47e('0x7')]},'key':{'type':Sequelize[_0xb47e('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb47e('0x7')]},'nameField':{'type':Sequelize[_0xb47e('0x7')]},'customField':{'type':Sequelize[_0xb47e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb47e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2390ff7..e3310b1 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 _0x1448=['nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','json','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x1448,0x140));var _0x8144=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1448[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8144('0x0'));var zipdir=require(_0x8144('0x1'));var jsonpatch=require(_0x8144('0x2'));var rp=require(_0x8144('0x3'));var moment=require('moment');var BPromise=require(_0x8144('0x4'));var Mustache=require(_0x8144('0x5'));var util=require(_0x8144('0x6'));var path=require('path');var sox=require(_0x8144('0x7'));var csv=require(_0x8144('0x8'));var ejs=require(_0x8144('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8144('0xa'));var squel=require(_0x8144('0xb'));var crypto=require(_0x8144('0xc'));var jsforce=require(_0x8144('0xd'));var deskjs=require(_0x8144('0xe'));var toCsv=require(_0x8144('0x8'));var querystring=require(_0x8144('0xf'));var Papa=require(_0x8144('0x10'));var Redis=require(_0x8144('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8144('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8144('0x13'));var logger=require('../../config/logger')(_0x8144('0x14'));var utils=require(_0x8144('0x15'));var config=require(_0x8144('0x16'));var licenseUtil=require(_0x8144('0x17'));var db=require(_0x8144('0x18'))['db'];function respondWithStatusCode(_0xcabbcd,_0x486c96){_0x486c96=_0x486c96||0xcc;return function(_0x2e5885){if(_0x2e5885){return _0xcabbcd['sendStatus'](_0x486c96);}return _0xcabbcd[_0x8144('0x19')](_0x486c96)[_0x8144('0x1a')]();};}function respondWithResult(_0x57e1a7,_0x2f2fa3){_0x2f2fa3=_0x2f2fa3||0xc8;return function(_0x2814d6){if(_0x2814d6){return _0x57e1a7[_0x8144('0x19')](_0x2f2fa3)['json'](_0x2814d6);}};}function respondWithFilteredResult(_0x53a3a9,_0x1d36d3){return function(_0x2dba35){if(_0x2dba35){var _0x5f2942=typeof _0x1d36d3['offset']===_0x8144('0x1b')&&typeof _0x1d36d3[_0x8144('0x1c')]===_0x8144('0x1b');var _0x52ab9f=_0x2dba35[_0x8144('0x1d')];var _0x56d1e5=_0x5f2942?0x0:_0x1d36d3[_0x8144('0x1e')];var _0x5a04d6=_0x5f2942?_0x2dba35[_0x8144('0x1d')]:_0x1d36d3[_0x8144('0x1e')]+_0x1d36d3[_0x8144('0x1c')];var _0x3b58c3;if(_0x5a04d6>=_0x52ab9f){_0x5a04d6=_0x52ab9f;_0x3b58c3=0xc8;}else{_0x3b58c3=0xce;}_0x53a3a9['status'](_0x3b58c3);return _0x53a3a9['set']('Content-Range',_0x56d1e5+'-'+_0x5a04d6+'/'+_0x52ab9f)[_0x8144('0x1f')](_0x2dba35);}return null;};}function patchUpdates(_0x27d313){return function(_0x7ca9cd){try{jsonpatch[_0x8144('0x20')](_0x7ca9cd,_0x27d313,!![]);}catch(_0x49043f){return BPromise[_0x8144('0x21')](_0x49043f);}return _0x7ca9cd[_0x8144('0x22')]();};}function saveUpdates(_0x249abf,_0x464dbf){return function(_0x2aa6a4){if(_0x2aa6a4){return _0x2aa6a4['update'](_0x249abf)['then'](function(_0x334a13){return _0x334a13;});}return null;};}function removeEntity(_0x34a11a,_0x237b14){return function(_0x2f4985){if(_0x2f4985){return _0x2f4985[_0x8144('0x23')]()[_0x8144('0x24')](function(){_0x34a11a[_0x8144('0x19')](0xcc)[_0x8144('0x1a')]();});}};}function handleEntityNotFound(_0x19b49f,_0x31a55e){return function(_0x1a7385){if(!_0x1a7385){_0x19b49f[_0x8144('0x25')](0x194);}return _0x1a7385;};}function handleError(_0xbeaea3,_0x2c5d19){_0x2c5d19=_0x2c5d19||0x1f4;return function(_0x2b44c7){logger[_0x8144('0x26')](_0x2b44c7[_0x8144('0x27')]);if(_0x2b44c7[_0x8144('0x28')]){delete _0x2b44c7[_0x8144('0x28')];}_0xbeaea3[_0x8144('0x19')](_0x2c5d19)['send'](_0x2b44c7);};}exports[_0x8144('0x29')]=function(_0xe3ac2d,_0x40aef7){var _0x19e869={},_0x4538e1={},_0x3fa41d={'count':0x0,'rows':[]};var _0x51f7d8=_[_0x8144('0x2a')](db[_0x8144('0x2b')][_0x8144('0x2c')],function(_0x213f03){return{'name':_0x213f03[_0x8144('0x2d')],'type':_0x213f03[_0x8144('0x2e')]['key']};});_0x4538e1[_0x8144('0x2f')]=_[_0x8144('0x2a')](_0x51f7d8,_0x8144('0x28'));_0x4538e1['query']=_['keys'](_0xe3ac2d[_0x8144('0x30')]);_0x4538e1[_0x8144('0x31')]=_[_0x8144('0x32')](_0x4538e1[_0x8144('0x2f')],_0x4538e1[_0x8144('0x30')]);_0x19e869['attributes']=_['intersection'](_0x4538e1[_0x8144('0x2f')],qs['fields'](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x33')]));_0x19e869[_0x8144('0x34')]=_0x19e869[_0x8144('0x34')][_0x8144('0x35')]?_0x19e869[_0x8144('0x34')]:_0x4538e1[_0x8144('0x2f')];if(!_0xe3ac2d[_0x8144('0x30')][_0x8144('0x36')](_0x8144('0x37'))){_0x19e869[_0x8144('0x1c')]=qs['limit'](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x1c')]);_0x19e869['offset']=qs[_0x8144('0x1e')](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x1e')]);}_0x19e869[_0x8144('0x38')]=qs[_0x8144('0x39')](_0xe3ac2d[_0x8144('0x30')][_0x8144('0x39')]);_0x19e869[_0x8144('0x3a')]=qs[_0x8144('0x31')](_[_0x8144('0x3b')](_0xe3ac2d['query'],_0x4538e1['filters']),_0x51f7d8);if(_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3c')]){_0x19e869[_0x8144('0x3a')]=_[_0x8144('0x3d')](_0x19e869[_0x8144('0x3a')],{'$or':_['map'](_0x51f7d8,function(_0x52988c){if(_0x52988c[_0x8144('0x2e')]!=='VIRTUAL'){var _0x4c8624={};_0x4c8624[_0x52988c['name']]={'$like':'%'+_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3c')]+'%'};return _0x4c8624;}})});}_0x19e869=_['merge']({},_0x19e869,_0xe3ac2d[_0x8144('0x3e')]);var _0x2a9187={'where':_0x19e869[_0x8144('0x3a')]};return db['ZohoField'][_0x8144('0x1d')](_0x2a9187)[_0x8144('0x24')](function(_0x364821){_0x3fa41d[_0x8144('0x1d')]=_0x364821;if(_0xe3ac2d[_0x8144('0x30')][_0x8144('0x3f')]){_0x19e869[_0x8144('0x40')]=[{'all':!![]}];}return db[_0x8144('0x2b')][_0x8144('0x41')](_0x19e869);})[_0x8144('0x24')](function(_0x39fd69){_0x3fa41d[_0x8144('0x42')]=_0x39fd69;return _0x3fa41d;})[_0x8144('0x24')](respondWithFilteredResult(_0x40aef7,_0x19e869))[_0x8144('0x43')](handleError(_0x40aef7,null));};exports[_0x8144('0x44')]=function(_0x2a95cc,_0x1bfa76){var _0x57ee3={'raw':!![],'where':{'id':_0x2a95cc[_0x8144('0x45')]['id']}},_0x1cd4c4={};_0x1cd4c4[_0x8144('0x2f')]=_[_0x8144('0x46')](db['ZohoField'][_0x8144('0x2c')]);_0x1cd4c4['query']=_[_0x8144('0x46')](_0x2a95cc[_0x8144('0x30')]);_0x1cd4c4[_0x8144('0x31')]=_['intersection'](_0x1cd4c4[_0x8144('0x2f')],_0x1cd4c4[_0x8144('0x30')]);_0x57ee3[_0x8144('0x34')]=_[_0x8144('0x32')](_0x1cd4c4['model'],qs['fields'](_0x2a95cc[_0x8144('0x30')][_0x8144('0x33')]));_0x57ee3[_0x8144('0x34')]=_0x57ee3[_0x8144('0x34')][_0x8144('0x35')]?_0x57ee3[_0x8144('0x34')]:_0x1cd4c4['model'];if(_0x2a95cc['query'][_0x8144('0x3f')]){_0x57ee3[_0x8144('0x40')]=[{'all':!![]}];}_0x57ee3=_[_0x8144('0x3d')]({},_0x57ee3,_0x2a95cc[_0x8144('0x3e')]);return db['ZohoField'][_0x8144('0x47')](_0x57ee3)['then'](handleEntityNotFound(_0x1bfa76,null))[_0x8144('0x24')](respondWithResult(_0x1bfa76,null))[_0x8144('0x43')](handleError(_0x1bfa76,null));};exports[_0x8144('0x48')]=function(_0x11df83,_0x22183d){return db['ZohoField'][_0x8144('0x48')](_0x11df83[_0x8144('0x49')],{})[_0x8144('0x24')](respondWithResult(_0x22183d,0xc9))[_0x8144('0x43')](handleError(_0x22183d,null));};exports[_0x8144('0x4a')]=function(_0x215bef,_0x37be38){if(_0x215bef['body']['id']){delete _0x215bef[_0x8144('0x49')]['id'];}return db[_0x8144('0x2b')][_0x8144('0x47')]({'where':{'id':_0x215bef['params']['id']}})[_0x8144('0x24')](handleEntityNotFound(_0x37be38,null))['then'](saveUpdates(_0x215bef[_0x8144('0x49')],null))['then'](respondWithResult(_0x37be38,null))['catch'](handleError(_0x37be38,null));};exports[_0x8144('0x23')]=function(_0x2ae52e,_0x3c0385){return db[_0x8144('0x2b')][_0x8144('0x47')]({'where':{'id':_0x2ae52e[_0x8144('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c0385,null))['then'](removeEntity(_0x3c0385,null))[_0x8144('0x43')](handleError(_0x3c0385,null));}; \ No newline at end of file +var _0x3a9e=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','error','stack','name','send','index','ZohoField','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2e476a,_0x1c655d){var _0x188142=function(_0x4936ef){while(--_0x4936ef){_0x2e476a['push'](_0x2e476a['shift']());}};_0x188142(++_0x1c655d);}(_0x3a9e,0x162));var _0xe3a9=function(_0x368b19,_0xcf4ad7){_0x368b19=_0x368b19-0x0;var _0x8ec657=_0x3a9e[_0x368b19];return _0x8ec657;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3a9('0x0'));var jsonpatch=require(_0xe3a9('0x1'));var rp=require(_0xe3a9('0x2'));var moment=require(_0xe3a9('0x3'));var BPromise=require(_0xe3a9('0x4'));var Mustache=require(_0xe3a9('0x5'));var util=require(_0xe3a9('0x6'));var path=require(_0xe3a9('0x7'));var sox=require('sox');var csv=require(_0xe3a9('0x8'));var ejs=require(_0xe3a9('0x9'));var fs=require('fs');var fs_extra=require(_0xe3a9('0xa'));var _=require(_0xe3a9('0xb'));var squel=require(_0xe3a9('0xc'));var crypto=require(_0xe3a9('0xd'));var jsforce=require(_0xe3a9('0xe'));var deskjs=require(_0xe3a9('0xf'));var toCsv=require(_0xe3a9('0x8'));var querystring=require(_0xe3a9('0x10'));var Papa=require(_0xe3a9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe3a9('0x12'));var as=require(_0xe3a9('0x13'));var hardwareService=require(_0xe3a9('0x14'));var logger=require(_0xe3a9('0x15'))(_0xe3a9('0x16'));var utils=require('../../config/utils');var config=require(_0xe3a9('0x17'));var licenseUtil=require(_0xe3a9('0x18'));var db=require(_0xe3a9('0x19'))['db'];function respondWithStatusCode(_0x44c5cd,_0x47c921){_0x47c921=_0x47c921||0xcc;return function(_0x8c556a){if(_0x8c556a){return _0x44c5cd[_0xe3a9('0x1a')](_0x47c921);}return _0x44c5cd[_0xe3a9('0x1b')](_0x47c921)[_0xe3a9('0x1c')]();};}function respondWithResult(_0x55be4c,_0x3a6bdf){_0x3a6bdf=_0x3a6bdf||0xc8;return function(_0x35e893){if(_0x35e893){return _0x55be4c[_0xe3a9('0x1b')](_0x3a6bdf)['json'](_0x35e893);}};}function respondWithFilteredResult(_0xca42d4,_0x594e1f){return function(_0x43f7d1){if(_0x43f7d1){var _0x1cf895=typeof _0x594e1f[_0xe3a9('0x1d')]===_0xe3a9('0x1e')&&typeof _0x594e1f[_0xe3a9('0x1f')]==='undefined';var _0x4730e6=_0x43f7d1['count'];var _0x12722b=_0x1cf895?0x0:_0x594e1f['offset'];var _0x4eac84=_0x1cf895?_0x43f7d1[_0xe3a9('0x20')]:_0x594e1f['offset']+_0x594e1f['limit'];var _0x3e9bd9;if(_0x4eac84>=_0x4730e6){_0x4eac84=_0x4730e6;_0x3e9bd9=0xc8;}else{_0x3e9bd9=0xce;}_0xca42d4['status'](_0x3e9bd9);return _0xca42d4['set']('Content-Range',_0x12722b+'-'+_0x4eac84+'/'+_0x4730e6)[_0xe3a9('0x21')](_0x43f7d1);}return null;};}function patchUpdates(_0x53557c){return function(_0x57087f){try{jsonpatch[_0xe3a9('0x22')](_0x57087f,_0x53557c,!![]);}catch(_0x366427){return BPromise[_0xe3a9('0x23')](_0x366427);}return _0x57087f['save']();};}function saveUpdates(_0x4a4189,_0x517d4e){return function(_0x1a85cf){if(_0x1a85cf){return _0x1a85cf[_0xe3a9('0x24')](_0x4a4189)[_0xe3a9('0x25')](function(_0x7a48e4){return _0x7a48e4;});}return null;};}function removeEntity(_0x43a95a,_0x20a764){return function(_0x32f7c4){if(_0x32f7c4){return _0x32f7c4['destroy']()['then'](function(){_0x43a95a[_0xe3a9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x117435,_0x503c3d){return function(_0x532e97){if(!_0x532e97){_0x117435[_0xe3a9('0x1a')](0x194);}return _0x532e97;};}function handleError(_0x1e96ca,_0x5a5a87){_0x5a5a87=_0x5a5a87||0x1f4;return function(_0x1f10a6){logger[_0xe3a9('0x26')](_0x1f10a6[_0xe3a9('0x27')]);if(_0x1f10a6[_0xe3a9('0x28')]){delete _0x1f10a6['name'];}_0x1e96ca[_0xe3a9('0x1b')](_0x5a5a87)[_0xe3a9('0x29')](_0x1f10a6);};}exports[_0xe3a9('0x2a')]=function(_0x4d56f5,_0x49295b){var _0x34937d={},_0x4012bf={},_0x1c0553={'count':0x0,'rows':[]};var _0x33e053=_['map'](db[_0xe3a9('0x2b')][_0xe3a9('0x2c')],function(_0x4e9fa7){return{'name':_0x4e9fa7['fieldName'],'type':_0x4e9fa7[_0xe3a9('0x2d')][_0xe3a9('0x2e')]};});_0x4012bf['model']=_[_0xe3a9('0x2f')](_0x33e053,'name');_0x4012bf[_0xe3a9('0x30')]=_[_0xe3a9('0x31')](_0x4d56f5[_0xe3a9('0x30')]);_0x4012bf[_0xe3a9('0x32')]=_['intersection'](_0x4012bf[_0xe3a9('0x33')],_0x4012bf[_0xe3a9('0x30')]);_0x34937d[_0xe3a9('0x34')]=_[_0xe3a9('0x35')](_0x4012bf[_0xe3a9('0x33')],qs[_0xe3a9('0x36')](_0x4d56f5[_0xe3a9('0x30')][_0xe3a9('0x36')]));_0x34937d[_0xe3a9('0x34')]=_0x34937d[_0xe3a9('0x34')][_0xe3a9('0x37')]?_0x34937d[_0xe3a9('0x34')]:_0x4012bf[_0xe3a9('0x33')];if(!_0x4d56f5[_0xe3a9('0x30')][_0xe3a9('0x38')](_0xe3a9('0x39'))){_0x34937d[_0xe3a9('0x1f')]=qs['limit'](_0x4d56f5[_0xe3a9('0x30')][_0xe3a9('0x1f')]);_0x34937d['offset']=qs[_0xe3a9('0x1d')](_0x4d56f5[_0xe3a9('0x30')]['offset']);}_0x34937d['order']=qs['sort'](_0x4d56f5[_0xe3a9('0x30')][_0xe3a9('0x3a')]);_0x34937d[_0xe3a9('0x3b')]=qs[_0xe3a9('0x32')](_[_0xe3a9('0x3c')](_0x4d56f5[_0xe3a9('0x30')],_0x4012bf[_0xe3a9('0x32')]),_0x33e053);if(_0x4d56f5[_0xe3a9('0x30')]['filter']){_0x34937d[_0xe3a9('0x3b')]=_[_0xe3a9('0x3d')](_0x34937d[_0xe3a9('0x3b')],{'$or':_[_0xe3a9('0x2f')](_0x33e053,function(_0xef8c2b){if(_0xef8c2b[_0xe3a9('0x2d')]!==_0xe3a9('0x3e')){var _0x1f1b82={};_0x1f1b82[_0xef8c2b[_0xe3a9('0x28')]]={'$like':'%'+_0x4d56f5[_0xe3a9('0x30')][_0xe3a9('0x3f')]+'%'};return _0x1f1b82;}})});}_0x34937d=_[_0xe3a9('0x3d')]({},_0x34937d,_0x4d56f5[_0xe3a9('0x40')]);var _0x150930={'where':_0x34937d[_0xe3a9('0x3b')]};return db[_0xe3a9('0x2b')][_0xe3a9('0x20')](_0x150930)[_0xe3a9('0x25')](function(_0x5c6e3a){_0x1c0553[_0xe3a9('0x20')]=_0x5c6e3a;if(_0x4d56f5[_0xe3a9('0x30')]['includeAll']){_0x34937d[_0xe3a9('0x41')]=[{'all':!![]}];}return db[_0xe3a9('0x2b')][_0xe3a9('0x42')](_0x34937d);})['then'](function(_0x7981a5){_0x1c0553[_0xe3a9('0x43')]=_0x7981a5;return _0x1c0553;})[_0xe3a9('0x25')](respondWithFilteredResult(_0x49295b,_0x34937d))[_0xe3a9('0x44')](handleError(_0x49295b,null));};exports[_0xe3a9('0x45')]=function(_0x3339e7,_0x4ebd81){var _0xfadcc8={'raw':!![],'where':{'id':_0x3339e7[_0xe3a9('0x46')]['id']}},_0x4865ba={};_0x4865ba[_0xe3a9('0x33')]=_[_0xe3a9('0x31')](db['ZohoField'][_0xe3a9('0x2c')]);_0x4865ba['query']=_[_0xe3a9('0x31')](_0x3339e7['query']);_0x4865ba[_0xe3a9('0x32')]=_[_0xe3a9('0x35')](_0x4865ba[_0xe3a9('0x33')],_0x4865ba['query']);_0xfadcc8['attributes']=_[_0xe3a9('0x35')](_0x4865ba['model'],qs[_0xe3a9('0x36')](_0x3339e7[_0xe3a9('0x30')]['fields']));_0xfadcc8[_0xe3a9('0x34')]=_0xfadcc8[_0xe3a9('0x34')][_0xe3a9('0x37')]?_0xfadcc8['attributes']:_0x4865ba[_0xe3a9('0x33')];if(_0x3339e7['query'][_0xe3a9('0x47')]){_0xfadcc8[_0xe3a9('0x41')]=[{'all':!![]}];}_0xfadcc8=_[_0xe3a9('0x3d')]({},_0xfadcc8,_0x3339e7[_0xe3a9('0x40')]);return db[_0xe3a9('0x2b')][_0xe3a9('0x48')](_0xfadcc8)[_0xe3a9('0x25')](handleEntityNotFound(_0x4ebd81,null))[_0xe3a9('0x25')](respondWithResult(_0x4ebd81,null))[_0xe3a9('0x44')](handleError(_0x4ebd81,null));};exports[_0xe3a9('0x49')]=function(_0x308c1d,_0x2d8403){return db[_0xe3a9('0x2b')][_0xe3a9('0x49')](_0x308c1d[_0xe3a9('0x4a')],{})['then'](respondWithResult(_0x2d8403,0xc9))['catch'](handleError(_0x2d8403,null));};exports[_0xe3a9('0x24')]=function(_0x55c69a,_0x2f7775){if(_0x55c69a['body']['id']){delete _0x55c69a['body']['id'];}return db[_0xe3a9('0x2b')][_0xe3a9('0x48')]({'where':{'id':_0x55c69a[_0xe3a9('0x46')]['id']}})[_0xe3a9('0x25')](handleEntityNotFound(_0x2f7775,null))['then'](saveUpdates(_0x55c69a['body'],null))[_0xe3a9('0x25')](respondWithResult(_0x2f7775,null))[_0xe3a9('0x44')](handleError(_0x2f7775,null));};exports['destroy']=function(_0x29d804,_0x461b8c){return db['ZohoField'][_0xe3a9('0x48')]({'where':{'id':_0x29d804[_0xe3a9('0x46')]['id']}})[_0xe3a9('0x25')](handleEntityNotFound(_0x461b8c,null))[_0xe3a9('0x25')](removeEntity(_0x461b8c,null))[_0xe3a9('0x44')](handleError(_0x461b8c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2f030ac..31cdd14 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x588811,_0x2d5f0b){var _0x431309=function(_0xa2cbec){while(--_0xa2cbec){_0x588811['push'](_0x588811['shift']());}};_0x431309(++_0x2d5f0b);}(_0x187d,0x93));var _0xd187=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x187d[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xd'),_0xd187('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bd3=['lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define','ZohoField','zoho_unique_index','idField','FieldId'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4bd3,0x174));var _0x34bd=function(_0x56e614,_0x257613){_0x56e614=_0x56e614-0x0;var _0x1417d4=_0x4bd3[_0x56e614];return _0x1417d4;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./intZohoField.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x34bd('0x9'),'fields':[_0x34bd('0xa'),_0x34bd('0xb')],'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 f180b04..f9bdab5 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 _0x164f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils'];(function(_0x366455,_0x45dd1d){var _0x11b025=function(_0x405777){while(--_0x405777){_0x366455['push'](_0x366455['shift']());}};_0x11b025(++_0x45dd1d);}(_0x164f,0x15c));var _0xf164=function(_0x147aef,_0x548f7b){_0x147aef=_0x147aef-0x0;var _0x125b35=_0x164f[_0x147aef];return _0x125b35;};'use strict';var _=require(_0xf164('0x0'));var util=require(_0xf164('0x1'));var moment=require(_0xf164('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf164('0x3'));var logger=require(_0xf164('0x4'))(_0xf164('0x5'));var config=require(_0xf164('0x6'));var jayson=require(_0xf164('0x7'));var client=jayson[_0xf164('0x8')][_0xf164('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55c606,_0x2f712e,_0x102fce){return new BPromise(function(_0x5cf61c,_0x2d77be){return client[_0xf164('0xa')](_0x55c606,_0x102fce)[_0xf164('0xb')](function(_0x27156e){logger[_0xf164('0xc')](_0xf164('0xd'),_0x2f712e,_0xf164('0xe'));logger['debug'](_0xf164('0xf'),_0x2f712e,_0xf164('0xe'),JSON[_0xf164('0x10')](_0x27156e));if(_0x27156e[_0xf164('0x11')]){if(_0x27156e[_0xf164('0x11')][_0xf164('0x12')]===0x1f4){logger[_0xf164('0x11')](_0xf164('0xd'),_0x2f712e,_0x27156e[_0xf164('0x11')]['message']);return _0x2d77be(_0x27156e['error'][_0xf164('0x13')]);}logger[_0xf164('0x11')](_0xf164('0xd'),_0x2f712e,_0x27156e[_0xf164('0x11')][_0xf164('0x13')]);return _0x5cf61c(_0x27156e[_0xf164('0x11')][_0xf164('0x13')]);}else{logger['info'](_0xf164('0xd'),_0x2f712e,'request\x20sent');_0x5cf61c(_0x27156e[_0xf164('0x14')]['message']);}})[_0xf164('0x15')](function(_0x2312f1){logger[_0xf164('0x11')](_0xf164('0xd'),_0x2f712e,_0x2312f1);_0x2d77be(_0x2312f1);});});} \ No newline at end of file +var _0x66d5=['jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x34a324,_0xeae68c){var _0x41303c=function(_0x3eaf6a){while(--_0x3eaf6a){_0x34a324['push'](_0x34a324['shift']());}};_0x41303c(++_0xeae68c);}(_0x66d5,0xa0));var _0x566d=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x66d5[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x566d('0x0'));var util=require(_0x566d('0x1'));var moment=require(_0x566d('0x2'));var BPromise=require('bluebird');var rs=require(_0x566d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x566d('0x4'))['db'];var utils=require(_0x566d('0x5'));var logger=require('../../config/logger')(_0x566d('0x6'));var config=require(_0x566d('0x7'));var jayson=require(_0x566d('0x8'));var client=jayson[_0x566d('0x9')][_0x566d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c39d6,_0x4d0eb7,_0x250530){return new BPromise(function(_0x1e7e44,_0x5512ac){return client[_0x566d('0xb')](_0x1c39d6,_0x250530)['then'](function(_0x329e24){logger[_0x566d('0xc')](_0x566d('0xd'),_0x4d0eb7,_0x566d('0xe'));logger['debug'](_0x566d('0xf'),_0x4d0eb7,_0x566d('0xe'),JSON[_0x566d('0x10')](_0x329e24));if(_0x329e24['error']){if(_0x329e24[_0x566d('0x11')]['code']===0x1f4){logger[_0x566d('0x11')]('ZohoField,\x20%s,\x20%s',_0x4d0eb7,_0x329e24[_0x566d('0x11')]['message']);return _0x5512ac(_0x329e24[_0x566d('0x11')][_0x566d('0x12')]);}logger['error'](_0x566d('0xd'),_0x4d0eb7,_0x329e24[_0x566d('0x11')][_0x566d('0x12')]);return _0x1e7e44(_0x329e24[_0x566d('0x11')]['message']);}else{logger[_0x566d('0xc')](_0x566d('0xd'),_0x4d0eb7,_0x566d('0xe'));_0x1e7e44(_0x329e24[_0x566d('0x13')][_0x566d('0x12')]);}})[_0x566d('0x14')](function(_0x311801){logger[_0x566d('0x11')](_0x566d('0xd'),_0x4d0eb7,_0x311801);_0x5512ac(_0x311801);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 0c64ac2..d1c62c2 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(_0x5012f0,_0x177f7d){var _0x2c451e=function(_0x420627){while(--_0x420627){_0x5012f0['push'](_0x5012f0['shift']());}};_0x2c451e(++_0x177f7d);}(_0xe706,0xa3));var _0x6e70=function(_0x3984a6,_0x4adaba){_0x3984a6=_0x3984a6-0x0;var _0x2cc75f=_0xe706[_0x3984a6];return _0x2cc75f;};'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(_0x4072d0,_0x2c84bd){var _0x2fc971=function(_0xf56f8d){while(--_0xf56f8d){_0x4072d0['push'](_0x4072d0['shift']());}};_0x2fc971(++_0x2c84bd);}(_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 9049e1b..348cf23 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 _0x4849=['exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x5aa141,_0x2d6e3a){var _0x446d2f=function(_0x11bb05){while(--_0x11bb05){_0x5aa141['push'](_0x5aa141['shift']());}};_0x446d2f(++_0x2d6e3a);}(_0x4849,0x181));var _0x9484=function(_0x358394,_0x4406a2){_0x358394=_0x358394-0x0;var _0x2d6bec=_0x4849[_0x358394];return _0x2d6bec;};'use strict';var Sequelize=require('sequelize');module[_0x9484('0x0')]={'name':{'type':Sequelize[_0x9484('0x1')],'allowNull':![],'unique':_0x9484('0x2')},'version':{'type':Sequelize[_0x9484('0x1')],'allowNull':![],'unique':_0x9484('0x2')},'main':{'type':Sequelize[_0x9484('0x1')],'defaultValue':_0x9484('0x3')},'filename':{'type':Sequelize[_0x9484('0x1')]},'path':{'type':Sequelize[_0x9484('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9484('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9484('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x9484('0x1')]},'title':{'type':Sequelize[_0x9484('0x1')]},'remoteUri':{'type':Sequelize[_0x9484('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xc3a6=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','STRING'];(function(_0x39b389,_0x59ddfa){var _0x128d70=function(_0x45e1ec){while(--_0x45e1ec){_0x39b389['push'](_0x39b389['shift']());}};_0x128d70(++_0x59ddfa);}(_0xc3a6,0x116));var _0x6c3a=function(_0x29c92d,_0x44f5d9){_0x29c92d=_0x29c92d-0x0;var _0x53e143=_0xc3a6[_0x29c92d];return _0x53e143;};'use strict';var Sequelize=require(_0x6c3a('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c3a('0x1')],'allowNull':![],'unique':_0x6c3a('0x2')},'version':{'type':Sequelize[_0x6c3a('0x1')],'allowNull':![],'unique':_0x6c3a('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x6c3a('0x3')},'filename':{'type':Sequelize[_0x6c3a('0x1')]},'path':{'type':Sequelize[_0x6c3a('0x1')]},'type':{'type':Sequelize[_0x6c3a('0x1')]},'size':{'type':Sequelize[_0x6c3a('0x4')]},'active':{'type':Sequelize[_0x6c3a('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x6c3a('0x1')]},'state':{'type':Sequelize[_0x6c3a('0x1')],'unique':_0x6c3a('0x6')},'description':{'type':Sequelize[_0x6c3a('0x1')]},'title':{'type':Sequelize[_0x6c3a('0x1')]},'remoteUri':{'type':Sequelize[_0x6c3a('0x1')]},'link':{'type':Sequelize[_0x6c3a('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 9f3dbce..784130a 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 _0x2a07=['name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2a07,0x74));var _0x72a0=function(_0xe22f40,_0x3331e2){_0xe22f40=_0xe22f40-0x0;var _0x226c12=_0x2a07[_0xe22f40];return _0x226c12;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['Integration'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));}; \ No newline at end of file +var _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x9536[_0x4c8a8f];return _0x404500;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8d390c9..5fe1cb1 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 _0xa955=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash'];(function(_0x2d88de,_0x4346b7){var _0x410a8c=function(_0x26f6d9){while(--_0x26f6d9){_0x2d88de['push'](_0x2d88de['shift']());}};_0x410a8c(++_0x4346b7);}(_0xa955,0xfc));var _0x5a95=function(_0x508c93,_0x4b53c4){_0x508c93=_0x508c93-0x0;var _0x3e9a86=_0xa955[_0x508c93];return _0x3e9a86;};'use strict';var _=require(_0x5a95('0x0'));var util=require('util');var logger=require(_0x5a95('0x1'))('api');var moment=require(_0x5a95('0x2'));var BPromise=require(_0x5a95('0x3'));var rp=require(_0x5a95('0x4'));var fs=require('fs');var path=require(_0x5a95('0x5'));var rimraf=require('rimraf');var config=require(_0x5a95('0x6'));var attributes=require(_0x5a95('0x7'));module[_0x5a95('0x8')]=function(_0x1ef654,_0x2542ba){return _0x1ef654['define'](_0x5a95('0x9'),attributes,{'tableName':_0x5a95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6287=['integrations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','Integration'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x6287,0x1cf));var _0x7628=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x6287[_0x2fa457];return _0x4f250a;};'use strict';var _=require(_0x7628('0x0'));var util=require(_0x7628('0x1'));var logger=require(_0x7628('0x2'))(_0x7628('0x3'));var moment=require(_0x7628('0x4'));var BPromise=require(_0x7628('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7628('0x6'));var rimraf=require(_0x7628('0x7'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x7628('0x8')]=function(_0x22b096,_0x46102e){return _0x22b096['define'](_0x7628('0x9'),attributes,{'tableName':_0x7628('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index ceedd9a..eb2a35b 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x4975,0x86));var _0x5497=function(_0x5ecbbf,_0xc9291f){_0x5ecbbf=_0x5ecbbf-0x0;var _0x5d1f26=_0x4975[_0x5ecbbf];return _0x5d1f26;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0x524e,0x15e));var _0xe524=function(_0x364804,_0x403b92){_0x364804=_0x364804-0x0;var _0x3231fc=_0x524e[_0x364804];return _0x3231fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 15de16e..406afc8 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(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x27a4d3,_0x40d02d){var _0x45b980=function(_0x38e0f0){while(--_0x38e0f0){_0x27a4d3['push'](_0x27a4d3['shift']());}};_0x45b980(++_0x40d02d);}(_0xba34,0x119));var _0x4ba3=function(_0x11e358,_0x7b3161){_0x11e358=_0x11e358-0x0;var _0x30035a=_0xba34[_0x11e358];return _0x30035a;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('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 4cb85ef..784df82 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 _0xfec6=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x3d9312,_0x3363fc){var _0x3a0a42=function(_0x58cad2){while(--_0x58cad2){_0x3d9312['push'](_0x3d9312['shift']());}};_0x3a0a42(++_0x3363fc);}(_0xfec6,0x1aa));var _0x6fec=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xfec6[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x6fec('0x0'));module[_0x6fec('0x1')]={'integration':{'type':Sequelize[_0x6fec('0x2')]},'eventChannel':{'type':Sequelize[_0x6fec('0x2')]},'exitStatus':{'type':Sequelize[_0x6fec('0x2')]},'ticketId':{'type':Sequelize[_0x6fec('0x2')]},'integrationId':{'type':Sequelize[_0x6fec('0x3')]},'contacts':{'type':Sequelize[_0x6fec('0x2')]},'uniqueid':{'type':Sequelize[_0x6fec('0x2')]},'calleridnum':{'type':Sequelize[_0x6fec('0x2')]},'calleridname':{'type':Sequelize[_0x6fec('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6fec('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6fec('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6fec('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6fec('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x6fec('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6fec('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6fec('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6fec('0x4')]},'agentdump':{'type':Sequelize[_0x6fec('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6fec('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6fec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6fec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6fec('0x2')]},'language':{'type':Sequelize[_0x6fec('0x2')]},'accountcode':{'type':Sequelize[_0x6fec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6fec('0x2')]},'priority':{'type':Sequelize[_0x6fec('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x6fec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6fec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6fec('0x2')]},'destlanguage':{'type':Sequelize[_0x6fec('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6fec('0x2')]},'destexten':{'type':Sequelize[_0x6fec('0x2')]},'destpriority':{'type':Sequelize[_0x6fec('0x2')]},'destuniqueid':{'type':Sequelize[_0x6fec('0x2')]},'messageId':{'type':Sequelize[_0x6fec('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6fec('0x2')]},'from':{'type':Sequelize[_0x6fec('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6fec('0x2')]},'attachment':{'type':Sequelize[_0x6fec('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x6fec('0x6')]},'status':{'type':Sequelize[_0x6fec('0x7')](_0x6fec('0x8'),_0x6fec('0x9'),_0x6fec('0xa'),_0x6fec('0xb'))},'url':{'type':Sequelize[_0x6fec('0x2')]},'app':{'type':Sequelize[_0x6fec('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x6fec('0x3')]}}; \ No newline at end of file +var _0xe552=['TEXT','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x248802,_0x16ea99){var _0x485434=function(_0x425d24){while(--_0x425d24){_0x248802['push'](_0x248802['shift']());}};_0x485434(++_0x16ea99);}(_0xe552,0x15f));var _0x2e55=function(_0x3b58b5,_0x5799ad){_0x3b58b5=_0x3b58b5-0x0;var _0x5d48e6=_0xe552[_0x3b58b5];return _0x5d48e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x2e55('0x0')]},'exitStatus':{'type':Sequelize[_0x2e55('0x0')]},'ticketId':{'type':Sequelize[_0x2e55('0x0')]},'integrationId':{'type':Sequelize[_0x2e55('0x1')]},'contacts':{'type':Sequelize[_0x2e55('0x0')]},'uniqueid':{'type':Sequelize[_0x2e55('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2e55('0x0')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2e55('0x0')]},'membername':{'type':Sequelize[_0x2e55('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x2e55('0x2')]},'holdtime':{'type':Sequelize[_0x2e55('0x1')]},'agentcomplete':{'type':Sequelize[_0x2e55('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x2e55('0x1')]},'agentacw':{'type':Sequelize[_0x2e55('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x2e55('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x2e55('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2e55('0x2')]},'agentdump':{'type':Sequelize[_0x2e55('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2e55('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2e55('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2e55('0x0')]},'connectedlinenum':{'type':Sequelize[_0x2e55('0x0')]},'connectedlinename':{'type':Sequelize[_0x2e55('0x0')]},'language':{'type':Sequelize[_0x2e55('0x0')]},'accountcode':{'type':Sequelize[_0x2e55('0x0')]},'context':{'type':Sequelize[_0x2e55('0x0')]},'exten':{'type':Sequelize[_0x2e55('0x0')]},'priority':{'type':Sequelize[_0x2e55('0x0')]},'destchannel':{'type':Sequelize[_0x2e55('0x0')]},'destchannelstate':{'type':Sequelize[_0x2e55('0x1')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x2e55('0x0')]},'destcalleridname':{'type':Sequelize[_0x2e55('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x2e55('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x2e55('0x0')]},'destlanguage':{'type':Sequelize[_0x2e55('0x0')]},'destaccountcode':{'type':Sequelize[_0x2e55('0x0')]},'destcontext':{'type':Sequelize[_0x2e55('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2e55('0x0')]},'destuniqueid':{'type':Sequelize[_0x2e55('0x0')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x2e55('0x0')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x2e55('0x0')]},'cc':{'type':Sequelize[_0x2e55('0x0')]},'attachment':{'type':Sequelize[_0x2e55('0x4')]},'html':{'type':Sequelize[_0x2e55('0x4')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT','SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0x2e55('0x0')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x2e55('0x0')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 7a0d2ca..5614459 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 _0x9949=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','create','update','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0xd5ed38,_0x1a5ffe){var _0x57ac23=function(_0x156a2d){while(--_0x156a2d){_0xd5ed38['push'](_0xd5ed38['shift']());}};_0x57ac23(++_0x1a5ffe);}(_0x9949,0x127));var _0x9994=function(_0x5199ba,_0x1cc536){_0x5199ba=_0x5199ba-0x0;var _0xdb80f1=_0x9949[_0x5199ba];return _0xdb80f1;};'use strict';var emlformat=require(_0x9994('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9994('0x1'));var jsonpatch=require(_0x9994('0x2'));var rp=require('request-promise');var moment=require(_0x9994('0x3'));var BPromise=require(_0x9994('0x4'));var Mustache=require(_0x9994('0x5'));var util=require(_0x9994('0x6'));var path=require(_0x9994('0x7'));var sox=require(_0x9994('0x8'));var csv=require(_0x9994('0x9'));var ejs=require(_0x9994('0xa'));var fs=require('fs');var fs_extra=require(_0x9994('0xb'));var _=require('lodash');var squel=require(_0x9994('0xc'));var crypto=require(_0x9994('0xd'));var jsforce=require(_0x9994('0xe'));var deskjs=require(_0x9994('0xf'));var toCsv=require(_0x9994('0x9'));var querystring=require('querystring');var Papa=require(_0x9994('0x10'));var Redis=require('ioredis');var authService=require(_0x9994('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9994('0x12'));var hardwareService=require(_0x9994('0x13'));var logger=require(_0x9994('0x14'))('api');var utils=require(_0x9994('0x15'));var config=require(_0x9994('0x16'));var licenseUtil=require(_0x9994('0x17'));var db=require(_0x9994('0x18'))['db'];function respondWithStatusCode(_0x1d0162,_0x433fa2){_0x433fa2=_0x433fa2||0xcc;return function(_0x39ab51){if(_0x39ab51){return _0x1d0162['sendStatus'](_0x433fa2);}return _0x1d0162[_0x9994('0x19')](_0x433fa2)[_0x9994('0x1a')]();};}function respondWithResult(_0x580876,_0x352fdb){_0x352fdb=_0x352fdb||0xc8;return function(_0x51a576){if(_0x51a576){return _0x580876['status'](_0x352fdb)[_0x9994('0x1b')](_0x51a576);}};}function respondWithFilteredResult(_0x404e82,_0x43ec30){return function(_0x4b09c7){if(_0x4b09c7){var _0x557399=typeof _0x43ec30[_0x9994('0x1c')]===_0x9994('0x1d')&&typeof _0x43ec30[_0x9994('0x1e')]==='undefined';var _0x3fe7cd=_0x4b09c7[_0x9994('0x1f')];var _0x5bbc3a=_0x557399?0x0:_0x43ec30['offset'];var _0x25b19a=_0x557399?_0x4b09c7[_0x9994('0x1f')]:_0x43ec30[_0x9994('0x1c')]+_0x43ec30['limit'];var _0x5739a5;if(_0x25b19a>=_0x3fe7cd){_0x25b19a=_0x3fe7cd;_0x5739a5=0xc8;}else{_0x5739a5=0xce;}_0x404e82['status'](_0x5739a5);return _0x404e82[_0x9994('0x20')](_0x9994('0x21'),_0x5bbc3a+'-'+_0x25b19a+'/'+_0x3fe7cd)[_0x9994('0x1b')](_0x4b09c7);}return null;};}function patchUpdates(_0x3abfa2){return function(_0x199fb4){try{jsonpatch[_0x9994('0x22')](_0x199fb4,_0x3abfa2,!![]);}catch(_0x2e5f72){return BPromise[_0x9994('0x23')](_0x2e5f72);}return _0x199fb4[_0x9994('0x24')]();};}function saveUpdates(_0x1e957a,_0x636aeb){return function(_0x14dbcd){if(_0x14dbcd){return _0x14dbcd['update'](_0x1e957a)[_0x9994('0x25')](function(_0x30e607){return _0x30e607;});}return null;};}function removeEntity(_0x2f885f,_0x2a37f7){return function(_0x50b143){if(_0x50b143){return _0x50b143['destroy']()[_0x9994('0x25')](function(){_0x2f885f[_0x9994('0x19')](0xcc)[_0x9994('0x1a')]();});}};}function handleEntityNotFound(_0x136c32,_0x75147f){return function(_0x9b1127){if(!_0x9b1127){_0x136c32[_0x9994('0x26')](0x194);}return _0x9b1127;};}function handleError(_0x257ad3,_0x5af77c){_0x5af77c=_0x5af77c||0x1f4;return function(_0x4b5147){logger[_0x9994('0x27')](_0x4b5147[_0x9994('0x28')]);if(_0x4b5147[_0x9994('0x29')]){delete _0x4b5147[_0x9994('0x29')];}_0x257ad3[_0x9994('0x19')](_0x5af77c)['send'](_0x4b5147);};}exports['index']=function(_0x1127fe,_0x444012){var _0x3c27d1={},_0x123d91={},_0x34a038={'count':0x0,'rows':[]};var _0x4cda30=_[_0x9994('0x2a')](db[_0x9994('0x2b')][_0x9994('0x2c')],function(_0x2ccc12){return{'name':_0x2ccc12[_0x9994('0x2d')],'type':_0x2ccc12[_0x9994('0x2e')][_0x9994('0x2f')]};});_0x123d91[_0x9994('0x30')]=_[_0x9994('0x2a')](_0x4cda30,_0x9994('0x29'));_0x123d91[_0x9994('0x31')]=_[_0x9994('0x32')](_0x1127fe[_0x9994('0x31')]);_0x123d91[_0x9994('0x33')]=_['intersection'](_0x123d91[_0x9994('0x30')],_0x123d91['query']);_0x3c27d1[_0x9994('0x34')]=_[_0x9994('0x35')](_0x123d91[_0x9994('0x30')],qs[_0x9994('0x36')](_0x1127fe[_0x9994('0x31')]['fields']));_0x3c27d1[_0x9994('0x34')]=_0x3c27d1[_0x9994('0x34')][_0x9994('0x37')]?_0x3c27d1['attributes']:_0x123d91[_0x9994('0x30')];if(!_0x1127fe[_0x9994('0x31')][_0x9994('0x38')](_0x9994('0x39'))){_0x3c27d1[_0x9994('0x1e')]=qs[_0x9994('0x1e')](_0x1127fe[_0x9994('0x31')][_0x9994('0x1e')]);_0x3c27d1['offset']=qs[_0x9994('0x1c')](_0x1127fe[_0x9994('0x31')][_0x9994('0x1c')]);}_0x3c27d1[_0x9994('0x3a')]=qs['sort'](_0x1127fe[_0x9994('0x31')][_0x9994('0x3b')]);_0x3c27d1[_0x9994('0x3c')]=qs[_0x9994('0x33')](_[_0x9994('0x3d')](_0x1127fe['query'],_0x123d91[_0x9994('0x33')]),_0x4cda30);if(_0x1127fe[_0x9994('0x31')][_0x9994('0x3e')]){_0x3c27d1[_0x9994('0x3c')]=_[_0x9994('0x3f')](_0x3c27d1[_0x9994('0x3c')],{'$or':_[_0x9994('0x2a')](_0x4cda30,function(_0x41295b){if(_0x41295b[_0x9994('0x2e')]!==_0x9994('0x40')){var _0x5d770b={};_0x5d770b[_0x41295b[_0x9994('0x29')]]={'$like':'%'+_0x1127fe[_0x9994('0x31')][_0x9994('0x3e')]+'%'};return _0x5d770b;}})});}_0x3c27d1=_[_0x9994('0x3f')]({},_0x3c27d1,_0x1127fe[_0x9994('0x41')]);var _0x180818={'where':_0x3c27d1[_0x9994('0x3c')]};return db['IntegrationReport'][_0x9994('0x1f')](_0x180818)[_0x9994('0x25')](function(_0x5ec5a7){_0x34a038['count']=_0x5ec5a7;if(_0x1127fe[_0x9994('0x31')]['includeAll']){_0x3c27d1[_0x9994('0x42')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x3c27d1);})['then'](function(_0x11bbc9){_0x34a038[_0x9994('0x43')]=_0x11bbc9;return _0x34a038;})[_0x9994('0x25')](respondWithFilteredResult(_0x444012,_0x3c27d1))[_0x9994('0x44')](handleError(_0x444012,null));};exports[_0x9994('0x45')]=function(_0x2a3bae,_0x115091){var _0x1d1687={'raw':![],'where':{'id':_0x2a3bae['params']['id']}},_0xc41583={};_0xc41583[_0x9994('0x30')]=_['keys'](db[_0x9994('0x2b')][_0x9994('0x2c')]);_0xc41583[_0x9994('0x31')]=_[_0x9994('0x32')](_0x2a3bae['query']);_0xc41583['filters']=_[_0x9994('0x35')](_0xc41583['model'],_0xc41583[_0x9994('0x31')]);_0x1d1687[_0x9994('0x34')]=_['intersection'](_0xc41583['model'],qs[_0x9994('0x36')](_0x2a3bae[_0x9994('0x31')][_0x9994('0x36')]));_0x1d1687[_0x9994('0x34')]=_0x1d1687[_0x9994('0x34')][_0x9994('0x37')]?_0x1d1687[_0x9994('0x34')]:_0xc41583['model'];if(_0x2a3bae[_0x9994('0x31')]['includeAll']){_0x1d1687[_0x9994('0x42')]=[{'all':!![]}];}_0x1d1687=_[_0x9994('0x3f')]({},_0x1d1687,_0x2a3bae['options']);return db[_0x9994('0x2b')]['find'](_0x1d1687)['then'](handleEntityNotFound(_0x115091,null))[_0x9994('0x25')](respondWithResult(_0x115091,null))[_0x9994('0x44')](handleError(_0x115091,null));};exports[_0x9994('0x46')]=function(_0x446ab8,_0x43bdc1){return db[_0x9994('0x2b')][_0x9994('0x46')](_0x446ab8['body'],{})['then'](respondWithResult(_0x43bdc1,0xc9))[_0x9994('0x44')](handleError(_0x43bdc1,null));};exports[_0x9994('0x47')]=function(_0x1b1ae1,_0x22fedf){if(_0x1b1ae1[_0x9994('0x48')]['id']){delete _0x1b1ae1[_0x9994('0x48')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x1b1ae1[_0x9994('0x49')]['id']}})[_0x9994('0x25')](handleEntityNotFound(_0x22fedf,null))['then'](saveUpdates(_0x1b1ae1[_0x9994('0x48')],null))['then'](respondWithResult(_0x22fedf,null))[_0x9994('0x44')](handleError(_0x22fedf,null));};exports[_0x9994('0x4a')]=function(_0x143ea9,_0x4cd47c){return db[_0x9994('0x2b')]['find']({'where':{'id':_0x143ea9[_0x9994('0x49')]['id']}})['then'](handleEntityNotFound(_0x4cd47c,null))[_0x9994('0x25')](removeEntity(_0x4cd47c,null))[_0x9994('0x44')](handleError(_0x4cd47c,null));};exports['describe']=function(_0xe01636,_0x411c7a){return db[_0x9994('0x2b')][_0x9994('0x4b')]()[_0x9994('0x25')](respondWithResult(_0x411c7a,null))['catch'](handleError(_0x411c7a,null));}; \ No newline at end of file +var _0x5a89=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','pick','merge','where','VIRTUAL','filter','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','options','create','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x1cd7e0,_0x292385){var _0x2b357a=function(_0xf19d61){while(--_0xf19d61){_0x1cd7e0['push'](_0x1cd7e0['shift']());}};_0x2b357a(++_0x292385);}(_0x5a89,0x8b));var _0x95a8=function(_0x52430b,_0x23a3d7){_0x52430b=_0x52430b-0x0;var _0x177178=_0x5a89[_0x52430b];return _0x177178;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x95a8('0x0'));var rp=require(_0x95a8('0x1'));var moment=require(_0x95a8('0x2'));var BPromise=require(_0x95a8('0x3'));var Mustache=require(_0x95a8('0x4'));var util=require(_0x95a8('0x5'));var path=require('path');var sox=require(_0x95a8('0x6'));var csv=require(_0x95a8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95a8('0x8'));var _=require(_0x95a8('0x9'));var squel=require(_0x95a8('0xa'));var crypto=require(_0x95a8('0xb'));var jsforce=require(_0x95a8('0xc'));var deskjs=require(_0x95a8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x95a8('0xe'));var Papa=require(_0x95a8('0xf'));var Redis=require(_0x95a8('0x10'));var authService=require(_0x95a8('0x11'));var qs=require(_0x95a8('0x12'));var as=require(_0x95a8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95a8('0x14'))('api');var utils=require(_0x95a8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x95a8('0x16'));var db=require(_0x95a8('0x17'))['db'];function respondWithStatusCode(_0x2a8907,_0x3b5dba){_0x3b5dba=_0x3b5dba||0xcc;return function(_0x23b1ad){if(_0x23b1ad){return _0x2a8907['sendStatus'](_0x3b5dba);}return _0x2a8907[_0x95a8('0x18')](_0x3b5dba)[_0x95a8('0x19')]();};}function respondWithResult(_0x327a6f,_0x422d1d){_0x422d1d=_0x422d1d||0xc8;return function(_0x1cbd62){if(_0x1cbd62){return _0x327a6f[_0x95a8('0x18')](_0x422d1d)[_0x95a8('0x1a')](_0x1cbd62);}};}function respondWithFilteredResult(_0x3a157b,_0x2a58b1){return function(_0x1042cc){if(_0x1042cc){var _0x5c3c6e=typeof _0x2a58b1[_0x95a8('0x1b')]===_0x95a8('0x1c')&&typeof _0x2a58b1[_0x95a8('0x1d')]==='undefined';var _0x26c273=_0x1042cc[_0x95a8('0x1e')];var _0x262bb7=_0x5c3c6e?0x0:_0x2a58b1[_0x95a8('0x1b')];var _0x3088c2=_0x5c3c6e?_0x1042cc[_0x95a8('0x1e')]:_0x2a58b1['offset']+_0x2a58b1[_0x95a8('0x1d')];var _0x218db5;if(_0x3088c2>=_0x26c273){_0x3088c2=_0x26c273;_0x218db5=0xc8;}else{_0x218db5=0xce;}_0x3a157b[_0x95a8('0x18')](_0x218db5);return _0x3a157b[_0x95a8('0x1f')](_0x95a8('0x20'),_0x262bb7+'-'+_0x3088c2+'/'+_0x26c273)['json'](_0x1042cc);}return null;};}function patchUpdates(_0x5104d3){return function(_0x5996cf){try{jsonpatch[_0x95a8('0x21')](_0x5996cf,_0x5104d3,!![]);}catch(_0x22b143){return BPromise[_0x95a8('0x22')](_0x22b143);}return _0x5996cf[_0x95a8('0x23')]();};}function saveUpdates(_0xcd4062,_0x5e2eef){return function(_0x4e646d){if(_0x4e646d){return _0x4e646d[_0x95a8('0x24')](_0xcd4062)[_0x95a8('0x25')](function(_0x1a5cda){return _0x1a5cda;});}return null;};}function removeEntity(_0x570571,_0x574ea2){return function(_0x14e465){if(_0x14e465){return _0x14e465[_0x95a8('0x26')]()[_0x95a8('0x25')](function(){_0x570571[_0x95a8('0x18')](0xcc)[_0x95a8('0x19')]();});}};}function handleEntityNotFound(_0x21f53b,_0x4d47f9){return function(_0x5b485b){if(!_0x5b485b){_0x21f53b[_0x95a8('0x27')](0x194);}return _0x5b485b;};}function handleError(_0x556bf8,_0x537795){_0x537795=_0x537795||0x1f4;return function(_0x4bae7c){logger[_0x95a8('0x28')](_0x4bae7c[_0x95a8('0x29')]);if(_0x4bae7c['name']){delete _0x4bae7c[_0x95a8('0x2a')];}_0x556bf8['status'](_0x537795)['send'](_0x4bae7c);};}exports['index']=function(_0x41d994,_0x4b3341){var _0x1fe1ec={},_0x1c7301={},_0x361699={'count':0x0,'rows':[]};var _0x3fe74f=_[_0x95a8('0x2b')](db['IntegrationReport']['rawAttributes'],function(_0x4fa382){return{'name':_0x4fa382['fieldName'],'type':_0x4fa382[_0x95a8('0x2c')][_0x95a8('0x2d')]};});_0x1c7301[_0x95a8('0x2e')]=_[_0x95a8('0x2b')](_0x3fe74f,_0x95a8('0x2a'));_0x1c7301[_0x95a8('0x2f')]=_['keys'](_0x41d994['query']);_0x1c7301[_0x95a8('0x30')]=_[_0x95a8('0x31')](_0x1c7301[_0x95a8('0x2e')],_0x1c7301[_0x95a8('0x2f')]);_0x1fe1ec[_0x95a8('0x32')]=_[_0x95a8('0x31')](_0x1c7301[_0x95a8('0x2e')],qs[_0x95a8('0x33')](_0x41d994[_0x95a8('0x2f')][_0x95a8('0x33')]));_0x1fe1ec['attributes']=_0x1fe1ec[_0x95a8('0x32')]['length']?_0x1fe1ec[_0x95a8('0x32')]:_0x1c7301[_0x95a8('0x2e')];if(!_0x41d994[_0x95a8('0x2f')]['hasOwnProperty'](_0x95a8('0x34'))){_0x1fe1ec[_0x95a8('0x1d')]=qs[_0x95a8('0x1d')](_0x41d994[_0x95a8('0x2f')][_0x95a8('0x1d')]);_0x1fe1ec[_0x95a8('0x1b')]=qs[_0x95a8('0x1b')](_0x41d994[_0x95a8('0x2f')]['offset']);}_0x1fe1ec['order']=qs[_0x95a8('0x35')](_0x41d994['query'][_0x95a8('0x35')]);_0x1fe1ec['where']=qs[_0x95a8('0x30')](_[_0x95a8('0x36')](_0x41d994[_0x95a8('0x2f')],_0x1c7301[_0x95a8('0x30')]),_0x3fe74f);if(_0x41d994['query']['filter']){_0x1fe1ec['where']=_[_0x95a8('0x37')](_0x1fe1ec[_0x95a8('0x38')],{'$or':_[_0x95a8('0x2b')](_0x3fe74f,function(_0x4aab70){if(_0x4aab70['type']!==_0x95a8('0x39')){var _0x1a50ef={};_0x1a50ef[_0x4aab70[_0x95a8('0x2a')]]={'$like':'%'+_0x41d994[_0x95a8('0x2f')][_0x95a8('0x3a')]+'%'};return _0x1a50ef;}})});}_0x1fe1ec=_[_0x95a8('0x37')]({},_0x1fe1ec,_0x41d994['options']);var _0x1ecaaa={'where':_0x1fe1ec[_0x95a8('0x38')]};return db[_0x95a8('0x3b')][_0x95a8('0x1e')](_0x1ecaaa)[_0x95a8('0x25')](function(_0x20e204){_0x361699[_0x95a8('0x1e')]=_0x20e204;if(_0x41d994[_0x95a8('0x2f')][_0x95a8('0x3c')]){_0x1fe1ec[_0x95a8('0x3d')]=[{'all':!![]}];}return db[_0x95a8('0x3b')][_0x95a8('0x3e')](_0x1fe1ec);})[_0x95a8('0x25')](function(_0x24289d){_0x361699[_0x95a8('0x3f')]=_0x24289d;return _0x361699;})[_0x95a8('0x25')](respondWithFilteredResult(_0x4b3341,_0x1fe1ec))[_0x95a8('0x40')](handleError(_0x4b3341,null));};exports[_0x95a8('0x41')]=function(_0xb640bb,_0x5444d2){var _0x5dabd1={'raw':![],'where':{'id':_0xb640bb[_0x95a8('0x42')]['id']}},_0x15fe0d={};_0x15fe0d[_0x95a8('0x2e')]=_['keys'](db[_0x95a8('0x3b')][_0x95a8('0x43')]);_0x15fe0d[_0x95a8('0x2f')]=_[_0x95a8('0x44')](_0xb640bb[_0x95a8('0x2f')]);_0x15fe0d[_0x95a8('0x30')]=_[_0x95a8('0x31')](_0x15fe0d[_0x95a8('0x2e')],_0x15fe0d[_0x95a8('0x2f')]);_0x5dabd1['attributes']=_['intersection'](_0x15fe0d[_0x95a8('0x2e')],qs[_0x95a8('0x33')](_0xb640bb['query'][_0x95a8('0x33')]));_0x5dabd1['attributes']=_0x5dabd1[_0x95a8('0x32')][_0x95a8('0x45')]?_0x5dabd1[_0x95a8('0x32')]:_0x15fe0d[_0x95a8('0x2e')];if(_0xb640bb['query'][_0x95a8('0x3c')]){_0x5dabd1[_0x95a8('0x3d')]=[{'all':!![]}];}_0x5dabd1=_[_0x95a8('0x37')]({},_0x5dabd1,_0xb640bb[_0x95a8('0x46')]);return db[_0x95a8('0x3b')]['find'](_0x5dabd1)[_0x95a8('0x25')](handleEntityNotFound(_0x5444d2,null))[_0x95a8('0x25')](respondWithResult(_0x5444d2,null))[_0x95a8('0x40')](handleError(_0x5444d2,null));};exports[_0x95a8('0x47')]=function(_0x1ed738,_0xaa7873){return db[_0x95a8('0x3b')][_0x95a8('0x47')](_0x1ed738['body'],{})[_0x95a8('0x25')](respondWithResult(_0xaa7873,0xc9))[_0x95a8('0x40')](handleError(_0xaa7873,null));};exports['update']=function(_0x37664b,_0x56dee2){if(_0x37664b['body']['id']){delete _0x37664b['body']['id'];}return db[_0x95a8('0x3b')][_0x95a8('0x48')]({'where':{'id':_0x37664b[_0x95a8('0x42')]['id']}})[_0x95a8('0x25')](handleEntityNotFound(_0x56dee2,null))[_0x95a8('0x25')](saveUpdates(_0x37664b['body'],null))['then'](respondWithResult(_0x56dee2,null))[_0x95a8('0x40')](handleError(_0x56dee2,null));};exports[_0x95a8('0x26')]=function(_0x4d21c3,_0x5d9c82){return db[_0x95a8('0x3b')][_0x95a8('0x48')]({'where':{'id':_0x4d21c3[_0x95a8('0x42')]['id']}})[_0x95a8('0x25')](handleEntityNotFound(_0x5d9c82,null))['then'](removeEntity(_0x5d9c82,null))[_0x95a8('0x40')](handleError(_0x5d9c82,null));};exports['describe']=function(_0x25e2b8,_0x4e48d7){return db[_0x95a8('0x3b')]['describe']()[_0x95a8('0x25')](respondWithResult(_0x4e48d7,null))[_0x95a8('0x40')](handleError(_0x4e48d7,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index fc6840f..6b61b83 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 _0xcca4=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xcca4,0x12b));var _0x4cca=function(_0x36ad09,_0x2c290d){_0x36ad09=_0x36ad09-0x0;var _0x2ae9db=_0xcca4[_0x36ad09];return _0x2ae9db;};'use strict';var _=require(_0x4cca('0x0'));var util=require(_0x4cca('0x1'));var logger=require(_0x4cca('0x2'))(_0x4cca('0x3'));var moment=require(_0x4cca('0x4'));var BPromise=require('bluebird');var rp=require(_0x4cca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cca('0x6'));var config=require(_0x4cca('0x7'));var attributes=require(_0x4cca('0x8'));module[_0x4cca('0x9')]=function(_0x15fbb1,_0x58ff00){return _0x15fbb1[_0x4cca('0xa')](_0x4cca('0xb'),attributes,{'tableName':_0x4cca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67e1=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util'];(function(_0x233b26,_0x113df9){var _0x2a64a2=function(_0x2b1f1f){while(--_0x2b1f1f){_0x233b26['push'](_0x233b26['shift']());}};_0x2a64a2(++_0x113df9);}(_0x67e1,0x1b8));var _0x167e=function(_0x58e610,_0x30ecbe){_0x58e610=_0x58e610-0x0;var _0x1e10a1=_0x67e1[_0x58e610];return _0x1e10a1;};'use strict';var _=require(_0x167e('0x0'));var util=require(_0x167e('0x1'));var logger=require(_0x167e('0x2'))(_0x167e('0x3'));var moment=require('moment');var BPromise=require(_0x167e('0x4'));var rp=require(_0x167e('0x5'));var fs=require('fs');var path=require(_0x167e('0x6'));var rimraf=require(_0x167e('0x7'));var config=require(_0x167e('0x8'));var attributes=require(_0x167e('0x9'));module[_0x167e('0xa')]=function(_0x12e73f,_0x88f9f2){return _0x12e73f[_0x167e('0xb')](_0x167e('0xc'),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 46e8db9..a9cbcb5 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc2c7,0x134));var _0x7c2c=function(_0x45f0d7,_0x3b7077){_0x45f0d7=_0x45f0d7-0x0;var _0x15b853=_0xc2c7[_0x45f0d7];return _0x15b853;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2c8abf,_0x4334ee){var _0x1b4f83=function(_0x55c338){while(--_0x55c338){_0x2c8abf['push'](_0x2c8abf['shift']());}};_0x1b4f83(++_0x4334ee);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xc4aa[_0x45d55e];return _0x29812a;};'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')]('IntegrationReport,\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/interval/index.js b/server/api/interval/index.js index 98b8f8e..becdd5c 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 _0xcf30=['show','post','create','/:id/sub_intervals','addInterval','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./interval.controller','get','/:id','isAuthenticated'];(function(_0x56a1f1,_0x1ed556){var _0x29d489=function(_0x192017){while(--_0x192017){_0x56a1f1['push'](_0x56a1f1['shift']());}};_0x29d489(++_0x1ed556);}(_0xcf30,0x128));var _0x0cf3=function(_0x32c590,_0x430bc7){_0x32c590=_0x32c590-0x0;var _0x9b74f6=_0xcf30[_0x32c590];return _0x9b74f6;};'use strict';var multer=require(_0x0cf3('0x0'));var util=require(_0x0cf3('0x1'));var path=require(_0x0cf3('0x2'));var timeout=require(_0x0cf3('0x3'));var express=require('express');var router=express[_0x0cf3('0x4')]();var fs_extra=require(_0x0cf3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0cf3('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0cf3('0x7')](_0x0cf3('0x8'),auth[_0x0cf3('0x9')](),controller[_0x0cf3('0xa')]);router[_0x0cf3('0x7')]('/:id/sub_intervals',auth[_0x0cf3('0x9')](),controller['getIntervals']);router[_0x0cf3('0xb')]('/',auth[_0x0cf3('0x9')](),controller[_0x0cf3('0xc')]);router[_0x0cf3('0xb')](_0x0cf3('0xd'),auth[_0x0cf3('0x9')](),controller[_0x0cf3('0xe')]);router[_0x0cf3('0xb')]('/:id/sub_intervals/create_many',auth[_0x0cf3('0x9')](),controller['addIntervals']);router['put']('/:id',auth[_0x0cf3('0x9')](),controller[_0x0cf3('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0cf3('0x10')]);module[_0x0cf3('0x11')]=router; \ No newline at end of file +var _0x229a=['post','/:id/sub_intervals/create_many','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','create'];(function(_0x585f40,_0x4a3091){var _0x44fc86=function(_0x5bcedc){while(--_0x5bcedc){_0x585f40['push'](_0x585f40['shift']());}};_0x44fc86(++_0x4a3091);}(_0x229a,0x1ea));var _0xa229=function(_0x441884,_0x4e546a){_0x441884=_0x441884-0x0;var _0x18ca7f=_0x229a[_0x441884];return _0x18ca7f;};'use strict';var multer=require(_0xa229('0x0'));var util=require(_0xa229('0x1'));var path=require(_0xa229('0x2'));var timeout=require(_0xa229('0x3'));var express=require(_0xa229('0x4'));var router=express[_0xa229('0x5')]();var fs_extra=require(_0xa229('0x6'));var auth=require(_0xa229('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa229('0x8'));var controller=require('./interval.controller');router[_0xa229('0x9')]('/',auth[_0xa229('0xa')](),controller[_0xa229('0xb')]);router[_0xa229('0x9')]('/:id',auth[_0xa229('0xa')](),controller[_0xa229('0xc')]);router[_0xa229('0x9')](_0xa229('0xd'),auth['isAuthenticated'](),controller[_0xa229('0xe')]);router['post']('/',auth[_0xa229('0xa')](),controller[_0xa229('0xf')]);router[_0xa229('0x10')](_0xa229('0xd'),auth[_0xa229('0xa')](),controller['addInterval']);router[_0xa229('0x10')](_0xa229('0x11'),auth[_0xa229('0xa')](),controller['addIntervals']);router['put'](_0xa229('0x12'),auth[_0xa229('0xa')](),controller[_0xa229('0x13')]);router[_0xa229('0x14')](_0xa229('0x12'),auth[_0xa229('0xa')](),controller[_0xa229('0x15')]);module[_0xa229('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index dba08ae..d444415 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 _0xf8d9=['exports','STRING','sequelize'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0xf8d9,0x1c7));var _0x9f8d=function(_0x340e24,_0xde71e){_0x340e24=_0x340e24-0x0;var _0x1808a=_0xf8d9[_0x340e24];return _0x1808a;};'use strict';var Sequelize=require(_0x9f8d('0x0'));module[_0x9f8d('0x1')]={'name':{'type':Sequelize[_0x9f8d('0x2')]},'description':{'type':Sequelize[_0x9f8d('0x2')]},'interval':{'type':Sequelize[_0x9f8d('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xb1c8=['STRING'];(function(_0x2c83c3,_0x2fb223){var _0x4fafb4=function(_0x334ba1){while(--_0x334ba1){_0x2c83c3['push'](_0x2c83c3['shift']());}};_0x4fafb4(++_0x2fb223);}(_0xb1c8,0xc1));var _0x8b1c=function(_0x37d3f3,_0xca010f){_0x37d3f3=_0x37d3f3-0x0;var _0x185c9c=_0xb1c8[_0x37d3f3];return _0x185c9c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8b1c('0x0')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8b1c('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 2a89b2b..8f5b134 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 _0xb600=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','sort','addIntervals','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','count','findAll','rows','params','includeAll','options'];(function(_0x1e271f,_0xf14504){var _0x2b2ac5=function(_0x21c3b6){while(--_0x21c3b6){_0x1e271f['push'](_0x1e271f['shift']());}};_0x2b2ac5(++_0xf14504);}(_0xb600,0x130));var _0x0b60=function(_0x45b1b3,_0x224dce){_0x45b1b3=_0x45b1b3-0x0;var _0x8f20cc=_0xb600[_0x45b1b3];return _0x8f20cc;};'use strict';var emlformat=require(_0x0b60('0x0'));var rimraf=require(_0x0b60('0x1'));var zipdir=require(_0x0b60('0x2'));var jsonpatch=require(_0x0b60('0x3'));var rp=require(_0x0b60('0x4'));var moment=require(_0x0b60('0x5'));var BPromise=require(_0x0b60('0x6'));var Mustache=require('mustache');var util=require(_0x0b60('0x7'));var path=require('path');var sox=require(_0x0b60('0x8'));var csv=require('to-csv');var ejs=require(_0x0b60('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b60('0xa'));var squel=require(_0x0b60('0xb'));var crypto=require('crypto');var jsforce=require(_0x0b60('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0b60('0xd'));var querystring=require(_0x0b60('0xe'));var Papa=require(_0x0b60('0xf'));var Redis=require(_0x0b60('0x10'));var authService=require(_0x0b60('0x11'));var qs=require(_0x0b60('0x12'));var as=require(_0x0b60('0x13'));var hardwareService=require(_0x0b60('0x14'));var logger=require('../../config/logger')(_0x0b60('0x15'));var utils=require(_0x0b60('0x16'));var config=require(_0x0b60('0x17'));var licenseUtil=require(_0x0b60('0x18'));var db=require(_0x0b60('0x19'))['db'];var extensions=require(_0x0b60('0x1a'));function respondWithStatusCode(_0x920f00,_0x5c714b){_0x5c714b=_0x5c714b||0xcc;return function(_0xe683ad){if(_0xe683ad){return _0x920f00['sendStatus'](_0x5c714b);}return _0x920f00[_0x0b60('0x1b')](_0x5c714b)[_0x0b60('0x1c')]();};}function respondWithResult(_0x4785c8,_0x2d4c7a){_0x2d4c7a=_0x2d4c7a||0xc8;return function(_0x1a399d){if(_0x1a399d){return _0x4785c8[_0x0b60('0x1b')](_0x2d4c7a)[_0x0b60('0x1d')](_0x1a399d);}};}function respondWithFilteredResult(_0x16c4ea,_0x5a9cea){return function(_0x5dc48b){if(_0x5dc48b){var _0x47248c=typeof _0x5a9cea[_0x0b60('0x1e')]===_0x0b60('0x1f')&&typeof _0x5a9cea[_0x0b60('0x20')]===_0x0b60('0x1f');var _0x1ed9b5=_0x5dc48b['count'];var _0x24bf8d=_0x47248c?0x0:_0x5a9cea['offset'];var _0x27212f=_0x47248c?_0x5dc48b['count']:_0x5a9cea[_0x0b60('0x1e')]+_0x5a9cea[_0x0b60('0x20')];var _0x5c3021;if(_0x27212f>=_0x1ed9b5){_0x27212f=_0x1ed9b5;_0x5c3021=0xc8;}else{_0x5c3021=0xce;}_0x16c4ea[_0x0b60('0x1b')](_0x5c3021);return _0x16c4ea[_0x0b60('0x21')](_0x0b60('0x22'),_0x24bf8d+'-'+_0x27212f+'/'+_0x1ed9b5)[_0x0b60('0x1d')](_0x5dc48b);}return null;};}function patchUpdates(_0x560312){return function(_0x4e0860){try{jsonpatch[_0x0b60('0x23')](_0x4e0860,_0x560312,!![]);}catch(_0x479e4e){return BPromise[_0x0b60('0x24')](_0x479e4e);}return _0x4e0860[_0x0b60('0x25')]();};}function saveUpdates(_0x597634,_0x194b58){return function(_0x4c6fee){if(_0x4c6fee){return _0x4c6fee[_0x0b60('0x26')](_0x597634)['then'](function(_0x40bc8f){return _0x40bc8f;});}return null;};}function removeEntity(_0x3ee2d6,_0x36f6a0){return function(_0x13f8db){if(_0x13f8db){return _0x13f8db[_0x0b60('0x27')]()['then'](function(){var _0x359810=_0x13f8db[_0x0b60('0x28')]({'plain':!![]});var _0x1920cd='Intervals';return db[_0x0b60('0x29')][_0x0b60('0x27')]({'where':{'type':_0x1920cd,'resourceId':_0x359810['id']}})[_0x0b60('0x2a')](function(){return _0x13f8db;});})[_0x0b60('0x2a')](function(){_0x3ee2d6[_0x0b60('0x1b')](0xcc)[_0x0b60('0x1c')]();});}};}function handleEntityNotFound(_0x4833da,_0x1fb23d){return function(_0x291507){if(!_0x291507){_0x4833da[_0x0b60('0x2b')](0x194);}return _0x291507;};}function handleError(_0x1c359e,_0x12a2f0){_0x12a2f0=_0x12a2f0||0x1f4;return function(_0x3f9b2d){logger[_0x0b60('0x2c')](_0x3f9b2d[_0x0b60('0x2d')]);if(_0x3f9b2d[_0x0b60('0x2e')]){delete _0x3f9b2d[_0x0b60('0x2e')];}_0x1c359e['status'](_0x12a2f0)['send'](_0x3f9b2d);};}exports[_0x0b60('0x2f')]=function(_0xe9ae0d,_0x4b9da1){var _0x1ab3bb={},_0x57acc9={},_0x55f02e={'count':0x0,'rows':[]};var _0x1182f6=_[_0x0b60('0x30')](db[_0x0b60('0x31')][_0x0b60('0x32')],function(_0x4c73c8){return{'name':_0x4c73c8[_0x0b60('0x33')],'type':_0x4c73c8[_0x0b60('0x34')][_0x0b60('0x35')]};});_0x57acc9[_0x0b60('0x36')]=_[_0x0b60('0x30')](_0x1182f6,_0x0b60('0x2e'));_0x57acc9[_0x0b60('0x37')]=_[_0x0b60('0x38')](_0xe9ae0d[_0x0b60('0x37')]);_0x57acc9[_0x0b60('0x39')]=_[_0x0b60('0x3a')](_0x57acc9['model'],_0x57acc9[_0x0b60('0x37')]);_0x1ab3bb[_0x0b60('0x3b')]=_[_0x0b60('0x3a')](_0x57acc9[_0x0b60('0x36')],qs['fields'](_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x3c')]));_0x1ab3bb[_0x0b60('0x3b')]=_0x1ab3bb[_0x0b60('0x3b')][_0x0b60('0x3d')]?_0x1ab3bb[_0x0b60('0x3b')]:_0x57acc9['model'];if(!_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x3e')](_0x0b60('0x3f'))){_0x1ab3bb[_0x0b60('0x20')]=qs[_0x0b60('0x20')](_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x20')]);_0x1ab3bb[_0x0b60('0x1e')]=qs['offset'](_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x1e')]);}_0x1ab3bb[_0x0b60('0x40')]=qs['sort'](_0xe9ae0d[_0x0b60('0x37')]['sort']);_0x1ab3bb[_0x0b60('0x41')]=qs[_0x0b60('0x39')](_[_0x0b60('0x42')](_0xe9ae0d[_0x0b60('0x37')],_0x57acc9[_0x0b60('0x39')]),_0x1182f6);if(_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x43')]){_0x1ab3bb[_0x0b60('0x41')]=_[_0x0b60('0x44')](_0x1ab3bb[_0x0b60('0x41')],{'$or':_['map'](_0x1182f6,function(_0x3a91ce){if(_0x3a91ce[_0x0b60('0x34')]!==_0x0b60('0x45')){var _0x2d2a08={};_0x2d2a08[_0x3a91ce[_0x0b60('0x2e')]]={'$like':'%'+_0xe9ae0d[_0x0b60('0x37')][_0x0b60('0x43')]+'%'};return _0x2d2a08;}})});}_0x1ab3bb=_[_0x0b60('0x44')]({},_0x1ab3bb,_0xe9ae0d['options']);var _0x4d1166={'where':_0x1ab3bb[_0x0b60('0x41')]};return db['Interval'][_0x0b60('0x46')](_0x4d1166)['then'](function(_0x5e4029){_0x55f02e[_0x0b60('0x46')]=_0x5e4029;if(_0xe9ae0d[_0x0b60('0x37')]['includeAll']){_0x1ab3bb['include']=[{'all':!![]}];}return db[_0x0b60('0x31')][_0x0b60('0x47')](_0x1ab3bb);})[_0x0b60('0x2a')](function(_0x5765d2){_0x55f02e[_0x0b60('0x48')]=_0x5765d2;return _0x55f02e;})[_0x0b60('0x2a')](respondWithFilteredResult(_0x4b9da1,_0x1ab3bb))['catch'](handleError(_0x4b9da1,null));};exports['show']=function(_0x5748db,_0x48b799){var _0x54b467={'raw':!![],'where':{'id':_0x5748db[_0x0b60('0x49')]['id']}},_0x3fef53={};_0x3fef53[_0x0b60('0x36')]=_[_0x0b60('0x38')](db['Interval']['rawAttributes']);_0x3fef53[_0x0b60('0x37')]=_[_0x0b60('0x38')](_0x5748db['query']);_0x3fef53[_0x0b60('0x39')]=_[_0x0b60('0x3a')](_0x3fef53[_0x0b60('0x36')],_0x3fef53[_0x0b60('0x37')]);_0x54b467['attributes']=_[_0x0b60('0x3a')](_0x3fef53['model'],qs[_0x0b60('0x3c')](_0x5748db[_0x0b60('0x37')]['fields']));_0x54b467[_0x0b60('0x3b')]=_0x54b467['attributes'][_0x0b60('0x3d')]?_0x54b467[_0x0b60('0x3b')]:_0x3fef53[_0x0b60('0x36')];if(_0x5748db[_0x0b60('0x37')][_0x0b60('0x4a')]){_0x54b467['include']=[{'all':!![]}];}_0x54b467=_[_0x0b60('0x44')]({},_0x54b467,_0x5748db[_0x0b60('0x4b')]);return db[_0x0b60('0x31')][_0x0b60('0x4c')](_0x54b467)[_0x0b60('0x2a')](handleEntityNotFound(_0x48b799,null))['then'](respondWithResult(_0x48b799,null))['catch'](handleError(_0x48b799,null));};exports[_0x0b60('0x4d')]=function(_0x3680e5,_0x257185){return db[_0x0b60('0x31')][_0x0b60('0x4d')](_0x3680e5['body'],{})[_0x0b60('0x2a')](function(_0x5c8574){var _0x2ce38f=_0x3680e5[_0x0b60('0x4e')][_0x0b60('0x28')]({'plain':!![]});if(!_0x2ce38f)throw new Error(_0x0b60('0x4f'));if(_0x2ce38f[_0x0b60('0x50')]===_0x0b60('0x4e')){var _0x88e71=_0x5c8574['get']({'plain':!![]});var _0x3a22dd=_0x0b60('0x51');return db[_0x0b60('0x52')][_0x0b60('0x4c')]({'where':{'name':_0x3a22dd,'userProfileId':_0x2ce38f['userProfileId']},'raw':!![]})[_0x0b60('0x2a')](function(_0x22dbbf){if(_0x22dbbf&&_0x22dbbf[_0x0b60('0x53')]===0x0){return db[_0x0b60('0x29')]['create']({'name':_0x88e71['name'],'resourceId':_0x88e71['id'],'type':_0x22dbbf[_0x0b60('0x2e')],'sectionId':_0x22dbbf['id']},{})[_0x0b60('0x2a')](function(){return _0x5c8574;});}else{return _0x5c8574;}})[_0x0b60('0x54')](function(_0x40123b){logger[_0x0b60('0x2c')](_0x0b60('0x55'),_0x40123b);throw _0x40123b;});}return _0x5c8574;})[_0x0b60('0x2a')](respondWithResult(_0x257185,0xc9))[_0x0b60('0x54')](handleError(_0x257185,null));};exports[_0x0b60('0x26')]=function(_0x240c68,_0x1022a4){if(_0x240c68[_0x0b60('0x56')]['id']){delete _0x240c68[_0x0b60('0x56')]['id'];}return db['Interval'][_0x0b60('0x4c')]({'where':{'id':_0x240c68[_0x0b60('0x49')]['id']}})[_0x0b60('0x2a')](handleEntityNotFound(_0x1022a4,null))[_0x0b60('0x2a')](saveUpdates(_0x240c68[_0x0b60('0x56')],null))[_0x0b60('0x2a')](respondWithResult(_0x1022a4,null))['catch'](handleError(_0x1022a4,null));};exports[_0x0b60('0x27')]=function(_0x42445f,_0x4c2d45){return db[_0x0b60('0x31')][_0x0b60('0x4c')]({'where':{'id':_0x42445f['params']['id']}})[_0x0b60('0x2a')](handleEntityNotFound(_0x4c2d45,null))[_0x0b60('0x2a')](removeEntity(_0x4c2d45,null))[_0x0b60('0x54')](handleError(_0x4c2d45,null));};exports[_0x0b60('0x57')]=function(_0x263be4,_0x4e9ad8,_0x1076c6){if(_0x263be4[_0x0b60('0x56')]['id']){delete _0x263be4['body']['id'];}return db[_0x0b60('0x31')][_0x0b60('0x4c')]({'where':{'id':_0x263be4['params']['id']}})['then'](handleEntityNotFound(_0x4e9ad8,null))[_0x0b60('0x2a')](function(_0x517e91){if(_0x517e91){_0x263be4['body'][_0x0b60('0x58')]=_0x517e91['id'];return db['Interval'][_0x0b60('0x4d')](_0x263be4[_0x0b60('0x56')]);}})[_0x0b60('0x2a')](respondWithResult(_0x4e9ad8,null))[_0x0b60('0x54')](handleError(_0x4e9ad8,null));};exports[_0x0b60('0x59')]=function(_0x5b3596,_0x2adf15,_0x5ceeba){var _0x325e48={};var _0x157e6a={};var _0x4b19fd;var _0x26a8ee;return db['Interval'][_0x0b60('0x5a')]({'where':{'id':_0x5b3596['params']['id']}})[_0x0b60('0x2a')](handleEntityNotFound(_0x2adf15,null))[_0x0b60('0x2a')](function(_0x4964c0){if(_0x4964c0){_0x4b19fd=_0x4964c0;_0x157e6a[_0x0b60('0x36')]=_['keys'](db['Interval'][_0x0b60('0x32')]);_0x157e6a[_0x0b60('0x37')]=_[_0x0b60('0x38')](_0x5b3596[_0x0b60('0x37')]);_0x157e6a[_0x0b60('0x39')]=_[_0x0b60('0x3a')](_0x157e6a[_0x0b60('0x36')],_0x157e6a['query']);_0x325e48['attributes']=_['intersection'](_0x157e6a[_0x0b60('0x36')],qs[_0x0b60('0x3c')](_0x5b3596[_0x0b60('0x37')][_0x0b60('0x3c')]));_0x325e48[_0x0b60('0x3b')]=_0x325e48[_0x0b60('0x3b')]['length']?_0x325e48['attributes']:_0x157e6a[_0x0b60('0x36')];_0x325e48[_0x0b60('0x40')]=qs[_0x0b60('0x5b')](_0x5b3596[_0x0b60('0x37')][_0x0b60('0x5b')]);_0x325e48['where']=qs[_0x0b60('0x39')](_['pick'](_0x5b3596['query'],_0x157e6a[_0x0b60('0x39')]));if(_0x5b3596[_0x0b60('0x37')][_0x0b60('0x43')]){_0x325e48[_0x0b60('0x41')]=_[_0x0b60('0x44')](_0x325e48[_0x0b60('0x41')],{'$or':_[_0x0b60('0x30')](_0x325e48[_0x0b60('0x3b')],function(_0x2c26d2){var _0x592373={};_0x592373[_0x2c26d2]={'$like':'%'+_0x5b3596[_0x0b60('0x37')]['filter']+'%'};return _0x592373;})});}_0x325e48=_[_0x0b60('0x44')]({},_0x325e48,_0x5b3596[_0x0b60('0x4b')]);return _0x4b19fd['getIntervals'](_0x325e48);}})[_0x0b60('0x2a')](function(_0x237d13){if(_0x237d13){_0x26a8ee=_0x237d13['length'];if(!_0x5b3596[_0x0b60('0x37')][_0x0b60('0x3e')](_0x0b60('0x3f'))){_0x325e48[_0x0b60('0x20')]=qs[_0x0b60('0x20')](_0x5b3596[_0x0b60('0x37')]['limit']);_0x325e48['offset']=qs[_0x0b60('0x1e')](_0x5b3596[_0x0b60('0x37')]['offset']);}return _0x4b19fd[_0x0b60('0x59')](_0x325e48);}})[_0x0b60('0x2a')](function(_0x3631b2){if(_0x3631b2){return _0x3631b2?{'count':_0x26a8ee,'rows':_0x3631b2}:null;}})['then'](respondWithResult(_0x2adf15,null))[_0x0b60('0x54')](handleError(_0x2adf15,null));};exports[_0x0b60('0x5c')]=function(_0x226dcc,_0xfc01f2,_0x4dad34){return db[_0x0b60('0x31')][_0x0b60('0x5a')]({'where':{'id':_0x226dcc['params']['id']}})[_0x0b60('0x2a')](handleEntityNotFound(_0xfc01f2,null))['then'](function(_0x144f3b){if(_0x144f3b){return db[_0x0b60('0x5d')]['transaction'](function(_0x238165){return db[_0x0b60('0x31')][_0x0b60('0x27')]({'where':{'IntervalId':_0x226dcc[_0x0b60('0x49')]['id']},'transaction':_0x238165})['then'](function(_0x249393){var _0x4d7525=_[_0x0b60('0x30')](_0x226dcc[_0x0b60('0x56')],function(_0x4b40f4){delete _0x4b40f4['id'];_0x4b40f4[_0x0b60('0x58')]=_0x226dcc[_0x0b60('0x49')]['id'];return _0x4b40f4;});return db['Interval'][_0x0b60('0x5e')](_0x4d7525,{'transaction':_0x238165});});})['then'](function(){return db[_0x0b60('0x31')][_0x0b60('0x47')]({'where':{'IntervalId':_0x226dcc[_0x0b60('0x49')]['id']}});});}})[_0x0b60('0x2a')](respondWithResult(_0xfc01f2,null))['catch'](handleError(_0xfc01f2,null));}; \ No newline at end of file +var _0x7fe9=['filter','merge','VIRTUAL','options','include','findAll','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','order','addIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','then','destroy','get','Intervals','error','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick'];(function(_0x47c933,_0x17a669){var _0x19ecd7=function(_0x4ac639){while(--_0x4ac639){_0x47c933['push'](_0x47c933['shift']());}};_0x19ecd7(++_0x17a669);}(_0x7fe9,0x77));var _0x97fe=function(_0x2d142b,_0x1afb4b){_0x2d142b=_0x2d142b-0x0;var _0x32a654=_0x7fe9[_0x2d142b];return _0x32a654;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97fe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97fe('0x1'));var rp=require(_0x97fe('0x2'));var moment=require(_0x97fe('0x3'));var BPromise=require(_0x97fe('0x4'));var Mustache=require(_0x97fe('0x5'));var util=require('util');var path=require(_0x97fe('0x6'));var sox=require(_0x97fe('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97fe('0x8'));var _=require(_0x97fe('0x9'));var squel=require(_0x97fe('0xa'));var crypto=require(_0x97fe('0xb'));var jsforce=require(_0x97fe('0xc'));var deskjs=require(_0x97fe('0xd'));var toCsv=require(_0x97fe('0xe'));var querystring=require(_0x97fe('0xf'));var Papa=require(_0x97fe('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x97fe('0x11'));var as=require(_0x97fe('0x12'));var hardwareService=require(_0x97fe('0x13'));var logger=require(_0x97fe('0x14'))(_0x97fe('0x15'));var utils=require(_0x97fe('0x16'));var config=require(_0x97fe('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2b012e,_0x3fcf80){_0x3fcf80=_0x3fcf80||0xcc;return function(_0x379210){if(_0x379210){return _0x2b012e[_0x97fe('0x18')](_0x3fcf80);}return _0x2b012e['status'](_0x3fcf80)[_0x97fe('0x19')]();};}function respondWithResult(_0xb7ddbe,_0x26e44a){_0x26e44a=_0x26e44a||0xc8;return function(_0x58f7dc){if(_0x58f7dc){return _0xb7ddbe[_0x97fe('0x1a')](_0x26e44a)['json'](_0x58f7dc);}};}function respondWithFilteredResult(_0x320f1e,_0x5b74a5){return function(_0x3c06d7){if(_0x3c06d7){var _0x26843b=typeof _0x5b74a5[_0x97fe('0x1b')]===_0x97fe('0x1c')&&typeof _0x5b74a5[_0x97fe('0x1d')]==='undefined';var _0x4b54b5=_0x3c06d7[_0x97fe('0x1e')];var _0x956ecc=_0x26843b?0x0:_0x5b74a5[_0x97fe('0x1b')];var _0x3c459f=_0x26843b?_0x3c06d7['count']:_0x5b74a5[_0x97fe('0x1b')]+_0x5b74a5[_0x97fe('0x1d')];var _0x430197;if(_0x3c459f>=_0x4b54b5){_0x3c459f=_0x4b54b5;_0x430197=0xc8;}else{_0x430197=0xce;}_0x320f1e[_0x97fe('0x1a')](_0x430197);return _0x320f1e[_0x97fe('0x1f')]('Content-Range',_0x956ecc+'-'+_0x3c459f+'/'+_0x4b54b5)[_0x97fe('0x20')](_0x3c06d7);}return null;};}function patchUpdates(_0x32a5e0){return function(_0xd5c3f5){try{jsonpatch[_0x97fe('0x21')](_0xd5c3f5,_0x32a5e0,!![]);}catch(_0x119ef1){return BPromise[_0x97fe('0x22')](_0x119ef1);}return _0xd5c3f5['save']();};}function saveUpdates(_0x44fa68,_0x116258){return function(_0x324866){if(_0x324866){return _0x324866['update'](_0x44fa68)[_0x97fe('0x23')](function(_0x30f17e){return _0x30f17e;});}return null;};}function removeEntity(_0x42a71f,_0x5137ba){return function(_0x4a12f3){if(_0x4a12f3){return _0x4a12f3[_0x97fe('0x24')]()['then'](function(){var _0x1039a5=_0x4a12f3[_0x97fe('0x25')]({'plain':!![]});var _0x2162a9=_0x97fe('0x26');return db['UserProfileResource'][_0x97fe('0x24')]({'where':{'type':_0x2162a9,'resourceId':_0x1039a5['id']}})[_0x97fe('0x23')](function(){return _0x4a12f3;});})[_0x97fe('0x23')](function(){_0x42a71f[_0x97fe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48bb65,_0x46841e){return function(_0x50da9f){if(!_0x50da9f){_0x48bb65[_0x97fe('0x18')](0x194);}return _0x50da9f;};}function handleError(_0x3dd5dc,_0x12f393){_0x12f393=_0x12f393||0x1f4;return function(_0x62be44){logger[_0x97fe('0x27')](_0x62be44['stack']);if(_0x62be44[_0x97fe('0x28')]){delete _0x62be44[_0x97fe('0x28')];}_0x3dd5dc['status'](_0x12f393)[_0x97fe('0x29')](_0x62be44);};}exports[_0x97fe('0x2a')]=function(_0x38b780,_0x35ce1d){var _0x395469={},_0x933a38={},_0x2c9ab9={'count':0x0,'rows':[]};var _0x570fb3=_[_0x97fe('0x2b')](db[_0x97fe('0x2c')][_0x97fe('0x2d')],function(_0x5f4103){return{'name':_0x5f4103[_0x97fe('0x2e')],'type':_0x5f4103[_0x97fe('0x2f')]['key']};});_0x933a38[_0x97fe('0x30')]=_['map'](_0x570fb3,_0x97fe('0x28'));_0x933a38[_0x97fe('0x31')]=_[_0x97fe('0x32')](_0x38b780[_0x97fe('0x31')]);_0x933a38['filters']=_[_0x97fe('0x33')](_0x933a38[_0x97fe('0x30')],_0x933a38[_0x97fe('0x31')]);_0x395469['attributes']=_[_0x97fe('0x33')](_0x933a38[_0x97fe('0x30')],qs[_0x97fe('0x34')](_0x38b780[_0x97fe('0x31')]['fields']));_0x395469[_0x97fe('0x35')]=_0x395469[_0x97fe('0x35')][_0x97fe('0x36')]?_0x395469[_0x97fe('0x35')]:_0x933a38[_0x97fe('0x30')];if(!_0x38b780[_0x97fe('0x31')][_0x97fe('0x37')](_0x97fe('0x38'))){_0x395469['limit']=qs[_0x97fe('0x1d')](_0x38b780[_0x97fe('0x31')][_0x97fe('0x1d')]);_0x395469['offset']=qs[_0x97fe('0x1b')](_0x38b780[_0x97fe('0x31')][_0x97fe('0x1b')]);}_0x395469['order']=qs[_0x97fe('0x39')](_0x38b780[_0x97fe('0x31')]['sort']);_0x395469[_0x97fe('0x3a')]=qs[_0x97fe('0x3b')](_[_0x97fe('0x3c')](_0x38b780[_0x97fe('0x31')],_0x933a38['filters']),_0x570fb3);if(_0x38b780[_0x97fe('0x31')][_0x97fe('0x3d')]){_0x395469[_0x97fe('0x3a')]=_[_0x97fe('0x3e')](_0x395469[_0x97fe('0x3a')],{'$or':_[_0x97fe('0x2b')](_0x570fb3,function(_0x2be605){if(_0x2be605[_0x97fe('0x2f')]!==_0x97fe('0x3f')){var _0x18c602={};_0x18c602[_0x2be605[_0x97fe('0x28')]]={'$like':'%'+_0x38b780[_0x97fe('0x31')][_0x97fe('0x3d')]+'%'};return _0x18c602;}})});}_0x395469=_[_0x97fe('0x3e')]({},_0x395469,_0x38b780[_0x97fe('0x40')]);var _0x2c6758={'where':_0x395469[_0x97fe('0x3a')]};return db[_0x97fe('0x2c')][_0x97fe('0x1e')](_0x2c6758)[_0x97fe('0x23')](function(_0x365627){_0x2c9ab9[_0x97fe('0x1e')]=_0x365627;if(_0x38b780[_0x97fe('0x31')]['includeAll']){_0x395469[_0x97fe('0x41')]=[{'all':!![]}];}return db[_0x97fe('0x2c')][_0x97fe('0x42')](_0x395469);})[_0x97fe('0x23')](function(_0x5d62bb){_0x2c9ab9['rows']=_0x5d62bb;return _0x2c9ab9;})[_0x97fe('0x23')](respondWithFilteredResult(_0x35ce1d,_0x395469))['catch'](handleError(_0x35ce1d,null));};exports[_0x97fe('0x43')]=function(_0x2a4f4d,_0xc4ae2f){var _0x2f67f1={'raw':!![],'where':{'id':_0x2a4f4d['params']['id']}},_0x4c400f={};_0x4c400f[_0x97fe('0x30')]=_[_0x97fe('0x32')](db['Interval'][_0x97fe('0x2d')]);_0x4c400f['query']=_[_0x97fe('0x32')](_0x2a4f4d[_0x97fe('0x31')]);_0x4c400f[_0x97fe('0x3b')]=_['intersection'](_0x4c400f[_0x97fe('0x30')],_0x4c400f[_0x97fe('0x31')]);_0x2f67f1['attributes']=_[_0x97fe('0x33')](_0x4c400f[_0x97fe('0x30')],qs[_0x97fe('0x34')](_0x2a4f4d[_0x97fe('0x31')][_0x97fe('0x34')]));_0x2f67f1['attributes']=_0x2f67f1[_0x97fe('0x35')][_0x97fe('0x36')]?_0x2f67f1[_0x97fe('0x35')]:_0x4c400f[_0x97fe('0x30')];if(_0x2a4f4d['query'][_0x97fe('0x44')]){_0x2f67f1[_0x97fe('0x41')]=[{'all':!![]}];}_0x2f67f1=_[_0x97fe('0x3e')]({},_0x2f67f1,_0x2a4f4d[_0x97fe('0x40')]);return db[_0x97fe('0x2c')][_0x97fe('0x45')](_0x2f67f1)[_0x97fe('0x23')](handleEntityNotFound(_0xc4ae2f,null))[_0x97fe('0x23')](respondWithResult(_0xc4ae2f,null))['catch'](handleError(_0xc4ae2f,null));};exports[_0x97fe('0x46')]=function(_0x4783db,_0x2a919c){return db[_0x97fe('0x2c')][_0x97fe('0x46')](_0x4783db[_0x97fe('0x47')],{})[_0x97fe('0x23')](function(_0x27e4ef){var _0x36d91c=_0x4783db[_0x97fe('0x48')]['get']({'plain':!![]});if(!_0x36d91c)throw new Error(_0x97fe('0x49'));if(_0x36d91c[_0x97fe('0x4a')]===_0x97fe('0x48')){var _0x2c3ef1=_0x27e4ef[_0x97fe('0x25')]({'plain':!![]});var _0xd82670=_0x97fe('0x26');return db[_0x97fe('0x4b')][_0x97fe('0x45')]({'where':{'name':_0xd82670,'userProfileId':_0x36d91c[_0x97fe('0x4c')]},'raw':!![]})[_0x97fe('0x23')](function(_0x3ed1e2){if(_0x3ed1e2&&_0x3ed1e2[_0x97fe('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c3ef1[_0x97fe('0x28')],'resourceId':_0x2c3ef1['id'],'type':_0x3ed1e2[_0x97fe('0x28')],'sectionId':_0x3ed1e2['id']},{})[_0x97fe('0x23')](function(){return _0x27e4ef;});}else{return _0x27e4ef;}})[_0x97fe('0x4e')](function(_0x6f71ac){logger[_0x97fe('0x27')](_0x97fe('0x4f'),_0x6f71ac);throw _0x6f71ac;});}return _0x27e4ef;})['then'](respondWithResult(_0x2a919c,0xc9))['catch'](handleError(_0x2a919c,null));};exports['update']=function(_0x1b3755,_0x39e7d2){if(_0x1b3755['body']['id']){delete _0x1b3755['body']['id'];}return db[_0x97fe('0x2c')][_0x97fe('0x45')]({'where':{'id':_0x1b3755[_0x97fe('0x50')]['id']}})[_0x97fe('0x23')](handleEntityNotFound(_0x39e7d2,null))[_0x97fe('0x23')](saveUpdates(_0x1b3755[_0x97fe('0x47')],null))[_0x97fe('0x23')](respondWithResult(_0x39e7d2,null))[_0x97fe('0x4e')](handleError(_0x39e7d2,null));};exports[_0x97fe('0x24')]=function(_0x5d855c,_0x5b25de){return db[_0x97fe('0x2c')][_0x97fe('0x45')]({'where':{'id':_0x5d855c['params']['id']}})[_0x97fe('0x23')](handleEntityNotFound(_0x5b25de,null))[_0x97fe('0x23')](removeEntity(_0x5b25de,null))['catch'](handleError(_0x5b25de,null));};exports[_0x97fe('0x51')]=function(_0x3c847a,_0xe753f5,_0x14a6f6){if(_0x3c847a[_0x97fe('0x47')]['id']){delete _0x3c847a['body']['id'];}return db[_0x97fe('0x2c')]['find']({'where':{'id':_0x3c847a[_0x97fe('0x50')]['id']}})[_0x97fe('0x23')](handleEntityNotFound(_0xe753f5,null))[_0x97fe('0x23')](function(_0x2fe414){if(_0x2fe414){_0x3c847a[_0x97fe('0x47')]['IntervalId']=_0x2fe414['id'];return db[_0x97fe('0x2c')][_0x97fe('0x46')](_0x3c847a['body']);}})[_0x97fe('0x23')](respondWithResult(_0xe753f5,null))[_0x97fe('0x4e')](handleError(_0xe753f5,null));};exports[_0x97fe('0x52')]=function(_0x40d58c,_0x58b597,_0x50c5fb){var _0x1df969={};var _0x1fb02a={};var _0x49b579;var _0x211264;return db['Interval']['findOne']({'where':{'id':_0x40d58c[_0x97fe('0x50')]['id']}})[_0x97fe('0x23')](handleEntityNotFound(_0x58b597,null))[_0x97fe('0x23')](function(_0x370c3b){if(_0x370c3b){_0x49b579=_0x370c3b;_0x1fb02a['model']=_['keys'](db['Interval'][_0x97fe('0x2d')]);_0x1fb02a['query']=_[_0x97fe('0x32')](_0x40d58c['query']);_0x1fb02a[_0x97fe('0x3b')]=_['intersection'](_0x1fb02a[_0x97fe('0x30')],_0x1fb02a[_0x97fe('0x31')]);_0x1df969[_0x97fe('0x35')]=_['intersection'](_0x1fb02a[_0x97fe('0x30')],qs[_0x97fe('0x34')](_0x40d58c['query'][_0x97fe('0x34')]));_0x1df969[_0x97fe('0x35')]=_0x1df969[_0x97fe('0x35')][_0x97fe('0x36')]?_0x1df969[_0x97fe('0x35')]:_0x1fb02a[_0x97fe('0x30')];_0x1df969[_0x97fe('0x53')]=qs['sort'](_0x40d58c[_0x97fe('0x31')]['sort']);_0x1df969['where']=qs[_0x97fe('0x3b')](_[_0x97fe('0x3c')](_0x40d58c['query'],_0x1fb02a[_0x97fe('0x3b')]));if(_0x40d58c[_0x97fe('0x31')][_0x97fe('0x3d')]){_0x1df969['where']=_[_0x97fe('0x3e')](_0x1df969[_0x97fe('0x3a')],{'$or':_[_0x97fe('0x2b')](_0x1df969[_0x97fe('0x35')],function(_0x444106){var _0xba8966={};_0xba8966[_0x444106]={'$like':'%'+_0x40d58c[_0x97fe('0x31')][_0x97fe('0x3d')]+'%'};return _0xba8966;})});}_0x1df969=_[_0x97fe('0x3e')]({},_0x1df969,_0x40d58c[_0x97fe('0x40')]);return _0x49b579[_0x97fe('0x52')](_0x1df969);}})[_0x97fe('0x23')](function(_0x3d60cf){if(_0x3d60cf){_0x211264=_0x3d60cf[_0x97fe('0x36')];if(!_0x40d58c['query']['hasOwnProperty'](_0x97fe('0x38'))){_0x1df969['limit']=qs[_0x97fe('0x1d')](_0x40d58c[_0x97fe('0x31')][_0x97fe('0x1d')]);_0x1df969[_0x97fe('0x1b')]=qs[_0x97fe('0x1b')](_0x40d58c['query']['offset']);}return _0x49b579[_0x97fe('0x52')](_0x1df969);}})['then'](function(_0x34090d){if(_0x34090d){return _0x34090d?{'count':_0x211264,'rows':_0x34090d}:null;}})['then'](respondWithResult(_0x58b597,null))[_0x97fe('0x4e')](handleError(_0x58b597,null));};exports[_0x97fe('0x54')]=function(_0x1de5ca,_0x1e5856,_0x306510){return db[_0x97fe('0x2c')][_0x97fe('0x55')]({'where':{'id':_0x1de5ca['params']['id']}})['then'](handleEntityNotFound(_0x1e5856,null))[_0x97fe('0x23')](function(_0x4d16de){if(_0x4d16de){return db[_0x97fe('0x56')][_0x97fe('0x57')](function(_0x164b27){return db[_0x97fe('0x2c')]['destroy']({'where':{'IntervalId':_0x1de5ca['params']['id']},'transaction':_0x164b27})['then'](function(_0x2cc350){var _0x57bf6b=_[_0x97fe('0x2b')](_0x1de5ca[_0x97fe('0x47')],function(_0x3eed25){delete _0x3eed25['id'];_0x3eed25[_0x97fe('0x58')]=_0x1de5ca['params']['id'];return _0x3eed25;});return db[_0x97fe('0x2c')][_0x97fe('0x59')](_0x57bf6b,{'transaction':_0x164b27});});})[_0x97fe('0x23')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x1de5ca['params']['id']}});});}})[_0x97fe('0x23')](respondWithResult(_0x1e5856,null))['catch'](handleError(_0x1e5856,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d377c5e..56dd70f 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 _0x51d1=['./interval.attributes','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12e817,_0x118514){var _0x5ad3f0=function(_0x2efcda){while(--_0x2efcda){_0x12e817['push'](_0x12e817['shift']());}};_0x5ad3f0(++_0x118514);}(_0x51d1,0x1d6));var _0x151d=function(_0x1f6691,_0x3a3d46){_0x1f6691=_0x1f6691-0x0;var _0xf786b6=_0x51d1[_0x1f6691];return _0xf786b6;};'use strict';var _=require(_0x151d('0x0'));var util=require(_0x151d('0x1'));var logger=require(_0x151d('0x2'))(_0x151d('0x3'));var moment=require(_0x151d('0x4'));var BPromise=require(_0x151d('0x5'));var rp=require(_0x151d('0x6'));var fs=require('fs');var path=require(_0x151d('0x7'));var rimraf=require(_0x151d('0x8'));var config=require(_0x151d('0x9'));var attributes=require(_0x151d('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0x151d('0xb')]=function(_0x3a7ebb,_0x483d1f){return _0x3a7ebb[_0x151d('0xc')](_0x151d('0xd'),attributes,{'tableName':_0x151d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b48f5,_0xb6f9b3){extensions[_0x151d('0xf')](_0x3a7ebb,_0x2b48f5);},'afterBulkCreate':function(_0x5400b5,_0x4c7826,_0x2848c3){_0x2848c3();extensions[_0x151d('0xf')](_0x3a7ebb,_0x5400b5[0x0]);},'afterUpdate':function(_0x5f051d,_0x16f935){extensions[_0x151d('0xf')](_0x3a7ebb,_0x5f051d);},'afterDestroy':function(_0x977470,_0x1d3ce0){extensions[_0x151d('0xf')](_0x3a7ebb,_0x977470);}}});}; \ No newline at end of file +var _0x2e43=['Interval','rewrite','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x2e43,0x15e));var _0x32e4=function(_0x3dd745,_0x11b39b){_0x3dd745=_0x3dd745-0x0;var _0x362056=_0x2e43[_0x3dd745];return _0x362056;};'use strict';var _=require(_0x32e4('0x0'));var util=require(_0x32e4('0x1'));var logger=require(_0x32e4('0x2'))('api');var moment=require(_0x32e4('0x3'));var BPromise=require('bluebird');var rp=require(_0x32e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32e4('0x5'));var config=require(_0x32e4('0x6'));var attributes=require(_0x32e4('0x7'));var extensions=require(_0x32e4('0x8'));module[_0x32e4('0x9')]=function(_0x1e0bac,_0x136615){return _0x1e0bac['define'](_0x32e4('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d4bfa,_0x4d36b4){extensions[_0x32e4('0xb')](_0x1e0bac,_0x3d4bfa);},'afterBulkCreate':function(_0x3f34f8,_0x2fc85a,_0x2b1c28){_0x2b1c28();extensions['rewrite'](_0x1e0bac,_0x3f34f8[0x0]);},'afterUpdate':function(_0x50c261,_0x100104){extensions[_0x32e4('0xb')](_0x1e0bac,_0x50c261);},'afterDestroy':function(_0x11fff2,_0x5854ae){extensions['rewrite'](_0x1e0bac,_0x11fff2);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c278869..c493031 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(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 49f3398..f170b5d 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x1c1a2e,_0x374839){var _0x503c45=function(_0x493452){while(--_0x493452){_0x1c1a2e['push'](_0x1c1a2e['shift']());}};_0x503c45(++_0x374839);}(_0x2ef3,0xba));var _0x32ef=function(_0x502253,_0x50f4e7){_0x502253=_0x502253-0x0;var _0x1c0a5e=_0x2ef3[_0x502253];return _0x1c0a5e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0x0b0e[_0x4737a0];return _0x4d558b;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f9f78de..7b846fa 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 _0xe849=['customfield_11503','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','toString','stringify','request','setEncoding','utf8','data','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','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','support','MOTGUI','summary','description','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0xe849,0x1b7));var _0x9e84=function(_0x39fff2,_0x2ba9b2){_0x39fff2=_0x39fff2-0x0;var _0x40a1d7=_0xe849[_0x39fff2];return _0x40a1d7;};'use strict';var BPromise=require(_0x9e84('0x0'));var https=require('https');var logger=require('../../config/logger')('api');var USERNAME=_0x9e84('0x1');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5b7372,_0x22aa26){var _0x163243={'fields':{'project':{'key':_0x5b7372['key']||_0x9e84('0x2')},'summary':(_0x5b7372[_0x9e84('0x3')]||'Report')+'\x20from\x20'+_0x5b7372['ip'],'description':_0x5b7372[_0x9e84('0x4')]||JSON['stringify'](_0x5b7372),'issuetype':{'name':_0x5b7372['issuetype']||_0x9e84('0x5')}}};_0x163243[_0x9e84('0x6')][_0x9e84('0x7')]=_0x5b7372[_0x9e84('0x8')];_0x163243[_0x9e84('0x6')][_0x9e84('0x9')]=_0x5b7372['oldToken'];_0x163243[_0x9e84('0x6')][_0x9e84('0xa')]=_0x5b7372[_0x9e84('0xb')];_0x163243[_0x9e84('0x6')][_0x9e84('0xc')]=_0x5b7372[_0x9e84('0xd')];_0x163243[_0x9e84('0x6')][_0x9e84('0xe')]=_0x5b7372[_0x9e84('0xf')];_0x163243['fields'][_0x9e84('0x10')]=_0x5b7372['ip'];var _0x2e49b7={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x9e84('0x11'),'timeout':0x4e20,'headers':{'Content-Type':_0x9e84('0x12'),'Authorization':_0x9e84('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0x9e84('0x14')]('base64')}};var _0x1c9299=JSON[_0x9e84('0x15')](_0x163243);var _0x4efd11=https[_0x9e84('0x16')](_0x2e49b7,function(_0x4389a9){_0x4389a9[_0x9e84('0x17')](_0x9e84('0x18'));var _0x2b11d8='';_0x4389a9['on'](_0x9e84('0x19'),function(_0xb158e3){_0x2b11d8+=_0xb158e3;});_0x4389a9['on'](_0x9e84('0x1a'),function(){if(_0x22aa26){return _0x22aa26[_0x9e84('0x1b')](_0x4389a9[_0x9e84('0x1c')])[_0x9e84('0x1d')](JSON[_0x9e84('0x1e')](_0x2b11d8));}});});_0x4efd11['on'](_0x9e84('0x1f'),function(_0x55be40){if(_0x22aa26){return _0x22aa26[_0x9e84('0x1b')](0x1f4)[_0x9e84('0x1d')]({'errors':[{'message':_0x9e84('0x20'),'type':'api.jira'}]});}});_0x4efd11[_0x9e84('0x21')](_0x1c9299);_0x4efd11[_0x9e84('0x1a')]();}exports[_0x9e84('0x22')]=openIssue;exports[_0x9e84('0x23')]=function(_0x383b7a,_0x484ad6){_0x383b7a[_0x9e84('0x24')]['ip']=_0x383b7a[_0x9e84('0x25')][_0x9e84('0x26')]||_0x383b7a['connection'][_0x9e84('0x27')]||_0x383b7a[_0x9e84('0x28')][_0x9e84('0x27')]||_0x383b7a['connection'][_0x9e84('0x28')][_0x9e84('0x27')];return openIssue(_0x383b7a[_0x9e84('0x24')],_0x484ad6);}; \ No newline at end of file +var _0xfa70=['Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','request','end','status','json','parse','error','api.jira','write','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','description','stringify','issuetype'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfa70,0xa0));var _0x0fa7=function(_0x1159d3,_0x51f60d){_0x1159d3=_0x1159d3-0x0;var _0x26d2ae=_0xfa70[_0x1159d3];return _0x26d2ae;};'use strict';var BPromise=require(_0x0fa7('0x0'));var https=require(_0x0fa7('0x1'));var logger=require(_0x0fa7('0x2'))(_0x0fa7('0x3'));var USERNAME=_0x0fa7('0x4');var PASSWORD=_0x0fa7('0x5');function openIssue(_0x50b57c,_0x4f2462){var _0x4d200f={'fields':{'project':{'key':_0x50b57c[_0x0fa7('0x6')]||'MOTGUI'},'summary':(_0x50b57c[_0x0fa7('0x7')]||_0x0fa7('0x8'))+'\x20from\x20'+_0x50b57c['ip'],'description':_0x50b57c[_0x0fa7('0x9')]||JSON[_0x0fa7('0xa')](_0x50b57c),'issuetype':{'name':_0x50b57c[_0x0fa7('0xb')]||_0x0fa7('0xc')}}};_0x4d200f[_0x0fa7('0xd')][_0x0fa7('0xe')]=_0x50b57c[_0x0fa7('0xf')];_0x4d200f[_0x0fa7('0xd')][_0x0fa7('0x10')]=_0x50b57c[_0x0fa7('0x11')];_0x4d200f['fields'][_0x0fa7('0x12')]=_0x50b57c[_0x0fa7('0x13')];_0x4d200f[_0x0fa7('0xd')]['customfield_11503']=_0x50b57c[_0x0fa7('0x14')];_0x4d200f[_0x0fa7('0xd')][_0x0fa7('0x15')]=_0x50b57c[_0x0fa7('0x16')];_0x4d200f[_0x0fa7('0xd')][_0x0fa7('0x17')]=_0x50b57c['ip'];var _0x4267c1={'host':_0x0fa7('0x18'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0fa7('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0fa7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x0fa7('0x1b')](_0x0fa7('0x1c'))}};var _0x2fa82d=JSON[_0x0fa7('0xa')](_0x4d200f);var _0x4f83d8=https[_0x0fa7('0x1d')](_0x4267c1,function(_0x10f880){_0x10f880['setEncoding']('utf8');var _0x40f11b='';_0x10f880['on']('data',function(_0x47e88b){_0x40f11b+=_0x47e88b;});_0x10f880['on'](_0x0fa7('0x1e'),function(){if(_0x4f2462){return _0x4f2462[_0x0fa7('0x1f')](_0x10f880['statusCode'])[_0x0fa7('0x20')](JSON[_0x0fa7('0x21')](_0x40f11b));}});});_0x4f83d8['on'](_0x0fa7('0x22'),function(_0x1db7f1){if(_0x4f2462){return _0x4f2462[_0x0fa7('0x1f')](0x1f4)[_0x0fa7('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0fa7('0x23')}]});}});_0x4f83d8[_0x0fa7('0x24')](_0x2fa82d);_0x4f83d8[_0x0fa7('0x1e')]();}exports['openIssue']=openIssue;exports['send']=function(_0x5bec46,_0x526ba1){_0x5bec46[_0x0fa7('0x25')]['ip']=_0x5bec46[_0x0fa7('0x26')][_0x0fa7('0x27')]||_0x5bec46[_0x0fa7('0x28')][_0x0fa7('0x29')]||_0x5bec46[_0x0fa7('0x2a')][_0x0fa7('0x29')]||_0x5bec46['connection'][_0x0fa7('0x2a')][_0x0fa7('0x29')];return openIssue(_0x5bec46[_0x0fa7('0x25')],_0x526ba1);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7a86f3d..1c147ed 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 _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports'];(function(_0x739b76,_0x2250f8){var _0x3b471f=function(_0x249b87){while(--_0x249b87){_0x739b76['push'](_0x739b76['shift']());}};_0x3b471f(++_0x2250f8);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xc')]('/',auth[_0x34ea('0x8')](),controller['create']);router['put'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['delete'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xe')]);module[_0x34ea('0xf')]=router; \ No newline at end of file +var _0x3c81=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x39ddd4,_0x38ce35){var _0x3d642a=function(_0xa05ced){while(--_0xa05ced){_0x39ddd4['push'](_0x39ddd4['shift']());}};_0x3d642a(++_0x38ce35);}(_0x3c81,0x102));var _0x13c8=function(_0x335fb8,_0x16773c){_0x335fb8=_0x335fb8-0x0;var _0x1383cd=_0x3c81[_0x335fb8];return _0x1383cd;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0xd')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index c8869e6..4a339ee 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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x1be664,_0x4dbeb4){_0x1be664=_0x1be664-0x0;var _0x2ce8da=_0x7a54[_0x1be664];return _0x2ce8da;};'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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0xd4a6df,_0x48dab6){_0xd4a6df=_0xd4a6df-0x0;var _0x3af182=_0x7a54[_0xd4a6df];return _0x3af182;};'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 bfac72e..e87b1a6 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 _0x6c65=['offset','limit','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','undefined','count'];(function(_0x50b3f4,_0x9b1602){var _0x3a98a6=function(_0x52c998){while(--_0x52c998){_0x50b3f4['push'](_0x50b3f4['shift']());}};_0x3a98a6(++_0x9b1602);}(_0x6c65,0x78));var _0x56c6=function(_0x597da3,_0x51b62b){_0x597da3=_0x597da3-0x0;var _0xd3cd83=_0x6c65[_0x597da3];return _0xd3cd83;};'use strict';var emlformat=require(_0x56c6('0x0'));var rimraf=require(_0x56c6('0x1'));var zipdir=require(_0x56c6('0x2'));var jsonpatch=require(_0x56c6('0x3'));var rp=require(_0x56c6('0x4'));var moment=require(_0x56c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x56c6('0x6'));var util=require(_0x56c6('0x7'));var path=require(_0x56c6('0x8'));var sox=require(_0x56c6('0x9'));var csv=require(_0x56c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56c6('0xb'));var _=require(_0x56c6('0xc'));var squel=require(_0x56c6('0xd'));var crypto=require(_0x56c6('0xe'));var jsforce=require(_0x56c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x56c6('0xa'));var querystring=require(_0x56c6('0x10'));var Papa=require(_0x56c6('0x11'));var Redis=require('ioredis');var authService=require(_0x56c6('0x12'));var qs=require(_0x56c6('0x13'));var as=require(_0x56c6('0x14'));var hardwareService=require(_0x56c6('0x15'));var logger=require(_0x56c6('0x16'))(_0x56c6('0x17'));var utils=require('../../config/utils');var config=require(_0x56c6('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d7c67,_0x2bb84e){_0x2bb84e=_0x2bb84e||0xcc;return function(_0x3310ed){if(_0x3310ed){return _0x1d7c67[_0x56c6('0x19')](_0x2bb84e);}return _0x1d7c67['status'](_0x2bb84e)[_0x56c6('0x1a')]();};}function respondWithResult(_0x511316,_0x17f72e){_0x17f72e=_0x17f72e||0xc8;return function(_0x59b7b5){if(_0x59b7b5){return _0x511316[_0x56c6('0x1b')](_0x17f72e)['json'](_0x59b7b5);}};}function respondWithFilteredResult(_0x557189,_0x4b47ce){return function(_0x4d0838){if(_0x4d0838){var _0x3e6082=typeof _0x4b47ce['offset']===_0x56c6('0x1c')&&typeof _0x4b47ce['limit']===_0x56c6('0x1c');var _0x49fff5=_0x4d0838[_0x56c6('0x1d')];var _0x5625f2=_0x3e6082?0x0:_0x4b47ce[_0x56c6('0x1e')];var _0x288325=_0x3e6082?_0x4d0838['count']:_0x4b47ce[_0x56c6('0x1e')]+_0x4b47ce[_0x56c6('0x1f')];var _0x27b5b0;if(_0x288325>=_0x49fff5){_0x288325=_0x49fff5;_0x27b5b0=0xc8;}else{_0x27b5b0=0xce;}_0x557189[_0x56c6('0x1b')](_0x27b5b0);return _0x557189['set'](_0x56c6('0x20'),_0x5625f2+'-'+_0x288325+'/'+_0x49fff5)[_0x56c6('0x21')](_0x4d0838);}return null;};}function patchUpdates(_0x413ca7){return function(_0x137570){try{jsonpatch[_0x56c6('0x22')](_0x137570,_0x413ca7,!![]);}catch(_0x58bc6f){return BPromise[_0x56c6('0x23')](_0x58bc6f);}return _0x137570[_0x56c6('0x24')]();};}function saveUpdates(_0x55271c,_0x40d7be){return function(_0x4d33f7){if(_0x4d33f7){return _0x4d33f7['update'](_0x55271c)[_0x56c6('0x25')](function(_0x1f1bb1){return _0x1f1bb1;});}return null;};}function removeEntity(_0x17dd94,_0x5c6682){return function(_0x27806e){if(_0x27806e){return _0x27806e[_0x56c6('0x26')]()[_0x56c6('0x25')](function(){_0x17dd94[_0x56c6('0x1b')](0xcc)[_0x56c6('0x1a')]();});}};}function handleEntityNotFound(_0x207f05,_0x50d7ee){return function(_0x4be5df){if(!_0x4be5df){_0x207f05[_0x56c6('0x19')](0x194);}return _0x4be5df;};}function handleError(_0x44164c,_0x5cb361){_0x5cb361=_0x5cb361||0x1f4;return function(_0x33f95e){logger['error'](_0x33f95e[_0x56c6('0x27')]);if(_0x33f95e['name']){delete _0x33f95e[_0x56c6('0x28')];}_0x44164c['status'](_0x5cb361)[_0x56c6('0x29')](_0x33f95e);};}exports[_0x56c6('0x2a')]=function(_0x24fb02,_0x2e6b07){var _0x1acdcf={},_0x67fec3={},_0x14094b={'count':0x0,'rows':[]};var _0x3938d4=_[_0x56c6('0x2b')](db[_0x56c6('0x2c')][_0x56c6('0x2d')],function(_0x492d80){return{'name':_0x492d80[_0x56c6('0x2e')],'type':_0x492d80[_0x56c6('0x2f')]['key']};});_0x67fec3['model']=_[_0x56c6('0x2b')](_0x3938d4,'name');_0x67fec3[_0x56c6('0x30')]=_['keys'](_0x24fb02[_0x56c6('0x30')]);_0x67fec3[_0x56c6('0x31')]=_[_0x56c6('0x32')](_0x67fec3['model'],_0x67fec3[_0x56c6('0x30')]);_0x1acdcf[_0x56c6('0x33')]=_[_0x56c6('0x32')](_0x67fec3[_0x56c6('0x34')],qs[_0x56c6('0x35')](_0x24fb02[_0x56c6('0x30')][_0x56c6('0x35')]));_0x1acdcf[_0x56c6('0x33')]=_0x1acdcf[_0x56c6('0x33')][_0x56c6('0x36')]?_0x1acdcf['attributes']:_0x67fec3[_0x56c6('0x34')];if(!_0x24fb02[_0x56c6('0x30')]['hasOwnProperty'](_0x56c6('0x37'))){_0x1acdcf[_0x56c6('0x1f')]=qs[_0x56c6('0x1f')](_0x24fb02[_0x56c6('0x30')][_0x56c6('0x1f')]);_0x1acdcf[_0x56c6('0x1e')]=qs[_0x56c6('0x1e')](_0x24fb02['query'][_0x56c6('0x1e')]);}_0x1acdcf[_0x56c6('0x38')]=qs[_0x56c6('0x39')](_0x24fb02[_0x56c6('0x30')][_0x56c6('0x39')]);_0x1acdcf[_0x56c6('0x3a')]=qs[_0x56c6('0x31')](_['pick'](_0x24fb02['query'],_0x67fec3[_0x56c6('0x31')]),_0x3938d4);if(_0x24fb02[_0x56c6('0x30')][_0x56c6('0x3b')]){_0x1acdcf[_0x56c6('0x3a')]=_[_0x56c6('0x3c')](_0x1acdcf[_0x56c6('0x3a')],{'$or':_[_0x56c6('0x2b')](_0x3938d4,function(_0xbc92e){if(_0xbc92e[_0x56c6('0x2f')]!==_0x56c6('0x3d')){var _0x493865={};_0x493865[_0xbc92e[_0x56c6('0x28')]]={'$like':'%'+_0x24fb02[_0x56c6('0x30')][_0x56c6('0x3b')]+'%'};return _0x493865;}})});}_0x1acdcf=_['merge']({},_0x1acdcf,_0x24fb02[_0x56c6('0x3e')]);var _0x74516a={'where':_0x1acdcf[_0x56c6('0x3a')]};return db['JscriptyAnswerReport']['count'](_0x74516a)[_0x56c6('0x25')](function(_0x2dea5d){_0x14094b[_0x56c6('0x1d')]=_0x2dea5d;if(_0x24fb02[_0x56c6('0x30')][_0x56c6('0x3f')]){_0x1acdcf[_0x56c6('0x40')]=[{'all':!![]}];}return db[_0x56c6('0x2c')][_0x56c6('0x41')](_0x1acdcf);})[_0x56c6('0x25')](function(_0x295522){_0x14094b[_0x56c6('0x42')]=_0x295522;return _0x14094b;})[_0x56c6('0x25')](respondWithFilteredResult(_0x2e6b07,_0x1acdcf))[_0x56c6('0x43')](handleError(_0x2e6b07,null));};exports['show']=function(_0x217723,_0x851bbe){var _0x1e6b10={'raw':!![],'where':{'id':_0x217723[_0x56c6('0x44')]['id']}},_0x5968ac={};_0x5968ac[_0x56c6('0x34')]=_[_0x56c6('0x45')](db[_0x56c6('0x2c')][_0x56c6('0x2d')]);_0x5968ac[_0x56c6('0x30')]=_[_0x56c6('0x45')](_0x217723[_0x56c6('0x30')]);_0x5968ac['filters']=_[_0x56c6('0x32')](_0x5968ac['model'],_0x5968ac['query']);_0x1e6b10[_0x56c6('0x33')]=_[_0x56c6('0x32')](_0x5968ac[_0x56c6('0x34')],qs[_0x56c6('0x35')](_0x217723['query'][_0x56c6('0x35')]));_0x1e6b10[_0x56c6('0x33')]=_0x1e6b10[_0x56c6('0x33')]['length']?_0x1e6b10[_0x56c6('0x33')]:_0x5968ac[_0x56c6('0x34')];if(_0x217723[_0x56c6('0x30')][_0x56c6('0x3f')]){_0x1e6b10[_0x56c6('0x40')]=[{'all':!![]}];}_0x1e6b10=_['merge']({},_0x1e6b10,_0x217723[_0x56c6('0x3e')]);return db[_0x56c6('0x2c')][_0x56c6('0x46')](_0x1e6b10)[_0x56c6('0x25')](handleEntityNotFound(_0x851bbe,null))[_0x56c6('0x25')](respondWithResult(_0x851bbe,null))[_0x56c6('0x43')](handleError(_0x851bbe,null));};exports[_0x56c6('0x47')]=function(_0x1b6ac4,_0x4529df){return db[_0x56c6('0x2c')][_0x56c6('0x47')](_0x1b6ac4['body'],{})[_0x56c6('0x25')](respondWithResult(_0x4529df,0xc9))['catch'](handleError(_0x4529df,null));};exports[_0x56c6('0x48')]=function(_0x58cfa5,_0x5b449f){if(_0x58cfa5[_0x56c6('0x49')]['id']){delete _0x58cfa5[_0x56c6('0x49')]['id'];}return db[_0x56c6('0x2c')][_0x56c6('0x46')]({'where':{'id':_0x58cfa5[_0x56c6('0x44')]['id']}})[_0x56c6('0x25')](handleEntityNotFound(_0x5b449f,null))[_0x56c6('0x25')](saveUpdates(_0x58cfa5[_0x56c6('0x49')],null))[_0x56c6('0x25')](respondWithResult(_0x5b449f,null))[_0x56c6('0x43')](handleError(_0x5b449f,null));};exports['destroy']=function(_0x2b1ff0,_0x20598b){return db[_0x56c6('0x2c')][_0x56c6('0x46')]({'where':{'id':_0x2b1ff0['params']['id']}})[_0x56c6('0x25')](handleEntityNotFound(_0x20598b,null))[_0x56c6('0x25')](removeEntity(_0x20598b,null))[_0x56c6('0x43')](handleError(_0x20598b,null));};exports['describe']=function(_0x438674,_0xacbb0d){return db[_0x56c6('0x2c')][_0x56c6('0x4a')]()['then'](respondWithResult(_0xacbb0d,null))[_0x56c6('0x43')](handleError(_0xacbb0d,null));}; \ No newline at end of file +var _0x36c3=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','set','apply','then','destroy','status','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length'];(function(_0x454d3a,_0xc13ab6){var _0xc9b88c=function(_0x9a7434){while(--_0x9a7434){_0x454d3a['push'](_0x454d3a['shift']());}};_0xc9b88c(++_0xc13ab6);}(_0x36c3,0x1a6));var _0x336c=function(_0x1f0f2a,_0x14f11a){_0x1f0f2a=_0x1f0f2a-0x0;var _0x145cd9=_0x36c3[_0x1f0f2a];return _0x145cd9;};'use strict';var emlformat=require(_0x336c('0x0'));var rimraf=require(_0x336c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x336c('0x2'));var rp=require(_0x336c('0x3'));var moment=require(_0x336c('0x4'));var BPromise=require(_0x336c('0x5'));var Mustache=require(_0x336c('0x6'));var util=require(_0x336c('0x7'));var path=require(_0x336c('0x8'));var sox=require('sox');var csv=require(_0x336c('0x9'));var ejs=require(_0x336c('0xa'));var fs=require('fs');var fs_extra=require(_0x336c('0xb'));var _=require(_0x336c('0xc'));var squel=require(_0x336c('0xd'));var crypto=require('crypto');var jsforce=require(_0x336c('0xe'));var deskjs=require(_0x336c('0xf'));var toCsv=require(_0x336c('0x9'));var querystring=require(_0x336c('0x10'));var Papa=require(_0x336c('0x11'));var Redis=require(_0x336c('0x12'));var authService=require(_0x336c('0x13'));var qs=require(_0x336c('0x14'));var as=require(_0x336c('0x15'));var hardwareService=require(_0x336c('0x16'));var logger=require(_0x336c('0x17'))(_0x336c('0x18'));var utils=require(_0x336c('0x19'));var config=require(_0x336c('0x1a'));var licenseUtil=require(_0x336c('0x1b'));var db=require(_0x336c('0x1c'))['db'];function respondWithStatusCode(_0x94b601,_0x4b08f8){_0x4b08f8=_0x4b08f8||0xcc;return function(_0x592a5b){if(_0x592a5b){return _0x94b601[_0x336c('0x1d')](_0x4b08f8);}return _0x94b601['status'](_0x4b08f8)[_0x336c('0x1e')]();};}function respondWithResult(_0xc6a857,_0x2115ce){_0x2115ce=_0x2115ce||0xc8;return function(_0x345be6){if(_0x345be6){return _0xc6a857['status'](_0x2115ce)[_0x336c('0x1f')](_0x345be6);}};}function respondWithFilteredResult(_0x15bc2b,_0x4ce90a){return function(_0x23b375){if(_0x23b375){var _0x5f5ae1=typeof _0x4ce90a[_0x336c('0x20')]==='undefined'&&typeof _0x4ce90a[_0x336c('0x21')]==='undefined';var _0x7610f4=_0x23b375[_0x336c('0x22')];var _0x4a46ff=_0x5f5ae1?0x0:_0x4ce90a['offset'];var _0x13db87=_0x5f5ae1?_0x23b375[_0x336c('0x22')]:_0x4ce90a[_0x336c('0x20')]+_0x4ce90a[_0x336c('0x21')];var _0x366182;if(_0x13db87>=_0x7610f4){_0x13db87=_0x7610f4;_0x366182=0xc8;}else{_0x366182=0xce;}_0x15bc2b['status'](_0x366182);return _0x15bc2b[_0x336c('0x23')]('Content-Range',_0x4a46ff+'-'+_0x13db87+'/'+_0x7610f4)['json'](_0x23b375);}return null;};}function patchUpdates(_0x5f401e){return function(_0x9d4fc6){try{jsonpatch[_0x336c('0x24')](_0x9d4fc6,_0x5f401e,!![]);}catch(_0x2c8254){return BPromise['reject'](_0x2c8254);}return _0x9d4fc6['save']();};}function saveUpdates(_0x5b6cc3,_0x3ba228){return function(_0x60d259){if(_0x60d259){return _0x60d259['update'](_0x5b6cc3)[_0x336c('0x25')](function(_0x421929){return _0x421929;});}return null;};}function removeEntity(_0x37a355,_0x56a6fb){return function(_0x473164){if(_0x473164){return _0x473164[_0x336c('0x26')]()[_0x336c('0x25')](function(){_0x37a355[_0x336c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x401660,_0x9dc9bc){return function(_0x412a00){if(!_0x412a00){_0x401660[_0x336c('0x1d')](0x194);}return _0x412a00;};}function handleError(_0x27fcc2,_0x1cb083){_0x1cb083=_0x1cb083||0x1f4;return function(_0x567bfa){logger[_0x336c('0x28')](_0x567bfa[_0x336c('0x29')]);if(_0x567bfa[_0x336c('0x2a')]){delete _0x567bfa[_0x336c('0x2a')];}_0x27fcc2['status'](_0x1cb083)[_0x336c('0x2b')](_0x567bfa);};}exports[_0x336c('0x2c')]=function(_0x54b06b,_0x5476ff){var _0x562043={},_0x2ba9c1={},_0x1c7a34={'count':0x0,'rows':[]};var _0x489901=_['map'](db['JscriptyAnswerReport'][_0x336c('0x2d')],function(_0x37782a){return{'name':_0x37782a[_0x336c('0x2e')],'type':_0x37782a[_0x336c('0x2f')][_0x336c('0x30')]};});_0x2ba9c1[_0x336c('0x31')]=_[_0x336c('0x32')](_0x489901,'name');_0x2ba9c1[_0x336c('0x33')]=_[_0x336c('0x34')](_0x54b06b[_0x336c('0x33')]);_0x2ba9c1[_0x336c('0x35')]=_['intersection'](_0x2ba9c1[_0x336c('0x31')],_0x2ba9c1[_0x336c('0x33')]);_0x562043['attributes']=_[_0x336c('0x36')](_0x2ba9c1[_0x336c('0x31')],qs['fields'](_0x54b06b[_0x336c('0x33')][_0x336c('0x37')]));_0x562043[_0x336c('0x38')]=_0x562043[_0x336c('0x38')][_0x336c('0x39')]?_0x562043[_0x336c('0x38')]:_0x2ba9c1[_0x336c('0x31')];if(!_0x54b06b[_0x336c('0x33')]['hasOwnProperty'](_0x336c('0x3a'))){_0x562043[_0x336c('0x21')]=qs[_0x336c('0x21')](_0x54b06b[_0x336c('0x33')][_0x336c('0x21')]);_0x562043[_0x336c('0x20')]=qs[_0x336c('0x20')](_0x54b06b[_0x336c('0x33')][_0x336c('0x20')]);}_0x562043[_0x336c('0x3b')]=qs['sort'](_0x54b06b[_0x336c('0x33')][_0x336c('0x3c')]);_0x562043[_0x336c('0x3d')]=qs[_0x336c('0x35')](_[_0x336c('0x3e')](_0x54b06b[_0x336c('0x33')],_0x2ba9c1[_0x336c('0x35')]),_0x489901);if(_0x54b06b[_0x336c('0x33')][_0x336c('0x3f')]){_0x562043[_0x336c('0x3d')]=_['merge'](_0x562043[_0x336c('0x3d')],{'$or':_[_0x336c('0x32')](_0x489901,function(_0x3615a7){if(_0x3615a7['type']!==_0x336c('0x40')){var _0x154bc0={};_0x154bc0[_0x3615a7[_0x336c('0x2a')]]={'$like':'%'+_0x54b06b[_0x336c('0x33')]['filter']+'%'};return _0x154bc0;}})});}_0x562043=_[_0x336c('0x41')]({},_0x562043,_0x54b06b[_0x336c('0x42')]);var _0x478b10={'where':_0x562043[_0x336c('0x3d')]};return db[_0x336c('0x43')][_0x336c('0x22')](_0x478b10)['then'](function(_0x16c6c6){_0x1c7a34[_0x336c('0x22')]=_0x16c6c6;if(_0x54b06b[_0x336c('0x33')][_0x336c('0x44')]){_0x562043[_0x336c('0x45')]=[{'all':!![]}];}return db[_0x336c('0x43')][_0x336c('0x46')](_0x562043);})[_0x336c('0x25')](function(_0x1ab068){_0x1c7a34[_0x336c('0x47')]=_0x1ab068;return _0x1c7a34;})['then'](respondWithFilteredResult(_0x5476ff,_0x562043))[_0x336c('0x48')](handleError(_0x5476ff,null));};exports[_0x336c('0x49')]=function(_0x290750,_0x5b2f25){var _0x22ad35={'raw':!![],'where':{'id':_0x290750['params']['id']}},_0xabb11e={};_0xabb11e[_0x336c('0x31')]=_[_0x336c('0x34')](db[_0x336c('0x43')][_0x336c('0x2d')]);_0xabb11e['query']=_[_0x336c('0x34')](_0x290750[_0x336c('0x33')]);_0xabb11e['filters']=_[_0x336c('0x36')](_0xabb11e[_0x336c('0x31')],_0xabb11e['query']);_0x22ad35[_0x336c('0x38')]=_[_0x336c('0x36')](_0xabb11e[_0x336c('0x31')],qs[_0x336c('0x37')](_0x290750['query'][_0x336c('0x37')]));_0x22ad35[_0x336c('0x38')]=_0x22ad35[_0x336c('0x38')][_0x336c('0x39')]?_0x22ad35[_0x336c('0x38')]:_0xabb11e[_0x336c('0x31')];if(_0x290750[_0x336c('0x33')][_0x336c('0x44')]){_0x22ad35[_0x336c('0x45')]=[{'all':!![]}];}_0x22ad35=_['merge']({},_0x22ad35,_0x290750[_0x336c('0x42')]);return db[_0x336c('0x43')][_0x336c('0x4a')](_0x22ad35)[_0x336c('0x25')](handleEntityNotFound(_0x5b2f25,null))[_0x336c('0x25')](respondWithResult(_0x5b2f25,null))[_0x336c('0x48')](handleError(_0x5b2f25,null));};exports[_0x336c('0x4b')]=function(_0xbfac47,_0x3bdbb8){return db[_0x336c('0x43')][_0x336c('0x4b')](_0xbfac47[_0x336c('0x4c')],{})[_0x336c('0x25')](respondWithResult(_0x3bdbb8,0xc9))['catch'](handleError(_0x3bdbb8,null));};exports[_0x336c('0x4d')]=function(_0x57f151,_0x4f4e12){if(_0x57f151[_0x336c('0x4c')]['id']){delete _0x57f151['body']['id'];}return db['JscriptyAnswerReport'][_0x336c('0x4a')]({'where':{'id':_0x57f151['params']['id']}})[_0x336c('0x25')](handleEntityNotFound(_0x4f4e12,null))[_0x336c('0x25')](saveUpdates(_0x57f151[_0x336c('0x4c')],null))[_0x336c('0x25')](respondWithResult(_0x4f4e12,null))['catch'](handleError(_0x4f4e12,null));};exports['destroy']=function(_0x33f091,_0x17bfc9){return db['JscriptyAnswerReport'][_0x336c('0x4a')]({'where':{'id':_0x33f091[_0x336c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x17bfc9,null))[_0x336c('0x25')](removeEntity(_0x17bfc9,null))[_0x336c('0x48')](handleError(_0x17bfc9,null));};exports[_0x336c('0x4f')]=function(_0x2a0bf2,_0x4e0a2f){return db[_0x336c('0x43')][_0x336c('0x4f')]()['then'](respondWithResult(_0x4e0a2f,null))['catch'](handleError(_0x4e0a2f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e61ce4a..8651a57 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 _0x385a=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x147e56,_0x2efae8){var _0x40c49c=function(_0x380aaa){while(--_0x380aaa){_0x147e56['push'](_0x147e56['shift']());}};_0x40c49c(++_0x2efae8);}(_0x385a,0x1c2));var _0xa385=function(_0x5903ce,_0x111924){_0x5903ce=_0x5903ce-0x0;var _0x5677c7=_0x385a[_0x5903ce];return _0x5677c7;};'use strict';var _=require('lodash');var util=require(_0xa385('0x0'));var logger=require(_0xa385('0x1'))('api');var moment=require(_0xa385('0x2'));var BPromise=require(_0xa385('0x3'));var rp=require(_0xa385('0x4'));var fs=require('fs');var path=require(_0xa385('0x5'));var rimraf=require(_0xa385('0x6'));var config=require(_0xa385('0x7'));var attributes=require(_0xa385('0x8'));module[_0xa385('0x9')]=function(_0x2b44ae,_0x4431ed){return _0x2b44ae[_0xa385('0xa')](_0xa385('0xb'),attributes,{'tableName':_0xa385('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaad1=['../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment','bluebird','path','rimraf'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xaad1,0x19e));var _0x1aad=function(_0x488860,_0x31cc87){_0x488860=_0x488860-0x0;var _0x6a1a70=_0xaad1[_0x488860];return _0x6a1a70;};'use strict';var _=require(_0x1aad('0x0'));var util=require(_0x1aad('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1aad('0x2'));var BPromise=require(_0x1aad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aad('0x4'));var rimraf=require(_0x1aad('0x5'));var config=require(_0x1aad('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x582edc,_0x6e29a8){return _0x582edc[_0x1aad('0x7')](_0x1aad('0x8'),attributes,{'tableName':_0x1aad('0x9'),'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 7823ec0..5d58d04 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 _0xae1c=['stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','debug'];(function(_0x36438f,_0x32e3f6){var _0x595183=function(_0x2195c5){while(--_0x2195c5){_0x36438f['push'](_0x36438f['shift']());}};_0x595183(++_0x32e3f6);}(_0xae1c,0x15b));var _0xcae1=function(_0x21ff9c,_0x4eb5e1){_0x21ff9c=_0x21ff9c-0x0;var _0x40c478=_0xae1c[_0x21ff9c];return _0x40c478;};'use strict';var _=require('lodash');var util=require(_0xcae1('0x0'));var moment=require(_0xcae1('0x1'));var BPromise=require('bluebird');var rs=require(_0xcae1('0x2'));var fs=require('fs');var Redis=require(_0xcae1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcae1('0x4'));var logger=require(_0xcae1('0x5'))(_0xcae1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcae1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6c7c0,_0x376fa0,_0xe7df22){return new BPromise(function(_0x1dd857,_0x4008e9){return client[_0xcae1('0x8')](_0x6c7c0,_0xe7df22)[_0xcae1('0x9')](function(_0xa88241){logger[_0xcae1('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x376fa0,_0xcae1('0xb'));logger[_0xcae1('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x376fa0,_0xcae1('0xb'),JSON[_0xcae1('0xd')](_0xa88241));if(_0xa88241['error']){if(_0xa88241[_0xcae1('0xe')]['code']===0x1f4){logger[_0xcae1('0xe')](_0xcae1('0xf'),_0x376fa0,_0xa88241['error'][_0xcae1('0x10')]);return _0x4008e9(_0xa88241['error'][_0xcae1('0x10')]);}logger[_0xcae1('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x376fa0,_0xa88241[_0xcae1('0xe')][_0xcae1('0x10')]);return _0x1dd857(_0xa88241['error'][_0xcae1('0x10')]);}else{logger[_0xcae1('0xa')](_0xcae1('0xf'),_0x376fa0,_0xcae1('0xb'));_0x1dd857(_0xa88241[_0xcae1('0x11')][_0xcae1('0x10')]);}})['catch'](function(_0x5a49d5){logger[_0xcae1('0xe')](_0xcae1('0xf'),_0x376fa0,_0x5a49d5);_0x4008e9(_0x5a49d5);});});} \ No newline at end of file +var _0xca76=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x5a1244,_0x34217b){var _0x196126=function(_0x1d4505){while(--_0x1d4505){_0x5a1244['push'](_0x5a1244['shift']());}};_0x196126(++_0x34217b);}(_0xca76,0x14b));var _0x6ca7=function(_0x1c62e7,_0x997a2c){_0x1c62e7=_0x1c62e7-0x0;var _0x5850fa=_0xca76[_0x1c62e7];return _0x5850fa;};'use strict';var _=require(_0x6ca7('0x0'));var util=require('util');var moment=require(_0x6ca7('0x1'));var BPromise=require(_0x6ca7('0x2'));var rs=require(_0x6ca7('0x3'));var fs=require('fs');var Redis=require(_0x6ca7('0x4'));var db=require(_0x6ca7('0x5'))['db'];var utils=require(_0x6ca7('0x6'));var logger=require('../../config/logger')(_0x6ca7('0x7'));var config=require(_0x6ca7('0x8'));var jayson=require(_0x6ca7('0x9'));var client=jayson[_0x6ca7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48cdf5,_0x5aa68b,_0x272664){return new BPromise(function(_0x15f3ed,_0x4ae354){return client[_0x6ca7('0xb')](_0x48cdf5,_0x272664)[_0x6ca7('0xc')](function(_0x2dc4fe){logger[_0x6ca7('0xd')](_0x6ca7('0xe'),_0x5aa68b,'request\x20sent');logger[_0x6ca7('0xf')](_0x6ca7('0x10'),_0x5aa68b,_0x6ca7('0x11'),JSON[_0x6ca7('0x12')](_0x2dc4fe));if(_0x2dc4fe[_0x6ca7('0x13')]){if(_0x2dc4fe[_0x6ca7('0x13')]['code']===0x1f4){logger['error'](_0x6ca7('0xe'),_0x5aa68b,_0x2dc4fe[_0x6ca7('0x13')][_0x6ca7('0x14')]);return _0x4ae354(_0x2dc4fe[_0x6ca7('0x13')][_0x6ca7('0x14')]);}logger[_0x6ca7('0x13')](_0x6ca7('0xe'),_0x5aa68b,_0x2dc4fe[_0x6ca7('0x13')][_0x6ca7('0x14')]);return _0x15f3ed(_0x2dc4fe['error']['message']);}else{logger[_0x6ca7('0xd')](_0x6ca7('0xe'),_0x5aa68b,_0x6ca7('0x11'));_0x15f3ed(_0x2dc4fe['result'][_0x6ca7('0x14')]);}})[_0x6ca7('0x15')](function(_0x267404){logger[_0x6ca7('0x13')](_0x6ca7('0xe'),_0x5aa68b,_0x267404);_0x4ae354(_0x267404);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index bde685c..8ccab94 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 _0x2d47=['clone','put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x2d47,0x9c));var _0x72d4=function(_0x2defc4,_0x25dbea){_0x2defc4=_0x2defc4-0x0;var _0x10e80a=_0x2d47[_0x2defc4];return _0x10e80a;};'use strict';var multer=require('multer');var util=require(_0x72d4('0x0'));var path=require(_0x72d4('0x1'));var timeout=require('connect-timeout');var express=require(_0x72d4('0x2'));var router=express['Router']();var fs_extra=require(_0x72d4('0x3'));var auth=require(_0x72d4('0x4'));var interaction=require(_0x72d4('0x5'));var config=require(_0x72d4('0x6'));var controller=require(_0x72d4('0x7'));router['get']('/',auth[_0x72d4('0x8')](),controller['index']);router[_0x72d4('0x9')]('/:id',auth[_0x72d4('0x8')](),controller['show']);router[_0x72d4('0x9')](_0x72d4('0xa'),auth[_0x72d4('0x8')](),controller[_0x72d4('0xb')]);router[_0x72d4('0x9')]('/:id/answers',auth[_0x72d4('0x8')](),controller[_0x72d4('0xc')]);router['get'](_0x72d4('0xd'),auth['isAuthenticated'](),timeout(_0x72d4('0xe')),controller[_0x72d4('0xf')]);router['post']('/',auth[_0x72d4('0x8')](),controller[_0x72d4('0x10')]);router[_0x72d4('0x11')](_0x72d4('0x12'),auth[_0x72d4('0x8')](),controller[_0x72d4('0x13')]);router[_0x72d4('0x14')](_0x72d4('0x15'),auth[_0x72d4('0x8')](),controller[_0x72d4('0x16')]);router[_0x72d4('0x17')](_0x72d4('0x15'),auth[_0x72d4('0x8')](),controller[_0x72d4('0x18')]);module['exports']=router; \ No newline at end of file +var _0x3967=['/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','/:id/sessions','getSessions'];(function(_0x17d477,_0x19df54){var _0x5c3cae=function(_0x1ef130){while(--_0x1ef130){_0x17d477['push'](_0x17d477['shift']());}};_0x5c3cae(++_0x19df54);}(_0x3967,0x182));var _0x7396=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0x3967[_0x533132];return _0x1a7447;};'use strict';var multer=require('multer');var util=require(_0x7396('0x0'));var path=require(_0x7396('0x1'));var timeout=require(_0x7396('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7396('0x3'));var auth=require(_0x7396('0x4'));var interaction=require(_0x7396('0x5'));var config=require(_0x7396('0x6'));var controller=require(_0x7396('0x7'));router[_0x7396('0x8')]('/',auth['isAuthenticated'](),controller[_0x7396('0x9')]);router[_0x7396('0x8')](_0x7396('0xa'),auth[_0x7396('0xb')](),controller['show']);router[_0x7396('0x8')](_0x7396('0xc'),auth[_0x7396('0xb')](),controller[_0x7396('0xd')]);router[_0x7396('0x8')](_0x7396('0xe'),auth[_0x7396('0xb')](),controller[_0x7396('0xf')]);router['get'](_0x7396('0x10'),auth[_0x7396('0xb')](),timeout('30s'),controller[_0x7396('0x11')]);router['post']('/',auth[_0x7396('0xb')](),controller[_0x7396('0x12')]);router[_0x7396('0x13')](_0x7396('0x14'),auth[_0x7396('0xb')](),controller['clone']);router['put'](_0x7396('0xa'),auth[_0x7396('0xb')](),controller[_0x7396('0x15')]);router[_0x7396('0x16')](_0x7396('0xa'),auth[_0x7396('0xb')](),controller[_0x7396('0x17')]);module[_0x7396('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a4fa36f..afedf72 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 _0x255a=['format','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue'];(function(_0x53258e,_0xc6575d){var _0x236c9d=function(_0x1c22d2){while(--_0x1c22d2){_0x53258e['push'](_0x53258e['shift']());}};_0x236c9d(++_0xc6575d);}(_0x255a,0xd4));var _0xa255=function(_0x2ed43c,_0x2deea6){_0x2ed43c=_0x2ed43c-0x0;var _0x4ec9a2=_0x255a[_0x2ed43c];return _0x4ec9a2;};'use strict';var Sequelize=require(_0xa255('0x0'));var _=require(_0xa255('0x1'));var util=require(_0xa255('0x2'));module['exports']={'name':{'type':Sequelize[_0xa255('0x3')],'unique':_0xa255('0x4')},'description':{'type':Sequelize[_0xa255('0x3')]},'formData':{'type':Sequelize[_0xa255('0x5')](_0xa255('0x6')),'set':function(_0x409e05){if(_[_0xa255('0x7')](_0x409e05)){this['setDataValue'](_0xa255('0x8'),JSON[_0xa255('0x9')](_0x409e05));}else if(_[_0xa255('0xa')](_0x409e05)){this[_0xa255('0xb')](_0xa255('0x8'),_0x409e05);}else{this['setDataValue']('formData',util[_0xa255('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xa255('0xd')]('name')||'',this['getDataValue'](_0xa255('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa255('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf98=['name','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING'];(function(_0x6f9bdb,_0x13712c){var _0x6670fc=function(_0x48168c){while(--_0x48168c){_0x6f9bdb['push'](_0x6f9bdb['shift']());}};_0x6670fc(++_0x13712c);}(_0xaf98,0x185));var _0x8af9=function(_0x333bc8,_0x290a9e){_0x333bc8=_0x333bc8-0x0;var _0x53ec77=_0xaf98[_0x333bc8];return _0x53ec77;};'use strict';var Sequelize=require('sequelize');var _=require(_0x8af9('0x0'));var util=require(_0x8af9('0x1'));module['exports']={'name':{'type':Sequelize[_0x8af9('0x2')],'unique':_0x8af9('0x3')},'description':{'type':Sequelize[_0x8af9('0x2')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x472f43){if(_[_0x8af9('0x4')](_0x472f43)){this[_0x8af9('0x5')](_0x8af9('0x6'),JSON[_0x8af9('0x7')](_0x472f43));}else if(_[_0x8af9('0x8')](_0x472f43)){this[_0x8af9('0x5')](_0x8af9('0x6'),_0x472f43);}else{this[_0x8af9('0x5')](_0x8af9('0x6'),util[_0x8af9('0x9')](_0x8af9('0xa'),this[_0x8af9('0xb')](_0x8af9('0x3'))||'',this[_0x8af9('0xb')](_0x8af9('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8af9('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index f113e02..627cda9 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 _0xd004=['findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','update'];(function(_0x5d0b83,_0x533cd6){var _0x56eaa2=function(_0x4f25c2){while(--_0x4f25c2){_0x5d0b83['push'](_0x5d0b83['shift']());}};_0x56eaa2(++_0x533cd6);}(_0xd004,0x181));var _0x4d00=function(_0x2411ea,_0x4e2188){_0x2411ea=_0x2411ea-0x0;var _0x4b9644=_0xd004[_0x2411ea];return _0x4b9644;};'use strict';var emlformat=require(_0x4d00('0x0'));var rimraf=require(_0x4d00('0x1'));var zipdir=require(_0x4d00('0x2'));var jsonpatch=require(_0x4d00('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d00('0x4'));var Mustache=require(_0x4d00('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4d00('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d00('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d00('0x8'));var deskjs=require(_0x4d00('0x9'));var toCsv=require(_0x4d00('0x6'));var querystring=require(_0x4d00('0xa'));var Papa=require(_0x4d00('0xb'));var Redis=require('ioredis');var authService=require(_0x4d00('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4d00('0xd'));var hardwareService=require(_0x4d00('0xe'));var logger=require('../../config/logger')(_0x4d00('0xf'));var utils=require(_0x4d00('0x10'));var config=require(_0x4d00('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaeac,_0x38ff0e){_0x38ff0e=_0x38ff0e||0xcc;return function(_0x47726e){if(_0x47726e){return _0x3eaeac[_0x4d00('0x12')](_0x38ff0e);}return _0x3eaeac['status'](_0x38ff0e)[_0x4d00('0x13')]();};}function respondWithResult(_0x39d68c,_0x5124c3){_0x5124c3=_0x5124c3||0xc8;return function(_0x588c31){if(_0x588c31){return _0x39d68c['status'](_0x5124c3)[_0x4d00('0x14')](_0x588c31);}};}function respondWithFilteredResult(_0x233de3,_0x30f3f4){return function(_0x58d56a){if(_0x58d56a){var _0x433a7b=typeof _0x30f3f4[_0x4d00('0x15')]===_0x4d00('0x16')&&typeof _0x30f3f4[_0x4d00('0x17')]===_0x4d00('0x16');var _0x433b1b=_0x58d56a[_0x4d00('0x18')];var _0x398a08=_0x433a7b?0x0:_0x30f3f4[_0x4d00('0x15')];var _0x2bf553=_0x433a7b?_0x58d56a[_0x4d00('0x18')]:_0x30f3f4[_0x4d00('0x15')]+_0x30f3f4[_0x4d00('0x17')];var _0x827890;if(_0x2bf553>=_0x433b1b){_0x2bf553=_0x433b1b;_0x827890=0xc8;}else{_0x827890=0xce;}_0x233de3[_0x4d00('0x19')](_0x827890);return _0x233de3[_0x4d00('0x1a')](_0x4d00('0x1b'),_0x398a08+'-'+_0x2bf553+'/'+_0x433b1b)['json'](_0x58d56a);}return null;};}function patchUpdates(_0x522066){return function(_0x17877b){try{jsonpatch[_0x4d00('0x1c')](_0x17877b,_0x522066,!![]);}catch(_0x38b460){return BPromise[_0x4d00('0x1d')](_0x38b460);}return _0x17877b[_0x4d00('0x1e')]();};}function saveUpdates(_0x102213,_0x58c7c7){return function(_0x4bf02e){if(_0x4bf02e){return _0x4bf02e['update'](_0x102213)[_0x4d00('0x1f')](function(_0xf70e8e){return _0xf70e8e;});}return null;};}function removeEntity(_0x2a2c74,_0x32a910){return function(_0x3e3d7f){if(_0x3e3d7f){return _0x3e3d7f[_0x4d00('0x20')]()[_0x4d00('0x1f')](function(){var _0x38b95e=_0x3e3d7f[_0x4d00('0x21')]({'plain':!![]});var _0x1a4553='Projects';return db[_0x4d00('0x22')][_0x4d00('0x20')]({'where':{'type':_0x1a4553,'resourceId':_0x38b95e['id']}})['then'](function(){return _0x3e3d7f;});})[_0x4d00('0x1f')](function(){_0x2a2c74[_0x4d00('0x19')](0xcc)[_0x4d00('0x13')]();});}};}function handleEntityNotFound(_0x3640ab,_0x6b106c){return function(_0x6df58c){if(!_0x6df58c){_0x3640ab[_0x4d00('0x12')](0x194);}return _0x6df58c;};}function handleError(_0x29a045,_0x85a5dd){_0x85a5dd=_0x85a5dd||0x1f4;return function(_0x7ae64d){logger['error'](_0x7ae64d['stack']);if(_0x7ae64d[_0x4d00('0x23')]){delete _0x7ae64d[_0x4d00('0x23')];}_0x29a045[_0x4d00('0x19')](_0x85a5dd)[_0x4d00('0x24')](_0x7ae64d);};}exports[_0x4d00('0x25')]=function(_0x1de92d,_0x703ce1){var _0x1b7adf={},_0x2649c2={},_0x461b6a={'count':0x0,'rows':[]};var _0x16e714=_[_0x4d00('0x26')](db[_0x4d00('0x27')][_0x4d00('0x28')],function(_0x4f4e9a){return{'name':_0x4f4e9a[_0x4d00('0x29')],'type':_0x4f4e9a[_0x4d00('0x2a')]['key']};});_0x2649c2['model']=_['map'](_0x16e714,_0x4d00('0x23'));_0x2649c2['query']=_[_0x4d00('0x2b')](_0x1de92d[_0x4d00('0x2c')]);_0x2649c2['filters']=_[_0x4d00('0x2d')](_0x2649c2['model'],_0x2649c2[_0x4d00('0x2c')]);_0x1b7adf[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x2649c2[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x1de92d[_0x4d00('0x2c')]['fields']));_0x1b7adf['attributes']=_0x1b7adf[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x1b7adf['attributes']:_0x2649c2['model'];if(!_0x1de92d['query'][_0x4d00('0x32')](_0x4d00('0x33'))){_0x1b7adf[_0x4d00('0x17')]=qs[_0x4d00('0x17')](_0x1de92d['query'][_0x4d00('0x17')]);_0x1b7adf['offset']=qs[_0x4d00('0x15')](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x15')]);}_0x1b7adf[_0x4d00('0x34')]=qs['sort'](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x1b7adf['where']=qs['filters'](_[_0x4d00('0x36')](_0x1de92d[_0x4d00('0x2c')],_0x2649c2[_0x4d00('0x37')]),_0x16e714);if(_0x1de92d['query']['filter']){_0x1b7adf[_0x4d00('0x38')]=_['merge'](_0x1b7adf[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x16e714,function(_0x248d0e){if(_0x248d0e[_0x4d00('0x2a')]!==_0x4d00('0x39')){var _0x5291ed={};_0x5291ed[_0x248d0e['name']]={'$like':'%'+_0x1de92d['query'][_0x4d00('0x3a')]+'%'};return _0x5291ed;}})});}_0x1b7adf=_[_0x4d00('0x3b')]({},_0x1b7adf,_0x1de92d[_0x4d00('0x3c')]);var _0xdaebc8={'where':_0x1b7adf[_0x4d00('0x38')]};return db[_0x4d00('0x27')][_0x4d00('0x18')](_0xdaebc8)[_0x4d00('0x1f')](function(_0x341ee7){_0x461b6a[_0x4d00('0x18')]=_0x341ee7;if(_0x1de92d[_0x4d00('0x2c')]['includeAll']){_0x1b7adf[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x27')][_0x4d00('0x3e')](_0x1b7adf);})['then'](function(_0x2162cc){_0x461b6a['rows']=_0x2162cc;return _0x461b6a;})[_0x4d00('0x1f')](respondWithFilteredResult(_0x703ce1,_0x1b7adf))[_0x4d00('0x3f')](handleError(_0x703ce1,null));};exports[_0x4d00('0x40')]=function(_0x3b08f5,_0x140864){var _0x30143f={'raw':![],'where':{'id':_0x3b08f5[_0x4d00('0x41')]['id']}},_0x4be1b2={};_0x4be1b2[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x27')][_0x4d00('0x28')]);_0x4be1b2[_0x4d00('0x2c')]=_['keys'](_0x3b08f5[_0x4d00('0x2c')]);_0x4be1b2[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],_0x4be1b2[_0x4d00('0x2c')]);_0x30143f[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],qs['fields'](_0x3b08f5[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x30143f[_0x4d00('0x2e')]=_0x30143f['attributes'][_0x4d00('0x31')]?_0x30143f[_0x4d00('0x2e')]:_0x4be1b2['model'];if(_0x3b08f5[_0x4d00('0x2c')]['includeAll']){_0x30143f[_0x4d00('0x3d')]=[{'all':!![]}];}_0x30143f=_[_0x4d00('0x3b')]({},_0x30143f,_0x3b08f5['options']);return db['JscriptyProject'][_0x4d00('0x42')](_0x30143f)[_0x4d00('0x1f')](handleEntityNotFound(_0x140864,null))[_0x4d00('0x1f')](respondWithResult(_0x140864,null))[_0x4d00('0x3f')](handleError(_0x140864,null));};exports[_0x4d00('0x43')]=function(_0x316136,_0x5b29e5){return db['JscriptyProject']['create'](_0x316136[_0x4d00('0x44')],{})[_0x4d00('0x1f')](function(_0x5ed0d2){var _0x13bf4f=_0x316136[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x13bf4f)throw new Error(_0x4d00('0x46'));if(_0x13bf4f[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x3ee807=_0x5ed0d2[_0x4d00('0x21')]({'plain':!![]});var _0x8cf582=_0x4d00('0x48');return db[_0x4d00('0x49')][_0x4d00('0x42')]({'where':{'name':_0x8cf582,'userProfileId':_0x13bf4f[_0x4d00('0x4a')]},'raw':!![]})['then'](function(_0x3110d9){if(_0x3110d9&&_0x3110d9[_0x4d00('0x4b')]===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x3ee807[_0x4d00('0x23')],'resourceId':_0x3ee807['id'],'type':_0x3110d9[_0x4d00('0x23')],'sectionId':_0x3110d9['id']},{})['then'](function(){return _0x5ed0d2;});}else{return _0x5ed0d2;}})[_0x4d00('0x3f')](function(_0x533bcb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x533bcb);throw _0x533bcb;});}return _0x5ed0d2;})[_0x4d00('0x1f')](respondWithResult(_0x5b29e5,0xc9))[_0x4d00('0x3f')](handleError(_0x5b29e5,null));};exports[_0x4d00('0x4e')]=function(_0x1a6943,_0xffb7b2){var _0x671e6d={'where':{'id':_0x1a6943[_0x4d00('0x41')]['id']}},_0x42959b={};_0x42959b['model']=_[_0x4d00('0x2b')](db[_0x4d00('0x27')]['rawAttributes']);_0x671e6d[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x42959b['model'],qs['fields'](_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x671e6d[_0x4d00('0x2e')]=_0x671e6d[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x671e6d[_0x4d00('0x2e')]:_0x42959b['model'];if(_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x671e6d[_0x4d00('0x3d')]=[{'all':!![]}];}_0x671e6d=_['merge']({},_0x671e6d,_0x1a6943[_0x4d00('0x3c')]);return db[_0x4d00('0x27')]['find'](_0x671e6d)[_0x4d00('0x1f')](handleEntityNotFound(_0xffb7b2,null))[_0x4d00('0x1f')](function(_0x4eb78c){if(_0x4eb78c){var _0x3ae133=_0x4eb78c[_0x4d00('0x21')]({'plain':!![]});_0x3ae133=qs['omit'](_0x3ae133,['id','createdAt','updatedAt']);_0x1a6943[_0x4d00('0x44')]=_[_0x4d00('0x50')](_0x1a6943[_0x4d00('0x44')],['id',_0x4d00('0x51'),'updatedAt']);return db[_0x4d00('0x27')]['create'](_[_0x4d00('0x3b')](_0x3ae133,_0x1a6943[_0x4d00('0x44')]),{'include':_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]?[{'all':!![]}]:undefined})[_0x4d00('0x1f')](function(_0x5710f6){var _0x1756df=_0x1a6943[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x1756df)throw new Error(_0x4d00('0x46'));if(_0x1756df[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x5df86b=_0x5710f6[_0x4d00('0x21')]({'plain':!![]});var _0x2f206d=_0x4d00('0x48');return db['UserProfileSection'][_0x4d00('0x42')]({'where':{'name':_0x2f206d,'userProfileId':_0x1756df[_0x4d00('0x4a')]},'raw':!![]})[_0x4d00('0x1f')](function(_0x95567d){if(_0x95567d&&_0x95567d['autoAssociation']===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x5df86b[_0x4d00('0x23')],'resourceId':_0x5df86b['id'],'type':_0x95567d[_0x4d00('0x23')],'sectionId':_0x95567d['id']},{})[_0x4d00('0x1f')](function(){return _0x5710f6;});}else{return _0x5710f6;}})['catch'](function(_0x15aeeb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x15aeeb);throw _0x15aeeb;});}return _0x5710f6;});}})[_0x4d00('0x1f')](respondWithResult(_0xffb7b2,0xc9))[_0x4d00('0x3f')](handleError(_0xffb7b2,null));};exports[_0x4d00('0x52')]=function(_0x271fac,_0x843471){if(_0x271fac[_0x4d00('0x44')]['id']){delete _0x271fac['body']['id'];}return db[_0x4d00('0x27')]['find']({'where':{'id':_0x271fac['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x843471,null))['then'](saveUpdates(_0x271fac[_0x4d00('0x44')],null))['then'](respondWithResult(_0x843471,null))[_0x4d00('0x3f')](handleError(_0x843471,null));};exports[_0x4d00('0x20')]=function(_0x1065b5,_0x4c6958){return db[_0x4d00('0x27')][_0x4d00('0x42')]({'where':{'id':_0x1065b5[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x4c6958,null))['then'](removeEntity(_0x4c6958,null))[_0x4d00('0x3f')](handleError(_0x4c6958,null));};exports['getSessions']=function(_0x456eaa,_0x5e2ee2,_0x1a7a64){var _0x539790={'raw':!![],'where':{}};var _0x3aa893={};var _0x1cfb25={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4d00('0x53')]({'where':{'id':_0x456eaa[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x5e2ee2,null))[_0x4d00('0x1f')](function(_0xb12a37){if(_0xb12a37){_0x3aa893[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x54')][_0x4d00('0x28')]);_0x3aa893[_0x4d00('0x2c')]=_[_0x4d00('0x2b')](_0x456eaa[_0x4d00('0x2c')]);_0x3aa893['filters']=_[_0x4d00('0x2d')](_0x3aa893[_0x4d00('0x2f')],_0x3aa893[_0x4d00('0x2c')]);_0x539790[_0x4d00('0x2e')]=_['intersection'](_0x3aa893[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x539790[_0x4d00('0x2e')]=_0x539790[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x539790[_0x4d00('0x2e')]:_0x3aa893[_0x4d00('0x2f')];if(!_0x456eaa[_0x4d00('0x2c')]['hasOwnProperty'](_0x4d00('0x33'))){_0x539790['limit']=qs['limit'](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x539790[_0x4d00('0x15')]=qs[_0x4d00('0x15')](_0x456eaa[_0x4d00('0x2c')]['offset']);}_0x539790[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x539790[_0x4d00('0x38')]=qs['filters'](_[_0x4d00('0x36')](_0x456eaa[_0x4d00('0x2c')],_0x3aa893['filters']));_0x539790[_0x4d00('0x38')][_0x4d00('0x55')]=_0xb12a37['id'];if(_0x456eaa['query'][_0x4d00('0x3a')]){_0x539790['where']=_[_0x4d00('0x3b')](_0x539790['where'],{'$or':_[_0x4d00('0x26')](_0x539790[_0x4d00('0x2e')],function(_0x32b109){var _0x13b511={};_0x13b511[_0x32b109]={'$like':'%'+_0x456eaa['query'][_0x4d00('0x3a')]+'%'};return _0x13b511;})});}_0x539790=_[_0x4d00('0x3b')]({},_0x539790,_0x456eaa['options']);return db['JscriptySessionReport'][_0x4d00('0x18')]({'where':_0x539790[_0x4d00('0x38')]})['then'](function(_0x2add61){_0x1cfb25[_0x4d00('0x18')]=_0x2add61;if(_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x539790[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x539790);})[_0x4d00('0x1f')](function(_0x1473a3){_0x1cfb25[_0x4d00('0x56')]=_0x1473a3;return _0x1cfb25;});}})[_0x4d00('0x1f')](respondWithFilteredResult(_0x5e2ee2,_0x539790))[_0x4d00('0x3f')](handleError(_0x5e2ee2,null));};exports[_0x4d00('0x57')]=function(_0x5a6da4,_0x446039,_0x3a64c5){var _0x4f3e2c={'raw':!![],'where':{}};var _0x5a2a74={};var _0x4f2791={'count':0x0,'rows':[]};return db[_0x4d00('0x27')]['findOne']({'where':{'id':_0x5a6da4['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x446039,null))[_0x4d00('0x1f')](function(_0x14df34){if(_0x14df34){_0x5a2a74[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x58')][_0x4d00('0x28')]);_0x5a2a74[_0x4d00('0x2c')]=_['keys'](_0x5a6da4[_0x4d00('0x2c')]);_0x5a2a74[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x5a2a74[_0x4d00('0x2f')],_0x5a2a74[_0x4d00('0x2c')]);_0x4f3e2c[_0x4d00('0x2e')]=_['intersection'](_0x5a2a74[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x4f3e2c[_0x4d00('0x2e')]=_0x4f3e2c['attributes'][_0x4d00('0x31')]?_0x4f3e2c[_0x4d00('0x2e')]:_0x5a2a74[_0x4d00('0x2f')];if(!_0x5a6da4['query']['hasOwnProperty'](_0x4d00('0x33'))){_0x4f3e2c[_0x4d00('0x17')]=qs['limit'](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x4f3e2c[_0x4d00('0x15')]=qs['offset'](_0x5a6da4['query'][_0x4d00('0x15')]);}_0x4f3e2c[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x4f3e2c[_0x4d00('0x38')]=qs[_0x4d00('0x37')](_[_0x4d00('0x36')](_0x5a6da4[_0x4d00('0x2c')],_0x5a2a74[_0x4d00('0x37')]));_0x4f3e2c[_0x4d00('0x38')]['ProjectId']=_0x14df34['id'];if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]){_0x4f3e2c[_0x4d00('0x38')]=_[_0x4d00('0x3b')](_0x4f3e2c[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x4f3e2c[_0x4d00('0x2e')],function(_0x2c99c4){var _0x52b938={};_0x52b938[_0x2c99c4]={'$like':'%'+_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]+'%'};return _0x52b938;})});}_0x4f3e2c=_[_0x4d00('0x3b')]({},_0x4f3e2c,_0x5a6da4[_0x4d00('0x3c')]);return db[_0x4d00('0x58')][_0x4d00('0x18')]({'where':_0x4f3e2c[_0x4d00('0x38')]})[_0x4d00('0x1f')](function(_0xfc9e0f){_0x4f2791['count']=_0xfc9e0f;if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x4f3e2c[_0x4d00('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4d00('0x3e')](_0x4f3e2c);})[_0x4d00('0x1f')](function(_0x213554){_0x4f2791[_0x4d00('0x56')]=_0x213554;return _0x4f2791;});}})['then'](respondWithFilteredResult(_0x446039,_0x4f3e2c))[_0x4d00('0x3f')](handleError(_0x446039,null));};function char(_0x106dc1){return _0x4d00('0x59')===typeof _0x106dc1?String[_0x4d00('0x5a')][_0x4d00('0x1c')](null,arguments):_0x106dc1;}function needsEncapsulation(_0x515ae6){return!!_0x515ae6&&(_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0xd))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0xa))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x547f65){var _0x366e32=char(0x22),_0x3822a0='\x5c'+char(0x22),_0x9bac0b=_0x547f65[_0x4d00('0x5b')]()[_0x4d00('0x5d')](new RegExp(_0x366e32,'g'),_0x3822a0);return _0x366e32+_0x9bac0b+_0x366e32;}exports['getSummary']=function(_0x325dc5,_0x40a8c4,_0x95d9aa){var _0x5914c5,_0x162170;var _0x535a02={'where':{'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']}};if(_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]){_0x535a02[_0x4d00('0x38')][_0x4d00('0x5f')]=JSON[_0x4d00('0x60')](_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]);}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x535a02)[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x6780df){if(_0x6780df){_0x5914c5=_0x6780df;return db[_0x4d00('0x61')][_0x4d00('0x3e')]({'where':{'SessionId':{'$in':_[_0x4d00('0x26')](_0x5914c5,'id')},'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']},'order':_0x4d00('0x62')});}})[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x1cf577){if(_0x1cf577){_0x162170=_0x1cf577;var _0x499ce4={};for(var _0x4e801c=0x0,_0x3beeeb=_0x162170['length'];_0x4e801c<_0x3beeeb;_0x4e801c++){if(!_0x499ce4['hasOwnProperty'](_0x162170[_0x4e801c]['questionId'])){_0x499ce4[_0x162170[_0x4e801c][_0x4d00('0x63')]]=needsEncapsulation(_0x162170[_0x4e801c]['question'])?encapsulate(_0x162170[_0x4e801c][_0x4d00('0x64')]):_0x162170[_0x4e801c][_0x4d00('0x64')];}}var _0x1f5e4c=[],_0x594397={};for(var _0x34eda6=0x0,_0x50a2fb=_0x5914c5['length'];_0x34eda6<_0x50a2fb;_0x34eda6++){_0x594397={'ProjectId':_0x325dc5[_0x4d00('0x41')]['id'],'SessionId':_0x5914c5[_0x34eda6]['id'],'StartTime':moment(_0x5914c5[_0x34eda6][_0x4d00('0x5f')])[_0x4d00('0x65')](_0x4d00('0x66'))};for(var _0x4af27b=0x0,_0x26a803=_0x162170[_0x4d00('0x31')];_0x4af27b<_0x26a803;_0x4af27b++){if(_0x162170[_0x4af27b][_0x4d00('0x67')]==_0x5914c5[_0x34eda6]['id']&&_0x499ce4[_0x4d00('0x32')](_0x162170[_0x4af27b]['questionId'])){_0x594397[_0x499ce4[_0x162170[_0x4af27b][_0x4d00('0x63')]]]=_0x162170[_0x4af27b][_0x4d00('0x68')];}}for(var _0x74dce4 in _0x499ce4){if(!_0x594397[_0x4d00('0x32')](_0x499ce4[_0x74dce4])){_0x594397[_0x499ce4[_0x74dce4]]=null;}}_0x1f5e4c[_0x4d00('0x69')](_0x594397);}return _0x1f5e4c;}})[_0x4d00('0x1f')](function(_0x597aff){if(!_[_0x4d00('0x6a')](_0x597aff)){var _0x80c016=toCsv(_0x597aff);var _0x4b933a=Date[_0x4d00('0x6b')]();fs[_0x4d00('0x6c')](util[_0x4d00('0x65')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a),_0x80c016);_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x6e'),_0x4d00('0x6f')+util[_0x4d00('0x65')](_0x4d00('0x70'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x71'),_0x4d00('0x72'));return _0x40a8c4[_0x4d00('0x73')](util[_0x4d00('0x65')](_0x4d00('0x74'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));}else{return _0x40a8c4['sendStatus'](0xcc);}})[_0x4d00('0x3f')](handleError(_0x40a8c4,null));}; \ No newline at end of file +var _0x0268=['updatedAt','createdAt','update','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','download','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','then','destroy','get','Projects','UserProfileResource','error','stack','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','name','filter','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x124216,_0x594b68){var _0x5abc97=function(_0x4c4419){while(--_0x4c4419){_0x124216['push'](_0x124216['shift']());}};_0x5abc97(++_0x594b68);}(_0x0268,0x17e));var _0x8026=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0268[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x8026('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8026('0x1'));var jsonpatch=require(_0x8026('0x2'));var rp=require('request-promise');var moment=require(_0x8026('0x3'));var BPromise=require(_0x8026('0x4'));var Mustache=require(_0x8026('0x5'));var util=require(_0x8026('0x6'));var path=require(_0x8026('0x7'));var sox=require('sox');var csv=require(_0x8026('0x8'));var ejs=require(_0x8026('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8026('0xa'));var squel=require(_0x8026('0xb'));var crypto=require(_0x8026('0xc'));var jsforce=require(_0x8026('0xd'));var deskjs=require(_0x8026('0xe'));var toCsv=require(_0x8026('0x8'));var querystring=require(_0x8026('0xf'));var Papa=require(_0x8026('0x10'));var Redis=require(_0x8026('0x11'));var authService=require(_0x8026('0x12'));var qs=require(_0x8026('0x13'));var as=require(_0x8026('0x14'));var hardwareService=require(_0x8026('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8026('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8026('0x17'))['db'];function respondWithStatusCode(_0x1fa831,_0x386b8c){_0x386b8c=_0x386b8c||0xcc;return function(_0x3898d2){if(_0x3898d2){return _0x1fa831[_0x8026('0x18')](_0x386b8c);}return _0x1fa831[_0x8026('0x19')](_0x386b8c)[_0x8026('0x1a')]();};}function respondWithResult(_0x386ddc,_0x2e0d72){_0x2e0d72=_0x2e0d72||0xc8;return function(_0x2b9da3){if(_0x2b9da3){return _0x386ddc[_0x8026('0x19')](_0x2e0d72)[_0x8026('0x1b')](_0x2b9da3);}};}function respondWithFilteredResult(_0x24c5b2,_0x324e50){return function(_0x276623){if(_0x276623){var _0x10057d=typeof _0x324e50[_0x8026('0x1c')]==='undefined'&&typeof _0x324e50['limit']===_0x8026('0x1d');var _0x27d2f5=_0x276623[_0x8026('0x1e')];var _0x49094d=_0x10057d?0x0:_0x324e50[_0x8026('0x1c')];var _0x5df1f6=_0x10057d?_0x276623[_0x8026('0x1e')]:_0x324e50[_0x8026('0x1c')]+_0x324e50['limit'];var _0x1a7ddb;if(_0x5df1f6>=_0x27d2f5){_0x5df1f6=_0x27d2f5;_0x1a7ddb=0xc8;}else{_0x1a7ddb=0xce;}_0x24c5b2[_0x8026('0x19')](_0x1a7ddb);return _0x24c5b2[_0x8026('0x1f')]('Content-Range',_0x49094d+'-'+_0x5df1f6+'/'+_0x27d2f5)['json'](_0x276623);}return null;};}function patchUpdates(_0x4548a6){return function(_0x351b9c){try{jsonpatch['apply'](_0x351b9c,_0x4548a6,!![]);}catch(_0x30c9dd){return BPromise[_0x8026('0x20')](_0x30c9dd);}return _0x351b9c['save']();};}function saveUpdates(_0x1b98a5,_0x3366b2){return function(_0xe6e4c3){if(_0xe6e4c3){return _0xe6e4c3['update'](_0x1b98a5)[_0x8026('0x21')](function(_0x442f83){return _0x442f83;});}return null;};}function removeEntity(_0x52b30a,_0x195d94){return function(_0x3222b2){if(_0x3222b2){return _0x3222b2[_0x8026('0x22')]()[_0x8026('0x21')](function(){var _0x1e5bf0=_0x3222b2[_0x8026('0x23')]({'plain':!![]});var _0x570bb7=_0x8026('0x24');return db[_0x8026('0x25')][_0x8026('0x22')]({'where':{'type':_0x570bb7,'resourceId':_0x1e5bf0['id']}})[_0x8026('0x21')](function(){return _0x3222b2;});})[_0x8026('0x21')](function(){_0x52b30a[_0x8026('0x19')](0xcc)[_0x8026('0x1a')]();});}};}function handleEntityNotFound(_0x49d212,_0x5a04bb){return function(_0x214778){if(!_0x214778){_0x49d212[_0x8026('0x18')](0x194);}return _0x214778;};}function handleError(_0x45c2bf,_0x211234){_0x211234=_0x211234||0x1f4;return function(_0x414eca){logger[_0x8026('0x26')](_0x414eca[_0x8026('0x27')]);if(_0x414eca['name']){delete _0x414eca['name'];}_0x45c2bf[_0x8026('0x19')](_0x211234)[_0x8026('0x28')](_0x414eca);};}exports[_0x8026('0x29')]=function(_0x3f3ae4,_0x5577ed){var _0x26273c={},_0x1bcf9f={},_0x454286={'count':0x0,'rows':[]};var _0x3b4a42=_[_0x8026('0x2a')](db[_0x8026('0x2b')][_0x8026('0x2c')],function(_0x204dd2){return{'name':_0x204dd2[_0x8026('0x2d')],'type':_0x204dd2['type'][_0x8026('0x2e')]};});_0x1bcf9f[_0x8026('0x2f')]=_[_0x8026('0x2a')](_0x3b4a42,'name');_0x1bcf9f[_0x8026('0x30')]=_[_0x8026('0x31')](_0x3f3ae4[_0x8026('0x30')]);_0x1bcf9f[_0x8026('0x32')]=_[_0x8026('0x33')](_0x1bcf9f[_0x8026('0x2f')],_0x1bcf9f[_0x8026('0x30')]);_0x26273c[_0x8026('0x34')]=_['intersection'](_0x1bcf9f[_0x8026('0x2f')],qs[_0x8026('0x35')](_0x3f3ae4[_0x8026('0x30')][_0x8026('0x35')]));_0x26273c[_0x8026('0x34')]=_0x26273c['attributes']['length']?_0x26273c[_0x8026('0x34')]:_0x1bcf9f[_0x8026('0x2f')];if(!_0x3f3ae4[_0x8026('0x30')][_0x8026('0x36')](_0x8026('0x37'))){_0x26273c[_0x8026('0x38')]=qs[_0x8026('0x38')](_0x3f3ae4[_0x8026('0x30')][_0x8026('0x38')]);_0x26273c[_0x8026('0x1c')]=qs['offset'](_0x3f3ae4[_0x8026('0x30')][_0x8026('0x1c')]);}_0x26273c[_0x8026('0x39')]=qs[_0x8026('0x3a')](_0x3f3ae4[_0x8026('0x30')][_0x8026('0x3a')]);_0x26273c['where']=qs[_0x8026('0x32')](_[_0x8026('0x3b')](_0x3f3ae4[_0x8026('0x30')],_0x1bcf9f['filters']),_0x3b4a42);if(_0x3f3ae4[_0x8026('0x30')]['filter']){_0x26273c[_0x8026('0x3c')]=_[_0x8026('0x3d')](_0x26273c[_0x8026('0x3c')],{'$or':_[_0x8026('0x2a')](_0x3b4a42,function(_0x967992){if(_0x967992[_0x8026('0x3e')]!==_0x8026('0x3f')){var _0x526ef4={};_0x526ef4[_0x967992[_0x8026('0x40')]]={'$like':'%'+_0x3f3ae4[_0x8026('0x30')][_0x8026('0x41')]+'%'};return _0x526ef4;}})});}_0x26273c=_[_0x8026('0x3d')]({},_0x26273c,_0x3f3ae4[_0x8026('0x42')]);var _0x1a9608={'where':_0x26273c[_0x8026('0x3c')]};return db[_0x8026('0x2b')][_0x8026('0x1e')](_0x1a9608)[_0x8026('0x21')](function(_0x404037){_0x454286[_0x8026('0x1e')]=_0x404037;if(_0x3f3ae4[_0x8026('0x30')][_0x8026('0x43')]){_0x26273c['include']=[{'all':!![]}];}return db[_0x8026('0x2b')][_0x8026('0x44')](_0x26273c);})[_0x8026('0x21')](function(_0x27616a){_0x454286[_0x8026('0x45')]=_0x27616a;return _0x454286;})[_0x8026('0x21')](respondWithFilteredResult(_0x5577ed,_0x26273c))[_0x8026('0x46')](handleError(_0x5577ed,null));};exports[_0x8026('0x47')]=function(_0x50e941,_0x96341c){var _0x21fa0a={'raw':![],'where':{'id':_0x50e941[_0x8026('0x48')]['id']}},_0x445413={};_0x445413[_0x8026('0x2f')]=_['keys'](db[_0x8026('0x2b')]['rawAttributes']);_0x445413[_0x8026('0x30')]=_[_0x8026('0x31')](_0x50e941[_0x8026('0x30')]);_0x445413['filters']=_[_0x8026('0x33')](_0x445413[_0x8026('0x2f')],_0x445413[_0x8026('0x30')]);_0x21fa0a[_0x8026('0x34')]=_[_0x8026('0x33')](_0x445413[_0x8026('0x2f')],qs['fields'](_0x50e941[_0x8026('0x30')][_0x8026('0x35')]));_0x21fa0a[_0x8026('0x34')]=_0x21fa0a['attributes'][_0x8026('0x49')]?_0x21fa0a[_0x8026('0x34')]:_0x445413[_0x8026('0x2f')];if(_0x50e941[_0x8026('0x30')][_0x8026('0x43')]){_0x21fa0a[_0x8026('0x4a')]=[{'all':!![]}];}_0x21fa0a=_[_0x8026('0x3d')]({},_0x21fa0a,_0x50e941['options']);return db[_0x8026('0x2b')][_0x8026('0x4b')](_0x21fa0a)[_0x8026('0x21')](handleEntityNotFound(_0x96341c,null))[_0x8026('0x21')](respondWithResult(_0x96341c,null))[_0x8026('0x46')](handleError(_0x96341c,null));};exports['create']=function(_0x58cad4,_0x5c6f74){return db['JscriptyProject'][_0x8026('0x4c')](_0x58cad4[_0x8026('0x4d')],{})[_0x8026('0x21')](function(_0x222e28){var _0xa68ef1=_0x58cad4['user'][_0x8026('0x23')]({'plain':!![]});if(!_0xa68ef1)throw new Error(_0x8026('0x4e'));if(_0xa68ef1[_0x8026('0x4f')]===_0x8026('0x50')){var _0x2cc4b3=_0x222e28[_0x8026('0x23')]({'plain':!![]});var _0x2de277='Projects';return db[_0x8026('0x51')][_0x8026('0x4b')]({'where':{'name':_0x2de277,'userProfileId':_0xa68ef1[_0x8026('0x52')]},'raw':!![]})[_0x8026('0x21')](function(_0x23b4fd){if(_0x23b4fd&&_0x23b4fd['autoAssociation']===0x0){return db[_0x8026('0x25')][_0x8026('0x4c')]({'name':_0x2cc4b3[_0x8026('0x40')],'resourceId':_0x2cc4b3['id'],'type':_0x23b4fd[_0x8026('0x40')],'sectionId':_0x23b4fd['id']},{})['then'](function(){return _0x222e28;});}else{return _0x222e28;}})[_0x8026('0x46')](function(_0x1007cd){logger[_0x8026('0x26')](_0x8026('0x53'),_0x1007cd);throw _0x1007cd;});}return _0x222e28;})[_0x8026('0x21')](respondWithResult(_0x5c6f74,0xc9))['catch'](handleError(_0x5c6f74,null));};exports[_0x8026('0x54')]=function(_0x26ce31,_0xd71c60){var _0x13355e={'where':{'id':_0x26ce31[_0x8026('0x48')]['id']}},_0x48d894={};_0x48d894[_0x8026('0x2f')]=_[_0x8026('0x31')](db[_0x8026('0x2b')]['rawAttributes']);_0x13355e[_0x8026('0x34')]=_[_0x8026('0x33')](_0x48d894['model'],qs['fields'](_0x26ce31[_0x8026('0x30')][_0x8026('0x35')]));_0x13355e[_0x8026('0x34')]=_0x13355e[_0x8026('0x34')][_0x8026('0x49')]?_0x13355e[_0x8026('0x34')]:_0x48d894[_0x8026('0x2f')];if(_0x26ce31[_0x8026('0x30')][_0x8026('0x43')]){_0x13355e[_0x8026('0x4a')]=[{'all':!![]}];}_0x13355e=_['merge']({},_0x13355e,_0x26ce31[_0x8026('0x42')]);return db['JscriptyProject'][_0x8026('0x4b')](_0x13355e)[_0x8026('0x21')](handleEntityNotFound(_0xd71c60,null))['then'](function(_0x302796){if(_0x302796){var _0xf32d6b=_0x302796[_0x8026('0x23')]({'plain':!![]});_0xf32d6b=qs[_0x8026('0x55')](_0xf32d6b,['id','createdAt',_0x8026('0x56')]);_0x26ce31[_0x8026('0x4d')]=_[_0x8026('0x55')](_0x26ce31['body'],['id',_0x8026('0x57'),_0x8026('0x56')]);return db[_0x8026('0x2b')][_0x8026('0x4c')](_['merge'](_0xf32d6b,_0x26ce31[_0x8026('0x4d')]),{'include':_0x26ce31[_0x8026('0x30')][_0x8026('0x43')]?[{'all':!![]}]:undefined})[_0x8026('0x21')](function(_0x488097){var _0x5dfb84=_0x26ce31[_0x8026('0x50')][_0x8026('0x23')]({'plain':!![]});if(!_0x5dfb84)throw new Error(_0x8026('0x4e'));if(_0x5dfb84[_0x8026('0x4f')]==='user'){var _0x1d6eaf=_0x488097['get']({'plain':!![]});var _0x546754=_0x8026('0x24');return db[_0x8026('0x51')][_0x8026('0x4b')]({'where':{'name':_0x546754,'userProfileId':_0x5dfb84['userProfileId']},'raw':!![]})[_0x8026('0x21')](function(_0x1864cb){if(_0x1864cb&&_0x1864cb['autoAssociation']===0x0){return db[_0x8026('0x25')][_0x8026('0x4c')]({'name':_0x1d6eaf[_0x8026('0x40')],'resourceId':_0x1d6eaf['id'],'type':_0x1864cb['name'],'sectionId':_0x1864cb['id']},{})[_0x8026('0x21')](function(){return _0x488097;});}else{return _0x488097;}})[_0x8026('0x46')](function(_0x2a5d19){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a5d19);throw _0x2a5d19;});}return _0x488097;});}})[_0x8026('0x21')](respondWithResult(_0xd71c60,0xc9))[_0x8026('0x46')](handleError(_0xd71c60,null));};exports[_0x8026('0x58')]=function(_0x20ae3a,_0x24882a){if(_0x20ae3a[_0x8026('0x4d')]['id']){delete _0x20ae3a[_0x8026('0x4d')]['id'];}return db[_0x8026('0x2b')][_0x8026('0x4b')]({'where':{'id':_0x20ae3a[_0x8026('0x48')]['id']}})[_0x8026('0x21')](handleEntityNotFound(_0x24882a,null))[_0x8026('0x21')](saveUpdates(_0x20ae3a[_0x8026('0x4d')],null))['then'](respondWithResult(_0x24882a,null))['catch'](handleError(_0x24882a,null));};exports[_0x8026('0x22')]=function(_0x44f2b5,_0x3e9294){return db['JscriptyProject'][_0x8026('0x4b')]({'where':{'id':_0x44f2b5[_0x8026('0x48')]['id']}})[_0x8026('0x21')](handleEntityNotFound(_0x3e9294,null))[_0x8026('0x21')](removeEntity(_0x3e9294,null))['catch'](handleError(_0x3e9294,null));};exports[_0x8026('0x59')]=function(_0x15cf77,_0xd3e0e,_0x50614b){var _0x38de67={'raw':!![],'where':{}};var _0x2b7af4={};var _0x537fa2={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x8026('0x5a')]({'where':{'id':_0x15cf77[_0x8026('0x48')]['id']}})[_0x8026('0x21')](handleEntityNotFound(_0xd3e0e,null))[_0x8026('0x21')](function(_0x1166ee){if(_0x1166ee){_0x2b7af4[_0x8026('0x2f')]=_['keys'](db[_0x8026('0x5b')][_0x8026('0x2c')]);_0x2b7af4[_0x8026('0x30')]=_[_0x8026('0x31')](_0x15cf77[_0x8026('0x30')]);_0x2b7af4[_0x8026('0x32')]=_[_0x8026('0x33')](_0x2b7af4['model'],_0x2b7af4[_0x8026('0x30')]);_0x38de67[_0x8026('0x34')]=_[_0x8026('0x33')](_0x2b7af4['model'],qs[_0x8026('0x35')](_0x15cf77['query'][_0x8026('0x35')]));_0x38de67[_0x8026('0x34')]=_0x38de67[_0x8026('0x34')][_0x8026('0x49')]?_0x38de67[_0x8026('0x34')]:_0x2b7af4[_0x8026('0x2f')];if(!_0x15cf77['query'][_0x8026('0x36')](_0x8026('0x37'))){_0x38de67[_0x8026('0x38')]=qs[_0x8026('0x38')](_0x15cf77[_0x8026('0x30')]['limit']);_0x38de67['offset']=qs[_0x8026('0x1c')](_0x15cf77[_0x8026('0x30')][_0x8026('0x1c')]);}_0x38de67['order']=qs[_0x8026('0x3a')](_0x15cf77[_0x8026('0x30')][_0x8026('0x3a')]);_0x38de67[_0x8026('0x3c')]=qs[_0x8026('0x32')](_[_0x8026('0x3b')](_0x15cf77[_0x8026('0x30')],_0x2b7af4[_0x8026('0x32')]));_0x38de67[_0x8026('0x3c')][_0x8026('0x5c')]=_0x1166ee['id'];if(_0x15cf77['query'][_0x8026('0x41')]){_0x38de67[_0x8026('0x3c')]=_['merge'](_0x38de67[_0x8026('0x3c')],{'$or':_[_0x8026('0x2a')](_0x38de67[_0x8026('0x34')],function(_0x5276d6){var _0x278486={};_0x278486[_0x5276d6]={'$like':'%'+_0x15cf77[_0x8026('0x30')][_0x8026('0x41')]+'%'};return _0x278486;})});}_0x38de67=_[_0x8026('0x3d')]({},_0x38de67,_0x15cf77[_0x8026('0x42')]);return db['JscriptySessionReport'][_0x8026('0x1e')]({'where':_0x38de67['where']})['then'](function(_0x4be9e3){_0x537fa2['count']=_0x4be9e3;if(_0x15cf77[_0x8026('0x30')][_0x8026('0x43')]){_0x38de67[_0x8026('0x4a')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x8026('0x44')](_0x38de67);})['then'](function(_0x49d890){_0x537fa2[_0x8026('0x45')]=_0x49d890;return _0x537fa2;});}})[_0x8026('0x21')](respondWithFilteredResult(_0xd3e0e,_0x38de67))[_0x8026('0x46')](handleError(_0xd3e0e,null));};exports[_0x8026('0x5d')]=function(_0x269475,_0x5d827f,_0x9dffa1){var _0x4c1281={'raw':!![],'where':{}};var _0x309d37={};var _0x198a6f={'count':0x0,'rows':[]};return db[_0x8026('0x2b')]['findOne']({'where':{'id':_0x269475['params']['id']}})[_0x8026('0x21')](handleEntityNotFound(_0x5d827f,null))[_0x8026('0x21')](function(_0x72dc32){if(_0x72dc32){_0x309d37[_0x8026('0x2f')]=_[_0x8026('0x31')](db[_0x8026('0x5e')]['rawAttributes']);_0x309d37[_0x8026('0x30')]=_[_0x8026('0x31')](_0x269475[_0x8026('0x30')]);_0x309d37[_0x8026('0x32')]=_[_0x8026('0x33')](_0x309d37[_0x8026('0x2f')],_0x309d37['query']);_0x4c1281[_0x8026('0x34')]=_[_0x8026('0x33')](_0x309d37['model'],qs[_0x8026('0x35')](_0x269475[_0x8026('0x30')][_0x8026('0x35')]));_0x4c1281['attributes']=_0x4c1281['attributes']['length']?_0x4c1281[_0x8026('0x34')]:_0x309d37['model'];if(!_0x269475[_0x8026('0x30')][_0x8026('0x36')](_0x8026('0x37'))){_0x4c1281[_0x8026('0x38')]=qs['limit'](_0x269475[_0x8026('0x30')][_0x8026('0x38')]);_0x4c1281['offset']=qs['offset'](_0x269475[_0x8026('0x30')]['offset']);}_0x4c1281[_0x8026('0x39')]=qs[_0x8026('0x3a')](_0x269475[_0x8026('0x30')][_0x8026('0x3a')]);_0x4c1281[_0x8026('0x3c')]=qs[_0x8026('0x32')](_[_0x8026('0x3b')](_0x269475[_0x8026('0x30')],_0x309d37[_0x8026('0x32')]));_0x4c1281[_0x8026('0x3c')][_0x8026('0x5c')]=_0x72dc32['id'];if(_0x269475[_0x8026('0x30')][_0x8026('0x41')]){_0x4c1281['where']=_[_0x8026('0x3d')](_0x4c1281[_0x8026('0x3c')],{'$or':_[_0x8026('0x2a')](_0x4c1281['attributes'],function(_0x188936){var _0x54609c={};_0x54609c[_0x188936]={'$like':'%'+_0x269475[_0x8026('0x30')][_0x8026('0x41')]+'%'};return _0x54609c;})});}_0x4c1281=_[_0x8026('0x3d')]({},_0x4c1281,_0x269475['options']);return db[_0x8026('0x5e')]['count']({'where':_0x4c1281[_0x8026('0x3c')]})['then'](function(_0x32065e){_0x198a6f[_0x8026('0x1e')]=_0x32065e;if(_0x269475[_0x8026('0x30')][_0x8026('0x43')]){_0x4c1281['include']=[{'all':!![]}];}return db[_0x8026('0x5e')][_0x8026('0x44')](_0x4c1281);})['then'](function(_0x458c49){_0x198a6f[_0x8026('0x45')]=_0x458c49;return _0x198a6f;});}})[_0x8026('0x21')](respondWithFilteredResult(_0x5d827f,_0x4c1281))['catch'](handleError(_0x5d827f,null));};function char(_0x51d6c9){return _0x8026('0x5f')===typeof _0x51d6c9?String[_0x8026('0x60')][_0x8026('0x61')](null,arguments):_0x51d6c9;}function needsEncapsulation(_0x327bb6){return!!_0x327bb6&&(_0x327bb6['toString']()[_0x8026('0x62')](char(0xd))>=0x0||_0x327bb6[_0x8026('0x63')]()[_0x8026('0x62')](char(0xa))>=0x0||_0x327bb6['toString']()[_0x8026('0x62')](char(0x2c))>=0x0||_0x327bb6['toString']()[_0x8026('0x62')](char(0x22))>=0x0);}function encapsulate(_0x21ace0){var _0x114da7=char(0x22),_0xcc5d60='\x5c'+char(0x22),_0x22d78e=_0x21ace0['toString']()['replace'](new RegExp(_0x114da7,'g'),_0xcc5d60);return _0x114da7+_0x22d78e+_0x114da7;}exports[_0x8026('0x64')]=function(_0x3e27c5,_0x3fc43e,_0x5b30c7){var _0x1b23a6,_0x357d98;var _0x21cbab={'where':{'ProjectId':_0x3e27c5[_0x8026('0x48')]['id']}};if(_0x3e27c5['query']['startTime']){_0x21cbab[_0x8026('0x3c')][_0x8026('0x65')]=JSON['parse'](_0x3e27c5[_0x8026('0x30')][_0x8026('0x66')]);}return db[_0x8026('0x5b')][_0x8026('0x44')](_0x21cbab)[_0x8026('0x21')](handleEntityNotFound(_0x3fc43e,null))[_0x8026('0x21')](function(_0x590fef){if(_0x590fef){_0x1b23a6=_0x590fef;return db[_0x8026('0x67')][_0x8026('0x44')]({'where':{'SessionId':{'$in':_[_0x8026('0x2a')](_0x1b23a6,'id')},'ProjectId':_0x3e27c5[_0x8026('0x48')]['id']},'order':_0x8026('0x68')});}})[_0x8026('0x21')](handleEntityNotFound(_0x3fc43e,null))['then'](function(_0x3dfed2){if(_0x3dfed2){_0x357d98=_0x3dfed2;var _0x52d141={};for(var _0x2d9c22=0x0,_0x4e1143=_0x357d98[_0x8026('0x49')];_0x2d9c22<_0x4e1143;_0x2d9c22++){if(!_0x52d141[_0x8026('0x36')](_0x357d98[_0x2d9c22][_0x8026('0x69')])){_0x52d141[_0x357d98[_0x2d9c22][_0x8026('0x69')]]=needsEncapsulation(_0x357d98[_0x2d9c22][_0x8026('0x6a')])?encapsulate(_0x357d98[_0x2d9c22][_0x8026('0x6a')]):_0x357d98[_0x2d9c22][_0x8026('0x6a')];}}var _0x52e357=[],_0x216564={};for(var _0x2640e9=0x0,_0x218234=_0x1b23a6['length'];_0x2640e9<_0x218234;_0x2640e9++){_0x216564={'ProjectId':_0x3e27c5[_0x8026('0x48')]['id'],'SessionId':_0x1b23a6[_0x2640e9]['id'],'StartTime':moment(_0x1b23a6[_0x2640e9][_0x8026('0x65')])[_0x8026('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x23eba4=0x0,_0x46df46=_0x357d98[_0x8026('0x49')];_0x23eba4<_0x46df46;_0x23eba4++){if(_0x357d98[_0x23eba4]['SessionId']==_0x1b23a6[_0x2640e9]['id']&&_0x52d141['hasOwnProperty'](_0x357d98[_0x23eba4][_0x8026('0x69')])){_0x216564[_0x52d141[_0x357d98[_0x23eba4][_0x8026('0x69')]]]=_0x357d98[_0x23eba4]['answer'];}}for(var _0x1b6c71 in _0x52d141){if(!_0x216564[_0x8026('0x36')](_0x52d141[_0x1b6c71])){_0x216564[_0x52d141[_0x1b6c71]]=null;}}_0x52e357[_0x8026('0x6c')](_0x216564);}return _0x52e357;}})[_0x8026('0x21')](function(_0x2ad156){if(!_[_0x8026('0x6d')](_0x2ad156)){var _0x456841=toCsv(_0x2ad156);var _0x3b4331=Date[_0x8026('0x6e')]();fs['writeFileSync'](util['format'](_0x8026('0x6f'),_0x3e27c5['params']['id'],_0x3b4331),_0x456841);_0x3fc43e['setHeader'](_0x8026('0x70'),_0x8026('0x71')+util[_0x8026('0x6b')](_0x8026('0x72'),_0x3e27c5[_0x8026('0x48')]['id'],_0x3b4331));_0x3fc43e[_0x8026('0x73')]('Content-type','text/csv');return _0x3fc43e[_0x8026('0x74')](util[_0x8026('0x6b')](_0x8026('0x6f'),_0x3e27c5[_0x8026('0x48')]['id'],_0x3b4331));}else{return _0x3fc43e['sendStatus'](0xcc);}})[_0x8026('0x46')](handleError(_0x3fc43e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 57f44cc..85c5e8c 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 _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x3e0a8e,_0x1fbd88){var _0x6ce713=function(_0x542c29){while(--_0x542c29){_0x3e0a8e['push'](_0x3e0a8e['shift']());}};_0x6ce713(++_0x1fbd88);}(_0xac31,0xca));var _0x1ac3=function(_0x3cfbc1,_0x590b67){_0x3cfbc1=_0x3cfbc1-0x0;var _0x14ed3d=_0xac31[_0x3cfbc1];return _0x14ed3d;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb39f=['lodash','util','../../config/logger','api','path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject'];(function(_0x5133d1,_0x4ae780){var _0x1f0e66=function(_0x1b99a9){while(--_0x1b99a9){_0x5133d1['push'](_0x5133d1['shift']());}};_0x1f0e66(++_0x4ae780);}(_0xb39f,0x1e6));var _0xfb39=function(_0x568ef9,_0x51d134){_0x568ef9=_0x568ef9-0x0;var _0xe40ae6=_0xb39f[_0x568ef9];return _0xe40ae6;};'use strict';var _=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var logger=require(_0xfb39('0x2'))(_0xfb39('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb39('0x4'));var rimraf=require('rimraf');var config=require(_0xfb39('0x5'));var attributes=require(_0xfb39('0x6'));module['exports']=function(_0x1619f6,_0x455dbe){return _0x1619f6[_0xfb39('0x7')](_0xfb39('0x8'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 9888229..c417eb2 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xaa88,0x137));var _0x8aa8=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xaa88[_0x330414];return _0x99dbff;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x4b4aa9,_0x514244){var _0x4a3a81=function(_0x4a4eb1){while(--_0x4a4eb1){_0x4b4aa9['push'](_0x4b4aa9['shift']());}};_0x4a3a81(++_0x514244);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 364851e..004f1f0 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 _0xbd2b=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x53a6b1,_0x29455b){var _0x358f81=function(_0x1a34e0){while(--_0x1a34e0){_0x53a6b1['push'](_0x53a6b1['shift']());}};_0x358f81(++_0x29455b);}(_0xbd2b,0x19a));var _0xbbd2=function(_0x3d0381,_0x576645){_0x3d0381=_0x3d0381-0x0;var _0x358b9a=_0xbd2b[_0x3d0381];return _0x358b9a;};'use strict';var multer=require(_0xbbd2('0x0'));var util=require(_0xbbd2('0x1'));var path=require(_0xbbd2('0x2'));var timeout=require(_0xbbd2('0x3'));var express=require(_0xbbd2('0x4'));var router=express[_0xbbd2('0x5')]();var fs_extra=require(_0xbbd2('0x6'));var auth=require(_0xbbd2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd2('0x8'));var controller=require(_0xbbd2('0x9'));router[_0xbbd2('0xa')]('/',auth[_0xbbd2('0xb')](),controller[_0xbbd2('0xc')]);router[_0xbbd2('0xa')]('/describe',auth[_0xbbd2('0xb')](),controller[_0xbbd2('0xd')]);router[_0xbbd2('0xa')](_0xbbd2('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbbd2('0xf')]);router[_0xbbd2('0x10')](_0xbbd2('0xe'),auth[_0xbbd2('0xb')](),controller[_0xbbd2('0x11')]);router['delete'](_0xbbd2('0xe'),auth[_0xbbd2('0xb')](),controller[_0xbbd2('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe1d5=['put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x2db750,_0x5f4b72){var _0x12bd9c=function(_0x5c1b3c){while(--_0x5c1b3c){_0x2db750['push'](_0x2db750['shift']());}};_0x12bd9c(++_0x5f4b72);}(_0xe1d5,0x1cc));var _0x5e1d=function(_0x2f82ff,_0x3c8e6e){_0x2f82ff=_0x2f82ff-0x0;var _0x5bc380=_0xe1d5[_0x2f82ff];return _0x5bc380;};'use strict';var multer=require(_0x5e1d('0x0'));var util=require('util');var path=require(_0x5e1d('0x1'));var timeout=require(_0x5e1d('0x2'));var express=require(_0x5e1d('0x3'));var router=express[_0x5e1d('0x4')]();var fs_extra=require(_0x5e1d('0x5'));var auth=require(_0x5e1d('0x6'));var interaction=require(_0x5e1d('0x7'));var config=require(_0x5e1d('0x8'));var controller=require(_0x5e1d('0x9'));router[_0x5e1d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e1d('0xa')](_0x5e1d('0xb'),auth[_0x5e1d('0xc')](),controller[_0x5e1d('0xd')]);router[_0x5e1d('0xa')]('/:id',auth[_0x5e1d('0xc')](),controller[_0x5e1d('0xe')]);router['post']('/',auth[_0x5e1d('0xc')](),controller['create']);router[_0x5e1d('0xf')](_0x5e1d('0x10'),auth[_0x5e1d('0xc')](),controller[_0x5e1d('0x11')]);router[_0x5e1d('0x12')](_0x5e1d('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 35f1e25..7bcf3f3 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x55d591,_0x516fec){_0x55d591=_0x55d591-0x0;var _0x10253f=_0x7a54[_0x55d591];return _0x10253f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x14329a,_0x395c72){_0x14329a=_0x14329a-0x0;var _0x10a82f=_0x7a54[_0x14329a];return _0x10a82f;};'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 f1d9beb..03249a9 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 _0x60fe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','JscriptyQuestionReport','rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2a6501,_0x9c5a0e){var _0x34d3ae=function(_0x204c8b){while(--_0x204c8b){_0x2a6501['push'](_0x2a6501['shift']());}};_0x34d3ae(++_0x9c5a0e);}(_0x60fe,0x120));var _0xe60f=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0x60fe[_0x2e846d];return _0x10a6ab;};'use strict';var emlformat=require(_0xe60f('0x0'));var rimraf=require(_0xe60f('0x1'));var zipdir=require(_0xe60f('0x2'));var jsonpatch=require(_0xe60f('0x3'));var rp=require(_0xe60f('0x4'));var moment=require('moment');var BPromise=require(_0xe60f('0x5'));var Mustache=require('mustache');var util=require(_0xe60f('0x6'));var path=require(_0xe60f('0x7'));var sox=require(_0xe60f('0x8'));var csv=require(_0xe60f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe60f('0xa'));var _=require(_0xe60f('0xb'));var squel=require(_0xe60f('0xc'));var crypto=require(_0xe60f('0xd'));var jsforce=require(_0xe60f('0xe'));var deskjs=require(_0xe60f('0xf'));var toCsv=require(_0xe60f('0x9'));var querystring=require(_0xe60f('0x10'));var Papa=require(_0xe60f('0x11'));var Redis=require(_0xe60f('0x12'));var authService=require(_0xe60f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe60f('0x14'));var hardwareService=require(_0xe60f('0x15'));var logger=require(_0xe60f('0x16'))(_0xe60f('0x17'));var utils=require(_0xe60f('0x18'));var config=require(_0xe60f('0x19'));var licenseUtil=require(_0xe60f('0x1a'));var db=require(_0xe60f('0x1b'))['db'];function respondWithStatusCode(_0x7bb291,_0x3424a8){_0x3424a8=_0x3424a8||0xcc;return function(_0x354d1a){if(_0x354d1a){return _0x7bb291['sendStatus'](_0x3424a8);}return _0x7bb291[_0xe60f('0x1c')](_0x3424a8)[_0xe60f('0x1d')]();};}function respondWithResult(_0x2d7f7b,_0x453014){_0x453014=_0x453014||0xc8;return function(_0x2d44f7){if(_0x2d44f7){return _0x2d7f7b['status'](_0x453014)[_0xe60f('0x1e')](_0x2d44f7);}};}function respondWithFilteredResult(_0x1befa0,_0x51ea64){return function(_0x1cbc56){if(_0x1cbc56){var _0x19c3c1=typeof _0x51ea64[_0xe60f('0x1f')]===_0xe60f('0x20')&&typeof _0x51ea64['limit']===_0xe60f('0x20');var _0x30c950=_0x1cbc56[_0xe60f('0x21')];var _0x17deb9=_0x19c3c1?0x0:_0x51ea64[_0xe60f('0x1f')];var _0x507168=_0x19c3c1?_0x1cbc56[_0xe60f('0x21')]:_0x51ea64[_0xe60f('0x1f')]+_0x51ea64['limit'];var _0x18e52c;if(_0x507168>=_0x30c950){_0x507168=_0x30c950;_0x18e52c=0xc8;}else{_0x18e52c=0xce;}_0x1befa0['status'](_0x18e52c);return _0x1befa0[_0xe60f('0x22')](_0xe60f('0x23'),_0x17deb9+'-'+_0x507168+'/'+_0x30c950)[_0xe60f('0x1e')](_0x1cbc56);}return null;};}function patchUpdates(_0x31973e){return function(_0x264601){try{jsonpatch['apply'](_0x264601,_0x31973e,!![]);}catch(_0xc9249){return BPromise['reject'](_0xc9249);}return _0x264601[_0xe60f('0x24')]();};}function saveUpdates(_0x309433,_0x25d13b){return function(_0xbe1163){if(_0xbe1163){return _0xbe1163[_0xe60f('0x25')](_0x309433)[_0xe60f('0x26')](function(_0x3ee56c){return _0x3ee56c;});}return null;};}function removeEntity(_0x5ebd91,_0x5180ab){return function(_0x395a5e){if(_0x395a5e){return _0x395a5e[_0xe60f('0x27')]()['then'](function(){_0x5ebd91[_0xe60f('0x1c')](0xcc)[_0xe60f('0x1d')]();});}};}function handleEntityNotFound(_0x3b3e51,_0x1497ec){return function(_0xbe8f80){if(!_0xbe8f80){_0x3b3e51[_0xe60f('0x28')](0x194);}return _0xbe8f80;};}function handleError(_0x2c65d9,_0x44abe5){_0x44abe5=_0x44abe5||0x1f4;return function(_0x8c2bf4){logger[_0xe60f('0x29')](_0x8c2bf4[_0xe60f('0x2a')]);if(_0x8c2bf4[_0xe60f('0x2b')]){delete _0x8c2bf4[_0xe60f('0x2b')];}_0x2c65d9['status'](_0x44abe5)['send'](_0x8c2bf4);};}exports['index']=function(_0x24eba6,_0x9cba77){var _0x47c141={},_0x5424c3={},_0x4f6cd8={'count':0x0,'rows':[]};var _0x289204=_['map'](db[_0xe60f('0x2c')][_0xe60f('0x2d')],function(_0x2094a1){return{'name':_0x2094a1[_0xe60f('0x2e')],'type':_0x2094a1['type'][_0xe60f('0x2f')]};});_0x5424c3[_0xe60f('0x30')]=_[_0xe60f('0x31')](_0x289204,_0xe60f('0x2b'));_0x5424c3[_0xe60f('0x32')]=_['keys'](_0x24eba6['query']);_0x5424c3['filters']=_[_0xe60f('0x33')](_0x5424c3[_0xe60f('0x30')],_0x5424c3['query']);_0x47c141['attributes']=_[_0xe60f('0x33')](_0x5424c3[_0xe60f('0x30')],qs[_0xe60f('0x34')](_0x24eba6[_0xe60f('0x32')][_0xe60f('0x34')]));_0x47c141[_0xe60f('0x35')]=_0x47c141[_0xe60f('0x35')][_0xe60f('0x36')]?_0x47c141[_0xe60f('0x35')]:_0x5424c3['model'];if(!_0x24eba6[_0xe60f('0x32')][_0xe60f('0x37')](_0xe60f('0x38'))){_0x47c141[_0xe60f('0x39')]=qs['limit'](_0x24eba6[_0xe60f('0x32')]['limit']);_0x47c141['offset']=qs[_0xe60f('0x1f')](_0x24eba6[_0xe60f('0x32')][_0xe60f('0x1f')]);}_0x47c141[_0xe60f('0x3a')]=qs[_0xe60f('0x3b')](_0x24eba6['query'][_0xe60f('0x3b')]);_0x47c141[_0xe60f('0x3c')]=qs[_0xe60f('0x3d')](_['pick'](_0x24eba6[_0xe60f('0x32')],_0x5424c3['filters']),_0x289204);if(_0x24eba6[_0xe60f('0x32')][_0xe60f('0x3e')]){_0x47c141[_0xe60f('0x3c')]=_[_0xe60f('0x3f')](_0x47c141[_0xe60f('0x3c')],{'$or':_[_0xe60f('0x31')](_0x289204,function(_0xbb6358){if(_0xbb6358['type']!==_0xe60f('0x40')){var _0x643d28={};_0x643d28[_0xbb6358[_0xe60f('0x2b')]]={'$like':'%'+_0x24eba6[_0xe60f('0x32')][_0xe60f('0x3e')]+'%'};return _0x643d28;}})});}_0x47c141=_['merge']({},_0x47c141,_0x24eba6[_0xe60f('0x41')]);var _0x32d190={'where':_0x47c141[_0xe60f('0x3c')]};return db[_0xe60f('0x2c')][_0xe60f('0x21')](_0x32d190)['then'](function(_0x1e2613){_0x4f6cd8['count']=_0x1e2613;if(_0x24eba6['query'][_0xe60f('0x42')]){_0x47c141['include']=[{'all':!![]}];}return db[_0xe60f('0x2c')][_0xe60f('0x43')](_0x47c141);})[_0xe60f('0x26')](function(_0x30fda4){_0x4f6cd8[_0xe60f('0x44')]=_0x30fda4;return _0x4f6cd8;})[_0xe60f('0x26')](respondWithFilteredResult(_0x9cba77,_0x47c141))[_0xe60f('0x45')](handleError(_0x9cba77,null));};exports[_0xe60f('0x46')]=function(_0x517ee4,_0x3ee614){var _0x5d1738={'raw':!![],'where':{'id':_0x517ee4[_0xe60f('0x47')]['id']}},_0x1e2e42={};_0x1e2e42['model']=_[_0xe60f('0x48')](db[_0xe60f('0x2c')][_0xe60f('0x2d')]);_0x1e2e42[_0xe60f('0x32')]=_[_0xe60f('0x48')](_0x517ee4[_0xe60f('0x32')]);_0x1e2e42[_0xe60f('0x3d')]=_['intersection'](_0x1e2e42[_0xe60f('0x30')],_0x1e2e42[_0xe60f('0x32')]);_0x5d1738['attributes']=_[_0xe60f('0x33')](_0x1e2e42[_0xe60f('0x30')],qs[_0xe60f('0x34')](_0x517ee4[_0xe60f('0x32')]['fields']));_0x5d1738[_0xe60f('0x35')]=_0x5d1738['attributes'][_0xe60f('0x36')]?_0x5d1738[_0xe60f('0x35')]:_0x1e2e42['model'];if(_0x517ee4[_0xe60f('0x32')][_0xe60f('0x42')]){_0x5d1738[_0xe60f('0x49')]=[{'all':!![]}];}_0x5d1738=_[_0xe60f('0x3f')]({},_0x5d1738,_0x517ee4['options']);return db[_0xe60f('0x2c')][_0xe60f('0x4a')](_0x5d1738)[_0xe60f('0x26')](handleEntityNotFound(_0x3ee614,null))[_0xe60f('0x26')](respondWithResult(_0x3ee614,null))['catch'](handleError(_0x3ee614,null));};exports[_0xe60f('0x4b')]=function(_0x44cdec,_0x3f1275){return db['JscriptyQuestionReport'][_0xe60f('0x4b')](_0x44cdec[_0xe60f('0x4c')],{})[_0xe60f('0x26')](respondWithResult(_0x3f1275,0xc9))['catch'](handleError(_0x3f1275,null));};exports[_0xe60f('0x25')]=function(_0x1fcce1,_0x426c80){if(_0x1fcce1[_0xe60f('0x4c')]['id']){delete _0x1fcce1['body']['id'];}return db[_0xe60f('0x2c')][_0xe60f('0x4a')]({'where':{'id':_0x1fcce1[_0xe60f('0x47')]['id']}})[_0xe60f('0x26')](handleEntityNotFound(_0x426c80,null))[_0xe60f('0x26')](saveUpdates(_0x1fcce1[_0xe60f('0x4c')],null))[_0xe60f('0x26')](respondWithResult(_0x426c80,null))['catch'](handleError(_0x426c80,null));};exports[_0xe60f('0x27')]=function(_0x216ba4,_0x1c1720){return db[_0xe60f('0x2c')][_0xe60f('0x4a')]({'where':{'id':_0x216ba4[_0xe60f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c1720,null))[_0xe60f('0x26')](removeEntity(_0x1c1720,null))[_0xe60f('0x45')](handleError(_0x1c1720,null));};exports[_0xe60f('0x4d')]=function(_0x116b93,_0x49a78e){return db['JscriptyQuestionReport'][_0xe60f('0x4d')]()['then'](respondWithResult(_0x49a78e,null))[_0xe60f('0x45')](handleError(_0x49a78e,null));}; \ No newline at end of file +var _0x19e3=['then','destroy','sendStatus','error','name','send','map','JscriptyQuestionReport','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','intersection','options','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x19e3,0xc7));var _0x319e=function(_0x4b4db7,_0x38955c){_0x4b4db7=_0x4b4db7-0x0;var _0x29810a=_0x19e3[_0x4b4db7];return _0x29810a;};'use strict';var emlformat=require(_0x319e('0x0'));var rimraf=require(_0x319e('0x1'));var zipdir=require(_0x319e('0x2'));var jsonpatch=require(_0x319e('0x3'));var rp=require(_0x319e('0x4'));var moment=require(_0x319e('0x5'));var BPromise=require(_0x319e('0x6'));var Mustache=require(_0x319e('0x7'));var util=require(_0x319e('0x8'));var path=require(_0x319e('0x9'));var sox=require('sox');var csv=require(_0x319e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x319e('0xb'));var crypto=require(_0x319e('0xc'));var jsforce=require(_0x319e('0xd'));var deskjs=require(_0x319e('0xe'));var toCsv=require(_0x319e('0xa'));var querystring=require(_0x319e('0xf'));var Papa=require(_0x319e('0x10'));var Redis=require(_0x319e('0x11'));var authService=require(_0x319e('0x12'));var qs=require(_0x319e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x319e('0x14'));var logger=require(_0x319e('0x15'))(_0x319e('0x16'));var utils=require(_0x319e('0x17'));var config=require(_0x319e('0x18'));var licenseUtil=require(_0x319e('0x19'));var db=require(_0x319e('0x1a'))['db'];function respondWithStatusCode(_0x434d9a,_0x2366b8){_0x2366b8=_0x2366b8||0xcc;return function(_0x55606c){if(_0x55606c){return _0x434d9a['sendStatus'](_0x2366b8);}return _0x434d9a[_0x319e('0x1b')](_0x2366b8)[_0x319e('0x1c')]();};}function respondWithResult(_0x53cd52,_0x105b3e){_0x105b3e=_0x105b3e||0xc8;return function(_0x481c81){if(_0x481c81){return _0x53cd52[_0x319e('0x1b')](_0x105b3e)[_0x319e('0x1d')](_0x481c81);}};}function respondWithFilteredResult(_0x257215,_0x476437){return function(_0x2075b2){if(_0x2075b2){var _0x1c9c28=typeof _0x476437[_0x319e('0x1e')]===_0x319e('0x1f')&&typeof _0x476437[_0x319e('0x20')]===_0x319e('0x1f');var _0xbc83a0=_0x2075b2[_0x319e('0x21')];var _0x1d4744=_0x1c9c28?0x0:_0x476437['offset'];var _0x2ace62=_0x1c9c28?_0x2075b2['count']:_0x476437[_0x319e('0x1e')]+_0x476437['limit'];var _0x12619f;if(_0x2ace62>=_0xbc83a0){_0x2ace62=_0xbc83a0;_0x12619f=0xc8;}else{_0x12619f=0xce;}_0x257215[_0x319e('0x1b')](_0x12619f);return _0x257215[_0x319e('0x22')]('Content-Range',_0x1d4744+'-'+_0x2ace62+'/'+_0xbc83a0)[_0x319e('0x1d')](_0x2075b2);}return null;};}function patchUpdates(_0x1e1fcb){return function(_0x39f4b0){try{jsonpatch['apply'](_0x39f4b0,_0x1e1fcb,!![]);}catch(_0x5c0791){return BPromise[_0x319e('0x23')](_0x5c0791);}return _0x39f4b0[_0x319e('0x24')]();};}function saveUpdates(_0x3a02f4,_0x5d60c2){return function(_0x3095ec){if(_0x3095ec){return _0x3095ec[_0x319e('0x25')](_0x3a02f4)[_0x319e('0x26')](function(_0x100dea){return _0x100dea;});}return null;};}function removeEntity(_0x2d190c,_0x5ba096){return function(_0x527d9b){if(_0x527d9b){return _0x527d9b[_0x319e('0x27')]()[_0x319e('0x26')](function(){_0x2d190c[_0x319e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5cb6,_0x2104ac){return function(_0x27a2f1){if(!_0x27a2f1){_0x5d5cb6[_0x319e('0x28')](0x194);}return _0x27a2f1;};}function handleError(_0x2dbf5e,_0x5c507f){_0x5c507f=_0x5c507f||0x1f4;return function(_0x438447){logger[_0x319e('0x29')](_0x438447['stack']);if(_0x438447[_0x319e('0x2a')]){delete _0x438447[_0x319e('0x2a')];}_0x2dbf5e[_0x319e('0x1b')](_0x5c507f)[_0x319e('0x2b')](_0x438447);};}exports['index']=function(_0x35c99b,_0x9f444e){var _0xc4c71={},_0x10ac9b={},_0x20a511={'count':0x0,'rows':[]};var _0x5611cf=_[_0x319e('0x2c')](db[_0x319e('0x2d')]['rawAttributes'],function(_0xadc896){return{'name':_0xadc896[_0x319e('0x2e')],'type':_0xadc896['type'][_0x319e('0x2f')]};});_0x10ac9b[_0x319e('0x30')]=_[_0x319e('0x2c')](_0x5611cf,_0x319e('0x2a'));_0x10ac9b[_0x319e('0x31')]=_[_0x319e('0x32')](_0x35c99b[_0x319e('0x31')]);_0x10ac9b['filters']=_['intersection'](_0x10ac9b[_0x319e('0x30')],_0x10ac9b[_0x319e('0x31')]);_0xc4c71[_0x319e('0x33')]=_['intersection'](_0x10ac9b['model'],qs[_0x319e('0x34')](_0x35c99b[_0x319e('0x31')][_0x319e('0x34')]));_0xc4c71[_0x319e('0x33')]=_0xc4c71['attributes'][_0x319e('0x35')]?_0xc4c71['attributes']:_0x10ac9b[_0x319e('0x30')];if(!_0x35c99b['query'][_0x319e('0x36')](_0x319e('0x37'))){_0xc4c71[_0x319e('0x20')]=qs[_0x319e('0x20')](_0x35c99b[_0x319e('0x31')]['limit']);_0xc4c71[_0x319e('0x1e')]=qs['offset'](_0x35c99b[_0x319e('0x31')][_0x319e('0x1e')]);}_0xc4c71[_0x319e('0x38')]=qs[_0x319e('0x39')](_0x35c99b['query'][_0x319e('0x39')]);_0xc4c71[_0x319e('0x3a')]=qs[_0x319e('0x3b')](_[_0x319e('0x3c')](_0x35c99b[_0x319e('0x31')],_0x10ac9b[_0x319e('0x3b')]),_0x5611cf);if(_0x35c99b[_0x319e('0x31')][_0x319e('0x3d')]){_0xc4c71['where']=_[_0x319e('0x3e')](_0xc4c71[_0x319e('0x3a')],{'$or':_['map'](_0x5611cf,function(_0x1dee5b){if(_0x1dee5b[_0x319e('0x3f')]!==_0x319e('0x40')){var _0x100f67={};_0x100f67[_0x1dee5b[_0x319e('0x2a')]]={'$like':'%'+_0x35c99b[_0x319e('0x31')][_0x319e('0x3d')]+'%'};return _0x100f67;}})});}_0xc4c71=_[_0x319e('0x3e')]({},_0xc4c71,_0x35c99b['options']);var _0x5aabee={'where':_0xc4c71[_0x319e('0x3a')]};return db['JscriptyQuestionReport'][_0x319e('0x21')](_0x5aabee)[_0x319e('0x26')](function(_0x412b19){_0x20a511[_0x319e('0x21')]=_0x412b19;if(_0x35c99b['query'][_0x319e('0x41')]){_0xc4c71[_0x319e('0x42')]=[{'all':!![]}];}return db[_0x319e('0x2d')][_0x319e('0x43')](_0xc4c71);})[_0x319e('0x26')](function(_0x2b1226){_0x20a511[_0x319e('0x44')]=_0x2b1226;return _0x20a511;})[_0x319e('0x26')](respondWithFilteredResult(_0x9f444e,_0xc4c71))['catch'](handleError(_0x9f444e,null));};exports[_0x319e('0x45')]=function(_0x2e7ae2,_0x5e9cac){var _0x54d59e={'raw':!![],'where':{'id':_0x2e7ae2['params']['id']}},_0x47b84c={};_0x47b84c['model']=_['keys'](db[_0x319e('0x2d')][_0x319e('0x46')]);_0x47b84c['query']=_[_0x319e('0x32')](_0x2e7ae2[_0x319e('0x31')]);_0x47b84c['filters']=_[_0x319e('0x47')](_0x47b84c[_0x319e('0x30')],_0x47b84c[_0x319e('0x31')]);_0x54d59e['attributes']=_[_0x319e('0x47')](_0x47b84c[_0x319e('0x30')],qs[_0x319e('0x34')](_0x2e7ae2[_0x319e('0x31')][_0x319e('0x34')]));_0x54d59e[_0x319e('0x33')]=_0x54d59e[_0x319e('0x33')][_0x319e('0x35')]?_0x54d59e[_0x319e('0x33')]:_0x47b84c[_0x319e('0x30')];if(_0x2e7ae2[_0x319e('0x31')][_0x319e('0x41')]){_0x54d59e[_0x319e('0x42')]=[{'all':!![]}];}_0x54d59e=_[_0x319e('0x3e')]({},_0x54d59e,_0x2e7ae2[_0x319e('0x48')]);return db[_0x319e('0x2d')][_0x319e('0x49')](_0x54d59e)[_0x319e('0x26')](handleEntityNotFound(_0x5e9cac,null))[_0x319e('0x26')](respondWithResult(_0x5e9cac,null))['catch'](handleError(_0x5e9cac,null));};exports[_0x319e('0x4a')]=function(_0x4546c4,_0x2f9a84){return db[_0x319e('0x2d')][_0x319e('0x4a')](_0x4546c4['body'],{})['then'](respondWithResult(_0x2f9a84,0xc9))[_0x319e('0x4b')](handleError(_0x2f9a84,null));};exports[_0x319e('0x25')]=function(_0x4bd4e1,_0x437746){if(_0x4bd4e1[_0x319e('0x4c')]['id']){delete _0x4bd4e1[_0x319e('0x4c')]['id'];}return db[_0x319e('0x2d')][_0x319e('0x49')]({'where':{'id':_0x4bd4e1[_0x319e('0x4d')]['id']}})[_0x319e('0x26')](handleEntityNotFound(_0x437746,null))['then'](saveUpdates(_0x4bd4e1[_0x319e('0x4c')],null))['then'](respondWithResult(_0x437746,null))[_0x319e('0x4b')](handleError(_0x437746,null));};exports[_0x319e('0x27')]=function(_0x19b54d,_0x4fcfa9){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x19b54d[_0x319e('0x4d')]['id']}})[_0x319e('0x26')](handleEntityNotFound(_0x4fcfa9,null))[_0x319e('0x26')](removeEntity(_0x4fcfa9,null))[_0x319e('0x4b')](handleError(_0x4fcfa9,null));};exports['describe']=function(_0x2b12a7,_0x416bcc){return db['JscriptyQuestionReport'][_0x319e('0x4e')]()['then'](respondWithResult(_0x416bcc,null))[_0x319e('0x4b')](handleError(_0x416bcc,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3a86a89..4ef603d 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 _0x4af4=['report_jscripty_questions','lodash','util','api','moment','bluebird','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x4af4,0x1c1));var _0x44af=function(_0x5613bc,_0x4521b3){_0x5613bc=_0x5613bc-0x0;var _0x4fee66=_0x4af4[_0x5613bc];return _0x4fee66;};'use strict';var _=require(_0x44af('0x0'));var util=require(_0x44af('0x1'));var logger=require('../../config/logger')(_0x44af('0x2'));var moment=require(_0x44af('0x3'));var BPromise=require(_0x44af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44af('0x5'));var attributes=require(_0x44af('0x6'));module['exports']=function(_0x5a2281,_0x13f438){return _0x5a2281['define']('JscriptyQuestionReport',attributes,{'tableName':_0x44af('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeee3=['bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','api','moment'];(function(_0x4d5528,_0x272f26){var _0x2c4b72=function(_0x10ccb9){while(--_0x10ccb9){_0x4d5528['push'](_0x4d5528['shift']());}};_0x2c4b72(++_0x272f26);}(_0xeee3,0x141));var _0x3eee=function(_0x2328c6,_0x295914){_0x2328c6=_0x2328c6-0x0;var _0x3ea2fd=_0xeee3[_0x2328c6];return _0x3ea2fd;};'use strict';var _=require(_0x3eee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3eee('0x1'));var moment=require(_0x3eee('0x2'));var BPromise=require(_0x3eee('0x3'));var rp=require(_0x3eee('0x4'));var fs=require('fs');var path=require(_0x3eee('0x5'));var rimraf=require('rimraf');var config=require(_0x3eee('0x6'));var attributes=require(_0x3eee('0x7'));module[_0x3eee('0x8')]=function(_0x52ea33,_0x20bd65){return _0x52ea33[_0x3eee('0x9')](_0x3eee('0xa'),attributes,{'tableName':_0x3eee('0xb'),'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 3352c4b..cdf08f4 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 _0x623b=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x32a254,_0x14e1d0){var _0x799afb=function(_0x47e462){while(--_0x47e462){_0x32a254['push'](_0x32a254['shift']());}};_0x799afb(++_0x14e1d0);}(_0x623b,0x135));var _0xb623=function(_0x48b5a2,_0x5014c7){_0x48b5a2=_0x48b5a2-0x0;var _0xc7f542=_0x623b[_0x48b5a2];return _0xc7f542;};'use strict';var _=require(_0xb623('0x0'));var util=require(_0xb623('0x1'));var moment=require(_0xb623('0x2'));var BPromise=require(_0xb623('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb623('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb623('0x5'))(_0xb623('0x6'));var config=require(_0xb623('0x7'));var jayson=require(_0xb623('0x8'));var client=jayson[_0xb623('0x9')][_0xb623('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4372d6,_0x346851,_0x3c983d){return new BPromise(function(_0x3a10c1,_0x41096e){return client[_0xb623('0xb')](_0x4372d6,_0x3c983d)[_0xb623('0xc')](function(_0x246e03){logger['info'](_0xb623('0xd'),_0x346851,_0xb623('0xe'));logger['debug'](_0xb623('0xf'),_0x346851,_0xb623('0xe'),JSON['stringify'](_0x246e03));if(_0x246e03['error']){if(_0x246e03[_0xb623('0x10')][_0xb623('0x11')]===0x1f4){logger[_0xb623('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x346851,_0x246e03[_0xb623('0x10')][_0xb623('0x12')]);return _0x41096e(_0x246e03[_0xb623('0x10')][_0xb623('0x12')]);}logger[_0xb623('0x10')](_0xb623('0xd'),_0x346851,_0x246e03['error']['message']);return _0x3a10c1(_0x246e03['error']['message']);}else{logger[_0xb623('0x13')](_0xb623('0xd'),_0x346851,_0xb623('0xe'));_0x3a10c1(_0x246e03[_0xb623('0x14')]['message']);}})[_0xb623('0x15')](function(_0x5045fb){logger['error'](_0xb623('0xd'),_0x346851,_0x5045fb);_0x41096e(_0x5045fb);});});} \ No newline at end of file +var _0x1256=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x1256,0x17a));var _0x6125=function(_0x2203b3,_0x12aa65){_0x2203b3=_0x2203b3-0x0;var _0x3e095a=_0x1256[_0x2203b3];return _0x3e095a;};'use strict';var _=require(_0x6125('0x0'));var util=require(_0x6125('0x1'));var moment=require('moment');var BPromise=require(_0x6125('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6125('0x3'));var db=require(_0x6125('0x4'))['db'];var utils=require(_0x6125('0x5'));var logger=require(_0x6125('0x6'))(_0x6125('0x7'));var config=require(_0x6125('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6125('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f094c,_0x3641e8,_0x35eaf6){return new BPromise(function(_0xd0b0a6,_0x42b430){return client[_0x6125('0xa')](_0x5f094c,_0x35eaf6)[_0x6125('0xb')](function(_0x58333d){logger[_0x6125('0xc')](_0x6125('0xd'),_0x3641e8,_0x6125('0xe'));logger[_0x6125('0xf')](_0x6125('0x10'),_0x3641e8,_0x6125('0xe'),JSON[_0x6125('0x11')](_0x58333d));if(_0x58333d['error']){if(_0x58333d[_0x6125('0x12')]['code']===0x1f4){logger['error'](_0x6125('0xd'),_0x3641e8,_0x58333d[_0x6125('0x12')]['message']);return _0x42b430(_0x58333d[_0x6125('0x12')][_0x6125('0x13')]);}logger[_0x6125('0x12')](_0x6125('0xd'),_0x3641e8,_0x58333d[_0x6125('0x12')]['message']);return _0xd0b0a6(_0x58333d[_0x6125('0x12')][_0x6125('0x13')]);}else{logger[_0x6125('0xc')](_0x6125('0xd'),_0x3641e8,_0x6125('0xe'));_0xd0b0a6(_0x58333d[_0x6125('0x14')]['message']);}})[_0x6125('0x15')](function(_0xf5c66d){logger[_0x6125('0x12')](_0x6125('0xd'),_0x3641e8,_0xf5c66d);_0x42b430(_0xf5c66d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index c07b53b..4a5eed1 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 _0x273e=['index','/describe','describe','/:id','show','/:id/questions','isAuthenticated','getQuestions','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','get'];(function(_0x2a8a9,_0x2cd671){var _0x1d8af0=function(_0x351196){while(--_0x351196){_0x2a8a9['push'](_0x2a8a9['shift']());}};_0x1d8af0(++_0x2cd671);}(_0x273e,0x158));var _0xe273=function(_0x333ed0,_0x24e1a9){_0x333ed0=_0x333ed0-0x0;var _0x558ab7=_0x273e[_0x333ed0];return _0x558ab7;};'use strict';var multer=require(_0xe273('0x0'));var util=require(_0xe273('0x1'));var path=require(_0xe273('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe273('0x3')]();var fs_extra=require(_0xe273('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe273('0x5'));var config=require('../../config/environment');var controller=require(_0xe273('0x6'));router[_0xe273('0x7')]('/',auth['isAuthenticated'](),controller[_0xe273('0x8')]);router[_0xe273('0x7')](_0xe273('0x9'),auth['isAuthenticated'](),controller[_0xe273('0xa')]);router['get'](_0xe273('0xb'),auth['isAuthenticated'](),controller[_0xe273('0xc')]);router[_0xe273('0x7')](_0xe273('0xd'),auth[_0xe273('0xe')](),controller[_0xe273('0xf')]);router[_0xe273('0x10')]('/',auth[_0xe273('0xe')](),controller['create']);router[_0xe273('0x11')](_0xe273('0xb'),auth[_0xe273('0xe')](),controller[_0xe273('0x12')]);router[_0xe273('0x13')](_0xe273('0xb'),auth[_0xe273('0xe')](),controller[_0xe273('0x14')]);module[_0xe273('0x15')]=router; \ No newline at end of file +var _0x6bd6=['getQuestions','create','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions'];(function(_0x27963c,_0x3dd8fc){var _0x2ec155=function(_0xf0b223){while(--_0xf0b223){_0x27963c['push'](_0x27963c['shift']());}};_0x2ec155(++_0x3dd8fc);}(_0x6bd6,0x158));var _0x66bd=function(_0xa741fa,_0x14b888){_0xa741fa=_0xa741fa-0x0;var _0xfa882c=_0x6bd6[_0xa741fa];return _0xfa882c;};'use strict';var multer=require(_0x66bd('0x0'));var util=require(_0x66bd('0x1'));var path=require(_0x66bd('0x2'));var timeout=require(_0x66bd('0x3'));var express=require('express');var router=express[_0x66bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x66bd('0x5'));var interaction=require(_0x66bd('0x6'));var config=require(_0x66bd('0x7'));var controller=require(_0x66bd('0x8'));router[_0x66bd('0x9')]('/',auth[_0x66bd('0xa')](),controller['index']);router['get'](_0x66bd('0xb'),auth[_0x66bd('0xa')](),controller[_0x66bd('0xc')]);router[_0x66bd('0x9')](_0x66bd('0xd'),auth[_0x66bd('0xa')](),controller[_0x66bd('0xe')]);router[_0x66bd('0x9')](_0x66bd('0xf'),auth[_0x66bd('0xa')](),controller[_0x66bd('0x10')]);router['post']('/',auth[_0x66bd('0xa')](),controller[_0x66bd('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x66bd('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x66bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0cf4a9b..ab33b38 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 _0x20f2=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x20f2,0x1e6));var _0x220f=function(_0xb8245e,_0x41ab7a){_0xb8245e=_0xb8245e-0x0;var _0x2f5a62=_0x20f2[_0xb8245e];return _0x2f5a62;};'use strict';var moment=require(_0x220f('0x0'));var Sequelize=require(_0x220f('0x1'));module[_0x220f('0x2')]={'starttime':{'type':Sequelize[_0x220f('0x3')],'set':function(_0x3c55d0){this[_0x220f('0x4')](_0x220f('0x5'),_0x3c55d0);this[_0x220f('0x4')](_0x220f('0x6'),moment()[_0x220f('0x7')](_0x220f('0x8')));}},'endtime':{'type':Sequelize[_0x220f('0x3')]},'membername':{'type':Sequelize[_0x220f('0x9')]},'projectname':{'type':Sequelize[_0x220f('0x9')]},'queue':{'type':Sequelize[_0x220f('0x9')]},'uniqueid':{'type':Sequelize[_0x220f('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x220f('0x9')]},'completed':{'type':Sequelize[_0x220f('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x32b4=['DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b4,0x73));var _0x432b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x32b4[_0x1d1779];return _0x2377e9;};'use strict';var moment=require('moment');var Sequelize=require(_0x432b('0x0'));module[_0x432b('0x1')]={'starttime':{'type':Sequelize[_0x432b('0x2')],'set':function(_0x5e9bbd){this['setDataValue'](_0x432b('0x3'),_0x5e9bbd);this[_0x432b('0x4')](_0x432b('0x5'),moment()[_0x432b('0x6')](_0x432b('0x7')));}},'endtime':{'type':Sequelize[_0x432b('0x2')]},'membername':{'type':Sequelize[_0x432b('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x432b('0x8')]},'uniqueid':{'type':Sequelize[_0x432b('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x432b('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 63fe8ec..c7f371b 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x289c=['params','find','catch','create','body','describe','getQuestions','findOne','SessionId','filter','JscriptyQuestionReport','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x370281,_0x50b615){var _0x33a7ae=function(_0x111586){while(--_0x111586){_0x370281['push'](_0x370281['shift']());}};_0x33a7ae(++_0x50b615);}(_0x289c,0xa3));var _0xc289=function(_0x2c6d74,_0x450a5b){_0x2c6d74=_0x2c6d74-0x0;var _0x3bd411=_0x289c[_0x2c6d74];return _0x3bd411;};'use strict';var emlformat=require(_0xc289('0x0'));var rimraf=require(_0xc289('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc289('0x2'));var rp=require(_0xc289('0x3'));var moment=require(_0xc289('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc289('0x5'));var path=require(_0xc289('0x6'));var sox=require(_0xc289('0x7'));var csv=require(_0xc289('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc289('0x9'));var _=require('lodash');var squel=require(_0xc289('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc289('0xb'));var toCsv=require(_0xc289('0x8'));var querystring=require(_0xc289('0xc'));var Papa=require(_0xc289('0xd'));var Redis=require(_0xc289('0xe'));var authService=require(_0xc289('0xf'));var qs=require(_0xc289('0x10'));var as=require(_0xc289('0x11'));var hardwareService=require(_0xc289('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc289('0x13'));var config=require(_0xc289('0x14'));var licenseUtil=require(_0xc289('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8af9,_0x46f672){_0x46f672=_0x46f672||0xcc;return function(_0x423264){if(_0x423264){return _0x5a8af9[_0xc289('0x16')](_0x46f672);}return _0x5a8af9['status'](_0x46f672)[_0xc289('0x17')]();};}function respondWithResult(_0x2def6d,_0x236e28){_0x236e28=_0x236e28||0xc8;return function(_0x13863a){if(_0x13863a){return _0x2def6d['status'](_0x236e28)[_0xc289('0x18')](_0x13863a);}};}function respondWithFilteredResult(_0x28ab12,_0x4f6a7a){return function(_0x11f42a){if(_0x11f42a){var _0x296b26=typeof _0x4f6a7a['offset']===_0xc289('0x19')&&typeof _0x4f6a7a[_0xc289('0x1a')]===_0xc289('0x19');var _0x2350f3=_0x11f42a[_0xc289('0x1b')];var _0xcec38f=_0x296b26?0x0:_0x4f6a7a[_0xc289('0x1c')];var _0x29b831=_0x296b26?_0x11f42a[_0xc289('0x1b')]:_0x4f6a7a[_0xc289('0x1c')]+_0x4f6a7a[_0xc289('0x1a')];var _0x286d81;if(_0x29b831>=_0x2350f3){_0x29b831=_0x2350f3;_0x286d81=0xc8;}else{_0x286d81=0xce;}_0x28ab12['status'](_0x286d81);return _0x28ab12[_0xc289('0x1d')](_0xc289('0x1e'),_0xcec38f+'-'+_0x29b831+'/'+_0x2350f3)[_0xc289('0x18')](_0x11f42a);}return null;};}function patchUpdates(_0x178dd9){return function(_0x1bcf54){try{jsonpatch['apply'](_0x1bcf54,_0x178dd9,!![]);}catch(_0x1ba58){return BPromise[_0xc289('0x1f')](_0x1ba58);}return _0x1bcf54[_0xc289('0x20')]();};}function saveUpdates(_0x4bfd6f,_0x12f9ba){return function(_0x3c51d2){if(_0x3c51d2){return _0x3c51d2[_0xc289('0x21')](_0x4bfd6f)[_0xc289('0x22')](function(_0x2def57){return _0x2def57;});}return null;};}function removeEntity(_0x2c93fd,_0x46dad8){return function(_0x2e9ac5){if(_0x2e9ac5){return _0x2e9ac5[_0xc289('0x23')]()[_0xc289('0x22')](function(){_0x2c93fd['status'](0xcc)[_0xc289('0x17')]();});}};}function handleEntityNotFound(_0x394ecf,_0x2219a4){return function(_0x341043){if(!_0x341043){_0x394ecf[_0xc289('0x16')](0x194);}return _0x341043;};}function handleError(_0x327c93,_0x5870a1){_0x5870a1=_0x5870a1||0x1f4;return function(_0x2bd9f8){logger[_0xc289('0x24')](_0x2bd9f8['stack']);if(_0x2bd9f8[_0xc289('0x25')]){delete _0x2bd9f8[_0xc289('0x25')];}_0x327c93['status'](_0x5870a1)[_0xc289('0x26')](_0x2bd9f8);};}exports[_0xc289('0x27')]=function(_0x250aa1,_0x4d42f9){var _0x38e10f={},_0x15145e={},_0x2ad104={'count':0x0,'rows':[]};var _0x3fdd91=_[_0xc289('0x28')](db[_0xc289('0x29')][_0xc289('0x2a')],function(_0xc213d7){return{'name':_0xc213d7[_0xc289('0x2b')],'type':_0xc213d7[_0xc289('0x2c')][_0xc289('0x2d')]};});_0x15145e[_0xc289('0x2e')]=_[_0xc289('0x28')](_0x3fdd91,_0xc289('0x25'));_0x15145e[_0xc289('0x2f')]=_[_0xc289('0x30')](_0x250aa1[_0xc289('0x2f')]);_0x15145e[_0xc289('0x31')]=_[_0xc289('0x32')](_0x15145e[_0xc289('0x2e')],_0x15145e['query']);_0x38e10f[_0xc289('0x33')]=_[_0xc289('0x32')](_0x15145e[_0xc289('0x2e')],qs[_0xc289('0x34')](_0x250aa1[_0xc289('0x2f')][_0xc289('0x34')]));_0x38e10f[_0xc289('0x33')]=_0x38e10f[_0xc289('0x33')]['length']?_0x38e10f[_0xc289('0x33')]:_0x15145e['model'];if(!_0x250aa1[_0xc289('0x2f')]['hasOwnProperty'](_0xc289('0x35'))){_0x38e10f[_0xc289('0x1a')]=qs[_0xc289('0x1a')](_0x250aa1[_0xc289('0x2f')][_0xc289('0x1a')]);_0x38e10f[_0xc289('0x1c')]=qs[_0xc289('0x1c')](_0x250aa1[_0xc289('0x2f')][_0xc289('0x1c')]);}_0x38e10f[_0xc289('0x36')]=qs[_0xc289('0x37')](_0x250aa1[_0xc289('0x2f')]['sort']);_0x38e10f[_0xc289('0x38')]=qs[_0xc289('0x31')](_[_0xc289('0x39')](_0x250aa1['query'],_0x15145e['filters']),_0x3fdd91);if(_0x250aa1[_0xc289('0x2f')]['filter']){_0x38e10f[_0xc289('0x38')]=_[_0xc289('0x3a')](_0x38e10f[_0xc289('0x38')],{'$or':_[_0xc289('0x28')](_0x3fdd91,function(_0xe77779){if(_0xe77779[_0xc289('0x2c')]!==_0xc289('0x3b')){var _0x5cc506={};_0x5cc506[_0xe77779[_0xc289('0x25')]]={'$like':'%'+_0x250aa1[_0xc289('0x2f')]['filter']+'%'};return _0x5cc506;}})});}_0x38e10f=_[_0xc289('0x3a')]({},_0x38e10f,_0x250aa1[_0xc289('0x3c')]);var _0x5a1141={'where':_0x38e10f['where']};return db['JscriptySessionReport'][_0xc289('0x1b')](_0x5a1141)['then'](function(_0x2b484e){_0x2ad104[_0xc289('0x1b')]=_0x2b484e;if(_0x250aa1['query'][_0xc289('0x3d')]){_0x38e10f[_0xc289('0x3e')]=[{'all':!![]}];}return db[_0xc289('0x29')]['findAll'](_0x38e10f);})[_0xc289('0x22')](function(_0x5cc565){_0x2ad104[_0xc289('0x3f')]=_0x5cc565;return _0x2ad104;})['then'](respondWithFilteredResult(_0x4d42f9,_0x38e10f))['catch'](handleError(_0x4d42f9,null));};exports[_0xc289('0x40')]=function(_0x1afdfa,_0x1a37ac){var _0x14cbe3={'raw':!![],'where':{'id':_0x1afdfa[_0xc289('0x41')]['id']}},_0x1f9a89={};_0x1f9a89[_0xc289('0x2e')]=_[_0xc289('0x30')](db[_0xc289('0x29')][_0xc289('0x2a')]);_0x1f9a89['query']=_[_0xc289('0x30')](_0x1afdfa['query']);_0x1f9a89['filters']=_[_0xc289('0x32')](_0x1f9a89[_0xc289('0x2e')],_0x1f9a89[_0xc289('0x2f')]);_0x14cbe3['attributes']=_[_0xc289('0x32')](_0x1f9a89[_0xc289('0x2e')],qs['fields'](_0x1afdfa[_0xc289('0x2f')][_0xc289('0x34')]));_0x14cbe3[_0xc289('0x33')]=_0x14cbe3['attributes']['length']?_0x14cbe3[_0xc289('0x33')]:_0x1f9a89['model'];if(_0x1afdfa[_0xc289('0x2f')][_0xc289('0x3d')]){_0x14cbe3[_0xc289('0x3e')]=[{'all':!![]}];}_0x14cbe3=_['merge']({},_0x14cbe3,_0x1afdfa[_0xc289('0x3c')]);return db[_0xc289('0x29')][_0xc289('0x42')](_0x14cbe3)['then'](handleEntityNotFound(_0x1a37ac,null))[_0xc289('0x22')](respondWithResult(_0x1a37ac,null))[_0xc289('0x43')](handleError(_0x1a37ac,null));};exports[_0xc289('0x44')]=function(_0x1bfaa1,_0x5a4846){return db[_0xc289('0x29')][_0xc289('0x44')](_0x1bfaa1[_0xc289('0x45')],{})[_0xc289('0x22')](respondWithResult(_0x5a4846,0xc9))['catch'](handleError(_0x5a4846,null));};exports[_0xc289('0x21')]=function(_0xd2ff1e,_0x16ca52){if(_0xd2ff1e[_0xc289('0x45')]['id']){delete _0xd2ff1e[_0xc289('0x45')]['id'];}return db[_0xc289('0x29')][_0xc289('0x42')]({'where':{'id':_0xd2ff1e[_0xc289('0x41')]['id']}})[_0xc289('0x22')](handleEntityNotFound(_0x16ca52,null))[_0xc289('0x22')](saveUpdates(_0xd2ff1e[_0xc289('0x45')],null))[_0xc289('0x22')](respondWithResult(_0x16ca52,null))[_0xc289('0x43')](handleError(_0x16ca52,null));};exports[_0xc289('0x23')]=function(_0x1ff735,_0x57469a){return db['JscriptySessionReport'][_0xc289('0x42')]({'where':{'id':_0x1ff735[_0xc289('0x41')]['id']}})['then'](handleEntityNotFound(_0x57469a,null))[_0xc289('0x22')](removeEntity(_0x57469a,null))[_0xc289('0x43')](handleError(_0x57469a,null));};exports['describe']=function(_0x281fb,_0x5c1492){return db[_0xc289('0x29')][_0xc289('0x46')]()[_0xc289('0x22')](respondWithResult(_0x5c1492,null))[_0xc289('0x43')](handleError(_0x5c1492,null));};exports[_0xc289('0x47')]=function(_0xbfb6a9,_0x526a42,_0x39da0c){var _0x1a1914={'raw':!![],'where':{}};var _0x2cca36={};var _0x37c651={'count':0x0,'rows':[]};return db[_0xc289('0x29')][_0xc289('0x48')]({'where':{'id':_0xbfb6a9['params']['id']}})['then'](handleEntityNotFound(_0x526a42,null))['then'](function(_0x1911c8){if(_0x1911c8){_0x2cca36[_0xc289('0x2e')]=_[_0xc289('0x30')](db['JscriptyQuestionReport'][_0xc289('0x2a')]);_0x2cca36[_0xc289('0x2f')]=_[_0xc289('0x30')](_0xbfb6a9[_0xc289('0x2f')]);_0x2cca36['filters']=_[_0xc289('0x32')](_0x2cca36[_0xc289('0x2e')],_0x2cca36['query']);_0x1a1914['attributes']=_[_0xc289('0x32')](_0x2cca36['model'],qs[_0xc289('0x34')](_0xbfb6a9[_0xc289('0x2f')][_0xc289('0x34')]));_0x1a1914[_0xc289('0x33')]=_0x1a1914[_0xc289('0x33')]['length']?_0x1a1914[_0xc289('0x33')]:_0x2cca36[_0xc289('0x2e')];if(!_0xbfb6a9['query']['hasOwnProperty'](_0xc289('0x35'))){_0x1a1914[_0xc289('0x1a')]=qs[_0xc289('0x1a')](_0xbfb6a9[_0xc289('0x2f')][_0xc289('0x1a')]);_0x1a1914[_0xc289('0x1c')]=qs[_0xc289('0x1c')](_0xbfb6a9[_0xc289('0x2f')][_0xc289('0x1c')]);}_0x1a1914[_0xc289('0x36')]=qs[_0xc289('0x37')](_0xbfb6a9['query'][_0xc289('0x37')]);_0x1a1914[_0xc289('0x38')]=qs[_0xc289('0x31')](_[_0xc289('0x39')](_0xbfb6a9[_0xc289('0x2f')],_0x2cca36[_0xc289('0x31')]));_0x1a1914[_0xc289('0x38')][_0xc289('0x49')]=_0x1911c8['id'];if(_0xbfb6a9[_0xc289('0x2f')][_0xc289('0x4a')]){_0x1a1914['where']=_[_0xc289('0x3a')](_0x1a1914[_0xc289('0x38')],{'$or':_[_0xc289('0x28')](_0x1a1914[_0xc289('0x33')],function(_0x1d2e9e){var _0x22b7b5={};_0x22b7b5[_0x1d2e9e]={'$like':'%'+_0xbfb6a9[_0xc289('0x2f')][_0xc289('0x4a')]+'%'};return _0x22b7b5;})});}_0x1a1914=_['merge']({},_0x1a1914,_0xbfb6a9[_0xc289('0x3c')]);return db['JscriptyQuestionReport'][_0xc289('0x1b')]({'where':_0x1a1914[_0xc289('0x38')]})[_0xc289('0x22')](function(_0x4ba381){_0x37c651[_0xc289('0x1b')]=_0x4ba381;if(_0xbfb6a9[_0xc289('0x2f')]['includeAll']){_0x1a1914[_0xc289('0x3e')]=[{'all':!![]}];}return db[_0xc289('0x4b')]['findAll'](_0x1a1914);})[_0xc289('0x22')](function(_0x3d7e8e){_0x37c651['rows']=_0x3d7e8e;return _0x37c651;});}})['then'](respondWithFilteredResult(_0x526a42,_0x1a1914))[_0xc289('0x43')](handleError(_0x526a42,null));}; \ No newline at end of file +var _0x3ade=['describe','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','index','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','create','body','find'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x3ade,0x1d2));var _0xe3ad=function(_0x264ff2,_0x47ae2f){_0x264ff2=_0x264ff2-0x0;var _0x3e23d6=_0x3ade[_0x264ff2];return _0x3e23d6;};'use strict';var emlformat=require(_0xe3ad('0x0'));var rimraf=require(_0xe3ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ad('0x2'));var rp=require(_0xe3ad('0x3'));var moment=require('moment');var BPromise=require(_0xe3ad('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe3ad('0x5'));var sox=require(_0xe3ad('0x6'));var csv=require(_0xe3ad('0x7'));var ejs=require(_0xe3ad('0x8'));var fs=require('fs');var fs_extra=require(_0xe3ad('0x9'));var _=require(_0xe3ad('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe3ad('0xb'));var deskjs=require(_0xe3ad('0xc'));var toCsv=require(_0xe3ad('0x7'));var querystring=require(_0xe3ad('0xd'));var Papa=require(_0xe3ad('0xe'));var Redis=require(_0xe3ad('0xf'));var authService=require(_0xe3ad('0x10'));var qs=require(_0xe3ad('0x11'));var as=require(_0xe3ad('0x12'));var hardwareService=require(_0xe3ad('0x13'));var logger=require('../../config/logger')(_0xe3ad('0x14'));var utils=require(_0xe3ad('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe3ad('0x16'))['db'];function respondWithStatusCode(_0x291d5a,_0x51ba7c){_0x51ba7c=_0x51ba7c||0xcc;return function(_0x58a57f){if(_0x58a57f){return _0x291d5a[_0xe3ad('0x17')](_0x51ba7c);}return _0x291d5a[_0xe3ad('0x18')](_0x51ba7c)[_0xe3ad('0x19')]();};}function respondWithResult(_0x3ddaef,_0x403aae){_0x403aae=_0x403aae||0xc8;return function(_0x60c1c5){if(_0x60c1c5){return _0x3ddaef[_0xe3ad('0x18')](_0x403aae)[_0xe3ad('0x1a')](_0x60c1c5);}};}function respondWithFilteredResult(_0x220220,_0x11f502){return function(_0xe995ab){if(_0xe995ab){var _0x4dc0fc=typeof _0x11f502[_0xe3ad('0x1b')]===_0xe3ad('0x1c')&&typeof _0x11f502[_0xe3ad('0x1d')]===_0xe3ad('0x1c');var _0x15ab05=_0xe995ab['count'];var _0x228081=_0x4dc0fc?0x0:_0x11f502[_0xe3ad('0x1b')];var _0x246fd5=_0x4dc0fc?_0xe995ab[_0xe3ad('0x1e')]:_0x11f502['offset']+_0x11f502['limit'];var _0x429bd5;if(_0x246fd5>=_0x15ab05){_0x246fd5=_0x15ab05;_0x429bd5=0xc8;}else{_0x429bd5=0xce;}_0x220220[_0xe3ad('0x18')](_0x429bd5);return _0x220220[_0xe3ad('0x1f')](_0xe3ad('0x20'),_0x228081+'-'+_0x246fd5+'/'+_0x15ab05)['json'](_0xe995ab);}return null;};}function patchUpdates(_0x5253e2){return function(_0x2839a1){try{jsonpatch[_0xe3ad('0x21')](_0x2839a1,_0x5253e2,!![]);}catch(_0x195703){return BPromise[_0xe3ad('0x22')](_0x195703);}return _0x2839a1[_0xe3ad('0x23')]();};}function saveUpdates(_0x87a5e8,_0x211452){return function(_0x52979c){if(_0x52979c){return _0x52979c[_0xe3ad('0x24')](_0x87a5e8)[_0xe3ad('0x25')](function(_0x5ae450){return _0x5ae450;});}return null;};}function removeEntity(_0x53bb88,_0x1141bc){return function(_0x15c212){if(_0x15c212){return _0x15c212[_0xe3ad('0x26')]()[_0xe3ad('0x25')](function(){_0x53bb88['status'](0xcc)[_0xe3ad('0x19')]();});}};}function handleEntityNotFound(_0x20e4b7,_0x447bc4){return function(_0x2ff02f){if(!_0x2ff02f){_0x20e4b7['sendStatus'](0x194);}return _0x2ff02f;};}function handleError(_0x200954,_0x586f6f){_0x586f6f=_0x586f6f||0x1f4;return function(_0x5150f7){logger[_0xe3ad('0x27')](_0x5150f7['stack']);if(_0x5150f7['name']){delete _0x5150f7['name'];}_0x200954[_0xe3ad('0x18')](_0x586f6f)['send'](_0x5150f7);};}exports[_0xe3ad('0x28')]=function(_0x4f875b,_0x22526d){var _0x5762a9={},_0x26cf5f={},_0x295b80={'count':0x0,'rows':[]};var _0x5f5429=_['map'](db['JscriptySessionReport']['rawAttributes'],function(_0x25ea30){return{'name':_0x25ea30[_0xe3ad('0x29')],'type':_0x25ea30[_0xe3ad('0x2a')][_0xe3ad('0x2b')]};});_0x26cf5f[_0xe3ad('0x2c')]=_[_0xe3ad('0x2d')](_0x5f5429,_0xe3ad('0x2e'));_0x26cf5f[_0xe3ad('0x2f')]=_[_0xe3ad('0x30')](_0x4f875b[_0xe3ad('0x2f')]);_0x26cf5f['filters']=_[_0xe3ad('0x31')](_0x26cf5f[_0xe3ad('0x2c')],_0x26cf5f[_0xe3ad('0x2f')]);_0x5762a9[_0xe3ad('0x32')]=_[_0xe3ad('0x31')](_0x26cf5f['model'],qs[_0xe3ad('0x33')](_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x33')]));_0x5762a9['attributes']=_0x5762a9[_0xe3ad('0x32')][_0xe3ad('0x34')]?_0x5762a9[_0xe3ad('0x32')]:_0x26cf5f[_0xe3ad('0x2c')];if(!_0x4f875b['query'][_0xe3ad('0x35')](_0xe3ad('0x36'))){_0x5762a9['limit']=qs[_0xe3ad('0x1d')](_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x1d')]);_0x5762a9['offset']=qs[_0xe3ad('0x1b')](_0x4f875b['query']['offset']);}_0x5762a9[_0xe3ad('0x37')]=qs[_0xe3ad('0x38')](_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x38')]);_0x5762a9[_0xe3ad('0x39')]=qs[_0xe3ad('0x3a')](_[_0xe3ad('0x3b')](_0x4f875b['query'],_0x26cf5f[_0xe3ad('0x3a')]),_0x5f5429);if(_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x3c')]){_0x5762a9[_0xe3ad('0x39')]=_[_0xe3ad('0x3d')](_0x5762a9[_0xe3ad('0x39')],{'$or':_[_0xe3ad('0x2d')](_0x5f5429,function(_0x520779){if(_0x520779['type']!=='VIRTUAL'){var _0x5c2265={};_0x5c2265[_0x520779['name']]={'$like':'%'+_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x3c')]+'%'};return _0x5c2265;}})});}_0x5762a9=_[_0xe3ad('0x3d')]({},_0x5762a9,_0x4f875b[_0xe3ad('0x3e')]);var _0x389566={'where':_0x5762a9['where']};return db[_0xe3ad('0x3f')][_0xe3ad('0x1e')](_0x389566)['then'](function(_0x1c69d7){_0x295b80[_0xe3ad('0x1e')]=_0x1c69d7;if(_0x4f875b[_0xe3ad('0x2f')][_0xe3ad('0x40')]){_0x5762a9[_0xe3ad('0x41')]=[{'all':!![]}];}return db[_0xe3ad('0x3f')][_0xe3ad('0x42')](_0x5762a9);})[_0xe3ad('0x25')](function(_0x1b6159){_0x295b80[_0xe3ad('0x43')]=_0x1b6159;return _0x295b80;})[_0xe3ad('0x25')](respondWithFilteredResult(_0x22526d,_0x5762a9))[_0xe3ad('0x44')](handleError(_0x22526d,null));};exports['show']=function(_0x1a46eb,_0x23c387){var _0x4dc5c8={'raw':!![],'where':{'id':_0x1a46eb[_0xe3ad('0x45')]['id']}},_0x24535d={};_0x24535d[_0xe3ad('0x2c')]=_[_0xe3ad('0x30')](db[_0xe3ad('0x3f')]['rawAttributes']);_0x24535d[_0xe3ad('0x2f')]=_[_0xe3ad('0x30')](_0x1a46eb['query']);_0x24535d[_0xe3ad('0x3a')]=_['intersection'](_0x24535d[_0xe3ad('0x2c')],_0x24535d['query']);_0x4dc5c8[_0xe3ad('0x32')]=_[_0xe3ad('0x31')](_0x24535d[_0xe3ad('0x2c')],qs['fields'](_0x1a46eb[_0xe3ad('0x2f')][_0xe3ad('0x33')]));_0x4dc5c8[_0xe3ad('0x32')]=_0x4dc5c8[_0xe3ad('0x32')]['length']?_0x4dc5c8[_0xe3ad('0x32')]:_0x24535d['model'];if(_0x1a46eb[_0xe3ad('0x2f')][_0xe3ad('0x40')]){_0x4dc5c8[_0xe3ad('0x41')]=[{'all':!![]}];}_0x4dc5c8=_['merge']({},_0x4dc5c8,_0x1a46eb['options']);return db['JscriptySessionReport']['find'](_0x4dc5c8)['then'](handleEntityNotFound(_0x23c387,null))[_0xe3ad('0x25')](respondWithResult(_0x23c387,null))[_0xe3ad('0x44')](handleError(_0x23c387,null));};exports[_0xe3ad('0x46')]=function(_0x565cc2,_0x1afb82){return db[_0xe3ad('0x3f')]['create'](_0x565cc2['body'],{})['then'](respondWithResult(_0x1afb82,0xc9))['catch'](handleError(_0x1afb82,null));};exports[_0xe3ad('0x24')]=function(_0x21f136,_0x58dfe3){if(_0x21f136[_0xe3ad('0x47')]['id']){delete _0x21f136[_0xe3ad('0x47')]['id'];}return db['JscriptySessionReport'][_0xe3ad('0x48')]({'where':{'id':_0x21f136[_0xe3ad('0x45')]['id']}})[_0xe3ad('0x25')](handleEntityNotFound(_0x58dfe3,null))[_0xe3ad('0x25')](saveUpdates(_0x21f136[_0xe3ad('0x47')],null))[_0xe3ad('0x25')](respondWithResult(_0x58dfe3,null))[_0xe3ad('0x44')](handleError(_0x58dfe3,null));};exports[_0xe3ad('0x26')]=function(_0x407141,_0x14f075){return db[_0xe3ad('0x3f')][_0xe3ad('0x48')]({'where':{'id':_0x407141['params']['id']}})[_0xe3ad('0x25')](handleEntityNotFound(_0x14f075,null))[_0xe3ad('0x25')](removeEntity(_0x14f075,null))[_0xe3ad('0x44')](handleError(_0x14f075,null));};exports['describe']=function(_0x5ad2f9,_0x87febb){return db[_0xe3ad('0x3f')][_0xe3ad('0x49')]()[_0xe3ad('0x25')](respondWithResult(_0x87febb,null))[_0xe3ad('0x44')](handleError(_0x87febb,null));};exports['getQuestions']=function(_0x52033e,_0x2b0557,_0x3b8955){var _0x4a41f4={'raw':!![],'where':{}};var _0x595a6d={};var _0x58fe84={'count':0x0,'rows':[]};return db[_0xe3ad('0x3f')][_0xe3ad('0x4a')]({'where':{'id':_0x52033e[_0xe3ad('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b0557,null))[_0xe3ad('0x25')](function(_0x1c5d90){if(_0x1c5d90){_0x595a6d[_0xe3ad('0x2c')]=_[_0xe3ad('0x30')](db[_0xe3ad('0x4b')]['rawAttributes']);_0x595a6d[_0xe3ad('0x2f')]=_[_0xe3ad('0x30')](_0x52033e[_0xe3ad('0x2f')]);_0x595a6d[_0xe3ad('0x3a')]=_[_0xe3ad('0x31')](_0x595a6d[_0xe3ad('0x2c')],_0x595a6d['query']);_0x4a41f4['attributes']=_[_0xe3ad('0x31')](_0x595a6d['model'],qs['fields'](_0x52033e['query'][_0xe3ad('0x33')]));_0x4a41f4[_0xe3ad('0x32')]=_0x4a41f4[_0xe3ad('0x32')][_0xe3ad('0x34')]?_0x4a41f4[_0xe3ad('0x32')]:_0x595a6d[_0xe3ad('0x2c')];if(!_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x35')](_0xe3ad('0x36'))){_0x4a41f4[_0xe3ad('0x1d')]=qs['limit'](_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x1d')]);_0x4a41f4['offset']=qs[_0xe3ad('0x1b')](_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x1b')]);}_0x4a41f4[_0xe3ad('0x37')]=qs[_0xe3ad('0x38')](_0x52033e[_0xe3ad('0x2f')]['sort']);_0x4a41f4[_0xe3ad('0x39')]=qs[_0xe3ad('0x3a')](_[_0xe3ad('0x3b')](_0x52033e['query'],_0x595a6d['filters']));_0x4a41f4['where'][_0xe3ad('0x4c')]=_0x1c5d90['id'];if(_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x3c')]){_0x4a41f4[_0xe3ad('0x39')]=_[_0xe3ad('0x3d')](_0x4a41f4[_0xe3ad('0x39')],{'$or':_[_0xe3ad('0x2d')](_0x4a41f4[_0xe3ad('0x32')],function(_0x3c463a){var _0x39f0bc={};_0x39f0bc[_0x3c463a]={'$like':'%'+_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x3c')]+'%'};return _0x39f0bc;})});}_0x4a41f4=_[_0xe3ad('0x3d')]({},_0x4a41f4,_0x52033e[_0xe3ad('0x3e')]);return db[_0xe3ad('0x4b')][_0xe3ad('0x1e')]({'where':_0x4a41f4['where']})[_0xe3ad('0x25')](function(_0x4c723d){_0x58fe84['count']=_0x4c723d;if(_0x52033e[_0xe3ad('0x2f')][_0xe3ad('0x40')]){_0x4a41f4[_0xe3ad('0x41')]=[{'all':!![]}];}return db[_0xe3ad('0x4b')][_0xe3ad('0x42')](_0x4a41f4);})['then'](function(_0x453c50){_0x58fe84['rows']=_0x453c50;return _0x58fe84;});}})['then'](respondWithFilteredResult(_0x2b0557,_0x4a41f4))[_0xe3ad('0x44')](handleError(_0x2b0557,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7d28bb0..6dcc81e 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 _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1fcf6c,_0x1613c0){_0x1fcf6c=_0x1fcf6c-0x0;var _0x40c5da=_0xb4c7[_0x1fcf6c];return _0x40c5da;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe015=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','report_jscripty_sessions'];(function(_0x53e925,_0xed13c8){var _0x169487=function(_0x2dadac){while(--_0x2dadac){_0x53e925['push'](_0x53e925['shift']());}};_0x169487(++_0xed13c8);}(_0xe015,0x13b));var _0x5e01=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe015[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('JscriptySessionReport',attributes,{'tableName':_0x5e01('0x8'),'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 d58f292..fd0f556 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 _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x23b3df,_0x21ca6a){var _0x26488a=function(_0xf3d2dd){while(--_0xf3d2dd){_0x23b3df['push'](_0x23b3df['shift']());}};_0x26488a(++_0x21ca6a);}(_0x1261,0x144));var _0x1126=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x1261[_0x3d5df9];return _0x50ba39;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x77e6=['client','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2edcf6,_0x44ba8d){var _0x75d0d8=function(_0x8b1653){while(--_0x8b1653){_0x2edcf6['push'](_0x2edcf6['shift']());}};_0x75d0d8(++_0x44ba8d);}(_0x77e6,0x1a6));var _0x677e=function(_0x19a947,_0x5c7d80){_0x19a947=_0x19a947-0x0;var _0x37e79e=_0x77e6[_0x19a947];return _0x37e79e;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b0ed8c7..421d820 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 _0xba12=['Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','downloadLogFile','exports','multer','util','path','connect-timeout'];(function(_0x7b68ba,_0x4c4b0d){var _0x2dda4c=function(_0x16b5d6){while(--_0x16b5d6){_0x7b68ba['push'](_0x7b68ba['shift']());}};_0x2dda4c(++_0x4c4b0d);}(_0xba12,0x16c));var _0x2ba1=function(_0x3ab0d0,_0x946c4e){_0x3ab0d0=_0x3ab0d0-0x0;var _0x3ee9a7=_0xba12[_0x3ab0d0];return _0x3ee9a7;};'use strict';var multer=require(_0x2ba1('0x0'));var util=require(_0x2ba1('0x1'));var path=require(_0x2ba1('0x2'));var timeout=require(_0x2ba1('0x3'));var express=require('express');var router=express[_0x2ba1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ba1('0x5'));var config=require(_0x2ba1('0x6'));var controller=require(_0x2ba1('0x7'));router[_0x2ba1('0x8')]('/',controller[_0x2ba1('0x9')]);router[_0x2ba1('0xa')](_0x2ba1('0xb'),auth[_0x2ba1('0xc')](),controller[_0x2ba1('0xd')]);router[_0x2ba1('0x8')]('/download_log_file',auth['isAuthenticated'](),controller[_0x2ba1('0xe')]);module[_0x2ba1('0xf')]=router; \ No newline at end of file +var _0x70fa=['./license.controller','get','index','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x6b02d9,_0x3d1590){var _0x469c60=function(_0x5700df){while(--_0x5700df){_0x6b02d9['push'](_0x6b02d9['shift']());}};_0x469c60(++_0x3d1590);}(_0x70fa,0x1e4));var _0xa70f=function(_0x22de09,_0x3db597){_0x22de09=_0x22de09-0x0;var _0x4a13dc=_0x70fa[_0x22de09];return _0x4a13dc;};'use strict';var multer=require(_0xa70f('0x0'));var util=require(_0xa70f('0x1'));var path=require(_0xa70f('0x2'));var timeout=require(_0xa70f('0x3'));var express=require(_0xa70f('0x4'));var router=express[_0xa70f('0x5')]();var fs_extra=require(_0xa70f('0x6'));var auth=require(_0xa70f('0x7'));var interaction=require(_0xa70f('0x8'));var config=require(_0xa70f('0x9'));var controller=require(_0xa70f('0xa'));router[_0xa70f('0xb')]('/',controller[_0xa70f('0xc')]);router[_0xa70f('0xd')](_0xa70f('0xe'),auth[_0xa70f('0xf')](),controller['update']);router[_0xa70f('0xb')](_0xa70f('0x10'),auth['isAuthenticated'](),controller[_0xa70f('0x11')]);module[_0xa70f('0x12')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 368af07..0881e34 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 _0x9119=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x28763e,_0x8fcea5){var _0x550795=function(_0x5eb7af){while(--_0x5eb7af){_0x28763e['push'](_0x28763e['shift']());}};_0x550795(++_0x8fcea5);}(_0x9119,0x1f1));var _0x9911=function(_0x3c3388,_0xdf58a0){_0x3c3388=_0x3c3388-0x0;var _0x570040=_0x9119[_0x3c3388];return _0x570040;};'use strict';var Sequelize=require(_0x9911('0x0'));module[_0x9911('0x1')]={'license':{'type':Sequelize[_0x9911('0x2')]},'data1':{'type':Sequelize[_0x9911('0x3')]},'data2':{'type':Sequelize[_0x9911('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x9911('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf8bd=['sequelize','TEXT','STRING','INTEGER'];(function(_0x51f46a,_0x5c8b19){var _0x24896c=function(_0xf2c54c){while(--_0xf2c54c){_0x51f46a['push'](_0x51f46a['shift']());}};_0x24896c(++_0x5c8b19);}(_0xf8bd,0xc8));var _0xdf8b=function(_0x19fd3f,_0x8adcfa){_0x19fd3f=_0x19fd3f-0x0;var _0x28ad05=_0xf8bd[_0x19fd3f];return _0x28ad05;};'use strict';var Sequelize=require(_0xdf8b('0x0'));module['exports']={'license':{'type':Sequelize[_0xdf8b('0x1')]},'data1':{'type':Sequelize[_0xdf8b('0x2')]},'data2':{'type':Sequelize[_0xdf8b('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xdf8b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 6e80425..b9eebad 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 _0x9e4d=['key','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','name','send','index','License','rawAttributes','query','filters','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','params','checkLicense'];(function(_0x232ca6,_0xd7fe4c){var _0x3787c6=function(_0x268ae2){while(--_0x268ae2){_0x232ca6['push'](_0x232ca6['shift']());}};_0x3787c6(++_0xd7fe4c);}(_0x9e4d,0xa1));var _0xd9e4=function(_0x3b6beb,_0xefcd2b){_0x3b6beb=_0x3b6beb-0x0;var _0x20b5dc=_0x9e4d[_0x3b6beb];return _0x20b5dc;};'use strict';var emlformat=require(_0xd9e4('0x0'));var rimraf=require(_0xd9e4('0x1'));var zipdir=require(_0xd9e4('0x2'));var jsonpatch=require(_0xd9e4('0x3'));var rp=require(_0xd9e4('0x4'));var moment=require(_0xd9e4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd9e4('0x6'));var path=require(_0xd9e4('0x7'));var sox=require(_0xd9e4('0x8'));var csv=require(_0xd9e4('0x9'));var ejs=require(_0xd9e4('0xa'));var fs=require('fs');var fs_extra=require(_0xd9e4('0xb'));var _=require(_0xd9e4('0xc'));var squel=require(_0xd9e4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9e4('0xe'));var toCsv=require(_0xd9e4('0x9'));var querystring=require(_0xd9e4('0xf'));var Papa=require('papaparse');var Redis=require(_0xd9e4('0x10'));var authService=require(_0xd9e4('0x11'));var qs=require(_0xd9e4('0x12'));var as=require(_0xd9e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9e4('0x14'))(_0xd9e4('0x15'));var utils=require(_0xd9e4('0x16'));var config=require(_0xd9e4('0x17'));var licenseUtil=require(_0xd9e4('0x18'));var db=require(_0xd9e4('0x19'))['db'];function respondWithStatusCode(_0x197977,_0x285dea){_0x285dea=_0x285dea||0xcc;return function(_0x294d24){if(_0x294d24){return _0x197977[_0xd9e4('0x1a')](_0x285dea);}return _0x197977['status'](_0x285dea)['end']();};}function respondWithResult(_0x41f85f,_0x108232){_0x108232=_0x108232||0xc8;return function(_0x291d5d){if(_0x291d5d){return _0x41f85f[_0xd9e4('0x1b')](_0x108232)[_0xd9e4('0x1c')](_0x291d5d);}};}function respondWithFilteredResult(_0x44ffb4,_0x38746e){return function(_0x2df8b2){if(_0x2df8b2){var _0x595de3=typeof _0x38746e[_0xd9e4('0x1d')]===_0xd9e4('0x1e')&&typeof _0x38746e[_0xd9e4('0x1f')]===_0xd9e4('0x1e');var _0xbe05f4=_0x2df8b2[_0xd9e4('0x20')];var _0x543a9b=_0x595de3?0x0:_0x38746e[_0xd9e4('0x1d')];var _0x116ba4=_0x595de3?_0x2df8b2['count']:_0x38746e[_0xd9e4('0x1d')]+_0x38746e['limit'];var _0x46b063;if(_0x116ba4>=_0xbe05f4){_0x116ba4=_0xbe05f4;_0x46b063=0xc8;}else{_0x46b063=0xce;}_0x44ffb4[_0xd9e4('0x1b')](_0x46b063);return _0x44ffb4[_0xd9e4('0x21')]('Content-Range',_0x543a9b+'-'+_0x116ba4+'/'+_0xbe05f4)[_0xd9e4('0x1c')](_0x2df8b2);}return null;};}function patchUpdates(_0x4a82d1){return function(_0x338925){try{jsonpatch[_0xd9e4('0x22')](_0x338925,_0x4a82d1,!![]);}catch(_0x43325a){return BPromise[_0xd9e4('0x23')](_0x43325a);}return _0x338925[_0xd9e4('0x24')]();};}function saveUpdates(_0x41d736,_0xbdbeb8){return function(_0x144e78){if(_0x144e78){return _0x144e78[_0xd9e4('0x25')](_0x41d736)[_0xd9e4('0x26')](function(_0xc2f819){return _0xc2f819;});}return null;};}function removeEntity(_0x5c2bf5,_0x8eeb1c){return function(_0x11b2c1){if(_0x11b2c1){return _0x11b2c1[_0xd9e4('0x27')]()[_0xd9e4('0x26')](function(){_0x5c2bf5['status'](0xcc)[_0xd9e4('0x28')]();});}};}function handleEntityNotFound(_0x5d3753,_0x35e936){return function(_0x4a63c4){if(!_0x4a63c4){_0x5d3753[_0xd9e4('0x1a')](0x194);}return _0x4a63c4;};}function handleError(_0x223e41,_0x4d628d){_0x4d628d=_0x4d628d||0x1f4;return function(_0x19e0e9){logger[_0xd9e4('0x29')](_0x19e0e9['stack']);if(_0x19e0e9[_0xd9e4('0x2a')]){delete _0x19e0e9['name'];}_0x223e41[_0xd9e4('0x1b')](_0x4d628d)[_0xd9e4('0x2b')](_0x19e0e9);};}var utilLicense=require('../../config/license/util');exports[_0xd9e4('0x2c')]=function(_0x4e4346,_0x37849a){var _0x40f34f={'raw':!![],'where':{'id':0x1}},_0xbf2b95={};_0xbf2b95['model']=_['keys'](db[_0xd9e4('0x2d')][_0xd9e4('0x2e')]);_0xbf2b95[_0xd9e4('0x2f')]=_['keys'](_0x4e4346[_0xd9e4('0x2f')]);_0xbf2b95[_0xd9e4('0x30')]=_[_0xd9e4('0x31')](_0xbf2b95[_0xd9e4('0x32')],_0xbf2b95[_0xd9e4('0x2f')]);_0x40f34f[_0xd9e4('0x33')]=_[_0xd9e4('0x31')](_0xbf2b95[_0xd9e4('0x32')],qs[_0xd9e4('0x34')](_0x4e4346['query'][_0xd9e4('0x34')]));_0x40f34f[_0xd9e4('0x33')]=_0x40f34f[_0xd9e4('0x33')][_0xd9e4('0x35')]?_0x40f34f['attributes']:_0xbf2b95[_0xd9e4('0x32')];_0x40f34f=_[_0xd9e4('0x36')]({},_0x40f34f,_0x4e4346[_0xd9e4('0x37')]);return utilLicense[_0xd9e4('0x38')](_0x40f34f)[_0xd9e4('0x26')](respondWithResult(_0x37849a,null))[_0xd9e4('0x39')](handleError(_0x37849a,null));};exports['update']=function(_0x31152d,_0x8ec5cd){if(_0x31152d['body']['id']){delete _0x31152d[_0xd9e4('0x3a')]['id'];}return db['License']['find']({'where':{'id':_0x31152d[_0xd9e4('0x3b')]['id']}})['then'](handleEntityNotFound(_0x8ec5cd,null))[_0xd9e4('0x26')](function(_0x4afb88){var _0x3231c0=_0x4afb88['get']({'plain':!![]});return utilLicense[_0xd9e4('0x3c')](_0x3231c0,_0x31152d[_0xd9e4('0x3a')][_0xd9e4('0x3d')]);})[_0xd9e4('0x26')](function(_0x4b197f){if(!_0x4b197f[_0xd9e4('0x3e')]){return saveUpdates(_0x31152d['body'],null);}return _0x4b197f;})[_0xd9e4('0x26')](respondWithResult(_0x8ec5cd,null))['catch'](handleError(_0x8ec5cd,null));};exports[_0xd9e4('0x3f')]=function(_0x405ec6,_0x321427){var _0x291354='license-info.log';var _0x14ac5c=path[_0xd9e4('0x40')](_0xd9e4('0x41'),_0xd9e4('0x42'),_0xd9e4('0x43'),_0x291354);_0x321427[_0xd9e4('0x44')](_0xd9e4('0x45'),_0xd9e4('0x46')+_0x291354);_0x321427['set'](_0xd9e4('0x47'),_0xd9e4('0x48'));_0x321427[_0xd9e4('0x49')](_0x14ac5c);}; \ No newline at end of file +var _0xfa6c=['index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','getLicense','catch','body','find','params','key','demo','downloadLogFile','license-info.log','join','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','util','path','sox','to-csv','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','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfa6c,0xf4));var _0xcfa6=function(_0x27e82f,_0x191abd){_0x27e82f=_0x27e82f-0x0;var _0x4c09b6=_0xfa6c[_0x27e82f];return _0x4c09b6;};'use strict';var emlformat=require(_0xcfa6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfa6('0x1'));var jsonpatch=require(_0xcfa6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcfa6('0x3'));var path=require(_0xcfa6('0x4'));var sox=require(_0xcfa6('0x5'));var csv=require(_0xcfa6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfa6('0x7'));var _=require(_0xcfa6('0x8'));var squel=require(_0xcfa6('0x9'));var crypto=require(_0xcfa6('0xa'));var jsforce=require(_0xcfa6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcfa6('0x6'));var querystring=require(_0xcfa6('0xc'));var Papa=require('papaparse');var Redis=require(_0xcfa6('0xd'));var authService=require(_0xcfa6('0xe'));var qs=require(_0xcfa6('0xf'));var as=require(_0xcfa6('0x10'));var hardwareService=require(_0xcfa6('0x11'));var logger=require(_0xcfa6('0x12'))(_0xcfa6('0x13'));var utils=require(_0xcfa6('0x14'));var config=require(_0xcfa6('0x15'));var licenseUtil=require(_0xcfa6('0x16'));var db=require(_0xcfa6('0x17'))['db'];function respondWithStatusCode(_0x2f9c3c,_0x408cf1){_0x408cf1=_0x408cf1||0xcc;return function(_0x37ed1b){if(_0x37ed1b){return _0x2f9c3c['sendStatus'](_0x408cf1);}return _0x2f9c3c[_0xcfa6('0x18')](_0x408cf1)['end']();};}function respondWithResult(_0x1c1560,_0x399c3a){_0x399c3a=_0x399c3a||0xc8;return function(_0x4478cd){if(_0x4478cd){return _0x1c1560['status'](_0x399c3a)[_0xcfa6('0x19')](_0x4478cd);}};}function respondWithFilteredResult(_0x5f3258,_0x1b24e1){return function(_0x4c956f){if(_0x4c956f){var _0x486dbc=typeof _0x1b24e1['offset']==='undefined'&&typeof _0x1b24e1[_0xcfa6('0x1a')]===_0xcfa6('0x1b');var _0x388480=_0x4c956f[_0xcfa6('0x1c')];var _0x3d4b92=_0x486dbc?0x0:_0x1b24e1[_0xcfa6('0x1d')];var _0x67abf9=_0x486dbc?_0x4c956f[_0xcfa6('0x1c')]:_0x1b24e1[_0xcfa6('0x1d')]+_0x1b24e1[_0xcfa6('0x1a')];var _0x1dbf9b;if(_0x67abf9>=_0x388480){_0x67abf9=_0x388480;_0x1dbf9b=0xc8;}else{_0x1dbf9b=0xce;}_0x5f3258['status'](_0x1dbf9b);return _0x5f3258[_0xcfa6('0x1e')](_0xcfa6('0x1f'),_0x3d4b92+'-'+_0x67abf9+'/'+_0x388480)[_0xcfa6('0x19')](_0x4c956f);}return null;};}function patchUpdates(_0x45899e){return function(_0x21cbd6){try{jsonpatch[_0xcfa6('0x20')](_0x21cbd6,_0x45899e,!![]);}catch(_0x406405){return BPromise[_0xcfa6('0x21')](_0x406405);}return _0x21cbd6[_0xcfa6('0x22')]();};}function saveUpdates(_0x227b03,_0x1dd5e6){return function(_0x3116da){if(_0x3116da){return _0x3116da[_0xcfa6('0x23')](_0x227b03)[_0xcfa6('0x24')](function(_0x282980){return _0x282980;});}return null;};}function removeEntity(_0x4e5d6a,_0x35fbfd){return function(_0x1d99fc){if(_0x1d99fc){return _0x1d99fc[_0xcfa6('0x25')]()[_0xcfa6('0x24')](function(){_0x4e5d6a[_0xcfa6('0x18')](0xcc)[_0xcfa6('0x26')]();});}};}function handleEntityNotFound(_0x517bcf,_0x26df8b){return function(_0x51a615){if(!_0x51a615){_0x517bcf[_0xcfa6('0x27')](0x194);}return _0x51a615;};}function handleError(_0x420390,_0x48babc){_0x48babc=_0x48babc||0x1f4;return function(_0x50e293){logger[_0xcfa6('0x28')](_0x50e293[_0xcfa6('0x29')]);if(_0x50e293[_0xcfa6('0x2a')]){delete _0x50e293[_0xcfa6('0x2a')];}_0x420390[_0xcfa6('0x18')](_0x48babc)[_0xcfa6('0x2b')](_0x50e293);};}var utilLicense=require(_0xcfa6('0x16'));exports[_0xcfa6('0x2c')]=function(_0xbc5181,_0x39ff23){var _0x39c004={'raw':!![],'where':{'id':0x1}},_0x3a4e03={};_0x3a4e03['model']=_[_0xcfa6('0x2d')](db[_0xcfa6('0x2e')][_0xcfa6('0x2f')]);_0x3a4e03['query']=_[_0xcfa6('0x2d')](_0xbc5181[_0xcfa6('0x30')]);_0x3a4e03[_0xcfa6('0x31')]=_[_0xcfa6('0x32')](_0x3a4e03[_0xcfa6('0x33')],_0x3a4e03['query']);_0x39c004[_0xcfa6('0x34')]=_[_0xcfa6('0x32')](_0x3a4e03[_0xcfa6('0x33')],qs['fields'](_0xbc5181[_0xcfa6('0x30')][_0xcfa6('0x35')]));_0x39c004[_0xcfa6('0x34')]=_0x39c004[_0xcfa6('0x34')]['length']?_0x39c004[_0xcfa6('0x34')]:_0x3a4e03[_0xcfa6('0x33')];_0x39c004=_['merge']({},_0x39c004,_0xbc5181['options']);return utilLicense[_0xcfa6('0x36')](_0x39c004)[_0xcfa6('0x24')](respondWithResult(_0x39ff23,null))[_0xcfa6('0x37')](handleError(_0x39ff23,null));};exports[_0xcfa6('0x23')]=function(_0x5b798c,_0x50913c){if(_0x5b798c['body']['id']){delete _0x5b798c[_0xcfa6('0x38')]['id'];}return db[_0xcfa6('0x2e')][_0xcfa6('0x39')]({'where':{'id':_0x5b798c[_0xcfa6('0x3a')]['id']}})[_0xcfa6('0x24')](handleEntityNotFound(_0x50913c,null))[_0xcfa6('0x24')](function(_0xcf5b3b){var _0x32f0e7=_0xcf5b3b['get']({'plain':!![]});return utilLicense['checkLicense'](_0x32f0e7,_0x5b798c[_0xcfa6('0x38')][_0xcfa6('0x3b')]);})[_0xcfa6('0x24')](function(_0x5e0792){if(!_0x5e0792[_0xcfa6('0x3c')]){return saveUpdates(_0x5b798c[_0xcfa6('0x38')],null);}return _0x5e0792;})[_0xcfa6('0x24')](respondWithResult(_0x50913c,null))[_0xcfa6('0x37')](handleError(_0x50913c,null));};exports[_0xcfa6('0x3d')]=function(_0x5d60b4,_0x4a01f0){var _0x152731=_0xcfa6('0x3e');var _0x4b5acc=path[_0xcfa6('0x3f')]('/var',_0xcfa6('0x40'),_0xcfa6('0x41'),_0x152731);_0x4a01f0[_0xcfa6('0x42')](_0xcfa6('0x43'),_0xcfa6('0x44')+_0x152731);_0x4a01f0[_0xcfa6('0x1e')](_0xcfa6('0x45'),_0xcfa6('0x46'));_0x4a01f0[_0xcfa6('0x47')](_0x4b5acc);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index cc04949..7c78e9a 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 _0x5e14=['path','../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1929b3,_0x4ca74f){var _0x445020=function(_0x28ba31){while(--_0x28ba31){_0x1929b3['push'](_0x1929b3['shift']());}};_0x445020(++_0x4ca74f);}(_0x5e14,0xaf));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x45e1('0x0'));var util=require(_0x45e1('0x1'));var logger=require(_0x45e1('0x2'))(_0x45e1('0x3'));var moment=require(_0x45e1('0x4'));var BPromise=require(_0x45e1('0x5'));var rp=require(_0x45e1('0x6'));var fs=require('fs');var path=require(_0x45e1('0x7'));var rimraf=require('rimraf');var config=require(_0x45e1('0x8'));var attributes=require(_0x45e1('0x9'));module[_0x45e1('0xa')]=function(_0x4d2ec4,_0x366ee7){return _0x4d2ec4['define'](_0x45e1('0xb'),attributes,{'tableName':_0x45e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2af4=['exports','define','License','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes'];(function(_0x3182c0,_0x16c046){var _0x23edd1=function(_0x3d156b){while(--_0x3d156b){_0x3182c0['push'](_0x3182c0['shift']());}};_0x23edd1(++_0x16c046);}(_0x2af4,0x107));var _0x42af=function(_0x5415ef,_0x34a408){_0x5415ef=_0x5415ef-0x0;var _0x54d8a8=_0x2af4[_0x5415ef];return _0x54d8a8;};'use strict';var _=require(_0x42af('0x0'));var util=require('util');var logger=require(_0x42af('0x1'))(_0x42af('0x2'));var moment=require(_0x42af('0x3'));var BPromise=require(_0x42af('0x4'));var rp=require(_0x42af('0x5'));var fs=require('fs');var path=require(_0x42af('0x6'));var rimraf=require(_0x42af('0x7'));var config=require(_0x42af('0x8'));var attributes=require(_0x42af('0x9'));module[_0x42af('0xa')]=function(_0x5d98eb,_0x9626cd){return _0x5d98eb[_0x42af('0xb')](_0x42af('0xc'),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 99659ad..8a836a8 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 _0xb8b7=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x47e3f6,_0xb76105){var _0x41259d=function(_0x59e90a){while(--_0x59e90a){_0x47e3f6['push'](_0x47e3f6['shift']());}};_0x41259d(++_0xb76105);}(_0xb8b7,0x1cd));var _0x7b8b=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb8b7[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x7b8b('0x0'));var util=require(_0x7b8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b8b('0x2'));var fs=require('fs');var Redis=require(_0x7b8b('0x3'));var db=require(_0x7b8b('0x4'))['db'];var utils=require(_0x7b8b('0x5'));var logger=require(_0x7b8b('0x6'))('rpc');var config=require(_0x7b8b('0x7'));var jayson=require(_0x7b8b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x895db8,_0x59e1d3,_0x353326){return new BPromise(function(_0x4e1ac3,_0xec09f){return client[_0x7b8b('0x9')](_0x895db8,_0x353326)[_0x7b8b('0xa')](function(_0x1b73df){logger[_0x7b8b('0xb')](_0x7b8b('0xc'),_0x59e1d3,'request\x20sent');logger[_0x7b8b('0xd')](_0x7b8b('0xe'),_0x59e1d3,'request\x20sent',JSON[_0x7b8b('0xf')](_0x1b73df));if(_0x1b73df['error']){if(_0x1b73df[_0x7b8b('0x10')]['code']===0x1f4){logger[_0x7b8b('0x10')]('License,\x20%s,\x20%s',_0x59e1d3,_0x1b73df[_0x7b8b('0x10')][_0x7b8b('0x11')]);return _0xec09f(_0x1b73df[_0x7b8b('0x10')]['message']);}logger[_0x7b8b('0x10')]('License,\x20%s,\x20%s',_0x59e1d3,_0x1b73df[_0x7b8b('0x10')][_0x7b8b('0x11')]);return _0x4e1ac3(_0x1b73df[_0x7b8b('0x10')][_0x7b8b('0x11')]);}else{logger[_0x7b8b('0xb')](_0x7b8b('0xc'),_0x59e1d3,_0x7b8b('0x12'));_0x4e1ac3(_0x1b73df[_0x7b8b('0x13')][_0x7b8b('0x11')]);}})[_0x7b8b('0x14')](function(_0x393c72){logger[_0x7b8b('0x10')](_0x7b8b('0xc'),_0x59e1d3,_0x393c72);_0xec09f(_0x393c72);});});} \ No newline at end of file +var _0xc793=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x46122a,_0x3083b3){var _0x4a3d88=function(_0x59b455){while(--_0x59b455){_0x46122a['push'](_0x46122a['shift']());}};_0x4a3d88(++_0x3083b3);}(_0xc793,0x1c2));var _0x3c79=function(_0x6c94b3,_0x870785){_0x6c94b3=_0x6c94b3-0x0;var _0x5221db=_0xc793[_0x6c94b3];return _0x5221db;};'use strict';var _=require(_0x3c79('0x0'));var util=require(_0x3c79('0x1'));var moment=require(_0x3c79('0x2'));var BPromise=require(_0x3c79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c79('0x4'));var db=require(_0x3c79('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c79('0x6'))('rpc');var config=require(_0x3c79('0x7'));var jayson=require(_0x3c79('0x8'));var client=jayson[_0x3c79('0x9')][_0x3c79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21461d,_0x50ab47,_0x17189d){return new BPromise(function(_0x40efe0,_0x59d0d4){return client[_0x3c79('0xb')](_0x21461d,_0x17189d)[_0x3c79('0xc')](function(_0x19a1fb){logger[_0x3c79('0xd')](_0x3c79('0xe'),_0x50ab47,_0x3c79('0xf'));logger[_0x3c79('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x50ab47,_0x3c79('0xf'),JSON[_0x3c79('0x11')](_0x19a1fb));if(_0x19a1fb['error']){if(_0x19a1fb[_0x3c79('0x12')]['code']===0x1f4){logger[_0x3c79('0x12')](_0x3c79('0xe'),_0x50ab47,_0x19a1fb[_0x3c79('0x12')][_0x3c79('0x13')]);return _0x59d0d4(_0x19a1fb[_0x3c79('0x12')][_0x3c79('0x13')]);}logger['error'](_0x3c79('0xe'),_0x50ab47,_0x19a1fb[_0x3c79('0x12')][_0x3c79('0x13')]);return _0x40efe0(_0x19a1fb['error']['message']);}else{logger[_0x3c79('0xd')]('License,\x20%s,\x20%s',_0x50ab47,_0x3c79('0xf'));_0x40efe0(_0x19a1fb['result']['message']);}})[_0x3c79('0x14')](function(_0x5b4291){logger[_0x3c79('0x12')](_0x3c79('0xe'),_0x50ab47,_0x5b4291);_0x59d0d4(_0x5b4291);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index fec4aa8..559141b 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 _0x9f73=['/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions'];(function(_0x4fad60,_0x289704){var _0x2e84c=function(_0x3d025d){while(--_0x3d025d){_0x4fad60['push'](_0x4fad60['shift']());}};_0x2e84c(++_0x289704);}(_0x9f73,0x7e));var _0x39f7=function(_0x3c382d,_0x2c7964){_0x3c382d=_0x3c382d-0x0;var _0x3c852f=_0x9f73[_0x3c382d];return _0x3c852f;};'use strict';var multer=require(_0x39f7('0x0'));var util=require(_0x39f7('0x1'));var path=require(_0x39f7('0x2'));var timeout=require(_0x39f7('0x3'));var express=require(_0x39f7('0x4'));var router=express[_0x39f7('0x5')]();var fs_extra=require(_0x39f7('0x6'));var auth=require(_0x39f7('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39f7('0x8'));router[_0x39f7('0x9')]('/',auth[_0x39f7('0xa')](),controller['index']);router[_0x39f7('0x9')](_0x39f7('0xb'),auth[_0x39f7('0xa')](),controller[_0x39f7('0xc')]);router[_0x39f7('0x9')](_0x39f7('0xd'),auth['isAuthenticated'](),controller[_0x39f7('0xe')]);router['get'](_0x39f7('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x39f7('0x9')](_0x39f7('0x10'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x11')]);router[_0x39f7('0x9')](_0x39f7('0x12'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x13')]);router[_0x39f7('0x9')](_0x39f7('0x14'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x15')]);router[_0x39f7('0x9')](_0x39f7('0x16'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x17')]);router['get'](_0x39f7('0x18'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x19')]);router[_0x39f7('0x9')](_0x39f7('0x1a'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x1b')]);router[_0x39f7('0x9')](_0x39f7('0x1c'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x1d')]);router[_0x39f7('0x9')](_0x39f7('0x1e'),auth[_0x39f7('0xa')](),controller['getAgents']);router[_0x39f7('0x1f')](_0x39f7('0xf'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x20')]);router[_0x39f7('0x1f')](_0x39f7('0x10'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x21')]);router[_0x39f7('0x1f')]('/',auth[_0x39f7('0xa')](),controller[_0x39f7('0x22')]);router[_0x39f7('0x1f')](_0x39f7('0x12'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x23')]);router[_0x39f7('0x1f')](_0x39f7('0x14'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x24')]);router['post'](_0x39f7('0x16'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x25')]);router[_0x39f7('0x1f')](_0x39f7('0x18'),auth['isAuthenticated'](),controller[_0x39f7('0x26')]);router[_0x39f7('0x1f')](_0x39f7('0x27'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x28')]);router[_0x39f7('0x1f')](_0x39f7('0x1e'),auth['isAuthenticated'](),controller[_0x39f7('0x29')]);router[_0x39f7('0x2a')](_0x39f7('0xd'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x2b')]);router[_0x39f7('0x2c')](_0x39f7('0xf'),auth[_0x39f7('0xa')](),controller[_0x39f7('0x2d')]);router[_0x39f7('0x2c')]('/:id/canned_answers',auth[_0x39f7('0xa')](),controller[_0x39f7('0x2e')]);router['delete'](_0x39f7('0x12'),auth['isAuthenticated'](),controller[_0x39f7('0x2f')]);router['delete'](_0x39f7('0x14'),auth['isAuthenticated'](),controller[_0x39f7('0x30')]);router[_0x39f7('0x2c')](_0x39f7('0xd'),auth[_0x39f7('0xa')](),controller['destroy']);router['delete']('/:id/users',auth[_0x39f7('0xa')](),controller['removeAgents']);module[_0x39f7('0x31')]=router; \ No newline at end of file +var _0xd8fd=['getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addApplications','/:id/send','send','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications'];(function(_0x5c9959,_0x3d7731){var _0x847f98=function(_0x60d897){while(--_0x60d897){_0x5c9959['push'](_0x5c9959['shift']());}};_0x847f98(++_0x3d7731);}(_0xd8fd,0x70));var _0xdd8f=function(_0x4d3835,_0x4f5f50){_0x4d3835=_0x4d3835-0x0;var _0x823439=_0xd8fd[_0x4d3835];return _0x823439;};'use strict';var multer=require(_0xdd8f('0x0'));var util=require(_0xdd8f('0x1'));var path=require(_0xdd8f('0x2'));var timeout=require(_0xdd8f('0x3'));var express=require('express');var router=express[_0xdd8f('0x4')]();var fs_extra=require(_0xdd8f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xdd8f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdd8f('0x6')](_0xdd8f('0x7'),auth['isAuthenticated'](),controller[_0xdd8f('0x8')]);router[_0xdd8f('0x6')](_0xdd8f('0x9'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0xb')]);router[_0xdd8f('0x6')](_0xdd8f('0xc'),auth[_0xdd8f('0xa')](),controller['getDispositions']);router['get'](_0xdd8f('0xd'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0xe')]);router[_0xdd8f('0x6')]('/:id/in_servers',auth[_0xdd8f('0xa')](),controller['getImap']);router[_0xdd8f('0x6')](_0xdd8f('0xf'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x10')]);router['get'](_0xdd8f('0x11'),auth['isAuthenticated'](),controller[_0xdd8f('0x12')]);router[_0xdd8f('0x6')](_0xdd8f('0x13'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x14')]);router[_0xdd8f('0x6')](_0xdd8f('0x15'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x16')]);router[_0xdd8f('0x6')](_0xdd8f('0x17'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x18')]);router[_0xdd8f('0x6')]('/:id/users',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x19')]);router[_0xdd8f('0x1a')](_0xdd8f('0xc'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x1b')]);router[_0xdd8f('0x1a')]('/:id/canned_answers',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x1c')]);router[_0xdd8f('0x1a')]('/',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x1d')]);router['post'](_0xdd8f('0x1e'),auth[_0xdd8f('0xa')](),controller['addImap']);router['post'](_0xdd8f('0xf'),auth[_0xdd8f('0xa')](),controller['addSmtp']);router[_0xdd8f('0x1a')](_0xdd8f('0x11'),auth[_0xdd8f('0xa')](),controller['addInteraction']);router[_0xdd8f('0x1a')](_0xdd8f('0x13'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x1f')]);router[_0xdd8f('0x1a')](_0xdd8f('0x20'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x21')]);router[_0xdd8f('0x1a')](_0xdd8f('0x22'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x23')]);router[_0xdd8f('0x24')](_0xdd8f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xdd8f('0x25')](_0xdd8f('0xc'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x26')]);router['delete'](_0xdd8f('0xd'),auth['isAuthenticated'](),controller[_0xdd8f('0x27')]);router[_0xdd8f('0x25')](_0xdd8f('0x1e'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x28')]);router[_0xdd8f('0x25')](_0xdd8f('0xf'),auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x29')]);router[_0xdd8f('0x25')]('/:id',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x2a')]);router[_0xdd8f('0x25')]('/:id/users',auth[_0xdd8f('0xa')](),controller[_0xdd8f('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 6025321..a127a69 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 _0x2a60=['custom','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','getDataValue','provider'];(function(_0x4349ec,_0x123fca){var _0x4b343b=function(_0x4c0727){while(--_0x4c0727){_0x4349ec['push'](_0x4349ec['shift']());}};_0x4b343b(++_0x123fca);}(_0x2a60,0xb5));var _0x02a6=function(_0x258238,_0x219494){_0x258238=_0x258238-0x0;var _0x126c77=_0x2a60[_0x258238];return _0x126c77;};'use strict';var Sequelize=require(_0x02a6('0x0'));module[_0x02a6('0x1')]={'description':{'type':Sequelize[_0x02a6('0x2')]},'name':{'type':Sequelize[_0x02a6('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x02a6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x02a6('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x02a6('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x02a6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x02a6('0x4')},'fontSize':{'type':Sequelize[_0x02a6('0x5')](0x2)[_0x02a6('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x02a6('0x7')],'defaultValue':function(){return _0x02a6('0x8');}},'notificationSound':{'type':Sequelize[_0x02a6('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x02a6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x02a6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x02a6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x02a6('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x02a6('0x9'),'set':function(_0x4ff0b0){if(!_0x4ff0b0)this['setDataValue'](_0x02a6('0xa'),null);this[_0x02a6('0xb')](_0x02a6('0xc'),_0x4ff0b0);}},'provider':{'type':Sequelize['ENUM'](_0x02a6('0xd'),_0x02a6('0xe'),_0x02a6('0xf'),_0x02a6('0x10')),'defaultValue':null,'get':function(){if(!this[_0x02a6('0x11')](_0x02a6('0x12')))return _0x02a6('0x13');return this['getDataValue'](_0x02a6('0x12'));},'set':function(_0x564354){if(_0x564354===_0x02a6('0x13'))_0x564354=null;return this[_0x02a6('0xb')](_0x02a6('0x12'),_0x564354);}}}; \ No newline at end of file +var _0xdbe6=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xdbe6,0x1e7));var _0x6dbe=function(_0x3f414b,_0x3f8dc8){_0x3f414b=_0x3f414b-0x0;var _0x41d01c=_0xdbe6[_0x3f414b];return _0x41d01c;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x6dbe('0x0')]},'name':{'type':Sequelize[_0x6dbe('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x6dbe('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x6dbe('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x6dbe('0x2')]},'markAsUnread':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6dbe('0x0')],'allowNull':![],'defaultValue':_0x6dbe('0x3')},'fontSize':{'type':Sequelize[_0x6dbe('0x4')](0x2)[_0x6dbe('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6dbe('0x2')],'defaultValue':function(){return _0x6dbe('0x6');}},'notificationSound':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dbe('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dbe('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6dbe('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6dbe('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x6dbe('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e0430){if(!_0x2e0430)this[_0x6dbe('0x8')](_0x6dbe('0x9'),null);this[_0x6dbe('0x8')]('mandatoryDisposition',_0x2e0430);}},'provider':{'type':Sequelize[_0x6dbe('0xa')](_0x6dbe('0xb'),_0x6dbe('0xc'),'yahoo',_0x6dbe('0xd')),'defaultValue':null,'get':function(){if(!this[_0x6dbe('0xe')](_0x6dbe('0xf')))return _0x6dbe('0x10');return this[_0x6dbe('0xe')]('provider');},'set':function(_0x546e0b){if(_0x546e0b==='custom')_0x546e0b=null;return this[_0x6dbe('0x8')]('provider',_0x546e0b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 38f45ec..c6ccfea 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 _0x6105=['Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','CmContact','List\x20not\x20found','attach','out','messageId','Messages','verifySmtp','CloudProvider','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','include','findAll','rows','catch','params','Smtp','fields','includeAll','find','body','modernAuthentication','CloudProviderId','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','order','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','provider','custom','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List'];(function(_0x1fed06,_0x1cf619){var _0x20707b=function(_0x52b56a){while(--_0x52b56a){_0x1fed06['push'](_0x1fed06['shift']());}};_0x20707b(++_0x1cf619);}(_0x6105,0xd7));var _0x5610=function(_0x3bea3,_0x4d6961){_0x3bea3=_0x3bea3-0x0;var _0x45046e=_0x6105[_0x3bea3];return _0x45046e;};'use strict';var moment=require('moment');var BPromise=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var path=require('path');var _=require(_0x5610('0x2'));var juice=require(_0x5610('0x3'));var Redis=require(_0x5610('0x4'));var qs=require(_0x5610('0x5'));var logger=require(_0x5610('0x6'))('api');var config=require(_0x5610('0x7'));var db=require(_0x5610('0x8'))['db'];config[_0x5610('0x9')]=_[_0x5610('0xa')](config['redis'],{'host':_0x5610('0xb'),'port':0x18eb});var socket=require(_0x5610('0xc'))(new Redis(config[_0x5610('0x9')]));require(_0x5610('0xd'))['register'](socket);var jayson=require(_0x5610('0xe'));var client=jayson[_0x5610('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4ed7f3,_0xdac82e,_0x9cd410,_0x2f86d2){return new BPromise(function(_0x40ddec,_0x163f13){var _0xd9e605=_0x2f86d2||client;return _0xd9e605[_0x5610('0x10')](_0x4ed7f3,_0x9cd410)[_0x5610('0x11')](function(_0x45c1f3){logger[_0x5610('0x12')]('MailAccount,\x20%s,\x20%s',_0xdac82e,_0x5610('0x13'));logger[_0x5610('0x14')](_0x5610('0x15'),_0xdac82e,'request\x20sent',JSON[_0x5610('0x16')](_0x45c1f3));if(_0x45c1f3[_0x5610('0x17')]){if(_0x45c1f3[_0x5610('0x17')][_0x5610('0x18')]===0x1f4){logger[_0x5610('0x17')](_0x5610('0x19'),_0xdac82e,_0x45c1f3['error'][_0x5610('0x1a')]);return _0x163f13(_0x45c1f3[_0x5610('0x17')][_0x5610('0x1a')]);}logger[_0x5610('0x17')](_0x5610('0x19'),_0xdac82e,_0x45c1f3[_0x5610('0x17')]['message']);return _0x40ddec(_0x45c1f3[_0x5610('0x17')][_0x5610('0x1a')]);}else{logger[_0x5610('0x12')](_0x5610('0x19'),_0xdac82e,_0x5610('0x13'));_0x40ddec(_0x45c1f3[_0x5610('0x1b')][_0x5610('0x1a')]);}})['catch'](function(_0x42183f){logger[_0x5610('0x17')](_0x5610('0x19'),_0xdac82e,_0x42183f);_0x163f13(_0x42183f);});});}function respondWithStatusCode(_0x13f2ff,_0x217232){_0x217232=_0x217232||0xcc;return function(_0x125253){if(_0x125253){return _0x13f2ff[_0x5610('0x1c')](_0x217232);}return _0x13f2ff['status'](_0x217232)[_0x5610('0x1d')]();};}function respondWithResult(_0x331200,_0x4c7824){_0x4c7824=_0x4c7824||0xc8;return function(_0x589e32){if(_0x589e32){return _0x331200[_0x5610('0x1e')](_0x4c7824)[_0x5610('0x1f')](_0x589e32);}};}function respondWithFilteredResult(_0x1002c8,_0x327a4b){return function(_0x28c50b){if(_0x28c50b){var _0x16436d=typeof _0x327a4b[_0x5610('0x20')]==='undefined'&&typeof _0x327a4b[_0x5610('0x21')]===_0x5610('0x22');var _0xee9f8d=_0x28c50b[_0x5610('0x23')];var _0x570364=_0x16436d?0x0:_0x327a4b['offset'];var _0x2ad27f=_0x16436d?_0x28c50b['count']:_0x327a4b[_0x5610('0x20')]+_0x327a4b[_0x5610('0x21')];var _0x51e4e2;if(_0x2ad27f>=_0xee9f8d){_0x2ad27f=_0xee9f8d;_0x51e4e2=0xc8;}else{_0x51e4e2=0xce;}_0x1002c8[_0x5610('0x1e')](_0x51e4e2);return _0x1002c8['set'](_0x5610('0x24'),_0x570364+'-'+_0x2ad27f+'/'+_0xee9f8d)[_0x5610('0x1f')](_0x28c50b);}return null;};}function saveUpdates(_0x3a4332){return function(_0x3e4aba){if(_0x3e4aba){return _0x3e4aba[_0x5610('0x25')](_0x3a4332)[_0x5610('0x11')](function(_0x26fe98){return _0x26fe98;});}return null;};}function removeEntity(_0x261679){return function(_0x593fdc){if(_0x593fdc){return _0x593fdc[_0x5610('0x26')]()[_0x5610('0x11')](function(){var _0x28c053=_0x593fdc[_0x5610('0x27')]({'plain':!![]});var _0x453d83=_0x5610('0x28');return db[_0x5610('0x29')][_0x5610('0x26')]({'where':{'type':_0x453d83,'resourceId':_0x28c053['id']}})['then'](function(){return _0x593fdc;});})[_0x5610('0x11')](function(){_0x261679[_0x5610('0x1e')](0xcc)[_0x5610('0x1d')]();});}};}function handleEntityNotFound(_0x343a5d){return function(_0x3c67ad){if(!_0x3c67ad){_0x343a5d[_0x5610('0x1c')](0x194);}return _0x3c67ad;};}function handleError(_0x48214c,_0x3f4087){_0x3f4087=_0x3f4087||0x1f4;return function(_0x88a09d){logger['error'](_0x88a09d[_0x5610('0x2a')]);if(_0x88a09d[_0x5610('0x2b')]){delete _0x88a09d['name'];}_0x48214c[_0x5610('0x1e')](_0x3f4087)[_0x5610('0x2c')](_0x88a09d);};}exports['index']=function(_0x58bd38,_0x15e720){var _0x48791a={'include':[{'model':db[_0x5610('0x2d')],'as':_0x5610('0x2e')},{'model':db[_0x5610('0x2f')],'as':'Smtp'},{'model':db[_0x5610('0x30')],'as':_0x5610('0x31')}]},_0x3b4a7b={},_0x3fd7f1={'count':0x0,'rows':[]};var _0x19e924=_[_0x5610('0x32')](db[_0x5610('0x33')]['rawAttributes'],function(_0x3b1f32){return{'name':_0x3b1f32[_0x5610('0x34')],'type':_0x3b1f32['type'][_0x5610('0x35')]};});_0x3b4a7b[_0x5610('0x36')]=_[_0x5610('0x32')](_0x19e924,_0x5610('0x2b'));_0x3b4a7b[_0x5610('0x37')]=_[_0x5610('0x38')](_0x58bd38[_0x5610('0x37')]);_0x3b4a7b[_0x5610('0x39')]=_['intersection'](_0x3b4a7b[_0x5610('0x36')],_0x3b4a7b['query']);_0x48791a[_0x5610('0x3a')]=_[_0x5610('0x3b')](_0x3b4a7b[_0x5610('0x36')],qs['fields'](_0x58bd38[_0x5610('0x37')]['fields']));_0x48791a[_0x5610('0x3a')]=_0x48791a[_0x5610('0x3a')][_0x5610('0x3c')]?_0x48791a[_0x5610('0x3a')]:_0x3b4a7b[_0x5610('0x36')];if(!_0x58bd38[_0x5610('0x37')][_0x5610('0x3d')](_0x5610('0x3e'))){_0x48791a['limit']=qs[_0x5610('0x21')](_0x58bd38[_0x5610('0x37')]['limit']);_0x48791a[_0x5610('0x20')]=qs[_0x5610('0x20')](_0x58bd38[_0x5610('0x37')][_0x5610('0x20')]);}_0x48791a['order']=qs[_0x5610('0x3f')](_0x58bd38['query'][_0x5610('0x3f')]);_0x48791a[_0x5610('0x40')]=qs['filters'](_[_0x5610('0x41')](_0x58bd38[_0x5610('0x37')],_0x3b4a7b[_0x5610('0x39')]),_0x19e924);if(_0x58bd38[_0x5610('0x37')]['filter']){_0x48791a[_0x5610('0x40')]=_['merge'](_0x48791a[_0x5610('0x40')],{'$or':_[_0x5610('0x32')](_0x19e924,function(_0x1a0ca5){if(_0x1a0ca5['type']!=='VIRTUAL'){var _0x244800={};_0x244800[_0x1a0ca5[_0x5610('0x2b')]]={'$like':'%'+_0x58bd38[_0x5610('0x37')]['filter']+'%'};return _0x244800;}})});}_0x48791a=_[_0x5610('0x42')]({},_0x48791a,_0x58bd38[_0x5610('0x43')]);var _0x4c1755={'where':_0x48791a[_0x5610('0x40')]};return db['MailAccount'][_0x5610('0x23')](_0x4c1755)[_0x5610('0x11')](function(_0x38eb95){_0x3fd7f1[_0x5610('0x23')]=_0x38eb95;if(_0x58bd38['query']['includeAll']){_0x48791a[_0x5610('0x44')]=[{'all':!![]}];}return db[_0x5610('0x33')][_0x5610('0x45')](_0x48791a);})['then'](function(_0x5502b2){_0x3fd7f1[_0x5610('0x46')]=_0x5502b2;return _0x3fd7f1;})[_0x5610('0x11')](respondWithFilteredResult(_0x15e720,_0x48791a))[_0x5610('0x47')](handleError(_0x15e720,null));};exports['show']=function(_0x13d4c0,_0xd9d2b8){var _0x21dee2={'raw':![],'where':{'id':_0x13d4c0[_0x5610('0x48')]['id']},'include':[{'model':db[_0x5610('0x2d')],'as':_0x5610('0x2e')},{'model':db[_0x5610('0x2f')],'as':_0x5610('0x49')},{'model':db['Pause'],'as':_0x5610('0x31')}]},_0x330760={};_0x330760[_0x5610('0x36')]=_[_0x5610('0x38')](db['MailAccount']['rawAttributes']);_0x330760[_0x5610('0x37')]=_[_0x5610('0x38')](_0x13d4c0[_0x5610('0x37')]);_0x330760[_0x5610('0x39')]=_[_0x5610('0x3b')](_0x330760[_0x5610('0x36')],_0x330760[_0x5610('0x37')]);_0x21dee2['attributes']=_[_0x5610('0x3b')](_0x330760[_0x5610('0x36')],qs[_0x5610('0x4a')](_0x13d4c0[_0x5610('0x37')]['fields']));_0x21dee2[_0x5610('0x3a')]=_0x21dee2['attributes']['length']?_0x21dee2[_0x5610('0x3a')]:_0x330760[_0x5610('0x36')];if(_0x13d4c0[_0x5610('0x37')][_0x5610('0x4b')]){_0x21dee2['include']=[{'all':!![]}];}_0x21dee2=_[_0x5610('0x42')]({},_0x21dee2,_0x13d4c0[_0x5610('0x43')]);return db['MailAccount'][_0x5610('0x4c')](_0x21dee2)[_0x5610('0x11')](handleEntityNotFound(_0xd9d2b8,null))['then'](respondWithResult(_0xd9d2b8,null))[_0x5610('0x47')](handleError(_0xd9d2b8,null));};exports[_0x5610('0x25')]=function(_0x4c59aa,_0x3eea22){if(_0x4c59aa[_0x5610('0x4d')]['id']){delete _0x4c59aa[_0x5610('0x4d')]['id'];}if(_0x4c59aa[_0x5610('0x4d')][_0x5610('0x2e')]){if(!_0x4c59aa[_0x5610('0x4d')][_0x5610('0x2e')][_0x5610('0x4e')]){_0x4c59aa[_0x5610('0x4d')][_0x5610('0x2e')][_0x5610('0x4f')]=null;}}if(_0x4c59aa[_0x5610('0x4d')][_0x5610('0x49')]){if(!_0x4c59aa[_0x5610('0x4d')][_0x5610('0x49')][_0x5610('0x4e')]){_0x4c59aa['body'][_0x5610('0x49')][_0x5610('0x4f')]=null;}}return db['MailAccount'][_0x5610('0x4c')]({'where':{'id':_0x4c59aa[_0x5610('0x48')]['id']},'include':[{'model':db[_0x5610('0x2d')],'as':'Imap'},{'model':db[_0x5610('0x2f')],'as':_0x5610('0x49')},{'model':db[_0x5610('0x30')],'as':_0x5610('0x31')}]})[_0x5610('0x11')](handleEntityNotFound(_0x3eea22,null))[_0x5610('0x11')](saveUpdates(_0x4c59aa[_0x5610('0x4d')],null))[_0x5610('0x11')](function(_0x5b292c){if(_0x5b292c&&_0x4c59aa[_0x5610('0x4d')][_0x5610('0x2e')]){return db[_0x5610('0x2d')][_0x5610('0x25')](_0x4c59aa[_0x5610('0x4d')][_0x5610('0x2e')],{'where':{'MailAccountId':_0x5b292c['id']}})['then'](function(){return _0x5b292c;});}return _0x5b292c;})[_0x5610('0x11')](function(_0x581a8a){if(_0x581a8a&&_0x4c59aa[_0x5610('0x4d')]['Smtp']){return db[_0x5610('0x2f')][_0x5610('0x25')](_0x4c59aa[_0x5610('0x4d')][_0x5610('0x49')],{'where':{'MailAccountId':_0x581a8a['id']}})['then'](function(){return _0x581a8a;});}return _0x581a8a;})['then'](respondWithResult(_0x3eea22,null))[_0x5610('0x47')](handleError(_0x3eea22,null));};exports['describe']=function(_0x15251c,_0x56d672){return db[_0x5610('0x33')]['describe']()[_0x5610('0x11')](respondWithResult(_0x56d672,null))[_0x5610('0x47')](handleError(_0x56d672,null));};exports[_0x5610('0x50')]=function(_0xc33124,_0x19260f){if(_0xc33124['body']['id']){delete _0xc33124[_0x5610('0x4d')]['id'];}return db[_0x5610('0x33')]['find']({'where':{'id':_0xc33124[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x19260f,null))[_0x5610('0x11')](function(_0x4ab4e2){if(_0x4ab4e2){_0xc33124[_0x5610('0x4d')][_0x5610('0x51')]=_0x4ab4e2['id'];return db[_0x5610('0x52')][_0x5610('0x53')](_0xc33124[_0x5610('0x4d')]);}})[_0x5610('0x11')](respondWithResult(_0x19260f,null))[_0x5610('0x47')](handleError(_0x19260f,null));};exports[_0x5610('0x54')]=function(_0x3d5ba1,_0x40f370){var _0x131d51={'raw':![],'where':{}};var _0x50ec55={};var _0x25f8d5={'count':0x0,'rows':[]};return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x3d5ba1['params']['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x40f370,null))[_0x5610('0x11')](function(_0x1fc6b8){if(_0x1fc6b8){_0x50ec55[_0x5610('0x36')]=_['keys'](db[_0x5610('0x52')][_0x5610('0x56')]);_0x50ec55[_0x5610('0x37')]=_['keys'](_0x3d5ba1[_0x5610('0x37')]);_0x50ec55['filters']=_[_0x5610('0x3b')](_0x50ec55['model'],_0x50ec55['query']);_0x131d51[_0x5610('0x3a')]=_['intersection'](_0x50ec55[_0x5610('0x36')],qs[_0x5610('0x4a')](_0x3d5ba1[_0x5610('0x37')]['fields']));_0x131d51[_0x5610('0x3a')]=_0x131d51[_0x5610('0x3a')][_0x5610('0x3c')]?_0x131d51[_0x5610('0x3a')]:_0x50ec55[_0x5610('0x36')];if(!_0x3d5ba1[_0x5610('0x37')][_0x5610('0x3d')](_0x5610('0x3e'))){_0x131d51[_0x5610('0x21')]=qs[_0x5610('0x21')](_0x3d5ba1['query'][_0x5610('0x21')]);_0x131d51[_0x5610('0x20')]=qs[_0x5610('0x20')](_0x3d5ba1[_0x5610('0x37')][_0x5610('0x20')]);}_0x131d51[_0x5610('0x57')]=qs[_0x5610('0x3f')](_0x3d5ba1[_0x5610('0x37')]['sort']);_0x131d51['where']=qs[_0x5610('0x39')](_[_0x5610('0x41')](_0x3d5ba1[_0x5610('0x37')],_0x50ec55[_0x5610('0x39')]));_0x131d51[_0x5610('0x40')][_0x5610('0x51')]=_0x1fc6b8['id'];if(_0x3d5ba1[_0x5610('0x37')][_0x5610('0x58')]){_0x131d51[_0x5610('0x40')]=_['merge'](_0x131d51[_0x5610('0x40')],{'$or':_[_0x5610('0x32')](_0x131d51['attributes'],function(_0x9a0ae){var _0x5ee2f3={};_0x5ee2f3[_0x9a0ae]={'$like':'%'+_0x3d5ba1[_0x5610('0x37')]['filter']+'%'};return _0x5ee2f3;})});}_0x131d51=_['merge']({},_0x131d51,_0x3d5ba1[_0x5610('0x43')]);return db[_0x5610('0x52')][_0x5610('0x23')]({'where':_0x131d51['where']})['then'](function(_0x22bec0){_0x25f8d5[_0x5610('0x23')]=_0x22bec0;if(_0x3d5ba1[_0x5610('0x37')][_0x5610('0x4b')]){_0x131d51[_0x5610('0x44')]=[{'all':!![]}];}return db[_0x5610('0x52')]['findAll'](_0x131d51);})[_0x5610('0x11')](function(_0x393569){_0x25f8d5[_0x5610('0x46')]=_0x393569;return _0x25f8d5;});}})[_0x5610('0x11')](respondWithFilteredResult(_0x40f370,_0x131d51))[_0x5610('0x47')](handleError(_0x40f370,null));};exports[_0x5610('0x59')]=function(_0x318732,_0x52c8e6){return db['MailAccount'][_0x5610('0x4c')]({'where':{'id':_0x318732[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x52c8e6,null))[_0x5610('0x11')](function(_0x1b8f57){if(_0x1b8f57){return _0x1b8f57['removeDispositions'](_0x318732['query'][_0x5610('0x5a')]);}})['then'](respondWithStatusCode(_0x52c8e6,null))['catch'](handleError(_0x52c8e6,null));};exports[_0x5610('0x5b')]=function(_0x3c5a73,_0x5a2dbf){if(_0x3c5a73['body']['id']){delete _0x3c5a73[_0x5610('0x4d')]['id'];}return db[_0x5610('0x33')][_0x5610('0x4c')]({'where':{'id':_0x3c5a73['params']['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x5a2dbf,null))['then'](function(_0x1d9e19){if(_0x1d9e19){_0x3c5a73[_0x5610('0x4d')][_0x5610('0x51')]=_0x1d9e19['id'];return db['CannedAnswer'][_0x5610('0x53')](_0x3c5a73['body']);}})[_0x5610('0x11')](respondWithResult(_0x5a2dbf,null))['catch'](handleError(_0x5a2dbf,null));};exports[_0x5610('0x5c')]=function(_0x405faa,_0xb1c34){var _0xf7ca25={'raw':![],'where':{}};var _0x2a2a01={};var _0x1cf9d1={'count':0x0,'rows':[]};return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x405faa[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0xb1c34,null))['then'](function(_0x3374bc){if(_0x3374bc){_0x2a2a01[_0x5610('0x36')]=_[_0x5610('0x38')](db[_0x5610('0x5d')][_0x5610('0x56')]);_0x2a2a01[_0x5610('0x37')]=_[_0x5610('0x38')](_0x405faa['query']);_0x2a2a01[_0x5610('0x39')]=_[_0x5610('0x3b')](_0x2a2a01['model'],_0x2a2a01[_0x5610('0x37')]);_0xf7ca25[_0x5610('0x3a')]=_[_0x5610('0x3b')](_0x2a2a01[_0x5610('0x36')],qs['fields'](_0x405faa[_0x5610('0x37')][_0x5610('0x4a')]));_0xf7ca25[_0x5610('0x3a')]=_0xf7ca25['attributes'][_0x5610('0x3c')]?_0xf7ca25['attributes']:_0x2a2a01[_0x5610('0x36')];if(!_0x405faa['query'][_0x5610('0x3d')](_0x5610('0x3e'))){_0xf7ca25[_0x5610('0x21')]=qs[_0x5610('0x21')](_0x405faa[_0x5610('0x37')][_0x5610('0x21')]);_0xf7ca25[_0x5610('0x20')]=qs[_0x5610('0x20')](_0x405faa[_0x5610('0x37')][_0x5610('0x20')]);}_0xf7ca25[_0x5610('0x57')]=qs['sort'](_0x405faa[_0x5610('0x37')][_0x5610('0x3f')]);_0xf7ca25[_0x5610('0x40')]=qs[_0x5610('0x39')](_['pick'](_0x405faa['query'],_0x2a2a01[_0x5610('0x39')]));_0xf7ca25[_0x5610('0x40')][_0x5610('0x51')]=_0x3374bc['id'];if(_0x405faa[_0x5610('0x37')]['filter']){_0xf7ca25[_0x5610('0x40')]=_[_0x5610('0x42')](_0xf7ca25[_0x5610('0x40')],{'$or':_[_0x5610('0x32')](_0xf7ca25['attributes'],function(_0x54ebfe){var _0x1bcfa5={};_0x1bcfa5[_0x54ebfe]={'$like':'%'+_0x405faa[_0x5610('0x37')]['filter']+'%'};return _0x1bcfa5;})});}_0xf7ca25=_[_0x5610('0x42')]({},_0xf7ca25,_0x405faa[_0x5610('0x43')]);return db[_0x5610('0x5d')][_0x5610('0x23')]({'where':_0xf7ca25[_0x5610('0x40')]})[_0x5610('0x11')](function(_0x56e5bc){_0x1cf9d1[_0x5610('0x23')]=_0x56e5bc;if(_0x405faa['query'][_0x5610('0x4b')]){_0xf7ca25['include']=[{'all':!![]}];}return db[_0x5610('0x5d')][_0x5610('0x45')](_0xf7ca25);})['then'](function(_0x5f5ce3){_0x1cf9d1[_0x5610('0x46')]=_0x5f5ce3;return _0x1cf9d1;});}})['then'](respondWithFilteredResult(_0xb1c34,_0xf7ca25))['catch'](handleError(_0xb1c34,null));};exports['removeAnswers']=function(_0x48c673,_0x3d1e59){return db[_0x5610('0x33')][_0x5610('0x4c')]({'where':{'id':_0x48c673[_0x5610('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d1e59,null))['then'](function(_0x4f39d9){if(_0x4f39d9){return _0x4f39d9[_0x5610('0x5e')](_0x48c673['query']['ids']);}})[_0x5610('0x11')](respondWithStatusCode(_0x3d1e59,null))[_0x5610('0x47')](handleError(_0x3d1e59,null));};exports[_0x5610('0x53')]=function(_0x210666,_0x33201b){var _0x43fe0e={'name':_0x210666['body'][_0x5610('0x2b')],'key':_0x210666[_0x5610('0x4d')][_0x5610('0x35')],'provider':_0x210666['body'][_0x5610('0x5f')]===_0x5610('0x60')?null:_0x210666[_0x5610('0x4d')]['provider'],'email':_0x210666['body'][_0x5610('0x61')],'ListId':_0x210666[_0x5610('0x4d')]['ListId'],'active':!_[_0x5610('0x62')](_0x210666['body'][_0x5610('0x63')])?_0x210666[_0x5610('0x4d')]['active']:!![],'description':_0x210666['body'][_0x5610('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x43fe0e[_0x5610('0x5f')]){_0x43fe0e[_0x5610('0x2e')]['user']=_0x43fe0e[_0x5610('0x49')][_0x5610('0x65')]=_0x210666[_0x5610('0x4d')][_0x5610('0x66')];_0x43fe0e[_0x5610('0x2e')][_0x5610('0x67')]=_0x43fe0e['Smtp'][_0x5610('0x68')]=_0x210666[_0x5610('0x4d')][_0x5610('0x67')];if(_0x210666[_0x5610('0x4d')][_0x5610('0x4e')]){_0x43fe0e[_0x5610('0x2e')][_0x5610('0x4e')]=_0x43fe0e[_0x5610('0x49')][_0x5610('0x4e')]=!![];_0x43fe0e[_0x5610('0x2e')][_0x5610('0x4f')]=_0x43fe0e['Smtp'][_0x5610('0x4f')]=_0x210666[_0x5610('0x4d')][_0x5610('0x4f')];_0x43fe0e[_0x5610('0x2e')]['password']=_0x43fe0e[_0x5610('0x49')]['pass']=null;}else{_0x43fe0e['Imap']['CloudProviderId']=_0x43fe0e[_0x5610('0x49')][_0x5610('0x4f')]=null;}_0x43fe0e[_0x5610('0x2e')]['service']=_0x43fe0e[_0x5610('0x49')][_0x5610('0x69')]=null;_0x43fe0e[_0x5610('0x2e')][_0x5610('0x6a')]=_0x43fe0e[_0x5610('0x49')]['host']=null;_0x43fe0e[_0x5610('0x2e')][_0x5610('0x6b')]=_0x43fe0e[_0x5610('0x49')][_0x5610('0x6b')]=null;}else{if(_0x210666[_0x5610('0x4d')][_0x5610('0x6c')]){_0x43fe0e[_0x5610('0x2e')][_0x5610('0x65')]=_0x43fe0e[_0x5610('0x49')][_0x5610('0x65')]=_0x210666['body']['username'];_0x43fe0e['Imap'][_0x5610('0x67')]=_0x43fe0e[_0x5610('0x49')][_0x5610('0x68')]=_0x210666[_0x5610('0x4d')][_0x5610('0x67')];}else{_0x43fe0e[_0x5610('0x2e')][_0x5610('0x6c')]=_0x43fe0e[_0x5610('0x49')][_0x5610('0x6c')]=![];_0x43fe0e[_0x5610('0x2e')][_0x5610('0x65')]=_0x43fe0e['Smtp'][_0x5610('0x65')]=null;_0x43fe0e[_0x5610('0x2e')]['password']=_0x43fe0e[_0x5610('0x49')]['pass']=null;}_0x43fe0e[_0x5610('0x2e')][_0x5610('0x6a')]=_0x210666[_0x5610('0x4d')]['Imap']['host'];_0x43fe0e[_0x5610('0x2e')][_0x5610('0x6b')]=_0x210666[_0x5610('0x4d')][_0x5610('0x2e')][_0x5610('0x6b')];_0x43fe0e['Smtp']['host']=_0x210666['body'][_0x5610('0x49')]['host'];_0x43fe0e[_0x5610('0x49')][_0x5610('0x6b')]=_0x210666[_0x5610('0x4d')][_0x5610('0x49')][_0x5610('0x6b')];}return db['MailAccount']['create'](_0x43fe0e,{'include':[{'model':db['MailServerOut'],'as':_0x5610('0x49')},{'model':db[_0x5610('0x2d')],'as':'Imap'}]})[_0x5610('0x11')](function(_0x2227dc){var _0x53182c=_0x210666[_0x5610('0x65')]['get']({'plain':!![]});if(!_0x53182c)throw new Error(_0x5610('0x6d'));if(_0x53182c[_0x5610('0x6e')]===_0x5610('0x65')){var _0x412fc5=_0x2227dc[_0x5610('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x5610('0x4c')]({'where':{'name':_0x5610('0x28'),'userProfileId':_0x53182c[_0x5610('0x6f')]},'raw':!![]})['then'](function(_0x1da2f6){if(_0x1da2f6&&_0x1da2f6[_0x5610('0x70')]===0x0){return db[_0x5610('0x29')][_0x5610('0x53')]({'name':_0x412fc5[_0x5610('0x2b')],'resourceId':_0x412fc5['id'],'type':_0x1da2f6[_0x5610('0x2b')],'sectionId':_0x1da2f6['id']},{})[_0x5610('0x11')](function(){return _0x2227dc;});}else{return _0x2227dc;}})[_0x5610('0x47')](function(_0x45f39f){logger[_0x5610('0x17')](_0x5610('0x71'),_0x45f39f);throw _0x45f39f;});}return _0x2227dc;})['then'](respondWithResult(_0x33201b,0xc9))['catch'](handleError(_0x33201b,null));};exports[_0x5610('0x72')]=function(_0x215f30,_0x29d09c){return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x215f30[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x29d09c,null))[_0x5610('0x11')](function(_0x3db971){if(_0x3db971){return _0x3db971['getImap']();}return null;})['then'](respondWithResult(_0x29d09c,null))[_0x5610('0x47')](handleError(_0x29d09c,null));};exports['addImap']=function(_0x1a3858,_0x43546c){if(_0x1a3858[_0x5610('0x4d')]['id']){delete _0x1a3858[_0x5610('0x4d')]['id'];}return db['MailAccount'][_0x5610('0x4c')]({'where':{'id':_0x1a3858[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x43546c,null))[_0x5610('0x11')](function(_0x23e3df){if(_0x23e3df){_0x1a3858['body'][_0x5610('0x51')]=_0x23e3df['id'];return db[_0x5610('0x2d')]['create'](_0x1a3858['body']);}})[_0x5610('0x11')](respondWithResult(_0x43546c,null))[_0x5610('0x47')](handleError(_0x43546c,null));};exports[_0x5610('0x73')]=function(_0x940923,_0xc4b444){return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x940923['params']['id']}})[_0x5610('0x11')](handleEntityNotFound(_0xc4b444,null))[_0x5610('0x11')](function(_0x3b74f5){if(_0x3b74f5){return _0x3b74f5[_0x5610('0x74')](null);}return null;})[_0x5610('0x11')](respondWithStatusCode(_0xc4b444,null))['catch'](handleError(_0xc4b444,null));};exports[_0x5610('0x75')]=function(_0x21920f,_0x3ffb64){return db['MailAccount'][_0x5610('0x55')]({'where':{'id':_0x21920f[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x3ffb64,null))[_0x5610('0x11')](function(_0x4dd54f){if(_0x4dd54f){return _0x4dd54f[_0x5610('0x75')]();}return null;})[_0x5610('0x11')](respondWithResult(_0x3ffb64,null))[_0x5610('0x47')](handleError(_0x3ffb64,null));};exports[_0x5610('0x76')]=function(_0x53292d,_0x48ea08){if(_0x53292d[_0x5610('0x4d')]['id']){delete _0x53292d[_0x5610('0x4d')]['id'];}return db[_0x5610('0x33')]['find']({'where':{'id':_0x53292d[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x48ea08,null))['then'](function(_0x403b77){if(_0x403b77){_0x53292d[_0x5610('0x4d')][_0x5610('0x51')]=_0x403b77['id'];return db[_0x5610('0x2f')][_0x5610('0x53')](_0x53292d[_0x5610('0x4d')]);}})[_0x5610('0x11')](respondWithResult(_0x48ea08,null))[_0x5610('0x47')](handleError(_0x48ea08,null));};exports[_0x5610('0x77')]=function(_0x5e4013,_0x240e4a){return db[_0x5610('0x33')]['findOne']({'where':{'id':_0x5e4013[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x240e4a,null))[_0x5610('0x11')](function(_0x3a4972){if(_0x3a4972){return _0x3a4972[_0x5610('0x78')](null);}return null;})[_0x5610('0x11')](respondWithStatusCode(_0x240e4a,null))['catch'](handleError(_0x240e4a,null));};exports['addInteraction']=function(_0xb9da89,_0x4dff89){return db[_0x5610('0x79')][_0x5610('0x4c')]({'where':{'id':_0xb9da89[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x4dff89,null))[_0x5610('0x11')](function(_0x254da9){if(_0x254da9){return _0x254da9[_0x5610('0x7a')](_0xb9da89[_0x5610('0x4d')][_0x5610('0x5a')],_[_0x5610('0x7b')](_0xb9da89[_0x5610('0x4d')],[_0x5610('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x4dff89,null))[_0x5610('0x47')](handleError(_0x4dff89,null));};exports['getInteractions']=function(_0x524aa5,_0x24df85){var _0x20be93={'raw':![],'where':{}};var _0x33b793={};var _0x47bba2={'count':0x0,'rows':[]};return db['MailAccount'][_0x5610('0x55')]({'where':{'id':_0x524aa5[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x24df85,null))[_0x5610('0x11')](function(_0x2860b1){if(_0x2860b1){_0x33b793[_0x5610('0x36')]=_[_0x5610('0x38')](db[_0x5610('0x79')][_0x5610('0x56')]);_0x33b793['query']=_[_0x5610('0x38')](_0x524aa5[_0x5610('0x37')]);_0x33b793[_0x5610('0x39')]=_['intersection'](_0x33b793[_0x5610('0x36')],_0x33b793['query']);_0x20be93[_0x5610('0x3a')]=_[_0x5610('0x3b')](_0x33b793[_0x5610('0x36')],qs[_0x5610('0x4a')](_0x524aa5[_0x5610('0x37')][_0x5610('0x4a')]));_0x20be93[_0x5610('0x3a')]=_0x20be93[_0x5610('0x3a')][_0x5610('0x3c')]?_0x20be93[_0x5610('0x3a')]:_0x33b793[_0x5610('0x36')];if(!_0x524aa5[_0x5610('0x37')][_0x5610('0x3d')](_0x5610('0x3e'))){_0x20be93[_0x5610('0x21')]=qs[_0x5610('0x21')](_0x524aa5[_0x5610('0x37')][_0x5610('0x21')]);_0x20be93['offset']=qs['offset'](_0x524aa5[_0x5610('0x37')][_0x5610('0x20')]);}_0x20be93[_0x5610('0x57')]=qs[_0x5610('0x3f')](_0x524aa5[_0x5610('0x37')]['sort']);_0x20be93[_0x5610('0x40')]=qs[_0x5610('0x39')](_[_0x5610('0x41')](_0x524aa5['query'],_0x33b793['filters']));_0x20be93['where']['MailAccountId']=_0x2860b1['id'];if(_0x524aa5[_0x5610('0x37')][_0x5610('0x58')]){_0x20be93[_0x5610('0x40')]=_[_0x5610('0x42')](_0x20be93[_0x5610('0x40')],{'$or':_['map'](_0x20be93[_0x5610('0x3a')],function(_0x2c0fbd){var _0x4fe7f0={};_0x4fe7f0[_0x2c0fbd]={'$like':'%'+_0x524aa5[_0x5610('0x37')]['filter']+'%'};return _0x4fe7f0;})});}_0x20be93=_[_0x5610('0x42')]({},_0x20be93,_0x524aa5['options']);return db['MailInteraction'][_0x5610('0x23')]({'where':_0x20be93[_0x5610('0x40')]})[_0x5610('0x11')](function(_0xa52123){_0x47bba2[_0x5610('0x23')]=_0xa52123;if(_0x524aa5[_0x5610('0x37')][_0x5610('0x4b')]){_0x20be93['include']=[{'model':db['CmContact'],'as':_0x5610('0x7c'),'required':![]},{'model':db[_0x5610('0x7d')],'as':_0x5610('0x7e'),'attributes':['name','fullname',_0x5610('0x7f')],'required':![]},{'model':db[_0x5610('0x80')],'as':_0x5610('0x81'),'attributes':['id',_0x5610('0x2b'),_0x5610('0x82')],'where':_0x524aa5[_0x5610('0x37')][_0x5610('0x83')]?{'id':_0x524aa5[_0x5610('0x37')][_0x5610('0x83')]}:undefined,'required':_0x524aa5[_0x5610('0x37')][_0x5610('0x83')]?!![]:![]}];}return db['MailInteraction'][_0x5610('0x45')](_0x20be93);})[_0x5610('0x11')](function(_0x1c0935){_0x47bba2[_0x5610('0x46')]=_0x1c0935;return _0x47bba2;});}})['then'](respondWithFilteredResult(_0x24df85,_0x20be93))['catch'](handleError(_0x24df85,null));};exports[_0x5610('0x84')]=function addApplications(_0x1e34a9,_0x4d42e9){var _0x12568e=_0x1e34a9['params']['id'];var _0x1f51b6=_0x1e34a9[_0x5610('0x4d')];var _0xd8007a=0xc8;var _0xd253af=null;return db[_0x5610('0x85')][_0x5610('0x86')]({'isolationLevel':db['sequelize'][_0x5610('0x87')][_0x5610('0x88')][_0x5610('0x89')]},function(_0x261492){return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x12568e},'transaction':_0x261492})['then'](function(_0x7e508a){if(_0x7e508a){return db[_0x5610('0x8a')][_0x5610('0x26')]({'where':{'MailAccountId':_0x12568e},'transaction':_0x261492})[_0x5610('0x11')](function(){var _0x3178cf=_[_0x5610('0x32')](_0x1f51b6,function(_0x2938f9){_0x2938f9[_0x5610('0x51')]=_0x12568e;return _0x2938f9;});return db[_0x5610('0x8a')][_0x5610('0x8b')](_0x3178cf,{'transaction':_0x261492});});}else{_0xd8007a=0x194;_0xd253af=[];}});})[_0x5610('0x11')](function(){if(_0xd8007a!==0x194){return db[_0x5610('0x8a')][_0x5610('0x8c')]({'where':{'MailAccountId':_0x12568e},'order':_0x5610('0x8d')})[_0x5610('0x11')](function(_0x5cf3c6){_0xd253af=_0x5cf3c6;});}})[_0x5610('0x47')](function(_0x261406){_0xd8007a=0x1f4;logger['error'](_0x261406['stack']);if(_0x261406[_0x5610('0x2b')]){delete _0x261406[_0x5610('0x2b')];}_0xd253af=_0x261406;})[_0x5610('0x8e')](function(){if(_0xd253af===null){_0x4d42e9[_0x5610('0x1c')](_0xd8007a);}else{if(_0xd8007a===0x1f4){_0x4d42e9[_0x5610('0x1e')](_0xd8007a)[_0x5610('0x2c')](_0xd253af);}else{_0x4d42e9['status'](_0xd8007a)[_0x5610('0x1f')](_0xd253af);}}});};exports[_0x5610('0x8f')]=function(_0x4a70a9,_0x4c693e){var _0x891540={};var _0x337b32={};var _0x30dc12;var _0x43d0aa;return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x4a70a9[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x4c693e,null))['then'](function(_0x56d91b){if(_0x56d91b){_0x30dc12=_0x56d91b;_0x337b32[_0x5610('0x36')]=_[_0x5610('0x38')](db[_0x5610('0x8a')]['rawAttributes']);_0x337b32[_0x5610('0x37')]=_[_0x5610('0x38')](_0x4a70a9['query']);_0x337b32[_0x5610('0x39')]=_[_0x5610('0x3b')](_0x337b32[_0x5610('0x36')],_0x337b32[_0x5610('0x37')]);_0x891540[_0x5610('0x3a')]=_[_0x5610('0x3b')](_0x337b32[_0x5610('0x36')],qs[_0x5610('0x4a')](_0x4a70a9['query'][_0x5610('0x4a')]));_0x891540['attributes']=_0x891540['attributes']['length']?_0x891540[_0x5610('0x3a')]:_0x337b32[_0x5610('0x36')];_0x891540['order']=qs[_0x5610('0x3f')](_0x4a70a9[_0x5610('0x37')][_0x5610('0x3f')]);_0x891540[_0x5610('0x40')]=qs['filters'](_[_0x5610('0x41')](_0x4a70a9[_0x5610('0x37')],_0x337b32[_0x5610('0x39')]));if(_0x4a70a9['query']['filter']){_0x891540['where']=_[_0x5610('0x42')](_0x891540[_0x5610('0x40')],{'$or':_['map'](_0x891540['attributes'],function(_0x2b59fe){var _0x4da537={};_0x4da537[_0x2b59fe]={'$like':'%'+_0x4a70a9[_0x5610('0x37')][_0x5610('0x58')]+'%'};return _0x4da537;})});}_0x891540=_[_0x5610('0x42')]({},_0x891540,_0x4a70a9[_0x5610('0x43')]);return _0x30dc12[_0x5610('0x8f')](_0x891540);}})[_0x5610('0x11')](function(_0x4237c7){if(_0x4237c7){_0x43d0aa=_0x4237c7[_0x5610('0x3c')];if(!_0x4a70a9['query']['hasOwnProperty'](_0x5610('0x3e'))){_0x891540[_0x5610('0x21')]=qs[_0x5610('0x21')](_0x4a70a9[_0x5610('0x37')][_0x5610('0x21')]);_0x891540[_0x5610('0x20')]=qs[_0x5610('0x20')](_0x4a70a9[_0x5610('0x37')][_0x5610('0x20')]);}return _0x30dc12[_0x5610('0x8f')](_0x891540);}})['then'](function(_0x1b222a){if(_0x1b222a){return _0x1b222a?{'count':_0x43d0aa,'rows':_0x1b222a}:null;}})[_0x5610('0x11')](respondWithResult(_0x4c693e,null))['catch'](handleError(_0x4c693e,null));};exports['getMessages']=function(_0x13b855,_0x25b07c){var _0x14299c={'raw':!![],'where':{}};var _0x3a022b={};var _0x39e037={'count':0x0,'rows':[]};return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x13b855['params']['id']}})['then'](handleEntityNotFound(_0x25b07c,null))[_0x5610('0x11')](function(_0x1caaff){if(_0x1caaff){_0x3a022b[_0x5610('0x36')]=_[_0x5610('0x38')](db[_0x5610('0x90')][_0x5610('0x56')]);_0x3a022b[_0x5610('0x37')]=_['keys'](_0x13b855[_0x5610('0x37')]);_0x3a022b[_0x5610('0x39')]=_[_0x5610('0x3b')](_0x3a022b[_0x5610('0x36')],_0x3a022b[_0x5610('0x37')]);_0x14299c[_0x5610('0x3a')]=_[_0x5610('0x3b')](_0x3a022b[_0x5610('0x36')],qs['fields'](_0x13b855[_0x5610('0x37')][_0x5610('0x4a')]));_0x14299c[_0x5610('0x3a')]=_0x14299c[_0x5610('0x3a')][_0x5610('0x3c')]?_0x14299c[_0x5610('0x3a')]:_0x3a022b[_0x5610('0x36')];if(!_0x13b855['query']['hasOwnProperty'](_0x5610('0x3e'))){_0x14299c[_0x5610('0x21')]=qs['limit'](_0x13b855[_0x5610('0x37')][_0x5610('0x21')]);_0x14299c[_0x5610('0x20')]=qs[_0x5610('0x20')](_0x13b855['query'][_0x5610('0x20')]);}_0x14299c[_0x5610('0x57')]=qs[_0x5610('0x3f')](_0x13b855[_0x5610('0x37')][_0x5610('0x3f')]);_0x14299c[_0x5610('0x40')]=qs[_0x5610('0x39')](_[_0x5610('0x41')](_0x13b855[_0x5610('0x37')],_0x3a022b[_0x5610('0x39')]));_0x14299c['where'][_0x5610('0x51')]=_0x1caaff['id'];if(_0x13b855[_0x5610('0x37')][_0x5610('0x58')]){_0x14299c[_0x5610('0x40')]=_[_0x5610('0x42')](_0x14299c[_0x5610('0x40')],{'$or':_[_0x5610('0x32')](_0x14299c['attributes'],function(_0x2a4c78){var _0x309f85={};_0x309f85[_0x2a4c78]={'$like':'%'+_0x13b855[_0x5610('0x37')]['filter']+'%'};return _0x309f85;})});}if(_0x13b855[_0x5610('0x37')][_0x5610('0x91')]){var _0xcbe1a4=_0x13b855[_0x5610('0x37')][_0x5610('0x91')][_0x5610('0x92')](',');var _0x5d8eb0={};_0x5d8eb0[_0xcbe1a4[0x0]]={'$gte':moment(_0xcbe1a4[0x1])[_0x5610('0x93')](_0x5610('0x94'))};_0x14299c[_0x5610('0x40')]=_[_0x5610('0x42')](_0x14299c['where'],_0x5d8eb0);}_0x14299c=_[_0x5610('0x42')]({},_0x14299c,_0x13b855[_0x5610('0x43')]);return db[_0x5610('0x90')][_0x5610('0x23')]({'where':_0x14299c['where']})[_0x5610('0x11')](function(_0x22c31f){_0x39e037['count']=_0x22c31f;if(_0x13b855[_0x5610('0x37')][_0x5610('0x4b')]){_0x14299c[_0x5610('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0x5610('0x45')](_0x14299c);})[_0x5610('0x11')](function(_0x4e5c42){if(_0x13b855['query'][_0x5610('0x95')]===_0x5610('0x96')){for(var _0x4d26f2=0x0;_0x4d26f2<_0x4e5c42[_0x5610('0x3c')];_0x4d26f2++){_0x4e5c42[_0x4d26f2][_0x5610('0x4d')]=juice(_0x4e5c42[_0x4d26f2][_0x5610('0x4d')]);}}_0x39e037[_0x5610('0x46')]=_0x4e5c42;return _0x39e037;});}})['then'](respondWithFilteredResult(_0x25b07c,_0x14299c))[_0x5610('0x47')](handleError(_0x25b07c,null));};exports[_0x5610('0x2c')]=function(_0x49f84a,_0x1eef53){var _0x480b7d,_0x4d114b={},_0x274558;if(_0x49f84a[_0x5610('0x4d')]['to']){_0x274558=_0x49f84a[_0x5610('0x4d')]['to'][_0x5610('0x92')](',')[0x0];}return db['MailAccount'][_0x5610('0x4c')]({'where':{'id':_0x49f84a[_0x5610('0x48')]['id']},'include':[{'model':db[_0x5610('0x97')],'as':_0x5610('0x98'),'include':[{'model':db['CmContact'],'as':_0x5610('0x99'),'where':{'email':_0x274558},'limit':0x1,'order':[[_0x5610('0x9a'),_0x5610('0x9b')]]}]},{'model':db['MailServerOut'],'as':_0x5610('0x49'),'raw':!![]}]})[_0x5610('0x11')](handleEntityNotFound(_0x1eef53,null))['then'](function(_0x3fbe7d){if(_0x3fbe7d){_0x480b7d=_0x3fbe7d;if(_0x3fbe7d[_0x5610('0x49')]){if(_['isNil'](_0x49f84a['body'][_0x5610('0x9c')])){_0x49f84a['body'][_0x5610('0x9c')]=util[_0x5610('0x93')](_0x5610('0x9d'),_0x3fbe7d[_0x5610('0x2b')],_0x3fbe7d[_0x5610('0x61')]||_0x3fbe7d[_0x5610('0x49')][_0x5610('0x65')]);}if(_0x49f84a[_0x5610('0x4d')][_0x5610('0x9e')]&&_0x49f84a['body']['attachments']['length']){for(var _0x3b2a50=0x0;_0x3b2a50<_0x49f84a[_0x5610('0x4d')][_0x5610('0x9e')][_0x5610('0x3c')];_0x3b2a50+=0x1){_0x49f84a['body'][_0x5610('0x9e')][_0x3b2a50]={'filename':_0x49f84a[_0x5610('0x4d')][_0x5610('0x9e')][_0x3b2a50][_0x5610('0x2b')],'path':path[_0x5610('0x9f')](config[_0x5610('0xa0')],_0x5610('0xa1'),_0x49f84a[_0x5610('0x4d')]['attachments'][_0x3b2a50]['basename'])};}}var _0x5a1380={'tls':{'rejectUnauthorized':![]}};if(_[_0x5610('0x62')](_0x3fbe7d['Smtp']['service'])){if(_0x3fbe7d[_0x5610('0x49')][_0x5610('0x6c')]){_0x5a1380[_0x5610('0xa2')]={'user':_0x3fbe7d[_0x5610('0x49')][_0x5610('0x65')],'pass':_0x3fbe7d[_0x5610('0x49')][_0x5610('0x68')]};}_0x5a1380[_0x5610('0x6a')]=_0x3fbe7d[_0x5610('0x49')][_0x5610('0x6a')];_0x5a1380[_0x5610('0x6b')]=_0x3fbe7d[_0x5610('0x49')]['port'];_0x5a1380[_0x5610('0xa3')]=_0x3fbe7d[_0x5610('0x49')][_0x5610('0xa3')];}else{_0x5a1380[_0x5610('0x69')]=_0x3fbe7d[_0x5610('0x49')][_0x5610('0x69')];_0x5a1380[_0x5610('0xa2')]={'user':_0x3fbe7d[_0x5610('0x49')][_0x5610('0x65')],'pass':_0x3fbe7d[_0x5610('0x49')][_0x5610('0x68')]};}return respondWithRpcPromise(_0x5610('0xa4'),_0x5610('0xa5'),{'account':_0x5a1380,'message':_0x49f84a[_0x5610('0x4d')]});}else{throw new Error('List\x20not\x20found');}}})[_0x5610('0x11')](function(_0x235c3b){if(_0x235c3b){_0x4d114b=_0x235c3b;if(_0x480b7d[_0x5610('0x98')]){if(_0x480b7d[_0x5610('0x98')][_0x5610('0x99')][_0x5610('0x3c')]){return _0x480b7d[_0x5610('0x98')]['Contacts'][0x0];}else{return db[_0x5610('0xa6')]['create'](_[_0x5610('0xa')](_0x49f84a[_0x5610('0x4d')],{'firstName':_0x49f84a['body']['to'],'email':_0x49f84a[_0x5610('0x4d')]['to'],'phone':_0x49f84a[_0x5610('0x4d')]['to'],'ListId':_0x480b7d['ListId']}));}}else{throw new Error(_0x5610('0xa7'));}}})[_0x5610('0x11')](function(_0x33ac86){if(_0x33ac86){var _0xff1690={'UserId':_0x49f84a['user']['id'],'ContactId':_0x33ac86['id'],'MailAccountId':_0x480b7d['id'],'inReplyTo':_0x4d114b['messageId'],'to':_0x49f84a[_0x5610('0x4d')]['from'],'cc':_0x49f84a[_0x5610('0x4d')]['cc'],'subject':_0x49f84a['body']['subject'],'attach':_0x49f84a[_0x5610('0x4d')][_0x5610('0xa8')],'firstMsgDirection':_0x5610('0xa9'),'lastMsgAt':moment()[_0x5610('0x93')](_0x5610('0x94')),'lastMsgDirection':_0x5610('0xa9'),'Messages':[_[_0x5610('0x42')](_0x49f84a[_0x5610('0x4d')],{'messageId':_0x4d114b[_0x5610('0xaa')],'sentAt':moment()[_0x5610('0x93')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x480b7d['id'],'UserId':_0x49f84a[_0x5610('0x65')]['id'],'ContactId':_0x33ac86['id']})]};if(_0x49f84a[_0x5610('0x4d')]['Interaction']){_0xff1690=_[_0x5610('0x42')](_0xff1690,_0x49f84a[_0x5610('0x4d')]['Interaction']);}return db['MailInteraction'][_0x5610('0x53')](_0xff1690,{'include':[{'model':db[_0x5610('0x90')],'as':_0x5610('0xab')}]});}})['then'](respondWithResult(_0x1eef53,null))[_0x5610('0x47')](handleError(_0x1eef53,null));};exports[_0x5610('0xac')]=function(_0x3f6130,_0x353152){return db[_0x5610('0x33')][_0x5610('0x4c')]({'where':{'id':_0x3f6130[_0x5610('0x48')]['id']},'include':[{'model':db[_0x5610('0x2f')],'as':_0x5610('0x49'),'raw':!![],'include':[{'model':db[_0x5610('0xad')],'as':_0x5610('0xad'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x353152,null))[_0x5610('0x11')](function(_0x499dea){if(!_0x499dea['Smtp'])return;var _0x1f2a30={'id':_0x499dea['id'],'tls':{'rejectUnauthorized':![]}};if(_0x499dea[_0x5610('0x5f')]!==_0x5610('0x60')){_0x1f2a30['service']=_0x499dea[_0x5610('0x5f')];}else{_0x1f2a30[_0x5610('0x6a')]=_0x499dea[_0x5610('0x49')]['host'];_0x1f2a30[_0x5610('0x6b')]=_0x499dea[_0x5610('0x49')][_0x5610('0x6b')];_0x1f2a30[_0x5610('0xa3')]=_0x499dea[_0x5610('0x49')][_0x5610('0xa3')];}if(_0x499dea['Smtp'][_0x5610('0x6c')]){if(_0x499dea[_0x5610('0x49')][_0x5610('0x4e')]){_0x1f2a30[_0x5610('0xa2')]={'type':'OAuth2','user':_0x499dea[_0x5610('0x49')][_0x5610('0x65')],'accessToken':_0x499dea[_0x5610('0x49')][_0x5610('0xad')]['data5']};}else{_0x1f2a30[_0x5610('0xa2')]={'user':_0x499dea[_0x5610('0x49')][_0x5610('0x65')],'pass':_0x499dea['Smtp'][_0x5610('0x68')]};}}return respondWithRpcPromise('VerifySmtp',_0x5610('0xac'),{'account':_0x1f2a30});})['then'](respondWithResult(_0x353152,null))['catch'](handleError(_0x353152,null));};exports[_0x5610('0x26')]=function(_0x4bba49,_0x32b125){return db[_0x5610('0x33')]['find']({'where':{'id':_0x4bba49['params']['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x32b125,null))[_0x5610('0x11')](function(_0x4e5eea){if(_0x4e5eea&&_0x4e5eea[_0x5610('0x69')]){throw new db[(_0x5610('0xae'))][(_0x5610('0xaf'))](_0x5610('0xb0'));}return _0x4e5eea;})[_0x5610('0x11')](removeEntity(_0x32b125,null))['catch'](handleError(_0x32b125,null));};exports[_0x5610('0xb1')]=function(_0x9d15c9,_0x280174){return db[_0x5610('0x33')]['find']({'where':{'id':_0x9d15c9[_0x5610('0x48')]['id']}})['then'](handleEntityNotFound(_0x280174,null))[_0x5610('0x11')](function(_0x3621cd){if(_0x3621cd){return _0x3621cd[_0x5610('0xb1')](_0x9d15c9['body'][_0x5610('0x5a')],_[_0x5610('0x7b')](_0x9d15c9['body'],[_0x5610('0x5a'),'id'])||{})['spread'](function(_0x1ca9a5){for(var _0x8b1447=0x0;_0x8b1447<_0x9d15c9['body']['ids'][_0x5610('0x3c')];_0x8b1447+=0x1){socket[_0x5610('0xb2')](_0x5610('0xb3'),{'UserId':Number(_0x9d15c9[_0x5610('0x4d')][_0x5610('0x5a')][_0x8b1447]),'MailAccountId':Number(_0x9d15c9[_0x5610('0x48')]['id'])});}return _0x1ca9a5;});}})[_0x5610('0x11')](respondWithResult(_0x280174,null))['catch'](handleError(_0x280174,null));};exports[_0x5610('0xb4')]=function(_0x2910e5,_0x5c20f4){return db[_0x5610('0x33')]['find']({'where':{'id':_0x2910e5['params']['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x5c20f4,null))[_0x5610('0x11')](function(_0x3052ba){if(_0x3052ba){return _0x3052ba[_0x5610('0xb4')](_0x2910e5['query'][_0x5610('0x5a')])['then'](function(){if(_[_0x5610('0xb5')](_0x2910e5[_0x5610('0x37')][_0x5610('0x5a')])){for(var _0x402350=0x0;_0x402350<_0x2910e5[_0x5610('0x37')][_0x5610('0x5a')][_0x5610('0x3c')];_0x402350+=0x1){socket['emit'](_0x5610('0xb6'),{'UserId':Number(_0x2910e5[_0x5610('0x37')][_0x5610('0x5a')][_0x402350]),'MailAccountId':Number(_0x2910e5['params']['id'])});}}else{socket['emit'](_0x5610('0xb6'),{'UserId':Number(_0x2910e5[_0x5610('0x37')]['ids']),'MailAccountId':Number(_0x2910e5[_0x5610('0x48')]['id'])});}});}})[_0x5610('0x11')](respondWithStatusCode(_0x5c20f4,null))['catch'](handleError(_0x5c20f4,null));};exports['getAgents']=function(_0x42c23f,_0x37e985){var _0x2ed8c4={};var _0x4c4db1={};var _0x4772ac;var _0x59c149;return db[_0x5610('0x33')][_0x5610('0x55')]({'where':{'id':_0x42c23f[_0x5610('0x48')]['id']}})[_0x5610('0x11')](handleEntityNotFound(_0x37e985,null))['then'](function(_0x4fe4ff){if(_0x4fe4ff){_0x4772ac=_0x4fe4ff;_0x4c4db1[_0x5610('0x36')]=_[_0x5610('0x38')](db[_0x5610('0x7d')]['rawAttributes']);_0x4c4db1['query']=_[_0x5610('0x38')](_0x42c23f[_0x5610('0x37')]);_0x4c4db1[_0x5610('0x39')]=_[_0x5610('0x3b')](_0x4c4db1[_0x5610('0x36')],_0x4c4db1[_0x5610('0x37')]);_0x2ed8c4['attributes']=_[_0x5610('0x3b')](_0x4c4db1[_0x5610('0x36')],qs[_0x5610('0x4a')](_0x42c23f[_0x5610('0x37')][_0x5610('0x4a')]));_0x2ed8c4['attributes']=_0x2ed8c4[_0x5610('0x3a')]['length']?_0x2ed8c4[_0x5610('0x3a')]:_0x4c4db1[_0x5610('0x36')];_0x2ed8c4[_0x5610('0x57')]=qs[_0x5610('0x3f')](_0x42c23f[_0x5610('0x37')]['sort']);_0x2ed8c4[_0x5610('0x40')]=qs[_0x5610('0x39')](_[_0x5610('0x41')](_0x42c23f['query'],_0x4c4db1[_0x5610('0x39')]));if(_0x42c23f[_0x5610('0x37')]['filter']){_0x2ed8c4[_0x5610('0x40')]=_[_0x5610('0x42')](_0x2ed8c4[_0x5610('0x40')],{'$or':_['map'](_0x2ed8c4[_0x5610('0x3a')],function(_0xa28c7e){var _0x58644b={};_0x58644b[_0xa28c7e]={'$like':'%'+_0x42c23f[_0x5610('0x37')][_0x5610('0x58')]+'%'};return _0x58644b;})});}_0x2ed8c4=_[_0x5610('0x42')]({},_0x2ed8c4,_0x42c23f[_0x5610('0x43')]);return _0x4772ac[_0x5610('0xb7')](_0x2ed8c4);}})['then'](function(_0x1cc80c){if(_0x1cc80c){_0x59c149=_0x1cc80c[_0x5610('0x3c')];if(!_0x42c23f['query'][_0x5610('0x3d')]('nolimit')){_0x2ed8c4[_0x5610('0x21')]=qs[_0x5610('0x21')](_0x42c23f['query'][_0x5610('0x21')]);_0x2ed8c4['offset']=qs[_0x5610('0x20')](_0x42c23f[_0x5610('0x37')]['offset']);}return _0x4772ac[_0x5610('0xb7')](_0x2ed8c4);}})[_0x5610('0x11')](function(_0x38371e){if(_0x38371e){return _0x38371e?{'count':_0x59c149,'rows':_0x38371e}:null;}})[_0x5610('0x11')](respondWithResult(_0x37e985,null))[_0x5610('0x47')](handleError(_0x37e985,null));}; \ No newline at end of file +var _0xfa69=['filter','where','merge','VIRTUAL','MailAccount','count','includeAll','findAll','rows','params','rawAttributes','options','find','body','CloudProviderId','Smtp','modernAuthentication','describe','addDisposition','Disposition','create','findOne','MailAccountId','include','removeDispositions','CannedAnswer','getAnswers','nolimit','removeAnswers','provider','custom','email','ListId','isNil','active','description','user','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','tag','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','MailApplication','findAndCountAll','priority','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','send','CmList','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','messageId','from','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','Sequelize','ValidationError','addAgents','ids','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','get','MailAccounts','sendStatus','name','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','pick'];(function(_0x43c778,_0xf083cf){var _0x5dc03e=function(_0x240792){while(--_0x240792){_0x43c778['push'](_0x43c778['shift']());}};_0x5dc03e(++_0xf083cf);}(_0xfa69,0x1e7));var _0x9fa6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa69[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require(_0x9fa6('0x0'));var BPromise=require(_0x9fa6('0x1'));var util=require(_0x9fa6('0x2'));var path=require(_0x9fa6('0x3'));var _=require(_0x9fa6('0x4'));var juice=require('juice');var Redis=require(_0x9fa6('0x5'));var qs=require(_0x9fa6('0x6'));var logger=require('../../config/logger')(_0x9fa6('0x7'));var config=require(_0x9fa6('0x8'));var db=require(_0x9fa6('0x9'))['db'];config['redis']=_[_0x9fa6('0xa')](config[_0x9fa6('0xb')],{'host':_0x9fa6('0xc'),'port':0x18eb});var socket=require(_0x9fa6('0xd'))(new Redis(config[_0x9fa6('0xb')]));require('./mailAccount.socket')[_0x9fa6('0xe')](socket);var jayson=require(_0x9fa6('0xf'));var client=jayson[_0x9fa6('0x10')][_0x9fa6('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x9e574d,_0x2919b5,_0x29ef08,_0x54ea0d){return new BPromise(function(_0x187508,_0x7d2a0a){var _0x27802c=_0x54ea0d||client;return _0x27802c[_0x9fa6('0x12')](_0x9e574d,_0x29ef08)['then'](function(_0x2596af){logger[_0x9fa6('0x13')]('MailAccount,\x20%s,\x20%s',_0x2919b5,'request\x20sent');logger[_0x9fa6('0x14')](_0x9fa6('0x15'),_0x2919b5,_0x9fa6('0x16'),JSON['stringify'](_0x2596af));if(_0x2596af[_0x9fa6('0x17')]){if(_0x2596af[_0x9fa6('0x17')]['code']===0x1f4){logger[_0x9fa6('0x17')](_0x9fa6('0x18'),_0x2919b5,_0x2596af['error'][_0x9fa6('0x19')]);return _0x7d2a0a(_0x2596af[_0x9fa6('0x17')][_0x9fa6('0x19')]);}logger[_0x9fa6('0x17')](_0x9fa6('0x18'),_0x2919b5,_0x2596af[_0x9fa6('0x17')]['message']);return _0x187508(_0x2596af['error'][_0x9fa6('0x19')]);}else{logger[_0x9fa6('0x13')](_0x9fa6('0x18'),_0x2919b5,_0x9fa6('0x16'));_0x187508(_0x2596af[_0x9fa6('0x1a')][_0x9fa6('0x19')]);}})[_0x9fa6('0x1b')](function(_0x5bfce5){logger[_0x9fa6('0x17')](_0x9fa6('0x18'),_0x2919b5,_0x5bfce5);_0x7d2a0a(_0x5bfce5);});});}function respondWithStatusCode(_0x4e9d6e,_0x164b79){_0x164b79=_0x164b79||0xcc;return function(_0x3b4a32){if(_0x3b4a32){return _0x4e9d6e['sendStatus'](_0x164b79);}return _0x4e9d6e[_0x9fa6('0x1c')](_0x164b79)[_0x9fa6('0x1d')]();};}function respondWithResult(_0x22aaae,_0x75c108){_0x75c108=_0x75c108||0xc8;return function(_0x2d5032){if(_0x2d5032){return _0x22aaae[_0x9fa6('0x1c')](_0x75c108)[_0x9fa6('0x1e')](_0x2d5032);}};}function respondWithFilteredResult(_0x4c9ace,_0x3742d4){return function(_0xa1501){if(_0xa1501){var _0x209c8a=typeof _0x3742d4[_0x9fa6('0x1f')]==='undefined'&&typeof _0x3742d4[_0x9fa6('0x20')]===_0x9fa6('0x21');var _0x4b9019=_0xa1501['count'];var _0x41423b=_0x209c8a?0x0:_0x3742d4[_0x9fa6('0x1f')];var _0x9edc7e=_0x209c8a?_0xa1501['count']:_0x3742d4[_0x9fa6('0x1f')]+_0x3742d4[_0x9fa6('0x20')];var _0x46ee4d;if(_0x9edc7e>=_0x4b9019){_0x9edc7e=_0x4b9019;_0x46ee4d=0xc8;}else{_0x46ee4d=0xce;}_0x4c9ace[_0x9fa6('0x1c')](_0x46ee4d);return _0x4c9ace[_0x9fa6('0x22')](_0x9fa6('0x23'),_0x41423b+'-'+_0x9edc7e+'/'+_0x4b9019)[_0x9fa6('0x1e')](_0xa1501);}return null;};}function saveUpdates(_0x207bbf){return function(_0x4f3c83){if(_0x4f3c83){return _0x4f3c83[_0x9fa6('0x24')](_0x207bbf)[_0x9fa6('0x25')](function(_0x5c3b22){return _0x5c3b22;});}return null;};}function removeEntity(_0x15cc52){return function(_0x413195){if(_0x413195){return _0x413195[_0x9fa6('0x26')]()[_0x9fa6('0x25')](function(){var _0x520f53=_0x413195[_0x9fa6('0x27')]({'plain':!![]});var _0xc8ba1b=_0x9fa6('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xc8ba1b,'resourceId':_0x520f53['id']}})['then'](function(){return _0x413195;});})[_0x9fa6('0x25')](function(){_0x15cc52[_0x9fa6('0x1c')](0xcc)[_0x9fa6('0x1d')]();});}};}function handleEntityNotFound(_0x48fc73){return function(_0x285db2){if(!_0x285db2){_0x48fc73[_0x9fa6('0x29')](0x194);}return _0x285db2;};}function handleError(_0x19fce8,_0x3052c7){_0x3052c7=_0x3052c7||0x1f4;return function(_0x44aa52){logger[_0x9fa6('0x17')](_0x44aa52['stack']);if(_0x44aa52[_0x9fa6('0x2a')]){delete _0x44aa52[_0x9fa6('0x2a')];}_0x19fce8[_0x9fa6('0x1c')](_0x3052c7)['send'](_0x44aa52);};}exports[_0x9fa6('0x2b')]=function(_0x23ecea,_0x49ba45){var _0x2ec0e2={'include':[{'model':db[_0x9fa6('0x2c')],'as':_0x9fa6('0x2d')},{'model':db[_0x9fa6('0x2e')],'as':'Smtp'},{'model':db[_0x9fa6('0x2f')],'as':_0x9fa6('0x30')}]},_0x2fd4eb={},_0x2865d1={'count':0x0,'rows':[]};var _0x4eb03c=_['map'](db['MailAccount']['rawAttributes'],function(_0x2e4ca8){return{'name':_0x2e4ca8[_0x9fa6('0x31')],'type':_0x2e4ca8[_0x9fa6('0x32')][_0x9fa6('0x33')]};});_0x2fd4eb[_0x9fa6('0x34')]=_[_0x9fa6('0x35')](_0x4eb03c,_0x9fa6('0x2a'));_0x2fd4eb['query']=_[_0x9fa6('0x36')](_0x23ecea['query']);_0x2fd4eb[_0x9fa6('0x37')]=_[_0x9fa6('0x38')](_0x2fd4eb[_0x9fa6('0x34')],_0x2fd4eb['query']);_0x2ec0e2[_0x9fa6('0x39')]=_[_0x9fa6('0x38')](_0x2fd4eb['model'],qs[_0x9fa6('0x3a')](_0x23ecea[_0x9fa6('0x3b')][_0x9fa6('0x3a')]));_0x2ec0e2[_0x9fa6('0x39')]=_0x2ec0e2[_0x9fa6('0x39')][_0x9fa6('0x3c')]?_0x2ec0e2[_0x9fa6('0x39')]:_0x2fd4eb[_0x9fa6('0x34')];if(!_0x23ecea['query'][_0x9fa6('0x3d')]('nolimit')){_0x2ec0e2[_0x9fa6('0x20')]=qs[_0x9fa6('0x20')](_0x23ecea[_0x9fa6('0x3b')][_0x9fa6('0x20')]);_0x2ec0e2[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0x23ecea[_0x9fa6('0x3b')]['offset']);}_0x2ec0e2[_0x9fa6('0x3e')]=qs[_0x9fa6('0x3f')](_0x23ecea[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x2ec0e2['where']=qs[_0x9fa6('0x37')](_[_0x9fa6('0x40')](_0x23ecea[_0x9fa6('0x3b')],_0x2fd4eb[_0x9fa6('0x37')]),_0x4eb03c);if(_0x23ecea[_0x9fa6('0x3b')][_0x9fa6('0x41')]){_0x2ec0e2[_0x9fa6('0x42')]=_[_0x9fa6('0x43')](_0x2ec0e2[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x4eb03c,function(_0x3a7a5b){if(_0x3a7a5b[_0x9fa6('0x32')]!==_0x9fa6('0x44')){var _0x162da8={};_0x162da8[_0x3a7a5b[_0x9fa6('0x2a')]]={'$like':'%'+_0x23ecea[_0x9fa6('0x3b')]['filter']+'%'};return _0x162da8;}})});}_0x2ec0e2=_[_0x9fa6('0x43')]({},_0x2ec0e2,_0x23ecea['options']);var _0x25aa0e={'where':_0x2ec0e2['where']};return db[_0x9fa6('0x45')][_0x9fa6('0x46')](_0x25aa0e)['then'](function(_0x12d984){_0x2865d1[_0x9fa6('0x46')]=_0x12d984;if(_0x23ecea[_0x9fa6('0x3b')][_0x9fa6('0x47')]){_0x2ec0e2['include']=[{'all':!![]}];}return db['MailAccount'][_0x9fa6('0x48')](_0x2ec0e2);})[_0x9fa6('0x25')](function(_0x47929b){_0x2865d1[_0x9fa6('0x49')]=_0x47929b;return _0x2865d1;})[_0x9fa6('0x25')](respondWithFilteredResult(_0x49ba45,_0x2ec0e2))[_0x9fa6('0x1b')](handleError(_0x49ba45,null));};exports['show']=function(_0x3f4719,_0x469177){var _0x3dbf8e={'raw':![],'where':{'id':_0x3f4719[_0x9fa6('0x4a')]['id']},'include':[{'model':db[_0x9fa6('0x2c')],'as':_0x9fa6('0x2d')},{'model':db[_0x9fa6('0x2e')],'as':'Smtp'},{'model':db[_0x9fa6('0x2f')],'as':'mandatoryDispositionPause'}]},_0x1dfcc8={};_0x1dfcc8[_0x9fa6('0x34')]=_['keys'](db[_0x9fa6('0x45')][_0x9fa6('0x4b')]);_0x1dfcc8[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0x3f4719[_0x9fa6('0x3b')]);_0x1dfcc8[_0x9fa6('0x37')]=_['intersection'](_0x1dfcc8['model'],_0x1dfcc8[_0x9fa6('0x3b')]);_0x3dbf8e['attributes']=_[_0x9fa6('0x38')](_0x1dfcc8[_0x9fa6('0x34')],qs['fields'](_0x3f4719[_0x9fa6('0x3b')]['fields']));_0x3dbf8e[_0x9fa6('0x39')]=_0x3dbf8e[_0x9fa6('0x39')]['length']?_0x3dbf8e[_0x9fa6('0x39')]:_0x1dfcc8[_0x9fa6('0x34')];if(_0x3f4719['query']['includeAll']){_0x3dbf8e['include']=[{'all':!![]}];}_0x3dbf8e=_[_0x9fa6('0x43')]({},_0x3dbf8e,_0x3f4719[_0x9fa6('0x4c')]);return db['MailAccount'][_0x9fa6('0x4d')](_0x3dbf8e)[_0x9fa6('0x25')](handleEntityNotFound(_0x469177,null))[_0x9fa6('0x25')](respondWithResult(_0x469177,null))[_0x9fa6('0x1b')](handleError(_0x469177,null));};exports[_0x9fa6('0x24')]=function(_0x4eef7f,_0x2fb64f){if(_0x4eef7f[_0x9fa6('0x4e')]['id']){delete _0x4eef7f[_0x9fa6('0x4e')]['id'];}if(_0x4eef7f['body'][_0x9fa6('0x2d')]){if(!_0x4eef7f['body'][_0x9fa6('0x2d')]['modernAuthentication']){_0x4eef7f['body'][_0x9fa6('0x2d')][_0x9fa6('0x4f')]=null;}}if(_0x4eef7f[_0x9fa6('0x4e')][_0x9fa6('0x50')]){if(!_0x4eef7f[_0x9fa6('0x4e')][_0x9fa6('0x50')][_0x9fa6('0x51')]){_0x4eef7f['body']['Smtp']['CloudProviderId']=null;}}return db['MailAccount'][_0x9fa6('0x4d')]({'where':{'id':_0x4eef7f[_0x9fa6('0x4a')]['id']},'include':[{'model':db[_0x9fa6('0x2c')],'as':_0x9fa6('0x2d')},{'model':db[_0x9fa6('0x2e')],'as':_0x9fa6('0x50')},{'model':db[_0x9fa6('0x2f')],'as':_0x9fa6('0x30')}]})[_0x9fa6('0x25')](handleEntityNotFound(_0x2fb64f,null))[_0x9fa6('0x25')](saveUpdates(_0x4eef7f['body'],null))[_0x9fa6('0x25')](function(_0x270e85){if(_0x270e85&&_0x4eef7f[_0x9fa6('0x4e')][_0x9fa6('0x2d')]){return db[_0x9fa6('0x2c')][_0x9fa6('0x24')](_0x4eef7f[_0x9fa6('0x4e')][_0x9fa6('0x2d')],{'where':{'MailAccountId':_0x270e85['id']}})[_0x9fa6('0x25')](function(){return _0x270e85;});}return _0x270e85;})['then'](function(_0x19d5cd){if(_0x19d5cd&&_0x4eef7f[_0x9fa6('0x4e')]['Smtp']){return db['MailServerOut'][_0x9fa6('0x24')](_0x4eef7f['body'][_0x9fa6('0x50')],{'where':{'MailAccountId':_0x19d5cd['id']}})[_0x9fa6('0x25')](function(){return _0x19d5cd;});}return _0x19d5cd;})[_0x9fa6('0x25')](respondWithResult(_0x2fb64f,null))[_0x9fa6('0x1b')](handleError(_0x2fb64f,null));};exports[_0x9fa6('0x52')]=function(_0x29a5e0,_0x21ee73){return db[_0x9fa6('0x45')]['describe']()[_0x9fa6('0x25')](respondWithResult(_0x21ee73,null))[_0x9fa6('0x1b')](handleError(_0x21ee73,null));};exports[_0x9fa6('0x53')]=function(_0x4e9796,_0x186d11){if(_0x4e9796['body']['id']){delete _0x4e9796['body']['id'];}return db[_0x9fa6('0x45')]['find']({'where':{'id':_0x4e9796[_0x9fa6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x186d11,null))[_0x9fa6('0x25')](function(_0x4471f4){if(_0x4471f4){_0x4e9796[_0x9fa6('0x4e')]['MailAccountId']=_0x4471f4['id'];return db[_0x9fa6('0x54')][_0x9fa6('0x55')](_0x4e9796[_0x9fa6('0x4e')]);}})[_0x9fa6('0x25')](respondWithResult(_0x186d11,null))['catch'](handleError(_0x186d11,null));};exports['getDispositions']=function(_0xf62f4a,_0xd64e33){var _0x5dd2fa={'raw':![],'where':{}};var _0x1df786={};var _0x230c82={'count':0x0,'rows':[]};return db[_0x9fa6('0x45')][_0x9fa6('0x56')]({'where':{'id':_0xf62f4a['params']['id']}})['then'](handleEntityNotFound(_0xd64e33,null))[_0x9fa6('0x25')](function(_0x1dd6f0){if(_0x1dd6f0){_0x1df786['model']=_[_0x9fa6('0x36')](db[_0x9fa6('0x54')][_0x9fa6('0x4b')]);_0x1df786[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0xf62f4a[_0x9fa6('0x3b')]);_0x1df786['filters']=_[_0x9fa6('0x38')](_0x1df786[_0x9fa6('0x34')],_0x1df786[_0x9fa6('0x3b')]);_0x5dd2fa['attributes']=_['intersection'](_0x1df786[_0x9fa6('0x34')],qs[_0x9fa6('0x3a')](_0xf62f4a['query'][_0x9fa6('0x3a')]));_0x5dd2fa['attributes']=_0x5dd2fa['attributes'][_0x9fa6('0x3c')]?_0x5dd2fa[_0x9fa6('0x39')]:_0x1df786[_0x9fa6('0x34')];if(!_0xf62f4a['query'][_0x9fa6('0x3d')]('nolimit')){_0x5dd2fa[_0x9fa6('0x20')]=qs[_0x9fa6('0x20')](_0xf62f4a[_0x9fa6('0x3b')]['limit']);_0x5dd2fa[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0xf62f4a[_0x9fa6('0x3b')][_0x9fa6('0x1f')]);}_0x5dd2fa[_0x9fa6('0x3e')]=qs['sort'](_0xf62f4a[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x5dd2fa['where']=qs[_0x9fa6('0x37')](_[_0x9fa6('0x40')](_0xf62f4a[_0x9fa6('0x3b')],_0x1df786[_0x9fa6('0x37')]));_0x5dd2fa[_0x9fa6('0x42')][_0x9fa6('0x57')]=_0x1dd6f0['id'];if(_0xf62f4a['query'][_0x9fa6('0x41')]){_0x5dd2fa[_0x9fa6('0x42')]=_['merge'](_0x5dd2fa[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x5dd2fa['attributes'],function(_0x268051){var _0x447cc3={};_0x447cc3[_0x268051]={'$like':'%'+_0xf62f4a[_0x9fa6('0x3b')][_0x9fa6('0x41')]+'%'};return _0x447cc3;})});}_0x5dd2fa=_['merge']({},_0x5dd2fa,_0xf62f4a[_0x9fa6('0x4c')]);return db[_0x9fa6('0x54')][_0x9fa6('0x46')]({'where':_0x5dd2fa[_0x9fa6('0x42')]})[_0x9fa6('0x25')](function(_0x4c690c){_0x230c82[_0x9fa6('0x46')]=_0x4c690c;if(_0xf62f4a[_0x9fa6('0x3b')][_0x9fa6('0x47')]){_0x5dd2fa[_0x9fa6('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x9fa6('0x48')](_0x5dd2fa);})[_0x9fa6('0x25')](function(_0xc350ff){_0x230c82[_0x9fa6('0x49')]=_0xc350ff;return _0x230c82;});}})['then'](respondWithFilteredResult(_0xd64e33,_0x5dd2fa))[_0x9fa6('0x1b')](handleError(_0xd64e33,null));};exports['removeDispositions']=function(_0x6dd772,_0x5679e9){return db[_0x9fa6('0x45')]['find']({'where':{'id':_0x6dd772[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x5679e9,null))['then'](function(_0x10281b){if(_0x10281b){return _0x10281b[_0x9fa6('0x59')](_0x6dd772[_0x9fa6('0x3b')]['ids']);}})[_0x9fa6('0x25')](respondWithStatusCode(_0x5679e9,null))[_0x9fa6('0x1b')](handleError(_0x5679e9,null));};exports['addAnswer']=function(_0x1a07fd,_0x7d28b7){if(_0x1a07fd['body']['id']){delete _0x1a07fd[_0x9fa6('0x4e')]['id'];}return db[_0x9fa6('0x45')][_0x9fa6('0x4d')]({'where':{'id':_0x1a07fd[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x7d28b7,null))[_0x9fa6('0x25')](function(_0x29a865){if(_0x29a865){_0x1a07fd[_0x9fa6('0x4e')][_0x9fa6('0x57')]=_0x29a865['id'];return db[_0x9fa6('0x5a')][_0x9fa6('0x55')](_0x1a07fd[_0x9fa6('0x4e')]);}})['then'](respondWithResult(_0x7d28b7,null))['catch'](handleError(_0x7d28b7,null));};exports[_0x9fa6('0x5b')]=function(_0x93adbe,_0x216950){var _0x4c1ca4={'raw':![],'where':{}};var _0x3b98f0={};var _0x1a37c1={'count':0x0,'rows':[]};return db[_0x9fa6('0x45')][_0x9fa6('0x56')]({'where':{'id':_0x93adbe['params']['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x216950,null))['then'](function(_0x428a8a){if(_0x428a8a){_0x3b98f0['model']=_['keys'](db[_0x9fa6('0x5a')]['rawAttributes']);_0x3b98f0[_0x9fa6('0x3b')]=_['keys'](_0x93adbe[_0x9fa6('0x3b')]);_0x3b98f0[_0x9fa6('0x37')]=_[_0x9fa6('0x38')](_0x3b98f0['model'],_0x3b98f0[_0x9fa6('0x3b')]);_0x4c1ca4[_0x9fa6('0x39')]=_[_0x9fa6('0x38')](_0x3b98f0[_0x9fa6('0x34')],qs[_0x9fa6('0x3a')](_0x93adbe['query'][_0x9fa6('0x3a')]));_0x4c1ca4[_0x9fa6('0x39')]=_0x4c1ca4[_0x9fa6('0x39')][_0x9fa6('0x3c')]?_0x4c1ca4[_0x9fa6('0x39')]:_0x3b98f0[_0x9fa6('0x34')];if(!_0x93adbe[_0x9fa6('0x3b')][_0x9fa6('0x3d')](_0x9fa6('0x5c'))){_0x4c1ca4[_0x9fa6('0x20')]=qs[_0x9fa6('0x20')](_0x93adbe[_0x9fa6('0x3b')][_0x9fa6('0x20')]);_0x4c1ca4[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0x93adbe[_0x9fa6('0x3b')][_0x9fa6('0x1f')]);}_0x4c1ca4['order']=qs['sort'](_0x93adbe[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x4c1ca4['where']=qs[_0x9fa6('0x37')](_[_0x9fa6('0x40')](_0x93adbe['query'],_0x3b98f0[_0x9fa6('0x37')]));_0x4c1ca4[_0x9fa6('0x42')][_0x9fa6('0x57')]=_0x428a8a['id'];if(_0x93adbe['query'][_0x9fa6('0x41')]){_0x4c1ca4[_0x9fa6('0x42')]=_['merge'](_0x4c1ca4['where'],{'$or':_[_0x9fa6('0x35')](_0x4c1ca4[_0x9fa6('0x39')],function(_0x3daf03){var _0x5f4f30={};_0x5f4f30[_0x3daf03]={'$like':'%'+_0x93adbe[_0x9fa6('0x3b')]['filter']+'%'};return _0x5f4f30;})});}_0x4c1ca4=_[_0x9fa6('0x43')]({},_0x4c1ca4,_0x93adbe[_0x9fa6('0x4c')]);return db[_0x9fa6('0x5a')][_0x9fa6('0x46')]({'where':_0x4c1ca4['where']})['then'](function(_0x11385d){_0x1a37c1[_0x9fa6('0x46')]=_0x11385d;if(_0x93adbe['query']['includeAll']){_0x4c1ca4[_0x9fa6('0x58')]=[{'all':!![]}];}return db[_0x9fa6('0x5a')][_0x9fa6('0x48')](_0x4c1ca4);})[_0x9fa6('0x25')](function(_0x4f0f1e){_0x1a37c1[_0x9fa6('0x49')]=_0x4f0f1e;return _0x1a37c1;});}})['then'](respondWithFilteredResult(_0x216950,_0x4c1ca4))[_0x9fa6('0x1b')](handleError(_0x216950,null));};exports[_0x9fa6('0x5d')]=function(_0x5c3e55,_0x3043a0){return db['MailAccount'][_0x9fa6('0x4d')]({'where':{'id':_0x5c3e55[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x3043a0,null))[_0x9fa6('0x25')](function(_0x3ac626){if(_0x3ac626){return _0x3ac626[_0x9fa6('0x5d')](_0x5c3e55[_0x9fa6('0x3b')]['ids']);}})[_0x9fa6('0x25')](respondWithStatusCode(_0x3043a0,null))[_0x9fa6('0x1b')](handleError(_0x3043a0,null));};exports[_0x9fa6('0x55')]=function(_0x393e38,_0x393289){var _0x114fa7={'name':_0x393e38[_0x9fa6('0x4e')]['name'],'key':_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x33')],'provider':_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x5e')]===_0x9fa6('0x5f')?null:_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x5e')],'email':_0x393e38['body'][_0x9fa6('0x60')],'ListId':_0x393e38['body'][_0x9fa6('0x61')],'active':!_[_0x9fa6('0x62')](_0x393e38[_0x9fa6('0x4e')]['active'])?_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x63')]:!![],'description':_0x393e38['body'][_0x9fa6('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x114fa7[_0x9fa6('0x5e')]){_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x65')]=_0x114fa7['Smtp']['user']=_0x393e38['body']['username'];_0x114fa7['Imap'][_0x9fa6('0x66')]=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x67')]=_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x66')];if(_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x51')]){_0x114fa7[_0x9fa6('0x2d')]['modernAuthentication']=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x51')]=!![];_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x4f')]=_0x114fa7[_0x9fa6('0x50')]['CloudProviderId']=_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x4f')];_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x66')]=_0x114fa7['Smtp'][_0x9fa6('0x67')]=null;}else{_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x4f')]=_0x114fa7['Smtp'][_0x9fa6('0x4f')]=null;}_0x114fa7['Imap'][_0x9fa6('0x68')]=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x68')]=null;_0x114fa7['Imap']['host']=_0x114fa7['Smtp'][_0x9fa6('0x69')]=null;_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x6a')]=_0x114fa7['Smtp']['port']=null;}else{if(_0x393e38[_0x9fa6('0x4e')]['authentication']){_0x114fa7[_0x9fa6('0x2d')]['user']=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x65')]=_0x393e38[_0x9fa6('0x4e')]['username'];_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x66')]=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x67')]=_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x66')];}else{_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x6b')]=_0x114fa7[_0x9fa6('0x50')]['authentication']=![];_0x114fa7[_0x9fa6('0x2d')]['user']=_0x114fa7[_0x9fa6('0x50')][_0x9fa6('0x65')]=null;_0x114fa7[_0x9fa6('0x2d')]['password']=_0x114fa7['Smtp'][_0x9fa6('0x67')]=null;}_0x114fa7[_0x9fa6('0x2d')][_0x9fa6('0x69')]=_0x393e38[_0x9fa6('0x4e')][_0x9fa6('0x2d')]['host'];_0x114fa7['Imap'][_0x9fa6('0x6a')]=_0x393e38['body'][_0x9fa6('0x2d')][_0x9fa6('0x6a')];_0x114fa7['Smtp'][_0x9fa6('0x69')]=_0x393e38[_0x9fa6('0x4e')]['Smtp']['host'];_0x114fa7['Smtp'][_0x9fa6('0x6a')]=_0x393e38[_0x9fa6('0x4e')]['Smtp']['port'];}return db[_0x9fa6('0x45')][_0x9fa6('0x55')](_0x114fa7,{'include':[{'model':db[_0x9fa6('0x2e')],'as':_0x9fa6('0x50')},{'model':db[_0x9fa6('0x2c')],'as':_0x9fa6('0x2d')}]})[_0x9fa6('0x25')](function(_0x5c2e1e){var _0xedb831=_0x393e38[_0x9fa6('0x65')][_0x9fa6('0x27')]({'plain':!![]});if(!_0xedb831)throw new Error(_0x9fa6('0x6c'));if(_0xedb831['role']===_0x9fa6('0x65')){var _0x30ff7c=_0x5c2e1e[_0x9fa6('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x9fa6('0x4d')]({'where':{'name':_0x9fa6('0x28'),'userProfileId':_0xedb831[_0x9fa6('0x6d')]},'raw':!![]})[_0x9fa6('0x25')](function(_0x4fc341){if(_0x4fc341&&_0x4fc341[_0x9fa6('0x6e')]===0x0){return db[_0x9fa6('0x6f')][_0x9fa6('0x55')]({'name':_0x30ff7c[_0x9fa6('0x2a')],'resourceId':_0x30ff7c['id'],'type':_0x4fc341[_0x9fa6('0x2a')],'sectionId':_0x4fc341['id']},{})[_0x9fa6('0x25')](function(){return _0x5c2e1e;});}else{return _0x5c2e1e;}})[_0x9fa6('0x1b')](function(_0x353e4d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353e4d);throw _0x353e4d;});}return _0x5c2e1e;})[_0x9fa6('0x25')](respondWithResult(_0x393289,0xc9))['catch'](handleError(_0x393289,null));};exports[_0x9fa6('0x70')]=function(_0x5ab676,_0x17ba2d){return db[_0x9fa6('0x45')][_0x9fa6('0x56')]({'where':{'id':_0x5ab676[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x17ba2d,null))['then'](function(_0x295d3d){if(_0x295d3d){return _0x295d3d[_0x9fa6('0x70')]();}return null;})[_0x9fa6('0x25')](respondWithResult(_0x17ba2d,null))[_0x9fa6('0x1b')](handleError(_0x17ba2d,null));};exports[_0x9fa6('0x71')]=function(_0x467ffb,_0x210e05){if(_0x467ffb['body']['id']){delete _0x467ffb['body']['id'];}return db[_0x9fa6('0x45')]['find']({'where':{'id':_0x467ffb[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x210e05,null))[_0x9fa6('0x25')](function(_0x4b6d93){if(_0x4b6d93){_0x467ffb[_0x9fa6('0x4e')][_0x9fa6('0x57')]=_0x4b6d93['id'];return db[_0x9fa6('0x2c')]['create'](_0x467ffb[_0x9fa6('0x4e')]);}})[_0x9fa6('0x25')](respondWithResult(_0x210e05,null))['catch'](handleError(_0x210e05,null));};exports['removeImap']=function(_0x1cc591,_0x412be8){return db['MailAccount']['findOne']({'where':{'id':_0x1cc591['params']['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x412be8,null))[_0x9fa6('0x25')](function(_0x1d6c08){if(_0x1d6c08){return _0x1d6c08[_0x9fa6('0x72')](null);}return null;})[_0x9fa6('0x25')](respondWithStatusCode(_0x412be8,null))[_0x9fa6('0x1b')](handleError(_0x412be8,null));};exports[_0x9fa6('0x73')]=function(_0x44ef0a,_0x11ed9d){return db[_0x9fa6('0x45')]['findOne']({'where':{'id':_0x44ef0a[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x11ed9d,null))[_0x9fa6('0x25')](function(_0x4cf181){if(_0x4cf181){return _0x4cf181[_0x9fa6('0x73')]();}return null;})[_0x9fa6('0x25')](respondWithResult(_0x11ed9d,null))['catch'](handleError(_0x11ed9d,null));};exports[_0x9fa6('0x74')]=function(_0x50c501,_0x15ae4e){if(_0x50c501[_0x9fa6('0x4e')]['id']){delete _0x50c501[_0x9fa6('0x4e')]['id'];}return db[_0x9fa6('0x45')][_0x9fa6('0x4d')]({'where':{'id':_0x50c501[_0x9fa6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15ae4e,null))[_0x9fa6('0x25')](function(_0xf3897f){if(_0xf3897f){_0x50c501[_0x9fa6('0x4e')][_0x9fa6('0x57')]=_0xf3897f['id'];return db[_0x9fa6('0x2e')][_0x9fa6('0x55')](_0x50c501[_0x9fa6('0x4e')]);}})[_0x9fa6('0x25')](respondWithResult(_0x15ae4e,null))[_0x9fa6('0x1b')](handleError(_0x15ae4e,null));};exports[_0x9fa6('0x75')]=function(_0x87445,_0x4bf8a9){return db['MailAccount'][_0x9fa6('0x56')]({'where':{'id':_0x87445[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x4bf8a9,null))[_0x9fa6('0x25')](function(_0x3459a9){if(_0x3459a9){return _0x3459a9[_0x9fa6('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x4bf8a9,null))['catch'](handleError(_0x4bf8a9,null));};exports[_0x9fa6('0x77')]=function(_0x28ea3d,_0x420fd1){return db[_0x9fa6('0x78')][_0x9fa6('0x4d')]({'where':{'id':_0x28ea3d[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x420fd1,null))[_0x9fa6('0x25')](function(_0x1cd0d2){if(_0x1cd0d2){return _0x1cd0d2[_0x9fa6('0x77')](_0x28ea3d[_0x9fa6('0x4e')]['ids'],_[_0x9fa6('0x79')](_0x28ea3d[_0x9fa6('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x420fd1,null))[_0x9fa6('0x1b')](handleError(_0x420fd1,null));};exports[_0x9fa6('0x7a')]=function(_0x29f538,_0x51a599){var _0x4dc17c={'raw':![],'where':{}};var _0x813e86={};var _0x5696ab={'count':0x0,'rows':[]};return db[_0x9fa6('0x45')][_0x9fa6('0x56')]({'where':{'id':_0x29f538[_0x9fa6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51a599,null))[_0x9fa6('0x25')](function(_0x3b7c2a){if(_0x3b7c2a){_0x813e86['model']=_[_0x9fa6('0x36')](db[_0x9fa6('0x78')][_0x9fa6('0x4b')]);_0x813e86[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0x29f538['query']);_0x813e86['filters']=_[_0x9fa6('0x38')](_0x813e86[_0x9fa6('0x34')],_0x813e86[_0x9fa6('0x3b')]);_0x4dc17c['attributes']=_['intersection'](_0x813e86['model'],qs[_0x9fa6('0x3a')](_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x3a')]));_0x4dc17c['attributes']=_0x4dc17c[_0x9fa6('0x39')][_0x9fa6('0x3c')]?_0x4dc17c[_0x9fa6('0x39')]:_0x813e86[_0x9fa6('0x34')];if(!_0x29f538[_0x9fa6('0x3b')]['hasOwnProperty'](_0x9fa6('0x5c'))){_0x4dc17c[_0x9fa6('0x20')]=qs['limit'](_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x20')]);_0x4dc17c[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x1f')]);}_0x4dc17c[_0x9fa6('0x3e')]=qs[_0x9fa6('0x3f')](_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x4dc17c[_0x9fa6('0x42')]=qs[_0x9fa6('0x37')](_['pick'](_0x29f538[_0x9fa6('0x3b')],_0x813e86['filters']));_0x4dc17c[_0x9fa6('0x42')][_0x9fa6('0x57')]=_0x3b7c2a['id'];if(_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x41')]){_0x4dc17c[_0x9fa6('0x42')]=_[_0x9fa6('0x43')](_0x4dc17c[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x4dc17c[_0x9fa6('0x39')],function(_0x52a944){var _0x1eda7c={};_0x1eda7c[_0x52a944]={'$like':'%'+_0x29f538['query'][_0x9fa6('0x41')]+'%'};return _0x1eda7c;})});}_0x4dc17c=_[_0x9fa6('0x43')]({},_0x4dc17c,_0x29f538[_0x9fa6('0x4c')]);return db[_0x9fa6('0x78')][_0x9fa6('0x46')]({'where':_0x4dc17c[_0x9fa6('0x42')]})[_0x9fa6('0x25')](function(_0x4dd8aa){_0x5696ab[_0x9fa6('0x46')]=_0x4dd8aa;if(_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x47')]){_0x4dc17c[_0x9fa6('0x58')]=[{'model':db[_0x9fa6('0x7b')],'as':_0x9fa6('0x7c'),'required':![]},{'model':db[_0x9fa6('0x7d')],'as':_0x9fa6('0x7e'),'attributes':['name','fullname',_0x9fa6('0x7f')],'required':![]},{'model':db[_0x9fa6('0x80')],'as':'Tags','attributes':['id','name','color'],'where':_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x81')]?{'id':_0x29f538[_0x9fa6('0x3b')][_0x9fa6('0x81')]}:undefined,'required':_0x29f538[_0x9fa6('0x3b')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x4dc17c);})[_0x9fa6('0x25')](function(_0x5ec996){_0x5696ab['rows']=_0x5ec996;return _0x5696ab;});}})[_0x9fa6('0x25')](respondWithFilteredResult(_0x51a599,_0x4dc17c))[_0x9fa6('0x1b')](handleError(_0x51a599,null));};exports[_0x9fa6('0x82')]=function addApplications(_0x16ab5c,_0x17645a){var _0x18def3=_0x16ab5c[_0x9fa6('0x4a')]['id'];var _0x4fac44=_0x16ab5c[_0x9fa6('0x4e')];var _0x485dbf=0xc8;var _0x477c33=null;return db['sequelize'][_0x9fa6('0x83')]({'isolationLevel':db['sequelize'][_0x9fa6('0x84')][_0x9fa6('0x85')][_0x9fa6('0x86')]},function(_0x5cd26c){return db[_0x9fa6('0x45')]['findOne']({'where':{'id':_0x18def3},'transaction':_0x5cd26c})[_0x9fa6('0x25')](function(_0x2d7d25){if(_0x2d7d25){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x18def3},'transaction':_0x5cd26c})[_0x9fa6('0x25')](function(){var _0x223901=_[_0x9fa6('0x35')](_0x4fac44,function(_0x15e1cd){_0x15e1cd[_0x9fa6('0x57')]=_0x18def3;return _0x15e1cd;});return db['MailApplication'][_0x9fa6('0x87')](_0x223901,{'transaction':_0x5cd26c});});}else{_0x485dbf=0x194;_0x477c33=[];}});})[_0x9fa6('0x25')](function(){if(_0x485dbf!==0x194){return db[_0x9fa6('0x88')][_0x9fa6('0x89')]({'where':{'MailAccountId':_0x18def3},'order':_0x9fa6('0x8a')})[_0x9fa6('0x25')](function(_0x39c24c){_0x477c33=_0x39c24c;});}})['catch'](function(_0x5a9155){_0x485dbf=0x1f4;logger['error'](_0x5a9155[_0x9fa6('0x8b')]);if(_0x5a9155[_0x9fa6('0x2a')]){delete _0x5a9155[_0x9fa6('0x2a')];}_0x477c33=_0x5a9155;})[_0x9fa6('0x8c')](function(){if(_0x477c33===null){_0x17645a[_0x9fa6('0x29')](_0x485dbf);}else{if(_0x485dbf===0x1f4){_0x17645a[_0x9fa6('0x1c')](_0x485dbf)['send'](_0x477c33);}else{_0x17645a[_0x9fa6('0x1c')](_0x485dbf)[_0x9fa6('0x1e')](_0x477c33);}}});};exports[_0x9fa6('0x8d')]=function(_0xe83fbc,_0x17858a){var _0x57a3f7={};var _0x81c760={};var _0x42ef60;var _0x515389;return db[_0x9fa6('0x45')][_0x9fa6('0x56')]({'where':{'id':_0xe83fbc[_0x9fa6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x17858a,null))[_0x9fa6('0x25')](function(_0xff4262){if(_0xff4262){_0x42ef60=_0xff4262;_0x81c760[_0x9fa6('0x34')]=_[_0x9fa6('0x36')](db[_0x9fa6('0x88')][_0x9fa6('0x4b')]);_0x81c760[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0xe83fbc[_0x9fa6('0x3b')]);_0x81c760[_0x9fa6('0x37')]=_[_0x9fa6('0x38')](_0x81c760[_0x9fa6('0x34')],_0x81c760[_0x9fa6('0x3b')]);_0x57a3f7[_0x9fa6('0x39')]=_[_0x9fa6('0x38')](_0x81c760[_0x9fa6('0x34')],qs['fields'](_0xe83fbc[_0x9fa6('0x3b')][_0x9fa6('0x3a')]));_0x57a3f7[_0x9fa6('0x39')]=_0x57a3f7[_0x9fa6('0x39')][_0x9fa6('0x3c')]?_0x57a3f7[_0x9fa6('0x39')]:_0x81c760['model'];_0x57a3f7[_0x9fa6('0x3e')]=qs['sort'](_0xe83fbc[_0x9fa6('0x3b')]['sort']);_0x57a3f7['where']=qs[_0x9fa6('0x37')](_[_0x9fa6('0x40')](_0xe83fbc['query'],_0x81c760[_0x9fa6('0x37')]));if(_0xe83fbc[_0x9fa6('0x3b')]['filter']){_0x57a3f7[_0x9fa6('0x42')]=_[_0x9fa6('0x43')](_0x57a3f7[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x57a3f7['attributes'],function(_0x2679bf){var _0x1b8ad3={};_0x1b8ad3[_0x2679bf]={'$like':'%'+_0xe83fbc[_0x9fa6('0x3b')]['filter']+'%'};return _0x1b8ad3;})});}_0x57a3f7=_['merge']({},_0x57a3f7,_0xe83fbc[_0x9fa6('0x4c')]);return _0x42ef60[_0x9fa6('0x8d')](_0x57a3f7);}})[_0x9fa6('0x25')](function(_0xb34ad9){if(_0xb34ad9){_0x515389=_0xb34ad9[_0x9fa6('0x3c')];if(!_0xe83fbc['query'][_0x9fa6('0x3d')]('nolimit')){_0x57a3f7[_0x9fa6('0x20')]=qs[_0x9fa6('0x20')](_0xe83fbc[_0x9fa6('0x3b')]['limit']);_0x57a3f7[_0x9fa6('0x1f')]=qs[_0x9fa6('0x1f')](_0xe83fbc['query'][_0x9fa6('0x1f')]);}return _0x42ef60[_0x9fa6('0x8d')](_0x57a3f7);}})[_0x9fa6('0x25')](function(_0x5322f1){if(_0x5322f1){return _0x5322f1?{'count':_0x515389,'rows':_0x5322f1}:null;}})[_0x9fa6('0x25')](respondWithResult(_0x17858a,null))[_0x9fa6('0x1b')](handleError(_0x17858a,null));};exports[_0x9fa6('0x8e')]=function(_0x240d37,_0x27fe06){var _0x32cf9e={'raw':!![],'where':{}};var _0x4243bd={};var _0x2db055={'count':0x0,'rows':[]};return db[_0x9fa6('0x45')]['findOne']({'where':{'id':_0x240d37[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x27fe06,null))[_0x9fa6('0x25')](function(_0x9ddfc8){if(_0x9ddfc8){_0x4243bd[_0x9fa6('0x34')]=_[_0x9fa6('0x36')](db[_0x9fa6('0x8f')][_0x9fa6('0x4b')]);_0x4243bd[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0x240d37[_0x9fa6('0x3b')]);_0x4243bd[_0x9fa6('0x37')]=_[_0x9fa6('0x38')](_0x4243bd[_0x9fa6('0x34')],_0x4243bd['query']);_0x32cf9e[_0x9fa6('0x39')]=_['intersection'](_0x4243bd['model'],qs[_0x9fa6('0x3a')](_0x240d37[_0x9fa6('0x3b')]['fields']));_0x32cf9e[_0x9fa6('0x39')]=_0x32cf9e['attributes']['length']?_0x32cf9e['attributes']:_0x4243bd[_0x9fa6('0x34')];if(!_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x3d')]('nolimit')){_0x32cf9e[_0x9fa6('0x20')]=qs[_0x9fa6('0x20')](_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x20')]);_0x32cf9e['offset']=qs[_0x9fa6('0x1f')](_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x1f')]);}_0x32cf9e['order']=qs[_0x9fa6('0x3f')](_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x32cf9e[_0x9fa6('0x42')]=qs[_0x9fa6('0x37')](_[_0x9fa6('0x40')](_0x240d37[_0x9fa6('0x3b')],_0x4243bd[_0x9fa6('0x37')]));_0x32cf9e[_0x9fa6('0x42')][_0x9fa6('0x57')]=_0x9ddfc8['id'];if(_0x240d37[_0x9fa6('0x3b')]['filter']){_0x32cf9e[_0x9fa6('0x42')]=_[_0x9fa6('0x43')](_0x32cf9e[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x32cf9e[_0x9fa6('0x39')],function(_0x3a5afc){var _0x323981={};_0x323981[_0x3a5afc]={'$like':'%'+_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x41')]+'%'};return _0x323981;})});}if(_0x240d37['query'][_0x9fa6('0x90')]){var _0x14407b=_0x240d37[_0x9fa6('0x3b')]['$gte'][_0x9fa6('0x91')](',');var _0x1b5b5c={};_0x1b5b5c[_0x14407b[0x0]]={'$gte':moment(_0x14407b[0x1])[_0x9fa6('0x92')](_0x9fa6('0x93'))};_0x32cf9e[_0x9fa6('0x42')]=_['merge'](_0x32cf9e['where'],_0x1b5b5c);}_0x32cf9e=_[_0x9fa6('0x43')]({},_0x32cf9e,_0x240d37[_0x9fa6('0x4c')]);return db[_0x9fa6('0x8f')][_0x9fa6('0x46')]({'where':_0x32cf9e[_0x9fa6('0x42')]})['then'](function(_0x3f6d35){_0x2db055[_0x9fa6('0x46')]=_0x3f6d35;if(_0x240d37[_0x9fa6('0x3b')][_0x9fa6('0x47')]){_0x32cf9e[_0x9fa6('0x58')]=[{'all':!![]}];}return db[_0x9fa6('0x8f')]['findAll'](_0x32cf9e);})['then'](function(_0x2c8f19){if(_0x240d37[_0x9fa6('0x3b')]['inlineCss']===_0x9fa6('0x94')){for(var _0x224bd0=0x0;_0x224bd0<_0x2c8f19[_0x9fa6('0x3c')];_0x224bd0++){_0x2c8f19[_0x224bd0][_0x9fa6('0x4e')]=juice(_0x2c8f19[_0x224bd0][_0x9fa6('0x4e')]);}}_0x2db055[_0x9fa6('0x49')]=_0x2c8f19;return _0x2db055;});}})[_0x9fa6('0x25')](respondWithFilteredResult(_0x27fe06,_0x32cf9e))[_0x9fa6('0x1b')](handleError(_0x27fe06,null));};exports[_0x9fa6('0x95')]=function(_0x278dfe,_0x41ea52){var _0x41f01a,_0x259be1={},_0x36dee7;if(_0x278dfe[_0x9fa6('0x4e')]['to']){_0x36dee7=_0x278dfe[_0x9fa6('0x4e')]['to']['split'](',')[0x0];}return db[_0x9fa6('0x45')][_0x9fa6('0x4d')]({'where':{'id':_0x278dfe[_0x9fa6('0x4a')]['id']},'include':[{'model':db[_0x9fa6('0x96')],'as':_0x9fa6('0x97'),'include':[{'model':db[_0x9fa6('0x7b')],'as':_0x9fa6('0x98'),'where':{'email':_0x36dee7},'limit':0x1,'order':[[_0x9fa6('0x99'),_0x9fa6('0x9a')]]}]},{'model':db[_0x9fa6('0x2e')],'as':_0x9fa6('0x50'),'raw':!![]}]})['then'](handleEntityNotFound(_0x41ea52,null))[_0x9fa6('0x25')](function(_0x4f61de){if(_0x4f61de){_0x41f01a=_0x4f61de;if(_0x4f61de[_0x9fa6('0x50')]){if(_['isNil'](_0x278dfe['body']['from'])){_0x278dfe[_0x9fa6('0x4e')]['from']=util[_0x9fa6('0x92')]('%s\x20<%s>',_0x4f61de[_0x9fa6('0x2a')],_0x4f61de[_0x9fa6('0x60')]||_0x4f61de['Smtp'][_0x9fa6('0x65')]);}if(_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0x9b')]&&_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0x9b')][_0x9fa6('0x3c')]){for(var _0x4b7da5=0x0;_0x4b7da5<_0x278dfe[_0x9fa6('0x4e')]['attachments']['length'];_0x4b7da5+=0x1){_0x278dfe['body']['attachments'][_0x4b7da5]={'filename':_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0x9b')][_0x4b7da5][_0x9fa6('0x2a')],'path':path[_0x9fa6('0x9c')](config['root'],_0x9fa6('0x9d'),_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0x9b')][_0x4b7da5][_0x9fa6('0x9e')])};}}var _0xb62b74={'tls':{'rejectUnauthorized':![]}};if(_[_0x9fa6('0x62')](_0x4f61de[_0x9fa6('0x50')][_0x9fa6('0x68')])){if(_0x4f61de[_0x9fa6('0x50')][_0x9fa6('0x6b')]){_0xb62b74[_0x9fa6('0x9f')]={'user':_0x4f61de[_0x9fa6('0x50')]['user'],'pass':_0x4f61de[_0x9fa6('0x50')][_0x9fa6('0x67')]};}_0xb62b74[_0x9fa6('0x69')]=_0x4f61de[_0x9fa6('0x50')]['host'];_0xb62b74[_0x9fa6('0x6a')]=_0x4f61de['Smtp'][_0x9fa6('0x6a')];_0xb62b74[_0x9fa6('0xa0')]=_0x4f61de['Smtp'][_0x9fa6('0xa0')];}else{_0xb62b74[_0x9fa6('0x68')]=_0x4f61de[_0x9fa6('0x50')]['service'];_0xb62b74['auth']={'user':_0x4f61de[_0x9fa6('0x50')][_0x9fa6('0x65')],'pass':_0x4f61de[_0x9fa6('0x50')][_0x9fa6('0x67')]};}return respondWithRpcPromise(_0x9fa6('0xa1'),_0x9fa6('0xa2'),{'account':_0xb62b74,'message':_0x278dfe[_0x9fa6('0x4e')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x33214d){if(_0x33214d){_0x259be1=_0x33214d;if(_0x41f01a[_0x9fa6('0x97')]){if(_0x41f01a['List'][_0x9fa6('0x98')][_0x9fa6('0x3c')]){return _0x41f01a[_0x9fa6('0x97')]['Contacts'][0x0];}else{return db[_0x9fa6('0x7b')]['create'](_[_0x9fa6('0xa')](_0x278dfe[_0x9fa6('0x4e')],{'firstName':_0x278dfe[_0x9fa6('0x4e')]['to'],'email':_0x278dfe[_0x9fa6('0x4e')]['to'],'phone':_0x278dfe[_0x9fa6('0x4e')]['to'],'ListId':_0x41f01a[_0x9fa6('0x61')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x1e9960){if(_0x1e9960){var _0x19b617={'UserId':_0x278dfe['user']['id'],'ContactId':_0x1e9960['id'],'MailAccountId':_0x41f01a['id'],'inReplyTo':_0x259be1[_0x9fa6('0xa3')],'to':_0x278dfe['body'][_0x9fa6('0xa4')],'cc':_0x278dfe[_0x9fa6('0x4e')]['cc'],'subject':_0x278dfe['body'][_0x9fa6('0xa5')],'attach':_0x278dfe['body'][_0x9fa6('0xa6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9fa6('0x92')](_0x9fa6('0x93')),'lastMsgDirection':_0x9fa6('0xa7'),'Messages':[_[_0x9fa6('0x43')](_0x278dfe[_0x9fa6('0x4e')],{'messageId':_0x259be1['messageId'],'sentAt':moment()[_0x9fa6('0x92')](_0x9fa6('0x93')),'read':!![],'MailAccountId':_0x41f01a['id'],'UserId':_0x278dfe[_0x9fa6('0x65')]['id'],'ContactId':_0x1e9960['id']})]};if(_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0xa8')]){_0x19b617=_['merge'](_0x19b617,_0x278dfe[_0x9fa6('0x4e')][_0x9fa6('0xa8')]);}return db[_0x9fa6('0x78')][_0x9fa6('0x55')](_0x19b617,{'include':[{'model':db[_0x9fa6('0x8f')],'as':_0x9fa6('0xa9')}]});}})['then'](respondWithResult(_0x41ea52,null))['catch'](handleError(_0x41ea52,null));};exports[_0x9fa6('0xaa')]=function(_0x6280ff,_0x4674e3){return db[_0x9fa6('0x45')]['find']({'where':{'id':_0x6280ff[_0x9fa6('0x4a')]['id']},'include':[{'model':db[_0x9fa6('0x2e')],'as':_0x9fa6('0x50'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9fa6('0xab'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4674e3,null))['then'](function(_0x28b55e){if(!_0x28b55e[_0x9fa6('0x50')])return;var _0x46e6db={'id':_0x28b55e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x28b55e[_0x9fa6('0x5e')]!==_0x9fa6('0x5f')){_0x46e6db[_0x9fa6('0x68')]=_0x28b55e[_0x9fa6('0x5e')];}else{_0x46e6db[_0x9fa6('0x69')]=_0x28b55e[_0x9fa6('0x50')]['host'];_0x46e6db[_0x9fa6('0x6a')]=_0x28b55e[_0x9fa6('0x50')][_0x9fa6('0x6a')];_0x46e6db['secure']=_0x28b55e[_0x9fa6('0x50')][_0x9fa6('0xa0')];}if(_0x28b55e['Smtp'][_0x9fa6('0x6b')]){if(_0x28b55e[_0x9fa6('0x50')]['modernAuthentication']){_0x46e6db['auth']={'type':_0x9fa6('0xac'),'user':_0x28b55e[_0x9fa6('0x50')]['user'],'accessToken':_0x28b55e['Smtp'][_0x9fa6('0xab')]['data5']};}else{_0x46e6db[_0x9fa6('0x9f')]={'user':_0x28b55e['Smtp'][_0x9fa6('0x65')],'pass':_0x28b55e[_0x9fa6('0x50')][_0x9fa6('0x67')]};}}return respondWithRpcPromise('VerifySmtp',_0x9fa6('0xaa'),{'account':_0x46e6db});})['then'](respondWithResult(_0x4674e3,null))['catch'](handleError(_0x4674e3,null));};exports[_0x9fa6('0x26')]=function(_0x2412e1,_0x4519c4){return db[_0x9fa6('0x45')][_0x9fa6('0x4d')]({'where':{'id':_0x2412e1[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x4519c4,null))[_0x9fa6('0x25')](function(_0x4f0150){if(_0x4f0150&&_0x4f0150[_0x9fa6('0x68')]){throw new db[(_0x9fa6('0xad'))][(_0x9fa6('0xae'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4f0150;})[_0x9fa6('0x25')](removeEntity(_0x4519c4,null))[_0x9fa6('0x1b')](handleError(_0x4519c4,null));};exports[_0x9fa6('0xaf')]=function(_0x5db99f,_0x3c4291){return db[_0x9fa6('0x45')][_0x9fa6('0x4d')]({'where':{'id':_0x5db99f['params']['id']}})['then'](handleEntityNotFound(_0x3c4291,null))[_0x9fa6('0x25')](function(_0x1cf32d){if(_0x1cf32d){return _0x1cf32d[_0x9fa6('0xaf')](_0x5db99f['body'][_0x9fa6('0xb0')],_[_0x9fa6('0x79')](_0x5db99f[_0x9fa6('0x4e')],[_0x9fa6('0xb0'),'id'])||{})[_0x9fa6('0xb1')](function(_0x3480ac){for(var _0x1053ec=0x0;_0x1053ec<_0x5db99f[_0x9fa6('0x4e')][_0x9fa6('0xb0')]['length'];_0x1053ec+=0x1){socket[_0x9fa6('0xb2')](_0x9fa6('0xb3'),{'UserId':Number(_0x5db99f[_0x9fa6('0x4e')][_0x9fa6('0xb0')][_0x1053ec]),'MailAccountId':Number(_0x5db99f[_0x9fa6('0x4a')]['id'])});}return _0x3480ac;});}})['then'](respondWithResult(_0x3c4291,null))[_0x9fa6('0x1b')](handleError(_0x3c4291,null));};exports[_0x9fa6('0xb4')]=function(_0x5d0672,_0x27def4){return db[_0x9fa6('0x45')]['find']({'where':{'id':_0x5d0672[_0x9fa6('0x4a')]['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x27def4,null))[_0x9fa6('0x25')](function(_0x3d8149){if(_0x3d8149){return _0x3d8149[_0x9fa6('0xb4')](_0x5d0672[_0x9fa6('0x3b')][_0x9fa6('0xb0')])[_0x9fa6('0x25')](function(){if(_[_0x9fa6('0xb5')](_0x5d0672[_0x9fa6('0x3b')][_0x9fa6('0xb0')])){for(var _0x9bffc9=0x0;_0x9bffc9<_0x5d0672[_0x9fa6('0x3b')][_0x9fa6('0xb0')][_0x9fa6('0x3c')];_0x9bffc9+=0x1){socket[_0x9fa6('0xb2')](_0x9fa6('0xb6'),{'UserId':Number(_0x5d0672[_0x9fa6('0x3b')]['ids'][_0x9bffc9]),'MailAccountId':Number(_0x5d0672[_0x9fa6('0x4a')]['id'])});}}else{socket[_0x9fa6('0xb2')](_0x9fa6('0xb6'),{'UserId':Number(_0x5d0672[_0x9fa6('0x3b')][_0x9fa6('0xb0')]),'MailAccountId':Number(_0x5d0672[_0x9fa6('0x4a')]['id'])});}});}})[_0x9fa6('0x25')](respondWithStatusCode(_0x27def4,null))[_0x9fa6('0x1b')](handleError(_0x27def4,null));};exports[_0x9fa6('0xb7')]=function(_0x395730,_0x523bcc){var _0x2bf96b={};var _0x11eaa1={};var _0x20a1aa;var _0x170a9d;return db[_0x9fa6('0x45')]['findOne']({'where':{'id':_0x395730['params']['id']}})[_0x9fa6('0x25')](handleEntityNotFound(_0x523bcc,null))[_0x9fa6('0x25')](function(_0x587f53){if(_0x587f53){_0x20a1aa=_0x587f53;_0x11eaa1[_0x9fa6('0x34')]=_[_0x9fa6('0x36')](db[_0x9fa6('0x7d')]['rawAttributes']);_0x11eaa1[_0x9fa6('0x3b')]=_[_0x9fa6('0x36')](_0x395730[_0x9fa6('0x3b')]);_0x11eaa1['filters']=_['intersection'](_0x11eaa1[_0x9fa6('0x34')],_0x11eaa1[_0x9fa6('0x3b')]);_0x2bf96b[_0x9fa6('0x39')]=_['intersection'](_0x11eaa1[_0x9fa6('0x34')],qs[_0x9fa6('0x3a')](_0x395730['query'][_0x9fa6('0x3a')]));_0x2bf96b['attributes']=_0x2bf96b['attributes'][_0x9fa6('0x3c')]?_0x2bf96b[_0x9fa6('0x39')]:_0x11eaa1[_0x9fa6('0x34')];_0x2bf96b['order']=qs[_0x9fa6('0x3f')](_0x395730[_0x9fa6('0x3b')][_0x9fa6('0x3f')]);_0x2bf96b[_0x9fa6('0x42')]=qs['filters'](_['pick'](_0x395730[_0x9fa6('0x3b')],_0x11eaa1[_0x9fa6('0x37')]));if(_0x395730['query'][_0x9fa6('0x41')]){_0x2bf96b['where']=_[_0x9fa6('0x43')](_0x2bf96b[_0x9fa6('0x42')],{'$or':_[_0x9fa6('0x35')](_0x2bf96b[_0x9fa6('0x39')],function(_0x4503cf){var _0x240c45={};_0x240c45[_0x4503cf]={'$like':'%'+_0x395730[_0x9fa6('0x3b')]['filter']+'%'};return _0x240c45;})});}_0x2bf96b=_['merge']({},_0x2bf96b,_0x395730[_0x9fa6('0x4c')]);return _0x20a1aa[_0x9fa6('0xb7')](_0x2bf96b);}})['then'](function(_0x4637de){if(_0x4637de){_0x170a9d=_0x4637de[_0x9fa6('0x3c')];if(!_0x395730['query'][_0x9fa6('0x3d')](_0x9fa6('0x5c'))){_0x2bf96b['limit']=qs[_0x9fa6('0x20')](_0x395730[_0x9fa6('0x3b')][_0x9fa6('0x20')]);_0x2bf96b['offset']=qs[_0x9fa6('0x1f')](_0x395730[_0x9fa6('0x3b')]['offset']);}return _0x20a1aa['getAgents'](_0x2bf96b);}})[_0x9fa6('0x25')](function(_0x39d8fe){if(_0x39d8fe){return _0x39d8fe?{'count':_0x170a9d,'rows':_0x39d8fe}:null;}})[_0x9fa6('0x25')](respondWithResult(_0x523bcc,null))['catch'](handleError(_0x523bcc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e2ae7d0..407bb17 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 _0xbf07=['hook','exports','events','MailAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x51e8d0,_0x1fe6cf){var _0x451174=function(_0x241802){while(--_0x241802){_0x51e8d0['push'](_0x51e8d0['shift']());}};_0x451174(++_0x1fe6cf);}(_0xbf07,0x17a));var _0x7bf0=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xbf07[_0x26fc81];return _0x9feece;};'use strict';var EventEmitter=require(_0x7bf0('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x7bf0('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7bf0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7bf0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44f677){return function(_0x57f19e,_0x21f58c,_0x1c7d51){MailAccountEvents[_0x7bf0('0x4')](_0x44f677+':'+_0x57f19e['id'],_0x57f19e);MailAccountEvents['emit'](_0x44f677,_0x57f19e);_0x1c7d51(null);};}for(var e in events){if(events[_0x7bf0('0x5')](e)){var event=events[e];MailAccount[_0x7bf0('0x6')](e,emitEvent(event));}}module[_0x7bf0('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x9851=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9851,0x1f1));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1985('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x1985('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1985('0x2')](0x0);var events={'afterCreate':_0x1985('0x3'),'afterUpdate':_0x1985('0x4'),'afterDestroy':_0x1985('0x5')};function emitEvent(_0x2a6e0e){return function(_0x3a21f1,_0x1fd90c,_0x41df88){MailAccountEvents[_0x1985('0x6')](_0x2a6e0e+':'+_0x3a21f1['id'],_0x3a21f1);MailAccountEvents['emit'](_0x2a6e0e,_0x3a21f1);_0x41df88(null);};}for(var e in events){if(events[_0x1985('0x7')](e)){var event=events[e];MailAccount[_0x1985('0x8')](e,emitEvent(event));}}module[_0x1985('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 855c515..53f2caf 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 _0xb785=['MailAccount','mail_accounts','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1e5111,_0x3d0a12){var _0x2a6bb9=function(_0x3adf85){while(--_0x3adf85){_0x1e5111['push'](_0x1e5111['shift']());}};_0x2a6bb9(++_0x3d0a12);}(_0xb785,0x1ba));var _0x5b78=function(_0x382883,_0x3b3326){_0x382883=_0x382883-0x0;var _0x56a70c=_0xb785[_0x382883];return _0x56a70c;};'use strict';var _=require(_0x5b78('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b78('0x1'));var BPromise=require(_0x5b78('0x2'));var rp=require(_0x5b78('0x3'));var fs=require('fs');var path=require(_0x5b78('0x4'));var rimraf=require(_0x5b78('0x5'));var config=require(_0x5b78('0x6'));var attributes=require('./mailAccount.attributes');module[_0x5b78('0x7')]=function(_0x9cb374,_0x133403){return _0x9cb374['define'](_0x5b78('0x8'),attributes,{'tableName':_0x5b78('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fe=['./mailAccount.attributes','define','util','api','moment','request-promise','path','../../config/environment'];(function(_0x2361fb,_0x547c8c){var _0x3932ea=function(_0x4f6f85){while(--_0x4f6f85){_0x2361fb['push'](_0x2361fb['shift']());}};_0x3932ea(++_0x547c8c);}(_0xd8fe,0xaa));var _0xed8f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd8fe[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0xed8f('0x0'));var logger=require('../../config/logger')(_0xed8f('0x1'));var moment=require(_0xed8f('0x2'));var BPromise=require('bluebird');var rp=require(_0xed8f('0x3'));var fs=require('fs');var path=require(_0xed8f('0x4'));var rimraf=require('rimraf');var config=require(_0xed8f('0x5'));var attributes=require(_0xed8f('0x6'));module['exports']=function(_0x11d7b3,_0x2cfb63){return _0x11d7b3[_0xed8f('0x7')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 823411f..95c7a9b 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 _0x0a29=['rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','priority','asc','autoclose','close','*,*,*,*','length','create','List\x20not\x20found','messageId','subject','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','format','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','startRouting','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','debug','mail','keys','CmContact'];(function(_0xd720d0,_0x2e05e6){var _0x7a2a44=function(_0x5c3d8b){while(--_0x5c3d8b){_0xd720d0['push'](_0xd720d0['shift']());}};_0x7a2a44(++_0x2e05e6);}(_0x0a29,0x1ce));var _0x90a2=function(_0xdb3239,_0x40b209){_0xdb3239=_0xdb3239-0x0;var _0x402a23=_0x0a29[_0xdb3239];return _0x402a23;};'use strict';var _=require(_0x90a2('0x0'));var util=require(_0x90a2('0x1'));var moment=require(_0x90a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a2('0x3'));var db=require(_0x90a2('0x4'))['db'];var utils=require(_0x90a2('0x5'));var logger=require(_0x90a2('0x6'))('rpc');var config=require(_0x90a2('0x7'));var jayson=require(_0x90a2('0x8'));var client=jayson['client'][_0x90a2('0x9')]({'port':0x232c});config[_0x90a2('0xa')]=_[_0x90a2('0xb')](config[_0x90a2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x90a2('0xc'))(new Redis(config[_0x90a2('0xa')]));require(_0x90a2('0xd'))[_0x90a2('0xe')](socket);function respondWithRpcPromise(_0x496b5f,_0x2c232b,_0x5d990e){return new BPromise(function(_0x50efdb,_0x367602){return client[_0x90a2('0xf')](_0x496b5f,_0x5d990e)[_0x90a2('0x10')](function(_0x2a654c){logger[_0x90a2('0x11')]('MailAccount,\x20%s,\x20%s',_0x2c232b,_0x90a2('0x12'));logger['debug'](_0x90a2('0x13'),_0x2c232b,_0x90a2('0x12'),JSON[_0x90a2('0x14')](_0x2a654c));if(_0x2a654c[_0x90a2('0x15')]){if(_0x2a654c[_0x90a2('0x15')][_0x90a2('0x16')]===0x1f4){logger[_0x90a2('0x15')](_0x90a2('0x17'),_0x2c232b,_0x2a654c[_0x90a2('0x15')]['message']);return _0x367602(_0x2a654c[_0x90a2('0x15')][_0x90a2('0x18')]);}logger[_0x90a2('0x15')](_0x90a2('0x17'),_0x2c232b,_0x2a654c[_0x90a2('0x15')][_0x90a2('0x18')]);return _0x50efdb(_0x2a654c[_0x90a2('0x15')][_0x90a2('0x18')]);}else{logger['info'](_0x90a2('0x17'),_0x2c232b,_0x90a2('0x12'));_0x50efdb(_0x2a654c['result'][_0x90a2('0x18')]);}})[_0x90a2('0x19')](function(_0x2c016a){logger[_0x90a2('0x15')](_0x90a2('0x17'),_0x2c232b,_0x2c016a);_0x367602(_0x2c016a);});});}exports['GetMailAccount']=function(_0x5c3016){var _0x2af3a4=this;return new Promise(function(_0x15b247,_0x242c1f){return db[_0x90a2('0x1a')][_0x90a2('0x1b')]({'raw':_0x5c3016[_0x90a2('0x1c')]?_0x5c3016[_0x90a2('0x1c')][_0x90a2('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c3016[_0x90a2('0x1c')]?_0x5c3016[_0x90a2('0x1c')][_0x90a2('0x1e')]||null:null,'attributes':_0x5c3016[_0x90a2('0x1c')]?_0x5c3016['options'][_0x90a2('0x1f')]||null:null,'limit':_0x5c3016[_0x90a2('0x1c')]?_0x5c3016[_0x90a2('0x1c')][_0x90a2('0x20')]||null:null,'include':_0x5c3016[_0x90a2('0x1c')]?_0x5c3016[_0x90a2('0x1c')][_0x90a2('0x21')]?_[_0x90a2('0x22')](_0x5c3016[_0x90a2('0x1c')][_0x90a2('0x21')],function(_0xc39be1){return{'model':db[_0xc39be1['model']],'as':_0xc39be1['as'],'attributes':_0xc39be1[_0x90a2('0x1f')],'include':_0xc39be1[_0x90a2('0x21')]?_[_0x90a2('0x22')](_0xc39be1['include'],function(_0x489fcd){return{'model':db[_0x489fcd[_0x90a2('0x23')]],'as':_0x489fcd['as'],'attributes':_0x489fcd['attributes'],'include':_0x489fcd[_0x90a2('0x21')]?_['map'](_0x489fcd[_0x90a2('0x21')],function(_0x372ced){return{'model':db[_0x372ced[_0x90a2('0x23')]],'as':_0x372ced['as'],'attributes':_0x372ced[_0x90a2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x90a2('0x10')](function(_0x8763d3){logger['info'](_0x90a2('0x24'),_0x5c3016);logger['debug']('GetMailAccount',_0x5c3016,JSON[_0x90a2('0x14')](_0x8763d3));_0x15b247(_0x8763d3);})[_0x90a2('0x19')](function(_0x371a97){logger[_0x90a2('0x15')](_0x90a2('0x24'),_0x371a97[_0x90a2('0x18')],_0x5c3016);_0x242c1f(_0x2af3a4[_0x90a2('0x15')](0x1f4,_0x371a97['message']));});});};exports[_0x90a2('0x25')]=function(_0x1d7da9){var _0x4a3505=this;return new Promise(function(_0x534667,_0x47b76d){return db[_0x90a2('0x1a')][_0x90a2('0x26')]({'raw':_0x1d7da9['options']?_0x1d7da9[_0x90a2('0x1c')][_0x90a2('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d7da9[_0x90a2('0x1c')]?_0x1d7da9[_0x90a2('0x1c')][_0x90a2('0x1e')]||null:null,'attributes':_0x1d7da9[_0x90a2('0x1c')]?_0x1d7da9['options'][_0x90a2('0x1f')]||null:null,'include':_0x1d7da9[_0x90a2('0x1c')]?_0x1d7da9[_0x90a2('0x1c')]['include']?_[_0x90a2('0x22')](_0x1d7da9[_0x90a2('0x1c')][_0x90a2('0x21')],function(_0x5829b6){return{'model':db[_0x5829b6['model']],'as':_0x5829b6['as'],'attributes':_0x5829b6[_0x90a2('0x1f')],'include':_0x5829b6['include']?_['map'](_0x5829b6['include'],function(_0x269bac){return{'model':db[_0x269bac['model']],'as':_0x269bac['as'],'attributes':_0x269bac[_0x90a2('0x1f')],'include':_0x269bac[_0x90a2('0x21')]?_['map'](_0x269bac[_0x90a2('0x21')],function(_0x937fd6){return{'model':db[_0x937fd6[_0x90a2('0x23')]],'as':_0x937fd6['as'],'attributes':_0x937fd6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c49e){logger[_0x90a2('0x11')](_0x90a2('0x25'),_0x1d7da9);logger[_0x90a2('0x27')]('ShowMailAccount',_0x1d7da9,JSON[_0x90a2('0x14')](_0x22c49e));_0x534667(_0x22c49e);})[_0x90a2('0x19')](function(_0x468aee){logger[_0x90a2('0x15')](_0x90a2('0x25'),_0x468aee[_0x90a2('0x18')],_0x1d7da9);_0x47b76d(_0x4a3505[_0x90a2('0x15')](0x1f4,_0x468aee['message']));});});};exports['NotifyMailAccount']=function(_0x14c1ea){var _0x15c184=this;return new Promise(function(_0x137b5f,_0x499e28){var _0x58cb2e={'body':_0x14c1ea['body'],'channel':_0x90a2('0x28')};var _0x2287be=_['difference'](_[_0x90a2('0x29')](db[_0x90a2('0x2a')][_0x90a2('0x2b')]),['createdAt',_0x90a2('0x2c'),_0x90a2('0x2d'),_0x90a2('0x2e')]);var _0xdd6f78=![];if(_0x14c1ea[_0x90a2('0x2f')]['id']){delete _0x14c1ea[_0x90a2('0x2f')]['id'];}if(_[_0x90a2('0x30')](_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x31')])){return _0x499e28(_0x15c184['error'](0x1f4,_0x90a2('0x32')));}if(_[_0x90a2('0x30')](_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x2f')])||_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x2f')]===''){return _0x499e28(_0x15c184[_0x90a2('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x90a2('0x30')](_0x14c1ea['body'][_0x90a2('0x33')])){return _0x499e28(_0x15c184[_0x90a2('0x15')](0x1f4,_0x90a2('0x34')+_0x2287be));}if(!_['includes'](_0x2287be,_0x14c1ea[_0x90a2('0x2f')]['mapKey'])){return _0x499e28(_0x15c184[_0x90a2('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2287be));}var _0x325a1c={};_0x325a1c[_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x33')]]=_0x14c1ea['body']['from'];return db[_0x90a2('0x1a')][_0x90a2('0x26')]({'where':{'id':_0x14c1ea[_0x90a2('0x35')]['id']},'include':[{'model':db[_0x90a2('0x36')],'as':'List','include':[{'model':db[_0x90a2('0x2a')],'as':_0x90a2('0x37'),'where':_0x325a1c,'limit':0x1,'order':[[_0x90a2('0x2c'),_0x90a2('0x38')]]}]},{'model':db['MailApplication'],'as':_0x90a2('0x39')},{'model':db[_0x90a2('0x3a')],'as':_0x90a2('0x3b')}]})[_0x90a2('0x10')](function(_0x20ce57){if(_0x20ce57&&_0x20ce57[_0x90a2('0x3c')]){var _0x2a09d1=_0x20ce57[_0x90a2('0x3d')]({'plain':!![]});_0x58cb2e[_0x90a2('0x35')]=_[_0x90a2('0x3e')](_0x2a09d1,[_0x90a2('0x39'),_0x90a2('0x3c')]);_0x58cb2e[_0x90a2('0x3f')]=_0x2a09d1[_0x90a2('0x39')];_0x58cb2e[_0x90a2('0x40')]=_0x2a09d1[_0x90a2('0x3c')];_0x58cb2e['applications']=_[_0x90a2('0x41')](_0x58cb2e[_0x90a2('0x3f')],[_0x90a2('0x42')],[_0x90a2('0x43')]);if(_0x58cb2e[_0x90a2('0x35')]&&_0x58cb2e['account'][_0x90a2('0x44')]){_0x58cb2e[_0x90a2('0x3f')]['push']({'id':0x0,'priority':_0x58cb2e[_0x90a2('0x3f')]['length']+0x1,'app':_0x90a2('0x45'),'appdata':_0x90a2('0x44'),'interval':_0x90a2('0x46')});}if(_0x58cb2e['account'][_0x90a2('0x39')]){delete _0x58cb2e['account']['Applications'];}if(_0x58cb2e[_0x90a2('0x35')]['List']){delete _0x58cb2e[_0x90a2('0x35')][_0x90a2('0x3c')];}if(_0x2a09d1[_0x90a2('0x3c')][_0x90a2('0x37')][_0x90a2('0x47')]){return _0x2a09d1[_0x90a2('0x3c')][_0x90a2('0x37')][0x0];}var _0x14b5a9=_[_0x90a2('0xb')](_0x14c1ea[_0x90a2('0x2f')],{'firstName':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x31')],'ListId':_0x2a09d1[_0x90a2('0x2e')]});_0x14b5a9[_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x33')]]=_0x14c1ea[_0x90a2('0x2f')]['from'];return db[_0x90a2('0x2a')][_0x90a2('0x48')](_0x14b5a9);}else{throw new Error(_0x90a2('0x49'));}})[_0x90a2('0x10')](function(_0x12c6d4){_0x58cb2e['contact']=_0x12c6d4;if(_0x12c6d4){if(!_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4a')]){_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4a')]=rs['generate']()+'\x20'+_0x14c1ea['body']['message'][_0x90a2('0x31')];}var _0x257936={'ContactId':_0x12c6d4['id'],'MailAccountId':_0x14c1ea[_0x90a2('0x35')]['id'],'inReplyTo':_0x14c1ea[_0x90a2('0x2f')]['message'][_0x90a2('0x4a')],'to':_0x14c1ea[_0x90a2('0x2f')]['message'][_0x90a2('0x31')],'cc':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')]['cc'],'subject':_0x14c1ea['body']['message'][_0x90a2('0x4b')],'attach':_0x14c1ea['body'][_0x90a2('0x18')]['attach'],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x90a2('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0x14c1ea[_0x90a2('0x35')]['id']},'include':[{'model':db[_0x90a2('0x4d')],'as':_0x90a2('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4f')]}}]})[_0x90a2('0x10')](function(_0x4b4e2a){if(_0x4b4e2a){return[_0x4b4e2a,![]];}return db[_0x90a2('0x4c')][_0x90a2('0x48')](_0x257936)['then'](function(_0x5b8156){return[_0x5b8156,!![]];});});}else{throw new Error(_0x90a2('0x50'));}})[_0x90a2('0x51')](function(_0x5a6c22,_0x1422cf){if(_0x5a6c22){_0xdd6f78=_0x1422cf;if(!_0x1422cf){return _0x5a6c22[_0x90a2('0x52')]({'inReplyTo':_0x14c1ea[_0x90a2('0x2f')]['message'][_0x90a2('0x4a')],'to':_0x14c1ea['body'][_0x90a2('0x18')][_0x90a2('0x31')],'cc':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')]['cc'],'subject':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4b')],'attach':_0x5a6c22['attach']?_0x5a6c22[_0x90a2('0x53')]:_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0x90a2('0x54')](_0x90a2('0x55')),'lastMsgAt':moment()[_0x90a2('0x54')](_0x90a2('0x55')),'lastMsgDirection':'in'});}else{return _0x5a6c22;}}})[_0x90a2('0x10')](function(_0x5d5d3f){_0x58cb2e[_0x90a2('0x56')]=_0x5d5d3f[_0x90a2('0x3d')]({'plain':!![]});_0x58cb2e[_0x90a2('0x56')]['created']=_0xdd6f78;return db[_0x90a2('0x4d')][_0x90a2('0x48')]({'body':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x2f')],'MailAccountId':_0x14c1ea[_0x90a2('0x35')]['id'],'MailInteractionId':_0x5d5d3f['id'],'direction':'in','ContactId':_0x58cb2e[_0x90a2('0x57')]['id'],'messageId':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4a')],'from':_0x14c1ea['body'][_0x90a2('0x18')]['from'],'to':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')]['to'],'cc':_0x14c1ea[_0x90a2('0x2f')]['message']['cc'],'subject':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x4b')],'attach':_0x14c1ea[_0x90a2('0x2f')]['message']['attach'],'Attachments':_0x14c1ea['body'][_0x90a2('0x18')]['attachments'],'originTo':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')]['originTo'],'originCc':_0x14c1ea['body'][_0x90a2('0x18')]['originCc'],'bcc':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x58')],'ChatWebsiteId':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x59')]||null,'originChannel':_0x14c1ea[_0x90a2('0x2f')][_0x90a2('0x18')][_0x90a2('0x5a')]||_0x90a2('0x5b'),'ChatOfflineMessageId':_0x14c1ea['body']['message'][_0x90a2('0x5c')]||null},{'include':[{'model':db['Attachment'],'as':_0x90a2('0x5d')}]});})['then'](function(_0xc958f0){_0x58cb2e['message']=_0xc958f0;if(_0x58cb2e[_0x90a2('0x56')][_0x90a2('0x5e')]){return db[_0x90a2('0x5f')][_0x90a2('0x26')]({'attributes':['id','name'],'where':{'id':_0x58cb2e[_0x90a2('0x56')][_0x90a2('0x5e')]}})[_0x90a2('0x10')](function(_0x29dc6e){if(_0x29dc6e){_0x58cb2e['applications'][_0x90a2('0x60')]({'id':0x0,'priority':0x0,'app':_0x90a2('0x61'),'appdata':_0x29dc6e[_0x90a2('0x62')]+','+(_0x58cb2e[_0x90a2('0x35')][_0x90a2('0x63')]||0xa),'interval':_0x90a2('0x46')});}return respondWithRpcPromise('Start','startRouting',_0x58cb2e);});}return respondWithRpcPromise('Start',_0x90a2('0x64'),_0x58cb2e);})[_0x90a2('0x10')](function(_0xc1d315){_0x137b5f(_0xc1d315);})[_0x90a2('0x19')](function(_0x4ab288){_0x499e28(_0x15c184[_0x90a2('0x15')](0x1f4,_0x4ab288[_0x90a2('0x18')]));});});}; \ No newline at end of file +var _0x017f=['./mailAccount.socket','register','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','result','MailAccount','findAll','options','raw','where','limit','map','include','model','attributes','then','GetMailAccount','ShowMailAccount','find','stringify','catch','mail','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','DESC','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','asc','push','length','close','autoclose','Contacts','CmContact','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','update','interaction','created','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','UserId','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x2910a8,_0x18d908){var _0x3b7fec=function(_0x366b15){while(--_0x366b15){_0x2910a8['push'](_0x2910a8['shift']());}};_0x3b7fec(++_0x18d908);}(_0x017f,0x12f));var _0xf017=function(_0x55cb95,_0x5c6523){_0x55cb95=_0x55cb95-0x0;var _0x33cff1=_0x017f[_0x55cb95];return _0x33cff1;};'use strict';var _=require(_0xf017('0x0'));var util=require(_0xf017('0x1'));var moment=require(_0xf017('0x2'));var BPromise=require(_0xf017('0x3'));var rs=require(_0xf017('0x4'));var fs=require('fs');var Redis=require(_0xf017('0x5'));var db=require(_0xf017('0x6'))['db'];var utils=require(_0xf017('0x7'));var logger=require(_0xf017('0x8'))(_0xf017('0x9'));var config=require(_0xf017('0xa'));var jayson=require(_0xf017('0xb'));var client=jayson[_0xf017('0xc')][_0xf017('0xd')]({'port':0x232c});config['redis']=_[_0xf017('0xe')](config[_0xf017('0xf')],{'host':_0xf017('0x10'),'port':0x18eb});var socket=require(_0xf017('0x11'))(new Redis(config['redis']));require(_0xf017('0x12'))[_0xf017('0x13')](socket);function respondWithRpcPromise(_0x2cedd6,_0x303dbf,_0xa275d2){return new BPromise(function(_0x3d99c3,_0x3914cc){return client[_0xf017('0x14')](_0x2cedd6,_0xa275d2)['then'](function(_0x364b49){logger[_0xf017('0x15')]('MailAccount,\x20%s,\x20%s',_0x303dbf,_0xf017('0x16'));logger[_0xf017('0x17')](_0xf017('0x18'),_0x303dbf,'request\x20sent',JSON['stringify'](_0x364b49));if(_0x364b49[_0xf017('0x19')]){if(_0x364b49[_0xf017('0x19')]['code']===0x1f4){logger['error'](_0xf017('0x1a'),_0x303dbf,_0x364b49[_0xf017('0x19')]['message']);return _0x3914cc(_0x364b49['error'][_0xf017('0x1b')]);}logger['error'](_0xf017('0x1a'),_0x303dbf,_0x364b49['error']['message']);return _0x3d99c3(_0x364b49[_0xf017('0x19')][_0xf017('0x1b')]);}else{logger[_0xf017('0x15')](_0xf017('0x1a'),_0x303dbf,_0xf017('0x16'));_0x3d99c3(_0x364b49[_0xf017('0x1c')]['message']);}})['catch'](function(_0x146d34){logger[_0xf017('0x19')](_0xf017('0x1a'),_0x303dbf,_0x146d34);_0x3914cc(_0x146d34);});});}exports['GetMailAccount']=function(_0x387c82){var _0x57345b=this;return new Promise(function(_0x3b8ed6,_0x43672e){return db[_0xf017('0x1d')][_0xf017('0x1e')]({'raw':_0x387c82[_0xf017('0x1f')]?_0x387c82[_0xf017('0x1f')][_0xf017('0x20')]===undefined?!![]:![]:!![],'where':_0x387c82['options']?_0x387c82[_0xf017('0x1f')][_0xf017('0x21')]||null:null,'attributes':_0x387c82[_0xf017('0x1f')]?_0x387c82[_0xf017('0x1f')]['attributes']||null:null,'limit':_0x387c82[_0xf017('0x1f')]?_0x387c82[_0xf017('0x1f')][_0xf017('0x22')]||null:null,'include':_0x387c82[_0xf017('0x1f')]?_0x387c82[_0xf017('0x1f')]['include']?_[_0xf017('0x23')](_0x387c82[_0xf017('0x1f')][_0xf017('0x24')],function(_0x5ef1d0){return{'model':db[_0x5ef1d0[_0xf017('0x25')]],'as':_0x5ef1d0['as'],'attributes':_0x5ef1d0['attributes'],'include':_0x5ef1d0['include']?_[_0xf017('0x23')](_0x5ef1d0[_0xf017('0x24')],function(_0x298025){return{'model':db[_0x298025[_0xf017('0x25')]],'as':_0x298025['as'],'attributes':_0x298025['attributes'],'include':_0x298025[_0xf017('0x24')]?_[_0xf017('0x23')](_0x298025[_0xf017('0x24')],function(_0x213362){return{'model':db[_0x213362[_0xf017('0x25')]],'as':_0x213362['as'],'attributes':_0x213362[_0xf017('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf017('0x27')](function(_0x284fd5){logger['info'](_0xf017('0x28'),_0x387c82);logger[_0xf017('0x17')](_0xf017('0x28'),_0x387c82,JSON['stringify'](_0x284fd5));_0x3b8ed6(_0x284fd5);})['catch'](function(_0x19d1c4){logger[_0xf017('0x19')]('GetMailAccount',_0x19d1c4['message'],_0x387c82);_0x43672e(_0x57345b['error'](0x1f4,_0x19d1c4['message']));});});};exports[_0xf017('0x29')]=function(_0x54a6b9){var _0x19f2e2=this;return new Promise(function(_0x129961,_0x58c00b){return db['MailAccount'][_0xf017('0x2a')]({'raw':_0x54a6b9[_0xf017('0x1f')]?_0x54a6b9[_0xf017('0x1f')][_0xf017('0x20')]===undefined?!![]:![]:!![],'where':_0x54a6b9[_0xf017('0x1f')]?_0x54a6b9[_0xf017('0x1f')][_0xf017('0x21')]||null:null,'attributes':_0x54a6b9[_0xf017('0x1f')]?_0x54a6b9[_0xf017('0x1f')]['attributes']||null:null,'include':_0x54a6b9[_0xf017('0x1f')]?_0x54a6b9[_0xf017('0x1f')][_0xf017('0x24')]?_[_0xf017('0x23')](_0x54a6b9[_0xf017('0x1f')][_0xf017('0x24')],function(_0x5cc641){return{'model':db[_0x5cc641['model']],'as':_0x5cc641['as'],'attributes':_0x5cc641[_0xf017('0x26')],'include':_0x5cc641[_0xf017('0x24')]?_['map'](_0x5cc641[_0xf017('0x24')],function(_0x205a85){return{'model':db[_0x205a85[_0xf017('0x25')]],'as':_0x205a85['as'],'attributes':_0x205a85[_0xf017('0x26')],'include':_0x205a85[_0xf017('0x24')]?_[_0xf017('0x23')](_0x205a85[_0xf017('0x24')],function(_0x2bcf4c){return{'model':db[_0x2bcf4c['model']],'as':_0x2bcf4c['as'],'attributes':_0x2bcf4c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf017('0x27')](function(_0x2780a6){logger[_0xf017('0x15')](_0xf017('0x29'),_0x54a6b9);logger[_0xf017('0x17')]('ShowMailAccount',_0x54a6b9,JSON[_0xf017('0x2b')](_0x2780a6));_0x129961(_0x2780a6);})[_0xf017('0x2c')](function(_0x1c7494){logger[_0xf017('0x19')](_0xf017('0x29'),_0x1c7494[_0xf017('0x1b')],_0x54a6b9);_0x58c00b(_0x19f2e2[_0xf017('0x19')](0x1f4,_0x1c7494[_0xf017('0x1b')]));});});};exports['NotifyMailAccount']=function(_0x34b33f){var _0x4a7409=this;return new Promise(function(_0x4edfef,_0x4b5f4a){var _0xc2aa2b={'body':_0x34b33f['body'],'channel':_0xf017('0x2d')};var _0x3b8057=_['difference'](_[_0xf017('0x2e')](db['CmContact'][_0xf017('0x2f')]),[_0xf017('0x30'),_0xf017('0x31'),_0xf017('0x32'),_0xf017('0x33')]);var _0x4f6f70=![];if(_0x34b33f['body']['id']){delete _0x34b33f[_0xf017('0x34')]['id'];}if(_['isNil'](_0x34b33f[_0xf017('0x34')][_0xf017('0x35')])){return _0x4b5f4a(_0x4a7409[_0xf017('0x19')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xf017('0x36')](_0x34b33f['body'][_0xf017('0x34')])||_0x34b33f[_0xf017('0x34')][_0xf017('0x34')]===''){return _0x4b5f4a(_0x4a7409[_0xf017('0x19')](0x1f4,_0xf017('0x37')));}if(_[_0xf017('0x36')](_0x34b33f['body']['mapKey'])){return _0x4b5f4a(_0x4a7409[_0xf017('0x19')](0x1f4,_0xf017('0x38')+_0x3b8057));}if(!_[_0xf017('0x39')](_0x3b8057,_0x34b33f[_0xf017('0x34')]['mapKey'])){return _0x4b5f4a(_0x4a7409[_0xf017('0x19')](0x1f4,_0xf017('0x3a')+_0x3b8057));}var _0x18936={};_0x18936[_0x34b33f[_0xf017('0x34')][_0xf017('0x3b')]]=_0x34b33f['body'][_0xf017('0x35')];return db[_0xf017('0x1d')][_0xf017('0x2a')]({'where':{'id':_0x34b33f[_0xf017('0x3c')]['id']},'include':[{'model':db[_0xf017('0x3d')],'as':_0xf017('0x3e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x18936,'limit':0x1,'order':[[_0xf017('0x31'),_0xf017('0x3f')]]}]},{'model':db['MailApplication'],'as':_0xf017('0x40')},{'model':db[_0xf017('0x41')],'as':_0xf017('0x42')}]})['then'](function(_0x362782){if(_0x362782&&_0x362782[_0xf017('0x3e')]){var _0x3b0e96=_0x362782[_0xf017('0x43')]({'plain':!![]});_0xc2aa2b['account']=_[_0xf017('0x44')](_0x3b0e96,[_0xf017('0x40'),_0xf017('0x3e')]);_0xc2aa2b[_0xf017('0x45')]=_0x3b0e96['Applications'];_0xc2aa2b[_0xf017('0x46')]=_0x3b0e96['List'];_0xc2aa2b[_0xf017('0x45')]=_[_0xf017('0x47')](_0xc2aa2b[_0xf017('0x45')],['priority'],[_0xf017('0x48')]);if(_0xc2aa2b[_0xf017('0x3c')]&&_0xc2aa2b['account']['autoclose']){_0xc2aa2b[_0xf017('0x45')][_0xf017('0x49')]({'id':0x0,'priority':_0xc2aa2b['applications'][_0xf017('0x4a')]+0x1,'app':_0xf017('0x4b'),'appdata':_0xf017('0x4c'),'interval':'*,*,*,*'});}if(_0xc2aa2b[_0xf017('0x3c')][_0xf017('0x40')]){delete _0xc2aa2b[_0xf017('0x3c')][_0xf017('0x40')];}if(_0xc2aa2b[_0xf017('0x3c')]['List']){delete _0xc2aa2b['account'][_0xf017('0x3e')];}if(_0x3b0e96['List'][_0xf017('0x4d')][_0xf017('0x4a')]){return _0x3b0e96['List'][_0xf017('0x4d')][0x0];}var _0x3f4df1=_[_0xf017('0xe')](_0x34b33f[_0xf017('0x34')],{'firstName':_0x34b33f[_0xf017('0x34')][_0xf017('0x35')],'ListId':_0x3b0e96[_0xf017('0x33')]});_0x3f4df1[_0x34b33f[_0xf017('0x34')]['mapKey']]=_0x34b33f['body'][_0xf017('0x35')];return db[_0xf017('0x4e')][_0xf017('0x4f')](_0x3f4df1);}else{throw new Error(_0xf017('0x50'));}})['then'](function(_0x227885){_0xc2aa2b['contact']=_0x227885;if(_0x227885){if(!_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x51')]){_0x34b33f[_0xf017('0x34')]['message'][_0xf017('0x51')]=rs[_0xf017('0x52')]()+'\x20'+_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x35')];}var _0x1c3f25={'ContactId':_0x227885['id'],'MailAccountId':_0x34b33f['account']['id'],'inReplyTo':_0x34b33f[_0xf017('0x34')]['message'][_0xf017('0x51')],'to':_0x34b33f[_0xf017('0x34')]['message'][_0xf017('0x35')],'cc':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['cc'],'subject':_0x34b33f['body'][_0xf017('0x1b')][_0xf017('0x53')],'attach':_0x34b33f[_0xf017('0x34')]['message'][_0xf017('0x54')],'lastMsgAt':moment()['format'](_0xf017('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf017('0x2a')]({'where':{'closed':![],'MailAccountId':_0x34b33f[_0xf017('0x3c')]['id']},'include':[{'model':db[_0xf017('0x56')],'as':_0xf017('0x57'),'attributes':[_0xf017('0x51')],'where':{'messageId':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x58')]}}]})[_0xf017('0x27')](function(_0xd2f794){if(_0xd2f794){return[_0xd2f794,![]];}return db[_0xf017('0x59')]['create'](_0x1c3f25)[_0xf017('0x27')](function(_0x47cc4e){return[_0x47cc4e,!![]];});});}else{throw new Error(_0xf017('0x5a'));}})['spread'](function(_0x521513,_0x2186c3){if(_0x521513){_0x4f6f70=_0x2186c3;if(!_0x2186c3){return _0x521513[_0xf017('0x5b')]({'inReplyTo':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['messageId'],'to':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['from'],'cc':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['cc'],'subject':_0x34b33f['body'][_0xf017('0x1b')][_0xf017('0x53')],'attach':_0x521513[_0xf017('0x54')]?_0x521513[_0xf017('0x54')]:_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x54')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0xf017('0x55')),'lastMsgDirection':'in'});}else{return _0x521513;}}})['then'](function(_0x135097){_0xc2aa2b[_0xf017('0x5c')]=_0x135097[_0xf017('0x43')]({'plain':!![]});_0xc2aa2b[_0xf017('0x5c')][_0xf017('0x5d')]=_0x4f6f70;return db[_0xf017('0x56')][_0xf017('0x4f')]({'body':_0x34b33f[_0xf017('0x34')]['body'],'MailAccountId':_0x34b33f[_0xf017('0x3c')]['id'],'MailInteractionId':_0x135097['id'],'direction':'in','ContactId':_0xc2aa2b['contact']['id'],'messageId':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x51')],'from':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['from'],'to':_0x34b33f[_0xf017('0x34')]['message']['to'],'cc':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['cc'],'subject':_0x34b33f['body'][_0xf017('0x1b')][_0xf017('0x53')],'attach':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x54')],'Attachments':_0x34b33f[_0xf017('0x34')]['message']['attachments'],'originTo':_0x34b33f['body']['message'][_0xf017('0x5e')],'originCc':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x5f')],'bcc':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x60')],'ChatWebsiteId':_0x34b33f['body']['message'][_0xf017('0x61')]||null,'originChannel':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')][_0xf017('0x62')]||_0xf017('0x63'),'ChatOfflineMessageId':_0x34b33f[_0xf017('0x34')][_0xf017('0x1b')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0xf017('0x27')](function(_0x3cbb39){_0xc2aa2b['message']=_0x3cbb39;if(_0xc2aa2b[_0xf017('0x5c')][_0xf017('0x64')]){return db['User'][_0xf017('0x2a')]({'attributes':['id',_0xf017('0x65')],'where':{'id':_0xc2aa2b[_0xf017('0x5c')]['UserId']}})['then'](function(_0x24e80c){if(_0x24e80c){_0xc2aa2b[_0xf017('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf017('0x66'),'appdata':_0x24e80c[_0xf017('0x65')]+','+(_0xc2aa2b[_0xf017('0x3c')][_0xf017('0x67')]||0xa),'interval':_0xf017('0x68')});}return respondWithRpcPromise(_0xf017('0x69'),_0xf017('0x6a'),_0xc2aa2b);});}return respondWithRpcPromise('Start',_0xf017('0x6a'),_0xc2aa2b);})[_0xf017('0x27')](function(_0x175bc5){_0x4edfef(_0x175bc5);})[_0xf017('0x2c')](function(_0x2d840f){_0x4b5f4a(_0x4a7409[_0xf017('0x19')](0x1f4,_0x2d840f[_0xf017('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e7936ad..cc3e9ae 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 _0x3266=['mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3266,0x6a));var _0x6326=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x3266[_0x2261ce];return _0x524640;};'use strict';var MailAccountEvents=require(_0x6326('0x0'));var events=[_0x6326('0x1'),_0x6326('0x2'),_0x6326('0x3')];function createListener(_0x545df7,_0x6b67c0){return function(_0x29aef3){_0x6b67c0[_0x6326('0x4')](_0x545df7,_0x29aef3);};}function removeListener(_0x265264,_0x5a6b4d){return function(){MailAccountEvents[_0x6326('0x5')](_0x265264,_0x5a6b4d);};}exports['register']=function(_0x25ecd8){for(var _0x44460c=0x0,_0x14208e=events['length'];_0x44460c<_0x14208e;_0x44460c++){var _0x161f4e=events[_0x44460c];var _0x5730e7=createListener(_0x6326('0x6')+_0x161f4e,_0x25ecd8);MailAccountEvents['on'](_0x161f4e,_0x5730e7);}}; \ No newline at end of file +var _0xaf1c=['remove','update','register','length','./mailAccount.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaf1c,0xea));var _0xcaf1=function(_0x5133ff,_0xaca318){_0x5133ff=_0x5133ff-0x0;var _0x302854=_0xaf1c[_0x5133ff];return _0x302854;};'use strict';var MailAccountEvents=require(_0xcaf1('0x0'));var events=['save',_0xcaf1('0x1'),_0xcaf1('0x2')];function createListener(_0x2feb27,_0x525c86){return function(_0x343483){_0x525c86['emit'](_0x2feb27,_0x343483);};}function removeListener(_0x3684f4,_0x5129a8){return function(){MailAccountEvents['removeListener'](_0x3684f4,_0x5129a8);};}exports[_0xcaf1('0x3')]=function(_0x5e9ca0){for(var _0x5563e0=0x0,_0x5a0d3e=events[_0xcaf1('0x4')];_0x5563e0<_0x5a0d3e;_0x5563e0++){var _0xb63956=events[_0x5563e0];var _0x165d08=createListener('mailAccount:'+_0xb63956,_0x5e9ca0);MailAccountEvents['on'](_0xb63956,_0x165d08);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 4a30491..e7ed12f 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 _0xf14b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','multer','util','path','connect-timeout'];(function(_0x1e7aff,_0x1c843b){var _0x2a16bf=function(_0x2eceee){while(--_0x2eceee){_0x1e7aff['push'](_0x1e7aff['shift']());}};_0x2a16bf(++_0x1c843b);}(_0xf14b,0x1be));var _0xbf14=function(_0x275f08,_0x44cddf){_0x275f08=_0x275f08-0x0;var _0x275290=_0xf14b[_0x275f08];return _0x275290;};'use strict';var multer=require(_0xbf14('0x0'));var util=require(_0xbf14('0x1'));var path=require(_0xbf14('0x2'));var timeout=require(_0xbf14('0x3'));var express=require(_0xbf14('0x4'));var router=express[_0xbf14('0x5')]();var fs_extra=require(_0xbf14('0x6'));var auth=require(_0xbf14('0x7'));var interaction=require(_0xbf14('0x8'));var config=require(_0xbf14('0x9'));var controller=require(_0xbf14('0xa'));router[_0xbf14('0xb')](_0xbf14('0xc'),auth[_0xbf14('0xd')](),controller[_0xbf14('0xe')]);router[_0xbf14('0xf')](_0xbf14('0xc'),auth[_0xbf14('0xd')](),controller[_0xbf14('0x10')]);router[_0xbf14('0x11')](_0xbf14('0xc'),auth[_0xbf14('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd0ca=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','isAuthenticated','put','/:id'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xd0ca,0xc4));var _0xad0c=function(_0x3154a2,_0x575cc8){_0x3154a2=_0x3154a2-0x0;var _0x4af8d5=_0xd0ca[_0x3154a2];return _0x4af8d5;};'use strict';var multer=require('multer');var util=require(_0xad0c('0x0'));var path=require(_0xad0c('0x1'));var timeout=require(_0xad0c('0x2'));var express=require(_0xad0c('0x3'));var router=express[_0xad0c('0x4')]();var fs_extra=require(_0xad0c('0x5'));var auth=require(_0xad0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad0c('0x7'));var controller=require(_0xad0c('0x8'));router['get']('/:id',auth[_0xad0c('0x9')](),controller['show']);router[_0xad0c('0xa')](_0xad0c('0xb'),auth['isAuthenticated'](),controller[_0xad0c('0xc')]);router[_0xad0c('0xd')](_0xad0c('0xb'),auth[_0xad0c('0x9')](),controller[_0xad0c('0xe')]);module[_0xad0c('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 224a75c..66050ee 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 _0xe574=['noop','TEXT','INTEGER','STRING'];(function(_0x2b69ad,_0x1b898e){var _0x3e0891=function(_0x28ee98){while(--_0x28ee98){_0x2b69ad['push'](_0x2b69ad['shift']());}};_0x3e0891(++_0x1b898e);}(_0xe574,0x1ea));var _0x4e57=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe574[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x4e57('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x4e57('0x1')],'allowNull':![],'defaultValue':_0x4e57('0x2')},'appdata':{'type':Sequelize[_0x4e57('0x3')]()},'description':{'type':Sequelize[_0x4e57('0x1')]},'interval':{'type':Sequelize[_0x4e57('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x72a8=['STRING','noop','*,*,*,*','sequelize','INTEGER'];(function(_0xe4b8e9,_0x5d5c82){var _0x35f9b2=function(_0x3ad120){while(--_0x3ad120){_0xe4b8e9['push'](_0xe4b8e9['shift']());}};_0x35f9b2(++_0x5d5c82);}(_0x72a8,0x1e3));var _0x872a=function(_0x1ddc21,_0x54c199){_0x1ddc21=_0x1ddc21-0x0;var _0x10678e=_0x72a8[_0x1ddc21];return _0x10678e;};'use strict';var Sequelize=require(_0x872a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x872a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x872a('0x2')],'allowNull':![],'defaultValue':_0x872a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x872a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x872a('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6f10966..9cbe98f 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x4cad9a,_0x365b74){var _0x29ffb5=function(_0x13e2cf){while(--_0x13e2cf){_0x4cad9a['push'](_0x4cad9a['shift']());}};_0x29ffb5(++_0x365b74);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xcb91[_0x1809c5];return _0x5254a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x3dd7a0,_0x170d7){var _0x57d2ad=function(_0x4bc52a){while(--_0x4bc52a){_0x3dd7a0['push'](_0x3dd7a0['shift']());}};_0x57d2ad(++_0x170d7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index fd828b7..5fd2368 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 _0xa879=['rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','util','api','moment','bluebird','request-promise','path'];(function(_0x565411,_0x7415b0){var _0x439dfb=function(_0x48711c){while(--_0x48711c){_0x565411['push'](_0x565411['shift']());}};_0x439dfb(++_0x7415b0);}(_0xa879,0x166));var _0x9a87=function(_0x1c3d59,_0x111d08){_0x1c3d59=_0x1c3d59-0x0;var _0x3eff34=_0xa879[_0x1c3d59];return _0x3eff34;};'use strict';var _=require('lodash');var util=require(_0x9a87('0x0'));var logger=require('../../config/logger')(_0x9a87('0x1'));var moment=require(_0x9a87('0x2'));var BPromise=require(_0x9a87('0x3'));var rp=require(_0x9a87('0x4'));var fs=require('fs');var path=require(_0x9a87('0x5'));var rimraf=require(_0x9a87('0x6'));var config=require(_0x9a87('0x7'));var attributes=require(_0x9a87('0x8'));module[_0x9a87('0x9')]=function(_0x6621af,_0x24f44c){return _0x6621af[_0x9a87('0xa')](_0x9a87('0xb'),attributes,{'tableName':_0x9a87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7966=['api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x239c72,_0x554a85){var _0x5da3f6=function(_0x2c8377){while(--_0x2c8377){_0x239c72['push'](_0x239c72['shift']());}};_0x5da3f6(++_0x554a85);}(_0x7966,0x11c));var _0x6796=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7966[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6796('0x0'));var util=require(_0x6796('0x1'));var logger=require('../../config/logger')(_0x6796('0x2'));var moment=require(_0x6796('0x3'));var BPromise=require('bluebird');var rp=require(_0x6796('0x4'));var fs=require('fs');var path=require(_0x6796('0x5'));var rimraf=require(_0x6796('0x6'));var config=require(_0x6796('0x7'));var attributes=require(_0x6796('0x8'));module[_0x6796('0x9')]=function(_0x17a7f8,_0x5919c2){return _0x17a7f8[_0x6796('0xa')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6796('0xb'),'collate':_0x6796('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 284718b..0766fe3 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 _0xf057=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','MailApplication,\x20%s,\x20%s','message','info','result','catch','MailApplication','update','body','options','raw','where','attributes','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2d431e,_0x4ca651){var _0x443bab=function(_0x2c99d0){while(--_0x2c99d0){_0x2d431e['push'](_0x2d431e['shift']());}};_0x443bab(++_0x4ca651);}(_0xf057,0x16e));var _0x7f05=function(_0x242878,_0x64cce6){_0x242878=_0x242878-0x0;var _0x506e22=_0xf057[_0x242878];return _0x506e22;};'use strict';var _=require(_0x7f05('0x0'));var util=require(_0x7f05('0x1'));var moment=require(_0x7f05('0x2'));var BPromise=require(_0x7f05('0x3'));var rs=require(_0x7f05('0x4'));var fs=require('fs');var Redis=require(_0x7f05('0x5'));var db=require(_0x7f05('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f05('0x7'))(_0x7f05('0x8'));var config=require(_0x7f05('0x9'));var jayson=require(_0x7f05('0xa'));var client=jayson[_0x7f05('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a07dc,_0x474f3f,_0x243e93){return new BPromise(function(_0x420bec,_0xdc6224){return client['request'](_0x1a07dc,_0x243e93)[_0x7f05('0xc')](function(_0x4069ed){logger['info']('MailApplication,\x20%s,\x20%s',_0x474f3f,_0x7f05('0xd'));logger[_0x7f05('0xe')](_0x7f05('0xf'),_0x474f3f,'request\x20sent',JSON[_0x7f05('0x10')](_0x4069ed));if(_0x4069ed[_0x7f05('0x11')]){if(_0x4069ed[_0x7f05('0x11')]['code']===0x1f4){logger[_0x7f05('0x11')](_0x7f05('0x12'),_0x474f3f,_0x4069ed[_0x7f05('0x11')][_0x7f05('0x13')]);return _0xdc6224(_0x4069ed['error'][_0x7f05('0x13')]);}logger['error'](_0x7f05('0x12'),_0x474f3f,_0x4069ed[_0x7f05('0x11')][_0x7f05('0x13')]);return _0x420bec(_0x4069ed[_0x7f05('0x11')][_0x7f05('0x13')]);}else{logger[_0x7f05('0x14')](_0x7f05('0x12'),_0x474f3f,_0x7f05('0xd'));_0x420bec(_0x4069ed[_0x7f05('0x15')][_0x7f05('0x13')]);}})[_0x7f05('0x16')](function(_0x34a5ec){logger[_0x7f05('0x11')](_0x7f05('0x12'),_0x474f3f,_0x34a5ec);_0xdc6224(_0x34a5ec);});});}exports['UpdateMailApplication']=function(_0x2caa49){var _0x47261a=this;return new Promise(function(_0x1ac544,_0x115b22){return db[_0x7f05('0x17')][_0x7f05('0x18')](_0x2caa49[_0x7f05('0x19')],{'raw':_0x2caa49[_0x7f05('0x1a')]?_0x2caa49[_0x7f05('0x1a')][_0x7f05('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2caa49[_0x7f05('0x1a')]?_0x2caa49[_0x7f05('0x1a')][_0x7f05('0x1c')]||null:null,'attributes':_0x2caa49[_0x7f05('0x1a')]?_0x2caa49[_0x7f05('0x1a')][_0x7f05('0x1d')]||null:null,'limit':_0x2caa49[_0x7f05('0x1a')]?_0x2caa49[_0x7f05('0x1a')]['limit']||null:null})['then'](function(_0x3ec091){logger['info']('UpdateMailApplication',_0x2caa49);logger[_0x7f05('0xe')]('UpdateMailApplication',_0x2caa49,JSON['stringify'](_0x3ec091));_0x1ac544(_0x3ec091);})[_0x7f05('0x16')](function(_0x54d76d){logger[_0x7f05('0x11')](_0x7f05('0x1e'),_0x54d76d['message'],_0x2caa49);_0x115b22(_0x47261a['error'](0x1f4,_0x54d76d[_0x7f05('0x13')]));});});}; \ No newline at end of file +var _0x580f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','update','body','options','where','attributes','limit','then','UpdateMailApplication','lodash'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x580f,0x7b));var _0xf580=function(_0x37d7f9,_0x272825){_0x37d7f9=_0x37d7f9-0x0;var _0x3bb881=_0x580f[_0x37d7f9];return _0x3bb881;};'use strict';var _=require(_0xf580('0x0'));var util=require(_0xf580('0x1'));var moment=require(_0xf580('0x2'));var BPromise=require(_0xf580('0x3'));var rs=require(_0xf580('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf580('0x5'))['db'];var utils=require(_0xf580('0x6'));var logger=require(_0xf580('0x7'))(_0xf580('0x8'));var config=require(_0xf580('0x9'));var jayson=require(_0xf580('0xa'));var client=jayson['client'][_0xf580('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1df6d8,_0xf45a6d,_0xf0318d){return new BPromise(function(_0x228c10,_0x2ba31a){return client[_0xf580('0xc')](_0x1df6d8,_0xf0318d)['then'](function(_0x31dcea){logger['info'](_0xf580('0xd'),_0xf45a6d,_0xf580('0xe'));logger[_0xf580('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xf45a6d,_0xf580('0xe'),JSON[_0xf580('0x10')](_0x31dcea));if(_0x31dcea[_0xf580('0x11')]){if(_0x31dcea[_0xf580('0x11')][_0xf580('0x12')]===0x1f4){logger[_0xf580('0x11')](_0xf580('0xd'),_0xf45a6d,_0x31dcea[_0xf580('0x11')][_0xf580('0x13')]);return _0x2ba31a(_0x31dcea[_0xf580('0x11')][_0xf580('0x13')]);}logger[_0xf580('0x11')](_0xf580('0xd'),_0xf45a6d,_0x31dcea['error']['message']);return _0x228c10(_0x31dcea[_0xf580('0x11')][_0xf580('0x13')]);}else{logger[_0xf580('0x14')](_0xf580('0xd'),_0xf45a6d,'request\x20sent');_0x228c10(_0x31dcea[_0xf580('0x15')][_0xf580('0x13')]);}})[_0xf580('0x16')](function(_0x104a28){logger[_0xf580('0x11')]('MailApplication,\x20%s,\x20%s',_0xf45a6d,_0x104a28);_0x2ba31a(_0x104a28);});});}exports['UpdateMailApplication']=function(_0x832ec0){var _0x230fa8=this;return new Promise(function(_0x260bfc,_0x19a4d5){return db['MailApplication'][_0xf580('0x17')](_0x832ec0[_0xf580('0x18')],{'raw':_0x832ec0[_0xf580('0x19')]?_0x832ec0[_0xf580('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x832ec0[_0xf580('0x19')]?_0x832ec0['options'][_0xf580('0x1a')]||null:null,'attributes':_0x832ec0['options']?_0x832ec0['options'][_0xf580('0x1b')]||null:null,'limit':_0x832ec0[_0xf580('0x19')]?_0x832ec0[_0xf580('0x19')][_0xf580('0x1c')]||null:null})[_0xf580('0x1d')](function(_0x2c3410){logger[_0xf580('0x14')]('UpdateMailApplication',_0x832ec0);logger['debug'](_0xf580('0x1e'),_0x832ec0,JSON[_0xf580('0x10')](_0x2c3410));_0x260bfc(_0x2c3410);})[_0xf580('0x16')](function(_0x59e4e2){logger[_0xf580('0x11')]('UpdateMailApplication',_0x59e4e2[_0xf580('0x13')],_0x832ec0);_0x19a4d5(_0x230fa8[_0xf580('0x11')](0x1f4,_0x59e4e2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index dcd3b5b..225922a 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 _0x1dd2=['index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','destroy','delete','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x4c37d9,_0x187c40){var _0x2208f8=function(_0x338639){while(--_0x338639){_0x4c37d9['push'](_0x4c37d9['shift']());}};_0x2208f8(++_0x187c40);}(_0x1dd2,0x159));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x21dd('0x0')]();var auth=require(_0x21dd('0x1'));var interaction=require(_0x21dd('0x2'));var controller=require(_0x21dd('0x3'));router[_0x21dd('0x4')]('/',auth[_0x21dd('0x5')](),controller[_0x21dd('0x6')]);router[_0x21dd('0x4')](_0x21dd('0x7'),auth['isAuthenticated'](),controller[_0x21dd('0x8')]);router[_0x21dd('0x4')]('/:id',auth[_0x21dd('0x5')](),controller[_0x21dd('0x9')]);router[_0x21dd('0x4')](_0x21dd('0xa'),auth['isAuthenticated'](),controller[_0x21dd('0xb')]);router['get'](_0x21dd('0xc'),auth[_0x21dd('0x5')](),controller[_0x21dd('0xd')]);router[_0x21dd('0xe')]('/',auth['isAuthenticated'](),controller[_0x21dd('0xf')]);router['post'](_0x21dd('0xa'),auth[_0x21dd('0x5')](),controller[_0x21dd('0x10')]);router[_0x21dd('0xe')](_0x21dd('0x11'),auth[_0x21dd('0x5')](),interaction[_0x21dd('0x12')]('mail',_0x21dd('0x13')),controller[_0x21dd('0x14')]);router[_0x21dd('0x15')](_0x21dd('0x16'),auth[_0x21dd('0x5')](),interaction[_0x21dd('0x12')](_0x21dd('0x17'),'mailinteraction:update'),controller['update']);router['delete'](_0x21dd('0x16'),auth[_0x21dd('0x5')](),interaction[_0x21dd('0x12')](_0x21dd('0x17'),'mailinteraction:destroy'),controller[_0x21dd('0x18')]);router[_0x21dd('0x19')](_0x21dd('0x11'),auth['isAuthenticated'](),controller[_0x21dd('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xf8bd=['mailinteraction:destroy','destroy','/:id/tags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','describe','isAuthenticated','show','getMessages','/:id/download','download','post','create','/:id/messages','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xf8bd,0xd4));var _0xdf8b=function(_0x2b2ac8,_0x22f79a){_0x2b2ac8=_0x2b2ac8-0x0;var _0x5cd081=_0xf8bd[_0x2b2ac8];return _0x5cd081;};'use strict';var express=require(_0xdf8b('0x0'));var router=express['Router']();var auth=require(_0xdf8b('0x1'));var interaction=require(_0xdf8b('0x2'));var controller=require(_0xdf8b('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdf8b('0x4')](_0xdf8b('0x5'),auth['isAuthenticated'](),controller[_0xdf8b('0x6')]);router['get']('/:id',auth[_0xdf8b('0x7')](),controller[_0xdf8b('0x8')]);router[_0xdf8b('0x4')]('/:id/messages',auth['isAuthenticated'](),controller[_0xdf8b('0x9')]);router['get'](_0xdf8b('0xa'),auth[_0xdf8b('0x7')](),controller[_0xdf8b('0xb')]);router[_0xdf8b('0xc')]('/',auth[_0xdf8b('0x7')](),controller[_0xdf8b('0xd')]);router[_0xdf8b('0xc')](_0xdf8b('0xe'),auth[_0xdf8b('0x7')](),controller['addMessage']);router[_0xdf8b('0xc')]('/:id/tags',auth[_0xdf8b('0x7')](),interaction[_0xdf8b('0xf')](_0xdf8b('0x10'),_0xdf8b('0x11')),controller[_0xdf8b('0x12')]);router[_0xdf8b('0x13')]('/:id',auth['isAuthenticated'](),interaction['tracked']('mail',_0xdf8b('0x14')),controller['update']);router[_0xdf8b('0x15')]('/:id',auth[_0xdf8b('0x7')](),interaction['tracked'](_0xdf8b('0x10'),_0xdf8b('0x16')),controller[_0xdf8b('0x17')]);router[_0xdf8b('0x15')](_0xdf8b('0x18'),auth['isAuthenticated'](),controller['removeTags']);module[_0xdf8b('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index e51233a..4e08258 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 _0xb3f6=['long','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0xdc5ca7,_0x4ca4eb){var _0x25b991=function(_0x5ec606){while(--_0x5ec606){_0xdc5ca7['push'](_0xdc5ca7['shift']());}};_0x25b991(++_0x4ca4eb);}(_0xb3f6,0x18a));var _0x6b3f=function(_0x514984,_0x3bd51a){_0x514984=_0x514984-0x0;var _0x49faec=_0xb3f6[_0x514984];return _0x49faec;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x6b3f('0x0'));module[_0x6b3f('0x1')]={'closed':{'type':Sequelize[_0x6b3f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6b3f('0x3')]},'disposition':{'type':Sequelize[_0x6b3f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6b3f('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6b3f('0x4')]},'cc':{'type':Sequelize[_0x6b3f('0x5')](_0x6b3f('0x6'))},'subject':{'type':Sequelize[_0x6b3f('0x5')]()},'attach':{'type':Sequelize[_0x6b3f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x6b3f('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6b3f('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6b3f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6b3f('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6b3f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfeb3=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x535f38,_0x5abf90){var _0x4128b7=function(_0x569274){while(--_0x569274){_0x535f38['push'](_0x535f38['shift']());}};_0x4128b7(++_0x5abf90);}(_0xfeb3,0x1a4));var _0x3feb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfeb3[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x3feb('0x0'));var iconv=require(_0x3feb('0x1'));module[_0x3feb('0x2')]={'closed':{'type':Sequelize[_0x3feb('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3feb('0x4')]},'disposition':{'type':Sequelize[_0x3feb('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3feb('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3feb('0x5')]},'cc':{'type':Sequelize[_0x3feb('0x6')](_0x3feb('0x7'))},'subject':{'type':Sequelize[_0x3feb('0x6')]()},'attach':{'type':Sequelize[_0x3feb('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3feb('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x3feb('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3feb('0x8')]('in',_0x3feb('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3feb('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3feb('0x8')]('in',_0x3feb('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3feb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 135c4e8..86a1f5d 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 _0x2675=['concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','MailAccountId','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.MailAccountId','c.firstName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','show','rawAttributes','includeAll','include','options','create','body','update','params','describe','addMessage','MailMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','spread','findAll','color','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','attachments','bcc','subject','Messages','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','send','Users','map','TagIds','split','forEach','Tags','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','fieldName','type','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','field','from','select','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','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','ContactId','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','keys','some','isEmpty','where','i.MailAccountId\x20IN\x20?'];(function(_0x491082,_0x28f78b){var _0x5797d9=function(_0x20d0ba){while(--_0x20d0ba){_0x491082['push'](_0x491082['shift']());}};_0x5797d9(++_0x28f78b);}(_0x2675,0x75));var _0x5267=function(_0x3983a0,_0x37a2ab){_0x3983a0=_0x3983a0-0x0;var _0x1c06ff=_0x2675[_0x3983a0];return _0x1c06ff;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x5267('0x1'));var util=require(_0x5267('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x5267('0x3'));var squel=require(_0x5267('0x4'));var juice=require('juice');var Redis=require(_0x5267('0x5'));var qs=require(_0x5267('0x6'));var as=require(_0x5267('0x7'));var logger=require(_0x5267('0x8'))(_0x5267('0x9'));var config=require(_0x5267('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x5267('0xb'));config[_0x5267('0xc')]=_['defaults'](config[_0x5267('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5267('0xd'))(new Redis(config[_0x5267('0xc')]));require(_0x5267('0xe'))['register'](socket);function respondWithStatusCode(_0x3e6964,_0x5060b3){_0x5060b3=_0x5060b3||0xcc;return function(_0x445151){if(_0x445151){return _0x3e6964['sendStatus'](_0x5060b3);}return _0x3e6964[_0x5267('0xf')](_0x5060b3)[_0x5267('0x10')]();};}function respondWithResult(_0x268a8a,_0x1f9be3){_0x1f9be3=_0x1f9be3||0xc8;return function(_0x1d7090){if(_0x1d7090){return _0x268a8a[_0x5267('0xf')](_0x1f9be3)[_0x5267('0x11')](_0x1d7090);}};}function respondWithFilteredResult(_0x36dc17,_0x3e19e4){return function(_0x1e2d3b){if(_0x1e2d3b){var _0x16e5a7=typeof _0x3e19e4[_0x5267('0x12')]===_0x5267('0x13')&&typeof _0x3e19e4['limit']==='undefined';var _0xa593fb=_0x1e2d3b[_0x5267('0x14')];var _0x38a147=_0x16e5a7?0x0:_0x3e19e4[_0x5267('0x12')];var _0x46b2c2=_0x16e5a7?_0x1e2d3b[_0x5267('0x14')]:_0x3e19e4[_0x5267('0x12')]+_0x3e19e4[_0x5267('0x15')];var _0x15d81e;if(_0x46b2c2>=_0xa593fb){_0x46b2c2=_0xa593fb;_0x15d81e=0xc8;}else{_0x15d81e=0xce;}_0x36dc17[_0x5267('0xf')](_0x15d81e);return _0x36dc17[_0x5267('0x16')](_0x5267('0x17'),_0x38a147+'-'+_0x46b2c2+'/'+_0xa593fb)['json'](_0x1e2d3b);}return null;};}function saveUpdates(_0x18f32e){return function(_0x2afd38){if(_0x2afd38){return _0x2afd38['update'](_0x18f32e)[_0x5267('0x18')](function(_0x56733e){return _0x56733e;});}return null;};}function removeEntity(_0x1cf835){return function(_0x1019e7){if(_0x1019e7){return _0x1019e7[_0x5267('0x19')]()[_0x5267('0x18')](function(){_0x1cf835[_0x5267('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100fcd){return function(_0x5aebdd){if(!_0x5aebdd){_0x100fcd[_0x5267('0x1a')](0x194);}return _0x5aebdd;};}function handleError(_0x420fb8,_0x3b53ac){_0x3b53ac=_0x3b53ac||0x1f4;return function(_0x56dd95){logger['error'](_0x56dd95['stack']);if(_0x56dd95['name']){delete _0x56dd95['name'];}_0x420fb8[_0x5267('0xf')](_0x3b53ac)[_0x5267('0x1b')](_0x56dd95);};}function getInteractionUsers(_0x2d761d,_0x279377){return new BPromise(function(_0x11c8ea,_0x40d1be){try{if(_0x279377[_0x2d761d['id']]){_0x2d761d[_0x5267('0x1c')]=_[_0x5267('0x1d')](_0x279377[_0x2d761d['id']],function(_0x2cdc45){return{'id':_0x2cdc45['id'],'fullname':_0x2cdc45['fullname']};});}}catch(_0x5cb64f){_0x40d1be(_0x5cb64f);}_0x11c8ea(_0x2d761d);});}function getInteractionTags(_0x354111,_0x472938){return new BPromise(function(_0x5abf95,_0x45373e){try{if(_0x354111['TagIds']){_0x354111['Tags']=[];_0x354111[_0x5267('0x1e')][_0x5267('0x1f')](',')[_0x5267('0x20')](function(_0x2d2ace){_0x354111[_0x5267('0x21')]['push'](_0x472938[_0x2d2ace]);});}delete _0x354111['TagIds'];}catch(_0x18020c){_0x45373e(_0x18020c);}_0x5abf95(_0x354111);});}function getLastMessageText(_0x10a68c){return new BPromise(function(_0x24496d,_0x549a66){return db['MailMessage'][_0x5267('0x22')]({'where':{'$and':[{'MailInteractionId':_0x10a68c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5267('0x23')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5267('0x24')],'order':'-id','raw':!![]})['then'](function(_0x2249a1){if(_0x2249a1&&_0x2249a1[_0x5267('0x24')]){_0x10a68c[_0x5267('0x25')]=_[_0x5267('0x26')](_0x2249a1['plainBody']);}_0x24496d(_0x10a68c);})[_0x5267('0x27')](function(_0x1a7f4b){_0x549a66(_0x1a7f4b);});});}function updateMailInteraction(_0x4344c5,_0xf8d7a3,_0x1eb8d8,_0xd65cb1){return new BPromise(function(_0x341bae,_0x1dda95){return getInteractionUsers(_0x4344c5,_0x1eb8d8)['then'](function(_0x4f372c){return getInteractionTags(_0x4f372c,_0xf8d7a3);})[_0x5267('0x18')](function(_0x51c372){return getStateInteraction(_0x51c372);})[_0x5267('0x18')](function(_0x100097){if(_0xd65cb1){_0x341bae(getLastMessageText(_0x100097));}else{_0x341bae(_0x100097);}})[_0x5267('0x27')](function(_0x3a729c){_0x1dda95(_0x3a729c);});});}function getStateInteraction(_0x4ac4a0){return new BPromise(function(_0x305863){_0x4ac4a0[_0x5267('0x28')]=0x0;_0x4ac4a0[_0x5267('0x29')]=0x0;_0x4ac4a0[_0x5267('0x2a')]=0x0;_0x4ac4a0[_0x5267('0x2b')]=0x0;_0x4ac4a0[_0x5267('0x2c')]=0x0;if(!_0x4ac4a0[_0x5267('0x2d')]&&!_0x4ac4a0[_0x5267('0x2e')]){_0x4ac4a0['waiting']+=0x1;}if(!_0x4ac4a0[_0x5267('0x2d')]&&_0x4ac4a0['UserId']){_0x4ac4a0[_0x5267('0x29')]+=0x1;if(_0x4ac4a0[_0x5267('0x28')]){_0x4ac4a0[_0x5267('0x28')]-=0x1;}}if(_0x4ac4a0[_0x5267('0x2d')]&&_0x4ac4a0[_0x5267('0x2e')]){_0x4ac4a0[_0x5267('0x2a')]+=0x1;if(_0x4ac4a0[_0x5267('0x29')]){_0x4ac4a0['talking']-=0x1;}}if(_0x4ac4a0[_0x5267('0x2d')]&&!_0x4ac4a0[_0x5267('0x2e')]){_0x4ac4a0[_0x5267('0x2b')]+=0x1;if(_0x4ac4a0[_0x5267('0x28')]){_0x4ac4a0[_0x5267('0x28')]-=0x1;}}_0x4ac4a0[_0x5267('0x2c')]+=0x1;_0x305863(_0x4ac4a0);});}exports[_0x5267('0x2f')]=function(_0x487dfc,_0x2dc5cc){var _0x5ef02e={},_0x3db34d={},_0x5c0cdf={'count':0x0,'rows':[]};var _0x4dee66=_['map'](db[_0x5267('0x30')]['rawAttributes'],function(_0xf33688){return{'name':_0xf33688[_0x5267('0x31')],'type':_0xf33688[_0x5267('0x32')][_0x5267('0x33')]};});_0x3db34d['model']=_[_0x5267('0x1d')](_0x4dee66,_0x5267('0x34'));_0x3db34d['query']=_['keys'](_0x487dfc[_0x5267('0x35')]);_0x3db34d['filters']=_[_0x5267('0x36')](_0x3db34d[_0x5267('0x37')],_0x3db34d[_0x5267('0x35')]);_0x5ef02e[_0x5267('0x38')]=_[_0x5267('0x36')](_0x3db34d[_0x5267('0x37')],qs[_0x5267('0x39')](_0x487dfc['query']['fields']));_0x5ef02e[_0x5267('0x38')]=_0x5ef02e['attributes'][_0x5267('0x3a')]?_0x5ef02e[_0x5267('0x38')]:_0x3db34d['model'];if(!_0x487dfc[_0x5267('0x35')][_0x5267('0x3b')](_0x5267('0x3c'))){_0x5ef02e[_0x5267('0x15')]=qs[_0x5267('0x15')](_0x487dfc[_0x5267('0x35')][_0x5267('0x15')]);_0x5ef02e[_0x5267('0x12')]=qs[_0x5267('0x12')](_0x487dfc['query'][_0x5267('0x12')]);}_0x5ef02e[_0x5267('0x3d')]=qs[_0x5267('0x3e')](_0x487dfc[_0x5267('0x35')][_0x5267('0x3e')]);_0x5ef02e['where']=qs[_0x5267('0x3f')](_['pick'](_0x487dfc[_0x5267('0x35')],_0x3db34d['filters']),_0x4dee66);var _0x4ae9f9=[];var _0x37ec6c=squel['select']()[_0x5267('0x40')]('id')[_0x5267('0x40')](_0x5267('0x34'))[_0x5267('0x40')]('color')[_0x5267('0x41')]('tools_tags');var _0x4b8db5=squel[_0x5267('0x42')]()[_0x5267('0x40')]('u.id')['field'](_0x5267('0x43'))[_0x5267('0x40')](_0x5267('0x44'))[_0x5267('0x41')](_0x5267('0x45'),'ui')[_0x5267('0x46')](_0x5267('0x47'),'u',_0x5267('0x48'));var _0x4332c7=squel[_0x5267('0x42')]()[_0x5267('0x41')](_0x5267('0x49'),'i')[_0x5267('0x46')](_0x5267('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5267('0x46')](_0x5267('0x47'),'o',_0x5267('0x4b'))['left_join'](_0x5267('0x4c'),'a',_0x5267('0x4d'))[_0x5267('0x46')](_0x5267('0x4e'),'me',_0x5267('0x4f'))[_0x5267('0x46')]('mail_interaction_has_tags','it',_0x5267('0x50'))['left_join'](_0x5267('0x51'),'t',_0x5267('0x52'));var _0xa49fd7=squel[_0x5267('0x53')]();var _0x91b932=[];var _0x3f9664=squel[_0x5267('0x53')]();var _0x577c1a;if(_0x487dfc['query'][_0x5267('0x54')]){_0x577c1a=as[_0x5267('0x55')](_0x487dfc['query'][_0x5267('0x54')]);var _0x578e4e=_0x577c1a['sqlOperator'];for(var _0x1eeb21=0x0;_0x1eeb21<_0x577c1a[_0x5267('0x56')][_0x5267('0x3a')];_0x1eeb21++){var _0x194519=_0x577c1a[_0x5267('0x56')][_0x1eeb21];var _0x3e7e6a='i';var _0xe33b95=_[_0x5267('0x57')](_0x4dee66,[_0x5267('0x34'),_0x194519[_0x5267('0x40')]]);if(!_0xe33b95){switch(_0x194519['field']){case _0x5267('0x58'):if(_0x194519[_0x5267('0x59')]==0x1){_0x4332c7[_0x5267('0x5a')]('`'+_0x194519[_0x5267('0x40')]+_0x5267('0x5b'));}else{_0x4332c7[_0x5267('0x5a')]('`'+_0x194519['field']+_0x5267('0x5c'));}break;case'Contact':if(_0x194519[_0x5267('0x5d')]===_0x5267('0x5e')){if(_0x194519[_0x5267('0x59')]['split']('\x20')[_0x5267('0x3a')]>0x1){_0xa49fd7[_0x578e4e](_0x5267('0x5f'),qs[_0x5267('0x60')](_0x194519[_0x5267('0x59')]),null);}else{var _0x316988='%'+_0x194519[_0x5267('0x59')]+'%';_0xa49fd7[_0x578e4e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x316988,_0x316988,_0x316988);}}else{_0xe33b95=_[_0x5267('0x57')](_0x4dee66,[_0x5267('0x34'),_0x5267('0x61')]);_0x194519[_0x5267('0x40')]='ContactId';_0x3745b3=as['buildExpression'](_0x3e7e6a,_0xe33b95[_0x5267('0x32')],_0x194519);_0xa49fd7[_0x578e4e](_0x3745b3['text'],_0x3745b3[_0x5267('0x59')][_0x5267('0x62')],_0x3745b3['value']['end']);}break;case _0x5267('0x63'):var _0x1f01e4=_0x194519[_0x5267('0x59')]['split'](',')[_0x5267('0x1d')](function(_0xc88193){return Number(_0xc88193);});_0x1f01e4[_0x5267('0x20')](function(_0x2043e8){_0x3f9664['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2043e8+',%');});_0x91b932=_['union'](_0x91b932,_0x1f01e4);break;case'User':if(_0x194519[_0x5267('0x5d')]===_0x5267('0x5e')){_0xa49fd7[_0x578e4e](_0x5267('0x64'),'%'+_0x194519[_0x5267('0x59')]+'%',null);}else{_0xe33b95=_[_0x5267('0x57')](_0x4dee66,[_0x5267('0x34'),_0x5267('0x2e')]);_0x194519[_0x5267('0x40')]='UserId';_0x3745b3=as[_0x5267('0x65')](_0x3e7e6a,_0xe33b95[_0x5267('0x32')],_0x194519);_0xa49fd7[_0x578e4e](_0x3745b3['text'],_0x3745b3[_0x5267('0x59')][_0x5267('0x62')],_0x3745b3[_0x5267('0x59')][_0x5267('0x10')]);}break;case _0x5267('0x24'):_0x3745b3=as[_0x5267('0x65')]('me',null,_0x194519);_0xa49fd7[_0x578e4e](_0x3745b3['text'],_0x3745b3[_0x5267('0x59')][_0x5267('0x62')],_0x3745b3[_0x5267('0x59')][_0x5267('0x10')]);break;}}else{var _0x3745b3=as[_0x5267('0x65')](_0x3e7e6a,_0xe33b95['type'],_0x194519);_0xa49fd7[_0x578e4e](_0x3745b3[_0x5267('0x66')],_0x3745b3[_0x5267('0x59')][_0x5267('0x62')],_0x3745b3[_0x5267('0x59')][_0x5267('0x10')]);}}}else{var _0x3384c6=_(_0x487dfc['query'])[_0x5267('0x67')]()[_0x5267('0x1d')](function(_0x9aef0){return _[_0x5267('0x68')](_0x4dee66,['name',_0x9aef0])?_0x9aef0:undefined;})['compact']()['value']();if(!_[_0x5267('0x69')](_0x3384c6)){_0x3384c6['forEach'](function(_0xd7789e){if(_0xd7789e==='MailAccountId'){_0x4332c7[_0x5267('0x6a')](_0x5267('0x6b'),[][_0x5267('0x6c')](_0x487dfc[_0x5267('0x35')][_0xd7789e]));}else if(_0xd7789e===_0x5267('0x6d')){var _0xa92aa5=JSON[_0x5267('0x6e')](_0x487dfc[_0x5267('0x35')][_0xd7789e])['$gte'];var _0x489f46=JSON['parse'](_0x487dfc[_0x5267('0x35')][_0xd7789e])[_0x5267('0x6f')];_0x4332c7[_0x5267('0x6a')](_0x5267('0x70'),_0xa92aa5,_0x489f46);}else{if(_0x487dfc['query'][_0xd7789e]===_0x5267('0x71')){_0x4332c7[_0x5267('0x6a')]('i.'+_0xd7789e+_0x5267('0x72'));}else{_0x4332c7[_0x5267('0x6a')]('i.'+_0xd7789e+'\x20=\x20?',_0x487dfc[_0x5267('0x35')][_0xd7789e]);}}});}if(_0x487dfc[_0x5267('0x35')]['read']){if(_0x487dfc[_0x5267('0x35')][_0x5267('0x73')]==0x1){_0x4332c7['having']('`unreadMessages`\x20=\x200');}else{_0x4332c7[_0x5267('0x5a')](_0x5267('0x74'));}}if(_0x487dfc['query']['tag']){_0x91b932=_[_0x5267('0x75')](_0x487dfc[_0x5267('0x35')][_0x5267('0x76')])?_0x487dfc[_0x5267('0x35')][_0x5267('0x76')]:new Array(_0x487dfc['query'][_0x5267('0x76')]);_0x91b932[_0x5267('0x20')](function(_0x538786){_0x3f9664['or'](_0x5267('0x77'),'%,'+_0x538786+',%');});}if(_0x487dfc[_0x5267('0x35')][_0x5267('0x78')]){var _0xb6f237=_0x487dfc[_0x5267('0x35')][_0x5267('0x78')][_0x5267('0x79')]('\x5c','\x5c\x5c')[_0x5267('0x79')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xb6f237)){_0xa49fd7['or']('i.id\x20LIKE\x20?',_0xb6f237+'%');}else if(qs[_0x5267('0x7a')](_0xb6f237)){_0xa49fd7['or'](_0x5267('0x7b'),_0xb6f237+'%');}else{_0xa49fd7['or'](_0x5267('0x7c'),qs[_0x5267('0x60')](_0xb6f237))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5267('0x60')](_0xb6f237));}}}_0x4332c7['where'](_0xa49fd7);_0x4332c7[_0x5267('0x7d')](_0x5267('0x7e'));var _0x1bf43a={'type':db[_0x5267('0x7f')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3a67a0=_0x4332c7[_0x5267('0x80')]();_0x3a67a0[_0x5267('0x40')](_0x5267('0x7e'));_0x3a67a0[_0x5267('0x40')](_0x5267('0x81'),'unreadMessages');if(_0x5ef02e[_0x5267('0x3d')]){_0x5ef02e['order'][_0x5267('0x20')](function(_0x5b8026){var _0x2c2b95=_0x5b8026[0x0]===_0x5267('0x82')?_0x5b8026[0x0]:'i.'+_0x5b8026[0x0];_0x4332c7[_0x5267('0x3d')](_0x2c2b95,_0x5b8026[0x1]===_0x5267('0x83')?![]:!![]);});}if(!_[_0x5267('0x69')](_0x91b932)){_0x4332c7[_0x5267('0x5a')](_0x3f9664);_0x3a67a0[_0x5267('0x6a')](_0x5267('0x84'),_0x91b932);}BPromise[_0x5267('0x85')]()[_0x5267('0x18')](function(){if(!_0x577c1a){if(_0x487dfc[_0x5267('0x35')]['MailAccountId'])return;_0x3a67a0[_0x5267('0x6a')](_0x5267('0x86'));_0x4332c7['where'](_0x5267('0x86'));return;}if(_0x487dfc[_0x5267('0x87')][_0x5267('0x88')]!==_0x5267('0x89'))return;return _0x487dfc[_0x5267('0x87')][_0x5267('0x8a')]({'attributes':['id'],'raw':!![]})[_0x5267('0x18')](function(_0x49ad09){if(_[_0x5267('0x69')](_0x49ad09)){_0x3a67a0[_0x5267('0x6a')](_0x5267('0x8b'));_0x4332c7[_0x5267('0x6a')](_0x5267('0x8b'));}else{_0x3a67a0['where']('i.MailAccountId\x20IN\x20?',_[_0x5267('0x1d')](_0x49ad09,'id'));_0x4332c7[_0x5267('0x6a')](_0x5267('0x6b'),_[_0x5267('0x1d')](_0x49ad09,'id'));}});})['then'](function(){if(_0x487dfc[_0x5267('0x87')][_0x5267('0x88')]===_0x5267('0x89')&&!_0x577c1a&&!_0x487dfc[_0x5267('0x35')][_0x5267('0x8c')])return[];return db[_0x5267('0x8d')][_0x5267('0x35')](_0x3a67a0[_0x5267('0x8e')](),_0x1bf43a);})[_0x5267('0x18')](function(_0x22875c){_0x5c0cdf[_0x5267('0x14')]=_0x22875c[_0x5267('0x3a')];if(_0x5c0cdf[_0x5267('0x14')]===0x0)return[];return db['sequelize'][_0x5267('0x35')](_0x37ec6c[_0x5267('0x8e')](),_0x1bf43a)[_0x5267('0x18')](function(_0x16374d){_0x4ae9f9=_[_0x5267('0x8f')](_0x16374d,'id');_0x1bf43a=_[_0x5267('0x90')](_0x1bf43a,{'model':db[_0x5267('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x487dfc[_0x5267('0x35')][_0x5267('0x39')]){_0x5ef02e[_0x5267('0x38')][_0x5267('0x20')](function(_0x24058e){_0x4332c7[_0x5267('0x40')]('i.'+_0x24058e);});}else{_0x4332c7[_0x5267('0x40')](_0x5267('0x81'),_0x5267('0x58'));_0x4332c7[_0x5267('0x40')](_0x5267('0x91'),_0x5267('0x92'));_0x4332c7[_0x5267('0x40')](_0x5267('0x93'),_0x5267('0x94'));_0x4332c7[_0x5267('0x40')]('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',_0x5267('0x82'));_0x4332c7[_0x5267('0x40')](_0x5267('0x7e'));_0x4332c7[_0x5267('0x40')](_0x5267('0x95'));_0x4332c7['field'](_0x5267('0x96'));_0x4332c7[_0x5267('0x40')]('i.closed');_0x4332c7['field']('i.closedAt');_0x4332c7[_0x5267('0x40')]('i.attach');_0x4332c7[_0x5267('0x40')]('i.lastMsgAt');_0x4332c7['field'](_0x5267('0x97'));_0x4332c7[_0x5267('0x40')](_0x5267('0x98'));_0x4332c7[_0x5267('0x40')](_0x5267('0x99'));_0x4332c7['field']('i.secondDisposition');_0x4332c7[_0x5267('0x40')](_0x5267('0x9a'));_0x4332c7[_0x5267('0x40')](_0x5267('0x9b'));_0x4332c7[_0x5267('0x40')]('i.to');_0x4332c7[_0x5267('0x40')]('i.ContactId');_0x4332c7['field'](_0x5267('0x9c'));_0x4332c7['field']('i.UserId');_0x4332c7[_0x5267('0x40')](_0x5267('0x9d'),'Contact.firstName');_0x4332c7['field']('c.lastName',_0x5267('0x9e'));_0x4332c7['field'](_0x5267('0x9f'),'Contact.email');_0x4332c7[_0x5267('0x40')](_0x5267('0xa0'),'Contact.phone');_0x4332c7[_0x5267('0x40')](_0x5267('0xa1'),_0x5267('0xa2'));_0x4332c7[_0x5267('0x40')](_0x5267('0xa3'),_0x5267('0xa4'));_0x4332c7['field']('o.fullname',_0x5267('0xa5'));_0x4332c7['field']('o.internal',_0x5267('0xa6'));_0x4332c7['field'](_0x5267('0xa7'),'TagIds');}if(_0x5ef02e[_0x5267('0x15')])_0x4332c7['limit'](_0x5ef02e[_0x5267('0x15')]);if(_0x5ef02e[_0x5267('0x12')])_0x4332c7[_0x5267('0x12')](_0x5ef02e[_0x5267('0x12')]);return db[_0x5267('0x8d')][_0x5267('0x35')](_0x4332c7[_0x5267('0x8e')](),_0x1bf43a);})['then'](function(_0x4df99f){if(_0x4df99f[_0x5267('0x3a')]>0x0)_0x4b8db5['where']('ui.MailInteractionId\x20IN\x20?',_['map'](_0x4df99f,'id'));return db['sequelize']['query'](_0x4b8db5['toString'](),_0x1bf43a)[_0x5267('0x18')](function(_0x43d554){var _0x15a05a=_[_0x5267('0xa8')](_0x43d554,_0x5267('0xa9'));var _0xe2cde4=[];return db[_0x5267('0xaa')][_0x5267('0x22')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x5e2a93){var _0x25d4e1=_0x5e2a93[_0x5267('0xab')];_0x4df99f['forEach'](function(_0x216107){_0xe2cde4[_0x5267('0xac')](updateMailInteraction(_0x216107,_0x4ae9f9,_0x15a05a,_0x25d4e1));});return BPromise[_0x5267('0xad')](_0xe2cde4);});});});})[_0x5267('0x18')](function(_0x535422){_0x5c0cdf['rows']=_0x535422;return _0x5c0cdf;})[_0x5267('0x18')](respondWithFilteredResult(_0x2dc5cc,_0x5ef02e))[_0x5267('0x27')](handleError(_0x2dc5cc,null));};exports[_0x5267('0xae')]=function(_0x96fba5,_0x3e4240){var _0x174e2b={'raw':![],'where':{'id':_0x96fba5['params']['id']}},_0x3fd3f1={};_0x3fd3f1['model']=_['keys'](db[_0x5267('0x30')][_0x5267('0xaf')]);_0x3fd3f1[_0x5267('0x35')]=_[_0x5267('0x67')](_0x96fba5[_0x5267('0x35')]);_0x3fd3f1[_0x5267('0x3f')]=_['intersection'](_0x3fd3f1[_0x5267('0x37')],_0x3fd3f1['query']);_0x174e2b[_0x5267('0x38')]=_[_0x5267('0x36')](_0x3fd3f1[_0x5267('0x37')],qs[_0x5267('0x39')](_0x96fba5[_0x5267('0x35')]['fields']));_0x174e2b[_0x5267('0x38')]=_0x174e2b[_0x5267('0x38')][_0x5267('0x3a')]?_0x174e2b['attributes']:_0x3fd3f1['model'];if(_0x96fba5['query'][_0x5267('0xb0')]){_0x174e2b[_0x5267('0xb1')]=[{'all':!![]}];}_0x174e2b=_[_0x5267('0x90')]({},_0x174e2b,_0x96fba5[_0x5267('0xb2')]);return db['MailInteraction']['find'](_0x174e2b)[_0x5267('0x18')](handleEntityNotFound(_0x3e4240,null))[_0x5267('0x18')](respondWithResult(_0x3e4240,null))['catch'](handleError(_0x3e4240,null));};exports[_0x5267('0xb3')]=function(_0x3f4659,_0x55021c){return db['MailInteraction'][_0x5267('0xb3')](_0x3f4659[_0x5267('0xb4')],{})['then'](respondWithResult(_0x55021c,0xc9))[_0x5267('0x27')](handleError(_0x55021c,null));};exports[_0x5267('0xb5')]=function(_0x445a49,_0x1291bc){if(_0x445a49[_0x5267('0xb4')]['id']){delete _0x445a49[_0x5267('0xb4')]['id'];}return db[_0x5267('0x30')][_0x5267('0x57')]({'where':{'id':_0x445a49[_0x5267('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1291bc,null))['then'](saveUpdates(_0x445a49[_0x5267('0xb4')],null))['then'](respondWithResult(_0x1291bc,null))[_0x5267('0x27')](handleError(_0x1291bc,null));};exports[_0x5267('0x19')]=function(_0x2722f9,_0x20c270){return db[_0x5267('0x30')][_0x5267('0x57')]({'where':{'id':_0x2722f9[_0x5267('0xb6')]['id']}})[_0x5267('0x18')](handleEntityNotFound(_0x20c270,null))[_0x5267('0x18')](removeEntity(_0x20c270,null))[_0x5267('0x27')](handleError(_0x20c270,null));};exports[_0x5267('0xb7')]=function(_0x11acb9,_0x5909b3){return db[_0x5267('0x30')]['describe']()['then'](respondWithResult(_0x5909b3,null))[_0x5267('0x27')](handleError(_0x5909b3,null));};exports[_0x5267('0xb8')]=function(_0x1d7987,_0x59efe1){return db[_0x5267('0xb9')][_0x5267('0x57')]({'where':{'id':_0x1d7987[_0x5267('0xb6')]['id']}})[_0x5267('0x18')](handleEntityNotFound(_0x59efe1,null))[_0x5267('0x18')](function(_0x46c79e){if(_0x46c79e){return _0x46c79e[_0x5267('0xb8')](_0x1d7987[_0x5267('0xb4')][_0x5267('0xba')],_[_0x5267('0xbb')](_0x1d7987[_0x5267('0xb4')],[_0x5267('0xba'),'id'])||{});}})['then'](respondWithResult(_0x59efe1,null))[_0x5267('0x27')](handleError(_0x59efe1,null));};exports[_0x5267('0xbc')]=function(_0x53d571,_0x262af9){var _0x37b08e={'raw':![],'where':{}};var _0x2da5ea={};var _0x3cdf6b={'count':0x0,'rows':[]};return db['MailInteraction'][_0x5267('0x22')]({'where':{'id':_0x53d571[_0x5267('0xb6')]['id']}})[_0x5267('0x18')](handleEntityNotFound(_0x262af9,null))['then'](function(_0x3fdb4d){if(_0x3fdb4d){_0x2da5ea[_0x5267('0x37')]=_[_0x5267('0x67')](db[_0x5267('0xb9')][_0x5267('0xaf')]);_0x2da5ea[_0x5267('0x35')]=_[_0x5267('0x67')](_0x53d571[_0x5267('0x35')]);_0x2da5ea[_0x5267('0x3f')]=_['intersection'](_0x2da5ea[_0x5267('0x37')],_0x2da5ea[_0x5267('0x35')]);_0x37b08e['attributes']=_[_0x5267('0x36')](_0x2da5ea['model'],qs[_0x5267('0x39')](_0x53d571['query'][_0x5267('0x39')]));_0x37b08e[_0x5267('0x38')]=_0x37b08e['attributes']['length']?_0x37b08e[_0x5267('0x38')]:_0x2da5ea[_0x5267('0x37')];if(!_0x53d571[_0x5267('0x35')][_0x5267('0x3b')](_0x5267('0x3c'))){_0x37b08e['limit']=qs[_0x5267('0x15')](_0x53d571['query']['limit']);_0x37b08e['offset']=qs[_0x5267('0x12')](_0x53d571[_0x5267('0x35')][_0x5267('0x12')]);}_0x37b08e[_0x5267('0x3d')]=qs[_0x5267('0x3e')](_0x53d571[_0x5267('0x35')][_0x5267('0x3e')]);_0x37b08e['where']=qs['filters'](_[_0x5267('0xbd')](_0x53d571[_0x5267('0x35')],_0x2da5ea[_0x5267('0x3f')]));_0x37b08e[_0x5267('0x6a')][_0x5267('0xa9')]=_0x3fdb4d['id'];if(_0x53d571['query'][_0x5267('0x78')]){_0x37b08e[_0x5267('0x6a')]=_[_0x5267('0x90')](_0x37b08e[_0x5267('0x6a')],{'$or':_[_0x5267('0x1d')](_0x37b08e['attributes'],function(_0x3ab097){var _0x24e500={};_0x24e500[_0x3ab097]={'$like':'%'+_0x53d571[_0x5267('0x35')]['filter']+'%'};return _0x24e500;})});}if(_0x53d571[_0x5267('0x35')]['$gte']){var _0x2017e9=_0x53d571[_0x5267('0x35')]['$gte'][_0x5267('0x1f')](',');var _0x5cadcd={};_0x5cadcd[_0x2017e9[0x0]]={'$gte':moment(_0x2017e9[0x1])[_0x5267('0xbe')](_0x5267('0xbf'))};_0x37b08e['where']=_[_0x5267('0x90')](_0x37b08e[_0x5267('0x6a')],_0x5cadcd);}_0x37b08e=_['merge']({},_0x37b08e,_0x53d571[_0x5267('0xb2')]);return db[_0x5267('0xb9')][_0x5267('0x14')]({'where':_0x37b08e[_0x5267('0x6a')]})[_0x5267('0x18')](function(_0x4ebfec){_0x3cdf6b['count']=_0x4ebfec;if(_0x53d571[_0x5267('0x35')][_0x5267('0xb0')]){_0x37b08e['include']=[{'all':!![]}];}return db[_0x5267('0xb9')]['findAll'](_0x37b08e);})[_0x5267('0x18')](function(_0x43b941){if(_0x53d571[_0x5267('0x35')][_0x5267('0xc0')]===_0x5267('0xc1')){for(var _0xc5908b=0x0;_0xc5908b<_0x43b941[_0x5267('0x3a')];_0xc5908b++){_0x43b941[_0xc5908b][_0x5267('0xb4')]=juice(_0x43b941[_0xc5908b][_0x5267('0xb4')]);}}_0x3cdf6b[_0x5267('0xc2')]=_0x43b941;return _0x3cdf6b;});}})[_0x5267('0x18')](respondWithFilteredResult(_0x262af9,_0x37b08e))[_0x5267('0x27')](handleError(_0x262af9,null));};exports['addTags']=function(_0x176709,_0xeb1871){return db[_0x5267('0x30')][_0x5267('0x57')]({'where':{'id':_0x176709[_0x5267('0xb6')]['id']}})[_0x5267('0x18')](handleEntityNotFound(_0xeb1871,null))[_0x5267('0x18')](function(_0x1c1719){if(_0x1c1719){return _0x1c1719[_0x5267('0xc3')](_0x176709[_0x5267('0xb4')][_0x5267('0xba')],_[_0x5267('0xbb')](_0x176709[_0x5267('0xb4')],[_0x5267('0xba'),'id'])||{})[_0x5267('0xc4')](function(){return db['Tag'][_0x5267('0xc5')]({'attributes':['id',_0x5267('0x34'),_0x5267('0xc6')],'where':{'id':_0x176709['body']['ids']}});})[_0x5267('0x18')](function(_0x5cb1a9){socket['emit'](_0x5267('0xc7'),{'id':Number(_0x176709[_0x5267('0xb6')]['id']),'tags':_0x5cb1a9||[]});return{'id':Number(_0x176709['params']['id']),'tags':_0x5cb1a9||[]};});}})['then'](respondWithResult(_0xeb1871,null))[_0x5267('0x27')](handleError(_0xeb1871,null));};exports[_0x5267('0xc8')]=function(_0x29ecb9,_0x43db60){return db['MailInteraction'][_0x5267('0x57')]({'where':{'id':_0x29ecb9[_0x5267('0xb6')]['id']}})['then'](handleEntityNotFound(_0x43db60,null))[_0x5267('0x18')](function(_0x2f6c0e){if(_0x2f6c0e){return _0x2f6c0e[_0x5267('0xc8')](_0x29ecb9[_0x5267('0x35')][_0x5267('0xba')]);}})[_0x5267('0x18')](respondWithStatusCode(_0x43db60,null))[_0x5267('0x27')](handleError(_0x43db60,null));};exports[_0x5267('0xc9')]=function(_0x3937fe,_0x3529ae){var _0x3c39d4=moment()[_0x5267('0xca')]()[_0x5267('0x8e')]();var _0x220ae7=path[_0x5267('0xcb')](config[_0x5267('0xcc')],'server',_0x5267('0xcd'),_0x5267('0xce'));var _0x3c6cbf=path[_0x5267('0xcb')](config[_0x5267('0xcc')],_0x5267('0xcf'),_0x5267('0xcd'),'attachments');var _0x12b78b=path['join'](_0x220ae7,_0x3c39d4);var _0x1e8fa8=util[_0x5267('0xbe')](_0x5267('0xd0'),_0x3937fe[_0x5267('0xb6')]['id'],_0x3c39d4);var _0x5f698c=path['join'](_0x220ae7,_0x1e8fa8);var _0x252dfc=[];if(_0x3937fe[_0x5267('0x35')][_0x5267('0xd1')]){_0x252dfc[_0x5267('0xac')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x25d517=[{'model':db[_0x5267('0xb9')],'as':'Messages','attributes':['id',_0x5267('0xb4'),_0x5267('0x41'),'to','cc',_0x5267('0xd2'),_0x5267('0xd3'),'createdAt'],'where':{'secret':![]},'order':qs[_0x5267('0x3e')]('id'),'include':_0x252dfc}];return db['MailInteraction']['find']({'where':{'id':_0x3937fe[_0x5267('0xb6')]['id']},'include':_0x25d517})[_0x5267('0x18')](handleEntityNotFound(_0x3529ae,null))[_0x5267('0x18')](function(_0x4e0b1c){if(_0x4e0b1c&&_0x4e0b1c[_0x5267('0xd4')]){var _0x297d06=_0x4e0b1c['get']({'plain':!![]});fs[_0x5267('0xd5')](_0x12b78b);return BPromise['each'](_0x297d06['Messages'],function(_0x599091,_0x26620c){var _0x160389={'from':_0x599091['from'],'to':_0x599091['to'],'subject':_0x599091[_0x5267('0xd3')],'html':htmlEntities[_0x5267('0xd6')](_0x599091[_0x5267('0xb4')]),'headers':{'Date':moment(_0x599091[_0x5267('0x6d')])[_0x5267('0xbe')](_0x5267('0xd7'))},'attachments':[]};if(_0x599091['cc']){_0x160389[_0x5267('0xd8')]['Cc']=_0x599091['cc'];}if(_0x599091[_0x5267('0xd2')]){_0x160389[_0x5267('0xd8')][_0x5267('0xd9')]=_0x599091[_0x5267('0xd2')];}return new BPromise(function(_0x5aa880,_0x36afed){if(_0x599091['Attachments']){for(var _0xbed87e=0x0;_0xbed87e<_0x599091[_0x5267('0xda')][_0x5267('0x3a')];_0xbed87e++){var _0x379585=_0x599091[_0x5267('0xda')][_0xbed87e];var _0x23389c=path['join'](_0x3c6cbf,_0x379585[_0x5267('0xdb')]);if(fs[_0x5267('0xdc')](_0x23389c)){_0x160389[_0x5267('0xd1')]['push']({'name':_0x379585[_0x5267('0x34')],'contentType':_0x379585[_0x5267('0x32')],'data':fs['readFileSync'](_0x23389c)});}}}emlformat[_0x5267('0xdd')](_0x160389,function(_0x464dea,_0x30ef21){if(_0x464dea)return _0x36afed(_0x464dea);fs[_0x5267('0xde')](path[_0x5267('0xcb')](_0x12b78b,util['format'](_0x5267('0xdf'),_0x26620c)),_0x30ef21);return _0x5aa880(_0x30ef21);});});})[_0x5267('0x18')](function(){return new BPromise(function(_0x3ee247,_0x487224){zipdir(_0x12b78b,{'saveTo':_0x5f698c},function(_0x107993,_0x2880ba){if(_0x107993)return _0x487224(_0x107993);return _0x3ee247(_0x2880ba);});})[_0x5267('0x18')](function(){return new BPromise(function(_0x2db95e,_0x730f99){rimraf(_0x12b78b,function(_0x1ca1d1){if(_0x1ca1d1)_0x730f99(_0x1ca1d1);return _0x2db95e();});});})[_0x5267('0x18')](function(){return _0x3529ae[_0x5267('0xc9')](_0x5f698c,_0x1e8fa8,function(_0x17c6a7){if(!_0x17c6a7)fs[_0x5267('0xe0')](_0x5f698c);});});});}else{return _0x3529ae['sendStatus'](0xc8);}})['catch'](handleError(_0x3529ae,null));}; \ No newline at end of file +var _0x8ca9=['t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','MailAccountId','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','contactName','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','show','params','includeAll','include','merge','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','end','error','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','out','plainBody','lastMsgText','then','catch','talking','answered','unmanaged','closed','UserId','waiting','total','index','map','MailInteraction','rawAttributes','fieldName','type','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id'];(function(_0x1c31e3,_0x87d2fc){var _0x124b75=function(_0x42d1ed){while(--_0x42d1ed){_0x1c31e3['push'](_0x1c31e3['shift']());}};_0x124b75(++_0x87d2fc);}(_0x8ca9,0x9c));var _0x98ca=function(_0x379a31,_0x270fb0){_0x379a31=_0x379a31-0x0;var _0x412eea=_0x8ca9[_0x379a31];return _0x412eea;};'use strict';var emlformat=require(_0x98ca('0x0'));var rimraf=require(_0x98ca('0x1'));var zipdir=require(_0x98ca('0x2'));var moment=require(_0x98ca('0x3'));var BPromise=require(_0x98ca('0x4'));var util=require(_0x98ca('0x5'));var path=require(_0x98ca('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require(_0x98ca('0x7'));var Redis=require('ioredis');var qs=require(_0x98ca('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x98ca('0x9'))(_0x98ca('0xa'));var config=require(_0x98ca('0xb'));var db=require(_0x98ca('0xc'))['db'];var htmlEntities=require(_0x98ca('0xd'));config[_0x98ca('0xe')]=_[_0x98ca('0xf')](config[_0x98ca('0xe')],{'host':_0x98ca('0x10'),'port':0x18eb});var socket=require(_0x98ca('0x11'))(new Redis(config[_0x98ca('0xe')]));require(_0x98ca('0x12'))[_0x98ca('0x13')](socket);function respondWithStatusCode(_0x1bec99,_0x220a97){_0x220a97=_0x220a97||0xcc;return function(_0x3b8e87){if(_0x3b8e87){return _0x1bec99[_0x98ca('0x14')](_0x220a97);}return _0x1bec99[_0x98ca('0x15')](_0x220a97)['end']();};}function respondWithResult(_0x16221a,_0x44b65b){_0x44b65b=_0x44b65b||0xc8;return function(_0xba3887){if(_0xba3887){return _0x16221a[_0x98ca('0x15')](_0x44b65b)['json'](_0xba3887);}};}function respondWithFilteredResult(_0xf78589,_0x6345be){return function(_0x9a230e){if(_0x9a230e){var _0xa2bab4=typeof _0x6345be[_0x98ca('0x16')]===_0x98ca('0x17')&&typeof _0x6345be[_0x98ca('0x18')]==='undefined';var _0x330713=_0x9a230e[_0x98ca('0x19')];var _0x29f46b=_0xa2bab4?0x0:_0x6345be[_0x98ca('0x16')];var _0x52e9c8=_0xa2bab4?_0x9a230e[_0x98ca('0x19')]:_0x6345be[_0x98ca('0x16')]+_0x6345be[_0x98ca('0x18')];var _0x1ce43a;if(_0x52e9c8>=_0x330713){_0x52e9c8=_0x330713;_0x1ce43a=0xc8;}else{_0x1ce43a=0xce;}_0xf78589[_0x98ca('0x15')](_0x1ce43a);return _0xf78589[_0x98ca('0x1a')](_0x98ca('0x1b'),_0x29f46b+'-'+_0x52e9c8+'/'+_0x330713)[_0x98ca('0x1c')](_0x9a230e);}return null;};}function saveUpdates(_0xddec43){return function(_0x110f9f){if(_0x110f9f){return _0x110f9f[_0x98ca('0x1d')](_0xddec43)['then'](function(_0x626b37){return _0x626b37;});}return null;};}function removeEntity(_0x49298d){return function(_0x47a3f1){if(_0x47a3f1){return _0x47a3f1[_0x98ca('0x1e')]()['then'](function(){_0x49298d['status'](0xcc)[_0x98ca('0x1f')]();});}};}function handleEntityNotFound(_0x170688){return function(_0x130544){if(!_0x130544){_0x170688['sendStatus'](0x194);}return _0x130544;};}function handleError(_0x2f7742,_0xc23332){_0xc23332=_0xc23332||0x1f4;return function(_0x56f799){logger[_0x98ca('0x20')](_0x56f799['stack']);if(_0x56f799[_0x98ca('0x21')]){delete _0x56f799[_0x98ca('0x21')];}_0x2f7742[_0x98ca('0x15')](_0xc23332)[_0x98ca('0x22')](_0x56f799);};}function getInteractionUsers(_0x8d669d,_0xe5091e){return new BPromise(function(_0x2a59e3,_0x50b1a2){try{if(_0xe5091e[_0x8d669d['id']]){_0x8d669d[_0x98ca('0x23')]=_['map'](_0xe5091e[_0x8d669d['id']],function(_0x989cc4){return{'id':_0x989cc4['id'],'fullname':_0x989cc4[_0x98ca('0x24')]};});}}catch(_0x5eb829){_0x50b1a2(_0x5eb829);}_0x2a59e3(_0x8d669d);});}function getInteractionTags(_0x1f569b,_0x47d89f){return new BPromise(function(_0x214649,_0x4f48db){try{if(_0x1f569b['TagIds']){_0x1f569b[_0x98ca('0x25')]=[];_0x1f569b['TagIds'][_0x98ca('0x26')](',')[_0x98ca('0x27')](function(_0x13f766){_0x1f569b[_0x98ca('0x25')][_0x98ca('0x28')](_0x47d89f[_0x13f766]);});}delete _0x1f569b[_0x98ca('0x29')];}catch(_0x11389a){_0x4f48db(_0x11389a);}_0x214649(_0x1f569b);});}function getLastMessageText(_0x1bf154){return new BPromise(function(_0x447881,_0x4f2406){return db[_0x98ca('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1bf154['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x98ca('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x98ca('0x2c')],'order':'-id','raw':!![]})['then'](function(_0x5adf7d){if(_0x5adf7d&&_0x5adf7d['plainBody']){_0x1bf154[_0x98ca('0x2d')]=_['trimStart'](_0x5adf7d[_0x98ca('0x2c')]);}_0x447881(_0x1bf154);})['catch'](function(_0x401034){_0x4f2406(_0x401034);});});}function updateMailInteraction(_0x341de3,_0x5d98b3,_0x3cda27,_0x3d863c){return new BPromise(function(_0x5551b4,_0x356cf5){return getInteractionUsers(_0x341de3,_0x3cda27)[_0x98ca('0x2e')](function(_0x5d94ba){return getInteractionTags(_0x5d94ba,_0x5d98b3);})[_0x98ca('0x2e')](function(_0x428d75){return getStateInteraction(_0x428d75);})[_0x98ca('0x2e')](function(_0x396803){if(_0x3d863c){_0x5551b4(getLastMessageText(_0x396803));}else{_0x5551b4(_0x396803);}})[_0x98ca('0x2f')](function(_0x47b1c1){_0x356cf5(_0x47b1c1);});});}function getStateInteraction(_0x15e428){return new BPromise(function(_0x430a37){_0x15e428['waiting']=0x0;_0x15e428[_0x98ca('0x30')]=0x0;_0x15e428[_0x98ca('0x31')]=0x0;_0x15e428[_0x98ca('0x32')]=0x0;_0x15e428['total']=0x0;if(!_0x15e428[_0x98ca('0x33')]&&!_0x15e428[_0x98ca('0x34')]){_0x15e428[_0x98ca('0x35')]+=0x1;}if(!_0x15e428['closed']&&_0x15e428[_0x98ca('0x34')]){_0x15e428[_0x98ca('0x30')]+=0x1;if(_0x15e428[_0x98ca('0x35')]){_0x15e428['waiting']-=0x1;}}if(_0x15e428['closed']&&_0x15e428[_0x98ca('0x34')]){_0x15e428[_0x98ca('0x31')]+=0x1;if(_0x15e428[_0x98ca('0x30')]){_0x15e428['talking']-=0x1;}}if(_0x15e428[_0x98ca('0x33')]&&!_0x15e428[_0x98ca('0x34')]){_0x15e428[_0x98ca('0x32')]+=0x1;if(_0x15e428['waiting']){_0x15e428[_0x98ca('0x35')]-=0x1;}}_0x15e428[_0x98ca('0x36')]+=0x1;_0x430a37(_0x15e428);});}exports[_0x98ca('0x37')]=function(_0x450745,_0x1b41c5){var _0x5d924c={},_0x578b2f={},_0x4b811b={'count':0x0,'rows':[]};var _0x405691=_[_0x98ca('0x38')](db[_0x98ca('0x39')][_0x98ca('0x3a')],function(_0x43ba26){return{'name':_0x43ba26[_0x98ca('0x3b')],'type':_0x43ba26[_0x98ca('0x3c')]['key']};});_0x578b2f['model']=_[_0x98ca('0x38')](_0x405691,_0x98ca('0x21'));_0x578b2f[_0x98ca('0x3d')]=_[_0x98ca('0x3e')](_0x450745[_0x98ca('0x3d')]);_0x578b2f['filters']=_['intersection'](_0x578b2f['model'],_0x578b2f[_0x98ca('0x3d')]);_0x5d924c[_0x98ca('0x3f')]=_[_0x98ca('0x40')](_0x578b2f[_0x98ca('0x41')],qs['fields'](_0x450745['query'][_0x98ca('0x42')]));_0x5d924c[_0x98ca('0x3f')]=_0x5d924c[_0x98ca('0x3f')][_0x98ca('0x43')]?_0x5d924c[_0x98ca('0x3f')]:_0x578b2f[_0x98ca('0x41')];if(!_0x450745[_0x98ca('0x3d')][_0x98ca('0x44')](_0x98ca('0x45'))){_0x5d924c[_0x98ca('0x18')]=qs[_0x98ca('0x18')](_0x450745['query'][_0x98ca('0x18')]);_0x5d924c[_0x98ca('0x16')]=qs[_0x98ca('0x16')](_0x450745[_0x98ca('0x3d')][_0x98ca('0x16')]);}_0x5d924c[_0x98ca('0x46')]=qs[_0x98ca('0x47')](_0x450745[_0x98ca('0x3d')][_0x98ca('0x47')]);_0x5d924c['where']=qs[_0x98ca('0x48')](_[_0x98ca('0x49')](_0x450745['query'],_0x578b2f[_0x98ca('0x48')]),_0x405691);var _0x4f2444=[];var _0x3946b3=squel[_0x98ca('0x4a')]()[_0x98ca('0x4b')]('id')[_0x98ca('0x4b')](_0x98ca('0x21'))[_0x98ca('0x4b')](_0x98ca('0x4c'))[_0x98ca('0x4d')](_0x98ca('0x4e'));var _0x42a53d=squel[_0x98ca('0x4a')]()[_0x98ca('0x4b')]('u.id')[_0x98ca('0x4b')](_0x98ca('0x4f'))[_0x98ca('0x4b')](_0x98ca('0x50'))['from'](_0x98ca('0x51'),'ui')[_0x98ca('0x52')](_0x98ca('0x53'),'u',_0x98ca('0x54'));var _0x2141ef=squel[_0x98ca('0x4a')]()[_0x98ca('0x4d')]('mail_interactions','i')['left_join']('cm_contacts','c',_0x98ca('0x55'))[_0x98ca('0x52')](_0x98ca('0x53'),'o',_0x98ca('0x56'))['left_join']('mail_accounts','a',_0x98ca('0x57'))[_0x98ca('0x52')](_0x98ca('0x58'),'me',_0x98ca('0x59'))[_0x98ca('0x52')](_0x98ca('0x5a'),'it',_0x98ca('0x5b'))[_0x98ca('0x52')](_0x98ca('0x4e'),'t',_0x98ca('0x5c'));var _0x648ba4=squel[_0x98ca('0x5d')]();var _0x14f523=[];var _0x55da8d=squel[_0x98ca('0x5d')]();var _0x4f9750;if(_0x450745[_0x98ca('0x3d')][_0x98ca('0x5e')]){_0x4f9750=as[_0x98ca('0x5f')](_0x450745[_0x98ca('0x3d')][_0x98ca('0x5e')]);var _0x51fbad=_0x4f9750[_0x98ca('0x60')];for(var _0x2916a8=0x0;_0x2916a8<_0x4f9750['conditions'][_0x98ca('0x43')];_0x2916a8++){var _0x454bd1=_0x4f9750[_0x98ca('0x61')][_0x2916a8];var _0x5ddaae='i';var _0x9525bb=_[_0x98ca('0x62')](_0x405691,['name',_0x454bd1[_0x98ca('0x4b')]]);if(!_0x9525bb){switch(_0x454bd1[_0x98ca('0x4b')]){case _0x98ca('0x63'):if(_0x454bd1[_0x98ca('0x64')]==0x1){_0x2141ef[_0x98ca('0x65')]('`'+_0x454bd1[_0x98ca('0x4b')]+_0x98ca('0x66'));}else{_0x2141ef['having']('`'+_0x454bd1[_0x98ca('0x4b')]+_0x98ca('0x67'));}break;case _0x98ca('0x68'):if(_0x454bd1['operator']==='$substring'){if(_0x454bd1[_0x98ca('0x64')][_0x98ca('0x26')]('\x20')[_0x98ca('0x43')]>0x1){_0x648ba4[_0x51fbad](_0x98ca('0x69'),qs[_0x98ca('0x6a')](_0x454bd1[_0x98ca('0x64')]),null);}else{var _0x3dc32e='%'+_0x454bd1[_0x98ca('0x64')]+'%';_0x648ba4[_0x51fbad]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3dc32e,_0x3dc32e,_0x3dc32e);}}else{_0x9525bb=_[_0x98ca('0x62')](_0x405691,['name','ContactId']);_0x454bd1[_0x98ca('0x4b')]=_0x98ca('0x6b');_0x2e6347=as[_0x98ca('0x6c')](_0x5ddaae,_0x9525bb[_0x98ca('0x3c')],_0x454bd1);_0x648ba4[_0x51fbad](_0x2e6347[_0x98ca('0x6d')],_0x2e6347[_0x98ca('0x64')]['start'],_0x2e6347[_0x98ca('0x64')][_0x98ca('0x1f')]);}break;case _0x98ca('0x6e'):var _0x59f5ae=_0x454bd1['value'][_0x98ca('0x26')](',')[_0x98ca('0x38')](function(_0xd82630){return Number(_0xd82630);});_0x59f5ae[_0x98ca('0x27')](function(_0x1ad7c2){_0x55da8d['or'](_0x98ca('0x6f'),'%,'+_0x1ad7c2+',%');});_0x14f523=_[_0x98ca('0x70')](_0x14f523,_0x59f5ae);break;case _0x98ca('0x71'):if(_0x454bd1[_0x98ca('0x72')]===_0x98ca('0x73')){_0x648ba4[_0x51fbad](_0x98ca('0x74'),'%'+_0x454bd1[_0x98ca('0x64')]+'%',null);}else{_0x9525bb=_['find'](_0x405691,[_0x98ca('0x21'),_0x98ca('0x34')]);_0x454bd1[_0x98ca('0x4b')]=_0x98ca('0x34');_0x2e6347=as[_0x98ca('0x6c')](_0x5ddaae,_0x9525bb[_0x98ca('0x3c')],_0x454bd1);_0x648ba4[_0x51fbad](_0x2e6347[_0x98ca('0x6d')],_0x2e6347[_0x98ca('0x64')][_0x98ca('0x75')],_0x2e6347['value'][_0x98ca('0x1f')]);}break;case _0x98ca('0x2c'):_0x2e6347=as[_0x98ca('0x6c')]('me',null,_0x454bd1);_0x648ba4[_0x51fbad](_0x2e6347['text'],_0x2e6347[_0x98ca('0x64')][_0x98ca('0x75')],_0x2e6347[_0x98ca('0x64')][_0x98ca('0x1f')]);break;}}else{var _0x2e6347=as['buildExpression'](_0x5ddaae,_0x9525bb[_0x98ca('0x3c')],_0x454bd1);_0x648ba4[_0x51fbad](_0x2e6347[_0x98ca('0x6d')],_0x2e6347['value'][_0x98ca('0x75')],_0x2e6347[_0x98ca('0x64')][_0x98ca('0x1f')]);}}}else{var _0x33d12f=_(_0x450745[_0x98ca('0x3d')])[_0x98ca('0x3e')]()['map'](function(_0x9bd554){return _[_0x98ca('0x76')](_0x405691,[_0x98ca('0x21'),_0x9bd554])?_0x9bd554:undefined;})[_0x98ca('0x77')]()['value']();if(!_[_0x98ca('0x78')](_0x33d12f)){_0x33d12f[_0x98ca('0x27')](function(_0x4cfa03){if(_0x4cfa03===_0x98ca('0x79')){_0x2141ef[_0x98ca('0x7a')]('i.MailAccountId\x20IN\x20?',[][_0x98ca('0x7b')](_0x450745[_0x98ca('0x3d')][_0x4cfa03]));}else if(_0x4cfa03===_0x98ca('0x7c')){var _0x30ba0d=JSON[_0x98ca('0x7d')](_0x450745[_0x98ca('0x3d')][_0x4cfa03])['$gte'];var _0x1a2c1d=JSON[_0x98ca('0x7d')](_0x450745[_0x98ca('0x3d')][_0x4cfa03])[_0x98ca('0x7e')];_0x2141ef[_0x98ca('0x7a')](_0x98ca('0x7f'),_0x30ba0d,_0x1a2c1d);}else{if(_0x450745[_0x98ca('0x3d')][_0x4cfa03]==='null'){_0x2141ef[_0x98ca('0x7a')]('i.'+_0x4cfa03+_0x98ca('0x80'));}else{_0x2141ef[_0x98ca('0x7a')]('i.'+_0x4cfa03+'\x20=\x20?',_0x450745[_0x98ca('0x3d')][_0x4cfa03]);}}});}if(_0x450745[_0x98ca('0x3d')][_0x98ca('0x81')]){if(_0x450745['query'][_0x98ca('0x81')]==0x1){_0x2141ef[_0x98ca('0x65')](_0x98ca('0x82'));}else{_0x2141ef[_0x98ca('0x65')](_0x98ca('0x83'));}}if(_0x450745['query']['tag']){_0x14f523=_[_0x98ca('0x84')](_0x450745['query'][_0x98ca('0x85')])?_0x450745[_0x98ca('0x3d')][_0x98ca('0x85')]:new Array(_0x450745[_0x98ca('0x3d')]['tag']);_0x14f523[_0x98ca('0x27')](function(_0x3d4824){_0x55da8d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d4824+',%');});}if(_0x450745[_0x98ca('0x3d')][_0x98ca('0x86')]){var _0x40a5f0=_0x450745[_0x98ca('0x3d')][_0x98ca('0x86')][_0x98ca('0x87')]('\x5c','\x5c\x5c')[_0x98ca('0x87')](/'/g,'\x27\x27');if(qs[_0x98ca('0x88')](_0x40a5f0)){_0x648ba4['or'](_0x98ca('0x89'),_0x40a5f0+'%');}else if(qs[_0x98ca('0x8a')](_0x40a5f0)){_0x648ba4['or'](_0x98ca('0x8b'),_0x40a5f0+'%');}else{_0x648ba4['or'](_0x98ca('0x8c'),qs[_0x98ca('0x6a')](_0x40a5f0))['or'](_0x98ca('0x8d'),qs[_0x98ca('0x6a')](_0x40a5f0));}}}_0x2141ef[_0x98ca('0x7a')](_0x648ba4);_0x2141ef[_0x98ca('0x8e')](_0x98ca('0x8f'));var _0x2176dc={'type':db[_0x98ca('0x90')][_0x98ca('0x91')]['SELECT'],'raw':!![]};var _0x29369b=_0x2141ef[_0x98ca('0x92')]();_0x29369b['field'](_0x98ca('0x8f'));_0x29369b[_0x98ca('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x98ca('0x63'));if(_0x5d924c['order']){_0x5d924c[_0x98ca('0x46')][_0x98ca('0x27')](function(_0x411f48){var _0x464b29=_0x411f48[0x0]===_0x98ca('0x93')?_0x411f48[0x0]:'i.'+_0x411f48[0x0];_0x2141ef['order'](_0x464b29,_0x411f48[0x1]==='DESC'?![]:!![]);});}if(!_[_0x98ca('0x78')](_0x14f523)){_0x2141ef[_0x98ca('0x65')](_0x55da8d);_0x29369b[_0x98ca('0x7a')](_0x98ca('0x94'),_0x14f523);}BPromise[_0x98ca('0x95')]()[_0x98ca('0x2e')](function(){if(!_0x4f9750){if(_0x450745['query'][_0x98ca('0x79')])return;_0x29369b[_0x98ca('0x7a')](_0x98ca('0x96'));_0x2141ef[_0x98ca('0x7a')](_0x98ca('0x96'));return;}if(_0x450745[_0x98ca('0x97')][_0x98ca('0x98')]!==_0x98ca('0x99'))return;return _0x450745[_0x98ca('0x97')][_0x98ca('0x9a')]({'attributes':['id'],'raw':!![]})[_0x98ca('0x2e')](function(_0x27e412){if(_['isEmpty'](_0x27e412)){_0x29369b['where'](_0x98ca('0x9b'));_0x2141ef[_0x98ca('0x7a')](_0x98ca('0x9b'));}else{_0x29369b['where'](_0x98ca('0x9c'),_[_0x98ca('0x38')](_0x27e412,'id'));_0x2141ef[_0x98ca('0x7a')](_0x98ca('0x9c'),_[_0x98ca('0x38')](_0x27e412,'id'));}});})['then'](function(){if(_0x450745[_0x98ca('0x97')][_0x98ca('0x98')]==='agent'&&!_0x4f9750&&!_0x450745[_0x98ca('0x3d')][_0x98ca('0x79')])return[];return db[_0x98ca('0x9d')]['query'](_0x29369b[_0x98ca('0x9e')](),_0x2176dc);})[_0x98ca('0x2e')](function(_0x3095b){_0x4b811b['count']=_0x3095b[_0x98ca('0x43')];if(_0x4b811b[_0x98ca('0x19')]===0x0)return[];return db[_0x98ca('0x9d')]['query'](_0x3946b3[_0x98ca('0x9e')](),_0x2176dc)['then'](function(_0x2ed9f2){_0x4f2444=_[_0x98ca('0x9f')](_0x2ed9f2,'id');_0x2176dc=_['merge'](_0x2176dc,{'model':db[_0x98ca('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x450745[_0x98ca('0x3d')][_0x98ca('0x42')]){_0x5d924c['attributes']['forEach'](function(_0x31036a){_0x2141ef[_0x98ca('0x4b')]('i.'+_0x31036a);});}else{_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa0'),_0x98ca('0x63'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa1'),_0x98ca('0xa2'));_0x2141ef[_0x98ca('0x4b')]('a.mandatoryDisposition',_0x98ca('0xa3'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa4'),_0x98ca('0x93'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0x8f'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa5'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa6'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa7'));_0x2141ef['field'](_0x98ca('0xa8'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xa9'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xaa'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xab'));_0x2141ef['field'](_0x98ca('0xac'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xad'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xae'));_0x2141ef['field'](_0x98ca('0xaf'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xb0'));_0x2141ef['field'](_0x98ca('0xb1'));_0x2141ef['field']('i.ContactId');_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xb2'));_0x2141ef['field']('i.UserId');_0x2141ef['field']('c.firstName',_0x98ca('0xb3'));_0x2141ef['field'](_0x98ca('0xb4'),'Contact.lastName');_0x2141ef['field'](_0x98ca('0xb5'),_0x98ca('0xb6'));_0x2141ef[_0x98ca('0x4b')]('c.phone',_0x98ca('0xb7'));_0x2141ef['field']('c.mobile',_0x98ca('0xb8'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xb9'),_0x98ca('0xba'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xbb'),_0x98ca('0xbc'));_0x2141ef['field'](_0x98ca('0xbd'),_0x98ca('0xbe'));_0x2141ef[_0x98ca('0x4b')](_0x98ca('0xbf'),_0x98ca('0x29'));}if(_0x5d924c[_0x98ca('0x18')])_0x2141ef[_0x98ca('0x18')](_0x5d924c[_0x98ca('0x18')]);if(_0x5d924c['offset'])_0x2141ef['offset'](_0x5d924c['offset']);return db[_0x98ca('0x9d')]['query'](_0x2141ef[_0x98ca('0x9e')](),_0x2176dc);})[_0x98ca('0x2e')](function(_0x5d3e4c){if(_0x5d3e4c[_0x98ca('0x43')]>0x0)_0x42a53d[_0x98ca('0x7a')](_0x98ca('0xc0'),_[_0x98ca('0x38')](_0x5d3e4c,'id'));return db[_0x98ca('0x9d')]['query'](_0x42a53d['toString'](),_0x2176dc)['then'](function(_0x2f4fc3){var _0x501f9f=_[_0x98ca('0xc1')](_0x2f4fc3,'MailInteractionId');var _0x591819=[];return db[_0x98ca('0xc2')]['findOne']({'attributes':[_0x98ca('0xc3')],'raw':!![]})['then'](function(_0x258cdd){var _0x3c45d5=_0x258cdd[_0x98ca('0xc3')];_0x5d3e4c[_0x98ca('0x27')](function(_0x2b2bfe){_0x591819[_0x98ca('0x28')](updateMailInteraction(_0x2b2bfe,_0x4f2444,_0x501f9f,_0x3c45d5));});return BPromise[_0x98ca('0xc4')](_0x591819);});});});})[_0x98ca('0x2e')](function(_0x276313){_0x4b811b['rows']=_0x276313;return _0x4b811b;})[_0x98ca('0x2e')](respondWithFilteredResult(_0x1b41c5,_0x5d924c))[_0x98ca('0x2f')](handleError(_0x1b41c5,null));};exports[_0x98ca('0xc5')]=function(_0x35b96e,_0x24179f){var _0x236818={'raw':![],'where':{'id':_0x35b96e[_0x98ca('0xc6')]['id']}},_0xb85857={};_0xb85857[_0x98ca('0x41')]=_['keys'](db[_0x98ca('0x39')][_0x98ca('0x3a')]);_0xb85857['query']=_['keys'](_0x35b96e[_0x98ca('0x3d')]);_0xb85857[_0x98ca('0x48')]=_['intersection'](_0xb85857[_0x98ca('0x41')],_0xb85857[_0x98ca('0x3d')]);_0x236818[_0x98ca('0x3f')]=_[_0x98ca('0x40')](_0xb85857['model'],qs[_0x98ca('0x42')](_0x35b96e['query']['fields']));_0x236818['attributes']=_0x236818[_0x98ca('0x3f')][_0x98ca('0x43')]?_0x236818[_0x98ca('0x3f')]:_0xb85857['model'];if(_0x35b96e[_0x98ca('0x3d')][_0x98ca('0xc7')]){_0x236818[_0x98ca('0xc8')]=[{'all':!![]}];}_0x236818=_[_0x98ca('0xc9')]({},_0x236818,_0x35b96e['options']);return db[_0x98ca('0x39')][_0x98ca('0x62')](_0x236818)[_0x98ca('0x2e')](handleEntityNotFound(_0x24179f,null))['then'](respondWithResult(_0x24179f,null))[_0x98ca('0x2f')](handleError(_0x24179f,null));};exports[_0x98ca('0xca')]=function(_0xc7b165,_0x40b1c5){return db['MailInteraction'][_0x98ca('0xca')](_0xc7b165['body'],{})[_0x98ca('0x2e')](respondWithResult(_0x40b1c5,0xc9))[_0x98ca('0x2f')](handleError(_0x40b1c5,null));};exports[_0x98ca('0x1d')]=function(_0x56d8bc,_0xec0e3a){if(_0x56d8bc['body']['id']){delete _0x56d8bc['body']['id'];}return db['MailInteraction'][_0x98ca('0x62')]({'where':{'id':_0x56d8bc[_0x98ca('0xc6')]['id']}})['then'](handleEntityNotFound(_0xec0e3a,null))[_0x98ca('0x2e')](saveUpdates(_0x56d8bc[_0x98ca('0xcb')],null))[_0x98ca('0x2e')](respondWithResult(_0xec0e3a,null))['catch'](handleError(_0xec0e3a,null));};exports['destroy']=function(_0x4b522c,_0x45169d){return db[_0x98ca('0x39')]['find']({'where':{'id':_0x4b522c[_0x98ca('0xc6')]['id']}})[_0x98ca('0x2e')](handleEntityNotFound(_0x45169d,null))[_0x98ca('0x2e')](removeEntity(_0x45169d,null))[_0x98ca('0x2f')](handleError(_0x45169d,null));};exports['describe']=function(_0x31a3f9,_0x745a12){return db[_0x98ca('0x39')][_0x98ca('0xcc')]()[_0x98ca('0x2e')](respondWithResult(_0x745a12,null))['catch'](handleError(_0x745a12,null));};exports[_0x98ca('0xcd')]=function(_0x50be38,_0x2d6aa0){return db['MailMessage'][_0x98ca('0x62')]({'where':{'id':_0x50be38[_0x98ca('0xc6')]['id']}})[_0x98ca('0x2e')](handleEntityNotFound(_0x2d6aa0,null))[_0x98ca('0x2e')](function(_0xe57440){if(_0xe57440){return _0xe57440[_0x98ca('0xcd')](_0x50be38[_0x98ca('0xcb')][_0x98ca('0xce')],_[_0x98ca('0xcf')](_0x50be38[_0x98ca('0xcb')],['ids','id'])||{});}})[_0x98ca('0x2e')](respondWithResult(_0x2d6aa0,null))['catch'](handleError(_0x2d6aa0,null));};exports[_0x98ca('0xd0')]=function(_0x3ab963,_0xb6b47f){var _0x1f1e50={'raw':![],'where':{}};var _0x5afdfc={};var _0x144a45={'count':0x0,'rows':[]};return db[_0x98ca('0x39')][_0x98ca('0xd1')]({'where':{'id':_0x3ab963[_0x98ca('0xc6')]['id']}})[_0x98ca('0x2e')](handleEntityNotFound(_0xb6b47f,null))[_0x98ca('0x2e')](function(_0x5d8f16){if(_0x5d8f16){_0x5afdfc[_0x98ca('0x41')]=_['keys'](db['MailMessage']['rawAttributes']);_0x5afdfc[_0x98ca('0x3d')]=_[_0x98ca('0x3e')](_0x3ab963[_0x98ca('0x3d')]);_0x5afdfc[_0x98ca('0x48')]=_[_0x98ca('0x40')](_0x5afdfc[_0x98ca('0x41')],_0x5afdfc[_0x98ca('0x3d')]);_0x1f1e50[_0x98ca('0x3f')]=_[_0x98ca('0x40')](_0x5afdfc[_0x98ca('0x41')],qs[_0x98ca('0x42')](_0x3ab963[_0x98ca('0x3d')][_0x98ca('0x42')]));_0x1f1e50[_0x98ca('0x3f')]=_0x1f1e50[_0x98ca('0x3f')][_0x98ca('0x43')]?_0x1f1e50['attributes']:_0x5afdfc[_0x98ca('0x41')];if(!_0x3ab963[_0x98ca('0x3d')]['hasOwnProperty'](_0x98ca('0x45'))){_0x1f1e50['limit']=qs[_0x98ca('0x18')](_0x3ab963['query'][_0x98ca('0x18')]);_0x1f1e50['offset']=qs[_0x98ca('0x16')](_0x3ab963[_0x98ca('0x3d')][_0x98ca('0x16')]);}_0x1f1e50[_0x98ca('0x46')]=qs[_0x98ca('0x47')](_0x3ab963[_0x98ca('0x3d')][_0x98ca('0x47')]);_0x1f1e50[_0x98ca('0x7a')]=qs[_0x98ca('0x48')](_[_0x98ca('0x49')](_0x3ab963['query'],_0x5afdfc[_0x98ca('0x48')]));_0x1f1e50[_0x98ca('0x7a')][_0x98ca('0xd2')]=_0x5d8f16['id'];if(_0x3ab963['query'][_0x98ca('0x86')]){_0x1f1e50[_0x98ca('0x7a')]=_[_0x98ca('0xc9')](_0x1f1e50[_0x98ca('0x7a')],{'$or':_['map'](_0x1f1e50[_0x98ca('0x3f')],function(_0x344e96){var _0x3ef80b={};_0x3ef80b[_0x344e96]={'$like':'%'+_0x3ab963['query']['filter']+'%'};return _0x3ef80b;})});}if(_0x3ab963[_0x98ca('0x3d')][_0x98ca('0xd3')]){var _0x20be7d=_0x3ab963[_0x98ca('0x3d')][_0x98ca('0xd3')]['split'](',');var _0x52b1db={};_0x52b1db[_0x20be7d[0x0]]={'$gte':moment(_0x20be7d[0x1])[_0x98ca('0xd4')](_0x98ca('0xd5'))};_0x1f1e50[_0x98ca('0x7a')]=_['merge'](_0x1f1e50[_0x98ca('0x7a')],_0x52b1db);}_0x1f1e50=_['merge']({},_0x1f1e50,_0x3ab963[_0x98ca('0xd6')]);return db['MailMessage']['count']({'where':_0x1f1e50['where']})[_0x98ca('0x2e')](function(_0x33afb5){_0x144a45['count']=_0x33afb5;if(_0x3ab963[_0x98ca('0x3d')][_0x98ca('0xc7')]){_0x1f1e50[_0x98ca('0xc8')]=[{'all':!![]}];}return db['MailMessage'][_0x98ca('0xd7')](_0x1f1e50);})[_0x98ca('0x2e')](function(_0x409a56){if(_0x3ab963['query'][_0x98ca('0xd8')]===_0x98ca('0xd9')){for(var _0x360879=0x0;_0x360879<_0x409a56[_0x98ca('0x43')];_0x360879++){_0x409a56[_0x360879][_0x98ca('0xcb')]=juice(_0x409a56[_0x360879]['body']);}}_0x144a45[_0x98ca('0xda')]=_0x409a56;return _0x144a45;});}})['then'](respondWithFilteredResult(_0xb6b47f,_0x1f1e50))[_0x98ca('0x2f')](handleError(_0xb6b47f,null));};exports[_0x98ca('0xdb')]=function(_0x1190ac,_0x2db57b){return db[_0x98ca('0x39')][_0x98ca('0x62')]({'where':{'id':_0x1190ac['params']['id']}})[_0x98ca('0x2e')](handleEntityNotFound(_0x2db57b,null))[_0x98ca('0x2e')](function(_0x4b5d18){if(_0x4b5d18){return _0x4b5d18[_0x98ca('0xdc')](_0x1190ac['body'][_0x98ca('0xce')],_[_0x98ca('0xcf')](_0x1190ac[_0x98ca('0xcb')],['ids','id'])||{})[_0x98ca('0xdd')](function(){return db[_0x98ca('0x6e')][_0x98ca('0xd7')]({'attributes':['id',_0x98ca('0x21'),'color'],'where':{'id':_0x1190ac[_0x98ca('0xcb')][_0x98ca('0xce')]}});})[_0x98ca('0x2e')](function(_0x5d61e7){socket[_0x98ca('0xde')](_0x98ca('0xdf'),{'id':Number(_0x1190ac['params']['id']),'tags':_0x5d61e7||[]});return{'id':Number(_0x1190ac['params']['id']),'tags':_0x5d61e7||[]};});}})['then'](respondWithResult(_0x2db57b,null))[_0x98ca('0x2f')](handleError(_0x2db57b,null));};exports[_0x98ca('0xe0')]=function(_0x8de69d,_0x5db069){return db[_0x98ca('0x39')][_0x98ca('0x62')]({'where':{'id':_0x8de69d['params']['id']}})['then'](handleEntityNotFound(_0x5db069,null))[_0x98ca('0x2e')](function(_0x2b75d3){if(_0x2b75d3){return _0x2b75d3[_0x98ca('0xe0')](_0x8de69d[_0x98ca('0x3d')][_0x98ca('0xce')]);}})[_0x98ca('0x2e')](respondWithStatusCode(_0x5db069,null))[_0x98ca('0x2f')](handleError(_0x5db069,null));};exports[_0x98ca('0xe1')]=function(_0x4a670c,_0xf80240){var _0x40ac5c=moment()[_0x98ca('0xe2')]()[_0x98ca('0x9e')]();var _0x259ea8=path[_0x98ca('0xe3')](config[_0x98ca('0xe4')],_0x98ca('0xe5'),_0x98ca('0xe6'),_0x98ca('0xe7'));var _0x45365a=path[_0x98ca('0xe3')](config[_0x98ca('0xe4')],_0x98ca('0xe5'),_0x98ca('0xe6'),_0x98ca('0xe8'));var _0x385047=path[_0x98ca('0xe3')](_0x259ea8,_0x40ac5c);var _0x11a3ee=util[_0x98ca('0xd4')](_0x98ca('0xe9'),_0x4a670c[_0x98ca('0xc6')]['id'],_0x40ac5c);var _0x48b8a8=path[_0x98ca('0xe3')](_0x259ea8,_0x11a3ee);var _0x273459=[];if(_0x4a670c[_0x98ca('0x3d')][_0x98ca('0xe8')]){_0x273459['push']({'model':db[_0x98ca('0xea')],'as':_0x98ca('0xeb'),'raw':!![]});}var _0x37f039=[{'model':db[_0x98ca('0x2a')],'as':_0x98ca('0xec'),'attributes':['id',_0x98ca('0xcb'),'from','to','cc',_0x98ca('0xed'),_0x98ca('0xee'),'createdAt'],'where':{'secret':![]},'order':qs[_0x98ca('0x47')]('id'),'include':_0x273459}];return db[_0x98ca('0x39')][_0x98ca('0x62')]({'where':{'id':_0x4a670c[_0x98ca('0xc6')]['id']},'include':_0x37f039})[_0x98ca('0x2e')](handleEntityNotFound(_0xf80240,null))['then'](function(_0x3ddcfb){if(_0x3ddcfb&&_0x3ddcfb[_0x98ca('0xec')]){var _0x20306e=_0x3ddcfb['get']({'plain':!![]});fs[_0x98ca('0xef')](_0x385047);return BPromise[_0x98ca('0xf0')](_0x20306e[_0x98ca('0xec')],function(_0x23ca27,_0x3cd8a8){var _0x2f9c79={'from':_0x23ca27[_0x98ca('0x4d')],'to':_0x23ca27['to'],'subject':_0x23ca27[_0x98ca('0xee')],'html':htmlEntities['decode'](_0x23ca27[_0x98ca('0xcb')]),'headers':{'Date':moment(_0x23ca27[_0x98ca('0x7c')])[_0x98ca('0xd4')](_0x98ca('0xf1'))},'attachments':[]};if(_0x23ca27['cc']){_0x2f9c79[_0x98ca('0xf2')]['Cc']=_0x23ca27['cc'];}if(_0x23ca27[_0x98ca('0xed')]){_0x2f9c79['headers'][_0x98ca('0xf3')]=_0x23ca27[_0x98ca('0xed')];}return new BPromise(function(_0x40f643,_0x2f2029){if(_0x23ca27[_0x98ca('0xeb')]){for(var _0x3df023=0x0;_0x3df023<_0x23ca27[_0x98ca('0xeb')][_0x98ca('0x43')];_0x3df023++){var _0x3bc65d=_0x23ca27['Attachments'][_0x3df023];var _0x148859=path[_0x98ca('0xe3')](_0x45365a,_0x3bc65d[_0x98ca('0xf4')]);if(fs['existsSync'](_0x148859)){_0x2f9c79[_0x98ca('0xe8')][_0x98ca('0x28')]({'name':_0x3bc65d[_0x98ca('0x21')],'contentType':_0x3bc65d[_0x98ca('0x3c')],'data':fs['readFileSync'](_0x148859)});}}}emlformat[_0x98ca('0xf5')](_0x2f9c79,function(_0x547c36,_0x32808a){if(_0x547c36)return _0x2f2029(_0x547c36);fs[_0x98ca('0xf6')](path[_0x98ca('0xe3')](_0x385047,util[_0x98ca('0xd4')]('message%d.eml',_0x3cd8a8)),_0x32808a);return _0x40f643(_0x32808a);});});})[_0x98ca('0x2e')](function(){return new BPromise(function(_0xb56d58,_0x1170f0){zipdir(_0x385047,{'saveTo':_0x48b8a8},function(_0x25a8d9,_0x3fffcf){if(_0x25a8d9)return _0x1170f0(_0x25a8d9);return _0xb56d58(_0x3fffcf);});})['then'](function(){return new BPromise(function(_0x1a21e8,_0x310a6f){rimraf(_0x385047,function(_0x5e97ce){if(_0x5e97ce)_0x310a6f(_0x5e97ce);return _0x1a21e8();});});})['then'](function(){return _0xf80240[_0x98ca('0xe1')](_0x48b8a8,_0x11a3ee,function(_0x269bdf){if(!_0x269bdf)fs[_0x98ca('0xf7')](_0x48b8a8);});});});}else{return _0xf80240[_0x98ca('0x14')](0xc8);}})[_0x98ca('0x2f')](handleError(_0xf80240,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9403d18..46b3b66 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 _0xea30=['MailInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4b9699,_0x23af6b){var _0x2515ec=function(_0x41a5cc){while(--_0x41a5cc){_0x4b9699['push'](_0x4b9699['shift']());}};_0x2515ec(++_0x23af6b);}(_0xea30,0x9f));var _0x0ea3=function(_0x437e1a,_0x3bcab7){_0x437e1a=_0x437e1a-0x0;var _0x5536cd=_0xea30[_0x437e1a];return _0x5536cd;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x0ea3('0x0'))['db'][_0x0ea3('0x1')];var MailMessage=require(_0x0ea3('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0ea3('0x2')](0x0);var events={'afterCreate':_0x0ea3('0x3'),'afterUpdate':'update','afterDestroy':_0x0ea3('0x4')};function emitEvent(_0x44e057){return function(_0xb94945,_0xe9843b,_0x2c1614){_0xb94945[_0x0ea3('0x5')]({'attributes':['id'],'raw':!![]})[_0x0ea3('0x6')](function(_0x3857cf){_0xb94945[_0x0ea3('0x7')](_0x0ea3('0x8'),_0x3857cf[_0x0ea3('0x9')](function(_0x29dd34){return{'id':_0x29dd34['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0xb94945['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ea3('0x6')](function(_0x4b5658){_0xb94945[_0x0ea3('0x7')]('unreadMessages',_0x4b5658[_0x0ea3('0xa')]);MailInteractionEvents[_0x0ea3('0xb')](_0x44e057+':'+_0xb94945['id'],_0xb94945);MailInteractionEvents[_0x0ea3('0xb')](_0x44e057,_0xb94945);_0x2c1614(null);})[_0x0ea3('0xc')](_0x2c1614(null));};}for(var e in events){if(events[_0x0ea3('0xd')](e)){var event=events[e];MailInteraction[_0x0ea3('0xe')](e,emitEvent(event));}}module[_0x0ea3('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x0a14=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x58f835,_0x11fa7b){var _0x58e8c2=function(_0x1843e4){while(--_0x1843e4){_0x58f835['push'](_0x58f835['shift']());}};_0x58e8c2(++_0x11fa7b);}(_0x0a14,0x103));var _0x40a1=function(_0x7777c7,_0x278b61){_0x7777c7=_0x7777c7-0x0;var _0x363a0e=_0x0a14[_0x7777c7];return _0x363a0e;};'use strict';var EventEmitter=require(_0x40a1('0x0'));var MailInteraction=require(_0x40a1('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x40a1('0x1'))['db'][_0x40a1('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x40a1('0x3')](0x0);var events={'afterCreate':_0x40a1('0x4'),'afterUpdate':_0x40a1('0x5'),'afterDestroy':_0x40a1('0x6')};function emitEvent(_0x358a7d){return function(_0x5e77f1,_0x3be218,_0x144cde){_0x5e77f1[_0x40a1('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16952){_0x5e77f1[_0x40a1('0x8')](_0x40a1('0x9'),_0x16952[_0x40a1('0xa')](function(_0x541515){return{'id':_0x541515['id']};}));return MailMessage[_0x40a1('0xb')]({'where':{'MailInteractionId':_0x5e77f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x40a1('0xc')](function(_0x2d85e5){_0x5e77f1[_0x40a1('0x8')](_0x40a1('0xd'),_0x2d85e5['length']);MailInteractionEvents[_0x40a1('0xe')](_0x358a7d+':'+_0x5e77f1['id'],_0x5e77f1);MailInteractionEvents['emit'](_0x358a7d,_0x5e77f1);_0x144cde(null);})[_0x40a1('0xf')](_0x144cde(null));};}for(var e in events){if(events[_0x40a1('0x10')](e)){var event=events[e];MailInteraction[_0x40a1('0x11')](e,emitEvent(event));}}module[_0x40a1('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 640acf2..a948b6f 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 _0x8b00=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','closed','models','get','MailMessage','update','then','utf8mb4_unicode_ci','lodash'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x8b00,0x1b9));var _0x08b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b00[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x08b0('0x0'));var util=require(_0x08b0('0x1'));var logger=require(_0x08b0('0x2'))(_0x08b0('0x3'));var moment=require('moment');var BPromise=require(_0x08b0('0x4'));var rp=require(_0x08b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08b0('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x08b0('0x7')]=function(_0x1fc156,_0x4e15ee){return _0x1fc156[_0x08b0('0x8')]('MailInteraction',attributes,{'tableName':_0x08b0('0x9'),'paranoid':![],'indexes':[{'name':_0x08b0('0xa'),'fields':[_0x08b0('0xb'),'to'],'type':_0x08b0('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28ce9e,_0x3631f3,_0x2da46d){if(_0x28ce9e[_0x08b0('0xd')]){_0x28ce9e[_0x08b0('0xe')]=moment()[_0x08b0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x28ce9e['closed']){_0x28ce9e[_0x08b0('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2da46d(null,_0x3631f3);},'beforeUpdate':function(_0x535435,_0x5467bd,_0x161b1a){if(_0x535435['changed'](_0x08b0('0xd'))){_0x535435[_0x08b0('0xe')]=_0x535435[_0x08b0('0xd')]?moment()[_0x08b0('0xf')](_0x08b0('0x11')):null;}if(_0x535435[_0x08b0('0x12')](_0x08b0('0x13'))){_0x535435[_0x08b0('0x10')]=moment()[_0x08b0('0xf')](_0x08b0('0x11'));_0x535435[_0x08b0('0xd')]=null;_0x535435['substatusAt']=null;}_0x161b1a(null,_0x535435);},'afterUpdate':function(_0x1392f3,_0x5ea814,_0x5ad250){var _0x5c2b26=_0x1fc156[_0x08b0('0x14')];var _0x403953=_0x1392f3[_0x08b0('0x15')]({'plain':!![]});if(_0x403953[_0x08b0('0x13')]){return _0x5c2b26[_0x08b0('0x16')][_0x08b0('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x403953['id']}})[_0x08b0('0x18')](function(){_0x5ad250();})['catch'](function(_0x309ab8){_0x5ad250(_0x309ab8);});}else{_0x5ad250();}}},'charset':'utf8mb4','collate':_0x08b0('0x19')});}; \ No newline at end of file +var _0x4cae=['format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','substatusAt','then','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x4cae,0xa6));var _0xe4ca=function(_0x58f3fc,_0x50430f){_0x58f3fc=_0x58f3fc-0x0;var _0x18f158=_0x4cae[_0x58f3fc];return _0x18f158;};'use strict';var _=require(_0xe4ca('0x0'));var util=require(_0xe4ca('0x1'));var logger=require(_0xe4ca('0x2'))('api');var moment=require(_0xe4ca('0x3'));var BPromise=require(_0xe4ca('0x4'));var rp=require(_0xe4ca('0x5'));var fs=require('fs');var path=require(_0xe4ca('0x6'));var rimraf=require(_0xe4ca('0x7'));var config=require(_0xe4ca('0x8'));var attributes=require('./mailInteraction.attributes');module[_0xe4ca('0x9')]=function(_0x2f0f59,_0x1e0ded){return _0x2f0f59[_0xe4ca('0xa')](_0xe4ca('0xb'),attributes,{'tableName':_0xe4ca('0xc'),'paranoid':![],'indexes':[{'name':_0xe4ca('0xd'),'fields':[_0xe4ca('0xe'),'to'],'type':_0xe4ca('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ad75e,_0x37f9e3,_0x1cd83f){if(_0x3ad75e['substatus']){_0x3ad75e['substatusAt']=moment()[_0xe4ca('0x10')](_0xe4ca('0x11'));}if(_0x3ad75e[_0xe4ca('0x12')]){_0x3ad75e[_0xe4ca('0x13')]=moment()[_0xe4ca('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1cd83f(null,_0x37f9e3);},'beforeUpdate':function(_0x4a594a,_0x4a691a,_0x22e66f){if(_0x4a594a[_0xe4ca('0x14')](_0xe4ca('0x15'))){_0x4a594a[_0xe4ca('0x16')]=_0x4a594a[_0xe4ca('0x15')]?moment()[_0xe4ca('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4a594a[_0xe4ca('0x14')](_0xe4ca('0x12'))){_0x4a594a[_0xe4ca('0x13')]=moment()[_0xe4ca('0x10')](_0xe4ca('0x11'));_0x4a594a[_0xe4ca('0x15')]=null;_0x4a594a[_0xe4ca('0x16')]=null;}_0x22e66f(null,_0x4a594a);},'afterUpdate':function(_0x20a69f,_0x36ec49,_0x4737c9){var _0x545334=_0x2f0f59['models'];var _0x18d5ef=_0x20a69f['get']({'plain':!![]});if(_0x18d5ef['closed']){return _0x545334['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x18d5ef['id']}})[_0xe4ca('0x17')](function(){_0x4737c9();})[_0xe4ca('0x18')](function(_0x34dd37){_0x4737c9(_0x34dd37);});}else{_0x4737c9();}}},'charset':_0xe4ca('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 660be88..0d84bca 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 _0x591d=['options','raw','where','attributes','limit','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body'];(function(_0x17bb78,_0x38ab21){var _0x558d02=function(_0x4776e0){while(--_0x4776e0){_0x17bb78['push'](_0x17bb78['shift']());}};_0x558d02(++_0x38ab21);}(_0x591d,0x171));var _0xd591=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x591d[_0x34325b];return _0x3da348;};'use strict';var _=require('lodash');var util=require(_0xd591('0x0'));var moment=require(_0xd591('0x1'));var BPromise=require(_0xd591('0x2'));var rs=require(_0xd591('0x3'));var fs=require('fs');var Redis=require(_0xd591('0x4'));var db=require(_0xd591('0x5'))['db'];var utils=require(_0xd591('0x6'));var logger=require(_0xd591('0x7'))(_0xd591('0x8'));var config=require('../../config/environment');var jayson=require(_0xd591('0x9'));var client=jayson[_0xd591('0xa')][_0xd591('0xb')]({'port':0x232a});config[_0xd591('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd591('0xc')]));require(_0xd591('0xd'))[_0xd591('0xe')](socket);function respondWithRpcPromise(_0xa02ab1,_0xf266bf,_0x365194){return new BPromise(function(_0x5cd09c,_0x294ea5){return client[_0xd591('0xf')](_0xa02ab1,_0x365194)[_0xd591('0x10')](function(_0xbc799){logger[_0xd591('0x11')](_0xd591('0x12'),_0xf266bf,_0xd591('0x13'));logger[_0xd591('0x14')](_0xd591('0x15'),_0xf266bf,_0xd591('0x13'),JSON[_0xd591('0x16')](_0xbc799));if(_0xbc799[_0xd591('0x17')]){if(_0xbc799[_0xd591('0x17')]['code']===0x1f4){logger[_0xd591('0x17')](_0xd591('0x12'),_0xf266bf,_0xbc799['error'][_0xd591('0x18')]);return _0x294ea5(_0xbc799[_0xd591('0x17')]['message']);}logger[_0xd591('0x17')](_0xd591('0x12'),_0xf266bf,_0xbc799[_0xd591('0x17')]['message']);return _0x5cd09c(_0xbc799[_0xd591('0x17')][_0xd591('0x18')]);}else{logger[_0xd591('0x11')]('MailInteraction,\x20%s,\x20%s',_0xf266bf,_0xd591('0x13'));_0x5cd09c(_0xbc799[_0xd591('0x19')]['message']);}})[_0xd591('0x1a')](function(_0x324ac7){logger[_0xd591('0x17')](_0xd591('0x12'),_0xf266bf,_0x324ac7);_0x294ea5(_0x324ac7);});});}exports[_0xd591('0x1b')]=function(_0x274b4d){var _0x1070f6=this;return new Promise(function(_0x28caa5,_0x1c1afa){return db[_0xd591('0x1c')][_0xd591('0x1d')](_0x274b4d[_0xd591('0x1e')],{'raw':_0x274b4d[_0xd591('0x1f')]?_0x274b4d[_0xd591('0x1f')][_0xd591('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274b4d[_0xd591('0x1f')]?_0x274b4d[_0xd591('0x1f')][_0xd591('0x21')]||null:null,'attributes':_0x274b4d[_0xd591('0x1f')]?_0x274b4d[_0xd591('0x1f')][_0xd591('0x22')]||null:null,'limit':_0x274b4d[_0xd591('0x1f')]?_0x274b4d[_0xd591('0x1f')][_0xd591('0x23')]||null:null})[_0xd591('0x10')](function(_0x2f729c){logger[_0xd591('0x11')](_0xd591('0x1b'),_0x274b4d);logger[_0xd591('0x14')]('UpdateMailInteraction',_0x274b4d,JSON[_0xd591('0x16')](_0x2f729c));_0x28caa5(_0x2f729c);})[_0xd591('0x1a')](function(_0x28514b){logger[_0xd591('0x17')](_0xd591('0x1b'),_0x28514b[_0xd591('0x18')],_0x274b4d);_0x1c1afa(_0x1070f6[_0xd591('0x17')](0x1f4,_0x28514b[_0xd591('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x1bc029){return new Promise(function(_0x4ab9c4,_0x65a3f1){return db[_0xd591('0x1c')]['find']({'where':_0x1bc029[_0xd591('0x1f')]?_0x1bc029[_0xd591('0x1f')]['where']||null:null})[_0xd591('0x10')](function(_0x1fc7c2){if(_0x1fc7c2){return _0x1fc7c2[_0xd591('0x24')](_0x1bc029[_0xd591('0x1e')][_0xd591('0x25')],_[_0xd591('0x26')](_0x1bc029[_0xd591('0x1e')],[_0xd591('0x25'),'id'])||{});}})['spread'](function(_0x36f427){logger[_0xd591('0x11')](_0xd591('0x27'),_0x1bc029);logger[_0xd591('0x14')]('AddTags',_0x1bc029,JSON['stringify'](_0x36f427));_0x4ab9c4(_0x36f427);})['catch'](function(_0x5b6fbb){logger[_0xd591('0x17')](_0xd591('0x27'),_0x5b6fbb[_0xd591('0x18')],_0x1bc029);_0x65a3f1(_this[_0xd591('0x17')](0x1f4,_0x5b6fbb[_0xd591('0x18')]));});});}; \ No newline at end of file +var _0x9fc5=['spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','omit'];(function(_0x461467,_0x81d0dd){var _0x5c47da=function(_0x5a10a8){while(--_0x5a10a8){_0x461467['push'](_0x461467['shift']());}};_0x5c47da(++_0x81d0dd);}(_0x9fc5,0xb6));var _0x59fc=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x9fc5[_0x298ed3];return _0x5aad28;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var moment=require(_0x59fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x59fc('0x2'));var fs=require('fs');var Redis=require(_0x59fc('0x3'));var db=require(_0x59fc('0x4'))['db'];var utils=require(_0x59fc('0x5'));var logger=require(_0x59fc('0x6'))(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var jayson=require(_0x59fc('0x9'));var client=jayson['client'][_0x59fc('0xa')]({'port':0x232a});config[_0x59fc('0xb')]=_[_0x59fc('0xc')](config['redis'],{'host':_0x59fc('0xd'),'port':0x18eb});var socket=require(_0x59fc('0xe'))(new Redis(config[_0x59fc('0xb')]));require(_0x59fc('0xf'))[_0x59fc('0x10')](socket);function respondWithRpcPromise(_0x212ec8,_0x2556f8,_0x4afc93){return new BPromise(function(_0x2de019,_0x33364e){return client[_0x59fc('0x11')](_0x212ec8,_0x4afc93)[_0x59fc('0x12')](function(_0x29e599){logger[_0x59fc('0x13')](_0x59fc('0x14'),_0x2556f8,'request\x20sent');logger[_0x59fc('0x15')](_0x59fc('0x16'),_0x2556f8,_0x59fc('0x17'),JSON[_0x59fc('0x18')](_0x29e599));if(_0x29e599[_0x59fc('0x19')]){if(_0x29e599[_0x59fc('0x19')][_0x59fc('0x1a')]===0x1f4){logger[_0x59fc('0x19')](_0x59fc('0x14'),_0x2556f8,_0x29e599[_0x59fc('0x19')][_0x59fc('0x1b')]);return _0x33364e(_0x29e599['error'][_0x59fc('0x1b')]);}logger[_0x59fc('0x19')]('MailInteraction,\x20%s,\x20%s',_0x2556f8,_0x29e599[_0x59fc('0x19')][_0x59fc('0x1b')]);return _0x2de019(_0x29e599[_0x59fc('0x19')][_0x59fc('0x1b')]);}else{logger[_0x59fc('0x13')]('MailInteraction,\x20%s,\x20%s',_0x2556f8,_0x59fc('0x17'));_0x2de019(_0x29e599[_0x59fc('0x1c')][_0x59fc('0x1b')]);}})[_0x59fc('0x1d')](function(_0x395ede){logger[_0x59fc('0x19')](_0x59fc('0x14'),_0x2556f8,_0x395ede);_0x33364e(_0x395ede);});});}exports[_0x59fc('0x1e')]=function(_0x58a0bb){var _0x153c58=this;return new Promise(function(_0x530c11,_0xdcfddb){return db['MailInteraction'][_0x59fc('0x1f')](_0x58a0bb[_0x59fc('0x20')],{'raw':_0x58a0bb[_0x59fc('0x21')]?_0x58a0bb[_0x59fc('0x21')][_0x59fc('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58a0bb[_0x59fc('0x21')]?_0x58a0bb['options'][_0x59fc('0x23')]||null:null,'attributes':_0x58a0bb[_0x59fc('0x21')]?_0x58a0bb['options']['attributes']||null:null,'limit':_0x58a0bb[_0x59fc('0x21')]?_0x58a0bb[_0x59fc('0x21')][_0x59fc('0x24')]||null:null})[_0x59fc('0x12')](function(_0x188c1d){logger[_0x59fc('0x13')](_0x59fc('0x1e'),_0x58a0bb);logger[_0x59fc('0x15')](_0x59fc('0x1e'),_0x58a0bb,JSON['stringify'](_0x188c1d));_0x530c11(_0x188c1d);})[_0x59fc('0x1d')](function(_0x5e8669){logger[_0x59fc('0x19')]('UpdateMailInteraction',_0x5e8669[_0x59fc('0x1b')],_0x58a0bb);_0xdcfddb(_0x153c58[_0x59fc('0x19')](0x1f4,_0x5e8669['message']));});});};exports[_0x59fc('0x25')]=function(_0x16e41c){return new Promise(function(_0x5611e7,_0x1304ae){return db[_0x59fc('0x26')][_0x59fc('0x27')]({'where':_0x16e41c[_0x59fc('0x21')]?_0x16e41c[_0x59fc('0x21')]['where']||null:null})[_0x59fc('0x12')](function(_0x2a9423){if(_0x2a9423){return _0x2a9423[_0x59fc('0x28')](_0x16e41c['body'][_0x59fc('0x29')],_[_0x59fc('0x2a')](_0x16e41c[_0x59fc('0x20')],[_0x59fc('0x29'),'id'])||{});}})[_0x59fc('0x2b')](function(_0x18bcfc){logger[_0x59fc('0x13')](_0x59fc('0x2c'),_0x16e41c);logger['debug'](_0x59fc('0x2c'),_0x16e41c,JSON[_0x59fc('0x18')](_0x18bcfc));_0x5611e7(_0x18bcfc);})[_0x59fc('0x1d')](function(_0x57795b){logger[_0x59fc('0x19')]('AddTags',_0x57795b[_0x59fc('0x1b')],_0x16e41c);_0x1304ae(_this[_0x59fc('0x19')](0x1f4,_0x57795b[_0x59fc('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 529d522..70ba729 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 _0xa52a=['update','emit','removeListener','register','length','./mailInteraction.events','save'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0xa52a,0x194));var _0xaa52=function(_0x5caabb,_0x2b0cc1){_0x5caabb=_0x5caabb-0x0;var _0x2929d8=_0xa52a[_0x5caabb];return _0x2929d8;};'use strict';var MailInteractionEvents=require(_0xaa52('0x0'));var events=[_0xaa52('0x1'),'remove',_0xaa52('0x2')];function createListener(_0x2baf6e,_0x335f07){return function(_0x4e969b){_0x335f07[_0xaa52('0x3')](_0x2baf6e,_0x4e969b);};}function removeListener(_0x1f84da,_0x25a95d){return function(){MailInteractionEvents[_0xaa52('0x4')](_0x1f84da,_0x25a95d);};}exports[_0xaa52('0x5')]=function(_0x2deb50){for(var _0x72923a=0x0,_0x201d94=events[_0xaa52('0x6')];_0x72923a<_0x201d94;_0x72923a++){var _0x18bd48=events[_0x72923a];var _0xb56d3=createListener('mailInteraction:'+_0x18bd48,_0x2deb50);MailInteractionEvents['on'](_0x18bd48,_0xb56d3);}}; \ No newline at end of file +var _0x01dc=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x01dc,0x8e));var _0xc01d=function(_0x169768,_0x123128){_0x169768=_0x169768-0x0;var _0x96b163=_0x01dc[_0x169768];return _0x96b163;};'use strict';var MailInteractionEvents=require(_0xc01d('0x0'));var events=[_0xc01d('0x1'),_0xc01d('0x2'),'update'];function createListener(_0x3a6e48,_0x45b878){return function(_0x105596){_0x45b878[_0xc01d('0x3')](_0x3a6e48,_0x105596);};}function removeListener(_0x20aa97,_0x31dd0b){return function(){MailInteractionEvents[_0xc01d('0x4')](_0x20aa97,_0x31dd0b);};}exports[_0xc01d('0x5')]=function(_0x2007d0){for(var _0x5d4787=0x0,_0x1845a2=events[_0xc01d('0x6')];_0x5d4787<_0x1845a2;_0x5d4787++){var _0x109466=events[_0x5d4787];var _0xa02c78=createListener(_0xc01d('0x7')+_0x109466,_0x2007d0);MailInteractionEvents['on'](_0x109466,_0xa02c78);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 69e986a..f9cd5c8 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 _0x0f94=['/:id','update','/:id/accept','/:id/reject','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get','/describe','describe','show','download','post','tracked','mailmessage:create','create'];(function(_0x1f1fb4,_0x15a561){var _0x12fa15=function(_0x5ecc9b){while(--_0x5ecc9b){_0x1f1fb4['push'](_0x1f1fb4['shift']());}};_0x12fa15(++_0x15a561);}(_0x0f94,0x1ad));var _0x40f9=function(_0x518b93,_0x5a5dfc){_0x518b93=_0x518b93-0x0;var _0x416763=_0x0f94[_0x518b93];return _0x416763;};'use strict';var multer=require(_0x40f9('0x0'));var util=require(_0x40f9('0x1'));var path=require(_0x40f9('0x2'));var timeout=require(_0x40f9('0x3'));var express=require(_0x40f9('0x4'));var router=express[_0x40f9('0x5')]();var fs_extra=require(_0x40f9('0x6'));var auth=require(_0x40f9('0x7'));var interaction=require(_0x40f9('0x8'));var config=require(_0x40f9('0x9'));var controller=require(_0x40f9('0xa'));router['get']('/',auth[_0x40f9('0xb')](),controller['index']);router[_0x40f9('0xc')](_0x40f9('0xd'),auth['isAuthenticated'](),controller[_0x40f9('0xe')]);router['get']('/:id',auth[_0x40f9('0xb')](),controller[_0x40f9('0xf')]);router[_0x40f9('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x40f9('0x10')]);router[_0x40f9('0x11')]('/',auth['isAuthenticated'](),interaction[_0x40f9('0x12')]('mail',_0x40f9('0x13')),controller[_0x40f9('0x14')]);router['put'](_0x40f9('0x15'),auth['isAuthenticated'](),controller[_0x40f9('0x16')]);router['put'](_0x40f9('0x17'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x40f9('0x18'),auth[_0x40f9('0xb')](),controller['reject']);router['delete']('/:id',auth[_0x40f9('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbdeb=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/download','download','post','tracked','mail','put','/:id/accept','accept','/:id/reject','delete','/:id','exports','util','connect-timeout','Router','fs-extra'];(function(_0x135a5d,_0x562b60){var _0x4813c6=function(_0x8f7ad0){while(--_0x8f7ad0){_0x135a5d['push'](_0x135a5d['shift']());}};_0x4813c6(++_0x562b60);}(_0xbdeb,0x6f));var _0xbbde=function(_0x19f29c,_0x3488de){_0x19f29c=_0x19f29c-0x0;var _0x23bf85=_0xbdeb[_0x19f29c];return _0x23bf85;};'use strict';var multer=require('multer');var util=require(_0xbbde('0x0'));var path=require('path');var timeout=require(_0xbbde('0x1'));var express=require('express');var router=express[_0xbbde('0x2')]();var fs_extra=require(_0xbbde('0x3'));var auth=require(_0xbbde('0x4'));var interaction=require(_0xbbde('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbbde('0x6')]('/',auth[_0xbbde('0x7')](),controller[_0xbbde('0x8')]);router[_0xbbde('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xbbde('0x9')]);router[_0xbbde('0x6')]('/:id',auth[_0xbbde('0x7')](),controller[_0xbbde('0xa')]);router[_0xbbde('0x6')](_0xbbde('0xb'),auth[_0xbbde('0x7')](),controller[_0xbbde('0xc')]);router[_0xbbde('0xd')]('/',auth[_0xbbde('0x7')](),interaction[_0xbbde('0xe')](_0xbbde('0xf'),'mailmessage:create'),controller['create']);router[_0xbbde('0x10')]('/:id',auth[_0xbbde('0x7')](),controller['update']);router[_0xbbde('0x10')](_0xbbde('0x11'),auth[_0xbbde('0x7')](),controller[_0xbbde('0x12')]);router[_0xbbde('0x10')](_0xbbde('0x13'),auth[_0xbbde('0x7')](),controller['reject']);router[_0xbbde('0x14')](_0xbbde('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xbbde('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2c85a4c..9b81d1b 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 _0xeef0=['DATE','Email','Chat','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xeef0,0x121));var _0x0eef=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xeef0[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x0eef('0x0'));var _=require(_0x0eef('0x1'));module[_0x0eef('0x2')]={'body':{'type':Sequelize['TEXT'](_0x0eef('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0eef('0x4')](_0x0eef('0x5'))},'read':{'type':Sequelize[_0x0eef('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0eef('0x7')]('in','out'),'defaultValue':_0x0eef('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0eef('0x9')](0x1fe)},'from':{'type':Sequelize[_0x0eef('0x9')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x0eef('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x0eef('0x3'))},'subject':{'type':Sequelize[_0x0eef('0x4')]},'sentAt':{'type':Sequelize[_0x0eef('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0eef('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0eef('0xa')]},'originTo':{'type':Sequelize[_0x0eef('0x4')](_0x0eef('0x3'))},'originCc':{'type':Sequelize[_0x0eef('0x4')](_0x0eef('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0x0eef('0xb'),_0x0eef('0xc')),'defaultValue':_0x0eef('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x34fc=['TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Chat','Email','sequelize','exports'];(function(_0x30cbe5,_0x5af316){var _0x3eb245=function(_0x17e17d){while(--_0x17e17d){_0x30cbe5['push'](_0x30cbe5['shift']());}};_0x3eb245(++_0x5af316);}(_0x34fc,0xdb));var _0xc34f=function(_0x1ec9e0,_0x423a34){_0x1ec9e0=_0x1ec9e0-0x0;var _0x542c54=_0x34fc[_0x1ec9e0];return _0x542c54;};'use strict';var Sequelize=require(_0xc34f('0x0'));var _=require('lodash');module[_0xc34f('0x1')]={'body':{'type':Sequelize[_0xc34f('0x2')](_0xc34f('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc34f('0x2')](_0xc34f('0x4'))},'read':{'type':Sequelize[_0xc34f('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc34f('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc34f('0x7')](0x1fe)},'from':{'type':Sequelize[_0xc34f('0x7')]},'to':{'type':Sequelize['TEXT'](_0xc34f('0x3'))},'cc':{'type':Sequelize[_0xc34f('0x2')](_0xc34f('0x3'))},'bcc':{'type':Sequelize[_0xc34f('0x2')](_0xc34f('0x3'))},'subject':{'type':Sequelize[_0xc34f('0x2')]},'sentAt':{'type':Sequelize[_0xc34f('0x8')]},'attach':{'type':Sequelize[_0xc34f('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc34f('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0xc34f('0x3'))},'originCc':{'type':Sequelize[_0xc34f('0x2')](_0xc34f('0x3'))},'originChannel':{'type':Sequelize[_0xc34f('0xa')]('Email',_0xc34f('0xb')),'defaultValue':_0xc34f('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 721e43d..1988af6 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 _0x1137=['register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','destroy','end','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','update','body','describe','create','direction','out','secret','MailAccount','findOne','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','format','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','MailInteractionId','isNil','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','User','event','rejectmessage','download','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','unlinkSync','moment','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket'];(function(_0x1ae4cf,_0x486600){var _0x5c1b93=function(_0x293126){while(--_0x293126){_0x1ae4cf['push'](_0x1ae4cf['shift']());}};_0x5c1b93(++_0x486600);}(_0x1137,0x1d6));var _0x7113=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x1137[_0x387dc1];return _0x17567c;};'use strict';var emlformat=require('eml-format');var moment=require(_0x7113('0x0'));var BPromise=require(_0x7113('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x7113('0x2'));var Redis=require(_0x7113('0x3'));var htmlToText=require('html-to-text');var qs=require(_0x7113('0x4'));var logger=require(_0x7113('0x5'))(_0x7113('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0x7113('0x7'))['db'];config[_0x7113('0x8')]=_['defaults'](config['redis'],{'host':_0x7113('0x9'),'port':0x18eb});var socket=require(_0x7113('0xa'))(new Redis(config[_0x7113('0x8')]));var htmlEntities=require(_0x7113('0xb'));require(_0x7113('0xc'))[_0x7113('0xd')](socket);var jayson=require(_0x7113('0xe'));var client=jayson[_0x7113('0xf')][_0x7113('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x7113('0x10')]({'port':0x232b});var client9002=jayson[_0x7113('0xf')][_0x7113('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x22045c,_0x48a550,_0x329cb0,_0x25df6a){return new BPromise(function(_0x124343,_0x5d9159){var _0x3a11c5=_0x25df6a||client;return _0x3a11c5['request'](_0x22045c,_0x329cb0)[_0x7113('0x11')](function(_0x435d48){logger[_0x7113('0x12')](_0x7113('0x13'),_0x48a550,_0x7113('0x14'));logger[_0x7113('0x15')](_0x7113('0x16'),_0x48a550,_0x7113('0x14'),JSON[_0x7113('0x17')](_0x435d48));if(_0x435d48[_0x7113('0x18')]){if(_0x435d48[_0x7113('0x18')][_0x7113('0x19')]===0x1f4){logger[_0x7113('0x18')](_0x7113('0x13'),_0x48a550,_0x435d48[_0x7113('0x18')][_0x7113('0x1a')]);return _0x5d9159(_0x435d48[_0x7113('0x18')][_0x7113('0x1a')]);}logger[_0x7113('0x18')]('MailMessage,\x20%s,\x20%s',_0x48a550,_0x435d48[_0x7113('0x18')][_0x7113('0x1a')]);return _0x124343(_0x435d48[_0x7113('0x18')][_0x7113('0x1a')]);}else{logger[_0x7113('0x12')]('MailMessage,\x20%s,\x20%s',_0x48a550,_0x7113('0x14'));_0x124343(_0x435d48[_0x7113('0x1b')]['message']);}})[_0x7113('0x1c')](function(_0x3d00f3){logger[_0x7113('0x18')]('MailMessage,\x20%s,\x20%s',_0x48a550,_0x3d00f3);_0x5d9159(_0x3d00f3);});});}function respondWithResult(_0xd03e54,_0x1636c2){_0x1636c2=_0x1636c2||0xc8;return function(_0x2f698c){if(_0x2f698c){return _0xd03e54[_0x7113('0x1d')](_0x1636c2)['json'](_0x2f698c);}};}function respondWithFilteredResult(_0x1d002b,_0x2c09dc){return function(_0x25fdaf){if(_0x25fdaf){var _0x45dc80=typeof _0x2c09dc[_0x7113('0x1e')]===_0x7113('0x1f')&&typeof _0x2c09dc[_0x7113('0x20')]===_0x7113('0x1f');var _0x110f0d=_0x25fdaf['count'];var _0x318148=_0x45dc80?0x0:_0x2c09dc[_0x7113('0x1e')];var _0x29bd88=_0x45dc80?_0x25fdaf[_0x7113('0x21')]:_0x2c09dc[_0x7113('0x1e')]+_0x2c09dc[_0x7113('0x20')];var _0x52e22c;if(_0x29bd88>=_0x110f0d){_0x29bd88=_0x110f0d;_0x52e22c=0xc8;}else{_0x52e22c=0xce;}_0x1d002b[_0x7113('0x1d')](_0x52e22c);return _0x1d002b[_0x7113('0x22')](_0x7113('0x23'),_0x318148+'-'+_0x29bd88+'/'+_0x110f0d)[_0x7113('0x24')](_0x25fdaf);}return null;};}function saveUpdates(_0x598180){return function(_0x378847){if(_0x378847){return _0x378847['update'](_0x598180)[_0x7113('0x11')](function(_0x1ac210){return _0x1ac210;});}return null;};}function removeEntity(_0x506839){return function(_0x57c198){if(_0x57c198){return _0x57c198[_0x7113('0x25')]()['then'](function(){_0x506839[_0x7113('0x1d')](0xcc)[_0x7113('0x26')]();});}};}function handleEntityNotFound(_0x383cbf){return function(_0x470b34){if(!_0x470b34){_0x383cbf['sendStatus'](0x194);}return _0x470b34;};}function handleError(_0x5a6f55,_0x4fdaca){_0x4fdaca=_0x4fdaca||0x1f4;return function(_0x184ba9){logger[_0x7113('0x18')](_0x184ba9['stack']);if(_0x184ba9[_0x7113('0x27')]){delete _0x184ba9['name'];}_0x5a6f55[_0x7113('0x1d')](_0x4fdaca)['send'](_0x184ba9);};}exports[_0x7113('0x28')]=function(_0x4cf9f7,_0x3844f0){var _0x5f3213={},_0x159f3a={},_0x4e5e61={'count':0x0,'rows':[]};var _0x264653=_[_0x7113('0x29')](db[_0x7113('0x2a')][_0x7113('0x2b')],function(_0x8bdbb6){return{'name':_0x8bdbb6[_0x7113('0x2c')],'type':_0x8bdbb6[_0x7113('0x2d')][_0x7113('0x2e')]};});_0x159f3a[_0x7113('0x2f')]=_[_0x7113('0x29')](_0x264653,_0x7113('0x27'));_0x159f3a['query']=_['keys'](_0x4cf9f7['query']);_0x159f3a[_0x7113('0x30')]=_[_0x7113('0x31')](_0x159f3a[_0x7113('0x2f')],_0x159f3a[_0x7113('0x32')]);_0x5f3213['attributes']=_[_0x7113('0x31')](_0x159f3a[_0x7113('0x2f')],qs['fields'](_0x4cf9f7[_0x7113('0x32')][_0x7113('0x33')]));_0x5f3213[_0x7113('0x34')]=_0x5f3213[_0x7113('0x34')][_0x7113('0x35')]?_0x5f3213[_0x7113('0x34')]:_0x159f3a[_0x7113('0x2f')];if(!_0x4cf9f7[_0x7113('0x32')][_0x7113('0x36')]('nolimit')){_0x5f3213[_0x7113('0x20')]=qs[_0x7113('0x20')](_0x4cf9f7['query'][_0x7113('0x20')]);_0x5f3213[_0x7113('0x1e')]=qs['offset'](_0x4cf9f7['query'][_0x7113('0x1e')]);}_0x5f3213[_0x7113('0x37')]=qs[_0x7113('0x38')](_0x4cf9f7[_0x7113('0x32')][_0x7113('0x38')]);_0x5f3213[_0x7113('0x39')]=qs[_0x7113('0x30')](_[_0x7113('0x3a')](_0x4cf9f7[_0x7113('0x32')],_0x159f3a[_0x7113('0x30')]),_0x264653);if(_0x4cf9f7[_0x7113('0x32')][_0x7113('0x3b')]){_0x5f3213[_0x7113('0x39')]=_[_0x7113('0x3c')](_0x5f3213['where'],{'$or':_[_0x7113('0x29')](_0x264653,function(_0xb25667){if(_0xb25667[_0x7113('0x2d')]!==_0x7113('0x3d')){var _0x33084b={};_0x33084b[_0xb25667['name']]={'$like':'%'+_0x4cf9f7[_0x7113('0x32')][_0x7113('0x3b')]+'%'};return _0x33084b;}})});}_0x5f3213=_['merge']({},_0x5f3213,_0x4cf9f7[_0x7113('0x3e')]);var _0x2dd5f8={'where':_0x5f3213['where']};return db[_0x7113('0x2a')][_0x7113('0x21')](_0x2dd5f8)['then'](function(_0x3d32ef){_0x4e5e61[_0x7113('0x21')]=_0x3d32ef;if(_0x4cf9f7[_0x7113('0x32')][_0x7113('0x3f')]){_0x5f3213[_0x7113('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0x7113('0x41')](_0x5f3213);})[_0x7113('0x11')](function(_0x520ceb){_0x4e5e61[_0x7113('0x42')]=_0x520ceb;return _0x4e5e61;})['then'](respondWithFilteredResult(_0x3844f0,_0x5f3213))['catch'](handleError(_0x3844f0,null));};exports['show']=function(_0x2a1330,_0x34bb20){var _0x900940={'raw':!![],'where':{'id':_0x2a1330[_0x7113('0x43')]['id']}},_0x38e3d1={};_0x38e3d1[_0x7113('0x2f')]=_[_0x7113('0x44')](db['MailMessage'][_0x7113('0x2b')]);_0x38e3d1[_0x7113('0x32')]=_[_0x7113('0x44')](_0x2a1330[_0x7113('0x32')]);_0x38e3d1['filters']=_[_0x7113('0x31')](_0x38e3d1[_0x7113('0x2f')],_0x38e3d1[_0x7113('0x32')]);_0x900940[_0x7113('0x34')]=_[_0x7113('0x31')](_0x38e3d1[_0x7113('0x2f')],qs[_0x7113('0x33')](_0x2a1330['query'][_0x7113('0x33')]));_0x900940[_0x7113('0x34')]=_0x900940[_0x7113('0x34')]['length']?_0x900940[_0x7113('0x34')]:_0x38e3d1[_0x7113('0x2f')];if(_0x2a1330[_0x7113('0x32')][_0x7113('0x3f')]){_0x900940[_0x7113('0x40')]=[{'all':!![]}];}_0x900940=_[_0x7113('0x3c')]({},_0x900940,_0x2a1330[_0x7113('0x3e')]);return db[_0x7113('0x2a')][_0x7113('0x45')](_0x900940)[_0x7113('0x11')](handleEntityNotFound(_0x34bb20,null))[_0x7113('0x11')](respondWithResult(_0x34bb20,null))['catch'](handleError(_0x34bb20,null));};exports[_0x7113('0x46')]=function(_0xf0e4f0,_0x5c5010){if(_0xf0e4f0['body']['id']){delete _0xf0e4f0[_0x7113('0x47')]['id'];}return db['MailMessage']['find']({'where':{'id':_0xf0e4f0['params']['id']}})[_0x7113('0x11')](handleEntityNotFound(_0x5c5010,null))[_0x7113('0x11')](saveUpdates(_0xf0e4f0[_0x7113('0x47')],null))['then'](respondWithResult(_0x5c5010,null))['catch'](handleError(_0x5c5010,null));};exports[_0x7113('0x25')]=function(_0x5de41d,_0x13312e){return db['MailMessage'][_0x7113('0x45')]({'where':{'id':_0x5de41d[_0x7113('0x43')]['id']}})['then'](handleEntityNotFound(_0x13312e,null))[_0x7113('0x11')](removeEntity(_0x13312e,null))[_0x7113('0x1c')](handleError(_0x13312e,null));};exports[_0x7113('0x48')]=function(_0x64b55f,_0x2d88ca){return db[_0x7113('0x2a')][_0x7113('0x48')]()[_0x7113('0x11')](respondWithResult(_0x2d88ca,null))[_0x7113('0x1c')](handleError(_0x2d88ca,null));};exports['create']=function(_0x271f69,_0x5b2cab){return db[_0x7113('0x2a')][_0x7113('0x49')](_0x271f69[_0x7113('0x47')])[_0x7113('0x11')](function(_0x32cd2e){if(_0x32cd2e){if(_0x32cd2e[_0x7113('0x4a')]===_0x7113('0x4b')&&!_0x32cd2e[_0x7113('0x4c')]){var _0x5caac9,_0x4f6d90,_0x5010b3;if(_0x271f69[_0x7113('0x47')]['to']){_0x4f6d90=_0x271f69[_0x7113('0x47')]['to']['split'](',')[0x0];}return db[_0x7113('0x4d')][_0x7113('0x4e')]({'where':{'id':_0x32cd2e['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x7113('0x4f'),'include':[{'model':db[_0x7113('0x50')],'as':_0x7113('0x51'),'where':{'email':_0x4f6d90},'limit':0x1,'order':[[_0x7113('0x52'),_0x7113('0x53')]]}]},{'model':db[_0x7113('0x54')],'as':_0x7113('0x55'),'raw':!![]}]})[_0x7113('0x11')](function(_0x18c281){_0x5caac9=_0x18c281;if(_0x5caac9&&_0x5caac9[_0x7113('0x55')]){var _0x550fac={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5caac9[_0x7113('0x55')][_0x7113('0x56')])){_0x550fac[_0x7113('0x57')]=_0x5caac9['Smtp'][_0x7113('0x57')];_0x550fac[_0x7113('0x58')]=_0x5caac9[_0x7113('0x55')][_0x7113('0x58')];_0x550fac[_0x7113('0x59')]=_0x5caac9[_0x7113('0x55')][_0x7113('0x59')];if(_0x5caac9[_0x7113('0x55')][_0x7113('0x5a')]){_0x550fac[_0x7113('0x5b')]={'user':_0x5caac9[_0x7113('0x55')]['user'],'pass':_0x5caac9['Smtp'][_0x7113('0x5c')]};}}else{_0x550fac['service']=_0x5caac9['Smtp'][_0x7113('0x56')];_0x550fac[_0x7113('0x5b')]={'user':_0x5caac9[_0x7113('0x55')][_0x7113('0x5d')],'pass':_0x5caac9[_0x7113('0x55')][_0x7113('0x5c')]};_0x550fac['secure']=_0x5caac9[_0x7113('0x55')][_0x7113('0x59')];}if(_0x271f69[_0x7113('0x47')][_0x7113('0x5e')]&&_0x271f69[_0x7113('0x47')][_0x7113('0x5e')][_0x7113('0x35')]){for(var _0x46f4b0=0x0;_0x46f4b0<_0x271f69[_0x7113('0x47')]['attachments'][_0x7113('0x35')];_0x46f4b0+=0x1){_0x271f69[_0x7113('0x47')][_0x7113('0x5e')][_0x46f4b0]={'filename':_0x271f69[_0x7113('0x47')]['attachments'][_0x46f4b0][_0x7113('0x27')],'path':path[_0x7113('0x5f')](config[_0x7113('0x60')],_0x7113('0x61'),_0x271f69[_0x7113('0x47')][_0x7113('0x5e')][_0x46f4b0][_0x7113('0x62')])};}}_0x5010b3={'account':_0x550fac,'message':_0x271f69[_0x7113('0x47')]};return;}})[_0x7113('0x11')](function(){if(_0x5caac9[_0x7113('0x4f')]){if(_0x5caac9[_0x7113('0x4f')][_0x7113('0x51')][_0x7113('0x35')]){return _0x5caac9[_0x7113('0x4f')]['Contacts'][0x0];}else{return db[_0x7113('0x50')][_0x7113('0x49')](_['defaults'](_0x271f69['body'],{'firstName':_0x271f69[_0x7113('0x47')]['to'],'email':_0x271f69[_0x7113('0x47')]['to'],'phone':_0x271f69[_0x7113('0x47')]['to'],'ListId':_0x5caac9[_0x7113('0x63')]}));}}else{throw new Error(_0x7113('0x64'));}})[_0x7113('0x11')](function(){if(_0x5010b3){return respondWithRpcPromise('SendMail',_0x7113('0x65'),_0x5010b3,client9003)[_0x7113('0x11')](function(_0x3639bb){return _0x32cd2e[_0x7113('0x46')]({'read':!![],'messageId':_0x3639bb['messageId'],'sentAt':moment()[_0x7113('0x66')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x479919){logger[_0x7113('0x18')]('%s',JSON['stringify'](_0x479919));return _0x32cd2e;});}return _0x32cd2e;});}return _0x32cd2e;}})[_0x7113('0x11')](respondWithResult(_0x5b2cab,0xc9))['catch'](handleError(_0x5b2cab,null));};exports[_0x7113('0x67')]=function(_0x4298a8,_0x5524a8){var _0x39c022={'agent':{},'channel':'mail'};if(_0x4298a8['body']['id']){delete _0x4298a8[_0x7113('0x47')]['id'];}_0x4298a8[_0x7113('0x47')][_0x7113('0x68')]=!![];_0x4298a8[_0x7113('0x47')][_0x7113('0x69')]=moment()[_0x7113('0x66')](_0x7113('0x6a'));_0x4298a8[_0x7113('0x47')][_0x7113('0x6b')]=_0x4298a8[_0x7113('0x47')][_0x7113('0x6b')]||_0x4298a8[_0x7113('0x5d')]['id'];_0x39c022[_0x7113('0x6c')]['id']=_0x4298a8[_0x7113('0x47')]['UserId'];return db[_0x7113('0x2a')][_0x7113('0x45')]({'where':{'id':_0x4298a8[_0x7113('0x43')]['id'],'UserId':null}})[_0x7113('0x11')](handleEntityNotFound(_0x5524a8,null))[_0x7113('0x11')](saveUpdates(_0x4298a8[_0x7113('0x47')],null))['then'](function(_0x5be1a0){if(_0x5be1a0){_0x39c022[_0x7113('0x1a')]=_0x5be1a0['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5be1a0[_0x7113('0x6d')]}});}return null;})[_0x7113('0x11')](handleEntityNotFound(_0x5524a8,null))[_0x7113('0x11')](function(_0x38d0e3){if(_0x38d0e3){return _0x38d0e3[_0x7113('0x46')]({'UserId':_0x4298a8['body']['UserId'],'read1stAt':_[_0x7113('0x6e')](_0x38d0e3[_0x7113('0x6f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7113('0x11')](function(_0x23c868){if(_0x23c868){_0x39c022['interaction']=_0x23c868[_0x7113('0x70')]({'plain':!![]});interaction_log['info'](_0x7113('0x71'),_0x4298a8['user']['id'],_0x4298a8[_0x7113('0x5d')][_0x7113('0x27')],_0x4298a8[_0x7113('0x5d')][_0x7113('0x72')],_0x39c022[_0x7113('0x73')]['id'],_0x4298a8[_0x7113('0x47')]?JSON[_0x7113('0x17')](_0x4298a8[_0x7113('0x47')]):_0x7113('0x74'));return respondWithRpcPromise('AcceptMessage',_0x7113('0x75'),_0x39c022);}return null;})[_0x7113('0x11')](function(_0x5e6d53){var _0x326b01=_0x7113('0x76')+_0x5e6d53[_0x7113('0x1a')]['ContactId'];return db[_0x7113('0x77')][_0x7113('0x32')](_0x326b01,{'type':db[_0x7113('0x78')]['QueryTypes'][_0x7113('0x79')],'raw':!![]})['then'](function(_0x9a4d4){return _0x9a4d4;});})[_0x7113('0x11')](function(_0x37b44e){if(_0x37b44e){_0x39c022[_0x7113('0x1a')][_0x7113('0x7a')]=_0x37b44e[0x0];if(!_0x4298a8[_0x7113('0x47')][_0x7113('0x6b')])return;return db['User'][_0x7113('0x45')]({'where':{'id':_0x4298a8[_0x7113('0x47')][_0x7113('0x6b')],'role':_0x7113('0x6c')},'attributes':['id',_0x7113('0x27'),_0x7113('0x7b'),'email',_0x7113('0x7c')],'raw':!![]});}return null;})['then'](function(_0x409ec2){if(!_0x409ec2)return null;_0x39c022[_0x7113('0x1a')][_0x7113('0x6c')]=_0x409ec2;return _0x39c022;})['then'](function(_0x4d11c5){if(_0x4d11c5){if(_0x4298a8[_0x7113('0x47')][_0x7113('0x7d')]){_0x39c022[_0x7113('0x1a')][_0x7113('0x7e')]=util['format'](_0x7113('0x7f'),_0x4298a8[_0x7113('0x5d')][_0x7113('0x27')]);_0x39c022[_0x7113('0x1a')][_0x7113('0x80')]=_0x39c022[_0x7113('0x80')];_0x39c022[_0x7113('0x1a')][_0x7113('0x81')]=_0x39c022[_0x7113('0x80')];_0x39c022[_0x7113('0x1a')]['event']=_0x7113('0x67');_0x39c022['message'][_0x7113('0x47')]=htmlToText[_0x7113('0x82')](_0x39c022[_0x7113('0x1a')][_0x7113('0x47')]);return respondWithRpcPromise(_0x7113('0x83'),_0x7113('0x83'),{'event':'acceptmessage','message':_0x39c022[_0x7113('0x1a')]},client9002)[_0x7113('0x11')](function(){return _0x39c022;});}return _0x39c022;}return null;})[_0x7113('0x11')](respondWithResult(_0x5524a8,null))[_0x7113('0x1c')](handleError(_0x5524a8,null));};exports['reject']=function(_0x10d931,_0x4c3369){var _0x498c23={'agent':{},'channel':'mail'};if(_0x10d931['body']['id']){delete _0x10d931[_0x7113('0x47')]['id'];}_0x10d931[_0x7113('0x47')][_0x7113('0x6b')]=_0x10d931['body'][_0x7113('0x6b')]||_0x10d931[_0x7113('0x5d')]['id'];_0x498c23[_0x7113('0x6c')]['id']=_0x10d931[_0x7113('0x47')]['UserId'];return db['MailMessage'][_0x7113('0x45')]({'where':{'id':_0x10d931[_0x7113('0x43')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4c3369,null))[_0x7113('0x11')](function(_0x54323d){if(_0x54323d){_0x498c23['message']=_0x54323d[_0x7113('0x70')]({'plain':!![]});return db[_0x7113('0x84')][_0x7113('0x45')]({'where':{'id':_0x54323d[_0x7113('0x6d')]}});}return null;})[_0x7113('0x11')](handleEntityNotFound(_0x4c3369,null))['then'](function(_0x298c4e){if(_0x298c4e){_0x498c23[_0x7113('0x73')]=_0x298c4e[_0x7113('0x70')]({'plain':!![]});interaction_log['info'](_0x7113('0x85'),_0x10d931['user']['id'],_0x10d931[_0x7113('0x5d')][_0x7113('0x27')],_0x10d931[_0x7113('0x5d')][_0x7113('0x72')],_0x498c23[_0x7113('0x73')]['id'],_0x10d931[_0x7113('0x47')]?JSON[_0x7113('0x17')](_0x10d931[_0x7113('0x47')]):_0x7113('0x74'));return respondWithRpcPromise(_0x7113('0x86'),_0x7113('0x87'),_0x498c23);}return null;})[_0x7113('0x11')](function(_0x44ab3d){var _0x3d41df=_0x7113('0x76')+_0x44ab3d[_0x7113('0x1a')][_0x7113('0x88')];return db[_0x7113('0x77')][_0x7113('0x32')](_0x3d41df,{'type':db[_0x7113('0x78')][_0x7113('0x89')][_0x7113('0x79')],'raw':!![]})[_0x7113('0x11')](function(_0x6d7bb2){return _0x6d7bb2;});})[_0x7113('0x11')](function(_0x5596f9){if(_0x5596f9){_0x498c23['message']['contact']=_0x5596f9[0x0];if(!_0x10d931['body'][_0x7113('0x6b')])return;return db[_0x7113('0x8a')][_0x7113('0x45')]({'where':{'id':_0x10d931[_0x7113('0x47')][_0x7113('0x6b')],'role':_0x7113('0x6c')},'attributes':['id',_0x7113('0x27'),'fullname','email',_0x7113('0x7c')],'raw':!![]});}return null;})[_0x7113('0x11')](function(_0x1e8981){if(!_0x1e8981)return null;_0x498c23[_0x7113('0x1a')]['agent']=_0x1e8981;return _0x498c23;})['then'](function(_0x3843e8){if(_0x3843e8){_0x3843e8[_0x7113('0x1a')][_0x7113('0x7e')]=util[_0x7113('0x66')]('SIP/%s',_0x10d931['user'][_0x7113('0x27')]);_0x3843e8[_0x7113('0x1a')]['channel']=_0x498c23[_0x7113('0x80')];_0x3843e8[_0x7113('0x1a')]['motionChannel']=_0x498c23[_0x7113('0x80')];_0x3843e8[_0x7113('0x1a')][_0x7113('0x8b')]='reject';_0x3843e8['message'][_0x7113('0x47')]=htmlToText[_0x7113('0x82')](_0x498c23[_0x7113('0x1a')][_0x7113('0x47')]);respondWithRpcPromise('EventManager',_0x7113('0x83'),{'event':_0x7113('0x8c'),'message':_0x3843e8[_0x7113('0x1a')]},client9002);return _0x498c23;}return null;})[_0x7113('0x11')](respondWithResult(_0x4c3369,null))[_0x7113('0x1c')](handleError(_0x4c3369,null));};exports[_0x7113('0x8d')]=function(_0x5d2f75,_0xbda6f4){var _0x379140=moment()['unix']()[_0x7113('0x8e')]();var _0x5a2724=path['join'](config[_0x7113('0x60')],_0x7113('0x8f'),_0x7113('0x90'),'tmp');var _0x338b98=path[_0x7113('0x5f')](config[_0x7113('0x60')],'server',_0x7113('0x90'),_0x7113('0x5e'));var _0x4008aa=util[_0x7113('0x66')](_0x7113('0x91'),_0x379140);return db[_0x7113('0x2a')]['find']({'where':{'id':_0x5d2f75['params']['id']},'attributes':['id','body',_0x7113('0x92'),'to','cc',_0x7113('0x93'),_0x7113('0x94'),_0x7113('0x95')],'include':_0x5d2f75[_0x7113('0x32')][_0x7113('0x5e')]?[{'model':db[_0x7113('0x96')],'as':_0x7113('0x97')}]:undefined})['then'](handleEntityNotFound(_0xbda6f4,null))[_0x7113('0x11')](function(_0xda9dea){if(_0xda9dea){var _0x42f2a9=_0xda9dea;var _0x152483={'from':_0x42f2a9[_0x7113('0x92')],'to':_0x42f2a9['to'],'subject':_0x42f2a9[_0x7113('0x94')],'html':htmlEntities[_0x7113('0x98')](_0x42f2a9[_0x7113('0x47')]),'headers':{'Date':moment(_0x42f2a9[_0x7113('0x95')])[_0x7113('0x66')](_0x7113('0x99'))},'attachments':[]};if(_0xda9dea['cc']){_0x152483[_0x7113('0x9a')]['Cc']=_0xda9dea['cc'];}if(_0xda9dea[_0x7113('0x93')]){_0x152483[_0x7113('0x9a')][_0x7113('0x9b')]=_0xda9dea[_0x7113('0x93')];}return new BPromise(function(_0x214508,_0x23e931){if(_0xda9dea['Attachments']){for(var _0x36c54d=0x0;_0x36c54d<_0xda9dea[_0x7113('0x97')]['length'];_0x36c54d++){var _0x4d18af=_0xda9dea[_0x7113('0x97')][_0x36c54d];var _0x17453f=path[_0x7113('0x5f')](_0x338b98,_0x4d18af[_0x7113('0x62')]);if(fs[_0x7113('0x9c')](_0x17453f)){_0x152483['attachments'][_0x7113('0x9d')]({'name':_0x4d18af[_0x7113('0x27')],'contentType':_0x4d18af[_0x7113('0x2d')],'data':fs['readFileSync'](_0x17453f)});}}}emlformat[_0x7113('0x9e')](_0x152483,function(_0x4fb186,_0x9beb8e){if(_0x4fb186)return _0x23e931(_0x4fb186);fs[_0x7113('0x9f')](path[_0x7113('0x5f')](_0x5a2724,_0x4008aa),_0x9beb8e);return _0x214508(_0x9beb8e);});});}})[_0x7113('0x11')](function(_0x3d3fc3){if(_0x3d3fc3){return _0xbda6f4[_0x7113('0x8d')](path[_0x7113('0x5f')](_0x5a2724,_0x4008aa),_0x4008aa,function(_0x4f4f0c){if(!_0x4f4f0c)fs[_0x7113('0xa0')](path[_0x7113('0x5f')](_0x5a2724,_0x4008aa));});}})[_0x7113('0x1c')](handleError(_0xbda6f4,null));}; \ No newline at end of file +var _0x7e0a=['reject','rejectmessage','toString','server','files','tmp','message-%s.eml','bcc','Attachment','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','push','readFileSync','build','download','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','sendStatus','send','map','MailMessage','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','show','keys','includeAll','find','catch','body','params','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','Smtp','isNil','service','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','agent','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','channel','event','accept','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','internal','SIP/%s','motionChannel'];(function(_0x3a48d6,_0x12a8d2){var _0x19c374=function(_0x1ac816){while(--_0x1ac816){_0x3a48d6['push'](_0x3a48d6['shift']());}};_0x19c374(++_0x12a8d2);}(_0x7e0a,0x15a));var _0xa7e0=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x7e0a[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0xa7e0('0x0'));var moment=require('moment');var BPromise=require(_0xa7e0('0x1'));var util=require(_0xa7e0('0x2'));var path=require(_0xa7e0('0x3'));var fs=require('fs');var _=require(_0xa7e0('0x4'));var Redis=require(_0xa7e0('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xa7e0('0x6'));var logger=require(_0xa7e0('0x7'))('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xa7e0('0x8'));var db=require(_0xa7e0('0x9'))['db'];config[_0xa7e0('0xa')]=_['defaults'](config[_0xa7e0('0xa')],{'host':_0xa7e0('0xb'),'port':0x18eb});var socket=require(_0xa7e0('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0xa7e0('0xd'));require(_0xa7e0('0xe'))['register'](socket);var jayson=require(_0xa7e0('0xf'));var client=jayson['client'][_0xa7e0('0x10')]({'port':0x232c});var client9003=jayson[_0xa7e0('0x11')][_0xa7e0('0x10')]({'port':0x232b});var client9002=jayson[_0xa7e0('0x11')][_0xa7e0('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x20f4e0,_0x406b0a,_0x4288fe,_0x4ecb49){return new BPromise(function(_0x2d1760,_0x45a23b){var _0x24630c=_0x4ecb49||client;return _0x24630c['request'](_0x20f4e0,_0x4288fe)[_0xa7e0('0x12')](function(_0x8e5d0b){logger[_0xa7e0('0x13')]('MailMessage,\x20%s,\x20%s',_0x406b0a,'request\x20sent');logger[_0xa7e0('0x14')](_0xa7e0('0x15'),_0x406b0a,_0xa7e0('0x16'),JSON[_0xa7e0('0x17')](_0x8e5d0b));if(_0x8e5d0b['error']){if(_0x8e5d0b[_0xa7e0('0x18')][_0xa7e0('0x19')]===0x1f4){logger[_0xa7e0('0x18')](_0xa7e0('0x1a'),_0x406b0a,_0x8e5d0b[_0xa7e0('0x18')][_0xa7e0('0x1b')]);return _0x45a23b(_0x8e5d0b[_0xa7e0('0x18')]['message']);}logger[_0xa7e0('0x18')]('MailMessage,\x20%s,\x20%s',_0x406b0a,_0x8e5d0b['error'][_0xa7e0('0x1b')]);return _0x2d1760(_0x8e5d0b[_0xa7e0('0x18')][_0xa7e0('0x1b')]);}else{logger['info'](_0xa7e0('0x1a'),_0x406b0a,'request\x20sent');_0x2d1760(_0x8e5d0b[_0xa7e0('0x1c')][_0xa7e0('0x1b')]);}})['catch'](function(_0x1b4b23){logger[_0xa7e0('0x18')](_0xa7e0('0x1a'),_0x406b0a,_0x1b4b23);_0x45a23b(_0x1b4b23);});});}function respondWithResult(_0x2c4eb3,_0x42f52c){_0x42f52c=_0x42f52c||0xc8;return function(_0x998ea9){if(_0x998ea9){return _0x2c4eb3[_0xa7e0('0x1d')](_0x42f52c)[_0xa7e0('0x1e')](_0x998ea9);}};}function respondWithFilteredResult(_0x25f608,_0x4fbbba){return function(_0x16687c){if(_0x16687c){var _0x1028d6=typeof _0x4fbbba['offset']===_0xa7e0('0x1f')&&typeof _0x4fbbba[_0xa7e0('0x20')]===_0xa7e0('0x1f');var _0x3d41d6=_0x16687c[_0xa7e0('0x21')];var _0x21a41f=_0x1028d6?0x0:_0x4fbbba[_0xa7e0('0x22')];var _0x5a57fb=_0x1028d6?_0x16687c[_0xa7e0('0x21')]:_0x4fbbba[_0xa7e0('0x22')]+_0x4fbbba[_0xa7e0('0x20')];var _0xd02f27;if(_0x5a57fb>=_0x3d41d6){_0x5a57fb=_0x3d41d6;_0xd02f27=0xc8;}else{_0xd02f27=0xce;}_0x25f608[_0xa7e0('0x1d')](_0xd02f27);return _0x25f608[_0xa7e0('0x23')](_0xa7e0('0x24'),_0x21a41f+'-'+_0x5a57fb+'/'+_0x3d41d6)[_0xa7e0('0x1e')](_0x16687c);}return null;};}function saveUpdates(_0x4f6c65){return function(_0x3e547f){if(_0x3e547f){return _0x3e547f[_0xa7e0('0x25')](_0x4f6c65)['then'](function(_0x29eead){return _0x29eead;});}return null;};}function removeEntity(_0x5dcdd3){return function(_0x2385fb){if(_0x2385fb){return _0x2385fb[_0xa7e0('0x26')]()['then'](function(){_0x5dcdd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f2ba){return function(_0x334cfa){if(!_0x334cfa){_0x28f2ba[_0xa7e0('0x27')](0x194);}return _0x334cfa;};}function handleError(_0x13ffeb,_0x46f55d){_0x46f55d=_0x46f55d||0x1f4;return function(_0x16a03d){logger[_0xa7e0('0x18')](_0x16a03d['stack']);if(_0x16a03d['name']){delete _0x16a03d['name'];}_0x13ffeb['status'](_0x46f55d)[_0xa7e0('0x28')](_0x16a03d);};}exports['index']=function(_0x57e513,_0x5f0bc0){var _0x40abaa={},_0x23ab81={},_0x4bd8cf={'count':0x0,'rows':[]};var _0xcd8fe1=_[_0xa7e0('0x29')](db[_0xa7e0('0x2a')][_0xa7e0('0x2b')],function(_0x1c190f){return{'name':_0x1c190f[_0xa7e0('0x2c')],'type':_0x1c190f[_0xa7e0('0x2d')]['key']};});_0x23ab81[_0xa7e0('0x2e')]=_[_0xa7e0('0x29')](_0xcd8fe1,_0xa7e0('0x2f'));_0x23ab81[_0xa7e0('0x30')]=_['keys'](_0x57e513[_0xa7e0('0x30')]);_0x23ab81[_0xa7e0('0x31')]=_[_0xa7e0('0x32')](_0x23ab81[_0xa7e0('0x2e')],_0x23ab81['query']);_0x40abaa['attributes']=_['intersection'](_0x23ab81['model'],qs[_0xa7e0('0x33')](_0x57e513['query'][_0xa7e0('0x33')]));_0x40abaa[_0xa7e0('0x34')]=_0x40abaa[_0xa7e0('0x34')][_0xa7e0('0x35')]?_0x40abaa[_0xa7e0('0x34')]:_0x23ab81[_0xa7e0('0x2e')];if(!_0x57e513[_0xa7e0('0x30')][_0xa7e0('0x36')](_0xa7e0('0x37'))){_0x40abaa[_0xa7e0('0x20')]=qs[_0xa7e0('0x20')](_0x57e513[_0xa7e0('0x30')][_0xa7e0('0x20')]);_0x40abaa['offset']=qs['offset'](_0x57e513[_0xa7e0('0x30')][_0xa7e0('0x22')]);}_0x40abaa['order']=qs[_0xa7e0('0x38')](_0x57e513['query']['sort']);_0x40abaa['where']=qs[_0xa7e0('0x31')](_[_0xa7e0('0x39')](_0x57e513[_0xa7e0('0x30')],_0x23ab81[_0xa7e0('0x31')]),_0xcd8fe1);if(_0x57e513['query'][_0xa7e0('0x3a')]){_0x40abaa[_0xa7e0('0x3b')]=_[_0xa7e0('0x3c')](_0x40abaa[_0xa7e0('0x3b')],{'$or':_[_0xa7e0('0x29')](_0xcd8fe1,function(_0x47e3e5){if(_0x47e3e5[_0xa7e0('0x2d')]!==_0xa7e0('0x3d')){var _0x560128={};_0x560128[_0x47e3e5[_0xa7e0('0x2f')]]={'$like':'%'+_0x57e513[_0xa7e0('0x30')][_0xa7e0('0x3a')]+'%'};return _0x560128;}})});}_0x40abaa=_[_0xa7e0('0x3c')]({},_0x40abaa,_0x57e513[_0xa7e0('0x3e')]);var _0x124c73={'where':_0x40abaa[_0xa7e0('0x3b')]};return db[_0xa7e0('0x2a')][_0xa7e0('0x21')](_0x124c73)[_0xa7e0('0x12')](function(_0x19704d){_0x4bd8cf[_0xa7e0('0x21')]=_0x19704d;if(_0x57e513[_0xa7e0('0x30')]['includeAll']){_0x40abaa[_0xa7e0('0x3f')]=[{'all':!![]}];}return db[_0xa7e0('0x2a')]['findAll'](_0x40abaa);})['then'](function(_0x11e216){_0x4bd8cf[_0xa7e0('0x40')]=_0x11e216;return _0x4bd8cf;})[_0xa7e0('0x12')](respondWithFilteredResult(_0x5f0bc0,_0x40abaa))['catch'](handleError(_0x5f0bc0,null));};exports[_0xa7e0('0x41')]=function(_0x235811,_0x5263fb){var _0x51b692={'raw':!![],'where':{'id':_0x235811['params']['id']}},_0x1df664={};_0x1df664[_0xa7e0('0x2e')]=_[_0xa7e0('0x42')](db[_0xa7e0('0x2a')][_0xa7e0('0x2b')]);_0x1df664[_0xa7e0('0x30')]=_[_0xa7e0('0x42')](_0x235811['query']);_0x1df664['filters']=_[_0xa7e0('0x32')](_0x1df664[_0xa7e0('0x2e')],_0x1df664['query']);_0x51b692['attributes']=_[_0xa7e0('0x32')](_0x1df664[_0xa7e0('0x2e')],qs[_0xa7e0('0x33')](_0x235811['query'][_0xa7e0('0x33')]));_0x51b692[_0xa7e0('0x34')]=_0x51b692['attributes'][_0xa7e0('0x35')]?_0x51b692[_0xa7e0('0x34')]:_0x1df664[_0xa7e0('0x2e')];if(_0x235811['query'][_0xa7e0('0x43')]){_0x51b692['include']=[{'all':!![]}];}_0x51b692=_[_0xa7e0('0x3c')]({},_0x51b692,_0x235811[_0xa7e0('0x3e')]);return db[_0xa7e0('0x2a')][_0xa7e0('0x44')](_0x51b692)['then'](handleEntityNotFound(_0x5263fb,null))[_0xa7e0('0x12')](respondWithResult(_0x5263fb,null))[_0xa7e0('0x45')](handleError(_0x5263fb,null));};exports['update']=function(_0x5d2f5c,_0x49066f){if(_0x5d2f5c['body']['id']){delete _0x5d2f5c[_0xa7e0('0x46')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x5d2f5c[_0xa7e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x49066f,null))['then'](saveUpdates(_0x5d2f5c['body'],null))['then'](respondWithResult(_0x49066f,null))[_0xa7e0('0x45')](handleError(_0x49066f,null));};exports[_0xa7e0('0x26')]=function(_0x57f1e9,_0x58e968){return db[_0xa7e0('0x2a')][_0xa7e0('0x44')]({'where':{'id':_0x57f1e9[_0xa7e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x58e968,null))[_0xa7e0('0x12')](removeEntity(_0x58e968,null))['catch'](handleError(_0x58e968,null));};exports['describe']=function(_0x44d38d,_0x85a327){return db[_0xa7e0('0x2a')]['describe']()[_0xa7e0('0x12')](respondWithResult(_0x85a327,null))[_0xa7e0('0x45')](handleError(_0x85a327,null));};exports['create']=function(_0x7cc016,_0x3939c1){return db[_0xa7e0('0x2a')][_0xa7e0('0x48')](_0x7cc016[_0xa7e0('0x46')])[_0xa7e0('0x12')](function(_0x55ec59){if(_0x55ec59){if(_0x55ec59[_0xa7e0('0x49')]===_0xa7e0('0x4a')&&!_0x55ec59[_0xa7e0('0x4b')]){var _0x3e0885,_0x1066e2,_0x22f6b5;if(_0x7cc016[_0xa7e0('0x46')]['to']){_0x1066e2=_0x7cc016[_0xa7e0('0x46')]['to']['split'](',')[0x0];}return db[_0xa7e0('0x4c')][_0xa7e0('0x4d')]({'where':{'id':_0x55ec59[_0xa7e0('0x4e')]},'include':[{'model':db[_0xa7e0('0x4f')],'as':_0xa7e0('0x50'),'include':[{'model':db[_0xa7e0('0x51')],'as':_0xa7e0('0x52'),'where':{'email':_0x1066e2},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xa7e0('0x12')](function(_0x3491a0){_0x3e0885=_0x3491a0;if(_0x3e0885&&_0x3e0885[_0xa7e0('0x53')]){var _0x5ab75a={'tls':{'rejectUnauthorized':![]}};if(_[_0xa7e0('0x54')](_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x55')])){_0x5ab75a['host']=_0x3e0885[_0xa7e0('0x53')]['host'];_0x5ab75a[_0xa7e0('0x56')]=_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x56')];_0x5ab75a['secure']=_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x57')];if(_0x3e0885[_0xa7e0('0x53')]['authentication']){_0x5ab75a[_0xa7e0('0x58')]={'user':_0x3e0885['Smtp'][_0xa7e0('0x59')],'pass':_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x5a')]};}}else{_0x5ab75a[_0xa7e0('0x55')]=_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x55')];_0x5ab75a['auth']={'user':_0x3e0885[_0xa7e0('0x53')]['user'],'pass':_0x3e0885[_0xa7e0('0x53')][_0xa7e0('0x5a')]};_0x5ab75a[_0xa7e0('0x57')]=_0x3e0885[_0xa7e0('0x53')]['secure'];}if(_0x7cc016[_0xa7e0('0x46')][_0xa7e0('0x5b')]&&_0x7cc016[_0xa7e0('0x46')]['attachments'][_0xa7e0('0x35')]){for(var _0x3dbb95=0x0;_0x3dbb95<_0x7cc016[_0xa7e0('0x46')]['attachments'][_0xa7e0('0x35')];_0x3dbb95+=0x1){_0x7cc016[_0xa7e0('0x46')]['attachments'][_0x3dbb95]={'filename':_0x7cc016[_0xa7e0('0x46')][_0xa7e0('0x5b')][_0x3dbb95][_0xa7e0('0x2f')],'path':path[_0xa7e0('0x5c')](config[_0xa7e0('0x5d')],_0xa7e0('0x5e'),_0x7cc016[_0xa7e0('0x46')][_0xa7e0('0x5b')][_0x3dbb95]['basename'])};}}_0x22f6b5={'account':_0x5ab75a,'message':_0x7cc016[_0xa7e0('0x46')]};return;}})[_0xa7e0('0x12')](function(){if(_0x3e0885[_0xa7e0('0x50')]){if(_0x3e0885[_0xa7e0('0x50')][_0xa7e0('0x52')][_0xa7e0('0x35')]){return _0x3e0885[_0xa7e0('0x50')][_0xa7e0('0x52')][0x0];}else{return db[_0xa7e0('0x51')][_0xa7e0('0x48')](_[_0xa7e0('0x5f')](_0x7cc016[_0xa7e0('0x46')],{'firstName':_0x7cc016[_0xa7e0('0x46')]['to'],'email':_0x7cc016[_0xa7e0('0x46')]['to'],'phone':_0x7cc016[_0xa7e0('0x46')]['to'],'ListId':_0x3e0885[_0xa7e0('0x60')]}));}}else{throw new Error(_0xa7e0('0x61'));}})[_0xa7e0('0x12')](function(){if(_0x22f6b5){return respondWithRpcPromise(_0xa7e0('0x62'),_0xa7e0('0x63'),_0x22f6b5,client9003)[_0xa7e0('0x12')](function(_0x4836ba){return _0x55ec59['update']({'read':!![],'messageId':_0x4836ba[_0xa7e0('0x64')],'sentAt':moment()[_0xa7e0('0x65')](_0xa7e0('0x66'))});})[_0xa7e0('0x45')](function(_0x33283a){logger[_0xa7e0('0x18')]('%s',JSON[_0xa7e0('0x17')](_0x33283a));return _0x55ec59;});}return _0x55ec59;});}return _0x55ec59;}})[_0xa7e0('0x12')](respondWithResult(_0x3939c1,0xc9))[_0xa7e0('0x45')](handleError(_0x3939c1,null));};exports['accept']=function(_0x30058a,_0x242a89){var _0x57b15f={'agent':{},'channel':_0xa7e0('0x67')};if(_0x30058a['body']['id']){delete _0x30058a[_0xa7e0('0x46')]['id'];}_0x30058a[_0xa7e0('0x46')]['read']=!![];_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x68')]=moment()[_0xa7e0('0x65')](_0xa7e0('0x66'));_0x30058a['body']['UserId']=_0x30058a[_0xa7e0('0x46')]['UserId']||_0x30058a[_0xa7e0('0x59')]['id'];_0x57b15f[_0xa7e0('0x69')]['id']=_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x6a')];return db[_0xa7e0('0x2a')][_0xa7e0('0x44')]({'where':{'id':_0x30058a['params']['id'],'UserId':null}})[_0xa7e0('0x12')](handleEntityNotFound(_0x242a89,null))[_0xa7e0('0x12')](saveUpdates(_0x30058a[_0xa7e0('0x46')],null))[_0xa7e0('0x12')](function(_0x5b4d3f){if(_0x5b4d3f){_0x57b15f[_0xa7e0('0x1b')]=_0x5b4d3f[_0xa7e0('0x6b')]({'plain':!![]});return db[_0xa7e0('0x6c')][_0xa7e0('0x44')]({'where':{'id':_0x5b4d3f[_0xa7e0('0x6d')]}});}return null;})[_0xa7e0('0x12')](handleEntityNotFound(_0x242a89,null))[_0xa7e0('0x12')](function(_0x3bf447){if(_0x3bf447){return _0x3bf447['update']({'UserId':_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x6a')],'read1stAt':_[_0xa7e0('0x54')](_0x3bf447[_0xa7e0('0x6e')])?moment()['format'](_0xa7e0('0x66')):undefined});}return null;})['then'](function(_0x156459){if(_0x156459){_0x57b15f[_0xa7e0('0x6f')]=_0x156459[_0xa7e0('0x6b')]({'plain':!![]});interaction_log[_0xa7e0('0x13')](_0xa7e0('0x70'),_0x30058a[_0xa7e0('0x59')]['id'],_0x30058a['user'][_0xa7e0('0x2f')],_0x30058a[_0xa7e0('0x59')][_0xa7e0('0x71')],_0x57b15f[_0xa7e0('0x6f')]['id'],_0x30058a[_0xa7e0('0x46')]?JSON[_0xa7e0('0x17')](_0x30058a[_0xa7e0('0x46')]):'null');return respondWithRpcPromise(_0xa7e0('0x72'),_0xa7e0('0x73'),_0x57b15f);}return null;})['then'](function(_0x4d9030){var _0x16fd26='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d9030[_0xa7e0('0x1b')][_0xa7e0('0x74')];return db['sequelize'][_0xa7e0('0x30')](_0x16fd26,{'type':db[_0xa7e0('0x75')][_0xa7e0('0x76')][_0xa7e0('0x77')],'raw':!![]})[_0xa7e0('0x12')](function(_0x3b9a59){return _0x3b9a59;});})[_0xa7e0('0x12')](function(_0x446642){if(_0x446642){_0x57b15f[_0xa7e0('0x1b')]['contact']=_0x446642[0x0];if(!_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x6a')])return;return db[_0xa7e0('0x78')]['find']({'where':{'id':_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x6a')],'role':_0xa7e0('0x69')},'attributes':['id',_0xa7e0('0x2f'),_0xa7e0('0x79'),_0xa7e0('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x49b84f){if(!_0x49b84f)return null;_0x57b15f[_0xa7e0('0x1b')][_0xa7e0('0x69')]=_0x49b84f;return _0x57b15f;})[_0xa7e0('0x12')](function(_0xdeb037){if(_0xdeb037){if(_0x30058a[_0xa7e0('0x46')][_0xa7e0('0x7b')]){_0x57b15f['message'][_0xa7e0('0x7c')]=util[_0xa7e0('0x65')]('SIP/%s',_0x30058a[_0xa7e0('0x59')][_0xa7e0('0x2f')]);_0x57b15f[_0xa7e0('0x1b')][_0xa7e0('0x7d')]=_0x57b15f[_0xa7e0('0x7d')];_0x57b15f[_0xa7e0('0x1b')]['motionChannel']=_0x57b15f['channel'];_0x57b15f[_0xa7e0('0x1b')][_0xa7e0('0x7e')]=_0xa7e0('0x7f');_0x57b15f[_0xa7e0('0x1b')]['body']=htmlToText[_0xa7e0('0x80')](_0x57b15f[_0xa7e0('0x1b')][_0xa7e0('0x46')]);return respondWithRpcPromise(_0xa7e0('0x81'),_0xa7e0('0x81'),{'event':_0xa7e0('0x82'),'message':_0x57b15f[_0xa7e0('0x1b')]},client9002)[_0xa7e0('0x12')](function(){return _0x57b15f;});}return _0x57b15f;}return null;})['then'](respondWithResult(_0x242a89,null))[_0xa7e0('0x45')](handleError(_0x242a89,null));};exports['reject']=function(_0x2296cf,_0x10ecb1){var _0x26b614={'agent':{},'channel':_0xa7e0('0x67')};if(_0x2296cf['body']['id']){delete _0x2296cf[_0xa7e0('0x46')]['id'];}_0x2296cf[_0xa7e0('0x46')][_0xa7e0('0x6a')]=_0x2296cf[_0xa7e0('0x46')]['UserId']||_0x2296cf['user']['id'];_0x26b614[_0xa7e0('0x69')]['id']=_0x2296cf[_0xa7e0('0x46')][_0xa7e0('0x6a')];return db[_0xa7e0('0x2a')][_0xa7e0('0x44')]({'where':{'id':_0x2296cf[_0xa7e0('0x47')]['id'],'UserId':null}})[_0xa7e0('0x12')](handleEntityNotFound(_0x10ecb1,null))[_0xa7e0('0x12')](function(_0x14da89){if(_0x14da89){_0x26b614['message']=_0x14da89[_0xa7e0('0x6b')]({'plain':!![]});return db[_0xa7e0('0x6c')][_0xa7e0('0x44')]({'where':{'id':_0x14da89['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x10ecb1,null))[_0xa7e0('0x12')](function(_0x2b2f59){if(_0x2b2f59){_0x26b614[_0xa7e0('0x6f')]=_0x2b2f59[_0xa7e0('0x6b')]({'plain':!![]});interaction_log[_0xa7e0('0x13')](_0xa7e0('0x83'),_0x2296cf[_0xa7e0('0x59')]['id'],_0x2296cf['user'][_0xa7e0('0x2f')],_0x2296cf['user']['role'],_0x26b614[_0xa7e0('0x6f')]['id'],_0x2296cf[_0xa7e0('0x46')]?JSON[_0xa7e0('0x17')](_0x2296cf['body']):_0xa7e0('0x84'));return respondWithRpcPromise('RejectMessage',_0xa7e0('0x85'),_0x26b614);}return null;})['then'](function(_0x835cab){var _0x429624=_0xa7e0('0x86')+_0x835cab[_0xa7e0('0x1b')]['ContactId'];return db[_0xa7e0('0x87')][_0xa7e0('0x30')](_0x429624,{'type':db[_0xa7e0('0x75')][_0xa7e0('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x48c3b1){return _0x48c3b1;});})['then'](function(_0xa7486e){if(_0xa7486e){_0x26b614[_0xa7e0('0x1b')][_0xa7e0('0x88')]=_0xa7486e[0x0];if(!_0x2296cf[_0xa7e0('0x46')][_0xa7e0('0x6a')])return;return db['User'][_0xa7e0('0x44')]({'where':{'id':_0x2296cf['body'][_0xa7e0('0x6a')],'role':'agent'},'attributes':['id',_0xa7e0('0x2f'),'fullname',_0xa7e0('0x7a'),_0xa7e0('0x89')],'raw':!![]});}return null;})[_0xa7e0('0x12')](function(_0x16d6e5){if(!_0x16d6e5)return null;_0x26b614['message']['agent']=_0x16d6e5;return _0x26b614;})['then'](function(_0x513c91){if(_0x513c91){_0x513c91[_0xa7e0('0x1b')]['interface']=util[_0xa7e0('0x65')](_0xa7e0('0x8a'),_0x2296cf[_0xa7e0('0x59')][_0xa7e0('0x2f')]);_0x513c91[_0xa7e0('0x1b')][_0xa7e0('0x7d')]=_0x26b614['channel'];_0x513c91[_0xa7e0('0x1b')][_0xa7e0('0x8b')]=_0x26b614['channel'];_0x513c91[_0xa7e0('0x1b')]['event']=_0xa7e0('0x8c');_0x513c91['message'][_0xa7e0('0x46')]=htmlToText['fromString'](_0x26b614[_0xa7e0('0x1b')][_0xa7e0('0x46')]);respondWithRpcPromise(_0xa7e0('0x81'),_0xa7e0('0x81'),{'event':_0xa7e0('0x8d'),'message':_0x513c91['message']},client9002);return _0x26b614;}return null;})[_0xa7e0('0x12')](respondWithResult(_0x10ecb1,null))[_0xa7e0('0x45')](handleError(_0x10ecb1,null));};exports['download']=function(_0x9deaf7,_0x2ecde6){var _0x34c0b9=moment()['unix']()[_0xa7e0('0x8e')]();var _0xa0b638=path[_0xa7e0('0x5c')](config['root'],_0xa7e0('0x8f'),_0xa7e0('0x90'),_0xa7e0('0x91'));var _0x344e1d=path[_0xa7e0('0x5c')](config[_0xa7e0('0x5d')],_0xa7e0('0x8f'),_0xa7e0('0x90'),_0xa7e0('0x5b'));var _0x1006bc=util[_0xa7e0('0x65')](_0xa7e0('0x92'),_0x34c0b9);return db[_0xa7e0('0x2a')][_0xa7e0('0x44')]({'where':{'id':_0x9deaf7['params']['id']},'attributes':['id',_0xa7e0('0x46'),'from','to','cc',_0xa7e0('0x93'),'subject','createdAt'],'include':_0x9deaf7[_0xa7e0('0x30')][_0xa7e0('0x5b')]?[{'model':db[_0xa7e0('0x94')],'as':'Attachments'}]:undefined})[_0xa7e0('0x12')](handleEntityNotFound(_0x2ecde6,null))[_0xa7e0('0x12')](function(_0x4e7070){if(_0x4e7070){var _0x3d4f00=_0x4e7070;var _0x1b763d={'from':_0x3d4f00[_0xa7e0('0x95')],'to':_0x3d4f00['to'],'subject':_0x3d4f00['subject'],'html':htmlEntities[_0xa7e0('0x96')](_0x3d4f00[_0xa7e0('0x46')]),'headers':{'Date':moment(_0x3d4f00[_0xa7e0('0x97')])['format'](_0xa7e0('0x98'))},'attachments':[]};if(_0x4e7070['cc']){_0x1b763d[_0xa7e0('0x99')]['Cc']=_0x4e7070['cc'];}if(_0x4e7070['bcc']){_0x1b763d[_0xa7e0('0x99')][_0xa7e0('0x9a')]=_0x4e7070['bcc'];}return new BPromise(function(_0x10bae0,_0x1dcab4){if(_0x4e7070[_0xa7e0('0x9b')]){for(var _0x368d35=0x0;_0x368d35<_0x4e7070['Attachments'][_0xa7e0('0x35')];_0x368d35++){var _0x3c2f9f=_0x4e7070[_0xa7e0('0x9b')][_0x368d35];var _0x1df193=path[_0xa7e0('0x5c')](_0x344e1d,_0x3c2f9f[_0xa7e0('0x9c')]);if(fs['existsSync'](_0x1df193)){_0x1b763d[_0xa7e0('0x5b')][_0xa7e0('0x9d')]({'name':_0x3c2f9f['name'],'contentType':_0x3c2f9f['type'],'data':fs[_0xa7e0('0x9e')](_0x1df193)});}}}emlformat[_0xa7e0('0x9f')](_0x1b763d,function(_0x345bc0,_0x137d0d){if(_0x345bc0)return _0x1dcab4(_0x345bc0);fs['writeFileSync'](path[_0xa7e0('0x5c')](_0xa0b638,_0x1006bc),_0x137d0d);return _0x10bae0(_0x137d0d);});});}})[_0xa7e0('0x12')](function(_0x1b1bd3){if(_0x1b1bd3){return _0x2ecde6[_0xa7e0('0xa0')](path[_0xa7e0('0x5c')](_0xa0b638,_0x1006bc),_0x1006bc,function(_0x1e72c6){if(!_0x1e72c6)fs[_0xa7e0('0xa1')](path[_0xa7e0('0x5c')](_0xa0b638,_0x1006bc));});}})[_0xa7e0('0x45')](handleError(_0x2ecde6,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f68113c..544cf63 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 _0x1d5c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1e744a,_0xa8fdb1){var _0x1ac4d0=function(_0x13a75d){while(--_0x13a75d){_0x1e744a['push'](_0x1e744a['shift']());}};_0x1ac4d0(++_0xa8fdb1);}(_0x1d5c,0xbc));var _0xc1d5=function(_0x458775,_0x523411){_0x458775=_0x458775-0x0;var _0x48eb06=_0x1d5c[_0x458775];return _0x48eb06;};'use strict';var EventEmitter=require(_0xc1d5('0x0'));var MailMessage=require(_0xc1d5('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc1d5('0x2')](0x0);var events={'afterCreate':_0xc1d5('0x3'),'afterUpdate':_0xc1d5('0x4'),'afterDestroy':_0xc1d5('0x5')};function emitEvent(_0x1d1b90){return function(_0x592047,_0x101496,_0x2036b3){MailMessageEvents[_0xc1d5('0x6')](_0x1d1b90+':'+_0x592047['id'],_0x592047);MailMessageEvents[_0xc1d5('0x6')](_0x1d1b90,_0x592047);_0x2036b3(null);};}for(var e in events){if(events[_0xc1d5('0x7')](e)){var event=events[e];MailMessage[_0xc1d5('0x8')](e,emitEvent(event));}}module[_0xc1d5('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xf070=['events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x392806,_0x24bd96){var _0x37f7d2=function(_0x28ab7f){while(--_0x28ab7f){_0x392806['push'](_0x392806['shift']());}};_0x37f7d2(++_0x24bd96);}(_0xf070,0xab));var _0x0f07=function(_0x327022,_0x31bcea){_0x327022=_0x327022-0x0;var _0x4ec5bb=_0xf070[_0x327022];return _0x4ec5bb;};'use strict';var EventEmitter=require(_0x0f07('0x0'));var MailMessage=require(_0x0f07('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0f07('0x2')](0x0);var events={'afterCreate':_0x0f07('0x3'),'afterUpdate':_0x0f07('0x4'),'afterDestroy':_0x0f07('0x5')};function emitEvent(_0x1ef9a0){return function(_0x3a5b33,_0x4ea2a6,_0x500d19){MailMessageEvents['emit'](_0x1ef9a0+':'+_0x3a5b33['id'],_0x3a5b33);MailMessageEvents['emit'](_0x1ef9a0,_0x3a5b33);_0x500d19(null);};}for(var e in events){if(events[_0x0f07('0x6')](e)){var event=events[e];MailMessage[_0x0f07('0x7')](e,emitEvent(event));}}module[_0x0f07('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 91630c3..c326390 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 _0xb034=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xb034,0x1a4));var _0x4b03=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xb034[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x4b03('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4b03('0x1'));var BPromise=require(_0x4b03('0x2'));var rp=require(_0x4b03('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x4b03('0x4'));var config=require(_0x4b03('0x5'));var attributes=require('./mailMessage.attributes');module[_0x4b03('0x6')]=function(_0x33dc54,_0x2a39f2){return _0x33dc54['define'](_0x4b03('0x7'),attributes,{'tableName':_0x4b03('0x8'),'paranoid':![],'indexes':[{'name':_0x4b03('0x9'),'fields':[_0x4b03('0x9')]},{'name':_0x4b03('0xa'),'fields':['plainBody','subject'],'type':_0x4b03('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d9191,_0x1572be,_0x41096c){if(_0x3d9191[_0x4b03('0xc')]){_0x3d9191['plainBody']=htmlToText[_0x4b03('0xd')](_0x3d9191[_0x4b03('0xc')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x41096c(null,_0x1572be);},'afterCreate':function(_0xaa6aa,_0x5779fe,_0xae495d){var _0x4c9189=_0x33dc54[_0x4b03('0xe')];var _0x2ffefd=_0xaa6aa[_0x4b03('0xf')]({'plain':!![]});if(_0x2ffefd['direction'][_0x4b03('0x10')]()==='in'||_0x2ffefd[_0x4b03('0x11')][_0x4b03('0x10')]()===_0x4b03('0x12')&&!_0x2ffefd[_0x4b03('0x13')]&&!_[_0x4b03('0x14')](_0x2ffefd[_0x4b03('0x15')])){_0x4c9189[_0x4b03('0x16')]['findOne']({'where':{'id':_0x2ffefd[_0x4b03('0x17')]}})[_0x4b03('0x18')](function(_0x39ef72){if(_0x39ef72){_0x39ef72[_0x4b03('0x19')]({'lastMsgAt':_0x2ffefd[_0x4b03('0x1a')],'lastMsgDirection':_0x2ffefd[_0x4b03('0x11')][_0x4b03('0x10')]()});}})[_0x4b03('0x1b')](function(_0x57df39){console[_0x4b03('0x1c')](_0x57df39);});}_0xae495d();}},'charset':'utf8mb4','collate':_0x4b03('0x1d')});}; \ No newline at end of file +var _0x7f9a=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','subject','FULLTEXT','body','fromString','direction','toLowerCase','secret','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch'];(function(_0x549752,_0x16fc66){var _0x508e33=function(_0x53ca6b){while(--_0x53ca6b){_0x549752['push'](_0x549752['shift']());}};_0x508e33(++_0x16fc66);}(_0x7f9a,0x83));var _0xa7f9=function(_0x2e6314,_0xd3374c){_0x2e6314=_0x2e6314-0x0;var _0x3d9bce=_0x7f9a[_0x2e6314];return _0x3d9bce;};'use strict';var _=require(_0xa7f9('0x0'));var util=require(_0xa7f9('0x1'));var logger=require(_0xa7f9('0x2'))(_0xa7f9('0x3'));var moment=require(_0xa7f9('0x4'));var BPromise=require(_0xa7f9('0x5'));var rp=require('request-promise');var htmlToText=require(_0xa7f9('0x6'));var fs=require('fs');var path=require(_0xa7f9('0x7'));var rimraf=require(_0xa7f9('0x8'));var config=require(_0xa7f9('0x9'));var attributes=require(_0xa7f9('0xa'));module[_0xa7f9('0xb')]=function(_0x1da14a,_0x3e869d){return _0x1da14a[_0xa7f9('0xc')]('MailMessage',attributes,{'tableName':_0xa7f9('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa7f9('0xe')]},{'name':'fti_mail_messages','fields':['plainBody',_0xa7f9('0xf')],'type':_0xa7f9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2685d4,_0x485ffb,_0x559a85){if(_0x2685d4[_0xa7f9('0x11')]){_0x2685d4['plainBody']=htmlToText[_0xa7f9('0x12')](_0x2685d4[_0xa7f9('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x559a85(null,_0x485ffb);},'afterCreate':function(_0x5a6b12,_0x907ba8,_0xfa6e07){var _0x159cc9=_0x1da14a['models'];var _0x51d7e1=_0x5a6b12['get']({'plain':!![]});if(_0x51d7e1[_0xa7f9('0x13')][_0xa7f9('0x14')]()==='in'||_0x51d7e1[_0xa7f9('0x13')][_0xa7f9('0x14')]()==='out'&&!_0x51d7e1[_0xa7f9('0x15')]&&!_['isNil'](_0x51d7e1['UserId'])){_0x159cc9[_0xa7f9('0x16')][_0xa7f9('0x17')]({'where':{'id':_0x51d7e1[_0xa7f9('0x18')]}})[_0xa7f9('0x19')](function(_0x266e9c){if(_0x266e9c){_0x266e9c[_0xa7f9('0x1a')]({'lastMsgAt':_0x51d7e1[_0xa7f9('0x1b')],'lastMsgDirection':_0x51d7e1[_0xa7f9('0x13')][_0xa7f9('0x14')]()});}})[_0xa7f9('0x1c')](function(_0x3bd8b9){console[_0xa7f9('0x1d')](_0x3bd8b9);});}_0xfa6e07();}},'charset':_0xa7f9('0x1e'),'collate':_0xa7f9('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 781fc24..071ae24 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 _0x1a37=['debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent'];(function(_0x33cb6a,_0x2d70ed){var _0x56a428=function(_0x1478d3){while(--_0x1478d3){_0x33cb6a['push'](_0x33cb6a['shift']());}};_0x56a428(++_0x2d70ed);}(_0x1a37,0xb4));var _0x71a3=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x1a37[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});}exports[_0x71a3('0x1b')]=function(_0x1c4ec2){var _0x4a7980=this;return new Promise(function(_0x596328,_0x1ab947){return db[_0x71a3('0x1c')][_0x71a3('0x1d')](_0x1c4ec2[_0x71a3('0x1e')],{'raw':_0x1c4ec2[_0x71a3('0x1f')]?_0x1c4ec2['options'][_0x71a3('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3bf78e){logger[_0x71a3('0x19')](_0x71a3('0x1b'),_0x1c4ec2);logger[_0x71a3('0x12')](_0x71a3('0x1b'),_0x1c4ec2,JSON[_0x71a3('0x14')](_0x3bf78e));_0x596328(_0x3bf78e);})['catch'](function(_0x26e6e7){logger[_0x71a3('0x15')](_0x71a3('0x1b'),_0x26e6e7[_0x71a3('0x18')],_0x1c4ec2);_0x1ab947(_0x4a7980[_0x71a3('0x15')](0x1f4,_0x26e6e7['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(_0x1c9102,_0x37261c){var _0x82599d=function(_0x26fed4){while(--_0x26fed4){_0x1c9102['push'](_0x1c9102['shift']());}};_0x82599d(++_0x37261c);}(_0x6d11,0xbf));var _0x16d1=function(_0x598431,_0x444742){_0x598431=_0x598431-0x0;var _0x3695a3=_0x6d11[_0x598431];return _0x3695a3;};'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 2047c78..fcab279 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 _0x6250=['save','update','emit','removeListener'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x6250,0x1b0));var _0x0625=function(_0x2c665a,_0x330ba9){_0x2c665a=_0x2c665a-0x0;var _0x5d9f89=_0x6250[_0x2c665a];return _0x5d9f89;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x0625('0x0'),'remove',_0x0625('0x1')];function createListener(_0x5829a6,_0x40a53f){return function(_0x526c0e){_0x40a53f[_0x0625('0x2')](_0x5829a6,_0x526c0e);};}function removeListener(_0x367123,_0x529303){return function(){MailMessageEvents[_0x0625('0x3')](_0x367123,_0x529303);};}exports['register']=function(_0x111571){for(var _0x22ad4c=0x0,_0x42bb48=events['length'];_0x22ad4c<_0x42bb48;_0x22ad4c++){var _0x14a80a=events[_0x22ad4c];var _0x595d0e=createListener('mailMessage:'+_0x14a80a,_0x111571);MailMessageEvents['on'](_0x14a80a,_0x595d0e);}}; \ No newline at end of file +var _0x428c=['save','remove','update','removeListener','register','length','./mailMessage.events'];(function(_0x3cbf3d,_0x37d55a){var _0x4fd959=function(_0x4a3b72){while(--_0x4a3b72){_0x3cbf3d['push'](_0x3cbf3d['shift']());}};_0x4fd959(++_0x37d55a);}(_0x428c,0x1d4));var _0xc428=function(_0x5738ee,_0x44f706){_0x5738ee=_0x5738ee-0x0;var _0x17720e=_0x428c[_0x5738ee];return _0x17720e;};'use strict';var MailMessageEvents=require(_0xc428('0x0'));var events=[_0xc428('0x1'),_0xc428('0x2'),_0xc428('0x3')];function createListener(_0x11bcd5,_0x49e3f5){return function(_0x4701d6){_0x49e3f5['emit'](_0x11bcd5,_0x4701d6);};}function removeListener(_0xd4e0aa,_0x5f4e31){return function(){MailMessageEvents[_0xc428('0x4')](_0xd4e0aa,_0x5f4e31);};}exports[_0xc428('0x5')]=function(_0x55ec7a){for(var _0x45953a=0x0,_0x1ec16a=events[_0xc428('0x6')];_0x45953a<_0x1ec16a;_0x45953a++){var _0x2f925c=events[_0x45953a];var _0x12d2ea=createListener('mailMessage:'+_0x2f925c,_0x55ec7a);MailMessageEvents['on'](_0x2f925c,_0x12d2ea);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 378831f..ff17f8e 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 _0x2101=['addTeams','/:id/users','addAgents','put','destroy','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x2101,0xca));var _0x1210=function(_0xd04987,_0x308e24){_0xd04987=_0xd04987-0x0;var _0x57e30d=_0x2101[_0xd04987];return _0x57e30d;};'use strict';var multer=require('multer');var util=require(_0x1210('0x0'));var path=require(_0x1210('0x1'));var timeout=require(_0x1210('0x2'));var express=require(_0x1210('0x3'));var router=express['Router']();var fs_extra=require(_0x1210('0x4'));var auth=require(_0x1210('0x5'));var interaction=require(_0x1210('0x6'));var config=require(_0x1210('0x7'));var controller=require(_0x1210('0x8'));router[_0x1210('0x9')]('/',auth[_0x1210('0xa')](),controller[_0x1210('0xb')]);router[_0x1210('0x9')](_0x1210('0xc'),auth['isAuthenticated'](),controller[_0x1210('0xd')]);router[_0x1210('0x9')](_0x1210('0xe'),auth[_0x1210('0xa')](),controller[_0x1210('0xf')]);router[_0x1210('0x9')](_0x1210('0x10'),auth[_0x1210('0xa')](),controller[_0x1210('0x11')]);router[_0x1210('0x9')](_0x1210('0x12'),auth[_0x1210('0xa')](),controller[_0x1210('0x13')]);router[_0x1210('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x1210('0x14')]);router[_0x1210('0x15')]('/',auth[_0x1210('0xa')](),controller['create']);router[_0x1210('0x15')](_0x1210('0x12'),auth[_0x1210('0xa')](),controller[_0x1210('0x16')]);router[_0x1210('0x15')](_0x1210('0x17'),auth['isAuthenticated'](),controller[_0x1210('0x18')]);router[_0x1210('0x19')](_0x1210('0xe'),auth[_0x1210('0xa')](),controller['update']);router['delete'](_0x1210('0xe'),auth[_0x1210('0xa')](),controller[_0x1210('0x1a')]);router['delete'](_0x1210('0x12'),auth[_0x1210('0xa')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1210('0xa')](),controller[_0x1210('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2fd8=['update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./mailQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','put','/:id'];(function(_0x39cd18,_0x542950){var _0x322f92=function(_0x64c280){while(--_0x64c280){_0x39cd18['push'](_0x39cd18['shift']());}};_0x322f92(++_0x542950);}(_0x2fd8,0x13d));var _0x82fd=function(_0x24cc80,_0xcca616){_0x24cc80=_0x24cc80-0x0;var _0x229b98=_0x2fd8[_0x24cc80];return _0x229b98;};'use strict';var multer=require(_0x82fd('0x0'));var util=require(_0x82fd('0x1'));var path=require(_0x82fd('0x2'));var timeout=require(_0x82fd('0x3'));var express=require(_0x82fd('0x4'));var router=express[_0x82fd('0x5')]();var fs_extra=require(_0x82fd('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x82fd('0x7'));router[_0x82fd('0x8')]('/',auth[_0x82fd('0x9')](),controller[_0x82fd('0xa')]);router[_0x82fd('0x8')]('/describe',auth[_0x82fd('0x9')](),controller[_0x82fd('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x82fd('0xc')]);router['get'](_0x82fd('0xd'),auth['isAuthenticated'](),controller[_0x82fd('0xe')]);router[_0x82fd('0x8')](_0x82fd('0xf'),auth[_0x82fd('0x9')](),controller[_0x82fd('0x10')]);router[_0x82fd('0x8')](_0x82fd('0x11'),auth[_0x82fd('0x9')](),controller['getAgents']);router[_0x82fd('0x12')]('/',auth[_0x82fd('0x9')](),controller['create']);router[_0x82fd('0x12')](_0x82fd('0xf'),auth[_0x82fd('0x9')](),controller['addTeams']);router['post'](_0x82fd('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0x82fd('0x13')](_0x82fd('0x14'),auth[_0x82fd('0x9')](),controller[_0x82fd('0x15')]);router[_0x82fd('0x16')](_0x82fd('0x14'),auth[_0x82fd('0x9')](),controller['destroy']);router[_0x82fd('0x16')](_0x82fd('0xf'),auth['isAuthenticated'](),controller[_0x82fd('0x17')]);router['delete']('/:id/users',auth[_0x82fd('0x9')](),controller[_0x82fd('0x18')]);module[_0x82fd('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4e2133c..0c085d3 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 _0xcc5a=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x128c41,_0x44a378){var _0xbbd946=function(_0x1b01e9){while(--_0x1b01e9){_0x128c41['push'](_0x128c41['shift']());}};_0xbbd946(++_0x44a378);}(_0xcc5a,0x14b));var _0xacc5=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xcc5a[_0x1d70db];return _0x3060c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xacc5('0x0')],'unique':_0xacc5('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xacc5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xacc5('0x3')](_0xacc5('0x4'),_0xacc5('0x5'),_0xacc5('0x6'))}}; \ No newline at end of file +var _0xe722=['exports','STRING','name','INTEGER','ENUM','beepall','sequelize'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xe722,0x1f0));var _0x2e72=function(_0x1d116b,_0x4924ec){_0x1d116b=_0x1d116b-0x0;var _0x13db0c=_0xe722[_0x1d116b];return _0x13db0c;};'use strict';var Sequelize=require(_0x2e72('0x0'));module[_0x2e72('0x1')]={'name':{'type':Sequelize[_0x2e72('0x2')],'unique':_0x2e72('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2e72('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e72('0x5')]('rrmemory',_0x2e72('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2168062..9146f58 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 _0x0c24=['agent','mailPause','updatedAt','createdAt','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','interface','sequelize','transaction','findOrCreate','emit','userMailQueue:save','removeTeams','Agents','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./mailQueue.socket','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','map','MailQueue','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','get','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','MailQueueId','UserMailQueue','User','UserId'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x0c24,0x13b));var _0x40c2=function(_0x4fab3f,_0x5b0e8a){_0x4fab3f=_0x4fab3f-0x0;var _0x27364e=_0x0c24[_0x4fab3f];return _0x27364e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x40c2('0x0'));var jsonpatch=require(_0x40c2('0x1'));var rp=require('request-promise');var moment=require(_0x40c2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40c2('0x3'));var path=require(_0x40c2('0x4'));var sox=require(_0x40c2('0x5'));var csv=require('to-csv');var ejs=require(_0x40c2('0x6'));var fs=require('fs');var fs_extra=require(_0x40c2('0x7'));var _=require(_0x40c2('0x8'));var squel=require(_0x40c2('0x9'));var crypto=require(_0x40c2('0xa'));var jsforce=require(_0x40c2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x40c2('0xc'));var querystring=require(_0x40c2('0xd'));var Papa=require(_0x40c2('0xe'));var Redis=require(_0x40c2('0xf'));var authService=require(_0x40c2('0x10'));var qs=require(_0x40c2('0x11'));var as=require(_0x40c2('0x12'));var hardwareService=require(_0x40c2('0x13'));var logger=require(_0x40c2('0x14'))(_0x40c2('0x15'));var utils=require('../../config/utils');var config=require(_0x40c2('0x16'));var licenseUtil=require(_0x40c2('0x17'));var db=require(_0x40c2('0x18'))['db'];config[_0x40c2('0x19')]=_[_0x40c2('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40c2('0x19')]));require(_0x40c2('0x1b'))['register'](socket);function respondWithStatusCode(_0x527ce3,_0x4a49f9){_0x4a49f9=_0x4a49f9||0xcc;return function(_0x21dc2b){if(_0x21dc2b){return _0x527ce3['sendStatus'](_0x4a49f9);}return _0x527ce3[_0x40c2('0x1c')](_0x4a49f9)[_0x40c2('0x1d')]();};}function respondWithResult(_0x21c6e8,_0x23d976){_0x23d976=_0x23d976||0xc8;return function(_0x505b32){if(_0x505b32){return _0x21c6e8['status'](_0x23d976)[_0x40c2('0x1e')](_0x505b32);}};}function respondWithFilteredResult(_0x513b40,_0x1c9a81){return function(_0x5cda21){if(_0x5cda21){var _0x210e8b=typeof _0x1c9a81['offset']===_0x40c2('0x1f')&&typeof _0x1c9a81['limit']==='undefined';var _0x3f3840=_0x5cda21[_0x40c2('0x20')];var _0x4acaca=_0x210e8b?0x0:_0x1c9a81[_0x40c2('0x21')];var _0x21d445=_0x210e8b?_0x5cda21[_0x40c2('0x20')]:_0x1c9a81[_0x40c2('0x21')]+_0x1c9a81[_0x40c2('0x22')];var _0x578e50;if(_0x21d445>=_0x3f3840){_0x21d445=_0x3f3840;_0x578e50=0xc8;}else{_0x578e50=0xce;}_0x513b40['status'](_0x578e50);return _0x513b40[_0x40c2('0x23')](_0x40c2('0x24'),_0x4acaca+'-'+_0x21d445+'/'+_0x3f3840)[_0x40c2('0x1e')](_0x5cda21);}return null;};}function patchUpdates(_0x8d2e11){return function(_0x4354d7){try{jsonpatch[_0x40c2('0x25')](_0x4354d7,_0x8d2e11,!![]);}catch(_0x52ef28){return BPromise[_0x40c2('0x26')](_0x52ef28);}return _0x4354d7['save']();};}function saveUpdates(_0x2e097a,_0x4a320d){return function(_0x5b68f3){if(_0x5b68f3){return _0x5b68f3[_0x40c2('0x27')](_0x2e097a)[_0x40c2('0x28')](function(_0x2bd8df){return _0x2bd8df;});}return null;};}function removeEntity(_0x538a89,_0x1c25f3){return function(_0x30b2c8){if(_0x30b2c8){return _0x30b2c8[_0x40c2('0x29')]()[_0x40c2('0x28')](function(){var _0x2e4e66=_0x30b2c8['get']({'plain':!![]});var _0x350218='MailQueues';return db[_0x40c2('0x2a')][_0x40c2('0x29')]({'where':{'type':_0x350218,'resourceId':_0x2e4e66['id']}})[_0x40c2('0x28')](function(){return _0x30b2c8;});})[_0x40c2('0x28')](function(){_0x538a89[_0x40c2('0x1c')](0xcc)[_0x40c2('0x1d')]();});}};}function handleEntityNotFound(_0x373572,_0x371b62){return function(_0x38f2b5){if(!_0x38f2b5){_0x373572[_0x40c2('0x2b')](0x194);}return _0x38f2b5;};}function handleError(_0x422a6a,_0x3a7760){_0x3a7760=_0x3a7760||0x1f4;return function(_0x22ac07){logger[_0x40c2('0x2c')](_0x22ac07[_0x40c2('0x2d')]);if(_0x22ac07[_0x40c2('0x2e')]){delete _0x22ac07['name'];}_0x422a6a[_0x40c2('0x1c')](_0x3a7760)['send'](_0x22ac07);};}exports['index']=function(_0x578cb4,_0x56068f){var _0x3f2d36={},_0xbe83b3={},_0x427d40={'count':0x0,'rows':[]};var _0x209f05=_[_0x40c2('0x2f')](db[_0x40c2('0x30')]['rawAttributes'],function(_0x389818){return{'name':_0x389818['fieldName'],'type':_0x389818[_0x40c2('0x31')][_0x40c2('0x32')]};});_0xbe83b3[_0x40c2('0x33')]=_[_0x40c2('0x2f')](_0x209f05,_0x40c2('0x2e'));_0xbe83b3['query']=_[_0x40c2('0x34')](_0x578cb4[_0x40c2('0x35')]);_0xbe83b3[_0x40c2('0x36')]=_[_0x40c2('0x37')](_0xbe83b3[_0x40c2('0x33')],_0xbe83b3[_0x40c2('0x35')]);_0x3f2d36['attributes']=_[_0x40c2('0x37')](_0xbe83b3[_0x40c2('0x33')],qs['fields'](_0x578cb4[_0x40c2('0x35')][_0x40c2('0x38')]));_0x3f2d36[_0x40c2('0x39')]=_0x3f2d36[_0x40c2('0x39')][_0x40c2('0x3a')]?_0x3f2d36[_0x40c2('0x39')]:_0xbe83b3['model'];if(!_0x578cb4[_0x40c2('0x35')][_0x40c2('0x3b')]('nolimit')){_0x3f2d36[_0x40c2('0x22')]=qs['limit'](_0x578cb4['query']['limit']);_0x3f2d36[_0x40c2('0x21')]=qs[_0x40c2('0x21')](_0x578cb4[_0x40c2('0x35')][_0x40c2('0x21')]);}_0x3f2d36[_0x40c2('0x3c')]=qs['sort'](_0x578cb4[_0x40c2('0x35')][_0x40c2('0x3d')]);_0x3f2d36[_0x40c2('0x3e')]=qs[_0x40c2('0x36')](_[_0x40c2('0x3f')](_0x578cb4['query'],_0xbe83b3[_0x40c2('0x36')]),_0x209f05);if(_0x578cb4[_0x40c2('0x35')][_0x40c2('0x40')]){_0x3f2d36[_0x40c2('0x3e')]=_[_0x40c2('0x41')](_0x3f2d36[_0x40c2('0x3e')],{'$or':_['map'](_0x209f05,function(_0x143c57){if(_0x143c57[_0x40c2('0x31')]!==_0x40c2('0x42')){var _0x1129ac={};_0x1129ac[_0x143c57['name']]={'$like':'%'+_0x578cb4[_0x40c2('0x35')]['filter']+'%'};return _0x1129ac;}})});}_0x3f2d36=_[_0x40c2('0x41')]({},_0x3f2d36,_0x578cb4[_0x40c2('0x43')]);var _0x115ed3={'where':_0x3f2d36[_0x40c2('0x3e')]};return db[_0x40c2('0x30')][_0x40c2('0x20')](_0x115ed3)[_0x40c2('0x28')](function(_0x45b20b){_0x427d40[_0x40c2('0x20')]=_0x45b20b;if(_0x578cb4[_0x40c2('0x35')]['includeAll']){_0x3f2d36[_0x40c2('0x44')]=[{'all':!![]}];}return db[_0x40c2('0x30')][_0x40c2('0x45')](_0x3f2d36);})[_0x40c2('0x28')](function(_0x18e220){_0x427d40[_0x40c2('0x46')]=_0x18e220;return _0x427d40;})['then'](respondWithFilteredResult(_0x56068f,_0x3f2d36))[_0x40c2('0x47')](handleError(_0x56068f,null));};exports[_0x40c2('0x48')]=function(_0x525cdc,_0x3db732){var _0xdfc92c={'raw':!![],'where':{'id':_0x525cdc['params']['id']}},_0x1b1d0f={};_0x1b1d0f[_0x40c2('0x33')]=_['keys'](db[_0x40c2('0x30')]['rawAttributes']);_0x1b1d0f[_0x40c2('0x35')]=_['keys'](_0x525cdc[_0x40c2('0x35')]);_0x1b1d0f['filters']=_[_0x40c2('0x37')](_0x1b1d0f['model'],_0x1b1d0f[_0x40c2('0x35')]);_0xdfc92c[_0x40c2('0x39')]=_[_0x40c2('0x37')](_0x1b1d0f[_0x40c2('0x33')],qs[_0x40c2('0x38')](_0x525cdc[_0x40c2('0x35')]['fields']));_0xdfc92c[_0x40c2('0x39')]=_0xdfc92c['attributes'][_0x40c2('0x3a')]?_0xdfc92c[_0x40c2('0x39')]:_0x1b1d0f['model'];if(_0x525cdc['query'][_0x40c2('0x49')]){_0xdfc92c['include']=[{'all':!![]}];}_0xdfc92c=_[_0x40c2('0x41')]({},_0xdfc92c,_0x525cdc['options']);return db[_0x40c2('0x30')][_0x40c2('0x4a')](_0xdfc92c)['then'](handleEntityNotFound(_0x3db732,null))['then'](respondWithResult(_0x3db732,null))[_0x40c2('0x47')](handleError(_0x3db732,null));};exports[_0x40c2('0x4b')]=function(_0x46764e,_0x116e9f){return db['MailQueue'][_0x40c2('0x4b')](_0x46764e[_0x40c2('0x4c')],{})[_0x40c2('0x28')](function(_0x4d873d){var _0x3abaa5=_0x46764e[_0x40c2('0x4d')][_0x40c2('0x4e')]({'plain':!![]});if(!_0x3abaa5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abaa5[_0x40c2('0x4f')]===_0x40c2('0x4d')){var _0x1215f1=_0x4d873d[_0x40c2('0x4e')]({'plain':!![]});var _0x94f11c=_0x40c2('0x50');return db[_0x40c2('0x51')][_0x40c2('0x4a')]({'where':{'name':_0x94f11c,'userProfileId':_0x3abaa5[_0x40c2('0x52')]},'raw':!![]})['then'](function(_0x110b9f){if(_0x110b9f&&_0x110b9f[_0x40c2('0x53')]===0x0){return db[_0x40c2('0x2a')][_0x40c2('0x4b')]({'name':_0x1215f1[_0x40c2('0x2e')],'resourceId':_0x1215f1['id'],'type':_0x110b9f[_0x40c2('0x2e')],'sectionId':_0x110b9f['id']},{})[_0x40c2('0x28')](function(){return _0x4d873d;});}else{return _0x4d873d;}})[_0x40c2('0x47')](function(_0x25a7bb){logger[_0x40c2('0x2c')](_0x40c2('0x54'),_0x25a7bb);throw _0x25a7bb;});}return _0x4d873d;})[_0x40c2('0x28')](respondWithResult(_0x116e9f,0xc9))['catch'](handleError(_0x116e9f,null));};exports[_0x40c2('0x27')]=function(_0x35ad8d,_0x232a14){if(_0x35ad8d['body']['id']){delete _0x35ad8d[_0x40c2('0x4c')]['id'];}return db[_0x40c2('0x30')][_0x40c2('0x4a')]({'where':{'id':_0x35ad8d[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0x232a14,null))[_0x40c2('0x28')](saveUpdates(_0x35ad8d[_0x40c2('0x4c')],null))['then'](respondWithResult(_0x232a14,null))['catch'](handleError(_0x232a14,null));};exports[_0x40c2('0x29')]=function(_0x5c2681,_0x2400e4){return db[_0x40c2('0x30')][_0x40c2('0x4a')]({'where':{'id':_0x5c2681['params']['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0x2400e4,null))[_0x40c2('0x28')](removeEntity(_0x2400e4,null))[_0x40c2('0x47')](handleError(_0x2400e4,null));};exports[_0x40c2('0x56')]=function(_0x5f51fb,_0xe49f52){return db[_0x40c2('0x30')]['describe']()['then'](respondWithResult(_0xe49f52,null))[_0x40c2('0x47')](handleError(_0xe49f52,null));};exports[_0x40c2('0x57')]=function(_0x20d6d0,_0xbd6137,_0x206491){var _0x375993={'raw':!![],'where':{}},_0x12f1c7={},_0x2d4962;return db[_0x40c2('0x30')][_0x40c2('0x58')]({'where':{'id':_0x20d6d0[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0xbd6137,null))[_0x40c2('0x28')](function(_0x420c15){if(_0x420c15){_0x2d4962=_0x420c15[_0x40c2('0x4e')]({'plain':!![]});_0x12f1c7['model']=_[_0x40c2('0x34')](db['UserMailQueue']['rawAttributes']);_0x12f1c7[_0x40c2('0x35')]=_[_0x40c2('0x34')](_0x20d6d0[_0x40c2('0x35')]);_0x12f1c7[_0x40c2('0x36')]=_['intersection'](_0x12f1c7[_0x40c2('0x33')],_0x12f1c7['query']);_0x375993['attributes']=_[_0x40c2('0x37')](_0x12f1c7[_0x40c2('0x33')],qs[_0x40c2('0x38')](_0x20d6d0[_0x40c2('0x35')][_0x40c2('0x38')]));_0x375993[_0x40c2('0x39')]=_0x375993[_0x40c2('0x39')][_0x40c2('0x3a')]?_0x375993[_0x40c2('0x39')]:_0x12f1c7[_0x40c2('0x33')];if(!_0x20d6d0[_0x40c2('0x35')][_0x40c2('0x3b')]('nolimit')){_0x375993[_0x40c2('0x22')]=qs[_0x40c2('0x22')](_0x20d6d0[_0x40c2('0x35')][_0x40c2('0x22')]);_0x375993[_0x40c2('0x21')]=qs[_0x40c2('0x21')](_0x20d6d0[_0x40c2('0x35')]['offset']);}_0x375993[_0x40c2('0x3c')]=qs[_0x40c2('0x3d')](_0x20d6d0[_0x40c2('0x35')]['sort']);_0x375993['where']=qs[_0x40c2('0x36')](_[_0x40c2('0x3f')](_0x20d6d0[_0x40c2('0x35')],_0x12f1c7['filters']));_0x375993['where'][_0x40c2('0x59')]=_0x420c15['id'];if(_0x20d6d0[_0x40c2('0x35')][_0x40c2('0x40')]){_0x375993[_0x40c2('0x3e')]=_[_0x40c2('0x41')](_0x375993[_0x40c2('0x3e')],{'$or':_['map'](_0x375993[_0x40c2('0x39')],function(_0x2c2ad2){var _0x2350f8={};_0x2350f8[_0x2c2ad2]={'$like':'%'+_0x20d6d0[_0x40c2('0x35')][_0x40c2('0x40')]+'%'};return _0x2350f8;})});}_0x375993=_['merge']({},_0x375993,_0x20d6d0['options']);return db[_0x40c2('0x5a')][_0x40c2('0x45')](_0x375993);}})[_0x40c2('0x28')](function(_0x32206b){if(_0x32206b){return db[_0x40c2('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x32206b,_0x40c2('0x5c')),'role':_0x40c2('0x5d')},'attributes':['id','name',_0x40c2('0x5e'),_0x40c2('0x5f'),_0x40c2('0x60')]});}})['then'](function(_0x551278){if(_0x551278){return{'count':_0x551278[_0x40c2('0x20')],'rows':_['map'](_0x551278[_0x40c2('0x46')],function(_0x2317e3){return{'membername':_0x2317e3[_0x40c2('0x2e')],'UserId':_0x2317e3['id'],'queue_name':_0x2d4962[_0x40c2('0x2e')],'MailQueueId':_0x2d4962['id'],'interface':util['format']('%s/%s',_0x40c2('0x61'),_0x2317e3[_0x40c2('0x2e')]),'penalty':0x0,'paused':_0x2317e3[_0x40c2('0x5e')],'createdAt':_0x2317e3['createdAt'],'updatedAt':_0x2317e3[_0x40c2('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x40c2('0x28')](respondWithFilteredResult(_0xbd6137,_0x375993))['catch'](handleError(_0xbd6137,null));};exports[_0x40c2('0x62')]=function(_0x249ff7,_0x392c9e,_0x7dd18c){var _0x256942={};var _0x46e7f0={};var _0x3a690c;var _0x27b521;return db['MailQueue'][_0x40c2('0x58')]({'where':{'id':_0x249ff7[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0x392c9e,null))['then'](function(_0x3aa3a2){if(_0x3aa3a2){_0x3a690c=_0x3aa3a2;_0x46e7f0[_0x40c2('0x33')]=_[_0x40c2('0x34')](db[_0x40c2('0x63')]['rawAttributes']);_0x46e7f0[_0x40c2('0x35')]=_[_0x40c2('0x34')](_0x249ff7['query']);_0x46e7f0[_0x40c2('0x36')]=_[_0x40c2('0x37')](_0x46e7f0[_0x40c2('0x33')],_0x46e7f0[_0x40c2('0x35')]);_0x256942[_0x40c2('0x39')]=_['intersection'](_0x46e7f0[_0x40c2('0x33')],qs['fields'](_0x249ff7[_0x40c2('0x35')]['fields']));_0x256942[_0x40c2('0x39')]=_0x256942[_0x40c2('0x39')][_0x40c2('0x3a')]?_0x256942[_0x40c2('0x39')]:_0x46e7f0[_0x40c2('0x33')];_0x256942['order']=qs[_0x40c2('0x3d')](_0x249ff7[_0x40c2('0x35')][_0x40c2('0x3d')]);_0x256942[_0x40c2('0x3e')]=qs[_0x40c2('0x36')](_[_0x40c2('0x3f')](_0x249ff7['query'],_0x46e7f0['filters']));if(_0x249ff7[_0x40c2('0x35')]['filter']){_0x256942[_0x40c2('0x3e')]=_[_0x40c2('0x41')](_0x256942[_0x40c2('0x3e')],{'$or':_[_0x40c2('0x2f')](_0x256942[_0x40c2('0x39')],function(_0x570608){var _0x2588f6={};_0x2588f6[_0x570608]={'$like':'%'+_0x249ff7[_0x40c2('0x35')][_0x40c2('0x40')]+'%'};return _0x2588f6;})});}_0x256942=_[_0x40c2('0x41')]({},_0x256942,_0x249ff7[_0x40c2('0x43')]);return _0x3a690c[_0x40c2('0x62')](_0x256942);}})[_0x40c2('0x28')](function(_0x13cb63){if(_0x13cb63){_0x27b521=_0x13cb63['length'];if(!_0x249ff7[_0x40c2('0x35')][_0x40c2('0x3b')](_0x40c2('0x64'))){_0x256942['limit']=qs['limit'](_0x249ff7[_0x40c2('0x35')][_0x40c2('0x22')]);_0x256942[_0x40c2('0x21')]=qs[_0x40c2('0x21')](_0x249ff7['query']['offset']);}return _0x3a690c['getTeams'](_0x256942);}})[_0x40c2('0x28')](function(_0x36b713){if(_0x36b713){return _0x36b713?{'count':_0x27b521,'rows':_0x36b713}:null;}})[_0x40c2('0x28')](respondWithResult(_0x392c9e,null))[_0x40c2('0x47')](handleError(_0x392c9e,null));};exports[_0x40c2('0x65')]=function(_0x22fba3,_0x523f8d,_0x90cfa7){var _0x3d0292=_0x22fba3[_0x40c2('0x4c')][_0x40c2('0x66')];return db['Team'][_0x40c2('0x45')]({'where':{'id':_0x3d0292},'attributes':['id'],'include':[{'model':db[_0x40c2('0x5b')],'as':'Agents','attributes':['id',_0x40c2('0x2e'),_0x40c2('0x67'),_0x40c2('0x68'),_0x40c2('0x69')],'raw':!![]}]})[_0x40c2('0x28')](function(_0x3fc552){if(_0x3fc552){var _0x2df2a4=_['flatMap'](_0x3fc552,function(_0x1a72b8){var _0x431d38=_0x1a72b8[_0x40c2('0x4e')]({'plain':!![]});return _0x431d38['Agents'];});return db[_0x40c2('0x30')][_0x40c2('0x4a')]({'where':{'id':_0x22fba3[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](function(_0xc5e3fd){return db[_0x40c2('0x6a')][_0x40c2('0x6b')](function(_0x3e0fce){return _0xc5e3fd[_0x40c2('0x65')](_0x3d0292,{'transaction':_0x3e0fce})[_0x40c2('0x28')](function(){return BPromise['each'](_0x2df2a4,function(_0x5719a5){return db['UserMailQueue'][_0x40c2('0x6c')]({'where':{'UserId':_0x5719a5['id'],'MailQueueId':_0x22fba3[_0x40c2('0x55')]['id']},'transaction':_0x3e0fce});});})[_0x40c2('0x28')](function(){_0x2df2a4['forEach'](function(_0x461180){socket[_0x40c2('0x6d')](_0x40c2('0x6e'),{'UserId':_0x461180['id'],'MailQueueId':_0xc5e3fd['id']});});});});});}})[_0x40c2('0x28')](respondWithStatusCode(_0x523f8d,null))[_0x40c2('0x47')](handleError(_0x523f8d,null));};exports[_0x40c2('0x6f')]=function(_0x13013e,_0x343e7e,_0x1bee3f){return db[_0x40c2('0x63')][_0x40c2('0x45')]({'where':{'id':_0x13013e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x40c2('0x5b')],'as':_0x40c2('0x70'),'attributes':['id'],'raw':!![]}]})[_0x40c2('0x28')](handleEntityNotFound(_0x343e7e,null))[_0x40c2('0x28')](function(_0x10fb63){var _0x5a1500=_[_0x40c2('0x2f')](_0x10fb63,'id');var _0x4a1168=[];var _0xe85e65=[];var _0x305198=squel['select']();_0x305198[_0x40c2('0x71')](_0x40c2('0x72'))['from'](_0x40c2('0x73'),'tq')['join'](_0x40c2('0x74'),'ut',_0x40c2('0x75'))[_0x40c2('0x3e')]('MailQueueId\x20=\x20?',_0x13013e[_0x40c2('0x55')]['id']);for(var _0x1f0f7e=0x0;_0x1f0f7e<_0x10fb63[_0x40c2('0x3a')];_0x1f0f7e+=0x1){let _0x2c3b52=_0x10fb63[_0x1f0f7e];for(var _0x1d110e=0x0;_0x1d110e<_0x2c3b52['Agents'][_0x40c2('0x3a')];_0x1d110e+=0x1){let _0x64ba89=_0x2c3b52['Agents'][_0x1d110e];var _0x56f294=_0x305198[_0x40c2('0x76')]();_0x56f294['where'](_0x40c2('0x77'),_0x64ba89['id']);_0xe85e65[_0x40c2('0x78')](db[_0x40c2('0x6a')][_0x40c2('0x35')](_0x56f294['toString'](),{'type':db['sequelize']['QueryTypes'][_0x40c2('0x79')]})[_0x40c2('0x28')](function(_0x3c6fdf){if(_0x3c6fdf[_0x40c2('0x3a')]===0x1){return _0x64ba89['id'];}else{var _0x1095ac=_[_0x40c2('0x7a')](_['map'](_0x3c6fdf,_0x40c2('0x7b')),function(_0xb74490){return _['includes'](_0x5a1500,_0xb74490);});if(_0x1095ac){return _0x64ba89['id'];}}}));}}return BPromise[_0x40c2('0x7c')](_0xe85e65)[_0x40c2('0x28')](function(_0x40f265){_0x4a1168=_(_0x4a1168)[_0x40c2('0x7d')](_0x40f265)[_0x40c2('0x7e')]()[_0x40c2('0x7f')]();return db['MailQueue'][_0x40c2('0x4a')]({'where':{'id':_0x13013e[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](function(_0x44ac25){return db[_0x40c2('0x6a')][_0x40c2('0x6b')](function(_0x1bfe28){return _0x44ac25[_0x40c2('0x6f')](_0x13013e[_0x40c2('0x35')][_0x40c2('0x66')],{'transaction':_0x1bfe28})['then'](function(){if(!_[_0x40c2('0x80')](_0x4a1168)){return _0x44ac25[_0x40c2('0x81')](_0x4a1168,{'transaction':_0x1bfe28});}})[_0x40c2('0x28')](function(){_0x4a1168['forEach'](function(_0x43118f){socket[_0x40c2('0x6d')](_0x40c2('0x82'),{'UserId':_0x43118f,'MailQueueId':_0x44ac25['id']});});});});});});})[_0x40c2('0x28')](respondWithStatusCode(_0x343e7e,null))[_0x40c2('0x47')](handleError(_0x343e7e,null));};exports[_0x40c2('0x83')]=function(_0x44de75,_0x38aadd,_0x367819){return db[_0x40c2('0x30')]['find']({'where':{'id':_0x44de75[_0x40c2('0x55')]['id']}})['then'](handleEntityNotFound(_0x38aadd,null))['then'](function(_0x19b805){if(_0x19b805){return _0x19b805[_0x40c2('0x83')](_0x44de75[_0x40c2('0x4c')][_0x40c2('0x66')],_[_0x40c2('0x84')](_0x44de75[_0x40c2('0x4c')],[_0x40c2('0x66'),'id'])||{})[_0x40c2('0x85')](function(_0xe6e7b){for(var _0x19c3e9=0x0;_0x19c3e9<_0x44de75[_0x40c2('0x4c')][_0x40c2('0x66')][_0x40c2('0x3a')];_0x19c3e9+=0x1){socket[_0x40c2('0x6d')]('userMailQueue:save',{'UserId':Number(_0x44de75[_0x40c2('0x4c')][_0x40c2('0x66')][_0x19c3e9]),'MailQueueId':Number(_0x44de75['params']['id'])});}return _0xe6e7b;});}})[_0x40c2('0x28')](respondWithResult(_0x38aadd,null))['catch'](handleError(_0x38aadd,null));};exports[_0x40c2('0x81')]=function(_0x249f93,_0x4b208b,_0x518875){return db['MailQueue'][_0x40c2('0x4a')]({'where':{'id':_0x249f93['params']['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0x4b208b,null))[_0x40c2('0x28')](function(_0x235021){if(_0x235021){return _0x235021['removeAgents'](_0x249f93[_0x40c2('0x35')][_0x40c2('0x66')])[_0x40c2('0x28')](function(){if(_[_0x40c2('0x86')](_0x249f93[_0x40c2('0x35')][_0x40c2('0x66')])){for(var _0x4f743d=0x0;_0x4f743d<_0x249f93[_0x40c2('0x35')][_0x40c2('0x66')][_0x40c2('0x3a')];_0x4f743d+=0x1){socket[_0x40c2('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x249f93[_0x40c2('0x35')]['ids'][_0x4f743d]),'MailQueueId':Number(_0x249f93['params']['id'])});}}else{socket['emit'](_0x40c2('0x82'),{'UserId':Number(_0x249f93['query'][_0x40c2('0x66')]),'MailQueueId':Number(_0x249f93['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b208b,null))[_0x40c2('0x47')](handleError(_0x4b208b,null));};exports[_0x40c2('0x87')]=function(_0x178c23,_0x40ce96,_0x4c96cf){var _0x216e8b={};var _0x42c1b1={};var _0x5edf7f;var _0x5db097;return db['MailQueue'][_0x40c2('0x58')]({'where':{'id':_0x178c23[_0x40c2('0x55')]['id']}})[_0x40c2('0x28')](handleEntityNotFound(_0x40ce96,null))[_0x40c2('0x28')](function(_0x3dd775){if(_0x3dd775){_0x5edf7f=_0x3dd775;_0x42c1b1['model']=_[_0x40c2('0x34')](db['User']['rawAttributes']);_0x42c1b1['query']=_[_0x40c2('0x34')](_0x178c23['query']);_0x42c1b1['filters']=_[_0x40c2('0x37')](_0x42c1b1[_0x40c2('0x33')],_0x42c1b1[_0x40c2('0x35')]);_0x216e8b[_0x40c2('0x39')]=_['intersection'](_0x42c1b1[_0x40c2('0x33')],qs[_0x40c2('0x38')](_0x178c23[_0x40c2('0x35')][_0x40c2('0x38')]));_0x216e8b['attributes']=_0x216e8b[_0x40c2('0x39')][_0x40c2('0x3a')]?_0x216e8b[_0x40c2('0x39')]:_0x42c1b1[_0x40c2('0x33')];_0x216e8b[_0x40c2('0x3c')]=qs[_0x40c2('0x3d')](_0x178c23[_0x40c2('0x35')][_0x40c2('0x3d')]);_0x216e8b[_0x40c2('0x3e')]=qs['filters'](_[_0x40c2('0x3f')](_0x178c23[_0x40c2('0x35')],_0x42c1b1[_0x40c2('0x36')]));if(_0x178c23[_0x40c2('0x35')][_0x40c2('0x40')]){_0x216e8b[_0x40c2('0x3e')]=_[_0x40c2('0x41')](_0x216e8b['where'],{'$or':_[_0x40c2('0x2f')](_0x216e8b[_0x40c2('0x39')],function(_0x10ad77){var _0x154c59={};_0x154c59[_0x10ad77]={'$like':'%'+_0x178c23[_0x40c2('0x35')]['filter']+'%'};return _0x154c59;})});}_0x216e8b=_[_0x40c2('0x41')]({},_0x216e8b,_0x178c23[_0x40c2('0x43')]);return _0x5edf7f['getAgents'](_0x216e8b);}})[_0x40c2('0x28')](function(_0x1ee452){if(_0x1ee452){_0x5db097=_0x1ee452['length'];if(!_0x178c23['query'][_0x40c2('0x3b')](_0x40c2('0x64'))){_0x216e8b[_0x40c2('0x22')]=qs[_0x40c2('0x22')](_0x178c23[_0x40c2('0x35')][_0x40c2('0x22')]);_0x216e8b[_0x40c2('0x21')]=qs[_0x40c2('0x21')](_0x178c23[_0x40c2('0x35')]['offset']);}return _0x5edf7f[_0x40c2('0x87')](_0x216e8b);}})[_0x40c2('0x28')](function(_0x447872){if(_0x447872){return _0x447872?{'count':_0x5db097,'rows':_0x447872}:null;}})['then'](respondWithResult(_0x40ce96,null))[_0x40c2('0x47')](handleError(_0x40ce96,null));}; \ No newline at end of file +var _0x781f=['each','findOrCreate','forEach','userMailQueue:save','removeTeams','Team','select','field','tq.TeamId','from','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','emit','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','end','offset','limit','undefined','count','json','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','MailQueue','rawAttributes','fieldName','key','model','map','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','keys','UserMailQueue','intersection','MailQueueId','filter','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','mailPause','updatedAt','getTeams','addTeams','ids','Agents','online','interface','sequelize'];(function(_0x142342,_0x483920){var _0x341c03=function(_0x318588){while(--_0x318588){_0x142342['push'](_0x142342['shift']());}};_0x341c03(++_0x483920);}(_0x781f,0x13f));var _0xf781=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x781f[_0x1ee351];return _0x245aaf;};'use strict';var emlformat=require(_0xf781('0x0'));var rimraf=require(_0xf781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf781('0x2'));var rp=require('request-promise');var moment=require(_0xf781('0x3'));var BPromise=require(_0xf781('0x4'));var Mustache=require(_0xf781('0x5'));var util=require(_0xf781('0x6'));var path=require(_0xf781('0x7'));var sox=require(_0xf781('0x8'));var csv=require(_0xf781('0x9'));var ejs=require(_0xf781('0xa'));var fs=require('fs');var fs_extra=require(_0xf781('0xb'));var _=require(_0xf781('0xc'));var squel=require(_0xf781('0xd'));var crypto=require(_0xf781('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf781('0xf'));var toCsv=require(_0xf781('0x9'));var querystring=require('querystring');var Papa=require(_0xf781('0x10'));var Redis=require(_0xf781('0x11'));var authService=require(_0xf781('0x12'));var qs=require(_0xf781('0x13'));var as=require(_0xf781('0x14'));var hardwareService=require(_0xf781('0x15'));var logger=require(_0xf781('0x16'))(_0xf781('0x17'));var utils=require(_0xf781('0x18'));var config=require(_0xf781('0x19'));var licenseUtil=require(_0xf781('0x1a'));var db=require(_0xf781('0x1b'))['db'];config[_0xf781('0x1c')]=_['defaults'](config['redis'],{'host':_0xf781('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')[_0xf781('0x1e')](socket);function respondWithStatusCode(_0x1cdea0,_0x5ec07b){_0x5ec07b=_0x5ec07b||0xcc;return function(_0x28cbaa){if(_0x28cbaa){return _0x1cdea0['sendStatus'](_0x5ec07b);}return _0x1cdea0[_0xf781('0x1f')](_0x5ec07b)[_0xf781('0x20')]();};}function respondWithResult(_0x350940,_0x342b02){_0x342b02=_0x342b02||0xc8;return function(_0x5a7bf1){if(_0x5a7bf1){return _0x350940[_0xf781('0x1f')](_0x342b02)['json'](_0x5a7bf1);}};}function respondWithFilteredResult(_0x175db6,_0x2b109a){return function(_0xea6a72){if(_0xea6a72){var _0x544776=typeof _0x2b109a[_0xf781('0x21')]==='undefined'&&typeof _0x2b109a[_0xf781('0x22')]===_0xf781('0x23');var _0x5d5531=_0xea6a72[_0xf781('0x24')];var _0x4a3f85=_0x544776?0x0:_0x2b109a['offset'];var _0x452943=_0x544776?_0xea6a72['count']:_0x2b109a['offset']+_0x2b109a[_0xf781('0x22')];var _0x41c2fd;if(_0x452943>=_0x5d5531){_0x452943=_0x5d5531;_0x41c2fd=0xc8;}else{_0x41c2fd=0xce;}_0x175db6[_0xf781('0x1f')](_0x41c2fd);return _0x175db6['set']('Content-Range',_0x4a3f85+'-'+_0x452943+'/'+_0x5d5531)[_0xf781('0x25')](_0xea6a72);}return null;};}function patchUpdates(_0x352b0f){return function(_0x2de693){try{jsonpatch['apply'](_0x2de693,_0x352b0f,!![]);}catch(_0x50edd0){return BPromise['reject'](_0x50edd0);}return _0x2de693[_0xf781('0x26')]();};}function saveUpdates(_0x5f1215,_0x1e8ec8){return function(_0x27755d){if(_0x27755d){return _0x27755d[_0xf781('0x27')](_0x5f1215)[_0xf781('0x28')](function(_0x4377f5){return _0x4377f5;});}return null;};}function removeEntity(_0x59a345,_0x1a26cc){return function(_0x4909a3){if(_0x4909a3){return _0x4909a3[_0xf781('0x29')]()[_0xf781('0x28')](function(){var _0xe1a2a9=_0x4909a3[_0xf781('0x2a')]({'plain':!![]});var _0x2f40ee=_0xf781('0x2b');return db[_0xf781('0x2c')][_0xf781('0x29')]({'where':{'type':_0x2f40ee,'resourceId':_0xe1a2a9['id']}})['then'](function(){return _0x4909a3;});})['then'](function(){_0x59a345[_0xf781('0x1f')](0xcc)[_0xf781('0x20')]();});}};}function handleEntityNotFound(_0x402cb3,_0x216eff){return function(_0x1ba624){if(!_0x1ba624){_0x402cb3[_0xf781('0x2d')](0x194);}return _0x1ba624;};}function handleError(_0x421546,_0x37134a){_0x37134a=_0x37134a||0x1f4;return function(_0x5ec1f6){logger[_0xf781('0x2e')](_0x5ec1f6[_0xf781('0x2f')]);if(_0x5ec1f6['name']){delete _0x5ec1f6[_0xf781('0x30')];}_0x421546[_0xf781('0x1f')](_0x37134a)['send'](_0x5ec1f6);};}exports[_0xf781('0x31')]=function(_0x2c56b6,_0x5578dc){var _0x208377={},_0x3fc937={},_0x5d8708={'count':0x0,'rows':[]};var _0x18d367=_['map'](db[_0xf781('0x32')][_0xf781('0x33')],function(_0x268c11){return{'name':_0x268c11[_0xf781('0x34')],'type':_0x268c11['type'][_0xf781('0x35')]};});_0x3fc937[_0xf781('0x36')]=_[_0xf781('0x37')](_0x18d367,_0xf781('0x30'));_0x3fc937['query']=_['keys'](_0x2c56b6[_0xf781('0x38')]);_0x3fc937[_0xf781('0x39')]=_['intersection'](_0x3fc937[_0xf781('0x36')],_0x3fc937[_0xf781('0x38')]);_0x208377['attributes']=_['intersection'](_0x3fc937[_0xf781('0x36')],qs[_0xf781('0x3a')](_0x2c56b6['query'][_0xf781('0x3a')]));_0x208377[_0xf781('0x3b')]=_0x208377[_0xf781('0x3b')][_0xf781('0x3c')]?_0x208377[_0xf781('0x3b')]:_0x3fc937['model'];if(!_0x2c56b6['query'][_0xf781('0x3d')](_0xf781('0x3e'))){_0x208377['limit']=qs[_0xf781('0x22')](_0x2c56b6['query'][_0xf781('0x22')]);_0x208377[_0xf781('0x21')]=qs[_0xf781('0x21')](_0x2c56b6['query']['offset']);}_0x208377[_0xf781('0x3f')]=qs[_0xf781('0x40')](_0x2c56b6[_0xf781('0x38')][_0xf781('0x40')]);_0x208377[_0xf781('0x41')]=qs[_0xf781('0x39')](_[_0xf781('0x42')](_0x2c56b6['query'],_0x3fc937[_0xf781('0x39')]),_0x18d367);if(_0x2c56b6['query']['filter']){_0x208377['where']=_[_0xf781('0x43')](_0x208377[_0xf781('0x41')],{'$or':_[_0xf781('0x37')](_0x18d367,function(_0x4e8e3f){if(_0x4e8e3f[_0xf781('0x44')]!==_0xf781('0x45')){var _0x4ec159={};_0x4ec159[_0x4e8e3f[_0xf781('0x30')]]={'$like':'%'+_0x2c56b6[_0xf781('0x38')]['filter']+'%'};return _0x4ec159;}})});}_0x208377=_[_0xf781('0x43')]({},_0x208377,_0x2c56b6['options']);var _0x470119={'where':_0x208377[_0xf781('0x41')]};return db['MailQueue']['count'](_0x470119)[_0xf781('0x28')](function(_0x331727){_0x5d8708[_0xf781('0x24')]=_0x331727;if(_0x2c56b6['query'][_0xf781('0x46')]){_0x208377['include']=[{'all':!![]}];}return db['MailQueue'][_0xf781('0x47')](_0x208377);})[_0xf781('0x28')](function(_0x196b8e){_0x5d8708[_0xf781('0x48')]=_0x196b8e;return _0x5d8708;})[_0xf781('0x28')](respondWithFilteredResult(_0x5578dc,_0x208377))[_0xf781('0x49')](handleError(_0x5578dc,null));};exports[_0xf781('0x4a')]=function(_0x99f951,_0x40cd7f){var _0x36480e={'raw':!![],'where':{'id':_0x99f951['params']['id']}},_0x176df1={};_0x176df1[_0xf781('0x36')]=_['keys'](db['MailQueue'][_0xf781('0x33')]);_0x176df1[_0xf781('0x38')]=_['keys'](_0x99f951[_0xf781('0x38')]);_0x176df1[_0xf781('0x39')]=_['intersection'](_0x176df1[_0xf781('0x36')],_0x176df1['query']);_0x36480e[_0xf781('0x3b')]=_['intersection'](_0x176df1[_0xf781('0x36')],qs['fields'](_0x99f951[_0xf781('0x38')]['fields']));_0x36480e[_0xf781('0x3b')]=_0x36480e[_0xf781('0x3b')][_0xf781('0x3c')]?_0x36480e[_0xf781('0x3b')]:_0x176df1[_0xf781('0x36')];if(_0x99f951[_0xf781('0x38')][_0xf781('0x46')]){_0x36480e[_0xf781('0x4b')]=[{'all':!![]}];}_0x36480e=_[_0xf781('0x43')]({},_0x36480e,_0x99f951[_0xf781('0x4c')]);return db[_0xf781('0x32')][_0xf781('0x4d')](_0x36480e)[_0xf781('0x28')](handleEntityNotFound(_0x40cd7f,null))[_0xf781('0x28')](respondWithResult(_0x40cd7f,null))['catch'](handleError(_0x40cd7f,null));};exports[_0xf781('0x4e')]=function(_0x4c2d6c,_0x2d678a){return db[_0xf781('0x32')]['create'](_0x4c2d6c['body'],{})[_0xf781('0x28')](function(_0x173b63){var _0x4b335c=_0x4c2d6c[_0xf781('0x4f')]['get']({'plain':!![]});if(!_0x4b335c)throw new Error(_0xf781('0x50'));if(_0x4b335c[_0xf781('0x51')]===_0xf781('0x4f')){var _0x439495=_0x173b63[_0xf781('0x2a')]({'plain':!![]});var _0x45b195=_0xf781('0x2b');return db[_0xf781('0x52')][_0xf781('0x4d')]({'where':{'name':_0x45b195,'userProfileId':_0x4b335c[_0xf781('0x53')]},'raw':!![]})[_0xf781('0x28')](function(_0x5b7f5d){if(_0x5b7f5d&&_0x5b7f5d[_0xf781('0x54')]===0x0){return db['UserProfileResource'][_0xf781('0x4e')]({'name':_0x439495['name'],'resourceId':_0x439495['id'],'type':_0x5b7f5d[_0xf781('0x30')],'sectionId':_0x5b7f5d['id']},{})['then'](function(){return _0x173b63;});}else{return _0x173b63;}})['catch'](function(_0x2626d0){logger[_0xf781('0x2e')](_0xf781('0x55'),_0x2626d0);throw _0x2626d0;});}return _0x173b63;})[_0xf781('0x28')](respondWithResult(_0x2d678a,0xc9))[_0xf781('0x49')](handleError(_0x2d678a,null));};exports[_0xf781('0x27')]=function(_0x2f725a,_0x50612d){if(_0x2f725a[_0xf781('0x56')]['id']){delete _0x2f725a[_0xf781('0x56')]['id'];}return db[_0xf781('0x32')][_0xf781('0x4d')]({'where':{'id':_0x2f725a[_0xf781('0x57')]['id']}})[_0xf781('0x28')](handleEntityNotFound(_0x50612d,null))['then'](saveUpdates(_0x2f725a[_0xf781('0x56')],null))[_0xf781('0x28')](respondWithResult(_0x50612d,null))[_0xf781('0x49')](handleError(_0x50612d,null));};exports['destroy']=function(_0x453066,_0x1dabd9){return db['MailQueue'][_0xf781('0x4d')]({'where':{'id':_0x453066[_0xf781('0x57')]['id']}})[_0xf781('0x28')](handleEntityNotFound(_0x1dabd9,null))[_0xf781('0x28')](removeEntity(_0x1dabd9,null))[_0xf781('0x49')](handleError(_0x1dabd9,null));};exports[_0xf781('0x58')]=function(_0x5c9c5b,_0x3bf5c6){return db[_0xf781('0x32')]['describe']()[_0xf781('0x28')](respondWithResult(_0x3bf5c6,null))[_0xf781('0x49')](handleError(_0x3bf5c6,null));};exports[_0xf781('0x59')]=function(_0x32f795,_0x55a72c,_0x269dca){var _0x3a5b9c={'raw':!![],'where':{}},_0x198c5e={},_0x51d1df;return db[_0xf781('0x32')][_0xf781('0x5a')]({'where':{'id':_0x32f795[_0xf781('0x57')]['id']}})['then'](handleEntityNotFound(_0x55a72c,null))[_0xf781('0x28')](function(_0x1b694c){if(_0x1b694c){_0x51d1df=_0x1b694c['get']({'plain':!![]});_0x198c5e[_0xf781('0x36')]=_[_0xf781('0x5b')](db[_0xf781('0x5c')][_0xf781('0x33')]);_0x198c5e[_0xf781('0x38')]=_[_0xf781('0x5b')](_0x32f795[_0xf781('0x38')]);_0x198c5e['filters']=_[_0xf781('0x5d')](_0x198c5e[_0xf781('0x36')],_0x198c5e[_0xf781('0x38')]);_0x3a5b9c[_0xf781('0x3b')]=_[_0xf781('0x5d')](_0x198c5e[_0xf781('0x36')],qs['fields'](_0x32f795[_0xf781('0x38')][_0xf781('0x3a')]));_0x3a5b9c[_0xf781('0x3b')]=_0x3a5b9c[_0xf781('0x3b')]['length']?_0x3a5b9c['attributes']:_0x198c5e[_0xf781('0x36')];if(!_0x32f795[_0xf781('0x38')]['hasOwnProperty'](_0xf781('0x3e'))){_0x3a5b9c[_0xf781('0x22')]=qs[_0xf781('0x22')](_0x32f795[_0xf781('0x38')][_0xf781('0x22')]);_0x3a5b9c['offset']=qs[_0xf781('0x21')](_0x32f795[_0xf781('0x38')][_0xf781('0x21')]);}_0x3a5b9c[_0xf781('0x3f')]=qs[_0xf781('0x40')](_0x32f795[_0xf781('0x38')][_0xf781('0x40')]);_0x3a5b9c[_0xf781('0x41')]=qs[_0xf781('0x39')](_['pick'](_0x32f795[_0xf781('0x38')],_0x198c5e[_0xf781('0x39')]));_0x3a5b9c['where'][_0xf781('0x5e')]=_0x1b694c['id'];if(_0x32f795[_0xf781('0x38')][_0xf781('0x5f')]){_0x3a5b9c['where']=_['merge'](_0x3a5b9c[_0xf781('0x41')],{'$or':_['map'](_0x3a5b9c[_0xf781('0x3b')],function(_0x5f0776){var _0x24ed2a={};_0x24ed2a[_0x5f0776]={'$like':'%'+_0x32f795[_0xf781('0x38')]['filter']+'%'};return _0x24ed2a;})});}_0x3a5b9c=_['merge']({},_0x3a5b9c,_0x32f795[_0xf781('0x4c')]);return db['UserMailQueue'][_0xf781('0x47')](_0x3a5b9c);}})['then'](function(_0x3dd2e5){if(_0x3dd2e5){return db[_0xf781('0x60')][_0xf781('0x61')]({'where':{'id':_['map'](_0x3dd2e5,_0xf781('0x62')),'role':_0xf781('0x63')},'attributes':['id',_0xf781('0x30'),'mailPause','updatedAt',_0xf781('0x64')]});}})[_0xf781('0x28')](function(_0x4c514f){if(_0x4c514f){return{'count':_0x4c514f[_0xf781('0x24')],'rows':_['map'](_0x4c514f[_0xf781('0x48')],function(_0x8c7d95){return{'membername':_0x8c7d95[_0xf781('0x30')],'UserId':_0x8c7d95['id'],'queue_name':_0x51d1df[_0xf781('0x30')],'MailQueueId':_0x51d1df['id'],'interface':util[_0xf781('0x65')](_0xf781('0x66'),_0xf781('0x67'),_0x8c7d95['name']),'penalty':0x0,'paused':_0x8c7d95[_0xf781('0x68')],'createdAt':_0x8c7d95[_0xf781('0x64')],'updatedAt':_0x8c7d95[_0xf781('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf781('0x28')](respondWithFilteredResult(_0x55a72c,_0x3a5b9c))[_0xf781('0x49')](handleError(_0x55a72c,null));};exports[_0xf781('0x6a')]=function(_0x1000c2,_0x42cc8b,_0x4148fa){var _0xa45eca={};var _0x146da8={};var _0x2a5690;var _0x343303;return db['MailQueue']['findOne']({'where':{'id':_0x1000c2[_0xf781('0x57')]['id']}})[_0xf781('0x28')](handleEntityNotFound(_0x42cc8b,null))[_0xf781('0x28')](function(_0x27f563){if(_0x27f563){_0x2a5690=_0x27f563;_0x146da8[_0xf781('0x36')]=_['keys'](db['Team']['rawAttributes']);_0x146da8[_0xf781('0x38')]=_[_0xf781('0x5b')](_0x1000c2[_0xf781('0x38')]);_0x146da8[_0xf781('0x39')]=_['intersection'](_0x146da8['model'],_0x146da8[_0xf781('0x38')]);_0xa45eca[_0xf781('0x3b')]=_[_0xf781('0x5d')](_0x146da8[_0xf781('0x36')],qs['fields'](_0x1000c2[_0xf781('0x38')][_0xf781('0x3a')]));_0xa45eca[_0xf781('0x3b')]=_0xa45eca[_0xf781('0x3b')][_0xf781('0x3c')]?_0xa45eca[_0xf781('0x3b')]:_0x146da8[_0xf781('0x36')];_0xa45eca[_0xf781('0x3f')]=qs[_0xf781('0x40')](_0x1000c2[_0xf781('0x38')][_0xf781('0x40')]);_0xa45eca[_0xf781('0x41')]=qs[_0xf781('0x39')](_[_0xf781('0x42')](_0x1000c2[_0xf781('0x38')],_0x146da8[_0xf781('0x39')]));if(_0x1000c2[_0xf781('0x38')][_0xf781('0x5f')]){_0xa45eca[_0xf781('0x41')]=_[_0xf781('0x43')](_0xa45eca[_0xf781('0x41')],{'$or':_['map'](_0xa45eca['attributes'],function(_0x2181f2){var _0xdd67b3={};_0xdd67b3[_0x2181f2]={'$like':'%'+_0x1000c2['query'][_0xf781('0x5f')]+'%'};return _0xdd67b3;})});}_0xa45eca=_[_0xf781('0x43')]({},_0xa45eca,_0x1000c2['options']);return _0x2a5690['getTeams'](_0xa45eca);}})['then'](function(_0x206995){if(_0x206995){_0x343303=_0x206995[_0xf781('0x3c')];if(!_0x1000c2[_0xf781('0x38')][_0xf781('0x3d')](_0xf781('0x3e'))){_0xa45eca[_0xf781('0x22')]=qs['limit'](_0x1000c2['query'][_0xf781('0x22')]);_0xa45eca[_0xf781('0x21')]=qs[_0xf781('0x21')](_0x1000c2[_0xf781('0x38')][_0xf781('0x21')]);}return _0x2a5690[_0xf781('0x6a')](_0xa45eca);}})[_0xf781('0x28')](function(_0x19a162){if(_0x19a162){return _0x19a162?{'count':_0x343303,'rows':_0x19a162}:null;}})[_0xf781('0x28')](respondWithResult(_0x42cc8b,null))[_0xf781('0x49')](handleError(_0x42cc8b,null));};exports[_0xf781('0x6b')]=function(_0x4cfad4,_0x3be83f,_0x162106){var _0x401705=_0x4cfad4[_0xf781('0x56')][_0xf781('0x6c')];return db['Team'][_0xf781('0x47')]({'where':{'id':_0x401705},'attributes':['id'],'include':[{'model':db[_0xf781('0x60')],'as':_0xf781('0x6d'),'attributes':['id',_0xf781('0x30'),_0xf781('0x6e'),'voicePause',_0xf781('0x6f')],'raw':!![]}]})[_0xf781('0x28')](function(_0x1d414b){if(_0x1d414b){var _0x1d61e8=_['flatMap'](_0x1d414b,function(_0x31f805){var _0x584e70=_0x31f805['get']({'plain':!![]});return _0x584e70[_0xf781('0x6d')];});return db[_0xf781('0x32')][_0xf781('0x4d')]({'where':{'id':_0x4cfad4[_0xf781('0x57')]['id']}})[_0xf781('0x28')](function(_0x4dd349){return db[_0xf781('0x70')]['transaction'](function(_0x5ee0e9){return _0x4dd349[_0xf781('0x6b')](_0x401705,{'transaction':_0x5ee0e9})[_0xf781('0x28')](function(){return BPromise[_0xf781('0x71')](_0x1d61e8,function(_0x456268){return db[_0xf781('0x5c')][_0xf781('0x72')]({'where':{'UserId':_0x456268['id'],'MailQueueId':_0x4cfad4['params']['id']},'transaction':_0x5ee0e9});});})[_0xf781('0x28')](function(){_0x1d61e8[_0xf781('0x73')](function(_0x5b0042){socket['emit'](_0xf781('0x74'),{'UserId':_0x5b0042['id'],'MailQueueId':_0x4dd349['id']});});});});});}})[_0xf781('0x28')](respondWithStatusCode(_0x3be83f,null))[_0xf781('0x49')](handleError(_0x3be83f,null));};exports[_0xf781('0x75')]=function(_0x4dfde1,_0x522239,_0x557ce9){return db[_0xf781('0x76')]['findAll']({'where':{'id':_0x4dfde1['query'][_0xf781('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf781('0x28')](handleEntityNotFound(_0x522239,null))['then'](function(_0x42a43a){var _0x143442=_[_0xf781('0x37')](_0x42a43a,'id');var _0x24b00a=[];var _0x31345a=[];var _0x11b0b5=squel[_0xf781('0x77')]();_0x11b0b5[_0xf781('0x78')](_0xf781('0x79'))[_0xf781('0x7a')]('team_has_mail_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf781('0x41')](_0xf781('0x7b'),_0x4dfde1[_0xf781('0x57')]['id']);for(var _0x32bbfa=0x0;_0x32bbfa<_0x42a43a['length'];_0x32bbfa+=0x1){let _0x54eeca=_0x42a43a[_0x32bbfa];for(var _0x145c2c=0x0;_0x145c2c<_0x54eeca[_0xf781('0x6d')][_0xf781('0x3c')];_0x145c2c+=0x1){let _0x264cd0=_0x54eeca['Agents'][_0x145c2c];var _0x203520=_0x11b0b5[_0xf781('0x7c')]();_0x203520[_0xf781('0x41')](_0xf781('0x7d'),_0x264cd0['id']);_0x31345a[_0xf781('0x7e')](db['sequelize']['query'](_0x203520['toString'](),{'type':db[_0xf781('0x70')][_0xf781('0x7f')][_0xf781('0x80')]})['then'](function(_0x286d5b){if(_0x286d5b[_0xf781('0x3c')]===0x1){return _0x264cd0['id'];}else{var _0x3c17f4=_[_0xf781('0x81')](_['map'](_0x286d5b,_0xf781('0x82')),function(_0x55ea0e){return _[_0xf781('0x83')](_0x143442,_0x55ea0e);});if(_0x3c17f4){return _0x264cd0['id'];}}}));}}return BPromise[_0xf781('0x84')](_0x31345a)[_0xf781('0x28')](function(_0x21fbcb){_0x24b00a=_(_0x24b00a)[_0xf781('0x85')](_0x21fbcb)['compact']()[_0xf781('0x86')]();return db[_0xf781('0x32')][_0xf781('0x4d')]({'where':{'id':_0x4dfde1[_0xf781('0x57')]['id']}})[_0xf781('0x28')](function(_0x309d75){return db[_0xf781('0x70')]['transaction'](function(_0x311f41){return _0x309d75[_0xf781('0x75')](_0x4dfde1[_0xf781('0x38')][_0xf781('0x6c')],{'transaction':_0x311f41})[_0xf781('0x28')](function(){if(!_[_0xf781('0x87')](_0x24b00a)){return _0x309d75[_0xf781('0x88')](_0x24b00a,{'transaction':_0x311f41});}})[_0xf781('0x28')](function(){_0x24b00a[_0xf781('0x73')](function(_0xbfd322){socket['emit']('userMailQueue:remove',{'UserId':_0xbfd322,'MailQueueId':_0x309d75['id']});});});});});});})['then'](respondWithStatusCode(_0x522239,null))[_0xf781('0x49')](handleError(_0x522239,null));};exports[_0xf781('0x89')]=function(_0x2713f7,_0x4ae933,_0x447e41){return db[_0xf781('0x32')][_0xf781('0x4d')]({'where':{'id':_0x2713f7['params']['id']}})['then'](handleEntityNotFound(_0x4ae933,null))['then'](function(_0x252cd4){if(_0x252cd4){return _0x252cd4['addAgents'](_0x2713f7['body'][_0xf781('0x6c')],_[_0xf781('0x8a')](_0x2713f7[_0xf781('0x56')],[_0xf781('0x6c'),'id'])||{})[_0xf781('0x8b')](function(_0x1300d1){for(var _0x3a61f4=0x0;_0x3a61f4<_0x2713f7[_0xf781('0x56')]['ids'][_0xf781('0x3c')];_0x3a61f4+=0x1){socket[_0xf781('0x8c')](_0xf781('0x74'),{'UserId':Number(_0x2713f7[_0xf781('0x56')][_0xf781('0x6c')][_0x3a61f4]),'MailQueueId':Number(_0x2713f7[_0xf781('0x57')]['id'])});}return _0x1300d1;});}})[_0xf781('0x28')](respondWithResult(_0x4ae933,null))[_0xf781('0x49')](handleError(_0x4ae933,null));};exports['removeAgents']=function(_0x40d896,_0x43dfc5,_0x23f967){return db[_0xf781('0x32')][_0xf781('0x4d')]({'where':{'id':_0x40d896[_0xf781('0x57')]['id']}})[_0xf781('0x28')](handleEntityNotFound(_0x43dfc5,null))[_0xf781('0x28')](function(_0x17e18a){if(_0x17e18a){return _0x17e18a['removeAgents'](_0x40d896[_0xf781('0x38')]['ids'])[_0xf781('0x28')](function(){if(_[_0xf781('0x8d')](_0x40d896['query']['ids'])){for(var _0x49ac65=0x0;_0x49ac65<_0x40d896['query']['ids'][_0xf781('0x3c')];_0x49ac65+=0x1){socket['emit'](_0xf781('0x8e'),{'UserId':Number(_0x40d896['query']['ids'][_0x49ac65]),'MailQueueId':Number(_0x40d896[_0xf781('0x57')]['id'])});}}else{socket[_0xf781('0x8c')](_0xf781('0x8e'),{'UserId':Number(_0x40d896[_0xf781('0x38')][_0xf781('0x6c')]),'MailQueueId':Number(_0x40d896[_0xf781('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x43dfc5,null))[_0xf781('0x49')](handleError(_0x43dfc5,null));};exports['getAgents']=function(_0x1fa4ce,_0xe37346,_0x41b2e0){var _0x1105a4={};var _0x4c6963={};var _0x185d58;var _0x47186c;return db[_0xf781('0x32')][_0xf781('0x5a')]({'where':{'id':_0x1fa4ce[_0xf781('0x57')]['id']}})[_0xf781('0x28')](handleEntityNotFound(_0xe37346,null))[_0xf781('0x28')](function(_0x1ec112){if(_0x1ec112){_0x185d58=_0x1ec112;_0x4c6963[_0xf781('0x36')]=_['keys'](db[_0xf781('0x60')][_0xf781('0x33')]);_0x4c6963[_0xf781('0x38')]=_['keys'](_0x1fa4ce[_0xf781('0x38')]);_0x4c6963[_0xf781('0x39')]=_[_0xf781('0x5d')](_0x4c6963[_0xf781('0x36')],_0x4c6963[_0xf781('0x38')]);_0x1105a4[_0xf781('0x3b')]=_['intersection'](_0x4c6963['model'],qs['fields'](_0x1fa4ce[_0xf781('0x38')][_0xf781('0x3a')]));_0x1105a4['attributes']=_0x1105a4[_0xf781('0x3b')][_0xf781('0x3c')]?_0x1105a4[_0xf781('0x3b')]:_0x4c6963[_0xf781('0x36')];_0x1105a4[_0xf781('0x3f')]=qs['sort'](_0x1fa4ce[_0xf781('0x38')]['sort']);_0x1105a4[_0xf781('0x41')]=qs[_0xf781('0x39')](_[_0xf781('0x42')](_0x1fa4ce['query'],_0x4c6963[_0xf781('0x39')]));if(_0x1fa4ce[_0xf781('0x38')][_0xf781('0x5f')]){_0x1105a4[_0xf781('0x41')]=_[_0xf781('0x43')](_0x1105a4['where'],{'$or':_['map'](_0x1105a4[_0xf781('0x3b')],function(_0x25b80b){var _0x3719b0={};_0x3719b0[_0x25b80b]={'$like':'%'+_0x1fa4ce[_0xf781('0x38')]['filter']+'%'};return _0x3719b0;})});}_0x1105a4=_[_0xf781('0x43')]({},_0x1105a4,_0x1fa4ce[_0xf781('0x4c')]);return _0x185d58[_0xf781('0x8f')](_0x1105a4);}})['then'](function(_0xfd2404){if(_0xfd2404){_0x47186c=_0xfd2404[_0xf781('0x3c')];if(!_0x1fa4ce[_0xf781('0x38')][_0xf781('0x3d')](_0xf781('0x3e'))){_0x1105a4[_0xf781('0x22')]=qs[_0xf781('0x22')](_0x1fa4ce[_0xf781('0x38')][_0xf781('0x22')]);_0x1105a4['offset']=qs[_0xf781('0x21')](_0x1fa4ce[_0xf781('0x38')][_0xf781('0x21')]);}return _0x185d58[_0xf781('0x8f')](_0x1105a4);}})['then'](function(_0x4394f0){if(_0x4394f0){return _0x4394f0?{'count':_0x47186c,'rows':_0x4394f0}:null;}})[_0xf781('0x28')](respondWithResult(_0xe37346,null))[_0xf781('0x49')](handleError(_0xe37346,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8d826c4..2abc0e5 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 _0xbf14=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1ed298,_0x514c16){var _0xdc6426=function(_0x4fd404){while(--_0x4fd404){_0x1ed298['push'](_0x1ed298['shift']());}};_0xdc6426(++_0x514c16);}(_0xbf14,0x164));var _0x4bf1=function(_0x5dbfe6,_0x1d132e){_0x5dbfe6=_0x5dbfe6-0x0;var _0x24f9b9=_0xbf14[_0x5dbfe6];return _0x24f9b9;};'use strict';var EventEmitter=require(_0x4bf1('0x0'));var MailQueue=require(_0x4bf1('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4bf1('0x2')](0x0);var events={'afterCreate':_0x4bf1('0x3'),'afterUpdate':_0x4bf1('0x4'),'afterDestroy':_0x4bf1('0x5')};function emitEvent(_0x50e315){return function(_0x48668d,_0x190e31,_0xeefb2c){MailQueueEvents[_0x4bf1('0x6')](_0x50e315+':'+_0x48668d['id'],_0x48668d);MailQueueEvents[_0x4bf1('0x6')](_0x50e315,_0x48668d);_0xeefb2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x4bf1('0x7')](e,emitEvent(event));}}module[_0x4bf1('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xdc05=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x57c667,_0x5d1c99){var _0x475ebb=function(_0x1c0bf5){while(--_0x1c0bf5){_0x57c667['push'](_0x57c667['shift']());}};_0x475ebb(++_0x5d1c99);}(_0xdc05,0x192));var _0x5dc0=function(_0x329647,_0x2f6850){_0x329647=_0x329647-0x0;var _0xbcd89b=_0xdc05[_0x329647];return _0xbcd89b;};'use strict';var EventEmitter=require(_0x5dc0('0x0'));var MailQueue=require(_0x5dc0('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5dc0('0x2')](0x0);var events={'afterCreate':_0x5dc0('0x3'),'afterUpdate':_0x5dc0('0x4'),'afterDestroy':_0x5dc0('0x5')};function emitEvent(_0x3001bd){return function(_0x2940a2,_0x9d68bc,_0xfe529c){MailQueueEvents[_0x5dc0('0x6')](_0x3001bd+':'+_0x2940a2['id'],_0x2940a2);MailQueueEvents[_0x5dc0('0x6')](_0x3001bd,_0x2940a2);_0xfe529c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x5dc0('0x7')](e,emitEvent(event));}}module[_0x5dc0('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index e8f5dd1..620d4a4 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 _0x9f8a=['../../config/logger','api','moment','path','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash'];(function(_0x4506a3,_0x383514){var _0x3a112c=function(_0x53097d){while(--_0x53097d){_0x4506a3['push'](_0x4506a3['shift']());}};_0x3a112c(++_0x383514);}(_0x9f8a,0x171));var _0xa9f8=function(_0x1673d4,_0x31b681){_0x1673d4=_0x1673d4-0x0;var _0x481d97=_0x9f8a[_0x1673d4];return _0x481d97;};'use strict';var _=require(_0xa9f8('0x0'));var util=require('util');var logger=require(_0xa9f8('0x1'))(_0xa9f8('0x2'));var moment=require(_0xa9f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9f8('0x4'));var rimraf=require('rimraf');var config=require(_0xa9f8('0x5'));var attributes=require(_0xa9f8('0x6'));module[_0xa9f8('0x7')]=function(_0x59546e,_0x5d6a1f){return _0x59546e['define'](_0xa9f8('0x8'),attributes,{'tableName':_0xa9f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3d1=['./mailQueue.attributes','exports','define','mail_queues','lodash','../../config/logger','path','rimraf','../../config/environment'];(function(_0x26f96e,_0x2dd3bc){var _0x3daee8=function(_0x429acc){while(--_0x429acc){_0x26f96e['push'](_0x26f96e['shift']());}};_0x3daee8(++_0x2dd3bc);}(_0xf3d1,0x12d));var _0x1f3d=function(_0x316686,_0x1d0887){_0x316686=_0x316686-0x0;var _0x7c9440=_0xf3d1[_0x316686];return _0x7c9440;};'use strict';var _=require(_0x1f3d('0x0'));var util=require('util');var logger=require(_0x1f3d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f3d('0x2'));var rimraf=require(_0x1f3d('0x3'));var config=require(_0x1f3d('0x4'));var attributes=require(_0x1f3d('0x5'));module[_0x1f3d('0x6')]=function(_0x3f309c,_0x5d4227){return _0x3f309c[_0x1f3d('0x7')]('MailQueue',attributes,{'tableName':_0x1f3d('0x8'),'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 dee85e0..0ab24d1 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 _0x4c73=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetMailQueue','find','ShowMailQueue','lodash','util','moment','bluebird'];(function(_0x150e14,_0x3a7c0a){var _0x2d26fc=function(_0x33103b){while(--_0x33103b){_0x150e14['push'](_0x150e14['shift']());}};_0x2d26fc(++_0x3a7c0a);}(_0x4c73,0x14c));var _0x34c7=function(_0x33b7bd,_0x8ddb4d){_0x33b7bd=_0x33b7bd-0x0;var _0x1059c6=_0x4c73[_0x33b7bd];return _0x1059c6;};'use strict';var _=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var moment=require(_0x34c7('0x2'));var BPromise=require(_0x34c7('0x3'));var rs=require(_0x34c7('0x4'));var fs=require('fs');var Redis=require(_0x34c7('0x5'));var db=require(_0x34c7('0x6'))['db'];var utils=require(_0x34c7('0x7'));var logger=require('../../config/logger')(_0x34c7('0x8'));var config=require(_0x34c7('0x9'));var jayson=require(_0x34c7('0xa'));var client=jayson[_0x34c7('0xb')][_0x34c7('0xc')]({'port':0x232a});config[_0x34c7('0xd')]=_['defaults'](config[_0x34c7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x34c7('0xe'))(new Redis(config[_0x34c7('0xd')]));require('./mailQueue.socket')[_0x34c7('0xf')](socket);function respondWithRpcPromise(_0x56a95b,_0x3d0adc,_0x11ed76){return new BPromise(function(_0x3e3d3c,_0x45f3db){return client[_0x34c7('0x10')](_0x56a95b,_0x11ed76)[_0x34c7('0x11')](function(_0x31e24f){logger[_0x34c7('0x12')](_0x34c7('0x13'),_0x3d0adc,_0x34c7('0x14'));logger[_0x34c7('0x15')](_0x34c7('0x16'),_0x3d0adc,_0x34c7('0x14'),JSON[_0x34c7('0x17')](_0x31e24f));if(_0x31e24f[_0x34c7('0x18')]){if(_0x31e24f[_0x34c7('0x18')][_0x34c7('0x19')]===0x1f4){logger[_0x34c7('0x18')]('MailQueue,\x20%s,\x20%s',_0x3d0adc,_0x31e24f[_0x34c7('0x18')][_0x34c7('0x1a')]);return _0x45f3db(_0x31e24f['error'][_0x34c7('0x1a')]);}logger[_0x34c7('0x18')](_0x34c7('0x13'),_0x3d0adc,_0x31e24f[_0x34c7('0x18')][_0x34c7('0x1a')]);return _0x3e3d3c(_0x31e24f[_0x34c7('0x18')][_0x34c7('0x1a')]);}else{logger[_0x34c7('0x12')](_0x34c7('0x13'),_0x3d0adc,_0x34c7('0x14'));_0x3e3d3c(_0x31e24f[_0x34c7('0x1b')][_0x34c7('0x1a')]);}})[_0x34c7('0x1c')](function(_0x484405){logger[_0x34c7('0x18')]('MailQueue,\x20%s,\x20%s',_0x3d0adc,_0x484405);_0x45f3db(_0x484405);});});}exports['GetMailQueue']=function(_0x548e71){var _0x3e6af1=this;return new Promise(function(_0x5ae135,_0x3bee56){return db[_0x34c7('0x1d')][_0x34c7('0x1e')]({'raw':_0x548e71[_0x34c7('0x1f')]?_0x548e71[_0x34c7('0x1f')][_0x34c7('0x20')]===undefined?!![]:![]:!![],'where':_0x548e71[_0x34c7('0x1f')]?_0x548e71['options'][_0x34c7('0x21')]||null:null,'attributes':_0x548e71[_0x34c7('0x1f')]?_0x548e71[_0x34c7('0x1f')]['attributes']||null:null,'limit':_0x548e71[_0x34c7('0x1f')]?_0x548e71[_0x34c7('0x1f')][_0x34c7('0x22')]||null:null,'include':_0x548e71[_0x34c7('0x1f')]?_0x548e71[_0x34c7('0x1f')][_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x548e71[_0x34c7('0x1f')][_0x34c7('0x23')],function(_0x13c113){return{'model':db[_0x13c113[_0x34c7('0x25')]],'as':_0x13c113['as'],'attributes':_0x13c113[_0x34c7('0x26')],'include':_0x13c113[_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x13c113[_0x34c7('0x23')],function(_0x754bf){return{'model':db[_0x754bf['model']],'as':_0x754bf['as'],'attributes':_0x754bf[_0x34c7('0x26')],'include':_0x754bf[_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x754bf[_0x34c7('0x23')],function(_0x1c42b7){return{'model':db[_0x1c42b7[_0x34c7('0x25')]],'as':_0x1c42b7['as'],'attributes':_0x1c42b7[_0x34c7('0x26')]};}):[]};}):[]};}):[]:[]})[_0x34c7('0x11')](function(_0x4e6ce2){logger['info'](_0x34c7('0x27'),_0x548e71);logger[_0x34c7('0x15')](_0x34c7('0x27'),_0x548e71,JSON['stringify'](_0x4e6ce2));_0x5ae135(_0x4e6ce2);})[_0x34c7('0x1c')](function(_0x57a99e){logger[_0x34c7('0x18')](_0x34c7('0x27'),_0x57a99e['message'],_0x548e71);_0x3bee56(_0x3e6af1['error'](0x1f4,_0x57a99e['message']));});});};exports['ShowMailQueue']=function(_0x321a1f){var _0xf36996=this;return new Promise(function(_0x45317f,_0xabaa96){return db['MailQueue'][_0x34c7('0x28')]({'raw':_0x321a1f[_0x34c7('0x1f')]?_0x321a1f[_0x34c7('0x1f')][_0x34c7('0x20')]===undefined?!![]:![]:!![],'where':_0x321a1f[_0x34c7('0x1f')]?_0x321a1f[_0x34c7('0x1f')]['where']||null:null,'attributes':_0x321a1f[_0x34c7('0x1f')]?_0x321a1f[_0x34c7('0x1f')][_0x34c7('0x26')]||null:null,'include':_0x321a1f[_0x34c7('0x1f')]?_0x321a1f[_0x34c7('0x1f')][_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x321a1f['options']['include'],function(_0x1ef14d){return{'model':db[_0x1ef14d[_0x34c7('0x25')]],'as':_0x1ef14d['as'],'attributes':_0x1ef14d[_0x34c7('0x26')],'include':_0x1ef14d[_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x1ef14d[_0x34c7('0x23')],function(_0x4d0685){return{'model':db[_0x4d0685[_0x34c7('0x25')]],'as':_0x4d0685['as'],'attributes':_0x4d0685[_0x34c7('0x26')],'include':_0x4d0685[_0x34c7('0x23')]?_[_0x34c7('0x24')](_0x4d0685[_0x34c7('0x23')],function(_0x4ca72b){return{'model':db[_0x4ca72b[_0x34c7('0x25')]],'as':_0x4ca72b['as'],'attributes':_0x4ca72b[_0x34c7('0x26')]};}):[]};}):[]};}):[]:[]})[_0x34c7('0x11')](function(_0x3dd065){logger[_0x34c7('0x12')](_0x34c7('0x29'),_0x321a1f);logger['debug'](_0x34c7('0x29'),_0x321a1f,JSON[_0x34c7('0x17')](_0x3dd065));_0x45317f(_0x3dd065);})['catch'](function(_0x580c27){logger[_0x34c7('0x18')]('ShowMailQueue',_0x580c27[_0x34c7('0x1a')],_0x321a1f);_0xabaa96(_0xf36996[_0x34c7('0x18')](0x1f4,_0x580c27[_0x34c7('0x1a')]));});});}; \ No newline at end of file +var _0x014b=['catch','MailQueue','findAll','options','raw','where','include','map','model','attributes','GetMailQueue','stringify','ShowMailQueue','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x54b992,_0x5121de){var _0x331700=function(_0x44fc8e){while(--_0x44fc8e){_0x54b992['push'](_0x54b992['shift']());}};_0x331700(++_0x5121de);}(_0x014b,0x7a));var _0xb014=function(_0x240c19,_0x11de1b){_0x240c19=_0x240c19-0x0;var _0x18d022=_0x014b[_0x240c19];return _0x18d022;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb014('0x0'));var BPromise=require(_0xb014('0x1'));var rs=require(_0xb014('0x2'));var fs=require('fs');var Redis=require(_0xb014('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb014('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb014('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb014('0x6')][_0xb014('0x7')]({'port':0x232a});config[_0xb014('0x8')]=_['defaults'](config[_0xb014('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb014('0x9'))(new Redis(config[_0xb014('0x8')]));require(_0xb014('0xa'))[_0xb014('0xb')](socket);function respondWithRpcPromise(_0x2353f5,_0x948fb5,_0x1c20ce){return new BPromise(function(_0x17756b,_0x2f40af){return client[_0xb014('0xc')](_0x2353f5,_0x1c20ce)[_0xb014('0xd')](function(_0x285f30){logger[_0xb014('0xe')](_0xb014('0xf'),_0x948fb5,_0xb014('0x10'));logger[_0xb014('0x11')](_0xb014('0x12'),_0x948fb5,_0xb014('0x10'),JSON['stringify'](_0x285f30));if(_0x285f30[_0xb014('0x13')]){if(_0x285f30[_0xb014('0x13')][_0xb014('0x14')]===0x1f4){logger[_0xb014('0x13')](_0xb014('0xf'),_0x948fb5,_0x285f30[_0xb014('0x13')][_0xb014('0x15')]);return _0x2f40af(_0x285f30['error'][_0xb014('0x15')]);}logger[_0xb014('0x13')]('MailQueue,\x20%s,\x20%s',_0x948fb5,_0x285f30[_0xb014('0x13')][_0xb014('0x15')]);return _0x17756b(_0x285f30[_0xb014('0x13')][_0xb014('0x15')]);}else{logger[_0xb014('0xe')](_0xb014('0xf'),_0x948fb5,'request\x20sent');_0x17756b(_0x285f30['result'][_0xb014('0x15')]);}})[_0xb014('0x16')](function(_0x8e584a){logger['error'](_0xb014('0xf'),_0x948fb5,_0x8e584a);_0x2f40af(_0x8e584a);});});}exports['GetMailQueue']=function(_0x2c30ce){var _0x4478ec=this;return new Promise(function(_0xc7d204,_0x92f046){return db[_0xb014('0x17')][_0xb014('0x18')]({'raw':_0x2c30ce['options']?_0x2c30ce[_0xb014('0x19')][_0xb014('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c30ce[_0xb014('0x19')]?_0x2c30ce[_0xb014('0x19')][_0xb014('0x1b')]||null:null,'attributes':_0x2c30ce[_0xb014('0x19')]?_0x2c30ce[_0xb014('0x19')]['attributes']||null:null,'limit':_0x2c30ce[_0xb014('0x19')]?_0x2c30ce[_0xb014('0x19')]['limit']||null:null,'include':_0x2c30ce[_0xb014('0x19')]?_0x2c30ce[_0xb014('0x19')][_0xb014('0x1c')]?_[_0xb014('0x1d')](_0x2c30ce[_0xb014('0x19')][_0xb014('0x1c')],function(_0x28457b){return{'model':db[_0x28457b[_0xb014('0x1e')]],'as':_0x28457b['as'],'attributes':_0x28457b['attributes'],'include':_0x28457b['include']?_[_0xb014('0x1d')](_0x28457b[_0xb014('0x1c')],function(_0x4574eb){return{'model':db[_0x4574eb[_0xb014('0x1e')]],'as':_0x4574eb['as'],'attributes':_0x4574eb[_0xb014('0x1f')],'include':_0x4574eb[_0xb014('0x1c')]?_[_0xb014('0x1d')](_0x4574eb[_0xb014('0x1c')],function(_0x49d9ed){return{'model':db[_0x49d9ed[_0xb014('0x1e')]],'as':_0x49d9ed['as'],'attributes':_0x49d9ed[_0xb014('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb014('0xd')](function(_0x450c93){logger['info'](_0xb014('0x20'),_0x2c30ce);logger[_0xb014('0x11')](_0xb014('0x20'),_0x2c30ce,JSON[_0xb014('0x21')](_0x450c93));_0xc7d204(_0x450c93);})[_0xb014('0x16')](function(_0x560466){logger['error'](_0xb014('0x20'),_0x560466[_0xb014('0x15')],_0x2c30ce);_0x92f046(_0x4478ec[_0xb014('0x13')](0x1f4,_0x560466[_0xb014('0x15')]));});});};exports[_0xb014('0x22')]=function(_0x49e332){var _0x5dbce6=this;return new Promise(function(_0x46f76a,_0xa684c8){return db[_0xb014('0x17')][_0xb014('0x23')]({'raw':_0x49e332['options']?_0x49e332[_0xb014('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x49e332[_0xb014('0x19')]?_0x49e332[_0xb014('0x19')][_0xb014('0x1b')]||null:null,'attributes':_0x49e332['options']?_0x49e332[_0xb014('0x19')][_0xb014('0x1f')]||null:null,'include':_0x49e332[_0xb014('0x19')]?_0x49e332[_0xb014('0x19')][_0xb014('0x1c')]?_['map'](_0x49e332[_0xb014('0x19')]['include'],function(_0x10ef82){return{'model':db[_0x10ef82[_0xb014('0x1e')]],'as':_0x10ef82['as'],'attributes':_0x10ef82['attributes'],'include':_0x10ef82[_0xb014('0x1c')]?_[_0xb014('0x1d')](_0x10ef82['include'],function(_0x1d59ca){return{'model':db[_0x1d59ca['model']],'as':_0x1d59ca['as'],'attributes':_0x1d59ca[_0xb014('0x1f')],'include':_0x1d59ca[_0xb014('0x1c')]?_[_0xb014('0x1d')](_0x1d59ca[_0xb014('0x1c')],function(_0x1a5613){return{'model':db[_0x1a5613[_0xb014('0x1e')]],'as':_0x1a5613['as'],'attributes':_0x1a5613['attributes']};}):[]};}):[]};}):[]:[]})[_0xb014('0xd')](function(_0x51c4aa){logger[_0xb014('0xe')](_0xb014('0x22'),_0x49e332);logger[_0xb014('0x11')]('ShowMailQueue',_0x49e332,JSON[_0xb014('0x21')](_0x51c4aa));_0x46f76a(_0x51c4aa);})[_0xb014('0x16')](function(_0x3c6423){logger[_0xb014('0x13')]('ShowMailQueue',_0x3c6423[_0xb014('0x15')],_0x49e332);_0xa684c8(_0x5dbce6[_0xb014('0x13')](0x1f4,_0x3c6423[_0xb014('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index cb9f8f0..6d83816 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 _0x8eba=['save','emit','removeListener','register','length','mailQueue:','./mailQueue.events'];(function(_0x57e212,_0xb2da96){var _0x1e9cf7=function(_0xd06dd5){while(--_0xd06dd5){_0x57e212['push'](_0x57e212['shift']());}};_0x1e9cf7(++_0xb2da96);}(_0x8eba,0xc3));var _0xa8eb=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x8eba[_0x1911ed];return _0x11edaa;};'use strict';var MailQueueEvents=require(_0xa8eb('0x0'));var events=[_0xa8eb('0x1'),'remove','update'];function createListener(_0x4b3a3e,_0x3894f8){return function(_0x322799){_0x3894f8[_0xa8eb('0x2')](_0x4b3a3e,_0x322799);};}function removeListener(_0x2cdf40,_0x52533a){return function(){MailQueueEvents[_0xa8eb('0x3')](_0x2cdf40,_0x52533a);};}exports[_0xa8eb('0x4')]=function(_0x5abab9){for(var _0x321f2f=0x0,_0x5ece80=events[_0xa8eb('0x5')];_0x321f2f<_0x5ece80;_0x321f2f++){var _0x225307=events[_0x321f2f];var _0x509b54=createListener(_0xa8eb('0x6')+_0x225307,_0x5abab9);MailQueueEvents['on'](_0x225307,_0x509b54);}}; \ No newline at end of file +var _0xa79a=['removeListener','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa79a,0x1df));var _0xaa79=function(_0x1dc2ab,_0x215934){_0x1dc2ab=_0x1dc2ab-0x0;var _0x392640=_0xa79a[_0x1dc2ab];return _0x392640;};'use strict';var MailQueueEvents=require(_0xaa79('0x0'));var events=[_0xaa79('0x1'),_0xaa79('0x2'),_0xaa79('0x3')];function createListener(_0x3731a3,_0x42e9d5){return function(_0x2f394c){_0x42e9d5['emit'](_0x3731a3,_0x2f394c);};}function removeListener(_0x277f15,_0x22dd6b){return function(){MailQueueEvents[_0xaa79('0x4')](_0x277f15,_0x22dd6b);};}exports['register']=function(_0x53193a){for(var _0x5b45c9=0x0,_0x287425=events[_0xaa79('0x5')];_0x5b45c9<_0x287425;_0x5b45c9++){var _0x3c4bec=events[_0x5b45c9];var _0x2a64ac=createListener(_0xaa79('0x6')+_0x3c4bec,_0x53193a);MailQueueEvents['on'](_0x3c4bec,_0x2a64ac);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a5c6332..319a46b 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 _0xd80f=['create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','show','post'];(function(_0x102bec,_0x4ff431){var _0x473ee7=function(_0x192dea){while(--_0x192dea){_0x102bec['push'](_0x102bec['shift']());}};_0x473ee7(++_0x4ff431);}(_0xd80f,0xbb));var _0xfd80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd80f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd80('0x0'));var timeout=require(_0xfd80('0x1'));var express=require(_0xfd80('0x2'));var router=express[_0xfd80('0x3')]();var fs_extra=require(_0xfd80('0x4'));var auth=require(_0xfd80('0x5'));var interaction=require(_0xfd80('0x6'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xfd80('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfd80('0x7')](_0xfd80('0x8'),auth[_0xfd80('0x9')](),controller[_0xfd80('0xa')]);router['get']('/:id',auth[_0xfd80('0x9')](),controller[_0xfd80('0xb')]);router[_0xfd80('0xc')]('/',auth['isAuthenticated'](),controller[_0xfd80('0xd')]);router[_0xfd80('0xe')](_0xfd80('0xf'),auth[_0xfd80('0x9')](),controller[_0xfd80('0x10')]);router[_0xfd80('0x11')](_0xfd80('0xf'),auth['isAuthenticated'](),controller[_0xfd80('0x12')]);module[_0xfd80('0x13')]=router; \ No newline at end of file +var _0x922f=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x922f,0xc3));var _0xf922=function(_0x5a56ec,_0x999feb){_0x5a56ec=_0x5a56ec-0x0;var _0x3fb25d=_0x922f[_0x5a56ec];return _0x3fb25d;};'use strict';var multer=require(_0xf922('0x0'));var util=require(_0xf922('0x1'));var path=require(_0xf922('0x2'));var timeout=require(_0xf922('0x3'));var express=require(_0xf922('0x4'));var router=express[_0xf922('0x5')]();var fs_extra=require(_0xf922('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf922('0x7'));var config=require(_0xf922('0x8'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf922('0x9')](_0xf922('0xa'),auth[_0xf922('0xb')](),controller[_0xf922('0xc')]);router[_0xf922('0x9')](_0xf922('0xd'),auth[_0xf922('0xb')](),controller[_0xf922('0xe')]);router[_0xf922('0xf')]('/',auth[_0xf922('0xb')](),controller[_0xf922('0x10')]);router[_0xf922('0x11')](_0xf922('0xd'),auth['isAuthenticated'](),controller[_0xf922('0x12')]);router[_0xf922('0x13')](_0xf922('0xd'),auth[_0xf922('0xb')](),controller['destroy']);module[_0xf922('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 82f2f05..dae32ef 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 _0x49c5=['STRING','DATE','moment','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x49c5,0x183));var _0x549c=function(_0x48f29a,_0x4d8874){_0x48f29a=_0x48f29a-0x0;var _0x31feae=_0x49c5[_0x48f29a];return _0x31feae;};'use strict';var moment=require(_0x549c('0x0'));var Sequelize=require(_0x549c('0x1'));module[_0x549c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x549c('0x3')]},'joinAt':{'type':Sequelize[_0x549c('0x4')]},'leaveAt':{'type':Sequelize[_0x549c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6f1d=['STRING','DATE','sequelize','exports'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x6f1d,0x1b2));var _0xd6f1=function(_0xf69696,_0x2ab9dd){_0xf69696=_0xf69696-0x0;var _0x2c5f0c=_0x6f1d[_0xf69696];return _0x2c5f0c;};'use strict';var moment=require('moment');var Sequelize=require(_0xd6f1('0x0'));module[_0xd6f1('0x1')]={'uniqueid':{'type':Sequelize[_0xd6f1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd6f1('0x2')]},'joinAt':{'type':Sequelize[_0xd6f1('0x3')]},'leaveAt':{'type':Sequelize[_0xd6f1('0x3')]},'acceptAt':{'type':Sequelize[_0xd6f1('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd6f1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index dd4882a..4ca8780 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 _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0xedf8e6,_0x3408ac){var _0x21ef95=function(_0x58f99f){while(--_0x58f99f){_0xedf8e6['push'](_0xedf8e6['shift']());}};_0x21ef95(++_0x3408ac);}(_0x8aad,0x146));var _0xd8aa=function(_0x5ae3a7,_0x104846){_0x5ae3a7=_0x5ae3a7-0x0;var _0x506b45=_0x8aad[_0x5ae3a7];return _0x506b45;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));}; \ No newline at end of file +var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x51a61e,_0x303e3f){var _0x3db0d4=function(_0x2225fb){while(--_0x2225fb){_0x51a61e['push'](_0x51a61e['shift']());}};_0x3db0d4(++_0x303e3f);}(_0x6050,0x196));var _0x0605=function(_0x3c701f,_0x5ba138){_0x3c701f=_0x3c701f-0x0;var _0x40e759=_0x6050[_0x3c701f];return _0x40e759;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 958de2e..498784b 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 _0xdb21=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue'];(function(_0x612267,_0x363a1f){var _0x46b502=function(_0x32791a){while(--_0x32791a){_0x612267['push'](_0x612267['shift']());}};_0x46b502(++_0x363a1f);}(_0xdb21,0x135));var _0x1db2=function(_0x5b4daa,_0xc385e4){_0x5b4daa=_0x5b4daa-0x0;var _0x9b569c=_0xdb21[_0x5b4daa];return _0x9b569c;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var logger=require(_0x1db2('0x2'))(_0x1db2('0x3'));var moment=require(_0x1db2('0x4'));var BPromise=require(_0x1db2('0x5'));var rp=require(_0x1db2('0x6'));var fs=require('fs');var path=require(_0x1db2('0x7'));var rimraf=require(_0x1db2('0x8'));var config=require('../../config/environment');var attributes=require(_0x1db2('0x9'));module['exports']=function(_0x5a7099,_0x174343){return _0x5a7099[_0x1db2('0xa')](_0x1db2('0xb'),attributes,{'tableName':_0x1db2('0xc'),'paranoid':![],'indexes':[{'name':_0x1db2('0xd'),'fields':[_0x1db2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa8d=['exports','MailQueueReport','report_mail_queue','uniqueid','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xdf8c70,_0x5e165a){var _0x3f803f=function(_0x191589){while(--_0x191589){_0xdf8c70['push'](_0xdf8c70['shift']());}};_0x3f803f(++_0x5e165a);}(_0xfa8d,0x159));var _0xdfa8=function(_0x4827db,_0x1eddbc){_0x4827db=_0x4827db-0x0;var _0x380388=_0xfa8d[_0x4827db];return _0x380388;};'use strict';var _=require('lodash');var util=require(_0xdfa8('0x0'));var logger=require('../../config/logger')(_0xdfa8('0x1'));var moment=require(_0xdfa8('0x2'));var BPromise=require(_0xdfa8('0x3'));var rp=require(_0xdfa8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfa8('0x5'));var config=require(_0xdfa8('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0xdfa8('0x7')]=function(_0x181265,_0x127659){return _0x181265['define'](_0xdfa8('0x8'),attributes,{'tableName':_0xdfa8('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdfa8('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 8fb4e5d..e7e148d 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x297a40,_0x24cbe0){var _0x4f2752=function(_0x21ed5a){while(--_0x21ed5a){_0x297a40['push'](_0x297a40['shift']());}};_0x4f2752(++_0x24cbe0);}(_0x1261,0x144));var _0x1126=function(_0x3cdf50,_0x3e8eb2){_0x3cdf50=_0x3cdf50-0x0;var _0x22d47a=_0x1261[_0x3cdf50];return _0x22d47a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x58d394,_0x429162){var _0x1df6a1=function(_0x5907a7){while(--_0x5907a7){_0x58d394['push'](_0x58d394['shift']());}};_0x1df6a1(++_0x429162);}(_0xadb5,0xad));var _0x5adb=function(_0x326264,_0x5943b2){_0x326264=_0x326264-0x0;var _0x46a623=_0xadb5[_0x326264];return _0x46a623;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f9c47e8..979ce90 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_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 +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1c603b,_0x365bb9){var _0x323167=function(_0x1368a1){while(--_0x1368a1){_0x1c603b['push'](_0x1c603b['shift']());}};_0x323167(++_0x365bb9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xcb91[_0x126f47];return _0x49508a;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 291cec3..d095e49 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 _0xa8ce=['INTEGER','INBOX','exports','STRING','BOOLEAN'];(function(_0x4fc300,_0x51ecb4){var _0x318890=function(_0x5d9bc6){while(--_0x5d9bc6){_0x4fc300['push'](_0x4fc300['shift']());}};_0x318890(++_0x51ecb4);}(_0xa8ce,0x1d8));var _0xea8c=function(_0x3e4c70,_0x202c0c){_0x3e4c70=_0x3e4c70-0x0;var _0x26c67e=_0xa8ce[_0x3e4c70];return _0x26c67e;};'use strict';var Sequelize=require('sequelize');module[_0xea8c('0x0')]={'description':{'type':Sequelize[_0xea8c('0x1')]},'host':{'type':Sequelize[_0xea8c('0x1')]},'authentication':{'type':Sequelize[_0xea8c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xea8c('0x1')]},'password':{'type':Sequelize[_0xea8c('0x1')]},'port':{'type':Sequelize[_0xea8c('0x3')]},'tls':{'type':Sequelize[_0xea8c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xea8c('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xea8c('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xea8c('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1db3=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x2c6db7,_0x2e60b4){var _0x584cb5=function(_0x144d86){while(--_0x144d86){_0x2c6db7['push'](_0x2c6db7['shift']());}};_0x584cb5(++_0x2e60b4);}(_0x1db3,0x6c));var _0x31db=function(_0x5988e7,_0x85df60){_0x5988e7=_0x5988e7-0x0;var _0x255bfb=_0x1db3[_0x5988e7];return _0x255bfb;};'use strict';var Sequelize=require(_0x31db('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x31db('0x1')]},'authentication':{'type':Sequelize[_0x31db('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x31db('0x1')]},'password':{'type':Sequelize[_0x31db('0x1')]},'port':{'type':Sequelize[_0x31db('0x3')]},'tls':{'type':Sequelize[_0x31db('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x31db('0x1')],'defaultValue':_0x31db('0x4')},'connTimeout':{'type':Sequelize[_0x31db('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x31db('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x31db('0x1')]},'modernAuthentication':{'type':Sequelize[_0x31db('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7806171..5feef71 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 _0xa1e0=['util','../../config/logger','moment','bluebird','rimraf','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash'];(function(_0x5a5b05,_0x2b2b39){var _0x2d7680=function(_0xe0b893){while(--_0xe0b893){_0x5a5b05['push'](_0x5a5b05['shift']());}};_0x2d7680(++_0x2b2b39);}(_0xa1e0,0x17b));var _0x0a1e=function(_0x367058,_0x53da31){_0x367058=_0x367058-0x0;var _0x1f557a=_0xa1e0[_0x367058];return _0x1f557a;};'use strict';var _=require(_0x0a1e('0x0'));var util=require(_0x0a1e('0x1'));var logger=require(_0x0a1e('0x2'))('api');var moment=require(_0x0a1e('0x3'));var BPromise=require(_0x0a1e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a1e('0x5'));var config=require('../../config/environment');var attributes=require(_0x0a1e('0x6'));module['exports']=function(_0x54fb9a,_0x5e450e){return _0x54fb9a[_0x0a1e('0x7')](_0x0a1e('0x8'),attributes,{'tableName':_0x0a1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a51=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0x2c3d4f,_0x448a69){var _0x2dddb6=function(_0x35974e){while(--_0x35974e){_0x2c3d4f['push'](_0x2c3d4f['shift']());}};_0x2dddb6(++_0x448a69);}(_0x7a51,0x6e));var _0x17a5=function(_0x955720,_0x2f100d){_0x955720=_0x955720-0x0;var _0x545d80=_0x7a51[_0x955720];return _0x545d80;};'use strict';var _=require(_0x17a5('0x0'));var util=require(_0x17a5('0x1'));var logger=require(_0x17a5('0x2'))(_0x17a5('0x3'));var moment=require(_0x17a5('0x4'));var BPromise=require(_0x17a5('0x5'));var rp=require(_0x17a5('0x6'));var fs=require('fs');var path=require(_0x17a5('0x7'));var rimraf=require('rimraf');var config=require(_0x17a5('0x8'));var attributes=require(_0x17a5('0x9'));module[_0x17a5('0xa')]=function(_0x2caf8b,_0x29826a){return _0x2caf8b[_0x17a5('0xb')](_0x17a5('0xc'),attributes,{'tableName':_0x17a5('0xd'),'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 b2f4a31..dfdb8f1 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 _0x0eaa=['limit','include','model','attributes','map','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x5b756c,_0x3621b6){_0x5b756c=_0x5b756c-0x0;var _0x2e0952=_0x0eaa[_0x5b756c];return _0x2e0952;};'use strict';var _=require(_0xa0ea('0x0'));var util=require(_0xa0ea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0ea('0x2'));var fs=require('fs');var Redis=require(_0xa0ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0ea('0x4'));var logger=require(_0xa0ea('0x5'))(_0xa0ea('0x6'));var config=require(_0xa0ea('0x7'));var jayson=require(_0xa0ea('0x8'));var client=jayson['client'][_0xa0ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521881,_0x4b8856,_0x361178){return new BPromise(function(_0x8632a1,_0x5b2adc){return client['request'](_0x521881,_0x361178)[_0xa0ea('0xa')](function(_0x2746f2){logger[_0xa0ea('0xb')](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));logger['debug'](_0xa0ea('0xe'),_0x4b8856,_0xa0ea('0xd'),JSON[_0xa0ea('0xf')](_0x2746f2));if(_0x2746f2[_0xa0ea('0x10')]){if(_0x2746f2['error'][_0xa0ea('0x11')]===0x1f4){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x5b2adc(_0x2746f2['error'][_0xa0ea('0x12')]);}logger[_0xa0ea('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4b8856,_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);return _0x8632a1(_0x2746f2[_0xa0ea('0x10')][_0xa0ea('0x12')]);}else{logger['info'](_0xa0ea('0xc'),_0x4b8856,_0xa0ea('0xd'));_0x8632a1(_0x2746f2[_0xa0ea('0x13')][_0xa0ea('0x12')]);}})[_0xa0ea('0x14')](function(_0x34b94c){logger[_0xa0ea('0x10')](_0xa0ea('0xc'),_0x4b8856,_0x34b94c);_0x5b2adc(_0x34b94c);});});}exports[_0xa0ea('0x15')]=function(_0x405f7f){var _0x581f59=this;return new Promise(function(_0x4ca082,_0xe116e2){return db[_0xa0ea('0x16')][_0xa0ea('0x17')]({'raw':_0x405f7f[_0xa0ea('0x18')]?_0x405f7f[_0xa0ea('0x18')][_0xa0ea('0x19')]===undefined?!![]:![]:!![],'where':_0x405f7f[_0xa0ea('0x18')]?_0x405f7f['options'][_0xa0ea('0x1a')]||null:null,'attributes':_0x405f7f[_0xa0ea('0x18')]?_0x405f7f[_0xa0ea('0x18')]['attributes']||null:null,'limit':_0x405f7f[_0xa0ea('0x18')]?_0x405f7f[_0xa0ea('0x18')][_0xa0ea('0x1b')]||null:null,'include':_0x405f7f[_0xa0ea('0x18')]?_0x405f7f[_0xa0ea('0x18')][_0xa0ea('0x1c')]?_['map'](_0x405f7f[_0xa0ea('0x18')]['include'],function(_0x4d494e){return{'model':db[_0x4d494e[_0xa0ea('0x1d')]],'as':_0x4d494e['as'],'attributes':_0x4d494e[_0xa0ea('0x1e')],'include':_0x4d494e[_0xa0ea('0x1c')]?_['map'](_0x4d494e[_0xa0ea('0x1c')],function(_0x5d2d73){return{'model':db[_0x5d2d73[_0xa0ea('0x1d')]],'as':_0x5d2d73['as'],'attributes':_0x5d2d73[_0xa0ea('0x1e')],'include':_0x5d2d73[_0xa0ea('0x1c')]?_[_0xa0ea('0x1f')](_0x5d2d73[_0xa0ea('0x1c')],function(_0x3b4e62){return{'model':db[_0x3b4e62[_0xa0ea('0x1d')]],'as':_0x3b4e62['as'],'attributes':_0x3b4e62[_0xa0ea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa0ea('0xa')](function(_0x208c8){logger['info'](_0xa0ea('0x15'),_0x405f7f);logger['debug'](_0xa0ea('0x15'),_0x405f7f,JSON[_0xa0ea('0xf')](_0x208c8));_0x4ca082(_0x208c8);})[_0xa0ea('0x14')](function(_0x705022){logger[_0xa0ea('0x10')](_0xa0ea('0x15'),_0x705022['message'],_0x405f7f);_0xe116e2(_0x581f59[_0xa0ea('0x10')](0x1f4,_0x705022['message']));});});}; \ No newline at end of file +var _0x2259=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3ef608,_0x54b5e6){var _0x134799=function(_0x283501){while(--_0x283501){_0x3ef608['push'](_0x3ef608['shift']());}};_0x134799(++_0x54b5e6);}(_0x2259,0x17c));var _0x9225=function(_0xbbef7f,_0x1d3256){_0xbbef7f=_0xbbef7f-0x0;var _0x29283d=_0x2259[_0xbbef7f];return _0x29283d;};'use strict';var _=require(_0x9225('0x0'));var util=require(_0x9225('0x1'));var moment=require(_0x9225('0x2'));var BPromise=require(_0x9225('0x3'));var rs=require(_0x9225('0x4'));var fs=require('fs');var Redis=require(_0x9225('0x5'));var db=require(_0x9225('0x6'))['db'];var utils=require(_0x9225('0x7'));var logger=require('../../config/logger')(_0x9225('0x8'));var config=require(_0x9225('0x9'));var jayson=require(_0x9225('0xa'));var client=jayson[_0x9225('0xb')][_0x9225('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36bd31,_0x14d943,_0x46b110){return new BPromise(function(_0x238484,_0x17f6ea){return client[_0x9225('0xd')](_0x36bd31,_0x46b110)[_0x9225('0xe')](function(_0x49bdef){logger[_0x9225('0xf')](_0x9225('0x10'),_0x14d943,_0x9225('0x11'));logger[_0x9225('0x12')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x14d943,'request\x20sent',JSON['stringify'](_0x49bdef));if(_0x49bdef[_0x9225('0x13')]){if(_0x49bdef['error'][_0x9225('0x14')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x14d943,_0x49bdef[_0x9225('0x13')]['message']);return _0x17f6ea(_0x49bdef[_0x9225('0x13')][_0x9225('0x15')]);}logger['error'](_0x9225('0x10'),_0x14d943,_0x49bdef[_0x9225('0x13')][_0x9225('0x15')]);return _0x238484(_0x49bdef[_0x9225('0x13')][_0x9225('0x15')]);}else{logger['info'](_0x9225('0x10'),_0x14d943,_0x9225('0x11'));_0x238484(_0x49bdef[_0x9225('0x16')][_0x9225('0x15')]);}})[_0x9225('0x17')](function(_0x4c385d){logger[_0x9225('0x13')](_0x9225('0x10'),_0x14d943,_0x4c385d);_0x17f6ea(_0x4c385d);});});}exports[_0x9225('0x18')]=function(_0x4a0463){var _0x400e97=this;return new Promise(function(_0xf97e8,_0x5329bb){return db[_0x9225('0x19')][_0x9225('0x1a')]({'raw':_0x4a0463['options']?_0x4a0463[_0x9225('0x1b')][_0x9225('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a0463[_0x9225('0x1b')]?_0x4a0463['options'][_0x9225('0x1d')]||null:null,'attributes':_0x4a0463[_0x9225('0x1b')]?_0x4a0463[_0x9225('0x1b')]['attributes']||null:null,'limit':_0x4a0463[_0x9225('0x1b')]?_0x4a0463['options'][_0x9225('0x1e')]||null:null,'include':_0x4a0463['options']?_0x4a0463[_0x9225('0x1b')][_0x9225('0x1f')]?_[_0x9225('0x20')](_0x4a0463[_0x9225('0x1b')][_0x9225('0x1f')],function(_0x4c57dc){return{'model':db[_0x4c57dc[_0x9225('0x21')]],'as':_0x4c57dc['as'],'attributes':_0x4c57dc[_0x9225('0x22')],'include':_0x4c57dc[_0x9225('0x1f')]?_[_0x9225('0x20')](_0x4c57dc[_0x9225('0x1f')],function(_0xde65d4){return{'model':db[_0xde65d4['model']],'as':_0xde65d4['as'],'attributes':_0xde65d4[_0x9225('0x22')],'include':_0xde65d4[_0x9225('0x1f')]?_[_0x9225('0x20')](_0xde65d4['include'],function(_0xe52116){return{'model':db[_0xe52116[_0x9225('0x21')]],'as':_0xe52116['as'],'attributes':_0xe52116[_0x9225('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9225('0xe')](function(_0x1b4959){logger[_0x9225('0xf')](_0x9225('0x18'),_0x4a0463);logger[_0x9225('0x12')](_0x9225('0x18'),_0x4a0463,JSON[_0x9225('0x23')](_0x1b4959));_0xf97e8(_0x1b4959);})[_0x9225('0x17')](function(_0x27c8eb){logger[_0x9225('0x13')](_0x9225('0x18'),_0x27c8eb[_0x9225('0x15')],_0x4a0463);_0x5329bb(_0x400e97[_0x9225('0x13')](0x1f4,_0x27c8eb[_0x9225('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7500025..1715663 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a54,0x106));var _0x47a5=function(_0x420540,_0x15a734){_0x420540=_0x420540-0x0;var _0x51dbd1=_0x7a54[_0x420540];return _0x51dbd1;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _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(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 066c19f..490c279 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 _0xeffd=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x1328bf,_0x1cc5d0){var _0x1a6f27=function(_0x36992f){while(--_0x36992f){_0x1328bf['push'](_0x1328bf['shift']());}};_0x1a6f27(++_0x1cc5d0);}(_0xeffd,0x6b));var _0xdeff=function(_0x190f12,_0x32e3ca){_0x190f12=_0x190f12-0x0;var _0x1ebfd9=_0xeffd[_0x190f12];return _0x1ebfd9;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'description':{'type':Sequelize[_0xdeff('0x1')]},'host':{'type':Sequelize[_0xdeff('0x1')]},'user':{'type':Sequelize[_0xdeff('0x1')]},'pass':{'type':Sequelize[_0xdeff('0x1')]},'port':{'type':Sequelize[_0xdeff('0x2')]},'secure':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xdeff('0x1')]},'authentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8603=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x48f316,_0x214969){var _0x4c0030=function(_0xbeb449){while(--_0xbeb449){_0x48f316['push'](_0x48f316['shift']());}};_0x4c0030(++_0x214969);}(_0x8603,0x190));var _0x3860=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x8603[_0x2605dc];return _0x4568c9;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'description':{'type':Sequelize[_0x3860('0x1')]},'host':{'type':Sequelize[_0x3860('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3860('0x2')]},'secure':{'type':Sequelize[_0x3860('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x3860('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3860('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index b9d390f..2f8c44f 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 _0xb3f2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0xb3f2,0x116));var _0x2b3f=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xb3f2[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x2b3f('0x0'));var rimraf=require(_0x2b3f('0x1'));var zipdir=require(_0x2b3f('0x2'));var jsonpatch=require(_0x2b3f('0x3'));var rp=require(_0x2b3f('0x4'));var moment=require(_0x2b3f('0x5'));var BPromise=require(_0x2b3f('0x6'));var Mustache=require(_0x2b3f('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2b3f('0x8'));var ejs=require(_0x2b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x2b3f('0xa'));var _=require(_0x2b3f('0xb'));var squel=require('squel');var crypto=require(_0x2b3f('0xc'));var jsforce=require(_0x2b3f('0xd'));var deskjs=require(_0x2b3f('0xe'));var toCsv=require(_0x2b3f('0x8'));var querystring=require(_0x2b3f('0xf'));var Papa=require(_0x2b3f('0x10'));var Redis=require(_0x2b3f('0x11'));var authService=require(_0x2b3f('0x12'));var qs=require(_0x2b3f('0x13'));var as=require(_0x2b3f('0x14'));var hardwareService=require(_0x2b3f('0x15'));var logger=require(_0x2b3f('0x16'))(_0x2b3f('0x17'));var utils=require('../../config/utils');var config=require(_0x2b3f('0x18'));var licenseUtil=require(_0x2b3f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xacc982,_0x60de03){_0x60de03=_0x60de03||0xcc;return function(_0x28b753){if(_0x28b753){return _0xacc982[_0x2b3f('0x1a')](_0x60de03);}return _0xacc982['status'](_0x60de03)['end']();};}function respondWithResult(_0x45be12,_0x287d73){_0x287d73=_0x287d73||0xc8;return function(_0x37121f){if(_0x37121f){return _0x45be12[_0x2b3f('0x1b')](_0x287d73)[_0x2b3f('0x1c')](_0x37121f);}};}function respondWithFilteredResult(_0x5283da,_0x1c3573){return function(_0x5d5393){if(_0x5d5393){var _0x250634=typeof _0x1c3573[_0x2b3f('0x1d')]==='undefined'&&typeof _0x1c3573[_0x2b3f('0x1e')]==='undefined';var _0x4e6966=_0x5d5393[_0x2b3f('0x1f')];var _0x121e55=_0x250634?0x0:_0x1c3573[_0x2b3f('0x1d')];var _0x3378f7=_0x250634?_0x5d5393[_0x2b3f('0x1f')]:_0x1c3573[_0x2b3f('0x1d')]+_0x1c3573[_0x2b3f('0x1e')];var _0x67bb04;if(_0x3378f7>=_0x4e6966){_0x3378f7=_0x4e6966;_0x67bb04=0xc8;}else{_0x67bb04=0xce;}_0x5283da[_0x2b3f('0x1b')](_0x67bb04);return _0x5283da[_0x2b3f('0x20')](_0x2b3f('0x21'),_0x121e55+'-'+_0x3378f7+'/'+_0x4e6966)[_0x2b3f('0x1c')](_0x5d5393);}return null;};}function patchUpdates(_0x5f15df){return function(_0x3612d5){try{jsonpatch[_0x2b3f('0x22')](_0x3612d5,_0x5f15df,!![]);}catch(_0x3cc913){return BPromise[_0x2b3f('0x23')](_0x3cc913);}return _0x3612d5[_0x2b3f('0x24')]();};}function saveUpdates(_0x382835,_0x509477){return function(_0x27d515){if(_0x27d515){return _0x27d515[_0x2b3f('0x25')](_0x382835)[_0x2b3f('0x26')](function(_0x2d3a0e){return _0x2d3a0e;});}return null;};}function removeEntity(_0x325ab9,_0x325915){return function(_0x16b841){if(_0x16b841){return _0x16b841[_0x2b3f('0x27')]()[_0x2b3f('0x26')](function(){_0x325ab9[_0x2b3f('0x1b')](0xcc)[_0x2b3f('0x28')]();});}};}function handleEntityNotFound(_0x1dca3f,_0x32c1d1){return function(_0x5befb9){if(!_0x5befb9){_0x1dca3f[_0x2b3f('0x1a')](0x194);}return _0x5befb9;};}function handleError(_0x35c7cc,_0xc86987){_0xc86987=_0xc86987||0x1f4;return function(_0x286237){logger['error'](_0x286237['stack']);if(_0x286237[_0x2b3f('0x29')]){delete _0x286237[_0x2b3f('0x29')];}_0x35c7cc['status'](_0xc86987)[_0x2b3f('0x2a')](_0x286237);};}exports[_0x2b3f('0x2b')]=function(_0x5c9e6f,_0x29ea3d){var _0x36b4c2={},_0x176d97={},_0x4626e5={'count':0x0,'rows':[]};var _0x4bd8a8=_[_0x2b3f('0x2c')](db[_0x2b3f('0x2d')][_0x2b3f('0x2e')],function(_0x14b878){return{'name':_0x14b878['fieldName'],'type':_0x14b878[_0x2b3f('0x2f')][_0x2b3f('0x30')]};});_0x176d97[_0x2b3f('0x31')]=_[_0x2b3f('0x2c')](_0x4bd8a8,_0x2b3f('0x29'));_0x176d97['query']=_[_0x2b3f('0x32')](_0x5c9e6f[_0x2b3f('0x33')]);_0x176d97[_0x2b3f('0x34')]=_[_0x2b3f('0x35')](_0x176d97['model'],_0x176d97['query']);_0x36b4c2[_0x2b3f('0x36')]=_[_0x2b3f('0x35')](_0x176d97['model'],qs[_0x2b3f('0x37')](_0x5c9e6f[_0x2b3f('0x33')]['fields']));_0x36b4c2[_0x2b3f('0x36')]=_0x36b4c2[_0x2b3f('0x36')][_0x2b3f('0x38')]?_0x36b4c2[_0x2b3f('0x36')]:_0x176d97[_0x2b3f('0x31')];if(!_0x5c9e6f[_0x2b3f('0x33')]['hasOwnProperty'](_0x2b3f('0x39'))){_0x36b4c2[_0x2b3f('0x1e')]=qs[_0x2b3f('0x1e')](_0x5c9e6f[_0x2b3f('0x33')]['limit']);_0x36b4c2[_0x2b3f('0x1d')]=qs['offset'](_0x5c9e6f[_0x2b3f('0x33')][_0x2b3f('0x1d')]);}_0x36b4c2['order']=qs['sort'](_0x5c9e6f['query'][_0x2b3f('0x3a')]);_0x36b4c2[_0x2b3f('0x3b')]=qs[_0x2b3f('0x34')](_[_0x2b3f('0x3c')](_0x5c9e6f[_0x2b3f('0x33')],_0x176d97[_0x2b3f('0x34')]),_0x4bd8a8);if(_0x5c9e6f['query']['filter']){_0x36b4c2[_0x2b3f('0x3b')]=_[_0x2b3f('0x3d')](_0x36b4c2[_0x2b3f('0x3b')],{'$or':_[_0x2b3f('0x2c')](_0x4bd8a8,function(_0x4d64ce){if(_0x4d64ce[_0x2b3f('0x2f')]!==_0x2b3f('0x3e')){var _0x44c4c5={};_0x44c4c5[_0x4d64ce['name']]={'$like':'%'+_0x5c9e6f[_0x2b3f('0x33')]['filter']+'%'};return _0x44c4c5;}})});}_0x36b4c2=_[_0x2b3f('0x3d')]({},_0x36b4c2,_0x5c9e6f[_0x2b3f('0x3f')]);var _0xdc456b={'where':_0x36b4c2[_0x2b3f('0x3b')]};return db['MailServerOut']['count'](_0xdc456b)[_0x2b3f('0x26')](function(_0x28586e){_0x4626e5[_0x2b3f('0x1f')]=_0x28586e;if(_0x5c9e6f[_0x2b3f('0x33')][_0x2b3f('0x40')]){_0x36b4c2['include']=[{'all':!![]}];}return db[_0x2b3f('0x2d')][_0x2b3f('0x41')](_0x36b4c2);})[_0x2b3f('0x26')](function(_0x45e1a5){_0x4626e5[_0x2b3f('0x42')]=_0x45e1a5;return _0x4626e5;})[_0x2b3f('0x26')](respondWithFilteredResult(_0x29ea3d,_0x36b4c2))[_0x2b3f('0x43')](handleError(_0x29ea3d,null));};exports[_0x2b3f('0x44')]=function(_0xb9b1c4,_0x1aba07){var _0x4eaa3c={'raw':!![],'where':{'id':_0xb9b1c4[_0x2b3f('0x45')]['id']}},_0x2a60b4={};_0x2a60b4['model']=_['keys'](db[_0x2b3f('0x2d')][_0x2b3f('0x2e')]);_0x2a60b4[_0x2b3f('0x33')]=_[_0x2b3f('0x32')](_0xb9b1c4[_0x2b3f('0x33')]);_0x2a60b4[_0x2b3f('0x34')]=_['intersection'](_0x2a60b4['model'],_0x2a60b4[_0x2b3f('0x33')]);_0x4eaa3c['attributes']=_[_0x2b3f('0x35')](_0x2a60b4[_0x2b3f('0x31')],qs[_0x2b3f('0x37')](_0xb9b1c4[_0x2b3f('0x33')][_0x2b3f('0x37')]));_0x4eaa3c['attributes']=_0x4eaa3c[_0x2b3f('0x36')][_0x2b3f('0x38')]?_0x4eaa3c[_0x2b3f('0x36')]:_0x2a60b4[_0x2b3f('0x31')];if(_0xb9b1c4[_0x2b3f('0x33')][_0x2b3f('0x40')]){_0x4eaa3c[_0x2b3f('0x46')]=[{'all':!![]}];}_0x4eaa3c=_[_0x2b3f('0x3d')]({},_0x4eaa3c,_0xb9b1c4['options']);return db[_0x2b3f('0x2d')][_0x2b3f('0x47')](_0x4eaa3c)['then'](handleEntityNotFound(_0x1aba07,null))[_0x2b3f('0x26')](respondWithResult(_0x1aba07,null))['catch'](handleError(_0x1aba07,null));};exports[_0x2b3f('0x48')]=function(_0x44da99,_0x4272d9){return db[_0x2b3f('0x2d')][_0x2b3f('0x48')](_0x44da99[_0x2b3f('0x49')],{})[_0x2b3f('0x26')](respondWithResult(_0x4272d9,0xc9))['catch'](handleError(_0x4272d9,null));};exports[_0x2b3f('0x25')]=function(_0x5311eb,_0x536a51){if(_0x5311eb[_0x2b3f('0x49')]['id']){delete _0x5311eb[_0x2b3f('0x49')]['id'];}return db[_0x2b3f('0x2d')]['find']({'where':{'id':_0x5311eb[_0x2b3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x536a51,null))[_0x2b3f('0x26')](saveUpdates(_0x5311eb['body'],null))[_0x2b3f('0x26')](respondWithResult(_0x536a51,null))['catch'](handleError(_0x536a51,null));};exports['destroy']=function(_0x5a6a3c,_0x328175){return db['MailServerOut']['find']({'where':{'id':_0x5a6a3c[_0x2b3f('0x45')]['id']}})[_0x2b3f('0x26')](handleEntityNotFound(_0x328175,null))[_0x2b3f('0x26')](removeEntity(_0x328175,null))[_0x2b3f('0x43')](handleError(_0x328175,null));}; \ No newline at end of file +var _0xe762=['params','intersection','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','MailServerOut','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x50c599,_0x21de75){var _0x245ca1=function(_0x3a1de8){while(--_0x3a1de8){_0x50c599['push'](_0x50c599['shift']());}};_0x245ca1(++_0x21de75);}(_0xe762,0x1ce));var _0x2e76=function(_0x5d7369,_0x424daa){_0x5d7369=_0x5d7369-0x0;var _0x39bb06=_0xe762[_0x5d7369];return _0x39bb06;};'use strict';var emlformat=require(_0x2e76('0x0'));var rimraf=require(_0x2e76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e76('0x2'));var rp=require(_0x2e76('0x3'));var moment=require(_0x2e76('0x4'));var BPromise=require(_0x2e76('0x5'));var Mustache=require(_0x2e76('0x6'));var util=require(_0x2e76('0x7'));var path=require(_0x2e76('0x8'));var sox=require(_0x2e76('0x9'));var csv=require('to-csv');var ejs=require(_0x2e76('0xa'));var fs=require('fs');var fs_extra=require(_0x2e76('0xb'));var _=require('lodash');var squel=require(_0x2e76('0xc'));var crypto=require(_0x2e76('0xd'));var jsforce=require(_0x2e76('0xe'));var deskjs=require(_0x2e76('0xf'));var toCsv=require(_0x2e76('0x10'));var querystring=require(_0x2e76('0x11'));var Papa=require(_0x2e76('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2e76('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e76('0x14'));var logger=require(_0x2e76('0x15'))(_0x2e76('0x16'));var utils=require(_0x2e76('0x17'));var config=require(_0x2e76('0x18'));var licenseUtil=require(_0x2e76('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23d932,_0x17e5d3){_0x17e5d3=_0x17e5d3||0xcc;return function(_0x39e912){if(_0x39e912){return _0x23d932[_0x2e76('0x1a')](_0x17e5d3);}return _0x23d932[_0x2e76('0x1b')](_0x17e5d3)[_0x2e76('0x1c')]();};}function respondWithResult(_0xfacfec,_0x7d8090){_0x7d8090=_0x7d8090||0xc8;return function(_0x2e37e0){if(_0x2e37e0){return _0xfacfec[_0x2e76('0x1b')](_0x7d8090)['json'](_0x2e37e0);}};}function respondWithFilteredResult(_0x23cdfa,_0x341c78){return function(_0x2a34e0){if(_0x2a34e0){var _0x1ccb23=typeof _0x341c78['offset']==='undefined'&&typeof _0x341c78[_0x2e76('0x1d')]===_0x2e76('0x1e');var _0x555088=_0x2a34e0[_0x2e76('0x1f')];var _0xf97e89=_0x1ccb23?0x0:_0x341c78['offset'];var _0x38e015=_0x1ccb23?_0x2a34e0[_0x2e76('0x1f')]:_0x341c78[_0x2e76('0x20')]+_0x341c78[_0x2e76('0x1d')];var _0x209f6e;if(_0x38e015>=_0x555088){_0x38e015=_0x555088;_0x209f6e=0xc8;}else{_0x209f6e=0xce;}_0x23cdfa['status'](_0x209f6e);return _0x23cdfa[_0x2e76('0x21')](_0x2e76('0x22'),_0xf97e89+'-'+_0x38e015+'/'+_0x555088)[_0x2e76('0x23')](_0x2a34e0);}return null;};}function patchUpdates(_0x272037){return function(_0x3d5556){try{jsonpatch[_0x2e76('0x24')](_0x3d5556,_0x272037,!![]);}catch(_0x349e96){return BPromise[_0x2e76('0x25')](_0x349e96);}return _0x3d5556['save']();};}function saveUpdates(_0x2d15d1,_0x2623e6){return function(_0x515a24){if(_0x515a24){return _0x515a24[_0x2e76('0x26')](_0x2d15d1)[_0x2e76('0x27')](function(_0x47fd20){return _0x47fd20;});}return null;};}function removeEntity(_0x30fa40,_0x228e12){return function(_0x74f77d){if(_0x74f77d){return _0x74f77d[_0x2e76('0x28')]()['then'](function(){_0x30fa40[_0x2e76('0x1b')](0xcc)[_0x2e76('0x1c')]();});}};}function handleEntityNotFound(_0x5d13a4,_0x126960){return function(_0x2ca240){if(!_0x2ca240){_0x5d13a4[_0x2e76('0x1a')](0x194);}return _0x2ca240;};}function handleError(_0x53c1d2,_0x34a317){_0x34a317=_0x34a317||0x1f4;return function(_0x404443){logger[_0x2e76('0x29')](_0x404443[_0x2e76('0x2a')]);if(_0x404443[_0x2e76('0x2b')]){delete _0x404443['name'];}_0x53c1d2[_0x2e76('0x1b')](_0x34a317)[_0x2e76('0x2c')](_0x404443);};}exports['index']=function(_0x392592,_0x447468){var _0x36ad3e={},_0x40a0a0={},_0x247d11={'count':0x0,'rows':[]};var _0x2ae8dd=_[_0x2e76('0x2d')](db[_0x2e76('0x2e')]['rawAttributes'],function(_0x2406ac){return{'name':_0x2406ac[_0x2e76('0x2f')],'type':_0x2406ac[_0x2e76('0x30')][_0x2e76('0x31')]};});_0x40a0a0[_0x2e76('0x32')]=_[_0x2e76('0x2d')](_0x2ae8dd,_0x2e76('0x2b'));_0x40a0a0[_0x2e76('0x33')]=_[_0x2e76('0x34')](_0x392592['query']);_0x40a0a0[_0x2e76('0x35')]=_['intersection'](_0x40a0a0[_0x2e76('0x32')],_0x40a0a0['query']);_0x36ad3e[_0x2e76('0x36')]=_['intersection'](_0x40a0a0[_0x2e76('0x32')],qs[_0x2e76('0x37')](_0x392592['query'][_0x2e76('0x37')]));_0x36ad3e[_0x2e76('0x36')]=_0x36ad3e[_0x2e76('0x36')][_0x2e76('0x38')]?_0x36ad3e[_0x2e76('0x36')]:_0x40a0a0[_0x2e76('0x32')];if(!_0x392592[_0x2e76('0x33')]['hasOwnProperty'](_0x2e76('0x39'))){_0x36ad3e['limit']=qs[_0x2e76('0x1d')](_0x392592[_0x2e76('0x33')]['limit']);_0x36ad3e[_0x2e76('0x20')]=qs[_0x2e76('0x20')](_0x392592[_0x2e76('0x33')][_0x2e76('0x20')]);}_0x36ad3e[_0x2e76('0x3a')]=qs['sort'](_0x392592[_0x2e76('0x33')][_0x2e76('0x3b')]);_0x36ad3e[_0x2e76('0x3c')]=qs[_0x2e76('0x35')](_[_0x2e76('0x3d')](_0x392592[_0x2e76('0x33')],_0x40a0a0[_0x2e76('0x35')]),_0x2ae8dd);if(_0x392592[_0x2e76('0x33')][_0x2e76('0x3e')]){_0x36ad3e[_0x2e76('0x3c')]=_[_0x2e76('0x3f')](_0x36ad3e[_0x2e76('0x3c')],{'$or':_[_0x2e76('0x2d')](_0x2ae8dd,function(_0x1c88af){if(_0x1c88af[_0x2e76('0x30')]!==_0x2e76('0x40')){var _0x18f6e6={};_0x18f6e6[_0x1c88af['name']]={'$like':'%'+_0x392592[_0x2e76('0x33')]['filter']+'%'};return _0x18f6e6;}})});}_0x36ad3e=_[_0x2e76('0x3f')]({},_0x36ad3e,_0x392592[_0x2e76('0x41')]);var _0x47e939={'where':_0x36ad3e[_0x2e76('0x3c')]};return db[_0x2e76('0x2e')][_0x2e76('0x1f')](_0x47e939)['then'](function(_0x1cc22e){_0x247d11[_0x2e76('0x1f')]=_0x1cc22e;if(_0x392592[_0x2e76('0x33')]['includeAll']){_0x36ad3e[_0x2e76('0x42')]=[{'all':!![]}];}return db[_0x2e76('0x2e')][_0x2e76('0x43')](_0x36ad3e);})['then'](function(_0x24d8d0){_0x247d11[_0x2e76('0x44')]=_0x24d8d0;return _0x247d11;})['then'](respondWithFilteredResult(_0x447468,_0x36ad3e))[_0x2e76('0x45')](handleError(_0x447468,null));};exports['show']=function(_0x1aa569,_0x28acdb){var _0x1d5d47={'raw':!![],'where':{'id':_0x1aa569[_0x2e76('0x46')]['id']}},_0x56ac1d={};_0x56ac1d[_0x2e76('0x32')]=_[_0x2e76('0x34')](db['MailServerOut']['rawAttributes']);_0x56ac1d[_0x2e76('0x33')]=_[_0x2e76('0x34')](_0x1aa569['query']);_0x56ac1d[_0x2e76('0x35')]=_['intersection'](_0x56ac1d['model'],_0x56ac1d[_0x2e76('0x33')]);_0x1d5d47[_0x2e76('0x36')]=_[_0x2e76('0x47')](_0x56ac1d[_0x2e76('0x32')],qs[_0x2e76('0x37')](_0x1aa569[_0x2e76('0x33')][_0x2e76('0x37')]));_0x1d5d47['attributes']=_0x1d5d47['attributes']['length']?_0x1d5d47[_0x2e76('0x36')]:_0x56ac1d[_0x2e76('0x32')];if(_0x1aa569[_0x2e76('0x33')][_0x2e76('0x48')]){_0x1d5d47[_0x2e76('0x42')]=[{'all':!![]}];}_0x1d5d47=_[_0x2e76('0x3f')]({},_0x1d5d47,_0x1aa569[_0x2e76('0x41')]);return db[_0x2e76('0x2e')][_0x2e76('0x49')](_0x1d5d47)[_0x2e76('0x27')](handleEntityNotFound(_0x28acdb,null))[_0x2e76('0x27')](respondWithResult(_0x28acdb,null))[_0x2e76('0x45')](handleError(_0x28acdb,null));};exports[_0x2e76('0x4a')]=function(_0xe6847a,_0x176996){return db[_0x2e76('0x2e')]['create'](_0xe6847a[_0x2e76('0x4b')],{})[_0x2e76('0x27')](respondWithResult(_0x176996,0xc9))[_0x2e76('0x45')](handleError(_0x176996,null));};exports[_0x2e76('0x26')]=function(_0x3229e6,_0x3c71ef){if(_0x3229e6[_0x2e76('0x4b')]['id']){delete _0x3229e6[_0x2e76('0x4b')]['id'];}return db[_0x2e76('0x2e')]['find']({'where':{'id':_0x3229e6[_0x2e76('0x46')]['id']}})[_0x2e76('0x27')](handleEntityNotFound(_0x3c71ef,null))[_0x2e76('0x27')](saveUpdates(_0x3229e6['body'],null))[_0x2e76('0x27')](respondWithResult(_0x3c71ef,null))[_0x2e76('0x45')](handleError(_0x3c71ef,null));};exports[_0x2e76('0x28')]=function(_0x42590b,_0x2f0461){return db[_0x2e76('0x2e')][_0x2e76('0x49')]({'where':{'id':_0x42590b[_0x2e76('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f0461,null))[_0x2e76('0x27')](removeEntity(_0x2f0461,null))[_0x2e76('0x45')](handleError(_0x2f0461,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d779e43..553cc2c 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 _0xc1dc=['MailServerOut','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x5618d6,_0x41e5ed){var _0x50e819=function(_0x52875e){while(--_0x52875e){_0x5618d6['push'](_0x5618d6['shift']());}};_0x50e819(++_0x41e5ed);}(_0xc1dc,0x155));var _0xcc1d=function(_0x4f55ca,_0x57b6a1){_0x4f55ca=_0x4f55ca-0x0;var _0x389d66=_0xc1dc[_0x4f55ca];return _0x389d66;};'use strict';var _=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var logger=require(_0xcc1d('0x2'))(_0xcc1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc1d('0x5'));var config=require(_0xcc1d('0x6'));var attributes=require(_0xcc1d('0x7'));module[_0xcc1d('0x8')]=function(_0xf3fbe,_0x3ce555){return _0xf3fbe['define'](_0xcc1d('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77b6=['exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','./mailServerOut.attributes'];(function(_0x1381c6,_0x33d826){var _0x35a1c8=function(_0x1af81f){while(--_0x1af81f){_0x1381c6['push'](_0x1381c6['shift']());}};_0x35a1c8(++_0x33d826);}(_0x77b6,0x1e8));var _0x677b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x77b6[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x677b('0x0'));var util=require('util');var logger=require(_0x677b('0x1'))(_0x677b('0x2'));var moment=require(_0x677b('0x3'));var BPromise=require(_0x677b('0x4'));var rp=require(_0x677b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x677b('0x6'));module[_0x677b('0x7')]=function(_0x5bee5b,_0x554c1a){return _0x5bee5b[_0x677b('0x8')](_0x677b('0x9'),attributes,{'tableName':_0x677b('0xa'),'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 7b78332..2801c3a 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1608cc,_0x50aae9){var _0x150b3e=function(_0x35ffbb){while(--_0x35ffbb){_0x1608cc['push'](_0x1608cc['shift']());}};_0x150b3e(++_0x50aae9);}(_0xdb28,0x106));var _0x8db2=function(_0x27a0de,_0x57da30){_0x27a0de=_0x27a0de-0x0;var _0x1499be=_0xdb28[_0x27a0de];return _0x1499be;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +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(_0x4db851,_0x1e0498){var _0x5c2312=function(_0x11608c){while(--_0x11608c){_0x4db851['push'](_0x4db851['shift']());}};_0x5c2312(++_0x1e0498);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 1e63c58..1a5dfa6 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 _0x2810=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','index','get','/describe','isAuthenticated','post','create','update','delete','/:id','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x2810,0xb8));var _0x0281=function(_0x214747,_0x13fc3d){_0x214747=_0x214747-0x0;var _0x4dfcef=_0x2810[_0x214747];return _0x4dfcef;};'use strict';var multer=require(_0x0281('0x0'));var util=require(_0x0281('0x1'));var path=require(_0x0281('0x2'));var timeout=require('connect-timeout');var express=require(_0x0281('0x3'));var router=express['Router']();var fs_extra=require(_0x0281('0x4'));var auth=require(_0x0281('0x5'));var interaction=require(_0x0281('0x6'));var config=require(_0x0281('0x7'));var controller=require(_0x0281('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0281('0x9')]);router[_0x0281('0xa')](_0x0281('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0281('0xa')]('/:id',auth[_0x0281('0xc')](),controller['show']);router[_0x0281('0xd')]('/',auth[_0x0281('0xc')](),controller[_0x0281('0xe')]);router['put']('/:id',auth[_0x0281('0xc')](),controller[_0x0281('0xf')]);router[_0x0281('0x10')](_0x0281('0x11'),auth[_0x0281('0xc')](),controller['destroy']);module[_0x0281('0x12')]=router; \ No newline at end of file +var _0x85d8=['Router','fs-extra','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','express'];(function(_0x5f5de7,_0x299738){var _0x16c33d=function(_0x49e75c){while(--_0x49e75c){_0x5f5de7['push'](_0x5f5de7['shift']());}};_0x16c33d(++_0x299738);}(_0x85d8,0xd6));var _0x885d=function(_0x3456bf,_0x25d8d8){_0x3456bf=_0x3456bf-0x0;var _0x5191a5=_0x85d8[_0x3456bf];return _0x5191a5;};'use strict';var multer=require(_0x885d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x885d('0x1'));var router=express[_0x885d('0x2')]();var fs_extra=require(_0x885d('0x3'));var auth=require(_0x885d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x885d('0x5'));router[_0x885d('0x6')]('/',auth[_0x885d('0x7')](),controller[_0x885d('0x8')]);router['get'](_0x885d('0x9'),auth[_0x885d('0x7')](),controller[_0x885d('0xa')]);router[_0x885d('0x6')](_0x885d('0xb'),auth[_0x885d('0x7')](),controller[_0x885d('0xc')]);router['post']('/',auth[_0x885d('0x7')](),controller['create']);router[_0x885d('0xd')](_0x885d('0xb'),auth[_0x885d('0x7')](),controller[_0x885d('0xe')]);router[_0x885d('0xf')]('/:id',auth[_0x885d('0x7')](),controller[_0x885d('0x10')]);module[_0x885d('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 130c170..a65264e 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 _0x06f4=['name','STRING','sequelize','exports'];(function(_0x20f5ff,_0x519f7d){var _0x5ce199=function(_0x2be018){while(--_0x2be018){_0x20f5ff['push'](_0x20f5ff['shift']());}};_0x5ce199(++_0x519f7d);}(_0x06f4,0x136));var _0x406f=function(_0xb0cb31,_0x23d6a2){_0xb0cb31=_0xb0cb31-0x0;var _0x5eeb4d=_0x06f4[_0xb0cb31];return _0x5eeb4d;};'use strict';var Sequelize=require(_0x406f('0x0'));module[_0x406f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x406f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x406f('0x3')]}}; \ No newline at end of file +var _0xb4c7=['STRING','name','sequelize','exports'];(function(_0x70051f,_0x1b734c){var _0x1c8f86=function(_0xa87282){while(--_0xa87282){_0x70051f['push'](_0x70051f['shift']());}};_0x1c8f86(++_0x1b734c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x552b6b,_0xea582){_0x552b6b=_0x552b6b-0x0;var _0x4ae68a=_0xb4c7[_0x552b6b];return _0x4ae68a;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'unique':_0x7b4c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b4c('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d7d1bff..1c16f89 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 _0x84ad=['findAll','rows','show','params','includeAll','include','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x84ad,0x18c));var _0xd84a=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x84ad[_0x487496];return _0x539dc8;};'use strict';var emlformat=require(_0xd84a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd84a('0x1'));var jsonpatch=require(_0xd84a('0x2'));var rp=require(_0xd84a('0x3'));var moment=require('moment');var BPromise=require(_0xd84a('0x4'));var Mustache=require(_0xd84a('0x5'));var util=require(_0xd84a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd84a('0x7'));var fs=require('fs');var fs_extra=require(_0xd84a('0x8'));var _=require(_0xd84a('0x9'));var squel=require('squel');var crypto=require(_0xd84a('0xa'));var jsforce=require(_0xd84a('0xb'));var deskjs=require(_0xd84a('0xc'));var toCsv=require(_0xd84a('0xd'));var querystring=require(_0xd84a('0xe'));var Papa=require('papaparse');var Redis=require(_0xd84a('0xf'));var authService=require(_0xd84a('0x10'));var qs=require(_0xd84a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd84a('0x12'));var logger=require(_0xd84a('0x13'))(_0xd84a('0x14'));var utils=require(_0xd84a('0x15'));var config=require(_0xd84a('0x16'));var licenseUtil=require(_0xd84a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3cea,_0x3bb0b9){_0x3bb0b9=_0x3bb0b9||0xcc;return function(_0x3c47b4){if(_0x3c47b4){return _0x5b3cea[_0xd84a('0x18')](_0x3bb0b9);}return _0x5b3cea['status'](_0x3bb0b9)['end']();};}function respondWithResult(_0x507bc6,_0x4004e0){_0x4004e0=_0x4004e0||0xc8;return function(_0x12d995){if(_0x12d995){return _0x507bc6[_0xd84a('0x19')](_0x4004e0)[_0xd84a('0x1a')](_0x12d995);}};}function respondWithFilteredResult(_0x232fd4,_0x550ac6){return function(_0x483b2d){if(_0x483b2d){var _0x5ef893=typeof _0x550ac6[_0xd84a('0x1b')]==='undefined'&&typeof _0x550ac6['limit']===_0xd84a('0x1c');var _0x5de6d2=_0x483b2d[_0xd84a('0x1d')];var _0xe4aa02=_0x5ef893?0x0:_0x550ac6[_0xd84a('0x1b')];var _0x22e8cb=_0x5ef893?_0x483b2d['count']:_0x550ac6['offset']+_0x550ac6['limit'];var _0x45cc09;if(_0x22e8cb>=_0x5de6d2){_0x22e8cb=_0x5de6d2;_0x45cc09=0xc8;}else{_0x45cc09=0xce;}_0x232fd4[_0xd84a('0x19')](_0x45cc09);return _0x232fd4[_0xd84a('0x1e')](_0xd84a('0x1f'),_0xe4aa02+'-'+_0x22e8cb+'/'+_0x5de6d2)[_0xd84a('0x1a')](_0x483b2d);}return null;};}function patchUpdates(_0x265d92){return function(_0x1c21a7){try{jsonpatch[_0xd84a('0x20')](_0x1c21a7,_0x265d92,!![]);}catch(_0x20c5a0){return BPromise['reject'](_0x20c5a0);}return _0x1c21a7[_0xd84a('0x21')]();};}function saveUpdates(_0x1ec407,_0x2df2ee){return function(_0x30cf3e){if(_0x30cf3e){return _0x30cf3e['update'](_0x1ec407)[_0xd84a('0x22')](function(_0x3af83c){return _0x3af83c;});}return null;};}function removeEntity(_0x589243,_0x9d1033){return function(_0xd693b3){if(_0xd693b3){return _0xd693b3[_0xd84a('0x23')]()[_0xd84a('0x22')](function(){_0x589243[_0xd84a('0x19')](0xcc)[_0xd84a('0x24')]();});}};}function handleEntityNotFound(_0x2c5647,_0x2aaea5){return function(_0xf24dfe){if(!_0xf24dfe){_0x2c5647['sendStatus'](0x194);}return _0xf24dfe;};}function handleError(_0xbc5d01,_0xb1f5a8){_0xb1f5a8=_0xb1f5a8||0x1f4;return function(_0x209318){logger[_0xd84a('0x25')](_0x209318[_0xd84a('0x26')]);if(_0x209318[_0xd84a('0x27')]){delete _0x209318[_0xd84a('0x27')];}_0xbc5d01[_0xd84a('0x19')](_0xb1f5a8)[_0xd84a('0x28')](_0x209318);};}exports['index']=function(_0x34f35e,_0x23124d){var _0x356c18={},_0x38f065={},_0x400efe={'count':0x0,'rows':[]};var _0x3e35bf=_[_0xd84a('0x29')](db[_0xd84a('0x2a')][_0xd84a('0x2b')],function(_0x533e9e){return{'name':_0x533e9e[_0xd84a('0x2c')],'type':_0x533e9e['type'][_0xd84a('0x2d')]};});_0x38f065[_0xd84a('0x2e')]=_[_0xd84a('0x29')](_0x3e35bf,_0xd84a('0x27'));_0x38f065[_0xd84a('0x2f')]=_[_0xd84a('0x30')](_0x34f35e[_0xd84a('0x2f')]);_0x38f065[_0xd84a('0x31')]=_[_0xd84a('0x32')](_0x38f065[_0xd84a('0x2e')],_0x38f065[_0xd84a('0x2f')]);_0x356c18['attributes']=_[_0xd84a('0x32')](_0x38f065[_0xd84a('0x2e')],qs[_0xd84a('0x33')](_0x34f35e[_0xd84a('0x2f')][_0xd84a('0x33')]));_0x356c18[_0xd84a('0x34')]=_0x356c18[_0xd84a('0x34')][_0xd84a('0x35')]?_0x356c18['attributes']:_0x38f065[_0xd84a('0x2e')];if(!_0x34f35e[_0xd84a('0x2f')][_0xd84a('0x36')](_0xd84a('0x37'))){_0x356c18[_0xd84a('0x38')]=qs[_0xd84a('0x38')](_0x34f35e[_0xd84a('0x2f')][_0xd84a('0x38')]);_0x356c18[_0xd84a('0x1b')]=qs[_0xd84a('0x1b')](_0x34f35e[_0xd84a('0x2f')]['offset']);}_0x356c18[_0xd84a('0x39')]=qs[_0xd84a('0x3a')](_0x34f35e[_0xd84a('0x2f')][_0xd84a('0x3a')]);_0x356c18[_0xd84a('0x3b')]=qs[_0xd84a('0x31')](_[_0xd84a('0x3c')](_0x34f35e[_0xd84a('0x2f')],_0x38f065[_0xd84a('0x31')]),_0x3e35bf);if(_0x34f35e[_0xd84a('0x2f')][_0xd84a('0x3d')]){_0x356c18[_0xd84a('0x3b')]=_['merge'](_0x356c18[_0xd84a('0x3b')],{'$or':_[_0xd84a('0x29')](_0x3e35bf,function(_0x1bb8f0){if(_0x1bb8f0[_0xd84a('0x3e')]!==_0xd84a('0x3f')){var _0x588cd0={};_0x588cd0[_0x1bb8f0[_0xd84a('0x27')]]={'$like':'%'+_0x34f35e['query'][_0xd84a('0x3d')]+'%'};return _0x588cd0;}})});}_0x356c18=_[_0xd84a('0x40')]({},_0x356c18,_0x34f35e[_0xd84a('0x41')]);var _0xa1e55d={'where':_0x356c18['where']};return db[_0xd84a('0x2a')][_0xd84a('0x1d')](_0xa1e55d)[_0xd84a('0x22')](function(_0x13b218){_0x400efe[_0xd84a('0x1d')]=_0x13b218;if(_0x34f35e[_0xd84a('0x2f')]['includeAll']){_0x356c18['include']=[{'all':!![]}];}return db[_0xd84a('0x2a')][_0xd84a('0x42')](_0x356c18);})['then'](function(_0x5e75d9){_0x400efe[_0xd84a('0x43')]=_0x5e75d9;return _0x400efe;})[_0xd84a('0x22')](respondWithFilteredResult(_0x23124d,_0x356c18))['catch'](handleError(_0x23124d,null));};exports[_0xd84a('0x44')]=function(_0x5a854e,_0x464d50){var _0x5e3705={'raw':!![],'where':{'id':_0x5a854e[_0xd84a('0x45')]['id']}},_0x548010={};_0x548010['model']=_[_0xd84a('0x30')](db[_0xd84a('0x2a')][_0xd84a('0x2b')]);_0x548010[_0xd84a('0x2f')]=_[_0xd84a('0x30')](_0x5a854e['query']);_0x548010['filters']=_['intersection'](_0x548010[_0xd84a('0x2e')],_0x548010[_0xd84a('0x2f')]);_0x5e3705[_0xd84a('0x34')]=_['intersection'](_0x548010[_0xd84a('0x2e')],qs[_0xd84a('0x33')](_0x5a854e['query'][_0xd84a('0x33')]));_0x5e3705[_0xd84a('0x34')]=_0x5e3705['attributes'][_0xd84a('0x35')]?_0x5e3705[_0xd84a('0x34')]:_0x548010[_0xd84a('0x2e')];if(_0x5a854e[_0xd84a('0x2f')][_0xd84a('0x46')]){_0x5e3705[_0xd84a('0x47')]=[{'all':!![]}];}_0x5e3705=_['merge']({},_0x5e3705,_0x5a854e[_0xd84a('0x41')]);return db[_0xd84a('0x2a')]['find'](_0x5e3705)[_0xd84a('0x22')](handleEntityNotFound(_0x464d50,null))[_0xd84a('0x22')](respondWithResult(_0x464d50,null))[_0xd84a('0x48')](handleError(_0x464d50,null));};exports[_0xd84a('0x49')]=function(_0x1e50a3,_0x10dfa5){return db[_0xd84a('0x2a')]['create'](_0x1e50a3[_0xd84a('0x4a')],{})[_0xd84a('0x22')](respondWithResult(_0x10dfa5,0xc9))[_0xd84a('0x48')](handleError(_0x10dfa5,null));};exports['update']=function(_0x7de79a,_0x851a7){if(_0x7de79a[_0xd84a('0x4a')]['id']){delete _0x7de79a[_0xd84a('0x4a')]['id'];}return db['MailSubstatus'][_0xd84a('0x4b')]({'where':{'id':_0x7de79a[_0xd84a('0x45')]['id']}})['then'](handleEntityNotFound(_0x851a7,null))[_0xd84a('0x22')](saveUpdates(_0x7de79a['body'],null))[_0xd84a('0x22')](respondWithResult(_0x851a7,null))[_0xd84a('0x48')](handleError(_0x851a7,null));};exports['destroy']=function(_0x421de9,_0x1928ec){return db['MailSubstatus'][_0xd84a('0x4b')]({'where':{'id':_0x421de9['params']['id']}})[_0xd84a('0x22')](handleEntityNotFound(_0x1928ec,null))['then'](removeEntity(_0x1928ec,null))[_0xd84a('0x48')](handleError(_0x1928ec,null));};exports[_0xd84a('0x4c')]=function(_0x406a59,_0x3d5905){return db[_0xd84a('0x2a')]['describe']()['then'](respondWithResult(_0x3d5905,null))[_0xd84a('0x48')](handleError(_0x3d5905,null));}; \ No newline at end of file +var _0x3088=['MailSubstatus','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map'];(function(_0x2e3ace,_0x1bb784){var _0x49c257=function(_0x1b1502){while(--_0x1b1502){_0x2e3ace['push'](_0x2e3ace['shift']());}};_0x49c257(++_0x1bb784);}(_0x3088,0x1da));var _0x8308=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x3088[_0x33155c];return _0x5becf7;};'use strict';var emlformat=require(_0x8308('0x0'));var rimraf=require(_0x8308('0x1'));var zipdir=require(_0x8308('0x2'));var jsonpatch=require(_0x8308('0x3'));var rp=require('request-promise');var moment=require(_0x8308('0x4'));var BPromise=require(_0x8308('0x5'));var Mustache=require(_0x8308('0x6'));var util=require(_0x8308('0x7'));var path=require(_0x8308('0x8'));var sox=require(_0x8308('0x9'));var csv=require(_0x8308('0xa'));var ejs=require(_0x8308('0xb'));var fs=require('fs');var fs_extra=require(_0x8308('0xc'));var _=require('lodash');var squel=require(_0x8308('0xd'));var crypto=require('crypto');var jsforce=require(_0x8308('0xe'));var deskjs=require(_0x8308('0xf'));var toCsv=require(_0x8308('0xa'));var querystring=require('querystring');var Papa=require(_0x8308('0x10'));var Redis=require('ioredis');var authService=require(_0x8308('0x11'));var qs=require(_0x8308('0x12'));var as=require(_0x8308('0x13'));var hardwareService=require(_0x8308('0x14'));var logger=require(_0x8308('0x15'))(_0x8308('0x16'));var utils=require(_0x8308('0x17'));var config=require(_0x8308('0x18'));var licenseUtil=require(_0x8308('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf5ee,_0x44c172){_0x44c172=_0x44c172||0xcc;return function(_0x14caad){if(_0x14caad){return _0x4bf5ee['sendStatus'](_0x44c172);}return _0x4bf5ee['status'](_0x44c172)['end']();};}function respondWithResult(_0x1367b8,_0x15e4b9){_0x15e4b9=_0x15e4b9||0xc8;return function(_0xfd5d5f){if(_0xfd5d5f){return _0x1367b8[_0x8308('0x1a')](_0x15e4b9)['json'](_0xfd5d5f);}};}function respondWithFilteredResult(_0x5a5c6e,_0x49390a){return function(_0x22a73d){if(_0x22a73d){var _0x4b49a9=typeof _0x49390a[_0x8308('0x1b')]==='undefined'&&typeof _0x49390a[_0x8308('0x1c')]==='undefined';var _0x5e25b6=_0x22a73d[_0x8308('0x1d')];var _0x5f571d=_0x4b49a9?0x0:_0x49390a[_0x8308('0x1b')];var _0x1e5945=_0x4b49a9?_0x22a73d['count']:_0x49390a[_0x8308('0x1b')]+_0x49390a['limit'];var _0x40b615;if(_0x1e5945>=_0x5e25b6){_0x1e5945=_0x5e25b6;_0x40b615=0xc8;}else{_0x40b615=0xce;}_0x5a5c6e[_0x8308('0x1a')](_0x40b615);return _0x5a5c6e[_0x8308('0x1e')](_0x8308('0x1f'),_0x5f571d+'-'+_0x1e5945+'/'+_0x5e25b6)[_0x8308('0x20')](_0x22a73d);}return null;};}function patchUpdates(_0x225fb0){return function(_0x34056e){try{jsonpatch[_0x8308('0x21')](_0x34056e,_0x225fb0,!![]);}catch(_0x20ff16){return BPromise['reject'](_0x20ff16);}return _0x34056e[_0x8308('0x22')]();};}function saveUpdates(_0x500de5,_0x1361c0){return function(_0x136e0c){if(_0x136e0c){return _0x136e0c[_0x8308('0x23')](_0x500de5)[_0x8308('0x24')](function(_0x275717){return _0x275717;});}return null;};}function removeEntity(_0x2ec641,_0x4c2ebc){return function(_0x85cd9d){if(_0x85cd9d){return _0x85cd9d[_0x8308('0x25')]()['then'](function(){_0x2ec641[_0x8308('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b718e,_0x253bfe){return function(_0x2da685){if(!_0x2da685){_0x1b718e[_0x8308('0x26')](0x194);}return _0x2da685;};}function handleError(_0x56f264,_0x4eebfe){_0x4eebfe=_0x4eebfe||0x1f4;return function(_0x1c5f67){logger[_0x8308('0x27')](_0x1c5f67[_0x8308('0x28')]);if(_0x1c5f67[_0x8308('0x29')]){delete _0x1c5f67[_0x8308('0x29')];}_0x56f264[_0x8308('0x1a')](_0x4eebfe)['send'](_0x1c5f67);};}exports[_0x8308('0x2a')]=function(_0x52f01b,_0x4cf9d6){var _0xc10efa={},_0x1b815e={},_0x77c618={'count':0x0,'rows':[]};var _0x14ccec=_[_0x8308('0x2b')](db[_0x8308('0x2c')][_0x8308('0x2d')],function(_0x48fb78){return{'name':_0x48fb78['fieldName'],'type':_0x48fb78[_0x8308('0x2e')][_0x8308('0x2f')]};});_0x1b815e['model']=_[_0x8308('0x2b')](_0x14ccec,_0x8308('0x29'));_0x1b815e[_0x8308('0x30')]=_[_0x8308('0x31')](_0x52f01b['query']);_0x1b815e[_0x8308('0x32')]=_['intersection'](_0x1b815e[_0x8308('0x33')],_0x1b815e['query']);_0xc10efa[_0x8308('0x34')]=_[_0x8308('0x35')](_0x1b815e[_0x8308('0x33')],qs['fields'](_0x52f01b[_0x8308('0x30')][_0x8308('0x36')]));_0xc10efa[_0x8308('0x34')]=_0xc10efa[_0x8308('0x34')]['length']?_0xc10efa['attributes']:_0x1b815e[_0x8308('0x33')];if(!_0x52f01b[_0x8308('0x30')]['hasOwnProperty'](_0x8308('0x37'))){_0xc10efa[_0x8308('0x1c')]=qs[_0x8308('0x1c')](_0x52f01b[_0x8308('0x30')][_0x8308('0x1c')]);_0xc10efa[_0x8308('0x1b')]=qs[_0x8308('0x1b')](_0x52f01b[_0x8308('0x30')][_0x8308('0x1b')]);}_0xc10efa[_0x8308('0x38')]=qs['sort'](_0x52f01b['query']['sort']);_0xc10efa[_0x8308('0x39')]=qs[_0x8308('0x32')](_[_0x8308('0x3a')](_0x52f01b['query'],_0x1b815e[_0x8308('0x32')]),_0x14ccec);if(_0x52f01b[_0x8308('0x30')][_0x8308('0x3b')]){_0xc10efa[_0x8308('0x39')]=_['merge'](_0xc10efa[_0x8308('0x39')],{'$or':_['map'](_0x14ccec,function(_0x2b8a47){if(_0x2b8a47[_0x8308('0x2e')]!==_0x8308('0x3c')){var _0x301878={};_0x301878[_0x2b8a47['name']]={'$like':'%'+_0x52f01b['query'][_0x8308('0x3b')]+'%'};return _0x301878;}})});}_0xc10efa=_[_0x8308('0x3d')]({},_0xc10efa,_0x52f01b[_0x8308('0x3e')]);var _0x4757cc={'where':_0xc10efa[_0x8308('0x39')]};return db['MailSubstatus'][_0x8308('0x1d')](_0x4757cc)[_0x8308('0x24')](function(_0x18c714){_0x77c618['count']=_0x18c714;if(_0x52f01b[_0x8308('0x30')]['includeAll']){_0xc10efa[_0x8308('0x3f')]=[{'all':!![]}];}return db[_0x8308('0x2c')][_0x8308('0x40')](_0xc10efa);})[_0x8308('0x24')](function(_0x53ebec){_0x77c618[_0x8308('0x41')]=_0x53ebec;return _0x77c618;})[_0x8308('0x24')](respondWithFilteredResult(_0x4cf9d6,_0xc10efa))[_0x8308('0x42')](handleError(_0x4cf9d6,null));};exports[_0x8308('0x43')]=function(_0x5f3a29,_0x7f9a8b){var _0x3fa0e3={'raw':!![],'where':{'id':_0x5f3a29[_0x8308('0x44')]['id']}},_0x68e170={};_0x68e170[_0x8308('0x33')]=_[_0x8308('0x31')](db['MailSubstatus'][_0x8308('0x2d')]);_0x68e170['query']=_[_0x8308('0x31')](_0x5f3a29[_0x8308('0x30')]);_0x68e170[_0x8308('0x32')]=_['intersection'](_0x68e170['model'],_0x68e170[_0x8308('0x30')]);_0x3fa0e3[_0x8308('0x34')]=_[_0x8308('0x35')](_0x68e170[_0x8308('0x33')],qs['fields'](_0x5f3a29['query'][_0x8308('0x36')]));_0x3fa0e3[_0x8308('0x34')]=_0x3fa0e3['attributes'][_0x8308('0x45')]?_0x3fa0e3[_0x8308('0x34')]:_0x68e170[_0x8308('0x33')];if(_0x5f3a29[_0x8308('0x30')][_0x8308('0x46')]){_0x3fa0e3['include']=[{'all':!![]}];}_0x3fa0e3=_[_0x8308('0x3d')]({},_0x3fa0e3,_0x5f3a29['options']);return db[_0x8308('0x2c')][_0x8308('0x47')](_0x3fa0e3)[_0x8308('0x24')](handleEntityNotFound(_0x7f9a8b,null))['then'](respondWithResult(_0x7f9a8b,null))[_0x8308('0x42')](handleError(_0x7f9a8b,null));};exports[_0x8308('0x48')]=function(_0x13e18b,_0x172a21){return db[_0x8308('0x2c')][_0x8308('0x48')](_0x13e18b['body'],{})[_0x8308('0x24')](respondWithResult(_0x172a21,0xc9))[_0x8308('0x42')](handleError(_0x172a21,null));};exports[_0x8308('0x23')]=function(_0x1e7078,_0x396ae7){if(_0x1e7078[_0x8308('0x49')]['id']){delete _0x1e7078[_0x8308('0x49')]['id'];}return db[_0x8308('0x2c')][_0x8308('0x47')]({'where':{'id':_0x1e7078[_0x8308('0x44')]['id']}})[_0x8308('0x24')](handleEntityNotFound(_0x396ae7,null))['then'](saveUpdates(_0x1e7078[_0x8308('0x49')],null))['then'](respondWithResult(_0x396ae7,null))['catch'](handleError(_0x396ae7,null));};exports[_0x8308('0x25')]=function(_0x1e2ad5,_0xb64a19){return db[_0x8308('0x2c')][_0x8308('0x47')]({'where':{'id':_0x1e2ad5[_0x8308('0x44')]['id']}})[_0x8308('0x24')](handleEntityNotFound(_0xb64a19,null))[_0x8308('0x24')](removeEntity(_0xb64a19,null))[_0x8308('0x42')](handleError(_0xb64a19,null));};exports['describe']=function(_0x25a884,_0x45b947){return db['MailSubstatus']['describe']()[_0x8308('0x24')](respondWithResult(_0x45b947,null))['catch'](handleError(_0x45b947,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 9ff14b5..7029030 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 _0xd13c=['setMaxListeners','emit','hasOwnProperty','hook','events','../../mysqldb','MailSubstatus'];(function(_0x4668de,_0x22f7e1){var _0x40ac23=function(_0x1172e3){while(--_0x1172e3){_0x4668de['push'](_0x4668de['shift']());}};_0x40ac23(++_0x22f7e1);}(_0xd13c,0x154));var _0xcd13=function(_0x494848,_0x216dc5){_0x494848=_0x494848-0x0;var _0x18792b=_0xd13c[_0x494848];return _0x18792b;};'use strict';var EventEmitter=require(_0xcd13('0x0'));var MailSubstatus=require(_0xcd13('0x1'))['db'][_0xcd13('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xcd13('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x83f712){return function(_0x1f5c36,_0x410354,_0x3f0deb){MailSubstatusEvents[_0xcd13('0x4')](_0x83f712+':'+_0x1f5c36['id'],_0x1f5c36);MailSubstatusEvents[_0xcd13('0x4')](_0x83f712,_0x1f5c36);_0x3f0deb(null);};}for(var e in events){if(events[_0xcd13('0x5')](e)){var event=events[e];MailSubstatus[_0xcd13('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x6a61=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4a2f8d,_0x2cf00d){var _0x176c5d=function(_0x54fcf5){while(--_0x54fcf5){_0x4a2f8d['push'](_0x4a2f8d['shift']());}};_0x176c5d(++_0x2cf00d);}(_0x6a61,0x119));var _0x16a6=function(_0x3fc14b,_0x3b0b6b){_0x3fc14b=_0x3fc14b-0x0;var _0x1ebd07=_0x6a61[_0x3fc14b];return _0x1ebd07;};'use strict';var EventEmitter=require(_0x16a6('0x0'));var MailSubstatus=require(_0x16a6('0x1'))['db'][_0x16a6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x16a6('0x3')](0x0);var events={'afterUpdate':_0x16a6('0x4')};function emitEvent(_0x4053a9){return function(_0x1fe60d,_0x1c1f3a,_0x3d8336){MailSubstatusEvents['emit'](_0x4053a9+':'+_0x1fe60d['id'],_0x1fe60d);MailSubstatusEvents[_0x16a6('0x5')](_0x4053a9,_0x1fe60d);_0x3d8336(null);};}for(var e in events){if(events[_0x16a6('0x6')](e)){var event=events[e];MailSubstatus[_0x16a6('0x7')](e,emitEvent(event));}}module[_0x16a6('0x8')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5324a56..aec6e3d 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 _0x991a=['Condition','update','name','_previousDataValues','exports','models','MailSubstatus','mail_substatuses'];(function(_0x4ce860,_0x24ca0c){var _0x587afc=function(_0xc1a4e8){while(--_0xc1a4e8){_0x4ce860['push'](_0x4ce860['shift']());}};_0x587afc(++_0x24ca0c);}(_0x991a,0xd4));var _0xa991=function(_0x3c5915,_0x5c7f81){_0x3c5915=_0x3c5915-0x0;var _0x4daa59=_0x991a[_0x3c5915];return _0x4daa59;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xa991('0x0')]=function(_0x6fa35f){var _0x4af501=_0x6fa35f[_0xa991('0x1')];return _0x6fa35f['define'](_0xa991('0x2'),attributes,{'tableName':_0xa991('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x157c79,_0x30db65,_0x30cca6){return _0x4af501[_0xa991('0x4')][_0xa991('0x5')]({'value':_0x157c79[_0xa991('0x6')]},{'where':{'field':'mailSubstatus','value':_0x157c79[_0xa991('0x7')][_0xa991('0x6')]}})['then'](function(){_0x30cca6();})['catch'](function(_0x2a0636){_0x30cca6(_0x2a0636);});}}});}; \ No newline at end of file +var _0x1c20=['models','define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x25d377,_0x28f009){var _0x3b4def=function(_0x5dd868){while(--_0x5dd868){_0x25d377['push'](_0x25d377['shift']());}};_0x3b4def(++_0x28f009);}(_0x1c20,0x1d2));var _0x01c2=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x1c20[_0x218994];return _0x3f350b;};'use strict';var attributes=require(_0x01c2('0x0'));module[_0x01c2('0x1')]=function(_0x512d42){var _0x4e66b0=_0x512d42[_0x01c2('0x2')];return _0x512d42[_0x01c2('0x3')](_0x01c2('0x4'),attributes,{'tableName':_0x01c2('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xe3dfb9,_0x2938a0,_0x3916d3){return _0x4e66b0[_0x01c2('0x6')][_0x01c2('0x7')]({'value':_0xe3dfb9[_0x01c2('0x8')]},{'where':{'field':'mailSubstatus','value':_0xe3dfb9[_0x01c2('0x9')][_0x01c2('0x8')]}})[_0x01c2('0xa')](function(){_0x3916d3();})[_0x01c2('0xb')](function(_0x2a2e33){_0x3916d3(_0x2a2e33);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index db6d5e4..7bfbef0 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 _0x9dc6=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9dc6,0xe0));var _0x69dc=function(_0x2fbd46,_0x512536){_0x2fbd46=_0x2fbd46-0x0;var _0x9f1dd1=_0x9dc6[_0x2fbd46];return _0x9f1dd1;};'use strict';var _=require(_0x69dc('0x0'));var util=require(_0x69dc('0x1'));var moment=require(_0x69dc('0x2'));var BPromise=require(_0x69dc('0x3'));var rs=require(_0x69dc('0x4'));var fs=require('fs');var Redis=require(_0x69dc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69dc('0x6'));var logger=require('../../config/logger')(_0x69dc('0x7'));var config=require(_0x69dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e85ce,_0x4d5265,_0x395691){return new BPromise(function(_0x526c09,_0x213304){return client[_0x69dc('0xa')](_0x5e85ce,_0x395691)[_0x69dc('0xb')](function(_0x217ac5){logger['info'](_0x69dc('0xc'),_0x4d5265,_0x69dc('0xd'));logger[_0x69dc('0xe')](_0x69dc('0xf'),_0x4d5265,_0x69dc('0xd'),JSON[_0x69dc('0x10')](_0x217ac5));if(_0x217ac5[_0x69dc('0x11')]){if(_0x217ac5[_0x69dc('0x11')]['code']===0x1f4){logger[_0x69dc('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4d5265,_0x217ac5[_0x69dc('0x11')][_0x69dc('0x12')]);return _0x213304(_0x217ac5[_0x69dc('0x11')][_0x69dc('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x4d5265,_0x217ac5[_0x69dc('0x11')][_0x69dc('0x12')]);return _0x526c09(_0x217ac5[_0x69dc('0x11')][_0x69dc('0x12')]);}else{logger[_0x69dc('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4d5265,_0x69dc('0xd'));_0x526c09(_0x217ac5[_0x69dc('0x14')][_0x69dc('0x12')]);}})[_0x69dc('0x15')](function(_0x11a92e){logger[_0x69dc('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4d5265,_0x11a92e);_0x213304(_0x11a92e);});});} \ No newline at end of file +var _0x1ef4=['message','info','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1ef4,0x82));var _0x41ef=function(_0x190111,_0x4f12cd){_0x190111=_0x190111-0x0;var _0xb2d2ea=_0x1ef4[_0x190111];return _0xb2d2ea;};'use strict';var _=require(_0x41ef('0x0'));var util=require(_0x41ef('0x1'));var moment=require('moment');var BPromise=require(_0x41ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x41ef('0x4'))(_0x41ef('0x5'));var config=require(_0x41ef('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x41ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x106911,_0x5dc657,_0x4d0928){return new BPromise(function(_0x1b26a4,_0x277c56){return client['request'](_0x106911,_0x4d0928)['then'](function(_0x2f9b28){logger['info'](_0x41ef('0x8'),_0x5dc657,_0x41ef('0x9'));logger[_0x41ef('0xa')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5dc657,'request\x20sent',JSON[_0x41ef('0xb')](_0x2f9b28));if(_0x2f9b28['error']){if(_0x2f9b28[_0x41ef('0xc')][_0x41ef('0xd')]===0x1f4){logger[_0x41ef('0xc')](_0x41ef('0x8'),_0x5dc657,_0x2f9b28[_0x41ef('0xc')]['message']);return _0x277c56(_0x2f9b28[_0x41ef('0xc')][_0x41ef('0xe')]);}logger[_0x41ef('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x5dc657,_0x2f9b28[_0x41ef('0xc')][_0x41ef('0xe')]);return _0x1b26a4(_0x2f9b28[_0x41ef('0xc')][_0x41ef('0xe')]);}else{logger[_0x41ef('0xf')](_0x41ef('0x8'),_0x5dc657,_0x41ef('0x9'));_0x1b26a4(_0x2f9b28[_0x41ef('0x10')][_0x41ef('0xe')]);}})[_0x41ef('0x11')](function(_0xf2a4f7){logger[_0x41ef('0xc')](_0x41ef('0x8'),_0x5dc657,_0xf2a4f7);_0x277c56(_0xf2a4f7);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 1b06a7a..7e44474 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 _0x8f38=['./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f38,0xb3));var _0x88f3=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x8f38[_0xeff2c3];return _0x2cade6;};'use strict';var multer=require(_0x88f3('0x0'));var util=require(_0x88f3('0x1'));var path=require(_0x88f3('0x2'));var timeout=require(_0x88f3('0x3'));var express=require(_0x88f3('0x4'));var router=express[_0x88f3('0x5')]();var fs_extra=require(_0x88f3('0x6'));var auth=require(_0x88f3('0x7'));var interaction=require(_0x88f3('0x8'));var config=require(_0x88f3('0x9'));var controller=require(_0x88f3('0xa'));router[_0x88f3('0xb')]('/',auth[_0x88f3('0xc')](),controller[_0x88f3('0xd')]);router['get'](_0x88f3('0xe'),auth[_0x88f3('0xc')](),controller[_0x88f3('0xf')]);router[_0x88f3('0xb')](_0x88f3('0x10'),auth[_0x88f3('0xc')](),controller['show']);router[_0x88f3('0x11')]('/',auth[_0x88f3('0xc')](),controller[_0x88f3('0x12')]);router['put']('/:id',auth[_0x88f3('0xc')](),controller[_0x88f3('0x13')]);router['delete'](_0x88f3('0x10'),auth[_0x88f3('0xc')](),controller[_0x88f3('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb6af=['post','create','put','exports','multer','path','connect-timeout','express','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x547e22,_0x2e286c){var _0x205412=function(_0x10d5a6){while(--_0x10d5a6){_0x547e22['push'](_0x547e22['shift']());}};_0x205412(++_0x2e286c);}(_0xb6af,0xba));var _0xfb6a=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xb6af[_0x3e182f];return _0x23edc9;};'use strict';var multer=require(_0xfb6a('0x0'));var util=require('util');var path=require(_0xfb6a('0x1'));var timeout=require(_0xfb6a('0x2'));var express=require(_0xfb6a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xfb6a('0x4')]('/',auth['isAuthenticated'](),controller[_0xfb6a('0x5')]);router['get'](_0xfb6a('0x6'),auth[_0xfb6a('0x7')](),controller['describe']);router[_0xfb6a('0x4')](_0xfb6a('0x8'),auth[_0xfb6a('0x7')](),controller[_0xfb6a('0x9')]);router[_0xfb6a('0xa')]('/',auth['isAuthenticated'](),controller[_0xfb6a('0xb')]);router[_0xfb6a('0xc')](_0xfb6a('0x8'),auth[_0xfb6a('0x7')](),controller['update']);router['delete'](_0xfb6a('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xfb6a('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 6b30a77..7409f07 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xb43b,0x1b2));var _0xbb43=function(_0x380921,_0x555d3f){_0x380921=_0x380921-0x0;var _0xd7f479=_0xb43b[_0x380921];return _0xd7f479;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x333590,_0x20b3f5){var _0x59950e=function(_0x46c651){while(--_0x46c651){_0x333590['push'](_0x333590['shift']());}};_0x59950e(++_0x20b3f5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1ac5e1,_0x43a483){_0x1ac5e1=_0x1ac5e1-0x0;var _0x3ae80e=_0xf3cd[_0x1ac5e1];return _0x3ae80e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index aee854a..c3c9f93 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 _0xc46c=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','create','body','params','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','json','offset','undefined','limit','count','save','update','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xc46c,0x1b9));var _0xcc46=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0xc46c[_0x59eacf];return _0x5d74f2;};'use strict';var emlformat=require(_0xcc46('0x0'));var rimraf=require(_0xcc46('0x1'));var zipdir=require(_0xcc46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc46('0x3'));var BPromise=require(_0xcc46('0x4'));var Mustache=require(_0xcc46('0x5'));var util=require(_0xcc46('0x6'));var path=require(_0xcc46('0x7'));var sox=require(_0xcc46('0x8'));var csv=require(_0xcc46('0x9'));var ejs=require(_0xcc46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcc46('0xb'));var crypto=require(_0xcc46('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcc46('0xd'));var toCsv=require(_0xcc46('0x9'));var querystring=require(_0xcc46('0xe'));var Papa=require(_0xcc46('0xf'));var Redis=require(_0xcc46('0x10'));var authService=require(_0xcc46('0x11'));var qs=require(_0xcc46('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc46('0x13'));var logger=require(_0xcc46('0x14'))(_0xcc46('0x15'));var utils=require(_0xcc46('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcc46('0x17'));var db=require(_0xcc46('0x18'))['db'];function respondWithStatusCode(_0x83f72d,_0x3da6a5){_0x3da6a5=_0x3da6a5||0xcc;return function(_0x1f042c){if(_0x1f042c){return _0x83f72d[_0xcc46('0x19')](_0x3da6a5);}return _0x83f72d[_0xcc46('0x1a')](_0x3da6a5)['end']();};}function respondWithResult(_0xe2217c,_0x31ad9a){_0x31ad9a=_0x31ad9a||0xc8;return function(_0xab9b51){if(_0xab9b51){return _0xe2217c[_0xcc46('0x1a')](_0x31ad9a)[_0xcc46('0x1b')](_0xab9b51);}};}function respondWithFilteredResult(_0x2fdcb0,_0x5398f3){return function(_0x1249cd){if(_0x1249cd){var _0x2857d0=typeof _0x5398f3[_0xcc46('0x1c')]===_0xcc46('0x1d')&&typeof _0x5398f3[_0xcc46('0x1e')]===_0xcc46('0x1d');var _0x5a3794=_0x1249cd[_0xcc46('0x1f')];var _0x34ab03=_0x2857d0?0x0:_0x5398f3[_0xcc46('0x1c')];var _0x166f57=_0x2857d0?_0x1249cd[_0xcc46('0x1f')]:_0x5398f3['offset']+_0x5398f3[_0xcc46('0x1e')];var _0x595100;if(_0x166f57>=_0x5a3794){_0x166f57=_0x5a3794;_0x595100=0xc8;}else{_0x595100=0xce;}_0x2fdcb0[_0xcc46('0x1a')](_0x595100);return _0x2fdcb0['set']('Content-Range',_0x34ab03+'-'+_0x166f57+'/'+_0x5a3794)[_0xcc46('0x1b')](_0x1249cd);}return null;};}function patchUpdates(_0x2c9c4d){return function(_0x251dfb){try{jsonpatch['apply'](_0x251dfb,_0x2c9c4d,!![]);}catch(_0x1b9380){return BPromise['reject'](_0x1b9380);}return _0x251dfb[_0xcc46('0x20')]();};}function saveUpdates(_0x55b1a5,_0x31deeb){return function(_0x39baeb){if(_0x39baeb){return _0x39baeb[_0xcc46('0x21')](_0x55b1a5)[_0xcc46('0x22')](function(_0x59b9b0){return _0x59b9b0;});}return null;};}function removeEntity(_0x56f829,_0x358bbb){return function(_0x51d33b){if(_0x51d33b){return _0x51d33b['destroy']()[_0xcc46('0x22')](function(){_0x56f829[_0xcc46('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29f1b7,_0x136622){return function(_0x42fbe6){if(!_0x42fbe6){_0x29f1b7['sendStatus'](0x194);}return _0x42fbe6;};}function handleError(_0x1b71e7,_0x1adc78){_0x1adc78=_0x1adc78||0x1f4;return function(_0x361dfb){logger[_0xcc46('0x23')](_0x361dfb[_0xcc46('0x24')]);if(_0x361dfb['name']){delete _0x361dfb[_0xcc46('0x25')];}_0x1b71e7[_0xcc46('0x1a')](_0x1adc78)[_0xcc46('0x26')](_0x361dfb);};}exports[_0xcc46('0x27')]=function(_0x46e397,_0x40bfb0){var _0x8e9478={},_0xa6db5b={},_0x1f0be3={'count':0x0,'rows':[]};var _0x3c9562=_[_0xcc46('0x28')](db[_0xcc46('0x29')][_0xcc46('0x2a')],function(_0x15ffcc){return{'name':_0x15ffcc[_0xcc46('0x2b')],'type':_0x15ffcc[_0xcc46('0x2c')]['key']};});_0xa6db5b[_0xcc46('0x2d')]=_[_0xcc46('0x28')](_0x3c9562,_0xcc46('0x25'));_0xa6db5b[_0xcc46('0x2e')]=_[_0xcc46('0x2f')](_0x46e397['query']);_0xa6db5b['filters']=_[_0xcc46('0x30')](_0xa6db5b[_0xcc46('0x2d')],_0xa6db5b['query']);_0x8e9478[_0xcc46('0x31')]=_[_0xcc46('0x30')](_0xa6db5b[_0xcc46('0x2d')],qs['fields'](_0x46e397[_0xcc46('0x2e')][_0xcc46('0x32')]));_0x8e9478['attributes']=_0x8e9478[_0xcc46('0x31')][_0xcc46('0x33')]?_0x8e9478[_0xcc46('0x31')]:_0xa6db5b[_0xcc46('0x2d')];if(!_0x46e397['query']['hasOwnProperty'](_0xcc46('0x34'))){_0x8e9478[_0xcc46('0x1e')]=qs[_0xcc46('0x1e')](_0x46e397[_0xcc46('0x2e')][_0xcc46('0x1e')]);_0x8e9478[_0xcc46('0x1c')]=qs['offset'](_0x46e397[_0xcc46('0x2e')][_0xcc46('0x1c')]);}_0x8e9478[_0xcc46('0x35')]=qs[_0xcc46('0x36')](_0x46e397['query'][_0xcc46('0x36')]);_0x8e9478[_0xcc46('0x37')]=qs[_0xcc46('0x38')](_[_0xcc46('0x39')](_0x46e397[_0xcc46('0x2e')],_0xa6db5b[_0xcc46('0x38')]),_0x3c9562);if(_0x46e397[_0xcc46('0x2e')][_0xcc46('0x3a')]){_0x8e9478['where']=_[_0xcc46('0x3b')](_0x8e9478['where'],{'$or':_[_0xcc46('0x28')](_0x3c9562,function(_0x162aa1){if(_0x162aa1[_0xcc46('0x2c')]!==_0xcc46('0x3c')){var _0xa4a887={};_0xa4a887[_0x162aa1[_0xcc46('0x25')]]={'$like':'%'+_0x46e397[_0xcc46('0x2e')][_0xcc46('0x3a')]+'%'};return _0xa4a887;}})});}_0x8e9478=_[_0xcc46('0x3b')]({},_0x8e9478,_0x46e397[_0xcc46('0x3d')]);var _0xdf1531={'where':_0x8e9478[_0xcc46('0x37')]};return db[_0xcc46('0x29')][_0xcc46('0x1f')](_0xdf1531)[_0xcc46('0x22')](function(_0x29fb6a){_0x1f0be3[_0xcc46('0x1f')]=_0x29fb6a;if(_0x46e397[_0xcc46('0x2e')][_0xcc46('0x3e')]){_0x8e9478[_0xcc46('0x3f')]=[{'all':!![]}];}return db[_0xcc46('0x29')][_0xcc46('0x40')](_0x8e9478);})[_0xcc46('0x22')](function(_0x5610ba){_0x1f0be3['rows']=_0x5610ba;return _0x1f0be3;})[_0xcc46('0x22')](respondWithFilteredResult(_0x40bfb0,_0x8e9478))['catch'](handleError(_0x40bfb0,null));};exports['show']=function(_0x11f235,_0x4dd313){var _0x596d4c={'raw':!![],'where':{'id':_0x11f235['params']['id']}},_0x45c6fa={};_0x45c6fa[_0xcc46('0x2d')]=_[_0xcc46('0x2f')](db['MailTransferReport']['rawAttributes']);_0x45c6fa['query']=_[_0xcc46('0x2f')](_0x11f235['query']);_0x45c6fa[_0xcc46('0x38')]=_[_0xcc46('0x30')](_0x45c6fa[_0xcc46('0x2d')],_0x45c6fa[_0xcc46('0x2e')]);_0x596d4c[_0xcc46('0x31')]=_['intersection'](_0x45c6fa['model'],qs[_0xcc46('0x32')](_0x11f235[_0xcc46('0x2e')][_0xcc46('0x32')]));_0x596d4c['attributes']=_0x596d4c[_0xcc46('0x31')][_0xcc46('0x33')]?_0x596d4c[_0xcc46('0x31')]:_0x45c6fa['model'];if(_0x11f235[_0xcc46('0x2e')][_0xcc46('0x3e')]){_0x596d4c[_0xcc46('0x3f')]=[{'all':!![]}];}_0x596d4c=_[_0xcc46('0x3b')]({},_0x596d4c,_0x11f235['options']);return db[_0xcc46('0x29')]['find'](_0x596d4c)[_0xcc46('0x22')](handleEntityNotFound(_0x4dd313,null))[_0xcc46('0x22')](respondWithResult(_0x4dd313,null))[_0xcc46('0x41')](handleError(_0x4dd313,null));};exports[_0xcc46('0x42')]=function(_0x3f7bf1,_0x6e2ba){return db['MailTransferReport'][_0xcc46('0x42')](_0x3f7bf1[_0xcc46('0x43')],{})[_0xcc46('0x22')](respondWithResult(_0x6e2ba,0xc9))[_0xcc46('0x41')](handleError(_0x6e2ba,null));};exports[_0xcc46('0x21')]=function(_0x218007,_0x8b1eaa){if(_0x218007[_0xcc46('0x43')]['id']){delete _0x218007['body']['id'];}return db[_0xcc46('0x29')]['find']({'where':{'id':_0x218007[_0xcc46('0x44')]['id']}})['then'](handleEntityNotFound(_0x8b1eaa,null))['then'](saveUpdates(_0x218007[_0xcc46('0x43')],null))['then'](respondWithResult(_0x8b1eaa,null))['catch'](handleError(_0x8b1eaa,null));};exports['destroy']=function(_0x481463,_0x3cba11){return db[_0xcc46('0x29')][_0xcc46('0x45')]({'where':{'id':_0x481463['params']['id']}})[_0xcc46('0x22')](handleEntityNotFound(_0x3cba11,null))[_0xcc46('0x22')](removeEntity(_0x3cba11,null))[_0xcc46('0x41')](handleError(_0x3cba11,null));};exports[_0xcc46('0x46')]=function(_0x59e2c9,_0x3bad35){return db[_0xcc46('0x29')][_0xcc46('0x46')]()['then'](respondWithResult(_0x3bad35,null))['catch'](handleError(_0x3bad35,null));}; \ No newline at end of file +var _0x986b=['error','stack','name','index','MailTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','update','then'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x986b,0x6b));var _0xb986=function(_0x3a0a25,_0xc055b8){_0x3a0a25=_0x3a0a25-0x0;var _0x9a0717=_0x986b[_0x3a0a25];return _0x9a0717;};'use strict';var emlformat=require(_0xb986('0x0'));var rimraf=require(_0xb986('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb986('0x2'));var moment=require(_0xb986('0x3'));var BPromise=require(_0xb986('0x4'));var Mustache=require(_0xb986('0x5'));var util=require(_0xb986('0x6'));var path=require('path');var sox=require(_0xb986('0x7'));var csv=require(_0xb986('0x8'));var ejs=require(_0xb986('0x9'));var fs=require('fs');var fs_extra=require(_0xb986('0xa'));var _=require(_0xb986('0xb'));var squel=require('squel');var crypto=require(_0xb986('0xc'));var jsforce=require(_0xb986('0xd'));var deskjs=require(_0xb986('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb986('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb986('0x10'));var as=require(_0xb986('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb986('0x12'))(_0xb986('0x13'));var utils=require(_0xb986('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb986('0x15'));var db=require(_0xb986('0x16'))['db'];function respondWithStatusCode(_0x18e76a,_0x110341){_0x110341=_0x110341||0xcc;return function(_0x222f2a){if(_0x222f2a){return _0x18e76a[_0xb986('0x17')](_0x110341);}return _0x18e76a['status'](_0x110341)[_0xb986('0x18')]();};}function respondWithResult(_0x15e7a3,_0xf9fc1c){_0xf9fc1c=_0xf9fc1c||0xc8;return function(_0x182c5b){if(_0x182c5b){return _0x15e7a3['status'](_0xf9fc1c)[_0xb986('0x19')](_0x182c5b);}};}function respondWithFilteredResult(_0x39551c,_0x3cfc18){return function(_0x268047){if(_0x268047){var _0x12cde7=typeof _0x3cfc18['offset']===_0xb986('0x1a')&&typeof _0x3cfc18[_0xb986('0x1b')]===_0xb986('0x1a');var _0x33186a=_0x268047[_0xb986('0x1c')];var _0x5f56ab=_0x12cde7?0x0:_0x3cfc18[_0xb986('0x1d')];var _0x446b0e=_0x12cde7?_0x268047[_0xb986('0x1c')]:_0x3cfc18[_0xb986('0x1d')]+_0x3cfc18[_0xb986('0x1b')];var _0x295adf;if(_0x446b0e>=_0x33186a){_0x446b0e=_0x33186a;_0x295adf=0xc8;}else{_0x295adf=0xce;}_0x39551c[_0xb986('0x1e')](_0x295adf);return _0x39551c[_0xb986('0x1f')]('Content-Range',_0x5f56ab+'-'+_0x446b0e+'/'+_0x33186a)[_0xb986('0x19')](_0x268047);}return null;};}function patchUpdates(_0x34cf46){return function(_0x48de2d){try{jsonpatch[_0xb986('0x20')](_0x48de2d,_0x34cf46,!![]);}catch(_0x5ca290){return BPromise['reject'](_0x5ca290);}return _0x48de2d['save']();};}function saveUpdates(_0x34d728,_0x1ffeda){return function(_0x3e78e1){if(_0x3e78e1){return _0x3e78e1[_0xb986('0x21')](_0x34d728)[_0xb986('0x22')](function(_0x28f6d4){return _0x28f6d4;});}return null;};}function removeEntity(_0x437e12,_0x4c1942){return function(_0x5a2e40){if(_0x5a2e40){return _0x5a2e40['destroy']()[_0xb986('0x22')](function(){_0x437e12[_0xb986('0x1e')](0xcc)[_0xb986('0x18')]();});}};}function handleEntityNotFound(_0x3a07e0,_0x5d175c){return function(_0x5dd5c5){if(!_0x5dd5c5){_0x3a07e0['sendStatus'](0x194);}return _0x5dd5c5;};}function handleError(_0x553de3,_0x2bc48a){_0x2bc48a=_0x2bc48a||0x1f4;return function(_0x3aeba9){logger[_0xb986('0x23')](_0x3aeba9[_0xb986('0x24')]);if(_0x3aeba9[_0xb986('0x25')]){delete _0x3aeba9[_0xb986('0x25')];}_0x553de3[_0xb986('0x1e')](_0x2bc48a)['send'](_0x3aeba9);};}exports[_0xb986('0x26')]=function(_0x4da636,_0x4caf9c){var _0x47a98e={},_0x4ce5a2={},_0xbab079={'count':0x0,'rows':[]};var _0x3107cd=_['map'](db[_0xb986('0x27')][_0xb986('0x28')],function(_0x5e5660){return{'name':_0x5e5660[_0xb986('0x29')],'type':_0x5e5660['type'][_0xb986('0x2a')]};});_0x4ce5a2[_0xb986('0x2b')]=_[_0xb986('0x2c')](_0x3107cd,_0xb986('0x25'));_0x4ce5a2['query']=_[_0xb986('0x2d')](_0x4da636[_0xb986('0x2e')]);_0x4ce5a2[_0xb986('0x2f')]=_[_0xb986('0x30')](_0x4ce5a2[_0xb986('0x2b')],_0x4ce5a2[_0xb986('0x2e')]);_0x47a98e[_0xb986('0x31')]=_['intersection'](_0x4ce5a2[_0xb986('0x2b')],qs[_0xb986('0x32')](_0x4da636[_0xb986('0x2e')][_0xb986('0x32')]));_0x47a98e[_0xb986('0x31')]=_0x47a98e[_0xb986('0x31')][_0xb986('0x33')]?_0x47a98e['attributes']:_0x4ce5a2[_0xb986('0x2b')];if(!_0x4da636[_0xb986('0x2e')]['hasOwnProperty'](_0xb986('0x34'))){_0x47a98e[_0xb986('0x1b')]=qs[_0xb986('0x1b')](_0x4da636[_0xb986('0x2e')][_0xb986('0x1b')]);_0x47a98e[_0xb986('0x1d')]=qs['offset'](_0x4da636['query']['offset']);}_0x47a98e['order']=qs['sort'](_0x4da636[_0xb986('0x2e')][_0xb986('0x35')]);_0x47a98e[_0xb986('0x36')]=qs['filters'](_[_0xb986('0x37')](_0x4da636[_0xb986('0x2e')],_0x4ce5a2['filters']),_0x3107cd);if(_0x4da636[_0xb986('0x2e')]['filter']){_0x47a98e[_0xb986('0x36')]=_[_0xb986('0x38')](_0x47a98e[_0xb986('0x36')],{'$or':_[_0xb986('0x2c')](_0x3107cd,function(_0xee696e){if(_0xee696e['type']!==_0xb986('0x39')){var _0x100f6d={};_0x100f6d[_0xee696e['name']]={'$like':'%'+_0x4da636['query'][_0xb986('0x3a')]+'%'};return _0x100f6d;}})});}_0x47a98e=_[_0xb986('0x38')]({},_0x47a98e,_0x4da636[_0xb986('0x3b')]);var _0x5dec66={'where':_0x47a98e[_0xb986('0x36')]};return db[_0xb986('0x27')][_0xb986('0x1c')](_0x5dec66)['then'](function(_0x4e1cda){_0xbab079['count']=_0x4e1cda;if(_0x4da636['query']['includeAll']){_0x47a98e[_0xb986('0x3c')]=[{'all':!![]}];}return db[_0xb986('0x27')][_0xb986('0x3d')](_0x47a98e);})[_0xb986('0x22')](function(_0x3b4b47){_0xbab079[_0xb986('0x3e')]=_0x3b4b47;return _0xbab079;})['then'](respondWithFilteredResult(_0x4caf9c,_0x47a98e))[_0xb986('0x3f')](handleError(_0x4caf9c,null));};exports['show']=function(_0x267d57,_0x2cb072){var _0x4e313a={'raw':!![],'where':{'id':_0x267d57[_0xb986('0x40')]['id']}},_0x279481={};_0x279481[_0xb986('0x2b')]=_[_0xb986('0x2d')](db[_0xb986('0x27')][_0xb986('0x28')]);_0x279481[_0xb986('0x2e')]=_[_0xb986('0x2d')](_0x267d57['query']);_0x279481[_0xb986('0x2f')]=_[_0xb986('0x30')](_0x279481['model'],_0x279481[_0xb986('0x2e')]);_0x4e313a['attributes']=_[_0xb986('0x30')](_0x279481['model'],qs[_0xb986('0x32')](_0x267d57[_0xb986('0x2e')][_0xb986('0x32')]));_0x4e313a[_0xb986('0x31')]=_0x4e313a['attributes'][_0xb986('0x33')]?_0x4e313a[_0xb986('0x31')]:_0x279481[_0xb986('0x2b')];if(_0x267d57[_0xb986('0x2e')][_0xb986('0x41')]){_0x4e313a['include']=[{'all':!![]}];}_0x4e313a=_[_0xb986('0x38')]({},_0x4e313a,_0x267d57[_0xb986('0x3b')]);return db['MailTransferReport'][_0xb986('0x42')](_0x4e313a)['then'](handleEntityNotFound(_0x2cb072,null))[_0xb986('0x22')](respondWithResult(_0x2cb072,null))[_0xb986('0x3f')](handleError(_0x2cb072,null));};exports[_0xb986('0x43')]=function(_0x2996f8,_0x47245e){return db[_0xb986('0x27')]['create'](_0x2996f8[_0xb986('0x44')],{})[_0xb986('0x22')](respondWithResult(_0x47245e,0xc9))[_0xb986('0x3f')](handleError(_0x47245e,null));};exports[_0xb986('0x21')]=function(_0x254d80,_0x5a52d0){if(_0x254d80['body']['id']){delete _0x254d80['body']['id'];}return db[_0xb986('0x27')][_0xb986('0x42')]({'where':{'id':_0x254d80[_0xb986('0x40')]['id']}})[_0xb986('0x22')](handleEntityNotFound(_0x5a52d0,null))[_0xb986('0x22')](saveUpdates(_0x254d80[_0xb986('0x44')],null))['then'](respondWithResult(_0x5a52d0,null))[_0xb986('0x3f')](handleError(_0x5a52d0,null));};exports[_0xb986('0x45')]=function(_0x2e64c7,_0x2b5b08){return db[_0xb986('0x27')][_0xb986('0x42')]({'where':{'id':_0x2e64c7[_0xb986('0x40')]['id']}})[_0xb986('0x22')](handleEntityNotFound(_0x2b5b08,null))[_0xb986('0x22')](removeEntity(_0x2b5b08,null))[_0xb986('0x3f')](handleError(_0x2b5b08,null));};exports[_0xb986('0x46')]=function(_0x1da165,_0x5e53f3){return db[_0xb986('0x27')][_0xb986('0x46')]()[_0xb986('0x22')](respondWithResult(_0x5e53f3,null))[_0xb986('0x3f')](handleError(_0x5e53f3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 078338a..164a407 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 _0xc0a4=['report_mail_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport'];(function(_0x4ec4f8,_0x1098cc){var _0x573b24=function(_0x10addc){while(--_0x10addc){_0x4ec4f8['push'](_0x4ec4f8['shift']());}};_0x573b24(++_0x1098cc);}(_0xc0a4,0x147));var _0x4c0a=function(_0x54397b,_0x1c2899){_0x54397b=_0x54397b-0x0;var _0x3cd405=_0xc0a4[_0x54397b];return _0x3cd405;};'use strict';var _=require('lodash');var util=require(_0x4c0a('0x0'));var logger=require(_0x4c0a('0x1'))(_0x4c0a('0x2'));var moment=require('moment');var BPromise=require(_0x4c0a('0x3'));var rp=require(_0x4c0a('0x4'));var fs=require('fs');var path=require(_0x4c0a('0x5'));var rimraf=require(_0x4c0a('0x6'));var config=require(_0x4c0a('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x4c0a('0x8')]=function(_0x1a78a1,_0x12af4b){return _0x1a78a1[_0x4c0a('0x9')](_0x4c0a('0xa'),attributes,{'tableName':_0x4c0a('0xb'),'paranoid':![],'indexes':[{'name':_0x4c0a('0xc'),'fields':[_0x4c0a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x448b=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x43e48f,_0x83b79a){var _0x3212b5=function(_0x4d8347){while(--_0x4d8347){_0x43e48f['push'](_0x43e48f['shift']());}};_0x3212b5(++_0x83b79a);}(_0x448b,0x125));var _0xb448=function(_0x5d94e3,_0x5ad3bc){_0x5d94e3=_0x5d94e3-0x0;var _0x1a38ee=_0x448b[_0x5d94e3];return _0x1a38ee;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var logger=require(_0xb448('0x2'))(_0xb448('0x3'));var moment=require(_0xb448('0x4'));var BPromise=require(_0xb448('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb448('0x6'));var rimraf=require(_0xb448('0x7'));var config=require(_0xb448('0x8'));var attributes=require(_0xb448('0x9'));module[_0xb448('0xa')]=function(_0x276466,_0x3670cb){return _0x276466['define'](_0xb448('0xb'),attributes,{'tableName':_0xb448('0xc'),'paranoid':![],'indexes':[{'name':_0xb448('0xd'),'fields':[_0xb448('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f0090ba..022e7b7 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 _0x2f8a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x13eed4,_0x87b2d9){var _0xa34c29=function(_0x507f60){while(--_0x507f60){_0x13eed4['push'](_0x13eed4['shift']());}};_0xa34c29(++_0x87b2d9);}(_0x2f8a,0x18c));var _0xa2f8=function(_0x220349,_0x4034dd){_0x220349=_0x220349-0x0;var _0x21347c=_0x2f8a[_0x220349];return _0x21347c;};'use strict';var _=require('lodash');var util=require(_0xa2f8('0x0'));var moment=require(_0xa2f8('0x1'));var BPromise=require(_0xa2f8('0x2'));var rs=require(_0xa2f8('0x3'));var fs=require('fs');var Redis=require(_0xa2f8('0x4'));var db=require(_0xa2f8('0x5'))['db'];var utils=require(_0xa2f8('0x6'));var logger=require(_0xa2f8('0x7'))(_0xa2f8('0x8'));var config=require(_0xa2f8('0x9'));var jayson=require(_0xa2f8('0xa'));var client=jayson[_0xa2f8('0xb')][_0xa2f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x215d10,_0x4e631f,_0x10e833){return new BPromise(function(_0x626636,_0x5d089c){return client[_0xa2f8('0xd')](_0x215d10,_0x10e833)[_0xa2f8('0xe')](function(_0x34be98){logger[_0xa2f8('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4e631f,_0xa2f8('0x10'));logger['debug'](_0xa2f8('0x11'),_0x4e631f,_0xa2f8('0x10'),JSON[_0xa2f8('0x12')](_0x34be98));if(_0x34be98[_0xa2f8('0x13')]){if(_0x34be98['error'][_0xa2f8('0x14')]===0x1f4){logger[_0xa2f8('0x13')](_0xa2f8('0x15'),_0x4e631f,_0x34be98[_0xa2f8('0x13')][_0xa2f8('0x16')]);return _0x5d089c(_0x34be98[_0xa2f8('0x13')][_0xa2f8('0x16')]);}logger[_0xa2f8('0x13')](_0xa2f8('0x15'),_0x4e631f,_0x34be98[_0xa2f8('0x13')][_0xa2f8('0x16')]);return _0x626636(_0x34be98[_0xa2f8('0x13')][_0xa2f8('0x16')]);}else{logger[_0xa2f8('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4e631f,'request\x20sent');_0x626636(_0x34be98[_0xa2f8('0x17')][_0xa2f8('0x16')]);}})[_0xa2f8('0x18')](function(_0x417974){logger[_0xa2f8('0x13')](_0xa2f8('0x15'),_0x4e631f,_0x417974);_0x5d089c(_0x417974);});});} \ No newline at end of file +var _0x41cf=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x38a7b0,_0x14de68){var _0x43d085=function(_0x1e91c7){while(--_0x1e91c7){_0x38a7b0['push'](_0x38a7b0['shift']());}};_0x43d085(++_0x14de68);}(_0x41cf,0x126));var _0xf41c=function(_0x1bd85d,_0xdc683f){_0x1bd85d=_0x1bd85d-0x0;var _0xd40669=_0x41cf[_0x1bd85d];return _0xd40669;};'use strict';var _=require('lodash');var util=require(_0xf41c('0x0'));var moment=require('moment');var BPromise=require(_0xf41c('0x1'));var rs=require(_0xf41c('0x2'));var fs=require('fs');var Redis=require(_0xf41c('0x3'));var db=require(_0xf41c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf41c('0x5'));var config=require(_0xf41c('0x6'));var jayson=require(_0xf41c('0x7'));var client=jayson[_0xf41c('0x8')][_0xf41c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x444dd4,_0xb0cac9,_0x28a66f){return new BPromise(function(_0xc5ead8,_0x339903){return client['request'](_0x444dd4,_0x28a66f)[_0xf41c('0xa')](function(_0x586ca5){logger[_0xf41c('0xb')](_0xf41c('0xc'),_0xb0cac9,_0xf41c('0xd'));logger[_0xf41c('0xe')](_0xf41c('0xf'),_0xb0cac9,_0xf41c('0xd'),JSON[_0xf41c('0x10')](_0x586ca5));if(_0x586ca5[_0xf41c('0x11')]){if(_0x586ca5[_0xf41c('0x11')][_0xf41c('0x12')]===0x1f4){logger[_0xf41c('0x11')](_0xf41c('0xc'),_0xb0cac9,_0x586ca5[_0xf41c('0x11')]['message']);return _0x339903(_0x586ca5[_0xf41c('0x11')][_0xf41c('0x13')]);}logger[_0xf41c('0x11')](_0xf41c('0xc'),_0xb0cac9,_0x586ca5[_0xf41c('0x11')]['message']);return _0xc5ead8(_0x586ca5[_0xf41c('0x11')]['message']);}else{logger[_0xf41c('0xb')](_0xf41c('0xc'),_0xb0cac9,_0xf41c('0xd'));_0xc5ead8(_0x586ca5[_0xf41c('0x14')][_0xf41c('0x13')]);}})[_0xf41c('0x15')](function(_0x4e8d4f){logger[_0xf41c('0x11')]('MailTransferReport,\x20%s,\x20%s',_0xb0cac9,_0x4e8d4f);_0x339903(_0x4e8d4f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 21f0659..92007ea 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 _0xc752=['get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc0eacc,_0x1ef0ad){var _0x1742a8=function(_0x3c413d){while(--_0x3c413d){_0xc0eacc['push'](_0xc0eacc['shift']());}};_0x1742a8(++_0x1ef0ad);}(_0xc752,0xa6));var _0x2c75=function(_0x4aad42,_0x4b065a){_0x4aad42=_0x4aad42-0x0;var _0x24fb73=_0xc752[_0x4aad42];return _0x24fb73;};'use strict';var multer=require(_0x2c75('0x0'));var util=require(_0x2c75('0x1'));var path=require(_0x2c75('0x2'));var timeout=require(_0x2c75('0x3'));var express=require(_0x2c75('0x4'));var router=express[_0x2c75('0x5')]();var fs_extra=require(_0x2c75('0x6'));var auth=require(_0x2c75('0x7'));var interaction=require(_0x2c75('0x8'));var config=require(_0x2c75('0x9'));var controller=require('./memberReport.controller');router[_0x2c75('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2c75('0xa')](_0x2c75('0xb'),auth[_0x2c75('0xc')](),controller[_0x2c75('0xd')]);router[_0x2c75('0xa')](_0x2c75('0xe'),auth[_0x2c75('0xc')](),controller[_0x2c75('0xf')]);router[_0x2c75('0x10')]('/',auth[_0x2c75('0xc')](),controller[_0x2c75('0x11')]);router[_0x2c75('0x12')](_0x2c75('0xe'),auth[_0x2c75('0xc')](),controller[_0x2c75('0x13')]);router['delete'](_0x2c75('0xe'),auth[_0x2c75('0xc')](),controller[_0x2c75('0x14')]);module[_0x2c75('0x15')]=router; \ No newline at end of file +var _0x2b35=['index','/:id','show','post','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x39a6ca,_0x10c9f0){var _0x752c2f=function(_0x3f6ed1){while(--_0x3f6ed1){_0x39a6ca['push'](_0x39a6ca['shift']());}};_0x752c2f(++_0x10c9f0);}(_0x2b35,0xd4));var _0x52b3=function(_0x1a88ea,_0x1c112b){_0x1a88ea=_0x1a88ea-0x0;var _0x38eb16=_0x2b35[_0x1a88ea];return _0x38eb16;};'use strict';var multer=require('multer');var util=require(_0x52b3('0x0'));var path=require(_0x52b3('0x1'));var timeout=require('connect-timeout');var express=require(_0x52b3('0x2'));var router=express[_0x52b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x52b3('0x4'));var interaction=require(_0x52b3('0x5'));var config=require(_0x52b3('0x6'));var controller=require('./memberReport.controller');router[_0x52b3('0x7')]('/',auth[_0x52b3('0x8')](),controller[_0x52b3('0x9')]);router[_0x52b3('0x7')]('/describe',auth[_0x52b3('0x8')](),controller['describe']);router[_0x52b3('0x7')](_0x52b3('0xa'),auth['isAuthenticated'](),controller[_0x52b3('0xb')]);router[_0x52b3('0xc')]('/',auth[_0x52b3('0x8')](),controller[_0x52b3('0xd')]);router[_0x52b3('0xe')](_0x52b3('0xa'),auth[_0x52b3('0x8')](),controller[_0x52b3('0xf')]);router['delete'](_0x52b3('0xa'),auth[_0x52b3('0x8')](),controller[_0x52b3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f7e5336..d60f743 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 _0x64c4=['INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0xb3275c,_0x2623c3){var _0x58e50b=function(_0x2303a3){while(--_0x2303a3){_0xb3275c['push'](_0xb3275c['shift']());}};_0x58e50b(++_0x2623c3);}(_0x64c4,0x11b));var _0x464c=function(_0x44b2f8,_0x988781){_0x44b2f8=_0x44b2f8-0x0;var _0x535c56=_0x64c4[_0x44b2f8];return _0x535c56;};'use strict';var Sequelize=require(_0x464c('0x0'));var moment=require(_0x464c('0x1'));module[_0x464c('0x2')]={'channel':{'type':Sequelize[_0x464c('0x3')]},'membername':{'type':Sequelize[_0x464c('0x3')]},'interface':{'type':Sequelize[_0x464c('0x3')]},'type':{'type':Sequelize[_0x464c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x464c('0x4')},'duration':{'type':Sequelize[_0x464c('0x5')]},'enterAt':{'type':Sequelize[_0x464c('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x50f541){var _0x1ddd0b=moment(_0x50f541);var _0x5518bd=moment(this[_0x464c('0x7')](_0x464c('0x8')));var _0x1100b0=_0x1ddd0b['diff'](_0x5518bd,_0x464c('0x9'));this[_0x464c('0xa')]('exitAt',_0x50f541);this[_0x464c('0xa')](_0x464c('0xb'),_0x1100b0>=0x0?_0x1100b0:null);}},'data1':{'type':Sequelize[_0x464c('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x464c('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x464c('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x464c('0xe')},'data5':{'type':Sequelize[_0x464c('0x3')],'comment':_0x464c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x464c('0x3')]}}; \ No newline at end of file +var _0x0539=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','seconds'];(function(_0x1cb827,_0x1619cc){var _0xea3c40=function(_0x3aa9df){while(--_0x3aa9df){_0x1cb827['push'](_0x1cb827['shift']());}};_0xea3c40(++_0x1619cc);}(_0x0539,0x107));var _0x9053=function(_0x59c8b5,_0x494197){_0x59c8b5=_0x59c8b5-0x0;var _0x748332=_0x0539[_0x59c8b5];return _0x748332;};'use strict';var Sequelize=require(_0x9053('0x0'));var moment=require(_0x9053('0x1'));module[_0x9053('0x2')]={'channel':{'type':Sequelize[_0x9053('0x3')]},'membername':{'type':Sequelize[_0x9053('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9053('0x3')],'defaultValue':_0x9053('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x9053('0x5')]},'enterAt':{'type':Sequelize[_0x9053('0x6')]},'exitAt':{'type':Sequelize[_0x9053('0x6')],'set':function(_0x59bfe8){var _0x187f79=moment(_0x59bfe8);var _0x3748f9=moment(this['getDataValue'](_0x9053('0x7')));var _0x4716f2=_0x187f79['diff'](_0x3748f9,_0x9053('0x8'));this[_0x9053('0x9')](_0x9053('0xa'),_0x59bfe8);this[_0x9053('0x9')](_0x9053('0xb'),_0x4716f2>=0x0?_0x4716f2:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x9053('0xc')},'data2':{'type':Sequelize[_0x9053('0x3')],'comment':_0x9053('0xd')},'data3':{'type':Sequelize[_0x9053('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x9053('0x3')],'comment':_0x9053('0xe')},'data5':{'type':Sequelize[_0x9053('0x3')],'comment':_0x9053('0xf')},'role':{'type':Sequelize[_0x9053('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 888a991..5bb1c47 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x333159,_0x68262e){var _0x2e29ac=function(_0xf4f1f){while(--_0xf4f1f){_0x333159['push'](_0x333159['shift']());}};_0x2e29ac(++_0x68262e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x52dfa9,_0x306d3f){var _0xdfaa57=function(_0x9991c6){while(--_0x9991c6){_0x52dfa9['push'](_0x52dfa9['shift']());}};_0xdfaa57(++_0x306d3f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2dec9f1..ac8cc44 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 _0x42d4=['util','moment','bluebird','request-promise','rimraf','exports','define','report_member','membername_interface','membername','interface','lodash'];(function(_0x2d8b31,_0x3d216e){var _0x3e02b5=function(_0x44e9f4){while(--_0x44e9f4){_0x2d8b31['push'](_0x2d8b31['shift']());}};_0x3e02b5(++_0x3d216e);}(_0x42d4,0x8f));var _0x442d=function(_0x345284,_0xc566d7){_0x345284=_0x345284-0x0;var _0x5b6f42=_0x42d4[_0x345284];return _0x5b6f42;};'use strict';var _=require(_0x442d('0x0'));var util=require(_0x442d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x442d('0x2'));var BPromise=require(_0x442d('0x3'));var rp=require(_0x442d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x442d('0x5'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x442d('0x6')]=function(_0x4d4471,_0x225e94){return _0x4d4471[_0x442d('0x7')]('MemberReport',attributes,{'tableName':_0x442d('0x8'),'paranoid':![],'indexes':[{'name':_0x442d('0x9'),'fields':[_0x442d('0xa'),_0x442d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa026=['MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0xa026,0x1f4));var _0x6a02=function(_0x26f4f5,_0x53419e){_0x26f4f5=_0x26f4f5-0x0;var _0x91bf0a=_0xa026[_0x26f4f5];return _0x91bf0a;};'use strict';var _=require('lodash');var util=require(_0x6a02('0x0'));var logger=require(_0x6a02('0x1'))('api');var moment=require(_0x6a02('0x2'));var BPromise=require(_0x6a02('0x3'));var rp=require(_0x6a02('0x4'));var fs=require('fs');var path=require(_0x6a02('0x5'));var rimraf=require(_0x6a02('0x6'));var config=require(_0x6a02('0x7'));var attributes=require('./memberReport.attributes');module[_0x6a02('0x8')]=function(_0x14b11e,_0x4c6f17){return _0x14b11e[_0x6a02('0x9')](_0x6a02('0xa'),attributes,{'tableName':_0x6a02('0xb'),'paranoid':![],'indexes':[{'name':_0x6a02('0xc'),'fields':[_0x6a02('0xd'),_0x6a02('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 9c75dd6..6ecbffc 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 _0xfcbe=['info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','debug','CreateMemberReport','UpdateMemberReport','update','body','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then'];(function(_0x3f4822,_0x310403){var _0xb8f85=function(_0x2772a2){while(--_0x2772a2){_0x3f4822['push'](_0x3f4822['shift']());}};_0xb8f85(++_0x310403);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x2ebe0a,_0x3b0570){_0x2ebe0a=_0x2ebe0a-0x0;var _0x29ca01=_0xfcbe[_0x2ebe0a];return _0x29ca01;};'use strict';var _=require('lodash');var util=require(_0xefcb('0x0'));var moment=require(_0xefcb('0x1'));var BPromise=require(_0xefcb('0x2'));var rs=require(_0xefcb('0x3'));var fs=require('fs');var Redis=require(_0xefcb('0x4'));var db=require(_0xefcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xefcb('0x6'))(_0xefcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xefcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e15ab,_0x4bacb4,_0x4697fe){return new BPromise(function(_0x55cad2,_0x100aa1){return client[_0xefcb('0x9')](_0x4e15ab,_0x4697fe)[_0xefcb('0xa')](function(_0x5dc9cd){logger[_0xefcb('0xb')](_0xefcb('0xc'),_0x4bacb4,'request\x20sent');logger['debug'](_0xefcb('0xd'),_0x4bacb4,_0xefcb('0xe'),JSON[_0xefcb('0xf')](_0x5dc9cd));if(_0x5dc9cd[_0xefcb('0x10')]){if(_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x11')]===0x1f4){logger['error'](_0xefcb('0xc'),_0x4bacb4,_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);return _0x100aa1(_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x4bacb4,_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);return _0x55cad2(_0x5dc9cd['error'][_0xefcb('0x12')]);}else{logger['info'](_0xefcb('0xc'),_0x4bacb4,'request\x20sent');_0x55cad2(_0x5dc9cd[_0xefcb('0x13')][_0xefcb('0x12')]);}})[_0xefcb('0x14')](function(_0x187f0f){logger[_0xefcb('0x10')](_0xefcb('0xc'),_0x4bacb4,_0x187f0f);_0x100aa1(_0x187f0f);});});}exports['GetMemberReport']=function(_0x15fbec){var _0x8de41a=this;return new Promise(function(_0xe922c7,_0x4884be){return db[_0xefcb('0x15')][_0xefcb('0x16')]({'raw':_0x15fbec[_0xefcb('0x17')]?_0x15fbec['options'][_0xefcb('0x18')]===undefined?!![]:![]:!![],'where':_0x15fbec[_0xefcb('0x17')]?_0x15fbec['options'][_0xefcb('0x19')]||null:null,'attributes':_0x15fbec[_0xefcb('0x17')]?_0x15fbec[_0xefcb('0x17')][_0xefcb('0x1a')]||null:null,'limit':_0x15fbec[_0xefcb('0x17')]?_0x15fbec['options'][_0xefcb('0x1b')]||null:null,'include':_0x15fbec[_0xefcb('0x17')]?_0x15fbec[_0xefcb('0x17')][_0xefcb('0x1c')]?_[_0xefcb('0x1d')](_0x15fbec[_0xefcb('0x17')][_0xefcb('0x1c')],function(_0x2a74f6){return{'model':db[_0x2a74f6['model']],'as':_0x2a74f6['as'],'attributes':_0x2a74f6['attributes'],'include':_0x2a74f6['include']?_[_0xefcb('0x1d')](_0x2a74f6[_0xefcb('0x1c')],function(_0x457ff6){return{'model':db[_0x457ff6[_0xefcb('0x1e')]],'as':_0x457ff6['as'],'attributes':_0x457ff6[_0xefcb('0x1a')],'include':_0x457ff6[_0xefcb('0x1c')]?_[_0xefcb('0x1d')](_0x457ff6['include'],function(_0x3029d1){return{'model':db[_0x3029d1[_0xefcb('0x1e')]],'as':_0x3029d1['as'],'attributes':_0x3029d1[_0xefcb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xefcb('0xa')](function(_0x18f4ef){logger[_0xefcb('0xb')](_0xefcb('0x1f'),_0x15fbec);logger[_0xefcb('0x20')](_0xefcb('0x1f'),_0x15fbec,JSON[_0xefcb('0xf')](_0x18f4ef));_0xe922c7(_0x18f4ef);})[_0xefcb('0x14')](function(_0x160782){logger[_0xefcb('0x10')](_0xefcb('0x1f'),_0x160782[_0xefcb('0x12')],_0x15fbec);_0x4884be(_0x8de41a['error'](0x1f4,_0x160782[_0xefcb('0x12')]));});});};exports[_0xefcb('0x21')]=function(_0x296427){var _0x232d45=this;return new Promise(function(_0x301daa,_0xc83f28){return db[_0xefcb('0x15')]['create'](_0x296427['body'],{'raw':_0x296427[_0xefcb('0x17')]?_0x296427[_0xefcb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xefcb('0xa')](function(_0x3b4f33){logger[_0xefcb('0xb')]('CreateMemberReport',_0x296427);logger[_0xefcb('0x20')](_0xefcb('0x21'),_0x296427,JSON[_0xefcb('0xf')](_0x3b4f33));_0x301daa(_0x3b4f33);})['catch'](function(_0x4fb22f){logger['error']('CreateMemberReport',_0x4fb22f[_0xefcb('0x12')],_0x296427);_0xc83f28(_0x232d45[_0xefcb('0x10')](0x1f4,_0x4fb22f[_0xefcb('0x12')]));});});};exports[_0xefcb('0x22')]=function(_0x2b1759){var _0x352db0=this;return new Promise(function(_0x32562b,_0x293176){return db[_0xefcb('0x15')][_0xefcb('0x23')](_0x2b1759[_0xefcb('0x24')],{'raw':_0x2b1759[_0xefcb('0x17')]?_0x2b1759[_0xefcb('0x17')][_0xefcb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1759[_0xefcb('0x17')]?_0x2b1759[_0xefcb('0x17')]['where']||null:null,'attributes':_0x2b1759[_0xefcb('0x17')]?_0x2b1759[_0xefcb('0x17')][_0xefcb('0x1a')]||null:null,'limit':_0x2b1759[_0xefcb('0x17')]?_0x2b1759['options'][_0xefcb('0x1b')]||null:null})['then'](function(_0x2ca1ee){logger[_0xefcb('0xb')](_0xefcb('0x22'),_0x2b1759);logger[_0xefcb('0x20')]('UpdateMemberReport',_0x2b1759,JSON[_0xefcb('0xf')](_0x2ca1ee));_0x32562b(_0x2ca1ee);})[_0xefcb('0x14')](function(_0x31e7c3){logger['error'](_0xefcb('0x22'),_0x31e7c3[_0xefcb('0x12')],_0x2b1759);_0x293176(_0x352db0[_0xefcb('0x10')](0x1f4,_0x31e7c3['message']));});});}; \ No newline at end of file +var _0x872a=['MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MemberReport','options','raw','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','create','body','catch','UpdateMemberReport','update','where','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x22324b,_0x15da25){var _0x21d630=function(_0x5040f7){while(--_0x5040f7){_0x22324b['push'](_0x22324b['shift']());}};_0x21d630(++_0x15da25);}(_0x872a,0x100));var _0xa872=function(_0x41dca4,_0x4cb3b1){_0x41dca4=_0x41dca4-0x0;var _0x313bec=_0x872a[_0x41dca4];return _0x313bec;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var moment=require(_0xa872('0x2'));var BPromise=require(_0xa872('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa872('0x4'));var logger=require(_0xa872('0x5'))(_0xa872('0x6'));var config=require(_0xa872('0x7'));var jayson=require(_0xa872('0x8'));var client=jayson[_0xa872('0x9')][_0xa872('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aab9d,_0x156bae,_0x1b87b7){return new BPromise(function(_0x1e0c05,_0x1cff1f){return client[_0xa872('0xb')](_0x4aab9d,_0x1b87b7)[_0xa872('0xc')](function(_0x18bbb8){logger[_0xa872('0xd')](_0xa872('0xe'),_0x156bae,_0xa872('0xf'));logger[_0xa872('0x10')](_0xa872('0x11'),_0x156bae,_0xa872('0xf'),JSON[_0xa872('0x12')](_0x18bbb8));if(_0x18bbb8['error']){if(_0x18bbb8[_0xa872('0x13')][_0xa872('0x14')]===0x1f4){logger[_0xa872('0x13')]('MemberReport,\x20%s,\x20%s',_0x156bae,_0x18bbb8[_0xa872('0x13')][_0xa872('0x15')]);return _0x1cff1f(_0x18bbb8[_0xa872('0x13')][_0xa872('0x15')]);}logger[_0xa872('0x13')]('MemberReport,\x20%s,\x20%s',_0x156bae,_0x18bbb8[_0xa872('0x13')]['message']);return _0x1e0c05(_0x18bbb8[_0xa872('0x13')][_0xa872('0x15')]);}else{logger[_0xa872('0xd')](_0xa872('0xe'),_0x156bae,'request\x20sent');_0x1e0c05(_0x18bbb8[_0xa872('0x16')][_0xa872('0x15')]);}})['catch'](function(_0x28fe25){logger[_0xa872('0x13')](_0xa872('0xe'),_0x156bae,_0x28fe25);_0x1cff1f(_0x28fe25);});});}exports['GetMemberReport']=function(_0xa61ab3){var _0x377107=this;return new Promise(function(_0x3c05b5,_0x2ce294){return db[_0xa872('0x17')]['findAll']({'raw':_0xa61ab3[_0xa872('0x18')]?_0xa61ab3['options'][_0xa872('0x19')]===undefined?!![]:![]:!![],'where':_0xa61ab3['options']?_0xa61ab3[_0xa872('0x18')]['where']||null:null,'attributes':_0xa61ab3[_0xa872('0x18')]?_0xa61ab3['options'][_0xa872('0x1a')]||null:null,'limit':_0xa61ab3[_0xa872('0x18')]?_0xa61ab3['options'][_0xa872('0x1b')]||null:null,'include':_0xa61ab3[_0xa872('0x18')]?_0xa61ab3['options'][_0xa872('0x1c')]?_[_0xa872('0x1d')](_0xa61ab3[_0xa872('0x18')][_0xa872('0x1c')],function(_0x167057){return{'model':db[_0x167057[_0xa872('0x1e')]],'as':_0x167057['as'],'attributes':_0x167057[_0xa872('0x1a')],'include':_0x167057['include']?_[_0xa872('0x1d')](_0x167057[_0xa872('0x1c')],function(_0x28876a){return{'model':db[_0x28876a[_0xa872('0x1e')]],'as':_0x28876a['as'],'attributes':_0x28876a[_0xa872('0x1a')],'include':_0x28876a[_0xa872('0x1c')]?_[_0xa872('0x1d')](_0x28876a['include'],function(_0x3f2413){return{'model':db[_0x3f2413['model']],'as':_0x3f2413['as'],'attributes':_0x3f2413[_0xa872('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa872('0xc')](function(_0x1e24c7){logger['info'](_0xa872('0x1f'),_0xa61ab3);logger[_0xa872('0x10')](_0xa872('0x1f'),_0xa61ab3,JSON[_0xa872('0x12')](_0x1e24c7));_0x3c05b5(_0x1e24c7);})['catch'](function(_0x438527){logger['error']('GetMemberReport',_0x438527[_0xa872('0x15')],_0xa61ab3);_0x2ce294(_0x377107['error'](0x1f4,_0x438527[_0xa872('0x15')]));});});};exports[_0xa872('0x20')]=function(_0x45131d){var _0x252831=this;return new Promise(function(_0x391725,_0x4a990d){return db[_0xa872('0x17')][_0xa872('0x21')](_0x45131d[_0xa872('0x22')],{'raw':_0x45131d['options']?_0x45131d[_0xa872('0x18')][_0xa872('0x19')]===undefined?!![]:![]:!![]})[_0xa872('0xc')](function(_0x1d869e){logger[_0xa872('0xd')](_0xa872('0x20'),_0x45131d);logger['debug'](_0xa872('0x20'),_0x45131d,JSON[_0xa872('0x12')](_0x1d869e));_0x391725(_0x1d869e);})[_0xa872('0x23')](function(_0x2e1d93){logger['error'](_0xa872('0x20'),_0x2e1d93[_0xa872('0x15')],_0x45131d);_0x4a990d(_0x252831[_0xa872('0x13')](0x1f4,_0x2e1d93[_0xa872('0x15')]));});});};exports[_0xa872('0x24')]=function(_0x450807){var _0x4fd710=this;return new Promise(function(_0x2241d6,_0x29413d){return db[_0xa872('0x17')][_0xa872('0x25')](_0x450807[_0xa872('0x22')],{'raw':_0x450807[_0xa872('0x18')]?_0x450807[_0xa872('0x18')][_0xa872('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450807[_0xa872('0x18')]?_0x450807[_0xa872('0x18')][_0xa872('0x26')]||null:null,'attributes':_0x450807[_0xa872('0x18')]?_0x450807['options']['attributes']||null:null,'limit':_0x450807['options']?_0x450807['options'][_0xa872('0x1b')]||null:null})[_0xa872('0xc')](function(_0x3f48e8){logger['info'](_0xa872('0x24'),_0x450807);logger[_0xa872('0x10')]('UpdateMemberReport',_0x450807,JSON[_0xa872('0x12')](_0x3f48e8));_0x2241d6(_0x3f48e8);})[_0xa872('0x23')](function(_0x11daca){logger['error'](_0xa872('0x24'),_0x11daca[_0xa872('0x15')],_0x450807);_0x29413d(_0x4fd710[_0xa872('0x13')](0x1f4,_0x11daca['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 68588db..6265b8d 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 _0x58bd=['../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','express','../../components/auth/service'];(function(_0x273ca4,_0xf2e8c6){var _0x5800fb=function(_0x16ff4a){while(--_0x16ff4a){_0x273ca4['push'](_0x273ca4['shift']());}};_0x5800fb(++_0xf2e8c6);}(_0x58bd,0x18b));var _0xd58b=function(_0x17c092,_0x1b64f4){_0x17c092=_0x17c092-0x0;var _0x5f0e19=_0x58bd[_0x17c092];return _0x5f0e19;};'use strict';var multer=require(_0xd58b('0x0'));var util=require(_0xd58b('0x1'));var path=require(_0xd58b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd58b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd58b('0x4'));var interaction=require(_0xd58b('0x5'));var config=require(_0xd58b('0x6'));var controller=require(_0xd58b('0x7'));router[_0xd58b('0x8')]('/',controller['index']);module[_0xd58b('0x9')]=router; \ No newline at end of file +var _0xa1d5=['exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa1d5,0x191));var _0x5a1d=function(_0xd03c16,_0x4999d1){_0xd03c16=_0xd03c16-0x0;var _0x2d9e4c=_0xa1d5[_0xd03c16];return _0x2d9e4c;};'use strict';var multer=require(_0x5a1d('0x0'));var util=require('util');var path=require(_0x5a1d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a1d('0x2')]();var fs_extra=require(_0x5a1d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5a1d('0x4'));var config=require(_0x5a1d('0x5'));var controller=require(_0x5a1d('0x6'));router[_0x5a1d('0x7')]('/',controller[_0x5a1d('0x8')]);module[_0x5a1d('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5756416..170ee23 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 _0xa783=['STRING','version','sequelize'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0xa783,0x18e));var _0x3a78=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xa783[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x3a78('0x0'));module['exports']={'version':{'type':Sequelize[_0x3a78('0x1')],'unique':_0x3a78('0x2')}}; \ No newline at end of file +var _0x07ca=['STRING','version','exports'];(function(_0x4c942c,_0x1058ff){var _0x1ae9a0=function(_0x1f59d2){while(--_0x1f59d2){_0x4c942c['push'](_0x4c942c['shift']());}};_0x1ae9a0(++_0x1058ff);}(_0x07ca,0x6b));var _0xa07c=function(_0x461c18,_0x5605b9){_0x461c18=_0x461c18-0x0;var _0x35501c=_0x07ca[_0x461c18];return _0x35501c;};'use strict';var Sequelize=require('sequelize');module[_0xa07c('0x0')]={'version':{'type':Sequelize[_0xa07c('0x1')],'unique':_0xa07c('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 07817df..988315c 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 _0x4b26=['merge','VIRTUAL','options','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x4a25a8,_0x4d1fcb){var _0x350106=function(_0x19a846){while(--_0x19a846){_0x4a25a8['push'](_0x4a25a8['shift']());}};_0x350106(++_0x4d1fcb);}(_0x4b26,0x123));var _0x64b2=function(_0x58fc37,_0x2eaa0a){_0x58fc37=_0x58fc37-0x0;var _0x48d716=_0x4b26[_0x58fc37];return _0x48d716;};'use strict';var emlformat=require(_0x64b2('0x0'));var rimraf=require(_0x64b2('0x1'));var zipdir=require(_0x64b2('0x2'));var jsonpatch=require(_0x64b2('0x3'));var rp=require(_0x64b2('0x4'));var moment=require(_0x64b2('0x5'));var BPromise=require(_0x64b2('0x6'));var Mustache=require(_0x64b2('0x7'));var util=require(_0x64b2('0x8'));var path=require('path');var sox=require(_0x64b2('0x9'));var csv=require('to-csv');var ejs=require(_0x64b2('0xa'));var fs=require('fs');var fs_extra=require(_0x64b2('0xb'));var _=require('lodash');var squel=require(_0x64b2('0xc'));var crypto=require(_0x64b2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x64b2('0xe'));var toCsv=require(_0x64b2('0xf'));var querystring=require('querystring');var Papa=require(_0x64b2('0x10'));var Redis=require('ioredis');var authService=require(_0x64b2('0x11'));var qs=require(_0x64b2('0x12'));var as=require(_0x64b2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64b2('0x14'))(_0x64b2('0x15'));var utils=require(_0x64b2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x64b2('0x17'))['db'];function respondWithStatusCode(_0x16065e,_0xa57540){_0xa57540=_0xa57540||0xcc;return function(_0x4baf31){if(_0x4baf31){return _0x16065e[_0x64b2('0x18')](_0xa57540);}return _0x16065e[_0x64b2('0x19')](_0xa57540)[_0x64b2('0x1a')]();};}function respondWithResult(_0x468c18,_0x20e4bc){_0x20e4bc=_0x20e4bc||0xc8;return function(_0x182174){if(_0x182174){return _0x468c18['status'](_0x20e4bc)[_0x64b2('0x1b')](_0x182174);}};}function respondWithFilteredResult(_0x4fd45e,_0x2469a8){return function(_0x17e00){if(_0x17e00){var _0x5b38bc=typeof _0x2469a8['offset']===_0x64b2('0x1c')&&typeof _0x2469a8[_0x64b2('0x1d')]===_0x64b2('0x1c');var _0x222d86=_0x17e00[_0x64b2('0x1e')];var _0x102868=_0x5b38bc?0x0:_0x2469a8['offset'];var _0x41fbde=_0x5b38bc?_0x17e00['count']:_0x2469a8[_0x64b2('0x1f')]+_0x2469a8[_0x64b2('0x1d')];var _0x4d4e7c;if(_0x41fbde>=_0x222d86){_0x41fbde=_0x222d86;_0x4d4e7c=0xc8;}else{_0x4d4e7c=0xce;}_0x4fd45e[_0x64b2('0x19')](_0x4d4e7c);return _0x4fd45e[_0x64b2('0x20')]('Content-Range',_0x102868+'-'+_0x41fbde+'/'+_0x222d86)['json'](_0x17e00);}return null;};}function patchUpdates(_0x44b93f){return function(_0x4e5324){try{jsonpatch[_0x64b2('0x21')](_0x4e5324,_0x44b93f,!![]);}catch(_0x44b21a){return BPromise[_0x64b2('0x22')](_0x44b21a);}return _0x4e5324[_0x64b2('0x23')]();};}function saveUpdates(_0x231ecf,_0x21dda2){return function(_0x52912d){if(_0x52912d){return _0x52912d[_0x64b2('0x24')](_0x231ecf)['then'](function(_0x1409a6){return _0x1409a6;});}return null;};}function removeEntity(_0x2c646b,_0x31b926){return function(_0x3c39b4){if(_0x3c39b4){return _0x3c39b4['destroy']()[_0x64b2('0x25')](function(){_0x2c646b[_0x64b2('0x19')](0xcc)[_0x64b2('0x1a')]();});}};}function handleEntityNotFound(_0x38ff34,_0x4c7515){return function(_0x1b4ed8){if(!_0x1b4ed8){_0x38ff34['sendStatus'](0x194);}return _0x1b4ed8;};}function handleError(_0x32684c,_0x222eba){_0x222eba=_0x222eba||0x1f4;return function(_0x5db5de){logger[_0x64b2('0x26')](_0x5db5de[_0x64b2('0x27')]);if(_0x5db5de[_0x64b2('0x28')]){delete _0x5db5de[_0x64b2('0x28')];}_0x32684c[_0x64b2('0x19')](_0x222eba)[_0x64b2('0x29')](_0x5db5de);};}exports[_0x64b2('0x2a')]=function(_0x3b2034,_0x25d5dd){var _0x573200={},_0x4b10e1={},_0x558bb3={'count':0x0,'rows':[]};var _0x53be6d=_[_0x64b2('0x2b')](db[_0x64b2('0x2c')][_0x64b2('0x2d')],function(_0x28ebee){return{'name':_0x28ebee[_0x64b2('0x2e')],'type':_0x28ebee[_0x64b2('0x2f')][_0x64b2('0x30')]};});_0x4b10e1['model']=_[_0x64b2('0x2b')](_0x53be6d,_0x64b2('0x28'));_0x4b10e1[_0x64b2('0x31')]=_[_0x64b2('0x32')](_0x3b2034['query']);_0x4b10e1[_0x64b2('0x33')]=_['intersection'](_0x4b10e1[_0x64b2('0x34')],_0x4b10e1[_0x64b2('0x31')]);_0x573200[_0x64b2('0x35')]=_[_0x64b2('0x36')](_0x4b10e1[_0x64b2('0x34')],qs[_0x64b2('0x37')](_0x3b2034['query']['fields']));_0x573200[_0x64b2('0x35')]=_0x573200[_0x64b2('0x35')][_0x64b2('0x38')]?_0x573200['attributes']:_0x4b10e1[_0x64b2('0x34')];if(!_0x3b2034[_0x64b2('0x31')][_0x64b2('0x39')](_0x64b2('0x3a'))){_0x573200[_0x64b2('0x1d')]=qs[_0x64b2('0x1d')](_0x3b2034[_0x64b2('0x31')][_0x64b2('0x1d')]);_0x573200['offset']=qs[_0x64b2('0x1f')](_0x3b2034['query']['offset']);}_0x573200[_0x64b2('0x3b')]=qs['sort'](_0x3b2034[_0x64b2('0x31')][_0x64b2('0x3c')]);_0x573200[_0x64b2('0x3d')]=qs[_0x64b2('0x33')](_[_0x64b2('0x3e')](_0x3b2034[_0x64b2('0x31')],_0x4b10e1[_0x64b2('0x33')]),_0x53be6d);if(_0x3b2034[_0x64b2('0x31')][_0x64b2('0x3f')]){_0x573200[_0x64b2('0x3d')]=_[_0x64b2('0x40')](_0x573200[_0x64b2('0x3d')],{'$or':_[_0x64b2('0x2b')](_0x53be6d,function(_0xc50eb0){if(_0xc50eb0['type']!==_0x64b2('0x41')){var _0x364d91={};_0x364d91[_0xc50eb0[_0x64b2('0x28')]]={'$like':'%'+_0x3b2034['query'][_0x64b2('0x3f')]+'%'};return _0x364d91;}})});}_0x573200=_[_0x64b2('0x40')]({},_0x573200,_0x3b2034[_0x64b2('0x42')]);var _0x5b4c78={'where':_0x573200[_0x64b2('0x3d')]};return db[_0x64b2('0x2c')]['count'](_0x5b4c78)[_0x64b2('0x25')](function(_0x3c75f1){_0x558bb3[_0x64b2('0x1e')]=_0x3c75f1;if(_0x3b2034[_0x64b2('0x31')][_0x64b2('0x43')]){_0x573200[_0x64b2('0x44')]=[{'all':!![]}];}return db['Migration'][_0x64b2('0x45')](_0x573200);})[_0x64b2('0x25')](function(_0x2edd06){_0x558bb3[_0x64b2('0x46')]=_0x2edd06;return _0x558bb3;})[_0x64b2('0x25')](respondWithFilteredResult(_0x25d5dd,_0x573200))['catch'](handleError(_0x25d5dd,null));}; \ No newline at end of file +var _0xefbf=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','index','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','eml-format'];(function(_0x2037bf,_0x4dc7b8){var _0x193e0d=function(_0x266a18){while(--_0x266a18){_0x2037bf['push'](_0x2037bf['shift']());}};_0x193e0d(++_0x4dc7b8);}(_0xefbf,0x1d4));var _0xfefb=function(_0x8649c,_0x2787f5){_0x8649c=_0x8649c-0x0;var _0x446d03=_0xefbf[_0x8649c];return _0x446d03;};'use strict';var emlformat=require(_0xfefb('0x0'));var rimraf=require(_0xfefb('0x1'));var zipdir=require(_0xfefb('0x2'));var jsonpatch=require(_0xfefb('0x3'));var rp=require(_0xfefb('0x4'));var moment=require(_0xfefb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfefb('0x6'));var util=require(_0xfefb('0x7'));var path=require(_0xfefb('0x8'));var sox=require(_0xfefb('0x9'));var csv=require(_0xfefb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfefb('0xb'));var _=require('lodash');var squel=require(_0xfefb('0xc'));var crypto=require(_0xfefb('0xd'));var jsforce=require(_0xfefb('0xe'));var deskjs=require(_0xfefb('0xf'));var toCsv=require(_0xfefb('0xa'));var querystring=require(_0xfefb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfefb('0x11'));var as=require(_0xfefb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfefb('0x13'))(_0xfefb('0x14'));var utils=require(_0xfefb('0x15'));var config=require(_0xfefb('0x16'));var licenseUtil=require(_0xfefb('0x17'));var db=require(_0xfefb('0x18'))['db'];function respondWithStatusCode(_0x1c4199,_0x20fb12){_0x20fb12=_0x20fb12||0xcc;return function(_0x234e84){if(_0x234e84){return _0x1c4199[_0xfefb('0x19')](_0x20fb12);}return _0x1c4199[_0xfefb('0x1a')](_0x20fb12)[_0xfefb('0x1b')]();};}function respondWithResult(_0x3d839b,_0x577e92){_0x577e92=_0x577e92||0xc8;return function(_0x14d710){if(_0x14d710){return _0x3d839b[_0xfefb('0x1a')](_0x577e92)[_0xfefb('0x1c')](_0x14d710);}};}function respondWithFilteredResult(_0x52d5a6,_0x3e1b32){return function(_0xe55736){if(_0xe55736){var _0x33c8b7=typeof _0x3e1b32[_0xfefb('0x1d')]===_0xfefb('0x1e')&&typeof _0x3e1b32[_0xfefb('0x1f')]===_0xfefb('0x1e');var _0x4d4bcc=_0xe55736[_0xfefb('0x20')];var _0x2e819f=_0x33c8b7?0x0:_0x3e1b32[_0xfefb('0x1d')];var _0x2174fd=_0x33c8b7?_0xe55736[_0xfefb('0x20')]:_0x3e1b32[_0xfefb('0x1d')]+_0x3e1b32[_0xfefb('0x1f')];var _0x134b6f;if(_0x2174fd>=_0x4d4bcc){_0x2174fd=_0x4d4bcc;_0x134b6f=0xc8;}else{_0x134b6f=0xce;}_0x52d5a6['status'](_0x134b6f);return _0x52d5a6[_0xfefb('0x21')]('Content-Range',_0x2e819f+'-'+_0x2174fd+'/'+_0x4d4bcc)[_0xfefb('0x1c')](_0xe55736);}return null;};}function patchUpdates(_0x5d2cc4){return function(_0x5d6860){try{jsonpatch['apply'](_0x5d6860,_0x5d2cc4,!![]);}catch(_0x2ac2a8){return BPromise[_0xfefb('0x22')](_0x2ac2a8);}return _0x5d6860['save']();};}function saveUpdates(_0x3ce0d1,_0x475366){return function(_0x1a8973){if(_0x1a8973){return _0x1a8973[_0xfefb('0x23')](_0x3ce0d1)[_0xfefb('0x24')](function(_0x12824f){return _0x12824f;});}return null;};}function removeEntity(_0x3040a5,_0x19ae4a){return function(_0x8294f1){if(_0x8294f1){return _0x8294f1[_0xfefb('0x25')]()[_0xfefb('0x24')](function(){_0x3040a5[_0xfefb('0x1a')](0xcc)[_0xfefb('0x1b')]();});}};}function handleEntityNotFound(_0x4ffcc2,_0x1886cb){return function(_0x5b3694){if(!_0x5b3694){_0x4ffcc2[_0xfefb('0x19')](0x194);}return _0x5b3694;};}function handleError(_0x1042c2,_0x5d344b){_0x5d344b=_0x5d344b||0x1f4;return function(_0x17f483){logger[_0xfefb('0x26')](_0x17f483[_0xfefb('0x27')]);if(_0x17f483[_0xfefb('0x28')]){delete _0x17f483['name'];}_0x1042c2['status'](_0x5d344b)['send'](_0x17f483);};}exports[_0xfefb('0x29')]=function(_0x182325,_0x296bac){var _0x2bde83={},_0x4b62c7={},_0x29f6f9={'count':0x0,'rows':[]};var _0x114125=_[_0xfefb('0x2a')](db[_0xfefb('0x2b')][_0xfefb('0x2c')],function(_0x780c45){return{'name':_0x780c45['fieldName'],'type':_0x780c45[_0xfefb('0x2d')][_0xfefb('0x2e')]};});_0x4b62c7[_0xfefb('0x2f')]=_[_0xfefb('0x2a')](_0x114125,_0xfefb('0x28'));_0x4b62c7[_0xfefb('0x30')]=_[_0xfefb('0x31')](_0x182325['query']);_0x4b62c7[_0xfefb('0x32')]=_[_0xfefb('0x33')](_0x4b62c7['model'],_0x4b62c7[_0xfefb('0x30')]);_0x2bde83[_0xfefb('0x34')]=_[_0xfefb('0x33')](_0x4b62c7[_0xfefb('0x2f')],qs[_0xfefb('0x35')](_0x182325['query'][_0xfefb('0x35')]));_0x2bde83[_0xfefb('0x34')]=_0x2bde83[_0xfefb('0x34')][_0xfefb('0x36')]?_0x2bde83[_0xfefb('0x34')]:_0x4b62c7[_0xfefb('0x2f')];if(!_0x182325[_0xfefb('0x30')][_0xfefb('0x37')](_0xfefb('0x38'))){_0x2bde83['limit']=qs[_0xfefb('0x1f')](_0x182325[_0xfefb('0x30')][_0xfefb('0x1f')]);_0x2bde83[_0xfefb('0x1d')]=qs['offset'](_0x182325[_0xfefb('0x30')]['offset']);}_0x2bde83[_0xfefb('0x39')]=qs[_0xfefb('0x3a')](_0x182325[_0xfefb('0x30')][_0xfefb('0x3a')]);_0x2bde83[_0xfefb('0x3b')]=qs[_0xfefb('0x32')](_[_0xfefb('0x3c')](_0x182325['query'],_0x4b62c7[_0xfefb('0x32')]),_0x114125);if(_0x182325['query']['filter']){_0x2bde83[_0xfefb('0x3b')]=_[_0xfefb('0x3d')](_0x2bde83[_0xfefb('0x3b')],{'$or':_[_0xfefb('0x2a')](_0x114125,function(_0x5bd9b6){if(_0x5bd9b6[_0xfefb('0x2d')]!==_0xfefb('0x3e')){var _0x30d173={};_0x30d173[_0x5bd9b6[_0xfefb('0x28')]]={'$like':'%'+_0x182325[_0xfefb('0x30')][_0xfefb('0x3f')]+'%'};return _0x30d173;}})});}_0x2bde83=_[_0xfefb('0x3d')]({},_0x2bde83,_0x182325[_0xfefb('0x40')]);var _0x36b542={'where':_0x2bde83[_0xfefb('0x3b')]};return db[_0xfefb('0x2b')][_0xfefb('0x20')](_0x36b542)[_0xfefb('0x24')](function(_0x12e9d0){_0x29f6f9[_0xfefb('0x20')]=_0x12e9d0;if(_0x182325[_0xfefb('0x30')][_0xfefb('0x41')]){_0x2bde83['include']=[{'all':!![]}];}return db[_0xfefb('0x2b')]['findAll'](_0x2bde83);})['then'](function(_0x3dd3a4){_0x29f6f9['rows']=_0x3dd3a4;return _0x29f6f9;})[_0xfefb('0x24')](respondWithFilteredResult(_0x296bac,_0x2bde83))[_0xfefb('0x42')](handleError(_0x296bac,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 6f18c73..36c0908 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 _0x3b95=['rimraf','../../config/environment','exports','define','migrations','lodash','util','../../config/logger','api','request-promise'];(function(_0x2d570c,_0x36afb2){var _0x226026=function(_0xdbc7ea){while(--_0xdbc7ea){_0x2d570c['push'](_0x2d570c['shift']());}};_0x226026(++_0x36afb2);}(_0x3b95,0xa5));var _0x53b9=function(_0x339fd4,_0xf1cb71){_0x339fd4=_0x339fd4-0x0;var _0x3cffe4=_0x3b95[_0x339fd4];return _0x3cffe4;};'use strict';var _=require(_0x53b9('0x0'));var util=require(_0x53b9('0x1'));var logger=require(_0x53b9('0x2'))(_0x53b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53b9('0x5'));var config=require(_0x53b9('0x6'));var attributes=require('./migration.attributes');module[_0x53b9('0x7')]=function(_0x429207,_0x5cfd2b){return _0x429207[_0x53b9('0x8')]('Migration',attributes,{'tableName':_0x53b9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f1b=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','migrations'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3f1b,0x134));var _0xb3f1=function(_0x43971a,_0x2ed038){_0x43971a=_0x43971a-0x0;var _0x328d49=_0x3f1b[_0x43971a];return _0x328d49;};'use strict';var _=require(_0xb3f1('0x0'));var util=require(_0xb3f1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb3f1('0x2'));var BPromise=require(_0xb3f1('0x3'));var rp=require(_0xb3f1('0x4'));var fs=require('fs');var path=require(_0xb3f1('0x5'));var rimraf=require(_0xb3f1('0x6'));var config=require(_0xb3f1('0x7'));var attributes=require('./migration.attributes');module[_0xb3f1('0x8')]=function(_0x1c14ac,_0x5a8c14){return _0x1c14ac[_0xb3f1('0x9')]('Migration',attributes,{'tableName':_0xb3f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index ea915dc..deaa8a1 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 _0x8f37=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8f37,0x190));var _0x78f3=function(_0x3932b4,_0x214db7){_0x3932b4=_0x3932b4-0x0;var _0xc5126c=_0x8f37[_0x3932b4];return _0xc5126c;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var moment=require(_0x78f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f3('0x3'));var db=require(_0x78f3('0x4'))['db'];var utils=require(_0x78f3('0x5'));var logger=require('../../config/logger')(_0x78f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x78f3('0x7'));var client=jayson['client'][_0x78f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc185,_0x492dc7,_0x58bd73){return new BPromise(function(_0x55e353,_0x35d861){return client[_0x78f3('0x9')](_0x3dc185,_0x58bd73)['then'](function(_0x20c081){logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));logger[_0x78f3('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x492dc7,_0x78f3('0xc'),JSON[_0x78f3('0xe')](_0x20c081));if(_0x20c081['error']){if(_0x20c081[_0x78f3('0xf')][_0x78f3('0x10')]===0x1f4){logger[_0x78f3('0xf')]('Migration,\x20%s,\x20%s',_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x35d861(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x55e353(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}else{logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));_0x55e353(_0x20c081[_0x78f3('0x12')][_0x78f3('0x11')]);}})[_0x78f3('0x13')](function(_0x39adfc){logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x39adfc);_0x35d861(_0x39adfc);});});} \ No newline at end of file +var _0x682e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x138293,_0x197e7f){var _0x34c4a2=function(_0x20192b){while(--_0x20192b){_0x138293['push'](_0x138293['shift']());}};_0x34c4a2(++_0x197e7f);}(_0x682e,0x1ce));var _0xe682=function(_0x4988c1,_0x27a504){_0x4988c1=_0x4988c1-0x0;var _0x18b3ee=_0x682e[_0x4988c1];return _0x18b3ee;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var moment=require(_0xe682('0x2'));var BPromise=require(_0xe682('0x3'));var rs=require(_0xe682('0x4'));var fs=require('fs');var Redis=require(_0xe682('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')][_0xe682('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd6995,_0x68a2e3,_0x1ab428){return new BPromise(function(_0x4e7e7d,_0x1817bf){return client[_0xe682('0xd')](_0xd6995,_0x1ab428)[_0xe682('0xe')](function(_0x2c098f){logger[_0xe682('0xf')](_0xe682('0x10'),_0x68a2e3,'request\x20sent');logger[_0xe682('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'),JSON['stringify'](_0x2c098f));if(_0x2c098f['error']){if(_0x2c098f[_0xe682('0x13')][_0xe682('0x14')]===0x1f4){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x1817bf(_0x2c098f['error'][_0xe682('0x15')]);}logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x4e7e7d(_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);}else{logger[_0xe682('0xf')]('Migration,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'));_0x4e7e7d(_0x2c098f['result']['message']);}})['catch'](function(_0x14fc2f){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x14fc2f);_0x1817bf(_0x14fc2f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 308bfbf..5458019 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 _0x9f89=['../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e3005,_0x14f0ec){var _0x36ca7d=function(_0x41275e){while(--_0x41275e){_0x4e3005['push'](_0x4e3005['shift']());}};_0x36ca7d(++_0x14f0ec);}(_0x9f89,0x13d));var _0x99f8=function(_0x312cbb,_0x501f44){_0x312cbb=_0x312cbb-0x0;var _0x29c288=_0x9f89[_0x312cbb];return _0x29c288;};'use strict';var multer=require('multer');var util=require(_0x99f8('0x0'));var path=require('path');var timeout=require(_0x99f8('0x1'));var express=require(_0x99f8('0x2'));var router=express[_0x99f8('0x3')]();var fs_extra=require(_0x99f8('0x4'));var auth=require(_0x99f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99f8('0x6'));var controller=require(_0x99f8('0x7'));router[_0x99f8('0x8')]('/',auth[_0x99f8('0x9')](),controller[_0x99f8('0xa')]);router[_0x99f8('0x8')](_0x99f8('0xb'),auth['isAuthenticated'](),controller[_0x99f8('0xc')]);router[_0x99f8('0xd')]('/',auth[_0x99f8('0x9')](),controller[_0x99f8('0xe')]);router['put'](_0x99f8('0xb'),auth[_0x99f8('0x9')](),controller[_0x99f8('0xf')]);router[_0x99f8('0x10')]('/:id',auth[_0x99f8('0x9')](),controller[_0x99f8('0x11')]);module[_0x99f8('0x12')]=router; \ No newline at end of file +var _0xf277=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x9e72c8,_0x5ac1a9){var _0x1468b2=function(_0x2cac69){while(--_0x2cac69){_0x9e72c8['push'](_0x9e72c8['shift']());}};_0x1468b2(++_0x5ac1a9);}(_0xf277,0x1e1));var _0x7f27=function(_0x46c25d,_0x46e677){_0x46c25d=_0x46c25d-0x0;var _0x474bf2=_0xf277[_0x46c25d];return _0x474bf2;};'use strict';var multer=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var path=require('path');var timeout=require(_0x7f27('0x2'));var express=require('express');var router=express[_0x7f27('0x3')]();var fs_extra=require(_0x7f27('0x4'));var auth=require(_0x7f27('0x5'));var interaction=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var controller=require('./network.controller');router[_0x7f27('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f27('0x9')]);router[_0x7f27('0x8')]('/:id',auth[_0x7f27('0xa')](),controller[_0x7f27('0xb')]);router['post']('/',auth[_0x7f27('0xa')](),controller[_0x7f27('0xc')]);router[_0x7f27('0xd')](_0x7f27('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x7f27('0xf')]('/:id',auth[_0x7f27('0xa')](),controller[_0x7f27('0x10')]);module[_0x7f27('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index eb2612d..852007c 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 _0x510a=['externip','stun','STRING','sequelize','localnet'];(function(_0xc06762,_0x115b96){var _0x48e797=function(_0x154c06){while(--_0x154c06){_0xc06762['push'](_0xc06762['shift']());}};_0x48e797(++_0x115b96);}(_0x510a,0x166));var _0xa510=function(_0x4815b,_0xbcd7ac){_0x4815b=_0x4815b-0x0;var _0x2cbc26=_0x510a[_0x4815b];return _0x2cbc26;};'use strict';var Sequelize=require(_0xa510('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa510('0x1'),_0xa510('0x2'),_0xa510('0x3'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa510('0x4')]},'password':{'type':Sequelize[_0xa510('0x4')]}}; \ No newline at end of file +var _0xb191=['turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xb191,0x10c));var _0x1b19=function(_0x4411f2,_0x5f0f4f){_0x4411f2=_0x4411f2-0x0;var _0x4ed28a=_0xb191[_0x4411f2];return _0x4ed28a;};'use strict';var Sequelize=require(_0x1b19('0x0'));module[_0x1b19('0x1')]={'type':{'type':Sequelize[_0x1b19('0x2')](_0x1b19('0x3'),_0x1b19('0x4'),'stun',_0x1b19('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1b19('0x6')]},'password':{'type':Sequelize[_0x1b19('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e3f1a37..4f781d6 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 _0x4226=['end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','show','params','length','includeAll','find','create','transaction','body','STUN','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','sequelize','server/files/templates/stun_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/turn_xcally.conf','rimraf','moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status'];(function(_0x5a6fb9,_0x26154b){var _0x591b12=function(_0x4759c3){while(--_0x4759c3){_0x5a6fb9['push'](_0x5a6fb9['shift']());}};_0x591b12(++_0x26154b);}(_0x4226,0x1dc));var _0x6422=function(_0x98828d,_0xe82cc4){_0x98828d=_0x98828d-0x0;var _0x215bf3=_0x4226[_0x98828d];return _0x215bf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6422('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6422('0x1'));var BPromise=require(_0x6422('0x2'));var Mustache=require('mustache');var util=require(_0x6422('0x3'));var path=require(_0x6422('0x4'));var sox=require(_0x6422('0x5'));var csv=require(_0x6422('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6422('0x7'));var crypto=require('crypto');var jsforce=require(_0x6422('0x8'));var deskjs=require(_0x6422('0x9'));var toCsv=require('to-csv');var querystring=require(_0x6422('0xa'));var Papa=require(_0x6422('0xb'));var Redis=require('ioredis');var authService=require(_0x6422('0xc'));var qs=require(_0x6422('0xd'));var as=require(_0x6422('0xe'));var hardwareService=require(_0x6422('0xf'));var logger=require(_0x6422('0x10'))(_0x6422('0x11'));var utils=require(_0x6422('0x12'));var config=require(_0x6422('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6422('0x14'))['db'];var jayson=require(_0x6422('0x15'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x399362,_0x2e4b66,_0x47caf2,_0x31afe5){return new BPromise(function(_0x52c5a9,_0xa810b4){var _0x44421e=_0x31afe5||client;return _0x44421e[_0x6422('0x16')](_0x399362,_0x47caf2)[_0x6422('0x17')](function(_0x5e7103){logger[_0x6422('0x18')](_0x6422('0x19'),_0x2e4b66,_0x6422('0x1a'));logger[_0x6422('0x1b')]('Network,\x20%s,\x20%s,\x20%s',_0x2e4b66,_0x6422('0x1a'),JSON['stringify'](_0x5e7103));if(_0x5e7103[_0x6422('0x1c')]){if(_0x5e7103['error'][_0x6422('0x1d')]===0x1f4){logger[_0x6422('0x1c')](_0x6422('0x19'),_0x2e4b66,_0x5e7103[_0x6422('0x1c')][_0x6422('0x1e')]);return _0xa810b4(_0x5e7103[_0x6422('0x1c')]['message']);}logger['error'](_0x6422('0x19'),_0x2e4b66,_0x5e7103[_0x6422('0x1c')][_0x6422('0x1e')]);return _0x52c5a9(_0x5e7103[_0x6422('0x1c')][_0x6422('0x1e')]);}else{logger[_0x6422('0x18')](_0x6422('0x19'),_0x2e4b66,_0x6422('0x1a'));_0x52c5a9(_0x5e7103['result']['message']);}})[_0x6422('0x1f')](function(_0x531199){logger[_0x6422('0x1c')](_0x6422('0x19'),_0x2e4b66,_0x531199);_0xa810b4(_0x531199);});});}function respondWithStatusCode(_0xb0e33a,_0x5c5ae1){_0x5c5ae1=_0x5c5ae1||0xcc;return function(_0x198ad7){if(_0x198ad7){return _0xb0e33a[_0x6422('0x20')](_0x5c5ae1);}return _0xb0e33a[_0x6422('0x21')](_0x5c5ae1)[_0x6422('0x22')]();};}function respondWithResult(_0x4a16b9,_0x55d714){_0x55d714=_0x55d714||0xc8;return function(_0xfd0571){if(_0xfd0571){return _0x4a16b9[_0x6422('0x21')](_0x55d714)[_0x6422('0x23')](_0xfd0571);}};}function respondWithFilteredResult(_0xca8eb2,_0x277f1a){return function(_0x47c073){if(_0x47c073){var _0x2ae5c3=typeof _0x277f1a[_0x6422('0x24')]===_0x6422('0x25')&&typeof _0x277f1a['limit']===_0x6422('0x25');var _0x26c68e=_0x47c073[_0x6422('0x26')];var _0x551346=_0x2ae5c3?0x0:_0x277f1a[_0x6422('0x24')];var _0x4d8c5c=_0x2ae5c3?_0x47c073['count']:_0x277f1a['offset']+_0x277f1a[_0x6422('0x27')];var _0x2bc665;if(_0x4d8c5c>=_0x26c68e){_0x4d8c5c=_0x26c68e;_0x2bc665=0xc8;}else{_0x2bc665=0xce;}_0xca8eb2[_0x6422('0x21')](_0x2bc665);return _0xca8eb2[_0x6422('0x28')]('Content-Range',_0x551346+'-'+_0x4d8c5c+'/'+_0x26c68e)[_0x6422('0x23')](_0x47c073);}return null;};}function patchUpdates(_0x153402){return function(_0x334f30){try{jsonpatch[_0x6422('0x29')](_0x334f30,_0x153402,!![]);}catch(_0x55ecae){return BPromise[_0x6422('0x2a')](_0x55ecae);}return _0x334f30[_0x6422('0x2b')]();};}function saveUpdates(_0x1aa79a,_0x3b990e){return function(_0x492438){if(_0x492438){return _0x492438[_0x6422('0x2c')](_0x1aa79a)[_0x6422('0x17')](function(_0x504848){return _0x504848;});}return null;};}function removeEntity(_0x5ab495,_0x3fa6cc){return function(_0x4f9b96){if(_0x4f9b96){return _0x4f9b96[_0x6422('0x2d')]()[_0x6422('0x17')](function(){_0x5ab495['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262fc9,_0x173d27){return function(_0x5d0aa6){if(!_0x5d0aa6){_0x262fc9[_0x6422('0x20')](0x194);}return _0x5d0aa6;};}function handleError(_0x39a935,_0x46b047){_0x46b047=_0x46b047||0x1f4;return function(_0xb4727){logger[_0x6422('0x1c')](_0xb4727[_0x6422('0x2e')]);if(_0xb4727['name']){delete _0xb4727[_0x6422('0x2f')];}_0x39a935['status'](_0x46b047)[_0x6422('0x30')](_0xb4727);};}exports[_0x6422('0x31')]=function(_0x287b8c,_0x51865b){var _0x40a4e2={},_0x165d85={},_0x6ba22f={'count':0x0,'rows':[]};var _0xfc3fea=_[_0x6422('0x32')](db[_0x6422('0x33')][_0x6422('0x34')],function(_0x4e29bb){return{'name':_0x4e29bb[_0x6422('0x35')],'type':_0x4e29bb[_0x6422('0x36')][_0x6422('0x37')]};});_0x165d85[_0x6422('0x38')]=_[_0x6422('0x32')](_0xfc3fea,_0x6422('0x2f'));_0x165d85[_0x6422('0x39')]=_[_0x6422('0x3a')](_0x287b8c['query']);_0x165d85[_0x6422('0x3b')]=_['intersection'](_0x165d85['model'],_0x165d85[_0x6422('0x39')]);_0x40a4e2[_0x6422('0x3c')]=_[_0x6422('0x3d')](_0x165d85[_0x6422('0x38')],qs['fields'](_0x287b8c[_0x6422('0x39')][_0x6422('0x3e')]));_0x40a4e2[_0x6422('0x3c')]=_0x40a4e2['attributes']['length']?_0x40a4e2['attributes']:_0x165d85['model'];if(!_0x287b8c[_0x6422('0x39')]['hasOwnProperty'](_0x6422('0x3f'))){_0x40a4e2['limit']=qs[_0x6422('0x27')](_0x287b8c[_0x6422('0x39')][_0x6422('0x27')]);_0x40a4e2[_0x6422('0x24')]=qs[_0x6422('0x24')](_0x287b8c[_0x6422('0x39')]['offset']);}_0x40a4e2[_0x6422('0x40')]=qs[_0x6422('0x41')](_0x287b8c[_0x6422('0x39')][_0x6422('0x41')]);_0x40a4e2[_0x6422('0x42')]=qs[_0x6422('0x3b')](_['pick'](_0x287b8c[_0x6422('0x39')],_0x165d85['filters']),_0xfc3fea);if(_0x287b8c['query']['filter']){_0x40a4e2['where']=_[_0x6422('0x43')](_0x40a4e2[_0x6422('0x42')],{'$or':_['map'](_0xfc3fea,function(_0x5b66b5){if(_0x5b66b5[_0x6422('0x36')]!==_0x6422('0x44')){var _0x35b9fb={};_0x35b9fb[_0x5b66b5[_0x6422('0x2f')]]={'$like':'%'+_0x287b8c[_0x6422('0x39')][_0x6422('0x45')]+'%'};return _0x35b9fb;}})});}_0x40a4e2=_[_0x6422('0x43')]({},_0x40a4e2,_0x287b8c[_0x6422('0x46')]);var _0x2eba78={'where':_0x40a4e2[_0x6422('0x42')]};return db[_0x6422('0x33')]['count'](_0x2eba78)[_0x6422('0x17')](function(_0x325f86){_0x6ba22f[_0x6422('0x26')]=_0x325f86;if(_0x287b8c[_0x6422('0x39')]['includeAll']){_0x40a4e2['include']=[{'all':!![]}];}return db['Network'][_0x6422('0x47')](_0x40a4e2);})['then'](function(_0x1d0bb4){_0x6ba22f[_0x6422('0x48')]=_0x1d0bb4;return _0x6ba22f;})['then'](respondWithFilteredResult(_0x51865b,_0x40a4e2))[_0x6422('0x1f')](handleError(_0x51865b,null));};exports[_0x6422('0x49')]=function(_0x10ace8,_0x22f1fe){var _0x3d915d={'raw':!![],'where':{'id':_0x10ace8[_0x6422('0x4a')]['id']}},_0x2fe87f={};_0x2fe87f[_0x6422('0x38')]=_[_0x6422('0x3a')](db[_0x6422('0x33')][_0x6422('0x34')]);_0x2fe87f[_0x6422('0x39')]=_[_0x6422('0x3a')](_0x10ace8[_0x6422('0x39')]);_0x2fe87f[_0x6422('0x3b')]=_[_0x6422('0x3d')](_0x2fe87f['model'],_0x2fe87f[_0x6422('0x39')]);_0x3d915d[_0x6422('0x3c')]=_[_0x6422('0x3d')](_0x2fe87f[_0x6422('0x38')],qs[_0x6422('0x3e')](_0x10ace8[_0x6422('0x39')]['fields']));_0x3d915d['attributes']=_0x3d915d[_0x6422('0x3c')][_0x6422('0x4b')]?_0x3d915d['attributes']:_0x2fe87f[_0x6422('0x38')];if(_0x10ace8[_0x6422('0x39')][_0x6422('0x4c')]){_0x3d915d['include']=[{'all':!![]}];}_0x3d915d=_[_0x6422('0x43')]({},_0x3d915d,_0x10ace8[_0x6422('0x46')]);return db[_0x6422('0x33')][_0x6422('0x4d')](_0x3d915d)['then'](handleEntityNotFound(_0x22f1fe,null))[_0x6422('0x17')](respondWithResult(_0x22f1fe,null))['catch'](handleError(_0x22f1fe,null));};exports[_0x6422('0x4e')]=function(_0x16b735,_0x3c7eee,_0x42df6f){var _0x3a2a6c;return db['sequelize'][_0x6422('0x4f')](function(_0x59d930){return db[_0x6422('0x33')][_0x6422('0x4e')](_0x16b735[_0x6422('0x50')],{'raw':!![]})[_0x6422('0x17')](function(_0x57112f){_0x3a2a6c=_0x57112f;return db[_0x6422('0x33')][_0x6422('0x47')]({'where':{'type':_0x16b735['body']['type']},'raw':!![]});})[_0x6422('0x17')](function(_0x38762f){if(_0x3a2a6c[_0x6422('0x36')]['toUpperCase']()==_0x6422('0x51')){var _0x44324e=fs['readFileSync'](path[_0x6422('0x52')](config[_0x6422('0x53')],'server/files/templates/stun_multiple.ejs'),_0x6422('0x54'));var _0x3fa118=ejs[_0x6422('0x55')](_0x44324e,{'networks':_0x38762f||[]});fs[_0x6422('0x56')](_0x6422('0x57'),_0x3fa118);return respondWithRpcPromise(_0x6422('0x58'),_0x6422('0x4e'),{'module':_0x6422('0x59')});}else if(_0x3a2a6c[_0x6422('0x36')][_0x6422('0x5a')]()==_0x6422('0x5b')){var _0x323e33=fs[_0x6422('0x5c')](path['join'](config[_0x6422('0x53')],_0x6422('0x5d')),_0x6422('0x54'));var _0x50b813=ejs[_0x6422('0x55')](_0x323e33,{'networks':_0x38762f||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x50b813);return respondWithRpcPromise(_0x6422('0x58'),_0x6422('0x4e'),{'module':_0x6422('0x59')});}else{var _0x3b1792=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],_0x6422('0x5e')),_0x6422('0x54'));var _0x2848e6=ejs['render'](_0x3b1792,{'networks':_0x38762f||[]});fs[_0x6422('0x56')](util[_0x6422('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x16b735['body'][_0x6422('0x36')][_0x6422('0x60')]()),_0x2848e6);return respondWithRpcPromise('Reload',_0x6422('0x4e'),{'module':'chan_sip.so'});}return null;})[_0x6422('0x17')](function(){return _0x3a2a6c;});})['then'](respondWithResult(_0x3c7eee,0xc9))[_0x6422('0x1f')](handleError(_0x3c7eee,null));};exports[_0x6422('0x2c')]=function(_0x4808dd,_0x291ee2,_0x3f4f5f){var _0x1091db;return db[_0x6422('0x61')][_0x6422('0x4f')](function(_0x3ec3b4){return db[_0x6422('0x33')]['find']({'where':{'id':_0x4808dd[_0x6422('0x4a')]['id']}})['then'](handleEntityNotFound(_0x291ee2,null))['then'](saveUpdates(_0x4808dd[_0x6422('0x50')],null))['then'](function(_0x177f1b){if(_0x177f1b){_0x1091db=_0x177f1b;return db['Network'][_0x6422('0x47')]({'where':{'type':_0x1091db[_0x6422('0x36')]},'raw':!![]});}return null;})[_0x6422('0x17')](function(_0x2836bc){if(_0x1091db[_0x6422('0x36')][_0x6422('0x5a')]()==_0x6422('0x51')){var _0x485e59=fs[_0x6422('0x5c')](path['join'](config['root'],_0x6422('0x62')),_0x6422('0x54'));var _0x2a44e7=ejs['render'](_0x485e59,{'networks':_0x2836bc||[]});fs[_0x6422('0x56')](_0x6422('0x57'),_0x2a44e7);return respondWithRpcPromise(_0x6422('0x58'),'update',{'module':_0x6422('0x59')});}else if(_0x1091db[_0x6422('0x36')][_0x6422('0x5a')]()==_0x6422('0x5b')){var _0x5e9f08=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],_0x6422('0x5d')),_0x6422('0x54'));var _0xebdf9e=ejs['render'](_0x5e9f08,{'networks':_0x2836bc||[]});fs[_0x6422('0x56')]('/etc/asterisk/turn_xcally.conf',_0xebdf9e);return respondWithRpcPromise(_0x6422('0x58'),'update',{'module':_0x6422('0x59')});}else{var _0x4a14cd=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],'server/files/templates/network.ejs'),_0x6422('0x54'));var _0x4dcc7f=ejs[_0x6422('0x55')](_0x4a14cd,{'networks':_0x2836bc||[]});fs['writeFileSync'](util[_0x6422('0x5f')](_0x6422('0x63'),_0x4808dd[_0x6422('0x50')][_0x6422('0x36')][_0x6422('0x60')]()),_0x4dcc7f);return respondWithRpcPromise('Reload','update',{'module':_0x6422('0x64')});}return null;})['then'](function(_0x177e30){if(_0x177e30){return _0x1091db;}return null;});})['then'](respondWithResult(_0x291ee2,null))[_0x6422('0x1f')](handleError(_0x291ee2,null));};exports['destroy']=function(_0x2f4adf,_0x486e6c,_0x268a98){var _0x19e1a0;return db['Network']['find']({'where':{'id':_0x2f4adf[_0x6422('0x4a')]['id']}})[_0x6422('0x17')](function(_0x2dc0bc){_0x19e1a0=_0x2dc0bc;return _0x2dc0bc;})[_0x6422('0x17')](handleEntityNotFound(_0x486e6c,null))['then'](removeEntity(_0x486e6c,null))[_0x6422('0x17')](function(){if(_0x19e1a0){return db[_0x6422('0x33')][_0x6422('0x47')]({'where':{'type':_0x19e1a0[_0x6422('0x36')]},'raw':!![]});}})['then'](function(_0x46e38e){if(_0x19e1a0[_0x6422('0x36')]['toUpperCase']()=='STUN'){var _0x3a981c=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],'server/files/templates/stun_multiple.ejs'),_0x6422('0x54'));var _0x584cdc=ejs['render'](_0x3a981c,{'networks':_0x46e38e||[]});fs['writeFileSync'](_0x6422('0x57'),_0x584cdc);return respondWithRpcPromise(_0x6422('0x58'),_0x6422('0x2d'),{'module':'res_stun_monitor.so'});}else if(_0x19e1a0[_0x6422('0x36')][_0x6422('0x5a')]()=='TURN'){var _0x27807e=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],'server/files/templates/turn_multiple.ejs'),_0x6422('0x54'));var _0x4d6b1f=ejs['render'](_0x27807e,{'networks':_0x46e38e||[]});fs[_0x6422('0x56')](_0x6422('0x65'),_0x4d6b1f);return respondWithRpcPromise(_0x6422('0x58'),_0x6422('0x2d'),{'module':'res_stun_monitor.so'});}else{var _0x1d393c=fs[_0x6422('0x5c')](path[_0x6422('0x52')](config[_0x6422('0x53')],_0x6422('0x5e')),_0x6422('0x54'));var _0x125f0c=ejs['render'](_0x1d393c,{'networks':_0x46e38e||[]});fs[_0x6422('0x56')](util[_0x6422('0x5f')](_0x6422('0x63'),_0x2f4adf['body'][_0x6422('0x36')][_0x6422('0x60')]()),_0x125f0c);return respondWithRpcPromise(_0x6422('0x58'),_0x6422('0x2d'),{'module':_0x6422('0x64')});}return null;})[_0x6422('0x1f')](handleError(_0x486e6c,null));}; \ No newline at end of file +var _0x4d52=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','update','stack','name','index','map','Network','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','offset','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','include','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','join','chan_sip.so','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x578ee9,_0x4f8c8c){var _0x2d303f=function(_0x17bbcd){while(--_0x17bbcd){_0x578ee9['push'](_0x578ee9['shift']());}};_0x2d303f(++_0x4f8c8c);}(_0x4d52,0x137));var _0x24d5=function(_0x4b6318,_0x223a37){_0x4b6318=_0x4b6318-0x0;var _0x6c39f=_0x4d52[_0x4b6318];return _0x6c39f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24d5('0x0'));var zipdir=require(_0x24d5('0x1'));var jsonpatch=require(_0x24d5('0x2'));var rp=require(_0x24d5('0x3'));var moment=require(_0x24d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24d5('0x5'));var util=require(_0x24d5('0x6'));var path=require(_0x24d5('0x7'));var sox=require(_0x24d5('0x8'));var csv=require(_0x24d5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24d5('0xa'));var _=require(_0x24d5('0xb'));var squel=require(_0x24d5('0xc'));var crypto=require('crypto');var jsforce=require(_0x24d5('0xd'));var deskjs=require(_0x24d5('0xe'));var toCsv=require(_0x24d5('0x9'));var querystring=require('querystring');var Papa=require(_0x24d5('0xf'));var Redis=require(_0x24d5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x24d5('0x11'));var as=require(_0x24d5('0x12'));var hardwareService=require(_0x24d5('0x13'));var logger=require(_0x24d5('0x14'))('api');var utils=require(_0x24d5('0x15'));var config=require(_0x24d5('0x16'));var licenseUtil=require(_0x24d5('0x17'));var db=require(_0x24d5('0x18'))['db'];var jayson=require(_0x24d5('0x19'));var client=jayson[_0x24d5('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x127152,_0x515fc6,_0xab49be,_0x2eee7c){return new BPromise(function(_0x1fe3a6,_0x18a5af){var _0x3d8ca9=_0x2eee7c||client;return _0x3d8ca9[_0x24d5('0x1b')](_0x127152,_0xab49be)[_0x24d5('0x1c')](function(_0x30202b){logger['info'](_0x24d5('0x1d'),_0x515fc6,_0x24d5('0x1e'));logger[_0x24d5('0x1f')](_0x24d5('0x20'),_0x515fc6,'request\x20sent',JSON[_0x24d5('0x21')](_0x30202b));if(_0x30202b['error']){if(_0x30202b[_0x24d5('0x22')][_0x24d5('0x23')]===0x1f4){logger[_0x24d5('0x22')](_0x24d5('0x1d'),_0x515fc6,_0x30202b[_0x24d5('0x22')][_0x24d5('0x24')]);return _0x18a5af(_0x30202b[_0x24d5('0x22')]['message']);}logger[_0x24d5('0x22')](_0x24d5('0x1d'),_0x515fc6,_0x30202b[_0x24d5('0x22')]['message']);return _0x1fe3a6(_0x30202b[_0x24d5('0x22')][_0x24d5('0x24')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x515fc6,'request\x20sent');_0x1fe3a6(_0x30202b[_0x24d5('0x25')][_0x24d5('0x24')]);}})[_0x24d5('0x26')](function(_0x49b6b9){logger[_0x24d5('0x22')](_0x24d5('0x1d'),_0x515fc6,_0x49b6b9);_0x18a5af(_0x49b6b9);});});}function respondWithStatusCode(_0x514782,_0x4042e7){_0x4042e7=_0x4042e7||0xcc;return function(_0x93a661){if(_0x93a661){return _0x514782[_0x24d5('0x27')](_0x4042e7);}return _0x514782[_0x24d5('0x28')](_0x4042e7)[_0x24d5('0x29')]();};}function respondWithResult(_0x5aea66,_0xd468a4){_0xd468a4=_0xd468a4||0xc8;return function(_0x459055){if(_0x459055){return _0x5aea66[_0x24d5('0x28')](_0xd468a4)['json'](_0x459055);}};}function respondWithFilteredResult(_0x2d4c95,_0x469538){return function(_0x267c01){if(_0x267c01){var _0x316db5=typeof _0x469538['offset']===_0x24d5('0x2a')&&typeof _0x469538[_0x24d5('0x2b')]===_0x24d5('0x2a');var _0x23ce62=_0x267c01[_0x24d5('0x2c')];var _0x3d32df=_0x316db5?0x0:_0x469538['offset'];var _0x796322=_0x316db5?_0x267c01[_0x24d5('0x2c')]:_0x469538['offset']+_0x469538[_0x24d5('0x2b')];var _0x1e64a0;if(_0x796322>=_0x23ce62){_0x796322=_0x23ce62;_0x1e64a0=0xc8;}else{_0x1e64a0=0xce;}_0x2d4c95[_0x24d5('0x28')](_0x1e64a0);return _0x2d4c95[_0x24d5('0x2d')](_0x24d5('0x2e'),_0x3d32df+'-'+_0x796322+'/'+_0x23ce62)[_0x24d5('0x2f')](_0x267c01);}return null;};}function patchUpdates(_0x411245){return function(_0x2e4f7b){try{jsonpatch[_0x24d5('0x30')](_0x2e4f7b,_0x411245,!![]);}catch(_0x3d64ef){return BPromise[_0x24d5('0x31')](_0x3d64ef);}return _0x2e4f7b['save']();};}function saveUpdates(_0x3ad43e,_0x4ee27c){return function(_0x54a818){if(_0x54a818){return _0x54a818[_0x24d5('0x32')](_0x3ad43e)[_0x24d5('0x1c')](function(_0x895505){return _0x895505;});}return null;};}function removeEntity(_0x1420fc,_0x2e290c){return function(_0x35d79a){if(_0x35d79a){return _0x35d79a['destroy']()[_0x24d5('0x1c')](function(){_0x1420fc['status'](0xcc)[_0x24d5('0x29')]();});}};}function handleEntityNotFound(_0x36c1ca,_0x5bc6fc){return function(_0x4df85b){if(!_0x4df85b){_0x36c1ca['sendStatus'](0x194);}return _0x4df85b;};}function handleError(_0x4b1ef0,_0x1fc008){_0x1fc008=_0x1fc008||0x1f4;return function(_0x191bcf){logger[_0x24d5('0x22')](_0x191bcf[_0x24d5('0x33')]);if(_0x191bcf[_0x24d5('0x34')]){delete _0x191bcf[_0x24d5('0x34')];}_0x4b1ef0[_0x24d5('0x28')](_0x1fc008)['send'](_0x191bcf);};}exports[_0x24d5('0x35')]=function(_0x2dac49,_0x66bb63){var _0x40d75e={},_0x5f022d={},_0x16d967={'count':0x0,'rows':[]};var _0x7ee86c=_[_0x24d5('0x36')](db[_0x24d5('0x37')][_0x24d5('0x38')],function(_0x3195c4){return{'name':_0x3195c4[_0x24d5('0x39')],'type':_0x3195c4[_0x24d5('0x3a')]['key']};});_0x5f022d[_0x24d5('0x3b')]=_[_0x24d5('0x36')](_0x7ee86c,'name');_0x5f022d['query']=_[_0x24d5('0x3c')](_0x2dac49['query']);_0x5f022d['filters']=_[_0x24d5('0x3d')](_0x5f022d[_0x24d5('0x3b')],_0x5f022d[_0x24d5('0x3e')]);_0x40d75e[_0x24d5('0x3f')]=_[_0x24d5('0x3d')](_0x5f022d[_0x24d5('0x3b')],qs[_0x24d5('0x40')](_0x2dac49[_0x24d5('0x3e')][_0x24d5('0x40')]));_0x40d75e[_0x24d5('0x3f')]=_0x40d75e['attributes']['length']?_0x40d75e['attributes']:_0x5f022d[_0x24d5('0x3b')];if(!_0x2dac49[_0x24d5('0x3e')]['hasOwnProperty']('nolimit')){_0x40d75e[_0x24d5('0x2b')]=qs['limit'](_0x2dac49[_0x24d5('0x3e')][_0x24d5('0x2b')]);_0x40d75e[_0x24d5('0x41')]=qs[_0x24d5('0x41')](_0x2dac49['query'][_0x24d5('0x41')]);}_0x40d75e[_0x24d5('0x42')]=qs[_0x24d5('0x43')](_0x2dac49[_0x24d5('0x3e')][_0x24d5('0x43')]);_0x40d75e[_0x24d5('0x44')]=qs[_0x24d5('0x45')](_[_0x24d5('0x46')](_0x2dac49['query'],_0x5f022d[_0x24d5('0x45')]),_0x7ee86c);if(_0x2dac49['query'][_0x24d5('0x47')]){_0x40d75e[_0x24d5('0x44')]=_[_0x24d5('0x48')](_0x40d75e[_0x24d5('0x44')],{'$or':_['map'](_0x7ee86c,function(_0x96789d){if(_0x96789d['type']!=='VIRTUAL'){var _0x41a41e={};_0x41a41e[_0x96789d[_0x24d5('0x34')]]={'$like':'%'+_0x2dac49[_0x24d5('0x3e')][_0x24d5('0x47')]+'%'};return _0x41a41e;}})});}_0x40d75e=_[_0x24d5('0x48')]({},_0x40d75e,_0x2dac49[_0x24d5('0x49')]);var _0x4e7e5d={'where':_0x40d75e[_0x24d5('0x44')]};return db[_0x24d5('0x37')][_0x24d5('0x2c')](_0x4e7e5d)[_0x24d5('0x1c')](function(_0x3fcf9d){_0x16d967[_0x24d5('0x2c')]=_0x3fcf9d;if(_0x2dac49[_0x24d5('0x3e')][_0x24d5('0x4a')]){_0x40d75e['include']=[{'all':!![]}];}return db[_0x24d5('0x37')][_0x24d5('0x4b')](_0x40d75e);})[_0x24d5('0x1c')](function(_0x35cf97){_0x16d967[_0x24d5('0x4c')]=_0x35cf97;return _0x16d967;})[_0x24d5('0x1c')](respondWithFilteredResult(_0x66bb63,_0x40d75e))['catch'](handleError(_0x66bb63,null));};exports['show']=function(_0x50eb15,_0x477212){var _0x772552={'raw':!![],'where':{'id':_0x50eb15['params']['id']}},_0x4e253e={};_0x4e253e['model']=_[_0x24d5('0x3c')](db[_0x24d5('0x37')][_0x24d5('0x38')]);_0x4e253e[_0x24d5('0x3e')]=_['keys'](_0x50eb15[_0x24d5('0x3e')]);_0x4e253e[_0x24d5('0x45')]=_[_0x24d5('0x3d')](_0x4e253e[_0x24d5('0x3b')],_0x4e253e[_0x24d5('0x3e')]);_0x772552['attributes']=_[_0x24d5('0x3d')](_0x4e253e[_0x24d5('0x3b')],qs['fields'](_0x50eb15[_0x24d5('0x3e')][_0x24d5('0x40')]));_0x772552[_0x24d5('0x3f')]=_0x772552[_0x24d5('0x3f')]['length']?_0x772552['attributes']:_0x4e253e[_0x24d5('0x3b')];if(_0x50eb15['query']['includeAll']){_0x772552[_0x24d5('0x4d')]=[{'all':!![]}];}_0x772552=_[_0x24d5('0x48')]({},_0x772552,_0x50eb15[_0x24d5('0x49')]);return db['Network'][_0x24d5('0x4e')](_0x772552)[_0x24d5('0x1c')](handleEntityNotFound(_0x477212,null))[_0x24d5('0x1c')](respondWithResult(_0x477212,null))[_0x24d5('0x26')](handleError(_0x477212,null));};exports[_0x24d5('0x4f')]=function(_0x2bbc23,_0x28bb6e,_0x281a46){var _0x2573da;return db[_0x24d5('0x50')][_0x24d5('0x51')](function(_0x33c456){return db['Network']['create'](_0x2bbc23[_0x24d5('0x52')],{'raw':!![]})[_0x24d5('0x1c')](function(_0xe2dd88){_0x2573da=_0xe2dd88;return db[_0x24d5('0x37')][_0x24d5('0x4b')]({'where':{'type':_0x2bbc23[_0x24d5('0x52')][_0x24d5('0x3a')]},'raw':!![]});})[_0x24d5('0x1c')](function(_0x4af008){if(_0x2573da[_0x24d5('0x3a')][_0x24d5('0x53')]()==_0x24d5('0x54')){var _0xff9baf=fs[_0x24d5('0x55')](path['join'](config['root'],_0x24d5('0x56')),_0x24d5('0x57'));var _0x56a466=ejs[_0x24d5('0x58')](_0xff9baf,{'networks':_0x4af008||[]});fs[_0x24d5('0x59')](_0x24d5('0x5a'),_0x56a466);return respondWithRpcPromise(_0x24d5('0x5b'),_0x24d5('0x4f'),{'module':_0x24d5('0x5c')});}else if(_0x2573da[_0x24d5('0x3a')][_0x24d5('0x53')]()==_0x24d5('0x5d')){var _0x2a63a2=fs['readFileSync'](path['join'](config[_0x24d5('0x5e')],_0x24d5('0x5f')),'utf8');var _0x989ac=ejs[_0x24d5('0x58')](_0x2a63a2,{'networks':_0x4af008||[]});fs[_0x24d5('0x59')](_0x24d5('0x60'),_0x989ac);return respondWithRpcPromise(_0x24d5('0x5b'),_0x24d5('0x4f'),{'module':'res_stun_monitor.so'});}else{var _0x4d690f=fs['readFileSync'](path['join'](config[_0x24d5('0x5e')],_0x24d5('0x61')),_0x24d5('0x57'));var _0x2f7d9f=ejs[_0x24d5('0x58')](_0x4d690f,{'networks':_0x4af008||[]});fs[_0x24d5('0x59')](util[_0x24d5('0x62')](_0x24d5('0x63'),_0x2bbc23['body']['type'][_0x24d5('0x64')]()),_0x2f7d9f);return respondWithRpcPromise(_0x24d5('0x5b'),'create',{'module':'chan_sip.so'});}return null;})[_0x24d5('0x1c')](function(){return _0x2573da;});})[_0x24d5('0x1c')](respondWithResult(_0x28bb6e,0xc9))[_0x24d5('0x26')](handleError(_0x28bb6e,null));};exports[_0x24d5('0x32')]=function(_0x4535a6,_0x1f5ede,_0x54473b){var _0x42a1fd;return db[_0x24d5('0x50')][_0x24d5('0x51')](function(_0x31dd50){return db['Network'][_0x24d5('0x4e')]({'where':{'id':_0x4535a6['params']['id']}})[_0x24d5('0x1c')](handleEntityNotFound(_0x1f5ede,null))[_0x24d5('0x1c')](saveUpdates(_0x4535a6[_0x24d5('0x52')],null))['then'](function(_0x475f3f){if(_0x475f3f){_0x42a1fd=_0x475f3f;return db[_0x24d5('0x37')][_0x24d5('0x4b')]({'where':{'type':_0x42a1fd[_0x24d5('0x3a')]},'raw':!![]});}return null;})[_0x24d5('0x1c')](function(_0x3d33b5){if(_0x42a1fd[_0x24d5('0x3a')][_0x24d5('0x53')]()==_0x24d5('0x54')){var _0x10b2ef=fs['readFileSync'](path['join'](config['root'],_0x24d5('0x56')),_0x24d5('0x57'));var _0x5c1215=ejs['render'](_0x10b2ef,{'networks':_0x3d33b5||[]});fs[_0x24d5('0x59')](_0x24d5('0x5a'),_0x5c1215);return respondWithRpcPromise(_0x24d5('0x5b'),_0x24d5('0x32'),{'module':_0x24d5('0x5c')});}else if(_0x42a1fd[_0x24d5('0x3a')]['toUpperCase']()==_0x24d5('0x5d')){var _0x1dfb76=fs[_0x24d5('0x55')](path[_0x24d5('0x65')](config['root'],_0x24d5('0x5f')),_0x24d5('0x57'));var _0x4f7733=ejs[_0x24d5('0x58')](_0x1dfb76,{'networks':_0x3d33b5||[]});fs['writeFileSync'](_0x24d5('0x60'),_0x4f7733);return respondWithRpcPromise(_0x24d5('0x5b'),_0x24d5('0x32'),{'module':_0x24d5('0x5c')});}else{var _0xa631f8=fs[_0x24d5('0x55')](path[_0x24d5('0x65')](config['root'],_0x24d5('0x61')),'utf8');var _0x2cb07a=ejs['render'](_0xa631f8,{'networks':_0x3d33b5||[]});fs[_0x24d5('0x59')](util['format'](_0x24d5('0x63'),_0x4535a6[_0x24d5('0x52')]['type']['toLowerCase']()),_0x2cb07a);return respondWithRpcPromise(_0x24d5('0x5b'),_0x24d5('0x32'),{'module':_0x24d5('0x66')});}return null;})[_0x24d5('0x1c')](function(_0x3efa97){if(_0x3efa97){return _0x42a1fd;}return null;});})[_0x24d5('0x1c')](respondWithResult(_0x1f5ede,null))[_0x24d5('0x26')](handleError(_0x1f5ede,null));};exports[_0x24d5('0x67')]=function(_0xcf023e,_0x18bc71,_0x460924){var _0xcab366;return db['Network']['find']({'where':{'id':_0xcf023e[_0x24d5('0x68')]['id']}})['then'](function(_0x188c87){_0xcab366=_0x188c87;return _0x188c87;})[_0x24d5('0x1c')](handleEntityNotFound(_0x18bc71,null))[_0x24d5('0x1c')](removeEntity(_0x18bc71,null))[_0x24d5('0x1c')](function(){if(_0xcab366){return db[_0x24d5('0x37')]['findAll']({'where':{'type':_0xcab366[_0x24d5('0x3a')]},'raw':!![]});}})[_0x24d5('0x1c')](function(_0x326e98){if(_0xcab366[_0x24d5('0x3a')][_0x24d5('0x53')]()==_0x24d5('0x54')){var _0x50a5ef=fs[_0x24d5('0x55')](path[_0x24d5('0x65')](config[_0x24d5('0x5e')],_0x24d5('0x56')),'utf8');var _0xf4c4f2=ejs[_0x24d5('0x58')](_0x50a5ef,{'networks':_0x326e98||[]});fs['writeFileSync'](_0x24d5('0x5a'),_0xf4c4f2);return respondWithRpcPromise(_0x24d5('0x5b'),'destroy',{'module':_0x24d5('0x5c')});}else if(_0xcab366['type'][_0x24d5('0x53')]()=='TURN'){var _0x448465=fs[_0x24d5('0x55')](path[_0x24d5('0x65')](config[_0x24d5('0x5e')],_0x24d5('0x5f')),_0x24d5('0x57'));var _0x1692f9=ejs[_0x24d5('0x58')](_0x448465,{'networks':_0x326e98||[]});fs[_0x24d5('0x59')](_0x24d5('0x60'),_0x1692f9);return respondWithRpcPromise(_0x24d5('0x5b'),'destroy',{'module':_0x24d5('0x5c')});}else{var _0x34997e=fs[_0x24d5('0x55')](path[_0x24d5('0x65')](config[_0x24d5('0x5e')],_0x24d5('0x61')),_0x24d5('0x57'));var _0x46f3b3=ejs[_0x24d5('0x58')](_0x34997e,{'networks':_0x326e98||[]});fs['writeFileSync'](util[_0x24d5('0x62')](_0x24d5('0x63'),_0xcf023e['body'][_0x24d5('0x3a')][_0x24d5('0x64')]()),_0x46f3b3);return respondWithRpcPromise(_0x24d5('0x5b'),'destroy',{'module':_0x24d5('0x66')});}return null;})[_0x24d5('0x26')](handleError(_0x18bc71,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4ed5a99..cd75e42 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 _0xbe02=['exports','network','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbe02,0x146));var _0x2be0=function(_0x1a5d3c,_0x121970){_0x1a5d3c=_0x1a5d3c-0x0;var _0x5d2e0b=_0xbe02[_0x1a5d3c];return _0x5d2e0b;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var logger=require(_0x2be0('0x2'))(_0x2be0('0x3'));var moment=require('moment');var BPromise=require(_0x2be0('0x4'));var rp=require(_0x2be0('0x5'));var fs=require('fs');var path=require(_0x2be0('0x6'));var rimraf=require(_0x2be0('0x7'));var config=require(_0x2be0('0x8'));var attributes=require(_0x2be0('0x9'));module[_0x2be0('0xa')]=function(_0x474a35,_0x39a2ca){return _0x474a35['define']('Network',attributes,{'tableName':_0x2be0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['define','Network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x18b591,_0x2b65dd){var _0xb6773a=function(_0x39cbb6){while(--_0x39cbb6){_0x18b591['push'](_0x18b591['shift']());}};_0xb6773a(++_0x2b65dd);}(_0x867f,0xe6));var _0xf867=function(_0x2bbbc2,_0x2fd8b9){_0x2bbbc2=_0x2bbbc2-0x0;var _0x1f0319=_0x867f[_0x2bbbc2];return _0x1f0319;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 18637e0..4cebcb6 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4e50f8,_0x1fbcd7){_0x4e50f8=_0x4e50f8-0x0;var _0x3540af=_0x7a54[_0x4e50f8];return _0x3540af;};'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 _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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x3ea9b5,_0x554633){_0x3ea9b5=_0x3ea9b5-0x0;var _0x5c77c4=_0x7a54[_0x3ea9b5];return _0x5c77c4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 37f584d..6e5fbfe 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 _0x7e93=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','addApplications','send','/:id','update','destroy','delete','removeAgents','exports','multer','util','express'];(function(_0x475d45,_0x2cfe44){var _0x46b50e=function(_0x18ddc6){while(--_0x18ddc6){_0x475d45['push'](_0x475d45['shift']());}};_0x46b50e(++_0x2cfe44);}(_0x7e93,0xac));var _0x37e9=function(_0x1c2ff9,_0x2bbc97){_0x1c2ff9=_0x1c2ff9-0x0;var _0x5cc4d3=_0x7e93[_0x1c2ff9];return _0x5cc4d3;};'use strict';var multer=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37e9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37e9('0x3'));var interaction=require(_0x37e9('0x4'));var config=require(_0x37e9('0x5'));var controller=require(_0x37e9('0x6'));router[_0x37e9('0x7')]('/',auth[_0x37e9('0x8')](),controller[_0x37e9('0x9')]);router[_0x37e9('0x7')]('/describe',auth[_0x37e9('0x8')](),controller[_0x37e9('0xa')]);router[_0x37e9('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x37e9('0xb')]);router[_0x37e9('0x7')](_0x37e9('0xc'),auth[_0x37e9('0x8')](),controller[_0x37e9('0xd')]);router[_0x37e9('0x7')](_0x37e9('0xe'),auth[_0x37e9('0x8')](),controller[_0x37e9('0xf')]);router[_0x37e9('0x7')](_0x37e9('0x10'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x11')]);router[_0x37e9('0x7')](_0x37e9('0x12'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x13')]);router[_0x37e9('0x7')](_0x37e9('0x14'),auth['isAuthenticated'](),controller[_0x37e9('0x15')]);router['post']('/',auth[_0x37e9('0x8')](),controller[_0x37e9('0x16')]);router['post'](_0x37e9('0xc'),auth[_0x37e9('0x8')](),controller['addDisposition']);router[_0x37e9('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x37e9('0x18')]);router[_0x37e9('0x17')](_0x37e9('0x19'),controller[_0x37e9('0x1a')]);router[_0x37e9('0x17')](_0x37e9('0x10'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x1b')]);router[_0x37e9('0x17')](_0x37e9('0x14'),auth[_0x37e9('0x8')](),controller['addAgents']);router[_0x37e9('0x17')]('/:id/send',auth[_0x37e9('0x8')](),controller[_0x37e9('0x1c')]);router['put'](_0x37e9('0x1d'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x1e')]);router['delete'](_0x37e9('0x1d'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x1f')]);router[_0x37e9('0x20')]('/:id/dispositions',auth[_0x37e9('0x8')](),controller['removeDispositions']);router[_0x37e9('0x20')](_0x37e9('0xe'),auth[_0x37e9('0x8')](),controller['removeAnswers']);router['delete'](_0x37e9('0x14'),auth[_0x37e9('0x8')](),controller[_0x37e9('0x21')]);module[_0x37e9('0x22')]=router; \ No newline at end of file +var _0x2a58=['getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeAnswers','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2a58,0x159));var _0x82a5=function(_0x4275bb,_0x330697){_0x4275bb=_0x4275bb-0x0;var _0x64ef55=_0x2a58[_0x4275bb];return _0x64ef55;};'use strict';var multer=require(_0x82a5('0x0'));var util=require(_0x82a5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x82a5('0x2'));var router=express[_0x82a5('0x3')]();var fs_extra=require(_0x82a5('0x4'));var auth=require(_0x82a5('0x5'));var interaction=require(_0x82a5('0x6'));var config=require(_0x82a5('0x7'));var controller=require('./openchannelAccount.controller');router[_0x82a5('0x8')]('/',auth[_0x82a5('0x9')](),controller['index']);router[_0x82a5('0x8')](_0x82a5('0xa'),auth[_0x82a5('0x9')](),controller[_0x82a5('0xb')]);router[_0x82a5('0x8')](_0x82a5('0xc'),auth['isAuthenticated'](),controller[_0x82a5('0xd')]);router[_0x82a5('0x8')](_0x82a5('0xe'),auth[_0x82a5('0x9')](),controller[_0x82a5('0xf')]);router['get']('/:id/canned_answers',auth[_0x82a5('0x9')](),controller[_0x82a5('0x10')]);router[_0x82a5('0x8')](_0x82a5('0x11'),auth[_0x82a5('0x9')](),controller['getApplications']);router[_0x82a5('0x8')](_0x82a5('0x12'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x13')]);router[_0x82a5('0x8')](_0x82a5('0x14'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x15')]);router[_0x82a5('0x16')]('/',auth[_0x82a5('0x9')](),controller[_0x82a5('0x17')]);router[_0x82a5('0x16')](_0x82a5('0xe'),auth['isAuthenticated'](),controller[_0x82a5('0x18')]);router[_0x82a5('0x16')](_0x82a5('0x19'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x1a')]);router['post']('/:id/notify',controller[_0x82a5('0x1b')]);router[_0x82a5('0x16')](_0x82a5('0x11'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x1c')]);router[_0x82a5('0x16')](_0x82a5('0x14'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x1d')]);router[_0x82a5('0x16')](_0x82a5('0x1e'),auth[_0x82a5('0x9')](),controller['send']);router[_0x82a5('0x1f')](_0x82a5('0xc'),auth['isAuthenticated'](),controller[_0x82a5('0x20')]);router[_0x82a5('0x21')]('/:id',auth[_0x82a5('0x9')](),controller[_0x82a5('0x22')]);router['delete'](_0x82a5('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x82a5('0x21')](_0x82a5('0x19'),auth[_0x82a5('0x9')](),controller[_0x82a5('0x23')]);router[_0x82a5('0x21')](_0x82a5('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d9cfd10..12b6b27 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 _0x01b0=['sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition'];(function(_0x59e9b0,_0x13187c){var _0x30941e=function(_0x501396){while(--_0x501396){_0x59e9b0['push'](_0x59e9b0['shift']());}};_0x30941e(++_0x13187c);}(_0x01b0,0x18c));var _0x001b=function(_0x4f7dcb,_0x693382){_0x4f7dcb=_0x4f7dcb-0x0;var _0x4537a1=_0x01b0[_0x4f7dcb];return _0x4537a1;};'use strict';var Sequelize=require(_0x001b('0x0'));var rs=require(_0x001b('0x1'));module[_0x001b('0x2')]={'name':{'type':Sequelize[_0x001b('0x3')],'unique':_0x001b('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x001b('0x3')]},'token':{'type':Sequelize[_0x001b('0x3')],'defaultValue':function(){return rs[_0x001b('0x5')]();}},'replyUri':{'type':Sequelize[_0x001b('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x001b('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x001b('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x001b('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x001b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x001b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x001b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x001b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x001b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x001b('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b8736){if(!_0x2b8736)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x001b('0xa'),_0x2b8736);}}}; \ No newline at end of file +var _0xb79c=['sequelize','randomstring','exports','name','STRING','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x3ecf65,_0x3bac13){var _0x1907df=function(_0x247dd9){while(--_0x247dd9){_0x3ecf65['push'](_0x3ecf65['shift']());}};_0x1907df(++_0x3bac13);}(_0xb79c,0xf7));var _0xcb79=function(_0x1c9380,_0x17854b){_0x1c9380=_0x1c9380-0x0;var _0x590346=_0xb79c[_0x1c9380];return _0x590346;};'use strict';var Sequelize=require(_0xcb79('0x0'));var rs=require(_0xcb79('0x1'));module[_0xcb79('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb79('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcb79('0x4')]},'token':{'type':Sequelize[_0xcb79('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xcb79('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcb79('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcb79('0x5')],'defaultValue':function(){return _0xcb79('0x6');}},'notificationSound':{'type':Sequelize[_0xcb79('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcb79('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb79('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcb79('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb79('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb79('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xcb79('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xcb79('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d7abe){if(!_0x4d7abe)this[_0xcb79('0xa')](_0xcb79('0xb'),null);this['setDataValue'](_0xcb79('0xc'),_0x4d7abe);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 6587384..594a784 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 _0x01ac=['fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','from','CmContact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','contact','lastName','messageId','update','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','util','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./openchannelAccount.socket','jayson/promise','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','OpenchannelAccount,\x20%s,\x20%s','message','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes'];(function(_0x56426b,_0x365a0a){var _0x2fc3d8=function(_0x12535a){while(--_0x12535a){_0x56426b['push'](_0x56426b['shift']());}};_0x2fc3d8(++_0x365a0a);}(_0x01ac,0x7e));var _0xc01a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x01ac[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xc01a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc01a('0x1'));var jsonpatch=require(_0xc01a('0x2'));var rp=require(_0xc01a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc01a('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc01a('0x5'));var fs=require('fs');var fs_extra=require(_0xc01a('0x6'));var _=require(_0xc01a('0x7'));var squel=require(_0xc01a('0x8'));var crypto=require(_0xc01a('0x9'));var jsforce=require(_0xc01a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc01a('0xb'));var Papa=require(_0xc01a('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc01a('0xd'));var hardwareService=require(_0xc01a('0xe'));var logger=require(_0xc01a('0xf'))('api');var utils=require(_0xc01a('0x10'));var config=require(_0xc01a('0x11'));var licenseUtil=require(_0xc01a('0x12'));var db=require(_0xc01a('0x13'))['db'];config['redis']=_[_0xc01a('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc01a('0x15'))(new Redis(config[_0xc01a('0x16')]));require(_0xc01a('0x17'))['register'](socket);var jayson=require(_0xc01a('0x18'));var client=jayson['client'][_0xc01a('0x19')]({'port':0x232c});var client9002=jayson[_0xc01a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354b9c,_0x3610fb,_0x252709,_0xb428c0){return new BPromise(function(_0x4455eb,_0x402356){var _0x22f382=_0xb428c0||client;return _0x22f382['request'](_0x354b9c,_0x252709)[_0xc01a('0x1b')](function(_0x328a06){logger[_0xc01a('0x1c')]('OpenchannelAccount,\x20%s,\x20%s',_0x3610fb,'request\x20sent');logger['debug'](_0xc01a('0x1d'),_0x3610fb,_0xc01a('0x1e'),JSON['stringify'](_0x328a06));if(_0x328a06[_0xc01a('0x1f')]){if(_0x328a06[_0xc01a('0x1f')]['code']===0x1f4){logger[_0xc01a('0x1f')](_0xc01a('0x20'),_0x3610fb,_0x328a06['error'][_0xc01a('0x21')]);return _0x402356(_0x328a06[_0xc01a('0x1f')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3610fb,_0x328a06[_0xc01a('0x1f')]['message']);return _0x4455eb(_0x328a06[_0xc01a('0x1f')][_0xc01a('0x21')]);}else{logger[_0xc01a('0x1c')]('OpenchannelAccount,\x20%s,\x20%s',_0x3610fb,_0xc01a('0x1e'));_0x4455eb(_0x328a06['result'][_0xc01a('0x21')]);}})[_0xc01a('0x22')](function(_0x4205ec){logger['error'](_0xc01a('0x20'),_0x3610fb,_0x4205ec);_0x402356(_0x4205ec);});});}function respondWithStatusCode(_0x46b8d9,_0x53dfd1){_0x53dfd1=_0x53dfd1||0xcc;return function(_0x5e2632){if(_0x5e2632){return _0x46b8d9['sendStatus'](_0x53dfd1);}return _0x46b8d9[_0xc01a('0x23')](_0x53dfd1)[_0xc01a('0x24')]();};}function respondWithResult(_0xdefc1a,_0x3109df){_0x3109df=_0x3109df||0xc8;return function(_0x4681b1){if(_0x4681b1){return _0xdefc1a[_0xc01a('0x23')](_0x3109df)['json'](_0x4681b1);}};}function respondWithFilteredResult(_0x256530,_0x8bec92){return function(_0x178b18){if(_0x178b18){var _0x393b68=typeof _0x8bec92[_0xc01a('0x25')]===_0xc01a('0x26')&&typeof _0x8bec92[_0xc01a('0x27')]===_0xc01a('0x26');var _0x59ffaf=_0x178b18[_0xc01a('0x28')];var _0x59e31d=_0x393b68?0x0:_0x8bec92[_0xc01a('0x25')];var _0x397171=_0x393b68?_0x178b18[_0xc01a('0x28')]:_0x8bec92['offset']+_0x8bec92[_0xc01a('0x27')];var _0x318949;if(_0x397171>=_0x59ffaf){_0x397171=_0x59ffaf;_0x318949=0xc8;}else{_0x318949=0xce;}_0x256530[_0xc01a('0x23')](_0x318949);return _0x256530[_0xc01a('0x29')](_0xc01a('0x2a'),_0x59e31d+'-'+_0x397171+'/'+_0x59ffaf)[_0xc01a('0x2b')](_0x178b18);}return null;};}function patchUpdates(_0xa1db95){return function(_0x4d35ce){try{jsonpatch['apply'](_0x4d35ce,_0xa1db95,!![]);}catch(_0x8d67b3){return BPromise[_0xc01a('0x2c')](_0x8d67b3);}return _0x4d35ce['save']();};}function saveUpdates(_0x5f34b5,_0xff6a54){return function(_0x347c1f){if(_0x347c1f){return _0x347c1f['update'](_0x5f34b5)[_0xc01a('0x1b')](function(_0x3c1042){return _0x3c1042;});}return null;};}function removeEntity(_0x198015,_0x4b7dbc){return function(_0x5390ab){if(_0x5390ab){return _0x5390ab['destroy']()[_0xc01a('0x1b')](function(){var _0x4cb8fa=_0x5390ab['get']({'plain':!![]});var _0x1eaf8d=_0xc01a('0x2d');return db[_0xc01a('0x2e')][_0xc01a('0x2f')]({'where':{'type':_0x1eaf8d,'resourceId':_0x4cb8fa['id']}})[_0xc01a('0x1b')](function(){return _0x5390ab;});})[_0xc01a('0x1b')](function(){_0x198015[_0xc01a('0x23')](0xcc)[_0xc01a('0x24')]();});}};}function handleEntityNotFound(_0x8e441,_0x552d49){return function(_0x443bdf){if(!_0x443bdf){_0x8e441[_0xc01a('0x30')](0x194);}return _0x443bdf;};}function handleError(_0x578417,_0x2404d6){_0x2404d6=_0x2404d6||0x1f4;return function(_0xef3dcf){logger[_0xc01a('0x1f')](_0xef3dcf['stack']);if(_0xef3dcf[_0xc01a('0x31')]){delete _0xef3dcf[_0xc01a('0x31')];}_0x578417['status'](_0x2404d6)[_0xc01a('0x32')](_0xef3dcf);};}exports[_0xc01a('0x33')]=function(_0x312dde,_0x565303){var _0x5e814a={'include':[{'model':db[_0xc01a('0x34')],'as':_0xc01a('0x35')}]},_0x4e30e1={},_0x2e7324={'count':0x0,'rows':[]};var _0x3a6559=_[_0xc01a('0x36')](db[_0xc01a('0x37')][_0xc01a('0x38')],function(_0x241546){return{'name':_0x241546[_0xc01a('0x39')],'type':_0x241546[_0xc01a('0x3a')][_0xc01a('0x3b')]};});_0x4e30e1['model']=_[_0xc01a('0x36')](_0x3a6559,'name');_0x4e30e1['query']=_[_0xc01a('0x3c')](_0x312dde[_0xc01a('0x3d')]);_0x4e30e1[_0xc01a('0x3e')]=_[_0xc01a('0x3f')](_0x4e30e1[_0xc01a('0x40')],_0x4e30e1[_0xc01a('0x3d')]);_0x5e814a['attributes']=_[_0xc01a('0x3f')](_0x4e30e1[_0xc01a('0x40')],qs['fields'](_0x312dde['query'][_0xc01a('0x41')]));_0x5e814a[_0xc01a('0x42')]=_0x5e814a[_0xc01a('0x42')][_0xc01a('0x43')]?_0x5e814a[_0xc01a('0x42')]:_0x4e30e1['model'];if(!_0x312dde[_0xc01a('0x3d')]['hasOwnProperty'](_0xc01a('0x44'))){_0x5e814a['limit']=qs[_0xc01a('0x27')](_0x312dde[_0xc01a('0x3d')]['limit']);_0x5e814a[_0xc01a('0x25')]=qs[_0xc01a('0x25')](_0x312dde[_0xc01a('0x3d')][_0xc01a('0x25')]);}_0x5e814a[_0xc01a('0x45')]=qs[_0xc01a('0x46')](_0x312dde[_0xc01a('0x3d')]['sort']);_0x5e814a['where']=qs[_0xc01a('0x3e')](_[_0xc01a('0x47')](_0x312dde[_0xc01a('0x3d')],_0x4e30e1[_0xc01a('0x3e')]),_0x3a6559);if(_0x312dde['query'][_0xc01a('0x48')]){_0x5e814a[_0xc01a('0x49')]=_[_0xc01a('0x4a')](_0x5e814a['where'],{'$or':_[_0xc01a('0x36')](_0x3a6559,function(_0x50f1c1){if(_0x50f1c1['type']!=='VIRTUAL'){var _0x3ef3ec={};_0x3ef3ec[_0x50f1c1['name']]={'$like':'%'+_0x312dde[_0xc01a('0x3d')][_0xc01a('0x48')]+'%'};return _0x3ef3ec;}})});}_0x5e814a=_[_0xc01a('0x4a')]({},_0x5e814a,_0x312dde[_0xc01a('0x4b')]);var _0x9da877={'where':_0x5e814a[_0xc01a('0x49')]};return db['OpenchannelAccount'][_0xc01a('0x28')](_0x9da877)[_0xc01a('0x1b')](function(_0x1cfebc){_0x2e7324[_0xc01a('0x28')]=_0x1cfebc;if(_0x312dde[_0xc01a('0x3d')][_0xc01a('0x4c')]){_0x5e814a[_0xc01a('0x4d')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xc01a('0x4e')](_0x5e814a);})[_0xc01a('0x1b')](function(_0x11f719){_0x2e7324[_0xc01a('0x4f')]=_0x11f719;return _0x2e7324;})[_0xc01a('0x1b')](respondWithFilteredResult(_0x565303,_0x5e814a))[_0xc01a('0x22')](handleError(_0x565303,null));};exports[_0xc01a('0x50')]=function(_0xc761cf,_0x77e4ee){var _0x3c9fed={'raw':![],'where':{'id':_0xc761cf[_0xc01a('0x51')]['id']},'include':[{'model':db[_0xc01a('0x34')],'as':_0xc01a('0x35')}]},_0x439b21={};_0x439b21['model']=_[_0xc01a('0x3c')](db['OpenchannelAccount'][_0xc01a('0x38')]);_0x439b21[_0xc01a('0x3d')]=_[_0xc01a('0x3c')](_0xc761cf[_0xc01a('0x3d')]);_0x439b21[_0xc01a('0x3e')]=_['intersection'](_0x439b21[_0xc01a('0x40')],_0x439b21[_0xc01a('0x3d')]);_0x3c9fed[_0xc01a('0x42')]=_[_0xc01a('0x3f')](_0x439b21[_0xc01a('0x40')],qs[_0xc01a('0x41')](_0xc761cf[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x3c9fed[_0xc01a('0x42')]=_0x3c9fed['attributes'][_0xc01a('0x43')]?_0x3c9fed[_0xc01a('0x42')]:_0x439b21['model'];if(_0xc761cf[_0xc01a('0x3d')][_0xc01a('0x4c')]){_0x3c9fed['include']=[{'all':!![]}];}_0x3c9fed=_[_0xc01a('0x4a')]({},_0x3c9fed,_0xc761cf[_0xc01a('0x4b')]);return db[_0xc01a('0x37')][_0xc01a('0x52')](_0x3c9fed)[_0xc01a('0x1b')](handleEntityNotFound(_0x77e4ee,null))[_0xc01a('0x1b')](respondWithResult(_0x77e4ee,null))['catch'](handleError(_0x77e4ee,null));};exports[_0xc01a('0x53')]=function(_0x40e6ce,_0x3865fb){return db[_0xc01a('0x37')][_0xc01a('0x53')](_0x40e6ce['body'],{})[_0xc01a('0x1b')](function(_0x583f2d){var _0x18b955=_0x40e6ce['user']['get']({'plain':!![]});if(!_0x18b955)throw new Error(_0xc01a('0x54'));if(_0x18b955[_0xc01a('0x55')]===_0xc01a('0x56')){var _0x404c86=_0x583f2d[_0xc01a('0x57')]({'plain':!![]});var _0x395e4a=_0xc01a('0x2d');return db[_0xc01a('0x58')][_0xc01a('0x52')]({'where':{'name':_0x395e4a,'userProfileId':_0x18b955[_0xc01a('0x59')]},'raw':!![]})[_0xc01a('0x1b')](function(_0xead024){if(_0xead024&&_0xead024['autoAssociation']===0x0){return db[_0xc01a('0x2e')][_0xc01a('0x53')]({'name':_0x404c86['name'],'resourceId':_0x404c86['id'],'type':_0xead024[_0xc01a('0x31')],'sectionId':_0xead024['id']},{})[_0xc01a('0x1b')](function(){return _0x583f2d;});}else{return _0x583f2d;}})['catch'](function(_0xd46be1){logger[_0xc01a('0x1f')](_0xc01a('0x5a'),_0xd46be1);throw _0xd46be1;});}return _0x583f2d;})[_0xc01a('0x1b')](respondWithResult(_0x3865fb,0xc9))[_0xc01a('0x22')](handleError(_0x3865fb,null));};exports['update']=function(_0x2acccf,_0x11fc14){if(_0x2acccf[_0xc01a('0x5b')]['id']){delete _0x2acccf[_0xc01a('0x5b')]['id'];}return db['OpenchannelAccount'][_0xc01a('0x52')]({'where':{'id':_0x2acccf[_0xc01a('0x51')]['id']},'include':[{'model':db[_0xc01a('0x34')],'as':_0xc01a('0x35')}]})[_0xc01a('0x1b')](handleEntityNotFound(_0x11fc14,null))[_0xc01a('0x1b')](saveUpdates(_0x2acccf[_0xc01a('0x5b')],null))[_0xc01a('0x1b')](respondWithResult(_0x11fc14,null))[_0xc01a('0x22')](handleError(_0x11fc14,null));};exports['destroy']=function(_0x30f30f,_0x30156d){return db[_0xc01a('0x37')][_0xc01a('0x52')]({'where':{'id':_0x30f30f['params']['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x30156d,null))['then'](removeEntity(_0x30156d,null))[_0xc01a('0x22')](handleError(_0x30156d,null));};exports[_0xc01a('0x5c')]=function(_0x4769ca,_0xea9ac8){return db[_0xc01a('0x37')][_0xc01a('0x5c')]()[_0xc01a('0x1b')](respondWithResult(_0xea9ac8,null))[_0xc01a('0x22')](handleError(_0xea9ac8,null));};exports['addDisposition']=function(_0x315360,_0x120075,_0x20cb53){if(_0x315360['body']['id']){delete _0x315360['body']['id'];}return db[_0xc01a('0x37')][_0xc01a('0x52')]({'where':{'id':_0x315360[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x120075,null))[_0xc01a('0x1b')](function(_0x37131e){if(_0x37131e){_0x315360['body'][_0xc01a('0x5d')]=_0x37131e['id'];return db[_0xc01a('0x5e')][_0xc01a('0x53')](_0x315360[_0xc01a('0x5b')]);}})[_0xc01a('0x1b')](respondWithResult(_0x120075,null))[_0xc01a('0x22')](handleError(_0x120075,null));};exports[_0xc01a('0x5f')]=function(_0x17f04a,_0x2871b5,_0x350287){var _0x40aefa={'raw':![],'where':{}};var _0x4b8c12={};var _0x315da8={'count':0x0,'rows':[]};return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x17f04a[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x2871b5,null))[_0xc01a('0x1b')](function(_0x3c4a31){if(_0x3c4a31){_0x4b8c12[_0xc01a('0x40')]=_[_0xc01a('0x3c')](db[_0xc01a('0x5e')][_0xc01a('0x38')]);_0x4b8c12[_0xc01a('0x3d')]=_[_0xc01a('0x3c')](_0x17f04a[_0xc01a('0x3d')]);_0x4b8c12['filters']=_['intersection'](_0x4b8c12['model'],_0x4b8c12[_0xc01a('0x3d')]);_0x40aefa[_0xc01a('0x42')]=_[_0xc01a('0x3f')](_0x4b8c12[_0xc01a('0x40')],qs[_0xc01a('0x41')](_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x40aefa[_0xc01a('0x42')]=_0x40aefa[_0xc01a('0x42')][_0xc01a('0x43')]?_0x40aefa[_0xc01a('0x42')]:_0x4b8c12[_0xc01a('0x40')];if(!_0x17f04a[_0xc01a('0x3d')]['hasOwnProperty'](_0xc01a('0x44'))){_0x40aefa['limit']=qs[_0xc01a('0x27')](_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x27')]);_0x40aefa['offset']=qs[_0xc01a('0x25')](_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x25')]);}_0x40aefa[_0xc01a('0x45')]=qs[_0xc01a('0x46')](_0x17f04a[_0xc01a('0x3d')]['sort']);_0x40aefa[_0xc01a('0x49')]=qs[_0xc01a('0x3e')](_['pick'](_0x17f04a['query'],_0x4b8c12[_0xc01a('0x3e')]));_0x40aefa[_0xc01a('0x49')][_0xc01a('0x5d')]=_0x3c4a31['id'];if(_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x48')]){_0x40aefa[_0xc01a('0x49')]=_['merge'](_0x40aefa[_0xc01a('0x49')],{'$or':_[_0xc01a('0x36')](_0x40aefa[_0xc01a('0x42')],function(_0x3f39b4){var _0x1de799={};_0x1de799[_0x3f39b4]={'$like':'%'+_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x48')]+'%'};return _0x1de799;})});}_0x40aefa=_[_0xc01a('0x4a')]({},_0x40aefa,_0x17f04a['options']);return db[_0xc01a('0x5e')][_0xc01a('0x28')]({'where':_0x40aefa[_0xc01a('0x49')]})[_0xc01a('0x1b')](function(_0x2f017d){_0x315da8[_0xc01a('0x28')]=_0x2f017d;if(_0x17f04a[_0xc01a('0x3d')][_0xc01a('0x4c')]){_0x40aefa[_0xc01a('0x4d')]=[{'all':!![]}];}return db[_0xc01a('0x5e')][_0xc01a('0x4e')](_0x40aefa);})[_0xc01a('0x1b')](function(_0x3dc849){_0x315da8[_0xc01a('0x4f')]=_0x3dc849;return _0x315da8;});}})[_0xc01a('0x1b')](respondWithFilteredResult(_0x2871b5,_0x40aefa))[_0xc01a('0x22')](handleError(_0x2871b5,null));};exports[_0xc01a('0x61')]=function(_0x1380f3,_0x56bf60,_0x1ff445){return db[_0xc01a('0x37')][_0xc01a('0x52')]({'where':{'id':_0x1380f3[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x56bf60,null))[_0xc01a('0x1b')](function(_0x397215){if(_0x397215){return _0x397215[_0xc01a('0x61')](_0x1380f3['query'][_0xc01a('0x62')]);}})[_0xc01a('0x1b')](respondWithStatusCode(_0x56bf60,null))[_0xc01a('0x22')](handleError(_0x56bf60,null));};exports[_0xc01a('0x63')]=function(_0x353932,_0x386f0a,_0x3bfd17){if(_0x353932[_0xc01a('0x5b')]['id']){delete _0x353932[_0xc01a('0x5b')]['id'];}return db[_0xc01a('0x37')]['find']({'where':{'id':_0x353932[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x386f0a,null))[_0xc01a('0x1b')](function(_0x2e3209){if(_0x2e3209){_0x353932[_0xc01a('0x5b')][_0xc01a('0x5d')]=_0x2e3209['id'];return db[_0xc01a('0x64')][_0xc01a('0x53')](_0x353932[_0xc01a('0x5b')]);}})[_0xc01a('0x1b')](respondWithResult(_0x386f0a,null))[_0xc01a('0x22')](handleError(_0x386f0a,null));};exports[_0xc01a('0x65')]=function(_0x2ac7ce,_0x4f1334,_0x2bcff8){var _0x61d889={'raw':![],'where':{}};var _0x4de037={};var _0x5bd836={'count':0x0,'rows':[]};return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x2ac7ce[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x4f1334,null))[_0xc01a('0x1b')](function(_0x11dc8e){if(_0x11dc8e){_0x4de037[_0xc01a('0x40')]=_[_0xc01a('0x3c')](db[_0xc01a('0x64')][_0xc01a('0x38')]);_0x4de037['query']=_['keys'](_0x2ac7ce[_0xc01a('0x3d')]);_0x4de037[_0xc01a('0x3e')]=_['intersection'](_0x4de037[_0xc01a('0x40')],_0x4de037['query']);_0x61d889['attributes']=_['intersection'](_0x4de037[_0xc01a('0x40')],qs[_0xc01a('0x41')](_0x2ac7ce[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x61d889[_0xc01a('0x42')]=_0x61d889[_0xc01a('0x42')][_0xc01a('0x43')]?_0x61d889[_0xc01a('0x42')]:_0x4de037['model'];if(!_0x2ac7ce[_0xc01a('0x3d')][_0xc01a('0x66')](_0xc01a('0x44'))){_0x61d889[_0xc01a('0x27')]=qs[_0xc01a('0x27')](_0x2ac7ce[_0xc01a('0x3d')][_0xc01a('0x27')]);_0x61d889[_0xc01a('0x25')]=qs['offset'](_0x2ac7ce[_0xc01a('0x3d')]['offset']);}_0x61d889[_0xc01a('0x45')]=qs[_0xc01a('0x46')](_0x2ac7ce[_0xc01a('0x3d')][_0xc01a('0x46')]);_0x61d889[_0xc01a('0x49')]=qs[_0xc01a('0x3e')](_[_0xc01a('0x47')](_0x2ac7ce[_0xc01a('0x3d')],_0x4de037['filters']));_0x61d889[_0xc01a('0x49')][_0xc01a('0x5d')]=_0x11dc8e['id'];if(_0x2ac7ce[_0xc01a('0x3d')]['filter']){_0x61d889[_0xc01a('0x49')]=_['merge'](_0x61d889[_0xc01a('0x49')],{'$or':_['map'](_0x61d889[_0xc01a('0x42')],function(_0x3de0e4){var _0x2e8ce3={};_0x2e8ce3[_0x3de0e4]={'$like':'%'+_0x2ac7ce[_0xc01a('0x3d')][_0xc01a('0x48')]+'%'};return _0x2e8ce3;})});}_0x61d889=_[_0xc01a('0x4a')]({},_0x61d889,_0x2ac7ce[_0xc01a('0x4b')]);return db[_0xc01a('0x64')][_0xc01a('0x28')]({'where':_0x61d889[_0xc01a('0x49')]})['then'](function(_0xf51e92){_0x5bd836[_0xc01a('0x28')]=_0xf51e92;if(_0x2ac7ce['query'][_0xc01a('0x4c')]){_0x61d889[_0xc01a('0x4d')]=[{'all':!![]}];}return db[_0xc01a('0x64')][_0xc01a('0x4e')](_0x61d889);})['then'](function(_0x2ec3ba){_0x5bd836['rows']=_0x2ec3ba;return _0x5bd836;});}})[_0xc01a('0x1b')](respondWithFilteredResult(_0x4f1334,_0x61d889))[_0xc01a('0x22')](handleError(_0x4f1334,null));};exports[_0xc01a('0x67')]=function(_0xbf7c24,_0x34d0dd,_0x11af4a){return db['OpenchannelAccount']['find']({'where':{'id':_0xbf7c24[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x34d0dd,null))[_0xc01a('0x1b')](function(_0x509a01){if(_0x509a01){return _0x509a01['removeAnswers'](_0xbf7c24[_0xc01a('0x3d')][_0xc01a('0x62')]);}})[_0xc01a('0x1b')](respondWithStatusCode(_0x34d0dd,null))[_0xc01a('0x22')](handleError(_0x34d0dd,null));};exports[_0xc01a('0x68')]=function(_0x3257e8,_0x280d3c,_0x1f2c5e){var _0x39a7a0={'body':_0x3257e8[_0xc01a('0x5b')],'channel':_0xc01a('0x69')};var _0x2a0d11=[];var _0x5d1e57=[];var _0x3ac316={};var _0x20389c=![];return db['CmContact'][_0xc01a('0x5c')]()['then'](function(_0x2a8350){if(!_0x2a8350){throw new db[(_0xc01a('0x6a'))][(_0xc01a('0x6b'))](_0xc01a('0x6c'));}_0x2a0d11=_[_0xc01a('0x6d')](_[_0xc01a('0x3c')](_0x2a8350),[_0xc01a('0x6e'),'updatedAt']);_0x5d1e57=_[_0xc01a('0x6d')](_[_0xc01a('0x3c')](_0x2a8350),['createdAt',_0xc01a('0x6f'),_0xc01a('0x70'),_0xc01a('0x71')]);if(_0x3257e8[_0xc01a('0x5b')]['id']){delete _0x3257e8[_0xc01a('0x5b')]['id'];}if(_[_0xc01a('0x72')](_0x3257e8[_0xc01a('0x5b')]['from'])){throw new db['Sequelize'][(_0xc01a('0x6b'))](_0xc01a('0x73'));}if(_[_0xc01a('0x72')](_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x5b')])||_0x3257e8['body'][_0xc01a('0x5b')]===''){throw new db[(_0xc01a('0x6a'))][(_0xc01a('0x6b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc01a('0x72')](_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x74')])){throw new db['Sequelize'][(_0xc01a('0x6b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d1e57);}if(!_[_0xc01a('0x75')](_0x5d1e57,_0x3257e8['body'][_0xc01a('0x74')])){throw new db['Sequelize']['ValidationError'](_0xc01a('0x76')+_0x5d1e57);}_0x3ac316[_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x74')]]=_0x3257e8[_0xc01a('0x5b')]['from'];})[_0xc01a('0x1b')](function(){return db[_0xc01a('0x37')][_0xc01a('0x52')]({'where':{'id':_0x3257e8['params']['id']},'include':[{'model':db[_0xc01a('0x77')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc01a('0x78'),'where':_0x3ac316,'limit':0x1,'order':[[_0xc01a('0x6f'),_0xc01a('0x79')]]}]},{'model':db[_0xc01a('0x7a')],'as':_0xc01a('0x7b')}]});})[_0xc01a('0x1b')](handleEntityNotFound(_0x280d3c,null))[_0xc01a('0x1b')](function(_0x55e71b){if(_0x55e71b&&_0x55e71b[_0xc01a('0x7c')]){_0x39a7a0[_0xc01a('0x7d')]=_0x55e71b;_0x39a7a0[_0xc01a('0x7e')]=_0x55e71b[_0xc01a('0x7b')];_0x39a7a0[_0xc01a('0x7f')]=_0x55e71b['List'];_0x39a7a0[_0xc01a('0x7e')]=_[_0xc01a('0x80')](_0x39a7a0[_0xc01a('0x7e')],[_0xc01a('0x81')],['asc']);if(_0x39a7a0[_0xc01a('0x7d')][_0xc01a('0x7b')]){delete _0x39a7a0['account'][_0xc01a('0x7b')];}if(_0x39a7a0[_0xc01a('0x7d')][_0xc01a('0x7c')]&&_0x39a7a0['account'][_0xc01a('0x7c')][_0xc01a('0x78')][_0xc01a('0x43')]){return _0x39a7a0[_0xc01a('0x7d')][_0xc01a('0x7c')][_0xc01a('0x78')][0x0];}var _0x1cd7f8=_['defaults'](_0x3257e8[_0xc01a('0x5b')],{'firstName':_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x82')],'ListId':_0x55e71b[_0xc01a('0x71')]});_0x1cd7f8[_0x3257e8['body'][_0xc01a('0x74')]]=_0x3257e8[_0xc01a('0x5b')]['from'];return db[_0xc01a('0x83')][_0xc01a('0x53')](_0x1cd7f8,{'fields':_0x2a0d11,'raw':!![]});}})[_0xc01a('0x1b')](handleEntityNotFound(_0x280d3c,null))[_0xc01a('0x1b')](function(_0x4d90f7){_0x39a7a0['contact']=_0x4d90f7;if(_0x4d90f7){var _0x5d5602={'ContactId':_0x4d90f7['id'],'OpenchannelAccountId':_0x3257e8['params']['id'],'from':(_0x4d90f7[_0xc01a('0x84')]||'')+'\x20'+(_0x4d90f7['lastName']||'')};var _0x582b07={'OpenchannelAccountId':_0x3257e8[_0xc01a('0x51')]['id'],'closed':![]};if(_0x3257e8[_0xc01a('0x5b')]['threadId']){_0x582b07[_0xc01a('0x85')]=_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x85')];return db[_0xc01a('0x86')][_0xc01a('0x52')]({'where':_0x582b07})['then'](function(_0x379a12){if(_0x379a12){return[_0x379a12,![]];}_0x5d5602[_0xc01a('0x85')]=_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x85')];_0x5d5602[_0xc01a('0x87')]=_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x87')];return db['OpenchannelInteraction'][_0xc01a('0x53')](_0x5d5602)[_0xc01a('0x1b')](function(_0x4209fc){return[_0x4209fc,!![]];});});}else{_0x582b07[_0xc01a('0x85')]=null;}_0x582b07['ContactId']=_0x4d90f7['id'];return db[_0xc01a('0x86')]['find']({'where':_0x582b07})[_0xc01a('0x1b')](function(_0x3ed450){if(_0x3ed450){return[_0x3ed450,![]];}return db[_0xc01a('0x86')][_0xc01a('0x53')](_0x5d5602)[_0xc01a('0x1b')](function(_0x35ed9f){return[_0x35ed9f,!![]];});});}})[_0xc01a('0x88')](function(_0xba9749,_0x96110){if(_0xba9749){_0x20389c=_0x96110;if(!_0x96110){var _0x33c4ab={'from':(_0x39a7a0[_0xc01a('0x89')][_0xc01a('0x84')]||'')+'\x20'+(_0x39a7a0['contact'][_0xc01a('0x8a')]||'')};if(_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x85')]&&_0x3257e8['body'][_0xc01a('0x8b')]&&_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x85')]!=_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x8b')]){_0x33c4ab[_0xc01a('0x85')]=_0x3257e8[_0xc01a('0x5b')]['messageId'];}return _0xba9749[_0xc01a('0x8c')](_0x33c4ab);}else{return _0xba9749;}}})[_0xc01a('0x1b')](function(_0x264c89){_0x39a7a0[_0xc01a('0x8d')]=_0x264c89[_0xc01a('0x57')]({'plain':!![]});_0x39a7a0[_0xc01a('0x8d')][_0xc01a('0x8e')]=_0x20389c;if(_0x39a7a0[_0xc01a('0x8d')][_0xc01a('0x8e')]){if(_0x39a7a0['account']['autoclose']){_0x39a7a0[_0xc01a('0x7e')]['push']({'id':0x0,'priority':_0x39a7a0[_0xc01a('0x7e')][_0xc01a('0x43')]+0x1,'app':_0xc01a('0x8f'),'appdata':_0xc01a('0x90'),'interval':_0xc01a('0x91')});}}return db[_0xc01a('0x92')]['create']({'body':_0x3257e8['body'][_0xc01a('0x5b')],'OpenchannelAccountId':_0x3257e8[_0xc01a('0x51')]['id'],'OpenchannelInteractionId':_0x264c89['id'],'direction':'in','ContactId':_0x39a7a0[_0xc01a('0x89')]['id'],'AttachmentId':_0x3257e8[_0xc01a('0x5b')][_0xc01a('0x93')]});})[_0xc01a('0x1b')](function(_0x15d20a){_0x39a7a0[_0xc01a('0x21')]=_0x15d20a;if(_0x39a7a0[_0xc01a('0x8d')]['UserId']){return db[_0xc01a('0x94')][_0xc01a('0x52')]({'attributes':['id',_0xc01a('0x31')],'where':{'id':_0x39a7a0[_0xc01a('0x8d')]['UserId']}})[_0xc01a('0x1b')](function(_0x1626c6){if(_0x1626c6){_0x39a7a0[_0xc01a('0x7e')][_0xc01a('0x95')]({'id':0x0,'priority':0x0,'app':_0xc01a('0x96'),'appdata':_0x1626c6[_0xc01a('0x31')]+','+(_0x39a7a0[_0xc01a('0x7d')][_0xc01a('0x97')]||0xa),'interval':_0xc01a('0x91')});_0x39a7a0[_0xc01a('0x98')]=![];}return respondWithRpcPromise(_0xc01a('0x99'),_0xc01a('0x9a'),_0x39a7a0);});}return respondWithRpcPromise(_0xc01a('0x99'),_0xc01a('0x9a'),_0x39a7a0);})[_0xc01a('0x1b')](function(_0x3a63b2){respondWithRpcPromise(_0xc01a('0x9b'),'EventManager',{'event':_0xc01a('0x68'),'message':_0x3a63b2},client9002);return _0x3a63b2;})[_0xc01a('0x1b')](respondWithResult(_0x280d3c,null))['catch'](handleError(_0x280d3c,null));};exports[_0xc01a('0x9c')]=function(_0x488d06,_0xfc1292){var _0x46674b=_0x488d06[_0xc01a('0x51')]['id'];var _0x35d90f=_0x488d06[_0xc01a('0x5b')];var _0x19bd0e=0xc8;var _0x4e2b8c=null;return db[_0xc01a('0x9d')][_0xc01a('0x9e')]({'isolationLevel':db['sequelize'][_0xc01a('0x9f')][_0xc01a('0xa0')][_0xc01a('0xa1')]},function(_0x458a9d){return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x46674b},'transaction':_0x458a9d})[_0xc01a('0x1b')](function(_0xa7f217){if(_0xa7f217){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x46674b},'transaction':_0x458a9d})['then'](function(){var _0x54e1bc=_[_0xc01a('0x36')](_0x35d90f,function(_0x23dd4e){_0x23dd4e[_0xc01a('0x5d')]=_0x46674b;return _0x23dd4e;});return db[_0xc01a('0x7a')][_0xc01a('0xa2')](_0x54e1bc,{'transaction':_0x458a9d});});}else{_0x19bd0e=0x194;_0x4e2b8c=[];}});})['then'](function(){if(_0x19bd0e!==0x194){return db['OpenchannelApplication'][_0xc01a('0xa3')]({'where':{'OpenchannelAccountId':_0x46674b},'order':'priority'})[_0xc01a('0x1b')](function(_0x243861){_0x4e2b8c=_0x243861;});}})[_0xc01a('0x22')](function(_0x3a156d){_0x19bd0e=0x1f4;logger[_0xc01a('0x1f')](_0x3a156d['stack']);if(_0x3a156d[_0xc01a('0x31')]){delete _0x3a156d[_0xc01a('0x31')];}_0x4e2b8c=_0x3a156d;})[_0xc01a('0xa4')](function(){if(_0x4e2b8c===null){_0xfc1292['sendStatus'](_0x19bd0e);}else{if(_0x19bd0e===0x1f4){_0xfc1292[_0xc01a('0x23')](_0x19bd0e)[_0xc01a('0x32')](_0x4e2b8c);}else{_0xfc1292[_0xc01a('0x23')](_0x19bd0e)['json'](_0x4e2b8c);}}});};exports[_0xc01a('0xa5')]=function(_0x19dd80,_0x2ba8c4,_0x1ba2f8){var _0x1ef821={};var _0x109acb={};var _0x2ef3a9;var _0x1df86d;return db['OpenchannelAccount'][_0xc01a('0x60')]({'where':{'id':_0x19dd80[_0xc01a('0x51')]['id']}})['then'](handleEntityNotFound(_0x2ba8c4,null))[_0xc01a('0x1b')](function(_0x3a0bf0){if(_0x3a0bf0){_0x2ef3a9=_0x3a0bf0;_0x109acb[_0xc01a('0x40')]=_[_0xc01a('0x3c')](db[_0xc01a('0x7a')][_0xc01a('0x38')]);_0x109acb[_0xc01a('0x3d')]=_['keys'](_0x19dd80['query']);_0x109acb[_0xc01a('0x3e')]=_[_0xc01a('0x3f')](_0x109acb[_0xc01a('0x40')],_0x109acb[_0xc01a('0x3d')]);_0x1ef821[_0xc01a('0x42')]=_[_0xc01a('0x3f')](_0x109acb['model'],qs[_0xc01a('0x41')](_0x19dd80[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x1ef821[_0xc01a('0x42')]=_0x1ef821[_0xc01a('0x42')][_0xc01a('0x43')]?_0x1ef821['attributes']:_0x109acb[_0xc01a('0x40')];_0x1ef821[_0xc01a('0x45')]=qs[_0xc01a('0x46')](_0x19dd80['query'][_0xc01a('0x46')]);_0x1ef821[_0xc01a('0x49')]=qs[_0xc01a('0x3e')](_[_0xc01a('0x47')](_0x19dd80[_0xc01a('0x3d')],_0x109acb['filters']));if(_0x19dd80['query']['filter']){_0x1ef821[_0xc01a('0x49')]=_[_0xc01a('0x4a')](_0x1ef821[_0xc01a('0x49')],{'$or':_[_0xc01a('0x36')](_0x1ef821[_0xc01a('0x42')],function(_0x50ef33){var _0x441fbf={};_0x441fbf[_0x50ef33]={'$like':'%'+_0x19dd80[_0xc01a('0x3d')][_0xc01a('0x48')]+'%'};return _0x441fbf;})});}_0x1ef821=_[_0xc01a('0x4a')]({},_0x1ef821,_0x19dd80[_0xc01a('0x4b')]);return _0x2ef3a9[_0xc01a('0xa5')](_0x1ef821);}})[_0xc01a('0x1b')](function(_0x379208){if(_0x379208){_0x1df86d=_0x379208[_0xc01a('0x43')];if(!_0x19dd80['query'][_0xc01a('0x66')](_0xc01a('0x44'))){_0x1ef821[_0xc01a('0x27')]=qs['limit'](_0x19dd80[_0xc01a('0x3d')]['limit']);_0x1ef821[_0xc01a('0x25')]=qs[_0xc01a('0x25')](_0x19dd80[_0xc01a('0x3d')][_0xc01a('0x25')]);}return _0x2ef3a9[_0xc01a('0xa5')](_0x1ef821);}})['then'](function(_0x8a4816){if(_0x8a4816){return _0x8a4816?{'count':_0x1df86d,'rows':_0x8a4816}:null;}})['then'](respondWithResult(_0x2ba8c4,null))[_0xc01a('0x22')](handleError(_0x2ba8c4,null));};exports['getInteractions']=function(_0x2c4ab5,_0x52ce71,_0x1b1b77){var _0x4ee00c={'raw':![],'where':{}};var _0x52b3cf={};var _0x3c806b={'count':0x0,'rows':[]};return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x2c4ab5[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x52ce71,null))['then'](function(_0x48b92b){if(_0x48b92b){_0x52b3cf['model']=_[_0xc01a('0x3c')](db[_0xc01a('0x86')]['rawAttributes']);_0x52b3cf[_0xc01a('0x3d')]=_[_0xc01a('0x3c')](_0x2c4ab5['query']);_0x52b3cf[_0xc01a('0x3e')]=_[_0xc01a('0x3f')](_0x52b3cf[_0xc01a('0x40')],_0x52b3cf[_0xc01a('0x3d')]);_0x4ee00c[_0xc01a('0x42')]=_[_0xc01a('0x3f')](_0x52b3cf['model'],qs[_0xc01a('0x41')](_0x2c4ab5[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x4ee00c[_0xc01a('0x42')]=_0x4ee00c['attributes'][_0xc01a('0x43')]?_0x4ee00c['attributes']:_0x52b3cf[_0xc01a('0x40')];if(!_0x2c4ab5[_0xc01a('0x3d')][_0xc01a('0x66')](_0xc01a('0x44'))){_0x4ee00c[_0xc01a('0x27')]=qs[_0xc01a('0x27')](_0x2c4ab5[_0xc01a('0x3d')][_0xc01a('0x27')]);_0x4ee00c[_0xc01a('0x25')]=qs[_0xc01a('0x25')](_0x2c4ab5['query'][_0xc01a('0x25')]);}_0x4ee00c[_0xc01a('0x45')]=qs[_0xc01a('0x46')](_0x2c4ab5[_0xc01a('0x3d')][_0xc01a('0x46')]);_0x4ee00c['where']=qs[_0xc01a('0x3e')](_[_0xc01a('0x47')](_0x2c4ab5[_0xc01a('0x3d')],_0x52b3cf['filters']));_0x4ee00c['where'][_0xc01a('0x5d')]=_0x48b92b['id'];if(_0x2c4ab5[_0xc01a('0x3d')]['filter']){_0x4ee00c['where']=_[_0xc01a('0x4a')](_0x4ee00c[_0xc01a('0x49')],{'$or':_['map'](_0x4ee00c[_0xc01a('0x42')],function(_0x1ed0e1){var _0x301b49={};_0x301b49[_0x1ed0e1]={'$like':'%'+_0x2c4ab5['query'][_0xc01a('0x48')]+'%'};return _0x301b49;})});}_0x4ee00c=_[_0xc01a('0x4a')]({},_0x4ee00c,_0x2c4ab5[_0xc01a('0x4b')]);return db[_0xc01a('0x86')][_0xc01a('0x28')]({'where':_0x4ee00c[_0xc01a('0x49')]})[_0xc01a('0x1b')](function(_0x17e12e){_0x3c806b[_0xc01a('0x28')]=_0x17e12e;if(_0x2c4ab5['query'][_0xc01a('0x4c')]){_0x4ee00c[_0xc01a('0x4d')]=[{'model':db[_0xc01a('0x83')],'as':_0xc01a('0xa6'),'required':![]},{'model':db[_0xc01a('0x94')],'as':_0xc01a('0xa7'),'attributes':[_0xc01a('0x31'),_0xc01a('0xa8'),_0xc01a('0xa9')],'required':![]},{'model':db[_0xc01a('0xaa')],'as':'Tags','attributes':['id',_0xc01a('0x31'),_0xc01a('0xab')],'where':_0x2c4ab5['query']['tag']?{'id':_0x2c4ab5['query'][_0xc01a('0xac')]}:undefined,'required':_0x2c4ab5[_0xc01a('0x3d')][_0xc01a('0xac')]?!![]:![]}];}return db[_0xc01a('0x86')][_0xc01a('0x4e')](_0x4ee00c);})[_0xc01a('0x1b')](function(_0x5f2578){_0x3c806b[_0xc01a('0x4f')]=_0x5f2578;return _0x3c806b;});}})[_0xc01a('0x1b')](respondWithFilteredResult(_0x52ce71,_0x4ee00c))[_0xc01a('0x22')](handleError(_0x52ce71,null));};exports[_0xc01a('0xad')]=function(_0x21ca57,_0x228978,_0xa7b31e){return db['OpenchannelAccount'][_0xc01a('0x52')]({'where':{'id':_0x21ca57['params']['id']}})['then'](handleEntityNotFound(_0x228978,null))['then'](function(_0x3c6a34){if(_0x3c6a34){return _0x3c6a34['addAgents'](_0x21ca57[_0xc01a('0x5b')][_0xc01a('0x62')],_[_0xc01a('0xae')](_0x21ca57[_0xc01a('0x5b')],[_0xc01a('0x62'),'id'])||{})[_0xc01a('0x88')](function(_0x99ed91){for(var _0x1a8df1=0x0;_0x1a8df1<_0x21ca57[_0xc01a('0x5b')][_0xc01a('0x62')][_0xc01a('0x43')];_0x1a8df1+=0x1){socket[_0xc01a('0xaf')]('userOpenchannelAccount:save',{'UserId':Number(_0x21ca57[_0xc01a('0x5b')][_0xc01a('0x62')][_0x1a8df1]),'OpenchannelAccountId':Number(_0x21ca57[_0xc01a('0x51')]['id'])});}return _0x99ed91;});}})[_0xc01a('0x1b')](respondWithResult(_0x228978,null))[_0xc01a('0x22')](handleError(_0x228978,null));};exports[_0xc01a('0xb0')]=function(_0x5486eb,_0x202b84,_0xeb8072){return db[_0xc01a('0x37')]['find']({'where':{'id':_0x5486eb['params']['id']}})['then'](handleEntityNotFound(_0x202b84,null))['then'](function(_0x534c6d){if(_0x534c6d){return _0x534c6d['removeAgents'](_0x5486eb['query'][_0xc01a('0x62')])['then'](function(){if(_[_0xc01a('0xb1')](_0x5486eb[_0xc01a('0x3d')]['ids'])){for(var _0x4f7f5a=0x0;_0x4f7f5a<_0x5486eb['query'][_0xc01a('0x62')][_0xc01a('0x43')];_0x4f7f5a+=0x1){socket[_0xc01a('0xaf')](_0xc01a('0xb2'),{'UserId':Number(_0x5486eb[_0xc01a('0x3d')][_0xc01a('0x62')][_0x4f7f5a]),'OpenchannelAccountId':Number(_0x5486eb[_0xc01a('0x51')]['id'])});}}else{socket[_0xc01a('0xaf')](_0xc01a('0xb2'),{'UserId':Number(_0x5486eb[_0xc01a('0x3d')][_0xc01a('0x62')]),'OpenchannelAccountId':Number(_0x5486eb[_0xc01a('0x51')]['id'])});}});}})[_0xc01a('0x1b')](respondWithStatusCode(_0x202b84,null))[_0xc01a('0x22')](handleError(_0x202b84,null));};exports['getAgents']=function(_0x1c255c,_0x13dd38,_0x38e6df){var _0x1949d1={};var _0x7d8930={};var _0x176bd1;var _0x3b8ab1;return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x1c255c[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x13dd38,null))['then'](function(_0xb2ff58){if(_0xb2ff58){_0x176bd1=_0xb2ff58;_0x7d8930['model']=_[_0xc01a('0x3c')](db[_0xc01a('0x94')][_0xc01a('0x38')]);_0x7d8930[_0xc01a('0x3d')]=_[_0xc01a('0x3c')](_0x1c255c[_0xc01a('0x3d')]);_0x7d8930[_0xc01a('0x3e')]=_[_0xc01a('0x3f')](_0x7d8930[_0xc01a('0x40')],_0x7d8930[_0xc01a('0x3d')]);_0x1949d1['attributes']=_['intersection'](_0x7d8930['model'],qs['fields'](_0x1c255c[_0xc01a('0x3d')][_0xc01a('0x41')]));_0x1949d1[_0xc01a('0x42')]=_0x1949d1[_0xc01a('0x42')][_0xc01a('0x43')]?_0x1949d1['attributes']:_0x7d8930[_0xc01a('0x40')];_0x1949d1[_0xc01a('0x45')]=qs['sort'](_0x1c255c[_0xc01a('0x3d')][_0xc01a('0x46')]);_0x1949d1[_0xc01a('0x49')]=qs[_0xc01a('0x3e')](_[_0xc01a('0x47')](_0x1c255c[_0xc01a('0x3d')],_0x7d8930['filters']));if(_0x1c255c[_0xc01a('0x3d')]['filter']){_0x1949d1['where']=_['merge'](_0x1949d1[_0xc01a('0x49')],{'$or':_[_0xc01a('0x36')](_0x1949d1[_0xc01a('0x42')],function(_0x24146b){var _0x285b0a={};_0x285b0a[_0x24146b]={'$like':'%'+_0x1c255c[_0xc01a('0x3d')][_0xc01a('0x48')]+'%'};return _0x285b0a;})});}_0x1949d1=_[_0xc01a('0x4a')]({},_0x1949d1,_0x1c255c[_0xc01a('0x4b')]);return _0x176bd1[_0xc01a('0xb3')](_0x1949d1);}})['then'](function(_0x264652){if(_0x264652){_0x3b8ab1=_0x264652[_0xc01a('0x43')];if(!_0x1c255c[_0xc01a('0x3d')][_0xc01a('0x66')](_0xc01a('0x44'))){_0x1949d1[_0xc01a('0x27')]=qs[_0xc01a('0x27')](_0x1c255c[_0xc01a('0x3d')]['limit']);_0x1949d1[_0xc01a('0x25')]=qs['offset'](_0x1c255c[_0xc01a('0x3d')][_0xc01a('0x25')]);}return _0x176bd1[_0xc01a('0xb3')](_0x1949d1);}})[_0xc01a('0x1b')](function(_0x163b03){if(_0x163b03){return _0x163b03?{'count':_0x3b8ab1,'rows':_0x163b03}:null;}})[_0xc01a('0x1b')](respondWithResult(_0x13dd38,null))[_0xc01a('0x22')](handleError(_0x13dd38,null));};exports['send']=function(_0x3c8d5b,_0x278a78,_0x1cb779){var _0x52bee1,_0x5a8e4f,_0x6d5bba;if(_[_0xc01a('0x72')](_0x3c8d5b[_0xc01a('0x5b')][_0xc01a('0x5b')])||_0x3c8d5b[_0xc01a('0x5b')]['body']===''){throw new db[(_0xc01a('0x6a'))][(_0xc01a('0x6b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3c8d5b[_0xc01a('0x5b')]['to'])){}_0x52bee1=_0x3c8d5b[_0xc01a('0x5b')]['to'];return db[_0xc01a('0x37')][_0xc01a('0x60')]({'where':{'id':_0x3c8d5b[_0xc01a('0x51')]['id']}})[_0xc01a('0x1b')](handleEntityNotFound(_0x278a78,null))['then'](function(_0x1f5045){if(_0x1f5045){return db['OpenchannelAccount']['find']({'where':{'id':_0x1f5045['id']},'include':[{'model':db['CmList'],'as':_0xc01a('0x7c'),'include':[{'model':db[_0xc01a('0x83')],'as':_0xc01a('0x78'),'where':{[_0x1f5045[_0xc01a('0x74')]]:_0x52bee1},'limit':0x1,'order':[[_0xc01a('0x6f'),_0xc01a('0x79')]]}]}]})[_0xc01a('0x1b')](handleEntityNotFound(_0x278a78,null))[_0xc01a('0x1b')](function(_0x37809f){if(_0x37809f&&_0x37809f[_0xc01a('0x7c')]){_0x5a8e4f=_0x37809f[_0xc01a('0x57')]({'plain':!![]});if(_0x5a8e4f['List']&&_0x5a8e4f[_0xc01a('0x7c')][_0xc01a('0x78')][_0xc01a('0x43')]){return _0x5a8e4f['List']['Contacts'][0x0];}return db['CmContact'][_0xc01a('0x53')](_[_0xc01a('0x14')](_0x3c8d5b['body'],{'firstName':_0x52bee1,[_0x37809f[_0xc01a('0x74')]]:_0x52bee1,'phone':_0x52bee1,'ListId':_0x5a8e4f[_0xc01a('0x71')]}));}})[_0xc01a('0x1b')](handleEntityNotFound(_0x278a78,null))['then'](function(_0x309615){if(_0x309615){_0x6d5bba=_0x309615;return db[_0xc01a('0x86')]['find']({'where':{'ContactId':_0x6d5bba['id'],'closed':![],'OpenchannelAccountId':_0x5a8e4f['id']}})['then'](function(_0x204f5e){if(_0x204f5e){return[_0x204f5e,![]];}return db[_0xc01a('0x86')][_0xc01a('0x53')]({'UserId':_0x3c8d5b[_0xc01a('0x56')]['id'],'ContactId':_0x6d5bba['id'],'OpenchannelAccountId':_0x5a8e4f['id'],'lastMsgDirection':'out','Messages':[_[_0xc01a('0x4a')](_0x3c8d5b[_0xc01a('0x5b')],{'read':![],'body':_0x3c8d5b['body'][_0xc01a('0x5b')],'OpenchannelAccountId':_0x5a8e4f['id'],'UserId':_0x3c8d5b['user']['id'],'ContactId':_0x6d5bba['id']})]},{'include':[{'model':db[_0xc01a('0x92')],'as':_0xc01a('0xb4')}]})['then'](function(_0xa2e447){return[_0xa2e447,!![]];});});}})[_0xc01a('0x88')](function(_0x17894b,_0x302fa1){if(_0x302fa1){return _0x17894b;}return db[_0xc01a('0x92')]['create'](_[_0xc01a('0x4a')](_0x3c8d5b[_0xc01a('0x5b')],{'read':![],'body':_0x3c8d5b['body']['body'],'OpenchannelAccountId':_0x5a8e4f['id'],'OpenchannelInteractionId':_0x17894b['id'],'UserId':_0x3c8d5b[_0xc01a('0x56')]['id'],'ContactId':_0x6d5bba['id']}))['then'](function(_0x3b26a1){_0x17894b[_0xc01a('0xb5')]['Messages']=[];_0x17894b['dataValues'][_0xc01a('0xb4')][_0xc01a('0xb6')](_0x3b26a1[_0xc01a('0xb5')]);return _0x17894b;});});}})[_0xc01a('0x1b')](respondWithResult(_0x278a78,null))[_0xc01a('0x22')](handleError(_0x278a78,null));}; \ No newline at end of file +var _0x9b0a=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','pick','OpenchannelAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','Applications','account','list','applications','priority','asc','Contacts','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','contact','messageId','interaction','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','OpenchannelApplication','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','addAgents','emit','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','http','info','OpenchannelAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','sendStatus','end','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','get','OpenchannelAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','merge','options','OpenchannelAccount','include','findAll','rows','catch','show','params','Pause','keys','includeAll','find','create','body','role','user'];(function(_0x121166,_0x38d126){var _0x126f4d=function(_0x9c5fb3){while(--_0x9c5fb3){_0x121166['push'](_0x121166['shift']());}};_0x126f4d(++_0x38d126);}(_0x9b0a,0x113));var _0xa9b0=function(_0x23345f,_0xc1cd34){_0x23345f=_0x23345f-0x0;var _0x1865e0=_0x9b0a[_0x23345f];return _0x1865e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa9b0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9b0('0x1'));var moment=require('moment');var BPromise=require(_0xa9b0('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa9b0('0x3'));var sox=require(_0xa9b0('0x4'));var csv=require(_0xa9b0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9b0('0x6'));var _=require(_0xa9b0('0x7'));var squel=require(_0xa9b0('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa9b0('0x9'));var toCsv=require(_0xa9b0('0x5'));var querystring=require(_0xa9b0('0xa'));var Papa=require('papaparse');var Redis=require(_0xa9b0('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xa9b0('0xc'));var as=require(_0xa9b0('0xd'));var hardwareService=require(_0xa9b0('0xe'));var logger=require(_0xa9b0('0xf'))(_0xa9b0('0x10'));var utils=require(_0xa9b0('0x11'));var config=require(_0xa9b0('0x12'));var licenseUtil=require(_0xa9b0('0x13'));var db=require('../../mysqldb')['db'];config[_0xa9b0('0x14')]=_['defaults'](config[_0xa9b0('0x14')],{'host':_0xa9b0('0x15'),'port':0x18eb});var socket=require(_0xa9b0('0x16'))(new Redis(config['redis']));require(_0xa9b0('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xa9b0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x40fdbc,_0x497a69,_0x53277a,_0x59e9f2){return new BPromise(function(_0x472adc,_0x4af1b0){var _0x594ca2=_0x59e9f2||client;return _0x594ca2['request'](_0x40fdbc,_0x53277a)['then'](function(_0x1a9208){logger[_0xa9b0('0x19')](_0xa9b0('0x1a'),_0x497a69,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x497a69,'request\x20sent',JSON[_0xa9b0('0x1b')](_0x1a9208));if(_0x1a9208[_0xa9b0('0x1c')]){if(_0x1a9208['error'][_0xa9b0('0x1d')]===0x1f4){logger[_0xa9b0('0x1c')](_0xa9b0('0x1a'),_0x497a69,_0x1a9208[_0xa9b0('0x1c')][_0xa9b0('0x1e')]);return _0x4af1b0(_0x1a9208[_0xa9b0('0x1c')][_0xa9b0('0x1e')]);}logger['error'](_0xa9b0('0x1a'),_0x497a69,_0x1a9208[_0xa9b0('0x1c')]['message']);return _0x472adc(_0x1a9208[_0xa9b0('0x1c')]['message']);}else{logger[_0xa9b0('0x19')](_0xa9b0('0x1a'),_0x497a69,_0xa9b0('0x1f'));_0x472adc(_0x1a9208['result'][_0xa9b0('0x1e')]);}})['catch'](function(_0x1cc375){logger[_0xa9b0('0x1c')](_0xa9b0('0x1a'),_0x497a69,_0x1cc375);_0x4af1b0(_0x1cc375);});});}function respondWithStatusCode(_0x447ab7,_0x2015bd){_0x2015bd=_0x2015bd||0xcc;return function(_0x47eeac){if(_0x47eeac){return _0x447ab7[_0xa9b0('0x20')](_0x2015bd);}return _0x447ab7['status'](_0x2015bd)[_0xa9b0('0x21')]();};}function respondWithResult(_0x5260f4,_0xb20a81){_0xb20a81=_0xb20a81||0xc8;return function(_0x530456){if(_0x530456){return _0x5260f4[_0xa9b0('0x22')](_0xb20a81)['json'](_0x530456);}};}function respondWithFilteredResult(_0x3d87dc,_0x224713){return function(_0x959a9b){if(_0x959a9b){var _0xe9d773=typeof _0x224713[_0xa9b0('0x23')]===_0xa9b0('0x24')&&typeof _0x224713['limit']===_0xa9b0('0x24');var _0x46bfc3=_0x959a9b[_0xa9b0('0x25')];var _0x416c4f=_0xe9d773?0x0:_0x224713[_0xa9b0('0x23')];var _0x375234=_0xe9d773?_0x959a9b[_0xa9b0('0x25')]:_0x224713[_0xa9b0('0x23')]+_0x224713['limit'];var _0x254474;if(_0x375234>=_0x46bfc3){_0x375234=_0x46bfc3;_0x254474=0xc8;}else{_0x254474=0xce;}_0x3d87dc[_0xa9b0('0x22')](_0x254474);return _0x3d87dc['set'](_0xa9b0('0x26'),_0x416c4f+'-'+_0x375234+'/'+_0x46bfc3)[_0xa9b0('0x27')](_0x959a9b);}return null;};}function patchUpdates(_0x37a2e){return function(_0x8cb3b9){try{jsonpatch[_0xa9b0('0x28')](_0x8cb3b9,_0x37a2e,!![]);}catch(_0x4e1594){return BPromise[_0xa9b0('0x29')](_0x4e1594);}return _0x8cb3b9[_0xa9b0('0x2a')]();};}function saveUpdates(_0x1bd62b,_0x958be5){return function(_0x208d63){if(_0x208d63){return _0x208d63[_0xa9b0('0x2b')](_0x1bd62b)['then'](function(_0x4e9608){return _0x4e9608;});}return null;};}function removeEntity(_0x991bd1,_0x2d04d3){return function(_0x4868d6){if(_0x4868d6){return _0x4868d6[_0xa9b0('0x2c')]()[_0xa9b0('0x2d')](function(){var _0x166bde=_0x4868d6[_0xa9b0('0x2e')]({'plain':!![]});var _0x1cb030=_0xa9b0('0x2f');return db['UserProfileResource'][_0xa9b0('0x2c')]({'where':{'type':_0x1cb030,'resourceId':_0x166bde['id']}})[_0xa9b0('0x2d')](function(){return _0x4868d6;});})[_0xa9b0('0x2d')](function(){_0x991bd1['status'](0xcc)[_0xa9b0('0x21')]();});}};}function handleEntityNotFound(_0x245843,_0xf72511){return function(_0x510c3a){if(!_0x510c3a){_0x245843[_0xa9b0('0x20')](0x194);}return _0x510c3a;};}function handleError(_0x127495,_0x1379a7){_0x1379a7=_0x1379a7||0x1f4;return function(_0x44f95a){logger['error'](_0x44f95a[_0xa9b0('0x30')]);if(_0x44f95a[_0xa9b0('0x31')]){delete _0x44f95a[_0xa9b0('0x31')];}_0x127495[_0xa9b0('0x22')](_0x1379a7)[_0xa9b0('0x32')](_0x44f95a);};}exports[_0xa9b0('0x33')]=function(_0x1107c1,_0x44024c){var _0x342db3={'include':[{'model':db['Pause'],'as':_0xa9b0('0x34')}]},_0x2fbddf={},_0x4da727={'count':0x0,'rows':[]};var _0x4710e9=_[_0xa9b0('0x35')](db['OpenchannelAccount'][_0xa9b0('0x36')],function(_0x490610){return{'name':_0x490610[_0xa9b0('0x37')],'type':_0x490610[_0xa9b0('0x38')]['key']};});_0x2fbddf[_0xa9b0('0x39')]=_['map'](_0x4710e9,'name');_0x2fbddf[_0xa9b0('0x3a')]=_['keys'](_0x1107c1['query']);_0x2fbddf['filters']=_[_0xa9b0('0x3b')](_0x2fbddf[_0xa9b0('0x39')],_0x2fbddf[_0xa9b0('0x3a')]);_0x342db3[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x2fbddf['model'],qs[_0xa9b0('0x3d')](_0x1107c1[_0xa9b0('0x3a')][_0xa9b0('0x3d')]));_0x342db3[_0xa9b0('0x3c')]=_0x342db3[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x342db3[_0xa9b0('0x3c')]:_0x2fbddf[_0xa9b0('0x39')];if(!_0x1107c1['query'][_0xa9b0('0x3f')](_0xa9b0('0x40'))){_0x342db3[_0xa9b0('0x41')]=qs[_0xa9b0('0x41')](_0x1107c1[_0xa9b0('0x3a')][_0xa9b0('0x41')]);_0x342db3[_0xa9b0('0x23')]=qs[_0xa9b0('0x23')](_0x1107c1['query'][_0xa9b0('0x23')]);}_0x342db3[_0xa9b0('0x42')]=qs[_0xa9b0('0x43')](_0x1107c1[_0xa9b0('0x3a')][_0xa9b0('0x43')]);_0x342db3[_0xa9b0('0x44')]=qs[_0xa9b0('0x45')](_['pick'](_0x1107c1[_0xa9b0('0x3a')],_0x2fbddf[_0xa9b0('0x45')]),_0x4710e9);if(_0x1107c1['query'][_0xa9b0('0x46')]){_0x342db3['where']=_['merge'](_0x342db3[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0x4710e9,function(_0x42bb9e){if(_0x42bb9e['type']!==_0xa9b0('0x47')){var _0x2f83e7={};_0x2f83e7[_0x42bb9e['name']]={'$like':'%'+_0x1107c1[_0xa9b0('0x3a')][_0xa9b0('0x46')]+'%'};return _0x2f83e7;}})});}_0x342db3=_[_0xa9b0('0x48')]({},_0x342db3,_0x1107c1[_0xa9b0('0x49')]);var _0x4600fa={'where':_0x342db3[_0xa9b0('0x44')]};return db[_0xa9b0('0x4a')][_0xa9b0('0x25')](_0x4600fa)['then'](function(_0x2b65ea){_0x4da727[_0xa9b0('0x25')]=_0x2b65ea;if(_0x1107c1[_0xa9b0('0x3a')]['includeAll']){_0x342db3[_0xa9b0('0x4b')]=[{'all':!![]}];}return db[_0xa9b0('0x4a')][_0xa9b0('0x4c')](_0x342db3);})['then'](function(_0x313ece){_0x4da727[_0xa9b0('0x4d')]=_0x313ece;return _0x4da727;})['then'](respondWithFilteredResult(_0x44024c,_0x342db3))[_0xa9b0('0x4e')](handleError(_0x44024c,null));};exports[_0xa9b0('0x4f')]=function(_0x1fe81a,_0x1715bc){var _0x3f4fcd={'raw':![],'where':{'id':_0x1fe81a[_0xa9b0('0x50')]['id']},'include':[{'model':db[_0xa9b0('0x51')],'as':_0xa9b0('0x34')}]},_0x4872b6={};_0x4872b6[_0xa9b0('0x39')]=_[_0xa9b0('0x52')](db[_0xa9b0('0x4a')][_0xa9b0('0x36')]);_0x4872b6[_0xa9b0('0x3a')]=_[_0xa9b0('0x52')](_0x1fe81a[_0xa9b0('0x3a')]);_0x4872b6[_0xa9b0('0x45')]=_[_0xa9b0('0x3b')](_0x4872b6['model'],_0x4872b6['query']);_0x3f4fcd[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x4872b6[_0xa9b0('0x39')],qs[_0xa9b0('0x3d')](_0x1fe81a[_0xa9b0('0x3a')][_0xa9b0('0x3d')]));_0x3f4fcd[_0xa9b0('0x3c')]=_0x3f4fcd[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x3f4fcd[_0xa9b0('0x3c')]:_0x4872b6[_0xa9b0('0x39')];if(_0x1fe81a['query'][_0xa9b0('0x53')]){_0x3f4fcd[_0xa9b0('0x4b')]=[{'all':!![]}];}_0x3f4fcd=_[_0xa9b0('0x48')]({},_0x3f4fcd,_0x1fe81a[_0xa9b0('0x49')]);return db[_0xa9b0('0x4a')][_0xa9b0('0x54')](_0x3f4fcd)['then'](handleEntityNotFound(_0x1715bc,null))['then'](respondWithResult(_0x1715bc,null))['catch'](handleError(_0x1715bc,null));};exports[_0xa9b0('0x55')]=function(_0x587507,_0x27bd05){return db[_0xa9b0('0x4a')]['create'](_0x587507[_0xa9b0('0x56')],{})['then'](function(_0x390a22){var _0x7d48b=_0x587507['user']['get']({'plain':!![]});if(!_0x7d48b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7d48b[_0xa9b0('0x57')]===_0xa9b0('0x58')){var _0x46b1c6=_0x390a22[_0xa9b0('0x2e')]({'plain':!![]});var _0x46142e='OpenchannelAccounts';return db[_0xa9b0('0x59')][_0xa9b0('0x54')]({'where':{'name':_0x46142e,'userProfileId':_0x7d48b[_0xa9b0('0x5a')]},'raw':!![]})['then'](function(_0x172f2c){if(_0x172f2c&&_0x172f2c[_0xa9b0('0x5b')]===0x0){return db[_0xa9b0('0x5c')][_0xa9b0('0x55')]({'name':_0x46b1c6[_0xa9b0('0x31')],'resourceId':_0x46b1c6['id'],'type':_0x172f2c['name'],'sectionId':_0x172f2c['id']},{})[_0xa9b0('0x2d')](function(){return _0x390a22;});}else{return _0x390a22;}})[_0xa9b0('0x4e')](function(_0x357f20){logger['error'](_0xa9b0('0x5d'),_0x357f20);throw _0x357f20;});}return _0x390a22;})[_0xa9b0('0x2d')](respondWithResult(_0x27bd05,0xc9))[_0xa9b0('0x4e')](handleError(_0x27bd05,null));};exports[_0xa9b0('0x2b')]=function(_0x106b15,_0x5ac508){if(_0x106b15[_0xa9b0('0x56')]['id']){delete _0x106b15[_0xa9b0('0x56')]['id'];}return db['OpenchannelAccount'][_0xa9b0('0x54')]({'where':{'id':_0x106b15[_0xa9b0('0x50')]['id']},'include':[{'model':db[_0xa9b0('0x51')],'as':_0xa9b0('0x34')}]})[_0xa9b0('0x2d')](handleEntityNotFound(_0x5ac508,null))[_0xa9b0('0x2d')](saveUpdates(_0x106b15[_0xa9b0('0x56')],null))[_0xa9b0('0x2d')](respondWithResult(_0x5ac508,null))[_0xa9b0('0x4e')](handleError(_0x5ac508,null));};exports['destroy']=function(_0x22c1af,_0x5f2e48){return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x22c1af[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x5f2e48,null))[_0xa9b0('0x2d')](removeEntity(_0x5f2e48,null))[_0xa9b0('0x4e')](handleError(_0x5f2e48,null));};exports['describe']=function(_0x54a15b,_0x21c974){return db[_0xa9b0('0x4a')][_0xa9b0('0x5e')]()[_0xa9b0('0x2d')](respondWithResult(_0x21c974,null))[_0xa9b0('0x4e')](handleError(_0x21c974,null));};exports[_0xa9b0('0x5f')]=function(_0x2cc1eb,_0x19832e,_0x308934){if(_0x2cc1eb[_0xa9b0('0x56')]['id']){delete _0x2cc1eb[_0xa9b0('0x56')]['id'];}return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x2cc1eb[_0xa9b0('0x50')]['id']}})['then'](handleEntityNotFound(_0x19832e,null))[_0xa9b0('0x2d')](function(_0x10f9db){if(_0x10f9db){_0x2cc1eb[_0xa9b0('0x56')]['OpenchannelAccountId']=_0x10f9db['id'];return db['Disposition']['create'](_0x2cc1eb[_0xa9b0('0x56')]);}})[_0xa9b0('0x2d')](respondWithResult(_0x19832e,null))['catch'](handleError(_0x19832e,null));};exports[_0xa9b0('0x60')]=function(_0x4fd9dd,_0x55e711,_0x5b607b){var _0x4e1bbf={'raw':![],'where':{}};var _0x157bad={};var _0x561f91={'count':0x0,'rows':[]};return db[_0xa9b0('0x4a')][_0xa9b0('0x61')]({'where':{'id':_0x4fd9dd['params']['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x55e711,null))[_0xa9b0('0x2d')](function(_0x30a139){if(_0x30a139){_0x157bad['model']=_[_0xa9b0('0x52')](db['Disposition'][_0xa9b0('0x36')]);_0x157bad[_0xa9b0('0x3a')]=_['keys'](_0x4fd9dd[_0xa9b0('0x3a')]);_0x157bad['filters']=_[_0xa9b0('0x3b')](_0x157bad[_0xa9b0('0x39')],_0x157bad['query']);_0x4e1bbf[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x157bad[_0xa9b0('0x39')],qs[_0xa9b0('0x3d')](_0x4fd9dd[_0xa9b0('0x3a')][_0xa9b0('0x3d')]));_0x4e1bbf[_0xa9b0('0x3c')]=_0x4e1bbf[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x4e1bbf[_0xa9b0('0x3c')]:_0x157bad[_0xa9b0('0x39')];if(!_0x4fd9dd[_0xa9b0('0x3a')]['hasOwnProperty'](_0xa9b0('0x40'))){_0x4e1bbf['limit']=qs[_0xa9b0('0x41')](_0x4fd9dd['query'][_0xa9b0('0x41')]);_0x4e1bbf[_0xa9b0('0x23')]=qs[_0xa9b0('0x23')](_0x4fd9dd[_0xa9b0('0x3a')][_0xa9b0('0x23')]);}_0x4e1bbf[_0xa9b0('0x42')]=qs['sort'](_0x4fd9dd[_0xa9b0('0x3a')]['sort']);_0x4e1bbf[_0xa9b0('0x44')]=qs[_0xa9b0('0x45')](_[_0xa9b0('0x62')](_0x4fd9dd['query'],_0x157bad[_0xa9b0('0x45')]));_0x4e1bbf[_0xa9b0('0x44')][_0xa9b0('0x63')]=_0x30a139['id'];if(_0x4fd9dd['query'][_0xa9b0('0x46')]){_0x4e1bbf[_0xa9b0('0x44')]=_[_0xa9b0('0x48')](_0x4e1bbf[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0x4e1bbf[_0xa9b0('0x3c')],function(_0x190fa2){var _0x410647={};_0x410647[_0x190fa2]={'$like':'%'+_0x4fd9dd[_0xa9b0('0x3a')][_0xa9b0('0x46')]+'%'};return _0x410647;})});}_0x4e1bbf=_[_0xa9b0('0x48')]({},_0x4e1bbf,_0x4fd9dd[_0xa9b0('0x49')]);return db[_0xa9b0('0x64')][_0xa9b0('0x25')]({'where':_0x4e1bbf[_0xa9b0('0x44')]})[_0xa9b0('0x2d')](function(_0x5b946f){_0x561f91[_0xa9b0('0x25')]=_0x5b946f;if(_0x4fd9dd['query'][_0xa9b0('0x53')]){_0x4e1bbf[_0xa9b0('0x4b')]=[{'all':!![]}];}return db[_0xa9b0('0x64')][_0xa9b0('0x4c')](_0x4e1bbf);})['then'](function(_0x26152a){_0x561f91[_0xa9b0('0x4d')]=_0x26152a;return _0x561f91;});}})[_0xa9b0('0x2d')](respondWithFilteredResult(_0x55e711,_0x4e1bbf))[_0xa9b0('0x4e')](handleError(_0x55e711,null));};exports[_0xa9b0('0x65')]=function(_0x1d3310,_0x2d183e,_0x382641){return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x1d3310[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x2d183e,null))['then'](function(_0x5e07de){if(_0x5e07de){return _0x5e07de[_0xa9b0('0x65')](_0x1d3310[_0xa9b0('0x3a')][_0xa9b0('0x66')]);}})[_0xa9b0('0x2d')](respondWithStatusCode(_0x2d183e,null))[_0xa9b0('0x4e')](handleError(_0x2d183e,null));};exports[_0xa9b0('0x67')]=function(_0x1acc12,_0x472638,_0x5b117a){if(_0x1acc12[_0xa9b0('0x56')]['id']){delete _0x1acc12[_0xa9b0('0x56')]['id'];}return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x1acc12['params']['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x472638,null))['then'](function(_0x2d6e4c){if(_0x2d6e4c){_0x1acc12[_0xa9b0('0x56')][_0xa9b0('0x63')]=_0x2d6e4c['id'];return db[_0xa9b0('0x68')][_0xa9b0('0x55')](_0x1acc12['body']);}})['then'](respondWithResult(_0x472638,null))[_0xa9b0('0x4e')](handleError(_0x472638,null));};exports[_0xa9b0('0x69')]=function(_0x4c1d44,_0x1ad391,_0x4d447c){var _0x32f276={'raw':![],'where':{}};var _0x422cf5={};var _0x2f03f7={'count':0x0,'rows':[]};return db[_0xa9b0('0x4a')][_0xa9b0('0x61')]({'where':{'id':_0x4c1d44[_0xa9b0('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ad391,null))[_0xa9b0('0x2d')](function(_0x8db68d){if(_0x8db68d){_0x422cf5[_0xa9b0('0x39')]=_['keys'](db[_0xa9b0('0x68')][_0xa9b0('0x36')]);_0x422cf5['query']=_[_0xa9b0('0x52')](_0x4c1d44['query']);_0x422cf5['filters']=_[_0xa9b0('0x3b')](_0x422cf5[_0xa9b0('0x39')],_0x422cf5['query']);_0x32f276['attributes']=_[_0xa9b0('0x3b')](_0x422cf5['model'],qs['fields'](_0x4c1d44['query']['fields']));_0x32f276['attributes']=_0x32f276[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x32f276[_0xa9b0('0x3c')]:_0x422cf5[_0xa9b0('0x39')];if(!_0x4c1d44[_0xa9b0('0x3a')]['hasOwnProperty']('nolimit')){_0x32f276['limit']=qs['limit'](_0x4c1d44[_0xa9b0('0x3a')][_0xa9b0('0x41')]);_0x32f276[_0xa9b0('0x23')]=qs[_0xa9b0('0x23')](_0x4c1d44[_0xa9b0('0x3a')][_0xa9b0('0x23')]);}_0x32f276[_0xa9b0('0x42')]=qs[_0xa9b0('0x43')](_0x4c1d44[_0xa9b0('0x3a')]['sort']);_0x32f276[_0xa9b0('0x44')]=qs['filters'](_[_0xa9b0('0x62')](_0x4c1d44[_0xa9b0('0x3a')],_0x422cf5[_0xa9b0('0x45')]));_0x32f276['where'][_0xa9b0('0x63')]=_0x8db68d['id'];if(_0x4c1d44['query'][_0xa9b0('0x46')]){_0x32f276[_0xa9b0('0x44')]=_[_0xa9b0('0x48')](_0x32f276[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0x32f276[_0xa9b0('0x3c')],function(_0x2baf20){var _0x479947={};_0x479947[_0x2baf20]={'$like':'%'+_0x4c1d44[_0xa9b0('0x3a')][_0xa9b0('0x46')]+'%'};return _0x479947;})});}_0x32f276=_[_0xa9b0('0x48')]({},_0x32f276,_0x4c1d44['options']);return db[_0xa9b0('0x68')][_0xa9b0('0x25')]({'where':_0x32f276[_0xa9b0('0x44')]})[_0xa9b0('0x2d')](function(_0x4a0bbe){_0x2f03f7[_0xa9b0('0x25')]=_0x4a0bbe;if(_0x4c1d44[_0xa9b0('0x3a')][_0xa9b0('0x53')]){_0x32f276[_0xa9b0('0x4b')]=[{'all':!![]}];}return db[_0xa9b0('0x68')][_0xa9b0('0x4c')](_0x32f276);})['then'](function(_0x56fb2d){_0x2f03f7['rows']=_0x56fb2d;return _0x2f03f7;});}})['then'](respondWithFilteredResult(_0x1ad391,_0x32f276))['catch'](handleError(_0x1ad391,null));};exports[_0xa9b0('0x6a')]=function(_0x36d86c,_0x1c0068,_0xbbee59){return db['OpenchannelAccount']['find']({'where':{'id':_0x36d86c['params']['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x1c0068,null))['then'](function(_0x39e0b4){if(_0x39e0b4){return _0x39e0b4['removeAnswers'](_0x36d86c['query'][_0xa9b0('0x66')]);}})['then'](respondWithStatusCode(_0x1c0068,null))[_0xa9b0('0x4e')](handleError(_0x1c0068,null));};exports[_0xa9b0('0x6b')]=function(_0x556787,_0x4f1df1,_0xca58d4){var _0x10cd03={'body':_0x556787['body'],'channel':_0xa9b0('0x6c')};var _0x4218c8=[];var _0x1f84da=[];var _0x5c85f5={};var _0x199348=![];return db[_0xa9b0('0x6d')][_0xa9b0('0x5e')]()[_0xa9b0('0x2d')](function(_0x15b754){if(!_0x15b754){throw new db['Sequelize'][(_0xa9b0('0x6e'))](_0xa9b0('0x6f'));}_0x4218c8=_[_0xa9b0('0x70')](_[_0xa9b0('0x52')](_0x15b754),[_0xa9b0('0x71'),_0xa9b0('0x72')]);_0x1f84da=_['difference'](_[_0xa9b0('0x52')](_0x15b754),[_0xa9b0('0x71'),_0xa9b0('0x72'),_0xa9b0('0x73'),_0xa9b0('0x74')]);if(_0x556787[_0xa9b0('0x56')]['id']){delete _0x556787[_0xa9b0('0x56')]['id'];}if(_[_0xa9b0('0x75')](_0x556787[_0xa9b0('0x56')][_0xa9b0('0x76')])){throw new db[(_0xa9b0('0x77'))]['ValidationError'](_0xa9b0('0x78'));}if(_['isNil'](_0x556787[_0xa9b0('0x56')][_0xa9b0('0x56')])||_0x556787['body'][_0xa9b0('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0xa9b0('0x79'));}if(_[_0xa9b0('0x75')](_0x556787[_0xa9b0('0x56')][_0xa9b0('0x7a')])){throw new db['Sequelize'][(_0xa9b0('0x6e'))](_0xa9b0('0x7b')+_0x1f84da);}if(!_['includes'](_0x1f84da,_0x556787[_0xa9b0('0x56')]['mapKey'])){throw new db[(_0xa9b0('0x77'))][(_0xa9b0('0x6e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f84da);}_0x5c85f5[_0x556787[_0xa9b0('0x56')]['mapKey']]=_0x556787[_0xa9b0('0x56')][_0xa9b0('0x76')];})[_0xa9b0('0x2d')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x556787[_0xa9b0('0x50')]['id']},'include':[{'model':db[_0xa9b0('0x7c')],'as':_0xa9b0('0x7d'),'include':[{'model':db[_0xa9b0('0x6d')],'as':'Contacts','where':_0x5c85f5,'limit':0x1,'order':[['updatedAt',_0xa9b0('0x7e')]]}]},{'model':db['OpenchannelApplication'],'as':_0xa9b0('0x7f')}]});})[_0xa9b0('0x2d')](handleEntityNotFound(_0x4f1df1,null))['then'](function(_0x2c61fd){if(_0x2c61fd&&_0x2c61fd[_0xa9b0('0x7d')]){_0x10cd03[_0xa9b0('0x80')]=_0x2c61fd;_0x10cd03['applications']=_0x2c61fd['Applications'];_0x10cd03[_0xa9b0('0x81')]=_0x2c61fd[_0xa9b0('0x7d')];_0x10cd03[_0xa9b0('0x82')]=_['orderBy'](_0x10cd03[_0xa9b0('0x82')],[_0xa9b0('0x83')],[_0xa9b0('0x84')]);if(_0x10cd03['account'][_0xa9b0('0x7f')]){delete _0x10cd03[_0xa9b0('0x80')]['Applications'];}if(_0x10cd03[_0xa9b0('0x80')][_0xa9b0('0x7d')]&&_0x10cd03[_0xa9b0('0x80')][_0xa9b0('0x7d')][_0xa9b0('0x85')][_0xa9b0('0x3e')]){return _0x10cd03[_0xa9b0('0x80')][_0xa9b0('0x7d')][_0xa9b0('0x85')][0x0];}var _0x4982ab=_['defaults'](_0x556787['body'],{'firstName':_0x556787[_0xa9b0('0x56')][_0xa9b0('0x76')],'ListId':_0x2c61fd[_0xa9b0('0x74')]});_0x4982ab[_0x556787[_0xa9b0('0x56')]['mapKey']]=_0x556787[_0xa9b0('0x56')][_0xa9b0('0x76')];return db['CmContact'][_0xa9b0('0x55')](_0x4982ab,{'fields':_0x4218c8,'raw':!![]});}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x4f1df1,null))[_0xa9b0('0x2d')](function(_0x1f82b4){_0x10cd03['contact']=_0x1f82b4;if(_0x1f82b4){var _0x229122={'ContactId':_0x1f82b4['id'],'OpenchannelAccountId':_0x556787['params']['id'],'from':(_0x1f82b4['firstName']||'')+'\x20'+(_0x1f82b4[_0xa9b0('0x86')]||'')};var _0x983fd6={'OpenchannelAccountId':_0x556787['params']['id'],'closed':![]};if(_0x556787['body']['threadId']){_0x983fd6[_0xa9b0('0x87')]=_0x556787[_0xa9b0('0x56')][_0xa9b0('0x87')];return db[_0xa9b0('0x88')]['find']({'where':_0x983fd6})[_0xa9b0('0x2d')](function(_0x556bbe){if(_0x556bbe){return[_0x556bbe,![]];}_0x229122['threadId']=_0x556787['body'][_0xa9b0('0x87')];_0x229122[_0xa9b0('0x89')]=_0x556787['body']['externalUrl'];return db['OpenchannelInteraction'][_0xa9b0('0x55')](_0x229122)[_0xa9b0('0x2d')](function(_0xde286){return[_0xde286,!![]];});});}else{_0x983fd6[_0xa9b0('0x87')]=null;}_0x983fd6[_0xa9b0('0x8a')]=_0x1f82b4['id'];return db[_0xa9b0('0x88')][_0xa9b0('0x54')]({'where':_0x983fd6})[_0xa9b0('0x2d')](function(_0x51e709){if(_0x51e709){return[_0x51e709,![]];}return db[_0xa9b0('0x88')][_0xa9b0('0x55')](_0x229122)[_0xa9b0('0x2d')](function(_0x35a9a9){return[_0x35a9a9,!![]];});});}})[_0xa9b0('0x8b')](function(_0x4583b9,_0x29ec93){if(_0x4583b9){_0x199348=_0x29ec93;if(!_0x29ec93){var _0x347444={'from':(_0x10cd03['contact'][_0xa9b0('0x8c')]||'')+'\x20'+(_0x10cd03[_0xa9b0('0x8d')][_0xa9b0('0x86')]||'')};if(_0x556787['body'][_0xa9b0('0x87')]&&_0x556787['body']['messageId']&&_0x556787['body']['threadId']!=_0x556787['body'][_0xa9b0('0x8e')]){_0x347444[_0xa9b0('0x87')]=_0x556787[_0xa9b0('0x56')][_0xa9b0('0x8e')];}return _0x4583b9[_0xa9b0('0x2b')](_0x347444);}else{return _0x4583b9;}}})[_0xa9b0('0x2d')](function(_0xd6ad89){_0x10cd03[_0xa9b0('0x8f')]=_0xd6ad89[_0xa9b0('0x2e')]({'plain':!![]});_0x10cd03[_0xa9b0('0x8f')]['created']=_0x199348;if(_0x10cd03[_0xa9b0('0x8f')]['created']){if(_0x10cd03['account']['autoclose']){_0x10cd03[_0xa9b0('0x82')][_0xa9b0('0x90')]({'id':0x0,'priority':_0x10cd03[_0xa9b0('0x82')][_0xa9b0('0x3e')]+0x1,'app':_0xa9b0('0x91'),'appdata':_0xa9b0('0x92'),'interval':_0xa9b0('0x93')});}}return db['OpenchannelMessage'][_0xa9b0('0x55')]({'body':_0x556787[_0xa9b0('0x56')]['body'],'OpenchannelAccountId':_0x556787['params']['id'],'OpenchannelInteractionId':_0xd6ad89['id'],'direction':'in','ContactId':_0x10cd03['contact']['id'],'AttachmentId':_0x556787[_0xa9b0('0x56')]['AttachmentId']});})[_0xa9b0('0x2d')](function(_0xf4cede){_0x10cd03[_0xa9b0('0x1e')]=_0xf4cede;if(_0x10cd03[_0xa9b0('0x8f')][_0xa9b0('0x94')]){return db[_0xa9b0('0x95')][_0xa9b0('0x54')]({'attributes':['id',_0xa9b0('0x31')],'where':{'id':_0x10cd03[_0xa9b0('0x8f')][_0xa9b0('0x94')]}})['then'](function(_0x515678){if(_0x515678){_0x10cd03[_0xa9b0('0x82')][_0xa9b0('0x96')]({'id':0x0,'priority':0x0,'app':_0xa9b0('0x97'),'appdata':_0x515678[_0xa9b0('0x31')]+','+(_0x10cd03[_0xa9b0('0x80')][_0xa9b0('0x98')]||0xa),'interval':_0xa9b0('0x93')});_0x10cd03[_0xa9b0('0x99')]=![];}return respondWithRpcPromise(_0xa9b0('0x9a'),_0xa9b0('0x9b'),_0x10cd03);});}return respondWithRpcPromise(_0xa9b0('0x9a'),_0xa9b0('0x9b'),_0x10cd03);})['then'](function(_0x2bf8){respondWithRpcPromise(_0xa9b0('0x9c'),_0xa9b0('0x9c'),{'event':_0xa9b0('0x6b'),'message':_0x2bf8},client9002);return _0x2bf8;})[_0xa9b0('0x2d')](respondWithResult(_0x4f1df1,null))['catch'](handleError(_0x4f1df1,null));};exports['addApplications']=function(_0x151483,_0x2f9c64){var _0x30baec=_0x151483[_0xa9b0('0x50')]['id'];var _0x57b0a1=_0x151483[_0xa9b0('0x56')];var _0x262547=0xc8;var _0x2cc9b9=null;return db[_0xa9b0('0x9d')][_0xa9b0('0x9e')]({'isolationLevel':db[_0xa9b0('0x9d')][_0xa9b0('0x9f')][_0xa9b0('0xa0')]['READ_COMMITTED']},function(_0x266586){return db[_0xa9b0('0x4a')][_0xa9b0('0x61')]({'where':{'id':_0x30baec},'transaction':_0x266586})[_0xa9b0('0x2d')](function(_0x159ae0){if(_0x159ae0){return db['OpenchannelApplication'][_0xa9b0('0x2c')]({'where':{'OpenchannelAccountId':_0x30baec},'transaction':_0x266586})[_0xa9b0('0x2d')](function(){var _0x48248a=_['map'](_0x57b0a1,function(_0x15b9aa){_0x15b9aa[_0xa9b0('0x63')]=_0x30baec;return _0x15b9aa;});return db['OpenchannelApplication'][_0xa9b0('0xa1')](_0x48248a,{'transaction':_0x266586});});}else{_0x262547=0x194;_0x2cc9b9=[];}});})[_0xa9b0('0x2d')](function(){if(_0x262547!==0x194){return db[_0xa9b0('0xa2')][_0xa9b0('0xa3')]({'where':{'OpenchannelAccountId':_0x30baec},'order':_0xa9b0('0x83')})[_0xa9b0('0x2d')](function(_0x55f606){_0x2cc9b9=_0x55f606;});}})[_0xa9b0('0x4e')](function(_0x47e050){_0x262547=0x1f4;logger[_0xa9b0('0x1c')](_0x47e050[_0xa9b0('0x30')]);if(_0x47e050[_0xa9b0('0x31')]){delete _0x47e050[_0xa9b0('0x31')];}_0x2cc9b9=_0x47e050;})[_0xa9b0('0xa4')](function(){if(_0x2cc9b9===null){_0x2f9c64[_0xa9b0('0x20')](_0x262547);}else{if(_0x262547===0x1f4){_0x2f9c64[_0xa9b0('0x22')](_0x262547)[_0xa9b0('0x32')](_0x2cc9b9);}else{_0x2f9c64['status'](_0x262547)[_0xa9b0('0x27')](_0x2cc9b9);}}});};exports[_0xa9b0('0xa5')]=function(_0x141ea4,_0x29222e,_0x3178a8){var _0x875a27={};var _0x1713ab={};var _0x51b825;var _0x18af57;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x141ea4['params']['id']}})['then'](handleEntityNotFound(_0x29222e,null))[_0xa9b0('0x2d')](function(_0x347c04){if(_0x347c04){_0x51b825=_0x347c04;_0x1713ab[_0xa9b0('0x39')]=_['keys'](db[_0xa9b0('0xa2')][_0xa9b0('0x36')]);_0x1713ab[_0xa9b0('0x3a')]=_[_0xa9b0('0x52')](_0x141ea4[_0xa9b0('0x3a')]);_0x1713ab[_0xa9b0('0x45')]=_[_0xa9b0('0x3b')](_0x1713ab[_0xa9b0('0x39')],_0x1713ab[_0xa9b0('0x3a')]);_0x875a27[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x1713ab[_0xa9b0('0x39')],qs[_0xa9b0('0x3d')](_0x141ea4['query'][_0xa9b0('0x3d')]));_0x875a27[_0xa9b0('0x3c')]=_0x875a27[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x875a27[_0xa9b0('0x3c')]:_0x1713ab[_0xa9b0('0x39')];_0x875a27[_0xa9b0('0x42')]=qs[_0xa9b0('0x43')](_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x43')]);_0x875a27[_0xa9b0('0x44')]=qs[_0xa9b0('0x45')](_[_0xa9b0('0x62')](_0x141ea4[_0xa9b0('0x3a')],_0x1713ab[_0xa9b0('0x45')]));if(_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x46')]){_0x875a27[_0xa9b0('0x44')]=_[_0xa9b0('0x48')](_0x875a27[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0x875a27[_0xa9b0('0x3c')],function(_0x5ad56a){var _0x53dbe0={};_0x53dbe0[_0x5ad56a]={'$like':'%'+_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x46')]+'%'};return _0x53dbe0;})});}_0x875a27=_[_0xa9b0('0x48')]({},_0x875a27,_0x141ea4['options']);return _0x51b825[_0xa9b0('0xa5')](_0x875a27);}})[_0xa9b0('0x2d')](function(_0x50dac7){if(_0x50dac7){_0x18af57=_0x50dac7[_0xa9b0('0x3e')];if(!_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x3f')](_0xa9b0('0x40'))){_0x875a27[_0xa9b0('0x41')]=qs[_0xa9b0('0x41')](_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x41')]);_0x875a27[_0xa9b0('0x23')]=qs[_0xa9b0('0x23')](_0x141ea4[_0xa9b0('0x3a')][_0xa9b0('0x23')]);}return _0x51b825['getApplications'](_0x875a27);}})[_0xa9b0('0x2d')](function(_0x1688ca){if(_0x1688ca){return _0x1688ca?{'count':_0x18af57,'rows':_0x1688ca}:null;}})['then'](respondWithResult(_0x29222e,null))[_0xa9b0('0x4e')](handleError(_0x29222e,null));};exports[_0xa9b0('0xa6')]=function(_0x3be1c0,_0x22ab9f,_0x2b5663){var _0xa5c872={'raw':![],'where':{}};var _0x51e494={};var _0x13e2d4={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3be1c0[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x22ab9f,null))[_0xa9b0('0x2d')](function(_0x5bce65){if(_0x5bce65){_0x51e494[_0xa9b0('0x39')]=_[_0xa9b0('0x52')](db[_0xa9b0('0x88')][_0xa9b0('0x36')]);_0x51e494[_0xa9b0('0x3a')]=_[_0xa9b0('0x52')](_0x3be1c0[_0xa9b0('0x3a')]);_0x51e494[_0xa9b0('0x45')]=_[_0xa9b0('0x3b')](_0x51e494[_0xa9b0('0x39')],_0x51e494[_0xa9b0('0x3a')]);_0xa5c872[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x51e494[_0xa9b0('0x39')],qs['fields'](_0x3be1c0['query'][_0xa9b0('0x3d')]));_0xa5c872['attributes']=_0xa5c872[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0xa5c872['attributes']:_0x51e494['model'];if(!_0x3be1c0['query']['hasOwnProperty'](_0xa9b0('0x40'))){_0xa5c872[_0xa9b0('0x41')]=qs[_0xa9b0('0x41')](_0x3be1c0[_0xa9b0('0x3a')][_0xa9b0('0x41')]);_0xa5c872[_0xa9b0('0x23')]=qs[_0xa9b0('0x23')](_0x3be1c0[_0xa9b0('0x3a')]['offset']);}_0xa5c872[_0xa9b0('0x42')]=qs['sort'](_0x3be1c0['query'][_0xa9b0('0x43')]);_0xa5c872[_0xa9b0('0x44')]=qs[_0xa9b0('0x45')](_[_0xa9b0('0x62')](_0x3be1c0[_0xa9b0('0x3a')],_0x51e494[_0xa9b0('0x45')]));_0xa5c872[_0xa9b0('0x44')]['OpenchannelAccountId']=_0x5bce65['id'];if(_0x3be1c0[_0xa9b0('0x3a')][_0xa9b0('0x46')]){_0xa5c872[_0xa9b0('0x44')]=_[_0xa9b0('0x48')](_0xa5c872[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0xa5c872['attributes'],function(_0x4a8155){var _0x3e332d={};_0x3e332d[_0x4a8155]={'$like':'%'+_0x3be1c0[_0xa9b0('0x3a')][_0xa9b0('0x46')]+'%'};return _0x3e332d;})});}_0xa5c872=_[_0xa9b0('0x48')]({},_0xa5c872,_0x3be1c0[_0xa9b0('0x49')]);return db[_0xa9b0('0x88')]['count']({'where':_0xa5c872[_0xa9b0('0x44')]})[_0xa9b0('0x2d')](function(_0x47827d){_0x13e2d4[_0xa9b0('0x25')]=_0x47827d;if(_0x3be1c0[_0xa9b0('0x3a')][_0xa9b0('0x53')]){_0xa5c872['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa9b0('0x95')],'as':_0xa9b0('0xa7'),'attributes':[_0xa9b0('0x31'),_0xa9b0('0xa8'),_0xa9b0('0xa9')],'required':![]},{'model':db[_0xa9b0('0xaa')],'as':'Tags','attributes':['id',_0xa9b0('0x31'),_0xa9b0('0xab')],'where':_0x3be1c0[_0xa9b0('0x3a')]['tag']?{'id':_0x3be1c0['query'][_0xa9b0('0xac')]}:undefined,'required':_0x3be1c0[_0xa9b0('0x3a')]['tag']?!![]:![]}];}return db[_0xa9b0('0x88')][_0xa9b0('0x4c')](_0xa5c872);})[_0xa9b0('0x2d')](function(_0x276145){_0x13e2d4['rows']=_0x276145;return _0x13e2d4;});}})[_0xa9b0('0x2d')](respondWithFilteredResult(_0x22ab9f,_0xa5c872))['catch'](handleError(_0x22ab9f,null));};exports[_0xa9b0('0xad')]=function(_0x12499e,_0x330a69,_0x19b07d){return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x12499e[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x330a69,null))[_0xa9b0('0x2d')](function(_0x4e8889){if(_0x4e8889){return _0x4e8889['addAgents'](_0x12499e[_0xa9b0('0x56')][_0xa9b0('0x66')],_['omit'](_0x12499e['body'],[_0xa9b0('0x66'),'id'])||{})['spread'](function(_0x2e5750){for(var _0x2a54d9=0x0;_0x2a54d9<_0x12499e[_0xa9b0('0x56')]['ids'][_0xa9b0('0x3e')];_0x2a54d9+=0x1){socket[_0xa9b0('0xae')]('userOpenchannelAccount:save',{'UserId':Number(_0x12499e[_0xa9b0('0x56')][_0xa9b0('0x66')][_0x2a54d9]),'OpenchannelAccountId':Number(_0x12499e[_0xa9b0('0x50')]['id'])});}return _0x2e5750;});}})[_0xa9b0('0x2d')](respondWithResult(_0x330a69,null))[_0xa9b0('0x4e')](handleError(_0x330a69,null));};exports[_0xa9b0('0xaf')]=function(_0x399902,_0x9f7711,_0x4c7fb7){return db[_0xa9b0('0x4a')][_0xa9b0('0x54')]({'where':{'id':_0x399902[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0x9f7711,null))[_0xa9b0('0x2d')](function(_0x266e9d){if(_0x266e9d){return _0x266e9d['removeAgents'](_0x399902['query'][_0xa9b0('0x66')])['then'](function(){if(_['isArray'](_0x399902[_0xa9b0('0x3a')]['ids'])){for(var _0x1e70c7=0x0;_0x1e70c7<_0x399902[_0xa9b0('0x3a')][_0xa9b0('0x66')][_0xa9b0('0x3e')];_0x1e70c7+=0x1){socket[_0xa9b0('0xae')](_0xa9b0('0xb0'),{'UserId':Number(_0x399902['query'][_0xa9b0('0x66')][_0x1e70c7]),'OpenchannelAccountId':Number(_0x399902[_0xa9b0('0x50')]['id'])});}}else{socket[_0xa9b0('0xae')](_0xa9b0('0xb0'),{'UserId':Number(_0x399902['query'][_0xa9b0('0x66')]),'OpenchannelAccountId':Number(_0x399902[_0xa9b0('0x50')]['id'])});}});}})[_0xa9b0('0x2d')](respondWithStatusCode(_0x9f7711,null))[_0xa9b0('0x4e')](handleError(_0x9f7711,null));};exports[_0xa9b0('0xb1')]=function(_0x4a5979,_0x328e7d,_0x35f4e4){var _0x3990d3={};var _0x1205bb={};var _0x106193;var _0x35098f;return db[_0xa9b0('0x4a')][_0xa9b0('0x61')]({'where':{'id':_0x4a5979[_0xa9b0('0x50')]['id']}})['then'](handleEntityNotFound(_0x328e7d,null))[_0xa9b0('0x2d')](function(_0x4cb137){if(_0x4cb137){_0x106193=_0x4cb137;_0x1205bb['model']=_[_0xa9b0('0x52')](db[_0xa9b0('0x95')][_0xa9b0('0x36')]);_0x1205bb[_0xa9b0('0x3a')]=_[_0xa9b0('0x52')](_0x4a5979[_0xa9b0('0x3a')]);_0x1205bb[_0xa9b0('0x45')]=_['intersection'](_0x1205bb[_0xa9b0('0x39')],_0x1205bb[_0xa9b0('0x3a')]);_0x3990d3[_0xa9b0('0x3c')]=_[_0xa9b0('0x3b')](_0x1205bb['model'],qs[_0xa9b0('0x3d')](_0x4a5979[_0xa9b0('0x3a')][_0xa9b0('0x3d')]));_0x3990d3['attributes']=_0x3990d3[_0xa9b0('0x3c')][_0xa9b0('0x3e')]?_0x3990d3[_0xa9b0('0x3c')]:_0x1205bb[_0xa9b0('0x39')];_0x3990d3[_0xa9b0('0x42')]=qs[_0xa9b0('0x43')](_0x4a5979['query']['sort']);_0x3990d3[_0xa9b0('0x44')]=qs['filters'](_[_0xa9b0('0x62')](_0x4a5979['query'],_0x1205bb[_0xa9b0('0x45')]));if(_0x4a5979[_0xa9b0('0x3a')][_0xa9b0('0x46')]){_0x3990d3['where']=_[_0xa9b0('0x48')](_0x3990d3[_0xa9b0('0x44')],{'$or':_[_0xa9b0('0x35')](_0x3990d3[_0xa9b0('0x3c')],function(_0x3deed9){var _0x2fafeb={};_0x2fafeb[_0x3deed9]={'$like':'%'+_0x4a5979[_0xa9b0('0x3a')]['filter']+'%'};return _0x2fafeb;})});}_0x3990d3=_['merge']({},_0x3990d3,_0x4a5979[_0xa9b0('0x49')]);return _0x106193[_0xa9b0('0xb1')](_0x3990d3);}})[_0xa9b0('0x2d')](function(_0x2a25cc){if(_0x2a25cc){_0x35098f=_0x2a25cc[_0xa9b0('0x3e')];if(!_0x4a5979[_0xa9b0('0x3a')][_0xa9b0('0x3f')]('nolimit')){_0x3990d3[_0xa9b0('0x41')]=qs[_0xa9b0('0x41')](_0x4a5979[_0xa9b0('0x3a')][_0xa9b0('0x41')]);_0x3990d3['offset']=qs[_0xa9b0('0x23')](_0x4a5979[_0xa9b0('0x3a')][_0xa9b0('0x23')]);}return _0x106193['getAgents'](_0x3990d3);}})[_0xa9b0('0x2d')](function(_0x3f89a9){if(_0x3f89a9){return _0x3f89a9?{'count':_0x35098f,'rows':_0x3f89a9}:null;}})[_0xa9b0('0x2d')](respondWithResult(_0x328e7d,null))[_0xa9b0('0x4e')](handleError(_0x328e7d,null));};exports[_0xa9b0('0x32')]=function(_0x1b5928,_0xbe2415,_0x57ff14){var _0x36121b,_0x51da17,_0x5d742c;if(_[_0xa9b0('0x75')](_0x1b5928['body'][_0xa9b0('0x56')])||_0x1b5928[_0xa9b0('0x56')][_0xa9b0('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0xa9b0('0x79'));}if(_[_0xa9b0('0x75')](_0x1b5928['body']['to'])){}_0x36121b=_0x1b5928['body']['to'];return db[_0xa9b0('0x4a')][_0xa9b0('0x61')]({'where':{'id':_0x1b5928[_0xa9b0('0x50')]['id']}})[_0xa9b0('0x2d')](handleEntityNotFound(_0xbe2415,null))[_0xa9b0('0x2d')](function(_0x2b6fea){if(_0x2b6fea){return db['OpenchannelAccount'][_0xa9b0('0x54')]({'where':{'id':_0x2b6fea['id']},'include':[{'model':db[_0xa9b0('0x7c')],'as':_0xa9b0('0x7d'),'include':[{'model':db[_0xa9b0('0x6d')],'as':_0xa9b0('0x85'),'where':{[_0x2b6fea['mapKey']]:_0x36121b},'limit':0x1,'order':[[_0xa9b0('0x72'),_0xa9b0('0x7e')]]}]}]})['then'](handleEntityNotFound(_0xbe2415,null))['then'](function(_0x18d1e9){if(_0x18d1e9&&_0x18d1e9['List']){_0x51da17=_0x18d1e9[_0xa9b0('0x2e')]({'plain':!![]});if(_0x51da17['List']&&_0x51da17['List'][_0xa9b0('0x85')]['length']){return _0x51da17[_0xa9b0('0x7d')][_0xa9b0('0x85')][0x0];}return db[_0xa9b0('0x6d')][_0xa9b0('0x55')](_['defaults'](_0x1b5928[_0xa9b0('0x56')],{'firstName':_0x36121b,[_0x18d1e9['mapKey']]:_0x36121b,'phone':_0x36121b,'ListId':_0x51da17[_0xa9b0('0x74')]}));}})[_0xa9b0('0x2d')](handleEntityNotFound(_0xbe2415,null))[_0xa9b0('0x2d')](function(_0x242c04){if(_0x242c04){_0x5d742c=_0x242c04;return db[_0xa9b0('0x88')][_0xa9b0('0x54')]({'where':{'ContactId':_0x5d742c['id'],'closed':![],'OpenchannelAccountId':_0x51da17['id']}})['then'](function(_0x23c727){if(_0x23c727){return[_0x23c727,![]];}return db[_0xa9b0('0x88')][_0xa9b0('0x55')]({'UserId':_0x1b5928['user']['id'],'ContactId':_0x5d742c['id'],'OpenchannelAccountId':_0x51da17['id'],'lastMsgDirection':_0xa9b0('0xb2'),'Messages':[_[_0xa9b0('0x48')](_0x1b5928[_0xa9b0('0x56')],{'read':![],'body':_0x1b5928[_0xa9b0('0x56')][_0xa9b0('0x56')],'OpenchannelAccountId':_0x51da17['id'],'UserId':_0x1b5928[_0xa9b0('0x58')]['id'],'ContactId':_0x5d742c['id']})]},{'include':[{'model':db[_0xa9b0('0xb3')],'as':_0xa9b0('0xb4')}]})['then'](function(_0x24c427){return[_0x24c427,!![]];});});}})[_0xa9b0('0x8b')](function(_0x229eb8,_0x2f9a51){if(_0x2f9a51){return _0x229eb8;}return db[_0xa9b0('0xb3')]['create'](_[_0xa9b0('0x48')](_0x1b5928[_0xa9b0('0x56')],{'read':![],'body':_0x1b5928[_0xa9b0('0x56')][_0xa9b0('0x56')],'OpenchannelAccountId':_0x51da17['id'],'OpenchannelInteractionId':_0x229eb8['id'],'UserId':_0x1b5928[_0xa9b0('0x58')]['id'],'ContactId':_0x5d742c['id']}))['then'](function(_0x2c9393){_0x229eb8['dataValues']['Messages']=[];_0x229eb8[_0xa9b0('0xb5')][_0xa9b0('0xb4')][_0xa9b0('0x90')](_0x2c9393[_0xa9b0('0xb5')]);return _0x229eb8;});});}})[_0xa9b0('0x2d')](respondWithResult(_0xbe2415,null))[_0xa9b0('0x4e')](handleError(_0xbe2415,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index fb287dc..45728bf 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x5ae8bb,_0x7be596){var _0x44606c=function(_0x3e65c3){while(--_0x3e65c3){_0x5ae8bb['push'](_0x5ae8bb['shift']());}};_0x44606c(++_0x7be596);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x586bc0,_0x4ec1d6){var _0x4367af=function(_0x36f502){while(--_0x36f502){_0x586bc0['push'](_0x586bc0['shift']());}};_0x4367af(++_0x4ec1d6);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 15244e0..6587903 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(_0xed7ec3,_0x4010d6){var _0x16e8db=function(_0x1027d4){while(--_0x1027d4){_0xed7ec3['push'](_0xed7ec3['shift']());}};_0x16e8db(++_0x4010d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x388eec,_0x179074){var _0x1cdcdc=function(_0x197990){while(--_0x197990){_0x388eec['push'](_0x388eec['shift']());}};_0x1cdcdc(++_0x179074);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 2050279..759b21b 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 _0x80df=['OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','error','code'];(function(_0x6debee,_0x2a11a9){var _0x25424c=function(_0x4e4b1d){while(--_0x4e4b1d){_0x6debee['push'](_0x6debee['shift']());}};_0x25424c(++_0x2a11a9);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});config[_0xf80d('0xd')]=_['defaults'](config[_0xf80d('0xd')],{'host':_0xf80d('0xe'),'port':0x18eb});var socket=require(_0xf80d('0xf'))(new Redis(config[_0xf80d('0xd')]));require(_0xf80d('0x10'))[_0xf80d('0x11')](socket);function respondWithRpcPromise(_0x41595f,_0x45d290,_0x2fddc2){return new BPromise(function(_0x2ef5d1,_0x30df95){return client[_0xf80d('0x12')](_0x41595f,_0x2fddc2)[_0xf80d('0x13')](function(_0x29bd2c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x45d290,_0xf80d('0x14'));logger[_0xf80d('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45d290,_0xf80d('0x14'),JSON['stringify'](_0x29bd2c));if(_0x29bd2c[_0xf80d('0x16')]){if(_0x29bd2c['error'][_0xf80d('0x17')]===0x1f4){logger['error'](_0xf80d('0x18'),_0x45d290,_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);return _0x30df95(_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);}logger[_0xf80d('0x16')](_0xf80d('0x18'),_0x45d290,_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);return _0x2ef5d1(_0x29bd2c[_0xf80d('0x16')][_0xf80d('0x19')]);}else{logger[_0xf80d('0x1a')](_0xf80d('0x18'),_0x45d290,_0xf80d('0x14'));_0x2ef5d1(_0x29bd2c[_0xf80d('0x1b')][_0xf80d('0x19')]);}})[_0xf80d('0x1c')](function(_0x124174){logger[_0xf80d('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x45d290,_0x124174);_0x30df95(_0x124174);});});} \ No newline at end of file +var _0x04b8=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x7c877,_0x5cd882){var _0xb7416d=function(_0x2e6e64){while(--_0x2e6e64){_0x7c877['push'](_0x7c877['shift']());}};_0xb7416d(++_0x5cd882);}(_0x04b8,0x159));var _0x804b=function(_0x23902e,_0x2bcb4e){_0x23902e=_0x23902e-0x0;var _0x28f007=_0x04b8[_0x23902e];return _0x28f007;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});config[_0x804b('0x9')]=_[_0x804b('0xa')](config['redis'],{'host':_0x804b('0xb'),'port':0x18eb});var socket=require(_0x804b('0xc'))(new Redis(config['redis']));require(_0x804b('0xd'))[_0x804b('0xe')](socket);function respondWithRpcPromise(_0x222487,_0x22c59a,_0x1c5c15){return new BPromise(function(_0x5c1a40,_0x22c98d){return client[_0x804b('0xf')](_0x222487,_0x1c5c15)[_0x804b('0x10')](function(_0x7029e7){logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,'request\x20sent');logger[_0x804b('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x22c59a,_0x804b('0x14'),JSON[_0x804b('0x15')](_0x7029e7));if(_0x7029e7[_0x804b('0x16')]){if(_0x7029e7[_0x804b('0x16')]['code']===0x1f4){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);return _0x22c98d(_0x7029e7['error'][_0x804b('0x17')]);}logger[_0x804b('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x22c59a,_0x7029e7[_0x804b('0x16')]['message']);return _0x5c1a40(_0x7029e7[_0x804b('0x16')][_0x804b('0x17')]);}else{logger[_0x804b('0x11')](_0x804b('0x12'),_0x22c59a,_0x804b('0x14'));_0x5c1a40(_0x7029e7['result'][_0x804b('0x17')]);}})['catch'](function(_0x247380){logger[_0x804b('0x16')](_0x804b('0x12'),_0x22c59a,_0x247380);_0x22c98d(_0x247380);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index d6f5ca7..8ec7da9 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 _0xb677=['remove','update','emit','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x1a5f2b,_0x51a8b8){var _0xcc90e4=function(_0x155660){while(--_0x155660){_0x1a5f2b['push'](_0x1a5f2b['shift']());}};_0xcc90e4(++_0x51a8b8);}(_0xb677,0x119));var _0x7b67=function(_0x53013d,_0x583c2a){_0x53013d=_0x53013d-0x0;var _0x1b5377=_0xb677[_0x53013d];return _0x1b5377;};'use strict';var OpenchannelAccountEvents=require(_0x7b67('0x0'));var events=['save',_0x7b67('0x1'),_0x7b67('0x2')];function createListener(_0x388b87,_0x749563){return function(_0x13f678){_0x749563[_0x7b67('0x3')](_0x388b87,_0x13f678);};}function removeListener(_0x927eee,_0x28e9f6){return function(){OpenchannelAccountEvents['removeListener'](_0x927eee,_0x28e9f6);};}exports[_0x7b67('0x4')]=function(_0x21ccf2){for(var _0x2beadb=0x0,_0x3b7a82=events['length'];_0x2beadb<_0x3b7a82;_0x2beadb++){var _0x5af161=events[_0x2beadb];var _0x560eea=createListener(_0x7b67('0x5')+_0x5af161,_0x21ccf2);OpenchannelAccountEvents['on'](_0x5af161,_0x560eea);}}; \ No newline at end of file +var _0x76bc=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x1331d3,_0x5e22be){var _0x2e04c7=function(_0x33dadc){while(--_0x33dadc){_0x1331d3['push'](_0x1331d3['shift']());}};_0x2e04c7(++_0x5e22be);}(_0x76bc,0x17f));var _0xc76b=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x76bc[_0x393d69];return _0x3cee37;};'use strict';var OpenchannelAccountEvents=require(_0xc76b('0x0'));var events=[_0xc76b('0x1'),_0xc76b('0x2'),_0xc76b('0x3')];function createListener(_0x178974,_0x5a265d){return function(_0x5ce5d4){_0x5a265d[_0xc76b('0x4')](_0x178974,_0x5ce5d4);};}function removeListener(_0x161ef3,_0x3f7b22){return function(){OpenchannelAccountEvents[_0xc76b('0x5')](_0x161ef3,_0x3f7b22);};}exports[_0xc76b('0x6')]=function(_0x239be6){for(var _0x25b111=0x0,_0x2cbe53=events[_0xc76b('0x7')];_0x25b111<_0x2cbe53;_0x25b111++){var _0x1cb174=events[_0x25b111];var _0x235ff3=createListener(_0xc76b('0x8')+_0x1cb174,_0x239be6);OpenchannelAccountEvents['on'](_0x1cb174,_0x235ff3);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 85e5764..b4194bd 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 _0x03a8=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x5d2f44,_0x148a36){var _0xc0883b=function(_0x5c7950){while(--_0x5c7950){_0x5d2f44['push'](_0x5d2f44['shift']());}};_0xc0883b(++_0x148a36);}(_0x03a8,0x1ec));var _0x803a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03a8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x803a('0x0'));var util=require('util');var path=require(_0x803a('0x1'));var timeout=require(_0x803a('0x2'));var express=require('express');var router=express[_0x803a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x803a('0x4'));var interaction=require(_0x803a('0x5'));var config=require(_0x803a('0x6'));var controller=require('./openchannelApplication.controller');router[_0x803a('0x7')]('/',auth[_0x803a('0x8')](),controller['index']);router[_0x803a('0x7')](_0x803a('0x9'),auth[_0x803a('0x8')](),controller[_0x803a('0xa')]);router[_0x803a('0xb')]('/',auth['isAuthenticated'](),controller[_0x803a('0xc')]);router[_0x803a('0xd')](_0x803a('0x9'),auth[_0x803a('0x8')](),controller['update']);router[_0x803a('0xe')](_0x803a('0x9'),auth[_0x803a('0x8')](),controller[_0x803a('0xf')]);module[_0x803a('0x10')]=router; \ No newline at end of file +var _0xd3c2=['/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xd3c2,0x1d0));var _0x2d3c=function(_0x3a73df,_0x1124be){_0x3a73df=_0x3a73df-0x0;var _0x15815c=_0xd3c2[_0x3a73df];return _0x15815c;};'use strict';var multer=require('multer');var util=require(_0x2d3c('0x0'));var path=require(_0x2d3c('0x1'));var timeout=require(_0x2d3c('0x2'));var express=require(_0x2d3c('0x3'));var router=express[_0x2d3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d3c('0x5'));var interaction=require(_0x2d3c('0x6'));var config=require(_0x2d3c('0x7'));var controller=require('./openchannelApplication.controller');router[_0x2d3c('0x8')]('/',auth[_0x2d3c('0x9')](),controller[_0x2d3c('0xa')]);router['get'](_0x2d3c('0xb'),auth[_0x2d3c('0x9')](),controller[_0x2d3c('0xc')]);router[_0x2d3c('0xd')]('/',auth[_0x2d3c('0x9')](),controller[_0x2d3c('0xe')]);router[_0x2d3c('0xf')](_0x2d3c('0xb'),auth['isAuthenticated'](),controller[_0x2d3c('0x10')]);router['delete'](_0x2d3c('0xb'),auth[_0x2d3c('0x9')](),controller[_0x2d3c('0x11')]);module[_0x2d3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 8bbb00c..84c5c4d 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 _0x6b6d=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x3d2f6a,_0x3e4923){var _0x5c4851=function(_0x213ba1){while(--_0x213ba1){_0x3d2f6a['push'](_0x3d2f6a['shift']());}};_0x5c4851(++_0x3e4923);}(_0x6b6d,0x124));var _0xd6b6=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x6b6d[_0x2fee96];return _0x2e6ad1;};'use strict';var Sequelize=require('sequelize');module[_0xd6b6('0x0')]={'priority':{'type':Sequelize[_0xd6b6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd6b6('0x2')],'allowNull':![],'defaultValue':_0xd6b6('0x3')},'appdata':{'type':Sequelize[_0xd6b6('0x4')]()},'description':{'type':Sequelize[_0xd6b6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xcc79=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x4f0b54,_0x301666){var _0x3e2440=function(_0x1369e2){while(--_0x1369e2){_0x4f0b54['push'](_0x4f0b54['shift']());}};_0x3e2440(++_0x301666);}(_0xcc79,0xc1));var _0x9cc7=function(_0x1c67f8,_0x4738d6){_0x1c67f8=_0x1c67f8-0x0;var _0x3b9f8c=_0xcc79[_0x1c67f8];return _0x3b9f8c;};'use strict';var Sequelize=require(_0x9cc7('0x0'));module[_0x9cc7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9cc7('0x2')},'appdata':{'type':Sequelize[_0x9cc7('0x3')]()},'description':{'type':Sequelize[_0x9cc7('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9cc7('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index bbc1e80..af07984 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 _0x2124=['sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','create','body','find','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0x2124,0xa4));var _0x4212=function(_0x41f27d,_0x3932b5){_0x41f27d=_0x41f27d-0x0;var _0x993fac=_0x2124[_0x41f27d];return _0x993fac;};'use strict';var emlformat=require(_0x4212('0x0'));var rimraf=require(_0x4212('0x1'));var zipdir=require(_0x4212('0x2'));var jsonpatch=require(_0x4212('0x3'));var rp=require(_0x4212('0x4'));var moment=require(_0x4212('0x5'));var BPromise=require(_0x4212('0x6'));var Mustache=require(_0x4212('0x7'));var util=require(_0x4212('0x8'));var path=require(_0x4212('0x9'));var sox=require(_0x4212('0xa'));var csv=require(_0x4212('0xb'));var ejs=require(_0x4212('0xc'));var fs=require('fs');var fs_extra=require(_0x4212('0xd'));var _=require(_0x4212('0xe'));var squel=require('squel');var crypto=require(_0x4212('0xf'));var jsforce=require(_0x4212('0x10'));var deskjs=require(_0x4212('0x11'));var toCsv=require(_0x4212('0xb'));var querystring=require(_0x4212('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4212('0x13'));var as=require(_0x4212('0x14'));var hardwareService=require(_0x4212('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4212('0x16'));var licenseUtil=require(_0x4212('0x17'));var db=require(_0x4212('0x18'))['db'];function respondWithStatusCode(_0x4a250c,_0x3cd59b){_0x3cd59b=_0x3cd59b||0xcc;return function(_0x13b2e8){if(_0x13b2e8){return _0x4a250c[_0x4212('0x19')](_0x3cd59b);}return _0x4a250c[_0x4212('0x1a')](_0x3cd59b)[_0x4212('0x1b')]();};}function respondWithResult(_0x31fabd,_0x22c231){_0x22c231=_0x22c231||0xc8;return function(_0x20695a){if(_0x20695a){return _0x31fabd[_0x4212('0x1a')](_0x22c231)[_0x4212('0x1c')](_0x20695a);}};}function respondWithFilteredResult(_0x4d6cc8,_0x1527d4){return function(_0x39bcdb){if(_0x39bcdb){var _0x6f6e99=typeof _0x1527d4[_0x4212('0x1d')]===_0x4212('0x1e')&&typeof _0x1527d4[_0x4212('0x1f')]===_0x4212('0x1e');var _0x1eb527=_0x39bcdb[_0x4212('0x20')];var _0x9683b5=_0x6f6e99?0x0:_0x1527d4[_0x4212('0x1d')];var _0x2d8080=_0x6f6e99?_0x39bcdb[_0x4212('0x20')]:_0x1527d4[_0x4212('0x1d')]+_0x1527d4[_0x4212('0x1f')];var _0x21ca1a;if(_0x2d8080>=_0x1eb527){_0x2d8080=_0x1eb527;_0x21ca1a=0xc8;}else{_0x21ca1a=0xce;}_0x4d6cc8['status'](_0x21ca1a);return _0x4d6cc8[_0x4212('0x21')]('Content-Range',_0x9683b5+'-'+_0x2d8080+'/'+_0x1eb527)['json'](_0x39bcdb);}return null;};}function patchUpdates(_0x26f14b){return function(_0x4e3140){try{jsonpatch[_0x4212('0x22')](_0x4e3140,_0x26f14b,!![]);}catch(_0x542e5d){return BPromise[_0x4212('0x23')](_0x542e5d);}return _0x4e3140[_0x4212('0x24')]();};}function saveUpdates(_0x5c8b02,_0x144dd8){return function(_0x2d7ca8){if(_0x2d7ca8){return _0x2d7ca8[_0x4212('0x25')](_0x5c8b02)[_0x4212('0x26')](function(_0x33fc52){return _0x33fc52;});}return null;};}function removeEntity(_0x26e106,_0x342d48){return function(_0x23195a){if(_0x23195a){return _0x23195a[_0x4212('0x27')]()[_0x4212('0x26')](function(){_0x26e106[_0x4212('0x1a')](0xcc)[_0x4212('0x1b')]();});}};}function handleEntityNotFound(_0x1ac41a,_0x2c9436){return function(_0x1a9e23){if(!_0x1a9e23){_0x1ac41a[_0x4212('0x19')](0x194);}return _0x1a9e23;};}function handleError(_0xf95fd,_0x11af9a){_0x11af9a=_0x11af9a||0x1f4;return function(_0x2871ac){logger[_0x4212('0x28')](_0x2871ac[_0x4212('0x29')]);if(_0x2871ac[_0x4212('0x2a')]){delete _0x2871ac[_0x4212('0x2a')];}_0xf95fd[_0x4212('0x1a')](_0x11af9a)[_0x4212('0x2b')](_0x2871ac);};}exports[_0x4212('0x2c')]=function(_0x4bb5f8,_0x33b327){var _0x448b56={},_0x40b80c={},_0x493853={'count':0x0,'rows':[]};var _0x1e4989=_['map'](db[_0x4212('0x2d')][_0x4212('0x2e')],function(_0x3ef356){return{'name':_0x3ef356[_0x4212('0x2f')],'type':_0x3ef356[_0x4212('0x30')][_0x4212('0x31')]};});_0x40b80c[_0x4212('0x32')]=_[_0x4212('0x33')](_0x1e4989,'name');_0x40b80c[_0x4212('0x34')]=_[_0x4212('0x35')](_0x4bb5f8[_0x4212('0x34')]);_0x40b80c[_0x4212('0x36')]=_[_0x4212('0x37')](_0x40b80c[_0x4212('0x32')],_0x40b80c[_0x4212('0x34')]);_0x448b56[_0x4212('0x38')]=_[_0x4212('0x37')](_0x40b80c['model'],qs[_0x4212('0x39')](_0x4bb5f8[_0x4212('0x34')]['fields']));_0x448b56[_0x4212('0x38')]=_0x448b56['attributes'][_0x4212('0x3a')]?_0x448b56[_0x4212('0x38')]:_0x40b80c[_0x4212('0x32')];if(!_0x4bb5f8[_0x4212('0x34')][_0x4212('0x3b')]('nolimit')){_0x448b56[_0x4212('0x1f')]=qs[_0x4212('0x1f')](_0x4bb5f8[_0x4212('0x34')][_0x4212('0x1f')]);_0x448b56[_0x4212('0x1d')]=qs[_0x4212('0x1d')](_0x4bb5f8[_0x4212('0x34')][_0x4212('0x1d')]);}_0x448b56[_0x4212('0x3c')]=qs[_0x4212('0x3d')](_0x4bb5f8[_0x4212('0x34')][_0x4212('0x3d')]);_0x448b56[_0x4212('0x3e')]=qs[_0x4212('0x36')](_['pick'](_0x4bb5f8['query'],_0x40b80c[_0x4212('0x36')]),_0x1e4989);if(_0x4bb5f8[_0x4212('0x34')]['filter']){_0x448b56[_0x4212('0x3e')]=_[_0x4212('0x3f')](_0x448b56[_0x4212('0x3e')],{'$or':_[_0x4212('0x33')](_0x1e4989,function(_0x3a1488){if(_0x3a1488[_0x4212('0x30')]!==_0x4212('0x40')){var _0x481994={};_0x481994[_0x3a1488['name']]={'$like':'%'+_0x4bb5f8[_0x4212('0x34')][_0x4212('0x41')]+'%'};return _0x481994;}})});}_0x448b56=_['merge']({},_0x448b56,_0x4bb5f8[_0x4212('0x42')]);var _0x183093={'where':_0x448b56['where']};return db[_0x4212('0x2d')][_0x4212('0x20')](_0x183093)[_0x4212('0x26')](function(_0xfe3c51){_0x493853[_0x4212('0x20')]=_0xfe3c51;if(_0x4bb5f8[_0x4212('0x34')][_0x4212('0x43')]){_0x448b56[_0x4212('0x44')]=[{'all':!![]}];}return db[_0x4212('0x2d')]['findAll'](_0x448b56);})['then'](function(_0x49d7f8){_0x493853['rows']=_0x49d7f8;return _0x493853;})[_0x4212('0x26')](respondWithFilteredResult(_0x33b327,_0x448b56))[_0x4212('0x45')](handleError(_0x33b327,null));};exports[_0x4212('0x46')]=function(_0x392611,_0x3fdb2e){var _0x316ed0={'raw':!![],'where':{'id':_0x392611[_0x4212('0x47')]['id']}},_0x38b19d={};_0x38b19d[_0x4212('0x32')]=_['keys'](db[_0x4212('0x2d')][_0x4212('0x2e')]);_0x38b19d[_0x4212('0x34')]=_[_0x4212('0x35')](_0x392611[_0x4212('0x34')]);_0x38b19d['filters']=_[_0x4212('0x37')](_0x38b19d['model'],_0x38b19d[_0x4212('0x34')]);_0x316ed0[_0x4212('0x38')]=_['intersection'](_0x38b19d[_0x4212('0x32')],qs[_0x4212('0x39')](_0x392611[_0x4212('0x34')]['fields']));_0x316ed0[_0x4212('0x38')]=_0x316ed0[_0x4212('0x38')]['length']?_0x316ed0[_0x4212('0x38')]:_0x38b19d['model'];if(_0x392611[_0x4212('0x34')][_0x4212('0x43')]){_0x316ed0['include']=[{'all':!![]}];}_0x316ed0=_[_0x4212('0x3f')]({},_0x316ed0,_0x392611[_0x4212('0x42')]);return db[_0x4212('0x2d')]['find'](_0x316ed0)[_0x4212('0x26')](handleEntityNotFound(_0x3fdb2e,null))['then'](respondWithResult(_0x3fdb2e,null))['catch'](handleError(_0x3fdb2e,null));};exports[_0x4212('0x48')]=function(_0x138db8,_0x516efc){return db[_0x4212('0x2d')][_0x4212('0x48')](_0x138db8[_0x4212('0x49')],{})[_0x4212('0x26')](respondWithResult(_0x516efc,0xc9))[_0x4212('0x45')](handleError(_0x516efc,null));};exports['update']=function(_0x2b14c8,_0x5c1920){if(_0x2b14c8[_0x4212('0x49')]['id']){delete _0x2b14c8[_0x4212('0x49')]['id'];}return db['OpenchannelApplication'][_0x4212('0x4a')]({'where':{'id':_0x2b14c8[_0x4212('0x47')]['id']}})[_0x4212('0x26')](handleEntityNotFound(_0x5c1920,null))[_0x4212('0x26')](saveUpdates(_0x2b14c8[_0x4212('0x49')],null))[_0x4212('0x26')](respondWithResult(_0x5c1920,null))[_0x4212('0x45')](handleError(_0x5c1920,null));};exports['destroy']=function(_0x3cf689,_0x309797){return db[_0x4212('0x2d')]['find']({'where':{'id':_0x3cf689[_0x4212('0x47')]['id']}})[_0x4212('0x26')](handleEntityNotFound(_0x309797,null))[_0x4212('0x26')](removeEntity(_0x309797,null))[_0x4212('0x45')](handleError(_0x309797,null));}; \ No newline at end of file +var _0xb5cf=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','error','stack','name','index','OpenchannelApplication','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','options','find','catch','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x3b0193,_0xdecb84){var _0x56b5a7=function(_0x2d627a){while(--_0x2d627a){_0x3b0193['push'](_0x3b0193['shift']());}};_0x56b5a7(++_0xdecb84);}(_0xb5cf,0xd7));var _0xfb5c=function(_0x1b226,_0x3f1cc5){_0x1b226=_0x1b226-0x0;var _0x2da4c1=_0xb5cf[_0x1b226];return _0x2da4c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb5c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb5c('0x1'));var rp=require(_0xfb5c('0x2'));var moment=require('moment');var BPromise=require(_0xfb5c('0x3'));var Mustache=require(_0xfb5c('0x4'));var util=require('util');var path=require(_0xfb5c('0x5'));var sox=require(_0xfb5c('0x6'));var csv=require(_0xfb5c('0x7'));var ejs=require(_0xfb5c('0x8'));var fs=require('fs');var fs_extra=require(_0xfb5c('0x9'));var _=require(_0xfb5c('0xa'));var squel=require('squel');var crypto=require(_0xfb5c('0xb'));var jsforce=require(_0xfb5c('0xc'));var deskjs=require(_0xfb5c('0xd'));var toCsv=require(_0xfb5c('0x7'));var querystring=require(_0xfb5c('0xe'));var Papa=require(_0xfb5c('0xf'));var Redis=require(_0xfb5c('0x10'));var authService=require(_0xfb5c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfb5c('0x12'));var hardwareService=require(_0xfb5c('0x13'));var logger=require(_0xfb5c('0x14'))('api');var utils=require(_0xfb5c('0x15'));var config=require(_0xfb5c('0x16'));var licenseUtil=require(_0xfb5c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b410f,_0x1e879f){_0x1e879f=_0x1e879f||0xcc;return function(_0xf8cc9a){if(_0xf8cc9a){return _0x5b410f[_0xfb5c('0x18')](_0x1e879f);}return _0x5b410f[_0xfb5c('0x19')](_0x1e879f)[_0xfb5c('0x1a')]();};}function respondWithResult(_0x2db1dc,_0x1e627c){_0x1e627c=_0x1e627c||0xc8;return function(_0x3b05e8){if(_0x3b05e8){return _0x2db1dc[_0xfb5c('0x19')](_0x1e627c)[_0xfb5c('0x1b')](_0x3b05e8);}};}function respondWithFilteredResult(_0x491913,_0x4cc0fe){return function(_0x24d492){if(_0x24d492){var _0x8e30aa=typeof _0x4cc0fe['offset']===_0xfb5c('0x1c')&&typeof _0x4cc0fe[_0xfb5c('0x1d')]==='undefined';var _0x45f905=_0x24d492[_0xfb5c('0x1e')];var _0x27d1d0=_0x8e30aa?0x0:_0x4cc0fe[_0xfb5c('0x1f')];var _0x11bbda=_0x8e30aa?_0x24d492[_0xfb5c('0x1e')]:_0x4cc0fe[_0xfb5c('0x1f')]+_0x4cc0fe[_0xfb5c('0x1d')];var _0x63a2af;if(_0x11bbda>=_0x45f905){_0x11bbda=_0x45f905;_0x63a2af=0xc8;}else{_0x63a2af=0xce;}_0x491913[_0xfb5c('0x19')](_0x63a2af);return _0x491913[_0xfb5c('0x20')]('Content-Range',_0x27d1d0+'-'+_0x11bbda+'/'+_0x45f905)[_0xfb5c('0x1b')](_0x24d492);}return null;};}function patchUpdates(_0xcb0bcc){return function(_0xbd6da5){try{jsonpatch[_0xfb5c('0x21')](_0xbd6da5,_0xcb0bcc,!![]);}catch(_0x1441c7){return BPromise[_0xfb5c('0x22')](_0x1441c7);}return _0xbd6da5[_0xfb5c('0x23')]();};}function saveUpdates(_0xee45b3,_0x2981c8){return function(_0x2f2c92){if(_0x2f2c92){return _0x2f2c92[_0xfb5c('0x24')](_0xee45b3)['then'](function(_0x516c09){return _0x516c09;});}return null;};}function removeEntity(_0x14b894,_0x1554ba){return function(_0x2c4f6d){if(_0x2c4f6d){return _0x2c4f6d[_0xfb5c('0x25')]()[_0xfb5c('0x26')](function(){_0x14b894[_0xfb5c('0x19')](0xcc)[_0xfb5c('0x1a')]();});}};}function handleEntityNotFound(_0x461849,_0x278661){return function(_0xe7eb71){if(!_0xe7eb71){_0x461849[_0xfb5c('0x18')](0x194);}return _0xe7eb71;};}function handleError(_0x2bf016,_0x197ce5){_0x197ce5=_0x197ce5||0x1f4;return function(_0x5f1288){logger[_0xfb5c('0x27')](_0x5f1288[_0xfb5c('0x28')]);if(_0x5f1288[_0xfb5c('0x29')]){delete _0x5f1288[_0xfb5c('0x29')];}_0x2bf016[_0xfb5c('0x19')](_0x197ce5)['send'](_0x5f1288);};}exports[_0xfb5c('0x2a')]=function(_0x4c90d9,_0xaacd41){var _0x3aa2c2={},_0x2108f1={},_0x4c395a={'count':0x0,'rows':[]};var _0x274add=_['map'](db[_0xfb5c('0x2b')][_0xfb5c('0x2c')],function(_0x1150e7){return{'name':_0x1150e7[_0xfb5c('0x2d')],'type':_0x1150e7[_0xfb5c('0x2e')]['key']};});_0x2108f1['model']=_[_0xfb5c('0x2f')](_0x274add,'name');_0x2108f1['query']=_['keys'](_0x4c90d9[_0xfb5c('0x30')]);_0x2108f1[_0xfb5c('0x31')]=_[_0xfb5c('0x32')](_0x2108f1[_0xfb5c('0x33')],_0x2108f1[_0xfb5c('0x30')]);_0x3aa2c2[_0xfb5c('0x34')]=_['intersection'](_0x2108f1[_0xfb5c('0x33')],qs['fields'](_0x4c90d9['query'][_0xfb5c('0x35')]));_0x3aa2c2[_0xfb5c('0x34')]=_0x3aa2c2[_0xfb5c('0x34')][_0xfb5c('0x36')]?_0x3aa2c2['attributes']:_0x2108f1['model'];if(!_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x37')](_0xfb5c('0x38'))){_0x3aa2c2['limit']=qs[_0xfb5c('0x1d')](_0x4c90d9['query'][_0xfb5c('0x1d')]);_0x3aa2c2[_0xfb5c('0x1f')]=qs['offset'](_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x1f')]);}_0x3aa2c2['order']=qs['sort'](_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x39')]);_0x3aa2c2['where']=qs[_0xfb5c('0x31')](_[_0xfb5c('0x3a')](_0x4c90d9[_0xfb5c('0x30')],_0x2108f1[_0xfb5c('0x31')]),_0x274add);if(_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x3b')]){_0x3aa2c2[_0xfb5c('0x3c')]=_[_0xfb5c('0x3d')](_0x3aa2c2[_0xfb5c('0x3c')],{'$or':_[_0xfb5c('0x2f')](_0x274add,function(_0x4bfc93){if(_0x4bfc93[_0xfb5c('0x2e')]!==_0xfb5c('0x3e')){var _0x3858aa={};_0x3858aa[_0x4bfc93[_0xfb5c('0x29')]]={'$like':'%'+_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x3b')]+'%'};return _0x3858aa;}})});}_0x3aa2c2=_['merge']({},_0x3aa2c2,_0x4c90d9['options']);var _0x7c14ea={'where':_0x3aa2c2[_0xfb5c('0x3c')]};return db['OpenchannelApplication'][_0xfb5c('0x1e')](_0x7c14ea)[_0xfb5c('0x26')](function(_0xc07ebb){_0x4c395a[_0xfb5c('0x1e')]=_0xc07ebb;if(_0x4c90d9[_0xfb5c('0x30')][_0xfb5c('0x3f')]){_0x3aa2c2[_0xfb5c('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xfb5c('0x41')](_0x3aa2c2);})[_0xfb5c('0x26')](function(_0x5ac4c3){_0x4c395a['rows']=_0x5ac4c3;return _0x4c395a;})[_0xfb5c('0x26')](respondWithFilteredResult(_0xaacd41,_0x3aa2c2))['catch'](handleError(_0xaacd41,null));};exports[_0xfb5c('0x42')]=function(_0x1e33fb,_0x5212f7){var _0x83ce86={'raw':!![],'where':{'id':_0x1e33fb[_0xfb5c('0x43')]['id']}},_0x36bb7e={};_0x36bb7e[_0xfb5c('0x33')]=_[_0xfb5c('0x44')](db[_0xfb5c('0x2b')][_0xfb5c('0x2c')]);_0x36bb7e['query']=_[_0xfb5c('0x44')](_0x1e33fb[_0xfb5c('0x30')]);_0x36bb7e[_0xfb5c('0x31')]=_[_0xfb5c('0x32')](_0x36bb7e[_0xfb5c('0x33')],_0x36bb7e['query']);_0x83ce86[_0xfb5c('0x34')]=_[_0xfb5c('0x32')](_0x36bb7e[_0xfb5c('0x33')],qs['fields'](_0x1e33fb[_0xfb5c('0x30')][_0xfb5c('0x35')]));_0x83ce86['attributes']=_0x83ce86[_0xfb5c('0x34')][_0xfb5c('0x36')]?_0x83ce86[_0xfb5c('0x34')]:_0x36bb7e[_0xfb5c('0x33')];if(_0x1e33fb[_0xfb5c('0x30')][_0xfb5c('0x3f')]){_0x83ce86[_0xfb5c('0x40')]=[{'all':!![]}];}_0x83ce86=_[_0xfb5c('0x3d')]({},_0x83ce86,_0x1e33fb[_0xfb5c('0x45')]);return db[_0xfb5c('0x2b')][_0xfb5c('0x46')](_0x83ce86)[_0xfb5c('0x26')](handleEntityNotFound(_0x5212f7,null))['then'](respondWithResult(_0x5212f7,null))[_0xfb5c('0x47')](handleError(_0x5212f7,null));};exports[_0xfb5c('0x48')]=function(_0x426565,_0x3f4996){return db[_0xfb5c('0x2b')][_0xfb5c('0x48')](_0x426565[_0xfb5c('0x49')],{})['then'](respondWithResult(_0x3f4996,0xc9))['catch'](handleError(_0x3f4996,null));};exports[_0xfb5c('0x24')]=function(_0x1461de,_0x30140a){if(_0x1461de[_0xfb5c('0x49')]['id']){delete _0x1461de[_0xfb5c('0x49')]['id'];}return db[_0xfb5c('0x2b')][_0xfb5c('0x46')]({'where':{'id':_0x1461de[_0xfb5c('0x43')]['id']}})[_0xfb5c('0x26')](handleEntityNotFound(_0x30140a,null))[_0xfb5c('0x26')](saveUpdates(_0x1461de[_0xfb5c('0x49')],null))[_0xfb5c('0x26')](respondWithResult(_0x30140a,null))[_0xfb5c('0x47')](handleError(_0x30140a,null));};exports[_0xfb5c('0x25')]=function(_0x1c339e,_0x1c0c7c){return db[_0xfb5c('0x2b')][_0xfb5c('0x46')]({'where':{'id':_0x1c339e[_0xfb5c('0x43')]['id']}})[_0xfb5c('0x26')](handleEntityNotFound(_0x1c0c7c,null))['then'](removeEntity(_0x1c0c7c,null))[_0xfb5c('0x47')](handleError(_0x1c0c7c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 3e52bbc..72c9f39 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 _0xfec9=['rimraf','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x348c72,_0x3e32b3){var _0x4fb90d=function(_0x47eeab){while(--_0x47eeab){_0x348c72['push'](_0x348c72['shift']());}};_0x4fb90d(++_0x3e32b3);}(_0xfec9,0x1b3));var _0x9fec=function(_0x4d65c2,_0x2d2156){_0x4d65c2=_0x4d65c2-0x0;var _0x1fbbcd=_0xfec9[_0x4d65c2];return _0x1fbbcd;};'use strict';var _=require(_0x9fec('0x0'));var util=require(_0x9fec('0x1'));var logger=require('../../config/logger')(_0x9fec('0x2'));var moment=require(_0x9fec('0x3'));var BPromise=require(_0x9fec('0x4'));var rp=require(_0x9fec('0x5'));var fs=require('fs');var path=require(_0x9fec('0x6'));var rimraf=require(_0x9fec('0x7'));var config=require('../../config/environment');var attributes=require(_0x9fec('0x8'));module['exports']=function(_0x4a7e36,_0x193526){return _0x4a7e36[_0x9fec('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x9fec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9fec('0xb'),'collate':_0x9fec('0xc')});}; \ No newline at end of file +var _0x37a5=['./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37a5,0x157));var _0x537a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x37a5[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x537a('0x0'))(_0x537a('0x1'));var moment=require(_0x537a('0x2'));var BPromise=require(_0x537a('0x3'));var rp=require(_0x537a('0x4'));var fs=require('fs');var path=require(_0x537a('0x5'));var rimraf=require(_0x537a('0x6'));var config=require(_0x537a('0x7'));var attributes=require(_0x537a('0x8'));module[_0x537a('0x9')]=function(_0x80ff26,_0x56c82e){return _0x80ff26['define'](_0x537a('0xa'),attributes,{'tableName':_0x537a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x537a('0xc'),'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 9d1c6c7..eca61fc 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 _0x659c=['stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x659c,0x15e));var _0xc659=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0x659c[_0x65c597];return _0x1ec368;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var moment=require(_0xc659('0x1'));var BPromise=require('bluebird');var rs=require(_0xc659('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc659('0x3'))['db'];var utils=require(_0xc659('0x4'));var logger=require('../../config/logger')(_0xc659('0x5'));var config=require(_0xc659('0x6'));var jayson=require(_0xc659('0x7'));var client=jayson['client'][_0xc659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xedb8da,_0x44f592,_0x1ade45){return new BPromise(function(_0x4c5bba,_0x1d8147){return client[_0xc659('0x9')](_0xedb8da,_0x1ade45)['then'](function(_0x2d93ab){logger[_0xc659('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x44f592,'request\x20sent');logger[_0xc659('0xb')](_0xc659('0xc'),_0x44f592,_0xc659('0xd'),JSON[_0xc659('0xe')](_0x2d93ab));if(_0x2d93ab[_0xc659('0xf')]){if(_0x2d93ab[_0xc659('0xf')]['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x44f592,_0x2d93ab[_0xc659('0xf')]['message']);return _0x1d8147(_0x2d93ab[_0xc659('0xf')]['message']);}logger['error'](_0xc659('0x10'),_0x44f592,_0x2d93ab[_0xc659('0xf')][_0xc659('0x11')]);return _0x4c5bba(_0x2d93ab[_0xc659('0xf')][_0xc659('0x11')]);}else{logger[_0xc659('0xa')](_0xc659('0x10'),_0x44f592,_0xc659('0xd'));_0x4c5bba(_0x2d93ab[_0xc659('0x12')][_0xc659('0x11')]);}})['catch'](function(_0x30e681){logger[_0xc659('0xf')](_0xc659('0x10'),_0x44f592,_0x30e681);_0x1d8147(_0x30e681);});});}exports[_0xc659('0x13')]=function(_0xa219eb){var _0x9e603d=this;return new Promise(function(_0x3a4147,_0x1cc2e2){return db[_0xc659('0x14')]['update'](_0xa219eb[_0xc659('0x15')],{'raw':_0xa219eb[_0xc659('0x16')]?_0xa219eb[_0xc659('0x16')][_0xc659('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa219eb[_0xc659('0x16')]?_0xa219eb[_0xc659('0x16')][_0xc659('0x18')]||null:null,'attributes':_0xa219eb['options']?_0xa219eb['options']['attributes']||null:null,'limit':_0xa219eb[_0xc659('0x16')]?_0xa219eb[_0xc659('0x16')]['limit']||null:null})['then'](function(_0x22c0d4){logger[_0xc659('0xa')]('UpdateOpenchannelApplication',_0xa219eb);logger[_0xc659('0xb')]('UpdateOpenchannelApplication',_0xa219eb,JSON['stringify'](_0x22c0d4));_0x3a4147(_0x22c0d4);})[_0xc659('0x19')](function(_0x1d46ba){logger['error'](_0xc659('0x13'),_0x1d46ba['message'],_0xa219eb);_0x1cc2e2(_0x9e603d[_0xc659('0xf')](0x1f4,_0x1d46ba[_0xc659('0x11')]));});});}; \ No newline at end of file +var _0x4462=['error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','attributes','limit','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x4462,0x1dc));var _0x2446=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x4462[_0x1f3aec];return _0x409f0d;};'use strict';var _=require('lodash');var util=require(_0x2446('0x0'));var moment=require(_0x2446('0x1'));var BPromise=require('bluebird');var rs=require(_0x2446('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2446('0x3'))['db'];var utils=require(_0x2446('0x4'));var logger=require(_0x2446('0x5'))(_0x2446('0x6'));var config=require(_0x2446('0x7'));var jayson=require(_0x2446('0x8'));var client=jayson[_0x2446('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6e1db,_0x453614,_0xb8f245){return new BPromise(function(_0x5f45e0,_0x3b0f03){return client[_0x2446('0xa')](_0xa6e1db,_0xb8f245)[_0x2446('0xb')](function(_0x138f49){logger[_0x2446('0xc')](_0x2446('0xd'),_0x453614,'request\x20sent');logger[_0x2446('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x453614,_0x2446('0xf'),JSON[_0x2446('0x10')](_0x138f49));if(_0x138f49[_0x2446('0x11')]){if(_0x138f49[_0x2446('0x11')][_0x2446('0x12')]===0x1f4){logger['error'](_0x2446('0xd'),_0x453614,_0x138f49['error']['message']);return _0x3b0f03(_0x138f49[_0x2446('0x11')][_0x2446('0x13')]);}logger[_0x2446('0x11')](_0x2446('0xd'),_0x453614,_0x138f49[_0x2446('0x11')][_0x2446('0x13')]);return _0x5f45e0(_0x138f49[_0x2446('0x11')]['message']);}else{logger[_0x2446('0xc')](_0x2446('0xd'),_0x453614,_0x2446('0xf'));_0x5f45e0(_0x138f49[_0x2446('0x14')][_0x2446('0x13')]);}})['catch'](function(_0x1765a2){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x453614,_0x1765a2);_0x3b0f03(_0x1765a2);});});}exports[_0x2446('0x15')]=function(_0x18cdb0){var _0x5dfca9=this;return new Promise(function(_0x5f09c6,_0x48df6d){return db[_0x2446('0x16')][_0x2446('0x17')](_0x18cdb0[_0x2446('0x18')],{'raw':_0x18cdb0[_0x2446('0x19')]?_0x18cdb0[_0x2446('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18cdb0[_0x2446('0x19')]?_0x18cdb0['options']['where']||null:null,'attributes':_0x18cdb0['options']?_0x18cdb0['options'][_0x2446('0x1a')]||null:null,'limit':_0x18cdb0[_0x2446('0x19')]?_0x18cdb0[_0x2446('0x19')][_0x2446('0x1b')]||null:null})[_0x2446('0xb')](function(_0x4edf61){logger[_0x2446('0xc')]('UpdateOpenchannelApplication',_0x18cdb0);logger['debug'](_0x2446('0x15'),_0x18cdb0,JSON[_0x2446('0x10')](_0x4edf61));_0x5f09c6(_0x4edf61);})[_0x2446('0x1c')](function(_0x5922ca){logger[_0x2446('0x11')](_0x2446('0x15'),_0x5922ca['message'],_0x18cdb0);_0x48df6d(_0x5dfca9[_0x2446('0x11')](0x1f4,_0x5922ca[_0x2446('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 034165b..eb3d15c 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 _0x99ac=['tracked','openchannel','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags'];(function(_0x574b7f,_0x5a758e){var _0x3da1af=function(_0x4b382e){while(--_0x4b382e){_0x574b7f['push'](_0x574b7f['shift']());}};_0x3da1af(++_0x5a758e);}(_0x99ac,0x1c5));var _0xc99a=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x99ac[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0xc99a('0x0'));var util=require(_0xc99a('0x1'));var path=require('path');var timeout=require(_0xc99a('0x2'));var express=require(_0xc99a('0x3'));var router=express[_0xc99a('0x4')]();var fs_extra=require(_0xc99a('0x5'));var auth=require(_0xc99a('0x6'));var interaction=require(_0xc99a('0x7'));var config=require(_0xc99a('0x8'));var controller=require(_0xc99a('0x9'));router[_0xc99a('0xa')]('/',auth[_0xc99a('0xb')](),controller[_0xc99a('0xc')]);router['get'](_0xc99a('0xd'),auth['isAuthenticated'](),controller[_0xc99a('0xe')]);router[_0xc99a('0xa')](_0xc99a('0xf'),auth[_0xc99a('0xb')](),controller[_0xc99a('0x10')]);router[_0xc99a('0xa')](_0xc99a('0x11'),auth[_0xc99a('0xb')](),controller[_0xc99a('0x12')]);router['get']('/:id/download',auth[_0xc99a('0xb')](),controller['download']);router[_0xc99a('0x13')]('/',auth['isAuthenticated'](),controller[_0xc99a('0x14')]);router[_0xc99a('0x13')](_0xc99a('0x11'),auth[_0xc99a('0xb')](),controller[_0xc99a('0x15')]);router['post'](_0xc99a('0x16'),auth[_0xc99a('0xb')](),interaction[_0xc99a('0x17')](_0xc99a('0x18'),'openchannelinteraction:addtags'),controller[_0xc99a('0x19')]);router[_0xc99a('0x1a')](_0xc99a('0xf'),auth[_0xc99a('0xb')](),interaction[_0xc99a('0x17')](_0xc99a('0x18'),_0xc99a('0x1b')),controller[_0xc99a('0x1c')]);router['delete'](_0xc99a('0xf'),auth[_0xc99a('0xb')](),interaction['tracked'](_0xc99a('0x18'),_0xc99a('0x1d')),controller[_0xc99a('0x1e')]);router[_0xc99a('0x1f')](_0xc99a('0x16'),auth[_0xc99a('0xb')](),controller[_0xc99a('0x20')]);module[_0xc99a('0x21')]=router; \ No newline at end of file +var _0x7cae=['openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x7cae,0x1c2));var _0xe7ca=function(_0x3b2f74,_0x2b843c){_0x3b2f74=_0x3b2f74-0x0;var _0x134bd8=_0x7cae[_0x3b2f74];return _0x134bd8;};'use strict';var multer=require(_0xe7ca('0x0'));var util=require(_0xe7ca('0x1'));var path=require(_0xe7ca('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7ca('0x3'));var router=express[_0xe7ca('0x4')]();var fs_extra=require(_0xe7ca('0x5'));var auth=require(_0xe7ca('0x6'));var interaction=require(_0xe7ca('0x7'));var config=require(_0xe7ca('0x8'));var controller=require(_0xe7ca('0x9'));router[_0xe7ca('0xa')]('/',auth['isAuthenticated'](),controller[_0xe7ca('0xb')]);router[_0xe7ca('0xa')](_0xe7ca('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xe7ca('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe7ca('0xa')]('/:id/messages',auth[_0xe7ca('0xd')](),controller[_0xe7ca('0xe')]);router[_0xe7ca('0xa')](_0xe7ca('0xf'),auth[_0xe7ca('0xd')](),controller[_0xe7ca('0x10')]);router[_0xe7ca('0x11')]('/',auth[_0xe7ca('0xd')](),controller['create']);router[_0xe7ca('0x11')](_0xe7ca('0x12'),auth[_0xe7ca('0xd')](),controller[_0xe7ca('0x13')]);router[_0xe7ca('0x11')](_0xe7ca('0x14'),auth['isAuthenticated'](),interaction[_0xe7ca('0x15')]('openchannel',_0xe7ca('0x16')),controller[_0xe7ca('0x17')]);router[_0xe7ca('0x18')](_0xe7ca('0x19'),auth[_0xe7ca('0xd')](),interaction[_0xe7ca('0x15')](_0xe7ca('0x1a'),_0xe7ca('0x1b')),controller[_0xe7ca('0x1c')]);router[_0xe7ca('0x1d')](_0xe7ca('0x19'),auth[_0xe7ca('0xd')](),interaction['tracked']('openchannel',_0xe7ca('0x1e')),controller[_0xe7ca('0x1f')]);router[_0xe7ca('0x1d')](_0xe7ca('0x14'),auth['isAuthenticated'](),controller[_0xe7ca('0x20')]);module[_0xe7ca('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 92380f0..f6fd4ba 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 _0x07b9=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2edb80,_0x5658fb){var _0x11446a=function(_0x4d05c9){while(--_0x4d05c9){_0x2edb80['push'](_0x2edb80['shift']());}};_0x11446a(++_0x5658fb);}(_0x07b9,0x143));var _0x907b=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x07b9[_0x310504];return _0x5b36d0;};'use strict';var Sequelize=require(_0x907b('0x0'));module[_0x907b('0x1')]={'closed':{'type':Sequelize[_0x907b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x907b('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x907b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x907b('0x4')]},'read1stAt':{'type':Sequelize[_0x907b('0x3')]},'threadId':{'type':Sequelize[_0x907b('0x4')]},'externalUrl':{'type':Sequelize[_0x907b('0x4')]},'lastMsgAt':{'type':Sequelize[_0x907b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x907b('0x5')]('in',_0x907b('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x907b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0d0b=['exports','DATE','STRING','ENUM','BOOLEAN'];(function(_0x158139,_0x2c49d1){var _0x394ad0=function(_0x5f19b4){while(--_0x5f19b4){_0x158139['push'](_0x158139['shift']());}};_0x394ad0(++_0x2c49d1);}(_0x0d0b,0x1ef));var _0xb0d0=function(_0x38dcac,_0x970d3){_0x38dcac=_0x38dcac-0x0;var _0x42e616=_0x0d0b[_0x38dcac];return _0x42e616;};'use strict';var Sequelize=require('sequelize');module[_0xb0d0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb0d0('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb0d0('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb0d0('0x2')]},'note':{'type':Sequelize[_0xb0d0('0x2')]},'read1stAt':{'type':Sequelize[_0xb0d0('0x1')]},'threadId':{'type':Sequelize[_0xb0d0('0x2')]},'externalUrl':{'type':Sequelize[_0xb0d0('0x2')]},'lastMsgAt':{'type':Sequelize[_0xb0d0('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb0d0('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb0d0('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xb0d0('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index aa33863..cf984a1 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 _0x94ac=['limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','Users','map','Tags','TagIds','split','push','catch','talking','answered','UserId','waiting','closed','unmanaged','total','index','OpenchannelInteraction','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','from','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','includeAll','include','options','create','body','params','describe','addMessage','OpenchannelMessage','ids','omit','findOne','nolimit','sort','format','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','fullname','firstName','Attachment','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Private','Messages','basename','pipe','createWriteStream','direction','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset'];(function(_0x595485,_0x58ce3b){var _0x594c96=function(_0x44d05a){while(--_0x44d05a){_0x595485['push'](_0x595485['shift']());}};_0x594c96(++_0x58ce3b);}(_0x94ac,0x1d1));var _0xc94a=function(_0x4b7ec6,_0x3180d9){_0x4b7ec6=_0x4b7ec6-0x0;var _0x4f3c3e=_0x94ac[_0x4b7ec6];return _0x4f3c3e;};'use strict';var emlformat=require(_0xc94a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc94a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc94a('0x2'));var BPromise=require(_0xc94a('0x3'));var Mustache=require('mustache');var util=require(_0xc94a('0x4'));var path=require(_0xc94a('0x5'));var sox=require(_0xc94a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc94a('0x7'));var _=require(_0xc94a('0x8'));var squel=require(_0xc94a('0x9'));var crypto=require(_0xc94a('0xa'));var jsforce=require(_0xc94a('0xb'));var deskjs=require(_0xc94a('0xc'));var toCsv=require(_0xc94a('0xd'));var querystring=require(_0xc94a('0xe'));var Papa=require(_0xc94a('0xf'));var Redis=require('ioredis');var authService=require(_0xc94a('0x10'));var qs=require(_0xc94a('0x11'));var as=require(_0xc94a('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xc94a('0x13'));var logger=require(_0xc94a('0x14'))('api');var utils=require(_0xc94a('0x15'));var config=require(_0xc94a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc94a('0x17'))['db'];config[_0xc94a('0x18')]=_[_0xc94a('0x19')](config[_0xc94a('0x18')],{'host':_0xc94a('0x1a'),'port':0x18eb});var socket=require(_0xc94a('0x1b'))(new Redis(config[_0xc94a('0x18')]));require(_0xc94a('0x1c'))[_0xc94a('0x1d')](socket);function respondWithStatusCode(_0x23378b,_0x4b12a6){_0x4b12a6=_0x4b12a6||0xcc;return function(_0xfaa53c){if(_0xfaa53c){return _0x23378b[_0xc94a('0x1e')](_0x4b12a6);}return _0x23378b[_0xc94a('0x1f')](_0x4b12a6)[_0xc94a('0x20')]();};}function respondWithResult(_0x3b617a,_0x37e41e){_0x37e41e=_0x37e41e||0xc8;return function(_0x59ff39){if(_0x59ff39){return _0x3b617a[_0xc94a('0x1f')](_0x37e41e)[_0xc94a('0x21')](_0x59ff39);}};}function respondWithFilteredResult(_0x37ea5e,_0x1619b3){return function(_0x2dd2fe){if(_0x2dd2fe){var _0x18bcf7=typeof _0x1619b3[_0xc94a('0x22')]==='undefined'&&typeof _0x1619b3[_0xc94a('0x23')]===_0xc94a('0x24');var _0xb48e55=_0x2dd2fe[_0xc94a('0x25')];var _0x395258=_0x18bcf7?0x0:_0x1619b3[_0xc94a('0x22')];var _0x472cbf=_0x18bcf7?_0x2dd2fe[_0xc94a('0x25')]:_0x1619b3[_0xc94a('0x22')]+_0x1619b3[_0xc94a('0x23')];var _0x440414;if(_0x472cbf>=_0xb48e55){_0x472cbf=_0xb48e55;_0x440414=0xc8;}else{_0x440414=0xce;}_0x37ea5e[_0xc94a('0x1f')](_0x440414);return _0x37ea5e[_0xc94a('0x26')](_0xc94a('0x27'),_0x395258+'-'+_0x472cbf+'/'+_0xb48e55)[_0xc94a('0x21')](_0x2dd2fe);}return null;};}function patchUpdates(_0x4062bc){return function(_0x2fd5e0){try{jsonpatch[_0xc94a('0x28')](_0x2fd5e0,_0x4062bc,!![]);}catch(_0x489aac){return BPromise[_0xc94a('0x29')](_0x489aac);}return _0x2fd5e0['save']();};}function saveUpdates(_0x567c81,_0x2f88d5){return function(_0x53eae1){if(_0x53eae1){return _0x53eae1[_0xc94a('0x2a')](_0x567c81)[_0xc94a('0x2b')](function(_0x8b0eb5){return _0x8b0eb5;});}return null;};}function removeEntity(_0x3030fa,_0x3ef014){return function(_0xfb0864){if(_0xfb0864){return _0xfb0864['destroy']()['then'](function(){_0x3030fa[_0xc94a('0x1f')](0xcc)[_0xc94a('0x20')]();});}};}function handleEntityNotFound(_0x574296,_0x5c6d0e){return function(_0x3e2ed2){if(!_0x3e2ed2){_0x574296['sendStatus'](0x194);}return _0x3e2ed2;};}function handleError(_0x575009,_0x42c2db){_0x42c2db=_0x42c2db||0x1f4;return function(_0x176ae0){logger[_0xc94a('0x2c')](_0x176ae0[_0xc94a('0x2d')]);if(_0x176ae0[_0xc94a('0x2e')]){delete _0x176ae0['name'];}_0x575009[_0xc94a('0x1f')](_0x42c2db)[_0xc94a('0x2f')](_0x176ae0);};}function getInteractionUsers(_0x4b9fdc,_0x1bf3c1){return new BPromise(function(_0xd671df,_0x28e158){try{if(_0x1bf3c1[_0x4b9fdc['id']]){_0x4b9fdc[_0xc94a('0x30')]=_[_0xc94a('0x31')](_0x1bf3c1[_0x4b9fdc['id']],function(_0xee3c84){return{'id':_0xee3c84['id'],'fullname':_0xee3c84['fullname']};});}}catch(_0xbe718b){_0x28e158(_0xbe718b);}_0xd671df(_0x4b9fdc);});}function getInteractionTags(_0x2b17ff,_0x261569){return new BPromise(function(_0x5df013,_0x309d7b){try{if(_0x2b17ff['TagIds']){_0x2b17ff[_0xc94a('0x32')]=[];_0x2b17ff[_0xc94a('0x33')][_0xc94a('0x34')](',')['forEach'](function(_0x56a1c8){_0x2b17ff[_0xc94a('0x32')][_0xc94a('0x35')](_0x261569[_0x56a1c8]);});}delete _0x2b17ff[_0xc94a('0x33')];}catch(_0x82fe6b){_0x309d7b(_0x82fe6b);}_0x5df013(_0x2b17ff);});}function updateOpenchannelInteraction(_0x371eef,_0x447fcd,_0x2be8c5){return new BPromise(function(_0xf8708e,_0x4af471){return getInteractionUsers(_0x371eef,_0x2be8c5)[_0xc94a('0x2b')](function(_0x522ba4){return getInteractionTags(_0x522ba4,_0x447fcd);})[_0xc94a('0x2b')](function(_0x133be2){return getStateInteraction(_0x133be2);})[_0xc94a('0x2b')](function(_0x483301){_0xf8708e(_0x483301);})[_0xc94a('0x36')](function(_0x38364d){_0x4af471(_0x38364d);});});}function getStateInteraction(_0x475269){return new BPromise(function(_0xd255ad){_0x475269['waiting']=0x0;_0x475269[_0xc94a('0x37')]=0x0;_0x475269[_0xc94a('0x38')]=0x0;_0x475269['unmanaged']=0x0;_0x475269['total']=0x0;if(!_0x475269['closed']&&!_0x475269[_0xc94a('0x39')]){_0x475269[_0xc94a('0x3a')]+=0x1;}if(!_0x475269['closed']&&_0x475269['UserId']){_0x475269[_0xc94a('0x37')]+=0x1;if(_0x475269[_0xc94a('0x3a')]){_0x475269['waiting']-=0x1;}}if(_0x475269[_0xc94a('0x3b')]&&_0x475269[_0xc94a('0x39')]){_0x475269[_0xc94a('0x38')]+=0x1;if(_0x475269[_0xc94a('0x37')]){_0x475269[_0xc94a('0x37')]-=0x1;}}if(_0x475269['closed']&&!_0x475269[_0xc94a('0x39')]){_0x475269[_0xc94a('0x3c')]+=0x1;if(_0x475269[_0xc94a('0x3a')]){_0x475269[_0xc94a('0x3a')]-=0x1;}}_0x475269[_0xc94a('0x3d')]+=0x1;_0xd255ad(_0x475269);});}exports[_0xc94a('0x3e')]=function(_0x4b2900,_0x359d77){var _0x54bfe6={},_0x4352c3={},_0x50dc53={'count':0x0,'rows':[]};var _0x518c99=_[_0xc94a('0x31')](db[_0xc94a('0x3f')][_0xc94a('0x40')],function(_0x249549){return{'name':_0x249549[_0xc94a('0x41')],'type':_0x249549[_0xc94a('0x42')]['key']};});_0x4352c3[_0xc94a('0x43')]=_[_0xc94a('0x31')](_0x518c99,_0xc94a('0x2e'));_0x4352c3['query']=_[_0xc94a('0x44')](_0x4b2900[_0xc94a('0x45')]);_0x4352c3[_0xc94a('0x46')]=_[_0xc94a('0x47')](_0x4352c3[_0xc94a('0x43')],_0x4352c3[_0xc94a('0x45')]);_0x54bfe6[_0xc94a('0x48')]=_[_0xc94a('0x47')](_0x4352c3['model'],qs[_0xc94a('0x49')](_0x4b2900[_0xc94a('0x45')][_0xc94a('0x49')]));_0x54bfe6[_0xc94a('0x48')]=_0x54bfe6[_0xc94a('0x48')]['length']?_0x54bfe6[_0xc94a('0x48')]:_0x4352c3[_0xc94a('0x43')];if(!_0x4b2900['query'][_0xc94a('0x4a')]('nolimit')){_0x54bfe6[_0xc94a('0x23')]=qs[_0xc94a('0x23')](_0x4b2900[_0xc94a('0x45')][_0xc94a('0x23')]);_0x54bfe6[_0xc94a('0x22')]=qs[_0xc94a('0x22')](_0x4b2900[_0xc94a('0x45')][_0xc94a('0x22')]);}_0x54bfe6[_0xc94a('0x4b')]=qs['sort'](_0x4b2900['query']['sort']);_0x54bfe6[_0xc94a('0x4c')]=qs[_0xc94a('0x46')](_['pick'](_0x4b2900[_0xc94a('0x45')],_0x4352c3['filters']),_0x518c99);var _0xcdc55d=[];var _0x530252=squel[_0xc94a('0x4d')]()[_0xc94a('0x4e')]('id')[_0xc94a('0x4e')]('name')[_0xc94a('0x4e')](_0xc94a('0x4f'))['from'](_0xc94a('0x50'));var _0x81f335=squel[_0xc94a('0x4d')]()[_0xc94a('0x4e')](_0xc94a('0x51'))[_0xc94a('0x4e')](_0xc94a('0x52'))[_0xc94a('0x4e')](_0xc94a('0x53'))['from'](_0xc94a('0x54'),'ui')[_0xc94a('0x55')]('users','u',_0xc94a('0x56'));var _0x29db55=squel[_0xc94a('0x4d')]()[_0xc94a('0x57')](_0xc94a('0x58'),'i')[_0xc94a('0x55')](_0xc94a('0x59'),'c',_0xc94a('0x5a'))['left_join'](_0xc94a('0x5b'),'o',_0xc94a('0x5c'))[_0xc94a('0x55')]('openchannel_accounts','a',_0xc94a('0x5d'))[_0xc94a('0x55')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xc94a('0x55')](_0xc94a('0x5e'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xc94a('0x5f'));var _0x457dfc=squel[_0xc94a('0x60')]();var _0x592da0=[];var _0x365abc=squel[_0xc94a('0x60')]();var _0x44ea17;if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x61')]){_0x44ea17=as['parseSearch'](_0x4b2900[_0xc94a('0x45')][_0xc94a('0x61')]);var _0x5e5543=_0x44ea17[_0xc94a('0x62')];for(var _0xb64b28=0x0;_0xb64b28<_0x44ea17[_0xc94a('0x63')][_0xc94a('0x64')];_0xb64b28++){var _0x5cc3c1=_0x44ea17[_0xc94a('0x63')][_0xb64b28];var _0x1cc342='i';var _0x44cb88=_[_0xc94a('0x65')](_0x518c99,[_0xc94a('0x2e'),_0x5cc3c1[_0xc94a('0x4e')]]);if(!_0x44cb88){switch(_0x5cc3c1['field']){case _0xc94a('0x66'):if(_0x5cc3c1[_0xc94a('0x67')]==0x1){_0x29db55[_0xc94a('0x68')]('`'+_0x5cc3c1['field']+_0xc94a('0x69'));}else{_0x29db55[_0xc94a('0x68')]('`'+_0x5cc3c1[_0xc94a('0x4e')]+_0xc94a('0x6a'));}break;case _0xc94a('0x6b'):if(_0x5cc3c1[_0xc94a('0x6c')]==='$substring'){if(_0x5cc3c1[_0xc94a('0x67')]['split']('\x20')[_0xc94a('0x64')]>0x1){_0x457dfc[_0x5e5543](_0xc94a('0x6d'),qs[_0xc94a('0x6e')](_0x5cc3c1[_0xc94a('0x67')]),null);}else{var _0x22c6cd='%'+_0x5cc3c1[_0xc94a('0x67')]+'%';_0x457dfc[_0x5e5543]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x22c6cd,_0x22c6cd,_0x22c6cd);}}else{_0x44cb88=_[_0xc94a('0x65')](_0x518c99,[_0xc94a('0x2e'),_0xc94a('0x6f')]);_0x5cc3c1['field']='ContactId';_0x3d452a=as[_0xc94a('0x70')](_0x1cc342,_0x44cb88['type'],_0x5cc3c1);_0x457dfc[_0x5e5543](_0x3d452a[_0xc94a('0x71')],_0x3d452a[_0xc94a('0x67')][_0xc94a('0x72')],_0x3d452a[_0xc94a('0x67')]['end']);}break;case _0xc94a('0x73'):var _0x21bc78=_0x5cc3c1[_0xc94a('0x67')]['split'](',')['map'](function(_0x34ad3b){return Number(_0x34ad3b);});_0x21bc78[_0xc94a('0x74')](function(_0x58ba1b){_0x365abc['or'](_0xc94a('0x75'),'%,'+_0x58ba1b+',%');});_0x592da0=_[_0xc94a('0x76')](_0x592da0,_0x21bc78);break;case _0xc94a('0x77'):if(_0x5cc3c1[_0xc94a('0x6c')]===_0xc94a('0x78')){_0x457dfc[_0x5e5543](_0xc94a('0x79'),'%'+_0x5cc3c1[_0xc94a('0x67')]+'%',null);}else{_0x44cb88=_[_0xc94a('0x65')](_0x518c99,[_0xc94a('0x2e'),'UserId']);_0x5cc3c1[_0xc94a('0x4e')]='UserId';_0x3d452a=as['buildExpression'](_0x1cc342,_0x44cb88[_0xc94a('0x42')],_0x5cc3c1);_0x457dfc[_0x5e5543](_0x3d452a[_0xc94a('0x71')],_0x3d452a[_0xc94a('0x67')]['start'],_0x3d452a[_0xc94a('0x67')]['end']);}break;case'body':_0x3d452a=as[_0xc94a('0x70')]('me',null,_0x5cc3c1);_0x457dfc[_0x5e5543](_0x3d452a[_0xc94a('0x71')],_0x3d452a[_0xc94a('0x67')][_0xc94a('0x72')],_0x3d452a[_0xc94a('0x67')]['end']);break;}}else{var _0x3d452a=as[_0xc94a('0x70')](_0x1cc342,_0x44cb88[_0xc94a('0x42')],_0x5cc3c1);_0x457dfc[_0x5e5543](_0x3d452a[_0xc94a('0x71')],_0x3d452a[_0xc94a('0x67')]['start'],_0x3d452a[_0xc94a('0x67')]['end']);}}}else{var _0x2ff198=_(_0x4b2900[_0xc94a('0x45')])[_0xc94a('0x44')]()[_0xc94a('0x31')](function(_0x3ad09d){return _[_0xc94a('0x7a')](_0x518c99,[_0xc94a('0x2e'),_0x3ad09d])?_0x3ad09d:undefined;})[_0xc94a('0x7b')]()[_0xc94a('0x67')]();if(!_['isEmpty'](_0x2ff198)){_0x2ff198[_0xc94a('0x74')](function(_0x276029){if(_0x276029===_0xc94a('0x7c')){_0x29db55[_0xc94a('0x4c')](_0xc94a('0x7d'),[][_0xc94a('0x7e')](_0x4b2900[_0xc94a('0x45')][_0x276029]));}else if(_0x276029===_0xc94a('0x7f')){var _0x3d2e25=JSON[_0xc94a('0x80')](_0x4b2900[_0xc94a('0x45')][_0x276029])[_0xc94a('0x81')];var _0x4aa736=JSON[_0xc94a('0x80')](_0x4b2900[_0xc94a('0x45')][_0x276029])[_0xc94a('0x82')];_0x29db55[_0xc94a('0x4c')](_0xc94a('0x83'),_0x3d2e25,_0x4aa736);}else{if(_0x4b2900['query'][_0x276029]===_0xc94a('0x84')){_0x29db55['where']('i.'+_0x276029+_0xc94a('0x85'));}else{_0x29db55[_0xc94a('0x4c')]('i.'+_0x276029+_0xc94a('0x86'),_0x4b2900['query'][_0x276029]);}}});}if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x87')]){if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x87')]==0x1){_0x29db55[_0xc94a('0x68')]('`unreadMessages`\x20=\x200');}else{_0x29db55[_0xc94a('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x88')]){_0x592da0=_[_0xc94a('0x89')](_0x4b2900[_0xc94a('0x45')][_0xc94a('0x88')])?_0x4b2900[_0xc94a('0x45')][_0xc94a('0x88')]:new Array(_0x4b2900[_0xc94a('0x45')]['tag']);_0x592da0['forEach'](function(_0x2f2c08){_0x365abc['or'](_0xc94a('0x75'),'%,'+_0x2f2c08+',%');});}if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x8a')]){var _0x90e1a6=_0x4b2900[_0xc94a('0x45')][_0xc94a('0x8a')][_0xc94a('0x8b')]('\x5c','\x5c\x5c')[_0xc94a('0x8b')](/'/g,'\x27\x27');if(qs[_0xc94a('0x8c')](_0x90e1a6)){_0x457dfc['or'](_0xc94a('0x8d'),_0x90e1a6+'%');}else{_0x457dfc['or'](_0xc94a('0x8e'),qs[_0xc94a('0x6e')](_0x90e1a6))['or']('i.from\x20LIKE\x20?',_0x90e1a6+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x90e1a6+'%');}}}_0x29db55[_0xc94a('0x4c')](_0x457dfc);_0x29db55[_0xc94a('0x8f')]('i.id');var _0x156561={'type':db[_0xc94a('0x90')][_0xc94a('0x91')]['SELECT'],'raw':!![]};var _0x17ed8b=_0x29db55[_0xc94a('0x92')]();_0x17ed8b[_0xc94a('0x4e')]('i.id');_0x17ed8b[_0xc94a('0x4e')](_0xc94a('0x93'),_0xc94a('0x66'));if(_0x54bfe6[_0xc94a('0x4b')]){_0x54bfe6[_0xc94a('0x4b')][_0xc94a('0x74')](function(_0xe774fe){var _0x3d797d=_0xe774fe[0x0]===_0xc94a('0x94')?_0xe774fe[0x0]:'i.'+_0xe774fe[0x0];_0x29db55['order'](_0x3d797d,_0xe774fe[0x1]===_0xc94a('0x95')?![]:!![]);});}if(!_[_0xc94a('0x96')](_0x592da0)){_0x29db55[_0xc94a('0x68')](_0x365abc);_0x17ed8b['where'](_0xc94a('0x97'),_0x592da0);}BPromise[_0xc94a('0x98')]()['then'](function(){if(!_0x44ea17){if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x7c')])return;_0x17ed8b[_0xc94a('0x4c')](_0xc94a('0x99'));_0x29db55[_0xc94a('0x4c')](_0xc94a('0x99'));return;}if(_0x4b2900['user'][_0xc94a('0x9a')]!==_0xc94a('0x9b'))return;return _0x4b2900[_0xc94a('0x9c')][_0xc94a('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4f2d8b){if(_['isEmpty'](_0x4f2d8b)){_0x17ed8b[_0xc94a('0x4c')](_0xc94a('0x9e'));_0x29db55['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x17ed8b[_0xc94a('0x4c')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x4f2d8b,'id'));_0x29db55[_0xc94a('0x4c')](_0xc94a('0x7d'),_[_0xc94a('0x31')](_0x4f2d8b,'id'));}});})[_0xc94a('0x2b')](function(){if(_0x4b2900['user'][_0xc94a('0x9a')]===_0xc94a('0x9b')&&!_0x44ea17&&!_0x4b2900['query'][_0xc94a('0x7c')])return[];return db['sequelize']['query'](_0x17ed8b[_0xc94a('0x9f')](),_0x156561);})['then'](function(_0x415d55){_0x50dc53[_0xc94a('0x25')]=_0x415d55[_0xc94a('0x64')];if(_0x50dc53[_0xc94a('0x25')]===0x0)return[];return db[_0xc94a('0xa0')][_0xc94a('0x45')](_0x530252[_0xc94a('0x9f')](),_0x156561)['then'](function(_0x108077){_0xcdc55d=_['keyBy'](_0x108077,'id');_0x156561=_[_0xc94a('0xa1')](_0x156561,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b2900[_0xc94a('0x45')][_0xc94a('0x49')]){_0x54bfe6[_0xc94a('0x48')][_0xc94a('0x74')](function(_0x275b6e){_0x29db55[_0xc94a('0x4e')]('i.'+_0x275b6e);});}else{_0x29db55[_0xc94a('0x4e')](_0xc94a('0x93'),'unreadMessages');_0x29db55[_0xc94a('0x4e')](_0xc94a('0xa2'),_0xc94a('0xa3'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xa4'),_0xc94a('0xa5'));_0x29db55[_0xc94a('0x4e')]('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',_0xc94a('0x94'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xa6'));_0x29db55[_0xc94a('0x4e')]('c.firstName',_0xc94a('0xa7'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xa8'),_0xc94a('0xa9'));_0x29db55['field'](_0xc94a('0xaa'),_0xc94a('0xab'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xac'),_0xc94a('0xad'));_0x29db55['field'](_0xc94a('0xae'),_0xc94a('0xaf'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xb0'),_0xc94a('0xb1'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xb2'),_0xc94a('0xb3'));_0x29db55[_0xc94a('0x4e')](_0xc94a('0xb4'),_0xc94a('0xb5'));_0x29db55['field'](_0xc94a('0xb6'),'TagIds');}if(_0x54bfe6[_0xc94a('0x23')])_0x29db55[_0xc94a('0x23')](_0x54bfe6[_0xc94a('0x23')]);if(_0x54bfe6[_0xc94a('0x22')])_0x29db55[_0xc94a('0x22')](_0x54bfe6[_0xc94a('0x22')]);return db[_0xc94a('0xa0')][_0xc94a('0x45')](_0x29db55[_0xc94a('0x9f')](),_0x156561);})['then'](function(_0x5e5fbe){if(_0x5e5fbe[_0xc94a('0x64')]>0x0)_0x81f335['where'](_0xc94a('0xb7'),_[_0xc94a('0x31')](_0x5e5fbe,'id'));return db[_0xc94a('0xa0')][_0xc94a('0x45')](_0x81f335[_0xc94a('0x9f')](),_0x156561)[_0xc94a('0x2b')](function(_0x8b90bd){var _0x4814cd=_[_0xc94a('0xb8')](_0x8b90bd,_0xc94a('0xb9'));var _0x45a2f0=[];_0x5e5fbe[_0xc94a('0x74')](function(_0x5af13){_0x45a2f0[_0xc94a('0x35')](updateOpenchannelInteraction(_0x5af13,_0xcdc55d,_0x4814cd));});return BPromise[_0xc94a('0xba')](_0x45a2f0);});});})[_0xc94a('0x2b')](function(_0x1e82ae){_0x50dc53[_0xc94a('0xbb')]=_0x1e82ae;return _0x50dc53;})[_0xc94a('0x2b')](respondWithFilteredResult(_0x359d77,_0x54bfe6))['catch'](handleError(_0x359d77,null));};exports[_0xc94a('0xbc')]=function(_0x17d1bd,_0x21db00){var _0x3ae7ee={};if(_0x17d1bd[_0xc94a('0x45')][_0xc94a('0x42')]&&_0x17d1bd['query'][_0xc94a('0x42')]===_0xc94a('0x57')){_0x3ae7ee['from']=_0x17d1bd['params']['id'];}else{_0x3ae7ee['id']=_0x17d1bd['params']['id'];}var _0x167851={'raw':![],'where':_0x3ae7ee},_0x582503={};_0x582503[_0xc94a('0x43')]=_[_0xc94a('0x44')](db[_0xc94a('0x3f')][_0xc94a('0x40')]);_0x582503[_0xc94a('0x45')]=_[_0xc94a('0x44')](_0x17d1bd[_0xc94a('0x45')]);_0x582503[_0xc94a('0x46')]=_['intersection'](_0x582503[_0xc94a('0x43')],_0x582503[_0xc94a('0x45')]);_0x167851['attributes']=_[_0xc94a('0x47')](_0x582503[_0xc94a('0x43')],qs[_0xc94a('0x49')](_0x17d1bd['query'][_0xc94a('0x49')]));_0x167851['attributes']=_0x167851[_0xc94a('0x48')][_0xc94a('0x64')]?_0x167851['attributes']:_0x582503[_0xc94a('0x43')];if(_0x17d1bd[_0xc94a('0x45')][_0xc94a('0xbd')]){_0x167851[_0xc94a('0xbe')]=[{'all':!![]}];}_0x167851=_[_0xc94a('0xa1')]({},_0x167851,_0x17d1bd[_0xc94a('0xbf')]);return db['OpenchannelInteraction'][_0xc94a('0x65')](_0x167851)[_0xc94a('0x2b')](handleEntityNotFound(_0x21db00,null))['then'](respondWithResult(_0x21db00,null))['catch'](handleError(_0x21db00,null));};exports[_0xc94a('0xc0')]=function(_0x4a3b0f,_0x16f487){return db[_0xc94a('0x3f')][_0xc94a('0xc0')](_0x4a3b0f[_0xc94a('0xc1')],{})['then'](respondWithResult(_0x16f487,0xc9))[_0xc94a('0x36')](handleError(_0x16f487,null));};exports['update']=function(_0x4729eb,_0x572027){if(_0x4729eb['body']['id']){delete _0x4729eb['body']['id'];}return db['OpenchannelInteraction'][_0xc94a('0x65')]({'where':{'id':_0x4729eb[_0xc94a('0xc2')]['id']}})[_0xc94a('0x2b')](handleEntityNotFound(_0x572027,null))[_0xc94a('0x2b')](saveUpdates(_0x4729eb[_0xc94a('0xc1')],null))[_0xc94a('0x2b')](respondWithResult(_0x572027,null))[_0xc94a('0x36')](handleError(_0x572027,null));};exports['destroy']=function(_0x45ccc4,_0xf36ee0){return db[_0xc94a('0x3f')][_0xc94a('0x65')]({'where':{'id':_0x45ccc4[_0xc94a('0xc2')]['id']}})[_0xc94a('0x2b')](handleEntityNotFound(_0xf36ee0,null))[_0xc94a('0x2b')](removeEntity(_0xf36ee0,null))['catch'](handleError(_0xf36ee0,null));};exports['describe']=function(_0xacd770,_0x4df77d){return db[_0xc94a('0x3f')][_0xc94a('0xc3')]()[_0xc94a('0x2b')](respondWithResult(_0x4df77d,null))[_0xc94a('0x36')](handleError(_0x4df77d,null));};exports[_0xc94a('0xc4')]=function(_0x1d84e1,_0x2d1559,_0x4789dd){return db[_0xc94a('0xc5')]['find']({'where':{'id':_0x1d84e1['params']['id']}})['then'](handleEntityNotFound(_0x2d1559,null))['then'](function(_0xd55cc2){if(_0xd55cc2){return _0xd55cc2[_0xc94a('0xc4')](_0x1d84e1['body'][_0xc94a('0xc6')],_[_0xc94a('0xc7')](_0x1d84e1[_0xc94a('0xc1')],[_0xc94a('0xc6'),'id'])||{});}})[_0xc94a('0x2b')](respondWithResult(_0x2d1559,null))[_0xc94a('0x36')](handleError(_0x2d1559,null));};exports['getMessages']=function(_0x5deb77,_0x120f0f,_0x956abc){var _0x387378={'raw':![],'where':{}};var _0x2a7bd7={};var _0x4911ff={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xc94a('0xc8')]({'where':{'id':_0x5deb77[_0xc94a('0xc2')]['id']}})['then'](handleEntityNotFound(_0x120f0f,null))[_0xc94a('0x2b')](function(_0x3684af){if(_0x3684af){_0x2a7bd7['model']=_[_0xc94a('0x44')](db[_0xc94a('0xc5')][_0xc94a('0x40')]);_0x2a7bd7[_0xc94a('0x45')]=_['keys'](_0x5deb77[_0xc94a('0x45')]);_0x2a7bd7['filters']=_[_0xc94a('0x47')](_0x2a7bd7['model'],_0x2a7bd7[_0xc94a('0x45')]);_0x387378['attributes']=_[_0xc94a('0x47')](_0x2a7bd7[_0xc94a('0x43')],qs['fields'](_0x5deb77[_0xc94a('0x45')][_0xc94a('0x49')]));_0x387378[_0xc94a('0x48')]=_0x387378[_0xc94a('0x48')][_0xc94a('0x64')]?_0x387378[_0xc94a('0x48')]:_0x2a7bd7['model'];if(!_0x5deb77[_0xc94a('0x45')][_0xc94a('0x4a')](_0xc94a('0xc9'))){_0x387378['limit']=qs[_0xc94a('0x23')](_0x5deb77[_0xc94a('0x45')][_0xc94a('0x23')]);_0x387378[_0xc94a('0x22')]=qs[_0xc94a('0x22')](_0x5deb77[_0xc94a('0x45')][_0xc94a('0x22')]);}_0x387378['order']=qs[_0xc94a('0xca')](_0x5deb77[_0xc94a('0x45')][_0xc94a('0xca')]);_0x387378[_0xc94a('0x4c')]=qs[_0xc94a('0x46')](_['pick'](_0x5deb77['query'],_0x2a7bd7[_0xc94a('0x46')]));_0x387378[_0xc94a('0x4c')][_0xc94a('0xb9')]=_0x3684af['id'];if(_0x5deb77['query'][_0xc94a('0x8a')]){_0x387378[_0xc94a('0x4c')]=_[_0xc94a('0xa1')](_0x387378[_0xc94a('0x4c')],{'$or':_['map'](_0x387378[_0xc94a('0x48')],function(_0x1bc507){var _0x42f2a6={};_0x42f2a6[_0x1bc507]={'$like':'%'+_0x5deb77[_0xc94a('0x45')][_0xc94a('0x8a')]+'%'};return _0x42f2a6;})});}if(_0x5deb77[_0xc94a('0x45')][_0xc94a('0x81')]){var _0x9c5e20=_0x5deb77[_0xc94a('0x45')][_0xc94a('0x81')][_0xc94a('0x34')](',');var _0x2d6897={};_0x2d6897[_0x9c5e20[0x0]]={'$gte':moment(_0x9c5e20[0x1])[_0xc94a('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x387378[_0xc94a('0x4c')]=_['merge'](_0x387378['where'],_0x2d6897);}_0x387378=_['merge']({},_0x387378,_0x5deb77[_0xc94a('0xbf')]);return db[_0xc94a('0xc5')][_0xc94a('0x25')]({'where':_0x387378[_0xc94a('0x4c')]})[_0xc94a('0x2b')](function(_0x4705b7){_0x4911ff[_0xc94a('0x25')]=_0x4705b7;if(_0x5deb77[_0xc94a('0x45')][_0xc94a('0xbd')]){_0x387378[_0xc94a('0xbe')]=[{'all':!![]}];}return db[_0xc94a('0xc5')][_0xc94a('0xcc')](_0x387378);})[_0xc94a('0x2b')](function(_0x1cf5c4){_0x4911ff['rows']=_0x1cf5c4;return _0x4911ff;});}})[_0xc94a('0x2b')](respondWithFilteredResult(_0x120f0f,_0x387378))[_0xc94a('0x36')](handleError(_0x120f0f,null));};exports[_0xc94a('0xcd')]=function(_0x49e5ad,_0x8e55a,_0x56bf57){return db[_0xc94a('0x3f')][_0xc94a('0x65')]({'where':{'id':_0x49e5ad[_0xc94a('0xc2')]['id']}})[_0xc94a('0x2b')](handleEntityNotFound(_0x8e55a,null))[_0xc94a('0x2b')](function(_0x58c685){if(_0x58c685){return _0x58c685[_0xc94a('0xce')](_0x49e5ad[_0xc94a('0xc1')][_0xc94a('0xc6')],_[_0xc94a('0xc7')](_0x49e5ad['body'],[_0xc94a('0xc6'),'id'])||{})[_0xc94a('0xcf')](function(){return db[_0xc94a('0x73')][_0xc94a('0xcc')]({'attributes':['id',_0xc94a('0x2e'),_0xc94a('0x4f')],'where':{'id':_0x49e5ad[_0xc94a('0xc1')][_0xc94a('0xc6')]}});})[_0xc94a('0x2b')](function(_0x365305){socket[_0xc94a('0xd0')](_0xc94a('0xd1'),{'id':Number(_0x49e5ad['params']['id']),'tags':_0x365305||[]});return{'id':Number(_0x49e5ad['params']['id']),'tags':_0x365305||[]};});}})[_0xc94a('0x2b')](respondWithResult(_0x8e55a,null))[_0xc94a('0x36')](handleError(_0x8e55a,null));};exports['removeTags']=function(_0xb2b455,_0x17e178,_0x23094b){return db[_0xc94a('0x3f')][_0xc94a('0x65')]({'where':{'id':_0xb2b455[_0xc94a('0xc2')]['id']}})[_0xc94a('0x2b')](handleEntityNotFound(_0x17e178,null))[_0xc94a('0x2b')](function(_0x3ae869){if(_0x3ae869){return _0x3ae869[_0xc94a('0xd2')](_0xb2b455[_0xc94a('0x45')][_0xc94a('0xc6')]);}})[_0xc94a('0x2b')](respondWithStatusCode(_0x17e178,null))[_0xc94a('0x36')](handleError(_0x17e178,null));};exports[_0xc94a('0xd3')]=function(_0x3fbf8a,_0x2ef230){var _0x9f618d=moment()[_0xc94a('0xd4')]()[_0xc94a('0x9f')]();var _0x10f58d=path['join'](config[_0xc94a('0xd5')],_0xc94a('0xd6'),'files',_0xc94a('0xd7'));var _0x45c5d9=path[_0xc94a('0xd8')](config[_0xc94a('0xd5')],_0xc94a('0xd6'),_0xc94a('0xd9'),_0xc94a('0xda'));var _0x5ba842=path[_0xc94a('0xd8')](_0x10f58d,_0x9f618d);var _0x21f777=util[_0xc94a('0xcb')]('transcript-%d-%s.zip',_0x3fbf8a[_0xc94a('0xc2')]['id'],_0x9f618d);var _0x4e2338=path[_0xc94a('0xd8')](_0x10f58d,_0x21f777);var _0x4aad32=[];_0x4aad32[_0xc94a('0x35')]({'model':db[_0xc94a('0x77')],'as':'User','attributes':['id',_0xc94a('0xdb')],'raw':!![]});_0x4aad32[_0xc94a('0x35')]({'model':db['CmContact'],'as':_0xc94a('0x6b'),'attributes':['id',_0xc94a('0xdc'),'lastName'],'raw':!![]});if(_0x3fbf8a[_0xc94a('0x45')][_0xc94a('0xda')]){_0x4aad32[_0xc94a('0x35')]({'model':db[_0xc94a('0xdd')],'as':'Attachment','raw':!![]});}var _0x2a0062=[{'model':db[_0xc94a('0xc5')],'as':'Messages','attributes':['id','body',_0xc94a('0x7f'),'direction',_0xc94a('0xde'),_0xc94a('0x87')],'include':_0x4aad32}];_0x2a0062[_0xc94a('0x35')]({'model':db[_0xc94a('0xdf')],'as':_0xc94a('0xe0'),'attributes':['id',_0xc94a('0x2e')]});_0x2a0062[_0xc94a('0x35')]({'model':db[_0xc94a('0x77')],'as':_0xc94a('0xe1'),'attributes':['id',_0xc94a('0xdb')]});return db['OpenchannelInteraction'][_0xc94a('0x65')]({'where':{'id':_0x3fbf8a[_0xc94a('0xc2')]['id']},'include':_0x2a0062})[_0xc94a('0x2b')](handleEntityNotFound(_0x2ef230,null))[_0xc94a('0x2b')](function(_0x1a9f46){if(_0x1a9f46){var _0x56af8f=_0x1a9f46[_0xc94a('0xe2')]({'plain':!![]});fs['mkdirSync'](_0x5ba842);var _0x2d9a25={'channel':_0xc94a('0xe3'),'account':_0x56af8f['Account'][_0xc94a('0x2e')],'agent':_0x56af8f[_0xc94a('0xe1')]?_0x56af8f['Owner'][_0xc94a('0xdb')]:_0xc94a('0xe4'),'createdAt':moment(_0x56af8f[_0xc94a('0x7f')])[_0xc94a('0xcb')](_0xc94a('0xe5'))[_0xc94a('0x9f')](),'closedAt':_0x56af8f[_0xc94a('0x3b')]?moment(_0x56af8f[_0xc94a('0xe6')])[_0xc94a('0xcb')](_0xc94a('0xe5'))[_0xc94a('0x9f')]():'','disposition':_0x56af8f[_0xc94a('0xe7')],'visibility':_0x56af8f[_0xc94a('0xe8')]?'Public':_0xc94a('0xe9'),'messages':_(_0x56af8f[_0xc94a('0xea')])[_0xc94a('0x8a')]({'secret':![]})[_0xc94a('0x31')](function(_0x36caa2){if(_0x36caa2[_0xc94a('0xdd')]){var _0x37a502=path['join'](_0x45c5d9,_0x36caa2['Attachment'][_0xc94a('0xeb')]);if(fs['existsSync'](_0x37a502)){fs['createReadStream'](_0x37a502)[_0xc94a('0xec')](fs[_0xc94a('0xed')](path[_0xc94a('0xd8')](_0x5ba842,_0x36caa2[_0xc94a('0xdd')][_0xc94a('0xeb')])));}}return{'date':moment(_0x36caa2['createdAt'])[_0xc94a('0xcb')](_0xc94a('0xe5'))[_0xc94a('0x9f')](),'sender':_0x36caa2[_0xc94a('0xee')]===_0xc94a('0xef')?_0x36caa2[_0xc94a('0x77')]?_0x36caa2['User'][_0xc94a('0xdb')]:'System':_0x36caa2[_0xc94a('0x6b')][_0xc94a('0xdc')]+(_0x36caa2['Contact'][_0xc94a('0xf0')]?'\x20'+_0x36caa2['Contact'][_0xc94a('0xf0')]:''),'body':_0x36caa2[_0xc94a('0xdd')]?_0x36caa2[_0xc94a('0xdd')][_0xc94a('0xeb')]:_0x36caa2['body'],'direction':_0x36caa2[_0xc94a('0xee')]===_0xc94a('0xef')?'A':'C','secret':_0x36caa2[_0xc94a('0xde')],'read':_0x36caa2['read'],'attachment':_0x36caa2[_0xc94a('0xdd')]};})['value']()};return ejs[_0xc94a('0xf1')](path['join'](config['root'],_0xc94a('0xd6'),_0xc94a('0xf2'),_0xc94a('0xf3')),{'interaction':_0x2d9a25})[_0xc94a('0x2b')](function(_0x2989bb){var _0x48394a=path[_0xc94a('0xd8')](_0x5ba842,_0xc94a('0xf4')+_0x56af8f['id']+'-'+_0x9f618d+_0xc94a('0xf5'));var _0x1bc173={'path':_0x48394a,'channel':_0xc94a('0xe3'),'interactionId':_0x56af8f['id']};return pdf[_0xc94a('0xf6')](_0x2989bb,_0x1bc173);})['then'](function(){return new BPromise(function(_0x5eb858,_0x402e2d){zipdir(_0x5ba842,{'saveTo':_0x4e2338},function(_0x385264,_0x1b094d){if(_0x385264)return _0x402e2d(_0x385264);return _0x5eb858(_0x1b094d);});})['then'](function(){return new BPromise(function(_0x1784a6,_0x30b6a0){rimraf(_0x5ba842,function(_0xf3f26f){if(_0xf3f26f)_0x30b6a0(_0xf3f26f);return _0x1784a6();});});})[_0xc94a('0x2b')](function(){return _0x2ef230[_0xc94a('0xd3')](_0x4e2338,_0x21f777,function(_0x44f2bc){if(_0x44f2bc){console[_0xc94a('0xf7')](_0xc94a('0xf8'),_0x44f2bc);}else{fs[_0xc94a('0xf9')](_0x4e2338);}});});});}else{return _0x2ef230[_0xc94a('0x1e')](0xc8);}})[_0xc94a('0x36')](handleError(_0x2ef230,null));}; \ No newline at end of file +var _0xb016=['download','log','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','answered','unmanaged','total','UserId','closed','talking','index','OpenchannelInteraction','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','body','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','filter','replace','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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','all','show','params','includeAll','include','options','create','destroy','describe','addMessage','ids','getMessages','OpenchannelMessage','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','CmContact','firstName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','N.A.','createdAt','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','renderFile','transcript-','.pdf','Openchannel','createPdfFromHTML'];(function(_0x386e25,_0x179917){var _0x32d7b5=function(_0x4bd6f6){while(--_0x4bd6f6){_0x386e25['push'](_0x386e25['shift']());}};_0x32d7b5(++_0x179917);}(_0xb016,0xee));var _0x6b01=function(_0x5e034a,_0x4a43f0){_0x5e034a=_0x5e034a-0x0;var _0x5ed3ca=_0xb016[_0x5e034a];return _0x5ed3ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b01('0x1'));var rp=require(_0x6b01('0x2'));var moment=require(_0x6b01('0x3'));var BPromise=require(_0x6b01('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b01('0x5'));var sox=require(_0x6b01('0x6'));var csv=require(_0x6b01('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b01('0x8'));var _=require('lodash');var squel=require(_0x6b01('0x9'));var crypto=require('crypto');var jsforce=require(_0x6b01('0xa'));var deskjs=require(_0x6b01('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b01('0xe'));var as=require(_0x6b01('0xf'));var pdf=require(_0x6b01('0x10'));var hardwareService=require(_0x6b01('0x11'));var logger=require(_0x6b01('0x12'))(_0x6b01('0x13'));var utils=require(_0x6b01('0x14'));var config=require(_0x6b01('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6b01('0x16')]=_[_0x6b01('0x17')](config[_0x6b01('0x16')],{'host':_0x6b01('0x18'),'port':0x18eb});var socket=require(_0x6b01('0x19'))(new Redis(config['redis']));require(_0x6b01('0x1a'))['register'](socket);function respondWithStatusCode(_0x3158ff,_0x1e6c22){_0x1e6c22=_0x1e6c22||0xcc;return function(_0x39b3ff){if(_0x39b3ff){return _0x3158ff['sendStatus'](_0x1e6c22);}return _0x3158ff[_0x6b01('0x1b')](_0x1e6c22)[_0x6b01('0x1c')]();};}function respondWithResult(_0x3df546,_0x223e05){_0x223e05=_0x223e05||0xc8;return function(_0x227cc0){if(_0x227cc0){return _0x3df546[_0x6b01('0x1b')](_0x223e05)[_0x6b01('0x1d')](_0x227cc0);}};}function respondWithFilteredResult(_0x49cea8,_0x964253){return function(_0x2bcdd5){if(_0x2bcdd5){var _0x300169=typeof _0x964253[_0x6b01('0x1e')]===_0x6b01('0x1f')&&typeof _0x964253[_0x6b01('0x20')]==='undefined';var _0x41a9cc=_0x2bcdd5[_0x6b01('0x21')];var _0x12c1cf=_0x300169?0x0:_0x964253[_0x6b01('0x1e')];var _0x53ab15=_0x300169?_0x2bcdd5[_0x6b01('0x21')]:_0x964253[_0x6b01('0x1e')]+_0x964253[_0x6b01('0x20')];var _0x8a5b4;if(_0x53ab15>=_0x41a9cc){_0x53ab15=_0x41a9cc;_0x8a5b4=0xc8;}else{_0x8a5b4=0xce;}_0x49cea8[_0x6b01('0x1b')](_0x8a5b4);return _0x49cea8[_0x6b01('0x22')](_0x6b01('0x23'),_0x12c1cf+'-'+_0x53ab15+'/'+_0x41a9cc)[_0x6b01('0x1d')](_0x2bcdd5);}return null;};}function patchUpdates(_0x414004){return function(_0x1b7366){try{jsonpatch['apply'](_0x1b7366,_0x414004,!![]);}catch(_0x56cca6){return BPromise['reject'](_0x56cca6);}return _0x1b7366['save']();};}function saveUpdates(_0x117cf5,_0x5ebe67){return function(_0x301ab2){if(_0x301ab2){return _0x301ab2[_0x6b01('0x24')](_0x117cf5)[_0x6b01('0x25')](function(_0x3707a6){return _0x3707a6;});}return null;};}function removeEntity(_0x527224,_0x5932c1){return function(_0x340ab3){if(_0x340ab3){return _0x340ab3['destroy']()[_0x6b01('0x25')](function(){_0x527224['status'](0xcc)[_0x6b01('0x1c')]();});}};}function handleEntityNotFound(_0x5bf4f4,_0x44592e){return function(_0x291511){if(!_0x291511){_0x5bf4f4['sendStatus'](0x194);}return _0x291511;};}function handleError(_0x1e24d4,_0x3945ce){_0x3945ce=_0x3945ce||0x1f4;return function(_0x3895ef){logger[_0x6b01('0x26')](_0x3895ef[_0x6b01('0x27')]);if(_0x3895ef[_0x6b01('0x28')]){delete _0x3895ef[_0x6b01('0x28')];}_0x1e24d4[_0x6b01('0x1b')](_0x3945ce)[_0x6b01('0x29')](_0x3895ef);};}function getInteractionUsers(_0x292409,_0x48a19a){return new BPromise(function(_0x1cd175,_0x4e4fb8){try{if(_0x48a19a[_0x292409['id']]){_0x292409['Users']=_[_0x6b01('0x2a')](_0x48a19a[_0x292409['id']],function(_0x27dca3){return{'id':_0x27dca3['id'],'fullname':_0x27dca3[_0x6b01('0x2b')]};});}}catch(_0x2acf05){_0x4e4fb8(_0x2acf05);}_0x1cd175(_0x292409);});}function getInteractionTags(_0xcfe5b9,_0x51cd09){return new BPromise(function(_0x4ff6b1,_0x38806a){try{if(_0xcfe5b9[_0x6b01('0x2c')]){_0xcfe5b9[_0x6b01('0x2d')]=[];_0xcfe5b9[_0x6b01('0x2c')][_0x6b01('0x2e')](',')[_0x6b01('0x2f')](function(_0x26a822){_0xcfe5b9['Tags'][_0x6b01('0x30')](_0x51cd09[_0x26a822]);});}delete _0xcfe5b9['TagIds'];}catch(_0x2dd83e){_0x38806a(_0x2dd83e);}_0x4ff6b1(_0xcfe5b9);});}function updateOpenchannelInteraction(_0x5bb702,_0x2a7bb6,_0x48adc9){return new BPromise(function(_0x4547a1,_0x30e95c){return getInteractionUsers(_0x5bb702,_0x48adc9)[_0x6b01('0x25')](function(_0x49edc0){return getInteractionTags(_0x49edc0,_0x2a7bb6);})[_0x6b01('0x25')](function(_0x441d20){return getStateInteraction(_0x441d20);})['then'](function(_0x1e6a25){_0x4547a1(_0x1e6a25);})[_0x6b01('0x31')](function(_0x5ed385){_0x30e95c(_0x5ed385);});});}function getStateInteraction(_0x3fd171){return new BPromise(function(_0x713ccf){_0x3fd171[_0x6b01('0x32')]=0x0;_0x3fd171['talking']=0x0;_0x3fd171[_0x6b01('0x33')]=0x0;_0x3fd171[_0x6b01('0x34')]=0x0;_0x3fd171[_0x6b01('0x35')]=0x0;if(!_0x3fd171['closed']&&!_0x3fd171[_0x6b01('0x36')]){_0x3fd171[_0x6b01('0x32')]+=0x1;}if(!_0x3fd171[_0x6b01('0x37')]&&_0x3fd171[_0x6b01('0x36')]){_0x3fd171[_0x6b01('0x38')]+=0x1;if(_0x3fd171[_0x6b01('0x32')]){_0x3fd171[_0x6b01('0x32')]-=0x1;}}if(_0x3fd171[_0x6b01('0x37')]&&_0x3fd171[_0x6b01('0x36')]){_0x3fd171[_0x6b01('0x33')]+=0x1;if(_0x3fd171[_0x6b01('0x38')]){_0x3fd171[_0x6b01('0x38')]-=0x1;}}if(_0x3fd171[_0x6b01('0x37')]&&!_0x3fd171['UserId']){_0x3fd171[_0x6b01('0x34')]+=0x1;if(_0x3fd171[_0x6b01('0x32')]){_0x3fd171['waiting']-=0x1;}}_0x3fd171['total']+=0x1;_0x713ccf(_0x3fd171);});}exports[_0x6b01('0x39')]=function(_0xeea9e,_0x34c3e0){var _0x88fed3={},_0x42f751={},_0x2ddc00={'count':0x0,'rows':[]};var _0x557bc7=_['map'](db[_0x6b01('0x3a')][_0x6b01('0x3b')],function(_0x174f77){return{'name':_0x174f77['fieldName'],'type':_0x174f77[_0x6b01('0x3c')][_0x6b01('0x3d')]};});_0x42f751['model']=_[_0x6b01('0x2a')](_0x557bc7,'name');_0x42f751[_0x6b01('0x3e')]=_[_0x6b01('0x3f')](_0xeea9e[_0x6b01('0x3e')]);_0x42f751[_0x6b01('0x40')]=_['intersection'](_0x42f751[_0x6b01('0x41')],_0x42f751[_0x6b01('0x3e')]);_0x88fed3[_0x6b01('0x42')]=_[_0x6b01('0x43')](_0x42f751['model'],qs[_0x6b01('0x44')](_0xeea9e[_0x6b01('0x3e')]['fields']));_0x88fed3['attributes']=_0x88fed3[_0x6b01('0x42')][_0x6b01('0x45')]?_0x88fed3[_0x6b01('0x42')]:_0x42f751[_0x6b01('0x41')];if(!_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x46')](_0x6b01('0x47'))){_0x88fed3[_0x6b01('0x20')]=qs[_0x6b01('0x20')](_0xeea9e['query'][_0x6b01('0x20')]);_0x88fed3[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x1e')]);}_0x88fed3['order']=qs[_0x6b01('0x48')](_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x48')]);_0x88fed3[_0x6b01('0x49')]=qs['filters'](_['pick'](_0xeea9e[_0x6b01('0x3e')],_0x42f751[_0x6b01('0x40')]),_0x557bc7);var _0xb74eb5=[];var _0x310e7f=squel[_0x6b01('0x4a')]()['field']('id')['field'](_0x6b01('0x28'))[_0x6b01('0x4b')]('color')[_0x6b01('0x4c')](_0x6b01('0x4d'));var _0x1b5aff=squel[_0x6b01('0x4a')]()['field'](_0x6b01('0x4e'))[_0x6b01('0x4b')](_0x6b01('0x4f'))[_0x6b01('0x4b')](_0x6b01('0x50'))[_0x6b01('0x4c')](_0x6b01('0x51'),'ui')[_0x6b01('0x52')](_0x6b01('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x42b2f8=squel['select']()['from'](_0x6b01('0x54'),'i')[_0x6b01('0x52')]('cm_contacts','c',_0x6b01('0x55'))[_0x6b01('0x52')](_0x6b01('0x53'),'o',_0x6b01('0x56'))[_0x6b01('0x52')]('openchannel_accounts','a',_0x6b01('0x57'))['left_join'](_0x6b01('0x58'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x6b01('0x52')](_0x6b01('0x59'),'it',_0x6b01('0x5a'))[_0x6b01('0x52')](_0x6b01('0x4d'),'t',_0x6b01('0x5b'));var _0x2c1db6=squel[_0x6b01('0x5c')]();var _0x2e943a=[];var _0x40842b=squel[_0x6b01('0x5c')]();var _0x556726;if(_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x5d')]){_0x556726=as['parseSearch'](_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x5d')]);var _0x261427=_0x556726[_0x6b01('0x5e')];for(var _0x54cb3e=0x0;_0x54cb3e<_0x556726['conditions']['length'];_0x54cb3e++){var _0xbaec55=_0x556726[_0x6b01('0x5f')][_0x54cb3e];var _0x4ad6cb='i';var _0x37ff15=_['find'](_0x557bc7,[_0x6b01('0x28'),_0xbaec55[_0x6b01('0x4b')]]);if(!_0x37ff15){switch(_0xbaec55['field']){case _0x6b01('0x60'):if(_0xbaec55[_0x6b01('0x61')]==0x1){_0x42b2f8[_0x6b01('0x62')]('`'+_0xbaec55[_0x6b01('0x4b')]+_0x6b01('0x63'));}else{_0x42b2f8['having']('`'+_0xbaec55[_0x6b01('0x4b')]+_0x6b01('0x64'));}break;case _0x6b01('0x65'):if(_0xbaec55[_0x6b01('0x66')]===_0x6b01('0x67')){if(_0xbaec55[_0x6b01('0x61')][_0x6b01('0x2e')]('\x20')[_0x6b01('0x45')]>0x1){_0x2c1db6[_0x261427](_0x6b01('0x68'),qs[_0x6b01('0x69')](_0xbaec55[_0x6b01('0x61')]),null);}else{var _0x3a2173='%'+_0xbaec55[_0x6b01('0x61')]+'%';_0x2c1db6[_0x261427](_0x6b01('0x6a'),_0x3a2173,_0x3a2173,_0x3a2173);}}else{_0x37ff15=_['find'](_0x557bc7,[_0x6b01('0x28'),'ContactId']);_0xbaec55[_0x6b01('0x4b')]=_0x6b01('0x6b');_0x4e691c=as[_0x6b01('0x6c')](_0x4ad6cb,_0x37ff15[_0x6b01('0x3c')],_0xbaec55);_0x2c1db6[_0x261427](_0x4e691c[_0x6b01('0x6d')],_0x4e691c[_0x6b01('0x61')][_0x6b01('0x6e')],_0x4e691c[_0x6b01('0x61')]['end']);}break;case _0x6b01('0x6f'):var _0x3d82fa=_0xbaec55[_0x6b01('0x61')][_0x6b01('0x2e')](',')[_0x6b01('0x2a')](function(_0x12fcf1){return Number(_0x12fcf1);});_0x3d82fa['forEach'](function(_0x4399ac){_0x40842b['or'](_0x6b01('0x70'),'%,'+_0x4399ac+',%');});_0x2e943a=_[_0x6b01('0x71')](_0x2e943a,_0x3d82fa);break;case _0x6b01('0x72'):if(_0xbaec55[_0x6b01('0x66')]===_0x6b01('0x67')){_0x2c1db6[_0x261427]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xbaec55['value']+'%',null);}else{_0x37ff15=_[_0x6b01('0x73')](_0x557bc7,[_0x6b01('0x28'),_0x6b01('0x36')]);_0xbaec55[_0x6b01('0x4b')]='UserId';_0x4e691c=as[_0x6b01('0x6c')](_0x4ad6cb,_0x37ff15[_0x6b01('0x3c')],_0xbaec55);_0x2c1db6[_0x261427](_0x4e691c[_0x6b01('0x6d')],_0x4e691c[_0x6b01('0x61')]['start'],_0x4e691c[_0x6b01('0x61')][_0x6b01('0x1c')]);}break;case _0x6b01('0x74'):_0x4e691c=as['buildExpression']('me',null,_0xbaec55);_0x2c1db6[_0x261427](_0x4e691c['text'],_0x4e691c[_0x6b01('0x61')]['start'],_0x4e691c['value'][_0x6b01('0x1c')]);break;}}else{var _0x4e691c=as[_0x6b01('0x6c')](_0x4ad6cb,_0x37ff15[_0x6b01('0x3c')],_0xbaec55);_0x2c1db6[_0x261427](_0x4e691c[_0x6b01('0x6d')],_0x4e691c[_0x6b01('0x61')][_0x6b01('0x6e')],_0x4e691c[_0x6b01('0x61')][_0x6b01('0x1c')]);}}}else{var _0x3bb851=_(_0xeea9e['query'])['keys']()['map'](function(_0x19212b){return _['some'](_0x557bc7,[_0x6b01('0x28'),_0x19212b])?_0x19212b:undefined;})[_0x6b01('0x75')]()[_0x6b01('0x61')]();if(!_[_0x6b01('0x76')](_0x3bb851)){_0x3bb851[_0x6b01('0x2f')](function(_0xdeaacf){if(_0xdeaacf==='OpenchannelAccountId'){_0x42b2f8['where'](_0x6b01('0x77'),[]['concat'](_0xeea9e[_0x6b01('0x3e')][_0xdeaacf]));}else if(_0xdeaacf==='createdAt'){var _0x3b71f7=JSON[_0x6b01('0x78')](_0xeea9e[_0x6b01('0x3e')][_0xdeaacf])[_0x6b01('0x79')];var _0x478184=JSON['parse'](_0xeea9e[_0x6b01('0x3e')][_0xdeaacf])[_0x6b01('0x7a')];_0x42b2f8[_0x6b01('0x49')](_0x6b01('0x7b'),_0x3b71f7,_0x478184);}else{if(_0xeea9e[_0x6b01('0x3e')][_0xdeaacf]===_0x6b01('0x7c')){_0x42b2f8[_0x6b01('0x49')]('i.'+_0xdeaacf+'\x20IS\x20NULL');}else{_0x42b2f8[_0x6b01('0x49')]('i.'+_0xdeaacf+'\x20=\x20?',_0xeea9e[_0x6b01('0x3e')][_0xdeaacf]);}}});}if(_0xeea9e[_0x6b01('0x3e')]['read']){if(_0xeea9e['query'][_0x6b01('0x7d')]==0x1){_0x42b2f8[_0x6b01('0x62')]('`unreadMessages`\x20=\x200');}else{_0x42b2f8['having'](_0x6b01('0x7e'));}}if(_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x7f')]){_0x2e943a=_['isArray'](_0xeea9e['query'][_0x6b01('0x7f')])?_0xeea9e['query']['tag']:new Array(_0xeea9e[_0x6b01('0x3e')]['tag']);_0x2e943a[_0x6b01('0x2f')](function(_0x5a3aac){_0x40842b['or'](_0x6b01('0x70'),'%,'+_0x5a3aac+',%');});}if(_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x80')]){var _0x122918=_0xeea9e['query'][_0x6b01('0x80')][_0x6b01('0x81')]('\x5c','\x5c\x5c')[_0x6b01('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x122918)){_0x2c1db6['or']('i.id\x20LIKE\x20?',_0x122918+'%');}else{_0x2c1db6['or'](_0x6b01('0x82'),qs[_0x6b01('0x69')](_0x122918))['or'](_0x6b01('0x83'),_0x122918+'%')['or'](_0x6b01('0x84'),_0x122918+'%');}}}_0x42b2f8[_0x6b01('0x49')](_0x2c1db6);_0x42b2f8[_0x6b01('0x85')](_0x6b01('0x86'));var _0x5282f1={'type':db[_0x6b01('0x87')]['QueryTypes'][_0x6b01('0x88')],'raw':!![]};var _0x17e6c0=_0x42b2f8[_0x6b01('0x89')]();_0x17e6c0[_0x6b01('0x4b')]('i.id');_0x17e6c0[_0x6b01('0x4b')](_0x6b01('0x8a'),_0x6b01('0x60'));if(_0x88fed3['order']){_0x88fed3[_0x6b01('0x8b')][_0x6b01('0x2f')](function(_0x36e112){var _0x3a08fa=_0x36e112[0x0]===_0x6b01('0x8c')?_0x36e112[0x0]:'i.'+_0x36e112[0x0];_0x42b2f8['order'](_0x3a08fa,_0x36e112[0x1]===_0x6b01('0x8d')?![]:!![]);});}if(!_[_0x6b01('0x76')](_0x2e943a)){_0x42b2f8['having'](_0x40842b);_0x17e6c0[_0x6b01('0x49')](_0x6b01('0x8e'),_0x2e943a);}BPromise[_0x6b01('0x8f')]()[_0x6b01('0x25')](function(){if(!_0x556726){if(_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x90')])return;_0x17e6c0[_0x6b01('0x49')](_0x6b01('0x91'));_0x42b2f8['where'](_0x6b01('0x91'));return;}if(_0xeea9e[_0x6b01('0x92')][_0x6b01('0x93')]!==_0x6b01('0x94'))return;return _0xeea9e['user'][_0x6b01('0x95')]({'attributes':['id'],'raw':!![]})[_0x6b01('0x25')](function(_0x526437){if(_['isEmpty'](_0x526437)){_0x17e6c0[_0x6b01('0x49')](_0x6b01('0x96'));_0x42b2f8[_0x6b01('0x49')](_0x6b01('0x96'));}else{_0x17e6c0['where'](_0x6b01('0x77'),_[_0x6b01('0x2a')](_0x526437,'id'));_0x42b2f8[_0x6b01('0x49')](_0x6b01('0x77'),_[_0x6b01('0x2a')](_0x526437,'id'));}});})[_0x6b01('0x25')](function(){if(_0xeea9e[_0x6b01('0x92')]['role']===_0x6b01('0x94')&&!_0x556726&&!_0xeea9e[_0x6b01('0x3e')][_0x6b01('0x90')])return[];return db['sequelize'][_0x6b01('0x3e')](_0x17e6c0[_0x6b01('0x97')](),_0x5282f1);})[_0x6b01('0x25')](function(_0x25384b){_0x2ddc00['count']=_0x25384b['length'];if(_0x2ddc00[_0x6b01('0x21')]===0x0)return[];return db['sequelize'][_0x6b01('0x3e')](_0x310e7f[_0x6b01('0x97')](),_0x5282f1)[_0x6b01('0x25')](function(_0x5dc8fb){_0xb74eb5=_[_0x6b01('0x98')](_0x5dc8fb,'id');_0x5282f1=_[_0x6b01('0x99')](_0x5282f1,{'model':db[_0x6b01('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xeea9e[_0x6b01('0x3e')]['fields']){_0x88fed3[_0x6b01('0x42')][_0x6b01('0x2f')](function(_0x69d43a){_0x42b2f8[_0x6b01('0x4b')]('i.'+_0x69d43a);});}else{_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0x8a'),_0x6b01('0x60'));_0x42b2f8['field'](_0x6b01('0x9a'),_0x6b01('0x9b'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0x9c'),_0x6b01('0x9d'));_0x42b2f8[_0x6b01('0x4b')]('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',_0x6b01('0x8c'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0x9e'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0x9f'),_0x6b01('0xa0'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0xa1'),'Contact.lastName');_0x42b2f8['field'](_0x6b01('0xa2'),_0x6b01('0xa3'));_0x42b2f8['field']('c.phone',_0x6b01('0xa4'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0xa5'),_0x6b01('0xa6'));_0x42b2f8['field']('c.fax','Contact.fax');_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0xa7'),_0x6b01('0xa8'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0xa9'),_0x6b01('0xaa'));_0x42b2f8[_0x6b01('0x4b')](_0x6b01('0xab'),_0x6b01('0x2c'));}if(_0x88fed3[_0x6b01('0x20')])_0x42b2f8['limit'](_0x88fed3[_0x6b01('0x20')]);if(_0x88fed3[_0x6b01('0x1e')])_0x42b2f8['offset'](_0x88fed3['offset']);return db['sequelize'][_0x6b01('0x3e')](_0x42b2f8[_0x6b01('0x97')](),_0x5282f1);})['then'](function(_0x7c59f3){if(_0x7c59f3[_0x6b01('0x45')]>0x0)_0x1b5aff[_0x6b01('0x49')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x6b01('0x2a')](_0x7c59f3,'id'));return db[_0x6b01('0xac')][_0x6b01('0x3e')](_0x1b5aff['toString'](),_0x5282f1)[_0x6b01('0x25')](function(_0x82341a){var _0x31f4eb=_[_0x6b01('0xad')](_0x82341a,'OpenchannelInteractionId');var _0x1c80b5=[];_0x7c59f3[_0x6b01('0x2f')](function(_0x3c197f){_0x1c80b5['push'](updateOpenchannelInteraction(_0x3c197f,_0xb74eb5,_0x31f4eb));});return BPromise[_0x6b01('0xae')](_0x1c80b5);});});})[_0x6b01('0x25')](function(_0x339a3f){_0x2ddc00['rows']=_0x339a3f;return _0x2ddc00;})[_0x6b01('0x25')](respondWithFilteredResult(_0x34c3e0,_0x88fed3))[_0x6b01('0x31')](handleError(_0x34c3e0,null));};exports[_0x6b01('0xaf')]=function(_0x80b5f1,_0x3ec3d3){var _0x4cbaaa={};if(_0x80b5f1['query'][_0x6b01('0x3c')]&&_0x80b5f1[_0x6b01('0x3e')][_0x6b01('0x3c')]===_0x6b01('0x4c')){_0x4cbaaa[_0x6b01('0x4c')]=_0x80b5f1['params']['id'];}else{_0x4cbaaa['id']=_0x80b5f1[_0x6b01('0xb0')]['id'];}var _0x4f8d90={'raw':![],'where':_0x4cbaaa},_0x21b29a={};_0x21b29a[_0x6b01('0x41')]=_[_0x6b01('0x3f')](db['OpenchannelInteraction']['rawAttributes']);_0x21b29a['query']=_[_0x6b01('0x3f')](_0x80b5f1['query']);_0x21b29a[_0x6b01('0x40')]=_['intersection'](_0x21b29a[_0x6b01('0x41')],_0x21b29a[_0x6b01('0x3e')]);_0x4f8d90[_0x6b01('0x42')]=_['intersection'](_0x21b29a[_0x6b01('0x41')],qs['fields'](_0x80b5f1[_0x6b01('0x3e')][_0x6b01('0x44')]));_0x4f8d90[_0x6b01('0x42')]=_0x4f8d90[_0x6b01('0x42')]['length']?_0x4f8d90['attributes']:_0x21b29a[_0x6b01('0x41')];if(_0x80b5f1[_0x6b01('0x3e')][_0x6b01('0xb1')]){_0x4f8d90[_0x6b01('0xb2')]=[{'all':!![]}];}_0x4f8d90=_['merge']({},_0x4f8d90,_0x80b5f1[_0x6b01('0xb3')]);return db[_0x6b01('0x3a')]['find'](_0x4f8d90)[_0x6b01('0x25')](handleEntityNotFound(_0x3ec3d3,null))[_0x6b01('0x25')](respondWithResult(_0x3ec3d3,null))[_0x6b01('0x31')](handleError(_0x3ec3d3,null));};exports[_0x6b01('0xb4')]=function(_0x3280de,_0x3a28f5){return db[_0x6b01('0x3a')][_0x6b01('0xb4')](_0x3280de['body'],{})[_0x6b01('0x25')](respondWithResult(_0x3a28f5,0xc9))['catch'](handleError(_0x3a28f5,null));};exports[_0x6b01('0x24')]=function(_0x126fc2,_0xe8ea8){if(_0x126fc2['body']['id']){delete _0x126fc2['body']['id'];}return db[_0x6b01('0x3a')][_0x6b01('0x73')]({'where':{'id':_0x126fc2[_0x6b01('0xb0')]['id']}})[_0x6b01('0x25')](handleEntityNotFound(_0xe8ea8,null))[_0x6b01('0x25')](saveUpdates(_0x126fc2[_0x6b01('0x74')],null))[_0x6b01('0x25')](respondWithResult(_0xe8ea8,null))['catch'](handleError(_0xe8ea8,null));};exports[_0x6b01('0xb5')]=function(_0x21ddcd,_0x390ec5){return db[_0x6b01('0x3a')][_0x6b01('0x73')]({'where':{'id':_0x21ddcd[_0x6b01('0xb0')]['id']}})['then'](handleEntityNotFound(_0x390ec5,null))[_0x6b01('0x25')](removeEntity(_0x390ec5,null))[_0x6b01('0x31')](handleError(_0x390ec5,null));};exports[_0x6b01('0xb6')]=function(_0xa4630f,_0x59e6ea){return db[_0x6b01('0x3a')][_0x6b01('0xb6')]()[_0x6b01('0x25')](respondWithResult(_0x59e6ea,null))[_0x6b01('0x31')](handleError(_0x59e6ea,null));};exports[_0x6b01('0xb7')]=function(_0x448d39,_0x5583a5,_0x49a594){return db['OpenchannelMessage'][_0x6b01('0x73')]({'where':{'id':_0x448d39[_0x6b01('0xb0')]['id']}})['then'](handleEntityNotFound(_0x5583a5,null))['then'](function(_0x37fc29){if(_0x37fc29){return _0x37fc29['addMessage'](_0x448d39['body']['ids'],_['omit'](_0x448d39['body'],[_0x6b01('0xb8'),'id'])||{});}})[_0x6b01('0x25')](respondWithResult(_0x5583a5,null))[_0x6b01('0x31')](handleError(_0x5583a5,null));};exports[_0x6b01('0xb9')]=function(_0x35f1b0,_0x586726,_0x4e6ee0){var _0x59bef4={'raw':![],'where':{}};var _0x415c25={};var _0x2ab48f={'count':0x0,'rows':[]};return db[_0x6b01('0x3a')]['findOne']({'where':{'id':_0x35f1b0[_0x6b01('0xb0')]['id']}})[_0x6b01('0x25')](handleEntityNotFound(_0x586726,null))['then'](function(_0x3e56a9){if(_0x3e56a9){_0x415c25[_0x6b01('0x41')]=_['keys'](db[_0x6b01('0xba')][_0x6b01('0x3b')]);_0x415c25[_0x6b01('0x3e')]=_[_0x6b01('0x3f')](_0x35f1b0[_0x6b01('0x3e')]);_0x415c25[_0x6b01('0x40')]=_[_0x6b01('0x43')](_0x415c25[_0x6b01('0x41')],_0x415c25[_0x6b01('0x3e')]);_0x59bef4[_0x6b01('0x42')]=_['intersection'](_0x415c25[_0x6b01('0x41')],qs[_0x6b01('0x44')](_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x44')]));_0x59bef4[_0x6b01('0x42')]=_0x59bef4[_0x6b01('0x42')]['length']?_0x59bef4[_0x6b01('0x42')]:_0x415c25[_0x6b01('0x41')];if(!_0x35f1b0[_0x6b01('0x3e')]['hasOwnProperty'](_0x6b01('0x47'))){_0x59bef4[_0x6b01('0x20')]=qs[_0x6b01('0x20')](_0x35f1b0[_0x6b01('0x3e')]['limit']);_0x59bef4[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x35f1b0[_0x6b01('0x3e')]['offset']);}_0x59bef4[_0x6b01('0x8b')]=qs['sort'](_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x48')]);_0x59bef4[_0x6b01('0x49')]=qs[_0x6b01('0x40')](_[_0x6b01('0xbb')](_0x35f1b0[_0x6b01('0x3e')],_0x415c25['filters']));_0x59bef4[_0x6b01('0x49')][_0x6b01('0xbc')]=_0x3e56a9['id'];if(_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x80')]){_0x59bef4[_0x6b01('0x49')]=_[_0x6b01('0x99')](_0x59bef4[_0x6b01('0x49')],{'$or':_[_0x6b01('0x2a')](_0x59bef4[_0x6b01('0x42')],function(_0x5d3640){var _0x4d415a={};_0x4d415a[_0x5d3640]={'$like':'%'+_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x80')]+'%'};return _0x4d415a;})});}if(_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x79')]){var _0x43822a=_0x35f1b0[_0x6b01('0x3e')][_0x6b01('0x79')][_0x6b01('0x2e')](',');var _0xf044f8={};_0xf044f8[_0x43822a[0x0]]={'$gte':moment(_0x43822a[0x1])[_0x6b01('0xbd')](_0x6b01('0xbe'))};_0x59bef4['where']=_[_0x6b01('0x99')](_0x59bef4['where'],_0xf044f8);}_0x59bef4=_[_0x6b01('0x99')]({},_0x59bef4,_0x35f1b0['options']);return db['OpenchannelMessage'][_0x6b01('0x21')]({'where':_0x59bef4['where']})[_0x6b01('0x25')](function(_0x48abb4){_0x2ab48f[_0x6b01('0x21')]=_0x48abb4;if(_0x35f1b0['query'][_0x6b01('0xb1')]){_0x59bef4[_0x6b01('0xb2')]=[{'all':!![]}];}return db[_0x6b01('0xba')][_0x6b01('0xbf')](_0x59bef4);})[_0x6b01('0x25')](function(_0x19889c){_0x2ab48f['rows']=_0x19889c;return _0x2ab48f;});}})[_0x6b01('0x25')](respondWithFilteredResult(_0x586726,_0x59bef4))[_0x6b01('0x31')](handleError(_0x586726,null));};exports[_0x6b01('0xc0')]=function(_0x29e872,_0xcf4892,_0x2496fa){return db[_0x6b01('0x3a')][_0x6b01('0x73')]({'where':{'id':_0x29e872[_0x6b01('0xb0')]['id']}})[_0x6b01('0x25')](handleEntityNotFound(_0xcf4892,null))[_0x6b01('0x25')](function(_0x247366){if(_0x247366){return _0x247366[_0x6b01('0xc1')](_0x29e872['body'][_0x6b01('0xb8')],_['omit'](_0x29e872[_0x6b01('0x74')],[_0x6b01('0xb8'),'id'])||{})[_0x6b01('0xc2')](function(){return db[_0x6b01('0x6f')]['findAll']({'attributes':['id',_0x6b01('0x28'),_0x6b01('0xc3')],'where':{'id':_0x29e872[_0x6b01('0x74')][_0x6b01('0xb8')]}});})[_0x6b01('0x25')](function(_0xc1275a){socket[_0x6b01('0xc4')](_0x6b01('0xc5'),{'id':Number(_0x29e872[_0x6b01('0xb0')]['id']),'tags':_0xc1275a||[]});return{'id':Number(_0x29e872[_0x6b01('0xb0')]['id']),'tags':_0xc1275a||[]};});}})[_0x6b01('0x25')](respondWithResult(_0xcf4892,null))[_0x6b01('0x31')](handleError(_0xcf4892,null));};exports[_0x6b01('0xc6')]=function(_0x464ba8,_0x1d9932,_0x4de7f0){return db[_0x6b01('0x3a')][_0x6b01('0x73')]({'where':{'id':_0x464ba8['params']['id']}})[_0x6b01('0x25')](handleEntityNotFound(_0x1d9932,null))['then'](function(_0x5db4fb){if(_0x5db4fb){return _0x5db4fb[_0x6b01('0xc6')](_0x464ba8[_0x6b01('0x3e')]['ids']);}})[_0x6b01('0x25')](respondWithStatusCode(_0x1d9932,null))[_0x6b01('0x31')](handleError(_0x1d9932,null));};exports['download']=function(_0x29d5ca,_0x2a8963){var _0x2ac9d9=moment()[_0x6b01('0xc7')]()[_0x6b01('0x97')]();var _0x41a6e4=path[_0x6b01('0xc8')](config[_0x6b01('0xc9')],_0x6b01('0xca'),_0x6b01('0xcb'),_0x6b01('0xcc'));var _0x3d0db1=path[_0x6b01('0xc8')](config[_0x6b01('0xc9')],_0x6b01('0xca'),_0x6b01('0xcb'),_0x6b01('0xcd'));var _0x20a24b=path[_0x6b01('0xc8')](_0x41a6e4,_0x2ac9d9);var _0x13345b=util[_0x6b01('0xbd')]('transcript-%d-%s.zip',_0x29d5ca['params']['id'],_0x2ac9d9);var _0xe1d0cd=path[_0x6b01('0xc8')](_0x41a6e4,_0x13345b);var _0x5f1a5f=[];_0x5f1a5f[_0x6b01('0x30')]({'model':db[_0x6b01('0x72')],'as':_0x6b01('0x72'),'attributes':['id','fullname'],'raw':!![]});_0x5f1a5f[_0x6b01('0x30')]({'model':db[_0x6b01('0xce')],'as':'Contact','attributes':['id',_0x6b01('0xcf'),'lastName'],'raw':!![]});if(_0x29d5ca['query']['attachments']){_0x5f1a5f['push']({'model':db[_0x6b01('0xd0')],'as':_0x6b01('0xd0'),'raw':!![]});}var _0x2c5bba=[{'model':db[_0x6b01('0xba')],'as':_0x6b01('0xd1'),'attributes':['id',_0x6b01('0x74'),'createdAt',_0x6b01('0xd2'),_0x6b01('0xd3'),_0x6b01('0x7d')],'include':_0x5f1a5f}];_0x2c5bba[_0x6b01('0x30')]({'model':db[_0x6b01('0xd4')],'as':_0x6b01('0xd5'),'attributes':['id',_0x6b01('0x28')]});_0x2c5bba[_0x6b01('0x30')]({'model':db[_0x6b01('0x72')],'as':_0x6b01('0xd6'),'attributes':['id',_0x6b01('0x2b')]});return db[_0x6b01('0x3a')][_0x6b01('0x73')]({'where':{'id':_0x29d5ca[_0x6b01('0xb0')]['id']},'include':_0x2c5bba})[_0x6b01('0x25')](handleEntityNotFound(_0x2a8963,null))['then'](function(_0x24d121){if(_0x24d121){var _0x3bddd7=_0x24d121[_0x6b01('0xd7')]({'plain':!![]});fs[_0x6b01('0xd8')](_0x20a24b);var _0x4c03bc={'channel':'Openchannel','account':_0x3bddd7['Account'][_0x6b01('0x28')],'agent':_0x3bddd7[_0x6b01('0xd6')]?_0x3bddd7[_0x6b01('0xd6')][_0x6b01('0x2b')]:_0x6b01('0xd9'),'createdAt':moment(_0x3bddd7[_0x6b01('0xda')])[_0x6b01('0xbd')](_0x6b01('0xbe'))[_0x6b01('0x97')](),'closedAt':_0x3bddd7[_0x6b01('0x37')]?moment(_0x3bddd7[_0x6b01('0xdb')])['format'](_0x6b01('0xbe'))[_0x6b01('0x97')]():'','disposition':_0x3bddd7[_0x6b01('0xdc')],'visibility':_0x3bddd7[_0x6b01('0xdd')]?_0x6b01('0xde'):_0x6b01('0xdf'),'messages':_(_0x3bddd7[_0x6b01('0xd1')])[_0x6b01('0x80')]({'secret':![]})[_0x6b01('0x2a')](function(_0x28b266){if(_0x28b266['Attachment']){var _0x3cd5bb=path['join'](_0x3d0db1,_0x28b266[_0x6b01('0xd0')][_0x6b01('0xe0')]);if(fs[_0x6b01('0xe1')](_0x3cd5bb)){fs[_0x6b01('0xe2')](_0x3cd5bb)[_0x6b01('0xe3')](fs[_0x6b01('0xe4')](path[_0x6b01('0xc8')](_0x20a24b,_0x28b266['Attachment'][_0x6b01('0xe0')])));}}return{'date':moment(_0x28b266[_0x6b01('0xda')])['format'](_0x6b01('0xbe'))[_0x6b01('0x97')](),'sender':_0x28b266[_0x6b01('0xd2')]==='out'?_0x28b266['User']?_0x28b266[_0x6b01('0x72')][_0x6b01('0x2b')]:'System':_0x28b266[_0x6b01('0x65')][_0x6b01('0xcf')]+(_0x28b266[_0x6b01('0x65')]['lastName']?'\x20'+_0x28b266[_0x6b01('0x65')]['lastName']:''),'body':_0x28b266['Attachment']?_0x28b266['Attachment'][_0x6b01('0xe0')]:_0x28b266[_0x6b01('0x74')],'direction':_0x28b266['direction']==='out'?'A':'C','secret':_0x28b266[_0x6b01('0xd3')],'read':_0x28b266[_0x6b01('0x7d')],'attachment':_0x28b266['Attachment']};})['value']()};return ejs[_0x6b01('0xe5')](path[_0x6b01('0xc8')](config[_0x6b01('0xc9')],_0x6b01('0xca'),'views','downloadInteraction.ejs'),{'interaction':_0x4c03bc})[_0x6b01('0x25')](function(_0x2c75a6){var _0x5a2147=path[_0x6b01('0xc8')](_0x20a24b,_0x6b01('0xe6')+_0x3bddd7['id']+'-'+_0x2ac9d9+_0x6b01('0xe7'));var _0x16e526={'path':_0x5a2147,'channel':_0x6b01('0xe8'),'interactionId':_0x3bddd7['id']};return pdf[_0x6b01('0xe9')](_0x2c75a6,_0x16e526);})['then'](function(){return new BPromise(function(_0x28869e,_0xa8f74d){zipdir(_0x20a24b,{'saveTo':_0xe1d0cd},function(_0x4f0bb8,_0x33afa6){if(_0x4f0bb8)return _0xa8f74d(_0x4f0bb8);return _0x28869e(_0x33afa6);});})[_0x6b01('0x25')](function(){return new BPromise(function(_0x2aa8e3,_0x258d8f){rimraf(_0x20a24b,function(_0x231a99){if(_0x231a99)_0x258d8f(_0x231a99);return _0x2aa8e3();});});})['then'](function(){return _0x2a8963[_0x6b01('0xea')](_0xe1d0cd,_0x13345b,function(_0x532214){if(_0x532214){console[_0x6b01('0xeb')]('err',_0x532214);}else{fs['unlinkSync'](_0xe1d0cd);}});});});}else{return _0x2a8963['sendStatus'](0xc8);}})['catch'](handleError(_0x2a8963,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index caa777b..602a512 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 _0xd532=['map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','save','update','getUsers','then','setDataValue','Users'];(function(_0x295ff0,_0x133c36){var _0x5a219c=function(_0x967a4c){while(--_0x967a4c){_0x295ff0['push'](_0x295ff0['shift']());}};_0x5a219c(++_0x133c36);}(_0xd532,0x15c));var _0x2d53=function(_0xd296b2,_0x27ef8a){_0xd296b2=_0xd296b2-0x0;var _0xf05c77=_0xd532[_0xd296b2];return _0xf05c77;};'use strict';var EventEmitter=require(_0x2d53('0x0'));var OpenchannelInteraction=require(_0x2d53('0x1'))['db'][_0x2d53('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d53('0x3'),'afterUpdate':_0x2d53('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f1b9a){return function(_0x8d778a,_0x125f1b,_0x3f4a2a){_0x8d778a[_0x2d53('0x5')]({'attributes':['id'],'raw':!![]})[_0x2d53('0x6')](function(_0x60a7ae){_0x8d778a[_0x2d53('0x7')](_0x2d53('0x8'),_0x60a7ae[_0x2d53('0x9')](function(_0x193d3e){return{'id':_0x193d3e['id']};}));return OpenchannelMessage[_0x2d53('0xa')]({'where':{'OpenchannelInteractionId':_0x8d778a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2d53('0x6')](function(_0x4c9dd8){_0x8d778a[_0x2d53('0x7')](_0x2d53('0xb'),_0x4c9dd8['length']);OpenchannelInteractionEvents[_0x2d53('0xc')](_0x3f1b9a+':'+_0x8d778a['id'],_0x8d778a);OpenchannelInteractionEvents[_0x2d53('0xc')](_0x3f1b9a,_0x8d778a);_0x3f4a2a(null);})[_0x2d53('0xd')](_0x3f4a2a(null));};}for(var e in events){if(events[_0x2d53('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x2d53('0xf')](e,emitEvent(event));}}module[_0x2d53('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5b57=['remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x280b40,_0x422cb9){var _0x34fe2f=function(_0x3917f0){while(--_0x3917f0){_0x280b40['push'](_0x280b40['shift']());}};_0x34fe2f(++_0x422cb9);}(_0x5b57,0xc6));var _0x75b5=function(_0x3637ea,_0x2dd8fd){_0x3637ea=_0x3637ea-0x0;var _0x11c182=_0x5b57[_0x3637ea];return _0x11c182;};'use strict';var EventEmitter=require(_0x75b5('0x0'));var OpenchannelInteraction=require(_0x75b5('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x75b5('0x1'))['db'][_0x75b5('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x75b5('0x3')](0x0);var events={'afterCreate':_0x75b5('0x4'),'afterUpdate':_0x75b5('0x5'),'afterDestroy':_0x75b5('0x6')};function emitEvent(_0x182608){return function(_0x31b407,_0x5ca050,_0x4b1936){_0x31b407[_0x75b5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f473c){_0x31b407['setDataValue'](_0x75b5('0x8'),_0x3f473c[_0x75b5('0x9')](function(_0x57ffb3){return{'id':_0x57ffb3['id']};}));return OpenchannelMessage[_0x75b5('0xa')]({'where':{'OpenchannelInteractionId':_0x31b407['id'],'direction':'in','read':![]},'raw':!![]});})[_0x75b5('0xb')](function(_0x227644){_0x31b407[_0x75b5('0xc')](_0x75b5('0xd'),_0x227644[_0x75b5('0xe')]);OpenchannelInteractionEvents[_0x75b5('0xf')](_0x182608+':'+_0x31b407['id'],_0x31b407);OpenchannelInteractionEvents[_0x75b5('0xf')](_0x182608,_0x31b407);_0x4b1936(null);})['catch'](_0x4b1936(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x75b5('0x10')](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 aa16da7..d030e7b 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 _0x9ec0=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x9ec0,0x1b9));var _0x09ec=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0x9ec0[_0x1a5eb0];return _0x30f9ba;};'use strict';var _=require(_0x09ec('0x0'));var util=require(_0x09ec('0x1'));var logger=require(_0x09ec('0x2'))(_0x09ec('0x3'));var moment=require(_0x09ec('0x4'));var BPromise=require(_0x09ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x09ec('0x6'));var config=require(_0x09ec('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x09ec('0x8')]=function(_0x427940,_0x1ab080){return _0x427940[_0x09ec('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x09ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09ec('0xb'),'collate':_0x09ec('0xc'),'hooks':{'beforeUpdate':function(_0x3b689d,_0x12a43d,_0x4c8878){if(_0x3b689d[_0x09ec('0xd')](_0x09ec('0xe'))){_0x3b689d['closedAt']=moment()[_0x09ec('0xf')](_0x09ec('0x10'));}_0x4c8878(null,_0x3b689d);}}});}; \ No newline at end of file +var _0xe617=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2e361a,_0x18e83a){var _0x45c0dc=function(_0x205004){while(--_0x205004){_0x2e361a['push'](_0x2e361a['shift']());}};_0x45c0dc(++_0x18e83a);}(_0xe617,0x17c));var _0x7e61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe617[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7e61('0x0'));var util=require(_0x7e61('0x1'));var logger=require(_0x7e61('0x2'))(_0x7e61('0x3'));var moment=require(_0x7e61('0x4'));var BPromise=require(_0x7e61('0x5'));var rp=require(_0x7e61('0x6'));var fs=require('fs');var path=require(_0x7e61('0x7'));var rimraf=require(_0x7e61('0x8'));var config=require(_0x7e61('0x9'));var attributes=require(_0x7e61('0xa'));module[_0x7e61('0xb')]=function(_0x281715,_0x122e31){return _0x281715[_0x7e61('0xc')]('OpenchannelInteraction',attributes,{'tableName':_0x7e61('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e61('0xe'),'collate':_0x7e61('0xf'),'hooks':{'beforeUpdate':function(_0x3c500f,_0x502bc6,_0x317ae5){if(_0x3c500f['changed'](_0x7e61('0x10'))){_0x3c500f['closedAt']=moment()[_0x7e61('0x11')](_0x7e61('0x12'));}_0x317ae5(null,_0x3c500f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 42dbfe1..a83b501 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 _0x4966=['addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UpdateOpenchannelInteraction','update','body','options','where','attributes','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction'];(function(_0x4e7962,_0x4269fd){var _0x2a79f0=function(_0x49dcb2){while(--_0x49dcb2){_0x4e7962['push'](_0x4e7962['shift']());}};_0x2a79f0(++_0x4269fd);}(_0x4966,0x146));var _0x6496=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x4966[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0x6496('0x0'));var util=require(_0x6496('0x1'));var moment=require(_0x6496('0x2'));var BPromise=require(_0x6496('0x3'));var rs=require(_0x6496('0x4'));var fs=require('fs');var Redis=require(_0x6496('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6496('0x6'));var logger=require(_0x6496('0x7'))(_0x6496('0x8'));var config=require(_0x6496('0x9'));var jayson=require(_0x6496('0xa'));var client=jayson[_0x6496('0xb')]['http']({'port':0x232a});config[_0x6496('0xc')]=_['defaults'](config[_0x6496('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6496('0xd'))(new Redis(config['redis']));require(_0x6496('0xe'))[_0x6496('0xf')](socket);function respondWithRpcPromise(_0xac329f,_0x1abf34,_0x516dd1){return new BPromise(function(_0x5bc44a,_0x17c2bb){return client[_0x6496('0x10')](_0xac329f,_0x516dd1)[_0x6496('0x11')](function(_0x5b254d){logger[_0x6496('0x12')](_0x6496('0x13'),_0x1abf34,'request\x20sent');logger['debug'](_0x6496('0x14'),_0x1abf34,_0x6496('0x15'),JSON[_0x6496('0x16')](_0x5b254d));if(_0x5b254d[_0x6496('0x17')]){if(_0x5b254d['error']['code']===0x1f4){logger[_0x6496('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1abf34,_0x5b254d['error'][_0x6496('0x18')]);return _0x17c2bb(_0x5b254d[_0x6496('0x17')][_0x6496('0x18')]);}logger[_0x6496('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1abf34,_0x5b254d[_0x6496('0x17')][_0x6496('0x18')]);return _0x5bc44a(_0x5b254d[_0x6496('0x17')][_0x6496('0x18')]);}else{logger['info'](_0x6496('0x13'),_0x1abf34,_0x6496('0x15'));_0x5bc44a(_0x5b254d['result'][_0x6496('0x18')]);}})['catch'](function(_0x29ba7c){logger[_0x6496('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1abf34,_0x29ba7c);_0x17c2bb(_0x29ba7c);});});}exports[_0x6496('0x19')]=function(_0x460827){var _0x2798c0=this;return new Promise(function(_0x4f740f,_0x5472f2){return db['OpenchannelInteraction'][_0x6496('0x1a')](_0x460827[_0x6496('0x1b')],{'raw':_0x460827[_0x6496('0x1c')]?_0x460827[_0x6496('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x460827[_0x6496('0x1c')]?_0x460827[_0x6496('0x1c')][_0x6496('0x1d')]||null:null,'attributes':_0x460827['options']?_0x460827[_0x6496('0x1c')][_0x6496('0x1e')]||null:null,'limit':_0x460827[_0x6496('0x1c')]?_0x460827[_0x6496('0x1c')]['limit']||null:null})[_0x6496('0x11')](function(_0x3f7fd8){logger[_0x6496('0x12')](_0x6496('0x19'),_0x460827);logger[_0x6496('0x1f')](_0x6496('0x19'),_0x460827,JSON[_0x6496('0x16')](_0x3f7fd8));_0x4f740f(_0x3f7fd8);})['catch'](function(_0x2944fe){logger[_0x6496('0x17')](_0x6496('0x19'),_0x2944fe[_0x6496('0x18')],_0x460827);_0x5472f2(_0x2798c0[_0x6496('0x17')](0x1f4,_0x2944fe['message']));});});};exports[_0x6496('0x20')]=function(_0x1055e1){return new Promise(function(_0xa587cb,_0x540905){return db[_0x6496('0x21')]['find']({'where':_0x1055e1[_0x6496('0x1c')]?_0x1055e1[_0x6496('0x1c')][_0x6496('0x1d')]||null:null})['then'](function(_0x1581ee){if(_0x1581ee){return _0x1581ee[_0x6496('0x22')](_0x1055e1[_0x6496('0x1b')][_0x6496('0x23')],_[_0x6496('0x24')](_0x1055e1[_0x6496('0x1b')],[_0x6496('0x23'),'id'])||{});}})[_0x6496('0x25')](function(_0x591f2b){logger[_0x6496('0x12')](_0x6496('0x26'),_0x1055e1);logger[_0x6496('0x1f')]('AddTags',_0x1055e1,JSON['stringify'](_0x591f2b));_0xa587cb(_0x591f2b);})[_0x6496('0x27')](function(_0x55485e){logger['error'](_0x6496('0x26'),_0x55485e[_0x6496('0x18')],_0x1055e1);_0x540905(_this[_0x6496('0x17')](0x1f4,_0x55485e['message']));});});}; \ No newline at end of file +var _0xe950=['OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','attributes','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis','./openchannelInteraction.socket','request','then'];(function(_0x1879e0,_0xd45c1a){var _0x17c40f=function(_0x9844d5){while(--_0x9844d5){_0x1879e0['push'](_0x1879e0['shift']());}};_0x17c40f(++_0xd45c1a);}(_0xe950,0x6d));var _0x0e95=function(_0x4f1d28,_0x4cc061){_0x4f1d28=_0x4f1d28-0x0;var _0x4bb7c3=_0xe950[_0x4f1d28];return _0x4bb7c3;};'use strict';var _=require(_0x0e95('0x0'));var util=require(_0x0e95('0x1'));var moment=require(_0x0e95('0x2'));var BPromise=require(_0x0e95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e95('0x4'))['db'];var utils=require(_0x0e95('0x5'));var logger=require(_0x0e95('0x6'))(_0x0e95('0x7'));var config=require(_0x0e95('0x8'));var jayson=require(_0x0e95('0x9'));var client=jayson['client'][_0x0e95('0xa')]({'port':0x232a});config['redis']=_[_0x0e95('0xb')](config['redis'],{'host':_0x0e95('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e95('0xd')]));require(_0x0e95('0xe'))['register'](socket);function respondWithRpcPromise(_0x4575fa,_0x513805,_0x4fb95e){return new BPromise(function(_0x5c9c33,_0xb09800){return client[_0x0e95('0xf')](_0x4575fa,_0x4fb95e)[_0x0e95('0x10')](function(_0x84c9ab){logger['info'](_0x0e95('0x11'),_0x513805,_0x0e95('0x12'));logger[_0x0e95('0x13')](_0x0e95('0x14'),_0x513805,_0x0e95('0x12'),JSON[_0x0e95('0x15')](_0x84c9ab));if(_0x84c9ab['error']){if(_0x84c9ab[_0x0e95('0x16')][_0x0e95('0x17')]===0x1f4){logger[_0x0e95('0x16')](_0x0e95('0x11'),_0x513805,_0x84c9ab[_0x0e95('0x16')]['message']);return _0xb09800(_0x84c9ab[_0x0e95('0x16')][_0x0e95('0x18')]);}logger[_0x0e95('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x513805,_0x84c9ab[_0x0e95('0x16')][_0x0e95('0x18')]);return _0x5c9c33(_0x84c9ab['error'][_0x0e95('0x18')]);}else{logger[_0x0e95('0x19')](_0x0e95('0x11'),_0x513805,'request\x20sent');_0x5c9c33(_0x84c9ab[_0x0e95('0x1a')][_0x0e95('0x18')]);}})[_0x0e95('0x1b')](function(_0x157f1a){logger[_0x0e95('0x16')](_0x0e95('0x11'),_0x513805,_0x157f1a);_0xb09800(_0x157f1a);});});}exports[_0x0e95('0x1c')]=function(_0x47f200){var _0x27a503=this;return new Promise(function(_0x446a43,_0x4ac347){return db[_0x0e95('0x1d')][_0x0e95('0x1e')](_0x47f200['body'],{'raw':_0x47f200[_0x0e95('0x1f')]?_0x47f200['options'][_0x0e95('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47f200[_0x0e95('0x1f')]?_0x47f200[_0x0e95('0x1f')]['where']||null:null,'attributes':_0x47f200['options']?_0x47f200[_0x0e95('0x1f')][_0x0e95('0x21')]||null:null,'limit':_0x47f200[_0x0e95('0x1f')]?_0x47f200[_0x0e95('0x1f')]['limit']||null:null})[_0x0e95('0x10')](function(_0x592a4a){logger[_0x0e95('0x19')](_0x0e95('0x1c'),_0x47f200);logger['debug'](_0x0e95('0x1c'),_0x47f200,JSON['stringify'](_0x592a4a));_0x446a43(_0x592a4a);})[_0x0e95('0x1b')](function(_0x5095e2){logger['error']('UpdateOpenchannelInteraction',_0x5095e2[_0x0e95('0x18')],_0x47f200);_0x4ac347(_0x27a503[_0x0e95('0x16')](0x1f4,_0x5095e2[_0x0e95('0x18')]));});});};exports[_0x0e95('0x22')]=function(_0x287cb4){return new Promise(function(_0xf174fa,_0x1bfccf){return db[_0x0e95('0x1d')][_0x0e95('0x23')]({'where':_0x287cb4[_0x0e95('0x1f')]?_0x287cb4[_0x0e95('0x1f')]['where']||null:null})[_0x0e95('0x10')](function(_0x534566){if(_0x534566){return _0x534566[_0x0e95('0x24')](_0x287cb4[_0x0e95('0x25')][_0x0e95('0x26')],_[_0x0e95('0x27')](_0x287cb4[_0x0e95('0x25')],[_0x0e95('0x26'),'id'])||{});}})[_0x0e95('0x28')](function(_0xd5d99f){logger[_0x0e95('0x19')](_0x0e95('0x29'),_0x287cb4);logger[_0x0e95('0x13')](_0x0e95('0x29'),_0x287cb4,JSON[_0x0e95('0x15')](_0xd5d99f));_0xf174fa(_0xd5d99f);})[_0x0e95('0x1b')](function(_0x180b15){logger[_0x0e95('0x16')](_0x0e95('0x29'),_0x180b15['message'],_0x287cb4);_0x1bfccf(_this[_0x0e95('0x16')](0x1f4,_0x180b15[_0x0e95('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 4871d76..d131956 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 _0x94b8=['length','openchannelInteraction:','./openchannelInteraction.events','save','update','emit','removeListener'];(function(_0x38ff2b,_0x3a0316){var _0x341f5e=function(_0x346368){while(--_0x346368){_0x38ff2b['push'](_0x38ff2b['shift']());}};_0x341f5e(++_0x3a0316);}(_0x94b8,0x80));var _0x894b=function(_0x445656,_0x4ba170){_0x445656=_0x445656-0x0;var _0x5a6e5d=_0x94b8[_0x445656];return _0x5a6e5d;};'use strict';var OpenchannelInteractionEvents=require(_0x894b('0x0'));var events=[_0x894b('0x1'),'remove',_0x894b('0x2')];function createListener(_0x41916f,_0x3dd75d){return function(_0x2bdd1b){_0x3dd75d[_0x894b('0x3')](_0x41916f,_0x2bdd1b);};}function removeListener(_0x5d394c,_0x197a42){return function(){OpenchannelInteractionEvents[_0x894b('0x4')](_0x5d394c,_0x197a42);};}exports['register']=function(_0x449940){for(var _0x4eaec0=0x0,_0x285f77=events[_0x894b('0x5')];_0x4eaec0<_0x285f77;_0x4eaec0++){var _0x1316c6=events[_0x4eaec0];var _0x26eb78=createListener(_0x894b('0x6')+_0x1316c6,_0x449940);OpenchannelInteractionEvents['on'](_0x1316c6,_0x26eb78);}}; \ No newline at end of file +var _0x8eb7=['update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x1b0fd2,_0x8461d3){var _0x447bd5=function(_0x33ce9f){while(--_0x33ce9f){_0x1b0fd2['push'](_0x1b0fd2['shift']());}};_0x447bd5(++_0x8461d3);}(_0x8eb7,0x95));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0x78eb('0x0'));var events=[_0x78eb('0x1'),_0x78eb('0x2'),_0x78eb('0x3')];function createListener(_0x3446d6,_0x3f6ff2){return function(_0x35e089){_0x3f6ff2[_0x78eb('0x4')](_0x3446d6,_0x35e089);};}function removeListener(_0x2a65c0,_0x4216a2){return function(){OpenchannelInteractionEvents[_0x78eb('0x5')](_0x2a65c0,_0x4216a2);};}exports[_0x78eb('0x6')]=function(_0x3189b8){for(var _0xe7f59=0x0,_0x3af2c7=events['length'];_0xe7f59<_0x3af2c7;_0xe7f59++){var _0x24cd54=events[_0xe7f59];var _0x1ea242=createListener(_0x78eb('0x7')+_0x24cd54,_0x3189b8);OpenchannelInteractionEvents['on'](_0x24cd54,_0x1ea242);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 234cc0a..a5787c4 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0xcb91[_0x2a4095];return _0x52eeab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x427386,_0x5f5229){var _0x418313=function(_0x201879){while(--_0x201879){_0x427386['push'](_0x427386['shift']());}};_0x418313(++_0x5f5229);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 18ce4e0..6149610 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 _0x93e9=['BOOLEAN','ENUM','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x7aff93,_0x548677){var _0x2f27c8=function(_0x2a81b4){while(--_0x2a81b4){_0x7aff93['push'](_0x7aff93['shift']());}};_0x2f27c8(++_0x548677);}(_0x93e9,0xcc));var _0x993e=function(_0x5a4c73,_0x1fb644){_0x5a4c73=_0x5a4c73-0x0;var _0x4f6f42=_0x93e9[_0x5a4c73];return _0x4f6f42;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'body':{'type':Sequelize[_0x993e('0x2')](_0x993e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x993e('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x993e('0x6')]},'providerName':{'type':Sequelize[_0x993e('0x7')]},'providerResponse':{'type':Sequelize[_0x993e('0x2')]}}; \ No newline at end of file +var _0xcf66=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x565b93,_0x537e27){var _0x15c9f1=function(_0x1f8a27){while(--_0x1f8a27){_0x565b93['push'](_0x565b93['shift']());}};_0x15c9f1(++_0x537e27);}(_0xcf66,0x71));var _0x6cf6=function(_0x4d6c86,_0x51f230){_0x4d6c86=_0x4d6c86-0x0;var _0x192e54=_0xcf66[_0x4d6c86];return _0x192e54;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'body':{'type':Sequelize[_0x6cf6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6cf6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6cf6('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6cf6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6cf6('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2dbb10b..91d3a28 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 _0xbb1a=['filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','contact','email','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys'];(function(_0x1b69aa,_0x5aa147){var _0x42647d=function(_0x1743fd){while(--_0x1743fd){_0x1b69aa['push'](_0x1b69aa['shift']());}};_0x42647d(++_0x5aa147);}(_0xbb1a,0x14c));var _0xabb1=function(_0x3da921,_0x23b768){_0x3da921=_0x3da921-0x0;var _0x434990=_0xbb1a[_0x3da921];return _0x434990;};'use strict';var emlformat=require(_0xabb1('0x0'));var rimraf=require(_0xabb1('0x1'));var zipdir=require(_0xabb1('0x2'));var jsonpatch=require(_0xabb1('0x3'));var rp=require('request-promise');var moment=require(_0xabb1('0x4'));var BPromise=require(_0xabb1('0x5'));var Mustache=require('mustache');var util=require(_0xabb1('0x6'));var path=require(_0xabb1('0x7'));var sox=require(_0xabb1('0x8'));var csv=require('to-csv');var ejs=require(_0xabb1('0x9'));var fs=require('fs');var fs_extra=require(_0xabb1('0xa'));var _=require(_0xabb1('0xb'));var squel=require(_0xabb1('0xc'));var crypto=require(_0xabb1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabb1('0xe'));var toCsv=require(_0xabb1('0xf'));var querystring=require(_0xabb1('0x10'));var Papa=require(_0xabb1('0x11'));var Redis=require('ioredis');var authService=require(_0xabb1('0x12'));var qs=require(_0xabb1('0x13'));var as=require(_0xabb1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabb1('0x15'))(_0xabb1('0x16'));var utils=require(_0xabb1('0x17'));var config=require(_0xabb1('0x18'));var licenseUtil=require(_0xabb1('0x19'));var db=require(_0xabb1('0x1a'))['db'];config['redis']=_[_0xabb1('0x1b')](config[_0xabb1('0x1c')],{'host':_0xabb1('0x1d'),'port':0x18eb});var socket=require(_0xabb1('0x1e'))(new Redis(config[_0xabb1('0x1c')]));require('./openchannelMessage.socket')[_0xabb1('0x1f')](socket);var jayson=require(_0xabb1('0x20'));var client=jayson[_0xabb1('0x21')][_0xabb1('0x22')]({'port':0x232c});var client9002=jayson[_0xabb1('0x21')][_0xabb1('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2a66e3,_0x1f4c25,_0x74ae80,_0x487926){return new BPromise(function(_0x41a207,_0x34e136){var _0x456b62=_0x487926||client;return _0x456b62[_0xabb1('0x23')](_0x2a66e3,_0x74ae80)['then'](function(_0x1b079b){logger[_0xabb1('0x24')](_0xabb1('0x25'),_0x1f4c25,_0xabb1('0x26'));logger['debug'](_0xabb1('0x27'),_0x1f4c25,_0xabb1('0x26'),JSON[_0xabb1('0x28')](_0x1b079b));if(_0x1b079b[_0xabb1('0x29')]){if(_0x1b079b[_0xabb1('0x29')][_0xabb1('0x2a')]===0x1f4){logger[_0xabb1('0x29')](_0xabb1('0x25'),_0x1f4c25,_0x1b079b[_0xabb1('0x29')][_0xabb1('0x2b')]);return _0x34e136(_0x1b079b['error']['message']);}logger[_0xabb1('0x29')](_0xabb1('0x25'),_0x1f4c25,_0x1b079b[_0xabb1('0x29')][_0xabb1('0x2b')]);return _0x41a207(_0x1b079b[_0xabb1('0x29')][_0xabb1('0x2b')]);}else{logger[_0xabb1('0x24')](_0xabb1('0x25'),_0x1f4c25,_0xabb1('0x26'));_0x41a207(_0x1b079b[_0xabb1('0x2c')][_0xabb1('0x2b')]);}})['catch'](function(_0x1730bc){logger[_0xabb1('0x29')](_0xabb1('0x25'),_0x1f4c25,_0x1730bc);_0x34e136(_0x1730bc);});});}function respondWithStatusCode(_0x1b9af2,_0x3302f3){_0x3302f3=_0x3302f3||0xcc;return function(_0x39cf3f){if(_0x39cf3f){return _0x1b9af2[_0xabb1('0x2d')](_0x3302f3);}return _0x1b9af2['status'](_0x3302f3)[_0xabb1('0x2e')]();};}function respondWithResult(_0xfd3e6e,_0x25c086){_0x25c086=_0x25c086||0xc8;return function(_0xdad627){if(_0xdad627){return _0xfd3e6e[_0xabb1('0x2f')](_0x25c086)[_0xabb1('0x30')](_0xdad627);}};}function respondWithFilteredResult(_0x5d2560,_0xaea962){return function(_0x542c9a){if(_0x542c9a){var _0x5e14d2=typeof _0xaea962[_0xabb1('0x31')]===_0xabb1('0x32')&&typeof _0xaea962[_0xabb1('0x33')]===_0xabb1('0x32');var _0x18aba0=_0x542c9a['count'];var _0x1c0aa5=_0x5e14d2?0x0:_0xaea962[_0xabb1('0x31')];var _0x33d8d1=_0x5e14d2?_0x542c9a[_0xabb1('0x34')]:_0xaea962['offset']+_0xaea962[_0xabb1('0x33')];var _0x430855;if(_0x33d8d1>=_0x18aba0){_0x33d8d1=_0x18aba0;_0x430855=0xc8;}else{_0x430855=0xce;}_0x5d2560[_0xabb1('0x2f')](_0x430855);return _0x5d2560[_0xabb1('0x35')](_0xabb1('0x36'),_0x1c0aa5+'-'+_0x33d8d1+'/'+_0x18aba0)[_0xabb1('0x30')](_0x542c9a);}return null;};}function patchUpdates(_0x297e0b){return function(_0x4e27a7){try{jsonpatch[_0xabb1('0x37')](_0x4e27a7,_0x297e0b,!![]);}catch(_0x1391be){return BPromise[_0xabb1('0x38')](_0x1391be);}return _0x4e27a7[_0xabb1('0x39')]();};}function saveUpdates(_0x5b4cd8,_0x387e40){return function(_0x381a54){if(_0x381a54){return _0x381a54[_0xabb1('0x3a')](_0x5b4cd8)['then'](function(_0x56a5cb){return _0x56a5cb;});}return null;};}function removeEntity(_0x27a736,_0x2aebf8){return function(_0x34ac8d){if(_0x34ac8d){return _0x34ac8d[_0xabb1('0x3b')]()[_0xabb1('0x3c')](function(){_0x27a736['status'](0xcc)[_0xabb1('0x2e')]();});}};}function handleEntityNotFound(_0x3552fb,_0x37bcd8){return function(_0x1dc8f3){if(!_0x1dc8f3){_0x3552fb[_0xabb1('0x2d')](0x194);}return _0x1dc8f3;};}function handleError(_0x367094,_0x51f113){_0x51f113=_0x51f113||0x1f4;return function(_0x1395f6){logger['error'](_0x1395f6[_0xabb1('0x3d')]);if(_0x1395f6['name']){delete _0x1395f6[_0xabb1('0x3e')];}_0x367094[_0xabb1('0x2f')](_0x51f113)[_0xabb1('0x3f')](_0x1395f6);};}exports[_0xabb1('0x40')]=function(_0x3e0951,_0x1cace4){var _0x2f405f={},_0x3a2aa3={},_0x24ee43={'count':0x0,'rows':[]};var _0x1b5af1=_[_0xabb1('0x41')](db[_0xabb1('0x42')][_0xabb1('0x43')],function(_0x3b1479){return{'name':_0x3b1479[_0xabb1('0x44')],'type':_0x3b1479[_0xabb1('0x45')]['key']};});_0x3a2aa3[_0xabb1('0x46')]=_[_0xabb1('0x41')](_0x1b5af1,_0xabb1('0x3e'));_0x3a2aa3[_0xabb1('0x47')]=_[_0xabb1('0x48')](_0x3e0951[_0xabb1('0x47')]);_0x3a2aa3[_0xabb1('0x49')]=_[_0xabb1('0x4a')](_0x3a2aa3[_0xabb1('0x46')],_0x3a2aa3[_0xabb1('0x47')]);_0x2f405f[_0xabb1('0x4b')]=_[_0xabb1('0x4a')](_0x3a2aa3[_0xabb1('0x46')],qs[_0xabb1('0x4c')](_0x3e0951[_0xabb1('0x47')]['fields']));_0x2f405f['attributes']=_0x2f405f[_0xabb1('0x4b')][_0xabb1('0x4d')]?_0x2f405f['attributes']:_0x3a2aa3['model'];if(!_0x3e0951['query']['hasOwnProperty']('nolimit')){_0x2f405f['limit']=qs[_0xabb1('0x33')](_0x3e0951[_0xabb1('0x47')][_0xabb1('0x33')]);_0x2f405f['offset']=qs[_0xabb1('0x31')](_0x3e0951[_0xabb1('0x47')][_0xabb1('0x31')]);}_0x2f405f['order']=qs[_0xabb1('0x4e')](_0x3e0951['query'][_0xabb1('0x4e')]);_0x2f405f[_0xabb1('0x4f')]=qs[_0xabb1('0x49')](_[_0xabb1('0x50')](_0x3e0951[_0xabb1('0x47')],_0x3a2aa3[_0xabb1('0x49')]),_0x1b5af1);if(_0x3e0951[_0xabb1('0x47')][_0xabb1('0x51')]){_0x2f405f[_0xabb1('0x4f')]=_[_0xabb1('0x52')](_0x2f405f[_0xabb1('0x4f')],{'$or':_[_0xabb1('0x41')](_0x1b5af1,function(_0x3beb62){if(_0x3beb62[_0xabb1('0x45')]!==_0xabb1('0x53')){var _0x11330f={};_0x11330f[_0x3beb62[_0xabb1('0x3e')]]={'$like':'%'+_0x3e0951[_0xabb1('0x47')][_0xabb1('0x51')]+'%'};return _0x11330f;}})});}_0x2f405f=_[_0xabb1('0x52')]({},_0x2f405f,_0x3e0951['options']);var _0x5c8b1a={'where':_0x2f405f[_0xabb1('0x4f')]};return db[_0xabb1('0x42')][_0xabb1('0x34')](_0x5c8b1a)['then'](function(_0x1045df){_0x24ee43[_0xabb1('0x34')]=_0x1045df;if(_0x3e0951[_0xabb1('0x47')][_0xabb1('0x54')]){_0x2f405f[_0xabb1('0x55')]=[{'all':!![]}];}return db[_0xabb1('0x42')][_0xabb1('0x56')](_0x2f405f);})[_0xabb1('0x3c')](function(_0x29e439){_0x24ee43[_0xabb1('0x57')]=_0x29e439;return _0x24ee43;})[_0xabb1('0x3c')](respondWithFilteredResult(_0x1cace4,_0x2f405f))[_0xabb1('0x58')](handleError(_0x1cace4,null));};exports[_0xabb1('0x59')]=function(_0x4022e3,_0x52eb44){var _0x16d209={'raw':!![],'where':{'id':_0x4022e3[_0xabb1('0x5a')]['id']}},_0x134787={};_0x134787[_0xabb1('0x46')]=_[_0xabb1('0x48')](db[_0xabb1('0x42')]['rawAttributes']);_0x134787[_0xabb1('0x47')]=_[_0xabb1('0x48')](_0x4022e3[_0xabb1('0x47')]);_0x134787[_0xabb1('0x49')]=_[_0xabb1('0x4a')](_0x134787[_0xabb1('0x46')],_0x134787[_0xabb1('0x47')]);_0x16d209[_0xabb1('0x4b')]=_[_0xabb1('0x4a')](_0x134787[_0xabb1('0x46')],qs[_0xabb1('0x4c')](_0x4022e3[_0xabb1('0x47')][_0xabb1('0x4c')]));_0x16d209[_0xabb1('0x4b')]=_0x16d209[_0xabb1('0x4b')][_0xabb1('0x4d')]?_0x16d209[_0xabb1('0x4b')]:_0x134787[_0xabb1('0x46')];if(_0x4022e3[_0xabb1('0x47')]['includeAll']){_0x16d209[_0xabb1('0x55')]=[{'all':!![]}];}_0x16d209=_['merge']({},_0x16d209,_0x4022e3[_0xabb1('0x5b')]);return db[_0xabb1('0x42')][_0xabb1('0x5c')](_0x16d209)[_0xabb1('0x3c')](handleEntityNotFound(_0x52eb44,null))[_0xabb1('0x3c')](respondWithResult(_0x52eb44,null))[_0xabb1('0x58')](handleError(_0x52eb44,null));};exports[_0xabb1('0x5d')]=function(_0x52fab4,_0x32b11a){return db[_0xabb1('0x42')][_0xabb1('0x5d')](_0x52fab4['body'],{})[_0xabb1('0x3c')](respondWithResult(_0x32b11a,0xc9))['catch'](handleError(_0x32b11a,null));};exports[_0xabb1('0x3a')]=function(_0x17d49b,_0x585c89){if(_0x17d49b[_0xabb1('0x5e')]['id']){delete _0x17d49b[_0xabb1('0x5e')]['id'];}return db[_0xabb1('0x42')][_0xabb1('0x5c')]({'where':{'id':_0x17d49b['params']['id']}})[_0xabb1('0x3c')](handleEntityNotFound(_0x585c89,null))['then'](saveUpdates(_0x17d49b[_0xabb1('0x5e')],null))[_0xabb1('0x3c')](respondWithResult(_0x585c89,null))[_0xabb1('0x58')](handleError(_0x585c89,null));};exports[_0xabb1('0x3b')]=function(_0x80788f,_0x1ecbea){return db[_0xabb1('0x42')][_0xabb1('0x5c')]({'where':{'id':_0x80788f[_0xabb1('0x5a')]['id']}})[_0xabb1('0x3c')](handleEntityNotFound(_0x1ecbea,null))[_0xabb1('0x3c')](removeEntity(_0x1ecbea,null))[_0xabb1('0x58')](handleError(_0x1ecbea,null));};exports['describe']=function(_0x3ba1ed,_0x188a8e){return db[_0xabb1('0x42')]['describe']()[_0xabb1('0x3c')](respondWithResult(_0x188a8e,null))['catch'](handleError(_0x188a8e,null));};var interaction_log=require(_0xabb1('0x15'))(_0xabb1('0x5f'));exports[_0xabb1('0x60')]=function(_0xe3f973,_0x124d45,_0x4910fb){var _0x4ba5c2={'agent':{},'channel':_0xabb1('0x61')};if(_0xe3f973[_0xabb1('0x5e')]['id']){delete _0xe3f973['body']['id'];}_0xe3f973[_0xabb1('0x5e')]['read']=!![];_0xe3f973[_0xabb1('0x5e')]['readAt']=moment()[_0xabb1('0x62')](_0xabb1('0x63'));_0xe3f973[_0xabb1('0x5e')]['UserId']=_0xe3f973[_0xabb1('0x5e')][_0xabb1('0x64')]||_0xe3f973[_0xabb1('0x65')]['id'];_0x4ba5c2[_0xabb1('0x66')]['id']=_0xe3f973[_0xabb1('0x5e')][_0xabb1('0x64')];return db[_0xabb1('0x42')][_0xabb1('0x5c')]({'where':{'id':_0xe3f973[_0xabb1('0x5a')]['id'],'UserId':null}})[_0xabb1('0x3c')](handleEntityNotFound(_0x124d45,null))[_0xabb1('0x3c')](saveUpdates(_0xe3f973[_0xabb1('0x5e')],null))[_0xabb1('0x3c')](function(_0x246c8d){if(_0x246c8d){_0x4ba5c2['message']=_0x246c8d[_0xabb1('0x67')]({'plain':!![]});return db[_0xabb1('0x68')][_0xabb1('0x5c')]({'where':{'id':_0x246c8d[_0xabb1('0x69')]}});}return null;})[_0xabb1('0x3c')](handleEntityNotFound(_0x124d45,null))[_0xabb1('0x3c')](function(_0x3386c7){if(_0x3386c7){return _0x3386c7[_0xabb1('0x3a')]({'UserId':_0xe3f973[_0xabb1('0x5e')][_0xabb1('0x64')],'read1stAt':_[_0xabb1('0x6a')](_0x3386c7[_0xabb1('0x6b')])?moment()[_0xabb1('0x62')](_0xabb1('0x63')):undefined});}return null;})['then'](function(_0x47ab70){if(_0x47ab70){_0x4ba5c2[_0xabb1('0x6c')]=_0x47ab70[_0xabb1('0x67')]({'plain':!![]});interaction_log[_0xabb1('0x24')](_0xabb1('0x6d'),_0xe3f973[_0xabb1('0x65')]['id'],_0xe3f973[_0xabb1('0x65')]['name'],_0xe3f973[_0xabb1('0x65')][_0xabb1('0x6e')],_0x4ba5c2[_0xabb1('0x6c')]['id'],_0xe3f973[_0xabb1('0x5e')]?JSON['stringify'](_0xe3f973[_0xabb1('0x5e')]):_0xabb1('0x6f'));return respondWithRpcPromise(_0xabb1('0x70'),_0xabb1('0x71'),_0x4ba5c2);}return null;})[_0xabb1('0x3c')](function(_0x301fcf){var _0x467122=_0xabb1('0x72')+_0x301fcf[_0xabb1('0x2b')]['ContactId'];return db[_0xabb1('0x73')]['query'](_0x467122,{'type':db[_0xabb1('0x74')][_0xabb1('0x75')]['SELECT'],'raw':!![]})[_0xabb1('0x3c')](function(_0x14e92f){return _0x14e92f;});})[_0xabb1('0x3c')](function(_0x4d62cb){if(_0x4d62cb){_0x4ba5c2[_0xabb1('0x2b')]['contact']=_0x4d62cb[0x0];if(!_0xe3f973[_0xabb1('0x5e')][_0xabb1('0x64')])return;return db[_0xabb1('0x76')]['find']({'where':{'id':_0xe3f973[_0xabb1('0x5e')]['UserId'],'role':_0xabb1('0x66')},'attributes':['id',_0xabb1('0x3e'),'fullname','email',_0xabb1('0x77')],'raw':!![]});}return null;})[_0xabb1('0x3c')](function(_0x348270){if(!_0x348270)return null;_0x4ba5c2[_0xabb1('0x2b')][_0xabb1('0x66')]=_0x348270;return _0x4ba5c2;})['then'](function(_0x250e5f){if(_0x250e5f){if(_0xe3f973['body'][_0xabb1('0x78')]){_0x4ba5c2[_0xabb1('0x2b')]['interface']=util[_0xabb1('0x62')](_0xabb1('0x79'),_0xe3f973[_0xabb1('0x65')][_0xabb1('0x3e')]);_0x4ba5c2[_0xabb1('0x2b')][_0xabb1('0x7a')]=_0x4ba5c2[_0xabb1('0x7a')];_0x4ba5c2[_0xabb1('0x2b')][_0xabb1('0x7b')]=_0x4ba5c2[_0xabb1('0x7a')];_0x4ba5c2[_0xabb1('0x2b')]['event']='accept';return respondWithRpcPromise('EventManager',_0xabb1('0x7c'),{'event':_0xabb1('0x7d'),'message':_0x4ba5c2['message']},client9002)[_0xabb1('0x3c')](function(){return _0x4ba5c2;});}return _0x4ba5c2;}return null;})[_0xabb1('0x3c')](respondWithResult(_0x124d45,null))[_0xabb1('0x58')](handleError(_0x124d45,null));};var interaction_log=require('../../config/logger')(_0xabb1('0x5f'));exports[_0xabb1('0x38')]=function(_0x13f792,_0x2c8b20,_0x400a15){var _0x3f06ff={'agent':{},'channel':_0xabb1('0x61')};if(_0x13f792['body']['id']){delete _0x13f792['body']['id'];}_0x13f792[_0xabb1('0x5e')][_0xabb1('0x64')]=_0x13f792['body']['UserId']||_0x13f792[_0xabb1('0x65')]['id'];_0x3f06ff[_0xabb1('0x66')]['id']=_0x13f792[_0xabb1('0x5e')][_0xabb1('0x64')];return db[_0xabb1('0x42')]['find']({'where':{'id':_0x13f792[_0xabb1('0x5a')]['id'],'UserId':null}})[_0xabb1('0x3c')](handleEntityNotFound(_0x2c8b20,null))[_0xabb1('0x3c')](function(_0x59c8fc){if(_0x59c8fc){_0x3f06ff['message']=_0x59c8fc['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x59c8fc[_0xabb1('0x69')]}});}return null;})[_0xabb1('0x3c')](handleEntityNotFound(_0x2c8b20,null))['then'](function(_0x4671b4){if(_0x4671b4){_0x3f06ff[_0xabb1('0x6c')]=_0x4671b4[_0xabb1('0x67')]({'plain':!![]});interaction_log[_0xabb1('0x24')](_0xabb1('0x7e'),_0x13f792[_0xabb1('0x65')]['id'],_0x13f792['user']['name'],_0x13f792['user'][_0xabb1('0x6e')],_0x3f06ff[_0xabb1('0x6c')]['id'],_0x13f792[_0xabb1('0x5e')]?JSON['stringify'](_0x13f792[_0xabb1('0x5e')]):_0xabb1('0x6f'));return respondWithRpcPromise(_0xabb1('0x7f'),_0xabb1('0x80'),_0x3f06ff);}return null;})[_0xabb1('0x3c')](function(_0x355fec){var _0x5c5e76=_0xabb1('0x72')+_0x355fec[_0xabb1('0x2b')][_0xabb1('0x81')];return db['sequelize'][_0xabb1('0x47')](_0x5c5e76,{'type':db[_0xabb1('0x74')][_0xabb1('0x75')][_0xabb1('0x82')],'raw':!![]})[_0xabb1('0x3c')](function(_0x1bfd37){return _0x1bfd37;});})[_0xabb1('0x3c')](function(_0x359446){if(_0x359446){_0x3f06ff['message'][_0xabb1('0x83')]=_0x359446[0x0];if(!_0x13f792[_0xabb1('0x5e')]['UserId'])return;return db[_0xabb1('0x76')][_0xabb1('0x5c')]({'where':{'id':_0x13f792[_0xabb1('0x5e')][_0xabb1('0x64')],'role':_0xabb1('0x66')},'attributes':['id','name','fullname',_0xabb1('0x84'),'internal'],'raw':!![]});}return null;})[_0xabb1('0x3c')](function(_0x44f311){if(!_0x44f311)return null;_0x3f06ff[_0xabb1('0x2b')][_0xabb1('0x66')]=_0x44f311;return _0x3f06ff;})['then'](function(_0x41c417){if(_0x41c417){_0x41c417[_0xabb1('0x2b')]['interface']=util['format'](_0xabb1('0x79'),_0x13f792['user'][_0xabb1('0x3e')]);_0x41c417[_0xabb1('0x2b')]['channel']=_0x3f06ff['channel'];_0x41c417[_0xabb1('0x2b')][_0xabb1('0x7b')]=_0x3f06ff['channel'];_0x41c417[_0xabb1('0x2b')][_0xabb1('0x85')]=_0xabb1('0x38');respondWithRpcPromise(_0xabb1('0x7c'),_0xabb1('0x7c'),{'event':_0xabb1('0x86'),'message':_0x41c417[_0xabb1('0x2b')]},client9002);return _0x3f06ff;}return null;})[_0xabb1('0x3c')](respondWithResult(_0x2c8b20,null))[_0xabb1('0x58')](handleError(_0x2c8b20,null));}; \ No newline at end of file +var _0x960c=['fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','params','length','include','find','create','body','update','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','Sequelize','contact','User'];(function(_0xcff125,_0x1aeea2){var _0x15fb11=function(_0x292cf5){while(--_0x292cf5){_0xcff125['push'](_0xcff125['shift']());}};_0x15fb11(++_0x1aeea2);}(_0x960c,0x113));var _0xc960=function(_0x319637,_0x1ca9cd){_0x319637=_0x319637-0x0;var _0x2d1590=_0x960c[_0x319637];return _0x2d1590;};'use strict';var emlformat=require(_0xc960('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc960('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc960('0x2'));var moment=require(_0xc960('0x3'));var BPromise=require(_0xc960('0x4'));var Mustache=require('mustache');var util=require(_0xc960('0x5'));var path=require(_0xc960('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc960('0x7'));var fs=require('fs');var fs_extra=require(_0xc960('0x8'));var _=require(_0xc960('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc960('0xa'));var deskjs=require(_0xc960('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc960('0xc'));var Redis=require(_0xc960('0xd'));var authService=require(_0xc960('0xe'));var qs=require(_0xc960('0xf'));var as=require(_0xc960('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc960('0x11'))(_0xc960('0x12'));var utils=require(_0xc960('0x13'));var config=require(_0xc960('0x14'));var licenseUtil=require(_0xc960('0x15'));var db=require(_0xc960('0x16'))['db'];config[_0xc960('0x17')]=_[_0xc960('0x18')](config[_0xc960('0x17')],{'host':_0xc960('0x19'),'port':0x18eb});var socket=require(_0xc960('0x1a'))(new Redis(config['redis']));require(_0xc960('0x1b'))[_0xc960('0x1c')](socket);var jayson=require(_0xc960('0x1d'));var client=jayson[_0xc960('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xc960('0x1e')][_0xc960('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x195ff0,_0x43cd5a,_0x1d062a,_0x2a1356){return new BPromise(function(_0x10c47d,_0x457c67){var _0x32e2f5=_0x2a1356||client;return _0x32e2f5[_0xc960('0x20')](_0x195ff0,_0x1d062a)[_0xc960('0x21')](function(_0x367940){logger[_0xc960('0x22')](_0xc960('0x23'),_0x43cd5a,_0xc960('0x24'));logger['debug'](_0xc960('0x25'),_0x43cd5a,_0xc960('0x24'),JSON[_0xc960('0x26')](_0x367940));if(_0x367940[_0xc960('0x27')]){if(_0x367940[_0xc960('0x27')]['code']===0x1f4){logger[_0xc960('0x27')](_0xc960('0x23'),_0x43cd5a,_0x367940[_0xc960('0x27')][_0xc960('0x28')]);return _0x457c67(_0x367940[_0xc960('0x27')][_0xc960('0x28')]);}logger[_0xc960('0x27')](_0xc960('0x23'),_0x43cd5a,_0x367940[_0xc960('0x27')]['message']);return _0x10c47d(_0x367940['error'][_0xc960('0x28')]);}else{logger['info'](_0xc960('0x23'),_0x43cd5a,_0xc960('0x24'));_0x10c47d(_0x367940[_0xc960('0x29')][_0xc960('0x28')]);}})[_0xc960('0x2a')](function(_0x43c5aa){logger[_0xc960('0x27')](_0xc960('0x23'),_0x43cd5a,_0x43c5aa);_0x457c67(_0x43c5aa);});});}function respondWithStatusCode(_0x57db17,_0x540390){_0x540390=_0x540390||0xcc;return function(_0x56a6d5){if(_0x56a6d5){return _0x57db17[_0xc960('0x2b')](_0x540390);}return _0x57db17[_0xc960('0x2c')](_0x540390)[_0xc960('0x2d')]();};}function respondWithResult(_0x9dcee1,_0x24cc4e){_0x24cc4e=_0x24cc4e||0xc8;return function(_0x2ebe29){if(_0x2ebe29){return _0x9dcee1[_0xc960('0x2c')](_0x24cc4e)[_0xc960('0x2e')](_0x2ebe29);}};}function respondWithFilteredResult(_0x5b42c4,_0x5ce276){return function(_0x535275){if(_0x535275){var _0x1f6212=typeof _0x5ce276[_0xc960('0x2f')]===_0xc960('0x30')&&typeof _0x5ce276[_0xc960('0x31')]==='undefined';var _0x4971a5=_0x535275[_0xc960('0x32')];var _0x1fa880=_0x1f6212?0x0:_0x5ce276[_0xc960('0x2f')];var _0x2709f6=_0x1f6212?_0x535275[_0xc960('0x32')]:_0x5ce276['offset']+_0x5ce276[_0xc960('0x31')];var _0x3ce9fd;if(_0x2709f6>=_0x4971a5){_0x2709f6=_0x4971a5;_0x3ce9fd=0xc8;}else{_0x3ce9fd=0xce;}_0x5b42c4[_0xc960('0x2c')](_0x3ce9fd);return _0x5b42c4['set'](_0xc960('0x33'),_0x1fa880+'-'+_0x2709f6+'/'+_0x4971a5)['json'](_0x535275);}return null;};}function patchUpdates(_0x106e58){return function(_0x53c11d){try{jsonpatch[_0xc960('0x34')](_0x53c11d,_0x106e58,!![]);}catch(_0x80aa77){return BPromise[_0xc960('0x35')](_0x80aa77);}return _0x53c11d[_0xc960('0x36')]();};}function saveUpdates(_0x421058,_0x27d2e5){return function(_0x4ef03c){if(_0x4ef03c){return _0x4ef03c['update'](_0x421058)['then'](function(_0x396338){return _0x396338;});}return null;};}function removeEntity(_0x11a848,_0x3f7e98){return function(_0x29b19c){if(_0x29b19c){return _0x29b19c['destroy']()[_0xc960('0x21')](function(){_0x11a848[_0xc960('0x2c')](0xcc)[_0xc960('0x2d')]();});}};}function handleEntityNotFound(_0x1148fe,_0x36e2a7){return function(_0x2a8a8d){if(!_0x2a8a8d){_0x1148fe[_0xc960('0x2b')](0x194);}return _0x2a8a8d;};}function handleError(_0xd91892,_0x342229){_0x342229=_0x342229||0x1f4;return function(_0x228252){logger[_0xc960('0x27')](_0x228252['stack']);if(_0x228252['name']){delete _0x228252[_0xc960('0x37')];}_0xd91892[_0xc960('0x2c')](_0x342229)[_0xc960('0x38')](_0x228252);};}exports[_0xc960('0x39')]=function(_0x220461,_0x1f1598){var _0x503f94={},_0xdf22a9={},_0x495b79={'count':0x0,'rows':[]};var _0x3c7491=_[_0xc960('0x3a')](db[_0xc960('0x3b')][_0xc960('0x3c')],function(_0x141235){return{'name':_0x141235[_0xc960('0x3d')],'type':_0x141235[_0xc960('0x3e')]['key']};});_0xdf22a9[_0xc960('0x3f')]=_[_0xc960('0x3a')](_0x3c7491,_0xc960('0x37'));_0xdf22a9['query']=_[_0xc960('0x40')](_0x220461['query']);_0xdf22a9[_0xc960('0x41')]=_[_0xc960('0x42')](_0xdf22a9[_0xc960('0x3f')],_0xdf22a9['query']);_0x503f94[_0xc960('0x43')]=_[_0xc960('0x42')](_0xdf22a9[_0xc960('0x3f')],qs[_0xc960('0x44')](_0x220461[_0xc960('0x45')][_0xc960('0x44')]));_0x503f94[_0xc960('0x43')]=_0x503f94[_0xc960('0x43')]['length']?_0x503f94[_0xc960('0x43')]:_0xdf22a9[_0xc960('0x3f')];if(!_0x220461[_0xc960('0x45')][_0xc960('0x46')](_0xc960('0x47'))){_0x503f94[_0xc960('0x31')]=qs[_0xc960('0x31')](_0x220461[_0xc960('0x45')][_0xc960('0x31')]);_0x503f94[_0xc960('0x2f')]=qs[_0xc960('0x2f')](_0x220461[_0xc960('0x45')]['offset']);}_0x503f94[_0xc960('0x48')]=qs[_0xc960('0x49')](_0x220461[_0xc960('0x45')][_0xc960('0x49')]);_0x503f94[_0xc960('0x4a')]=qs[_0xc960('0x41')](_[_0xc960('0x4b')](_0x220461['query'],_0xdf22a9[_0xc960('0x41')]),_0x3c7491);if(_0x220461[_0xc960('0x45')][_0xc960('0x4c')]){_0x503f94['where']=_[_0xc960('0x4d')](_0x503f94[_0xc960('0x4a')],{'$or':_[_0xc960('0x3a')](_0x3c7491,function(_0x590e15){if(_0x590e15['type']!=='VIRTUAL'){var _0x15f8f7={};_0x15f8f7[_0x590e15[_0xc960('0x37')]]={'$like':'%'+_0x220461[_0xc960('0x45')][_0xc960('0x4c')]+'%'};return _0x15f8f7;}})});}_0x503f94=_[_0xc960('0x4d')]({},_0x503f94,_0x220461[_0xc960('0x4e')]);var _0x7f33de={'where':_0x503f94['where']};return db[_0xc960('0x3b')][_0xc960('0x32')](_0x7f33de)[_0xc960('0x21')](function(_0x2b5c98){_0x495b79[_0xc960('0x32')]=_0x2b5c98;if(_0x220461[_0xc960('0x45')]['includeAll']){_0x503f94['include']=[{'all':!![]}];}return db[_0xc960('0x3b')][_0xc960('0x4f')](_0x503f94);})['then'](function(_0x534340){_0x495b79[_0xc960('0x50')]=_0x534340;return _0x495b79;})[_0xc960('0x21')](respondWithFilteredResult(_0x1f1598,_0x503f94))[_0xc960('0x2a')](handleError(_0x1f1598,null));};exports['show']=function(_0x1b134e,_0x1aff82){var _0x37f625={'raw':!![],'where':{'id':_0x1b134e[_0xc960('0x51')]['id']}},_0x326358={};_0x326358[_0xc960('0x3f')]=_[_0xc960('0x40')](db[_0xc960('0x3b')][_0xc960('0x3c')]);_0x326358[_0xc960('0x45')]=_[_0xc960('0x40')](_0x1b134e[_0xc960('0x45')]);_0x326358[_0xc960('0x41')]=_[_0xc960('0x42')](_0x326358[_0xc960('0x3f')],_0x326358['query']);_0x37f625[_0xc960('0x43')]=_[_0xc960('0x42')](_0x326358[_0xc960('0x3f')],qs[_0xc960('0x44')](_0x1b134e['query']['fields']));_0x37f625[_0xc960('0x43')]=_0x37f625[_0xc960('0x43')][_0xc960('0x52')]?_0x37f625[_0xc960('0x43')]:_0x326358['model'];if(_0x1b134e[_0xc960('0x45')]['includeAll']){_0x37f625[_0xc960('0x53')]=[{'all':!![]}];}_0x37f625=_[_0xc960('0x4d')]({},_0x37f625,_0x1b134e[_0xc960('0x4e')]);return db[_0xc960('0x3b')][_0xc960('0x54')](_0x37f625)[_0xc960('0x21')](handleEntityNotFound(_0x1aff82,null))[_0xc960('0x21')](respondWithResult(_0x1aff82,null))['catch'](handleError(_0x1aff82,null));};exports[_0xc960('0x55')]=function(_0x87cb19,_0x3cbbd1){return db[_0xc960('0x3b')]['create'](_0x87cb19[_0xc960('0x56')],{})[_0xc960('0x21')](respondWithResult(_0x3cbbd1,0xc9))[_0xc960('0x2a')](handleError(_0x3cbbd1,null));};exports[_0xc960('0x57')]=function(_0x16fd9b,_0x4a166b){if(_0x16fd9b['body']['id']){delete _0x16fd9b[_0xc960('0x56')]['id'];}return db[_0xc960('0x3b')][_0xc960('0x54')]({'where':{'id':_0x16fd9b[_0xc960('0x51')]['id']}})[_0xc960('0x21')](handleEntityNotFound(_0x4a166b,null))[_0xc960('0x21')](saveUpdates(_0x16fd9b['body'],null))[_0xc960('0x21')](respondWithResult(_0x4a166b,null))[_0xc960('0x2a')](handleError(_0x4a166b,null));};exports[_0xc960('0x58')]=function(_0x3a130a,_0x15536f){return db[_0xc960('0x3b')][_0xc960('0x54')]({'where':{'id':_0x3a130a['params']['id']}})[_0xc960('0x21')](handleEntityNotFound(_0x15536f,null))['then'](removeEntity(_0x15536f,null))['catch'](handleError(_0x15536f,null));};exports[_0xc960('0x59')]=function(_0x18642b,_0x2401b8){return db[_0xc960('0x3b')][_0xc960('0x59')]()[_0xc960('0x21')](respondWithResult(_0x2401b8,null))[_0xc960('0x2a')](handleError(_0x2401b8,null));};var interaction_log=require('../../config/logger')(_0xc960('0x5a'));exports[_0xc960('0x5b')]=function(_0x1ac0c9,_0x1c3ddb,_0x2c6460){var _0x18afb4={'agent':{},'channel':_0xc960('0x5c')};if(_0x1ac0c9[_0xc960('0x56')]['id']){delete _0x1ac0c9['body']['id'];}_0x1ac0c9[_0xc960('0x56')][_0xc960('0x5d')]=!![];_0x1ac0c9[_0xc960('0x56')][_0xc960('0x5e')]=moment()[_0xc960('0x5f')](_0xc960('0x60'));_0x1ac0c9[_0xc960('0x56')][_0xc960('0x61')]=_0x1ac0c9[_0xc960('0x56')][_0xc960('0x61')]||_0x1ac0c9[_0xc960('0x62')]['id'];_0x18afb4[_0xc960('0x63')]['id']=_0x1ac0c9[_0xc960('0x56')][_0xc960('0x61')];return db[_0xc960('0x3b')][_0xc960('0x54')]({'where':{'id':_0x1ac0c9[_0xc960('0x51')]['id'],'UserId':null}})[_0xc960('0x21')](handleEntityNotFound(_0x1c3ddb,null))[_0xc960('0x21')](saveUpdates(_0x1ac0c9['body'],null))['then'](function(_0x1a0a79){if(_0x1a0a79){_0x18afb4[_0xc960('0x28')]=_0x1a0a79[_0xc960('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc960('0x54')]({'where':{'id':_0x1a0a79['OpenchannelInteractionId']}});}return null;})[_0xc960('0x21')](handleEntityNotFound(_0x1c3ddb,null))['then'](function(_0x292281){if(_0x292281){return _0x292281[_0xc960('0x57')]({'UserId':_0x1ac0c9['body'][_0xc960('0x61')],'read1stAt':_[_0xc960('0x65')](_0x292281[_0xc960('0x66')])?moment()[_0xc960('0x5f')](_0xc960('0x60')):undefined});}return null;})[_0xc960('0x21')](function(_0x43b12e){if(_0x43b12e){_0x18afb4[_0xc960('0x67')]=_0x43b12e[_0xc960('0x64')]({'plain':!![]});interaction_log[_0xc960('0x22')](_0xc960('0x68'),_0x1ac0c9[_0xc960('0x62')]['id'],_0x1ac0c9[_0xc960('0x62')][_0xc960('0x37')],_0x1ac0c9['user'][_0xc960('0x69')],_0x18afb4['interaction']['id'],_0x1ac0c9['body']?JSON[_0xc960('0x26')](_0x1ac0c9[_0xc960('0x56')]):_0xc960('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xc960('0x6b'),_0x18afb4);}return null;})[_0xc960('0x21')](function(_0x2e2d5a){var _0x22177f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e2d5a[_0xc960('0x28')][_0xc960('0x6c')];return db['sequelize'][_0xc960('0x45')](_0x22177f,{'type':db[_0xc960('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc960('0x21')](function(_0x2e44a6){return _0x2e44a6;});})['then'](function(_0x391c18){if(_0x391c18){_0x18afb4[_0xc960('0x28')][_0xc960('0x6e')]=_0x391c18[0x0];if(!_0x1ac0c9[_0xc960('0x56')][_0xc960('0x61')])return;return db[_0xc960('0x6f')][_0xc960('0x54')]({'where':{'id':_0x1ac0c9[_0xc960('0x56')][_0xc960('0x61')],'role':_0xc960('0x63')},'attributes':['id',_0xc960('0x37'),_0xc960('0x70'),'email',_0xc960('0x71')],'raw':!![]});}return null;})[_0xc960('0x21')](function(_0xdf0270){if(!_0xdf0270)return null;_0x18afb4[_0xc960('0x28')][_0xc960('0x63')]=_0xdf0270;return _0x18afb4;})['then'](function(_0x312297){if(_0x312297){if(_0x1ac0c9[_0xc960('0x56')][_0xc960('0x72')]){_0x18afb4[_0xc960('0x28')][_0xc960('0x73')]=util[_0xc960('0x5f')](_0xc960('0x74'),_0x1ac0c9[_0xc960('0x62')][_0xc960('0x37')]);_0x18afb4[_0xc960('0x28')][_0xc960('0x75')]=_0x18afb4[_0xc960('0x75')];_0x18afb4['message'][_0xc960('0x76')]=_0x18afb4['channel'];_0x18afb4['message'][_0xc960('0x77')]=_0xc960('0x5b');return respondWithRpcPromise('EventManager',_0xc960('0x78'),{'event':'acceptmessage','message':_0x18afb4[_0xc960('0x28')]},client9002)[_0xc960('0x21')](function(){return _0x18afb4;});}return _0x18afb4;}return null;})[_0xc960('0x21')](respondWithResult(_0x1c3ddb,null))[_0xc960('0x2a')](handleError(_0x1c3ddb,null));};var interaction_log=require('../../config/logger')(_0xc960('0x5a'));exports[_0xc960('0x35')]=function(_0x1e6c99,_0x1ebc3f,_0x25322f){var _0x4850b7={'agent':{},'channel':_0xc960('0x5c')};if(_0x1e6c99[_0xc960('0x56')]['id']){delete _0x1e6c99[_0xc960('0x56')]['id'];}_0x1e6c99[_0xc960('0x56')][_0xc960('0x61')]=_0x1e6c99[_0xc960('0x56')]['UserId']||_0x1e6c99[_0xc960('0x62')]['id'];_0x4850b7[_0xc960('0x63')]['id']=_0x1e6c99[_0xc960('0x56')]['UserId'];return db[_0xc960('0x3b')][_0xc960('0x54')]({'where':{'id':_0x1e6c99[_0xc960('0x51')]['id'],'UserId':null}})[_0xc960('0x21')](handleEntityNotFound(_0x1ebc3f,null))[_0xc960('0x21')](function(_0xeaebe6){if(_0xeaebe6){_0x4850b7['message']=_0xeaebe6[_0xc960('0x64')]({'plain':!![]});return db[_0xc960('0x79')]['find']({'where':{'id':_0xeaebe6[_0xc960('0x7a')]}});}return null;})[_0xc960('0x21')](handleEntityNotFound(_0x1ebc3f,null))['then'](function(_0x2bfcda){if(_0x2bfcda){_0x4850b7[_0xc960('0x67')]=_0x2bfcda['get']({'plain':!![]});interaction_log[_0xc960('0x22')](_0xc960('0x7b'),_0x1e6c99['user']['id'],_0x1e6c99[_0xc960('0x62')][_0xc960('0x37')],_0x1e6c99[_0xc960('0x62')][_0xc960('0x69')],_0x4850b7['interaction']['id'],_0x1e6c99[_0xc960('0x56')]?JSON[_0xc960('0x26')](_0x1e6c99['body']):_0xc960('0x6a'));return respondWithRpcPromise(_0xc960('0x7c'),'rejectMessage',_0x4850b7);}return null;})[_0xc960('0x21')](function(_0x365704){var _0x2af954=_0xc960('0x7d')+_0x365704[_0xc960('0x28')][_0xc960('0x6c')];return db['sequelize'][_0xc960('0x45')](_0x2af954,{'type':db['Sequelize'][_0xc960('0x7e')][_0xc960('0x7f')],'raw':!![]})['then'](function(_0x1052de){return _0x1052de;});})[_0xc960('0x21')](function(_0x70344e){if(_0x70344e){_0x4850b7['message'][_0xc960('0x6e')]=_0x70344e[0x0];if(!_0x1e6c99[_0xc960('0x56')][_0xc960('0x61')])return;return db['User']['find']({'where':{'id':_0x1e6c99[_0xc960('0x56')][_0xc960('0x61')],'role':_0xc960('0x63')},'attributes':['id',_0xc960('0x37'),'fullname','email',_0xc960('0x71')],'raw':!![]});}return null;})[_0xc960('0x21')](function(_0x135f54){if(!_0x135f54)return null;_0x4850b7[_0xc960('0x28')]['agent']=_0x135f54;return _0x4850b7;})['then'](function(_0x1214cb){if(_0x1214cb){_0x1214cb['message'][_0xc960('0x73')]=util[_0xc960('0x5f')](_0xc960('0x74'),_0x1e6c99[_0xc960('0x62')][_0xc960('0x37')]);_0x1214cb[_0xc960('0x28')][_0xc960('0x75')]=_0x4850b7[_0xc960('0x75')];_0x1214cb[_0xc960('0x28')][_0xc960('0x76')]=_0x4850b7[_0xc960('0x75')];_0x1214cb[_0xc960('0x28')][_0xc960('0x77')]='reject';respondWithRpcPromise(_0xc960('0x78'),'EventManager',{'event':_0xc960('0x80'),'message':_0x1214cb[_0xc960('0x28')]},client9002);return _0x4850b7;}return null;})[_0xc960('0x21')](respondWithResult(_0x1ebc3f,null))[_0xc960('0x2a')](handleError(_0x1ebc3f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 439a885..e3c6d03 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 _0x5992=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','OpenchannelMessage'];(function(_0x4303d0,_0x1dcda4){var _0x1b7196=function(_0x336abd){while(--_0x336abd){_0x4303d0['push'](_0x4303d0['shift']());}};_0x1b7196(++_0x1dcda4);}(_0x5992,0xaf));var _0x2599=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5992[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x2599('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2599('0x1')](0x0);var events={'afterCreate':_0x2599('0x2'),'afterUpdate':'update','afterDestroy':_0x2599('0x3')};function emitEvent(_0x1f7a2f){return function(_0x215ab0,_0xc95d,_0x503067){OpenchannelMessageEvents[_0x2599('0x4')](_0x1f7a2f+':'+_0x215ab0['id'],_0x215ab0);OpenchannelMessageEvents[_0x2599('0x4')](_0x1f7a2f,_0x215ab0);_0x503067(null);};}for(var e in events){if(events[_0x2599('0x5')](e)){var event=events[e];OpenchannelMessage[_0x2599('0x6')](e,emitEvent(event));}}module[_0x2599('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x03a8=['../../mysqldb','OpenchannelMessage','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x164e9a,_0x4c9d90){var _0x30ffe7=function(_0x2fff08){while(--_0x2fff08){_0x164e9a['push'](_0x164e9a['shift']());}};_0x30ffe7(++_0x4c9d90);}(_0x03a8,0x155));var _0x803a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03a8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x803a('0x0'));var OpenchannelMessage=require(_0x803a('0x1'))['db'][_0x803a('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x803a('0x3'),'afterUpdate':_0x803a('0x4'),'afterDestroy':_0x803a('0x5')};function emitEvent(_0x3305b5){return function(_0x598908,_0x511961,_0x552324){OpenchannelMessageEvents[_0x803a('0x6')](_0x3305b5+':'+_0x598908['id'],_0x598908);OpenchannelMessageEvents['emit'](_0x3305b5,_0x598908);_0x552324(null);};}for(var e in events){if(events[_0x803a('0x7')](e)){var event=events[e];OpenchannelMessage[_0x803a('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c1032ef..bbbf9ea 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 _0xf4f4=['Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','Interaction','threadId','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId'];(function(_0x48f07b,_0x173bc6){var _0x6d6e92=function(_0x5b4d87){while(--_0x5b4d87){_0x48f07b['push'](_0x48f07b['shift']());}};_0x6d6e92(++_0x173bc6);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5b7528,_0x59847a){_0x5b7528=_0x5b7528-0x0;var _0x404df=_0xf4f4[_0x5b7528];return _0x404df;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var logger=require('../../config/logger')(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var BPromise=require(_0x4f4f('0x4'));var rp=require(_0x4f4f('0x5'));var fs=require('fs');var path=require(_0x4f4f('0x6'));var rimraf=require('rimraf');var config=require(_0x4f4f('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x4f4f('0x8')]=function(_0x132d5c,_0x20ee6e){return _0x132d5c[_0x4f4f('0x9')](_0x4f4f('0xa'),attributes,{'tableName':_0x4f4f('0xb'),'paranoid':![],'indexes':[{'name':_0x4f4f('0xc'),'fields':[_0x4f4f('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc066a4,_0x38d110,_0x39e36b){var _0x2d86d1=_0x132d5c[_0x4f4f('0xe')];var _0x11940f=_0xc066a4[_0x4f4f('0xf')]({'plain':!![]});if(_0x11940f[_0x4f4f('0x10')]['toLowerCase']()==='in'||_0x11940f['direction'][_0x4f4f('0x11')]()===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]&&!_[_0x4f4f('0x14')](_0x11940f[_0x4f4f('0x15')])){_0x2d86d1[_0x4f4f('0x16')]['findOne']({'where':{'id':_0x11940f[_0x4f4f('0x17')]}})['then'](function(_0x216ba8){if(_0x216ba8){_0x216ba8[_0x4f4f('0x18')]({'lastMsgAt':_0x11940f[_0x4f4f('0x19')],'lastMsgDirection':_0x11940f[_0x4f4f('0x10')]['toLowerCase']()});}})[_0x4f4f('0x1a')](function(_0x4c68f4){console['error'](_0x4c68f4);});}if(_0x11940f['direction']===_0x4f4f('0x12')&&!_0x11940f[_0x4f4f('0x13')]){var _0x2d21ed;_0x2d86d1[_0x4f4f('0x1b')][_0x4f4f('0x1c')]()[_0x4f4f('0x1d')](function(_0x1245c4){return _0x2d86d1[_0x4f4f('0x1e')][_0x4f4f('0x1f')]({'where':{'id':_0x11940f[_0x4f4f('0x20')]},'include':[{'model':_0x2d86d1[_0x4f4f('0x16')],'as':_0x4f4f('0x21'),'where':{'id':_0x11940f['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2d86d1[_0x4f4f('0x1b')],'as':_0x4f4f('0x22'),'attributes':_[_0x4f4f('0x23')](_0x1245c4)}]}]});})[_0x4f4f('0x1d')](function(_0x302a79){_0x2d21ed=_0x302a79[_0x4f4f('0xf')]({'plain':!![]});if(_0x2d21ed&&_0x2d21ed[_0x4f4f('0x24')]){logger[_0x4f4f('0x25')](_0x4f4f('0x26'),_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x29'),_0x11940f['id'],_0x2d21ed[_0x4f4f('0x24')]));if(_0x2d21ed[_0x4f4f('0x21')]&&_0x2d21ed['Interactions']['length']){_0x11940f['Interaction']=_[_0x4f4f('0x2a')](_0x2d21ed[_0x4f4f('0x21')][0x0],'Contact');_0x11940f[_0x4f4f('0x22')]=_0x2d21ed[_0x4f4f('0x21')][0x0][_0x4f4f('0x22')];}var _0x38d110={'method':_0x4f4f('0x2b'),'uri':encodeURI(_0x2d21ed[_0x4f4f('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x38d110[_0x4f4f('0x2c')]){case'GET':_0x38d110['qs']=_0x11940f;break;case _0x4f4f('0x2b'):_0x38d110[_0x4f4f('0xd')]=_0x11940f;break;}return rp(_0x38d110)[_0x4f4f('0x1d')](function(_0x15c79c){logger[_0x4f4f('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f4f('0x27'),util[_0x4f4f('0x28')](_0x4f4f('0x2d'),_0x11940f['id'],_0x2d21ed['replyUri']));if(_0x15c79c['body']['threadId']&&_0x15c79c[_0x4f4f('0xd')]['threadId']!=_0x11940f[_0x4f4f('0x2e')][_0x4f4f('0x2f')]){return _0x2d86d1[_0x4f4f('0x16')]['update']({'threadId':_0x15c79c[_0x4f4f('0xd')][_0x4f4f('0x2f')]},{'logging':!![],'where':{'id':_0x11940f['Interaction']['id']}});}else{return;}})[_0x4f4f('0x1d')](function(){return _0xc066a4[_0x4f4f('0x18')]({'read':!![]});})[_0x4f4f('0x1a')](function(_0x5b937e){logger[_0x4f4f('0x30')](_0x4f4f('0x26'),'afterCreate',util['inspect'](_0x5b937e,{'showHidden':![],'depth':null}));_0x39e36b();});}else{_0x39e36b();}})[_0x4f4f('0x31')](function(){_0x39e36b();});}else{_0x39e36b();}}},'charset':_0x4f4f('0x32'),'collate':_0x4f4f('0x33')});}; \ No newline at end of file +var _0x8e3f=['get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc')],'type':_0xf8e3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38f8e8,_0x4055e2,_0x299a7e){var _0x2a3b59=_0xb21f8d[_0xf8e3('0xe')];var _0x2bc3cd=_0x38f8e8[_0xf8e3('0xf')]({'plain':!![]});if(_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()==='in'||_0x2bc3cd[_0xf8e3('0x10')][_0xf8e3('0x11')]()===_0xf8e3('0x12')&&!_0x2bc3cd['secret']&&!_[_0xf8e3('0x13')](_0x2bc3cd[_0xf8e3('0x14')])){_0x2a3b59[_0xf8e3('0x15')][_0xf8e3('0x16')]({'where':{'id':_0x2bc3cd['OpenchannelInteractionId']}})[_0xf8e3('0x17')](function(_0xa856f5){if(_0xa856f5){_0xa856f5[_0xf8e3('0x18')]({'lastMsgAt':_0x2bc3cd['createdAt'],'lastMsgDirection':_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()});}})[_0xf8e3('0x19')](function(_0x40c196){console[_0xf8e3('0x1a')](_0x40c196);});}if(_0x2bc3cd['direction']==='out'&&!_0x2bc3cd[_0xf8e3('0x1b')]){var _0x385dde;_0x2a3b59[_0xf8e3('0x1c')][_0xf8e3('0x1d')]()[_0xf8e3('0x17')](function(_0x11d4cc){return _0x2a3b59[_0xf8e3('0x1e')][_0xf8e3('0x1f')]({'where':{'id':_0x2bc3cd[_0xf8e3('0x20')]},'include':[{'model':_0x2a3b59[_0xf8e3('0x15')],'as':'Interactions','where':{'id':_0x2bc3cd[_0xf8e3('0x21')]},'limit':0x1,'include':[{'model':_0x2a3b59[_0xf8e3('0x1c')],'as':_0xf8e3('0x22'),'attributes':_[_0xf8e3('0x23')](_0x11d4cc)}]}]});})[_0xf8e3('0x17')](function(_0x11c58e){_0x385dde=_0x11c58e[_0xf8e3('0xf')]({'plain':!![]});if(_0x385dde&&_0x385dde[_0xf8e3('0x24')]){logger['info'](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x2bc3cd['id'],_0x385dde['replyUri']));if(_0x385dde[_0xf8e3('0x29')]&&_0x385dde['Interactions'][_0xf8e3('0x2a')]){_0x2bc3cd[_0xf8e3('0x2b')]=_[_0xf8e3('0x2c')](_0x385dde[_0xf8e3('0x29')][0x0],_0xf8e3('0x22'));_0x2bc3cd[_0xf8e3('0x22')]=_0x385dde['Interactions'][0x0][_0xf8e3('0x22')];}var _0x4055e2={'method':_0xf8e3('0x2d'),'uri':encodeURI(_0x385dde[_0xf8e3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4055e2[_0xf8e3('0x2e')]){case _0xf8e3('0x2f'):_0x4055e2['qs']=_0x2bc3cd;break;case _0xf8e3('0x2d'):_0x4055e2[_0xf8e3('0xc')]=_0x2bc3cd;break;}return rp(_0x4055e2)['then'](function(_0x356e0a){logger[_0xf8e3('0x30')](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x31'),_0x2bc3cd['id'],_0x385dde[_0xf8e3('0x24')]));if(_0x356e0a[_0xf8e3('0xc')]['threadId']&&_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]!=_0x2bc3cd[_0xf8e3('0x2b')][_0xf8e3('0x32')]){return _0x2a3b59['OpenchannelInteraction'][_0xf8e3('0x18')]({'threadId':_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]},{'logging':!![],'where':{'id':_0x2bc3cd[_0xf8e3('0x2b')]['id']}});}else{return;}})[_0xf8e3('0x17')](function(){return _0x38f8e8[_0xf8e3('0x18')]({'read':!![]});})[_0xf8e3('0x19')](function(_0x18c8ae){logger['error'](_0xf8e3('0x25'),_0xf8e3('0x26'),util['inspect'](_0x18c8ae,{'showHidden':![],'depth':null}));_0x299a7e();});}else{_0x299a7e();}})['finally'](function(){_0x299a7e();});}else{_0x299a7e();}}},'charset':'utf8mb4','collate':_0xf8e3('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 183b719..7561b99 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xb4470b,_0x1e2ba7){var _0x37ba82=function(_0x203c9e){while(--_0x203c9e){_0xb4470b['push'](_0xb4470b['shift']());}};_0x37ba82(++_0x1e2ba7);}(_0x2ef3,0xba));var _0x32ef=function(_0x574e8d,_0x52f383){_0x574e8d=_0x574e8d-0x0;var _0x300923=_0x2ef3[_0x574e8d];return _0x300923;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +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(_0x33e1c0,_0x3b19c9){var _0x1a2188=function(_0x238428){while(--_0x238428){_0x33e1c0['push'](_0x33e1c0['shift']());}};_0x1a2188(++_0x3b19c9);}(_0x7a54,0x106));var _0x47a5=function(_0xaa7224,_0x47927b){_0xaa7224=_0xaa7224-0x0;var _0xe89b2e=_0x7a54[_0xaa7224];return _0xe89b2e;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 36933e9..a01d0ab 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 _0xe170=['openchannelMessage:','./openchannelMessage.events','save','emit','removeListener','register','length'];(function(_0x538117,_0x4cc778){var _0x54f2a8=function(_0x386a23){while(--_0x386a23){_0x538117['push'](_0x538117['shift']());}};_0x54f2a8(++_0x4cc778);}(_0xe170,0x1b3));var _0x0e17=function(_0x2c0ff7,_0x5dd45e){_0x2c0ff7=_0x2c0ff7-0x0;var _0x57742=_0xe170[_0x2c0ff7];return _0x57742;};'use strict';var OpenchannelMessageEvents=require(_0x0e17('0x0'));var events=[_0x0e17('0x1'),'remove','update'];function createListener(_0x4e5bea,_0x5121cf){return function(_0x38ea49){_0x5121cf[_0x0e17('0x2')](_0x4e5bea,_0x38ea49);};}function removeListener(_0x22e4cc,_0x472070){return function(){OpenchannelMessageEvents[_0x0e17('0x3')](_0x22e4cc,_0x472070);};}exports[_0x0e17('0x4')]=function(_0x3a60af){for(var _0x45b182=0x0,_0x4408a6=events[_0x0e17('0x5')];_0x45b182<_0x4408a6;_0x45b182++){var _0x52e7ec=events[_0x45b182];var _0x393324=createListener(_0x0e17('0x6')+_0x52e7ec,_0x3a60af);OpenchannelMessageEvents['on'](_0x52e7ec,_0x393324);}}; \ No newline at end of file +var _0x1e92=['register','length','openchannelMessage:','./openchannelMessage.events','remove','emit','removeListener'];(function(_0x203a09,_0x3ead51){var _0x33291c=function(_0x27aeb1){while(--_0x27aeb1){_0x203a09['push'](_0x203a09['shift']());}};_0x33291c(++_0x3ead51);}(_0x1e92,0x1df));var _0x21e9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x1e92[_0x3511d3];return _0x5d6321;};'use strict';var OpenchannelMessageEvents=require(_0x21e9('0x0'));var events=['save',_0x21e9('0x1'),'update'];function createListener(_0x5a922f,_0x144614){return function(_0x42fd50){_0x144614[_0x21e9('0x2')](_0x5a922f,_0x42fd50);};}function removeListener(_0x2c75f5,_0x44d894){return function(){OpenchannelMessageEvents[_0x21e9('0x3')](_0x2c75f5,_0x44d894);};}exports[_0x21e9('0x4')]=function(_0x3212cb){for(var _0x54b40a=0x0,_0x2bde41=events[_0x21e9('0x5')];_0x54b40a<_0x2bde41;_0x54b40a++){var _0x2de161=events[_0x54b40a];var _0x58ac2d=createListener(_0x21e9('0x6')+_0x2de161,_0x3212cb);OpenchannelMessageEvents['on'](_0x2de161,_0x58ac2d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 7a2f919..8bc4789 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 _0x61a9=['removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','index','get','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','/:id'];(function(_0x438b39,_0x4a16f1){var _0x511bfd=function(_0x37ec6e){while(--_0x37ec6e){_0x438b39['push'](_0x438b39['shift']());}};_0x511bfd(++_0x4a16f1);}(_0x61a9,0x1c2));var _0x961a=function(_0x4baa72,_0x42a8ef){_0x4baa72=_0x4baa72-0x0;var _0x1c7abd=_0x61a9[_0x4baa72];return _0x1c7abd;};'use strict';var multer=require(_0x961a('0x0'));var util=require(_0x961a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x961a('0x2'));var router=express[_0x961a('0x3')]();var fs_extra=require(_0x961a('0x4'));var auth=require(_0x961a('0x5'));var interaction=require(_0x961a('0x6'));var config=require('../../config/environment');var controller=require(_0x961a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x961a('0x8')]);router[_0x961a('0x9')](_0x961a('0xa'),auth[_0x961a('0xb')](),controller[_0x961a('0xc')]);router[_0x961a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x961a('0xd')]);router[_0x961a('0x9')](_0x961a('0xe'),auth['isAuthenticated'](),controller[_0x961a('0xf')]);router[_0x961a('0x9')](_0x961a('0x10'),auth[_0x961a('0xb')](),controller['getTeams']);router[_0x961a('0x9')](_0x961a('0x11'),auth['isAuthenticated'](),controller[_0x961a('0x12')]);router[_0x961a('0x13')]('/',auth[_0x961a('0xb')](),controller[_0x961a('0x14')]);router[_0x961a('0x13')](_0x961a('0x10'),auth['isAuthenticated'](),controller[_0x961a('0x15')]);router['post'](_0x961a('0x11'),auth[_0x961a('0xb')](),controller[_0x961a('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x961a('0x17')]);router[_0x961a('0x18')](_0x961a('0x19'),auth[_0x961a('0xb')](),controller['destroy']);router[_0x961a('0x18')](_0x961a('0x10'),auth[_0x961a('0xb')](),controller[_0x961a('0x1a')]);router[_0x961a('0x18')](_0x961a('0x11'),auth[_0x961a('0xb')](),controller[_0x961a('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x77b8=['describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x5b630f,_0x38095c){var _0x21c25d=function(_0x12b9dc){while(--_0x12b9dc){_0x5b630f['push'](_0x5b630f['shift']());}};_0x21c25d(++_0x38095c);}(_0x77b8,0x1e2));var _0x877b=function(_0x3287a6,_0x5c1f6e){_0x3287a6=_0x3287a6-0x0;var _0x252b7b=_0x77b8[_0x3287a6];return _0x252b7b;};'use strict';var multer=require(_0x877b('0x0'));var util=require(_0x877b('0x1'));var path=require(_0x877b('0x2'));var timeout=require(_0x877b('0x3'));var express=require(_0x877b('0x4'));var router=express[_0x877b('0x5')]();var fs_extra=require(_0x877b('0x6'));var auth=require(_0x877b('0x7'));var interaction=require(_0x877b('0x8'));var config=require('../../config/environment');var controller=require(_0x877b('0x9'));router[_0x877b('0xa')]('/',auth[_0x877b('0xb')](),controller[_0x877b('0xc')]);router[_0x877b('0xa')](_0x877b('0xd'),auth[_0x877b('0xb')](),controller[_0x877b('0xe')]);router['get'](_0x877b('0xf'),auth[_0x877b('0xb')](),controller['show']);router[_0x877b('0xa')](_0x877b('0x10'),auth[_0x877b('0xb')](),controller[_0x877b('0x11')]);router[_0x877b('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0x877b('0x12')]);router[_0x877b('0xa')]('/:id/users',auth[_0x877b('0xb')](),controller[_0x877b('0x13')]);router[_0x877b('0x14')]('/',auth[_0x877b('0xb')](),controller[_0x877b('0x15')]);router[_0x877b('0x14')]('/:id/teams',auth[_0x877b('0xb')](),controller[_0x877b('0x16')]);router['post'](_0x877b('0x17'),auth[_0x877b('0xb')](),controller[_0x877b('0x18')]);router[_0x877b('0x19')]('/:id',auth[_0x877b('0xb')](),controller[_0x877b('0x1a')]);router[_0x877b('0x1b')](_0x877b('0xf'),auth['isAuthenticated'](),controller[_0x877b('0x1c')]);router['delete']('/:id/teams',auth[_0x877b('0xb')](),controller[_0x877b('0x1d')]);router['delete']('/:id/users',auth[_0x877b('0xb')](),controller[_0x877b('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 36aae80..c31ed21 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 _0xdbf5=['name','rrmemory','sequelize'];(function(_0x567e3f,_0x3df761){var _0x3fc825=function(_0x37006e){while(--_0x37006e){_0x567e3f['push'](_0x567e3f['shift']());}};_0x3fc825(++_0x3df761);}(_0xdbf5,0x10a));var _0x5dbf=function(_0x1776d3,_0x5d088a){_0x1776d3=_0x1776d3-0x0;var _0x16da2b=_0xdbf5[_0x1776d3];return _0x16da2b;};'use strict';var Sequelize=require(_0x5dbf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5dbf('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5dbf('0x2'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x0460=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x50e417,_0x5a1bff){var _0x56fec0=function(_0xab353){while(--_0xab353){_0x50e417['push'](_0x50e417['shift']());}};_0x56fec0(++_0x5a1bff);}(_0x0460,0x64));var _0x0046=function(_0x3fd020,_0x2e6ada){_0x3fd020=_0x3fd020-0x0;var _0xc79b91=_0x0460[_0x3fd020];return _0xc79b91;};'use strict';var Sequelize=require(_0x0046('0x0'));module[_0x0046('0x1')]={'name':{'type':Sequelize[_0x0046('0x2')],'unique':_0x0046('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0046('0x2')]},'timeout':{'type':Sequelize[_0x0046('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0046('0x5')](_0x0046('0x6'),_0x0046('0x7'),_0x0046('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index af7f178..de24a19 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 _0xd0f7=['../../config/license/util','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','OpenchannelQueue','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getMembers','UserOpenchannelQueue','sort','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','updatedAt','getTeams','findOne','Team','pick','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','removeTeams','select','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','userOpenchannelQueue:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xd0f7,0x78));var _0x7d0f=function(_0x184d50,_0xd03f9a){_0x184d50=_0x184d50-0x0;var _0x3653fd=_0xd0f7[_0x184d50];return _0x3653fd;};'use strict';var emlformat=require(_0x7d0f('0x0'));var rimraf=require(_0x7d0f('0x1'));var zipdir=require(_0x7d0f('0x2'));var jsonpatch=require(_0x7d0f('0x3'));var rp=require(_0x7d0f('0x4'));var moment=require('moment');var BPromise=require(_0x7d0f('0x5'));var Mustache=require(_0x7d0f('0x6'));var util=require(_0x7d0f('0x7'));var path=require(_0x7d0f('0x8'));var sox=require(_0x7d0f('0x9'));var csv=require(_0x7d0f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0f('0xb'));var _=require(_0x7d0f('0xc'));var squel=require(_0x7d0f('0xd'));var crypto=require(_0x7d0f('0xe'));var jsforce=require(_0x7d0f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7d0f('0xa'));var querystring=require(_0x7d0f('0x10'));var Papa=require(_0x7d0f('0x11'));var Redis=require(_0x7d0f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7d0f('0x13'));var as=require(_0x7d0f('0x14'));var hardwareService=require(_0x7d0f('0x15'));var logger=require('../../config/logger')(_0x7d0f('0x16'));var utils=require(_0x7d0f('0x17'));var config=require(_0x7d0f('0x18'));var licenseUtil=require(_0x7d0f('0x19'));var db=require(_0x7d0f('0x1a'))['db'];config[_0x7d0f('0x1b')]=_['defaults'](config[_0x7d0f('0x1b')],{'host':_0x7d0f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d0f('0x1b')]));require(_0x7d0f('0x1d'))[_0x7d0f('0x1e')](socket);function respondWithStatusCode(_0x3a9dda,_0x555d69){_0x555d69=_0x555d69||0xcc;return function(_0x3c061f){if(_0x3c061f){return _0x3a9dda[_0x7d0f('0x1f')](_0x555d69);}return _0x3a9dda['status'](_0x555d69)[_0x7d0f('0x20')]();};}function respondWithResult(_0x4cb57b,_0x9c4c9a){_0x9c4c9a=_0x9c4c9a||0xc8;return function(_0x230737){if(_0x230737){return _0x4cb57b['status'](_0x9c4c9a)[_0x7d0f('0x21')](_0x230737);}};}function respondWithFilteredResult(_0x54ae78,_0x13f1a6){return function(_0x14e3a3){if(_0x14e3a3){var _0x2ae823=typeof _0x13f1a6[_0x7d0f('0x22')]===_0x7d0f('0x23')&&typeof _0x13f1a6[_0x7d0f('0x24')]==='undefined';var _0x4b1a62=_0x14e3a3[_0x7d0f('0x25')];var _0x8f1648=_0x2ae823?0x0:_0x13f1a6[_0x7d0f('0x22')];var _0x28787c=_0x2ae823?_0x14e3a3['count']:_0x13f1a6[_0x7d0f('0x22')]+_0x13f1a6['limit'];var _0x1765cc;if(_0x28787c>=_0x4b1a62){_0x28787c=_0x4b1a62;_0x1765cc=0xc8;}else{_0x1765cc=0xce;}_0x54ae78[_0x7d0f('0x26')](_0x1765cc);return _0x54ae78[_0x7d0f('0x27')](_0x7d0f('0x28'),_0x8f1648+'-'+_0x28787c+'/'+_0x4b1a62)['json'](_0x14e3a3);}return null;};}function patchUpdates(_0x18b6b8){return function(_0x106d87){try{jsonpatch['apply'](_0x106d87,_0x18b6b8,!![]);}catch(_0x32a38a){return BPromise[_0x7d0f('0x29')](_0x32a38a);}return _0x106d87[_0x7d0f('0x2a')]();};}function saveUpdates(_0x1f9fa1,_0x446f33){return function(_0xf0507){if(_0xf0507){return _0xf0507[_0x7d0f('0x2b')](_0x1f9fa1)[_0x7d0f('0x2c')](function(_0x375733){return _0x375733;});}return null;};}function removeEntity(_0x924001,_0x1c8d05){return function(_0x59498d){if(_0x59498d){return _0x59498d[_0x7d0f('0x2d')]()[_0x7d0f('0x2c')](function(){var _0xcebc96=_0x59498d[_0x7d0f('0x2e')]({'plain':!![]});var _0x3848a6=_0x7d0f('0x2f');return db[_0x7d0f('0x30')][_0x7d0f('0x2d')]({'where':{'type':_0x3848a6,'resourceId':_0xcebc96['id']}})[_0x7d0f('0x2c')](function(){return _0x59498d;});})[_0x7d0f('0x2c')](function(){_0x924001[_0x7d0f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x164653,_0x38244d){return function(_0x71e588){if(!_0x71e588){_0x164653[_0x7d0f('0x1f')](0x194);}return _0x71e588;};}function handleError(_0x87d84d,_0x364cd9){_0x364cd9=_0x364cd9||0x1f4;return function(_0x23dbd5){logger['error'](_0x23dbd5[_0x7d0f('0x31')]);if(_0x23dbd5[_0x7d0f('0x32')]){delete _0x23dbd5[_0x7d0f('0x32')];}_0x87d84d[_0x7d0f('0x26')](_0x364cd9)[_0x7d0f('0x33')](_0x23dbd5);};}exports[_0x7d0f('0x34')]=function(_0x9a06a3,_0x36bf68){var _0x37af9a={},_0xdafacb={},_0x10af00={'count':0x0,'rows':[]};var _0x315ddc=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x228a51){return{'name':_0x228a51[_0x7d0f('0x35')],'type':_0x228a51[_0x7d0f('0x36')][_0x7d0f('0x37')]};});_0xdafacb[_0x7d0f('0x38')]=_[_0x7d0f('0x39')](_0x315ddc,_0x7d0f('0x32'));_0xdafacb[_0x7d0f('0x3a')]=_[_0x7d0f('0x3b')](_0x9a06a3[_0x7d0f('0x3a')]);_0xdafacb[_0x7d0f('0x3c')]=_['intersection'](_0xdafacb[_0x7d0f('0x38')],_0xdafacb['query']);_0x37af9a[_0x7d0f('0x3d')]=_[_0x7d0f('0x3e')](_0xdafacb['model'],qs['fields'](_0x9a06a3['query'][_0x7d0f('0x3f')]));_0x37af9a[_0x7d0f('0x3d')]=_0x37af9a[_0x7d0f('0x3d')][_0x7d0f('0x40')]?_0x37af9a['attributes']:_0xdafacb[_0x7d0f('0x38')];if(!_0x9a06a3[_0x7d0f('0x3a')][_0x7d0f('0x41')](_0x7d0f('0x42'))){_0x37af9a[_0x7d0f('0x24')]=qs['limit'](_0x9a06a3[_0x7d0f('0x3a')]['limit']);_0x37af9a['offset']=qs[_0x7d0f('0x22')](_0x9a06a3[_0x7d0f('0x3a')]['offset']);}_0x37af9a[_0x7d0f('0x43')]=qs['sort'](_0x9a06a3[_0x7d0f('0x3a')]['sort']);_0x37af9a[_0x7d0f('0x44')]=qs[_0x7d0f('0x3c')](_['pick'](_0x9a06a3[_0x7d0f('0x3a')],_0xdafacb[_0x7d0f('0x3c')]),_0x315ddc);if(_0x9a06a3[_0x7d0f('0x3a')][_0x7d0f('0x45')]){_0x37af9a[_0x7d0f('0x44')]=_['merge'](_0x37af9a['where'],{'$or':_[_0x7d0f('0x39')](_0x315ddc,function(_0x2e343f){if(_0x2e343f[_0x7d0f('0x36')]!==_0x7d0f('0x46')){var _0x267a89={};_0x267a89[_0x2e343f[_0x7d0f('0x32')]]={'$like':'%'+_0x9a06a3[_0x7d0f('0x3a')]['filter']+'%'};return _0x267a89;}})});}_0x37af9a=_[_0x7d0f('0x47')]({},_0x37af9a,_0x9a06a3['options']);var _0x1afcf2={'where':_0x37af9a[_0x7d0f('0x44')]};return db['OpenchannelQueue'][_0x7d0f('0x25')](_0x1afcf2)[_0x7d0f('0x2c')](function(_0x289a65){_0x10af00[_0x7d0f('0x25')]=_0x289a65;if(_0x9a06a3[_0x7d0f('0x3a')][_0x7d0f('0x48')]){_0x37af9a[_0x7d0f('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x7d0f('0x4a')](_0x37af9a);})['then'](function(_0xb07061){_0x10af00[_0x7d0f('0x4b')]=_0xb07061;return _0x10af00;})['then'](respondWithFilteredResult(_0x36bf68,_0x37af9a))[_0x7d0f('0x4c')](handleError(_0x36bf68,null));};exports[_0x7d0f('0x4d')]=function(_0x16f472,_0x3a2a87){var _0x495e50={'raw':!![],'where':{'id':_0x16f472[_0x7d0f('0x4e')]['id']}},_0x55f4b8={};_0x55f4b8[_0x7d0f('0x38')]=_['keys'](db[_0x7d0f('0x4f')][_0x7d0f('0x50')]);_0x55f4b8[_0x7d0f('0x3a')]=_[_0x7d0f('0x3b')](_0x16f472['query']);_0x55f4b8[_0x7d0f('0x3c')]=_[_0x7d0f('0x3e')](_0x55f4b8['model'],_0x55f4b8[_0x7d0f('0x3a')]);_0x495e50[_0x7d0f('0x3d')]=_['intersection'](_0x55f4b8['model'],qs['fields'](_0x16f472[_0x7d0f('0x3a')][_0x7d0f('0x3f')]));_0x495e50[_0x7d0f('0x3d')]=_0x495e50['attributes'][_0x7d0f('0x40')]?_0x495e50['attributes']:_0x55f4b8[_0x7d0f('0x38')];if(_0x16f472['query'][_0x7d0f('0x48')]){_0x495e50['include']=[{'all':!![]}];}_0x495e50=_['merge']({},_0x495e50,_0x16f472[_0x7d0f('0x51')]);return db[_0x7d0f('0x4f')][_0x7d0f('0x52')](_0x495e50)['then'](handleEntityNotFound(_0x3a2a87,null))[_0x7d0f('0x2c')](respondWithResult(_0x3a2a87,null))[_0x7d0f('0x4c')](handleError(_0x3a2a87,null));};exports[_0x7d0f('0x53')]=function(_0x113d4b,_0x8dfc82){return db['OpenchannelQueue'][_0x7d0f('0x53')](_0x113d4b[_0x7d0f('0x54')],{})[_0x7d0f('0x2c')](function(_0x33d900){var _0x4f9b34=_0x113d4b[_0x7d0f('0x55')][_0x7d0f('0x2e')]({'plain':!![]});if(!_0x4f9b34)throw new Error(_0x7d0f('0x56'));if(_0x4f9b34[_0x7d0f('0x57')]===_0x7d0f('0x55')){var _0x28e006=_0x33d900[_0x7d0f('0x2e')]({'plain':!![]});var _0x19c937=_0x7d0f('0x2f');return db[_0x7d0f('0x58')][_0x7d0f('0x52')]({'where':{'name':_0x19c937,'userProfileId':_0x4f9b34[_0x7d0f('0x59')]},'raw':!![]})['then'](function(_0x5ced66){if(_0x5ced66&&_0x5ced66[_0x7d0f('0x5a')]===0x0){return db['UserProfileResource'][_0x7d0f('0x53')]({'name':_0x28e006['name'],'resourceId':_0x28e006['id'],'type':_0x5ced66[_0x7d0f('0x32')],'sectionId':_0x5ced66['id']},{})[_0x7d0f('0x2c')](function(){return _0x33d900;});}else{return _0x33d900;}})['catch'](function(_0x4ef08c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ef08c);throw _0x4ef08c;});}return _0x33d900;})[_0x7d0f('0x2c')](respondWithResult(_0x8dfc82,0xc9))[_0x7d0f('0x4c')](handleError(_0x8dfc82,null));};exports[_0x7d0f('0x2b')]=function(_0x58853e,_0x233ac8){if(_0x58853e['body']['id']){delete _0x58853e[_0x7d0f('0x54')]['id'];}return db[_0x7d0f('0x4f')][_0x7d0f('0x52')]({'where':{'id':_0x58853e[_0x7d0f('0x4e')]['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0x233ac8,null))[_0x7d0f('0x2c')](saveUpdates(_0x58853e['body'],null))['then'](respondWithResult(_0x233ac8,null))[_0x7d0f('0x4c')](handleError(_0x233ac8,null));};exports[_0x7d0f('0x2d')]=function(_0x3c5050,_0x567dad){return db[_0x7d0f('0x4f')]['find']({'where':{'id':_0x3c5050['params']['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0x567dad,null))['then'](removeEntity(_0x567dad,null))[_0x7d0f('0x4c')](handleError(_0x567dad,null));};exports['describe']=function(_0x2fe39b,_0x378625){return db[_0x7d0f('0x4f')]['describe']()[_0x7d0f('0x2c')](respondWithResult(_0x378625,null))[_0x7d0f('0x4c')](handleError(_0x378625,null));};exports[_0x7d0f('0x5b')]=function(_0x1d11b,_0x503158,_0x2b4544){var _0xcc72aa={'raw':!![],'where':{}},_0x7f69fa={},_0x30e0c9;return db[_0x7d0f('0x4f')]['findOne']({'where':{'id':_0x1d11b[_0x7d0f('0x4e')]['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0x503158,null))['then'](function(_0x5f2894){if(_0x5f2894){_0x30e0c9=_0x5f2894['get']({'plain':!![]});_0x7f69fa[_0x7d0f('0x38')]=_[_0x7d0f('0x3b')](db[_0x7d0f('0x5c')][_0x7d0f('0x50')]);_0x7f69fa['query']=_['keys'](_0x1d11b[_0x7d0f('0x3a')]);_0x7f69fa[_0x7d0f('0x3c')]=_[_0x7d0f('0x3e')](_0x7f69fa['model'],_0x7f69fa[_0x7d0f('0x3a')]);_0xcc72aa[_0x7d0f('0x3d')]=_['intersection'](_0x7f69fa['model'],qs[_0x7d0f('0x3f')](_0x1d11b[_0x7d0f('0x3a')][_0x7d0f('0x3f')]));_0xcc72aa[_0x7d0f('0x3d')]=_0xcc72aa[_0x7d0f('0x3d')]['length']?_0xcc72aa['attributes']:_0x7f69fa[_0x7d0f('0x38')];if(!_0x1d11b[_0x7d0f('0x3a')]['hasOwnProperty'](_0x7d0f('0x42'))){_0xcc72aa[_0x7d0f('0x24')]=qs[_0x7d0f('0x24')](_0x1d11b[_0x7d0f('0x3a')][_0x7d0f('0x24')]);_0xcc72aa[_0x7d0f('0x22')]=qs['offset'](_0x1d11b[_0x7d0f('0x3a')][_0x7d0f('0x22')]);}_0xcc72aa[_0x7d0f('0x43')]=qs[_0x7d0f('0x5d')](_0x1d11b['query']['sort']);_0xcc72aa[_0x7d0f('0x44')]=qs[_0x7d0f('0x3c')](_['pick'](_0x1d11b[_0x7d0f('0x3a')],_0x7f69fa['filters']));_0xcc72aa[_0x7d0f('0x44')][_0x7d0f('0x5e')]=_0x5f2894['id'];if(_0x1d11b[_0x7d0f('0x3a')][_0x7d0f('0x45')]){_0xcc72aa[_0x7d0f('0x44')]=_[_0x7d0f('0x47')](_0xcc72aa[_0x7d0f('0x44')],{'$or':_[_0x7d0f('0x39')](_0xcc72aa[_0x7d0f('0x3d')],function(_0x5b4ef9){var _0x10c94b={};_0x10c94b[_0x5b4ef9]={'$like':'%'+_0x1d11b[_0x7d0f('0x3a')][_0x7d0f('0x45')]+'%'};return _0x10c94b;})});}_0xcc72aa=_[_0x7d0f('0x47')]({},_0xcc72aa,_0x1d11b[_0x7d0f('0x51')]);return db[_0x7d0f('0x5c')][_0x7d0f('0x4a')](_0xcc72aa);}})[_0x7d0f('0x2c')](function(_0x3e8882){if(_0x3e8882){return db[_0x7d0f('0x5f')][_0x7d0f('0x60')]({'where':{'id':_[_0x7d0f('0x39')](_0x3e8882,_0x7d0f('0x61')),'role':_0x7d0f('0x62')},'attributes':['id',_0x7d0f('0x32'),_0x7d0f('0x63'),'updatedAt',_0x7d0f('0x64')]});}})[_0x7d0f('0x2c')](function(_0xa989b4){if(_0xa989b4){return{'count':_0xa989b4[_0x7d0f('0x25')],'rows':_[_0x7d0f('0x39')](_0xa989b4[_0x7d0f('0x4b')],function(_0xc893b4){return{'membername':_0xc893b4[_0x7d0f('0x32')],'UserId':_0xc893b4['id'],'queue_name':_0x30e0c9[_0x7d0f('0x32')],'OpenchannelQueueId':_0x30e0c9['id'],'interface':util[_0x7d0f('0x65')](_0x7d0f('0x66'),'SIP',_0xc893b4[_0x7d0f('0x32')]),'penalty':0x0,'paused':_0xc893b4['openchannelPause'],'createdAt':_0xc893b4['createdAt'],'updatedAt':_0xc893b4[_0x7d0f('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7d0f('0x2c')](respondWithFilteredResult(_0x503158,_0xcc72aa))[_0x7d0f('0x4c')](handleError(_0x503158,null));};exports[_0x7d0f('0x68')]=function(_0x3fe24f,_0x4f8f09,_0x3fbb84){var _0xb0665b={};var _0x36dc7f={};var _0x40fd0e;var _0x3a3c8c;return db[_0x7d0f('0x4f')][_0x7d0f('0x69')]({'where':{'id':_0x3fe24f[_0x7d0f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f8f09,null))[_0x7d0f('0x2c')](function(_0x1651c7){if(_0x1651c7){_0x40fd0e=_0x1651c7;_0x36dc7f['model']=_['keys'](db[_0x7d0f('0x6a')][_0x7d0f('0x50')]);_0x36dc7f[_0x7d0f('0x3a')]=_[_0x7d0f('0x3b')](_0x3fe24f[_0x7d0f('0x3a')]);_0x36dc7f[_0x7d0f('0x3c')]=_[_0x7d0f('0x3e')](_0x36dc7f[_0x7d0f('0x38')],_0x36dc7f['query']);_0xb0665b['attributes']=_[_0x7d0f('0x3e')](_0x36dc7f['model'],qs[_0x7d0f('0x3f')](_0x3fe24f[_0x7d0f('0x3a')][_0x7d0f('0x3f')]));_0xb0665b[_0x7d0f('0x3d')]=_0xb0665b[_0x7d0f('0x3d')]['length']?_0xb0665b[_0x7d0f('0x3d')]:_0x36dc7f[_0x7d0f('0x38')];_0xb0665b[_0x7d0f('0x43')]=qs[_0x7d0f('0x5d')](_0x3fe24f[_0x7d0f('0x3a')][_0x7d0f('0x5d')]);_0xb0665b[_0x7d0f('0x44')]=qs['filters'](_[_0x7d0f('0x6b')](_0x3fe24f[_0x7d0f('0x3a')],_0x36dc7f[_0x7d0f('0x3c')]));if(_0x3fe24f[_0x7d0f('0x3a')]['filter']){_0xb0665b['where']=_['merge'](_0xb0665b['where'],{'$or':_[_0x7d0f('0x39')](_0xb0665b['attributes'],function(_0x2b9a82){var _0x3c9def={};_0x3c9def[_0x2b9a82]={'$like':'%'+_0x3fe24f[_0x7d0f('0x3a')]['filter']+'%'};return _0x3c9def;})});}_0xb0665b=_[_0x7d0f('0x47')]({},_0xb0665b,_0x3fe24f[_0x7d0f('0x51')]);return _0x40fd0e[_0x7d0f('0x68')](_0xb0665b);}})['then'](function(_0x16b753){if(_0x16b753){_0x3a3c8c=_0x16b753['length'];if(!_0x3fe24f[_0x7d0f('0x3a')][_0x7d0f('0x41')](_0x7d0f('0x42'))){_0xb0665b[_0x7d0f('0x24')]=qs[_0x7d0f('0x24')](_0x3fe24f[_0x7d0f('0x3a')][_0x7d0f('0x24')]);_0xb0665b['offset']=qs[_0x7d0f('0x22')](_0x3fe24f[_0x7d0f('0x3a')][_0x7d0f('0x22')]);}return _0x40fd0e[_0x7d0f('0x68')](_0xb0665b);}})[_0x7d0f('0x2c')](function(_0x449471){if(_0x449471){return _0x449471?{'count':_0x3a3c8c,'rows':_0x449471}:null;}})[_0x7d0f('0x2c')](respondWithResult(_0x4f8f09,null))[_0x7d0f('0x4c')](handleError(_0x4f8f09,null));};exports['addTeams']=function(_0xf04a60,_0x1bb130,_0x39aaa4){var _0xe9603a=_0xf04a60[_0x7d0f('0x54')][_0x7d0f('0x6c')];return db[_0x7d0f('0x6a')][_0x7d0f('0x4a')]({'where':{'id':_0xe9603a},'attributes':['id'],'include':[{'model':db[_0x7d0f('0x5f')],'as':_0x7d0f('0x6d'),'attributes':['id',_0x7d0f('0x32'),_0x7d0f('0x6e'),_0x7d0f('0x6f'),_0x7d0f('0x70')],'raw':!![]}]})[_0x7d0f('0x2c')](function(_0x1fb698){if(_0x1fb698){var _0x32b51a=_[_0x7d0f('0x71')](_0x1fb698,function(_0x41d29e){var _0x42f9a3=_0x41d29e[_0x7d0f('0x2e')]({'plain':!![]});return _0x42f9a3[_0x7d0f('0x6d')];});return db[_0x7d0f('0x4f')]['find']({'where':{'id':_0xf04a60[_0x7d0f('0x4e')]['id']}})[_0x7d0f('0x2c')](function(_0x145a30){return db['sequelize'][_0x7d0f('0x72')](function(_0x54e214){return _0x145a30['addTeams'](_0xe9603a,{'transaction':_0x54e214})['then'](function(){return BPromise[_0x7d0f('0x73')](_0x32b51a,function(_0x4d9c9c){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x4d9c9c['id'],'OpenchannelQueueId':_0xf04a60['params']['id']},'transaction':_0x54e214});});})[_0x7d0f('0x2c')](function(){_0x32b51a[_0x7d0f('0x74')](function(_0x4eb8e1){socket[_0x7d0f('0x75')]('userOpenchannelQueue:save',{'UserId':_0x4eb8e1['id'],'OpenchannelQueueId':_0x145a30['id']});});});});});}})[_0x7d0f('0x2c')](respondWithStatusCode(_0x1bb130,null))[_0x7d0f('0x4c')](handleError(_0x1bb130,null));};exports[_0x7d0f('0x76')]=function(_0x58d8ec,_0x5cc6a6,_0x18c6e8){return db[_0x7d0f('0x6a')][_0x7d0f('0x4a')]({'where':{'id':_0x58d8ec[_0x7d0f('0x3a')][_0x7d0f('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7d0f('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7d0f('0x2c')](handleEntityNotFound(_0x5cc6a6,null))[_0x7d0f('0x2c')](function(_0x123b25){var _0x3755e3=_[_0x7d0f('0x39')](_0x123b25,'id');var _0x33e8ae=[];var _0x1ebf5e=[];var _0x1ca7c8=squel[_0x7d0f('0x77')]();_0x1ca7c8[_0x7d0f('0x78')]('tq.TeamId')[_0x7d0f('0x79')](_0x7d0f('0x7a'),'tq')['join'](_0x7d0f('0x7b'),'ut',_0x7d0f('0x7c'))[_0x7d0f('0x44')](_0x7d0f('0x7d'),_0x58d8ec['params']['id']);for(var _0x2bffc5=0x0;_0x2bffc5<_0x123b25[_0x7d0f('0x40')];_0x2bffc5+=0x1){let _0x4596c7=_0x123b25[_0x2bffc5];for(var _0xf21aed=0x0;_0xf21aed<_0x4596c7[_0x7d0f('0x6d')][_0x7d0f('0x40')];_0xf21aed+=0x1){let _0x2a07a3=_0x4596c7['Agents'][_0xf21aed];var _0x5d05ef=_0x1ca7c8[_0x7d0f('0x7e')]();_0x5d05ef[_0x7d0f('0x44')](_0x7d0f('0x7f'),_0x2a07a3['id']);_0x1ebf5e[_0x7d0f('0x80')](db[_0x7d0f('0x81')][_0x7d0f('0x3a')](_0x5d05ef['toString'](),{'type':db['sequelize'][_0x7d0f('0x82')][_0x7d0f('0x83')]})[_0x7d0f('0x2c')](function(_0x171e27){if(_0x171e27[_0x7d0f('0x40')]===0x1){return _0x2a07a3['id'];}else{var _0x80fd76=_[_0x7d0f('0x84')](_['map'](_0x171e27,_0x7d0f('0x85')),function(_0x1afb4d){return _[_0x7d0f('0x86')](_0x3755e3,_0x1afb4d);});if(_0x80fd76){return _0x2a07a3['id'];}}}));}}return BPromise[_0x7d0f('0x87')](_0x1ebf5e)[_0x7d0f('0x2c')](function(_0x4ea906){_0x33e8ae=_(_0x33e8ae)[_0x7d0f('0x88')](_0x4ea906)[_0x7d0f('0x89')]()[_0x7d0f('0x8a')]();return db[_0x7d0f('0x4f')][_0x7d0f('0x52')]({'where':{'id':_0x58d8ec[_0x7d0f('0x4e')]['id']}})['then'](function(_0x1b7f6d){return db[_0x7d0f('0x81')][_0x7d0f('0x72')](function(_0x47575e){return _0x1b7f6d['removeTeams'](_0x58d8ec[_0x7d0f('0x3a')]['ids'],{'transaction':_0x47575e})['then'](function(){if(!_[_0x7d0f('0x8b')](_0x33e8ae)){return _0x1b7f6d['removeAgents'](_0x33e8ae,{'transaction':_0x47575e});}})['then'](function(){_0x33e8ae[_0x7d0f('0x74')](function(_0x5d0821){socket[_0x7d0f('0x75')](_0x7d0f('0x8c'),{'UserId':_0x5d0821,'OpenchannelQueueId':_0x1b7f6d['id']});});});});});});})['then'](respondWithStatusCode(_0x5cc6a6,null))[_0x7d0f('0x4c')](handleError(_0x5cc6a6,null));};exports[_0x7d0f('0x8d')]=function(_0x2e331f,_0xb11738,_0x4bf1cf){return db[_0x7d0f('0x4f')][_0x7d0f('0x52')]({'where':{'id':_0x2e331f[_0x7d0f('0x4e')]['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0xb11738,null))[_0x7d0f('0x2c')](function(_0x93d10b){if(_0x93d10b){return _0x93d10b[_0x7d0f('0x8d')](_0x2e331f[_0x7d0f('0x54')][_0x7d0f('0x6c')],_['omit'](_0x2e331f['body'],[_0x7d0f('0x6c'),'id'])||{})['spread'](function(_0x19914f){for(var _0x518e6b=0x0;_0x518e6b<_0x2e331f[_0x7d0f('0x54')]['ids'][_0x7d0f('0x40')];_0x518e6b+=0x1){socket[_0x7d0f('0x75')](_0x7d0f('0x8e'),{'UserId':Number(_0x2e331f[_0x7d0f('0x54')]['ids'][_0x518e6b]),'OpenchannelQueueId':Number(_0x2e331f[_0x7d0f('0x4e')]['id'])});}return _0x19914f;});}})[_0x7d0f('0x2c')](respondWithResult(_0xb11738,null))['catch'](handleError(_0xb11738,null));};exports[_0x7d0f('0x8f')]=function(_0x7962c5,_0xcdc78f,_0x118bcc){return db['OpenchannelQueue'][_0x7d0f('0x52')]({'where':{'id':_0x7962c5['params']['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0xcdc78f,null))[_0x7d0f('0x2c')](function(_0x15acb7){if(_0x15acb7){return _0x15acb7[_0x7d0f('0x8f')](_0x7962c5[_0x7d0f('0x3a')][_0x7d0f('0x6c')])[_0x7d0f('0x2c')](function(){if(_['isArray'](_0x7962c5[_0x7d0f('0x3a')]['ids'])){for(var _0x202748=0x0;_0x202748<_0x7962c5[_0x7d0f('0x3a')][_0x7d0f('0x6c')]['length'];_0x202748+=0x1){socket[_0x7d0f('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x7962c5['query'][_0x7d0f('0x6c')][_0x202748]),'OpenchannelQueueId':Number(_0x7962c5[_0x7d0f('0x4e')]['id'])});}}else{socket[_0x7d0f('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x7962c5['query']['ids']),'OpenchannelQueueId':Number(_0x7962c5[_0x7d0f('0x4e')]['id'])});}});}})[_0x7d0f('0x2c')](respondWithStatusCode(_0xcdc78f,null))[_0x7d0f('0x4c')](handleError(_0xcdc78f,null));};exports[_0x7d0f('0x90')]=function(_0x2a30e9,_0xd1e5be,_0x4d7fee){var _0x117299={};var _0x2740f5={};var _0x46e40f;var _0x312b10;return db['OpenchannelQueue'][_0x7d0f('0x69')]({'where':{'id':_0x2a30e9[_0x7d0f('0x4e')]['id']}})[_0x7d0f('0x2c')](handleEntityNotFound(_0xd1e5be,null))[_0x7d0f('0x2c')](function(_0xa6c6d0){if(_0xa6c6d0){_0x46e40f=_0xa6c6d0;_0x2740f5[_0x7d0f('0x38')]=_[_0x7d0f('0x3b')](db[_0x7d0f('0x5f')][_0x7d0f('0x50')]);_0x2740f5[_0x7d0f('0x3a')]=_[_0x7d0f('0x3b')](_0x2a30e9[_0x7d0f('0x3a')]);_0x2740f5['filters']=_[_0x7d0f('0x3e')](_0x2740f5['model'],_0x2740f5[_0x7d0f('0x3a')]);_0x117299[_0x7d0f('0x3d')]=_['intersection'](_0x2740f5[_0x7d0f('0x38')],qs['fields'](_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x3f')]));_0x117299[_0x7d0f('0x3d')]=_0x117299[_0x7d0f('0x3d')][_0x7d0f('0x40')]?_0x117299['attributes']:_0x2740f5['model'];_0x117299[_0x7d0f('0x43')]=qs[_0x7d0f('0x5d')](_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x5d')]);_0x117299[_0x7d0f('0x44')]=qs[_0x7d0f('0x3c')](_[_0x7d0f('0x6b')](_0x2a30e9[_0x7d0f('0x3a')],_0x2740f5[_0x7d0f('0x3c')]));if(_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x45')]){_0x117299[_0x7d0f('0x44')]=_[_0x7d0f('0x47')](_0x117299['where'],{'$or':_[_0x7d0f('0x39')](_0x117299[_0x7d0f('0x3d')],function(_0x586950){var _0x4b078f={};_0x4b078f[_0x586950]={'$like':'%'+_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x45')]+'%'};return _0x4b078f;})});}_0x117299=_[_0x7d0f('0x47')]({},_0x117299,_0x2a30e9[_0x7d0f('0x51')]);return _0x46e40f[_0x7d0f('0x90')](_0x117299);}})[_0x7d0f('0x2c')](function(_0x41ef45){if(_0x41ef45){_0x312b10=_0x41ef45[_0x7d0f('0x40')];if(!_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x41')](_0x7d0f('0x42'))){_0x117299[_0x7d0f('0x24')]=qs['limit'](_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x24')]);_0x117299['offset']=qs[_0x7d0f('0x22')](_0x2a30e9[_0x7d0f('0x3a')][_0x7d0f('0x22')]);}return _0x46e40f[_0x7d0f('0x90')](_0x117299);}})[_0x7d0f('0x2c')](function(_0x159c37){if(_0x159c37){return _0x159c37?{'count':_0x312b10,'rows':_0x159c37}:null;}})[_0x7d0f('0x2c')](respondWithResult(_0xd1e5be,null))[_0x7d0f('0x4c')](handleError(_0xd1e5be,null));}; \ No newline at end of file +var _0x5a2f=['isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','OpenchannelQueues','then','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','includeAll','create','body','user','autoAssociation','UserProfileResource','find','params','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','nolimit','OpenchannelQueueId','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Team','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x652ed6,_0x1b6658){var _0x39fa7b=function(_0x423471){while(--_0x423471){_0x652ed6['push'](_0x652ed6['shift']());}};_0x39fa7b(++_0x1b6658);}(_0x5a2f,0x1a3));var _0xf5a2=function(_0x2ee1bb,_0x285c88){_0x2ee1bb=_0x2ee1bb-0x0;var _0x496278=_0x5a2f[_0x2ee1bb];return _0x496278;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5a2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5a2('0x1'));var rp=require(_0xf5a2('0x2'));var moment=require(_0xf5a2('0x3'));var BPromise=require(_0xf5a2('0x4'));var Mustache=require('mustache');var util=require(_0xf5a2('0x5'));var path=require(_0xf5a2('0x6'));var sox=require('sox');var csv=require(_0xf5a2('0x7'));var ejs=require(_0xf5a2('0x8'));var fs=require('fs');var fs_extra=require(_0xf5a2('0x9'));var _=require(_0xf5a2('0xa'));var squel=require(_0xf5a2('0xb'));var crypto=require('crypto');var jsforce=require(_0xf5a2('0xc'));var deskjs=require(_0xf5a2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf5a2('0xe'));var Papa=require(_0xf5a2('0xf'));var Redis=require(_0xf5a2('0x10'));var authService=require(_0xf5a2('0x11'));var qs=require(_0xf5a2('0x12'));var as=require(_0xf5a2('0x13'));var hardwareService=require(_0xf5a2('0x14'));var logger=require(_0xf5a2('0x15'))(_0xf5a2('0x16'));var utils=require(_0xf5a2('0x17'));var config=require(_0xf5a2('0x18'));var licenseUtil=require(_0xf5a2('0x19'));var db=require(_0xf5a2('0x1a'))['db'];config[_0xf5a2('0x1b')]=_[_0xf5a2('0x1c')](config[_0xf5a2('0x1b')],{'host':_0xf5a2('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5a2('0x1b')]));require(_0xf5a2('0x1e'))[_0xf5a2('0x1f')](socket);function respondWithStatusCode(_0x1c4008,_0x2c4cf2){_0x2c4cf2=_0x2c4cf2||0xcc;return function(_0x535e35){if(_0x535e35){return _0x1c4008[_0xf5a2('0x20')](_0x2c4cf2);}return _0x1c4008[_0xf5a2('0x21')](_0x2c4cf2)['end']();};}function respondWithResult(_0x225e80,_0x450efc){_0x450efc=_0x450efc||0xc8;return function(_0x282445){if(_0x282445){return _0x225e80[_0xf5a2('0x21')](_0x450efc)[_0xf5a2('0x22')](_0x282445);}};}function respondWithFilteredResult(_0x1b2454,_0x41e1a8){return function(_0x767cbd){if(_0x767cbd){var _0x8ce760=typeof _0x41e1a8[_0xf5a2('0x23')]===_0xf5a2('0x24')&&typeof _0x41e1a8[_0xf5a2('0x25')]==='undefined';var _0x451d02=_0x767cbd[_0xf5a2('0x26')];var _0x4aee58=_0x8ce760?0x0:_0x41e1a8[_0xf5a2('0x23')];var _0x38357b=_0x8ce760?_0x767cbd['count']:_0x41e1a8['offset']+_0x41e1a8[_0xf5a2('0x25')];var _0x1b1397;if(_0x38357b>=_0x451d02){_0x38357b=_0x451d02;_0x1b1397=0xc8;}else{_0x1b1397=0xce;}_0x1b2454[_0xf5a2('0x21')](_0x1b1397);return _0x1b2454[_0xf5a2('0x27')](_0xf5a2('0x28'),_0x4aee58+'-'+_0x38357b+'/'+_0x451d02)[_0xf5a2('0x22')](_0x767cbd);}return null;};}function patchUpdates(_0x290be9){return function(_0x2b2a60){try{jsonpatch['apply'](_0x2b2a60,_0x290be9,!![]);}catch(_0x5d12a2){return BPromise[_0xf5a2('0x29')](_0x5d12a2);}return _0x2b2a60['save']();};}function saveUpdates(_0x2db1ac,_0x1d8bec){return function(_0x3d8487){if(_0x3d8487){return _0x3d8487[_0xf5a2('0x2a')](_0x2db1ac)['then'](function(_0x3d1ec7){return _0x3d1ec7;});}return null;};}function removeEntity(_0x380e8b,_0x4a4011){return function(_0x21e810){if(_0x21e810){return _0x21e810[_0xf5a2('0x2b')]()['then'](function(){var _0xac72f3=_0x21e810[_0xf5a2('0x2c')]({'plain':!![]});var _0xcd4e69=_0xf5a2('0x2d');return db['UserProfileResource'][_0xf5a2('0x2b')]({'where':{'type':_0xcd4e69,'resourceId':_0xac72f3['id']}})[_0xf5a2('0x2e')](function(){return _0x21e810;});})['then'](function(){_0x380e8b[_0xf5a2('0x21')](0xcc)[_0xf5a2('0x2f')]();});}};}function handleEntityNotFound(_0x188786,_0x149c1a){return function(_0x169bf3){if(!_0x169bf3){_0x188786[_0xf5a2('0x20')](0x194);}return _0x169bf3;};}function handleError(_0x568cbf,_0x2e62d4){_0x2e62d4=_0x2e62d4||0x1f4;return function(_0x3820d9){logger[_0xf5a2('0x30')](_0x3820d9[_0xf5a2('0x31')]);if(_0x3820d9[_0xf5a2('0x32')]){delete _0x3820d9[_0xf5a2('0x32')];}_0x568cbf['status'](_0x2e62d4)[_0xf5a2('0x33')](_0x3820d9);};}exports[_0xf5a2('0x34')]=function(_0x33dfa2,_0x40f8f4){var _0x12dc79={},_0x5ef5b4={},_0x4a3f74={'count':0x0,'rows':[]};var _0x4a5cd8=_[_0xf5a2('0x35')](db[_0xf5a2('0x36')][_0xf5a2('0x37')],function(_0x45f0d4){return{'name':_0x45f0d4[_0xf5a2('0x38')],'type':_0x45f0d4[_0xf5a2('0x39')][_0xf5a2('0x3a')]};});_0x5ef5b4[_0xf5a2('0x3b')]=_[_0xf5a2('0x35')](_0x4a5cd8,_0xf5a2('0x32'));_0x5ef5b4[_0xf5a2('0x3c')]=_[_0xf5a2('0x3d')](_0x33dfa2[_0xf5a2('0x3c')]);_0x5ef5b4['filters']=_['intersection'](_0x5ef5b4[_0xf5a2('0x3b')],_0x5ef5b4['query']);_0x12dc79[_0xf5a2('0x3e')]=_[_0xf5a2('0x3f')](_0x5ef5b4['model'],qs[_0xf5a2('0x40')](_0x33dfa2[_0xf5a2('0x3c')][_0xf5a2('0x40')]));_0x12dc79[_0xf5a2('0x3e')]=_0x12dc79[_0xf5a2('0x3e')][_0xf5a2('0x41')]?_0x12dc79[_0xf5a2('0x3e')]:_0x5ef5b4['model'];if(!_0x33dfa2[_0xf5a2('0x3c')]['hasOwnProperty']('nolimit')){_0x12dc79[_0xf5a2('0x25')]=qs[_0xf5a2('0x25')](_0x33dfa2['query'][_0xf5a2('0x25')]);_0x12dc79[_0xf5a2('0x23')]=qs[_0xf5a2('0x23')](_0x33dfa2['query'][_0xf5a2('0x23')]);}_0x12dc79[_0xf5a2('0x42')]=qs[_0xf5a2('0x43')](_0x33dfa2[_0xf5a2('0x3c')]['sort']);_0x12dc79[_0xf5a2('0x44')]=qs[_0xf5a2('0x45')](_[_0xf5a2('0x46')](_0x33dfa2['query'],_0x5ef5b4[_0xf5a2('0x45')]),_0x4a5cd8);if(_0x33dfa2['query'][_0xf5a2('0x47')]){_0x12dc79['where']=_[_0xf5a2('0x48')](_0x12dc79[_0xf5a2('0x44')],{'$or':_['map'](_0x4a5cd8,function(_0xeb3fff){if(_0xeb3fff[_0xf5a2('0x39')]!==_0xf5a2('0x49')){var _0x5b0249={};_0x5b0249[_0xeb3fff[_0xf5a2('0x32')]]={'$like':'%'+_0x33dfa2[_0xf5a2('0x3c')][_0xf5a2('0x47')]+'%'};return _0x5b0249;}})});}_0x12dc79=_[_0xf5a2('0x48')]({},_0x12dc79,_0x33dfa2[_0xf5a2('0x4a')]);var _0x3d2ca7={'where':_0x12dc79[_0xf5a2('0x44')]};return db[_0xf5a2('0x36')]['count'](_0x3d2ca7)[_0xf5a2('0x2e')](function(_0x1ec38f){_0x4a3f74[_0xf5a2('0x26')]=_0x1ec38f;if(_0x33dfa2[_0xf5a2('0x3c')]['includeAll']){_0x12dc79[_0xf5a2('0x4b')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x12dc79);})['then'](function(_0x492ae3){_0x4a3f74[_0xf5a2('0x4c')]=_0x492ae3;return _0x4a3f74;})['then'](respondWithFilteredResult(_0x40f8f4,_0x12dc79))[_0xf5a2('0x4d')](handleError(_0x40f8f4,null));};exports['show']=function(_0x18c620,_0x1f0c60){var _0x26c048={'raw':!![],'where':{'id':_0x18c620['params']['id']}},_0x328708={};_0x328708[_0xf5a2('0x3b')]=_[_0xf5a2('0x3d')](db[_0xf5a2('0x36')]['rawAttributes']);_0x328708[_0xf5a2('0x3c')]=_[_0xf5a2('0x3d')](_0x18c620[_0xf5a2('0x3c')]);_0x328708[_0xf5a2('0x45')]=_['intersection'](_0x328708[_0xf5a2('0x3b')],_0x328708['query']);_0x26c048['attributes']=_[_0xf5a2('0x3f')](_0x328708[_0xf5a2('0x3b')],qs[_0xf5a2('0x40')](_0x18c620[_0xf5a2('0x3c')][_0xf5a2('0x40')]));_0x26c048['attributes']=_0x26c048['attributes'][_0xf5a2('0x41')]?_0x26c048['attributes']:_0x328708[_0xf5a2('0x3b')];if(_0x18c620[_0xf5a2('0x3c')][_0xf5a2('0x4e')]){_0x26c048[_0xf5a2('0x4b')]=[{'all':!![]}];}_0x26c048=_['merge']({},_0x26c048,_0x18c620[_0xf5a2('0x4a')]);return db[_0xf5a2('0x36')]['find'](_0x26c048)[_0xf5a2('0x2e')](handleEntityNotFound(_0x1f0c60,null))[_0xf5a2('0x2e')](respondWithResult(_0x1f0c60,null))[_0xf5a2('0x4d')](handleError(_0x1f0c60,null));};exports[_0xf5a2('0x4f')]=function(_0x498db7,_0x2b1b12){return db[_0xf5a2('0x36')][_0xf5a2('0x4f')](_0x498db7[_0xf5a2('0x50')],{})[_0xf5a2('0x2e')](function(_0x1ecc55){var _0x27ad0c=_0x498db7[_0xf5a2('0x51')][_0xf5a2('0x2c')]({'plain':!![]});if(!_0x27ad0c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27ad0c['role']===_0xf5a2('0x51')){var _0x4f9a0f=_0x1ecc55[_0xf5a2('0x2c')]({'plain':!![]});var _0x2f57ee=_0xf5a2('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x2f57ee,'userProfileId':_0x27ad0c['userProfileId']},'raw':!![]})['then'](function(_0x70af5d){if(_0x70af5d&&_0x70af5d[_0xf5a2('0x52')]===0x0){return db[_0xf5a2('0x53')][_0xf5a2('0x4f')]({'name':_0x4f9a0f[_0xf5a2('0x32')],'resourceId':_0x4f9a0f['id'],'type':_0x70af5d[_0xf5a2('0x32')],'sectionId':_0x70af5d['id']},{})['then'](function(){return _0x1ecc55;});}else{return _0x1ecc55;}})[_0xf5a2('0x4d')](function(_0x1c2670){logger[_0xf5a2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c2670);throw _0x1c2670;});}return _0x1ecc55;})['then'](respondWithResult(_0x2b1b12,0xc9))[_0xf5a2('0x4d')](handleError(_0x2b1b12,null));};exports[_0xf5a2('0x2a')]=function(_0x1dc09b,_0x320aea){if(_0x1dc09b['body']['id']){delete _0x1dc09b['body']['id'];}return db[_0xf5a2('0x36')][_0xf5a2('0x54')]({'where':{'id':_0x1dc09b['params']['id']}})[_0xf5a2('0x2e')](handleEntityNotFound(_0x320aea,null))[_0xf5a2('0x2e')](saveUpdates(_0x1dc09b[_0xf5a2('0x50')],null))[_0xf5a2('0x2e')](respondWithResult(_0x320aea,null))['catch'](handleError(_0x320aea,null));};exports[_0xf5a2('0x2b')]=function(_0x4c7bdf,_0x213fe7){return db['OpenchannelQueue'][_0xf5a2('0x54')]({'where':{'id':_0x4c7bdf[_0xf5a2('0x55')]['id']}})['then'](handleEntityNotFound(_0x213fe7,null))[_0xf5a2('0x2e')](removeEntity(_0x213fe7,null))[_0xf5a2('0x4d')](handleError(_0x213fe7,null));};exports[_0xf5a2('0x56')]=function(_0x55e4f8,_0x489dc4){return db[_0xf5a2('0x36')][_0xf5a2('0x56')]()[_0xf5a2('0x2e')](respondWithResult(_0x489dc4,null))['catch'](handleError(_0x489dc4,null));};exports[_0xf5a2('0x57')]=function(_0x256d1f,_0x10da9b,_0x4362c0){var _0x8f81b4={'raw':!![],'where':{}},_0x569ce8={},_0x14b0fd;return db[_0xf5a2('0x36')]['findOne']({'where':{'id':_0x256d1f['params']['id']}})['then'](handleEntityNotFound(_0x10da9b,null))['then'](function(_0x23216f){if(_0x23216f){_0x14b0fd=_0x23216f[_0xf5a2('0x2c')]({'plain':!![]});_0x569ce8[_0xf5a2('0x3b')]=_['keys'](db[_0xf5a2('0x58')][_0xf5a2('0x37')]);_0x569ce8[_0xf5a2('0x3c')]=_[_0xf5a2('0x3d')](_0x256d1f[_0xf5a2('0x3c')]);_0x569ce8['filters']=_[_0xf5a2('0x3f')](_0x569ce8[_0xf5a2('0x3b')],_0x569ce8[_0xf5a2('0x3c')]);_0x8f81b4[_0xf5a2('0x3e')]=_[_0xf5a2('0x3f')](_0x569ce8[_0xf5a2('0x3b')],qs[_0xf5a2('0x40')](_0x256d1f[_0xf5a2('0x3c')]['fields']));_0x8f81b4[_0xf5a2('0x3e')]=_0x8f81b4['attributes'][_0xf5a2('0x41')]?_0x8f81b4[_0xf5a2('0x3e')]:_0x569ce8[_0xf5a2('0x3b')];if(!_0x256d1f['query'][_0xf5a2('0x59')](_0xf5a2('0x5a'))){_0x8f81b4['limit']=qs[_0xf5a2('0x25')](_0x256d1f[_0xf5a2('0x3c')]['limit']);_0x8f81b4[_0xf5a2('0x23')]=qs[_0xf5a2('0x23')](_0x256d1f[_0xf5a2('0x3c')]['offset']);}_0x8f81b4[_0xf5a2('0x42')]=qs[_0xf5a2('0x43')](_0x256d1f[_0xf5a2('0x3c')]['sort']);_0x8f81b4[_0xf5a2('0x44')]=qs[_0xf5a2('0x45')](_[_0xf5a2('0x46')](_0x256d1f[_0xf5a2('0x3c')],_0x569ce8[_0xf5a2('0x45')]));_0x8f81b4['where'][_0xf5a2('0x5b')]=_0x23216f['id'];if(_0x256d1f[_0xf5a2('0x3c')][_0xf5a2('0x47')]){_0x8f81b4[_0xf5a2('0x44')]=_[_0xf5a2('0x48')](_0x8f81b4[_0xf5a2('0x44')],{'$or':_[_0xf5a2('0x35')](_0x8f81b4[_0xf5a2('0x3e')],function(_0x3a2e9b){var _0x278400={};_0x278400[_0x3a2e9b]={'$like':'%'+_0x256d1f[_0xf5a2('0x3c')]['filter']+'%'};return _0x278400;})});}_0x8f81b4=_[_0xf5a2('0x48')]({},_0x8f81b4,_0x256d1f[_0xf5a2('0x4a')]);return db['UserOpenchannelQueue'][_0xf5a2('0x5c')](_0x8f81b4);}})['then'](function(_0x23057a){if(_0x23057a){return db['User'][_0xf5a2('0x5d')]({'where':{'id':_[_0xf5a2('0x35')](_0x23057a,_0xf5a2('0x5e')),'role':_0xf5a2('0x5f')},'attributes':['id',_0xf5a2('0x32'),_0xf5a2('0x60'),_0xf5a2('0x61'),_0xf5a2('0x62')]});}})[_0xf5a2('0x2e')](function(_0xfc223a){if(_0xfc223a){return{'count':_0xfc223a[_0xf5a2('0x26')],'rows':_['map'](_0xfc223a[_0xf5a2('0x4c')],function(_0x2bdf5b){return{'membername':_0x2bdf5b[_0xf5a2('0x32')],'UserId':_0x2bdf5b['id'],'queue_name':_0x14b0fd[_0xf5a2('0x32')],'OpenchannelQueueId':_0x14b0fd['id'],'interface':util[_0xf5a2('0x63')](_0xf5a2('0x64'),_0xf5a2('0x65'),_0x2bdf5b[_0xf5a2('0x32')]),'penalty':0x0,'paused':_0x2bdf5b[_0xf5a2('0x60')],'createdAt':_0x2bdf5b[_0xf5a2('0x62')],'updatedAt':_0x2bdf5b[_0xf5a2('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x10da9b,_0x8f81b4))[_0xf5a2('0x4d')](handleError(_0x10da9b,null));};exports[_0xf5a2('0x66')]=function(_0x31e171,_0x1069aa,_0x289c71){var _0x3b8d37={};var _0x495f02={};var _0x56870a;var _0x2f60d4;return db['OpenchannelQueue'][_0xf5a2('0x67')]({'where':{'id':_0x31e171[_0xf5a2('0x55')]['id']}})[_0xf5a2('0x2e')](handleEntityNotFound(_0x1069aa,null))[_0xf5a2('0x2e')](function(_0x479efe){if(_0x479efe){_0x56870a=_0x479efe;_0x495f02[_0xf5a2('0x3b')]=_[_0xf5a2('0x3d')](db['Team']['rawAttributes']);_0x495f02['query']=_[_0xf5a2('0x3d')](_0x31e171['query']);_0x495f02[_0xf5a2('0x45')]=_[_0xf5a2('0x3f')](_0x495f02[_0xf5a2('0x3b')],_0x495f02[_0xf5a2('0x3c')]);_0x3b8d37[_0xf5a2('0x3e')]=_[_0xf5a2('0x3f')](_0x495f02[_0xf5a2('0x3b')],qs[_0xf5a2('0x40')](_0x31e171[_0xf5a2('0x3c')][_0xf5a2('0x40')]));_0x3b8d37['attributes']=_0x3b8d37[_0xf5a2('0x3e')][_0xf5a2('0x41')]?_0x3b8d37[_0xf5a2('0x3e')]:_0x495f02[_0xf5a2('0x3b')];_0x3b8d37[_0xf5a2('0x42')]=qs[_0xf5a2('0x43')](_0x31e171[_0xf5a2('0x3c')][_0xf5a2('0x43')]);_0x3b8d37[_0xf5a2('0x44')]=qs[_0xf5a2('0x45')](_['pick'](_0x31e171[_0xf5a2('0x3c')],_0x495f02['filters']));if(_0x31e171[_0xf5a2('0x3c')][_0xf5a2('0x47')]){_0x3b8d37[_0xf5a2('0x44')]=_[_0xf5a2('0x48')](_0x3b8d37[_0xf5a2('0x44')],{'$or':_['map'](_0x3b8d37['attributes'],function(_0x1b7fb6){var _0x550709={};_0x550709[_0x1b7fb6]={'$like':'%'+_0x31e171['query'][_0xf5a2('0x47')]+'%'};return _0x550709;})});}_0x3b8d37=_[_0xf5a2('0x48')]({},_0x3b8d37,_0x31e171[_0xf5a2('0x4a')]);return _0x56870a[_0xf5a2('0x66')](_0x3b8d37);}})[_0xf5a2('0x2e')](function(_0xe1a760){if(_0xe1a760){_0x2f60d4=_0xe1a760[_0xf5a2('0x41')];if(!_0x31e171['query'][_0xf5a2('0x59')](_0xf5a2('0x5a'))){_0x3b8d37[_0xf5a2('0x25')]=qs[_0xf5a2('0x25')](_0x31e171[_0xf5a2('0x3c')][_0xf5a2('0x25')]);_0x3b8d37['offset']=qs['offset'](_0x31e171[_0xf5a2('0x3c')][_0xf5a2('0x23')]);}return _0x56870a[_0xf5a2('0x66')](_0x3b8d37);}})[_0xf5a2('0x2e')](function(_0x259c3e){if(_0x259c3e){return _0x259c3e?{'count':_0x2f60d4,'rows':_0x259c3e}:null;}})[_0xf5a2('0x2e')](respondWithResult(_0x1069aa,null))[_0xf5a2('0x4d')](handleError(_0x1069aa,null));};exports[_0xf5a2('0x68')]=function(_0x4b9532,_0x454351,_0x3c0a80){var _0x1c2541=_0x4b9532[_0xf5a2('0x50')][_0xf5a2('0x69')];return db[_0xf5a2('0x6a')][_0xf5a2('0x5c')]({'where':{'id':_0x1c2541},'attributes':['id'],'include':[{'model':db[_0xf5a2('0x6b')],'as':_0xf5a2('0x6c'),'attributes':['id',_0xf5a2('0x32'),_0xf5a2('0x6d'),_0xf5a2('0x6e'),_0xf5a2('0x6f')],'raw':!![]}]})[_0xf5a2('0x2e')](function(_0x50d758){if(_0x50d758){var _0x118c4d=_['flatMap'](_0x50d758,function(_0x2ba695){var _0x531ee6=_0x2ba695['get']({'plain':!![]});return _0x531ee6[_0xf5a2('0x6c')];});return db[_0xf5a2('0x36')][_0xf5a2('0x54')]({'where':{'id':_0x4b9532[_0xf5a2('0x55')]['id']}})[_0xf5a2('0x2e')](function(_0x9c5a73){return db[_0xf5a2('0x70')][_0xf5a2('0x71')](function(_0x501e56){return _0x9c5a73[_0xf5a2('0x68')](_0x1c2541,{'transaction':_0x501e56})[_0xf5a2('0x2e')](function(){return BPromise[_0xf5a2('0x72')](_0x118c4d,function(_0x1fd3be){return db[_0xf5a2('0x58')][_0xf5a2('0x73')]({'where':{'UserId':_0x1fd3be['id'],'OpenchannelQueueId':_0x4b9532[_0xf5a2('0x55')]['id']},'transaction':_0x501e56});});})['then'](function(){_0x118c4d[_0xf5a2('0x74')](function(_0x5ea4f9){socket[_0xf5a2('0x75')]('userOpenchannelQueue:save',{'UserId':_0x5ea4f9['id'],'OpenchannelQueueId':_0x9c5a73['id']});});});});});}})['then'](respondWithStatusCode(_0x454351,null))['catch'](handleError(_0x454351,null));};exports[_0xf5a2('0x76')]=function(_0x513b0b,_0x59e92c,_0x4fd46e){return db[_0xf5a2('0x6a')][_0xf5a2('0x5c')]({'where':{'id':_0x513b0b['query'][_0xf5a2('0x69')]},'attributes':['id'],'include':[{'model':db[_0xf5a2('0x6b')],'as':_0xf5a2('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf5a2('0x2e')](handleEntityNotFound(_0x59e92c,null))[_0xf5a2('0x2e')](function(_0x18b0f3){var _0xcab36c=_[_0xf5a2('0x35')](_0x18b0f3,'id');var _0x3457ff=[];var _0x531e42=[];var _0x24aa9d=squel['select']();_0x24aa9d['field'](_0xf5a2('0x77'))[_0xf5a2('0x78')]('team_has_openchannel_queues','tq')[_0xf5a2('0x79')](_0xf5a2('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5a2('0x44')](_0xf5a2('0x7b'),_0x513b0b['params']['id']);for(var _0x1d6666=0x0;_0x1d6666<_0x18b0f3['length'];_0x1d6666+=0x1){let _0x33df28=_0x18b0f3[_0x1d6666];for(var _0x1c6287=0x0;_0x1c6287<_0x33df28[_0xf5a2('0x6c')][_0xf5a2('0x41')];_0x1c6287+=0x1){let _0x529687=_0x33df28['Agents'][_0x1c6287];var _0x37c670=_0x24aa9d[_0xf5a2('0x7c')]();_0x37c670[_0xf5a2('0x44')](_0xf5a2('0x7d'),_0x529687['id']);_0x531e42[_0xf5a2('0x7e')](db['sequelize'][_0xf5a2('0x3c')](_0x37c670['toString'](),{'type':db[_0xf5a2('0x70')][_0xf5a2('0x7f')][_0xf5a2('0x80')]})['then'](function(_0x39574c){if(_0x39574c['length']===0x1){return _0x529687['id'];}else{var _0x228d29=_[_0xf5a2('0x81')](_['map'](_0x39574c,_0xf5a2('0x82')),function(_0x337158){return _['includes'](_0xcab36c,_0x337158);});if(_0x228d29){return _0x529687['id'];}}}));}}return BPromise[_0xf5a2('0x83')](_0x531e42)[_0xf5a2('0x2e')](function(_0x212a79){_0x3457ff=_(_0x3457ff)['union'](_0x212a79)['compact']()['value']();return db[_0xf5a2('0x36')][_0xf5a2('0x54')]({'where':{'id':_0x513b0b[_0xf5a2('0x55')]['id']}})[_0xf5a2('0x2e')](function(_0x231c6d){return db[_0xf5a2('0x70')][_0xf5a2('0x71')](function(_0x4c2d9b){return _0x231c6d['removeTeams'](_0x513b0b[_0xf5a2('0x3c')]['ids'],{'transaction':_0x4c2d9b})[_0xf5a2('0x2e')](function(){if(!_['isEmpty'](_0x3457ff)){return _0x231c6d[_0xf5a2('0x84')](_0x3457ff,{'transaction':_0x4c2d9b});}})[_0xf5a2('0x2e')](function(){_0x3457ff[_0xf5a2('0x74')](function(_0x1f60db){socket[_0xf5a2('0x75')](_0xf5a2('0x85'),{'UserId':_0x1f60db,'OpenchannelQueueId':_0x231c6d['id']});});});});});});})['then'](respondWithStatusCode(_0x59e92c,null))['catch'](handleError(_0x59e92c,null));};exports[_0xf5a2('0x86')]=function(_0x464ce6,_0x1a3bf3,_0x447896){return db[_0xf5a2('0x36')]['find']({'where':{'id':_0x464ce6[_0xf5a2('0x55')]['id']}})[_0xf5a2('0x2e')](handleEntityNotFound(_0x1a3bf3,null))[_0xf5a2('0x2e')](function(_0xb94cf0){if(_0xb94cf0){return _0xb94cf0[_0xf5a2('0x86')](_0x464ce6[_0xf5a2('0x50')][_0xf5a2('0x69')],_[_0xf5a2('0x87')](_0x464ce6[_0xf5a2('0x50')],[_0xf5a2('0x69'),'id'])||{})[_0xf5a2('0x88')](function(_0x278c29){for(var _0x50ed95=0x0;_0x50ed95<_0x464ce6[_0xf5a2('0x50')][_0xf5a2('0x69')][_0xf5a2('0x41')];_0x50ed95+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x464ce6[_0xf5a2('0x50')][_0xf5a2('0x69')][_0x50ed95]),'OpenchannelQueueId':Number(_0x464ce6[_0xf5a2('0x55')]['id'])});}return _0x278c29;});}})[_0xf5a2('0x2e')](respondWithResult(_0x1a3bf3,null))[_0xf5a2('0x4d')](handleError(_0x1a3bf3,null));};exports[_0xf5a2('0x84')]=function(_0x25aa31,_0x58c5f2,_0x11487a){return db['OpenchannelQueue'][_0xf5a2('0x54')]({'where':{'id':_0x25aa31[_0xf5a2('0x55')]['id']}})['then'](handleEntityNotFound(_0x58c5f2,null))['then'](function(_0x4cc9fd){if(_0x4cc9fd){return _0x4cc9fd[_0xf5a2('0x84')](_0x25aa31[_0xf5a2('0x3c')][_0xf5a2('0x69')])[_0xf5a2('0x2e')](function(){if(_[_0xf5a2('0x89')](_0x25aa31['query'][_0xf5a2('0x69')])){for(var _0x46a05a=0x0;_0x46a05a<_0x25aa31[_0xf5a2('0x3c')][_0xf5a2('0x69')][_0xf5a2('0x41')];_0x46a05a+=0x1){socket[_0xf5a2('0x75')](_0xf5a2('0x85'),{'UserId':Number(_0x25aa31[_0xf5a2('0x3c')][_0xf5a2('0x69')][_0x46a05a]),'OpenchannelQueueId':Number(_0x25aa31['params']['id'])});}}else{socket[_0xf5a2('0x75')](_0xf5a2('0x85'),{'UserId':Number(_0x25aa31[_0xf5a2('0x3c')]['ids']),'OpenchannelQueueId':Number(_0x25aa31[_0xf5a2('0x55')]['id'])});}});}})[_0xf5a2('0x2e')](respondWithStatusCode(_0x58c5f2,null))['catch'](handleError(_0x58c5f2,null));};exports['getAgents']=function(_0x1f07b0,_0x5c7318,_0x46fb79){var _0x35762d={};var _0x413f0b={};var _0x3716b6;var _0x41f97e;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x1f07b0[_0xf5a2('0x55')]['id']}})[_0xf5a2('0x2e')](handleEntityNotFound(_0x5c7318,null))[_0xf5a2('0x2e')](function(_0x33ed73){if(_0x33ed73){_0x3716b6=_0x33ed73;_0x413f0b[_0xf5a2('0x3b')]=_[_0xf5a2('0x3d')](db[_0xf5a2('0x6b')][_0xf5a2('0x37')]);_0x413f0b[_0xf5a2('0x3c')]=_['keys'](_0x1f07b0[_0xf5a2('0x3c')]);_0x413f0b[_0xf5a2('0x45')]=_[_0xf5a2('0x3f')](_0x413f0b[_0xf5a2('0x3b')],_0x413f0b[_0xf5a2('0x3c')]);_0x35762d[_0xf5a2('0x3e')]=_[_0xf5a2('0x3f')](_0x413f0b['model'],qs[_0xf5a2('0x40')](_0x1f07b0['query'][_0xf5a2('0x40')]));_0x35762d[_0xf5a2('0x3e')]=_0x35762d[_0xf5a2('0x3e')]['length']?_0x35762d[_0xf5a2('0x3e')]:_0x413f0b[_0xf5a2('0x3b')];_0x35762d[_0xf5a2('0x42')]=qs[_0xf5a2('0x43')](_0x1f07b0[_0xf5a2('0x3c')]['sort']);_0x35762d['where']=qs[_0xf5a2('0x45')](_[_0xf5a2('0x46')](_0x1f07b0[_0xf5a2('0x3c')],_0x413f0b['filters']));if(_0x1f07b0['query'][_0xf5a2('0x47')]){_0x35762d[_0xf5a2('0x44')]=_[_0xf5a2('0x48')](_0x35762d[_0xf5a2('0x44')],{'$or':_['map'](_0x35762d[_0xf5a2('0x3e')],function(_0x5ba4af){var _0x409713={};_0x409713[_0x5ba4af]={'$like':'%'+_0x1f07b0[_0xf5a2('0x3c')][_0xf5a2('0x47')]+'%'};return _0x409713;})});}_0x35762d=_[_0xf5a2('0x48')]({},_0x35762d,_0x1f07b0['options']);return _0x3716b6[_0xf5a2('0x8a')](_0x35762d);}})['then'](function(_0x2c818f){if(_0x2c818f){_0x41f97e=_0x2c818f[_0xf5a2('0x41')];if(!_0x1f07b0[_0xf5a2('0x3c')]['hasOwnProperty']('nolimit')){_0x35762d['limit']=qs[_0xf5a2('0x25')](_0x1f07b0[_0xf5a2('0x3c')][_0xf5a2('0x25')]);_0x35762d[_0xf5a2('0x23')]=qs[_0xf5a2('0x23')](_0x1f07b0[_0xf5a2('0x3c')][_0xf5a2('0x23')]);}return _0x3716b6[_0xf5a2('0x8a')](_0x35762d);}})[_0xf5a2('0x2e')](function(_0x24a5cc){if(_0x24a5cc){return _0x24a5cc?{'count':_0x41f97e,'rows':_0x24a5cc}:null;}})['then'](respondWithResult(_0x5c7318,null))['catch'](handleError(_0x5c7318,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b8fcaf1..68dd055 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 _0x8c66=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8c66,0x78));var _0x68c6=function(_0x119c85,_0x268175){_0x119c85=_0x119c85-0x0;var _0x41d288=_0x8c66[_0x119c85];return _0x41d288;};'use strict';var EventEmitter=require(_0x68c6('0x0'));var OpenchannelQueue=require(_0x68c6('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x68c6('0x2')](0x0);var events={'afterCreate':_0x68c6('0x3'),'afterUpdate':_0x68c6('0x4'),'afterDestroy':_0x68c6('0x5')};function emitEvent(_0x5e8aa4){return function(_0x5a99ae,_0x3e074a,_0x1e27a8){OpenchannelQueueEvents[_0x68c6('0x6')](_0x5e8aa4+':'+_0x5a99ae['id'],_0x5a99ae);OpenchannelQueueEvents[_0x68c6('0x6')](_0x5e8aa4,_0x5a99ae);_0x1e27a8(null);};}for(var e in events){if(events[_0x68c6('0x7')](e)){var event=events[e];OpenchannelQueue[_0x68c6('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x28c5=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x28c5,0xa0));var _0x528c=function(_0x34098f,_0x59800c){_0x34098f=_0x34098f-0x0;var _0x16fccb=_0x28c5[_0x34098f];return _0x16fccb;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x528c('0x0'))['db'][_0x528c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x528c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x528c('0x3'),'afterDestroy':_0x528c('0x4')};function emitEvent(_0x466370){return function(_0x15a065,_0x2ec054,_0x318d3d){OpenchannelQueueEvents['emit'](_0x466370+':'+_0x15a065['id'],_0x15a065);OpenchannelQueueEvents[_0x528c('0x5')](_0x466370,_0x15a065);_0x318d3d(null);};}for(var e in events){if(events[_0x528c('0x6')](e)){var event=events[e];OpenchannelQueue[_0x528c('0x7')](e,emitEvent(event));}}module[_0x528c('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 2fa3a32..2b46133 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 _0xa014=['moment','path','rimraf','../../config/environment','exports','define','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x14c695,_0x336d7e){var _0x1a9544=function(_0x5e24b1){while(--_0x5e24b1){_0x14c695['push'](_0x14c695['shift']());}};_0x1a9544(++_0x336d7e);}(_0xa014,0x1b4));var _0x4a01=function(_0x473f1d,_0x3cd9b2){_0x473f1d=_0x473f1d-0x0;var _0x430957=_0xa014[_0x473f1d];return _0x430957;};'use strict';var _=require(_0x4a01('0x0'));var util=require(_0x4a01('0x1'));var logger=require(_0x4a01('0x2'))(_0x4a01('0x3'));var moment=require(_0x4a01('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a01('0x5'));var rimraf=require(_0x4a01('0x6'));var config=require(_0x4a01('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x4a01('0x8')]=function(_0x109b85,_0x33c16a){return _0x109b85[_0x4a01('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x4a01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df7=['define','OpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x49daf9,_0x26fd76){var _0x40dfea=function(_0x40e3aa){while(--_0x40e3aa){_0x49daf9['push'](_0x49daf9['shift']());}};_0x40dfea(++_0x26fd76);}(_0x6df7,0x17b));var _0x76df=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6df7[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x76df('0x0'));var logger=require(_0x76df('0x1'))(_0x76df('0x2'));var moment=require(_0x76df('0x3'));var BPromise=require(_0x76df('0x4'));var rp=require(_0x76df('0x5'));var fs=require('fs');var path=require(_0x76df('0x6'));var rimraf=require(_0x76df('0x7'));var config=require(_0x76df('0x8'));var attributes=require(_0x76df('0x9'));module[_0x76df('0xa')]=function(_0x38e0d5,_0x4f74e3){return _0x38e0d5[_0x76df('0xb')](_0x76df('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 78942b5..db68672 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 _0x4e66=['request\x20sent','stringify','code','error','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4e66,0x149));var _0x64e6=function(_0x4b0d65,_0x5cc99a){_0x4b0d65=_0x4b0d65-0x0;var _0x252ff1=_0x4e66[_0x4b0d65];return _0x252ff1;};'use strict';var _=require(_0x64e6('0x0'));var util=require(_0x64e6('0x1'));var moment=require(_0x64e6('0x2'));var BPromise=require(_0x64e6('0x3'));var rs=require(_0x64e6('0x4'));var fs=require('fs');var Redis=require(_0x64e6('0x5'));var db=require(_0x64e6('0x6'))['db'];var utils=require(_0x64e6('0x7'));var logger=require(_0x64e6('0x8'))(_0x64e6('0x9'));var config=require(_0x64e6('0xa'));var jayson=require(_0x64e6('0xb'));var client=jayson[_0x64e6('0xc')][_0x64e6('0xd')]({'port':0x232a});config[_0x64e6('0xe')]=_['defaults'](config[_0x64e6('0xe')],{'host':_0x64e6('0xf'),'port':0x18eb});var socket=require(_0x64e6('0x10'))(new Redis(config['redis']));require(_0x64e6('0x11'))['register'](socket);function respondWithRpcPromise(_0x574834,_0x6b3413,_0x3598c5){return new BPromise(function(_0x3e68cd,_0x4e4e36){return client[_0x64e6('0x12')](_0x574834,_0x3598c5)[_0x64e6('0x13')](function(_0x4e67fd){logger['info'](_0x64e6('0x14'),_0x6b3413,'request\x20sent');logger[_0x64e6('0x15')](_0x64e6('0x16'),_0x6b3413,_0x64e6('0x17'),JSON[_0x64e6('0x18')](_0x4e67fd));if(_0x4e67fd['error']){if(_0x4e67fd['error'][_0x64e6('0x19')]===0x1f4){logger[_0x64e6('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x6b3413,_0x4e67fd[_0x64e6('0x1a')]['message']);return _0x4e4e36(_0x4e67fd[_0x64e6('0x1a')][_0x64e6('0x1b')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x6b3413,_0x4e67fd[_0x64e6('0x1a')][_0x64e6('0x1b')]);return _0x3e68cd(_0x4e67fd[_0x64e6('0x1a')]['message']);}else{logger[_0x64e6('0x1c')](_0x64e6('0x14'),_0x6b3413,_0x64e6('0x17'));_0x3e68cd(_0x4e67fd[_0x64e6('0x1d')][_0x64e6('0x1b')]);}})[_0x64e6('0x1e')](function(_0x63fb5b){logger['error'](_0x64e6('0x14'),_0x6b3413,_0x63fb5b);_0x4e4e36(_0x63fb5b);});});}exports[_0x64e6('0x1f')]=function(_0x586c26){var _0xc5232=this;return new Promise(function(_0x174c7,_0x3bd639){return db[_0x64e6('0x20')][_0x64e6('0x21')]({'raw':_0x586c26['options']?_0x586c26[_0x64e6('0x22')][_0x64e6('0x23')]===undefined?!![]:![]:!![],'where':_0x586c26[_0x64e6('0x22')]?_0x586c26[_0x64e6('0x22')][_0x64e6('0x24')]||null:null,'attributes':_0x586c26[_0x64e6('0x22')]?_0x586c26[_0x64e6('0x22')]['attributes']||null:null,'limit':_0x586c26[_0x64e6('0x22')]?_0x586c26[_0x64e6('0x22')][_0x64e6('0x25')]||null:null,'include':_0x586c26[_0x64e6('0x22')]?_0x586c26['options'][_0x64e6('0x26')]?_[_0x64e6('0x27')](_0x586c26[_0x64e6('0x22')]['include'],function(_0x3acc6b){return{'model':db[_0x3acc6b[_0x64e6('0x28')]],'as':_0x3acc6b['as'],'attributes':_0x3acc6b[_0x64e6('0x29')],'include':_0x3acc6b[_0x64e6('0x26')]?_[_0x64e6('0x27')](_0x3acc6b['include'],function(_0xd39dcf){return{'model':db[_0xd39dcf['model']],'as':_0xd39dcf['as'],'attributes':_0xd39dcf[_0x64e6('0x29')],'include':_0xd39dcf[_0x64e6('0x26')]?_[_0x64e6('0x27')](_0xd39dcf[_0x64e6('0x26')],function(_0x2cd34d){return{'model':db[_0x2cd34d[_0x64e6('0x28')]],'as':_0x2cd34d['as'],'attributes':_0x2cd34d[_0x64e6('0x29')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x268b5a){logger[_0x64e6('0x1c')](_0x64e6('0x1f'),_0x586c26);logger[_0x64e6('0x15')]('GetOpenchannelQueue',_0x586c26,JSON[_0x64e6('0x18')](_0x268b5a));_0x174c7(_0x268b5a);})[_0x64e6('0x1e')](function(_0xe29d58){logger[_0x64e6('0x1a')]('GetOpenchannelQueue',_0xe29d58['message'],_0x586c26);_0x3bd639(_0xc5232['error'](0x1f4,_0xe29d58[_0x64e6('0x1b')]));});});};exports['ShowOpenchannelQueue']=function(_0xe25c54){var _0x53b25e=this;return new Promise(function(_0x425822,_0x4998c2){return db[_0x64e6('0x20')][_0x64e6('0x2a')]({'raw':_0xe25c54[_0x64e6('0x22')]?_0xe25c54['options'][_0x64e6('0x23')]===undefined?!![]:![]:!![],'where':_0xe25c54[_0x64e6('0x22')]?_0xe25c54['options']['where']||null:null,'attributes':_0xe25c54[_0x64e6('0x22')]?_0xe25c54[_0x64e6('0x22')][_0x64e6('0x29')]||null:null,'include':_0xe25c54[_0x64e6('0x22')]?_0xe25c54[_0x64e6('0x22')][_0x64e6('0x26')]?_[_0x64e6('0x27')](_0xe25c54['options'][_0x64e6('0x26')],function(_0x47f242){return{'model':db[_0x47f242[_0x64e6('0x28')]],'as':_0x47f242['as'],'attributes':_0x47f242[_0x64e6('0x29')],'include':_0x47f242[_0x64e6('0x26')]?_[_0x64e6('0x27')](_0x47f242['include'],function(_0x4bedab){return{'model':db[_0x4bedab[_0x64e6('0x28')]],'as':_0x4bedab['as'],'attributes':_0x4bedab[_0x64e6('0x29')],'include':_0x4bedab[_0x64e6('0x26')]?_['map'](_0x4bedab[_0x64e6('0x26')],function(_0x1ed56d){return{'model':db[_0x1ed56d[_0x64e6('0x28')]],'as':_0x1ed56d['as'],'attributes':_0x1ed56d[_0x64e6('0x29')]};}):[]};}):[]};}):[]:[]})[_0x64e6('0x13')](function(_0x9c4fe0){logger[_0x64e6('0x1c')](_0x64e6('0x2b'),_0xe25c54);logger[_0x64e6('0x15')](_0x64e6('0x2b'),_0xe25c54,JSON[_0x64e6('0x18')](_0x9c4fe0));_0x425822(_0x9c4fe0);})[_0x64e6('0x1e')](function(_0x2c7746){logger[_0x64e6('0x1a')](_0x64e6('0x2b'),_0x2c7746[_0x64e6('0x1b')],_0xe25c54);_0x4998c2(_0x53b25e[_0x64e6('0x1a')](0x1f4,_0x2c7746[_0x64e6('0x1b')]));});});}; \ No newline at end of file +var _0xa433=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa433,0xa6));var _0x3a43=function(_0x42659f,_0x19f4e9){_0x42659f=_0x42659f-0x0;var _0x4188ff=_0xa433[_0x42659f];return _0x4188ff;};'use strict';var _=require(_0x3a43('0x0'));var util=require(_0x3a43('0x1'));var moment=require(_0x3a43('0x2'));var BPromise=require(_0x3a43('0x3'));var rs=require(_0x3a43('0x4'));var fs=require('fs');var Redis=require(_0x3a43('0x5'));var db=require(_0x3a43('0x6'))['db'];var utils=require(_0x3a43('0x7'));var logger=require(_0x3a43('0x8'))(_0x3a43('0x9'));var config=require(_0x3a43('0xa'));var jayson=require(_0x3a43('0xb'));var client=jayson[_0x3a43('0xc')][_0x3a43('0xd')]({'port':0x232a});config[_0x3a43('0xe')]=_[_0x3a43('0xf')](config[_0x3a43('0xe')],{'host':_0x3a43('0x10'),'port':0x18eb});var socket=require(_0x3a43('0x11'))(new Redis(config[_0x3a43('0xe')]));require(_0x3a43('0x12'))[_0x3a43('0x13')](socket);function respondWithRpcPromise(_0x5cda26,_0x503374,_0x43e676){return new BPromise(function(_0xaf3e06,_0x2262b6){return client[_0x3a43('0x14')](_0x5cda26,_0x43e676)[_0x3a43('0x15')](function(_0x5cf4cf){logger[_0x3a43('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x503374,_0x3a43('0x17'));logger[_0x3a43('0x18')](_0x3a43('0x19'),_0x503374,'request\x20sent',JSON[_0x3a43('0x1a')](_0x5cf4cf));if(_0x5cf4cf[_0x3a43('0x1b')]){if(_0x5cf4cf[_0x3a43('0x1b')][_0x3a43('0x1c')]===0x1f4){logger['error'](_0x3a43('0x1d'),_0x503374,_0x5cf4cf[_0x3a43('0x1b')][_0x3a43('0x1e')]);return _0x2262b6(_0x5cf4cf[_0x3a43('0x1b')]['message']);}logger[_0x3a43('0x1b')](_0x3a43('0x1d'),_0x503374,_0x5cf4cf[_0x3a43('0x1b')][_0x3a43('0x1e')]);return _0xaf3e06(_0x5cf4cf['error'][_0x3a43('0x1e')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x503374,'request\x20sent');_0xaf3e06(_0x5cf4cf['result'][_0x3a43('0x1e')]);}})[_0x3a43('0x1f')](function(_0x775646){logger[_0x3a43('0x1b')](_0x3a43('0x1d'),_0x503374,_0x775646);_0x2262b6(_0x775646);});});}exports[_0x3a43('0x20')]=function(_0x5c6358){var _0x276e57=this;return new Promise(function(_0x37f559,_0x40a8e6){return db[_0x3a43('0x21')][_0x3a43('0x22')]({'raw':_0x5c6358[_0x3a43('0x23')]?_0x5c6358[_0x3a43('0x23')][_0x3a43('0x24')]===undefined?!![]:![]:!![],'where':_0x5c6358[_0x3a43('0x23')]?_0x5c6358[_0x3a43('0x23')][_0x3a43('0x25')]||null:null,'attributes':_0x5c6358['options']?_0x5c6358[_0x3a43('0x23')][_0x3a43('0x26')]||null:null,'limit':_0x5c6358['options']?_0x5c6358[_0x3a43('0x23')][_0x3a43('0x27')]||null:null,'include':_0x5c6358[_0x3a43('0x23')]?_0x5c6358[_0x3a43('0x23')][_0x3a43('0x28')]?_[_0x3a43('0x29')](_0x5c6358[_0x3a43('0x23')][_0x3a43('0x28')],function(_0x3aaefb){return{'model':db[_0x3aaefb[_0x3a43('0x2a')]],'as':_0x3aaefb['as'],'attributes':_0x3aaefb[_0x3a43('0x26')],'include':_0x3aaefb['include']?_[_0x3a43('0x29')](_0x3aaefb['include'],function(_0x4e5cb5){return{'model':db[_0x4e5cb5[_0x3a43('0x2a')]],'as':_0x4e5cb5['as'],'attributes':_0x4e5cb5[_0x3a43('0x26')],'include':_0x4e5cb5[_0x3a43('0x28')]?_['map'](_0x4e5cb5[_0x3a43('0x28')],function(_0x59a655){return{'model':db[_0x59a655[_0x3a43('0x2a')]],'as':_0x59a655['as'],'attributes':_0x59a655[_0x3a43('0x26')]};}):[]};}):[]};}):[]:[]})[_0x3a43('0x15')](function(_0x42994d){logger[_0x3a43('0x16')](_0x3a43('0x20'),_0x5c6358);logger[_0x3a43('0x18')]('GetOpenchannelQueue',_0x5c6358,JSON[_0x3a43('0x1a')](_0x42994d));_0x37f559(_0x42994d);})['catch'](function(_0x433594){logger[_0x3a43('0x1b')](_0x3a43('0x20'),_0x433594['message'],_0x5c6358);_0x40a8e6(_0x276e57[_0x3a43('0x1b')](0x1f4,_0x433594[_0x3a43('0x1e')]));});});};exports[_0x3a43('0x2b')]=function(_0x803c0){var _0x497eac=this;return new Promise(function(_0xf5cef3,_0x57b443){return db['OpenchannelQueue'][_0x3a43('0x2c')]({'raw':_0x803c0[_0x3a43('0x23')]?_0x803c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x803c0['options']?_0x803c0[_0x3a43('0x23')]['where']||null:null,'attributes':_0x803c0['options']?_0x803c0[_0x3a43('0x23')][_0x3a43('0x26')]||null:null,'include':_0x803c0['options']?_0x803c0['options'][_0x3a43('0x28')]?_[_0x3a43('0x29')](_0x803c0[_0x3a43('0x23')][_0x3a43('0x28')],function(_0x27ed63){return{'model':db[_0x27ed63[_0x3a43('0x2a')]],'as':_0x27ed63['as'],'attributes':_0x27ed63['attributes'],'include':_0x27ed63['include']?_[_0x3a43('0x29')](_0x27ed63[_0x3a43('0x28')],function(_0x59c618){return{'model':db[_0x59c618[_0x3a43('0x2a')]],'as':_0x59c618['as'],'attributes':_0x59c618[_0x3a43('0x26')],'include':_0x59c618[_0x3a43('0x28')]?_[_0x3a43('0x29')](_0x59c618[_0x3a43('0x28')],function(_0x7fc2de){return{'model':db[_0x7fc2de['model']],'as':_0x7fc2de['as'],'attributes':_0x7fc2de[_0x3a43('0x26')]};}):[]};}):[]};}):[]:[]})[_0x3a43('0x15')](function(_0x3cb364){logger['info'](_0x3a43('0x2b'),_0x803c0);logger[_0x3a43('0x18')](_0x3a43('0x2b'),_0x803c0,JSON[_0x3a43('0x1a')](_0x3cb364));_0xf5cef3(_0x3cb364);})['catch'](function(_0x31fb62){logger[_0x3a43('0x1b')](_0x3a43('0x2b'),_0x31fb62[_0x3a43('0x1e')],_0x803c0);_0x57b443(_0x497eac[_0x3a43('0x1b')](0x1f4,_0x31fb62[_0x3a43('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f9b730f..feecc7d 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 _0x4b71=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b71,0x1c2));var _0x14b7=function(_0x50e1a7,_0x555868){_0x50e1a7=_0x50e1a7-0x0;var _0x5a3a82=_0x4b71[_0x50e1a7];return _0x5a3a82;};'use strict';var OpenchannelQueueEvents=require(_0x14b7('0x0'));var events=[_0x14b7('0x1'),_0x14b7('0x2'),_0x14b7('0x3')];function createListener(_0x6e5ff8,_0x329d2d){return function(_0x22f9d8){_0x329d2d['emit'](_0x6e5ff8,_0x22f9d8);};}function removeListener(_0x2e9781,_0x4216b1){return function(){OpenchannelQueueEvents[_0x14b7('0x4')](_0x2e9781,_0x4216b1);};}exports[_0x14b7('0x5')]=function(_0x75b2d6){for(var _0x1d9d8d=0x0,_0x27aded=events[_0x14b7('0x6')];_0x1d9d8d<_0x27aded;_0x1d9d8d++){var _0x367b84=events[_0x1d9d8d];var _0x561f22=createListener(_0x14b7('0x7')+_0x367b84,_0x75b2d6);OpenchannelQueueEvents['on'](_0x367b84,_0x561f22);}}; \ No newline at end of file +var _0xa1bf=['register','length','./openchannelQueue.events','save','emit','removeListener'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xa1bf,0xe6));var _0xfa1b=function(_0x3e2b67,_0x5eae3c){_0x3e2b67=_0x3e2b67-0x0;var _0x419d32=_0xa1bf[_0x3e2b67];return _0x419d32;};'use strict';var OpenchannelQueueEvents=require(_0xfa1b('0x0'));var events=[_0xfa1b('0x1'),'remove','update'];function createListener(_0x1e21c1,_0x38cdd8){return function(_0x4afb62){_0x38cdd8[_0xfa1b('0x2')](_0x1e21c1,_0x4afb62);};}function removeListener(_0x57e15b,_0x8bcfc3){return function(){OpenchannelQueueEvents[_0xfa1b('0x3')](_0x57e15b,_0x8bcfc3);};}exports[_0xfa1b('0x4')]=function(_0x15a857){for(var _0x4d23f4=0x0,_0x141fce=events[_0xfa1b('0x5')];_0x4d23f4<_0x141fce;_0x4d23f4++){var _0x539b69=events[_0x4d23f4];var _0x48a8ec=createListener('openchannelQueue:'+_0x539b69,_0x15a857);OpenchannelQueueEvents['on'](_0x539b69,_0x48a8ec);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 08fe849..d57a171 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 _0x795b=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe'];(function(_0x403559,_0x1b69c4){var _0x2e7fb9=function(_0x58bd5a){while(--_0x58bd5a){_0x403559['push'](_0x403559['shift']());}};_0x2e7fb9(++_0x1b69c4);}(_0x795b,0x7a));var _0xb795=function(_0x353ce8,_0x29fd68){_0x353ce8=_0x353ce8-0x0;var _0x1d069b=_0x795b[_0x353ce8];return _0x1d069b;};'use strict';var multer=require(_0xb795('0x0'));var util=require(_0xb795('0x1'));var path=require(_0xb795('0x2'));var timeout=require(_0xb795('0x3'));var express=require(_0xb795('0x4'));var router=express[_0xb795('0x5')]();var fs_extra=require(_0xb795('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb795('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0xb795('0x8')]('/',auth[_0xb795('0x9')](),controller['index']);router[_0xb795('0x8')](_0xb795('0xa'),auth[_0xb795('0x9')](),controller['describe']);router[_0xb795('0x8')](_0xb795('0xb'),auth[_0xb795('0x9')](),controller[_0xb795('0xc')]);router[_0xb795('0xd')]('/',auth['isAuthenticated'](),controller[_0xb795('0xe')]);router[_0xb795('0xf')](_0xb795('0xb'),auth[_0xb795('0x9')](),controller['update']);router[_0xb795('0x10')]('/:id',auth[_0xb795('0x9')](),controller[_0xb795('0x11')]);module[_0xb795('0x12')]=router; \ No newline at end of file +var _0x5642=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy'];(function(_0x3d2c06,_0x3cc8f3){var _0x36c85f=function(_0x432d41){while(--_0x432d41){_0x3d2c06['push'](_0x3d2c06['shift']());}};_0x36c85f(++_0x3cc8f3);}(_0x5642,0x1e5));var _0x2564=function(_0x10d1ff,_0x236da0){_0x10d1ff=_0x10d1ff-0x0;var _0x355630=_0x5642[_0x10d1ff];return _0x355630;};'use strict';var multer=require(_0x2564('0x0'));var util=require('util');var path=require(_0x2564('0x1'));var timeout=require(_0x2564('0x2'));var express=require(_0x2564('0x3'));var router=express[_0x2564('0x4')]();var fs_extra=require(_0x2564('0x5'));var auth=require(_0x2564('0x6'));var interaction=require(_0x2564('0x7'));var config=require(_0x2564('0x8'));var controller=require(_0x2564('0x9'));router[_0x2564('0xa')]('/',auth[_0x2564('0xb')](),controller[_0x2564('0xc')]);router[_0x2564('0xa')](_0x2564('0xd'),auth[_0x2564('0xb')](),controller['describe']);router[_0x2564('0xa')](_0x2564('0xe'),auth[_0x2564('0xb')](),controller[_0x2564('0xf')]);router[_0x2564('0x10')]('/',auth['isAuthenticated'](),controller[_0x2564('0x11')]);router[_0x2564('0x12')](_0x2564('0xe'),auth[_0x2564('0xb')](),controller['update']);router[_0x2564('0x13')](_0x2564('0xe'),auth[_0x2564('0xb')](),controller[_0x2564('0x14')]);module[_0x2564('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b362d5d..a7ce212 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 _0xe234=['STRING','DATE','sequelize','exports'];(function(_0x1cdce5,_0x1fb0d4){var _0x3f9d13=function(_0x1125af){while(--_0x1125af){_0x1cdce5['push'](_0x1cdce5['shift']());}};_0x3f9d13(++_0x1fb0d4);}(_0xe234,0xfe));var _0x4e23=function(_0x4ab987,_0x4e95f5){_0x4ab987=_0x4ab987-0x0;var _0x550a31=_0xe234[_0x4ab987];return _0x550a31;};'use strict';var moment=require('moment');var Sequelize=require(_0x4e23('0x0'));module[_0x4e23('0x1')]={'uniqueid':{'type':Sequelize[_0x4e23('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4e23('0x2')]},'joinAt':{'type':Sequelize[_0x4e23('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4e23('0x3')]},'reason':{'type':Sequelize[_0x4e23('0x2')]}}; \ No newline at end of file +var _0x2d05=['exports','STRING','DATE'];(function(_0x423295,_0x17f324){var _0x11765e=function(_0x2e7e74){while(--_0x2e7e74){_0x423295['push'](_0x423295['shift']());}};_0x11765e(++_0x17f324);}(_0x2d05,0x144));var _0x52d0=function(_0x12445e,_0x20d0b8){_0x12445e=_0x12445e-0x0;var _0xfd8ea1=_0x2d05[_0x12445e];return _0xfd8ea1;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x52d0('0x0')]={'uniqueid':{'type':Sequelize[_0x52d0('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x52d0('0x1')]},'joinAt':{'type':Sequelize[_0x52d0('0x2')]},'leaveAt':{'type':Sequelize[_0x52d0('0x2')]},'acceptAt':{'type':Sequelize[_0x52d0('0x2')]},'exitAt':{'type':Sequelize[_0x52d0('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cb49b10..63a8ada 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 _0x32ab=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','squel','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','type','model','map'];(function(_0x5285a2,_0x1949c0){var _0x4222dc=function(_0x4a166a){while(--_0x4a166a){_0x5285a2['push'](_0x5285a2['shift']());}};_0x4222dc(++_0x1949c0);}(_0x32ab,0xad));var _0xb32a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x32ab[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xb32a('0x0'));var rimraf=require(_0xb32a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb32a('0x2'));var rp=require(_0xb32a('0x3'));var moment=require(_0xb32a('0x4'));var BPromise=require(_0xb32a('0x5'));var Mustache=require(_0xb32a('0x6'));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('lodash');var squel=require(_0xb32a('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb32a('0x8'));var toCsv=require(_0xb32a('0x9'));var querystring=require(_0xb32a('0xa'));var Papa=require(_0xb32a('0xb'));var Redis=require(_0xb32a('0xc'));var authService=require(_0xb32a('0xd'));var qs=require(_0xb32a('0xe'));var as=require(_0xb32a('0xf'));var hardwareService=require(_0xb32a('0x10'));var logger=require(_0xb32a('0x11'))(_0xb32a('0x12'));var utils=require(_0xb32a('0x13'));var config=require(_0xb32a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb32a('0x15'))['db'];function respondWithStatusCode(_0xe4b422,_0x31c99c){_0x31c99c=_0x31c99c||0xcc;return function(_0x9f5fc0){if(_0x9f5fc0){return _0xe4b422[_0xb32a('0x16')](_0x31c99c);}return _0xe4b422[_0xb32a('0x17')](_0x31c99c)['end']();};}function respondWithResult(_0x286b40,_0x38c7eb){_0x38c7eb=_0x38c7eb||0xc8;return function(_0x5e1ffa){if(_0x5e1ffa){return _0x286b40[_0xb32a('0x17')](_0x38c7eb)[_0xb32a('0x18')](_0x5e1ffa);}};}function respondWithFilteredResult(_0x567a18,_0x38578d){return function(_0x3b78bb){if(_0x3b78bb){var _0x481826=typeof _0x38578d[_0xb32a('0x19')]===_0xb32a('0x1a')&&typeof _0x38578d[_0xb32a('0x1b')]===_0xb32a('0x1a');var _0x355e4e=_0x3b78bb[_0xb32a('0x1c')];var _0xfe2080=_0x481826?0x0:_0x38578d[_0xb32a('0x19')];var _0x4e8d06=_0x481826?_0x3b78bb[_0xb32a('0x1c')]:_0x38578d[_0xb32a('0x19')]+_0x38578d[_0xb32a('0x1b')];var _0x1763b6;if(_0x4e8d06>=_0x355e4e){_0x4e8d06=_0x355e4e;_0x1763b6=0xc8;}else{_0x1763b6=0xce;}_0x567a18['status'](_0x1763b6);return _0x567a18[_0xb32a('0x1d')](_0xb32a('0x1e'),_0xfe2080+'-'+_0x4e8d06+'/'+_0x355e4e)['json'](_0x3b78bb);}return null;};}function patchUpdates(_0x4724e1){return function(_0x4ecc0c){try{jsonpatch['apply'](_0x4ecc0c,_0x4724e1,!![]);}catch(_0x40a7b9){return BPromise[_0xb32a('0x1f')](_0x40a7b9);}return _0x4ecc0c['save']();};}function saveUpdates(_0x53f6a4,_0x226f81){return function(_0x23ed03){if(_0x23ed03){return _0x23ed03[_0xb32a('0x20')](_0x53f6a4)[_0xb32a('0x21')](function(_0x17e61f){return _0x17e61f;});}return null;};}function removeEntity(_0x2f5f50,_0x13ba0d){return function(_0x1e1236){if(_0x1e1236){return _0x1e1236[_0xb32a('0x22')]()['then'](function(){_0x2f5f50['status'](0xcc)[_0xb32a('0x23')]();});}};}function handleEntityNotFound(_0x3f5a34,_0x1b8e8e){return function(_0x4e385c){if(!_0x4e385c){_0x3f5a34[_0xb32a('0x16')](0x194);}return _0x4e385c;};}function handleError(_0x5919c6,_0x411055){_0x411055=_0x411055||0x1f4;return function(_0x455f99){logger[_0xb32a('0x24')](_0x455f99[_0xb32a('0x25')]);if(_0x455f99[_0xb32a('0x26')]){delete _0x455f99[_0xb32a('0x26')];}_0x5919c6[_0xb32a('0x17')](_0x411055)[_0xb32a('0x27')](_0x455f99);};}exports[_0xb32a('0x28')]=function(_0x2c1daa,_0x53e705){var _0x12b721={},_0x7a3a69={},_0x2d99a1={'count':0x0,'rows':[]};var _0x25728e=_['map'](db[_0xb32a('0x29')][_0xb32a('0x2a')],function(_0x143cb9){return{'name':_0x143cb9['fieldName'],'type':_0x143cb9[_0xb32a('0x2b')]['key']};});_0x7a3a69[_0xb32a('0x2c')]=_[_0xb32a('0x2d')](_0x25728e,_0xb32a('0x26'));_0x7a3a69[_0xb32a('0x2e')]=_[_0xb32a('0x2f')](_0x2c1daa[_0xb32a('0x2e')]);_0x7a3a69[_0xb32a('0x30')]=_[_0xb32a('0x31')](_0x7a3a69[_0xb32a('0x2c')],_0x7a3a69[_0xb32a('0x2e')]);_0x12b721[_0xb32a('0x32')]=_[_0xb32a('0x31')](_0x7a3a69['model'],qs[_0xb32a('0x33')](_0x2c1daa['query'][_0xb32a('0x33')]));_0x12b721[_0xb32a('0x32')]=_0x12b721['attributes'][_0xb32a('0x34')]?_0x12b721['attributes']:_0x7a3a69[_0xb32a('0x2c')];if(!_0x2c1daa[_0xb32a('0x2e')][_0xb32a('0x35')](_0xb32a('0x36'))){_0x12b721[_0xb32a('0x1b')]=qs[_0xb32a('0x1b')](_0x2c1daa[_0xb32a('0x2e')]['limit']);_0x12b721[_0xb32a('0x19')]=qs[_0xb32a('0x19')](_0x2c1daa['query'][_0xb32a('0x19')]);}_0x12b721['order']=qs[_0xb32a('0x37')](_0x2c1daa[_0xb32a('0x2e')][_0xb32a('0x37')]);_0x12b721[_0xb32a('0x38')]=qs[_0xb32a('0x30')](_[_0xb32a('0x39')](_0x2c1daa['query'],_0x7a3a69[_0xb32a('0x30')]),_0x25728e);if(_0x2c1daa[_0xb32a('0x2e')][_0xb32a('0x3a')]){_0x12b721[_0xb32a('0x38')]=_[_0xb32a('0x3b')](_0x12b721['where'],{'$or':_[_0xb32a('0x2d')](_0x25728e,function(_0x37daab){if(_0x37daab[_0xb32a('0x2b')]!==_0xb32a('0x3c')){var _0x2b2db5={};_0x2b2db5[_0x37daab[_0xb32a('0x26')]]={'$like':'%'+_0x2c1daa['query'][_0xb32a('0x3a')]+'%'};return _0x2b2db5;}})});}_0x12b721=_[_0xb32a('0x3b')]({},_0x12b721,_0x2c1daa[_0xb32a('0x3d')]);var _0x32fd15={'where':_0x12b721['where']};return db[_0xb32a('0x29')]['count'](_0x32fd15)[_0xb32a('0x21')](function(_0x390ee1){_0x2d99a1['count']=_0x390ee1;if(_0x2c1daa[_0xb32a('0x2e')][_0xb32a('0x3e')]){_0x12b721[_0xb32a('0x3f')]=[{'all':!![]}];}return db[_0xb32a('0x29')][_0xb32a('0x40')](_0x12b721);})[_0xb32a('0x21')](function(_0x91a69f){_0x2d99a1[_0xb32a('0x41')]=_0x91a69f;return _0x2d99a1;})[_0xb32a('0x21')](respondWithFilteredResult(_0x53e705,_0x12b721))[_0xb32a('0x42')](handleError(_0x53e705,null));};exports[_0xb32a('0x43')]=function(_0x1a6c1b,_0x25f6f8){var _0x2d3d92={'raw':!![],'where':{'id':_0x1a6c1b[_0xb32a('0x44')]['id']}},_0xcbe63c={};_0xcbe63c[_0xb32a('0x2c')]=_[_0xb32a('0x2f')](db[_0xb32a('0x29')][_0xb32a('0x2a')]);_0xcbe63c[_0xb32a('0x2e')]=_[_0xb32a('0x2f')](_0x1a6c1b['query']);_0xcbe63c[_0xb32a('0x30')]=_[_0xb32a('0x31')](_0xcbe63c[_0xb32a('0x2c')],_0xcbe63c['query']);_0x2d3d92[_0xb32a('0x32')]=_[_0xb32a('0x31')](_0xcbe63c[_0xb32a('0x2c')],qs[_0xb32a('0x33')](_0x1a6c1b[_0xb32a('0x2e')][_0xb32a('0x33')]));_0x2d3d92[_0xb32a('0x32')]=_0x2d3d92[_0xb32a('0x32')][_0xb32a('0x34')]?_0x2d3d92[_0xb32a('0x32')]:_0xcbe63c[_0xb32a('0x2c')];if(_0x1a6c1b[_0xb32a('0x2e')][_0xb32a('0x3e')]){_0x2d3d92['include']=[{'all':!![]}];}_0x2d3d92=_[_0xb32a('0x3b')]({},_0x2d3d92,_0x1a6c1b[_0xb32a('0x3d')]);return db[_0xb32a('0x29')][_0xb32a('0x45')](_0x2d3d92)[_0xb32a('0x21')](handleEntityNotFound(_0x25f6f8,null))['then'](respondWithResult(_0x25f6f8,null))[_0xb32a('0x42')](handleError(_0x25f6f8,null));};exports['create']=function(_0xa4905a,_0x50a5f5){return db[_0xb32a('0x29')][_0xb32a('0x46')](_0xa4905a[_0xb32a('0x47')],{})[_0xb32a('0x21')](respondWithResult(_0x50a5f5,0xc9))[_0xb32a('0x42')](handleError(_0x50a5f5,null));};exports[_0xb32a('0x20')]=function(_0x348648,_0x57a7aa){if(_0x348648[_0xb32a('0x47')]['id']){delete _0x348648['body']['id'];}return db['OpenchannelQueueReport'][_0xb32a('0x45')]({'where':{'id':_0x348648['params']['id']}})[_0xb32a('0x21')](handleEntityNotFound(_0x57a7aa,null))[_0xb32a('0x21')](saveUpdates(_0x348648[_0xb32a('0x47')],null))['then'](respondWithResult(_0x57a7aa,null))[_0xb32a('0x42')](handleError(_0x57a7aa,null));};exports[_0xb32a('0x22')]=function(_0x5f39d1,_0x23becd){return db[_0xb32a('0x29')][_0xb32a('0x45')]({'where':{'id':_0x5f39d1[_0xb32a('0x44')]['id']}})[_0xb32a('0x21')](handleEntityNotFound(_0x23becd,null))[_0xb32a('0x21')](removeEntity(_0x23becd,null))['catch'](handleError(_0x23becd,null));};exports[_0xb32a('0x48')]=function(_0x378a34,_0x56a77a){return db[_0xb32a('0x29')][_0xb32a('0x48')]()[_0xb32a('0x21')](respondWithResult(_0x56a77a,null))[_0xb32a('0x42')](handleError(_0x56a77a,null));}; \ No newline at end of file +var _0xa9a2=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9a2,0x1c9));var _0x2a9a=function(_0x40120f,_0x2e9157){_0x40120f=_0x40120f-0x0;var _0x5f232f=_0xa9a2[_0x40120f];return _0x5f232f;};'use strict';var emlformat=require(_0x2a9a('0x0'));var rimraf=require(_0x2a9a('0x1'));var zipdir=require(_0x2a9a('0x2'));var jsonpatch=require(_0x2a9a('0x3'));var rp=require(_0x2a9a('0x4'));var moment=require(_0x2a9a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a9a('0x6'));var util=require(_0x2a9a('0x7'));var path=require(_0x2a9a('0x8'));var sox=require('sox');var csv=require(_0x2a9a('0x9'));var ejs=require(_0x2a9a('0xa'));var fs=require('fs');var fs_extra=require(_0x2a9a('0xb'));var _=require(_0x2a9a('0xc'));var squel=require('squel');var crypto=require(_0x2a9a('0xd'));var jsforce=require(_0x2a9a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2a9a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2a9a('0xf'));var qs=require(_0x2a9a('0x10'));var as=require(_0x2a9a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a9a('0x12'))(_0x2a9a('0x13'));var utils=require(_0x2a9a('0x14'));var config=require(_0x2a9a('0x15'));var licenseUtil=require(_0x2a9a('0x16'));var db=require(_0x2a9a('0x17'))['db'];function respondWithStatusCode(_0x4a8bb2,_0x318cf8){_0x318cf8=_0x318cf8||0xcc;return function(_0x531c8b){if(_0x531c8b){return _0x4a8bb2[_0x2a9a('0x18')](_0x318cf8);}return _0x4a8bb2['status'](_0x318cf8)[_0x2a9a('0x19')]();};}function respondWithResult(_0x44793b,_0x5d94bc){_0x5d94bc=_0x5d94bc||0xc8;return function(_0x40dea5){if(_0x40dea5){return _0x44793b[_0x2a9a('0x1a')](_0x5d94bc)[_0x2a9a('0x1b')](_0x40dea5);}};}function respondWithFilteredResult(_0x3ad123,_0x5c3cf8){return function(_0x788779){if(_0x788779){var _0x100cd7=typeof _0x5c3cf8[_0x2a9a('0x1c')]===_0x2a9a('0x1d')&&typeof _0x5c3cf8[_0x2a9a('0x1e')]===_0x2a9a('0x1d');var _0x9f6459=_0x788779[_0x2a9a('0x1f')];var _0x4000c3=_0x100cd7?0x0:_0x5c3cf8[_0x2a9a('0x1c')];var _0x51c44f=_0x100cd7?_0x788779[_0x2a9a('0x1f')]:_0x5c3cf8[_0x2a9a('0x1c')]+_0x5c3cf8[_0x2a9a('0x1e')];var _0xc2f832;if(_0x51c44f>=_0x9f6459){_0x51c44f=_0x9f6459;_0xc2f832=0xc8;}else{_0xc2f832=0xce;}_0x3ad123[_0x2a9a('0x1a')](_0xc2f832);return _0x3ad123[_0x2a9a('0x20')](_0x2a9a('0x21'),_0x4000c3+'-'+_0x51c44f+'/'+_0x9f6459)[_0x2a9a('0x1b')](_0x788779);}return null;};}function patchUpdates(_0x558671){return function(_0x47ec7d){try{jsonpatch[_0x2a9a('0x22')](_0x47ec7d,_0x558671,!![]);}catch(_0x2a5dd9){return BPromise[_0x2a9a('0x23')](_0x2a5dd9);}return _0x47ec7d[_0x2a9a('0x24')]();};}function saveUpdates(_0x2f431e,_0x49539e){return function(_0x1a2b19){if(_0x1a2b19){return _0x1a2b19[_0x2a9a('0x25')](_0x2f431e)['then'](function(_0x65b7f6){return _0x65b7f6;});}return null;};}function removeEntity(_0xc644a9,_0x496d78){return function(_0x2702fe){if(_0x2702fe){return _0x2702fe[_0x2a9a('0x26')]()[_0x2a9a('0x27')](function(){_0xc644a9[_0x2a9a('0x1a')](0xcc)[_0x2a9a('0x19')]();});}};}function handleEntityNotFound(_0x40e20f,_0x17f97c){return function(_0x16114c){if(!_0x16114c){_0x40e20f['sendStatus'](0x194);}return _0x16114c;};}function handleError(_0x18349a,_0x4861bd){_0x4861bd=_0x4861bd||0x1f4;return function(_0x696c08){logger[_0x2a9a('0x28')](_0x696c08['stack']);if(_0x696c08[_0x2a9a('0x29')]){delete _0x696c08[_0x2a9a('0x29')];}_0x18349a[_0x2a9a('0x1a')](_0x4861bd)['send'](_0x696c08);};}exports[_0x2a9a('0x2a')]=function(_0x309297,_0x4ff78f){var _0x180305={},_0x14d214={},_0x429332={'count':0x0,'rows':[]};var _0x45d2ba=_[_0x2a9a('0x2b')](db[_0x2a9a('0x2c')][_0x2a9a('0x2d')],function(_0x1e882a){return{'name':_0x1e882a[_0x2a9a('0x2e')],'type':_0x1e882a[_0x2a9a('0x2f')][_0x2a9a('0x30')]};});_0x14d214[_0x2a9a('0x31')]=_[_0x2a9a('0x2b')](_0x45d2ba,_0x2a9a('0x29'));_0x14d214['query']=_[_0x2a9a('0x32')](_0x309297[_0x2a9a('0x33')]);_0x14d214[_0x2a9a('0x34')]=_[_0x2a9a('0x35')](_0x14d214[_0x2a9a('0x31')],_0x14d214[_0x2a9a('0x33')]);_0x180305['attributes']=_[_0x2a9a('0x35')](_0x14d214[_0x2a9a('0x31')],qs['fields'](_0x309297[_0x2a9a('0x33')]['fields']));_0x180305[_0x2a9a('0x36')]=_0x180305[_0x2a9a('0x36')]['length']?_0x180305['attributes']:_0x14d214[_0x2a9a('0x31')];if(!_0x309297[_0x2a9a('0x33')]['hasOwnProperty'](_0x2a9a('0x37'))){_0x180305[_0x2a9a('0x1e')]=qs[_0x2a9a('0x1e')](_0x309297[_0x2a9a('0x33')]['limit']);_0x180305['offset']=qs[_0x2a9a('0x1c')](_0x309297[_0x2a9a('0x33')][_0x2a9a('0x1c')]);}_0x180305[_0x2a9a('0x38')]=qs[_0x2a9a('0x39')](_0x309297[_0x2a9a('0x33')][_0x2a9a('0x39')]);_0x180305['where']=qs[_0x2a9a('0x34')](_[_0x2a9a('0x3a')](_0x309297[_0x2a9a('0x33')],_0x14d214[_0x2a9a('0x34')]),_0x45d2ba);if(_0x309297[_0x2a9a('0x33')]['filter']){_0x180305['where']=_[_0x2a9a('0x3b')](_0x180305[_0x2a9a('0x3c')],{'$or':_[_0x2a9a('0x2b')](_0x45d2ba,function(_0x2368e8){if(_0x2368e8[_0x2a9a('0x2f')]!==_0x2a9a('0x3d')){var _0x1f4e38={};_0x1f4e38[_0x2368e8['name']]={'$like':'%'+_0x309297['query'][_0x2a9a('0x3e')]+'%'};return _0x1f4e38;}})});}_0x180305=_['merge']({},_0x180305,_0x309297[_0x2a9a('0x3f')]);var _0x30a862={'where':_0x180305[_0x2a9a('0x3c')]};return db['OpenchannelQueueReport'][_0x2a9a('0x1f')](_0x30a862)[_0x2a9a('0x27')](function(_0x33d6df){_0x429332[_0x2a9a('0x1f')]=_0x33d6df;if(_0x309297[_0x2a9a('0x33')][_0x2a9a('0x40')]){_0x180305['include']=[{'all':!![]}];}return db[_0x2a9a('0x2c')][_0x2a9a('0x41')](_0x180305);})[_0x2a9a('0x27')](function(_0x551030){_0x429332[_0x2a9a('0x42')]=_0x551030;return _0x429332;})['then'](respondWithFilteredResult(_0x4ff78f,_0x180305))[_0x2a9a('0x43')](handleError(_0x4ff78f,null));};exports[_0x2a9a('0x44')]=function(_0x37e2c8,_0x28c007){var _0xd4e4b1={'raw':!![],'where':{'id':_0x37e2c8[_0x2a9a('0x45')]['id']}},_0x5625c2={};_0x5625c2[_0x2a9a('0x31')]=_[_0x2a9a('0x32')](db[_0x2a9a('0x2c')][_0x2a9a('0x2d')]);_0x5625c2[_0x2a9a('0x33')]=_['keys'](_0x37e2c8[_0x2a9a('0x33')]);_0x5625c2[_0x2a9a('0x34')]=_[_0x2a9a('0x35')](_0x5625c2[_0x2a9a('0x31')],_0x5625c2[_0x2a9a('0x33')]);_0xd4e4b1[_0x2a9a('0x36')]=_[_0x2a9a('0x35')](_0x5625c2[_0x2a9a('0x31')],qs[_0x2a9a('0x46')](_0x37e2c8[_0x2a9a('0x33')][_0x2a9a('0x46')]));_0xd4e4b1[_0x2a9a('0x36')]=_0xd4e4b1[_0x2a9a('0x36')]['length']?_0xd4e4b1[_0x2a9a('0x36')]:_0x5625c2['model'];if(_0x37e2c8[_0x2a9a('0x33')][_0x2a9a('0x40')]){_0xd4e4b1[_0x2a9a('0x47')]=[{'all':!![]}];}_0xd4e4b1=_['merge']({},_0xd4e4b1,_0x37e2c8[_0x2a9a('0x3f')]);return db[_0x2a9a('0x2c')][_0x2a9a('0x48')](_0xd4e4b1)[_0x2a9a('0x27')](handleEntityNotFound(_0x28c007,null))[_0x2a9a('0x27')](respondWithResult(_0x28c007,null))['catch'](handleError(_0x28c007,null));};exports[_0x2a9a('0x49')]=function(_0x26acec,_0x59475d){return db[_0x2a9a('0x2c')]['create'](_0x26acec[_0x2a9a('0x4a')],{})[_0x2a9a('0x27')](respondWithResult(_0x59475d,0xc9))[_0x2a9a('0x43')](handleError(_0x59475d,null));};exports[_0x2a9a('0x25')]=function(_0x199174,_0x443a42){if(_0x199174[_0x2a9a('0x4a')]['id']){delete _0x199174[_0x2a9a('0x4a')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x199174[_0x2a9a('0x45')]['id']}})['then'](handleEntityNotFound(_0x443a42,null))[_0x2a9a('0x27')](saveUpdates(_0x199174[_0x2a9a('0x4a')],null))['then'](respondWithResult(_0x443a42,null))[_0x2a9a('0x43')](handleError(_0x443a42,null));};exports['destroy']=function(_0x1ff46,_0x4aab72){return db['OpenchannelQueueReport'][_0x2a9a('0x48')]({'where':{'id':_0x1ff46['params']['id']}})[_0x2a9a('0x27')](handleEntityNotFound(_0x4aab72,null))['then'](removeEntity(_0x4aab72,null))['catch'](handleError(_0x4aab72,null));};exports[_0x2a9a('0x4b')]=function(_0x42fc47,_0x51bd21){return db[_0x2a9a('0x2c')][_0x2a9a('0x4b')]()[_0x2a9a('0x27')](respondWithResult(_0x51bd21,null))[_0x2a9a('0x43')](handleError(_0x51bd21,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f2ebb0a..008e3b5 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x41ec33,_0x904b4f){var _0x455763=function(_0x49913c){while(--_0x49913c){_0x41ec33['push'](_0x41ec33['shift']());}};_0x455763(++_0x904b4f);}(_0x7a54,0x106));var _0x47a5=function(_0x324f7e,_0x56c8f6){_0x324f7e=_0x324f7e-0x0;var _0x511884=_0x7a54[_0x324f7e];return _0x511884;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x1ac8e1,_0x395baa){var _0x287e25=function(_0xf633ab){while(--_0xf633ab){_0x1ac8e1['push'](_0x1ac8e1['shift']());}};_0x287e25(++_0x395baa);}(_0xe14b,0x93));var _0xbe14=function(_0x296f96,_0x4c3e36){_0x296f96=_0x296f96-0x0;var _0x36c3d1=_0xe14b[_0x296f96];return _0x36c3d1;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 29c1e13..85c25b7 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 _0xd4f4=['options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelQueueReport','create','body'];(function(_0x49ca00,_0x53fa97){var _0x43bca8=function(_0x256ed8){while(--_0x256ed8){_0x49ca00['push'](_0x49ca00['shift']());}};_0x43bca8(++_0x53fa97);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x1ac3ff,_0x4e5685){_0x1ac3ff=_0x1ac3ff-0x0;var _0x284b4a=_0xd4f4[_0x1ac3ff];return _0x284b4a;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['OpenchannelQueueReport'][_0x4d4f('0x18')](_0x51dcf1[_0x4d4f('0x19')],{'raw':_0x51dcf1[_0x4d4f('0x1a')]?_0x51dcf1[_0x4d4f('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e1ae2){logger['info'](_0x4d4f('0x17'),_0x51dcf1);logger[_0x4d4f('0x10')](_0x4d4f('0x17'),_0x51dcf1,JSON[_0x4d4f('0x12')](_0x1e1ae2));_0x519501(_0x1e1ae2);})[_0x4d4f('0x16')](function(_0x5beab4){logger['error'](_0x4d4f('0x17'),_0x5beab4['message'],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x5beab4[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x1b')]=function(_0x3f4a55){var _0xf3f7a4=this;return new Promise(function(_0x497cec,_0x44bd2f){return db[_0x4d4f('0x1c')][_0x4d4f('0x1d')](_0x3f4a55[_0x4d4f('0x19')],{'raw':_0x3f4a55['options']?_0x3f4a55['options'][_0x4d4f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x1f')]||null:null,'attributes':_0x3f4a55['options']?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x20')]||null:null,'limit':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')]['limit']||null:null})[_0x4d4f('0xc')](function(_0x51cb3d){logger[_0x4d4f('0xd')](_0x4d4f('0x1b'),_0x3f4a55);logger['debug'](_0x4d4f('0x1b'),_0x3f4a55,JSON[_0x4d4f('0x12')](_0x51cb3d));_0x497cec(_0x51cb3d);})[_0x4d4f('0x16')](function(_0x3d7f14){logger[_0x4d4f('0x13')](_0x4d4f('0x1b'),_0x3d7f14['message'],_0x3f4a55);_0x44bd2f(_0xf3f7a4[_0x4d4f('0x13')](0x1f4,_0x3d7f14[_0x4d4f('0x15')]));});});}; \ No newline at end of file +var _0x958a=['http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x47f3af,_0xf55396){var _0x3ba1e8=function(_0x3876e4){while(--_0x3876e4){_0x47f3af['push'](_0x47f3af['shift']());}};_0x3ba1e8(++_0xf55396);}(_0x958a,0x128));var _0xa958=function(_0x252678,_0x4235bd){_0x252678=_0x252678-0x0;var _0x234b6f=_0x958a[_0x252678];return _0x234b6f;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a90c2){logger[_0xa958('0xc')](_0xa958('0x17'),_0x4eadc9);logger[_0xa958('0xf')]('CreateOpenchannelQueueReport',_0x4eadc9,JSON[_0xa958('0x11')](_0x4a90c2));_0x70d13e(_0x4a90c2);})[_0xa958('0x16')](function(_0x5c091a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x5c091a['message'],_0x4eadc9);_0x52a184(_0x3a053f['error'](0x1f4,_0x5c091a[_0xa958('0x14')]));});});};exports[_0xa958('0x1d')]=function(_0x50b3c3){var _0x25f461=this;return new Promise(function(_0x27097a,_0x2f03df){return db[_0xa958('0x18')][_0xa958('0x1e')](_0x50b3c3[_0xa958('0x1a')],{'raw':_0x50b3c3['options']?_0x50b3c3[_0xa958('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x1f')]||null:null,'attributes':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x20')]||null:null,'limit':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x21')]||null:null})[_0xa958('0xb')](function(_0x4c4c37){logger['info'](_0xa958('0x1d'),_0x50b3c3);logger['debug'](_0xa958('0x1d'),_0x50b3c3,JSON[_0xa958('0x11')](_0x4c4c37));_0x27097a(_0x4c4c37);})['catch'](function(_0x23bdbf){logger[_0xa958('0x12')](_0xa958('0x1d'),_0x23bdbf[_0xa958('0x14')],_0x50b3c3);_0x2f03df(_0x25f461[_0xa958('0x12')](0x1f4,_0x23bdbf['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 97ef977..4f2d464 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 _0x2731=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','put','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0x2731,0xba));var _0x1273=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2731[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1273('0x0'));var util=require(_0x1273('0x1'));var path=require('path');var timeout=require(_0x1273('0x2'));var express=require(_0x1273('0x3'));var router=express[_0x1273('0x4')]();var fs_extra=require(_0x1273('0x5'));var auth=require(_0x1273('0x6'));var interaction=require(_0x1273('0x7'));var config=require(_0x1273('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x1273('0x9')]('/',auth[_0x1273('0xa')](),controller['index']);router[_0x1273('0x9')](_0x1273('0xb'),auth[_0x1273('0xa')](),controller[_0x1273('0xc')]);router[_0x1273('0x9')](_0x1273('0xd'),auth[_0x1273('0xa')](),controller[_0x1273('0xe')]);router['post']('/',auth[_0x1273('0xa')](),controller['create']);router[_0x1273('0xf')](_0x1273('0xd'),auth[_0x1273('0xa')](),controller['update']);router['delete'](_0x1273('0xd'),auth[_0x1273('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdc2b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1ed8b1,_0x17ef7d){var _0x53ab5b=function(_0x1d7530){while(--_0x1d7530){_0x1ed8b1['push'](_0x1ed8b1['shift']());}};_0x53ab5b(++_0x17ef7d);}(_0xdc2b,0x19c));var _0xbdc2=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xdc2b[_0x4e6ae6];return _0x23c108;};'use strict';var multer=require(_0xbdc2('0x0'));var util=require(_0xbdc2('0x1'));var path=require(_0xbdc2('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc2('0x3'));var router=express[_0xbdc2('0x4')]();var fs_extra=require(_0xbdc2('0x5'));var auth=require(_0xbdc2('0x6'));var interaction=require(_0xbdc2('0x7'));var config=require(_0xbdc2('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xbdc2('0x9')]('/',auth[_0xbdc2('0xa')](),controller[_0xbdc2('0xb')]);router[_0xbdc2('0x9')](_0xbdc2('0xc'),auth[_0xbdc2('0xa')](),controller[_0xbdc2('0xd')]);router[_0xbdc2('0x9')]('/:id',auth[_0xbdc2('0xa')](),controller[_0xbdc2('0xe')]);router[_0xbdc2('0xf')]('/',auth[_0xbdc2('0xa')](),controller[_0xbdc2('0x10')]);router[_0xbdc2('0x11')](_0xbdc2('0x12'),auth[_0xbdc2('0xa')](),controller['update']);router[_0xbdc2('0x13')](_0xbdc2('0x12'),auth['isAuthenticated'](),controller[_0xbdc2('0x14')]);module[_0xbdc2('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index fed2e80..f17cac9 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0xf8bba,_0x2ca2bc){var _0x414766=function(_0x373ec8){while(--_0x373ec8){_0xf8bba['push'](_0xf8bba['shift']());}};_0x414766(++_0x2ca2bc);}(_0xf4eb,0xec));var _0xbf4e=function(_0xa769c4,_0x2ab319){_0xa769c4=_0xa769c4-0x0;var _0x185412=_0xf4eb[_0xa769c4];return _0x185412;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xce1284,_0x4ed591){var _0x5d177c=function(_0x48db7e){while(--_0x48db7e){_0xce1284['push'](_0xce1284['shift']());}};_0x5d177c(++_0x4ed591);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d47819b..d0dc0af 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 _0xdd5c=['create','body','find','params','describe','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','length','catch'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xdd5c,0xda));var _0xcdd5=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0xdd5c[_0x538c70];return _0x42ae01;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdd5('0x0'));var rp=require(_0xcdd5('0x1'));var moment=require(_0xcdd5('0x2'));var BPromise=require(_0xcdd5('0x3'));var Mustache=require('mustache');var util=require(_0xcdd5('0x4'));var path=require(_0xcdd5('0x5'));var sox=require(_0xcdd5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd5('0x7'));var _=require(_0xcdd5('0x8'));var squel=require(_0xcdd5('0x9'));var crypto=require(_0xcdd5('0xa'));var jsforce=require(_0xcdd5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcdd5('0xc'));var querystring=require('querystring');var Papa=require(_0xcdd5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcdd5('0xe'));var as=require(_0xcdd5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdd5('0x10'))(_0xcdd5('0x11'));var utils=require('../../config/utils');var config=require(_0xcdd5('0x12'));var licenseUtil=require(_0xcdd5('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11eb29,_0x523ed9){_0x523ed9=_0x523ed9||0xcc;return function(_0x4a0522){if(_0x4a0522){return _0x11eb29[_0xcdd5('0x14')](_0x523ed9);}return _0x11eb29[_0xcdd5('0x15')](_0x523ed9)[_0xcdd5('0x16')]();};}function respondWithResult(_0x368038,_0x2a2913){_0x2a2913=_0x2a2913||0xc8;return function(_0x8ea961){if(_0x8ea961){return _0x368038[_0xcdd5('0x15')](_0x2a2913)[_0xcdd5('0x17')](_0x8ea961);}};}function respondWithFilteredResult(_0x1102d3,_0x5235a3){return function(_0x22f50d){if(_0x22f50d){var _0x1fb4f9=typeof _0x5235a3[_0xcdd5('0x18')]===_0xcdd5('0x19')&&typeof _0x5235a3[_0xcdd5('0x1a')]==='undefined';var _0x49add4=_0x22f50d[_0xcdd5('0x1b')];var _0x5af3f3=_0x1fb4f9?0x0:_0x5235a3[_0xcdd5('0x18')];var _0x22a77e=_0x1fb4f9?_0x22f50d['count']:_0x5235a3['offset']+_0x5235a3['limit'];var _0x50e2f2;if(_0x22a77e>=_0x49add4){_0x22a77e=_0x49add4;_0x50e2f2=0xc8;}else{_0x50e2f2=0xce;}_0x1102d3['status'](_0x50e2f2);return _0x1102d3[_0xcdd5('0x1c')](_0xcdd5('0x1d'),_0x5af3f3+'-'+_0x22a77e+'/'+_0x49add4)[_0xcdd5('0x17')](_0x22f50d);}return null;};}function patchUpdates(_0x567844){return function(_0x174af0){try{jsonpatch[_0xcdd5('0x1e')](_0x174af0,_0x567844,!![]);}catch(_0x3b92f2){return BPromise[_0xcdd5('0x1f')](_0x3b92f2);}return _0x174af0[_0xcdd5('0x20')]();};}function saveUpdates(_0x57bd74,_0x5f374f){return function(_0x4d9a4d){if(_0x4d9a4d){return _0x4d9a4d[_0xcdd5('0x21')](_0x57bd74)[_0xcdd5('0x22')](function(_0x38eb5e){return _0x38eb5e;});}return null;};}function removeEntity(_0x118d1e,_0xd7315c){return function(_0x3ee6b2){if(_0x3ee6b2){return _0x3ee6b2[_0xcdd5('0x23')]()[_0xcdd5('0x22')](function(){_0x118d1e['status'](0xcc)[_0xcdd5('0x16')]();});}};}function handleEntityNotFound(_0x47c50f,_0x257f2c){return function(_0x44f391){if(!_0x44f391){_0x47c50f[_0xcdd5('0x14')](0x194);}return _0x44f391;};}function handleError(_0x3a7b7b,_0xf4e941){_0xf4e941=_0xf4e941||0x1f4;return function(_0x21c8c5){logger['error'](_0x21c8c5[_0xcdd5('0x24')]);if(_0x21c8c5['name']){delete _0x21c8c5[_0xcdd5('0x25')];}_0x3a7b7b[_0xcdd5('0x15')](_0xf4e941)[_0xcdd5('0x26')](_0x21c8c5);};}exports[_0xcdd5('0x27')]=function(_0x353046,_0x4c9cc0){var _0x3fa64f={},_0x368d23={},_0x52593f={'count':0x0,'rows':[]};var _0x136fd8=_[_0xcdd5('0x28')](db[_0xcdd5('0x29')][_0xcdd5('0x2a')],function(_0x20f8c8){return{'name':_0x20f8c8[_0xcdd5('0x2b')],'type':_0x20f8c8['type']['key']};});_0x368d23[_0xcdd5('0x2c')]=_[_0xcdd5('0x28')](_0x136fd8,'name');_0x368d23['query']=_[_0xcdd5('0x2d')](_0x353046[_0xcdd5('0x2e')]);_0x368d23[_0xcdd5('0x2f')]=_['intersection'](_0x368d23['model'],_0x368d23[_0xcdd5('0x2e')]);_0x3fa64f[_0xcdd5('0x30')]=_[_0xcdd5('0x31')](_0x368d23[_0xcdd5('0x2c')],qs['fields'](_0x353046[_0xcdd5('0x2e')][_0xcdd5('0x32')]));_0x3fa64f[_0xcdd5('0x30')]=_0x3fa64f[_0xcdd5('0x30')]['length']?_0x3fa64f[_0xcdd5('0x30')]:_0x368d23[_0xcdd5('0x2c')];if(!_0x353046['query'][_0xcdd5('0x33')](_0xcdd5('0x34'))){_0x3fa64f[_0xcdd5('0x1a')]=qs[_0xcdd5('0x1a')](_0x353046[_0xcdd5('0x2e')][_0xcdd5('0x1a')]);_0x3fa64f['offset']=qs[_0xcdd5('0x18')](_0x353046[_0xcdd5('0x2e')][_0xcdd5('0x18')]);}_0x3fa64f['order']=qs['sort'](_0x353046['query'][_0xcdd5('0x35')]);_0x3fa64f[_0xcdd5('0x36')]=qs['filters'](_['pick'](_0x353046[_0xcdd5('0x2e')],_0x368d23[_0xcdd5('0x2f')]),_0x136fd8);if(_0x353046['query'][_0xcdd5('0x37')]){_0x3fa64f[_0xcdd5('0x36')]=_['merge'](_0x3fa64f[_0xcdd5('0x36')],{'$or':_[_0xcdd5('0x28')](_0x136fd8,function(_0x533859){if(_0x533859[_0xcdd5('0x38')]!==_0xcdd5('0x39')){var _0x3ed0d9={};_0x3ed0d9[_0x533859[_0xcdd5('0x25')]]={'$like':'%'+_0x353046['query'][_0xcdd5('0x37')]+'%'};return _0x3ed0d9;}})});}_0x3fa64f=_[_0xcdd5('0x3a')]({},_0x3fa64f,_0x353046[_0xcdd5('0x3b')]);var _0x6aed14={'where':_0x3fa64f[_0xcdd5('0x36')]};return db[_0xcdd5('0x29')][_0xcdd5('0x1b')](_0x6aed14)['then'](function(_0x4574ca){_0x52593f['count']=_0x4574ca;if(_0x353046['query'][_0xcdd5('0x3c')]){_0x3fa64f[_0xcdd5('0x3d')]=[{'all':!![]}];}return db[_0xcdd5('0x29')][_0xcdd5('0x3e')](_0x3fa64f);})[_0xcdd5('0x22')](function(_0x2acdc0){_0x52593f['rows']=_0x2acdc0;return _0x52593f;})[_0xcdd5('0x22')](respondWithFilteredResult(_0x4c9cc0,_0x3fa64f))['catch'](handleError(_0x4c9cc0,null));};exports[_0xcdd5('0x3f')]=function(_0x3f8027,_0x5f0ed8){var _0x5982a8={'raw':!![],'where':{'id':_0x3f8027['params']['id']}},_0x16e1a1={};_0x16e1a1[_0xcdd5('0x2c')]=_[_0xcdd5('0x2d')](db[_0xcdd5('0x29')][_0xcdd5('0x2a')]);_0x16e1a1[_0xcdd5('0x2e')]=_['keys'](_0x3f8027[_0xcdd5('0x2e')]);_0x16e1a1['filters']=_[_0xcdd5('0x31')](_0x16e1a1[_0xcdd5('0x2c')],_0x16e1a1['query']);_0x5982a8[_0xcdd5('0x30')]=_['intersection'](_0x16e1a1['model'],qs[_0xcdd5('0x32')](_0x3f8027[_0xcdd5('0x2e')][_0xcdd5('0x32')]));_0x5982a8['attributes']=_0x5982a8[_0xcdd5('0x30')][_0xcdd5('0x40')]?_0x5982a8[_0xcdd5('0x30')]:_0x16e1a1[_0xcdd5('0x2c')];if(_0x3f8027[_0xcdd5('0x2e')][_0xcdd5('0x3c')]){_0x5982a8[_0xcdd5('0x3d')]=[{'all':!![]}];}_0x5982a8=_[_0xcdd5('0x3a')]({},_0x5982a8,_0x3f8027[_0xcdd5('0x3b')]);return db[_0xcdd5('0x29')]['find'](_0x5982a8)[_0xcdd5('0x22')](handleEntityNotFound(_0x5f0ed8,null))['then'](respondWithResult(_0x5f0ed8,null))[_0xcdd5('0x41')](handleError(_0x5f0ed8,null));};exports[_0xcdd5('0x42')]=function(_0x240798,_0x422a39){return db[_0xcdd5('0x29')][_0xcdd5('0x42')](_0x240798[_0xcdd5('0x43')],{})[_0xcdd5('0x22')](respondWithResult(_0x422a39,0xc9))[_0xcdd5('0x41')](handleError(_0x422a39,null));};exports['update']=function(_0x475299,_0x11b26a){if(_0x475299[_0xcdd5('0x43')]['id']){delete _0x475299[_0xcdd5('0x43')]['id'];}return db[_0xcdd5('0x29')][_0xcdd5('0x44')]({'where':{'id':_0x475299['params']['id']}})[_0xcdd5('0x22')](handleEntityNotFound(_0x11b26a,null))[_0xcdd5('0x22')](saveUpdates(_0x475299[_0xcdd5('0x43')],null))[_0xcdd5('0x22')](respondWithResult(_0x11b26a,null))['catch'](handleError(_0x11b26a,null));};exports['destroy']=function(_0x70eac9,_0x250d4b){return db[_0xcdd5('0x29')][_0xcdd5('0x44')]({'where':{'id':_0x70eac9[_0xcdd5('0x45')]['id']}})[_0xcdd5('0x22')](handleEntityNotFound(_0x250d4b,null))['then'](removeEntity(_0x250d4b,null))['catch'](handleError(_0x250d4b,null));};exports[_0xcdd5('0x46')]=function(_0x2a5a44,_0x2ad67f){return db[_0xcdd5('0x29')][_0xcdd5('0x46')]()[_0xcdd5('0x22')](respondWithResult(_0x2ad67f,null))[_0xcdd5('0x41')](handleError(_0x2ad67f,null));}; \ No newline at end of file +var _0xe8eb=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','options','includeAll','include','rows','catch','show','params','merge','find','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3bf9b7,_0x2d9b97){var _0x566013=function(_0x33472e){while(--_0x33472e){_0x3bf9b7['push'](_0x3bf9b7['shift']());}};_0x566013(++_0x2d9b97);}(_0xe8eb,0x115));var _0xbe8e=function(_0x2594b2,_0x11ffcd){_0x2594b2=_0x2594b2-0x0;var _0x4df599=_0xe8eb[_0x2594b2];return _0x4df599;};'use strict';var emlformat=require(_0xbe8e('0x0'));var rimraf=require(_0xbe8e('0x1'));var zipdir=require(_0xbe8e('0x2'));var jsonpatch=require(_0xbe8e('0x3'));var rp=require(_0xbe8e('0x4'));var moment=require(_0xbe8e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbe8e('0x6'));var path=require(_0xbe8e('0x7'));var sox=require(_0xbe8e('0x8'));var csv=require(_0xbe8e('0x9'));var ejs=require(_0xbe8e('0xa'));var fs=require('fs');var fs_extra=require(_0xbe8e('0xb'));var _=require(_0xbe8e('0xc'));var squel=require(_0xbe8e('0xd'));var crypto=require(_0xbe8e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbe8e('0xf'));var toCsv=require(_0xbe8e('0x9'));var querystring=require(_0xbe8e('0x10'));var Papa=require(_0xbe8e('0x11'));var Redis=require(_0xbe8e('0x12'));var authService=require(_0xbe8e('0x13'));var qs=require(_0xbe8e('0x14'));var as=require(_0xbe8e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe8e('0x16'))('api');var utils=require(_0xbe8e('0x17'));var config=require(_0xbe8e('0x18'));var licenseUtil=require(_0xbe8e('0x19'));var db=require(_0xbe8e('0x1a'))['db'];function respondWithStatusCode(_0x2cbf46,_0x2e3af3){_0x2e3af3=_0x2e3af3||0xcc;return function(_0x1acc2f){if(_0x1acc2f){return _0x2cbf46[_0xbe8e('0x1b')](_0x2e3af3);}return _0x2cbf46[_0xbe8e('0x1c')](_0x2e3af3)[_0xbe8e('0x1d')]();};}function respondWithResult(_0x1e123f,_0x4868cf){_0x4868cf=_0x4868cf||0xc8;return function(_0x1a8845){if(_0x1a8845){return _0x1e123f[_0xbe8e('0x1c')](_0x4868cf)[_0xbe8e('0x1e')](_0x1a8845);}};}function respondWithFilteredResult(_0x5c3af8,_0x3bb5ae){return function(_0x19642d){if(_0x19642d){var _0x4b6ba1=typeof _0x3bb5ae[_0xbe8e('0x1f')]==='undefined'&&typeof _0x3bb5ae[_0xbe8e('0x20')]===_0xbe8e('0x21');var _0xbaeea6=_0x19642d[_0xbe8e('0x22')];var _0x2446ad=_0x4b6ba1?0x0:_0x3bb5ae[_0xbe8e('0x1f')];var _0x47cfd1=_0x4b6ba1?_0x19642d[_0xbe8e('0x22')]:_0x3bb5ae[_0xbe8e('0x1f')]+_0x3bb5ae[_0xbe8e('0x20')];var _0x159a27;if(_0x47cfd1>=_0xbaeea6){_0x47cfd1=_0xbaeea6;_0x159a27=0xc8;}else{_0x159a27=0xce;}_0x5c3af8['status'](_0x159a27);return _0x5c3af8[_0xbe8e('0x23')](_0xbe8e('0x24'),_0x2446ad+'-'+_0x47cfd1+'/'+_0xbaeea6)[_0xbe8e('0x1e')](_0x19642d);}return null;};}function patchUpdates(_0x47061b){return function(_0x220927){try{jsonpatch[_0xbe8e('0x25')](_0x220927,_0x47061b,!![]);}catch(_0x31a116){return BPromise[_0xbe8e('0x26')](_0x31a116);}return _0x220927[_0xbe8e('0x27')]();};}function saveUpdates(_0xdba9f6,_0x354a89){return function(_0xc3fec4){if(_0xc3fec4){return _0xc3fec4[_0xbe8e('0x28')](_0xdba9f6)[_0xbe8e('0x29')](function(_0x3b1419){return _0x3b1419;});}return null;};}function removeEntity(_0xc56985,_0x5247bc){return function(_0x8b365e){if(_0x8b365e){return _0x8b365e[_0xbe8e('0x2a')]()[_0xbe8e('0x29')](function(){_0xc56985[_0xbe8e('0x1c')](0xcc)[_0xbe8e('0x1d')]();});}};}function handleEntityNotFound(_0x4d2321,_0x5201a9){return function(_0x43392d){if(!_0x43392d){_0x4d2321[_0xbe8e('0x1b')](0x194);}return _0x43392d;};}function handleError(_0x1e29ef,_0x183ba8){_0x183ba8=_0x183ba8||0x1f4;return function(_0x266991){logger['error'](_0x266991[_0xbe8e('0x2b')]);if(_0x266991['name']){delete _0x266991['name'];}_0x1e29ef[_0xbe8e('0x1c')](_0x183ba8)[_0xbe8e('0x2c')](_0x266991);};}exports['index']=function(_0x309c38,_0x54e32d){var _0x9e7b57={},_0xf886b4={},_0x42b01b={'count':0x0,'rows':[]};var _0x20c3eb=_[_0xbe8e('0x2d')](db[_0xbe8e('0x2e')][_0xbe8e('0x2f')],function(_0x1d4798){return{'name':_0x1d4798[_0xbe8e('0x30')],'type':_0x1d4798[_0xbe8e('0x31')][_0xbe8e('0x32')]};});_0xf886b4[_0xbe8e('0x33')]=_['map'](_0x20c3eb,_0xbe8e('0x34'));_0xf886b4[_0xbe8e('0x35')]=_[_0xbe8e('0x36')](_0x309c38[_0xbe8e('0x35')]);_0xf886b4['filters']=_[_0xbe8e('0x37')](_0xf886b4[_0xbe8e('0x33')],_0xf886b4[_0xbe8e('0x35')]);_0x9e7b57[_0xbe8e('0x38')]=_['intersection'](_0xf886b4[_0xbe8e('0x33')],qs[_0xbe8e('0x39')](_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x39')]));_0x9e7b57[_0xbe8e('0x38')]=_0x9e7b57['attributes'][_0xbe8e('0x3a')]?_0x9e7b57['attributes']:_0xf886b4[_0xbe8e('0x33')];if(!_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x3b')]('nolimit')){_0x9e7b57[_0xbe8e('0x20')]=qs[_0xbe8e('0x20')](_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x20')]);_0x9e7b57[_0xbe8e('0x1f')]=qs['offset'](_0x309c38['query'][_0xbe8e('0x1f')]);}_0x9e7b57[_0xbe8e('0x3c')]=qs[_0xbe8e('0x3d')](_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x3d')]);_0x9e7b57[_0xbe8e('0x3e')]=qs[_0xbe8e('0x3f')](_['pick'](_0x309c38[_0xbe8e('0x35')],_0xf886b4[_0xbe8e('0x3f')]),_0x20c3eb);if(_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x40')]){_0x9e7b57['where']=_['merge'](_0x9e7b57[_0xbe8e('0x3e')],{'$or':_[_0xbe8e('0x2d')](_0x20c3eb,function(_0x2ee479){if(_0x2ee479[_0xbe8e('0x31')]!=='VIRTUAL'){var _0x50a759={};_0x50a759[_0x2ee479[_0xbe8e('0x34')]]={'$like':'%'+_0x309c38[_0xbe8e('0x35')][_0xbe8e('0x40')]+'%'};return _0x50a759;}})});}_0x9e7b57=_['merge']({},_0x9e7b57,_0x309c38[_0xbe8e('0x41')]);var _0x5246f3={'where':_0x9e7b57['where']};return db['OpenchannelTransferReport']['count'](_0x5246f3)[_0xbe8e('0x29')](function(_0x51b5dc){_0x42b01b[_0xbe8e('0x22')]=_0x51b5dc;if(_0x309c38['query'][_0xbe8e('0x42')]){_0x9e7b57[_0xbe8e('0x43')]=[{'all':!![]}];}return db[_0xbe8e('0x2e')]['findAll'](_0x9e7b57);})[_0xbe8e('0x29')](function(_0x38c697){_0x42b01b[_0xbe8e('0x44')]=_0x38c697;return _0x42b01b;})['then'](respondWithFilteredResult(_0x54e32d,_0x9e7b57))[_0xbe8e('0x45')](handleError(_0x54e32d,null));};exports[_0xbe8e('0x46')]=function(_0x54892d,_0xc0d925){var _0x41d725={'raw':!![],'where':{'id':_0x54892d[_0xbe8e('0x47')]['id']}},_0x5107ce={};_0x5107ce[_0xbe8e('0x33')]=_[_0xbe8e('0x36')](db[_0xbe8e('0x2e')][_0xbe8e('0x2f')]);_0x5107ce['query']=_[_0xbe8e('0x36')](_0x54892d[_0xbe8e('0x35')]);_0x5107ce[_0xbe8e('0x3f')]=_[_0xbe8e('0x37')](_0x5107ce[_0xbe8e('0x33')],_0x5107ce[_0xbe8e('0x35')]);_0x41d725[_0xbe8e('0x38')]=_[_0xbe8e('0x37')](_0x5107ce[_0xbe8e('0x33')],qs['fields'](_0x54892d['query'][_0xbe8e('0x39')]));_0x41d725['attributes']=_0x41d725['attributes'][_0xbe8e('0x3a')]?_0x41d725[_0xbe8e('0x38')]:_0x5107ce['model'];if(_0x54892d[_0xbe8e('0x35')]['includeAll']){_0x41d725[_0xbe8e('0x43')]=[{'all':!![]}];}_0x41d725=_[_0xbe8e('0x48')]({},_0x41d725,_0x54892d[_0xbe8e('0x41')]);return db[_0xbe8e('0x2e')][_0xbe8e('0x49')](_0x41d725)[_0xbe8e('0x29')](handleEntityNotFound(_0xc0d925,null))[_0xbe8e('0x29')](respondWithResult(_0xc0d925,null))['catch'](handleError(_0xc0d925,null));};exports['create']=function(_0x9cc63f,_0x295dc2){return db['OpenchannelTransferReport'][_0xbe8e('0x4a')](_0x9cc63f[_0xbe8e('0x4b')],{})['then'](respondWithResult(_0x295dc2,0xc9))[_0xbe8e('0x45')](handleError(_0x295dc2,null));};exports['update']=function(_0x1bcc34,_0x3735f8){if(_0x1bcc34[_0xbe8e('0x4b')]['id']){delete _0x1bcc34[_0xbe8e('0x4b')]['id'];}return db[_0xbe8e('0x2e')][_0xbe8e('0x49')]({'where':{'id':_0x1bcc34[_0xbe8e('0x47')]['id']}})[_0xbe8e('0x29')](handleEntityNotFound(_0x3735f8,null))[_0xbe8e('0x29')](saveUpdates(_0x1bcc34[_0xbe8e('0x4b')],null))[_0xbe8e('0x29')](respondWithResult(_0x3735f8,null))['catch'](handleError(_0x3735f8,null));};exports[_0xbe8e('0x2a')]=function(_0xfe6c4d,_0x3065dd){return db[_0xbe8e('0x2e')][_0xbe8e('0x49')]({'where':{'id':_0xfe6c4d[_0xbe8e('0x47')]['id']}})[_0xbe8e('0x29')](handleEntityNotFound(_0x3065dd,null))['then'](removeEntity(_0x3065dd,null))[_0xbe8e('0x45')](handleError(_0x3065dd,null));};exports[_0xbe8e('0x4c')]=function(_0x50dce0,_0x347306){return db[_0xbe8e('0x2e')][_0xbe8e('0x4c')]()[_0xbe8e('0x29')](respondWithResult(_0x347306,null))['catch'](handleError(_0x347306,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 37b5212..0a09ca2 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 _0x3cb1=['util','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash'];(function(_0x2415ad,_0x2fc4bb){var _0x3debf9=function(_0x5f0e05){while(--_0x5f0e05){_0x2415ad['push'](_0x2415ad['shift']());}};_0x3debf9(++_0x2fc4bb);}(_0x3cb1,0xdc));var _0x13cb=function(_0x132a2a,_0x42c807){_0x132a2a=_0x132a2a-0x0;var _0x3b1ade=_0x3cb1[_0x132a2a];return _0x3b1ade;};'use strict';var _=require(_0x13cb('0x0'));var util=require(_0x13cb('0x1'));var logger=require('../../config/logger')(_0x13cb('0x2'));var moment=require(_0x13cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x13cb('0x4'));var fs=require('fs');var path=require(_0x13cb('0x5'));var rimraf=require(_0x13cb('0x6'));var config=require(_0x13cb('0x7'));var attributes=require(_0x13cb('0x8'));module[_0x13cb('0x9')]=function(_0x263dd7,_0x302f42){return _0x263dd7[_0x13cb('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x13cb('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x13cb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f09=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15490c,_0x1f3c71){var _0x4ac4f1=function(_0xb5501a){while(--_0xb5501a){_0x15490c['push'](_0x15490c['shift']());}};_0x4ac4f1(++_0x1f3c71);}(_0x4f09,0xcc));var _0x94f0=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x4f09[_0x589aee];return _0x2f5ed4;};'use strict';var _=require(_0x94f0('0x0'));var util=require(_0x94f0('0x1'));var logger=require(_0x94f0('0x2'))(_0x94f0('0x3'));var moment=require(_0x94f0('0x4'));var BPromise=require(_0x94f0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94f0('0x6'));var rimraf=require(_0x94f0('0x7'));var config=require(_0x94f0('0x8'));var attributes=require(_0x94f0('0x9'));module[_0x94f0('0xa')]=function(_0x59de09,_0x525d9e){return _0x59de09[_0x94f0('0xb')](_0x94f0('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x94f0('0xd'),'fields':[_0x94f0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4c163a4..d6b1c68 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 _0xfd6e=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49e68f,_0x21fa6b){var _0x351589=function(_0x88157b){while(--_0x88157b){_0x49e68f['push'](_0x49e68f['shift']());}};_0x351589(++_0x21fa6b);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd6e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xefd6('0x0'));var util=require('util');var moment=require(_0xefd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xefd6('0x2'));var fs=require('fs');var Redis=require(_0xefd6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefd6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefd6('0x5')][_0xefd6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26e108,_0xe477f9,_0x340765){return new BPromise(function(_0x5da399,_0x59c636){return client[_0xefd6('0x7')](_0x26e108,_0x340765)[_0xefd6('0x8')](function(_0x3c941a){logger['info'](_0xefd6('0x9'),_0xe477f9,_0xefd6('0xa'));logger[_0xefd6('0xb')](_0xefd6('0xc'),_0xe477f9,'request\x20sent',JSON[_0xefd6('0xd')](_0x3c941a));if(_0x3c941a[_0xefd6('0xe')]){if(_0x3c941a[_0xefd6('0xe')][_0xefd6('0xf')]===0x1f4){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x59c636(_0x3c941a['error'][_0xefd6('0x10')]);}logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x5da399(_0x3c941a['error'][_0xefd6('0x10')]);}else{logger['info'](_0xefd6('0x9'),_0xe477f9,'request\x20sent');_0x5da399(_0x3c941a[_0xefd6('0x11')][_0xefd6('0x10')]);}})['catch'](function(_0x17bf20){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x17bf20);_0x59c636(_0x17bf20);});});} \ No newline at end of file +var _0x383d=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x51e25b,_0x1fed7d){var _0x44ce69=function(_0x2d68b8){while(--_0x2d68b8){_0x51e25b['push'](_0x51e25b['shift']());}};_0x44ce69(++_0x1fed7d);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ba82,_0x9922e9,_0x470d8d){return new BPromise(function(_0xffa778,_0x5d4e0f){return client['request'](_0x30ba82,_0x470d8d)[_0xd383('0xa')](function(_0xb3ff62){logger['info'](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));logger[_0xd383('0xd')](_0xd383('0xe'),_0x9922e9,_0xd383('0xc'),JSON[_0xd383('0xf')](_0xb3ff62));if(_0xb3ff62['error']){if(_0xb3ff62[_0xd383('0x10')][_0xd383('0x11')]===0x1f4){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0xb3ff62['error'][_0xd383('0x12')]);return _0x5d4e0f(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}logger[_0xd383('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9922e9,_0xb3ff62[_0xd383('0x10')]['message']);return _0xffa778(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}else{logger[_0xd383('0x13')](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));_0xffa778(_0xb3ff62[_0xd383('0x14')]['message']);}})['catch'](function(_0x3905c1){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0x3905c1);_0x5d4e0f(_0x3905c1);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6163486..ca4cc50 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 _0x05f7=['Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x05f7,0xb9));var _0x705f=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0x05f7[_0x3d8ca8];return _0x517e45;};'use strict';var multer=require(_0x705f('0x0'));var util=require(_0x705f('0x1'));var path=require(_0x705f('0x2'));var timeout=require(_0x705f('0x3'));var express=require(_0x705f('0x4'));var router=express[_0x705f('0x5')]();var fs_extra=require(_0x705f('0x6'));var auth=require(_0x705f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x705f('0x8'));var controller=require(_0x705f('0x9'));router[_0x705f('0xa')]('/',auth[_0x705f('0xb')](),controller[_0x705f('0xc')]);router['get'](_0x705f('0xd'),auth[_0x705f('0xb')](),controller[_0x705f('0xe')]);router[_0x705f('0xf')]('/',auth[_0x705f('0xb')](),controller['create']);router[_0x705f('0x10')](_0x705f('0xd'),auth[_0x705f('0xb')](),controller[_0x705f('0x11')]);router['delete']('/:id',auth[_0x705f('0xb')](),controller[_0x705f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb7aa=['index','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','get'];(function(_0xd672c1,_0x34681f){var _0x513980=function(_0x20f863){while(--_0x20f863){_0xd672c1['push'](_0xd672c1['shift']());}};_0x513980(++_0x34681f);}(_0xb7aa,0x160));var _0xab7a=function(_0x135fa5,_0x5068d7){_0x135fa5=_0x135fa5-0x0;var _0x40789f=_0xb7aa[_0x135fa5];return _0x40789f;};'use strict';var multer=require(_0xab7a('0x0'));var util=require(_0xab7a('0x1'));var path=require(_0xab7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xab7a('0x3'));var router=express[_0xab7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab7a('0x5'));var interaction=require(_0xab7a('0x6'));var config=require('../../config/environment');var controller=require(_0xab7a('0x7'));router[_0xab7a('0x8')]('/',auth['isAuthenticated'](),controller[_0xab7a('0x9')]);router[_0xab7a('0x8')](_0xab7a('0xa'),auth['isAuthenticated'](),controller[_0xab7a('0xb')]);router[_0xab7a('0xc')]('/',auth[_0xab7a('0xd')](),controller[_0xab7a('0xe')]);router[_0xab7a('0xf')](_0xab7a('0xa'),auth[_0xab7a('0xd')](),controller[_0xab7a('0x10')]);router['delete'](_0xab7a('0xa'),auth[_0xab7a('0xd')](),controller[_0xab7a('0x11')]);module[_0xab7a('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 868361c..a6500cd 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 _0xf58b=['STRING','name','exports'];(function(_0x1f5236,_0xea7afc){var _0x2efe18=function(_0x1457e4){while(--_0x1457e4){_0x1f5236['push'](_0x1f5236['shift']());}};_0x2efe18(++_0xea7afc);}(_0xf58b,0x1d3));var _0xbf58=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0xf58b[_0x233716];return _0x302298;};'use strict';var Sequelize=require('sequelize');module[_0xbf58('0x0')]={'name':{'type':Sequelize[_0xbf58('0x1')],'unique':_0xbf58('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xbf58('0x1')]}}; \ No newline at end of file +var _0xa63a=['STRING','name','sequelize','exports'];(function(_0xee396,_0x496dce){var _0xc95140=function(_0x132807){while(--_0x132807){_0xee396['push'](_0xee396['shift']());}};_0xc95140(++_0x496dce);}(_0xa63a,0x15a));var _0xaa63=function(_0x20a68a,_0x54502e){_0x20a68a=_0x20a68a-0x0;var _0x56c5d4=_0xa63a[_0x20a68a];return _0x56c5d4;};'use strict';var Sequelize=require(_0xaa63('0x0'));module[_0xaa63('0x1')]={'name':{'type':Sequelize[_0xaa63('0x2')],'unique':_0xaa63('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xaa63('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4d6ba22..6c33411 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 _0x1f4b=['UserProfileResource','sendStatus','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','fields','length','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Pauses'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0x1f4b,0x1d1));var _0xb1f4=function(_0x3b1502,_0xa23e9d){_0x3b1502=_0x3b1502-0x0;var _0x1c8537=_0x1f4b[_0x3b1502];return _0x1c8537;};'use strict';var emlformat=require(_0xb1f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1f4('0x1'));var jsonpatch=require(_0xb1f4('0x2'));var rp=require('request-promise');var moment=require(_0xb1f4('0x3'));var BPromise=require(_0xb1f4('0x4'));var Mustache=require(_0xb1f4('0x5'));var util=require(_0xb1f4('0x6'));var path=require(_0xb1f4('0x7'));var sox=require('sox');var csv=require(_0xb1f4('0x8'));var ejs=require(_0xb1f4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1f4('0xa'));var squel=require(_0xb1f4('0xb'));var crypto=require(_0xb1f4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb1f4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb1f4('0xe'));var Papa=require(_0xb1f4('0xf'));var Redis=require(_0xb1f4('0x10'));var authService=require(_0xb1f4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1f4('0x12'));var logger=require(_0xb1f4('0x13'))(_0xb1f4('0x14'));var utils=require(_0xb1f4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb1f4('0x16'));var db=require(_0xb1f4('0x17'))['db'];function respondWithStatusCode(_0x1a9abb,_0x48509e){_0x48509e=_0x48509e||0xcc;return function(_0x1d9c1c){if(_0x1d9c1c){return _0x1a9abb['sendStatus'](_0x48509e);}return _0x1a9abb[_0xb1f4('0x18')](_0x48509e)[_0xb1f4('0x19')]();};}function respondWithResult(_0x120ab0,_0x5445fd){_0x5445fd=_0x5445fd||0xc8;return function(_0x2f2d5f){if(_0x2f2d5f){return _0x120ab0[_0xb1f4('0x18')](_0x5445fd)[_0xb1f4('0x1a')](_0x2f2d5f);}};}function respondWithFilteredResult(_0x1e166b,_0x152e8f){return function(_0x57be2f){if(_0x57be2f){var _0xe7df7c=typeof _0x152e8f[_0xb1f4('0x1b')]===_0xb1f4('0x1c')&&typeof _0x152e8f[_0xb1f4('0x1d')]===_0xb1f4('0x1c');var _0x399925=_0x57be2f[_0xb1f4('0x1e')];var _0x2d69b9=_0xe7df7c?0x0:_0x152e8f['offset'];var _0x53502f=_0xe7df7c?_0x57be2f['count']:_0x152e8f['offset']+_0x152e8f['limit'];var _0x4d9a91;if(_0x53502f>=_0x399925){_0x53502f=_0x399925;_0x4d9a91=0xc8;}else{_0x4d9a91=0xce;}_0x1e166b[_0xb1f4('0x18')](_0x4d9a91);return _0x1e166b['set'](_0xb1f4('0x1f'),_0x2d69b9+'-'+_0x53502f+'/'+_0x399925)[_0xb1f4('0x1a')](_0x57be2f);}return null;};}function patchUpdates(_0x52f86e){return function(_0x3b5d7e){try{jsonpatch[_0xb1f4('0x20')](_0x3b5d7e,_0x52f86e,!![]);}catch(_0x26479e){return BPromise[_0xb1f4('0x21')](_0x26479e);}return _0x3b5d7e[_0xb1f4('0x22')]();};}function saveUpdates(_0x280aa1,_0x208296){return function(_0x278016){if(_0x278016){return _0x278016[_0xb1f4('0x23')](_0x280aa1)[_0xb1f4('0x24')](function(_0x1e811d){return _0x1e811d;});}return null;};}function removeEntity(_0x1c49a5,_0x313933){return function(_0x11b4c5){if(_0x11b4c5){return _0x11b4c5[_0xb1f4('0x25')]()['then'](function(){var _0x12e728=_0x11b4c5['get']({'plain':!![]});var _0x115824=_0xb1f4('0x26');return db[_0xb1f4('0x27')]['destroy']({'where':{'type':_0x115824,'resourceId':_0x12e728['id']}})['then'](function(){return _0x11b4c5;});})[_0xb1f4('0x24')](function(){_0x1c49a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x141810,_0x4d3c53){return function(_0x395133){if(!_0x395133){_0x141810[_0xb1f4('0x28')](0x194);}return _0x395133;};}function handleError(_0x35b0b7,_0x51720d){_0x51720d=_0x51720d||0x1f4;return function(_0x232923){logger[_0xb1f4('0x29')](_0x232923[_0xb1f4('0x2a')]);if(_0x232923[_0xb1f4('0x2b')]){delete _0x232923[_0xb1f4('0x2b')];}_0x35b0b7[_0xb1f4('0x18')](_0x51720d)[_0xb1f4('0x2c')](_0x232923);};}exports['index']=function(_0x3f1710,_0x3383db){var _0x294592={},_0x45662e={},_0x4a8f4b={'count':0x0,'rows':[]};var _0x37c01f=_[_0xb1f4('0x2d')](db[_0xb1f4('0x2e')][_0xb1f4('0x2f')],function(_0x22c07b){return{'name':_0x22c07b[_0xb1f4('0x30')],'type':_0x22c07b[_0xb1f4('0x31')][_0xb1f4('0x32')]};});_0x45662e[_0xb1f4('0x33')]=_[_0xb1f4('0x2d')](_0x37c01f,'name');_0x45662e[_0xb1f4('0x34')]=_['keys'](_0x3f1710[_0xb1f4('0x34')]);_0x45662e[_0xb1f4('0x35')]=_[_0xb1f4('0x36')](_0x45662e[_0xb1f4('0x33')],_0x45662e[_0xb1f4('0x34')]);_0x294592[_0xb1f4('0x37')]=_['intersection'](_0x45662e[_0xb1f4('0x33')],qs['fields'](_0x3f1710[_0xb1f4('0x34')]['fields']));_0x294592[_0xb1f4('0x37')]=_0x294592[_0xb1f4('0x37')]['length']?_0x294592[_0xb1f4('0x37')]:_0x45662e[_0xb1f4('0x33')];if(!_0x3f1710[_0xb1f4('0x34')][_0xb1f4('0x38')](_0xb1f4('0x39'))){_0x294592[_0xb1f4('0x1d')]=qs[_0xb1f4('0x1d')](_0x3f1710[_0xb1f4('0x34')]['limit']);_0x294592['offset']=qs[_0xb1f4('0x1b')](_0x3f1710[_0xb1f4('0x34')][_0xb1f4('0x1b')]);}_0x294592['order']=qs[_0xb1f4('0x3a')](_0x3f1710[_0xb1f4('0x34')][_0xb1f4('0x3a')]);_0x294592[_0xb1f4('0x3b')]=qs[_0xb1f4('0x35')](_[_0xb1f4('0x3c')](_0x3f1710['query'],_0x45662e['filters']),_0x37c01f);if(_0x3f1710['query'][_0xb1f4('0x3d')]){_0x294592[_0xb1f4('0x3b')]=_[_0xb1f4('0x3e')](_0x294592['where'],{'$or':_[_0xb1f4('0x2d')](_0x37c01f,function(_0x410b12){if(_0x410b12[_0xb1f4('0x31')]!==_0xb1f4('0x3f')){var _0x4c1f37={};_0x4c1f37[_0x410b12[_0xb1f4('0x2b')]]={'$like':'%'+_0x3f1710[_0xb1f4('0x34')][_0xb1f4('0x3d')]+'%'};return _0x4c1f37;}})});}_0x294592=_['merge']({},_0x294592,_0x3f1710[_0xb1f4('0x40')]);var _0xb0bb69={'where':_0x294592['where']};return db[_0xb1f4('0x2e')][_0xb1f4('0x1e')](_0xb0bb69)['then'](function(_0x84adc8){_0x4a8f4b[_0xb1f4('0x1e')]=_0x84adc8;if(_0x3f1710['query'][_0xb1f4('0x41')]){_0x294592[_0xb1f4('0x42')]=[{'all':!![]}];}return db[_0xb1f4('0x2e')]['findAll'](_0x294592);})[_0xb1f4('0x24')](function(_0x3f521d){_0x4a8f4b[_0xb1f4('0x43')]=_0x3f521d;return _0x4a8f4b;})[_0xb1f4('0x24')](respondWithFilteredResult(_0x3383db,_0x294592))['catch'](handleError(_0x3383db,null));};exports[_0xb1f4('0x44')]=function(_0x19a991,_0x218c1b){var _0x3420e1={'raw':!![],'where':{'id':_0x19a991[_0xb1f4('0x45')]['id']}},_0x14df15={};_0x14df15[_0xb1f4('0x33')]=_[_0xb1f4('0x46')](db['Pause']['rawAttributes']);_0x14df15['query']=_['keys'](_0x19a991['query']);_0x14df15[_0xb1f4('0x35')]=_['intersection'](_0x14df15['model'],_0x14df15[_0xb1f4('0x34')]);_0x3420e1[_0xb1f4('0x37')]=_['intersection'](_0x14df15[_0xb1f4('0x33')],qs[_0xb1f4('0x47')](_0x19a991[_0xb1f4('0x34')][_0xb1f4('0x47')]));_0x3420e1[_0xb1f4('0x37')]=_0x3420e1[_0xb1f4('0x37')][_0xb1f4('0x48')]?_0x3420e1[_0xb1f4('0x37')]:_0x14df15['model'];if(_0x19a991[_0xb1f4('0x34')]['includeAll']){_0x3420e1[_0xb1f4('0x42')]=[{'all':!![]}];}_0x3420e1=_[_0xb1f4('0x3e')]({},_0x3420e1,_0x19a991[_0xb1f4('0x40')]);return db[_0xb1f4('0x2e')]['find'](_0x3420e1)[_0xb1f4('0x24')](handleEntityNotFound(_0x218c1b,null))['then'](respondWithResult(_0x218c1b,null))[_0xb1f4('0x49')](handleError(_0x218c1b,null));};exports[_0xb1f4('0x4a')]=function(_0x6d8a75,_0x2c1709){return db[_0xb1f4('0x2e')][_0xb1f4('0x4a')](_0x6d8a75[_0xb1f4('0x4b')],{})['then'](function(_0x49c1c5){var _0x297b0c=_0x6d8a75[_0xb1f4('0x4c')][_0xb1f4('0x4d')]({'plain':!![]});if(!_0x297b0c)throw new Error(_0xb1f4('0x4e'));if(_0x297b0c[_0xb1f4('0x4f')]===_0xb1f4('0x4c')){var _0x1be43e=_0x49c1c5['get']({'plain':!![]});var _0x107e1a=_0xb1f4('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x107e1a,'userProfileId':_0x297b0c[_0xb1f4('0x50')]},'raw':!![]})[_0xb1f4('0x24')](function(_0x552ae5){if(_0x552ae5&&_0x552ae5[_0xb1f4('0x51')]===0x0){return db[_0xb1f4('0x27')]['create']({'name':_0x1be43e[_0xb1f4('0x2b')],'resourceId':_0x1be43e['id'],'type':_0x552ae5[_0xb1f4('0x2b')],'sectionId':_0x552ae5['id']},{})['then'](function(){return _0x49c1c5;});}else{return _0x49c1c5;}})['catch'](function(_0x270e16){logger[_0xb1f4('0x29')](_0xb1f4('0x52'),_0x270e16);throw _0x270e16;});}return _0x49c1c5;})[_0xb1f4('0x24')](respondWithResult(_0x2c1709,0xc9))[_0xb1f4('0x49')](handleError(_0x2c1709,null));};exports['update']=function(_0x4df54f,_0x30a0c9){if(_0x4df54f[_0xb1f4('0x4b')]['id']){delete _0x4df54f['body']['id'];}return db[_0xb1f4('0x2e')][_0xb1f4('0x53')]({'where':{'id':_0x4df54f[_0xb1f4('0x45')]['id']}})[_0xb1f4('0x24')](handleEntityNotFound(_0x30a0c9,null))[_0xb1f4('0x24')](saveUpdates(_0x4df54f[_0xb1f4('0x4b')],null))[_0xb1f4('0x24')](respondWithResult(_0x30a0c9,null))[_0xb1f4('0x49')](handleError(_0x30a0c9,null));};exports[_0xb1f4('0x25')]=function(_0x506000,_0x3cb9a3){return db[_0xb1f4('0x2e')]['find']({'where':{'id':_0x506000[_0xb1f4('0x45')]['id']}})[_0xb1f4('0x24')](handleEntityNotFound(_0x3cb9a3,null))['then'](removeEntity(_0x3cb9a3,null))[_0xb1f4('0x49')](handleError(_0x3cb9a3,null));}; \ No newline at end of file +var _0xbc91=['status','json','offset','undefined','limit','count','set','save','update','then','UserProfileResource','error','stack','name','send','map','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Pause','includeAll','include','rows','catch','show','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end'];(function(_0x514b92,_0x116062){var _0x2a20c6=function(_0x3138f5){while(--_0x3138f5){_0x514b92['push'](_0x514b92['shift']());}};_0x2a20c6(++_0x116062);}(_0xbc91,0x83));var _0x1bc9=function(_0x4e70ba,_0x4fc2eb){_0x4e70ba=_0x4e70ba-0x0;var _0x54f81b=_0xbc91[_0x4e70ba];return _0x54f81b;};'use strict';var emlformat=require(_0x1bc9('0x0'));var rimraf=require(_0x1bc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bc9('0x2'));var rp=require(_0x1bc9('0x3'));var moment=require(_0x1bc9('0x4'));var BPromise=require(_0x1bc9('0x5'));var Mustache=require(_0x1bc9('0x6'));var util=require(_0x1bc9('0x7'));var path=require(_0x1bc9('0x8'));var sox=require('sox');var csv=require(_0x1bc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bc9('0xa'));var _=require(_0x1bc9('0xb'));var squel=require(_0x1bc9('0xc'));var crypto=require('crypto');var jsforce=require(_0x1bc9('0xd'));var deskjs=require(_0x1bc9('0xe'));var toCsv=require(_0x1bc9('0x9'));var querystring=require(_0x1bc9('0xf'));var Papa=require(_0x1bc9('0x10'));var Redis=require(_0x1bc9('0x11'));var authService=require(_0x1bc9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bc9('0x13'));var logger=require('../../config/logger')(_0x1bc9('0x14'));var utils=require(_0x1bc9('0x15'));var config=require(_0x1bc9('0x16'));var licenseUtil=require(_0x1bc9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d82f0,_0x532956){_0x532956=_0x532956||0xcc;return function(_0x2c50f3){if(_0x2c50f3){return _0x2d82f0['sendStatus'](_0x532956);}return _0x2d82f0['status'](_0x532956)[_0x1bc9('0x18')]();};}function respondWithResult(_0x26a87f,_0x1a36a9){_0x1a36a9=_0x1a36a9||0xc8;return function(_0x31c57a){if(_0x31c57a){return _0x26a87f[_0x1bc9('0x19')](_0x1a36a9)[_0x1bc9('0x1a')](_0x31c57a);}};}function respondWithFilteredResult(_0xca22aa,_0x30b82c){return function(_0x3bc335){if(_0x3bc335){var _0x235a79=typeof _0x30b82c[_0x1bc9('0x1b')]===_0x1bc9('0x1c')&&typeof _0x30b82c[_0x1bc9('0x1d')]===_0x1bc9('0x1c');var _0x53423f=_0x3bc335[_0x1bc9('0x1e')];var _0x202cf6=_0x235a79?0x0:_0x30b82c[_0x1bc9('0x1b')];var _0x163278=_0x235a79?_0x3bc335[_0x1bc9('0x1e')]:_0x30b82c[_0x1bc9('0x1b')]+_0x30b82c['limit'];var _0x492c68;if(_0x163278>=_0x53423f){_0x163278=_0x53423f;_0x492c68=0xc8;}else{_0x492c68=0xce;}_0xca22aa[_0x1bc9('0x19')](_0x492c68);return _0xca22aa[_0x1bc9('0x1f')]('Content-Range',_0x202cf6+'-'+_0x163278+'/'+_0x53423f)[_0x1bc9('0x1a')](_0x3bc335);}return null;};}function patchUpdates(_0xae1889){return function(_0x3af120){try{jsonpatch['apply'](_0x3af120,_0xae1889,!![]);}catch(_0x3a2c81){return BPromise['reject'](_0x3a2c81);}return _0x3af120[_0x1bc9('0x20')]();};}function saveUpdates(_0x5649ca,_0x1017cd){return function(_0x21c61a){if(_0x21c61a){return _0x21c61a[_0x1bc9('0x21')](_0x5649ca)[_0x1bc9('0x22')](function(_0x12bfba){return _0x12bfba;});}return null;};}function removeEntity(_0x442cd8,_0x2dcc3b){return function(_0x2b9d0b){if(_0x2b9d0b){return _0x2b9d0b['destroy']()[_0x1bc9('0x22')](function(){var _0x55c32c=_0x2b9d0b['get']({'plain':!![]});var _0x53a1eb='Pauses';return db[_0x1bc9('0x23')]['destroy']({'where':{'type':_0x53a1eb,'resourceId':_0x55c32c['id']}})[_0x1bc9('0x22')](function(){return _0x2b9d0b;});})[_0x1bc9('0x22')](function(){_0x442cd8[_0x1bc9('0x19')](0xcc)[_0x1bc9('0x18')]();});}};}function handleEntityNotFound(_0x51a6c5,_0x5e3064){return function(_0x13cdfc){if(!_0x13cdfc){_0x51a6c5['sendStatus'](0x194);}return _0x13cdfc;};}function handleError(_0x2c7e40,_0x17a144){_0x17a144=_0x17a144||0x1f4;return function(_0x5ae807){logger[_0x1bc9('0x24')](_0x5ae807[_0x1bc9('0x25')]);if(_0x5ae807[_0x1bc9('0x26')]){delete _0x5ae807[_0x1bc9('0x26')];}_0x2c7e40[_0x1bc9('0x19')](_0x17a144)[_0x1bc9('0x27')](_0x5ae807);};}exports['index']=function(_0x27e7c0,_0x556188){var _0x526391={},_0x2c2fad={},_0x3692a6={'count':0x0,'rows':[]};var _0x416cbc=_[_0x1bc9('0x28')](db['Pause']['rawAttributes'],function(_0x28e3f8){return{'name':_0x28e3f8['fieldName'],'type':_0x28e3f8[_0x1bc9('0x29')]['key']};});_0x2c2fad['model']=_[_0x1bc9('0x28')](_0x416cbc,_0x1bc9('0x26'));_0x2c2fad[_0x1bc9('0x2a')]=_[_0x1bc9('0x2b')](_0x27e7c0[_0x1bc9('0x2a')]);_0x2c2fad[_0x1bc9('0x2c')]=_[_0x1bc9('0x2d')](_0x2c2fad[_0x1bc9('0x2e')],_0x2c2fad[_0x1bc9('0x2a')]);_0x526391[_0x1bc9('0x2f')]=_[_0x1bc9('0x2d')](_0x2c2fad['model'],qs[_0x1bc9('0x30')](_0x27e7c0[_0x1bc9('0x2a')][_0x1bc9('0x30')]));_0x526391[_0x1bc9('0x2f')]=_0x526391[_0x1bc9('0x2f')][_0x1bc9('0x31')]?_0x526391['attributes']:_0x2c2fad[_0x1bc9('0x2e')];if(!_0x27e7c0[_0x1bc9('0x2a')][_0x1bc9('0x32')](_0x1bc9('0x33'))){_0x526391[_0x1bc9('0x1d')]=qs['limit'](_0x27e7c0[_0x1bc9('0x2a')]['limit']);_0x526391['offset']=qs['offset'](_0x27e7c0[_0x1bc9('0x2a')]['offset']);}_0x526391[_0x1bc9('0x34')]=qs[_0x1bc9('0x35')](_0x27e7c0[_0x1bc9('0x2a')]['sort']);_0x526391[_0x1bc9('0x36')]=qs['filters'](_[_0x1bc9('0x37')](_0x27e7c0[_0x1bc9('0x2a')],_0x2c2fad[_0x1bc9('0x2c')]),_0x416cbc);if(_0x27e7c0[_0x1bc9('0x2a')][_0x1bc9('0x38')]){_0x526391[_0x1bc9('0x36')]=_[_0x1bc9('0x39')](_0x526391['where'],{'$or':_['map'](_0x416cbc,function(_0x121c5b){if(_0x121c5b['type']!=='VIRTUAL'){var _0x2921ce={};_0x2921ce[_0x121c5b[_0x1bc9('0x26')]]={'$like':'%'+_0x27e7c0[_0x1bc9('0x2a')][_0x1bc9('0x38')]+'%'};return _0x2921ce;}})});}_0x526391=_[_0x1bc9('0x39')]({},_0x526391,_0x27e7c0[_0x1bc9('0x3a')]);var _0x118b9e={'where':_0x526391[_0x1bc9('0x36')]};return db[_0x1bc9('0x3b')][_0x1bc9('0x1e')](_0x118b9e)[_0x1bc9('0x22')](function(_0x133c62){_0x3692a6[_0x1bc9('0x1e')]=_0x133c62;if(_0x27e7c0[_0x1bc9('0x2a')][_0x1bc9('0x3c')]){_0x526391[_0x1bc9('0x3d')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x526391);})[_0x1bc9('0x22')](function(_0x4816bd){_0x3692a6[_0x1bc9('0x3e')]=_0x4816bd;return _0x3692a6;})[_0x1bc9('0x22')](respondWithFilteredResult(_0x556188,_0x526391))[_0x1bc9('0x3f')](handleError(_0x556188,null));};exports[_0x1bc9('0x40')]=function(_0x53f50a,_0x5772a5){var _0x21b938={'raw':!![],'where':{'id':_0x53f50a['params']['id']}},_0x56f437={};_0x56f437[_0x1bc9('0x2e')]=_[_0x1bc9('0x2b')](db[_0x1bc9('0x3b')][_0x1bc9('0x41')]);_0x56f437[_0x1bc9('0x2a')]=_[_0x1bc9('0x2b')](_0x53f50a[_0x1bc9('0x2a')]);_0x56f437[_0x1bc9('0x2c')]=_[_0x1bc9('0x2d')](_0x56f437['model'],_0x56f437['query']);_0x21b938['attributes']=_['intersection'](_0x56f437['model'],qs[_0x1bc9('0x30')](_0x53f50a[_0x1bc9('0x2a')][_0x1bc9('0x30')]));_0x21b938[_0x1bc9('0x2f')]=_0x21b938[_0x1bc9('0x2f')][_0x1bc9('0x31')]?_0x21b938[_0x1bc9('0x2f')]:_0x56f437[_0x1bc9('0x2e')];if(_0x53f50a['query'][_0x1bc9('0x3c')]){_0x21b938['include']=[{'all':!![]}];}_0x21b938=_[_0x1bc9('0x39')]({},_0x21b938,_0x53f50a['options']);return db['Pause'][_0x1bc9('0x42')](_0x21b938)[_0x1bc9('0x22')](handleEntityNotFound(_0x5772a5,null))[_0x1bc9('0x22')](respondWithResult(_0x5772a5,null))[_0x1bc9('0x3f')](handleError(_0x5772a5,null));};exports[_0x1bc9('0x43')]=function(_0x3418fe,_0x20ec17){return db[_0x1bc9('0x3b')][_0x1bc9('0x43')](_0x3418fe['body'],{})['then'](function(_0x3295fe){var _0x405b66=_0x3418fe['user'][_0x1bc9('0x44')]({'plain':!![]});if(!_0x405b66)throw new Error(_0x1bc9('0x45'));if(_0x405b66[_0x1bc9('0x46')]==='user'){var _0x29fe59=_0x3295fe[_0x1bc9('0x44')]({'plain':!![]});var _0x534c33='Pauses';return db[_0x1bc9('0x47')]['find']({'where':{'name':_0x534c33,'userProfileId':_0x405b66[_0x1bc9('0x48')]},'raw':!![]})[_0x1bc9('0x22')](function(_0x535b78){if(_0x535b78&&_0x535b78[_0x1bc9('0x49')]===0x0){return db['UserProfileResource'][_0x1bc9('0x43')]({'name':_0x29fe59[_0x1bc9('0x26')],'resourceId':_0x29fe59['id'],'type':_0x535b78[_0x1bc9('0x26')],'sectionId':_0x535b78['id']},{})[_0x1bc9('0x22')](function(){return _0x3295fe;});}else{return _0x3295fe;}})[_0x1bc9('0x3f')](function(_0x3a97fa){logger[_0x1bc9('0x24')](_0x1bc9('0x4a'),_0x3a97fa);throw _0x3a97fa;});}return _0x3295fe;})['then'](respondWithResult(_0x20ec17,0xc9))['catch'](handleError(_0x20ec17,null));};exports[_0x1bc9('0x21')]=function(_0x50917c,_0x5d0d44){if(_0x50917c['body']['id']){delete _0x50917c[_0x1bc9('0x4b')]['id'];}return db[_0x1bc9('0x3b')][_0x1bc9('0x42')]({'where':{'id':_0x50917c['params']['id']}})[_0x1bc9('0x22')](handleEntityNotFound(_0x5d0d44,null))['then'](saveUpdates(_0x50917c[_0x1bc9('0x4b')],null))[_0x1bc9('0x22')](respondWithResult(_0x5d0d44,null))[_0x1bc9('0x3f')](handleError(_0x5d0d44,null));};exports[_0x1bc9('0x4c')]=function(_0x4448c2,_0x47540c){return db['Pause'][_0x1bc9('0x42')]({'where':{'id':_0x4448c2[_0x1bc9('0x4d')]['id']}})[_0x1bc9('0x22')](handleEntityNotFound(_0x47540c,null))[_0x1bc9('0x22')](removeEntity(_0x47540c,null))['catch'](handleError(_0x47540c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 78dc3a6..69ec2e1 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 _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x5f24b2,_0x3b3859){var _0x44fb70=function(_0x26525d){while(--_0x26525d){_0x5f24b2['push'](_0x5f24b2['shift']());}};_0x44fb70(++_0x3b3859);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x5fc3[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x33b6a7,_0x51dcc6){var _0x1f3b80=function(_0xeedc7){while(--_0xeedc7){_0x33b6a7['push'](_0x33b6a7['shift']());}};_0x1f3b80(++_0x51dcc6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3415b6,_0x5c2db9){_0x3415b6=_0x3415b6-0x0;var _0x49cfb3=_0x1cb9[_0x3415b6];return _0x49cfb3;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index ee1ccaa..8c94479 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x32a104,_0x540edc){var _0x2fdb2d=function(_0x591026){while(--_0x591026){_0x32a104['push'](_0x32a104['shift']());}};_0x2fdb2d(++_0x540edc);}(_0x7a54,0x106));var _0x47a5=function(_0x3fcf6b,_0x5de186){_0x3fcf6b=_0x3fcf6b-0x0;var _0x3ebc77=_0x7a54[_0x3fcf6b];return _0x3ebc77;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1b4181,_0xf0bc0e){var _0x19e909=function(_0x20cbe4){while(--_0x20cbe4){_0x1b4181['push'](_0x1b4181['shift']());}};_0x19e909(++_0xf0bc0e);}(_0x7a54,0x106));var _0x47a5=function(_0x1a234c,_0x1100c7){_0x1a234c=_0x1a234c-0x0;var _0x1567e5=_0x7a54[_0x1a234c];return _0x1567e5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8ed6888..9d0c1e4 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 _0x68fc=['webhookPost','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','upload','/webhook'];(function(_0x534077,_0x58ed46){var _0x5b007e=function(_0x575224){while(--_0x575224){_0x534077['push'](_0x534077['shift']());}};_0x5b007e(++_0x58ed46);}(_0x68fc,0xa5));var _0xc68f=function(_0xb46b93,_0x1f6a57){_0xb46b93=_0xb46b93-0x0;var _0x312adb=_0x68fc[_0xb46b93];return _0x312adb;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc68f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc68f('0x5'));router[_0xc68f('0x6')]('/',auth[_0xc68f('0x7')](),controller[_0xc68f('0x8')]);router['get']('/webhook',controller[_0xc68f('0x9')]);router[_0xc68f('0x6')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xb')]);router[_0xc68f('0x6')](_0xc68f('0xc'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xd')]);var upload=multer({'storage':multer[_0xc68f('0xe')]({'destination':function(_0x5777f9,_0x3b1a43,_0x29f1fe){_0x29f1fe(null,path[_0xc68f('0xf')](config[_0xc68f('0x10')],_0xc68f('0x11')));},'filename':function(_0x2a0a52,_0x3ccebe,_0x41aeb8){_0x3ccebe[_0xc68f('0x12')]=_0x3ccebe[_0xc68f('0x12')][_0xc68f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41aeb8(null,util['format'](_0xc68f('0x14'),path[_0xc68f('0x15')](_0x3ccebe[_0xc68f('0x12')],path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])),Date[_0xc68f('0x17')](),path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])));}})});router[_0xc68f('0x18')]('/',upload['single']('file'),controller[_0xc68f('0x19')]);router[_0xc68f('0x18')](_0xc68f('0x1a'),controller[_0xc68f('0x1b')]);router[_0xc68f('0x1c')](_0xc68f('0xa'),auth['isAuthenticated'](),controller[_0xc68f('0x1d')]);router[_0xc68f('0x1e')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0x1e')]);module[_0xc68f('0x1f')]=router; \ No newline at end of file +var _0xfd28=['webhookPost','put','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/:id','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','/webhook'];(function(_0xc79a88,_0x30eb1c){var _0x1cb9ef=function(_0xb48fc0){while(--_0xb48fc0){_0xc79a88['push'](_0xc79a88['shift']());}};_0x1cb9ef(++_0x30eb1c);}(_0xfd28,0x148));var _0x8fd2=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0xfd28[_0xc40b9f];return _0x535b9c;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/webhook',controller['webhookGet']);router[_0x8fd2('0x7')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['show']);router[_0x8fd2('0x7')]('/:id/download',auth[_0x8fd2('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x8fd2('0xb')]({'destination':function(_0x4fdf0b,_0x1ca2a1,_0x5244ed){_0x5244ed(null,path[_0x8fd2('0xc')](config['root'],_0x8fd2('0xd')));},'filename':function(_0x207298,_0xfd78d,_0xa6d7ca){_0xfd78d[_0x8fd2('0xe')]=_0xfd78d[_0x8fd2('0xe')][_0x8fd2('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa6d7ca(null,util[_0x8fd2('0x10')](_0x8fd2('0x11'),path[_0x8fd2('0x12')](_0xfd78d[_0x8fd2('0xe')],path[_0x8fd2('0x13')](_0xfd78d[_0x8fd2('0xe')])),Date[_0x8fd2('0x14')](),path[_0x8fd2('0x13')](_0xfd78d['originalname'])));}})});router[_0x8fd2('0x15')]('/',upload['single']('file'),controller['upload']);router[_0x8fd2('0x15')](_0x8fd2('0x16'),controller[_0x8fd2('0x17')]);router[_0x8fd2('0x18')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x19')]);router[_0x8fd2('0x1a')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1dd5976..2ec654c 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 _0xc01b=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','BOOLEAN'];(function(_0x2eeb7d,_0x24e606){var _0x241fc2=function(_0xa600be){while(--_0xa600be){_0x2eeb7d['push'](_0x2eeb7d['shift']());}};_0x241fc2(++_0x24e606);}(_0xc01b,0x65));var _0xbc01=function(_0x5806a1,_0x4b247d){_0x5806a1=_0x5806a1-0x0;var _0x2d271e=_0xc01b[_0x5806a1];return _0x2d271e;};'use strict';var Sequelize=require(_0xbc01('0x0'));module[_0xbc01('0x1')]={'name':{'type':Sequelize[_0xbc01('0x2')]},'type':{'type':Sequelize[_0xbc01('0x3')]('html',_0xbc01('0x4'))},'description':{'type':Sequelize[_0xbc01('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xbc01('0x6')],'defaultValue':0x0,'comment':_0xbc01('0x7')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xbc01('0x8'),_0xbc01('0x9'),_0xbc01('0xa')),'defaultValue':_0xbc01('0x9'),'comment':_0xbc01('0xb')},'icon':{'type':Sequelize[_0xbc01('0x2')]},'adminUrl':{'type':Sequelize[_0xbc01('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xbc01('0x2')]},'scriptPath':{'type':Sequelize[_0xbc01('0x2')]}}; \ No newline at end of file +var _0x55c5=['agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','BOOLEAN'];(function(_0x2ec4eb,_0x2c3820){var _0xc3e74b=function(_0x620399){while(--_0x620399){_0x2ec4eb['push'](_0x2ec4eb['shift']());}};_0xc3e74b(++_0x2c3820);}(_0x55c5,0x190));var _0x555c=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x55c5[_0x49bdc4];return _0x1f7437;};'use strict';var Sequelize=require(_0x555c('0x0'));module[_0x555c('0x1')]={'name':{'type':Sequelize[_0x555c('0x2')]},'type':{'type':Sequelize[_0x555c('0x3')](_0x555c('0x4'),_0x555c('0x5'))},'description':{'type':Sequelize[_0x555c('0x6')]},'version':{'type':Sequelize[_0x555c('0x6')]},'path':{'type':Sequelize[_0x555c('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x555c('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x555c('0x3')]('adminOnly',_0x555c('0x8'),'always',_0x555c('0x9')),'defaultValue':_0x555c('0xa'),'comment':_0x555c('0xb')},'icon':{'type':Sequelize[_0x555c('0x2')]},'adminUrl':{'type':Sequelize[_0x555c('0x2')]},'agentUrl':{'type':Sequelize[_0x555c('0x2')]},'scriptName':{'type':Sequelize[_0x555c('0x2')]},'scriptPath':{'type':Sequelize[_0x555c('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 4666e17..84ecbe9 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 _0xfc0f=['script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','headers','content-length','content-type','set','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','update','then','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','download','join','root','format','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','attachments/**/*','finalize','existsSync','%s.zip','unlinkSync','info','Temporary\x20file\x20removed','upload','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified'];(function(_0x422d8f,_0xb108b2){var _0xb532ac=function(_0x255b42){while(--_0x255b42){_0x422d8f['push'](_0x422d8f['shift']());}};_0xb532ac(++_0xb108b2);}(_0xfc0f,0x176));var _0xffc0=function(_0x477d3e,_0x25003b){_0x477d3e=_0x477d3e-0x0;var _0x4addc1=_0xfc0f[_0x477d3e];return _0x4addc1;};'use strict';var emlformat=require(_0xffc0('0x0'));var rimraf=require(_0xffc0('0x1'));var zipdir=require(_0xffc0('0x2'));var jsonpatch=require(_0xffc0('0x3'));var rp=require(_0xffc0('0x4'));var moment=require(_0xffc0('0x5'));var BPromise=require(_0xffc0('0x6'));var Mustache=require('mustache');var util=require(_0xffc0('0x7'));var path=require(_0xffc0('0x8'));var sox=require(_0xffc0('0x9'));var csv=require(_0xffc0('0xa'));var ejs=require(_0xffc0('0xb'));var fs=require('fs');var fs_extra=require(_0xffc0('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xffc0('0xd'));var jsforce=require(_0xffc0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xffc0('0xa'));var querystring=require(_0xffc0('0xf'));var Papa=require(_0xffc0('0x10'));var extract=require(_0xffc0('0x11'));var rimraf=require('rimraf');var archiver=require(_0xffc0('0x12'));var Redis=require(_0xffc0('0x13'));var authService=require(_0xffc0('0x14'));var qs=require(_0xffc0('0x15'));var as=require(_0xffc0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffc0('0x17'))(_0xffc0('0x18'));var utils=require(_0xffc0('0x19'));var config=require(_0xffc0('0x1a'));var licenseUtil=require(_0xffc0('0x1b'));var db=require('../../mysqldb')['db'];config[_0xffc0('0x1c')]=_[_0xffc0('0x1d')](config[_0xffc0('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffc0('0x1c')]));require(_0xffc0('0x1e'))['register'](socket);function respondWithStatusCode(_0x112ec5,_0x408c57){_0x408c57=_0x408c57||0xcc;return function(_0x1ee6ca){if(_0x1ee6ca){return _0x112ec5[_0xffc0('0x1f')](_0x408c57);}return _0x112ec5['status'](_0x408c57)[_0xffc0('0x20')]();};}function respondWithResult(_0x2fb0c7,_0x3f22cd){_0x3f22cd=_0x3f22cd||0xc8;return function(_0x4ccd81){if(_0x4ccd81){return _0x2fb0c7[_0xffc0('0x21')](_0x3f22cd)[_0xffc0('0x22')](_0x4ccd81);}};}function respondWithFilteredResult(_0x1a9d5a,_0x188a83){return function(_0x51ac32){if(_0x51ac32){var _0x2d9838=typeof _0x188a83[_0xffc0('0x23')]===_0xffc0('0x24')&&typeof _0x188a83[_0xffc0('0x25')]===_0xffc0('0x24');var _0x1ebe39=_0x51ac32['count'];var _0x33fcbe=_0x2d9838?0x0:_0x188a83[_0xffc0('0x23')];var _0x58fac2=_0x2d9838?_0x51ac32[_0xffc0('0x26')]:_0x188a83['offset']+_0x188a83[_0xffc0('0x25')];var _0x16ea44;if(_0x58fac2>=_0x1ebe39){_0x58fac2=_0x1ebe39;_0x16ea44=0xc8;}else{_0x16ea44=0xce;}_0x1a9d5a[_0xffc0('0x21')](_0x16ea44);return _0x1a9d5a['set']('Content-Range',_0x33fcbe+'-'+_0x58fac2+'/'+_0x1ebe39)[_0xffc0('0x22')](_0x51ac32);}return null;};}function patchUpdates(_0x1085e8){return function(_0x20f3a2){try{jsonpatch[_0xffc0('0x27')](_0x20f3a2,_0x1085e8,!![]);}catch(_0x1bf6c5){return BPromise[_0xffc0('0x28')](_0x1bf6c5);}return _0x20f3a2['save']();};}function saveUpdates(_0x25ac79,_0x446af9){return function(_0x3c3b70){if(_0x3c3b70){return _0x3c3b70[_0xffc0('0x29')](_0x25ac79)[_0xffc0('0x2a')](function(_0x26d9ce){return _0x26d9ce;});}return null;};}function removeEntity(_0x3d052d,_0x5654da){return function(_0x12e425){if(_0x12e425){return _0x12e425['destroy']()[_0xffc0('0x2a')](function(){var _0x5d4feb=_0x12e425[_0xffc0('0x2b')]({'plain':!![]});var _0x3148eb=_0xffc0('0x2c');return db[_0xffc0('0x2d')]['destroy']({'where':{'type':_0x3148eb,'resourceId':_0x5d4feb['id']}})[_0xffc0('0x2a')](function(){return _0x12e425;});})[_0xffc0('0x2a')](function(){_0x3d052d[_0xffc0('0x21')](0xcc)[_0xffc0('0x20')]();});}};}function handleEntityNotFound(_0x42cace,_0x21c37c){return function(_0x3b4172){if(!_0x3b4172){_0x42cace[_0xffc0('0x1f')](0x194);}return _0x3b4172;};}function handleError(_0x14ebd1,_0x595f7c){_0x595f7c=_0x595f7c||0x1f4;return function(_0xb8e8d3){logger[_0xffc0('0x2e')](_0xb8e8d3[_0xffc0('0x2f')]);if(_0xb8e8d3[_0xffc0('0x30')]){delete _0xb8e8d3['name'];}_0x14ebd1['status'](_0x595f7c)[_0xffc0('0x31')](_0xb8e8d3);};}exports[_0xffc0('0x32')]=function(_0xfc7baa,_0x31fb9f){var _0x16a729={},_0x437b00={},_0x400bed={'count':0x0,'rows':[]};var _0x20392b=_[_0xffc0('0x33')](db[_0xffc0('0x34')][_0xffc0('0x35')],function(_0x38bd1b){return{'name':_0x38bd1b[_0xffc0('0x36')],'type':_0x38bd1b[_0xffc0('0x37')][_0xffc0('0x38')]};});_0x437b00[_0xffc0('0x39')]=_[_0xffc0('0x33')](_0x20392b,'name');_0x437b00[_0xffc0('0x3a')]=_[_0xffc0('0x3b')](_0xfc7baa[_0xffc0('0x3a')]);_0x437b00[_0xffc0('0x3c')]=_[_0xffc0('0x3d')](_0x437b00[_0xffc0('0x39')],_0x437b00[_0xffc0('0x3a')]);_0x16a729[_0xffc0('0x3e')]=_[_0xffc0('0x3d')](_0x437b00[_0xffc0('0x39')],qs[_0xffc0('0x3f')](_0xfc7baa['query'][_0xffc0('0x3f')]));_0x16a729['attributes']=_0x16a729[_0xffc0('0x3e')]['length']?_0x16a729[_0xffc0('0x3e')]:_0x437b00[_0xffc0('0x39')];if(!_0xfc7baa['query'][_0xffc0('0x40')](_0xffc0('0x41'))){_0x16a729[_0xffc0('0x25')]=qs[_0xffc0('0x25')](_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x25')]);_0x16a729[_0xffc0('0x23')]=qs[_0xffc0('0x23')](_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x23')]);}_0x16a729[_0xffc0('0x42')]=qs[_0xffc0('0x43')](_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x43')]);_0x16a729[_0xffc0('0x44')]=qs[_0xffc0('0x3c')](_[_0xffc0('0x45')](_0xfc7baa['query'],_0x437b00[_0xffc0('0x3c')]),_0x20392b);if(_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x46')]){_0x16a729['where']=_[_0xffc0('0x47')](_0x16a729[_0xffc0('0x44')],{'$or':_['map'](_0x20392b,function(_0x2a71ed){if(_0x2a71ed['type']!==_0xffc0('0x48')){var _0xfc08a0={};_0xfc08a0[_0x2a71ed[_0xffc0('0x30')]]={'$like':'%'+_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x46')]+'%'};return _0xfc08a0;}})});}_0x16a729=_[_0xffc0('0x47')]({},_0x16a729,_0xfc7baa[_0xffc0('0x49')]);var _0x440013={'where':_0x16a729[_0xffc0('0x44')]};return db[_0xffc0('0x34')]['count'](_0x440013)[_0xffc0('0x2a')](function(_0x5d20f5){_0x400bed[_0xffc0('0x26')]=_0x5d20f5;if(_0xfc7baa[_0xffc0('0x3a')][_0xffc0('0x4a')]){_0x16a729[_0xffc0('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0xffc0('0x4c')](_0x16a729);})['then'](function(_0x227826){_0x400bed[_0xffc0('0x4d')]=_0x227826;return _0x400bed;})[_0xffc0('0x2a')](respondWithFilteredResult(_0x31fb9f,_0x16a729))['catch'](handleError(_0x31fb9f,null));};exports[_0xffc0('0x4e')]=function(_0x11f57f,_0x3c3117){var _0x5d40dc={'raw':!![],'where':{'id':_0x11f57f[_0xffc0('0x4f')]['id']}},_0x2e149f={};_0x2e149f['model']=_[_0xffc0('0x3b')](db[_0xffc0('0x34')][_0xffc0('0x35')]);_0x2e149f[_0xffc0('0x3a')]=_[_0xffc0('0x3b')](_0x11f57f[_0xffc0('0x3a')]);_0x2e149f[_0xffc0('0x3c')]=_[_0xffc0('0x3d')](_0x2e149f['model'],_0x2e149f['query']);_0x5d40dc['attributes']=_[_0xffc0('0x3d')](_0x2e149f['model'],qs[_0xffc0('0x3f')](_0x11f57f[_0xffc0('0x3a')]['fields']));_0x5d40dc[_0xffc0('0x3e')]=_0x5d40dc[_0xffc0('0x3e')]['length']?_0x5d40dc['attributes']:_0x2e149f[_0xffc0('0x39')];if(_0x11f57f[_0xffc0('0x3a')][_0xffc0('0x4a')]){_0x5d40dc[_0xffc0('0x4b')]=[{'all':!![]}];}_0x5d40dc=_['merge']({},_0x5d40dc,_0x11f57f[_0xffc0('0x49')]);return db[_0xffc0('0x34')][_0xffc0('0x50')](_0x5d40dc)[_0xffc0('0x2a')](handleEntityNotFound(_0x3c3117,null))[_0xffc0('0x2a')](respondWithResult(_0x3c3117,null))[_0xffc0('0x51')](handleError(_0x3c3117,null));};exports[_0xffc0('0x52')]=function(_0x4a656e,_0x45d3c5,_0x4153f3){return db[_0xffc0('0x34')]['find']({'where':{'id':_0x4a656e['params']['id']},'attributes':['name',_0xffc0('0x8')],'raw':!![]})[_0xffc0('0x2a')](handleEntityNotFound(_0x45d3c5,null))['then'](function(_0x491903){if(_0x491903){var _0x3ba9b8=path[_0xffc0('0x53')](config[_0xffc0('0x54')],'server/files/plugins',util[_0xffc0('0x55')]('%s.zip',path[_0xffc0('0x56')](_0x491903[_0xffc0('0x8')])));var _0xaae5cd=fs['createWriteStream'](_0x3ba9b8);var _0x1946a3=archiver(_0xffc0('0x57'),{'zlib':{'level':0x9}});_0x1946a3['on'](_0xffc0('0x58'),function(_0x441e23){if(_0x441e23['code']===_0xffc0('0x59')){logger['error'](_0x441e23);}else{throw new db[(_0xffc0('0x5a'))][(_0xffc0('0x5b'))](_0xffc0('0x5c'));}});_0x1946a3['on']('error',function(_0xa64105){throw new db[(_0xffc0('0x5a'))][(_0xffc0('0x5b'))](_0xffc0('0x5c'));});_0x1946a3[_0xffc0('0x5d')](_0xaae5cd);_0x1946a3[_0xffc0('0x5e')]('**/*',{'cwd':path[_0xffc0('0x53')](config[_0xffc0('0x54')],'server/files/plugins',path[_0xffc0('0x5f')](_0x491903[_0xffc0('0x8')])),'ignore':[path[_0xffc0('0x53')](path[_0xffc0('0x56')](_0x491903[_0xffc0('0x8')]),'node_modules/**/*'),path[_0xffc0('0x53')](path[_0xffc0('0x56')](_0x491903[_0xffc0('0x8')]),_0xffc0('0x60'))],'nodir':!![]})[_0xffc0('0x61')]();_0xaae5cd['on']('close',function(){if(!fs[_0xffc0('0x62')](_0x3ba9b8)){throw new db[(_0xffc0('0x5a'))]['Error']('Plugin\x20not\x20found');}return _0x45d3c5['download'](_0x3ba9b8,util[_0xffc0('0x55')](_0xffc0('0x63'),path['basename'](_0x491903[_0xffc0('0x8')])),function(_0x4c2e57){if(_0x4c2e57){throw new db['Sequelize'][(_0xffc0('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xffc0('0x64')](_0x3ba9b8);logger[_0xffc0('0x65')]('Download\x20completed');logger[_0xffc0('0x65')](_0xffc0('0x66'));});});}return null;})[_0xffc0('0x51')](handleError(_0x45d3c5,null));};exports[_0xffc0('0x67')]=function(_0x582466,_0x5bb7cb,_0x5792b6){var _0x22feca=path[_0xffc0('0x56')](_0x582466['file'][_0xffc0('0x68')],path[_0xffc0('0x69')](_0x582466['file'][_0xffc0('0x68')]));var _0x11e002=path['join'](config['root'],_0xffc0('0x6a'),_0x582466['file']['filename']);var _0xae1453=path['join'](config[_0xffc0('0x54')],_0xffc0('0x6a'),_0x22feca);logger['info'](_0xffc0('0x6b'),_0x11e002);logger[_0xffc0('0x65')](_0xffc0('0x6c'),_0xae1453);try{fs[_0xffc0('0x6d')](_0x11e002,parseInt('0777',0x8));extract(_0x11e002,{'dir':_0xae1453},function(_0x308e4d){if(_0x308e4d){logger[_0xffc0('0x2e')](_0x308e4d);handleError(_0x308e4d,!![]);};var _0x15d3e5=fs[_0xffc0('0x6e')](_0xae1453);if(_0x15d3e5[_0xffc0('0x6f')]>0x1){removeReferences(_0x11e002,_0xae1453);logger[_0xffc0('0x2e')]('Invalid\x20plugin\x20structure');return _0x5792b6(new Error(_0xffc0('0x70')));}var _0x3022a3=fs[_0xffc0('0x71')](path[_0xffc0('0x53')](_0xae1453,_0x15d3e5[0x0]));if(_0x3022a3[_0xffc0('0x72')]()){removeReferences(_0x11e002,_0xae1453);logger['error']('Invalid\x20plugin\x20structure');return _0x5792b6(new Error('Invalid\x20plugin\x20structure'));}if(_0x3022a3['isDirectory']()){var _0x1ce577=fs['readdirSync'](path['join'](_0xae1453,_0x15d3e5[0x0]));if(_0x1ce577[_0xffc0('0x6f')]===0x0){removeReferences(_0x11e002,_0xae1453);logger[_0xffc0('0x2e')](_0xffc0('0x70'));return _0x5792b6(new Error('Invalid\x20plugin\x20structure'));}var _0x1c3b77=_0x1ce577['some'](function(_0x4e049d){return _0x4e049d===_0xffc0('0x73');});if(!_0x1c3b77){return _0x5792b6(new Error(_0xffc0('0x74')));}var _0x1d61ac=fs[_0xffc0('0x75')](path[_0xffc0('0x53')](_0xae1453,_0x15d3e5[0x0],_0xffc0('0x73')));var _0x5c39ff=JSON['parse'](_0x1d61ac);if(_0xffc0('0x24')==typeof _0x5c39ff[_0xffc0('0x30')]){return _0x5792b6(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xffc0('0x24')==typeof _0x5c39ff[_0xffc0('0x37')]){return _0x5792b6(new Error(_0xffc0('0x76')));}if('undefined'==typeof _0x5c39ff['version']){return _0x5792b6(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x5c39ff[_0xffc0('0x77')]){return _0x5792b6(new Error(_0xffc0('0x78')));}if(_0x5c39ff[_0xffc0('0x37')]===_0xffc0('0x79')){if(_0xffc0('0x24')==typeof _0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')]){return _0x5792b6(new Error(_0xffc0('0x7b')));}if(_0xffc0('0x24')==typeof _0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')][_0xffc0('0x7c')]&&_0xffc0('0x24')==typeof _0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')][_0xffc0('0x7d')]){return _0x5792b6(new Error(_0xffc0('0x7e')));}}else if(_0x5c39ff[_0xffc0('0x37')]===_0xffc0('0x7f')){if('undefined'==typeof _0x5c39ff[_0xffc0('0x77')][_0xffc0('0x80')]){return _0x5792b6(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xffc0('0x24')==typeof _0x5c39ff['parameters'][_0xffc0('0x81')]){return _0x5792b6(new Error(_0xffc0('0x82')));}}else{return _0x5792b6(new Error(_0xffc0('0x83')));}var _0x3ec19a=_0x5c39ff['name'];var _0x42738d=_0x5c39ff[_0xffc0('0x84')];var _0x952ace=_0x5c39ff[_0xffc0('0x37')];var _0x54bf0e=_0x5c39ff[_0xffc0('0x85')]?_0x5c39ff[_0xffc0('0x85')]:_0xffc0('0x86');var _0x339fcf=_0x5c39ff[_0xffc0('0x87')]?_0x5c39ff[_0xffc0('0x87')]:_0xffc0('0x88');var _0x186f18='';var _0x227e86='';var _0x53bc56='';var _0x571d01='';var _0x511dd1=_0x5c39ff['version'];if(_0x952ace===_0xffc0('0x79')){if(_0xffc0('0x24')!=typeof _0x5c39ff['parameters'][_0xffc0('0x7a')]['admin']){var _0x2524cc=_0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xffc0('0x89')](_0x2524cc)){_0x186f18=path['join'](_0xffc0('0x8a'),_0x22feca,_0x15d3e5[0x0],_0x2524cc);}else{_0x186f18=_0x2524cc;}}else{logger[_0xffc0('0x65')](_0xffc0('0x8b'));}if(_0xffc0('0x24')!=typeof _0x5c39ff[_0xffc0('0x77')]['views']['agent']){var _0x569b75=_0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')][_0xffc0('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x569b75)){_0x227e86=path[_0xffc0('0x53')]('plugins',_0x22feca,_0x15d3e5[0x0],_0x569b75);}else{_0x227e86=_0x569b75;}}else{logger[_0xffc0('0x65')](_0xffc0('0x8c'));}}else if(_0x952ace==='script'){_0x53bc56=_0x5c39ff['parameters'][_0xffc0('0x80')];_0x571d01=_0x5c39ff['parameters'][_0xffc0('0x81')];if('undefined'!=typeof _0x5c39ff['parameters'][_0xffc0('0x7a')]){if('undefined'!=typeof _0x5c39ff['parameters'][_0xffc0('0x7a')][_0xffc0('0x7c')]){var _0x2524cc=_0x5c39ff['parameters'][_0xffc0('0x7a')][_0xffc0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xffc0('0x89')](_0x2524cc)){_0x186f18=path['join'](_0xffc0('0x8a'),_0x22feca,_0x15d3e5[0x0],_0x2524cc);}else{_0x186f18=_0x2524cc;}}if(_0xffc0('0x24')!=typeof _0x5c39ff[_0xffc0('0x77')][_0xffc0('0x7a')][_0xffc0('0x7d')]){var _0x569b75=_0x5c39ff['parameters'][_0xffc0('0x7a')][_0xffc0('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xffc0('0x89')](_0x569b75)){_0x227e86=path[_0xffc0('0x53')](_0xffc0('0x8a'),_0x22feca,_0x15d3e5[0x0],_0x569b75);}else{_0x227e86=_0x569b75;}}}}var _0x17386e={'name':_0x3ec19a,'description':_0x42738d,'path':path[_0xffc0('0x53')](_0x22feca,_0x15d3e5[0x0]),'type':_0x952ace,'sidebar':_0x54bf0e,'icon':_0x339fcf,'adminUrl':_0x186f18,'agentUrl':_0x227e86,'scriptName':_0x53bc56,'scriptPath':_0x571d01,'version':_0x511dd1};removeReferences(_0x11e002,null);return db[_0xffc0('0x34')][_0xffc0('0x8d')](_0x17386e)['then'](function(_0x5e36b2){var _0x41ef44={'role':_0x582466[_0xffc0('0x8e')][_0xffc0('0x8f')],'userProfileId':_0x582466['body'][_0xffc0('0x90')]};if(!_0x41ef44)throw new Error(_0xffc0('0x91'));if(_0x41ef44[_0xffc0('0x8f')]===_0xffc0('0x92')){var _0x5923cf=_0x5e36b2['get']({'plain':!![]});return db[_0xffc0('0x93')][_0xffc0('0x50')]({'where':{'name':_0xffc0('0x2c'),'userProfileId':_0x41ef44[_0xffc0('0x90')]},'raw':!![]})[_0xffc0('0x2a')](function(_0xb93f85){if(_0xb93f85&&_0xb93f85[_0xffc0('0x94')]===0x0){return db[_0xffc0('0x2d')][_0xffc0('0x8d')]({'name':_0x5923cf[_0xffc0('0x30')],'resourceId':_0x5923cf['id'],'type':_0xb93f85[_0xffc0('0x30')],'sectionId':_0xb93f85['id']},{})[_0xffc0('0x2a')](function(){return _0x5e36b2;});}else{return _0x5e36b2;}})['catch'](function(_0x14c9cd){logger[_0xffc0('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14c9cd);throw _0x14c9cd;});}return _0x5e36b2;})[_0xffc0('0x2a')](respondWithResult(_0x5bb7cb,null))[_0xffc0('0x51')](handleError(_0x5bb7cb,null));}});}catch(_0x539dd6){_0x5bb7cb[_0xffc0('0x21')](0x1f4)[_0xffc0('0x31')](_0x539dd6);}};function removeReferences(_0x418202,_0x2bde9f){try{if(_0x418202){fs[_0xffc0('0x64')](_0x418202);logger[_0xffc0('0x65')](_0xffc0('0x95'));}if(_0x2bde9f){rimraf(_0x2bde9f,function(){});logger[_0xffc0('0x65')](_0xffc0('0x96'));}}catch(_0x46adf9){logger[_0xffc0('0x2e')](_0x46adf9);}}exports[_0xffc0('0x29')]=function(_0x44a0a1,_0x3d05a0,_0x5a41fb){return db[_0xffc0('0x34')][_0xffc0('0x50')]({'where':{'id':_0x44a0a1[_0xffc0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d05a0,null))[_0xffc0('0x2a')](saveUpdates(_0x44a0a1[_0xffc0('0x8e')],null))[_0xffc0('0x2a')](respondWithResult(_0x3d05a0,null))['catch'](handleError(_0x3d05a0,null));};exports[_0xffc0('0x97')]=function(_0x1a3e4e,_0x2d5ef8,_0x3dc529){return db[_0xffc0('0x34')][_0xffc0('0x50')]({'where':{'id':_0x1a3e4e[_0xffc0('0x4f')]['id']}})['then'](function(_0x40d6bb){if(_0x40d6bb){return _0x40d6bb['destroy']();}})[_0xffc0('0x2a')](function(_0xcc5aa2){rimraf(path[_0xffc0('0x53')](config[_0xffc0('0x54')],'server/files/plugins',path[_0xffc0('0x5f')](_0xcc5aa2['path'])),function(){});return _0xcc5aa2;})[_0xffc0('0x2a')](handleEntityNotFound(_0x2d5ef8,null))[_0xffc0('0x2a')](respondWithStatusCode(_0x2d5ef8,null))[_0xffc0('0x51')](handleError(_0x2d5ef8,null));};exports[_0xffc0('0x98')]=function(_0x4ca160,_0x1e97dd,_0x50d3be){return BPromise[_0xffc0('0x99')]()[_0xffc0('0x2a')](function(){if(!_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x8')]){throw new Error(_0xffc0('0x9a'));}if(!_0x4ca160[_0xffc0('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x18653e=_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x9b')]?_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x9b')]+':'+_0x4ca160['query']['port']:'http://localhost:'+_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x9c')];var _0x562a9a=_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x22')]?_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x22')]:!![];var _0x45da9c=_0x4ca160['query'][_0xffc0('0x9d')]?_0x4ca160[_0xffc0('0x3a')][_0xffc0('0x9d')]:null;var _0x5bed3e={'method':_0x4ca160[_0xffc0('0x9e')],'uri':util[_0xffc0('0x55')]('%s%s',_0x18653e,_0x4ca160[_0xffc0('0x3a')]['path']),'json':_0x562a9a,'resolveWithFullResponse':!![],'encoding':_0x45da9c,'qs':_0x4ca160[_0xffc0('0x3a')]};if(_0x4ca160[_0xffc0('0x9f')]){_0x5bed3e['headers']=_0x4ca160[_0xffc0('0x9f')];if(_0x5bed3e[_0xffc0('0x9f')][_0xffc0('0xa0')]){delete _0x5bed3e[_0xffc0('0x9f')]['content-length'];}}if(_0x5bed3e[_0xffc0('0x9f')][_0xffc0('0xa1')]){delete _0x5bed3e[_0xffc0('0x9f')][_0xffc0('0xa1')];}return rp(_0x5bed3e);})[_0xffc0('0x2a')](function(_0x13d9ac){if(_0x13d9ac){_0x1e97dd[_0xffc0('0xa2')](_0x13d9ac['headers']);logger[_0xffc0('0x65')](_0x13d9ac['body']);if(_['endsWith'](_0x4ca160[_0xffc0('0x3a')]['path'],_0xffc0('0x52'))&&_0x13d9ac[_0xffc0('0xa3')]==0x1f4){return _0x1e97dd[_0xffc0('0x1f')](_0x13d9ac[_0xffc0('0xa3')]);}else{return _0x1e97dd[_0xffc0('0x21')](_0x13d9ac[_0xffc0('0xa3')])[_0xffc0('0x31')](_0x13d9ac[_0xffc0('0x8e')]);}}else{return _0x1e97dd[_0xffc0('0x1f')](0xc8);}})[_0xffc0('0x51')](handleError(_0x1e97dd,null));};exports[_0xffc0('0xa4')]=function(_0x5c8aed,_0x4646ff,_0x282eff){return BPromise[_0xffc0('0x99')]()[_0xffc0('0x2a')](function(){if(!_0x5c8aed[_0xffc0('0x3a')][_0xffc0('0x8')]){throw new Error(_0xffc0('0x9a'));}if(!_0x5c8aed[_0xffc0('0x3a')]['port']){throw new Error(_0xffc0('0xa5'));}var _0x1947fd=_0x5c8aed[_0xffc0('0x3a')][_0xffc0('0x9b')]?_0x5c8aed['query']['hostname']+':'+_0x5c8aed['query'][_0xffc0('0x9c')]:'http://localhost:'+_0x5c8aed[_0xffc0('0x3a')][_0xffc0('0x9c')];var _0x56a93f=_0x5c8aed[_0xffc0('0x3a')]['json']?_0x5c8aed[_0xffc0('0x3a')][_0xffc0('0x22')]:!![];var _0x1bd75f=_0x5c8aed[_0xffc0('0x3a')][_0xffc0('0x9d')]?_0x5c8aed[_0xffc0('0x3a')]['encoding']:null;var _0x71ce23={'method':_0x5c8aed[_0xffc0('0x9e')],'uri':util[_0xffc0('0x55')](_0xffc0('0xa6'),_0x1947fd,_0x5c8aed['query'][_0xffc0('0x8')]),'json':_0x56a93f,'resolveWithFullResponse':!![],'encoding':_0x1bd75f,'body':_0x5c8aed[_0xffc0('0x8e')]};if(_0x5c8aed[_0xffc0('0x9f')]){_0x71ce23[_0xffc0('0x9f')]=_0x5c8aed['headers'];if(_0x71ce23['headers'][_0xffc0('0xa0')]){delete _0x71ce23[_0xffc0('0x9f')][_0xffc0('0xa0')];}}if(_0x71ce23[_0xffc0('0x9f')][_0xffc0('0xa1')]){delete _0x71ce23['headers'][_0xffc0('0xa1')];}return rp(_0x71ce23);})[_0xffc0('0x2a')](function(_0x212c33){if(_0x212c33){_0x4646ff[_0xffc0('0xa2')](_0x212c33[_0xffc0('0x9f')]);logger[_0xffc0('0x65')](_0x212c33[_0xffc0('0x8e')]);return _0x4646ff['status'](_0x212c33['statusCode'])[_0xffc0('0x31')](_0x212c33[_0xffc0('0x8e')]);}else{return _0x4646ff[_0xffc0('0x1f')](0xc8);}})[_0xffc0('0x51')](handleError(_0x4646ff,null));}; \ No newline at end of file +var _0x9e1c=['destroy','get','Plugins','UserProfileResource','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','show','params','keys','includeAll','options','catch','download','find','join','root','server/files/plugins','%s.zip','basename','zip','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','format','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','send','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x378056,_0x2f1061){var _0xdfdf0=function(_0x1575d1){while(--_0x1575d1){_0x378056['push'](_0x378056['shift']());}};_0xdfdf0(++_0x2f1061);}(_0x9e1c,0x138));var _0xc9e1=function(_0x31c1de,_0x4273ff){_0x31c1de=_0x31c1de-0x0;var _0x486a30=_0x9e1c[_0x31c1de];return _0x486a30;};'use strict';var emlformat=require(_0xc9e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc9e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9e1('0x2'));var moment=require(_0xc9e1('0x3'));var BPromise=require(_0xc9e1('0x4'));var Mustache=require(_0xc9e1('0x5'));var util=require(_0xc9e1('0x6'));var path=require(_0xc9e1('0x7'));var sox=require(_0xc9e1('0x8'));var csv=require(_0xc9e1('0x9'));var ejs=require(_0xc9e1('0xa'));var fs=require('fs');var fs_extra=require(_0xc9e1('0xb'));var _=require(_0xc9e1('0xc'));var squel=require('squel');var crypto=require(_0xc9e1('0xd'));var jsforce=require(_0xc9e1('0xe'));var deskjs=require(_0xc9e1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9e1('0x10'));var Papa=require(_0xc9e1('0x11'));var extract=require(_0xc9e1('0x12'));var rimraf=require(_0xc9e1('0x13'));var archiver=require(_0xc9e1('0x14'));var Redis=require(_0xc9e1('0x15'));var authService=require(_0xc9e1('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xc9e1('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9e1('0x18'))(_0xc9e1('0x19'));var utils=require(_0xc9e1('0x1a'));var config=require(_0xc9e1('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9e1('0x1c'))['db'];config[_0xc9e1('0x1d')]=_[_0xc9e1('0x1e')](config['redis'],{'host':_0xc9e1('0x1f'),'port':0x18eb});var socket=require(_0xc9e1('0x20'))(new Redis(config[_0xc9e1('0x1d')]));require(_0xc9e1('0x21'))[_0xc9e1('0x22')](socket);function respondWithStatusCode(_0x12dfb9,_0x3958f2){_0x3958f2=_0x3958f2||0xcc;return function(_0x8eb52f){if(_0x8eb52f){return _0x12dfb9[_0xc9e1('0x23')](_0x3958f2);}return _0x12dfb9['status'](_0x3958f2)[_0xc9e1('0x24')]();};}function respondWithResult(_0xac68ea,_0x58b8f6){_0x58b8f6=_0x58b8f6||0xc8;return function(_0x29e03d){if(_0x29e03d){return _0xac68ea[_0xc9e1('0x25')](_0x58b8f6)['json'](_0x29e03d);}};}function respondWithFilteredResult(_0x3dbb1e,_0x100669){return function(_0x261d99){if(_0x261d99){var _0x3998d6=typeof _0x100669[_0xc9e1('0x26')]===_0xc9e1('0x27')&&typeof _0x100669[_0xc9e1('0x28')]===_0xc9e1('0x27');var _0x4137d3=_0x261d99['count'];var _0x376324=_0x3998d6?0x0:_0x100669[_0xc9e1('0x26')];var _0x131449=_0x3998d6?_0x261d99[_0xc9e1('0x29')]:_0x100669[_0xc9e1('0x26')]+_0x100669[_0xc9e1('0x28')];var _0x3fcde9;if(_0x131449>=_0x4137d3){_0x131449=_0x4137d3;_0x3fcde9=0xc8;}else{_0x3fcde9=0xce;}_0x3dbb1e[_0xc9e1('0x25')](_0x3fcde9);return _0x3dbb1e[_0xc9e1('0x2a')](_0xc9e1('0x2b'),_0x376324+'-'+_0x131449+'/'+_0x4137d3)['json'](_0x261d99);}return null;};}function patchUpdates(_0x1e9b1f){return function(_0x2e7f35){try{jsonpatch[_0xc9e1('0x2c')](_0x2e7f35,_0x1e9b1f,!![]);}catch(_0x996e64){return BPromise[_0xc9e1('0x2d')](_0x996e64);}return _0x2e7f35[_0xc9e1('0x2e')]();};}function saveUpdates(_0x284e17,_0x3403b5){return function(_0x1f18ee){if(_0x1f18ee){return _0x1f18ee['update'](_0x284e17)[_0xc9e1('0x2f')](function(_0x1f5795){return _0x1f5795;});}return null;};}function removeEntity(_0x4e3d2d,_0x598df8){return function(_0x288e74){if(_0x288e74){return _0x288e74[_0xc9e1('0x30')]()[_0xc9e1('0x2f')](function(){var _0x356ea4=_0x288e74[_0xc9e1('0x31')]({'plain':!![]});var _0x52b812=_0xc9e1('0x32');return db[_0xc9e1('0x33')][_0xc9e1('0x30')]({'where':{'type':_0x52b812,'resourceId':_0x356ea4['id']}})[_0xc9e1('0x2f')](function(){return _0x288e74;});})[_0xc9e1('0x2f')](function(){_0x4e3d2d['status'](0xcc)[_0xc9e1('0x24')]();});}};}function handleEntityNotFound(_0x4ad91e,_0x3fdaa1){return function(_0x11fb09){if(!_0x11fb09){_0x4ad91e['sendStatus'](0x194);}return _0x11fb09;};}function handleError(_0x1a91b5,_0x5d1811){_0x5d1811=_0x5d1811||0x1f4;return function(_0x30ce81){logger['error'](_0x30ce81['stack']);if(_0x30ce81[_0xc9e1('0x34')]){delete _0x30ce81['name'];}_0x1a91b5[_0xc9e1('0x25')](_0x5d1811)['send'](_0x30ce81);};}exports[_0xc9e1('0x35')]=function(_0x44823e,_0x46cda5){var _0xe8d5c7={},_0x578135={},_0x197fe6={'count':0x0,'rows':[]};var _0x2727b2=_[_0xc9e1('0x36')](db[_0xc9e1('0x37')][_0xc9e1('0x38')],function(_0x22df9c){return{'name':_0x22df9c[_0xc9e1('0x39')],'type':_0x22df9c[_0xc9e1('0x3a')][_0xc9e1('0x3b')]};});_0x578135[_0xc9e1('0x3c')]=_[_0xc9e1('0x36')](_0x2727b2,_0xc9e1('0x34'));_0x578135[_0xc9e1('0x3d')]=_['keys'](_0x44823e[_0xc9e1('0x3d')]);_0x578135[_0xc9e1('0x3e')]=_[_0xc9e1('0x3f')](_0x578135[_0xc9e1('0x3c')],_0x578135[_0xc9e1('0x3d')]);_0xe8d5c7['attributes']=_[_0xc9e1('0x3f')](_0x578135[_0xc9e1('0x3c')],qs[_0xc9e1('0x40')](_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x40')]));_0xe8d5c7['attributes']=_0xe8d5c7[_0xc9e1('0x41')][_0xc9e1('0x42')]?_0xe8d5c7[_0xc9e1('0x41')]:_0x578135[_0xc9e1('0x3c')];if(!_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x43')](_0xc9e1('0x44'))){_0xe8d5c7[_0xc9e1('0x28')]=qs[_0xc9e1('0x28')](_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x28')]);_0xe8d5c7[_0xc9e1('0x26')]=qs[_0xc9e1('0x26')](_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x26')]);}_0xe8d5c7[_0xc9e1('0x45')]=qs[_0xc9e1('0x46')](_0x44823e[_0xc9e1('0x3d')]['sort']);_0xe8d5c7[_0xc9e1('0x47')]=qs[_0xc9e1('0x3e')](_[_0xc9e1('0x48')](_0x44823e[_0xc9e1('0x3d')],_0x578135[_0xc9e1('0x3e')]),_0x2727b2);if(_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x49')]){_0xe8d5c7[_0xc9e1('0x47')]=_[_0xc9e1('0x4a')](_0xe8d5c7['where'],{'$or':_[_0xc9e1('0x36')](_0x2727b2,function(_0x1afe4b){if(_0x1afe4b[_0xc9e1('0x3a')]!=='VIRTUAL'){var _0x52cebd={};_0x52cebd[_0x1afe4b[_0xc9e1('0x34')]]={'$like':'%'+_0x44823e[_0xc9e1('0x3d')][_0xc9e1('0x49')]+'%'};return _0x52cebd;}})});}_0xe8d5c7=_['merge']({},_0xe8d5c7,_0x44823e['options']);var _0x57ff6c={'where':_0xe8d5c7[_0xc9e1('0x47')]};return db['Plugin'][_0xc9e1('0x29')](_0x57ff6c)[_0xc9e1('0x2f')](function(_0x390e2c){_0x197fe6[_0xc9e1('0x29')]=_0x390e2c;if(_0x44823e[_0xc9e1('0x3d')]['includeAll']){_0xe8d5c7[_0xc9e1('0x4b')]=[{'all':!![]}];}return db[_0xc9e1('0x37')]['findAll'](_0xe8d5c7);})[_0xc9e1('0x2f')](function(_0x1aa96f){_0x197fe6[_0xc9e1('0x4c')]=_0x1aa96f;return _0x197fe6;})['then'](respondWithFilteredResult(_0x46cda5,_0xe8d5c7))['catch'](handleError(_0x46cda5,null));};exports[_0xc9e1('0x4d')]=function(_0x6556db,_0x59f1fc){var _0x233b47={'raw':!![],'where':{'id':_0x6556db[_0xc9e1('0x4e')]['id']}},_0x5a397f={};_0x5a397f['model']=_[_0xc9e1('0x4f')](db[_0xc9e1('0x37')][_0xc9e1('0x38')]);_0x5a397f['query']=_[_0xc9e1('0x4f')](_0x6556db[_0xc9e1('0x3d')]);_0x5a397f[_0xc9e1('0x3e')]=_[_0xc9e1('0x3f')](_0x5a397f[_0xc9e1('0x3c')],_0x5a397f[_0xc9e1('0x3d')]);_0x233b47[_0xc9e1('0x41')]=_[_0xc9e1('0x3f')](_0x5a397f[_0xc9e1('0x3c')],qs[_0xc9e1('0x40')](_0x6556db[_0xc9e1('0x3d')]['fields']));_0x233b47[_0xc9e1('0x41')]=_0x233b47['attributes'][_0xc9e1('0x42')]?_0x233b47[_0xc9e1('0x41')]:_0x5a397f[_0xc9e1('0x3c')];if(_0x6556db['query'][_0xc9e1('0x50')]){_0x233b47[_0xc9e1('0x4b')]=[{'all':!![]}];}_0x233b47=_[_0xc9e1('0x4a')]({},_0x233b47,_0x6556db[_0xc9e1('0x51')]);return db[_0xc9e1('0x37')]['find'](_0x233b47)[_0xc9e1('0x2f')](handleEntityNotFound(_0x59f1fc,null))[_0xc9e1('0x2f')](respondWithResult(_0x59f1fc,null))[_0xc9e1('0x52')](handleError(_0x59f1fc,null));};exports[_0xc9e1('0x53')]=function(_0x1a4fd4,_0x2b900b,_0x5deb2f){return db['Plugin'][_0xc9e1('0x54')]({'where':{'id':_0x1a4fd4[_0xc9e1('0x4e')]['id']},'attributes':[_0xc9e1('0x34'),_0xc9e1('0x7')],'raw':!![]})[_0xc9e1('0x2f')](handleEntityNotFound(_0x2b900b,null))['then'](function(_0x29b058){if(_0x29b058){var _0x2b5d45=path[_0xc9e1('0x55')](config[_0xc9e1('0x56')],_0xc9e1('0x57'),util['format'](_0xc9e1('0x58'),path[_0xc9e1('0x59')](_0x29b058[_0xc9e1('0x7')])));var _0x43b1dc=fs['createWriteStream'](_0x2b5d45);var _0x293ea3=archiver(_0xc9e1('0x5a'),{'zlib':{'level':0x9}});_0x293ea3['on']('warning',function(_0x1b88b3){if(_0x1b88b3['code']===_0xc9e1('0x5b')){logger[_0xc9e1('0x5c')](_0x1b88b3);}else{throw new db[(_0xc9e1('0x5d'))][(_0xc9e1('0x5e'))](_0xc9e1('0x5f'));}});_0x293ea3['on']('error',function(_0x1a4b18){throw new db[(_0xc9e1('0x5d'))][(_0xc9e1('0x5e'))](_0xc9e1('0x5f'));});_0x293ea3[_0xc9e1('0x60')](_0x43b1dc);_0x293ea3[_0xc9e1('0x61')]('**/*',{'cwd':path[_0xc9e1('0x55')](config[_0xc9e1('0x56')],'server/files/plugins',path[_0xc9e1('0x62')](_0x29b058[_0xc9e1('0x7')])),'ignore':[path[_0xc9e1('0x55')](path[_0xc9e1('0x59')](_0x29b058[_0xc9e1('0x7')]),_0xc9e1('0x63')),path['join'](path['basename'](_0x29b058[_0xc9e1('0x7')]),_0xc9e1('0x64'))],'nodir':!![]})[_0xc9e1('0x65')]();_0x43b1dc['on'](_0xc9e1('0x66'),function(){if(!fs[_0xc9e1('0x67')](_0x2b5d45)){throw new db[(_0xc9e1('0x5d'))][(_0xc9e1('0x5e'))](_0xc9e1('0x68'));}return _0x2b900b[_0xc9e1('0x53')](_0x2b5d45,util['format'](_0xc9e1('0x58'),path['basename'](_0x29b058[_0xc9e1('0x7')])),function(_0x593b10){if(_0x593b10){throw new db[(_0xc9e1('0x5d'))]['Error'](_0xc9e1('0x69'));}fs['unlinkSync'](_0x2b5d45);logger[_0xc9e1('0x6a')](_0xc9e1('0x6b'));logger[_0xc9e1('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0xc9e1('0x52')](handleError(_0x2b900b,null));};exports[_0xc9e1('0x6c')]=function(_0x263051,_0x135ef1,_0x31b69b){var _0x1164ce=path[_0xc9e1('0x59')](_0x263051['file'][_0xc9e1('0x6d')],path[_0xc9e1('0x6e')](_0x263051[_0xc9e1('0x6f')][_0xc9e1('0x6d')]));var _0x13bc0d=path[_0xc9e1('0x55')](config['root'],'server/files/plugins',_0x263051[_0xc9e1('0x6f')]['filename']);var _0x21e830=path[_0xc9e1('0x55')](config['root'],_0xc9e1('0x57'),_0x1164ce);logger[_0xc9e1('0x6a')]('Plugin\x20upload\x20filepath:\x20%s',_0x13bc0d);logger['info'](_0xc9e1('0x70'),_0x21e830);try{fs['chmodSync'](_0x13bc0d,parseInt(_0xc9e1('0x71'),0x8));extract(_0x13bc0d,{'dir':_0x21e830},function(_0x3d52ad){if(_0x3d52ad){logger[_0xc9e1('0x5c')](_0x3d52ad);handleError(_0x3d52ad,!![]);};var _0x32d1a2=fs[_0xc9e1('0x72')](_0x21e830);if(_0x32d1a2[_0xc9e1('0x42')]>0x1){removeReferences(_0x13bc0d,_0x21e830);logger[_0xc9e1('0x5c')](_0xc9e1('0x73'));return _0x31b69b(new Error(_0xc9e1('0x73')));}var _0x38d3ee=fs[_0xc9e1('0x74')](path[_0xc9e1('0x55')](_0x21e830,_0x32d1a2[0x0]));if(_0x38d3ee[_0xc9e1('0x75')]()){removeReferences(_0x13bc0d,_0x21e830);logger[_0xc9e1('0x5c')]('Invalid\x20plugin\x20structure');return _0x31b69b(new Error(_0xc9e1('0x73')));}if(_0x38d3ee[_0xc9e1('0x76')]()){var _0x2ee313=fs[_0xc9e1('0x72')](path[_0xc9e1('0x55')](_0x21e830,_0x32d1a2[0x0]));if(_0x2ee313[_0xc9e1('0x42')]===0x0){removeReferences(_0x13bc0d,_0x21e830);logger['error'](_0xc9e1('0x73'));return _0x31b69b(new Error(_0xc9e1('0x73')));}var _0x4e935b=_0x2ee313[_0xc9e1('0x77')](function(_0x40db89){return _0x40db89==='manifest.json';});if(!_0x4e935b){return _0x31b69b(new Error(_0xc9e1('0x78')));}var _0x56b4f0=fs['readFileSync'](path[_0xc9e1('0x55')](_0x21e830,_0x32d1a2[0x0],'manifest.json'));var _0x4da6ff=JSON[_0xc9e1('0x79')](_0x56b4f0);if(_0xc9e1('0x27')==typeof _0x4da6ff[_0xc9e1('0x34')]){return _0x31b69b(new Error(_0xc9e1('0x7a')));}if('undefined'==typeof _0x4da6ff['type']){return _0x31b69b(new Error(_0xc9e1('0x7b')));}if(_0xc9e1('0x27')==typeof _0x4da6ff[_0xc9e1('0x7c')]){return _0x31b69b(new Error(_0xc9e1('0x7d')));}if(_0xc9e1('0x27')==typeof _0x4da6ff[_0xc9e1('0x7e')]){return _0x31b69b(new Error(_0xc9e1('0x7f')));}if(_0x4da6ff[_0xc9e1('0x3a')]===_0xc9e1('0x80')){if(_0xc9e1('0x27')==typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')]){return _0x31b69b(new Error(_0xc9e1('0x82')));}if(_0xc9e1('0x27')==typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')][_0xc9e1('0x83')]&&_0xc9e1('0x27')==typeof _0x4da6ff['parameters']['views'][_0xc9e1('0x84')]){return _0x31b69b(new Error(_0xc9e1('0x85')));}}else if(_0x4da6ff[_0xc9e1('0x3a')]===_0xc9e1('0x86')){if('undefined'==typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x87')]){return _0x31b69b(new Error(_0xc9e1('0x88')));}if(_0xc9e1('0x27')==typeof _0x4da6ff['parameters'][_0xc9e1('0x89')]){return _0x31b69b(new Error(_0xc9e1('0x8a')));}}else{return _0x31b69b(new Error(_0xc9e1('0x8b')));}var _0x489286=_0x4da6ff[_0xc9e1('0x34')];var _0x213200=_0x4da6ff[_0xc9e1('0x8c')];var _0x4a9a72=_0x4da6ff[_0xc9e1('0x3a')];var _0xea170d=_0x4da6ff['sidebar']?_0x4da6ff['sidebar']:_0xc9e1('0x8d');var _0x5c2b9e=_0x4da6ff['icon']?_0x4da6ff[_0xc9e1('0x8e')]:_0xc9e1('0x8f');var _0x4774be='';var _0xfe9c14='';var _0x3893ec='';var _0x418019='';var _0x521f3f=_0x4da6ff[_0xc9e1('0x7c')];if(_0x4a9a72===_0xc9e1('0x80')){if(_0xc9e1('0x27')!=typeof _0x4da6ff['parameters']['views'][_0xc9e1('0x83')]){var _0x378da0=_0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')][_0xc9e1('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xc9e1('0x90')](_0x378da0)){_0x4774be=path[_0xc9e1('0x55')](_0xc9e1('0x91'),_0x1164ce,_0x32d1a2[0x0],_0x378da0);}else{_0x4774be=_0x378da0;}}else{logger[_0xc9e1('0x6a')](_0xc9e1('0x92'));}if(_0xc9e1('0x27')!=typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')][_0xc9e1('0x84')]){var _0x3d8b9b=_0x4da6ff[_0xc9e1('0x7e')]['views'][_0xc9e1('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc9e1('0x90')](_0x3d8b9b)){_0xfe9c14=path[_0xc9e1('0x55')](_0xc9e1('0x91'),_0x1164ce,_0x32d1a2[0x0],_0x3d8b9b);}else{_0xfe9c14=_0x3d8b9b;}}else{logger['info'](_0xc9e1('0x93'));}}else if(_0x4a9a72==='script'){_0x3893ec=_0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x87')];_0x418019=_0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x89')];if(_0xc9e1('0x27')!=typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')]){if(_0xc9e1('0x27')!=typeof _0x4da6ff['parameters']['views'][_0xc9e1('0x83')]){var _0x378da0=_0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')][_0xc9e1('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xc9e1('0x90')](_0x378da0)){_0x4774be=path[_0xc9e1('0x55')](_0xc9e1('0x91'),_0x1164ce,_0x32d1a2[0x0],_0x378da0);}else{_0x4774be=_0x378da0;}}if('undefined'!=typeof _0x4da6ff[_0xc9e1('0x7e')][_0xc9e1('0x81')][_0xc9e1('0x84')]){var _0x3d8b9b=_0x4da6ff['parameters'][_0xc9e1('0x81')][_0xc9e1('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xc9e1('0x90')](_0x3d8b9b)){_0xfe9c14=path[_0xc9e1('0x55')]('plugins',_0x1164ce,_0x32d1a2[0x0],_0x3d8b9b);}else{_0xfe9c14=_0x3d8b9b;}}}}var _0x506faf={'name':_0x489286,'description':_0x213200,'path':path[_0xc9e1('0x55')](_0x1164ce,_0x32d1a2[0x0]),'type':_0x4a9a72,'sidebar':_0xea170d,'icon':_0x5c2b9e,'adminUrl':_0x4774be,'agentUrl':_0xfe9c14,'scriptName':_0x3893ec,'scriptPath':_0x418019,'version':_0x521f3f};removeReferences(_0x13bc0d,null);return db['Plugin'][_0xc9e1('0x94')](_0x506faf)[_0xc9e1('0x2f')](function(_0xd295e7){var _0x5e7231={'role':_0x263051[_0xc9e1('0x95')]['role'],'userProfileId':_0x263051[_0xc9e1('0x95')][_0xc9e1('0x96')]};if(!_0x5e7231)throw new Error(_0xc9e1('0x97'));if(_0x5e7231[_0xc9e1('0x98')]==='user'){var _0x233152=_0xd295e7[_0xc9e1('0x31')]({'plain':!![]});return db[_0xc9e1('0x99')][_0xc9e1('0x54')]({'where':{'name':_0xc9e1('0x32'),'userProfileId':_0x5e7231[_0xc9e1('0x96')]},'raw':!![]})[_0xc9e1('0x2f')](function(_0x501ea5){if(_0x501ea5&&_0x501ea5[_0xc9e1('0x9a')]===0x0){return db[_0xc9e1('0x33')][_0xc9e1('0x94')]({'name':_0x233152[_0xc9e1('0x34')],'resourceId':_0x233152['id'],'type':_0x501ea5[_0xc9e1('0x34')],'sectionId':_0x501ea5['id']},{})['then'](function(){return _0xd295e7;});}else{return _0xd295e7;}})[_0xc9e1('0x52')](function(_0x47dea7){logger['error'](_0xc9e1('0x9b'),_0x47dea7);throw _0x47dea7;});}return _0xd295e7;})[_0xc9e1('0x2f')](respondWithResult(_0x135ef1,null))[_0xc9e1('0x52')](handleError(_0x135ef1,null));}});}catch(_0x35cae5){_0x135ef1[_0xc9e1('0x25')](0x1f4)['send'](_0x35cae5);}};function removeReferences(_0x39caa4,_0x51aa41){try{if(_0x39caa4){fs[_0xc9e1('0x9c')](_0x39caa4);logger[_0xc9e1('0x6a')](_0xc9e1('0x9d'));}if(_0x51aa41){rimraf(_0x51aa41,function(){});logger[_0xc9e1('0x6a')](_0xc9e1('0x9e'));}}catch(_0xf14bf1){logger[_0xc9e1('0x5c')](_0xf14bf1);}}exports[_0xc9e1('0x9f')]=function(_0x5a68fa,_0x512899,_0x2716b8){return db[_0xc9e1('0x37')]['find']({'where':{'id':_0x5a68fa[_0xc9e1('0x4e')]['id']}})[_0xc9e1('0x2f')](handleEntityNotFound(_0x512899,null))[_0xc9e1('0x2f')](saveUpdates(_0x5a68fa['body'],null))[_0xc9e1('0x2f')](respondWithResult(_0x512899,null))[_0xc9e1('0x52')](handleError(_0x512899,null));};exports[_0xc9e1('0xa0')]=function(_0xaa253f,_0x53f14b,_0xac0a2c){return db[_0xc9e1('0x37')][_0xc9e1('0x54')]({'where':{'id':_0xaa253f[_0xc9e1('0x4e')]['id']}})[_0xc9e1('0x2f')](function(_0x3b5bd3){if(_0x3b5bd3){return _0x3b5bd3['destroy']();}})[_0xc9e1('0x2f')](function(_0x187f84){rimraf(path[_0xc9e1('0x55')](config[_0xc9e1('0x56')],'server/files/plugins',path[_0xc9e1('0x62')](_0x187f84[_0xc9e1('0x7')])),function(){});return _0x187f84;})[_0xc9e1('0x2f')](handleEntityNotFound(_0x53f14b,null))[_0xc9e1('0x2f')](respondWithStatusCode(_0x53f14b,null))[_0xc9e1('0x52')](handleError(_0x53f14b,null));};exports[_0xc9e1('0xa1')]=function(_0x5740c5,_0x1ee939,_0x24ba04){return BPromise[_0xc9e1('0xa2')]()['then'](function(){if(!_0x5740c5[_0xc9e1('0x3d')]['path']){throw new Error(_0xc9e1('0xa3'));}if(!_0x5740c5['query'][_0xc9e1('0xa4')]){throw new Error(_0xc9e1('0xa5'));}var _0x8e0f6d=_0x5740c5[_0xc9e1('0x3d')]['hostname']?_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0xa6')]+':'+_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0xa4')]:_0xc9e1('0xa7')+_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0xa4')];var _0x5d8a90=_0x5740c5[_0xc9e1('0x3d')]['json']?_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0xa8')]:!![];var _0x74b3da=_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0xa9')]?_0x5740c5['query'][_0xc9e1('0xa9')]:null;var _0x86b924={'method':_0x5740c5[_0xc9e1('0xaa')],'uri':util[_0xc9e1('0xab')](_0xc9e1('0xac'),_0x8e0f6d,_0x5740c5['query'][_0xc9e1('0x7')]),'json':_0x5d8a90,'resolveWithFullResponse':!![],'encoding':_0x74b3da,'qs':_0x5740c5[_0xc9e1('0x3d')]};if(_0x5740c5[_0xc9e1('0xad')]){_0x86b924[_0xc9e1('0xad')]=_0x5740c5[_0xc9e1('0xad')];if(_0x86b924['headers']['content-length']){delete _0x86b924[_0xc9e1('0xad')][_0xc9e1('0xae')];}}if(_0x86b924[_0xc9e1('0xad')][_0xc9e1('0xaf')]){delete _0x86b924[_0xc9e1('0xad')]['content-type'];}return rp(_0x86b924);})[_0xc9e1('0x2f')](function(_0x30d950){if(_0x30d950){_0x1ee939[_0xc9e1('0x2a')](_0x30d950[_0xc9e1('0xad')]);logger[_0xc9e1('0x6a')](_0x30d950[_0xc9e1('0x95')]);if(_[_0xc9e1('0xb0')](_0x5740c5[_0xc9e1('0x3d')][_0xc9e1('0x7')],_0xc9e1('0x53'))&&_0x30d950[_0xc9e1('0xb1')]==0x1f4){return _0x1ee939[_0xc9e1('0x23')](_0x30d950[_0xc9e1('0xb1')]);}else{return _0x1ee939[_0xc9e1('0x25')](_0x30d950['statusCode'])['send'](_0x30d950[_0xc9e1('0x95')]);}}else{return _0x1ee939['sendStatus'](0xc8);}})[_0xc9e1('0x52')](handleError(_0x1ee939,null));};exports[_0xc9e1('0xb2')]=function(_0x200849,_0x29803f,_0x1b4fb0){return BPromise[_0xc9e1('0xa2')]()['then'](function(){if(!_0x200849[_0xc9e1('0x3d')]['path']){throw new Error(_0xc9e1('0xa3'));}if(!_0x200849[_0xc9e1('0x3d')][_0xc9e1('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3b0f4f=_0x200849[_0xc9e1('0x3d')]['hostname']?_0x200849[_0xc9e1('0x3d')][_0xc9e1('0xa6')]+':'+_0x200849['query'][_0xc9e1('0xa4')]:_0xc9e1('0xa7')+_0x200849[_0xc9e1('0x3d')][_0xc9e1('0xa4')];var _0x453942=_0x200849[_0xc9e1('0x3d')]['json']?_0x200849['query'][_0xc9e1('0xa8')]:!![];var _0x35b28a=_0x200849[_0xc9e1('0x3d')][_0xc9e1('0xa9')]?_0x200849[_0xc9e1('0x3d')]['encoding']:null;var _0x3b0f67={'method':_0x200849[_0xc9e1('0xaa')],'uri':util['format'](_0xc9e1('0xac'),_0x3b0f4f,_0x200849[_0xc9e1('0x3d')][_0xc9e1('0x7')]),'json':_0x453942,'resolveWithFullResponse':!![],'encoding':_0x35b28a,'body':_0x200849[_0xc9e1('0x95')]};if(_0x200849['headers']){_0x3b0f67[_0xc9e1('0xad')]=_0x200849[_0xc9e1('0xad')];if(_0x3b0f67[_0xc9e1('0xad')]['content-length']){delete _0x3b0f67['headers'][_0xc9e1('0xae')];}}if(_0x3b0f67[_0xc9e1('0xad')][_0xc9e1('0xaf')]){delete _0x3b0f67['headers'][_0xc9e1('0xaf')];}return rp(_0x3b0f67);})[_0xc9e1('0x2f')](function(_0x567b1f){if(_0x567b1f){_0x29803f[_0xc9e1('0x2a')](_0x567b1f[_0xc9e1('0xad')]);logger[_0xc9e1('0x6a')](_0x567b1f[_0xc9e1('0x95')]);return _0x29803f['status'](_0x567b1f[_0xc9e1('0xb1')])[_0xc9e1('0xb3')](_0x567b1f[_0xc9e1('0x95')]);}else{return _0x29803f['sendStatus'](0xc8);}})['catch'](handleError(_0x29803f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 6052bc9..22b69fd 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 _0x1a0b=['Plugin','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x311759,_0x1fa355){_0x311759=_0x311759-0x0;var _0x198b75=_0x1a0b[_0x311759];return _0x198b75;};'use strict';var EventEmitter=require(_0xb1a0('0x0'));var Plugin=require('../../mysqldb')['db'][_0xb1a0('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xb1a0('0x2')](0x0);var events={'afterCreate':_0xb1a0('0x3'),'afterUpdate':_0xb1a0('0x4'),'afterDestroy':_0xb1a0('0x5')};function emitEvent(_0x4522c2){return function(_0x46f819,_0x34c5fb,_0x1126a3){PluginEvents[_0xb1a0('0x6')](_0x4522c2+':'+_0x46f819['id'],_0x46f819);PluginEvents[_0xb1a0('0x6')](_0x4522c2,_0x46f819);_0x1126a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xb1a0('0x7')]=PluginEvents; \ No newline at end of file +var _0x3d49=['emit','../../mysqldb','Plugin','setMaxListeners','save','remove'];(function(_0x34cf2a,_0x195aa7){var _0x8973e2=function(_0x29c8d4){while(--_0x29c8d4){_0x34cf2a['push'](_0x34cf2a['shift']());}};_0x8973e2(++_0x195aa7);}(_0x3d49,0x151));var _0x93d4=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x3d49[_0x56f7e2];return _0x36240b;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x93d4('0x0'))['db'][_0x93d4('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x93d4('0x2')](0x0);var events={'afterCreate':_0x93d4('0x3'),'afterUpdate':'update','afterDestroy':_0x93d4('0x4')};function emitEvent(_0x9846c2){return function(_0xa1de2e,_0x41313a,_0x20e6c7){PluginEvents[_0x93d4('0x5')](_0x9846c2+':'+_0xa1de2e['id'],_0xa1de2e);PluginEvents['emit'](_0x9846c2,_0xa1de2e);_0x20e6c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a673054..45c3f83 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 _0x6e64=['./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x554d24,_0x2a9d57){var _0x1d1396=function(_0x48a811){while(--_0x48a811){_0x554d24['push'](_0x554d24['shift']());}};_0x1d1396(++_0x2a9d57);}(_0x6e64,0x79));var _0x46e6=function(_0x25ee6b,_0x2ff72f){_0x25ee6b=_0x25ee6b-0x0;var _0x169ec8=_0x6e64[_0x25ee6b];return _0x169ec8;};'use strict';var _=require(_0x46e6('0x0'));var util=require(_0x46e6('0x1'));var logger=require(_0x46e6('0x2'))(_0x46e6('0x3'));var moment=require(_0x46e6('0x4'));var BPromise=require(_0x46e6('0x5'));var rp=require(_0x46e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46e6('0x7'));var config=require(_0x46e6('0x8'));var attributes=require(_0x46e6('0x9'));module[_0x46e6('0xa')]=function(_0x4e11d7,_0x52d20b){return _0x4e11d7[_0x46e6('0xb')](_0x46e6('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebc0=['moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger'];(function(_0x34e9ac,_0x358683){var _0x18c152=function(_0x39e5c8){while(--_0x39e5c8){_0x34e9ac['push'](_0x34e9ac['shift']());}};_0x18c152(++_0x358683);}(_0xebc0,0x1a1));var _0x0ebc=function(_0x1789a8,_0x4cbf14){_0x1789a8=_0x1789a8-0x0;var _0x4eefd0=_0xebc0[_0x1789a8];return _0x4eefd0;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var logger=require(_0x0ebc('0x2'))('api');var moment=require(_0x0ebc('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ebc('0x4'));var fs=require('fs');var path=require(_0x0ebc('0x5'));var rimraf=require(_0x0ebc('0x6'));var config=require(_0x0ebc('0x7'));var attributes=require(_0x0ebc('0x8'));module[_0x0ebc('0x9')]=function(_0x3a40e6,_0xbae735){return _0x3a40e6[_0x0ebc('0xa')](_0x0ebc('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index da37475..9d0bd3f 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 _0x6af2=['result','CreatePlugin','create','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x576675,_0x43a637){var _0x20fbd6=function(_0x551a6c){while(--_0x551a6c){_0x576675['push'](_0x576675['shift']());}};_0x20fbd6(++_0x43a637);}(_0x6af2,0x17d));var _0x26af=function(_0x330df2,_0x4e79c3){_0x330df2=_0x330df2-0x0;var _0x110b32=_0x6af2[_0x330df2];return _0x110b32;};'use strict';var _=require(_0x26af('0x0'));var util=require(_0x26af('0x1'));var moment=require(_0x26af('0x2'));var BPromise=require(_0x26af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26af('0x4'))['db'];var utils=require(_0x26af('0x5'));var logger=require(_0x26af('0x6'))(_0x26af('0x7'));var config=require(_0x26af('0x8'));var jayson=require(_0x26af('0x9'));var client=jayson['client'][_0x26af('0xa')]({'port':0x232a});config[_0x26af('0xb')]=_['defaults'](config[_0x26af('0xb')],{'host':_0x26af('0xc'),'port':0x18eb});var socket=require(_0x26af('0xd'))(new Redis(config[_0x26af('0xb')]));require('./plugin.socket')[_0x26af('0xe')](socket);function respondWithRpcPromise(_0x4aba51,_0x415032,_0x3a1fd1){return new BPromise(function(_0x56108a,_0x41c772){return client[_0x26af('0xf')](_0x4aba51,_0x3a1fd1)[_0x26af('0x10')](function(_0x142b40){logger[_0x26af('0x11')](_0x26af('0x12'),_0x415032,_0x26af('0x13'));logger[_0x26af('0x14')](_0x26af('0x15'),_0x415032,'request\x20sent',JSON['stringify'](_0x142b40));if(_0x142b40[_0x26af('0x16')]){if(_0x142b40[_0x26af('0x16')][_0x26af('0x17')]===0x1f4){logger['error'](_0x26af('0x12'),_0x415032,_0x142b40[_0x26af('0x16')][_0x26af('0x18')]);return _0x41c772(_0x142b40[_0x26af('0x16')][_0x26af('0x18')]);}logger[_0x26af('0x16')](_0x26af('0x12'),_0x415032,_0x142b40[_0x26af('0x16')][_0x26af('0x18')]);return _0x56108a(_0x142b40['error'][_0x26af('0x18')]);}else{logger['info'](_0x26af('0x12'),_0x415032,_0x26af('0x13'));_0x56108a(_0x142b40[_0x26af('0x19')][_0x26af('0x18')]);}})['catch'](function(_0x1c1ced){logger[_0x26af('0x16')](_0x26af('0x12'),_0x415032,_0x1c1ced);_0x41c772(_0x1c1ced);});});}exports[_0x26af('0x1a')]=function(_0x548c4a){var _0x1d920e=this;return new Promise(function(_0x5d3125,_0x2372aa){return db['Plugin'][_0x26af('0x1b')](_0x548c4a['body'],{'raw':_0x548c4a['options']?_0x548c4a['options']['raw']===undefined?!![]:![]:!![]})[_0x26af('0x10')](function(_0x14996c){logger[_0x26af('0x11')](_0x26af('0x1a'),_0x548c4a);logger[_0x26af('0x14')]('CreatePlugin',_0x548c4a,JSON['stringify'](_0x14996c));_0x5d3125(_0x14996c);})[_0x26af('0x1c')](function(_0x585bc9){logger[_0x26af('0x16')](_0x26af('0x1a'),_0x585bc9[_0x26af('0x18')],_0x548c4a);_0x2372aa(_0x1d920e['error'](0x1f4,_0x585bc9[_0x26af('0x18')]));});});}; \ No newline at end of file +var _0x8155=['http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','stringify','error','code','message','catch','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45d53f,_0x4c8a01){var _0x363dec=function(_0x26f4d0){while(--_0x26f4d0){_0x45d53f['push'](_0x45d53f['shift']());}};_0x363dec(++_0x4c8a01);}(_0x8155,0x1f2));var _0x5815=function(_0x2911a7,_0x566515){_0x2911a7=_0x2911a7-0x0;var _0x3e5f0b=_0x8155[_0x2911a7];return _0x3e5f0b;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var moment=require(_0x5815('0x2'));var BPromise=require(_0x5815('0x3'));var rs=require(_0x5815('0x4'));var fs=require('fs');var Redis=require(_0x5815('0x5'));var db=require(_0x5815('0x6'))['db'];var utils=require(_0x5815('0x7'));var logger=require(_0x5815('0x8'))(_0x5815('0x9'));var config=require(_0x5815('0xa'));var jayson=require(_0x5815('0xb'));var client=jayson['client'][_0x5815('0xc')]({'port':0x232a});config[_0x5815('0xd')]=_[_0x5815('0xe')](config[_0x5815('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5815('0xf'))(new Redis(config[_0x5815('0xd')]));require(_0x5815('0x10'))[_0x5815('0x11')](socket);function respondWithRpcPromise(_0x387baa,_0x2e68dd,_0x3a1dd9){return new BPromise(function(_0x88537,_0x5ad284){return client[_0x5815('0x12')](_0x387baa,_0x3a1dd9)[_0x5815('0x13')](function(_0xbe0180){logger[_0x5815('0x14')](_0x5815('0x15'),_0x2e68dd,'request\x20sent');logger[_0x5815('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2e68dd,'request\x20sent',JSON[_0x5815('0x17')](_0xbe0180));if(_0xbe0180[_0x5815('0x18')]){if(_0xbe0180[_0x5815('0x18')][_0x5815('0x19')]===0x1f4){logger[_0x5815('0x18')](_0x5815('0x15'),_0x2e68dd,_0xbe0180[_0x5815('0x18')][_0x5815('0x1a')]);return _0x5ad284(_0xbe0180[_0x5815('0x18')]['message']);}logger[_0x5815('0x18')]('Plugin,\x20%s,\x20%s',_0x2e68dd,_0xbe0180[_0x5815('0x18')][_0x5815('0x1a')]);return _0x88537(_0xbe0180['error']['message']);}else{logger[_0x5815('0x14')]('Plugin,\x20%s,\x20%s',_0x2e68dd,'request\x20sent');_0x88537(_0xbe0180['result']['message']);}})[_0x5815('0x1b')](function(_0x31a3c5){logger[_0x5815('0x18')](_0x5815('0x15'),_0x2e68dd,_0x31a3c5);_0x5ad284(_0x31a3c5);});});}exports['CreatePlugin']=function(_0x55b66c){var _0x428497=this;return new Promise(function(_0x42b187,_0xb8490c){return db[_0x5815('0x1c')][_0x5815('0x1d')](_0x55b66c[_0x5815('0x1e')],{'raw':_0x55b66c[_0x5815('0x1f')]?_0x55b66c['options'][_0x5815('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3ad2fb){logger[_0x5815('0x14')](_0x5815('0x21'),_0x55b66c);logger[_0x5815('0x16')](_0x5815('0x21'),_0x55b66c,JSON[_0x5815('0x17')](_0x3ad2fb));_0x42b187(_0x3ad2fb);})[_0x5815('0x1b')](function(_0x2d2a21){logger['error'](_0x5815('0x21'),_0x2d2a21['message'],_0x55b66c);_0xb8490c(_0x428497['error'](0x1f4,_0x2d2a21['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1abc048..4dc729d 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 _0x2f47=['remove','update','removeListener','register','length'];(function(_0x27b94b,_0x5a7563){var _0x8d94b2=function(_0x311fea){while(--_0x311fea){_0x27b94b['push'](_0x27b94b['shift']());}};_0x8d94b2(++_0x5a7563);}(_0x2f47,0x159));var _0x72f4=function(_0x33030c,_0x35cce3){_0x33030c=_0x33030c-0x0;var _0x503291=_0x2f47[_0x33030c];return _0x503291;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x72f4('0x0'),_0x72f4('0x1')];function createListener(_0x558713,_0x12dd06){return function(_0x2d4e84){_0x12dd06['emit'](_0x558713,_0x2d4e84);};}function removeListener(_0xd3df6d,_0x533c67){return function(){PluginEvents[_0x72f4('0x2')](_0xd3df6d,_0x533c67);};}exports[_0x72f4('0x3')]=function(_0x104268){for(var _0x174dc2=0x0,_0x37c04a=events[_0x72f4('0x4')];_0x174dc2<_0x37c04a;_0x174dc2++){var _0x44ebfe=events[_0x174dc2];var _0xc2bafc=createListener('plugin:'+_0x44ebfe,_0x104268);PluginEvents['on'](_0x44ebfe,_0xc2bafc);}}; \ No newline at end of file +var _0x808a=['length','plugin:','./plugin.events','update','emit','removeListener','register'];(function(_0x2568d9,_0x2e85ff){var _0x534fdf=function(_0x4d3a59){while(--_0x4d3a59){_0x2568d9['push'](_0x2568d9['shift']());}};_0x534fdf(++_0x2e85ff);}(_0x808a,0x1e5));var _0xa808=function(_0xad9d4d,_0x5bf432){_0xad9d4d=_0xad9d4d-0x0;var _0x195e72=_0x808a[_0xad9d4d];return _0x195e72;};'use strict';var PluginEvents=require(_0xa808('0x0'));var events=['save','remove',_0xa808('0x1')];function createListener(_0x1a388f,_0x1727a7){return function(_0x341723){_0x1727a7[_0xa808('0x2')](_0x1a388f,_0x341723);};}function removeListener(_0x25bd29,_0x245b2d){return function(){PluginEvents[_0xa808('0x3')](_0x25bd29,_0x245b2d);};}exports[_0xa808('0x4')]=function(_0x559a08){for(var _0x4da49e=0x0,_0x57a96f=events[_0xa808('0x5')];_0x4da49e<_0x57a96f;_0x4da49e++){var _0x13d2b3=events[_0x4da49e];var _0x431a5c=createListener(_0xa808('0x6')+_0x13d2b3,_0x559a08);PluginEvents['on'](_0x13d2b3,_0x431a5c);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 18cf04c..5b9ed47 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(_0x50cfa6,_0x369ea6){var _0x5a3715=function(_0x372d16){while(--_0x372d16){_0x50cfa6['push'](_0x50cfa6['shift']());}};_0x5a3715(++_0x369ea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x28c5e0,_0x114cfe){var _0x514e78=function(_0x94c26){while(--_0x94c26){_0x28c5e0['push'](_0x28c5e0['shift']());}};_0x514e78(++_0x114cfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 e273d94..add2fed 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 _0x2e54=['exec','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','api','path','child_process'];(function(_0x4962d0,_0x4137e9){var _0x42a832=function(_0x502291){while(--_0x502291){_0x4962d0['push'](_0x4962d0['shift']());}};_0x42a832(++_0x4137e9);}(_0x2e54,0x1dd));var _0x42e5=function(_0xbb7979,_0x19c733){_0xbb7979=_0xbb7979-0x0;var _0x2458c4=_0x2e54[_0xbb7979];return _0x2458c4;};'use strict';var _=require(_0x42e5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x42e5('0x1'));var path=require(_0x42e5('0x2'));var exec=require(_0x42e5('0x3'))[_0x42e5('0x4')];var BPromise=require(_0x42e5('0x5'));function handleEntityNotFound(_0x153440,_0x42736b){return function(_0x528772){if(!_0x528772){_0x153440[_0x42e5('0x6')](0x194);;}return _0x528772;};}function respondWithResult(_0x455f48,_0x38cb1b){_0x38cb1b=_0x38cb1b||0xc8;return function(_0x4bed10){if(_0x4bed10){return _0x455f48[_0x42e5('0x7')](_0x38cb1b)['json'](_0x4bed10);}return null;};}function handleError(_0x335b92,_0x490b99){_0x490b99=_0x490b99||0x1f4;return function(_0x3a8494){logger[_0x42e5('0x8')](_0x3a8494[_0x42e5('0x9')]);if(_0x3a8494[_0x42e5('0xa')]){delete _0x3a8494[_0x42e5('0xa')];}_0x335b92[_0x42e5('0x7')](_0x490b99)[_0x42e5('0xb')](_0x3a8494);};}function execChildProcess(){return new BPromise(function(_0x2fa2f0,_0x197752){exec('npm\x20install',function(_0x456298,_0x28b3b3,_0x5d57f4){logger[_0x42e5('0xc')](_0x28b3b3);logger[_0x42e5('0xc')](_0x5d57f4);if(_0x456298){logger[_0x42e5('0x8')](_0x456298);return _0x197752(_0x456298);}return _0x2fa2f0(_0x28b3b3);});});}exports[_0x42e5('0xd')]=function(_0x144fb4,_0x1faafc){return pm2[_0x42e5('0xe')]()[_0x42e5('0xf')](function(_0x447648){if(_0x447648){var _0x23957f=_['reject'](_0x447648,function(_0x3b3dd9){return _0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x10')||_0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x11');});return{'rows':_0x23957f,'count':_0x23957f[_0x42e5('0x12')]};}return null;})[_0x42e5('0xf')](respondWithResult(_0x1faafc,null))[_0x42e5('0x13')](handleError(_0x1faafc,null));};exports[_0x42e5('0x14')]=function(_0x3c7b79,_0x22655f){return pm2[_0x42e5('0x15')](_0x3c7b79[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x22655f,null))['then'](handleEntityNotFound(_0x22655f,null))[_0x42e5('0x13')](handleError(_0x22655f,null));};exports['create']=function(_0x5f4428,_0x14d16d){if(_0x5f4428[_0x42e5('0x17')]['name']&&_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]){var _0x1c2169=path[_0x42e5('0x19')](__dirname,_0x42e5('0x1a'),_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]);var _0x58eee5=process['cwd']();process[_0x42e5('0x1b')](path['dirname'](_0x1c2169));return execChildProcess()[_0x42e5('0xf')](function(_0x2e9574){process[_0x42e5('0x1b')](_0x58eee5);return pm2[_0x42e5('0x1c')]({'name':_0x5f4428[_0x42e5('0x17')]['name'],'script':_0x1c2169});})[_0x42e5('0xf')](function(_0xf29221){pm2[_0x42e5('0x1d')]();return _0xf29221[0x0];})[_0x42e5('0xf')](respondWithResult(_0x14d16d,0xc9))[_0x42e5('0x13')](handleError(_0x14d16d,null));}else{return _0x14d16d['status'](0x1f4)['send']({'message':_0x42e5('0x1e')});}};exports['update']=function(_0x56f812,_0x1b60be){if(_0x56f812['body']['id']){delete _0x56f812[_0x42e5('0x17')]['id'];}var _0x2d9e65={'online':_0x42e5('0x1f'),'stopped':_0x42e5('0x20')};if(_0x2d9e65[_0x42e5('0x21')](_0x56f812[_0x42e5('0x17')]['status'])){return pm2[_0x2d9e65[_0x56f812[_0x42e5('0x17')][_0x42e5('0x7')]]](_0x56f812[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x1b60be,0xc8))[_0x42e5('0x13')](handleError(_0x1b60be,null));}else{return _0x1b60be[_0x42e5('0x7')](0x1f4)[_0x42e5('0xb')]({'message':_0x42e5('0x22')});}};exports[_0x42e5('0x23')]=function(_0x2ba9ef,_0x2c7542){if(_0x2ba9ef[_0x42e5('0x17')]['id']){delete _0x2ba9ef[_0x42e5('0x17')]['id'];}if(_0x2ba9ef['params']['id']){return pm2[_0x42e5('0x24')](_0x2ba9ef[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](function(_0x156e73){pm2['dump']();return _0x156e73[0x0];})['then'](respondWithResult(_0x2c7542,null))[_0x42e5('0x13')](handleError(_0x2c7542,null));}else{return _0x2c7542['status'](0x1f4)[_0x42e5('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2547=['express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','delete','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','index','list','then','reject'];(function(_0xe31ec2,_0x556e37){var _0x344180=function(_0x2f4d66){while(--_0x2f4d66){_0xe31ec2['push'](_0xe31ec2['shift']());}};_0x344180(++_0x556e37);}(_0x2547,0x1cd));var _0x7254=function(_0x3d0613,_0x3dea5e){_0x3d0613=_0x3d0613-0x0;var _0x528544=_0x2547[_0x3d0613];return _0x528544;};'use strict';var _=require('lodash');var pm2=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var path=require(_0x7254('0x3'));var exec=require(_0x7254('0x4'))[_0x7254('0x5')];var BPromise=require(_0x7254('0x6'));function handleEntityNotFound(_0x265ebf,_0x53a02f){return function(_0x2ddeae){if(!_0x2ddeae){_0x265ebf[_0x7254('0x7')](0x194);;}return _0x2ddeae;};}function respondWithResult(_0x67f427,_0x119f66){_0x119f66=_0x119f66||0xc8;return function(_0x4b845f){if(_0x4b845f){return _0x67f427[_0x7254('0x8')](_0x119f66)[_0x7254('0x9')](_0x4b845f);}return null;};}function handleError(_0x395913,_0x5da1ec){_0x5da1ec=_0x5da1ec||0x1f4;return function(_0x2a2f82){logger['error'](_0x2a2f82['stack']);if(_0x2a2f82['name']){delete _0x2a2f82[_0x7254('0xa')];}_0x395913[_0x7254('0x8')](_0x5da1ec)[_0x7254('0xb')](_0x2a2f82);};}function execChildProcess(){return new BPromise(function(_0x310c21,_0x6828b6){exec(_0x7254('0xc'),function(_0x4d19e8,_0x3275bd,_0x5ec311){logger[_0x7254('0xd')](_0x3275bd);logger['info'](_0x5ec311);if(_0x4d19e8){logger[_0x7254('0xe')](_0x4d19e8);return _0x6828b6(_0x4d19e8);}return _0x310c21(_0x3275bd);});});}exports[_0x7254('0xf')]=function(_0x348d4e,_0x120780){return pm2[_0x7254('0x10')]()[_0x7254('0x11')](function(_0x124192){if(_0x124192){var _0x21cecc=_[_0x7254('0x12')](_0x124192,function(_0x362a1){return _0x362a1[_0x7254('0xa')]===_0x7254('0x13')||_0x362a1[_0x7254('0xa')]==='motion2';});return{'rows':_0x21cecc,'count':_0x21cecc[_0x7254('0x14')]};}return null;})[_0x7254('0x11')](respondWithResult(_0x120780,null))[_0x7254('0x15')](handleError(_0x120780,null));};exports[_0x7254('0x16')]=function(_0x3b5f06,_0x1e4aff){return pm2[_0x7254('0x17')](_0x3b5f06['params']['id'])[_0x7254('0x11')](respondWithResult(_0x1e4aff,null))[_0x7254('0x11')](handleEntityNotFound(_0x1e4aff,null))[_0x7254('0x15')](handleError(_0x1e4aff,null));};exports[_0x7254('0x18')]=function(_0x2a1ddc,_0x301f00){if(_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')]&&_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]){var _0x2594b8=path[_0x7254('0x1b')](__dirname,_0x7254('0x1c'),_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]);var _0x95ceaa=process[_0x7254('0x1d')]();process[_0x7254('0x1e')](path[_0x7254('0x1f')](_0x2594b8));return execChildProcess()[_0x7254('0x11')](function(_0x1be69b){process['chdir'](_0x95ceaa);return pm2['start']({'name':_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')],'script':_0x2594b8});})[_0x7254('0x11')](function(_0x54dace){pm2[_0x7254('0x20')]();return _0x54dace[0x0];})[_0x7254('0x11')](respondWithResult(_0x301f00,0xc9))[_0x7254('0x15')](handleError(_0x301f00,null));}else{return _0x301f00['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x21')});}};exports[_0x7254('0x22')]=function(_0x494cdb,_0x3c22d0){if(_0x494cdb['body']['id']){delete _0x494cdb[_0x7254('0x19')]['id'];}var _0x134a9e={'online':'restart','stopped':_0x7254('0x23')};if(_0x134a9e[_0x7254('0x24')](_0x494cdb['body'][_0x7254('0x8')])){return pm2[_0x134a9e[_0x494cdb[_0x7254('0x19')][_0x7254('0x8')]]](_0x494cdb[_0x7254('0x25')]['id'])[_0x7254('0x11')](respondWithResult(_0x3c22d0,0xc8))[_0x7254('0x15')](handleError(_0x3c22d0,null));}else{return _0x3c22d0['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x26')});}};exports['destroy']=function(_0x2f75ea,_0x1279cd){if(_0x2f75ea[_0x7254('0x19')]['id']){delete _0x2f75ea['body']['id'];}if(_0x2f75ea[_0x7254('0x25')]['id']){return pm2[_0x7254('0x27')](_0x2f75ea[_0x7254('0x25')]['id'])[_0x7254('0x11')](function(_0x40a137){pm2[_0x7254('0x20')]();return _0x40a137[0x0];})[_0x7254('0x11')](respondWithResult(_0x1279cd,null))['catch'](handleError(_0x1279cd,null));}else{return _0x1279cd[_0x7254('0x8')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 40245fe..549f9fc 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 _0x9b4d=['exports','express','Router','../../components/auth/service','get','isAuthenticated','/queues','getQueues'];(function(_0x1ef607,_0x3cb96e){var _0x1d2230=function(_0x15eeac){while(--_0x15eeac){_0x1ef607['push'](_0x1ef607['shift']());}};_0x1d2230(++_0x3cb96e);}(_0x9b4d,0x1b9));var _0xd9b4=function(_0x4559d6,_0x21ff92){_0x4559d6=_0x4559d6-0x0;var _0x3b77ae=_0x9b4d[_0x4559d6];return _0x3b77ae;};'use strict';var express=require(_0xd9b4('0x0'));var router=express[_0xd9b4('0x1')]();var auth=require(_0xd9b4('0x2'));var controller=require('./realtime.controller');router[_0xd9b4('0x3')]('/agents',auth[_0xd9b4('0x4')](),controller['getAgents']);router[_0xd9b4('0x3')](_0xd9b4('0x5'),auth[_0xd9b4('0x4')](),controller[_0xd9b4('0x6')]);module[_0xd9b4('0x7')]=router; \ No newline at end of file +var _0xdfb0=['/agents','isAuthenticated','getAgents','getQueues','express','./realtime.controller','get'];(function(_0x2ff38f,_0xefceba){var _0x19a75f=function(_0x22c3b1){while(--_0x22c3b1){_0x2ff38f['push'](_0x2ff38f['shift']());}};_0x19a75f(++_0xefceba);}(_0xdfb0,0xeb));var _0x0dfb=function(_0x1c7116,_0x45bdd9){_0x1c7116=_0x1c7116-0x0;var _0x1c226e=_0xdfb0[_0x1c7116];return _0x1c226e;};'use strict';var express=require(_0x0dfb('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0dfb('0x1'));router[_0x0dfb('0x2')](_0x0dfb('0x3'),auth[_0x0dfb('0x4')](),controller[_0x0dfb('0x5')]);router[_0x0dfb('0x2')]('/queues',auth[_0x0dfb('0x4')](),controller[_0x0dfb('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index a29ca57..0fdb042 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 _0x1623=['raw','user','userProfileId','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','whatsapp','channel','Invalid\x20channel','toLowerCase','type','QueueCampaigns','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','name','request','then','result','Agents','merge','catch','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','outbound','push','pTalking','originated','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','get','loggedInDb','talking','busy','find','pick','filter','queue','some','connectedlinenum','internal','getMembers','UserId','accountcode','paused','voiceStatus','online','agents','User','startCase','Queue','Pause','QueueId','length','idle','unknown','unavailable','ringing','isNil','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','voicePause','pause','every','chatStatus','faxStatus','whatsappStatus','*pause','userpic','lastPauseAt','pauseType','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','map','rawAttributes','fieldName','key','query','role','agent','getOptions'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x1623,0xab));var _0x3162=function(_0x48f6a8,_0x45314d){_0x48f6a8=_0x48f6a8-0x0;var _0x4094b7=_0x1623[_0x48f6a8];return _0x4094b7;};'use strict';var util=require(_0x3162('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require(_0x3162('0x1'));var logger=require(_0x3162('0x2'))(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var amiClient=jayson[_0x3162('0x5')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x3162('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x4b77c4,_0x1b55f2){return function(_0x428de6){if(_0x428de6){var _0x53260d=typeof _0x1b55f2[_0x3162('0x7')]===_0x3162('0x8')&&typeof _0x1b55f2[_0x3162('0x9')]===_0x3162('0x8');var _0x10d684=_0x428de6[_0x3162('0xa')];var _0xe43099=_0x53260d?0x0:_0x1b55f2[_0x3162('0x7')];var _0x4bde10=_0x53260d?_0x428de6['count']:_0x1b55f2[_0x3162('0x7')]+_0x1b55f2[_0x3162('0x9')];var _0x1c3772;if(_0x4bde10>=_0x10d684){_0x4bde10=_0x10d684;_0x1c3772=0xc8;}else{_0x1c3772=0xce;}_0x4b77c4[_0x3162('0xb')](_0x1c3772);return _0x4b77c4[_0x3162('0xc')](_0x3162('0xd'),_0xe43099+'-'+_0x4bde10+'/'+_0x10d684)[_0x3162('0xe')](_0x428de6);}return null;};}function handleError(_0x38da60,_0x157ab8){_0x157ab8=_0x157ab8||0x1f4;return function(_0x4c3625){logger[_0x3162('0xf')](_0x4c3625['stack']);if(_0x4c3625[_0x3162('0x10')]){delete _0x4c3625[_0x3162('0x10')];}_0x38da60['status'](_0x157ab8)['send'](_0x4c3625);};}function getRealtimeAgents(){return new Promise(function(_0x198764,_0x2bb738){return amiClient[_0x3162('0x11')]('Agents',{})[_0x3162('0x12')](function(_0x3d0bea){if(_0x3d0bea[_0x3162('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x78a56c=_0x3d0bea[_0x3162('0x13')];return routingClient[_0x3162('0x11')](_0x3162('0x14'),{})[_0x3162('0x12')](function(_0x1eed46){if(_0x1eed46[_0x3162('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x42f283=_0x1eed46[_0x3162('0x13')];return _0x198764(_[_0x3162('0x15')]({},_0x78a56c,_0x42f283));});})[_0x3162('0x16')](function(_0x491144){_0x2bb738(_0x491144);});});}function getRealtimeQueues(_0x1dfd5c,_0x5a5141){return new Promise(function(_0x4ab3e8,_0xa5c62b){var _0x3e4d23=_0x5a5141===_0x3162('0x17')?amiClient:routingClient;return _0x3e4d23['request'](_['startCase'](_0x5a5141)+_0x3162('0x18'),_0x1dfd5c)[_0x3162('0x12')](function(_0x32c051){if(_0x32c051[_0x3162('0xf')])throw new Error(util[_0x3162('0x19')](_0x3162('0x1a'),_0x5a5141));return _0x4ab3e8(_0x32c051[_0x3162('0x13')]);})[_0x3162('0x16')](function(_0x5a4994){_0xa5c62b(_0x5a4994);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xd283d6,_0x2433f8){return amiClient[_0x3162('0x11')](_0x3162('0x1b'),{})[_0x3162('0x12')](function(_0x3c543e){if(_0x3c543e[_0x3162('0xf')])throw new Error(_0x3162('0x1c'));return _0xd283d6(_0x3c543e[_0x3162('0x13')]);})[_0x3162('0x16')](function(_0x8fa09f){_0x2433f8(_0x8fa09f);});});}function initializeQueues(_0x2f62d7,_0x1c03a4,_0x48de45,_0x4025c3){var _0x552469=[_0x3162('0x1d'),_0x3162('0x1e'),_0x3162('0x1f'),'talking','paused'];if(_0x48de45===_0x3162('0x17')&&_0x4025c3===_0x3162('0x20')){_0x552469[_0x3162('0x21')](_0x3162('0x22'),_0x3162('0x23'),'message',_0x3162('0x24'),'dialMethod',_0x3162('0x25'),_0x3162('0x26'),_0x3162('0x27'),_0x3162('0x28'),_0x3162('0x29'),_0x3162('0x2a'),_0x3162('0x2b'),_0x3162('0x2c'),'dialPredictiveIntervalMaxThreshold',_0x3162('0x2d'),_0x3162('0x2e'),'predictiveIntervalTotalCalls',_0x3162('0x2f'),_0x3162('0x30'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x3162('0x31'));}return _0x2f62d7['map'](function(_0x266aab){var _0x47241c=_0x266aab[_0x3162('0x32')]({'plain':!![]});_0x47241c['agents']=[];_0x47241c['paused']=0x0;_0x47241c[_0x3162('0x33')]=0x0;_0x47241c[_0x3162('0x1d')]=0x0;_0x47241c['available']=0x0;_0x47241c[_0x3162('0x1f')]=0x0;if(_0x48de45==='voice'){_0x47241c[_0x3162('0x34')]=0x0;_0x47241c[_0x3162('0x35')]=0x0;if(_0x4025c3===_0x3162('0x20')){_0x47241c[_0x3162('0x22')]=0x0;_0x47241c[_0x3162('0x23')]=0x0;}}var _0x3b6c91=_[_0x3162('0x36')](_0x1c03a4,['id',_0x47241c['id']]);if(_0x3b6c91)_[_0x3162('0x15')](_0x47241c,_[_0x3162('0x37')](_0x3b6c91,_0x552469));return _0x47241c;});}function updateAgentVoiceStatus(_0x16c5d6,_0x3fc06f,_0x5c39d9){var _0x149571=_[_0x3162('0x38')](_0x5c39d9,[_0x3162('0x39'),_0x3fc06f['name']]);if(_0x149571['length']===0x0)return _0x16c5d6[_0x3162('0x35')]=!![];if(_[_0x3162('0x3a')](_0x149571,[_0x3162('0x3b'),_0x16c5d6[_0x3162('0x3c')]['toString']()]))return _0x16c5d6[_0x3162('0x34')]=!![];if(!_0x16c5d6['talking'])return _0x16c5d6['busy']=!![];}function getVoiceQueueAgents(_0x5dee49,_0x298ed7,_0x3fe4d2,_0x315fdb){var _0x49829f=_[_0x3162('0x36')](_0x298ed7,['id',_0x5dee49['id']]);if(!_0x49829f)return _0x5dee49;return _0x49829f[_0x3162('0x3d')]({'raw':!![]})[_0x3162('0x12')](function(_0x369d33){for(var _0x1e8d5e=0x0;_0x1e8d5e<_0x369d33['length'];_0x1e8d5e++){var _0x5447d6=_[_0x3162('0x36')](_0x3fe4d2,['id',_0x369d33[_0x1e8d5e][_0x3162('0x3e')]]);if(!_0x5447d6){_0x5447d6={'id':_0x369d33[_0x1e8d5e]['UserId'],'name':_0x369d33[_0x1e8d5e]['UserId'],'accountcode':'','online':![]};}var _0x43f780={'id':_0x5447d6['id'],'name':_0x5447d6[_0x3162('0x10')],'internal':_0x5447d6[_0x3162('0x3f')],'online':Boolean(_0x5447d6['online']),'paused':Boolean(_0x369d33[_0x1e8d5e][_0x3162('0x40')])};if(_0x5447d6[_0x3162('0x41')]===_0x3162('0x34'))updateAgentVoiceStatus(_0x43f780,_0x5dee49,_0x315fdb);if(_0x43f780[_0x3162('0x42')])_0x5dee49['loggedInDb']++;if(_0x43f780[_0x3162('0x35')])_0x5dee49[_0x3162('0x35')]++;if(_0x43f780['paused']&&!_0x43f780[_0x3162('0x35')]&&!_0x43f780[_0x3162('0x34')])_0x5dee49['paused']++;_0x5dee49[_0x3162('0x43')][_0x3162('0x21')](_0x43f780);}return _0x5dee49;});}function getQueueAgents(_0x59f75d,_0x117775,_0x555d33){var _0x4146f1=_0x3162('0x44')+_[_0x3162('0x45')](_0x555d33)+_0x3162('0x46');var _0x1bdc10=_0x555d33+_0x3162('0x47');return db[_0x4146f1]['findAll']({'where':{[_[_0x3162('0x45')](_0x555d33)+_0x3162('0x48')]:_0x59f75d['id']},'raw':!![]})[_0x3162('0x12')](function(_0x48832d){for(var _0x3bc8d9=0x0;_0x3bc8d9<_0x48832d[_0x3162('0x49')];_0x3bc8d9++){var _0x4a9cc9=_[_0x3162('0x36')](_0x117775,['id',_0x48832d[_0x3bc8d9]['UserId']]);if(!_0x4a9cc9){_0x4a9cc9={'id':_0x48832d[_0x3bc8d9]['UserId'],'name':_0x48832d[_0x3bc8d9]['UserId'],'online':![],['pauseField']:![]};}var _0x1a4bcf={'id':_0x4a9cc9['id'],'name':_0x4a9cc9[_0x3162('0x10')],'online':Boolean(_0x4a9cc9[_0x3162('0x42')]),'paused':Boolean(_0x4a9cc9[_0x1bdc10])};if(_0x1a4bcf[_0x3162('0x42')])_0x59f75d[_0x3162('0x33')]++;_0x59f75d[_0x3162('0x43')][_0x3162('0x21')](_0x1a4bcf);}return _0x59f75d;});}function isIdle(_0x1b363f){return _0x1b363f===_0x3162('0x4a')||_0x1b363f===_0x3162('0x4b')||_0x1b363f===_0x3162('0x4c')||_0x1b363f===_0x3162('0x4d')||_[_0x3162('0x4e')](_0x1b363f);}function isAgentPaused(_0x56f9bf,_0x3ac940){var _0x48cb8f=[_0x56f9bf['chatPause'],_0x56f9bf[_0x3162('0x4f')],_0x56f9bf[_0x3162('0x50')],_0x56f9bf[_0x3162('0x51')],_0x56f9bf[_0x3162('0x52')],_0x56f9bf['voicePause'],_0x56f9bf[_0x3162('0x53')]];if(!_0x3ac940)return _['every'](_0x48cb8f);var _0xa11c6e=_[_0x3162('0x38')](_0x48cb8f);return _0xa11c6e['length']>0x0&&_0xa11c6e[_0x3162('0x49')]<_0x48cb8f['length']?!![]:![];}function isAgentIdle(_0x516599){if(_0x516599[_0x3162('0x41')]!==_0x3162('0x4a')&&_0x516599[_0x3162('0x54')]){_0x516599[_0x3162('0x41')]=_0x3162('0x55');return![];}return _[_0x3162('0x56')]([_0x516599[_0x3162('0x57')],_0x516599[_0x3162('0x58')],_0x516599['mailStatus'],_0x516599['openchannelStatus'],_0x516599['smsStatus'],_0x516599[_0x3162('0x41')],_0x516599[_0x3162('0x59')]],isIdle);}function getAgentStatus(_0x87de12){var _0x46141d=_0x3162('0x4b');if(isAgentPaused(_0x87de12))_0x46141d=_0x3162('0x55');else if(isAgentPaused(_0x87de12,!![]))_0x46141d=_0x3162('0x5a');else if(isAgentIdle(_0x87de12))_0x46141d='idle';else _0x46141d=_0x3162('0x35');return _0x46141d;}exports['getAgents']=function(_0x3c85e6,_0x4971d1){var _0x283eeb={'count':0x0,'rows':[]},_0x580a75={},_0x1a7165,_0xd6b792,_0x554a8f=[_0x3162('0x5b'),_0x3162('0x42'),'lastLoginAt',_0x3162('0x5c'),_0x3162('0x5d'),_0x3162('0x5c'),_0x3162('0x3c'),_0x3162('0x5e'),'chatPause',_0x3162('0x51'),_0x3162('0x50'),'smsPause','whatsappPause',_0x3162('0x4f'),_0x3162('0x54'),_0x3162('0x5f'),'openchannelCapacity',_0x3162('0x60'),_0x3162('0x61'),_0x3162('0x62'),_0x3162('0x63'),'chatCurrentCapacity',_0x3162('0x64'),_0x3162('0x65'),'smsCurrentCapacity',_0x3162('0x66'),'faxCurrentCapacity',_0x3162('0x57'),_0x3162('0x67'),_0x3162('0x68'),'smsStatus',_0x3162('0x59'),_0x3162('0x58'),_0x3162('0x41'),_0x3162('0x69'),_0x3162('0x6a'),_0x3162('0x6b'),'smsStatusTime','whatsappStatusTime','faxStatusTime',_0x3162('0x6c'),'queue',_0x3162('0x6d'),_0x3162('0x6e'),_0x3162('0x6f'),_0x3162('0x70'),_0x3162('0x71')],_0x51fab3=['chatPause','openchannelPause',_0x3162('0x50'),_0x3162('0x52'),'whatsappPause',_0x3162('0x4f'),_0x3162('0x54'),_0x3162('0x42')];Promise[_0x3162('0x72')]()[_0x3162('0x12')](function(){var _0x4fdcec=_[_0x3162('0x73')](db[_0x3162('0x44')][_0x3162('0x74')],function(_0x28f891){return{'name':_0x28f891[_0x3162('0x75')],'type':_0x28f891['type'][_0x3162('0x76')]};});_0x3c85e6[_0x3162('0x77')][_0x3162('0x78')]=_0x3162('0x79');_0x3c85e6['query'][_0x3162('0x42')]=!![];_0x580a75=qs[_0x3162('0x7a')](_0x4fdcec,_0x3c85e6);_0x580a75[_0x3162('0x7b')]=!![];if(_0x3c85e6[_0x3162('0x7c')][_0x3162('0x78')]===_0x3162('0x7c')){var _0xbc75f={'params':{'id':_0x3c85e6[_0x3162('0x7c')][_0x3162('0x7d')]},'query':{'section':_0x3162('0x14'),'role':'agent','online':!![],'nolimit':_0x3c85e6[_0x3162('0x77')][_0x3162('0x7e')],'sort':_0x3c85e6['query'][_0x3162('0x7f')],'filter':_0x3c85e6['query'][_0x3162('0x38')],'raw':!![]}};return db[_0x3162('0x80')][_0x3162('0x81')](_0xbc75f);}return db[_0x3162('0x44')][_0x3162('0x82')](_0x580a75);})[_0x3162('0x12')](function(_0x5918f2){_0x283eeb[_0x3162('0xa')]=_0x5918f2[_0x3162('0xa')];_0x1a7165=_0x5918f2[_0x3162('0x83')];return getRealtimeAgents();})[_0x3162('0x12')](function(_0x3147a8){_0xd6b792=_0x3147a8[_0x3162('0x83')];return _0x1a7165['map'](function(_0x2a3e33){var _0x111952=_[_0x3162('0x36')](_0xd6b792,['id',_0x2a3e33['id']]);if(_0x111952)_[_0x3162('0x15')](_0x2a3e33,_[_0x3162('0x37')](_[_0x3162('0x84')](_0x111952,_0x51fab3),_0x554a8f));_0x2a3e33[_0x3162('0x85')]=getAgentStatus(_0x2a3e33);return _0x2a3e33;});})['then'](function(_0x57200f){if(_0x3c85e6['query'][_0x3162('0x86')]){var _0x3b4afd=_['filter'](_0x57200f,[_0x3162('0x85'),_0x3c85e6[_0x3162('0x77')][_0x3162('0x86')]]);if(_0x3c85e6[_0x3162('0x77')]['pauseTypeFilter']){_0x3b4afd=_[_0x3162('0x38')](_0x3b4afd,[_0x3162('0x5d'),_0x3c85e6['query'][_0x3162('0x87')]]);}}_0x283eeb['rows']=_0x3b4afd||_0x57200f;return _0x283eeb;})[_0x3162('0x12')](respondWithFilteredResult(_0x4971d1,_0x580a75))['catch'](handleError(_0x4971d1,null));};exports[_0x3162('0x88')]=function(_0x58e47e,_0x1dc930){var _0x2d62db=[_0x3162('0x89'),_0x3162('0x8a'),_0x3162('0x8b'),_0x3162('0x8c'),'fax',_0x3162('0x8d'),_0x3162('0x17')];var _0x40110d={'count':0x0,'rows':[]},_0x4b3971={},_0x31803e,_0x3685f2,_0x2d2f69,_0x15940e,_0x2e6124;Promise['resolve']()[_0x3162('0x12')](function(){if(_0x58e47e[_0x3162('0x77')]['channel']){if(!_['includes'](_0x2d62db,_0x58e47e[_0x3162('0x77')][_0x3162('0x8e')]['toLowerCase']()))throw new Error(_0x3162('0x8f'));_0x31803e=_0x58e47e[_0x3162('0x77')][_0x3162('0x8e')][_0x3162('0x90')]();}var _0xdc502b=_[_0x3162('0x45')](_0x31803e)+_0x3162('0x46');var _0x3da74a=_[_0x3162('0x73')](db[_0xdc502b]['rawAttributes'],function(_0x48fc50){return{'name':_0x48fc50[_0x3162('0x75')],'type':_0x48fc50[_0x3162('0x91')]['key']};});_0x4b3971=qs[_0x3162('0x7a')](_0x3da74a,_0x58e47e);if(_0x58e47e['user']['role']==='user'){var _0x31981a={'params':{'id':_0x58e47e['user'][_0x3162('0x7d')]},'query':{'section':_0x31803e===_0x3162('0x17')&&_0x58e47e[_0x3162('0x77')][_0x3162('0x91')]===_0x3162('0x20')?_0x3162('0x92'):_[_0x3162('0x45')](_0x31803e)+_0x3162('0x18'),'type':_0x58e47e[_0x3162('0x77')][_0x3162('0x91')],'nolimit':!![],'sort':_0x3162('0x10'),'filter':_0x58e47e['query'][_0x3162('0x38')]}};return db[_0x3162('0x80')][_0x3162('0x81')](_0x31981a);}return db[_0xdc502b][_0x3162('0x82')](_0x4b3971);})[_0x3162('0x12')](function(_0xa463ad){_0x40110d[_0x3162('0xa')]=_0xa463ad[_0x3162('0xa')];_0x3685f2=_0xa463ad[_0x3162('0x83')];return getRealtimeQueues(_0x58e47e,_0x31803e);})[_0x3162('0x12')](function(_0x1d242f){_0x15940e=_0x1d242f[_0x3162('0x83')];return getRealtimeAgents();})['then'](function(_0x22bfb6){_0x2d2f69=_0x22bfb6[_0x3162('0x83')];if(_0x31803e!=_0x3162('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3d7bd1){_0x2e6124=_0x3d7bd1?_0x3d7bd1['rows']:[];return initializeQueues(_0x3685f2,_0x15940e,_0x31803e,_0x58e47e[_0x3162('0x77')][_0x3162('0x91')]);})['then'](function(_0x5e4321){var _0x246d90=_0x5e4321[_0x3162('0x73')](function(_0x4da601){if(_0x31803e===_0x3162('0x17'))return getVoiceQueueAgents(_0x4da601,_0x3685f2,_0x2d2f69,_0x2e6124);else return getQueueAgents(_0x4da601,_0x2d2f69,_0x31803e);});return Promise['all'](_0x246d90);})[_0x3162('0x12')](function(_0x3421a3){_0x40110d[_0x3162('0x83')]=_0x3421a3;return _0x40110d;})[_0x3162('0x12')](respondWithFilteredResult(_0x1dc930,_0x4b3971))[_0x3162('0x16')](handleError(_0x1dc930,null));}; \ No newline at end of file +var _0xdc97=['mailCurrentCapacity','smsCurrentCapacity','smsStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','type','key','query','getOptions','raw','user','role','agent','sort','UserProfile','findAndCountAll','rows','pick','globalStatusFilter','globalStatus','pauseTypeFilter','chat','fax','whatsapp','toLowerCase','Invalid\x20channel','channel','QueueCampaigns','Queues','getResources','all','util','lodash','jayson/promise','../../config/logger','../../mysqldb','client','http','limit','undefined','count','offset','status','set','error','name','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','queue','length','some','connectedlinenum','internal','toString','UserId','accountcode','voiceStatus','User','startCase','Queue','Pause','findAll','online','idle','unknown','unavailable','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','pause','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity'];(function(_0x679a3c,_0x5c80d6){var _0x173403=function(_0xda2a59){while(--_0xda2a59){_0x679a3c['push'](_0x679a3c['shift']());}};_0x173403(++_0x5c80d6);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4009f7,_0x5e835b){_0x4009f7=_0x4009f7-0x0;var _0x4f4172=_0xdc97[_0x4009f7];return _0x4f4172;};'use strict';var util=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var jayson=require(_0x7dc9('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7dc9('0x3'))('api');var db=require(_0x7dc9('0x4'))['db'];var amiClient=jayson[_0x7dc9('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0x7dc9('0x5')][_0x7dc9('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xb15a0b,_0x3ba3ca){return function(_0x589f02){if(_0x589f02){var _0x2636ef=typeof _0x3ba3ca['offset']==='undefined'&&typeof _0x3ba3ca[_0x7dc9('0x7')]===_0x7dc9('0x8');var _0x3318ea=_0x589f02[_0x7dc9('0x9')];var _0x3dd07e=_0x2636ef?0x0:_0x3ba3ca['offset'];var _0xb2fa2a=_0x2636ef?_0x589f02[_0x7dc9('0x9')]:_0x3ba3ca[_0x7dc9('0xa')]+_0x3ba3ca[_0x7dc9('0x7')];var _0x359c88;if(_0xb2fa2a>=_0x3318ea){_0xb2fa2a=_0x3318ea;_0x359c88=0xc8;}else{_0x359c88=0xce;}_0xb15a0b[_0x7dc9('0xb')](_0x359c88);return _0xb15a0b[_0x7dc9('0xc')]('Content-Range',_0x3dd07e+'-'+_0xb2fa2a+'/'+_0x3318ea)['json'](_0x589f02);}return null;};}function handleError(_0x4be1c8,_0x599ef1){_0x599ef1=_0x599ef1||0x1f4;return function(_0x94c75a){logger[_0x7dc9('0xd')](_0x94c75a['stack']);if(_0x94c75a[_0x7dc9('0xe')]){delete _0x94c75a[_0x7dc9('0xe')];}_0x4be1c8[_0x7dc9('0xb')](_0x599ef1)[_0x7dc9('0xf')](_0x94c75a);};}function getRealtimeAgents(){return new Promise(function(_0x31d43d,_0x11af93){return amiClient['request'](_0x7dc9('0x10'),{})[_0x7dc9('0x11')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0xd')])throw new Error(_0x7dc9('0x12'));var _0xbe0437=_0x1b0aa1[_0x7dc9('0x13')];return routingClient[_0x7dc9('0x14')](_0x7dc9('0x10'),{})['then'](function(_0x22577e){if(_0x22577e['error'])throw new Error(_0x7dc9('0x15'));var _0x1cc237=_0x22577e['result'];return _0x31d43d(_[_0x7dc9('0x16')]({},_0xbe0437,_0x1cc237));});})[_0x7dc9('0x17')](function(_0x12f08d){_0x11af93(_0x12f08d);});});}function getRealtimeQueues(_0x4b2703,_0x43ec33){return new Promise(function(_0x184bfd,_0x2dad65){var _0x2895f5=_0x43ec33===_0x7dc9('0x18')?amiClient:routingClient;return _0x2895f5[_0x7dc9('0x14')](_['startCase'](_0x43ec33)+'Queues',_0x4b2703)[_0x7dc9('0x11')](function(_0x5981e2){if(_0x5981e2['error'])throw new Error(util[_0x7dc9('0x19')](_0x7dc9('0x1a'),_0x43ec33));return _0x184bfd(_0x5981e2['result']);})[_0x7dc9('0x17')](function(_0x43d31f){_0x2dad65(_0x43d31f);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x41110a,_0x4906b1){return amiClient[_0x7dc9('0x14')](_0x7dc9('0x1b'),{})[_0x7dc9('0x11')](function(_0x55a482){if(_0x55a482['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x41110a(_0x55a482[_0x7dc9('0x13')]);})[_0x7dc9('0x17')](function(_0x5843bf){_0x4906b1(_0x5843bf);});});}function initializeQueues(_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb){var _0x1c690b=[_0x7dc9('0x1c'),_0x7dc9('0x1d'),_0x7dc9('0x1e'),_0x7dc9('0x1f'),_0x7dc9('0x20')];if(_0x5afb7d===_0x7dc9('0x18')&&_0x2d22eb===_0x7dc9('0x21')){_0x1c690b[_0x7dc9('0x22')](_0x7dc9('0x23'),_0x7dc9('0x24'),'message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond',_0x7dc9('0x25'),_0x7dc9('0x26'),_0x7dc9('0x27'),_0x7dc9('0x28'),_0x7dc9('0x29'),_0x7dc9('0x2a'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x7dc9('0x2b'),'predictiveIntervalAvgHoldtime',_0x7dc9('0x2c'));}return _0x585eef[_0x7dc9('0x2d')](function(_0x1298f9){var _0x213066=_0x1298f9[_0x7dc9('0x2e')]({'plain':!![]});_0x213066[_0x7dc9('0x2f')]=[];_0x213066[_0x7dc9('0x20')]=0x0;_0x213066[_0x7dc9('0x30')]=0x0;_0x213066['loggedIn']=0x0;_0x213066[_0x7dc9('0x1d')]=0x0;_0x213066['waiting']=0x0;if(_0x5afb7d===_0x7dc9('0x18')){_0x213066[_0x7dc9('0x1f')]=0x0;_0x213066[_0x7dc9('0x31')]=0x0;if(_0x2d22eb===_0x7dc9('0x21')){_0x213066['pTalking']=0x0;_0x213066[_0x7dc9('0x24')]=0x0;}}var _0x47fb58=_[_0x7dc9('0x32')](_0x47771b,['id',_0x213066['id']]);if(_0x47fb58)_['merge'](_0x213066,_['pick'](_0x47fb58,_0x1c690b));return _0x213066;});}function updateAgentVoiceStatus(_0x265a5f,_0x45fd54,_0x21e036){var _0x30bb6d=_['filter'](_0x21e036,[_0x7dc9('0x33'),_0x45fd54[_0x7dc9('0xe')]]);if(_0x30bb6d[_0x7dc9('0x34')]===0x0)return _0x265a5f[_0x7dc9('0x31')]=!![];if(_[_0x7dc9('0x35')](_0x30bb6d,[_0x7dc9('0x36'),_0x265a5f[_0x7dc9('0x37')][_0x7dc9('0x38')]()]))return _0x265a5f[_0x7dc9('0x1f')]=!![];if(!_0x265a5f[_0x7dc9('0x1f')])return _0x265a5f[_0x7dc9('0x31')]=!![];}function getVoiceQueueAgents(_0x3a8d80,_0x5a94b5,_0x34b5c9,_0x7cdd8d){var _0x466b02=_[_0x7dc9('0x32')](_0x5a94b5,['id',_0x3a8d80['id']]);if(!_0x466b02)return _0x3a8d80;return _0x466b02['getMembers']({'raw':!![]})[_0x7dc9('0x11')](function(_0x89db0e){for(var _0x255801=0x0;_0x255801<_0x89db0e[_0x7dc9('0x34')];_0x255801++){var _0x295853=_[_0x7dc9('0x32')](_0x34b5c9,['id',_0x89db0e[_0x255801]['UserId']]);if(!_0x295853){_0x295853={'id':_0x89db0e[_0x255801]['UserId'],'name':_0x89db0e[_0x255801][_0x7dc9('0x39')],'accountcode':'','online':![]};}var _0x36a965={'id':_0x295853['id'],'name':_0x295853['name'],'internal':_0x295853[_0x7dc9('0x3a')],'online':Boolean(_0x295853['online']),'paused':Boolean(_0x89db0e[_0x255801][_0x7dc9('0x20')])};if(_0x295853[_0x7dc9('0x3b')]===_0x7dc9('0x1f'))updateAgentVoiceStatus(_0x36a965,_0x3a8d80,_0x7cdd8d);if(_0x36a965['online'])_0x3a8d80[_0x7dc9('0x30')]++;if(_0x36a965[_0x7dc9('0x31')])_0x3a8d80[_0x7dc9('0x31')]++;if(_0x36a965[_0x7dc9('0x20')]&&!_0x36a965[_0x7dc9('0x31')]&&!_0x36a965[_0x7dc9('0x1f')])_0x3a8d80[_0x7dc9('0x20')]++;_0x3a8d80['agents'][_0x7dc9('0x22')](_0x36a965);}return _0x3a8d80;});}function getQueueAgents(_0x4f29b2,_0x52d883,_0xcced6c){var _0x294276=_0x7dc9('0x3c')+_[_0x7dc9('0x3d')](_0xcced6c)+_0x7dc9('0x3e');var _0x1bd3a7=_0xcced6c+_0x7dc9('0x3f');return db[_0x294276][_0x7dc9('0x40')]({'where':{[_[_0x7dc9('0x3d')](_0xcced6c)+'QueueId']:_0x4f29b2['id']},'raw':!![]})[_0x7dc9('0x11')](function(_0x1971c7){for(var _0x3c4d4c=0x0;_0x3c4d4c<_0x1971c7[_0x7dc9('0x34')];_0x3c4d4c++){var _0xda202e=_[_0x7dc9('0x32')](_0x52d883,['id',_0x1971c7[_0x3c4d4c]['UserId']]);if(!_0xda202e){_0xda202e={'id':_0x1971c7[_0x3c4d4c][_0x7dc9('0x39')],'name':_0x1971c7[_0x3c4d4c][_0x7dc9('0x39')],'online':![],['pauseField']:![]};}var _0x49bffe={'id':_0xda202e['id'],'name':_0xda202e[_0x7dc9('0xe')],'online':Boolean(_0xda202e[_0x7dc9('0x41')]),'paused':Boolean(_0xda202e[_0x1bd3a7])};if(_0x49bffe[_0x7dc9('0x41')])_0x4f29b2['loggedInDb']++;_0x4f29b2[_0x7dc9('0x2f')]['push'](_0x49bffe);}return _0x4f29b2;});}function isIdle(_0x55826d){return _0x55826d===_0x7dc9('0x42')||_0x55826d===_0x7dc9('0x43')||_0x55826d===_0x7dc9('0x44')||_0x55826d==='ringing'||_['isNil'](_0x55826d);}function isAgentPaused(_0x415ebd,_0x5a817a){var _0xad7278=[_0x415ebd[_0x7dc9('0x45')],_0x415ebd['faxPause'],_0x415ebd[_0x7dc9('0x46')],_0x415ebd[_0x7dc9('0x47')],_0x415ebd[_0x7dc9('0x48')],_0x415ebd[_0x7dc9('0x49')],_0x415ebd[_0x7dc9('0x4a')]];if(!_0x5a817a)return _[_0x7dc9('0x4b')](_0xad7278);var _0x86739f=_[_0x7dc9('0x4c')](_0xad7278);return _0x86739f[_0x7dc9('0x34')]>0x0&&_0x86739f[_0x7dc9('0x34')]<_0xad7278[_0x7dc9('0x34')]?!![]:![];}function isAgentIdle(_0x13580b){if(_0x13580b[_0x7dc9('0x3b')]!=='idle'&&_0x13580b[_0x7dc9('0x49')]){_0x13580b['voiceStatus']='pause';return![];}return _[_0x7dc9('0x4b')]([_0x13580b[_0x7dc9('0x4d')],_0x13580b[_0x7dc9('0x4e')],_0x13580b[_0x7dc9('0x4f')],_0x13580b[_0x7dc9('0x50')],_0x13580b['smsStatus'],_0x13580b[_0x7dc9('0x3b')],_0x13580b[_0x7dc9('0x51')]],isIdle);}function getAgentStatus(_0x34f7b1){var _0x4a9b75=_0x7dc9('0x43');if(isAgentPaused(_0x34f7b1))_0x4a9b75=_0x7dc9('0x52');else if(isAgentPaused(_0x34f7b1,!![]))_0x4a9b75=_0x7dc9('0x53');else if(isAgentIdle(_0x34f7b1))_0x4a9b75=_0x7dc9('0x42');else _0x4a9b75=_0x7dc9('0x31');return _0x4a9b75;}exports[_0x7dc9('0x54')]=function(_0x593132,_0x366b8b){var _0x2ecc80={'count':0x0,'rows':[]},_0x2b0941={},_0x4139e6,_0x877a67,_0x1d252e=[_0x7dc9('0x55'),_0x7dc9('0x41'),_0x7dc9('0x56'),_0x7dc9('0x57'),_0x7dc9('0x58'),'lastPauseAt',_0x7dc9('0x37'),_0x7dc9('0x59'),_0x7dc9('0x45'),_0x7dc9('0x47'),_0x7dc9('0x46'),'smsPause',_0x7dc9('0x4a'),_0x7dc9('0x5a'),_0x7dc9('0x49'),_0x7dc9('0x5b'),_0x7dc9('0x5c'),_0x7dc9('0x5d'),'smsCapacity','whatsappCapacity','faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x5f'),_0x7dc9('0x60'),_0x7dc9('0x61'),'whatsappCurrentCapacity','faxCurrentCapacity',_0x7dc9('0x4d'),_0x7dc9('0x50'),_0x7dc9('0x4f'),_0x7dc9('0x62'),_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x3b'),'chatStatusTime',_0x7dc9('0x63'),_0x7dc9('0x64'),_0x7dc9('0x65'),_0x7dc9('0x66'),_0x7dc9('0x67'),'voiceStatusTime',_0x7dc9('0x33'),_0x7dc9('0x68'),_0x7dc9('0x69'),_0x7dc9('0x6a'),_0x7dc9('0x6b'),_0x7dc9('0x6c')],_0x31baf1=[_0x7dc9('0x45'),_0x7dc9('0x47'),_0x7dc9('0x46'),_0x7dc9('0x48'),_0x7dc9('0x4a'),_0x7dc9('0x5a'),_0x7dc9('0x49'),'online'];Promise[_0x7dc9('0x6d')]()['then'](function(){var _0xad5a69=_[_0x7dc9('0x2d')](db['User'][_0x7dc9('0x6e')],function(_0x24d2c7){return{'name':_0x24d2c7['fieldName'],'type':_0x24d2c7[_0x7dc9('0x6f')][_0x7dc9('0x70')]};});_0x593132[_0x7dc9('0x71')]['role']='agent';_0x593132[_0x7dc9('0x71')][_0x7dc9('0x41')]=!![];_0x2b0941=qs[_0x7dc9('0x72')](_0xad5a69,_0x593132);_0x2b0941[_0x7dc9('0x73')]=!![];if(_0x593132[_0x7dc9('0x74')][_0x7dc9('0x75')]===_0x7dc9('0x74')){var _0x3e5e86={'params':{'id':_0x593132[_0x7dc9('0x74')]['userProfileId']},'query':{'section':_0x7dc9('0x10'),'role':_0x7dc9('0x76'),'online':!![],'nolimit':_0x593132[_0x7dc9('0x71')]['nolimit'],'sort':_0x593132['query'][_0x7dc9('0x77')],'filter':_0x593132[_0x7dc9('0x71')][_0x7dc9('0x4c')],'raw':!![]}};return db[_0x7dc9('0x78')]['getResources'](_0x3e5e86);}return db['User'][_0x7dc9('0x79')](_0x2b0941);})[_0x7dc9('0x11')](function(_0x25f8b3){_0x2ecc80[_0x7dc9('0x9')]=_0x25f8b3['count'];_0x4139e6=_0x25f8b3[_0x7dc9('0x7a')];return getRealtimeAgents();})[_0x7dc9('0x11')](function(_0x436b0d){_0x877a67=_0x436b0d[_0x7dc9('0x7a')];return _0x4139e6[_0x7dc9('0x2d')](function(_0x3aa148){var _0x43e96e=_['find'](_0x877a67,['id',_0x3aa148['id']]);if(_0x43e96e)_[_0x7dc9('0x16')](_0x3aa148,_[_0x7dc9('0x7b')](_['omit'](_0x43e96e,_0x31baf1),_0x1d252e));_0x3aa148['globalStatus']=getAgentStatus(_0x3aa148);return _0x3aa148;});})[_0x7dc9('0x11')](function(_0x5e456e){if(_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7c')]){var _0xd99a2=_[_0x7dc9('0x4c')](_0x5e456e,[_0x7dc9('0x7d'),_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7c')]]);if(_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7e')]){_0xd99a2=_[_0x7dc9('0x4c')](_0xd99a2,['pauseType',_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7e')]]);}}_0x2ecc80[_0x7dc9('0x7a')]=_0xd99a2||_0x5e456e;return _0x2ecc80;})['then'](respondWithFilteredResult(_0x366b8b,_0x2b0941))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports['getQueues']=function(_0x5904c6,_0x4202ce){var _0x34f6c1=['mail',_0x7dc9('0x7f'),'sms','openchannel',_0x7dc9('0x80'),_0x7dc9('0x81'),_0x7dc9('0x18')];var _0xb8be9={'count':0x0,'rows':[]},_0x56f757={},_0xf9a553,_0xe944a4,_0x222370,_0x38f037,_0xe0071;Promise[_0x7dc9('0x6d')]()[_0x7dc9('0x11')](function(){if(_0x5904c6[_0x7dc9('0x71')]['channel']){if(!_['includes'](_0x34f6c1,_0x5904c6[_0x7dc9('0x71')]['channel'][_0x7dc9('0x82')]()))throw new Error(_0x7dc9('0x83'));_0xf9a553=_0x5904c6[_0x7dc9('0x71')][_0x7dc9('0x84')]['toLowerCase']();}var _0x192b5e=_[_0x7dc9('0x3d')](_0xf9a553)+'Queue';var _0x1b811d=_[_0x7dc9('0x2d')](db[_0x192b5e][_0x7dc9('0x6e')],function(_0x398dfc){return{'name':_0x398dfc['fieldName'],'type':_0x398dfc[_0x7dc9('0x6f')][_0x7dc9('0x70')]};});_0x56f757=qs['getOptions'](_0x1b811d,_0x5904c6);if(_0x5904c6['user'][_0x7dc9('0x75')]===_0x7dc9('0x74')){var _0x49d7ef={'params':{'id':_0x5904c6[_0x7dc9('0x74')]['userProfileId']},'query':{'section':_0xf9a553===_0x7dc9('0x18')&&_0x5904c6[_0x7dc9('0x71')][_0x7dc9('0x6f')]==='outbound'?_0x7dc9('0x85'):_[_0x7dc9('0x3d')](_0xf9a553)+_0x7dc9('0x86'),'type':_0x5904c6['query'][_0x7dc9('0x6f')],'nolimit':!![],'sort':'name','filter':_0x5904c6['query'][_0x7dc9('0x4c')]}};return db[_0x7dc9('0x78')][_0x7dc9('0x87')](_0x49d7ef);}return db[_0x192b5e][_0x7dc9('0x79')](_0x56f757);})[_0x7dc9('0x11')](function(_0x56a00d){_0xb8be9[_0x7dc9('0x9')]=_0x56a00d[_0x7dc9('0x9')];_0xe944a4=_0x56a00d[_0x7dc9('0x7a')];return getRealtimeQueues(_0x5904c6,_0xf9a553);})[_0x7dc9('0x11')](function(_0x33fd00){_0x38f037=_0x33fd00['rows'];return getRealtimeAgents();})[_0x7dc9('0x11')](function(_0x3631c3){_0x222370=_0x3631c3[_0x7dc9('0x7a')];if(_0xf9a553!=_0x7dc9('0x18'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2247ce){_0xe0071=_0x2247ce?_0x2247ce['rows']:[];return initializeQueues(_0xe944a4,_0x38f037,_0xf9a553,_0x5904c6['query'][_0x7dc9('0x6f')]);})['then'](function(_0x21da79){var _0x476a24=_0x21da79[_0x7dc9('0x2d')](function(_0xcf3a6f){if(_0xf9a553===_0x7dc9('0x18'))return getVoiceQueueAgents(_0xcf3a6f,_0xe944a4,_0x222370,_0xe0071);else return getQueueAgents(_0xcf3a6f,_0x222370,_0xf9a553);});return Promise[_0x7dc9('0x88')](_0x476a24);})['then'](function(_0x42d4cc){_0xb8be9[_0x7dc9('0x7a')]=_0x42d4cc;return _0xb8be9;})[_0x7dc9('0x11')](respondWithFilteredResult(_0x4202ce,_0x56f757))[_0x7dc9('0x17')](handleError(_0x4202ce,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 0e9aaf7..7cc7297 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xb0f253,_0x476cc1){var _0x25dbbe=function(_0x52a034){while(--_0x52a034){_0xb0f253['push'](_0xb0f253['shift']());}};_0x25dbbe(++_0x476cc1);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x218e7d,_0x329283){var _0x435318=function(_0x4e614a){while(--_0x4e614a){_0x218e7d['push'](_0x218e7d['shift']());}};_0x435318(++_0x329283);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xcb91[_0x5cbf0e];return _0x1c76f8;};'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 8105828..18f49f4 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 _0xa2c8=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x4700fd,_0x5ef5c5){var _0x5999b6=function(_0x454367){while(--_0x454367){_0x4700fd['push'](_0x4700fd['shift']());}};_0x5999b6(++_0x5ef5c5);}(_0xa2c8,0x99));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8a2c('0x0'));module[_0x8a2c('0x1')]={'state':{'type':Sequelize[_0x8a2c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8a2c('0x3')]},'scheduledat':{'type':Sequelize[_0x8a2c('0x4')]},'uniqueid':{'type':Sequelize[_0x8a2c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8a2c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8a2c('0x3')]}}; \ No newline at end of file +var _0x04f9=['INTEGER','STRING','DATE','exports'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0x04f9,0xb3));var _0x904f=function(_0x200d52,_0x2b75d2){_0x200d52=_0x200d52-0x0;var _0x142897=_0x04f9[_0x200d52];return _0x142897;};'use strict';var Sequelize=require('sequelize');module[_0x904f('0x0')]={'state':{'type':Sequelize[_0x904f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x904f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x904f('0x2')]},'starttime':{'type':Sequelize[_0x904f('0x3')]},'responsetime':{'type':Sequelize[_0x904f('0x3')]},'ringtime':{'type':Sequelize[_0x904f('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x904f('0x2')]},'campaigntype':{'type':Sequelize[_0x904f('0x2')]},'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 6c19038..96146f4 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 _0x7c8b=['request-promise','path','rimraf','../../config/environment','exports','define','report_agent_preview','lodash','util','../../config/logger','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7c8b,0xb7));var _0xb7c8=function(_0x4d2ae4,_0x51fbd2){_0x4d2ae4=_0x4d2ae4-0x0;var _0x35a7ab=_0x7c8b[_0x4d2ae4];return _0x35a7ab;};'use strict';var _=require(_0xb7c8('0x0'));var util=require(_0xb7c8('0x1'));var logger=require(_0xb7c8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb7c8('0x3'));var rp=require(_0xb7c8('0x4'));var fs=require('fs');var path=require(_0xb7c8('0x5'));var rimraf=require(_0xb7c8('0x6'));var config=require(_0xb7c8('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xb7c8('0x8')]=function(_0x380219,_0x3d2b00){return _0x380219[_0xb7c8('0x9')]('ReportAgentPreview',attributes,{'tableName':_0xb7c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6cf=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview'];(function(_0x5acbef,_0x36b414){var _0x5e9742=function(_0x1fac54){while(--_0x1fac54){_0x5acbef['push'](_0x5acbef['shift']());}};_0x5e9742(++_0x36b414);}(_0xe6cf,0x1c7));var _0xfe6c=function(_0x53dd63,_0x5e1852){_0x53dd63=_0x53dd63-0x0;var _0x460c0a=_0xe6cf[_0x53dd63];return _0x460c0a;};'use strict';var _=require(_0xfe6c('0x0'));var util=require(_0xfe6c('0x1'));var logger=require(_0xfe6c('0x2'))(_0xfe6c('0x3'));var moment=require('moment');var BPromise=require(_0xfe6c('0x4'));var rp=require(_0xfe6c('0x5'));var fs=require('fs');var path=require(_0xfe6c('0x6'));var rimraf=require(_0xfe6c('0x7'));var config=require(_0xfe6c('0x8'));var attributes=require(_0xfe6c('0x9'));module[_0xfe6c('0xa')]=function(_0x58d800,_0x205f85){return _0x58d800[_0xfe6c('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xfe6c('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 7bb8a81..24d4700 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 _0x2461=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','body','options','raw','CreateReportAgentPreview','stringify','lodash','moment'];(function(_0x2be4b2,_0x1a10a5){var _0x412f6c=function(_0x2a506b){while(--_0x2a506b){_0x2be4b2['push'](_0x2be4b2['shift']());}};_0x412f6c(++_0x1a10a5);}(_0x2461,0x157));var _0x1246=function(_0x9b5188,_0x1ee9a9){_0x9b5188=_0x9b5188-0x0;var _0x20f079=_0x2461[_0x9b5188];return _0x20f079;};'use strict';var _=require(_0x1246('0x0'));var util=require('util');var moment=require(_0x1246('0x1'));var BPromise=require(_0x1246('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1246('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1246('0x4'))(_0x1246('0x5'));var config=require(_0x1246('0x6'));var jayson=require(_0x1246('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c4fbb,_0x10bc47,_0x173c20){return new BPromise(function(_0x4a3fbc,_0x239df5){return client[_0x1246('0x8')](_0x1c4fbb,_0x173c20)[_0x1246('0x9')](function(_0x34ecee){logger[_0x1246('0xa')](_0x1246('0xb'),_0x10bc47,_0x1246('0xc'));logger[_0x1246('0xd')](_0x1246('0xe'),_0x10bc47,_0x1246('0xc'),JSON['stringify'](_0x34ecee));if(_0x34ecee['error']){if(_0x34ecee[_0x1246('0xf')]['code']===0x1f4){logger[_0x1246('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x10bc47,_0x34ecee[_0x1246('0xf')]['message']);return _0x239df5(_0x34ecee[_0x1246('0xf')]['message']);}logger[_0x1246('0xf')](_0x1246('0xb'),_0x10bc47,_0x34ecee['error'][_0x1246('0x10')]);return _0x4a3fbc(_0x34ecee[_0x1246('0xf')][_0x1246('0x10')]);}else{logger[_0x1246('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x10bc47,_0x1246('0xc'));_0x4a3fbc(_0x34ecee[_0x1246('0x11')][_0x1246('0x10')]);}})['catch'](function(_0x264526){logger[_0x1246('0xf')](_0x1246('0xb'),_0x10bc47,_0x264526);_0x239df5(_0x264526);});});}exports['CreateReportAgentPreview']=function(_0x12fe49){var _0x54ae19=this;return new Promise(function(_0x15e044,_0x5efa1a){return db['ReportAgentPreview']['create'](_0x12fe49[_0x1246('0x12')],{'raw':_0x12fe49['options']?_0x12fe49[_0x1246('0x13')][_0x1246('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x569853){logger[_0x1246('0xa')]('CreateReportAgentPreview',_0x12fe49);logger[_0x1246('0xd')](_0x1246('0x15'),_0x12fe49,JSON[_0x1246('0x16')](_0x569853));_0x15e044(_0x569853);})['catch'](function(_0x5b182a){logger[_0x1246('0xf')](_0x1246('0x15'),_0x5b182a[_0x1246('0x10')],_0x12fe49);_0x5efa1a(_0x54ae19[_0x1246('0xf')](0x1f4,_0x5b182a[_0x1246('0x10')]));});});}; \ No newline at end of file +var _0x6f6b=['error','code','message','result','catch','CreateReportAgentPreview','body','options','raw','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x93a32a,_0x279e0a){var _0x41035d=function(_0x4f2638){while(--_0x4f2638){_0x93a32a['push'](_0x93a32a['shift']());}};_0x41035d(++_0x279e0a);}(_0x6f6b,0x77));var _0xb6f6=function(_0x4f0057,_0x23c77a){_0x4f0057=_0x4f0057-0x0;var _0x45e03a=_0x6f6b[_0x4f0057];return _0x45e03a;};'use strict';var _=require(_0xb6f6('0x0'));var util=require(_0xb6f6('0x1'));var moment=require('moment');var BPromise=require(_0xb6f6('0x2'));var rs=require(_0xb6f6('0x3'));var fs=require('fs');var Redis=require(_0xb6f6('0x4'));var db=require(_0xb6f6('0x5'))['db'];var utils=require(_0xb6f6('0x6'));var logger=require(_0xb6f6('0x7'))(_0xb6f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6f6('0x9'));var client=jayson[_0xb6f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e0eb6,_0x4de7ac,_0x56b319){return new BPromise(function(_0x1244e0,_0x227e72){return client[_0xb6f6('0xb')](_0x3e0eb6,_0x56b319)['then'](function(_0x829d66){logger[_0xb6f6('0xc')](_0xb6f6('0xd'),_0x4de7ac,_0xb6f6('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4de7ac,_0xb6f6('0xe'),JSON[_0xb6f6('0xf')](_0x829d66));if(_0x829d66[_0xb6f6('0x10')]){if(_0x829d66[_0xb6f6('0x10')][_0xb6f6('0x11')]===0x1f4){logger[_0xb6f6('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x4de7ac,_0x829d66[_0xb6f6('0x10')][_0xb6f6('0x12')]);return _0x227e72(_0x829d66[_0xb6f6('0x10')][_0xb6f6('0x12')]);}logger[_0xb6f6('0x10')](_0xb6f6('0xd'),_0x4de7ac,_0x829d66[_0xb6f6('0x10')][_0xb6f6('0x12')]);return _0x1244e0(_0x829d66[_0xb6f6('0x10')][_0xb6f6('0x12')]);}else{logger['info'](_0xb6f6('0xd'),_0x4de7ac,_0xb6f6('0xe'));_0x1244e0(_0x829d66[_0xb6f6('0x13')][_0xb6f6('0x12')]);}})[_0xb6f6('0x14')](function(_0x488a0d){logger[_0xb6f6('0x10')](_0xb6f6('0xd'),_0x4de7ac,_0x488a0d);_0x227e72(_0x488a0d);});});}exports[_0xb6f6('0x15')]=function(_0x3eb906){var _0x1978d6=this;return new Promise(function(_0x167d6e,_0x524365){return db['ReportAgentPreview']['create'](_0x3eb906[_0xb6f6('0x16')],{'raw':_0x3eb906[_0xb6f6('0x17')]?_0x3eb906['options'][_0xb6f6('0x18')]===undefined?!![]:![]:!![]})[_0xb6f6('0x19')](function(_0xde5c79){logger[_0xb6f6('0xc')](_0xb6f6('0x15'),_0x3eb906);logger[_0xb6f6('0x1a')](_0xb6f6('0x15'),_0x3eb906,JSON[_0xb6f6('0xf')](_0xde5c79));_0x167d6e(_0xde5c79);})[_0xb6f6('0x14')](function(_0x3e6d7d){logger[_0xb6f6('0x10')](_0xb6f6('0x15'),_0x3e6d7d['message'],_0x3eb906);_0x524365(_0x1978d6['error'](0x1f4,_0x3e6d7d[_0xb6f6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 00e7ea7..b561e47 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 _0x9243=['/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','multer','util','path','express','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9243,0x89));var _0x3924=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x9243[_0x1d1963];return _0x3f58bb;};'use strict';var multer=require(_0x3924('0x0'));var util=require(_0x3924('0x1'));var path=require(_0x3924('0x2'));var express=require(_0x3924('0x3'));var router=express['Router']();var auth=require(_0x3924('0x4'));var controller=require('./rpc.controller');router[_0x3924('0x5')](_0x3924('0x6'),auth[_0x3924('0x7')](),controller[_0x3924('0x8')]);router[_0x3924('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x3924('0x7')](),controller['voiceChannelMixMonitor']);router[_0x3924('0x5')](_0x3924('0x9'),auth[_0x3924('0x7')](),controller[_0x3924('0xa')]);router['get'](_0x3924('0xb'),auth[_0x3924('0x7')](),controller[_0x3924('0xc')]);router['get']('/chat/queues',auth[_0x3924('0x7')](),controller[_0x3924('0xd')]);router[_0x3924('0x5')](_0x3924('0xe'),auth[_0x3924('0x7')](),controller['mailQueues']);router[_0x3924('0x5')]('/mail/accounts',auth[_0x3924('0x7')](),controller['mailAccounts']);router[_0x3924('0x5')](_0x3924('0xf'),auth[_0x3924('0x7')](),controller['openchannelQueues']);router[_0x3924('0x5')](_0x3924('0x10'),auth[_0x3924('0x7')](),controller[_0x3924('0x11')]);router[_0x3924('0x5')](_0x3924('0x12'),auth[_0x3924('0x7')](),controller[_0x3924('0x13')]);router[_0x3924('0x5')]('/fax/queues',auth[_0x3924('0x7')](),controller[_0x3924('0x14')]);router[_0x3924('0x5')](_0x3924('0x15'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x3924('0x5')](_0x3924('0x16'),auth['isAuthenticated'](),controller[_0x3924('0x17')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0x3924('0x7')](),controller[_0x3924('0x18')]);router[_0x3924('0x5')](_0x3924('0x19'),auth[_0x3924('0x7')](),controller[_0x3924('0x1a')]);router[_0x3924('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3924('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x3924('0x5')](_0x3924('0x1b'),auth[_0x3924('0x7')](),controller[_0x3924('0x1c')]);router[_0x3924('0x1d')](_0x3924('0x1b'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0x3924('0x5')](_0x3924('0x1e'),auth[_0x3924('0x7')](),controller[_0x3924('0x1f')]);router[_0x3924('0x5')](_0x3924('0x20'),auth[_0x3924('0x7')](),controller[_0x3924('0x21')]);router[_0x3924('0x5')](_0x3924('0x22'),auth[_0x3924('0x7')](),controller[_0x3924('0x23')]);router[_0x3924('0x1d')](_0x3924('0x24'),auth[_0x3924('0x7')](),controller['agentCapacity']);router[_0x3924('0x5')](_0x3924('0x25'),auth['isAuthenticated'](),controller[_0x3924('0x26')]);router[_0x3924('0x5')](_0x3924('0x27'),auth[_0x3924('0x7')](),controller[_0x3924('0x28')]);router[_0x3924('0x5')](_0x3924('0x29'),auth[_0x3924('0x7')](),controller[_0x3924('0x2a')]);router[_0x3924('0x5')](_0x3924('0x2b'),auth[_0x3924('0x7')](),controller[_0x3924('0x2c')]);router[_0x3924('0x5')](_0x3924('0x2d'),auth[_0x3924('0x7')](),controller[_0x3924('0x2e')]);router[_0x3924('0x5')](_0x3924('0x2f'),auth[_0x3924('0x7')](),controller[_0x3924('0x30')]);router[_0x3924('0x5')](_0x3924('0x31'),auth[_0x3924('0x7')](),controller[_0x3924('0x32')]);router[_0x3924('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x3924('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3924('0x5')](_0x3924('0x33'),auth[_0x3924('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x3924('0x5')](_0x3924('0x34'),auth[_0x3924('0x7')](),controller[_0x3924('0x35')]);router[_0x3924('0x5')](_0x3924('0x36'),auth[_0x3924('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x3924('0x37')](_0x3924('0x38'),auth[_0x3924('0x7')](),controller['queueNotify'](_0x3924('0x39')));router[_0x3924('0x5')](_0x3924('0x3a'),auth[_0x3924('0x7')](),controller[_0x3924('0x3b')]);router[_0x3924('0x37')](_0x3924('0x3c'),auth['isAuthenticated'](),controller[_0x3924('0x3d')](_0x3924('0x3e')));router['get'](_0x3924('0x3f'),auth[_0x3924('0x7')](),controller[_0x3924('0x40')]);router[_0x3924('0x37')](_0x3924('0x41'),auth[_0x3924('0x7')](),controller['queueNotify'](_0x3924('0x42')));router['get'](_0x3924('0x43'),auth[_0x3924('0x7')](),controller[_0x3924('0x44')]);router['post'](_0x3924('0x45'),auth[_0x3924('0x7')](),controller[_0x3924('0x3d')](_0x3924('0x46')));router[_0x3924('0x5')]('/openchannel/queues/:id',auth[_0x3924('0x7')](),controller['showOpenchannelQueues']);router[_0x3924('0x37')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x3924('0x37')](_0x3924('0x47'),auth[_0x3924('0x7')](),controller['queueNotify'](_0x3924('0x48')));router[_0x3924('0x5')](_0x3924('0x49'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get'](_0x3924('0x4a'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router['post'](_0x3924('0x4b'),auth[_0x3924('0x7')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x813c=['queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','showChatQueues','post','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify'];(function(_0x478e87,_0x3bd797){var _0x1d3471=function(_0x402040){while(--_0x402040){_0x478e87['push'](_0x478e87['shift']());}};_0x1d3471(++_0x3bd797);}(_0x813c,0x169));var _0xc813=function(_0x3f5233,_0x237206){_0x3f5233=_0x3f5233-0x0;var _0x3904c7=_0x813c[_0x3f5233];return _0x3904c7;};'use strict';var multer=require('multer');var util=require(_0xc813('0x0'));var path=require(_0xc813('0x1'));var express=require(_0xc813('0x2'));var router=express[_0xc813('0x3')]();var auth=require(_0xc813('0x4'));var controller=require(_0xc813('0x5'));router['get'](_0xc813('0x6'),auth[_0xc813('0x7')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xc813('0x7')](),controller[_0xc813('0x8')]);router[_0xc813('0x9')](_0xc813('0xa'),auth[_0xc813('0x7')](),controller[_0xc813('0xb')]);router[_0xc813('0x9')](_0xc813('0xc'),auth['isAuthenticated'](),controller[_0xc813('0xd')]);router[_0xc813('0x9')](_0xc813('0xe'),auth['isAuthenticated'](),controller[_0xc813('0xf')]);router[_0xc813('0x9')](_0xc813('0x10'),auth[_0xc813('0x7')](),controller[_0xc813('0x11')]);router[_0xc813('0x9')]('/mail/accounts',auth[_0xc813('0x7')](),controller[_0xc813('0x12')]);router['get'](_0xc813('0x13'),auth['isAuthenticated'](),controller[_0xc813('0x14')]);router[_0xc813('0x9')](_0xc813('0x15'),auth[_0xc813('0x7')](),controller[_0xc813('0x16')]);router['get'](_0xc813('0x17'),auth[_0xc813('0x7')](),controller['whatsappQueues']);router[_0xc813('0x9')](_0xc813('0x18'),auth[_0xc813('0x7')](),controller[_0xc813('0x19')]);router[_0xc813('0x9')]('/voice/queues/preview/:id',auth[_0xc813('0x7')](),controller[_0xc813('0x1a')]);router[_0xc813('0x9')](_0xc813('0x1b'),auth[_0xc813('0x7')](),controller['voiceQueuesChannels']);router['get'](_0xc813('0x1c'),auth[_0xc813('0x7')](),controller[_0xc813('0x1d')]);router[_0xc813('0x9')](_0xc813('0x1e'),auth[_0xc813('0x7')](),controller[_0xc813('0x1f')]);router['get'](_0xc813('0x20'),auth[_0xc813('0x7')](),controller[_0xc813('0x21')]);router['get'](_0xc813('0x22'),auth[_0xc813('0x7')](),controller[_0xc813('0x23')]);router[_0xc813('0x24')](_0xc813('0x22'),auth['isAuthenticated'](),controller[_0xc813('0x25')]);router[_0xc813('0x9')](_0xc813('0x26'),auth[_0xc813('0x7')](),controller['outbound']);router['get'](_0xc813('0x27'),auth['isAuthenticated'](),controller[_0xc813('0x28')]);router[_0xc813('0x9')](_0xc813('0x29'),auth['isAuthenticated'](),controller[_0xc813('0x2a')]);router[_0xc813('0x24')]('/agents/:id/capacity',auth[_0xc813('0x7')](),controller[_0xc813('0x2b')]);router[_0xc813('0x9')]('/telephones',auth['isAuthenticated'](),controller[_0xc813('0x2c')]);router[_0xc813('0x9')](_0xc813('0x2d'),auth[_0xc813('0x7')](),controller[_0xc813('0x2e')]);router[_0xc813('0x9')]('/campaigns',auth[_0xc813('0x7')](),controller[_0xc813('0x2f')]);router[_0xc813('0x9')](_0xc813('0x30'),auth[_0xc813('0x7')](),controller[_0xc813('0x31')]);router[_0xc813('0x9')](_0xc813('0x32'),auth[_0xc813('0x7')](),controller[_0xc813('0x33')]);router[_0xc813('0x9')](_0xc813('0x34'),auth[_0xc813('0x7')](),controller[_0xc813('0x35')]);router[_0xc813('0x9')](_0xc813('0x36'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xc813('0x9')](_0xc813('0x37'),auth['isAuthenticated'](),controller[_0xc813('0x38')]);router[_0xc813('0x9')](_0xc813('0x39'),auth[_0xc813('0x7')](),controller[_0xc813('0x3a')]);router[_0xc813('0x9')](_0xc813('0x3b'),auth[_0xc813('0x7')](),controller[_0xc813('0x3c')]);router[_0xc813('0x9')](_0xc813('0x3d'),auth[_0xc813('0x7')](),controller[_0xc813('0x3e')]);router['post'](_0xc813('0x3f'),auth[_0xc813('0x7')](),controller[_0xc813('0x40')]('mail'));router[_0xc813('0x9')](_0xc813('0x41'),auth['isAuthenticated'](),controller['showMailQueues']);router['post'](_0xc813('0x42'),auth[_0xc813('0x7')](),controller[_0xc813('0x40')](_0xc813('0x43')));router['get']('/chat/queues/:id',auth[_0xc813('0x7')](),controller[_0xc813('0x44')]);router[_0xc813('0x45')](_0xc813('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0xc813('0x47')));router[_0xc813('0x9')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0xc813('0x48')]);router['post']('/openchannel/queues/:id/notify',auth[_0xc813('0x7')](),controller[_0xc813('0x40')](_0xc813('0x49')));router['get']('/openchannel/queues/:id',auth[_0xc813('0x7')](),controller['showOpenchannelQueues']);router[_0xc813('0x45')](_0xc813('0x4a'),auth[_0xc813('0x7')](),controller[_0xc813('0x40')](_0xc813('0x4b')));router['post'](_0xc813('0x4c'),auth[_0xc813('0x7')](),controller[_0xc813('0x40')](_0xc813('0x4d')));router[_0xc813('0x9')](_0xc813('0x4e'),auth[_0xc813('0x7')](),controller[_0xc813('0x4f')]);router['get'](_0xc813('0x50'),auth[_0xc813('0x7')](),controller[_0xc813('0x51')]);router['post'](_0xc813('0x52'),auth['isAuthenticated'](),controller[_0xc813('0x53')]);module[_0xc813('0x54')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 876504b..4bd79c2 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 _0x8d0e=['merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','interface','SIP/%s','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','showChatQueues','ChatQueues','mailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','findOne','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','agent','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','json','stack','name','send','isNil','rows','voiceChannels','query','then','VoiceChannelMixMonitor'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x315fdc,_0x15282a){_0x315fdc=_0x315fdc-0x0;var _0x5409e2=_0x8d0e[_0x315fdc];return _0x5409e2;};'use strict';var BPromise=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));var _=require(_0xe8d0('0x2'));var util=require(_0xe8d0('0x3'));var db=require(_0xe8d0('0x4'))['db'];var logger=require(_0xe8d0('0x5'))(_0xe8d0('0x6'));var jayson=require(_0xe8d0('0x7'));var amiClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232a});var mailClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xe8d0('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){var _0x1b353a=_0xcc03d0?_0xcc03d0:amiClient;return _0x1b353a[_0xe8d0('0xa')](_0x92483d,_0x469d37)['then'](function(_0x10e56c){if(_0x10e56c[_0xe8d0('0xb')]){if(_0x10e56c[_0xe8d0('0xb')]['code']===0x1f4){return _0x13aa63(_0x10e56c['error'][_0xe8d0('0xc')]);}return _0x2b6dce(_0x10e56c[_0xe8d0('0xb')][_0xe8d0('0xc')]);}else{_0x2b6dce(_0x10e56c[_0xe8d0('0xd')]);}})[_0xe8d0('0xe')](function(_0x41de69){_0x13aa63(_0x41de69);});});}function respondWithResult(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xc8;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['status'](_0x38fac0)[_0xe8d0('0xf')](_0x15b9e5);}return _0x5934b2['sendStatus'](0x194);};}function handleError(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0x1f4;return function(_0x2aa906){logger[_0xe8d0('0xb')](_0x2aa906[_0xe8d0('0x10')]);if(_0x2aa906[_0xe8d0('0x11')]){delete _0x2aa906[_0xe8d0('0x11')];}_0x59b4b7['status'](_0x90a1ea)[_0xe8d0('0x12')](_0x2aa906);};}function findById(_0x49554d){return function(_0x6d932b){if(!_[_0xe8d0('0x13')](_0x49554d)&&!_[_0xe8d0('0x13')](_0x6d932b)&&!_['isNil'](_0x6d932b['rows'])){return _['find'](_0x6d932b[_0xe8d0('0x14')],function(_0x384854){return _0x384854['id']==_0x49554d;});}return null;};}exports[_0xe8d0('0x15')]=function(_0x44bbe4,_0x83177b){return respondWithRpcPromise('VoiceChannels',_0x44bbe4[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x83177b,null))['catch'](handleError(_0x83177b,null));};exports['voiceChannelMixMonitor']=function(_0x554402,_0x384a60){return respondWithRpcPromise(_0xe8d0('0x18'),_[_0xe8d0('0x19')](_0x554402[_0xe8d0('0x16')],_0x554402[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x384a60,null))[_0xe8d0('0xe')](handleError(_0x384a60,null));};exports[_0xe8d0('0x1b')]=function(_0x32e39a,_0x5ab4e7){return respondWithRpcPromise(_0xe8d0('0x1c'),_[_0xe8d0('0x19')](_0x32e39a['query'],_0x32e39a[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x5ab4e7,null))[_0xe8d0('0xe')](handleError(_0x5ab4e7,null));};exports[_0xe8d0('0x1d')]=function(_0x146783,_0x149dfd){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x146783[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x149dfd,null))[_0xe8d0('0xe')](handleError(_0x149dfd,null));};exports[_0xe8d0('0x1f')]=function(_0x539548,_0x24982c){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x539548[_0xe8d0('0x16')])['then'](findById(_0x539548[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x24982c,null))['catch'](handleError(_0x24982c,null));};exports[_0xe8d0('0x20')]=function(_0x3ffcb7,_0x11fcf2){return respondWithRpcPromise(_0xe8d0('0x21'),_[_0xe8d0('0x19')](_0x3ffcb7['body'],_0x3ffcb7[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x11fcf2,null))['catch'](handleError(_0x11fcf2,null));};exports['voiceQueuesPreview']=function(_0x547a2b,_0x13cd4c){return respondWithRpcPromise(_0xe8d0('0x22'),_['merge'](_0x547a2b['query'],_0x547a2b[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x13cd4c,null))[_0xe8d0('0xe')](handleError(_0x13cd4c,null));};exports[_0xe8d0('0x23')]=function(_0x327004,_0x1b2b0a){return respondWithRpcPromise(_0xe8d0('0x24'),_0x327004['query'])[_0xe8d0('0x17')](respondWithResult(_0x1b2b0a,null))[_0xe8d0('0xe')](handleError(_0x1b2b0a,null));};exports[_0xe8d0('0x25')]=function(_0x145ddb,_0x587819){return respondWithRpcPromise(_0xe8d0('0x26'),_[_0xe8d0('0x19')](_0x145ddb['query'],_0x145ddb[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x587819,null))[_0xe8d0('0xe')](handleError(_0x587819,null));};exports['voiceQueuesChannelHangup']=function(_0x197e01,_0x531835){return respondWithRpcPromise(_0xe8d0('0x27'),_[_0xe8d0('0x19')](_0x197e01[_0xe8d0('0x16')],_0x197e01[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x531835,null))[_0xe8d0('0xe')](handleError(_0x531835,null));};exports[_0xe8d0('0x28')]=function(_0x20eec5,_0x516243){return respondWithRpcPromise(_0xe8d0('0x29'),_[_0xe8d0('0x19')](_0x20eec5[_0xe8d0('0x16')],_0x20eec5[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x516243,null))['catch'](handleError(_0x516243,null));};exports[_0xe8d0('0x2a')]=function(_0x1828c5,_0x10970d){return respondWithRpcPromise(_0xe8d0('0x2b'),_0x1828c5[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x10970d,null))[_0xe8d0('0xe')](handleError(_0x10970d,null));};exports[_0xe8d0('0x2c')]=function(_0x4edb3d,_0x5dff14){return respondWithRpcPromise(_0xe8d0('0x2d'),_0x4edb3d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x5dff14,null))[_0xe8d0('0xe')](handleError(_0x5dff14,null));};exports[_0xe8d0('0x2e')]=function(_0x585d27,_0x2e4362){var _0x4bd7a2;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')])[_0xe8d0('0x17')](function(_0x48fa07){_0x4bd7a2=_0x48fa07;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')],routingClient);})[_0xe8d0('0x17')](function(_0x230a90){return _[_0xe8d0('0x19')]({},_0x230a90,_0x4bd7a2);})['then'](respondWithResult(_0x2e4362,null))['catch'](handleError(_0x2e4362,null));};exports['agentCapacity']=function(_0x4cf0da,_0x14ffb6){if(_0x4cf0da['body']&&_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]&&_0x4cf0da[_0xe8d0('0x32')]&&_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]){for(var _0x1156da in _0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]){if(_0x4cf0da['body'][_0xe8d0('0x31')][_0xe8d0('0x33')](_0x1156da)){db['MemberReport']['findAll']({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'exitAt':null,'uniqueid':_0x4cf0da['body'][_0xe8d0('0x31')][_0x1156da]&&_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da][_0xe8d0('0x35')]?{'$notIn':_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da]}:{'$ne':null}}})[_0xe8d0('0x17')](function(_0x23e250){var _0x1b7866=moment()[_0xe8d0('0x36')](_0xe8d0('0x37'));for(var _0x2a6760=0x0,_0x11339d=_0x23e250[_0xe8d0('0x35')];_0x2a6760<_0x11339d;_0x2a6760+=0x1){_0x23e250[_0x2a6760]['updateAttributes']({'exitAt':_0x1b7866});}});for(var _0x31a370=0x0;_0x31a370<_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0xe8d0('0x35')];_0x31a370+=0x1){db[_0xe8d0('0x38')][_0xe8d0('0x39')]({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370],'exitAt':null},'defaults':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')]['name'],'interface':_[_0xe8d0('0x13')](_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x3a')])?util[_0xe8d0('0x36')](_0xe8d0('0x3b'),_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]):_0x4cf0da['user'][_0xe8d0('0x3a')],'type':_0xe8d0('0x34'),'enterAt':moment()[_0xe8d0('0x36')](_0xe8d0('0x37')),'role':'agent','internal':_0x4cf0da[_0xe8d0('0x32')]['internal'],'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370]}});}}}}return respondWithRpcPromise(_0xe8d0('0x3c'),{'id':_0x4cf0da[_0xe8d0('0x1a')]['id'],'capacity':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x3d')]},routingClient)[_0xe8d0('0x17')](respondWithResult(_0x14ffb6,null))['catch'](handleError(_0x14ffb6,null));};exports[_0xe8d0('0x3e')]=function(_0x55f93d,_0x581a34){return respondWithRpcPromise(_0xe8d0('0x3f'),_0x55f93d['query'])[_0xe8d0('0x17')](respondWithResult(_0x581a34,null))['catch'](handleError(_0x581a34,null));};exports[_0xe8d0('0x40')]=function(_0x28494c,_0x13713c){return respondWithRpcPromise(_0xe8d0('0x41'),_0x28494c['query'])[_0xe8d0('0x17')](respondWithResult(_0x13713c,null))[_0xe8d0('0xe')](handleError(_0x13713c,null));};exports[_0xe8d0('0x42')]=function(_0x2e3f1d,_0x18cc14){return respondWithRpcPromise('Campaigns',_0x2e3f1d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x18cc14,null))[_0xe8d0('0xe')](handleError(_0x18cc14,null));};exports['chatQueues']=function(_0x2f4d43,_0x571c4e){return respondWithRpcPromise('ChatQueues',_0x2f4d43[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x571c4e,null))['catch'](handleError(_0x571c4e,null));};exports[_0xe8d0('0x43')]=function(_0x3a8074,_0x47893d){return respondWithRpcPromise(_0xe8d0('0x44'),_0x3a8074[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3a8074[_0xe8d0('0x1a')]['id']))['then'](respondWithResult(_0x47893d,null))[_0xe8d0('0xe')](handleError(_0x47893d,null));};exports[_0xe8d0('0x45')]=function(_0x25e5ab,_0x76316a){return respondWithRpcPromise('MailQueues',_0x25e5ab[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x76316a,null))[_0xe8d0('0xe')](handleError(_0x76316a,null));};exports[_0xe8d0('0x46')]=function(_0x1a74d0,_0x29667c){return respondWithRpcPromise('MailQueues',_0x1a74d0['query'],routingClient)[_0xe8d0('0x17')](findById(_0x1a74d0['params']['id']))[_0xe8d0('0x17')](respondWithResult(_0x29667c,null))[_0xe8d0('0xe')](handleError(_0x29667c,null));};exports['mailAccounts']=function(_0x5ac1ae,_0x995163){return respondWithRpcPromise('MailAccounts',_0x5ac1ae[_0xe8d0('0x16')],mailClient)['then'](respondWithResult(_0x995163,null))[_0xe8d0('0xe')](handleError(_0x995163,null));};exports[_0xe8d0('0x47')]=function(_0x13b9f0,_0x4e2abc){return respondWithRpcPromise(_0xe8d0('0x48'),_0x13b9f0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x4e2abc,null))[_0xe8d0('0xe')](handleError(_0x4e2abc,null));};exports['showOpenchannelQueues']=function(_0x3d0908,_0x4ff583){return respondWithRpcPromise(_0xe8d0('0x48'),_0x3d0908[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3d0908[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x4ff583,null))['catch'](handleError(_0x4ff583,null));};exports['smsQueues']=function(_0xd7d433,_0x55a2df){return respondWithRpcPromise(_0xe8d0('0x49'),_0xd7d433[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x55a2df,null))[_0xe8d0('0xe')](handleError(_0x55a2df,null));};exports[_0xe8d0('0x4a')]=function(_0x1e806b,_0x177485){return respondWithRpcPromise(_0xe8d0('0x49'),_0x1e806b[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x1e806b[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x177485,null))[_0xe8d0('0xe')](handleError(_0x177485,null));};exports[_0xe8d0('0x4b')]=function(_0x22992f,_0x4a68d5){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x22992f[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x4a68d5,null))[_0xe8d0('0xe')](handleError(_0x4a68d5,null));};exports[_0xe8d0('0x4d')]=function(_0x4848d4,_0x2eeb92){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x4848d4[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x4848d4[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x2eeb92,null))[_0xe8d0('0xe')](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x4e')]=function(_0x40cb5c,_0x24be86){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x40cb5c[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x24be86,null))['catch'](handleError(_0x24be86,null));};exports[_0xe8d0('0x50')]=function(_0x54c04f,_0x169047){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x54c04f['query'],routingClient)[_0xe8d0('0x17')](findById(_0x54c04f[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x169047,null))[_0xe8d0('0xe')](handleError(_0x169047,null));};exports[_0xe8d0('0x51')]=function(_0x1b5df8,_0x473e0b){return respondWithRpcPromise(_0xe8d0('0x52'),_0x1b5df8[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x473e0b,null))[_0xe8d0('0xe')](handleError(_0x473e0b,null));};exports[_0xe8d0('0x53')]=function(_0xa0c61a,_0x2147d5){return respondWithRpcPromise(_0xe8d0('0x54'),_0xa0c61a[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2147d5,null))[_0xe8d0('0xe')](handleError(_0x2147d5,null));};exports[_0xe8d0('0x55')]=function(_0x500fb0,_0x30ed66){return respondWithRpcPromise(_0xe8d0('0x56'),_0x500fb0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x30ed66,null))[_0xe8d0('0xe')](handleError(_0x30ed66,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x31e6df,_0x1c1794){return respondWithRpcPromise(_0xe8d0('0x57'),_0x31e6df['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1c1794,null))[_0xe8d0('0xe')](handleError(_0x1c1794,null));};exports[_0xe8d0('0x58')]=function(_0x207680,_0x939184){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x207680[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](function(_0x23ba49){if(_0x207680[_0xe8d0('0x16')][_0xe8d0('0x59')]!==undefined){var _0x385a73=_(_0x23ba49[_0xe8d0('0x14')])[_0xe8d0('0x5a')]([_0x207680['query'][_0xe8d0('0x59')],_0x207680[_0xe8d0('0x1a')]['id']])[_0xe8d0('0x5b')](_0xe8d0('0x5c'))['uniq']()[_0xe8d0('0x5d')]();return _0x23ba49[_0xe8d0('0x14')][_0xe8d0('0x5a')](function(_0x575730){return _0x385a73[_0xe8d0('0x5e')](_0x575730['queue_id'])>-0x1;});}else{return _0x23ba49[_0xe8d0('0x14')]['filter'](function(_0x25bc77){return _0x25bc77[_0xe8d0('0x5c')]===parseInt(_0x207680[_0xe8d0('0x1a')]['id']);});}})[_0xe8d0('0x17')](respondWithResult(_0x939184,null))[_0xe8d0('0xe')](handleError(_0x939184,null));};exports[_0xe8d0('0x5f')]=function(_0x17fbdc,_0x3f5c69){return respondWithRpcPromise(_0xe8d0('0x60'),_0x17fbdc[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x3f5c69,null))[_0xe8d0('0xe')](handleError(_0x3f5c69,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x20e4ff,_0x1fa61e){return respondWithRpcPromise(_0xe8d0('0x61'),_0x20e4ff[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1fa61e,null))[_0xe8d0('0xe')](handleError(_0x1fa61e,null));};exports[_0xe8d0('0x62')]=function(_0x605b5f,_0x2f9702){return respondWithRpcPromise(_0xe8d0('0x63'),_0x605b5f['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2f9702,null))[_0xe8d0('0xe')](handleError(_0x2f9702,null));};exports[_0xe8d0('0x64')]=function(_0xebc89e){return function(_0x255e4b,_0x550fe6){var _0x4c4ff0,_0xca752a;var _0x5c8c7d=_[_0xe8d0('0x65')](_0xebc89e);var _0x16098b=_0xebc89e===_0xe8d0('0x66')?'Website':_0xe8d0('0x67');return db[_0x5c8c7d+'Queue'][_0xe8d0('0x68')]({'raw':!![],'where':{'id':_0x255e4b[_0xe8d0('0x1a')]['id']}})[_0xe8d0('0x17')](function(_0x1a04a6){if(_[_0xe8d0('0x13')](_0x1a04a6)){throw new Error(_0x5c8c7d+'\x20Queue\x20not\x20found');}_0x4c4ff0=_0x1a04a6;return db[_0x5c8c7d+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x255e4b[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x5c8c7d+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x5c8c7d+_0x16098b],'as':_0xe8d0('0x67')}]});})[_0xe8d0('0x17')](function(_0x1ff1cc){if(_[_0xe8d0('0x13')](_0x1ff1cc)){throw new Error(_0x5c8c7d+'\x20Message\x20not\x20found');}_0xca752a=_0x1ff1cc;return _0x1ff1cc[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x142db4={'uniqueid':_0xebc89e+'.'+_0xca752a['id']+'.'+_0xca752a[_0xe8d0('0x6a')]['id'],'FromUserId':_0x255e4b['user']['id'],'type':'queue'};_0x142db4[_0x5c8c7d+_0xe8d0('0x6c')]=_0xca752a['id'];_0x142db4[_0x5c8c7d+_0xe8d0('0x6d')]=_0xca752a[_0xe8d0('0x6a')]['id'];_0x142db4[_0xe8d0('0x6e')+_0x5c8c7d+_0x16098b+'Id']=_0xca752a[_0xe8d0('0x67')]['id'];_0x142db4['To'+_0x5c8c7d+_0xe8d0('0x6f')]=_0x4c4ff0['id'];return db[_0x5c8c7d+_0xe8d0('0x70')][_0xe8d0('0x71')](_0x142db4);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0xebc89e,'interaction':_0xca752a['Interaction'],'message':_0xca752a,'account':_0xca752a[_0xe8d0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe8d0('0x73'),'appdata':_0x4c4ff0[_0xe8d0('0x11')]+','+(_0xca752a[_0xe8d0('0x67')][_0xe8d0('0x74')]||0x12c),'interval':_0xe8d0('0x75')}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x550fe6,null))[_0xe8d0('0xe')](handleError(_0x550fe6,null));};};exports[_0xe8d0('0x76')]=function(_0x47bdc2,_0x52aece){var _0x2e11fc,_0x38e83f;if(_['isNil'](_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')])){throw new Error(_0xe8d0('0x78'));}var _0x499efb=_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')];var _0x233a5a=_[_0xe8d0('0x65')](_0x499efb);var _0x55588a=_0x499efb==='chat'?_0xe8d0('0x79'):_0xe8d0('0x67');return db['User']['findOne']({'raw':!![],'where':{'id':_0x47bdc2[_0xe8d0('0x1a')]['id'],'role':_0xe8d0('0x7a')}})[_0xe8d0('0x17')](function(_0x5eaf13){if(_[_0xe8d0('0x13')](_0x5eaf13)){throw new Error('Agent\x20not\x20found');}_0x2e11fc=_0x5eaf13;return db[_0x233a5a+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x233a5a+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x233a5a+_0x55588a],'as':'Account'}]});})[_0xe8d0('0x17')](function(_0x455614){if(_['isNil'](_0x455614)){throw new Error(_0x233a5a+_0xe8d0('0x7b'));}_0x38e83f=_0x455614;return _0x455614[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x3e18af={'uniqueid':_0x499efb+'.'+_0x38e83f['id']+'.'+_0x38e83f['Interaction']['id'],'FromUserId':_0x47bdc2[_0xe8d0('0x32')]['id'],'type':_0xe8d0('0x73'),'ToUserId':_0x2e11fc['id']};_0x3e18af[_0x233a5a+_0xe8d0('0x6c')]=_0x38e83f['id'];_0x3e18af[_0x233a5a+_0xe8d0('0x6d')]=_0x38e83f[_0xe8d0('0x6a')]['id'];_0x3e18af[_0xe8d0('0x6e')+_0x233a5a+_0x55588a+'Id']=_0x38e83f[_0xe8d0('0x67')]['id'];return db[_0x233a5a+_0xe8d0('0x70')]['create'](_0x3e18af);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0x499efb,'interaction':_0x38e83f['Interaction'],'message':_0x38e83f,'account':_0x38e83f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2e11fc['name']+','+(_0x38e83f[_0xe8d0('0x67')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x52aece,null))['catch'](handleError(_0x52aece,null));}; \ No newline at end of file +var _0x038b=['\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','create','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','update','Start','agentTransferTimeout','moment','lodash','util','../../config/logger','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','then','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','agentCapacity','interaction','user','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne'];(function(_0x572a5a,_0x290f3e){var _0x5b1b2b=function(_0x4fcd93){while(--_0x4fcd93){_0x572a5a['push'](_0x572a5a['shift']());}};_0x5b1b2b(++_0x290f3e);}(_0x038b,0x114));var _0xb038=function(_0x34bb44,_0x580d4a){_0x34bb44=_0x34bb44-0x0;var _0xe11c40=_0x038b[_0x34bb44];return _0xe11c40;};'use strict';var BPromise=require('bluebird');var moment=require(_0xb038('0x0'));var _=require(_0xb038('0x1'));var util=require(_0xb038('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb038('0x3'))('api');var jayson=require(_0xb038('0x4'));var amiClient=jayson[_0xb038('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xb038('0x5')][_0xb038('0x6')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){var _0x462e8f=_0x1534a9?_0x1534a9:amiClient;return _0x462e8f[_0xb038('0x7')](_0x2e3e64,_0x1b077a)['then'](function(_0x53bcc0){if(_0x53bcc0[_0xb038('0x8')]){if(_0x53bcc0[_0xb038('0x8')]['code']===0x1f4){return _0x48a4d7(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}return _0x4b4085(_0x53bcc0[_0xb038('0x8')][_0xb038('0x9')]);}else{_0x4b4085(_0x53bcc0[_0xb038('0xa')]);}})[_0xb038('0xb')](function(_0x1e6474){_0x48a4d7(_0x1e6474);});});}function respondWithResult(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xc8;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0xc')](_0x16e4a3)[_0xb038('0xd')](_0x57acd8);}return _0x439751[_0xb038('0xe')](0x194);};}function handleError(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0x1f4;return function(_0x13acc7){logger[_0xb038('0x8')](_0x13acc7['stack']);if(_0x13acc7[_0xb038('0xf')]){delete _0x13acc7[_0xb038('0xf')];}_0x3cc717[_0xb038('0xc')](_0x3a71a6)[_0xb038('0x10')](_0x13acc7);};}function findById(_0xdef213){return function(_0x2b4173){if(!_['isNil'](_0xdef213)&&!_[_0xb038('0x11')](_0x2b4173)&&!_[_0xb038('0x11')](_0x2b4173[_0xb038('0x12')])){return _[_0xb038('0x13')](_0x2b4173['rows'],function(_0x49b237){return _0x49b237['id']==_0xdef213;});}return null;};}exports[_0xb038('0x14')]=function(_0x3f48e6,_0x3e06ef){return respondWithRpcPromise(_0xb038('0x15'),_0x3f48e6['query'])[_0xb038('0x16')](respondWithResult(_0x3e06ef,null))[_0xb038('0xb')](handleError(_0x3e06ef,null));};exports[_0xb038('0x17')]=function(_0x33a377,_0xc6cd61){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xb038('0x18')](_0x33a377[_0xb038('0x19')],_0x33a377[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0xc6cd61,null))['catch'](handleError(_0xc6cd61,null));};exports[_0xb038('0x1b')]=function(_0x1b7505,_0x4bbf38){return respondWithRpcPromise(_0xb038('0x1c'),_[_0xb038('0x18')](_0x1b7505['query'],_0x1b7505[_0xb038('0x1a')]))['then'](respondWithResult(_0x4bbf38,null))[_0xb038('0xb')](handleError(_0x4bbf38,null));};exports[_0xb038('0x1d')]=function(_0x27ff21,_0x1df7c4){return respondWithRpcPromise(_0xb038('0x1e'),_0x27ff21[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1df7c4,null))['catch'](handleError(_0x1df7c4,null));};exports[_0xb038('0x1f')]=function(_0x33cf3c,_0x226631){return respondWithRpcPromise('VoiceQueues',_0x33cf3c[_0xb038('0x19')])[_0xb038('0x16')](findById(_0x33cf3c[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x226631,null))[_0xb038('0xb')](handleError(_0x226631,null));};exports[_0xb038('0x20')]=function(_0x28a6a9,_0x12b3b6){return respondWithRpcPromise(_0xb038('0x21'),_['merge'](_0x28a6a9[_0xb038('0x22')],_0x28a6a9[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x12b3b6,null))[_0xb038('0xb')](handleError(_0x12b3b6,null));};exports[_0xb038('0x23')]=function(_0xbc8958,_0x29a0d7){return respondWithRpcPromise(_0xb038('0x24'),_[_0xb038('0x18')](_0xbc8958[_0xb038('0x19')],_0xbc8958[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x29a0d7,null))[_0xb038('0xb')](handleError(_0x29a0d7,null));};exports['voiceQueuesChannels']=function(_0x1d807a,_0x598554){return respondWithRpcPromise(_0xb038('0x25'),_0x1d807a[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x598554,null))[_0xb038('0xb')](handleError(_0x598554,null));};exports[_0xb038('0x26')]=function(_0x424b81,_0x3a393d){return respondWithRpcPromise(_0xb038('0x27'),_[_0xb038('0x18')](_0x424b81[_0xb038('0x19')],_0x424b81['params']))[_0xb038('0x16')](respondWithResult(_0x3a393d,null))[_0xb038('0xb')](handleError(_0x3a393d,null));};exports[_0xb038('0x28')]=function(_0x560342,_0x51e649){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xb038('0x18')](_0x560342[_0xb038('0x19')],_0x560342[_0xb038('0x1a')]))[_0xb038('0x16')](respondWithResult(_0x51e649,null))[_0xb038('0xb')](handleError(_0x51e649,null));};exports[_0xb038('0x29')]=function(_0x48f777,_0x16abea){return respondWithRpcPromise(_0xb038('0x2a'),_[_0xb038('0x18')](_0x48f777[_0xb038('0x19')],_0x48f777['params']))[_0xb038('0x16')](respondWithResult(_0x16abea,null))[_0xb038('0xb')](handleError(_0x16abea,null));};exports['outbound']=function(_0x5cb40c,_0x26c769){return respondWithRpcPromise(_0xb038('0x2b'),_0x5cb40c[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x26c769,null))[_0xb038('0xb')](handleError(_0x26c769,null));};exports['outboundChannels']=function(_0x404f82,_0x125d2a){return respondWithRpcPromise(_0xb038('0x2c'),_0x404f82[_0xb038('0x19')])['then'](respondWithResult(_0x125d2a,null))[_0xb038('0xb')](handleError(_0x125d2a,null));};exports[_0xb038('0x2d')]=function(_0x7d2f79,_0x573426){var _0x412d71;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')])[_0xb038('0x16')](function(_0x3ac1db){_0x412d71=_0x3ac1db;return respondWithRpcPromise('Agents',_0x7d2f79[_0xb038('0x19')],routingClient);})[_0xb038('0x16')](function(_0x4e0533){return _['merge']({},_0x4e0533,_0x412d71);})[_0xb038('0x16')](respondWithResult(_0x573426,null))[_0xb038('0xb')](handleError(_0x573426,null));};exports[_0xb038('0x2e')]=function(_0x3c291e,_0x5ad462){if(_0x3c291e[_0xb038('0x22')]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]&&_0x3c291e[_0xb038('0x30')]&&_0x3c291e['user'][_0xb038('0xf')]){for(var _0x269c7d in _0x3c291e['body'][_0xb038('0x2f')]){if(_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')]['hasOwnProperty'](_0x269c7d)){db[_0xb038('0x31')][_0xb038('0x32')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e['user']['name'],'type':_0xb038('0x33'),'exitAt':null,'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]&&_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0xb038('0x34')]?{'$notIn':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d]}:{'$ne':null}}})['then'](function(_0x5f0d9d){var _0x5e8383=moment()[_0xb038('0x35')](_0xb038('0x36'));for(var _0x52f0b8=0x0,_0x46a724=_0x5f0d9d[_0xb038('0x34')];_0x52f0b8<_0x46a724;_0x52f0b8+=0x1){_0x5f0d9d[_0x52f0b8][_0xb038('0x37')]({'exitAt':_0x5e8383});}});for(var _0x5f24cd=0x0;_0x5f24cd<_0x3c291e[_0xb038('0x22')]['interaction'][_0x269c7d]['length'];_0x5f24cd+=0x1){db[_0xb038('0x31')][_0xb038('0x38')]({'where':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'type':_0xb038('0x33'),'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd],'exitAt':null},'defaults':{'channel':_0x269c7d,'membername':_0x3c291e[_0xb038('0x30')][_0xb038('0xf')],'interface':_[_0xb038('0x11')](_0x3c291e['user'][_0xb038('0x39')])?util[_0xb038('0x35')]('SIP/%s',_0x3c291e[_0xb038('0x30')][_0xb038('0xf')]):_0x3c291e['user'][_0xb038('0x39')],'type':_0xb038('0x33'),'enterAt':moment()[_0xb038('0x35')](_0xb038('0x36')),'role':_0xb038('0x3a'),'internal':_0x3c291e[_0xb038('0x30')][_0xb038('0x3b')],'uniqueid':_0x3c291e[_0xb038('0x22')][_0xb038('0x2f')][_0x269c7d][_0x5f24cd]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3c291e[_0xb038('0x1a')]['id'],'capacity':_0x3c291e[_0xb038('0x22')][_0xb038('0x3c')]},routingClient)[_0xb038('0x16')](respondWithResult(_0x5ad462,null))[_0xb038('0xb')](handleError(_0x5ad462,null));};exports[_0xb038('0x3d')]=function(_0x591077,_0x1f4997){return respondWithRpcPromise(_0xb038('0x3e'),_0x591077[_0xb038('0x19')])[_0xb038('0x16')](respondWithResult(_0x1f4997,null))[_0xb038('0xb')](handleError(_0x1f4997,null));};exports[_0xb038('0x3f')]=function(_0xd7a862,_0x5b82f4){return respondWithRpcPromise(_0xb038('0x40'),_0xd7a862['query'])[_0xb038('0x16')](respondWithResult(_0x5b82f4,null))[_0xb038('0xb')](handleError(_0x5b82f4,null));};exports[_0xb038('0x41')]=function(_0x998fe3,_0x1518c4){return respondWithRpcPromise('Campaigns',_0x998fe3['query'])['then'](respondWithResult(_0x1518c4,null))[_0xb038('0xb')](handleError(_0x1518c4,null));};exports[_0xb038('0x42')]=function(_0x276fac,_0x218368){return respondWithRpcPromise(_0xb038('0x43'),_0x276fac[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x218368,null))[_0xb038('0xb')](handleError(_0x218368,null));};exports[_0xb038('0x44')]=function(_0x5b2cbb,_0x5b27d3){return respondWithRpcPromise(_0xb038('0x43'),_0x5b2cbb['query'],routingClient)[_0xb038('0x16')](findById(_0x5b2cbb['params']['id']))[_0xb038('0x16')](respondWithResult(_0x5b27d3,null))[_0xb038('0xb')](handleError(_0x5b27d3,null));};exports[_0xb038('0x45')]=function(_0x4300e9,_0x4ee38b){return respondWithRpcPromise(_0xb038('0x46'),_0x4300e9[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4ee38b,null))[_0xb038('0xb')](handleError(_0x4ee38b,null));};exports[_0xb038('0x47')]=function(_0x1246c8,_0x14a553){return respondWithRpcPromise(_0xb038('0x46'),_0x1246c8[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x1246c8[_0xb038('0x1a')]['id']))[_0xb038('0x16')](respondWithResult(_0x14a553,null))['catch'](handleError(_0x14a553,null));};exports[_0xb038('0x48')]=function(_0x2fc38d,_0x438e7e){return respondWithRpcPromise(_0xb038('0x49'),_0x2fc38d[_0xb038('0x19')],mailClient)['then'](respondWithResult(_0x438e7e,null))[_0xb038('0xb')](handleError(_0x438e7e,null));};exports['openchannelQueues']=function(_0xfb3ce6,_0x170a7e){return respondWithRpcPromise('OpenchannelQueues',_0xfb3ce6[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x170a7e,null))[_0xb038('0xb')](handleError(_0x170a7e,null));};exports[_0xb038('0x4a')]=function(_0x120cc7,_0x2f01c0){return respondWithRpcPromise(_0xb038('0x4b'),_0x120cc7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x120cc7[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2f01c0,null))[_0xb038('0xb')](handleError(_0x2f01c0,null));};exports['smsQueues']=function(_0x189894,_0x37e445){return respondWithRpcPromise(_0xb038('0x4c'),_0x189894[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x37e445,null))[_0xb038('0xb')](handleError(_0x37e445,null));};exports[_0xb038('0x4d')]=function(_0x4c23b2,_0x572ad4){return respondWithRpcPromise(_0xb038('0x4c'),_0x4c23b2[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4c23b2['params']['id']))['then'](respondWithResult(_0x572ad4,null))[_0xb038('0xb')](handleError(_0x572ad4,null));};exports['whatsappQueues']=function(_0x35da9e,_0x50e078){return respondWithRpcPromise(_0xb038('0x4e'),_0x35da9e['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x50e078,null))[_0xb038('0xb')](handleError(_0x50e078,null));};exports[_0xb038('0x4f')]=function(_0x112d77,_0x2c57b9){return respondWithRpcPromise(_0xb038('0x4e'),_0x112d77['query'],routingClient)['then'](findById(_0x112d77[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x2c57b9,null))[_0xb038('0xb')](handleError(_0x2c57b9,null));};exports[_0xb038('0x50')]=function(_0x2f4650,_0x538690){return respondWithRpcPromise(_0xb038('0x51'),_0x2f4650['query'],routingClient)[_0xb038('0x16')](respondWithResult(_0x538690,null))[_0xb038('0xb')](handleError(_0x538690,null));};exports[_0xb038('0x52')]=function(_0x4a417a,_0x40abb7){return respondWithRpcPromise(_0xb038('0x51'),_0x4a417a[_0xb038('0x19')],routingClient)[_0xb038('0x16')](findById(_0x4a417a[_0xb038('0x1a')]['id']))['then'](respondWithResult(_0x40abb7,null))['catch'](handleError(_0x40abb7,null));};exports['faxAccounts']=function(_0x609caf,_0x4efa0f){return respondWithRpcPromise(_0xb038('0x53'),_0x609caf['query'])[_0xb038('0x16')](respondWithResult(_0x4efa0f,null))[_0xb038('0xb')](handleError(_0x4efa0f,null));};exports[_0xb038('0x54')]=function(_0x1294d7,_0x7c8d01){return respondWithRpcPromise(_0xb038('0x55'),_0x1294d7[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x7c8d01,null))[_0xb038('0xb')](handleError(_0x7c8d01,null));};exports[_0xb038('0x56')]=function(_0x1db407,_0x1a5cf6){return respondWithRpcPromise(_0xb038('0x57'),_0x1db407[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1a5cf6,null))[_0xb038('0xb')](handleError(_0x1a5cf6,null));};exports[_0xb038('0x58')]=function(_0x123e31,_0x1f9a30){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x123e31[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x1f9a30,null))[_0xb038('0xb')](handleError(_0x1f9a30,null));};exports[_0xb038('0x59')]=function(_0xdaacfe,_0x5ead21){return respondWithRpcPromise(_0xb038('0x5a'),_0xdaacfe[_0xb038('0x19')],routingClient)[_0xb038('0x16')](function(_0x80d720){if(_0xdaacfe[_0xb038('0x19')][_0xb038('0x5b')]!==undefined){var _0x2acbf6=_(_0x80d720[_0xb038('0x12')])[_0xb038('0x5c')]([_0xdaacfe['query']['type'],_0xdaacfe[_0xb038('0x1a')]['id']])['map'](_0xb038('0x5d'))['uniq']()['value']();return _0x80d720['rows'][_0xb038('0x5c')](function(_0x463ae6){return _0x2acbf6['indexOf'](_0x463ae6[_0xb038('0x5d')])>-0x1;});}else{return _0x80d720[_0xb038('0x12')][_0xb038('0x5c')](function(_0x31ccf7){return _0x31ccf7[_0xb038('0x5d')]===parseInt(_0xdaacfe[_0xb038('0x1a')]['id']);});}})[_0xb038('0x16')](respondWithResult(_0x5ead21,null))[_0xb038('0xb')](handleError(_0x5ead21,null));};exports[_0xb038('0x5e')]=function(_0xde487d,_0x4b15b7){return respondWithRpcPromise(_0xb038('0x5f'),_0xde487d[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x4b15b7,null))[_0xb038('0xb')](handleError(_0x4b15b7,null));};exports[_0xb038('0x60')]=function(_0x222e90,_0x425854){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x222e90[_0xb038('0x19')],routingClient)[_0xb038('0x16')](respondWithResult(_0x425854,null))[_0xb038('0xb')](handleError(_0x425854,null));};exports['faxQueuesWaitingInteractions']=function(_0x551fcc,_0x2adf3b){return respondWithRpcPromise(_0xb038('0x61'),_0x551fcc[_0xb038('0x19')],routingClient)['then'](respondWithResult(_0x2adf3b,null))[_0xb038('0xb')](handleError(_0x2adf3b,null));};exports[_0xb038('0x62')]=function(_0x5b003a){return function(_0x2e6db4,_0x1d5640){var _0x240d06,_0x2a41c8;var _0x24f810=_[_0xb038('0x63')](_0x5b003a);var _0x1ea747=_0x5b003a===_0xb038('0x64')?_0xb038('0x65'):_0xb038('0x66');return db[_0x24f810+_0xb038('0x67')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x2e6db4[_0xb038('0x1a')]['id']}})[_0xb038('0x16')](function(_0x5d1410){if(_[_0xb038('0x11')](_0x5d1410)){throw new Error(_0x24f810+_0xb038('0x69'));}_0x240d06=_0x5d1410;return db[_0x24f810+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x2e6db4[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x24f810+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x24f810+_0x1ea747],'as':'Account'}]});})[_0xb038('0x16')](function(_0x3e01ce){if(_['isNil'](_0x3e01ce)){throw new Error(_0x24f810+_0xb038('0x6d'));}_0x2a41c8=_0x3e01ce;return _0x3e01ce['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x38a4d3={'uniqueid':_0x5b003a+'.'+_0x2a41c8['id']+'.'+_0x2a41c8['Interaction']['id'],'FromUserId':_0x2e6db4[_0xb038('0x30')]['id'],'type':'queue'};_0x38a4d3[_0x24f810+_0xb038('0x6e')]=_0x2a41c8['id'];_0x38a4d3[_0x24f810+_0xb038('0x6f')]=_0x2a41c8[_0xb038('0x6c')]['id'];_0x38a4d3[_0xb038('0x70')+_0x24f810+_0x1ea747+'Id']=_0x2a41c8[_0xb038('0x66')]['id'];_0x38a4d3['To'+_0x24f810+_0xb038('0x71')]=_0x240d06['id'];return db[_0x24f810+_0xb038('0x72')][_0xb038('0x73')](_0x38a4d3);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5b003a,'interaction':_0x2a41c8[_0xb038('0x6c')],'message':_0x2a41c8,'account':_0x2a41c8[_0xb038('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x74'),'appdata':_0x240d06[_0xb038('0xf')]+','+(_0x2a41c8['Account'][_0xb038('0x75')]||0x12c),'interval':_0xb038('0x76')}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x1d5640,null))[_0xb038('0xb')](handleError(_0x1d5640,null));};};exports[_0xb038('0x77')]=function(_0x139ffa,_0x208cdd){var _0x2ee9bd,_0x32ee35;if(_[_0xb038('0x11')](_0x139ffa['body']['channel'])){throw new Error(_0xb038('0x78'));}var _0xb7f025=_0x139ffa[_0xb038('0x22')][_0xb038('0x79')];var _0x3ee569=_[_0xb038('0x63')](_0xb7f025);var _0x3e129d=_0xb7f025==='chat'?_0xb038('0x65'):_0xb038('0x66');return db[_0xb038('0x7a')][_0xb038('0x68')]({'raw':!![],'where':{'id':_0x139ffa[_0xb038('0x1a')]['id'],'role':_0xb038('0x3a')}})['then'](function(_0x451fe5){if(_[_0xb038('0x11')](_0x451fe5)){throw new Error(_0xb038('0x7b'));}_0x2ee9bd=_0x451fe5;return db[_0x3ee569+_0xb038('0x6a')][_0xb038('0x68')]({'where':{'id':_0x139ffa[_0xb038('0x22')][_0xb038('0x6b')]},'include':[{'model':db[_0x3ee569+_0xb038('0x6c')],'as':_0xb038('0x6c')},{'model':db[_0x3ee569+_0x3e129d],'as':_0xb038('0x66')}]});})[_0xb038('0x16')](function(_0x22e0bd){if(_[_0xb038('0x11')](_0x22e0bd)){throw new Error(_0x3ee569+_0xb038('0x6d'));}_0x32ee35=_0x22e0bd;return _0x22e0bd[_0xb038('0x7c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb038('0x16')](function(){var _0x5448e3={'uniqueid':_0xb7f025+'.'+_0x32ee35['id']+'.'+_0x32ee35['Interaction']['id'],'FromUserId':_0x139ffa[_0xb038('0x30')]['id'],'type':_0xb038('0x74'),'ToUserId':_0x2ee9bd['id']};_0x5448e3[_0x3ee569+_0xb038('0x6e')]=_0x32ee35['id'];_0x5448e3[_0x3ee569+'InteractionId']=_0x32ee35[_0xb038('0x6c')]['id'];_0x5448e3[_0xb038('0x70')+_0x3ee569+_0x3e129d+'Id']=_0x32ee35[_0xb038('0x66')]['id'];return db[_0x3ee569+_0xb038('0x72')]['create'](_0x5448e3);})['then'](function(){return respondWithRpcPromise(_0xb038('0x7d'),{'channel':_0xb7f025,'interaction':_0x32ee35[_0xb038('0x6c')],'message':_0x32ee35,'account':_0x32ee35['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xb038('0x3a'),'appdata':_0x2ee9bd[_0xb038('0xf')]+','+(_0x32ee35[_0xb038('0x66')][_0xb038('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb038('0x16')](respondWithResult(_0x208cdd,null))[_0xb038('0xb')](handleError(_0x208cdd,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ad64464..0c44411 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 _0x7847=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id/run','run','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x540f7c,_0x2854cf){var _0x49dc8e=function(_0x308e6f){while(--_0x308e6f){_0x540f7c['push'](_0x540f7c['shift']());}};_0x49dc8e(++_0x2854cf);}(_0x7847,0xf9));var _0x7784=function(_0x21057f,_0x4e3b82){_0x21057f=_0x21057f-0x0;var _0x1e2c77=_0x7847[_0x21057f];return _0x1e2c77;};'use strict';var multer=require(_0x7784('0x0'));var util=require(_0x7784('0x1'));var path=require(_0x7784('0x2'));var timeout=require(_0x7784('0x3'));var express=require('express');var router=express[_0x7784('0x4')]();var fs_extra=require(_0x7784('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7784('0x6'));var config=require(_0x7784('0x7'));var controller=require(_0x7784('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7784('0x9')]('/:id',auth[_0x7784('0xa')](),controller['show']);router[_0x7784('0x9')](_0x7784('0xb'),auth['isAuthenticated'](),controller[_0x7784('0xc')]);router[_0x7784('0xd')]('/',auth[_0x7784('0xa')](),controller[_0x7784('0xe')]);router[_0x7784('0xf')](_0x7784('0x10'),auth[_0x7784('0xa')](),controller[_0x7784('0x11')]);router[_0x7784('0x12')](_0x7784('0x10'),auth[_0x7784('0xa')](),controller[_0x7784('0x13')]);module[_0x7784('0x14')]=router; \ No newline at end of file +var _0xd3cc=['isAuthenticated','/:id/run','post','create','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','index','/:id'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0xd3cc,0x1a6));var _0xcd3c=function(_0x16631d,_0xfa552d){_0x16631d=_0x16631d-0x0;var _0x2f34fe=_0xd3cc[_0x16631d];return _0x2f34fe;};'use strict';var multer=require('multer');var util=require(_0xcd3c('0x0'));var path=require(_0xcd3c('0x1'));var timeout=require('connect-timeout');var express=require(_0xcd3c('0x2'));var router=express[_0xcd3c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcd3c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcd3c('0x5'));var controller=require(_0xcd3c('0x6'));router[_0xcd3c('0x7')]('/',auth['isAuthenticated'](),controller[_0xcd3c('0x8')]);router['get'](_0xcd3c('0x9'),auth[_0xcd3c('0xa')](),controller['show']);router[_0xcd3c('0x7')](_0xcd3c('0xb'),auth[_0xcd3c('0xa')](),controller['run']);router[_0xcd3c('0xc')]('/',auth['isAuthenticated'](),controller[_0xcd3c('0xd')]);router['put'](_0xcd3c('0x9'),auth['isAuthenticated'](),controller[_0xcd3c('0xe')]);router[_0xcd3c('0xf')](_0xcd3c('0x9'),auth[_0xcd3c('0xa')](),controller[_0xcd3c('0x10')]);module[_0xcd3c('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index fccf65b..3adc04c 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 _0xbd42=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','default','custom','TEXT'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0xbd42,0xa8));var _0x2bd4=function(_0x4e53f3,_0x46a9e3){_0x4e53f3=_0x4e53f3-0x0;var _0x4273d4=_0xbd42[_0x4e53f3];return _0x4273d4;};'use strict';var Sequelize=require(_0x2bd4('0x0'));module[_0x2bd4('0x1')]={'name':{'type':Sequelize[_0x2bd4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2bd4('0x2')]},'active':{'type':Sequelize[_0x2bd4('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2bd4('0x2')],'allowNull':![],'defaultValue':_0x2bd4('0x4')},'startAt':{'type':Sequelize[_0x2bd4('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2bd4('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2bd4('0x7')](_0x2bd4('0x8'),_0x2bd4('0x9'),_0x2bd4('0xa'),_0x2bd4('0xb'),_0x2bd4('0xc'),_0x2bd4('0xd'),_0x2bd4('0xe')),'allowNull':![],'defaultValue':_0x2bd4('0xc')},'output':{'type':Sequelize['ENUM'](_0x2bd4('0xf'),_0x2bd4('0x10'),_0x2bd4('0x11')),'allowNull':![],'defaultValue':_0x2bd4('0xf')},'type':{'type':Sequelize[_0x2bd4('0x7')]('custom',_0x2bd4('0x12')),'allowNull':![],'defaultValue':_0x2bd4('0x13')},'sendMail':{'type':Sequelize[_0x2bd4('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2bd4('0x14')]},'bcc':{'type':Sequelize[_0x2bd4('0x14')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9f1e=['quarters','weeks','days','minutes','ENUM','csv','pdf','custom','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x52605d,_0x4fb60e){var _0x39c247=function(_0x55bdf6){while(--_0x55bdf6){_0x52605d['push'](_0x52605d['shift']());}};_0x39c247(++_0x4fb60e);}(_0x9f1e,0x130));var _0xe9f1=function(_0x4fa06a,_0x3eb632){_0x4fa06a=_0x4fa06a-0x0;var _0x1ed5bc=_0x9f1e[_0x4fa06a];return _0x1ed5bc;};'use strict';var Sequelize=require(_0xe9f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xe9f1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe9f1('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9f1('0x2')},'startAt':{'type':Sequelize[_0xe9f1('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xe9f1('0x4'),'months',_0xe9f1('0x5'),_0xe9f1('0x6'),'hours',_0xe9f1('0x7')),'allowNull':![],'defaultValue':_0xe9f1('0x6')},'output':{'type':Sequelize[_0xe9f1('0x8')](_0xe9f1('0x9'),_0xe9f1('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0xe9f1('0x9')},'type':{'type':Sequelize[_0xe9f1('0x8')](_0xe9f1('0xb'),'default'),'allowNull':![],'defaultValue':_0xe9f1('0xb')},'sendMail':{'type':Sequelize[_0xe9f1('0xc')],'defaultValue':![]},'email':{'type':Sequelize[_0xe9f1('0x1')]},'cc':{'type':Sequelize[_0xe9f1('0xd')]},'bcc':{'type':Sequelize[_0xe9f1('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xe9f1('0xc')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 93e93d7..60ba87f 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 _0x31da=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','name','send','index','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Schedule','includeAll','include','rows','catch','keys','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','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x414834,_0x346280){var _0x697f02=function(_0x309212){while(--_0x309212){_0x414834['push'](_0x414834['shift']());}};_0x697f02(++_0x346280);}(_0x31da,0x1f4));var _0xa31d=function(_0x95b4a8,_0x3c1c28){_0x95b4a8=_0x95b4a8-0x0;var _0x563671=_0x31da[_0x95b4a8];return _0x563671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa31d('0x0'));var zipdir=require(_0xa31d('0x1'));var jsonpatch=require(_0xa31d('0x2'));var rp=require(_0xa31d('0x3'));var moment=require(_0xa31d('0x4'));var BPromise=require(_0xa31d('0x5'));var Mustache=require(_0xa31d('0x6'));var util=require(_0xa31d('0x7'));var path=require(_0xa31d('0x8'));var sox=require(_0xa31d('0x9'));var csv=require(_0xa31d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa31d('0xb'));var _=require(_0xa31d('0xc'));var squel=require(_0xa31d('0xd'));var crypto=require(_0xa31d('0xe'));var jsforce=require(_0xa31d('0xf'));var deskjs=require(_0xa31d('0x10'));var toCsv=require(_0xa31d('0xa'));var querystring=require(_0xa31d('0x11'));var Papa=require('papaparse');var Redis=require(_0xa31d('0x12'));var authService=require(_0xa31d('0x13'));var qs=require(_0xa31d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa31d('0x15'))(_0xa31d('0x16'));var utils=require(_0xa31d('0x17'));var config=require(_0xa31d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa31d('0x19'))['db'];function respondWithStatusCode(_0x2598f2,_0x56157d){_0x56157d=_0x56157d||0xcc;return function(_0x174f1f){if(_0x174f1f){return _0x2598f2[_0xa31d('0x1a')](_0x56157d);}return _0x2598f2[_0xa31d('0x1b')](_0x56157d)[_0xa31d('0x1c')]();};}function respondWithResult(_0x2c0887,_0x5c35bb){_0x5c35bb=_0x5c35bb||0xc8;return function(_0x1075fe){if(_0x1075fe){return _0x2c0887['status'](_0x5c35bb)[_0xa31d('0x1d')](_0x1075fe);}};}function respondWithFilteredResult(_0x23eaa1,_0x28760f){return function(_0x4b05b2){if(_0x4b05b2){var _0x593b54=typeof _0x28760f[_0xa31d('0x1e')]===_0xa31d('0x1f')&&typeof _0x28760f['limit']===_0xa31d('0x1f');var _0x5a093e=_0x4b05b2[_0xa31d('0x20')];var _0x31a2ab=_0x593b54?0x0:_0x28760f['offset'];var _0x1bf388=_0x593b54?_0x4b05b2[_0xa31d('0x20')]:_0x28760f[_0xa31d('0x1e')]+_0x28760f[_0xa31d('0x21')];var _0x45cb08;if(_0x1bf388>=_0x5a093e){_0x1bf388=_0x5a093e;_0x45cb08=0xc8;}else{_0x45cb08=0xce;}_0x23eaa1[_0xa31d('0x1b')](_0x45cb08);return _0x23eaa1[_0xa31d('0x22')](_0xa31d('0x23'),_0x31a2ab+'-'+_0x1bf388+'/'+_0x5a093e)[_0xa31d('0x1d')](_0x4b05b2);}return null;};}function patchUpdates(_0x534512){return function(_0x5101da){try{jsonpatch[_0xa31d('0x24')](_0x5101da,_0x534512,!![]);}catch(_0x49cb39){return BPromise[_0xa31d('0x25')](_0x49cb39);}return _0x5101da['save']();};}function saveUpdates(_0x5ec410,_0x596a93){return function(_0x271c23){if(_0x271c23){return _0x271c23[_0xa31d('0x26')](_0x5ec410)[_0xa31d('0x27')](function(_0x535bb6){return _0x535bb6;});}return null;};}function removeEntity(_0x542a18,_0x38673a){return function(_0xcb720d){if(_0xcb720d){return _0xcb720d[_0xa31d('0x28')]()[_0xa31d('0x27')](function(){var _0x547070=_0xcb720d[_0xa31d('0x29')]({'plain':!![]});var _0x173bbd=_0xa31d('0x2a');return db[_0xa31d('0x2b')]['destroy']({'where':{'type':_0x173bbd,'resourceId':_0x547070['id']}})[_0xa31d('0x27')](function(){return _0xcb720d;});})[_0xa31d('0x27')](function(){_0x542a18[_0xa31d('0x1b')](0xcc)[_0xa31d('0x1c')]();});}};}function handleEntityNotFound(_0x355d87,_0x46861e){return function(_0x10df60){if(!_0x10df60){_0x355d87['sendStatus'](0x194);}return _0x10df60;};}function handleError(_0x500327,_0x15f906){_0x15f906=_0x15f906||0x1f4;return function(_0x3a8aaa){logger[_0xa31d('0x2c')](_0x3a8aaa['stack']);if(_0x3a8aaa['name']){delete _0x3a8aaa[_0xa31d('0x2d')];}_0x500327[_0xa31d('0x1b')](_0x15f906)[_0xa31d('0x2e')](_0x3a8aaa);};}exports[_0xa31d('0x2f')]=function(_0x22a245,_0x27a075){var _0x3a373e={},_0x1f6e3f={},_0x40fe70={'count':0x0,'rows':[]};var _0x51aa97=_['map'](db['Schedule']['rawAttributes'],function(_0x42f661){return{'name':_0x42f661['fieldName'],'type':_0x42f661[_0xa31d('0x30')][_0xa31d('0x31')]};});_0x1f6e3f[_0xa31d('0x32')]=_[_0xa31d('0x33')](_0x51aa97,_0xa31d('0x2d'));_0x1f6e3f['query']=_['keys'](_0x22a245[_0xa31d('0x34')]);_0x1f6e3f[_0xa31d('0x35')]=_[_0xa31d('0x36')](_0x1f6e3f[_0xa31d('0x32')],_0x1f6e3f[_0xa31d('0x34')]);_0x3a373e[_0xa31d('0x37')]=_[_0xa31d('0x36')](_0x1f6e3f['model'],qs[_0xa31d('0x38')](_0x22a245[_0xa31d('0x34')]['fields']));_0x3a373e['attributes']=_0x3a373e[_0xa31d('0x37')][_0xa31d('0x39')]?_0x3a373e[_0xa31d('0x37')]:_0x1f6e3f[_0xa31d('0x32')];if(!_0x22a245[_0xa31d('0x34')]['hasOwnProperty'](_0xa31d('0x3a'))){_0x3a373e[_0xa31d('0x21')]=qs[_0xa31d('0x21')](_0x22a245[_0xa31d('0x34')][_0xa31d('0x21')]);_0x3a373e['offset']=qs[_0xa31d('0x1e')](_0x22a245[_0xa31d('0x34')][_0xa31d('0x1e')]);}_0x3a373e[_0xa31d('0x3b')]=qs[_0xa31d('0x3c')](_0x22a245[_0xa31d('0x34')][_0xa31d('0x3c')]);_0x3a373e[_0xa31d('0x3d')]=qs['filters'](_[_0xa31d('0x3e')](_0x22a245[_0xa31d('0x34')],_0x1f6e3f[_0xa31d('0x35')]),_0x51aa97);if(_0x22a245['query']['filter']){_0x3a373e[_0xa31d('0x3d')]=_[_0xa31d('0x3f')](_0x3a373e[_0xa31d('0x3d')],{'$or':_[_0xa31d('0x33')](_0x51aa97,function(_0xd4b65d){if(_0xd4b65d['type']!==_0xa31d('0x40')){var _0x40e96e={};_0x40e96e[_0xd4b65d[_0xa31d('0x2d')]]={'$like':'%'+_0x22a245[_0xa31d('0x34')][_0xa31d('0x41')]+'%'};return _0x40e96e;}})});}_0x3a373e=_[_0xa31d('0x3f')]({},_0x3a373e,_0x22a245[_0xa31d('0x42')]);var _0x233d45={'where':_0x3a373e[_0xa31d('0x3d')]};return db[_0xa31d('0x43')][_0xa31d('0x20')](_0x233d45)[_0xa31d('0x27')](function(_0x3ebc16){_0x40fe70[_0xa31d('0x20')]=_0x3ebc16;if(_0x22a245[_0xa31d('0x34')][_0xa31d('0x44')]){_0x3a373e[_0xa31d('0x45')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x3a373e);})[_0xa31d('0x27')](function(_0x306b57){_0x40fe70[_0xa31d('0x46')]=_0x306b57;return _0x40fe70;})['then'](respondWithFilteredResult(_0x27a075,_0x3a373e))[_0xa31d('0x47')](handleError(_0x27a075,null));};exports['show']=function(_0x19207e,_0x5ae006){var _0x1211ea={'raw':![],'where':{'id':_0x19207e['params']['id']}},_0x491524={};_0x491524[_0xa31d('0x32')]=_['keys'](db[_0xa31d('0x43')]['rawAttributes']);_0x491524[_0xa31d('0x34')]=_[_0xa31d('0x48')](_0x19207e[_0xa31d('0x34')]);_0x491524['filters']=_[_0xa31d('0x36')](_0x491524[_0xa31d('0x32')],_0x491524[_0xa31d('0x34')]);_0x1211ea['attributes']=_['intersection'](_0x491524[_0xa31d('0x32')],qs[_0xa31d('0x38')](_0x19207e[_0xa31d('0x34')][_0xa31d('0x38')]));_0x1211ea[_0xa31d('0x37')]=_0x1211ea[_0xa31d('0x37')]['length']?_0x1211ea[_0xa31d('0x37')]:_0x491524[_0xa31d('0x32')];if(_0x19207e[_0xa31d('0x34')][_0xa31d('0x44')]){_0x1211ea[_0xa31d('0x45')]=[{'all':!![]}];}_0x1211ea=_[_0xa31d('0x3f')]({},_0x1211ea,_0x19207e['options']);return db[_0xa31d('0x43')][_0xa31d('0x49')](_0x1211ea)[_0xa31d('0x27')](handleEntityNotFound(_0x5ae006,null))['then'](respondWithResult(_0x5ae006,null))['catch'](handleError(_0x5ae006,null));};exports[_0xa31d('0x4a')]=function(_0x7ab9b3,_0x14c402){return db['Schedule'][_0xa31d('0x4a')](_0x7ab9b3['body'],{})[_0xa31d('0x27')](function(_0x18e951){var _0x4d1a3b=_0x7ab9b3[_0xa31d('0x4b')][_0xa31d('0x29')]({'plain':!![]});if(!_0x4d1a3b)throw new Error(_0xa31d('0x4c'));if(_0x4d1a3b[_0xa31d('0x4d')]===_0xa31d('0x4b')){var _0x110678=_0x18e951[_0xa31d('0x29')]({'plain':!![]});var _0x756779=_0xa31d('0x2a');return db[_0xa31d('0x4e')][_0xa31d('0x49')]({'where':{'name':_0x756779,'userProfileId':_0x4d1a3b[_0xa31d('0x4f')]},'raw':!![]})['then'](function(_0x32f77f){if(_0x32f77f&&_0x32f77f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x110678[_0xa31d('0x2d')],'resourceId':_0x110678['id'],'type':_0x32f77f[_0xa31d('0x2d')],'sectionId':_0x32f77f['id']},{})[_0xa31d('0x27')](function(){return _0x18e951;});}else{return _0x18e951;}})[_0xa31d('0x47')](function(_0x1160f2){logger[_0xa31d('0x2c')](_0xa31d('0x50'),_0x1160f2);throw _0x1160f2;});}return _0x18e951;})[_0xa31d('0x27')](respondWithResult(_0x14c402,0xc9))[_0xa31d('0x47')](handleError(_0x14c402,null));};exports[_0xa31d('0x26')]=function(_0x4bebe0,_0x3a1367){if(_0x4bebe0['body']['id']){delete _0x4bebe0[_0xa31d('0x51')]['id'];}return db[_0xa31d('0x43')][_0xa31d('0x49')]({'where':{'id':_0x4bebe0['params']['id']}})['then'](handleEntityNotFound(_0x3a1367,null))[_0xa31d('0x27')](saveUpdates(_0x4bebe0[_0xa31d('0x51')],null))[_0xa31d('0x27')](respondWithResult(_0x3a1367,null))[_0xa31d('0x47')](handleError(_0x3a1367,null));};exports[_0xa31d('0x28')]=function(_0x42142d,_0x149760){return db['Schedule'][_0xa31d('0x49')]({'where':{'id':_0x42142d[_0xa31d('0x52')]['id']}})[_0xa31d('0x27')](handleEntityNotFound(_0x149760,null))[_0xa31d('0x27')](removeEntity(_0x149760,null))['catch'](handleError(_0x149760,null));};exports[_0xa31d('0x53')]=function(_0x1e6b87,_0x57ff2f,_0x3874c9){var _0x26b2ea=require(_0xa31d('0x54'));return db[_0xa31d('0x43')][_0xa31d('0x49')]({'where':{'id':_0x1e6b87[_0xa31d('0x52')]['id']},'raw':!![]})[_0xa31d('0x27')](handleEntityNotFound(_0x57ff2f,null))[_0xa31d('0x27')](function(){_0x26b2ea[_0xa31d('0x53')](_0x1e6b87[_0xa31d('0x52')]['id']);})['then'](respondWithStatusCode(_0x57ff2f,null))[_0xa31d('0x47')](handleError(_0x57ff2f,null));}; \ No newline at end of file +var _0xdbb9=['autoAssociation','error','body','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','length','sort','where','filters','pick','merge','filter','options','include','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbb9,0xfb));var _0x9dbb=function(_0x28ad77,_0x4c16d1){_0x28ad77=_0x28ad77-0x0;var _0x465af7=_0xdbb9[_0x28ad77];return _0x465af7;};'use strict';var emlformat=require(_0x9dbb('0x0'));var rimraf=require(_0x9dbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require(_0x9dbb('0x4'));var BPromise=require(_0x9dbb('0x5'));var Mustache=require(_0x9dbb('0x6'));var util=require('util');var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require(_0x9dbb('0xa'));var fs=require('fs');var fs_extra=require(_0x9dbb('0xb'));var _=require(_0x9dbb('0xc'));var squel=require(_0x9dbb('0xd'));var crypto=require('crypto');var jsforce=require(_0x9dbb('0xe'));var deskjs=require(_0x9dbb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9dbb('0x10'));var authService=require(_0x9dbb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9dbb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9dbb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9dbb('0x14'));var licenseUtil=require(_0x9dbb('0x15'));var db=require(_0x9dbb('0x16'))['db'];function respondWithStatusCode(_0x4ff138,_0x60cdba){_0x60cdba=_0x60cdba||0xcc;return function(_0x2385e1){if(_0x2385e1){return _0x4ff138[_0x9dbb('0x17')](_0x60cdba);}return _0x4ff138['status'](_0x60cdba)[_0x9dbb('0x18')]();};}function respondWithResult(_0x2477bb,_0x2c9573){_0x2c9573=_0x2c9573||0xc8;return function(_0x937bad){if(_0x937bad){return _0x2477bb[_0x9dbb('0x19')](_0x2c9573)[_0x9dbb('0x1a')](_0x937bad);}};}function respondWithFilteredResult(_0x221855,_0x1d5be5){return function(_0x4c62d7){if(_0x4c62d7){var _0x588942=typeof _0x1d5be5[_0x9dbb('0x1b')]===_0x9dbb('0x1c')&&typeof _0x1d5be5[_0x9dbb('0x1d')]===_0x9dbb('0x1c');var _0x7d069b=_0x4c62d7[_0x9dbb('0x1e')];var _0x4620d6=_0x588942?0x0:_0x1d5be5['offset'];var _0x51cf99=_0x588942?_0x4c62d7[_0x9dbb('0x1e')]:_0x1d5be5[_0x9dbb('0x1b')]+_0x1d5be5[_0x9dbb('0x1d')];var _0x34fa27;if(_0x51cf99>=_0x7d069b){_0x51cf99=_0x7d069b;_0x34fa27=0xc8;}else{_0x34fa27=0xce;}_0x221855[_0x9dbb('0x19')](_0x34fa27);return _0x221855[_0x9dbb('0x1f')](_0x9dbb('0x20'),_0x4620d6+'-'+_0x51cf99+'/'+_0x7d069b)[_0x9dbb('0x1a')](_0x4c62d7);}return null;};}function patchUpdates(_0x5db96e){return function(_0x40d5f7){try{jsonpatch[_0x9dbb('0x21')](_0x40d5f7,_0x5db96e,!![]);}catch(_0x1ddd28){return BPromise[_0x9dbb('0x22')](_0x1ddd28);}return _0x40d5f7['save']();};}function saveUpdates(_0x1a051d,_0x1466ff){return function(_0x101e1a){if(_0x101e1a){return _0x101e1a[_0x9dbb('0x23')](_0x1a051d)[_0x9dbb('0x24')](function(_0xa57532){return _0xa57532;});}return null;};}function removeEntity(_0x1e4216,_0x18b65d){return function(_0x17affa){if(_0x17affa){return _0x17affa[_0x9dbb('0x25')]()['then'](function(){var _0x2e0d5e=_0x17affa[_0x9dbb('0x26')]({'plain':!![]});var _0x4cbed6='Scheduler';return db[_0x9dbb('0x27')][_0x9dbb('0x25')]({'where':{'type':_0x4cbed6,'resourceId':_0x2e0d5e['id']}})[_0x9dbb('0x24')](function(){return _0x17affa;});})[_0x9dbb('0x24')](function(){_0x1e4216[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x18')]();});}};}function handleEntityNotFound(_0x18876b,_0x4c1a82){return function(_0x36189d){if(!_0x36189d){_0x18876b[_0x9dbb('0x17')](0x194);}return _0x36189d;};}function handleError(_0x54a6b8,_0x59db4d){_0x59db4d=_0x59db4d||0x1f4;return function(_0x42610c){logger['error'](_0x42610c[_0x9dbb('0x28')]);if(_0x42610c[_0x9dbb('0x29')]){delete _0x42610c['name'];}_0x54a6b8[_0x9dbb('0x19')](_0x59db4d)[_0x9dbb('0x2a')](_0x42610c);};}exports[_0x9dbb('0x2b')]=function(_0x2b1a4a,_0x4944dc){var _0x383689={},_0x4ca1ad={},_0x2f7ce8={'count':0x0,'rows':[]};var _0x183ddf=_['map'](db[_0x9dbb('0x2c')][_0x9dbb('0x2d')],function(_0xf4fbbf){return{'name':_0xf4fbbf[_0x9dbb('0x2e')],'type':_0xf4fbbf[_0x9dbb('0x2f')][_0x9dbb('0x30')]};});_0x4ca1ad[_0x9dbb('0x31')]=_[_0x9dbb('0x32')](_0x183ddf,_0x9dbb('0x29'));_0x4ca1ad['query']=_[_0x9dbb('0x33')](_0x2b1a4a['query']);_0x4ca1ad['filters']=_[_0x9dbb('0x34')](_0x4ca1ad['model'],_0x4ca1ad[_0x9dbb('0x35')]);_0x383689['attributes']=_[_0x9dbb('0x34')](_0x4ca1ad[_0x9dbb('0x31')],qs[_0x9dbb('0x36')](_0x2b1a4a['query']['fields']));_0x383689[_0x9dbb('0x37')]=_0x383689[_0x9dbb('0x37')][_0x9dbb('0x38')]?_0x383689[_0x9dbb('0x37')]:_0x4ca1ad['model'];if(!_0x2b1a4a[_0x9dbb('0x35')]['hasOwnProperty']('nolimit')){_0x383689[_0x9dbb('0x1d')]=qs[_0x9dbb('0x1d')](_0x2b1a4a['query'][_0x9dbb('0x1d')]);_0x383689['offset']=qs[_0x9dbb('0x1b')](_0x2b1a4a[_0x9dbb('0x35')]['offset']);}_0x383689['order']=qs['sort'](_0x2b1a4a[_0x9dbb('0x35')][_0x9dbb('0x39')]);_0x383689[_0x9dbb('0x3a')]=qs[_0x9dbb('0x3b')](_[_0x9dbb('0x3c')](_0x2b1a4a[_0x9dbb('0x35')],_0x4ca1ad[_0x9dbb('0x3b')]),_0x183ddf);if(_0x2b1a4a['query']['filter']){_0x383689['where']=_[_0x9dbb('0x3d')](_0x383689[_0x9dbb('0x3a')],{'$or':_[_0x9dbb('0x32')](_0x183ddf,function(_0x44cabe){if(_0x44cabe['type']!=='VIRTUAL'){var _0x1d1bf2={};_0x1d1bf2[_0x44cabe[_0x9dbb('0x29')]]={'$like':'%'+_0x2b1a4a[_0x9dbb('0x35')][_0x9dbb('0x3e')]+'%'};return _0x1d1bf2;}})});}_0x383689=_[_0x9dbb('0x3d')]({},_0x383689,_0x2b1a4a[_0x9dbb('0x3f')]);var _0x4f4090={'where':_0x383689[_0x9dbb('0x3a')]};return db[_0x9dbb('0x2c')][_0x9dbb('0x1e')](_0x4f4090)[_0x9dbb('0x24')](function(_0x4e508b){_0x2f7ce8['count']=_0x4e508b;if(_0x2b1a4a['query']['includeAll']){_0x383689[_0x9dbb('0x40')]=[{'all':!![]}];}return db[_0x9dbb('0x2c')]['findAll'](_0x383689);})[_0x9dbb('0x24')](function(_0x4215b4){_0x2f7ce8[_0x9dbb('0x41')]=_0x4215b4;return _0x2f7ce8;})[_0x9dbb('0x24')](respondWithFilteredResult(_0x4944dc,_0x383689))[_0x9dbb('0x42')](handleError(_0x4944dc,null));};exports[_0x9dbb('0x43')]=function(_0x4fb538,_0x455a25){var _0x4886aa={'raw':![],'where':{'id':_0x4fb538[_0x9dbb('0x44')]['id']}},_0x5373f9={};_0x5373f9[_0x9dbb('0x31')]=_['keys'](db[_0x9dbb('0x2c')][_0x9dbb('0x2d')]);_0x5373f9['query']=_[_0x9dbb('0x33')](_0x4fb538[_0x9dbb('0x35')]);_0x5373f9['filters']=_[_0x9dbb('0x34')](_0x5373f9[_0x9dbb('0x31')],_0x5373f9[_0x9dbb('0x35')]);_0x4886aa[_0x9dbb('0x37')]=_[_0x9dbb('0x34')](_0x5373f9['model'],qs[_0x9dbb('0x36')](_0x4fb538['query']['fields']));_0x4886aa[_0x9dbb('0x37')]=_0x4886aa[_0x9dbb('0x37')][_0x9dbb('0x38')]?_0x4886aa['attributes']:_0x5373f9[_0x9dbb('0x31')];if(_0x4fb538[_0x9dbb('0x35')][_0x9dbb('0x45')]){_0x4886aa[_0x9dbb('0x40')]=[{'all':!![]}];}_0x4886aa=_[_0x9dbb('0x3d')]({},_0x4886aa,_0x4fb538[_0x9dbb('0x3f')]);return db['Schedule'][_0x9dbb('0x46')](_0x4886aa)['then'](handleEntityNotFound(_0x455a25,null))[_0x9dbb('0x24')](respondWithResult(_0x455a25,null))[_0x9dbb('0x42')](handleError(_0x455a25,null));};exports[_0x9dbb('0x47')]=function(_0x59fae6,_0xe6d0b0){return db[_0x9dbb('0x2c')]['create'](_0x59fae6['body'],{})['then'](function(_0x5ce7dc){var _0x223c4a=_0x59fae6['user']['get']({'plain':!![]});if(!_0x223c4a)throw new Error(_0x9dbb('0x48'));if(_0x223c4a[_0x9dbb('0x49')]===_0x9dbb('0x4a')){var _0x3220fd=_0x5ce7dc['get']({'plain':!![]});var _0x33585a=_0x9dbb('0x4b');return db[_0x9dbb('0x4c')][_0x9dbb('0x46')]({'where':{'name':_0x33585a,'userProfileId':_0x223c4a['userProfileId']},'raw':!![]})[_0x9dbb('0x24')](function(_0x24486c){if(_0x24486c&&_0x24486c[_0x9dbb('0x4d')]===0x0){return db['UserProfileResource'][_0x9dbb('0x47')]({'name':_0x3220fd[_0x9dbb('0x29')],'resourceId':_0x3220fd['id'],'type':_0x24486c['name'],'sectionId':_0x24486c['id']},{})[_0x9dbb('0x24')](function(){return _0x5ce7dc;});}else{return _0x5ce7dc;}})[_0x9dbb('0x42')](function(_0xd7cda2){logger[_0x9dbb('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd7cda2);throw _0xd7cda2;});}return _0x5ce7dc;})[_0x9dbb('0x24')](respondWithResult(_0xe6d0b0,0xc9))[_0x9dbb('0x42')](handleError(_0xe6d0b0,null));};exports[_0x9dbb('0x23')]=function(_0x3242a9,_0x11d96a){if(_0x3242a9[_0x9dbb('0x4f')]['id']){delete _0x3242a9[_0x9dbb('0x4f')]['id'];}return db[_0x9dbb('0x2c')]['find']({'where':{'id':_0x3242a9['params']['id']}})[_0x9dbb('0x24')](handleEntityNotFound(_0x11d96a,null))[_0x9dbb('0x24')](saveUpdates(_0x3242a9[_0x9dbb('0x4f')],null))[_0x9dbb('0x24')](respondWithResult(_0x11d96a,null))[_0x9dbb('0x42')](handleError(_0x11d96a,null));};exports[_0x9dbb('0x25')]=function(_0x14a626,_0x22d41d){return db['Schedule'][_0x9dbb('0x46')]({'where':{'id':_0x14a626[_0x9dbb('0x44')]['id']}})['then'](handleEntityNotFound(_0x22d41d,null))[_0x9dbb('0x24')](removeEntity(_0x22d41d,null))[_0x9dbb('0x42')](handleError(_0x22d41d,null));};exports['run']=function(_0x37ecf4,_0x3e3d39,_0x50f03c){var _0x113b6c=require(_0x9dbb('0x50'));return db[_0x9dbb('0x2c')][_0x9dbb('0x46')]({'where':{'id':_0x37ecf4[_0x9dbb('0x44')]['id']},'raw':!![]})[_0x9dbb('0x24')](handleEntityNotFound(_0x3e3d39,null))['then'](function(){_0x113b6c[_0x9dbb('0x51')](_0x37ecf4[_0x9dbb('0x44')]['id']);})['then'](respondWithStatusCode(_0x3e3d39,null))['catch'](handleError(_0x3e3d39,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5340d35..fe5bb97 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 _0x8382=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','tools_schedules','util'];(function(_0x493c8f,_0xdfd05){var _0x45722c=function(_0x4dc8f5){while(--_0x4dc8f5){_0x493c8f['push'](_0x493c8f['shift']());}};_0x45722c(++_0xdfd05);}(_0x8382,0x8e));var _0x2838=function(_0x98062e,_0x29e3dc){_0x98062e=_0x98062e-0x0;var _0x45d9c8=_0x8382[_0x98062e];return _0x45d9c8;};'use strict';var _=require('lodash');var util=require(_0x2838('0x0'));var logger=require(_0x2838('0x1'))(_0x2838('0x2'));var moment=require('moment');var BPromise=require(_0x2838('0x3'));var rp=require(_0x2838('0x4'));var fs=require('fs');var path=require(_0x2838('0x5'));var rimraf=require(_0x2838('0x6'));var config=require(_0x2838('0x7'));var attributes=require(_0x2838('0x8'));module['exports']=function(_0x26410b,_0x5f104d){return _0x26410b[_0x2838('0x9')]('Schedule',attributes,{'tableName':_0x2838('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe378=['api','moment','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0xe500db,_0x103349){var _0x5734ff=function(_0x26dd69){while(--_0x26dd69){_0xe500db['push'](_0xe500db['shift']());}};_0x5734ff(++_0x103349);}(_0xe378,0x1eb));var _0x8e37=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0xe378[_0x291aaf];return _0x5571e6;};'use strict';var _=require(_0x8e37('0x0'));var util=require(_0x8e37('0x1'));var logger=require(_0x8e37('0x2'))(_0x8e37('0x3'));var moment=require(_0x8e37('0x4'));var BPromise=require('bluebird');var rp=require(_0x8e37('0x5'));var fs=require('fs');var path=require(_0x8e37('0x6'));var rimraf=require('rimraf');var config=require(_0x8e37('0x7'));var attributes=require(_0x8e37('0x8'));module[_0x8e37('0x9')]=function(_0x326e08,_0x1b6144){return _0x326e08[_0x8e37('0xa')](_0x8e37('0xb'),attributes,{'tableName':_0x8e37('0xc'),'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 e18e390..34e3304 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 _0x9f9d=['info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5874c2,_0x5b61a4){var _0x4cab66=function(_0x172f24){while(--_0x172f24){_0x5874c2['push'](_0x5874c2['shift']());}};_0x4cab66(++_0x5b61a4);}(_0x9f9d,0xc2));var _0xd9f9=function(_0x5254b1,_0x471ede){_0x5254b1=_0x5254b1-0x0;var _0xfaddd4=_0x9f9d[_0x5254b1];return _0xfaddd4;};'use strict';var _=require(_0xd9f9('0x0'));var util=require(_0xd9f9('0x1'));var moment=require(_0xd9f9('0x2'));var BPromise=require(_0xd9f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9f9('0x4'));var db=require(_0xd9f9('0x5'))['db'];var utils=require(_0xd9f9('0x6'));var logger=require('../../config/logger')(_0xd9f9('0x7'));var config=require(_0xd9f9('0x8'));var jayson=require(_0xd9f9('0x9'));var client=jayson[_0xd9f9('0xa')][_0xd9f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x268a8d,_0x27899a,_0x5c1dd4){return new BPromise(function(_0x69a491,_0x10f7b2){return client['request'](_0x268a8d,_0x5c1dd4)[_0xd9f9('0xc')](function(_0x4e3437){logger[_0xd9f9('0xd')](_0xd9f9('0xe'),_0x27899a,_0xd9f9('0xf'));logger['debug'](_0xd9f9('0x10'),_0x27899a,_0xd9f9('0xf'),JSON[_0xd9f9('0x11')](_0x4e3437));if(_0x4e3437[_0xd9f9('0x12')]){if(_0x4e3437[_0xd9f9('0x12')][_0xd9f9('0x13')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x27899a,_0x4e3437[_0xd9f9('0x12')]['message']);return _0x10f7b2(_0x4e3437[_0xd9f9('0x12')][_0xd9f9('0x14')]);}logger[_0xd9f9('0x12')](_0xd9f9('0xe'),_0x27899a,_0x4e3437[_0xd9f9('0x12')][_0xd9f9('0x14')]);return _0x69a491(_0x4e3437[_0xd9f9('0x12')]['message']);}else{logger[_0xd9f9('0xd')](_0xd9f9('0xe'),_0x27899a,_0xd9f9('0xf'));_0x69a491(_0x4e3437[_0xd9f9('0x15')][_0xd9f9('0x14')]);}})[_0xd9f9('0x16')](function(_0x4a98be){logger[_0xd9f9('0x12')](_0xd9f9('0xe'),_0x27899a,_0x4a98be);_0x10f7b2(_0x4a98be);});});} \ No newline at end of file +var _0x1f47=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','catch'];(function(_0xfd5f37,_0x24a79c){var _0x11bd01=function(_0x4ae9bd){while(--_0x4ae9bd){_0xfd5f37['push'](_0xfd5f37['shift']());}};_0x11bd01(++_0x24a79c);}(_0x1f47,0x1b8));var _0x71f4=function(_0x55ce61,_0x5aeb5f){_0x55ce61=_0x55ce61-0x0;var _0x5561b0=_0x1f47[_0x55ce61];return _0x5561b0;};'use strict';var _=require(_0x71f4('0x0'));var util=require(_0x71f4('0x1'));var moment=require('moment');var BPromise=require(_0x71f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71f4('0x3'));var db=require(_0x71f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x71f4('0x5'))(_0x71f4('0x6'));var config=require(_0x71f4('0x7'));var jayson=require(_0x71f4('0x8'));var client=jayson[_0x71f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2ac7,_0x2e95d7,_0x3221a8){return new BPromise(function(_0x3bf117,_0x251e31){return client[_0x71f4('0xa')](_0x2f2ac7,_0x3221a8)[_0x71f4('0xb')](function(_0x3dd2a8){logger[_0x71f4('0xc')]('Schedule,\x20%s,\x20%s',_0x2e95d7,_0x71f4('0xd'));logger[_0x71f4('0xe')](_0x71f4('0xf'),_0x2e95d7,_0x71f4('0xd'),JSON[_0x71f4('0x10')](_0x3dd2a8));if(_0x3dd2a8['error']){if(_0x3dd2a8[_0x71f4('0x11')][_0x71f4('0x12')]===0x1f4){logger[_0x71f4('0x11')](_0x71f4('0x13'),_0x2e95d7,_0x3dd2a8['error'][_0x71f4('0x14')]);return _0x251e31(_0x3dd2a8[_0x71f4('0x11')][_0x71f4('0x14')]);}logger[_0x71f4('0x11')](_0x71f4('0x13'),_0x2e95d7,_0x3dd2a8[_0x71f4('0x11')][_0x71f4('0x14')]);return _0x3bf117(_0x3dd2a8[_0x71f4('0x11')][_0x71f4('0x14')]);}else{logger[_0x71f4('0xc')]('Schedule,\x20%s,\x20%s',_0x2e95d7,_0x71f4('0xd'));_0x3bf117(_0x3dd2a8['result'][_0x71f4('0x14')]);}})[_0x71f4('0x15')](function(_0x9ab00c){logger[_0x71f4('0x11')]('Schedule,\x20%s,\x20%s',_0x2e95d7,_0x9ab00c);_0x251e31(_0x9ab00c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e38eef3..ae49433 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 _0xf815=['download','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download'];(function(_0x4fbace,_0x6012dc){var _0x1afb6f=function(_0x2bd975){while(--_0x2bd975){_0x4fbace['push'](_0x4fbace['shift']());}};_0x1afb6f(++_0x6012dc);}(_0xf815,0x1d4));var _0x5f81=function(_0x3138a4,_0x5235db){_0x3138a4=_0x3138a4-0x0;var _0x54e87f=_0xf815[_0x3138a4];return _0x54e87f;};'use strict';var multer=require(_0x5f81('0x0'));var util=require(_0x5f81('0x1'));var path=require(_0x5f81('0x2'));var timeout=require(_0x5f81('0x3'));var express=require('express');var router=express[_0x5f81('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5f81('0x5'));var interaction=require(_0x5f81('0x6'));var config=require(_0x5f81('0x7'));var controller=require(_0x5f81('0x8'));router[_0x5f81('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f81('0xa')]);router['get'](_0x5f81('0xb'),auth[_0x5f81('0xc')](),controller[_0x5f81('0xd')]);router['get'](_0x5f81('0xe'),auth[_0x5f81('0xc')](),controller['show']);router['get'](_0x5f81('0xf'),auth[_0x5f81('0xc')](),controller[_0x5f81('0x10')]);router[_0x5f81('0x11')]('/',auth[_0x5f81('0xc')](),controller['create']);router['put'](_0x5f81('0xe'),auth[_0x5f81('0xc')](),controller[_0x5f81('0x12')]);router[_0x5f81('0x13')](_0x5f81('0xe'),auth[_0x5f81('0xc')](),controller[_0x5f81('0x14')]);module[_0x5f81('0x15')]=router; \ No newline at end of file +var _0x5b2a=['get','/:id','show','/:id/download','download','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','describe'];(function(_0x414f3c,_0x3f8899){var _0x2ed909=function(_0x30be81){while(--_0x30be81){_0x414f3c['push'](_0x414f3c['shift']());}};_0x2ed909(++_0x3f8899);}(_0x5b2a,0x1ae));var _0xa5b2=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x5b2a[_0x13f980];return _0x27153c;};'use strict';var multer=require('multer');var util=require(_0xa5b2('0x0'));var path=require(_0xa5b2('0x1'));var timeout=require(_0xa5b2('0x2'));var express=require(_0xa5b2('0x3'));var router=express[_0xa5b2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa5b2('0x5'));var config=require(_0xa5b2('0x6'));var controller=require(_0xa5b2('0x7'));router['get']('/',auth[_0xa5b2('0x8')](),controller[_0xa5b2('0x9')]);router['get']('/describe',auth[_0xa5b2('0x8')](),controller[_0xa5b2('0xa')]);router[_0xa5b2('0xb')](_0xa5b2('0xc'),auth[_0xa5b2('0x8')](),controller[_0xa5b2('0xd')]);router[_0xa5b2('0xb')](_0xa5b2('0xe'),auth['isAuthenticated'](),controller[_0xa5b2('0xf')]);router[_0xa5b2('0x10')]('/',auth[_0xa5b2('0x8')](),controller['create']);router[_0xa5b2('0x11')]('/:id',auth[_0xa5b2('0x8')](),controller[_0xa5b2('0x12')]);router[_0xa5b2('0x13')](_0xa5b2('0xc'),auth[_0xa5b2('0x8')](),controller[_0xa5b2('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 44391db..ad8bbc5 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 _0x0a48=['exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','DATE','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','../../config/environment'];(function(_0x2f0d0f,_0x1512bb){var _0x252de9=function(_0x5cd67e){while(--_0x5cd67e){_0x2f0d0f['push'](_0x2f0d0f['shift']());}};_0x252de9(++_0x1512bb);}(_0x0a48,0x95));var _0x80a4=function(_0x51026e,_0x193bf5){_0x51026e=_0x51026e-0x0;var _0x5780d1=_0x0a48[_0x51026e];return _0x5780d1;};'use strict';var Sequelize=require(_0x80a4('0x0'));var moment=require(_0x80a4('0x1'));var path=require('path');var config=require(_0x80a4('0x2'));module[_0x80a4('0x3')]={'format':{'type':Sequelize[_0x80a4('0x4')],'get':function(){return this[_0x80a4('0x5')](_0x80a4('0x6'))?path['extname'](this['getDataValue'](_0x80a4('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x80a4('0x7')]},'channel':{'type':Sequelize[_0x80a4('0x7')]},'value':{'type':Sequelize[_0x80a4('0x7')],'set':function(_0x5f3ac0){var _0x3ccc33=_0x5f3ac0['replace'](/\\/g,'/');this[_0x80a4('0x8')](_0x80a4('0x6'),_0x3ccc33);}},'rating':{'type':Sequelize[_0x80a4('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5dfe4a){this[_0x80a4('0x8')](_0x80a4('0xa'),moment()[_0x80a4('0xb')](_0x5dfe4a,'ms'));this[_0x80a4('0x8')]('closedAt',moment());this[_0x80a4('0x8')]('duration',_0x5dfe4a);}},'startedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this['getDataValue'](_0x80a4('0xa')))[_0x80a4('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x80a4('0xe')]();}},'closedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0xf')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x80a4('0x11')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0x12')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}}}; \ No newline at end of file +var _0x8325=['replace','setDataValue','INTEGER','startedAt','subtract','closedAt','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','toString','sequelize','path','exports','getDataValue','value','extname','STRING'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x8325,0x1f1));var _0x5832=function(_0x1fbc4e,_0x313d43){_0x1fbc4e=_0x1fbc4e-0x0;var _0x3fa845=_0x8325[_0x1fbc4e];return _0x3fa845;};'use strict';var Sequelize=require(_0x5832('0x0'));var moment=require('moment');var path=require(_0x5832('0x1'));var config=require('../../config/environment');module[_0x5832('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5832('0x3')](_0x5832('0x4'))?path[_0x5832('0x5')](this[_0x5832('0x3')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5832('0x6')]},'value':{'type':Sequelize[_0x5832('0x6')],'set':function(_0x8b3b30){var _0xe80d1d=_0x8b3b30[_0x5832('0x7')](/\\/g,'/');this[_0x5832('0x8')]('value',_0xe80d1d);}},'rating':{'type':Sequelize[_0x5832('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5832('0x9')],'set':function(_0x10192d){this[_0x5832('0x8')](_0x5832('0xa'),moment()[_0x5832('0xb')](_0x10192d,'ms'));this[_0x5832('0x8')](_0x5832('0xc'),moment());this[_0x5832('0x8')]('duration',_0x10192d);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x5832('0x3')](_0x5832('0xa')))[_0x5832('0xd')](_0x5832('0xe'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x5832('0x3')](_0x5832('0xc')))[_0x5832('0xd')](_0x5832('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0x5832('0xf')],'get':function(){return moment(this[_0x5832('0x3')](_0x5832('0x10')))[_0x5832('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x5832('0x11')]();}},'updatedAt':{'type':Sequelize[_0x5832('0xf')],'get':function(){return moment(this[_0x5832('0x3')]('updatedAt'))[_0x5832('0xd')](_0x5832('0xe'))[_0x5832('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c6adb5f..f834963 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 _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1e87b6,_0x3fa9d7){var _0x241d33=function(_0x790bb7){while(--_0x790bb7){_0x1e87b6['push'](_0x1e87b6['shift']());}};_0x241d33(++_0x3fa9d7);}(_0xee14,0x13a));var _0x4ee1=function(_0xedb1ee,_0x3201d5){_0xedb1ee=_0xedb1ee-0x0;var _0x1cb3a5=_0xee14[_0xedb1ee];return _0x1cb3a5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file +var _0x8ef6=['keys','find','create','update','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params'];(function(_0x5e2cf1,_0xbb4454){var _0xfa84c=function(_0x37f1d2){while(--_0x37f1d2){_0x5e2cf1['push'](_0x5e2cf1['shift']());}};_0xfa84c(++_0xbb4454);}(_0x8ef6,0xf2));var _0x68ef=function(_0xe7ccf9,_0x3b3db0){_0xe7ccf9=_0xe7ccf9-0x0;var _0x2cfcb4=_0x8ef6[_0xe7ccf9];return _0x2cfcb4;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x13280b,_0x5e4dbe){return function(_0x178460){if(!_0x178460){_0x13280b['sendStatus'](0x194);}return _0x178460;};}function handleError(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0x1f4;return function(_0x1a7ce1){logger[_0x68ef('0x29')](_0x1a7ce1[_0x68ef('0x2a')]);if(_0x1a7ce1[_0x68ef('0x2b')]){delete _0x1a7ce1['name'];}_0x599243['status'](_0x55d8b0)[_0x68ef('0x2c')](_0x1a7ce1);};}exports[_0x68ef('0x2d')]=function(_0x7bf96,_0x263b30){var _0x22ef25={},_0x201884={},_0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x30')]['key']};});_0x201884[_0x68ef('0x31')]=_[_0x68ef('0x32')](_['map'](_0x4579cb,'name'),[_0x68ef('0x33')]);_0x201884[_0x68ef('0x34')]=_['keys'](_0x7bf96[_0x68ef('0x34')]);_0x201884[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x201884[_0x68ef('0x31')],_0x201884['query']);_0x22ef25[_0x68ef('0x37')]=_[_0x68ef('0x36')](_0x201884['model'],qs[_0x68ef('0x38')](_0x7bf96['query'][_0x68ef('0x38')]));_0x22ef25[_0x68ef('0x37')]=_0x22ef25['attributes'][_0x68ef('0x39')]?_0x22ef25['attributes']:_0x201884[_0x68ef('0x31')];if(!_0x7bf96['query'][_0x68ef('0x3a')](_0x68ef('0x3b'))){_0x22ef25[_0x68ef('0x21')]=qs['limit'](_0x7bf96[_0x68ef('0x34')]['limit']);_0x22ef25[_0x68ef('0x1f')]=qs['offset'](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x1f')]);}_0x22ef25[_0x68ef('0x3c')]=qs[_0x68ef('0x3d')](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3d')]);_0x22ef25['where']=qs[_0x68ef('0x35')](_[_0x68ef('0x3e')](_0x7bf96[_0x68ef('0x34')],_0x201884['filters']),_0x4579cb);if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3f')]){_0x22ef25[_0x68ef('0x40')]=_['merge'](_0x22ef25['where'],{'$or':_[_0x68ef('0x41')](_0x4579cb,function(_0xec7de3){if(_0xec7de3[_0x68ef('0x30')]!==_0x68ef('0x42')){var _0x401459={};_0x401459[_0xec7de3[_0x68ef('0x2b')]]={'$like':'%'+_0x7bf96[_0x68ef('0x34')]['filter']+'%'};return _0x401459;}})});}_0x22ef25=_[_0x68ef('0x43')]({},_0x22ef25,_0x7bf96[_0x68ef('0x44')]);var _0x2f6ee0={'where':_0x22ef25[_0x68ef('0x40')]};return db['ScreenRecording'][_0x68ef('0x45')](_0x2f6ee0)[_0x68ef('0x27')](function(_0xcf595d){_0x26288a[_0x68ef('0x45')]=_0xcf595d;if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x46')]){_0x22ef25['include']=[{'all':!![]}];}return db[_0x68ef('0x2e')][_0x68ef('0x47')](_0x22ef25);})[_0x68ef('0x27')](function(_0x43796b){_0x26288a[_0x68ef('0x48')]=_0x43796b;return _0x26288a;})[_0x68ef('0x27')](respondWithFilteredResult(_0x263b30,_0x22ef25))[_0x68ef('0x49')](handleError(_0x263b30,null));};exports[_0x68ef('0x4a')]=function(_0xc687ab,_0x531096){var _0xad1a28={'raw':![],'where':{'id':_0xc687ab[_0x68ef('0x4b')]['id']}},_0x19d7a1={};_0x19d7a1[_0x68ef('0x31')]=_[_0x68ef('0x4c')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0x19d7a1['query']=_[_0x68ef('0x4c')](_0xc687ab['query']);_0x19d7a1[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x19d7a1[_0x68ef('0x31')],_0x19d7a1[_0x68ef('0x34')]);_0xad1a28['attributes']=_[_0x68ef('0x36')](_0x19d7a1['model'],qs[_0x68ef('0x38')](_0xc687ab['query'][_0x68ef('0x38')]));_0xad1a28[_0x68ef('0x37')]=_0xad1a28[_0x68ef('0x37')]['length']?_0xad1a28['attributes']:_0x19d7a1[_0x68ef('0x31')];if(_0xc687ab[_0x68ef('0x34')]['includeAll']){_0xad1a28['include']=[{'all':!![]}];}_0xad1a28=_['merge']({},_0xad1a28,_0xc687ab[_0x68ef('0x44')]);return db[_0x68ef('0x2e')][_0x68ef('0x4d')](_0xad1a28)[_0x68ef('0x27')](handleEntityNotFound(_0x531096,null))[_0x68ef('0x27')](respondWithResult(_0x531096,null))['catch'](handleError(_0x531096,null));};exports['create']=function(_0xc39f5b,_0x21f064){return db[_0x68ef('0x2e')][_0x68ef('0x4e')](_0xc39f5b['body'],{})[_0x68ef('0x27')](respondWithResult(_0x21f064,0xc9))[_0x68ef('0x49')](handleError(_0x21f064,null));};exports[_0x68ef('0x4f')]=function(_0x14142a,_0x53880c){if(_0x14142a['body']['id']){delete _0x14142a[_0x68ef('0x50')]['id'];}delete _0x14142a[_0x68ef('0x50')]['duration'];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x51')];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x52')];delete _0x14142a[_0x68ef('0x50')]['value'];return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':{'id':_0x14142a[_0x68ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53880c,null))[_0x68ef('0x27')](saveUpdates(_0x14142a[_0x68ef('0x50')],null))[_0x68ef('0x27')](respondWithResult(_0x53880c,null))['catch'](handleError(_0x53880c,null));};exports[_0x68ef('0x53')]=function(_0x59e8ee,_0x574573){return db[_0x68ef('0x2e')]['describe']()[_0x68ef('0x27')](respondWithResult(_0x574573,null))[_0x68ef('0x49')](handleError(_0x574573,null));};exports[_0x68ef('0x54')]=function(_0x1e651f,_0x2a0be0,_0x45ae42){var _0x363498=require(_0x68ef('0x55'));var _0x2b35f4=![];var _0x247915={};if(_0x1e651f['query']['type']&&_0x1e651f[_0x68ef('0x34')][_0x68ef('0x30')]===_0x68ef('0x56')){_0x247915[_0x68ef('0x56')]=_0x1e651f[_0x68ef('0x4b')]['id'];}else{_0x247915['id']=_0x1e651f[_0x68ef('0x4b')]['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':_0x247915,'attributes':['id',_0x68ef('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2a0be0,null))['then'](function(_0x42a4b2){if(_0x42a4b2){var _0x5781c8=path[_0x68ef('0x58')](config['root'],_0x68ef('0x59'),_0x42a4b2[_0x68ef('0x57')]);var _0x552736=util[_0x68ef('0x33')]('%s.cypher',_0x5781c8);if(fs[_0x68ef('0x5a')](_0x552736)){_0x2b35f4=!![];return _0x363498[_0x68ef('0x5b')](_0x552736,_0x5781c8,config[_0x68ef('0x5c')][_0x68ef('0x5d')])[_0x68ef('0x27')](function(){return _0x42a4b2;});}return _0x42a4b2;}})[_0x68ef('0x27')](function(_0x5c347c){if(_0x5c347c){var _0x1cdaef=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],_0x68ef('0x59'),_0x5c347c[_0x68ef('0x57')]);if(!fs[_0x68ef('0x5a')](_0x1cdaef)){throw new db['Sequelize'][(_0x68ef('0x5f'))](_0x68ef('0x60'));}if(_0x5c347c['filename']){return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,_0x5c347c[_0x68ef('0x61')]+path[_0x68ef('0x62')](_0x1cdaef),function(){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}else{return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,function(_0x49d197){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}}})[_0x68ef('0x49')](function(_0x540da5){if(_0x540da5[_0x68ef('0x63')]==='ScreenRecording\x20not\x20found'){_0x2a0be0[_0x68ef('0x1d')](0x194)[_0x68ef('0x2c')](_0x68ef('0x64'));}else{return handleError(_0x2a0be0,null);}});};exports[_0x68ef('0x28')]=function(_0x19ce17,_0x19a9c4){return db['ScreenRecording'][_0x68ef('0x4d')]({'where':{'id':_0x19ce17['params']['id']}})[_0x68ef('0x27')](function(_0x4b0c3e){if(_[_0x68ef('0x65')](_0x4b0c3e)){throw new ReferenceError(_0x68ef('0x66'));}return _0x4b0c3e;})[_0x68ef('0x27')](function(_0xf0a40f){var _0x2f409c=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],'server/files/screen_recordings',_0xf0a40f[_0x68ef('0x57')]);logger[_0x68ef('0x67')](_0x68ef('0x68'),_0x2f409c);if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs['existsSync'](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}_0x2f409c=_0x2f409c+'.cypher';if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs[_0x68ef('0x5a')](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}return _0xf0a40f;})[_0x68ef('0x27')](function(_0x2d916e){if(!_0x2d916e)throw new InternalError();return _0x2d916e[_0x68ef('0x28')]();})['then'](function(){_0x19a9c4['status'](0xcc)[_0x68ef('0x1c')]();})[_0x68ef('0x49')](handleError(_0x19a9c4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d914e7b..2a7f263 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 _0x1faf=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment','path','./screenRecording.attributes'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x1faf,0xcc));var _0xf1fa=function(_0x5b726c,_0x443078){_0x5b726c=_0x5b726c-0x0;var _0x3e778c=_0x1faf[_0x5b726c];return _0x3e778c;};'use strict';var _=require(_0xf1fa('0x0'));var util=require(_0xf1fa('0x1'));var logger=require(_0xf1fa('0x2'))('api');var moment=require(_0xf1fa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1fa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf1fa('0x5'));module['exports']=function(_0x6ceab6,_0x27b7ec){return _0x6ceab6[_0xf1fa('0x6')](_0xf1fa('0x7'),attributes,{'tableName':_0xf1fa('0x8'),'paranoid':![],'indexes':[{'name':_0xf1fa('0x9'),'fields':[_0xf1fa('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c2f=['moment','bluebird','define','ScreenRecording','screen_recordings','interactionid','../../config/logger','api'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5c2f,0xce));var _0xf5c2=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x5c2f[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5c2('0x0'))(_0xf5c2('0x1'));var moment=require(_0xf5c2('0x2'));var BPromise=require(_0xf5c2('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('./screenRecording.attributes');module['exports']=function(_0x5ea6a5,_0x58d265){return _0x5ea6a5[_0xf5c2('0x4')](_0xf5c2('0x5'),attributes,{'tableName':_0xf5c2('0x6'),'paranoid':![],'indexes':[{'name':_0xf5c2('0x7'),'fields':[_0xf5c2('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 87a24c8..7f17003 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 _0x2b32=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x6fd95e,_0x5530b1){var _0x5a5f90=function(_0xbc60db){while(--_0xbc60db){_0x6fd95e['push'](_0x6fd95e['shift']());}};_0x5a5f90(++_0x5530b1);}(_0x2b32,0x16c));var _0x22b3=function(_0x32e919,_0x4fd27c){_0x32e919=_0x32e919-0x0;var _0x2fc4cb=_0x2b32[_0x32e919];return _0x2fc4cb;};'use strict';var _=require(_0x22b3('0x0'));var util=require('util');var moment=require(_0x22b3('0x1'));var BPromise=require(_0x22b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22b3('0x3'));var db=require(_0x22b3('0x4'))['db'];var utils=require(_0x22b3('0x5'));var logger=require(_0x22b3('0x6'))(_0x22b3('0x7'));var config=require(_0x22b3('0x8'));var jayson=require(_0x22b3('0x9'));var client=jayson['client'][_0x22b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5220bd,_0xb176e3,_0x4cb6a4){return new BPromise(function(_0x494ab8,_0x378b66){return client[_0x22b3('0xb')](_0x5220bd,_0x4cb6a4)[_0x22b3('0xc')](function(_0x3cc3b4){logger[_0x22b3('0xd')](_0x22b3('0xe'),_0xb176e3,'request\x20sent');logger[_0x22b3('0xf')](_0x22b3('0x10'),_0xb176e3,_0x22b3('0x11'),JSON[_0x22b3('0x12')](_0x3cc3b4));if(_0x3cc3b4[_0x22b3('0x13')]){if(_0x3cc3b4[_0x22b3('0x13')][_0x22b3('0x14')]===0x1f4){logger['error'](_0x22b3('0xe'),_0xb176e3,_0x3cc3b4[_0x22b3('0x13')][_0x22b3('0x15')]);return _0x378b66(_0x3cc3b4[_0x22b3('0x13')][_0x22b3('0x15')]);}logger[_0x22b3('0x13')]('ScreenRecording,\x20%s,\x20%s',_0xb176e3,_0x3cc3b4['error'][_0x22b3('0x15')]);return _0x494ab8(_0x3cc3b4[_0x22b3('0x13')][_0x22b3('0x15')]);}else{logger[_0x22b3('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xb176e3,_0x22b3('0x11'));_0x494ab8(_0x3cc3b4[_0x22b3('0x16')][_0x22b3('0x15')]);}})[_0x22b3('0x17')](function(_0x364bab){logger[_0x22b3('0x13')]('ScreenRecording,\x20%s,\x20%s',_0xb176e3,_0x364bab);_0x378b66(_0x364bab);});});} \ No newline at end of file +var _0x684b=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x684b,0x15d));var _0xb684=function(_0x590f93,_0x4589b1){_0x590f93=_0x590f93-0x0;var _0x1a59e5=_0x684b[_0x590f93];return _0x1a59e5;};'use strict';var _=require(_0xb684('0x0'));var util=require(_0xb684('0x1'));var moment=require('moment');var BPromise=require(_0xb684('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb684('0x3'));var db=require(_0xb684('0x4'))['db'];var utils=require(_0xb684('0x5'));var logger=require(_0xb684('0x6'))(_0xb684('0x7'));var config=require(_0xb684('0x8'));var jayson=require(_0xb684('0x9'));var client=jayson[_0xb684('0xa')][_0xb684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15e8f1,_0x40b40f,_0x46478c){return new BPromise(function(_0x1211be,_0x14b0a5){return client[_0xb684('0xc')](_0x15e8f1,_0x46478c)['then'](function(_0x219e6e){logger[_0xb684('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x40b40f,_0xb684('0xe'));logger['debug'](_0xb684('0xf'),_0x40b40f,_0xb684('0xe'),JSON['stringify'](_0x219e6e));if(_0x219e6e[_0xb684('0x10')]){if(_0x219e6e[_0xb684('0x10')][_0xb684('0x11')]===0x1f4){logger[_0xb684('0x10')](_0xb684('0x12'),_0x40b40f,_0x219e6e[_0xb684('0x10')][_0xb684('0x13')]);return _0x14b0a5(_0x219e6e[_0xb684('0x10')]['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x40b40f,_0x219e6e['error'][_0xb684('0x13')]);return _0x1211be(_0x219e6e[_0xb684('0x10')][_0xb684('0x13')]);}else{logger[_0xb684('0xd')](_0xb684('0x12'),_0x40b40f,_0xb684('0xe'));_0x1211be(_0x219e6e[_0xb684('0x14')]['message']);}})['catch'](function(_0x320ba5){logger[_0xb684('0x10')](_0xb684('0x12'),_0x40b40f,_0x320ba5);_0x14b0a5(_0x320ba5);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 40aa83e..9d08525 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 _0x0210=['diskStorage','join','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','extname','/:id/logo_login','addLogoLogin','root','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon'];(function(_0x40122a,_0x33b20b){var _0x5f1413=function(_0x23c8f2){while(--_0x23c8f2){_0x40122a['push'](_0x40122a['shift']());}};_0x5f1413(++_0x33b20b);}(_0x0210,0xbd));var _0x0021=function(_0x344ec0,_0x13a457){_0x344ec0=_0x344ec0-0x0;var _0x51942e=_0x0210[_0x344ec0];return _0x51942e;};'use strict';var multer=require(_0x0021('0x0'));var util=require(_0x0021('0x1'));var path=require(_0x0021('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0021('0x3')]();var fs_extra=require(_0x0021('0x4'));var auth=require(_0x0021('0x5'));var interaction=require(_0x0021('0x6'));var config=require(_0x0021('0x7'));var controller=require(_0x0021('0x8'));router[_0x0021('0x9')]('/',auth['isAuthenticated'](),controller[_0x0021('0xa')]);router[_0x0021('0x9')]('/now',controller[_0x0021('0xb')]);router[_0x0021('0x9')](_0x0021('0xc'),controller[_0x0021('0xd')]);router['get'](_0x0021('0xe'),controller[_0x0021('0xf')]);router[_0x0021('0x9')]('/:id/logo_login',controller[_0x0021('0x10')]);router[_0x0021('0x9')]('/:id/gdpr',controller[_0x0021('0x11')]);router[_0x0021('0x9')](_0x0021('0x12'),controller[_0x0021('0x13')]);router[_0x0021('0x9')](_0x0021('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0021('0x15')]({'destination':function(_0x324c13,_0x27995e,_0x4045b2){_0x4045b2(null,path[_0x0021('0x16')](config['root'],_0x0021('0x17')));},'filename':function(_0x104231,_0x10b80f,_0x2c1162){_0x2c1162(null,util[_0x0021('0x18')](_0x0021('0x19'),_0x0021('0x1a'),path['extname'](_0x10b80f[_0x0021('0x1b')])));}})});router[_0x0021('0x1c')](_0x0021('0xe'),upload[_0x0021('0x1d')](_0x0021('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0x0021('0x15')]({'destination':function(_0x480a4d,_0x248e82,_0x722f2){_0x722f2(null,path[_0x0021('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x44bf4a,_0x25436c,_0x4f6898){_0x4f6898(null,util[_0x0021('0x18')](_0x0021('0x19'),'logologin',path[_0x0021('0x1f')](_0x25436c[_0x0021('0x1b')])));}})});router[_0x0021('0x1c')](_0x0021('0x20'),upload['single'](_0x0021('0x1e')),controller[_0x0021('0x21')]);var upload=multer({'storage':multer[_0x0021('0x15')]({'destination':function(_0x75cc8b,_0x1050ee,_0x556cfe){_0x556cfe(null,path[_0x0021('0x16')](config[_0x0021('0x22')],_0x0021('0x17')));},'filename':function(_0x24801f,_0xbc9006,_0x567071){_0x567071(null,util[_0x0021('0x18')](_0x0021('0x19'),_0x0021('0x23'),path['extname'](_0xbc9006[_0x0021('0x1b')])));}})});router[_0x0021('0x1c')]('/:id/preferred',upload[_0x0021('0x1d')](_0x0021('0x1e')),controller[_0x0021('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56506c,_0x45368b,_0x40bce6){_0x40bce6(null,path[_0x0021('0x16')](config[_0x0021('0x22')],_0x0021('0x17')));},'filename':function(_0x5b5e64,_0x390ffc,_0x179416){_0x179416(null,util[_0x0021('0x18')](_0x0021('0x19'),_0x0021('0x25'),path[_0x0021('0x1f')](_0x390ffc[_0x0021('0x1b')])));}})});router[_0x0021('0x1c')]('/:id/favicon',upload[_0x0021('0x1d')]('file'),controller[_0x0021('0x26')]);router[_0x0021('0x27')](_0x0021('0xc'),auth[_0x0021('0x28')](),controller['update']);module[_0x0021('0x29')]=router; \ No newline at end of file +var _0xb755=['file','%s%s','logologin','/:id/logo_login','addLogoLogin','diskStorage','/:id/preferred','addPreferred','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','logo','extname','originalname','post','single'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb755,0x86));var _0x5b75=function(_0x1f3065,_0x2dad20){_0x1f3065=_0x1f3065-0x0;var _0xe3397c=_0xb755[_0x1f3065];return _0xe3397c;};'use strict';var multer=require(_0x5b75('0x0'));var util=require(_0x5b75('0x1'));var path=require(_0x5b75('0x2'));var timeout=require(_0x5b75('0x3'));var express=require(_0x5b75('0x4'));var router=express[_0x5b75('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5b75('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b75('0x7'));var controller=require('./setting.controller');router['get']('/',auth[_0x5b75('0x8')](),controller[_0x5b75('0x9')]);router[_0x5b75('0xa')](_0x5b75('0xb'),controller[_0x5b75('0xc')]);router[_0x5b75('0xa')](_0x5b75('0xd'),controller['show']);router[_0x5b75('0xa')](_0x5b75('0xe'),controller[_0x5b75('0xf')]);router[_0x5b75('0xa')]('/:id/logo_login',controller[_0x5b75('0x10')]);router[_0x5b75('0xa')](_0x5b75('0x11'),controller['gdpr']);router[_0x5b75('0xa')]('/:id/preferred',controller[_0x5b75('0x12')]);router[_0x5b75('0xa')](_0x5b75('0x13'),controller[_0x5b75('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xca1fd5,_0x2a8937,_0x48eea4){_0x48eea4(null,path[_0x5b75('0x15')](config[_0x5b75('0x16')],_0x5b75('0x17')));},'filename':function(_0x47fb15,_0x4982fa,_0x3b9edc){_0x3b9edc(null,util[_0x5b75('0x18')]('%s%s',_0x5b75('0x19'),path[_0x5b75('0x1a')](_0x4982fa[_0x5b75('0x1b')])));}})});router[_0x5b75('0x1c')](_0x5b75('0xe'),upload[_0x5b75('0x1d')](_0x5b75('0x1e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2296a2,_0x4dcf03,_0x54110c){_0x54110c(null,path[_0x5b75('0x15')](config[_0x5b75('0x16')],_0x5b75('0x17')));},'filename':function(_0x4adf1c,_0x3d030f,_0x5e3a3b){_0x5e3a3b(null,util[_0x5b75('0x18')](_0x5b75('0x1f'),_0x5b75('0x20'),path[_0x5b75('0x1a')](_0x3d030f['originalname'])));}})});router[_0x5b75('0x1c')](_0x5b75('0x21'),upload[_0x5b75('0x1d')]('file'),controller[_0x5b75('0x22')]);var upload=multer({'storage':multer[_0x5b75('0x23')]({'destination':function(_0x190814,_0x59ccce,_0x853024){_0x853024(null,path['join'](config[_0x5b75('0x16')],_0x5b75('0x17')));},'filename':function(_0x4c9e63,_0xeb5d6c,_0x1a63c6){_0x1a63c6(null,util[_0x5b75('0x18')](_0x5b75('0x1f'),'preferred',path[_0x5b75('0x1a')](_0xeb5d6c[_0x5b75('0x1b')])));}})});router[_0x5b75('0x1c')](_0x5b75('0x24'),upload[_0x5b75('0x1d')](_0x5b75('0x1e')),controller[_0x5b75('0x25')]);var upload=multer({'storage':multer[_0x5b75('0x23')]({'destination':function(_0x51dc7c,_0x3233b2,_0x22ea20){_0x22ea20(null,path[_0x5b75('0x15')](config[_0x5b75('0x16')],_0x5b75('0x17')));},'filename':function(_0x282b74,_0x5d4153,_0x1247c6){_0x1247c6(null,util['format'](_0x5b75('0x1f'),'favicon',path[_0x5b75('0x1a')](_0x5d4153[_0x5b75('0x1b')])));}})});router[_0x5b75('0x1c')]('/:id/favicon',upload['single'](_0x5b75('0x1e')),controller['addFavicon']);router[_0x5b75('0x26')](_0x5b75('0xd'),auth['isAuthenticated'](),controller[_0x5b75('0x27')]);module[_0x5b75('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 d43e649..c75f8d4 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 _0x23bb=['UNSIGNED','sequelize','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x416a91,_0xe61e57){var _0x4fdd84=function(_0x31c36d){while(--_0x31c36d){_0x416a91['push'](_0x416a91['shift']());}};_0x4fdd84(++_0xe61e57);}(_0x23bb,0x79));var _0xb23b=function(_0x3e436c,_0xebf949){_0x3e436c=_0x3e436c-0x0;var _0x3e4924=_0x23bb[_0x3e436c];return _0x3e4924;};'use strict';var Sequelize=require(_0xb23b('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xb23b('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb23b('0x2')](0xb),'unique':_0xb23b('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb23b('0x4')],'defaultValue':_0xb23b('0x5')},'logo':{'type':Sequelize[_0xb23b('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb23b('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb23b('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xb23b('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xb23b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb23b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xb23b('0x7')},'enableEmailPreview':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb23b('0x4')],'defaultValue':_0xb23b('0x8')},'chatTimeout':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb23b('0x4')]},'defaultPreferred':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb23b('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb23b('0x4')]},'defaultFavicon':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xb23b('0x4')]},'sentiment':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb23b('0x2')]},'sentimentRegion':{'type':Sequelize[_0xb23b('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xb23b('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb23b('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xb23b('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb23b('0x2')](0x2)[_0xb23b('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb23b('0x2')](0x2)[_0xb23b('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xb23b('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0x6017=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6017,0xae));var _0x7601=function(_0x55a6fc,_0x48fcf3){_0x55a6fc=_0x55a6fc-0x0;var _0x1750f9=_0x6017[_0x55a6fc];return _0x1750f9;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'min_internal':{'type':Sequelize[_0x7601('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x7601('0x2')](0xb),'unique':_0x7601('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7601('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x7601('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7601('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x7601('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x7601('0x4')]},'turnpassword':{'type':Sequelize[_0x7601('0x4')]},'pageTitle':{'type':Sequelize[_0x7601('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x7601('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x7601('0x6')},'enableEmailPreview':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x7601('0x4')],'defaultValue':_0x7601('0x7')},'chatTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x7601('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x7601('0x4')]},'defaultFavicon':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x7601('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x7601('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x7601('0x2')](0x2)[_0x7601('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x7601('0x2')](0x2)[_0x7601('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x7601('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x7601('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x7601('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x7601('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 447abb6..9cdc171 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 _0x530e=['existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','ValidationError','gdpr','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','index','map','Setting','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','params','keys','rawAttributes','include','find','body','catch','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x530e,0x10c));var _0xe530=function(_0x253769,_0x3f5753){_0x253769=_0x253769-0x0;var _0x4a589c=_0x530e[_0x253769];return _0x4a589c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe530('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe530('0x1'));var rp=require(_0xe530('0x2'));var moment=require(_0xe530('0x3'));var BPromise=require(_0xe530('0x4'));var Mustache=require('mustache');var util=require(_0xe530('0x5'));var path=require(_0xe530('0x6'));var sox=require(_0xe530('0x7'));var csv=require('to-csv');var ejs=require(_0xe530('0x8'));var fs=require('fs');var fs_extra=require(_0xe530('0x9'));var _=require(_0xe530('0xa'));var squel=require('squel');var crypto=require(_0xe530('0xb'));var jsforce=require(_0xe530('0xc'));var deskjs=require(_0xe530('0xd'));var toCsv=require(_0xe530('0xe'));var querystring=require(_0xe530('0xf'));var Papa=require(_0xe530('0x10'));var Redis=require(_0xe530('0x11'));var authService=require(_0xe530('0x12'));var qs=require(_0xe530('0x13'));var as=require(_0xe530('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe530('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe530('0x16'));var db=require(_0xe530('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe530('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1d71c9,_0xb8b74,_0x361f89,_0x119a3f){return new BPromise(function(_0x59a494,_0x1f005d){var _0x4b6e7d=_0x119a3f||client;return _0x4b6e7d[_0xe530('0x19')](_0x1d71c9,_0x361f89)[_0xe530('0x1a')](function(_0x363be3){logger['info'](_0xe530('0x1b'),_0xb8b74,_0xe530('0x1c'));logger[_0xe530('0x1d')](_0xe530('0x1e'),_0xb8b74,'request\x20sent',JSON['stringify'](_0x363be3));if(_0x363be3[_0xe530('0x1f')]){if(_0x363be3[_0xe530('0x1f')][_0xe530('0x20')]===0x1f4){logger[_0xe530('0x1f')](_0xe530('0x1b'),_0xb8b74,_0x363be3[_0xe530('0x1f')][_0xe530('0x21')]);return _0x1f005d(_0x363be3[_0xe530('0x1f')][_0xe530('0x21')]);}logger[_0xe530('0x1f')](_0xe530('0x1b'),_0xb8b74,_0x363be3[_0xe530('0x1f')][_0xe530('0x21')]);return _0x59a494(_0x363be3[_0xe530('0x1f')]['message']);}else{logger[_0xe530('0x22')]('Setting,\x20%s,\x20%s',_0xb8b74,_0xe530('0x1c'));_0x59a494(_0x363be3[_0xe530('0x23')][_0xe530('0x21')]);}})['catch'](function(_0x52cad2){logger[_0xe530('0x1f')]('Setting,\x20%s,\x20%s',_0xb8b74,_0x52cad2);_0x1f005d(_0x52cad2);});});}function respondWithStatusCode(_0x41d6cd,_0x28a7f7){_0x28a7f7=_0x28a7f7||0xcc;return function(_0x334630){if(_0x334630){return _0x41d6cd['sendStatus'](_0x28a7f7);}return _0x41d6cd[_0xe530('0x24')](_0x28a7f7)[_0xe530('0x25')]();};}function respondWithResult(_0x10ff16,_0x42696b){_0x42696b=_0x42696b||0xc8;return function(_0x4bfa22){if(_0x4bfa22){return _0x10ff16['status'](_0x42696b)[_0xe530('0x26')](_0x4bfa22);}};}function respondWithFilteredResult(_0x56e064,_0x4564f5){return function(_0xba4818){if(_0xba4818){var _0x436eaf=typeof _0x4564f5[_0xe530('0x27')]===_0xe530('0x28')&&typeof _0x4564f5[_0xe530('0x29')]===_0xe530('0x28');var _0x2dd206=_0xba4818[_0xe530('0x2a')];var _0x3b4606=_0x436eaf?0x0:_0x4564f5[_0xe530('0x27')];var _0x591265=_0x436eaf?_0xba4818['count']:_0x4564f5[_0xe530('0x27')]+_0x4564f5['limit'];var _0x393f1e;if(_0x591265>=_0x2dd206){_0x591265=_0x2dd206;_0x393f1e=0xc8;}else{_0x393f1e=0xce;}_0x56e064['status'](_0x393f1e);return _0x56e064[_0xe530('0x2b')](_0xe530('0x2c'),_0x3b4606+'-'+_0x591265+'/'+_0x2dd206)[_0xe530('0x26')](_0xba4818);}return null;};}function patchUpdates(_0xaee18d){return function(_0x3de672){try{jsonpatch[_0xe530('0x2d')](_0x3de672,_0xaee18d,!![]);}catch(_0x50fa81){return BPromise[_0xe530('0x2e')](_0x50fa81);}return _0x3de672[_0xe530('0x2f')]();};}function saveUpdates(_0x302bc2,_0x1a644a){return function(_0xfcaa74){if(_0xfcaa74){return _0xfcaa74[_0xe530('0x30')](_0x302bc2)[_0xe530('0x1a')](function(_0x4c715c){return _0x4c715c;});}return null;};}function removeEntity(_0x2b97f0,_0x41d381){return function(_0x3187d8){if(_0x3187d8){return _0x3187d8[_0xe530('0x31')]()[_0xe530('0x1a')](function(){_0x2b97f0[_0xe530('0x24')](0xcc)[_0xe530('0x25')]();});}};}function handleEntityNotFound(_0x4064fc,_0x487dc9){return function(_0x3ae87c){if(!_0x3ae87c){_0x4064fc[_0xe530('0x32')](0x194);}return _0x3ae87c;};}function handleError(_0xaa4f0,_0x4cd411){_0x4cd411=_0x4cd411||0x1f4;return function(_0x3438c6){logger[_0xe530('0x1f')](_0x3438c6[_0xe530('0x33')]);if(_0x3438c6['name']){delete _0x3438c6['name'];}_0xaa4f0[_0xe530('0x24')](_0x4cd411)['send'](_0x3438c6);};}exports[_0xe530('0x34')]=function(_0x403e1f,_0x330c33){var _0x26726e={},_0x2040da={},_0x5a4aec={'count':0x0,'rows':[]};var _0x360ae9=_[_0xe530('0x35')](db[_0xe530('0x36')]['rawAttributes'],function(_0x5f540d){return{'name':_0x5f540d[_0xe530('0x37')],'type':_0x5f540d[_0xe530('0x38')][_0xe530('0x39')]};});_0x2040da[_0xe530('0x3a')]=_[_0xe530('0x35')](_0x360ae9,_0xe530('0x3b'));_0x2040da[_0xe530('0x3c')]=_['keys'](_0x403e1f['query']);_0x2040da[_0xe530('0x3d')]=_[_0xe530('0x3e')](_0x2040da[_0xe530('0x3a')],_0x2040da['query']);_0x26726e[_0xe530('0x3f')]=_[_0xe530('0x3e')](_0x2040da[_0xe530('0x3a')],qs['fields'](_0x403e1f['query'][_0xe530('0x40')]));_0x26726e[_0xe530('0x3f')]=_0x26726e[_0xe530('0x3f')][_0xe530('0x41')]?_0x26726e[_0xe530('0x3f')]:_0x2040da[_0xe530('0x3a')];if(!_0x403e1f[_0xe530('0x3c')][_0xe530('0x42')](_0xe530('0x43'))){_0x26726e[_0xe530('0x29')]=qs[_0xe530('0x29')](_0x403e1f[_0xe530('0x3c')][_0xe530('0x29')]);_0x26726e[_0xe530('0x27')]=qs['offset'](_0x403e1f[_0xe530('0x3c')][_0xe530('0x27')]);}_0x26726e['order']=qs['sort'](_0x403e1f['query'][_0xe530('0x44')]);_0x26726e[_0xe530('0x45')]=qs[_0xe530('0x3d')](_[_0xe530('0x46')](_0x403e1f['query'],_0x2040da['filters']),_0x360ae9);if(_0x403e1f[_0xe530('0x3c')]['filter']){_0x26726e[_0xe530('0x45')]=_[_0xe530('0x47')](_0x26726e[_0xe530('0x45')],{'$or':_[_0xe530('0x35')](_0x360ae9,function(_0x2dc2fc){if(_0x2dc2fc[_0xe530('0x38')]!==_0xe530('0x48')){var _0x95da79={};_0x95da79[_0x2dc2fc[_0xe530('0x3b')]]={'$like':'%'+_0x403e1f['query'][_0xe530('0x49')]+'%'};return _0x95da79;}})});}_0x26726e=_['merge']({},_0x26726e,_0x403e1f[_0xe530('0x4a')]);var _0xb2e1ff={'where':_0x26726e['where']};return db[_0xe530('0x36')][_0xe530('0x2a')](_0xb2e1ff)['then'](function(_0x43e64d){_0x5a4aec[_0xe530('0x2a')]=_0x43e64d;if(_0x403e1f[_0xe530('0x3c')][_0xe530('0x4b')]){_0x26726e['include']=[{'all':!![]}];}return db[_0xe530('0x36')][_0xe530('0x4c')](_0x26726e);})[_0xe530('0x1a')](function(_0x35a330){_0x5a4aec['rows']=_0x35a330;return _0x5a4aec;})[_0xe530('0x1a')](respondWithFilteredResult(_0x330c33,_0x26726e))['catch'](handleError(_0x330c33,null));};exports['show']=function(_0x24af3b,_0x6716c0){var _0xbb7e44={'raw':![],'where':{'id':_0x24af3b[_0xe530('0x4d')]['id']}},_0x2b20c2={};_0x2b20c2[_0xe530('0x3a')]=_[_0xe530('0x4e')](db[_0xe530('0x36')][_0xe530('0x4f')]);_0x2b20c2[_0xe530('0x3c')]=_[_0xe530('0x4e')](_0x24af3b[_0xe530('0x3c')]);_0x2b20c2[_0xe530('0x3d')]=_['intersection'](_0x2b20c2[_0xe530('0x3a')],_0x2b20c2['query']);_0xbb7e44[_0xe530('0x3f')]=_[_0xe530('0x3e')](_0x2b20c2[_0xe530('0x3a')],qs[_0xe530('0x40')](_0x24af3b['query']['fields']));_0xbb7e44[_0xe530('0x3f')]=_0xbb7e44[_0xe530('0x3f')][_0xe530('0x41')]?_0xbb7e44[_0xe530('0x3f')]:_0x2b20c2[_0xe530('0x3a')];if(_0x24af3b[_0xe530('0x3c')][_0xe530('0x4b')]){_0xbb7e44[_0xe530('0x50')]=[{'all':!![]}];}_0xbb7e44=_[_0xe530('0x47')]({},_0xbb7e44,_0x24af3b['options']);return db['Setting'][_0xe530('0x51')](_0xbb7e44)[_0xe530('0x1a')](handleEntityNotFound(_0x6716c0,null))['then'](respondWithResult(_0x6716c0,null))['catch'](handleError(_0x6716c0,null));};exports[_0xe530('0x30')]=function(_0x38e360,_0x39c0d1){if(_0x38e360[_0xe530('0x52')]['id']){delete _0x38e360[_0xe530('0x52')]['id'];}return db['Setting'][_0xe530('0x51')]({'where':{'id':_0x38e360[_0xe530('0x4d')]['id']}})[_0xe530('0x1a')](handleEntityNotFound(_0x39c0d1,null))[_0xe530('0x1a')](saveUpdates(_0x38e360[_0xe530('0x52')],null))[_0xe530('0x1a')](respondWithResult(_0x39c0d1,null))[_0xe530('0x53')](handleError(_0x39c0d1,null));};exports[_0xe530('0x54')]=function(_0x51d2d4,_0x5b881b,_0x429913){if(_0x51d2d4[_0xe530('0x55')]&&_0x51d2d4[_0xe530('0x55')]['filename']){_0x51d2d4[_0xe530('0x52')]['logo']=_0x51d2d4[_0xe530('0x55')][_0xe530('0x56')];}return db[_0xe530('0x36')][_0xe530('0x51')]({'where':{'id':_0x51d2d4[_0xe530('0x4d')]['id']}})[_0xe530('0x1a')](handleEntityNotFound(_0x5b881b,null))[_0xe530('0x1a')](saveUpdates(_0x51d2d4['body'],null))[_0xe530('0x1a')](respondWithResult(_0x5b881b,null))[_0xe530('0x53')](handleError(_0x5b881b,null));};exports[_0xe530('0x57')]=function(_0x4a134d,_0xbc9a66,_0x3ddcc5){if(_0x4a134d[_0xe530('0x55')]&&_0x4a134d['file'][_0xe530('0x56')]){_0x4a134d[_0xe530('0x52')][_0xe530('0x58')]=_0x4a134d[_0xe530('0x55')][_0xe530('0x56')];}return db[_0xe530('0x36')]['find']({'where':{'id':_0x4a134d['params']['id']}})[_0xe530('0x1a')](handleEntityNotFound(_0xbc9a66,null))[_0xe530('0x1a')](saveUpdates(_0x4a134d[_0xe530('0x52')],null))[_0xe530('0x1a')](respondWithResult(_0xbc9a66,null))['catch'](handleError(_0xbc9a66,null));};var utilLicense=require(_0xe530('0x16'));exports[_0xe530('0x59')]=function(_0x802343,_0x2982d9,_0x2d199c){var _0x55228f=_0xe530('0x5a');var _0x795439={'custom':![]};return utilLicense[_0xe530('0x5b')]()[_0xe530('0x1a')](function(_0x3076e7){if(_0x3076e7){_0x795439=_0x3076e7;}return db[_0xe530('0x36')]['find']({'where':{'id':_0x802343[_0xe530('0x4d')]['id']},'attributes':[_0xe530('0x5c'),_0xe530('0x58'),'preferred',_0xe530('0x5d'),_0xe530('0x5e'),_0xe530('0x5f'),_0xe530('0x60'),_0xe530('0x61')],'raw':!![]});})[_0xe530('0x1a')](handleEntityNotFound(_0x2982d9,null))[_0xe530('0x1a')](function(_0x221720){if(_0x221720){var _0x53a3df=_0x221720[_0xe530('0x5c')]&&fs[_0xe530('0x62')](path[_0xe530('0x63')](config[_0xe530('0x64')],_0x55228f,_[_0xe530('0x65')](_0x221720[_0xe530('0x5c')])))?path[_0xe530('0x63')](config[_0xe530('0x64')],_0x55228f,_['toLower'](_0x221720[_0xe530('0x5c')])):path[_0xe530('0x63')](config[_0xe530('0x64')],_0x55228f,_[_0xe530('0x65')](_0xe530('0x66')));var _0x167628=_0xe530('0x67')+_[_0xe530('0x68')]('logo');if(_0x221720[_0x167628]||!_0x795439[_0xe530('0x69')]){_0x53a3df=path['join'](config['root'],_0x55228f,_[_0xe530('0x65')](_0xe530('0x66')));}if(!fs[_0xe530('0x62')](_0x53a3df)){throw new db[(_0xe530('0x6a'))]['ValidationError'](_[_0xe530('0x68')](_0xe530('0x5c'))+_0xe530('0x6b'));}return _0x2982d9[_0xe530('0x6c')](_0x53a3df);}})['catch'](handleError(_0x2982d9,null));};var utilLicense=require(_0xe530('0x16'));exports[_0xe530('0x6d')]=function(_0x5c52bd,_0x291284,_0x256c5c){var _0x4048f5=_0xe530('0x5a');var _0x5cda6c={'custom':![]};return utilLicense[_0xe530('0x5b')]()[_0xe530('0x1a')](function(_0x4626bc){if(_0x4626bc){_0x5cda6c=_0x4626bc;}return db[_0xe530('0x36')][_0xe530('0x51')]({'where':{'id':_0x5c52bd[_0xe530('0x4d')]['id']},'attributes':[_0xe530('0x5c'),_0xe530('0x58'),_0xe530('0x6e'),_0xe530('0x5d'),_0xe530('0x5e'),_0xe530('0x5f'),_0xe530('0x60'),_0xe530('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x291284,null))[_0xe530('0x1a')](function(_0x20a7f6){if(_0x20a7f6){var _0x1ba9b0=_0x20a7f6[_0xe530('0x58')]&&fs[_0xe530('0x62')](path[_0xe530('0x63')](config['root'],_0x4048f5,_[_0xe530('0x65')](_0x20a7f6['loginLogo'])))?path[_0xe530('0x63')](config['root'],_0x4048f5,_[_0xe530('0x65')](_0x20a7f6[_0xe530('0x58')])):path[_0xe530('0x63')](config[_0xe530('0x64')],_0x4048f5,_[_0xe530('0x65')](_0xe530('0x6f')));var _0x167bfd='default'+_[_0xe530('0x68')](_0xe530('0x58'));if(_0x20a7f6[_0x167bfd]||!_0x5cda6c[_0xe530('0x69')]){_0x1ba9b0=path['join'](config[_0xe530('0x64')],_0x4048f5,_['toLower'](_0xe530('0x6f')));}if(!fs[_0xe530('0x62')](_0x1ba9b0)){throw new db['Sequelize'][(_0xe530('0x70'))](_['upperFirst'](_0xe530('0x58'))+_0xe530('0x6b'));}return _0x291284[_0xe530('0x6c')](_0x1ba9b0);}})[_0xe530('0x53')](handleError(_0x291284,null));};exports[_0xe530('0x71')]=function(_0x993cb4,_0x7f2744){return db[_0xe530('0x36')][_0xe530('0x51')]({'where':{'id':_0x993cb4[_0xe530('0x4d')]['id']},'attributes':['securePassword']})[_0xe530('0x1a')](respondWithResult(_0x7f2744,null))[_0xe530('0x53')](handleError(_0x7f2744,null));};exports[_0xe530('0x72')]=function(_0x576244,_0x1f163a,_0x4400c9){if(_0x576244[_0xe530('0x55')]&&_0x576244[_0xe530('0x55')]['filename']){_0x576244['body']['preferred']=_0x576244[_0xe530('0x55')][_0xe530('0x56')];}return db[_0xe530('0x36')][_0xe530('0x51')]({'where':{'id':_0x576244[_0xe530('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f163a,null))[_0xe530('0x1a')](saveUpdates(_0x576244['body'],null))[_0xe530('0x1a')](respondWithResult(_0x1f163a,null))['catch'](handleError(_0x1f163a,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x50d3bb,_0x40a3c8,_0x226f8c){var _0x21b5f5=_0xe530('0x5a');var _0x15162b={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x457e26){if(_0x457e26){_0x15162b=_0x457e26;}return db['Setting']['find']({'where':{'id':_0x50d3bb[_0xe530('0x4d')]['id']},'attributes':[_0xe530('0x5c'),_0xe530('0x58'),'preferred',_0xe530('0x5d'),'defaultLogo',_0xe530('0x5f'),_0xe530('0x60'),_0xe530('0x61')],'raw':!![]});})[_0xe530('0x1a')](handleEntityNotFound(_0x40a3c8,null))['then'](function(_0x23a760){if(_0x23a760){var _0x2e673c=_0x23a760[_0xe530('0x6e')]&&fs[_0xe530('0x62')](path[_0xe530('0x63')](config[_0xe530('0x64')],_0x21b5f5,_[_0xe530('0x65')](_0x23a760[_0xe530('0x6e')])))?path[_0xe530('0x63')](config['root'],_0x21b5f5,_[_0xe530('0x65')](_0x23a760[_0xe530('0x6e')])):path['join'](config[_0xe530('0x64')],_0x21b5f5,_[_0xe530('0x65')]('default_preferred.png'));var _0x383704=_0xe530('0x67')+_[_0xe530('0x68')](_0xe530('0x6e'));if(_0x23a760[_0x383704]||!_0x15162b[_0xe530('0x69')]||!_0x15162b[_0xe530('0x6e')]){_0x2e673c=path[_0xe530('0x63')](config[_0xe530('0x64')],_0x21b5f5,_[_0xe530('0x65')](_0xe530('0x73')));}if(!fs[_0xe530('0x62')](_0x2e673c)){throw new db[(_0xe530('0x6a'))][(_0xe530('0x70'))](_[_0xe530('0x68')](_0xe530('0x6e'))+_0xe530('0x6b'));}return _0x40a3c8['download'](_0x2e673c);}})[_0xe530('0x53')](handleError(_0x40a3c8,null));};exports[_0xe530('0x74')]=function(_0xe63f8d,_0x503d2c,_0x53bc97){if(_0xe63f8d['file']&&_0xe63f8d[_0xe530('0x55')]['filename']){_0xe63f8d['body'][_0xe530('0x5d')]=_0xe63f8d[_0xe530('0x55')][_0xe530('0x56')];}return db[_0xe530('0x36')][_0xe530('0x51')]({'where':{'id':_0xe63f8d['params']['id']}})['then'](handleEntityNotFound(_0x503d2c,null))[_0xe530('0x1a')](saveUpdates(_0xe63f8d[_0xe530('0x52')],null))[_0xe530('0x1a')](respondWithResult(_0x503d2c,null))['catch'](handleError(_0x503d2c,null));};var utilLicense=require(_0xe530('0x16'));exports['getFavicon']=function(_0x36bfbd,_0x50626b,_0x28bc96){var _0xc09ff6=_0xe530('0x5a');var _0x45d8f8={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4fc647){if(_0x4fc647){_0x45d8f8=_0x4fc647;}return db['Setting'][_0xe530('0x51')]({'where':{'id':_0x36bfbd[_0xe530('0x4d')]['id']},'attributes':[_0xe530('0x5c'),_0xe530('0x58'),_0xe530('0x6e'),'favicon',_0xe530('0x5e'),_0xe530('0x5f'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xe530('0x1a')](handleEntityNotFound(_0x50626b,null))[_0xe530('0x1a')](function(_0x12d70c){if(_0x12d70c){var _0x2c257e=_0x12d70c['favicon']&&fs[_0xe530('0x62')](path[_0xe530('0x63')](config[_0xe530('0x64')],_0xc09ff6,_[_0xe530('0x65')](_0x12d70c['favicon'])))?path[_0xe530('0x63')](config[_0xe530('0x64')],_0xc09ff6,_[_0xe530('0x65')](_0x12d70c[_0xe530('0x5d')])):path[_0xe530('0x63')](config['root'],_0xc09ff6,_[_0xe530('0x65')](_0xe530('0x75')));var _0x5cbfd2=_0xe530('0x67')+_[_0xe530('0x68')](_0xe530('0x5d'));if(_0x12d70c[_0x5cbfd2]||!_0x45d8f8[_0xe530('0x69')]){_0x2c257e=path[_0xe530('0x63')](config[_0xe530('0x64')],_0xc09ff6,_[_0xe530('0x65')](_0xe530('0x75')));}if(!fs[_0xe530('0x62')](_0x2c257e)){throw new db[(_0xe530('0x6a'))][(_0xe530('0x70'))](_[_0xe530('0x68')](_0xe530('0x5d'))+_0xe530('0x6b'));}return _0x50626b['download'](_0x2c257e);}})[_0xe530('0x53')](handleError(_0x50626b,null));};exports[_0xe530('0x76')]=function(_0x5284ae,_0x1469d7){var _0x43b6de={'offset':moment()['utcOffset']()};_0x43b6de[_0xe530('0x77')]=moment()['utcOffset'](_0x43b6de['offset'])[_0xe530('0x78')](_0xe530('0x79'));return _0x1469d7[_0xe530('0x24')](0xc8)['send'](_0x43b6de);}; \ No newline at end of file +var _0x64c4=['addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','show','params','Setting','rawAttributes','options','find','body','addLogo','file','filename','logo'];(function(_0x349b6a,_0x496705){var _0x21097c=function(_0x2aaded){while(--_0x2aaded){_0x349b6a['push'](_0x349b6a['shift']());}};_0x21097c(++_0x496705);}(_0x64c4,0x11b));var _0x464c=function(_0x195686,_0xd329df){_0x195686=_0x195686-0x0;var _0xaf27a1=_0x64c4[_0x195686];return _0xaf27a1;};'use strict';var emlformat=require(_0x464c('0x0'));var rimraf=require(_0x464c('0x1'));var zipdir=require(_0x464c('0x2'));var jsonpatch=require(_0x464c('0x3'));var rp=require(_0x464c('0x4'));var moment=require(_0x464c('0x5'));var BPromise=require(_0x464c('0x6'));var Mustache=require('mustache');var util=require(_0x464c('0x7'));var path=require(_0x464c('0x8'));var sox=require(_0x464c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x464c('0xa'));var _=require(_0x464c('0xb'));var squel=require(_0x464c('0xc'));var crypto=require(_0x464c('0xd'));var jsforce=require(_0x464c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x464c('0xf'));var querystring=require(_0x464c('0x10'));var Papa=require('papaparse');var Redis=require(_0x464c('0x11'));var authService=require(_0x464c('0x12'));var qs=require(_0x464c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x464c('0x14'))('api');var utils=require(_0x464c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x464c('0x16'));var db=require(_0x464c('0x17'))['db'];var jayson=require(_0x464c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x75d10a,_0x224586,_0x5e25da,_0xc84fb7){return new BPromise(function(_0x53d09e,_0x629135){var _0x49ce5d=_0xc84fb7||client;return _0x49ce5d[_0x464c('0x19')](_0x75d10a,_0x5e25da)[_0x464c('0x1a')](function(_0x1326a8){logger[_0x464c('0x1b')](_0x464c('0x1c'),_0x224586,_0x464c('0x1d'));logger['debug'](_0x464c('0x1e'),_0x224586,_0x464c('0x1d'),JSON[_0x464c('0x1f')](_0x1326a8));if(_0x1326a8[_0x464c('0x20')]){if(_0x1326a8[_0x464c('0x20')][_0x464c('0x21')]===0x1f4){logger[_0x464c('0x20')]('Setting,\x20%s,\x20%s',_0x224586,_0x1326a8[_0x464c('0x20')]['message']);return _0x629135(_0x1326a8['error'][_0x464c('0x22')]);}logger[_0x464c('0x20')](_0x464c('0x1c'),_0x224586,_0x1326a8[_0x464c('0x20')][_0x464c('0x22')]);return _0x53d09e(_0x1326a8[_0x464c('0x20')]['message']);}else{logger[_0x464c('0x1b')]('Setting,\x20%s,\x20%s',_0x224586,_0x464c('0x1d'));_0x53d09e(_0x1326a8[_0x464c('0x23')][_0x464c('0x22')]);}})[_0x464c('0x24')](function(_0x2498b2){logger[_0x464c('0x20')](_0x464c('0x1c'),_0x224586,_0x2498b2);_0x629135(_0x2498b2);});});}function respondWithStatusCode(_0x1d6f38,_0x3b2591){_0x3b2591=_0x3b2591||0xcc;return function(_0x1158eb){if(_0x1158eb){return _0x1d6f38[_0x464c('0x25')](_0x3b2591);}return _0x1d6f38[_0x464c('0x26')](_0x3b2591)[_0x464c('0x27')]();};}function respondWithResult(_0x53cb6f,_0x4571ad){_0x4571ad=_0x4571ad||0xc8;return function(_0x5c8dd8){if(_0x5c8dd8){return _0x53cb6f[_0x464c('0x26')](_0x4571ad)[_0x464c('0x28')](_0x5c8dd8);}};}function respondWithFilteredResult(_0x27f434,_0x61d96f){return function(_0x16e0b5){if(_0x16e0b5){var _0x1cc625=typeof _0x61d96f[_0x464c('0x29')]===_0x464c('0x2a')&&typeof _0x61d96f[_0x464c('0x2b')]===_0x464c('0x2a');var _0x217481=_0x16e0b5[_0x464c('0x2c')];var _0x26689e=_0x1cc625?0x0:_0x61d96f[_0x464c('0x29')];var _0x454ced=_0x1cc625?_0x16e0b5[_0x464c('0x2c')]:_0x61d96f['offset']+_0x61d96f[_0x464c('0x2b')];var _0x49e6a8;if(_0x454ced>=_0x217481){_0x454ced=_0x217481;_0x49e6a8=0xc8;}else{_0x49e6a8=0xce;}_0x27f434[_0x464c('0x26')](_0x49e6a8);return _0x27f434['set'](_0x464c('0x2d'),_0x26689e+'-'+_0x454ced+'/'+_0x217481)['json'](_0x16e0b5);}return null;};}function patchUpdates(_0x1c8430){return function(_0x2971c3){try{jsonpatch[_0x464c('0x2e')](_0x2971c3,_0x1c8430,!![]);}catch(_0x5416af){return BPromise[_0x464c('0x2f')](_0x5416af);}return _0x2971c3[_0x464c('0x30')]();};}function saveUpdates(_0x192355,_0x21bc44){return function(_0x3c5fd9){if(_0x3c5fd9){return _0x3c5fd9[_0x464c('0x31')](_0x192355)[_0x464c('0x1a')](function(_0x17e206){return _0x17e206;});}return null;};}function removeEntity(_0x3c2244,_0x2bc892){return function(_0x1089b0){if(_0x1089b0){return _0x1089b0[_0x464c('0x32')]()[_0x464c('0x1a')](function(){_0x3c2244['status'](0xcc)[_0x464c('0x27')]();});}};}function handleEntityNotFound(_0x931182,_0x165cc5){return function(_0x5e68f4){if(!_0x5e68f4){_0x931182['sendStatus'](0x194);}return _0x5e68f4;};}function handleError(_0x3f459f,_0xaf862){_0xaf862=_0xaf862||0x1f4;return function(_0x472e0c){logger['error'](_0x472e0c[_0x464c('0x33')]);if(_0x472e0c[_0x464c('0x34')]){delete _0x472e0c['name'];}_0x3f459f[_0x464c('0x26')](_0xaf862)['send'](_0x472e0c);};}exports[_0x464c('0x35')]=function(_0x1037d1,_0x1aef71){var _0x24b056={},_0x67e3a3={},_0x2ad132={'count':0x0,'rows':[]};var _0x18eebf=_[_0x464c('0x36')](db['Setting']['rawAttributes'],function(_0x53ab9c){return{'name':_0x53ab9c[_0x464c('0x37')],'type':_0x53ab9c[_0x464c('0x38')][_0x464c('0x39')]};});_0x67e3a3[_0x464c('0x3a')]=_[_0x464c('0x36')](_0x18eebf,'name');_0x67e3a3[_0x464c('0x3b')]=_['keys'](_0x1037d1[_0x464c('0x3b')]);_0x67e3a3[_0x464c('0x3c')]=_[_0x464c('0x3d')](_0x67e3a3[_0x464c('0x3a')],_0x67e3a3[_0x464c('0x3b')]);_0x24b056['attributes']=_[_0x464c('0x3d')](_0x67e3a3[_0x464c('0x3a')],qs[_0x464c('0x3e')](_0x1037d1[_0x464c('0x3b')]['fields']));_0x24b056[_0x464c('0x3f')]=_0x24b056['attributes'][_0x464c('0x40')]?_0x24b056[_0x464c('0x3f')]:_0x67e3a3[_0x464c('0x3a')];if(!_0x1037d1[_0x464c('0x3b')]['hasOwnProperty'](_0x464c('0x41'))){_0x24b056[_0x464c('0x2b')]=qs[_0x464c('0x2b')](_0x1037d1[_0x464c('0x3b')][_0x464c('0x2b')]);_0x24b056[_0x464c('0x29')]=qs['offset'](_0x1037d1['query'][_0x464c('0x29')]);}_0x24b056[_0x464c('0x42')]=qs['sort'](_0x1037d1[_0x464c('0x3b')]['sort']);_0x24b056['where']=qs['filters'](_[_0x464c('0x43')](_0x1037d1['query'],_0x67e3a3[_0x464c('0x3c')]),_0x18eebf);if(_0x1037d1['query']['filter']){_0x24b056['where']=_[_0x464c('0x44')](_0x24b056[_0x464c('0x45')],{'$or':_[_0x464c('0x36')](_0x18eebf,function(_0x5b9be3){if(_0x5b9be3[_0x464c('0x38')]!==_0x464c('0x46')){var _0x135214={};_0x135214[_0x5b9be3[_0x464c('0x34')]]={'$like':'%'+_0x1037d1[_0x464c('0x3b')][_0x464c('0x47')]+'%'};return _0x135214;}})});}_0x24b056=_[_0x464c('0x44')]({},_0x24b056,_0x1037d1['options']);var _0x5293cc={'where':_0x24b056[_0x464c('0x45')]};return db['Setting'][_0x464c('0x2c')](_0x5293cc)[_0x464c('0x1a')](function(_0x553609){_0x2ad132[_0x464c('0x2c')]=_0x553609;if(_0x1037d1[_0x464c('0x3b')][_0x464c('0x48')]){_0x24b056[_0x464c('0x49')]=[{'all':!![]}];}return db['Setting'][_0x464c('0x4a')](_0x24b056);})['then'](function(_0x19cb86){_0x2ad132['rows']=_0x19cb86;return _0x2ad132;})[_0x464c('0x1a')](respondWithFilteredResult(_0x1aef71,_0x24b056))[_0x464c('0x24')](handleError(_0x1aef71,null));};exports[_0x464c('0x4b')]=function(_0x53520b,_0x278d6d){var _0x59dedf={'raw':![],'where':{'id':_0x53520b[_0x464c('0x4c')]['id']}},_0x581183={};_0x581183[_0x464c('0x3a')]=_['keys'](db[_0x464c('0x4d')][_0x464c('0x4e')]);_0x581183['query']=_['keys'](_0x53520b[_0x464c('0x3b')]);_0x581183[_0x464c('0x3c')]=_[_0x464c('0x3d')](_0x581183[_0x464c('0x3a')],_0x581183[_0x464c('0x3b')]);_0x59dedf[_0x464c('0x3f')]=_[_0x464c('0x3d')](_0x581183[_0x464c('0x3a')],qs['fields'](_0x53520b['query'][_0x464c('0x3e')]));_0x59dedf[_0x464c('0x3f')]=_0x59dedf[_0x464c('0x3f')][_0x464c('0x40')]?_0x59dedf[_0x464c('0x3f')]:_0x581183[_0x464c('0x3a')];if(_0x53520b['query'][_0x464c('0x48')]){_0x59dedf[_0x464c('0x49')]=[{'all':!![]}];}_0x59dedf=_['merge']({},_0x59dedf,_0x53520b[_0x464c('0x4f')]);return db[_0x464c('0x4d')][_0x464c('0x50')](_0x59dedf)['then'](handleEntityNotFound(_0x278d6d,null))[_0x464c('0x1a')](respondWithResult(_0x278d6d,null))[_0x464c('0x24')](handleError(_0x278d6d,null));};exports['update']=function(_0x2e8c1f,_0x410115){if(_0x2e8c1f[_0x464c('0x51')]['id']){delete _0x2e8c1f[_0x464c('0x51')]['id'];}return db[_0x464c('0x4d')]['find']({'where':{'id':_0x2e8c1f[_0x464c('0x4c')]['id']}})[_0x464c('0x1a')](handleEntityNotFound(_0x410115,null))[_0x464c('0x1a')](saveUpdates(_0x2e8c1f[_0x464c('0x51')],null))['then'](respondWithResult(_0x410115,null))[_0x464c('0x24')](handleError(_0x410115,null));};exports[_0x464c('0x52')]=function(_0x158e0a,_0x3d574d,_0x4abdbe){if(_0x158e0a[_0x464c('0x53')]&&_0x158e0a[_0x464c('0x53')][_0x464c('0x54')]){_0x158e0a[_0x464c('0x51')][_0x464c('0x55')]=_0x158e0a['file']['filename'];}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x158e0a[_0x464c('0x4c')]['id']}})[_0x464c('0x1a')](handleEntityNotFound(_0x3d574d,null))[_0x464c('0x1a')](saveUpdates(_0x158e0a[_0x464c('0x51')],null))[_0x464c('0x1a')](respondWithResult(_0x3d574d,null))['catch'](handleError(_0x3d574d,null));};exports[_0x464c('0x56')]=function(_0x3eb462,_0x3f19e9,_0x2cbe6c){if(_0x3eb462['file']&&_0x3eb462['file'][_0x464c('0x54')]){_0x3eb462['body'][_0x464c('0x57')]=_0x3eb462[_0x464c('0x53')][_0x464c('0x54')];}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x3eb462[_0x464c('0x4c')]['id']}})[_0x464c('0x1a')](handleEntityNotFound(_0x3f19e9,null))[_0x464c('0x1a')](saveUpdates(_0x3eb462[_0x464c('0x51')],null))['then'](respondWithResult(_0x3f19e9,null))[_0x464c('0x24')](handleError(_0x3f19e9,null));};var utilLicense=require(_0x464c('0x16'));exports[_0x464c('0x58')]=function(_0xee2045,_0x4d68e7,_0x2b69bd){var _0x2782d9=_0x464c('0x59');var _0xdb4ddd={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x104eee){if(_0x104eee){_0xdb4ddd=_0x104eee;}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0xee2045['params']['id']},'attributes':[_0x464c('0x55'),_0x464c('0x57'),_0x464c('0x5a'),_0x464c('0x5b'),'defaultLogo',_0x464c('0x5c'),_0x464c('0x5d'),_0x464c('0x5e')],'raw':!![]});})[_0x464c('0x1a')](handleEntityNotFound(_0x4d68e7,null))[_0x464c('0x1a')](function(_0x32ef9d){if(_0x32ef9d){var _0x5c0bb5=_0x32ef9d[_0x464c('0x55')]&&fs[_0x464c('0x5f')](path[_0x464c('0x60')](config['root'],_0x2782d9,_[_0x464c('0x61')](_0x32ef9d[_0x464c('0x55')])))?path['join'](config[_0x464c('0x62')],_0x2782d9,_[_0x464c('0x61')](_0x32ef9d[_0x464c('0x55')])):path[_0x464c('0x60')](config[_0x464c('0x62')],_0x2782d9,_['toLower'](_0x464c('0x63')));var _0x1dae84=_0x464c('0x64')+_['upperFirst'](_0x464c('0x55'));if(_0x32ef9d[_0x1dae84]||!_0xdb4ddd[_0x464c('0x65')]){_0x5c0bb5=path[_0x464c('0x60')](config['root'],_0x2782d9,_[_0x464c('0x61')](_0x464c('0x63')));}if(!fs[_0x464c('0x5f')](_0x5c0bb5)){throw new db[(_0x464c('0x66'))][(_0x464c('0x67'))](_[_0x464c('0x68')](_0x464c('0x55'))+_0x464c('0x69'));}return _0x4d68e7[_0x464c('0x6a')](_0x5c0bb5);}})[_0x464c('0x24')](handleError(_0x4d68e7,null));};var utilLicense=require(_0x464c('0x16'));exports[_0x464c('0x6b')]=function(_0x517d8f,_0x3eaa5c,_0x1581b4){var _0x141595=_0x464c('0x59');var _0x4a0ec7={'custom':![]};return utilLicense[_0x464c('0x6c')]()['then'](function(_0x40dbc2){if(_0x40dbc2){_0x4a0ec7=_0x40dbc2;}return db[_0x464c('0x4d')]['find']({'where':{'id':_0x517d8f[_0x464c('0x4c')]['id']},'attributes':[_0x464c('0x55'),'loginLogo','preferred',_0x464c('0x5b'),'defaultLogo',_0x464c('0x5c'),_0x464c('0x5d'),_0x464c('0x5e')],'raw':!![]});})[_0x464c('0x1a')](handleEntityNotFound(_0x3eaa5c,null))['then'](function(_0x4c507a){if(_0x4c507a){var _0x1630f4=_0x4c507a[_0x464c('0x57')]&&fs[_0x464c('0x5f')](path['join'](config[_0x464c('0x62')],_0x141595,_[_0x464c('0x61')](_0x4c507a[_0x464c('0x57')])))?path[_0x464c('0x60')](config[_0x464c('0x62')],_0x141595,_[_0x464c('0x61')](_0x4c507a['loginLogo'])):path[_0x464c('0x60')](config[_0x464c('0x62')],_0x141595,_[_0x464c('0x61')](_0x464c('0x6d')));var _0x424cbd=_0x464c('0x64')+_[_0x464c('0x68')](_0x464c('0x57'));if(_0x4c507a[_0x424cbd]||!_0x4a0ec7[_0x464c('0x65')]){_0x1630f4=path[_0x464c('0x60')](config[_0x464c('0x62')],_0x141595,_[_0x464c('0x61')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1630f4)){throw new db[(_0x464c('0x66'))][(_0x464c('0x67'))](_['upperFirst']('loginLogo')+'\x20not\x20found');}return _0x3eaa5c[_0x464c('0x6a')](_0x1630f4);}})[_0x464c('0x24')](handleError(_0x3eaa5c,null));};exports[_0x464c('0x6e')]=function(_0x4d37be,_0x58dd26){return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x4d37be[_0x464c('0x4c')]['id']},'attributes':[_0x464c('0x6f')]})['then'](respondWithResult(_0x58dd26,null))['catch'](handleError(_0x58dd26,null));};exports[_0x464c('0x70')]=function(_0x33ec41,_0x329067,_0xbbbeba){if(_0x33ec41['file']&&_0x33ec41['file']['filename']){_0x33ec41[_0x464c('0x51')][_0x464c('0x5a')]=_0x33ec41['file'][_0x464c('0x54')];}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x33ec41[_0x464c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x329067,null))['then'](saveUpdates(_0x33ec41[_0x464c('0x51')],null))[_0x464c('0x1a')](respondWithResult(_0x329067,null))[_0x464c('0x24')](handleError(_0x329067,null));};var utilLicense=require(_0x464c('0x16'));exports[_0x464c('0x71')]=function(_0x2d339c,_0x4d1b69,_0x836330){var _0x11f069=_0x464c('0x59');var _0x542d84={'custom':![]};return utilLicense['getLicense']()[_0x464c('0x1a')](function(_0x291eb3){if(_0x291eb3){_0x542d84=_0x291eb3;}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x2d339c[_0x464c('0x4c')]['id']},'attributes':['logo',_0x464c('0x57'),'preferred',_0x464c('0x5b'),_0x464c('0x72'),_0x464c('0x5c'),_0x464c('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x464c('0x1a')](handleEntityNotFound(_0x4d1b69,null))['then'](function(_0x5b9300){if(_0x5b9300){var _0x4a8be1=_0x5b9300[_0x464c('0x5a')]&&fs['existsSync'](path['join'](config[_0x464c('0x62')],_0x11f069,_[_0x464c('0x61')](_0x5b9300[_0x464c('0x5a')])))?path['join'](config['root'],_0x11f069,_['toLower'](_0x5b9300[_0x464c('0x5a')])):path[_0x464c('0x60')](config[_0x464c('0x62')],_0x11f069,_[_0x464c('0x61')](_0x464c('0x73')));var _0x105e49='default'+_[_0x464c('0x68')](_0x464c('0x5a'));if(_0x5b9300[_0x105e49]||!_0x542d84[_0x464c('0x65')]||!_0x542d84[_0x464c('0x5a')]){_0x4a8be1=path['join'](config[_0x464c('0x62')],_0x11f069,_['toLower'](_0x464c('0x73')));}if(!fs[_0x464c('0x5f')](_0x4a8be1)){throw new db[(_0x464c('0x66'))][(_0x464c('0x67'))](_[_0x464c('0x68')](_0x464c('0x5a'))+_0x464c('0x69'));}return _0x4d1b69['download'](_0x4a8be1);}})[_0x464c('0x24')](handleError(_0x4d1b69,null));};exports[_0x464c('0x74')]=function(_0x1fbd8c,_0x10e6cb,_0x231c24){if(_0x1fbd8c[_0x464c('0x53')]&&_0x1fbd8c[_0x464c('0x53')]['filename']){_0x1fbd8c['body'][_0x464c('0x5b')]=_0x1fbd8c[_0x464c('0x53')][_0x464c('0x54')];}return db[_0x464c('0x4d')][_0x464c('0x50')]({'where':{'id':_0x1fbd8c[_0x464c('0x4c')]['id']}})[_0x464c('0x1a')](handleEntityNotFound(_0x10e6cb,null))['then'](saveUpdates(_0x1fbd8c[_0x464c('0x51')],null))[_0x464c('0x1a')](respondWithResult(_0x10e6cb,null))[_0x464c('0x24')](handleError(_0x10e6cb,null));};var utilLicense=require('../../config/license/util');exports[_0x464c('0x75')]=function(_0x586e58,_0x4e7bc2,_0x55bc23){var _0x21d544=_0x464c('0x59');var _0x2ea62a={'custom':![]};return utilLicense[_0x464c('0x6c')]()[_0x464c('0x1a')](function(_0x324fab){if(_0x324fab){_0x2ea62a=_0x324fab;}return db['Setting'][_0x464c('0x50')]({'where':{'id':_0x586e58[_0x464c('0x4c')]['id']},'attributes':[_0x464c('0x55'),_0x464c('0x57'),_0x464c('0x5a'),'favicon',_0x464c('0x72'),'defaultLoginLogo',_0x464c('0x5d'),_0x464c('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x4e7bc2,null))[_0x464c('0x1a')](function(_0x367174){if(_0x367174){var _0x4ede95=_0x367174[_0x464c('0x5b')]&&fs['existsSync'](path[_0x464c('0x60')](config[_0x464c('0x62')],_0x21d544,_[_0x464c('0x61')](_0x367174[_0x464c('0x5b')])))?path[_0x464c('0x60')](config['root'],_0x21d544,_[_0x464c('0x61')](_0x367174[_0x464c('0x5b')])):path['join'](config[_0x464c('0x62')],_0x21d544,_[_0x464c('0x61')](_0x464c('0x76')));var _0x11aee9=_0x464c('0x64')+_[_0x464c('0x68')](_0x464c('0x5b'));if(_0x367174[_0x11aee9]||!_0x2ea62a['custom']){_0x4ede95=path[_0x464c('0x60')](config[_0x464c('0x62')],_0x21d544,_['toLower'](_0x464c('0x76')));}if(!fs[_0x464c('0x5f')](_0x4ede95)){throw new db[(_0x464c('0x66'))][(_0x464c('0x67'))](_[_0x464c('0x68')]('favicon')+_0x464c('0x69'));}return _0x4e7bc2[_0x464c('0x6a')](_0x4ede95);}})[_0x464c('0x24')](handleError(_0x4e7bc2,null));};exports['getDate']=function(_0x3c7187,_0x2e24be){var _0x5ac0fc={'offset':moment()[_0x464c('0x77')]()};_0x5ac0fc[_0x464c('0x78')]=moment()[_0x464c('0x77')](_0x5ac0fc['offset'])['format'](_0x464c('0x79'));return _0x2e24be['status'](0xc8)[_0x464c('0x7a')](_0x5ac0fc);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 34c8161..61be760 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(_0x2f002a,_0x299399){var _0x346cbf=function(_0x57760e){while(--_0x57760e){_0x2f002a['push'](_0x2f002a['shift']());}};_0x346cbf(++_0x299399);}(_0xedd9,0xfc));var _0x9edd=function(_0x341577,_0x24fcc0){_0x341577=_0x341577-0x0;var _0x558ed4=_0xedd9[_0x341577];return _0x558ed4;};'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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x3b0efb,_0x1c4ba9){var _0x428bb8=function(_0x1210d6){while(--_0x1210d6){_0x3b0efb['push'](_0x3b0efb['shift']());}};_0x428bb8(++_0x1c4ba9);}(_0xe14b,0x93));var _0xbe14=function(_0x39ff0a,_0x3904cc){_0x39ff0a=_0x39ff0a-0x0;var _0x384f45=_0xe14b[_0x39ff0a];return _0x384f45;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index efaf0c4..5ded128 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 _0x9a95=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','find','options','raw','where','attributes','include','map','model','then','ShowSetting','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x5bd436,_0x52a267){var _0x1ee2c2=function(_0x530b14){while(--_0x530b14){_0x5bd436['push'](_0x5bd436['shift']());}};_0x1ee2c2(++_0x52a267);}(_0x9a95,0x15f));var _0x59a9=function(_0x2f08a1,_0x295d31){_0x2f08a1=_0x2f08a1-0x0;var _0x217da7=_0x9a95[_0x2f08a1];return _0x217da7;};'use strict';var _=require(_0x59a9('0x0'));var util=require(_0x59a9('0x1'));var moment=require('moment');var BPromise=require(_0x59a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x59a9('0x4'));var logger=require(_0x59a9('0x5'))(_0x59a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x59a9('0x7'));var client=jayson[_0x59a9('0x8')][_0x59a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x219ab0,_0x3286a4,_0x3f952b){return new BPromise(function(_0x5eee13,_0x4b4ed0){return client[_0x59a9('0xa')](_0x219ab0,_0x3f952b)['then'](function(_0x21a63e){logger[_0x59a9('0xb')](_0x59a9('0xc'),_0x3286a4,_0x59a9('0xd'));logger[_0x59a9('0xe')](_0x59a9('0xf'),_0x3286a4,_0x59a9('0xd'),JSON[_0x59a9('0x10')](_0x21a63e));if(_0x21a63e['error']){if(_0x21a63e[_0x59a9('0x11')][_0x59a9('0x12')]===0x1f4){logger[_0x59a9('0x11')](_0x59a9('0xc'),_0x3286a4,_0x21a63e[_0x59a9('0x11')]['message']);return _0x4b4ed0(_0x21a63e[_0x59a9('0x11')]['message']);}logger['error'](_0x59a9('0xc'),_0x3286a4,_0x21a63e['error'][_0x59a9('0x13')]);return _0x5eee13(_0x21a63e['error'][_0x59a9('0x13')]);}else{logger[_0x59a9('0xb')](_0x59a9('0xc'),_0x3286a4,_0x59a9('0xd'));_0x5eee13(_0x21a63e[_0x59a9('0x14')][_0x59a9('0x13')]);}})[_0x59a9('0x15')](function(_0xbff729){logger[_0x59a9('0x11')]('Setting,\x20%s,\x20%s',_0x3286a4,_0xbff729);_0x4b4ed0(_0xbff729);});});}exports['ShowSetting']=function(_0x420495){var _0x1eec94=this;return new Promise(function(_0x39455c,_0x3ef895){return db[_0x59a9('0x16')][_0x59a9('0x17')]({'raw':_0x420495[_0x59a9('0x18')]?_0x420495[_0x59a9('0x18')][_0x59a9('0x19')]===undefined?!![]:![]:!![],'where':_0x420495['options']?_0x420495[_0x59a9('0x18')][_0x59a9('0x1a')]||null:null,'attributes':_0x420495[_0x59a9('0x18')]?_0x420495[_0x59a9('0x18')][_0x59a9('0x1b')]||null:null,'include':_0x420495[_0x59a9('0x18')]?_0x420495[_0x59a9('0x18')][_0x59a9('0x1c')]?_[_0x59a9('0x1d')](_0x420495[_0x59a9('0x18')][_0x59a9('0x1c')],function(_0x3ff9f9){return{'model':db[_0x3ff9f9[_0x59a9('0x1e')]],'as':_0x3ff9f9['as'],'attributes':_0x3ff9f9['attributes'],'include':_0x3ff9f9[_0x59a9('0x1c')]?_['map'](_0x3ff9f9[_0x59a9('0x1c')],function(_0x4db078){return{'model':db[_0x4db078[_0x59a9('0x1e')]],'as':_0x4db078['as'],'attributes':_0x4db078[_0x59a9('0x1b')],'include':_0x4db078[_0x59a9('0x1c')]?_[_0x59a9('0x1d')](_0x4db078['include'],function(_0x5b9d39){return{'model':db[_0x5b9d39[_0x59a9('0x1e')]],'as':_0x5b9d39['as'],'attributes':_0x5b9d39['attributes']};}):[]};}):[]};}):[]:[]})[_0x59a9('0x1f')](function(_0x1263e5){logger[_0x59a9('0xb')]('ShowSetting',_0x420495);logger[_0x59a9('0xe')](_0x59a9('0x20'),_0x420495,JSON['stringify'](_0x1263e5));_0x39455c(_0x1263e5);})[_0x59a9('0x15')](function(_0x30715a){logger[_0x59a9('0x11')](_0x59a9('0x20'),_0x30715a['message'],_0x420495);_0x3ef895(_0x1eec94[_0x59a9('0x11')](0x1f4,_0x30715a[_0x59a9('0x13')]));});});}; \ No newline at end of file +var _0xaa33=['result','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5a8981,_0x12fe84){var _0x4a3592=function(_0x56bb10){while(--_0x56bb10){_0x5a8981['push'](_0x5a8981['shift']());}};_0x4a3592(++_0x12fe84);}(_0xaa33,0x1b0));var _0x3aa3=function(_0xf80889,_0x24a32c){_0xf80889=_0xf80889-0x0;var _0x51325b=_0xaa33[_0xf80889];return _0x51325b;};'use strict';var _=require(_0x3aa3('0x0'));var util=require(_0x3aa3('0x1'));var moment=require(_0x3aa3('0x2'));var BPromise=require(_0x3aa3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3aa3('0x4'));var db=require(_0x3aa3('0x5'))['db'];var utils=require(_0x3aa3('0x6'));var logger=require('../../config/logger')(_0x3aa3('0x7'));var config=require(_0x3aa3('0x8'));var jayson=require(_0x3aa3('0x9'));var client=jayson[_0x3aa3('0xa')][_0x3aa3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cbf9c,_0x1ee28d,_0x33bfb6){return new BPromise(function(_0x274b3e,_0x2095c4){return client[_0x3aa3('0xc')](_0x3cbf9c,_0x33bfb6)[_0x3aa3('0xd')](function(_0x3338f4){logger['info'](_0x3aa3('0xe'),_0x1ee28d,_0x3aa3('0xf'));logger[_0x3aa3('0x10')](_0x3aa3('0x11'),_0x1ee28d,_0x3aa3('0xf'),JSON[_0x3aa3('0x12')](_0x3338f4));if(_0x3338f4['error']){if(_0x3338f4[_0x3aa3('0x13')][_0x3aa3('0x14')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x1ee28d,_0x3338f4[_0x3aa3('0x13')][_0x3aa3('0x15')]);return _0x2095c4(_0x3338f4[_0x3aa3('0x13')]['message']);}logger[_0x3aa3('0x13')]('Setting,\x20%s,\x20%s',_0x1ee28d,_0x3338f4[_0x3aa3('0x13')][_0x3aa3('0x15')]);return _0x274b3e(_0x3338f4['error']['message']);}else{logger[_0x3aa3('0x16')](_0x3aa3('0xe'),_0x1ee28d,_0x3aa3('0xf'));_0x274b3e(_0x3338f4[_0x3aa3('0x17')][_0x3aa3('0x15')]);}})['catch'](function(_0x59ef92){logger['error'](_0x3aa3('0xe'),_0x1ee28d,_0x59ef92);_0x2095c4(_0x59ef92);});});}exports[_0x3aa3('0x18')]=function(_0x5f3146){var _0x8a5d39=this;return new Promise(function(_0x554f6b,_0x5f1649){return db[_0x3aa3('0x19')][_0x3aa3('0x1a')]({'raw':_0x5f3146[_0x3aa3('0x1b')]?_0x5f3146['options'][_0x3aa3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3146['options']?_0x5f3146[_0x3aa3('0x1b')][_0x3aa3('0x1d')]||null:null,'attributes':_0x5f3146[_0x3aa3('0x1b')]?_0x5f3146[_0x3aa3('0x1b')][_0x3aa3('0x1e')]||null:null,'include':_0x5f3146[_0x3aa3('0x1b')]?_0x5f3146['options'][_0x3aa3('0x1f')]?_['map'](_0x5f3146[_0x3aa3('0x1b')][_0x3aa3('0x1f')],function(_0x1c8a6e){return{'model':db[_0x1c8a6e[_0x3aa3('0x20')]],'as':_0x1c8a6e['as'],'attributes':_0x1c8a6e['attributes'],'include':_0x1c8a6e[_0x3aa3('0x1f')]?_['map'](_0x1c8a6e['include'],function(_0x1b9b5f){return{'model':db[_0x1b9b5f['model']],'as':_0x1b9b5f['as'],'attributes':_0x1b9b5f[_0x3aa3('0x1e')],'include':_0x1b9b5f[_0x3aa3('0x1f')]?_[_0x3aa3('0x21')](_0x1b9b5f[_0x3aa3('0x1f')],function(_0x4b7087){return{'model':db[_0x4b7087[_0x3aa3('0x20')]],'as':_0x4b7087['as'],'attributes':_0x4b7087['attributes']};}):[]};}):[]};}):[]:[]})[_0x3aa3('0xd')](function(_0x1847ab){logger[_0x3aa3('0x16')]('ShowSetting',_0x5f3146);logger['debug'](_0x3aa3('0x18'),_0x5f3146,JSON[_0x3aa3('0x12')](_0x1847ab));_0x554f6b(_0x1847ab);})[_0x3aa3('0x22')](function(_0x5da0b0){logger[_0x3aa3('0x13')](_0x3aa3('0x18'),_0x5da0b0['message'],_0x5f3146);_0x5f1649(_0x8a5d39[_0x3aa3('0x13')](0x1f4,_0x5da0b0[_0x3aa3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 620eda7..66f3769 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 _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x206315,_0x54b9ec){var _0x4d8de0=function(_0x1b9ccd){while(--_0x1b9ccd){_0x206315['push'](_0x206315['shift']());}};_0x4d8de0(++_0x54b9ec);}(_0x5fab,0x177));var _0xb5fa=function(_0x50e67a,_0x1784b8){_0x50e67a=_0x50e67a-0x0;var _0x34ff8d=_0x5fab[_0x50e67a];return _0x34ff8d;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file +var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x57fd40,_0x9de24f){var _0x52bb76=function(_0x55f232){while(--_0x55f232){_0x57fd40['push'](_0x57fd40['shift']());}};_0x52bb76(++_0x9de24f);}(_0x5fab,0x177));var _0xb5fa=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x5fab[_0x2d3a4d];return _0x3a94a3;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 33312a3..7dcd848 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 _0xfe2a=['connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xfe2a,0xe0));var _0xafe2=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xfe2a[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0xafe2('0x0'));var rs=require(_0xafe2('0x1'));module['exports']={'name':{'type':Sequelize[_0xafe2('0x2')],'unique':_0xafe2('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xafe2('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xafe2('0x4')]();}},'phone':{'type':Sequelize[_0xafe2('0x2')]},'type':{'type':Sequelize[_0xafe2('0x5')](_0xafe2('0x6'),'skebby',_0xafe2('0x7'),_0xafe2('0x8'),_0xafe2('0x9'),'clickatell',_0xafe2('0xa'),_0xafe2('0xb'),_0xafe2('0xc'),_0xafe2('0xd'))},'accountSid':{'type':Sequelize[_0xafe2('0x2')]},'authId':{'type':Sequelize[_0xafe2('0x2')]},'authToken':{'type':Sequelize[_0xafe2('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xafe2('0x2')]},'password':{'type':Sequelize[_0xafe2('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xafe2('0x2')]},'accountId':{'type':Sequelize[_0xafe2('0x2')]},'senderString':{'type':Sequelize[_0xafe2('0x2')]},'deliveryReport':{'type':Sequelize[_0xafe2('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xafe2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xafe2('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xafe2('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xafe2('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xafe2('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xafe2('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xafe2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xafe2('0xe')],'defaultValue':![],'comment':_0xafe2('0x11'),'set':function(_0xa3894){if(!_0xa3894)this[_0xafe2('0x12')](_0xafe2('0x13'),null);this[_0xafe2('0x12')](_0xafe2('0x14'),_0xa3894);}}}; \ No newline at end of file +var _0xf50c=['clicksend','clickatell','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','generate','ENUM','twilio','connectel'];(function(_0x597351,_0x5aed9f){var _0x410cd7=function(_0x511d62){while(--_0x511d62){_0x597351['push'](_0x597351['shift']());}};_0x410cd7(++_0x5aed9f);}(_0xf50c,0x198));var _0xcf50=function(_0x1ecc91,_0x3e6d62){_0x1ecc91=_0x1ecc91-0x0;var _0x416a20=_0xf50c[_0x1ecc91];return _0x416a20;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xcf50('0x0'));module['exports']={'name':{'type':Sequelize[_0xcf50('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xcf50('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xcf50('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xcf50('0x1')],'defaultValue':function(){return rs[_0xcf50('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcf50('0x3')](_0xcf50('0x4'),'skebby',_0xcf50('0x5'),_0xcf50('0x6'),'plivo',_0xcf50('0x7'),'bandwidth',_0xcf50('0x8'),_0xcf50('0x9'),_0xcf50('0xa'))},'accountSid':{'type':Sequelize[_0xcf50('0x1')]},'authId':{'type':Sequelize[_0xcf50('0x1')]},'authToken':{'type':Sequelize[_0xcf50('0x1')]},'smsMethod':{'type':Sequelize[_0xcf50('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0xcf50('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xcf50('0x1')]},'accountId':{'type':Sequelize[_0xcf50('0x1')]},'senderString':{'type':Sequelize[_0xcf50('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xcf50('0x1')]},'notificationTemplate':{'type':Sequelize[_0xcf50('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf50('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcf50('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcf50('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcf50('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcf50('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcf50('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xcf50('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcf50('0xd')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcf50('0xe'),'set':function(_0x1ceb52){if(!_0x1ceb52)this[_0xcf50('0xf')](_0xcf50('0x10'),null);this['setDataValue'](_0xcf50('0x11'),_0x1ceb52);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a12ff6b..445f916 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 _0x68aa=['text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','get','SmsAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','nolimit','pick','removeDispositions','addAnswer','SmsAccountId','CannedAnswer','getAnswers','length','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','defaults','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','set','Content-Type'];(function(_0x10efaf,_0xefbbf5){var _0x3b6863=function(_0x136676){while(--_0x136676){_0x10efaf['push'](_0x10efaf['shift']());}};_0x3b6863(++_0xefbbf5);}(_0x68aa,0x110));var _0xa68a=function(_0x1a39a,_0x5134ea){_0x1a39a=_0x1a39a-0x0;var _0x4ce4a8=_0x68aa[_0x1a39a];return _0x4ce4a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa68a('0x0'));var jsonpatch=require(_0xa68a('0x1'));var rp=require('request-promise');var moment=require(_0xa68a('0x2'));var BPromise=require(_0xa68a('0x3'));var Mustache=require(_0xa68a('0x4'));var util=require('util');var path=require(_0xa68a('0x5'));var sox=require(_0xa68a('0x6'));var csv=require(_0xa68a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa68a('0x8'));var _=require(_0xa68a('0x9'));var squel=require('squel');var crypto=require(_0xa68a('0xa'));var jsforce=require(_0xa68a('0xb'));var deskjs=require(_0xa68a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa68a('0xd'));var Papa=require(_0xa68a('0xe'));var Redis=require(_0xa68a('0xf'));var authService=require(_0xa68a('0x10'));var qs=require(_0xa68a('0x11'));var as=require(_0xa68a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa68a('0x13'))(_0xa68a('0x14'));var utils=require(_0xa68a('0x15'));var config=require(_0xa68a('0x16'));var licenseUtil=require(_0xa68a('0x17'));var db=require(_0xa68a('0x18'))['db'];config['redis']=_['defaults'](config[_0xa68a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa68a('0x1a'))(new Redis(config[_0xa68a('0x19')]));require(_0xa68a('0x1b'))[_0xa68a('0x1c')](socket);var jayson=require(_0xa68a('0x1d'));var client=jayson['client'][_0xa68a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3327c2,_0x3a8534,_0xa81c2f,_0x1240fb){return new BPromise(function(_0x2fee1b,_0x127be2){var _0x2f79e4=_0x1240fb||client;return _0x2f79e4[_0xa68a('0x1f')](_0x3327c2,_0xa81c2f)[_0xa68a('0x20')](function(_0x38f888){logger[_0xa68a('0x21')](_0xa68a('0x22'),_0x3a8534,_0xa68a('0x23'));logger[_0xa68a('0x24')](_0xa68a('0x25'),_0x3a8534,_0xa68a('0x23'),JSON[_0xa68a('0x26')](_0x38f888));if(_0x38f888['error']){if(_0x38f888['error'][_0xa68a('0x27')]===0x1f4){logger[_0xa68a('0x28')](_0xa68a('0x22'),_0x3a8534,_0x38f888[_0xa68a('0x28')][_0xa68a('0x29')]);return _0x127be2(_0x38f888[_0xa68a('0x28')][_0xa68a('0x29')]);}logger[_0xa68a('0x28')](_0xa68a('0x22'),_0x3a8534,_0x38f888['error'][_0xa68a('0x29')]);return _0x2fee1b(_0x38f888[_0xa68a('0x28')][_0xa68a('0x29')]);}else{logger[_0xa68a('0x21')](_0xa68a('0x22'),_0x3a8534,_0xa68a('0x23'));_0x2fee1b(_0x38f888['result']['message']);}})[_0xa68a('0x2a')](function(_0x4cebd2){logger['error'](_0xa68a('0x22'),_0x3a8534,_0x4cebd2);_0x127be2(_0x4cebd2);});});}function respondWithStatusCode(_0x3f903e,_0x5310ac){_0x5310ac=_0x5310ac||0xcc;return function(_0x17804a){if(_0x17804a){return _0x3f903e[_0xa68a('0x2b')](_0x5310ac);}return _0x3f903e[_0xa68a('0x2c')](_0x5310ac)['end']();};}function respondWithResult(_0x2d2cab,_0x12ccaf){_0x12ccaf=_0x12ccaf||0xc8;return function(_0x4f466b){if(_0x4f466b){return _0x2d2cab['status'](_0x12ccaf)[_0xa68a('0x2d')](_0x4f466b);}};}function respondWithFilteredResult(_0x4a0d12,_0x59b7d5){return function(_0x91866c){if(_0x91866c){var _0x1c319f=typeof _0x59b7d5[_0xa68a('0x2e')]===_0xa68a('0x2f')&&typeof _0x59b7d5['limit']===_0xa68a('0x2f');var _0x52df1c=_0x91866c[_0xa68a('0x30')];var _0x3a56d5=_0x1c319f?0x0:_0x59b7d5[_0xa68a('0x2e')];var _0x5effa=_0x1c319f?_0x91866c[_0xa68a('0x30')]:_0x59b7d5['offset']+_0x59b7d5[_0xa68a('0x31')];var _0x5127ce;if(_0x5effa>=_0x52df1c){_0x5effa=_0x52df1c;_0x5127ce=0xc8;}else{_0x5127ce=0xce;}_0x4a0d12[_0xa68a('0x2c')](_0x5127ce);return _0x4a0d12['set'](_0xa68a('0x32'),_0x3a56d5+'-'+_0x5effa+'/'+_0x52df1c)['json'](_0x91866c);}return null;};}function patchUpdates(_0xda8cb5){return function(_0x24e9d7){try{jsonpatch[_0xa68a('0x33')](_0x24e9d7,_0xda8cb5,!![]);}catch(_0xd6ffa2){return BPromise[_0xa68a('0x34')](_0xd6ffa2);}return _0x24e9d7['save']();};}function saveUpdates(_0x5a3658,_0x3eeef1){return function(_0xf17874){if(_0xf17874){return _0xf17874[_0xa68a('0x35')](_0x5a3658)['then'](function(_0x404198){return _0x404198;});}return null;};}function removeEntity(_0x385b34,_0x392ac7){return function(_0x3e220f){if(_0x3e220f){return _0x3e220f[_0xa68a('0x36')]()[_0xa68a('0x20')](function(){var _0x32e56c=_0x3e220f[_0xa68a('0x37')]({'plain':!![]});var _0x10c201=_0xa68a('0x38');return db['UserProfileResource'][_0xa68a('0x36')]({'where':{'type':_0x10c201,'resourceId':_0x32e56c['id']}})[_0xa68a('0x20')](function(){return _0x3e220f;});})[_0xa68a('0x20')](function(){_0x385b34[_0xa68a('0x2c')](0xcc)[_0xa68a('0x39')]();});}};}function handleEntityNotFound(_0x36d67b,_0x21fa01){return function(_0x540752){if(!_0x540752){_0x36d67b['sendStatus'](0x194);}return _0x540752;};}function handleError(_0x246c0f,_0x446580){_0x446580=_0x446580||0x1f4;return function(_0x479a0b){logger[_0xa68a('0x28')](_0x479a0b[_0xa68a('0x3a')]);if(_0x479a0b[_0xa68a('0x3b')]){delete _0x479a0b[_0xa68a('0x3b')];}_0x246c0f[_0xa68a('0x2c')](_0x446580)[_0xa68a('0x3c')](_0x479a0b);};}exports[_0xa68a('0x3d')]=function(_0x18c7d1,_0xa811ea){var _0x3ee605={'include':[{'model':db[_0xa68a('0x3e')],'as':_0xa68a('0x3f')}]},_0x14be85={},_0x2eb3e9={'count':0x0,'rows':[]};var _0x47cd32=_[_0xa68a('0x40')](db[_0xa68a('0x41')][_0xa68a('0x42')],function(_0x3f6fe1){return{'name':_0x3f6fe1[_0xa68a('0x43')],'type':_0x3f6fe1['type'][_0xa68a('0x44')]};});_0x14be85[_0xa68a('0x45')]=_[_0xa68a('0x40')](_0x47cd32,_0xa68a('0x3b'));_0x14be85[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x18c7d1[_0xa68a('0x46')]);_0x14be85[_0xa68a('0x48')]=_['intersection'](_0x14be85[_0xa68a('0x45')],_0x14be85[_0xa68a('0x46')]);_0x3ee605['attributes']=_[_0xa68a('0x49')](_0x14be85[_0xa68a('0x45')],qs[_0xa68a('0x4a')](_0x18c7d1[_0xa68a('0x46')][_0xa68a('0x4a')]));_0x3ee605['attributes']=_0x3ee605[_0xa68a('0x4b')]['length']?_0x3ee605[_0xa68a('0x4b')]:_0x14be85[_0xa68a('0x45')];if(!_0x18c7d1[_0xa68a('0x46')][_0xa68a('0x4c')]('nolimit')){_0x3ee605[_0xa68a('0x31')]=qs['limit'](_0x18c7d1[_0xa68a('0x46')][_0xa68a('0x31')]);_0x3ee605[_0xa68a('0x2e')]=qs[_0xa68a('0x2e')](_0x18c7d1[_0xa68a('0x46')]['offset']);}_0x3ee605[_0xa68a('0x4d')]=qs[_0xa68a('0x4e')](_0x18c7d1[_0xa68a('0x46')][_0xa68a('0x4e')]);_0x3ee605[_0xa68a('0x4f')]=qs['filters'](_['pick'](_0x18c7d1[_0xa68a('0x46')],_0x14be85[_0xa68a('0x48')]),_0x47cd32);if(_0x18c7d1['query'][_0xa68a('0x50')]){_0x3ee605[_0xa68a('0x4f')]=_[_0xa68a('0x51')](_0x3ee605[_0xa68a('0x4f')],{'$or':_[_0xa68a('0x40')](_0x47cd32,function(_0x1c2d28){if(_0x1c2d28['type']!==_0xa68a('0x52')){var _0x5a6fdc={};_0x5a6fdc[_0x1c2d28['name']]={'$like':'%'+_0x18c7d1['query'][_0xa68a('0x50')]+'%'};return _0x5a6fdc;}})});}_0x3ee605=_[_0xa68a('0x51')]({},_0x3ee605,_0x18c7d1[_0xa68a('0x53')]);var _0x1182fd={'where':_0x3ee605[_0xa68a('0x4f')]};return db[_0xa68a('0x41')][_0xa68a('0x30')](_0x1182fd)[_0xa68a('0x20')](function(_0x4a72c8){_0x2eb3e9[_0xa68a('0x30')]=_0x4a72c8;if(_0x18c7d1[_0xa68a('0x46')][_0xa68a('0x54')]){_0x3ee605['include']=[{'all':!![]}];}return db[_0xa68a('0x41')][_0xa68a('0x55')](_0x3ee605);})[_0xa68a('0x20')](function(_0x522585){_0x2eb3e9[_0xa68a('0x56')]=_0x522585;return _0x2eb3e9;})[_0xa68a('0x20')](respondWithFilteredResult(_0xa811ea,_0x3ee605))['catch'](handleError(_0xa811ea,null));};exports[_0xa68a('0x57')]=function(_0x29a243,_0x5cc847){var _0x52e3a6={'raw':![],'where':{'id':_0x29a243[_0xa68a('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xa68a('0x3f')}]},_0x5b5780={};_0x5b5780[_0xa68a('0x45')]=_['keys'](db[_0xa68a('0x41')][_0xa68a('0x42')]);_0x5b5780[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x29a243[_0xa68a('0x46')]);_0x5b5780[_0xa68a('0x48')]=_['intersection'](_0x5b5780['model'],_0x5b5780[_0xa68a('0x46')]);_0x52e3a6[_0xa68a('0x4b')]=_[_0xa68a('0x49')](_0x5b5780[_0xa68a('0x45')],qs['fields'](_0x29a243[_0xa68a('0x46')][_0xa68a('0x4a')]));_0x52e3a6[_0xa68a('0x4b')]=_0x52e3a6['attributes']['length']?_0x52e3a6[_0xa68a('0x4b')]:_0x5b5780[_0xa68a('0x45')];if(_0x29a243[_0xa68a('0x46')][_0xa68a('0x54')]){_0x52e3a6[_0xa68a('0x59')]=[{'all':!![]}];}_0x52e3a6=_[_0xa68a('0x51')]({},_0x52e3a6,_0x29a243['options']);return db['SmsAccount'][_0xa68a('0x5a')](_0x52e3a6)[_0xa68a('0x20')](handleEntityNotFound(_0x5cc847,null))['then'](respondWithResult(_0x5cc847,null))[_0xa68a('0x2a')](handleError(_0x5cc847,null));};exports[_0xa68a('0x5b')]=function(_0x35592c,_0x26b056){return db['SmsAccount'][_0xa68a('0x5b')](_0x35592c[_0xa68a('0x5c')],{})[_0xa68a('0x20')](function(_0x4ff71c){var _0x26032e=_0x35592c[_0xa68a('0x5d')][_0xa68a('0x37')]({'plain':!![]});if(!_0x26032e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26032e['role']===_0xa68a('0x5d')){var _0x4fcd23=_0x4ff71c['get']({'plain':!![]});var _0x4b72c8=_0xa68a('0x38');return db[_0xa68a('0x5e')][_0xa68a('0x5a')]({'where':{'name':_0x4b72c8,'userProfileId':_0x26032e[_0xa68a('0x5f')]},'raw':!![]})[_0xa68a('0x20')](function(_0x3541f7){if(_0x3541f7&&_0x3541f7['autoAssociation']===0x0){return db['UserProfileResource'][_0xa68a('0x5b')]({'name':_0x4fcd23['name'],'resourceId':_0x4fcd23['id'],'type':_0x3541f7['name'],'sectionId':_0x3541f7['id']},{})['then'](function(){return _0x4ff71c;});}else{return _0x4ff71c;}})['catch'](function(_0x431187){logger[_0xa68a('0x28')](_0xa68a('0x60'),_0x431187);throw _0x431187;});}return _0x4ff71c;})[_0xa68a('0x20')](respondWithResult(_0x26b056,0xc9))[_0xa68a('0x2a')](handleError(_0x26b056,null));};exports[_0xa68a('0x35')]=function(_0x21688a,_0x1a470b){if(_0x21688a[_0xa68a('0x5c')]['id']){delete _0x21688a[_0xa68a('0x5c')]['id'];}return db[_0xa68a('0x41')]['find']({'where':{'id':_0x21688a['params']['id']},'include':[{'model':db[_0xa68a('0x3e')],'as':_0xa68a('0x3f')}]})[_0xa68a('0x20')](handleEntityNotFound(_0x1a470b,null))[_0xa68a('0x20')](saveUpdates(_0x21688a[_0xa68a('0x5c')],null))['then'](respondWithResult(_0x1a470b,null))[_0xa68a('0x2a')](handleError(_0x1a470b,null));};exports[_0xa68a('0x36')]=function(_0x47f469,_0x5b9c32){return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x47f469[_0xa68a('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b9c32,null))[_0xa68a('0x20')](removeEntity(_0x5b9c32,null))[_0xa68a('0x2a')](handleError(_0x5b9c32,null));};exports['describe']=function(_0x27634b,_0x58ade5){return db[_0xa68a('0x41')][_0xa68a('0x61')]()[_0xa68a('0x20')](respondWithResult(_0x58ade5,null))[_0xa68a('0x2a')](handleError(_0x58ade5,null));};exports[_0xa68a('0x62')]=function(_0x9e403c,_0x5b7e33,_0x4cb9a4){if(_0x9e403c[_0xa68a('0x5c')]['id']){delete _0x9e403c['body']['id'];}return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x9e403c['params']['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x5b7e33,null))[_0xa68a('0x20')](function(_0x2a4adb){if(_0x2a4adb){_0x9e403c['body']['SmsAccountId']=_0x2a4adb['id'];return db[_0xa68a('0x63')]['create'](_0x9e403c[_0xa68a('0x5c')]);}})['then'](respondWithResult(_0x5b7e33,null))[_0xa68a('0x2a')](handleError(_0x5b7e33,null));};exports['getDispositions']=function(_0x59d8ca,_0x5377ab,_0x2d3cc1){var _0xb688a6={'raw':![],'where':{}};var _0x2f09a1={};var _0x279edc={'count':0x0,'rows':[]};return db[_0xa68a('0x41')][_0xa68a('0x64')]({'where':{'id':_0x59d8ca['params']['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x5377ab,null))[_0xa68a('0x20')](function(_0x28272b){if(_0x28272b){_0x2f09a1[_0xa68a('0x45')]=_[_0xa68a('0x47')](db[_0xa68a('0x63')][_0xa68a('0x42')]);_0x2f09a1[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x59d8ca[_0xa68a('0x46')]);_0x2f09a1[_0xa68a('0x48')]=_[_0xa68a('0x49')](_0x2f09a1['model'],_0x2f09a1[_0xa68a('0x46')]);_0xb688a6[_0xa68a('0x4b')]=_[_0xa68a('0x49')](_0x2f09a1[_0xa68a('0x45')],qs[_0xa68a('0x4a')](_0x59d8ca['query']['fields']));_0xb688a6['attributes']=_0xb688a6[_0xa68a('0x4b')]['length']?_0xb688a6[_0xa68a('0x4b')]:_0x2f09a1['model'];if(!_0x59d8ca['query'][_0xa68a('0x4c')](_0xa68a('0x65'))){_0xb688a6[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x59d8ca[_0xa68a('0x46')][_0xa68a('0x31')]);_0xb688a6[_0xa68a('0x2e')]=qs['offset'](_0x59d8ca['query'][_0xa68a('0x2e')]);}_0xb688a6[_0xa68a('0x4d')]=qs[_0xa68a('0x4e')](_0x59d8ca[_0xa68a('0x46')]['sort']);_0xb688a6[_0xa68a('0x4f')]=qs[_0xa68a('0x48')](_[_0xa68a('0x66')](_0x59d8ca[_0xa68a('0x46')],_0x2f09a1['filters']));_0xb688a6[_0xa68a('0x4f')]['SmsAccountId']=_0x28272b['id'];if(_0x59d8ca[_0xa68a('0x46')][_0xa68a('0x50')]){_0xb688a6[_0xa68a('0x4f')]=_['merge'](_0xb688a6[_0xa68a('0x4f')],{'$or':_[_0xa68a('0x40')](_0xb688a6['attributes'],function(_0x367c4c){var _0x4262bf={};_0x4262bf[_0x367c4c]={'$like':'%'+_0x59d8ca[_0xa68a('0x46')]['filter']+'%'};return _0x4262bf;})});}_0xb688a6=_['merge']({},_0xb688a6,_0x59d8ca[_0xa68a('0x53')]);return db[_0xa68a('0x63')][_0xa68a('0x30')]({'where':_0xb688a6[_0xa68a('0x4f')]})['then'](function(_0x1e394d){_0x279edc[_0xa68a('0x30')]=_0x1e394d;if(_0x59d8ca[_0xa68a('0x46')][_0xa68a('0x54')]){_0xb688a6[_0xa68a('0x59')]=[{'all':!![]}];}return db[_0xa68a('0x63')][_0xa68a('0x55')](_0xb688a6);})['then'](function(_0x4a3e75){_0x279edc[_0xa68a('0x56')]=_0x4a3e75;return _0x279edc;});}})[_0xa68a('0x20')](respondWithFilteredResult(_0x5377ab,_0xb688a6))['catch'](handleError(_0x5377ab,null));};exports[_0xa68a('0x67')]=function(_0x3fb19b,_0x2e2ad8,_0x2820ab){return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x3fb19b['params']['id']}})['then'](handleEntityNotFound(_0x2e2ad8,null))[_0xa68a('0x20')](function(_0x5ba633){if(_0x5ba633){return _0x5ba633['removeDispositions'](_0x3fb19b['query']['ids']);}})[_0xa68a('0x20')](respondWithStatusCode(_0x2e2ad8,null))[_0xa68a('0x2a')](handleError(_0x2e2ad8,null));};exports[_0xa68a('0x68')]=function(_0x42addc,_0x14fa6a,_0x388330){if(_0x42addc['body']['id']){delete _0x42addc['body']['id'];}return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x42addc['params']['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x14fa6a,null))[_0xa68a('0x20')](function(_0x2ecea7){if(_0x2ecea7){_0x42addc[_0xa68a('0x5c')][_0xa68a('0x69')]=_0x2ecea7['id'];return db[_0xa68a('0x6a')][_0xa68a('0x5b')](_0x42addc['body']);}})['then'](respondWithResult(_0x14fa6a,null))[_0xa68a('0x2a')](handleError(_0x14fa6a,null));};exports[_0xa68a('0x6b')]=function(_0x25c4a7,_0x4ca835,_0x1f7938){var _0x3c5019={'raw':![],'where':{}};var _0x48f75a={};var _0x52d24e={'count':0x0,'rows':[]};return db[_0xa68a('0x41')][_0xa68a('0x64')]({'where':{'id':_0x25c4a7['params']['id']}})['then'](handleEntityNotFound(_0x4ca835,null))[_0xa68a('0x20')](function(_0x2cf7c3){if(_0x2cf7c3){_0x48f75a[_0xa68a('0x45')]=_['keys'](db[_0xa68a('0x6a')][_0xa68a('0x42')]);_0x48f75a['query']=_[_0xa68a('0x47')](_0x25c4a7['query']);_0x48f75a[_0xa68a('0x48')]=_['intersection'](_0x48f75a[_0xa68a('0x45')],_0x48f75a[_0xa68a('0x46')]);_0x3c5019[_0xa68a('0x4b')]=_['intersection'](_0x48f75a[_0xa68a('0x45')],qs['fields'](_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x4a')]));_0x3c5019[_0xa68a('0x4b')]=_0x3c5019[_0xa68a('0x4b')][_0xa68a('0x6c')]?_0x3c5019[_0xa68a('0x4b')]:_0x48f75a[_0xa68a('0x45')];if(!_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x4c')](_0xa68a('0x65'))){_0x3c5019[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x31')]);_0x3c5019['offset']=qs[_0xa68a('0x2e')](_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x2e')]);}_0x3c5019[_0xa68a('0x4d')]=qs['sort'](_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x4e')]);_0x3c5019['where']=qs[_0xa68a('0x48')](_['pick'](_0x25c4a7['query'],_0x48f75a[_0xa68a('0x48')]));_0x3c5019[_0xa68a('0x4f')]['SmsAccountId']=_0x2cf7c3['id'];if(_0x25c4a7['query']['filter']){_0x3c5019['where']=_[_0xa68a('0x51')](_0x3c5019['where'],{'$or':_[_0xa68a('0x40')](_0x3c5019[_0xa68a('0x4b')],function(_0x3e6249){var _0x3ebbe5={};_0x3ebbe5[_0x3e6249]={'$like':'%'+_0x25c4a7['query'][_0xa68a('0x50')]+'%'};return _0x3ebbe5;})});}_0x3c5019=_[_0xa68a('0x51')]({},_0x3c5019,_0x25c4a7['options']);return db[_0xa68a('0x6a')]['count']({'where':_0x3c5019['where']})[_0xa68a('0x20')](function(_0x3f2ff5){_0x52d24e[_0xa68a('0x30')]=_0x3f2ff5;if(_0x25c4a7[_0xa68a('0x46')][_0xa68a('0x54')]){_0x3c5019[_0xa68a('0x59')]=[{'all':!![]}];}return db[_0xa68a('0x6a')]['findAll'](_0x3c5019);})[_0xa68a('0x20')](function(_0x5d0173){_0x52d24e[_0xa68a('0x56')]=_0x5d0173;return _0x52d24e;});}})[_0xa68a('0x20')](respondWithFilteredResult(_0x4ca835,_0x3c5019))['catch'](handleError(_0x4ca835,null));};exports[_0xa68a('0x6d')]=function(_0x5e5169,_0x394fc2,_0xea1d6a){return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x5e5169[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x394fc2,null))[_0xa68a('0x20')](function(_0x33064f){if(_0x33064f){return _0x33064f['removeAnswers'](_0x5e5169[_0xa68a('0x46')][_0xa68a('0x6e')]);}})[_0xa68a('0x20')](respondWithStatusCode(_0x394fc2,null))[_0xa68a('0x2a')](handleError(_0x394fc2,null));};exports[_0xa68a('0x6f')]=function(_0x4323fa,_0x373ee8,_0x59ab7a){var _0x5e44a3={'channel':_0xa68a('0x70')};var _0x1ceff7=[];var _0x4fec4c=[];var _0x3766df={};return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x4323fa[_0xa68a('0x58')]['id']},'include':[{'model':db[_0xa68a('0x71')],'as':_0xa68a('0x72')}]})[_0xa68a('0x20')](handleEntityNotFound(_0x373ee8,null))[_0xa68a('0x20')](function(_0x21ca4c){_0x5e44a3[_0xa68a('0x73')]=_0x21ca4c;_0x5e44a3[_0xa68a('0x74')]=_[_0xa68a('0x75')](_0x21ca4c[_0xa68a('0x72')],[_0xa68a('0x76')],[_0xa68a('0x77')]);if(_0x5e44a3['account'][_0xa68a('0x72')]){delete _0x5e44a3[_0xa68a('0x73')][_0xa68a('0x72')];}return db[_0xa68a('0x78')][_0xa68a('0x61')]();})[_0xa68a('0x20')](function(_0x4ead6a){if(!_0x4ead6a){throw new db[(_0xa68a('0x79'))][(_0xa68a('0x7a'))](_0xa68a('0x7b'));}_0x1ceff7=_[_0xa68a('0x7c')](_[_0xa68a('0x47')](_0x4ead6a),[_0xa68a('0x7d'),_0xa68a('0x7e')]);_0x4fec4c=_[_0xa68a('0x7c')](_[_0xa68a('0x47')](_0x4ead6a),[_0xa68a('0x7d'),_0xa68a('0x7e'),'CompanyId',_0xa68a('0x7f')]);_0x5e44a3[_0xa68a('0x5c')]={'mapKey':_0xa68a('0x80')};if(_0x5e44a3['account'][_0xa68a('0x81')]){switch(_0x5e44a3['account'][_0xa68a('0x81')]){case _0xa68a('0x82'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x84')];_0x5e44a3['body'][_0xa68a('0x5c')]=_0x4323fa['body'][_0xa68a('0x85')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x87')];break;case _0xa68a('0x88'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]='+'+_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x89')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x8a')];break;case _0xa68a('0x8b'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x83')];_0x5e44a3['body'][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x29')];break;case _0xa68a('0x8c'):_0x5e44a3['body'][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x83')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x5c')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x8d')];break;case _0xa68a('0x8e'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x84')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x8f')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x90')];break;case _0xa68a('0x91'):_0x5e44a3['body']['from']='+'+_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x92')][0x0][_0xa68a('0x83')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')]['results'][0x0]['text'];_0x5e44a3['body'][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x92')][0x0][_0xa68a('0x86')];break;case _0xa68a('0x93'):_0x5e44a3['body'][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x94')];_0x5e44a3['body'][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x95')][_0xa68a('0x29')];break;case _0xa68a('0x96'):_0x5e44a3[_0xa68a('0x5c')]['from']=_0x4323fa[_0xa68a('0x5c')]['fromNumber'];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x8a')];_0x5e44a3['body'][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x97')];break;case _0xa68a('0x98'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')][0x0]['message']['id'];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][0x0][_0xa68a('0x29')]['from'];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][0x0][_0xa68a('0x29')][_0xa68a('0x8a')];break;case _0xa68a('0x99'):_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x83')];_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')]=_0x4323fa[_0xa68a('0x5c')][_0xa68a('0x29')];_0x5e44a3['body'][_0xa68a('0x86')]=_0x4323fa[_0xa68a('0x5c')]['refid'];break;}}if(_0x5e44a3[_0xa68a('0x5c')]['id']){delete _0x5e44a3[_0xa68a('0x5c')]['id'];}if(_[_0xa68a('0x9a')](_0x5e44a3['body']['from'])){throw new db[(_0xa68a('0x79'))][(_0xa68a('0x7a'))](_0xa68a('0x9b'));}if(_[_0xa68a('0x9a')](_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x5c')])||_0x5e44a3['body']['body']===''){throw new db[(_0xa68a('0x79'))][(_0xa68a('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa68a('0x9a')](_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x9c')])){throw new db[(_0xa68a('0x79'))]['ValidationError'](_0xa68a('0x9d')+_0x4fec4c);}if(!_['includes'](_0x4fec4c,_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x9c')])){throw new db[(_0xa68a('0x79'))][(_0xa68a('0x7a'))](_0xa68a('0x9e')+_0x4fec4c);}_0x3766df[_0x5e44a3['body']['mapKey']]=_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')];return db[_0xa68a('0x9f')][_0xa68a('0x5a')]({'where':{'id':_0x5e44a3['account']['ListId']},'include':[{'model':db[_0xa68a('0x78')],'as':_0xa68a('0xa0'),'where':_0x3766df,'limit':0x1,'order':[[_0xa68a('0x7e'),'DESC']]}]});})['then'](handleEntityNotFound(_0x373ee8,null))[_0xa68a('0x20')](function(_0x10b454){if(_0x10b454){_0x5e44a3[_0xa68a('0xa1')]=_[_0xa68a('0xa2')](_0x10b454,[_0xa68a('0xa0')]);if(_0x10b454[_0xa68a('0xa0')][_0xa68a('0x6c')]){return _0x10b454[_0xa68a('0xa0')][0x0];}var _0x18bcef=_[_0xa68a('0xa3')](_0x5e44a3[_0xa68a('0x5c')],{'firstName':_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')],'ListId':_0x10b454['id']});_0x18bcef[_0x5e44a3['body'][_0xa68a('0x9c')]]=_0x5e44a3['body'][_0xa68a('0x83')];return db[_0xa68a('0x78')][_0xa68a('0x5b')](_0x18bcef,{'fields':_0x1ceff7,'raw':!![]});}})[_0xa68a('0x20')](handleEntityNotFound(_0x373ee8,null))[_0xa68a('0x20')](function(_0x389e45){if(_0x389e45){_0x5e44a3['contact']=_0x389e45;var _0x1a2e66={'ContactId':_0x389e45['id'],'phone':_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0x83')],'SmsAccountId':_0x4323fa[_0xa68a('0x58')]['id']};var _0x4fbe91={'ContactId':_0x389e45['id'],'SmsAccountId':_0x4323fa['params']['id'],'closed':![]};return db[_0xa68a('0xa4')][_0xa68a('0x5a')]({'where':_0x4fbe91})[_0xa68a('0x20')](function(_0xee3db2){if(_0xee3db2){return[_0xee3db2,![]];}return db[_0xa68a('0xa4')][_0xa68a('0x5b')](_0x1a2e66)[_0xa68a('0x20')](function(_0x10314e){return[_0x10314e,!![]];});});}})[_0xa68a('0xa5')](function(_0x37703c,_0x38edf7){_0x5e44a3[_0xa68a('0xa6')]=_0x37703c[_0xa68a('0x37')]({'plain':!![]});_0x5e44a3[_0xa68a('0xa6')][_0xa68a('0xa7')]=![];if(_0x38edf7){if(_0x5e44a3[_0xa68a('0x73')][_0xa68a('0xa8')]){_0x5e44a3[_0xa68a('0x74')][_0xa68a('0xa9')]({'id':0x0,'priority':_0x5e44a3[_0xa68a('0x74')]['length']+0x1,'app':_0xa68a('0xaa'),'appdata':_0xa68a('0xab'),'interval':_0xa68a('0xac')});}_0x5e44a3[_0xa68a('0xa6')][_0xa68a('0xa7')]=!![];}return db[_0xa68a('0xad')]['create']({'phone':_0x5e44a3[_0xa68a('0x5c')]['from'],'messageId':_0x5e44a3['body'][_0xa68a('0x86')],'body':_0x5e44a3['body']['body'],'SmsAccountId':_0x4323fa[_0xa68a('0x58')]['id'],'SmsInteractionId':_0x37703c['id'],'direction':'in','ContactId':_0x37703c[_0xa68a('0xae')],'AttachmentId':_0x5e44a3[_0xa68a('0x5c')][_0xa68a('0xaf')]});})[_0xa68a('0x20')](function(_0x10f4f2){_0x5e44a3[_0xa68a('0x29')]=_0x10f4f2;if(_0x5e44a3['interaction']['UserId']){return db['User'][_0xa68a('0x5a')]({'attributes':['id','name'],'where':{'id':_0x5e44a3[_0xa68a('0xa6')]['UserId']}})['then'](function(_0x19ca4d){if(_0x19ca4d){_0x5e44a3[_0xa68a('0x74')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x19ca4d[_0xa68a('0x3b')]+','+(_0x5e44a3[_0xa68a('0x73')][_0xa68a('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xa68a('0xb1'),_0x5e44a3);});}return respondWithRpcPromise('Start',_0xa68a('0xb1'),_0x5e44a3);})['then'](function(_0x154618){if(_0x154618){var _0x287e47=0xc8;var _0x5ad601=_0xa68a('0xb2');logger['info'](_0xa68a('0x25'),_0x5ad601,_0x287e47,_0xa68a('0xb3'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5ad601,_0x287e47,_0xa68a('0xb3'),JSON['stringify'](_0x154618));if(_0x5e44a3[_0xa68a('0x73')][_0xa68a('0x81')]===_0xa68a('0x82')){return _0x373ee8[_0xa68a('0x2c')](_0x287e47)[_0xa68a('0xb4')](_0xa68a('0xb5'),_0xa68a('0xb6'))[_0xa68a('0x3c')](_0xa68a('0xb7'));}else{return _0x373ee8[_0xa68a('0x2c')](_0x287e47)[_0xa68a('0x2d')](_0x154618);}}})[_0xa68a('0x2a')](handleError(_0x373ee8,null));};exports[_0xa68a('0xb8')]=function(_0x5fc02c,_0x576bee){var _0x42d509=_0x5fc02c[_0xa68a('0x58')]['id'];var _0x516c9c=_0x5fc02c[_0xa68a('0x5c')];var _0x31711a=0xc8;var _0x50f2b8=null;return db[_0xa68a('0xb9')][_0xa68a('0xba')]({'isolationLevel':db[_0xa68a('0xb9')][_0xa68a('0xbb')][_0xa68a('0xbc')][_0xa68a('0xbd')]},function(_0x92b6bf){return db['SmsAccount'][_0xa68a('0x64')]({'where':{'id':_0x42d509},'transaction':_0x92b6bf})[_0xa68a('0x20')](function(_0x542b27){if(_0x542b27){return db['SmsApplication'][_0xa68a('0x36')]({'where':{'SmsAccountId':_0x42d509},'transaction':_0x92b6bf})[_0xa68a('0x20')](function(){var _0x185d55=_[_0xa68a('0x40')](_0x516c9c,function(_0x948cc){_0x948cc['SmsAccountId']=_0x42d509;return _0x948cc;});return db[_0xa68a('0x71')][_0xa68a('0xbe')](_0x185d55,{'transaction':_0x92b6bf});});}else{_0x31711a=0x194;_0x50f2b8=[];}});})[_0xa68a('0x20')](function(){if(_0x31711a!==0x194){return db['SmsApplication'][_0xa68a('0xbf')]({'where':{'SmsAccountId':_0x42d509},'order':_0xa68a('0x76')})['then'](function(_0x3898fa){_0x50f2b8=_0x3898fa;});}})[_0xa68a('0x2a')](function(_0x1b9df1){_0x31711a=0x1f4;logger[_0xa68a('0x28')](_0x1b9df1['stack']);if(_0x1b9df1[_0xa68a('0x3b')]){delete _0x1b9df1['name'];}_0x50f2b8=_0x1b9df1;})[_0xa68a('0xc0')](function(){if(_0x50f2b8===null){_0x576bee[_0xa68a('0x2b')](_0x31711a);}else{if(_0x31711a===0x1f4){_0x576bee[_0xa68a('0x2c')](_0x31711a)[_0xa68a('0x3c')](_0x50f2b8);}else{_0x576bee[_0xa68a('0x2c')](_0x31711a)[_0xa68a('0x2d')](_0x50f2b8);}}});};exports[_0xa68a('0xc1')]=function(_0x26d339,_0x113f9a,_0x565d80){var _0xc87cbf={};var _0x4a1d4b={};var _0x3762fc;var _0x1fe52a;return db[_0xa68a('0x41')][_0xa68a('0x64')]({'where':{'id':_0x26d339[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x113f9a,null))[_0xa68a('0x20')](function(_0x45721e){if(_0x45721e){_0x3762fc=_0x45721e;_0x4a1d4b[_0xa68a('0x45')]=_[_0xa68a('0x47')](db['SmsApplication'][_0xa68a('0x42')]);_0x4a1d4b[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x26d339[_0xa68a('0x46')]);_0x4a1d4b[_0xa68a('0x48')]=_[_0xa68a('0x49')](_0x4a1d4b[_0xa68a('0x45')],_0x4a1d4b[_0xa68a('0x46')]);_0xc87cbf[_0xa68a('0x4b')]=_[_0xa68a('0x49')](_0x4a1d4b[_0xa68a('0x45')],qs['fields'](_0x26d339['query']['fields']));_0xc87cbf[_0xa68a('0x4b')]=_0xc87cbf['attributes'][_0xa68a('0x6c')]?_0xc87cbf[_0xa68a('0x4b')]:_0x4a1d4b[_0xa68a('0x45')];_0xc87cbf[_0xa68a('0x4d')]=qs['sort'](_0x26d339[_0xa68a('0x46')][_0xa68a('0x4e')]);_0xc87cbf[_0xa68a('0x4f')]=qs[_0xa68a('0x48')](_[_0xa68a('0x66')](_0x26d339['query'],_0x4a1d4b[_0xa68a('0x48')]));if(_0x26d339['query']['filter']){_0xc87cbf[_0xa68a('0x4f')]=_[_0xa68a('0x51')](_0xc87cbf['where'],{'$or':_[_0xa68a('0x40')](_0xc87cbf[_0xa68a('0x4b')],function(_0x39ffa8){var _0x144a25={};_0x144a25[_0x39ffa8]={'$like':'%'+_0x26d339[_0xa68a('0x46')][_0xa68a('0x50')]+'%'};return _0x144a25;})});}_0xc87cbf=_['merge']({},_0xc87cbf,_0x26d339['options']);return _0x3762fc[_0xa68a('0xc1')](_0xc87cbf);}})[_0xa68a('0x20')](function(_0x2349a6){if(_0x2349a6){_0x1fe52a=_0x2349a6[_0xa68a('0x6c')];if(!_0x26d339[_0xa68a('0x46')]['hasOwnProperty'](_0xa68a('0x65'))){_0xc87cbf[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x26d339[_0xa68a('0x46')][_0xa68a('0x31')]);_0xc87cbf['offset']=qs[_0xa68a('0x2e')](_0x26d339[_0xa68a('0x46')][_0xa68a('0x2e')]);}return _0x3762fc[_0xa68a('0xc1')](_0xc87cbf);}})[_0xa68a('0x20')](function(_0x363129){if(_0x363129){return _0x363129?{'count':_0x1fe52a,'rows':_0x363129}:null;}})['then'](respondWithResult(_0x113f9a,null))[_0xa68a('0x2a')](handleError(_0x113f9a,null));};exports[_0xa68a('0xc2')]=function(_0x300a20,_0xdd0dc0,_0x285912){var _0x5c7fab={'raw':![],'where':{}};var _0x50e706={};var _0x1234b9={'count':0x0,'rows':[]};return db[_0xa68a('0x41')][_0xa68a('0x64')]({'where':{'id':_0x300a20[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0xdd0dc0,null))[_0xa68a('0x20')](function(_0x5b3c12){if(_0x5b3c12){_0x50e706[_0xa68a('0x45')]=_[_0xa68a('0x47')](db[_0xa68a('0xa4')][_0xa68a('0x42')]);_0x50e706[_0xa68a('0x46')]=_[_0xa68a('0x47')](_0x300a20[_0xa68a('0x46')]);_0x50e706[_0xa68a('0x48')]=_[_0xa68a('0x49')](_0x50e706[_0xa68a('0x45')],_0x50e706[_0xa68a('0x46')]);_0x5c7fab[_0xa68a('0x4b')]=_['intersection'](_0x50e706[_0xa68a('0x45')],qs['fields'](_0x300a20[_0xa68a('0x46')][_0xa68a('0x4a')]));_0x5c7fab[_0xa68a('0x4b')]=_0x5c7fab[_0xa68a('0x4b')][_0xa68a('0x6c')]?_0x5c7fab[_0xa68a('0x4b')]:_0x50e706[_0xa68a('0x45')];if(!_0x300a20[_0xa68a('0x46')][_0xa68a('0x4c')](_0xa68a('0x65'))){_0x5c7fab['limit']=qs[_0xa68a('0x31')](_0x300a20['query'][_0xa68a('0x31')]);_0x5c7fab[_0xa68a('0x2e')]=qs['offset'](_0x300a20[_0xa68a('0x46')][_0xa68a('0x2e')]);}_0x5c7fab['order']=qs[_0xa68a('0x4e')](_0x300a20[_0xa68a('0x46')]['sort']);_0x5c7fab[_0xa68a('0x4f')]=qs['filters'](_[_0xa68a('0x66')](_0x300a20['query'],_0x50e706[_0xa68a('0x48')]));_0x5c7fab[_0xa68a('0x4f')][_0xa68a('0x69')]=_0x5b3c12['id'];if(_0x300a20[_0xa68a('0x46')]['filter']){_0x5c7fab[_0xa68a('0x4f')]=_['merge'](_0x5c7fab[_0xa68a('0x4f')],{'$or':_[_0xa68a('0x40')](_0x5c7fab[_0xa68a('0x4b')],function(_0x378478){var _0x413b1d={};_0x413b1d[_0x378478]={'$like':'%'+_0x300a20[_0xa68a('0x46')][_0xa68a('0x50')]+'%'};return _0x413b1d;})});}_0x5c7fab=_[_0xa68a('0x51')]({},_0x5c7fab,_0x300a20[_0xa68a('0x53')]);return db[_0xa68a('0xa4')][_0xa68a('0x30')]({'where':_0x5c7fab['where']})[_0xa68a('0x20')](function(_0x2582ba){_0x1234b9[_0xa68a('0x30')]=_0x2582ba;if(_0x300a20[_0xa68a('0x46')][_0xa68a('0x54')]){_0x5c7fab[_0xa68a('0x59')]=[{'model':db['CmContact'],'as':_0xa68a('0xc3'),'required':![]},{'model':db[_0xa68a('0xc4')],'as':_0xa68a('0xc5'),'attributes':[_0xa68a('0x3b'),_0xa68a('0xc6'),_0xa68a('0xc7')],'required':![]},{'model':db['Tag'],'as':_0xa68a('0xc8'),'attributes':['id',_0xa68a('0x3b'),'color'],'where':_0x300a20[_0xa68a('0x46')]['tag']?{'id':_0x300a20[_0xa68a('0x46')][_0xa68a('0xc9')]}:undefined,'required':_0x300a20[_0xa68a('0x46')][_0xa68a('0xc9')]?!![]:![]}];}return db[_0xa68a('0xa4')][_0xa68a('0x55')](_0x5c7fab);})[_0xa68a('0x20')](function(_0x595480){_0x1234b9[_0xa68a('0x56')]=_0x595480;return _0x1234b9;});}})['then'](respondWithFilteredResult(_0xdd0dc0,_0x5c7fab))[_0xa68a('0x2a')](handleError(_0xdd0dc0,null));};exports[_0xa68a('0x3c')]=function(_0x1de83c,_0x9abda1,_0x2be74e){var _0x150e83,_0x593884,_0x152c02;if(_['isNil'](_0x1de83c[_0xa68a('0x5c')][_0xa68a('0x5c')])||_0x1de83c[_0xa68a('0x5c')][_0xa68a('0x5c')]===''){throw new db[(_0xa68a('0x79'))]['ValidationError'](_0xa68a('0xca'));}if(_[_0xa68a('0x9a')](_0x1de83c['body']['to'])){throw new db[(_0xa68a('0x79'))]['ValidationError']('to\x20is\x20mandatory');}_0x150e83=_0x1de83c[_0xa68a('0x5c')]['to'];return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x1de83c[_0xa68a('0x58')]['id']},'include':[{'model':db[_0xa68a('0x9f')],'as':_0xa68a('0xcb'),'include':[{'model':db[_0xa68a('0x78')],'as':_0xa68a('0xa0'),'where':{'mobile':_0x150e83},'limit':0x1,'order':[[_0xa68a('0x7e'),'DESC']]}]}]})[_0xa68a('0x20')](handleEntityNotFound(_0x9abda1,null))[_0xa68a('0x20')](function(_0x4bbc70){if(_0x4bbc70&&_0x4bbc70[_0xa68a('0xcb')]){_0x593884=_0x4bbc70[_0xa68a('0x37')]({'plain':!![]});if(_0x593884[_0xa68a('0xcb')]&&_0x593884['List'][_0xa68a('0xa0')][_0xa68a('0x6c')]){return _0x593884['List'][_0xa68a('0xa0')][0x0];}return db['CmContact'][_0xa68a('0x5b')](_[_0xa68a('0xa3')](_0x1de83c[_0xa68a('0x5c')],{'firstName':_0x150e83,'mobile':_0x150e83,'phone':_0x150e83,'ListId':_0x593884[_0xa68a('0x7f')]}));}})['then'](handleEntityNotFound(_0x9abda1,null))[_0xa68a('0x20')](function(_0x431b06){if(_0x431b06){_0x152c02=_0x431b06;return db['SmsInteraction'][_0xa68a('0x5a')]({'where':{'ContactId':_0x152c02['id'],'closed':![],'SmsAccountId':_0x593884['id']}})[_0xa68a('0x20')](function(_0x1ea01a){if(_0x1ea01a){return[_0x1ea01a,![]];}return db[_0xa68a('0xa4')][_0xa68a('0x5b')]({'UserId':_0x1de83c['user']['id'],'ContactId':_0x152c02['id'],'SmsAccountId':_0x593884['id'],'phone':_0x150e83,'firstMsgDirection':'out','Messages':[_[_0xa68a('0x51')](_0x1de83c[_0xa68a('0x5c')],{'read':![],'body':_0x1de83c[_0xa68a('0x5c')][_0xa68a('0x5c')],'phone':_0x150e83,'SmsAccountId':_0x593884['id'],'UserId':_0x1de83c[_0xa68a('0x5d')]['id'],'ContactId':_0x152c02['id']})]},{'include':[{'model':db[_0xa68a('0xad')],'as':'Messages'}]})[_0xa68a('0x20')](function(_0x2ca1d8){return[_0x2ca1d8,!![]];});});}})[_0xa68a('0xa5')](function(_0x48daf7,_0x153551){if(_0x153551){return _0x48daf7;}return db[_0xa68a('0xad')][_0xa68a('0x5b')](_['merge'](_0x1de83c[_0xa68a('0x5c')],{'read':![],'body':_0x1de83c[_0xa68a('0x5c')][_0xa68a('0x5c')],'phone':_0x150e83,'SmsAccountId':_0x593884['id'],'SmsInteractionId':_0x48daf7['id'],'UserId':_0x1de83c[_0xa68a('0x5d')]['id'],'ContactId':_0x152c02['id']}))[_0xa68a('0x20')](function(_0x1032a7){_0x48daf7[_0xa68a('0xcc')][_0xa68a('0xcd')]=[];_0x48daf7['dataValues'][_0xa68a('0xcd')][_0xa68a('0xa9')](_0x1032a7[_0xa68a('0xcc')]);return _0x48daf7;});})[_0xa68a('0x20')](respondWithResult(_0x9abda1,null))[_0xa68a('0x2a')](handleError(_0x9abda1,null));};exports[_0xa68a('0x2c')]=function(_0x66cedc,_0x25aa7d,_0x384154){if(_0x66cedc[_0xa68a('0x5c')]['id']){delete _0x66cedc[_0xa68a('0x5c')]['id'];}var _0x500dc5,_0x234eac,_0x467645;return db[_0xa68a('0x41')]['find']({'where':{'id':_0x66cedc[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x25aa7d,null))[_0xa68a('0x20')](function(_0x29127d){if(_0x29127d){_0x467645=_0x29127d;logger[_0xa68a('0x24')](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0xce'),_0x29127d[_0xa68a('0x81')],util['inspect'](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));switch(_0x29127d['type']){case _0xa68a('0x88'):if(_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xcf')]&&_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x2c')]){_0x234eac=_0x66cedc['body'][_0xa68a('0x2c')];return db[_0xa68a('0xad')][_0xa68a('0x5a')]({'where':{'messageId':_0x66cedc['body'][_0xa68a('0xcf')]}});}break;case _0xa68a('0x8b'):if(_0x66cedc['body'][_0xa68a('0xd0')]&&_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xd1')]){_0x234eac=_0x66cedc['body']['statusInt'];return db[_0xa68a('0xad')][_0xa68a('0x5a')]({'where':{'messageId':_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xd0')]}});}break;case _0xa68a('0x8c'):if(_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x8d')]&&_0x66cedc['body'][_0xa68a('0xd2')]){_0x234eac=_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xd2')];return db['SmsMessage'][_0xa68a('0x5a')]({'where':{'messageId':_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x8d')]}});}break;case'infobip':var _0x5a2cc2=_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x92')][0x0];if(_0x5a2cc2[_0xa68a('0x86')]&&_0x5a2cc2[_0xa68a('0x2c')][_0xa68a('0xd3')]===_0xa68a('0xd4')){_0x234eac=_0x5a2cc2[_0xa68a('0x2c')][_0xa68a('0xd3')];return db['SmsMessage'][_0xa68a('0x5a')]({'where':{'messageId':_0x5a2cc2[_0xa68a('0x86')]}});}break;case _0xa68a('0x96'):if(_0x66cedc[_0xa68a('0x5c')]['messageId']&&_0x66cedc['body'][_0xa68a('0x2c')]){_0x234eac=_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x2c')];return db[_0xa68a('0xad')]['find']({'where':{'messageId':_0x66cedc[_0xa68a('0x5c')]['messageId']}});}break;case _0xa68a('0x98'):if(_0x66cedc[_0xa68a('0x5c')][0x0]['message']['id']){_0x234eac=_0x66cedc[_0xa68a('0x5c')][0x0]['type'];return db[_0xa68a('0xad')][_0xa68a('0x5a')]({'where':{'messageId':_0x66cedc[_0xa68a('0x5c')][0x0][_0xa68a('0x29')]['id']}});}break;case'intelepeer':if(_0x66cedc[_0xa68a('0x5c')]['redif']&&_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x2c')]){_0x234eac=_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x2c')];return db['SmsMessage'][_0xa68a('0x5a')]({'where':{'messageId':_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xd5')]}});}break;}}})[_0xa68a('0x20')](handleEntityNotFound(_0x25aa7d,null))['then'](function(_0x449a7b){if(_0x449a7b){_0x500dc5=_0x449a7b;switch(_0x467645['type']){case _0xa68a('0x88'):if(_0x234eac===_0xa68a('0xd4')){return _0x500dc5['update']({'read':!![]});}else{logger[_0xa68a('0x28')](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0x88'),util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa68a('0x8b'):if(_0x234eac==='1'){return _0x500dc5[_0xa68a('0x35')]({'read':!![]});}else{logger['error'](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0x88'),util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa68a('0x8c'):if(!_0x66cedc[_0xa68a('0x5c')][_0xa68a('0xd7')]&&_0x234eac>=0xc8&&_0x234eac<=0xce){return _0x500dc5['update']({'read':!![]});}else{logger[_0xa68a('0x28')](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0x8c'),util['inspect'](_0x66cedc['body'],{'showHidden':![],'depth':null}));}break;case _0xa68a('0x91'):var _0x4bee24=_0x66cedc[_0xa68a('0x5c')][_0xa68a('0x92')][0x0];if(_0x4bee24['status'][_0xa68a('0xd3')]===_0xa68a('0xd4')){return _0x500dc5[_0xa68a('0x35')]({'read':!![]});}else{logger[_0xa68a('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa68a('0x2c'),'infobip',util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa68a('0x96'):if(_0x234eac==_0xa68a('0xd8')||_0x234eac==_0xa68a('0xd9')){return _0x500dc5[_0xa68a('0x35')]({'read':!![]});}else{logger['error'](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0x96'),util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x234eac==_0xa68a('0xda')){return _0x500dc5[_0xa68a('0x35')]({'read':!![]});}else{logger[_0xa68a('0x28')](_0xa68a('0x25'),_0xa68a('0x2c'),'bandwidth',util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa68a('0x99'):if(_0x234eac===_0xa68a('0xdb')||_0x234eac==='ACCEPTD'){return _0x500dc5['update']({'read':!![]});}else{logger[_0xa68a('0x28')](_0xa68a('0x25'),_0xa68a('0x2c'),'intelepeer',util[_0xa68a('0xd6')](_0x66cedc[_0xa68a('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x500dc5;}})['then'](respondWithResult(_0x25aa7d,null))[_0xa68a('0x2a')](handleError(_0x25aa7d,null));};exports['statusGet']=function(_0x43c3c0,_0x5e3a29,_0x22eb8e){var _0x1d4616,_0x4e090a,_0x4aa140;return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x43c3c0[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x5e3a29,null))[_0xa68a('0x20')](function(_0x1bd4f3){if(_0x1bd4f3){_0x4aa140=_0x1bd4f3;logger['debug'](_0xa68a('0x25'),_0xa68a('0x2c'),'received\x20delivery\x20report\x20from',_0x1bd4f3[_0xa68a('0x81')],util['inspect'](_0x43c3c0[_0xa68a('0x46')],{'showHidden':![],'depth':null}));switch(_0x1bd4f3[_0xa68a('0x81')]){case _0xa68a('0x93'):if(_0x43c3c0[_0xa68a('0x46')][_0xa68a('0xdc')]&&_0x43c3c0[_0xa68a('0x46')][_0xa68a('0xdd')]){_0x4e090a=_0x43c3c0[_0xa68a('0x46')][_0xa68a('0xdd')];return db[_0xa68a('0xad')][_0xa68a('0x5a')]({'where':{'messageId':_0x43c3c0[_0xa68a('0x46')][_0xa68a('0xdc')]}});}break;}}})[_0xa68a('0x20')](handleEntityNotFound(_0x5e3a29,null))[_0xa68a('0x20')](function(_0x3b600e){if(_0x3b600e){_0x1d4616=_0x3b600e;switch(_0x4aa140[_0xa68a('0x81')]){case'csc':if(_0x4e090a==='2'||_0x4e090a==='6'){return _0x1d4616[_0xa68a('0x35')]({'read':!![]});}else{logger[_0xa68a('0x28')](_0xa68a('0x25'),_0xa68a('0x2c'),_0xa68a('0x93'),util['inspect'](_0x43c3c0[_0xa68a('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x1d4616;}})['then'](respondWithResult(_0x5e3a29,null))[_0xa68a('0x2a')](handleError(_0x5e3a29,null));};exports['addAgents']=function(_0x1b0f77,_0x5b2913,_0x5ce138){return db[_0xa68a('0x41')][_0xa68a('0x5a')]({'where':{'id':_0x1b0f77[_0xa68a('0x58')]['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x5b2913,null))[_0xa68a('0x20')](function(_0x2bd324){if(_0x2bd324){return _0x2bd324['addAgents'](_0x1b0f77[_0xa68a('0x5c')][_0xa68a('0x6e')],_[_0xa68a('0xa2')](_0x1b0f77['body'],['ids','id'])||{})[_0xa68a('0xa5')](function(_0x487a98){for(var _0xa254a8=0x0;_0xa254a8<_0x1b0f77[_0xa68a('0x5c')]['ids']['length'];_0xa254a8+=0x1){socket[_0xa68a('0xde')](_0xa68a('0xdf'),{'UserId':Number(_0x1b0f77[_0xa68a('0x5c')][_0xa68a('0x6e')][_0xa254a8]),'SmsAccountId':Number(_0x1b0f77[_0xa68a('0x58')]['id'])});}return _0x487a98;});}})['then'](respondWithResult(_0x5b2913,null))[_0xa68a('0x2a')](handleError(_0x5b2913,null));};exports['removeAgents']=function(_0x27cfea,_0x21002f,_0x28f25b){return db['SmsAccount'][_0xa68a('0x5a')]({'where':{'id':_0x27cfea['params']['id']}})[_0xa68a('0x20')](handleEntityNotFound(_0x21002f,null))['then'](function(_0x39c8f7){if(_0x39c8f7){return _0x39c8f7[_0xa68a('0xe0')](_0x27cfea[_0xa68a('0x46')]['ids'])[_0xa68a('0x20')](function(){if(_[_0xa68a('0xe1')](_0x27cfea[_0xa68a('0x46')][_0xa68a('0x6e')])){for(var _0x155631=0x0;_0x155631<_0x27cfea[_0xa68a('0x46')][_0xa68a('0x6e')][_0xa68a('0x6c')];_0x155631+=0x1){socket[_0xa68a('0xde')]('userSmsAccount:remove',{'UserId':Number(_0x27cfea['query'][_0xa68a('0x6e')][_0x155631]),'SmsAccountId':Number(_0x27cfea[_0xa68a('0x58')]['id'])});}}else{socket[_0xa68a('0xde')]('userSmsAccount:remove',{'UserId':Number(_0x27cfea[_0xa68a('0x46')][_0xa68a('0x6e')]),'SmsAccountId':Number(_0x27cfea[_0xa68a('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x21002f,null))[_0xa68a('0x2a')](handleError(_0x21002f,null));};exports[_0xa68a('0xe2')]=function(_0x59a72c,_0x2e3262,_0x48c03a){var _0x3194e={};var _0x9574a5={};var _0x4efed6;var _0x1fbf25;return db['SmsAccount'][_0xa68a('0x64')]({'where':{'id':_0x59a72c[_0xa68a('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e3262,null))[_0xa68a('0x20')](function(_0xe8a9a9){if(_0xe8a9a9){_0x4efed6=_0xe8a9a9;_0x9574a5[_0xa68a('0x45')]=_[_0xa68a('0x47')](db['User'][_0xa68a('0x42')]);_0x9574a5['query']=_['keys'](_0x59a72c['query']);_0x9574a5['filters']=_[_0xa68a('0x49')](_0x9574a5[_0xa68a('0x45')],_0x9574a5['query']);_0x3194e[_0xa68a('0x4b')]=_[_0xa68a('0x49')](_0x9574a5[_0xa68a('0x45')],qs[_0xa68a('0x4a')](_0x59a72c['query'][_0xa68a('0x4a')]));_0x3194e[_0xa68a('0x4b')]=_0x3194e['attributes'][_0xa68a('0x6c')]?_0x3194e[_0xa68a('0x4b')]:_0x9574a5[_0xa68a('0x45')];_0x3194e['order']=qs[_0xa68a('0x4e')](_0x59a72c[_0xa68a('0x46')][_0xa68a('0x4e')]);_0x3194e[_0xa68a('0x4f')]=qs[_0xa68a('0x48')](_[_0xa68a('0x66')](_0x59a72c[_0xa68a('0x46')],_0x9574a5['filters']));if(_0x59a72c[_0xa68a('0x46')][_0xa68a('0x50')]){_0x3194e[_0xa68a('0x4f')]=_[_0xa68a('0x51')](_0x3194e[_0xa68a('0x4f')],{'$or':_['map'](_0x3194e[_0xa68a('0x4b')],function(_0x45411c){var _0x5f22a5={};_0x5f22a5[_0x45411c]={'$like':'%'+_0x59a72c[_0xa68a('0x46')][_0xa68a('0x50')]+'%'};return _0x5f22a5;})});}_0x3194e=_[_0xa68a('0x51')]({},_0x3194e,_0x59a72c[_0xa68a('0x53')]);return _0x4efed6['getAgents'](_0x3194e);}})[_0xa68a('0x20')](function(_0x269c5d){if(_0x269c5d){_0x1fbf25=_0x269c5d['length'];if(!_0x59a72c[_0xa68a('0x46')][_0xa68a('0x4c')]('nolimit')){_0x3194e[_0xa68a('0x31')]=qs[_0xa68a('0x31')](_0x59a72c[_0xa68a('0x46')]['limit']);_0x3194e[_0xa68a('0x2e')]=qs[_0xa68a('0x2e')](_0x59a72c[_0xa68a('0x46')][_0xa68a('0x2e')]);}return _0x4efed6['getAgents'](_0x3194e);}})['then'](function(_0x4c4c1a){if(_0x4c4c1a){return _0x4c4c1a?{'count':_0x1fbf25,'rows':_0x4c4c1a}:null;}})[_0xa68a('0x20')](respondWithResult(_0x2e3262,null))[_0xa68a('0x2a')](handleError(_0x2e3262,null));}; \ No newline at end of file +var _0xa77c=['orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','type','twilio','from','From','MessageSid','text','connectel','messageId','plivo','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','omit','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','UserId','unshift','waitForTheAssignedAgent','startRouting','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','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','Owner','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','spread','dataValues','inspect','skebby','skebby_dispatch_id','requestid','statusInt','message_id','status_code','DELIVERED','groupName','redif','clicksend','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','statusGet','received\x20delivery\x20report\x20from','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','show','params','rawAttributes','options','find','create','body','user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','notify','sms','SmsApplication','Applications','account'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa77c,0x147));var _0xca77=function(_0x5d9b73,_0x505f3c){_0x5d9b73=_0x5d9b73-0x0;var _0x4cf846=_0xa77c[_0x5d9b73];return _0x4cf846;};'use strict';var emlformat=require(_0xca77('0x0'));var rimraf=require(_0xca77('0x1'));var zipdir=require(_0xca77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca77('0x3'));var moment=require(_0xca77('0x4'));var BPromise=require(_0xca77('0x5'));var Mustache=require(_0xca77('0x6'));var util=require(_0xca77('0x7'));var path=require('path');var sox=require(_0xca77('0x8'));var csv=require('to-csv');var ejs=require(_0xca77('0x9'));var fs=require('fs');var fs_extra=require(_0xca77('0xa'));var _=require(_0xca77('0xb'));var squel=require(_0xca77('0xc'));var crypto=require(_0xca77('0xd'));var jsforce=require(_0xca77('0xe'));var deskjs=require(_0xca77('0xf'));var toCsv=require(_0xca77('0x10'));var querystring=require(_0xca77('0x11'));var Papa=require(_0xca77('0x12'));var Redis=require(_0xca77('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xca77('0x14'));var hardwareService=require(_0xca77('0x15'));var logger=require(_0xca77('0x16'))('api');var utils=require(_0xca77('0x17'));var config=require(_0xca77('0x18'));var licenseUtil=require(_0xca77('0x19'));var db=require(_0xca77('0x1a'))['db'];config[_0xca77('0x1b')]=_[_0xca77('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xca77('0x1d'))(new Redis(config[_0xca77('0x1b')]));require(_0xca77('0x1e'))[_0xca77('0x1f')](socket);var jayson=require(_0xca77('0x20'));var client=jayson['client'][_0xca77('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x437e9f,_0x45ed72,_0x1d11b7,_0x260d0f){return new BPromise(function(_0x3d6acb,_0x2b2d01){var _0x150742=_0x260d0f||client;return _0x150742[_0xca77('0x22')](_0x437e9f,_0x1d11b7)[_0xca77('0x23')](function(_0x3520df){logger[_0xca77('0x24')](_0xca77('0x25'),_0x45ed72,'request\x20sent');logger[_0xca77('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x45ed72,_0xca77('0x27'),JSON[_0xca77('0x28')](_0x3520df));if(_0x3520df['error']){if(_0x3520df[_0xca77('0x29')][_0xca77('0x2a')]===0x1f4){logger['error'](_0xca77('0x25'),_0x45ed72,_0x3520df[_0xca77('0x29')][_0xca77('0x2b')]);return _0x2b2d01(_0x3520df[_0xca77('0x29')][_0xca77('0x2b')]);}logger['error'](_0xca77('0x25'),_0x45ed72,_0x3520df[_0xca77('0x29')]['message']);return _0x3d6acb(_0x3520df['error']['message']);}else{logger['info'](_0xca77('0x25'),_0x45ed72,'request\x20sent');_0x3d6acb(_0x3520df[_0xca77('0x2c')][_0xca77('0x2b')]);}})[_0xca77('0x2d')](function(_0x1cd2c6){logger['error'](_0xca77('0x25'),_0x45ed72,_0x1cd2c6);_0x2b2d01(_0x1cd2c6);});});}function respondWithStatusCode(_0xe0369f,_0x52a42f){_0x52a42f=_0x52a42f||0xcc;return function(_0x1d0abf){if(_0x1d0abf){return _0xe0369f[_0xca77('0x2e')](_0x52a42f);}return _0xe0369f[_0xca77('0x2f')](_0x52a42f)[_0xca77('0x30')]();};}function respondWithResult(_0x8c951e,_0x442045){_0x442045=_0x442045||0xc8;return function(_0x4a1235){if(_0x4a1235){return _0x8c951e['status'](_0x442045)[_0xca77('0x31')](_0x4a1235);}};}function respondWithFilteredResult(_0x22fd05,_0x1f466b){return function(_0x564308){if(_0x564308){var _0x3b5aa2=typeof _0x1f466b[_0xca77('0x32')]===_0xca77('0x33')&&typeof _0x1f466b[_0xca77('0x34')]===_0xca77('0x33');var _0x945a71=_0x564308[_0xca77('0x35')];var _0x5981fa=_0x3b5aa2?0x0:_0x1f466b[_0xca77('0x32')];var _0x233a94=_0x3b5aa2?_0x564308[_0xca77('0x35')]:_0x1f466b[_0xca77('0x32')]+_0x1f466b[_0xca77('0x34')];var _0x57973d;if(_0x233a94>=_0x945a71){_0x233a94=_0x945a71;_0x57973d=0xc8;}else{_0x57973d=0xce;}_0x22fd05[_0xca77('0x2f')](_0x57973d);return _0x22fd05[_0xca77('0x36')](_0xca77('0x37'),_0x5981fa+'-'+_0x233a94+'/'+_0x945a71)[_0xca77('0x31')](_0x564308);}return null;};}function patchUpdates(_0x27ec6e){return function(_0x47491a){try{jsonpatch[_0xca77('0x38')](_0x47491a,_0x27ec6e,!![]);}catch(_0x25649f){return BPromise[_0xca77('0x39')](_0x25649f);}return _0x47491a[_0xca77('0x3a')]();};}function saveUpdates(_0xdc38c0,_0x3dffd7){return function(_0x525736){if(_0x525736){return _0x525736[_0xca77('0x3b')](_0xdc38c0)['then'](function(_0x42456f){return _0x42456f;});}return null;};}function removeEntity(_0xb2fe2a,_0x3dcd27){return function(_0xdc1c7b){if(_0xdc1c7b){return _0xdc1c7b[_0xca77('0x3c')]()['then'](function(){var _0x4ab71d=_0xdc1c7b['get']({'plain':!![]});var _0x1584e6=_0xca77('0x3d');return db[_0xca77('0x3e')]['destroy']({'where':{'type':_0x1584e6,'resourceId':_0x4ab71d['id']}})['then'](function(){return _0xdc1c7b;});})['then'](function(){_0xb2fe2a[_0xca77('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xde513e,_0x59f487){return function(_0x4deea0){if(!_0x4deea0){_0xde513e[_0xca77('0x2e')](0x194);}return _0x4deea0;};}function handleError(_0x4e6e53,_0x2b6acd){_0x2b6acd=_0x2b6acd||0x1f4;return function(_0x4e5330){logger['error'](_0x4e5330[_0xca77('0x3f')]);if(_0x4e5330['name']){delete _0x4e5330[_0xca77('0x40')];}_0x4e6e53[_0xca77('0x2f')](_0x2b6acd)[_0xca77('0x41')](_0x4e5330);};}exports[_0xca77('0x42')]=function(_0x42620d,_0x42f836){var _0x31d0a0={'include':[{'model':db[_0xca77('0x43')],'as':_0xca77('0x44')}]},_0x2c9a7d={},_0x4c995a={'count':0x0,'rows':[]};var _0x949b0=_[_0xca77('0x45')](db[_0xca77('0x46')]['rawAttributes'],function(_0x1283a0){return{'name':_0x1283a0['fieldName'],'type':_0x1283a0['type'][_0xca77('0x47')]};});_0x2c9a7d['model']=_[_0xca77('0x45')](_0x949b0,_0xca77('0x40'));_0x2c9a7d[_0xca77('0x48')]=_[_0xca77('0x49')](_0x42620d[_0xca77('0x48')]);_0x2c9a7d['filters']=_['intersection'](_0x2c9a7d[_0xca77('0x4a')],_0x2c9a7d[_0xca77('0x48')]);_0x31d0a0[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x2c9a7d['model'],qs[_0xca77('0x4d')](_0x42620d[_0xca77('0x48')]['fields']));_0x31d0a0[_0xca77('0x4b')]=_0x31d0a0[_0xca77('0x4b')][_0xca77('0x4e')]?_0x31d0a0['attributes']:_0x2c9a7d[_0xca77('0x4a')];if(!_0x42620d[_0xca77('0x48')][_0xca77('0x4f')](_0xca77('0x50'))){_0x31d0a0[_0xca77('0x34')]=qs[_0xca77('0x34')](_0x42620d[_0xca77('0x48')][_0xca77('0x34')]);_0x31d0a0[_0xca77('0x32')]=qs[_0xca77('0x32')](_0x42620d['query']['offset']);}_0x31d0a0[_0xca77('0x51')]=qs[_0xca77('0x52')](_0x42620d['query'][_0xca77('0x52')]);_0x31d0a0[_0xca77('0x53')]=qs['filters'](_[_0xca77('0x54')](_0x42620d[_0xca77('0x48')],_0x2c9a7d[_0xca77('0x55')]),_0x949b0);if(_0x42620d['query'][_0xca77('0x56')]){_0x31d0a0[_0xca77('0x53')]=_['merge'](_0x31d0a0['where'],{'$or':_[_0xca77('0x45')](_0x949b0,function(_0x514e47){if(_0x514e47['type']!=='VIRTUAL'){var _0x3b4d54={};_0x3b4d54[_0x514e47[_0xca77('0x40')]]={'$like':'%'+_0x42620d[_0xca77('0x48')][_0xca77('0x56')]+'%'};return _0x3b4d54;}})});}_0x31d0a0=_[_0xca77('0x57')]({},_0x31d0a0,_0x42620d['options']);var _0x3af3aa={'where':_0x31d0a0['where']};return db[_0xca77('0x46')][_0xca77('0x35')](_0x3af3aa)[_0xca77('0x23')](function(_0x3e08b0){_0x4c995a['count']=_0x3e08b0;if(_0x42620d[_0xca77('0x48')][_0xca77('0x58')]){_0x31d0a0[_0xca77('0x59')]=[{'all':!![]}];}return db[_0xca77('0x46')][_0xca77('0x5a')](_0x31d0a0);})[_0xca77('0x23')](function(_0x49a943){_0x4c995a['rows']=_0x49a943;return _0x4c995a;})[_0xca77('0x23')](respondWithFilteredResult(_0x42f836,_0x31d0a0))[_0xca77('0x2d')](handleError(_0x42f836,null));};exports[_0xca77('0x5b')]=function(_0x40f22b,_0x275e2b){var _0x548953={'raw':![],'where':{'id':_0x40f22b[_0xca77('0x5c')]['id']},'include':[{'model':db[_0xca77('0x43')],'as':_0xca77('0x44')}]},_0x386f9a={};_0x386f9a[_0xca77('0x4a')]=_[_0xca77('0x49')](db[_0xca77('0x46')][_0xca77('0x5d')]);_0x386f9a['query']=_[_0xca77('0x49')](_0x40f22b['query']);_0x386f9a[_0xca77('0x55')]=_[_0xca77('0x4c')](_0x386f9a[_0xca77('0x4a')],_0x386f9a[_0xca77('0x48')]);_0x548953[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x386f9a[_0xca77('0x4a')],qs['fields'](_0x40f22b['query']['fields']));_0x548953[_0xca77('0x4b')]=_0x548953[_0xca77('0x4b')][_0xca77('0x4e')]?_0x548953['attributes']:_0x386f9a[_0xca77('0x4a')];if(_0x40f22b['query'][_0xca77('0x58')]){_0x548953[_0xca77('0x59')]=[{'all':!![]}];}_0x548953=_[_0xca77('0x57')]({},_0x548953,_0x40f22b[_0xca77('0x5e')]);return db['SmsAccount'][_0xca77('0x5f')](_0x548953)[_0xca77('0x23')](handleEntityNotFound(_0x275e2b,null))[_0xca77('0x23')](respondWithResult(_0x275e2b,null))[_0xca77('0x2d')](handleError(_0x275e2b,null));};exports['create']=function(_0x4591cc,_0x1208f8){return db[_0xca77('0x46')][_0xca77('0x60')](_0x4591cc[_0xca77('0x61')],{})[_0xca77('0x23')](function(_0x6e1b02){var _0x3630d3=_0x4591cc[_0xca77('0x62')]['get']({'plain':!![]});if(!_0x3630d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3630d3[_0xca77('0x63')]===_0xca77('0x62')){var _0x4994b4=_0x6e1b02[_0xca77('0x64')]({'plain':!![]});var _0x293988='SmsAccounts';return db[_0xca77('0x65')][_0xca77('0x5f')]({'where':{'name':_0x293988,'userProfileId':_0x3630d3['userProfileId']},'raw':!![]})[_0xca77('0x23')](function(_0x213447){if(_0x213447&&_0x213447['autoAssociation']===0x0){return db[_0xca77('0x3e')]['create']({'name':_0x4994b4[_0xca77('0x40')],'resourceId':_0x4994b4['id'],'type':_0x213447[_0xca77('0x40')],'sectionId':_0x213447['id']},{})[_0xca77('0x23')](function(){return _0x6e1b02;});}else{return _0x6e1b02;}})[_0xca77('0x2d')](function(_0xfa4092){logger[_0xca77('0x29')](_0xca77('0x66'),_0xfa4092);throw _0xfa4092;});}return _0x6e1b02;})[_0xca77('0x23')](respondWithResult(_0x1208f8,0xc9))[_0xca77('0x2d')](handleError(_0x1208f8,null));};exports[_0xca77('0x3b')]=function(_0x2a1dde,_0xc6f2a9){if(_0x2a1dde[_0xca77('0x61')]['id']){delete _0x2a1dde[_0xca77('0x61')]['id'];}return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x2a1dde[_0xca77('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xca77('0x44')}]})['then'](handleEntityNotFound(_0xc6f2a9,null))[_0xca77('0x23')](saveUpdates(_0x2a1dde[_0xca77('0x61')],null))[_0xca77('0x23')](respondWithResult(_0xc6f2a9,null))[_0xca77('0x2d')](handleError(_0xc6f2a9,null));};exports[_0xca77('0x3c')]=function(_0x385c37,_0x38a086){return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x385c37['params']['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x38a086,null))[_0xca77('0x23')](removeEntity(_0x38a086,null))['catch'](handleError(_0x38a086,null));};exports[_0xca77('0x67')]=function(_0x5c9ec2,_0x13ed66){return db[_0xca77('0x46')][_0xca77('0x67')]()[_0xca77('0x23')](respondWithResult(_0x13ed66,null))[_0xca77('0x2d')](handleError(_0x13ed66,null));};exports[_0xca77('0x68')]=function(_0x502923,_0x53c490,_0x395805){if(_0x502923[_0xca77('0x61')]['id']){delete _0x502923['body']['id'];}return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x502923[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x53c490,null))['then'](function(_0x254a05){if(_0x254a05){_0x502923[_0xca77('0x61')][_0xca77('0x69')]=_0x254a05['id'];return db['Disposition'][_0xca77('0x60')](_0x502923['body']);}})[_0xca77('0x23')](respondWithResult(_0x53c490,null))[_0xca77('0x2d')](handleError(_0x53c490,null));};exports[_0xca77('0x6a')]=function(_0x275717,_0x52fabb,_0x57018e){var _0x203de3={'raw':![],'where':{}};var _0x262a9f={};var _0x14af61={'count':0x0,'rows':[]};return db[_0xca77('0x46')]['findOne']({'where':{'id':_0x275717[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x52fabb,null))[_0xca77('0x23')](function(_0x597316){if(_0x597316){_0x262a9f[_0xca77('0x4a')]=_[_0xca77('0x49')](db['Disposition'][_0xca77('0x5d')]);_0x262a9f[_0xca77('0x48')]=_[_0xca77('0x49')](_0x275717[_0xca77('0x48')]);_0x262a9f['filters']=_[_0xca77('0x4c')](_0x262a9f[_0xca77('0x4a')],_0x262a9f[_0xca77('0x48')]);_0x203de3[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x262a9f[_0xca77('0x4a')],qs[_0xca77('0x4d')](_0x275717[_0xca77('0x48')][_0xca77('0x4d')]));_0x203de3[_0xca77('0x4b')]=_0x203de3['attributes']['length']?_0x203de3['attributes']:_0x262a9f[_0xca77('0x4a')];if(!_0x275717[_0xca77('0x48')][_0xca77('0x4f')]('nolimit')){_0x203de3[_0xca77('0x34')]=qs[_0xca77('0x34')](_0x275717['query'][_0xca77('0x34')]);_0x203de3[_0xca77('0x32')]=qs[_0xca77('0x32')](_0x275717[_0xca77('0x48')]['offset']);}_0x203de3[_0xca77('0x51')]=qs[_0xca77('0x52')](_0x275717[_0xca77('0x48')][_0xca77('0x52')]);_0x203de3['where']=qs[_0xca77('0x55')](_[_0xca77('0x54')](_0x275717[_0xca77('0x48')],_0x262a9f['filters']));_0x203de3[_0xca77('0x53')][_0xca77('0x69')]=_0x597316['id'];if(_0x275717[_0xca77('0x48')]['filter']){_0x203de3[_0xca77('0x53')]=_[_0xca77('0x57')](_0x203de3[_0xca77('0x53')],{'$or':_[_0xca77('0x45')](_0x203de3[_0xca77('0x4b')],function(_0x53cc94){var _0x510ee5={};_0x510ee5[_0x53cc94]={'$like':'%'+_0x275717[_0xca77('0x48')][_0xca77('0x56')]+'%'};return _0x510ee5;})});}_0x203de3=_['merge']({},_0x203de3,_0x275717[_0xca77('0x5e')]);return db[_0xca77('0x6b')][_0xca77('0x35')]({'where':_0x203de3[_0xca77('0x53')]})[_0xca77('0x23')](function(_0x2799d6){_0x14af61['count']=_0x2799d6;if(_0x275717['query']['includeAll']){_0x203de3[_0xca77('0x59')]=[{'all':!![]}];}return db[_0xca77('0x6b')]['findAll'](_0x203de3);})['then'](function(_0x1b7aef){_0x14af61['rows']=_0x1b7aef;return _0x14af61;});}})[_0xca77('0x23')](respondWithFilteredResult(_0x52fabb,_0x203de3))[_0xca77('0x2d')](handleError(_0x52fabb,null));};exports[_0xca77('0x6c')]=function(_0x483d14,_0x11e2ab,_0xbbe14a){return db['SmsAccount'][_0xca77('0x5f')]({'where':{'id':_0x483d14[_0xca77('0x5c')]['id']}})['then'](handleEntityNotFound(_0x11e2ab,null))[_0xca77('0x23')](function(_0x40fc2d){if(_0x40fc2d){return _0x40fc2d[_0xca77('0x6c')](_0x483d14['query'][_0xca77('0x6d')]);}})['then'](respondWithStatusCode(_0x11e2ab,null))[_0xca77('0x2d')](handleError(_0x11e2ab,null));};exports[_0xca77('0x6e')]=function(_0x5f0689,_0x3e5100,_0x3e7c7e){if(_0x5f0689['body']['id']){delete _0x5f0689[_0xca77('0x61')]['id'];}return db['SmsAccount'][_0xca77('0x5f')]({'where':{'id':_0x5f0689[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x3e5100,null))[_0xca77('0x23')](function(_0x374d49){if(_0x374d49){_0x5f0689[_0xca77('0x61')][_0xca77('0x69')]=_0x374d49['id'];return db[_0xca77('0x6f')]['create'](_0x5f0689[_0xca77('0x61')]);}})['then'](respondWithResult(_0x3e5100,null))[_0xca77('0x2d')](handleError(_0x3e5100,null));};exports[_0xca77('0x70')]=function(_0x4148cc,_0x5317c8,_0x5c08e0){var _0x34bc22={'raw':![],'where':{}};var _0x3355f4={};var _0x51364c={'count':0x0,'rows':[]};return db['SmsAccount'][_0xca77('0x71')]({'where':{'id':_0x4148cc[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x5317c8,null))[_0xca77('0x23')](function(_0x36d8cb){if(_0x36d8cb){_0x3355f4[_0xca77('0x4a')]=_['keys'](db[_0xca77('0x6f')][_0xca77('0x5d')]);_0x3355f4['query']=_[_0xca77('0x49')](_0x4148cc[_0xca77('0x48')]);_0x3355f4[_0xca77('0x55')]=_[_0xca77('0x4c')](_0x3355f4[_0xca77('0x4a')],_0x3355f4[_0xca77('0x48')]);_0x34bc22[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x3355f4[_0xca77('0x4a')],qs[_0xca77('0x4d')](_0x4148cc[_0xca77('0x48')]['fields']));_0x34bc22['attributes']=_0x34bc22[_0xca77('0x4b')][_0xca77('0x4e')]?_0x34bc22[_0xca77('0x4b')]:_0x3355f4[_0xca77('0x4a')];if(!_0x4148cc[_0xca77('0x48')][_0xca77('0x4f')](_0xca77('0x50'))){_0x34bc22[_0xca77('0x34')]=qs['limit'](_0x4148cc['query']['limit']);_0x34bc22[_0xca77('0x32')]=qs['offset'](_0x4148cc[_0xca77('0x48')][_0xca77('0x32')]);}_0x34bc22[_0xca77('0x51')]=qs[_0xca77('0x52')](_0x4148cc[_0xca77('0x48')][_0xca77('0x52')]);_0x34bc22[_0xca77('0x53')]=qs[_0xca77('0x55')](_[_0xca77('0x54')](_0x4148cc[_0xca77('0x48')],_0x3355f4[_0xca77('0x55')]));_0x34bc22['where'][_0xca77('0x69')]=_0x36d8cb['id'];if(_0x4148cc['query']['filter']){_0x34bc22[_0xca77('0x53')]=_[_0xca77('0x57')](_0x34bc22['where'],{'$or':_[_0xca77('0x45')](_0x34bc22[_0xca77('0x4b')],function(_0x54e235){var _0x49dae3={};_0x49dae3[_0x54e235]={'$like':'%'+_0x4148cc[_0xca77('0x48')][_0xca77('0x56')]+'%'};return _0x49dae3;})});}_0x34bc22=_[_0xca77('0x57')]({},_0x34bc22,_0x4148cc[_0xca77('0x5e')]);return db['CannedAnswer'][_0xca77('0x35')]({'where':_0x34bc22[_0xca77('0x53')]})[_0xca77('0x23')](function(_0x55c9e2){_0x51364c[_0xca77('0x35')]=_0x55c9e2;if(_0x4148cc[_0xca77('0x48')][_0xca77('0x58')]){_0x34bc22[_0xca77('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0xca77('0x5a')](_0x34bc22);})[_0xca77('0x23')](function(_0x2b46c6){_0x51364c[_0xca77('0x72')]=_0x2b46c6;return _0x51364c;});}})[_0xca77('0x23')](respondWithFilteredResult(_0x5317c8,_0x34bc22))[_0xca77('0x2d')](handleError(_0x5317c8,null));};exports['removeAnswers']=function(_0x3b3f02,_0x4004da,_0x3457ad){return db['SmsAccount'][_0xca77('0x5f')]({'where':{'id':_0x3b3f02[_0xca77('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4004da,null))[_0xca77('0x23')](function(_0x133180){if(_0x133180){return _0x133180[_0xca77('0x73')](_0x3b3f02[_0xca77('0x48')][_0xca77('0x6d')]);}})[_0xca77('0x23')](respondWithStatusCode(_0x4004da,null))[_0xca77('0x2d')](handleError(_0x4004da,null));};exports[_0xca77('0x74')]=function(_0x33067b,_0x2956b2,_0x457ac3){var _0x5372f1={'channel':_0xca77('0x75')};var _0x1e4efe=[];var _0x238874=[];var _0x5f374a={};return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x33067b[_0xca77('0x5c')]['id']},'include':[{'model':db[_0xca77('0x76')],'as':_0xca77('0x77')}]})[_0xca77('0x23')](handleEntityNotFound(_0x2956b2,null))[_0xca77('0x23')](function(_0x31b12a){_0x5372f1[_0xca77('0x78')]=_0x31b12a;_0x5372f1['applications']=_[_0xca77('0x79')](_0x31b12a[_0xca77('0x77')],[_0xca77('0x7a')],[_0xca77('0x7b')]);if(_0x5372f1[_0xca77('0x78')][_0xca77('0x77')]){delete _0x5372f1['account'][_0xca77('0x77')];}return db[_0xca77('0x7c')][_0xca77('0x67')]();})['then'](function(_0xf2e89e){if(!_0xf2e89e){throw new db[(_0xca77('0x7d'))][(_0xca77('0x7e'))](_0xca77('0x7f'));}_0x1e4efe=_[_0xca77('0x80')](_[_0xca77('0x49')](_0xf2e89e),[_0xca77('0x81'),'updatedAt']);_0x238874=_['difference'](_[_0xca77('0x49')](_0xf2e89e),[_0xca77('0x81'),_0xca77('0x82'),'CompanyId',_0xca77('0x83')]);_0x5372f1[_0xca77('0x61')]={'mapKey':'mobile'};if(_0x5372f1[_0xca77('0x78')][_0xca77('0x84')]){switch(_0x5372f1[_0xca77('0x78')][_0xca77('0x84')]){case _0xca77('0x85'):_0x5372f1[_0xca77('0x61')][_0xca77('0x86')]=_0x33067b['body'][_0xca77('0x87')];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')]['Body'];_0x5372f1[_0xca77('0x61')]['messageId']=_0x33067b[_0xca77('0x61')][_0xca77('0x88')];break;case'skebby':_0x5372f1['body'][_0xca77('0x86')]='+'+_0x33067b[_0xca77('0x61')]['sender'];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')][_0xca77('0x89')];break;case _0xca77('0x8a'):_0x5372f1[_0xca77('0x61')]['from']=_0x33067b[_0xca77('0x61')][_0xca77('0x86')];_0x5372f1[_0xca77('0x61')]['body']=_0x33067b[_0xca77('0x61')]['message'];break;case'clicksend':_0x5372f1[_0xca77('0x61')]['from']=_0x33067b[_0xca77('0x61')][_0xca77('0x86')];_0x5372f1[_0xca77('0x61')]['body']=_0x33067b['body'][_0xca77('0x61')];_0x5372f1['body'][_0xca77('0x8b')]=_0x33067b[_0xca77('0x61')]['message_id'];break;case _0xca77('0x8c'):_0x5372f1[_0xca77('0x61')][_0xca77('0x86')]=_0x33067b['body']['From'];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b['body'][_0xca77('0x8d')];_0x5372f1[_0xca77('0x61')][_0xca77('0x8b')]=_0x33067b[_0xca77('0x61')]['MessageUUID'];break;case _0xca77('0x8e'):_0x5372f1[_0xca77('0x61')]['from']='+'+_0x33067b['body'][_0xca77('0x8f')][0x0][_0xca77('0x86')];_0x5372f1[_0xca77('0x61')]['body']=_0x33067b[_0xca77('0x61')][_0xca77('0x8f')][0x0][_0xca77('0x89')];_0x5372f1[_0xca77('0x61')]['messageId']=_0x33067b[_0xca77('0x61')]['results'][0x0]['messageId'];break;case _0xca77('0x90'):_0x5372f1['body'][_0xca77('0x86')]=_0x33067b[_0xca77('0x61')][_0xca77('0x91')];_0x5372f1['body'][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')]['segmentedMessage'][_0xca77('0x2b')];break;case _0xca77('0x92'):_0x5372f1['body']['from']=_0x33067b[_0xca77('0x61')][_0xca77('0x93')];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')][_0xca77('0x89')];_0x5372f1[_0xca77('0x61')][_0xca77('0x8b')]=_0x33067b['body'][_0xca77('0x94')];break;case _0xca77('0x95'):_0x5372f1['body'][_0xca77('0x8b')]=_0x33067b[_0xca77('0x61')][0x0]['message']['id'];_0x5372f1[_0xca77('0x61')]['from']=_0x33067b['body'][0x0][_0xca77('0x2b')]['from'];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')][0x0][_0xca77('0x2b')][_0xca77('0x89')];break;case _0xca77('0x96'):_0x5372f1[_0xca77('0x61')]['from']=_0x33067b[_0xca77('0x61')][_0xca77('0x86')];_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]=_0x33067b[_0xca77('0x61')][_0xca77('0x2b')];_0x5372f1[_0xca77('0x61')][_0xca77('0x8b')]=_0x33067b['body']['refid'];break;}}if(_0x5372f1['body']['id']){delete _0x5372f1[_0xca77('0x61')]['id'];}if(_['isNil'](_0x5372f1[_0xca77('0x61')][_0xca77('0x86')])){throw new db[(_0xca77('0x7d'))][(_0xca77('0x7e'))](_0xca77('0x97'));}if(_[_0xca77('0x98')](_0x5372f1[_0xca77('0x61')]['body'])||_0x5372f1[_0xca77('0x61')][_0xca77('0x61')]===''){throw new db[(_0xca77('0x7d'))][(_0xca77('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xca77('0x98')](_0x5372f1['body'][_0xca77('0x99')])){throw new db['Sequelize'][(_0xca77('0x7e'))](_0xca77('0x9a')+_0x238874);}if(!_[_0xca77('0x9b')](_0x238874,_0x5372f1['body']['mapKey'])){throw new db[(_0xca77('0x7d'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x238874);}_0x5f374a[_0x5372f1[_0xca77('0x61')][_0xca77('0x99')]]=_0x5372f1[_0xca77('0x61')][_0xca77('0x86')];return db[_0xca77('0x9c')][_0xca77('0x5f')]({'where':{'id':_0x5372f1['account'][_0xca77('0x83')]},'include':[{'model':db[_0xca77('0x7c')],'as':_0xca77('0x9d'),'where':_0x5f374a,'limit':0x1,'order':[['updatedAt',_0xca77('0x9e')]]}]});})[_0xca77('0x23')](handleEntityNotFound(_0x2956b2,null))[_0xca77('0x23')](function(_0x2b9c40){if(_0x2b9c40){_0x5372f1['list']=_[_0xca77('0x9f')](_0x2b9c40,[_0xca77('0x9d')]);if(_0x2b9c40['Contacts'][_0xca77('0x4e')]){return _0x2b9c40[_0xca77('0x9d')][0x0];}var _0x2473e2=_['defaults'](_0x5372f1[_0xca77('0x61')],{'firstName':_0x5372f1[_0xca77('0x61')]['from'],'ListId':_0x2b9c40['id']});_0x2473e2[_0x5372f1[_0xca77('0x61')][_0xca77('0x99')]]=_0x5372f1[_0xca77('0x61')][_0xca77('0x86')];return db['CmContact']['create'](_0x2473e2,{'fields':_0x1e4efe,'raw':!![]});}})[_0xca77('0x23')](handleEntityNotFound(_0x2956b2,null))[_0xca77('0x23')](function(_0x11833b){if(_0x11833b){_0x5372f1['contact']=_0x11833b;var _0x11f3fe={'ContactId':_0x11833b['id'],'phone':_0x5372f1[_0xca77('0x61')][_0xca77('0x86')],'SmsAccountId':_0x33067b[_0xca77('0x5c')]['id']};var _0x499a54={'ContactId':_0x11833b['id'],'SmsAccountId':_0x33067b[_0xca77('0x5c')]['id'],'closed':![]};return db[_0xca77('0xa0')][_0xca77('0x5f')]({'where':_0x499a54})['then'](function(_0xb7c0de){if(_0xb7c0de){return[_0xb7c0de,![]];}return db[_0xca77('0xa0')][_0xca77('0x60')](_0x11f3fe)[_0xca77('0x23')](function(_0x305071){return[_0x305071,!![]];});});}})['spread'](function(_0x36ee65,_0x4e3586){_0x5372f1[_0xca77('0xa1')]=_0x36ee65['get']({'plain':!![]});_0x5372f1['interaction'][_0xca77('0xa2')]=![];if(_0x4e3586){if(_0x5372f1['account'][_0xca77('0xa3')]){_0x5372f1[_0xca77('0xa4')]['push']({'id':0x0,'priority':_0x5372f1[_0xca77('0xa4')][_0xca77('0x4e')]+0x1,'app':_0xca77('0xa5'),'appdata':_0xca77('0xa6'),'interval':_0xca77('0xa7')});}_0x5372f1[_0xca77('0xa1')][_0xca77('0xa2')]=!![];}return db[_0xca77('0xa8')][_0xca77('0x60')]({'phone':_0x5372f1[_0xca77('0x61')][_0xca77('0x86')],'messageId':_0x5372f1[_0xca77('0x61')][_0xca77('0x8b')],'body':_0x5372f1[_0xca77('0x61')][_0xca77('0x61')],'SmsAccountId':_0x33067b[_0xca77('0x5c')]['id'],'SmsInteractionId':_0x36ee65['id'],'direction':'in','ContactId':_0x36ee65['ContactId'],'AttachmentId':_0x5372f1[_0xca77('0x61')]['AttachmentId']});})[_0xca77('0x23')](function(_0x512645){_0x5372f1[_0xca77('0x2b')]=_0x512645;if(_0x5372f1[_0xca77('0xa1')][_0xca77('0xa9')]){return db['User'][_0xca77('0x5f')]({'attributes':['id',_0xca77('0x40')],'where':{'id':_0x5372f1[_0xca77('0xa1')][_0xca77('0xa9')]}})[_0xca77('0x23')](function(_0x52e8cb){if(_0x52e8cb){_0x5372f1['applications'][_0xca77('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x52e8cb[_0xca77('0x40')]+','+(_0x5372f1[_0xca77('0x78')][_0xca77('0xab')]||0xa),'interval':_0xca77('0xa7')});}return respondWithRpcPromise('Start',_0xca77('0xac'),_0x5372f1);});}return respondWithRpcPromise(_0xca77('0xad'),_0xca77('0xac'),_0x5372f1);})[_0xca77('0x23')](function(_0xaa6c02){if(_0xaa6c02){var _0x551816=0xc8;var _0x337f9f='receiveMessage';logger[_0xca77('0x24')](_0xca77('0xae'),_0x337f9f,_0x551816,_0xca77('0xaf'));logger['debug'](_0xca77('0xb0'),_0x337f9f,_0x551816,_0xca77('0xaf'),JSON[_0xca77('0x28')](_0xaa6c02));if(_0x5372f1['account']['type']===_0xca77('0x85')){return _0x2956b2[_0xca77('0x2f')](_0x551816)[_0xca77('0x36')](_0xca77('0xb1'),_0xca77('0xb2'))[_0xca77('0x41')](_0xca77('0xb3'));}else{return _0x2956b2[_0xca77('0x2f')](_0x551816)[_0xca77('0x31')](_0xaa6c02);}}})[_0xca77('0x2d')](handleError(_0x2956b2,null));};exports['addApplications']=function(_0x416a53,_0x2c59c6){var _0x58b878=_0x416a53[_0xca77('0x5c')]['id'];var _0x3bbcf7=_0x416a53[_0xca77('0x61')];var _0x4fee97=0xc8;var _0x32e608=null;return db[_0xca77('0xb4')][_0xca77('0xb5')]({'isolationLevel':db[_0xca77('0xb4')][_0xca77('0xb6')]['ISOLATION_LEVELS'][_0xca77('0xb7')]},function(_0xa1867f){return db[_0xca77('0x46')][_0xca77('0x71')]({'where':{'id':_0x58b878},'transaction':_0xa1867f})[_0xca77('0x23')](function(_0x1bc1fa){if(_0x1bc1fa){return db[_0xca77('0x76')][_0xca77('0x3c')]({'where':{'SmsAccountId':_0x58b878},'transaction':_0xa1867f})[_0xca77('0x23')](function(){var _0x1f9fb3=_[_0xca77('0x45')](_0x3bbcf7,function(_0x4b78e3){_0x4b78e3['SmsAccountId']=_0x58b878;return _0x4b78e3;});return db['SmsApplication'][_0xca77('0xb8')](_0x1f9fb3,{'transaction':_0xa1867f});});}else{_0x4fee97=0x194;_0x32e608=[];}});})['then'](function(){if(_0x4fee97!==0x194){return db['SmsApplication'][_0xca77('0xb9')]({'where':{'SmsAccountId':_0x58b878},'order':_0xca77('0x7a')})['then'](function(_0x5ad72b){_0x32e608=_0x5ad72b;});}})['catch'](function(_0x4c3b70){_0x4fee97=0x1f4;logger[_0xca77('0x29')](_0x4c3b70[_0xca77('0x3f')]);if(_0x4c3b70[_0xca77('0x40')]){delete _0x4c3b70[_0xca77('0x40')];}_0x32e608=_0x4c3b70;})[_0xca77('0xba')](function(){if(_0x32e608===null){_0x2c59c6[_0xca77('0x2e')](_0x4fee97);}else{if(_0x4fee97===0x1f4){_0x2c59c6[_0xca77('0x2f')](_0x4fee97)[_0xca77('0x41')](_0x32e608);}else{_0x2c59c6['status'](_0x4fee97)[_0xca77('0x31')](_0x32e608);}}});};exports['getApplications']=function(_0x2ff102,_0x2f9e9f,_0x166dcb){var _0x17088e={};var _0x4f8c1e={};var _0x1e6e74;var _0x3a090e;return db[_0xca77('0x46')][_0xca77('0x71')]({'where':{'id':_0x2ff102['params']['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x2f9e9f,null))['then'](function(_0x494d06){if(_0x494d06){_0x1e6e74=_0x494d06;_0x4f8c1e[_0xca77('0x4a')]=_[_0xca77('0x49')](db[_0xca77('0x76')]['rawAttributes']);_0x4f8c1e[_0xca77('0x48')]=_[_0xca77('0x49')](_0x2ff102[_0xca77('0x48')]);_0x4f8c1e[_0xca77('0x55')]=_['intersection'](_0x4f8c1e[_0xca77('0x4a')],_0x4f8c1e[_0xca77('0x48')]);_0x17088e[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x4f8c1e[_0xca77('0x4a')],qs[_0xca77('0x4d')](_0x2ff102[_0xca77('0x48')][_0xca77('0x4d')]));_0x17088e[_0xca77('0x4b')]=_0x17088e[_0xca77('0x4b')][_0xca77('0x4e')]?_0x17088e[_0xca77('0x4b')]:_0x4f8c1e[_0xca77('0x4a')];_0x17088e['order']=qs['sort'](_0x2ff102[_0xca77('0x48')][_0xca77('0x52')]);_0x17088e[_0xca77('0x53')]=qs[_0xca77('0x55')](_['pick'](_0x2ff102[_0xca77('0x48')],_0x4f8c1e[_0xca77('0x55')]));if(_0x2ff102[_0xca77('0x48')][_0xca77('0x56')]){_0x17088e[_0xca77('0x53')]=_[_0xca77('0x57')](_0x17088e[_0xca77('0x53')],{'$or':_[_0xca77('0x45')](_0x17088e[_0xca77('0x4b')],function(_0x3746ac){var _0x889e9={};_0x889e9[_0x3746ac]={'$like':'%'+_0x2ff102[_0xca77('0x48')][_0xca77('0x56')]+'%'};return _0x889e9;})});}_0x17088e=_[_0xca77('0x57')]({},_0x17088e,_0x2ff102[_0xca77('0x5e')]);return _0x1e6e74[_0xca77('0xbb')](_0x17088e);}})[_0xca77('0x23')](function(_0x15dd28){if(_0x15dd28){_0x3a090e=_0x15dd28[_0xca77('0x4e')];if(!_0x2ff102[_0xca77('0x48')][_0xca77('0x4f')](_0xca77('0x50'))){_0x17088e[_0xca77('0x34')]=qs[_0xca77('0x34')](_0x2ff102[_0xca77('0x48')]['limit']);_0x17088e[_0xca77('0x32')]=qs[_0xca77('0x32')](_0x2ff102[_0xca77('0x48')]['offset']);}return _0x1e6e74['getApplications'](_0x17088e);}})[_0xca77('0x23')](function(_0x3f31db){if(_0x3f31db){return _0x3f31db?{'count':_0x3a090e,'rows':_0x3f31db}:null;}})[_0xca77('0x23')](respondWithResult(_0x2f9e9f,null))[_0xca77('0x2d')](handleError(_0x2f9e9f,null));};exports['getInteractions']=function(_0x3b04d4,_0x2d9080,_0x28d6a2){var _0xa77ac4={'raw':![],'where':{}};var _0x56a75f={};var _0x3e7f31={'count':0x0,'rows':[]};return db[_0xca77('0x46')][_0xca77('0x71')]({'where':{'id':_0x3b04d4[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x2d9080,null))[_0xca77('0x23')](function(_0x55c7ff){if(_0x55c7ff){_0x56a75f['model']=_[_0xca77('0x49')](db[_0xca77('0xa0')]['rawAttributes']);_0x56a75f[_0xca77('0x48')]=_['keys'](_0x3b04d4[_0xca77('0x48')]);_0x56a75f[_0xca77('0x55')]=_[_0xca77('0x4c')](_0x56a75f[_0xca77('0x4a')],_0x56a75f[_0xca77('0x48')]);_0xa77ac4['attributes']=_[_0xca77('0x4c')](_0x56a75f[_0xca77('0x4a')],qs[_0xca77('0x4d')](_0x3b04d4[_0xca77('0x48')][_0xca77('0x4d')]));_0xa77ac4[_0xca77('0x4b')]=_0xa77ac4[_0xca77('0x4b')]['length']?_0xa77ac4[_0xca77('0x4b')]:_0x56a75f['model'];if(!_0x3b04d4[_0xca77('0x48')][_0xca77('0x4f')](_0xca77('0x50'))){_0xa77ac4['limit']=qs[_0xca77('0x34')](_0x3b04d4[_0xca77('0x48')][_0xca77('0x34')]);_0xa77ac4['offset']=qs[_0xca77('0x32')](_0x3b04d4[_0xca77('0x48')][_0xca77('0x32')]);}_0xa77ac4[_0xca77('0x51')]=qs[_0xca77('0x52')](_0x3b04d4[_0xca77('0x48')]['sort']);_0xa77ac4['where']=qs[_0xca77('0x55')](_[_0xca77('0x54')](_0x3b04d4['query'],_0x56a75f[_0xca77('0x55')]));_0xa77ac4[_0xca77('0x53')][_0xca77('0x69')]=_0x55c7ff['id'];if(_0x3b04d4['query'][_0xca77('0x56')]){_0xa77ac4[_0xca77('0x53')]=_[_0xca77('0x57')](_0xa77ac4['where'],{'$or':_[_0xca77('0x45')](_0xa77ac4[_0xca77('0x4b')],function(_0x24c093){var _0x4220d1={};_0x4220d1[_0x24c093]={'$like':'%'+_0x3b04d4[_0xca77('0x48')][_0xca77('0x56')]+'%'};return _0x4220d1;})});}_0xa77ac4=_[_0xca77('0x57')]({},_0xa77ac4,_0x3b04d4[_0xca77('0x5e')]);return db['SmsInteraction'][_0xca77('0x35')]({'where':_0xa77ac4[_0xca77('0x53')]})[_0xca77('0x23')](function(_0x4ca724){_0x3e7f31[_0xca77('0x35')]=_0x4ca724;if(_0x3b04d4['query'][_0xca77('0x58')]){_0xa77ac4['include']=[{'model':db[_0xca77('0x7c')],'as':_0xca77('0xbc'),'required':![]},{'model':db[_0xca77('0xbd')],'as':_0xca77('0xbe'),'attributes':[_0xca77('0x40'),_0xca77('0xbf'),'internal'],'required':![]},{'model':db[_0xca77('0xc0')],'as':_0xca77('0xc1'),'attributes':['id',_0xca77('0x40'),_0xca77('0xc2')],'where':_0x3b04d4[_0xca77('0x48')]['tag']?{'id':_0x3b04d4[_0xca77('0x48')]['tag']}:undefined,'required':_0x3b04d4['query'][_0xca77('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0xca77('0x5a')](_0xa77ac4);})[_0xca77('0x23')](function(_0x560515){_0x3e7f31[_0xca77('0x72')]=_0x560515;return _0x3e7f31;});}})[_0xca77('0x23')](respondWithFilteredResult(_0x2d9080,_0xa77ac4))[_0xca77('0x2d')](handleError(_0x2d9080,null));};exports[_0xca77('0x41')]=function(_0x299798,_0x554909,_0x13c124){var _0x25d422,_0x3dd4b9,_0x5d33ac;if(_[_0xca77('0x98')](_0x299798[_0xca77('0x61')][_0xca77('0x61')])||_0x299798[_0xca77('0x61')][_0xca77('0x61')]===''){throw new db['Sequelize'][(_0xca77('0x7e'))](_0xca77('0xc4'));}if(_['isNil'](_0x299798[_0xca77('0x61')]['to'])){throw new db[(_0xca77('0x7d'))][(_0xca77('0x7e'))]('to\x20is\x20mandatory');}_0x25d422=_0x299798[_0xca77('0x61')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x299798['params']['id']},'include':[{'model':db[_0xca77('0x9c')],'as':_0xca77('0xc5'),'include':[{'model':db[_0xca77('0x7c')],'as':'Contacts','where':{'mobile':_0x25d422},'limit':0x1,'order':[['updatedAt',_0xca77('0x9e')]]}]}]})[_0xca77('0x23')](handleEntityNotFound(_0x554909,null))[_0xca77('0x23')](function(_0x4b2bb7){if(_0x4b2bb7&&_0x4b2bb7['List']){_0x3dd4b9=_0x4b2bb7[_0xca77('0x64')]({'plain':!![]});if(_0x3dd4b9['List']&&_0x3dd4b9[_0xca77('0xc5')][_0xca77('0x9d')]['length']){return _0x3dd4b9[_0xca77('0xc5')][_0xca77('0x9d')][0x0];}return db[_0xca77('0x7c')][_0xca77('0x60')](_[_0xca77('0x1c')](_0x299798[_0xca77('0x61')],{'firstName':_0x25d422,'mobile':_0x25d422,'phone':_0x25d422,'ListId':_0x3dd4b9[_0xca77('0x83')]}));}})['then'](handleEntityNotFound(_0x554909,null))['then'](function(_0xf0e387){if(_0xf0e387){_0x5d33ac=_0xf0e387;return db[_0xca77('0xa0')][_0xca77('0x5f')]({'where':{'ContactId':_0x5d33ac['id'],'closed':![],'SmsAccountId':_0x3dd4b9['id']}})[_0xca77('0x23')](function(_0x25e92f){if(_0x25e92f){return[_0x25e92f,![]];}return db[_0xca77('0xa0')][_0xca77('0x60')]({'UserId':_0x299798[_0xca77('0x62')]['id'],'ContactId':_0x5d33ac['id'],'SmsAccountId':_0x3dd4b9['id'],'phone':_0x25d422,'firstMsgDirection':_0xca77('0xc6'),'Messages':[_['merge'](_0x299798['body'],{'read':![],'body':_0x299798[_0xca77('0x61')][_0xca77('0x61')],'phone':_0x25d422,'SmsAccountId':_0x3dd4b9['id'],'UserId':_0x299798['user']['id'],'ContactId':_0x5d33ac['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xca77('0xc7')}]})[_0xca77('0x23')](function(_0x27039f){return[_0x27039f,!![]];});});}})[_0xca77('0xc8')](function(_0x613d4b,_0x620810){if(_0x620810){return _0x613d4b;}return db[_0xca77('0xa8')][_0xca77('0x60')](_[_0xca77('0x57')](_0x299798[_0xca77('0x61')],{'read':![],'body':_0x299798[_0xca77('0x61')][_0xca77('0x61')],'phone':_0x25d422,'SmsAccountId':_0x3dd4b9['id'],'SmsInteractionId':_0x613d4b['id'],'UserId':_0x299798[_0xca77('0x62')]['id'],'ContactId':_0x5d33ac['id']}))[_0xca77('0x23')](function(_0x217054){_0x613d4b[_0xca77('0xc9')][_0xca77('0xc7')]=[];_0x613d4b[_0xca77('0xc9')]['Messages']['push'](_0x217054['dataValues']);return _0x613d4b;});})[_0xca77('0x23')](respondWithResult(_0x554909,null))['catch'](handleError(_0x554909,null));};exports[_0xca77('0x2f')]=function(_0x286e87,_0xac5e66,_0x347437){if(_0x286e87[_0xca77('0x61')]['id']){delete _0x286e87[_0xca77('0x61')]['id'];}var _0x5e0e4b,_0x52fb4c,_0xadf16f;return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x286e87[_0xca77('0x5c')]['id']}})['then'](handleEntityNotFound(_0xac5e66,null))['then'](function(_0x272fc8){if(_0x272fc8){_0xadf16f=_0x272fc8;logger[_0xca77('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x272fc8[_0xca77('0x84')],util[_0xca77('0xca')](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));switch(_0x272fc8['type']){case _0xca77('0xcb'):if(_0x286e87[_0xca77('0x61')][_0xca77('0xcc')]&&_0x286e87[_0xca77('0x61')][_0xca77('0x2f')]){_0x52fb4c=_0x286e87[_0xca77('0x61')][_0xca77('0x2f')];return db[_0xca77('0xa8')][_0xca77('0x5f')]({'where':{'messageId':_0x286e87[_0xca77('0x61')][_0xca77('0xcc')]}});}break;case _0xca77('0x8a'):if(_0x286e87[_0xca77('0x61')][_0xca77('0xcd')]&&_0x286e87[_0xca77('0x61')]['statusInt']){_0x52fb4c=_0x286e87['body'][_0xca77('0xce')];return db[_0xca77('0xa8')][_0xca77('0x5f')]({'where':{'messageId':_0x286e87[_0xca77('0x61')][_0xca77('0xcd')]}});}break;case'clicksend':if(_0x286e87[_0xca77('0x61')][_0xca77('0xcf')]&&_0x286e87[_0xca77('0x61')]['status_code']){_0x52fb4c=_0x286e87['body'][_0xca77('0xd0')];return db[_0xca77('0xa8')][_0xca77('0x5f')]({'where':{'messageId':_0x286e87[_0xca77('0x61')][_0xca77('0xcf')]}});}break;case _0xca77('0x8e'):var _0x1761f5=_0x286e87[_0xca77('0x61')][_0xca77('0x8f')][0x0];if(_0x1761f5[_0xca77('0x8b')]&&_0x1761f5[_0xca77('0x2f')]['groupName']===_0xca77('0xd1')){_0x52fb4c=_0x1761f5['status'][_0xca77('0xd2')];return db[_0xca77('0xa8')][_0xca77('0x5f')]({'where':{'messageId':_0x1761f5[_0xca77('0x8b')]}});}break;case _0xca77('0x92'):if(_0x286e87[_0xca77('0x61')][_0xca77('0x8b')]&&_0x286e87[_0xca77('0x61')][_0xca77('0x2f')]){_0x52fb4c=_0x286e87[_0xca77('0x61')][_0xca77('0x2f')];return db[_0xca77('0xa8')][_0xca77('0x5f')]({'where':{'messageId':_0x286e87['body'][_0xca77('0x8b')]}});}break;case'bandwidth':if(_0x286e87[_0xca77('0x61')][0x0][_0xca77('0x2b')]['id']){_0x52fb4c=_0x286e87[_0xca77('0x61')][0x0][_0xca77('0x84')];return db[_0xca77('0xa8')]['find']({'where':{'messageId':_0x286e87[_0xca77('0x61')][0x0][_0xca77('0x2b')]['id']}});}break;case _0xca77('0x96'):if(_0x286e87[_0xca77('0x61')][_0xca77('0xd3')]&&_0x286e87['body'][_0xca77('0x2f')]){_0x52fb4c=_0x286e87[_0xca77('0x61')][_0xca77('0x2f')];return db[_0xca77('0xa8')]['find']({'where':{'messageId':_0x286e87[_0xca77('0x61')][_0xca77('0xd3')]}});}break;}}})[_0xca77('0x23')](handleEntityNotFound(_0xac5e66,null))[_0xca77('0x23')](function(_0x588ef4){if(_0x588ef4){_0x5e0e4b=_0x588ef4;switch(_0xadf16f[_0xca77('0x84')]){case _0xca77('0xcb'):if(_0x52fb4c===_0xca77('0xd1')){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')](_0xca77('0xae'),'status',_0xca77('0xcb'),util['inspect'](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case _0xca77('0x8a'):if(_0x52fb4c==='1'){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')](_0xca77('0xae'),_0xca77('0x2f'),_0xca77('0xcb'),util[_0xca77('0xca')](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x286e87[_0xca77('0x61')]['error_code']&&_0x52fb4c>=0xc8&&_0x52fb4c<=0xce){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xca77('0xd4'),util[_0xca77('0xca')](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case _0xca77('0x8e'):var _0x5960ae=_0x286e87[_0xca77('0x61')][_0xca77('0x8f')][0x0];if(_0x5960ae['status']['groupName']===_0xca77('0xd1')){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')](_0xca77('0xae'),'status',_0xca77('0x8e'),util[_0xca77('0xca')](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case _0xca77('0x92'):if(_0x52fb4c==_0xca77('0xd5')||_0x52fb4c==_0xca77('0xd6')){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xca77('0x2f'),_0xca77('0x92'),util['inspect'](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case _0xca77('0x95'):if(_0x52fb4c=='message-delivered'){return _0x5e0e4b[_0xca77('0x3b')]({'read':!![]});}else{logger[_0xca77('0x29')](_0xca77('0xae'),_0xca77('0x2f'),_0xca77('0x95'),util[_0xca77('0xca')](_0x286e87[_0xca77('0x61')],{'showHidden':![],'depth':null}));}break;case _0xca77('0x96'):if(_0x52fb4c==='DELIVRD'||_0x52fb4c==='ACCEPTD'){return _0x5e0e4b['update']({'read':!![]});}else{logger[_0xca77('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xca77('0x2f'),_0xca77('0x96'),util[_0xca77('0xca')](_0x286e87['body'],{'showHidden':![],'depth':null}));}break;}return _0x5e0e4b;}})['then'](respondWithResult(_0xac5e66,null))['catch'](handleError(_0xac5e66,null));};exports[_0xca77('0xd7')]=function(_0x56449b,_0x375f0d,_0x2bf082){var _0x5d59c9,_0x309b76,_0x452ad2;return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x56449b[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x375f0d,null))[_0xca77('0x23')](function(_0x2f614f){if(_0x2f614f){_0x452ad2=_0x2f614f;logger[_0xca77('0x26')](_0xca77('0xae'),_0xca77('0x2f'),_0xca77('0xd8'),_0x2f614f[_0xca77('0x84')],util[_0xca77('0xca')](_0x56449b['query'],{'showHidden':![],'depth':null}));switch(_0x2f614f['type']){case _0xca77('0x90'):if(_0x56449b[_0xca77('0x48')]['message-id']&&_0x56449b['query'][_0xca77('0xd9')]){_0x309b76=_0x56449b[_0xca77('0x48')][_0xca77('0xd9')];return db[_0xca77('0xa8')]['find']({'where':{'messageId':_0x56449b[_0xca77('0x48')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x375f0d,null))[_0xca77('0x23')](function(_0x4341db){if(_0x4341db){_0x5d59c9=_0x4341db;switch(_0x452ad2[_0xca77('0x84')]){case _0xca77('0x90'):if(_0x309b76==='2'||_0x309b76==='6'){return _0x5d59c9[_0xca77('0x3b')]({'read':!![]});}else{logger['error'](_0xca77('0xae'),_0xca77('0x2f'),_0xca77('0x90'),util['inspect'](_0x56449b[_0xca77('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x5d59c9;}})[_0xca77('0x23')](respondWithResult(_0x375f0d,null))['catch'](handleError(_0x375f0d,null));};exports[_0xca77('0xda')]=function(_0x4b903a,_0x4dc522,_0x3c413e){return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x4b903a[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x4dc522,null))[_0xca77('0x23')](function(_0x510353){if(_0x510353){return _0x510353['addAgents'](_0x4b903a[_0xca77('0x61')][_0xca77('0x6d')],_[_0xca77('0x9f')](_0x4b903a[_0xca77('0x61')],['ids','id'])||{})[_0xca77('0xc8')](function(_0x252775){for(var _0xa548c4=0x0;_0xa548c4<_0x4b903a[_0xca77('0x61')][_0xca77('0x6d')]['length'];_0xa548c4+=0x1){socket[_0xca77('0xdb')]('userSmsAccount:save',{'UserId':Number(_0x4b903a['body'][_0xca77('0x6d')][_0xa548c4]),'SmsAccountId':Number(_0x4b903a[_0xca77('0x5c')]['id'])});}return _0x252775;});}})[_0xca77('0x23')](respondWithResult(_0x4dc522,null))['catch'](handleError(_0x4dc522,null));};exports[_0xca77('0xdc')]=function(_0x32191b,_0x301f2d,_0x3df789){return db[_0xca77('0x46')][_0xca77('0x5f')]({'where':{'id':_0x32191b[_0xca77('0x5c')]['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x301f2d,null))[_0xca77('0x23')](function(_0x2f06ea){if(_0x2f06ea){return _0x2f06ea[_0xca77('0xdc')](_0x32191b[_0xca77('0x48')]['ids'])[_0xca77('0x23')](function(){if(_[_0xca77('0xdd')](_0x32191b[_0xca77('0x48')][_0xca77('0x6d')])){for(var _0xdc0e74=0x0;_0xdc0e74<_0x32191b[_0xca77('0x48')][_0xca77('0x6d')][_0xca77('0x4e')];_0xdc0e74+=0x1){socket[_0xca77('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x32191b[_0xca77('0x48')]['ids'][_0xdc0e74]),'SmsAccountId':Number(_0x32191b[_0xca77('0x5c')]['id'])});}}else{socket[_0xca77('0xdb')](_0xca77('0xde'),{'UserId':Number(_0x32191b[_0xca77('0x48')][_0xca77('0x6d')]),'SmsAccountId':Number(_0x32191b[_0xca77('0x5c')]['id'])});}});}})[_0xca77('0x23')](respondWithStatusCode(_0x301f2d,null))['catch'](handleError(_0x301f2d,null));};exports[_0xca77('0xdf')]=function(_0x3bab2c,_0x9867aa,_0x499b86){var _0x1e7310={};var _0x477acd={};var _0x566b5d;var _0x511bb2;return db[_0xca77('0x46')][_0xca77('0x71')]({'where':{'id':_0x3bab2c['params']['id']}})[_0xca77('0x23')](handleEntityNotFound(_0x9867aa,null))['then'](function(_0x3540b9){if(_0x3540b9){_0x566b5d=_0x3540b9;_0x477acd[_0xca77('0x4a')]=_[_0xca77('0x49')](db[_0xca77('0xbd')][_0xca77('0x5d')]);_0x477acd[_0xca77('0x48')]=_[_0xca77('0x49')](_0x3bab2c[_0xca77('0x48')]);_0x477acd['filters']=_[_0xca77('0x4c')](_0x477acd[_0xca77('0x4a')],_0x477acd[_0xca77('0x48')]);_0x1e7310[_0xca77('0x4b')]=_[_0xca77('0x4c')](_0x477acd[_0xca77('0x4a')],qs[_0xca77('0x4d')](_0x3bab2c['query'][_0xca77('0x4d')]));_0x1e7310[_0xca77('0x4b')]=_0x1e7310[_0xca77('0x4b')]['length']?_0x1e7310[_0xca77('0x4b')]:_0x477acd['model'];_0x1e7310[_0xca77('0x51')]=qs[_0xca77('0x52')](_0x3bab2c['query'][_0xca77('0x52')]);_0x1e7310[_0xca77('0x53')]=qs[_0xca77('0x55')](_['pick'](_0x3bab2c[_0xca77('0x48')],_0x477acd[_0xca77('0x55')]));if(_0x3bab2c[_0xca77('0x48')][_0xca77('0x56')]){_0x1e7310[_0xca77('0x53')]=_[_0xca77('0x57')](_0x1e7310[_0xca77('0x53')],{'$or':_[_0xca77('0x45')](_0x1e7310[_0xca77('0x4b')],function(_0x11bb7b){var _0x3957d0={};_0x3957d0[_0x11bb7b]={'$like':'%'+_0x3bab2c['query'][_0xca77('0x56')]+'%'};return _0x3957d0;})});}_0x1e7310=_[_0xca77('0x57')]({},_0x1e7310,_0x3bab2c[_0xca77('0x5e')]);return _0x566b5d['getAgents'](_0x1e7310);}})[_0xca77('0x23')](function(_0x9b5bff){if(_0x9b5bff){_0x511bb2=_0x9b5bff[_0xca77('0x4e')];if(!_0x3bab2c[_0xca77('0x48')]['hasOwnProperty'](_0xca77('0x50'))){_0x1e7310[_0xca77('0x34')]=qs['limit'](_0x3bab2c[_0xca77('0x48')][_0xca77('0x34')]);_0x1e7310[_0xca77('0x32')]=qs[_0xca77('0x32')](_0x3bab2c[_0xca77('0x48')][_0xca77('0x32')]);}return _0x566b5d[_0xca77('0xdf')](_0x1e7310);}})['then'](function(_0x33c18a){if(_0x33c18a){return _0x33c18a?{'count':_0x511bb2,'rows':_0x33c18a}:null;}})[_0xca77('0x23')](respondWithResult(_0x9867aa,null))[_0xca77('0x2d')](handleError(_0x9867aa,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 78fe3d7..a480a2d 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 _0xd762=['exports','events','SmsAccount','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd762,0xb0));var _0x2d76=function(_0x31c798,_0x2f1872){_0x31c798=_0x31c798-0x0;var _0x5e508d=_0xd762[_0x31c798];return _0x5e508d;};'use strict';var EventEmitter=require(_0x2d76('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x2d76('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d76('0x2'),'afterDestroy':_0x2d76('0x3')};function emitEvent(_0x4d06b7){return function(_0x361c2a,_0x169ac1,_0x3c956b){SmsAccountEvents['emit'](_0x4d06b7+':'+_0x361c2a['id'],_0x361c2a);SmsAccountEvents[_0x2d76('0x4')](_0x4d06b7,_0x361c2a);_0x3c956b(null);};}for(var e in events){if(events[_0x2d76('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x2d76('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x3336=['save','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x509fe5,_0x5e9a85){var _0x3fa2c3=function(_0x72fa25){while(--_0x72fa25){_0x509fe5['push'](_0x509fe5['shift']());}};_0x3fa2c3(++_0x5e9a85);}(_0x3336,0x15b));var _0x6333=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x3336[_0x1428d9];return _0x438019;};'use strict';var EventEmitter=require(_0x6333('0x0'));var SmsAccount=require(_0x6333('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6333('0x2')](0x0);var events={'afterCreate':_0x6333('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21fedd){return function(_0x2bfd03,_0x22f213,_0x5129c7){SmsAccountEvents[_0x6333('0x4')](_0x21fedd+':'+_0x2bfd03['id'],_0x2bfd03);SmsAccountEvents[_0x6333('0x4')](_0x21fedd,_0x2bfd03);_0x5129c7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x6333('0x5')](e,emitEvent(event));}}module[_0x6333('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 218d027..790f38f 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 _0x810b=['exports','define','SmsAccount','sms_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x46ede9,_0x18ad7b){var _0x35af8b=function(_0xb13571){while(--_0xb13571){_0x46ede9['push'](_0x46ede9['shift']());}};_0x35af8b(++_0x18ad7b);}(_0x810b,0x66));var _0xb810=function(_0x30a2f2,_0x13bb5f){_0x30a2f2=_0x30a2f2-0x0;var _0x4a7bb9=_0x810b[_0x30a2f2];return _0x4a7bb9;};'use strict';var _=require(_0xb810('0x0'));var util=require(_0xb810('0x1'));var logger=require('../../config/logger')(_0xb810('0x2'));var moment=require(_0xb810('0x3'));var BPromise=require(_0xb810('0x4'));var rp=require(_0xb810('0x5'));var fs=require('fs');var path=require(_0xb810('0x6'));var rimraf=require(_0xb810('0x7'));var config=require(_0xb810('0x8'));var attributes=require(_0xb810('0x9'));module[_0xb810('0xa')]=function(_0x7c8f7b,_0x7e7627){return _0x7c8f7b[_0xb810('0xb')](_0xb810('0xc'),attributes,{'tableName':_0xb810('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x223e=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x569970,_0x16f028){var _0x13cc81=function(_0x313dc2){while(--_0x313dc2){_0x569970['push'](_0x569970['shift']());}};_0x13cc81(++_0x16f028);}(_0x223e,0x15c));var _0xe223=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0x223e[_0xb7a459];return _0x104ab5;};'use strict';var _=require(_0xe223('0x0'));var util=require('util');var logger=require(_0xe223('0x1'))(_0xe223('0x2'));var moment=require(_0xe223('0x3'));var BPromise=require(_0xe223('0x4'));var rp=require(_0xe223('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe223('0x6'));var config=require(_0xe223('0x7'));var attributes=require(_0xe223('0x8'));module[_0xe223('0x9')]=function(_0x23e904,_0x22818f){return _0x23e904[_0xe223('0xa')]('SmsAccount',attributes,{'tableName':_0xe223('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e3c53dd..36eeb92 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 _0x2590=['redis','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ShowSmsAccount','options','raw','where','attributes','map','model','include','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x2590,0x1eb));var _0x0259=function(_0x44ba7e,_0x385d05){_0x44ba7e=_0x44ba7e-0x0;var _0x2fb813=_0x2590[_0x44ba7e];return _0x2fb813;};'use strict';var _=require(_0x0259('0x0'));var util=require(_0x0259('0x1'));var moment=require(_0x0259('0x2'));var BPromise=require(_0x0259('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0259('0x4'));var db=require(_0x0259('0x5'))['db'];var utils=require(_0x0259('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0259('0x7'));var jayson=require(_0x0259('0x8'));var client=jayson[_0x0259('0x9')][_0x0259('0xa')]({'port':0x232a});config['redis']=_[_0x0259('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0259('0xc'))(new Redis(config[_0x0259('0xd')]));require(_0x0259('0xe'))[_0x0259('0xf')](socket);function respondWithRpcPromise(_0x44938a,_0x22235e,_0x343924){return new BPromise(function(_0x2ddd54,_0x59882a){return client[_0x0259('0x10')](_0x44938a,_0x343924)['then'](function(_0x4fc5ba){logger[_0x0259('0x11')](_0x0259('0x12'),_0x22235e,'request\x20sent');logger[_0x0259('0x13')](_0x0259('0x14'),_0x22235e,'request\x20sent',JSON[_0x0259('0x15')](_0x4fc5ba));if(_0x4fc5ba[_0x0259('0x16')]){if(_0x4fc5ba[_0x0259('0x16')][_0x0259('0x17')]===0x1f4){logger[_0x0259('0x16')](_0x0259('0x12'),_0x22235e,_0x4fc5ba[_0x0259('0x16')][_0x0259('0x18')]);return _0x59882a(_0x4fc5ba[_0x0259('0x16')][_0x0259('0x18')]);}logger[_0x0259('0x16')](_0x0259('0x12'),_0x22235e,_0x4fc5ba[_0x0259('0x16')]['message']);return _0x2ddd54(_0x4fc5ba[_0x0259('0x16')][_0x0259('0x18')]);}else{logger[_0x0259('0x11')](_0x0259('0x12'),_0x22235e,_0x0259('0x19'));_0x2ddd54(_0x4fc5ba['result'][_0x0259('0x18')]);}})[_0x0259('0x1a')](function(_0x24aa28){logger[_0x0259('0x16')](_0x0259('0x12'),_0x22235e,_0x24aa28);_0x59882a(_0x24aa28);});});}exports[_0x0259('0x1b')]=function(_0x31d819){var _0x5f552b=this;return new Promise(function(_0x3a3e5f,_0x26305b){return db['SmsAccount']['find']({'raw':_0x31d819['options']?_0x31d819[_0x0259('0x1c')][_0x0259('0x1d')]===undefined?!![]:![]:!![],'where':_0x31d819[_0x0259('0x1c')]?_0x31d819[_0x0259('0x1c')][_0x0259('0x1e')]||null:null,'attributes':_0x31d819[_0x0259('0x1c')]?_0x31d819['options'][_0x0259('0x1f')]||null:null,'include':_0x31d819['options']?_0x31d819[_0x0259('0x1c')]['include']?_[_0x0259('0x20')](_0x31d819[_0x0259('0x1c')]['include'],function(_0x17849a){return{'model':db[_0x17849a[_0x0259('0x21')]],'as':_0x17849a['as'],'attributes':_0x17849a[_0x0259('0x1f')],'include':_0x17849a[_0x0259('0x22')]?_['map'](_0x17849a['include'],function(_0x12de23){return{'model':db[_0x12de23['model']],'as':_0x12de23['as'],'attributes':_0x12de23['attributes'],'include':_0x12de23[_0x0259('0x22')]?_[_0x0259('0x20')](_0x12de23[_0x0259('0x22')],function(_0x2ebb8a){return{'model':db[_0x2ebb8a[_0x0259('0x21')]],'as':_0x2ebb8a['as'],'attributes':_0x2ebb8a[_0x0259('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0259('0x23')](function(_0x221b57){logger[_0x0259('0x11')](_0x0259('0x1b'),_0x31d819);logger[_0x0259('0x13')](_0x0259('0x1b'),_0x31d819,JSON['stringify'](_0x221b57));_0x3a3e5f(_0x221b57);})[_0x0259('0x1a')](function(_0x215c40){logger[_0x0259('0x16')](_0x0259('0x1b'),_0x215c40[_0x0259('0x18')],_0x31d819);_0x26305b(_0x5f552b[_0x0259('0x16')](0x1f4,_0x215c40[_0x0259('0x18')]));});});}; \ No newline at end of file +var _0x206e=['./smsAccount.socket','register','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','SmsAccount','find','options','raw','include','map','attributes','model','ShowSmsAccount','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3f0329,_0x5575d6){var _0x500058=function(_0x3c64a0){while(--_0x3c64a0){_0x3f0329['push'](_0x3f0329['shift']());}};_0x500058(++_0x5575d6);}(_0x206e,0x8a));var _0xe206=function(_0x37bc10,_0x528f6f){_0x37bc10=_0x37bc10-0x0;var _0x10fff1=_0x206e[_0x37bc10];return _0x10fff1;};'use strict';var _=require(_0xe206('0x0'));var util=require(_0xe206('0x1'));var moment=require(_0xe206('0x2'));var BPromise=require(_0xe206('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe206('0x4'));var db=require(_0xe206('0x5'))['db'];var utils=require(_0xe206('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe206('0x7'));var client=jayson[_0xe206('0x8')][_0xe206('0x9')]({'port':0x232a});config[_0xe206('0xa')]=_[_0xe206('0xb')](config[_0xe206('0xa')],{'host':_0xe206('0xc'),'port':0x18eb});var socket=require(_0xe206('0xd'))(new Redis(config['redis']));require(_0xe206('0xe'))[_0xe206('0xf')](socket);function respondWithRpcPromise(_0x2e4f27,_0x4dc642,_0x4190a4){return new BPromise(function(_0x47bba0,_0x32d592){return client[_0xe206('0x10')](_0x2e4f27,_0x4190a4)[_0xe206('0x11')](function(_0x3eae3c){logger[_0xe206('0x12')]('SmsAccount,\x20%s,\x20%s',_0x4dc642,_0xe206('0x13'));logger['debug'](_0xe206('0x14'),_0x4dc642,'request\x20sent',JSON['stringify'](_0x3eae3c));if(_0x3eae3c[_0xe206('0x15')]){if(_0x3eae3c[_0xe206('0x15')][_0xe206('0x16')]===0x1f4){logger[_0xe206('0x15')](_0xe206('0x17'),_0x4dc642,_0x3eae3c[_0xe206('0x15')][_0xe206('0x18')]);return _0x32d592(_0x3eae3c[_0xe206('0x15')]['message']);}logger[_0xe206('0x15')](_0xe206('0x17'),_0x4dc642,_0x3eae3c['error'][_0xe206('0x18')]);return _0x47bba0(_0x3eae3c['error'][_0xe206('0x18')]);}else{logger['info'](_0xe206('0x17'),_0x4dc642,'request\x20sent');_0x47bba0(_0x3eae3c[_0xe206('0x19')][_0xe206('0x18')]);}})['catch'](function(_0x53a873){logger[_0xe206('0x15')](_0xe206('0x17'),_0x4dc642,_0x53a873);_0x32d592(_0x53a873);});});}exports['ShowSmsAccount']=function(_0x1090d4){var _0x5377f0=this;return new Promise(function(_0x380266,_0x1c7848){return db[_0xe206('0x1a')][_0xe206('0x1b')]({'raw':_0x1090d4[_0xe206('0x1c')]?_0x1090d4['options'][_0xe206('0x1d')]===undefined?!![]:![]:!![],'where':_0x1090d4[_0xe206('0x1c')]?_0x1090d4[_0xe206('0x1c')]['where']||null:null,'attributes':_0x1090d4[_0xe206('0x1c')]?_0x1090d4[_0xe206('0x1c')]['attributes']||null:null,'include':_0x1090d4[_0xe206('0x1c')]?_0x1090d4[_0xe206('0x1c')][_0xe206('0x1e')]?_[_0xe206('0x1f')](_0x1090d4['options'][_0xe206('0x1e')],function(_0x11600f){return{'model':db[_0x11600f['model']],'as':_0x11600f['as'],'attributes':_0x11600f[_0xe206('0x20')],'include':_0x11600f[_0xe206('0x1e')]?_['map'](_0x11600f[_0xe206('0x1e')],function(_0x5180c5){return{'model':db[_0x5180c5['model']],'as':_0x5180c5['as'],'attributes':_0x5180c5[_0xe206('0x20')],'include':_0x5180c5[_0xe206('0x1e')]?_[_0xe206('0x1f')](_0x5180c5[_0xe206('0x1e')],function(_0x409c31){return{'model':db[_0x409c31[_0xe206('0x21')]],'as':_0x409c31['as'],'attributes':_0x409c31[_0xe206('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe206('0x11')](function(_0x1cf319){logger[_0xe206('0x12')](_0xe206('0x22'),_0x1090d4);logger[_0xe206('0x23')]('ShowSmsAccount',_0x1090d4,JSON[_0xe206('0x24')](_0x1cf319));_0x380266(_0x1cf319);})[_0xe206('0x25')](function(_0x4dae4c){logger[_0xe206('0x15')](_0xe206('0x22'),_0x4dae4c[_0xe206('0x18')],_0x1090d4);_0x1c7848(_0x5377f0[_0xe206('0x15')](0x1f4,_0x4dae4c[_0xe206('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 9f695a9..2d04c72 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 db89a1c..4b0f4d9 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(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_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('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 _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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_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('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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d242735..6be86e0 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 _0xbed1=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x63d3f,_0x2d07df){var _0x1ebed8=function(_0x5db54a){while(--_0x5db54a){_0x63d3f['push'](_0x63d3f['shift']());}};_0x1ebed8(++_0x2d07df);}(_0xbed1,0x86));var _0x1bed=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xbed1[_0x34df4a];return _0x145c69;};'use strict';var Sequelize=require(_0x1bed('0x0'));module[_0x1bed('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1bed('0x2')],'allowNull':![],'defaultValue':_0x1bed('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1bed('0x2')]},'interval':{'type':Sequelize[_0x1bed('0x2')],'defaultValue':_0x1bed('0x4')}}; \ No newline at end of file +var _0x91f5=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91f5,0x162));var _0x591f=function(_0x18ac9d,_0x19b7c8){_0x18ac9d=_0x18ac9d-0x0;var _0x47909c=_0x91f5[_0x18ac9d];return _0x47909c;};'use strict';var Sequelize=require(_0x591f('0x0'));module[_0x591f('0x1')]={'priority':{'type':Sequelize[_0x591f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x591f('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x591f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x591f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 31728be..7a6c3b7 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 _0xc342=['find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsApplication','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xc342,0xf2));var _0x2c34=function(_0x4105a8,_0x198324){_0x4105a8=_0x4105a8-0x0;var _0x553f0c=_0xc342[_0x4105a8];return _0x553f0c;};'use strict';var emlformat=require(_0x2c34('0x0'));var rimraf=require(_0x2c34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c34('0x2'));var rp=require(_0x2c34('0x3'));var moment=require(_0x2c34('0x4'));var BPromise=require(_0x2c34('0x5'));var Mustache=require(_0x2c34('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2c34('0x7'));var csv=require('to-csv');var ejs=require(_0x2c34('0x8'));var fs=require('fs');var fs_extra=require(_0x2c34('0x9'));var _=require('lodash');var squel=require(_0x2c34('0xa'));var crypto=require('crypto');var jsforce=require(_0x2c34('0xb'));var deskjs=require(_0x2c34('0xc'));var toCsv=require(_0x2c34('0xd'));var querystring=require(_0x2c34('0xe'));var Papa=require(_0x2c34('0xf'));var Redis=require(_0x2c34('0x10'));var authService=require(_0x2c34('0x11'));var qs=require(_0x2c34('0x12'));var as=require(_0x2c34('0x13'));var hardwareService=require(_0x2c34('0x14'));var logger=require(_0x2c34('0x15'))(_0x2c34('0x16'));var utils=require(_0x2c34('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2c34('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4401a8,_0x5e963e){_0x5e963e=_0x5e963e||0xcc;return function(_0x1a9460){if(_0x1a9460){return _0x4401a8[_0x2c34('0x19')](_0x5e963e);}return _0x4401a8['status'](_0x5e963e)[_0x2c34('0x1a')]();};}function respondWithResult(_0x765f07,_0x46a796){_0x46a796=_0x46a796||0xc8;return function(_0x563d0b){if(_0x563d0b){return _0x765f07[_0x2c34('0x1b')](_0x46a796)[_0x2c34('0x1c')](_0x563d0b);}};}function respondWithFilteredResult(_0x3e26ba,_0x563785){return function(_0x5e176d){if(_0x5e176d){var _0x2dab62=typeof _0x563785[_0x2c34('0x1d')]===_0x2c34('0x1e')&&typeof _0x563785[_0x2c34('0x1f')]===_0x2c34('0x1e');var _0x4632fb=_0x5e176d['count'];var _0x2220dc=_0x2dab62?0x0:_0x563785[_0x2c34('0x1d')];var _0x188391=_0x2dab62?_0x5e176d[_0x2c34('0x20')]:_0x563785[_0x2c34('0x1d')]+_0x563785[_0x2c34('0x1f')];var _0x59e580;if(_0x188391>=_0x4632fb){_0x188391=_0x4632fb;_0x59e580=0xc8;}else{_0x59e580=0xce;}_0x3e26ba[_0x2c34('0x1b')](_0x59e580);return _0x3e26ba[_0x2c34('0x21')](_0x2c34('0x22'),_0x2220dc+'-'+_0x188391+'/'+_0x4632fb)[_0x2c34('0x1c')](_0x5e176d);}return null;};}function patchUpdates(_0x2fbc08){return function(_0x1ddb62){try{jsonpatch[_0x2c34('0x23')](_0x1ddb62,_0x2fbc08,!![]);}catch(_0x28abf9){return BPromise[_0x2c34('0x24')](_0x28abf9);}return _0x1ddb62[_0x2c34('0x25')]();};}function saveUpdates(_0x2074f8,_0x4705ae){return function(_0x56e33a){if(_0x56e33a){return _0x56e33a[_0x2c34('0x26')](_0x2074f8)[_0x2c34('0x27')](function(_0x185c73){return _0x185c73;});}return null;};}function removeEntity(_0x61aac6,_0x3ba9be){return function(_0x33f879){if(_0x33f879){return _0x33f879['destroy']()[_0x2c34('0x27')](function(){_0x61aac6['status'](0xcc)[_0x2c34('0x1a')]();});}};}function handleEntityNotFound(_0x2378ce,_0x11c0a5){return function(_0x25bc21){if(!_0x25bc21){_0x2378ce[_0x2c34('0x19')](0x194);}return _0x25bc21;};}function handleError(_0x117e94,_0x2af440){_0x2af440=_0x2af440||0x1f4;return function(_0x5320ef){logger[_0x2c34('0x28')](_0x5320ef[_0x2c34('0x29')]);if(_0x5320ef[_0x2c34('0x2a')]){delete _0x5320ef[_0x2c34('0x2a')];}_0x117e94[_0x2c34('0x1b')](_0x2af440)[_0x2c34('0x2b')](_0x5320ef);};}exports[_0x2c34('0x2c')]=function(_0x2b04ed,_0x1cbb1b){var _0x91a27e={},_0x21a2e4={},_0xf05908={'count':0x0,'rows':[]};var _0x4ef377=_[_0x2c34('0x2d')](db['SmsApplication'][_0x2c34('0x2e')],function(_0x40b6a4){return{'name':_0x40b6a4[_0x2c34('0x2f')],'type':_0x40b6a4[_0x2c34('0x30')][_0x2c34('0x31')]};});_0x21a2e4[_0x2c34('0x32')]=_[_0x2c34('0x2d')](_0x4ef377,_0x2c34('0x2a'));_0x21a2e4[_0x2c34('0x33')]=_[_0x2c34('0x34')](_0x2b04ed['query']);_0x21a2e4[_0x2c34('0x35')]=_[_0x2c34('0x36')](_0x21a2e4[_0x2c34('0x32')],_0x21a2e4[_0x2c34('0x33')]);_0x91a27e[_0x2c34('0x37')]=_[_0x2c34('0x36')](_0x21a2e4['model'],qs['fields'](_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x38')]));_0x91a27e[_0x2c34('0x37')]=_0x91a27e[_0x2c34('0x37')][_0x2c34('0x39')]?_0x91a27e[_0x2c34('0x37')]:_0x21a2e4[_0x2c34('0x32')];if(!_0x2b04ed['query'][_0x2c34('0x3a')](_0x2c34('0x3b'))){_0x91a27e[_0x2c34('0x1f')]=qs[_0x2c34('0x1f')](_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x1f')]);_0x91a27e[_0x2c34('0x1d')]=qs[_0x2c34('0x1d')](_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x1d')]);}_0x91a27e[_0x2c34('0x3c')]=qs[_0x2c34('0x3d')](_0x2b04ed['query'][_0x2c34('0x3d')]);_0x91a27e[_0x2c34('0x3e')]=qs['filters'](_[_0x2c34('0x3f')](_0x2b04ed['query'],_0x21a2e4['filters']),_0x4ef377);if(_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x40')]){_0x91a27e['where']=_['merge'](_0x91a27e[_0x2c34('0x3e')],{'$or':_[_0x2c34('0x2d')](_0x4ef377,function(_0x5a10e7){if(_0x5a10e7[_0x2c34('0x30')]!==_0x2c34('0x41')){var _0x2f34b2={};_0x2f34b2[_0x5a10e7['name']]={'$like':'%'+_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x40')]+'%'};return _0x2f34b2;}})});}_0x91a27e=_[_0x2c34('0x42')]({},_0x91a27e,_0x2b04ed[_0x2c34('0x43')]);var _0x592ddd={'where':_0x91a27e[_0x2c34('0x3e')]};return db[_0x2c34('0x44')][_0x2c34('0x20')](_0x592ddd)[_0x2c34('0x27')](function(_0x226edf){_0xf05908[_0x2c34('0x20')]=_0x226edf;if(_0x2b04ed[_0x2c34('0x33')][_0x2c34('0x45')]){_0x91a27e[_0x2c34('0x46')]=[{'all':!![]}];}return db[_0x2c34('0x44')][_0x2c34('0x47')](_0x91a27e);})[_0x2c34('0x27')](function(_0x35bc45){_0xf05908[_0x2c34('0x48')]=_0x35bc45;return _0xf05908;})[_0x2c34('0x27')](respondWithFilteredResult(_0x1cbb1b,_0x91a27e))[_0x2c34('0x49')](handleError(_0x1cbb1b,null));};exports[_0x2c34('0x4a')]=function(_0x2843a8,_0x1a7c13){var _0x4f77cc={'raw':!![],'where':{'id':_0x2843a8[_0x2c34('0x4b')]['id']}},_0x396d14={};_0x396d14[_0x2c34('0x32')]=_[_0x2c34('0x34')](db[_0x2c34('0x44')][_0x2c34('0x2e')]);_0x396d14['query']=_[_0x2c34('0x34')](_0x2843a8[_0x2c34('0x33')]);_0x396d14['filters']=_[_0x2c34('0x36')](_0x396d14[_0x2c34('0x32')],_0x396d14[_0x2c34('0x33')]);_0x4f77cc[_0x2c34('0x37')]=_['intersection'](_0x396d14[_0x2c34('0x32')],qs[_0x2c34('0x38')](_0x2843a8['query'][_0x2c34('0x38')]));_0x4f77cc[_0x2c34('0x37')]=_0x4f77cc['attributes'][_0x2c34('0x39')]?_0x4f77cc[_0x2c34('0x37')]:_0x396d14[_0x2c34('0x32')];if(_0x2843a8[_0x2c34('0x33')][_0x2c34('0x45')]){_0x4f77cc[_0x2c34('0x46')]=[{'all':!![]}];}_0x4f77cc=_[_0x2c34('0x42')]({},_0x4f77cc,_0x2843a8[_0x2c34('0x43')]);return db[_0x2c34('0x44')]['find'](_0x4f77cc)[_0x2c34('0x27')](handleEntityNotFound(_0x1a7c13,null))['then'](respondWithResult(_0x1a7c13,null))[_0x2c34('0x49')](handleError(_0x1a7c13,null));};exports[_0x2c34('0x4c')]=function(_0x2d0d08,_0xd3bf2){return db['SmsApplication']['create'](_0x2d0d08['body'],{})[_0x2c34('0x27')](respondWithResult(_0xd3bf2,0xc9))['catch'](handleError(_0xd3bf2,null));};exports[_0x2c34('0x26')]=function(_0x3896db,_0x38a82b){if(_0x3896db['body']['id']){delete _0x3896db[_0x2c34('0x4d')]['id'];}return db[_0x2c34('0x44')][_0x2c34('0x4e')]({'where':{'id':_0x3896db[_0x2c34('0x4b')]['id']}})[_0x2c34('0x27')](handleEntityNotFound(_0x38a82b,null))[_0x2c34('0x27')](saveUpdates(_0x3896db[_0x2c34('0x4d')],null))['then'](respondWithResult(_0x38a82b,null))[_0x2c34('0x49')](handleError(_0x38a82b,null));};exports[_0x2c34('0x4f')]=function(_0x11a9c2,_0x36ea1f){return db['SmsApplication']['find']({'where':{'id':_0x11a9c2[_0x2c34('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36ea1f,null))[_0x2c34('0x27')](removeEntity(_0x36ea1f,null))[_0x2c34('0x49')](handleError(_0x36ea1f,null));}; \ No newline at end of file +var _0x70fc=['attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','type','VIRTUAL','filter','SmsApplication','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','index','map','rawAttributes','fieldName','model','name','query','keys','intersection'];(function(_0xeeeb42,_0x56a3b8){var _0x4edc7f=function(_0x2075ac){while(--_0x2075ac){_0xeeeb42['push'](_0xeeeb42['shift']());}};_0x4edc7f(++_0x56a3b8);}(_0x70fc,0x1c8));var _0xc70f=function(_0x5e4b33,_0x1d62ae){_0x5e4b33=_0x5e4b33-0x0;var _0x55954c=_0x70fc[_0x5e4b33];return _0x55954c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc70f('0x0'));var zipdir=require(_0xc70f('0x1'));var jsonpatch=require(_0xc70f('0x2'));var rp=require(_0xc70f('0x3'));var moment=require(_0xc70f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc70f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc70f('0x6'));var ejs=require(_0xc70f('0x7'));var fs=require('fs');var fs_extra=require(_0xc70f('0x8'));var _=require(_0xc70f('0x9'));var squel=require(_0xc70f('0xa'));var crypto=require(_0xc70f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc70f('0xc'));var Papa=require(_0xc70f('0xd'));var Redis=require(_0xc70f('0xe'));var authService=require(_0xc70f('0xf'));var qs=require(_0xc70f('0x10'));var as=require(_0xc70f('0x11'));var hardwareService=require(_0xc70f('0x12'));var logger=require(_0xc70f('0x13'))(_0xc70f('0x14'));var utils=require('../../config/utils');var config=require(_0xc70f('0x15'));var licenseUtil=require(_0xc70f('0x16'));var db=require(_0xc70f('0x17'))['db'];function respondWithStatusCode(_0x3e0b41,_0x5abf62){_0x5abf62=_0x5abf62||0xcc;return function(_0x5ba8c7){if(_0x5ba8c7){return _0x3e0b41[_0xc70f('0x18')](_0x5abf62);}return _0x3e0b41[_0xc70f('0x19')](_0x5abf62)[_0xc70f('0x1a')]();};}function respondWithResult(_0x69eb35,_0x26a98e){_0x26a98e=_0x26a98e||0xc8;return function(_0x2280bc){if(_0x2280bc){return _0x69eb35[_0xc70f('0x19')](_0x26a98e)[_0xc70f('0x1b')](_0x2280bc);}};}function respondWithFilteredResult(_0xa98081,_0x43d224){return function(_0xb2c0f6){if(_0xb2c0f6){var _0x9a2cdc=typeof _0x43d224[_0xc70f('0x1c')]===_0xc70f('0x1d')&&typeof _0x43d224[_0xc70f('0x1e')]==='undefined';var _0xf15d3d=_0xb2c0f6[_0xc70f('0x1f')];var _0xcc6c25=_0x9a2cdc?0x0:_0x43d224[_0xc70f('0x1c')];var _0x363e41=_0x9a2cdc?_0xb2c0f6[_0xc70f('0x1f')]:_0x43d224[_0xc70f('0x1c')]+_0x43d224[_0xc70f('0x1e')];var _0x221865;if(_0x363e41>=_0xf15d3d){_0x363e41=_0xf15d3d;_0x221865=0xc8;}else{_0x221865=0xce;}_0xa98081['status'](_0x221865);return _0xa98081['set'](_0xc70f('0x20'),_0xcc6c25+'-'+_0x363e41+'/'+_0xf15d3d)[_0xc70f('0x1b')](_0xb2c0f6);}return null;};}function patchUpdates(_0x2eb1b5){return function(_0x2a5dce){try{jsonpatch[_0xc70f('0x21')](_0x2a5dce,_0x2eb1b5,!![]);}catch(_0x929933){return BPromise['reject'](_0x929933);}return _0x2a5dce[_0xc70f('0x22')]();};}function saveUpdates(_0x3af05f,_0x2d44ce){return function(_0x342a7d){if(_0x342a7d){return _0x342a7d[_0xc70f('0x23')](_0x3af05f)['then'](function(_0x44d621){return _0x44d621;});}return null;};}function removeEntity(_0x402bb6,_0x4d208b){return function(_0x332637){if(_0x332637){return _0x332637['destroy']()[_0xc70f('0x24')](function(){_0x402bb6[_0xc70f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x363a92,_0x2c56c6){return function(_0x3d6422){if(!_0x3d6422){_0x363a92[_0xc70f('0x18')](0x194);}return _0x3d6422;};}function handleError(_0x1bc68f,_0x3e4e3c){_0x3e4e3c=_0x3e4e3c||0x1f4;return function(_0x2b400e){logger[_0xc70f('0x25')](_0x2b400e[_0xc70f('0x26')]);if(_0x2b400e['name']){delete _0x2b400e['name'];}_0x1bc68f[_0xc70f('0x19')](_0x3e4e3c)['send'](_0x2b400e);};}exports[_0xc70f('0x27')]=function(_0x409100,_0x41cf2d){var _0x59981f={},_0x3d6aca={},_0x154cdf={'count':0x0,'rows':[]};var _0x344bb2=_[_0xc70f('0x28')](db['SmsApplication'][_0xc70f('0x29')],function(_0x4abb5a){return{'name':_0x4abb5a[_0xc70f('0x2a')],'type':_0x4abb5a['type']['key']};});_0x3d6aca[_0xc70f('0x2b')]=_[_0xc70f('0x28')](_0x344bb2,_0xc70f('0x2c'));_0x3d6aca[_0xc70f('0x2d')]=_[_0xc70f('0x2e')](_0x409100[_0xc70f('0x2d')]);_0x3d6aca['filters']=_[_0xc70f('0x2f')](_0x3d6aca[_0xc70f('0x2b')],_0x3d6aca[_0xc70f('0x2d')]);_0x59981f[_0xc70f('0x30')]=_[_0xc70f('0x2f')](_0x3d6aca[_0xc70f('0x2b')],qs['fields'](_0x409100[_0xc70f('0x2d')][_0xc70f('0x31')]));_0x59981f[_0xc70f('0x30')]=_0x59981f['attributes'][_0xc70f('0x32')]?_0x59981f[_0xc70f('0x30')]:_0x3d6aca['model'];if(!_0x409100[_0xc70f('0x2d')][_0xc70f('0x33')]('nolimit')){_0x59981f[_0xc70f('0x1e')]=qs[_0xc70f('0x1e')](_0x409100[_0xc70f('0x2d')][_0xc70f('0x1e')]);_0x59981f['offset']=qs[_0xc70f('0x1c')](_0x409100[_0xc70f('0x2d')][_0xc70f('0x1c')]);}_0x59981f[_0xc70f('0x34')]=qs[_0xc70f('0x35')](_0x409100['query'][_0xc70f('0x35')]);_0x59981f[_0xc70f('0x36')]=qs[_0xc70f('0x37')](_[_0xc70f('0x38')](_0x409100[_0xc70f('0x2d')],_0x3d6aca[_0xc70f('0x37')]),_0x344bb2);if(_0x409100[_0xc70f('0x2d')]['filter']){_0x59981f[_0xc70f('0x36')]=_['merge'](_0x59981f['where'],{'$or':_['map'](_0x344bb2,function(_0x490abf){if(_0x490abf[_0xc70f('0x39')]!==_0xc70f('0x3a')){var _0x145289={};_0x145289[_0x490abf[_0xc70f('0x2c')]]={'$like':'%'+_0x409100[_0xc70f('0x2d')][_0xc70f('0x3b')]+'%'};return _0x145289;}})});}_0x59981f=_['merge']({},_0x59981f,_0x409100['options']);var _0x411837={'where':_0x59981f[_0xc70f('0x36')]};return db[_0xc70f('0x3c')]['count'](_0x411837)[_0xc70f('0x24')](function(_0x1ad2b2){_0x154cdf['count']=_0x1ad2b2;if(_0x409100['query'][_0xc70f('0x3d')]){_0x59981f[_0xc70f('0x3e')]=[{'all':!![]}];}return db[_0xc70f('0x3c')][_0xc70f('0x3f')](_0x59981f);})['then'](function(_0x33f2bd){_0x154cdf[_0xc70f('0x40')]=_0x33f2bd;return _0x154cdf;})['then'](respondWithFilteredResult(_0x41cf2d,_0x59981f))[_0xc70f('0x41')](handleError(_0x41cf2d,null));};exports[_0xc70f('0x42')]=function(_0x174661,_0x54ea89){var _0x320b55={'raw':!![],'where':{'id':_0x174661[_0xc70f('0x43')]['id']}},_0x3146fd={};_0x3146fd['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x3146fd['query']=_[_0xc70f('0x2e')](_0x174661[_0xc70f('0x2d')]);_0x3146fd[_0xc70f('0x37')]=_[_0xc70f('0x2f')](_0x3146fd[_0xc70f('0x2b')],_0x3146fd[_0xc70f('0x2d')]);_0x320b55['attributes']=_['intersection'](_0x3146fd[_0xc70f('0x2b')],qs[_0xc70f('0x31')](_0x174661[_0xc70f('0x2d')]['fields']));_0x320b55[_0xc70f('0x30')]=_0x320b55[_0xc70f('0x30')][_0xc70f('0x32')]?_0x320b55['attributes']:_0x3146fd[_0xc70f('0x2b')];if(_0x174661['query'][_0xc70f('0x3d')]){_0x320b55['include']=[{'all':!![]}];}_0x320b55=_['merge']({},_0x320b55,_0x174661[_0xc70f('0x44')]);return db[_0xc70f('0x3c')][_0xc70f('0x45')](_0x320b55)[_0xc70f('0x24')](handleEntityNotFound(_0x54ea89,null))['then'](respondWithResult(_0x54ea89,null))[_0xc70f('0x41')](handleError(_0x54ea89,null));};exports[_0xc70f('0x46')]=function(_0x417578,_0x8437ef){return db[_0xc70f('0x3c')][_0xc70f('0x46')](_0x417578[_0xc70f('0x47')],{})[_0xc70f('0x24')](respondWithResult(_0x8437ef,0xc9))[_0xc70f('0x41')](handleError(_0x8437ef,null));};exports[_0xc70f('0x23')]=function(_0x110c9e,_0xce7272){if(_0x110c9e[_0xc70f('0x47')]['id']){delete _0x110c9e['body']['id'];}return db[_0xc70f('0x3c')][_0xc70f('0x45')]({'where':{'id':_0x110c9e[_0xc70f('0x43')]['id']}})[_0xc70f('0x24')](handleEntityNotFound(_0xce7272,null))[_0xc70f('0x24')](saveUpdates(_0x110c9e[_0xc70f('0x47')],null))[_0xc70f('0x24')](respondWithResult(_0xce7272,null))['catch'](handleError(_0xce7272,null));};exports['destroy']=function(_0x2e9a18,_0x232724){return db[_0xc70f('0x3c')][_0xc70f('0x45')]({'where':{'id':_0x2e9a18[_0xc70f('0x43')]['id']}})['then'](handleEntityNotFound(_0x232724,null))[_0xc70f('0x24')](removeEntity(_0x232724,null))['catch'](handleError(_0x232724,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index afaa7db..f0dbdd7 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 _0xe3ae=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3ae,0xdc));var _0xee3a=function(_0xb22b4b,_0x564a03){_0xb22b4b=_0xb22b4b-0x0;var _0x145a36=_0xe3ae[_0xb22b4b];return _0x145a36;};'use strict';var _=require(_0xee3a('0x0'));var util=require(_0xee3a('0x1'));var logger=require('../../config/logger')(_0xee3a('0x2'));var moment=require('moment');var BPromise=require(_0xee3a('0x3'));var rp=require(_0xee3a('0x4'));var fs=require('fs');var path=require(_0xee3a('0x5'));var rimraf=require(_0xee3a('0x6'));var config=require(_0xee3a('0x7'));var attributes=require(_0xee3a('0x8'));module[_0xee3a('0x9')]=function(_0x3788f7,_0x19937c){return _0x3788f7['define'](_0xee3a('0xa'),attributes,{'tableName':_0xee3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee3a('0xc'),'collate':_0xee3a('0xd')});}; \ No newline at end of file +var _0xfdc8=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x3d7790,_0x3284bf){var _0x43d187=function(_0x2dff3d){while(--_0x2dff3d){_0x3d7790['push'](_0x3d7790['shift']());}};_0x43d187(++_0x3284bf);}(_0xfdc8,0xd6));var _0x8fdc=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xfdc8[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x8fdc('0x0'));var util=require(_0x8fdc('0x1'));var logger=require(_0x8fdc('0x2'))('api');var moment=require(_0x8fdc('0x3'));var BPromise=require(_0x8fdc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fdc('0x5'));var config=require(_0x8fdc('0x6'));var attributes=require(_0x8fdc('0x7'));module[_0x8fdc('0x8')]=function(_0x745cb,_0x50082f){return _0x745cb[_0x8fdc('0x9')](_0x8fdc('0xa'),attributes,{'tableName':_0x8fdc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fdc('0xc'),'collate':_0x8fdc('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index ab89691..ebe58ae 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 _0xa413=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info'];(function(_0x550eb7,_0x465856){var _0x33bffe=function(_0x171208){while(--_0x171208){_0x550eb7['push'](_0x550eb7['shift']());}};_0x33bffe(++_0x465856);}(_0xa413,0x1e5));var _0x3a41=function(_0x1b065a,_0x58c71b){_0x1b065a=_0x1b065a-0x0;var _0x156a8a=_0xa413[_0x1b065a];return _0x156a8a;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f6d2,_0x407d52,_0xca7253){return new BPromise(function(_0x473cd2,_0x27c2e5){return client['request'](_0x45f6d2,_0xca7253)[_0x3a41('0xa')](function(_0x570304){logger['info']('SmsApplication,\x20%s,\x20%s',_0x407d52,_0x3a41('0xb'));logger['debug'](_0x3a41('0xc'),_0x407d52,'request\x20sent',JSON[_0x3a41('0xd')](_0x570304));if(_0x570304[_0x3a41('0xe')]){if(_0x570304['error'][_0x3a41('0xf')]===0x1f4){logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x27c2e5(_0x570304['error'][_0x3a41('0x11')]);}logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x473cd2(_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);}else{logger[_0x3a41('0x12')](_0x3a41('0x10'),_0x407d52,_0x3a41('0xb'));_0x473cd2(_0x570304[_0x3a41('0x13')]['message']);}})[_0x3a41('0x14')](function(_0x30d675){logger['error']('SmsApplication,\x20%s,\x20%s',_0x407d52,_0x30d675);_0x27c2e5(_0x30d675);});});} \ No newline at end of file +var _0x94d4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x27e870,_0x7c2108){var _0x1843c1=function(_0x3c17f4){while(--_0x3c17f4){_0x27e870['push'](_0x27e870['shift']());}};_0x1843c1(++_0x7c2108);}(_0x94d4,0xa5));var _0x494d=function(_0x2ddbf0,_0xad6c39){_0x2ddbf0=_0x2ddbf0-0x0;var _0x14f9b0=_0x94d4[_0x2ddbf0];return _0x14f9b0;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var moment=require('moment');var BPromise=require(_0x494d('0x2'));var rs=require(_0x494d('0x3'));var fs=require('fs');var Redis=require(_0x494d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x494d('0x5'));var logger=require(_0x494d('0x6'))(_0x494d('0x7'));var config=require(_0x494d('0x8'));var jayson=require(_0x494d('0x9'));var client=jayson[_0x494d('0xa')][_0x494d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c53d7,_0x4f4576,_0x5269db){return new BPromise(function(_0x396280,_0x3f6b68){return client['request'](_0x4c53d7,_0x5269db)['then'](function(_0x456fe8){logger[_0x494d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));logger[_0x494d('0xe')](_0x494d('0xf'),_0x4f4576,_0x494d('0xd'),JSON['stringify'](_0x456fe8));if(_0x456fe8[_0x494d('0x10')]){if(_0x456fe8[_0x494d('0x10')]['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x3f6b68(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x396280(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}else{logger[_0x494d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));_0x396280(_0x456fe8[_0x494d('0x13')][_0x494d('0x11')]);}})[_0x494d('0x14')](function(_0x120488){logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x120488);_0x3f6b68(_0x120488);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2d6ea2b..e0ccd4a 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 _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router; \ No newline at end of file +var _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0x1eba[_0x1d211b];return _0x47c88b;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index c9d83e1..cfc3acb 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 _0x5031=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x36d031,_0x146ec1){var _0x2f0b3c=function(_0x5a813c){while(--_0x5a813c){_0x36d031['push'](_0x36d031['shift']());}};_0x2f0b3c(++_0x146ec1);}(_0x5031,0x144));var _0x1503=function(_0x3f0aec,_0x4af277){_0x3f0aec=_0x3f0aec-0x0;var _0x4beb61=_0x5031[_0x3f0aec];return _0x4beb61;};'use strict';var Sequelize=require(_0x1503('0x0'));var moment=require(_0x1503('0x1'));module[_0x1503('0x2')]={'closed':{'type':Sequelize[_0x1503('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1503('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1503('0x5')]},'note':{'type':Sequelize[_0x1503('0x5')]},'phone':{'type':Sequelize[_0x1503('0x5')]},'read1stAt':{'type':Sequelize[_0x1503('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1503('0x6')]('in',_0x1503('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1503('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1503('0x6')]('in',_0x1503('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x539d=['ENUM','sequelize','exports','BOOLEAN','STRING','DATE','out'];(function(_0x2c6047,_0x485481){var _0x5a9f17=function(_0x505fe8){while(--_0x505fe8){_0x2c6047['push'](_0x2c6047['shift']());}};_0x5a9f17(++_0x485481);}(_0x539d,0x17b));var _0xd539=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x539d[_0x1064bc];return _0x5edc45;};'use strict';var Sequelize=require(_0xd539('0x0'));var moment=require('moment');module[_0xd539('0x1')]={'closed':{'type':Sequelize[_0xd539('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd539('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd539('0x3')]},'note':{'type':Sequelize[_0xd539('0x3')]},'phone':{'type':Sequelize[_0xd539('0x3')]},'read1stAt':{'type':Sequelize[_0xd539('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd539('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd539('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd539('0x6')]('in',_0xd539('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd539('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 41f88a5..8255b18 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 _0x4fed=['query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','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','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','find','unreadMessages','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','SmsAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','toString','count','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','show','include','merge','options','create','params','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','filter','includeAll','rows','addTags','spread','Tag','findAll','emit','smsInteractionTags:save','removeTags','download','root','server','files','tmp','attachments','join','format','CmContact','firstName','direction','read','SmsAccount','Account','get','Sms','Owner','fullname','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','out','System','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','stack','name','send','Tags','TagIds','split','forEach','catch','waiting','talking','total','closed','UserId','answered','unmanaged','index','SmsInteraction','rawAttributes','type','key','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fed,0xab));var _0xd4fe=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x4fed[_0x334651];return _0x29657c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd4fe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd4fe('0x1'));var moment=require(_0xd4fe('0x2'));var BPromise=require(_0xd4fe('0x3'));var Mustache=require('mustache');var util=require(_0xd4fe('0x4'));var path=require(_0xd4fe('0x5'));var sox=require('sox');var csv=require(_0xd4fe('0x6'));var ejs=require(_0xd4fe('0x7'));var fs=require('fs');var fs_extra=require(_0xd4fe('0x8'));var _=require('lodash');var squel=require(_0xd4fe('0x9'));var crypto=require(_0xd4fe('0xa'));var jsforce=require(_0xd4fe('0xb'));var deskjs=require(_0xd4fe('0xc'));var toCsv=require(_0xd4fe('0x6'));var querystring=require(_0xd4fe('0xd'));var Papa=require(_0xd4fe('0xe'));var Redis=require('ioredis');var authService=require(_0xd4fe('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd4fe('0x10'));var pdf=require(_0xd4fe('0x11'));var hardwareService=require(_0xd4fe('0x12'));var logger=require(_0xd4fe('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd4fe('0x14'));var db=require(_0xd4fe('0x15'))['db'];config[_0xd4fe('0x16')]=_['defaults'](config[_0xd4fe('0x16')],{'host':_0xd4fe('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4fe('0x16')]));require(_0xd4fe('0x18'))[_0xd4fe('0x19')](socket);function respondWithStatusCode(_0x192d44,_0x268426){_0x268426=_0x268426||0xcc;return function(_0x485709){if(_0x485709){return _0x192d44[_0xd4fe('0x1a')](_0x268426);}return _0x192d44[_0xd4fe('0x1b')](_0x268426)[_0xd4fe('0x1c')]();};}function respondWithResult(_0x96ede2,_0x5e9222){_0x5e9222=_0x5e9222||0xc8;return function(_0xd3584f){if(_0xd3584f){return _0x96ede2[_0xd4fe('0x1b')](_0x5e9222)[_0xd4fe('0x1d')](_0xd3584f);}};}function respondWithFilteredResult(_0x7f0cf6,_0x526e29){return function(_0x20e749){if(_0x20e749){var _0x3c6a9b=typeof _0x526e29[_0xd4fe('0x1e')]==='undefined'&&typeof _0x526e29['limit']===_0xd4fe('0x1f');var _0x2f2625=_0x20e749['count'];var _0x19fbf8=_0x3c6a9b?0x0:_0x526e29[_0xd4fe('0x1e')];var _0x4d1892=_0x3c6a9b?_0x20e749['count']:_0x526e29[_0xd4fe('0x1e')]+_0x526e29[_0xd4fe('0x20')];var _0x88d655;if(_0x4d1892>=_0x2f2625){_0x4d1892=_0x2f2625;_0x88d655=0xc8;}else{_0x88d655=0xce;}_0x7f0cf6['status'](_0x88d655);return _0x7f0cf6[_0xd4fe('0x21')](_0xd4fe('0x22'),_0x19fbf8+'-'+_0x4d1892+'/'+_0x2f2625)[_0xd4fe('0x1d')](_0x20e749);}return null;};}function patchUpdates(_0x46ba47){return function(_0x174732){try{jsonpatch['apply'](_0x174732,_0x46ba47,!![]);}catch(_0x34bda3){return BPromise['reject'](_0x34bda3);}return _0x174732['save']();};}function saveUpdates(_0x10b3a4,_0x3cd5ed){return function(_0xf1cdf0){if(_0xf1cdf0){return _0xf1cdf0[_0xd4fe('0x23')](_0x10b3a4)[_0xd4fe('0x24')](function(_0x21c0d3){return _0x21c0d3;});}return null;};}function removeEntity(_0x3ba0c6,_0xe76854){return function(_0x4840e7){if(_0x4840e7){return _0x4840e7[_0xd4fe('0x25')]()[_0xd4fe('0x24')](function(){_0x3ba0c6[_0xd4fe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8dab1,_0x964ff0){return function(_0x11b6fb){if(!_0x11b6fb){_0x8dab1[_0xd4fe('0x1a')](0x194);}return _0x11b6fb;};}function handleError(_0x500d17,_0x1a0d0e){_0x1a0d0e=_0x1a0d0e||0x1f4;return function(_0x264329){logger[_0xd4fe('0x26')](_0x264329[_0xd4fe('0x27')]);if(_0x264329[_0xd4fe('0x28')]){delete _0x264329[_0xd4fe('0x28')];}_0x500d17[_0xd4fe('0x1b')](_0x1a0d0e)[_0xd4fe('0x29')](_0x264329);};}function getInteractionUsers(_0x203bc1,_0x578ce0){return new BPromise(function(_0x1751b3,_0x2dafc6){try{if(_0x578ce0[_0x203bc1['id']]){_0x203bc1['Users']=_['map'](_0x578ce0[_0x203bc1['id']],function(_0x5afd3a){return{'id':_0x5afd3a['id'],'fullname':_0x5afd3a['fullname']};});}}catch(_0x3d73d6){_0x2dafc6(_0x3d73d6);}_0x1751b3(_0x203bc1);});}function getInteractionTags(_0x52fa63,_0x1349b7){return new BPromise(function(_0x5e55fb,_0xc77c02){try{if(_0x52fa63['TagIds']){_0x52fa63[_0xd4fe('0x2a')]=[];_0x52fa63[_0xd4fe('0x2b')][_0xd4fe('0x2c')](',')[_0xd4fe('0x2d')](function(_0x5c8d9c){_0x52fa63[_0xd4fe('0x2a')]['push'](_0x1349b7[_0x5c8d9c]);});}delete _0x52fa63['TagIds'];}catch(_0x3204cd){_0xc77c02(_0x3204cd);}_0x5e55fb(_0x52fa63);});}function updateSmsInteraction(_0x22ff12,_0x53df86,_0x1c54f6){return new BPromise(function(_0x42bef6,_0x2ea124){return getInteractionUsers(_0x22ff12,_0x1c54f6)[_0xd4fe('0x24')](function(_0x1a71f0){return getInteractionTags(_0x1a71f0,_0x53df86);})[_0xd4fe('0x24')](function(_0xe9e3c1){return getStateInteraction(_0xe9e3c1);})['then'](function(_0xdf7c7e){_0x42bef6(_0xdf7c7e);})[_0xd4fe('0x2e')](function(_0x33630d){_0x2ea124(_0x33630d);});});}function getStateInteraction(_0x496a41){return new BPromise(function(_0x300125){_0x496a41[_0xd4fe('0x2f')]=0x0;_0x496a41[_0xd4fe('0x30')]=0x0;_0x496a41['answered']=0x0;_0x496a41['unmanaged']=0x0;_0x496a41[_0xd4fe('0x31')]=0x0;if(!_0x496a41[_0xd4fe('0x32')]&&!_0x496a41['UserId']){_0x496a41[_0xd4fe('0x2f')]+=0x1;}if(!_0x496a41[_0xd4fe('0x32')]&&_0x496a41[_0xd4fe('0x33')]){_0x496a41[_0xd4fe('0x30')]+=0x1;if(_0x496a41['waiting']){_0x496a41[_0xd4fe('0x2f')]-=0x1;}}if(_0x496a41['closed']&&_0x496a41[_0xd4fe('0x33')]){_0x496a41[_0xd4fe('0x34')]+=0x1;if(_0x496a41[_0xd4fe('0x30')]){_0x496a41[_0xd4fe('0x30')]-=0x1;}}if(_0x496a41['closed']&&!_0x496a41[_0xd4fe('0x33')]){_0x496a41[_0xd4fe('0x35')]+=0x1;if(_0x496a41['waiting']){_0x496a41[_0xd4fe('0x2f')]-=0x1;}}_0x496a41[_0xd4fe('0x31')]+=0x1;_0x300125(_0x496a41);});}exports[_0xd4fe('0x36')]=function(_0x1940ec,_0x398c70){var _0x2c1888={},_0x5086d0={},_0x27bc6d={'count':0x0,'rows':[]};var _0x462c3f=_['map'](db[_0xd4fe('0x37')][_0xd4fe('0x38')],function(_0x13b887){return{'name':_0x13b887['fieldName'],'type':_0x13b887[_0xd4fe('0x39')][_0xd4fe('0x3a')]};});_0x5086d0['model']=_[_0xd4fe('0x3b')](_0x462c3f,'name');_0x5086d0[_0xd4fe('0x3c')]=_[_0xd4fe('0x3d')](_0x1940ec[_0xd4fe('0x3c')]);_0x5086d0['filters']=_[_0xd4fe('0x3e')](_0x5086d0[_0xd4fe('0x3f')],_0x5086d0['query']);_0x2c1888[_0xd4fe('0x40')]=_[_0xd4fe('0x3e')](_0x5086d0[_0xd4fe('0x3f')],qs[_0xd4fe('0x41')](_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x41')]));_0x2c1888[_0xd4fe('0x40')]=_0x2c1888[_0xd4fe('0x40')][_0xd4fe('0x42')]?_0x2c1888['attributes']:_0x5086d0[_0xd4fe('0x3f')];if(!_0x1940ec[_0xd4fe('0x3c')]['hasOwnProperty'](_0xd4fe('0x43'))){_0x2c1888[_0xd4fe('0x20')]=qs[_0xd4fe('0x20')](_0x1940ec['query'][_0xd4fe('0x20')]);_0x2c1888[_0xd4fe('0x1e')]=qs['offset'](_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x1e')]);}_0x2c1888[_0xd4fe('0x44')]=qs[_0xd4fe('0x45')](_0x1940ec[_0xd4fe('0x3c')]['sort']);_0x2c1888[_0xd4fe('0x46')]=qs[_0xd4fe('0x47')](_[_0xd4fe('0x48')](_0x1940ec['query'],_0x5086d0[_0xd4fe('0x47')]),_0x462c3f);var _0x1a6ef0=[];var _0x969a6=squel[_0xd4fe('0x49')]()[_0xd4fe('0x4a')]('id')[_0xd4fe('0x4a')](_0xd4fe('0x28'))[_0xd4fe('0x4a')](_0xd4fe('0x4b'))[_0xd4fe('0x4c')](_0xd4fe('0x4d'));var _0x2a0007=squel['select']()['field'](_0xd4fe('0x4e'))[_0xd4fe('0x4a')](_0xd4fe('0x4f'))[_0xd4fe('0x4a')](_0xd4fe('0x50'))['from'](_0xd4fe('0x51'),'ui')['left_join'](_0xd4fe('0x52'),'u',_0xd4fe('0x53'));var _0x587d59=squel[_0xd4fe('0x49')]()[_0xd4fe('0x4c')](_0xd4fe('0x54'),'i')['left_join'](_0xd4fe('0x55'),'c',_0xd4fe('0x56'))[_0xd4fe('0x57')](_0xd4fe('0x52'),'o',_0xd4fe('0x58'))[_0xd4fe('0x57')](_0xd4fe('0x59'),'a',_0xd4fe('0x5a'))[_0xd4fe('0x57')](_0xd4fe('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xd4fe('0x57')](_0xd4fe('0x5c'),'it',_0xd4fe('0x5d'))[_0xd4fe('0x57')](_0xd4fe('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x593906=squel[_0xd4fe('0x5e')]();var _0x17074e=[];var _0x83f402=squel[_0xd4fe('0x5e')]();var _0xb2a277;if(_0x1940ec['query'][_0xd4fe('0x5f')]){_0xb2a277=as[_0xd4fe('0x60')](_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x5f')]);var _0x176060=_0xb2a277[_0xd4fe('0x61')];for(var _0x3daa80=0x0;_0x3daa80<_0xb2a277['conditions'][_0xd4fe('0x42')];_0x3daa80++){var _0x5439a4=_0xb2a277['conditions'][_0x3daa80];var _0x381119='i';var _0x1b909e=_[_0xd4fe('0x62')](_0x462c3f,[_0xd4fe('0x28'),_0x5439a4[_0xd4fe('0x4a')]]);if(!_0x1b909e){switch(_0x5439a4[_0xd4fe('0x4a')]){case _0xd4fe('0x63'):if(_0x5439a4['value']==0x1){_0x587d59['having']('`'+_0x5439a4[_0xd4fe('0x4a')]+_0xd4fe('0x64'));}else{_0x587d59['having']('`'+_0x5439a4[_0xd4fe('0x4a')]+_0xd4fe('0x65'));}break;case _0xd4fe('0x66'):if(_0x5439a4['operator']===_0xd4fe('0x67')){if(_0x5439a4['value'][_0xd4fe('0x2c')]('\x20')['length']>0x1){_0x593906[_0x176060](_0xd4fe('0x68'),qs[_0xd4fe('0x69')](_0x5439a4[_0xd4fe('0x6a')]),null);}else{var _0x378eef='%'+_0x5439a4[_0xd4fe('0x6a')]+'%';_0x593906[_0x176060](_0xd4fe('0x6b'),_0x378eef,_0x378eef,_0x378eef);}}else{_0x1b909e=_[_0xd4fe('0x62')](_0x462c3f,['name',_0xd4fe('0x6c')]);_0x5439a4[_0xd4fe('0x4a')]='ContactId';_0x444b29=as[_0xd4fe('0x6d')](_0x381119,_0x1b909e['type'],_0x5439a4);_0x593906[_0x176060](_0x444b29[_0xd4fe('0x6e')],_0x444b29[_0xd4fe('0x6a')][_0xd4fe('0x6f')],_0x444b29['value'][_0xd4fe('0x1c')]);}break;case'Tag':var _0x2eaab6=_0x5439a4['value']['split'](',')['map'](function(_0x883c19){return Number(_0x883c19);});_0x2eaab6[_0xd4fe('0x2d')](function(_0x1731a5){_0x83f402['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1731a5+',%');});_0x17074e=_[_0xd4fe('0x70')](_0x17074e,_0x2eaab6);break;case _0xd4fe('0x71'):if(_0x5439a4['operator']===_0xd4fe('0x67')){_0x593906[_0x176060](_0xd4fe('0x72'),'%'+_0x5439a4[_0xd4fe('0x6a')]+'%',null);}else{_0x1b909e=_[_0xd4fe('0x62')](_0x462c3f,[_0xd4fe('0x28'),_0xd4fe('0x33')]);_0x5439a4[_0xd4fe('0x4a')]=_0xd4fe('0x33');_0x444b29=as[_0xd4fe('0x6d')](_0x381119,_0x1b909e['type'],_0x5439a4);_0x593906[_0x176060](_0x444b29[_0xd4fe('0x6e')],_0x444b29[_0xd4fe('0x6a')][_0xd4fe('0x6f')],_0x444b29[_0xd4fe('0x6a')]['end']);}break;case _0xd4fe('0x73'):_0x444b29=as[_0xd4fe('0x6d')]('me',null,_0x5439a4);_0x593906[_0x176060](_0x444b29[_0xd4fe('0x6e')],_0x444b29[_0xd4fe('0x6a')]['start'],_0x444b29[_0xd4fe('0x6a')][_0xd4fe('0x1c')]);break;}}else{var _0x444b29=as[_0xd4fe('0x6d')](_0x381119,_0x1b909e[_0xd4fe('0x39')],_0x5439a4);_0x593906[_0x176060](_0x444b29['text'],_0x444b29[_0xd4fe('0x6a')][_0xd4fe('0x6f')],_0x444b29[_0xd4fe('0x6a')][_0xd4fe('0x1c')]);}}}else{var _0x5e83c5=_(_0x1940ec[_0xd4fe('0x3c')])[_0xd4fe('0x3d')]()[_0xd4fe('0x3b')](function(_0xd5f0c){return _[_0xd4fe('0x74')](_0x462c3f,[_0xd4fe('0x28'),_0xd5f0c])?_0xd5f0c:undefined;})[_0xd4fe('0x75')]()[_0xd4fe('0x6a')]();if(!_['isEmpty'](_0x5e83c5)){_0x5e83c5['forEach'](function(_0x995824){if(_0x995824===_0xd4fe('0x76')){_0x587d59[_0xd4fe('0x46')]('i.SmsAccountId\x20IN\x20?',[][_0xd4fe('0x77')](_0x1940ec[_0xd4fe('0x3c')][_0x995824]));}else if(_0x995824===_0xd4fe('0x78')){var _0x2ebc76=JSON[_0xd4fe('0x79')](_0x1940ec[_0xd4fe('0x3c')][_0x995824])[_0xd4fe('0x7a')];var _0x5f53f1=JSON[_0xd4fe('0x79')](_0x1940ec[_0xd4fe('0x3c')][_0x995824])[_0xd4fe('0x7b')];_0x587d59[_0xd4fe('0x46')](_0xd4fe('0x7c'),_0x2ebc76,_0x5f53f1);}else{if(_0x1940ec[_0xd4fe('0x3c')][_0x995824]==='null'){_0x587d59[_0xd4fe('0x46')]('i.'+_0x995824+'\x20IS\x20NULL');}else{_0x587d59['where']('i.'+_0x995824+'\x20=\x20?',_0x1940ec['query'][_0x995824]);}}});}if(_0x1940ec[_0xd4fe('0x3c')]['read']){if(_0x1940ec['query']['read']==0x1){_0x587d59['having'](_0xd4fe('0x7d'));}else{_0x587d59['having'](_0xd4fe('0x7e'));}}if(_0x1940ec[_0xd4fe('0x3c')]['tag']){_0x17074e=_['isArray'](_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x7f')])?_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x7f')]:new Array(_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x7f')]);_0x17074e[_0xd4fe('0x2d')](function(_0x5bbc04){_0x83f402['or'](_0xd4fe('0x80'),'%,'+_0x5bbc04+',%');});}if(_0x1940ec['query']['filter']){var _0x266923=_0x1940ec[_0xd4fe('0x3c')]['filter']['replace']('\x5c','\x5c\x5c')[_0xd4fe('0x81')](/'/g,'\x27\x27');if(qs[_0xd4fe('0x82')](_0x266923)){_0x593906['or']('i.id\x20LIKE\x20?',_0x266923+'%')['or'](_0xd4fe('0x83'),_0x266923+'%');}else{_0x593906['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd4fe('0x69')](_0x266923))['or'](_0xd4fe('0x84'),_0x266923+'%');}}}_0x587d59['where'](_0x593906);_0x587d59[_0xd4fe('0x85')]('i.id');var _0x296782={'type':db[_0xd4fe('0x86')]['QueryTypes'][_0xd4fe('0x87')],'raw':!![]};var _0x2551c5=_0x587d59[_0xd4fe('0x88')]();_0x2551c5[_0xd4fe('0x4a')](_0xd4fe('0x89'));_0x2551c5['field'](_0xd4fe('0x8a'),'unreadMessages');if(_0x2c1888['order']){_0x2c1888[_0xd4fe('0x44')][_0xd4fe('0x2d')](function(_0x378c6b){var _0x1f89cc=_0x378c6b[0x0]===_0xd4fe('0x8b')?_0x378c6b[0x0]:'i.'+_0x378c6b[0x0];_0x587d59[_0xd4fe('0x44')](_0x1f89cc,_0x378c6b[0x1]===_0xd4fe('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x17074e)){_0x587d59['having'](_0x83f402);_0x2551c5[_0xd4fe('0x46')]('t.id\x20IN\x20?',_0x17074e);}BPromise[_0xd4fe('0x8d')]()['then'](function(){if(!_0xb2a277){if(_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x76')])return;_0x2551c5[_0xd4fe('0x46')](_0xd4fe('0x8e'));_0x587d59[_0xd4fe('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1940ec[_0xd4fe('0x8f')]['role']!==_0xd4fe('0x90'))return;return _0x1940ec[_0xd4fe('0x8f')][_0xd4fe('0x91')]({'attributes':['id'],'raw':!![]})[_0xd4fe('0x24')](function(_0x16364f){if(_[_0xd4fe('0x92')](_0x16364f)){_0x2551c5[_0xd4fe('0x46')](_0xd4fe('0x93'));_0x587d59['where'](_0xd4fe('0x93'));}else{_0x2551c5[_0xd4fe('0x46')](_0xd4fe('0x94'),_[_0xd4fe('0x3b')](_0x16364f,'id'));_0x587d59[_0xd4fe('0x46')](_0xd4fe('0x94'),_[_0xd4fe('0x3b')](_0x16364f,'id'));}});})[_0xd4fe('0x24')](function(){if(_0x1940ec[_0xd4fe('0x8f')]['role']===_0xd4fe('0x90')&&!_0xb2a277&&!_0x1940ec[_0xd4fe('0x3c')]['SmsAccountId'])return[];return db['sequelize'][_0xd4fe('0x3c')](_0x2551c5[_0xd4fe('0x95')](),_0x296782);})[_0xd4fe('0x24')](function(_0x4af652){_0x27bc6d[_0xd4fe('0x96')]=_0x4af652[_0xd4fe('0x42')];if(_0x27bc6d[_0xd4fe('0x96')]===0x0)return[];return db['sequelize'][_0xd4fe('0x3c')](_0x969a6[_0xd4fe('0x95')](),_0x296782)['then'](function(_0x4331cb){_0x1a6ef0=_['keyBy'](_0x4331cb,'id');_0x296782=_['merge'](_0x296782,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1940ec[_0xd4fe('0x3c')][_0xd4fe('0x41')]){_0x2c1888['attributes'][_0xd4fe('0x2d')](function(_0x517d52){_0x587d59['field']('i.'+_0x517d52);});}else{_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0x8a'),_0xd4fe('0x63'));_0x587d59['field']('a.key','Account.key');_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0x97'),_0xd4fe('0x98'));_0x587d59['field'](_0xd4fe('0x99'),_0xd4fe('0x8b'));_0x587d59[_0xd4fe('0x4a')]('i.*');_0x587d59['field']('c.firstName',_0xd4fe('0x9a'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0x9b'),_0xd4fe('0x9c'));_0x587d59['field'](_0xd4fe('0x9d'),_0xd4fe('0x9e'));_0x587d59[_0xd4fe('0x4a')]('c.phone',_0xd4fe('0x9f'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0xa0'),_0xd4fe('0xa1'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0xa2'),_0xd4fe('0xa3'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0xa4'),_0xd4fe('0xa5'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0xa6'),_0xd4fe('0xa7'));_0x587d59[_0xd4fe('0x4a')](_0xd4fe('0xa8'),_0xd4fe('0x2b'));}if(_0x2c1888[_0xd4fe('0x20')])_0x587d59[_0xd4fe('0x20')](_0x2c1888[_0xd4fe('0x20')]);if(_0x2c1888[_0xd4fe('0x1e')])_0x587d59[_0xd4fe('0x1e')](_0x2c1888['offset']);return db[_0xd4fe('0xa9')][_0xd4fe('0x3c')](_0x587d59[_0xd4fe('0x95')](),_0x296782);})[_0xd4fe('0x24')](function(_0x32bda8){if(_0x32bda8[_0xd4fe('0x42')]>0x0)_0x2a0007['where'](_0xd4fe('0xaa'),_[_0xd4fe('0x3b')](_0x32bda8,'id'));return db[_0xd4fe('0xa9')][_0xd4fe('0x3c')](_0x2a0007[_0xd4fe('0x95')](),_0x296782)['then'](function(_0x35fc0c){var _0x1b19a4=_[_0xd4fe('0xab')](_0x35fc0c,_0xd4fe('0xac'));var _0x4e62a6=[];_0x32bda8[_0xd4fe('0x2d')](function(_0x294ff5){_0x4e62a6[_0xd4fe('0xad')](updateSmsInteraction(_0x294ff5,_0x1a6ef0,_0x1b19a4));});return BPromise[_0xd4fe('0xae')](_0x4e62a6);});});})[_0xd4fe('0x24')](function(_0x421cd1){_0x27bc6d['rows']=_0x421cd1;return _0x27bc6d;})['then'](respondWithFilteredResult(_0x398c70,_0x2c1888))[_0xd4fe('0x2e')](handleError(_0x398c70,null));};exports[_0xd4fe('0xaf')]=function(_0x38d553,_0x3a3541){var _0x1908bd={'raw':![],'where':{'id':_0x38d553['params']['id']}},_0x229860={};_0x229860['model']=_['keys'](db[_0xd4fe('0x37')]['rawAttributes']);_0x229860[_0xd4fe('0x3c')]=_[_0xd4fe('0x3d')](_0x38d553[_0xd4fe('0x3c')]);_0x229860[_0xd4fe('0x47')]=_[_0xd4fe('0x3e')](_0x229860[_0xd4fe('0x3f')],_0x229860[_0xd4fe('0x3c')]);_0x1908bd[_0xd4fe('0x40')]=_[_0xd4fe('0x3e')](_0x229860[_0xd4fe('0x3f')],qs['fields'](_0x38d553['query'][_0xd4fe('0x41')]));_0x1908bd['attributes']=_0x1908bd[_0xd4fe('0x40')][_0xd4fe('0x42')]?_0x1908bd['attributes']:_0x229860['model'];if(_0x38d553[_0xd4fe('0x3c')]['includeAll']){_0x1908bd[_0xd4fe('0xb0')]=[{'all':!![]}];}_0x1908bd=_[_0xd4fe('0xb1')]({},_0x1908bd,_0x38d553[_0xd4fe('0xb2')]);return db[_0xd4fe('0x37')][_0xd4fe('0x62')](_0x1908bd)[_0xd4fe('0x24')](handleEntityNotFound(_0x3a3541,null))[_0xd4fe('0x24')](respondWithResult(_0x3a3541,null))[_0xd4fe('0x2e')](handleError(_0x3a3541,null));};exports['create']=function(_0x45cccf,_0x503df9){return db['SmsInteraction'][_0xd4fe('0xb3')](_0x45cccf[_0xd4fe('0x73')],{})['then'](respondWithResult(_0x503df9,0xc9))[_0xd4fe('0x2e')](handleError(_0x503df9,null));};exports[_0xd4fe('0x23')]=function(_0x3509f8,_0x2df7c7){if(_0x3509f8[_0xd4fe('0x73')]['id']){delete _0x3509f8[_0xd4fe('0x73')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x3509f8[_0xd4fe('0xb4')]['id']}})[_0xd4fe('0x24')](handleEntityNotFound(_0x2df7c7,null))[_0xd4fe('0x24')](saveUpdates(_0x3509f8[_0xd4fe('0x73')],null))[_0xd4fe('0x24')](respondWithResult(_0x2df7c7,null))[_0xd4fe('0x2e')](handleError(_0x2df7c7,null));};exports[_0xd4fe('0x25')]=function(_0x5b5b61,_0xa99a5d){return db[_0xd4fe('0x37')][_0xd4fe('0x62')]({'where':{'id':_0x5b5b61[_0xd4fe('0xb4')]['id']}})[_0xd4fe('0x24')](handleEntityNotFound(_0xa99a5d,null))[_0xd4fe('0x24')](removeEntity(_0xa99a5d,null))[_0xd4fe('0x2e')](handleError(_0xa99a5d,null));};exports['describe']=function(_0x26e3ce,_0x2897fe){return db[_0xd4fe('0x37')]['describe']()[_0xd4fe('0x24')](respondWithResult(_0x2897fe,null))[_0xd4fe('0x2e')](handleError(_0x2897fe,null));};exports[_0xd4fe('0xb5')]=function(_0x3e5e2f,_0x361eef,_0x49639b){return db[_0xd4fe('0xb6')][_0xd4fe('0x62')]({'where':{'id':_0x3e5e2f['params']['id']}})['then'](handleEntityNotFound(_0x361eef,null))[_0xd4fe('0x24')](function(_0x20bcb1){if(_0x20bcb1){return _0x20bcb1['addMessage'](_0x3e5e2f[_0xd4fe('0x73')][_0xd4fe('0xb7')],_[_0xd4fe('0xb8')](_0x3e5e2f[_0xd4fe('0x73')],['ids','id'])||{});}})[_0xd4fe('0x24')](respondWithResult(_0x361eef,null))[_0xd4fe('0x2e')](handleError(_0x361eef,null));};exports[_0xd4fe('0xb9')]=function(_0x1bb48d,_0x4f1d99,_0x390103){var _0x216ca1={'raw':![],'where':{}};var _0x4bd6aa={};var _0x243037={'count':0x0,'rows':[]};return db[_0xd4fe('0x37')][_0xd4fe('0xba')]({'where':{'id':_0x1bb48d[_0xd4fe('0xb4')]['id']}})[_0xd4fe('0x24')](handleEntityNotFound(_0x4f1d99,null))[_0xd4fe('0x24')](function(_0x2dc2e6){if(_0x2dc2e6){_0x4bd6aa[_0xd4fe('0x3f')]=_[_0xd4fe('0x3d')](db[_0xd4fe('0xb6')][_0xd4fe('0x38')]);_0x4bd6aa[_0xd4fe('0x3c')]=_[_0xd4fe('0x3d')](_0x1bb48d[_0xd4fe('0x3c')]);_0x4bd6aa[_0xd4fe('0x47')]=_['intersection'](_0x4bd6aa[_0xd4fe('0x3f')],_0x4bd6aa[_0xd4fe('0x3c')]);_0x216ca1[_0xd4fe('0x40')]=_[_0xd4fe('0x3e')](_0x4bd6aa['model'],qs[_0xd4fe('0x41')](_0x1bb48d['query'][_0xd4fe('0x41')]));_0x216ca1[_0xd4fe('0x40')]=_0x216ca1[_0xd4fe('0x40')][_0xd4fe('0x42')]?_0x216ca1[_0xd4fe('0x40')]:_0x4bd6aa[_0xd4fe('0x3f')];if(!_0x1bb48d['query'][_0xd4fe('0xbb')](_0xd4fe('0x43'))){_0x216ca1[_0xd4fe('0x20')]=qs[_0xd4fe('0x20')](_0x1bb48d['query'][_0xd4fe('0x20')]);_0x216ca1[_0xd4fe('0x1e')]=qs[_0xd4fe('0x1e')](_0x1bb48d['query']['offset']);}_0x216ca1[_0xd4fe('0x44')]=qs[_0xd4fe('0x45')](_0x1bb48d[_0xd4fe('0x3c')][_0xd4fe('0x45')]);_0x216ca1[_0xd4fe('0x46')]=qs[_0xd4fe('0x47')](_[_0xd4fe('0x48')](_0x1bb48d['query'],_0x4bd6aa[_0xd4fe('0x47')]));_0x216ca1['where']['SmsInteractionId']=_0x2dc2e6['id'];if(_0x1bb48d[_0xd4fe('0x3c')][_0xd4fe('0xbc')]){_0x216ca1[_0xd4fe('0x46')]=_[_0xd4fe('0xb1')](_0x216ca1[_0xd4fe('0x46')],{'$or':_[_0xd4fe('0x3b')](_0x216ca1[_0xd4fe('0x40')],function(_0x162c95){var _0x51461c={};_0x51461c[_0x162c95]={'$like':'%'+_0x1bb48d['query']['filter']+'%'};return _0x51461c;})});}if(_0x1bb48d[_0xd4fe('0x3c')]['$gte']){var _0x1c1d7a=_0x1bb48d[_0xd4fe('0x3c')]['$gte'][_0xd4fe('0x2c')](',');var _0x5d608b={};_0x5d608b[_0x1c1d7a[0x0]]={'$gte':moment(_0x1c1d7a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x216ca1[_0xd4fe('0x46')]=_[_0xd4fe('0xb1')](_0x216ca1['where'],_0x5d608b);}_0x216ca1=_[_0xd4fe('0xb1')]({},_0x216ca1,_0x1bb48d[_0xd4fe('0xb2')]);return db['SmsMessage'][_0xd4fe('0x96')]({'where':_0x216ca1[_0xd4fe('0x46')]})[_0xd4fe('0x24')](function(_0x3f07a2){_0x243037[_0xd4fe('0x96')]=_0x3f07a2;if(_0x1bb48d['query'][_0xd4fe('0xbd')]){_0x216ca1[_0xd4fe('0xb0')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x216ca1);})[_0xd4fe('0x24')](function(_0x634ab7){_0x243037[_0xd4fe('0xbe')]=_0x634ab7;return _0x243037;});}})[_0xd4fe('0x24')](respondWithFilteredResult(_0x4f1d99,_0x216ca1))[_0xd4fe('0x2e')](handleError(_0x4f1d99,null));};exports[_0xd4fe('0xbf')]=function(_0x55655c,_0x4a5ebb,_0x3a6f98){return db[_0xd4fe('0x37')]['find']({'where':{'id':_0x55655c['params']['id']}})[_0xd4fe('0x24')](handleEntityNotFound(_0x4a5ebb,null))['then'](function(_0x2c1eb2){if(_0x2c1eb2){return _0x2c1eb2['setTags'](_0x55655c['body']['ids'],_[_0xd4fe('0xb8')](_0x55655c[_0xd4fe('0x73')],['ids','id'])||{})[_0xd4fe('0xc0')](function(){return db[_0xd4fe('0xc1')][_0xd4fe('0xc2')]({'attributes':['id',_0xd4fe('0x28'),_0xd4fe('0x4b')],'where':{'id':_0x55655c[_0xd4fe('0x73')]['ids']}});})[_0xd4fe('0x24')](function(_0x183dc1){socket[_0xd4fe('0xc3')](_0xd4fe('0xc4'),{'id':Number(_0x55655c[_0xd4fe('0xb4')]['id']),'tags':_0x183dc1||[]});return{'id':Number(_0x55655c[_0xd4fe('0xb4')]['id']),'tags':_0x183dc1||[]};});}})[_0xd4fe('0x24')](respondWithResult(_0x4a5ebb,null))['catch'](handleError(_0x4a5ebb,null));};exports[_0xd4fe('0xc5')]=function(_0x12a251,_0x5b8ee7,_0x1070b1){return db[_0xd4fe('0x37')][_0xd4fe('0x62')]({'where':{'id':_0x12a251[_0xd4fe('0xb4')]['id']}})[_0xd4fe('0x24')](handleEntityNotFound(_0x5b8ee7,null))['then'](function(_0x15d292){if(_0x15d292){return _0x15d292[_0xd4fe('0xc5')](_0x12a251[_0xd4fe('0x3c')][_0xd4fe('0xb7')]);}})[_0xd4fe('0x24')](respondWithStatusCode(_0x5b8ee7,null))[_0xd4fe('0x2e')](handleError(_0x5b8ee7,null));};exports[_0xd4fe('0xc6')]=function(_0x120292,_0xce3021){var _0xfd4d67=moment()['unix']()['toString']();var _0x7f4297=path['join'](config[_0xd4fe('0xc7')],_0xd4fe('0xc8'),_0xd4fe('0xc9'),_0xd4fe('0xca'));var _0x160085=path['join'](config[_0xd4fe('0xc7')],'server',_0xd4fe('0xc9'),_0xd4fe('0xcb'));var _0x4e8181=path[_0xd4fe('0xcc')](_0x7f4297,_0xfd4d67);var _0x2d6262=util[_0xd4fe('0xcd')]('transcript-%d-%s.zip',_0x120292['params']['id'],_0xfd4d67);var _0x1794bf=path[_0xd4fe('0xcc')](_0x7f4297,_0x2d6262);var _0x2bbfb0=[];_0x2bbfb0[_0xd4fe('0xad')]({'model':db[_0xd4fe('0x71')],'as':_0xd4fe('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x2bbfb0[_0xd4fe('0xad')]({'model':db[_0xd4fe('0xce')],'as':'Contact','attributes':['id',_0xd4fe('0xcf'),'lastName'],'raw':!![]});var _0x3d9788=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xd4fe('0x73'),'createdAt',_0xd4fe('0xd0'),'secret',_0xd4fe('0xd1')],'include':_0x2bbfb0}];_0x3d9788['push']({'model':db[_0xd4fe('0xd2')],'as':_0xd4fe('0xd3'),'attributes':['id',_0xd4fe('0x28')]});_0x3d9788['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0xd4fe('0x62')]({'where':{'id':_0x120292[_0xd4fe('0xb4')]['id']},'include':_0x3d9788})[_0xd4fe('0x24')](handleEntityNotFound(_0xce3021,null))[_0xd4fe('0x24')](function(_0x157e77){if(_0x157e77){var _0x515bf0=_0x157e77[_0xd4fe('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x4e8181);var _0x3d2422={'channel':_0xd4fe('0xd5'),'account':_0x515bf0['Account'][_0xd4fe('0x28')],'agent':_0x515bf0[_0xd4fe('0xd6')]?_0x515bf0[_0xd4fe('0xd6')][_0xd4fe('0xd7')]:'N.A.','createdAt':moment(_0x515bf0[_0xd4fe('0x78')])[_0xd4fe('0xcd')](_0xd4fe('0xd8'))[_0xd4fe('0x95')](),'closedAt':_0x515bf0[_0xd4fe('0x32')]?moment(_0x515bf0[_0xd4fe('0xd9')])['format'](_0xd4fe('0xd8'))[_0xd4fe('0x95')]():'','disposition':_0x515bf0[_0xd4fe('0xda')],'messages':_(_0x515bf0[_0xd4fe('0xdb')])[_0xd4fe('0xbc')]({'secret':![]})[_0xd4fe('0x3b')](function(_0x44f515){return{'date':moment(_0x44f515['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x44f515[_0xd4fe('0xd0')]===_0xd4fe('0xdc')?_0x44f515[_0xd4fe('0x71')]?_0x44f515[_0xd4fe('0x71')][_0xd4fe('0xd7')]:_0xd4fe('0xdd'):_0x44f515[_0xd4fe('0x66')][_0xd4fe('0xcf')]+(_0x44f515[_0xd4fe('0x66')]['lastName']?'\x20'+_0x44f515[_0xd4fe('0x66')]['lastName']:''),'body':_0x44f515['body'],'direction':_0x44f515[_0xd4fe('0xd0')]===_0xd4fe('0xdc')?'A':'C','secret':_0x44f515[_0xd4fe('0xde')],'read':_0x44f515[_0xd4fe('0xd1')]};})['value']()};return ejs[_0xd4fe('0xdf')](path[_0xd4fe('0xcc')](config[_0xd4fe('0xc7')],_0xd4fe('0xc8'),_0xd4fe('0xe0'),'downloadInteraction.ejs'),{'interaction':_0x3d2422})[_0xd4fe('0x24')](function(_0x52f75a){var _0x41e397=path[_0xd4fe('0xcc')](_0x4e8181,_0xd4fe('0xe1')+_0x515bf0['id']+'-'+_0xfd4d67+_0xd4fe('0xe2'));var _0x2b2a9a={'path':_0x41e397,'channel':_0xd4fe('0xd5'),'interactionId':_0x515bf0['id']};return pdf[_0xd4fe('0xe3')](_0x52f75a,_0x2b2a9a);})['then'](function(){return new BPromise(function(_0x176e17,_0x547c7f){zipdir(_0x4e8181,{'saveTo':_0x1794bf},function(_0x16c73d,_0x472492){if(_0x16c73d)return _0x547c7f(_0x16c73d);return _0x176e17(_0x472492);});})[_0xd4fe('0x24')](function(){return new BPromise(function(_0xb6fe7a,_0x54ff2b){rimraf(_0x4e8181,function(_0x228a44){if(_0x228a44)_0x54ff2b(_0x228a44);return _0xb6fe7a();});});})['then'](function(){return _0xce3021[_0xd4fe('0xc6')](_0x1794bf,_0x2d6262,function(_0x16610e){if(_0x16610e){console[_0xd4fe('0xe4')](_0xd4fe('0xe5'),_0x16610e);}else{fs[_0xd4fe('0xe6')](_0x1794bf);}});});});}else{return _0xce3021[_0xd4fe('0x1a')](0xc8);}})['catch'](handleError(_0xce3021,null));}; \ No newline at end of file +var _0x4d65=['then','destroy','sendStatus','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','map','SmsInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','parseSearch','search','sqlOperator','conditions','length','find','value','`\x20=\x200','having','`\x20>\x200','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','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','i.SmsAccountId\x20IN\x20?','parse','$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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','unreadMessages','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','include','options','create','update','body','params','addMessage','SmsMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','root','server','files','tmp','attachments','transcript-%d-%s.zip','join','CmContact','lastName','createdAt','direction','secret','Owner','mkdirSync','Sms','Account','closedAt','disposition','Messages','out','System','Contact','firstName','views','transcript-','createPdfFromHTML','download','log','err','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x1224d3,_0xb93c1a){var _0x57ee3e=function(_0x5641ad){while(--_0x5641ad){_0x1224d3['push'](_0x1224d3['shift']());}};_0x57ee3e(++_0xb93c1a);}(_0x4d65,0xc0));var _0x54d6=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x4d65[_0x9aada2];return _0x196dff;};'use strict';var emlformat=require(_0x54d6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x54d6('0x1'));var moment=require('moment');var BPromise=require(_0x54d6('0x2'));var Mustache=require(_0x54d6('0x3'));var util=require(_0x54d6('0x4'));var path=require(_0x54d6('0x5'));var sox=require(_0x54d6('0x6'));var csv=require(_0x54d6('0x7'));var ejs=require(_0x54d6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54d6('0x9'));var squel=require(_0x54d6('0xa'));var crypto=require(_0x54d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x54d6('0xc'));var toCsv=require(_0x54d6('0x7'));var querystring=require(_0x54d6('0xd'));var Papa=require(_0x54d6('0xe'));var Redis=require(_0x54d6('0xf'));var authService=require(_0x54d6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x54d6('0x11'));var pdf=require(_0x54d6('0x12'));var hardwareService=require(_0x54d6('0x13'));var logger=require(_0x54d6('0x14'))(_0x54d6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x54d6('0x16'));var db=require(_0x54d6('0x17'))['db'];config[_0x54d6('0x18')]=_[_0x54d6('0x19')](config[_0x54d6('0x18')],{'host':_0x54d6('0x1a'),'port':0x18eb});var socket=require(_0x54d6('0x1b'))(new Redis(config[_0x54d6('0x18')]));require(_0x54d6('0x1c'))[_0x54d6('0x1d')](socket);function respondWithStatusCode(_0x573571,_0x2edce8){_0x2edce8=_0x2edce8||0xcc;return function(_0x198dc2){if(_0x198dc2){return _0x573571['sendStatus'](_0x2edce8);}return _0x573571[_0x54d6('0x1e')](_0x2edce8)[_0x54d6('0x1f')]();};}function respondWithResult(_0x3f8d0c,_0x344d6d){_0x344d6d=_0x344d6d||0xc8;return function(_0x1cd594){if(_0x1cd594){return _0x3f8d0c[_0x54d6('0x1e')](_0x344d6d)[_0x54d6('0x20')](_0x1cd594);}};}function respondWithFilteredResult(_0x551464,_0x5cc7df){return function(_0x3c395d){if(_0x3c395d){var _0x4de917=typeof _0x5cc7df['offset']==='undefined'&&typeof _0x5cc7df[_0x54d6('0x21')]==='undefined';var _0x5d696b=_0x3c395d[_0x54d6('0x22')];var _0x3312c3=_0x4de917?0x0:_0x5cc7df[_0x54d6('0x23')];var _0x5ebca1=_0x4de917?_0x3c395d['count']:_0x5cc7df['offset']+_0x5cc7df[_0x54d6('0x21')];var _0x16fec7;if(_0x5ebca1>=_0x5d696b){_0x5ebca1=_0x5d696b;_0x16fec7=0xc8;}else{_0x16fec7=0xce;}_0x551464['status'](_0x16fec7);return _0x551464[_0x54d6('0x24')](_0x54d6('0x25'),_0x3312c3+'-'+_0x5ebca1+'/'+_0x5d696b)[_0x54d6('0x20')](_0x3c395d);}return null;};}function patchUpdates(_0x1edfd2){return function(_0x263834){try{jsonpatch[_0x54d6('0x26')](_0x263834,_0x1edfd2,!![]);}catch(_0x4b7eaa){return BPromise[_0x54d6('0x27')](_0x4b7eaa);}return _0x263834['save']();};}function saveUpdates(_0xb701e0,_0x2a6af7){return function(_0x5257b7){if(_0x5257b7){return _0x5257b7['update'](_0xb701e0)[_0x54d6('0x28')](function(_0x4d4c59){return _0x4d4c59;});}return null;};}function removeEntity(_0x4ecfde,_0x3dbbcf){return function(_0x514987){if(_0x514987){return _0x514987[_0x54d6('0x29')]()[_0x54d6('0x28')](function(){_0x4ecfde['status'](0xcc)[_0x54d6('0x1f')]();});}};}function handleEntityNotFound(_0x362417,_0x27d76b){return function(_0x2127e8){if(!_0x2127e8){_0x362417[_0x54d6('0x2a')](0x194);}return _0x2127e8;};}function handleError(_0x2d1c1e,_0x4e5df0){_0x4e5df0=_0x4e5df0||0x1f4;return function(_0x102b11){logger[_0x54d6('0x2b')](_0x102b11[_0x54d6('0x2c')]);if(_0x102b11[_0x54d6('0x2d')]){delete _0x102b11[_0x54d6('0x2d')];}_0x2d1c1e[_0x54d6('0x1e')](_0x4e5df0)[_0x54d6('0x2e')](_0x102b11);};}function getInteractionUsers(_0xeeafde,_0x4224c1){return new BPromise(function(_0x21522d,_0x5e40d1){try{if(_0x4224c1[_0xeeafde['id']]){_0xeeafde['Users']=_['map'](_0x4224c1[_0xeeafde['id']],function(_0x378daa){return{'id':_0x378daa['id'],'fullname':_0x378daa[_0x54d6('0x2f')]};});}}catch(_0x29605d){_0x5e40d1(_0x29605d);}_0x21522d(_0xeeafde);});}function getInteractionTags(_0x136099,_0x1883e9){return new BPromise(function(_0x2b442c,_0x2518ea){try{if(_0x136099[_0x54d6('0x30')]){_0x136099[_0x54d6('0x31')]=[];_0x136099[_0x54d6('0x30')][_0x54d6('0x32')](',')[_0x54d6('0x33')](function(_0x40109b){_0x136099[_0x54d6('0x31')][_0x54d6('0x34')](_0x1883e9[_0x40109b]);});}delete _0x136099[_0x54d6('0x30')];}catch(_0x1bc956){_0x2518ea(_0x1bc956);}_0x2b442c(_0x136099);});}function updateSmsInteraction(_0x37a68f,_0x39adf7,_0x46e75e){return new BPromise(function(_0x1ca48b,_0x555bb5){return getInteractionUsers(_0x37a68f,_0x46e75e)[_0x54d6('0x28')](function(_0xd243bf){return getInteractionTags(_0xd243bf,_0x39adf7);})[_0x54d6('0x28')](function(_0x4e8605){return getStateInteraction(_0x4e8605);})[_0x54d6('0x28')](function(_0x46a82b){_0x1ca48b(_0x46a82b);})[_0x54d6('0x35')](function(_0xf7cbe8){_0x555bb5(_0xf7cbe8);});});}function getStateInteraction(_0x2106e1){return new BPromise(function(_0x17294e){_0x2106e1[_0x54d6('0x36')]=0x0;_0x2106e1['talking']=0x0;_0x2106e1[_0x54d6('0x37')]=0x0;_0x2106e1[_0x54d6('0x38')]=0x0;_0x2106e1[_0x54d6('0x39')]=0x0;if(!_0x2106e1[_0x54d6('0x3a')]&&!_0x2106e1[_0x54d6('0x3b')]){_0x2106e1[_0x54d6('0x36')]+=0x1;}if(!_0x2106e1['closed']&&_0x2106e1[_0x54d6('0x3b')]){_0x2106e1['talking']+=0x1;if(_0x2106e1[_0x54d6('0x36')]){_0x2106e1[_0x54d6('0x36')]-=0x1;}}if(_0x2106e1['closed']&&_0x2106e1[_0x54d6('0x3b')]){_0x2106e1[_0x54d6('0x37')]+=0x1;if(_0x2106e1['talking']){_0x2106e1['talking']-=0x1;}}if(_0x2106e1[_0x54d6('0x3a')]&&!_0x2106e1[_0x54d6('0x3b')]){_0x2106e1['unmanaged']+=0x1;if(_0x2106e1[_0x54d6('0x36')]){_0x2106e1[_0x54d6('0x36')]-=0x1;}}_0x2106e1[_0x54d6('0x39')]+=0x1;_0x17294e(_0x2106e1);});}exports['index']=function(_0x5a49f2,_0x3fe752){var _0x347dc1={},_0x4c140f={},_0x574002={'count':0x0,'rows':[]};var _0x23775b=_[_0x54d6('0x3c')](db[_0x54d6('0x3d')][_0x54d6('0x3e')],function(_0x54b182){return{'name':_0x54b182[_0x54d6('0x3f')],'type':_0x54b182['type'][_0x54d6('0x40')]};});_0x4c140f[_0x54d6('0x41')]=_[_0x54d6('0x3c')](_0x23775b,_0x54d6('0x2d'));_0x4c140f[_0x54d6('0x42')]=_[_0x54d6('0x43')](_0x5a49f2[_0x54d6('0x42')]);_0x4c140f[_0x54d6('0x44')]=_[_0x54d6('0x45')](_0x4c140f[_0x54d6('0x41')],_0x4c140f['query']);_0x347dc1[_0x54d6('0x46')]=_[_0x54d6('0x45')](_0x4c140f[_0x54d6('0x41')],qs[_0x54d6('0x47')](_0x5a49f2[_0x54d6('0x42')]['fields']));_0x347dc1[_0x54d6('0x46')]=_0x347dc1['attributes']['length']?_0x347dc1['attributes']:_0x4c140f[_0x54d6('0x41')];if(!_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x48')](_0x54d6('0x49'))){_0x347dc1['limit']=qs['limit'](_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x21')]);_0x347dc1[_0x54d6('0x23')]=qs['offset'](_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x23')]);}_0x347dc1[_0x54d6('0x4a')]=qs[_0x54d6('0x4b')](_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x4b')]);_0x347dc1[_0x54d6('0x4c')]=qs[_0x54d6('0x44')](_[_0x54d6('0x4d')](_0x5a49f2[_0x54d6('0x42')],_0x4c140f[_0x54d6('0x44')]),_0x23775b);var _0x23b8a2=[];var _0x1aeb47=squel[_0x54d6('0x4e')]()['field']('id')[_0x54d6('0x4f')](_0x54d6('0x2d'))[_0x54d6('0x4f')]('color')[_0x54d6('0x50')](_0x54d6('0x51'));var _0x19fd85=squel[_0x54d6('0x4e')]()['field'](_0x54d6('0x52'))[_0x54d6('0x4f')](_0x54d6('0x53'))[_0x54d6('0x4f')]('ui.SmsInteractionId')[_0x54d6('0x50')](_0x54d6('0x54'),'ui')[_0x54d6('0x55')](_0x54d6('0x56'),'u',_0x54d6('0x57'));var _0x360343=squel['select']()[_0x54d6('0x50')](_0x54d6('0x58'),'i')['left_join'](_0x54d6('0x59'),'c',_0x54d6('0x5a'))[_0x54d6('0x55')]('users','o',_0x54d6('0x5b'))[_0x54d6('0x55')](_0x54d6('0x5c'),'a',_0x54d6('0x5d'))[_0x54d6('0x55')]('sms_messages','me',_0x54d6('0x5e'))['left_join']('sms_interaction_has_tags','it',_0x54d6('0x5f'))['left_join'](_0x54d6('0x51'),'t','t.id\x20=\x20it.TagId');var _0x2b8746=squel['expr']();var _0x25285e=[];var _0x537995=squel['expr']();var _0x408145;if(_0x5a49f2[_0x54d6('0x42')]['search']){_0x408145=as[_0x54d6('0x60')](_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x61')]);var _0x5cda65=_0x408145[_0x54d6('0x62')];for(var _0x43f9ee=0x0;_0x43f9ee<_0x408145[_0x54d6('0x63')][_0x54d6('0x64')];_0x43f9ee++){var _0xd20a71=_0x408145[_0x54d6('0x63')][_0x43f9ee];var _0x496cfb='i';var _0x3e3058=_[_0x54d6('0x65')](_0x23775b,['name',_0xd20a71[_0x54d6('0x4f')]]);if(!_0x3e3058){switch(_0xd20a71[_0x54d6('0x4f')]){case'unreadMessages':if(_0xd20a71[_0x54d6('0x66')]==0x1){_0x360343['having']('`'+_0xd20a71[_0x54d6('0x4f')]+_0x54d6('0x67'));}else{_0x360343[_0x54d6('0x68')]('`'+_0xd20a71['field']+_0x54d6('0x69'));}break;case'Contact':if(_0xd20a71[_0x54d6('0x6a')]==='$substring'){if(_0xd20a71['value'][_0x54d6('0x32')]('\x20')[_0x54d6('0x64')]>0x1){_0x2b8746[_0x5cda65](_0x54d6('0x6b'),qs[_0x54d6('0x6c')](_0xd20a71[_0x54d6('0x66')]),null);}else{var _0x2e77c0='%'+_0xd20a71['value']+'%';_0x2b8746[_0x5cda65](_0x54d6('0x6d'),_0x2e77c0,_0x2e77c0,_0x2e77c0);}}else{_0x3e3058=_[_0x54d6('0x65')](_0x23775b,[_0x54d6('0x2d'),'ContactId']);_0xd20a71[_0x54d6('0x4f')]=_0x54d6('0x6e');_0x40bedf=as[_0x54d6('0x6f')](_0x496cfb,_0x3e3058[_0x54d6('0x70')],_0xd20a71);_0x2b8746[_0x5cda65](_0x40bedf[_0x54d6('0x71')],_0x40bedf[_0x54d6('0x66')][_0x54d6('0x72')],_0x40bedf['value']['end']);}break;case _0x54d6('0x73'):var _0x1d8cdf=_0xd20a71['value'][_0x54d6('0x32')](',')[_0x54d6('0x3c')](function(_0x302c11){return Number(_0x302c11);});_0x1d8cdf[_0x54d6('0x33')](function(_0x1e1756){_0x537995['or'](_0x54d6('0x74'),'%,'+_0x1e1756+',%');});_0x25285e=_[_0x54d6('0x75')](_0x25285e,_0x1d8cdf);break;case _0x54d6('0x76'):if(_0xd20a71['operator']==='$substring'){_0x2b8746[_0x5cda65](_0x54d6('0x77'),'%'+_0xd20a71['value']+'%',null);}else{_0x3e3058=_[_0x54d6('0x65')](_0x23775b,[_0x54d6('0x2d'),'UserId']);_0xd20a71['field']=_0x54d6('0x3b');_0x40bedf=as['buildExpression'](_0x496cfb,_0x3e3058[_0x54d6('0x70')],_0xd20a71);_0x2b8746[_0x5cda65](_0x40bedf[_0x54d6('0x71')],_0x40bedf[_0x54d6('0x66')][_0x54d6('0x72')],_0x40bedf[_0x54d6('0x66')]['end']);}break;case'body':_0x40bedf=as[_0x54d6('0x6f')]('me',null,_0xd20a71);_0x2b8746[_0x5cda65](_0x40bedf[_0x54d6('0x71')],_0x40bedf[_0x54d6('0x66')][_0x54d6('0x72')],_0x40bedf[_0x54d6('0x66')]['end']);break;}}else{var _0x40bedf=as[_0x54d6('0x6f')](_0x496cfb,_0x3e3058[_0x54d6('0x70')],_0xd20a71);_0x2b8746[_0x5cda65](_0x40bedf['text'],_0x40bedf[_0x54d6('0x66')]['start'],_0x40bedf[_0x54d6('0x66')]['end']);}}}else{var _0x2e5f9a=_(_0x5a49f2[_0x54d6('0x42')])['keys']()[_0x54d6('0x3c')](function(_0xea3627){return _[_0x54d6('0x78')](_0x23775b,[_0x54d6('0x2d'),_0xea3627])?_0xea3627:undefined;})[_0x54d6('0x79')]()[_0x54d6('0x66')]();if(!_['isEmpty'](_0x2e5f9a)){_0x2e5f9a[_0x54d6('0x33')](function(_0x21f5c9){if(_0x21f5c9==='SmsAccountId'){_0x360343[_0x54d6('0x4c')](_0x54d6('0x7a'),[]['concat'](_0x5a49f2['query'][_0x21f5c9]));}else if(_0x21f5c9==='createdAt'){var _0x54698a=JSON['parse'](_0x5a49f2[_0x54d6('0x42')][_0x21f5c9])['$gte'];var _0xdb4e3b=JSON[_0x54d6('0x7b')](_0x5a49f2[_0x54d6('0x42')][_0x21f5c9])[_0x54d6('0x7c')];_0x360343[_0x54d6('0x4c')](_0x54d6('0x7d'),_0x54698a,_0xdb4e3b);}else{if(_0x5a49f2[_0x54d6('0x42')][_0x21f5c9]===_0x54d6('0x7e')){_0x360343[_0x54d6('0x4c')]('i.'+_0x21f5c9+_0x54d6('0x7f'));}else{_0x360343[_0x54d6('0x4c')]('i.'+_0x21f5c9+_0x54d6('0x80'),_0x5a49f2['query'][_0x21f5c9]);}}});}if(_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x81')]){if(_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x81')]==0x1){_0x360343[_0x54d6('0x68')]('`unreadMessages`\x20=\x200');}else{_0x360343[_0x54d6('0x68')](_0x54d6('0x82'));}}if(_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x83')]){_0x25285e=_[_0x54d6('0x84')](_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x83')])?_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x83')]:new Array(_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x83')]);_0x25285e['forEach'](function(_0x173636){_0x537995['or'](_0x54d6('0x74'),'%,'+_0x173636+',%');});}if(_0x5a49f2[_0x54d6('0x42')]['filter']){var _0xa3b97a=_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x85')][_0x54d6('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x54d6('0x87')](_0xa3b97a)){_0x2b8746['or'](_0x54d6('0x88'),_0xa3b97a+'%')['or']('i.phone\x20LIKE\x20?',_0xa3b97a+'%');}else{_0x2b8746['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x54d6('0x6c')](_0xa3b97a))['or'](_0x54d6('0x89'),_0xa3b97a+'%');}}}_0x360343[_0x54d6('0x4c')](_0x2b8746);_0x360343['group'](_0x54d6('0x8a'));var _0x15df29={'type':db[_0x54d6('0x8b')]['QueryTypes'][_0x54d6('0x8c')],'raw':!![]};var _0x564ae5=_0x360343[_0x54d6('0x8d')]();_0x564ae5[_0x54d6('0x4f')](_0x54d6('0x8a'));_0x564ae5[_0x54d6('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x54d6('0x8e'));if(_0x347dc1['order']){_0x347dc1[_0x54d6('0x4a')][_0x54d6('0x33')](function(_0xdcd37e){var _0xd320fa=_0xdcd37e[0x0]===_0x54d6('0x8f')?_0xdcd37e[0x0]:'i.'+_0xdcd37e[0x0];_0x360343['order'](_0xd320fa,_0xdcd37e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x54d6('0x90')](_0x25285e)){_0x360343[_0x54d6('0x68')](_0x537995);_0x564ae5[_0x54d6('0x4c')](_0x54d6('0x91'),_0x25285e);}BPromise[_0x54d6('0x92')]()['then'](function(){if(!_0x408145){if(_0x5a49f2[_0x54d6('0x42')]['SmsAccountId'])return;_0x564ae5['where'](_0x54d6('0x93'));_0x360343[_0x54d6('0x4c')](_0x54d6('0x93'));return;}if(_0x5a49f2[_0x54d6('0x94')][_0x54d6('0x95')]!==_0x54d6('0x96'))return;return _0x5a49f2[_0x54d6('0x94')][_0x54d6('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x104678){if(_[_0x54d6('0x90')](_0x104678)){_0x564ae5[_0x54d6('0x4c')](_0x54d6('0x98'));_0x360343['where'](_0x54d6('0x98'));}else{_0x564ae5[_0x54d6('0x4c')]('i.SmsAccountId\x20IN\x20?',_[_0x54d6('0x3c')](_0x104678,'id'));_0x360343['where'](_0x54d6('0x7a'),_['map'](_0x104678,'id'));}});})[_0x54d6('0x28')](function(){if(_0x5a49f2[_0x54d6('0x94')][_0x54d6('0x95')]==='agent'&&!_0x408145&&!_0x5a49f2[_0x54d6('0x42')]['SmsAccountId'])return[];return db[_0x54d6('0x99')][_0x54d6('0x42')](_0x564ae5['toString'](),_0x15df29);})['then'](function(_0x30ee3){_0x574002[_0x54d6('0x22')]=_0x30ee3['length'];if(_0x574002[_0x54d6('0x22')]===0x0)return[];return db[_0x54d6('0x99')][_0x54d6('0x42')](_0x1aeb47[_0x54d6('0x9a')](),_0x15df29)['then'](function(_0x43488b){_0x23b8a2=_['keyBy'](_0x43488b,'id');_0x15df29=_[_0x54d6('0x9b')](_0x15df29,{'model':db[_0x54d6('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a49f2[_0x54d6('0x42')][_0x54d6('0x47')]){_0x347dc1[_0x54d6('0x46')][_0x54d6('0x33')](function(_0x6b2ace){_0x360343[_0x54d6('0x4f')]('i.'+_0x6b2ace);});}else{_0x360343[_0x54d6('0x4f')](_0x54d6('0x9c'),'unreadMessages');_0x360343[_0x54d6('0x4f')](_0x54d6('0x9d'),_0x54d6('0x9e'));_0x360343[_0x54d6('0x4f')](_0x54d6('0x9f'),'Account.mandatoryDisposition');_0x360343[_0x54d6('0x4f')](_0x54d6('0xa0'),_0x54d6('0x8f'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xa1'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xa2'),'Contact.firstName');_0x360343['field'](_0x54d6('0xa3'),_0x54d6('0xa4'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xa5'),_0x54d6('0xa6'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xa7'),_0x54d6('0xa8'));_0x360343['field'](_0x54d6('0xa9'),_0x54d6('0xaa'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xab'),_0x54d6('0xac'));_0x360343[_0x54d6('0x4f')](_0x54d6('0xad'),'Owner.fullname');_0x360343[_0x54d6('0x4f')](_0x54d6('0xae'),_0x54d6('0xaf'));_0x360343['field'](_0x54d6('0xb0'),_0x54d6('0x30'));}if(_0x347dc1['limit'])_0x360343[_0x54d6('0x21')](_0x347dc1[_0x54d6('0x21')]);if(_0x347dc1[_0x54d6('0x23')])_0x360343[_0x54d6('0x23')](_0x347dc1[_0x54d6('0x23')]);return db['sequelize'][_0x54d6('0x42')](_0x360343[_0x54d6('0x9a')](),_0x15df29);})[_0x54d6('0x28')](function(_0x24e7c0){if(_0x24e7c0[_0x54d6('0x64')]>0x0)_0x19fd85[_0x54d6('0x4c')](_0x54d6('0xb1'),_[_0x54d6('0x3c')](_0x24e7c0,'id'));return db[_0x54d6('0x99')]['query'](_0x19fd85[_0x54d6('0x9a')](),_0x15df29)[_0x54d6('0x28')](function(_0x5e61be){var _0x57de95=_[_0x54d6('0xb2')](_0x5e61be,_0x54d6('0xb3'));var _0x2d51d0=[];_0x24e7c0[_0x54d6('0x33')](function(_0x39bce6){_0x2d51d0[_0x54d6('0x34')](updateSmsInteraction(_0x39bce6,_0x23b8a2,_0x57de95));});return BPromise[_0x54d6('0xb4')](_0x2d51d0);});});})[_0x54d6('0x28')](function(_0x9fa087){_0x574002[_0x54d6('0xb5')]=_0x9fa087;return _0x574002;})['then'](respondWithFilteredResult(_0x3fe752,_0x347dc1))[_0x54d6('0x35')](handleError(_0x3fe752,null));};exports[_0x54d6('0xb6')]=function(_0x446ea2,_0x2ee7b){var _0x2b4b30={'raw':![],'where':{'id':_0x446ea2['params']['id']}},_0x513b25={};_0x513b25[_0x54d6('0x41')]=_['keys'](db[_0x54d6('0x3d')]['rawAttributes']);_0x513b25[_0x54d6('0x42')]=_[_0x54d6('0x43')](_0x446ea2[_0x54d6('0x42')]);_0x513b25[_0x54d6('0x44')]=_[_0x54d6('0x45')](_0x513b25[_0x54d6('0x41')],_0x513b25[_0x54d6('0x42')]);_0x2b4b30[_0x54d6('0x46')]=_[_0x54d6('0x45')](_0x513b25[_0x54d6('0x41')],qs[_0x54d6('0x47')](_0x446ea2['query'][_0x54d6('0x47')]));_0x2b4b30[_0x54d6('0x46')]=_0x2b4b30[_0x54d6('0x46')][_0x54d6('0x64')]?_0x2b4b30[_0x54d6('0x46')]:_0x513b25[_0x54d6('0x41')];if(_0x446ea2[_0x54d6('0x42')]['includeAll']){_0x2b4b30[_0x54d6('0xb7')]=[{'all':!![]}];}_0x2b4b30=_[_0x54d6('0x9b')]({},_0x2b4b30,_0x446ea2[_0x54d6('0xb8')]);return db[_0x54d6('0x3d')][_0x54d6('0x65')](_0x2b4b30)[_0x54d6('0x28')](handleEntityNotFound(_0x2ee7b,null))[_0x54d6('0x28')](respondWithResult(_0x2ee7b,null))[_0x54d6('0x35')](handleError(_0x2ee7b,null));};exports['create']=function(_0x55f741,_0x4ee472){return db[_0x54d6('0x3d')][_0x54d6('0xb9')](_0x55f741['body'],{})[_0x54d6('0x28')](respondWithResult(_0x4ee472,0xc9))[_0x54d6('0x35')](handleError(_0x4ee472,null));};exports[_0x54d6('0xba')]=function(_0x450982,_0x5ad7ff){if(_0x450982[_0x54d6('0xbb')]['id']){delete _0x450982['body']['id'];}return db['SmsInteraction'][_0x54d6('0x65')]({'where':{'id':_0x450982[_0x54d6('0xbc')]['id']}})[_0x54d6('0x28')](handleEntityNotFound(_0x5ad7ff,null))[_0x54d6('0x28')](saveUpdates(_0x450982[_0x54d6('0xbb')],null))[_0x54d6('0x28')](respondWithResult(_0x5ad7ff,null))[_0x54d6('0x35')](handleError(_0x5ad7ff,null));};exports[_0x54d6('0x29')]=function(_0x3974b7,_0x384586){return db[_0x54d6('0x3d')][_0x54d6('0x65')]({'where':{'id':_0x3974b7[_0x54d6('0xbc')]['id']}})[_0x54d6('0x28')](handleEntityNotFound(_0x384586,null))[_0x54d6('0x28')](removeEntity(_0x384586,null))['catch'](handleError(_0x384586,null));};exports['describe']=function(_0x1e2d4f,_0x351ba9){return db[_0x54d6('0x3d')]['describe']()['then'](respondWithResult(_0x351ba9,null))[_0x54d6('0x35')](handleError(_0x351ba9,null));};exports[_0x54d6('0xbd')]=function(_0x15f8a3,_0x27171a,_0x22ef8d){return db[_0x54d6('0xbe')][_0x54d6('0x65')]({'where':{'id':_0x15f8a3['params']['id']}})['then'](handleEntityNotFound(_0x27171a,null))[_0x54d6('0x28')](function(_0x7da09d){if(_0x7da09d){return _0x7da09d[_0x54d6('0xbd')](_0x15f8a3[_0x54d6('0xbb')]['ids'],_['omit'](_0x15f8a3[_0x54d6('0xbb')],[_0x54d6('0xbf'),'id'])||{});}})[_0x54d6('0x28')](respondWithResult(_0x27171a,null))[_0x54d6('0x35')](handleError(_0x27171a,null));};exports['getMessages']=function(_0x3efb91,_0x16d044,_0x36eb32){var _0x52ceb0={'raw':![],'where':{}};var _0x5372b8={};var _0x1d11ed={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x3efb91[_0x54d6('0xbc')]['id']}})[_0x54d6('0x28')](handleEntityNotFound(_0x16d044,null))['then'](function(_0xe254d1){if(_0xe254d1){_0x5372b8['model']=_[_0x54d6('0x43')](db['SmsMessage'][_0x54d6('0x3e')]);_0x5372b8[_0x54d6('0x42')]=_[_0x54d6('0x43')](_0x3efb91[_0x54d6('0x42')]);_0x5372b8['filters']=_['intersection'](_0x5372b8['model'],_0x5372b8[_0x54d6('0x42')]);_0x52ceb0[_0x54d6('0x46')]=_[_0x54d6('0x45')](_0x5372b8[_0x54d6('0x41')],qs[_0x54d6('0x47')](_0x3efb91['query'][_0x54d6('0x47')]));_0x52ceb0[_0x54d6('0x46')]=_0x52ceb0[_0x54d6('0x46')]['length']?_0x52ceb0[_0x54d6('0x46')]:_0x5372b8[_0x54d6('0x41')];if(!_0x3efb91['query'][_0x54d6('0x48')](_0x54d6('0x49'))){_0x52ceb0[_0x54d6('0x21')]=qs[_0x54d6('0x21')](_0x3efb91['query'][_0x54d6('0x21')]);_0x52ceb0['offset']=qs[_0x54d6('0x23')](_0x3efb91['query']['offset']);}_0x52ceb0[_0x54d6('0x4a')]=qs[_0x54d6('0x4b')](_0x3efb91['query'][_0x54d6('0x4b')]);_0x52ceb0['where']=qs[_0x54d6('0x44')](_[_0x54d6('0x4d')](_0x3efb91[_0x54d6('0x42')],_0x5372b8[_0x54d6('0x44')]));_0x52ceb0[_0x54d6('0x4c')][_0x54d6('0xb3')]=_0xe254d1['id'];if(_0x3efb91[_0x54d6('0x42')][_0x54d6('0x85')]){_0x52ceb0[_0x54d6('0x4c')]=_[_0x54d6('0x9b')](_0x52ceb0[_0x54d6('0x4c')],{'$or':_[_0x54d6('0x3c')](_0x52ceb0[_0x54d6('0x46')],function(_0x3bb93d){var _0x3d443c={};_0x3d443c[_0x3bb93d]={'$like':'%'+_0x3efb91['query'][_0x54d6('0x85')]+'%'};return _0x3d443c;})});}if(_0x3efb91[_0x54d6('0x42')]['$gte']){var _0x21dc0d=_0x3efb91[_0x54d6('0x42')]['$gte']['split'](',');var _0x390ed8={};_0x390ed8[_0x21dc0d[0x0]]={'$gte':moment(_0x21dc0d[0x1])[_0x54d6('0xc0')](_0x54d6('0xc1'))};_0x52ceb0[_0x54d6('0x4c')]=_[_0x54d6('0x9b')](_0x52ceb0[_0x54d6('0x4c')],_0x390ed8);}_0x52ceb0=_['merge']({},_0x52ceb0,_0x3efb91[_0x54d6('0xb8')]);return db[_0x54d6('0xbe')][_0x54d6('0x22')]({'where':_0x52ceb0['where']})[_0x54d6('0x28')](function(_0xb0307e){_0x1d11ed[_0x54d6('0x22')]=_0xb0307e;if(_0x3efb91['query'][_0x54d6('0xc2')]){_0x52ceb0['include']=[{'all':!![]}];}return db['SmsMessage'][_0x54d6('0xc3')](_0x52ceb0);})['then'](function(_0x370123){_0x1d11ed['rows']=_0x370123;return _0x1d11ed;});}})[_0x54d6('0x28')](respondWithFilteredResult(_0x16d044,_0x52ceb0))[_0x54d6('0x35')](handleError(_0x16d044,null));};exports[_0x54d6('0xc4')]=function(_0x3484a7,_0x3b832b,_0x493a67){return db[_0x54d6('0x3d')][_0x54d6('0x65')]({'where':{'id':_0x3484a7['params']['id']}})[_0x54d6('0x28')](handleEntityNotFound(_0x3b832b,null))[_0x54d6('0x28')](function(_0x284e3e){if(_0x284e3e){return _0x284e3e[_0x54d6('0xc5')](_0x3484a7[_0x54d6('0xbb')][_0x54d6('0xbf')],_['omit'](_0x3484a7[_0x54d6('0xbb')],[_0x54d6('0xbf'),'id'])||{})[_0x54d6('0xc6')](function(){return db[_0x54d6('0x73')][_0x54d6('0xc3')]({'attributes':['id',_0x54d6('0x2d'),_0x54d6('0xc7')],'where':{'id':_0x3484a7[_0x54d6('0xbb')][_0x54d6('0xbf')]}});})['then'](function(_0x3e769f){socket[_0x54d6('0xc8')](_0x54d6('0xc9'),{'id':Number(_0x3484a7[_0x54d6('0xbc')]['id']),'tags':_0x3e769f||[]});return{'id':Number(_0x3484a7[_0x54d6('0xbc')]['id']),'tags':_0x3e769f||[]};});}})[_0x54d6('0x28')](respondWithResult(_0x3b832b,null))['catch'](handleError(_0x3b832b,null));};exports[_0x54d6('0xca')]=function(_0x3ad345,_0x453689,_0x1c6474){return db[_0x54d6('0x3d')]['find']({'where':{'id':_0x3ad345['params']['id']}})[_0x54d6('0x28')](handleEntityNotFound(_0x453689,null))['then'](function(_0x791d62){if(_0x791d62){return _0x791d62[_0x54d6('0xca')](_0x3ad345['query']['ids']);}})['then'](respondWithStatusCode(_0x453689,null))[_0x54d6('0x35')](handleError(_0x453689,null));};exports['download']=function(_0x4fd8c9,_0x2224da){var _0x15f947=moment()['unix']()['toString']();var _0x3095e6=path['join'](config[_0x54d6('0xcb')],_0x54d6('0xcc'),_0x54d6('0xcd'),_0x54d6('0xce'));var _0x444c91=path['join'](config['root'],'server',_0x54d6('0xcd'),_0x54d6('0xcf'));var _0x5c6a20=path['join'](_0x3095e6,_0x15f947);var _0x54c23d=util[_0x54d6('0xc0')](_0x54d6('0xd0'),_0x4fd8c9[_0x54d6('0xbc')]['id'],_0x15f947);var _0x3dd45f=path[_0x54d6('0xd1')](_0x3095e6,_0x54c23d);var _0x3ffc7d=[];_0x3ffc7d[_0x54d6('0x34')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x3ffc7d[_0x54d6('0x34')]({'model':db[_0x54d6('0xd2')],'as':'Contact','attributes':['id','firstName',_0x54d6('0xd3')],'raw':!![]});var _0x25ab66=[{'model':db[_0x54d6('0xbe')],'as':'Messages','attributes':['id',_0x54d6('0xbb'),_0x54d6('0xd4'),_0x54d6('0xd5'),_0x54d6('0xd6'),_0x54d6('0x81')],'include':_0x3ffc7d}];_0x25ab66[_0x54d6('0x34')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x54d6('0x2d')]});_0x25ab66[_0x54d6('0x34')]({'model':db['User'],'as':_0x54d6('0xd7'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x54d6('0x65')]({'where':{'id':_0x4fd8c9[_0x54d6('0xbc')]['id']},'include':_0x25ab66})[_0x54d6('0x28')](handleEntityNotFound(_0x2224da,null))[_0x54d6('0x28')](function(_0xb0910a){if(_0xb0910a){var _0x26beab=_0xb0910a['get']({'plain':!![]});fs[_0x54d6('0xd8')](_0x5c6a20);var _0x5db7a5={'channel':_0x54d6('0xd9'),'account':_0x26beab[_0x54d6('0xda')][_0x54d6('0x2d')],'agent':_0x26beab[_0x54d6('0xd7')]?_0x26beab[_0x54d6('0xd7')][_0x54d6('0x2f')]:'N.A.','createdAt':moment(_0x26beab[_0x54d6('0xd4')])[_0x54d6('0xc0')](_0x54d6('0xc1'))[_0x54d6('0x9a')](),'closedAt':_0x26beab[_0x54d6('0x3a')]?moment(_0x26beab[_0x54d6('0xdb')])[_0x54d6('0xc0')](_0x54d6('0xc1'))['toString']():'','disposition':_0x26beab[_0x54d6('0xdc')],'messages':_(_0x26beab[_0x54d6('0xdd')])[_0x54d6('0x85')]({'secret':![]})[_0x54d6('0x3c')](function(_0x11d64c){return{'date':moment(_0x11d64c[_0x54d6('0xd4')])[_0x54d6('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x54d6('0x9a')](),'sender':_0x11d64c[_0x54d6('0xd5')]===_0x54d6('0xde')?_0x11d64c[_0x54d6('0x76')]?_0x11d64c[_0x54d6('0x76')][_0x54d6('0x2f')]:_0x54d6('0xdf'):_0x11d64c[_0x54d6('0xe0')][_0x54d6('0xe1')]+(_0x11d64c[_0x54d6('0xe0')][_0x54d6('0xd3')]?'\x20'+_0x11d64c[_0x54d6('0xe0')][_0x54d6('0xd3')]:''),'body':_0x11d64c[_0x54d6('0xbb')],'direction':_0x11d64c[_0x54d6('0xd5')]===_0x54d6('0xde')?'A':'C','secret':_0x11d64c[_0x54d6('0xd6')],'read':_0x11d64c['read']};})['value']()};return ejs['renderFile'](path['join'](config['root'],_0x54d6('0xcc'),_0x54d6('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x5db7a5})[_0x54d6('0x28')](function(_0x4fd275){var _0x101ad4=path[_0x54d6('0xd1')](_0x5c6a20,_0x54d6('0xe3')+_0x26beab['id']+'-'+_0x15f947+'.pdf');var _0x42c404={'path':_0x101ad4,'channel':'Sms','interactionId':_0x26beab['id']};return pdf[_0x54d6('0xe4')](_0x4fd275,_0x42c404);})[_0x54d6('0x28')](function(){return new BPromise(function(_0x25f63c,_0x4fe813){zipdir(_0x5c6a20,{'saveTo':_0x3dd45f},function(_0x330d51,_0x2f5388){if(_0x330d51)return _0x4fe813(_0x330d51);return _0x25f63c(_0x2f5388);});})[_0x54d6('0x28')](function(){return new BPromise(function(_0x59a4e3,_0x50f97b){rimraf(_0x5c6a20,function(_0x3ebc34){if(_0x3ebc34)_0x50f97b(_0x3ebc34);return _0x59a4e3();});});})[_0x54d6('0x28')](function(){return _0x2224da[_0x54d6('0xe5')](_0x3dd45f,_0x54c23d,function(_0x2808dc){if(_0x2808dc){console[_0x54d6('0xe6')](_0x54d6('0xe7'),_0x2808dc);}else{fs['unlinkSync'](_0x3dd45f);}});});});}else{return _0x2224da[_0x54d6('0x2a')](0xc8);}})[_0x54d6('0x35')](handleError(_0x2224da,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 79d960e..5e1629a 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 _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x5c67ab,_0x14e2d0){var _0x194183=function(_0x2044ae){while(--_0x2044ae){_0x5c67ab['push'](_0x5c67ab['shift']());}};_0x194183(++_0x14e2d0);}(_0x93e9,0xcc));var _0x993e=function(_0x497641,_0x5d4f64){_0x497641=_0x497641-0x0;var _0x3c355e=_0x93e9[_0x497641];return _0x3c355e;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x63a5=['hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2444ba,_0x509fb2){var _0x5e7d8c=function(_0x521610){while(--_0x521610){_0x2444ba['push'](_0x2444ba['shift']());}};_0x5e7d8c(++_0x509fb2);}(_0x63a5,0x18e));var _0x563a=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x63a5[_0xbf8ebe];return _0x1e25e8;};'use strict';var EventEmitter=require(_0x563a('0x0'));var SmsInteraction=require(_0x563a('0x1'))['db'][_0x563a('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x563a('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x563a('0x4'),'afterUpdate':_0x563a('0x5'),'afterDestroy':_0x563a('0x6')};function emitEvent(_0x37e617){return function(_0x5c2a8d,_0x4cc9e5,_0x1fdcb0){_0x5c2a8d['getUsers']({'attributes':['id'],'raw':!![]})[_0x563a('0x7')](function(_0x4f89b4){_0x5c2a8d['setDataValue']('Users',_0x4f89b4[_0x563a('0x8')](function(_0x32bf51){return{'id':_0x32bf51['id']};}));return SmsMessage[_0x563a('0x9')]({'where':{'SmsInteractionId':_0x5c2a8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x563a('0x7')](function(_0x255922){_0x5c2a8d[_0x563a('0xa')](_0x563a('0xb'),_0x255922[_0x563a('0xc')]);SmsInteractionEvents[_0x563a('0xd')](_0x37e617+':'+_0x5c2a8d['id'],_0x5c2a8d);SmsInteractionEvents[_0x563a('0xd')](_0x37e617,_0x5c2a8d);_0x1fdcb0(null);})[_0x563a('0xe')](_0x1fdcb0(null));};}for(var e in events){if(events[_0x563a('0xf')](e)){var event=events[e];SmsInteraction[_0x563a('0x10')](e,emitEvent(event));}}module[_0x563a('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index bc0f5e4..fcca919 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 _0x9b14=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','format'];(function(_0x53f586,_0x2c46cb){var _0x2824a4=function(_0x299be2){while(--_0x299be2){_0x53f586['push'](_0x53f586['shift']());}};_0x2824a4(++_0x2c46cb);}(_0x9b14,0x121));var _0x49b1=function(_0x3b2397,_0x4d52e8){_0x3b2397=_0x3b2397-0x0;var _0x4a81ea=_0x9b14[_0x3b2397];return _0x4a81ea;};'use strict';var _=require(_0x49b1('0x0'));var util=require(_0x49b1('0x1'));var logger=require(_0x49b1('0x2'))('api');var moment=require(_0x49b1('0x3'));var BPromise=require(_0x49b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49b1('0x5'));var rimraf=require(_0x49b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x49b1('0x7'));module[_0x49b1('0x8')]=function(_0x5a771c,_0x178561){return _0x5a771c[_0x49b1('0x9')](_0x49b1('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x239f88,_0x335149,_0x50ff1c){if(_0x239f88[_0x49b1('0xb')](_0x49b1('0xc'))){_0x239f88[_0x49b1('0xd')]=moment()[_0x49b1('0xe')](_0x49b1('0xf'));}_0x50ff1c(null,_0x239f88);}}});}; \ No newline at end of file +var _0x3121=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed'];(function(_0x482996,_0x48cab1){var _0x18c5c8=function(_0x130275){while(--_0x130275){_0x482996['push'](_0x482996['shift']());}};_0x18c5c8(++_0x48cab1);}(_0x3121,0x17c));var _0x1312=function(_0x49e8b9,_0x5cdd53){_0x49e8b9=_0x49e8b9-0x0;var _0xd16cad=_0x3121[_0x49e8b9];return _0xd16cad;};'use strict';var _=require(_0x1312('0x0'));var util=require(_0x1312('0x1'));var logger=require(_0x1312('0x2'))(_0x1312('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1312('0x4'));var fs=require('fs');var path=require(_0x1312('0x5'));var rimraf=require('rimraf');var config=require(_0x1312('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x1312('0x7')]=function(_0x31698e,_0x1adbac){return _0x31698e[_0x1312('0x8')](_0x1312('0x9'),attributes,{'tableName':_0x1312('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5aa3f0,_0x325060,_0x5ba3b4){if(_0x5aa3f0['changed'](_0x1312('0xb'))){_0x5aa3f0['closedAt']=moment()[_0x1312('0xc')](_0x1312('0xd'));}_0x5ba3b4(null,_0x5aa3f0);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a39fcc1..7c14fe5 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 _0x3795=['attributes','limit','UpdateSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3795,0x1ae));var _0x5379=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3795[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5379('0x0'));var util=require('util');var moment=require(_0x5379('0x1'));var BPromise=require(_0x5379('0x2'));var rs=require(_0x5379('0x3'));var fs=require('fs');var Redis=require(_0x5379('0x4'));var db=require(_0x5379('0x5'))['db'];var utils=require(_0x5379('0x6'));var logger=require('../../config/logger')(_0x5379('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5379('0x8')][_0x5379('0x9')]({'port':0x232a});config[_0x5379('0xa')]=_['defaults'](config['redis'],{'host':_0x5379('0xb'),'port':0x18eb});var socket=require(_0x5379('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x5379('0xd')](socket);function respondWithRpcPromise(_0x2a57bf,_0x2e285e,_0x4e6dc6){return new BPromise(function(_0x5ada23,_0x524acb){return client[_0x5379('0xe')](_0x2a57bf,_0x4e6dc6)[_0x5379('0xf')](function(_0x1f36a9){logger[_0x5379('0x10')](_0x5379('0x11'),_0x2e285e,_0x5379('0x12'));logger[_0x5379('0x13')](_0x5379('0x14'),_0x2e285e,_0x5379('0x12'),JSON[_0x5379('0x15')](_0x1f36a9));if(_0x1f36a9[_0x5379('0x16')]){if(_0x1f36a9['error'][_0x5379('0x17')]===0x1f4){logger[_0x5379('0x16')](_0x5379('0x11'),_0x2e285e,_0x1f36a9[_0x5379('0x16')][_0x5379('0x18')]);return _0x524acb(_0x1f36a9['error']['message']);}logger[_0x5379('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2e285e,_0x1f36a9[_0x5379('0x16')][_0x5379('0x18')]);return _0x5ada23(_0x1f36a9[_0x5379('0x16')][_0x5379('0x18')]);}else{logger[_0x5379('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x2e285e,_0x5379('0x12'));_0x5ada23(_0x1f36a9[_0x5379('0x19')]['message']);}})[_0x5379('0x1a')](function(_0x1aad72){logger[_0x5379('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2e285e,_0x1aad72);_0x524acb(_0x1aad72);});});}exports['UpdateSmsInteraction']=function(_0x293913){var _0x35900c=this;return new Promise(function(_0x417f78,_0x4c1f18){return db['SmsInteraction'][_0x5379('0x1b')](_0x293913[_0x5379('0x1c')],{'raw':_0x293913[_0x5379('0x1d')]?_0x293913[_0x5379('0x1d')][_0x5379('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293913[_0x5379('0x1d')]?_0x293913['options'][_0x5379('0x1f')]||null:null,'attributes':_0x293913[_0x5379('0x1d')]?_0x293913[_0x5379('0x1d')][_0x5379('0x20')]||null:null,'limit':_0x293913[_0x5379('0x1d')]?_0x293913[_0x5379('0x1d')][_0x5379('0x21')]||null:null})[_0x5379('0xf')](function(_0x2c3faa){logger['info']('UpdateSmsInteraction',_0x293913);logger[_0x5379('0x13')](_0x5379('0x22'),_0x293913,JSON[_0x5379('0x15')](_0x2c3faa));_0x417f78(_0x2c3faa);})[_0x5379('0x1a')](function(_0x59052f){logger[_0x5379('0x16')]('UpdateSmsInteraction',_0x59052f[_0x5379('0x18')],_0x293913);_0x4c1f18(_0x35900c[_0x5379('0x16')](0x1f4,_0x59052f[_0x5379('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x53102e){return new Promise(function(_0xd7be5e,_0x5148c9){return db[_0x5379('0x23')][_0x5379('0x24')]({'where':_0x53102e[_0x5379('0x1d')]?_0x53102e[_0x5379('0x1d')][_0x5379('0x1f')]||null:null})[_0x5379('0xf')](function(_0x2dbd0a){if(_0x2dbd0a){return _0x2dbd0a[_0x5379('0x25')](_0x53102e[_0x5379('0x1c')][_0x5379('0x26')],_[_0x5379('0x27')](_0x53102e[_0x5379('0x1c')],[_0x5379('0x26'),'id'])||{});}})[_0x5379('0x28')](function(_0x596afc){logger[_0x5379('0x10')](_0x5379('0x29'),_0x53102e);logger[_0x5379('0x13')]('AddTags',_0x53102e,JSON[_0x5379('0x15')](_0x596afc));_0xd7be5e(_0x596afc);})[_0x5379('0x1a')](function(_0x55163b){logger[_0x5379('0x16')]('AddTags',_0x55163b[_0x5379('0x18')],_0x53102e);_0x5148c9(_this[_0x5379('0x16')](0x1f4,_0x55163b[_0x5379('0x18')]));});});}; \ No newline at end of file +var _0x8b15=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis'];(function(_0xf90c16,_0x4377a9){var _0x512b72=function(_0x42c1cb){while(--_0x42c1cb){_0xf90c16['push'](_0xf90c16['shift']());}};_0x512b72(++_0x4377a9);}(_0x8b15,0x122));var _0x58b1=function(_0x312eff,_0x501165){_0x312eff=_0x312eff-0x0;var _0x5182c0=_0x8b15[_0x312eff];return _0x5182c0;};'use strict';var _=require(_0x58b1('0x0'));var util=require(_0x58b1('0x1'));var moment=require(_0x58b1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58b1('0x3'));var db=require(_0x58b1('0x4'))['db'];var utils=require(_0x58b1('0x5'));var logger=require(_0x58b1('0x6'))('rpc');var config=require(_0x58b1('0x7'));var jayson=require(_0x58b1('0x8'));var client=jayson[_0x58b1('0x9')][_0x58b1('0xa')]({'port':0x232a});config[_0x58b1('0xb')]=_['defaults'](config[_0x58b1('0xb')],{'host':_0x58b1('0xc'),'port':0x18eb});var socket=require(_0x58b1('0xd'))(new Redis(config[_0x58b1('0xb')]));require('./smsInteraction.socket')[_0x58b1('0xe')](socket);function respondWithRpcPromise(_0x376e52,_0xdd5737,_0x484ba8){return new BPromise(function(_0x4db394,_0xe65eb2){return client[_0x58b1('0xf')](_0x376e52,_0x484ba8)[_0x58b1('0x10')](function(_0x50ade0){logger[_0x58b1('0x11')](_0x58b1('0x12'),_0xdd5737,_0x58b1('0x13'));logger[_0x58b1('0x14')](_0x58b1('0x15'),_0xdd5737,_0x58b1('0x13'),JSON[_0x58b1('0x16')](_0x50ade0));if(_0x50ade0['error']){if(_0x50ade0['error'][_0x58b1('0x17')]===0x1f4){logger[_0x58b1('0x18')](_0x58b1('0x12'),_0xdd5737,_0x50ade0[_0x58b1('0x18')][_0x58b1('0x19')]);return _0xe65eb2(_0x50ade0[_0x58b1('0x18')][_0x58b1('0x19')]);}logger[_0x58b1('0x18')](_0x58b1('0x12'),_0xdd5737,_0x50ade0[_0x58b1('0x18')]['message']);return _0x4db394(_0x50ade0[_0x58b1('0x18')][_0x58b1('0x19')]);}else{logger[_0x58b1('0x11')](_0x58b1('0x12'),_0xdd5737,'request\x20sent');_0x4db394(_0x50ade0[_0x58b1('0x1a')][_0x58b1('0x19')]);}})[_0x58b1('0x1b')](function(_0x544cdd){logger[_0x58b1('0x18')](_0x58b1('0x12'),_0xdd5737,_0x544cdd);_0xe65eb2(_0x544cdd);});});}exports[_0x58b1('0x1c')]=function(_0x3a4781){var _0xe925a2=this;return new Promise(function(_0x47484f,_0x4bc643){return db[_0x58b1('0x1d')]['update'](_0x3a4781[_0x58b1('0x1e')],{'raw':_0x3a4781['options']?_0x3a4781[_0x58b1('0x1f')][_0x58b1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4781['options']?_0x3a4781['options'][_0x58b1('0x21')]||null:null,'attributes':_0x3a4781[_0x58b1('0x1f')]?_0x3a4781[_0x58b1('0x1f')]['attributes']||null:null,'limit':_0x3a4781[_0x58b1('0x1f')]?_0x3a4781[_0x58b1('0x1f')][_0x58b1('0x22')]||null:null})['then'](function(_0xdde9bf){logger['info']('UpdateSmsInteraction',_0x3a4781);logger[_0x58b1('0x14')]('UpdateSmsInteraction',_0x3a4781,JSON['stringify'](_0xdde9bf));_0x47484f(_0xdde9bf);})['catch'](function(_0x1ddf95){logger[_0x58b1('0x18')](_0x58b1('0x1c'),_0x1ddf95['message'],_0x3a4781);_0x4bc643(_0xe925a2[_0x58b1('0x18')](0x1f4,_0x1ddf95['message']));});});};exports[_0x58b1('0x23')]=function(_0x126dc6){return new Promise(function(_0x265651,_0x4b5183){return db[_0x58b1('0x1d')][_0x58b1('0x24')]({'where':_0x126dc6['options']?_0x126dc6[_0x58b1('0x1f')][_0x58b1('0x21')]||null:null})[_0x58b1('0x10')](function(_0x13d26b){if(_0x13d26b){return _0x13d26b[_0x58b1('0x25')](_0x126dc6['body'][_0x58b1('0x26')],_[_0x58b1('0x27')](_0x126dc6[_0x58b1('0x1e')],['ids','id'])||{});}})[_0x58b1('0x28')](function(_0x546a33){logger[_0x58b1('0x11')](_0x58b1('0x29'),_0x126dc6);logger['debug'](_0x58b1('0x29'),_0x126dc6,JSON[_0x58b1('0x16')](_0x546a33));_0x265651(_0x546a33);})[_0x58b1('0x1b')](function(_0x379ad0){logger['error'](_0x58b1('0x29'),_0x379ad0[_0x58b1('0x19')],_0x126dc6);_0x4b5183(_this[_0x58b1('0x18')](0x1f4,_0x379ad0['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ee9919e..0641cc7 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 _0xcbb8=['./smsInteraction.events','save','remove','emit','removeListener','register','length','smsInteraction:'];(function(_0x43187f,_0x34a056){var _0x59eafe=function(_0x4e825b){while(--_0x4e825b){_0x43187f['push'](_0x43187f['shift']());}};_0x59eafe(++_0x34a056);}(_0xcbb8,0x70));var _0x8cbb=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xcbb8[_0x40ac5e];return _0x2839d6;};'use strict';var SmsInteractionEvents=require(_0x8cbb('0x0'));var events=[_0x8cbb('0x1'),_0x8cbb('0x2'),'update'];function createListener(_0x498b8e,_0x232c1c){return function(_0x6120ef){_0x232c1c[_0x8cbb('0x3')](_0x498b8e,_0x6120ef);};}function removeListener(_0x3d1bde,_0x21acff){return function(){SmsInteractionEvents[_0x8cbb('0x4')](_0x3d1bde,_0x21acff);};}exports[_0x8cbb('0x5')]=function(_0x49c91d){for(var _0x3d996b=0x0,_0x46b811=events[_0x8cbb('0x6')];_0x3d996b<_0x46b811;_0x3d996b++){var _0x26bf6d=events[_0x3d996b];var _0x3d65d5=createListener(_0x8cbb('0x7')+_0x26bf6d,_0x49c91d);SmsInteractionEvents['on'](_0x26bf6d,_0x3d65d5);}}; \ No newline at end of file +var _0x85ff=['./smsInteraction.events','save','remove','update','emit','removeListener','length','smsInteraction:'];(function(_0x4faa88,_0x4b5bd2){var _0x506729=function(_0x51ff4d){while(--_0x51ff4d){_0x4faa88['push'](_0x4faa88['shift']());}};_0x506729(++_0x4b5bd2);}(_0x85ff,0x178));var _0xf85f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x85ff[_0x2d7f0e];return _0x110b07;};'use strict';var SmsInteractionEvents=require(_0xf85f('0x0'));var events=[_0xf85f('0x1'),_0xf85f('0x2'),_0xf85f('0x3')];function createListener(_0x2badff,_0x237859){return function(_0x2bf239){_0x237859[_0xf85f('0x4')](_0x2badff,_0x2bf239);};}function removeListener(_0x4be3e1,_0x2438a1){return function(){SmsInteractionEvents[_0xf85f('0x5')](_0x4be3e1,_0x2438a1);};}exports['register']=function(_0x3b1d98){for(var _0x3ac2b8=0x0,_0x2f2ea7=events[_0xf85f('0x6')];_0x3ac2b8<_0x2f2ea7;_0x3ac2b8++){var _0x49ef0b=events[_0x3ac2b8];var _0x67ca70=createListener(_0xf85f('0x7')+_0x49ef0b,_0x3b1d98);SmsInteractionEvents['on'](_0x49ef0b,_0x67ca70);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 498ff71..04951dc 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 _0xa7ef=['./smsMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa7ef,0x70));var _0xfa7e=function(_0x1e929f,_0x3773e1){_0x1e929f=_0x1e929f-0x0;var _0x47f131=_0xa7ef[_0x1e929f];return _0x47f131;};'use strict';var multer=require(_0xfa7e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa7e('0x1'));var express=require(_0xfa7e('0x2'));var router=express[_0xfa7e('0x3')]();var fs_extra=require(_0xfa7e('0x4'));var auth=require(_0xfa7e('0x5'));var interaction=require(_0xfa7e('0x6'));var config=require(_0xfa7e('0x7'));var controller=require(_0xfa7e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa7e('0x9')]);router[_0xfa7e('0xa')](_0xfa7e('0xb'),auth[_0xfa7e('0xc')](),controller[_0xfa7e('0xd')]);router[_0xfa7e('0xa')](_0xfa7e('0xe'),auth['isAuthenticated'](),controller[_0xfa7e('0xf')]);router[_0xfa7e('0x10')]('/',auth[_0xfa7e('0xc')](),interaction['tracked'](_0xfa7e('0x11'),_0xfa7e('0x12')),controller[_0xfa7e('0x13')]);router[_0xfa7e('0x10')](_0xfa7e('0x14'),controller[_0xfa7e('0x15')]);router['put'](_0xfa7e('0xe'),auth[_0xfa7e('0xc')](),controller[_0xfa7e('0x16')]);router[_0xfa7e('0x17')](_0xfa7e('0x18'),auth[_0xfa7e('0xc')](),controller[_0xfa7e('0x19')]);router[_0xfa7e('0x17')](_0xfa7e('0x1a'),auth[_0xfa7e('0xc')](),controller[_0xfa7e('0x1b')]);router[_0xfa7e('0x1c')]('/:id',auth[_0xfa7e('0xc')](),controller['destroy']);module[_0xfa7e('0x1d')]=router; \ No newline at end of file +var _0x895e=['Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','tracked','sms','smsmessage:create','post','status','update','put','/:id/reject','reject','delete','exports','util','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x895e,0xab));var _0xe895=function(_0x199bcf,_0x5539dd){_0x199bcf=_0x199bcf-0x0;var _0x3e2c6e=_0x895e[_0x199bcf];return _0x3e2c6e;};'use strict';var multer=require('multer');var util=require(_0xe895('0x0'));var path=require(_0xe895('0x1'));var timeout=require(_0xe895('0x2'));var express=require(_0xe895('0x3'));var router=express[_0xe895('0x4')]();var fs_extra=require(_0xe895('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe895('0x6'));var config=require('../../config/environment');var controller=require(_0xe895('0x7'));router[_0xe895('0x8')]('/',auth[_0xe895('0x9')](),controller['index']);router[_0xe895('0x8')](_0xe895('0xa'),auth['isAuthenticated'](),controller[_0xe895('0xb')]);router[_0xe895('0x8')](_0xe895('0xc'),auth[_0xe895('0x9')](),controller[_0xe895('0xd')]);router['post']('/',auth[_0xe895('0x9')](),interaction[_0xe895('0xe')](_0xe895('0xf'),_0xe895('0x10')),controller['create']);router[_0xe895('0x11')]('/:id/status',controller[_0xe895('0x12')]);router['put'](_0xe895('0xc'),auth[_0xe895('0x9')](),controller[_0xe895('0x13')]);router['put']('/:id/accept',auth[_0xe895('0x9')](),controller['accept']);router[_0xe895('0x14')](_0xe895('0x15'),auth['isAuthenticated'](),controller[_0xe895('0x16')]);router[_0xe895('0x17')](_0xe895('0xc'),auth[_0xe895('0x9')](),controller['destroy']);module[_0xe895('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 8d9cfdf..23ab7d5 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 _0x853c=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x5c2d75,_0x4035fc){var _0x48f399=function(_0x576db0){while(--_0x576db0){_0x5c2d75['push'](_0x5c2d75['shift']());}};_0x48f399(++_0x4035fc);}(_0x853c,0x1a1));var _0xc853=function(_0x5b0369,_0x16e522){_0x5b0369=_0x5b0369-0x0;var _0x4c1547=_0x853c[_0x5b0369];return _0x4c1547;};'use strict';var Sequelize=require(_0xc853('0x0'));module['exports']={'body':{'type':Sequelize[_0xc853('0x1')](_0xc853('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc853('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc853('0x4')]('in',_0xc853('0x5')),'defaultValue':_0xc853('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc853('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc853('0x6')]},'readAt':{'type':Sequelize[_0xc853('0x7')]},'secret':{'type':Sequelize[_0xc853('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc853('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2111=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x41c434,_0x195a78){var _0x287f30=function(_0x3a9583){while(--_0x3a9583){_0x41c434['push'](_0x41c434['shift']());}};_0x287f30(++_0x195a78);}(_0x2111,0x11e));var _0x1211=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x2111[_0x10852d];return _0x13a8d6;};'use strict';var Sequelize=require(_0x1211('0x0'));module[_0x1211('0x1')]={'body':{'type':Sequelize[_0x1211('0x2')](_0x1211('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1211('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1211('0x5')]('in',_0x1211('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1211('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1211('0x8')]},'secret':{'type':Sequelize[_0x1211('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1211('0x7')]},'providerResponse':{'type':Sequelize[_0x1211('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 89047d3..2a8aa83 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 _0xfaf0=['catch','status','json','undefined','limit','count','offset','Content-Range','save','update','end','sendStatus','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','show','includeAll','find','create','body','params','destroy','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','SELECT','User','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x133015,_0x3f4b03){var _0x29aa33=function(_0x7bbb98){while(--_0x7bbb98){_0x133015['push'](_0x133015['shift']());}};_0x29aa33(++_0x3f4b03);}(_0xfaf0,0x6a));var _0x0faf=function(_0x1121c0,_0x565205){_0x1121c0=_0x1121c0-0x0;var _0x10225c=_0xfaf0[_0x1121c0];return _0x10225c;};'use strict';var emlformat=require(_0x0faf('0x0'));var rimraf=require(_0x0faf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0faf('0x2'));var rp=require(_0x0faf('0x3'));var moment=require('moment');var BPromise=require(_0x0faf('0x4'));var Mustache=require(_0x0faf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0faf('0x6'));var csv=require('to-csv');var ejs=require(_0x0faf('0x7'));var fs=require('fs');var fs_extra=require(_0x0faf('0x8'));var _=require(_0x0faf('0x9'));var squel=require(_0x0faf('0xa'));var crypto=require('crypto');var jsforce=require(_0x0faf('0xb'));var deskjs=require(_0x0faf('0xc'));var toCsv=require(_0x0faf('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0faf('0xe'));var authService=require(_0x0faf('0xf'));var qs=require(_0x0faf('0x10'));var as=require(_0x0faf('0x11'));var hardwareService=require(_0x0faf('0x12'));var logger=require(_0x0faf('0x13'))('api');var utils=require(_0x0faf('0x14'));var config=require(_0x0faf('0x15'));var licenseUtil=require(_0x0faf('0x16'));var db=require('../../mysqldb')['db'];config[_0x0faf('0x17')]=_['defaults'](config[_0x0faf('0x17')],{'host':_0x0faf('0x18'),'port':0x18eb});var socket=require(_0x0faf('0x19'))(new Redis(config[_0x0faf('0x17')]));require(_0x0faf('0x1a'))[_0x0faf('0x1b')](socket);var jayson=require(_0x0faf('0x1c'));var client=jayson[_0x0faf('0x1d')][_0x0faf('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x0faf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3afd74,_0x2183ad,_0x124966,_0xaf636){return new BPromise(function(_0x44151b,_0x5ea067){var _0x2bd51f=_0xaf636||client;return _0x2bd51f['request'](_0x3afd74,_0x124966)[_0x0faf('0x1f')](function(_0x53c799){logger[_0x0faf('0x20')](_0x0faf('0x21'),_0x2183ad,_0x0faf('0x22'));logger[_0x0faf('0x23')](_0x0faf('0x24'),_0x2183ad,_0x0faf('0x22'),JSON[_0x0faf('0x25')](_0x53c799));if(_0x53c799[_0x0faf('0x26')]){if(_0x53c799[_0x0faf('0x26')][_0x0faf('0x27')]===0x1f4){logger[_0x0faf('0x26')](_0x0faf('0x21'),_0x2183ad,_0x53c799['error']['message']);return _0x5ea067(_0x53c799[_0x0faf('0x26')][_0x0faf('0x28')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x2183ad,_0x53c799[_0x0faf('0x26')][_0x0faf('0x28')]);return _0x44151b(_0x53c799['error'][_0x0faf('0x28')]);}else{logger[_0x0faf('0x20')](_0x0faf('0x21'),_0x2183ad,_0x0faf('0x22'));_0x44151b(_0x53c799[_0x0faf('0x29')][_0x0faf('0x28')]);}})[_0x0faf('0x2a')](function(_0x37de2d){logger[_0x0faf('0x26')](_0x0faf('0x21'),_0x2183ad,_0x37de2d);_0x5ea067(_0x37de2d);});});}function respondWithStatusCode(_0xfe5bc2,_0x1d96b2){_0x1d96b2=_0x1d96b2||0xcc;return function(_0x192061){if(_0x192061){return _0xfe5bc2['sendStatus'](_0x1d96b2);}return _0xfe5bc2['status'](_0x1d96b2)['end']();};}function respondWithResult(_0x5333ff,_0x2a4736){_0x2a4736=_0x2a4736||0xc8;return function(_0x28e5c0){if(_0x28e5c0){return _0x5333ff[_0x0faf('0x2b')](_0x2a4736)[_0x0faf('0x2c')](_0x28e5c0);}};}function respondWithFilteredResult(_0x2aa669,_0x580abf){return function(_0x33f2f7){if(_0x33f2f7){var _0x1ecf39=typeof _0x580abf['offset']===_0x0faf('0x2d')&&typeof _0x580abf[_0x0faf('0x2e')]===_0x0faf('0x2d');var _0x1b8687=_0x33f2f7[_0x0faf('0x2f')];var _0x30244c=_0x1ecf39?0x0:_0x580abf[_0x0faf('0x30')];var _0x208d37=_0x1ecf39?_0x33f2f7[_0x0faf('0x2f')]:_0x580abf[_0x0faf('0x30')]+_0x580abf[_0x0faf('0x2e')];var _0x5f2a0b;if(_0x208d37>=_0x1b8687){_0x208d37=_0x1b8687;_0x5f2a0b=0xc8;}else{_0x5f2a0b=0xce;}_0x2aa669[_0x0faf('0x2b')](_0x5f2a0b);return _0x2aa669['set'](_0x0faf('0x31'),_0x30244c+'-'+_0x208d37+'/'+_0x1b8687)['json'](_0x33f2f7);}return null;};}function patchUpdates(_0x1e933f){return function(_0x34ca10){try{jsonpatch['apply'](_0x34ca10,_0x1e933f,!![]);}catch(_0x3bc0dc){return BPromise['reject'](_0x3bc0dc);}return _0x34ca10[_0x0faf('0x32')]();};}function saveUpdates(_0x580503,_0x553e53){return function(_0x46b53d){if(_0x46b53d){return _0x46b53d[_0x0faf('0x33')](_0x580503)[_0x0faf('0x1f')](function(_0x18a75d){return _0x18a75d;});}return null;};}function removeEntity(_0x10bfaf,_0x5ac121){return function(_0x24b40f){if(_0x24b40f){return _0x24b40f['destroy']()[_0x0faf('0x1f')](function(){_0x10bfaf[_0x0faf('0x2b')](0xcc)[_0x0faf('0x34')]();});}};}function handleEntityNotFound(_0x57c868,_0x195692){return function(_0x4149f2){if(!_0x4149f2){_0x57c868[_0x0faf('0x35')](0x194);}return _0x4149f2;};}function handleError(_0xa972de,_0x3a2a1a){_0x3a2a1a=_0x3a2a1a||0x1f4;return function(_0x5501e8){logger[_0x0faf('0x26')](_0x5501e8[_0x0faf('0x36')]);if(_0x5501e8[_0x0faf('0x37')]){delete _0x5501e8['name'];}_0xa972de[_0x0faf('0x2b')](_0x3a2a1a)[_0x0faf('0x38')](_0x5501e8);};}exports[_0x0faf('0x39')]=function(_0x2da5af,_0x396faa){var _0x8004d7={},_0x2f1f38={},_0x3a9679={'count':0x0,'rows':[]};var _0x50d651=_['map'](db[_0x0faf('0x3a')][_0x0faf('0x3b')],function(_0x75a095){return{'name':_0x75a095[_0x0faf('0x3c')],'type':_0x75a095[_0x0faf('0x3d')][_0x0faf('0x3e')]};});_0x2f1f38[_0x0faf('0x3f')]=_[_0x0faf('0x40')](_0x50d651,'name');_0x2f1f38[_0x0faf('0x41')]=_[_0x0faf('0x42')](_0x2da5af[_0x0faf('0x41')]);_0x2f1f38[_0x0faf('0x43')]=_[_0x0faf('0x44')](_0x2f1f38[_0x0faf('0x3f')],_0x2f1f38[_0x0faf('0x41')]);_0x8004d7[_0x0faf('0x45')]=_[_0x0faf('0x44')](_0x2f1f38['model'],qs[_0x0faf('0x46')](_0x2da5af[_0x0faf('0x41')][_0x0faf('0x46')]));_0x8004d7[_0x0faf('0x45')]=_0x8004d7[_0x0faf('0x45')][_0x0faf('0x47')]?_0x8004d7['attributes']:_0x2f1f38[_0x0faf('0x3f')];if(!_0x2da5af[_0x0faf('0x41')][_0x0faf('0x48')](_0x0faf('0x49'))){_0x8004d7[_0x0faf('0x2e')]=qs[_0x0faf('0x2e')](_0x2da5af[_0x0faf('0x41')][_0x0faf('0x2e')]);_0x8004d7[_0x0faf('0x30')]=qs[_0x0faf('0x30')](_0x2da5af['query'][_0x0faf('0x30')]);}_0x8004d7[_0x0faf('0x4a')]=qs['sort'](_0x2da5af[_0x0faf('0x41')][_0x0faf('0x4b')]);_0x8004d7['where']=qs[_0x0faf('0x43')](_[_0x0faf('0x4c')](_0x2da5af[_0x0faf('0x41')],_0x2f1f38[_0x0faf('0x43')]),_0x50d651);if(_0x2da5af[_0x0faf('0x41')][_0x0faf('0x4d')]){_0x8004d7[_0x0faf('0x4e')]=_[_0x0faf('0x4f')](_0x8004d7[_0x0faf('0x4e')],{'$or':_[_0x0faf('0x40')](_0x50d651,function(_0xa6359f){if(_0xa6359f[_0x0faf('0x3d')]!==_0x0faf('0x50')){var _0x25f4e4={};_0x25f4e4[_0xa6359f[_0x0faf('0x37')]]={'$like':'%'+_0x2da5af['query'][_0x0faf('0x4d')]+'%'};return _0x25f4e4;}})});}_0x8004d7=_[_0x0faf('0x4f')]({},_0x8004d7,_0x2da5af[_0x0faf('0x51')]);var _0x1aadb1={'where':_0x8004d7[_0x0faf('0x4e')]};return db['SmsMessage'][_0x0faf('0x2f')](_0x1aadb1)[_0x0faf('0x1f')](function(_0x2ec296){_0x3a9679['count']=_0x2ec296;if(_0x2da5af[_0x0faf('0x41')]['includeAll']){_0x8004d7[_0x0faf('0x52')]=[{'all':!![]}];}return db[_0x0faf('0x3a')]['findAll'](_0x8004d7);})['then'](function(_0x445713){_0x3a9679[_0x0faf('0x53')]=_0x445713;return _0x3a9679;})[_0x0faf('0x1f')](respondWithFilteredResult(_0x396faa,_0x8004d7))[_0x0faf('0x2a')](handleError(_0x396faa,null));};exports[_0x0faf('0x54')]=function(_0x450582,_0x449725){var _0x2b1307={'raw':!![],'where':{'id':_0x450582['params']['id']}},_0x4bdbe7={};_0x4bdbe7['model']=_[_0x0faf('0x42')](db[_0x0faf('0x3a')][_0x0faf('0x3b')]);_0x4bdbe7['query']=_[_0x0faf('0x42')](_0x450582[_0x0faf('0x41')]);_0x4bdbe7[_0x0faf('0x43')]=_['intersection'](_0x4bdbe7['model'],_0x4bdbe7['query']);_0x2b1307[_0x0faf('0x45')]=_[_0x0faf('0x44')](_0x4bdbe7[_0x0faf('0x3f')],qs[_0x0faf('0x46')](_0x450582[_0x0faf('0x41')][_0x0faf('0x46')]));_0x2b1307['attributes']=_0x2b1307['attributes'][_0x0faf('0x47')]?_0x2b1307[_0x0faf('0x45')]:_0x4bdbe7[_0x0faf('0x3f')];if(_0x450582[_0x0faf('0x41')][_0x0faf('0x55')]){_0x2b1307[_0x0faf('0x52')]=[{'all':!![]}];}_0x2b1307=_[_0x0faf('0x4f')]({},_0x2b1307,_0x450582[_0x0faf('0x51')]);return db[_0x0faf('0x3a')][_0x0faf('0x56')](_0x2b1307)['then'](handleEntityNotFound(_0x449725,null))[_0x0faf('0x1f')](respondWithResult(_0x449725,null))[_0x0faf('0x2a')](handleError(_0x449725,null));};exports[_0x0faf('0x57')]=function(_0x252d96,_0x408ffb){return db['SmsMessage']['create'](_0x252d96[_0x0faf('0x58')],{})[_0x0faf('0x1f')](respondWithResult(_0x408ffb,0xc9))['catch'](handleError(_0x408ffb,null));};exports[_0x0faf('0x33')]=function(_0x182a77,_0x5df42a){if(_0x182a77[_0x0faf('0x58')]['id']){delete _0x182a77[_0x0faf('0x58')]['id'];}return db[_0x0faf('0x3a')]['find']({'where':{'id':_0x182a77[_0x0faf('0x59')]['id']}})[_0x0faf('0x1f')](handleEntityNotFound(_0x5df42a,null))['then'](saveUpdates(_0x182a77[_0x0faf('0x58')],null))['then'](respondWithResult(_0x5df42a,null))[_0x0faf('0x2a')](handleError(_0x5df42a,null));};exports[_0x0faf('0x5a')]=function(_0x50e5e9,_0x160481){return db[_0x0faf('0x3a')]['find']({'where':{'id':_0x50e5e9[_0x0faf('0x59')]['id']}})[_0x0faf('0x1f')](handleEntityNotFound(_0x160481,null))[_0x0faf('0x1f')](removeEntity(_0x160481,null))['catch'](handleError(_0x160481,null));};exports[_0x0faf('0x5b')]=function(_0x5c884e,_0x4723a6){return db[_0x0faf('0x3a')][_0x0faf('0x5b')]()[_0x0faf('0x1f')](respondWithResult(_0x4723a6,null))['catch'](handleError(_0x4723a6,null));};var interaction_log=require('../../config/logger')(_0x0faf('0x5c'));exports[_0x0faf('0x5d')]=function(_0x3285c5,_0x19caa2,_0x1567fa){var _0x8587ab={'agent':{},'channel':_0x0faf('0x5e')};if(_0x3285c5['body']['id']){delete _0x3285c5[_0x0faf('0x58')]['id'];}_0x3285c5[_0x0faf('0x58')][_0x0faf('0x5f')]=!![];_0x3285c5[_0x0faf('0x58')]['readAt']=moment()[_0x0faf('0x60')](_0x0faf('0x61'));_0x3285c5[_0x0faf('0x58')][_0x0faf('0x62')]=_0x3285c5['body'][_0x0faf('0x62')]||_0x3285c5[_0x0faf('0x63')]['id'];_0x8587ab[_0x0faf('0x64')]['id']=_0x3285c5[_0x0faf('0x58')]['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x3285c5[_0x0faf('0x59')]['id'],'UserId':null}})[_0x0faf('0x1f')](handleEntityNotFound(_0x19caa2,null))['then'](saveUpdates(_0x3285c5[_0x0faf('0x58')],null))[_0x0faf('0x1f')](function(_0x127967){if(_0x127967){_0x8587ab[_0x0faf('0x28')]=_0x127967['get']({'plain':!![]});return db[_0x0faf('0x65')][_0x0faf('0x56')]({'where':{'id':_0x127967['SmsInteractionId']}});}return null;})[_0x0faf('0x1f')](handleEntityNotFound(_0x19caa2,null))[_0x0faf('0x1f')](function(_0x220757){if(_0x220757){return _0x220757[_0x0faf('0x33')]({'UserId':_0x3285c5['body']['UserId'],'read1stAt':_['isNil'](_0x220757[_0x0faf('0x66')])?moment()[_0x0faf('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0faf('0x1f')](function(_0x11e743){if(_0x11e743){_0x8587ab[_0x0faf('0x67')]=_0x11e743[_0x0faf('0x68')]({'plain':!![]});interaction_log[_0x0faf('0x20')](_0x0faf('0x69'),_0x3285c5[_0x0faf('0x63')]['id'],_0x3285c5['user'][_0x0faf('0x37')],_0x3285c5[_0x0faf('0x63')][_0x0faf('0x6a')],_0x8587ab[_0x0faf('0x67')]['id'],_0x3285c5['body']?JSON[_0x0faf('0x25')](_0x3285c5[_0x0faf('0x58')]):'null');return respondWithRpcPromise(_0x0faf('0x6b'),_0x0faf('0x6c'),_0x8587ab);}return null;})['then'](function(_0x950315){var _0x78c53b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x950315[_0x0faf('0x28')][_0x0faf('0x6d')];return db['sequelize']['query'](_0x78c53b,{'type':db[_0x0faf('0x6e')][_0x0faf('0x6f')]['SELECT'],'raw':!![]})[_0x0faf('0x1f')](function(_0x596b16){return _0x596b16;});})[_0x0faf('0x1f')](function(_0x5f0d15){if(_0x5f0d15){_0x8587ab['message'][_0x0faf('0x70')]=_0x5f0d15[0x0];if(!_0x3285c5['body'][_0x0faf('0x62')])return;return db['User'][_0x0faf('0x56')]({'where':{'id':_0x3285c5[_0x0faf('0x58')][_0x0faf('0x62')],'role':_0x0faf('0x64')},'attributes':['id',_0x0faf('0x37'),_0x0faf('0x71'),_0x0faf('0x72'),_0x0faf('0x73')],'raw':!![]});}return null;})['then'](function(_0x2a6c18){if(!_0x2a6c18)return null;_0x8587ab[_0x0faf('0x28')][_0x0faf('0x64')]=_0x2a6c18;return _0x8587ab;})[_0x0faf('0x1f')](function(_0x1c6710){if(_0x1c6710){if(_0x3285c5[_0x0faf('0x58')][_0x0faf('0x74')]){_0x8587ab[_0x0faf('0x28')][_0x0faf('0x75')]=util[_0x0faf('0x60')]('SIP/%s',_0x3285c5['user'][_0x0faf('0x37')]);_0x8587ab[_0x0faf('0x28')][_0x0faf('0x76')]=_0x8587ab[_0x0faf('0x76')];_0x8587ab[_0x0faf('0x28')][_0x0faf('0x77')]=_0x8587ab[_0x0faf('0x76')];_0x8587ab[_0x0faf('0x28')][_0x0faf('0x78')]=_0x0faf('0x5d');return respondWithRpcPromise(_0x0faf('0x79'),_0x0faf('0x79'),{'event':_0x0faf('0x7a'),'message':_0x8587ab[_0x0faf('0x28')]},client9002)['then'](function(){return _0x8587ab;});}return _0x8587ab;}return null;})['then'](respondWithResult(_0x19caa2,null))['catch'](handleError(_0x19caa2,null));};var interaction_log=require(_0x0faf('0x13'))(_0x0faf('0x5c'));exports[_0x0faf('0x7b')]=function(_0x10518c,_0x28fd13,_0x4c56b5){var _0x38ac6f={'agent':{},'channel':_0x0faf('0x5e')};if(_0x10518c['body']['id']){delete _0x10518c[_0x0faf('0x58')]['id'];}_0x10518c['body']['UserId']=_0x10518c['body'][_0x0faf('0x62')]||_0x10518c[_0x0faf('0x63')]['id'];_0x38ac6f['agent']['id']=_0x10518c[_0x0faf('0x58')][_0x0faf('0x62')];return db[_0x0faf('0x3a')][_0x0faf('0x56')]({'where':{'id':_0x10518c[_0x0faf('0x59')]['id'],'UserId':null}})[_0x0faf('0x1f')](handleEntityNotFound(_0x28fd13,null))[_0x0faf('0x1f')](function(_0x3d19eb){if(_0x3d19eb){_0x38ac6f[_0x0faf('0x28')]=_0x3d19eb[_0x0faf('0x68')]({'plain':!![]});return db['SmsInteraction'][_0x0faf('0x56')]({'where':{'id':_0x3d19eb[_0x0faf('0x7c')]}});}return null;})[_0x0faf('0x1f')](handleEntityNotFound(_0x28fd13,null))['then'](function(_0x4f9999){if(_0x4f9999){_0x38ac6f[_0x0faf('0x67')]=_0x4f9999[_0x0faf('0x68')]({'plain':!![]});interaction_log[_0x0faf('0x20')](_0x0faf('0x7d'),_0x10518c[_0x0faf('0x63')]['id'],_0x10518c[_0x0faf('0x63')][_0x0faf('0x37')],_0x10518c[_0x0faf('0x63')][_0x0faf('0x6a')],_0x38ac6f[_0x0faf('0x67')]['id'],_0x10518c[_0x0faf('0x58')]?JSON[_0x0faf('0x25')](_0x10518c['body']):_0x0faf('0x7e'));return respondWithRpcPromise('RejectMessage',_0x0faf('0x7f'),_0x38ac6f);}return null;})['then'](function(_0x535bf8){var _0x262cdd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x535bf8[_0x0faf('0x28')][_0x0faf('0x6d')];return db[_0x0faf('0x80')]['query'](_0x262cdd,{'type':db[_0x0faf('0x6e')][_0x0faf('0x6f')][_0x0faf('0x81')],'raw':!![]})['then'](function(_0x15ef78){return _0x15ef78;});})[_0x0faf('0x1f')](function(_0x3f5f93){if(_0x3f5f93){_0x38ac6f[_0x0faf('0x28')]['contact']=_0x3f5f93[0x0];if(!_0x10518c[_0x0faf('0x58')][_0x0faf('0x62')])return;return db[_0x0faf('0x82')]['find']({'where':{'id':_0x10518c[_0x0faf('0x58')][_0x0faf('0x62')],'role':_0x0faf('0x64')},'attributes':['id',_0x0faf('0x37'),_0x0faf('0x71'),_0x0faf('0x72'),_0x0faf('0x73')],'raw':!![]});}return null;})['then'](function(_0x26670e){if(!_0x26670e)return null;_0x38ac6f[_0x0faf('0x28')]['agent']=_0x26670e;return _0x38ac6f;})[_0x0faf('0x1f')](function(_0xf00046){if(_0xf00046){_0xf00046['message'][_0x0faf('0x75')]=util[_0x0faf('0x60')](_0x0faf('0x83'),_0x10518c['user']['name']);_0xf00046[_0x0faf('0x28')][_0x0faf('0x76')]=_0x38ac6f['channel'];_0xf00046[_0x0faf('0x28')]['motionChannel']=_0x38ac6f[_0x0faf('0x76')];_0xf00046[_0x0faf('0x28')][_0x0faf('0x78')]=_0x0faf('0x7b');respondWithRpcPromise(_0x0faf('0x79'),_0x0faf('0x79'),{'event':_0x0faf('0x84'),'message':_0xf00046[_0x0faf('0x28')]},client9002);return _0x38ac6f;}return null;})[_0x0faf('0x1f')](respondWithResult(_0x28fd13,null))['catch'](handleError(_0x28fd13,null));};exports[_0x0faf('0x2b')]=function(_0x2800af,_0x400931,_0x643de8){if(_0x2800af['body']['id']){delete _0x2800af['body']['id'];}var _0x47d69f;return db['SmsMessage'][_0x0faf('0x56')]({'where':{'id':_0x2800af[_0x0faf('0x59')]['id']}})['then'](handleEntityNotFound(_0x400931,null))[_0x0faf('0x1f')](function(_0x19ad46){if(_0x19ad46){_0x47d69f=_0x19ad46;return db[_0x0faf('0x85')]['find']({'where':{'id':_0x19ad46[_0x0faf('0x86')]}});}})['then'](handleEntityNotFound(_0x400931,null))[_0x0faf('0x1f')](function(_0x2f472e){if(_0x2f472e){logger['debug'](_0x0faf('0x24'),_0x0faf('0x2b'),_0x0faf('0x87'),_0x2f472e[_0x0faf('0x3d')],util['inspect'](_0x2800af[_0x0faf('0x58')],{'showHidden':![],'depth':null}));switch(_0x2f472e[_0x0faf('0x3d')]){case _0x0faf('0x88'):if(_0x2800af[_0x0faf('0x58')][_0x0faf('0x89')]&&_0x2800af[_0x0faf('0x58')][_0x0faf('0x89')]===_0x47d69f[_0x0faf('0x8a')]){return _0x47d69f[_0x0faf('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0faf('0x2b'),_0x0faf('0x88'),util[_0x0faf('0x8b')](_0x2800af[_0x0faf('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0faf('0x8c'):if(_0x2800af[_0x0faf('0x58')]['MessageUUID']&&_0x2800af['body'][_0x0faf('0x8d')]===_0x47d69f['messageId']&&_['indexOf']([_0x0faf('0x8e'),_0x0faf('0x8f')],_0x2800af[_0x0faf('0x58')]['Status'])>=0x0){return _0x47d69f[_0x0faf('0x33')]({'read':!![]});}else{logger['error'](_0x0faf('0x90'),_0x0faf('0x2b'),'plivio',util[_0x0faf('0x8b')](_0x2800af[_0x0faf('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0faf('0x91'):var _0xf2738c=_0x2800af['body'][_0x0faf('0x92')][0x0];if(_0xf2738c[_0x0faf('0x2b')][_0x0faf('0x93')]==='DELIVERED'){return _0x47d69f[_0x0faf('0x33')]({'read':!![]});}else{logger['error'](_0x0faf('0x90'),'status',_0x0faf('0x91'),util[_0x0faf('0x8b')](_0x2800af['body'],{'showHidden':![],'depth':null}));}break;}return _0x47d69f;}})[_0x0faf('0x1f')](respondWithResult(_0x400931,null))['catch'](handleError(_0x400931,null));}; \ No newline at end of file +var _0x2b10=['./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','apply','reject','save','update','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','destroy','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','User','params','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x333cc,_0x10db75){var _0x1ec6b1=function(_0xa94b0e){while(--_0xa94b0e){_0x333cc['push'](_0x333cc['shift']());}};_0x1ec6b1(++_0x10db75);}(_0x2b10,0x114));var _0x02b1=function(_0xc07722,_0x427dd1){_0xc07722=_0xc07722-0x0;var _0x44db6a=_0x2b10[_0xc07722];return _0x44db6a;};'use strict';var emlformat=require(_0x02b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02b1('0x1'));var jsonpatch=require(_0x02b1('0x2'));var rp=require(_0x02b1('0x3'));var moment=require(_0x02b1('0x4'));var BPromise=require(_0x02b1('0x5'));var Mustache=require('mustache');var util=require(_0x02b1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x02b1('0x7'));var ejs=require(_0x02b1('0x8'));var fs=require('fs');var fs_extra=require(_0x02b1('0x9'));var _=require(_0x02b1('0xa'));var squel=require('squel');var crypto=require(_0x02b1('0xb'));var jsforce=require(_0x02b1('0xc'));var deskjs=require(_0x02b1('0xd'));var toCsv=require(_0x02b1('0x7'));var querystring=require(_0x02b1('0xe'));var Papa=require(_0x02b1('0xf'));var Redis=require(_0x02b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x02b1('0x11'));var hardwareService=require(_0x02b1('0x12'));var logger=require(_0x02b1('0x13'))('api');var utils=require(_0x02b1('0x14'));var config=require(_0x02b1('0x15'));var licenseUtil=require(_0x02b1('0x16'));var db=require(_0x02b1('0x17'))['db'];config[_0x02b1('0x18')]=_['defaults'](config[_0x02b1('0x18')],{'host':_0x02b1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02b1('0x18')]));require(_0x02b1('0x1a'))['register'](socket);var jayson=require(_0x02b1('0x1b'));var client=jayson[_0x02b1('0x1c')][_0x02b1('0x1d')]({'port':0x232c});var client9002=jayson[_0x02b1('0x1c')][_0x02b1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x396dd3,_0x5ac82b,_0x14a5c5,_0x5d4354){return new BPromise(function(_0x311cb7,_0x3a6cf5){var _0x3b9322=_0x5d4354||client;return _0x3b9322[_0x02b1('0x1e')](_0x396dd3,_0x14a5c5)[_0x02b1('0x1f')](function(_0x29c60a){logger[_0x02b1('0x20')](_0x02b1('0x21'),_0x5ac82b,'request\x20sent');logger[_0x02b1('0x22')](_0x02b1('0x23'),_0x5ac82b,_0x02b1('0x24'),JSON[_0x02b1('0x25')](_0x29c60a));if(_0x29c60a['error']){if(_0x29c60a[_0x02b1('0x26')][_0x02b1('0x27')]===0x1f4){logger['error'](_0x02b1('0x21'),_0x5ac82b,_0x29c60a[_0x02b1('0x26')][_0x02b1('0x28')]);return _0x3a6cf5(_0x29c60a[_0x02b1('0x26')][_0x02b1('0x28')]);}logger[_0x02b1('0x26')](_0x02b1('0x21'),_0x5ac82b,_0x29c60a[_0x02b1('0x26')][_0x02b1('0x28')]);return _0x311cb7(_0x29c60a[_0x02b1('0x26')]['message']);}else{logger[_0x02b1('0x20')](_0x02b1('0x21'),_0x5ac82b,_0x02b1('0x24'));_0x311cb7(_0x29c60a[_0x02b1('0x29')][_0x02b1('0x28')]);}})['catch'](function(_0x3684be){logger[_0x02b1('0x26')](_0x02b1('0x21'),_0x5ac82b,_0x3684be);_0x3a6cf5(_0x3684be);});});}function respondWithStatusCode(_0x2ac4ee,_0x1994e9){_0x1994e9=_0x1994e9||0xcc;return function(_0x31621d){if(_0x31621d){return _0x2ac4ee['sendStatus'](_0x1994e9);}return _0x2ac4ee[_0x02b1('0x2a')](_0x1994e9)[_0x02b1('0x2b')]();};}function respondWithResult(_0x2404f3,_0xa0b0a9){_0xa0b0a9=_0xa0b0a9||0xc8;return function(_0x1c42ff){if(_0x1c42ff){return _0x2404f3[_0x02b1('0x2a')](_0xa0b0a9)[_0x02b1('0x2c')](_0x1c42ff);}};}function respondWithFilteredResult(_0xa73155,_0x46751b){return function(_0x506468){if(_0x506468){var _0x244b4d=typeof _0x46751b[_0x02b1('0x2d')]===_0x02b1('0x2e')&&typeof _0x46751b[_0x02b1('0x2f')]==='undefined';var _0x1fbfaa=_0x506468[_0x02b1('0x30')];var _0x18ddbb=_0x244b4d?0x0:_0x46751b[_0x02b1('0x2d')];var _0x5634f3=_0x244b4d?_0x506468[_0x02b1('0x30')]:_0x46751b[_0x02b1('0x2d')]+_0x46751b['limit'];var _0x3088fb;if(_0x5634f3>=_0x1fbfaa){_0x5634f3=_0x1fbfaa;_0x3088fb=0xc8;}else{_0x3088fb=0xce;}_0xa73155[_0x02b1('0x2a')](_0x3088fb);return _0xa73155['set']('Content-Range',_0x18ddbb+'-'+_0x5634f3+'/'+_0x1fbfaa)[_0x02b1('0x2c')](_0x506468);}return null;};}function patchUpdates(_0x3dceff){return function(_0x5d94fa){try{jsonpatch[_0x02b1('0x31')](_0x5d94fa,_0x3dceff,!![]);}catch(_0x31d2db){return BPromise[_0x02b1('0x32')](_0x31d2db);}return _0x5d94fa[_0x02b1('0x33')]();};}function saveUpdates(_0x30eaf8,_0x2de937){return function(_0x968d1a){if(_0x968d1a){return _0x968d1a[_0x02b1('0x34')](_0x30eaf8)[_0x02b1('0x1f')](function(_0x26d09b){return _0x26d09b;});}return null;};}function removeEntity(_0x45e802,_0xa7f05a){return function(_0x908735){if(_0x908735){return _0x908735['destroy']()[_0x02b1('0x1f')](function(){_0x45e802[_0x02b1('0x2a')](0xcc)[_0x02b1('0x2b')]();});}};}function handleEntityNotFound(_0xcbe3f,_0x4a4dc7){return function(_0x27fb45){if(!_0x27fb45){_0xcbe3f[_0x02b1('0x35')](0x194);}return _0x27fb45;};}function handleError(_0x11ae4a,_0x984d83){_0x984d83=_0x984d83||0x1f4;return function(_0x5b0866){logger['error'](_0x5b0866[_0x02b1('0x36')]);if(_0x5b0866[_0x02b1('0x37')]){delete _0x5b0866[_0x02b1('0x37')];}_0x11ae4a['status'](_0x984d83)[_0x02b1('0x38')](_0x5b0866);};}exports[_0x02b1('0x39')]=function(_0x5814b6,_0x213dac){var _0x1c60ba={},_0x588f66={},_0x148c56={'count':0x0,'rows':[]};var _0x3c4ecc=_[_0x02b1('0x3a')](db[_0x02b1('0x3b')][_0x02b1('0x3c')],function(_0x311172){return{'name':_0x311172[_0x02b1('0x3d')],'type':_0x311172[_0x02b1('0x3e')][_0x02b1('0x3f')]};});_0x588f66[_0x02b1('0x40')]=_['map'](_0x3c4ecc,'name');_0x588f66[_0x02b1('0x41')]=_['keys'](_0x5814b6[_0x02b1('0x41')]);_0x588f66['filters']=_[_0x02b1('0x42')](_0x588f66[_0x02b1('0x40')],_0x588f66['query']);_0x1c60ba[_0x02b1('0x43')]=_[_0x02b1('0x42')](_0x588f66[_0x02b1('0x40')],qs[_0x02b1('0x44')](_0x5814b6[_0x02b1('0x41')][_0x02b1('0x44')]));_0x1c60ba[_0x02b1('0x43')]=_0x1c60ba['attributes'][_0x02b1('0x45')]?_0x1c60ba[_0x02b1('0x43')]:_0x588f66[_0x02b1('0x40')];if(!_0x5814b6[_0x02b1('0x41')][_0x02b1('0x46')]('nolimit')){_0x1c60ba['limit']=qs['limit'](_0x5814b6[_0x02b1('0x41')][_0x02b1('0x2f')]);_0x1c60ba[_0x02b1('0x2d')]=qs[_0x02b1('0x2d')](_0x5814b6['query'][_0x02b1('0x2d')]);}_0x1c60ba['order']=qs[_0x02b1('0x47')](_0x5814b6[_0x02b1('0x41')][_0x02b1('0x47')]);_0x1c60ba[_0x02b1('0x48')]=qs[_0x02b1('0x49')](_[_0x02b1('0x4a')](_0x5814b6[_0x02b1('0x41')],_0x588f66[_0x02b1('0x49')]),_0x3c4ecc);if(_0x5814b6[_0x02b1('0x41')]['filter']){_0x1c60ba[_0x02b1('0x48')]=_[_0x02b1('0x4b')](_0x1c60ba[_0x02b1('0x48')],{'$or':_[_0x02b1('0x3a')](_0x3c4ecc,function(_0x44f25c){if(_0x44f25c[_0x02b1('0x3e')]!==_0x02b1('0x4c')){var _0x5eac73={};_0x5eac73[_0x44f25c[_0x02b1('0x37')]]={'$like':'%'+_0x5814b6[_0x02b1('0x41')]['filter']+'%'};return _0x5eac73;}})});}_0x1c60ba=_[_0x02b1('0x4b')]({},_0x1c60ba,_0x5814b6[_0x02b1('0x4d')]);var _0x4c8c3f={'where':_0x1c60ba['where']};return db[_0x02b1('0x3b')][_0x02b1('0x30')](_0x4c8c3f)['then'](function(_0x4bccef){_0x148c56[_0x02b1('0x30')]=_0x4bccef;if(_0x5814b6[_0x02b1('0x41')][_0x02b1('0x4e')]){_0x1c60ba[_0x02b1('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0x02b1('0x50')](_0x1c60ba);})[_0x02b1('0x1f')](function(_0x22021e){_0x148c56[_0x02b1('0x51')]=_0x22021e;return _0x148c56;})[_0x02b1('0x1f')](respondWithFilteredResult(_0x213dac,_0x1c60ba))[_0x02b1('0x52')](handleError(_0x213dac,null));};exports[_0x02b1('0x53')]=function(_0x1d2d9e,_0x1f75dd){var _0x113028={'raw':!![],'where':{'id':_0x1d2d9e['params']['id']}},_0x14731a={};_0x14731a[_0x02b1('0x40')]=_[_0x02b1('0x54')](db[_0x02b1('0x3b')][_0x02b1('0x3c')]);_0x14731a[_0x02b1('0x41')]=_['keys'](_0x1d2d9e[_0x02b1('0x41')]);_0x14731a[_0x02b1('0x49')]=_[_0x02b1('0x42')](_0x14731a[_0x02b1('0x40')],_0x14731a[_0x02b1('0x41')]);_0x113028['attributes']=_[_0x02b1('0x42')](_0x14731a[_0x02b1('0x40')],qs[_0x02b1('0x44')](_0x1d2d9e[_0x02b1('0x41')][_0x02b1('0x44')]));_0x113028[_0x02b1('0x43')]=_0x113028[_0x02b1('0x43')][_0x02b1('0x45')]?_0x113028['attributes']:_0x14731a[_0x02b1('0x40')];if(_0x1d2d9e[_0x02b1('0x41')][_0x02b1('0x4e')]){_0x113028['include']=[{'all':!![]}];}_0x113028=_['merge']({},_0x113028,_0x1d2d9e[_0x02b1('0x4d')]);return db['SmsMessage'][_0x02b1('0x55')](_0x113028)['then'](handleEntityNotFound(_0x1f75dd,null))['then'](respondWithResult(_0x1f75dd,null))[_0x02b1('0x52')](handleError(_0x1f75dd,null));};exports[_0x02b1('0x56')]=function(_0x2f3e1c,_0x2c681e){return db[_0x02b1('0x3b')]['create'](_0x2f3e1c[_0x02b1('0x57')],{})[_0x02b1('0x1f')](respondWithResult(_0x2c681e,0xc9))[_0x02b1('0x52')](handleError(_0x2c681e,null));};exports['update']=function(_0x56aa9d,_0x253ed1){if(_0x56aa9d[_0x02b1('0x57')]['id']){delete _0x56aa9d[_0x02b1('0x57')]['id'];}return db[_0x02b1('0x3b')][_0x02b1('0x55')]({'where':{'id':_0x56aa9d['params']['id']}})['then'](handleEntityNotFound(_0x253ed1,null))['then'](saveUpdates(_0x56aa9d[_0x02b1('0x57')],null))['then'](respondWithResult(_0x253ed1,null))[_0x02b1('0x52')](handleError(_0x253ed1,null));};exports[_0x02b1('0x58')]=function(_0x121201,_0xc1fb5a){return db[_0x02b1('0x3b')][_0x02b1('0x55')]({'where':{'id':_0x121201['params']['id']}})['then'](handleEntityNotFound(_0xc1fb5a,null))[_0x02b1('0x1f')](removeEntity(_0xc1fb5a,null))[_0x02b1('0x52')](handleError(_0xc1fb5a,null));};exports[_0x02b1('0x59')]=function(_0x1abc74,_0x53a1c6){return db[_0x02b1('0x3b')][_0x02b1('0x59')]()['then'](respondWithResult(_0x53a1c6,null))[_0x02b1('0x52')](handleError(_0x53a1c6,null));};var interaction_log=require(_0x02b1('0x13'))(_0x02b1('0x5a'));exports[_0x02b1('0x5b')]=function(_0x971e0c,_0x553f52,_0x3a6274){var _0x2f9fe0={'agent':{},'channel':_0x02b1('0x5c')};if(_0x971e0c[_0x02b1('0x57')]['id']){delete _0x971e0c[_0x02b1('0x57')]['id'];}_0x971e0c[_0x02b1('0x57')][_0x02b1('0x5d')]=!![];_0x971e0c[_0x02b1('0x57')][_0x02b1('0x5e')]=moment()[_0x02b1('0x5f')](_0x02b1('0x60'));_0x971e0c[_0x02b1('0x57')][_0x02b1('0x61')]=_0x971e0c[_0x02b1('0x57')][_0x02b1('0x61')]||_0x971e0c[_0x02b1('0x62')]['id'];_0x2f9fe0[_0x02b1('0x63')]['id']=_0x971e0c[_0x02b1('0x57')][_0x02b1('0x61')];return db['SmsMessage'][_0x02b1('0x55')]({'where':{'id':_0x971e0c['params']['id'],'UserId':null}})[_0x02b1('0x1f')](handleEntityNotFound(_0x553f52,null))[_0x02b1('0x1f')](saveUpdates(_0x971e0c[_0x02b1('0x57')],null))[_0x02b1('0x1f')](function(_0x4211b5){if(_0x4211b5){_0x2f9fe0[_0x02b1('0x28')]=_0x4211b5[_0x02b1('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x02b1('0x55')]({'where':{'id':_0x4211b5['SmsInteractionId']}});}return null;})[_0x02b1('0x1f')](handleEntityNotFound(_0x553f52,null))['then'](function(_0x5df251){if(_0x5df251){return _0x5df251[_0x02b1('0x34')]({'UserId':_0x971e0c[_0x02b1('0x57')]['UserId'],'read1stAt':_[_0x02b1('0x65')](_0x5df251[_0x02b1('0x66')])?moment()['format'](_0x02b1('0x60')):undefined});}return null;})['then'](function(_0x4f88cd){if(_0x4f88cd){_0x2f9fe0[_0x02b1('0x67')]=_0x4f88cd['get']({'plain':!![]});interaction_log[_0x02b1('0x20')](_0x02b1('0x68'),_0x971e0c['user']['id'],_0x971e0c[_0x02b1('0x62')][_0x02b1('0x37')],_0x971e0c[_0x02b1('0x62')][_0x02b1('0x69')],_0x2f9fe0[_0x02b1('0x67')]['id'],_0x971e0c[_0x02b1('0x57')]?JSON[_0x02b1('0x25')](_0x971e0c[_0x02b1('0x57')]):_0x02b1('0x6a'));return respondWithRpcPromise(_0x02b1('0x6b'),_0x02b1('0x6c'),_0x2f9fe0);}return null;})[_0x02b1('0x1f')](function(_0x50c4d3){var _0x40dc7d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50c4d3['message'][_0x02b1('0x6d')];return db['sequelize'][_0x02b1('0x41')](_0x40dc7d,{'type':db['Sequelize'][_0x02b1('0x6e')][_0x02b1('0x6f')],'raw':!![]})['then'](function(_0x3ca7e4){return _0x3ca7e4;});})[_0x02b1('0x1f')](function(_0x420e0d){if(_0x420e0d){_0x2f9fe0['message'][_0x02b1('0x70')]=_0x420e0d[0x0];if(!_0x971e0c['body'][_0x02b1('0x61')])return;return db['User']['find']({'where':{'id':_0x971e0c[_0x02b1('0x57')][_0x02b1('0x61')],'role':_0x02b1('0x63')},'attributes':['id',_0x02b1('0x37'),_0x02b1('0x71'),_0x02b1('0x72'),_0x02b1('0x73')],'raw':!![]});}return null;})[_0x02b1('0x1f')](function(_0x571194){if(!_0x571194)return null;_0x2f9fe0[_0x02b1('0x28')]['agent']=_0x571194;return _0x2f9fe0;})['then'](function(_0x34f2bb){if(_0x34f2bb){if(_0x971e0c[_0x02b1('0x57')][_0x02b1('0x74')]){_0x2f9fe0[_0x02b1('0x28')][_0x02b1('0x75')]=util[_0x02b1('0x5f')](_0x02b1('0x76'),_0x971e0c[_0x02b1('0x62')][_0x02b1('0x37')]);_0x2f9fe0[_0x02b1('0x28')][_0x02b1('0x77')]=_0x2f9fe0['channel'];_0x2f9fe0['message'][_0x02b1('0x78')]=_0x2f9fe0[_0x02b1('0x77')];_0x2f9fe0[_0x02b1('0x28')][_0x02b1('0x79')]=_0x02b1('0x5b');return respondWithRpcPromise(_0x02b1('0x7a'),_0x02b1('0x7a'),{'event':_0x02b1('0x7b'),'message':_0x2f9fe0['message']},client9002)[_0x02b1('0x1f')](function(){return _0x2f9fe0;});}return _0x2f9fe0;}return null;})[_0x02b1('0x1f')](respondWithResult(_0x553f52,null))['catch'](handleError(_0x553f52,null));};var interaction_log=require(_0x02b1('0x13'))(_0x02b1('0x5a'));exports[_0x02b1('0x32')]=function(_0x10e0a9,_0x1b5903,_0x26a333){var _0xafc5d0={'agent':{},'channel':'sms'};if(_0x10e0a9[_0x02b1('0x57')]['id']){delete _0x10e0a9[_0x02b1('0x57')]['id'];}_0x10e0a9['body'][_0x02b1('0x61')]=_0x10e0a9[_0x02b1('0x57')][_0x02b1('0x61')]||_0x10e0a9[_0x02b1('0x62')]['id'];_0xafc5d0[_0x02b1('0x63')]['id']=_0x10e0a9[_0x02b1('0x57')][_0x02b1('0x61')];return db[_0x02b1('0x3b')][_0x02b1('0x55')]({'where':{'id':_0x10e0a9['params']['id'],'UserId':null}})[_0x02b1('0x1f')](handleEntityNotFound(_0x1b5903,null))['then'](function(_0x471cbf){if(_0x471cbf){_0xafc5d0[_0x02b1('0x28')]=_0x471cbf[_0x02b1('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x02b1('0x55')]({'where':{'id':_0x471cbf[_0x02b1('0x7c')]}});}return null;})[_0x02b1('0x1f')](handleEntityNotFound(_0x1b5903,null))[_0x02b1('0x1f')](function(_0x2a5f5f){if(_0x2a5f5f){_0xafc5d0[_0x02b1('0x67')]=_0x2a5f5f['get']({'plain':!![]});interaction_log[_0x02b1('0x20')](_0x02b1('0x7d'),_0x10e0a9[_0x02b1('0x62')]['id'],_0x10e0a9[_0x02b1('0x62')][_0x02b1('0x37')],_0x10e0a9[_0x02b1('0x62')][_0x02b1('0x69')],_0xafc5d0[_0x02b1('0x67')]['id'],_0x10e0a9['body']?JSON['stringify'](_0x10e0a9['body']):_0x02b1('0x6a'));return respondWithRpcPromise(_0x02b1('0x7e'),_0x02b1('0x7f'),_0xafc5d0);}return null;})['then'](function(_0x5e0316){var _0x5c0b67=_0x02b1('0x80')+_0x5e0316['message'][_0x02b1('0x6d')];return db[_0x02b1('0x81')][_0x02b1('0x41')](_0x5c0b67,{'type':db[_0x02b1('0x82')]['QueryTypes'][_0x02b1('0x6f')],'raw':!![]})[_0x02b1('0x1f')](function(_0x527cfb){return _0x527cfb;});})[_0x02b1('0x1f')](function(_0x4225d1){if(_0x4225d1){_0xafc5d0[_0x02b1('0x28')][_0x02b1('0x70')]=_0x4225d1[0x0];if(!_0x10e0a9[_0x02b1('0x57')][_0x02b1('0x61')])return;return db[_0x02b1('0x83')]['find']({'where':{'id':_0x10e0a9[_0x02b1('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x02b1('0x37'),_0x02b1('0x71'),_0x02b1('0x72'),'internal'],'raw':!![]});}return null;})[_0x02b1('0x1f')](function(_0x5028bc){if(!_0x5028bc)return null;_0xafc5d0[_0x02b1('0x28')][_0x02b1('0x63')]=_0x5028bc;return _0xafc5d0;})[_0x02b1('0x1f')](function(_0x77b0e9){if(_0x77b0e9){_0x77b0e9[_0x02b1('0x28')][_0x02b1('0x75')]=util['format'](_0x02b1('0x76'),_0x10e0a9[_0x02b1('0x62')][_0x02b1('0x37')]);_0x77b0e9['message'][_0x02b1('0x77')]=_0xafc5d0[_0x02b1('0x77')];_0x77b0e9[_0x02b1('0x28')]['motionChannel']=_0xafc5d0[_0x02b1('0x77')];_0x77b0e9[_0x02b1('0x28')]['event']=_0x02b1('0x32');respondWithRpcPromise(_0x02b1('0x7a'),_0x02b1('0x7a'),{'event':'rejectmessage','message':_0x77b0e9[_0x02b1('0x28')]},client9002);return _0xafc5d0;}return null;})['then'](respondWithResult(_0x1b5903,null))[_0x02b1('0x52')](handleError(_0x1b5903,null));};exports[_0x02b1('0x2a')]=function(_0x4e60e3,_0x493bbc,_0x44eea4){if(_0x4e60e3['body']['id']){delete _0x4e60e3[_0x02b1('0x57')]['id'];}var _0x2479d4;return db['SmsMessage'][_0x02b1('0x55')]({'where':{'id':_0x4e60e3[_0x02b1('0x84')]['id']}})[_0x02b1('0x1f')](handleEntityNotFound(_0x493bbc,null))['then'](function(_0x4eda62){if(_0x4eda62){_0x2479d4=_0x4eda62;return db[_0x02b1('0x85')]['find']({'where':{'id':_0x4eda62[_0x02b1('0x86')]}});}})[_0x02b1('0x1f')](handleEntityNotFound(_0x493bbc,null))['then'](function(_0x28c537){if(_0x28c537){logger[_0x02b1('0x22')](_0x02b1('0x23'),_0x02b1('0x2a'),_0x02b1('0x87'),_0x28c537['type'],util[_0x02b1('0x88')](_0x4e60e3['body'],{'showHidden':![],'depth':null}));switch(_0x28c537[_0x02b1('0x3e')]){case _0x02b1('0x89'):if(_0x4e60e3['body']['MessageSid']&&_0x4e60e3[_0x02b1('0x57')][_0x02b1('0x8a')]===_0x2479d4[_0x02b1('0x8b')]){return _0x2479d4[_0x02b1('0x34')]({'read':!![]});}else{logger[_0x02b1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x02b1('0x2a'),_0x02b1('0x89'),util[_0x02b1('0x88')](_0x4e60e3[_0x02b1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x02b1('0x8c'):if(_0x4e60e3['body'][_0x02b1('0x8d')]&&_0x4e60e3['body'][_0x02b1('0x8d')]===_0x2479d4[_0x02b1('0x8b')]&&_[_0x02b1('0x8e')]([_0x02b1('0x8f'),_0x02b1('0x90')],_0x4e60e3[_0x02b1('0x57')][_0x02b1('0x91')])>=0x0){return _0x2479d4['update']({'read':!![]});}else{logger[_0x02b1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x02b1('0x2a'),_0x02b1('0x92'),util[_0x02b1('0x88')](_0x4e60e3[_0x02b1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x02b1('0x93'):var _0x28af77=_0x4e60e3[_0x02b1('0x57')]['results'][0x0];if(_0x28af77['status'][_0x02b1('0x94')]===_0x02b1('0x95')){return _0x2479d4['update']({'read':!![]});}else{logger[_0x02b1('0x26')](_0x02b1('0x96'),_0x02b1('0x2a'),_0x02b1('0x93'),util[_0x02b1('0x88')](_0x4e60e3['body'],{'showHidden':![],'depth':null}));}break;}return _0x2479d4;}})[_0x02b1('0x1f')](respondWithResult(_0x493bbc,null))[_0x02b1('0x52')](handleError(_0x493bbc,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1337656..fa2ca51 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 _0xc0eb=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x1656cd,_0x26f2f6){var _0x5af6c3=function(_0x283cfa){while(--_0x283cfa){_0x1656cd['push'](_0x1656cd['shift']());}};_0x5af6c3(++_0x26f2f6);}(_0xc0eb,0x1f0));var _0xbc0e=function(_0x3aa032,_0x566691){_0x3aa032=_0x3aa032-0x0;var _0x5120f9=_0xc0eb[_0x3aa032];return _0x5120f9;};'use strict';var EventEmitter=require(_0xbc0e('0x0'));var SmsMessage=require(_0xbc0e('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbc0e('0x2')](0x0);var events={'afterCreate':_0xbc0e('0x3'),'afterUpdate':'update','afterDestroy':_0xbc0e('0x4')};function emitEvent(_0x60dff4){return function(_0xb6fc8b,_0x8f1f97,_0x3ab073){SmsMessageEvents[_0xbc0e('0x5')](_0x60dff4+':'+_0xb6fc8b['id'],_0xb6fc8b);SmsMessageEvents[_0xbc0e('0x5')](_0x60dff4,_0xb6fc8b);_0x3ab073(null);};}for(var e in events){if(events[_0xbc0e('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xbc0e('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x4ad2=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x4ad2,0x87));var _0x24ad=function(_0x25e49b,_0x5a5935){_0x25e49b=_0x25e49b-0x0;var _0x308e22=_0x4ad2[_0x25e49b];return _0x308e22;};'use strict';var EventEmitter=require(_0x24ad('0x0'));var SmsMessage=require(_0x24ad('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x24ad('0x2')](0x0);var events={'afterCreate':_0x24ad('0x3'),'afterUpdate':_0x24ad('0x4'),'afterDestroy':_0x24ad('0x5')};function emitEvent(_0x478139){return function(_0x15fb95,_0x167b03,_0x7c2010){SmsMessageEvents[_0x24ad('0x6')](_0x478139+':'+_0x15fb95['id'],_0x15fb95);SmsMessageEvents[_0x24ad('0x6')](_0x478139,_0x15fb95);_0x7c2010(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x24ad('0x7')](e,emitEvent(event));}}module[_0x24ad('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index d3db76a..0611dce 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 _0x28cf=['Missing\x20parameters:\x20apiKey','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','error','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','text','timestamp','keys','sort','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','messages'];(function(_0x387ed9,_0x2abfc6){var _0x3bbbab=function(_0x1cfa29){while(--_0x1cfa29){_0x387ed9['push'](_0x387ed9['shift']());}};_0x3bbbab(++_0x2abfc6);}(_0x28cf,0xfb));var _0xf28c=function(_0x84caf7,_0x14bce4){_0x84caf7=_0x84caf7-0x0;var _0x1a54c1=_0x28cf[_0x84caf7];return _0x1a54c1;};'use strict';var _=require(_0xf28c('0x0'));var util=require(_0xf28c('0x1'));var logger=require(_0xf28c('0x2'))(_0xf28c('0x3'));var moment=require(_0xf28c('0x4'));var BPromise=require('bluebird');var rp=require(_0xf28c('0x5'));var fs=require('fs');var path=require(_0xf28c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf28c('0x7'));module[_0xf28c('0x8')]=function(_0x4e69ae,_0x4a1e5f){return _0x4e69ae[_0xf28c('0x9')]('SmsMessage',attributes,{'tableName':_0xf28c('0xa'),'paranoid':![],'indexes':[{'name':_0xf28c('0xb'),'fields':[_0xf28c('0xb')]},{'name':_0xf28c('0xc'),'fields':[_0xf28c('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x483953,_0x5e5cf9,_0x56aa31){var _0x5ee184=_0x4e69ae['models'];var _0x9b99f3=_0x483953['get']({'plain':!![]});if(_0x9b99f3[_0xf28c('0xe')]['toLowerCase']()==='in'||_0x9b99f3['direction'][_0xf28c('0xf')]()===_0xf28c('0x10')&&!_0x9b99f3[_0xf28c('0x11')]&&!_[_0xf28c('0x12')](_0x9b99f3[_0xf28c('0x13')])&&!_['isNil'](_0x9b99f3[_0xf28c('0x14')])){_0x5ee184[_0xf28c('0x15')]['findOne']({'where':{'id':_0x9b99f3['SmsInteractionId']}})[_0xf28c('0x16')](function(_0x276af7){if(_0x276af7){_0x276af7[_0xf28c('0x17')]({'lastMsgAt':_0x9b99f3[_0xf28c('0x18')],'lastMsgDirection':_0x9b99f3[_0xf28c('0xe')][_0xf28c('0xf')]()});}})['catch'](function(_0x47c014){console[_0xf28c('0x19')](_0x47c014);});}if(_0x9b99f3[_0xf28c('0xe')]===_0xf28c('0x10')&&!_0x9b99f3[_0xf28c('0x11')]){var _0x441146;_0x5ee184['SmsAccount'][_0xf28c('0x1a')]({'where':{'id':_0x9b99f3[_0xf28c('0x1b')]},'raw':!![]})[_0xf28c('0x16')](function(_0x57c844){_0x441146=_0x57c844;if(_0x441146&&_0x441146[_0xf28c('0x1c')]){switch(_0x441146[_0xf28c('0x1c')]){case _0xf28c('0x1d'):var _0x3394a9=require(_0xf28c('0x1d'));if(_0x441146[_0xf28c('0x1e')]&&_0x441146[_0xf28c('0x1f')]&&_0x441146[_0xf28c('0x20')]){var _0x5937f6=new _0x3394a9(_0x441146['accountSid'],_0x441146['authToken']);_0x5937f6['messages'][_0xf28c('0x21')]({'body':_0x9b99f3[_0xf28c('0xd')],'to':_0x9b99f3[_0xf28c('0x20')],'from':_0x441146[_0xf28c('0x20')],'statusCallback':_0x441146[_0xf28c('0x22')]+_0xf28c('0x23')+_0x9b99f3['id']+'/status?token='+_0x441146[_0xf28c('0x24')]})[_0xf28c('0x16')](function(_0x9ebd2){if(_0x9ebd2[_0xf28c('0x25')]){return _0x483953[_0xf28c('0x17')]({'messageId':_0x9ebd2['sid']});}})[_0xf28c('0x26')](function(_0x1af2c1){logger[_0xf28c('0x19')](_0xf28c('0x27'),'afterCreate',_0xf28c('0x1d'),util[_0xf28c('0x28')](_0x1af2c1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf28c('0x27'),_0xf28c('0x29'),'twilio',_0xf28c('0x2a'));}break;case _0xf28c('0x2b'):var _0x313270=_0xf28c('0x2c');if(_0x441146[_0xf28c('0x2d')]&&_0x441146[_0xf28c('0x2e')]){var _0x2c31a9={'recipient':[_0x9b99f3[_0xf28c('0x20')]],'message':_0x9b99f3[_0xf28c('0xd')],'message_type':_0x441146['smsMethod']};if(_0x441146[_0xf28c('0x2f')]&&_0x441146[_0xf28c('0x2f')]!=='SI'){_0x2c31a9[_0xf28c('0x30')]=_0x441146[_0xf28c('0x20')];}var _0x5c8d10={'url':_0x313270+'login?username='+_0x441146[_0xf28c('0x2d')]+_0xf28c('0x31')+_0x441146[_0xf28c('0x2e')],'method':'GET'};rp(_0x5c8d10)[_0xf28c('0x16')](function(_0x7b6bb7){var _0x20ce45=_0x7b6bb7[_0xf28c('0x32')](';');var _0x21c8ec={'user_key':_0x20ce45[0x0],'session_key':_0x20ce45[0x1]};_0x5c8d10={'url':_0x313270+_0xf28c('0x33'),'method':_0xf28c('0x34'),'headers':{'user_key':_0x21c8ec[_0xf28c('0x35')],'Session_key':_0x21c8ec[_0xf28c('0x36')]},'json':!![],'body':_0x2c31a9};return rp(_0x5c8d10);})[_0xf28c('0x16')](function(_0x5d691e){if(_0x5d691e[_0xf28c('0x37')]>=0x1){var _0x3c238d={'messageId':_0x5d691e['internal_order_id']};if(_0x441146[_0xf28c('0x2f')]!=='GP'||!_0x441146[_0xf28c('0x38')]){_0x3c238d[_0xf28c('0x39')]=!![];}return _0x483953[_0xf28c('0x17')](_0x3c238d);}else{return logger[_0xf28c('0x19')](_0xf28c('0x27'),'afterCreate',_0xf28c('0x2b'),util['inspect'](_0x5d691e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2e72dc){return logger[_0xf28c('0x19')](_0xf28c('0x27'),'afterCreate',_0xf28c('0x2b'),util[_0xf28c('0x28')](_0x2e72dc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x2b'),_0xf28c('0x3a'));}break;case _0xf28c('0x3b'):if(_0x441146[_0xf28c('0x1f')]){var _0x254d2d={'recipient':_0x9b99f3[_0xf28c('0x20')],'message':_0x9b99f3['body'],'sender':_0x441146[_0xf28c('0x3c')]||_0x441146[_0xf28c('0x20')],'authorization':_0x441146[_0xf28c('0x1f')]};var _0x5e5cf9={'method':_0xf28c('0x34'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x254d2d,'json':!![]};rp(_0x5e5cf9)[_0xf28c('0x16')](function(_0xb655da){var _0x57260b={'messageId':_0xb655da['requestid']};if(!_0x441146['deliveryReport']){_0x57260b['read']=!![];}return _0x483953[_0xf28c('0x17')](_0x57260b);})[_0xf28c('0x26')](function(_0x55aaa3){logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x3b'),util[_0xf28c('0x28')](_0x55aaa3,{'showHidden':![],'depth':null}));});}else{logger[_0xf28c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),'connectel',_0xf28c('0x3d'));}break;case'clicksend':if(_0x441146[_0xf28c('0x2d')]&&_0x441146[_0xf28c('0x2e')]){var _0x254d2d={'messages':[{'source':_0xf28c('0x3e'),'to':_0x9b99f3[_0xf28c('0x20')],'body':_0x9b99f3[_0xf28c('0xd')],'from':_0x441146[_0xf28c('0x3c')]||_0x441146[_0xf28c('0x20')]}]};var _0x125639=util['format'](_0xf28c('0x3f'),_0x441146[_0xf28c('0x2d')],_0x441146[_0xf28c('0x2e')]);var _0x5e5cf9={'method':_0xf28c('0x34'),'uri':_0xf28c('0x40'),'body':_0x254d2d,'headers':{'Authorization':util[_0xf28c('0x41')](_0xf28c('0x42'),new Buffer(_0x125639)[_0xf28c('0x43')]('base64'))},'json':!![]};rp(_0x5e5cf9)[_0xf28c('0x16')](function(_0x43fd9a){if(_0x43fd9a[_0xf28c('0x44')]>=0xc8&&_0x43fd9a[_0xf28c('0x44')]<=0xce){if(_0x43fd9a['data']&&_0x43fd9a[_0xf28c('0x45')][_0xf28c('0x46')]>0x0){var _0x4ec83b=_[_0xf28c('0x47')](_0x43fd9a[_0xf28c('0x45')]['messages']);var _0x50fcf7={'messageId':_0x4ec83b['message_id']};if(!_0x441146['deliveryReport']){_0x50fcf7[_0xf28c('0x39')]=!![];}return _0x483953['update'](_0x50fcf7);}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),'clickSend',util['inspect'](_0x43fd9a,{'showHidden':![],'depth':null}));}}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),'afterCreate',_0xf28c('0x48'),util[_0xf28c('0x28')](_0x43fd9a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x40a2b6){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),_0xf28c('0x48'),util['inspect'](_0x40a2b6,{'showHidden':![],'depth':null}));});}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x48'),_0xf28c('0x3a'));}break;case _0xf28c('0x49'):if(_0x441146[_0xf28c('0x4a')]&&_0x441146[_0xf28c('0x1f')]){var _0x254d2d={'dst':_0x9b99f3['phone'],'text':_0x9b99f3[_0xf28c('0xd')],'src':_0x441146[_0xf28c('0x3c')]||_0x441146[_0xf28c('0x20')],'url':_0x441146['remote']+_0xf28c('0x23')+_0x9b99f3['id']+_0xf28c('0x4b')+_0x441146[_0xf28c('0x24')]};var _0x125639=util[_0xf28c('0x41')]('%s:%s',_0x441146[_0xf28c('0x4a')],_0x441146[_0xf28c('0x1f')]);var _0x5e5cf9={'method':_0xf28c('0x34'),'uri':util[_0xf28c('0x41')](_0xf28c('0x4c'),_0x441146[_0xf28c('0x4a')]),'body':_0x254d2d,'headers':{'Authorization':util[_0xf28c('0x41')]('Basic\x20%s',new Buffer(_0x125639)[_0xf28c('0x43')](_0xf28c('0x4d')))},'json':!![]};rp(_0x5e5cf9)[_0xf28c('0x16')](function(_0x5dfb83){var _0x7befab={'messageId':_0x5dfb83[_0xf28c('0x4e')][0x0]};return _0x483953[_0xf28c('0x17')](_0x7befab);})[_0xf28c('0x26')](function(_0x3dc4c3){logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x49'),util[_0xf28c('0x28')](_0x3dc4c3,{'showHidden':![],'depth':null}));});}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x49'),_0xf28c('0x4f'));}break;case _0xf28c('0x50'):if(_0x441146['username']&&_0x441146[_0xf28c('0x2e')]){if(_0x441146[_0xf28c('0x51')]){var _0x3261e3={'method':_0xf28c('0x34'),'uri':_0x441146[_0xf28c('0x51')]+'/auth/1/session','body':{'username':_0x441146[_0xf28c('0x2d')],'password':_0x441146['password']},'json':!![]};return rp(_0x3261e3)[_0xf28c('0x16')](function(_0x1b1035){var _0xd53099={'method':_0xf28c('0x34'),'uri':_0x441146[_0xf28c('0x51')]+_0xf28c('0x52'),'body':{'messages':[{'from':_0x441146[_0xf28c('0x20')],'destinations':[{'to':_0x9b99f3['phone']}],'text':_0x9b99f3['body'],'notifyUrl':_0x441146[_0xf28c('0x22')]+_0xf28c('0x23')+_0x9b99f3['id']+_0xf28c('0x4b')+_0x441146['token'],'notifyContentType':_0xf28c('0x53'),'callbackData':_0x441146[_0xf28c('0x20')]+';'+_0x9b99f3[_0xf28c('0xd')]}]},'headers':{'Authorization':_0xf28c('0x54')+_0x1b1035['token']},'json':!![]};return rp(_0xd53099)[_0xf28c('0x16')](function(_0xebd373){if(_0xebd373['messages']){var _0x41b238={'messageId':_0xebd373['messages'][0x0]['messageId']};if(!_0x441146[_0xf28c('0x38')]){_0x41b238['read']=!![];}return _0x483953['update'](_0x41b238);}else{return logger[_0xf28c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),_0xf28c('0x50'),util[_0xf28c('0x28')](_0xebd373,{'showHidden':![],'depth':null}));}});})[_0xf28c('0x26')](function(_0x1d5def){return logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x50'),util[_0xf28c('0x28')](_0x1d5def,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),_0xf28c('0x50'),_0xf28c('0x55'));}}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),'afterCreate',_0xf28c('0x50'),_0xf28c('0x3a'));}break;case _0xf28c('0x56'):var _0x5bb2c3=require(_0xf28c('0x57'));if(_0x441146['apiKey']){var _0xc1e4a0={};_0xc1e4a0['login']=_0x441146[_0xf28c('0x2d')];_0xc1e4a0['phone']=_0x9b99f3['phone'];_0xc1e4a0[_0xf28c('0x30')]=_0x441146[_0xf28c('0x20')];_0xc1e4a0[_0xf28c('0x58')]=_0x9b99f3['body'];_0xc1e4a0[_0xf28c('0x59')]=+new Date();var _0x1642cc='';var _0x233413='';var _0x1f19c7=Object[_0xf28c('0x5a')](_0xc1e4a0);_0x1f19c7[_0xf28c('0x5b')]();for(var _0x3aa262=0x0;_0x3aa262<_0x1f19c7['length'];_0x3aa262++){if(_0x1642cc!=''){_0x1642cc+='&';}_0x1642cc+=_0x1f19c7[_0x3aa262]+'='+encodeURIComponent(_0xc1e4a0[_0x1f19c7[_0x3aa262]]);_0x233413+=_0xc1e4a0[_0x1f19c7[_0x3aa262]];}_0x233413+=_0x441146[_0xf28c('0x5c')];_0x233413=_0x5bb2c3[_0xf28c('0x5d')]('md5')[_0xf28c('0x17')](_0x233413)[_0xf28c('0x5e')](_0xf28c('0x5f'));if(_0x1642cc!==''){_0x1642cc+='&';}_0x1642cc+=_0xf28c('0x60')+_0x233413;var _0x5c8d10={'method':'GET','uri':_0x441146[_0xf28c('0x51')]+_0xf28c('0x61')+_0x1642cc,'json':!![]};return rp(_0x5c8d10)['then'](function(_0x13c4a9){var _0x223370=Object[_0xf28c('0x5a')](_0x13c4a9);if(_0x13c4a9[_0x223370[0x0]][_0xf28c('0x19')]&&parseInt(_0x13c4a9[_0x223370[0x0]][_0xf28c('0x19')])===0x0){var _0x4e07d6={'messageId':_0x13c4a9[_0x223370[0x0]]['id_sms']};if(!_0x441146[_0xf28c('0x38')]){_0x4e07d6[_0xf28c('0x39')]=!![];}return _0x483953[_0xf28c('0x17')](_0x4e07d6);}else{return logger['error'](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x56'),util[_0xf28c('0x28')](_0x13c4a9[_0xf28c('0x19')],{'showHidden':![],'depth':null}));}})[_0xf28c('0x26')](function(_0x3ed5bf){return logger['error'](_0xf28c('0x27'),'afterCreate','csc',util['inspect'](_0x3ed5bf,{'showHidden':![],'depth':null}));});}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x56'),'Missing\x20parameters:\x20apiKey');}break;case _0xf28c('0x62'):if(_0x441146[_0xf28c('0x5c')]){var _0xca51fa={'method':_0xf28c('0x34'),'uri':_0xf28c('0x63'),'headers':{'Authorization':_0x441146[_0xf28c('0x5c')]},'body':{'content':_0x9b99f3[_0xf28c('0xd')],'to':[_0x9b99f3[_0xf28c('0x20')]],'from':_0x441146[_0xf28c('0x20')],'binary':![],'clientMessageId':_0xf28c('0x64'),'charset':_0xf28c('0x65')},'json':!![]};rp(_0xca51fa)[_0xf28c('0x16')](function(_0x13e12e){if(!_0x13e12e['error']){var _0x10000b={'messageId':_0x13e12e[_0xf28c('0x66')][0x0]['apiMessageId']};if(!_0x441146[_0xf28c('0x38')]){_0x10000b[_0xf28c('0x39')]=!![];}return _0x483953[_0xf28c('0x17')](_0x10000b);}else{return logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x62'),util['inspect'](_0x13e12e[_0xf28c('0x19')],{'showHidden':![],'depth':null}));}})[_0xf28c('0x26')](function(_0x4fab45){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),_0xf28c('0x62'),util[_0xf28c('0x28')](_0x4fab45,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf28c('0x27'),_0xf28c('0x29'),'clickatell',_0xf28c('0x67'));}break;case'bandwidth':if(_0x441146[_0xf28c('0x2d')]&&_0x441146[_0xf28c('0x2e')]){var _0x125639=util[_0xf28c('0x41')](_0xf28c('0x3f'),_0x441146['username'],_0x441146[_0xf28c('0x2e')]);var _0x5e5cf9={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x441146[_0xf28c('0x68')]+_0xf28c('0x69'),'body':{'to':[_0x9b99f3['phone']],'text':_0x9b99f3[_0xf28c('0xd')],'from':_0x441146['phone'],'applicationId':_0x441146[_0xf28c('0x6a')]},'headers':{'Authorization':util[_0xf28c('0x41')](_0xf28c('0x42'),new Buffer(_0x125639)[_0xf28c('0x43')](_0xf28c('0x4d')))},'json':!![]};rp(_0x5e5cf9)['then'](function(_0x51ab49){if(_0x51ab49['id']){var _0x47aaf6={'messageId':_0x51ab49['id']};return _0x483953[_0xf28c('0x17')](_0x47aaf6);}else{logger['error'](_0xf28c('0x27'),'afterCreate','bandwidth',util[_0xf28c('0x28')](_0x51ab49,{'showHidden':![],'depth':null}));}})['catch'](function(_0xcafe92){logger['error'](_0xf28c('0x27'),'afterCreate',_0xf28c('0x6b'),util[_0xf28c('0x28')](_0xcafe92,{'showHidden':![],'depth':null}));});}else{logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf28c('0x6c'):if(_0x441146['apiKey']){var _0x1b4d8c={};var _0x5c8d10={'method':_0xf28c('0x34'),'uri':_0xf28c('0x6d'),'headers':{'Authorization':_0xf28c('0x6e')+_0x441146['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x441146[_0xf28c('0x20')],'to':_0x9b99f3[_0xf28c('0x20')],'text':_0x9b99f3[_0xf28c('0xd')]},'json':!![]};return rp(_0x5c8d10)['then'](function(_0x3cfb53){if(_0x3cfb53['code']==0xca){_0x1b4d8c[_0xf28c('0x6f')]=_0x3cfb53;var _0x65721f={'method':_0xf28c('0x34'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xf28c('0x6e')+_0x441146['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x1b4d8c[_0xf28c('0x6f')][_0xf28c('0x70')]},'json':!![]};return rp(_0x65721f)['then'](function(_0x3931ea){_0x1b4d8c[_0xf28c('0x71')]=_0x3931ea;var _0x4b975b={'messageId':_0x1b4d8c[_0xf28c('0x6f')][_0xf28c('0x70')],'read':!![]};return _0x483953[_0xf28c('0x17')](_0x4b975b);});}else{return logger[_0xf28c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf28c('0x29'),_0xf28c('0x6c'),util['inspect'](_0x3cfb53,{'showHidden':![],'depth':null}));}})['catch'](function(_0x258b2f){return logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x6c'),util['inspect'](_0x258b2f,{'showHidden':![],'depth':null}));});}else{return logger[_0xf28c('0x19')](_0xf28c('0x27'),_0xf28c('0x29'),_0xf28c('0x6c'),_0xf28c('0x72'));}break;}}})[_0xf28c('0x73')](function(){_0x56aa31();});}else{_0x56aa31();}}},'charset':_0xf28c('0x74'),'collate':_0xf28c('0x75')});}; \ No newline at end of file +var _0x414a=['messages','create','body','phone','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','username','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','message_id','clickSend','authId','remote','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','timestamp','keys','sort','length','createHash','md5','digest','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','accountSid'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x414a,0x1e2));var _0xa414=function(_0x3fde79,_0x11e979){_0x3fde79=_0x3fde79-0x0;var _0x4f4edb=_0x414a[_0x3fde79];return _0x4f4edb;};'use strict';var _=require(_0xa414('0x0'));var util=require(_0xa414('0x1'));var logger=require(_0xa414('0x2'))(_0xa414('0x3'));var moment=require(_0xa414('0x4'));var BPromise=require(_0xa414('0x5'));var rp=require(_0xa414('0x6'));var fs=require('fs');var path=require(_0xa414('0x7'));var rimraf=require(_0xa414('0x8'));var config=require(_0xa414('0x9'));var attributes=require('./smsMessage.attributes');module[_0xa414('0xa')]=function(_0x37710f,_0x45dad2){return _0x37710f[_0xa414('0xb')](_0xa414('0xc'),attributes,{'tableName':_0xa414('0xd'),'paranoid':![],'indexes':[{'name':_0xa414('0xe'),'fields':[_0xa414('0xe')]},{'name':_0xa414('0xf'),'fields':['body'],'type':_0xa414('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d40c4,_0x9387c5,_0x1c6e31){var _0x150921=_0x37710f[_0xa414('0x11')];var _0x25e2d4=_0x5d40c4[_0xa414('0x12')]({'plain':!![]});if(_0x25e2d4[_0xa414('0x13')][_0xa414('0x14')]()==='in'||_0x25e2d4[_0xa414('0x13')]['toLowerCase']()===_0xa414('0x15')&&!_0x25e2d4[_0xa414('0x16')]&&!_[_0xa414('0x17')](_0x25e2d4[_0xa414('0x18')])&&!_[_0xa414('0x17')](_0x25e2d4['SmsInteractionId'])){_0x150921[_0xa414('0x19')]['findOne']({'where':{'id':_0x25e2d4[_0xa414('0x1a')]}})[_0xa414('0x1b')](function(_0x56e1b9){if(_0x56e1b9){_0x56e1b9[_0xa414('0x1c')]({'lastMsgAt':_0x25e2d4['createdAt'],'lastMsgDirection':_0x25e2d4[_0xa414('0x13')][_0xa414('0x14')]()});}})[_0xa414('0x1d')](function(_0x462a97){console[_0xa414('0x1e')](_0x462a97);});}if(_0x25e2d4[_0xa414('0x13')]==='out'&&!_0x25e2d4[_0xa414('0x16')]){var _0x40f050;_0x150921[_0xa414('0x1f')][_0xa414('0x20')]({'where':{'id':_0x25e2d4[_0xa414('0x21')]},'raw':!![]})[_0xa414('0x1b')](function(_0x2efa31){_0x40f050=_0x2efa31;if(_0x40f050&&_0x40f050[_0xa414('0x22')]){switch(_0x40f050[_0xa414('0x22')]){case _0xa414('0x23'):var _0x4a9129=require('twilio');if(_0x40f050['accountSid']&&_0x40f050[_0xa414('0x24')]&&_0x40f050['phone']){var _0x3a1271=new _0x4a9129(_0x40f050[_0xa414('0x25')],_0x40f050[_0xa414('0x24')]);_0x3a1271[_0xa414('0x26')][_0xa414('0x27')]({'body':_0x25e2d4[_0xa414('0x28')],'to':_0x25e2d4[_0xa414('0x29')],'from':_0x40f050[_0xa414('0x29')],'statusCallback':_0x40f050['remote']+'/api/sms/messages/'+_0x25e2d4['id']+_0xa414('0x2a')+_0x40f050[_0xa414('0x2b')]})[_0xa414('0x1b')](function(_0x16e0ad){if(_0x16e0ad[_0xa414('0x2c')]){return _0x5d40c4[_0xa414('0x1c')]({'messageId':_0x16e0ad[_0xa414('0x2c')]});}})[_0xa414('0x1d')](function(_0x13ee0e){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa414('0x2d'),'twilio',util[_0xa414('0x2e')](_0x13ee0e,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x23'),_0xa414('0x30'));}break;case'skebby':var _0x2d6c33=_0xa414('0x31');if(_0x40f050['username']&&_0x40f050[_0xa414('0x32')]){var _0x42d809={'recipient':[_0x25e2d4['phone']],'message':_0x25e2d4[_0xa414('0x28')],'message_type':_0x40f050[_0xa414('0x33')]};if(_0x40f050[_0xa414('0x33')]&&_0x40f050['smsMethod']!=='SI'){_0x42d809[_0xa414('0x34')]=_0x40f050[_0xa414('0x29')];}var _0x43fa9e={'url':_0x2d6c33+_0xa414('0x35')+_0x40f050['username']+_0xa414('0x36')+_0x40f050['password'],'method':_0xa414('0x37')};rp(_0x43fa9e)[_0xa414('0x1b')](function(_0x4b6c8f){var _0x23549e=_0x4b6c8f[_0xa414('0x38')](';');var _0x4956f6={'user_key':_0x23549e[0x0],'session_key':_0x23549e[0x1]};_0x43fa9e={'url':_0x2d6c33+_0xa414('0x39'),'method':'POST','headers':{'user_key':_0x4956f6[_0xa414('0x3a')],'Session_key':_0x4956f6[_0xa414('0x3b')]},'json':!![],'body':_0x42d809};return rp(_0x43fa9e);})[_0xa414('0x1b')](function(_0xb4a7df){if(_0xb4a7df[_0xa414('0x3c')]>=0x1){var _0x5e6901={'messageId':_0xb4a7df[_0xa414('0x3d')]};if(_0x40f050[_0xa414('0x33')]!=='GP'||!_0x40f050[_0xa414('0x3e')]){_0x5e6901[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x5e6901);}else{return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),'skebby',util['inspect'](_0xb4a7df,{'showHidden':![],'depth':null}));}})['catch'](function(_0x103126){return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),'skebby',util[_0xa414('0x2e')](_0x103126,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x40'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa414('0x41'):if(_0x40f050['authToken']){var _0x2e78b0={'recipient':_0x25e2d4['phone'],'message':_0x25e2d4[_0xa414('0x28')],'sender':_0x40f050[_0xa414('0x42')]||_0x40f050[_0xa414('0x29')],'authorization':_0x40f050['authToken']};var _0x9387c5={'method':_0xa414('0x43'),'uri':_0xa414('0x44'),'body':_0x2e78b0,'json':!![]};rp(_0x9387c5)[_0xa414('0x1b')](function(_0x5de2a2){var _0x158498={'messageId':_0x5de2a2[_0xa414('0x45')]};if(!_0x40f050[_0xa414('0x3e')]){_0x158498[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x158498);})['catch'](function(_0x5b07c2){logger[_0xa414('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa414('0x41'),util[_0xa414('0x2e')](_0x5b07c2,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x41'),'Missing\x20parameters:\x20authToken');}break;case _0xa414('0x46'):if(_0x40f050[_0xa414('0x47')]&&_0x40f050['password']){var _0x2e78b0={'messages':[{'source':_0xa414('0x48'),'to':_0x25e2d4['phone'],'body':_0x25e2d4[_0xa414('0x28')],'from':_0x40f050[_0xa414('0x42')]||_0x40f050[_0xa414('0x29')]}]};var _0x290ad3=util[_0xa414('0x49')](_0xa414('0x4a'),_0x40f050[_0xa414('0x47')],_0x40f050[_0xa414('0x32')]);var _0x9387c5={'method':_0xa414('0x43'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2e78b0,'headers':{'Authorization':util[_0xa414('0x49')](_0xa414('0x4b'),new Buffer(_0x290ad3)['toString'](_0xa414('0x4c')))},'json':!![]};rp(_0x9387c5)['then'](function(_0x773bcb){if(_0x773bcb[_0xa414('0x4d')]>=0xc8&&_0x773bcb[_0xa414('0x4d')]<=0xce){if(_0x773bcb['data']&&_0x773bcb[_0xa414('0x4e')]['queued_count']>0x0){var _0x12dd5e=_['head'](_0x773bcb[_0xa414('0x4e')][_0xa414('0x26')]);var _0x47ded9={'messageId':_0x12dd5e[_0xa414('0x4f')]};if(!_0x40f050[_0xa414('0x3e')]){_0x47ded9[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x47ded9);}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x50'),util['inspect'](_0x773bcb,{'showHidden':![],'depth':null}));}}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),'clickSend',util[_0xa414('0x2e')](_0x773bcb,{'showHidden':![],'depth':null}));}})[_0xa414('0x1d')](function(_0x313c52){logger['error'](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x50'),util['inspect'](_0x313c52,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x40f050[_0xa414('0x51')]&&_0x40f050['authToken']){var _0x2e78b0={'dst':_0x25e2d4[_0xa414('0x29')],'text':_0x25e2d4['body'],'src':_0x40f050['senderString']||_0x40f050[_0xa414('0x29')],'url':_0x40f050[_0xa414('0x52')]+_0xa414('0x53')+_0x25e2d4['id']+_0xa414('0x2a')+_0x40f050[_0xa414('0x2b')]};var _0x290ad3=util[_0xa414('0x49')](_0xa414('0x4a'),_0x40f050[_0xa414('0x51')],_0x40f050[_0xa414('0x24')]);var _0x9387c5={'method':_0xa414('0x43'),'uri':util['format'](_0xa414('0x54'),_0x40f050[_0xa414('0x51')]),'body':_0x2e78b0,'headers':{'Authorization':util[_0xa414('0x49')]('Basic\x20%s',new Buffer(_0x290ad3)[_0xa414('0x55')]('base64'))},'json':!![]};rp(_0x9387c5)[_0xa414('0x1b')](function(_0x3d43ad){var _0x2c91f1={'messageId':_0x3d43ad[_0xa414('0x56')][0x0]};return _0x5d40c4['update'](_0x2c91f1);})[_0xa414('0x1d')](function(_0x32ab43){logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x57'),util[_0xa414('0x2e')](_0x32ab43,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa414('0x57'),_0xa414('0x58'));}break;case _0xa414('0x59'):if(_0x40f050[_0xa414('0x47')]&&_0x40f050[_0xa414('0x32')]){if(_0x40f050['baseUrl']){var _0x3ef2cb={'method':_0xa414('0x43'),'uri':_0x40f050[_0xa414('0x5a')]+_0xa414('0x5b'),'body':{'username':_0x40f050['username'],'password':_0x40f050[_0xa414('0x32')]},'json':!![]};return rp(_0x3ef2cb)['then'](function(_0xd688a2){var _0x5a14fe={'method':_0xa414('0x43'),'uri':_0x40f050[_0xa414('0x5a')]+_0xa414('0x5c'),'body':{'messages':[{'from':_0x40f050[_0xa414('0x29')],'destinations':[{'to':_0x25e2d4[_0xa414('0x29')]}],'text':_0x25e2d4['body'],'notifyUrl':_0x40f050[_0xa414('0x52')]+_0xa414('0x53')+_0x25e2d4['id']+_0xa414('0x2a')+_0x40f050[_0xa414('0x2b')],'notifyContentType':_0xa414('0x5d'),'callbackData':_0x40f050[_0xa414('0x29')]+';'+_0x25e2d4[_0xa414('0x28')]}]},'headers':{'Authorization':_0xa414('0x5e')+_0xd688a2[_0xa414('0x2b')]},'json':!![]};return rp(_0x5a14fe)['then'](function(_0x861e24){if(_0x861e24[_0xa414('0x26')]){var _0x1d4084={'messageId':_0x861e24[_0xa414('0x26')][0x0][_0xa414('0xe')]};if(!_0x40f050[_0xa414('0x3e')]){_0x1d4084[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x1d4084);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa414('0x2d'),_0xa414('0x59'),util[_0xa414('0x2e')](_0x861e24,{'showHidden':![],'depth':null}));}});})[_0xa414('0x1d')](function(_0x2ea4af){return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),'infobip',util[_0xa414('0x2e')](_0x2ea4af,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x59'),_0xa414('0x5f'));}}else{logger[_0xa414('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa414('0x59'),_0xa414('0x60'));}break;case _0xa414('0x61'):var _0x427186=require(_0xa414('0x62'));if(_0x40f050[_0xa414('0x63')]){var _0x4f379d={};_0x4f379d['login']=_0x40f050[_0xa414('0x47')];_0x4f379d[_0xa414('0x29')]=_0x25e2d4[_0xa414('0x29')];_0x4f379d[_0xa414('0x34')]=_0x40f050[_0xa414('0x29')];_0x4f379d['text']=_0x25e2d4['body'];_0x4f379d[_0xa414('0x64')]=+new Date();var _0x4e2a52='';var _0x43af59='';var _0x4def9f=Object[_0xa414('0x65')](_0x4f379d);_0x4def9f[_0xa414('0x66')]();for(var _0xad7540=0x0;_0xad7540<_0x4def9f[_0xa414('0x67')];_0xad7540++){if(_0x4e2a52!=''){_0x4e2a52+='&';}_0x4e2a52+=_0x4def9f[_0xad7540]+'='+encodeURIComponent(_0x4f379d[_0x4def9f[_0xad7540]]);_0x43af59+=_0x4f379d[_0x4def9f[_0xad7540]];}_0x43af59+=_0x40f050[_0xa414('0x63')];_0x43af59=_0x427186[_0xa414('0x68')](_0xa414('0x69'))[_0xa414('0x1c')](_0x43af59)[_0xa414('0x6a')](_0xa414('0x6b'));if(_0x4e2a52!==''){_0x4e2a52+='&';}_0x4e2a52+='signature='+_0x43af59;var _0x43fa9e={'method':_0xa414('0x37'),'uri':_0x40f050[_0xa414('0x5a')]+_0xa414('0x6c')+_0x4e2a52,'json':!![]};return rp(_0x43fa9e)[_0xa414('0x1b')](function(_0x496d8e){var _0x53c3a6=Object[_0xa414('0x65')](_0x496d8e);if(_0x496d8e[_0x53c3a6[0x0]][_0xa414('0x1e')]&&parseInt(_0x496d8e[_0x53c3a6[0x0]][_0xa414('0x1e')])===0x0){var _0x40269c={'messageId':_0x496d8e[_0x53c3a6[0x0]]['id_sms']};if(!_0x40f050[_0xa414('0x3e')]){_0x40269c[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x40269c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa414('0x2d'),_0xa414('0x61'),util[_0xa414('0x2e')](_0x496d8e[_0xa414('0x1e')],{'showHidden':![],'depth':null}));}})[_0xa414('0x1d')](function(_0x1294bd){return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),'csc',util[_0xa414('0x2e')](_0x1294bd,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x61'),_0xa414('0x6d'));}break;case _0xa414('0x6e'):if(_0x40f050[_0xa414('0x63')]){var _0x1b70bb={'method':'POST','uri':_0xa414('0x6f'),'headers':{'Authorization':_0x40f050[_0xa414('0x63')]},'body':{'content':_0x25e2d4[_0xa414('0x28')],'to':[_0x25e2d4[_0xa414('0x29')]],'from':_0x40f050[_0xa414('0x29')],'binary':![],'clientMessageId':'uuid','charset':_0xa414('0x70')},'json':!![]};rp(_0x1b70bb)[_0xa414('0x1b')](function(_0x38e74f){if(!_0x38e74f['error']){var _0x5db713={'messageId':_0x38e74f[_0xa414('0x26')][0x0][_0xa414('0x71')]};if(!_0x40f050[_0xa414('0x3e')]){_0x5db713[_0xa414('0x3f')]=!![];}return _0x5d40c4[_0xa414('0x1c')](_0x5db713);}else{return logger['error'](_0xa414('0x2f'),'afterCreate','clickatell',util['inspect'](_0x38e74f[_0xa414('0x1e')],{'showHidden':![],'depth':null}));}})[_0xa414('0x1d')](function(_0x292849){return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x6e'),util['inspect'](_0x292849,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),'afterCreate',_0xa414('0x6e'),_0xa414('0x6d'));}break;case _0xa414('0x72'):if(_0x40f050[_0xa414('0x47')]&&_0x40f050[_0xa414('0x32')]){var _0x290ad3=util[_0xa414('0x49')](_0xa414('0x4a'),_0x40f050[_0xa414('0x47')],_0x40f050[_0xa414('0x32')]);var _0x9387c5={'method':_0xa414('0x43'),'uri':_0xa414('0x73')+_0x40f050[_0xa414('0x74')]+'/messages','body':{'to':[_0x25e2d4[_0xa414('0x29')]],'text':_0x25e2d4['body'],'from':_0x40f050[_0xa414('0x29')],'applicationId':_0x40f050[_0xa414('0x75')]},'headers':{'Authorization':util['format'](_0xa414('0x4b'),new Buffer(_0x290ad3)[_0xa414('0x55')](_0xa414('0x4c')))},'json':!![]};rp(_0x9387c5)['then'](function(_0x5c5f37){if(_0x5c5f37['id']){var _0x505cc0={'messageId':_0x5c5f37['id']};return _0x5d40c4[_0xa414('0x1c')](_0x505cc0);}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),'afterCreate',_0xa414('0x72'),util[_0xa414('0x2e')](_0x5c5f37,{'showHidden':![],'depth':null}));}})[_0xa414('0x1d')](function(_0x4c74b2){logger['error'](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x72'),util[_0xa414('0x2e')](_0x4c74b2,{'showHidden':![],'depth':null}));});}else{logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x72'),_0xa414('0x60'));}break;case _0xa414('0x76'):if(_0x40f050[_0xa414('0x63')]){var _0x35ecde={};var _0x43fa9e={'method':_0xa414('0x43'),'uri':_0xa414('0x77'),'headers':{'Authorization':_0xa414('0x78')+_0x40f050[_0xa414('0x63')],'Content-Type':_0xa414('0x5d')},'body':{'from':_0x40f050[_0xa414('0x29')],'to':_0x25e2d4[_0xa414('0x29')],'text':_0x25e2d4[_0xa414('0x28')]},'json':!![]};return rp(_0x43fa9e)[_0xa414('0x1b')](function(_0x28c90a){if(_0x28c90a[_0xa414('0x79')]==0xca){_0x35ecde[_0xa414('0x7a')]=_0x28c90a;var _0x238af2={'method':'POST','uri':_0xa414('0x7b'),'headers':{'Authorization':'Bearer\x20'+_0x40f050[_0xa414('0x63')],'Content-Type':_0xa414('0x5d')},'body':{'refid':_0x35ecde[_0xa414('0x7a')][_0xa414('0x7c')]},'json':!![]};return rp(_0x238af2)[_0xa414('0x1b')](function(_0x2617d0){_0x35ecde[_0xa414('0x7d')]=_0x2617d0;var _0x1ec9f8={'messageId':_0x35ecde[_0xa414('0x7a')][_0xa414('0x7c')],'read':!![]};return _0x5d40c4[_0xa414('0x1c')](_0x1ec9f8);});}else{return logger['error'](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x76'),util[_0xa414('0x2e')](_0x28c90a,{'showHidden':![],'depth':null}));}})[_0xa414('0x1d')](function(_0xdcb83){return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x76'),util['inspect'](_0xdcb83,{'showHidden':![],'depth':null}));});}else{return logger[_0xa414('0x1e')](_0xa414('0x2f'),_0xa414('0x2d'),_0xa414('0x76'),_0xa414('0x7e'));}break;}}})[_0xa414('0x7f')](function(){_0x1c6e31();});}else{_0x1c6e31();}}},'charset':_0xa414('0x80'),'collate':_0xa414('0x81')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8aca546..db6ffca 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 _0x4ef6=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsMessage,\x20%s,\x20%s','CreateSmsMessage','create','options','debug','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x4ef6,0xc6));var _0x64ef=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x4ef6[_0x47e549];return _0x251374;};'use strict';var _=require('lodash');var util=require(_0x64ef('0x0'));var moment=require(_0x64ef('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64ef('0x2'))['db'];var utils=require(_0x64ef('0x3'));var logger=require(_0x64ef('0x4'))(_0x64ef('0x5'));var config=require('../../config/environment');var jayson=require(_0x64ef('0x6'));var client=jayson[_0x64ef('0x7')][_0x64ef('0x8')]({'port':0x232a});config[_0x64ef('0x9')]=_[_0x64ef('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x64ef('0xb'))(new Redis(config[_0x64ef('0x9')]));require(_0x64ef('0xc'))[_0x64ef('0xd')](socket);function respondWithRpcPromise(_0x177bc6,_0x425adb,_0x4b9d03){return new BPromise(function(_0x20bd5e,_0x1b7402){return client['request'](_0x177bc6,_0x4b9d03)[_0x64ef('0xe')](function(_0xb5a804){logger[_0x64ef('0xf')]('SmsMessage,\x20%s,\x20%s',_0x425adb,_0x64ef('0x10'));logger['debug'](_0x64ef('0x11'),_0x425adb,'request\x20sent',JSON[_0x64ef('0x12')](_0xb5a804));if(_0xb5a804[_0x64ef('0x13')]){if(_0xb5a804[_0x64ef('0x13')][_0x64ef('0x14')]===0x1f4){logger[_0x64ef('0x13')]('SmsMessage,\x20%s,\x20%s',_0x425adb,_0xb5a804[_0x64ef('0x13')][_0x64ef('0x15')]);return _0x1b7402(_0xb5a804[_0x64ef('0x13')]['message']);}logger[_0x64ef('0x13')]('SmsMessage,\x20%s,\x20%s',_0x425adb,_0xb5a804['error']['message']);return _0x20bd5e(_0xb5a804[_0x64ef('0x13')]['message']);}else{logger[_0x64ef('0xf')]('SmsMessage,\x20%s,\x20%s',_0x425adb,_0x64ef('0x10'));_0x20bd5e(_0xb5a804[_0x64ef('0x16')]['message']);}})[_0x64ef('0x17')](function(_0x4ba6e5){logger['error'](_0x64ef('0x18'),_0x425adb,_0x4ba6e5);_0x1b7402(_0x4ba6e5);});});}exports[_0x64ef('0x19')]=function(_0x2d0cd4){var _0x52971b=this;return new Promise(function(_0x51277d,_0x823572){return db['SmsMessage'][_0x64ef('0x1a')](_0x2d0cd4['body'],{'raw':_0x2d0cd4[_0x64ef('0x1b')]?_0x2d0cd4['options']['raw']===undefined?!![]:![]:!![]})[_0x64ef('0xe')](function(_0x2d0be9){logger[_0x64ef('0xf')](_0x64ef('0x19'),_0x2d0cd4);logger[_0x64ef('0x1c')](_0x64ef('0x19'),_0x2d0cd4,JSON[_0x64ef('0x12')](_0x2d0be9));_0x51277d(_0x2d0be9);})[_0x64ef('0x17')](function(_0x3acec5){logger[_0x64ef('0x13')](_0x64ef('0x19'),_0x3acec5[_0x64ef('0x15')],_0x2d0cd4);_0x823572(_0x52971b[_0x64ef('0x13')](0x1f4,_0x3acec5[_0x64ef('0x15')]));});});}; \ No newline at end of file +var _0x9257=['rpc','../../config/environment','client','http','redis','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','create','body','options','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x436d97,_0x9bc3eb){var _0x1df222=function(_0x52ea61){while(--_0x52ea61){_0x436d97['push'](_0x436d97['shift']());}};_0x1df222(++_0x9bc3eb);}(_0x9257,0x6b));var _0x7925=function(_0x28c4db,_0x2ccd05){_0x28c4db=_0x28c4db-0x0;var _0x5907ed=_0x9257[_0x28c4db];return _0x5907ed;};'use strict';var _=require(_0x7925('0x0'));var util=require(_0x7925('0x1'));var moment=require(_0x7925('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7925('0x3'));var db=require(_0x7925('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7925('0x5'));var config=require(_0x7925('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7925('0x7')][_0x7925('0x8')]({'port':0x232a});config[_0x7925('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7925('0xa'))(new Redis(config[_0x7925('0x9')]));require('./smsMessage.socket')[_0x7925('0xb')](socket);function respondWithRpcPromise(_0x10b3e9,_0x5f1255,_0x2d4ed9){return new BPromise(function(_0x5188b3,_0x458527){return client[_0x7925('0xc')](_0x10b3e9,_0x2d4ed9)[_0x7925('0xd')](function(_0x2bbc0a){logger[_0x7925('0xe')](_0x7925('0xf'),_0x5f1255,_0x7925('0x10'));logger[_0x7925('0x11')](_0x7925('0x12'),_0x5f1255,'request\x20sent',JSON[_0x7925('0x13')](_0x2bbc0a));if(_0x2bbc0a[_0x7925('0x14')]){if(_0x2bbc0a[_0x7925('0x14')]['code']===0x1f4){logger[_0x7925('0x14')](_0x7925('0xf'),_0x5f1255,_0x2bbc0a[_0x7925('0x14')][_0x7925('0x15')]);return _0x458527(_0x2bbc0a[_0x7925('0x14')][_0x7925('0x15')]);}logger['error'](_0x7925('0xf'),_0x5f1255,_0x2bbc0a[_0x7925('0x14')][_0x7925('0x15')]);return _0x5188b3(_0x2bbc0a[_0x7925('0x14')]['message']);}else{logger[_0x7925('0xe')]('SmsMessage,\x20%s,\x20%s',_0x5f1255,_0x7925('0x10'));_0x5188b3(_0x2bbc0a[_0x7925('0x16')][_0x7925('0x15')]);}})[_0x7925('0x17')](function(_0x3e7fac){logger['error'](_0x7925('0xf'),_0x5f1255,_0x3e7fac);_0x458527(_0x3e7fac);});});}exports[_0x7925('0x18')]=function(_0x933482){var _0x1a5049=this;return new Promise(function(_0x5ce831,_0x4edb36){return db['SmsMessage'][_0x7925('0x19')](_0x933482[_0x7925('0x1a')],{'raw':_0x933482[_0x7925('0x1b')]?_0x933482[_0x7925('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x7925('0xd')](function(_0x3c4408){logger[_0x7925('0xe')](_0x7925('0x18'),_0x933482);logger['debug']('CreateSmsMessage',_0x933482,JSON['stringify'](_0x3c4408));_0x5ce831(_0x3c4408);})[_0x7925('0x17')](function(_0x5cbb57){logger[_0x7925('0x14')]('CreateSmsMessage',_0x5cbb57[_0x7925('0x15')],_0x933482);_0x4edb36(_0x1a5049[_0x7925('0x14')](0x1f4,_0x5cbb57[_0x7925('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c1227d3..9f63852 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 _0x96d7=['register','save','update'];(function(_0x1bb939,_0x5905e9){var _0xf8e8a6=function(_0xb86dce){while(--_0xb86dce){_0x1bb939['push'](_0x1bb939['shift']());}};_0xf8e8a6(++_0x5905e9);}(_0x96d7,0x184));var _0x796d=function(_0x558ce2,_0x1adca8){_0x558ce2=_0x558ce2-0x0;var _0x1d0ab7=_0x96d7[_0x558ce2];return _0x1d0ab7;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x796d('0x0'),'remove',_0x796d('0x1')];function createListener(_0x1f4244,_0xde7649){return function(_0xa51582){_0xde7649['emit'](_0x1f4244,_0xa51582);};}function removeListener(_0x170f40,_0x4d4a6f){return function(){SmsMessageEvents['removeListener'](_0x170f40,_0x4d4a6f);};}exports[_0x796d('0x2')]=function(_0x5d55b8){for(var _0x1f302b=0x0,_0x11d2f6=events['length'];_0x1f302b<_0x11d2f6;_0x1f302b++){var _0x309dd2=events[_0x1f302b];var _0x5cb7c5=createListener('smsMessage:'+_0x309dd2,_0x5d55b8);SmsMessageEvents['on'](_0x309dd2,_0x5cb7c5);}}; \ No newline at end of file +var _0xb3a2=['./smsMessage.events','save','remove','update','removeListener','register','length','smsMessage:'];(function(_0x4b3cc3,_0x3085d0){var _0x5c0f4b=function(_0x50fbac){while(--_0x50fbac){_0x4b3cc3['push'](_0x4b3cc3['shift']());}};_0x5c0f4b(++_0x3085d0);}(_0xb3a2,0x68));var _0x2b3a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb3a2[_0x16b9ed];return _0x66b1f8;};'use strict';var SmsMessageEvents=require(_0x2b3a('0x0'));var events=[_0x2b3a('0x1'),_0x2b3a('0x2'),_0x2b3a('0x3')];function createListener(_0x2b9cbd,_0xd95426){return function(_0x4f7412){_0xd95426['emit'](_0x2b9cbd,_0x4f7412);};}function removeListener(_0xaac583,_0x1f490b){return function(){SmsMessageEvents[_0x2b3a('0x4')](_0xaac583,_0x1f490b);};}exports[_0x2b3a('0x5')]=function(_0x49ee13){for(var _0x2bbf77=0x0,_0xf6368c=events[_0x2b3a('0x6')];_0x2bbf77<_0xf6368c;_0x2bbf77++){var _0x2c6cff=events[_0x2bbf77];var _0x539bd9=createListener(_0x2b3a('0x7')+_0x2c6cff,_0x49ee13);SmsMessageEvents['on'](_0x2c6cff,_0x539bd9);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6f91394..5e725b5 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 _0xf2cc=['isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','put','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf2cc,0xc8));var _0xcf2c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf2cc[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0xcf2c('0x0'));var path=require(_0xcf2c('0x1'));var timeout=require(_0xcf2c('0x2'));var express=require('express');var router=express[_0xcf2c('0x3')]();var fs_extra=require(_0xcf2c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcf2c('0x5'));var config=require(_0xcf2c('0x6'));var controller=require(_0xcf2c('0x7'));router['get']('/',auth[_0xcf2c('0x8')](),controller['index']);router[_0xcf2c('0x9')](_0xcf2c('0xa'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0xb')]);router[_0xcf2c('0x9')](_0xcf2c('0xc'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0xd')]);router[_0xcf2c('0x9')](_0xcf2c('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xcf2c('0xf'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0x10')]);router['get'](_0xcf2c('0x11'),auth['isAuthenticated'](),controller[_0xcf2c('0x12')]);router['post']('/',auth[_0xcf2c('0x8')](),controller['create']);router['post'](_0xcf2c('0xf'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0x13')]);router[_0xcf2c('0x14')](_0xcf2c('0x11'),auth[_0xcf2c('0x8')](),controller['addAgents']);router[_0xcf2c('0x15')](_0xcf2c('0xc'),auth[_0xcf2c('0x8')](),controller['update']);router[_0xcf2c('0x16')](_0xcf2c('0xc'),auth['isAuthenticated'](),controller[_0xcf2c('0x17')]);router[_0xcf2c('0x16')](_0xcf2c('0xf'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0x18')]);router[_0xcf2c('0x16')](_0xcf2c('0x11'),auth[_0xcf2c('0x8')](),controller[_0xcf2c('0x19')]);module['exports']=router; \ No newline at end of file +var _0x178c=['post','/:id/teams','addTeams','addAgents','put','delete','removeTeams','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','create'];(function(_0x40e618,_0x49ba46){var _0x1e7446=function(_0x41c29f){while(--_0x41c29f){_0x40e618['push'](_0x40e618['shift']());}};_0x1e7446(++_0x49ba46);}(_0x178c,0xc5));var _0xc178=function(_0xa7efcc,_0x5600bf){_0xa7efcc=_0xa7efcc-0x0;var _0x2e6497=_0x178c[_0xa7efcc];return _0x2e6497;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc178('0x0'));var timeout=require(_0xc178('0x1'));var express=require(_0xc178('0x2'));var router=express[_0xc178('0x3')]();var fs_extra=require(_0xc178('0x4'));var auth=require(_0xc178('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc178('0x6'));var controller=require('./smsQueue.controller');router[_0xc178('0x7')]('/',auth['isAuthenticated'](),controller[_0xc178('0x8')]);router[_0xc178('0x7')](_0xc178('0x9'),auth[_0xc178('0xa')](),controller[_0xc178('0xb')]);router['get'](_0xc178('0xc'),auth[_0xc178('0xa')](),controller[_0xc178('0xd')]);router[_0xc178('0x7')]('/:id/members',auth[_0xc178('0xa')](),controller[_0xc178('0xe')]);router[_0xc178('0x7')]('/:id/teams',auth[_0xc178('0xa')](),controller[_0xc178('0xf')]);router[_0xc178('0x7')](_0xc178('0x10'),auth['isAuthenticated'](),controller[_0xc178('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc178('0x12')]);router[_0xc178('0x13')](_0xc178('0x14'),auth[_0xc178('0xa')](),controller[_0xc178('0x15')]);router[_0xc178('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xc178('0x16')]);router[_0xc178('0x17')](_0xc178('0xc'),auth[_0xc178('0xa')](),controller['update']);router[_0xc178('0x18')](_0xc178('0xc'),auth[_0xc178('0xa')](),controller['destroy']);router['delete'](_0xc178('0x14'),auth[_0xc178('0xa')](),controller[_0xc178('0x19')]);router[_0xc178('0x18')](_0xc178('0x10'),auth[_0xc178('0xa')](),controller['removeAgents']);module[_0xc178('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 93233be..899796b 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 _0xc34a=['sequelize','exports','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x53e720,_0x2c4c99){var _0x4aa714=function(_0x21bc45){while(--_0x21bc45){_0x53e720['push'](_0x53e720['shift']());}};_0x4aa714(++_0x2c4c99);}(_0xc34a,0xbd));var _0xac34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac34('0x0'));module[_0xac34('0x1')]={'name':{'type':Sequelize[_0xac34('0x2')],'unique':_0xac34('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac34('0x2')]},'timeout':{'type':Sequelize[_0xac34('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac34('0x5')]('rrmemory','beepall',_0xac34('0x6'))}}; \ No newline at end of file +var _0x7c6c=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x18b7eb,_0x19e89d){var _0x525d5e=function(_0x4b9e34){while(--_0x4b9e34){_0x18b7eb['push'](_0x18b7eb['shift']());}};_0x525d5e(++_0x19e89d);}(_0x7c6c,0x1c9));var _0xc7c6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7c6c[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xc7c6('0x0'));module[_0xc7c6('0x1')]={'name':{'type':Sequelize[_0xc7c6('0x2')],'unique':_0xc7c6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc7c6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc7c6('0x4')](_0xc7c6('0x5'),_0xc7c6('0x6'),_0xc7c6('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4e624af..cce67c6 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 _0xeb37=['compact','transaction','removeTeams','removeAgents','forEach','emit','userSmsQueue:remove','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','merge','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','findOrCreate','userSmsQueue:save','field','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','union'];(function(_0x22ce68,_0x37ef28){var _0x2a0319=function(_0x4ba5c8){while(--_0x4ba5c8){_0x22ce68['push'](_0x22ce68['shift']());}};_0x2a0319(++_0x37ef28);}(_0xeb37,0x1ad));var _0x7eb3=function(_0x2c4585,_0x2297fc){_0x2c4585=_0x2c4585-0x0;var _0x417bb0=_0xeb37[_0x2c4585];return _0x417bb0;};'use strict';var emlformat=require(_0x7eb3('0x0'));var rimraf=require(_0x7eb3('0x1'));var zipdir=require(_0x7eb3('0x2'));var jsonpatch=require(_0x7eb3('0x3'));var rp=require(_0x7eb3('0x4'));var moment=require(_0x7eb3('0x5'));var BPromise=require(_0x7eb3('0x6'));var Mustache=require(_0x7eb3('0x7'));var util=require(_0x7eb3('0x8'));var path=require(_0x7eb3('0x9'));var sox=require(_0x7eb3('0xa'));var csv=require(_0x7eb3('0xb'));var ejs=require(_0x7eb3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7eb3('0xd'));var crypto=require(_0x7eb3('0xe'));var jsforce=require(_0x7eb3('0xf'));var deskjs=require(_0x7eb3('0x10'));var toCsv=require(_0x7eb3('0xb'));var querystring=require('querystring');var Papa=require(_0x7eb3('0x11'));var Redis=require(_0x7eb3('0x12'));var authService=require(_0x7eb3('0x13'));var qs=require(_0x7eb3('0x14'));var as=require(_0x7eb3('0x15'));var hardwareService=require(_0x7eb3('0x16'));var logger=require(_0x7eb3('0x17'))(_0x7eb3('0x18'));var utils=require(_0x7eb3('0x19'));var config=require(_0x7eb3('0x1a'));var licenseUtil=require(_0x7eb3('0x1b'));var db=require(_0x7eb3('0x1c'))['db'];config[_0x7eb3('0x1d')]=_['defaults'](config[_0x7eb3('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x7eb3('0x1e'))(new Redis(config[_0x7eb3('0x1d')]));require(_0x7eb3('0x1f'))[_0x7eb3('0x20')](socket);function respondWithStatusCode(_0x5e252f,_0x35f3ea){_0x35f3ea=_0x35f3ea||0xcc;return function(_0x3d370e){if(_0x3d370e){return _0x5e252f[_0x7eb3('0x21')](_0x35f3ea);}return _0x5e252f[_0x7eb3('0x22')](_0x35f3ea)[_0x7eb3('0x23')]();};}function respondWithResult(_0x37bbbf,_0x482f29){_0x482f29=_0x482f29||0xc8;return function(_0x57037c){if(_0x57037c){return _0x37bbbf[_0x7eb3('0x22')](_0x482f29)[_0x7eb3('0x24')](_0x57037c);}};}function respondWithFilteredResult(_0x1433fd,_0x548830){return function(_0x262ef9){if(_0x262ef9){var _0x1bd814=typeof _0x548830['offset']==='undefined'&&typeof _0x548830['limit']===_0x7eb3('0x25');var _0x21994b=_0x262ef9[_0x7eb3('0x26')];var _0x4572d5=_0x1bd814?0x0:_0x548830[_0x7eb3('0x27')];var _0x4bb323=_0x1bd814?_0x262ef9[_0x7eb3('0x26')]:_0x548830[_0x7eb3('0x27')]+_0x548830['limit'];var _0x1fbdad;if(_0x4bb323>=_0x21994b){_0x4bb323=_0x21994b;_0x1fbdad=0xc8;}else{_0x1fbdad=0xce;}_0x1433fd[_0x7eb3('0x22')](_0x1fbdad);return _0x1433fd[_0x7eb3('0x28')]('Content-Range',_0x4572d5+'-'+_0x4bb323+'/'+_0x21994b)[_0x7eb3('0x24')](_0x262ef9);}return null;};}function patchUpdates(_0x4f5d19){return function(_0x46a15a){try{jsonpatch[_0x7eb3('0x29')](_0x46a15a,_0x4f5d19,!![]);}catch(_0x16d643){return BPromise[_0x7eb3('0x2a')](_0x16d643);}return _0x46a15a[_0x7eb3('0x2b')]();};}function saveUpdates(_0x445b6a,_0x3063b9){return function(_0xc76a5b){if(_0xc76a5b){return _0xc76a5b[_0x7eb3('0x2c')](_0x445b6a)[_0x7eb3('0x2d')](function(_0x32a4f9){return _0x32a4f9;});}return null;};}function removeEntity(_0x517c88,_0xabd430){return function(_0x35211b){if(_0x35211b){return _0x35211b[_0x7eb3('0x2e')]()[_0x7eb3('0x2d')](function(){var _0x48614d=_0x35211b[_0x7eb3('0x2f')]({'plain':!![]});var _0xa4d1a=_0x7eb3('0x30');return db[_0x7eb3('0x31')][_0x7eb3('0x2e')]({'where':{'type':_0xa4d1a,'resourceId':_0x48614d['id']}})[_0x7eb3('0x2d')](function(){return _0x35211b;});})[_0x7eb3('0x2d')](function(){_0x517c88[_0x7eb3('0x22')](0xcc)[_0x7eb3('0x23')]();});}};}function handleEntityNotFound(_0x2e6964,_0x4723ee){return function(_0x501b78){if(!_0x501b78){_0x2e6964['sendStatus'](0x194);}return _0x501b78;};}function handleError(_0x3130f2,_0x15ed37){_0x15ed37=_0x15ed37||0x1f4;return function(_0x33a643){logger[_0x7eb3('0x32')](_0x33a643[_0x7eb3('0x33')]);if(_0x33a643[_0x7eb3('0x34')]){delete _0x33a643[_0x7eb3('0x34')];}_0x3130f2[_0x7eb3('0x22')](_0x15ed37)[_0x7eb3('0x35')](_0x33a643);};}exports[_0x7eb3('0x36')]=function(_0x586288,_0x3d09b8){var _0xeceba9={},_0x3b2a8b={},_0x3b252d={'count':0x0,'rows':[]};var _0x1f8e03=_[_0x7eb3('0x37')](db[_0x7eb3('0x38')]['rawAttributes'],function(_0x198a54){return{'name':_0x198a54['fieldName'],'type':_0x198a54[_0x7eb3('0x39')]['key']};});_0x3b2a8b[_0x7eb3('0x3a')]=_[_0x7eb3('0x37')](_0x1f8e03,_0x7eb3('0x34'));_0x3b2a8b['query']=_[_0x7eb3('0x3b')](_0x586288['query']);_0x3b2a8b[_0x7eb3('0x3c')]=_[_0x7eb3('0x3d')](_0x3b2a8b[_0x7eb3('0x3a')],_0x3b2a8b[_0x7eb3('0x3e')]);_0xeceba9[_0x7eb3('0x3f')]=_['intersection'](_0x3b2a8b[_0x7eb3('0x3a')],qs['fields'](_0x586288['query'][_0x7eb3('0x40')]));_0xeceba9[_0x7eb3('0x3f')]=_0xeceba9[_0x7eb3('0x3f')][_0x7eb3('0x41')]?_0xeceba9[_0x7eb3('0x3f')]:_0x3b2a8b['model'];if(!_0x586288['query'][_0x7eb3('0x42')](_0x7eb3('0x43'))){_0xeceba9[_0x7eb3('0x44')]=qs[_0x7eb3('0x44')](_0x586288[_0x7eb3('0x3e')][_0x7eb3('0x44')]);_0xeceba9['offset']=qs[_0x7eb3('0x27')](_0x586288[_0x7eb3('0x3e')][_0x7eb3('0x27')]);}_0xeceba9[_0x7eb3('0x45')]=qs[_0x7eb3('0x46')](_0x586288[_0x7eb3('0x3e')]['sort']);_0xeceba9[_0x7eb3('0x47')]=qs[_0x7eb3('0x3c')](_[_0x7eb3('0x48')](_0x586288[_0x7eb3('0x3e')],_0x3b2a8b[_0x7eb3('0x3c')]),_0x1f8e03);if(_0x586288[_0x7eb3('0x3e')][_0x7eb3('0x49')]){_0xeceba9[_0x7eb3('0x47')]=_['merge'](_0xeceba9[_0x7eb3('0x47')],{'$or':_['map'](_0x1f8e03,function(_0xc7846c){if(_0xc7846c['type']!==_0x7eb3('0x4a')){var _0x3a62f8={};_0x3a62f8[_0xc7846c[_0x7eb3('0x34')]]={'$like':'%'+_0x586288[_0x7eb3('0x3e')][_0x7eb3('0x49')]+'%'};return _0x3a62f8;}})});}_0xeceba9=_['merge']({},_0xeceba9,_0x586288[_0x7eb3('0x4b')]);var _0x11f0db={'where':_0xeceba9['where']};return db[_0x7eb3('0x38')][_0x7eb3('0x26')](_0x11f0db)[_0x7eb3('0x2d')](function(_0x581b0b){_0x3b252d[_0x7eb3('0x26')]=_0x581b0b;if(_0x586288['query'][_0x7eb3('0x4c')]){_0xeceba9['include']=[{'all':!![]}];}return db[_0x7eb3('0x38')][_0x7eb3('0x4d')](_0xeceba9);})[_0x7eb3('0x2d')](function(_0x292b84){_0x3b252d['rows']=_0x292b84;return _0x3b252d;})[_0x7eb3('0x2d')](respondWithFilteredResult(_0x3d09b8,_0xeceba9))[_0x7eb3('0x4e')](handleError(_0x3d09b8,null));};exports['show']=function(_0x13d903,_0x384b4d){var _0x19899a={'raw':!![],'where':{'id':_0x13d903[_0x7eb3('0x4f')]['id']}},_0x296c3d={};_0x296c3d[_0x7eb3('0x3a')]=_[_0x7eb3('0x3b')](db[_0x7eb3('0x38')][_0x7eb3('0x50')]);_0x296c3d['query']=_[_0x7eb3('0x3b')](_0x13d903[_0x7eb3('0x3e')]);_0x296c3d['filters']=_[_0x7eb3('0x3d')](_0x296c3d[_0x7eb3('0x3a')],_0x296c3d['query']);_0x19899a[_0x7eb3('0x3f')]=_[_0x7eb3('0x3d')](_0x296c3d[_0x7eb3('0x3a')],qs[_0x7eb3('0x40')](_0x13d903['query'][_0x7eb3('0x40')]));_0x19899a[_0x7eb3('0x3f')]=_0x19899a[_0x7eb3('0x3f')][_0x7eb3('0x41')]?_0x19899a['attributes']:_0x296c3d[_0x7eb3('0x3a')];if(_0x13d903[_0x7eb3('0x3e')][_0x7eb3('0x4c')]){_0x19899a[_0x7eb3('0x51')]=[{'all':!![]}];}_0x19899a=_[_0x7eb3('0x52')]({},_0x19899a,_0x13d903['options']);return db[_0x7eb3('0x38')]['find'](_0x19899a)['then'](handleEntityNotFound(_0x384b4d,null))['then'](respondWithResult(_0x384b4d,null))['catch'](handleError(_0x384b4d,null));};exports[_0x7eb3('0x53')]=function(_0x3cf163,_0x1d4229){return db[_0x7eb3('0x38')][_0x7eb3('0x53')](_0x3cf163['body'],{})['then'](function(_0x2d9764){var _0x4c4a68=_0x3cf163['user'][_0x7eb3('0x2f')]({'plain':!![]});if(!_0x4c4a68)throw new Error(_0x7eb3('0x54'));if(_0x4c4a68[_0x7eb3('0x55')]===_0x7eb3('0x56')){var _0x2d4afc=_0x2d9764[_0x7eb3('0x2f')]({'plain':!![]});var _0x5e8fa0=_0x7eb3('0x30');return db[_0x7eb3('0x57')][_0x7eb3('0x58')]({'where':{'name':_0x5e8fa0,'userProfileId':_0x4c4a68[_0x7eb3('0x59')]},'raw':!![]})[_0x7eb3('0x2d')](function(_0x1bfb44){if(_0x1bfb44&&_0x1bfb44[_0x7eb3('0x5a')]===0x0){return db[_0x7eb3('0x31')][_0x7eb3('0x53')]({'name':_0x2d4afc[_0x7eb3('0x34')],'resourceId':_0x2d4afc['id'],'type':_0x1bfb44[_0x7eb3('0x34')],'sectionId':_0x1bfb44['id']},{})[_0x7eb3('0x2d')](function(){return _0x2d9764;});}else{return _0x2d9764;}})[_0x7eb3('0x4e')](function(_0x6f380d){logger[_0x7eb3('0x32')](_0x7eb3('0x5b'),_0x6f380d);throw _0x6f380d;});}return _0x2d9764;})[_0x7eb3('0x2d')](respondWithResult(_0x1d4229,0xc9))[_0x7eb3('0x4e')](handleError(_0x1d4229,null));};exports[_0x7eb3('0x2c')]=function(_0x2a3ef0,_0x588311){if(_0x2a3ef0[_0x7eb3('0x5c')]['id']){delete _0x2a3ef0[_0x7eb3('0x5c')]['id'];}return db[_0x7eb3('0x38')][_0x7eb3('0x58')]({'where':{'id':_0x2a3ef0['params']['id']}})[_0x7eb3('0x2d')](handleEntityNotFound(_0x588311,null))['then'](saveUpdates(_0x2a3ef0['body'],null))[_0x7eb3('0x2d')](respondWithResult(_0x588311,null))['catch'](handleError(_0x588311,null));};exports[_0x7eb3('0x2e')]=function(_0x46f802,_0x1405b9){return db[_0x7eb3('0x38')][_0x7eb3('0x58')]({'where':{'id':_0x46f802[_0x7eb3('0x4f')]['id']}})[_0x7eb3('0x2d')](handleEntityNotFound(_0x1405b9,null))[_0x7eb3('0x2d')](removeEntity(_0x1405b9,null))[_0x7eb3('0x4e')](handleError(_0x1405b9,null));};exports[_0x7eb3('0x5d')]=function(_0x355de7,_0x109d46){return db[_0x7eb3('0x38')][_0x7eb3('0x5d')]()[_0x7eb3('0x2d')](respondWithResult(_0x109d46,null))['catch'](handleError(_0x109d46,null));};exports[_0x7eb3('0x5e')]=function(_0x2a3ef8,_0x10fcf3,_0x33af7d){var _0x1d614f={'raw':!![],'where':{}},_0x517593={},_0x4dbe4b;return db[_0x7eb3('0x38')]['findOne']({'where':{'id':_0x2a3ef8[_0x7eb3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x10fcf3,null))[_0x7eb3('0x2d')](function(_0x2cb1a4){if(_0x2cb1a4){_0x4dbe4b=_0x2cb1a4[_0x7eb3('0x2f')]({'plain':!![]});_0x517593['model']=_['keys'](db[_0x7eb3('0x5f')]['rawAttributes']);_0x517593['query']=_['keys'](_0x2a3ef8[_0x7eb3('0x3e')]);_0x517593[_0x7eb3('0x3c')]=_['intersection'](_0x517593['model'],_0x517593[_0x7eb3('0x3e')]);_0x1d614f['attributes']=_[_0x7eb3('0x3d')](_0x517593['model'],qs[_0x7eb3('0x40')](_0x2a3ef8[_0x7eb3('0x3e')][_0x7eb3('0x40')]));_0x1d614f[_0x7eb3('0x3f')]=_0x1d614f[_0x7eb3('0x3f')][_0x7eb3('0x41')]?_0x1d614f[_0x7eb3('0x3f')]:_0x517593[_0x7eb3('0x3a')];if(!_0x2a3ef8[_0x7eb3('0x3e')][_0x7eb3('0x42')](_0x7eb3('0x43'))){_0x1d614f[_0x7eb3('0x44')]=qs['limit'](_0x2a3ef8[_0x7eb3('0x3e')]['limit']);_0x1d614f[_0x7eb3('0x27')]=qs[_0x7eb3('0x27')](_0x2a3ef8[_0x7eb3('0x3e')][_0x7eb3('0x27')]);}_0x1d614f[_0x7eb3('0x45')]=qs['sort'](_0x2a3ef8['query'][_0x7eb3('0x46')]);_0x1d614f[_0x7eb3('0x47')]=qs['filters'](_[_0x7eb3('0x48')](_0x2a3ef8[_0x7eb3('0x3e')],_0x517593[_0x7eb3('0x3c')]));_0x1d614f[_0x7eb3('0x47')]['SmsQueueId']=_0x2cb1a4['id'];if(_0x2a3ef8[_0x7eb3('0x3e')]['filter']){_0x1d614f[_0x7eb3('0x47')]=_[_0x7eb3('0x52')](_0x1d614f[_0x7eb3('0x47')],{'$or':_[_0x7eb3('0x37')](_0x1d614f['attributes'],function(_0x5d3a2a){var _0x3a9458={};_0x3a9458[_0x5d3a2a]={'$like':'%'+_0x2a3ef8[_0x7eb3('0x3e')]['filter']+'%'};return _0x3a9458;})});}_0x1d614f=_[_0x7eb3('0x52')]({},_0x1d614f,_0x2a3ef8[_0x7eb3('0x4b')]);return db[_0x7eb3('0x5f')][_0x7eb3('0x4d')](_0x1d614f);}})[_0x7eb3('0x2d')](function(_0x370672){if(_0x370672){return db[_0x7eb3('0x60')][_0x7eb3('0x61')]({'where':{'id':_[_0x7eb3('0x37')](_0x370672,_0x7eb3('0x62')),'role':_0x7eb3('0x63')},'attributes':['id',_0x7eb3('0x34'),_0x7eb3('0x64'),_0x7eb3('0x65'),'createdAt']});}})['then'](function(_0x848567){if(_0x848567){return{'count':_0x848567['count'],'rows':_[_0x7eb3('0x37')](_0x848567[_0x7eb3('0x66')],function(_0x1fac29){return{'membername':_0x1fac29[_0x7eb3('0x34')],'UserId':_0x1fac29['id'],'queue_name':_0x4dbe4b['name'],'SmsQueueId':_0x4dbe4b['id'],'interface':util[_0x7eb3('0x67')](_0x7eb3('0x68'),_0x7eb3('0x69'),_0x1fac29[_0x7eb3('0x34')]),'penalty':0x0,'paused':_0x1fac29[_0x7eb3('0x64')],'createdAt':_0x1fac29[_0x7eb3('0x6a')],'updatedAt':_0x1fac29[_0x7eb3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7eb3('0x2d')](respondWithFilteredResult(_0x10fcf3,_0x1d614f))['catch'](handleError(_0x10fcf3,null));};exports[_0x7eb3('0x6b')]=function(_0x36b74b,_0x41c365,_0xee31c4){var _0x10d5ec={};var _0x4ba598={};var _0x44abf6;var _0x4a178f;return db[_0x7eb3('0x38')][_0x7eb3('0x6c')]({'where':{'id':_0x36b74b[_0x7eb3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x41c365,null))['then'](function(_0x482d79){if(_0x482d79){_0x44abf6=_0x482d79;_0x4ba598['model']=_['keys'](db[_0x7eb3('0x6d')]['rawAttributes']);_0x4ba598[_0x7eb3('0x3e')]=_[_0x7eb3('0x3b')](_0x36b74b['query']);_0x4ba598['filters']=_[_0x7eb3('0x3d')](_0x4ba598[_0x7eb3('0x3a')],_0x4ba598[_0x7eb3('0x3e')]);_0x10d5ec[_0x7eb3('0x3f')]=_[_0x7eb3('0x3d')](_0x4ba598[_0x7eb3('0x3a')],qs[_0x7eb3('0x40')](_0x36b74b[_0x7eb3('0x3e')]['fields']));_0x10d5ec['attributes']=_0x10d5ec['attributes'][_0x7eb3('0x41')]?_0x10d5ec['attributes']:_0x4ba598[_0x7eb3('0x3a')];_0x10d5ec[_0x7eb3('0x45')]=qs[_0x7eb3('0x46')](_0x36b74b[_0x7eb3('0x3e')][_0x7eb3('0x46')]);_0x10d5ec[_0x7eb3('0x47')]=qs[_0x7eb3('0x3c')](_[_0x7eb3('0x48')](_0x36b74b[_0x7eb3('0x3e')],_0x4ba598['filters']));if(_0x36b74b[_0x7eb3('0x3e')][_0x7eb3('0x49')]){_0x10d5ec[_0x7eb3('0x47')]=_[_0x7eb3('0x52')](_0x10d5ec[_0x7eb3('0x47')],{'$or':_[_0x7eb3('0x37')](_0x10d5ec['attributes'],function(_0x1d2f16){var _0x4bf7b6={};_0x4bf7b6[_0x1d2f16]={'$like':'%'+_0x36b74b[_0x7eb3('0x3e')][_0x7eb3('0x49')]+'%'};return _0x4bf7b6;})});}_0x10d5ec=_['merge']({},_0x10d5ec,_0x36b74b['options']);return _0x44abf6[_0x7eb3('0x6b')](_0x10d5ec);}})[_0x7eb3('0x2d')](function(_0x5685c1){if(_0x5685c1){_0x4a178f=_0x5685c1[_0x7eb3('0x41')];if(!_0x36b74b[_0x7eb3('0x3e')]['hasOwnProperty'](_0x7eb3('0x43'))){_0x10d5ec[_0x7eb3('0x44')]=qs['limit'](_0x36b74b[_0x7eb3('0x3e')]['limit']);_0x10d5ec['offset']=qs[_0x7eb3('0x27')](_0x36b74b['query']['offset']);}return _0x44abf6[_0x7eb3('0x6b')](_0x10d5ec);}})[_0x7eb3('0x2d')](function(_0x44513e){if(_0x44513e){return _0x44513e?{'count':_0x4a178f,'rows':_0x44513e}:null;}})[_0x7eb3('0x2d')](respondWithResult(_0x41c365,null))[_0x7eb3('0x4e')](handleError(_0x41c365,null));};exports[_0x7eb3('0x6e')]=function(_0x24a75d,_0x5910f5,_0x35afc0){var _0x1a6dac=_0x24a75d[_0x7eb3('0x5c')][_0x7eb3('0x6f')];return db[_0x7eb3('0x6d')]['findAll']({'where':{'id':_0x1a6dac},'attributes':['id'],'include':[{'model':db[_0x7eb3('0x60')],'as':_0x7eb3('0x70'),'attributes':['id',_0x7eb3('0x34'),_0x7eb3('0x71'),'voicePause',_0x7eb3('0x72')],'raw':!![]}]})[_0x7eb3('0x2d')](function(_0x412402){if(_0x412402){var _0x1e9ec5=_[_0x7eb3('0x73')](_0x412402,function(_0x297077){var _0x20364f=_0x297077[_0x7eb3('0x2f')]({'plain':!![]});return _0x20364f[_0x7eb3('0x70')];});return db[_0x7eb3('0x38')][_0x7eb3('0x58')]({'where':{'id':_0x24a75d[_0x7eb3('0x4f')]['id']}})[_0x7eb3('0x2d')](function(_0xe14c1e){return db[_0x7eb3('0x74')]['transaction'](function(_0x2b9f36){return _0xe14c1e[_0x7eb3('0x6e')](_0x1a6dac,{'transaction':_0x2b9f36})[_0x7eb3('0x2d')](function(){return BPromise['each'](_0x1e9ec5,function(_0x240c0e){return db[_0x7eb3('0x5f')][_0x7eb3('0x75')]({'where':{'UserId':_0x240c0e['id'],'SmsQueueId':_0x24a75d[_0x7eb3('0x4f')]['id']},'transaction':_0x2b9f36});});})['then'](function(){_0x1e9ec5['forEach'](function(_0x3623ea){socket['emit'](_0x7eb3('0x76'),{'UserId':_0x3623ea['id'],'SmsQueueId':_0xe14c1e['id']});});});});});}})[_0x7eb3('0x2d')](respondWithStatusCode(_0x5910f5,null))[_0x7eb3('0x4e')](handleError(_0x5910f5,null));};exports['removeTeams']=function(_0x1a87fe,_0x1adaa5,_0x55e57c){return db[_0x7eb3('0x6d')][_0x7eb3('0x4d')]({'where':{'id':_0x1a87fe[_0x7eb3('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7eb3('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7eb3('0x2d')](handleEntityNotFound(_0x1adaa5,null))[_0x7eb3('0x2d')](function(_0x4d2bd2){var _0x56bf49=_[_0x7eb3('0x37')](_0x4d2bd2,'id');var _0xee55cd=[];var _0x4af1a3=[];var _0x331f48=squel['select']();_0x331f48[_0x7eb3('0x77')]('tq.TeamId')['from'](_0x7eb3('0x78'),'tq')[_0x7eb3('0x79')](_0x7eb3('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7eb3('0x47')](_0x7eb3('0x7b'),_0x1a87fe[_0x7eb3('0x4f')]['id']);for(var _0x2f38e2=0x0;_0x2f38e2<_0x4d2bd2[_0x7eb3('0x41')];_0x2f38e2+=0x1){let _0x16971c=_0x4d2bd2[_0x2f38e2];for(var _0x1cdd48=0x0;_0x1cdd48<_0x16971c['Agents'][_0x7eb3('0x41')];_0x1cdd48+=0x1){let _0x32a273=_0x16971c[_0x7eb3('0x70')][_0x1cdd48];var _0x4784c7=_0x331f48[_0x7eb3('0x7c')]();_0x4784c7[_0x7eb3('0x47')](_0x7eb3('0x7d'),_0x32a273['id']);_0x4af1a3['push'](db[_0x7eb3('0x74')][_0x7eb3('0x3e')](_0x4784c7[_0x7eb3('0x7e')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x175cdb){if(_0x175cdb['length']===0x1){return _0x32a273['id'];}else{var _0x1cab65=_[_0x7eb3('0x7f')](_[_0x7eb3('0x37')](_0x175cdb,_0x7eb3('0x80')),function(_0x254a33){return _[_0x7eb3('0x81')](_0x56bf49,_0x254a33);});if(_0x1cab65){return _0x32a273['id'];}}}));}}return BPromise['all'](_0x4af1a3)[_0x7eb3('0x2d')](function(_0x647484){_0xee55cd=_(_0xee55cd)[_0x7eb3('0x82')](_0x647484)[_0x7eb3('0x83')]()['value']();return db[_0x7eb3('0x38')][_0x7eb3('0x58')]({'where':{'id':_0x1a87fe['params']['id']}})[_0x7eb3('0x2d')](function(_0xecf19e){return db[_0x7eb3('0x74')][_0x7eb3('0x84')](function(_0x1d9b27){return _0xecf19e[_0x7eb3('0x85')](_0x1a87fe[_0x7eb3('0x3e')][_0x7eb3('0x6f')],{'transaction':_0x1d9b27})[_0x7eb3('0x2d')](function(){if(!_['isEmpty'](_0xee55cd)){return _0xecf19e[_0x7eb3('0x86')](_0xee55cd,{'transaction':_0x1d9b27});}})['then'](function(){_0xee55cd[_0x7eb3('0x87')](function(_0x178020){socket[_0x7eb3('0x88')](_0x7eb3('0x89'),{'UserId':_0x178020,'SmsQueueId':_0xecf19e['id']});});});});});});})['then'](respondWithStatusCode(_0x1adaa5,null))[_0x7eb3('0x4e')](handleError(_0x1adaa5,null));};exports['addAgents']=function(_0x5ae9a3,_0x35c8d9,_0x2c7870){return db['SmsQueue'][_0x7eb3('0x58')]({'where':{'id':_0x5ae9a3[_0x7eb3('0x4f')]['id']}})[_0x7eb3('0x2d')](handleEntityNotFound(_0x35c8d9,null))[_0x7eb3('0x2d')](function(_0x27ece2){if(_0x27ece2){return _0x27ece2['addAgents'](_0x5ae9a3[_0x7eb3('0x5c')]['ids'],_['omit'](_0x5ae9a3[_0x7eb3('0x5c')],['ids','id'])||{})['spread'](function(_0x564190){for(var _0x36ef76=0x0;_0x36ef76<_0x5ae9a3[_0x7eb3('0x5c')]['ids'][_0x7eb3('0x41')];_0x36ef76+=0x1){socket[_0x7eb3('0x88')]('userSmsQueue:save',{'UserId':Number(_0x5ae9a3[_0x7eb3('0x5c')][_0x7eb3('0x6f')][_0x36ef76]),'SmsQueueId':Number(_0x5ae9a3[_0x7eb3('0x4f')]['id'])});}return _0x564190;});}})[_0x7eb3('0x2d')](respondWithResult(_0x35c8d9,null))[_0x7eb3('0x4e')](handleError(_0x35c8d9,null));};exports['removeAgents']=function(_0xd2f3f7,_0x171bfc,_0x511a19){return db[_0x7eb3('0x38')][_0x7eb3('0x58')]({'where':{'id':_0xd2f3f7[_0x7eb3('0x4f')]['id']}})[_0x7eb3('0x2d')](handleEntityNotFound(_0x171bfc,null))[_0x7eb3('0x2d')](function(_0x1e6942){if(_0x1e6942){return _0x1e6942[_0x7eb3('0x86')](_0xd2f3f7[_0x7eb3('0x3e')][_0x7eb3('0x6f')])['then'](function(){if(_[_0x7eb3('0x8a')](_0xd2f3f7[_0x7eb3('0x3e')][_0x7eb3('0x6f')])){for(var _0x5ec279=0x0;_0x5ec279<_0xd2f3f7['query'][_0x7eb3('0x6f')]['length'];_0x5ec279+=0x1){socket[_0x7eb3('0x88')](_0x7eb3('0x89'),{'UserId':Number(_0xd2f3f7[_0x7eb3('0x3e')][_0x7eb3('0x6f')][_0x5ec279]),'SmsQueueId':Number(_0xd2f3f7['params']['id'])});}}else{socket[_0x7eb3('0x88')](_0x7eb3('0x89'),{'UserId':Number(_0xd2f3f7['query'][_0x7eb3('0x6f')]),'SmsQueueId':Number(_0xd2f3f7[_0x7eb3('0x4f')]['id'])});}});}})[_0x7eb3('0x2d')](respondWithStatusCode(_0x171bfc,null))['catch'](handleError(_0x171bfc,null));};exports[_0x7eb3('0x8b')]=function(_0x3d1ca9,_0x56e78b,_0x427f55){var _0x55f730={};var _0x9904e7={};var _0x883561;var _0x3b98aa;return db['SmsQueue'][_0x7eb3('0x6c')]({'where':{'id':_0x3d1ca9[_0x7eb3('0x4f')]['id']}})[_0x7eb3('0x2d')](handleEntityNotFound(_0x56e78b,null))[_0x7eb3('0x2d')](function(_0x61e56c){if(_0x61e56c){_0x883561=_0x61e56c;_0x9904e7[_0x7eb3('0x3a')]=_[_0x7eb3('0x3b')](db['User'][_0x7eb3('0x50')]);_0x9904e7[_0x7eb3('0x3e')]=_[_0x7eb3('0x3b')](_0x3d1ca9[_0x7eb3('0x3e')]);_0x9904e7[_0x7eb3('0x3c')]=_['intersection'](_0x9904e7['model'],_0x9904e7[_0x7eb3('0x3e')]);_0x55f730[_0x7eb3('0x3f')]=_[_0x7eb3('0x3d')](_0x9904e7[_0x7eb3('0x3a')],qs[_0x7eb3('0x40')](_0x3d1ca9[_0x7eb3('0x3e')][_0x7eb3('0x40')]));_0x55f730['attributes']=_0x55f730[_0x7eb3('0x3f')]['length']?_0x55f730[_0x7eb3('0x3f')]:_0x9904e7['model'];_0x55f730[_0x7eb3('0x45')]=qs[_0x7eb3('0x46')](_0x3d1ca9['query'][_0x7eb3('0x46')]);_0x55f730[_0x7eb3('0x47')]=qs[_0x7eb3('0x3c')](_['pick'](_0x3d1ca9['query'],_0x9904e7[_0x7eb3('0x3c')]));if(_0x3d1ca9[_0x7eb3('0x3e')][_0x7eb3('0x49')]){_0x55f730['where']=_[_0x7eb3('0x52')](_0x55f730[_0x7eb3('0x47')],{'$or':_[_0x7eb3('0x37')](_0x55f730['attributes'],function(_0x20d22c){var _0x27654f={};_0x27654f[_0x20d22c]={'$like':'%'+_0x3d1ca9[_0x7eb3('0x3e')][_0x7eb3('0x49')]+'%'};return _0x27654f;})});}_0x55f730=_[_0x7eb3('0x52')]({},_0x55f730,_0x3d1ca9[_0x7eb3('0x4b')]);return _0x883561[_0x7eb3('0x8b')](_0x55f730);}})[_0x7eb3('0x2d')](function(_0x126b5d){if(_0x126b5d){_0x3b98aa=_0x126b5d['length'];if(!_0x3d1ca9[_0x7eb3('0x3e')]['hasOwnProperty'](_0x7eb3('0x43'))){_0x55f730[_0x7eb3('0x44')]=qs[_0x7eb3('0x44')](_0x3d1ca9[_0x7eb3('0x3e')][_0x7eb3('0x44')]);_0x55f730[_0x7eb3('0x27')]=qs['offset'](_0x3d1ca9[_0x7eb3('0x3e')][_0x7eb3('0x27')]);}return _0x883561[_0x7eb3('0x8b')](_0x55f730);}})[_0x7eb3('0x2d')](function(_0x48d642){if(_0x48d642){return _0x48d642?{'count':_0x3b98aa,'rows':_0x48d642}:null;}})[_0x7eb3('0x2d')](respondWithResult(_0x56e78b,null))[_0x7eb3('0x4e')](handleError(_0x56e78b,null));}; \ No newline at end of file +var _0xb1be=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','find','create','body','user','role','SmsQueues','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserSmsQueue','order','SmsQueueId','findAll','User','findAndCountAll','smsPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','addTeams','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','isArray','findOne','zip-dir','request-promise','moment','bluebird'];(function(_0xa587a,_0xc7ebc7){var _0x2af6f3=function(_0x434495){while(--_0x434495){_0xa587a['push'](_0xa587a['shift']());}};_0x2af6f3(++_0xc7ebc7);}(_0xb1be,0x118));var _0xeb1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1be[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb1b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb1b('0x1'));var moment=require(_0xeb1b('0x2'));var BPromise=require(_0xeb1b('0x3'));var Mustache=require(_0xeb1b('0x4'));var util=require(_0xeb1b('0x5'));var path=require(_0xeb1b('0x6'));var sox=require(_0xeb1b('0x7'));var csv=require(_0xeb1b('0x8'));var ejs=require(_0xeb1b('0x9'));var fs=require('fs');var fs_extra=require(_0xeb1b('0xa'));var _=require(_0xeb1b('0xb'));var squel=require(_0xeb1b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeb1b('0x8'));var querystring=require('querystring');var Papa=require(_0xeb1b('0xd'));var Redis=require('ioredis');var authService=require(_0xeb1b('0xe'));var qs=require(_0xeb1b('0xf'));var as=require(_0xeb1b('0x10'));var hardwareService=require(_0xeb1b('0x11'));var logger=require(_0xeb1b('0x12'))(_0xeb1b('0x13'));var utils=require(_0xeb1b('0x14'));var config=require(_0xeb1b('0x15'));var licenseUtil=require(_0xeb1b('0x16'));var db=require(_0xeb1b('0x17'))['db'];config[_0xeb1b('0x18')]=_[_0xeb1b('0x19')](config[_0xeb1b('0x18')],{'host':_0xeb1b('0x1a'),'port':0x18eb});var socket=require(_0xeb1b('0x1b'))(new Redis(config[_0xeb1b('0x18')]));require(_0xeb1b('0x1c'))[_0xeb1b('0x1d')](socket);function respondWithStatusCode(_0x6d91b,_0x5affdc){_0x5affdc=_0x5affdc||0xcc;return function(_0x2b5abe){if(_0x2b5abe){return _0x6d91b[_0xeb1b('0x1e')](_0x5affdc);}return _0x6d91b[_0xeb1b('0x1f')](_0x5affdc)[_0xeb1b('0x20')]();};}function respondWithResult(_0xf20eeb,_0x1d24b7){_0x1d24b7=_0x1d24b7||0xc8;return function(_0x1e26d2){if(_0x1e26d2){return _0xf20eeb[_0xeb1b('0x1f')](_0x1d24b7)[_0xeb1b('0x21')](_0x1e26d2);}};}function respondWithFilteredResult(_0x1975ab,_0x4fe94d){return function(_0x41a405){if(_0x41a405){var _0x172435=typeof _0x4fe94d[_0xeb1b('0x22')]===_0xeb1b('0x23')&&typeof _0x4fe94d[_0xeb1b('0x24')]===_0xeb1b('0x23');var _0x2c4038=_0x41a405[_0xeb1b('0x25')];var _0x2424e5=_0x172435?0x0:_0x4fe94d['offset'];var _0x52b0f1=_0x172435?_0x41a405[_0xeb1b('0x25')]:_0x4fe94d[_0xeb1b('0x22')]+_0x4fe94d[_0xeb1b('0x24')];var _0xc628a9;if(_0x52b0f1>=_0x2c4038){_0x52b0f1=_0x2c4038;_0xc628a9=0xc8;}else{_0xc628a9=0xce;}_0x1975ab[_0xeb1b('0x1f')](_0xc628a9);return _0x1975ab[_0xeb1b('0x26')](_0xeb1b('0x27'),_0x2424e5+'-'+_0x52b0f1+'/'+_0x2c4038)[_0xeb1b('0x21')](_0x41a405);}return null;};}function patchUpdates(_0x5ca649){return function(_0x530fbb){try{jsonpatch[_0xeb1b('0x28')](_0x530fbb,_0x5ca649,!![]);}catch(_0x19c94d){return BPromise[_0xeb1b('0x29')](_0x19c94d);}return _0x530fbb[_0xeb1b('0x2a')]();};}function saveUpdates(_0x1fe43b,_0xac6e97){return function(_0x4e50f2){if(_0x4e50f2){return _0x4e50f2[_0xeb1b('0x2b')](_0x1fe43b)[_0xeb1b('0x2c')](function(_0x5d1c56){return _0x5d1c56;});}return null;};}function removeEntity(_0x2555ae,_0x3887b7){return function(_0x400fab){if(_0x400fab){return _0x400fab['destroy']()[_0xeb1b('0x2c')](function(){var _0x329f12=_0x400fab[_0xeb1b('0x2d')]({'plain':!![]});var _0x18b2ad='SmsQueues';return db[_0xeb1b('0x2e')][_0xeb1b('0x2f')]({'where':{'type':_0x18b2ad,'resourceId':_0x329f12['id']}})[_0xeb1b('0x2c')](function(){return _0x400fab;});})[_0xeb1b('0x2c')](function(){_0x2555ae[_0xeb1b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b9b5,_0x46c5fa){return function(_0x926c9a){if(!_0x926c9a){_0x42b9b5['sendStatus'](0x194);}return _0x926c9a;};}function handleError(_0x3f2684,_0x5d642b){_0x5d642b=_0x5d642b||0x1f4;return function(_0x501f23){logger[_0xeb1b('0x30')](_0x501f23[_0xeb1b('0x31')]);if(_0x501f23[_0xeb1b('0x32')]){delete _0x501f23[_0xeb1b('0x32')];}_0x3f2684[_0xeb1b('0x1f')](_0x5d642b)['send'](_0x501f23);};}exports[_0xeb1b('0x33')]=function(_0x3ad630,_0x3774e7){var _0x5e1ba0={},_0x25cc20={},_0x103789={'count':0x0,'rows':[]};var _0x5212fa=_[_0xeb1b('0x34')](db[_0xeb1b('0x35')][_0xeb1b('0x36')],function(_0x5eb333){return{'name':_0x5eb333[_0xeb1b('0x37')],'type':_0x5eb333[_0xeb1b('0x38')][_0xeb1b('0x39')]};});_0x25cc20[_0xeb1b('0x3a')]=_['map'](_0x5212fa,_0xeb1b('0x32'));_0x25cc20[_0xeb1b('0x3b')]=_[_0xeb1b('0x3c')](_0x3ad630[_0xeb1b('0x3b')]);_0x25cc20[_0xeb1b('0x3d')]=_[_0xeb1b('0x3e')](_0x25cc20[_0xeb1b('0x3a')],_0x25cc20[_0xeb1b('0x3b')]);_0x5e1ba0[_0xeb1b('0x3f')]=_[_0xeb1b('0x3e')](_0x25cc20['model'],qs[_0xeb1b('0x40')](_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x40')]));_0x5e1ba0[_0xeb1b('0x3f')]=_0x5e1ba0['attributes'][_0xeb1b('0x41')]?_0x5e1ba0[_0xeb1b('0x3f')]:_0x25cc20[_0xeb1b('0x3a')];if(!_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x42')](_0xeb1b('0x43'))){_0x5e1ba0['limit']=qs['limit'](_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x24')]);_0x5e1ba0[_0xeb1b('0x22')]=qs[_0xeb1b('0x22')](_0x3ad630['query'][_0xeb1b('0x22')]);}_0x5e1ba0['order']=qs[_0xeb1b('0x44')](_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x44')]);_0x5e1ba0[_0xeb1b('0x45')]=qs[_0xeb1b('0x3d')](_[_0xeb1b('0x46')](_0x3ad630[_0xeb1b('0x3b')],_0x25cc20[_0xeb1b('0x3d')]),_0x5212fa);if(_0x3ad630['query']['filter']){_0x5e1ba0[_0xeb1b('0x45')]=_[_0xeb1b('0x47')](_0x5e1ba0['where'],{'$or':_[_0xeb1b('0x34')](_0x5212fa,function(_0x4cfc28){if(_0x4cfc28['type']!==_0xeb1b('0x48')){var _0x32ea42={};_0x32ea42[_0x4cfc28['name']]={'$like':'%'+_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x49')]+'%'};return _0x32ea42;}})});}_0x5e1ba0=_[_0xeb1b('0x47')]({},_0x5e1ba0,_0x3ad630[_0xeb1b('0x4a')]);var _0x1aae01={'where':_0x5e1ba0[_0xeb1b('0x45')]};return db[_0xeb1b('0x35')]['count'](_0x1aae01)['then'](function(_0x25f4fd){_0x103789['count']=_0x25f4fd;if(_0x3ad630[_0xeb1b('0x3b')][_0xeb1b('0x4b')]){_0x5e1ba0[_0xeb1b('0x4c')]=[{'all':!![]}];}return db[_0xeb1b('0x35')]['findAll'](_0x5e1ba0);})[_0xeb1b('0x2c')](function(_0x4a4b3a){_0x103789['rows']=_0x4a4b3a;return _0x103789;})['then'](respondWithFilteredResult(_0x3774e7,_0x5e1ba0))['catch'](handleError(_0x3774e7,null));};exports[_0xeb1b('0x4d')]=function(_0x2053a1,_0x455b79){var _0x10d15a={'raw':!![],'where':{'id':_0x2053a1[_0xeb1b('0x4e')]['id']}},_0x11992e={};_0x11992e[_0xeb1b('0x3a')]=_[_0xeb1b('0x3c')](db['SmsQueue'][_0xeb1b('0x36')]);_0x11992e[_0xeb1b('0x3b')]=_['keys'](_0x2053a1[_0xeb1b('0x3b')]);_0x11992e[_0xeb1b('0x3d')]=_[_0xeb1b('0x3e')](_0x11992e['model'],_0x11992e['query']);_0x10d15a[_0xeb1b('0x3f')]=_[_0xeb1b('0x3e')](_0x11992e[_0xeb1b('0x3a')],qs['fields'](_0x2053a1[_0xeb1b('0x3b')][_0xeb1b('0x40')]));_0x10d15a[_0xeb1b('0x3f')]=_0x10d15a[_0xeb1b('0x3f')][_0xeb1b('0x41')]?_0x10d15a['attributes']:_0x11992e['model'];if(_0x2053a1[_0xeb1b('0x3b')][_0xeb1b('0x4b')]){_0x10d15a['include']=[{'all':!![]}];}_0x10d15a=_[_0xeb1b('0x47')]({},_0x10d15a,_0x2053a1['options']);return db[_0xeb1b('0x35')][_0xeb1b('0x4f')](_0x10d15a)[_0xeb1b('0x2c')](handleEntityNotFound(_0x455b79,null))[_0xeb1b('0x2c')](respondWithResult(_0x455b79,null))['catch'](handleError(_0x455b79,null));};exports[_0xeb1b('0x50')]=function(_0x318962,_0x3812f2){return db[_0xeb1b('0x35')][_0xeb1b('0x50')](_0x318962[_0xeb1b('0x51')],{})[_0xeb1b('0x2c')](function(_0x207064){var _0x22a733=_0x318962[_0xeb1b('0x52')][_0xeb1b('0x2d')]({'plain':!![]});if(!_0x22a733)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22a733[_0xeb1b('0x53')]==='user'){var _0x1c60b9=_0x207064[_0xeb1b('0x2d')]({'plain':!![]});var _0xc5c83=_0xeb1b('0x54');return db[_0xeb1b('0x55')][_0xeb1b('0x4f')]({'where':{'name':_0xc5c83,'userProfileId':_0x22a733['userProfileId']},'raw':!![]})['then'](function(_0x3f312d){if(_0x3f312d&&_0x3f312d[_0xeb1b('0x56')]===0x0){return db[_0xeb1b('0x2e')][_0xeb1b('0x50')]({'name':_0x1c60b9[_0xeb1b('0x32')],'resourceId':_0x1c60b9['id'],'type':_0x3f312d[_0xeb1b('0x32')],'sectionId':_0x3f312d['id']},{})['then'](function(){return _0x207064;});}else{return _0x207064;}})[_0xeb1b('0x57')](function(_0x45eaec){logger[_0xeb1b('0x30')](_0xeb1b('0x58'),_0x45eaec);throw _0x45eaec;});}return _0x207064;})[_0xeb1b('0x2c')](respondWithResult(_0x3812f2,0xc9))[_0xeb1b('0x57')](handleError(_0x3812f2,null));};exports['update']=function(_0x31fb36,_0x2994ee){if(_0x31fb36[_0xeb1b('0x51')]['id']){delete _0x31fb36['body']['id'];}return db['SmsQueue'][_0xeb1b('0x4f')]({'where':{'id':_0x31fb36[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x2994ee,null))[_0xeb1b('0x2c')](saveUpdates(_0x31fb36[_0xeb1b('0x51')],null))[_0xeb1b('0x2c')](respondWithResult(_0x2994ee,null))[_0xeb1b('0x57')](handleError(_0x2994ee,null));};exports['destroy']=function(_0x414d2b,_0x3312b0){return db['SmsQueue'][_0xeb1b('0x4f')]({'where':{'id':_0x414d2b['params']['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x3312b0,null))[_0xeb1b('0x2c')](removeEntity(_0x3312b0,null))[_0xeb1b('0x57')](handleError(_0x3312b0,null));};exports[_0xeb1b('0x59')]=function(_0x14b3af,_0x5d304e){return db[_0xeb1b('0x35')][_0xeb1b('0x59')]()[_0xeb1b('0x2c')](respondWithResult(_0x5d304e,null))[_0xeb1b('0x57')](handleError(_0x5d304e,null));};exports['getMembers']=function(_0x51d1f5,_0x1f1580,_0x2f190b){var _0x167609={'raw':!![],'where':{}},_0x5076c9={},_0x185454;return db['SmsQueue']['findOne']({'where':{'id':_0x51d1f5[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x1f1580,null))[_0xeb1b('0x2c')](function(_0x3a82f7){if(_0x3a82f7){_0x185454=_0x3a82f7['get']({'plain':!![]});_0x5076c9['model']=_[_0xeb1b('0x3c')](db[_0xeb1b('0x5a')]['rawAttributes']);_0x5076c9[_0xeb1b('0x3b')]=_[_0xeb1b('0x3c')](_0x51d1f5[_0xeb1b('0x3b')]);_0x5076c9[_0xeb1b('0x3d')]=_['intersection'](_0x5076c9[_0xeb1b('0x3a')],_0x5076c9[_0xeb1b('0x3b')]);_0x167609[_0xeb1b('0x3f')]=_[_0xeb1b('0x3e')](_0x5076c9['model'],qs['fields'](_0x51d1f5[_0xeb1b('0x3b')]['fields']));_0x167609['attributes']=_0x167609[_0xeb1b('0x3f')][_0xeb1b('0x41')]?_0x167609[_0xeb1b('0x3f')]:_0x5076c9[_0xeb1b('0x3a')];if(!_0x51d1f5[_0xeb1b('0x3b')][_0xeb1b('0x42')]('nolimit')){_0x167609[_0xeb1b('0x24')]=qs[_0xeb1b('0x24')](_0x51d1f5[_0xeb1b('0x3b')][_0xeb1b('0x24')]);_0x167609[_0xeb1b('0x22')]=qs['offset'](_0x51d1f5['query']['offset']);}_0x167609[_0xeb1b('0x5b')]=qs['sort'](_0x51d1f5[_0xeb1b('0x3b')]['sort']);_0x167609[_0xeb1b('0x45')]=qs[_0xeb1b('0x3d')](_[_0xeb1b('0x46')](_0x51d1f5[_0xeb1b('0x3b')],_0x5076c9[_0xeb1b('0x3d')]));_0x167609['where'][_0xeb1b('0x5c')]=_0x3a82f7['id'];if(_0x51d1f5[_0xeb1b('0x3b')][_0xeb1b('0x49')]){_0x167609[_0xeb1b('0x45')]=_[_0xeb1b('0x47')](_0x167609[_0xeb1b('0x45')],{'$or':_[_0xeb1b('0x34')](_0x167609['attributes'],function(_0x1ea9ce){var _0x4080c7={};_0x4080c7[_0x1ea9ce]={'$like':'%'+_0x51d1f5['query'][_0xeb1b('0x49')]+'%'};return _0x4080c7;})});}_0x167609=_['merge']({},_0x167609,_0x51d1f5[_0xeb1b('0x4a')]);return db[_0xeb1b('0x5a')][_0xeb1b('0x5d')](_0x167609);}})[_0xeb1b('0x2c')](function(_0x437567){if(_0x437567){return db[_0xeb1b('0x5e')][_0xeb1b('0x5f')]({'where':{'id':_[_0xeb1b('0x34')](_0x437567,'UserId'),'role':'agent'},'attributes':['id',_0xeb1b('0x32'),_0xeb1b('0x60'),_0xeb1b('0x61'),_0xeb1b('0x62')]});}})[_0xeb1b('0x2c')](function(_0x3ad5ae){if(_0x3ad5ae){return{'count':_0x3ad5ae[_0xeb1b('0x25')],'rows':_['map'](_0x3ad5ae[_0xeb1b('0x63')],function(_0x397bb6){return{'membername':_0x397bb6['name'],'UserId':_0x397bb6['id'],'queue_name':_0x185454[_0xeb1b('0x32')],'SmsQueueId':_0x185454['id'],'interface':util['format'](_0xeb1b('0x64'),_0xeb1b('0x65'),_0x397bb6[_0xeb1b('0x32')]),'penalty':0x0,'paused':_0x397bb6[_0xeb1b('0x60')],'createdAt':_0x397bb6[_0xeb1b('0x62')],'updatedAt':_0x397bb6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeb1b('0x2c')](respondWithFilteredResult(_0x1f1580,_0x167609))[_0xeb1b('0x57')](handleError(_0x1f1580,null));};exports[_0xeb1b('0x66')]=function(_0xf00d23,_0x558cd2,_0x330faf){var _0x179f05={};var _0x464528={};var _0x1a8628;var _0x30f37c;return db[_0xeb1b('0x35')]['findOne']({'where':{'id':_0xf00d23[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x558cd2,null))[_0xeb1b('0x2c')](function(_0x449797){if(_0x449797){_0x1a8628=_0x449797;_0x464528[_0xeb1b('0x3a')]=_[_0xeb1b('0x3c')](db[_0xeb1b('0x67')][_0xeb1b('0x36')]);_0x464528['query']=_[_0xeb1b('0x3c')](_0xf00d23[_0xeb1b('0x3b')]);_0x464528[_0xeb1b('0x3d')]=_[_0xeb1b('0x3e')](_0x464528[_0xeb1b('0x3a')],_0x464528[_0xeb1b('0x3b')]);_0x179f05[_0xeb1b('0x3f')]=_['intersection'](_0x464528[_0xeb1b('0x3a')],qs[_0xeb1b('0x40')](_0xf00d23[_0xeb1b('0x3b')][_0xeb1b('0x40')]));_0x179f05[_0xeb1b('0x3f')]=_0x179f05[_0xeb1b('0x3f')][_0xeb1b('0x41')]?_0x179f05[_0xeb1b('0x3f')]:_0x464528['model'];_0x179f05[_0xeb1b('0x5b')]=qs[_0xeb1b('0x44')](_0xf00d23[_0xeb1b('0x3b')]['sort']);_0x179f05['where']=qs[_0xeb1b('0x3d')](_['pick'](_0xf00d23[_0xeb1b('0x3b')],_0x464528['filters']));if(_0xf00d23['query'][_0xeb1b('0x49')]){_0x179f05['where']=_[_0xeb1b('0x47')](_0x179f05['where'],{'$or':_[_0xeb1b('0x34')](_0x179f05['attributes'],function(_0x562234){var _0x29e40a={};_0x29e40a[_0x562234]={'$like':'%'+_0xf00d23[_0xeb1b('0x3b')][_0xeb1b('0x49')]+'%'};return _0x29e40a;})});}_0x179f05=_[_0xeb1b('0x47')]({},_0x179f05,_0xf00d23['options']);return _0x1a8628[_0xeb1b('0x66')](_0x179f05);}})[_0xeb1b('0x2c')](function(_0x533297){if(_0x533297){_0x30f37c=_0x533297[_0xeb1b('0x41')];if(!_0xf00d23[_0xeb1b('0x3b')][_0xeb1b('0x42')](_0xeb1b('0x43'))){_0x179f05[_0xeb1b('0x24')]=qs[_0xeb1b('0x24')](_0xf00d23[_0xeb1b('0x3b')][_0xeb1b('0x24')]);_0x179f05[_0xeb1b('0x22')]=qs[_0xeb1b('0x22')](_0xf00d23['query']['offset']);}return _0x1a8628['getTeams'](_0x179f05);}})[_0xeb1b('0x2c')](function(_0x2e2440){if(_0x2e2440){return _0x2e2440?{'count':_0x30f37c,'rows':_0x2e2440}:null;}})[_0xeb1b('0x2c')](respondWithResult(_0x558cd2,null))[_0xeb1b('0x57')](handleError(_0x558cd2,null));};exports['addTeams']=function(_0x5c2e85,_0x444989,_0x40a6f8){var _0x4db701=_0x5c2e85['body'][_0xeb1b('0x68')];return db['Team'][_0xeb1b('0x5d')]({'where':{'id':_0x4db701},'attributes':['id'],'include':[{'model':db[_0xeb1b('0x5e')],'as':'Agents','attributes':['id',_0xeb1b('0x32'),_0xeb1b('0x69'),_0xeb1b('0x6a'),_0xeb1b('0x6b')],'raw':!![]}]})[_0xeb1b('0x2c')](function(_0x59848d){if(_0x59848d){var _0x1b76af=_[_0xeb1b('0x6c')](_0x59848d,function(_0x4af9be){var _0x4cb783=_0x4af9be['get']({'plain':!![]});return _0x4cb783[_0xeb1b('0x6d')];});return db[_0xeb1b('0x35')][_0xeb1b('0x4f')]({'where':{'id':_0x5c2e85['params']['id']}})[_0xeb1b('0x2c')](function(_0x4ada4c){return db['sequelize']['transaction'](function(_0x336232){return _0x4ada4c[_0xeb1b('0x6e')](_0x4db701,{'transaction':_0x336232})[_0xeb1b('0x2c')](function(){return BPromise[_0xeb1b('0x6f')](_0x1b76af,function(_0x4d4de7){return db[_0xeb1b('0x5a')][_0xeb1b('0x70')]({'where':{'UserId':_0x4d4de7['id'],'SmsQueueId':_0x5c2e85['params']['id']},'transaction':_0x336232});});})[_0xeb1b('0x2c')](function(){_0x1b76af['forEach'](function(_0x106e74){socket[_0xeb1b('0x71')](_0xeb1b('0x72'),{'UserId':_0x106e74['id'],'SmsQueueId':_0x4ada4c['id']});});});});});}})[_0xeb1b('0x2c')](respondWithStatusCode(_0x444989,null))[_0xeb1b('0x57')](handleError(_0x444989,null));};exports[_0xeb1b('0x73')]=function(_0x13afeb,_0xd553b5,_0x1b1666){return db[_0xeb1b('0x67')]['findAll']({'where':{'id':_0x13afeb['query'][_0xeb1b('0x68')]},'attributes':['id'],'include':[{'model':db[_0xeb1b('0x5e')],'as':_0xeb1b('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xeb1b('0x2c')](handleEntityNotFound(_0xd553b5,null))[_0xeb1b('0x2c')](function(_0x506935){var _0x4805e8=_[_0xeb1b('0x34')](_0x506935,'id');var _0x22f5b4=[];var _0x49415d=[];var _0x1fe322=squel[_0xeb1b('0x74')]();_0x1fe322[_0xeb1b('0x75')]('tq.TeamId')[_0xeb1b('0x76')]('team_has_sms_queues','tq')['join'](_0xeb1b('0x77'),'ut',_0xeb1b('0x78'))[_0xeb1b('0x45')](_0xeb1b('0x79'),_0x13afeb['params']['id']);for(var _0x17f125=0x0;_0x17f125<_0x506935[_0xeb1b('0x41')];_0x17f125+=0x1){let _0x3c0d49=_0x506935[_0x17f125];for(var _0x5e7865=0x0;_0x5e7865<_0x3c0d49[_0xeb1b('0x6d')][_0xeb1b('0x41')];_0x5e7865+=0x1){let _0x18ded7=_0x3c0d49[_0xeb1b('0x6d')][_0x5e7865];var _0x2211cb=_0x1fe322['clone']();_0x2211cb['where']('ut.UserId\x20=\x20?',_0x18ded7['id']);_0x49415d[_0xeb1b('0x7a')](db[_0xeb1b('0x7b')][_0xeb1b('0x3b')](_0x2211cb[_0xeb1b('0x7c')](),{'type':db[_0xeb1b('0x7b')][_0xeb1b('0x7d')][_0xeb1b('0x7e')]})[_0xeb1b('0x2c')](function(_0xe910ad){if(_0xe910ad['length']===0x1){return _0x18ded7['id'];}else{var _0x55f915=_[_0xeb1b('0x7f')](_[_0xeb1b('0x34')](_0xe910ad,_0xeb1b('0x80')),function(_0xac5d34){return _[_0xeb1b('0x81')](_0x4805e8,_0xac5d34);});if(_0x55f915){return _0x18ded7['id'];}}}));}}return BPromise[_0xeb1b('0x82')](_0x49415d)[_0xeb1b('0x2c')](function(_0x15057c){_0x22f5b4=_(_0x22f5b4)[_0xeb1b('0x83')](_0x15057c)[_0xeb1b('0x84')]()['value']();return db[_0xeb1b('0x35')][_0xeb1b('0x4f')]({'where':{'id':_0x13afeb[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](function(_0x42d976){return db['sequelize'][_0xeb1b('0x85')](function(_0xb452ee){return _0x42d976[_0xeb1b('0x73')](_0x13afeb[_0xeb1b('0x3b')][_0xeb1b('0x68')],{'transaction':_0xb452ee})['then'](function(){if(!_[_0xeb1b('0x86')](_0x22f5b4)){return _0x42d976[_0xeb1b('0x87')](_0x22f5b4,{'transaction':_0xb452ee});}})[_0xeb1b('0x2c')](function(){_0x22f5b4[_0xeb1b('0x88')](function(_0xde16d){socket[_0xeb1b('0x71')](_0xeb1b('0x89'),{'UserId':_0xde16d,'SmsQueueId':_0x42d976['id']});});});});});});})[_0xeb1b('0x2c')](respondWithStatusCode(_0xd553b5,null))['catch'](handleError(_0xd553b5,null));};exports[_0xeb1b('0x8a')]=function(_0x7d1175,_0x35613f,_0x4182da){return db[_0xeb1b('0x35')][_0xeb1b('0x4f')]({'where':{'id':_0x7d1175[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x35613f,null))['then'](function(_0x254f3f){if(_0x254f3f){return _0x254f3f['addAgents'](_0x7d1175[_0xeb1b('0x51')]['ids'],_[_0xeb1b('0x8b')](_0x7d1175[_0xeb1b('0x51')],[_0xeb1b('0x68'),'id'])||{})['spread'](function(_0x3815a0){for(var _0x3a8c86=0x0;_0x3a8c86<_0x7d1175[_0xeb1b('0x51')]['ids'][_0xeb1b('0x41')];_0x3a8c86+=0x1){socket[_0xeb1b('0x71')](_0xeb1b('0x72'),{'UserId':Number(_0x7d1175[_0xeb1b('0x51')]['ids'][_0x3a8c86]),'SmsQueueId':Number(_0x7d1175['params']['id'])});}return _0x3815a0;});}})['then'](respondWithResult(_0x35613f,null))[_0xeb1b('0x57')](handleError(_0x35613f,null));};exports[_0xeb1b('0x87')]=function(_0x2c38d8,_0x3a58aa,_0x4b2287){return db[_0xeb1b('0x35')][_0xeb1b('0x4f')]({'where':{'id':_0x2c38d8[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x3a58aa,null))[_0xeb1b('0x2c')](function(_0x235ab0){if(_0x235ab0){return _0x235ab0[_0xeb1b('0x87')](_0x2c38d8['query'][_0xeb1b('0x68')])[_0xeb1b('0x2c')](function(){if(_[_0xeb1b('0x8c')](_0x2c38d8[_0xeb1b('0x3b')][_0xeb1b('0x68')])){for(var _0x58b6a8=0x0;_0x58b6a8<_0x2c38d8[_0xeb1b('0x3b')][_0xeb1b('0x68')][_0xeb1b('0x41')];_0x58b6a8+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x2c38d8[_0xeb1b('0x3b')][_0xeb1b('0x68')][_0x58b6a8]),'SmsQueueId':Number(_0x2c38d8[_0xeb1b('0x4e')]['id'])});}}else{socket[_0xeb1b('0x71')]('userSmsQueue:remove',{'UserId':Number(_0x2c38d8[_0xeb1b('0x3b')][_0xeb1b('0x68')]),'SmsQueueId':Number(_0x2c38d8[_0xeb1b('0x4e')]['id'])});}});}})[_0xeb1b('0x2c')](respondWithStatusCode(_0x3a58aa,null))[_0xeb1b('0x57')](handleError(_0x3a58aa,null));};exports['getAgents']=function(_0x15ab44,_0x2203f1,_0x3e7ba3){var _0x51ba84={};var _0x372e28={};var _0xf76fcd;var _0x12b440;return db[_0xeb1b('0x35')][_0xeb1b('0x8d')]({'where':{'id':_0x15ab44[_0xeb1b('0x4e')]['id']}})[_0xeb1b('0x2c')](handleEntityNotFound(_0x2203f1,null))['then'](function(_0x355485){if(_0x355485){_0xf76fcd=_0x355485;_0x372e28[_0xeb1b('0x3a')]=_[_0xeb1b('0x3c')](db[_0xeb1b('0x5e')][_0xeb1b('0x36')]);_0x372e28['query']=_[_0xeb1b('0x3c')](_0x15ab44[_0xeb1b('0x3b')]);_0x372e28[_0xeb1b('0x3d')]=_[_0xeb1b('0x3e')](_0x372e28[_0xeb1b('0x3a')],_0x372e28[_0xeb1b('0x3b')]);_0x51ba84['attributes']=_[_0xeb1b('0x3e')](_0x372e28['model'],qs[_0xeb1b('0x40')](_0x15ab44[_0xeb1b('0x3b')][_0xeb1b('0x40')]));_0x51ba84[_0xeb1b('0x3f')]=_0x51ba84[_0xeb1b('0x3f')][_0xeb1b('0x41')]?_0x51ba84[_0xeb1b('0x3f')]:_0x372e28[_0xeb1b('0x3a')];_0x51ba84[_0xeb1b('0x5b')]=qs['sort'](_0x15ab44['query'][_0xeb1b('0x44')]);_0x51ba84['where']=qs[_0xeb1b('0x3d')](_[_0xeb1b('0x46')](_0x15ab44[_0xeb1b('0x3b')],_0x372e28[_0xeb1b('0x3d')]));if(_0x15ab44[_0xeb1b('0x3b')][_0xeb1b('0x49')]){_0x51ba84['where']=_[_0xeb1b('0x47')](_0x51ba84[_0xeb1b('0x45')],{'$or':_['map'](_0x51ba84['attributes'],function(_0x1be869){var _0x3552b2={};_0x3552b2[_0x1be869]={'$like':'%'+_0x15ab44[_0xeb1b('0x3b')][_0xeb1b('0x49')]+'%'};return _0x3552b2;})});}_0x51ba84=_[_0xeb1b('0x47')]({},_0x51ba84,_0x15ab44[_0xeb1b('0x4a')]);return _0xf76fcd['getAgents'](_0x51ba84);}})[_0xeb1b('0x2c')](function(_0x4caa94){if(_0x4caa94){_0x12b440=_0x4caa94[_0xeb1b('0x41')];if(!_0x15ab44[_0xeb1b('0x3b')][_0xeb1b('0x42')](_0xeb1b('0x43'))){_0x51ba84[_0xeb1b('0x24')]=qs[_0xeb1b('0x24')](_0x15ab44[_0xeb1b('0x3b')]['limit']);_0x51ba84[_0xeb1b('0x22')]=qs['offset'](_0x15ab44[_0xeb1b('0x3b')][_0xeb1b('0x22')]);}return _0xf76fcd['getAgents'](_0x51ba84);}})[_0xeb1b('0x2c')](function(_0x70af2a){if(_0x70af2a){return _0x70af2a?{'count':_0x12b440,'rows':_0x70af2a}:null;}})[_0xeb1b('0x2c')](respondWithResult(_0x2203f1,null))['catch'](handleError(_0x2203f1,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 75b218c..d5e56f7 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 _0x485c=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x485c,0xf3));var _0xc485=function(_0x525c31,_0x281564){_0x525c31=_0x525c31-0x0;var _0x18535b=_0x485c[_0x525c31];return _0x18535b;};'use strict';var EventEmitter=require(_0xc485('0x0'));var SmsQueue=require(_0xc485('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc485('0x2')](0x0);var events={'afterCreate':_0xc485('0x3'),'afterUpdate':_0xc485('0x4'),'afterDestroy':_0xc485('0x5')};function emitEvent(_0x3f9b63){return function(_0x554d72,_0x70977e,_0x40942){SmsQueueEvents['emit'](_0x3f9b63+':'+_0x554d72['id'],_0x554d72);SmsQueueEvents[_0xc485('0x6')](_0x3f9b63,_0x554d72);_0x40942(null);};}for(var e in events){if(events[_0xc485('0x7')](e)){var event=events[e];SmsQueue[_0xc485('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x65d0=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit'];(function(_0x112198,_0x52c556){var _0x21b4b3=function(_0x24b17f){while(--_0x24b17f){_0x112198['push'](_0x112198['shift']());}};_0x21b4b3(++_0x52c556);}(_0x65d0,0x17f));var _0x065d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x65d0[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x065d('0x0'));var SmsQueue=require(_0x065d('0x1'))['db'][_0x065d('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x065d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x065d('0x4'),'afterDestroy':_0x065d('0x5')};function emitEvent(_0x31c5bc){return function(_0x37e560,_0x1b1aa2,_0x147f06){SmsQueueEvents[_0x065d('0x6')](_0x31c5bc+':'+_0x37e560['id'],_0x37e560);SmsQueueEvents[_0x065d('0x6')](_0x31c5bc,_0x37e560);_0x147f06(null);};}for(var e in events){if(events[_0x065d('0x7')](e)){var event=events[e];SmsQueue[_0x065d('0x8')](e,emitEvent(event));}}module[_0x065d('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 983d65f..ce6c553 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 _0x8a06=['path','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger','moment','bluebird'];(function(_0x2442bd,_0x26ed49){var _0x50fecc=function(_0x293405){while(--_0x293405){_0x2442bd['push'](_0x2442bd['shift']());}};_0x50fecc(++_0x26ed49);}(_0x8a06,0x10f));var _0x68a0=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x8a06[_0x51b661];return _0x5d1971;};'use strict';var _=require('lodash');var util=require(_0x68a0('0x0'));var logger=require(_0x68a0('0x1'))('api');var moment=require(_0x68a0('0x2'));var BPromise=require(_0x68a0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x68a0('0x4'));var rimraf=require('rimraf');var config=require(_0x68a0('0x5'));var attributes=require(_0x68a0('0x6'));module[_0x68a0('0x7')]=function(_0x217f38,_0x390d3c){return _0x217f38[_0x68a0('0x8')](_0x68a0('0x9'),attributes,{'tableName':_0x68a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b18=['sms_queues','lodash','util','api','moment','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4b18,0x90));var _0x84b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84b1('0x0'));var util=require(_0x84b1('0x1'));var logger=require('../../config/logger')(_0x84b1('0x2'));var moment=require(_0x84b1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x84b1('0x4'));var config=require(_0x84b1('0x5'));var attributes=require(_0x84b1('0x6'));module[_0x84b1('0x7')]=function(_0x3bb301,_0x1dbd58){return _0x3bb301[_0x84b1('0x8')](_0x84b1('0x9'),attributes,{'tableName':_0x84b1('0xa'),'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 284816d..3636852 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 _0xe827=['localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x20ec4b,_0x305755){var _0x3e2f92=function(_0x585115){while(--_0x585115){_0x20ec4b['push'](_0x20ec4b['shift']());}};_0x3e2f92(++_0x305755);}(_0xe827,0x1a4));var _0x7e82=function(_0x512d2b,_0x3f1843){_0x512d2b=_0x512d2b-0x0;var _0x432f8e=_0xe827[_0x512d2b];return _0x432f8e;};'use strict';var _=require(_0x7e82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e82('0x1'));var db=require(_0x7e82('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e82('0x3'))(_0x7e82('0x4'));var config=require(_0x7e82('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7e82('0x6')][_0x7e82('0x7')]({'port':0x232a});config[_0x7e82('0x8')]=_['defaults'](config['redis'],{'host':_0x7e82('0x9'),'port':0x18eb});var socket=require(_0x7e82('0xa'))(new Redis(config[_0x7e82('0x8')]));require(_0x7e82('0xb'))[_0x7e82('0xc')](socket);function respondWithRpcPromise(_0xcebcd4,_0x3e945e,_0x5fbff7){return new BPromise(function(_0xba0fbf,_0x2bdc69){return client[_0x7e82('0xd')](_0xcebcd4,_0x5fbff7)['then'](function(_0x2bdd5e){logger[_0x7e82('0xe')](_0x7e82('0xf'),_0x3e945e,_0x7e82('0x10'));logger[_0x7e82('0x11')](_0x7e82('0x12'),_0x3e945e,'request\x20sent',JSON[_0x7e82('0x13')](_0x2bdd5e));if(_0x2bdd5e[_0x7e82('0x14')]){if(_0x2bdd5e[_0x7e82('0x14')][_0x7e82('0x15')]===0x1f4){logger[_0x7e82('0x14')](_0x7e82('0xf'),_0x3e945e,_0x2bdd5e[_0x7e82('0x14')][_0x7e82('0x16')]);return _0x2bdc69(_0x2bdd5e[_0x7e82('0x14')][_0x7e82('0x16')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x3e945e,_0x2bdd5e['error']['message']);return _0xba0fbf(_0x2bdd5e[_0x7e82('0x14')][_0x7e82('0x16')]);}else{logger[_0x7e82('0xe')](_0x7e82('0xf'),_0x3e945e,_0x7e82('0x10'));_0xba0fbf(_0x2bdd5e[_0x7e82('0x17')][_0x7e82('0x16')]);}})[_0x7e82('0x18')](function(_0x4cbfdf){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3e945e,_0x4cbfdf);_0x2bdc69(_0x4cbfdf);});});}exports['GetSmsQueue']=function(_0x4302fe){var _0x1a1381=this;return new Promise(function(_0x117640,_0x6e76f7){return db['SmsQueue'][_0x7e82('0x19')]({'raw':_0x4302fe[_0x7e82('0x1a')]?_0x4302fe[_0x7e82('0x1a')][_0x7e82('0x1b')]===undefined?!![]:![]:!![],'where':_0x4302fe['options']?_0x4302fe[_0x7e82('0x1a')][_0x7e82('0x1c')]||null:null,'attributes':_0x4302fe[_0x7e82('0x1a')]?_0x4302fe['options'][_0x7e82('0x1d')]||null:null,'limit':_0x4302fe[_0x7e82('0x1a')]?_0x4302fe['options'][_0x7e82('0x1e')]||null:null,'include':_0x4302fe[_0x7e82('0x1a')]?_0x4302fe[_0x7e82('0x1a')][_0x7e82('0x1f')]?_[_0x7e82('0x20')](_0x4302fe['options'][_0x7e82('0x1f')],function(_0x360e14){return{'model':db[_0x360e14[_0x7e82('0x21')]],'as':_0x360e14['as'],'attributes':_0x360e14[_0x7e82('0x1d')],'include':_0x360e14[_0x7e82('0x1f')]?_[_0x7e82('0x20')](_0x360e14[_0x7e82('0x1f')],function(_0x50cae0){return{'model':db[_0x50cae0[_0x7e82('0x21')]],'as':_0x50cae0['as'],'attributes':_0x50cae0[_0x7e82('0x1d')],'include':_0x50cae0[_0x7e82('0x1f')]?_['map'](_0x50cae0[_0x7e82('0x1f')],function(_0x210e97){return{'model':db[_0x210e97[_0x7e82('0x21')]],'as':_0x210e97['as'],'attributes':_0x210e97[_0x7e82('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e82('0x22')](function(_0x515c3b){logger[_0x7e82('0xe')](_0x7e82('0x23'),_0x4302fe);logger[_0x7e82('0x11')]('GetSmsQueue',_0x4302fe,JSON[_0x7e82('0x13')](_0x515c3b));_0x117640(_0x515c3b);})[_0x7e82('0x18')](function(_0x301b12){logger['error'](_0x7e82('0x23'),_0x301b12[_0x7e82('0x16')],_0x4302fe);_0x6e76f7(_0x1a1381[_0x7e82('0x14')](0x1f4,_0x301b12[_0x7e82('0x16')]));});});};exports[_0x7e82('0x24')]=function(_0x5008d0){var _0x551897=this;return new Promise(function(_0x1bd12a,_0xc6bc65){return db[_0x7e82('0x25')][_0x7e82('0x26')]({'raw':_0x5008d0[_0x7e82('0x1a')]?_0x5008d0[_0x7e82('0x1a')][_0x7e82('0x1b')]===undefined?!![]:![]:!![],'where':_0x5008d0[_0x7e82('0x1a')]?_0x5008d0[_0x7e82('0x1a')]['where']||null:null,'attributes':_0x5008d0['options']?_0x5008d0['options'][_0x7e82('0x1d')]||null:null,'include':_0x5008d0[_0x7e82('0x1a')]?_0x5008d0[_0x7e82('0x1a')][_0x7e82('0x1f')]?_[_0x7e82('0x20')](_0x5008d0[_0x7e82('0x1a')][_0x7e82('0x1f')],function(_0x5247be){return{'model':db[_0x5247be[_0x7e82('0x21')]],'as':_0x5247be['as'],'attributes':_0x5247be[_0x7e82('0x1d')],'include':_0x5247be[_0x7e82('0x1f')]?_['map'](_0x5247be[_0x7e82('0x1f')],function(_0x24e8d1){return{'model':db[_0x24e8d1[_0x7e82('0x21')]],'as':_0x24e8d1['as'],'attributes':_0x24e8d1[_0x7e82('0x1d')],'include':_0x24e8d1[_0x7e82('0x1f')]?_[_0x7e82('0x20')](_0x24e8d1[_0x7e82('0x1f')],function(_0x374d48){return{'model':db[_0x374d48[_0x7e82('0x21')]],'as':_0x374d48['as'],'attributes':_0x374d48[_0x7e82('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7e82('0x22')](function(_0x1d630b){logger[_0x7e82('0xe')](_0x7e82('0x24'),_0x5008d0);logger[_0x7e82('0x11')](_0x7e82('0x24'),_0x5008d0,JSON['stringify'](_0x1d630b));_0x1bd12a(_0x1d630b);})[_0x7e82('0x18')](function(_0x49e926){logger[_0x7e82('0x14')]('ShowSmsQueue',_0x49e926[_0x7e82('0x16')],_0x5008d0);_0xc6bc65(_0x551897[_0x7e82('0x14')](0x1f4,_0x49e926[_0x7e82('0x16')]));});});}; \ No newline at end of file +var _0xc44c=['GetSmsQueue','debug','stringify','ShowSmsQueue','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','SmsQueue','findAll','options','raw','attributes','include','map','model','then'];(function(_0x3d0133,_0x5bb2bf){var _0x30e7e8=function(_0x24c0dd){while(--_0x24c0dd){_0x3d0133['push'](_0x3d0133['shift']());}};_0x30e7e8(++_0x5bb2bf);}(_0xc44c,0xfb));var _0xcc44=function(_0xd93377,_0x331b22){_0xd93377=_0xd93377-0x0;var _0xd178d=_0xc44c[_0xd93377];return _0xd178d;};'use strict';var _=require(_0xcc44('0x0'));var util=require(_0xcc44('0x1'));var moment=require(_0xcc44('0x2'));var BPromise=require(_0xcc44('0x3'));var rs=require(_0xcc44('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc44('0x5'))['db'];var utils=require(_0xcc44('0x6'));var logger=require(_0xcc44('0x7'))(_0xcc44('0x8'));var config=require(_0xcc44('0x9'));var jayson=require(_0xcc44('0xa'));var client=jayson['client'][_0xcc44('0xb')]({'port':0x232a});config[_0xcc44('0xc')]=_[_0xcc44('0xd')](config['redis'],{'host':_0xcc44('0xe'),'port':0x18eb});var socket=require(_0xcc44('0xf'))(new Redis(config[_0xcc44('0xc')]));require(_0xcc44('0x10'))[_0xcc44('0x11')](socket);function respondWithRpcPromise(_0x2e34fb,_0x3e06fc,_0x2a57a5){return new BPromise(function(_0xaf5e3f,_0x43aaa6){return client[_0xcc44('0x12')](_0x2e34fb,_0x2a57a5)['then'](function(_0x3a1153){logger['info']('SmsQueue,\x20%s,\x20%s',_0x3e06fc,_0xcc44('0x13'));logger['debug'](_0xcc44('0x14'),_0x3e06fc,_0xcc44('0x13'),JSON['stringify'](_0x3a1153));if(_0x3a1153[_0xcc44('0x15')]){if(_0x3a1153[_0xcc44('0x15')][_0xcc44('0x16')]===0x1f4){logger[_0xcc44('0x15')](_0xcc44('0x17'),_0x3e06fc,_0x3a1153['error'][_0xcc44('0x18')]);return _0x43aaa6(_0x3a1153[_0xcc44('0x15')][_0xcc44('0x18')]);}logger['error'](_0xcc44('0x17'),_0x3e06fc,_0x3a1153[_0xcc44('0x15')][_0xcc44('0x18')]);return _0xaf5e3f(_0x3a1153[_0xcc44('0x15')][_0xcc44('0x18')]);}else{logger[_0xcc44('0x19')](_0xcc44('0x17'),_0x3e06fc,_0xcc44('0x13'));_0xaf5e3f(_0x3a1153['result'][_0xcc44('0x18')]);}})[_0xcc44('0x1a')](function(_0x19e02f){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3e06fc,_0x19e02f);_0x43aaa6(_0x19e02f);});});}exports['GetSmsQueue']=function(_0x88e67f){var _0x49df3e=this;return new Promise(function(_0x576127,_0x13208f){return db[_0xcc44('0x1b')][_0xcc44('0x1c')]({'raw':_0x88e67f[_0xcc44('0x1d')]?_0x88e67f[_0xcc44('0x1d')][_0xcc44('0x1e')]===undefined?!![]:![]:!![],'where':_0x88e67f[_0xcc44('0x1d')]?_0x88e67f['options']['where']||null:null,'attributes':_0x88e67f[_0xcc44('0x1d')]?_0x88e67f['options'][_0xcc44('0x1f')]||null:null,'limit':_0x88e67f[_0xcc44('0x1d')]?_0x88e67f[_0xcc44('0x1d')]['limit']||null:null,'include':_0x88e67f['options']?_0x88e67f[_0xcc44('0x1d')][_0xcc44('0x20')]?_['map'](_0x88e67f['options'][_0xcc44('0x20')],function(_0x4fcb4d){return{'model':db[_0x4fcb4d['model']],'as':_0x4fcb4d['as'],'attributes':_0x4fcb4d[_0xcc44('0x1f')],'include':_0x4fcb4d[_0xcc44('0x20')]?_[_0xcc44('0x21')](_0x4fcb4d[_0xcc44('0x20')],function(_0x479cf8){return{'model':db[_0x479cf8[_0xcc44('0x22')]],'as':_0x479cf8['as'],'attributes':_0x479cf8[_0xcc44('0x1f')],'include':_0x479cf8[_0xcc44('0x20')]?_[_0xcc44('0x21')](_0x479cf8['include'],function(_0x21de2b){return{'model':db[_0x21de2b['model']],'as':_0x21de2b['as'],'attributes':_0x21de2b['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc44('0x23')](function(_0x281f92){logger[_0xcc44('0x19')](_0xcc44('0x24'),_0x88e67f);logger[_0xcc44('0x25')](_0xcc44('0x24'),_0x88e67f,JSON[_0xcc44('0x26')](_0x281f92));_0x576127(_0x281f92);})['catch'](function(_0xe0442c){logger[_0xcc44('0x15')](_0xcc44('0x24'),_0xe0442c[_0xcc44('0x18')],_0x88e67f);_0x13208f(_0x49df3e['error'](0x1f4,_0xe0442c[_0xcc44('0x18')]));});});};exports[_0xcc44('0x27')]=function(_0x1beaf6){var _0x10f8fb=this;return new Promise(function(_0x37586,_0x18b74f){return db[_0xcc44('0x1b')]['find']({'raw':_0x1beaf6[_0xcc44('0x1d')]?_0x1beaf6[_0xcc44('0x1d')][_0xcc44('0x1e')]===undefined?!![]:![]:!![],'where':_0x1beaf6[_0xcc44('0x1d')]?_0x1beaf6[_0xcc44('0x1d')][_0xcc44('0x28')]||null:null,'attributes':_0x1beaf6['options']?_0x1beaf6['options'][_0xcc44('0x1f')]||null:null,'include':_0x1beaf6[_0xcc44('0x1d')]?_0x1beaf6[_0xcc44('0x1d')]['include']?_[_0xcc44('0x21')](_0x1beaf6[_0xcc44('0x1d')]['include'],function(_0x21ae1c){return{'model':db[_0x21ae1c['model']],'as':_0x21ae1c['as'],'attributes':_0x21ae1c[_0xcc44('0x1f')],'include':_0x21ae1c[_0xcc44('0x20')]?_[_0xcc44('0x21')](_0x21ae1c[_0xcc44('0x20')],function(_0x5866cb){return{'model':db[_0x5866cb[_0xcc44('0x22')]],'as':_0x5866cb['as'],'attributes':_0x5866cb[_0xcc44('0x1f')],'include':_0x5866cb[_0xcc44('0x20')]?_[_0xcc44('0x21')](_0x5866cb['include'],function(_0x4e1644){return{'model':db[_0x4e1644['model']],'as':_0x4e1644['as'],'attributes':_0x4e1644[_0xcc44('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcc44('0x23')](function(_0x129d84){logger[_0xcc44('0x19')](_0xcc44('0x27'),_0x1beaf6);logger[_0xcc44('0x25')](_0xcc44('0x27'),_0x1beaf6,JSON['stringify'](_0x129d84));_0x37586(_0x129d84);})[_0xcc44('0x1a')](function(_0xd0ee8d){logger[_0xcc44('0x15')]('ShowSmsQueue',_0xd0ee8d[_0xcc44('0x18')],_0x1beaf6);_0x18b74f(_0x10f8fb[_0xcc44('0x15')](0x1f4,_0xd0ee8d[_0xcc44('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 01a23d5..69ccfa7 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 _0xb289=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x1c6d4f,_0x37e880){var _0x2598af=function(_0x4e9104){while(--_0x4e9104){_0x1c6d4f['push'](_0x1c6d4f['shift']());}};_0x2598af(++_0x37e880);}(_0xb289,0x1ee));var _0x9b28=function(_0x34af1f,_0x10457e){_0x34af1f=_0x34af1f-0x0;var _0x3716c8=_0xb289[_0x34af1f];return _0x3716c8;};'use strict';var SmsQueueEvents=require(_0x9b28('0x0'));var events=[_0x9b28('0x1'),_0x9b28('0x2'),'update'];function createListener(_0x2f4227,_0x3ff9d0){return function(_0x56ccb0){_0x3ff9d0[_0x9b28('0x3')](_0x2f4227,_0x56ccb0);};}function removeListener(_0x540958,_0x4b3baa){return function(){SmsQueueEvents[_0x9b28('0x4')](_0x540958,_0x4b3baa);};}exports['register']=function(_0x367494){for(var _0x11b749=0x0,_0x47f003=events[_0x9b28('0x5')];_0x11b749<_0x47f003;_0x11b749++){var _0x4f33fb=events[_0x11b749];var _0xcdba3d=createListener(_0x9b28('0x6')+_0x4f33fb,_0x367494);SmsQueueEvents['on'](_0x4f33fb,_0xcdba3d);}}; \ No newline at end of file +var _0x5d92=['smsQueue:','./smsQueue.events','save','emit','removeListener','register'];(function(_0x3e28e4,_0x2c7aad){var _0x1d23f8=function(_0x4ec2d8){while(--_0x4ec2d8){_0x3e28e4['push'](_0x3e28e4['shift']());}};_0x1d23f8(++_0x2c7aad);}(_0x5d92,0xaf));var _0x25d9=function(_0x20f653,_0x4982eb){_0x20f653=_0x20f653-0x0;var _0x5a686f=_0x5d92[_0x20f653];return _0x5a686f;};'use strict';var SmsQueueEvents=require(_0x25d9('0x0'));var events=[_0x25d9('0x1'),'remove','update'];function createListener(_0x261e7f,_0x56dfa1){return function(_0x193b6b){_0x56dfa1[_0x25d9('0x2')](_0x261e7f,_0x193b6b);};}function removeListener(_0xe324d1,_0x4209ea){return function(){SmsQueueEvents[_0x25d9('0x3')](_0xe324d1,_0x4209ea);};}exports[_0x25d9('0x4')]=function(_0x5fc820){for(var _0x369c1f=0x0,_0x18cfd2=events['length'];_0x369c1f<_0x18cfd2;_0x369c1f++){var _0x58858e=events[_0x369c1f];var _0x226e65=createListener(_0x25d9('0x5')+_0x58858e,_0x5fc820);SmsQueueEvents['on'](_0x58858e,_0x226e65);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 8b6b2d0..bbc5951 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 _0x7233=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/describe','isAuthenticated','describe','get','show','post','/:id','update','delete'];(function(_0x2a4467,_0x36d01a){var _0x2df85c=function(_0x1e0fd4){while(--_0x1e0fd4){_0x2a4467['push'](_0x2a4467['shift']());}};_0x2df85c(++_0x36d01a);}(_0x7233,0x8d));var _0x3723=function(_0x3868dc,_0x420398){_0x3868dc=_0x3868dc-0x0;var _0xc466fb=_0x7233[_0x3868dc];return _0xc466fb;};'use strict';var multer=require(_0x3723('0x0'));var util=require(_0x3723('0x1'));var path=require(_0x3723('0x2'));var timeout=require(_0x3723('0x3'));var express=require(_0x3723('0x4'));var router=express[_0x3723('0x5')]();var fs_extra=require(_0x3723('0x6'));var auth=require(_0x3723('0x7'));var interaction=require(_0x3723('0x8'));var config=require(_0x3723('0x9'));var controller=require('./smsQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3723('0xa'),auth[_0x3723('0xb')](),controller[_0x3723('0xc')]);router[_0x3723('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3723('0xe')]);router[_0x3723('0xf')]('/',auth[_0x3723('0xb')](),controller['create']);router['put'](_0x3723('0x10'),auth[_0x3723('0xb')](),controller[_0x3723('0x11')]);router[_0x3723('0x12')](_0x3723('0x10'),auth['isAuthenticated'](),controller[_0x3723('0x13')]);module['exports']=router; \ No newline at end of file +var _0x76a8=['/describe','describe','/:id','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x76a8,0x170));var _0x876a=function(_0x48835e,_0x2033e8){_0x48835e=_0x48835e-0x0;var _0x3d3614=_0x76a8[_0x48835e];return _0x3d3614;};'use strict';var multer=require(_0x876a('0x0'));var util=require(_0x876a('0x1'));var path=require('path');var timeout=require(_0x876a('0x2'));var express=require(_0x876a('0x3'));var router=express['Router']();var fs_extra=require(_0x876a('0x4'));var auth=require(_0x876a('0x5'));var interaction=require(_0x876a('0x6'));var config=require(_0x876a('0x7'));var controller=require(_0x876a('0x8'));router[_0x876a('0x9')]('/',auth[_0x876a('0xa')](),controller[_0x876a('0xb')]);router[_0x876a('0x9')](_0x876a('0xc'),auth[_0x876a('0xa')](),controller[_0x876a('0xd')]);router[_0x876a('0x9')](_0x876a('0xe'),auth[_0x876a('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x876a('0xf')]);router['put'](_0x876a('0xe'),auth[_0x876a('0xa')](),controller[_0x876a('0x10')]);router[_0x876a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x876a('0x12')]);module[_0x876a('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e109a16..909db6e 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 _0xc999=['STRING','DATE','sequelize','exports'];(function(_0x5b5d01,_0x563f17){var _0x535208=function(_0x412257){while(--_0x412257){_0x5b5d01['push'](_0x5b5d01['shift']());}};_0x535208(++_0x563f17);}(_0xc999,0x176));var _0x9c99=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xc999[_0x1c9c24];return _0x349c69;};'use strict';var moment=require('moment');var Sequelize=require(_0x9c99('0x0'));module[_0x9c99('0x1')]={'uniqueid':{'type':Sequelize[_0x9c99('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9c99('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2128=['DATE','STRING','moment','exports'];(function(_0x3608b4,_0x351259){var _0x1455ca=function(_0x3dac29){while(--_0x3dac29){_0x3608b4['push'](_0x3608b4['shift']());}};_0x1455ca(++_0x351259);}(_0x2128,0x146));var _0x8212=function(_0x475a39,_0x5eab52){_0x475a39=_0x475a39-0x0;var _0x194426=_0x2128[_0x475a39];return _0x194426;};'use strict';var moment=require(_0x8212('0x0'));var Sequelize=require('sequelize');module[_0x8212('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8212('0x2')]},'leaveAt':{'type':Sequelize[_0x8212('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8212('0x2')]},'reason':{'type':Sequelize[_0x8212('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 734c94b..e9f7cff 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 _0xd4ff=['reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','zip-dir','request-promise','moment','mustache','util','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0xbc6e17,_0x2b3de5){var _0x29b837=function(_0x13b06d){while(--_0x13b06d){_0xbc6e17['push'](_0xbc6e17['shift']());}};_0x29b837(++_0x2b3de5);}(_0xd4ff,0x70));var _0xfd4f=function(_0x3f9980,_0x340405){_0x3f9980=_0x3f9980-0x0;var _0x6580fb=_0xd4ff[_0x3f9980];return _0x6580fb;};'use strict';var emlformat=require(_0xfd4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd4f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd4f('0x2'));var moment=require(_0xfd4f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfd4f('0x4'));var util=require(_0xfd4f('0x5'));var path=require('path');var sox=require(_0xfd4f('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('squel');var crypto=require(_0xfd4f('0x7'));var jsforce=require(_0xfd4f('0x8'));var deskjs=require(_0xfd4f('0x9'));var toCsv=require(_0xfd4f('0xa'));var querystring=require(_0xfd4f('0xb'));var Papa=require(_0xfd4f('0xc'));var Redis=require(_0xfd4f('0xd'));var authService=require(_0xfd4f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd4f('0xf'));var logger=require('../../config/logger')(_0xfd4f('0x10'));var utils=require(_0xfd4f('0x11'));var config=require(_0xfd4f('0x12'));var licenseUtil=require(_0xfd4f('0x13'));var db=require(_0xfd4f('0x14'))['db'];function respondWithStatusCode(_0x8d18ae,_0x3d1896){_0x3d1896=_0x3d1896||0xcc;return function(_0x27b869){if(_0x27b869){return _0x8d18ae[_0xfd4f('0x15')](_0x3d1896);}return _0x8d18ae[_0xfd4f('0x16')](_0x3d1896)[_0xfd4f('0x17')]();};}function respondWithResult(_0x5a411b,_0x3c82cf){_0x3c82cf=_0x3c82cf||0xc8;return function(_0x1c2bca){if(_0x1c2bca){return _0x5a411b['status'](_0x3c82cf)[_0xfd4f('0x18')](_0x1c2bca);}};}function respondWithFilteredResult(_0x29df57,_0x5db736){return function(_0x54b927){if(_0x54b927){var _0x233056=typeof _0x5db736[_0xfd4f('0x19')]===_0xfd4f('0x1a')&&typeof _0x5db736[_0xfd4f('0x1b')]===_0xfd4f('0x1a');var _0x2fc164=_0x54b927['count'];var _0x12fbf9=_0x233056?0x0:_0x5db736[_0xfd4f('0x19')];var _0x1d598f=_0x233056?_0x54b927[_0xfd4f('0x1c')]:_0x5db736[_0xfd4f('0x19')]+_0x5db736[_0xfd4f('0x1b')];var _0x56ba60;if(_0x1d598f>=_0x2fc164){_0x1d598f=_0x2fc164;_0x56ba60=0xc8;}else{_0x56ba60=0xce;}_0x29df57[_0xfd4f('0x16')](_0x56ba60);return _0x29df57['set'](_0xfd4f('0x1d'),_0x12fbf9+'-'+_0x1d598f+'/'+_0x2fc164)[_0xfd4f('0x18')](_0x54b927);}return null;};}function patchUpdates(_0x30a3d9){return function(_0x6795fc){try{jsonpatch['apply'](_0x6795fc,_0x30a3d9,!![]);}catch(_0x3cf921){return BPromise[_0xfd4f('0x1e')](_0x3cf921);}return _0x6795fc[_0xfd4f('0x1f')]();};}function saveUpdates(_0x18b3e1,_0x440ca2){return function(_0x51fd0a){if(_0x51fd0a){return _0x51fd0a[_0xfd4f('0x20')](_0x18b3e1)[_0xfd4f('0x21')](function(_0x1b80ec){return _0x1b80ec;});}return null;};}function removeEntity(_0x36ed31,_0x2ee8c2){return function(_0x3285a9){if(_0x3285a9){return _0x3285a9[_0xfd4f('0x22')]()[_0xfd4f('0x21')](function(){_0x36ed31[_0xfd4f('0x16')](0xcc)[_0xfd4f('0x17')]();});}};}function handleEntityNotFound(_0xafb394,_0x3056ed){return function(_0xbf3638){if(!_0xbf3638){_0xafb394[_0xfd4f('0x15')](0x194);}return _0xbf3638;};}function handleError(_0x1c5c84,_0x22e331){_0x22e331=_0x22e331||0x1f4;return function(_0x26c58e){logger[_0xfd4f('0x23')](_0x26c58e[_0xfd4f('0x24')]);if(_0x26c58e[_0xfd4f('0x25')]){delete _0x26c58e['name'];}_0x1c5c84[_0xfd4f('0x16')](_0x22e331)[_0xfd4f('0x26')](_0x26c58e);};}exports[_0xfd4f('0x27')]=function(_0x59bd75,_0x40558d){var _0x426865={},_0x5592c2={},_0x20d56f={'count':0x0,'rows':[]};var _0x5c5461=_[_0xfd4f('0x28')](db['SmsQueueReport'][_0xfd4f('0x29')],function(_0x1d3d4f){return{'name':_0x1d3d4f['fieldName'],'type':_0x1d3d4f[_0xfd4f('0x2a')][_0xfd4f('0x2b')]};});_0x5592c2[_0xfd4f('0x2c')]=_[_0xfd4f('0x28')](_0x5c5461,_0xfd4f('0x25'));_0x5592c2[_0xfd4f('0x2d')]=_[_0xfd4f('0x2e')](_0x59bd75[_0xfd4f('0x2d')]);_0x5592c2[_0xfd4f('0x2f')]=_[_0xfd4f('0x30')](_0x5592c2[_0xfd4f('0x2c')],_0x5592c2['query']);_0x426865[_0xfd4f('0x31')]=_['intersection'](_0x5592c2['model'],qs[_0xfd4f('0x32')](_0x59bd75[_0xfd4f('0x2d')][_0xfd4f('0x32')]));_0x426865[_0xfd4f('0x31')]=_0x426865[_0xfd4f('0x31')]['length']?_0x426865[_0xfd4f('0x31')]:_0x5592c2[_0xfd4f('0x2c')];if(!_0x59bd75[_0xfd4f('0x2d')][_0xfd4f('0x33')]('nolimit')){_0x426865[_0xfd4f('0x1b')]=qs['limit'](_0x59bd75[_0xfd4f('0x2d')]['limit']);_0x426865[_0xfd4f('0x19')]=qs[_0xfd4f('0x19')](_0x59bd75[_0xfd4f('0x2d')][_0xfd4f('0x19')]);}_0x426865['order']=qs[_0xfd4f('0x34')](_0x59bd75[_0xfd4f('0x2d')][_0xfd4f('0x34')]);_0x426865['where']=qs[_0xfd4f('0x2f')](_[_0xfd4f('0x35')](_0x59bd75[_0xfd4f('0x2d')],_0x5592c2[_0xfd4f('0x2f')]),_0x5c5461);if(_0x59bd75['query'][_0xfd4f('0x36')]){_0x426865[_0xfd4f('0x37')]=_[_0xfd4f('0x38')](_0x426865[_0xfd4f('0x37')],{'$or':_[_0xfd4f('0x28')](_0x5c5461,function(_0x288238){if(_0x288238['type']!==_0xfd4f('0x39')){var _0x1e3605={};_0x1e3605[_0x288238[_0xfd4f('0x25')]]={'$like':'%'+_0x59bd75[_0xfd4f('0x2d')][_0xfd4f('0x36')]+'%'};return _0x1e3605;}})});}_0x426865=_[_0xfd4f('0x38')]({},_0x426865,_0x59bd75['options']);var _0xeff07f={'where':_0x426865[_0xfd4f('0x37')]};return db[_0xfd4f('0x3a')][_0xfd4f('0x1c')](_0xeff07f)['then'](function(_0x4fa809){_0x20d56f[_0xfd4f('0x1c')]=_0x4fa809;if(_0x59bd75['query'][_0xfd4f('0x3b')]){_0x426865[_0xfd4f('0x3c')]=[{'all':!![]}];}return db[_0xfd4f('0x3a')][_0xfd4f('0x3d')](_0x426865);})[_0xfd4f('0x21')](function(_0x27282e){_0x20d56f[_0xfd4f('0x3e')]=_0x27282e;return _0x20d56f;})[_0xfd4f('0x21')](respondWithFilteredResult(_0x40558d,_0x426865))[_0xfd4f('0x3f')](handleError(_0x40558d,null));};exports[_0xfd4f('0x40')]=function(_0x4ac29e,_0x280406){var _0x1dc7e6={'raw':!![],'where':{'id':_0x4ac29e[_0xfd4f('0x41')]['id']}},_0x20343c={};_0x20343c[_0xfd4f('0x2c')]=_[_0xfd4f('0x2e')](db[_0xfd4f('0x3a')][_0xfd4f('0x29')]);_0x20343c[_0xfd4f('0x2d')]=_[_0xfd4f('0x2e')](_0x4ac29e[_0xfd4f('0x2d')]);_0x20343c[_0xfd4f('0x2f')]=_[_0xfd4f('0x30')](_0x20343c[_0xfd4f('0x2c')],_0x20343c[_0xfd4f('0x2d')]);_0x1dc7e6[_0xfd4f('0x31')]=_[_0xfd4f('0x30')](_0x20343c[_0xfd4f('0x2c')],qs[_0xfd4f('0x32')](_0x4ac29e['query'][_0xfd4f('0x32')]));_0x1dc7e6[_0xfd4f('0x31')]=_0x1dc7e6[_0xfd4f('0x31')]['length']?_0x1dc7e6['attributes']:_0x20343c['model'];if(_0x4ac29e[_0xfd4f('0x2d')][_0xfd4f('0x3b')]){_0x1dc7e6['include']=[{'all':!![]}];}_0x1dc7e6=_[_0xfd4f('0x38')]({},_0x1dc7e6,_0x4ac29e[_0xfd4f('0x42')]);return db[_0xfd4f('0x3a')]['find'](_0x1dc7e6)[_0xfd4f('0x21')](handleEntityNotFound(_0x280406,null))[_0xfd4f('0x21')](respondWithResult(_0x280406,null))[_0xfd4f('0x3f')](handleError(_0x280406,null));};exports['create']=function(_0xe86ffd,_0x4bc6b6){return db[_0xfd4f('0x3a')][_0xfd4f('0x43')](_0xe86ffd[_0xfd4f('0x44')],{})[_0xfd4f('0x21')](respondWithResult(_0x4bc6b6,0xc9))[_0xfd4f('0x3f')](handleError(_0x4bc6b6,null));};exports[_0xfd4f('0x20')]=function(_0x5d83de,_0x3a0088){if(_0x5d83de['body']['id']){delete _0x5d83de[_0xfd4f('0x44')]['id'];}return db[_0xfd4f('0x3a')][_0xfd4f('0x45')]({'where':{'id':_0x5d83de[_0xfd4f('0x41')]['id']}})[_0xfd4f('0x21')](handleEntityNotFound(_0x3a0088,null))[_0xfd4f('0x21')](saveUpdates(_0x5d83de[_0xfd4f('0x44')],null))[_0xfd4f('0x21')](respondWithResult(_0x3a0088,null))[_0xfd4f('0x3f')](handleError(_0x3a0088,null));};exports[_0xfd4f('0x22')]=function(_0x99d1a6,_0x115b2a){return db[_0xfd4f('0x3a')]['find']({'where':{'id':_0x99d1a6['params']['id']}})[_0xfd4f('0x21')](handleEntityNotFound(_0x115b2a,null))[_0xfd4f('0x21')](removeEntity(_0x115b2a,null))[_0xfd4f('0x3f')](handleError(_0x115b2a,null));};exports['describe']=function(_0x2b511c,_0x277b38){return db[_0xfd4f('0x3a')][_0xfd4f('0x46')]()['then'](respondWithResult(_0x277b38,null))[_0xfd4f('0x3f')](handleError(_0x277b38,null));}; \ No newline at end of file +var _0xf9f4=['destroy','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','update','then'];(function(_0x4ae496,_0x1d0ef7){var _0x376166=function(_0x559e1c){while(--_0x559e1c){_0x4ae496['push'](_0x4ae496['shift']());}};_0x376166(++_0x1d0ef7);}(_0xf9f4,0x134));var _0x4f9f=function(_0x2aada1,_0x5cc0b6){_0x2aada1=_0x2aada1-0x0;var _0x20f97f=_0xf9f4[_0x2aada1];return _0x20f97f;};'use strict';var emlformat=require(_0x4f9f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f9f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f9f('0x2'));var moment=require(_0x4f9f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f9f('0x4'));var sox=require(_0x4f9f('0x5'));var csv=require('to-csv');var ejs=require(_0x4f9f('0x6'));var fs=require('fs');var fs_extra=require(_0x4f9f('0x7'));var _=require(_0x4f9f('0x8'));var squel=require(_0x4f9f('0x9'));var crypto=require(_0x4f9f('0xa'));var jsforce=require(_0x4f9f('0xb'));var deskjs=require(_0x4f9f('0xc'));var toCsv=require(_0x4f9f('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f9f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f9f('0xf'));var logger=require('../../config/logger')(_0x4f9f('0x10'));var utils=require('../../config/utils');var config=require(_0x4f9f('0x11'));var licenseUtil=require(_0x4f9f('0x12'));var db=require(_0x4f9f('0x13'))['db'];function respondWithStatusCode(_0x1aafbe,_0xe4693){_0xe4693=_0xe4693||0xcc;return function(_0x73d887){if(_0x73d887){return _0x1aafbe['sendStatus'](_0xe4693);}return _0x1aafbe['status'](_0xe4693)[_0x4f9f('0x14')]();};}function respondWithResult(_0x35ac29,_0x210e65){_0x210e65=_0x210e65||0xc8;return function(_0x19dc40){if(_0x19dc40){return _0x35ac29['status'](_0x210e65)[_0x4f9f('0x15')](_0x19dc40);}};}function respondWithFilteredResult(_0x13d022,_0x139412){return function(_0x48779b){if(_0x48779b){var _0x3aae3c=typeof _0x139412['offset']===_0x4f9f('0x16')&&typeof _0x139412[_0x4f9f('0x17')]===_0x4f9f('0x16');var _0x4ad901=_0x48779b['count'];var _0x5617ab=_0x3aae3c?0x0:_0x139412[_0x4f9f('0x18')];var _0x4e941f=_0x3aae3c?_0x48779b[_0x4f9f('0x19')]:_0x139412['offset']+_0x139412[_0x4f9f('0x17')];var _0x4c2c1e;if(_0x4e941f>=_0x4ad901){_0x4e941f=_0x4ad901;_0x4c2c1e=0xc8;}else{_0x4c2c1e=0xce;}_0x13d022[_0x4f9f('0x1a')](_0x4c2c1e);return _0x13d022[_0x4f9f('0x1b')](_0x4f9f('0x1c'),_0x5617ab+'-'+_0x4e941f+'/'+_0x4ad901)['json'](_0x48779b);}return null;};}function patchUpdates(_0x278dc8){return function(_0x5048ac){try{jsonpatch['apply'](_0x5048ac,_0x278dc8,!![]);}catch(_0x2f85e6){return BPromise[_0x4f9f('0x1d')](_0x2f85e6);}return _0x5048ac['save']();};}function saveUpdates(_0x3dcb74,_0x311bdf){return function(_0x3e8ee0){if(_0x3e8ee0){return _0x3e8ee0[_0x4f9f('0x1e')](_0x3dcb74)[_0x4f9f('0x1f')](function(_0x3c99a1){return _0x3c99a1;});}return null;};}function removeEntity(_0x4fb2c6,_0x3afdec){return function(_0x170e65){if(_0x170e65){return _0x170e65[_0x4f9f('0x20')]()[_0x4f9f('0x1f')](function(){_0x4fb2c6['status'](0xcc)[_0x4f9f('0x14')]();});}};}function handleEntityNotFound(_0xa2900f,_0x3965a0){return function(_0x5310c4){if(!_0x5310c4){_0xa2900f[_0x4f9f('0x21')](0x194);}return _0x5310c4;};}function handleError(_0x180886,_0x51a761){_0x51a761=_0x51a761||0x1f4;return function(_0x38609a){logger['error'](_0x38609a[_0x4f9f('0x22')]);if(_0x38609a[_0x4f9f('0x23')]){delete _0x38609a['name'];}_0x180886[_0x4f9f('0x1a')](_0x51a761)[_0x4f9f('0x24')](_0x38609a);};}exports[_0x4f9f('0x25')]=function(_0x4280e0,_0x516a94){var _0x1bb8da={},_0x2155ac={},_0x17d99e={'count':0x0,'rows':[]};var _0x586613=_[_0x4f9f('0x26')](db[_0x4f9f('0x27')][_0x4f9f('0x28')],function(_0xccbdf7){return{'name':_0xccbdf7['fieldName'],'type':_0xccbdf7['type'][_0x4f9f('0x29')]};});_0x2155ac[_0x4f9f('0x2a')]=_[_0x4f9f('0x26')](_0x586613,'name');_0x2155ac['query']=_[_0x4f9f('0x2b')](_0x4280e0['query']);_0x2155ac['filters']=_['intersection'](_0x2155ac[_0x4f9f('0x2a')],_0x2155ac[_0x4f9f('0x2c')]);_0x1bb8da[_0x4f9f('0x2d')]=_[_0x4f9f('0x2e')](_0x2155ac['model'],qs[_0x4f9f('0x2f')](_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x2f')]));_0x1bb8da[_0x4f9f('0x2d')]=_0x1bb8da[_0x4f9f('0x2d')][_0x4f9f('0x30')]?_0x1bb8da[_0x4f9f('0x2d')]:_0x2155ac[_0x4f9f('0x2a')];if(!_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x31')](_0x4f9f('0x32'))){_0x1bb8da[_0x4f9f('0x17')]=qs[_0x4f9f('0x17')](_0x4280e0[_0x4f9f('0x2c')]['limit']);_0x1bb8da[_0x4f9f('0x18')]=qs[_0x4f9f('0x18')](_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x18')]);}_0x1bb8da['order']=qs[_0x4f9f('0x33')](_0x4280e0['query']['sort']);_0x1bb8da[_0x4f9f('0x34')]=qs['filters'](_['pick'](_0x4280e0['query'],_0x2155ac[_0x4f9f('0x35')]),_0x586613);if(_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x36')]){_0x1bb8da[_0x4f9f('0x34')]=_['merge'](_0x1bb8da[_0x4f9f('0x34')],{'$or':_[_0x4f9f('0x26')](_0x586613,function(_0x5d66dc){if(_0x5d66dc[_0x4f9f('0x37')]!==_0x4f9f('0x38')){var _0x34b106={};_0x34b106[_0x5d66dc['name']]={'$like':'%'+_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x36')]+'%'};return _0x34b106;}})});}_0x1bb8da=_[_0x4f9f('0x39')]({},_0x1bb8da,_0x4280e0[_0x4f9f('0x3a')]);var _0x953ee8={'where':_0x1bb8da[_0x4f9f('0x34')]};return db['SmsQueueReport'][_0x4f9f('0x19')](_0x953ee8)[_0x4f9f('0x1f')](function(_0x4138b1){_0x17d99e[_0x4f9f('0x19')]=_0x4138b1;if(_0x4280e0[_0x4f9f('0x2c')][_0x4f9f('0x3b')]){_0x1bb8da[_0x4f9f('0x3c')]=[{'all':!![]}];}return db[_0x4f9f('0x27')][_0x4f9f('0x3d')](_0x1bb8da);})[_0x4f9f('0x1f')](function(_0x28b40a){_0x17d99e['rows']=_0x28b40a;return _0x17d99e;})[_0x4f9f('0x1f')](respondWithFilteredResult(_0x516a94,_0x1bb8da))[_0x4f9f('0x3e')](handleError(_0x516a94,null));};exports['show']=function(_0x234a1e,_0x37f952){var _0x1d1fd1={'raw':!![],'where':{'id':_0x234a1e[_0x4f9f('0x3f')]['id']}},_0x85aafa={};_0x85aafa[_0x4f9f('0x2a')]=_[_0x4f9f('0x2b')](db['SmsQueueReport'][_0x4f9f('0x28')]);_0x85aafa[_0x4f9f('0x2c')]=_[_0x4f9f('0x2b')](_0x234a1e[_0x4f9f('0x2c')]);_0x85aafa[_0x4f9f('0x35')]=_[_0x4f9f('0x2e')](_0x85aafa[_0x4f9f('0x2a')],_0x85aafa[_0x4f9f('0x2c')]);_0x1d1fd1[_0x4f9f('0x2d')]=_[_0x4f9f('0x2e')](_0x85aafa[_0x4f9f('0x2a')],qs[_0x4f9f('0x2f')](_0x234a1e[_0x4f9f('0x2c')][_0x4f9f('0x2f')]));_0x1d1fd1[_0x4f9f('0x2d')]=_0x1d1fd1['attributes'][_0x4f9f('0x30')]?_0x1d1fd1[_0x4f9f('0x2d')]:_0x85aafa['model'];if(_0x234a1e[_0x4f9f('0x2c')][_0x4f9f('0x3b')]){_0x1d1fd1[_0x4f9f('0x3c')]=[{'all':!![]}];}_0x1d1fd1=_[_0x4f9f('0x39')]({},_0x1d1fd1,_0x234a1e[_0x4f9f('0x3a')]);return db[_0x4f9f('0x27')][_0x4f9f('0x40')](_0x1d1fd1)['then'](handleEntityNotFound(_0x37f952,null))[_0x4f9f('0x1f')](respondWithResult(_0x37f952,null))['catch'](handleError(_0x37f952,null));};exports['create']=function(_0x4ac270,_0x18f278){return db[_0x4f9f('0x27')][_0x4f9f('0x41')](_0x4ac270[_0x4f9f('0x42')],{})[_0x4f9f('0x1f')](respondWithResult(_0x18f278,0xc9))[_0x4f9f('0x3e')](handleError(_0x18f278,null));};exports[_0x4f9f('0x1e')]=function(_0x4f2d0d,_0x9d9d49){if(_0x4f2d0d[_0x4f9f('0x42')]['id']){delete _0x4f2d0d['body']['id'];}return db[_0x4f9f('0x27')]['find']({'where':{'id':_0x4f2d0d[_0x4f9f('0x3f')]['id']}})[_0x4f9f('0x1f')](handleEntityNotFound(_0x9d9d49,null))[_0x4f9f('0x1f')](saveUpdates(_0x4f2d0d[_0x4f9f('0x42')],null))[_0x4f9f('0x1f')](respondWithResult(_0x9d9d49,null))[_0x4f9f('0x3e')](handleError(_0x9d9d49,null));};exports[_0x4f9f('0x20')]=function(_0x22e1f7,_0x5e9732){return db[_0x4f9f('0x27')][_0x4f9f('0x40')]({'where':{'id':_0x22e1f7['params']['id']}})[_0x4f9f('0x1f')](handleEntityNotFound(_0x5e9732,null))['then'](removeEntity(_0x5e9732,null))[_0x4f9f('0x3e')](handleError(_0x5e9732,null));};exports[_0x4f9f('0x43')]=function(_0x4d9722,_0x15c4d4){return db[_0x4f9f('0x27')][_0x4f9f('0x43')]()[_0x4f9f('0x1f')](respondWithResult(_0x15c4d4,null))[_0x4f9f('0x3e')](handleError(_0x15c4d4,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1004de9..c509dd3 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(_0x19056c,_0x1f5dee){var _0x776130=function(_0x38bd15){while(--_0x38bd15){_0x19056c['push'](_0x19056c['shift']());}};_0x776130(++_0x1f5dee);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb7e7[_0x3ab9ee];return _0x82ee88;};'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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 80e3819..8639370 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 _0x28b5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsQueueReport','create','body','options','then','CreateSmsQueueReport','debug','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3d2b5c,_0x41ac4b){var _0x74ad64=function(_0xfa34a3){while(--_0xfa34a3){_0x3d2b5c['push'](_0x3d2b5c['shift']());}};_0x74ad64(++_0x41ac4b);}(_0x28b5,0xdb));var _0x528b=function(_0x4b8259,_0x1fd9a7){_0x4b8259=_0x4b8259-0x0;var _0x3bfa92=_0x28b5[_0x4b8259];return _0x3bfa92;};'use strict';var _=require(_0x528b('0x0'));var util=require(_0x528b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x528b('0x2'));var fs=require('fs');var Redis=require(_0x528b('0x3'));var db=require(_0x528b('0x4'))['db'];var utils=require(_0x528b('0x5'));var logger=require(_0x528b('0x6'))(_0x528b('0x7'));var config=require(_0x528b('0x8'));var jayson=require(_0x528b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a9a97,_0x47c1b6,_0x326b7f){return new BPromise(function(_0x1295a3,_0x1a24be){return client[_0x528b('0xa')](_0x2a9a97,_0x326b7f)['then'](function(_0x1e23cb){logger[_0x528b('0xb')](_0x528b('0xc'),_0x47c1b6,_0x528b('0xd'));logger['debug'](_0x528b('0xe'),_0x47c1b6,_0x528b('0xd'),JSON[_0x528b('0xf')](_0x1e23cb));if(_0x1e23cb[_0x528b('0x10')]){if(_0x1e23cb['error']['code']===0x1f4){logger['error'](_0x528b('0xc'),_0x47c1b6,_0x1e23cb[_0x528b('0x10')][_0x528b('0x11')]);return _0x1a24be(_0x1e23cb[_0x528b('0x10')]['message']);}logger[_0x528b('0x10')](_0x528b('0xc'),_0x47c1b6,_0x1e23cb[_0x528b('0x10')][_0x528b('0x11')]);return _0x1295a3(_0x1e23cb[_0x528b('0x10')][_0x528b('0x11')]);}else{logger[_0x528b('0xb')](_0x528b('0xc'),_0x47c1b6,_0x528b('0xd'));_0x1295a3(_0x1e23cb['result']['message']);}})[_0x528b('0x12')](function(_0x4937ac){logger[_0x528b('0x10')](_0x528b('0xc'),_0x47c1b6,_0x4937ac);_0x1a24be(_0x4937ac);});});}exports['CreateSmsQueueReport']=function(_0x38ad17){var _0x17b1e4=this;return new Promise(function(_0x2c4004,_0x5d3e75){return db[_0x528b('0x13')][_0x528b('0x14')](_0x38ad17[_0x528b('0x15')],{'raw':_0x38ad17[_0x528b('0x16')]?_0x38ad17[_0x528b('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x528b('0x17')](function(_0x14f51f){logger[_0x528b('0xb')](_0x528b('0x18'),_0x38ad17);logger[_0x528b('0x19')](_0x528b('0x18'),_0x38ad17,JSON[_0x528b('0xf')](_0x14f51f));_0x2c4004(_0x14f51f);})[_0x528b('0x12')](function(_0x54c73a){logger[_0x528b('0x10')](_0x528b('0x18'),_0x54c73a[_0x528b('0x11')],_0x38ad17);_0x5d3e75(_0x17b1e4['error'](0x1f4,_0x54c73a[_0x528b('0x11')]));});});};exports[_0x528b('0x1a')]=function(_0x3cc111){var _0x2ba39f=this;return new Promise(function(_0x40cd68,_0x4532d5){return db[_0x528b('0x13')][_0x528b('0x1b')](_0x3cc111[_0x528b('0x15')],{'raw':_0x3cc111[_0x528b('0x16')]?_0x3cc111[_0x528b('0x16')][_0x528b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cc111[_0x528b('0x16')]?_0x3cc111[_0x528b('0x16')][_0x528b('0x1d')]||null:null,'attributes':_0x3cc111['options']?_0x3cc111[_0x528b('0x16')][_0x528b('0x1e')]||null:null,'limit':_0x3cc111['options']?_0x3cc111[_0x528b('0x16')][_0x528b('0x1f')]||null:null})[_0x528b('0x17')](function(_0x37cdf6){logger[_0x528b('0xb')](_0x528b('0x1a'),_0x3cc111);logger[_0x528b('0x19')](_0x528b('0x1a'),_0x3cc111,JSON[_0x528b('0xf')](_0x37cdf6));_0x40cd68(_0x37cdf6);})['catch'](function(_0x1bb01b){logger[_0x528b('0x10')](_0x528b('0x1a'),_0x1bb01b[_0x528b('0x11')],_0x3cc111);_0x4532d5(_0x2ba39f['error'](0x1f4,_0x1bb01b[_0x528b('0x11')]));});});}; \ No newline at end of file +var _0x18da=['options','raw','then','CreateSmsQueueReport','catch','UpdateSmsQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','SmsQueueReport','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18da,0x69));var _0xa18d=function(_0x1e76ca,_0x44517c){_0x1e76ca=_0x1e76ca-0x0;var _0x548150=_0x18da[_0x1e76ca];return _0x548150;};'use strict';var _=require(_0xa18d('0x0'));var util=require(_0xa18d('0x1'));var moment=require(_0xa18d('0x2'));var BPromise=require(_0xa18d('0x3'));var rs=require(_0xa18d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa18d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa18d('0x6'))('rpc');var config=require(_0xa18d('0x7'));var jayson=require(_0xa18d('0x8'));var client=jayson[_0xa18d('0x9')][_0xa18d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422bf4,_0x4077f9,_0x24d596){return new BPromise(function(_0x113c87,_0xe7900b){return client[_0xa18d('0xb')](_0x422bf4,_0x24d596)['then'](function(_0x2eda5b){logger[_0xa18d('0xc')](_0xa18d('0xd'),_0x4077f9,_0xa18d('0xe'));logger[_0xa18d('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x4077f9,_0xa18d('0xe'),JSON[_0xa18d('0x10')](_0x2eda5b));if(_0x2eda5b['error']){if(_0x2eda5b[_0xa18d('0x11')][_0xa18d('0x12')]===0x1f4){logger[_0xa18d('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x4077f9,_0x2eda5b['error']['message']);return _0xe7900b(_0x2eda5b[_0xa18d('0x11')][_0xa18d('0x13')]);}logger[_0xa18d('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x4077f9,_0x2eda5b[_0xa18d('0x11')][_0xa18d('0x13')]);return _0x113c87(_0x2eda5b['error'][_0xa18d('0x13')]);}else{logger[_0xa18d('0xc')](_0xa18d('0xd'),_0x4077f9,_0xa18d('0xe'));_0x113c87(_0x2eda5b['result'][_0xa18d('0x13')]);}})['catch'](function(_0x278a65){logger[_0xa18d('0x11')](_0xa18d('0xd'),_0x4077f9,_0x278a65);_0xe7900b(_0x278a65);});});}exports['CreateSmsQueueReport']=function(_0x25fb31){var _0x5e7a50=this;return new Promise(function(_0x42f178,_0x4c24c9){return db[_0xa18d('0x14')][_0xa18d('0x15')](_0x25fb31[_0xa18d('0x16')],{'raw':_0x25fb31[_0xa18d('0x17')]?_0x25fb31[_0xa18d('0x17')][_0xa18d('0x18')]===undefined?!![]:![]:!![]})[_0xa18d('0x19')](function(_0x585976){logger[_0xa18d('0xc')](_0xa18d('0x1a'),_0x25fb31);logger[_0xa18d('0xf')](_0xa18d('0x1a'),_0x25fb31,JSON[_0xa18d('0x10')](_0x585976));_0x42f178(_0x585976);})[_0xa18d('0x1b')](function(_0x4933b3){logger[_0xa18d('0x11')](_0xa18d('0x1a'),_0x4933b3['message'],_0x25fb31);_0x4c24c9(_0x5e7a50[_0xa18d('0x11')](0x1f4,_0x4933b3[_0xa18d('0x13')]));});});};exports[_0xa18d('0x1c')]=function(_0x4130b1){var _0x2c2e41=this;return new Promise(function(_0x364b51,_0x245522){return db[_0xa18d('0x14')][_0xa18d('0x1d')](_0x4130b1[_0xa18d('0x16')],{'raw':_0x4130b1[_0xa18d('0x17')]?_0x4130b1[_0xa18d('0x17')][_0xa18d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4130b1['options']?_0x4130b1[_0xa18d('0x17')][_0xa18d('0x1e')]||null:null,'attributes':_0x4130b1[_0xa18d('0x17')]?_0x4130b1['options']['attributes']||null:null,'limit':_0x4130b1[_0xa18d('0x17')]?_0x4130b1[_0xa18d('0x17')][_0xa18d('0x1f')]||null:null})[_0xa18d('0x19')](function(_0x35140){logger[_0xa18d('0xc')](_0xa18d('0x1c'),_0x4130b1);logger['debug'](_0xa18d('0x1c'),_0x4130b1,JSON[_0xa18d('0x10')](_0x35140));_0x364b51(_0x35140);})['catch'](function(_0x5872ab){logger[_0xa18d('0x11')](_0xa18d('0x1c'),_0x5872ab[_0xa18d('0x13')],_0x4130b1);_0x245522(_0x2c2e41[_0xa18d('0x11')](0x1f4,_0x5872ab['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9c4610b..9aeed7b 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 _0xe015=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','describe','get','/:id','show','put','update','multer','util','path','Router','../../components/auth/service'];(function(_0x940fe0,_0x2b2ebe){var _0x48f3de=function(_0x446cc3){while(--_0x446cc3){_0x940fe0['push'](_0x940fe0['shift']());}};_0x48f3de(++_0x2b2ebe);}(_0xe015,0x13b));var _0x5e01=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe015[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['post']('/',auth[_0x5e01('0x8')](),controller['create']);router[_0x5e01('0xe')]('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xf')]);router['delete'](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x303a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','multer','path'];(function(_0x8e3421,_0x173641){var _0x1a2e41=function(_0x19dc4a){while(--_0x19dc4a){_0x8e3421['push'](_0x8e3421['shift']());}};_0x1a2e41(++_0x173641);}(_0x303a,0x1a0));var _0xa303=function(_0x305551,_0x868339){_0x305551=_0x305551-0x0;var _0x115ce2=_0x303a[_0x305551];return _0x115ce2;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller['show']);router[_0xa303('0xe')]('/',auth['isAuthenticated'](),controller[_0xa303('0xf')]);router['put'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller[_0xa303('0x10')]);router[_0xa303('0x11')]('/:id',auth[_0xa303('0xa')](),controller['destroy']);module[_0xa303('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a3f8af2..53b5efc 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4c8884,_0x248d8f){var _0x326b7d=function(_0x2dae5e){while(--_0x2dae5e){_0x4c8884['push'](_0x4c8884['shift']());}};_0x326b7d(++_0x248d8f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x4b84[_0x338f73];return _0x163fdf;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xb59a47,_0x3702d1){var _0x5057d4=function(_0x331521){while(--_0x331521){_0xb59a47['push'](_0xb59a47['shift']());}};_0x5057d4(++_0x3702d1);}(_0x00bb,0x1d8));var _0xb00b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x00bb[_0x33032e];return _0x13316b;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 52b4470..e530dfe 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 _0x9240=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0xc3398e,_0x49cbbc){var _0x2c64e6=function(_0x41e3b1){while(--_0x41e3b1){_0xc3398e['push'](_0xc3398e['shift']());}};_0x2c64e6(++_0x49cbbc);}(_0x9240,0x169));var _0x0924=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9240[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0924('0x0'));var rimraf=require(_0x0924('0x1'));var zipdir=require(_0x0924('0x2'));var jsonpatch=require(_0x0924('0x3'));var rp=require(_0x0924('0x4'));var moment=require(_0x0924('0x5'));var BPromise=require(_0x0924('0x6'));var Mustache=require('mustache');var util=require(_0x0924('0x7'));var path=require(_0x0924('0x8'));var sox=require(_0x0924('0x9'));var csv=require(_0x0924('0xa'));var ejs=require(_0x0924('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0924('0xc'));var squel=require(_0x0924('0xd'));var crypto=require(_0x0924('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0924('0xf'));var toCsv=require(_0x0924('0xa'));var querystring=require(_0x0924('0x10'));var Papa=require(_0x0924('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0924('0x12'));var as=require(_0x0924('0x13'));var hardwareService=require(_0x0924('0x14'));var logger=require(_0x0924('0x15'))(_0x0924('0x16'));var utils=require(_0x0924('0x17'));var config=require(_0x0924('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0924('0x19'))['db'];function respondWithStatusCode(_0x1549d4,_0xa67b95){_0xa67b95=_0xa67b95||0xcc;return function(_0x1d47d0){if(_0x1d47d0){return _0x1549d4['sendStatus'](_0xa67b95);}return _0x1549d4[_0x0924('0x1a')](_0xa67b95)['end']();};}function respondWithResult(_0x49407d,_0x2f0331){_0x2f0331=_0x2f0331||0xc8;return function(_0x1868e3){if(_0x1868e3){return _0x49407d[_0x0924('0x1a')](_0x2f0331)[_0x0924('0x1b')](_0x1868e3);}};}function respondWithFilteredResult(_0x55b16c,_0x18cda0){return function(_0x997e31){if(_0x997e31){var _0x496c06=typeof _0x18cda0['offset']===_0x0924('0x1c')&&typeof _0x18cda0['limit']===_0x0924('0x1c');var _0x8a422f=_0x997e31[_0x0924('0x1d')];var _0x1356ea=_0x496c06?0x0:_0x18cda0['offset'];var _0x49f75e=_0x496c06?_0x997e31['count']:_0x18cda0[_0x0924('0x1e')]+_0x18cda0[_0x0924('0x1f')];var _0x270e77;if(_0x49f75e>=_0x8a422f){_0x49f75e=_0x8a422f;_0x270e77=0xc8;}else{_0x270e77=0xce;}_0x55b16c[_0x0924('0x1a')](_0x270e77);return _0x55b16c[_0x0924('0x20')](_0x0924('0x21'),_0x1356ea+'-'+_0x49f75e+'/'+_0x8a422f)[_0x0924('0x1b')](_0x997e31);}return null;};}function patchUpdates(_0x1111f1){return function(_0x54d7fb){try{jsonpatch['apply'](_0x54d7fb,_0x1111f1,!![]);}catch(_0x3bd4c4){return BPromise[_0x0924('0x22')](_0x3bd4c4);}return _0x54d7fb[_0x0924('0x23')]();};}function saveUpdates(_0x1649ee,_0x218ba7){return function(_0x5a505e){if(_0x5a505e){return _0x5a505e[_0x0924('0x24')](_0x1649ee)[_0x0924('0x25')](function(_0x25df23){return _0x25df23;});}return null;};}function removeEntity(_0x164b09,_0x2e3ba0){return function(_0xd1a2da){if(_0xd1a2da){return _0xd1a2da[_0x0924('0x26')]()[_0x0924('0x25')](function(){_0x164b09[_0x0924('0x1a')](0xcc)[_0x0924('0x27')]();});}};}function handleEntityNotFound(_0x192d8a,_0x395ca2){return function(_0x50f691){if(!_0x50f691){_0x192d8a['sendStatus'](0x194);}return _0x50f691;};}function handleError(_0x5f0efe,_0x2635b0){_0x2635b0=_0x2635b0||0x1f4;return function(_0x3efc39){logger[_0x0924('0x28')](_0x3efc39[_0x0924('0x29')]);if(_0x3efc39[_0x0924('0x2a')]){delete _0x3efc39[_0x0924('0x2a')];}_0x5f0efe['status'](_0x2635b0)[_0x0924('0x2b')](_0x3efc39);};}exports[_0x0924('0x2c')]=function(_0x164c5a,_0x2bd16a){var _0x1f1756={},_0x52672a={},_0x2d2e9a={'count':0x0,'rows':[]};var _0xc16bdf=_[_0x0924('0x2d')](db[_0x0924('0x2e')][_0x0924('0x2f')],function(_0x270613){return{'name':_0x270613['fieldName'],'type':_0x270613[_0x0924('0x30')][_0x0924('0x31')]};});_0x52672a['model']=_[_0x0924('0x2d')](_0xc16bdf,_0x0924('0x2a'));_0x52672a[_0x0924('0x32')]=_[_0x0924('0x33')](_0x164c5a[_0x0924('0x32')]);_0x52672a['filters']=_[_0x0924('0x34')](_0x52672a[_0x0924('0x35')],_0x52672a[_0x0924('0x32')]);_0x1f1756[_0x0924('0x36')]=_[_0x0924('0x34')](_0x52672a['model'],qs['fields'](_0x164c5a[_0x0924('0x32')][_0x0924('0x37')]));_0x1f1756['attributes']=_0x1f1756[_0x0924('0x36')][_0x0924('0x38')]?_0x1f1756[_0x0924('0x36')]:_0x52672a[_0x0924('0x35')];if(!_0x164c5a['query'][_0x0924('0x39')](_0x0924('0x3a'))){_0x1f1756[_0x0924('0x1f')]=qs[_0x0924('0x1f')](_0x164c5a['query']['limit']);_0x1f1756[_0x0924('0x1e')]=qs['offset'](_0x164c5a['query'][_0x0924('0x1e')]);}_0x1f1756[_0x0924('0x3b')]=qs['sort'](_0x164c5a[_0x0924('0x32')]['sort']);_0x1f1756[_0x0924('0x3c')]=qs['filters'](_[_0x0924('0x3d')](_0x164c5a['query'],_0x52672a[_0x0924('0x3e')]),_0xc16bdf);if(_0x164c5a[_0x0924('0x32')][_0x0924('0x3f')]){_0x1f1756[_0x0924('0x3c')]=_[_0x0924('0x40')](_0x1f1756[_0x0924('0x3c')],{'$or':_[_0x0924('0x2d')](_0xc16bdf,function(_0x458f45){if(_0x458f45[_0x0924('0x30')]!==_0x0924('0x41')){var _0x4589c1={};_0x4589c1[_0x458f45['name']]={'$like':'%'+_0x164c5a[_0x0924('0x32')][_0x0924('0x3f')]+'%'};return _0x4589c1;}})});}_0x1f1756=_[_0x0924('0x40')]({},_0x1f1756,_0x164c5a['options']);var _0x4340e9={'where':_0x1f1756[_0x0924('0x3c')]};return db['SmsTransferReport'][_0x0924('0x1d')](_0x4340e9)['then'](function(_0x536a5a){_0x2d2e9a[_0x0924('0x1d')]=_0x536a5a;if(_0x164c5a[_0x0924('0x32')][_0x0924('0x42')]){_0x1f1756[_0x0924('0x43')]=[{'all':!![]}];}return db[_0x0924('0x2e')]['findAll'](_0x1f1756);})[_0x0924('0x25')](function(_0x2d77f0){_0x2d2e9a['rows']=_0x2d77f0;return _0x2d2e9a;})['then'](respondWithFilteredResult(_0x2bd16a,_0x1f1756))['catch'](handleError(_0x2bd16a,null));};exports[_0x0924('0x44')]=function(_0x18b3ce,_0x2f0eb1){var _0x35d11f={'raw':!![],'where':{'id':_0x18b3ce[_0x0924('0x45')]['id']}},_0x1f4634={};_0x1f4634[_0x0924('0x35')]=_[_0x0924('0x33')](db[_0x0924('0x2e')]['rawAttributes']);_0x1f4634[_0x0924('0x32')]=_[_0x0924('0x33')](_0x18b3ce[_0x0924('0x32')]);_0x1f4634['filters']=_[_0x0924('0x34')](_0x1f4634[_0x0924('0x35')],_0x1f4634['query']);_0x35d11f[_0x0924('0x36')]=_[_0x0924('0x34')](_0x1f4634[_0x0924('0x35')],qs[_0x0924('0x37')](_0x18b3ce[_0x0924('0x32')][_0x0924('0x37')]));_0x35d11f[_0x0924('0x36')]=_0x35d11f[_0x0924('0x36')][_0x0924('0x38')]?_0x35d11f[_0x0924('0x36')]:_0x1f4634[_0x0924('0x35')];if(_0x18b3ce[_0x0924('0x32')]['includeAll']){_0x35d11f[_0x0924('0x43')]=[{'all':!![]}];}_0x35d11f=_['merge']({},_0x35d11f,_0x18b3ce[_0x0924('0x46')]);return db['SmsTransferReport'][_0x0924('0x47')](_0x35d11f)[_0x0924('0x25')](handleEntityNotFound(_0x2f0eb1,null))['then'](respondWithResult(_0x2f0eb1,null))[_0x0924('0x48')](handleError(_0x2f0eb1,null));};exports[_0x0924('0x49')]=function(_0x503b24,_0x33abce){return db[_0x0924('0x2e')][_0x0924('0x49')](_0x503b24[_0x0924('0x4a')],{})[_0x0924('0x25')](respondWithResult(_0x33abce,0xc9))['catch'](handleError(_0x33abce,null));};exports['update']=function(_0x39303f,_0x42cfce){if(_0x39303f[_0x0924('0x4a')]['id']){delete _0x39303f[_0x0924('0x4a')]['id'];}return db['SmsTransferReport'][_0x0924('0x47')]({'where':{'id':_0x39303f[_0x0924('0x45')]['id']}})[_0x0924('0x25')](handleEntityNotFound(_0x42cfce,null))[_0x0924('0x25')](saveUpdates(_0x39303f[_0x0924('0x4a')],null))['then'](respondWithResult(_0x42cfce,null))['catch'](handleError(_0x42cfce,null));};exports['destroy']=function(_0x5460c2,_0x4cad2b){return db[_0x0924('0x2e')][_0x0924('0x47')]({'where':{'id':_0x5460c2[_0x0924('0x45')]['id']}})[_0x0924('0x25')](handleEntityNotFound(_0x4cad2b,null))[_0x0924('0x25')](removeEntity(_0x4cad2b,null))[_0x0924('0x48')](handleError(_0x4cad2b,null));};exports[_0x0924('0x4b')]=function(_0x147640,_0xeb0f93){return db[_0x0924('0x2e')][_0x0924('0x4b')]()[_0x0924('0x25')](respondWithResult(_0xeb0f93,null))[_0x0924('0x48')](handleError(_0xeb0f93,null));}; \ No newline at end of file +var _0xb58a=['includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','options','include','findAll','rows','show','params'];(function(_0x755c19,_0x1bc8f1){var _0x5d2899=function(_0x115d53){while(--_0x115d53){_0x755c19['push'](_0x755c19['shift']());}};_0x5d2899(++_0x1bc8f1);}(_0xb58a,0xe1));var _0xab58=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0xb58a[_0x263a2f];return _0x8020e8;};'use strict';var emlformat=require(_0xab58('0x0'));var rimraf=require(_0xab58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab58('0x2'));var rp=require('request-promise');var moment=require(_0xab58('0x3'));var BPromise=require(_0xab58('0x4'));var Mustache=require(_0xab58('0x5'));var util=require(_0xab58('0x6'));var path=require(_0xab58('0x7'));var sox=require(_0xab58('0x8'));var csv=require(_0xab58('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab58('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xab58('0xb'));var jsforce=require(_0xab58('0xc'));var deskjs=require(_0xab58('0xd'));var toCsv=require(_0xab58('0x9'));var querystring=require(_0xab58('0xe'));var Papa=require(_0xab58('0xf'));var Redis=require(_0xab58('0x10'));var authService=require(_0xab58('0x11'));var qs=require(_0xab58('0x12'));var as=require(_0xab58('0x13'));var hardwareService=require(_0xab58('0x14'));var logger=require(_0xab58('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xab58('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e5d27,_0x157292){_0x157292=_0x157292||0xcc;return function(_0x2654cf){if(_0x2654cf){return _0x4e5d27[_0xab58('0x17')](_0x157292);}return _0x4e5d27[_0xab58('0x18')](_0x157292)[_0xab58('0x19')]();};}function respondWithResult(_0x219bc4,_0x4839d6){_0x4839d6=_0x4839d6||0xc8;return function(_0x4a21a0){if(_0x4a21a0){return _0x219bc4[_0xab58('0x18')](_0x4839d6)[_0xab58('0x1a')](_0x4a21a0);}};}function respondWithFilteredResult(_0x414c39,_0x54dd5a){return function(_0x10b9b2){if(_0x10b9b2){var _0x33a249=typeof _0x54dd5a[_0xab58('0x1b')]===_0xab58('0x1c')&&typeof _0x54dd5a[_0xab58('0x1d')]===_0xab58('0x1c');var _0x29270d=_0x10b9b2[_0xab58('0x1e')];var _0x4ad94d=_0x33a249?0x0:_0x54dd5a[_0xab58('0x1b')];var _0xd0ffc6=_0x33a249?_0x10b9b2[_0xab58('0x1e')]:_0x54dd5a[_0xab58('0x1b')]+_0x54dd5a[_0xab58('0x1d')];var _0x2a8234;if(_0xd0ffc6>=_0x29270d){_0xd0ffc6=_0x29270d;_0x2a8234=0xc8;}else{_0x2a8234=0xce;}_0x414c39[_0xab58('0x18')](_0x2a8234);return _0x414c39['set']('Content-Range',_0x4ad94d+'-'+_0xd0ffc6+'/'+_0x29270d)[_0xab58('0x1a')](_0x10b9b2);}return null;};}function patchUpdates(_0x574774){return function(_0x23876e){try{jsonpatch[_0xab58('0x1f')](_0x23876e,_0x574774,!![]);}catch(_0x400571){return BPromise[_0xab58('0x20')](_0x400571);}return _0x23876e[_0xab58('0x21')]();};}function saveUpdates(_0x69a8eb,_0x1599d8){return function(_0x468b82){if(_0x468b82){return _0x468b82[_0xab58('0x22')](_0x69a8eb)[_0xab58('0x23')](function(_0x14321d){return _0x14321d;});}return null;};}function removeEntity(_0x20d12a,_0x5f21c5){return function(_0x19b0f2){if(_0x19b0f2){return _0x19b0f2[_0xab58('0x24')]()[_0xab58('0x23')](function(){_0x20d12a[_0xab58('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acdde,_0x30ecd2){return function(_0x4ceedb){if(!_0x4ceedb){_0x5acdde[_0xab58('0x17')](0x194);}return _0x4ceedb;};}function handleError(_0x5bd7e4,_0x70ac4a){_0x70ac4a=_0x70ac4a||0x1f4;return function(_0x52ab91){logger[_0xab58('0x25')](_0x52ab91[_0xab58('0x26')]);if(_0x52ab91[_0xab58('0x27')]){delete _0x52ab91['name'];}_0x5bd7e4[_0xab58('0x18')](_0x70ac4a)[_0xab58('0x28')](_0x52ab91);};}exports[_0xab58('0x29')]=function(_0x46db3a,_0x2d6a67){var _0x2d119c={},_0x1fe35e={},_0xec95f7={'count':0x0,'rows':[]};var _0x53067b=_['map'](db[_0xab58('0x2a')][_0xab58('0x2b')],function(_0x494887){return{'name':_0x494887['fieldName'],'type':_0x494887['type'][_0xab58('0x2c')]};});_0x1fe35e[_0xab58('0x2d')]=_[_0xab58('0x2e')](_0x53067b,_0xab58('0x27'));_0x1fe35e[_0xab58('0x2f')]=_[_0xab58('0x30')](_0x46db3a[_0xab58('0x2f')]);_0x1fe35e[_0xab58('0x31')]=_[_0xab58('0x32')](_0x1fe35e[_0xab58('0x2d')],_0x1fe35e[_0xab58('0x2f')]);_0x2d119c[_0xab58('0x33')]=_['intersection'](_0x1fe35e['model'],qs['fields'](_0x46db3a[_0xab58('0x2f')][_0xab58('0x34')]));_0x2d119c[_0xab58('0x33')]=_0x2d119c[_0xab58('0x33')][_0xab58('0x35')]?_0x2d119c[_0xab58('0x33')]:_0x1fe35e[_0xab58('0x2d')];if(!_0x46db3a[_0xab58('0x2f')][_0xab58('0x36')](_0xab58('0x37'))){_0x2d119c['limit']=qs[_0xab58('0x1d')](_0x46db3a[_0xab58('0x2f')][_0xab58('0x1d')]);_0x2d119c[_0xab58('0x1b')]=qs[_0xab58('0x1b')](_0x46db3a[_0xab58('0x2f')]['offset']);}_0x2d119c['order']=qs[_0xab58('0x38')](_0x46db3a['query'][_0xab58('0x38')]);_0x2d119c[_0xab58('0x39')]=qs[_0xab58('0x31')](_['pick'](_0x46db3a['query'],_0x1fe35e[_0xab58('0x31')]),_0x53067b);if(_0x46db3a[_0xab58('0x2f')][_0xab58('0x3a')]){_0x2d119c['where']=_['merge'](_0x2d119c[_0xab58('0x39')],{'$or':_[_0xab58('0x2e')](_0x53067b,function(_0x3f2c15){if(_0x3f2c15[_0xab58('0x3b')]!==_0xab58('0x3c')){var _0x1ac87e={};_0x1ac87e[_0x3f2c15[_0xab58('0x27')]]={'$like':'%'+_0x46db3a[_0xab58('0x2f')][_0xab58('0x3a')]+'%'};return _0x1ac87e;}})});}_0x2d119c=_['merge']({},_0x2d119c,_0x46db3a[_0xab58('0x3d')]);var _0x28140f={'where':_0x2d119c[_0xab58('0x39')]};return db[_0xab58('0x2a')][_0xab58('0x1e')](_0x28140f)[_0xab58('0x23')](function(_0x279aa0){_0xec95f7[_0xab58('0x1e')]=_0x279aa0;if(_0x46db3a[_0xab58('0x2f')]['includeAll']){_0x2d119c[_0xab58('0x3e')]=[{'all':!![]}];}return db[_0xab58('0x2a')][_0xab58('0x3f')](_0x2d119c);})[_0xab58('0x23')](function(_0x13dc5e){_0xec95f7[_0xab58('0x40')]=_0x13dc5e;return _0xec95f7;})[_0xab58('0x23')](respondWithFilteredResult(_0x2d6a67,_0x2d119c))['catch'](handleError(_0x2d6a67,null));};exports[_0xab58('0x41')]=function(_0x3633a2,_0x42ffee){var _0x434ffc={'raw':!![],'where':{'id':_0x3633a2[_0xab58('0x42')]['id']}},_0x1a82b1={};_0x1a82b1[_0xab58('0x2d')]=_['keys'](db['SmsTransferReport'][_0xab58('0x2b')]);_0x1a82b1['query']=_['keys'](_0x3633a2[_0xab58('0x2f')]);_0x1a82b1[_0xab58('0x31')]=_[_0xab58('0x32')](_0x1a82b1[_0xab58('0x2d')],_0x1a82b1[_0xab58('0x2f')]);_0x434ffc['attributes']=_[_0xab58('0x32')](_0x1a82b1['model'],qs['fields'](_0x3633a2[_0xab58('0x2f')]['fields']));_0x434ffc[_0xab58('0x33')]=_0x434ffc[_0xab58('0x33')][_0xab58('0x35')]?_0x434ffc['attributes']:_0x1a82b1[_0xab58('0x2d')];if(_0x3633a2[_0xab58('0x2f')][_0xab58('0x43')]){_0x434ffc[_0xab58('0x3e')]=[{'all':!![]}];}_0x434ffc=_['merge']({},_0x434ffc,_0x3633a2[_0xab58('0x3d')]);return db['SmsTransferReport'][_0xab58('0x44')](_0x434ffc)[_0xab58('0x23')](handleEntityNotFound(_0x42ffee,null))['then'](respondWithResult(_0x42ffee,null))[_0xab58('0x45')](handleError(_0x42ffee,null));};exports['create']=function(_0x42fd38,_0x328e7e){return db[_0xab58('0x2a')][_0xab58('0x46')](_0x42fd38[_0xab58('0x47')],{})[_0xab58('0x23')](respondWithResult(_0x328e7e,0xc9))[_0xab58('0x45')](handleError(_0x328e7e,null));};exports['update']=function(_0x15c583,_0x354807){if(_0x15c583['body']['id']){delete _0x15c583[_0xab58('0x47')]['id'];}return db[_0xab58('0x2a')]['find']({'where':{'id':_0x15c583[_0xab58('0x42')]['id']}})[_0xab58('0x23')](handleEntityNotFound(_0x354807,null))[_0xab58('0x23')](saveUpdates(_0x15c583[_0xab58('0x47')],null))['then'](respondWithResult(_0x354807,null))[_0xab58('0x45')](handleError(_0x354807,null));};exports[_0xab58('0x24')]=function(_0x5b31a3,_0x48bc76){return db['SmsTransferReport'][_0xab58('0x44')]({'where':{'id':_0x5b31a3['params']['id']}})['then'](handleEntityNotFound(_0x48bc76,null))['then'](removeEntity(_0x48bc76,null))[_0xab58('0x45')](handleError(_0x48bc76,null));};exports[_0xab58('0x48')]=function(_0x285835,_0x4f5258){return db[_0xab58('0x2a')][_0xab58('0x48')]()[_0xab58('0x23')](respondWithResult(_0x4f5258,null))['catch'](handleError(_0x4f5258,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b3de603..a18276a 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 _0x5943=['request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x2ed6c5,_0x2312c5){var _0x6a89cc=function(_0xcd3161){while(--_0xcd3161){_0x2ed6c5['push'](_0x2ed6c5['shift']());}};_0x6a89cc(++_0x2312c5);}(_0x5943,0x168));var _0x3594=function(_0x464497,_0x1e7d08){_0x464497=_0x464497-0x0;var _0x25ec55=_0x5943[_0x464497];return _0x25ec55;};'use strict';var _=require(_0x3594('0x0'));var util=require(_0x3594('0x1'));var logger=require(_0x3594('0x2'))('api');var moment=require(_0x3594('0x3'));var BPromise=require('bluebird');var rp=require(_0x3594('0x4'));var fs=require('fs');var path=require(_0x3594('0x5'));var rimraf=require(_0x3594('0x6'));var config=require('../../config/environment');var attributes=require(_0x3594('0x7'));module[_0x3594('0x8')]=function(_0x1b099e,_0x114190){return _0x1b099e[_0x3594('0x9')](_0x3594('0xa'),attributes,{'tableName':_0x3594('0xb'),'paranoid':![],'indexes':[{'name':_0x3594('0xc'),'fields':[_0x3594('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x18b8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18b8,0xff));var _0x818b=function(_0x1f9bab,_0x260b86){_0x1f9bab=_0x1f9bab-0x0;var _0x2a3f0a=_0x18b8[_0x1f9bab];return _0x2a3f0a;};'use strict';var _=require(_0x818b('0x0'));var util=require(_0x818b('0x1'));var logger=require(_0x818b('0x2'))(_0x818b('0x3'));var moment=require(_0x818b('0x4'));var BPromise=require(_0x818b('0x5'));var rp=require(_0x818b('0x6'));var fs=require('fs');var path=require(_0x818b('0x7'));var rimraf=require(_0x818b('0x8'));var config=require(_0x818b('0x9'));var attributes=require('./smsTransferReport.attributes');module[_0x818b('0xa')]=function(_0x152a07,_0x653fd7){return _0x152a07[_0x818b('0xb')](_0x818b('0xc'),attributes,{'tableName':_0x818b('0xd'),'paranoid':![],'indexes':[{'name':_0x818b('0xe'),'fields':[_0x818b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 2f5d4fa..cf45773 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 _0x046b=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x1cd15c,_0x330636){var _0x432cd8=function(_0x327c8b){while(--_0x327c8b){_0x1cd15c['push'](_0x1cd15c['shift']());}};_0x432cd8(++_0x330636);}(_0x046b,0x147));var _0xb046=function(_0x14c00f,_0x11b192){_0x14c00f=_0x14c00f-0x0;var _0x19fbda=_0x046b[_0x14c00f];return _0x19fbda;};'use strict';var _=require('lodash');var util=require(_0xb046('0x0'));var moment=require(_0xb046('0x1'));var BPromise=require(_0xb046('0x2'));var rs=require(_0xb046('0x3'));var fs=require('fs');var Redis=require(_0xb046('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb046('0x5'));var logger=require(_0xb046('0x6'))(_0xb046('0x7'));var config=require(_0xb046('0x8'));var jayson=require(_0xb046('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13203d,_0x1f00c8,_0x190c9a){return new BPromise(function(_0x308e79,_0x3c0678){return client[_0xb046('0xa')](_0x13203d,_0x190c9a)[_0xb046('0xb')](function(_0x170b66){logger['info'](_0xb046('0xc'),_0x1f00c8,'request\x20sent');logger[_0xb046('0xd')](_0xb046('0xe'),_0x1f00c8,_0xb046('0xf'),JSON[_0xb046('0x10')](_0x170b66));if(_0x170b66[_0xb046('0x11')]){if(_0x170b66['error']['code']===0x1f4){logger['error'](_0xb046('0xc'),_0x1f00c8,_0x170b66[_0xb046('0x11')]['message']);return _0x3c0678(_0x170b66[_0xb046('0x11')]['message']);}logger[_0xb046('0x11')](_0xb046('0xc'),_0x1f00c8,_0x170b66['error'][_0xb046('0x12')]);return _0x308e79(_0x170b66[_0xb046('0x11')][_0xb046('0x12')]);}else{logger[_0xb046('0x13')](_0xb046('0xc'),_0x1f00c8,'request\x20sent');_0x308e79(_0x170b66[_0xb046('0x14')][_0xb046('0x12')]);}})[_0xb046('0x15')](function(_0xa3b910){logger[_0xb046('0x11')](_0xb046('0xc'),_0x1f00c8,_0xa3b910);_0x3c0678(_0xa3b910);});});} \ No newline at end of file +var _0x4016=['SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','../../mysqldb','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0xb93141,_0x8a422c){var _0x537afa=function(_0x492375){while(--_0x492375){_0xb93141['push'](_0xb93141['shift']());}};_0x537afa(++_0x8a422c);}(_0x4016,0x131));var _0x6401=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4016[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x6401('0x0'));var moment=require(_0x6401('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6401('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6401('0x3'))(_0x6401('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6401('0x5')][_0x6401('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b7cac,_0x3b989d,_0x56856a){return new BPromise(function(_0x1fbc01,_0x4cadcf){return client[_0x6401('0x7')](_0x5b7cac,_0x56856a)[_0x6401('0x8')](function(_0x39bf31){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x3b989d,_0x6401('0x9'));logger[_0x6401('0xa')](_0x6401('0xb'),_0x3b989d,'request\x20sent',JSON[_0x6401('0xc')](_0x39bf31));if(_0x39bf31['error']){if(_0x39bf31['error'][_0x6401('0xd')]===0x1f4){logger[_0x6401('0xe')](_0x6401('0xf'),_0x3b989d,_0x39bf31[_0x6401('0xe')][_0x6401('0x10')]);return _0x4cadcf(_0x39bf31[_0x6401('0xe')][_0x6401('0x10')]);}logger[_0x6401('0xe')](_0x6401('0xf'),_0x3b989d,_0x39bf31[_0x6401('0xe')][_0x6401('0x10')]);return _0x1fbc01(_0x39bf31[_0x6401('0xe')][_0x6401('0x10')]);}else{logger[_0x6401('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x3b989d,_0x6401('0x9'));_0x1fbc01(_0x39bf31[_0x6401('0x12')][_0x6401('0x10')]);}})[_0x6401('0x13')](function(_0x21b595){logger[_0x6401('0xe')](_0x6401('0xf'),_0x3b989d,_0x21b595);_0x4cadcf(_0x21b595);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f5dbe7e..831e07f 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 _0xb3a7=['replace','format','%s-%s%s','extname','now','single','create','put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','diskStorage','root','originalname'];(function(_0x5a1d42,_0x1580ad){var _0x195c1f=function(_0x3f8b0c){while(--_0x3f8b0c){_0x5a1d42['push'](_0x5a1d42['shift']());}};_0x195c1f(++_0x1580ad);}(_0xb3a7,0x194));var _0x7b3a=function(_0x597d4f,_0xf528e9){_0x597d4f=_0x597d4f-0x0;var _0x1e65c1=_0xb3a7[_0x597d4f];return _0x1e65c1;};'use strict';var multer=require(_0x7b3a('0x0'));var util=require(_0x7b3a('0x1'));var path=require('path');var timeout=require(_0x7b3a('0x2'));var express=require(_0x7b3a('0x3'));var router=express[_0x7b3a('0x4')]();var fs_extra=require(_0x7b3a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7b3a('0x6'));var config=require(_0x7b3a('0x7'));var controller=require(_0x7b3a('0x8'));router[_0x7b3a('0x9')]('/',auth[_0x7b3a('0xa')](),controller[_0x7b3a('0xb')]);router[_0x7b3a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7b3a('0xc')]);router[_0x7b3a('0x9')]('/:id/download',auth[_0x7b3a('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x7b3a('0xd')]({'destination':function(_0x3c607d,_0x42b5e7,_0x4d1cc5){_0x4d1cc5(null,path['join'](config[_0x7b3a('0xe')],'server/files/sounds/original/'));},'filename':function(_0x285ffe,_0x15316b,_0x30b940){_0x15316b[_0x7b3a('0xf')]=_0x15316b[_0x7b3a('0xf')][_0x7b3a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x30b940(null,util[_0x7b3a('0x11')](_0x7b3a('0x12'),path['basename'](_0x15316b[_0x7b3a('0xf')],path[_0x7b3a('0x13')](_0x15316b[_0x7b3a('0xf')])),Date[_0x7b3a('0x14')](),path['extname'](_0x15316b[_0x7b3a('0xf')])));}})});router['post']('/',upload[_0x7b3a('0x15')]('file'),controller[_0x7b3a('0x16')]);router[_0x7b3a('0x17')]('/:id',auth[_0x7b3a('0xa')](),controller[_0x7b3a('0x18')]);router[_0x7b3a('0x19')](_0x7b3a('0x1a'),auth[_0x7b3a('0xa')](),controller[_0x7b3a('0x19')]);module[_0x7b3a('0x1b')]=router; \ No newline at end of file +var _0x606e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','basename','extname','now','post','file','create','put','update','delete','exports'];(function(_0x33925b,_0x95cfc6){var _0x375e21=function(_0x57c759){while(--_0x57c759){_0x33925b['push'](_0x33925b['shift']());}};_0x375e21(++_0x95cfc6);}(_0x606e,0x195));var _0xe606=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x606e[_0xdeefbd];return _0x4ff63f;};'use strict';var multer=require('multer');var util=require(_0xe606('0x0'));var path=require('path');var timeout=require(_0xe606('0x1'));var express=require(_0xe606('0x2'));var router=express[_0xe606('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe606('0x4'));var interaction=require(_0xe606('0x5'));var config=require('../../config/environment');var controller=require(_0xe606('0x6'));router[_0xe606('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe606('0x7')](_0xe606('0x8'),auth[_0xe606('0x9')](),controller[_0xe606('0xa')]);router['get'](_0xe606('0xb'),auth['isAuthenticated'](),controller[_0xe606('0xc')]);var upload=multer({'storage':multer[_0xe606('0xd')]({'destination':function(_0x5b75d5,_0x466749,_0x27384c){_0x27384c(null,path[_0xe606('0xe')](config[_0xe606('0xf')],'server/files/sounds/original/'));},'filename':function(_0x13a4e1,_0x5e31e8,_0x462257){_0x5e31e8[_0xe606('0x10')]=_0x5e31e8[_0xe606('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x462257(null,util['format']('%s-%s%s',path[_0xe606('0x11')](_0x5e31e8[_0xe606('0x10')],path[_0xe606('0x12')](_0x5e31e8[_0xe606('0x10')])),Date[_0xe606('0x13')](),path[_0xe606('0x12')](_0x5e31e8[_0xe606('0x10')])));}})});router[_0xe606('0x14')]('/',upload['single'](_0xe606('0x15')),controller[_0xe606('0x16')]);router[_0xe606('0x17')]('/:id',auth[_0xe606('0x9')](),controller[_0xe606('0x18')]);router['delete'](_0xe606('0x8'),auth[_0xe606('0x9')](),controller[_0xe606('0x19')]);module[_0xe606('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3a01655..7bcd05d 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 _0x6fa6=['BIGINT','INTEGER','sequelize','exports','STRING','name','FLOAT'];(function(_0x5a2bba,_0x37074d){var _0x2badee=function(_0x3cc97e){while(--_0x3cc97e){_0x5a2bba['push'](_0x5a2bba['shift']());}};_0x2badee(++_0x37074d);}(_0x6fa6,0x191));var _0x66fa=function(_0x7f379b,_0x184b2d){_0x7f379b=_0x7f379b-0x0;var _0x196089=_0x6fa6[_0x7f379b];return _0x196089;};'use strict';var Sequelize=require(_0x66fa('0x0'));module[_0x66fa('0x1')]={'name':{'type':Sequelize[_0x66fa('0x2')],'unique':_0x66fa('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x66fa('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x66fa('0x2')]},'original_format':{'type':Sequelize[_0x66fa('0x2')]},'original_duration':{'type':Sequelize[_0x66fa('0x4')]},'original_sampleCount':{'type':Sequelize[_0x66fa('0x5')]},'original_channelCount':{'type':Sequelize[_0x66fa('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x66fa('0x6')]},'converted_format':{'type':Sequelize[_0x66fa('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x66fa('0x6')]},'converted_bitRate':{'type':Sequelize[_0x66fa('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x66fa('0x6')]}}; \ No newline at end of file +var _0x42fc=['sequelize','exports','STRING','BIGINT','INTEGER'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0x42fc,0x1ae));var _0xc42f=function(_0x461cc8,_0x2ea5e2){_0x461cc8=_0x461cc8-0x0;var _0x17afb1=_0x42fc[_0x461cc8];return _0x17afb1;};'use strict';var Sequelize=require(_0xc42f('0x0'));module[_0xc42f('0x1')]={'name':{'type':Sequelize[_0xc42f('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xc42f('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xc42f('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc42f('0x4')]},'converted_format':{'type':Sequelize[_0xc42f('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc42f('0x3')]},'converted_channelCount':{'type':Sequelize[_0xc42f('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc42f('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c447ae1..72a09af 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 _0x8cb6=['util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','Sounds','error','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','params','keys','Sound','include','options','find','existsSync','join','root','server/files/sounds/converted','save_name','format','%s.%s','converted_format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','src','original_duration','original_sampleCount','sampleCount','channelCount','bitRate','sampleRate','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','unlinkSync','rimraf','zip-dir','request-promise','bluebird'];(function(_0x4d367a,_0x1b2740){var _0x159841=function(_0x1e3d7b){while(--_0x1e3d7b){_0x4d367a['push'](_0x4d367a['shift']());}};_0x159841(++_0x1b2740);}(_0x8cb6,0xe6));var _0x68cb=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0x8cb6[_0x562ec5];return _0x279c8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68cb('0x0'));var zipdir=require(_0x68cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68cb('0x2'));var moment=require('moment');var BPromise=require(_0x68cb('0x3'));var Mustache=require('mustache');var util=require(_0x68cb('0x4'));var path=require('path');var sox=require(_0x68cb('0x5'));var csv=require(_0x68cb('0x6'));var ejs=require(_0x68cb('0x7'));var fs=require('fs');var fs_extra=require(_0x68cb('0x8'));var _=require('lodash');var squel=require(_0x68cb('0x9'));var crypto=require(_0x68cb('0xa'));var jsforce=require(_0x68cb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x68cb('0x6'));var querystring=require(_0x68cb('0xc'));var Papa=require(_0x68cb('0xd'));var Redis=require(_0x68cb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x68cb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68cb('0x10'));var logger=require(_0x68cb('0x11'))(_0x68cb('0x12'));var utils=require(_0x68cb('0x13'));var config=require(_0x68cb('0x14'));var licenseUtil=require(_0x68cb('0x15'));var db=require(_0x68cb('0x16'))['db'];function respondWithStatusCode(_0x304de7,_0x397f98){_0x397f98=_0x397f98||0xcc;return function(_0x244762){if(_0x244762){return _0x304de7[_0x68cb('0x17')](_0x397f98);}return _0x304de7[_0x68cb('0x18')](_0x397f98)[_0x68cb('0x19')]();};}function respondWithResult(_0x23f616,_0x499721){_0x499721=_0x499721||0xc8;return function(_0x3e35f0){if(_0x3e35f0){return _0x23f616[_0x68cb('0x18')](_0x499721)[_0x68cb('0x1a')](_0x3e35f0);}};}function respondWithFilteredResult(_0x467857,_0x5d0b92){return function(_0x1dd08f){if(_0x1dd08f){var _0x4f5fed=typeof _0x5d0b92['offset']===_0x68cb('0x1b')&&typeof _0x5d0b92[_0x68cb('0x1c')]==='undefined';var _0x3dac58=_0x1dd08f[_0x68cb('0x1d')];var _0x3b2532=_0x4f5fed?0x0:_0x5d0b92[_0x68cb('0x1e')];var _0x342f0c=_0x4f5fed?_0x1dd08f['count']:_0x5d0b92[_0x68cb('0x1e')]+_0x5d0b92[_0x68cb('0x1c')];var _0x5bcb8c;if(_0x342f0c>=_0x3dac58){_0x342f0c=_0x3dac58;_0x5bcb8c=0xc8;}else{_0x5bcb8c=0xce;}_0x467857[_0x68cb('0x18')](_0x5bcb8c);return _0x467857[_0x68cb('0x1f')]('Content-Range',_0x3b2532+'-'+_0x342f0c+'/'+_0x3dac58)['json'](_0x1dd08f);}return null;};}function patchUpdates(_0xdcf85a){return function(_0x4f77fe){try{jsonpatch['apply'](_0x4f77fe,_0xdcf85a,!![]);}catch(_0x257618){return BPromise[_0x68cb('0x20')](_0x257618);}return _0x4f77fe[_0x68cb('0x21')]();};}function saveUpdates(_0x461314,_0x541b24){return function(_0x36b892){if(_0x36b892){return _0x36b892[_0x68cb('0x22')](_0x461314)[_0x68cb('0x23')](function(_0x51fe18){return _0x51fe18;});}return null;};}function removeEntity(_0x5cee86,_0x38f076){return function(_0x16fad0){if(_0x16fad0){return _0x16fad0[_0x68cb('0x24')]()[_0x68cb('0x23')](function(){var _0x8fdfd3=_0x16fad0['get']({'plain':!![]});var _0x176203=_0x68cb('0x25');return db['UserProfileResource'][_0x68cb('0x24')]({'where':{'type':_0x176203,'resourceId':_0x8fdfd3['id']}})[_0x68cb('0x23')](function(){return _0x16fad0;});})['then'](function(){_0x5cee86['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42630d,_0x455330){return function(_0xcc8983){if(!_0xcc8983){_0x42630d[_0x68cb('0x17')](0x194);}return _0xcc8983;};}function handleError(_0x58eb1f,_0x4b18dd){_0x4b18dd=_0x4b18dd||0x1f4;return function(_0x5b4bac){logger[_0x68cb('0x26')](_0x5b4bac['stack']);if(_0x5b4bac[_0x68cb('0x27')]){delete _0x5b4bac[_0x68cb('0x27')];}_0x58eb1f[_0x68cb('0x18')](_0x4b18dd)[_0x68cb('0x28')](_0x5b4bac);};}exports[_0x68cb('0x29')]=function(_0x37eed7,_0x35329c){var _0x2d0b5b={},_0x44481d={},_0x32e216={'count':0x0,'rows':[]};var _0x313dc6=_['map'](db['Sound'][_0x68cb('0x2a')],function(_0x4ae5bb){return{'name':_0x4ae5bb[_0x68cb('0x2b')],'type':_0x4ae5bb[_0x68cb('0x2c')]['key']};});_0x44481d[_0x68cb('0x2d')]=_[_0x68cb('0x2e')](_0x313dc6,'name');_0x44481d[_0x68cb('0x2f')]=_['keys'](_0x37eed7[_0x68cb('0x2f')]);_0x44481d[_0x68cb('0x30')]=_[_0x68cb('0x31')](_0x44481d[_0x68cb('0x2d')],_0x44481d[_0x68cb('0x2f')]);_0x2d0b5b['attributes']=_['intersection'](_0x44481d[_0x68cb('0x2d')],qs['fields'](_0x37eed7[_0x68cb('0x2f')][_0x68cb('0x32')]));_0x2d0b5b[_0x68cb('0x33')]=_0x2d0b5b[_0x68cb('0x33')][_0x68cb('0x34')]?_0x2d0b5b[_0x68cb('0x33')]:_0x44481d[_0x68cb('0x2d')];if(!_0x37eed7['query'][_0x68cb('0x35')](_0x68cb('0x36'))){_0x2d0b5b[_0x68cb('0x1c')]=qs[_0x68cb('0x1c')](_0x37eed7[_0x68cb('0x2f')][_0x68cb('0x1c')]);_0x2d0b5b[_0x68cb('0x1e')]=qs['offset'](_0x37eed7[_0x68cb('0x2f')][_0x68cb('0x1e')]);}_0x2d0b5b[_0x68cb('0x37')]=qs['sort'](_0x37eed7[_0x68cb('0x2f')][_0x68cb('0x38')]);_0x2d0b5b[_0x68cb('0x39')]=qs['filters'](_[_0x68cb('0x3a')](_0x37eed7[_0x68cb('0x2f')],_0x44481d[_0x68cb('0x30')]),_0x313dc6);if(_0x37eed7['query'][_0x68cb('0x3b')]){_0x2d0b5b['where']=_['merge'](_0x2d0b5b[_0x68cb('0x39')],{'$or':_[_0x68cb('0x2e')](_0x313dc6,function(_0x3ca086){if(_0x3ca086[_0x68cb('0x2c')]!==_0x68cb('0x3c')){var _0x2ed8a4={};_0x2ed8a4[_0x3ca086[_0x68cb('0x27')]]={'$like':'%'+_0x37eed7['query'][_0x68cb('0x3b')]+'%'};return _0x2ed8a4;}})});}_0x2d0b5b=_[_0x68cb('0x3d')]({},_0x2d0b5b,_0x37eed7['options']);var _0xb5a29={'where':_0x2d0b5b[_0x68cb('0x39')]};return db['Sound'][_0x68cb('0x1d')](_0xb5a29)[_0x68cb('0x23')](function(_0x26717c){_0x32e216[_0x68cb('0x1d')]=_0x26717c;if(_0x37eed7[_0x68cb('0x2f')][_0x68cb('0x3e')]){_0x2d0b5b['include']=[{'all':!![]}];}return db['Sound']['findAll'](_0x2d0b5b);})[_0x68cb('0x23')](function(_0x14f5ec){_0x32e216[_0x68cb('0x3f')]=_0x14f5ec;return _0x32e216;})[_0x68cb('0x23')](respondWithFilteredResult(_0x35329c,_0x2d0b5b))[_0x68cb('0x40')](handleError(_0x35329c,null));};exports['show']=function(_0x2e1049,_0x153ebc){var _0x317067={'raw':!![],'where':{'id':_0x2e1049[_0x68cb('0x41')]['id']}},_0x2b5ac8={};_0x2b5ac8[_0x68cb('0x2d')]=_[_0x68cb('0x42')](db[_0x68cb('0x43')][_0x68cb('0x2a')]);_0x2b5ac8[_0x68cb('0x2f')]=_[_0x68cb('0x42')](_0x2e1049[_0x68cb('0x2f')]);_0x2b5ac8[_0x68cb('0x30')]=_['intersection'](_0x2b5ac8[_0x68cb('0x2d')],_0x2b5ac8[_0x68cb('0x2f')]);_0x317067[_0x68cb('0x33')]=_[_0x68cb('0x31')](_0x2b5ac8[_0x68cb('0x2d')],qs[_0x68cb('0x32')](_0x2e1049[_0x68cb('0x2f')]['fields']));_0x317067[_0x68cb('0x33')]=_0x317067[_0x68cb('0x33')][_0x68cb('0x34')]?_0x317067[_0x68cb('0x33')]:_0x2b5ac8['model'];if(_0x2e1049[_0x68cb('0x2f')][_0x68cb('0x3e')]){_0x317067[_0x68cb('0x44')]=[{'all':!![]}];}_0x317067=_[_0x68cb('0x3d')]({},_0x317067,_0x2e1049[_0x68cb('0x45')]);return db['Sound'][_0x68cb('0x46')](_0x317067)[_0x68cb('0x23')](handleEntityNotFound(_0x153ebc,null))['then'](respondWithResult(_0x153ebc,null))[_0x68cb('0x40')](handleError(_0x153ebc,null));};exports['download']=function(_0xf94a0b,_0x19f5f3,_0x332970){return db[_0x68cb('0x43')][_0x68cb('0x46')]({'where':{'id':_0xf94a0b['params']['id']},'attributes':[_0x68cb('0x27'),'save_name','converted_format'],'raw':!![]})[_0x68cb('0x23')](handleEntityNotFound(_0x19f5f3,null))[_0x68cb('0x23')](function(_0x3d9157){if(_0x3d9157){if(!fs[_0x68cb('0x47')](path[_0x68cb('0x48')](config[_0x68cb('0x49')],_0x68cb('0x4a'),_0x3d9157[_0x68cb('0x4b')]+'.'+_0x3d9157['converted_format']))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x19f5f3['download'](path[_0x68cb('0x48')](config[_0x68cb('0x49')],_0x68cb('0x4a'),util[_0x68cb('0x4c')](_0x68cb('0x4d'),_0x3d9157[_0x68cb('0x4b')],_0x3d9157[_0x68cb('0x4e')])),util['format'](_0x68cb('0x4d'),_0x3d9157['name'],_0x3d9157[_0x68cb('0x4e')]));}return null;})[_0x68cb('0x40')](handleError(_0x19f5f3,null));};exports[_0x68cb('0x4f')]=function(_0x3b665e,_0x3ca1b8,_0x1a4b51){var _0x3f7fbd={'name':path[_0x68cb('0x50')](_0x3b665e[_0x68cb('0x51')][_0x68cb('0x52')],path[_0x68cb('0x53')](_0x3b665e[_0x68cb('0x51')]['originalname'])),'save_name':path[_0x68cb('0x50')](_0x3b665e[_0x68cb('0x51')]['filename'],path[_0x68cb('0x53')](_0x3b665e['file'][_0x68cb('0x54')])),'original_format':path[_0x68cb('0x53')](_0x3b665e[_0x68cb('0x51')]['originalname'])[_0x68cb('0x55')](0x1),'converted_format':_0x68cb('0x56')};var _0x1e71b1=path['join'](config['root'],_0x68cb('0x57'),_0x3b665e[_0x68cb('0x51')][_0x68cb('0x54')]);var _0x423e83=path[_0x68cb('0x48')](config[_0x68cb('0x49')],'server/files/sounds/converted',util[_0x68cb('0x4c')](_0x68cb('0x4d'),path[_0x68cb('0x50')](_0x3b665e[_0x68cb('0x51')][_0x68cb('0x54')],path[_0x68cb('0x53')](_0x3b665e['file'][_0x68cb('0x54')])),_0x3f7fbd[_0x68cb('0x4e')]));logger[_0x68cb('0x58')](_0x68cb('0x59'),_0x1e71b1);logger['info'](_0x68cb('0x5a'),_0x423e83);try{fs['chmodSync'](_0x1e71b1,parseInt('0777',0x8));var _0x1c8dd5=sox[_0x68cb('0x5b')](_0x1e71b1,_0x423e83,{'sampleRate':0x1f40,'format':_0x68cb('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1c8dd5['on']('error',function(_0x5633b2){fs['unlinkSync'](_0x1e71b1);_0x3ca1b8[_0x68cb('0x18')](0x1f4)[_0x68cb('0x28')](_0x5633b2);});_0x1c8dd5['on'](_0x68cb('0x5c'),function(_0x15d509){_0x3f7fbd[_0x68cb('0x5d')]=isNaN(_0x15d509['duration'])?null:_0x15d509['duration']*0x3e8;_0x3f7fbd[_0x68cb('0x5e')]=isNaN(_0x15d509[_0x68cb('0x5f')])?null:_0x15d509[_0x68cb('0x5f')];_0x3f7fbd['original_channelCount']=isNaN(_0x15d509[_0x68cb('0x60')])?null:_0x15d509[_0x68cb('0x60')];_0x3f7fbd['original_bitRate']=isNaN(_0x15d509[_0x68cb('0x61')])?null:_0x15d509[_0x68cb('0x61')];_0x3f7fbd['original_sampleRate']=isNaN(_0x15d509[_0x68cb('0x62')])?null:_0x15d509[_0x68cb('0x62')];});_0x1c8dd5['on']('dest',function(_0x69cf9f){_0x3f7fbd[_0x68cb('0x63')]=isNaN(_0x69cf9f[_0x68cb('0x64')])?null:_0x69cf9f['duration']*0x3e8;_0x3f7fbd[_0x68cb('0x65')]=isNaN(_0x69cf9f[_0x68cb('0x5f')])?null:_0x69cf9f[_0x68cb('0x5f')];_0x3f7fbd[_0x68cb('0x66')]=isNaN(_0x69cf9f[_0x68cb('0x60')])?null:_0x69cf9f[_0x68cb('0x60')];_0x3f7fbd['converted_bitRate']=isNaN(_0x69cf9f[_0x68cb('0x61')])?null:_0x69cf9f[_0x68cb('0x61')];_0x3f7fbd[_0x68cb('0x67')]=isNaN(_0x69cf9f['sampleRate'])?null:_0x69cf9f[_0x68cb('0x62')];});_0x1c8dd5['on'](_0x68cb('0x19'),function(){fs['chmodSync'](_0x423e83,parseInt(_0x68cb('0x68'),0x8));return db['Sound'][_0x68cb('0x4f')](_0x3f7fbd)[_0x68cb('0x23')](function(_0x11fbc0){var _0x40ba3e={'role':_0x3b665e[_0x68cb('0x69')][_0x68cb('0x6a')],'userProfileId':_0x3b665e[_0x68cb('0x69')][_0x68cb('0x6b')]};if(!_0x40ba3e)throw new Error(_0x68cb('0x6c'));if(_0x40ba3e[_0x68cb('0x6a')]===_0x68cb('0x6d')){var _0x4e2a67=_0x11fbc0[_0x68cb('0x6e')]({'plain':!![]});return db[_0x68cb('0x6f')]['find']({'where':{'name':'Sounds','userProfileId':_0x40ba3e[_0x68cb('0x6b')]},'raw':!![]})[_0x68cb('0x23')](function(_0x23b170){if(_0x23b170&&_0x23b170[_0x68cb('0x70')]===0x0){return db[_0x68cb('0x71')][_0x68cb('0x4f')]({'name':_0x4e2a67[_0x68cb('0x27')],'resourceId':_0x4e2a67['id'],'type':_0x23b170[_0x68cb('0x27')],'sectionId':_0x23b170['id']},{})[_0x68cb('0x23')](function(){return _0x11fbc0;});}else{return _0x11fbc0;}})['catch'](function(_0x4ed2cb){logger['error'](_0x68cb('0x72'),_0x4ed2cb);throw _0x4ed2cb;});}return _0x11fbc0;})['then'](respondWithResult(_0x3ca1b8,null))[_0x68cb('0x40')](handleError(_0x3ca1b8,null));});_0x1c8dd5['start']();}catch(_0xfe7af5){_0x3ca1b8['status'](0x1f4)[_0x68cb('0x28')](_0xfe7af5);}};exports[_0x68cb('0x22')]=function(_0x3746c8,_0x52de7e,_0x549b8d){return db[_0x68cb('0x43')]['find']({'where':{'id':_0x3746c8[_0x68cb('0x41')]['id']}})[_0x68cb('0x23')](handleEntityNotFound(_0x52de7e,null))[_0x68cb('0x23')](saveUpdates(_[_0x68cb('0x3a')](_0x3746c8['body'],[_0x68cb('0x27'),'description']),null))[_0x68cb('0x23')](respondWithResult(_0x52de7e,null))[_0x68cb('0x40')](handleError(_0x52de7e,null));};exports[_0x68cb('0x73')]=function(_0x211b86,_0x25869a,_0x6a7b2d){return db[_0x68cb('0x43')][_0x68cb('0x46')]({'where':{'id':_0x211b86[_0x68cb('0x41')]['id']}})[_0x68cb('0x23')](function(_0x40e1f8){if(_0x40e1f8){return _0x40e1f8[_0x68cb('0x24')]();}})[_0x68cb('0x23')](function(_0x260a9a){var _0x3617c7=path['join'](config[_0x68cb('0x49')],_0x68cb('0x57'),util[_0x68cb('0x4c')](_0x68cb('0x4d'),_0x260a9a['save_name'],_0x260a9a['original_format']));var _0x45ee7b=path['join'](config[_0x68cb('0x49')],'server/files/sounds/converted',util['format'](_0x68cb('0x4d'),_0x260a9a[_0x68cb('0x4b')],_0x260a9a['converted_format']));fs['unlinkSync'](_0x3617c7);fs[_0x68cb('0x74')](_0x45ee7b);return _0x260a9a;})[_0x68cb('0x23')](function(_0x5e2dac){if(_0x5e2dac){return _0x25869a['status'](0xcc)['end']();}})[_0x68cb('0x23')](handleEntityNotFound(_0x25869a,null))[_0x68cb('0x40')](handleError(_0x25869a,null));}; \ No newline at end of file +var _0x418f=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','Sounds','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Sound','includeAll','include','findAll','show','params','find','catch','download','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join','root','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','start','description','delete','original_format','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x75147b,_0x3c37f1){var _0x344ea0=function(_0x1794b0){while(--_0x1794b0){_0x75147b['push'](_0x75147b['shift']());}};_0x344ea0(++_0x3c37f1);}(_0x418f,0x176));var _0xf418=function(_0xda3f86,_0x32c86c){_0xda3f86=_0xda3f86-0x0;var _0x1bcc40=_0x418f[_0xda3f86];return _0x1bcc40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf418('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf418('0x1'));var rp=require(_0xf418('0x2'));var moment=require(_0xf418('0x3'));var BPromise=require(_0xf418('0x4'));var Mustache=require(_0xf418('0x5'));var util=require(_0xf418('0x6'));var path=require(_0xf418('0x7'));var sox=require(_0xf418('0x8'));var csv=require(_0xf418('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf418('0xa'));var _=require(_0xf418('0xb'));var squel=require(_0xf418('0xc'));var crypto=require(_0xf418('0xd'));var jsforce=require(_0xf418('0xe'));var deskjs=require(_0xf418('0xf'));var toCsv=require(_0xf418('0x9'));var querystring=require(_0xf418('0x10'));var Papa=require(_0xf418('0x11'));var Redis=require('ioredis');var authService=require(_0xf418('0x12'));var qs=require(_0xf418('0x13'));var as=require(_0xf418('0x14'));var hardwareService=require(_0xf418('0x15'));var logger=require(_0xf418('0x16'))('api');var utils=require(_0xf418('0x17'));var config=require(_0xf418('0x18'));var licenseUtil=require(_0xf418('0x19'));var db=require(_0xf418('0x1a'))['db'];function respondWithStatusCode(_0x2a9d60,_0x1ea153){_0x1ea153=_0x1ea153||0xcc;return function(_0x27b147){if(_0x27b147){return _0x2a9d60[_0xf418('0x1b')](_0x1ea153);}return _0x2a9d60[_0xf418('0x1c')](_0x1ea153)[_0xf418('0x1d')]();};}function respondWithResult(_0x423aca,_0x1a19f5){_0x1a19f5=_0x1a19f5||0xc8;return function(_0x577a7a){if(_0x577a7a){return _0x423aca[_0xf418('0x1c')](_0x1a19f5)['json'](_0x577a7a);}};}function respondWithFilteredResult(_0xb4e39e,_0x20a661){return function(_0x5a5a46){if(_0x5a5a46){var _0x4e00a2=typeof _0x20a661[_0xf418('0x1e')]===_0xf418('0x1f')&&typeof _0x20a661[_0xf418('0x20')]==='undefined';var _0x276e0e=_0x5a5a46['count'];var _0x22e9ba=_0x4e00a2?0x0:_0x20a661['offset'];var _0x29b8c6=_0x4e00a2?_0x5a5a46[_0xf418('0x21')]:_0x20a661['offset']+_0x20a661['limit'];var _0x1ae8f1;if(_0x29b8c6>=_0x276e0e){_0x29b8c6=_0x276e0e;_0x1ae8f1=0xc8;}else{_0x1ae8f1=0xce;}_0xb4e39e[_0xf418('0x1c')](_0x1ae8f1);return _0xb4e39e[_0xf418('0x22')](_0xf418('0x23'),_0x22e9ba+'-'+_0x29b8c6+'/'+_0x276e0e)[_0xf418('0x24')](_0x5a5a46);}return null;};}function patchUpdates(_0x4cf65c){return function(_0x1fd587){try{jsonpatch[_0xf418('0x25')](_0x1fd587,_0x4cf65c,!![]);}catch(_0x5846e9){return BPromise[_0xf418('0x26')](_0x5846e9);}return _0x1fd587[_0xf418('0x27')]();};}function saveUpdates(_0x400068,_0x2cc08b){return function(_0x329b56){if(_0x329b56){return _0x329b56[_0xf418('0x28')](_0x400068)[_0xf418('0x29')](function(_0x53faba){return _0x53faba;});}return null;};}function removeEntity(_0x54ec99,_0x8312cc){return function(_0x5bcc83){if(_0x5bcc83){return _0x5bcc83['destroy']()['then'](function(){var _0x24ba46=_0x5bcc83['get']({'plain':!![]});var _0x42ee03=_0xf418('0x2a');return db[_0xf418('0x2b')][_0xf418('0x2c')]({'where':{'type':_0x42ee03,'resourceId':_0x24ba46['id']}})[_0xf418('0x29')](function(){return _0x5bcc83;});})['then'](function(){_0x54ec99[_0xf418('0x1c')](0xcc)[_0xf418('0x1d')]();});}};}function handleEntityNotFound(_0x3353a7,_0xd9cce5){return function(_0x782c19){if(!_0x782c19){_0x3353a7['sendStatus'](0x194);}return _0x782c19;};}function handleError(_0x15514d,_0x2bfd97){_0x2bfd97=_0x2bfd97||0x1f4;return function(_0x38612b){logger[_0xf418('0x2d')](_0x38612b[_0xf418('0x2e')]);if(_0x38612b[_0xf418('0x2f')]){delete _0x38612b[_0xf418('0x2f')];}_0x15514d[_0xf418('0x1c')](_0x2bfd97)[_0xf418('0x30')](_0x38612b);};}exports[_0xf418('0x31')]=function(_0x57a528,_0x59b93b){var _0x525a2c={},_0x475846={},_0x13e754={'count':0x0,'rows':[]};var _0x945b10=_[_0xf418('0x32')](db['Sound'][_0xf418('0x33')],function(_0x4d5b49){return{'name':_0x4d5b49[_0xf418('0x34')],'type':_0x4d5b49[_0xf418('0x35')][_0xf418('0x36')]};});_0x475846[_0xf418('0x37')]=_['map'](_0x945b10,'name');_0x475846['query']=_[_0xf418('0x38')](_0x57a528[_0xf418('0x39')]);_0x475846[_0xf418('0x3a')]=_['intersection'](_0x475846['model'],_0x475846[_0xf418('0x39')]);_0x525a2c[_0xf418('0x3b')]=_[_0xf418('0x3c')](_0x475846[_0xf418('0x37')],qs[_0xf418('0x3d')](_0x57a528[_0xf418('0x39')][_0xf418('0x3d')]));_0x525a2c[_0xf418('0x3b')]=_0x525a2c[_0xf418('0x3b')][_0xf418('0x3e')]?_0x525a2c[_0xf418('0x3b')]:_0x475846['model'];if(!_0x57a528[_0xf418('0x39')][_0xf418('0x3f')](_0xf418('0x40'))){_0x525a2c[_0xf418('0x20')]=qs['limit'](_0x57a528['query'][_0xf418('0x20')]);_0x525a2c[_0xf418('0x1e')]=qs['offset'](_0x57a528[_0xf418('0x39')][_0xf418('0x1e')]);}_0x525a2c[_0xf418('0x41')]=qs[_0xf418('0x42')](_0x57a528[_0xf418('0x39')]['sort']);_0x525a2c[_0xf418('0x43')]=qs[_0xf418('0x3a')](_[_0xf418('0x44')](_0x57a528[_0xf418('0x39')],_0x475846[_0xf418('0x3a')]),_0x945b10);if(_0x57a528['query'][_0xf418('0x45')]){_0x525a2c[_0xf418('0x43')]=_[_0xf418('0x46')](_0x525a2c[_0xf418('0x43')],{'$or':_['map'](_0x945b10,function(_0x53366c){if(_0x53366c[_0xf418('0x35')]!==_0xf418('0x47')){var _0x127c52={};_0x127c52[_0x53366c['name']]={'$like':'%'+_0x57a528[_0xf418('0x39')][_0xf418('0x45')]+'%'};return _0x127c52;}})});}_0x525a2c=_['merge']({},_0x525a2c,_0x57a528[_0xf418('0x48')]);var _0x21c59a={'where':_0x525a2c[_0xf418('0x43')]};return db[_0xf418('0x49')]['count'](_0x21c59a)[_0xf418('0x29')](function(_0x18bbd6){_0x13e754['count']=_0x18bbd6;if(_0x57a528[_0xf418('0x39')][_0xf418('0x4a')]){_0x525a2c[_0xf418('0x4b')]=[{'all':!![]}];}return db[_0xf418('0x49')][_0xf418('0x4c')](_0x525a2c);})[_0xf418('0x29')](function(_0x4effc7){_0x13e754['rows']=_0x4effc7;return _0x13e754;})[_0xf418('0x29')](respondWithFilteredResult(_0x59b93b,_0x525a2c))['catch'](handleError(_0x59b93b,null));};exports[_0xf418('0x4d')]=function(_0x1570b7,_0x1f4a24){var _0x2d8a76={'raw':!![],'where':{'id':_0x1570b7[_0xf418('0x4e')]['id']}},_0x552e4a={};_0x552e4a[_0xf418('0x37')]=_[_0xf418('0x38')](db[_0xf418('0x49')][_0xf418('0x33')]);_0x552e4a[_0xf418('0x39')]=_[_0xf418('0x38')](_0x1570b7[_0xf418('0x39')]);_0x552e4a[_0xf418('0x3a')]=_[_0xf418('0x3c')](_0x552e4a['model'],_0x552e4a[_0xf418('0x39')]);_0x2d8a76[_0xf418('0x3b')]=_[_0xf418('0x3c')](_0x552e4a[_0xf418('0x37')],qs[_0xf418('0x3d')](_0x1570b7[_0xf418('0x39')][_0xf418('0x3d')]));_0x2d8a76['attributes']=_0x2d8a76[_0xf418('0x3b')][_0xf418('0x3e')]?_0x2d8a76[_0xf418('0x3b')]:_0x552e4a[_0xf418('0x37')];if(_0x1570b7['query'][_0xf418('0x4a')]){_0x2d8a76[_0xf418('0x4b')]=[{'all':!![]}];}_0x2d8a76=_[_0xf418('0x46')]({},_0x2d8a76,_0x1570b7[_0xf418('0x48')]);return db[_0xf418('0x49')][_0xf418('0x4f')](_0x2d8a76)[_0xf418('0x29')](handleEntityNotFound(_0x1f4a24,null))[_0xf418('0x29')](respondWithResult(_0x1f4a24,null))[_0xf418('0x50')](handleError(_0x1f4a24,null));};exports[_0xf418('0x51')]=function(_0x4c553a,_0x12bbbd,_0x2b48e3){return db[_0xf418('0x49')]['find']({'where':{'id':_0x4c553a['params']['id']},'attributes':[_0xf418('0x2f'),_0xf418('0x52'),'converted_format'],'raw':!![]})[_0xf418('0x29')](handleEntityNotFound(_0x12bbbd,null))[_0xf418('0x29')](function(_0x367114){if(_0x367114){if(!fs[_0xf418('0x53')](path['join'](config['root'],_0xf418('0x54'),_0x367114[_0xf418('0x52')]+'.'+_0x367114[_0xf418('0x55')]))){throw new db[(_0xf418('0x56'))][(_0xf418('0x57'))](_0xf418('0x58'));}return _0x12bbbd[_0xf418('0x51')](path[_0xf418('0x59')](config[_0xf418('0x5a')],_0xf418('0x54'),util['format'](_0xf418('0x5b'),_0x367114[_0xf418('0x52')],_0x367114[_0xf418('0x55')])),util[_0xf418('0x5c')](_0xf418('0x5b'),_0x367114[_0xf418('0x2f')],_0x367114[_0xf418('0x55')]));}return null;})['catch'](handleError(_0x12bbbd,null));};exports[_0xf418('0x5d')]=function(_0x15fe65,_0x59c387,_0x171f13){var _0xd773f1={'name':path[_0xf418('0x5e')](_0x15fe65[_0xf418('0x5f')][_0xf418('0x60')],path[_0xf418('0x61')](_0x15fe65[_0xf418('0x5f')][_0xf418('0x60')])),'save_name':path[_0xf418('0x5e')](_0x15fe65[_0xf418('0x5f')][_0xf418('0x62')],path[_0xf418('0x61')](_0x15fe65[_0xf418('0x5f')]['filename'])),'original_format':path[_0xf418('0x61')](_0x15fe65[_0xf418('0x5f')][_0xf418('0x60')])[_0xf418('0x63')](0x1),'converted_format':_0xf418('0x64')};var _0x31cf0e=path[_0xf418('0x59')](config[_0xf418('0x5a')],_0xf418('0x65'),_0x15fe65[_0xf418('0x5f')][_0xf418('0x62')]);var _0x4628cf=path[_0xf418('0x59')](config[_0xf418('0x5a')],_0xf418('0x54'),util[_0xf418('0x5c')](_0xf418('0x5b'),path[_0xf418('0x5e')](_0x15fe65[_0xf418('0x5f')][_0xf418('0x62')],path[_0xf418('0x61')](_0x15fe65['file'][_0xf418('0x62')])),_0xd773f1[_0xf418('0x55')]));logger[_0xf418('0x66')](_0xf418('0x67'),_0x31cf0e);logger[_0xf418('0x66')]('Sound\x20upload\x20destination:\x20%s',_0x4628cf);try{fs[_0xf418('0x68')](_0x31cf0e,parseInt(_0xf418('0x69'),0x8));var _0x480118=sox['transcode'](_0x31cf0e,_0x4628cf,{'sampleRate':0x1f40,'format':_0xf418('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x480118['on'](_0xf418('0x2d'),function(_0x41dc80){fs['unlinkSync'](_0x31cf0e);_0x59c387[_0xf418('0x1c')](0x1f4)[_0xf418('0x30')](_0x41dc80);});_0x480118['on']('src',function(_0x42df98){_0xd773f1[_0xf418('0x6a')]=isNaN(_0x42df98[_0xf418('0x6b')])?null:_0x42df98[_0xf418('0x6b')]*0x3e8;_0xd773f1['original_sampleCount']=isNaN(_0x42df98[_0xf418('0x6c')])?null:_0x42df98['sampleCount'];_0xd773f1['original_channelCount']=isNaN(_0x42df98['channelCount'])?null:_0x42df98[_0xf418('0x6d')];_0xd773f1[_0xf418('0x6e')]=isNaN(_0x42df98[_0xf418('0x6f')])?null:_0x42df98[_0xf418('0x6f')];_0xd773f1['original_sampleRate']=isNaN(_0x42df98[_0xf418('0x70')])?null:_0x42df98[_0xf418('0x70')];});_0x480118['on'](_0xf418('0x71'),function(_0x3fa94b){_0xd773f1[_0xf418('0x72')]=isNaN(_0x3fa94b[_0xf418('0x6b')])?null:_0x3fa94b['duration']*0x3e8;_0xd773f1['converted_sampleCount']=isNaN(_0x3fa94b[_0xf418('0x6c')])?null:_0x3fa94b[_0xf418('0x6c')];_0xd773f1['converted_channelCount']=isNaN(_0x3fa94b[_0xf418('0x6d')])?null:_0x3fa94b[_0xf418('0x6d')];_0xd773f1[_0xf418('0x73')]=isNaN(_0x3fa94b[_0xf418('0x6f')])?null:_0x3fa94b[_0xf418('0x6f')];_0xd773f1[_0xf418('0x74')]=isNaN(_0x3fa94b[_0xf418('0x70')])?null:_0x3fa94b['sampleRate'];});_0x480118['on'](_0xf418('0x1d'),function(){fs[_0xf418('0x68')](_0x4628cf,parseInt(_0xf418('0x69'),0x8));return db['Sound'][_0xf418('0x5d')](_0xd773f1)[_0xf418('0x29')](function(_0x170f77){var _0x109e1f={'role':_0x15fe65[_0xf418('0x75')]['role'],'userProfileId':_0x15fe65['body'][_0xf418('0x76')]};if(!_0x109e1f)throw new Error(_0xf418('0x77'));if(_0x109e1f[_0xf418('0x78')]==='user'){var _0x2995e1=_0x170f77[_0xf418('0x79')]({'plain':!![]});return db[_0xf418('0x7a')]['find']({'where':{'name':_0xf418('0x2a'),'userProfileId':_0x109e1f['userProfileId']},'raw':!![]})[_0xf418('0x29')](function(_0x1c1181){if(_0x1c1181&&_0x1c1181[_0xf418('0x7b')]===0x0){return db['UserProfileResource']['create']({'name':_0x2995e1[_0xf418('0x2f')],'resourceId':_0x2995e1['id'],'type':_0x1c1181[_0xf418('0x2f')],'sectionId':_0x1c1181['id']},{})[_0xf418('0x29')](function(){return _0x170f77;});}else{return _0x170f77;}})[_0xf418('0x50')](function(_0x5865dc){logger[_0xf418('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5865dc);throw _0x5865dc;});}return _0x170f77;})[_0xf418('0x29')](respondWithResult(_0x59c387,null))[_0xf418('0x50')](handleError(_0x59c387,null));});_0x480118[_0xf418('0x7c')]();}catch(_0x3fa93e){_0x59c387['status'](0x1f4)[_0xf418('0x30')](_0x3fa93e);}};exports[_0xf418('0x28')]=function(_0xb2177a,_0x322f6f,_0x461de6){return db[_0xf418('0x49')]['find']({'where':{'id':_0xb2177a[_0xf418('0x4e')]['id']}})[_0xf418('0x29')](handleEntityNotFound(_0x322f6f,null))['then'](saveUpdates(_[_0xf418('0x44')](_0xb2177a[_0xf418('0x75')],[_0xf418('0x2f'),_0xf418('0x7d')]),null))['then'](respondWithResult(_0x322f6f,null))[_0xf418('0x50')](handleError(_0x322f6f,null));};exports[_0xf418('0x7e')]=function(_0x33c928,_0x3c7ff4,_0x136cd3){return db[_0xf418('0x49')][_0xf418('0x4f')]({'where':{'id':_0x33c928[_0xf418('0x4e')]['id']}})[_0xf418('0x29')](function(_0x3593dd){if(_0x3593dd){return _0x3593dd['destroy']();}})['then'](function(_0x478a0a){var _0x529cbe=path[_0xf418('0x59')](config[_0xf418('0x5a')],_0xf418('0x65'),util['format'](_0xf418('0x5b'),_0x478a0a[_0xf418('0x52')],_0x478a0a[_0xf418('0x7f')]));var _0xef8125=path[_0xf418('0x59')](config[_0xf418('0x5a')],_0xf418('0x54'),util['format'](_0xf418('0x5b'),_0x478a0a[_0xf418('0x52')],_0x478a0a[_0xf418('0x55')]));fs[_0xf418('0x80')](_0x529cbe);fs[_0xf418('0x80')](_0xef8125);return _0x478a0a;})[_0xf418('0x29')](function(_0x1466ed){if(_0x1466ed){return _0x3c7ff4[_0xf418('0x1c')](0xcc)[_0xf418('0x1d')]();}})[_0xf418('0x29')](handleEntityNotFound(_0x3c7ff4,null))[_0xf418('0x50')](handleError(_0x3c7ff4,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d720370..f3eb033 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 _0x5f7b=['define','Sound','tools_sounds','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x9c3c94,_0x296e5a){var _0x598937=function(_0x2e3c3b){while(--_0x2e3c3b){_0x9c3c94['push'](_0x9c3c94['shift']());}};_0x598937(++_0x296e5a);}(_0x5f7b,0x1ef));var _0xb5f7=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x5f7b[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var logger=require('../../config/logger')(_0xb5f7('0x2'));var moment=require(_0xb5f7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5f7('0x4'));var fs=require('fs');var path=require(_0xb5f7('0x5'));var rimraf=require(_0xb5f7('0x6'));var config=require(_0xb5f7('0x7'));var attributes=require('./sound.attributes');module[_0xb5f7('0x8')]=function(_0x373673,_0x57127e){return _0x373673[_0xb5f7('0x9')](_0xb5f7('0xa'),attributes,{'tableName':_0xb5f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24df=['../../config/environment','./sound.attributes','exports','define','tools_sounds','util','../../config/logger','api','moment','rimraf'];(function(_0x283e6c,_0x4a89cc){var _0x4da760=function(_0x323fd8){while(--_0x323fd8){_0x283e6c['push'](_0x283e6c['shift']());}};_0x4da760(++_0x4a89cc);}(_0x24df,0x13b));var _0xf24d=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x24df[_0x4d45c1];return _0x244478;};'use strict';var _=require('lodash');var util=require(_0xf24d('0x0'));var logger=require(_0xf24d('0x1'))(_0xf24d('0x2'));var moment=require(_0xf24d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf24d('0x4'));var config=require(_0xf24d('0x5'));var attributes=require(_0xf24d('0x6'));module[_0xf24d('0x7')]=function(_0x1d20d6,_0x23ded5){return _0x1d20d6[_0xf24d('0x8')]('Sound',attributes,{'tableName':_0xf24d('0x9'),'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 fc77bad..f534ab8 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 _0xfa73=['error','info','result','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x55aac9,_0x307220){var _0x4069fd=function(_0x139aec){while(--_0x139aec){_0x55aac9['push'](_0x55aac9['shift']());}};_0x4069fd(++_0x307220);}(_0xfa73,0x184));var _0x3fa7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa73[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3fa7('0x0'));var util=require(_0x3fa7('0x1'));var moment=require(_0x3fa7('0x2'));var BPromise=require(_0x3fa7('0x3'));var rs=require(_0x3fa7('0x4'));var fs=require('fs');var Redis=require(_0x3fa7('0x5'));var db=require(_0x3fa7('0x6'))['db'];var utils=require(_0x3fa7('0x7'));var logger=require(_0x3fa7('0x8'))(_0x3fa7('0x9'));var config=require(_0x3fa7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3fa7('0xb')][_0x3fa7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3028d6,_0x2bf325,_0x585981){return new BPromise(function(_0x98c36e,_0x319bda){return client['request'](_0x3028d6,_0x585981)[_0x3fa7('0xd')](function(_0x2a256b){logger['info'](_0x3fa7('0xe'),_0x2bf325,_0x3fa7('0xf'));logger['debug'](_0x3fa7('0x10'),_0x2bf325,_0x3fa7('0xf'),JSON[_0x3fa7('0x11')](_0x2a256b));if(_0x2a256b['error']){if(_0x2a256b['error'][_0x3fa7('0x12')]===0x1f4){logger['error'](_0x3fa7('0xe'),_0x2bf325,_0x2a256b['error'][_0x3fa7('0x13')]);return _0x319bda(_0x2a256b[_0x3fa7('0x14')][_0x3fa7('0x13')]);}logger['error'](_0x3fa7('0xe'),_0x2bf325,_0x2a256b[_0x3fa7('0x14')]['message']);return _0x98c36e(_0x2a256b[_0x3fa7('0x14')][_0x3fa7('0x13')]);}else{logger[_0x3fa7('0x15')](_0x3fa7('0xe'),_0x2bf325,_0x3fa7('0xf'));_0x98c36e(_0x2a256b[_0x3fa7('0x16')][_0x3fa7('0x13')]);}})['catch'](function(_0x4abcb5){logger[_0x3fa7('0x14')](_0x3fa7('0xe'),_0x2bf325,_0x4abcb5);_0x319bda(_0x4abcb5);});});}exports[_0x3fa7('0x17')]=function(_0x547bbd){var _0x4786b7=this;return new Promise(function(_0x3f271d,_0x7f6ca7){return db[_0x3fa7('0x18')]['find']({'raw':_0x547bbd[_0x3fa7('0x19')]?_0x547bbd[_0x3fa7('0x19')][_0x3fa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x547bbd[_0x3fa7('0x19')]?_0x547bbd[_0x3fa7('0x19')][_0x3fa7('0x1b')]||null:null,'attributes':_0x547bbd[_0x3fa7('0x19')]?_0x547bbd[_0x3fa7('0x19')][_0x3fa7('0x1c')]||null:null,'include':_0x547bbd[_0x3fa7('0x19')]?_0x547bbd['options'][_0x3fa7('0x1d')]?_[_0x3fa7('0x1e')](_0x547bbd['options'][_0x3fa7('0x1d')],function(_0x1b67f8){return{'model':db[_0x1b67f8[_0x3fa7('0x1f')]],'as':_0x1b67f8['as'],'attributes':_0x1b67f8[_0x3fa7('0x1c')],'include':_0x1b67f8['include']?_[_0x3fa7('0x1e')](_0x1b67f8[_0x3fa7('0x1d')],function(_0x8cd342){return{'model':db[_0x8cd342['model']],'as':_0x8cd342['as'],'attributes':_0x8cd342[_0x3fa7('0x1c')],'include':_0x8cd342[_0x3fa7('0x1d')]?_[_0x3fa7('0x1e')](_0x8cd342[_0x3fa7('0x1d')],function(_0x5f2967){return{'model':db[_0x5f2967['model']],'as':_0x5f2967['as'],'attributes':_0x5f2967[_0x3fa7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4814be){logger[_0x3fa7('0x15')](_0x3fa7('0x17'),_0x547bbd);logger[_0x3fa7('0x20')](_0x3fa7('0x17'),_0x547bbd,JSON[_0x3fa7('0x11')](_0x4814be));_0x3f271d(_0x4814be);})[_0x3fa7('0x21')](function(_0x5abf34){logger[_0x3fa7('0x14')](_0x3fa7('0x17'),_0x5abf34[_0x3fa7('0x13')],_0x547bbd);_0x7f6ca7(_0x4786b7[_0x3fa7('0x14')](0x1f4,_0x5abf34[_0x3fa7('0x13')]));});});}; \ No newline at end of file +var _0xf7ad=['raw','include','map','model','attributes','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options'];(function(_0x4cee17,_0xda2b5){var _0x1d3b07=function(_0x100217){while(--_0x100217){_0x4cee17['push'](_0x4cee17['shift']());}};_0x1d3b07(++_0xda2b5);}(_0xf7ad,0x91));var _0xdf7a=function(_0x2729d6,_0x3feb8b){_0x2729d6=_0x2729d6-0x0;var _0x3749c3=_0xf7ad[_0x2729d6];return _0x3749c3;};'use strict';var _=require(_0xdf7a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf7a('0x1'));var rs=require(_0xdf7a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdf7a('0x3'))(_0xdf7a('0x4'));var config=require(_0xdf7a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdf7a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b3277,_0x58020a,_0x54a320){return new BPromise(function(_0x54fd23,_0x2f4263){return client['request'](_0x3b3277,_0x54a320)[_0xdf7a('0x7')](function(_0xd91d50){logger['info'](_0xdf7a('0x8'),_0x58020a,_0xdf7a('0x9'));logger[_0xdf7a('0xa')](_0xdf7a('0xb'),_0x58020a,_0xdf7a('0x9'),JSON[_0xdf7a('0xc')](_0xd91d50));if(_0xd91d50[_0xdf7a('0xd')]){if(_0xd91d50[_0xdf7a('0xd')][_0xdf7a('0xe')]===0x1f4){logger[_0xdf7a('0xd')](_0xdf7a('0x8'),_0x58020a,_0xd91d50[_0xdf7a('0xd')][_0xdf7a('0xf')]);return _0x2f4263(_0xd91d50[_0xdf7a('0xd')][_0xdf7a('0xf')]);}logger[_0xdf7a('0xd')]('Sound,\x20%s,\x20%s',_0x58020a,_0xd91d50[_0xdf7a('0xd')][_0xdf7a('0xf')]);return _0x54fd23(_0xd91d50[_0xdf7a('0xd')]['message']);}else{logger[_0xdf7a('0x10')](_0xdf7a('0x8'),_0x58020a,_0xdf7a('0x9'));_0x54fd23(_0xd91d50[_0xdf7a('0x11')][_0xdf7a('0xf')]);}})[_0xdf7a('0x12')](function(_0x4d5db0){logger[_0xdf7a('0xd')](_0xdf7a('0x8'),_0x58020a,_0x4d5db0);_0x2f4263(_0x4d5db0);});});}exports[_0xdf7a('0x13')]=function(_0x361756){var _0x502ec3=this;return new Promise(function(_0x1080ea,_0x2d3c7e){return db[_0xdf7a('0x14')][_0xdf7a('0x15')]({'raw':_0x361756[_0xdf7a('0x16')]?_0x361756[_0xdf7a('0x16')][_0xdf7a('0x17')]===undefined?!![]:![]:!![],'where':_0x361756[_0xdf7a('0x16')]?_0x361756[_0xdf7a('0x16')]['where']||null:null,'attributes':_0x361756[_0xdf7a('0x16')]?_0x361756['options']['attributes']||null:null,'include':_0x361756['options']?_0x361756[_0xdf7a('0x16')][_0xdf7a('0x18')]?_[_0xdf7a('0x19')](_0x361756[_0xdf7a('0x16')][_0xdf7a('0x18')],function(_0x5253e0){return{'model':db[_0x5253e0[_0xdf7a('0x1a')]],'as':_0x5253e0['as'],'attributes':_0x5253e0['attributes'],'include':_0x5253e0[_0xdf7a('0x18')]?_['map'](_0x5253e0[_0xdf7a('0x18')],function(_0x442a47){return{'model':db[_0x442a47['model']],'as':_0x442a47['as'],'attributes':_0x442a47['attributes'],'include':_0x442a47[_0xdf7a('0x18')]?_['map'](_0x442a47[_0xdf7a('0x18')],function(_0x10b41d){return{'model':db[_0x10b41d[_0xdf7a('0x1a')]],'as':_0x10b41d['as'],'attributes':_0x10b41d[_0xdf7a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbd2e84){logger[_0xdf7a('0x10')](_0xdf7a('0x13'),_0x361756);logger[_0xdf7a('0xa')](_0xdf7a('0x13'),_0x361756,JSON[_0xdf7a('0xc')](_0xbd2e84));_0x1080ea(_0xbd2e84);})['catch'](function(_0x3552a7){logger[_0xdf7a('0xd')](_0xdf7a('0x13'),_0x3552a7['message'],_0x361756);_0x2d3c7e(_0x502ec3[_0xdf7a('0xd')](0x1f4,_0x3552a7[_0xdf7a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 78ec6cc..2363d51 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 _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7c9ca4,_0x5506c0){var _0x1f33eb=function(_0x128232){while(--_0x128232){_0x7c9ca4['push'](_0x7c9ca4['shift']());}};_0x1f33eb(++_0x5506c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f46d,_0x1d6712){_0x34f46d=_0x34f46d-0x0;var _0x3a2d9e=_0xb10b[_0x34f46d];return _0x3a2d9e;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=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(_0x4a6216,_0x2a15d2){var _0xc5bcfb=function(_0xdeae70){while(--_0xdeae70){_0x4a6216['push'](_0x4a6216['shift']());}};_0xc5bcfb(++_0x2a15d2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x5eb8[_0x4b6830];return _0x239e4a;};'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 328c08c..2b0aa7a 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 _0x56f8=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x56f8,0x1ce));var _0x856f=function(_0x432b74,_0x44721c){_0x432b74=_0x432b74-0x0;var _0x11a547=_0x56f8[_0x432b74];return _0x11a547;};'use strict';var Sequelize=require(_0x856f('0x0'));module[_0x856f('0x1')]={'uniqueid':{'type':Sequelize[_0x856f('0x2')]},'body':{'type':Sequelize[_0x856f('0x3')](_0x856f('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x856f('0x5')]('in','out'),'defaultValue':_0x856f('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x856f('0x2')]},'providerResponse':{'type':Sequelize[_0x856f('0x3')]}}; \ No newline at end of file +var _0xc41d=['exports','STRING','medium','ENUM','out','TEXT','sequelize'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc41d,0xe6));var _0xdc41=function(_0x5d38e0,_0x435dfd){_0x5d38e0=_0x5d38e0-0x0;var _0x2d946f=_0xc41d[_0x5d38e0];return _0x2d946f;};'use strict';var Sequelize=require(_0xdc41('0x0'));module[_0xdc41('0x1')]={'uniqueid':{'type':Sequelize[_0xdc41('0x2')]},'body':{'type':Sequelize['TEXT'](_0xdc41('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xdc41('0x4')]('in',_0xdc41('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xdc41('0x2')]},'providerResponse':{'type':Sequelize[_0xdc41('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4265ce1..3551630 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 _0xa908=['show','params','keys','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','save','then','destroy','sendStatus','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','map','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch'];(function(_0x4ac1ce,_0x10c8c9){var _0x4a00c4=function(_0x709f14){while(--_0x709f14){_0x4ac1ce['push'](_0x4ac1ce['shift']());}};_0x4a00c4(++_0x10c8c9);}(_0xa908,0x1c3));var _0x8a90=function(_0x38c2b5,_0x4de8fa){_0x38c2b5=_0x38c2b5-0x0;var _0x46deb3=_0xa908[_0x38c2b5];return _0x46deb3;};'use strict';var emlformat=require(_0x8a90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a90('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a90('0x2'));var moment=require(_0x8a90('0x3'));var BPromise=require(_0x8a90('0x4'));var Mustache=require(_0x8a90('0x5'));var util=require(_0x8a90('0x6'));var path=require('path');var sox=require(_0x8a90('0x7'));var csv=require(_0x8a90('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a90('0x9'));var _=require(_0x8a90('0xa'));var squel=require(_0x8a90('0xb'));var crypto=require(_0x8a90('0xc'));var jsforce=require(_0x8a90('0xd'));var deskjs=require(_0x8a90('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8a90('0xf'));var Papa=require('papaparse');var Redis=require(_0x8a90('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a90('0x11'));var as=require(_0x8a90('0x12'));var hardwareService=require(_0x8a90('0x13'));var logger=require(_0x8a90('0x14'))(_0x8a90('0x15'));var utils=require(_0x8a90('0x16'));var config=require(_0x8a90('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb13e2e,_0x423d39){_0x423d39=_0x423d39||0xcc;return function(_0x110f2e){if(_0x110f2e){return _0xb13e2e['sendStatus'](_0x423d39);}return _0xb13e2e[_0x8a90('0x18')](_0x423d39)[_0x8a90('0x19')]();};}function respondWithResult(_0x3b563d,_0x499ca6){_0x499ca6=_0x499ca6||0xc8;return function(_0x38eef3){if(_0x38eef3){return _0x3b563d[_0x8a90('0x18')](_0x499ca6)['json'](_0x38eef3);}};}function respondWithFilteredResult(_0x122356,_0x85392a){return function(_0x1f667a){if(_0x1f667a){var _0x1bfd6c=typeof _0x85392a['offset']==='undefined'&&typeof _0x85392a[_0x8a90('0x1a')]===_0x8a90('0x1b');var _0x40e491=_0x1f667a[_0x8a90('0x1c')];var _0x17ba83=_0x1bfd6c?0x0:_0x85392a[_0x8a90('0x1d')];var _0x2808c2=_0x1bfd6c?_0x1f667a[_0x8a90('0x1c')]:_0x85392a['offset']+_0x85392a[_0x8a90('0x1a')];var _0x4e78c1;if(_0x2808c2>=_0x40e491){_0x2808c2=_0x40e491;_0x4e78c1=0xc8;}else{_0x4e78c1=0xce;}_0x122356[_0x8a90('0x18')](_0x4e78c1);return _0x122356[_0x8a90('0x1e')](_0x8a90('0x1f'),_0x17ba83+'-'+_0x2808c2+'/'+_0x40e491)[_0x8a90('0x20')](_0x1f667a);}return null;};}function patchUpdates(_0xce9cc3){return function(_0x454103){try{jsonpatch['apply'](_0x454103,_0xce9cc3,!![]);}catch(_0x3b7852){return BPromise[_0x8a90('0x21')](_0x3b7852);}return _0x454103[_0x8a90('0x22')]();};}function saveUpdates(_0x4f2bae,_0x28f6a8){return function(_0x43b8f6){if(_0x43b8f6){return _0x43b8f6['update'](_0x4f2bae)[_0x8a90('0x23')](function(_0x15f93f){return _0x15f93f;});}return null;};}function removeEntity(_0x51dd1a,_0x457c46){return function(_0x36a334){if(_0x36a334){return _0x36a334[_0x8a90('0x24')]()[_0x8a90('0x23')](function(){_0x51dd1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22fd3f,_0xf68970){return function(_0x29b50b){if(!_0x29b50b){_0x22fd3f[_0x8a90('0x25')](0x194);}return _0x29b50b;};}function handleError(_0x10bcda,_0x56cba8){_0x56cba8=_0x56cba8||0x1f4;return function(_0x16a228){logger[_0x8a90('0x26')](_0x16a228[_0x8a90('0x27')]);if(_0x16a228[_0x8a90('0x28')]){delete _0x16a228['name'];}_0x10bcda[_0x8a90('0x18')](_0x56cba8)['send'](_0x16a228);};}exports[_0x8a90('0x29')]=function(_0xdefa9a,_0xd67856){var _0x4b641d={},_0x17aafd={},_0x300a0b={'count':0x0,'rows':[]};var _0x16cbbf=_['map'](db[_0x8a90('0x2a')][_0x8a90('0x2b')],function(_0x3443ba){return{'name':_0x3443ba[_0x8a90('0x2c')],'type':_0x3443ba[_0x8a90('0x2d')][_0x8a90('0x2e')]};});_0x17aafd['model']=_[_0x8a90('0x2f')](_0x16cbbf,_0x8a90('0x28'));_0x17aafd['query']=_['keys'](_0xdefa9a['query']);_0x17aafd[_0x8a90('0x30')]=_[_0x8a90('0x31')](_0x17aafd[_0x8a90('0x32')],_0x17aafd[_0x8a90('0x33')]);_0x4b641d[_0x8a90('0x34')]=_['intersection'](_0x17aafd[_0x8a90('0x32')],qs[_0x8a90('0x35')](_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x35')]));_0x4b641d['attributes']=_0x4b641d['attributes'][_0x8a90('0x36')]?_0x4b641d['attributes']:_0x17aafd[_0x8a90('0x32')];if(!_0xdefa9a[_0x8a90('0x33')]['hasOwnProperty'](_0x8a90('0x37'))){_0x4b641d['limit']=qs[_0x8a90('0x1a')](_0xdefa9a['query'][_0x8a90('0x1a')]);_0x4b641d[_0x8a90('0x1d')]=qs[_0x8a90('0x1d')](_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x1d')]);}_0x4b641d[_0x8a90('0x38')]=qs[_0x8a90('0x39')](_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x39')]);_0x4b641d[_0x8a90('0x3a')]=qs[_0x8a90('0x30')](_['pick'](_0xdefa9a[_0x8a90('0x33')],_0x17aafd[_0x8a90('0x30')]),_0x16cbbf);if(_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x3b')]){_0x4b641d[_0x8a90('0x3a')]=_['merge'](_0x4b641d[_0x8a90('0x3a')],{'$or':_[_0x8a90('0x2f')](_0x16cbbf,function(_0xe5e1d4){if(_0xe5e1d4['type']!==_0x8a90('0x3c')){var _0x3b0229={};_0x3b0229[_0xe5e1d4[_0x8a90('0x28')]]={'$like':'%'+_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x3b')]+'%'};return _0x3b0229;}})});}_0x4b641d=_[_0x8a90('0x3d')]({},_0x4b641d,_0xdefa9a[_0x8a90('0x3e')]);var _0x541075={'where':_0x4b641d[_0x8a90('0x3a')]};return db[_0x8a90('0x2a')]['count'](_0x541075)[_0x8a90('0x23')](function(_0x129d80){_0x300a0b['count']=_0x129d80;if(_0xdefa9a[_0x8a90('0x33')][_0x8a90('0x3f')]){_0x4b641d[_0x8a90('0x40')]=[{'all':!![]}];}return db[_0x8a90('0x2a')]['findAll'](_0x4b641d);})[_0x8a90('0x23')](function(_0x141b39){_0x300a0b[_0x8a90('0x41')]=_0x141b39;return _0x300a0b;})[_0x8a90('0x23')](respondWithFilteredResult(_0xd67856,_0x4b641d))[_0x8a90('0x42')](handleError(_0xd67856,null));};exports[_0x8a90('0x43')]=function(_0xa5939c,_0x273ccf){var _0x478644={'raw':!![],'where':{'id':_0xa5939c[_0x8a90('0x44')]['id']}},_0x10208d={};_0x10208d[_0x8a90('0x32')]=_[_0x8a90('0x45')](db[_0x8a90('0x2a')][_0x8a90('0x2b')]);_0x10208d['query']=_[_0x8a90('0x45')](_0xa5939c['query']);_0x10208d[_0x8a90('0x30')]=_[_0x8a90('0x31')](_0x10208d['model'],_0x10208d[_0x8a90('0x33')]);_0x478644[_0x8a90('0x34')]=_[_0x8a90('0x31')](_0x10208d[_0x8a90('0x32')],qs[_0x8a90('0x35')](_0xa5939c['query'][_0x8a90('0x35')]));_0x478644[_0x8a90('0x34')]=_0x478644[_0x8a90('0x34')][_0x8a90('0x36')]?_0x478644[_0x8a90('0x34')]:_0x10208d[_0x8a90('0x32')];if(_0xa5939c[_0x8a90('0x33')][_0x8a90('0x3f')]){_0x478644[_0x8a90('0x40')]=[{'all':!![]}];}_0x478644=_[_0x8a90('0x3d')]({},_0x478644,_0xa5939c[_0x8a90('0x3e')]);return db[_0x8a90('0x2a')][_0x8a90('0x46')](_0x478644)['then'](handleEntityNotFound(_0x273ccf,null))[_0x8a90('0x23')](respondWithResult(_0x273ccf,null))[_0x8a90('0x42')](handleError(_0x273ccf,null));};exports[_0x8a90('0x47')]=function(_0x25b340,_0x5123ab){return db['SquareMessage']['create'](_0x25b340[_0x8a90('0x48')],{})[_0x8a90('0x23')](respondWithResult(_0x5123ab,0xc9))[_0x8a90('0x42')](handleError(_0x5123ab,null));};exports[_0x8a90('0x49')]=function(_0x2dd26d,_0x2a027c){if(_0x2dd26d['body']['id']){delete _0x2dd26d['body']['id'];}return db[_0x8a90('0x2a')][_0x8a90('0x46')]({'where':{'id':_0x2dd26d[_0x8a90('0x44')]['id']}})[_0x8a90('0x23')](handleEntityNotFound(_0x2a027c,null))['then'](saveUpdates(_0x2dd26d[_0x8a90('0x48')],null))[_0x8a90('0x23')](respondWithResult(_0x2a027c,null))[_0x8a90('0x42')](handleError(_0x2a027c,null));};exports[_0x8a90('0x24')]=function(_0x29a430,_0x453e7e){return db[_0x8a90('0x2a')][_0x8a90('0x46')]({'where':{'id':_0x29a430[_0x8a90('0x44')]['id']}})[_0x8a90('0x23')](handleEntityNotFound(_0x453e7e,null))[_0x8a90('0x23')](removeEntity(_0x453e7e,null))[_0x8a90('0x42')](handleError(_0x453e7e,null));}; \ No newline at end of file +var _0x2deb=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','intersection','include','create','body','find'];(function(_0x49e9a6,_0x5727ff){var _0x346d01=function(_0x31a85e){while(--_0x31a85e){_0x49e9a6['push'](_0x49e9a6['shift']());}};_0x346d01(++_0x5727ff);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb2de('0x0'));var rimraf=require(_0xb2de('0x1'));var zipdir=require(_0xb2de('0x2'));var jsonpatch=require(_0xb2de('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb2de('0x4'));var Mustache=require(_0xb2de('0x5'));var util=require(_0xb2de('0x6'));var path=require(_0xb2de('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2de('0x8'));var fs=require('fs');var fs_extra=require(_0xb2de('0x9'));var _=require(_0xb2de('0xa'));var squel=require('squel');var crypto=require(_0xb2de('0xb'));var jsforce=require(_0xb2de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb2de('0xd'));var querystring=require(_0xb2de('0xe'));var Papa=require(_0xb2de('0xf'));var Redis=require('ioredis');var authService=require(_0xb2de('0x10'));var qs=require(_0xb2de('0x11'));var as=require(_0xb2de('0x12'));var hardwareService=require(_0xb2de('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb2de('0x14'));var config=require(_0xb2de('0x15'));var licenseUtil=require(_0xb2de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e2237,_0x343024){_0x343024=_0x343024||0xcc;return function(_0xec4373){if(_0xec4373){return _0x1e2237['sendStatus'](_0x343024);}return _0x1e2237[_0xb2de('0x17')](_0x343024)['end']();};}function respondWithResult(_0x160d61,_0x4feb90){_0x4feb90=_0x4feb90||0xc8;return function(_0x10ef21){if(_0x10ef21){return _0x160d61[_0xb2de('0x17')](_0x4feb90)[_0xb2de('0x18')](_0x10ef21);}};}function respondWithFilteredResult(_0x5a1f02,_0x209429){return function(_0x40f29d){if(_0x40f29d){var _0x2dc98f=typeof _0x209429[_0xb2de('0x19')]===_0xb2de('0x1a')&&typeof _0x209429[_0xb2de('0x1b')]===_0xb2de('0x1a');var _0x2db287=_0x40f29d[_0xb2de('0x1c')];var _0x5d06ac=_0x2dc98f?0x0:_0x209429[_0xb2de('0x19')];var _0x53d213=_0x2dc98f?_0x40f29d[_0xb2de('0x1c')]:_0x209429[_0xb2de('0x19')]+_0x209429['limit'];var _0x2fbe63;if(_0x53d213>=_0x2db287){_0x53d213=_0x2db287;_0x2fbe63=0xc8;}else{_0x2fbe63=0xce;}_0x5a1f02[_0xb2de('0x17')](_0x2fbe63);return _0x5a1f02['set'](_0xb2de('0x1d'),_0x5d06ac+'-'+_0x53d213+'/'+_0x2db287)[_0xb2de('0x18')](_0x40f29d);}return null;};}function patchUpdates(_0x34b228){return function(_0x148c91){try{jsonpatch[_0xb2de('0x1e')](_0x148c91,_0x34b228,!![]);}catch(_0x3014b9){return BPromise[_0xb2de('0x1f')](_0x3014b9);}return _0x148c91[_0xb2de('0x20')]();};}function saveUpdates(_0x20d7f8,_0x506a50){return function(_0x280644){if(_0x280644){return _0x280644[_0xb2de('0x21')](_0x20d7f8)[_0xb2de('0x22')](function(_0xa97fb4){return _0xa97fb4;});}return null;};}function removeEntity(_0x521e47,_0x55051f){return function(_0x102da8){if(_0x102da8){return _0x102da8[_0xb2de('0x23')]()[_0xb2de('0x22')](function(){_0x521e47['status'](0xcc)[_0xb2de('0x24')]();});}};}function handleEntityNotFound(_0x1cc2db,_0x4a6d12){return function(_0x16c249){if(!_0x16c249){_0x1cc2db['sendStatus'](0x194);}return _0x16c249;};}function handleError(_0x2d9fd1,_0xd6693f){_0xd6693f=_0xd6693f||0x1f4;return function(_0x1c8eaf){logger[_0xb2de('0x25')](_0x1c8eaf[_0xb2de('0x26')]);if(_0x1c8eaf[_0xb2de('0x27')]){delete _0x1c8eaf['name'];}_0x2d9fd1[_0xb2de('0x17')](_0xd6693f)['send'](_0x1c8eaf);};}exports[_0xb2de('0x28')]=function(_0x5c74e6,_0x579d6c){var _0x3ed36e={},_0x4269ab={},_0x345e20={'count':0x0,'rows':[]};var _0x1b6c37=_[_0xb2de('0x29')](db[_0xb2de('0x2a')][_0xb2de('0x2b')],function(_0x88f02){return{'name':_0x88f02[_0xb2de('0x2c')],'type':_0x88f02[_0xb2de('0x2d')][_0xb2de('0x2e')]};});_0x4269ab[_0xb2de('0x2f')]=_['map'](_0x1b6c37,_0xb2de('0x27'));_0x4269ab[_0xb2de('0x30')]=_['keys'](_0x5c74e6[_0xb2de('0x30')]);_0x4269ab[_0xb2de('0x31')]=_['intersection'](_0x4269ab[_0xb2de('0x2f')],_0x4269ab[_0xb2de('0x30')]);_0x3ed36e[_0xb2de('0x32')]=_['intersection'](_0x4269ab[_0xb2de('0x2f')],qs[_0xb2de('0x33')](_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x33')]));_0x3ed36e[_0xb2de('0x32')]=_0x3ed36e[_0xb2de('0x32')][_0xb2de('0x34')]?_0x3ed36e[_0xb2de('0x32')]:_0x4269ab[_0xb2de('0x2f')];if(!_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x35')]('nolimit')){_0x3ed36e[_0xb2de('0x1b')]=qs[_0xb2de('0x1b')](_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x1b')]);_0x3ed36e[_0xb2de('0x19')]=qs[_0xb2de('0x19')](_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x19')]);}_0x3ed36e[_0xb2de('0x36')]=qs[_0xb2de('0x37')](_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x37')]);_0x3ed36e[_0xb2de('0x38')]=qs[_0xb2de('0x31')](_[_0xb2de('0x39')](_0x5c74e6['query'],_0x4269ab[_0xb2de('0x31')]),_0x1b6c37);if(_0x5c74e6['query'][_0xb2de('0x3a')]){_0x3ed36e[_0xb2de('0x38')]=_[_0xb2de('0x3b')](_0x3ed36e[_0xb2de('0x38')],{'$or':_[_0xb2de('0x29')](_0x1b6c37,function(_0x2cc362){if(_0x2cc362[_0xb2de('0x2d')]!==_0xb2de('0x3c')){var _0x24f53b={};_0x24f53b[_0x2cc362[_0xb2de('0x27')]]={'$like':'%'+_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x3a')]+'%'};return _0x24f53b;}})});}_0x3ed36e=_[_0xb2de('0x3b')]({},_0x3ed36e,_0x5c74e6[_0xb2de('0x3d')]);var _0x3dc4c0={'where':_0x3ed36e['where']};return db[_0xb2de('0x2a')][_0xb2de('0x1c')](_0x3dc4c0)['then'](function(_0x317a31){_0x345e20[_0xb2de('0x1c')]=_0x317a31;if(_0x5c74e6[_0xb2de('0x30')][_0xb2de('0x3e')]){_0x3ed36e['include']=[{'all':!![]}];}return db[_0xb2de('0x2a')][_0xb2de('0x3f')](_0x3ed36e);})['then'](function(_0x47448a){_0x345e20[_0xb2de('0x40')]=_0x47448a;return _0x345e20;})['then'](respondWithFilteredResult(_0x579d6c,_0x3ed36e))[_0xb2de('0x41')](handleError(_0x579d6c,null));};exports['show']=function(_0x5f30cc,_0x29e9a0){var _0x5ad6cf={'raw':!![],'where':{'id':_0x5f30cc[_0xb2de('0x42')]['id']}},_0x514623={};_0x514623[_0xb2de('0x2f')]=_['keys'](db[_0xb2de('0x2a')][_0xb2de('0x2b')]);_0x514623[_0xb2de('0x30')]=_[_0xb2de('0x43')](_0x5f30cc['query']);_0x514623[_0xb2de('0x31')]=_[_0xb2de('0x44')](_0x514623[_0xb2de('0x2f')],_0x514623[_0xb2de('0x30')]);_0x5ad6cf[_0xb2de('0x32')]=_[_0xb2de('0x44')](_0x514623[_0xb2de('0x2f')],qs['fields'](_0x5f30cc[_0xb2de('0x30')][_0xb2de('0x33')]));_0x5ad6cf[_0xb2de('0x32')]=_0x5ad6cf['attributes'][_0xb2de('0x34')]?_0x5ad6cf['attributes']:_0x514623[_0xb2de('0x2f')];if(_0x5f30cc[_0xb2de('0x30')][_0xb2de('0x3e')]){_0x5ad6cf[_0xb2de('0x45')]=[{'all':!![]}];}_0x5ad6cf=_['merge']({},_0x5ad6cf,_0x5f30cc[_0xb2de('0x3d')]);return db[_0xb2de('0x2a')]['find'](_0x5ad6cf)['then'](handleEntityNotFound(_0x29e9a0,null))[_0xb2de('0x22')](respondWithResult(_0x29e9a0,null))[_0xb2de('0x41')](handleError(_0x29e9a0,null));};exports[_0xb2de('0x46')]=function(_0x3d16b6,_0x22caba){return db['SquareMessage'][_0xb2de('0x46')](_0x3d16b6['body'],{})[_0xb2de('0x22')](respondWithResult(_0x22caba,0xc9))['catch'](handleError(_0x22caba,null));};exports[_0xb2de('0x21')]=function(_0x3dca27,_0x4c52bc){if(_0x3dca27[_0xb2de('0x47')]['id']){delete _0x3dca27['body']['id'];}return db[_0xb2de('0x2a')][_0xb2de('0x48')]({'where':{'id':_0x3dca27[_0xb2de('0x42')]['id']}})[_0xb2de('0x22')](handleEntityNotFound(_0x4c52bc,null))['then'](saveUpdates(_0x3dca27[_0xb2de('0x47')],null))[_0xb2de('0x22')](respondWithResult(_0x4c52bc,null))[_0xb2de('0x41')](handleError(_0x4c52bc,null));};exports[_0xb2de('0x23')]=function(_0x2a7d51,_0x4a80c3){return db[_0xb2de('0x2a')][_0xb2de('0x48')]({'where':{'id':_0x2a7d51[_0xb2de('0x42')]['id']}})[_0xb2de('0x22')](handleEntityNotFound(_0x4a80c3,null))[_0xb2de('0x22')](removeEntity(_0x4a80c3,null))['catch'](handleError(_0x4a80c3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f2a7f2d..d6bd1d1 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 _0x23b7=['bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger'];(function(_0x32def1,_0x34f15e){var _0xfc9777=function(_0x5b219b){while(--_0x5b219b){_0x32def1['push'](_0x32def1['shift']());}};_0xfc9777(++_0x34f15e);}(_0x23b7,0x169));var _0x723b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23b7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x723b('0x0'));var logger=require(_0x723b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x723b('0x2'));var rp=require(_0x723b('0x3'));var fs=require('fs');var path=require(_0x723b('0x4'));var rimraf=require(_0x723b('0x5'));var config=require(_0x723b('0x6'));var attributes=require(_0x723b('0x7'));module[_0x723b('0x8')]=function(_0x3dca0c,_0x17ed02){return _0x3dca0c[_0x723b('0x9')]('SquareMessage',attributes,{'tableName':_0x723b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0afa=['../../config/logger','moment','path','../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x0afa,0x197));var _0xa0af=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0afa[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xa0af('0x0'));var util=require('util');var logger=require(_0xa0af('0x1'))('api');var moment=require(_0xa0af('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0af('0x3'));var rimraf=require('rimraf');var config=require(_0xa0af('0x4'));var attributes=require(_0xa0af('0x5'));module['exports']=function(_0x156be1,_0x1b8082){return _0x156be1[_0xa0af('0x6')](_0xa0af('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 4303ed7..5b3bedf 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 _0xa4a8=['rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0xa4a8,0x143));var _0x8a4a=function(_0x5b12e1,_0x50c67c){_0x5b12e1=_0x5b12e1-0x0;var _0x38f78c=_0xa4a8[_0x5b12e1];return _0x38f78c;};'use strict';var _=require(_0x8a4a('0x0'));var util=require(_0x8a4a('0x1'));var moment=require(_0x8a4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a4a('0x3'));var fs=require('fs');var Redis=require(_0x8a4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a4a('0x5'));var logger=require(_0x8a4a('0x6'))(_0x8a4a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8a4a('0x8'));var client=jayson[_0x8a4a('0x9')][_0x8a4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6b88d8,_0xa6f3f9,_0x3af609){return new BPromise(function(_0x2ec7ae,_0xe53e73){return client[_0x8a4a('0xb')](_0x6b88d8,_0x3af609)[_0x8a4a('0xc')](function(_0x1eeeb7){logger['info'](_0x8a4a('0xd'),_0xa6f3f9,_0x8a4a('0xe'));logger['debug'](_0x8a4a('0xf'),_0xa6f3f9,_0x8a4a('0xe'),JSON[_0x8a4a('0x10')](_0x1eeeb7));if(_0x1eeeb7[_0x8a4a('0x11')]){if(_0x1eeeb7[_0x8a4a('0x11')][_0x8a4a('0x12')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0xa6f3f9,_0x1eeeb7[_0x8a4a('0x11')][_0x8a4a('0x13')]);return _0xe53e73(_0x1eeeb7[_0x8a4a('0x11')][_0x8a4a('0x13')]);}logger[_0x8a4a('0x11')](_0x8a4a('0xd'),_0xa6f3f9,_0x1eeeb7[_0x8a4a('0x11')][_0x8a4a('0x13')]);return _0x2ec7ae(_0x1eeeb7[_0x8a4a('0x11')]['message']);}else{logger[_0x8a4a('0x14')](_0x8a4a('0xd'),_0xa6f3f9,_0x8a4a('0xe'));_0x2ec7ae(_0x1eeeb7[_0x8a4a('0x15')]['message']);}})[_0x8a4a('0x16')](function(_0x4d7ea0){logger[_0x8a4a('0x11')](_0x8a4a('0xd'),_0xa6f3f9,_0x4d7ea0);_0xe53e73(_0x4d7ea0);});});}exports[_0x8a4a('0x17')]=function(_0x599c8c){var _0x147a52=this;return new Promise(function(_0x5bc1f2,_0x5586d8){return db[_0x8a4a('0x18')][_0x8a4a('0x19')](_0x599c8c[_0x8a4a('0x1a')],{'raw':_0x599c8c[_0x8a4a('0x1b')]?_0x599c8c[_0x8a4a('0x1b')][_0x8a4a('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x949d6c){logger[_0x8a4a('0x14')](_0x8a4a('0x17'),_0x599c8c);logger[_0x8a4a('0x1d')](_0x8a4a('0x17'),_0x599c8c,JSON[_0x8a4a('0x10')](_0x949d6c));_0x5bc1f2(_0x949d6c);})['catch'](function(_0x16bf83){logger[_0x8a4a('0x11')](_0x8a4a('0x17'),_0x16bf83[_0x8a4a('0x13')],_0x599c8c);_0x5586d8(_0x147a52[_0x8a4a('0x11')](0x1f4,_0x16bf83['message']));});});}; \ No newline at end of file +var _0xf71c=['lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareMessage','SquareMessage','create','body','options','stringify','catch'];(function(_0x3f7830,_0x2ef515){var _0x392bcf=function(_0x495eb3){while(--_0x495eb3){_0x3f7830['push'](_0x3f7830['shift']());}};_0x392bcf(++_0x2ef515);}(_0xf71c,0xf3));var _0xcf71=function(_0x1e1c72,_0x3d989f){_0x1e1c72=_0x1e1c72-0x0;var _0x501a1c=_0xf71c[_0x1e1c72];return _0x501a1c;};'use strict';var _=require(_0xcf71('0x0'));var util=require(_0xcf71('0x1'));var moment=require(_0xcf71('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf71('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf71('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf71('0x5'))('rpc');var config=require(_0xcf71('0x6'));var jayson=require(_0xcf71('0x7'));var client=jayson[_0xcf71('0x8')][_0xcf71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22d036,_0x491d84,_0x141e8d){return new BPromise(function(_0xcc158c,_0x46b961){return client[_0xcf71('0xa')](_0x22d036,_0x141e8d)['then'](function(_0x56c1d4){logger['info'](_0xcf71('0xb'),_0x491d84,_0xcf71('0xc'));logger[_0xcf71('0xd')](_0xcf71('0xe'),_0x491d84,'request\x20sent',JSON['stringify'](_0x56c1d4));if(_0x56c1d4[_0xcf71('0xf')]){if(_0x56c1d4[_0xcf71('0xf')][_0xcf71('0x10')]===0x1f4){logger[_0xcf71('0xf')]('SquareMessage,\x20%s,\x20%s',_0x491d84,_0x56c1d4[_0xcf71('0xf')][_0xcf71('0x11')]);return _0x46b961(_0x56c1d4[_0xcf71('0xf')][_0xcf71('0x11')]);}logger[_0xcf71('0xf')](_0xcf71('0xb'),_0x491d84,_0x56c1d4['error']['message']);return _0xcc158c(_0x56c1d4[_0xcf71('0xf')][_0xcf71('0x11')]);}else{logger[_0xcf71('0x12')](_0xcf71('0xb'),_0x491d84,_0xcf71('0xc'));_0xcc158c(_0x56c1d4[_0xcf71('0x13')][_0xcf71('0x11')]);}})['catch'](function(_0x45f718){logger[_0xcf71('0xf')](_0xcf71('0xb'),_0x491d84,_0x45f718);_0x46b961(_0x45f718);});});}exports[_0xcf71('0x14')]=function(_0x34423a){var _0x51ac16=this;return new Promise(function(_0x1c25fc,_0x500054){return db[_0xcf71('0x15')][_0xcf71('0x16')](_0x34423a[_0xcf71('0x17')],{'raw':_0x34423a['options']?_0x34423a[_0xcf71('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c09e2){logger[_0xcf71('0x12')](_0xcf71('0x14'),_0x34423a);logger[_0xcf71('0xd')](_0xcf71('0x14'),_0x34423a,JSON[_0xcf71('0x19')](_0x2c09e2));_0x1c25fc(_0x2c09e2);})[_0xcf71('0x1a')](function(_0x4f9617){logger[_0xcf71('0xf')]('CreateSquareMessage',_0x4f9617[_0xcf71('0x11')],_0x34423a);_0x500054(_0x51ac16[_0xcf71('0xf')](0x1f4,_0x4f9617['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7359f25..e28686f 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 _0x3ed9=['15s','test','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show'];(function(_0x5b083b,_0x145a9b){var _0x6c2225=function(_0xcc6435){while(--_0xcc6435){_0x5b083b['push'](_0x5b083b['shift']());}};_0x6c2225(++_0x145a9b);}(_0x3ed9,0xa7));var _0x93ed=function(_0x2b0f81,_0x3917f0){_0x2b0f81=_0x2b0f81-0x0;var _0x5ce74c=_0x3ed9[_0x2b0f81];return _0x5ce74c;};'use strict';var multer=require(_0x93ed('0x0'));var util=require(_0x93ed('0x1'));var path=require(_0x93ed('0x2'));var timeout=require(_0x93ed('0x3'));var express=require(_0x93ed('0x4'));var router=express[_0x93ed('0x5')]();var fs_extra=require(_0x93ed('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x93ed('0x7'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x93ed('0x8')]('/',auth['isAuthenticated'](),controller[_0x93ed('0x9')]);router[_0x93ed('0x8')](_0x93ed('0xa'),auth[_0x93ed('0xb')](),controller[_0x93ed('0xc')]);router[_0x93ed('0x8')]('/:id/test',auth['isAuthenticated'](),timeout(_0x93ed('0xd')),controller[_0x93ed('0xe')]);router['post']('/',auth[_0x93ed('0xb')](),controller[_0x93ed('0xf')]);router[_0x93ed('0x10')](_0x93ed('0xa'),auth[_0x93ed('0xb')](),controller[_0x93ed('0x11')]);router[_0x93ed('0x12')](_0x93ed('0xa'),auth[_0x93ed('0xb')](),controller['destroy']);module[_0x93ed('0x13')]=router; \ No newline at end of file +var _0x52d7=['show','/:id/test','15s','post','create','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x663e9e,_0xe28b42){var _0x98939b=function(_0x1fae70){while(--_0x1fae70){_0x663e9e['push'](_0x663e9e['shift']());}};_0x98939b(++_0xe28b42);}(_0x52d7,0x15d));var _0x752d=function(_0x32088f,_0x538e0a){_0x32088f=_0x32088f-0x0;var _0x43abf1=_0x52d7[_0x32088f];return _0x43abf1;};'use strict';var multer=require(_0x752d('0x0'));var util=require(_0x752d('0x1'));var path=require(_0x752d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x752d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x752d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x752d('0x5'));var controller=require(_0x752d('0x6'));router[_0x752d('0x7')]('/',auth[_0x752d('0x8')](),controller[_0x752d('0x9')]);router['get'](_0x752d('0xa'),auth[_0x752d('0x8')](),controller[_0x752d('0xb')]);router[_0x752d('0x7')](_0x752d('0xc'),auth[_0x752d('0x8')](),timeout(_0x752d('0xd')),controller['test']);router[_0x752d('0xe')]('/',auth[_0x752d('0x8')](),controller[_0x752d('0xf')]);router[_0x752d('0x10')](_0x752d('0xa'),auth['isAuthenticated'](),controller[_0x752d('0x11')]);router['delete']('/:id',auth[_0x752d('0x8')](),controller[_0x752d('0x12')]);module[_0x752d('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8af590a..b59a188 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 _0x56a8=['exports','STRING','sequelize'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x56a8,0x80));var _0x856a=function(_0x30b33,_0x5484d1){_0x30b33=_0x30b33-0x0;var _0x32e2e6=_0x56a8[_0x30b33];return _0x32e2e6;};'use strict';var Sequelize=require(_0x856a('0x0'));module[_0x856a('0x1')]={'name':{'type':Sequelize[_0x856a('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x856a('0x2')]},'description':{'type':Sequelize[_0x856a('0x2')]}}; \ No newline at end of file +var _0x5f00=['STRING','name','sequelize','exports'];(function(_0x276adf,_0x50e2f3){var _0xda28d9=function(_0x14779a){while(--_0x14779a){_0x276adf['push'](_0x276adf['shift']());}};_0xda28d9(++_0x50e2f3);}(_0x5f00,0xae));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x05f0('0x0'));module[_0x05f0('0x1')]={'name':{'type':Sequelize[_0x05f0('0x2')],'unique':_0x05f0('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x05f0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 999d313..958b344 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 _0xff96=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find'];(function(_0x1da80a,_0x4a69bf){var _0x2f2818=function(_0x5ccc95){while(--_0x5ccc95){_0x1da80a['push'](_0x1da80a['shift']());}};_0x2f2818(++_0x4a69bf);}(_0xff96,0x10a));var _0x6ff9=function(_0x2806f6,_0x294105){_0x2806f6=_0x2806f6-0x0;var _0x32ebb1=_0xff96[_0x2806f6];return _0x32ebb1;};'use strict';var emlformat=require(_0x6ff9('0x0'));var rimraf=require(_0x6ff9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff9('0x2'));var rp=require(_0x6ff9('0x3'));var moment=require(_0x6ff9('0x4'));var BPromise=require(_0x6ff9('0x5'));var Mustache=require(_0x6ff9('0x6'));var util=require(_0x6ff9('0x7'));var path=require(_0x6ff9('0x8'));var sox=require('sox');var csv=require(_0x6ff9('0x9'));var ejs=require(_0x6ff9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6ff9('0xb'));var jsforce=require(_0x6ff9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ff9('0x9'));var querystring=require(_0x6ff9('0xd'));var Papa=require('papaparse');var Redis=require(_0x6ff9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6ff9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ff9('0x10'))('api');var utils=require(_0x6ff9('0x11'));var config=require(_0x6ff9('0x12'));var licenseUtil=require(_0x6ff9('0x13'));var db=require(_0x6ff9('0x14'))['db'];function respondWithStatusCode(_0x50ea48,_0x2a3db0){_0x2a3db0=_0x2a3db0||0xcc;return function(_0x28b347){if(_0x28b347){return _0x50ea48[_0x6ff9('0x15')](_0x2a3db0);}return _0x50ea48[_0x6ff9('0x16')](_0x2a3db0)[_0x6ff9('0x17')]();};}function respondWithResult(_0x55a86e,_0x5b9863){_0x5b9863=_0x5b9863||0xc8;return function(_0x3131f6){if(_0x3131f6){return _0x55a86e[_0x6ff9('0x16')](_0x5b9863)[_0x6ff9('0x18')](_0x3131f6);}};}function respondWithFilteredResult(_0x31ebef,_0x15a23b){return function(_0x3a92f8){if(_0x3a92f8){var _0x5a6411=typeof _0x15a23b[_0x6ff9('0x19')]===_0x6ff9('0x1a')&&typeof _0x15a23b['limit']===_0x6ff9('0x1a');var _0x423a46=_0x3a92f8[_0x6ff9('0x1b')];var _0x23c2c8=_0x5a6411?0x0:_0x15a23b[_0x6ff9('0x19')];var _0x5adaea=_0x5a6411?_0x3a92f8[_0x6ff9('0x1b')]:_0x15a23b['offset']+_0x15a23b[_0x6ff9('0x1c')];var _0x354d60;if(_0x5adaea>=_0x423a46){_0x5adaea=_0x423a46;_0x354d60=0xc8;}else{_0x354d60=0xce;}_0x31ebef['status'](_0x354d60);return _0x31ebef[_0x6ff9('0x1d')](_0x6ff9('0x1e'),_0x23c2c8+'-'+_0x5adaea+'/'+_0x423a46)[_0x6ff9('0x18')](_0x3a92f8);}return null;};}function patchUpdates(_0x27a1d0){return function(_0x2d623e){try{jsonpatch['apply'](_0x2d623e,_0x27a1d0,!![]);}catch(_0x55c558){return BPromise['reject'](_0x55c558);}return _0x2d623e[_0x6ff9('0x1f')]();};}function saveUpdates(_0x6e20e7,_0x24dcce){return function(_0x357dac){if(_0x357dac){return _0x357dac[_0x6ff9('0x20')](_0x6e20e7)[_0x6ff9('0x21')](function(_0x341c71){return _0x341c71;});}return null;};}function removeEntity(_0x46f835,_0x195aeb){return function(_0x299938){if(_0x299938){return _0x299938['destroy']()['then'](function(){var _0xfcf95f=_0x299938[_0x6ff9('0x22')]({'plain':!![]});var _0x2af3d4=_0x6ff9('0x23');return db[_0x6ff9('0x24')][_0x6ff9('0x25')]({'where':{'type':_0x2af3d4,'resourceId':_0xfcf95f['id']}})['then'](function(){return _0x299938;});})[_0x6ff9('0x21')](function(){_0x46f835['status'](0xcc)[_0x6ff9('0x17')]();});}};}function handleEntityNotFound(_0x2b69ca,_0x356743){return function(_0x4c239e){if(!_0x4c239e){_0x2b69ca[_0x6ff9('0x15')](0x194);}return _0x4c239e;};}function handleError(_0x389e8d,_0x3d8e6f){_0x3d8e6f=_0x3d8e6f||0x1f4;return function(_0x3af309){logger[_0x6ff9('0x26')](_0x3af309[_0x6ff9('0x27')]);if(_0x3af309['name']){delete _0x3af309[_0x6ff9('0x28')];}_0x389e8d[_0x6ff9('0x16')](_0x3d8e6f)[_0x6ff9('0x29')](_0x3af309);};}exports[_0x6ff9('0x2a')]=function(_0x543592,_0x2acfcb){var _0x58f790={},_0x488032={},_0x460fa6={'count':0x0,'rows':[]};var _0x92fded=_[_0x6ff9('0x2b')](db[_0x6ff9('0x2c')][_0x6ff9('0x2d')],function(_0x4c3d3f){return{'name':_0x4c3d3f[_0x6ff9('0x2e')],'type':_0x4c3d3f[_0x6ff9('0x2f')][_0x6ff9('0x30')]};});_0x488032[_0x6ff9('0x31')]=_[_0x6ff9('0x2b')](_0x92fded,_0x6ff9('0x28'));_0x488032[_0x6ff9('0x32')]=_[_0x6ff9('0x33')](_0x543592[_0x6ff9('0x32')]);_0x488032[_0x6ff9('0x34')]=_[_0x6ff9('0x35')](_0x488032[_0x6ff9('0x31')],_0x488032[_0x6ff9('0x32')]);_0x58f790[_0x6ff9('0x36')]=_[_0x6ff9('0x35')](_0x488032['model'],qs[_0x6ff9('0x37')](_0x543592['query'][_0x6ff9('0x37')]));_0x58f790[_0x6ff9('0x36')]=_0x58f790['attributes']['length']?_0x58f790['attributes']:_0x488032['model'];if(!_0x543592['query']['hasOwnProperty'](_0x6ff9('0x38'))){_0x58f790[_0x6ff9('0x1c')]=qs[_0x6ff9('0x1c')](_0x543592['query'][_0x6ff9('0x1c')]);_0x58f790[_0x6ff9('0x19')]=qs[_0x6ff9('0x19')](_0x543592[_0x6ff9('0x32')][_0x6ff9('0x19')]);}_0x58f790[_0x6ff9('0x39')]=qs[_0x6ff9('0x3a')](_0x543592['query'][_0x6ff9('0x3a')]);_0x58f790['where']=qs[_0x6ff9('0x34')](_[_0x6ff9('0x3b')](_0x543592[_0x6ff9('0x32')],_0x488032[_0x6ff9('0x34')]),_0x92fded);if(_0x543592[_0x6ff9('0x32')][_0x6ff9('0x3c')]){_0x58f790[_0x6ff9('0x3d')]=_[_0x6ff9('0x3e')](_0x58f790['where'],{'$or':_[_0x6ff9('0x2b')](_0x92fded,function(_0xff70ec){if(_0xff70ec[_0x6ff9('0x2f')]!==_0x6ff9('0x3f')){var _0x28f5ea={};_0x28f5ea[_0xff70ec[_0x6ff9('0x28')]]={'$like':'%'+_0x543592[_0x6ff9('0x32')]['filter']+'%'};return _0x28f5ea;}})});}_0x58f790=_[_0x6ff9('0x3e')]({},_0x58f790,_0x543592[_0x6ff9('0x40')]);var _0x433790={'where':_0x58f790[_0x6ff9('0x3d')]};return db[_0x6ff9('0x2c')][_0x6ff9('0x1b')](_0x433790)[_0x6ff9('0x21')](function(_0xf9ba5){_0x460fa6[_0x6ff9('0x1b')]=_0xf9ba5;if(_0x543592[_0x6ff9('0x32')][_0x6ff9('0x41')]){_0x58f790['include']=[{'all':!![]}];}return db[_0x6ff9('0x2c')][_0x6ff9('0x42')](_0x58f790);})['then'](function(_0x5b1f7e){_0x460fa6[_0x6ff9('0x43')]=_0x5b1f7e;return _0x460fa6;})['then'](respondWithFilteredResult(_0x2acfcb,_0x58f790))[_0x6ff9('0x44')](handleError(_0x2acfcb,null));};exports[_0x6ff9('0x45')]=function(_0x59d15d,_0x403153){var _0x477b20={'raw':!![],'where':{'id':_0x59d15d[_0x6ff9('0x46')]['id']}},_0x35c7ff={};_0x35c7ff['model']=_[_0x6ff9('0x33')](db[_0x6ff9('0x2c')][_0x6ff9('0x2d')]);_0x35c7ff[_0x6ff9('0x32')]=_[_0x6ff9('0x33')](_0x59d15d['query']);_0x35c7ff[_0x6ff9('0x34')]=_[_0x6ff9('0x35')](_0x35c7ff['model'],_0x35c7ff[_0x6ff9('0x32')]);_0x477b20[_0x6ff9('0x36')]=_[_0x6ff9('0x35')](_0x35c7ff[_0x6ff9('0x31')],qs[_0x6ff9('0x37')](_0x59d15d[_0x6ff9('0x32')]['fields']));_0x477b20[_0x6ff9('0x36')]=_0x477b20[_0x6ff9('0x36')][_0x6ff9('0x47')]?_0x477b20[_0x6ff9('0x36')]:_0x35c7ff['model'];if(_0x59d15d[_0x6ff9('0x32')]['includeAll']){_0x477b20[_0x6ff9('0x48')]=[{'all':!![]}];}_0x477b20=_[_0x6ff9('0x3e')]({},_0x477b20,_0x59d15d[_0x6ff9('0x40')]);return db[_0x6ff9('0x2c')][_0x6ff9('0x49')](_0x477b20)[_0x6ff9('0x21')](handleEntityNotFound(_0x403153,null))[_0x6ff9('0x21')](respondWithResult(_0x403153,null))[_0x6ff9('0x44')](handleError(_0x403153,null));};exports[_0x6ff9('0x4a')]=function(_0x422b1b,_0x16545a){return db[_0x6ff9('0x2c')][_0x6ff9('0x4a')](_0x422b1b['body'],{})[_0x6ff9('0x21')](function(_0xfe59ec){var _0x3b22fb=_0x422b1b[_0x6ff9('0x4b')][_0x6ff9('0x22')]({'plain':!![]});if(!_0x3b22fb)throw new Error(_0x6ff9('0x4c'));if(_0x3b22fb[_0x6ff9('0x4d')]===_0x6ff9('0x4b')){var _0x20b9b9=_0xfe59ec[_0x6ff9('0x22')]({'plain':!![]});var _0x1616a5=_0x6ff9('0x23');return db[_0x6ff9('0x4e')][_0x6ff9('0x49')]({'where':{'name':_0x1616a5,'userProfileId':_0x3b22fb[_0x6ff9('0x4f')]},'raw':!![]})[_0x6ff9('0x21')](function(_0x347b1e){if(_0x347b1e&&_0x347b1e['autoAssociation']===0x0){return db[_0x6ff9('0x24')][_0x6ff9('0x4a')]({'name':_0x20b9b9[_0x6ff9('0x28')],'resourceId':_0x20b9b9['id'],'type':_0x347b1e[_0x6ff9('0x28')],'sectionId':_0x347b1e['id']},{})[_0x6ff9('0x21')](function(){return _0xfe59ec;});}else{return _0xfe59ec;}})[_0x6ff9('0x44')](function(_0x4ad747){logger[_0x6ff9('0x26')](_0x6ff9('0x50'),_0x4ad747);throw _0x4ad747;});}return _0xfe59ec;})[_0x6ff9('0x21')](respondWithResult(_0x16545a,0xc9))[_0x6ff9('0x44')](handleError(_0x16545a,null));};exports['update']=function(_0xc89058,_0x1a3854){if(_0xc89058[_0x6ff9('0x51')]['id']){delete _0xc89058[_0x6ff9('0x51')]['id'];}return db[_0x6ff9('0x2c')][_0x6ff9('0x49')]({'where':{'id':_0xc89058[_0x6ff9('0x46')]['id']}})[_0x6ff9('0x21')](handleEntityNotFound(_0x1a3854,null))[_0x6ff9('0x21')](saveUpdates(_0xc89058[_0x6ff9('0x51')],null))[_0x6ff9('0x21')](respondWithResult(_0x1a3854,null))['catch'](handleError(_0x1a3854,null));};exports[_0x6ff9('0x25')]=function(_0x519480,_0x36b4f7){return db[_0x6ff9('0x2c')][_0x6ff9('0x49')]({'where':{'id':_0x519480['params']['id']}})[_0x6ff9('0x21')](handleEntityNotFound(_0x36b4f7,null))[_0x6ff9('0x21')](removeEntity(_0x36b4f7,null))[_0x6ff9('0x44')](handleError(_0x36b4f7,null));};exports[_0x6ff9('0x52')]=function(_0xcf7f7a,_0x528d89,_0x59543d){var _0x3bded5;return db[_0x6ff9('0x2c')][_0x6ff9('0x49')]({'where':{'id':_0xcf7f7a[_0x6ff9('0x46')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x528d89,null))[_0x6ff9('0x21')](function(_0x2e8a00){if(_0x2e8a00){var _0x338f34=require(_0x6ff9('0x53'))();_0x338f34['openSync'](_0x2e8a00['dsn']);_0x338f34[_0x6ff9('0x54')]();return _0x2e8a00;}})[_0x6ff9('0x21')](respondWithResult(_0x528d89,null))[_0x6ff9('0x44')](handleError(_0x528d89,null));}; \ No newline at end of file +var _0x3427=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2b8acc,_0x53f96a){var _0x5d9cb1=function(_0x5330d0){while(--_0x5330d0){_0x2b8acc['push'](_0x2b8acc['shift']());}};_0x5d9cb1(++_0x53f96a);}(_0x3427,0x150));var _0x7342=function(_0x43aeda,_0x363bdc){_0x43aeda=_0x43aeda-0x0;var _0x2a7026=_0x3427[_0x43aeda];return _0x2a7026;};'use strict';var emlformat=require(_0x7342('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7342('0x1'));var jsonpatch=require(_0x7342('0x2'));var rp=require(_0x7342('0x3'));var moment=require('moment');var BPromise=require(_0x7342('0x4'));var Mustache=require(_0x7342('0x5'));var util=require(_0x7342('0x6'));var path=require(_0x7342('0x7'));var sox=require('sox');var csv=require(_0x7342('0x8'));var ejs=require(_0x7342('0x9'));var fs=require('fs');var fs_extra=require(_0x7342('0xa'));var _=require(_0x7342('0xb'));var squel=require(_0x7342('0xc'));var crypto=require('crypto');var jsforce=require(_0x7342('0xd'));var deskjs=require(_0x7342('0xe'));var toCsv=require(_0x7342('0x8'));var querystring=require(_0x7342('0xf'));var Papa=require(_0x7342('0x10'));var Redis=require(_0x7342('0x11'));var authService=require(_0x7342('0x12'));var qs=require(_0x7342('0x13'));var as=require(_0x7342('0x14'));var hardwareService=require(_0x7342('0x15'));var logger=require(_0x7342('0x16'))(_0x7342('0x17'));var utils=require(_0x7342('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7342('0x19'));var db=require(_0x7342('0x1a'))['db'];function respondWithStatusCode(_0x22f516,_0x26072a){_0x26072a=_0x26072a||0xcc;return function(_0x43c209){if(_0x43c209){return _0x22f516['sendStatus'](_0x26072a);}return _0x22f516['status'](_0x26072a)[_0x7342('0x1b')]();};}function respondWithResult(_0x12dc64,_0x367a47){_0x367a47=_0x367a47||0xc8;return function(_0x32e02e){if(_0x32e02e){return _0x12dc64[_0x7342('0x1c')](_0x367a47)[_0x7342('0x1d')](_0x32e02e);}};}function respondWithFilteredResult(_0x280287,_0xcb57a0){return function(_0x2f157a){if(_0x2f157a){var _0x34634c=typeof _0xcb57a0[_0x7342('0x1e')]===_0x7342('0x1f')&&typeof _0xcb57a0[_0x7342('0x20')]===_0x7342('0x1f');var _0xd3bbdc=_0x2f157a[_0x7342('0x21')];var _0x2ee002=_0x34634c?0x0:_0xcb57a0['offset'];var _0x4e979d=_0x34634c?_0x2f157a['count']:_0xcb57a0[_0x7342('0x1e')]+_0xcb57a0[_0x7342('0x20')];var _0xc4cd6;if(_0x4e979d>=_0xd3bbdc){_0x4e979d=_0xd3bbdc;_0xc4cd6=0xc8;}else{_0xc4cd6=0xce;}_0x280287['status'](_0xc4cd6);return _0x280287[_0x7342('0x22')]('Content-Range',_0x2ee002+'-'+_0x4e979d+'/'+_0xd3bbdc)['json'](_0x2f157a);}return null;};}function patchUpdates(_0x19a171){return function(_0x186b0a){try{jsonpatch['apply'](_0x186b0a,_0x19a171,!![]);}catch(_0x4fe3ea){return BPromise[_0x7342('0x23')](_0x4fe3ea);}return _0x186b0a[_0x7342('0x24')]();};}function saveUpdates(_0x3b2459,_0x3b5455){return function(_0x25c448){if(_0x25c448){return _0x25c448[_0x7342('0x25')](_0x3b2459)[_0x7342('0x26')](function(_0x1e7064){return _0x1e7064;});}return null;};}function removeEntity(_0x3cc665,_0x1538d6){return function(_0x4da970){if(_0x4da970){return _0x4da970[_0x7342('0x27')]()[_0x7342('0x26')](function(){var _0xce32fb=_0x4da970[_0x7342('0x28')]({'plain':!![]});var _0x21ed8e=_0x7342('0x29');return db[_0x7342('0x2a')][_0x7342('0x27')]({'where':{'type':_0x21ed8e,'resourceId':_0xce32fb['id']}})['then'](function(){return _0x4da970;});})[_0x7342('0x26')](function(){_0x3cc665['status'](0xcc)[_0x7342('0x1b')]();});}};}function handleEntityNotFound(_0x3793ae,_0x4ced0d){return function(_0x8be4ed){if(!_0x8be4ed){_0x3793ae[_0x7342('0x2b')](0x194);}return _0x8be4ed;};}function handleError(_0x1ed720,_0x30770b){_0x30770b=_0x30770b||0x1f4;return function(_0x40583e){logger[_0x7342('0x2c')](_0x40583e[_0x7342('0x2d')]);if(_0x40583e[_0x7342('0x2e')]){delete _0x40583e[_0x7342('0x2e')];}_0x1ed720[_0x7342('0x1c')](_0x30770b)[_0x7342('0x2f')](_0x40583e);};}exports[_0x7342('0x30')]=function(_0x4f0ebe,_0x79e668){var _0x33beff={},_0x13c0be={},_0x298397={'count':0x0,'rows':[]};var _0x5cd971=_['map'](db[_0x7342('0x31')][_0x7342('0x32')],function(_0x18cd5d){return{'name':_0x18cd5d[_0x7342('0x33')],'type':_0x18cd5d['type']['key']};});_0x13c0be[_0x7342('0x34')]=_[_0x7342('0x35')](_0x5cd971,_0x7342('0x2e'));_0x13c0be[_0x7342('0x36')]=_[_0x7342('0x37')](_0x4f0ebe[_0x7342('0x36')]);_0x13c0be[_0x7342('0x38')]=_[_0x7342('0x39')](_0x13c0be[_0x7342('0x34')],_0x13c0be['query']);_0x33beff[_0x7342('0x3a')]=_[_0x7342('0x39')](_0x13c0be['model'],qs[_0x7342('0x3b')](_0x4f0ebe[_0x7342('0x36')]['fields']));_0x33beff[_0x7342('0x3a')]=_0x33beff[_0x7342('0x3a')][_0x7342('0x3c')]?_0x33beff[_0x7342('0x3a')]:_0x13c0be['model'];if(!_0x4f0ebe[_0x7342('0x36')]['hasOwnProperty']('nolimit')){_0x33beff[_0x7342('0x20')]=qs[_0x7342('0x20')](_0x4f0ebe['query'][_0x7342('0x20')]);_0x33beff[_0x7342('0x1e')]=qs[_0x7342('0x1e')](_0x4f0ebe[_0x7342('0x36')][_0x7342('0x1e')]);}_0x33beff[_0x7342('0x3d')]=qs[_0x7342('0x3e')](_0x4f0ebe['query'][_0x7342('0x3e')]);_0x33beff[_0x7342('0x3f')]=qs['filters'](_[_0x7342('0x40')](_0x4f0ebe['query'],_0x13c0be[_0x7342('0x38')]),_0x5cd971);if(_0x4f0ebe[_0x7342('0x36')][_0x7342('0x41')]){_0x33beff[_0x7342('0x3f')]=_[_0x7342('0x42')](_0x33beff[_0x7342('0x3f')],{'$or':_[_0x7342('0x35')](_0x5cd971,function(_0x242871){if(_0x242871[_0x7342('0x43')]!==_0x7342('0x44')){var _0x359f45={};_0x359f45[_0x242871['name']]={'$like':'%'+_0x4f0ebe[_0x7342('0x36')][_0x7342('0x41')]+'%'};return _0x359f45;}})});}_0x33beff=_[_0x7342('0x42')]({},_0x33beff,_0x4f0ebe[_0x7342('0x45')]);var _0x5cf468={'where':_0x33beff[_0x7342('0x3f')]};return db[_0x7342('0x31')][_0x7342('0x21')](_0x5cf468)[_0x7342('0x26')](function(_0x2136a0){_0x298397['count']=_0x2136a0;if(_0x4f0ebe[_0x7342('0x36')]['includeAll']){_0x33beff[_0x7342('0x46')]=[{'all':!![]}];}return db[_0x7342('0x31')][_0x7342('0x47')](_0x33beff);})['then'](function(_0x3552a6){_0x298397[_0x7342('0x48')]=_0x3552a6;return _0x298397;})[_0x7342('0x26')](respondWithFilteredResult(_0x79e668,_0x33beff))[_0x7342('0x49')](handleError(_0x79e668,null));};exports[_0x7342('0x4a')]=function(_0x450b96,_0x499143){var _0x25f37c={'raw':!![],'where':{'id':_0x450b96['params']['id']}},_0x564682={};_0x564682[_0x7342('0x34')]=_['keys'](db[_0x7342('0x31')][_0x7342('0x32')]);_0x564682[_0x7342('0x36')]=_[_0x7342('0x37')](_0x450b96[_0x7342('0x36')]);_0x564682[_0x7342('0x38')]=_[_0x7342('0x39')](_0x564682[_0x7342('0x34')],_0x564682[_0x7342('0x36')]);_0x25f37c[_0x7342('0x3a')]=_[_0x7342('0x39')](_0x564682[_0x7342('0x34')],qs[_0x7342('0x3b')](_0x450b96[_0x7342('0x36')][_0x7342('0x3b')]));_0x25f37c[_0x7342('0x3a')]=_0x25f37c[_0x7342('0x3a')][_0x7342('0x3c')]?_0x25f37c['attributes']:_0x564682[_0x7342('0x34')];if(_0x450b96['query'][_0x7342('0x4b')]){_0x25f37c[_0x7342('0x46')]=[{'all':!![]}];}_0x25f37c=_['merge']({},_0x25f37c,_0x450b96[_0x7342('0x45')]);return db[_0x7342('0x31')]['find'](_0x25f37c)[_0x7342('0x26')](handleEntityNotFound(_0x499143,null))[_0x7342('0x26')](respondWithResult(_0x499143,null))[_0x7342('0x49')](handleError(_0x499143,null));};exports[_0x7342('0x4c')]=function(_0xd68866,_0x3ab229){return db[_0x7342('0x31')]['create'](_0xd68866[_0x7342('0x4d')],{})[_0x7342('0x26')](function(_0x5e47aa){var _0x5873be=_0xd68866['user'][_0x7342('0x28')]({'plain':!![]});if(!_0x5873be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5873be['role']===_0x7342('0x4e')){var _0x325632=_0x5e47aa['get']({'plain':!![]});var _0x58f235=_0x7342('0x29');return db[_0x7342('0x4f')][_0x7342('0x50')]({'where':{'name':_0x58f235,'userProfileId':_0x5873be[_0x7342('0x51')]},'raw':!![]})['then'](function(_0x2a218e){if(_0x2a218e&&_0x2a218e['autoAssociation']===0x0){return db[_0x7342('0x2a')][_0x7342('0x4c')]({'name':_0x325632[_0x7342('0x2e')],'resourceId':_0x325632['id'],'type':_0x2a218e[_0x7342('0x2e')],'sectionId':_0x2a218e['id']},{})[_0x7342('0x26')](function(){return _0x5e47aa;});}else{return _0x5e47aa;}})['catch'](function(_0x25dcaf){logger[_0x7342('0x2c')](_0x7342('0x52'),_0x25dcaf);throw _0x25dcaf;});}return _0x5e47aa;})[_0x7342('0x26')](respondWithResult(_0x3ab229,0xc9))['catch'](handleError(_0x3ab229,null));};exports[_0x7342('0x25')]=function(_0x4992f6,_0x3c48e7){if(_0x4992f6[_0x7342('0x4d')]['id']){delete _0x4992f6[_0x7342('0x4d')]['id'];}return db['SquareOdbc'][_0x7342('0x50')]({'where':{'id':_0x4992f6['params']['id']}})[_0x7342('0x26')](handleEntityNotFound(_0x3c48e7,null))[_0x7342('0x26')](saveUpdates(_0x4992f6['body'],null))[_0x7342('0x26')](respondWithResult(_0x3c48e7,null))[_0x7342('0x49')](handleError(_0x3c48e7,null));};exports[_0x7342('0x27')]=function(_0x41c402,_0x23b7d6){return db[_0x7342('0x31')][_0x7342('0x50')]({'where':{'id':_0x41c402[_0x7342('0x53')]['id']}})[_0x7342('0x26')](handleEntityNotFound(_0x23b7d6,null))[_0x7342('0x26')](removeEntity(_0x23b7d6,null))[_0x7342('0x49')](handleError(_0x23b7d6,null));};exports[_0x7342('0x54')]=function(_0x212553,_0x5b6990,_0x53df35){var _0x5cbbdc;return db[_0x7342('0x31')][_0x7342('0x50')]({'where':{'id':_0x212553[_0x7342('0x53')]['id']},'attributes':['id',_0x7342('0x55')]})[_0x7342('0x26')](handleEntityNotFound(_0x5b6990,null))[_0x7342('0x26')](function(_0x25093b){if(_0x25093b){var _0xf7a181=require(_0x7342('0x56'))();_0xf7a181[_0x7342('0x57')](_0x25093b['dsn']);_0xf7a181[_0x7342('0x58')]();return _0x25093b;}})['then'](respondWithResult(_0x5b6990,null))[_0x7342('0x49')](handleError(_0x5b6990,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index b36d772..cb56e29 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 _0xe9c5=['../../config/environment','./squareOdbc.attributes','define','SquareOdbc','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x188e3b,_0x4b8e01){var _0x5137c9=function(_0x167a06){while(--_0x167a06){_0x188e3b['push'](_0x188e3b['shift']());}};_0x5137c9(++_0x4b8e01);}(_0xe9c5,0x130));var _0x5e9c=function(_0x209fb4,_0x5241b2){_0x209fb4=_0x209fb4-0x0;var _0x572bbb=_0xe9c5[_0x209fb4];return _0x572bbb;};'use strict';var _=require(_0x5e9c('0x0'));var util=require('util');var logger=require(_0x5e9c('0x1'))(_0x5e9c('0x2'));var moment=require(_0x5e9c('0x3'));var BPromise=require(_0x5e9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e9c('0x5'));var config=require(_0x5e9c('0x6'));var attributes=require(_0x5e9c('0x7'));module['exports']=function(_0x396d04,_0x4ca6cb){return _0x396d04[_0x5e9c('0x8')](_0x5e9c('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb90=['square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0xbb90,0xe8));var _0x0bb9=function(_0x536a23,_0x361796){_0x536a23=_0x536a23-0x0;var _0x3569c6=_0xbb90[_0x536a23];return _0x3569c6;};'use strict';var _=require(_0x0bb9('0x0'));var util=require(_0x0bb9('0x1'));var logger=require(_0x0bb9('0x2'))(_0x0bb9('0x3'));var moment=require('moment');var BPromise=require(_0x0bb9('0x4'));var rp=require(_0x0bb9('0x5'));var fs=require('fs');var path=require(_0x0bb9('0x6'));var rimraf=require('rimraf');var config=require(_0x0bb9('0x7'));var attributes=require(_0x0bb9('0x8'));module[_0x0bb9('0x9')]=function(_0x7aa68e,_0x53adc6){return _0x7aa68e['define']('SquareOdbc',attributes,{'tableName':_0x0bb9('0xa'),'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 5891333..5d5f754 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 _0xf4d6=['debug','request\x20sent','stringify','error','code','message','result','catch','find','raw','options','where','map','model','include','attributes','then','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xf4d6,0x166));var _0x6f4d=function(_0x1c194f,_0x3eaef6){_0x1c194f=_0x1c194f-0x0;var _0x4e99b2=_0xf4d6[_0x1c194f];return _0x4e99b2;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var moment=require(_0x6f4d('0x2'));var BPromise=require(_0x6f4d('0x3'));var rs=require(_0x6f4d('0x4'));var fs=require('fs');var Redis=require(_0x6f4d('0x5'));var db=require(_0x6f4d('0x6'))['db'];var utils=require(_0x6f4d('0x7'));var logger=require(_0x6f4d('0x8'))(_0x6f4d('0x9'));var config=require('../../config/environment');var jayson=require(_0x6f4d('0xa'));var client=jayson[_0x6f4d('0xb')][_0x6f4d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45762e,_0x456458,_0x5d72f1){return new BPromise(function(_0x98fcdb,_0x38e57d){return client[_0x6f4d('0xd')](_0x45762e,_0x5d72f1)['then'](function(_0x210a75){logger[_0x6f4d('0xe')](_0x6f4d('0xf'),_0x456458,'request\x20sent');logger[_0x6f4d('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x456458,_0x6f4d('0x11'),JSON[_0x6f4d('0x12')](_0x210a75));if(_0x210a75['error']){if(_0x210a75[_0x6f4d('0x13')][_0x6f4d('0x14')]===0x1f4){logger[_0x6f4d('0x13')](_0x6f4d('0xf'),_0x456458,_0x210a75[_0x6f4d('0x13')]['message']);return _0x38e57d(_0x210a75[_0x6f4d('0x13')][_0x6f4d('0x15')]);}logger[_0x6f4d('0x13')](_0x6f4d('0xf'),_0x456458,_0x210a75[_0x6f4d('0x13')][_0x6f4d('0x15')]);return _0x98fcdb(_0x210a75[_0x6f4d('0x13')][_0x6f4d('0x15')]);}else{logger['info'](_0x6f4d('0xf'),_0x456458,_0x6f4d('0x11'));_0x98fcdb(_0x210a75[_0x6f4d('0x16')][_0x6f4d('0x15')]);}})[_0x6f4d('0x17')](function(_0x159b7e){logger['error'](_0x6f4d('0xf'),_0x456458,_0x159b7e);_0x38e57d(_0x159b7e);});});}exports['ShowSquareOdbc']=function(_0x31ad50){var _0x766b0a=this;return new Promise(function(_0x2f1498,_0xbbc521){return db['SquareOdbc'][_0x6f4d('0x18')]({'raw':_0x31ad50['options']?_0x31ad50['options'][_0x6f4d('0x19')]===undefined?!![]:![]:!![],'where':_0x31ad50[_0x6f4d('0x1a')]?_0x31ad50[_0x6f4d('0x1a')][_0x6f4d('0x1b')]||null:null,'attributes':_0x31ad50['options']?_0x31ad50[_0x6f4d('0x1a')]['attributes']||null:null,'include':_0x31ad50[_0x6f4d('0x1a')]?_0x31ad50[_0x6f4d('0x1a')]['include']?_[_0x6f4d('0x1c')](_0x31ad50[_0x6f4d('0x1a')]['include'],function(_0x52e13d){return{'model':db[_0x52e13d[_0x6f4d('0x1d')]],'as':_0x52e13d['as'],'attributes':_0x52e13d['attributes'],'include':_0x52e13d['include']?_[_0x6f4d('0x1c')](_0x52e13d['include'],function(_0x1c861b){return{'model':db[_0x1c861b[_0x6f4d('0x1d')]],'as':_0x1c861b['as'],'attributes':_0x1c861b['attributes'],'include':_0x1c861b[_0x6f4d('0x1e')]?_['map'](_0x1c861b[_0x6f4d('0x1e')],function(_0x1973fd){return{'model':db[_0x1973fd[_0x6f4d('0x1d')]],'as':_0x1973fd['as'],'attributes':_0x1973fd[_0x6f4d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x20')](function(_0x476af3){logger['info']('ShowSquareOdbc',_0x31ad50);logger[_0x6f4d('0x10')]('ShowSquareOdbc',_0x31ad50,JSON[_0x6f4d('0x12')](_0x476af3));_0x2f1498(_0x476af3);})[_0x6f4d('0x17')](function(_0x710ab9){logger[_0x6f4d('0x13')](_0x6f4d('0x21'),_0x710ab9[_0x6f4d('0x15')],_0x31ad50);_0xbbc521(_0x766b0a[_0x6f4d('0x13')](0x1f4,_0x710ab9[_0x6f4d('0x15')]));});});}; \ No newline at end of file +var _0xfeeb=['stringify','lodash','util','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model'];(function(_0x228bfc,_0x423973){var _0x5f2905=function(_0x67f833){while(--_0x67f833){_0x228bfc['push'](_0x228bfc['shift']());}};_0x5f2905(++_0x423973);}(_0xfeeb,0x9c));var _0xbfee=function(_0x37710c,_0x17fcce){_0x37710c=_0x37710c-0x0;var _0x3ad44e=_0xfeeb[_0x37710c];return _0x3ad44e;};'use strict';var _=require(_0xbfee('0x0'));var util=require(_0xbfee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbfee('0x2'));var fs=require('fs');var Redis=require(_0xbfee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfee('0x4'));var logger=require('../../config/logger')(_0xbfee('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfee('0x6')][_0xbfee('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b7516,_0x489abf,_0x44e903){return new BPromise(function(_0x891237,_0x39649){return client[_0xbfee('0x8')](_0x2b7516,_0x44e903)[_0xbfee('0x9')](function(_0x377c52){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x489abf,_0xbfee('0xa'));logger[_0xbfee('0xb')](_0xbfee('0xc'),_0x489abf,'request\x20sent',JSON['stringify'](_0x377c52));if(_0x377c52[_0xbfee('0xd')]){if(_0x377c52[_0xbfee('0xd')][_0xbfee('0xe')]===0x1f4){logger[_0xbfee('0xd')](_0xbfee('0xf'),_0x489abf,_0x377c52['error'][_0xbfee('0x10')]);return _0x39649(_0x377c52[_0xbfee('0xd')][_0xbfee('0x10')]);}logger[_0xbfee('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x489abf,_0x377c52['error']['message']);return _0x891237(_0x377c52['error']['message']);}else{logger[_0xbfee('0x11')](_0xbfee('0xf'),_0x489abf,_0xbfee('0xa'));_0x891237(_0x377c52[_0xbfee('0x12')][_0xbfee('0x10')]);}})[_0xbfee('0x13')](function(_0x23bcd3){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x489abf,_0x23bcd3);_0x39649(_0x23bcd3);});});}exports[_0xbfee('0x14')]=function(_0x336f02){var _0x435e6f=this;return new Promise(function(_0x158ed4,_0x11954e){return db[_0xbfee('0x15')][_0xbfee('0x16')]({'raw':_0x336f02[_0xbfee('0x17')]?_0x336f02[_0xbfee('0x17')][_0xbfee('0x18')]===undefined?!![]:![]:!![],'where':_0x336f02[_0xbfee('0x17')]?_0x336f02['options'][_0xbfee('0x19')]||null:null,'attributes':_0x336f02[_0xbfee('0x17')]?_0x336f02[_0xbfee('0x17')][_0xbfee('0x1a')]||null:null,'include':_0x336f02[_0xbfee('0x17')]?_0x336f02[_0xbfee('0x17')][_0xbfee('0x1b')]?_[_0xbfee('0x1c')](_0x336f02['options']['include'],function(_0x6e353c){return{'model':db[_0x6e353c[_0xbfee('0x1d')]],'as':_0x6e353c['as'],'attributes':_0x6e353c[_0xbfee('0x1a')],'include':_0x6e353c['include']?_['map'](_0x6e353c[_0xbfee('0x1b')],function(_0x35d5b5){return{'model':db[_0x35d5b5[_0xbfee('0x1d')]],'as':_0x35d5b5['as'],'attributes':_0x35d5b5[_0xbfee('0x1a')],'include':_0x35d5b5[_0xbfee('0x1b')]?_[_0xbfee('0x1c')](_0x35d5b5[_0xbfee('0x1b')],function(_0x2854f){return{'model':db[_0x2854f['model']],'as':_0x2854f['as'],'attributes':_0x2854f[_0xbfee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfee('0x9')](function(_0x9afdb3){logger[_0xbfee('0x11')]('ShowSquareOdbc',_0x336f02);logger[_0xbfee('0xb')](_0xbfee('0x14'),_0x336f02,JSON[_0xbfee('0x1e')](_0x9afdb3));_0x158ed4(_0x9afdb3);})[_0xbfee('0x13')](function(_0x3b44a3){logger[_0xbfee('0xd')](_0xbfee('0x14'),_0x3b44a3[_0xbfee('0x10')],_0x336f02);_0x11954e(_0x435e6f[_0xbfee('0xd')](0x1f4,_0x3b44a3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 69acef8..9685f92 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 _0x288a=['exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./squareProject.controller','get','index','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers'];(function(_0x56bfb7,_0x3e4072){var _0x858e7e=function(_0x5cd0d8){while(--_0x5cd0d8){_0x56bfb7['push'](_0x56bfb7['shift']());}};_0x858e7e(++_0x3e4072);}(_0x288a,0x188));var _0xa288=function(_0x4f257b,_0xfff5c5){_0x4f257b=_0x4f257b-0x0;var _0x4b2909=_0x288a[_0x4f257b];return _0x4b2909;};'use strict';var multer=require('multer');var util=require(_0xa288('0x0'));var path=require(_0xa288('0x1'));var timeout=require(_0xa288('0x2'));var express=require(_0xa288('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa288('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa288('0x5'));var controller=require(_0xa288('0x6'));router[_0xa288('0x7')]('/',auth['isAuthenticated'](),controller[_0xa288('0x8')]);router[_0xa288('0x7')](_0xa288('0x9'),auth['isAuthenticated'](),controller[_0xa288('0xa')]);router[_0xa288('0x7')](_0xa288('0xb'),auth[_0xa288('0xc')](),controller[_0xa288('0xd')]);router[_0xa288('0xe')]('/',auth[_0xa288('0xc')](),controller[_0xa288('0xf')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xa288('0x10')]);router[_0xa288('0x11')]('/:id',auth[_0xa288('0xc')](),controller[_0xa288('0x12')]);router[_0xa288('0x13')](_0xa288('0x9'),auth[_0xa288('0xc')](),controller[_0xa288('0x14')]);router[_0xa288('0x13')](_0xa288('0xb'),auth[_0xa288('0xc')](),controller[_0xa288('0x15')]);module[_0xa288('0x16')]=router; \ No newline at end of file +var _0xfc6d=['removeUsers','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/users','getUsers','post','create','put','update','destroy','delete'];(function(_0x15c818,_0x22bc5a){var _0x26c610=function(_0x9c22ba){while(--_0x9c22ba){_0x15c818['push'](_0x15c818['shift']());}};_0x26c610(++_0x22bc5a);}(_0xfc6d,0x1e6));var _0xdfc6=function(_0x1194c4,_0x598963){_0x1194c4=_0x1194c4-0x0;var _0x32ea56=_0xfc6d[_0x1194c4];return _0x32ea56;};'use strict';var multer=require(_0xdfc6('0x0'));var util=require(_0xdfc6('0x1'));var path=require(_0xdfc6('0x2'));var timeout=require(_0xdfc6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdfc6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfc6('0x5'));var config=require(_0xdfc6('0x6'));var controller=require('./squareProject.controller');router[_0xdfc6('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfc6('0x8')]);router[_0xdfc6('0x7')](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xb')]);router[_0xdfc6('0x7')](_0xdfc6('0xc'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xd')]);router[_0xdfc6('0xe')]('/',auth[_0xdfc6('0xa')](),controller[_0xdfc6('0xf')]);router[_0xdfc6('0xe')](_0xdfc6('0xc'),auth[_0xdfc6('0xa')](),controller['addUsers']);router[_0xdfc6('0x10')](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0x11')]);router['delete'](_0xdfc6('0x9'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0x12')]);router[_0xdfc6('0x13')](_0xdfc6('0xc'),auth[_0xdfc6('0xa')](),controller[_0xdfc6('0x14')]);module[_0xdfc6('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 88ee4b9..903aa3b 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 _0xf319=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','production'];(function(_0x1373a1,_0x44738a){var _0xc4cce3=function(_0x439f2a){while(--_0x439f2a){_0x1373a1['push'](_0x1373a1['shift']());}};_0xc4cce3(++_0x44738a);}(_0xf319,0xe8));var _0x9f31=function(_0x153bf3,_0x5b60c0){_0x153bf3=_0x153bf3-0x0;var _0x571b27=_0xf319[_0x153bf3];return _0x571b27;};'use strict';var Sequelize=require(_0x9f31('0x0'));module[_0x9f31('0x1')]={'name':{'type':Sequelize[_0x9f31('0x2')],'unique':_0x9f31('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9f31('0x2')]},'notes':{'type':Sequelize[_0x9f31('0x4')]},'preproduction':{'type':Sequelize[_0x9f31('0x5')]('long'),'get':function(){if(this[_0x9f31('0x6')](_0x9f31('0x7'))){return this[_0x9f31('0x6')]('preproduction')[_0x9f31('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x9f31('0x5')]('long'),'get':function(){if(this[_0x9f31('0x6')](_0x9f31('0x9'))){return this[_0x9f31('0x6')](_0x9f31('0x9'))[_0x9f31('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x9f31('0xa')]},'publishedAt':{'type':Sequelize[_0x9f31('0xa')]}}; \ No newline at end of file +var _0xa7c5=['toString','DATE','sequelize','STRING','TEXT','BLOB','long','getDataValue','preproduction','utf8','production'];(function(_0x4af527,_0x407cbb){var _0x3acc7c=function(_0x29ef36){while(--_0x29ef36){_0x4af527['push'](_0x4af527['shift']());}};_0x3acc7c(++_0x407cbb);}(_0xa7c5,0x1e6));var _0x5a7c=function(_0x335a18,_0x4522f1){_0x335a18=_0x335a18-0x0;var _0x4fdc71=_0xa7c5[_0x335a18];return _0x4fdc71;};'use strict';var Sequelize=require(_0x5a7c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5a7c('0x1')]},'notes':{'type':Sequelize[_0x5a7c('0x2')]},'preproduction':{'type':Sequelize[_0x5a7c('0x3')](_0x5a7c('0x4')),'get':function(){if(this[_0x5a7c('0x5')](_0x5a7c('0x6'))){return this[_0x5a7c('0x5')](_0x5a7c('0x6'))['toString'](_0x5a7c('0x7'));}}},'production':{'type':Sequelize[_0x5a7c('0x3')]('long'),'get':function(){if(this[_0x5a7c('0x5')](_0x5a7c('0x8'))){return this[_0x5a7c('0x5')](_0x5a7c('0x8'))[_0x5a7c('0x9')](_0x5a7c('0x7'));}}},'savedAt':{'type':Sequelize[_0x5a7c('0xa')]},'publishedAt':{'type':Sequelize[_0x5a7c('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 99faa4e..c22f194 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 _0xdeae=['filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','stack','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','name','query','keys'];(function(_0x41d350,_0x6062e){var _0x19899a=function(_0x4e4b86){while(--_0x4e4b86){_0x41d350['push'](_0x41d350['shift']());}};_0x19899a(++_0x6062e);}(_0xdeae,0x8f));var _0xedea=function(_0x72e04a,_0x398f0b){_0x72e04a=_0x72e04a-0x0;var _0x4e8acf=_0xdeae[_0x72e04a];return _0x4e8acf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedea('0x0'));var zipdir=require(_0xedea('0x1'));var jsonpatch=require(_0xedea('0x2'));var rp=require(_0xedea('0x3'));var moment=require('moment');var BPromise=require(_0xedea('0x4'));var Mustache=require(_0xedea('0x5'));var util=require(_0xedea('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xedea('0x7'));var ejs=require(_0xedea('0x8'));var fs=require('fs');var fs_extra=require(_0xedea('0x9'));var _=require('lodash');var squel=require(_0xedea('0xa'));var crypto=require('crypto');var jsforce=require(_0xedea('0xb'));var deskjs=require(_0xedea('0xc'));var toCsv=require(_0xedea('0x7'));var querystring=require(_0xedea('0xd'));var Papa=require(_0xedea('0xe'));var Redis=require(_0xedea('0xf'));var authService=require(_0xedea('0x10'));var qs=require(_0xedea('0x11'));var as=require(_0xedea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xedea('0x13'))(_0xedea('0x14'));var utils=require(_0xedea('0x15'));var config=require(_0xedea('0x16'));var licenseUtil=require(_0xedea('0x17'));var db=require(_0xedea('0x18'))['db'];config[_0xedea('0x19')]=_['defaults'](config[_0xedea('0x19')],{'host':_0xedea('0x1a'),'port':0x18eb});var socket=require(_0xedea('0x1b'))(new Redis(config[_0xedea('0x19')]));require(_0xedea('0x1c'))['register'](socket);function respondWithStatusCode(_0x4e1f9c,_0x207dae){_0x207dae=_0x207dae||0xcc;return function(_0x5475d0){if(_0x5475d0){return _0x4e1f9c[_0xedea('0x1d')](_0x207dae);}return _0x4e1f9c[_0xedea('0x1e')](_0x207dae)[_0xedea('0x1f')]();};}function respondWithResult(_0x59be48,_0x5cf848){_0x5cf848=_0x5cf848||0xc8;return function(_0x24a5af){if(_0x24a5af){return _0x59be48[_0xedea('0x1e')](_0x5cf848)['json'](_0x24a5af);}};}function respondWithFilteredResult(_0x38c502,_0x78c937){return function(_0x107fae){if(_0x107fae){var _0x770eed=typeof _0x78c937[_0xedea('0x20')]===_0xedea('0x21')&&typeof _0x78c937[_0xedea('0x22')]===_0xedea('0x21');var _0x5e26c3=_0x107fae[_0xedea('0x23')];var _0x5fe765=_0x770eed?0x0:_0x78c937[_0xedea('0x20')];var _0x46bd4f=_0x770eed?_0x107fae[_0xedea('0x23')]:_0x78c937[_0xedea('0x20')]+_0x78c937[_0xedea('0x22')];var _0x5357fb;if(_0x46bd4f>=_0x5e26c3){_0x46bd4f=_0x5e26c3;_0x5357fb=0xc8;}else{_0x5357fb=0xce;}_0x38c502[_0xedea('0x1e')](_0x5357fb);return _0x38c502[_0xedea('0x24')](_0xedea('0x25'),_0x5fe765+'-'+_0x46bd4f+'/'+_0x5e26c3)[_0xedea('0x26')](_0x107fae);}return null;};}function patchUpdates(_0x34f938){return function(_0x59a07a){try{jsonpatch[_0xedea('0x27')](_0x59a07a,_0x34f938,!![]);}catch(_0x3a3685){return BPromise[_0xedea('0x28')](_0x3a3685);}return _0x59a07a[_0xedea('0x29')]();};}function saveUpdates(_0x4e8aa4,_0x3a9bf0){return function(_0x3de3a1){if(_0x3de3a1){return _0x3de3a1[_0xedea('0x2a')](_0x4e8aa4)[_0xedea('0x2b')](function(_0x7a2138){return _0x7a2138;});}return null;};}function removeEntity(_0x285f5e,_0x58ae19){return function(_0x52cc90){if(_0x52cc90){return _0x52cc90[_0xedea('0x2c')]()[_0xedea('0x2b')](function(){var _0x2a967d=_0x52cc90[_0xedea('0x2d')]({'plain':!![]});var _0x2cdffc=_0xedea('0x2e');return db[_0xedea('0x2f')][_0xedea('0x2c')]({'where':{'type':_0x2cdffc,'resourceId':_0x2a967d['id']}})[_0xedea('0x2b')](function(){return _0x52cc90;});})['then'](function(){_0x285f5e[_0xedea('0x1e')](0xcc)[_0xedea('0x1f')]();});}};}function handleEntityNotFound(_0x3f6a93,_0x379d82){return function(_0x2c073c){if(!_0x2c073c){_0x3f6a93[_0xedea('0x1d')](0x194);}return _0x2c073c;};}function handleError(_0x504421,_0x5443eb){_0x5443eb=_0x5443eb||0x1f4;return function(_0x36b41f){logger['error'](_0x36b41f[_0xedea('0x30')]);if(_0x36b41f['name']){delete _0x36b41f['name'];}_0x504421[_0xedea('0x1e')](_0x5443eb)[_0xedea('0x31')](_0x36b41f);};}exports[_0xedea('0x32')]=function(_0x21f23c,_0x1ef38f){var _0x5980ca={},_0x1a7d35={},_0x50cd75={'count':0x0,'rows':[]};var _0x539f89=_[_0xedea('0x33')](db[_0xedea('0x34')][_0xedea('0x35')],function(_0x17aae3){return{'name':_0x17aae3[_0xedea('0x36')],'type':_0x17aae3[_0xedea('0x37')][_0xedea('0x38')]};});_0x1a7d35[_0xedea('0x39')]=_[_0xedea('0x33')](_0x539f89,_0xedea('0x3a'));_0x1a7d35[_0xedea('0x3b')]=_[_0xedea('0x3c')](_0x21f23c['query']);_0x1a7d35[_0xedea('0x3d')]=_[_0xedea('0x3e')](_0x1a7d35[_0xedea('0x39')],_0x1a7d35['query']);_0x5980ca[_0xedea('0x3f')]=_[_0xedea('0x3e')](_0x1a7d35[_0xedea('0x39')],qs[_0xedea('0x40')](_0x21f23c[_0xedea('0x3b')][_0xedea('0x40')]));_0x5980ca[_0xedea('0x3f')]=_0x5980ca['attributes'][_0xedea('0x41')]?_0x5980ca['attributes']:_0x1a7d35[_0xedea('0x39')];if(!_0x21f23c['query']['hasOwnProperty'](_0xedea('0x42'))){_0x5980ca[_0xedea('0x22')]=qs[_0xedea('0x22')](_0x21f23c[_0xedea('0x3b')][_0xedea('0x22')]);_0x5980ca['offset']=qs[_0xedea('0x20')](_0x21f23c[_0xedea('0x3b')]['offset']);}_0x5980ca[_0xedea('0x43')]=qs[_0xedea('0x44')](_0x21f23c[_0xedea('0x3b')][_0xedea('0x44')]);_0x5980ca['where']=qs['filters'](_[_0xedea('0x45')](_0x21f23c[_0xedea('0x3b')],_0x1a7d35['filters']),_0x539f89);if(_0x21f23c['query'][_0xedea('0x46')]){_0x5980ca['where']=_['merge'](_0x5980ca[_0xedea('0x47')],{'$or':_[_0xedea('0x33')](_0x539f89,function(_0x44a9fd){if(_0x44a9fd[_0xedea('0x37')]!==_0xedea('0x48')){var _0x3dcb9e={};_0x3dcb9e[_0x44a9fd[_0xedea('0x3a')]]={'$like':'%'+_0x21f23c[_0xedea('0x3b')][_0xedea('0x46')]+'%'};return _0x3dcb9e;}})});}_0x5980ca=_[_0xedea('0x49')]({},_0x5980ca,_0x21f23c[_0xedea('0x4a')]);var _0x30c7e2={'where':_0x5980ca[_0xedea('0x47')]};return db[_0xedea('0x34')][_0xedea('0x23')](_0x30c7e2)[_0xedea('0x2b')](function(_0x4adc08){_0x50cd75[_0xedea('0x23')]=_0x4adc08;if(_0x21f23c[_0xedea('0x3b')]['includeAll']){_0x5980ca[_0xedea('0x4b')]=[{'all':!![]}];}return db[_0xedea('0x34')][_0xedea('0x4c')](_0x5980ca);})[_0xedea('0x2b')](function(_0x5ad5ed){_0x50cd75[_0xedea('0x4d')]=_0x5ad5ed;return _0x50cd75;})[_0xedea('0x2b')](respondWithFilteredResult(_0x1ef38f,_0x5980ca))[_0xedea('0x4e')](handleError(_0x1ef38f,null));};exports[_0xedea('0x4f')]=function(_0x2a8fad,_0x1f2fa5){var _0x5b5e75={'raw':![],'where':{'id':_0x2a8fad['params']['id']}},_0x85c5f1={};_0x85c5f1[_0xedea('0x39')]=_[_0xedea('0x3c')](db['SquareProject'][_0xedea('0x35')]);_0x85c5f1['query']=_[_0xedea('0x3c')](_0x2a8fad[_0xedea('0x3b')]);_0x85c5f1[_0xedea('0x3d')]=_[_0xedea('0x3e')](_0x85c5f1[_0xedea('0x39')],_0x85c5f1[_0xedea('0x3b')]);_0x5b5e75[_0xedea('0x3f')]=_[_0xedea('0x3e')](_0x85c5f1[_0xedea('0x39')],qs[_0xedea('0x40')](_0x2a8fad[_0xedea('0x3b')][_0xedea('0x40')]));_0x5b5e75['attributes']=_0x5b5e75[_0xedea('0x3f')]['length']?_0x5b5e75[_0xedea('0x3f')]:_0x85c5f1['model'];if(_0x2a8fad['query']['includeAll']){_0x5b5e75[_0xedea('0x4b')]=[{'all':!![]}];}_0x5b5e75=_[_0xedea('0x49')]({},_0x5b5e75,_0x2a8fad[_0xedea('0x4a')]);return db[_0xedea('0x34')][_0xedea('0x50')](_0x5b5e75)[_0xedea('0x2b')](handleEntityNotFound(_0x1f2fa5,null))['then'](respondWithResult(_0x1f2fa5,null))[_0xedea('0x4e')](handleError(_0x1f2fa5,null));};exports[_0xedea('0x51')]=function(_0x3eec08,_0x4451d3){return db[_0xedea('0x34')][_0xedea('0x51')](_0x3eec08[_0xedea('0x52')],{})[_0xedea('0x2b')](function(_0x3f31dc){var _0x5ba762=_0x3eec08[_0xedea('0x53')]['get']({'plain':!![]});if(!_0x5ba762)throw new Error(_0xedea('0x54'));if(_0x5ba762[_0xedea('0x55')]===_0xedea('0x53')){var _0x449c9b=_0x3f31dc[_0xedea('0x2d')]({'plain':!![]});var _0x211320=_0xedea('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x211320,'userProfileId':_0x5ba762[_0xedea('0x56')]},'raw':!![]})[_0xedea('0x2b')](function(_0x468868){if(_0x468868&&_0x468868[_0xedea('0x57')]===0x0){return db[_0xedea('0x2f')]['create']({'name':_0x449c9b[_0xedea('0x3a')],'resourceId':_0x449c9b['id'],'type':_0x468868['name'],'sectionId':_0x468868['id']},{})[_0xedea('0x2b')](function(){return _0x3f31dc;});}else{return _0x3f31dc;}})[_0xedea('0x4e')](function(_0x25f673){logger[_0xedea('0x58')](_0xedea('0x59'),_0x25f673);throw _0x25f673;});}return _0x3f31dc;})[_0xedea('0x2b')](respondWithResult(_0x4451d3,0xc9))[_0xedea('0x4e')](handleError(_0x4451d3,null));};exports[_0xedea('0x2a')]=function(_0x36bea3,_0x3ad05d){if(_0x36bea3[_0xedea('0x52')]['id']){delete _0x36bea3[_0xedea('0x52')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x36bea3[_0xedea('0x5a')]['id']}})[_0xedea('0x2b')](handleEntityNotFound(_0x3ad05d,null))[_0xedea('0x2b')](saveUpdates(_0x36bea3['body'],null))[_0xedea('0x2b')](respondWithResult(_0x3ad05d,null))[_0xedea('0x4e')](handleError(_0x3ad05d,null));};exports[_0xedea('0x2c')]=function(_0x409890,_0x25df70){return db[_0xedea('0x34')][_0xedea('0x50')]({'where':{'id':_0x409890['params']['id']}})['then'](handleEntityNotFound(_0x25df70,null))[_0xedea('0x2b')](removeEntity(_0x25df70,null))[_0xedea('0x4e')](handleError(_0x25df70,null));};exports[_0xedea('0x5b')]=function(_0x10fa89,_0x111ec1,_0x362d1b){return db[_0xedea('0x34')][_0xedea('0x50')]({'where':{'id':_0x10fa89[_0xedea('0x5a')]['id']}})[_0xedea('0x2b')](handleEntityNotFound(_0x111ec1,null))[_0xedea('0x2b')](function(_0x19b813){if(_0x19b813){return _0x19b813[_0xedea('0x5b')](_0x10fa89[_0xedea('0x52')][_0xedea('0x5c')],_[_0xedea('0x5d')](_0x10fa89[_0xedea('0x52')],[_0xedea('0x5c'),'id'])||{});}})[_0xedea('0x2b')](respondWithResult(_0x111ec1,null))['catch'](handleError(_0x111ec1,null));};exports['removeUsers']=function(_0x118166,_0x2cfd45,_0x327dc1){return db[_0xedea('0x34')][_0xedea('0x50')]({'where':{'id':_0x118166[_0xedea('0x5a')]['id']}})[_0xedea('0x2b')](handleEntityNotFound(_0x2cfd45,null))[_0xedea('0x2b')](function(_0x2d67fd){if(_0x2d67fd){return _0x2d67fd[_0xedea('0x5e')](_0x118166['query'][_0xedea('0x5c')])['then'](function(){if(_[_0xedea('0x5f')](_0x118166['query'][_0xedea('0x5c')])){for(var _0x459886=0x0;_0x459886<_0x118166[_0xedea('0x3b')][_0xedea('0x5c')][_0xedea('0x41')];_0x459886+=0x1){socket[_0xedea('0x60')](_0xedea('0x61'),{'UserId':Number(_0x118166['query'][_0xedea('0x5c')][_0x459886]),'SquareProjectId':Number(_0x118166[_0xedea('0x5a')]['id'])});}}else{socket[_0xedea('0x60')](_0xedea('0x61'),{'UserId':Number(_0x118166[_0xedea('0x3b')][_0xedea('0x5c')]),'SquareProjectId':Number(_0x118166[_0xedea('0x5a')]['id'])});}});}})[_0xedea('0x2b')](respondWithStatusCode(_0x2cfd45,null))[_0xedea('0x4e')](handleError(_0x2cfd45,null));};exports[_0xedea('0x62')]=function(_0x34ecb6,_0x52f427,_0x47ee6b){var _0x4120e0={};var _0x25c088={};var _0xe1a02c;var _0x4a5931;return db[_0xedea('0x34')][_0xedea('0x63')]({'where':{'id':_0x34ecb6[_0xedea('0x5a')]['id']}})[_0xedea('0x2b')](handleEntityNotFound(_0x52f427,null))['then'](function(_0x3df9de){if(_0x3df9de){_0xe1a02c=_0x3df9de;_0x25c088[_0xedea('0x39')]=_['keys'](db[_0xedea('0x64')]['rawAttributes']);_0x25c088[_0xedea('0x3b')]=_[_0xedea('0x3c')](_0x34ecb6[_0xedea('0x3b')]);_0x25c088[_0xedea('0x3d')]=_[_0xedea('0x3e')](_0x25c088[_0xedea('0x39')],_0x25c088[_0xedea('0x3b')]);_0x4120e0[_0xedea('0x3f')]=_[_0xedea('0x3e')](_0x25c088[_0xedea('0x39')],qs['fields'](_0x34ecb6[_0xedea('0x3b')][_0xedea('0x40')]));_0x4120e0[_0xedea('0x3f')]=_0x4120e0[_0xedea('0x3f')][_0xedea('0x41')]?_0x4120e0['attributes']:_0x25c088[_0xedea('0x39')];_0x4120e0['order']=qs[_0xedea('0x44')](_0x34ecb6[_0xedea('0x3b')][_0xedea('0x44')]);_0x4120e0[_0xedea('0x47')]=qs['filters'](_['pick'](_0x34ecb6[_0xedea('0x3b')],_0x25c088[_0xedea('0x3d')]));if(_0x34ecb6['query'][_0xedea('0x46')]){_0x4120e0[_0xedea('0x47')]=_[_0xedea('0x49')](_0x4120e0[_0xedea('0x47')],{'$or':_[_0xedea('0x33')](_0x4120e0[_0xedea('0x3f')],function(_0x492106){var _0x4f3fc0={};_0x4f3fc0[_0x492106]={'$like':'%'+_0x34ecb6[_0xedea('0x3b')][_0xedea('0x46')]+'%'};return _0x4f3fc0;})});}_0x4120e0=_[_0xedea('0x49')]({},_0x4120e0,_0x34ecb6[_0xedea('0x4a')]);return _0xe1a02c[_0xedea('0x62')](_0x4120e0);}})['then'](function(_0x45064b){if(_0x45064b){_0x4a5931=_0x45064b[_0xedea('0x41')];if(!_0x34ecb6[_0xedea('0x3b')][_0xedea('0x65')](_0xedea('0x42'))){_0x4120e0[_0xedea('0x22')]=qs['limit'](_0x34ecb6['query'][_0xedea('0x22')]);_0x4120e0[_0xedea('0x20')]=qs[_0xedea('0x20')](_0x34ecb6[_0xedea('0x3b')][_0xedea('0x20')]);}return _0xe1a02c[_0xedea('0x62')](_0x4120e0);}})[_0xedea('0x2b')](function(_0x201506){if(_0x201506){return _0x201506?{'count':_0x4a5931,'rows':_0x201506}:null;}})[_0xedea('0x2b')](respondWithResult(_0x52f427,null))[_0xedea('0x4e')](handleError(_0x52f427,null));}; \ No newline at end of file +var _0xa009=['apply','reject','save','then','destroy','SquareProjects','UserProfileResource','error','stack','name','send','map','SquareProject','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range'];(function(_0x5ce2b9,_0x31f8ff){var _0x70b5c1=function(_0x2058a4){while(--_0x2058a4){_0x5ce2b9['push'](_0x5ce2b9['shift']());}};_0x70b5c1(++_0x31f8ff);}(_0xa009,0xf0));var _0x9a00=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xa009[_0x310504];return _0x5b36d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a00('0x0'));var zipdir=require(_0x9a00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a00('0x2'));var moment=require(_0x9a00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a00('0x4'));var util=require(_0x9a00('0x5'));var path=require('path');var sox=require(_0x9a00('0x6'));var csv=require(_0x9a00('0x7'));var ejs=require(_0x9a00('0x8'));var fs=require('fs');var fs_extra=require(_0x9a00('0x9'));var _=require(_0x9a00('0xa'));var squel=require(_0x9a00('0xb'));var crypto=require(_0x9a00('0xc'));var jsforce=require(_0x9a00('0xd'));var deskjs=require(_0x9a00('0xe'));var toCsv=require(_0x9a00('0x7'));var querystring=require(_0x9a00('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9a00('0x10'));var qs=require(_0x9a00('0x11'));var as=require(_0x9a00('0x12'));var hardwareService=require(_0x9a00('0x13'));var logger=require(_0x9a00('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9a00('0x15'));var licenseUtil=require(_0x9a00('0x16'));var db=require('../../mysqldb')['db'];config[_0x9a00('0x17')]=_[_0x9a00('0x18')](config[_0x9a00('0x17')],{'host':_0x9a00('0x19'),'port':0x18eb});var socket=require(_0x9a00('0x1a'))(new Redis(config[_0x9a00('0x17')]));require(_0x9a00('0x1b'))['register'](socket);function respondWithStatusCode(_0x2d9d86,_0x35f507){_0x35f507=_0x35f507||0xcc;return function(_0x4e337b){if(_0x4e337b){return _0x2d9d86[_0x9a00('0x1c')](_0x35f507);}return _0x2d9d86[_0x9a00('0x1d')](_0x35f507)[_0x9a00('0x1e')]();};}function respondWithResult(_0x58c295,_0x3b3710){_0x3b3710=_0x3b3710||0xc8;return function(_0x17e598){if(_0x17e598){return _0x58c295['status'](_0x3b3710)[_0x9a00('0x1f')](_0x17e598);}};}function respondWithFilteredResult(_0x33f41a,_0x45d7b8){return function(_0x367a10){if(_0x367a10){var _0xe33eb5=typeof _0x45d7b8['offset']===_0x9a00('0x20')&&typeof _0x45d7b8[_0x9a00('0x21')]===_0x9a00('0x20');var _0x2e8504=_0x367a10['count'];var _0x3fe53f=_0xe33eb5?0x0:_0x45d7b8[_0x9a00('0x22')];var _0x2198aa=_0xe33eb5?_0x367a10['count']:_0x45d7b8[_0x9a00('0x22')]+_0x45d7b8[_0x9a00('0x21')];var _0x1e1c4a;if(_0x2198aa>=_0x2e8504){_0x2198aa=_0x2e8504;_0x1e1c4a=0xc8;}else{_0x1e1c4a=0xce;}_0x33f41a[_0x9a00('0x1d')](_0x1e1c4a);return _0x33f41a['set'](_0x9a00('0x23'),_0x3fe53f+'-'+_0x2198aa+'/'+_0x2e8504)[_0x9a00('0x1f')](_0x367a10);}return null;};}function patchUpdates(_0x44d7d1){return function(_0x1ec6c4){try{jsonpatch[_0x9a00('0x24')](_0x1ec6c4,_0x44d7d1,!![]);}catch(_0x9aaf18){return BPromise[_0x9a00('0x25')](_0x9aaf18);}return _0x1ec6c4[_0x9a00('0x26')]();};}function saveUpdates(_0x41721d,_0x363cb1){return function(_0x1dbe03){if(_0x1dbe03){return _0x1dbe03['update'](_0x41721d)[_0x9a00('0x27')](function(_0x58b729){return _0x58b729;});}return null;};}function removeEntity(_0x3708bd,_0x686de3){return function(_0x38a196){if(_0x38a196){return _0x38a196[_0x9a00('0x28')]()['then'](function(){var _0xd1da5a=_0x38a196['get']({'plain':!![]});var _0xc7352c=_0x9a00('0x29');return db[_0x9a00('0x2a')][_0x9a00('0x28')]({'where':{'type':_0xc7352c,'resourceId':_0xd1da5a['id']}})['then'](function(){return _0x38a196;});})[_0x9a00('0x27')](function(){_0x3708bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a670,_0x296694){return function(_0x4c921a){if(!_0x4c921a){_0x26a670[_0x9a00('0x1c')](0x194);}return _0x4c921a;};}function handleError(_0x575fed,_0x3f2ed8){_0x3f2ed8=_0x3f2ed8||0x1f4;return function(_0x517660){logger[_0x9a00('0x2b')](_0x517660[_0x9a00('0x2c')]);if(_0x517660[_0x9a00('0x2d')]){delete _0x517660[_0x9a00('0x2d')];}_0x575fed[_0x9a00('0x1d')](_0x3f2ed8)[_0x9a00('0x2e')](_0x517660);};}exports['index']=function(_0x296700,_0x5ef8db){var _0x4086d2={},_0x157a00={},_0x3d285a={'count':0x0,'rows':[]};var _0x53ee35=_[_0x9a00('0x2f')](db[_0x9a00('0x30')]['rawAttributes'],function(_0x24a5ef){return{'name':_0x24a5ef[_0x9a00('0x31')],'type':_0x24a5ef['type']['key']};});_0x157a00['model']=_[_0x9a00('0x2f')](_0x53ee35,'name');_0x157a00[_0x9a00('0x32')]=_[_0x9a00('0x33')](_0x296700[_0x9a00('0x32')]);_0x157a00[_0x9a00('0x34')]=_[_0x9a00('0x35')](_0x157a00[_0x9a00('0x36')],_0x157a00[_0x9a00('0x32')]);_0x4086d2[_0x9a00('0x37')]=_['intersection'](_0x157a00[_0x9a00('0x36')],qs[_0x9a00('0x38')](_0x296700[_0x9a00('0x32')][_0x9a00('0x38')]));_0x4086d2[_0x9a00('0x37')]=_0x4086d2['attributes'][_0x9a00('0x39')]?_0x4086d2[_0x9a00('0x37')]:_0x157a00[_0x9a00('0x36')];if(!_0x296700[_0x9a00('0x32')][_0x9a00('0x3a')](_0x9a00('0x3b'))){_0x4086d2[_0x9a00('0x21')]=qs['limit'](_0x296700[_0x9a00('0x32')][_0x9a00('0x21')]);_0x4086d2[_0x9a00('0x22')]=qs[_0x9a00('0x22')](_0x296700['query']['offset']);}_0x4086d2[_0x9a00('0x3c')]=qs[_0x9a00('0x3d')](_0x296700['query'][_0x9a00('0x3d')]);_0x4086d2[_0x9a00('0x3e')]=qs['filters'](_['pick'](_0x296700[_0x9a00('0x32')],_0x157a00['filters']),_0x53ee35);if(_0x296700['query'][_0x9a00('0x3f')]){_0x4086d2[_0x9a00('0x3e')]=_[_0x9a00('0x40')](_0x4086d2[_0x9a00('0x3e')],{'$or':_[_0x9a00('0x2f')](_0x53ee35,function(_0xf53c4d){if(_0xf53c4d['type']!=='VIRTUAL'){var _0x9c2815={};_0x9c2815[_0xf53c4d[_0x9a00('0x2d')]]={'$like':'%'+_0x296700[_0x9a00('0x32')][_0x9a00('0x3f')]+'%'};return _0x9c2815;}})});}_0x4086d2=_[_0x9a00('0x40')]({},_0x4086d2,_0x296700[_0x9a00('0x41')]);var _0x451bdf={'where':_0x4086d2[_0x9a00('0x3e')]};return db['SquareProject'][_0x9a00('0x42')](_0x451bdf)[_0x9a00('0x27')](function(_0x23ba9d){_0x3d285a[_0x9a00('0x42')]=_0x23ba9d;if(_0x296700[_0x9a00('0x32')][_0x9a00('0x43')]){_0x4086d2[_0x9a00('0x44')]=[{'all':!![]}];}return db[_0x9a00('0x30')][_0x9a00('0x45')](_0x4086d2);})['then'](function(_0x433899){_0x3d285a['rows']=_0x433899;return _0x3d285a;})[_0x9a00('0x27')](respondWithFilteredResult(_0x5ef8db,_0x4086d2))[_0x9a00('0x46')](handleError(_0x5ef8db,null));};exports[_0x9a00('0x47')]=function(_0x37053e,_0x26410a){var _0xd465f={'raw':![],'where':{'id':_0x37053e[_0x9a00('0x48')]['id']}},_0x38d30f={};_0x38d30f[_0x9a00('0x36')]=_[_0x9a00('0x33')](db['SquareProject'][_0x9a00('0x49')]);_0x38d30f[_0x9a00('0x32')]=_[_0x9a00('0x33')](_0x37053e[_0x9a00('0x32')]);_0x38d30f['filters']=_[_0x9a00('0x35')](_0x38d30f[_0x9a00('0x36')],_0x38d30f[_0x9a00('0x32')]);_0xd465f[_0x9a00('0x37')]=_[_0x9a00('0x35')](_0x38d30f['model'],qs[_0x9a00('0x38')](_0x37053e[_0x9a00('0x32')][_0x9a00('0x38')]));_0xd465f[_0x9a00('0x37')]=_0xd465f[_0x9a00('0x37')][_0x9a00('0x39')]?_0xd465f[_0x9a00('0x37')]:_0x38d30f[_0x9a00('0x36')];if(_0x37053e[_0x9a00('0x32')][_0x9a00('0x43')]){_0xd465f[_0x9a00('0x44')]=[{'all':!![]}];}_0xd465f=_[_0x9a00('0x40')]({},_0xd465f,_0x37053e[_0x9a00('0x41')]);return db[_0x9a00('0x30')][_0x9a00('0x4a')](_0xd465f)[_0x9a00('0x27')](handleEntityNotFound(_0x26410a,null))[_0x9a00('0x27')](respondWithResult(_0x26410a,null))[_0x9a00('0x46')](handleError(_0x26410a,null));};exports['create']=function(_0x44f4da,_0x33dce0){return db[_0x9a00('0x30')][_0x9a00('0x4b')](_0x44f4da[_0x9a00('0x4c')],{})[_0x9a00('0x27')](function(_0xb3c93e){var _0x1a1cfc=_0x44f4da['user']['get']({'plain':!![]});if(!_0x1a1cfc)throw new Error(_0x9a00('0x4d'));if(_0x1a1cfc[_0x9a00('0x4e')]===_0x9a00('0x4f')){var _0xa162b2=_0xb3c93e['get']({'plain':!![]});var _0x7774cd=_0x9a00('0x29');return db[_0x9a00('0x50')]['find']({'where':{'name':_0x7774cd,'userProfileId':_0x1a1cfc[_0x9a00('0x51')]},'raw':!![]})[_0x9a00('0x27')](function(_0xe69226){if(_0xe69226&&_0xe69226['autoAssociation']===0x0){return db[_0x9a00('0x2a')][_0x9a00('0x4b')]({'name':_0xa162b2['name'],'resourceId':_0xa162b2['id'],'type':_0xe69226['name'],'sectionId':_0xe69226['id']},{})[_0x9a00('0x27')](function(){return _0xb3c93e;});}else{return _0xb3c93e;}})[_0x9a00('0x46')](function(_0x3a9e31){logger['error'](_0x9a00('0x52'),_0x3a9e31);throw _0x3a9e31;});}return _0xb3c93e;})[_0x9a00('0x27')](respondWithResult(_0x33dce0,0xc9))[_0x9a00('0x46')](handleError(_0x33dce0,null));};exports['update']=function(_0x25a83a,_0x4d0f3e){if(_0x25a83a[_0x9a00('0x4c')]['id']){delete _0x25a83a['body']['id'];}return db['SquareProject'][_0x9a00('0x4a')]({'where':{'id':_0x25a83a[_0x9a00('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d0f3e,null))[_0x9a00('0x27')](saveUpdates(_0x25a83a[_0x9a00('0x4c')],null))['then'](respondWithResult(_0x4d0f3e,null))[_0x9a00('0x46')](handleError(_0x4d0f3e,null));};exports[_0x9a00('0x28')]=function(_0x5d214d,_0x1f5bf9){return db[_0x9a00('0x30')][_0x9a00('0x4a')]({'where':{'id':_0x5d214d[_0x9a00('0x48')]['id']}})[_0x9a00('0x27')](handleEntityNotFound(_0x1f5bf9,null))[_0x9a00('0x27')](removeEntity(_0x1f5bf9,null))[_0x9a00('0x46')](handleError(_0x1f5bf9,null));};exports[_0x9a00('0x53')]=function(_0x3d2ca7,_0x3bcc81,_0xe16781){return db[_0x9a00('0x30')][_0x9a00('0x4a')]({'where':{'id':_0x3d2ca7['params']['id']}})['then'](handleEntityNotFound(_0x3bcc81,null))[_0x9a00('0x27')](function(_0x2ba666){if(_0x2ba666){return _0x2ba666[_0x9a00('0x53')](_0x3d2ca7[_0x9a00('0x4c')]['ids'],_[_0x9a00('0x54')](_0x3d2ca7[_0x9a00('0x4c')],[_0x9a00('0x55'),'id'])||{});}})[_0x9a00('0x27')](respondWithResult(_0x3bcc81,null))[_0x9a00('0x46')](handleError(_0x3bcc81,null));};exports[_0x9a00('0x56')]=function(_0x4fe3be,_0x5e183e,_0x2e3bb9){return db[_0x9a00('0x30')]['find']({'where':{'id':_0x4fe3be[_0x9a00('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e183e,null))['then'](function(_0x50cf97){if(_0x50cf97){return _0x50cf97['removeUsers'](_0x4fe3be[_0x9a00('0x32')][_0x9a00('0x55')])[_0x9a00('0x27')](function(){if(_[_0x9a00('0x57')](_0x4fe3be[_0x9a00('0x32')][_0x9a00('0x55')])){for(var _0x461134=0x0;_0x461134<_0x4fe3be['query'][_0x9a00('0x55')][_0x9a00('0x39')];_0x461134+=0x1){socket[_0x9a00('0x58')](_0x9a00('0x59'),{'UserId':Number(_0x4fe3be['query'][_0x9a00('0x55')][_0x461134]),'SquareProjectId':Number(_0x4fe3be[_0x9a00('0x48')]['id'])});}}else{socket[_0x9a00('0x58')](_0x9a00('0x59'),{'UserId':Number(_0x4fe3be[_0x9a00('0x32')][_0x9a00('0x55')]),'SquareProjectId':Number(_0x4fe3be[_0x9a00('0x48')]['id'])});}});}})[_0x9a00('0x27')](respondWithStatusCode(_0x5e183e,null))[_0x9a00('0x46')](handleError(_0x5e183e,null));};exports[_0x9a00('0x5a')]=function(_0x116eb0,_0x4946dd,_0x1a2db3){var _0x43359b={};var _0x390b3a={};var _0x1eb321;var _0x487ca9;return db[_0x9a00('0x30')]['findOne']({'where':{'id':_0x116eb0['params']['id']}})[_0x9a00('0x27')](handleEntityNotFound(_0x4946dd,null))['then'](function(_0x241308){if(_0x241308){_0x1eb321=_0x241308;_0x390b3a['model']=_[_0x9a00('0x33')](db[_0x9a00('0x5b')][_0x9a00('0x49')]);_0x390b3a['query']=_[_0x9a00('0x33')](_0x116eb0[_0x9a00('0x32')]);_0x390b3a['filters']=_[_0x9a00('0x35')](_0x390b3a[_0x9a00('0x36')],_0x390b3a[_0x9a00('0x32')]);_0x43359b['attributes']=_[_0x9a00('0x35')](_0x390b3a[_0x9a00('0x36')],qs[_0x9a00('0x38')](_0x116eb0[_0x9a00('0x32')][_0x9a00('0x38')]));_0x43359b[_0x9a00('0x37')]=_0x43359b[_0x9a00('0x37')][_0x9a00('0x39')]?_0x43359b[_0x9a00('0x37')]:_0x390b3a[_0x9a00('0x36')];_0x43359b[_0x9a00('0x3c')]=qs[_0x9a00('0x3d')](_0x116eb0['query'][_0x9a00('0x3d')]);_0x43359b[_0x9a00('0x3e')]=qs[_0x9a00('0x34')](_['pick'](_0x116eb0[_0x9a00('0x32')],_0x390b3a[_0x9a00('0x34')]));if(_0x116eb0['query']['filter']){_0x43359b[_0x9a00('0x3e')]=_[_0x9a00('0x40')](_0x43359b['where'],{'$or':_['map'](_0x43359b[_0x9a00('0x37')],function(_0x21c5e1){var _0x301ce0={};_0x301ce0[_0x21c5e1]={'$like':'%'+_0x116eb0[_0x9a00('0x32')][_0x9a00('0x3f')]+'%'};return _0x301ce0;})});}_0x43359b=_[_0x9a00('0x40')]({},_0x43359b,_0x116eb0[_0x9a00('0x41')]);return _0x1eb321[_0x9a00('0x5a')](_0x43359b);}})[_0x9a00('0x27')](function(_0x4069c9){if(_0x4069c9){_0x487ca9=_0x4069c9[_0x9a00('0x39')];if(!_0x116eb0[_0x9a00('0x32')][_0x9a00('0x3a')](_0x9a00('0x3b'))){_0x43359b['limit']=qs[_0x9a00('0x21')](_0x116eb0[_0x9a00('0x32')][_0x9a00('0x21')]);_0x43359b[_0x9a00('0x22')]=qs[_0x9a00('0x22')](_0x116eb0[_0x9a00('0x32')][_0x9a00('0x22')]);}return _0x1eb321[_0x9a00('0x5a')](_0x43359b);}})[_0x9a00('0x27')](function(_0x1d6e02){if(_0x1d6e02){return _0x1d6e02?{'count':_0x487ca9,'rows':_0x1d6e02}:null;}})[_0x9a00('0x27')](respondWithResult(_0x4946dd,null))[_0x9a00('0x46')](handleError(_0x4946dd,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index dd2626b..e4bbb13 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 _0x23b3=['remove','emit','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x2a18ab,_0xae4224){var _0x5d7db8=function(_0x21ccb2){while(--_0x21ccb2){_0x2a18ab['push'](_0x2a18ab['shift']());}};_0x5d7db8(++_0xae4224);}(_0x23b3,0x1cf));var _0x323b=function(_0x2100d6,_0x55362c){_0x2100d6=_0x2100d6-0x0;var _0x298ddd=_0x23b3[_0x2100d6];return _0x298ddd;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x323b('0x0'))['db'][_0x323b('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x323b('0x2')](0x0);var events={'afterCreate':_0x323b('0x3'),'afterUpdate':_0x323b('0x4'),'afterDestroy':_0x323b('0x5')};function emitEvent(_0x254211){return function(_0x28f1b3,_0x43d98d,_0x1ab644){SquareProjectEvents[_0x323b('0x6')](_0x254211+':'+_0x28f1b3['id'],_0x28f1b3);SquareProjectEvents[_0x323b('0x6')](_0x254211,_0x28f1b3);_0x1ab644(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x323b('0x7')](e,emitEvent(event));}}module[_0x323b('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xf9b0=['hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','emit'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xf9b0,0xe2));var _0x0f9b=function(_0x2a4603,_0x20e6f2){_0x2a4603=_0x2a4603-0x0;var _0x12afe9=_0xf9b0[_0x2a4603];return _0x12afe9;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x0f9b('0x0'))['db'][_0x0f9b('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0f9b('0x2')](0x0);var events={'afterCreate':_0x0f9b('0x3'),'afterUpdate':_0x0f9b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d7e56){return function(_0x560f2e,_0x234a99,_0x67ecf9){SquareProjectEvents[_0x0f9b('0x5')](_0x5d7e56+':'+_0x560f2e['id'],_0x560f2e);SquareProjectEvents[_0x0f9b('0x5')](_0x5d7e56,_0x560f2e);_0x67ecf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0f9b('0x6')](e,emitEvent(event));}}module[_0x0f9b('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index da04d01..4c01a63 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 _0xd703=['exports','define','SquareProject','changed','preproduction','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xd703,0x113));var _0x3d70=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xd703[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x3d70('0x0'));var util=require(_0x3d70('0x1'));var logger=require(_0x3d70('0x2'))('api');var moment=require(_0x3d70('0x3'));var BPromise=require(_0x3d70('0x4'));var rp=require(_0x3d70('0x5'));var fs=require('fs');var path=require(_0x3d70('0x6'));var rimraf=require(_0x3d70('0x7'));var config=require(_0x3d70('0x8'));var attributes=require(_0x3d70('0x9'));module[_0x3d70('0xa')]=function(_0x1e093b,_0x3b487d){return _0x1e093b[_0x3d70('0xb')](_0x3d70('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59a655,_0x59cce0,_0xf22964){if(_0x59a655[_0x3d70('0xd')](_0x3d70('0xe'))){_0x59a655[_0x3d70('0xf')]=moment()[_0x3d70('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x59a655['changed'](_0x3d70('0x11'))){_0x59a655['publishedAt']=moment()[_0x3d70('0x10')](_0x3d70('0x12'));}_0xf22964(null,_0x59a655);}}});}; \ No newline at end of file +var _0x7d4a=['define','SquareProject','square_projects','changed','preproduction','savedAt','format','production','publishedAt','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7d4a,0x14c));var _0xa7d4=function(_0x3d97ed,_0x30947d){_0x3d97ed=_0x3d97ed-0x0;var _0x3c4fa1=_0x7d4a[_0x3d97ed];return _0x3c4fa1;};'use strict';var _=require('lodash');var util=require(_0xa7d4('0x0'));var logger=require(_0xa7d4('0x1'))('api');var moment=require(_0xa7d4('0x2'));var BPromise=require('bluebird');var rp=require(_0xa7d4('0x3'));var fs=require('fs');var path=require(_0xa7d4('0x4'));var rimraf=require(_0xa7d4('0x5'));var config=require(_0xa7d4('0x6'));var attributes=require(_0xa7d4('0x7'));module['exports']=function(_0x41dd41,_0x543e56){return _0x41dd41[_0xa7d4('0x8')](_0xa7d4('0x9'),attributes,{'tableName':_0xa7d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e10bd,_0x521c34,_0x521a03){if(_0x3e10bd[_0xa7d4('0xb')](_0xa7d4('0xc'))){_0x3e10bd[_0xa7d4('0xd')]=moment()[_0xa7d4('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e10bd[_0xa7d4('0xb')](_0xa7d4('0xf'))){_0x3e10bd[_0xa7d4('0x10')]=moment()[_0xa7d4('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x521a03(null,_0x3e10bd);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0bdd3f2..e26c17f 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 _0xd68c=['error','code','message','catch','ShowSquareProject','SquareProject','options','raw','attributes','map','include','model','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x83bf26,_0x1fc049){var _0xaf25f8=function(_0x5dd993){while(--_0x5dd993){_0x83bf26['push'](_0x83bf26['shift']());}};_0xaf25f8(++_0x1fc049);}(_0xd68c,0x9c));var _0xcd68=function(_0x293440,_0x357eff){_0x293440=_0x293440-0x0;var _0x596af9=_0xd68c[_0x293440];return _0x596af9;};'use strict';var _=require(_0xcd68('0x0'));var util=require(_0xcd68('0x1'));var moment=require(_0xcd68('0x2'));var BPromise=require(_0xcd68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd68('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd68('0x5'))('rpc');var config=require(_0xcd68('0x6'));var jayson=require(_0xcd68('0x7'));var client=jayson[_0xcd68('0x8')][_0xcd68('0x9')]({'port':0x232a});config[_0xcd68('0xa')]=_[_0xcd68('0xb')](config[_0xcd68('0xa')],{'host':_0xcd68('0xc'),'port':0x18eb});var socket=require(_0xcd68('0xd'))(new Redis(config[_0xcd68('0xa')]));require(_0xcd68('0xe'))[_0xcd68('0xf')](socket);function respondWithRpcPromise(_0x4e5518,_0x5df442,_0x1c8ab7){return new BPromise(function(_0x1b8c40,_0x1f8c4a){return client[_0xcd68('0x10')](_0x4e5518,_0x1c8ab7)[_0xcd68('0x11')](function(_0x2f35ba){logger[_0xcd68('0x12')](_0xcd68('0x13'),_0x5df442,_0xcd68('0x14'));logger[_0xcd68('0x15')](_0xcd68('0x16'),_0x5df442,'request\x20sent',JSON[_0xcd68('0x17')](_0x2f35ba));if(_0x2f35ba[_0xcd68('0x18')]){if(_0x2f35ba[_0xcd68('0x18')][_0xcd68('0x19')]===0x1f4){logger[_0xcd68('0x18')](_0xcd68('0x13'),_0x5df442,_0x2f35ba[_0xcd68('0x18')][_0xcd68('0x1a')]);return _0x1f8c4a(_0x2f35ba[_0xcd68('0x18')][_0xcd68('0x1a')]);}logger[_0xcd68('0x18')](_0xcd68('0x13'),_0x5df442,_0x2f35ba[_0xcd68('0x18')]['message']);return _0x1b8c40(_0x2f35ba[_0xcd68('0x18')][_0xcd68('0x1a')]);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x5df442,'request\x20sent');_0x1b8c40(_0x2f35ba['result'][_0xcd68('0x1a')]);}})[_0xcd68('0x1b')](function(_0x3b5b1d){logger[_0xcd68('0x18')](_0xcd68('0x13'),_0x5df442,_0x3b5b1d);_0x1f8c4a(_0x3b5b1d);});});}exports[_0xcd68('0x1c')]=function(_0x57488b){var _0xd5f687=this;return new Promise(function(_0x4c7d45,_0x11857b){return db[_0xcd68('0x1d')]['find']({'raw':_0x57488b[_0xcd68('0x1e')]?_0x57488b[_0xcd68('0x1e')][_0xcd68('0x1f')]===undefined?!![]:![]:!![],'where':_0x57488b['options']?_0x57488b[_0xcd68('0x1e')]['where']||null:null,'attributes':_0x57488b['options']?_0x57488b[_0xcd68('0x1e')][_0xcd68('0x20')]||null:null,'include':_0x57488b[_0xcd68('0x1e')]?_0x57488b[_0xcd68('0x1e')]['include']?_[_0xcd68('0x21')](_0x57488b[_0xcd68('0x1e')][_0xcd68('0x22')],function(_0x5ea918){return{'model':db[_0x5ea918['model']],'as':_0x5ea918['as'],'attributes':_0x5ea918[_0xcd68('0x20')],'include':_0x5ea918[_0xcd68('0x22')]?_[_0xcd68('0x21')](_0x5ea918[_0xcd68('0x22')],function(_0x35fc65){return{'model':db[_0x35fc65[_0xcd68('0x23')]],'as':_0x35fc65['as'],'attributes':_0x35fc65[_0xcd68('0x20')],'include':_0x35fc65[_0xcd68('0x22')]?_[_0xcd68('0x21')](_0x35fc65[_0xcd68('0x22')],function(_0x250dc0){return{'model':db[_0x250dc0['model']],'as':_0x250dc0['as'],'attributes':_0x250dc0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55facb){logger[_0xcd68('0x12')](_0xcd68('0x1c'),_0x57488b);logger[_0xcd68('0x15')]('ShowSquareProject',_0x57488b,JSON['stringify'](_0x55facb));_0x4c7d45(_0x55facb);})['catch'](function(_0x16fb24){logger['error'](_0xcd68('0x1c'),_0x16fb24[_0xcd68('0x1a')],_0x57488b);_0x11857b(_0xd5f687[_0xcd68('0x18')](0x1f4,_0x16fb24[_0xcd68('0x1a')]));});});}; \ No newline at end of file +var _0xaa55=['ShowSquareProject','SquareProject','find','options','raw','where','include','attributes','model','map','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch'];(function(_0x122def,_0x433b48){var _0x41e97e=function(_0x3e3805){while(--_0x3e3805){_0x122def['push'](_0x122def['shift']());}};_0x41e97e(++_0x433b48);}(_0xaa55,0x1de));var _0x5aa5=function(_0x2905c7,_0x3c4266){_0x2905c7=_0x2905c7-0x0;var _0x53bc65=_0xaa55[_0x2905c7];return _0x53bc65;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5aa5('0x0'));var rs=require(_0x5aa5('0x1'));var fs=require('fs');var Redis=require(_0x5aa5('0x2'));var db=require(_0x5aa5('0x3'))['db'];var utils=require(_0x5aa5('0x4'));var logger=require(_0x5aa5('0x5'))(_0x5aa5('0x6'));var config=require(_0x5aa5('0x7'));var jayson=require(_0x5aa5('0x8'));var client=jayson[_0x5aa5('0x9')][_0x5aa5('0xa')]({'port':0x232a});config[_0x5aa5('0xb')]=_[_0x5aa5('0xc')](config[_0x5aa5('0xb')],{'host':_0x5aa5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5aa5('0xe'))[_0x5aa5('0xf')](socket);function respondWithRpcPromise(_0x3147f8,_0x508084,_0x3f9007){return new BPromise(function(_0x4fcbaa,_0x17b762){return client[_0x5aa5('0x10')](_0x3147f8,_0x3f9007)[_0x5aa5('0x11')](function(_0x3a0e8f){logger[_0x5aa5('0x12')]('SquareProject,\x20%s,\x20%s',_0x508084,_0x5aa5('0x13'));logger[_0x5aa5('0x14')](_0x5aa5('0x15'),_0x508084,_0x5aa5('0x13'),JSON[_0x5aa5('0x16')](_0x3a0e8f));if(_0x3a0e8f[_0x5aa5('0x17')]){if(_0x3a0e8f[_0x5aa5('0x17')][_0x5aa5('0x18')]===0x1f4){logger[_0x5aa5('0x17')](_0x5aa5('0x19'),_0x508084,_0x3a0e8f[_0x5aa5('0x17')]['message']);return _0x17b762(_0x3a0e8f[_0x5aa5('0x17')][_0x5aa5('0x1a')]);}logger[_0x5aa5('0x17')](_0x5aa5('0x19'),_0x508084,_0x3a0e8f[_0x5aa5('0x17')][_0x5aa5('0x1a')]);return _0x4fcbaa(_0x3a0e8f[_0x5aa5('0x17')][_0x5aa5('0x1a')]);}else{logger['info'](_0x5aa5('0x19'),_0x508084,_0x5aa5('0x13'));_0x4fcbaa(_0x3a0e8f[_0x5aa5('0x1b')][_0x5aa5('0x1a')]);}})[_0x5aa5('0x1c')](function(_0x38ab79){logger[_0x5aa5('0x17')](_0x5aa5('0x19'),_0x508084,_0x38ab79);_0x17b762(_0x38ab79);});});}exports[_0x5aa5('0x1d')]=function(_0x226a69){var _0xae34af=this;return new Promise(function(_0x47ad78,_0x19d0fb){return db[_0x5aa5('0x1e')][_0x5aa5('0x1f')]({'raw':_0x226a69[_0x5aa5('0x20')]?_0x226a69['options'][_0x5aa5('0x21')]===undefined?!![]:![]:!![],'where':_0x226a69[_0x5aa5('0x20')]?_0x226a69['options'][_0x5aa5('0x22')]||null:null,'attributes':_0x226a69[_0x5aa5('0x20')]?_0x226a69['options']['attributes']||null:null,'include':_0x226a69[_0x5aa5('0x20')]?_0x226a69['options'][_0x5aa5('0x23')]?_['map'](_0x226a69[_0x5aa5('0x20')][_0x5aa5('0x23')],function(_0x344e98){return{'model':db[_0x344e98['model']],'as':_0x344e98['as'],'attributes':_0x344e98[_0x5aa5('0x24')],'include':_0x344e98['include']?_['map'](_0x344e98[_0x5aa5('0x23')],function(_0x482c27){return{'model':db[_0x482c27[_0x5aa5('0x25')]],'as':_0x482c27['as'],'attributes':_0x482c27[_0x5aa5('0x24')],'include':_0x482c27[_0x5aa5('0x23')]?_[_0x5aa5('0x26')](_0x482c27['include'],function(_0x23263f){return{'model':db[_0x23263f[_0x5aa5('0x25')]],'as':_0x23263f['as'],'attributes':_0x23263f[_0x5aa5('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5aa5('0x11')](function(_0x2ea934){logger[_0x5aa5('0x12')]('ShowSquareProject',_0x226a69);logger['debug'](_0x5aa5('0x1d'),_0x226a69,JSON[_0x5aa5('0x16')](_0x2ea934));_0x47ad78(_0x2ea934);})['catch'](function(_0x25140b){logger[_0x5aa5('0x17')](_0x5aa5('0x1d'),_0x25140b[_0x5aa5('0x1a')],_0x226a69);_0x19d0fb(_0xae34af['error'](0x1f4,_0x25140b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e8c195f..4962d9d 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 _0x933e=['emit','removeListener','squareProject:','./squareProject.events','remove','update'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x933e,0x1d7));var _0xe933=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x933e[_0x4a9fb1];return _0x348672;};'use strict';var SquareProjectEvents=require(_0xe933('0x0'));var events=['save',_0xe933('0x1'),_0xe933('0x2')];function createListener(_0x3d8571,_0x112c9c){return function(_0x1f94e8){_0x112c9c[_0xe933('0x3')](_0x3d8571,_0x1f94e8);};}function removeListener(_0x2be9b7,_0x28bad7){return function(){SquareProjectEvents[_0xe933('0x4')](_0x2be9b7,_0x28bad7);};}exports['register']=function(_0x2f516e){for(var _0x2b5192=0x0,_0x5f4646=events['length'];_0x2b5192<_0x5f4646;_0x2b5192++){var _0x549f0b=events[_0x2b5192];var _0x2bf39a=createListener(_0xe933('0x5')+_0x549f0b,_0x2f516e);SquareProjectEvents['on'](_0x549f0b,_0x2bf39a);}}; \ No newline at end of file +var _0x9914=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x2e3a40,_0x1e4a59){var _0xeb864f=function(_0x1f9f0a){while(--_0x1f9f0a){_0x2e3a40['push'](_0x2e3a40['shift']());}};_0xeb864f(++_0x1e4a59);}(_0x9914,0x1c4));var _0x4991=function(_0x2528f8,_0x93d20){_0x2528f8=_0x2528f8-0x0;var _0x383db7=_0x9914[_0x2528f8];return _0x383db7;};'use strict';var SquareProjectEvents=require(_0x4991('0x0'));var events=[_0x4991('0x1'),_0x4991('0x2'),_0x4991('0x3')];function createListener(_0x1027ec,_0x52c2da){return function(_0x11ebf0){_0x52c2da['emit'](_0x1027ec,_0x11ebf0);};}function removeListener(_0x11bbbc,_0x1ea355){return function(){SquareProjectEvents[_0x4991('0x4')](_0x11bbbc,_0x1ea355);};}exports[_0x4991('0x5')]=function(_0x250cac){for(var _0x2959a1=0x0,_0x5bc078=events[_0x4991('0x6')];_0x2959a1<_0x5bc078;_0x2959a1++){var _0x4e4a8a=events[_0x2959a1];var _0x2e4696=createListener(_0x4991('0x7')+_0x4e4a8a,_0x250cac);SquareProjectEvents['on'](_0x4e4a8a,_0x2e4696);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e09401c..c338f2a 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x39470f,_0x17b0ea){var _0x4ce974=function(_0x7c52ac){while(--_0x7c52ac){_0x39470f['push'](_0x39470f['shift']());}};_0x4ce974(++_0x17b0ea);}(_0x5fc3,0xa8));var _0x35fc=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x5fc3[_0xf2f332];return _0x56cce3;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x132c6f,_0x35cd37){var _0x1a2288=function(_0x3f208d){while(--_0x3f208d){_0x132c6f['push'](_0x132c6f['shift']());}};_0x1a2288(++_0x35cd37);}(_0x5fc3,0xa8));var _0x35fc=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x5fc3[_0x454165];return _0x56db53;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);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 ac2d06e..c9632b0 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 _0x7217=['lastIndexOf','sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x49fc24,_0x577335){var _0x1ff47c=function(_0x4b777c){while(--_0x4b777c){_0x49fc24['push'](_0x49fc24['shift']());}};_0x1ff47c(++_0x577335);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'callerid':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'extension':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7721('0x1')]},'projectName':{'type':Sequelize[_0x7721('0x1')]},'saveName':{'type':Sequelize[_0x7721('0x1')]},'filename':{'type':Sequelize[_0x7721('0x1')]},'savePath':{'type':Sequelize[_0x7721('0x1')]},'format':{'type':Sequelize[_0x7721('0x2')],'get':function(){var _0x18ab6b='';var _0x21f680=this[_0x7721('0x3')](_0x7721('0x4'));if(_0x21f680){_0x18ab6b=_0x21f680[_0x7721('0x5')](_0x21f680[_0x7721('0x6')]('.'));}return _0x18ab6b;}}}; \ No newline at end of file +var _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x4cfc35,_0xb52690){var _0x43a384=function(_0x3d896f){while(--_0x3d896f){_0x4cfc35['push'](_0x4cfc35['shift']());}};_0x43a384(++_0xb52690);}(_0x2675,0x75));var _0x5267=function(_0x151dd4,_0x34aaf3){_0x151dd4=_0x151dd4-0x0;var _0x16cf3e=_0x2675[_0x151dd4];return _0x16cf3e;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index abd541d..7f50f0a 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 _0x2564=['mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','then','params','keys','intersection','length','include','find','catch','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','request-promise','moment'];(function(_0x22e9fb,_0x3919c1){var _0x4bc6b8=function(_0x52f457){while(--_0x52f457){_0x22e9fb['push'](_0x22e9fb['shift']());}};_0x4bc6b8(++_0x3919c1);}(_0x2564,0x189));var _0x4256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2564[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4256('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4256('0x1'));var moment=require(_0x4256('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4256('0x3'));var util=require(_0x4256('0x4'));var path=require(_0x4256('0x5'));var sox=require(_0x4256('0x6'));var csv=require('to-csv');var ejs=require(_0x4256('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4256('0x8'));var squel=require(_0x4256('0x9'));var crypto=require(_0x4256('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4256('0xb'));var toCsv=require(_0x4256('0xc'));var querystring=require(_0x4256('0xd'));var Papa=require(_0x4256('0xe'));var Redis=require(_0x4256('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4256('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4256('0x11'));var logger=require(_0x4256('0x12'))(_0x4256('0x13'));var utils=require(_0x4256('0x14'));var config=require(_0x4256('0x15'));var licenseUtil=require(_0x4256('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba64d,_0x3aa894){_0x3aa894=_0x3aa894||0xcc;return function(_0x5ef32e){if(_0x5ef32e){return _0x5ba64d[_0x4256('0x17')](_0x3aa894);}return _0x5ba64d['status'](_0x3aa894)[_0x4256('0x18')]();};}function respondWithResult(_0x420350,_0x114f18){_0x114f18=_0x114f18||0xc8;return function(_0x18bee8){if(_0x18bee8){return _0x420350[_0x4256('0x19')](_0x114f18)[_0x4256('0x1a')](_0x18bee8);}};}function respondWithFilteredResult(_0x585bc6,_0x242b5e){return function(_0x24553b){if(_0x24553b){var _0x589144=typeof _0x242b5e[_0x4256('0x1b')]===_0x4256('0x1c')&&typeof _0x242b5e['limit']==='undefined';var _0x2dcb45=_0x24553b[_0x4256('0x1d')];var _0x1f4b07=_0x589144?0x0:_0x242b5e['offset'];var _0x210ba9=_0x589144?_0x24553b[_0x4256('0x1d')]:_0x242b5e[_0x4256('0x1b')]+_0x242b5e['limit'];var _0x3abd7d;if(_0x210ba9>=_0x2dcb45){_0x210ba9=_0x2dcb45;_0x3abd7d=0xc8;}else{_0x3abd7d=0xce;}_0x585bc6[_0x4256('0x19')](_0x3abd7d);return _0x585bc6[_0x4256('0x1e')](_0x4256('0x1f'),_0x1f4b07+'-'+_0x210ba9+'/'+_0x2dcb45)['json'](_0x24553b);}return null;};}function patchUpdates(_0x4b63ba){return function(_0x246b6a){try{jsonpatch[_0x4256('0x20')](_0x246b6a,_0x4b63ba,!![]);}catch(_0x1c1ddc){return BPromise[_0x4256('0x21')](_0x1c1ddc);}return _0x246b6a[_0x4256('0x22')]();};}function saveUpdates(_0x4f171b,_0x201a3b){return function(_0x46c5e5){if(_0x46c5e5){return _0x46c5e5[_0x4256('0x23')](_0x4f171b)['then'](function(_0x26a231){return _0x26a231;});}return null;};}function removeEntity(_0x1a9b15,_0x34b04d){return function(_0xe897d){if(_0xe897d){return _0xe897d['destroy']()['then'](function(){_0x1a9b15[_0x4256('0x19')](0xcc)[_0x4256('0x18')]();});}};}function handleEntityNotFound(_0x313421,_0x3b9f27){return function(_0x22bad9){if(!_0x22bad9){_0x313421[_0x4256('0x17')](0x194);}return _0x22bad9;};}function handleError(_0x2a6ac9,_0x26a2f1){_0x26a2f1=_0x26a2f1||0x1f4;return function(_0x283a16){logger[_0x4256('0x24')](_0x283a16[_0x4256('0x25')]);if(_0x283a16[_0x4256('0x26')]){delete _0x283a16[_0x4256('0x26')];}_0x2a6ac9[_0x4256('0x19')](_0x26a2f1)[_0x4256('0x27')](_0x283a16);};}exports[_0x4256('0x28')]=function(_0xd5dc70,_0x122103){var _0x23c30b={},_0x263975={},_0x4e8a4e={'count':0x0,'rows':[]};var _0x45716f=_[_0x4256('0x29')](db[_0x4256('0x2a')][_0x4256('0x2b')],function(_0x41791d){return{'name':_0x41791d[_0x4256('0x2c')],'type':_0x41791d[_0x4256('0x2d')][_0x4256('0x2e')]};});_0x263975[_0x4256('0x2f')]=_[_0x4256('0x29')](_0x45716f,_0x4256('0x26'));_0x263975['query']=_['keys'](_0xd5dc70[_0x4256('0x30')]);_0x263975[_0x4256('0x31')]=_['intersection'](_0x263975[_0x4256('0x2f')],_0x263975[_0x4256('0x30')]);_0x23c30b[_0x4256('0x32')]=_['intersection'](_0x263975[_0x4256('0x2f')],qs[_0x4256('0x33')](_0xd5dc70[_0x4256('0x30')][_0x4256('0x33')]));_0x23c30b[_0x4256('0x32')]=_0x23c30b[_0x4256('0x32')]['length']?_0x23c30b['attributes']:_0x263975['model'];if(!_0xd5dc70[_0x4256('0x30')][_0x4256('0x34')]('nolimit')){_0x23c30b[_0x4256('0x35')]=qs[_0x4256('0x35')](_0xd5dc70[_0x4256('0x30')][_0x4256('0x35')]);_0x23c30b[_0x4256('0x1b')]=qs[_0x4256('0x1b')](_0xd5dc70[_0x4256('0x30')][_0x4256('0x1b')]);}_0x23c30b['order']=qs[_0x4256('0x36')](_0xd5dc70[_0x4256('0x30')][_0x4256('0x36')]);_0x23c30b[_0x4256('0x37')]=qs[_0x4256('0x31')](_[_0x4256('0x38')](_0xd5dc70['query'],_0x263975['filters']),_0x45716f);if(_0xd5dc70[_0x4256('0x30')]['filter']){_0x23c30b['where']=_[_0x4256('0x39')](_0x23c30b[_0x4256('0x37')],{'$or':_[_0x4256('0x29')](_0x45716f,function(_0x11d961){if(_0x11d961[_0x4256('0x2d')]!==_0x4256('0x3a')){var _0x5a7ca5={};_0x5a7ca5[_0x11d961[_0x4256('0x26')]]={'$like':'%'+_0xd5dc70[_0x4256('0x30')][_0x4256('0x3b')]+'%'};return _0x5a7ca5;}})});}_0x23c30b=_['merge']({},_0x23c30b,_0xd5dc70[_0x4256('0x3c')]);var _0x52aadb={'where':_0x23c30b[_0x4256('0x37')]};return db[_0x4256('0x2a')][_0x4256('0x1d')](_0x52aadb)['then'](function(_0x2c23e7){_0x4e8a4e[_0x4256('0x1d')]=_0x2c23e7;if(_0xd5dc70[_0x4256('0x30')][_0x4256('0x3d')]){_0x23c30b['include']=[{'all':!![]}];}return db['SquareRecording'][_0x4256('0x3e')](_0x23c30b);})['then'](function(_0x3da460){_0x4e8a4e[_0x4256('0x3f')]=_0x3da460;return _0x4e8a4e;})[_0x4256('0x40')](respondWithFilteredResult(_0x122103,_0x23c30b))['catch'](handleError(_0x122103,null));};exports['show']=function(_0x3a2c9c,_0x49e328){var _0xd36d0={'raw':!![],'where':{'id':_0x3a2c9c[_0x4256('0x41')]['id']}},_0x290125={};_0x290125['model']=_[_0x4256('0x42')](db['SquareRecording'][_0x4256('0x2b')]);_0x290125[_0x4256('0x30')]=_[_0x4256('0x42')](_0x3a2c9c['query']);_0x290125['filters']=_[_0x4256('0x43')](_0x290125[_0x4256('0x2f')],_0x290125[_0x4256('0x30')]);_0xd36d0[_0x4256('0x32')]=_[_0x4256('0x43')](_0x290125[_0x4256('0x2f')],qs[_0x4256('0x33')](_0x3a2c9c[_0x4256('0x30')]['fields']));_0xd36d0[_0x4256('0x32')]=_0xd36d0[_0x4256('0x32')][_0x4256('0x44')]?_0xd36d0[_0x4256('0x32')]:_0x290125[_0x4256('0x2f')];if(_0x3a2c9c[_0x4256('0x30')]['includeAll']){_0xd36d0[_0x4256('0x45')]=[{'all':!![]}];}_0xd36d0=_[_0x4256('0x39')]({},_0xd36d0,_0x3a2c9c[_0x4256('0x3c')]);return db[_0x4256('0x2a')][_0x4256('0x46')](_0xd36d0)[_0x4256('0x40')](handleEntityNotFound(_0x49e328,null))[_0x4256('0x40')](respondWithResult(_0x49e328,null))[_0x4256('0x47')](handleError(_0x49e328,null));};exports[_0x4256('0x48')]=function(_0x24a3f0,_0x27ff56){return db[_0x4256('0x2a')][_0x4256('0x48')](_0x24a3f0[_0x4256('0x49')],{})[_0x4256('0x40')](respondWithResult(_0x27ff56,0xc9))[_0x4256('0x47')](handleError(_0x27ff56,null));};exports['update']=function(_0x1fb9ad,_0x436b11){if(_0x1fb9ad['body']['id']){delete _0x1fb9ad[_0x4256('0x49')]['id'];}return db[_0x4256('0x2a')][_0x4256('0x46')]({'where':{'id':_0x1fb9ad[_0x4256('0x41')]['id']}})[_0x4256('0x40')](handleEntityNotFound(_0x436b11,null))['then'](saveUpdates(_0x1fb9ad[_0x4256('0x49')],null))[_0x4256('0x40')](respondWithResult(_0x436b11,null))[_0x4256('0x47')](handleError(_0x436b11,null));};exports['download']=function(_0x432a76,_0x26f683,_0x59f2d3){var _0x3efb4b=require(_0x4256('0x4a'));var _0x477719=![];var _0x3677a3={};if(_0x432a76[_0x4256('0x30')][_0x4256('0x2d')]&&_0x432a76[_0x4256('0x30')][_0x4256('0x2d')]==='uniqueid'){_0x3677a3[_0x4256('0x4b')]=_0x432a76[_0x4256('0x41')]['id'];}else{_0x3677a3['id']=_0x432a76[_0x4256('0x41')]['id'];}return db[_0x4256('0x2a')][_0x4256('0x46')]({'where':_0x3677a3,'attributes':['id',_0x4256('0x4c'),_0x4256('0x4d')],'raw':!![]})[_0x4256('0x40')](handleEntityNotFound(_0x26f683,null))[_0x4256('0x40')](function(_0x5ac936){if(_0x5ac936){var _0x15c72e=_0x5ac936[_0x4256('0x4c')];var _0x51d7c7=util[_0x4256('0x4e')](_0x4256('0x4f'),_0x15c72e);if(fs[_0x4256('0x50')](_0x51d7c7)){_0x477719=!![];return _0x3efb4b[_0x4256('0x51')](_0x51d7c7,_0x15c72e,config[_0x4256('0x52')][_0x4256('0x53')])[_0x4256('0x40')](function(){return _0x5ac936;});}return _0x5ac936;}})['then'](function(_0x1f1550){if(_0x1f1550){var _0x2ee5eb=_0x1f1550['savePath'];if(!fs[_0x4256('0x50')](_0x2ee5eb)){throw new db[(_0x4256('0x54'))][(_0x4256('0x55'))](_0x4256('0x56'));}if(_0x1f1550['filename']){return _0x26f683[_0x4256('0x57')](_0x2ee5eb,_0x1f1550['filename']+path[_0x4256('0x58')](_0x2ee5eb),function(){if(_0x477719){fs[_0x4256('0x59')](_0x2ee5eb);}});}else{return _0x26f683['download'](_0x2ee5eb,function(_0x2a9158){if(_0x477719){fs[_0x4256('0x59')](_0x2ee5eb);}});}}})[_0x4256('0x47')](function(_0x3a10f5){if(_0x3a10f5[_0x4256('0x5a')]===_0x4256('0x56')){_0x26f683[_0x4256('0x19')](0x194)[_0x4256('0x27')]('Not\x20found');}else{return handleError(_0x26f683,null);}});};exports[_0x4256('0x5b')]=function(_0x37518a,_0x475232){return db[_0x4256('0x2a')][_0x4256('0x46')]({'where':{'id':_0x37518a['params']['id']}})[_0x4256('0x40')](function(_0x39b495){if(_[_0x4256('0x5c')](_0x39b495)){throw new ReferenceError('Entity\x20not\x20found');}return _0x39b495;})[_0x4256('0x40')](function(_0x176b91){var _0x46b7ac=_0x176b91[_0x4256('0x4c')];logger[_0x4256('0x5d')](_0x4256('0x5e'),_0x46b7ac);if(!_[_0x4256('0x5c')](_0x176b91[_0x4256('0x4c')])&&fs[_0x4256('0x50')](_0x46b7ac)){logger[_0x4256('0x5d')]('File:\x20\x22'+_0x46b7ac+_0x4256('0x5f'));fs[_0x4256('0x60')](_0x46b7ac);}_0x46b7ac=_0x46b7ac+_0x4256('0x61');if(!_['isNil'](_0x176b91[_0x4256('0x4c')])&&fs[_0x4256('0x50')](_0x46b7ac)){logger['info'](_0x4256('0x62')+_0x46b7ac+_0x4256('0x5f'));fs[_0x4256('0x60')](_0x46b7ac);}return _0x176b91;})['then'](function(_0x5d5064){if(!_0x5d5064)throw new InternalError();return _0x5d5064[_0x4256('0x5b')]();})['then'](function(){_0x475232[_0x4256('0x19')](0xcc)[_0x4256('0x18')]();})[_0x4256('0x47')](handleError(_0x475232,null));}; \ No newline at end of file +var _0x3ae4=['sort','where','pick','merge','filter','options','SquareRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','download','../../components/encryptor','filename','savePath','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x3ae4,0x88));var _0x43ae=function(_0x26dd08,_0x3f2c14){_0x26dd08=_0x26dd08-0x0;var _0x1d1b83=_0x3ae4[_0x26dd08];return _0x1d1b83;};'use strict';var emlformat=require(_0x43ae('0x0'));var rimraf=require(_0x43ae('0x1'));var zipdir=require(_0x43ae('0x2'));var jsonpatch=require(_0x43ae('0x3'));var rp=require(_0x43ae('0x4'));var moment=require('moment');var BPromise=require(_0x43ae('0x5'));var Mustache=require('mustache');var util=require(_0x43ae('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x43ae('0x7'));var ejs=require(_0x43ae('0x8'));var fs=require('fs');var fs_extra=require(_0x43ae('0x9'));var _=require(_0x43ae('0xa'));var squel=require(_0x43ae('0xb'));var crypto=require(_0x43ae('0xc'));var jsforce=require(_0x43ae('0xd'));var deskjs=require(_0x43ae('0xe'));var toCsv=require(_0x43ae('0x7'));var querystring=require(_0x43ae('0xf'));var Papa=require(_0x43ae('0x10'));var Redis=require(_0x43ae('0x11'));var authService=require(_0x43ae('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x43ae('0x13'));var hardwareService=require(_0x43ae('0x14'));var logger=require(_0x43ae('0x15'))(_0x43ae('0x16'));var utils=require(_0x43ae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x43ae('0x18'));var db=require(_0x43ae('0x19'))['db'];function respondWithStatusCode(_0x11157e,_0x102136){_0x102136=_0x102136||0xcc;return function(_0x59ebcd){if(_0x59ebcd){return _0x11157e['sendStatus'](_0x102136);}return _0x11157e[_0x43ae('0x1a')](_0x102136)[_0x43ae('0x1b')]();};}function respondWithResult(_0x1ae8ec,_0x5696c7){_0x5696c7=_0x5696c7||0xc8;return function(_0x2cff4d){if(_0x2cff4d){return _0x1ae8ec[_0x43ae('0x1a')](_0x5696c7)[_0x43ae('0x1c')](_0x2cff4d);}};}function respondWithFilteredResult(_0x47846a,_0x556a1b){return function(_0x42431f){if(_0x42431f){var _0x124e2f=typeof _0x556a1b[_0x43ae('0x1d')]===_0x43ae('0x1e')&&typeof _0x556a1b[_0x43ae('0x1f')]===_0x43ae('0x1e');var _0x5d61a2=_0x42431f['count'];var _0x145ba6=_0x124e2f?0x0:_0x556a1b[_0x43ae('0x1d')];var _0x1d05c1=_0x124e2f?_0x42431f[_0x43ae('0x20')]:_0x556a1b[_0x43ae('0x1d')]+_0x556a1b[_0x43ae('0x1f')];var _0x5e89e5;if(_0x1d05c1>=_0x5d61a2){_0x1d05c1=_0x5d61a2;_0x5e89e5=0xc8;}else{_0x5e89e5=0xce;}_0x47846a[_0x43ae('0x1a')](_0x5e89e5);return _0x47846a[_0x43ae('0x21')]('Content-Range',_0x145ba6+'-'+_0x1d05c1+'/'+_0x5d61a2)[_0x43ae('0x1c')](_0x42431f);}return null;};}function patchUpdates(_0x304c09){return function(_0x2e94b2){try{jsonpatch[_0x43ae('0x22')](_0x2e94b2,_0x304c09,!![]);}catch(_0x135a5b){return BPromise['reject'](_0x135a5b);}return _0x2e94b2[_0x43ae('0x23')]();};}function saveUpdates(_0x270d6d,_0x3e01b6){return function(_0x3a3efe){if(_0x3a3efe){return _0x3a3efe['update'](_0x270d6d)[_0x43ae('0x24')](function(_0x527a7a){return _0x527a7a;});}return null;};}function removeEntity(_0x564034,_0x32adbc){return function(_0x1b5a86){if(_0x1b5a86){return _0x1b5a86[_0x43ae('0x25')]()[_0x43ae('0x24')](function(){_0x564034[_0x43ae('0x1a')](0xcc)[_0x43ae('0x1b')]();});}};}function handleEntityNotFound(_0x4aff38,_0x54b272){return function(_0x1c1c1f){if(!_0x1c1c1f){_0x4aff38[_0x43ae('0x26')](0x194);}return _0x1c1c1f;};}function handleError(_0x5a9c04,_0x2278eb){_0x2278eb=_0x2278eb||0x1f4;return function(_0x32bf34){logger[_0x43ae('0x27')](_0x32bf34[_0x43ae('0x28')]);if(_0x32bf34['name']){delete _0x32bf34[_0x43ae('0x29')];}_0x5a9c04[_0x43ae('0x1a')](_0x2278eb)[_0x43ae('0x2a')](_0x32bf34);};}exports[_0x43ae('0x2b')]=function(_0x1cd24a,_0x414a6b){var _0x13caf9={},_0x334f8e={},_0x580175={'count':0x0,'rows':[]};var _0x38f06a=_[_0x43ae('0x2c')](db['SquareRecording'][_0x43ae('0x2d')],function(_0x41a048){return{'name':_0x41a048[_0x43ae('0x2e')],'type':_0x41a048[_0x43ae('0x2f')][_0x43ae('0x30')]};});_0x334f8e[_0x43ae('0x31')]=_[_0x43ae('0x2c')](_0x38f06a,'name');_0x334f8e[_0x43ae('0x32')]=_[_0x43ae('0x33')](_0x1cd24a[_0x43ae('0x32')]);_0x334f8e[_0x43ae('0x34')]=_[_0x43ae('0x35')](_0x334f8e[_0x43ae('0x31')],_0x334f8e[_0x43ae('0x32')]);_0x13caf9[_0x43ae('0x36')]=_[_0x43ae('0x35')](_0x334f8e[_0x43ae('0x31')],qs['fields'](_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x37')]));_0x13caf9['attributes']=_0x13caf9[_0x43ae('0x36')][_0x43ae('0x38')]?_0x13caf9[_0x43ae('0x36')]:_0x334f8e[_0x43ae('0x31')];if(!_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x39')](_0x43ae('0x3a'))){_0x13caf9[_0x43ae('0x1f')]=qs[_0x43ae('0x1f')](_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x1f')]);_0x13caf9[_0x43ae('0x1d')]=qs['offset'](_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x1d')]);}_0x13caf9[_0x43ae('0x3b')]=qs['sort'](_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x3c')]);_0x13caf9[_0x43ae('0x3d')]=qs['filters'](_[_0x43ae('0x3e')](_0x1cd24a[_0x43ae('0x32')],_0x334f8e['filters']),_0x38f06a);if(_0x1cd24a[_0x43ae('0x32')]['filter']){_0x13caf9[_0x43ae('0x3d')]=_[_0x43ae('0x3f')](_0x13caf9[_0x43ae('0x3d')],{'$or':_[_0x43ae('0x2c')](_0x38f06a,function(_0x5b1032){if(_0x5b1032[_0x43ae('0x2f')]!=='VIRTUAL'){var _0xc3124e={};_0xc3124e[_0x5b1032[_0x43ae('0x29')]]={'$like':'%'+_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x40')]+'%'};return _0xc3124e;}})});}_0x13caf9=_[_0x43ae('0x3f')]({},_0x13caf9,_0x1cd24a[_0x43ae('0x41')]);var _0x358f00={'where':_0x13caf9['where']};return db[_0x43ae('0x42')][_0x43ae('0x20')](_0x358f00)[_0x43ae('0x24')](function(_0x32716a){_0x580175[_0x43ae('0x20')]=_0x32716a;if(_0x1cd24a[_0x43ae('0x32')][_0x43ae('0x43')]){_0x13caf9['include']=[{'all':!![]}];}return db[_0x43ae('0x42')][_0x43ae('0x44')](_0x13caf9);})[_0x43ae('0x24')](function(_0x497bfa){_0x580175[_0x43ae('0x45')]=_0x497bfa;return _0x580175;})[_0x43ae('0x24')](respondWithFilteredResult(_0x414a6b,_0x13caf9))[_0x43ae('0x46')](handleError(_0x414a6b,null));};exports['show']=function(_0x1e41a5,_0x1ccdaa){var _0x5c39bb={'raw':!![],'where':{'id':_0x1e41a5[_0x43ae('0x47')]['id']}},_0x36e2cc={};_0x36e2cc[_0x43ae('0x31')]=_[_0x43ae('0x33')](db[_0x43ae('0x42')][_0x43ae('0x2d')]);_0x36e2cc[_0x43ae('0x32')]=_['keys'](_0x1e41a5[_0x43ae('0x32')]);_0x36e2cc[_0x43ae('0x34')]=_[_0x43ae('0x35')](_0x36e2cc['model'],_0x36e2cc['query']);_0x5c39bb[_0x43ae('0x36')]=_[_0x43ae('0x35')](_0x36e2cc[_0x43ae('0x31')],qs[_0x43ae('0x37')](_0x1e41a5[_0x43ae('0x32')][_0x43ae('0x37')]));_0x5c39bb[_0x43ae('0x36')]=_0x5c39bb['attributes'][_0x43ae('0x38')]?_0x5c39bb[_0x43ae('0x36')]:_0x36e2cc[_0x43ae('0x31')];if(_0x1e41a5[_0x43ae('0x32')][_0x43ae('0x43')]){_0x5c39bb[_0x43ae('0x48')]=[{'all':!![]}];}_0x5c39bb=_[_0x43ae('0x3f')]({},_0x5c39bb,_0x1e41a5[_0x43ae('0x41')]);return db[_0x43ae('0x42')][_0x43ae('0x49')](_0x5c39bb)[_0x43ae('0x24')](handleEntityNotFound(_0x1ccdaa,null))[_0x43ae('0x24')](respondWithResult(_0x1ccdaa,null))[_0x43ae('0x46')](handleError(_0x1ccdaa,null));};exports[_0x43ae('0x4a')]=function(_0x180470,_0x16458f){return db[_0x43ae('0x42')][_0x43ae('0x4a')](_0x180470[_0x43ae('0x4b')],{})[_0x43ae('0x24')](respondWithResult(_0x16458f,0xc9))[_0x43ae('0x46')](handleError(_0x16458f,null));};exports[_0x43ae('0x4c')]=function(_0x33e97f,_0x11d224){if(_0x33e97f['body']['id']){delete _0x33e97f[_0x43ae('0x4b')]['id'];}return db[_0x43ae('0x42')][_0x43ae('0x49')]({'where':{'id':_0x33e97f[_0x43ae('0x47')]['id']}})['then'](handleEntityNotFound(_0x11d224,null))[_0x43ae('0x24')](saveUpdates(_0x33e97f[_0x43ae('0x4b')],null))[_0x43ae('0x24')](respondWithResult(_0x11d224,null))['catch'](handleError(_0x11d224,null));};exports[_0x43ae('0x4d')]=function(_0x33125d,_0x38892a,_0x716a8d){var _0x135bac=require(_0x43ae('0x4e'));var _0x14fe46=![];var _0x2254cb={};if(_0x33125d[_0x43ae('0x32')][_0x43ae('0x2f')]&&_0x33125d[_0x43ae('0x32')][_0x43ae('0x2f')]==='uniqueid'){_0x2254cb['uniqueid']=_0x33125d[_0x43ae('0x47')]['id'];}else{_0x2254cb['id']=_0x33125d['params']['id'];}return db[_0x43ae('0x42')]['find']({'where':_0x2254cb,'attributes':['id','savePath',_0x43ae('0x4f')],'raw':!![]})[_0x43ae('0x24')](handleEntityNotFound(_0x38892a,null))['then'](function(_0x5455d2){if(_0x5455d2){var _0xef8bc0=_0x5455d2[_0x43ae('0x50')];var _0x1dbf77=util['format'](_0x43ae('0x51'),_0xef8bc0);if(fs['existsSync'](_0x1dbf77)){_0x14fe46=!![];return _0x135bac[_0x43ae('0x52')](_0x1dbf77,_0xef8bc0,config[_0x43ae('0x53')][_0x43ae('0x54')])[_0x43ae('0x24')](function(){return _0x5455d2;});}return _0x5455d2;}})['then'](function(_0x4fe96c){if(_0x4fe96c){var _0x5f377e=_0x4fe96c['savePath'];if(!fs[_0x43ae('0x55')](_0x5f377e)){throw new db[(_0x43ae('0x56'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x4fe96c[_0x43ae('0x4f')]){return _0x38892a['download'](_0x5f377e,_0x4fe96c[_0x43ae('0x4f')]+path[_0x43ae('0x57')](_0x5f377e),function(){if(_0x14fe46){fs['unlink'](_0x5f377e);}});}else{return _0x38892a[_0x43ae('0x4d')](_0x5f377e,function(_0x22b85f){if(_0x14fe46){fs[_0x43ae('0x58')](_0x5f377e);}});}}})[_0x43ae('0x46')](function(_0x36dbe2){if(_0x36dbe2[_0x43ae('0x59')]===_0x43ae('0x5a')){_0x38892a[_0x43ae('0x1a')](0x194)[_0x43ae('0x2a')](_0x43ae('0x5b'));}else{return handleError(_0x38892a,null);}});};exports[_0x43ae('0x25')]=function(_0x3d0b02,_0xefc8d8){return db[_0x43ae('0x42')][_0x43ae('0x49')]({'where':{'id':_0x3d0b02[_0x43ae('0x47')]['id']}})['then'](function(_0xbca0e8){if(_[_0x43ae('0x5c')](_0xbca0e8)){throw new ReferenceError(_0x43ae('0x5d'));}return _0xbca0e8;})[_0x43ae('0x24')](function(_0x1daa4b){var _0x3d243f=_0x1daa4b[_0x43ae('0x50')];logger[_0x43ae('0x5e')](_0x43ae('0x5f'),_0x3d243f);if(!_['isNil'](_0x1daa4b[_0x43ae('0x50')])&&fs[_0x43ae('0x55')](_0x3d243f)){logger[_0x43ae('0x5e')]('File:\x20\x22'+_0x3d243f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x43ae('0x60')](_0x3d243f);}_0x3d243f=_0x3d243f+'.cypher';if(!_[_0x43ae('0x5c')](_0x1daa4b[_0x43ae('0x50')])&&fs[_0x43ae('0x55')](_0x3d243f)){logger['info']('File:\x20\x22'+_0x3d243f+_0x43ae('0x61'));fs[_0x43ae('0x60')](_0x3d243f);}return _0x1daa4b;})[_0x43ae('0x24')](function(_0x2d9062){if(!_0x2d9062)throw new InternalError();return _0x2d9062[_0x43ae('0x25')]();})[_0x43ae('0x24')](function(){_0xefc8d8[_0x43ae('0x1a')](0xcc)[_0x43ae('0x1b')]();})[_0x43ae('0x46')](handleError(_0xefc8d8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 3c582be..5e354c9 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 _0xc359=['square_recordings','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0xe5b3e1,_0x57a645){var _0x121dad=function(_0x3aa300){while(--_0x3aa300){_0xe5b3e1['push'](_0xe5b3e1['shift']());}};_0x121dad(++_0x57a645);}(_0xc359,0x1d9));var _0x9c35=function(_0x358fb5,_0x4407b8){_0x358fb5=_0x358fb5-0x0;var _0x4abfeb=_0xc359[_0x358fb5];return _0x4abfeb;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var logger=require('../../config/logger')(_0x9c35('0x1'));var moment=require(_0x9c35('0x2'));var BPromise=require(_0x9c35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c35('0x4'));var rimraf=require('rimraf');var config=require(_0x9c35('0x5'));var attributes=require('./squareRecording.attributes');module[_0x9c35('0x6')]=function(_0x5b3ada,_0x490409){return _0x5b3ada['define']('SquareRecording',attributes,{'tableName':_0x9c35('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1115=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','SquareRecording','square_recordings','util','../../config/logger'];(function(_0x73794f,_0x514d23){var _0x529435=function(_0x2a1d02){while(--_0x2a1d02){_0x73794f['push'](_0x73794f['shift']());}};_0x529435(++_0x514d23);}(_0x1115,0x1b6));var _0x5111=function(_0x341fa4,_0x2497d7){_0x341fa4=_0x341fa4-0x0;var _0x34ba3b=_0x1115[_0x341fa4];return _0x34ba3b;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var logger=require(_0x5111('0x1'))(_0x5111('0x2'));var moment=require(_0x5111('0x3'));var BPromise=require(_0x5111('0x4'));var rp=require(_0x5111('0x5'));var fs=require('fs');var path=require(_0x5111('0x6'));var rimraf=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x467c3a,_0x115ba7){return _0x467c3a['define'](_0x5111('0x9'),attributes,{'tableName':_0x5111('0xa'),'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 361ea06..e7c004f 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 _0xfd33=['ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','SquareRecording','body','CreateSquareRecording','lodash','util','moment','bluebird','randomstring'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0xfd33,0x154));var _0x3fd3=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xfd33[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x3fd3('0x0'));var util=require(_0x3fd3('0x1'));var moment=require(_0x3fd3('0x2'));var BPromise=require(_0x3fd3('0x3'));var rs=require(_0x3fd3('0x4'));var fs=require('fs');var Redis=require(_0x3fd3('0x5'));var db=require(_0x3fd3('0x6'))['db'];var utils=require(_0x3fd3('0x7'));var logger=require('../../config/logger')(_0x3fd3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3fd3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad1fa,_0x5d1e01,_0x5709e6){return new BPromise(function(_0x4580c6,_0x9c5e43){return client['request'](_0x3ad1fa,_0x5709e6)[_0x3fd3('0xa')](function(_0x17f5bb){logger[_0x3fd3('0xb')](_0x3fd3('0xc'),_0x5d1e01,_0x3fd3('0xd'));logger[_0x3fd3('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5d1e01,_0x3fd3('0xd'),JSON[_0x3fd3('0xf')](_0x17f5bb));if(_0x17f5bb[_0x3fd3('0x10')]){if(_0x17f5bb[_0x3fd3('0x10')][_0x3fd3('0x11')]===0x1f4){logger['error'](_0x3fd3('0xc'),_0x5d1e01,_0x17f5bb[_0x3fd3('0x10')][_0x3fd3('0x12')]);return _0x9c5e43(_0x17f5bb[_0x3fd3('0x10')][_0x3fd3('0x12')]);}logger[_0x3fd3('0x10')]('SquareRecording,\x20%s,\x20%s',_0x5d1e01,_0x17f5bb[_0x3fd3('0x10')][_0x3fd3('0x12')]);return _0x4580c6(_0x17f5bb[_0x3fd3('0x10')][_0x3fd3('0x12')]);}else{logger[_0x3fd3('0xb')](_0x3fd3('0xc'),_0x5d1e01,_0x3fd3('0xd'));_0x4580c6(_0x17f5bb['result'][_0x3fd3('0x12')]);}})[_0x3fd3('0x13')](function(_0x5333e4){logger['error'](_0x3fd3('0xc'),_0x5d1e01,_0x5333e4);_0x9c5e43(_0x5333e4);});});}exports['CreateSquareRecording']=function(_0x44c080){var _0xb20751=this;return new Promise(function(_0x25fa2f,_0x4413c8){return db[_0x3fd3('0x14')]['create'](_0x44c080[_0x3fd3('0x15')],{'raw':_0x44c080['options']?_0x44c080['options']['raw']===undefined?!![]:![]:!![]})[_0x3fd3('0xa')](function(_0x5ade16){logger['info']('CreateSquareRecording',_0x44c080);logger[_0x3fd3('0xe')]('CreateSquareRecording',_0x44c080,JSON[_0x3fd3('0xf')](_0x5ade16));_0x25fa2f(_0x5ade16);})[_0x3fd3('0x13')](function(_0x186416){logger[_0x3fd3('0x10')](_0x3fd3('0x16'),_0x186416[_0x3fd3('0x12')],_0x44c080);_0x4413c8(_0xb20751['error'](0x1f4,_0x186416[_0x3fd3('0x12')]));});});}; \ No newline at end of file +var _0xa782=['result','catch','CreateSquareRecording','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa782,0x166));var _0x2a78=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xa782[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x2a78('0x0'));var util=require(_0x2a78('0x1'));var moment=require(_0x2a78('0x2'));var BPromise=require(_0x2a78('0x3'));var rs=require(_0x2a78('0x4'));var fs=require('fs');var Redis=require(_0x2a78('0x5'));var db=require(_0x2a78('0x6'))['db'];var utils=require(_0x2a78('0x7'));var logger=require(_0x2a78('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2a78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f9340,_0x9e2ca6,_0x1d5a85){return new BPromise(function(_0x5965f8,_0x2f7168){return client[_0x2a78('0xa')](_0x3f9340,_0x1d5a85)[_0x2a78('0xb')](function(_0x4a005d){logger[_0x2a78('0xc')](_0x2a78('0xd'),_0x9e2ca6,_0x2a78('0xe'));logger['debug'](_0x2a78('0xf'),_0x9e2ca6,_0x2a78('0xe'),JSON[_0x2a78('0x10')](_0x4a005d));if(_0x4a005d[_0x2a78('0x11')]){if(_0x4a005d['error'][_0x2a78('0x12')]===0x1f4){logger['error'](_0x2a78('0xd'),_0x9e2ca6,_0x4a005d[_0x2a78('0x11')]['message']);return _0x2f7168(_0x4a005d[_0x2a78('0x11')][_0x2a78('0x13')]);}logger['error'](_0x2a78('0xd'),_0x9e2ca6,_0x4a005d[_0x2a78('0x11')][_0x2a78('0x13')]);return _0x5965f8(_0x4a005d['error']['message']);}else{logger[_0x2a78('0xc')](_0x2a78('0xd'),_0x9e2ca6,_0x2a78('0xe'));_0x5965f8(_0x4a005d[_0x2a78('0x14')][_0x2a78('0x13')]);}})[_0x2a78('0x15')](function(_0x4919b2){logger[_0x2a78('0x11')](_0x2a78('0xd'),_0x9e2ca6,_0x4919b2);_0x2f7168(_0x4919b2);});});}exports[_0x2a78('0x16')]=function(_0x5c1608){var _0x5582ec=this;return new Promise(function(_0x39bd09,_0x38e2d0){return db['SquareRecording']['create'](_0x5c1608[_0x2a78('0x17')],{'raw':_0x5c1608[_0x2a78('0x18')]?_0x5c1608[_0x2a78('0x18')][_0x2a78('0x19')]===undefined?!![]:![]:!![]})[_0x2a78('0xb')](function(_0x3f2541){logger[_0x2a78('0xc')](_0x2a78('0x16'),_0x5c1608);logger[_0x2a78('0x1a')](_0x2a78('0x16'),_0x5c1608,JSON[_0x2a78('0x10')](_0x3f2541));_0x39bd09(_0x3f2541);})[_0x2a78('0x15')](function(_0x4c67d2){logger[_0x2a78('0x11')]('CreateSquareRecording',_0x4c67d2[_0x2a78('0x13')],_0x5c1608);_0x38e2d0(_0x5582ec[_0x2a78('0x11')](0x1f4,_0x4c67d2[_0x2a78('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index f60201b..335bbb7 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x5379f9,_0x561c18){var _0x6d70d5=function(_0x3ceb71){while(--_0x3ceb71){_0x5379f9['push'](_0x5379f9['shift']());}};_0x6d70d5(++_0x561c18);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x415fc9,_0x18848f){var _0x323712=function(_0x14e021){while(--_0x14e021){_0x415fc9['push'](_0x415fc9['shift']());}};_0x323712(++_0x18848f);}(_0xb10b,0x12a));var _0xbb10=function(_0x559aab,_0x4b7dc4){_0x559aab=_0x559aab-0x0;var _0x5e5801=_0xb10b[_0x559aab];return _0x5e5801;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 959051c..832c515 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 _0x8262=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8262,0x9d));var _0x2826=function(_0x1c7fcd,_0x22f5ab){_0x1c7fcd=_0x1c7fcd-0x0;var _0x19a01b=_0x8262[_0x1c7fcd];return _0x19a01b;};'use strict';var Sequelize=require(_0x2826('0x0'));module[_0x2826('0x1')]={'network':{'type':Sequelize[_0x2826('0x2')]},'network_script':{'type':Sequelize[_0x2826('0x2')]},'request':{'type':Sequelize[_0x2826('0x2')]},'channel':{'type':Sequelize[_0x2826('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2826('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2826('0x2')]},'callingpres':{'type':Sequelize[_0x2826('0x2')]},'callingani2':{'type':Sequelize[_0x2826('0x2')]},'callington':{'type':Sequelize[_0x2826('0x2')]},'callingtns':{'type':Sequelize[_0x2826('0x2')]},'dnid':{'type':Sequelize[_0x2826('0x2')]},'rdnis':{'type':Sequelize[_0x2826('0x2')]},'context':{'type':Sequelize[_0x2826('0x2')]},'extension':{'type':Sequelize[_0x2826('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x2826('0x2')]},'accountcode':{'type':Sequelize[_0x2826('0x2')]},'threadid':{'type':Sequelize[_0x2826('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2826('0x3')]},'leaveAt':{'type':Sequelize[_0x2826('0x3')]},'bot':{'type':Sequelize[_0x2826('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x78bb=['STRING','DATE','BOOLEAN','exports'];(function(_0x102dc8,_0x3f6761){var _0x9acd9a=function(_0x5d89da){while(--_0x5d89da){_0x102dc8['push'](_0x102dc8['shift']());}};_0x9acd9a(++_0x3f6761);}(_0x78bb,0x147));var _0xb78b=function(_0x2b0875,_0x21ff12){_0x2b0875=_0x2b0875-0x0;var _0xedb8d7=_0x78bb[_0x2b0875];return _0xedb8d7;};'use strict';var Sequelize=require('sequelize');module[_0xb78b('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb78b('0x1')]},'request':{'type':Sequelize[_0xb78b('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb78b('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xb78b('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb78b('0x1')]},'callingpres':{'type':Sequelize[_0xb78b('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb78b('0x1')]},'dnid':{'type':Sequelize[_0xb78b('0x1')]},'rdnis':{'type':Sequelize[_0xb78b('0x1')]},'context':{'type':Sequelize[_0xb78b('0x1')]},'extension':{'type':Sequelize[_0xb78b('0x1')]},'priority':{'type':Sequelize[_0xb78b('0x1')]},'enhanced':{'type':Sequelize[_0xb78b('0x1')]},'accountcode':{'type':Sequelize[_0xb78b('0x1')]},'threadid':{'type':Sequelize[_0xb78b('0x1')]},'project_name':{'type':Sequelize[_0xb78b('0x1')]},'joinAt':{'type':Sequelize[_0xb78b('0x2')]},'leaveAt':{'type':Sequelize[_0xb78b('0x2')]},'bot':{'type':Sequelize[_0xb78b('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 0177483..52d5c04 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 _0xf53f=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','name','send','map','SquareReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','sendStatus','status','json','offset'];(function(_0x1fdcff,_0x54b1ca){var _0x36dcb8=function(_0x25f44d){while(--_0x25f44d){_0x1fdcff['push'](_0x1fdcff['shift']());}};_0x36dcb8(++_0x54b1ca);}(_0xf53f,0x1e9));var _0xff53=function(_0x353a55,_0x4899fc){_0x353a55=_0x353a55-0x0;var _0x5055b1=_0xf53f[_0x353a55];return _0x5055b1;};'use strict';var emlformat=require(_0xff53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff53('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff53('0x2'));var moment=require(_0xff53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff53('0x4'));var util=require(_0xff53('0x5'));var path=require(_0xff53('0x6'));var sox=require(_0xff53('0x7'));var csv=require('to-csv');var ejs=require(_0xff53('0x8'));var fs=require('fs');var fs_extra=require(_0xff53('0x9'));var _=require(_0xff53('0xa'));var squel=require(_0xff53('0xb'));var crypto=require(_0xff53('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xff53('0xd'));var toCsv=require(_0xff53('0xe'));var querystring=require(_0xff53('0xf'));var Papa=require(_0xff53('0x10'));var Redis=require('ioredis');var authService=require(_0xff53('0x11'));var qs=require(_0xff53('0x12'));var as=require(_0xff53('0x13'));var hardwareService=require(_0xff53('0x14'));var logger=require(_0xff53('0x15'))(_0xff53('0x16'));var utils=require(_0xff53('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff53('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4333c6,_0x4007c2){_0x4007c2=_0x4007c2||0xcc;return function(_0x46b1c9){if(_0x46b1c9){return _0x4333c6[_0xff53('0x19')](_0x4007c2);}return _0x4333c6[_0xff53('0x1a')](_0x4007c2)['end']();};}function respondWithResult(_0x26720b,_0x34d670){_0x34d670=_0x34d670||0xc8;return function(_0x14a20e){if(_0x14a20e){return _0x26720b[_0xff53('0x1a')](_0x34d670)[_0xff53('0x1b')](_0x14a20e);}};}function respondWithFilteredResult(_0x4fb23f,_0x3eae49){return function(_0x10eb35){if(_0x10eb35){var _0x399801=typeof _0x3eae49[_0xff53('0x1c')]===_0xff53('0x1d')&&typeof _0x3eae49[_0xff53('0x1e')]===_0xff53('0x1d');var _0x5d9679=_0x10eb35[_0xff53('0x1f')];var _0x4add53=_0x399801?0x0:_0x3eae49[_0xff53('0x1c')];var _0x50f442=_0x399801?_0x10eb35[_0xff53('0x1f')]:_0x3eae49[_0xff53('0x1c')]+_0x3eae49[_0xff53('0x1e')];var _0x445903;if(_0x50f442>=_0x5d9679){_0x50f442=_0x5d9679;_0x445903=0xc8;}else{_0x445903=0xce;}_0x4fb23f[_0xff53('0x1a')](_0x445903);return _0x4fb23f[_0xff53('0x20')](_0xff53('0x21'),_0x4add53+'-'+_0x50f442+'/'+_0x5d9679)[_0xff53('0x1b')](_0x10eb35);}return null;};}function patchUpdates(_0x4a21b8){return function(_0x5b3f91){try{jsonpatch[_0xff53('0x22')](_0x5b3f91,_0x4a21b8,!![]);}catch(_0x161f77){return BPromise[_0xff53('0x23')](_0x161f77);}return _0x5b3f91[_0xff53('0x24')]();};}function saveUpdates(_0x2d48db,_0x1270d1){return function(_0x5dc075){if(_0x5dc075){return _0x5dc075[_0xff53('0x25')](_0x2d48db)[_0xff53('0x26')](function(_0x24312c){return _0x24312c;});}return null;};}function removeEntity(_0x301afd,_0xf92b67){return function(_0x3ac85b){if(_0x3ac85b){return _0x3ac85b['destroy']()[_0xff53('0x26')](function(){_0x301afd[_0xff53('0x1a')](0xcc)[_0xff53('0x27')]();});}};}function handleEntityNotFound(_0x352ab0,_0x4abed5){return function(_0x547125){if(!_0x547125){_0x352ab0['sendStatus'](0x194);}return _0x547125;};}function handleError(_0x33484f,_0x18fd9c){_0x18fd9c=_0x18fd9c||0x1f4;return function(_0x475f20){logger['error'](_0x475f20['stack']);if(_0x475f20[_0xff53('0x28')]){delete _0x475f20['name'];}_0x33484f[_0xff53('0x1a')](_0x18fd9c)[_0xff53('0x29')](_0x475f20);};}exports['index']=function(_0x55881e,_0x1736ed){var _0x3912a8={},_0x1e8907={},_0x10e582={'count':0x0,'rows':[]};var _0x3e1333=_[_0xff53('0x2a')](db[_0xff53('0x2b')][_0xff53('0x2c')],function(_0x391a86){return{'name':_0x391a86[_0xff53('0x2d')],'type':_0x391a86['type'][_0xff53('0x2e')]};});_0x1e8907['model']=_[_0xff53('0x2a')](_0x3e1333,_0xff53('0x28'));_0x1e8907[_0xff53('0x2f')]=_[_0xff53('0x30')](_0x55881e['query']);_0x1e8907[_0xff53('0x31')]=_[_0xff53('0x32')](_0x1e8907['model'],_0x1e8907[_0xff53('0x2f')]);_0x3912a8[_0xff53('0x33')]=_[_0xff53('0x32')](_0x1e8907['model'],qs[_0xff53('0x34')](_0x55881e['query'][_0xff53('0x34')]));_0x3912a8[_0xff53('0x33')]=_0x3912a8[_0xff53('0x33')][_0xff53('0x35')]?_0x3912a8['attributes']:_0x1e8907[_0xff53('0x36')];if(!_0x55881e['query'][_0xff53('0x37')](_0xff53('0x38'))){_0x3912a8[_0xff53('0x1e')]=qs[_0xff53('0x1e')](_0x55881e[_0xff53('0x2f')][_0xff53('0x1e')]);_0x3912a8[_0xff53('0x1c')]=qs[_0xff53('0x1c')](_0x55881e['query']['offset']);}_0x3912a8['order']=qs['sort'](_0x55881e[_0xff53('0x2f')]['sort']);_0x3912a8['where']=qs[_0xff53('0x31')](_[_0xff53('0x39')](_0x55881e[_0xff53('0x2f')],_0x1e8907[_0xff53('0x31')]),_0x3e1333);if(_0x55881e['query'][_0xff53('0x3a')]){_0x3912a8[_0xff53('0x3b')]=_[_0xff53('0x3c')](_0x3912a8[_0xff53('0x3b')],{'$or':_[_0xff53('0x2a')](_0x3e1333,function(_0x4b5328){if(_0x4b5328['type']!==_0xff53('0x3d')){var _0x155949={};_0x155949[_0x4b5328['name']]={'$like':'%'+_0x55881e['query']['filter']+'%'};return _0x155949;}})});}_0x3912a8=_[_0xff53('0x3c')]({},_0x3912a8,_0x55881e[_0xff53('0x3e')]);var _0xb19f56={'where':_0x3912a8[_0xff53('0x3b')]};return db[_0xff53('0x2b')][_0xff53('0x1f')](_0xb19f56)[_0xff53('0x26')](function(_0x2072ab){_0x10e582[_0xff53('0x1f')]=_0x2072ab;if(_0x55881e[_0xff53('0x2f')][_0xff53('0x3f')]){_0x3912a8[_0xff53('0x40')]=[{'all':!![]}];}return db[_0xff53('0x2b')][_0xff53('0x41')](_0x3912a8);})[_0xff53('0x26')](function(_0x1c3373){_0x10e582[_0xff53('0x42')]=_0x1c3373;return _0x10e582;})[_0xff53('0x26')](respondWithFilteredResult(_0x1736ed,_0x3912a8))[_0xff53('0x43')](handleError(_0x1736ed,null));};exports[_0xff53('0x44')]=function(_0x49449a,_0x17114e){var _0x3cb239={'raw':!![],'where':{'id':_0x49449a[_0xff53('0x45')]['id']}},_0x5b8f52={};_0x5b8f52[_0xff53('0x36')]=_['keys'](db[_0xff53('0x2b')][_0xff53('0x2c')]);_0x5b8f52[_0xff53('0x2f')]=_['keys'](_0x49449a[_0xff53('0x2f')]);_0x5b8f52['filters']=_[_0xff53('0x32')](_0x5b8f52[_0xff53('0x36')],_0x5b8f52[_0xff53('0x2f')]);_0x3cb239[_0xff53('0x33')]=_[_0xff53('0x32')](_0x5b8f52[_0xff53('0x36')],qs['fields'](_0x49449a[_0xff53('0x2f')]['fields']));_0x3cb239[_0xff53('0x33')]=_0x3cb239['attributes'][_0xff53('0x35')]?_0x3cb239[_0xff53('0x33')]:_0x5b8f52[_0xff53('0x36')];if(_0x49449a[_0xff53('0x2f')]['includeAll']){_0x3cb239['include']=[{'all':!![]}];}_0x3cb239=_['merge']({},_0x3cb239,_0x49449a['options']);return db['SquareReport'][_0xff53('0x46')](_0x3cb239)[_0xff53('0x26')](handleEntityNotFound(_0x17114e,null))[_0xff53('0x26')](respondWithResult(_0x17114e,null))['catch'](handleError(_0x17114e,null));};exports['create']=function(_0x274ac8,_0x5c19e0){return db[_0xff53('0x2b')]['create'](_0x274ac8[_0xff53('0x47')],{})['then'](respondWithResult(_0x5c19e0,0xc9))[_0xff53('0x43')](handleError(_0x5c19e0,null));};exports[_0xff53('0x25')]=function(_0x390b5e,_0x1950d8){if(_0x390b5e['body']['id']){delete _0x390b5e[_0xff53('0x47')]['id'];}return db[_0xff53('0x2b')][_0xff53('0x46')]({'where':{'id':_0x390b5e[_0xff53('0x45')]['id']}})[_0xff53('0x26')](handleEntityNotFound(_0x1950d8,null))[_0xff53('0x26')](saveUpdates(_0x390b5e[_0xff53('0x47')],null))[_0xff53('0x26')](respondWithResult(_0x1950d8,null))[_0xff53('0x43')](handleError(_0x1950d8,null));};exports[_0xff53('0x48')]=function(_0x50d233,_0x8ac45e){return db['SquareReport'][_0xff53('0x46')]({'where':{'id':_0x50d233[_0xff53('0x45')]['id']}})[_0xff53('0x26')](handleEntityNotFound(_0x8ac45e,null))[_0xff53('0x26')](removeEntity(_0x8ac45e,null))[_0xff53('0x43')](handleError(_0x8ac45e,null));};exports[_0xff53('0x49')]=function(_0x16dad4,_0x424221){return db[_0xff53('0x2b')][_0xff53('0x49')]()[_0xff53('0x26')](respondWithResult(_0x424221,null))[_0xff53('0x43')](handleError(_0x424221,null));}; \ No newline at end of file +var _0x824c=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','index','SquareReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x54be74,_0x37c908){var _0x47da47=function(_0x233b4b){while(--_0x233b4b){_0x54be74['push'](_0x54be74['shift']());}};_0x47da47(++_0x37c908);}(_0x824c,0x85));var _0xc824=function(_0x7c488f,_0x45133d){_0x7c488f=_0x7c488f-0x0;var _0x1e7fa2=_0x824c[_0x7c488f];return _0x1e7fa2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc824('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc824('0x1'));var rp=require('request-promise');var moment=require(_0xc824('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc824('0x3'));var util=require(_0xc824('0x4'));var path=require(_0xc824('0x5'));var sox=require('sox');var csv=require(_0xc824('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc824('0x7'));var _=require('lodash');var squel=require(_0xc824('0x8'));var crypto=require(_0xc824('0x9'));var jsforce=require(_0xc824('0xa'));var deskjs=require(_0xc824('0xb'));var toCsv=require(_0xc824('0x6'));var querystring=require('querystring');var Papa=require(_0xc824('0xc'));var Redis=require(_0xc824('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc824('0xe'));var as=require(_0xc824('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc824('0x10'))(_0xc824('0x11'));var utils=require(_0xc824('0x12'));var config=require(_0xc824('0x13'));var licenseUtil=require(_0xc824('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4280a1,_0x4535b3){_0x4535b3=_0x4535b3||0xcc;return function(_0x384f17){if(_0x384f17){return _0x4280a1[_0xc824('0x15')](_0x4535b3);}return _0x4280a1[_0xc824('0x16')](_0x4535b3)[_0xc824('0x17')]();};}function respondWithResult(_0x1a3874,_0x1e93c1){_0x1e93c1=_0x1e93c1||0xc8;return function(_0x47f7a0){if(_0x47f7a0){return _0x1a3874[_0xc824('0x16')](_0x1e93c1)[_0xc824('0x18')](_0x47f7a0);}};}function respondWithFilteredResult(_0x198e22,_0x2fc1fa){return function(_0xdb0a38){if(_0xdb0a38){var _0x11e00d=typeof _0x2fc1fa[_0xc824('0x19')]===_0xc824('0x1a')&&typeof _0x2fc1fa[_0xc824('0x1b')]===_0xc824('0x1a');var _0x26caf6=_0xdb0a38[_0xc824('0x1c')];var _0x4b6792=_0x11e00d?0x0:_0x2fc1fa[_0xc824('0x19')];var _0x5b4a4a=_0x11e00d?_0xdb0a38[_0xc824('0x1c')]:_0x2fc1fa[_0xc824('0x19')]+_0x2fc1fa['limit'];var _0x5efd39;if(_0x5b4a4a>=_0x26caf6){_0x5b4a4a=_0x26caf6;_0x5efd39=0xc8;}else{_0x5efd39=0xce;}_0x198e22[_0xc824('0x16')](_0x5efd39);return _0x198e22[_0xc824('0x1d')]('Content-Range',_0x4b6792+'-'+_0x5b4a4a+'/'+_0x26caf6)[_0xc824('0x18')](_0xdb0a38);}return null;};}function patchUpdates(_0x4bef4d){return function(_0x2afd6c){try{jsonpatch['apply'](_0x2afd6c,_0x4bef4d,!![]);}catch(_0x164763){return BPromise[_0xc824('0x1e')](_0x164763);}return _0x2afd6c[_0xc824('0x1f')]();};}function saveUpdates(_0x4da329,_0x58ab6f){return function(_0x40008b){if(_0x40008b){return _0x40008b['update'](_0x4da329)[_0xc824('0x20')](function(_0x273359){return _0x273359;});}return null;};}function removeEntity(_0x556f71,_0x448769){return function(_0x4b9d05){if(_0x4b9d05){return _0x4b9d05[_0xc824('0x21')]()[_0xc824('0x20')](function(){_0x556f71[_0xc824('0x16')](0xcc)[_0xc824('0x17')]();});}};}function handleEntityNotFound(_0x425f90,_0x3d6b7c){return function(_0x51f7f9){if(!_0x51f7f9){_0x425f90[_0xc824('0x15')](0x194);}return _0x51f7f9;};}function handleError(_0x2b0ecc,_0x11cf19){_0x11cf19=_0x11cf19||0x1f4;return function(_0x1f046e){logger[_0xc824('0x22')](_0x1f046e[_0xc824('0x23')]);if(_0x1f046e[_0xc824('0x24')]){delete _0x1f046e[_0xc824('0x24')];}_0x2b0ecc[_0xc824('0x16')](_0x11cf19)['send'](_0x1f046e);};}exports[_0xc824('0x25')]=function(_0x4e8ff8,_0x5b7d3c){var _0x223d02={},_0x1bce4f={},_0x141168={'count':0x0,'rows':[]};var _0x2361b1=_['map'](db[_0xc824('0x26')][_0xc824('0x27')],function(_0x1685c5){return{'name':_0x1685c5['fieldName'],'type':_0x1685c5[_0xc824('0x28')][_0xc824('0x29')]};});_0x1bce4f[_0xc824('0x2a')]=_[_0xc824('0x2b')](_0x2361b1,_0xc824('0x24'));_0x1bce4f[_0xc824('0x2c')]=_[_0xc824('0x2d')](_0x4e8ff8[_0xc824('0x2c')]);_0x1bce4f[_0xc824('0x2e')]=_[_0xc824('0x2f')](_0x1bce4f['model'],_0x1bce4f[_0xc824('0x2c')]);_0x223d02['attributes']=_[_0xc824('0x2f')](_0x1bce4f[_0xc824('0x2a')],qs[_0xc824('0x30')](_0x4e8ff8[_0xc824('0x2c')][_0xc824('0x30')]));_0x223d02[_0xc824('0x31')]=_0x223d02['attributes'][_0xc824('0x32')]?_0x223d02[_0xc824('0x31')]:_0x1bce4f[_0xc824('0x2a')];if(!_0x4e8ff8[_0xc824('0x2c')][_0xc824('0x33')](_0xc824('0x34'))){_0x223d02[_0xc824('0x1b')]=qs['limit'](_0x4e8ff8[_0xc824('0x2c')]['limit']);_0x223d02[_0xc824('0x19')]=qs['offset'](_0x4e8ff8['query'][_0xc824('0x19')]);}_0x223d02[_0xc824('0x35')]=qs[_0xc824('0x36')](_0x4e8ff8[_0xc824('0x2c')][_0xc824('0x36')]);_0x223d02['where']=qs[_0xc824('0x2e')](_[_0xc824('0x37')](_0x4e8ff8[_0xc824('0x2c')],_0x1bce4f['filters']),_0x2361b1);if(_0x4e8ff8[_0xc824('0x2c')][_0xc824('0x38')]){_0x223d02[_0xc824('0x39')]=_['merge'](_0x223d02[_0xc824('0x39')],{'$or':_[_0xc824('0x2b')](_0x2361b1,function(_0x53e41b){if(_0x53e41b[_0xc824('0x28')]!==_0xc824('0x3a')){var _0x34c38c={};_0x34c38c[_0x53e41b[_0xc824('0x24')]]={'$like':'%'+_0x4e8ff8[_0xc824('0x2c')][_0xc824('0x38')]+'%'};return _0x34c38c;}})});}_0x223d02=_[_0xc824('0x3b')]({},_0x223d02,_0x4e8ff8[_0xc824('0x3c')]);var _0x5183bc={'where':_0x223d02[_0xc824('0x39')]};return db[_0xc824('0x26')]['count'](_0x5183bc)[_0xc824('0x20')](function(_0x849899){_0x141168['count']=_0x849899;if(_0x4e8ff8['query'][_0xc824('0x3d')]){_0x223d02[_0xc824('0x3e')]=[{'all':!![]}];}return db[_0xc824('0x26')][_0xc824('0x3f')](_0x223d02);})[_0xc824('0x20')](function(_0x3cf4ba){_0x141168[_0xc824('0x40')]=_0x3cf4ba;return _0x141168;})[_0xc824('0x20')](respondWithFilteredResult(_0x5b7d3c,_0x223d02))[_0xc824('0x41')](handleError(_0x5b7d3c,null));};exports['show']=function(_0x2907d5,_0x47d6f6){var _0x3debd8={'raw':!![],'where':{'id':_0x2907d5[_0xc824('0x42')]['id']}},_0x4b65fd={};_0x4b65fd[_0xc824('0x2a')]=_[_0xc824('0x2d')](db[_0xc824('0x26')][_0xc824('0x27')]);_0x4b65fd[_0xc824('0x2c')]=_[_0xc824('0x2d')](_0x2907d5['query']);_0x4b65fd['filters']=_[_0xc824('0x2f')](_0x4b65fd['model'],_0x4b65fd[_0xc824('0x2c')]);_0x3debd8[_0xc824('0x31')]=_['intersection'](_0x4b65fd[_0xc824('0x2a')],qs[_0xc824('0x30')](_0x2907d5['query']['fields']));_0x3debd8[_0xc824('0x31')]=_0x3debd8[_0xc824('0x31')][_0xc824('0x32')]?_0x3debd8[_0xc824('0x31')]:_0x4b65fd['model'];if(_0x2907d5[_0xc824('0x2c')]['includeAll']){_0x3debd8['include']=[{'all':!![]}];}_0x3debd8=_[_0xc824('0x3b')]({},_0x3debd8,_0x2907d5['options']);return db[_0xc824('0x26')][_0xc824('0x43')](_0x3debd8)['then'](handleEntityNotFound(_0x47d6f6,null))[_0xc824('0x20')](respondWithResult(_0x47d6f6,null))[_0xc824('0x41')](handleError(_0x47d6f6,null));};exports[_0xc824('0x44')]=function(_0x29cce7,_0x5f4b84){return db[_0xc824('0x26')][_0xc824('0x44')](_0x29cce7[_0xc824('0x45')],{})[_0xc824('0x20')](respondWithResult(_0x5f4b84,0xc9))[_0xc824('0x41')](handleError(_0x5f4b84,null));};exports[_0xc824('0x46')]=function(_0x3631fa,_0x3574b2){if(_0x3631fa[_0xc824('0x45')]['id']){delete _0x3631fa[_0xc824('0x45')]['id'];}return db[_0xc824('0x26')][_0xc824('0x43')]({'where':{'id':_0x3631fa[_0xc824('0x42')]['id']}})['then'](handleEntityNotFound(_0x3574b2,null))['then'](saveUpdates(_0x3631fa[_0xc824('0x45')],null))[_0xc824('0x20')](respondWithResult(_0x3574b2,null))[_0xc824('0x41')](handleError(_0x3574b2,null));};exports[_0xc824('0x21')]=function(_0x2cc2de,_0x4ac6a9){return db[_0xc824('0x26')][_0xc824('0x43')]({'where':{'id':_0x2cc2de[_0xc824('0x42')]['id']}})[_0xc824('0x20')](handleEntityNotFound(_0x4ac6a9,null))['then'](removeEntity(_0x4ac6a9,null))[_0xc824('0x41')](handleError(_0x4ac6a9,null));};exports[_0xc824('0x47')]=function(_0x65fad,_0x2ebd89){return db[_0xc824('0x26')][_0xc824('0x47')]()[_0xc824('0x20')](respondWithResult(_0x2ebd89,null))['catch'](handleError(_0x2ebd89,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b6dec7a..457d158 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 _0x187d=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name'];(function(_0xc6879,_0x84a966){var _0x54f7a4=function(_0x4e63eb){while(--_0x4e63eb){_0xc6879['push'](_0xc6879['shift']());}};_0x54f7a4(++_0x84a966);}(_0x187d,0x101));var _0xd187=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x187d[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xd187('0x0'));var util=require(_0xd187('0x1'));var logger=require(_0xd187('0x2'))(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var rp=require(_0xd187('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd187('0x7'));var config=require(_0xd187('0x8'));var attributes=require(_0xd187('0x9'));module[_0xd187('0xa')]=function(_0x219c20,_0x285b7a){return _0x219c20['define'](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd187('0xd'),_0xd187('0xe')]},{'name':_0xd187('0xf'),'fields':[_0xd187('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87eb=['report_square','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','SquareReport'];(function(_0x172096,_0x1efae4){var _0x5eb274=function(_0x4b9f26){while(--_0x4b9f26){_0x172096['push'](_0x172096['shift']());}};_0x5eb274(++_0x1efae4);}(_0x87eb,0x1b6));var _0xb87e=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x87eb[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xb87e('0x0'));var util=require(_0xb87e('0x1'));var logger=require('../../config/logger')(_0xb87e('0x2'));var moment=require(_0xb87e('0x3'));var BPromise=require(_0xb87e('0x4'));var rp=require(_0xb87e('0x5'));var fs=require('fs');var path=require(_0xb87e('0x6'));var rimraf=require('rimraf');var config=require(_0xb87e('0x7'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x52b25f,_0xe457a6){return _0x52b25f[_0xb87e('0x8')](_0xb87e('0x9'),attributes,{'tableName':_0xb87e('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xb87e('0xb'),_0xb87e('0xc')]},{'name':'leaveAt','fields':[_0xb87e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 642291b..2e59bf9 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 _0xe82b=['code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xe82b,0xfc));var _0xbe82=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe82b[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var moment=require(_0xbe82('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe82('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe82('0x4'))['db'];var utils=require(_0xbe82('0x5'));var logger=require(_0xbe82('0x6'))(_0xbe82('0x7'));var config=require(_0xbe82('0x8'));var jayson=require(_0xbe82('0x9'));var client=jayson[_0xbe82('0xa')][_0xbe82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39cbd7,_0x540364,_0x37d4a0){return new BPromise(function(_0x139da8,_0x41f23a){return client[_0xbe82('0xc')](_0x39cbd7,_0x37d4a0)[_0xbe82('0xd')](function(_0x57a209){logger[_0xbe82('0xe')](_0xbe82('0xf'),_0x540364,_0xbe82('0x10'));logger[_0xbe82('0x11')](_0xbe82('0x12'),_0x540364,'request\x20sent',JSON['stringify'](_0x57a209));if(_0x57a209[_0xbe82('0x13')]){if(_0x57a209['error'][_0xbe82('0x14')]===0x1f4){logger['error'](_0xbe82('0xf'),_0x540364,_0x57a209[_0xbe82('0x13')]['message']);return _0x41f23a(_0x57a209[_0xbe82('0x13')][_0xbe82('0x15')]);}logger[_0xbe82('0x13')]('SquareReport,\x20%s,\x20%s',_0x540364,_0x57a209[_0xbe82('0x13')][_0xbe82('0x15')]);return _0x139da8(_0x57a209[_0xbe82('0x13')][_0xbe82('0x15')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x540364,_0xbe82('0x10'));_0x139da8(_0x57a209[_0xbe82('0x16')][_0xbe82('0x15')]);}})[_0xbe82('0x17')](function(_0x5621ec){logger[_0xbe82('0x13')](_0xbe82('0xf'),_0x540364,_0x5621ec);_0x41f23a(_0x5621ec);});});}exports[_0xbe82('0x18')]=function(_0x496cc6){var _0x583385=this;return new Promise(function(_0x2996c6,_0x32b034){return db[_0xbe82('0x19')][_0xbe82('0x1a')](_0x496cc6[_0xbe82('0x1b')],{'raw':_0x496cc6[_0xbe82('0x1c')]?_0x496cc6['options'][_0xbe82('0x1d')]===undefined?!![]:![]:!![]})[_0xbe82('0xd')](function(_0x51dde6){logger[_0xbe82('0xe')](_0xbe82('0x18'),_0x496cc6);logger['debug'](_0xbe82('0x18'),_0x496cc6,JSON[_0xbe82('0x1e')](_0x51dde6));_0x2996c6(_0x51dde6);})[_0xbe82('0x17')](function(_0x54ef80){logger[_0xbe82('0x13')](_0xbe82('0x18'),_0x54ef80['message'],_0x496cc6);_0x32b034(_0x583385[_0xbe82('0x13')](0x1f4,_0x54ef80[_0xbe82('0x15')]));});});};exports[_0xbe82('0x1f')]=function(_0x2a2b76){var _0x2d94f0=this;return new Promise(function(_0x59c217,_0x55bcee){return db[_0xbe82('0x19')][_0xbe82('0x20')](_0x2a2b76['body'],{'raw':_0x2a2b76['options']?_0x2a2b76[_0xbe82('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a2b76[_0xbe82('0x1c')]?_0x2a2b76[_0xbe82('0x1c')]['where']||null:null,'attributes':_0x2a2b76[_0xbe82('0x1c')]?_0x2a2b76[_0xbe82('0x1c')][_0xbe82('0x21')]||null:null,'limit':_0x2a2b76[_0xbe82('0x1c')]?_0x2a2b76['options']['limit']||null:null})[_0xbe82('0xd')](function(_0x1d0b77){logger[_0xbe82('0xe')]('UpdateSquareReport',_0x2a2b76);logger['debug']('UpdateSquareReport',_0x2a2b76,JSON[_0xbe82('0x1e')](_0x1d0b77));_0x59c217(_0x1d0b77);})['catch'](function(_0x37f2b9){logger[_0xbe82('0x13')](_0xbe82('0x1f'),_0x37f2b9[_0xbe82('0x15')],_0x2a2b76);_0x55bcee(_0x2d94f0[_0xbe82('0x13')](0x1f4,_0x37f2b9['message']));});});}; \ No newline at end of file +var _0xb41c=['code','message','info','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4125fd,_0x4016d3){var _0x5a04ef=function(_0x2e98d7){while(--_0x2e98d7){_0x4125fd['push'](_0x4125fd['shift']());}};_0x5a04ef(++_0x4016d3);}(_0xb41c,0x106));var _0xcb41=function(_0x3dfaf8,_0x44c595){_0x3dfaf8=_0x3dfaf8-0x0;var _0x28ad5a=_0xb41c[_0x3dfaf8];return _0x28ad5a;};'use strict';var _=require('lodash');var util=require(_0xcb41('0x0'));var moment=require(_0xcb41('0x1'));var BPromise=require(_0xcb41('0x2'));var rs=require(_0xcb41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb41('0x4'))['db'];var utils=require(_0xcb41('0x5'));var logger=require('../../config/logger')(_0xcb41('0x6'));var config=require(_0xcb41('0x7'));var jayson=require(_0xcb41('0x8'));var client=jayson[_0xcb41('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33cf0d,_0x2c4646,_0x9d3b38){return new BPromise(function(_0xbdfd17,_0x2c072f){return client['request'](_0x33cf0d,_0x9d3b38)[_0xcb41('0xa')](function(_0x1aa274){logger['info'](_0xcb41('0xb'),_0x2c4646,_0xcb41('0xc'));logger[_0xcb41('0xd')](_0xcb41('0xe'),_0x2c4646,_0xcb41('0xc'),JSON[_0xcb41('0xf')](_0x1aa274));if(_0x1aa274[_0xcb41('0x10')]){if(_0x1aa274[_0xcb41('0x10')][_0xcb41('0x11')]===0x1f4){logger[_0xcb41('0x10')](_0xcb41('0xb'),_0x2c4646,_0x1aa274[_0xcb41('0x10')]['message']);return _0x2c072f(_0x1aa274['error'][_0xcb41('0x12')]);}logger[_0xcb41('0x10')]('SquareReport,\x20%s,\x20%s',_0x2c4646,_0x1aa274[_0xcb41('0x10')][_0xcb41('0x12')]);return _0xbdfd17(_0x1aa274[_0xcb41('0x10')][_0xcb41('0x12')]);}else{logger[_0xcb41('0x13')](_0xcb41('0xb'),_0x2c4646,_0xcb41('0xc'));_0xbdfd17(_0x1aa274['result'][_0xcb41('0x12')]);}})['catch'](function(_0x26a038){logger[_0xcb41('0x10')]('SquareReport,\x20%s,\x20%s',_0x2c4646,_0x26a038);_0x2c072f(_0x26a038);});});}exports[_0xcb41('0x14')]=function(_0x1dd88d){var _0x5ac944=this;return new Promise(function(_0x28f279,_0x200293){return db[_0xcb41('0x15')][_0xcb41('0x16')](_0x1dd88d[_0xcb41('0x17')],{'raw':_0x1dd88d[_0xcb41('0x18')]?_0x1dd88d[_0xcb41('0x18')][_0xcb41('0x19')]===undefined?!![]:![]:!![]})[_0xcb41('0xa')](function(_0x58c16b){logger[_0xcb41('0x13')](_0xcb41('0x14'),_0x1dd88d);logger[_0xcb41('0xd')](_0xcb41('0x14'),_0x1dd88d,JSON[_0xcb41('0xf')](_0x58c16b));_0x28f279(_0x58c16b);})[_0xcb41('0x1a')](function(_0x56a76a){logger[_0xcb41('0x10')](_0xcb41('0x14'),_0x56a76a['message'],_0x1dd88d);_0x200293(_0x5ac944[_0xcb41('0x10')](0x1f4,_0x56a76a['message']));});});};exports[_0xcb41('0x1b')]=function(_0x50380e){var _0x293163=this;return new Promise(function(_0x23ded6,_0x559899){return db[_0xcb41('0x15')][_0xcb41('0x1c')](_0x50380e[_0xcb41('0x17')],{'raw':_0x50380e[_0xcb41('0x18')]?_0x50380e[_0xcb41('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50380e[_0xcb41('0x18')]?_0x50380e[_0xcb41('0x18')][_0xcb41('0x1d')]||null:null,'attributes':_0x50380e[_0xcb41('0x18')]?_0x50380e[_0xcb41('0x18')][_0xcb41('0x1e')]||null:null,'limit':_0x50380e[_0xcb41('0x18')]?_0x50380e[_0xcb41('0x18')]['limit']||null:null})[_0xcb41('0xa')](function(_0x57ec6a){logger[_0xcb41('0x13')](_0xcb41('0x1b'),_0x50380e);logger[_0xcb41('0xd')](_0xcb41('0x1b'),_0x50380e,JSON[_0xcb41('0xf')](_0x57ec6a));_0x23ded6(_0x57ec6a);})[_0xcb41('0x1a')](function(_0x1195a9){logger[_0xcb41('0x10')](_0xcb41('0x1b'),_0x1195a9[_0xcb41('0x12')],_0x50380e);_0x559899(_0x293163[_0xcb41('0x10')](0x1f4,_0x1195a9[_0xcb41('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a689fdd..e2f6ac5 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 _0x726c=['fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x49a024,_0x583071){var _0x53d7e0=function(_0x3b3232){while(--_0x3b3232){_0x49a024['push'](_0x49a024['shift']());}};_0x53d7e0(++_0x583071);}(_0x726c,0x95));var _0xc726=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x726c[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0xc726('0x0'));var util=require(_0xc726('0x1'));var path=require('path');var timeout=require(_0xc726('0x2'));var express=require(_0xc726('0x3'));var router=express['Router']();var fs_extra=require(_0xc726('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc726('0x5'));var config=require(_0xc726('0x6'));var controller=require(_0xc726('0x7'));router[_0xc726('0x8')]('/',auth[_0xc726('0x9')](),controller['index']);router[_0xc726('0x8')](_0xc726('0xa'),auth['isAuthenticated'](),controller[_0xc726('0xb')]);router[_0xc726('0x8')](_0xc726('0xc'),auth[_0xc726('0x9')](),controller['show']);router['post']('/',auth[_0xc726('0x9')](),controller[_0xc726('0xd')]);router['put'](_0xc726('0xc'),auth[_0xc726('0x9')](),controller[_0xc726('0xe')]);router['delete'](_0xc726('0xc'),auth[_0xc726('0x9')](),controller[_0xc726('0xf')]);module[_0xc726('0x10')]=router; \ No newline at end of file +var _0xd6d5=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ede61,_0x82b7d1){var _0x4d75c4=function(_0x2d11d3){while(--_0x2d11d3){_0x4ede61['push'](_0x4ede61['shift']());}};_0x4d75c4(++_0x82b7d1);}(_0xd6d5,0x102));var _0x5d6d=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xd6d5[_0xc14df7];return _0x34a445;};'use strict';var multer=require(_0x5d6d('0x0'));var util=require(_0x5d6d('0x1'));var path=require('path');var timeout=require(_0x5d6d('0x2'));var express=require(_0x5d6d('0x3'));var router=express[_0x5d6d('0x4')]();var fs_extra=require(_0x5d6d('0x5'));var auth=require(_0x5d6d('0x6'));var interaction=require(_0x5d6d('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x5d6d('0x8')]('/',auth[_0x5d6d('0x9')](),controller[_0x5d6d('0xa')]);router[_0x5d6d('0x8')](_0x5d6d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x5d6d('0x8')](_0x5d6d('0xc'),auth['isAuthenticated'](),controller[_0x5d6d('0xd')]);router[_0x5d6d('0xe')]('/',auth[_0x5d6d('0x9')](),controller[_0x5d6d('0xf')]);router[_0x5d6d('0x10')]('/:id',auth[_0x5d6d('0x9')](),controller['update']);router['delete'](_0x5d6d('0xc'),auth['isAuthenticated'](),controller[_0x5d6d('0x11')]);module[_0x5d6d('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 45b1248..20650a3 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 _0x0724=['TEXT','sequelize','exports','STRING'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x0724,0xa5));var _0x4072=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0724[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4072('0x0'));module[_0x4072('0x1')]={'uniqueid':{'type':Sequelize[_0x4072('0x2')]},'node':{'type':Sequelize[_0x4072('0x2')]},'application':{'type':Sequelize[_0x4072('0x2')]},'data':{'type':Sequelize[_0x4072('0x3')]},'project_name':{'type':Sequelize[_0x4072('0x2')]},'callerid':{'type':Sequelize[_0x4072('0x2')]}}; \ No newline at end of file +var _0x0e1e=['TEXT','sequelize','exports','STRING'];(function(_0xe2b30f,_0x8dee3e){var _0x23f169=function(_0x53b175){while(--_0x53b175){_0xe2b30f['push'](_0xe2b30f['shift']());}};_0x23f169(++_0x8dee3e);}(_0x0e1e,0x13d));var _0xe0e1=function(_0x257ebd,_0x61b0b9){_0x257ebd=_0x257ebd-0x0;var _0x1ba9fc=_0x0e1e[_0x257ebd];return _0x1ba9fc;};'use strict';var Sequelize=require(_0xe0e1('0x0'));module[_0xe0e1('0x1')]={'uniqueid':{'type':Sequelize[_0xe0e1('0x2')]},'node':{'type':Sequelize[_0xe0e1('0x2')]},'application':{'type':Sequelize[_0xe0e1('0x2')]},'data':{'type':Sequelize[_0xe0e1('0x3')]},'project_name':{'type':Sequelize[_0xe0e1('0x2')]},'callerid':{'type':Sequelize[_0xe0e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b7bbbf0..5540d8f 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 _0xdc3a=['VIRTUAL','options','SquareDetailsReport','includeAll','findAll','rows','catch','show','params','include','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','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','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xdc3a,0x1e8));var _0xadc3=function(_0xe81a84,_0x1fafd4){_0xe81a84=_0xe81a84-0x0;var _0x314117=_0xdc3a[_0xe81a84];return _0x314117;};'use strict';var emlformat=require(_0xadc3('0x0'));var rimraf=require(_0xadc3('0x1'));var zipdir=require(_0xadc3('0x2'));var jsonpatch=require(_0xadc3('0x3'));var rp=require(_0xadc3('0x4'));var moment=require(_0xadc3('0x5'));var BPromise=require(_0xadc3('0x6'));var Mustache=require(_0xadc3('0x7'));var util=require(_0xadc3('0x8'));var path=require(_0xadc3('0x9'));var sox=require('sox');var csv=require(_0xadc3('0xa'));var ejs=require(_0xadc3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadc3('0xc'));var squel=require(_0xadc3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadc3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xadc3('0xf'));var Papa=require(_0xadc3('0x10'));var Redis=require(_0xadc3('0x11'));var authService=require(_0xadc3('0x12'));var qs=require(_0xadc3('0x13'));var as=require(_0xadc3('0x14'));var hardwareService=require(_0xadc3('0x15'));var logger=require(_0xadc3('0x16'))('api');var utils=require(_0xadc3('0x17'));var config=require(_0xadc3('0x18'));var licenseUtil=require(_0xadc3('0x19'));var db=require(_0xadc3('0x1a'))['db'];function respondWithStatusCode(_0x956312,_0x412934){_0x412934=_0x412934||0xcc;return function(_0x59ef21){if(_0x59ef21){return _0x956312['sendStatus'](_0x412934);}return _0x956312[_0xadc3('0x1b')](_0x412934)['end']();};}function respondWithResult(_0x390349,_0x4319f4){_0x4319f4=_0x4319f4||0xc8;return function(_0x3ebcb8){if(_0x3ebcb8){return _0x390349[_0xadc3('0x1b')](_0x4319f4)['json'](_0x3ebcb8);}};}function respondWithFilteredResult(_0x54af2a,_0x2e798f){return function(_0x26943c){if(_0x26943c){var _0x2c6b09=typeof _0x2e798f[_0xadc3('0x1c')]===_0xadc3('0x1d')&&typeof _0x2e798f[_0xadc3('0x1e')]===_0xadc3('0x1d');var _0x299415=_0x26943c[_0xadc3('0x1f')];var _0x22cb73=_0x2c6b09?0x0:_0x2e798f[_0xadc3('0x1c')];var _0x29565f=_0x2c6b09?_0x26943c['count']:_0x2e798f['offset']+_0x2e798f['limit'];var _0x42bbf1;if(_0x29565f>=_0x299415){_0x29565f=_0x299415;_0x42bbf1=0xc8;}else{_0x42bbf1=0xce;}_0x54af2a[_0xadc3('0x1b')](_0x42bbf1);return _0x54af2a[_0xadc3('0x20')](_0xadc3('0x21'),_0x22cb73+'-'+_0x29565f+'/'+_0x299415)['json'](_0x26943c);}return null;};}function patchUpdates(_0x15db07){return function(_0xbb7d4c){try{jsonpatch[_0xadc3('0x22')](_0xbb7d4c,_0x15db07,!![]);}catch(_0x16cb89){return BPromise[_0xadc3('0x23')](_0x16cb89);}return _0xbb7d4c[_0xadc3('0x24')]();};}function saveUpdates(_0x5c9155,_0x25776f){return function(_0x11e6fb){if(_0x11e6fb){return _0x11e6fb[_0xadc3('0x25')](_0x5c9155)[_0xadc3('0x26')](function(_0x5c595c){return _0x5c595c;});}return null;};}function removeEntity(_0x154538,_0x5f496f){return function(_0x15e651){if(_0x15e651){return _0x15e651['destroy']()[_0xadc3('0x26')](function(){_0x154538['status'](0xcc)[_0xadc3('0x27')]();});}};}function handleEntityNotFound(_0x49668b,_0x2aada0){return function(_0x408244){if(!_0x408244){_0x49668b[_0xadc3('0x28')](0x194);}return _0x408244;};}function handleError(_0x492b0a,_0x5b92e1){_0x5b92e1=_0x5b92e1||0x1f4;return function(_0x1258d4){logger[_0xadc3('0x29')](_0x1258d4['stack']);if(_0x1258d4[_0xadc3('0x2a')]){delete _0x1258d4['name'];}_0x492b0a[_0xadc3('0x1b')](_0x5b92e1)[_0xadc3('0x2b')](_0x1258d4);};}exports[_0xadc3('0x2c')]=function(_0x3cbeed,_0x594f11){var _0x1c9b02={},_0x23c4bd={},_0x5f2851={'count':0x0,'rows':[]};var _0x13afbf=_[_0xadc3('0x2d')](db['SquareDetailsReport'][_0xadc3('0x2e')],function(_0x2689d3){return{'name':_0x2689d3[_0xadc3('0x2f')],'type':_0x2689d3[_0xadc3('0x30')]['key']};});_0x23c4bd[_0xadc3('0x31')]=_['map'](_0x13afbf,'name');_0x23c4bd['query']=_[_0xadc3('0x32')](_0x3cbeed[_0xadc3('0x33')]);_0x23c4bd[_0xadc3('0x34')]=_[_0xadc3('0x35')](_0x23c4bd[_0xadc3('0x31')],_0x23c4bd[_0xadc3('0x33')]);_0x1c9b02[_0xadc3('0x36')]=_[_0xadc3('0x35')](_0x23c4bd[_0xadc3('0x31')],qs['fields'](_0x3cbeed[_0xadc3('0x33')][_0xadc3('0x37')]));_0x1c9b02['attributes']=_0x1c9b02[_0xadc3('0x36')][_0xadc3('0x38')]?_0x1c9b02[_0xadc3('0x36')]:_0x23c4bd[_0xadc3('0x31')];if(!_0x3cbeed['query'][_0xadc3('0x39')](_0xadc3('0x3a'))){_0x1c9b02[_0xadc3('0x1e')]=qs[_0xadc3('0x1e')](_0x3cbeed[_0xadc3('0x33')][_0xadc3('0x1e')]);_0x1c9b02[_0xadc3('0x1c')]=qs[_0xadc3('0x1c')](_0x3cbeed[_0xadc3('0x33')][_0xadc3('0x1c')]);}_0x1c9b02[_0xadc3('0x3b')]=qs[_0xadc3('0x3c')](_0x3cbeed[_0xadc3('0x33')][_0xadc3('0x3c')]);_0x1c9b02[_0xadc3('0x3d')]=qs[_0xadc3('0x34')](_[_0xadc3('0x3e')](_0x3cbeed[_0xadc3('0x33')],_0x23c4bd[_0xadc3('0x34')]),_0x13afbf);if(_0x3cbeed['query'][_0xadc3('0x3f')]){_0x1c9b02[_0xadc3('0x3d')]=_[_0xadc3('0x40')](_0x1c9b02[_0xadc3('0x3d')],{'$or':_['map'](_0x13afbf,function(_0x151ccf){if(_0x151ccf[_0xadc3('0x30')]!==_0xadc3('0x41')){var _0x586172={};_0x586172[_0x151ccf['name']]={'$like':'%'+_0x3cbeed['query'][_0xadc3('0x3f')]+'%'};return _0x586172;}})});}_0x1c9b02=_[_0xadc3('0x40')]({},_0x1c9b02,_0x3cbeed[_0xadc3('0x42')]);var _0x3adc9f={'where':_0x1c9b02['where']};return db[_0xadc3('0x43')][_0xadc3('0x1f')](_0x3adc9f)['then'](function(_0x24642c){_0x5f2851[_0xadc3('0x1f')]=_0x24642c;if(_0x3cbeed[_0xadc3('0x33')][_0xadc3('0x44')]){_0x1c9b02['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xadc3('0x45')](_0x1c9b02);})[_0xadc3('0x26')](function(_0x5058de){_0x5f2851[_0xadc3('0x46')]=_0x5058de;return _0x5f2851;})[_0xadc3('0x26')](respondWithFilteredResult(_0x594f11,_0x1c9b02))[_0xadc3('0x47')](handleError(_0x594f11,null));};exports[_0xadc3('0x48')]=function(_0x54b39b,_0x4ca848){var _0x49ff75={'raw':!![],'where':{'id':_0x54b39b[_0xadc3('0x49')]['id']}},_0x3ac36f={};_0x3ac36f[_0xadc3('0x31')]=_[_0xadc3('0x32')](db['SquareDetailsReport'][_0xadc3('0x2e')]);_0x3ac36f[_0xadc3('0x33')]=_[_0xadc3('0x32')](_0x54b39b['query']);_0x3ac36f['filters']=_[_0xadc3('0x35')](_0x3ac36f[_0xadc3('0x31')],_0x3ac36f[_0xadc3('0x33')]);_0x49ff75[_0xadc3('0x36')]=_['intersection'](_0x3ac36f[_0xadc3('0x31')],qs[_0xadc3('0x37')](_0x54b39b[_0xadc3('0x33')][_0xadc3('0x37')]));_0x49ff75[_0xadc3('0x36')]=_0x49ff75[_0xadc3('0x36')][_0xadc3('0x38')]?_0x49ff75[_0xadc3('0x36')]:_0x3ac36f['model'];if(_0x54b39b[_0xadc3('0x33')][_0xadc3('0x44')]){_0x49ff75[_0xadc3('0x4a')]=[{'all':!![]}];}_0x49ff75=_['merge']({},_0x49ff75,_0x54b39b[_0xadc3('0x42')]);return db[_0xadc3('0x43')][_0xadc3('0x4b')](_0x49ff75)['then'](handleEntityNotFound(_0x4ca848,null))[_0xadc3('0x26')](respondWithResult(_0x4ca848,null))[_0xadc3('0x47')](handleError(_0x4ca848,null));};exports['create']=function(_0x446b60,_0x17d2f8){return db[_0xadc3('0x43')]['create'](_0x446b60[_0xadc3('0x4c')],{})[_0xadc3('0x26')](respondWithResult(_0x17d2f8,0xc9))[_0xadc3('0x47')](handleError(_0x17d2f8,null));};exports[_0xadc3('0x25')]=function(_0x595814,_0x510a6d){if(_0x595814[_0xadc3('0x4c')]['id']){delete _0x595814[_0xadc3('0x4c')]['id'];}return db[_0xadc3('0x43')][_0xadc3('0x4b')]({'where':{'id':_0x595814[_0xadc3('0x49')]['id']}})[_0xadc3('0x26')](handleEntityNotFound(_0x510a6d,null))['then'](saveUpdates(_0x595814[_0xadc3('0x4c')],null))[_0xadc3('0x26')](respondWithResult(_0x510a6d,null))[_0xadc3('0x47')](handleError(_0x510a6d,null));};exports[_0xadc3('0x4d')]=function(_0x1e27aa,_0x4d42e2){return db[_0xadc3('0x43')][_0xadc3('0x4b')]({'where':{'id':_0x1e27aa[_0xadc3('0x49')]['id']}})[_0xadc3('0x26')](handleEntityNotFound(_0x4d42e2,null))[_0xadc3('0x26')](removeEntity(_0x4d42e2,null))[_0xadc3('0x47')](handleError(_0x4d42e2,null));};exports['describe']=function(_0x44b2ec,_0x3d295c){return db[_0xadc3('0x43')][_0xadc3('0x4e')]()[_0xadc3('0x26')](respondWithResult(_0x3d295c,null))['catch'](handleError(_0x3d295c,null));}; \ No newline at end of file +var _0xe48d=['type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','index','map','SquareDetailsReport','fieldName'];(function(_0x396dbf,_0x37df8c){var _0x9141=function(_0x4d9d0f){while(--_0x4d9d0f){_0x396dbf['push'](_0x396dbf['shift']());}};_0x9141(++_0x37df8c);}(_0xe48d,0x14e));var _0xde48=function(_0x32fc3a,_0x5da8e6){_0x32fc3a=_0x32fc3a-0x0;var _0x444d1d=_0xe48d[_0x32fc3a];return _0x444d1d;};'use strict';var emlformat=require(_0xde48('0x0'));var rimraf=require(_0xde48('0x1'));var zipdir=require(_0xde48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde48('0x3'));var moment=require(_0xde48('0x4'));var BPromise=require(_0xde48('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde48('0x6'));var sox=require(_0xde48('0x7'));var csv=require(_0xde48('0x8'));var ejs=require(_0xde48('0x9'));var fs=require('fs');var fs_extra=require(_0xde48('0xa'));var _=require(_0xde48('0xb'));var squel=require(_0xde48('0xc'));var crypto=require(_0xde48('0xd'));var jsforce=require(_0xde48('0xe'));var deskjs=require(_0xde48('0xf'));var toCsv=require('to-csv');var querystring=require(_0xde48('0x10'));var Papa=require(_0xde48('0x11'));var Redis=require(_0xde48('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xde48('0x13'));var as=require(_0xde48('0x14'));var hardwareService=require(_0xde48('0x15'));var logger=require(_0xde48('0x16'))('api');var utils=require(_0xde48('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde48('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f90d,_0x3a52c5){_0x3a52c5=_0x3a52c5||0xcc;return function(_0x19fb05){if(_0x19fb05){return _0x12f90d['sendStatus'](_0x3a52c5);}return _0x12f90d['status'](_0x3a52c5)[_0xde48('0x19')]();};}function respondWithResult(_0x53adfe,_0x163e67){_0x163e67=_0x163e67||0xc8;return function(_0x47cd8b){if(_0x47cd8b){return _0x53adfe[_0xde48('0x1a')](_0x163e67)[_0xde48('0x1b')](_0x47cd8b);}};}function respondWithFilteredResult(_0xa9252a,_0x31215f){return function(_0x54bc28){if(_0x54bc28){var _0x146a0c=typeof _0x31215f['offset']===_0xde48('0x1c')&&typeof _0x31215f[_0xde48('0x1d')]===_0xde48('0x1c');var _0x599c0e=_0x54bc28[_0xde48('0x1e')];var _0x41cf7c=_0x146a0c?0x0:_0x31215f['offset'];var _0xc6678e=_0x146a0c?_0x54bc28['count']:_0x31215f['offset']+_0x31215f[_0xde48('0x1d')];var _0x38a151;if(_0xc6678e>=_0x599c0e){_0xc6678e=_0x599c0e;_0x38a151=0xc8;}else{_0x38a151=0xce;}_0xa9252a[_0xde48('0x1a')](_0x38a151);return _0xa9252a[_0xde48('0x1f')](_0xde48('0x20'),_0x41cf7c+'-'+_0xc6678e+'/'+_0x599c0e)['json'](_0x54bc28);}return null;};}function patchUpdates(_0x3c2dad){return function(_0x5260bc){try{jsonpatch[_0xde48('0x21')](_0x5260bc,_0x3c2dad,!![]);}catch(_0x1b6e07){return BPromise[_0xde48('0x22')](_0x1b6e07);}return _0x5260bc[_0xde48('0x23')]();};}function saveUpdates(_0x3bc0ab,_0x4d38f8){return function(_0x759fb2){if(_0x759fb2){return _0x759fb2[_0xde48('0x24')](_0x3bc0ab)['then'](function(_0xa00c06){return _0xa00c06;});}return null;};}function removeEntity(_0x51b231,_0x2116d9){return function(_0x363897){if(_0x363897){return _0x363897[_0xde48('0x25')]()[_0xde48('0x26')](function(){_0x51b231[_0xde48('0x1a')](0xcc)[_0xde48('0x19')]();});}};}function handleEntityNotFound(_0x16d8e1,_0x43d7a4){return function(_0x8110c9){if(!_0x8110c9){_0x16d8e1[_0xde48('0x27')](0x194);}return _0x8110c9;};}function handleError(_0x1c9494,_0x338cc1){_0x338cc1=_0x338cc1||0x1f4;return function(_0x24c18f){logger['error'](_0x24c18f[_0xde48('0x28')]);if(_0x24c18f[_0xde48('0x29')]){delete _0x24c18f[_0xde48('0x29')];}_0x1c9494['status'](_0x338cc1)['send'](_0x24c18f);};}exports[_0xde48('0x2a')]=function(_0x20b7bd,_0x3c6905){var _0x7fc144={},_0x51d72b={},_0x2230fb={'count':0x0,'rows':[]};var _0x962069=_[_0xde48('0x2b')](db[_0xde48('0x2c')]['rawAttributes'],function(_0x46844e){return{'name':_0x46844e[_0xde48('0x2d')],'type':_0x46844e[_0xde48('0x2e')][_0xde48('0x2f')]};});_0x51d72b[_0xde48('0x30')]=_[_0xde48('0x2b')](_0x962069,'name');_0x51d72b[_0xde48('0x31')]=_[_0xde48('0x32')](_0x20b7bd['query']);_0x51d72b[_0xde48('0x33')]=_['intersection'](_0x51d72b[_0xde48('0x30')],_0x51d72b['query']);_0x7fc144['attributes']=_[_0xde48('0x34')](_0x51d72b[_0xde48('0x30')],qs['fields'](_0x20b7bd[_0xde48('0x31')]['fields']));_0x7fc144['attributes']=_0x7fc144[_0xde48('0x35')][_0xde48('0x36')]?_0x7fc144[_0xde48('0x35')]:_0x51d72b[_0xde48('0x30')];if(!_0x20b7bd[_0xde48('0x31')][_0xde48('0x37')](_0xde48('0x38'))){_0x7fc144[_0xde48('0x1d')]=qs[_0xde48('0x1d')](_0x20b7bd[_0xde48('0x31')][_0xde48('0x1d')]);_0x7fc144['offset']=qs['offset'](_0x20b7bd['query'][_0xde48('0x39')]);}_0x7fc144[_0xde48('0x3a')]=qs[_0xde48('0x3b')](_0x20b7bd[_0xde48('0x31')][_0xde48('0x3b')]);_0x7fc144[_0xde48('0x3c')]=qs['filters'](_[_0xde48('0x3d')](_0x20b7bd[_0xde48('0x31')],_0x51d72b[_0xde48('0x33')]),_0x962069);if(_0x20b7bd[_0xde48('0x31')][_0xde48('0x3e')]){_0x7fc144[_0xde48('0x3c')]=_[_0xde48('0x3f')](_0x7fc144['where'],{'$or':_[_0xde48('0x2b')](_0x962069,function(_0x44827b){if(_0x44827b[_0xde48('0x2e')]!=='VIRTUAL'){var _0x272a5d={};_0x272a5d[_0x44827b[_0xde48('0x29')]]={'$like':'%'+_0x20b7bd['query'][_0xde48('0x3e')]+'%'};return _0x272a5d;}})});}_0x7fc144=_[_0xde48('0x3f')]({},_0x7fc144,_0x20b7bd[_0xde48('0x40')]);var _0x28492c={'where':_0x7fc144[_0xde48('0x3c')]};return db['SquareDetailsReport'][_0xde48('0x1e')](_0x28492c)[_0xde48('0x26')](function(_0x5318f3){_0x2230fb[_0xde48('0x1e')]=_0x5318f3;if(_0x20b7bd[_0xde48('0x31')][_0xde48('0x41')]){_0x7fc144[_0xde48('0x42')]=[{'all':!![]}];}return db[_0xde48('0x2c')][_0xde48('0x43')](_0x7fc144);})['then'](function(_0x406257){_0x2230fb[_0xde48('0x44')]=_0x406257;return _0x2230fb;})[_0xde48('0x26')](respondWithFilteredResult(_0x3c6905,_0x7fc144))[_0xde48('0x45')](handleError(_0x3c6905,null));};exports['show']=function(_0x12a3de,_0x4b9112){var _0x54a8d0={'raw':!![],'where':{'id':_0x12a3de[_0xde48('0x46')]['id']}},_0x42751b={};_0x42751b['model']=_[_0xde48('0x32')](db[_0xde48('0x2c')]['rawAttributes']);_0x42751b[_0xde48('0x31')]=_['keys'](_0x12a3de[_0xde48('0x31')]);_0x42751b[_0xde48('0x33')]=_[_0xde48('0x34')](_0x42751b[_0xde48('0x30')],_0x42751b[_0xde48('0x31')]);_0x54a8d0[_0xde48('0x35')]=_[_0xde48('0x34')](_0x42751b[_0xde48('0x30')],qs['fields'](_0x12a3de['query'][_0xde48('0x47')]));_0x54a8d0['attributes']=_0x54a8d0[_0xde48('0x35')]['length']?_0x54a8d0['attributes']:_0x42751b[_0xde48('0x30')];if(_0x12a3de[_0xde48('0x31')][_0xde48('0x41')]){_0x54a8d0[_0xde48('0x42')]=[{'all':!![]}];}_0x54a8d0=_['merge']({},_0x54a8d0,_0x12a3de[_0xde48('0x40')]);return db['SquareDetailsReport']['find'](_0x54a8d0)[_0xde48('0x26')](handleEntityNotFound(_0x4b9112,null))[_0xde48('0x26')](respondWithResult(_0x4b9112,null))[_0xde48('0x45')](handleError(_0x4b9112,null));};exports[_0xde48('0x48')]=function(_0x447d4a,_0x29cec2){return db[_0xde48('0x2c')][_0xde48('0x48')](_0x447d4a[_0xde48('0x49')],{})[_0xde48('0x26')](respondWithResult(_0x29cec2,0xc9))[_0xde48('0x45')](handleError(_0x29cec2,null));};exports[_0xde48('0x24')]=function(_0x5c0b8f,_0x1b4bd5){if(_0x5c0b8f[_0xde48('0x49')]['id']){delete _0x5c0b8f[_0xde48('0x49')]['id'];}return db['SquareDetailsReport'][_0xde48('0x4a')]({'where':{'id':_0x5c0b8f['params']['id']}})[_0xde48('0x26')](handleEntityNotFound(_0x1b4bd5,null))[_0xde48('0x26')](saveUpdates(_0x5c0b8f[_0xde48('0x49')],null))[_0xde48('0x26')](respondWithResult(_0x1b4bd5,null))[_0xde48('0x45')](handleError(_0x1b4bd5,null));};exports[_0xde48('0x25')]=function(_0x28177e,_0x41ab75){return db['SquareDetailsReport']['find']({'where':{'id':_0x28177e['params']['id']}})[_0xde48('0x26')](handleEntityNotFound(_0x41ab75,null))[_0xde48('0x26')](removeEntity(_0x41ab75,null))[_0xde48('0x45')](handleError(_0x41ab75,null));};exports[_0xde48('0x4b')]=function(_0x509bff,_0x4cb06e){return db[_0xde48('0x2c')][_0xde48('0x4b')]()[_0xde48('0x26')](respondWithResult(_0x4cb06e,null))['catch'](handleError(_0x4cb06e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 24c4da3..14c08bc 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 _0x0457=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','api'];(function(_0x1c4cb2,_0x370de9){var _0xe28537=function(_0x184b4d){while(--_0x184b4d){_0x1c4cb2['push'](_0x1c4cb2['shift']());}};_0xe28537(++_0x370de9);}(_0x0457,0xbe));var _0x7045=function(_0x164e8f,_0xdba27a){_0x164e8f=_0x164e8f-0x0;var _0x2b2840=_0x0457[_0x164e8f];return _0x2b2840;};'use strict';var _=require(_0x7045('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7045('0x1'));var moment=require(_0x7045('0x2'));var BPromise=require(_0x7045('0x3'));var rp=require(_0x7045('0x4'));var fs=require('fs');var path=require(_0x7045('0x5'));var rimraf=require(_0x7045('0x6'));var config=require(_0x7045('0x7'));var attributes=require(_0x7045('0x8'));module[_0x7045('0x9')]=function(_0x5d28dd,_0x5a9fb8){return _0x5d28dd['define'](_0x7045('0xa'),attributes,{'tableName':_0x7045('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb553=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x21af31,_0xc951fa){var _0x24fa69=function(_0x123801){while(--_0x123801){_0x21af31['push'](_0x21af31['shift']());}};_0x24fa69(++_0xc951fa);}(_0xb553,0xaf));var _0x3b55=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xb553[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x3b55('0x0'));var util=require(_0x3b55('0x1'));var logger=require(_0x3b55('0x2'))('api');var moment=require(_0x3b55('0x3'));var BPromise=require(_0x3b55('0x4'));var rp=require(_0x3b55('0x5'));var fs=require('fs');var path=require(_0x3b55('0x6'));var rimraf=require('rimraf');var config=require(_0x3b55('0x7'));var attributes=require(_0x3b55('0x8'));module[_0x3b55('0x9')]=function(_0x260ece,_0x3fbfa6){return _0x260ece[_0x3b55('0xa')](_0x3b55('0xb'),attributes,{'tableName':_0x3b55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 6c3b168..1a48fc0 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 _0x5ec6=['randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment'];(function(_0x398705,_0x3cc941){var _0x1dd32e=function(_0x13e405){while(--_0x13e405){_0x398705['push'](_0x398705['shift']());}};_0x1dd32e(++_0x3cc941);}(_0x5ec6,0x7f));var _0x65ec=function(_0x12af2d,_0x3c99fb){_0x12af2d=_0x12af2d-0x0;var _0x42e3e3=_0x5ec6[_0x12af2d];return _0x42e3e3;};'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')]('SquareDetailsReport,\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);});});}exports[_0x65ec('0x14')]=function(_0x1254f8){var _0xb4ed90=this;return new Promise(function(_0x29ebc4,_0xd81ed3){return db[_0x65ec('0x15')][_0x65ec('0x16')](_0x1254f8[_0x65ec('0x17')],{'raw':_0x1254f8[_0x65ec('0x18')]?_0x1254f8[_0x65ec('0x18')][_0x65ec('0x19')]===undefined?!![]:![]:!![]})[_0x65ec('0xa')](function(_0x1467ac){logger[_0x65ec('0x12')](_0x65ec('0x14'),_0x1254f8);logger[_0x65ec('0xc')](_0x65ec('0x14'),_0x1254f8,JSON[_0x65ec('0xe')](_0x1467ac));_0x29ebc4(_0x1467ac);})['catch'](function(_0x170703){logger[_0x65ec('0xf')](_0x65ec('0x14'),_0x170703[_0x65ec('0x11')],_0x1254f8);_0xd81ed3(_0xb4ed90[_0x65ec('0xf')](0x1f4,_0x170703[_0x65ec('0x11')]));});});}; \ No newline at end of file +var _0x793b=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x793b,0x189));var _0xb793=function(_0x12b139,_0x2c3861){_0x12b139=_0x12b139-0x0;var _0x1cc443=_0x793b[_0x12b139];return _0x1cc443;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}exports[_0xb793('0x16')]=function(_0x977026){var _0x2914a2=this;return new Promise(function(_0x2c9e87,_0x101162){return db[_0xb793('0x17')][_0xb793('0x18')](_0x977026[_0xb793('0x19')],{'raw':_0x977026[_0xb793('0x1a')]?_0x977026['options'][_0xb793('0x1b')]===undefined?!![]:![]:!![]})[_0xb793('0xc')](function(_0x54bfd4){logger[_0xb793('0xd')](_0xb793('0x16'),_0x977026);logger[_0xb793('0xf')](_0xb793('0x16'),_0x977026,JSON[_0xb793('0x1c')](_0x54bfd4));_0x2c9e87(_0x54bfd4);})['catch'](function(_0x5ecf9c){logger[_0xb793('0x11')](_0xb793('0x16'),_0x5ecf9c[_0xb793('0x12')],_0x977026);_0x101162(_0x2914a2[_0xb793('0x11')](0x1f4,_0x5ecf9c[_0xb793('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 2b35021..13756b9 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 _0x94a4=['exports','express','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x150667,_0x4c0be9){var _0x35b307=function(_0x15244b){while(--_0x15244b){_0x150667['push'](_0x150667['shift']());}};_0x35b307(++_0x4c0be9);}(_0x94a4,0x9b));var _0x494a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x94a4[_0x42cae2];return _0x5f256f;};'use strict';var express=require(_0x494a('0x0'));var router=express['Router']();var auth=require(_0x494a('0x1'));var controller=require('./system.controller');router[_0x494a('0x2')]('/',auth[_0x494a('0x3')](),controller['index']);router['get'](_0x494a('0x4'),auth[_0x494a('0x3')](),controller[_0x494a('0x5')]);module[_0x494a('0x6')]=router; \ No newline at end of file +var _0xaf39=['Router','../../components/auth/service','./system.controller','isAuthenticated','index','/process/:pid/kill','killProcess','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf39,0x19f));var _0x9af3=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0xaf39[_0x2831cf];return _0x5ec206;};'use strict';var express=require(_0x9af3('0x0'));var router=express[_0x9af3('0x1')]();var auth=require(_0x9af3('0x2'));var controller=require(_0x9af3('0x3'));router['get']('/',auth[_0x9af3('0x4')](),controller[_0x9af3('0x5')]);router['get'](_0x9af3('0x6'),auth[_0x9af3('0x4')](),controller[_0x9af3('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a1cc061..6f5c474 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 _0x9675=['inspect','status','send','getAllData','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','killProcess','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9675,0x99));var _0x5967=function(_0x23c8ce,_0x39a64a){_0x23c8ce=_0x23c8ce-0x0;var _0x15a245=_0x9675[_0x23c8ce];return _0x15a245;};'use strict';var info=require(_0x5967('0x0'));var exec=require(_0x5967('0x1'))[_0x5967('0x2')];var logger=require(_0x5967('0x3'))('api');var util=require(_0x5967('0x4'));var BPromise=require(_0x5967('0x5'));var _=require(_0x5967('0x6'));function handleError(_0x23781a,_0x5030eb,_0x276dd5){_0x5030eb=_0x5030eb||0x1f4;return function(_0x58e44a){logger[_0x5967('0x7')](_0x5967('0x8'),_0x276dd5,_0x5030eb,util[_0x5967('0x9')](_0x58e44a,{'showHidden':![],'depth':null}));delete _0x58e44a['name'];_0x23781a[_0x5967('0xa')](_0x5030eb)[_0x5967('0xb')](_0x58e44a);};}exports['index']=function(_0x64665,_0x1d0b95){return info[_0x5967('0xc')]()['then'](function(_0x358a10){return _0x1d0b95[_0x5967('0xa')](0xc8)[_0x5967('0xd')](_0x358a10);})[_0x5967('0xe')](function(_0x543c33){return _0x1d0b95[_0x5967('0xa')](0x1f4)[_0x5967('0xd')](_0x543c33);});};exports['killProcess']=function(_0x405c3e,_0x2ba2a8){var _0x439d19=[_0x5967('0xf')];return new BPromise(function(_0x3e465c,_0x54b79a){return exec(util[_0x5967('0x10')](_0x5967('0x11'),_0x405c3e[_0x5967('0x12')][_0x5967('0x13')]),function(_0x2032de,_0x3e2d89,_0x58c442){if(_0x2032de){return _0x54b79a(_0x2032de);}return _0x3e465c(_0x3e2d89);});})[_0x5967('0x14')](function(_0x4f2b01){var _0x2247a3=![];var _0x5265c4=_0x4f2b01[_0x5967('0x15')](/\n/);for(var _0x16a532=0x0,_0x2035c0=_0x439d19[_0x5967('0x16')];_0x16a532<_0x2035c0,_0x2247a3===![];_0x16a532+=0x1){if(_0x4f2b01[_0x5967('0x17')](_0x439d19[_0x16a532])>=0x0){_0x2247a3=!![];}}if(!_0x2247a3){throw new Error(util[_0x5967('0x10')](_0x5967('0x18'),_0x405c3e[_0x5967('0x12')][_0x5967('0x13')]));}process[_0x5967('0x19')](_0x405c3e['params'][_0x5967('0x13')],'SIGINT');return _0x2ba2a8[_0x5967('0xa')](0xc8)[_0x5967('0xd')]({'message':util[_0x5967('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x405c3e[_0x5967('0x12')]['pid'])});})['catch'](handleError(_0x2ba2a8,null,_0x5967('0x1a')));}; \ No newline at end of file +var _0xe4bd=['api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger'];(function(_0x1c4d1d,_0x4099e1){var _0x1a8dd6=function(_0x59c119){while(--_0x59c119){_0x1c4d1d['push'](_0x1c4d1d['shift']());}};_0x1a8dd6(++_0x4099e1);}(_0xe4bd,0xdd));var _0xde4b=function(_0x23c8d1,_0x2923cc){_0x23c8d1=_0x23c8d1-0x0;var _0x509402=_0xe4bd[_0x23c8d1];return _0x509402;};'use strict';var info=require(_0xde4b('0x0'));var exec=require(_0xde4b('0x1'))['exec'];var logger=require(_0xde4b('0x2'))(_0xde4b('0x3'));var util=require(_0xde4b('0x4'));var BPromise=require('bluebird');var _=require(_0xde4b('0x5'));function handleError(_0x3c0691,_0x694ede,_0x26e7e9){_0x694ede=_0x694ede||0x1f4;return function(_0x54889e){logger['error'](_0xde4b('0x6'),_0x26e7e9,_0x694ede,util[_0xde4b('0x7')](_0x54889e,{'showHidden':![],'depth':null}));delete _0x54889e[_0xde4b('0x8')];_0x3c0691[_0xde4b('0x9')](_0x694ede)[_0xde4b('0xa')](_0x54889e);};}exports[_0xde4b('0xb')]=function(_0x3081ca,_0x1b26df){return info[_0xde4b('0xc')]()[_0xde4b('0xd')](function(_0x707acf){return _0x1b26df[_0xde4b('0x9')](0xc8)[_0xde4b('0xe')](_0x707acf);})['catch'](function(_0x453745){return _0x1b26df['status'](0x1f4)[_0xde4b('0xe')](_0x453745);});};exports[_0xde4b('0xf')]=function(_0x11bf14,_0x48a8df){var _0x36e341=[_0xde4b('0x10')];return new BPromise(function(_0xbdda95,_0x1136d5){return exec(util[_0xde4b('0x11')](_0xde4b('0x12'),_0x11bf14[_0xde4b('0x13')][_0xde4b('0x14')]),function(_0x28fce2,_0x5ee7f2,_0x2724ad){if(_0x28fce2){return _0x1136d5(_0x28fce2);}return _0xbdda95(_0x5ee7f2);});})[_0xde4b('0xd')](function(_0x42f1cf){var _0x46e65b=![];var _0x191f26=_0x42f1cf[_0xde4b('0x15')](/\n/);for(var _0x41acfa=0x0,_0x4548cd=_0x36e341[_0xde4b('0x16')];_0x41acfa<_0x4548cd,_0x46e65b===![];_0x41acfa+=0x1){if(_0x42f1cf[_0xde4b('0x17')](_0x36e341[_0x41acfa])>=0x0){_0x46e65b=!![];}}if(!_0x46e65b){throw new Error(util[_0xde4b('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x11bf14[_0xde4b('0x13')][_0xde4b('0x14')]));}process[_0xde4b('0x18')](_0x11bf14[_0xde4b('0x13')]['pid'],_0xde4b('0x19'));return _0x48a8df[_0xde4b('0x9')](0xc8)[_0xde4b('0xe')]({'message':util[_0xde4b('0x11')](_0xde4b('0x1a'),_0x11bf14[_0xde4b('0x13')][_0xde4b('0x14')])});})[_0xde4b('0x1b')](handleError(_0x48a8df,null,_0xde4b('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 068c7e2..4551051 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 _0x0120=['../../config/environment','./tag.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc6dbb4,_0x3fd27e){var _0xd5e8a9=function(_0x5adc40){while(--_0x5adc40){_0xc6dbb4['push'](_0xc6dbb4['shift']());}};_0xd5e8a9(++_0x3fd27e);}(_0x0120,0x6f));var _0x0012=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x0120[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var fs_extra=require(_0x0012('0x6'));var auth=require(_0x0012('0x7'));var interaction=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var controller=require(_0x0012('0xa'));router[_0x0012('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0xe')]);router[_0x0012('0xf')]('/',auth[_0x0012('0xd')](),controller['create']);router[_0x0012('0x10')](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0x11')]);router['delete'](_0x0012('0xc'),auth['isAuthenticated'](),controller[_0x0012('0x12')]);module[_0x0012('0x13')]=router; \ No newline at end of file +var _0xf0ba=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf0ba,0x7a));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var path=require(_0xaf0b('0x2'));var timeout=require(_0xaf0b('0x3'));var express=require(_0xaf0b('0x4'));var router=express['Router']();var fs_extra=require(_0xaf0b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf0b('0x6'));var config=require(_0xaf0b('0x7'));var controller=require(_0xaf0b('0x8'));router[_0xaf0b('0x9')]('/',auth[_0xaf0b('0xa')](),controller[_0xaf0b('0xb')]);router[_0xaf0b('0x9')](_0xaf0b('0xc'),auth[_0xaf0b('0xa')](),controller[_0xaf0b('0xd')]);router[_0xaf0b('0xe')]('/',auth[_0xaf0b('0xa')](),controller[_0xaf0b('0xf')]);router[_0xaf0b('0x10')](_0xaf0b('0xc'),auth[_0xaf0b('0xa')](),controller[_0xaf0b('0x11')]);router[_0xaf0b('0x12')](_0xaf0b('0xc'),auth['isAuthenticated'](),controller[_0xaf0b('0x13')]);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 bed085b..4abcca0 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 _0x152f=['sequelize','exports','STRING','name'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x152f,0x144));var _0xf152=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x152f[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'name':{'type':Sequelize[_0xf152('0x2')],'unique':_0xf152('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf152('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xf152('0x2')]}}; \ No newline at end of file +var _0xe0dd=['sequelize','exports','name','STRING','#0091EA'];(function(_0x323413,_0x421d63){var _0xe2aca0=function(_0x427f9c){while(--_0x427f9c){_0x323413['push'](_0x323413['shift']());}};_0xe2aca0(++_0x421d63);}(_0xe0dd,0x163));var _0xde0d=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0xe0dd[_0x3f9584];return _0x9d54c;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xde0d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xde0d('0x3')],'defaultValue':_0xde0d('0x4')},'description':{'type':Sequelize[_0xde0d('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index dbe5ac4..f74e3b0 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 _0x5712=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','save','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','user','get','role','userProfileId','autoAssociation','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x5b984b,_0x355e68){var _0x52e07d=function(_0x5b5064){while(--_0x5b5064){_0x5b984b['push'](_0x5b984b['shift']());}};_0x52e07d(++_0x355e68);}(_0x5712,0x140));var _0x2571=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5712[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x2571('0x0'));var rimraf=require(_0x2571('0x1'));var zipdir=require(_0x2571('0x2'));var jsonpatch=require(_0x2571('0x3'));var rp=require(_0x2571('0x4'));var moment=require(_0x2571('0x5'));var BPromise=require(_0x2571('0x6'));var Mustache=require(_0x2571('0x7'));var util=require(_0x2571('0x8'));var path=require(_0x2571('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2571('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2571('0xb'));var squel=require(_0x2571('0xc'));var crypto=require(_0x2571('0xd'));var jsforce=require(_0x2571('0xe'));var deskjs=require(_0x2571('0xf'));var toCsv=require(_0x2571('0x10'));var querystring=require('querystring');var Papa=require(_0x2571('0x11'));var Redis=require('ioredis');var authService=require(_0x2571('0x12'));var qs=require(_0x2571('0x13'));var as=require(_0x2571('0x14'));var hardwareService=require(_0x2571('0x15'));var logger=require(_0x2571('0x16'))(_0x2571('0x17'));var utils=require(_0x2571('0x18'));var config=require(_0x2571('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d3ed,_0x1ab846){_0x1ab846=_0x1ab846||0xcc;return function(_0x10823d){if(_0x10823d){return _0x33d3ed[_0x2571('0x1a')](_0x1ab846);}return _0x33d3ed[_0x2571('0x1b')](_0x1ab846)[_0x2571('0x1c')]();};}function respondWithResult(_0x241129,_0x130ab1){_0x130ab1=_0x130ab1||0xc8;return function(_0xdf8c3a){if(_0xdf8c3a){return _0x241129[_0x2571('0x1b')](_0x130ab1)[_0x2571('0x1d')](_0xdf8c3a);}};}function respondWithFilteredResult(_0x3c1a08,_0x5b0392){return function(_0x30b0f2){if(_0x30b0f2){var _0x47b5e9=typeof _0x5b0392['offset']==='undefined'&&typeof _0x5b0392['limit']===_0x2571('0x1e');var _0x371ae2=_0x30b0f2[_0x2571('0x1f')];var _0x75af2a=_0x47b5e9?0x0:_0x5b0392['offset'];var _0x7707=_0x47b5e9?_0x30b0f2[_0x2571('0x1f')]:_0x5b0392['offset']+_0x5b0392[_0x2571('0x20')];var _0x7303ad;if(_0x7707>=_0x371ae2){_0x7707=_0x371ae2;_0x7303ad=0xc8;}else{_0x7303ad=0xce;}_0x3c1a08[_0x2571('0x1b')](_0x7303ad);return _0x3c1a08[_0x2571('0x21')](_0x2571('0x22'),_0x75af2a+'-'+_0x7707+'/'+_0x371ae2)['json'](_0x30b0f2);}return null;};}function patchUpdates(_0x52da27){return function(_0x5fe030){try{jsonpatch[_0x2571('0x23')](_0x5fe030,_0x52da27,!![]);}catch(_0x58f6aa){return BPromise['reject'](_0x58f6aa);}return _0x5fe030[_0x2571('0x24')]();};}function saveUpdates(_0x2e7d89,_0x2218fb){return function(_0xb6dfa6){if(_0xb6dfa6){return _0xb6dfa6['update'](_0x2e7d89)[_0x2571('0x25')](function(_0x55ec06){return _0x55ec06;});}return null;};}function removeEntity(_0x1ec23c,_0x4316b1){return function(_0x5d6778){if(_0x5d6778){return _0x5d6778[_0x2571('0x26')]()[_0x2571('0x25')](function(){var _0x22cdb8=_0x5d6778['get']({'plain':!![]});var _0x5d455d=_0x2571('0x27');return db[_0x2571('0x28')][_0x2571('0x26')]({'where':{'type':_0x5d455d,'resourceId':_0x22cdb8['id']}})[_0x2571('0x25')](function(){return _0x5d6778;});})[_0x2571('0x25')](function(){_0x1ec23c[_0x2571('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6ccc,_0x1ceb21){return function(_0x426615){if(!_0x426615){_0x4f6ccc[_0x2571('0x1a')](0x194);}return _0x426615;};}function handleError(_0x2ce206,_0x26757a){_0x26757a=_0x26757a||0x1f4;return function(_0x165aa8){logger[_0x2571('0x29')](_0x165aa8[_0x2571('0x2a')]);if(_0x165aa8[_0x2571('0x2b')]){delete _0x165aa8[_0x2571('0x2b')];}_0x2ce206['status'](_0x26757a)[_0x2571('0x2c')](_0x165aa8);};}exports[_0x2571('0x2d')]=function(_0x26af3c,_0x441e7d){var _0x1bf5d1={},_0x2902cb={},_0x5bc2e7={'count':0x0,'rows':[]};var _0x4c4911=_[_0x2571('0x2e')](db[_0x2571('0x2f')][_0x2571('0x30')],function(_0x2b6416){return{'name':_0x2b6416['fieldName'],'type':_0x2b6416[_0x2571('0x31')][_0x2571('0x32')]};});_0x2902cb['model']=_['map'](_0x4c4911,_0x2571('0x2b'));_0x2902cb[_0x2571('0x33')]=_[_0x2571('0x34')](_0x26af3c['query']);_0x2902cb[_0x2571('0x35')]=_[_0x2571('0x36')](_0x2902cb['model'],_0x2902cb[_0x2571('0x33')]);_0x1bf5d1['attributes']=_[_0x2571('0x36')](_0x2902cb[_0x2571('0x37')],qs[_0x2571('0x38')](_0x26af3c['query']['fields']));_0x1bf5d1[_0x2571('0x39')]=_0x1bf5d1['attributes'][_0x2571('0x3a')]?_0x1bf5d1[_0x2571('0x39')]:_0x2902cb[_0x2571('0x37')];if(!_0x26af3c[_0x2571('0x33')]['hasOwnProperty'](_0x2571('0x3b'))){_0x1bf5d1[_0x2571('0x20')]=qs['limit'](_0x26af3c[_0x2571('0x33')][_0x2571('0x20')]);_0x1bf5d1['offset']=qs[_0x2571('0x3c')](_0x26af3c[_0x2571('0x33')][_0x2571('0x3c')]);}_0x1bf5d1[_0x2571('0x3d')]=qs[_0x2571('0x3e')](_0x26af3c[_0x2571('0x33')][_0x2571('0x3e')]);_0x1bf5d1[_0x2571('0x3f')]=qs[_0x2571('0x35')](_[_0x2571('0x40')](_0x26af3c[_0x2571('0x33')],_0x2902cb[_0x2571('0x35')]),_0x4c4911);if(_0x26af3c[_0x2571('0x33')][_0x2571('0x41')]){_0x1bf5d1['where']=_[_0x2571('0x42')](_0x1bf5d1[_0x2571('0x3f')],{'$or':_[_0x2571('0x2e')](_0x4c4911,function(_0x440752){if(_0x440752[_0x2571('0x31')]!==_0x2571('0x43')){var _0x35deff={};_0x35deff[_0x440752['name']]={'$like':'%'+_0x26af3c[_0x2571('0x33')][_0x2571('0x41')]+'%'};return _0x35deff;}})});}_0x1bf5d1=_[_0x2571('0x42')]({},_0x1bf5d1,_0x26af3c['options']);var _0x5fe079={'where':_0x1bf5d1[_0x2571('0x3f')]};return db[_0x2571('0x2f')]['count'](_0x5fe079)[_0x2571('0x25')](function(_0x1c6ccd){_0x5bc2e7[_0x2571('0x1f')]=_0x1c6ccd;if(_0x26af3c[_0x2571('0x33')][_0x2571('0x44')]){_0x1bf5d1[_0x2571('0x45')]=[{'all':!![]}];}return db[_0x2571('0x2f')][_0x2571('0x46')](_0x1bf5d1);})[_0x2571('0x25')](function(_0x5d2734){_0x5bc2e7[_0x2571('0x47')]=_0x5d2734;return _0x5bc2e7;})[_0x2571('0x25')](respondWithFilteredResult(_0x441e7d,_0x1bf5d1))[_0x2571('0x48')](handleError(_0x441e7d,null));};exports[_0x2571('0x49')]=function(_0x2411d9,_0x1e6f2c){var _0x391c01={'raw':!![],'where':{'id':_0x2411d9['params']['id']}},_0x2d024c={};_0x2d024c['model']=_['keys'](db['Tag']['rawAttributes']);_0x2d024c['query']=_[_0x2571('0x34')](_0x2411d9[_0x2571('0x33')]);_0x2d024c['filters']=_[_0x2571('0x36')](_0x2d024c[_0x2571('0x37')],_0x2d024c[_0x2571('0x33')]);_0x391c01[_0x2571('0x39')]=_[_0x2571('0x36')](_0x2d024c['model'],qs['fields'](_0x2411d9['query'][_0x2571('0x38')]));_0x391c01[_0x2571('0x39')]=_0x391c01[_0x2571('0x39')][_0x2571('0x3a')]?_0x391c01[_0x2571('0x39')]:_0x2d024c[_0x2571('0x37')];if(_0x2411d9[_0x2571('0x33')]['includeAll']){_0x391c01[_0x2571('0x45')]=[{'all':!![]}];}_0x391c01=_[_0x2571('0x42')]({},_0x391c01,_0x2411d9[_0x2571('0x4a')]);return db['Tag'][_0x2571('0x4b')](_0x391c01)[_0x2571('0x25')](handleEntityNotFound(_0x1e6f2c,null))[_0x2571('0x25')](respondWithResult(_0x1e6f2c,null))[_0x2571('0x48')](handleError(_0x1e6f2c,null));};exports['create']=function(_0x18291c,_0x245edb){return db[_0x2571('0x2f')][_0x2571('0x4c')](_0x18291c['body'],{})[_0x2571('0x25')](function(_0xef8f21){var _0x10d956=_0x18291c[_0x2571('0x4d')][_0x2571('0x4e')]({'plain':!![]});if(!_0x10d956)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10d956[_0x2571('0x4f')]===_0x2571('0x4d')){var _0x20302b=_0xef8f21[_0x2571('0x4e')]({'plain':!![]});var _0x6a55ff=_0x2571('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x6a55ff,'userProfileId':_0x10d956[_0x2571('0x50')]},'raw':!![]})['then'](function(_0x47ff18){if(_0x47ff18&&_0x47ff18[_0x2571('0x51')]===0x0){return db[_0x2571('0x28')][_0x2571('0x4c')]({'name':_0x20302b[_0x2571('0x2b')],'resourceId':_0x20302b['id'],'type':_0x47ff18[_0x2571('0x2b')],'sectionId':_0x47ff18['id']},{})[_0x2571('0x25')](function(){return _0xef8f21;});}else{return _0xef8f21;}})[_0x2571('0x48')](function(_0x3c890a){logger[_0x2571('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c890a);throw _0x3c890a;});}return _0xef8f21;})[_0x2571('0x25')](respondWithResult(_0x245edb,0xc9))[_0x2571('0x48')](handleError(_0x245edb,null));};exports[_0x2571('0x52')]=function(_0x495c45,_0x3823c9){if(_0x495c45['body']['id']){delete _0x495c45[_0x2571('0x53')]['id'];}return db[_0x2571('0x2f')][_0x2571('0x4b')]({'where':{'id':_0x495c45['params']['id']}})['then'](handleEntityNotFound(_0x3823c9,null))['then'](saveUpdates(_0x495c45['body'],null))[_0x2571('0x25')](respondWithResult(_0x3823c9,null))[_0x2571('0x48')](handleError(_0x3823c9,null));};exports[_0x2571('0x26')]=function(_0x3ce2b9,_0x333b91){return db[_0x2571('0x2f')][_0x2571('0x4b')]({'where':{'id':_0x3ce2b9[_0x2571('0x54')]['id']}})[_0x2571('0x25')](handleEntityNotFound(_0x333b91,null))[_0x2571('0x25')](removeEntity(_0x333b91,null))[_0x2571('0x48')](handleError(_0x333b91,null));}; \ No newline at end of file +var _0x5db8=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','merge','includeAll','findAll','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Tags','error','stack','name','send','index','map','Tag','fieldName','type','key','query','keys','intersection'];(function(_0x35beef,_0xb40b1e){var _0x5b91d6=function(_0x23dac9){while(--_0x23dac9){_0x35beef['push'](_0x35beef['shift']());}};_0x5b91d6(++_0xb40b1e);}(_0x5db8,0xbb));var _0x85db=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x5db8[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0x85db('0x0'));var rimraf=require(_0x85db('0x1'));var zipdir=require(_0x85db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85db('0x3'));var moment=require(_0x85db('0x4'));var BPromise=require(_0x85db('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x85db('0x6'));var sox=require(_0x85db('0x7'));var csv=require(_0x85db('0x8'));var ejs=require(_0x85db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85db('0xa'));var crypto=require(_0x85db('0xb'));var jsforce=require(_0x85db('0xc'));var deskjs=require(_0x85db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85db('0xe'));var Papa=require('papaparse');var Redis=require(_0x85db('0xf'));var authService=require(_0x85db('0x10'));var qs=require(_0x85db('0x11'));var as=require(_0x85db('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x85db('0x13'));var config=require(_0x85db('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x85db('0x15'))['db'];function respondWithStatusCode(_0x541f2f,_0x437f7a){_0x437f7a=_0x437f7a||0xcc;return function(_0x35f8c6){if(_0x35f8c6){return _0x541f2f[_0x85db('0x16')](_0x437f7a);}return _0x541f2f[_0x85db('0x17')](_0x437f7a)[_0x85db('0x18')]();};}function respondWithResult(_0xb7ea66,_0x2b7507){_0x2b7507=_0x2b7507||0xc8;return function(_0x25ec64){if(_0x25ec64){return _0xb7ea66[_0x85db('0x17')](_0x2b7507)[_0x85db('0x19')](_0x25ec64);}};}function respondWithFilteredResult(_0x1e9dec,_0x270fd7){return function(_0x2be61d){if(_0x2be61d){var _0x5ccfef=typeof _0x270fd7[_0x85db('0x1a')]===_0x85db('0x1b')&&typeof _0x270fd7[_0x85db('0x1c')]===_0x85db('0x1b');var _0x2ecd71=_0x2be61d[_0x85db('0x1d')];var _0x3209b3=_0x5ccfef?0x0:_0x270fd7['offset'];var _0x37ac04=_0x5ccfef?_0x2be61d[_0x85db('0x1d')]:_0x270fd7[_0x85db('0x1a')]+_0x270fd7[_0x85db('0x1c')];var _0x4d976d;if(_0x37ac04>=_0x2ecd71){_0x37ac04=_0x2ecd71;_0x4d976d=0xc8;}else{_0x4d976d=0xce;}_0x1e9dec[_0x85db('0x17')](_0x4d976d);return _0x1e9dec[_0x85db('0x1e')](_0x85db('0x1f'),_0x3209b3+'-'+_0x37ac04+'/'+_0x2ecd71)[_0x85db('0x19')](_0x2be61d);}return null;};}function patchUpdates(_0x107c10){return function(_0x5c37d7){try{jsonpatch[_0x85db('0x20')](_0x5c37d7,_0x107c10,!![]);}catch(_0x398aa2){return BPromise[_0x85db('0x21')](_0x398aa2);}return _0x5c37d7[_0x85db('0x22')]();};}function saveUpdates(_0x44c122,_0x3842d7){return function(_0x3a7148){if(_0x3a7148){return _0x3a7148[_0x85db('0x23')](_0x44c122)['then'](function(_0xfffea2){return _0xfffea2;});}return null;};}function removeEntity(_0x2534bc,_0x57fe5b){return function(_0x3381ec){if(_0x3381ec){return _0x3381ec[_0x85db('0x24')]()[_0x85db('0x25')](function(){var _0x51c948=_0x3381ec[_0x85db('0x26')]({'plain':!![]});var _0x46f428=_0x85db('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x46f428,'resourceId':_0x51c948['id']}})['then'](function(){return _0x3381ec;});})[_0x85db('0x25')](function(){_0x2534bc[_0x85db('0x17')](0xcc)[_0x85db('0x18')]();});}};}function handleEntityNotFound(_0x51b748,_0x71c6f4){return function(_0xc2abb8){if(!_0xc2abb8){_0x51b748[_0x85db('0x16')](0x194);}return _0xc2abb8;};}function handleError(_0x574bcc,_0x5c8ddd){_0x5c8ddd=_0x5c8ddd||0x1f4;return function(_0x299013){logger[_0x85db('0x28')](_0x299013[_0x85db('0x29')]);if(_0x299013[_0x85db('0x2a')]){delete _0x299013[_0x85db('0x2a')];}_0x574bcc[_0x85db('0x17')](_0x5c8ddd)[_0x85db('0x2b')](_0x299013);};}exports[_0x85db('0x2c')]=function(_0x6ee161,_0x1edc8d){var _0x580e90={},_0x4a15b9={},_0x13ad98={'count':0x0,'rows':[]};var _0x5e0e75=_[_0x85db('0x2d')](db[_0x85db('0x2e')]['rawAttributes'],function(_0x1d15b0){return{'name':_0x1d15b0[_0x85db('0x2f')],'type':_0x1d15b0[_0x85db('0x30')][_0x85db('0x31')]};});_0x4a15b9['model']=_[_0x85db('0x2d')](_0x5e0e75,_0x85db('0x2a'));_0x4a15b9[_0x85db('0x32')]=_[_0x85db('0x33')](_0x6ee161[_0x85db('0x32')]);_0x4a15b9['filters']=_[_0x85db('0x34')](_0x4a15b9[_0x85db('0x35')],_0x4a15b9[_0x85db('0x32')]);_0x580e90[_0x85db('0x36')]=_['intersection'](_0x4a15b9[_0x85db('0x35')],qs[_0x85db('0x37')](_0x6ee161[_0x85db('0x32')]['fields']));_0x580e90['attributes']=_0x580e90[_0x85db('0x36')][_0x85db('0x38')]?_0x580e90['attributes']:_0x4a15b9[_0x85db('0x35')];if(!_0x6ee161[_0x85db('0x32')][_0x85db('0x39')](_0x85db('0x3a'))){_0x580e90[_0x85db('0x1c')]=qs[_0x85db('0x1c')](_0x6ee161[_0x85db('0x32')][_0x85db('0x1c')]);_0x580e90[_0x85db('0x1a')]=qs[_0x85db('0x1a')](_0x6ee161[_0x85db('0x32')][_0x85db('0x1a')]);}_0x580e90['order']=qs[_0x85db('0x3b')](_0x6ee161[_0x85db('0x32')][_0x85db('0x3b')]);_0x580e90[_0x85db('0x3c')]=qs['filters'](_[_0x85db('0x3d')](_0x6ee161[_0x85db('0x32')],_0x4a15b9[_0x85db('0x3e')]),_0x5e0e75);if(_0x6ee161[_0x85db('0x32')]['filter']){_0x580e90['where']=_['merge'](_0x580e90['where'],{'$or':_['map'](_0x5e0e75,function(_0x3b9d1b){if(_0x3b9d1b[_0x85db('0x30')]!==_0x85db('0x3f')){var _0x17f649={};_0x17f649[_0x3b9d1b[_0x85db('0x2a')]]={'$like':'%'+_0x6ee161['query']['filter']+'%'};return _0x17f649;}})});}_0x580e90=_[_0x85db('0x40')]({},_0x580e90,_0x6ee161['options']);var _0x9f2d7f={'where':_0x580e90[_0x85db('0x3c')]};return db['Tag']['count'](_0x9f2d7f)[_0x85db('0x25')](function(_0x928808){_0x13ad98[_0x85db('0x1d')]=_0x928808;if(_0x6ee161[_0x85db('0x32')][_0x85db('0x41')]){_0x580e90['include']=[{'all':!![]}];}return db[_0x85db('0x2e')][_0x85db('0x42')](_0x580e90);})[_0x85db('0x25')](function(_0x5be721){_0x13ad98['rows']=_0x5be721;return _0x13ad98;})['then'](respondWithFilteredResult(_0x1edc8d,_0x580e90))[_0x85db('0x43')](handleError(_0x1edc8d,null));};exports[_0x85db('0x44')]=function(_0x116cb3,_0x57677d){var _0x5ef59b={'raw':!![],'where':{'id':_0x116cb3['params']['id']}},_0x3e4dbc={};_0x3e4dbc[_0x85db('0x35')]=_[_0x85db('0x33')](db[_0x85db('0x2e')]['rawAttributes']);_0x3e4dbc[_0x85db('0x32')]=_[_0x85db('0x33')](_0x116cb3[_0x85db('0x32')]);_0x3e4dbc[_0x85db('0x3e')]=_[_0x85db('0x34')](_0x3e4dbc[_0x85db('0x35')],_0x3e4dbc[_0x85db('0x32')]);_0x5ef59b[_0x85db('0x36')]=_[_0x85db('0x34')](_0x3e4dbc['model'],qs[_0x85db('0x37')](_0x116cb3[_0x85db('0x32')][_0x85db('0x37')]));_0x5ef59b[_0x85db('0x36')]=_0x5ef59b[_0x85db('0x36')][_0x85db('0x38')]?_0x5ef59b['attributes']:_0x3e4dbc[_0x85db('0x35')];if(_0x116cb3[_0x85db('0x32')][_0x85db('0x41')]){_0x5ef59b['include']=[{'all':!![]}];}_0x5ef59b=_['merge']({},_0x5ef59b,_0x116cb3[_0x85db('0x45')]);return db['Tag'][_0x85db('0x46')](_0x5ef59b)[_0x85db('0x25')](handleEntityNotFound(_0x57677d,null))[_0x85db('0x25')](respondWithResult(_0x57677d,null))[_0x85db('0x43')](handleError(_0x57677d,null));};exports[_0x85db('0x47')]=function(_0x5e1455,_0x5d44ef){return db[_0x85db('0x2e')][_0x85db('0x47')](_0x5e1455[_0x85db('0x48')],{})[_0x85db('0x25')](function(_0x1b6157){var _0x107882=_0x5e1455[_0x85db('0x49')][_0x85db('0x26')]({'plain':!![]});if(!_0x107882)throw new Error(_0x85db('0x4a'));if(_0x107882[_0x85db('0x4b')]==='user'){var _0x69c505=_0x1b6157[_0x85db('0x26')]({'plain':!![]});var _0x54abf5='Tags';return db[_0x85db('0x4c')][_0x85db('0x46')]({'where':{'name':_0x54abf5,'userProfileId':_0x107882['userProfileId']},'raw':!![]})['then'](function(_0x74b926){if(_0x74b926&&_0x74b926[_0x85db('0x4d')]===0x0){return db['UserProfileResource'][_0x85db('0x47')]({'name':_0x69c505[_0x85db('0x2a')],'resourceId':_0x69c505['id'],'type':_0x74b926[_0x85db('0x2a')],'sectionId':_0x74b926['id']},{})[_0x85db('0x25')](function(){return _0x1b6157;});}else{return _0x1b6157;}})[_0x85db('0x43')](function(_0x2cddad){logger[_0x85db('0x28')](_0x85db('0x4e'),_0x2cddad);throw _0x2cddad;});}return _0x1b6157;})[_0x85db('0x25')](respondWithResult(_0x5d44ef,0xc9))[_0x85db('0x43')](handleError(_0x5d44ef,null));};exports['update']=function(_0x4ef4db,_0x283b13){if(_0x4ef4db[_0x85db('0x48')]['id']){delete _0x4ef4db[_0x85db('0x48')]['id'];}return db[_0x85db('0x2e')][_0x85db('0x46')]({'where':{'id':_0x4ef4db[_0x85db('0x4f')]['id']}})[_0x85db('0x25')](handleEntityNotFound(_0x283b13,null))[_0x85db('0x25')](saveUpdates(_0x4ef4db[_0x85db('0x48')],null))[_0x85db('0x25')](respondWithResult(_0x283b13,null))[_0x85db('0x43')](handleError(_0x283b13,null));};exports[_0x85db('0x24')]=function(_0x198dad,_0x425e61){return db['Tag'][_0x85db('0x46')]({'where':{'id':_0x198dad[_0x85db('0x4f')]['id']}})['then'](handleEntityNotFound(_0x425e61,null))[_0x85db('0x25')](removeEntity(_0x425e61,null))[_0x85db('0x43')](handleError(_0x425e61,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 31c27ca..98b0683 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 _0x43a1=['exports','define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x3ea609,_0x4dd140){var _0x2ca054=function(_0x89f00c){while(--_0x89f00c){_0x3ea609['push'](_0x3ea609['shift']());}};_0x2ca054(++_0x4dd140);}(_0x43a1,0x138));var _0x143a=function(_0xb509c2,_0xc778dd){_0xb509c2=_0xb509c2-0x0;var _0x1a63e1=_0x43a1[_0xb509c2];return _0x1a63e1;};'use strict';var _=require(_0x143a('0x0'));var util=require('util');var logger=require(_0x143a('0x1'))(_0x143a('0x2'));var moment=require(_0x143a('0x3'));var BPromise=require(_0x143a('0x4'));var rp=require(_0x143a('0x5'));var fs=require('fs');var path=require(_0x143a('0x6'));var rimraf=require(_0x143a('0x7'));var config=require(_0x143a('0x8'));var attributes=require(_0x143a('0x9'));module[_0x143a('0xa')]=function(_0x1cefa5,_0x6cbfe0){return _0x1cefa5[_0x143a('0xb')](_0x143a('0xc'),attributes,{'tableName':_0x143a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85e0=['path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3aa379,_0x5bec75){var _0x442c97=function(_0x63387d){while(--_0x63387d){_0x3aa379['push'](_0x3aa379['shift']());}};_0x442c97(++_0x5bec75);}(_0x85e0,0x85));var _0x085e=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x85e0[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0x085e('0x0'));var util=require(_0x085e('0x1'));var logger=require(_0x085e('0x2'))(_0x085e('0x3'));var moment=require(_0x085e('0x4'));var BPromise=require(_0x085e('0x5'));var rp=require(_0x085e('0x6'));var fs=require('fs');var path=require(_0x085e('0x7'));var rimraf=require(_0x085e('0x8'));var config=require(_0x085e('0x9'));var attributes=require(_0x085e('0xa'));module[_0x085e('0xb')]=function(_0x2bc39e,_0x5d1d92){return _0x2bc39e['define'](_0x085e('0xc'),attributes,{'tableName':_0x085e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 0a28e7c..8bbda01 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb81=['lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x49a798,_0x38dbfa){var _0x215214=function(_0x8fd8b5){while(--_0x8fd8b5){_0x49a798['push'](_0x49a798['shift']());}};_0x215214(++_0x38dbfa);}(_0xcb81,0x154));var _0x1cb8=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xcb81[_0x3132e8];return _0x43eb8c;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var moment=require('moment');var BPromise=require(_0x1cb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1cb8('0x3'));var logger=require(_0x1cb8('0x4'))(_0x1cb8('0x5'));var config=require(_0x1cb8('0x6'));var jayson=require(_0x1cb8('0x7'));var client=jayson['client'][_0x1cb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ac2d6,_0x584b16,_0x2408c2){return new BPromise(function(_0x39b4ad,_0x282fd8){return client['request'](_0x2ac2d6,_0x2408c2)[_0x1cb8('0x9')](function(_0x51dc9e){logger['info'](_0x1cb8('0xa'),_0x584b16,_0x1cb8('0xb'));logger[_0x1cb8('0xc')](_0x1cb8('0xd'),_0x584b16,_0x1cb8('0xb'),JSON[_0x1cb8('0xe')](_0x51dc9e));if(_0x51dc9e[_0x1cb8('0xf')]){if(_0x51dc9e[_0x1cb8('0xf')]['code']===0x1f4){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x282fd8(_0x51dc9e[_0x1cb8('0xf')]['message']);}logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x39b4ad(_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);}else{logger[_0x1cb8('0x11')](_0x1cb8('0xa'),_0x584b16,'request\x20sent');_0x39b4ad(_0x51dc9e[_0x1cb8('0x12')]['message']);}})[_0x1cb8('0x13')](function(_0x28b8ff){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x28b8ff);_0x282fd8(_0x28b8ff);});});} \ No newline at end of file +var _0xe644=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index bd6ba8f..1c39380 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index ed8d7e7..26726d5 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 _0xb10b=['name','sequelize','STRING'];(function(_0x122336,_0x4828b4){var _0x23462d=function(_0x5341eb){while(--_0x5341eb){_0x122336['push'](_0x122336['shift']());}};_0x23462d(++_0x4828b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x425ea3,_0x26b830){_0x425ea3=_0x425ea3-0x0;var _0x54f159=_0xb10b[_0x425ea3];return _0x54f159;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index dc255aa..f689170 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 _0xd18d=['Queues','add','ids','ValidationError','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','UserVoicePrefix','spread','removeAgents','Queue:remove','getAgents','User','hasOwnProperty','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','type','filter','options','includeAll','include','findAll','rows','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','Sequelize','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','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','TeamVoicePrefix','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue'];(function(_0x53844f,_0x398371){var _0x3aed67=function(_0x1f24a3){while(--_0x1f24a3){_0x53844f['push'](_0x53844f['shift']());}};_0x3aed67(++_0x398371);}(_0xd18d,0x14c));var _0xdd18=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0xd18d[_0x22e9fe];return _0x47cd19;};'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(_0xdd18('0x0'));var moment=require('moment');var BPromise=require(_0xdd18('0x1'));var Mustache=require(_0xdd18('0x2'));var util=require(_0xdd18('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xdd18('0x4'));var ejs=require(_0xdd18('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd18('0x6'));var squel=require(_0xdd18('0x7'));var crypto=require(_0xdd18('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xdd18('0x9'));var toCsv=require(_0xdd18('0x4'));var querystring=require(_0xdd18('0xa'));var Papa=require(_0xdd18('0xb'));var Redis=require(_0xdd18('0xc'));var authService=require(_0xdd18('0xd'));var qs=require(_0xdd18('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdd18('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdd18('0x10'));var db=require(_0xdd18('0x11'))['db'];config['redis']=_[_0xdd18('0x12')](config['redis'],{'host':_0xdd18('0x13'),'port':0x18eb});var socket=require(_0xdd18('0x14'))(new Redis(config['redis']));require(_0xdd18('0x15'))[_0xdd18('0x16')](socket);function respondWithStatusCode(_0x5e72e7,_0x23a643){_0x23a643=_0x23a643||0xcc;return function(_0x298c9b){if(_0x298c9b){return _0x5e72e7[_0xdd18('0x17')](_0x23a643);}return _0x5e72e7[_0xdd18('0x18')](_0x23a643)['end']();};}function respondWithResult(_0x55fddf,_0x5c9695){_0x5c9695=_0x5c9695||0xc8;return function(_0x2517e1){if(_0x2517e1){return _0x55fddf[_0xdd18('0x18')](_0x5c9695)['json'](_0x2517e1);}};}function respondWithFilteredResult(_0x3dc790,_0x3e1deb){return function(_0x56131b){if(_0x56131b){var _0x191eb1=typeof _0x3e1deb[_0xdd18('0x19')]===_0xdd18('0x1a')&&typeof _0x3e1deb[_0xdd18('0x1b')]==='undefined';var _0x5ea204=_0x56131b[_0xdd18('0x1c')];var _0x1edc27=_0x191eb1?0x0:_0x3e1deb['offset'];var _0x30334b=_0x191eb1?_0x56131b[_0xdd18('0x1c')]:_0x3e1deb[_0xdd18('0x19')]+_0x3e1deb['limit'];var _0x27c4a1;if(_0x30334b>=_0x5ea204){_0x30334b=_0x5ea204;_0x27c4a1=0xc8;}else{_0x27c4a1=0xce;}_0x3dc790[_0xdd18('0x18')](_0x27c4a1);return _0x3dc790[_0xdd18('0x1d')](_0xdd18('0x1e'),_0x1edc27+'-'+_0x30334b+'/'+_0x5ea204)['json'](_0x56131b);}return null;};}function patchUpdates(_0x21964b){return function(_0x1de93f){try{jsonpatch[_0xdd18('0x1f')](_0x1de93f,_0x21964b,!![]);}catch(_0x5e51f6){return BPromise[_0xdd18('0x20')](_0x5e51f6);}return _0x1de93f[_0xdd18('0x21')]();};}function saveUpdates(_0x32df93,_0x19c932){return function(_0x45c6bd){if(_0x45c6bd){return _0x45c6bd['update'](_0x32df93)[_0xdd18('0x22')](function(_0x49903f){return _0x49903f;});}return null;};}function handleEntityNotFound(_0x9a55ba,_0x273616){return function(_0xf33827){if(!_0xf33827){_0x9a55ba[_0xdd18('0x17')](0x194);}return _0xf33827;};}function handleError(_0x3bf1d7,_0x16c313){_0x16c313=_0x16c313||0x1f4;return function(_0xf34a9e){logger[_0xdd18('0x23')](_0xf34a9e[_0xdd18('0x24')]);if(_0xf34a9e['name']){delete _0xf34a9e[_0xdd18('0x25')];}_0x3bf1d7[_0xdd18('0x18')](_0x16c313)[_0xdd18('0x26')](_0xf34a9e);};}exports[_0xdd18('0x27')]=function(_0x2b6238,_0x48cf78){var _0x5f401d={},_0x2fb1a2={},_0x495bbf={'count':0x0,'rows':[]};var _0x366013=_[_0xdd18('0x28')](db[_0xdd18('0x29')][_0xdd18('0x2a')],function(_0x3f6ed1){return{'name':_0x3f6ed1[_0xdd18('0x2b')],'type':_0x3f6ed1['type'][_0xdd18('0x2c')]};});_0x2fb1a2[_0xdd18('0x2d')]=_['map'](_0x366013,'name');_0x2fb1a2[_0xdd18('0x2e')]=_[_0xdd18('0x2f')](_0x2b6238[_0xdd18('0x2e')]);_0x2fb1a2[_0xdd18('0x30')]=_[_0xdd18('0x31')](_0x2fb1a2[_0xdd18('0x2d')],_0x2fb1a2[_0xdd18('0x2e')]);_0x5f401d[_0xdd18('0x32')]=_[_0xdd18('0x31')](_0x2fb1a2[_0xdd18('0x2d')],qs[_0xdd18('0x33')](_0x2b6238[_0xdd18('0x2e')][_0xdd18('0x33')]));_0x5f401d[_0xdd18('0x32')]=_0x5f401d[_0xdd18('0x32')][_0xdd18('0x34')]?_0x5f401d[_0xdd18('0x32')]:_0x2fb1a2[_0xdd18('0x2d')];if(!_0x2b6238[_0xdd18('0x2e')]['hasOwnProperty'](_0xdd18('0x35'))){_0x5f401d[_0xdd18('0x1b')]=qs[_0xdd18('0x1b')](_0x2b6238['query'][_0xdd18('0x1b')]);_0x5f401d[_0xdd18('0x19')]=qs[_0xdd18('0x19')](_0x2b6238[_0xdd18('0x2e')][_0xdd18('0x19')]);}_0x5f401d[_0xdd18('0x36')]=qs['sort'](_0x2b6238[_0xdd18('0x2e')][_0xdd18('0x37')]);_0x5f401d['where']=qs[_0xdd18('0x30')](_[_0xdd18('0x38')](_0x2b6238[_0xdd18('0x2e')],_0x2fb1a2[_0xdd18('0x30')]),_0x366013);if(_0x2b6238[_0xdd18('0x2e')]['filter']){_0x5f401d['where']=_[_0xdd18('0x39')](_0x5f401d[_0xdd18('0x3a')],{'$or':_[_0xdd18('0x28')](_0x366013,function(_0x5ba7fa){if(_0x5ba7fa[_0xdd18('0x3b')]!=='VIRTUAL'){var _0x1dd6c3={};_0x1dd6c3[_0x5ba7fa[_0xdd18('0x25')]]={'$like':'%'+_0x2b6238[_0xdd18('0x2e')][_0xdd18('0x3c')]+'%'};return _0x1dd6c3;}})});}_0x5f401d=_[_0xdd18('0x39')]({},_0x5f401d,_0x2b6238[_0xdd18('0x3d')]);var _0x5aaf84={'where':_0x5f401d[_0xdd18('0x3a')]};return db[_0xdd18('0x29')][_0xdd18('0x1c')](_0x5aaf84)[_0xdd18('0x22')](function(_0x214d32){_0x495bbf[_0xdd18('0x1c')]=_0x214d32;if(_0x2b6238['query'][_0xdd18('0x3e')]){_0x5f401d[_0xdd18('0x3f')]=[{'all':!![]}];}return db['Team'][_0xdd18('0x40')](_0x5f401d);})[_0xdd18('0x22')](function(_0x1ac43b){_0x495bbf[_0xdd18('0x41')]=_0x1ac43b;return _0x495bbf;})['then'](respondWithFilteredResult(_0x48cf78,_0x5f401d))[_0xdd18('0x42')](handleError(_0x48cf78,null));};exports[_0xdd18('0x43')]=function(_0x47a0ca,_0x325b24){var _0x2acaca={'raw':![],'where':{'id':_0x47a0ca['params']['id']}},_0xae94da={};_0xae94da[_0xdd18('0x2d')]=_['keys'](db[_0xdd18('0x29')]['rawAttributes']);_0xae94da['query']=_[_0xdd18('0x2f')](_0x47a0ca[_0xdd18('0x2e')]);_0xae94da['filters']=_[_0xdd18('0x31')](_0xae94da[_0xdd18('0x2d')],_0xae94da[_0xdd18('0x2e')]);_0x2acaca[_0xdd18('0x32')]=_['intersection'](_0xae94da[_0xdd18('0x2d')],qs[_0xdd18('0x33')](_0x47a0ca[_0xdd18('0x2e')]['fields']));_0x2acaca[_0xdd18('0x32')]=_0x2acaca[_0xdd18('0x32')][_0xdd18('0x34')]?_0x2acaca['attributes']:_0xae94da[_0xdd18('0x2d')];if(_0x47a0ca[_0xdd18('0x2e')]['includeAll']){_0x2acaca[_0xdd18('0x3f')]=[{'all':!![]}];}_0x2acaca=_[_0xdd18('0x39')]({},_0x2acaca,_0x47a0ca['options']);return db[_0xdd18('0x29')][_0xdd18('0x44')](_0x2acaca)[_0xdd18('0x22')](handleEntityNotFound(_0x325b24,null))[_0xdd18('0x22')](respondWithResult(_0x325b24,null))['catch'](handleError(_0x325b24,null));};exports[_0xdd18('0x45')]=function(_0x405d78,_0x4b214e){return db[_0xdd18('0x29')][_0xdd18('0x45')](_0x405d78['body'],{})[_0xdd18('0x22')](function(_0x501835){var _0x473929=_0x405d78[_0xdd18('0x46')][_0xdd18('0x47')]({'plain':!![]});if(!_0x473929)throw new Error(_0xdd18('0x48'));if(_0x473929[_0xdd18('0x49')]===_0xdd18('0x46')){var _0x50011f=_0x501835[_0xdd18('0x47')]({'plain':!![]});var _0x5eb0a3=_0xdd18('0x4a');return db[_0xdd18('0x4b')][_0xdd18('0x44')]({'where':{'name':_0x5eb0a3,'userProfileId':_0x473929['userProfileId']},'raw':!![]})[_0xdd18('0x22')](function(_0x2a42f0){if(_0x2a42f0&&_0x2a42f0[_0xdd18('0x4c')]===0x0){return db[_0xdd18('0x4d')]['create']({'name':_0x50011f['name'],'resourceId':_0x50011f['id'],'type':_0x2a42f0[_0xdd18('0x25')],'sectionId':_0x2a42f0['id']},{})[_0xdd18('0x22')](function(){return _0x501835;});}else{return _0x501835;}})[_0xdd18('0x42')](function(_0x9725e7){logger['error'](_0xdd18('0x4e'),_0x9725e7);throw _0x9725e7;});}return _0x501835;})[_0xdd18('0x22')](respondWithResult(_0x4b214e,0xc9))['catch'](handleError(_0x4b214e,null));};exports[_0xdd18('0x4f')]=function(_0x272fb9,_0x7e7be){if(_0x272fb9[_0xdd18('0x50')]['id']){delete _0x272fb9[_0xdd18('0x50')]['id'];}return db[_0xdd18('0x29')][_0xdd18('0x44')]({'where':{'id':_0x272fb9['params']['id']}})[_0xdd18('0x22')](handleEntityNotFound(_0x7e7be,null))['then'](saveUpdates(_0x272fb9[_0xdd18('0x50')],null))[_0xdd18('0x22')](respondWithResult(_0x7e7be,null))[_0xdd18('0x42')](handleError(_0x7e7be,null));};exports[_0xdd18('0x51')]=function(_0x5b9df4,_0x15687e){var _0x3c4658=_0x5b9df4[_0xdd18('0x52')]['id'];var _0x20dfe7=[];return db[_0xdd18('0x53')][_0xdd18('0x54')](function(_0x11bd0b){var _0xc0fb79=_0xdd18('0x55')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0xc0fb79,{'type':db['Sequelize'][_0xdd18('0x56')]['SELECT'],'raw':!![],'transaction':_0x11bd0b})[_0xdd18('0x22')](function(_0x337c6e){_0x20dfe7=_[_0xdd18('0x28')](_0x337c6e,function(_0x1e3369){return Number(_0x1e3369[_0xdd18('0x57')]);});})[_0xdd18('0x22')](function(){var _0x1c7aa7=_0xdd18('0x58')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x1c7aa7,{'type':db['Sequelize'][_0xdd18('0x56')]['SELECT'],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0x515bfa){var _0x438009=_[_0xdd18('0x28')](_0x515bfa,function(_0x460130){return Number(_0x460130['VoiceQueueId']);});return db[_0xdd18('0x59')]['destroy']({'where':{'UserId':{'$in':_0x20dfe7},'VoiceQueueId':{'$in':_0x438009}},'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(){var _0x559344=_0xdd18('0x5a')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x559344,{'type':db['Sequelize'][_0xdd18('0x56')][_0xdd18('0x5b')],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0xab2df5){var _0x1bc8b4=_[_0xdd18('0x28')](_0xab2df5,function(_0x1a7d96){return Number(_0x1a7d96[_0xdd18('0x5c')]);});return db[_0xdd18('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x20dfe7},'MailQueueId':{'$in':_0x1bc8b4}},'transaction':_0x11bd0b});})['then'](function(){var _0x11c416='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x11c416,{'type':db[_0xdd18('0x5e')][_0xdd18('0x56')][_0xdd18('0x5b')],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0xb15649){var _0x40d5b4=_['map'](_0xb15649,function(_0x4284d4){return Number(_0x4284d4['SmsQueueId']);});return db[_0xdd18('0x5f')][_0xdd18('0x51')]({'where':{'UserId':{'$in':_0x20dfe7},'SmsQueueId':{'$in':_0x40d5b4}},'transaction':_0x11bd0b});})['then'](function(){var _0x191284=_0xdd18('0x60')+_0x3c4658;return db[_0xdd18('0x53')]['query'](_0x191284,{'type':db[_0xdd18('0x5e')][_0xdd18('0x56')][_0xdd18('0x5b')],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0x1d067d){var _0x329fcc=_[_0xdd18('0x28')](_0x1d067d,function(_0x46b684){return Number(_0x46b684[_0xdd18('0x61')]);});return db[_0xdd18('0x62')][_0xdd18('0x51')]({'where':{'UserId':{'$in':_0x20dfe7},'ChatQueueId':{'$in':_0x329fcc}},'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(){var _0x3739bf=_0xdd18('0x63')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x3739bf,{'type':db[_0xdd18('0x5e')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x11bd0b});})['then'](function(_0x441da5){var _0x598060=_['map'](_0x441da5,function(_0x57aeec){return Number(_0x57aeec['FaxQueueId']);});return db[_0xdd18('0x64')]['destroy']({'where':{'UserId':{'$in':_0x20dfe7},'FaxQueueId':{'$in':_0x598060}},'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(){var _0x10f00f=_0xdd18('0x65')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x10f00f,{'type':db[_0xdd18('0x5e')]['QueryTypes'][_0xdd18('0x5b')],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0x32423c){var _0x40339c=_[_0xdd18('0x28')](_0x32423c,function(_0x3e238f){return Number(_0x3e238f[_0xdd18('0x66')]);});return db[_0xdd18('0x67')][_0xdd18('0x51')]({'where':{'UserId':{'$in':_0x20dfe7},'OpenchannelQueueId':{'$in':_0x40339c}},'transaction':_0x11bd0b});})['then'](function(){var _0x46ca7c=_0xdd18('0x68')+_0x3c4658;return db[_0xdd18('0x53')][_0xdd18('0x2e')](_0x46ca7c,{'type':db[_0xdd18('0x5e')][_0xdd18('0x56')][_0xdd18('0x5b')],'raw':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0x32af66){var _0x4a376e=_[_0xdd18('0x28')](_0x32af66,function(_0x35ff67){return Number(_0x35ff67[_0xdd18('0x69')]);});return db['UserWhatsappQueue'][_0xdd18('0x51')]({'where':{'UserId':{'$in':_0x20dfe7},'WhatsappQueueId':{'$in':_0x4a376e}},'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(){return db[_0xdd18('0x6a')]['find']({'where':{'TeamId':_0x3c4658}});})['then'](function(_0x107a2b){if(_0x107a2b===null){return;}return db['UserVoicePrefix'][_0xdd18('0x51')]({'where':{'UserId':{'$in':_0x20dfe7},'VoicePrefixId':_0x107a2b['VoicePrefixId']},'transaction':_0x11bd0b});})['then'](function(){return db['Team'][_0xdd18('0x51')]({'where':{'id':_0x3c4658},'cascade':!![],'transaction':_0x11bd0b});})[_0xdd18('0x22')](function(_0x35575d){if(_0x35575d===0x0){_0x15687e[_0xdd18('0x17')](0x194);}else{return db[_0xdd18('0x4d')][_0xdd18('0x51')]({'where':{'type':'Teams','resourceId':_0x3c4658},'cascade':!![],'transaction':_0x11bd0b})['then'](function(){_0x15687e[_0xdd18('0x18')](0xcc)['end']();});}})[_0xdd18('0x42')](function(_0x492285){_0x15687e[_0xdd18('0x18')](0x1f4)[_0xdd18('0x26')](_0x492285);});});};exports[_0xdd18('0x6b')]=function(_0x1c4a59,_0x4a6ef1,_0x27111f){return db[_0xdd18('0x29')][_0xdd18('0x6c')]({'where':{'id':_0x1c4a59['params']['id']}})[_0xdd18('0x22')](handleEntityNotFound(_0x4a6ef1,null))['then'](function(_0x55d76f){if(!_0x1c4a59[_0xdd18('0x2e')][_0xdd18('0x6d')]||!utils[_0xdd18('0x6e')](_0x1c4a59[_0xdd18('0x2e')]['channel'])){throw new db[(_0xdd18('0x5e'))]['ValidationError'](_0xdd18('0x6f'));}var _0x3399a0={};var _0x39f0c1={};_0x39f0c1['model']=_[_0xdd18('0x2f')](db[_[_0xdd18('0x70')](_0x1c4a59['query'][_0xdd18('0x6d')][_0xdd18('0x71')]())+_0xdd18('0x72')][_0xdd18('0x2a')]);_0x39f0c1['query']=_[_0xdd18('0x2f')](_0x1c4a59[_0xdd18('0x2e')]);_0x39f0c1[_0xdd18('0x30')]=_['intersection'](_0x39f0c1['model'],_0x39f0c1[_0xdd18('0x2e')]);_0x3399a0[_0xdd18('0x32')]=_[_0xdd18('0x31')](_0x39f0c1[_0xdd18('0x2d')],qs['fields'](_0x1c4a59[_0xdd18('0x2e')][_0xdd18('0x33')]));_0x3399a0[_0xdd18('0x32')]=_0x3399a0['attributes'][_0xdd18('0x34')]?_0x3399a0['attributes']:_0x39f0c1[_0xdd18('0x2d')];_0x3399a0[_0xdd18('0x1b')]=qs[_0xdd18('0x1b')](_0x1c4a59[_0xdd18('0x2e')][_0xdd18('0x1b')]);_0x3399a0['offset']=qs[_0xdd18('0x19')](_0x1c4a59['query'][_0xdd18('0x19')]);_0x3399a0[_0xdd18('0x36')]=qs[_0xdd18('0x37')](_0x1c4a59[_0xdd18('0x2e')]['sort']);_0x3399a0[_0xdd18('0x3a')]=qs['filters'](_[_0xdd18('0x38')](_0x1c4a59[_0xdd18('0x2e')],_0x39f0c1[_0xdd18('0x30')]));_0x3399a0=_['merge']({},_0x3399a0,_0x1c4a59['options']);return _0x55d76f[_0xdd18('0x47')+_[_0xdd18('0x70')](_0x1c4a59[_0xdd18('0x2e')][_0xdd18('0x6d')][_0xdd18('0x71')]())+_0xdd18('0x73')](_0x3399a0);})[_0xdd18('0x22')](respondWithResult(_0x4a6ef1,null))['catch'](handleError(_0x4a6ef1,null));};exports['addQueues']=function(_0x5b8f47,_0x78a1a2,_0x52bca1){return db['Team'][_0xdd18('0x6c')]({'where':{'id':_0x5b8f47[_0xdd18('0x52')]['id']}})[_0xdd18('0x22')](function(_0x1ec81d){if(_0x1ec81d){if(!_0x5b8f47[_0xdd18('0x50')]['channel']||!utils[_0xdd18('0x6e')](_0x5b8f47[_0xdd18('0x50')][_0xdd18('0x6d')])){throw new db['Sequelize']['ValidationError'](_0xdd18('0x6f'));}return _0x1ec81d[_0xdd18('0x74')+_[_0xdd18('0x70')](_0x5b8f47[_0xdd18('0x50')][_0xdd18('0x6d')][_0xdd18('0x71')]())+_0xdd18('0x73')](_0x5b8f47[_0xdd18('0x50')][_0xdd18('0x75')]);}return null;})[_0xdd18('0x22')](handleEntityNotFound(_0x78a1a2,null))['then'](respondWithStatusCode(_0x78a1a2,null))[_0xdd18('0x42')](handleError(_0x78a1a2,null));};exports['removeQueues']=function(_0x9d1cb6,_0x1e560c,_0x38f68c){return db[_0xdd18('0x29')][_0xdd18('0x6c')]({'where':{'id':_0x9d1cb6[_0xdd18('0x52')]['id']}})[_0xdd18('0x22')](function(_0x1c02c6){if(_0x1c02c6){if(!_0x9d1cb6[_0xdd18('0x2e')][_0xdd18('0x6d')]||!utils['isValidChannel'](_0x9d1cb6[_0xdd18('0x2e')]['channel'])){throw new db[(_0xdd18('0x5e'))][(_0xdd18('0x76'))](_0xdd18('0x6f'));}return _0x1c02c6[_0xdd18('0x77')+_[_0xdd18('0x70')](_0x9d1cb6['query'][_0xdd18('0x6d')]['toLowerCase']())+_0xdd18('0x73')](_0x9d1cb6[_0xdd18('0x2e')][_0xdd18('0x75')]);}return null;})[_0xdd18('0x22')](handleEntityNotFound(_0x1e560c,null))['then'](respondWithStatusCode(_0x1e560c,null))[_0xdd18('0x42')](handleError(_0x1e560c,null));};exports[_0xdd18('0x78')]=function(_0x2fddc9,_0x496e60){var _0x30bb88=_[_0xdd18('0x79')](_0x2fddc9[_0xdd18('0x50')][_0xdd18('0x75')])?_0x2fddc9[_0xdd18('0x50')][_0xdd18('0x75')]:[_0x2fddc9[_0xdd18('0x50')][_0xdd18('0x75')]];var _0x2a5179=_0x2fddc9[_0xdd18('0x52')]['id'];return db[_0xdd18('0x29')][_0xdd18('0x44')]({'where':{'id':_0x2a5179}})[_0xdd18('0x22')](handleEntityNotFound(_0x496e60,null))['then'](function(_0x45ad21){if(_0x45ad21){var _0x3577b6=[_0xdd18('0x7a'),_0xdd18('0x7b'),_0xdd18('0x7c'),_0xdd18('0x7d'),_0xdd18('0x7e'),_0xdd18('0x7f'),_0xdd18('0x80')];return db[_0xdd18('0x53')][_0xdd18('0x54')](function(_0x7f4622){var _0x6ffb84=_[_0xdd18('0x28')](_0x3577b6,function(_0x3eb16c){var _0x38ae33={'attributes':['id',_0xdd18('0x25')]};if(_0x3eb16c===_0xdd18('0x7a')){_0x38ae33['through']={'attributes':[_0xdd18('0x81')]};}return _0x45ad21[_0xdd18('0x47')+_0x3eb16c+_0xdd18('0x73')](_0x38ae33)[_0xdd18('0x22')](function(_0x5007b4){var _0x516951=_['map'](_0x5007b4,function(_0x18ac30){var _0x1c4ba4=_['map'](_0x30bb88,function(_0x39eacc){var _0x2a70b2={'where':{'UserId':_0x39eacc,[_0x3eb16c+_0xdd18('0x82')]:_0x18ac30['id']},'transaction':_0x7f4622};if(_0x3eb16c==='Voice'){_0x2a70b2['defaults']={'penalty':_0x18ac30[_0xdd18('0x83')][_0xdd18('0x81')]};}return db['User'+_0x3eb16c+'Queue'][_0xdd18('0x84')](_0x2a70b2)['then'](function(){socket[_0xdd18('0x85')]('user'+_0x3eb16c+'Queue:save',{'UserId':_0x39eacc,[_0x3eb16c+_0xdd18('0x82')]:_0x18ac30['id']});if(_0x3eb16c!==_0xdd18('0x7a')){return;}return db['User'][_0xdd18('0x40')]({'where':{'id':_0x30bb88,'online':0x1},'attributes':['id','name',_0xdd18('0x86'),_0xdd18('0x87'),_0xdd18('0x88')],'raw':!![]})[_0xdd18('0x22')](function(_0x20c2e8){var _0x39a9f4=_[_0xdd18('0x28')](_0x20c2e8,function(_0x293574){return db[_0xdd18('0x89')][_0xdd18('0x8a')]({'membername':_0x293574[_0xdd18('0x25')],'UserId':_0x293574['id'],'queue_name':_0x18ac30[_0xdd18('0x25')],'VoiceQueueId':_0x18ac30['id'],'interface':_[_0xdd18('0x8b')](_0x293574[_0xdd18('0x88')])?util[_0xdd18('0x8c')]('SIP/%s',_0x293574[_0xdd18('0x25')]):_0x293574[_0xdd18('0x88')],'paused':_0x293574[_0xdd18('0x87')]||![],'penalty':_0x18ac30[_0xdd18('0x83')][_0xdd18('0x81')]},{'transaction':_0x7f4622});});return Promise[_0xdd18('0x8d')](_0x39a9f4);});});});return Promise[_0xdd18('0x8d')](_0x1c4ba4);});return Promise[_0xdd18('0x8d')](_0x516951);})[_0xdd18('0x22')](function(){return db[_0xdd18('0x6a')]['findOne']({'where':{'teamId':_0x2a5179}})['then'](function(_0x44c0bb){if(_0x44c0bb){var _0x5f33e9=_['map'](_0x30bb88,function(_0x4cde90){db[_0xdd18('0x8e')][_0xdd18('0x8a')]({'UserId':_0x4cde90,'VoicePrefixId':_0x44c0bb['VoicePrefixId']});});return Promise[_0xdd18('0x8d')](_0x5f33e9);}});});});return Promise[_0xdd18('0x8d')](_0x6ffb84)[_0xdd18('0x22')](function(){return _0x45ad21[_0xdd18('0x78')](_0x30bb88,{'transaction':_0x7f4622})[_0xdd18('0x8f')](function(_0x59e895){return _0x59e895;});});});}})[_0xdd18('0x22')](respondWithResult(_0x496e60,null))[_0xdd18('0x42')](handleError(_0x496e60,null));};exports[_0xdd18('0x90')]=function(_0x738c18,_0x36c384){var _0x184260=_[_0xdd18('0x79')](_0x738c18[_0xdd18('0x2e')][_0xdd18('0x75')])?_0x738c18[_0xdd18('0x2e')][_0xdd18('0x75')]:[_0x738c18['query'][_0xdd18('0x75')]];var _0x53a780=_0x738c18['params']['id'];return db[_0xdd18('0x29')]['find']({'where':{'id':_0x53a780}})[_0xdd18('0x22')](handleEntityNotFound(_0x36c384,null))['then'](function(_0x4fd1b1){if(_0x4fd1b1){var _0x382db4=[_0xdd18('0x7a'),'Chat',_0xdd18('0x7c'),_0xdd18('0x7d'),_0xdd18('0x7e'),_0xdd18('0x7f'),_0xdd18('0x80')];return db[_0xdd18('0x53')][_0xdd18('0x54')](function(_0x432b02){var _0x29130e=_[_0xdd18('0x28')](_0x382db4,function(_0x4bfb55){var _0x55ffb3={'attributes':['id',_0xdd18('0x25')]};return _0x4fd1b1[_0xdd18('0x47')+_0x4bfb55+_0xdd18('0x73')](_0x55ffb3)['then'](function(_0x12ccbc){var _0xe4797a=_[_0xdd18('0x28')](_0x12ccbc,function(_0x148a69){return _0x148a69[_0xdd18('0x90')](_0x184260,{'transaction':_0x432b02})[_0xdd18('0x22')](function(){var _0x168da6=_[_0xdd18('0x28')](_0x184260,function(_0x4397dc){socket['emit']('user'+_0x4bfb55+_0xdd18('0x91'),{'UserId':Number(_0x4397dc),[_0x4bfb55+_0xdd18('0x82')]:_0x148a69['id']});if(_0x4bfb55!==_0xdd18('0x7a')){return;}return db[_0xdd18('0x89')][_0xdd18('0x51')]({'where':{'VoiceQueueId':_0x148a69['id'],'UserId':_0x4397dc},'transaction':_0x432b02});});return Promise[_0xdd18('0x8d')](_0x168da6);});});return Promise[_0xdd18('0x8d')](_0xe4797a);});});return Promise[_0xdd18('0x8d')](_0x29130e)[_0xdd18('0x22')](function(){return _0x4fd1b1['removeAgents'](_0x184260,{'transaction':_0x432b02});})[_0xdd18('0x22')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x53a780}})[_0xdd18('0x22')](function(_0x1b8b5a){if(_0x1b8b5a){var _0xd3aa10=_['map'](_0x184260,function(_0x3a6775){db[_0xdd18('0x8e')][_0xdd18('0x51')]({'where':{'UserId':_0x3a6775,'VoicePrefixId':_0x1b8b5a['VoicePrefixId']}});});return Promise[_0xdd18('0x8d')](_0xd3aa10);}});});});}})['then'](respondWithStatusCode(_0x36c384,null))[_0xdd18('0x42')](handleError(_0x36c384,null));};exports[_0xdd18('0x92')]=function(_0xdabf5a,_0x3eef5d,_0x29d14e){var _0x46bbf0={};var _0x22b09e={};var _0x19fed4;var _0x1f63b7;return db['Team']['findOne']({'where':{'id':_0xdabf5a['params']['id']}})[_0xdd18('0x22')](handleEntityNotFound(_0x3eef5d,null))[_0xdd18('0x22')](function(_0x115bf6){if(_0x115bf6){_0x19fed4=_0x115bf6;_0x22b09e[_0xdd18('0x2d')]=_[_0xdd18('0x2f')](db[_0xdd18('0x93')][_0xdd18('0x2a')]);_0x22b09e[_0xdd18('0x2e')]=_[_0xdd18('0x2f')](_0xdabf5a[_0xdd18('0x2e')]);_0x22b09e[_0xdd18('0x30')]=_[_0xdd18('0x31')](_0x22b09e['model'],_0x22b09e[_0xdd18('0x2e')]);_0x46bbf0[_0xdd18('0x32')]=_[_0xdd18('0x31')](_0x22b09e[_0xdd18('0x2d')],qs[_0xdd18('0x33')](_0xdabf5a[_0xdd18('0x2e')]['fields']));_0x46bbf0[_0xdd18('0x32')]=_0x46bbf0[_0xdd18('0x32')][_0xdd18('0x34')]?_0x46bbf0[_0xdd18('0x32')]:_0x22b09e[_0xdd18('0x2d')];_0x46bbf0['order']=qs[_0xdd18('0x37')](_0xdabf5a[_0xdd18('0x2e')][_0xdd18('0x37')]);_0x46bbf0[_0xdd18('0x3a')]=qs[_0xdd18('0x30')](_['pick'](_0xdabf5a['query'],_0x22b09e[_0xdd18('0x30')]));if(_0xdabf5a['query'][_0xdd18('0x3c')]){_0x46bbf0[_0xdd18('0x3a')]=_[_0xdd18('0x39')](_0x46bbf0[_0xdd18('0x3a')],{'$or':_[_0xdd18('0x28')](_0x46bbf0[_0xdd18('0x32')],function(_0x3d9fb6){var _0x1fcf1b={};_0x1fcf1b[_0x3d9fb6]={'$like':'%'+_0xdabf5a[_0xdd18('0x2e')][_0xdd18('0x3c')]+'%'};return _0x1fcf1b;})});}_0x46bbf0=_[_0xdd18('0x39')]({},_0x46bbf0,_0xdabf5a[_0xdd18('0x3d')]);return _0x19fed4[_0xdd18('0x92')](_0x46bbf0);}})[_0xdd18('0x22')](function(_0x38a063){if(_0x38a063){_0x1f63b7=_0x38a063[_0xdd18('0x34')];if(!_0xdabf5a['query'][_0xdd18('0x94')](_0xdd18('0x35'))){_0x46bbf0[_0xdd18('0x1b')]=qs[_0xdd18('0x1b')](_0xdabf5a[_0xdd18('0x2e')][_0xdd18('0x1b')]);_0x46bbf0['offset']=qs[_0xdd18('0x19')](_0xdabf5a[_0xdd18('0x2e')][_0xdd18('0x19')]);}return _0x19fed4[_0xdd18('0x92')](_0x46bbf0);}})['then'](function(_0x4ca66f){if(_0x4ca66f){return _0x4ca66f?{'count':_0x1f63b7,'rows':_0x4ca66f}:null;}})[_0xdd18('0x22')](respondWithResult(_0x3eef5d,null))[_0xdd18('0x42')](handleError(_0x3eef5d,null));}; \ No newline at end of file +var _0xfefb=['Queue','Queues','findOne','add','removeQueues','remove','ids','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','interface','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','removeAgents','Chat','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','undefined','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','Team','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','nolimit','limit','order','sort','where','pick','merge','filter','options','count','includeAll','rows','catch','params','keys','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','transaction','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase'];(function(_0x36722c,_0x5e054f){var _0x305cdd=function(_0x1274f2){while(--_0x1274f2){_0x36722c['push'](_0x36722c['shift']());}};_0x305cdd(++_0x5e054f);}(_0xfefb,0x167));var _0xbfef=function(_0x217ef9,_0x144451){_0x217ef9=_0x217ef9-0x0;var _0x4ee399=_0xfefb[_0x217ef9];return _0x4ee399;};'use strict';var emlformat=require(_0xbfef('0x0'));var rimraf=require(_0xbfef('0x1'));var zipdir=require(_0xbfef('0x2'));var jsonpatch=require(_0xbfef('0x3'));var rp=require('request-promise');var moment=require(_0xbfef('0x4'));var BPromise=require(_0xbfef('0x5'));var Mustache=require(_0xbfef('0x6'));var util=require(_0xbfef('0x7'));var path=require(_0xbfef('0x8'));var sox=require(_0xbfef('0x9'));var csv=require(_0xbfef('0xa'));var ejs=require(_0xbfef('0xb'));var fs=require('fs');var fs_extra=require(_0xbfef('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbfef('0xd'));var deskjs=require(_0xbfef('0xe'));var toCsv=require(_0xbfef('0xa'));var querystring=require(_0xbfef('0xf'));var Papa=require(_0xbfef('0x10'));var Redis=require(_0xbfef('0x11'));var authService=require(_0xbfef('0x12'));var qs=require(_0xbfef('0x13'));var as=require(_0xbfef('0x14'));var hardwareService=require(_0xbfef('0x15'));var logger=require(_0xbfef('0x16'))(_0xbfef('0x17'));var utils=require(_0xbfef('0x18'));var config=require(_0xbfef('0x19'));var licenseUtil=require(_0xbfef('0x1a'));var db=require(_0xbfef('0x1b'))['db'];config['redis']=_[_0xbfef('0x1c')](config[_0xbfef('0x1d')],{'host':_0xbfef('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfef('0x1d')]));require('./team.socket')[_0xbfef('0x1f')](socket);function respondWithStatusCode(_0x262b78,_0x593896){_0x593896=_0x593896||0xcc;return function(_0x2ef383){if(_0x2ef383){return _0x262b78[_0xbfef('0x20')](_0x593896);}return _0x262b78[_0xbfef('0x21')](_0x593896)[_0xbfef('0x22')]();};}function respondWithResult(_0x2a52d0,_0x4a96d0){_0x4a96d0=_0x4a96d0||0xc8;return function(_0x5e506f){if(_0x5e506f){return _0x2a52d0[_0xbfef('0x21')](_0x4a96d0)[_0xbfef('0x23')](_0x5e506f);}};}function respondWithFilteredResult(_0x4bbeae,_0x2b4a6){return function(_0xdbf3ec){if(_0xdbf3ec){var _0x185016=typeof _0x2b4a6['offset']==='undefined'&&typeof _0x2b4a6['limit']===_0xbfef('0x24');var _0x531980=_0xdbf3ec['count'];var _0x16a587=_0x185016?0x0:_0x2b4a6[_0xbfef('0x25')];var _0x318c47=_0x185016?_0xdbf3ec['count']:_0x2b4a6[_0xbfef('0x25')]+_0x2b4a6['limit'];var _0x25d2d0;if(_0x318c47>=_0x531980){_0x318c47=_0x531980;_0x25d2d0=0xc8;}else{_0x25d2d0=0xce;}_0x4bbeae['status'](_0x25d2d0);return _0x4bbeae['set'](_0xbfef('0x26'),_0x16a587+'-'+_0x318c47+'/'+_0x531980)['json'](_0xdbf3ec);}return null;};}function patchUpdates(_0x316ced){return function(_0x491b99){try{jsonpatch[_0xbfef('0x27')](_0x491b99,_0x316ced,!![]);}catch(_0x261008){return BPromise[_0xbfef('0x28')](_0x261008);}return _0x491b99[_0xbfef('0x29')]();};}function saveUpdates(_0x13c23e,_0x16f11c){return function(_0x44de97){if(_0x44de97){return _0x44de97[_0xbfef('0x2a')](_0x13c23e)[_0xbfef('0x2b')](function(_0xcae505){return _0xcae505;});}return null;};}function handleEntityNotFound(_0x1cd6ce,_0x4c96e9){return function(_0x3dc9db){if(!_0x3dc9db){_0x1cd6ce[_0xbfef('0x20')](0x194);}return _0x3dc9db;};}function handleError(_0xcf0570,_0x466e53){_0x466e53=_0x466e53||0x1f4;return function(_0x204e73){logger[_0xbfef('0x2c')](_0x204e73[_0xbfef('0x2d')]);if(_0x204e73['name']){delete _0x204e73[_0xbfef('0x2e')];}_0xcf0570[_0xbfef('0x21')](_0x466e53)['send'](_0x204e73);};}exports[_0xbfef('0x2f')]=function(_0x513ecc,_0x4d7dfa){var _0x2cf25a={},_0x2b8b94={},_0x3cd378={'count':0x0,'rows':[]};var _0x28d41c=_['map'](db[_0xbfef('0x30')][_0xbfef('0x31')],function(_0x385f58){return{'name':_0x385f58[_0xbfef('0x32')],'type':_0x385f58[_0xbfef('0x33')][_0xbfef('0x34')]};});_0x2b8b94[_0xbfef('0x35')]=_[_0xbfef('0x36')](_0x28d41c,_0xbfef('0x2e'));_0x2b8b94[_0xbfef('0x37')]=_['keys'](_0x513ecc[_0xbfef('0x37')]);_0x2b8b94[_0xbfef('0x38')]=_[_0xbfef('0x39')](_0x2b8b94[_0xbfef('0x35')],_0x2b8b94['query']);_0x2cf25a['attributes']=_[_0xbfef('0x39')](_0x2b8b94[_0xbfef('0x35')],qs[_0xbfef('0x3a')](_0x513ecc[_0xbfef('0x37')][_0xbfef('0x3a')]));_0x2cf25a['attributes']=_0x2cf25a['attributes'][_0xbfef('0x3b')]?_0x2cf25a[_0xbfef('0x3c')]:_0x2b8b94[_0xbfef('0x35')];if(!_0x513ecc[_0xbfef('0x37')]['hasOwnProperty'](_0xbfef('0x3d'))){_0x2cf25a[_0xbfef('0x3e')]=qs[_0xbfef('0x3e')](_0x513ecc[_0xbfef('0x37')][_0xbfef('0x3e')]);_0x2cf25a[_0xbfef('0x25')]=qs['offset'](_0x513ecc[_0xbfef('0x37')][_0xbfef('0x25')]);}_0x2cf25a[_0xbfef('0x3f')]=qs[_0xbfef('0x40')](_0x513ecc[_0xbfef('0x37')]['sort']);_0x2cf25a[_0xbfef('0x41')]=qs['filters'](_[_0xbfef('0x42')](_0x513ecc[_0xbfef('0x37')],_0x2b8b94[_0xbfef('0x38')]),_0x28d41c);if(_0x513ecc['query']['filter']){_0x2cf25a[_0xbfef('0x41')]=_[_0xbfef('0x43')](_0x2cf25a[_0xbfef('0x41')],{'$or':_['map'](_0x28d41c,function(_0x2e57f6){if(_0x2e57f6[_0xbfef('0x33')]!=='VIRTUAL'){var _0x32de60={};_0x32de60[_0x2e57f6[_0xbfef('0x2e')]]={'$like':'%'+_0x513ecc[_0xbfef('0x37')][_0xbfef('0x44')]+'%'};return _0x32de60;}})});}_0x2cf25a=_['merge']({},_0x2cf25a,_0x513ecc[_0xbfef('0x45')]);var _0x115f80={'where':_0x2cf25a[_0xbfef('0x41')]};return db[_0xbfef('0x30')][_0xbfef('0x46')](_0x115f80)[_0xbfef('0x2b')](function(_0xa943c8){_0x3cd378[_0xbfef('0x46')]=_0xa943c8;if(_0x513ecc['query'][_0xbfef('0x47')]){_0x2cf25a['include']=[{'all':!![]}];}return db[_0xbfef('0x30')]['findAll'](_0x2cf25a);})[_0xbfef('0x2b')](function(_0x3c8ec7){_0x3cd378[_0xbfef('0x48')]=_0x3c8ec7;return _0x3cd378;})[_0xbfef('0x2b')](respondWithFilteredResult(_0x4d7dfa,_0x2cf25a))[_0xbfef('0x49')](handleError(_0x4d7dfa,null));};exports['show']=function(_0x38950e,_0x151dff){var _0x25b3db={'raw':![],'where':{'id':_0x38950e[_0xbfef('0x4a')]['id']}},_0x5c2dbd={};_0x5c2dbd[_0xbfef('0x35')]=_[_0xbfef('0x4b')](db[_0xbfef('0x30')]['rawAttributes']);_0x5c2dbd[_0xbfef('0x37')]=_['keys'](_0x38950e[_0xbfef('0x37')]);_0x5c2dbd['filters']=_[_0xbfef('0x39')](_0x5c2dbd[_0xbfef('0x35')],_0x5c2dbd[_0xbfef('0x37')]);_0x25b3db['attributes']=_[_0xbfef('0x39')](_0x5c2dbd['model'],qs['fields'](_0x38950e[_0xbfef('0x37')][_0xbfef('0x3a')]));_0x25b3db[_0xbfef('0x3c')]=_0x25b3db[_0xbfef('0x3c')][_0xbfef('0x3b')]?_0x25b3db['attributes']:_0x5c2dbd[_0xbfef('0x35')];if(_0x38950e['query'][_0xbfef('0x47')]){_0x25b3db[_0xbfef('0x4c')]=[{'all':!![]}];}_0x25b3db=_[_0xbfef('0x43')]({},_0x25b3db,_0x38950e[_0xbfef('0x45')]);return db[_0xbfef('0x30')][_0xbfef('0x4d')](_0x25b3db)[_0xbfef('0x2b')](handleEntityNotFound(_0x151dff,null))[_0xbfef('0x2b')](respondWithResult(_0x151dff,null))['catch'](handleError(_0x151dff,null));};exports[_0xbfef('0x4e')]=function(_0x2d25be,_0x11f4cd){return db[_0xbfef('0x30')][_0xbfef('0x4e')](_0x2d25be['body'],{})[_0xbfef('0x2b')](function(_0x280d6a){var _0x1661a9=_0x2d25be[_0xbfef('0x4f')][_0xbfef('0x50')]({'plain':!![]});if(!_0x1661a9)throw new Error(_0xbfef('0x51'));if(_0x1661a9[_0xbfef('0x52')]===_0xbfef('0x4f')){var _0x3ddd08=_0x280d6a['get']({'plain':!![]});var _0x34c662=_0xbfef('0x53');return db[_0xbfef('0x54')][_0xbfef('0x4d')]({'where':{'name':_0x34c662,'userProfileId':_0x1661a9[_0xbfef('0x55')]},'raw':!![]})['then'](function(_0x20320c){if(_0x20320c&&_0x20320c[_0xbfef('0x56')]===0x0){return db[_0xbfef('0x57')][_0xbfef('0x4e')]({'name':_0x3ddd08[_0xbfef('0x2e')],'resourceId':_0x3ddd08['id'],'type':_0x20320c[_0xbfef('0x2e')],'sectionId':_0x20320c['id']},{})[_0xbfef('0x2b')](function(){return _0x280d6a;});}else{return _0x280d6a;}})[_0xbfef('0x49')](function(_0x425547){logger['error'](_0xbfef('0x58'),_0x425547);throw _0x425547;});}return _0x280d6a;})['then'](respondWithResult(_0x11f4cd,0xc9))[_0xbfef('0x49')](handleError(_0x11f4cd,null));};exports[_0xbfef('0x2a')]=function(_0x42da3c,_0x381c75){if(_0x42da3c['body']['id']){delete _0x42da3c[_0xbfef('0x59')]['id'];}return db[_0xbfef('0x30')][_0xbfef('0x4d')]({'where':{'id':_0x42da3c[_0xbfef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x381c75,null))[_0xbfef('0x2b')](saveUpdates(_0x42da3c[_0xbfef('0x59')],null))[_0xbfef('0x2b')](respondWithResult(_0x381c75,null))['catch'](handleError(_0x381c75,null));};exports['destroy']=function(_0x1c04b1,_0x337c7f){var _0x3e6d47=_0x1c04b1['params']['id'];var _0xc9980e=[];return db['sequelize'][_0xbfef('0x5a')](function(_0x47603c){var _0x449b48='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x3e6d47;return db[_0xbfef('0x5b')]['query'](_0x449b48,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')]['SELECT'],'raw':!![],'transaction':_0x47603c})[_0xbfef('0x2b')](function(_0x19e307){_0xc9980e=_[_0xbfef('0x36')](_0x19e307,function(_0x417c78){return Number(_0x417c78[_0xbfef('0x5e')]);});})[_0xbfef('0x2b')](function(){var _0x4ea3e1=_0xbfef('0x5f')+_0x3e6d47;return db[_0xbfef('0x5b')][_0xbfef('0x37')](_0x4ea3e1,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')]['SELECT'],'raw':!![],'transaction':_0x47603c});})['then'](function(_0x31b764){var _0x47b874=_[_0xbfef('0x36')](_0x31b764,function(_0x527414){return Number(_0x527414['VoiceQueueId']);});return db[_0xbfef('0x60')]['destroy']({'where':{'UserId':{'$in':_0xc9980e},'VoiceQueueId':{'$in':_0x47b874}},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){var _0x2be379='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e6d47;return db['sequelize'][_0xbfef('0x37')](_0x2be379,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')][_0xbfef('0x61')],'raw':!![],'transaction':_0x47603c});})[_0xbfef('0x2b')](function(_0x242dd4){var _0x2d32a=_[_0xbfef('0x36')](_0x242dd4,function(_0x112116){return Number(_0x112116['MailQueueId']);});return db['UserMailQueue'][_0xbfef('0x62')]({'where':{'UserId':{'$in':_0xc9980e},'MailQueueId':{'$in':_0x2d32a}},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){var _0x34fbce=_0xbfef('0x63')+_0x3e6d47;return db[_0xbfef('0x5b')][_0xbfef('0x37')](_0x34fbce,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')]['SELECT'],'raw':!![],'transaction':_0x47603c});})[_0xbfef('0x2b')](function(_0x4f3d3a){var _0xdd9591=_[_0xbfef('0x36')](_0x4f3d3a,function(_0x2a92bf){return Number(_0x2a92bf[_0xbfef('0x64')]);});return db[_0xbfef('0x65')]['destroy']({'where':{'UserId':{'$in':_0xc9980e},'SmsQueueId':{'$in':_0xdd9591}},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){var _0x208837='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e6d47;return db[_0xbfef('0x5b')][_0xbfef('0x37')](_0x208837,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')][_0xbfef('0x61')],'raw':!![],'transaction':_0x47603c});})['then'](function(_0x498e85){var _0x5c8063=_['map'](_0x498e85,function(_0x355985){return Number(_0x355985[_0xbfef('0x66')]);});return db[_0xbfef('0x67')]['destroy']({'where':{'UserId':{'$in':_0xc9980e},'ChatQueueId':{'$in':_0x5c8063}},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){var _0x239904=_0xbfef('0x68')+_0x3e6d47;return db[_0xbfef('0x5b')]['query'](_0x239904,{'type':db[_0xbfef('0x5c')]['QueryTypes'][_0xbfef('0x61')],'raw':!![],'transaction':_0x47603c});})[_0xbfef('0x2b')](function(_0x1fbbe4){var _0x1dd0e0=_[_0xbfef('0x36')](_0x1fbbe4,function(_0x335270){return Number(_0x335270[_0xbfef('0x69')]);});return db[_0xbfef('0x6a')][_0xbfef('0x62')]({'where':{'UserId':{'$in':_0xc9980e},'FaxQueueId':{'$in':_0x1dd0e0}},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){var _0x5e3c04=_0xbfef('0x6b')+_0x3e6d47;return db[_0xbfef('0x5b')][_0xbfef('0x37')](_0x5e3c04,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')][_0xbfef('0x61')],'raw':!![],'transaction':_0x47603c});})['then'](function(_0x17e7b6){var _0x45062c=_['map'](_0x17e7b6,function(_0x5a070d){return Number(_0x5a070d[_0xbfef('0x6c')]);});return db[_0xbfef('0x6d')][_0xbfef('0x62')]({'where':{'UserId':{'$in':_0xc9980e},'OpenchannelQueueId':{'$in':_0x45062c}},'transaction':_0x47603c});})['then'](function(){var _0x1675a3='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e6d47;return db[_0xbfef('0x5b')][_0xbfef('0x37')](_0x1675a3,{'type':db[_0xbfef('0x5c')][_0xbfef('0x5d')]['SELECT'],'raw':!![],'transaction':_0x47603c});})[_0xbfef('0x2b')](function(_0x2c1636){var _0x1ac95a=_[_0xbfef('0x36')](_0x2c1636,function(_0x2f62ad){return Number(_0x2f62ad[_0xbfef('0x6e')]);});return db[_0xbfef('0x6f')][_0xbfef('0x62')]({'where':{'UserId':{'$in':_0xc9980e},'WhatsappQueueId':{'$in':_0x1ac95a}},'transaction':_0x47603c});})['then'](function(){return db[_0xbfef('0x70')][_0xbfef('0x4d')]({'where':{'TeamId':_0x3e6d47}});})[_0xbfef('0x2b')](function(_0x1971f5){if(_0x1971f5===null){return;}return db['UserVoicePrefix'][_0xbfef('0x62')]({'where':{'UserId':{'$in':_0xc9980e},'VoicePrefixId':_0x1971f5[_0xbfef('0x71')]},'transaction':_0x47603c});})[_0xbfef('0x2b')](function(){return db[_0xbfef('0x30')][_0xbfef('0x62')]({'where':{'id':_0x3e6d47},'cascade':!![],'transaction':_0x47603c});})[_0xbfef('0x2b')](function(_0x3ac90f){if(_0x3ac90f===0x0){_0x337c7f[_0xbfef('0x20')](0x194);}else{return db['UserProfileResource'][_0xbfef('0x62')]({'where':{'type':_0xbfef('0x53'),'resourceId':_0x3e6d47},'cascade':!![],'transaction':_0x47603c})[_0xbfef('0x2b')](function(){_0x337c7f[_0xbfef('0x21')](0xcc)[_0xbfef('0x22')]();});}})['catch'](function(_0x5e7b7b){_0x337c7f['status'](0x1f4)['send'](_0x5e7b7b);});});};exports[_0xbfef('0x72')]=function(_0x2111f2,_0x5e9d3f,_0x589a59){return db['Team']['findOne']({'where':{'id':_0x2111f2[_0xbfef('0x4a')]['id']}})[_0xbfef('0x2b')](handleEntityNotFound(_0x5e9d3f,null))[_0xbfef('0x2b')](function(_0x186b48){if(!_0x2111f2[_0xbfef('0x37')][_0xbfef('0x73')]||!utils[_0xbfef('0x74')](_0x2111f2[_0xbfef('0x37')][_0xbfef('0x73')])){throw new db[(_0xbfef('0x5c'))][(_0xbfef('0x75'))](_0xbfef('0x76'));}var _0x43321e={};var _0x3d5e56={};_0x3d5e56[_0xbfef('0x35')]=_['keys'](db[_[_0xbfef('0x77')](_0x2111f2['query'][_0xbfef('0x73')][_0xbfef('0x78')]())+_0xbfef('0x79')][_0xbfef('0x31')]);_0x3d5e56[_0xbfef('0x37')]=_[_0xbfef('0x4b')](_0x2111f2[_0xbfef('0x37')]);_0x3d5e56[_0xbfef('0x38')]=_[_0xbfef('0x39')](_0x3d5e56[_0xbfef('0x35')],_0x3d5e56[_0xbfef('0x37')]);_0x43321e['attributes']=_[_0xbfef('0x39')](_0x3d5e56[_0xbfef('0x35')],qs['fields'](_0x2111f2[_0xbfef('0x37')][_0xbfef('0x3a')]));_0x43321e[_0xbfef('0x3c')]=_0x43321e[_0xbfef('0x3c')][_0xbfef('0x3b')]?_0x43321e[_0xbfef('0x3c')]:_0x3d5e56['model'];_0x43321e[_0xbfef('0x3e')]=qs['limit'](_0x2111f2[_0xbfef('0x37')]['limit']);_0x43321e[_0xbfef('0x25')]=qs[_0xbfef('0x25')](_0x2111f2['query'][_0xbfef('0x25')]);_0x43321e[_0xbfef('0x3f')]=qs[_0xbfef('0x40')](_0x2111f2[_0xbfef('0x37')][_0xbfef('0x40')]);_0x43321e[_0xbfef('0x41')]=qs['filters'](_[_0xbfef('0x42')](_0x2111f2[_0xbfef('0x37')],_0x3d5e56['filters']));_0x43321e=_[_0xbfef('0x43')]({},_0x43321e,_0x2111f2[_0xbfef('0x45')]);return _0x186b48['get'+_[_0xbfef('0x77')](_0x2111f2['query'][_0xbfef('0x73')][_0xbfef('0x78')]())+_0xbfef('0x7a')](_0x43321e);})[_0xbfef('0x2b')](respondWithResult(_0x5e9d3f,null))[_0xbfef('0x49')](handleError(_0x5e9d3f,null));};exports['addQueues']=function(_0x3f2fff,_0x2af903,_0xed42fc){return db[_0xbfef('0x30')][_0xbfef('0x7b')]({'where':{'id':_0x3f2fff[_0xbfef('0x4a')]['id']}})[_0xbfef('0x2b')](function(_0x73094c){if(_0x73094c){if(!_0x3f2fff[_0xbfef('0x59')][_0xbfef('0x73')]||!utils[_0xbfef('0x74')](_0x3f2fff[_0xbfef('0x59')][_0xbfef('0x73')])){throw new db[(_0xbfef('0x5c'))][(_0xbfef('0x75'))](_0xbfef('0x76'));}return _0x73094c[_0xbfef('0x7c')+_[_0xbfef('0x77')](_0x3f2fff[_0xbfef('0x59')][_0xbfef('0x73')][_0xbfef('0x78')]())+_0xbfef('0x7a')](_0x3f2fff[_0xbfef('0x59')]['ids']);}return null;})[_0xbfef('0x2b')](handleEntityNotFound(_0x2af903,null))[_0xbfef('0x2b')](respondWithStatusCode(_0x2af903,null))['catch'](handleError(_0x2af903,null));};exports[_0xbfef('0x7d')]=function(_0x121db9,_0x1877ad,_0x4b9b06){return db[_0xbfef('0x30')]['findOne']({'where':{'id':_0x121db9[_0xbfef('0x4a')]['id']}})[_0xbfef('0x2b')](function(_0x2a8091){if(_0x2a8091){if(!_0x121db9[_0xbfef('0x37')][_0xbfef('0x73')]||!utils[_0xbfef('0x74')](_0x121db9[_0xbfef('0x37')]['channel'])){throw new db[(_0xbfef('0x5c'))]['ValidationError'](_0xbfef('0x76'));}return _0x2a8091[_0xbfef('0x7e')+_['capitalize'](_0x121db9[_0xbfef('0x37')][_0xbfef('0x73')][_0xbfef('0x78')]())+_0xbfef('0x7a')](_0x121db9['query'][_0xbfef('0x7f')]);}return null;})[_0xbfef('0x2b')](handleEntityNotFound(_0x1877ad,null))[_0xbfef('0x2b')](respondWithStatusCode(_0x1877ad,null))[_0xbfef('0x49')](handleError(_0x1877ad,null));};exports[_0xbfef('0x80')]=function(_0xc0d79d,_0x5b0333){var _0x457c17=_[_0xbfef('0x81')](_0xc0d79d['body'][_0xbfef('0x7f')])?_0xc0d79d[_0xbfef('0x59')]['ids']:[_0xc0d79d[_0xbfef('0x59')]['ids']];var _0x1b0b4d=_0xc0d79d[_0xbfef('0x4a')]['id'];return db[_0xbfef('0x30')]['find']({'where':{'id':_0x1b0b4d}})[_0xbfef('0x2b')](handleEntityNotFound(_0x5b0333,null))[_0xbfef('0x2b')](function(_0x274308){if(_0x274308){var _0x45106c=[_0xbfef('0x82'),'Chat',_0xbfef('0x83'),_0xbfef('0x84'),_0xbfef('0x85'),_0xbfef('0x86'),'Whatsapp'];return db[_0xbfef('0x5b')][_0xbfef('0x5a')](function(_0x46f03c){var _0x5a5b76=_['map'](_0x45106c,function(_0x88b84a){var _0x4b2714={'attributes':['id',_0xbfef('0x2e')]};if(_0x88b84a===_0xbfef('0x82')){_0x4b2714[_0xbfef('0x87')]={'attributes':[_0xbfef('0x88')]};}return _0x274308['get'+_0x88b84a+_0xbfef('0x7a')](_0x4b2714)['then'](function(_0x9afcdd){var _0xb1007e=_['map'](_0x9afcdd,function(_0x5e87ff){var _0xacf7b4=_[_0xbfef('0x36')](_0x457c17,function(_0x39d8c2){var _0x4ee787={'where':{'UserId':_0x39d8c2,[_0x88b84a+_0xbfef('0x89')]:_0x5e87ff['id']},'transaction':_0x46f03c};if(_0x88b84a===_0xbfef('0x82')){_0x4ee787[_0xbfef('0x1c')]={'penalty':_0x5e87ff[_0xbfef('0x8a')]['penalty']};}return db[_0xbfef('0x8b')+_0x88b84a+_0xbfef('0x79')][_0xbfef('0x8c')](_0x4ee787)[_0xbfef('0x2b')](function(){socket[_0xbfef('0x8d')](_0xbfef('0x4f')+_0x88b84a+_0xbfef('0x8e'),{'UserId':_0x39d8c2,[_0x88b84a+_0xbfef('0x89')]:_0x5e87ff['id']});if(_0x88b84a!==_0xbfef('0x82')){return;}return db[_0xbfef('0x8b')][_0xbfef('0x8f')]({'where':{'id':_0x457c17,'online':0x1},'attributes':['id','name',_0xbfef('0x90'),'voicePause',_0xbfef('0x91')],'raw':!![]})[_0xbfef('0x2b')](function(_0x1dbe8){var _0x31b4fe=_[_0xbfef('0x36')](_0x1dbe8,function(_0xdee4fa){return db['UserVoiceQueueRt'][_0xbfef('0x92')]({'membername':_0xdee4fa[_0xbfef('0x2e')],'UserId':_0xdee4fa['id'],'queue_name':_0x5e87ff['name'],'VoiceQueueId':_0x5e87ff['id'],'interface':_[_0xbfef('0x93')](_0xdee4fa[_0xbfef('0x91')])?util[_0xbfef('0x94')](_0xbfef('0x95'),_0xdee4fa[_0xbfef('0x2e')]):_0xdee4fa['interface'],'paused':_0xdee4fa['voicePause']||![],'penalty':_0x5e87ff[_0xbfef('0x8a')][_0xbfef('0x88')]},{'transaction':_0x46f03c});});return Promise[_0xbfef('0x96')](_0x31b4fe);});});});return Promise[_0xbfef('0x96')](_0xacf7b4);});return Promise[_0xbfef('0x96')](_0xb1007e);})[_0xbfef('0x2b')](function(){return db[_0xbfef('0x70')][_0xbfef('0x7b')]({'where':{'teamId':_0x1b0b4d}})[_0xbfef('0x2b')](function(_0x1bfa91){if(_0x1bfa91){var _0x5b0a06=_[_0xbfef('0x36')](_0x457c17,function(_0x274dff){db[_0xbfef('0x97')][_0xbfef('0x92')]({'UserId':_0x274dff,'VoicePrefixId':_0x1bfa91[_0xbfef('0x71')]});});return Promise['all'](_0x5b0a06);}});});});return Promise[_0xbfef('0x96')](_0x5a5b76)[_0xbfef('0x2b')](function(){return _0x274308[_0xbfef('0x80')](_0x457c17,{'transaction':_0x46f03c})[_0xbfef('0x98')](function(_0x3d6ebc){return _0x3d6ebc;});});});}})['then'](respondWithResult(_0x5b0333,null))[_0xbfef('0x49')](handleError(_0x5b0333,null));};exports[_0xbfef('0x99')]=function(_0x27a372,_0xa7deba){var _0x55c327=_[_0xbfef('0x81')](_0x27a372[_0xbfef('0x37')][_0xbfef('0x7f')])?_0x27a372['query'][_0xbfef('0x7f')]:[_0x27a372[_0xbfef('0x37')][_0xbfef('0x7f')]];var _0x2b1d3a=_0x27a372[_0xbfef('0x4a')]['id'];return db[_0xbfef('0x30')][_0xbfef('0x4d')]({'where':{'id':_0x2b1d3a}})['then'](handleEntityNotFound(_0xa7deba,null))[_0xbfef('0x2b')](function(_0x435ccc){if(_0x435ccc){var _0x20af22=[_0xbfef('0x82'),_0xbfef('0x9a'),'Mail',_0xbfef('0x84'),_0xbfef('0x85'),_0xbfef('0x86'),_0xbfef('0x9b')];return db['sequelize'][_0xbfef('0x5a')](function(_0x109b58){var _0x12a1b3=_['map'](_0x20af22,function(_0x39e825){var _0x14fdca={'attributes':['id','name']};return _0x435ccc['get'+_0x39e825+_0xbfef('0x7a')](_0x14fdca)[_0xbfef('0x2b')](function(_0x589e21){var _0x17338d=_[_0xbfef('0x36')](_0x589e21,function(_0x1ef027){return _0x1ef027[_0xbfef('0x99')](_0x55c327,{'transaction':_0x109b58})[_0xbfef('0x2b')](function(){var _0x1efd16=_['map'](_0x55c327,function(_0x406239){socket['emit'](_0xbfef('0x4f')+_0x39e825+_0xbfef('0x9c'),{'UserId':Number(_0x406239),[_0x39e825+_0xbfef('0x89')]:_0x1ef027['id']});if(_0x39e825!==_0xbfef('0x82')){return;}return db[_0xbfef('0x9d')][_0xbfef('0x62')]({'where':{'VoiceQueueId':_0x1ef027['id'],'UserId':_0x406239},'transaction':_0x109b58});});return Promise[_0xbfef('0x96')](_0x1efd16);});});return Promise[_0xbfef('0x96')](_0x17338d);});});return Promise['all'](_0x12a1b3)['then'](function(){return _0x435ccc[_0xbfef('0x99')](_0x55c327,{'transaction':_0x109b58});})[_0xbfef('0x2b')](function(){return db['TeamVoicePrefix'][_0xbfef('0x7b')]({'where':{'teamId':_0x2b1d3a}})[_0xbfef('0x2b')](function(_0x4ad488){if(_0x4ad488){var _0x2a8300=_[_0xbfef('0x36')](_0x55c327,function(_0x40f018){db[_0xbfef('0x97')][_0xbfef('0x62')]({'where':{'UserId':_0x40f018,'VoicePrefixId':_0x4ad488[_0xbfef('0x71')]}});});return Promise[_0xbfef('0x96')](_0x2a8300);}});});});}})['then'](respondWithStatusCode(_0xa7deba,null))['catch'](handleError(_0xa7deba,null));};exports[_0xbfef('0x9e')]=function(_0x465190,_0x460f8c,_0x308d90){var _0x138b92={};var _0x1727d5={};var _0x4b9826;var _0x8100e2;return db[_0xbfef('0x30')][_0xbfef('0x7b')]({'where':{'id':_0x465190[_0xbfef('0x4a')]['id']}})[_0xbfef('0x2b')](handleEntityNotFound(_0x460f8c,null))[_0xbfef('0x2b')](function(_0x4bea49){if(_0x4bea49){_0x4b9826=_0x4bea49;_0x1727d5[_0xbfef('0x35')]=_[_0xbfef('0x4b')](db[_0xbfef('0x8b')]['rawAttributes']);_0x1727d5[_0xbfef('0x37')]=_[_0xbfef('0x4b')](_0x465190['query']);_0x1727d5[_0xbfef('0x38')]=_[_0xbfef('0x39')](_0x1727d5['model'],_0x1727d5[_0xbfef('0x37')]);_0x138b92['attributes']=_[_0xbfef('0x39')](_0x1727d5[_0xbfef('0x35')],qs[_0xbfef('0x3a')](_0x465190['query'][_0xbfef('0x3a')]));_0x138b92[_0xbfef('0x3c')]=_0x138b92[_0xbfef('0x3c')]['length']?_0x138b92[_0xbfef('0x3c')]:_0x1727d5[_0xbfef('0x35')];_0x138b92['order']=qs[_0xbfef('0x40')](_0x465190[_0xbfef('0x37')][_0xbfef('0x40')]);_0x138b92[_0xbfef('0x41')]=qs[_0xbfef('0x38')](_[_0xbfef('0x42')](_0x465190[_0xbfef('0x37')],_0x1727d5['filters']));if(_0x465190[_0xbfef('0x37')][_0xbfef('0x44')]){_0x138b92[_0xbfef('0x41')]=_['merge'](_0x138b92[_0xbfef('0x41')],{'$or':_['map'](_0x138b92[_0xbfef('0x3c')],function(_0x502e88){var _0x3a3b80={};_0x3a3b80[_0x502e88]={'$like':'%'+_0x465190[_0xbfef('0x37')][_0xbfef('0x44')]+'%'};return _0x3a3b80;})});}_0x138b92=_[_0xbfef('0x43')]({},_0x138b92,_0x465190['options']);return _0x4b9826[_0xbfef('0x9e')](_0x138b92);}})[_0xbfef('0x2b')](function(_0x33b91f){if(_0x33b91f){_0x8100e2=_0x33b91f[_0xbfef('0x3b')];if(!_0x465190[_0xbfef('0x37')][_0xbfef('0x9f')](_0xbfef('0x3d'))){_0x138b92[_0xbfef('0x3e')]=qs['limit'](_0x465190['query'][_0xbfef('0x3e')]);_0x138b92[_0xbfef('0x25')]=qs[_0xbfef('0x25')](_0x465190['query']['offset']);}return _0x4b9826[_0xbfef('0x9e')](_0x138b92);}})[_0xbfef('0x2b')](function(_0x1e3953){if(_0x1e3953){return _0x1e3953?{'count':_0x8100e2,'rows':_0x1e3953}:null;}})[_0xbfef('0x2b')](respondWithResult(_0x460f8c,null))[_0xbfef('0x49')](handleError(_0x460f8c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 3315f92..97668dc 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 _0x6759=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x2f7176,_0x2c6471){var _0x45a260=function(_0x11af07){while(--_0x11af07){_0x2f7176['push'](_0x2f7176['shift']());}};_0x45a260(++_0x2c6471);}(_0x6759,0x10d));var _0x9675=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x6759[_0x4df671];return _0x3f9658;};'use strict';var EventEmitter=require('events');var Team=require(_0x9675('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x9675('0x1')](0x0);var events={'afterCreate':_0x9675('0x2'),'afterUpdate':_0x9675('0x3'),'afterDestroy':_0x9675('0x4')};function emitEvent(_0x56f0c0){return function(_0x2398ff,_0xb6dc99,_0xc856e5){TeamEvents[_0x9675('0x5')](_0x56f0c0+':'+_0x2398ff['id'],_0x2398ff);TeamEvents[_0x9675('0x5')](_0x56f0c0,_0x2398ff);_0xc856e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x9675('0x6')]=TeamEvents; \ No newline at end of file +var _0x9eb2=['emit','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x2d151a,_0x5ba16b){var _0x5e0419=function(_0x18649d){while(--_0x18649d){_0x2d151a['push'](_0x2d151a['shift']());}};_0x5e0419(++_0x5ba16b);}(_0x9eb2,0xb2));var _0x29eb=function(_0x445e3d,_0xef2e55){_0x445e3d=_0x445e3d-0x0;var _0x4b7dfc=_0x9eb2[_0x445e3d];return _0x4b7dfc;};'use strict';var EventEmitter=require(_0x29eb('0x0'));var Team=require(_0x29eb('0x1'))['db'][_0x29eb('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x29eb('0x3')](0x0);var events={'afterCreate':_0x29eb('0x4'),'afterUpdate':_0x29eb('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4f26c){return function(_0x381a49,_0x5e6617,_0x1fb31e){TeamEvents[_0x29eb('0x6')](_0xd4f26c+':'+_0x381a49['id'],_0x381a49);TeamEvents[_0x29eb('0x6')](_0xd4f26c,_0x381a49);_0x1fb31e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x29eb('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 27d6504..9ca2921 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 _0xa3fe=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x5df25b,_0x1bc928){var _0x19f252=function(_0x41de28){while(--_0x41de28){_0x5df25b['push'](_0x5df25b['shift']());}};_0x19f252(++_0x1bc928);}(_0xa3fe,0xf4));var _0xea3f=function(_0x1c67ba,_0x3a95cf){_0x1c67ba=_0x1c67ba-0x0;var _0x3b139a=_0xa3fe[_0x1c67ba];return _0x3b139a;};'use strict';var _=require(_0xea3f('0x0'));var util=require(_0xea3f('0x1'));var logger=require(_0xea3f('0x2'))(_0xea3f('0x3'));var moment=require(_0xea3f('0x4'));var BPromise=require(_0xea3f('0x5'));var rp=require(_0xea3f('0x6'));var fs=require('fs');var path=require(_0xea3f('0x7'));var rimraf=require(_0xea3f('0x8'));var config=require(_0xea3f('0x9'));var attributes=require(_0xea3f('0xa'));module[_0xea3f('0xb')]=function(_0x4da87a,_0x1cc38b){return _0x4da87a[_0xea3f('0xc')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f14=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./team.attributes','exports','define','Team','util','../../config/logger'];(function(_0x1d0765,_0x4e68e0){var _0x375a20=function(_0x5e80c4){while(--_0x5e80c4){_0x1d0765['push'](_0x1d0765['shift']());}};_0x375a20(++_0x4e68e0);}(_0x3f14,0x112));var _0x43f1=function(_0x3c5e45,_0x5a9916){_0x3c5e45=_0x3c5e45-0x0;var _0x2cecea=_0x3f14[_0x3c5e45];return _0x2cecea;};'use strict';var _=require('lodash');var util=require(_0x43f1('0x0'));var logger=require(_0x43f1('0x1'))(_0x43f1('0x2'));var moment=require(_0x43f1('0x3'));var BPromise=require(_0x43f1('0x4'));var rp=require(_0x43f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43f1('0x6'));var config=require(_0x43f1('0x7'));var attributes=require(_0x43f1('0x8'));module[_0x43f1('0x9')]=function(_0x39a034,_0x3f378a){return _0x39a034[_0x43f1('0xa')](_0x43f1('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index c901c66..aed80a4 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 _0xca1f=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0xca1f,0xef));var _0xfca1=function(_0x2f122c,_0x8a9b50){_0x2f122c=_0x2f122c-0x0;var _0x2ca7f1=_0xca1f[_0x2f122c];return _0x2ca7f1;};'use strict';var _=require(_0xfca1('0x0'));var util=require(_0xfca1('0x1'));var moment=require('moment');var BPromise=require(_0xfca1('0x2'));var rs=require(_0xfca1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfca1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfca1('0x5'))(_0xfca1('0x6'));var config=require(_0xfca1('0x7'));var jayson=require(_0xfca1('0x8'));var client=jayson[_0xfca1('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xfca1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfca1('0xb'))(new Redis(config[_0xfca1('0xa')]));require(_0xfca1('0xc'))[_0xfca1('0xd')](socket);function respondWithRpcPromise(_0xa9b63e,_0x17039e,_0x4a0b91){return new BPromise(function(_0x3b8f94,_0x515905){return client[_0xfca1('0xe')](_0xa9b63e,_0x4a0b91)[_0xfca1('0xf')](function(_0x498ab4){logger[_0xfca1('0x10')](_0xfca1('0x11'),_0x17039e,'request\x20sent');logger[_0xfca1('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x17039e,_0xfca1('0x13'),JSON[_0xfca1('0x14')](_0x498ab4));if(_0x498ab4['error']){if(_0x498ab4[_0xfca1('0x15')][_0xfca1('0x16')]===0x1f4){logger[_0xfca1('0x15')](_0xfca1('0x11'),_0x17039e,_0x498ab4[_0xfca1('0x15')]['message']);return _0x515905(_0x498ab4[_0xfca1('0x15')][_0xfca1('0x17')]);}logger[_0xfca1('0x15')](_0xfca1('0x11'),_0x17039e,_0x498ab4[_0xfca1('0x15')][_0xfca1('0x17')]);return _0x3b8f94(_0x498ab4[_0xfca1('0x15')]['message']);}else{logger[_0xfca1('0x10')]('Team,\x20%s,\x20%s',_0x17039e,_0xfca1('0x13'));_0x3b8f94(_0x498ab4[_0xfca1('0x18')][_0xfca1('0x17')]);}})[_0xfca1('0x19')](function(_0xa7f7c){logger['error'](_0xfca1('0x11'),_0x17039e,_0xa7f7c);_0x515905(_0xa7f7c);});});} \ No newline at end of file +var _0x8613=['message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','register','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8613,0x174));var _0x3861=function(_0x143896,_0x31f415){_0x143896=_0x143896-0x0;var _0x27d303=_0x8613[_0x143896];return _0x27d303;};'use strict';var _=require(_0x3861('0x0'));var util=require('util');var moment=require(_0x3861('0x1'));var BPromise=require(_0x3861('0x2'));var rs=require(_0x3861('0x3'));var fs=require('fs');var Redis=require(_0x3861('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3861('0x5'));var logger=require(_0x3861('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3861('0x7'));var client=jayson['client'][_0x3861('0x8')]({'port':0x232a});config[_0x3861('0x9')]=_[_0x3861('0xa')](config[_0x3861('0x9')],{'host':_0x3861('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3861('0x9')]));require('./team.socket')[_0x3861('0xc')](socket);function respondWithRpcPromise(_0x390533,_0x96b9fc,_0x225994){return new BPromise(function(_0x606326,_0x3a3393){return client[_0x3861('0xd')](_0x390533,_0x225994)[_0x3861('0xe')](function(_0x49300c){logger['info'](_0x3861('0xf'),_0x96b9fc,_0x3861('0x10'));logger['debug'](_0x3861('0x11'),_0x96b9fc,_0x3861('0x10'),JSON['stringify'](_0x49300c));if(_0x49300c[_0x3861('0x12')]){if(_0x49300c[_0x3861('0x12')]['code']===0x1f4){logger[_0x3861('0x12')](_0x3861('0xf'),_0x96b9fc,_0x49300c[_0x3861('0x12')][_0x3861('0x13')]);return _0x3a3393(_0x49300c[_0x3861('0x12')]['message']);}logger[_0x3861('0x12')](_0x3861('0xf'),_0x96b9fc,_0x49300c[_0x3861('0x12')]['message']);return _0x606326(_0x49300c[_0x3861('0x12')][_0x3861('0x13')]);}else{logger[_0x3861('0x14')](_0x3861('0xf'),_0x96b9fc,_0x3861('0x10'));_0x606326(_0x49300c[_0x3861('0x15')]['message']);}})[_0x3861('0x16')](function(_0x3971a7){logger[_0x3861('0x12')](_0x3861('0xf'),_0x96b9fc,_0x3971a7);_0x3a3393(_0x3971a7);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e62fbc7..e43c6b1 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 _0xb7aa=['./team.events','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7aa,0x11a));var _0xab7a=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xb7aa[_0x41d02a];return _0x4c3983;};'use strict';var TeamEvents=require(_0xab7a('0x0'));var events=[_0xab7a('0x1'),_0xab7a('0x2'),_0xab7a('0x3')];function createListener(_0x1d2507,_0x3eab6c){return function(_0x20b86d){_0x3eab6c[_0xab7a('0x4')](_0x1d2507,_0x20b86d);};}function removeListener(_0x34adc3,_0x3b0621){return function(){TeamEvents['removeListener'](_0x34adc3,_0x3b0621);};}exports[_0xab7a('0x5')]=function(_0x1c761b){for(var _0x2ee412=0x0,_0x29ef15=events['length'];_0x2ee412<_0x29ef15;_0x2ee412++){var _0x99ac82=events[_0x2ee412];var _0x1e3b23=createListener('team:'+_0x99ac82,_0x1c761b);TeamEvents['on'](_0x99ac82,_0x1e3b23);}}; \ No newline at end of file +var _0x61ac=['save','update','removeListener','length','team:'];(function(_0x48aae5,_0x20e571){var _0x13fc73=function(_0x918308){while(--_0x918308){_0x48aae5['push'](_0x48aae5['shift']());}};_0x13fc73(++_0x20e571);}(_0x61ac,0x82));var _0xc61a=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x61ac[_0x35e124];return _0x53c482;};'use strict';var TeamEvents=require('./team.events');var events=[_0xc61a('0x0'),'remove',_0xc61a('0x1')];function createListener(_0x291212,_0x229183){return function(_0x52d3fd){_0x229183['emit'](_0x291212,_0x52d3fd);};}function removeListener(_0x3d170d,_0x370e61){return function(){TeamEvents[_0xc61a('0x2')](_0x3d170d,_0x370e61);};}exports['register']=function(_0x4bcc09){for(var _0x4c68e7=0x0,_0xd3713d=events[_0xc61a('0x3')];_0x4c68e7<_0xd3713d;_0x4c68e7++){var _0x18c5f6=events[_0x4c68e7];var _0x142793=createListener(_0xc61a('0x4')+_0x18c5f6,_0x4bcc09);TeamEvents['on'](_0x18c5f6,_0x142793);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 72155c1..5cce7f4 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 _0x4787=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4787,0x148));var _0x7478=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x4787[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x7478('0x0')]={'TeamId':{'type':Sequelize[_0x7478('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x7478('0x1')]}}; \ No newline at end of file +var _0x7834=['INTEGER','sequelize'];(function(_0x1497fa,_0xe4eb52){var _0x1c5bf0=function(_0x3c6503){while(--_0x3c6503){_0x1497fa['push'](_0x1497fa['shift']());}};_0x1c5bf0(++_0xe4eb52);}(_0x7834,0x13f));var _0x4783=function(_0x4df017,_0x2a0aa4){_0x4df017=_0x4df017-0x0;var _0x42c215=_0x7834[_0x4df017];return _0x42c215;};'use strict';var Sequelize=require(_0x4783('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x4783('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 03d08ec..2a92739 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 _0xb688=['exports','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x6990bc,_0x16f292){var _0x5ca9ab=function(_0x7e3f32){while(--_0x7e3f32){_0x6990bc['push'](_0x6990bc['shift']());}};_0x5ca9ab(++_0x16f292);}(_0xb688,0xcf));var _0x8b68=function(_0x1c1fa1,_0x31a871){_0x1c1fa1=_0x1c1fa1-0x0;var _0x2496fa=_0xb688[_0x1c1fa1];return _0x2496fa;};'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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','TeamVoicePrefix'];(function(_0x421803,_0x55cb9e){var _0x44234c=function(_0x1314a2){while(--_0x1314a2){_0x421803['push'](_0x421803['shift']());}};_0x44234c(++_0x55cb9e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x55db3e,_0x5efa08){_0x55db3e=_0x55db3e-0x0;var _0x43ff08=_0x8f4c[_0x55db3e];return _0x43ff08;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 88e719a..427ba6f 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3fe73d,_0x5edc28){var _0x2646a9=function(_0x59c671){while(--_0x59c671){_0x3fe73d['push'](_0x3fe73d['shift']());}};_0x2646a9(++_0x5edc28);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xd3bcf8,_0x994fdb){var _0x296170=function(_0x2f5519){while(--_0x2f5519){_0xd3bcf8['push'](_0xd3bcf8['shift']());}};_0x296170(++_0x994fdb);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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 dc37a88..880cea8 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 _0x2691=['sequelize','exports','INTEGER'];(function(_0x1be50b,_0x190884){var _0x112155=function(_0x386804){while(--_0x386804){_0x1be50b['push'](_0x1be50b['shift']());}};_0x112155(++_0x190884);}(_0x2691,0x132));var _0x1269=function(_0x38b58,_0x255a6f){_0x38b58=_0x38b58-0x0;var _0x338fd5=_0x2691[_0x38b58];return _0x338fd5;};'use strict';var Sequelize=require(_0x1269('0x0'));module[_0x1269('0x1')]={'penalty':{'type':Sequelize[_0x1269('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf108=['INTEGER','sequelize','exports'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf108,0x172));var _0x8f10=function(_0x15a8b6,_0x481d17){_0x15a8b6=_0x15a8b6-0x0;var _0x2b7bda=_0xf108[_0x15a8b6];return _0x2b7bda;};'use strict';var Sequelize=require(_0x8f10('0x0'));module[_0x8f10('0x1')]={'penalty':{'type':Sequelize[_0x8f10('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 83e184b..101eed5 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 _0x1159=['define','TeamVoiceQueue','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x2e8d52,_0x93b4e1){var _0x4b0865=function(_0x1dac72){while(--_0x1dac72){_0x2e8d52['push'](_0x2e8d52['shift']());}};_0x4b0865(++_0x93b4e1);}(_0x1159,0xf3));var _0x9115=function(_0x26d481,_0x369892){_0x26d481=_0x26d481-0x0;var _0x3da09e=_0x1159[_0x26d481];return _0x3da09e;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xad36,0x11c));var _0x6ad3=function(_0xdfd212,_0x53cc5f){_0xdfd212=_0xdfd212-0x0;var _0x39d3c9=_0xad36[_0xdfd212];return _0x39d3c9;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var logger=require(_0x6ad3('0x1'))(_0x6ad3('0x2'));var moment=require(_0x6ad3('0x3'));var BPromise=require(_0x6ad3('0x4'));var rp=require(_0x6ad3('0x5'));var fs=require('fs');var path=require(_0x6ad3('0x6'));var rimraf=require(_0x6ad3('0x7'));var config=require(_0x6ad3('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0x6ad3('0x9')]=function(_0x3d669f,_0x3c3041){return _0x3d669f[_0x6ad3('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','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 3a4ae78..916d871 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 _0x7d43=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d43,0x12c));var _0x37d4=function(_0x5c5b4a,_0x557f92){_0x5c5b4a=_0x5c5b4a-0x0;var _0x9de325=_0x7d43[_0x5c5b4a];return _0x9de325;};'use strict';var _=require(_0x37d4('0x0'));var util=require('util');var moment=require(_0x37d4('0x1'));var BPromise=require(_0x37d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d4('0x3'));var db=require(_0x37d4('0x4'))['db'];var utils=require(_0x37d4('0x5'));var logger=require(_0x37d4('0x6'))('rpc');var config=require(_0x37d4('0x7'));var jayson=require(_0x37d4('0x8'));var client=jayson[_0x37d4('0x9')][_0x37d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c17c3,_0x43a627,_0x1eaa2f){return new BPromise(function(_0x2625c1,_0x225da3){return client[_0x37d4('0xb')](_0x2c17c3,_0x1eaa2f)[_0x37d4('0xc')](function(_0x32e909){logger[_0x37d4('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x43a627,'request\x20sent');logger[_0x37d4('0xe')](_0x37d4('0xf'),_0x43a627,_0x37d4('0x10'),JSON['stringify'](_0x32e909));if(_0x32e909['error']){if(_0x32e909[_0x37d4('0x11')][_0x37d4('0x12')]===0x1f4){logger[_0x37d4('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x43a627,_0x32e909[_0x37d4('0x11')]['message']);return _0x225da3(_0x32e909['error'][_0x37d4('0x13')]);}logger[_0x37d4('0x11')](_0x37d4('0x14'),_0x43a627,_0x32e909['error'][_0x37d4('0x13')]);return _0x2625c1(_0x32e909[_0x37d4('0x11')][_0x37d4('0x13')]);}else{logger['info'](_0x37d4('0x14'),_0x43a627,_0x37d4('0x10'));_0x2625c1(_0x32e909[_0x37d4('0x15')][_0x37d4('0x13')]);}})[_0x37d4('0x16')](function(_0x1da5ef){logger[_0x37d4('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x43a627,_0x1da5ef);_0x225da3(_0x1da5ef);});});} \ No newline at end of file +var _0x9ff4=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x458c70,_0xf4d2aa){var _0x21aa61=function(_0x695877){while(--_0x695877){_0x458c70['push'](_0x458c70['shift']());}};_0x21aa61(++_0xf4d2aa);}(_0x9ff4,0x196));var _0x49ff=function(_0x54840a,_0x48eb0c){_0x54840a=_0x54840a-0x0;var _0x18939f=_0x9ff4[_0x54840a];return _0x18939f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49ff('0x0'));var rs=require(_0x49ff('0x1'));var fs=require('fs');var Redis=require(_0x49ff('0x2'));var db=require(_0x49ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ff('0x4'))(_0x49ff('0x5'));var config=require(_0x49ff('0x6'));var jayson=require(_0x49ff('0x7'));var client=jayson[_0x49ff('0x8')][_0x49ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe967d3,_0xd87903,_0x50f784){return new BPromise(function(_0x5478a6,_0x304f83){return client[_0x49ff('0xa')](_0xe967d3,_0x50f784)['then'](function(_0x4e845a){logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));logger[_0x49ff('0xe')](_0x49ff('0xf'),_0xd87903,_0x49ff('0xd'),JSON[_0x49ff('0x10')](_0x4e845a));if(_0x4e845a[_0x49ff('0x11')]){if(_0x4e845a['error']['code']===0x1f4){logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a[_0x49ff('0x11')]['message']);return _0x304f83(_0x4e845a[_0x49ff('0x11')]['message']);}logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a['error'][_0x49ff('0x12')]);return _0x5478a6(_0x4e845a[_0x49ff('0x11')][_0x49ff('0x12')]);}else{logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));_0x5478a6(_0x4e845a[_0x49ff('0x13')][_0x49ff('0x12')]);}})['catch'](function(_0x29fb22){logger['error'](_0x49ff('0xc'),_0xd87903,_0x29fb22);_0x304f83(_0x29fb22);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b10594c..cf34dd9 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 _0x078f=['create','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x078f,0x1b4));var _0xf078=function(_0x37377f,_0x3b08e3){_0x37377f=_0x37377f-0x0;var _0x3ffd62=_0x078f[_0x37377f];return _0x3ffd62;};'use strict';var multer=require('multer');var util=require(_0xf078('0x0'));var path=require(_0xf078('0x1'));var timeout=require('connect-timeout');var express=require(_0xf078('0x2'));var router=express[_0xf078('0x3')]();var fs_extra=require(_0xf078('0x4'));var auth=require(_0xf078('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf078('0x6'));var controller=require(_0xf078('0x7'));router[_0xf078('0x8')]('/',auth[_0xf078('0x9')](),controller[_0xf078('0xa')]);router[_0xf078('0x8')](_0xf078('0xb'),auth[_0xf078('0x9')](),controller[_0xf078('0xc')]);router[_0xf078('0xd')]('/',auth['isAuthenticated'](),controller[_0xf078('0xe')]);router['put'](_0xf078('0xb'),auth[_0xf078('0x9')](),controller[_0xf078('0xf')]);router[_0xf078('0x10')]('/:id',auth[_0xf078('0x9')](),controller['destroy']);module[_0xf078('0x11')]=router; \ No newline at end of file +var _0x6337=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28d1a9,_0x569828){var _0x19bc75=function(_0x2ec4ed){while(--_0x2ec4ed){_0x28d1a9['push'](_0x28d1a9['shift']());}};_0x19bc75(++_0x569828);}(_0x6337,0x18a));var _0x7633=function(_0x14a683,_0x37d119){_0x14a683=_0x14a683-0x0;var _0x211983=_0x6337[_0x14a683];return _0x211983;};'use strict';var multer=require('multer');var util=require(_0x7633('0x0'));var path=require(_0x7633('0x1'));var timeout=require(_0x7633('0x2'));var express=require(_0x7633('0x3'));var router=express[_0x7633('0x4')]();var fs_extra=require(_0x7633('0x5'));var auth=require(_0x7633('0x6'));var interaction=require(_0x7633('0x7'));var config=require(_0x7633('0x8'));var controller=require('./template.controller');router[_0x7633('0x9')]('/',auth[_0x7633('0xa')](),controller[_0x7633('0xb')]);router['get'](_0x7633('0xc'),auth['isAuthenticated'](),controller[_0x7633('0xd')]);router[_0x7633('0xe')]('/',auth['isAuthenticated'](),controller[_0x7633('0xf')]);router['put'](_0x7633('0xc'),auth['isAuthenticated'](),controller[_0x7633('0x10')]);router[_0x7633('0x11')]('/:id',auth[_0x7633('0xa')](),controller[_0x7633('0x12')]);module[_0x7633('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 33f60b2..e93b0de 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 _0x6c01=['STRING','TEXT','exports'];(function(_0x4bedc7,_0x1416dd){var _0x56a1f3=function(_0x462034){while(--_0x462034){_0x4bedc7['push'](_0x4bedc7['shift']());}};_0x56a1f3(++_0x1416dd);}(_0x6c01,0x1c7));var _0x16c0=function(_0x4de2ee,_0x343134){_0x4de2ee=_0x4de2ee-0x0;var _0x1faaac=_0x6c01[_0x4de2ee];return _0x1faaac;};'use strict';var Sequelize=require('sequelize');module[_0x16c0('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x16c0('0x1')]},'html':{'type':Sequelize[_0x16c0('0x2')]}}; \ No newline at end of file +var _0xb611=['STRING'];(function(_0x2b3b84,_0x29afe7){var _0x323153=function(_0x22a1dd){while(--_0x22a1dd){_0x2b3b84['push'](_0x2b3b84['shift']());}};_0x323153(++_0x29afe7);}(_0xb611,0x14e));var _0x1b61=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xb611[_0x301dab];return _0x2500a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1b61('0x0')]},'description':{'type':Sequelize[_0x1b61('0x0')]},'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 7b5df08..d30edcd 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 _0xec7e=['sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','fields','find','create','body','user','role','Templates','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit'];(function(_0x582fd0,_0x411f85){var _0x3ced46=function(_0x1c7cb9){while(--_0x1c7cb9){_0x582fd0['push'](_0x582fd0['shift']());}};_0x3ced46(++_0x411f85);}(_0xec7e,0x69));var _0xeec7=function(_0x702a2,_0x6c81ea){_0x702a2=_0x702a2-0x0;var _0x4741af=_0xec7e[_0x702a2];return _0x4741af;};'use strict';var emlformat=require(_0xeec7('0x0'));var rimraf=require(_0xeec7('0x1'));var zipdir=require(_0xeec7('0x2'));var jsonpatch=require(_0xeec7('0x3'));var rp=require('request-promise');var moment=require(_0xeec7('0x4'));var BPromise=require(_0xeec7('0x5'));var Mustache=require(_0xeec7('0x6'));var util=require(_0xeec7('0x7'));var path=require('path');var sox=require(_0xeec7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeec7('0x9'));var squel=require('squel');var crypto=require(_0xeec7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xeec7('0xb'));var toCsv=require('to-csv');var querystring=require(_0xeec7('0xc'));var Papa=require(_0xeec7('0xd'));var Redis=require(_0xeec7('0xe'));var authService=require(_0xeec7('0xf'));var qs=require(_0xeec7('0x10'));var as=require(_0xeec7('0x11'));var hardwareService=require(_0xeec7('0x12'));var logger=require(_0xeec7('0x13'))(_0xeec7('0x14'));var utils=require(_0xeec7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeec7('0x16'));var db=require(_0xeec7('0x17'))['db'];function respondWithStatusCode(_0x4728b8,_0x1d3d35){_0x1d3d35=_0x1d3d35||0xcc;return function(_0xfa9aab){if(_0xfa9aab){return _0x4728b8['sendStatus'](_0x1d3d35);}return _0x4728b8[_0xeec7('0x18')](_0x1d3d35)['end']();};}function respondWithResult(_0x4bd04d,_0x113216){_0x113216=_0x113216||0xc8;return function(_0x44c924){if(_0x44c924){return _0x4bd04d[_0xeec7('0x18')](_0x113216)[_0xeec7('0x19')](_0x44c924);}};}function respondWithFilteredResult(_0x36b4,_0x29c53b){return function(_0x25653c){if(_0x25653c){var _0xbba6ef=typeof _0x29c53b[_0xeec7('0x1a')]===_0xeec7('0x1b')&&typeof _0x29c53b[_0xeec7('0x1c')]===_0xeec7('0x1b');var _0x31a913=_0x25653c['count'];var _0x5da91c=_0xbba6ef?0x0:_0x29c53b[_0xeec7('0x1a')];var _0xdc1d67=_0xbba6ef?_0x25653c[_0xeec7('0x1d')]:_0x29c53b[_0xeec7('0x1a')]+_0x29c53b[_0xeec7('0x1c')];var _0x1acaa7;if(_0xdc1d67>=_0x31a913){_0xdc1d67=_0x31a913;_0x1acaa7=0xc8;}else{_0x1acaa7=0xce;}_0x36b4[_0xeec7('0x18')](_0x1acaa7);return _0x36b4['set'](_0xeec7('0x1e'),_0x5da91c+'-'+_0xdc1d67+'/'+_0x31a913)['json'](_0x25653c);}return null;};}function patchUpdates(_0x423c8e){return function(_0x4a35a8){try{jsonpatch['apply'](_0x4a35a8,_0x423c8e,!![]);}catch(_0x90e74b){return BPromise[_0xeec7('0x1f')](_0x90e74b);}return _0x4a35a8[_0xeec7('0x20')]();};}function saveUpdates(_0x2edcb9,_0x4ae77f){return function(_0x3ba019){if(_0x3ba019){return _0x3ba019['update'](_0x2edcb9)['then'](function(_0x514b77){return _0x514b77;});}return null;};}function removeEntity(_0x33d15c,_0x56b805){return function(_0x216608){if(_0x216608){return _0x216608[_0xeec7('0x21')]()[_0xeec7('0x22')](function(){var _0x4ea338=_0x216608[_0xeec7('0x23')]({'plain':!![]});var _0x40836f='Templates';return db[_0xeec7('0x24')][_0xeec7('0x21')]({'where':{'type':_0x40836f,'resourceId':_0x4ea338['id']}})[_0xeec7('0x22')](function(){return _0x216608;});})[_0xeec7('0x22')](function(){_0x33d15c[_0xeec7('0x18')](0xcc)[_0xeec7('0x25')]();});}};}function handleEntityNotFound(_0x2996aa,_0x251f2d){return function(_0x4e945f){if(!_0x4e945f){_0x2996aa[_0xeec7('0x26')](0x194);}return _0x4e945f;};}function handleError(_0x1bb588,_0xe7e61f){_0xe7e61f=_0xe7e61f||0x1f4;return function(_0x3d39ca){logger[_0xeec7('0x27')](_0x3d39ca[_0xeec7('0x28')]);if(_0x3d39ca['name']){delete _0x3d39ca[_0xeec7('0x29')];}_0x1bb588['status'](_0xe7e61f)[_0xeec7('0x2a')](_0x3d39ca);};}exports[_0xeec7('0x2b')]=function(_0x1a83f6,_0x351e39){var _0x35ef37={},_0x409684={},_0xb2b901={'count':0x0,'rows':[]};var _0x585c00=_[_0xeec7('0x2c')](db[_0xeec7('0x2d')][_0xeec7('0x2e')],function(_0x474fd4){return{'name':_0x474fd4[_0xeec7('0x2f')],'type':_0x474fd4[_0xeec7('0x30')][_0xeec7('0x31')]};});_0x409684[_0xeec7('0x32')]=_['map'](_0x585c00,_0xeec7('0x29'));_0x409684[_0xeec7('0x33')]=_[_0xeec7('0x34')](_0x1a83f6[_0xeec7('0x33')]);_0x409684['filters']=_[_0xeec7('0x35')](_0x409684[_0xeec7('0x32')],_0x409684['query']);_0x35ef37[_0xeec7('0x36')]=_[_0xeec7('0x35')](_0x409684[_0xeec7('0x32')],qs['fields'](_0x1a83f6[_0xeec7('0x33')]['fields']));_0x35ef37[_0xeec7('0x36')]=_0x35ef37['attributes'][_0xeec7('0x37')]?_0x35ef37[_0xeec7('0x36')]:_0x409684['model'];if(!_0x1a83f6['query']['hasOwnProperty'](_0xeec7('0x38'))){_0x35ef37[_0xeec7('0x1c')]=qs[_0xeec7('0x1c')](_0x1a83f6[_0xeec7('0x33')]['limit']);_0x35ef37[_0xeec7('0x1a')]=qs[_0xeec7('0x1a')](_0x1a83f6[_0xeec7('0x33')][_0xeec7('0x1a')]);}_0x35ef37['order']=qs[_0xeec7('0x39')](_0x1a83f6[_0xeec7('0x33')][_0xeec7('0x39')]);_0x35ef37[_0xeec7('0x3a')]=qs[_0xeec7('0x3b')](_['pick'](_0x1a83f6[_0xeec7('0x33')],_0x409684[_0xeec7('0x3b')]),_0x585c00);if(_0x1a83f6[_0xeec7('0x33')][_0xeec7('0x3c')]){_0x35ef37['where']=_[_0xeec7('0x3d')](_0x35ef37[_0xeec7('0x3a')],{'$or':_['map'](_0x585c00,function(_0x228e18){if(_0x228e18[_0xeec7('0x30')]!==_0xeec7('0x3e')){var _0x267c99={};_0x267c99[_0x228e18[_0xeec7('0x29')]]={'$like':'%'+_0x1a83f6[_0xeec7('0x33')][_0xeec7('0x3c')]+'%'};return _0x267c99;}})});}_0x35ef37=_[_0xeec7('0x3d')]({},_0x35ef37,_0x1a83f6[_0xeec7('0x3f')]);var _0x44c31c={'where':_0x35ef37[_0xeec7('0x3a')]};return db[_0xeec7('0x2d')][_0xeec7('0x1d')](_0x44c31c)[_0xeec7('0x22')](function(_0x197e81){_0xb2b901['count']=_0x197e81;if(_0x1a83f6[_0xeec7('0x33')][_0xeec7('0x40')]){_0x35ef37[_0xeec7('0x41')]=[{'all':!![]}];}return db[_0xeec7('0x2d')]['findAll'](_0x35ef37);})[_0xeec7('0x22')](function(_0x3ee78a){_0xb2b901[_0xeec7('0x42')]=_0x3ee78a;return _0xb2b901;})['then'](respondWithFilteredResult(_0x351e39,_0x35ef37))['catch'](handleError(_0x351e39,null));};exports[_0xeec7('0x43')]=function(_0x524951,_0x2d33e1){var _0x65d12b={'raw':!![],'where':{'id':_0x524951['params']['id']}},_0xf9b72c={};_0xf9b72c['model']=_[_0xeec7('0x34')](db[_0xeec7('0x2d')][_0xeec7('0x2e')]);_0xf9b72c['query']=_[_0xeec7('0x34')](_0x524951[_0xeec7('0x33')]);_0xf9b72c[_0xeec7('0x3b')]=_[_0xeec7('0x35')](_0xf9b72c[_0xeec7('0x32')],_0xf9b72c[_0xeec7('0x33')]);_0x65d12b[_0xeec7('0x36')]=_[_0xeec7('0x35')](_0xf9b72c[_0xeec7('0x32')],qs[_0xeec7('0x44')](_0x524951[_0xeec7('0x33')]['fields']));_0x65d12b[_0xeec7('0x36')]=_0x65d12b[_0xeec7('0x36')][_0xeec7('0x37')]?_0x65d12b['attributes']:_0xf9b72c['model'];if(_0x524951[_0xeec7('0x33')][_0xeec7('0x40')]){_0x65d12b[_0xeec7('0x41')]=[{'all':!![]}];}_0x65d12b=_[_0xeec7('0x3d')]({},_0x65d12b,_0x524951[_0xeec7('0x3f')]);return db['Template'][_0xeec7('0x45')](_0x65d12b)[_0xeec7('0x22')](handleEntityNotFound(_0x2d33e1,null))[_0xeec7('0x22')](respondWithResult(_0x2d33e1,null))['catch'](handleError(_0x2d33e1,null));};exports[_0xeec7('0x46')]=function(_0x14606b,_0x5c441d){return db['Template'][_0xeec7('0x46')](_0x14606b[_0xeec7('0x47')],{})['then'](function(_0x43a0d6){var _0x5eaadf=_0x14606b[_0xeec7('0x48')]['get']({'plain':!![]});if(!_0x5eaadf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5eaadf[_0xeec7('0x49')]===_0xeec7('0x48')){var _0x45fb80=_0x43a0d6[_0xeec7('0x23')]({'plain':!![]});var _0x2c39d8=_0xeec7('0x4a');return db[_0xeec7('0x4b')][_0xeec7('0x45')]({'where':{'name':_0x2c39d8,'userProfileId':_0x5eaadf['userProfileId']},'raw':!![]})[_0xeec7('0x22')](function(_0x54c2bc){if(_0x54c2bc&&_0x54c2bc[_0xeec7('0x4c')]===0x0){return db['UserProfileResource'][_0xeec7('0x46')]({'name':_0x45fb80['name'],'resourceId':_0x45fb80['id'],'type':_0x54c2bc[_0xeec7('0x29')],'sectionId':_0x54c2bc['id']},{})[_0xeec7('0x22')](function(){return _0x43a0d6;});}else{return _0x43a0d6;}})['catch'](function(_0x271553){logger['error'](_0xeec7('0x4d'),_0x271553);throw _0x271553;});}return _0x43a0d6;})[_0xeec7('0x22')](respondWithResult(_0x5c441d,0xc9))[_0xeec7('0x4e')](handleError(_0x5c441d,null));};exports[_0xeec7('0x4f')]=function(_0x3f10b3,_0x19de3c){if(_0x3f10b3[_0xeec7('0x47')]['id']){delete _0x3f10b3[_0xeec7('0x47')]['id'];}return db['Template'][_0xeec7('0x45')]({'where':{'id':_0x3f10b3[_0xeec7('0x50')]['id']}})['then'](handleEntityNotFound(_0x19de3c,null))[_0xeec7('0x22')](saveUpdates(_0x3f10b3[_0xeec7('0x47')],null))[_0xeec7('0x22')](respondWithResult(_0x19de3c,null))[_0xeec7('0x4e')](handleError(_0x19de3c,null));};exports['destroy']=function(_0x34d7ab,_0x34d91b){return db[_0xeec7('0x2d')][_0xeec7('0x45')]({'where':{'id':_0x34d7ab[_0xeec7('0x50')]['id']}})[_0xeec7('0x22')](handleEntityNotFound(_0x34d91b,null))[_0xeec7('0x22')](removeEntity(_0x34d91b,null))['catch'](handleError(_0x34d91b,null));}; \ No newline at end of file +var _0x787b=['filters','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','destroy','then','get','Templates','UserProfileResource','error','stack','name','map','Template','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x787b,0x1aa));var _0xb787=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x787b[_0x33554b];return _0x256954;};'use strict';var emlformat=require(_0xb787('0x0'));var rimraf=require(_0xb787('0x1'));var zipdir=require(_0xb787('0x2'));var jsonpatch=require(_0xb787('0x3'));var rp=require(_0xb787('0x4'));var moment=require(_0xb787('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb787('0x6'));var util=require(_0xb787('0x7'));var path=require('path');var sox=require(_0xb787('0x8'));var csv=require(_0xb787('0x9'));var ejs=require(_0xb787('0xa'));var fs=require('fs');var fs_extra=require(_0xb787('0xb'));var _=require(_0xb787('0xc'));var squel=require(_0xb787('0xd'));var crypto=require(_0xb787('0xe'));var jsforce=require(_0xb787('0xf'));var deskjs=require(_0xb787('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb787('0x11'));var Redis=require(_0xb787('0x12'));var authService=require(_0xb787('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb787('0x14'));var hardwareService=require(_0xb787('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb787('0x16'));var config=require(_0xb787('0x17'));var licenseUtil=require(_0xb787('0x18'));var db=require(_0xb787('0x19'))['db'];function respondWithStatusCode(_0x4289b3,_0x2b3121){_0x2b3121=_0x2b3121||0xcc;return function(_0x49ad8a){if(_0x49ad8a){return _0x4289b3[_0xb787('0x1a')](_0x2b3121);}return _0x4289b3[_0xb787('0x1b')](_0x2b3121)[_0xb787('0x1c')]();};}function respondWithResult(_0x5ed8e0,_0x10a7e0){_0x10a7e0=_0x10a7e0||0xc8;return function(_0x45791a){if(_0x45791a){return _0x5ed8e0['status'](_0x10a7e0)['json'](_0x45791a);}};}function respondWithFilteredResult(_0x340e1c,_0x416719){return function(_0x23192e){if(_0x23192e){var _0x41a667=typeof _0x416719[_0xb787('0x1d')]==='undefined'&&typeof _0x416719['limit']===_0xb787('0x1e');var _0x4bab32=_0x23192e[_0xb787('0x1f')];var _0x42bf5f=_0x41a667?0x0:_0x416719['offset'];var _0x1d6665=_0x41a667?_0x23192e[_0xb787('0x1f')]:_0x416719[_0xb787('0x1d')]+_0x416719['limit'];var _0x47b95a;if(_0x1d6665>=_0x4bab32){_0x1d6665=_0x4bab32;_0x47b95a=0xc8;}else{_0x47b95a=0xce;}_0x340e1c[_0xb787('0x1b')](_0x47b95a);return _0x340e1c[_0xb787('0x20')](_0xb787('0x21'),_0x42bf5f+'-'+_0x1d6665+'/'+_0x4bab32)[_0xb787('0x22')](_0x23192e);}return null;};}function patchUpdates(_0x76a5d4){return function(_0x3f819a){try{jsonpatch['apply'](_0x3f819a,_0x76a5d4,!![]);}catch(_0x8b4214){return BPromise['reject'](_0x8b4214);}return _0x3f819a[_0xb787('0x23')]();};}function saveUpdates(_0x411160,_0x4cbdab){return function(_0x4d9679){if(_0x4d9679){return _0x4d9679['update'](_0x411160)['then'](function(_0x58732c){return _0x58732c;});}return null;};}function removeEntity(_0x55dfcc,_0x470cec){return function(_0xfc8266){if(_0xfc8266){return _0xfc8266[_0xb787('0x24')]()[_0xb787('0x25')](function(){var _0x5100f0=_0xfc8266[_0xb787('0x26')]({'plain':!![]});var _0x1e9527=_0xb787('0x27');return db[_0xb787('0x28')][_0xb787('0x24')]({'where':{'type':_0x1e9527,'resourceId':_0x5100f0['id']}})[_0xb787('0x25')](function(){return _0xfc8266;});})['then'](function(){_0x55dfcc[_0xb787('0x1b')](0xcc)[_0xb787('0x1c')]();});}};}function handleEntityNotFound(_0x31c0c6,_0x2bd7d0){return function(_0x2e9892){if(!_0x2e9892){_0x31c0c6[_0xb787('0x1a')](0x194);}return _0x2e9892;};}function handleError(_0x1a602c,_0x29dd26){_0x29dd26=_0x29dd26||0x1f4;return function(_0x18affc){logger[_0xb787('0x29')](_0x18affc[_0xb787('0x2a')]);if(_0x18affc[_0xb787('0x2b')]){delete _0x18affc[_0xb787('0x2b')];}_0x1a602c[_0xb787('0x1b')](_0x29dd26)['send'](_0x18affc);};}exports['index']=function(_0x56deac,_0x314b53){var _0xbe4984={},_0x422041={},_0x1e981e={'count':0x0,'rows':[]};var _0x3851be=_[_0xb787('0x2c')](db[_0xb787('0x2d')]['rawAttributes'],function(_0x472723){return{'name':_0x472723[_0xb787('0x2e')],'type':_0x472723['type'][_0xb787('0x2f')]};});_0x422041['model']=_[_0xb787('0x2c')](_0x3851be,_0xb787('0x2b'));_0x422041[_0xb787('0x30')]=_[_0xb787('0x31')](_0x56deac[_0xb787('0x30')]);_0x422041['filters']=_['intersection'](_0x422041[_0xb787('0x32')],_0x422041[_0xb787('0x30')]);_0xbe4984[_0xb787('0x33')]=_[_0xb787('0x34')](_0x422041[_0xb787('0x32')],qs[_0xb787('0x35')](_0x56deac[_0xb787('0x30')][_0xb787('0x35')]));_0xbe4984[_0xb787('0x33')]=_0xbe4984[_0xb787('0x33')][_0xb787('0x36')]?_0xbe4984[_0xb787('0x33')]:_0x422041[_0xb787('0x32')];if(!_0x56deac[_0xb787('0x30')][_0xb787('0x37')](_0xb787('0x38'))){_0xbe4984[_0xb787('0x39')]=qs[_0xb787('0x39')](_0x56deac[_0xb787('0x30')]['limit']);_0xbe4984[_0xb787('0x1d')]=qs[_0xb787('0x1d')](_0x56deac[_0xb787('0x30')][_0xb787('0x1d')]);}_0xbe4984['order']=qs['sort'](_0x56deac[_0xb787('0x30')][_0xb787('0x3a')]);_0xbe4984[_0xb787('0x3b')]=qs[_0xb787('0x3c')](_[_0xb787('0x3d')](_0x56deac[_0xb787('0x30')],_0x422041[_0xb787('0x3c')]),_0x3851be);if(_0x56deac[_0xb787('0x30')][_0xb787('0x3e')]){_0xbe4984['where']=_[_0xb787('0x3f')](_0xbe4984[_0xb787('0x3b')],{'$or':_[_0xb787('0x2c')](_0x3851be,function(_0x24115d){if(_0x24115d['type']!=='VIRTUAL'){var _0x28110c={};_0x28110c[_0x24115d[_0xb787('0x2b')]]={'$like':'%'+_0x56deac['query']['filter']+'%'};return _0x28110c;}})});}_0xbe4984=_['merge']({},_0xbe4984,_0x56deac[_0xb787('0x40')]);var _0x5531d9={'where':_0xbe4984[_0xb787('0x3b')]};return db[_0xb787('0x2d')]['count'](_0x5531d9)['then'](function(_0x3d3dc8){_0x1e981e[_0xb787('0x1f')]=_0x3d3dc8;if(_0x56deac[_0xb787('0x30')]['includeAll']){_0xbe4984[_0xb787('0x41')]=[{'all':!![]}];}return db[_0xb787('0x2d')][_0xb787('0x42')](_0xbe4984);})[_0xb787('0x25')](function(_0x21bd61){_0x1e981e[_0xb787('0x43')]=_0x21bd61;return _0x1e981e;})[_0xb787('0x25')](respondWithFilteredResult(_0x314b53,_0xbe4984))['catch'](handleError(_0x314b53,null));};exports[_0xb787('0x44')]=function(_0x2b9a39,_0x37945f){var _0x1234ae={'raw':!![],'where':{'id':_0x2b9a39[_0xb787('0x45')]['id']}},_0xd5a479={};_0xd5a479[_0xb787('0x32')]=_['keys'](db[_0xb787('0x2d')]['rawAttributes']);_0xd5a479[_0xb787('0x30')]=_['keys'](_0x2b9a39['query']);_0xd5a479[_0xb787('0x3c')]=_['intersection'](_0xd5a479[_0xb787('0x32')],_0xd5a479['query']);_0x1234ae['attributes']=_[_0xb787('0x34')](_0xd5a479[_0xb787('0x32')],qs[_0xb787('0x35')](_0x2b9a39['query'][_0xb787('0x35')]));_0x1234ae[_0xb787('0x33')]=_0x1234ae['attributes'][_0xb787('0x36')]?_0x1234ae[_0xb787('0x33')]:_0xd5a479['model'];if(_0x2b9a39[_0xb787('0x30')]['includeAll']){_0x1234ae['include']=[{'all':!![]}];}_0x1234ae=_[_0xb787('0x3f')]({},_0x1234ae,_0x2b9a39[_0xb787('0x40')]);return db[_0xb787('0x2d')][_0xb787('0x46')](_0x1234ae)[_0xb787('0x25')](handleEntityNotFound(_0x37945f,null))['then'](respondWithResult(_0x37945f,null))['catch'](handleError(_0x37945f,null));};exports[_0xb787('0x47')]=function(_0x10ec4d,_0x5d5fb3){return db[_0xb787('0x2d')][_0xb787('0x47')](_0x10ec4d[_0xb787('0x48')],{})[_0xb787('0x25')](function(_0x1ddb17){var _0x3940a7=_0x10ec4d[_0xb787('0x49')]['get']({'plain':!![]});if(!_0x3940a7)throw new Error(_0xb787('0x4a'));if(_0x3940a7['role']==='user'){var _0x157780=_0x1ddb17[_0xb787('0x26')]({'plain':!![]});var _0x126048='Templates';return db[_0xb787('0x4b')][_0xb787('0x46')]({'where':{'name':_0x126048,'userProfileId':_0x3940a7[_0xb787('0x4c')]},'raw':!![]})['then'](function(_0x1b37fc){if(_0x1b37fc&&_0x1b37fc[_0xb787('0x4d')]===0x0){return db[_0xb787('0x28')][_0xb787('0x47')]({'name':_0x157780[_0xb787('0x2b')],'resourceId':_0x157780['id'],'type':_0x1b37fc[_0xb787('0x2b')],'sectionId':_0x1b37fc['id']},{})[_0xb787('0x25')](function(){return _0x1ddb17;});}else{return _0x1ddb17;}})['catch'](function(_0x14ad54){logger[_0xb787('0x29')](_0xb787('0x4e'),_0x14ad54);throw _0x14ad54;});}return _0x1ddb17;})[_0xb787('0x25')](respondWithResult(_0x5d5fb3,0xc9))[_0xb787('0x4f')](handleError(_0x5d5fb3,null));};exports[_0xb787('0x50')]=function(_0xd33270,_0x34b70c){if(_0xd33270[_0xb787('0x48')]['id']){delete _0xd33270['body']['id'];}return db[_0xb787('0x2d')][_0xb787('0x46')]({'where':{'id':_0xd33270[_0xb787('0x45')]['id']}})[_0xb787('0x25')](handleEntityNotFound(_0x34b70c,null))[_0xb787('0x25')](saveUpdates(_0xd33270['body'],null))[_0xb787('0x25')](respondWithResult(_0x34b70c,null))[_0xb787('0x4f')](handleError(_0x34b70c,null));};exports[_0xb787('0x24')]=function(_0x29afb4,_0x25c781){return db[_0xb787('0x2d')][_0xb787('0x46')]({'where':{'id':_0x29afb4[_0xb787('0x45')]['id']}})[_0xb787('0x25')](handleEntityNotFound(_0x25c781,null))['then'](removeEntity(_0x25c781,null))[_0xb787('0x4f')](handleError(_0x25c781,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2e90b2e..0da047d 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 _0x7356=['../../config/logger','api','request-promise','path','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x7356,0x1de));var _0x6735=function(_0x5ddbe9,_0xa1ef5){_0x5ddbe9=_0x5ddbe9-0x0;var _0x5cd717=_0x7356[_0x5ddbe9];return _0x5cd717;};'use strict';var _=require(_0x6735('0x0'));var util=require(_0x6735('0x1'));var logger=require(_0x6735('0x2'))(_0x6735('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6735('0x4'));var fs=require('fs');var path=require(_0x6735('0x5'));var rimraf=require('rimraf');var config=require(_0x6735('0x6'));var attributes=require(_0x6735('0x7'));module[_0x6735('0x8')]=function(_0x43087e,_0x33613c){return _0x43087e[_0x6735('0x9')](_0x6735('0xa'),attributes,{'tableName':_0x6735('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a02=['exports','Template','tools_templates','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./template.attributes'];(function(_0x4d1871,_0x17353d){var _0x4cf46d=function(_0x1d1790){while(--_0x1d1790){_0x4d1871['push'](_0x4d1871['shift']());}};_0x4cf46d(++_0x17353d);}(_0x3a02,0x14d));var _0x23a0=function(_0x1aef95,_0x465577){_0x1aef95=_0x1aef95-0x0;var _0xcd78ec=_0x3a02[_0x1aef95];return _0xcd78ec;};'use strict';var _=require(_0x23a0('0x0'));var util=require(_0x23a0('0x1'));var logger=require('../../config/logger')(_0x23a0('0x2'));var moment=require('moment');var BPromise=require(_0x23a0('0x3'));var rp=require(_0x23a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23a0('0x5'));var config=require(_0x23a0('0x6'));var attributes=require(_0x23a0('0x7'));module[_0x23a0('0x8')]=function(_0x38af91,_0x4100f6){return _0x38af91['define'](_0x23a0('0x9'),attributes,{'tableName':_0x23a0('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 003dfbd..9c4f2a4 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 _0x0e5c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetTemplate','Template','findAll','options','raw','where','include','map','model','attributes','catch','lodash'];(function(_0x90c4ad,_0x2986d8){var _0x1224a3=function(_0x306323){while(--_0x306323){_0x90c4ad['push'](_0x90c4ad['shift']());}};_0x1224a3(++_0x2986d8);}(_0x0e5c,0x1cd));var _0xc0e5=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0x0e5c[_0x120bc2];return _0x454a41;};'use strict';var _=require(_0xc0e5('0x0'));var util=require(_0xc0e5('0x1'));var moment=require(_0xc0e5('0x2'));var BPromise=require(_0xc0e5('0x3'));var rs=require(_0xc0e5('0x4'));var fs=require('fs');var Redis=require(_0xc0e5('0x5'));var db=require(_0xc0e5('0x6'))['db'];var utils=require(_0xc0e5('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc0e5('0x8')][_0xc0e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1600f4,_0x3bc3d6,_0x166607){return new BPromise(function(_0x582218,_0x2081a2){return client[_0xc0e5('0xa')](_0x1600f4,_0x166607)[_0xc0e5('0xb')](function(_0x2284df){logger['info'](_0xc0e5('0xc'),_0x3bc3d6,_0xc0e5('0xd'));logger[_0xc0e5('0xe')](_0xc0e5('0xf'),_0x3bc3d6,'request\x20sent',JSON[_0xc0e5('0x10')](_0x2284df));if(_0x2284df[_0xc0e5('0x11')]){if(_0x2284df[_0xc0e5('0x11')][_0xc0e5('0x12')]===0x1f4){logger[_0xc0e5('0x11')]('Template,\x20%s,\x20%s',_0x3bc3d6,_0x2284df['error'][_0xc0e5('0x13')]);return _0x2081a2(_0x2284df['error'][_0xc0e5('0x13')]);}logger[_0xc0e5('0x11')](_0xc0e5('0xc'),_0x3bc3d6,_0x2284df[_0xc0e5('0x11')][_0xc0e5('0x13')]);return _0x582218(_0x2284df[_0xc0e5('0x11')][_0xc0e5('0x13')]);}else{logger[_0xc0e5('0x14')](_0xc0e5('0xc'),_0x3bc3d6,_0xc0e5('0xd'));_0x582218(_0x2284df[_0xc0e5('0x15')][_0xc0e5('0x13')]);}})['catch'](function(_0x24ca9c){logger[_0xc0e5('0x11')](_0xc0e5('0xc'),_0x3bc3d6,_0x24ca9c);_0x2081a2(_0x24ca9c);});});}exports[_0xc0e5('0x16')]=function(_0x4e7a05){var _0x3a8645=this;return new Promise(function(_0x7aef39,_0xc4221c){return db[_0xc0e5('0x17')][_0xc0e5('0x18')]({'raw':_0x4e7a05[_0xc0e5('0x19')]?_0x4e7a05[_0xc0e5('0x19')][_0xc0e5('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e7a05[_0xc0e5('0x19')]?_0x4e7a05[_0xc0e5('0x19')][_0xc0e5('0x1b')]||null:null,'attributes':_0x4e7a05[_0xc0e5('0x19')]?_0x4e7a05[_0xc0e5('0x19')]['attributes']||null:null,'limit':_0x4e7a05[_0xc0e5('0x19')]?_0x4e7a05[_0xc0e5('0x19')]['limit']||null:null,'include':_0x4e7a05[_0xc0e5('0x19')]?_0x4e7a05[_0xc0e5('0x19')][_0xc0e5('0x1c')]?_[_0xc0e5('0x1d')](_0x4e7a05[_0xc0e5('0x19')][_0xc0e5('0x1c')],function(_0x5556ff){return{'model':db[_0x5556ff[_0xc0e5('0x1e')]],'as':_0x5556ff['as'],'attributes':_0x5556ff['attributes'],'include':_0x5556ff[_0xc0e5('0x1c')]?_[_0xc0e5('0x1d')](_0x5556ff[_0xc0e5('0x1c')],function(_0x19748b){return{'model':db[_0x19748b[_0xc0e5('0x1e')]],'as':_0x19748b['as'],'attributes':_0x19748b['attributes'],'include':_0x19748b[_0xc0e5('0x1c')]?_[_0xc0e5('0x1d')](_0x19748b['include'],function(_0x5a4e20){return{'model':db[_0x5a4e20['model']],'as':_0x5a4e20['as'],'attributes':_0x5a4e20[_0xc0e5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0e5('0xb')](function(_0x543101){logger['info']('GetTemplate',_0x4e7a05);logger[_0xc0e5('0xe')](_0xc0e5('0x16'),_0x4e7a05,JSON[_0xc0e5('0x10')](_0x543101));_0x7aef39(_0x543101);})[_0xc0e5('0x20')](function(_0x139889){logger[_0xc0e5('0x11')](_0xc0e5('0x16'),_0x139889[_0xc0e5('0x13')],_0x4e7a05);_0xc4221c(_0x3a8645['error'](0x1f4,_0x139889[_0xc0e5('0x13')]));});});}; \ No newline at end of file +var _0xd8b9=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x117bf2,_0x23c165){var _0x1a953e=function(_0x3ea940){while(--_0x3ea940){_0x117bf2['push'](_0x117bf2['shift']());}};_0x1a953e(++_0x23c165);}(_0xd8b9,0x15e));var _0x9d8b=function(_0x28a229,_0x4e68b3){_0x28a229=_0x28a229-0x0;var _0x14a0df=_0xd8b9[_0x28a229];return _0x14a0df;};'use strict';var _=require(_0x9d8b('0x0'));var util=require(_0x9d8b('0x1'));var moment=require('moment');var BPromise=require(_0x9d8b('0x2'));var rs=require(_0x9d8b('0x3'));var fs=require('fs');var Redis=require(_0x9d8b('0x4'));var db=require(_0x9d8b('0x5'))['db'];var utils=require(_0x9d8b('0x6'));var logger=require(_0x9d8b('0x7'))(_0x9d8b('0x8'));var config=require(_0x9d8b('0x9'));var jayson=require(_0x9d8b('0xa'));var client=jayson[_0x9d8b('0xb')][_0x9d8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b970,_0x2674ec,_0x58cd36){return new BPromise(function(_0x2252bd,_0x283548){return client[_0x9d8b('0xd')](_0x46b970,_0x58cd36)[_0x9d8b('0xe')](function(_0x5dd8b9){logger[_0x9d8b('0xf')](_0x9d8b('0x10'),_0x2674ec,_0x9d8b('0x11'));logger[_0x9d8b('0x12')](_0x9d8b('0x13'),_0x2674ec,_0x9d8b('0x11'),JSON['stringify'](_0x5dd8b9));if(_0x5dd8b9[_0x9d8b('0x14')]){if(_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x15')]===0x1f4){logger['error'](_0x9d8b('0x10'),_0x2674ec,_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);return _0x283548(_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);}logger[_0x9d8b('0x14')](_0x9d8b('0x10'),_0x2674ec,_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);return _0x2252bd(_0x5dd8b9['error'][_0x9d8b('0x16')]);}else{logger[_0x9d8b('0xf')]('Template,\x20%s,\x20%s',_0x2674ec,_0x9d8b('0x11'));_0x2252bd(_0x5dd8b9[_0x9d8b('0x17')][_0x9d8b('0x16')]);}})[_0x9d8b('0x18')](function(_0x39284b){logger[_0x9d8b('0x14')](_0x9d8b('0x10'),_0x2674ec,_0x39284b);_0x283548(_0x39284b);});});}exports[_0x9d8b('0x19')]=function(_0x43812a){var _0x4fad69=this;return new Promise(function(_0x18a3f2,_0xc8be90){return db['Template'][_0x9d8b('0x1a')]({'raw':_0x43812a[_0x9d8b('0x1b')]?_0x43812a['options'][_0x9d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x43812a[_0x9d8b('0x1b')]?_0x43812a[_0x9d8b('0x1b')][_0x9d8b('0x1d')]||null:null,'attributes':_0x43812a[_0x9d8b('0x1b')]?_0x43812a[_0x9d8b('0x1b')][_0x9d8b('0x1e')]||null:null,'limit':_0x43812a[_0x9d8b('0x1b')]?_0x43812a[_0x9d8b('0x1b')][_0x9d8b('0x1f')]||null:null,'include':_0x43812a[_0x9d8b('0x1b')]?_0x43812a[_0x9d8b('0x1b')][_0x9d8b('0x20')]?_[_0x9d8b('0x21')](_0x43812a[_0x9d8b('0x1b')]['include'],function(_0x2c341e){return{'model':db[_0x2c341e[_0x9d8b('0x22')]],'as':_0x2c341e['as'],'attributes':_0x2c341e[_0x9d8b('0x1e')],'include':_0x2c341e['include']?_[_0x9d8b('0x21')](_0x2c341e['include'],function(_0x523943){return{'model':db[_0x523943[_0x9d8b('0x22')]],'as':_0x523943['as'],'attributes':_0x523943[_0x9d8b('0x1e')],'include':_0x523943[_0x9d8b('0x20')]?_[_0x9d8b('0x21')](_0x523943[_0x9d8b('0x20')],function(_0x3e8a60){return{'model':db[_0x3e8a60[_0x9d8b('0x22')]],'as':_0x3e8a60['as'],'attributes':_0x3e8a60[_0x9d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9d8b('0xe')](function(_0x27fd1b){logger[_0x9d8b('0xf')]('GetTemplate',_0x43812a);logger[_0x9d8b('0x12')]('GetTemplate',_0x43812a,JSON['stringify'](_0x27fd1b));_0x18a3f2(_0x27fd1b);})[_0x9d8b('0x18')](function(_0x399a36){logger[_0x9d8b('0x14')](_0x9d8b('0x19'),_0x399a36[_0x9d8b('0x16')],_0x43812a);_0xc8be90(_0x4fad69['error'](0x1f4,_0x399a36[_0x9d8b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7db9e72..0191be2 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 _0x00d1=['util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','put','update','delete','destroy','exports','multer'];(function(_0x1fe828,_0x4d0dc2){var _0x5e5ec4=function(_0x189424){while(--_0x189424){_0x1fe828['push'](_0x1fe828['shift']());}};_0x5e5ec4(++_0x4d0dc2);}(_0x00d1,0x16f));var _0x100d=function(_0xcc6ce4,_0x2979cf){_0xcc6ce4=_0xcc6ce4-0x0;var _0x29566e=_0x00d1[_0xcc6ce4];return _0x29566e;};'use strict';var multer=require(_0x100d('0x0'));var util=require(_0x100d('0x1'));var path=require('path');var timeout=require(_0x100d('0x2'));var express=require(_0x100d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x100d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x100d('0x5'));var controller=require('./trigger.controller');router[_0x100d('0x6')]('/',auth[_0x100d('0x7')](),controller['index']);router[_0x100d('0x6')](_0x100d('0x8'),auth[_0x100d('0x7')](),controller['show']);router[_0x100d('0x6')](_0x100d('0x9'),auth['isAuthenticated'](),controller[_0x100d('0xa')]);router[_0x100d('0x6')](_0x100d('0xb'),auth['isAuthenticated'](),controller[_0x100d('0xc')]);router[_0x100d('0x6')](_0x100d('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x100d('0xe')]);router[_0x100d('0xf')](_0x100d('0x9'),auth[_0x100d('0x7')](),controller[_0x100d('0x10')]);router[_0x100d('0xf')]('/:id/any_conditions',auth[_0x100d('0x7')](),controller[_0x100d('0x11')]);router[_0x100d('0xf')](_0x100d('0xd'),auth[_0x100d('0x7')](),controller['addAction']);router[_0x100d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x100d('0x13')]);router[_0x100d('0x14')](_0x100d('0x8'),auth[_0x100d('0x7')](),controller[_0x100d('0x15')]);module[_0x100d('0x16')]=router; \ No newline at end of file +var _0x0033=['index','/:id','show','getAllConditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x30f68d,_0x12cb44){var _0x4ac6bf=function(_0x15da9c){while(--_0x15da9c){_0x30f68d['push'](_0x30f68d['shift']());}};_0x4ac6bf(++_0x12cb44);}(_0x0033,0x1c0));var _0x3003=function(_0x581f8e,_0x5617cb){_0x581f8e=_0x581f8e-0x0;var _0x18aec=_0x0033[_0x581f8e];return _0x18aec;};'use strict';var multer=require(_0x3003('0x0'));var util=require(_0x3003('0x1'));var path=require(_0x3003('0x2'));var timeout=require(_0x3003('0x3'));var express=require(_0x3003('0x4'));var router=express[_0x3003('0x5')]();var fs_extra=require(_0x3003('0x6'));var auth=require(_0x3003('0x7'));var interaction=require(_0x3003('0x8'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x3003('0x9')]('/',auth[_0x3003('0xa')](),controller[_0x3003('0xb')]);router[_0x3003('0x9')](_0x3003('0xc'),auth[_0x3003('0xa')](),controller[_0x3003('0xd')]);router[_0x3003('0x9')]('/:id/all_conditions',auth[_0x3003('0xa')](),controller[_0x3003('0xe')]);router[_0x3003('0x9')]('/:id/any_conditions',auth[_0x3003('0xa')](),controller[_0x3003('0xf')]);router[_0x3003('0x9')]('/:id/actions',auth[_0x3003('0xa')](),controller[_0x3003('0x10')]);router[_0x3003('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3003('0x11')](_0x3003('0x12'),auth[_0x3003('0xa')](),controller[_0x3003('0x13')]);router[_0x3003('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3003('0x14')]);router[_0x3003('0x11')](_0x3003('0x15'),auth['isAuthenticated'](),controller[_0x3003('0x16')]);router[_0x3003('0x17')](_0x3003('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3003('0x18')](_0x3003('0xc'),auth[_0x3003('0xa')](),controller[_0x3003('0x19')]);module[_0x3003('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d041c62..a1d096c 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 _0x6120=['exports','STRING','BOOLEAN'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0x6120,0x16b));var _0x0612=function(_0x44b0b0,_0x409c75){_0x44b0b0=_0x44b0b0-0x0;var _0x4adfd=_0x6120[_0x44b0b0];return _0x4adfd;};'use strict';var Sequelize=require('sequelize');module[_0x0612('0x0')]={'name':{'type':Sequelize[_0x0612('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0612('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6df4=['exports','STRING','BOOLEAN'];(function(_0x10a64a,_0x72fccc){var _0x59dce7=function(_0x3efe8e){while(--_0x3efe8e){_0x10a64a['push'](_0x10a64a['shift']());}};_0x59dce7(++_0x72fccc);}(_0x6df4,0x14a));var _0x46df=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x6df4[_0x51b0dc];return _0x13fa89;};'use strict';var Sequelize=require('sequelize');module[_0x46df('0x0')]={'name':{'type':Sequelize[_0x46df('0x1')]},'channel':{'type':Sequelize[_0x46df('0x1')]},'description':{'type':Sequelize[_0x46df('0x1')]},'status':{'type':Sequelize[_0x46df('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a721cd7..9242095 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 _0xbca4=['json','then','destroy','get','Triggers','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','Trigger','includeAll','include','findAll','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','addAllCondition','Condition','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count'];(function(_0x99be21,_0x37b7c2){var _0x2a7652=function(_0x530660){while(--_0x530660){_0x99be21['push'](_0x99be21['shift']());}};_0x2a7652(++_0x37b7c2);}(_0xbca4,0x149));var _0x4bca=function(_0x86b3ed,_0x5d831b){_0x86b3ed=_0x86b3ed-0x0;var _0x50d6a3=_0xbca4[_0x86b3ed];return _0x50d6a3;};'use strict';var emlformat=require(_0x4bca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bca('0x1'));var jsonpatch=require(_0x4bca('0x2'));var rp=require(_0x4bca('0x3'));var moment=require(_0x4bca('0x4'));var BPromise=require(_0x4bca('0x5'));var Mustache=require(_0x4bca('0x6'));var util=require('util');var path=require(_0x4bca('0x7'));var sox=require('sox');var csv=require(_0x4bca('0x8'));var ejs=require(_0x4bca('0x9'));var fs=require('fs');var fs_extra=require(_0x4bca('0xa'));var _=require(_0x4bca('0xb'));var squel=require(_0x4bca('0xc'));var crypto=require(_0x4bca('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4bca('0x8'));var querystring=require(_0x4bca('0xe'));var Papa=require(_0x4bca('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4bca('0x10'));var as=require(_0x4bca('0x11'));var hardwareService=require(_0x4bca('0x12'));var logger=require(_0x4bca('0x13'))(_0x4bca('0x14'));var utils=require(_0x4bca('0x15'));var config=require(_0x4bca('0x16'));var licenseUtil=require(_0x4bca('0x17'));var db=require(_0x4bca('0x18'))['db'];function respondWithStatusCode(_0x44b2a4,_0x1a1a68){_0x1a1a68=_0x1a1a68||0xcc;return function(_0x234191){if(_0x234191){return _0x44b2a4['sendStatus'](_0x1a1a68);}return _0x44b2a4['status'](_0x1a1a68)[_0x4bca('0x19')]();};}function respondWithResult(_0x35ac76,_0x2f738a){_0x2f738a=_0x2f738a||0xc8;return function(_0x2471bc){if(_0x2471bc){return _0x35ac76[_0x4bca('0x1a')](_0x2f738a)['json'](_0x2471bc);}};}function respondWithFilteredResult(_0x432812,_0x3aa248){return function(_0x472d38){if(_0x472d38){var _0x56d2ab=typeof _0x3aa248[_0x4bca('0x1b')]===_0x4bca('0x1c')&&typeof _0x3aa248[_0x4bca('0x1d')]===_0x4bca('0x1c');var _0x1a5672=_0x472d38[_0x4bca('0x1e')];var _0x38ee89=_0x56d2ab?0x0:_0x3aa248[_0x4bca('0x1b')];var _0x1f6d43=_0x56d2ab?_0x472d38[_0x4bca('0x1e')]:_0x3aa248[_0x4bca('0x1b')]+_0x3aa248[_0x4bca('0x1d')];var _0x1b4a79;if(_0x1f6d43>=_0x1a5672){_0x1f6d43=_0x1a5672;_0x1b4a79=0xc8;}else{_0x1b4a79=0xce;}_0x432812[_0x4bca('0x1a')](_0x1b4a79);return _0x432812['set']('Content-Range',_0x38ee89+'-'+_0x1f6d43+'/'+_0x1a5672)[_0x4bca('0x1f')](_0x472d38);}return null;};}function patchUpdates(_0x41c8bc){return function(_0x30d183){try{jsonpatch['apply'](_0x30d183,_0x41c8bc,!![]);}catch(_0x327ef8){return BPromise['reject'](_0x327ef8);}return _0x30d183['save']();};}function saveUpdates(_0x3dce42,_0x123097){return function(_0x44744d){if(_0x44744d){return _0x44744d['update'](_0x3dce42)[_0x4bca('0x20')](function(_0x26d7e5){return _0x26d7e5;});}return null;};}function removeEntity(_0x6a040b,_0x9705f5){return function(_0x1e99dd){if(_0x1e99dd){return _0x1e99dd[_0x4bca('0x21')]()[_0x4bca('0x20')](function(){var _0x53cf68=_0x1e99dd[_0x4bca('0x22')]({'plain':!![]});var _0x434a75=_0x4bca('0x23');return db['UserProfileResource'][_0x4bca('0x21')]({'where':{'type':_0x434a75,'resourceId':_0x53cf68['id']}})[_0x4bca('0x20')](function(){return _0x1e99dd;});})[_0x4bca('0x20')](function(){_0x6a040b[_0x4bca('0x1a')](0xcc)[_0x4bca('0x19')]();});}};}function handleEntityNotFound(_0x38f9e7,_0x3ac43d){return function(_0x51ba52){if(!_0x51ba52){_0x38f9e7[_0x4bca('0x24')](0x194);}return _0x51ba52;};}function handleError(_0x39d072,_0x3507b6){_0x3507b6=_0x3507b6||0x1f4;return function(_0x2b7789){logger[_0x4bca('0x25')](_0x2b7789[_0x4bca('0x26')]);if(_0x2b7789[_0x4bca('0x27')]){delete _0x2b7789[_0x4bca('0x27')];}_0x39d072[_0x4bca('0x1a')](_0x3507b6)['send'](_0x2b7789);};}exports[_0x4bca('0x28')]=function(_0x2c2f9c,_0x13bc60){var _0x34bdac={},_0x14f085={},_0x313695={'count':0x0,'rows':[]};var _0x3b9426=_[_0x4bca('0x29')](db['Trigger'][_0x4bca('0x2a')],function(_0x59a458){return{'name':_0x59a458[_0x4bca('0x2b')],'type':_0x59a458[_0x4bca('0x2c')][_0x4bca('0x2d')]};});_0x14f085[_0x4bca('0x2e')]=_['map'](_0x3b9426,_0x4bca('0x27'));_0x14f085[_0x4bca('0x2f')]=_[_0x4bca('0x30')](_0x2c2f9c['query']);_0x14f085['filters']=_[_0x4bca('0x31')](_0x14f085[_0x4bca('0x2e')],_0x14f085['query']);_0x34bdac['attributes']=_[_0x4bca('0x31')](_0x14f085[_0x4bca('0x2e')],qs[_0x4bca('0x32')](_0x2c2f9c['query'][_0x4bca('0x32')]));_0x34bdac[_0x4bca('0x33')]=_0x34bdac['attributes']['length']?_0x34bdac['attributes']:_0x14f085[_0x4bca('0x2e')];if(!_0x2c2f9c[_0x4bca('0x2f')][_0x4bca('0x34')](_0x4bca('0x35'))){_0x34bdac['limit']=qs[_0x4bca('0x1d')](_0x2c2f9c[_0x4bca('0x2f')][_0x4bca('0x1d')]);_0x34bdac[_0x4bca('0x1b')]=qs['offset'](_0x2c2f9c[_0x4bca('0x2f')][_0x4bca('0x1b')]);}_0x34bdac[_0x4bca('0x36')]=qs[_0x4bca('0x37')](_0x2c2f9c['query']['sort']);_0x34bdac[_0x4bca('0x38')]=qs['filters'](_['pick'](_0x2c2f9c[_0x4bca('0x2f')],_0x14f085[_0x4bca('0x39')]),_0x3b9426);if(_0x2c2f9c['query'][_0x4bca('0x3a')]){_0x34bdac[_0x4bca('0x38')]=_['merge'](_0x34bdac[_0x4bca('0x38')],{'$or':_['map'](_0x3b9426,function(_0x2e1564){if(_0x2e1564[_0x4bca('0x2c')]!=='VIRTUAL'){var _0x1bb343={};_0x1bb343[_0x2e1564['name']]={'$like':'%'+_0x2c2f9c['query'][_0x4bca('0x3a')]+'%'};return _0x1bb343;}})});}_0x34bdac=_[_0x4bca('0x3b')]({},_0x34bdac,_0x2c2f9c[_0x4bca('0x3c')]);var _0x20c2f8={'where':_0x34bdac[_0x4bca('0x38')]};return db[_0x4bca('0x3d')][_0x4bca('0x1e')](_0x20c2f8)['then'](function(_0x2899e5){_0x313695[_0x4bca('0x1e')]=_0x2899e5;if(_0x2c2f9c[_0x4bca('0x2f')][_0x4bca('0x3e')]){_0x34bdac[_0x4bca('0x3f')]=[{'all':!![]}];}return db[_0x4bca('0x3d')][_0x4bca('0x40')](_0x34bdac);})[_0x4bca('0x20')](function(_0x1455b9){_0x313695['rows']=_0x1455b9;return _0x313695;})[_0x4bca('0x20')](respondWithFilteredResult(_0x13bc60,_0x34bdac))['catch'](handleError(_0x13bc60,null));};exports[_0x4bca('0x41')]=function(_0x27f427,_0x3a8dc1){var _0x51a5bf={'raw':![],'where':{'id':_0x27f427[_0x4bca('0x42')]['id']}},_0x14afd2={};_0x14afd2[_0x4bca('0x2e')]=_[_0x4bca('0x30')](db[_0x4bca('0x3d')][_0x4bca('0x2a')]);_0x14afd2['query']=_['keys'](_0x27f427['query']);_0x14afd2[_0x4bca('0x39')]=_[_0x4bca('0x31')](_0x14afd2[_0x4bca('0x2e')],_0x14afd2[_0x4bca('0x2f')]);_0x51a5bf['attributes']=_[_0x4bca('0x31')](_0x14afd2[_0x4bca('0x2e')],qs['fields'](_0x27f427[_0x4bca('0x2f')][_0x4bca('0x32')]));_0x51a5bf[_0x4bca('0x33')]=_0x51a5bf[_0x4bca('0x33')][_0x4bca('0x43')]?_0x51a5bf['attributes']:_0x14afd2[_0x4bca('0x2e')];if(_0x27f427[_0x4bca('0x2f')][_0x4bca('0x3e')]){_0x51a5bf[_0x4bca('0x3f')]=[{'all':!![]}];}_0x51a5bf=_[_0x4bca('0x3b')]({},_0x51a5bf,_0x27f427[_0x4bca('0x3c')]);return db[_0x4bca('0x3d')][_0x4bca('0x44')](_0x51a5bf)[_0x4bca('0x20')](handleEntityNotFound(_0x3a8dc1,null))[_0x4bca('0x20')](respondWithResult(_0x3a8dc1,null))[_0x4bca('0x45')](handleError(_0x3a8dc1,null));};exports[_0x4bca('0x46')]=function(_0x2d5dbf,_0x12da06){return db[_0x4bca('0x3d')][_0x4bca('0x46')](_0x2d5dbf[_0x4bca('0x47')],{})[_0x4bca('0x20')](function(_0x534f78){var _0xe44bc=_0x2d5dbf[_0x4bca('0x48')]['get']({'plain':!![]});if(!_0xe44bc)throw new Error(_0x4bca('0x49'));if(_0xe44bc[_0x4bca('0x4a')]==='user'){var _0x26c4be=_0x534f78[_0x4bca('0x22')]({'plain':!![]});var _0x1fa8b2=_0x4bca('0x23');return db[_0x4bca('0x4b')][_0x4bca('0x44')]({'where':{'name':_0x1fa8b2,'userProfileId':_0xe44bc[_0x4bca('0x4c')]},'raw':!![]})[_0x4bca('0x20')](function(_0x32333a){if(_0x32333a&&_0x32333a[_0x4bca('0x4d')]===0x0){return db[_0x4bca('0x4e')][_0x4bca('0x46')]({'name':_0x26c4be[_0x4bca('0x27')],'resourceId':_0x26c4be['id'],'type':_0x32333a[_0x4bca('0x27')],'sectionId':_0x32333a['id']},{})['then'](function(){return _0x534f78;});}else{return _0x534f78;}})[_0x4bca('0x45')](function(_0x3da9f0){logger[_0x4bca('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3da9f0);throw _0x3da9f0;});}return _0x534f78;})[_0x4bca('0x20')](respondWithResult(_0x12da06,0xc9))['catch'](handleError(_0x12da06,null));};exports[_0x4bca('0x4f')]=function(_0x5dae2a,_0x120009){if(_0x5dae2a[_0x4bca('0x47')]['id']){delete _0x5dae2a[_0x4bca('0x47')]['id'];}return db[_0x4bca('0x3d')][_0x4bca('0x44')]({'where':{'id':_0x5dae2a[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0x120009,null))[_0x4bca('0x20')](saveUpdates(_0x5dae2a[_0x4bca('0x47')],null))[_0x4bca('0x20')](respondWithResult(_0x120009,null))[_0x4bca('0x45')](handleError(_0x120009,null));};exports[_0x4bca('0x21')]=function(_0x42bd64,_0x2838db){return db[_0x4bca('0x3d')][_0x4bca('0x44')]({'where':{'id':_0x42bd64[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0x2838db,null))['then'](removeEntity(_0x2838db,null))[_0x4bca('0x45')](handleError(_0x2838db,null));};exports[_0x4bca('0x50')]=function(_0x5e7613,_0x156046,_0x483b6c){if(_0x5e7613[_0x4bca('0x47')]['id']){delete _0x5e7613[_0x4bca('0x47')]['id'];}return db[_0x4bca('0x3d')][_0x4bca('0x44')]({'where':{'id':_0x5e7613[_0x4bca('0x42')]['id']}})['then'](handleEntityNotFound(_0x156046,null))[_0x4bca('0x20')](function(_0x5dfd72){if(_0x5dfd72){_0x5e7613['body']['TriggerAllId']=_0x5dfd72['id'];return db[_0x4bca('0x51')][_0x4bca('0x46')](_0x5e7613['body']);}})[_0x4bca('0x20')](respondWithResult(_0x156046,null))[_0x4bca('0x45')](handleError(_0x156046,null));};exports['addAnyCondition']=function(_0x13cea7,_0xf98b30,_0x5aec93){if(_0x13cea7[_0x4bca('0x47')]['id']){delete _0x13cea7['body']['id'];}return db[_0x4bca('0x3d')][_0x4bca('0x44')]({'where':{'id':_0x13cea7[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0xf98b30,null))[_0x4bca('0x20')](function(_0x1fb6e4){if(_0x1fb6e4){_0x13cea7[_0x4bca('0x47')]['TriggerAnyId']=_0x1fb6e4['id'];return db[_0x4bca('0x51')][_0x4bca('0x46')](_0x13cea7[_0x4bca('0x47')]);}})[_0x4bca('0x20')](respondWithResult(_0xf98b30,null))[_0x4bca('0x45')](handleError(_0xf98b30,null));};exports[_0x4bca('0x52')]=function(_0x47a04b,_0x409c76,_0x51edd6){var _0x2bb839={};var _0x19ea81={};var _0x226c09;var _0x3ca1ba;return db[_0x4bca('0x3d')][_0x4bca('0x53')]({'where':{'id':_0x47a04b[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0x409c76,null))['then'](function(_0x202200){if(_0x202200){_0x226c09=_0x202200;_0x19ea81[_0x4bca('0x2e')]=_[_0x4bca('0x30')](db['Condition']['rawAttributes']);_0x19ea81['query']=_[_0x4bca('0x30')](_0x47a04b[_0x4bca('0x2f')]);_0x19ea81[_0x4bca('0x39')]=_['intersection'](_0x19ea81[_0x4bca('0x2e')],_0x19ea81[_0x4bca('0x2f')]);_0x2bb839[_0x4bca('0x33')]=_[_0x4bca('0x31')](_0x19ea81[_0x4bca('0x2e')],qs['fields'](_0x47a04b[_0x4bca('0x2f')][_0x4bca('0x32')]));_0x2bb839['attributes']=_0x2bb839['attributes'][_0x4bca('0x43')]?_0x2bb839[_0x4bca('0x33')]:_0x19ea81[_0x4bca('0x2e')];_0x2bb839[_0x4bca('0x36')]=qs[_0x4bca('0x37')](_0x47a04b['query'][_0x4bca('0x37')]);_0x2bb839[_0x4bca('0x38')]=qs['filters'](_[_0x4bca('0x54')](_0x47a04b[_0x4bca('0x2f')],_0x19ea81[_0x4bca('0x39')]));if(_0x47a04b['query']['filter']){_0x2bb839[_0x4bca('0x38')]=_[_0x4bca('0x3b')](_0x2bb839[_0x4bca('0x38')],{'$or':_[_0x4bca('0x29')](_0x2bb839[_0x4bca('0x33')],function(_0x232067){var _0x22a6f2={};_0x22a6f2[_0x232067]={'$like':'%'+_0x47a04b[_0x4bca('0x2f')][_0x4bca('0x3a')]+'%'};return _0x22a6f2;})});}_0x2bb839=_[_0x4bca('0x3b')]({},_0x2bb839,_0x47a04b[_0x4bca('0x3c')]);return _0x226c09['getAllConditions'](_0x2bb839);}})[_0x4bca('0x20')](function(_0x38605b){if(_0x38605b){_0x3ca1ba=_0x38605b[_0x4bca('0x43')];if(!_0x47a04b['query'][_0x4bca('0x34')](_0x4bca('0x35'))){_0x2bb839['limit']=qs[_0x4bca('0x1d')](_0x47a04b[_0x4bca('0x2f')]['limit']);_0x2bb839[_0x4bca('0x1b')]=qs[_0x4bca('0x1b')](_0x47a04b['query']['offset']);}return _0x226c09['getAllConditions'](_0x2bb839);}})[_0x4bca('0x20')](function(_0x5568c5){if(_0x5568c5){return _0x5568c5?{'count':_0x3ca1ba,'rows':_0x5568c5}:null;}})['then'](respondWithResult(_0x409c76,null))[_0x4bca('0x45')](handleError(_0x409c76,null));};exports[_0x4bca('0x55')]=function(_0x27d996,_0x583d24,_0xad2e14){var _0x123267={};var _0x3d59a8={};var _0x4be3db;var _0x382618;return db[_0x4bca('0x3d')][_0x4bca('0x53')]({'where':{'id':_0x27d996[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0x583d24,null))['then'](function(_0x1d6e42){if(_0x1d6e42){_0x4be3db=_0x1d6e42;_0x3d59a8[_0x4bca('0x2e')]=_[_0x4bca('0x30')](db[_0x4bca('0x51')][_0x4bca('0x2a')]);_0x3d59a8[_0x4bca('0x2f')]=_['keys'](_0x27d996[_0x4bca('0x2f')]);_0x3d59a8[_0x4bca('0x39')]=_[_0x4bca('0x31')](_0x3d59a8[_0x4bca('0x2e')],_0x3d59a8['query']);_0x123267[_0x4bca('0x33')]=_[_0x4bca('0x31')](_0x3d59a8[_0x4bca('0x2e')],qs[_0x4bca('0x32')](_0x27d996[_0x4bca('0x2f')][_0x4bca('0x32')]));_0x123267[_0x4bca('0x33')]=_0x123267[_0x4bca('0x33')]['length']?_0x123267[_0x4bca('0x33')]:_0x3d59a8['model'];_0x123267[_0x4bca('0x36')]=qs[_0x4bca('0x37')](_0x27d996[_0x4bca('0x2f')][_0x4bca('0x37')]);_0x123267[_0x4bca('0x38')]=qs['filters'](_[_0x4bca('0x54')](_0x27d996['query'],_0x3d59a8[_0x4bca('0x39')]));if(_0x27d996['query'][_0x4bca('0x3a')]){_0x123267[_0x4bca('0x38')]=_[_0x4bca('0x3b')](_0x123267[_0x4bca('0x38')],{'$or':_[_0x4bca('0x29')](_0x123267[_0x4bca('0x33')],function(_0x445fc5){var _0x1dd145={};_0x1dd145[_0x445fc5]={'$like':'%'+_0x27d996[_0x4bca('0x2f')][_0x4bca('0x3a')]+'%'};return _0x1dd145;})});}_0x123267=_[_0x4bca('0x3b')]({},_0x123267,_0x27d996[_0x4bca('0x3c')]);return _0x4be3db[_0x4bca('0x55')](_0x123267);}})[_0x4bca('0x20')](function(_0x76bbb0){if(_0x76bbb0){_0x382618=_0x76bbb0[_0x4bca('0x43')];if(!_0x27d996[_0x4bca('0x2f')][_0x4bca('0x34')](_0x4bca('0x35'))){_0x123267['limit']=qs[_0x4bca('0x1d')](_0x27d996[_0x4bca('0x2f')][_0x4bca('0x1d')]);_0x123267[_0x4bca('0x1b')]=qs[_0x4bca('0x1b')](_0x27d996[_0x4bca('0x2f')][_0x4bca('0x1b')]);}return _0x4be3db[_0x4bca('0x55')](_0x123267);}})[_0x4bca('0x20')](function(_0x285c1c){if(_0x285c1c){return _0x285c1c?{'count':_0x382618,'rows':_0x285c1c}:null;}})[_0x4bca('0x20')](respondWithResult(_0x583d24,null))['catch'](handleError(_0x583d24,null));};exports[_0x4bca('0x56')]=function(_0x2e556b,_0x20b277,_0x4ee428){if(_0x2e556b[_0x4bca('0x47')]['id']){delete _0x2e556b['body']['id'];}return db['Trigger'][_0x4bca('0x44')]({'where':{'id':_0x2e556b[_0x4bca('0x42')]['id']}})[_0x4bca('0x20')](handleEntityNotFound(_0x20b277,null))[_0x4bca('0x20')](function(_0x52d5b9){if(_0x52d5b9){_0x2e556b[_0x4bca('0x47')][_0x4bca('0x57')]=_0x52d5b9['id'];return db[_0x4bca('0x58')][_0x4bca('0x46')](_0x2e556b['body']);}})[_0x4bca('0x20')](respondWithResult(_0x20b277,null))[_0x4bca('0x45')](handleError(_0x20b277,null));};exports[_0x4bca('0x59')]=function(_0x7a4107,_0x3e52a6,_0x272891){var _0x1d6d52={};var _0x4c28c5={};var _0x5d8f6c;var _0x20cabe;return db[_0x4bca('0x3d')][_0x4bca('0x53')]({'where':{'id':_0x7a4107['params']['id']}})['then'](handleEntityNotFound(_0x3e52a6,null))[_0x4bca('0x20')](function(_0x55bdb9){if(_0x55bdb9){_0x5d8f6c=_0x55bdb9;_0x4c28c5[_0x4bca('0x2e')]=_[_0x4bca('0x30')](db[_0x4bca('0x58')][_0x4bca('0x2a')]);_0x4c28c5[_0x4bca('0x2f')]=_['keys'](_0x7a4107[_0x4bca('0x2f')]);_0x4c28c5[_0x4bca('0x39')]=_[_0x4bca('0x31')](_0x4c28c5[_0x4bca('0x2e')],_0x4c28c5[_0x4bca('0x2f')]);_0x1d6d52[_0x4bca('0x33')]=_['intersection'](_0x4c28c5[_0x4bca('0x2e')],qs[_0x4bca('0x32')](_0x7a4107[_0x4bca('0x2f')][_0x4bca('0x32')]));_0x1d6d52['attributes']=_0x1d6d52[_0x4bca('0x33')]['length']?_0x1d6d52[_0x4bca('0x33')]:_0x4c28c5[_0x4bca('0x2e')];_0x1d6d52[_0x4bca('0x36')]=qs[_0x4bca('0x37')](_0x7a4107['query'][_0x4bca('0x37')]);_0x1d6d52['where']=qs[_0x4bca('0x39')](_[_0x4bca('0x54')](_0x7a4107[_0x4bca('0x2f')],_0x4c28c5[_0x4bca('0x39')]));if(_0x7a4107[_0x4bca('0x2f')][_0x4bca('0x3a')]){_0x1d6d52['where']=_['merge'](_0x1d6d52[_0x4bca('0x38')],{'$or':_[_0x4bca('0x29')](_0x1d6d52['attributes'],function(_0x4f1840){var _0x4209d8={};_0x4209d8[_0x4f1840]={'$like':'%'+_0x7a4107[_0x4bca('0x2f')]['filter']+'%'};return _0x4209d8;})});}_0x1d6d52=_['merge']({},_0x1d6d52,_0x7a4107['options']);return _0x5d8f6c[_0x4bca('0x59')](_0x1d6d52);}})['then'](function(_0x1c30ff){if(_0x1c30ff){_0x20cabe=_0x1c30ff[_0x4bca('0x43')];if(!_0x7a4107[_0x4bca('0x2f')][_0x4bca('0x34')](_0x4bca('0x35'))){_0x1d6d52[_0x4bca('0x1d')]=qs[_0x4bca('0x1d')](_0x7a4107[_0x4bca('0x2f')]['limit']);_0x1d6d52[_0x4bca('0x1b')]=qs[_0x4bca('0x1b')](_0x7a4107[_0x4bca('0x2f')][_0x4bca('0x1b')]);}return _0x5d8f6c['getActions'](_0x1d6d52);}})[_0x4bca('0x20')](function(_0x1ffee5){if(_0x1ffee5){return _0x1ffee5?{'count':_0x20cabe,'rows':_0x1ffee5}:null;}})[_0x4bca('0x20')](respondWithResult(_0x3e52a6,null))[_0x4bca('0x45')](handleError(_0x3e52a6,null));}; \ No newline at end of file +var _0x8ce2=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','name','send','index','Trigger','rawAttributes','fieldName','type','key','map','query','filters','model','intersection','fields'];(function(_0x3a243d,_0x24ae3c){var _0x5aa0cf=function(_0x41994d){while(--_0x41994d){_0x3a243d['push'](_0x3a243d['shift']());}};_0x5aa0cf(++_0x24ae3c);}(_0x8ce2,0xec));var _0x28ce=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8ce2[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x28ce('0x0'));var rimraf=require(_0x28ce('0x1'));var zipdir=require(_0x28ce('0x2'));var jsonpatch=require(_0x28ce('0x3'));var rp=require(_0x28ce('0x4'));var moment=require(_0x28ce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x28ce('0x6'));var sox=require('sox');var csv=require(_0x28ce('0x7'));var ejs=require(_0x28ce('0x8'));var fs=require('fs');var fs_extra=require(_0x28ce('0x9'));var _=require(_0x28ce('0xa'));var squel=require('squel');var crypto=require(_0x28ce('0xb'));var jsforce=require(_0x28ce('0xc'));var deskjs=require(_0x28ce('0xd'));var toCsv=require(_0x28ce('0x7'));var querystring=require(_0x28ce('0xe'));var Papa=require(_0x28ce('0xf'));var Redis=require(_0x28ce('0x10'));var authService=require(_0x28ce('0x11'));var qs=require(_0x28ce('0x12'));var as=require(_0x28ce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28ce('0x14'))(_0x28ce('0x15'));var utils=require(_0x28ce('0x16'));var config=require(_0x28ce('0x17'));var licenseUtil=require(_0x28ce('0x18'));var db=require(_0x28ce('0x19'))['db'];function respondWithStatusCode(_0xbf9857,_0x1289fb){_0x1289fb=_0x1289fb||0xcc;return function(_0x3e91cf){if(_0x3e91cf){return _0xbf9857[_0x28ce('0x1a')](_0x1289fb);}return _0xbf9857['status'](_0x1289fb)['end']();};}function respondWithResult(_0x219fda,_0x60b4e3){_0x60b4e3=_0x60b4e3||0xc8;return function(_0x48bacd){if(_0x48bacd){return _0x219fda[_0x28ce('0x1b')](_0x60b4e3)['json'](_0x48bacd);}};}function respondWithFilteredResult(_0x581c20,_0x990fd6){return function(_0x317a63){if(_0x317a63){var _0x452901=typeof _0x990fd6['offset']===_0x28ce('0x1c')&&typeof _0x990fd6[_0x28ce('0x1d')]===_0x28ce('0x1c');var _0x3d591d=_0x317a63['count'];var _0x3bda54=_0x452901?0x0:_0x990fd6[_0x28ce('0x1e')];var _0x4494d1=_0x452901?_0x317a63['count']:_0x990fd6[_0x28ce('0x1e')]+_0x990fd6[_0x28ce('0x1d')];var _0x4486ee;if(_0x4494d1>=_0x3d591d){_0x4494d1=_0x3d591d;_0x4486ee=0xc8;}else{_0x4486ee=0xce;}_0x581c20[_0x28ce('0x1b')](_0x4486ee);return _0x581c20[_0x28ce('0x1f')](_0x28ce('0x20'),_0x3bda54+'-'+_0x4494d1+'/'+_0x3d591d)[_0x28ce('0x21')](_0x317a63);}return null;};}function patchUpdates(_0x307847){return function(_0x54e513){try{jsonpatch[_0x28ce('0x22')](_0x54e513,_0x307847,!![]);}catch(_0x5e3495){return BPromise['reject'](_0x5e3495);}return _0x54e513[_0x28ce('0x23')]();};}function saveUpdates(_0x3833c3,_0x1f5e78){return function(_0xb6a69d){if(_0xb6a69d){return _0xb6a69d[_0x28ce('0x24')](_0x3833c3)[_0x28ce('0x25')](function(_0x2037fa){return _0x2037fa;});}return null;};}function removeEntity(_0x1ab658,_0x544e08){return function(_0x7feebf){if(_0x7feebf){return _0x7feebf[_0x28ce('0x26')]()[_0x28ce('0x25')](function(){var _0x5dcb14=_0x7feebf[_0x28ce('0x27')]({'plain':!![]});var _0x1f9117=_0x28ce('0x28');return db[_0x28ce('0x29')][_0x28ce('0x26')]({'where':{'type':_0x1f9117,'resourceId':_0x5dcb14['id']}})[_0x28ce('0x25')](function(){return _0x7feebf;});})['then'](function(){_0x1ab658[_0x28ce('0x1b')](0xcc)[_0x28ce('0x2a')]();});}};}function handleEntityNotFound(_0x122f8d,_0xa2b558){return function(_0xa47a91){if(!_0xa47a91){_0x122f8d[_0x28ce('0x1a')](0x194);}return _0xa47a91;};}function handleError(_0x5be836,_0x56d4fa){_0x56d4fa=_0x56d4fa||0x1f4;return function(_0x50f8bd){logger[_0x28ce('0x2b')](_0x50f8bd['stack']);if(_0x50f8bd[_0x28ce('0x2c')]){delete _0x50f8bd[_0x28ce('0x2c')];}_0x5be836['status'](_0x56d4fa)[_0x28ce('0x2d')](_0x50f8bd);};}exports[_0x28ce('0x2e')]=function(_0x7a4b32,_0x89fdd4){var _0x3f2b5c={},_0x412a57={},_0x35eb80={'count':0x0,'rows':[]};var _0x245c6e=_['map'](db[_0x28ce('0x2f')][_0x28ce('0x30')],function(_0x1c28ac){return{'name':_0x1c28ac[_0x28ce('0x31')],'type':_0x1c28ac[_0x28ce('0x32')][_0x28ce('0x33')]};});_0x412a57['model']=_[_0x28ce('0x34')](_0x245c6e,_0x28ce('0x2c'));_0x412a57[_0x28ce('0x35')]=_['keys'](_0x7a4b32['query']);_0x412a57[_0x28ce('0x36')]=_['intersection'](_0x412a57[_0x28ce('0x37')],_0x412a57[_0x28ce('0x35')]);_0x3f2b5c['attributes']=_[_0x28ce('0x38')](_0x412a57[_0x28ce('0x37')],qs[_0x28ce('0x39')](_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x39')]));_0x3f2b5c['attributes']=_0x3f2b5c[_0x28ce('0x3a')]['length']?_0x3f2b5c['attributes']:_0x412a57[_0x28ce('0x37')];if(!_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x3b')](_0x28ce('0x3c'))){_0x3f2b5c[_0x28ce('0x1d')]=qs[_0x28ce('0x1d')](_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x1d')]);_0x3f2b5c[_0x28ce('0x1e')]=qs[_0x28ce('0x1e')](_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x1e')]);}_0x3f2b5c[_0x28ce('0x3d')]=qs['sort'](_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x3e')]);_0x3f2b5c[_0x28ce('0x3f')]=qs['filters'](_[_0x28ce('0x40')](_0x7a4b32[_0x28ce('0x35')],_0x412a57['filters']),_0x245c6e);if(_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x41')]){_0x3f2b5c['where']=_[_0x28ce('0x42')](_0x3f2b5c[_0x28ce('0x3f')],{'$or':_[_0x28ce('0x34')](_0x245c6e,function(_0x137473){if(_0x137473['type']!==_0x28ce('0x43')){var _0x15e00c={};_0x15e00c[_0x137473[_0x28ce('0x2c')]]={'$like':'%'+_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x41')]+'%'};return _0x15e00c;}})});}_0x3f2b5c=_['merge']({},_0x3f2b5c,_0x7a4b32[_0x28ce('0x44')]);var _0x59ff4a={'where':_0x3f2b5c[_0x28ce('0x3f')]};return db[_0x28ce('0x2f')][_0x28ce('0x45')](_0x59ff4a)[_0x28ce('0x25')](function(_0x68b404){_0x35eb80[_0x28ce('0x45')]=_0x68b404;if(_0x7a4b32[_0x28ce('0x35')][_0x28ce('0x46')]){_0x3f2b5c[_0x28ce('0x47')]=[{'all':!![]}];}return db[_0x28ce('0x2f')][_0x28ce('0x48')](_0x3f2b5c);})[_0x28ce('0x25')](function(_0x234c59){_0x35eb80['rows']=_0x234c59;return _0x35eb80;})[_0x28ce('0x25')](respondWithFilteredResult(_0x89fdd4,_0x3f2b5c))[_0x28ce('0x49')](handleError(_0x89fdd4,null));};exports[_0x28ce('0x4a')]=function(_0x5464ce,_0x4e9c2f){var _0x434c27={'raw':![],'where':{'id':_0x5464ce[_0x28ce('0x4b')]['id']}},_0x1e3fba={};_0x1e3fba[_0x28ce('0x37')]=_[_0x28ce('0x4c')](db[_0x28ce('0x2f')][_0x28ce('0x30')]);_0x1e3fba[_0x28ce('0x35')]=_[_0x28ce('0x4c')](_0x5464ce['query']);_0x1e3fba[_0x28ce('0x36')]=_[_0x28ce('0x38')](_0x1e3fba['model'],_0x1e3fba[_0x28ce('0x35')]);_0x434c27['attributes']=_[_0x28ce('0x38')](_0x1e3fba[_0x28ce('0x37')],qs[_0x28ce('0x39')](_0x5464ce[_0x28ce('0x35')][_0x28ce('0x39')]));_0x434c27[_0x28ce('0x3a')]=_0x434c27['attributes'][_0x28ce('0x4d')]?_0x434c27[_0x28ce('0x3a')]:_0x1e3fba['model'];if(_0x5464ce[_0x28ce('0x35')][_0x28ce('0x46')]){_0x434c27[_0x28ce('0x47')]=[{'all':!![]}];}_0x434c27=_[_0x28ce('0x42')]({},_0x434c27,_0x5464ce[_0x28ce('0x44')]);return db[_0x28ce('0x2f')][_0x28ce('0x4e')](_0x434c27)[_0x28ce('0x25')](handleEntityNotFound(_0x4e9c2f,null))[_0x28ce('0x25')](respondWithResult(_0x4e9c2f,null))['catch'](handleError(_0x4e9c2f,null));};exports[_0x28ce('0x4f')]=function(_0x4458c0,_0x19db6d){return db[_0x28ce('0x2f')][_0x28ce('0x4f')](_0x4458c0[_0x28ce('0x50')],{})['then'](function(_0x52f600){var _0x1eadb2=_0x4458c0[_0x28ce('0x51')][_0x28ce('0x27')]({'plain':!![]});if(!_0x1eadb2)throw new Error(_0x28ce('0x52'));if(_0x1eadb2[_0x28ce('0x53')]==='user'){var _0x3d5d86=_0x52f600[_0x28ce('0x27')]({'plain':!![]});var _0xa636fb=_0x28ce('0x28');return db[_0x28ce('0x54')][_0x28ce('0x4e')]({'where':{'name':_0xa636fb,'userProfileId':_0x1eadb2['userProfileId']},'raw':!![]})[_0x28ce('0x25')](function(_0x34f936){if(_0x34f936&&_0x34f936['autoAssociation']===0x0){return db[_0x28ce('0x29')]['create']({'name':_0x3d5d86[_0x28ce('0x2c')],'resourceId':_0x3d5d86['id'],'type':_0x34f936[_0x28ce('0x2c')],'sectionId':_0x34f936['id']},{})[_0x28ce('0x25')](function(){return _0x52f600;});}else{return _0x52f600;}})[_0x28ce('0x49')](function(_0x306001){logger[_0x28ce('0x2b')](_0x28ce('0x55'),_0x306001);throw _0x306001;});}return _0x52f600;})[_0x28ce('0x25')](respondWithResult(_0x19db6d,0xc9))[_0x28ce('0x49')](handleError(_0x19db6d,null));};exports[_0x28ce('0x24')]=function(_0x4fae05,_0x144191){if(_0x4fae05[_0x28ce('0x50')]['id']){delete _0x4fae05['body']['id'];}return db['Trigger'][_0x28ce('0x4e')]({'where':{'id':_0x4fae05[_0x28ce('0x4b')]['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x144191,null))['then'](saveUpdates(_0x4fae05[_0x28ce('0x50')],null))[_0x28ce('0x25')](respondWithResult(_0x144191,null))[_0x28ce('0x49')](handleError(_0x144191,null));};exports[_0x28ce('0x26')]=function(_0xa42023,_0x43a80f){return db['Trigger'][_0x28ce('0x4e')]({'where':{'id':_0xa42023[_0x28ce('0x4b')]['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x43a80f,null))['then'](removeEntity(_0x43a80f,null))[_0x28ce('0x49')](handleError(_0x43a80f,null));};exports[_0x28ce('0x56')]=function(_0x4bc1e7,_0x17f9f2,_0x4e239a){if(_0x4bc1e7['body']['id']){delete _0x4bc1e7[_0x28ce('0x50')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4bc1e7[_0x28ce('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17f9f2,null))[_0x28ce('0x25')](function(_0x1b6b56){if(_0x1b6b56){_0x4bc1e7['body'][_0x28ce('0x57')]=_0x1b6b56['id'];return db[_0x28ce('0x58')][_0x28ce('0x4f')](_0x4bc1e7[_0x28ce('0x50')]);}})[_0x28ce('0x25')](respondWithResult(_0x17f9f2,null))[_0x28ce('0x49')](handleError(_0x17f9f2,null));};exports[_0x28ce('0x59')]=function(_0x2effd5,_0x23104e,_0x1099cc){if(_0x2effd5[_0x28ce('0x50')]['id']){delete _0x2effd5[_0x28ce('0x50')]['id'];}return db[_0x28ce('0x2f')][_0x28ce('0x4e')]({'where':{'id':_0x2effd5['params']['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x23104e,null))['then'](function(_0x398124){if(_0x398124){_0x2effd5[_0x28ce('0x50')][_0x28ce('0x5a')]=_0x398124['id'];return db['Condition'][_0x28ce('0x4f')](_0x2effd5[_0x28ce('0x50')]);}})[_0x28ce('0x25')](respondWithResult(_0x23104e,null))['catch'](handleError(_0x23104e,null));};exports[_0x28ce('0x5b')]=function(_0x5dbf85,_0x33006a,_0x4e38f2){var _0x55493a={};var _0x59cc32={};var _0x34fa8d;var _0x5eadf9;return db[_0x28ce('0x2f')][_0x28ce('0x5c')]({'where':{'id':_0x5dbf85['params']['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x33006a,null))[_0x28ce('0x25')](function(_0x4e91ba){if(_0x4e91ba){_0x34fa8d=_0x4e91ba;_0x59cc32['model']=_[_0x28ce('0x4c')](db['Condition'][_0x28ce('0x30')]);_0x59cc32[_0x28ce('0x35')]=_[_0x28ce('0x4c')](_0x5dbf85[_0x28ce('0x35')]);_0x59cc32[_0x28ce('0x36')]=_[_0x28ce('0x38')](_0x59cc32[_0x28ce('0x37')],_0x59cc32['query']);_0x55493a[_0x28ce('0x3a')]=_[_0x28ce('0x38')](_0x59cc32['model'],qs[_0x28ce('0x39')](_0x5dbf85[_0x28ce('0x35')][_0x28ce('0x39')]));_0x55493a[_0x28ce('0x3a')]=_0x55493a[_0x28ce('0x3a')][_0x28ce('0x4d')]?_0x55493a[_0x28ce('0x3a')]:_0x59cc32[_0x28ce('0x37')];_0x55493a['order']=qs[_0x28ce('0x3e')](_0x5dbf85[_0x28ce('0x35')][_0x28ce('0x3e')]);_0x55493a['where']=qs['filters'](_['pick'](_0x5dbf85[_0x28ce('0x35')],_0x59cc32[_0x28ce('0x36')]));if(_0x5dbf85[_0x28ce('0x35')][_0x28ce('0x41')]){_0x55493a['where']=_['merge'](_0x55493a[_0x28ce('0x3f')],{'$or':_[_0x28ce('0x34')](_0x55493a['attributes'],function(_0x9f5bd0){var _0x1e736f={};_0x1e736f[_0x9f5bd0]={'$like':'%'+_0x5dbf85[_0x28ce('0x35')]['filter']+'%'};return _0x1e736f;})});}_0x55493a=_[_0x28ce('0x42')]({},_0x55493a,_0x5dbf85[_0x28ce('0x44')]);return _0x34fa8d[_0x28ce('0x5b')](_0x55493a);}})[_0x28ce('0x25')](function(_0x152c6a){if(_0x152c6a){_0x5eadf9=_0x152c6a[_0x28ce('0x4d')];if(!_0x5dbf85[_0x28ce('0x35')][_0x28ce('0x3b')]('nolimit')){_0x55493a[_0x28ce('0x1d')]=qs[_0x28ce('0x1d')](_0x5dbf85[_0x28ce('0x35')]['limit']);_0x55493a['offset']=qs[_0x28ce('0x1e')](_0x5dbf85['query'][_0x28ce('0x1e')]);}return _0x34fa8d['getAllConditions'](_0x55493a);}})[_0x28ce('0x25')](function(_0xba7c58){if(_0xba7c58){return _0xba7c58?{'count':_0x5eadf9,'rows':_0xba7c58}:null;}})[_0x28ce('0x25')](respondWithResult(_0x33006a,null))[_0x28ce('0x49')](handleError(_0x33006a,null));};exports[_0x28ce('0x5d')]=function(_0x1bfbbc,_0x3e94c8,_0x6e292d){var _0x226943={};var _0x298474={};var _0xe82b40;var _0x2d891a;return db[_0x28ce('0x2f')]['findOne']({'where':{'id':_0x1bfbbc[_0x28ce('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e94c8,null))['then'](function(_0x4ffbcd){if(_0x4ffbcd){_0xe82b40=_0x4ffbcd;_0x298474['model']=_[_0x28ce('0x4c')](db[_0x28ce('0x58')]['rawAttributes']);_0x298474[_0x28ce('0x35')]=_[_0x28ce('0x4c')](_0x1bfbbc[_0x28ce('0x35')]);_0x298474['filters']=_['intersection'](_0x298474[_0x28ce('0x37')],_0x298474[_0x28ce('0x35')]);_0x226943[_0x28ce('0x3a')]=_['intersection'](_0x298474[_0x28ce('0x37')],qs[_0x28ce('0x39')](_0x1bfbbc[_0x28ce('0x35')][_0x28ce('0x39')]));_0x226943[_0x28ce('0x3a')]=_0x226943[_0x28ce('0x3a')]['length']?_0x226943[_0x28ce('0x3a')]:_0x298474['model'];_0x226943[_0x28ce('0x3d')]=qs[_0x28ce('0x3e')](_0x1bfbbc['query'][_0x28ce('0x3e')]);_0x226943[_0x28ce('0x3f')]=qs['filters'](_[_0x28ce('0x40')](_0x1bfbbc[_0x28ce('0x35')],_0x298474['filters']));if(_0x1bfbbc[_0x28ce('0x35')][_0x28ce('0x41')]){_0x226943[_0x28ce('0x3f')]=_[_0x28ce('0x42')](_0x226943['where'],{'$or':_[_0x28ce('0x34')](_0x226943['attributes'],function(_0x21eccc){var _0x2954b2={};_0x2954b2[_0x21eccc]={'$like':'%'+_0x1bfbbc[_0x28ce('0x35')]['filter']+'%'};return _0x2954b2;})});}_0x226943=_[_0x28ce('0x42')]({},_0x226943,_0x1bfbbc[_0x28ce('0x44')]);return _0xe82b40['getAnyConditions'](_0x226943);}})[_0x28ce('0x25')](function(_0x195e69){if(_0x195e69){_0x2d891a=_0x195e69['length'];if(!_0x1bfbbc[_0x28ce('0x35')]['hasOwnProperty'](_0x28ce('0x3c'))){_0x226943[_0x28ce('0x1d')]=qs[_0x28ce('0x1d')](_0x1bfbbc['query'][_0x28ce('0x1d')]);_0x226943['offset']=qs['offset'](_0x1bfbbc[_0x28ce('0x35')]['offset']);}return _0xe82b40[_0x28ce('0x5d')](_0x226943);}})['then'](function(_0x354a75){if(_0x354a75){return _0x354a75?{'count':_0x2d891a,'rows':_0x354a75}:null;}})[_0x28ce('0x25')](respondWithResult(_0x3e94c8,null))['catch'](handleError(_0x3e94c8,null));};exports[_0x28ce('0x5e')]=function(_0x1fa7e6,_0x14a841,_0x1daa28){if(_0x1fa7e6[_0x28ce('0x50')]['id']){delete _0x1fa7e6['body']['id'];}return db[_0x28ce('0x2f')][_0x28ce('0x4e')]({'where':{'id':_0x1fa7e6[_0x28ce('0x4b')]['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x14a841,null))['then'](function(_0x32b87d){if(_0x32b87d){_0x1fa7e6['body'][_0x28ce('0x5f')]=_0x32b87d['id'];return db[_0x28ce('0x60')][_0x28ce('0x4f')](_0x1fa7e6[_0x28ce('0x50')]);}})[_0x28ce('0x25')](respondWithResult(_0x14a841,null))[_0x28ce('0x49')](handleError(_0x14a841,null));};exports[_0x28ce('0x61')]=function(_0x7c74f3,_0x492081,_0x2aa4df){var _0x1c5977={};var _0x16fa40={};var _0x4999ca;var _0x3d61fd;return db[_0x28ce('0x2f')][_0x28ce('0x5c')]({'where':{'id':_0x7c74f3[_0x28ce('0x4b')]['id']}})[_0x28ce('0x25')](handleEntityNotFound(_0x492081,null))['then'](function(_0x2de4f4){if(_0x2de4f4){_0x4999ca=_0x2de4f4;_0x16fa40['model']=_[_0x28ce('0x4c')](db['Action'][_0x28ce('0x30')]);_0x16fa40['query']=_[_0x28ce('0x4c')](_0x7c74f3[_0x28ce('0x35')]);_0x16fa40[_0x28ce('0x36')]=_[_0x28ce('0x38')](_0x16fa40[_0x28ce('0x37')],_0x16fa40[_0x28ce('0x35')]);_0x1c5977[_0x28ce('0x3a')]=_[_0x28ce('0x38')](_0x16fa40[_0x28ce('0x37')],qs['fields'](_0x7c74f3['query'][_0x28ce('0x39')]));_0x1c5977[_0x28ce('0x3a')]=_0x1c5977[_0x28ce('0x3a')][_0x28ce('0x4d')]?_0x1c5977['attributes']:_0x16fa40[_0x28ce('0x37')];_0x1c5977[_0x28ce('0x3d')]=qs[_0x28ce('0x3e')](_0x7c74f3[_0x28ce('0x35')][_0x28ce('0x3e')]);_0x1c5977[_0x28ce('0x3f')]=qs[_0x28ce('0x36')](_[_0x28ce('0x40')](_0x7c74f3[_0x28ce('0x35')],_0x16fa40[_0x28ce('0x36')]));if(_0x7c74f3[_0x28ce('0x35')][_0x28ce('0x41')]){_0x1c5977[_0x28ce('0x3f')]=_[_0x28ce('0x42')](_0x1c5977['where'],{'$or':_[_0x28ce('0x34')](_0x1c5977[_0x28ce('0x3a')],function(_0xe0a01e){var _0x39bf38={};_0x39bf38[_0xe0a01e]={'$like':'%'+_0x7c74f3[_0x28ce('0x35')][_0x28ce('0x41')]+'%'};return _0x39bf38;})});}_0x1c5977=_[_0x28ce('0x42')]({},_0x1c5977,_0x7c74f3[_0x28ce('0x44')]);return _0x4999ca[_0x28ce('0x61')](_0x1c5977);}})[_0x28ce('0x25')](function(_0x120bd6){if(_0x120bd6){_0x3d61fd=_0x120bd6[_0x28ce('0x4d')];if(!_0x7c74f3[_0x28ce('0x35')]['hasOwnProperty'](_0x28ce('0x3c'))){_0x1c5977['limit']=qs[_0x28ce('0x1d')](_0x7c74f3[_0x28ce('0x35')][_0x28ce('0x1d')]);_0x1c5977[_0x28ce('0x1e')]=qs[_0x28ce('0x1e')](_0x7c74f3['query']['offset']);}return _0x4999ca[_0x28ce('0x61')](_0x1c5977);}})[_0x28ce('0x25')](function(_0xabebb8){if(_0xabebb8){return _0xabebb8?{'count':_0x3d61fd,'rows':_0xabebb8}:null;}})[_0x28ce('0x25')](respondWithResult(_0x492081,null))[_0x28ce('0x49')](handleError(_0x492081,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 604a0fe..30c016f 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 _0xb91a=['./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20c7cd,_0x401cb6){var _0x159723=function(_0x586e01){while(--_0x586e01){_0x20c7cd['push'](_0x20c7cd['shift']());}};_0x159723(++_0x401cb6);}(_0xb91a,0xf4));var _0xab91=function(_0x356fb0,_0x36bbc1){_0x356fb0=_0x356fb0-0x0;var _0x115f7a=_0xb91a[_0x356fb0];return _0x115f7a;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab91('0x3'));var rp=require(_0xab91('0x4'));var fs=require('fs');var path=require(_0xab91('0x5'));var rimraf=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var attributes=require(_0xab91('0x8'));module[_0xab91('0x9')]=function(_0x429933,_0x290af9){return _0x429933[_0xab91('0xa')]('Trigger',attributes,{'tableName':_0xab91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3937=['exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','bluebird','path','../../config/environment','./trigger.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3937,0xbf));var _0x7393=function(_0x124962,_0x2999fa){_0x124962=_0x124962-0x0;var _0x1081f6=_0x3937[_0x124962];return _0x1081f6;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var moment=require('moment');var BPromise=require(_0x7393('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7393('0x4'));var rimraf=require('rimraf');var config=require(_0x7393('0x5'));var attributes=require(_0x7393('0x6'));module[_0x7393('0x7')]=function(_0x1f538f,_0x15eabd){return _0x1f538f[_0x7393('0x8')](_0x7393('0x9'),attributes,{'tableName':_0x7393('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 5469612..2850566 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 _0x6096=['result','catch','GetTrigger','Trigger','options','where','attributes','limit','include','model','map','debug','ShowTrigger','find','raw','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0x2a3153,_0x4c56b5){var _0x22930e=function(_0x329911){while(--_0x329911){_0x2a3153['push'](_0x2a3153['shift']());}};_0x22930e(++_0x4c56b5);}(_0x6096,0x159));var _0x6609=function(_0x17fc20,_0x7d3f2f){_0x17fc20=_0x17fc20-0x0;var _0x29d108=_0x6096[_0x17fc20];return _0x29d108;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6609('0x0'));var rs=require(_0x6609('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6609('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6609('0x3'))('rpc');var config=require(_0x6609('0x4'));var jayson=require(_0x6609('0x5'));var client=jayson[_0x6609('0x6')][_0x6609('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38a11b,_0x5a696e,_0xfcf978){return new BPromise(function(_0x899abe,_0x1fcf95){return client[_0x6609('0x8')](_0x38a11b,_0xfcf978)[_0x6609('0x9')](function(_0x18003c){logger['info'](_0x6609('0xa'),_0x5a696e,_0x6609('0xb'));logger['debug'](_0x6609('0xc'),_0x5a696e,_0x6609('0xb'),JSON[_0x6609('0xd')](_0x18003c));if(_0x18003c['error']){if(_0x18003c['error'][_0x6609('0xe')]===0x1f4){logger[_0x6609('0xf')](_0x6609('0xa'),_0x5a696e,_0x18003c[_0x6609('0xf')]['message']);return _0x1fcf95(_0x18003c['error'][_0x6609('0x10')]);}logger[_0x6609('0xf')](_0x6609('0xa'),_0x5a696e,_0x18003c[_0x6609('0xf')][_0x6609('0x10')]);return _0x899abe(_0x18003c[_0x6609('0xf')]['message']);}else{logger[_0x6609('0x11')](_0x6609('0xa'),_0x5a696e,_0x6609('0xb'));_0x899abe(_0x18003c[_0x6609('0x12')][_0x6609('0x10')]);}})[_0x6609('0x13')](function(_0x206f81){logger[_0x6609('0xf')](_0x6609('0xa'),_0x5a696e,_0x206f81);_0x1fcf95(_0x206f81);});});}exports[_0x6609('0x14')]=function(_0x4da68b){var _0x353e7c=this;return new Promise(function(_0x2c3700,_0x4f37fd){return db[_0x6609('0x15')]['findAll']({'raw':_0x4da68b[_0x6609('0x16')]?_0x4da68b[_0x6609('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4da68b[_0x6609('0x16')]?_0x4da68b[_0x6609('0x16')][_0x6609('0x17')]||null:null,'attributes':_0x4da68b['options']?_0x4da68b[_0x6609('0x16')][_0x6609('0x18')]||null:null,'limit':_0x4da68b[_0x6609('0x16')]?_0x4da68b[_0x6609('0x16')][_0x6609('0x19')]||null:null,'include':_0x4da68b[_0x6609('0x16')]?_0x4da68b[_0x6609('0x16')]['include']?_['map'](_0x4da68b[_0x6609('0x16')][_0x6609('0x1a')],function(_0x21cb27){return{'model':db[_0x21cb27[_0x6609('0x1b')]],'as':_0x21cb27['as'],'attributes':_0x21cb27['attributes'],'include':_0x21cb27[_0x6609('0x1a')]?_[_0x6609('0x1c')](_0x21cb27[_0x6609('0x1a')],function(_0x322b9c){return{'model':db[_0x322b9c[_0x6609('0x1b')]],'as':_0x322b9c['as'],'attributes':_0x322b9c['attributes'],'include':_0x322b9c[_0x6609('0x1a')]?_['map'](_0x322b9c['include'],function(_0x4bcdde){return{'model':db[_0x4bcdde[_0x6609('0x1b')]],'as':_0x4bcdde['as'],'attributes':_0x4bcdde[_0x6609('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6609('0x9')](function(_0x4ccb08){logger['info'](_0x6609('0x14'),_0x4da68b);logger[_0x6609('0x1d')]('GetTrigger',_0x4da68b,JSON['stringify'](_0x4ccb08));_0x2c3700(_0x4ccb08);})[_0x6609('0x13')](function(_0x240118){logger[_0x6609('0xf')](_0x6609('0x14'),_0x240118[_0x6609('0x10')],_0x4da68b);_0x4f37fd(_0x353e7c['error'](0x1f4,_0x240118['message']));});});};exports[_0x6609('0x1e')]=function(_0x106367){var _0x1e3b5c=this;return new Promise(function(_0x4b6c6a,_0x49e95c){return db[_0x6609('0x15')][_0x6609('0x1f')]({'raw':_0x106367['options']?_0x106367['options'][_0x6609('0x20')]===undefined?!![]:![]:!![],'where':_0x106367[_0x6609('0x16')]?_0x106367[_0x6609('0x16')]['where']||null:null,'attributes':_0x106367['options']?_0x106367[_0x6609('0x16')][_0x6609('0x18')]||null:null,'include':_0x106367[_0x6609('0x16')]?_0x106367[_0x6609('0x16')][_0x6609('0x1a')]?_[_0x6609('0x1c')](_0x106367[_0x6609('0x16')]['include'],function(_0x55cce1){return{'model':db[_0x55cce1[_0x6609('0x1b')]],'as':_0x55cce1['as'],'attributes':_0x55cce1['attributes'],'include':_0x55cce1[_0x6609('0x1a')]?_['map'](_0x55cce1[_0x6609('0x1a')],function(_0x43f229){return{'model':db[_0x43f229[_0x6609('0x1b')]],'as':_0x43f229['as'],'attributes':_0x43f229[_0x6609('0x18')],'include':_0x43f229[_0x6609('0x1a')]?_[_0x6609('0x1c')](_0x43f229[_0x6609('0x1a')],function(_0x5dc95a){return{'model':db[_0x5dc95a[_0x6609('0x1b')]],'as':_0x5dc95a['as'],'attributes':_0x5dc95a[_0x6609('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6609('0x9')](function(_0x255e91){logger[_0x6609('0x11')](_0x6609('0x1e'),_0x106367);logger[_0x6609('0x1d')](_0x6609('0x1e'),_0x106367,JSON[_0x6609('0xd')](_0x255e91));_0x4b6c6a(_0x255e91);})[_0x6609('0x13')](function(_0x13a44a){logger['error'](_0x6609('0x1e'),_0x13a44a['message'],_0x106367);_0x49e95c(_0x1e3b5c[_0x6609('0xf')](0x1f4,_0x13a44a['message']));});});}; \ No newline at end of file +var _0x377e=['where','attributes','limit','include','map','model','then','Trigger','find','ShowTrigger','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetTrigger','options','raw'];(function(_0x50fea9,_0x1d534d){var _0x37a103=function(_0x3cd0e8){while(--_0x3cd0e8){_0x50fea9['push'](_0x50fea9['shift']());}};_0x37a103(++_0x1d534d);}(_0x377e,0x1d9));var _0xe377=function(_0x5b0a0c,_0x587d12){_0x5b0a0c=_0x5b0a0c-0x0;var _0x3350f=_0x377e[_0x5b0a0c];return _0x3350f;};'use strict';var _=require(_0xe377('0x0'));var util=require('util');var moment=require(_0xe377('0x1'));var BPromise=require('bluebird');var rs=require(_0xe377('0x2'));var fs=require('fs');var Redis=require(_0xe377('0x3'));var db=require(_0xe377('0x4'))['db'];var utils=require(_0xe377('0x5'));var logger=require('../../config/logger')(_0xe377('0x6'));var config=require(_0xe377('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe377('0x8')][_0xe377('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119693,_0x4392dc,_0x54e37b){return new BPromise(function(_0x4345dd,_0x25d168){return client[_0xe377('0xa')](_0x119693,_0x54e37b)['then'](function(_0x140194){logger[_0xe377('0xb')](_0xe377('0xc'),_0x4392dc,_0xe377('0xd'));logger[_0xe377('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4392dc,_0xe377('0xd'),JSON['stringify'](_0x140194));if(_0x140194[_0xe377('0xf')]){if(_0x140194[_0xe377('0xf')][_0xe377('0x10')]===0x1f4){logger[_0xe377('0xf')]('Trigger,\x20%s,\x20%s',_0x4392dc,_0x140194[_0xe377('0xf')][_0xe377('0x11')]);return _0x25d168(_0x140194['error']['message']);}logger[_0xe377('0xf')](_0xe377('0xc'),_0x4392dc,_0x140194[_0xe377('0xf')][_0xe377('0x11')]);return _0x4345dd(_0x140194[_0xe377('0xf')][_0xe377('0x11')]);}else{logger[_0xe377('0xb')]('Trigger,\x20%s,\x20%s',_0x4392dc,_0xe377('0xd'));_0x4345dd(_0x140194['result'][_0xe377('0x11')]);}})[_0xe377('0x12')](function(_0x155a09){logger[_0xe377('0xf')](_0xe377('0xc'),_0x4392dc,_0x155a09);_0x25d168(_0x155a09);});});}exports[_0xe377('0x13')]=function(_0x50167f){var _0x490eed=this;return new Promise(function(_0x5e3dc9,_0x1f9f32){return db['Trigger']['findAll']({'raw':_0x50167f[_0xe377('0x14')]?_0x50167f['options'][_0xe377('0x15')]===undefined?!![]:![]:!![],'where':_0x50167f[_0xe377('0x14')]?_0x50167f[_0xe377('0x14')][_0xe377('0x16')]||null:null,'attributes':_0x50167f[_0xe377('0x14')]?_0x50167f[_0xe377('0x14')][_0xe377('0x17')]||null:null,'limit':_0x50167f[_0xe377('0x14')]?_0x50167f['options'][_0xe377('0x18')]||null:null,'include':_0x50167f[_0xe377('0x14')]?_0x50167f['options'][_0xe377('0x19')]?_[_0xe377('0x1a')](_0x50167f[_0xe377('0x14')][_0xe377('0x19')],function(_0x49a2ca){return{'model':db[_0x49a2ca[_0xe377('0x1b')]],'as':_0x49a2ca['as'],'attributes':_0x49a2ca[_0xe377('0x17')],'include':_0x49a2ca['include']?_[_0xe377('0x1a')](_0x49a2ca[_0xe377('0x19')],function(_0x1df952){return{'model':db[_0x1df952[_0xe377('0x1b')]],'as':_0x1df952['as'],'attributes':_0x1df952['attributes'],'include':_0x1df952[_0xe377('0x19')]?_[_0xe377('0x1a')](_0x1df952[_0xe377('0x19')],function(_0x29b869){return{'model':db[_0x29b869[_0xe377('0x1b')]],'as':_0x29b869['as'],'attributes':_0x29b869['attributes']};}):[]};}):[]};}):[]:[]})[_0xe377('0x1c')](function(_0x472b67){logger[_0xe377('0xb')](_0xe377('0x13'),_0x50167f);logger[_0xe377('0xe')](_0xe377('0x13'),_0x50167f,JSON['stringify'](_0x472b67));_0x5e3dc9(_0x472b67);})[_0xe377('0x12')](function(_0x3fec02){logger[_0xe377('0xf')](_0xe377('0x13'),_0x3fec02[_0xe377('0x11')],_0x50167f);_0x1f9f32(_0x490eed[_0xe377('0xf')](0x1f4,_0x3fec02[_0xe377('0x11')]));});});};exports['ShowTrigger']=function(_0x39dc0b){var _0x395c6d=this;return new Promise(function(_0x3da971,_0x1335dc){return db[_0xe377('0x1d')][_0xe377('0x1e')]({'raw':_0x39dc0b['options']?_0x39dc0b[_0xe377('0x14')][_0xe377('0x15')]===undefined?!![]:![]:!![],'where':_0x39dc0b[_0xe377('0x14')]?_0x39dc0b[_0xe377('0x14')][_0xe377('0x16')]||null:null,'attributes':_0x39dc0b[_0xe377('0x14')]?_0x39dc0b['options'][_0xe377('0x17')]||null:null,'include':_0x39dc0b[_0xe377('0x14')]?_0x39dc0b[_0xe377('0x14')][_0xe377('0x19')]?_[_0xe377('0x1a')](_0x39dc0b[_0xe377('0x14')][_0xe377('0x19')],function(_0x5b9523){return{'model':db[_0x5b9523[_0xe377('0x1b')]],'as':_0x5b9523['as'],'attributes':_0x5b9523['attributes'],'include':_0x5b9523[_0xe377('0x19')]?_['map'](_0x5b9523[_0xe377('0x19')],function(_0x4dff67){return{'model':db[_0x4dff67[_0xe377('0x1b')]],'as':_0x4dff67['as'],'attributes':_0x4dff67[_0xe377('0x17')],'include':_0x4dff67['include']?_[_0xe377('0x1a')](_0x4dff67['include'],function(_0x3f673d){return{'model':db[_0x3f673d['model']],'as':_0x3f673d['as'],'attributes':_0x3f673d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe377('0x1c')](function(_0x3697a9){logger['info']('ShowTrigger',_0x39dc0b);logger[_0xe377('0xe')](_0xe377('0x1f'),_0x39dc0b,JSON[_0xe377('0x20')](_0x3697a9));_0x3da971(_0x3697a9);})['catch'](function(_0x472c97){logger['error'](_0xe377('0x1f'),_0x472c97[_0xe377('0x11')],_0x39dc0b);_0x1335dc(_0x395c6d[_0xe377('0xf')](0x1f4,_0x472c97[_0xe377('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index dfbce44..0c2853f 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 _0xe59b=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','index','get','/:id','show','post','/:id/clone','clone','isAuthenticated','create','update'];(function(_0x2f7763,_0xce17d9){var _0x47b0cd=function(_0xa9720a){while(--_0xa9720a){_0x2f7763['push'](_0x2f7763['shift']());}};_0x47b0cd(++_0xce17d9);}(_0xe59b,0x119));var _0xbe59=function(_0x29a580,_0xc0cfbb){_0x29a580=_0x29a580-0x0;var _0x196b8c=_0xe59b[_0x29a580];return _0x196b8c;};'use strict';var multer=require(_0xbe59('0x0'));var util=require(_0xbe59('0x1'));var path=require(_0xbe59('0x2'));var timeout=require(_0xbe59('0x3'));var express=require(_0xbe59('0x4'));var router=express['Router']();var fs_extra=require(_0xbe59('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe59('0x6'));var config=require(_0xbe59('0x7'));var controller=require(_0xbe59('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbe59('0x9')]);router[_0xbe59('0xa')](_0xbe59('0xb'),auth['isAuthenticated'](),controller[_0xbe59('0xc')]);router[_0xbe59('0xd')](_0xbe59('0xe'),auth['isAuthenticated'](),controller[_0xbe59('0xf')]);router[_0xbe59('0xd')]('/',auth[_0xbe59('0x10')](),controller[_0xbe59('0x11')]);router['put']('/:id',auth[_0xbe59('0x10')](),controller[_0xbe59('0x12')]);router['delete'](_0xbe59('0xb'),auth[_0xbe59('0x10')](),controller['destroy']);module[_0xbe59('0x13')]=router; \ No newline at end of file +var _0x7866=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x42c889,_0x35ba12){var _0x34aa55=function(_0x2a6522){while(--_0x2a6522){_0x42c889['push'](_0x42c889['shift']());}};_0x34aa55(++_0x35ba12);}(_0x7866,0x1d6));var _0x6786=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7866[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x6786('0x0'));var util=require(_0x6786('0x1'));var path=require('path');var timeout=require(_0x6786('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6786('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6786('0x4'));var controller=require(_0x6786('0x5'));router[_0x6786('0x6')]('/',auth[_0x6786('0x7')](),controller[_0x6786('0x8')]);router[_0x6786('0x6')](_0x6786('0x9'),auth['isAuthenticated'](),controller[_0x6786('0xa')]);router[_0x6786('0xb')](_0x6786('0xc'),auth[_0x6786('0x7')](),controller[_0x6786('0xd')]);router[_0x6786('0xb')]('/',auth[_0x6786('0x7')](),controller[_0x6786('0xe')]);router[_0x6786('0xf')]('/:id',auth[_0x6786('0x7')](),controller[_0x6786('0x10')]);router[_0x6786('0x11')]('/:id',auth[_0x6786('0x7')](),controller[_0x6786('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8b32374..5566aa8 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 _0x371c=['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','always','accept','refuse','uac','uas','fingerprint','certificate','passive','dynamic','nonat','update,nonat','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','rfc2833','auto','yes','update','force_rport,comedia','nat','join','all','ulaw;alaw;gsm'];(function(_0x168966,_0x2a307f){var _0x9089b4=function(_0x5656ab){while(--_0x5656ab){_0x168966['push'](_0x168966['shift']());}};_0x9089b4(++_0x2a307f);}(_0x371c,0x69));var _0xc371=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x371c[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc371('0x0')],'allowNull':![],'unique':_0xc371('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc371('0x2'),_0xc371('0x3'),_0xc371('0x4')),'allowNull':![],'defaultValue':_0xc371('0x2')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc371('0x5')},'callingpres':{'type':Sequelize[_0xc371('0x6')]('ALLOWED_NOT_SCREENED',_0xc371('0x7'),'ALLOWED_FAILED_SCREEN',_0xc371('0x8'),_0xc371('0x9'),_0xc371('0xa'),_0xc371('0xb'),_0xc371('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xc371('0x0')]},'secret':{'type':Sequelize[_0xc371('0x0')]},'md5secret':{'type':Sequelize[_0xc371('0x0')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xc371('0x0')],'defaultValue':_0xc371('0xd'),'set':function(_0x5166a9){this[_0xc371('0xe')](_0xc371('0xf'),_0x5166a9?_0x5166a9['join'](','):null);},'get':function(){return this[_0xc371('0x10')](_0xc371('0xf'))?this[_0xc371('0x10')]('transport')[_0xc371('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xc371('0x12'),'info','shortinfo','inband',_0xc371('0x13')),'defaultValue':_0xc371('0x12')},'directmedia':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no','nonat',_0xc371('0x15'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xc371('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc371('0x0')]},'directmediadeny':{'type':Sequelize[_0xc371('0x0')]},'nat':{'type':Sequelize[_0xc371('0x0')],'defaultValue':_0xc371('0x16'),'set':function(_0x27e309){this['setDataValue'](_0xc371('0x17'),_0x27e309?_0x27e309[_0xc371('0x18')](','):null);},'get':function(){return this[_0xc371('0x10')]('nat')?this[_0xc371('0x10')](_0xc371('0x17'))[_0xc371('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xc371('0x0')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xc371('0x0')]},'namedpickupgroup':{'type':Sequelize[_0xc371('0x0')]},'language':{'type':Sequelize[_0xc371('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc371('0x0')],'defaultValue':_0xc371('0x19')},'allow':{'type':Sequelize[_0xc371('0x0')],'allowNull':![],'defaultValue':_0xc371('0x1a'),'set':function(_0x29e13c){this[_0xc371('0xe')](_0xc371('0x1b'),_0x29e13c?_0x29e13c[_0xc371('0x18')](';'):_0xc371('0x1a'));},'get':function(){return this[_0xc371('0x10')]('allow')?this[_0xc371('0x10')](_0xc371('0x1b'))['split'](';'):null;},'comment':_0xc371('0x1c')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x485124){this[_0xc371('0xe')]('insecure',_0x485124?_0x485124[_0xc371('0x18')](','):null);},'get':function(){return this[_0xc371('0x10')](_0xc371('0x1d'))?this[_0xc371('0x10')](_0xc371('0x1d'))[_0xc371('0x11')](','):null;},'comment':_0xc371('0x1e')},'trustrpid':{'type':Sequelize['ENUM'](_0xc371('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc371('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no',_0xc371('0x1f'))},'promiscredir':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'useclientcode':{'type':Sequelize[_0xc371('0x6')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc371('0x0')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc371('0x0')]},'callcounter':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc371('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xc371('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xc371('0x0')]},'template':{'type':Sequelize[_0xc371('0x0')]},'videosupport':{'type':Sequelize['ENUM'](_0xc371('0x14'),'no',_0xc371('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'mailbox':{'type':Sequelize[_0xc371('0x0')]},'session_timers':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x22'),_0xc371('0x23'),'originate')},'session_expires':{'type':Sequelize[_0xc371('0x20')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x24'),_0xc371('0x25')),'defaultValue':_0xc371('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0xc371('0x0')]},'regexten':{'type':Sequelize[_0xc371('0x0')]},'fromdomain':{'type':Sequelize[_0xc371('0x0')]},'fromuser':{'type':Sequelize[_0xc371('0x0')]},'port':{'type':Sequelize[_0xc371('0x20')](0x5)},'qualify':{'type':Sequelize[_0xc371('0x6')]('yes','no'),'defaultValue':_0xc371('0x14')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xc371('0x0')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc371('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc371('0x0')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xc371('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc371('0x20')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc371('0x0')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xc371('0x0')]},'use_q850_reason':{'type':Sequelize[_0xc371('0x0')]},'maxforwards':{'type':Sequelize[_0xc371('0x20')](0xb)},'encryption':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'force_avp':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'icesupport':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no',_0xc371('0x26'),_0xc371('0x27'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xc371('0x0')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xc371('0x28'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc371('0x0')]},'recordofffeature':{'type':Sequelize[_0xc371('0x0')]},'call_limit':{'type':Sequelize[_0xc371('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no')},'vmexten':{'type':Sequelize[_0xc371('0x0')]},'mohinterpret':{'type':Sequelize[_0xc371('0x0')]},'mohsuggest':{'type':Sequelize[_0xc371('0x0')]},'parkinglot':{'type':Sequelize[_0xc371('0x0')]},'description':{'type':Sequelize[_0xc371('0x0')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xc371('0x29')},'canreinvite':{'type':Sequelize[_0xc371('0x6')](_0xc371('0x14'),'no',_0xc371('0x2a'),_0xc371('0x15'),_0xc371('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc371('0x0')]},'otherFields':{'type':Sequelize[_0xc371('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc371('0x0')],'defaultValue':'no'}}; \ No newline at end of file +var _0x5aac=['PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','originate','uas','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5aac,0x15e));var _0xc5aa=function(_0x321b75,_0x45341f){_0x321b75=_0x321b75-0x0;var _0xbb4efc=_0x5aac[_0x321b75];return _0xbb4efc;};'use strict';var Sequelize=require(_0xc5aa('0x0'));module[_0xc5aa('0x1')]={'name':{'type':Sequelize[_0xc5aa('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x4'),'user',_0xc5aa('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xc5aa('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xc5aa('0x6'),_0xc5aa('0x7'),_0xc5aa('0x8'),_0xc5aa('0x9'),'PROHIB_NOT_SCREENED',_0xc5aa('0xa'),_0xc5aa('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xc5aa('0x2')]},'md5secret':{'type':Sequelize[_0xc5aa('0x2')]},'remotesecret':{'type':Sequelize[_0xc5aa('0x2')]},'transport':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':'udp','set':function(_0x2563af){this[_0xc5aa('0xc')](_0xc5aa('0xd'),_0x2563af?_0x2563af['join'](','):null);},'get':function(){return this[_0xc5aa('0xe')]('transport')?this[_0xc5aa('0xe')](_0xc5aa('0xd'))[_0xc5aa('0xf')](','):null;},'comment':_0xc5aa('0x10')},'dtmfmode':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x11'),_0xc5aa('0x12'),_0xc5aa('0x13'),'inband',_0xc5aa('0x14')),'defaultValue':_0xc5aa('0x11')},'directmedia':{'type':Sequelize['ENUM'](_0xc5aa('0x15'),'no','nonat',_0xc5aa('0x16'),_0xc5aa('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc5aa('0x2')]},'directmediadeny':{'type':Sequelize[_0xc5aa('0x2')]},'nat':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':_0xc5aa('0x18'),'set':function(_0x4af2d8){this['setDataValue'](_0xc5aa('0x19'),_0x4af2d8?_0x4af2d8[_0xc5aa('0x1a')](','):null);},'get':function(){return this[_0xc5aa('0xe')](_0xc5aa('0x19'))?this[_0xc5aa('0xe')](_0xc5aa('0x19'))[_0xc5aa('0xf')](','):null;},'comment':_0xc5aa('0x1b')},'callgroup':{'type':Sequelize[_0xc5aa('0x2')]},'namedcallgroup':{'type':Sequelize[_0xc5aa('0x2')]},'pickupgroup':{'type':Sequelize[_0xc5aa('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xc5aa('0x2')]},'language':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc5aa('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xc5aa('0x2')],'allowNull':![],'defaultValue':_0xc5aa('0x1c'),'set':function(_0x259bfc){this[_0xc5aa('0xc')](_0xc5aa('0x1d'),_0x259bfc?_0x259bfc['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xc5aa('0xe')](_0xc5aa('0x1d'))?this[_0xc5aa('0xe')]('allow')[_0xc5aa('0xf')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xc5aa('0x1e'),'set':function(_0x242ac9){this['setDataValue'](_0xc5aa('0x1f'),_0x242ac9?_0x242ac9['join'](','):null);},'get':function(){return this[_0xc5aa('0xe')](_0xc5aa('0x1f'))?this[_0xc5aa('0xe')](_0xc5aa('0x1f'))[_0xc5aa('0xf')](','):null;},'comment':_0xc5aa('0x20')},'trustrpid':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc5aa('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xc5aa('0x21'))},'promiscredir':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'useclientcode':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'accountcode':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'setvar':{'type':Sequelize[_0xc5aa('0x2')]},'callerid':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xc5aa('0x15'),'no'),'defaultValue':_0xc5aa('0x15')},'busylevel':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0xc5aa('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0xc5aa('0x2')]},'template':{'type':Sequelize[_0xc5aa('0x2')]},'videosupport':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'mailbox':{'type':Sequelize[_0xc5aa('0x2')]},'session_timers':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x23'),'refuse',_0xc5aa('0x24'))},'session_expires':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xc5aa('0x3')]('uac',_0xc5aa('0x25')),'defaultValue':_0xc5aa('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0xc5aa('0x2')]},'regexten':{'type':Sequelize[_0xc5aa('0x2')]},'fromdomain':{'type':Sequelize[_0xc5aa('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no'),'defaultValue':_0xc5aa('0x15')},'keepalive':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xc5aa('0x2')]},'defaultuser':{'type':Sequelize[_0xc5aa('0x2')]},'rtptimeout':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no',_0xc5aa('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xc5aa('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xc5aa('0x2')]},'contactdeny':{'type':Sequelize[_0xc5aa('0x2')]},'contactacl':{'type':Sequelize[_0xc5aa('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xc5aa('0x22')](0xb)},'encryption':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc5aa('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'icesupport':{'type':Sequelize[_0xc5aa('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xc5aa('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no',_0xc5aa('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xc5aa('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xc5aa('0x2')]},'dtlscipher':{'type':Sequelize[_0xc5aa('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xc5aa('0x2')]},'dtlssetup':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x28'),_0xc5aa('0x29'),_0xc5aa('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc5aa('0x2')]},'usereqphone':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc5aa('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc5aa('0x3')](_0xc5aa('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xc5aa('0x15'),'no')},'vmexten':{'type':Sequelize[_0xc5aa('0x2')]},'mohinterpret':{'type':Sequelize[_0xc5aa('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xc5aa('0x2')]},'description':{'type':Sequelize[_0xc5aa('0x2')]},'host':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':_0xc5aa('0x2b')},'canreinvite':{'type':Sequelize[_0xc5aa('0x3')]('yes','no','nonat',_0xc5aa('0x16'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc5aa('0x2')]},'otherFields':{'type':Sequelize[_0xc5aa('0x2')]},'active':{'type':Sequelize[_0xc5aa('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc5aa('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 0b1c67b..ddd438a 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x2dd7fc,_0x42c03c){var _0x1eac5d=function(_0x48fe12){while(--_0x48fe12){_0x2dd7fc['push'](_0x2dd7fc['shift']());}};_0x1eac5d(++_0x42c03c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xa08ad0,_0x34b452){_0xa08ad0=_0xa08ad0-0x0;var _0x5c037f=_0x8d0e[_0xa08ad0];return _0x5c037f;};'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'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0x9f62,0x154));var _0x29f6=function(_0x4b0425,_0x1efd64){_0x4b0425=_0x4b0425-0x0;var _0x19abae=_0x9f62[_0x4b0425];return _0x19abae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 01aec6b..1c98464 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 _0xa569=['define','tools_trunks','lodash','util','api','bluebird','path','../../config/environment','./trunk.attributes','exports'];(function(_0x66b9b4,_0x8780d7){var _0x3016f0=function(_0x5f449e){while(--_0x5f449e){_0x66b9b4['push'](_0x66b9b4['shift']());}};_0x3016f0(++_0x8780d7);}(_0xa569,0x19c));var _0x9a56=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0xa569[_0x5d9ceb];return _0x33ce82;};'use strict';var _=require(_0x9a56('0x0'));var util=require(_0x9a56('0x1'));var logger=require('../../config/logger')(_0x9a56('0x2'));var moment=require('moment');var BPromise=require(_0x9a56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a56('0x4'));var rimraf=require('rimraf');var config=require(_0x9a56('0x5'));var attributes=require(_0x9a56('0x6'));module[_0x9a56('0x7')]=function(_0x3ed8c7,_0x2a5b10){return _0x3ed8c7[_0x9a56('0x8')]('Trunk',attributes,{'tableName':_0x9a56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8425=['define','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x8425,0xf9));var _0x5842=function(_0x30e1be,_0x2ef820){_0x30e1be=_0x30e1be-0x0;var _0x57c8ea=_0x8425[_0x30e1be];return _0x57c8ea;};'use strict';var _=require(_0x5842('0x0'));var util=require(_0x5842('0x1'));var logger=require(_0x5842('0x2'))(_0x5842('0x3'));var moment=require(_0x5842('0x4'));var BPromise=require(_0x5842('0x5'));var rp=require(_0x5842('0x6'));var fs=require('fs');var path=require(_0x5842('0x7'));var rimraf=require(_0x5842('0x8'));var config=require('../../config/environment');var attributes=require(_0x5842('0x9'));module[_0x5842('0xa')]=function(_0x3cabc5,_0x3f0dfe){return _0x3cabc5[_0x5842('0xb')]('Trunk',attributes,{'tableName':_0x5842('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index daef9d0..d92ae95 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 _0x008d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrunk','util','bluebird','randomstring','../../mysqldb'];(function(_0x3ceac8,_0x15070c){var _0x161b4b=function(_0x588398){while(--_0x588398){_0x3ceac8['push'](_0x3ceac8['shift']());}};_0x161b4b(++_0x15070c);}(_0x008d,0x88));var _0xd008=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x008d[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xd008('0x0'));var moment=require('moment');var BPromise=require(_0xd008('0x1'));var rs=require(_0xd008('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd008('0x3'))['db'];var utils=require(_0xd008('0x4'));var logger=require('../../config/logger')(_0xd008('0x5'));var config=require(_0xd008('0x6'));var jayson=require(_0xd008('0x7'));var client=jayson[_0xd008('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cfd98,_0x32df66,_0x2462df){return new BPromise(function(_0xcf07f7,_0x1d11df){return client[_0xd008('0x9')](_0x5cfd98,_0x2462df)[_0xd008('0xa')](function(_0x46d961){logger[_0xd008('0xb')](_0xd008('0xc'),_0x32df66,'request\x20sent');logger[_0xd008('0xd')](_0xd008('0xe'),_0x32df66,_0xd008('0xf'),JSON[_0xd008('0x10')](_0x46d961));if(_0x46d961[_0xd008('0x11')]){if(_0x46d961['error'][_0xd008('0x12')]===0x1f4){logger[_0xd008('0x11')](_0xd008('0xc'),_0x32df66,_0x46d961[_0xd008('0x11')][_0xd008('0x13')]);return _0x1d11df(_0x46d961[_0xd008('0x11')][_0xd008('0x13')]);}logger[_0xd008('0x11')]('Trunk,\x20%s,\x20%s',_0x32df66,_0x46d961['error'][_0xd008('0x13')]);return _0xcf07f7(_0x46d961[_0xd008('0x11')]['message']);}else{logger[_0xd008('0xb')](_0xd008('0xc'),_0x32df66,_0xd008('0xf'));_0xcf07f7(_0x46d961[_0xd008('0x14')]['message']);}})[_0xd008('0x15')](function(_0xef2169){logger['error'](_0xd008('0xc'),_0x32df66,_0xef2169);_0x1d11df(_0xef2169);});});}exports[_0xd008('0x16')]=function(_0x1a37c1){var _0x33276f=this;return new Promise(function(_0x38512a,_0x490bac){return db[_0xd008('0x17')][_0xd008('0x18')]({'raw':_0x1a37c1[_0xd008('0x19')]?_0x1a37c1[_0xd008('0x19')][_0xd008('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a37c1['options']?_0x1a37c1[_0xd008('0x19')][_0xd008('0x1b')]||null:null,'attributes':_0x1a37c1['options']?_0x1a37c1[_0xd008('0x19')][_0xd008('0x1c')]||null:null,'limit':_0x1a37c1['options']?_0x1a37c1[_0xd008('0x19')][_0xd008('0x1d')]||null:null,'include':_0x1a37c1[_0xd008('0x19')]?_0x1a37c1[_0xd008('0x19')][_0xd008('0x1e')]?_[_0xd008('0x1f')](_0x1a37c1['options'][_0xd008('0x1e')],function(_0x3ef4e2){return{'model':db[_0x3ef4e2[_0xd008('0x20')]],'as':_0x3ef4e2['as'],'attributes':_0x3ef4e2[_0xd008('0x1c')],'include':_0x3ef4e2['include']?_['map'](_0x3ef4e2[_0xd008('0x1e')],function(_0x5c53f4){return{'model':db[_0x5c53f4['model']],'as':_0x5c53f4['as'],'attributes':_0x5c53f4[_0xd008('0x1c')],'include':_0x5c53f4[_0xd008('0x1e')]?_[_0xd008('0x1f')](_0x5c53f4['include'],function(_0x3ba100){return{'model':db[_0x3ba100[_0xd008('0x20')]],'as':_0x3ba100['as'],'attributes':_0x3ba100[_0xd008('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd008('0xa')](function(_0x374dd1){logger[_0xd008('0xb')](_0xd008('0x16'),_0x1a37c1);logger[_0xd008('0xd')]('GetTrunk',_0x1a37c1,JSON[_0xd008('0x10')](_0x374dd1));_0x38512a(_0x374dd1);})[_0xd008('0x15')](function(_0x2d1e1a){logger[_0xd008('0x11')](_0xd008('0x16'),_0x2d1e1a['message'],_0x1a37c1);_0x490bac(_0x33276f[_0xd008('0x11')](0x1f4,_0x2d1e1a[_0xd008('0x13')]));});});};exports['ShowTrunk']=function(_0x39bfd2){var _0x25b138=this;return new Promise(function(_0xa159,_0x1cee03){return db[_0xd008('0x17')][_0xd008('0x21')]({'raw':_0x39bfd2[_0xd008('0x19')]?_0x39bfd2[_0xd008('0x19')][_0xd008('0x1a')]===undefined?!![]:![]:!![],'where':_0x39bfd2[_0xd008('0x19')]?_0x39bfd2['options'][_0xd008('0x1b')]||null:null,'attributes':_0x39bfd2[_0xd008('0x19')]?_0x39bfd2[_0xd008('0x19')]['attributes']||null:null,'include':_0x39bfd2[_0xd008('0x19')]?_0x39bfd2[_0xd008('0x19')]['include']?_['map'](_0x39bfd2[_0xd008('0x19')][_0xd008('0x1e')],function(_0x2a5938){return{'model':db[_0x2a5938[_0xd008('0x20')]],'as':_0x2a5938['as'],'attributes':_0x2a5938[_0xd008('0x1c')],'include':_0x2a5938[_0xd008('0x1e')]?_[_0xd008('0x1f')](_0x2a5938[_0xd008('0x1e')],function(_0x7aba00){return{'model':db[_0x7aba00[_0xd008('0x20')]],'as':_0x7aba00['as'],'attributes':_0x7aba00['attributes'],'include':_0x7aba00[_0xd008('0x1e')]?_[_0xd008('0x1f')](_0x7aba00[_0xd008('0x1e')],function(_0x68f929){return{'model':db[_0x68f929[_0xd008('0x20')]],'as':_0x68f929['as'],'attributes':_0x68f929[_0xd008('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd008('0xa')](function(_0x2b7dfb){logger[_0xd008('0xb')](_0xd008('0x22'),_0x39bfd2);logger['debug'](_0xd008('0x22'),_0x39bfd2,JSON[_0xd008('0x10')](_0x2b7dfb));_0xa159(_0x2b7dfb);})[_0xd008('0x15')](function(_0x1373ea){logger[_0xd008('0x11')](_0xd008('0x22'),_0x1373ea[_0xd008('0x13')],_0x39bfd2);_0x1cee03(_0x25b138[_0xd008('0x11')](0x1f4,_0x1373ea[_0xd008('0x13')]));});});}; \ No newline at end of file +var _0x06c6=['message','result','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','ShowTrunk','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2409ad,_0x5f4078){var _0x2c24c9=function(_0x4ea567){while(--_0x4ea567){_0x2409ad['push'](_0x2409ad['shift']());}};_0x2c24c9(++_0x5f4078);}(_0x06c6,0xe7));var _0x606c=function(_0x45f0fe,_0x2d7473){_0x45f0fe=_0x45f0fe-0x0;var _0x94a7c6=_0x06c6[_0x45f0fe];return _0x94a7c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x606c('0x0'));var BPromise=require(_0x606c('0x1'));var rs=require(_0x606c('0x2'));var fs=require('fs');var Redis=require(_0x606c('0x3'));var db=require(_0x606c('0x4'))['db'];var utils=require(_0x606c('0x5'));var logger=require(_0x606c('0x6'))(_0x606c('0x7'));var config=require(_0x606c('0x8'));var jayson=require(_0x606c('0x9'));var client=jayson[_0x606c('0xa')][_0x606c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28c447,_0xa3a21c,_0x44a770){return new BPromise(function(_0x169df6,_0x4d6463){return client[_0x606c('0xc')](_0x28c447,_0x44a770)[_0x606c('0xd')](function(_0x40208d){logger[_0x606c('0xe')](_0x606c('0xf'),_0xa3a21c,_0x606c('0x10'));logger[_0x606c('0x11')](_0x606c('0x12'),_0xa3a21c,'request\x20sent',JSON[_0x606c('0x13')](_0x40208d));if(_0x40208d[_0x606c('0x14')]){if(_0x40208d['error']['code']===0x1f4){logger['error'](_0x606c('0xf'),_0xa3a21c,_0x40208d[_0x606c('0x14')]['message']);return _0x4d6463(_0x40208d[_0x606c('0x14')][_0x606c('0x15')]);}logger[_0x606c('0x14')]('Trunk,\x20%s,\x20%s',_0xa3a21c,_0x40208d[_0x606c('0x14')]['message']);return _0x169df6(_0x40208d[_0x606c('0x14')][_0x606c('0x15')]);}else{logger[_0x606c('0xe')](_0x606c('0xf'),_0xa3a21c,_0x606c('0x10'));_0x169df6(_0x40208d[_0x606c('0x16')][_0x606c('0x15')]);}})['catch'](function(_0x2e7891){logger['error'](_0x606c('0xf'),_0xa3a21c,_0x2e7891);_0x4d6463(_0x2e7891);});});}exports[_0x606c('0x17')]=function(_0xe5fa4a){var _0x5ac846=this;return new Promise(function(_0x8f9135,_0x524687){return db['Trunk'][_0x606c('0x18')]({'raw':_0xe5fa4a[_0x606c('0x19')]?_0xe5fa4a[_0x606c('0x19')][_0x606c('0x1a')]===undefined?!![]:![]:!![],'where':_0xe5fa4a[_0x606c('0x19')]?_0xe5fa4a['options'][_0x606c('0x1b')]||null:null,'attributes':_0xe5fa4a[_0x606c('0x19')]?_0xe5fa4a[_0x606c('0x19')][_0x606c('0x1c')]||null:null,'limit':_0xe5fa4a[_0x606c('0x19')]?_0xe5fa4a[_0x606c('0x19')][_0x606c('0x1d')]||null:null,'include':_0xe5fa4a[_0x606c('0x19')]?_0xe5fa4a[_0x606c('0x19')]['include']?_['map'](_0xe5fa4a[_0x606c('0x19')][_0x606c('0x1e')],function(_0xd2f308){return{'model':db[_0xd2f308['model']],'as':_0xd2f308['as'],'attributes':_0xd2f308['attributes'],'include':_0xd2f308[_0x606c('0x1e')]?_[_0x606c('0x1f')](_0xd2f308[_0x606c('0x1e')],function(_0x133720){return{'model':db[_0x133720[_0x606c('0x20')]],'as':_0x133720['as'],'attributes':_0x133720['attributes'],'include':_0x133720[_0x606c('0x1e')]?_[_0x606c('0x1f')](_0x133720[_0x606c('0x1e')],function(_0x2eb83e){return{'model':db[_0x2eb83e[_0x606c('0x20')]],'as':_0x2eb83e['as'],'attributes':_0x2eb83e[_0x606c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x606c('0xd')](function(_0x554046){logger[_0x606c('0xe')](_0x606c('0x17'),_0xe5fa4a);logger[_0x606c('0x11')]('GetTrunk',_0xe5fa4a,JSON[_0x606c('0x13')](_0x554046));_0x8f9135(_0x554046);})[_0x606c('0x21')](function(_0xef3e67){logger[_0x606c('0x14')](_0x606c('0x17'),_0xef3e67[_0x606c('0x15')],_0xe5fa4a);_0x524687(_0x5ac846[_0x606c('0x14')](0x1f4,_0xef3e67[_0x606c('0x15')]));});});};exports['ShowTrunk']=function(_0x2eff9d){var _0x258afd=this;return new Promise(function(_0x538415,_0x323202){return db['Trunk'][_0x606c('0x22')]({'raw':_0x2eff9d[_0x606c('0x19')]?_0x2eff9d['options'][_0x606c('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eff9d[_0x606c('0x19')]?_0x2eff9d[_0x606c('0x19')][_0x606c('0x1b')]||null:null,'attributes':_0x2eff9d['options']?_0x2eff9d[_0x606c('0x19')][_0x606c('0x1c')]||null:null,'include':_0x2eff9d[_0x606c('0x19')]?_0x2eff9d[_0x606c('0x19')][_0x606c('0x1e')]?_[_0x606c('0x1f')](_0x2eff9d[_0x606c('0x19')]['include'],function(_0x4bcac9){return{'model':db[_0x4bcac9[_0x606c('0x20')]],'as':_0x4bcac9['as'],'attributes':_0x4bcac9[_0x606c('0x1c')],'include':_0x4bcac9[_0x606c('0x1e')]?_[_0x606c('0x1f')](_0x4bcac9['include'],function(_0x17ad9d){return{'model':db[_0x17ad9d[_0x606c('0x20')]],'as':_0x17ad9d['as'],'attributes':_0x17ad9d['attributes'],'include':_0x17ad9d[_0x606c('0x1e')]?_[_0x606c('0x1f')](_0x17ad9d['include'],function(_0x4b326b){return{'model':db[_0x4b326b[_0x606c('0x20')]],'as':_0x4b326b['as'],'attributes':_0x4b326b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9c16){logger['info'](_0x606c('0x23'),_0x2eff9d);logger[_0x606c('0x11')]('ShowTrunk',_0x2eff9d,JSON[_0x606c('0x13')](_0x4b9c16));_0x538415(_0x4b9c16);})[_0x606c('0x21')](function(_0x50186e){logger[_0x606c('0x14')](_0x606c('0x23'),_0x50186e[_0x606c('0x15')],_0x2eff9d);_0x323202(_0x258afd[_0x606c('0x14')](0x1f4,_0x50186e[_0x606c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 05e853e..1e75d91 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 _0xb05b=['Router','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x455198,_0x4b6927){var _0x479a26=function(_0x3d03c0){while(--_0x3d03c0){_0x455198['push'](_0x455198['shift']());}};_0x479a26(++_0x4b6927);}(_0xb05b,0x177));var _0xbb05=function(_0x332bb4,_0x24246d){_0x332bb4=_0x332bb4-0x0;var _0x136f0b=_0xb05b[_0x332bb4];return _0x136f0b;};'use strict';var express=require('express');var router=express[_0xbb05('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xbb05('0x1'));router[_0xbb05('0x2')](_0xbb05('0x3'),auth[_0xbb05('0x4')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x1f17=['./user-setting.controller','put','/:id','express','Router'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1f17,0x12a));var _0x71f1=function(_0x3f97a7,_0x4732e9){_0x3f97a7=_0x3f97a7-0x0;var _0x4cead3=_0x1f17[_0x3f97a7];return _0x4cead3;};'use strict';var express=require(_0x71f1('0x0'));var router=express[_0x71f1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x71f1('0x2'));router[_0x71f1('0x3')](_0x71f1('0x4'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 6a9eafd..74928ea 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 _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0xcafaae,_0x1236ed){var _0x95133e=function(_0x269e16){while(--_0x269e16){_0xcafaae['push'](_0xcafaae['shift']());}};_0x95133e(++_0x1236ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x229e40,_0x453ce1){var _0x340c8a=function(_0x2f31ec){while(--_0x2f31ec){_0x229e40['push'](_0x229e40['shift']());}};_0x340c8a(++_0x453ce1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ 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 9e5299c..ffec834 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 _0x44ae=['update','then','sendStatus','error','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','catch','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','./user-setting.socket','register','defaults','status'];(function(_0xa8ecef,_0x5821e6){var _0x39823c=function(_0x350011){while(--_0x350011){_0xa8ecef['push'](_0xa8ecef['shift']());}};_0x39823c(++_0x5821e6);}(_0x44ae,0x17d));var _0xe44a=function(_0x3ba3c0,_0x129464){_0x3ba3c0=_0x3ba3c0-0x0;var _0x574ae9=_0x44ae[_0x3ba3c0];return _0x574ae9;};'use strict';var _=require(_0xe44a('0x0'));var Redis=require(_0xe44a('0x1'));var logger=require(_0xe44a('0x2'))(_0xe44a('0x3'));var config=require('../../config/environment');var db=require(_0xe44a('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe44a('0x5')]));require(_0xe44a('0x6'))[_0xe44a('0x7')](socket);config[_0xe44a('0x5')]=_[_0xe44a('0x8')](config[_0xe44a('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x41a06b,_0x37bbef){_0x37bbef=_0x37bbef||0xc8;return function(_0x21f98c){if(_0x21f98c){return _0x41a06b[_0xe44a('0x9')](_0x37bbef)['json'](_0x21f98c);}};}function saveUpdates(_0x221125){return function(_0xde6308){if(_0xde6308){return _0xde6308[_0xe44a('0xa')](_0x221125)[_0xe44a('0xb')](function(_0x4c52ee){return _0x4c52ee;});}return null;};}function handleEntityNotFound(_0x231326){return function(_0x3493e7){if(!_0x3493e7){_0x231326[_0xe44a('0xc')](0x194);}return _0x3493e7;};}function handleError(_0x1d7db0,_0xe19628){_0xe19628=_0xe19628||0x1f4;return function(_0x30fd36){logger[_0xe44a('0xd')](_0x30fd36['stack']);if(_0x30fd36['name']){delete _0x30fd36['name'];}_0x1d7db0[_0xe44a('0x9')](_0xe19628)[_0xe44a('0xe')](_0x30fd36);};}exports[_0xe44a('0xa')]=function(_0x56cee6,_0x2263ba){if(_0x56cee6[_0xe44a('0xf')][_0xe44a('0x10')]!==_0xe44a('0x11'))throw new Error(_0xe44a('0x12'));if(isNaN(Number(_0x56cee6[_0xe44a('0x13')]['id'])))throw new Error(_0xe44a('0x14'));return db['UserSetting'][_0xe44a('0x15')]({'where':{'id':_0x56cee6[_0xe44a('0x13')]['id']}})['then'](handleEntityNotFound(_0x2263ba,null))['then'](saveUpdates(_0x56cee6['body'],null))['then'](respondWithResult(_0x2263ba,null))[_0xe44a('0x16')](handleError(_0x2263ba,null));}; \ No newline at end of file +var _0x919e=['sendStatus','name','status','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','catch','lodash','ioredis','../../config/logger','../../config/environment','redis','./user-setting.socket','register','defaults','localhost','json','update','then'];(function(_0x416cad,_0x394014){var _0x36f8f2=function(_0x3433de){while(--_0x3433de){_0x416cad['push'](_0x416cad['shift']());}};_0x36f8f2(++_0x394014);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe919('0x0'));var Redis=require(_0xe919('0x1'));var logger=require(_0xe919('0x2'))('api');var config=require(_0xe919('0x3'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe919('0x4')]));require(_0xe919('0x5'))[_0xe919('0x6')](socket);config[_0xe919('0x4')]=_[_0xe919('0x7')](config[_0xe919('0x4')],{'host':_0xe919('0x8'),'port':0x18eb});function respondWithResult(_0x493b47,_0x7c1fa4){_0x7c1fa4=_0x7c1fa4||0xc8;return function(_0x2ceb41){if(_0x2ceb41){return _0x493b47['status'](_0x7c1fa4)[_0xe919('0x9')](_0x2ceb41);}};}function saveUpdates(_0x5c4129){return function(_0x1715db){if(_0x1715db){return _0x1715db[_0xe919('0xa')](_0x5c4129)[_0xe919('0xb')](function(_0x58a7a7){return _0x58a7a7;});}return null;};}function handleEntityNotFound(_0x83759d){return function(_0x34e59e){if(!_0x34e59e){_0x83759d[_0xe919('0xc')](0x194);}return _0x34e59e;};}function handleError(_0x53ab97,_0x12098d){_0x12098d=_0x12098d||0x1f4;return function(_0x50c6ff){logger['error'](_0x50c6ff['stack']);if(_0x50c6ff[_0xe919('0xd')]){delete _0x50c6ff[_0xe919('0xd')];}_0x53ab97[_0xe919('0xe')](_0x12098d)['send'](_0x50c6ff);};}exports['update']=function(_0x203b79,_0x26fc06){if(_0x203b79['user'][_0xe919('0xf')]!==_0xe919('0x10'))throw new Error(_0xe919('0x11'));if(isNaN(Number(_0x203b79[_0xe919('0x12')]['id'])))throw new Error(_0xe919('0x13'));return db[_0xe919('0x14')][_0xe919('0x15')]({'where':{'id':_0x203b79['params']['id']}})[_0xe919('0xb')](handleEntityNotFound(_0x26fc06,null))['then'](saveUpdates(_0x203b79['body'],null))[_0xe919('0xb')](respondWithResult(_0x26fc06,null))[_0xe919('0x16')](handleError(_0x26fc06,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 675ca60..7c3994f 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 _0x3086=['../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x2da1a2,_0xa09d17){var _0x84cce9=function(_0x5778d6){while(--_0x5778d6){_0x2da1a2['push'](_0x2da1a2['shift']());}};_0x84cce9(++_0xa09d17);}(_0x3086,0xbd));var _0x6308=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x3086[_0x1beef3];return _0x5af964;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x6308('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6308('0x1'),'afterUpdate':_0x6308('0x2'),'afterDestroy':_0x6308('0x3')};function emitEvent(_0x4c192a){return function(_0x485e32,_0x240ddd,_0x17dbb3){UserSettingEvents[_0x6308('0x4')](_0x4c192a+':'+_0x485e32['id'],_0x485e32);UserSettingEvents[_0x6308('0x4')](_0x4c192a,_0x485e32);_0x17dbb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x6308('0x5')](e,emitEvent(event));}}module[_0x6308('0x6')]=UserSettingEvents; \ No newline at end of file +var _0x29ca=['hook','events','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0xcdac34,_0x43f665){var _0x269d23=function(_0x3f2d6f){while(--_0x3f2d6f){_0xcdac34['push'](_0xcdac34['shift']());}};_0x269d23(++_0x43f665);}(_0x29ca,0x91));var _0xa29c=function(_0x3f9b50,_0x5d40fc){_0x3f9b50=_0x3f9b50-0x0;var _0x48ffaf=_0x29ca[_0x3f9b50];return _0x48ffaf;};'use strict';var EventEmitter=require(_0xa29c('0x0'));var UserSetting=require(_0xa29c('0x1'))['db'][_0xa29c('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa29c('0x3')](0x0);var events={'afterCreate':_0xa29c('0x4'),'afterUpdate':_0xa29c('0x5'),'afterDestroy':_0xa29c('0x6')};function emitEvent(_0x1ef62a){return function(_0x108464,_0x49586d,_0x4c4b0b){UserSettingEvents['emit'](_0x1ef62a+':'+_0x108464['id'],_0x108464);UserSettingEvents[_0xa29c('0x7')](_0x1ef62a,_0x108464);_0x4c4b0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xa29c('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index b618162..3fb2d5c 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 _0x7497=['./user-setting.attributes','exports','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x7749('0x0'));module[_0x7749('0x1')]=function(_0x24fbc9){return _0x24fbc9['define']('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4000cf){if(!_0x4000cf[_0x7749('0x2')])_0x4000cf['clientSideLoggingEnabledSince']=null;else if(_0x4000cf[_0x7749('0x3')]===null)_0x4000cf[_0x7749('0x3')]=new Date();}}});}; \ No newline at end of file +var _0x4522=['define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0xed199a,_0x638a0){var _0x383f9d=function(_0x1cf474){while(--_0x1cf474){_0xed199a['push'](_0xed199a['shift']());}};_0x383f9d(++_0x638a0);}(_0x4522,0x1a0));var _0x2452=function(_0x17a5c4,_0x3df910){_0x17a5c4=_0x17a5c4-0x0;var _0x19345a=_0x4522[_0x17a5c4];return _0x19345a;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x46400f){return _0x46400f[_0x2452('0x0')](_0x2452('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x229028){if(!_0x229028[_0x2452('0x2')])_0x229028[_0x2452('0x3')]=null;else if(_0x229028[_0x2452('0x3')]===null)_0x229028[_0x2452('0x3')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index e42d082..371367d 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 _0x0a6d=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x0a6d,0x13e));var _0xd0a6=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x0a6d[_0x2dea24];return _0x309d58;};'use strict';var UserSettingEvents=require(_0xd0a6('0x0'));var events=[_0xd0a6('0x1'),'remove',_0xd0a6('0x2')];function createListener(_0x46330a,_0x3936bd){return function(_0x3431d6){_0x3936bd[_0xd0a6('0x3')](_0x46330a,_0x3431d6);if(_0x46330a===_0xd0a6('0x4')){_0x3936bd[_0xd0a6('0x3')](_0xd0a6('0x5')+_0x3431d6[_0xd0a6('0x6')],_0x3431d6);}};}exports[_0xd0a6('0x7')]=function(_0x501696){for(var _0x31395c=0x0,_0x2678d3=events[_0xd0a6('0x8')];_0x31395c<_0x2678d3;_0x31395c++){var _0x2d06e2=events[_0x31395c];var _0x5149aa=createListener(_0xd0a6('0x9')+_0x2d06e2,_0x501696);UserSettingEvents['on'](_0x2d06e2,_0x5149aa);}}; \ No newline at end of file +var _0xb69e=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','emit','user-setting:update'];(function(_0x101d18,_0x4638ab){var _0x1a4511=function(_0x48f1c4){while(--_0x48f1c4){_0x101d18['push'](_0x101d18['shift']());}};_0x1a4511(++_0x4638ab);}(_0xb69e,0x163));var _0xeb69=function(_0xf09fef,_0x414956){_0xf09fef=_0xf09fef-0x0;var _0x111287=_0xb69e[_0xf09fef];return _0x111287;};'use strict';var UserSettingEvents=require(_0xeb69('0x0'));var events=[_0xeb69('0x1'),_0xeb69('0x2'),'update'];function createListener(_0x311a85,_0x312611){return function(_0x1592b2){_0x312611[_0xeb69('0x3')](_0x311a85,_0x1592b2);if(_0x311a85===_0xeb69('0x4')){_0x312611[_0xeb69('0x3')](_0xeb69('0x5')+_0x1592b2[_0xeb69('0x6')],_0x1592b2);}};}exports[_0xeb69('0x7')]=function(_0x33a980){for(var _0x5aa318=0x0,_0x5d80f7=events[_0xeb69('0x8')];_0x5aa318<_0x5d80f7;_0x5aa318++){var _0x3e9d3b=events[_0x5aa318];var _0x4b8c21=createListener(_0xeb69('0x9')+_0x3e9d3b,_0x33a980);UserSettingEvents['on'](_0x3e9d3b,_0x4b8c21);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 88c3b22..1545e41 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 _0x6d36=['post','addContacts','create','/create_many','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','originalname','single','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','changePassword','removeQueues','delete','removeTeams','destroy','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','getApiKey'];(function(_0x2216f9,_0xce5b40){var _0x39eab6=function(_0x5eb8f5){while(--_0x5eb8f5){_0x2216f9['push'](_0x2216f9['shift']());}};_0x39eab6(++_0xce5b40);}(_0x6d36,0xb0));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x66d3('0x0'));var util=require(_0x66d3('0x1'));var path=require(_0x66d3('0x2'));var timeout=require(_0x66d3('0x3'));var express=require(_0x66d3('0x4'));var router=express[_0x66d3('0x5')]();var fs_extra=require(_0x66d3('0x6'));var auth=require(_0x66d3('0x7'));var interaction=require(_0x66d3('0x8'));var config=require(_0x66d3('0x9'));var controller=require(_0x66d3('0xa'));router[_0x66d3('0xb')]('/',auth[_0x66d3('0xc')](),controller[_0x66d3('0xd')]);router[_0x66d3('0xb')](_0x66d3('0xe'),auth[_0x66d3('0xc')](),controller[_0x66d3('0xf')]);router[_0x66d3('0xb')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router[_0x66d3('0xb')](_0x66d3('0x10'),auth['isAuthenticated'](),controller[_0x66d3('0x11')]);router[_0x66d3('0xb')](_0x66d3('0x12'),auth['isAuthenticated'](),controller[_0x66d3('0x13')]);router['get'](_0x66d3('0x14'),controller[_0x66d3('0x15')]);router[_0x66d3('0xb')](_0x66d3('0x16'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x66d3('0xb')](_0x66d3('0x17'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x18')]);router[_0x66d3('0xb')]('/:id/queues',auth[_0x66d3('0xc')](),controller['getQueues']);router[_0x66d3('0xb')](_0x66d3('0x19'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x1a')]);router['get'](_0x66d3('0x1b'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x1c')]);router[_0x66d3('0xb')](_0x66d3('0x1d'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x1e')]);router['get'](_0x66d3('0x1f'),auth['isAuthenticated'](),controller[_0x66d3('0x20')]);router[_0x66d3('0xb')](_0x66d3('0x21'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x22')]);router[_0x66d3('0xb')]('/:id/openchannel/interactions',auth[_0x66d3('0xc')](),controller['getOpenchannelInteractions']);router['get'](_0x66d3('0x23'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x24')]);router[_0x66d3('0xb')](_0x66d3('0x25'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x66d3('0xb')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x66d3('0x26')]);router[_0x66d3('0xb')](_0x66d3('0x27'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x28')]);router[_0x66d3('0xb')](_0x66d3('0x29'),auth[_0x66d3('0xc')](),controller['getTeams']);router[_0x66d3('0xb')](_0x66d3('0x2a'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x2b')]);router[_0x66d3('0xb')](_0x66d3('0x2c'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x2d')]);router[_0x66d3('0xb')](_0x66d3('0x2e'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x2f')]);router[_0x66d3('0xb')](_0x66d3('0x30'),auth['isAuthenticated'](),controller[_0x66d3('0x31')]);router[_0x66d3('0xb')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x66d3('0x32')]);router['get'](_0x66d3('0x33'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x34')]);router['get'](_0x66d3('0x35'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x36')]);router[_0x66d3('0xb')](_0x66d3('0x37'),auth[_0x66d3('0xc')](),controller['getChatWebsites']);router[_0x66d3('0xb')](_0x66d3('0x38'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x39')]);router[_0x66d3('0xb')](_0x66d3('0x3a'),auth['isAuthenticated'](),controller[_0x66d3('0x3b')]);router['get']('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x66d3('0x3c')]);router[_0x66d3('0xb')]('/:id/api_key',auth[_0x66d3('0xc')](),controller[_0x66d3('0x3d')]);router[_0x66d3('0x3e')]('/:id/contacts',auth[_0x66d3('0xc')](),controller[_0x66d3('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x66d3('0x40')]);router[_0x66d3('0x3e')](_0x66d3('0x41'),auth[_0x66d3('0xc')](),controller['bulkCreate']);router['post'](_0x66d3('0x42'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x43')]);var upload=multer({'storage':multer[_0x66d3('0x44')]({'destination':function(_0x3b30d5,_0x37d347,_0x30e01a){_0x30e01a(null,path[_0x66d3('0x45')](config[_0x66d3('0x46')],_0x66d3('0x47')));},'filename':function(_0x22c80d,_0x36907f,_0x5d4c2a){_0x5d4c2a(null,util[_0x66d3('0x48')]('%s-%s',Date['now'](),_0x36907f[_0x66d3('0x49')]));}})});router[_0x66d3('0x3e')]('/:id/avatar',upload[_0x66d3('0x4a')]('file'),controller['addAvatar']);router[_0x66d3('0x3e')](_0x66d3('0x4b'),auth['isAuthenticated'](),controller[_0x66d3('0x4c')]);router[_0x66d3('0x3e')]('/:id/logout',auth[_0x66d3('0xc')](),controller[_0x66d3('0x4d')]);router[_0x66d3('0x3e')](_0x66d3('0x4e'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x4f')]);router[_0x66d3('0x3e')](_0x66d3('0x50'),auth[_0x66d3('0xc')](),controller['unpause']);router['post'](_0x66d3('0x29'),auth['isAuthenticated'](),controller[_0x66d3('0x51')]);router['post'](_0x66d3('0x52'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x53')]);router[_0x66d3('0x3e')](_0x66d3('0x54'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x55')]);router[_0x66d3('0x3e')](_0x66d3('0x56'),auth['isAuthenticated'](),controller[_0x66d3('0x57')]);router[_0x66d3('0x3e')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x66d3('0x58')]);router['post'](_0x66d3('0x59'),auth['isAuthenticated'](),controller[_0x66d3('0x5a')]);router[_0x66d3('0x3e')](_0x66d3('0x5b'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x5c')]);router['post'](_0x66d3('0x30'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x5d')]);router[_0x66d3('0x3e')](_0x66d3('0x5e'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x5f')]);router[_0x66d3('0x3e')](_0x66d3('0x33'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x60')]);router[_0x66d3('0x3e')]('/:id/sms_accounts',auth[_0x66d3('0xc')](),controller['addSmsAccounts']);router[_0x66d3('0x3e')](_0x66d3('0x37'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x61')]);router[_0x66d3('0x3e')](_0x66d3('0x38'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x62')]);router[_0x66d3('0x3e')]('/:id/square_projects',auth[_0x66d3('0xc')](),controller[_0x66d3('0x63')]);router['post'](_0x66d3('0x64'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x65')]);router[_0x66d3('0x66')]('/:id',auth['isAuthenticated'](),controller[_0x66d3('0x67')]);router[_0x66d3('0x66')]('/:id/password',auth[_0x66d3('0xc')](),controller[_0x66d3('0x68')]);router['delete']('/:id/queues',auth[_0x66d3('0xc')](),controller[_0x66d3('0x69')]);router[_0x66d3('0x6a')](_0x66d3('0x29'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x6b')]);router[_0x66d3('0x6a')](_0x66d3('0x12'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x6c')]);router[_0x66d3('0x6a')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete'](_0x66d3('0x54'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x6d')]);router[_0x66d3('0x6a')](_0x66d3('0x56'),auth[_0x66d3('0xc')](),controller['removeFaxInteractions']);router['delete']('/:id/sms_interactions',auth[_0x66d3('0xc')](),controller[_0x66d3('0x6e')]);router[_0x66d3('0x6a')](_0x66d3('0x59'),auth['isAuthenticated'](),controller[_0x66d3('0x6f')]);router['delete'](_0x66d3('0x5b'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x70')]);router[_0x66d3('0x6a')](_0x66d3('0x30'),auth['isAuthenticated'](),controller[_0x66d3('0x71')]);router['delete'](_0x66d3('0x5e'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x72')]);router[_0x66d3('0x6a')](_0x66d3('0x33'),auth[_0x66d3('0xc')](),controller['removeOpenchannelAccounts']);router[_0x66d3('0x6a')](_0x66d3('0x35'),auth[_0x66d3('0xc')](),controller['removeSmsAccounts']);router[_0x66d3('0x6a')](_0x66d3('0x37'),auth['isAuthenticated'](),controller[_0x66d3('0x73')]);router[_0x66d3('0x6a')](_0x66d3('0x38'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x74')]);router[_0x66d3('0x6a')](_0x66d3('0x3a'),auth[_0x66d3('0xc')](),controller['removeSquareProjects']);router[_0x66d3('0x6a')](_0x66d3('0x64'),auth[_0x66d3('0xc')](),controller[_0x66d3('0x75')]);module[_0x66d3('0x76')]=router; \ No newline at end of file +var _0xf45d=['getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','post','bulkCreate','addQueues','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','destroy','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','/whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions'];(function(_0x5b4176,_0x49dedf){var _0x56d824=function(_0x5e99aa){while(--_0x5e99aa){_0x5b4176['push'](_0x5b4176['shift']());}};_0x56d824(++_0x49dedf);}(_0xf45d,0xcb));var _0xdf45=function(_0x23a4fe,_0x35be9a){_0x23a4fe=_0x23a4fe-0x0;var _0x19aa1f=_0xf45d[_0x23a4fe];return _0x19aa1f;};'use strict';var multer=require(_0xdf45('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf45('0x1'));var express=require(_0xdf45('0x2'));var router=express[_0xdf45('0x3')]();var fs_extra=require(_0xdf45('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdf45('0x5'));var config=require(_0xdf45('0x6'));var controller=require(_0xdf45('0x7'));router[_0xdf45('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf45('0x8')](_0xdf45('0x9'),auth[_0xdf45('0xa')](),controller['describe']);router['get'](_0xdf45('0xb'),auth[_0xdf45('0xa')](),controller['whoami']);router[_0xdf45('0x8')](_0xdf45('0xc'),auth[_0xdf45('0xa')](),controller[_0xdf45('0xd')]);router[_0xdf45('0x8')](_0xdf45('0xe'),auth[_0xdf45('0xa')](),controller[_0xdf45('0xf')]);router[_0xdf45('0x8')]('/:id/avatar',controller[_0xdf45('0x10')]);router['get'](_0xdf45('0x11'),auth[_0xdf45('0xa')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0xdf45('0xa')](),controller[_0xdf45('0x12')]);router['get'](_0xdf45('0x13'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x14')]);router[_0xdf45('0x8')](_0xdf45('0x15'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x16')]);router[_0xdf45('0x8')](_0xdf45('0x17'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x18')]);router['get'](_0xdf45('0x19'),auth['isAuthenticated'](),controller['getRecordings']);router[_0xdf45('0x8')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xdf45('0x1a')]);router[_0xdf45('0x8')](_0xdf45('0x1b'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x1c')]);router[_0xdf45('0x8')]('/:id/openchannel/interactions',auth[_0xdf45('0xa')](),controller['getOpenchannelInteractions']);router[_0xdf45('0x8')]('/:id/mail/interactions',auth[_0xdf45('0xa')](),controller[_0xdf45('0x1d')]);router[_0xdf45('0x8')](_0xdf45('0x1e'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x1f')]);router[_0xdf45('0x8')](_0xdf45('0x20'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x21')]);router['get'](_0xdf45('0x22'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x23')]);router[_0xdf45('0x8')]('/:id/teams',auth[_0xdf45('0xa')](),controller[_0xdf45('0x24')]);router['get']('/:id/lists',auth[_0xdf45('0xa')](),controller[_0xdf45('0x25')]);router['get'](_0xdf45('0x26'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x27')]);router[_0xdf45('0x8')](_0xdf45('0x28'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x29')]);router[_0xdf45('0x8')](_0xdf45('0x2a'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x2b')]);router[_0xdf45('0x8')](_0xdf45('0x2c'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xdf45('0x8')](_0xdf45('0x2d'),auth[_0xdf45('0xa')](),controller['getOpenchannelAccounts']);router[_0xdf45('0x8')](_0xdf45('0x2e'),auth[_0xdf45('0xa')](),controller['getSmsAccounts']);router[_0xdf45('0x8')](_0xdf45('0x2f'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x30')]);router['get']('/:id/whatsapp_accounts',auth[_0xdf45('0xa')](),controller[_0xdf45('0x31')]);router[_0xdf45('0x8')](_0xdf45('0x32'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x33')]);router[_0xdf45('0x8')](_0xdf45('0x34'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x35')]);router['get'](_0xdf45('0x36'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x37')]);router['post'](_0xdf45('0x38'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0xdf45('0xa')](),controller['create']);router[_0xdf45('0x39')]('/create_many',auth['isAuthenticated'](),controller[_0xdf45('0x3a')]);router[_0xdf45('0x39')](_0xdf45('0x13'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e5664,_0x3669e0,_0x2fbf26){_0x2fbf26(null,path['join'](config[_0xdf45('0x3c')],_0xdf45('0x3d')));},'filename':function(_0x59d622,_0x11024c,_0xb6b790){_0xb6b790(null,util[_0xdf45('0x3e')](_0xdf45('0x3f'),Date[_0xdf45('0x40')](),_0x11024c[_0xdf45('0x41')]));}})});router[_0xdf45('0x39')](_0xdf45('0x42'),upload['single'](_0xdf45('0x43')),controller[_0xdf45('0x44')]);router[_0xdf45('0x39')](_0xdf45('0x45'),auth['isAuthenticated'](),controller[_0xdf45('0x46')]);router[_0xdf45('0x39')](_0xdf45('0x47'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x48')]);router[_0xdf45('0x39')](_0xdf45('0x49'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x4a')]);router[_0xdf45('0x39')](_0xdf45('0x4b'),auth[_0xdf45('0xa')](),controller['unpause']);router[_0xdf45('0x39')](_0xdf45('0x4c'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x4d')]);router[_0xdf45('0x39')](_0xdf45('0x4e'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x4f')]);router[_0xdf45('0x39')](_0xdf45('0x50'),auth['isAuthenticated'](),controller[_0xdf45('0x51')]);router[_0xdf45('0x39')]('/:id/fax_interactions',auth[_0xdf45('0xa')](),controller[_0xdf45('0x52')]);router[_0xdf45('0x39')](_0xdf45('0x53'),auth['isAuthenticated'](),controller[_0xdf45('0x54')]);router[_0xdf45('0x39')](_0xdf45('0x55'),auth['isAuthenticated'](),controller[_0xdf45('0x56')]);router[_0xdf45('0x39')](_0xdf45('0x57'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x58')]);router['post'](_0xdf45('0x2a'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x59')]);router[_0xdf45('0x39')](_0xdf45('0x2c'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x5a')]);router['post'](_0xdf45('0x2d'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x5b')]);router[_0xdf45('0x39')](_0xdf45('0x2e'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x5c')]);router[_0xdf45('0x39')](_0xdf45('0x2f'),auth['isAuthenticated'](),controller[_0xdf45('0x5d')]);router[_0xdf45('0x39')]('/:id/whatsapp_accounts',auth[_0xdf45('0xa')](),controller[_0xdf45('0x5e')]);router['post'](_0xdf45('0x32'),auth['isAuthenticated'](),controller[_0xdf45('0x5f')]);router[_0xdf45('0x39')](_0xdf45('0x36'),auth['isAuthenticated'](),controller[_0xdf45('0x60')]);router[_0xdf45('0x61')](_0xdf45('0xe'),auth['isAuthenticated'](),controller[_0xdf45('0x62')]);router[_0xdf45('0x61')](_0xdf45('0x63'),auth['isAuthenticated'](),controller[_0xdf45('0x64')]);router['delete'](_0xdf45('0x13'),auth['isAuthenticated'](),controller[_0xdf45('0x65')]);router[_0xdf45('0x66')](_0xdf45('0x4c'),auth[_0xdf45('0xa')](),controller['removeTeams']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdf45('0x67')]);router[_0xdf45('0x66')](_0xdf45('0x4e'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0xdf45('0x66')](_0xdf45('0x50'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x68')]);router[_0xdf45('0x66')](_0xdf45('0x69'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x6a')]);router['delete'](_0xdf45('0x53'),auth['isAuthenticated'](),controller[_0xdf45('0x6b')]);router[_0xdf45('0x66')](_0xdf45('0x55'),auth['isAuthenticated'](),controller[_0xdf45('0x6c')]);router[_0xdf45('0x66')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0xdf45('0x6d')]);router[_0xdf45('0x66')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xdf45('0x6e')]);router[_0xdf45('0x66')](_0xdf45('0x2c'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x6f')]);router[_0xdf45('0x66')](_0xdf45('0x2d'),auth['isAuthenticated'](),controller[_0xdf45('0x70')]);router[_0xdf45('0x66')](_0xdf45('0x2e'),auth[_0xdf45('0xa')](),controller['removeSmsAccounts']);router[_0xdf45('0x66')]('/:id/chat_websites',auth[_0xdf45('0xa')](),controller[_0xdf45('0x71')]);router['delete'](_0xdf45('0x72'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x73')]);router['delete'](_0xdf45('0x32'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x74')]);router[_0xdf45('0x66')](_0xdf45('0x36'),auth['isAuthenticated'](),controller[_0xdf45('0x75')]);module[_0xdf45('0x76')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4c39aa9..81fad5c 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(_0x36fe15,_0x31c21e){var _0xbb9d82=function(_0x711861){while(--_0x711861){_0x36fe15['push'](_0x36fe15['shift']());}};_0xbb9d82(++_0x31c21e);}(_0xedd9,0xfc));var _0x9edd=function(_0x493c63,_0x2c7f1f){_0x493c63=_0x493c63-0x0;var _0x2d5330=_0xedd9[_0x493c63];return _0x2d5330;};'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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x14457b,_0x55cb3d){var _0x4a9ed8=function(_0x2bbbf0){while(--_0x2bbbf0){_0x14457b['push'](_0x14457b['shift']());}};_0x4a9ed8(++_0x55cb3d);}(_0xe706,0xa3));var _0x6e70=function(_0x52a45c,_0x331b52){_0x52a45c=_0x52a45c-0x0;var _0x4ac4be=_0xe706[_0x52a45c];return _0x4ac4be;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'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 b22e9af..bbe7bc8 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 _0xe284=['$not','$between','$notBetween','$in','$like','$iLike','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','getUserSetting','getPresence','teams','queues','inbound','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','bluebird','util','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','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','json','offset','undefined','count','set','Content-Range','update','destroy','get','admin','Users','Agents','agent','telephone','map','value','includes','role','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','filter','salt','getOptions','User','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','length','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','options','openTabs','chat','sms','body','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','password','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)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','113','110','104','105','106','107','108','109','100','111','114','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Telephones','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','autoAssociation','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','spread','toLowerCase','QueueId','emit','Queue:save','VoiceQueue','voice','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','remove','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','existsSync','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','findOne','CmContact','order','sort','where','merge','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','limit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','pick','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','intrf','user:%s','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','%s%s','Pause','Team','getTeams','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','transaction','Voice','getDataValue','TeamVoicePrefix','VoicePrefixId','removeTeams','Fax','flatten','removeAgent','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$gt','$gte','$lt','$lte','$ne','$eq'];(function(_0x5247ef,_0x565f44){var _0x34c207=function(_0x8f6fed){while(--_0x8f6fed){_0x5247ef['push'](_0x5247ef['shift']());}};_0x34c207(++_0x565f44);}(_0xe284,0x1df));var _0x4e28=function(_0x3c729b,_0x2a4146){_0x3c729b=_0x3c729b-0x0;var _0x55894c=_0xe284[_0x3c729b];return _0x55894c;};'use strict';var moment=require('moment');var BPromise=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var path=require(_0x4e28('0x2'));var fs=require('fs');var _=require(_0x4e28('0x3'));var squel=require('squel');var jayson=require(_0x4e28('0x4'));var Redis=require(_0x4e28('0x5'));var authService=require(_0x4e28('0x6'));var qs=require(_0x4e28('0x7'));var logger=require(_0x4e28('0x8'))(_0x4e28('0x9'));var utils=require('../../config/utils');var config=require(_0x4e28('0xa'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e28('0xb'))['db'];var socket=require(_0x4e28('0xc'))(new Redis(config[_0x4e28('0xd')]));require(_0x4e28('0xe'))[_0x4e28('0xf')](socket);config[_0x4e28('0xd')]=_[_0x4e28('0x10')](config['redis'],{'host':_0x4e28('0x11'),'port':0x18eb});var client=jayson[_0x4e28('0x12')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x35844d,_0x41dab1,_0xd100b,_0x3dec8c){return new BPromise(function(_0x388f19,_0x1b330c){var _0x2a87cd=_0x3dec8c||client;return _0x2a87cd[_0x4e28('0x13')](_0x35844d,_0xd100b)[_0x4e28('0x14')](function(_0x3e05b4){logger[_0x4e28('0x15')](_0x4e28('0x16'),_0x41dab1,_0x4e28('0x17'));logger[_0x4e28('0x18')](_0x4e28('0x19'),_0x41dab1,'request\x20sent',JSON[_0x4e28('0x1a')](_0x3e05b4));if(_0x3e05b4[_0x4e28('0x1b')]){if(_0x3e05b4[_0x4e28('0x1b')][_0x4e28('0x1c')]===0x1f4){logger[_0x4e28('0x1b')](_0x4e28('0x16'),_0x41dab1,_0x3e05b4[_0x4e28('0x1b')]['message']);return _0x1b330c(_0x3e05b4[_0x4e28('0x1b')]['message']);}logger['error']('User,\x20%s,\x20%s',_0x41dab1,_0x3e05b4['error'][_0x4e28('0x1d')]);return _0x388f19(_0x3e05b4[_0x4e28('0x1b')][_0x4e28('0x1d')]);}else{logger[_0x4e28('0x15')]('User,\x20%s,\x20%s',_0x41dab1,'request\x20sent');_0x388f19(_0x3e05b4[_0x4e28('0x1e')][_0x4e28('0x1d')]);}})[_0x4e28('0x1f')](function(_0x54119d){logger[_0x4e28('0x1b')](_0x4e28('0x16'),_0x41dab1,_0x54119d);_0x1b330c(_0x54119d);});});}function respondWithStatusCode(_0x28fe14,_0xcaec43){_0xcaec43=_0xcaec43||0xcc;return function(_0x249c90){if(_0x249c90){return _0x28fe14[_0x4e28('0x20')](_0xcaec43);}return _0x28fe14[_0x4e28('0x21')](_0xcaec43)[_0x4e28('0x22')]();};}function respondWithResult(_0x33def0,_0x553624){_0x553624=_0x553624||0xc8;return function(_0x572c8d){if(_0x572c8d){return _0x33def0[_0x4e28('0x21')](_0x553624)[_0x4e28('0x23')](_0x572c8d);}};}function respondWithFilteredResult(_0x5e6386,_0x4c5bec){return function(_0x163990){if(_0x163990){var _0x5eeab0=typeof _0x4c5bec[_0x4e28('0x24')]==='undefined'&&typeof _0x4c5bec['limit']===_0x4e28('0x25');var _0x100c90=_0x163990['count'];var _0x482e5a=_0x5eeab0?0x0:_0x4c5bec[_0x4e28('0x24')];var _0x54062d=_0x5eeab0?_0x163990[_0x4e28('0x26')]:_0x4c5bec['offset']+_0x4c5bec['limit'];var _0x128b34;if(_0x54062d>=_0x100c90){_0x54062d=_0x100c90;_0x128b34=0xc8;}else{_0x128b34=0xce;}_0x5e6386[_0x4e28('0x21')](_0x128b34);return _0x5e6386[_0x4e28('0x27')](_0x4e28('0x28'),_0x482e5a+'-'+_0x54062d+'/'+_0x100c90)['json'](_0x163990);}return null;};}function saveUpdates(_0xb7c01e){return function(_0x320dab){if(_0x320dab){return _0x320dab[_0x4e28('0x29')](_0xb7c01e)[_0x4e28('0x14')](function(_0x29d1ab){return _0x29d1ab;});}return null;};}function removeEntity(_0x109a55){return function(_0x18ad99){if(_0x18ad99){return _0x18ad99[_0x4e28('0x2a')]()[_0x4e28('0x14')](function(){var _0x39f7df=_0x18ad99[_0x4e28('0x2b')]({'plain':!![]});if(_0x39f7df['role']===_0x4e28('0x2c'))return;var _0x1a3c6d=[{'name':_0x4e28('0x2d'),'value':'user','ignore':!![]},{'name':_0x4e28('0x2e'),'value':_0x4e28('0x2f'),'ignore':![]},{'name':'Telephones','value':_0x4e28('0x30'),'ignore':![]}];var _0x4b343b=_(_0x1a3c6d)['filter']('ignore')[_0x4e28('0x31')](_0x4e28('0x32'))['value']();if(_[_0x4e28('0x33')](_0x4b343b,_0x39f7df[_0x4e28('0x34')])){return;}var _0x2ad774=_[_0x4e28('0x35')](_0x1a3c6d,[_0x4e28('0x32'),_0x39f7df[_0x4e28('0x34')]])['name'];return db[_0x4e28('0x36')][_0x4e28('0x2a')]({'where':{'type':_0x2ad774,'resourceId':_0x39f7df['id']}})[_0x4e28('0x14')](function(){return _0x18ad99;});})[_0x4e28('0x14')](function(){_0x109a55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x120edb){return function(_0x3f2dfa){if(!_0x3f2dfa){_0x120edb[_0x4e28('0x20')](0x194);}return _0x3f2dfa;};}function handleError(_0x580840,_0x43c1aa){_0x43c1aa=_0x43c1aa||0x1f4;return function(_0xeb50e2){logger[_0x4e28('0x1b')](_0xeb50e2[_0x4e28('0x37')]);if(_0xeb50e2[_0x4e28('0x38')]){delete _0xeb50e2[_0x4e28('0x38')];}_0x580840[_0x4e28('0x21')](_0x43c1aa)[_0x4e28('0x39')](_0xeb50e2);};}exports[_0x4e28('0x3a')]=function(_0x571132,_0x500c49){var _0x21fc6f={},_0x2db8cb={'count':0x0,'rows':[]};var _0x1f2aba=_(db['User'][_0x4e28('0x3b')])[_0x4e28('0x31')](function(_0x51f4c3){return{'name':_0x51f4c3[_0x4e28('0x3c')],'type':_0x51f4c3[_0x4e28('0x3d')][_0x4e28('0x3e')]};})[_0x4e28('0x3f')](function(_0x3f9462){return!_['includes'](['password',_0x4e28('0x40')],_0x3f9462[_0x4e28('0x38')]);})[_0x4e28('0x32')]();_0x21fc6f=qs[_0x4e28('0x41')](_0x1f2aba,_0x571132);var _0x528d88={'where':_0x21fc6f['where']};return db[_0x4e28('0x42')][_0x4e28('0x26')](_0x528d88)[_0x4e28('0x14')](function(_0x1c0989){_0x2db8cb['count']=_0x1c0989;if(_0x571132[_0x4e28('0x43')][_0x4e28('0x44')]){_0x21fc6f[_0x4e28('0x45')]=[{'all':!![]}];}if(_0x571132[_0x4e28('0x43')][_0x4e28('0x46')]===_0x4e28('0x47')){_0x21fc6f[_0x4e28('0x45')]=[{'model':db[_0x4e28('0x48')],'as':_0x4e28('0x46')}];}if(!_[_0x4e28('0x33')](_0x21fc6f[_0x4e28('0x49')],'id')){_0x21fc6f[_0x4e28('0x49')][_0x4e28('0x4a')]('id');}return db[_0x4e28('0x42')][_0x4e28('0x4b')](_0x21fc6f);})[_0x4e28('0x14')](function(_0xcc9a1c){_0x2db8cb[_0x4e28('0x4c')]=_0xcc9a1c;if(_0x571132[_0x4e28('0x43')]['openTabs']===_0x4e28('0x47')){var _0x26c466=[];for(var _0x3b695d=0x0;_0x3b695d<_0x2db8cb['rows'][_0x4e28('0x4d')];_0x3b695d++){_0x26c466['push'](get_open_tabs('chat',_0x2db8cb[_0x4e28('0x4c')][_0x3b695d][_0x4e28('0x4e')]));_0x26c466[_0x4e28('0x4a')](get_open_tabs('sms',_0x2db8cb[_0x4e28('0x4c')][_0x3b695d][_0x4e28('0x4e')]));_0x26c466[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x4f'),_0x2db8cb['rows'][_0x3b695d]['dataValues']));_0x26c466['push'](get_open_tabs(_0x4e28('0x50'),_0x2db8cb['rows'][_0x3b695d][_0x4e28('0x4e')]));_0x26c466['push'](get_open_tabs(_0x4e28('0x51'),_0x2db8cb['rows'][_0x3b695d]['dataValues']));_0x26c466[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x52'),_0x2db8cb[_0x4e28('0x4c')][_0x3b695d]['dataValues']));}return BPromise[_0x4e28('0x53')](_0x26c466)[_0x4e28('0x14')](function(){return _0x2db8cb;});}else{return _0x2db8cb;}})[_0x4e28('0x14')](respondWithFilteredResult(_0x500c49,_0x21fc6f))[_0x4e28('0x1f')](handleError(_0x500c49,null));};exports[_0x4e28('0x54')]=function(_0x181fca,_0x15c6ab){var _0x313073={'raw':![],'where':{'id':_0x181fca[_0x4e28('0x55')]['id']}},_0x5c29c5={};_0x5c29c5[_0x4e28('0x56')]=_[_0x4e28('0x57')](_[_0x4e28('0x58')](db['User'][_0x4e28('0x3b')]),['password',_0x4e28('0x40')]);_0x5c29c5['query']=_[_0x4e28('0x58')](_0x181fca['query']);_0x5c29c5[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x5c29c5[_0x4e28('0x56')],_0x5c29c5[_0x4e28('0x43')]);_0x313073[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x5c29c5['model'],qs[_0x4e28('0x5b')](_0x181fca[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x313073[_0x4e28('0x49')]=_0x313073[_0x4e28('0x49')]['length']?_0x313073[_0x4e28('0x49')]:_0x5c29c5[_0x4e28('0x56')];if(_0x181fca[_0x4e28('0x43')][_0x4e28('0x44')]){_0x313073['include']=[{'all':!![]}];}if(_0x181fca[_0x4e28('0x43')]['userSetting']===_0x4e28('0x47')){_0x313073[_0x4e28('0x45')]=[{'model':db[_0x4e28('0x48')],'as':_0x4e28('0x46')}];}_0x313073=_['merge']({},_0x313073,_0x181fca[_0x4e28('0x5c')]);if(!_[_0x4e28('0x33')](_0x313073[_0x4e28('0x49')],'id')){_0x313073[_0x4e28('0x49')][_0x4e28('0x4a')]('id');}return db[_0x4e28('0x42')][_0x4e28('0x35')](_0x313073)[_0x4e28('0x14')](handleEntityNotFound(_0x15c6ab,null))['then'](function(_0x317561){var _0x263f45=[];values=_0x317561;if(_0x181fca[_0x4e28('0x43')][_0x4e28('0x5d')]===_0x4e28('0x47')){_0x263f45[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x5e'),_0x317561[_0x4e28('0x4e')]));_0x263f45['push'](get_open_tabs(_0x4e28('0x5f'),_0x317561[_0x4e28('0x4e')]));_0x263f45[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x51'),_0x317561[_0x4e28('0x4e')]));_0x263f45[_0x4e28('0x4a')](get_open_tabs('whatsapp',_0x317561[_0x4e28('0x4e')]));_0x263f45[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x4f'),_0x317561[_0x4e28('0x4e')]));_0x263f45[_0x4e28('0x4a')](get_open_tabs('mail',_0x317561[_0x4e28('0x4e')]));return BPromise[_0x4e28('0x53')](_0x263f45);}else{return values;}})[_0x4e28('0x14')](function(){return values;})[_0x4e28('0x14')](respondWithResult(_0x15c6ab,null))[_0x4e28('0x1f')](handleError(_0x15c6ab,null));};exports[_0x4e28('0x29')]=function(_0x251458,_0x206ff1){if(_0x251458[_0x4e28('0x60')]['id']){delete _0x251458[_0x4e28('0x60')]['id'];}delete _0x251458[_0x4e28('0x60')][_0x4e28('0x34')];return db['User'][_0x4e28('0x35')]({'where':{'id':_0x251458[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x206ff1,null))['then'](saveUpdates(_0x251458[_0x4e28('0x60')],null))[_0x4e28('0x14')](respondWithResult(_0x206ff1,null))[_0x4e28('0x1f')](handleError(_0x206ff1,null));};exports['describe']=function(_0xac8815,_0x172e12){return db[_0x4e28('0x42')]['describe']()['then'](respondWithResult(_0x172e12,null))[_0x4e28('0x1f')](handleError(_0x172e12,null));};exports[_0x4e28('0x61')]=function(_0x48b14a,_0x4982eb){return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0x48b14a[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x4982eb,null))['then'](function(_0x1501b0){if(_0x1501b0){return _0x1501b0[_0x4e28('0x61')](_0x48b14a[_0x4e28('0x60')][_0x4e28('0x62')],_[_0x4e28('0x63')](_0x48b14a[_0x4e28('0x60')],[_0x4e28('0x62'),'id'])||{});}})[_0x4e28('0x14')](respondWithResult(_0x4982eb,null))[_0x4e28('0x1f')](handleError(_0x4982eb,null));};function validateUser(_0x20c2bb){return new BPromise(function(_0x187999,_0x2eef25){if(_0x20c2bb[_0x4e28('0x64')])return _0x187999(_0x20c2bb);return db[_0x4e28('0x65')][_0x4e28('0x66')](0x1)[_0x4e28('0x14')](function(_0xbf0df9){if(_0xbf0df9[_0x4e28('0x67')])authService[_0x4e28('0x68')](_0x20c2bb[_0x4e28('0x69')]);db[_0x4e28('0x42')][_0x4e28('0x6a')](_0x4e28('0x64'))[_0x4e28('0x14')](function(_0x5e58a4){if(_[_0x4e28('0x6b')](_0x5e58a4)){_0x20c2bb['internal']=_0xbf0df9[_0x4e28('0x6c')]||0x1;return;}if(_[_0x4e28('0x6b')](_0xbf0df9[_0x4e28('0x6c')])||_0xbf0df9[_0x4e28('0x6c')]===_0x5e58a4){_0x20c2bb[_0x4e28('0x64')]=_0x5e58a4+0x1;return;}if(_0xbf0df9['min_internal']>_0x5e58a4){_0x20c2bb['internal']=_0xbf0df9[_0x4e28('0x6c')];return;}return db[_0x4e28('0x6d')][_0x4e28('0x43')](_0x4e28('0x6e'),{'type':db[_0x4e28('0x6d')][_0x4e28('0x6f')]['SELECT']})[_0x4e28('0x14')](function(_0x18964d){if(_0x18964d&&_0x18964d[_0x4e28('0x4d')]){for(var _0x216968=0x0,_0x47d83e=_0x18964d[_0x4e28('0x4d')];_0x216968<_0x47d83e&&_['isNil'](_0x20c2bb[_0x4e28('0x64')]);_0x216968++){if(_0xbf0df9[_0x4e28('0x6c')]<=_0x18964d[_0x216968]['from']){_0x20c2bb['internal']=_0x18964d[_0x216968][_0x4e28('0x70')];}else if(_0xbf0df9['min_internal']>_0x18964d[_0x216968][_0x4e28('0x70')]&&_0xbf0df9[_0x4e28('0x6c')]<=_0x18964d[_0x216968]['to']){_0x20c2bb[_0x4e28('0x64')]=_0xbf0df9[_0x4e28('0x6c')];}}}if(_[_0x4e28('0x6b')](_0x20c2bb[_0x4e28('0x64')])){_0x20c2bb[_0x4e28('0x64')]=_0x5e58a4+0x1;}return _0x187999(_0x20c2bb);});});})[_0x4e28('0x1f')](function(_0x4435d7){_0x2eef25(_0x4435d7);});});}function updateUser(_0x2c013a){return new BPromise(function(_0x15ad1a,_0x2033f7){try{if(_0x2c013a[_0x4e28('0x71')]){_0x2c013a[_0x4e28('0x72')]=_0x2c013a['internal'];_0x2c013a[_0x4e28('0x73')]={'mailbox':_0x2c013a[_0x4e28('0x64')],'password':_0x2c013a[_0x4e28('0x69')],'fullname':_0x2c013a[_0x4e28('0x74')],'email':_0x2c013a['email']};}if(_0x2c013a[_0x4e28('0x34')]==='agent'){if(!_0x2c013a[_0x4e28('0x75')])_0x2c013a[_0x4e28('0x75')]=[_0x4e28('0x76'),_0x4e28('0x77'),'103',_0x4e28('0x78'),_0x4e28('0x79'),_0x4e28('0x7a'),_0x4e28('0x7b'),_0x4e28('0x7c'),_0x4e28('0x7d'),_0x4e28('0x7e'),_0x4e28('0x7f'),_0x4e28('0x80'),_0x4e28('0x81'),_0x4e28('0x82'),'115'];}_0x15ad1a(_0x2c013a);}catch(_0x1bbc53){_0x2033f7(_0x1bbc53);}});}exports[_0x4e28('0x83')]=function(_0x5c9d2e,_0x2e4856){if(_0x5c9d2e['user']['role']===_0x4e28('0x2f'))throw new Error('Unauthorized');if(_0x5c9d2e[_0x4e28('0x60')][_0x4e28('0x34')]===_0x4e28('0x84')&&_0x5c9d2e['user']['role']!=='admin'){throw new Error(_0x4e28('0x85'));}if(_0x5c9d2e[_0x4e28('0x60')][_0x4e28('0x34')]===_0x4e28('0x2c')&&_0x5c9d2e[_0x4e28('0x84')][_0x4e28('0x34')]!==_0x4e28('0x2c')){throw new Error(_0x4e28('0x86'));}return licenseUtil[_0x4e28('0x87')]([_0x5c9d2e[_0x4e28('0x60')]])[_0x4e28('0x14')](function(){return validateUser(_0x5c9d2e['body']);})['then'](function(_0x504b09){return updateUser(_0x504b09)['then'](function(_0x3ff91b){if(_0x3ff91b[_0x4e28('0x34')]===_0x4e28('0x2c')){_0x3ff91b[_0x4e28('0x88')]=_0x5c9d2e['user']['settingsEnabled'];delete _0x3ff91b[_0x4e28('0x89')];}return _0x3ff91b;});})[_0x4e28('0x14')](function(_0x445b32){return db[_0x4e28('0x42')][_0x4e28('0x83')](_0x445b32,{'include':[{'model':db[_0x4e28('0x73')],'as':_0x4e28('0x73')}]});})['then'](function(_0x4762e2){if(_0x5c9d2e[_0x4e28('0x60')]['role']===_0x4e28('0x84'))return _0x4762e2;if(_0x5c9d2e[_0x4e28('0x84')][_0x4e28('0x34')]!=='user')return _0x4762e2;return db[_0x4e28('0x8a')][_0x4e28('0x35')]({'where':{'name':_0x4762e2['role']===_0x4e28('0x2f')?_0x4e28('0x2e'):_0x4e28('0x8b'),'userProfileId':_0x5c9d2e[_0x4e28('0x84')][_0x4e28('0x89')]},'raw':!![]})[_0x4e28('0x14')](function(_0x4191a2){if(!_0x4191a2||_0x4191a2['autoAssociation']!=0x0)return _0x4762e2;return db[_0x4e28('0x36')]['create']({'name':_0x4762e2['name'],'resourceId':_0x4762e2['id'],'type':_0x4191a2[_0x4e28('0x38')],'sectionId':_0x4191a2['id']},{})[_0x4e28('0x14')](function(){return _0x4762e2;});})[_0x4e28('0x1f')](function(_0x39b57c){logger[_0x4e28('0x1b')](_0x4e28('0x8c'),_0x39b57c);throw _0x39b57c;});})[_0x4e28('0x14')](respondWithResult(_0x2e4856,0xc9))[_0x4e28('0x1f')](handleError(_0x2e4856,null));};exports[_0x4e28('0x8d')]=function(_0x345001,_0x5817c1){var _0x134512=_0x345001[_0x4e28('0x60')];var _0x35ff3c=[];if(_0x345001[_0x4e28('0x84')][_0x4e28('0x34')]===_0x4e28('0x2f'))throw new Error(_0x4e28('0x8e'));if(_[_0x4e28('0x8f')](_0x134512,[_0x4e28('0x34'),_0x4e28('0x84')])&&_0x345001[_0x4e28('0x84')][_0x4e28('0x34')]!==_0x4e28('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x4e28('0x8f')](_0x134512,['role','admin'])&&_0x345001[_0x4e28('0x84')][_0x4e28('0x34')]!=='admin'){throw new Error(_0x4e28('0x90'));}return licenseUtil[_0x4e28('0x87')](_0x134512)['then'](function(){return validateUser(_0x134512[0x0]);})[_0x4e28('0x14')](function(){for(var _0xd35e1=0x1;_0xd35e1<_0x134512['length'];_0xd35e1++){var _0x332366=_0x134512[_0xd35e1-0x1][_0x4e28('0x64')];if(!_0x134512[_0xd35e1]['internal'])_0x134512[_0xd35e1][_0x4e28('0x64')]=_0x332366+0x1;_0x35ff3c[_0x4e28('0x4a')](validateUser(_0x134512[_0xd35e1]));}return BPromise[_0x4e28('0x53')](_0x35ff3c);})[_0x4e28('0x14')](function(){_0x35ff3c=[];for(var _0x2953e9=0x0;_0x2953e9<_0x134512[_0x4e28('0x4d')];_0x2953e9++){_0x35ff3c[_0x4e28('0x4a')](updateUser(_0x134512[_0x2953e9]));}return BPromise[_0x4e28('0x53')](_0x35ff3c);})[_0x4e28('0x14')](function(){return BPromise[_0x4e28('0x91')](_0x134512,function(_0x46799e){return db[_0x4e28('0x42')]['create'](_0x46799e,{'include':[{'model':db[_0x4e28('0x73')],'as':_0x4e28('0x73')}]})['then'](function(_0x434b19){_0x46799e['id']=_0x434b19['id'];return _0x46799e;});});})[_0x4e28('0x14')](function(_0x31a0c2){if(_0x345001[_0x4e28('0x60')][_0x4e28('0x34')]===_0x4e28('0x84'))return _0x31a0c2;if(_0x345001[_0x4e28('0x84')]['role']!==_0x4e28('0x84'))return _0x31a0c2;var _0x1d4407=_[_0x4e28('0x8f')](_0x31a0c2,function(_0x202284){return _0x202284[_0x4e28('0x34')]===_0x4e28('0x2f')||_0x202284[_0x4e28('0x34')]===_0x4e28('0x30');});if(!_0x1d4407)return _0x31a0c2;return db[_0x4e28('0x8a')][_0x4e28('0x4b')]({'where':{'name':{'$or':[_0x4e28('0x2e'),_0x4e28('0x8b')]},'userProfileId':_0x345001[_0x4e28('0x84')][_0x4e28('0x89')]},'raw':!![]})[_0x4e28('0x14')](function(_0x8eecfa){if(_[_0x4e28('0x92')](_0x8eecfa)||!_[_0x4e28('0x8f')](_0x8eecfa,[_0x4e28('0x93'),0x0]))return _0x31a0c2;_0x35ff3c=[];var _0x1a3924=_(_0x8eecfa)[_0x4e28('0x31')](function(_0x53e547){if(_0x53e547[_0x4e28('0x93')]===0x1)return;return _0x53e547[_0x4e28('0x38')]===_0x4e28('0x2e')?_0x4e28('0x2f'):'telephone';})[_0x4e28('0x94')]()['value']();for(var _0xc16710=0x0;_0xc16710<_0x31a0c2['length'];_0xc16710++){if(!_['includes'](_0x1a3924,_0x31a0c2[_0xc16710][_0x4e28('0x34')]))return;var _0x198d35=_0x31a0c2[_0xc16710]['role']===_0x4e28('0x2f')?_0x4e28('0x2e'):_0x4e28('0x8b');_0x35ff3c[_0x4e28('0x4a')](db[_0x4e28('0x36')][_0x4e28('0x83')]({'name':_0x31a0c2[_0xc16710][_0x4e28('0x38')],'resourceId':_0x31a0c2[_0xc16710]['id'],'type':_0x198d35,'sectionId':_['find'](_0x8eecfa,[_0x4e28('0x38'),_0x198d35])['id']},{}));}return BPromise['all'](_0x35ff3c);});})[_0x4e28('0x14')](respondWithResult(_0x5817c1,0xc9))[_0x4e28('0x1f')](handleError(_0x5817c1,null));};exports[_0x4e28('0x95')]=function(_0xe38f26,_0x28d5d4){if(_0xe38f26[_0x4e28('0x60')]['id']){delete _0xe38f26[_0x4e28('0x60')]['id'];}return db[_0x4e28('0x42')]['find']({'where':{'id':_0xe38f26[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](function(_0x2bc4aa){if(!_0x2bc4aa)return null;if(_0x2bc4aa['id']===_0xe38f26[_0x4e28('0x84')]['id']){if(!_0xe38f26[_0x4e28('0x60')][_0x4e28('0x96')]||!_0xe38f26['body']['newPassword']){throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0x99'));}if(!_0x2bc4aa[_0x4e28('0x9a')](_0xe38f26[_0x4e28('0x60')][_0x4e28('0x96')])){throw new db['Sequelize'][(_0x4e28('0x98'))]('Wrong\x20credentials');}if(_0xe38f26[_0x4e28('0x60')][_0x4e28('0x96')]===_0xe38f26['body'][_0x4e28('0x9b')]){throw new db['Sequelize'][(_0x4e28('0x98'))](_0x4e28('0x9c'));}}else if(_0xe38f26[_0x4e28('0x84')][_0x4e28('0x34')]===_0x4e28('0x2c')){if(!_0xe38f26[_0x4e28('0x60')]['newPassword']){throw new db[(_0x4e28('0x97'))]['ValidationError'](_0x4e28('0x9d'));}}else if(_0xe38f26[_0x4e28('0x84')][_0x4e28('0x34')]==='user'){if(!_0xe38f26['body'][_0x4e28('0x9b')]){throw new db[(_0x4e28('0x97'))]['ValidationError'](_0x4e28('0x9d'));}if(_0x2bc4aa[_0x4e28('0x34')]!==_0x4e28('0x2f')){throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0x8e'));}}else{throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0x8e'));}return _0x2bc4aa;})[_0x4e28('0x14')](handleEntityNotFound(_0x28d5d4,null))['then'](function(_0x15521e){return db['Setting']['findOne']({'attributes':['id',_0x4e28('0x67'),_0x4e28('0x9e'),'passwordHistoryLimit']})[_0x4e28('0x14')](function(_0x545101){if(_0x545101[_0x4e28('0x67')])authService[_0x4e28('0x68')](_0xe38f26[_0x4e28('0x60')][_0x4e28('0x9b')]);if(!_0x545101[_0x4e28('0x9e')]||!_0x15521e['previousPasswords'])return _0x15521e;authService[_0x4e28('0x9f')](_0xe38f26[_0x4e28('0x60')][_0x4e28('0x9b')],_0x15521e[_0x4e28('0xa0')],_0x545101[_0x4e28('0xa1')]);return _0x15521e;})[_0x4e28('0x14')](saveUpdates({'password':_0xe38f26[_0x4e28('0x60')][_0x4e28('0x9b')],'passwordResetAt':_0xe38f26[_0x4e28('0x84')]['id']==_0xe38f26['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0xe38f26[_0x4e28('0x60')][_0x4e28('0x9b')],_0x15521e[_0x4e28('0xa0')])},null));})[_0x4e28('0x14')](respondWithResult(_0x28d5d4,null))[_0x4e28('0x1f')](handleError(_0x28d5d4,null));};exports['addQueues']=function(_0xa21e79,_0x3b2a75){var _0x39b4e8=_0xa21e79[_0x4e28('0x60')][_0x4e28('0xa2')];return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0xa21e79[_0x4e28('0x55')]['id']},'attributes':['id',_0x4e28('0x38'),'role',_0x4e28('0xa3'),_0x4e28('0xa4'),_0x4e28('0xa5'),_0x4e28('0xa6')]})['then'](handleEntityNotFound(_0x3b2a75,null))['then'](function(_0x44c103){if(_0x44c103){if(!utils[_0x4e28('0xa7')](_0x39b4e8)){throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0xa8'));}return _0x44c103[_0x4e28('0xa9')+_[_0x4e28('0xaa')](_0x39b4e8['toLowerCase']())+_0x4e28('0xab')](_0xa21e79[_0x4e28('0x60')]['ids'],{'penalty':_0xa21e79[_0x4e28('0x60')]['penalty']||0x0})[_0x4e28('0xac')](function(_0x7843b7){for(var _0x4121df=0x0;_0x4121df<_0xa21e79[_0x4e28('0x60')]['ids'][_0x4e28('0x4d')];_0x4121df+=0x1){var _0x60838f={'UserId':Number(_0xa21e79[_0x4e28('0x55')]['id'])};_0x60838f[_[_0x4e28('0xaa')](_0x39b4e8[_0x4e28('0xad')]())+_0x4e28('0xae')]=Number(_0xa21e79['body'][_0x4e28('0x62')][_0x4121df]);socket[_0x4e28('0xaf')](_0x4e28('0x84')+_['capitalize'](_0x39b4e8[_0x4e28('0xad')]())+_0x4e28('0xb0'),_0x60838f);}return _0x7843b7;})[_0x4e28('0x14')](function(){if(_0x39b4e8==='voice'){return db[_0x4e28('0xb1')][_0x4e28('0x4b')]({'where':{'id':_0xa21e79[_0x4e28('0x60')][_0x4e28('0x62')]||[]},'raw':!![],'attributes':['id',_0x4e28('0x38')]});}})[_0x4e28('0x14')](function(_0x237550){var _0x177412=_0x44c103['get']({'plain':!![]});var _0x39a847=[];if(_0x39b4e8===_0x4e28('0xb2')&&_0x177412[_0x4e28('0x34')]===_0x4e28('0x2f')&&_0x177412[_0x4e28('0xa3')]){for(var _0x43acdd=0x0;_0x43acdd<_0x237550['length'];_0x43acdd+=0x1){_0x39a847[_0x4e28('0x4a')]({'membername':_0x177412['name'],'UserId':_0x177412['id'],'queue_name':_0x237550[_0x43acdd][_0x4e28('0x38')],'VoiceQueueId':_0x237550[_0x43acdd]['id'],'interface':_[_0x4e28('0x6b')](_0x177412[_0x4e28('0xa6')])?util[_0x4e28('0xb3')](_0x4e28('0xb4'),_0x177412['name']):_0x177412[_0x4e28('0xa6')],'paused':_0x177412[_0x4e28('0xa5')]||![],'penalty':_0xa21e79[_0x4e28('0x60')][_0x4e28('0xb5')]||0x0});}return BPromise[_0x4e28('0x91')](_0x39a847,function(_0x309917){return db[_0x4e28('0xb6')][_0x4e28('0xb7')](_0x309917);});}return _0x44c103;});}})['then'](respondWithStatusCode(_0x3b2a75,null))['catch'](handleError(_0x3b2a75,null));};exports['removeQueues']=function(_0x683cbb,_0x29e6f0){var _0x1685a1,_0x59350f;return db[_0x4e28('0x42')]['find']({'where':{'id':_0x683cbb['params']['id']},'attributes':['id',_0x4e28('0x38'),_0x4e28('0x34')]})[_0x4e28('0x14')](handleEntityNotFound(_0x29e6f0,null))['then'](function(_0x480fe1){if(_0x480fe1){_0x1685a1=_0x480fe1;if(!_0x683cbb[_0x4e28('0x43')]['channel']||!utils[_0x4e28('0xa7')](_0x683cbb[_0x4e28('0x43')][_0x4e28('0xa2')])){throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))]('Unknown\x20channel');}return _0x480fe1[_0x4e28('0xb8')+_[_0x4e28('0xaa')](_0x683cbb[_0x4e28('0x43')][_0x4e28('0xa2')][_0x4e28('0xad')]())+_0x4e28('0xab')](_0x683cbb[_0x4e28('0x43')]['ids']);}})[_0x4e28('0x14')](function(_0x7ebb9b){if(_[_0x4e28('0xb9')](_0x683cbb[_0x4e28('0x43')][_0x4e28('0x62')])){for(var _0x41a913=0x0;_0x41a913<_0x683cbb[_0x4e28('0x43')][_0x4e28('0x62')][_0x4e28('0x4d')];_0x41a913+=0x1){_0x59350f={'UserId':Number(_0x683cbb[_0x4e28('0x55')]['id'])};_0x59350f[_[_0x4e28('0xaa')](_0x683cbb[_0x4e28('0x43')]['channel'][_0x4e28('0xad')]())+_0x4e28('0xae')]=Number(_0x683cbb[_0x4e28('0x43')]['ids'][_0x41a913]);socket[_0x4e28('0xaf')](_0x4e28('0x84')+_[_0x4e28('0xaa')](_0x683cbb[_0x4e28('0x43')][_0x4e28('0xa2')][_0x4e28('0xad')]())+_0x4e28('0xba'),_0x59350f);}}else{_0x59350f={'UserId':Number(_0x683cbb[_0x4e28('0x55')]['id'])};_0x59350f[_[_0x4e28('0xaa')](_0x683cbb['query']['channel']['toLowerCase']())+_0x4e28('0xae')]=Number(_0x683cbb[_0x4e28('0x43')][_0x4e28('0x62')]);socket[_0x4e28('0xaf')](_0x4e28('0x84')+_[_0x4e28('0xaa')](_0x683cbb['query'][_0x4e28('0xa2')][_0x4e28('0xad')]())+_0x4e28('0xba'),_0x59350f);}return _0x7ebb9b;})[_0x4e28('0x14')](function(){if(_0x683cbb[_0x4e28('0x43')][_0x4e28('0xa2')]===_0x4e28('0xb2')){return db[_0x4e28('0xb6')]['destroy']({'where':{'UserId':_0x683cbb[_0x4e28('0x55')]['id'],'VoiceQueueId':_0x683cbb[_0x4e28('0x43')]['ids']},'individualHooks':!![]})['then'](function(){return _0x1685a1;});}return _0x1685a1;})['then'](respondWithStatusCode(_0x29e6f0,null))[_0x4e28('0x1f')](handleError(_0x29e6f0,null));};exports[_0x4e28('0xbb')]=function(_0x4aac06,_0x5304f3){_0x4aac06[_0x4e28('0x60')][_0x4e28('0xbc')]=_0x4aac06[_0x4e28('0xbd')][_0x4e28('0xbe')];return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0x4aac06[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x5304f3,null))[_0x4e28('0x14')](saveUpdates(_0x4aac06[_0x4e28('0x60')],null))['then'](respondWithResult(_0x5304f3,null))[_0x4e28('0x1f')](handleError(_0x5304f3,null));};exports[_0x4e28('0xbf')]=function(_0x315241,_0x3ad729){var _0x2648f1=path[_0x4e28('0xc0')](config[_0x4e28('0xc1')],'server/files/images/logos/default_profile.png');return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0x315241['params']['id']},'attributes':['id',_0x4e28('0xbc')],'raw':!![]})[_0x4e28('0x14')](handleEntityNotFound(_0x3ad729,null))[_0x4e28('0x14')](function(_0x1847ed){if(_0x1847ed){if(_[_0x4e28('0x6b')](_0x1847ed[_0x4e28('0xbc')])){return _0x3ad729['download'](_0x2648f1);}else{if(!fs[_0x4e28('0xc2')](path['join'](config[_0x4e28('0xc1')],'server/files/images/',_0x1847ed[_0x4e28('0xbc')]))){return _0x3ad729[_0x4e28('0xc3')](_0x2648f1);}return _0x3ad729[_0x4e28('0xc3')](path[_0x4e28('0xc0')](config[_0x4e28('0xc1')],_0x4e28('0xc4'),_0x1847ed['userpic']));}}})[_0x4e28('0x1f')](handleError(_0x3ad729,null));};exports[_0x4e28('0xc5')]=function(_0x415f45,_0x536185){return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0x415f45[_0x4e28('0x55')]['id']},'attributes':['id']})[_0x4e28('0x14')](handleEntityNotFound(_0x536185,null))['then'](function(_0x5a32a8){var _0x527d9b=[];values=_0x5a32a8[_0x4e28('0x4e')];_0x527d9b[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x5e'),_0x5a32a8['dataValues']));_0x527d9b[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x5f'),_0x5a32a8['dataValues']));_0x527d9b[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x51'),_0x5a32a8[_0x4e28('0x4e')]));_0x527d9b[_0x4e28('0x4a')](get_open_tabs('whatsapp',_0x5a32a8[_0x4e28('0x4e')]));_0x527d9b[_0x4e28('0x4a')](get_open_tabs(_0x4e28('0x4f'),_0x5a32a8[_0x4e28('0x4e')]));_0x527d9b['push'](get_open_tabs('mail',_0x5a32a8['dataValues']));return BPromise['all'](_0x527d9b);})['then'](function(_0x45c7e4){if(_0x45c7e4){var _0x243ee2=_[_0x4e28('0x31')](values[_0x4e28('0xc6')],function(_0x416905){return{'channel':_0x4e28('0xc7'),'id':_0x416905['id'],'createdAt':_0x416905[_0x4e28('0xc8')]};});var _0x36c8ea=_['map'](values[_0x4e28('0xc9')],function(_0x5bdd96){return{'channel':'FAX','id':_0x5bdd96['id'],'createdAt':_0x5bdd96[_0x4e28('0xc8')]};});var _0x4ad764=_[_0x4e28('0x31')](values['OpenchannelOpenTabs'],function(_0xb1967){return{'channel':_0x4e28('0xca'),'id':_0xb1967['id'],'createdAt':_0xb1967[_0x4e28('0xc8')]};});var _0xecb0d5=_['map'](values['MailOpenTabs'],function(_0x4a0e91){return{'channel':_0x4e28('0xcb'),'id':_0x4a0e91['id'],'createdAt':_0x4a0e91[_0x4e28('0xc8')]};});var _0x5a69e4=_[_0x4e28('0x31')](values[_0x4e28('0xcc')],function(_0x512799){return{'channel':_0x4e28('0xcd'),'id':_0x512799['id'],'createdAt':_0x512799[_0x4e28('0xc8')]};});var _0x29d221=_['map'](values[_0x4e28('0xce')],function(_0x429f59){return{'channel':'WHATSAPP','id':_0x429f59['id'],'createdAt':_0x429f59[_0x4e28('0xc8')]};});var _0x1387e7=_[_0x4e28('0xcf')](_0x243ee2,_0x36c8ea,_0x4ad764,_0xecb0d5,_0x5a69e4,_0x29d221);var _0x1f6fa8={'count':_0x1387e7[_0x4e28('0x4d')],'rows':_0x1387e7};return _0x1f6fa8;}else return null;})['then'](respondWithResult(_0x536185,null))[_0x4e28('0x1f')](handleError(_0x536185,null));};exports[_0x4e28('0xd0')]=function(_0x5339a7,_0x2e6ee4){var _0xae36e7={};var _0x49de53={};var _0xd438b4;var _0x3dfe1;return db['User'][_0x4e28('0xd1')]({'where':{'id':_0x5339a7[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x2e6ee4,null))[_0x4e28('0x14')](function(_0x5e9315){if(_0x5e9315){_0xd438b4=_0x5e9315;_0x49de53[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_0x4e28('0xd2')][_0x4e28('0x3b')]);_0x49de53[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x5339a7['query']);_0x49de53[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x49de53[_0x4e28('0x56')],_0x49de53[_0x4e28('0x43')]);_0xae36e7[_0x4e28('0x49')]=_['intersection'](_0x49de53[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x5339a7[_0x4e28('0x43')]['fields']));_0xae36e7[_0x4e28('0x49')]=_0xae36e7[_0x4e28('0x49')][_0x4e28('0x4d')]?_0xae36e7[_0x4e28('0x49')]:_0x49de53[_0x4e28('0x56')];_0xae36e7[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x5339a7['query']['sort']);_0xae36e7[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_['pick'](_0x5339a7[_0x4e28('0x43')],_0x49de53[_0x4e28('0x59')]));if(_0x5339a7['query']['filter']){_0xae36e7['where']=_[_0x4e28('0xd6')](_0xae36e7['where'],{'$or':_[_0x4e28('0x31')](_0xae36e7['attributes'],function(_0x2c99b6){var _0x2d5bac={};_0x2d5bac[_0x2c99b6]={'$like':'%'+_0x5339a7[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x2d5bac;})});}_0xae36e7=_[_0x4e28('0xd6')]({},_0xae36e7,_0x5339a7[_0x4e28('0x5c')]);return _0xd438b4['getContacts'](_0xae36e7);}})['then'](function(_0x58478a){if(_0x58478a){_0x3dfe1=_0x58478a[_0x4e28('0x4d')];if(_0x5339a7[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0x44'))){_0xae36e7[_0x4e28('0x45')]=[{'model':db[_0x4e28('0xd8')],'as':_0x4e28('0xd9'),'required':![]},{'model':db[_0x4e28('0xda')],'as':_0x4e28('0xdb'),'attributes':['id','name',_0x4e28('0xdc')],'where':_0x5339a7[_0x4e28('0x43')]['tag']?{'id':_0x5339a7[_0x4e28('0x43')][_0x4e28('0xdd')]}:undefined,'required':_0x5339a7[_0x4e28('0x43')][_0x4e28('0xdd')]?!![]:![]}];}if(!_0x5339a7[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0xae36e7[_0x4e28('0xdf')]=qs['limit'](_0x5339a7['query'][_0x4e28('0xdf')]);_0xae36e7[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x5339a7['query']['offset']);}return _0xd438b4[_0x4e28('0xd0')](_0xae36e7);}})[_0x4e28('0x14')](function(_0x4e6cc1){if(_0x4e6cc1){return _0x4e6cc1?{'count':_0x3dfe1,'rows':_0x4e6cc1}:null;}})[_0x4e28('0x14')](respondWithResult(_0x2e6ee4,null))[_0x4e28('0x1f')](handleError(_0x2e6ee4,null));};exports[_0x4e28('0xe0')]=function(_0x3938b1,_0x5a498c){var _0x3769fd;var _0x596f73={};var _0x36e04a;return db['User'][_0x4e28('0xd1')]({'where':{'id':_0x3938b1[_0x4e28('0x55')]['id']},'attributes':['id',_0x4e28('0x38'),_0x4e28('0x34')]})[_0x4e28('0x14')](handleEntityNotFound(_0x5a498c,null))['then'](function(_0x927eb8){if(!utils[_0x4e28('0xa7')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xa2')])){throw new db['Sequelize'][(_0x4e28('0x98'))]('Unknown\x20channel');}_0x3769fd=_0x927eb8;var _0x258326={};_0x258326[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_['capitalize'](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xa2')])+_0x4e28('0xe1')][_0x4e28('0x3b')]);_0x258326[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x3938b1['query']);_0x258326[_0x4e28('0x59')]=_['intersection'](_0x258326[_0x4e28('0x56')],_0x258326[_0x4e28('0x43')]);_0x596f73[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x258326[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x3938b1['query'][_0x4e28('0x5b')]));_0x596f73[_0x4e28('0x49')]=_0x596f73[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x596f73[_0x4e28('0x49')]:_0x258326[_0x4e28('0x56')];_0x596f73[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x3938b1[_0x4e28('0x43')]['sort']);_0x596f73[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_['pick'](_0x3938b1['query'],_0x258326[_0x4e28('0x59')]));if(_0x3938b1[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x596f73[_0x4e28('0xd5')]=_[_0x4e28('0xd6')](_0x596f73[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x596f73[_0x4e28('0x49')],function(_0x6ef1bf){var _0x1cd94b={};_0x1cd94b[_0x6ef1bf]={'$like':'%'+_0x3938b1[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x1cd94b;})});}_0x596f73=_['merge']({},_0x596f73,_0x3938b1[_0x4e28('0x5c')]);switch(_0x3769fd[_0x4e28('0x34')]){case'admin':return db[_[_0x4e28('0xaa')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xa2')])+'Queue'][_0x4e28('0x4b')](_0x596f73);case _0x4e28('0x84'):case'agent':return _0x3769fd[_0x4e28('0x2b')+_[_0x4e28('0xaa')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xa2')])+_0x4e28('0xab')](_0x596f73);default:throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0xe2'));}})['then'](function(_0x219803){_0x36e04a=_0x219803['length'];if(!_0x3938b1[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x596f73[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x596f73['offset']=qs[_0x4e28('0x24')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0x24')]);}switch(_0x3769fd[_0x4e28('0x34')]){case _0x4e28('0x2c'):return db[_[_0x4e28('0xaa')](_0x3938b1['query'][_0x4e28('0xa2')])+_0x4e28('0xe1')][_0x4e28('0x4b')](_0x596f73);case'user':case'agent':return _0x3769fd[_0x4e28('0x2b')+_[_0x4e28('0xaa')](_0x3938b1[_0x4e28('0x43')][_0x4e28('0xa2')])+_0x4e28('0xab')](_0x596f73);}})['then'](function(_0x44ce31){return{'count':_0x36e04a,'rows':_0x44ce31};})[_0x4e28('0x14')](respondWithResult(_0x5a498c,null))[_0x4e28('0x1f')](handleError(_0x5a498c,null));};exports[_0x4e28('0xe3')]=function(_0x5e5317,_0x340f22){var _0x8c47ab={};var _0x5413e5={};var _0x598762;var _0x37c6b1;return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x5e5317[_0x4e28('0x55')]['id']}})['then'](handleEntityNotFound(_0x340f22,null))[_0x4e28('0x14')](function(_0x2d7421){if(_0x2d7421){_0x598762=_0x2d7421;_0x5413e5['model']=_[_0x4e28('0x58')](db[_0x4e28('0xb6')][_0x4e28('0x3b')]);_0x5413e5['query']=_[_0x4e28('0x58')](_0x5e5317[_0x4e28('0x43')]);_0x5413e5[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x5413e5['model'],_0x5413e5[_0x4e28('0x43')]);_0x8c47ab[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x5413e5[_0x4e28('0x56')],qs['fields'](_0x5e5317[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x8c47ab[_0x4e28('0x49')]=_0x8c47ab[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x8c47ab[_0x4e28('0x49')]:_0x5413e5[_0x4e28('0x56')];_0x8c47ab[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x5e5317[_0x4e28('0x43')]['sort']);_0x8c47ab['where']=qs[_0x4e28('0x59')](_['pick'](_0x5e5317[_0x4e28('0x43')],_0x5413e5[_0x4e28('0x59')]));if(_0x5e5317[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x8c47ab[_0x4e28('0xd5')]=_[_0x4e28('0xd6')](_0x8c47ab[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x8c47ab[_0x4e28('0x49')],function(_0x48e5e0){var _0x17d296={};_0x17d296[_0x48e5e0]={'$like':'%'+_0x5e5317[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x17d296;})});}_0x8c47ab=_[_0x4e28('0xd6')]({},_0x8c47ab,_0x5e5317[_0x4e28('0x5c')]);return _0x598762[_0x4e28('0xe3')](_0x8c47ab);}})[_0x4e28('0x14')](function(_0xc6cb4b){if(_0xc6cb4b){_0x37c6b1=_0xc6cb4b[_0x4e28('0x4d')];if(!_0x5e5317[_0x4e28('0x43')][_0x4e28('0xd7')]('nolimit')){_0x8c47ab[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x5e5317[_0x4e28('0x43')]['limit']);_0x8c47ab[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x5e5317[_0x4e28('0x43')]['offset']);}return _0x598762[_0x4e28('0xe3')](_0x8c47ab);}})[_0x4e28('0x14')](function(_0x3004d3){if(_0x3004d3){return _0x3004d3?{'count':_0x37c6b1,'rows':_0x3004d3}:null;}})[_0x4e28('0x14')](respondWithResult(_0x340f22,null))[_0x4e28('0x1f')](handleError(_0x340f22,null));};exports['getGroups']=function(_0x3e112b,_0x21645d){var _0x394f04={};var _0xdd951d={};var _0x58342e;var _0x2b6018;return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x3e112b[_0x4e28('0x55')]['id']}})['then'](handleEntityNotFound(_0x21645d,null))[_0x4e28('0x14')](function(_0x127b30){if(_0x127b30){_0x58342e=_0x127b30;_0xdd951d[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_0x4e28('0xe4')][_0x4e28('0x3b')]);_0xdd951d['query']=_['keys'](_0x3e112b[_0x4e28('0x43')]);_0xdd951d[_0x4e28('0x59')]=_['intersection'](_0xdd951d['model'],_0xdd951d[_0x4e28('0x43')]);_0x394f04[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0xdd951d[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x3e112b[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x394f04[_0x4e28('0x49')]=_0x394f04[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x394f04[_0x4e28('0x49')]:_0xdd951d[_0x4e28('0x56')];_0x394f04['order']=qs[_0x4e28('0xd4')](_0x3e112b[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x394f04['where']=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0x3e112b[_0x4e28('0x43')],_0xdd951d[_0x4e28('0x59')]));if(_0x3e112b[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x394f04[_0x4e28('0xd5')]=_['merge'](_0x394f04['where'],{'$or':_[_0x4e28('0x31')](_0x394f04[_0x4e28('0x49')],function(_0x5044d7){var _0x271363={};_0x271363[_0x5044d7]={'$like':'%'+_0x3e112b[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x271363;})});}_0x394f04=_['merge']({},_0x394f04,_0x3e112b[_0x4e28('0x5c')]);return _0x58342e[_0x4e28('0xe6')](_0x394f04);}})[_0x4e28('0x14')](function(_0x4005e8){if(_0x4005e8){_0x2b6018=_0x4005e8[_0x4e28('0x4d')];if(!_0x3e112b[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x394f04[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x3e112b[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x394f04['offset']=qs[_0x4e28('0x24')](_0x3e112b['query'][_0x4e28('0x24')]);}return _0x58342e[_0x4e28('0xe6')](_0x394f04);}})[_0x4e28('0x14')](function(_0x3d08b5){if(_0x3d08b5){return _0x3d08b5?{'count':_0x2b6018,'rows':_0x3d08b5}:null;}})['then'](respondWithResult(_0x21645d,null))[_0x4e28('0x1f')](handleError(_0x21645d,null));};exports[_0x4e28('0xe7')]=function(_0x4011e6,_0x1cef5c){var _0xfcee42={'raw':!![],'where':{}};var _0x107df9={};var _0x5af540={'count':0x0,'rows':[]};return db['User'][_0x4e28('0xd1')]({'where':{'id':_0x4011e6[_0x4e28('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cef5c,null))['then'](function(_0x59b48e){if(_0x59b48e){_0x107df9[_0x4e28('0x56')]=_['keys'](db[_0x4e28('0xe8')][_0x4e28('0x3b')]);_0x107df9[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x4011e6[_0x4e28('0x43')]);_0x107df9[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x107df9[_0x4e28('0x56')],_0x107df9['query']);_0xfcee42[_0x4e28('0x49')]=_['intersection'](_0x107df9[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x4011e6[_0x4e28('0x43')][_0x4e28('0x5b')]));_0xfcee42[_0x4e28('0x49')]=_0xfcee42[_0x4e28('0x49')]['length']?_0xfcee42[_0x4e28('0x49')]:_0x107df9[_0x4e28('0x56')];if(!_0x4011e6[_0x4e28('0x43')][_0x4e28('0xd7')]('nolimit')){_0xfcee42[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x4011e6[_0x4e28('0x43')]['limit']);_0xfcee42[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x4011e6[_0x4e28('0x43')]['offset']);}_0xfcee42[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x4011e6['query'][_0x4e28('0xd4')]);_0xfcee42[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0x4011e6['query'],_0x107df9[_0x4e28('0x59')]));_0xfcee42[_0x4e28('0xd5')][_0x4e28('0xe9')]=_0x59b48e['id'];if(_0x4011e6[_0x4e28('0x43')][_0x4e28('0x3f')]){_0xfcee42['where']=_['merge'](_0xfcee42[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0xfcee42['attributes'],function(_0x1b6266){var _0x299057={};_0x299057[_0x1b6266]={'$like':'%'+_0x4011e6[_0x4e28('0x43')]['filter']+'%'};return _0x299057;})});}_0xfcee42=_['merge']({},_0xfcee42,_0x4011e6[_0x4e28('0x5c')]);return db[_0x4e28('0xe8')][_0x4e28('0x26')]({'where':_0xfcee42[_0x4e28('0xd5')]})[_0x4e28('0x14')](function(_0x147067){_0x5af540[_0x4e28('0x26')]=_0x147067;if(_0x4011e6[_0x4e28('0x43')][_0x4e28('0x44')]){_0xfcee42['include']=[{'all':!![]}];}return db[_0x4e28('0xe8')][_0x4e28('0x4b')](_0xfcee42);})[_0x4e28('0x14')](function(_0x1295e2){_0x5af540['rows']=_0x1295e2;return _0x5af540;});}})[_0x4e28('0x14')](respondWithFilteredResult(_0x1cef5c,_0xfcee42))[_0x4e28('0x1f')](handleError(_0x1cef5c,null));};exports[_0x4e28('0xea')]=function(_0x23a70b,_0x5b4fe8){var _0x4bc2ce={'raw':!![],'where':{}};var _0x4842ac={};var _0x43e48a={'count':0x0,'rows':[]};return db[_0x4e28('0x42')]['findOne']({'where':{'id':_0x23a70b[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x5b4fe8,null))[_0x4e28('0x14')](function(_0x386190){if(_0x386190){_0x4842ac[_0x4e28('0x56')]=_[_0x4e28('0x58')](db['ScreenRecording']['rawAttributes']);_0x4842ac[_0x4e28('0x43')]=_['keys'](_0x23a70b[_0x4e28('0x43')]);_0x4842ac[_0x4e28('0x59')]=_['intersection'](_0x4842ac[_0x4e28('0x56')],_0x4842ac['query']);_0x4bc2ce[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x4842ac[_0x4e28('0x56')],qs['fields'](_0x23a70b[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x4bc2ce[_0x4e28('0x49')]=_0x4bc2ce[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x4bc2ce['attributes']:_0x4842ac[_0x4e28('0x56')];if(!_0x23a70b['query'][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x4bc2ce['limit']=qs[_0x4e28('0xdf')](_0x23a70b[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x4bc2ce['offset']=qs[_0x4e28('0x24')](_0x23a70b[_0x4e28('0x43')][_0x4e28('0x24')]);}_0x4bc2ce[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x23a70b[_0x4e28('0x43')]['sort']);_0x4bc2ce[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0x23a70b[_0x4e28('0x43')],_0x4842ac[_0x4e28('0x59')]));_0x4bc2ce['where']['UserId']=_0x386190['id'];if(_0x23a70b['query'][_0x4e28('0x3f')]){_0x4bc2ce['where']=_[_0x4e28('0xd6')](_0x4bc2ce[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x4bc2ce[_0x4e28('0x49')],function(_0x5987ed){var _0xd95a1a={};_0xd95a1a[_0x5987ed]={'$like':'%'+_0x23a70b['query'][_0x4e28('0x3f')]+'%'};return _0xd95a1a;})});}_0x4bc2ce=_[_0x4e28('0xd6')]({},_0x4bc2ce,_0x23a70b[_0x4e28('0x5c')]);return db[_0x4e28('0xeb')]['count']({'where':_0x4bc2ce[_0x4e28('0xd5')]})['then'](function(_0x15165b){_0x43e48a['count']=_0x15165b;if(_0x23a70b[_0x4e28('0x43')]['includeAll']){_0x4bc2ce['include']=[{'all':!![]}];}return db[_0x4e28('0xeb')][_0x4e28('0x4b')](_0x4bc2ce);})[_0x4e28('0x14')](function(_0x51f7fc){_0x43e48a[_0x4e28('0x4c')]=_0x51f7fc;return _0x43e48a;});}})[_0x4e28('0x14')](respondWithFilteredResult(_0x5b4fe8,_0x4bc2ce))[_0x4e28('0x1f')](handleError(_0x5b4fe8,null));};exports[_0x4e28('0xec')]=function(_0x7d3c4a,_0x3f11a5){var _0x3c2f5e={};var _0x2964f7={};var _0x558dcf;var _0xe2d1c7;return db['User']['findOne']({'where':{'id':_0x7d3c4a[_0x4e28('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f11a5,null))['then'](function(_0x3e3bff){if(_0x3e3bff){_0x558dcf=_0x3e3bff;_0x2964f7[_0x4e28('0x56')]=_[_0x4e28('0x58')](db['ChatInteraction'][_0x4e28('0x3b')]);_0x2964f7[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x7d3c4a[_0x4e28('0x43')]);_0x2964f7[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x2964f7[_0x4e28('0x56')],_0x2964f7[_0x4e28('0x43')]);_0x3c2f5e['attributes']=_[_0x4e28('0x5a')](_0x2964f7[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x7d3c4a[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x3c2f5e[_0x4e28('0x49')]=_0x3c2f5e[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x3c2f5e[_0x4e28('0x49')]:_0x2964f7[_0x4e28('0x56')];_0x3c2f5e[_0x4e28('0xd3')]=qs['sort'](_0x7d3c4a[_0x4e28('0x43')]['sort']);_0x3c2f5e[_0x4e28('0xd5')]=qs['filters'](_[_0x4e28('0xe5')](_0x7d3c4a['query'],_0x2964f7[_0x4e28('0x59')]));if(_0x7d3c4a[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x3c2f5e[_0x4e28('0xd5')]=_['merge'](_0x3c2f5e['where'],{'$or':_['map'](_0x3c2f5e['attributes'],function(_0x1f5500){var _0x321cc0={};_0x321cc0[_0x1f5500]={'$like':'%'+_0x7d3c4a[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x321cc0;})});}_0x3c2f5e=_['merge']({},_0x3c2f5e,_0x7d3c4a[_0x4e28('0x5c')]);return _0x558dcf['getChatInteractions'](_0x3c2f5e);}})[_0x4e28('0x14')](function(_0x146aeb){if(_0x146aeb){_0xe2d1c7=_0x146aeb[_0x4e28('0x4d')];if(!_0x7d3c4a['query'][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x3c2f5e[_0x4e28('0xdf')]=qs['limit'](_0x7d3c4a[_0x4e28('0x43')]['limit']);_0x3c2f5e[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x7d3c4a[_0x4e28('0x43')][_0x4e28('0x24')]);}return _0x558dcf[_0x4e28('0xec')](_0x3c2f5e);}})['then'](function(_0x58440c){if(_0x58440c){return _0x58440c?{'count':_0xe2d1c7,'rows':_0x58440c}:null;}})[_0x4e28('0x14')](respondWithResult(_0x3f11a5,null))[_0x4e28('0x1f')](handleError(_0x3f11a5,null));};exports[_0x4e28('0xed')]=function(_0x3e8eba,_0x50988f){var _0x24bf03={};var _0x3b4804={};var _0x1e322b;var _0x291747;return db['User'][_0x4e28('0xd1')]({'where':{'id':_0x3e8eba[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x50988f,null))[_0x4e28('0x14')](function(_0x236764){if(_0x236764){_0x1e322b=_0x236764;_0x3b4804['model']=_[_0x4e28('0x58')](db[_0x4e28('0xee')][_0x4e28('0x3b')]);_0x3b4804[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x3e8eba['query']);_0x3b4804[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x3b4804[_0x4e28('0x56')],_0x3b4804[_0x4e28('0x43')]);_0x24bf03['attributes']=_[_0x4e28('0x5a')](_0x3b4804[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x3e8eba['query'][_0x4e28('0x5b')]));_0x24bf03['attributes']=_0x24bf03[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x24bf03['attributes']:_0x3b4804[_0x4e28('0x56')];_0x24bf03[_0x4e28('0xd3')]=qs['sort'](_0x3e8eba[_0x4e28('0x43')]['sort']);_0x24bf03[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_['pick'](_0x3e8eba['query'],_0x3b4804['filters']));if(_0x3e8eba[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x24bf03[_0x4e28('0xd5')]=_[_0x4e28('0xd6')](_0x24bf03['where'],{'$or':_['map'](_0x24bf03[_0x4e28('0x49')],function(_0x2c980c){var _0x414cf6={};_0x414cf6[_0x2c980c]={'$like':'%'+_0x3e8eba['query'][_0x4e28('0x3f')]+'%'};return _0x414cf6;})});}_0x24bf03=_[_0x4e28('0xd6')]({},_0x24bf03,_0x3e8eba[_0x4e28('0x5c')]);return _0x1e322b[_0x4e28('0xed')](_0x24bf03);}})[_0x4e28('0x14')](function(_0x4aed65){if(_0x4aed65){_0x291747=_0x4aed65[_0x4e28('0x4d')];if(!_0x3e8eba[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x24bf03['limit']=qs['limit'](_0x3e8eba[_0x4e28('0x43')]['limit']);_0x24bf03[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x3e8eba[_0x4e28('0x43')][_0x4e28('0x24')]);}return _0x1e322b[_0x4e28('0xed')](_0x24bf03);}})[_0x4e28('0x14')](function(_0x5d7406){if(_0x5d7406){return _0x5d7406?{'count':_0x291747,'rows':_0x5d7406}:null;}})[_0x4e28('0x14')](respondWithResult(_0x50988f,null))['catch'](handleError(_0x50988f,null));};exports[_0x4e28('0xef')]=function(_0x4e9382,_0x549506){var _0x1ab635={'raw':!![],'where':{}};var _0x43b835={};var _0x4ea1cf={'count':0x0,'rows':[]};return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x4e9382[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x549506,null))['then'](function(_0x4ae661){if(_0x4ae661){_0x43b835[_0x4e28('0x56')]=_[_0x4e28('0x58')](db['MailInteraction']['rawAttributes']);_0x43b835[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x4e9382[_0x4e28('0x43')]);_0x43b835['filters']=_[_0x4e28('0x5a')](_0x43b835[_0x4e28('0x56')],_0x43b835[_0x4e28('0x43')]);_0x1ab635[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x43b835[_0x4e28('0x56')],qs['fields'](_0x4e9382[_0x4e28('0x43')][_0x4e28('0x5b')]));_0x1ab635['attributes']=_0x1ab635[_0x4e28('0x49')]['length']?_0x1ab635[_0x4e28('0x49')]:_0x43b835['model'];if(!_0x4e9382[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x1ab635[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x4e9382[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x1ab635[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x4e9382[_0x4e28('0x43')]['offset']);}_0x1ab635['order']=qs['sort'](_0x4e9382[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x1ab635[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_['pick'](_0x4e9382[_0x4e28('0x43')],_0x43b835[_0x4e28('0x59')]));_0x1ab635[_0x4e28('0xd5')][_0x4e28('0xe9')]=_0x4ae661['id'];if(_0x4e9382['query'][_0x4e28('0x3f')]){_0x1ab635['where']=_[_0x4e28('0xd6')](_0x1ab635[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x1ab635['attributes'],function(_0x3855ce){var _0x1848f0={};_0x1848f0[_0x3855ce]={'$like':'%'+_0x4e9382[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x1848f0;})});}_0x1ab635=_[_0x4e28('0xd6')]({},_0x1ab635,_0x4e9382[_0x4e28('0x5c')]);return db[_0x4e28('0xf0')][_0x4e28('0x26')]({'where':_0x1ab635[_0x4e28('0xd5')]})['then'](function(_0x52d041){_0x4ea1cf[_0x4e28('0x26')]=_0x52d041;if(_0x4e9382[_0x4e28('0x43')]['includeAll']){_0x1ab635[_0x4e28('0x45')]=[{'all':!![]}];}return db['MailInteraction'][_0x4e28('0x4b')](_0x1ab635);})[_0x4e28('0x14')](function(_0x12f112){_0x4ea1cf['rows']=_0x12f112;return _0x4ea1cf;});}})['then'](respondWithFilteredResult(_0x549506,_0x1ab635))[_0x4e28('0x1f')](handleError(_0x549506,null));};exports[_0x4e28('0xf1')]=function(_0xafcf37,_0x3bbad0){var _0x1d2672={};var _0x72fde0={};var _0x4c1a18;var _0x156317;return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0xafcf37['params']['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x3bbad0,null))[_0x4e28('0x14')](function(_0x3f7161){if(_0x3f7161){_0x4c1a18=_0x3f7161;_0x72fde0['model']=_['keys'](db[_0x4e28('0xf2')][_0x4e28('0x3b')]);_0x72fde0['query']=_[_0x4e28('0x58')](_0xafcf37[_0x4e28('0x43')]);_0x72fde0[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x72fde0[_0x4e28('0x56')],_0x72fde0[_0x4e28('0x43')]);_0x1d2672[_0x4e28('0x49')]=_['intersection'](_0x72fde0[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0xafcf37['query'][_0x4e28('0x5b')]));_0x1d2672[_0x4e28('0x49')]=_0x1d2672['attributes'][_0x4e28('0x4d')]?_0x1d2672[_0x4e28('0x49')]:_0x72fde0['model'];_0x1d2672[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0xafcf37[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x1d2672[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0xafcf37[_0x4e28('0x43')],_0x72fde0['filters']));if(_0xafcf37[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x1d2672[_0x4e28('0xd5')]=_['merge'](_0x1d2672[_0x4e28('0xd5')],{'$or':_['map'](_0x1d2672['attributes'],function(_0x4caef2){var _0x30c1bb={};_0x30c1bb[_0x4caef2]={'$like':'%'+_0xafcf37[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x30c1bb;})});}_0x1d2672=_[_0x4e28('0xd6')]({},_0x1d2672,_0xafcf37['options']);return _0x4c1a18['getSmsInteractions'](_0x1d2672);}})[_0x4e28('0x14')](function(_0x5e2fb4){if(_0x5e2fb4){_0x156317=_0x5e2fb4[_0x4e28('0x4d')];if(!_0xafcf37[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x1d2672['limit']=qs[_0x4e28('0xdf')](_0xafcf37[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x1d2672['offset']=qs[_0x4e28('0x24')](_0xafcf37['query']['offset']);}return _0x4c1a18[_0x4e28('0xf1')](_0x1d2672);}})[_0x4e28('0x14')](function(_0x2a5c64){if(_0x2a5c64){return _0x2a5c64?{'count':_0x156317,'rows':_0x2a5c64}:null;}})[_0x4e28('0x14')](respondWithResult(_0x3bbad0,null))[_0x4e28('0x1f')](handleError(_0x3bbad0,null));};exports[_0x4e28('0xf3')]=function(_0x59566e,_0x42816e){var _0x16fcfa={};var _0x55d5a2={};var _0x48bc55;var _0x1d0ee6;return db['User']['findOne']({'where':{'id':_0x59566e[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x42816e,null))[_0x4e28('0x14')](function(_0x22a105){if(_0x22a105){_0x48bc55=_0x22a105;_0x55d5a2[_0x4e28('0x56')]=_['keys'](db[_0x4e28('0xf4')][_0x4e28('0x3b')]);_0x55d5a2[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x59566e[_0x4e28('0x43')]);_0x55d5a2[_0x4e28('0x59')]=_['intersection'](_0x55d5a2[_0x4e28('0x56')],_0x55d5a2['query']);_0x16fcfa[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x55d5a2[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x59566e[_0x4e28('0x43')]['fields']));_0x16fcfa[_0x4e28('0x49')]=_0x16fcfa['attributes'][_0x4e28('0x4d')]?_0x16fcfa[_0x4e28('0x49')]:_0x55d5a2[_0x4e28('0x56')];_0x16fcfa[_0x4e28('0xd3')]=qs[_0x4e28('0xd4')](_0x59566e[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x16fcfa[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0x59566e[_0x4e28('0x43')],_0x55d5a2[_0x4e28('0x59')]));if(_0x59566e[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x16fcfa[_0x4e28('0xd5')]=_['merge'](_0x16fcfa['where'],{'$or':_['map'](_0x16fcfa[_0x4e28('0x49')],function(_0x40e97f){var _0x454d36={};_0x454d36[_0x40e97f]={'$like':'%'+_0x59566e['query'][_0x4e28('0x3f')]+'%'};return _0x454d36;})});}_0x16fcfa=_['merge']({},_0x16fcfa,_0x59566e['options']);return _0x48bc55[_0x4e28('0xf3')](_0x16fcfa);}})[_0x4e28('0x14')](function(_0x3609fd){if(_0x3609fd){_0x1d0ee6=_0x3609fd[_0x4e28('0x4d')];if(!_0x59566e[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x16fcfa['limit']=qs[_0x4e28('0xdf')](_0x59566e[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x16fcfa[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x59566e[_0x4e28('0x43')][_0x4e28('0x24')]);}return _0x48bc55[_0x4e28('0xf3')](_0x16fcfa);}})['then'](function(_0x28b4e9){if(_0x28b4e9){return _0x28b4e9?{'count':_0x1d0ee6,'rows':_0x28b4e9}:null;}})['then'](respondWithResult(_0x42816e,null))[_0x4e28('0x1f')](handleError(_0x42816e,null));};exports['getWhatsappInteractions']=function(_0x321ba8,_0x241def){var _0x2e6bcd={};var _0x190b12={};var _0x26c8fb;var _0xf97c45;return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x321ba8[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x241def,null))[_0x4e28('0x14')](function(_0x200d10){if(_0x200d10){_0x26c8fb=_0x200d10;_0x190b12[_0x4e28('0x56')]=_['keys'](db[_0x4e28('0xf5')][_0x4e28('0x3b')]);_0x190b12['query']=_[_0x4e28('0x58')](_0x321ba8['query']);_0x190b12[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x190b12['model'],_0x190b12[_0x4e28('0x43')]);_0x2e6bcd[_0x4e28('0x49')]=_['intersection'](_0x190b12[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x321ba8[_0x4e28('0x43')]['fields']));_0x2e6bcd[_0x4e28('0x49')]=_0x2e6bcd['attributes']['length']?_0x2e6bcd[_0x4e28('0x49')]:_0x190b12[_0x4e28('0x56')];_0x2e6bcd['order']=qs['sort'](_0x321ba8['query']['sort']);_0x2e6bcd[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0x321ba8[_0x4e28('0x43')],_0x190b12[_0x4e28('0x59')]));if(_0x321ba8[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x2e6bcd[_0x4e28('0xd5')]=_[_0x4e28('0xd6')](_0x2e6bcd[_0x4e28('0xd5')],{'$or':_['map'](_0x2e6bcd[_0x4e28('0x49')],function(_0xbda66){var _0x593bc8={};_0x593bc8[_0xbda66]={'$like':'%'+_0x321ba8[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x593bc8;})});}_0x2e6bcd=_[_0x4e28('0xd6')]({},_0x2e6bcd,_0x321ba8[_0x4e28('0x5c')]);return _0x26c8fb[_0x4e28('0xf6')](_0x2e6bcd);}})[_0x4e28('0x14')](function(_0x37cfa7){if(_0x37cfa7){_0xf97c45=_0x37cfa7[_0x4e28('0x4d')];if(!_0x321ba8['query'][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x2e6bcd[_0x4e28('0xdf')]=qs[_0x4e28('0xdf')](_0x321ba8[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x2e6bcd[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0x321ba8['query']['offset']);}return _0x26c8fb[_0x4e28('0xf6')](_0x2e6bcd);}})[_0x4e28('0x14')](function(_0x17c923){if(_0x17c923){return _0x17c923?{'count':_0xf97c45,'rows':_0x17c923}:null;}})['then'](respondWithResult(_0x241def,null))['catch'](handleError(_0x241def,null));};exports[_0x4e28('0xf7')]=function(_0x52252d,_0x17697d,_0x38cf91){var _0x1245b4;var _0x17c4e4;var _0x4dd06b;var _0x446623=!_[_0x4e28('0x6b')](_0x52252d[_0x4e28('0x55')]['id'])?_0x52252d[_0x4e28('0x55')]['id']:!_[_0x4e28('0x6b')](_0x52252d[_0x4e28('0x84')]['id'])?_0x52252d[_0x4e28('0x84')]['id']:null;return db['User'][_0x4e28('0x35')]({'where':{'id':_0x446623,'role':{'$or':[_0x4e28('0x2c'),_0x4e28('0x84'),_0x4e28('0x2f')]}},'attributes':['id',_0x4e28('0x38'),_0x4e28('0xf8'),_0x4e28('0xf9'),_0x4e28('0x34'),_0x4e28('0x64'),_0x4e28('0xa4')]})[_0x4e28('0x14')](function(_0x4ec5c1){if(_0x4ec5c1){if(_0x4ec5c1[_0x4e28('0x34')]===_0x4e28('0x2f')){_0x1245b4=_0x4ec5c1;if(_0x52252d[_0x4e28('0x60')][_0x4e28('0xa6')]){_0x4dd06b=util['format']('LOCAL/%s@from-sip/n',_0x1245b4[_0x52252d[_0x4e28('0x60')]['interface']]);}else if(_0x52252d[_0x4e28('0x60')][_0x4e28('0xfa')]){_0x4dd06b=util['format'](_0x4e28('0xb4'),_0x52252d[_0x4e28('0x60')]['intrf']);}else{_0x4dd06b=util[_0x4e28('0xb3')](_0x4e28('0xb4'),_0x1245b4[_0x4e28('0x38')]);}socket['to'](util[_0x4e28('0xb3')](_0x4e28('0xfb'),_0x1245b4[_0x4e28('0x38')]))[_0x4e28('0xaf')]('user:forcelogout',{'user':{'id':_0x1245b4['id'],'name':_0x1245b4[_0x4e28('0x38')]},'ip':_0x52252d['headers'][_0x4e28('0xfc')]||_0x52252d[_0x4e28('0xfd')][_0x4e28('0xfe')]||_0x52252d['socket'][_0x4e28('0xfe')]||_0x52252d['connection'][_0x4e28('0xff')][_0x4e28('0xfe')]});return db['UserVoiceQueueRt'][_0x4e28('0x2a')]({'where':{'membername':_0x1245b4['name']},'individualHooks':!![]});}}else{throw new db[(_0x4e28('0x97'))][(_0x4e28('0x98'))](_0x4e28('0x100'));}})['then'](function(){if(_0x1245b4){return _0x1245b4[_0x4e28('0x101')]({'raw':!![]});}})[_0x4e28('0x14')](function(_0x30a84a){if(_0x1245b4){var _0x318502=[];if(_0x30a84a){_0x17c4e4=_0x30a84a;if(_0x17c4e4[_0x4e28('0x4d')]){for(var _0x58451d=0x0;_0x58451d<_0x17c4e4[_0x4e28('0x4d')];_0x58451d++){_0x318502[_0x4e28('0x4a')]({'membername':_0x1245b4[_0x4e28('0x38')],'UserId':_0x1245b4['id'],'queue_name':_0x17c4e4[_0x58451d][_0x4e28('0x38')],'VoiceQueueId':_0x17c4e4[_0x58451d]['id'],'interface':_0x4dd06b,'paused':_0x1245b4[_0x4e28('0xa4')]||![],'penalty':_0x17c4e4[_0x58451d]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x318502,function(_0x3938e4){return db[_0x4e28('0xb6')][_0x4e28('0xb7')](_0x3938e4);});}}}})[_0x4e28('0x14')](function(){if(_0x1245b4){return db['MemberReport']['findAll']({'where':{'membername':_0x1245b4[_0x4e28('0x38')],'exitAt':null}});}})['then'](function(_0x49f53c){if(_0x1245b4){var _0x4739b3=[];_0x49f53c[_0x4e28('0x102')](function(_0x5b5973){_0x4739b3[_0x4e28('0x4a')](_0x5b5973[_0x4e28('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4e28('0x53')](_0x4739b3);}})[_0x4e28('0x14')](function(){if(_0x1245b4){var _0x3939c9=[];var _0x1a1675=[];var _0x585da7=utils[_0x4e28('0x103')]();var _0x4ef871={'membername':_0x1245b4['name'],'interface':_0x4dd06b,'enterAt':moment()[_0x4e28('0xb3')](_0x4e28('0x104')),'role':_0x1245b4['role'],'internal':_0x1245b4[_0x4e28('0x64')]};_0x585da7[_0x4e28('0x102')](function(_0x117d30){_0x3939c9[_0x4e28('0x4a')](_[_0x4e28('0xd6')]({'channel':_0x117d30,'type':_0x4e28('0x105'),'data1':_0x52252d['body'][_0x4e28('0x106')],'data2':_0x4dd06b},_0x4ef871));if(_0x1245b4['loginInPause']){_0x1a1675[_0x4e28('0x4a')](_[_0x4e28('0xd6')]({'channel':_0x117d30,'type':'PAUSE','data1':_0x4e28('0x107')},_0x4ef871));}});return db[_0x4e28('0x108')][_0x4e28('0x8d')](_0x3939c9[_0x4e28('0xcf')](_0x1a1675),{'individualHooks':!![]});}})[_0x4e28('0x14')](function(){if(_0x1245b4){return _0x1245b4['update']({'online':!![],'lastLoginAt':moment()[_0x4e28('0xb3')](_0x4e28('0x104')),'voicePause':_0x1245b4[_0x4e28('0xa4')]||![],'mailPause':_0x1245b4['loginInPause']||![],'chatPause':_0x1245b4['loginInPause']||![],'faxPause':_0x1245b4[_0x4e28('0xa4')]||![],'smsPause':_0x1245b4[_0x4e28('0xa4')]||![],'openchannelPause':_0x1245b4[_0x4e28('0xa4')]||![],'whatsappPause':_0x1245b4[_0x4e28('0xa4')]||![],'pauseType':_0x1245b4[_0x4e28('0xa4')]?_0x4e28('0x107'):null,'interface':_0x4dd06b,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x4e28('0x14')](function(_0x269b0a){if(_0x52252d[_0x4e28('0x109')]){return _0x38cf91();}else{return BPromise[_0x4e28('0x10a')](_0x269b0a)[_0x4e28('0x14')](respondWithResult(_0x17697d,null));}})['catch'](handleError(_0x17697d,null));};exports[_0x4e28('0x10b')]=function(_0x11182c,_0x3594eb){var _0x21b8c7;return db['User']['find']({'where':{'id':_0x11182c['params']['id'],'role':_0x4e28('0x2f')},'attributes':['id',_0x4e28('0x38'),'role']})['then'](handleEntityNotFound(_0x3594eb,null))['then'](function(_0x24e2c4){if(_0x24e2c4){_0x21b8c7=_0x24e2c4;return db[_0x4e28('0xb6')]['destroy']({'where':{'membername':_0x21b8c7[_0x4e28('0x38')]},'individualHooks':!![]});}})[_0x4e28('0x14')](function(){return db[_0x4e28('0x108')][_0x4e28('0x4b')]({'where':{'membername':_0x21b8c7[_0x4e28('0x38')],'exitAt':null}});})[_0x4e28('0x14')](function(_0x297555){var _0x29c383=[];_0x297555[_0x4e28('0x102')](function(_0x579009){_0x29c383[_0x4e28('0x4a')](_0x579009[_0x4e28('0x29')]({'exitAt':moment()[_0x4e28('0xb3')](_0x4e28('0x104'))}));});return BPromise[_0x4e28('0x53')](_0x29c383);})[_0x4e28('0x14')](function(){return _0x21b8c7[_0x4e28('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x4e28('0x14')](respondWithResult(_0x3594eb,null))['catch'](handleError(_0x3594eb,null));};exports[_0x4e28('0x10c')]=function(_0x1a2816,_0x107999){var _0x1dad5e;return db[_0x4e28('0xb6')][_0x4e28('0x29')]({'paused':0x1},{'where':{'UserId':_0x1a2816[_0x4e28('0x55')]['id']},'individualHooks':!![]})[_0x4e28('0x14')](function(){return db[_0x4e28('0x42')][_0x4e28('0x35')]({'where':{'id':_0x1a2816[_0x4e28('0x55')]['id'],'role':'agent'},'attributes':['id','name','role',_0x4e28('0x64'),_0x4e28('0xa6')]});})[_0x4e28('0x14')](handleEntityNotFound(_0x107999,null))[_0x4e28('0x14')](function(_0x57cbcb){if(_0x57cbcb){_0x1dad5e=_0x57cbcb;return respondWithRpcPromise('QueuePause','pause',{'id':_0x1dad5e['id'],'name':_0x1dad5e[_0x4e28('0x38')],'pause':!![]});}})[_0x4e28('0x14')](function(){if(_0x1dad5e){return db[_0x4e28('0x108')][_0x4e28('0x4b')]({'where':{'membername':_0x1dad5e[_0x4e28('0x38')],'type':_0x4e28('0x10d'),'exitAt':null}});}})[_0x4e28('0x14')](function(_0x4b0619){if(_0x4b0619[_0x4e28('0x4d')]){var _0x5dd7fb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x21eddb=0x0,_0x1b8964=_0x4b0619[_0x4e28('0x4d')];_0x21eddb<_0x1b8964;_0x21eddb++){_0x4b0619[_0x21eddb][_0x4e28('0x10e')]({'exitAt':_0x5dd7fb});}}})[_0x4e28('0x14')](function(){var _0x3d5cad=[];var _0x28bb70=utils[_0x4e28('0x103')]();_0x28bb70[_0x4e28('0x102')](function(_0x2455b2){_0x3d5cad[_0x4e28('0x4a')]({'channel':_0x2455b2,'membername':_0x1dad5e['name'],'interface':_['isNil'](_0x1dad5e['interface'])?util[_0x4e28('0xb3')](_0x4e28('0xb4'),_0x1dad5e[_0x4e28('0x38')]):_0x1dad5e[_0x4e28('0xa6')],'type':_0x4e28('0x10d'),'enterAt':moment()[_0x4e28('0xb3')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1a2816['body'][_0x4e28('0x3d')]||_0x4e28('0x10f'),'role':_0x1dad5e[_0x4e28('0x34')],'internal':_0x1dad5e[_0x4e28('0x64')]});});return db['MemberReport']['bulkCreate'](_0x3d5cad,{'individualHooks':!![]});})['then'](function(){return _0x1dad5e[_0x4e28('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1a2816[_0x4e28('0x60')][_0x4e28('0x3d')]||_0x4e28('0x10f'),'lastPauseAt':moment()[_0x4e28('0xb3')](_0x4e28('0x104'))});})[_0x4e28('0x14')](respondWithResult(_0x107999,null))[_0x4e28('0x1f')](handleError(_0x107999,null));};exports[_0x4e28('0x110')]=function(_0x256c8b,_0x20487d){var _0x441be7;return db[_0x4e28('0x42')]['find']({'where':{'id':_0x256c8b[_0x4e28('0x55')]['id']},'attributes':['id',_0x4e28('0x38'),_0x4e28('0x34'),'voicePause','mailPause',_0x4e28('0x111'),_0x4e28('0x112'),_0x4e28('0x113'),_0x4e28('0x114'),_0x4e28('0x115'),_0x4e28('0x116'),_0x4e28('0x117')]})[_0x4e28('0x14')](handleEntityNotFound(_0x20487d,null))[_0x4e28('0x14')](function(_0x4682e2){if(_0x4682e2){_0x441be7=_0x4682e2;if(_0x256c8b[_0x4e28('0x60')]['channel']&&!utils[_0x4e28('0xa7')](_0x256c8b[_0x4e28('0x60')][_0x4e28('0xa2')])){throw new db['Sequelize'][(_0x4e28('0x98'))]('Unknown\x20channel');}switch(_0x256c8b[_0x4e28('0x60')]['channel']){case _0x4e28('0xb2'):return respondWithRpcPromise(_0x4e28('0x118'),_0x4e28('0x110'),{'id':_0x441be7['id'],'name':_0x441be7[_0x4e28('0x38')],'pause':![]})[_0x4e28('0x14')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x441be7['id']},'individualHooks':!![]});})[_0x4e28('0x14')](function(){return db['MemberReport']['find']({'where':{'channel':_0x256c8b[_0x4e28('0x60')][_0x4e28('0xa2')],'membername':_0x441be7['name'],'type':_0x4e28('0x10d'),'exitAt':null}});})['then'](function(_0x5c15a7){if(_0x5c15a7){return _0x5c15a7[_0x4e28('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4e28('0x119')},{'individualHooks':!![]});}return null;})[_0x4e28('0x14')](function(){return _0x441be7[_0x4e28('0x29')]({'voicePause':![]});});case _0x4e28('0x50'):case _0x4e28('0x5e'):case'fax':case _0x4e28('0x5f'):case _0x4e28('0x52'):case _0x4e28('0x51'):return db[_0x4e28('0x108')]['find']({'where':{'channel':_0x256c8b['body']['channel'],'membername':_0x441be7[_0x4e28('0x38')],'type':_0x4e28('0x10d'),'exitAt':null}})[_0x4e28('0x14')](function(_0x1f6041){if(_0x1f6041){return _0x1f6041['update']({'exitAt':moment()['format'](_0x4e28('0x104')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x4e28('0x14')](function(){var _0x549df8={};_[_0x4e28('0x27')](_0x549df8,util['format'](_0x4e28('0x11a'),_0x256c8b[_0x4e28('0x60')][_0x4e28('0xa2')],_0x4e28('0x11b')),![]);return _0x441be7[_0x4e28('0x29')](_0x549df8);});default:return respondWithRpcPromise(_0x4e28('0x118'),_0x4e28('0x110'),{'id':_0x441be7['id'],'name':_0x441be7['name'],'pause':![]})[_0x4e28('0x14')](function(){return db[_0x4e28('0xb6')][_0x4e28('0x29')]({'paused':0x0},{'where':{'UserId':_0x441be7['id']}});})[_0x4e28('0x14')](function(){return db[_0x4e28('0x108')]['findAll']({'where':{'membername':_0x441be7[_0x4e28('0x38')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x51d958){var _0x200bde=[];_0x51d958['forEach'](function(_0x1e1dd0){_0x200bde['push'](_0x1e1dd0[_0x4e28('0x29')]({'exitAt':moment()[_0x4e28('0xb3')](_0x4e28('0x104')),'data2':_0x4e28('0x119')}));});return BPromise[_0x4e28('0x53')](_0x200bde);})['then'](function(){return _0x441be7[_0x4e28('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x4e28('0x14')](respondWithResult(_0x20487d,null))['catch'](handleError(_0x20487d,null));};exports['getTeams']=function(_0xd1131e,_0x4bdd1b){var _0x37f5b={};var _0x3eab13={};var _0xa2027c;var _0x422410;return db['User']['findOne']({'where':{'id':_0xd1131e['params']['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x4bdd1b,null))[_0x4e28('0x14')](function(_0x4a03f9){if(_0x4a03f9){_0xa2027c=_0x4a03f9;_0x3eab13[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_0x4e28('0x11c')]['rawAttributes']);_0x3eab13[_0x4e28('0x43')]=_['keys'](_0xd1131e[_0x4e28('0x43')]);_0x3eab13[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x3eab13[_0x4e28('0x56')],_0x3eab13[_0x4e28('0x43')]);_0x37f5b[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x3eab13[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0xd1131e['query'][_0x4e28('0x5b')]));_0x37f5b['attributes']=_0x37f5b[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x37f5b[_0x4e28('0x49')]:_0x3eab13[_0x4e28('0x56')];_0x37f5b['order']=qs[_0x4e28('0xd4')](_0xd1131e[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x37f5b[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0xd1131e[_0x4e28('0x43')],_0x3eab13['filters']));if(_0xd1131e[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x37f5b[_0x4e28('0xd5')]=_[_0x4e28('0xd6')](_0x37f5b[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x37f5b['attributes'],function(_0x23fcea){var _0xc320ad={};_0xc320ad[_0x23fcea]={'$like':'%'+_0xd1131e[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0xc320ad;})});}_0x37f5b=_[_0x4e28('0xd6')]({},_0x37f5b,_0xd1131e['options']);return _0xa2027c[_0x4e28('0x11d')](_0x37f5b);}})[_0x4e28('0x14')](function(_0x4a518e){if(_0x4a518e){_0x422410=_0x4a518e[_0x4e28('0x4d')];if(!_0xd1131e[_0x4e28('0x43')]['hasOwnProperty'](_0x4e28('0xde'))){_0x37f5b[_0x4e28('0xdf')]=qs['limit'](_0xd1131e[_0x4e28('0x43')][_0x4e28('0xdf')]);_0x37f5b[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0xd1131e[_0x4e28('0x43')][_0x4e28('0x24')]);}return _0xa2027c[_0x4e28('0x11d')](_0x37f5b);}})[_0x4e28('0x14')](function(_0x212fce){if(_0x212fce){return _0x212fce?{'count':_0x422410,'rows':_0x212fce}:null;}})[_0x4e28('0x14')](respondWithResult(_0x4bdd1b,null))['catch'](handleError(_0x4bdd1b,null));};exports[_0x4e28('0x11e')]=function(_0x43748c,_0x284b78){return db['User']['find']({'where':{'id':_0x43748c[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x284b78,null))[_0x4e28('0x14')](function(_0xf04d92){if(_0xf04d92){var _0x38b281=_0xf04d92[_0x4e28('0x2b')]({'plain':!![]});return _0xf04d92[_0x4e28('0x11e')](_0x43748c[_0x4e28('0x60')][_0x4e28('0x62')],_[_0x4e28('0x63')](_0x43748c['body'],[_0x4e28('0x62'),'id'])||{})['then'](function(){for(var _0x1edec9=0x0;_0x1edec9<_0x43748c[_0x4e28('0x60')][_0x4e28('0x62')][_0x4e28('0x4d')];_0x1edec9++){var _0x4c55bb=[];var _0x5a2dee={};db[_0x4e28('0x11c')][_0x4e28('0xd1')]({'where':{'id':_0x43748c[_0x4e28('0x60')]['ids'][_0x1edec9]}})['then'](function(_0xd3acbc){_0x5a2dee=_0xd3acbc[_0x4e28('0x4e')];_0x4c55bb[_0x4e28('0x4a')](_0xd3acbc[_0x4e28('0x101')]()[_0x4e28('0x14')](function(_0x52fbd5){for(var _0x321274=0x0;_0x321274<_0x52fbd5['length'];_0x321274++){_0x52fbd5[_0x321274][_0x4e28('0x11f')](_0x4e28('0xa2'),'Voice');}return _0x52fbd5;}));_0x4c55bb[_0x4e28('0x4a')](_0xd3acbc[_0x4e28('0x120')]()['then'](function(_0x4df2f0){for(var _0x41a3be=0x0;_0x41a3be<_0x4df2f0[_0x4e28('0x4d')];_0x41a3be++){_0x4df2f0[_0x41a3be]['setDataValue'](_0x4e28('0xa2'),_0x4e28('0x121'));}return _0x4df2f0;}));_0x4c55bb['push'](_0xd3acbc[_0x4e28('0x122')]()['then'](function(_0x4a6996){for(var _0x3387a2=0x0;_0x3387a2<_0x4a6996[_0x4e28('0x4d')];_0x3387a2++){_0x4a6996[_0x3387a2][_0x4e28('0x11f')]('channel','Mail');}return _0x4a6996;}));_0x4c55bb['push'](_0xd3acbc[_0x4e28('0x123')]()[_0x4e28('0x14')](function(_0x5e90db){for(var _0x65676e=0x0;_0x65676e<_0x5e90db[_0x4e28('0x4d')];_0x65676e++){_0x5e90db[_0x65676e]['setDataValue'](_0x4e28('0xa2'),_0x4e28('0x124'));}return _0x5e90db;}));_0x4c55bb[_0x4e28('0x4a')](_0xd3acbc[_0x4e28('0x125')]()['then'](function(_0x3faa0f){for(var _0x4ce2fe=0x0;_0x4ce2fe<_0x3faa0f[_0x4e28('0x4d')];_0x4ce2fe++){_0x3faa0f[_0x4ce2fe][_0x4e28('0x11f')](_0x4e28('0xa2'),_0x4e28('0x126'));}return _0x3faa0f;}));_0x4c55bb[_0x4e28('0x4a')](_0xd3acbc[_0x4e28('0x127')]()['then'](function(_0x58104b){for(var _0x5c06f1=0x0;_0x5c06f1<_0x58104b['length'];_0x5c06f1++){_0x58104b[_0x5c06f1][_0x4e28('0x11f')](_0x4e28('0xa2'),'Fax');}return _0x58104b;}));_0x4c55bb[_0x4e28('0x4a')](_0xd3acbc[_0x4e28('0x128')]()[_0x4e28('0x14')](function(_0x5a3e23){for(var _0x5d12f1=0x0;_0x5d12f1<_0x5a3e23[_0x4e28('0x4d')];_0x5d12f1++){_0x5a3e23[_0x5d12f1]['setDataValue'](_0x4e28('0xa2'),'Openchannel');}return _0x5a3e23;}));return BPromise['all'](_0x4c55bb);})[_0x4e28('0x14')](function(_0x583b73){var _0x3a77ea=_['flatten'](_0x583b73);_0x4c55bb=[];return db[_0x4e28('0x6d')][_0x4e28('0x129')](function(_0x48ab8c){for(var _0x2e4319=0x0;_0x2e4319<_0x3a77ea[_0x4e28('0x4d')];_0x2e4319++){_0x4c55bb[_0x4e28('0x4a')](_0x3a77ea[_0x2e4319]['addAgent'](_0x38b281['id']),{'transaction':_0x48ab8c});}return BPromise[_0x4e28('0x53')](_0x4c55bb)[_0x4e28('0x14')](function(){if(_0x38b281['online']){return BPromise[_0x4e28('0x91')](_[_0x4e28('0x3f')](_0x3a77ea,function(_0x4af207){return _0x4af207['getDataValue'](_0x4e28('0xa2'))===_0x4e28('0x12a');}),function(_0x30a959){return db['UserVoiceQueueRt'][_0x4e28('0xb7')]({'membername':_0x38b281[_0x4e28('0x38')],'UserId':_0x38b281['id'],'queue_name':_0x30a959[_0x4e28('0x38')],'VoiceQueueId':_0x30a959['id'],'interface':_[_0x4e28('0x6b')](_0x38b281['interface'])?util['format'](_0x4e28('0xb4'),_0x38b281[_0x4e28('0x38')]):_0x38b281[_0x4e28('0xa6')],'paused':_0x38b281[_0x4e28('0xa5')]||![],'penalty':_0x38b281[_0x4e28('0xb5')]},{'transaction':_0x48ab8c});});}else{return;}})['then'](function(){for(var _0x4b1976=0x0;_0x4b1976<_0x3a77ea[_0x4e28('0x4d')];_0x4b1976++){var _0x2fd978=_0x3a77ea[_0x4b1976][_0x4e28('0x12b')](_0x4e28('0xa2'));var _0x55ac66=_0x2fd978+_0x4e28('0xae');socket['emit']('user'+_0x2fd978+_0x4e28('0xb0'),{'UserId':_0x38b281['id'],['queueField']:_0x3a77ea[_0x4b1976]['id']});}});});})[_0x4e28('0x14')](function(){db[_0x4e28('0x12c')][_0x4e28('0xd1')]({'where':{'teamId':_0x5a2dee['id']}})[_0x4e28('0x14')](function(_0x5e150d){if(_0x5e150d){db['UserVoicePrefix'][_0x4e28('0x83')]({'UserId':_0x43748c['params']['id'],'VoicePrefixId':_0x5e150d[_0x4e28('0x12d')]});}});});}});}})[_0x4e28('0x14')](respondWithStatusCode(_0x284b78,null))[_0x4e28('0x1f')](handleError(_0x284b78,null));};exports[_0x4e28('0x12e')]=function(_0x591b58,_0x15be0c){return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x591b58[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x15be0c,null))[_0x4e28('0x14')](function(_0x503803){if(_0x503803){var _0x323294=_0x503803[_0x4e28('0x2b')]({'plain':!![]});var _0x328e0a=_0x591b58[_0x4e28('0x43')][_0x4e28('0x62')];return _0x503803[_0x4e28('0x12e')](_0x328e0a)['then'](function(){for(var _0x22d758=0x0;_0x22d758<_0x328e0a[_0x4e28('0x4d')];_0x22d758++){var _0xe8bc6=[];var _0x3cf309={};db['Team'][_0x4e28('0xd1')]({'where':{'id':_0x328e0a[_0x22d758]}})[_0x4e28('0x14')](function(_0x31359a){_0x3cf309=_0x31359a[_0x4e28('0x4e')];_0xe8bc6[_0x4e28('0x4a')](_0x31359a[_0x4e28('0x101')]()[_0x4e28('0x14')](function(_0x24603c){for(var _0x1faedd=0x0;_0x1faedd<_0x24603c[_0x4e28('0x4d')];_0x1faedd++){_0x24603c[_0x1faedd][_0x4e28('0x11f')](_0x4e28('0xa2'),_0x4e28('0x12a'));}return _0x24603c;}));_0xe8bc6['push'](_0x31359a[_0x4e28('0x120')]()[_0x4e28('0x14')](function(_0xa7537c){for(var _0x1d5541=0x0;_0x1d5541<_0xa7537c['length'];_0x1d5541++){_0xa7537c[_0x1d5541]['setDataValue'](_0x4e28('0xa2'),_0x4e28('0x121'));}return _0xa7537c;}));_0xe8bc6[_0x4e28('0x4a')](_0x31359a[_0x4e28('0x122')]()[_0x4e28('0x14')](function(_0x496734){for(var _0x1108df=0x0;_0x1108df<_0x496734[_0x4e28('0x4d')];_0x1108df++){_0x496734[_0x1108df][_0x4e28('0x11f')](_0x4e28('0xa2'),'Mail');}return _0x496734;}));_0xe8bc6[_0x4e28('0x4a')](_0x31359a[_0x4e28('0x123')]()[_0x4e28('0x14')](function(_0xa9f4c4){for(var _0x51932a=0x0;_0x51932a<_0xa9f4c4['length'];_0x51932a++){_0xa9f4c4[_0x51932a]['setDataValue'](_0x4e28('0xa2'),'Sms');}return _0xa9f4c4;}));_0xe8bc6['push'](_0x31359a[_0x4e28('0x125')]()[_0x4e28('0x14')](function(_0x5679c9){for(var _0x4bd3e7=0x0;_0x4bd3e7<_0x5679c9[_0x4e28('0x4d')];_0x4bd3e7++){_0x5679c9[_0x4bd3e7][_0x4e28('0x11f')](_0x4e28('0xa2'),'Whatsapp');}return _0x5679c9;}));_0xe8bc6[_0x4e28('0x4a')](_0x31359a[_0x4e28('0x127')]()[_0x4e28('0x14')](function(_0x542571){for(var _0x1b06a4=0x0;_0x1b06a4<_0x542571['length'];_0x1b06a4++){_0x542571[_0x1b06a4]['setDataValue'](_0x4e28('0xa2'),_0x4e28('0x12f'));}return _0x542571;}));_0xe8bc6['push'](_0x31359a[_0x4e28('0x128')]()[_0x4e28('0x14')](function(_0x145111){for(var _0x445ef8=0x0;_0x445ef8<_0x145111[_0x4e28('0x4d')];_0x445ef8++){_0x145111[_0x445ef8][_0x4e28('0x11f')](_0x4e28('0xa2'),'Openchannel');}return _0x145111;}));return BPromise['all'](_0xe8bc6);})[_0x4e28('0x14')](function(_0x18569a){var _0x2c3a45=_[_0x4e28('0x130')](_0x18569a);_0xe8bc6=[];return db[_0x4e28('0x6d')]['transaction'](function(_0x23b242){for(var _0x1e2ad5=0x0;_0x1e2ad5<_0x2c3a45[_0x4e28('0x4d')];_0x1e2ad5++){_0xe8bc6['push'](_0x2c3a45[_0x1e2ad5][_0x4e28('0x131')](_0x323294['id']),{'transaction':_0x23b242});}return BPromise['all'](_0xe8bc6)['then'](function(){if(_0x323294[_0x4e28('0xa3')]){return BPromise[_0x4e28('0x91')](_[_0x4e28('0x3f')](_0x2c3a45,function(_0x4e3136){return _0x4e3136[_0x4e28('0x12b')](_0x4e28('0xa2'))===_0x4e28('0x12a');}),function(_0x43c457){return db[_0x4e28('0xb6')][_0x4e28('0x2a')]({'where':{'VoiceQueueId':_0x43c457['id'],'UserId':_0x323294['id']},'transaction':_0x23b242});});}else{return;}})['then'](function(){db[_0x4e28('0x12c')][_0x4e28('0xd1')]({'where':{'teamId':_0x3cf309['id']}})[_0x4e28('0x14')](function(_0x6e2f3b){if(_0x6e2f3b){return db[_0x4e28('0x132')]['destroy']({'where':{'UserId':_0x323294['id'],'VoicePrefixId':_0x6e2f3b[_0x4e28('0x4e')][_0x4e28('0x12d')]}});}});})['then'](function(){for(var _0x2b7cf8=0x0;_0x2b7cf8<_0x2c3a45[_0x4e28('0x4d')];_0x2b7cf8++){var _0x27241b=_0x2c3a45[_0x2b7cf8]['getDataValue'](_0x4e28('0xa2'));var _0x246f20=_0x27241b+_0x4e28('0xae');socket[_0x4e28('0xaf')]('user'+_0x27241b+_0x4e28('0xba'),{'UserId':_0x323294['id'],['queueField']:_0x2c3a45[_0x2b7cf8]['id']});}});});});}});}})[_0x4e28('0x14')](respondWithStatusCode(_0x15be0c,null))[_0x4e28('0x1f')](handleError(_0x15be0c,null));};exports['getLists']=function(_0xb71d20,_0x1acf83){var _0x362144={};var _0x5052f4={};var _0xef30b0;var _0x2bb019;return db['User'][_0x4e28('0xd1')]({'where':{'id':_0xb71d20[_0x4e28('0x55')]['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x1acf83,null))[_0x4e28('0x14')](function(_0x2e84b5){if(_0x2e84b5){_0xef30b0=_0x2e84b5;_0x5052f4[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_0x4e28('0xd8')][_0x4e28('0x3b')]);_0x5052f4[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0xb71d20[_0x4e28('0x43')]);_0x5052f4[_0x4e28('0x59')]=_[_0x4e28('0x5a')](_0x5052f4[_0x4e28('0x56')],_0x5052f4[_0x4e28('0x43')]);_0x362144[_0x4e28('0x49')]=_[_0x4e28('0x5a')](_0x5052f4[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0xb71d20[_0x4e28('0x43')]['fields']));_0x362144[_0x4e28('0x49')]=_0x362144[_0x4e28('0x49')][_0x4e28('0x4d')]?_0x362144['attributes']:_0x5052f4[_0x4e28('0x56')];_0x362144['order']=qs[_0x4e28('0xd4')](_0xb71d20[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x362144[_0x4e28('0xd5')]=qs[_0x4e28('0x59')](_[_0x4e28('0xe5')](_0xb71d20['query'],_0x5052f4[_0x4e28('0x59')]));if(_0xb71d20[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x362144[_0x4e28('0xd5')]=_['merge'](_0x362144[_0x4e28('0xd5')],{'$or':_[_0x4e28('0x31')](_0x362144[_0x4e28('0x49')],function(_0x468c0a){var _0x13d65c={};_0x13d65c[_0x468c0a]={'$like':'%'+_0xb71d20[_0x4e28('0x43')][_0x4e28('0x3f')]+'%'};return _0x13d65c;})});}_0x362144=_[_0x4e28('0xd6')]({},_0x362144,_0xb71d20[_0x4e28('0x5c')]);return _0xef30b0[_0x4e28('0x133')](_0x362144);}})[_0x4e28('0x14')](function(_0x5369c1){if(_0x5369c1){_0x2bb019=_0x5369c1[_0x4e28('0x4d')];if(!_0xb71d20[_0x4e28('0x43')][_0x4e28('0xd7')](_0x4e28('0xde'))){_0x362144['limit']=qs[_0x4e28('0xdf')](_0xb71d20['query']['limit']);_0x362144[_0x4e28('0x24')]=qs[_0x4e28('0x24')](_0xb71d20[_0x4e28('0x43')]['offset']);}return _0xef30b0[_0x4e28('0x133')](_0x362144);}})['then'](function(_0x69df1e){if(_0x69df1e){return _0x69df1e?{'count':_0x2bb019,'rows':_0x69df1e}:null;}})[_0x4e28('0x14')](respondWithResult(_0x1acf83,null))[_0x4e28('0x1f')](handleError(_0x1acf83,null));};exports[_0x4e28('0x134')]=function(_0x391066,_0x209dc6){var _0x4ab3d1={};var _0x7e330a={};var _0x187645;return db[_0x4e28('0x42')][_0x4e28('0xd1')]({'where':{'id':_0x391066['params']['id']}})[_0x4e28('0x14')](handleEntityNotFound(_0x209dc6,null))[_0x4e28('0x14')](function(_0x151df2){if(_0x151df2){_0x187645=_0x151df2;_0x7e330a[_0x4e28('0x56')]=_[_0x4e28('0x58')](db[_0x4e28('0x42')]['rawAttributes']);_0x7e330a[_0x4e28('0x43')]=_[_0x4e28('0x58')](_0x391066[_0x4e28('0x43')]);_0x7e330a[_0x4e28('0x59')]=_['intersection'](_0x7e330a[_0x4e28('0x56')],_0x7e330a['query']);_0x4ab3d1[_0x4e28('0x49')]=_['intersection'](_0x7e330a[_0x4e28('0x56')],qs[_0x4e28('0x5b')](_0x391066[_0x4e28('0x43')]['fields']));_0x4ab3d1[_0x4e28('0x49')]=_0x4ab3d1[_0x4e28('0x49')]['length']?_0x4ab3d1['attributes']:_0x7e330a[_0x4e28('0x56')];_0x4ab3d1['order']=qs[_0x4e28('0xd4')](_0x391066[_0x4e28('0x43')][_0x4e28('0xd4')]);_0x4ab3d1[_0x4e28('0xd5')]=qs['filters'](_[_0x4e28('0xe5')](_0x391066[_0x4e28('0x43')],_0x7e330a[_0x4e28('0x59')]));if(_0x391066[_0x4e28('0x43')][_0x4e28('0x3f')]){_0x4ab3d1['where']=_[_0x4e28('0xd6')](_0x4ab3d1[_0x4e28('0xd5')],{'$or':_['map'](_0x4ab3d1['attributes'],function(_0x15b24a){var _0xfcc2f2={};_0xfcc2f2[_0x15b24a]={'$like':'%'+_0x391066['query'][_0x4e28('0x3f')]+'%'};return _0xfcc2f2;})});}_0x4ab3d1['model']=db[_0x4e28('0x42')];_0x4ab3d1['as']=_0x4e28('0x2e');_0x4ab3d1=_['merge']({},_0x4ab3d1,_0x391066['options']);return _0x187645[_0x4e28('0x101')]({'include':[_0x4ab3d1]});}})[_0x4e28('0x14')](function(_0x2ed890){if(_0x2ed890){var _0xfb8d01={},_0x508960=[];for(var _0x46009e=0x0;_0x46009e<_0x2ed890['length'];_0x46009e+=0x1){for(var _0x204c70=0x0,_0x2260f3;_0x204c70<_0x2ed890[_0x46009e]['Agents'][_0x4e28('0x4d')];_0x204c70+=0x1){_0x2260f3=_0x2ed890[_0x46009e][_0x4e28('0x2e')][_0x204c70]['get']({'plain':!![]});_0xfb8d01[_0x2260f3['id']]=_0x2260f3;}}_0xfb8d01=_[_0x4e28('0x135')](_0xfb8d01);for(var _0x2822e6=qs['offset'](_0x391066[_0x4e28('0x43')]['offset']);_0x2822e6<_0xfb8d01[_0x4e28('0x4d')]&&_0x508960[_0x4e28('0x4d')]=_0xa6e782){_0x576828=_0xa6e782;_0xd30b06=0xc8;}else{_0xd30b06=0xce;}_0x21a5f3[_0x65c9('0x1c')](_0xd30b06);return _0x21a5f3[_0x65c9('0x23')](_0x65c9('0x24'),_0x2146cb+'-'+_0x576828+'/'+_0xa6e782)[_0x65c9('0x1e')](_0x28078c);}return null;};}function saveUpdates(_0x604e6e){return function(_0x537e7f){if(_0x537e7f){return _0x537e7f[_0x65c9('0x25')](_0x604e6e)[_0x65c9('0x14')](function(_0x2b0e77){return _0x2b0e77;});}return null;};}function removeEntity(_0x2dc6cb){return function(_0x35b974){if(_0x35b974){return _0x35b974[_0x65c9('0x26')]()[_0x65c9('0x14')](function(){var _0xe15530=_0x35b974[_0x65c9('0x27')]({'plain':!![]});if(_0xe15530[_0x65c9('0x28')]===_0x65c9('0x29'))return;var _0x16196b=[{'name':_0x65c9('0x2a'),'value':_0x65c9('0x2b'),'ignore':!![]},{'name':_0x65c9('0x2c'),'value':_0x65c9('0x2d'),'ignore':![]},{'name':_0x65c9('0x2e'),'value':'telephone','ignore':![]}];var _0x23ebec=_(_0x16196b)[_0x65c9('0x2f')]('ignore')[_0x65c9('0x30')](_0x65c9('0x31'))[_0x65c9('0x31')]();if(_['includes'](_0x23ebec,_0xe15530[_0x65c9('0x28')])){return;}var _0xfcea9e=_[_0x65c9('0x32')](_0x16196b,[_0x65c9('0x31'),_0xe15530[_0x65c9('0x28')]])[_0x65c9('0x33')];return db['UserProfileResource']['destroy']({'where':{'type':_0xfcea9e,'resourceId':_0xe15530['id']}})[_0x65c9('0x14')](function(){return _0x35b974;});})['then'](function(){_0x2dc6cb[_0x65c9('0x1c')](0xcc)[_0x65c9('0x1d')]();});}};}function handleEntityNotFound(_0x1e512c){return function(_0x23adef){if(!_0x23adef){_0x1e512c['sendStatus'](0x194);}return _0x23adef;};}function handleError(_0x3e217a,_0x408bd7){_0x408bd7=_0x408bd7||0x1f4;return function(_0x4568a4){logger['error'](_0x4568a4['stack']);if(_0x4568a4[_0x65c9('0x33')]){delete _0x4568a4['name'];}_0x3e217a[_0x65c9('0x1c')](_0x408bd7)['send'](_0x4568a4);};}exports[_0x65c9('0x34')]=function(_0x4e80e8,_0x1ee19e){var _0x3830c6={},_0x5e7b0d={'count':0x0,'rows':[]};var _0x3c1110=_(db[_0x65c9('0x35')]['rawAttributes'])[_0x65c9('0x30')](function(_0xe50d96){return{'name':_0xe50d96[_0x65c9('0x36')],'type':_0xe50d96[_0x65c9('0x37')][_0x65c9('0x38')]};})[_0x65c9('0x2f')](function(_0xeb6170){return!_['includes']([_0x65c9('0x39'),_0x65c9('0x3a')],_0xeb6170[_0x65c9('0x33')]);})['value']();_0x3830c6=qs[_0x65c9('0x3b')](_0x3c1110,_0x4e80e8);var _0xb2eb70={'where':_0x3830c6[_0x65c9('0x3c')]};return db['User'][_0x65c9('0x22')](_0xb2eb70)[_0x65c9('0x14')](function(_0x46bef5){_0x5e7b0d['count']=_0x46bef5;if(_0x4e80e8[_0x65c9('0x3d')][_0x65c9('0x3e')]){_0x3830c6[_0x65c9('0x3f')]=[{'all':!![]}];}if(_0x4e80e8[_0x65c9('0x3d')]['userSetting']===_0x65c9('0x40')){_0x3830c6[_0x65c9('0x3f')]=[{'model':db[_0x65c9('0x41')],'as':'userSetting'}];}if(!_[_0x65c9('0x42')](_0x3830c6[_0x65c9('0x43')],'id')){_0x3830c6[_0x65c9('0x43')]['push']('id');}return db[_0x65c9('0x35')][_0x65c9('0x44')](_0x3830c6);})[_0x65c9('0x14')](function(_0x25d3de){_0x5e7b0d[_0x65c9('0x45')]=_0x25d3de;if(_0x4e80e8[_0x65c9('0x3d')][_0x65c9('0x46')]===_0x65c9('0x40')){var _0x2530c8=[];for(var _0x25048f=0x0;_0x25048f<_0x5e7b0d['rows'][_0x65c9('0x47')];_0x25048f++){_0x2530c8['push'](get_open_tabs(_0x65c9('0x48'),_0x5e7b0d[_0x65c9('0x45')][_0x25048f][_0x65c9('0x49')]));_0x2530c8[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4b'),_0x5e7b0d[_0x65c9('0x45')][_0x25048f][_0x65c9('0x49')]));_0x2530c8[_0x65c9('0x4a')](get_open_tabs('fax',_0x5e7b0d[_0x65c9('0x45')][_0x25048f][_0x65c9('0x49')]));_0x2530c8[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4c'),_0x5e7b0d[_0x65c9('0x45')][_0x25048f][_0x65c9('0x49')]));_0x2530c8[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4d'),_0x5e7b0d['rows'][_0x25048f]['dataValues']));_0x2530c8[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4e'),_0x5e7b0d[_0x65c9('0x45')][_0x25048f]['dataValues']));}return BPromise['all'](_0x2530c8)['then'](function(){return _0x5e7b0d;});}else{return _0x5e7b0d;}})[_0x65c9('0x14')](respondWithFilteredResult(_0x1ee19e,_0x3830c6))[_0x65c9('0x1b')](handleError(_0x1ee19e,null));};exports[_0x65c9('0x4f')]=function(_0x4f3310,_0x46140b){var _0xc524a6={'raw':![],'where':{'id':_0x4f3310[_0x65c9('0x50')]['id']}},_0x355c13={};_0x355c13['model']=_[_0x65c9('0x51')](_['keys'](db[_0x65c9('0x35')][_0x65c9('0x52')]),[_0x65c9('0x39'),_0x65c9('0x3a')]);_0x355c13[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x4f3310[_0x65c9('0x3d')]);_0x355c13['filters']=_[_0x65c9('0x54')](_0x355c13[_0x65c9('0x55')],_0x355c13['query']);_0xc524a6[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x355c13[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x4f3310[_0x65c9('0x3d')][_0x65c9('0x56')]));_0xc524a6[_0x65c9('0x43')]=_0xc524a6['attributes'][_0x65c9('0x47')]?_0xc524a6[_0x65c9('0x43')]:_0x355c13['model'];if(_0x4f3310['query']['includeAll']){_0xc524a6[_0x65c9('0x3f')]=[{'all':!![]}];}if(_0x4f3310[_0x65c9('0x3d')][_0x65c9('0x57')]===_0x65c9('0x40')){_0xc524a6[_0x65c9('0x3f')]=[{'model':db['UserSetting'],'as':_0x65c9('0x57')}];}_0xc524a6=_[_0x65c9('0x58')]({},_0xc524a6,_0x4f3310[_0x65c9('0x59')]);if(!_[_0x65c9('0x42')](_0xc524a6[_0x65c9('0x43')],'id')){_0xc524a6[_0x65c9('0x43')][_0x65c9('0x4a')]('id');}return db['User'][_0x65c9('0x32')](_0xc524a6)[_0x65c9('0x14')](handleEntityNotFound(_0x46140b,null))[_0x65c9('0x14')](function(_0x4b957){var _0x5f40b1=[];values=_0x4b957;if(_0x4f3310[_0x65c9('0x3d')]['openTabs']==='true'){_0x5f40b1[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x48'),_0x4b957[_0x65c9('0x49')]));_0x5f40b1['push'](get_open_tabs(_0x65c9('0x4b'),_0x4b957['dataValues']));_0x5f40b1['push'](get_open_tabs('openchannel',_0x4b957['dataValues']));_0x5f40b1[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4e'),_0x4b957[_0x65c9('0x49')]));_0x5f40b1[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x5a'),_0x4b957[_0x65c9('0x49')]));_0x5f40b1[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4c'),_0x4b957[_0x65c9('0x49')]));return BPromise[_0x65c9('0x5b')](_0x5f40b1);}else{return values;}})[_0x65c9('0x14')](function(){return values;})[_0x65c9('0x14')](respondWithResult(_0x46140b,null))['catch'](handleError(_0x46140b,null));};exports[_0x65c9('0x25')]=function(_0x65f1ba,_0x2c92e6){if(_0x65f1ba['body']['id']){delete _0x65f1ba[_0x65c9('0x5c')]['id'];}delete _0x65f1ba['body']['role'];return db['User'][_0x65c9('0x32')]({'where':{'id':_0x65f1ba['params']['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x2c92e6,null))[_0x65c9('0x14')](saveUpdates(_0x65f1ba[_0x65c9('0x5c')],null))[_0x65c9('0x14')](respondWithResult(_0x2c92e6,null))[_0x65c9('0x1b')](handleError(_0x2c92e6,null));};exports[_0x65c9('0x5d')]=function(_0x1aa269,_0x11e25c){return db[_0x65c9('0x35')][_0x65c9('0x5d')]()['then'](respondWithResult(_0x11e25c,null))['catch'](handleError(_0x11e25c,null));};exports[_0x65c9('0x5e')]=function(_0x2db606,_0x2378ba){return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x2db606['params']['id']}})['then'](handleEntityNotFound(_0x2378ba,null))['then'](function(_0x21ce90){if(_0x21ce90){return _0x21ce90[_0x65c9('0x5e')](_0x2db606[_0x65c9('0x5c')][_0x65c9('0x5f')],_[_0x65c9('0x60')](_0x2db606[_0x65c9('0x5c')],[_0x65c9('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x2378ba,null))[_0x65c9('0x1b')](handleError(_0x2378ba,null));};function validateUser(_0x2f12b3){return new BPromise(function(_0x2656dc,_0xa0682b){if(_0x2f12b3[_0x65c9('0x61')])return _0x2656dc(_0x2f12b3);return db[_0x65c9('0x62')]['findById'](0x1)[_0x65c9('0x14')](function(_0x2af002){if(_0x2af002[_0x65c9('0x63')])authService[_0x65c9('0x64')](_0x2f12b3[_0x65c9('0x39')]);db['User'][_0x65c9('0x65')](_0x65c9('0x61'))['then'](function(_0x2c20d4){if(_['isNil'](_0x2c20d4)){_0x2f12b3[_0x65c9('0x61')]=_0x2af002[_0x65c9('0x66')]||0x1;return;}if(_['isNil'](_0x2af002['min_internal'])||_0x2af002[_0x65c9('0x66')]===_0x2c20d4){_0x2f12b3[_0x65c9('0x61')]=_0x2c20d4+0x1;return;}if(_0x2af002['min_internal']>_0x2c20d4){_0x2f12b3[_0x65c9('0x61')]=_0x2af002['min_internal'];return;}return db[_0x65c9('0x67')][_0x65c9('0x3d')](_0x65c9('0x68'),{'type':db[_0x65c9('0x67')][_0x65c9('0x69')][_0x65c9('0x6a')]})[_0x65c9('0x14')](function(_0x17594b){if(_0x17594b&&_0x17594b[_0x65c9('0x47')]){for(var _0x14e4b3=0x0,_0x1d0539=_0x17594b['length'];_0x14e4b3<_0x1d0539&&_['isNil'](_0x2f12b3[_0x65c9('0x61')]);_0x14e4b3++){if(_0x2af002[_0x65c9('0x66')]<=_0x17594b[_0x14e4b3][_0x65c9('0x6b')]){_0x2f12b3['internal']=_0x17594b[_0x14e4b3][_0x65c9('0x6b')];}else if(_0x2af002[_0x65c9('0x66')]>_0x17594b[_0x14e4b3][_0x65c9('0x6b')]&&_0x2af002[_0x65c9('0x66')]<=_0x17594b[_0x14e4b3]['to']){_0x2f12b3[_0x65c9('0x61')]=_0x2af002[_0x65c9('0x66')];}}}if(_['isNil'](_0x2f12b3['internal'])){_0x2f12b3[_0x65c9('0x61')]=_0x2c20d4+0x1;}return _0x2656dc(_0x2f12b3);});});})['catch'](function(_0x2dbcd6){_0xa0682b(_0x2dbcd6);});});}function updateUser(_0x2399f5){return new BPromise(function(_0x397472,_0x53b61c){try{if(_0x2399f5[_0x65c9('0x6c')]){_0x2399f5[_0x65c9('0x6d')]=_0x2399f5[_0x65c9('0x61')];_0x2399f5[_0x65c9('0x6e')]={'mailbox':_0x2399f5['internal'],'password':_0x2399f5[_0x65c9('0x39')],'fullname':_0x2399f5['fullname'],'email':_0x2399f5[_0x65c9('0x6f')]};}if(_0x2399f5[_0x65c9('0x28')]===_0x65c9('0x2d')){if(!_0x2399f5[_0x65c9('0x70')])_0x2399f5[_0x65c9('0x70')]=[_0x65c9('0x71'),_0x65c9('0x72'),'103',_0x65c9('0x73'),_0x65c9('0x74'),_0x65c9('0x75'),_0x65c9('0x76'),_0x65c9('0x77'),'107',_0x65c9('0x78'),'109',_0x65c9('0x79'),_0x65c9('0x7a'),_0x65c9('0x7b'),_0x65c9('0x7c')];}_0x397472(_0x2399f5);}catch(_0x3ade95){_0x53b61c(_0x3ade95);}});}exports[_0x65c9('0x7d')]=function(_0x1fe83f,_0x54fa66){if(_0x1fe83f['user'][_0x65c9('0x28')]===_0x65c9('0x2d'))throw new Error(_0x65c9('0x7e'));if(_0x1fe83f[_0x65c9('0x5c')][_0x65c9('0x28')]===_0x65c9('0x2b')&&_0x1fe83f[_0x65c9('0x2b')][_0x65c9('0x28')]!==_0x65c9('0x29')){throw new Error(_0x65c9('0x7f'));}if(_0x1fe83f['body'][_0x65c9('0x28')]===_0x65c9('0x29')&&_0x1fe83f['user'][_0x65c9('0x28')]!==_0x65c9('0x29')){throw new Error(_0x65c9('0x80'));}return licenseUtil[_0x65c9('0x81')]([_0x1fe83f['body']])[_0x65c9('0x14')](function(){return validateUser(_0x1fe83f[_0x65c9('0x5c')]);})[_0x65c9('0x14')](function(_0xec55a2){return updateUser(_0xec55a2)[_0x65c9('0x14')](function(_0x1fe58f){if(_0x1fe58f[_0x65c9('0x28')]===_0x65c9('0x29')){_0x1fe58f[_0x65c9('0x82')]=_0x1fe83f[_0x65c9('0x2b')]['settingsEnabled'];delete _0x1fe58f[_0x65c9('0x83')];}return _0x1fe58f;});})[_0x65c9('0x14')](function(_0x4a8ab8){return db['User'][_0x65c9('0x7d')](_0x4a8ab8,{'include':[{'model':db[_0x65c9('0x6e')],'as':'VoiceMail'}]});})[_0x65c9('0x14')](function(_0x3dfe69){if(_0x1fe83f[_0x65c9('0x5c')][_0x65c9('0x28')]===_0x65c9('0x2b'))return _0x3dfe69;if(_0x1fe83f['user'][_0x65c9('0x28')]!==_0x65c9('0x2b'))return _0x3dfe69;return db[_0x65c9('0x84')][_0x65c9('0x32')]({'where':{'name':_0x3dfe69['role']===_0x65c9('0x2d')?_0x65c9('0x2c'):'Telephones','userProfileId':_0x1fe83f[_0x65c9('0x2b')][_0x65c9('0x83')]},'raw':!![]})[_0x65c9('0x14')](function(_0x31c6fc){if(!_0x31c6fc||_0x31c6fc[_0x65c9('0x85')]!=0x0)return _0x3dfe69;return db[_0x65c9('0x86')][_0x65c9('0x7d')]({'name':_0x3dfe69[_0x65c9('0x33')],'resourceId':_0x3dfe69['id'],'type':_0x31c6fc['name'],'sectionId':_0x31c6fc['id']},{})[_0x65c9('0x14')](function(){return _0x3dfe69;});})['catch'](function(_0xa0ce7e){logger['error'](_0x65c9('0x87'),_0xa0ce7e);throw _0xa0ce7e;});})[_0x65c9('0x14')](respondWithResult(_0x54fa66,0xc9))['catch'](handleError(_0x54fa66,null));};exports[_0x65c9('0x88')]=function(_0x6d03dc,_0x15cf46){var _0x582b85=_0x6d03dc[_0x65c9('0x5c')];var _0x5a3199=[];if(_0x6d03dc[_0x65c9('0x2b')][_0x65c9('0x28')]===_0x65c9('0x2d'))throw new Error(_0x65c9('0x7e'));if(_[_0x65c9('0x89')](_0x582b85,[_0x65c9('0x28'),_0x65c9('0x2b')])&&_0x6d03dc['user'][_0x65c9('0x28')]!=='admin'){throw new Error(_0x65c9('0x7f'));}if(_[_0x65c9('0x89')](_0x582b85,[_0x65c9('0x28'),_0x65c9('0x29')])&&_0x6d03dc[_0x65c9('0x2b')][_0x65c9('0x28')]!==_0x65c9('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x65c9('0x81')](_0x582b85)[_0x65c9('0x14')](function(){return validateUser(_0x582b85[0x0]);})['then'](function(){for(var _0xe25a61=0x1;_0xe25a61<_0x582b85[_0x65c9('0x47')];_0xe25a61++){var _0xd242f2=_0x582b85[_0xe25a61-0x1][_0x65c9('0x61')];if(!_0x582b85[_0xe25a61][_0x65c9('0x61')])_0x582b85[_0xe25a61][_0x65c9('0x61')]=_0xd242f2+0x1;_0x5a3199[_0x65c9('0x4a')](validateUser(_0x582b85[_0xe25a61]));}return BPromise[_0x65c9('0x5b')](_0x5a3199);})[_0x65c9('0x14')](function(){_0x5a3199=[];for(var _0x59dcbf=0x0;_0x59dcbf<_0x582b85[_0x65c9('0x47')];_0x59dcbf++){_0x5a3199[_0x65c9('0x4a')](updateUser(_0x582b85[_0x59dcbf]));}return BPromise['all'](_0x5a3199);})[_0x65c9('0x14')](function(){return BPromise['each'](_0x582b85,function(_0x3cbc47){return db['User'][_0x65c9('0x7d')](_0x3cbc47,{'include':[{'model':db[_0x65c9('0x6e')],'as':_0x65c9('0x6e')}]})[_0x65c9('0x14')](function(_0x47df32){_0x3cbc47['id']=_0x47df32['id'];return _0x3cbc47;});});})[_0x65c9('0x14')](function(_0x139ab8){if(_0x6d03dc[_0x65c9('0x5c')]['role']===_0x65c9('0x2b'))return _0x139ab8;if(_0x6d03dc[_0x65c9('0x2b')]['role']!==_0x65c9('0x2b'))return _0x139ab8;var _0x2c5b57=_[_0x65c9('0x89')](_0x139ab8,function(_0x4e7edb){return _0x4e7edb['role']===_0x65c9('0x2d')||_0x4e7edb[_0x65c9('0x28')]==='telephone';});if(!_0x2c5b57)return _0x139ab8;return db['UserProfileSection'][_0x65c9('0x44')]({'where':{'name':{'$or':['Agents',_0x65c9('0x2e')]},'userProfileId':_0x6d03dc['user'][_0x65c9('0x83')]},'raw':!![]})[_0x65c9('0x14')](function(_0x4aa2f7){if(_[_0x65c9('0x8a')](_0x4aa2f7)||!_['some'](_0x4aa2f7,['autoAssociation',0x0]))return _0x139ab8;_0x5a3199=[];var _0x4da935=_(_0x4aa2f7)[_0x65c9('0x30')](function(_0x15a24d){if(_0x15a24d['autoAssociation']===0x1)return;return _0x15a24d[_0x65c9('0x33')]===_0x65c9('0x2c')?_0x65c9('0x2d'):_0x65c9('0x8b');})[_0x65c9('0x8c')]()['value']();for(var _0x288df4=0x0;_0x288df4<_0x139ab8[_0x65c9('0x47')];_0x288df4++){if(!_[_0x65c9('0x42')](_0x4da935,_0x139ab8[_0x288df4][_0x65c9('0x28')]))return;var _0x11f580=_0x139ab8[_0x288df4]['role']===_0x65c9('0x2d')?_0x65c9('0x2c'):_0x65c9('0x2e');_0x5a3199[_0x65c9('0x4a')](db[_0x65c9('0x86')][_0x65c9('0x7d')]({'name':_0x139ab8[_0x288df4]['name'],'resourceId':_0x139ab8[_0x288df4]['id'],'type':_0x11f580,'sectionId':_[_0x65c9('0x32')](_0x4aa2f7,[_0x65c9('0x33'),_0x11f580])['id']},{}));}return BPromise[_0x65c9('0x5b')](_0x5a3199);});})['then'](respondWithResult(_0x15cf46,0xc9))[_0x65c9('0x1b')](handleError(_0x15cf46,null));};exports[_0x65c9('0x8d')]=function(_0x11d30f,_0x5962ce){if(_0x11d30f['body']['id']){delete _0x11d30f[_0x65c9('0x5c')]['id'];}return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x11d30f['params']['id']}})[_0x65c9('0x14')](function(_0x83deb9){if(!_0x83deb9)return null;if(_0x83deb9['id']===_0x11d30f[_0x65c9('0x2b')]['id']){if(!_0x11d30f['body'][_0x65c9('0x8e')]||!_0x11d30f['body'][_0x65c9('0x8f')]){throw new db[(_0x65c9('0x90'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x83deb9[_0x65c9('0x91')](_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8e')])){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))]('Wrong\x20credentials');}if(_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8e')]===_0x11d30f[_0x65c9('0x5c')]['newPassword']){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0x93'));}}else if(_0x11d30f[_0x65c9('0x2b')][_0x65c9('0x28')]===_0x65c9('0x29')){if(!_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8f')]){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x11d30f['user'][_0x65c9('0x28')]===_0x65c9('0x2b')){if(!_0x11d30f[_0x65c9('0x5c')]['newPassword']){throw new db['Sequelize'][(_0x65c9('0x92'))](_0x65c9('0x94'));}if(_0x83deb9[_0x65c9('0x28')]!==_0x65c9('0x2d')){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0x7e'));}}else{throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))]('Unauthorized');}return _0x83deb9;})[_0x65c9('0x14')](handleEntityNotFound(_0x5962ce,null))[_0x65c9('0x14')](function(_0x339127){return db['Setting'][_0x65c9('0x95')]({'attributes':['id',_0x65c9('0x63'),_0x65c9('0x96'),'passwordHistoryLimit']})[_0x65c9('0x14')](function(_0x2c1621){if(_0x2c1621['securePassword'])authService[_0x65c9('0x64')](_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8f')]);if(!_0x2c1621['enforcePasswordHistory']||!_0x339127[_0x65c9('0x97')])return _0x339127;authService[_0x65c9('0x98')](_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8f')],_0x339127[_0x65c9('0x97')],_0x2c1621[_0x65c9('0x99')]);return _0x339127;})[_0x65c9('0x14')](saveUpdates({'password':_0x11d30f[_0x65c9('0x5c')][_0x65c9('0x8f')],'passwordResetAt':_0x11d30f[_0x65c9('0x2b')]['id']==_0x11d30f['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x11d30f['body'][_0x65c9('0x8f')],_0x339127['previousPasswords'])},null));})['then'](respondWithResult(_0x5962ce,null))[_0x65c9('0x1b')](handleError(_0x5962ce,null));};exports['addQueues']=function(_0x192ccc,_0x534df3){var _0x1b6a2c=_0x192ccc[_0x65c9('0x5c')]['channel'];return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x192ccc[_0x65c9('0x50')]['id']},'attributes':['id',_0x65c9('0x33'),'role',_0x65c9('0x9a'),_0x65c9('0x9b'),'voicePause',_0x65c9('0x9c')]})[_0x65c9('0x14')](handleEntityNotFound(_0x534df3,null))[_0x65c9('0x14')](function(_0x2a0000){if(_0x2a0000){if(!utils[_0x65c9('0x9d')](_0x1b6a2c)){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))]('Unknown\x20channel');}return _0x2a0000[_0x65c9('0x9e')+_['capitalize'](_0x1b6a2c[_0x65c9('0x9f')]())+_0x65c9('0xa0')](_0x192ccc[_0x65c9('0x5c')]['ids'],{'penalty':_0x192ccc['body'][_0x65c9('0xa1')]||0x0})[_0x65c9('0xa2')](function(_0x3f51b9){for(var _0xe93b04=0x0;_0xe93b04<_0x192ccc['body'][_0x65c9('0x5f')][_0x65c9('0x47')];_0xe93b04+=0x1){var _0x5a7349={'UserId':Number(_0x192ccc[_0x65c9('0x50')]['id'])};_0x5a7349[_[_0x65c9('0xa3')](_0x1b6a2c['toLowerCase']())+_0x65c9('0xa4')]=Number(_0x192ccc[_0x65c9('0x5c')]['ids'][_0xe93b04]);socket[_0x65c9('0xa5')](_0x65c9('0x2b')+_[_0x65c9('0xa3')](_0x1b6a2c[_0x65c9('0x9f')]())+_0x65c9('0xa6'),_0x5a7349);}return _0x3f51b9;})['then'](function(){if(_0x1b6a2c===_0x65c9('0xa7')){return db['VoiceQueue'][_0x65c9('0x44')]({'where':{'id':_0x192ccc[_0x65c9('0x5c')][_0x65c9('0x5f')]||[]},'raw':!![],'attributes':['id',_0x65c9('0x33')]});}})[_0x65c9('0x14')](function(_0x554609){var _0x3ba781=_0x2a0000[_0x65c9('0x27')]({'plain':!![]});var _0x571e2f=[];if(_0x1b6a2c==='voice'&&_0x3ba781[_0x65c9('0x28')]==='agent'&&_0x3ba781['online']){for(var _0x440410=0x0;_0x440410<_0x554609[_0x65c9('0x47')];_0x440410+=0x1){_0x571e2f[_0x65c9('0x4a')]({'membername':_0x3ba781[_0x65c9('0x33')],'UserId':_0x3ba781['id'],'queue_name':_0x554609[_0x440410][_0x65c9('0x33')],'VoiceQueueId':_0x554609[_0x440410]['id'],'interface':_[_0x65c9('0xa8')](_0x3ba781[_0x65c9('0x9c')])?util[_0x65c9('0xa9')](_0x65c9('0xaa'),_0x3ba781[_0x65c9('0x33')]):_0x3ba781[_0x65c9('0x9c')],'paused':_0x3ba781[_0x65c9('0xab')]||![],'penalty':_0x192ccc['body'][_0x65c9('0xa1')]||0x0});}return BPromise[_0x65c9('0xac')](_0x571e2f,function(_0x1383e2){return db[_0x65c9('0xad')][_0x65c9('0xae')](_0x1383e2);});}return _0x2a0000;});}})[_0x65c9('0x14')](respondWithStatusCode(_0x534df3,null))[_0x65c9('0x1b')](handleError(_0x534df3,null));};exports[_0x65c9('0xaf')]=function(_0x2067e1,_0x205d06){var _0x350bbc,_0x3330c8;return db[_0x65c9('0x35')]['find']({'where':{'id':_0x2067e1['params']['id']},'attributes':['id',_0x65c9('0x33'),_0x65c9('0x28')]})['then'](handleEntityNotFound(_0x205d06,null))[_0x65c9('0x14')](function(_0x3264fc){if(_0x3264fc){_0x350bbc=_0x3264fc;if(!_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')]||!utils['isValidChannel'](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')])){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0xb1'));}return _0x3264fc[_0x65c9('0xb2')+_[_0x65c9('0xa3')](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')][_0x65c9('0x9f')]())+_0x65c9('0xa0')](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0x5f')]);}})['then'](function(_0x481d39){if(_[_0x65c9('0xb3')](_0x2067e1['query'][_0x65c9('0x5f')])){for(var _0x30967b=0x0;_0x30967b<_0x2067e1[_0x65c9('0x3d')][_0x65c9('0x5f')][_0x65c9('0x47')];_0x30967b+=0x1){_0x3330c8={'UserId':Number(_0x2067e1[_0x65c9('0x50')]['id'])};_0x3330c8[_[_0x65c9('0xa3')](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')]['toLowerCase']())+_0x65c9('0xa4')]=Number(_0x2067e1[_0x65c9('0x3d')][_0x65c9('0x5f')][_0x30967b]);socket[_0x65c9('0xa5')]('user'+_[_0x65c9('0xa3')](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')][_0x65c9('0x9f')]())+_0x65c9('0xb4'),_0x3330c8);}}else{_0x3330c8={'UserId':Number(_0x2067e1[_0x65c9('0x50')]['id'])};_0x3330c8[_['capitalize'](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')]['toLowerCase']())+_0x65c9('0xa4')]=Number(_0x2067e1[_0x65c9('0x3d')]['ids']);socket[_0x65c9('0xa5')]('user'+_[_0x65c9('0xa3')](_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')]['toLowerCase']())+_0x65c9('0xb4'),_0x3330c8);}return _0x481d39;})['then'](function(){if(_0x2067e1[_0x65c9('0x3d')][_0x65c9('0xb0')]===_0x65c9('0xa7')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2067e1[_0x65c9('0x50')]['id'],'VoiceQueueId':_0x2067e1['query'][_0x65c9('0x5f')]},'individualHooks':!![]})[_0x65c9('0x14')](function(){return _0x350bbc;});}return _0x350bbc;})['then'](respondWithStatusCode(_0x205d06,null))[_0x65c9('0x1b')](handleError(_0x205d06,null));};exports[_0x65c9('0xb5')]=function(_0x313942,_0x16e039){_0x313942['body'][_0x65c9('0xb6')]=_0x313942[_0x65c9('0xb7')][_0x65c9('0xb8')];return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x313942[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x16e039,null))[_0x65c9('0x14')](saveUpdates(_0x313942[_0x65c9('0x5c')],null))[_0x65c9('0x14')](respondWithResult(_0x16e039,null))[_0x65c9('0x1b')](handleError(_0x16e039,null));};exports['getAvatar']=function(_0x55ee41,_0x14b742){var _0x13f84a=path[_0x65c9('0xb9')](config[_0x65c9('0xba')],_0x65c9('0xbb'));return db['User'][_0x65c9('0x32')]({'where':{'id':_0x55ee41[_0x65c9('0x50')]['id']},'attributes':['id',_0x65c9('0xb6')],'raw':!![]})[_0x65c9('0x14')](handleEntityNotFound(_0x14b742,null))['then'](function(_0x1cd331){if(_0x1cd331){if(_[_0x65c9('0xa8')](_0x1cd331[_0x65c9('0xb6')])){return _0x14b742[_0x65c9('0xbc')](_0x13f84a);}else{if(!fs[_0x65c9('0xbd')](path[_0x65c9('0xb9')](config[_0x65c9('0xba')],_0x65c9('0xbe'),_0x1cd331[_0x65c9('0xb6')]))){return _0x14b742['download'](_0x13f84a);}return _0x14b742[_0x65c9('0xbc')](path[_0x65c9('0xb9')](config[_0x65c9('0xba')],_0x65c9('0xbe'),_0x1cd331[_0x65c9('0xb6')]));}}})[_0x65c9('0x1b')](handleError(_0x14b742,null));};exports[_0x65c9('0xbf')]=function(_0x1c01a2,_0x143e49){return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x1c01a2[_0x65c9('0x50')]['id']},'attributes':['id']})[_0x65c9('0x14')](handleEntityNotFound(_0x143e49,null))[_0x65c9('0x14')](function(_0xe5d79){var _0x14c46f=[];values=_0xe5d79['dataValues'];_0x14c46f[_0x65c9('0x4a')](get_open_tabs('chat',_0xe5d79[_0x65c9('0x49')]));_0x14c46f[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4b'),_0xe5d79[_0x65c9('0x49')]));_0x14c46f['push'](get_open_tabs(_0x65c9('0x4d'),_0xe5d79[_0x65c9('0x49')]));_0x14c46f[_0x65c9('0x4a')](get_open_tabs('whatsapp',_0xe5d79[_0x65c9('0x49')]));_0x14c46f[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x5a'),_0xe5d79[_0x65c9('0x49')]));_0x14c46f[_0x65c9('0x4a')](get_open_tabs(_0x65c9('0x4c'),_0xe5d79[_0x65c9('0x49')]));return BPromise[_0x65c9('0x5b')](_0x14c46f);})[_0x65c9('0x14')](function(_0x10455a){if(_0x10455a){var _0x382b82=_['map'](values[_0x65c9('0xc0')],function(_0x106034){return{'channel':_0x65c9('0xc1'),'id':_0x106034['id'],'createdAt':_0x106034[_0x65c9('0xc2')]};});var _0x494504=_[_0x65c9('0x30')](values[_0x65c9('0xc3')],function(_0xb4972b){return{'channel':_0x65c9('0xc4'),'id':_0xb4972b['id'],'createdAt':_0xb4972b[_0x65c9('0xc2')]};});var _0x187ab0=_[_0x65c9('0x30')](values[_0x65c9('0xc5')],function(_0xf9ddea){return{'channel':_0x65c9('0xc6'),'id':_0xf9ddea['id'],'createdAt':_0xf9ddea[_0x65c9('0xc2')]};});var _0x361f63=_['map'](values[_0x65c9('0xc7')],function(_0x225ebe){return{'channel':'MAIL','id':_0x225ebe['id'],'createdAt':_0x225ebe[_0x65c9('0xc2')]};});var _0x372133=_[_0x65c9('0x30')](values[_0x65c9('0xc8')],function(_0x29166a){return{'channel':_0x65c9('0xc9'),'id':_0x29166a['id'],'createdAt':_0x29166a[_0x65c9('0xc2')]};});var _0xb5f416=_[_0x65c9('0x30')](values[_0x65c9('0xca')],function(_0x220775){return{'channel':_0x65c9('0xcb'),'id':_0x220775['id'],'createdAt':_0x220775[_0x65c9('0xc2')]};});var _0x3cc6bf=_[_0x65c9('0xcc')](_0x382b82,_0x494504,_0x187ab0,_0x361f63,_0x372133,_0xb5f416);var _0x568692={'count':_0x3cc6bf[_0x65c9('0x47')],'rows':_0x3cc6bf};return _0x568692;}else return null;})[_0x65c9('0x14')](respondWithResult(_0x143e49,null))[_0x65c9('0x1b')](handleError(_0x143e49,null));};exports[_0x65c9('0xcd')]=function(_0x2350da,_0x24bb63){var _0x34583a={};var _0x24010b={};var _0x4241d8;var _0x535177;return db[_0x65c9('0x35')]['findOne']({'where':{'id':_0x2350da[_0x65c9('0x50')]['id']}})['then'](handleEntityNotFound(_0x24bb63,null))[_0x65c9('0x14')](function(_0x106902){if(_0x106902){_0x4241d8=_0x106902;_0x24010b[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xce')][_0x65c9('0x52')]);_0x24010b[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x2350da[_0x65c9('0x3d')]);_0x24010b['filters']=_[_0x65c9('0x54')](_0x24010b[_0x65c9('0x55')],_0x24010b['query']);_0x34583a[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x24010b['model'],qs['fields'](_0x2350da[_0x65c9('0x3d')]['fields']));_0x34583a[_0x65c9('0x43')]=_0x34583a[_0x65c9('0x43')][_0x65c9('0x47')]?_0x34583a[_0x65c9('0x43')]:_0x24010b[_0x65c9('0x55')];_0x34583a['order']=qs[_0x65c9('0xcf')](_0x2350da[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x34583a[_0x65c9('0x3c')]=qs['filters'](_[_0x65c9('0xd0')](_0x2350da[_0x65c9('0x3d')],_0x24010b['filters']));if(_0x2350da[_0x65c9('0x3d')]['filter']){_0x34583a['where']=_[_0x65c9('0x58')](_0x34583a['where'],{'$or':_[_0x65c9('0x30')](_0x34583a[_0x65c9('0x43')],function(_0xa046){var _0x1c8934={};_0x1c8934[_0xa046]={'$like':'%'+_0x2350da['query']['filter']+'%'};return _0x1c8934;})});}_0x34583a=_[_0x65c9('0x58')]({},_0x34583a,_0x2350da[_0x65c9('0x59')]);return _0x4241d8[_0x65c9('0xcd')](_0x34583a);}})['then'](function(_0x5290da){if(_0x5290da){_0x535177=_0x5290da[_0x65c9('0x47')];if(_0x2350da[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0x3e'))){_0x34583a[_0x65c9('0x3f')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x65c9('0x33'),_0x65c9('0xd2')],'where':_0x2350da[_0x65c9('0x3d')][_0x65c9('0xd3')]?{'id':_0x2350da[_0x65c9('0x3d')][_0x65c9('0xd3')]}:undefined,'required':_0x2350da[_0x65c9('0x3d')]['tag']?!![]:![]}];}if(!_0x2350da[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x34583a[_0x65c9('0x21')]=qs['limit'](_0x2350da[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x34583a[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x2350da[_0x65c9('0x3d')]['offset']);}return _0x4241d8['getContacts'](_0x34583a);}})[_0x65c9('0x14')](function(_0x1146a8){if(_0x1146a8){return _0x1146a8?{'count':_0x535177,'rows':_0x1146a8}:null;}})['then'](respondWithResult(_0x24bb63,null))[_0x65c9('0x1b')](handleError(_0x24bb63,null));};exports[_0x65c9('0xd5')]=function(_0x14f59b,_0x10ed4e){var _0x30e56d;var _0x2ff07d={};var _0x25a78a;return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x14f59b[_0x65c9('0x50')]['id']},'attributes':['id',_0x65c9('0x33'),_0x65c9('0x28')]})[_0x65c9('0x14')](handleEntityNotFound(_0x10ed4e,null))[_0x65c9('0x14')](function(_0x28aaf0){if(!utils['isValidChannel'](_0x14f59b[_0x65c9('0x3d')]['channel'])){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))]('Unknown\x20channel');}_0x30e56d=_0x28aaf0;var _0x184b83={};_0x184b83[_0x65c9('0x55')]=_['keys'](db[_[_0x65c9('0xa3')](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0xb0')])+_0x65c9('0xd6')]['rawAttributes']);_0x184b83[_0x65c9('0x3d')]=_['keys'](_0x14f59b[_0x65c9('0x3d')]);_0x184b83[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x184b83[_0x65c9('0x55')],_0x184b83[_0x65c9('0x3d')]);_0x2ff07d[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x184b83[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x14f59b[_0x65c9('0x3d')]['fields']));_0x2ff07d[_0x65c9('0x43')]=_0x2ff07d[_0x65c9('0x43')][_0x65c9('0x47')]?_0x2ff07d[_0x65c9('0x43')]:_0x184b83['model'];_0x2ff07d['order']=qs[_0x65c9('0xcf')](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x2ff07d[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x14f59b[_0x65c9('0x3d')],_0x184b83[_0x65c9('0xd7')]));if(_0x14f59b[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x2ff07d[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x2ff07d[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x2ff07d[_0x65c9('0x43')],function(_0x63bfb3){var _0xd5169d={};_0xd5169d[_0x63bfb3]={'$like':'%'+_0x14f59b[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0xd5169d;})});}_0x2ff07d=_[_0x65c9('0x58')]({},_0x2ff07d,_0x14f59b['options']);switch(_0x30e56d[_0x65c9('0x28')]){case _0x65c9('0x29'):return db[_[_0x65c9('0xa3')](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0xb0')])+_0x65c9('0xd6')][_0x65c9('0x44')](_0x2ff07d);case _0x65c9('0x2b'):case _0x65c9('0x2d'):return _0x30e56d['get'+_[_0x65c9('0xa3')](_0x14f59b['query']['channel'])+'Queues'](_0x2ff07d);default:throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0xd8'));}})[_0x65c9('0x14')](function(_0x1e3394){_0x25a78a=_0x1e3394[_0x65c9('0x47')];if(!_0x14f59b[_0x65c9('0x3d')]['hasOwnProperty']('nolimit')){_0x2ff07d[_0x65c9('0x21')]=qs['limit'](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x2ff07d[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0x1f')]);}switch(_0x30e56d[_0x65c9('0x28')]){case _0x65c9('0x29'):return db[_[_0x65c9('0xa3')](_0x14f59b['query'][_0x65c9('0xb0')])+_0x65c9('0xd6')]['findAll'](_0x2ff07d);case _0x65c9('0x2b'):case _0x65c9('0x2d'):return _0x30e56d[_0x65c9('0x27')+_[_0x65c9('0xa3')](_0x14f59b[_0x65c9('0x3d')][_0x65c9('0xb0')])+'Queues'](_0x2ff07d);}})['then'](function(_0x20676c){return{'count':_0x25a78a,'rows':_0x20676c};})[_0x65c9('0x14')](respondWithResult(_0x10ed4e,null))[_0x65c9('0x1b')](handleError(_0x10ed4e,null));};exports['getVoiceQueuesRt']=function(_0x4566bb,_0x45ba4b){var _0xd5ce00={};var _0x1d45d1={};var _0x1d5a44;var _0x24429a;return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x4566bb['params']['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x45ba4b,null))[_0x65c9('0x14')](function(_0x4e7a9e){if(_0x4e7a9e){_0x1d5a44=_0x4e7a9e;_0x1d45d1[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xad')][_0x65c9('0x52')]);_0x1d45d1[_0x65c9('0x3d')]=_['keys'](_0x4566bb[_0x65c9('0x3d')]);_0x1d45d1[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x1d45d1[_0x65c9('0x55')],_0x1d45d1[_0x65c9('0x3d')]);_0xd5ce00[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x1d45d1[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x4566bb['query'][_0x65c9('0x56')]));_0xd5ce00['attributes']=_0xd5ce00['attributes']['length']?_0xd5ce00[_0x65c9('0x43')]:_0x1d45d1[_0x65c9('0x55')];_0xd5ce00[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x4566bb[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0xd5ce00[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x4566bb[_0x65c9('0x3d')],_0x1d45d1['filters']));if(_0x4566bb[_0x65c9('0x3d')]['filter']){_0xd5ce00['where']=_[_0x65c9('0x58')](_0xd5ce00[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0xd5ce00[_0x65c9('0x43')],function(_0xa1d477){var _0x117584={};_0x117584[_0xa1d477]={'$like':'%'+_0x4566bb[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x117584;})});}_0xd5ce00=_[_0x65c9('0x58')]({},_0xd5ce00,_0x4566bb[_0x65c9('0x59')]);return _0x1d5a44[_0x65c9('0xda')](_0xd5ce00);}})['then'](function(_0x42d025){if(_0x42d025){_0x24429a=_0x42d025['length'];if(!_0x4566bb[_0x65c9('0x3d')]['hasOwnProperty'](_0x65c9('0xd4'))){_0xd5ce00[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x4566bb[_0x65c9('0x3d')][_0x65c9('0x21')]);_0xd5ce00[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x4566bb[_0x65c9('0x3d')]['offset']);}return _0x1d5a44['getVoiceQueuesRt'](_0xd5ce00);}})[_0x65c9('0x14')](function(_0x5af425){if(_0x5af425){return _0x5af425?{'count':_0x24429a,'rows':_0x5af425}:null;}})[_0x65c9('0x14')](respondWithResult(_0x45ba4b,null))['catch'](handleError(_0x45ba4b,null));};exports['getGroups']=function(_0x437d69,_0x2b9696){var _0x56c780={};var _0x3c4504={};var _0x45b047;var _0x11fbcf;return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x437d69['params']['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x2b9696,null))[_0x65c9('0x14')](function(_0x556526){if(_0x556526){_0x45b047=_0x556526;_0x3c4504[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xdb')]['rawAttributes']);_0x3c4504[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x437d69[_0x65c9('0x3d')]);_0x3c4504[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x3c4504[_0x65c9('0x55')],_0x3c4504[_0x65c9('0x3d')]);_0x56c780[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x3c4504[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x437d69[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x56c780[_0x65c9('0x43')]=_0x56c780[_0x65c9('0x43')][_0x65c9('0x47')]?_0x56c780[_0x65c9('0x43')]:_0x3c4504['model'];_0x56c780['order']=qs['sort'](_0x437d69[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x56c780[_0x65c9('0x3c')]=qs['filters'](_[_0x65c9('0xd0')](_0x437d69[_0x65c9('0x3d')],_0x3c4504[_0x65c9('0xd7')]));if(_0x437d69[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x56c780[_0x65c9('0x3c')]=_['merge'](_0x56c780['where'],{'$or':_[_0x65c9('0x30')](_0x56c780[_0x65c9('0x43')],function(_0x1b65f9){var _0xe7f270={};_0xe7f270[_0x1b65f9]={'$like':'%'+_0x437d69['query'][_0x65c9('0x2f')]+'%'};return _0xe7f270;})});}_0x56c780=_[_0x65c9('0x58')]({},_0x56c780,_0x437d69['options']);return _0x45b047[_0x65c9('0xdc')](_0x56c780);}})[_0x65c9('0x14')](function(_0x2fc2e3){if(_0x2fc2e3){_0x11fbcf=_0x2fc2e3[_0x65c9('0x47')];if(!_0x437d69[_0x65c9('0x3d')]['hasOwnProperty'](_0x65c9('0xd4'))){_0x56c780['limit']=qs[_0x65c9('0x21')](_0x437d69[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x56c780[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x437d69[_0x65c9('0x3d')][_0x65c9('0x1f')]);}return _0x45b047[_0x65c9('0xdc')](_0x56c780);}})[_0x65c9('0x14')](function(_0x2a6e9e){if(_0x2a6e9e){return _0x2a6e9e?{'count':_0x11fbcf,'rows':_0x2a6e9e}:null;}})['then'](respondWithResult(_0x2b9696,null))[_0x65c9('0x1b')](handleError(_0x2b9696,null));};exports[_0x65c9('0xdd')]=function(_0x429b15,_0x2b5ee9){var _0x1776ed={'raw':!![],'where':{}};var _0x4a4456={};var _0x32ae69={'count':0x0,'rows':[]};return db['User'][_0x65c9('0x95')]({'where':{'id':_0x429b15[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x2b5ee9,null))[_0x65c9('0x14')](function(_0x139456){if(_0x139456){_0x4a4456['model']=_[_0x65c9('0x53')](db['VoiceRecording'][_0x65c9('0x52')]);_0x4a4456[_0x65c9('0x3d')]=_['keys'](_0x429b15[_0x65c9('0x3d')]);_0x4a4456['filters']=_['intersection'](_0x4a4456['model'],_0x4a4456[_0x65c9('0x3d')]);_0x1776ed[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x4a4456[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x429b15[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x1776ed[_0x65c9('0x43')]=_0x1776ed['attributes'][_0x65c9('0x47')]?_0x1776ed[_0x65c9('0x43')]:_0x4a4456[_0x65c9('0x55')];if(!_0x429b15[_0x65c9('0x3d')]['hasOwnProperty'](_0x65c9('0xd4'))){_0x1776ed[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x429b15[_0x65c9('0x3d')]['limit']);_0x1776ed[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x429b15[_0x65c9('0x3d')][_0x65c9('0x1f')]);}_0x1776ed[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x429b15[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x1776ed[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x429b15[_0x65c9('0x3d')],_0x4a4456[_0x65c9('0xd7')]));_0x1776ed[_0x65c9('0x3c')][_0x65c9('0xde')]=_0x139456['id'];if(_0x429b15['query'][_0x65c9('0x2f')]){_0x1776ed[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x1776ed['where'],{'$or':_[_0x65c9('0x30')](_0x1776ed[_0x65c9('0x43')],function(_0x2b9294){var _0x2cd443={};_0x2cd443[_0x2b9294]={'$like':'%'+_0x429b15[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x2cd443;})});}_0x1776ed=_[_0x65c9('0x58')]({},_0x1776ed,_0x429b15[_0x65c9('0x59')]);return db[_0x65c9('0xdf')][_0x65c9('0x22')]({'where':_0x1776ed[_0x65c9('0x3c')]})[_0x65c9('0x14')](function(_0x203598){_0x32ae69['count']=_0x203598;if(_0x429b15['query'][_0x65c9('0x3e')]){_0x1776ed[_0x65c9('0x3f')]=[{'all':!![]}];}return db[_0x65c9('0xdf')][_0x65c9('0x44')](_0x1776ed);})[_0x65c9('0x14')](function(_0x847635){_0x32ae69[_0x65c9('0x45')]=_0x847635;return _0x32ae69;});}})[_0x65c9('0x14')](respondWithFilteredResult(_0x2b5ee9,_0x1776ed))[_0x65c9('0x1b')](handleError(_0x2b5ee9,null));};exports[_0x65c9('0xe0')]=function(_0x58b13d,_0x426ea4){var _0x257f5d={'raw':!![],'where':{}};var _0xed0037={};var _0x4d972c={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x58b13d[_0x65c9('0x50')]['id']}})['then'](handleEntityNotFound(_0x426ea4,null))['then'](function(_0x215f5b){if(_0x215f5b){_0xed0037[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xe1')][_0x65c9('0x52')]);_0xed0037[_0x65c9('0x3d')]=_['keys'](_0x58b13d[_0x65c9('0x3d')]);_0xed0037[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0xed0037[_0x65c9('0x55')],_0xed0037[_0x65c9('0x3d')]);_0x257f5d[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0xed0037[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x58b13d[_0x65c9('0x3d')]['fields']));_0x257f5d[_0x65c9('0x43')]=_0x257f5d[_0x65c9('0x43')]['length']?_0x257f5d['attributes']:_0xed0037[_0x65c9('0x55')];if(!_0x58b13d[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x257f5d[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x58b13d[_0x65c9('0x3d')]['limit']);_0x257f5d[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x58b13d['query']['offset']);}_0x257f5d['order']=qs[_0x65c9('0xcf')](_0x58b13d[_0x65c9('0x3d')]['sort']);_0x257f5d[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x58b13d[_0x65c9('0x3d')],_0xed0037[_0x65c9('0xd7')]));_0x257f5d['where'][_0x65c9('0xde')]=_0x215f5b['id'];if(_0x58b13d['query'][_0x65c9('0x2f')]){_0x257f5d[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x257f5d[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x257f5d['attributes'],function(_0x26afc5){var _0x26b87d={};_0x26b87d[_0x26afc5]={'$like':'%'+_0x58b13d[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x26b87d;})});}_0x257f5d=_['merge']({},_0x257f5d,_0x58b13d['options']);return db[_0x65c9('0xe1')][_0x65c9('0x22')]({'where':_0x257f5d[_0x65c9('0x3c')]})[_0x65c9('0x14')](function(_0x348c05){_0x4d972c[_0x65c9('0x22')]=_0x348c05;if(_0x58b13d[_0x65c9('0x3d')]['includeAll']){_0x257f5d[_0x65c9('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x65c9('0x44')](_0x257f5d);})[_0x65c9('0x14')](function(_0x19c422){_0x4d972c[_0x65c9('0x45')]=_0x19c422;return _0x4d972c;});}})[_0x65c9('0x14')](respondWithFilteredResult(_0x426ea4,_0x257f5d))['catch'](handleError(_0x426ea4,null));};exports[_0x65c9('0xe2')]=function(_0x2a2e71,_0x30037f){var _0x200acd={};var _0x179ddf={};var _0x5f1b76;var _0x5e1fcf;return db[_0x65c9('0x35')]['findOne']({'where':{'id':_0x2a2e71[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x30037f,null))[_0x65c9('0x14')](function(_0x53aabd){if(_0x53aabd){_0x5f1b76=_0x53aabd;_0x179ddf[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xe3')][_0x65c9('0x52')]);_0x179ddf[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x2a2e71['query']);_0x179ddf[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x179ddf[_0x65c9('0x55')],_0x179ddf[_0x65c9('0x3d')]);_0x200acd[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x179ddf[_0x65c9('0x55')],qs['fields'](_0x2a2e71[_0x65c9('0x3d')]['fields']));_0x200acd[_0x65c9('0x43')]=_0x200acd['attributes'][_0x65c9('0x47')]?_0x200acd[_0x65c9('0x43')]:_0x179ddf[_0x65c9('0x55')];_0x200acd[_0x65c9('0xd9')]=qs['sort'](_0x2a2e71[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x200acd[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_['pick'](_0x2a2e71[_0x65c9('0x3d')],_0x179ddf['filters']));if(_0x2a2e71[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x200acd['where']=_[_0x65c9('0x58')](_0x200acd['where'],{'$or':_[_0x65c9('0x30')](_0x200acd[_0x65c9('0x43')],function(_0x159d10){var _0x4da806={};_0x4da806[_0x159d10]={'$like':'%'+_0x2a2e71['query'][_0x65c9('0x2f')]+'%'};return _0x4da806;})});}_0x200acd=_[_0x65c9('0x58')]({},_0x200acd,_0x2a2e71[_0x65c9('0x59')]);return _0x5f1b76[_0x65c9('0xe2')](_0x200acd);}})[_0x65c9('0x14')](function(_0x54a51c){if(_0x54a51c){_0x5e1fcf=_0x54a51c[_0x65c9('0x47')];if(!_0x2a2e71[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x200acd[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x2a2e71[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x200acd[_0x65c9('0x1f')]=qs['offset'](_0x2a2e71['query']['offset']);}return _0x5f1b76[_0x65c9('0xe2')](_0x200acd);}})[_0x65c9('0x14')](function(_0x32019b){if(_0x32019b){return _0x32019b?{'count':_0x5e1fcf,'rows':_0x32019b}:null;}})[_0x65c9('0x14')](respondWithResult(_0x30037f,null))[_0x65c9('0x1b')](handleError(_0x30037f,null));};exports[_0x65c9('0xe4')]=function(_0x508178,_0xf25b58){var _0x132e87={};var _0x59bb43={};var _0x3e97a7;var _0x32d015;return db['User'][_0x65c9('0x95')]({'where':{'id':_0x508178[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0xf25b58,null))[_0x65c9('0x14')](function(_0xacb45e){if(_0xacb45e){_0x3e97a7=_0xacb45e;_0x59bb43['model']=_[_0x65c9('0x53')](db[_0x65c9('0xe5')][_0x65c9('0x52')]);_0x59bb43[_0x65c9('0x3d')]=_['keys'](_0x508178[_0x65c9('0x3d')]);_0x59bb43['filters']=_[_0x65c9('0x54')](_0x59bb43['model'],_0x59bb43[_0x65c9('0x3d')]);_0x132e87[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x59bb43['model'],qs[_0x65c9('0x56')](_0x508178[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x132e87['attributes']=_0x132e87[_0x65c9('0x43')][_0x65c9('0x47')]?_0x132e87['attributes']:_0x59bb43[_0x65c9('0x55')];_0x132e87[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x508178[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x132e87[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x508178[_0x65c9('0x3d')],_0x59bb43[_0x65c9('0xd7')]));if(_0x508178[_0x65c9('0x3d')]['filter']){_0x132e87[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x132e87[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x132e87[_0x65c9('0x43')],function(_0xb3fb03){var _0x2d61f9={};_0x2d61f9[_0xb3fb03]={'$like':'%'+_0x508178[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x2d61f9;})});}_0x132e87=_[_0x65c9('0x58')]({},_0x132e87,_0x508178['options']);return _0x3e97a7[_0x65c9('0xe4')](_0x132e87);}})[_0x65c9('0x14')](function(_0x32b8b5){if(_0x32b8b5){_0x32d015=_0x32b8b5[_0x65c9('0x47')];if(!_0x508178['query'][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x132e87[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x508178[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x132e87['offset']=qs[_0x65c9('0x1f')](_0x508178[_0x65c9('0x3d')][_0x65c9('0x1f')]);}return _0x3e97a7[_0x65c9('0xe4')](_0x132e87);}})[_0x65c9('0x14')](function(_0x28b9d0){if(_0x28b9d0){return _0x28b9d0?{'count':_0x32d015,'rows':_0x28b9d0}:null;}})[_0x65c9('0x14')](respondWithResult(_0xf25b58,null))[_0x65c9('0x1b')](handleError(_0xf25b58,null));};exports[_0x65c9('0xe6')]=function(_0x31d81b,_0x56e16a){var _0x2de89d={'raw':!![],'where':{}};var _0x5e2f7a={};var _0x28d86d={'count':0x0,'rows':[]};return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x31d81b['params']['id']}})['then'](handleEntityNotFound(_0x56e16a,null))[_0x65c9('0x14')](function(_0x3ad324){if(_0x3ad324){_0x5e2f7a[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xe7')][_0x65c9('0x52')]);_0x5e2f7a[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x31d81b[_0x65c9('0x3d')]);_0x5e2f7a['filters']=_['intersection'](_0x5e2f7a[_0x65c9('0x55')],_0x5e2f7a['query']);_0x2de89d[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x5e2f7a['model'],qs['fields'](_0x31d81b[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x2de89d[_0x65c9('0x43')]=_0x2de89d[_0x65c9('0x43')][_0x65c9('0x47')]?_0x2de89d['attributes']:_0x5e2f7a[_0x65c9('0x55')];if(!_0x31d81b['query'][_0x65c9('0xd1')]('nolimit')){_0x2de89d[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x31d81b['query'][_0x65c9('0x21')]);_0x2de89d[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x31d81b[_0x65c9('0x3d')]['offset']);}_0x2de89d[_0x65c9('0xd9')]=qs['sort'](_0x31d81b[_0x65c9('0x3d')]['sort']);_0x2de89d[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_['pick'](_0x31d81b[_0x65c9('0x3d')],_0x5e2f7a[_0x65c9('0xd7')]));_0x2de89d[_0x65c9('0x3c')][_0x65c9('0xde')]=_0x3ad324['id'];if(_0x31d81b[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x2de89d[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x2de89d[_0x65c9('0x3c')],{'$or':_['map'](_0x2de89d[_0x65c9('0x43')],function(_0x18c092){var _0x57b6cf={};_0x57b6cf[_0x18c092]={'$like':'%'+_0x31d81b[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x57b6cf;})});}_0x2de89d=_[_0x65c9('0x58')]({},_0x2de89d,_0x31d81b[_0x65c9('0x59')]);return db[_0x65c9('0xe7')]['count']({'where':_0x2de89d[_0x65c9('0x3c')]})['then'](function(_0x3f9edb){_0x28d86d[_0x65c9('0x22')]=_0x3f9edb;if(_0x31d81b['query'][_0x65c9('0x3e')]){_0x2de89d[_0x65c9('0x3f')]=[{'all':!![]}];}return db[_0x65c9('0xe7')][_0x65c9('0x44')](_0x2de89d);})[_0x65c9('0x14')](function(_0x47f204){_0x28d86d[_0x65c9('0x45')]=_0x47f204;return _0x28d86d;});}})[_0x65c9('0x14')](respondWithFilteredResult(_0x56e16a,_0x2de89d))['catch'](handleError(_0x56e16a,null));};exports[_0x65c9('0xe8')]=function(_0x551e0d,_0x1564b5){var _0x151d53={};var _0x190fd7={};var _0x4b0bc4;var _0x470501;return db[_0x65c9('0x35')]['findOne']({'where':{'id':_0x551e0d[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x1564b5,null))[_0x65c9('0x14')](function(_0x5e15b5){if(_0x5e15b5){_0x4b0bc4=_0x5e15b5;_0x190fd7['model']=_[_0x65c9('0x53')](db[_0x65c9('0xe9')][_0x65c9('0x52')]);_0x190fd7[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x551e0d[_0x65c9('0x3d')]);_0x190fd7[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x190fd7[_0x65c9('0x55')],_0x190fd7[_0x65c9('0x3d')]);_0x151d53[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x190fd7['model'],qs['fields'](_0x551e0d[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x151d53[_0x65c9('0x43')]=_0x151d53[_0x65c9('0x43')][_0x65c9('0x47')]?_0x151d53[_0x65c9('0x43')]:_0x190fd7[_0x65c9('0x55')];_0x151d53[_0x65c9('0xd9')]=qs['sort'](_0x551e0d[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x151d53[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_['pick'](_0x551e0d[_0x65c9('0x3d')],_0x190fd7[_0x65c9('0xd7')]));if(_0x551e0d[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x151d53[_0x65c9('0x3c')]=_['merge'](_0x151d53[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x151d53[_0x65c9('0x43')],function(_0x701963){var _0xef23dd={};_0xef23dd[_0x701963]={'$like':'%'+_0x551e0d[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0xef23dd;})});}_0x151d53=_[_0x65c9('0x58')]({},_0x151d53,_0x551e0d[_0x65c9('0x59')]);return _0x4b0bc4['getSmsInteractions'](_0x151d53);}})[_0x65c9('0x14')](function(_0x584dcd){if(_0x584dcd){_0x470501=_0x584dcd[_0x65c9('0x47')];if(!_0x551e0d[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x151d53[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x551e0d[_0x65c9('0x3d')]['limit']);_0x151d53[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x551e0d[_0x65c9('0x3d')][_0x65c9('0x1f')]);}return _0x4b0bc4[_0x65c9('0xe8')](_0x151d53);}})['then'](function(_0x1e82cf){if(_0x1e82cf){return _0x1e82cf?{'count':_0x470501,'rows':_0x1e82cf}:null;}})[_0x65c9('0x14')](respondWithResult(_0x1564b5,null))[_0x65c9('0x1b')](handleError(_0x1564b5,null));};exports[_0x65c9('0xea')]=function(_0x46d6bb,_0x31e333){var _0x44b453={};var _0x4a8970={};var _0x36e46e;var _0x418e9b;return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x46d6bb['params']['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x31e333,null))[_0x65c9('0x14')](function(_0x27cb63){if(_0x27cb63){_0x36e46e=_0x27cb63;_0x4a8970[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0xeb')][_0x65c9('0x52')]);_0x4a8970[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x46d6bb['query']);_0x4a8970[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x4a8970['model'],_0x4a8970[_0x65c9('0x3d')]);_0x44b453[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x4a8970[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x46d6bb[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x44b453['attributes']=_0x44b453[_0x65c9('0x43')][_0x65c9('0x47')]?_0x44b453['attributes']:_0x4a8970[_0x65c9('0x55')];_0x44b453['order']=qs[_0x65c9('0xcf')](_0x46d6bb[_0x65c9('0x3d')]['sort']);_0x44b453[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_[_0x65c9('0xd0')](_0x46d6bb[_0x65c9('0x3d')],_0x4a8970[_0x65c9('0xd7')]));if(_0x46d6bb[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x44b453[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x44b453[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x44b453[_0x65c9('0x43')],function(_0x43c6a5){var _0x1c2230={};_0x1c2230[_0x43c6a5]={'$like':'%'+_0x46d6bb[_0x65c9('0x3d')]['filter']+'%'};return _0x1c2230;})});}_0x44b453=_[_0x65c9('0x58')]({},_0x44b453,_0x46d6bb[_0x65c9('0x59')]);return _0x36e46e['getFaxInteractions'](_0x44b453);}})['then'](function(_0x100087){if(_0x100087){_0x418e9b=_0x100087[_0x65c9('0x47')];if(!_0x46d6bb[_0x65c9('0x3d')]['hasOwnProperty'](_0x65c9('0xd4'))){_0x44b453[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x46d6bb['query']['limit']);_0x44b453['offset']=qs[_0x65c9('0x1f')](_0x46d6bb[_0x65c9('0x3d')][_0x65c9('0x1f')]);}return _0x36e46e[_0x65c9('0xea')](_0x44b453);}})['then'](function(_0x159f96){if(_0x159f96){return _0x159f96?{'count':_0x418e9b,'rows':_0x159f96}:null;}})[_0x65c9('0x14')](respondWithResult(_0x31e333,null))[_0x65c9('0x1b')](handleError(_0x31e333,null));};exports[_0x65c9('0xec')]=function(_0x242f11,_0x11bbab){var _0x166ae3={};var _0x2c972f={};var _0x477d70;var _0x5a7658;return db['User'][_0x65c9('0x95')]({'where':{'id':_0x242f11[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x11bbab,null))[_0x65c9('0x14')](function(_0x2e86fe){if(_0x2e86fe){_0x477d70=_0x2e86fe;_0x2c972f[_0x65c9('0x55')]=_[_0x65c9('0x53')](db['WhatsappInteraction'][_0x65c9('0x52')]);_0x2c972f[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x242f11[_0x65c9('0x3d')]);_0x2c972f[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x2c972f[_0x65c9('0x55')],_0x2c972f[_0x65c9('0x3d')]);_0x166ae3['attributes']=_[_0x65c9('0x54')](_0x2c972f[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x242f11['query'][_0x65c9('0x56')]));_0x166ae3['attributes']=_0x166ae3[_0x65c9('0x43')][_0x65c9('0x47')]?_0x166ae3[_0x65c9('0x43')]:_0x2c972f[_0x65c9('0x55')];_0x166ae3['order']=qs[_0x65c9('0xcf')](_0x242f11[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x166ae3[_0x65c9('0x3c')]=qs['filters'](_[_0x65c9('0xd0')](_0x242f11[_0x65c9('0x3d')],_0x2c972f[_0x65c9('0xd7')]));if(_0x242f11[_0x65c9('0x3d')][_0x65c9('0x2f')]){_0x166ae3[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x166ae3[_0x65c9('0x3c')],{'$or':_['map'](_0x166ae3[_0x65c9('0x43')],function(_0xdb3aae){var _0x35abc0={};_0x35abc0[_0xdb3aae]={'$like':'%'+_0x242f11[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x35abc0;})});}_0x166ae3=_[_0x65c9('0x58')]({},_0x166ae3,_0x242f11[_0x65c9('0x59')]);return _0x477d70[_0x65c9('0xec')](_0x166ae3);}})[_0x65c9('0x14')](function(_0xccc9ef){if(_0xccc9ef){_0x5a7658=_0xccc9ef[_0x65c9('0x47')];if(!_0x242f11['query'][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x166ae3[_0x65c9('0x21')]=qs[_0x65c9('0x21')](_0x242f11[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x166ae3[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x242f11['query'][_0x65c9('0x1f')]);}return _0x477d70[_0x65c9('0xec')](_0x166ae3);}})['then'](function(_0x57c432){if(_0x57c432){return _0x57c432?{'count':_0x5a7658,'rows':_0x57c432}:null;}})[_0x65c9('0x14')](respondWithResult(_0x11bbab,null))[_0x65c9('0x1b')](handleError(_0x11bbab,null));};exports[_0x65c9('0xed')]=function(_0x5c6a11,_0x3d8c05,_0x161b01){var _0x5a75d1;var _0x18942f;var _0x2bdc39;var _0x439b10=!_[_0x65c9('0xa8')](_0x5c6a11['params']['id'])?_0x5c6a11['params']['id']:!_[_0x65c9('0xa8')](_0x5c6a11['user']['id'])?_0x5c6a11[_0x65c9('0x2b')]['id']:null;return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x439b10,'role':{'$or':['admin',_0x65c9('0x2b'),'agent']}},'attributes':['id',_0x65c9('0x33'),_0x65c9('0xee'),'mobile',_0x65c9('0x28'),_0x65c9('0x61'),_0x65c9('0x9b')]})[_0x65c9('0x14')](function(_0x4df107){if(_0x4df107){if(_0x4df107[_0x65c9('0x28')]==='agent'){_0x5a75d1=_0x4df107;if(_0x5c6a11['body'][_0x65c9('0x9c')]){_0x2bdc39=util[_0x65c9('0xa9')](_0x65c9('0xef'),_0x5a75d1[_0x5c6a11['body'][_0x65c9('0x9c')]]);}else if(_0x5c6a11['body'][_0x65c9('0xf0')]){_0x2bdc39=util[_0x65c9('0xa9')](_0x65c9('0xaa'),_0x5c6a11[_0x65c9('0x5c')][_0x65c9('0xf0')]);}else{_0x2bdc39=util['format'](_0x65c9('0xaa'),_0x5a75d1[_0x65c9('0x33')]);}socket['to'](util[_0x65c9('0xa9')](_0x65c9('0xf1'),_0x5a75d1['name']))[_0x65c9('0xa5')](_0x65c9('0xf2'),{'user':{'id':_0x5a75d1['id'],'name':_0x5a75d1[_0x65c9('0x33')]},'ip':_0x5c6a11[_0x65c9('0xf3')][_0x65c9('0xf4')]||_0x5c6a11[_0x65c9('0xf5')]['remoteAddress']||_0x5c6a11[_0x65c9('0xf6')][_0x65c9('0xf7')]||_0x5c6a11[_0x65c9('0xf5')][_0x65c9('0xf6')]['remoteAddress']});return db[_0x65c9('0xad')][_0x65c9('0x26')]({'where':{'membername':_0x5a75d1['name']},'individualHooks':!![]});}}else{throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0xf8'));}})[_0x65c9('0x14')](function(){if(_0x5a75d1){return _0x5a75d1[_0x65c9('0xf9')]({'raw':!![]});}})[_0x65c9('0x14')](function(_0x1b779b){if(_0x5a75d1){var _0x2193d1=[];if(_0x1b779b){_0x18942f=_0x1b779b;if(_0x18942f[_0x65c9('0x47')]){for(var _0x6c63e7=0x0;_0x6c63e7<_0x18942f['length'];_0x6c63e7++){_0x2193d1[_0x65c9('0x4a')]({'membername':_0x5a75d1['name'],'UserId':_0x5a75d1['id'],'queue_name':_0x18942f[_0x6c63e7][_0x65c9('0x33')],'VoiceQueueId':_0x18942f[_0x6c63e7]['id'],'interface':_0x2bdc39,'paused':_0x5a75d1['loginInPause']||![],'penalty':_0x18942f[_0x6c63e7][_0x65c9('0xfa')]||0x0});}return BPromise[_0x65c9('0xac')](_0x2193d1,function(_0x5c23c4){return db[_0x65c9('0xad')][_0x65c9('0xae')](_0x5c23c4);});}}}})['then'](function(){if(_0x5a75d1){return db[_0x65c9('0xfb')][_0x65c9('0x44')]({'where':{'membername':_0x5a75d1[_0x65c9('0x33')],'exitAt':null}});}})[_0x65c9('0x14')](function(_0x2a8d9e){if(_0x5a75d1){var _0x45178c=[];_0x2a8d9e[_0x65c9('0xfc')](function(_0x50f220){_0x45178c[_0x65c9('0x4a')](_0x50f220['update']({'exitAt':moment()['format'](_0x65c9('0xfd'))}));});return BPromise[_0x65c9('0x5b')](_0x45178c);}})[_0x65c9('0x14')](function(){if(_0x5a75d1){var _0x5cad5d=[];var _0x14a9e7=[];var _0x204c7c=utils[_0x65c9('0xfe')]();var _0x42ff3b={'membername':_0x5a75d1[_0x65c9('0x33')],'interface':_0x2bdc39,'enterAt':moment()['format'](_0x65c9('0xfd')),'role':_0x5a75d1[_0x65c9('0x28')],'internal':_0x5a75d1[_0x65c9('0x61')]};_0x204c7c[_0x65c9('0xfc')](function(_0x3f0b1e){_0x5cad5d[_0x65c9('0x4a')](_[_0x65c9('0x58')]({'channel':_0x3f0b1e,'type':_0x65c9('0xff'),'data1':_0x5c6a11['body']['device'],'data2':_0x2bdc39},_0x42ff3b));if(_0x5a75d1[_0x65c9('0x9b')]){_0x14a9e7['push'](_[_0x65c9('0x58')]({'channel':_0x3f0b1e,'type':_0x65c9('0x100'),'data1':'LOGININPAUSE'},_0x42ff3b));}});return db['MemberReport'][_0x65c9('0x88')](_0x5cad5d[_0x65c9('0xcc')](_0x14a9e7),{'individualHooks':!![]});}})[_0x65c9('0x14')](function(){if(_0x5a75d1){return _0x5a75d1[_0x65c9('0x25')]({'online':!![],'lastLoginAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd')),'voicePause':_0x5a75d1[_0x65c9('0x9b')]||![],'mailPause':_0x5a75d1[_0x65c9('0x9b')]||![],'chatPause':_0x5a75d1[_0x65c9('0x9b')]||![],'faxPause':_0x5a75d1['loginInPause']||![],'smsPause':_0x5a75d1['loginInPause']||![],'openchannelPause':_0x5a75d1[_0x65c9('0x9b')]||![],'whatsappPause':_0x5a75d1[_0x65c9('0x9b')]||![],'pauseType':_0x5a75d1[_0x65c9('0x9b')]?_0x65c9('0x101'):null,'interface':_0x2bdc39,'lastPauseAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd'))});}})['then'](function(_0x168071){if(_0x5c6a11[_0x65c9('0x102')]){return _0x161b01();}else{return BPromise[_0x65c9('0x103')](_0x168071)[_0x65c9('0x14')](respondWithResult(_0x3d8c05,null));}})[_0x65c9('0x1b')](handleError(_0x3d8c05,null));};exports[_0x65c9('0x104')]=function(_0x480141,_0x3c6896){var _0x204e63;return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x480141[_0x65c9('0x50')]['id'],'role':_0x65c9('0x2d')},'attributes':['id',_0x65c9('0x33'),_0x65c9('0x28')]})['then'](handleEntityNotFound(_0x3c6896,null))[_0x65c9('0x14')](function(_0x303cb5){if(_0x303cb5){_0x204e63=_0x303cb5;return db[_0x65c9('0xad')]['destroy']({'where':{'membername':_0x204e63[_0x65c9('0x33')]},'individualHooks':!![]});}})['then'](function(){return db[_0x65c9('0xfb')][_0x65c9('0x44')]({'where':{'membername':_0x204e63[_0x65c9('0x33')],'exitAt':null}});})['then'](function(_0x262624){var _0x55e0e3=[];_0x262624[_0x65c9('0xfc')](function(_0x59af74){_0x55e0e3[_0x65c9('0x4a')](_0x59af74[_0x65c9('0x25')]({'exitAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd'))}));});return BPromise['all'](_0x55e0e3);})[_0x65c9('0x14')](function(){return _0x204e63[_0x65c9('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3c6896,null))[_0x65c9('0x1b')](handleError(_0x3c6896,null));};exports[_0x65c9('0x105')]=function(_0xe38ef1,_0x55364d){var _0x42f5c1;return db[_0x65c9('0xad')][_0x65c9('0x25')]({'paused':0x1},{'where':{'UserId':_0xe38ef1[_0x65c9('0x50')]['id']},'individualHooks':!![]})[_0x65c9('0x14')](function(){return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0xe38ef1[_0x65c9('0x50')]['id'],'role':_0x65c9('0x2d')},'attributes':['id',_0x65c9('0x33'),'role',_0x65c9('0x61'),_0x65c9('0x9c')]});})[_0x65c9('0x14')](handleEntityNotFound(_0x55364d,null))[_0x65c9('0x14')](function(_0x380fc9){if(_0x380fc9){_0x42f5c1=_0x380fc9;return respondWithRpcPromise(_0x65c9('0x106'),_0x65c9('0x105'),{'id':_0x42f5c1['id'],'name':_0x42f5c1[_0x65c9('0x33')],'pause':!![]});}})['then'](function(){if(_0x42f5c1){return db['MemberReport'][_0x65c9('0x44')]({'where':{'membername':_0x42f5c1[_0x65c9('0x33')],'type':_0x65c9('0x100'),'exitAt':null}});}})[_0x65c9('0x14')](function(_0x331dcd){if(_0x331dcd[_0x65c9('0x47')]){var _0x711f72=moment()[_0x65c9('0xa9')](_0x65c9('0xfd'));for(var _0x217dd3=0x0,_0x54a610=_0x331dcd[_0x65c9('0x47')];_0x217dd3<_0x54a610;_0x217dd3++){_0x331dcd[_0x217dd3]['updateAttributes']({'exitAt':_0x711f72});}}})[_0x65c9('0x14')](function(){var _0x480222=[];var _0x49b434=utils[_0x65c9('0xfe')]();_0x49b434['forEach'](function(_0x1a30cc){_0x480222[_0x65c9('0x4a')]({'channel':_0x1a30cc,'membername':_0x42f5c1[_0x65c9('0x33')],'interface':_[_0x65c9('0xa8')](_0x42f5c1[_0x65c9('0x9c')])?util[_0x65c9('0xa9')]('SIP/%s',_0x42f5c1['name']):_0x42f5c1['interface'],'type':'PAUSE','enterAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd')),'data1':_0xe38ef1[_0x65c9('0x5c')][_0x65c9('0x37')]||_0x65c9('0x107'),'role':_0x42f5c1['role'],'internal':_0x42f5c1[_0x65c9('0x61')]});});return db['MemberReport'][_0x65c9('0x88')](_0x480222,{'individualHooks':!![]});})[_0x65c9('0x14')](function(){return _0x42f5c1[_0x65c9('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xe38ef1[_0x65c9('0x5c')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd'))});})[_0x65c9('0x14')](respondWithResult(_0x55364d,null))[_0x65c9('0x1b')](handleError(_0x55364d,null));};exports[_0x65c9('0x108')]=function(_0x21e34d,_0x44a1bb){var _0x379120;return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x21e34d['params']['id']},'attributes':['id',_0x65c9('0x33'),'role',_0x65c9('0xab'),_0x65c9('0x109'),_0x65c9('0x10a'),_0x65c9('0x10b'),_0x65c9('0x10c'),'smsPause',_0x65c9('0x10d'),_0x65c9('0x10e'),_0x65c9('0x10f')]})['then'](handleEntityNotFound(_0x44a1bb,null))[_0x65c9('0x14')](function(_0x3d5aee){if(_0x3d5aee){_0x379120=_0x3d5aee;if(_0x21e34d['body'][_0x65c9('0xb0')]&&!utils[_0x65c9('0x9d')](_0x21e34d[_0x65c9('0x5c')][_0x65c9('0xb0')])){throw new db[(_0x65c9('0x90'))][(_0x65c9('0x92'))](_0x65c9('0xb1'));}switch(_0x21e34d[_0x65c9('0x5c')][_0x65c9('0xb0')]){case'voice':return respondWithRpcPromise(_0x65c9('0x106'),_0x65c9('0x108'),{'id':_0x379120['id'],'name':_0x379120['name'],'pause':![]})[_0x65c9('0x14')](function(){return db[_0x65c9('0xad')][_0x65c9('0x25')]({'paused':0x0},{'where':{'UserId':_0x379120['id']},'individualHooks':!![]});})['then'](function(){return db[_0x65c9('0xfb')][_0x65c9('0x32')]({'where':{'channel':_0x21e34d['body'][_0x65c9('0xb0')],'membername':_0x379120['name'],'type':_0x65c9('0x100'),'exitAt':null}});})[_0x65c9('0x14')](function(_0x1399ae){if(_0x1399ae){return _0x1399ae[_0x65c9('0x25')]({'exitAt':moment()[_0x65c9('0xa9')](_0x65c9('0xfd')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x379120['update']({'voicePause':![]});});case _0x65c9('0x4c'):case _0x65c9('0x48'):case _0x65c9('0x5a'):case _0x65c9('0x4b'):case _0x65c9('0x4e'):case _0x65c9('0x4d'):return db[_0x65c9('0xfb')][_0x65c9('0x32')]({'where':{'channel':_0x21e34d['body'][_0x65c9('0xb0')],'membername':_0x379120[_0x65c9('0x33')],'type':_0x65c9('0x100'),'exitAt':null}})[_0x65c9('0x14')](function(_0x4bd942){if(_0x4bd942){return _0x4bd942[_0x65c9('0x25')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x65c9('0x110')},{'individualHooks':!![]});}return null;})[_0x65c9('0x14')](function(){var _0x4b05be={};_[_0x65c9('0x23')](_0x4b05be,util['format'](_0x65c9('0x111'),_0x21e34d[_0x65c9('0x5c')][_0x65c9('0xb0')],_0x65c9('0x112')),![]);return _0x379120[_0x65c9('0x25')](_0x4b05be);});default:return respondWithRpcPromise(_0x65c9('0x106'),'unpause',{'id':_0x379120['id'],'name':_0x379120[_0x65c9('0x33')],'pause':![]})['then'](function(){return db[_0x65c9('0xad')][_0x65c9('0x25')]({'paused':0x0},{'where':{'UserId':_0x379120['id']}});})['then'](function(){return db[_0x65c9('0xfb')][_0x65c9('0x44')]({'where':{'membername':_0x379120['name'],'type':'PAUSE','exitAt':null}});})[_0x65c9('0x14')](function(_0x4db045){var _0x3df658=[];_0x4db045[_0x65c9('0xfc')](function(_0x16d80f){_0x3df658[_0x65c9('0x4a')](_0x16d80f[_0x65c9('0x25')]({'exitAt':moment()[_0x65c9('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x65c9('0x110')}));});return BPromise[_0x65c9('0x5b')](_0x3df658);})[_0x65c9('0x14')](function(){return _0x379120[_0x65c9('0x25')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x65c9('0x14')](respondWithResult(_0x44a1bb,null))[_0x65c9('0x1b')](handleError(_0x44a1bb,null));};exports[_0x65c9('0x113')]=function(_0x30475c,_0x173afb){var _0x485299={};var _0x368b73={};var _0x343696;var _0x1d1500;return db['User'][_0x65c9('0x95')]({'where':{'id':_0x30475c['params']['id']}})['then'](handleEntityNotFound(_0x173afb,null))['then'](function(_0xc480b){if(_0xc480b){_0x343696=_0xc480b;_0x368b73[_0x65c9('0x55')]=_[_0x65c9('0x53')](db[_0x65c9('0x114')]['rawAttributes']);_0x368b73[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x30475c[_0x65c9('0x3d')]);_0x368b73[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x368b73[_0x65c9('0x55')],_0x368b73[_0x65c9('0x3d')]);_0x485299[_0x65c9('0x43')]=_['intersection'](_0x368b73[_0x65c9('0x55')],qs[_0x65c9('0x56')](_0x30475c[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x485299[_0x65c9('0x43')]=_0x485299['attributes'][_0x65c9('0x47')]?_0x485299['attributes']:_0x368b73[_0x65c9('0x55')];_0x485299[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x30475c['query'][_0x65c9('0xcf')]);_0x485299['where']=qs['filters'](_[_0x65c9('0xd0')](_0x30475c[_0x65c9('0x3d')],_0x368b73[_0x65c9('0xd7')]));if(_0x30475c[_0x65c9('0x3d')]['filter']){_0x485299['where']=_[_0x65c9('0x58')](_0x485299[_0x65c9('0x3c')],{'$or':_['map'](_0x485299[_0x65c9('0x43')],function(_0x261154){var _0x2b2eb4={};_0x2b2eb4[_0x261154]={'$like':'%'+_0x30475c[_0x65c9('0x3d')]['filter']+'%'};return _0x2b2eb4;})});}_0x485299=_['merge']({},_0x485299,_0x30475c[_0x65c9('0x59')]);return _0x343696['getTeams'](_0x485299);}})[_0x65c9('0x14')](function(_0x5be7a3){if(_0x5be7a3){_0x1d1500=_0x5be7a3[_0x65c9('0x47')];if(!_0x30475c[_0x65c9('0x3d')][_0x65c9('0xd1')](_0x65c9('0xd4'))){_0x485299['limit']=qs[_0x65c9('0x21')](_0x30475c['query'][_0x65c9('0x21')]);_0x485299[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x30475c[_0x65c9('0x3d')][_0x65c9('0x1f')]);}return _0x343696[_0x65c9('0x113')](_0x485299);}})[_0x65c9('0x14')](function(_0x468e53){if(_0x468e53){return _0x468e53?{'count':_0x1d1500,'rows':_0x468e53}:null;}})['then'](respondWithResult(_0x173afb,null))['catch'](handleError(_0x173afb,null));};exports[_0x65c9('0x115')]=function(_0x592cd8,_0x1df3fb){return db[_0x65c9('0x35')][_0x65c9('0x32')]({'where':{'id':_0x592cd8[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x1df3fb,null))[_0x65c9('0x14')](function(_0x2f798a){if(_0x2f798a){var _0x576362=_0x2f798a[_0x65c9('0x27')]({'plain':!![]});return _0x2f798a[_0x65c9('0x115')](_0x592cd8['body'][_0x65c9('0x5f')],_[_0x65c9('0x60')](_0x592cd8[_0x65c9('0x5c')],[_0x65c9('0x5f'),'id'])||{})['then'](function(){for(var _0x7db339=0x0;_0x7db339<_0x592cd8[_0x65c9('0x5c')][_0x65c9('0x5f')][_0x65c9('0x47')];_0x7db339++){var _0x547c4c=[];var _0x1f272f={};db[_0x65c9('0x114')][_0x65c9('0x95')]({'where':{'id':_0x592cd8[_0x65c9('0x5c')][_0x65c9('0x5f')][_0x7db339]}})[_0x65c9('0x14')](function(_0x522029){_0x1f272f=_0x522029[_0x65c9('0x49')];_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0xf9')]()['then'](function(_0x5f2045){for(var _0x1cfdb5=0x0;_0x1cfdb5<_0x5f2045[_0x65c9('0x47')];_0x1cfdb5++){_0x5f2045[_0x1cfdb5][_0x65c9('0x116')](_0x65c9('0xb0'),'Voice');}return _0x5f2045;}));_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0x117')]()[_0x65c9('0x14')](function(_0x3fe30a){for(var _0x5a0480=0x0;_0x5a0480<_0x3fe30a[_0x65c9('0x47')];_0x5a0480++){_0x3fe30a[_0x5a0480][_0x65c9('0x116')](_0x65c9('0xb0'),_0x65c9('0x118'));}return _0x3fe30a;}));_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0x119')]()[_0x65c9('0x14')](function(_0x201e1f){for(var _0x35180e=0x0;_0x35180e<_0x201e1f['length'];_0x35180e++){_0x201e1f[_0x35180e][_0x65c9('0x116')](_0x65c9('0xb0'),_0x65c9('0x11a'));}return _0x201e1f;}));_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0x11b')]()[_0x65c9('0x14')](function(_0x82013a){for(var _0x2a7f01=0x0;_0x2a7f01<_0x82013a[_0x65c9('0x47')];_0x2a7f01++){_0x82013a[_0x2a7f01]['setDataValue'](_0x65c9('0xb0'),'Sms');}return _0x82013a;}));_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0x11c')]()[_0x65c9('0x14')](function(_0x53f8d2){for(var _0x11ce8b=0x0;_0x11ce8b<_0x53f8d2[_0x65c9('0x47')];_0x11ce8b++){_0x53f8d2[_0x11ce8b][_0x65c9('0x116')](_0x65c9('0xb0'),_0x65c9('0x11d'));}return _0x53f8d2;}));_0x547c4c[_0x65c9('0x4a')](_0x522029[_0x65c9('0x11e')]()[_0x65c9('0x14')](function(_0x14f2cb){for(var _0x8b44b5=0x0;_0x8b44b5<_0x14f2cb[_0x65c9('0x47')];_0x8b44b5++){_0x14f2cb[_0x8b44b5]['setDataValue'](_0x65c9('0xb0'),_0x65c9('0x11f'));}return _0x14f2cb;}));_0x547c4c[_0x65c9('0x4a')](_0x522029['getOpenchannelQueues']()['then'](function(_0x3ac860){for(var _0x24feb8=0x0;_0x24feb8<_0x3ac860['length'];_0x24feb8++){_0x3ac860[_0x24feb8]['setDataValue'](_0x65c9('0xb0'),'Openchannel');}return _0x3ac860;}));return BPromise['all'](_0x547c4c);})[_0x65c9('0x14')](function(_0x1b1583){var _0x93a3fd=_[_0x65c9('0x120')](_0x1b1583);_0x547c4c=[];return db[_0x65c9('0x67')]['transaction'](function(_0x40eb91){for(var _0x3076f8=0x0;_0x3076f8<_0x93a3fd[_0x65c9('0x47')];_0x3076f8++){_0x547c4c[_0x65c9('0x4a')](_0x93a3fd[_0x3076f8][_0x65c9('0x121')](_0x576362['id']),{'transaction':_0x40eb91});}return BPromise['all'](_0x547c4c)[_0x65c9('0x14')](function(){if(_0x576362[_0x65c9('0x9a')]){return BPromise[_0x65c9('0xac')](_[_0x65c9('0x2f')](_0x93a3fd,function(_0x31e24a){return _0x31e24a[_0x65c9('0x122')](_0x65c9('0xb0'))==='Voice';}),function(_0x4381c8){return db[_0x65c9('0xad')][_0x65c9('0xae')]({'membername':_0x576362[_0x65c9('0x33')],'UserId':_0x576362['id'],'queue_name':_0x4381c8[_0x65c9('0x33')],'VoiceQueueId':_0x4381c8['id'],'interface':_[_0x65c9('0xa8')](_0x576362[_0x65c9('0x9c')])?util[_0x65c9('0xa9')]('SIP/%s',_0x576362[_0x65c9('0x33')]):_0x576362[_0x65c9('0x9c')],'paused':_0x576362[_0x65c9('0xab')]||![],'penalty':_0x576362[_0x65c9('0xa1')]},{'transaction':_0x40eb91});});}else{return;}})[_0x65c9('0x14')](function(){for(var _0x5dc131=0x0;_0x5dc131<_0x93a3fd[_0x65c9('0x47')];_0x5dc131++){var _0x34cbbf=_0x93a3fd[_0x5dc131][_0x65c9('0x122')](_0x65c9('0xb0'));var _0x56dbe0=_0x34cbbf+'QueueId';socket[_0x65c9('0xa5')]('user'+_0x34cbbf+_0x65c9('0xa6'),{'UserId':_0x576362['id'],['queueField']:_0x93a3fd[_0x5dc131]['id']});}});});})['then'](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1f272f['id']}})[_0x65c9('0x14')](function(_0x3ad262){if(_0x3ad262){db[_0x65c9('0x123')][_0x65c9('0x7d')]({'UserId':_0x592cd8[_0x65c9('0x50')]['id'],'VoicePrefixId':_0x3ad262[_0x65c9('0x124')]});}});});}});}})[_0x65c9('0x14')](respondWithStatusCode(_0x1df3fb,null))[_0x65c9('0x1b')](handleError(_0x1df3fb,null));};exports[_0x65c9('0x125')]=function(_0x5e1442,_0x97d441){return db['User'][_0x65c9('0x95')]({'where':{'id':_0x5e1442[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x97d441,null))[_0x65c9('0x14')](function(_0x1054bc){if(_0x1054bc){var _0x483036=_0x1054bc[_0x65c9('0x27')]({'plain':!![]});var _0x47b514=_0x5e1442[_0x65c9('0x3d')][_0x65c9('0x5f')];return _0x1054bc[_0x65c9('0x125')](_0x47b514)[_0x65c9('0x14')](function(){for(var _0x1cc722=0x0;_0x1cc722<_0x47b514[_0x65c9('0x47')];_0x1cc722++){var _0x14cde9=[];var _0x5c1405={};db[_0x65c9('0x114')][_0x65c9('0x95')]({'where':{'id':_0x47b514[_0x1cc722]}})[_0x65c9('0x14')](function(_0x4626d8){_0x5c1405=_0x4626d8[_0x65c9('0x49')];_0x14cde9[_0x65c9('0x4a')](_0x4626d8['getVoiceQueues']()['then'](function(_0x27e613){for(var _0x1c4231=0x0;_0x1c4231<_0x27e613[_0x65c9('0x47')];_0x1c4231++){_0x27e613[_0x1c4231]['setDataValue'](_0x65c9('0xb0'),_0x65c9('0x126'));}return _0x27e613;}));_0x14cde9['push'](_0x4626d8[_0x65c9('0x117')]()[_0x65c9('0x14')](function(_0x150b53){for(var _0x24b23b=0x0;_0x24b23b<_0x150b53[_0x65c9('0x47')];_0x24b23b++){_0x150b53[_0x24b23b]['setDataValue'](_0x65c9('0xb0'),_0x65c9('0x118'));}return _0x150b53;}));_0x14cde9['push'](_0x4626d8[_0x65c9('0x119')]()[_0x65c9('0x14')](function(_0x465b24){for(var _0x4d9eab=0x0;_0x4d9eab<_0x465b24['length'];_0x4d9eab++){_0x465b24[_0x4d9eab][_0x65c9('0x116')](_0x65c9('0xb0'),_0x65c9('0x11a'));}return _0x465b24;}));_0x14cde9['push'](_0x4626d8[_0x65c9('0x11b')]()[_0x65c9('0x14')](function(_0x17ddcd){for(var _0x48f578=0x0;_0x48f578<_0x17ddcd[_0x65c9('0x47')];_0x48f578++){_0x17ddcd[_0x48f578]['setDataValue']('channel',_0x65c9('0x127'));}return _0x17ddcd;}));_0x14cde9[_0x65c9('0x4a')](_0x4626d8[_0x65c9('0x11c')]()[_0x65c9('0x14')](function(_0x502539){for(var _0xe2a2ea=0x0;_0xe2a2ea<_0x502539[_0x65c9('0x47')];_0xe2a2ea++){_0x502539[_0xe2a2ea]['setDataValue'](_0x65c9('0xb0'),'Whatsapp');}return _0x502539;}));_0x14cde9['push'](_0x4626d8[_0x65c9('0x11e')]()[_0x65c9('0x14')](function(_0x195afb){for(var _0xb78afc=0x0;_0xb78afc<_0x195afb[_0x65c9('0x47')];_0xb78afc++){_0x195afb[_0xb78afc][_0x65c9('0x116')](_0x65c9('0xb0'),'Fax');}return _0x195afb;}));_0x14cde9[_0x65c9('0x4a')](_0x4626d8['getOpenchannelQueues']()['then'](function(_0x38577b){for(var _0x211f46=0x0;_0x211f46<_0x38577b[_0x65c9('0x47')];_0x211f46++){_0x38577b[_0x211f46][_0x65c9('0x116')](_0x65c9('0xb0'),_0x65c9('0x128'));}return _0x38577b;}));return BPromise[_0x65c9('0x5b')](_0x14cde9);})[_0x65c9('0x14')](function(_0x3d019e){var _0x46e50f=_[_0x65c9('0x120')](_0x3d019e);_0x14cde9=[];return db['sequelize']['transaction'](function(_0x37da7e){for(var _0x133cf3=0x0;_0x133cf3<_0x46e50f[_0x65c9('0x47')];_0x133cf3++){_0x14cde9['push'](_0x46e50f[_0x133cf3]['removeAgent'](_0x483036['id']),{'transaction':_0x37da7e});}return BPromise['all'](_0x14cde9)['then'](function(){if(_0x483036[_0x65c9('0x9a')]){return BPromise[_0x65c9('0xac')](_['filter'](_0x46e50f,function(_0x4284f1){return _0x4284f1['getDataValue'](_0x65c9('0xb0'))===_0x65c9('0x126');}),function(_0x47f2f2){return db[_0x65c9('0xad')][_0x65c9('0x26')]({'where':{'VoiceQueueId':_0x47f2f2['id'],'UserId':_0x483036['id']},'transaction':_0x37da7e});});}else{return;}})[_0x65c9('0x14')](function(){db[_0x65c9('0x129')][_0x65c9('0x95')]({'where':{'teamId':_0x5c1405['id']}})[_0x65c9('0x14')](function(_0x5351aa){if(_0x5351aa){return db[_0x65c9('0x123')][_0x65c9('0x26')]({'where':{'UserId':_0x483036['id'],'VoicePrefixId':_0x5351aa[_0x65c9('0x49')][_0x65c9('0x124')]}});}});})[_0x65c9('0x14')](function(){for(var _0x3118c8=0x0;_0x3118c8<_0x46e50f[_0x65c9('0x47')];_0x3118c8++){var _0x441825=_0x46e50f[_0x3118c8]['getDataValue'](_0x65c9('0xb0'));var _0x360923=_0x441825+_0x65c9('0xa4');socket[_0x65c9('0xa5')](_0x65c9('0x2b')+_0x441825+_0x65c9('0xb4'),{'UserId':_0x483036['id'],['queueField']:_0x46e50f[_0x3118c8]['id']});}});});});}});}})[_0x65c9('0x14')](respondWithStatusCode(_0x97d441,null))[_0x65c9('0x1b')](handleError(_0x97d441,null));};exports[_0x65c9('0x12a')]=function(_0x24ccb5,_0x54ddc6){var _0x3179ee={};var _0x1528b0={};var _0x57af17;var _0x4dc04b;return db[_0x65c9('0x35')]['findOne']({'where':{'id':_0x24ccb5[_0x65c9('0x50')]['id']}})[_0x65c9('0x14')](handleEntityNotFound(_0x54ddc6,null))[_0x65c9('0x14')](function(_0x43f30f){if(_0x43f30f){_0x57af17=_0x43f30f;_0x1528b0[_0x65c9('0x55')]=_['keys'](db[_0x65c9('0x12b')][_0x65c9('0x52')]);_0x1528b0[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x24ccb5[_0x65c9('0x3d')]);_0x1528b0[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x1528b0[_0x65c9('0x55')],_0x1528b0[_0x65c9('0x3d')]);_0x3179ee['attributes']=_[_0x65c9('0x54')](_0x1528b0['model'],qs[_0x65c9('0x56')](_0x24ccb5['query'][_0x65c9('0x56')]));_0x3179ee['attributes']=_0x3179ee[_0x65c9('0x43')][_0x65c9('0x47')]?_0x3179ee[_0x65c9('0x43')]:_0x1528b0['model'];_0x3179ee[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x24ccb5[_0x65c9('0x3d')][_0x65c9('0xcf')]);_0x3179ee[_0x65c9('0x3c')]=qs['filters'](_['pick'](_0x24ccb5[_0x65c9('0x3d')],_0x1528b0[_0x65c9('0xd7')]));if(_0x24ccb5['query']['filter']){_0x3179ee[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x3179ee[_0x65c9('0x3c')],{'$or':_[_0x65c9('0x30')](_0x3179ee[_0x65c9('0x43')],function(_0x4a51db){var _0x1bd9e2={};_0x1bd9e2[_0x4a51db]={'$like':'%'+_0x24ccb5['query'][_0x65c9('0x2f')]+'%'};return _0x1bd9e2;})});}_0x3179ee=_[_0x65c9('0x58')]({},_0x3179ee,_0x24ccb5[_0x65c9('0x59')]);return _0x57af17['getLists'](_0x3179ee);}})[_0x65c9('0x14')](function(_0x4e9554){if(_0x4e9554){_0x4dc04b=_0x4e9554['length'];if(!_0x24ccb5[_0x65c9('0x3d')]['hasOwnProperty']('nolimit')){_0x3179ee['limit']=qs[_0x65c9('0x21')](_0x24ccb5[_0x65c9('0x3d')][_0x65c9('0x21')]);_0x3179ee[_0x65c9('0x1f')]=qs[_0x65c9('0x1f')](_0x24ccb5['query'][_0x65c9('0x1f')]);}return _0x57af17[_0x65c9('0x12a')](_0x3179ee);}})[_0x65c9('0x14')](function(_0x170f62){if(_0x170f62){return _0x170f62?{'count':_0x4dc04b,'rows':_0x170f62}:null;}})[_0x65c9('0x14')](respondWithResult(_0x54ddc6,null))[_0x65c9('0x1b')](handleError(_0x54ddc6,null));};exports[_0x65c9('0x12c')]=function(_0x2bec28,_0x27fe9e){var _0x8155f9={};var _0x147c14={};var _0x635371;return db[_0x65c9('0x35')][_0x65c9('0x95')]({'where':{'id':_0x2bec28[_0x65c9('0x50')]['id']}})['then'](handleEntityNotFound(_0x27fe9e,null))[_0x65c9('0x14')](function(_0x535431){if(_0x535431){_0x635371=_0x535431;_0x147c14['model']=_[_0x65c9('0x53')](db[_0x65c9('0x35')][_0x65c9('0x52')]);_0x147c14[_0x65c9('0x3d')]=_[_0x65c9('0x53')](_0x2bec28[_0x65c9('0x3d')]);_0x147c14[_0x65c9('0xd7')]=_[_0x65c9('0x54')](_0x147c14[_0x65c9('0x55')],_0x147c14[_0x65c9('0x3d')]);_0x8155f9[_0x65c9('0x43')]=_[_0x65c9('0x54')](_0x147c14['model'],qs[_0x65c9('0x56')](_0x2bec28[_0x65c9('0x3d')][_0x65c9('0x56')]));_0x8155f9['attributes']=_0x8155f9[_0x65c9('0x43')][_0x65c9('0x47')]?_0x8155f9[_0x65c9('0x43')]:_0x147c14[_0x65c9('0x55')];_0x8155f9[_0x65c9('0xd9')]=qs[_0x65c9('0xcf')](_0x2bec28[_0x65c9('0x3d')]['sort']);_0x8155f9[_0x65c9('0x3c')]=qs[_0x65c9('0xd7')](_['pick'](_0x2bec28[_0x65c9('0x3d')],_0x147c14[_0x65c9('0xd7')]));if(_0x2bec28['query'][_0x65c9('0x2f')]){_0x8155f9[_0x65c9('0x3c')]=_[_0x65c9('0x58')](_0x8155f9['where'],{'$or':_['map'](_0x8155f9[_0x65c9('0x43')],function(_0x2d0837){var _0x1e4289={};_0x1e4289[_0x2d0837]={'$like':'%'+_0x2bec28[_0x65c9('0x3d')][_0x65c9('0x2f')]+'%'};return _0x1e4289;})});}_0x8155f9[_0x65c9('0x55')]=db[_0x65c9('0x35')];_0x8155f9['as']=_0x65c9('0x2c');_0x8155f9=_[_0x65c9('0x58')]({},_0x8155f9,_0x2bec28[_0x65c9('0x59')]);return _0x635371['getVoiceQueues']({'include':[_0x8155f9]});}})[_0x65c9('0x14')](function(_0x892a0c){if(_0x892a0c){var _0xee08f0={},_0x50fb2e=[];for(var _0x1084e5=0x0;_0x1084e5<_0x892a0c[_0x65c9('0x47')];_0x1084e5+=0x1){for(var _0x58f868=0x0,_0x56e757;_0x58f868<_0x892a0c[_0x1084e5][_0x65c9('0x2c')][_0x65c9('0x47')];_0x58f868+=0x1){_0x56e757=_0x892a0c[_0x1084e5][_0x65c9('0x2c')][_0x58f868][_0x65c9('0x27')]({'plain':!![]});_0xee08f0[_0x56e757['id']]=_0x56e757;}}_0xee08f0=_[_0x65c9('0x12d')](_0xee08f0);for(var _0x5cdde9=qs[_0x65c9('0x1f')](_0x2bec28['query']['offset']);_0x5cdde9<_0xee08f0[_0x65c9('0x47')]&&_0x50fb2e[_0x65c9('0x47')]=_0x268449[_0xe5ce('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xe5ce('0x28')](function(){if(_0x2a58e8){return db[_0xe5ce('0x2d')][_0xe5ce('0x55')]({'where':{'membername':_0x2a58e8[_0xe5ce('0x30')]},'individualHooks':!![]});}})['then'](function(){if(_0x2a58e8){return _0x2a58e8[_0xe5ce('0x56')]({'raw':!![]});}})[_0xe5ce('0x28')](function(_0x48ce0d){if(_0x2a58e8){if(_0x48ce0d){var _0x5af7ea=[];_0x13cdca=_0x48ce0d;if(_0x13cdca[_0xe5ce('0x32')]){for(var _0x3e727e=0x0;_0x3e727e<_0x13cdca[_0xe5ce('0x32')];_0x3e727e++){_0x5af7ea[_0xe5ce('0x36')](db[_0xe5ce('0x2d')][_0xe5ce('0x57')]({'membername':_0x2a58e8[_0xe5ce('0x30')],'UserId':_0x2a58e8['id'],'queue_name':_0x13cdca[_0x3e727e][_0xe5ce('0x30')],'VoiceQueueId':_0x13cdca[_0x3e727e]['id'],'interface':_0x1b825e,'paused':_0x2a58e8['loginInPause']||![],'penalty':_0x13cdca[_0x3e727e][_0xe5ce('0x58')]||0x0}));}return BPromise[_0xe5ce('0x4c')](_0x5af7ea);}}}})[_0xe5ce('0x28')](function(){if(_0x2a58e8){return db[_0xe5ce('0x3c')]['findAll']({'where':{'membername':_0x2a58e8[_0xe5ce('0x30')],'exitAt':null}});}})['then'](function(_0x3cdf30){if(_0x2a58e8){if(_0x3cdf30&&_0x3cdf30[_0xe5ce('0x32')]){var _0x5a261c=[];_0x3cdf30[_0xe5ce('0x35')](function(_0x44bd76){_0x5a261c[_0xe5ce('0x36')](_0x44bd76[_0xe5ce('0x2e')]({'exitAt':moment()[_0xe5ce('0x33')](_0xe5ce('0x43'))}));});return BPromise[_0xe5ce('0x4c')](_0x5a261c);}}})[_0xe5ce('0x28')](function(_0x4ac0d9){if(_0x2a58e8){var _0x1e82ba=[];var _0x5e982a=[];var _0x3fb72f=utils[_0xe5ce('0x59')]();var _0x5590c6={'membername':_0x2a58e8['name'],'interface':_0x1b825e,'enterAt':moment()[_0xe5ce('0x33')](_0xe5ce('0x43')),'role':_0x2a58e8[_0xe5ce('0x2b')],'internal':_0x2a58e8[_0xe5ce('0x39')]};_0x3fb72f[_0xe5ce('0x35')](function(_0xc832e1){_0x1e82ba['push'](_[_0xe5ce('0x5a')]({'channel':_0xc832e1,'type':_0xe5ce('0x5b'),'data1':_0xe5ce('0x5c'),'data2':_0x1b825e},_0x5590c6));if(_0x2a58e8['loginInPause']){_0x5e982a[_0xe5ce('0x36')](_[_0xe5ce('0x5a')]({'channel':_0xc832e1,'type':_0xe5ce('0x31'),'data1':'LOGININPAUSE'},_0x5590c6));}});return db['MemberReport'][_0xe5ce('0x5d')](_0x1e82ba['concat'](_0x5e982a),{'individualHooks':!![]});}})[_0xe5ce('0x28')](function(){if(_0x2a58e8){return _0x2a58e8[_0xe5ce('0x2e')]({'online':!![],'lastLoginAt':moment()[_0xe5ce('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2a58e8[_0xe5ce('0x50')]||![],'mailPause':_0x2a58e8['loginInPause']||![],'chatPause':_0x2a58e8[_0xe5ce('0x50')]||![],'faxPause':_0x2a58e8[_0xe5ce('0x50')]||![],'smsPause':_0x2a58e8[_0xe5ce('0x50')]||![],'openchannelPause':_0x2a58e8[_0xe5ce('0x50')]||![],'pauseType':_0x2a58e8[_0xe5ce('0x50')]?_0xe5ce('0x5e'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x1b825e});}})[_0xe5ce('0x28')](function(_0x401322){_0x1aa099(_0x401322);})[_0xe5ce('0x1c')](function(_0x5e557e){_0x192150(_0x516290[_0xe5ce('0x17')](0x1f4,_0x5e557e[_0xe5ce('0x19')]));});});}; \ No newline at end of file +var _0x344a=['User','find','PauseUser','name','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','role','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','sms','openchannel','whatsapp','system','set','%s%s','Pause','all','LogoutUser','findOne','destroy','findAll','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetUser','options','raw','where','attributes','limit','map','include','model','catch','ShowUser'];(function(_0x2819d6,_0x500134){var _0x7f08d6=function(_0x378eea){while(--_0x378eea){_0x2819d6['push'](_0x2819d6['shift']());}};_0x7f08d6(++_0x500134);}(_0x344a,0x159));var _0xa344=function(_0xd73fb2,_0x65509f){_0xd73fb2=_0xd73fb2-0x0;var _0x16ae77=_0x344a[_0xd73fb2];return _0x16ae77;};'use strict';var _=require(_0xa344('0x0'));var util=require(_0xa344('0x1'));var moment=require(_0xa344('0x2'));var BPromise=require(_0xa344('0x3'));var rs=require(_0xa344('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa344('0x5'));var logger=require(_0xa344('0x6'))(_0xa344('0x7'));var config=require(_0xa344('0x8'));var jayson=require(_0xa344('0x9'));var client=jayson['client'][_0xa344('0xa')]({'port':0x232a});config['redis']=_[_0xa344('0xb')](config[_0xa344('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa344('0xc')]));require('./user.socket')[_0xa344('0xd')](socket);function respondWithRpcPromise(_0x204f8f,_0x3585c0,_0x1a6aef){return new BPromise(function(_0x4a92c0,_0x3359bf){return client['request'](_0x204f8f,_0x1a6aef)[_0xa344('0xe')](function(_0x183122){logger[_0xa344('0xf')](_0xa344('0x10'),_0x3585c0,_0xa344('0x11'));logger[_0xa344('0x12')](_0xa344('0x13'),_0x3585c0,_0xa344('0x11'),JSON[_0xa344('0x14')](_0x183122));if(_0x183122['error']){if(_0x183122[_0xa344('0x15')][_0xa344('0x16')]===0x1f4){logger[_0xa344('0x15')](_0xa344('0x10'),_0x3585c0,_0x183122[_0xa344('0x15')]['message']);return _0x3359bf(_0x183122[_0xa344('0x15')][_0xa344('0x17')]);}logger[_0xa344('0x15')]('User,\x20%s,\x20%s',_0x3585c0,_0x183122['error'][_0xa344('0x17')]);return _0x4a92c0(_0x183122['error'][_0xa344('0x17')]);}else{logger[_0xa344('0xf')](_0xa344('0x10'),_0x3585c0,_0xa344('0x11'));_0x4a92c0(_0x183122['result'][_0xa344('0x17')]);}})['catch'](function(_0x5a6b8b){logger[_0xa344('0x15')](_0xa344('0x10'),_0x3585c0,_0x5a6b8b);_0x3359bf(_0x5a6b8b);});});}exports[_0xa344('0x18')]=function(_0x375a15){var _0x1e19a0=this;return new Promise(function(_0x3804e9,_0x1f77f5){return db['User']['findAll']({'raw':_0x375a15[_0xa344('0x19')]?_0x375a15[_0xa344('0x19')][_0xa344('0x1a')]===undefined?!![]:![]:!![],'where':_0x375a15[_0xa344('0x19')]?_0x375a15['options'][_0xa344('0x1b')]||null:null,'attributes':_0x375a15[_0xa344('0x19')]?_0x375a15[_0xa344('0x19')][_0xa344('0x1c')]||null:null,'limit':_0x375a15[_0xa344('0x19')]?_0x375a15['options'][_0xa344('0x1d')]||null:null,'include':_0x375a15['options']?_0x375a15[_0xa344('0x19')]['include']?_[_0xa344('0x1e')](_0x375a15['options'][_0xa344('0x1f')],function(_0x20e7bc){return{'model':db[_0x20e7bc[_0xa344('0x20')]],'as':_0x20e7bc['as'],'attributes':_0x20e7bc[_0xa344('0x1c')],'include':_0x20e7bc[_0xa344('0x1f')]?_[_0xa344('0x1e')](_0x20e7bc['include'],function(_0x12ad9c){return{'model':db[_0x12ad9c['model']],'as':_0x12ad9c['as'],'attributes':_0x12ad9c[_0xa344('0x1c')],'include':_0x12ad9c[_0xa344('0x1f')]?_[_0xa344('0x1e')](_0x12ad9c[_0xa344('0x1f')],function(_0x78c503){return{'model':db[_0x78c503['model']],'as':_0x78c503['as'],'attributes':_0x78c503[_0xa344('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa344('0xe')](function(_0x2af70d){logger[_0xa344('0xf')](_0xa344('0x18'),_0x375a15);logger[_0xa344('0x12')]('GetUser',_0x375a15,JSON['stringify'](_0x2af70d));_0x3804e9(_0x2af70d);})[_0xa344('0x21')](function(_0x2a9cfd){logger[_0xa344('0x15')]('GetUser',_0x2a9cfd[_0xa344('0x17')],_0x375a15);_0x1f77f5(_0x1e19a0[_0xa344('0x15')](0x1f4,_0x2a9cfd[_0xa344('0x17')]));});});};exports[_0xa344('0x22')]=function(_0xd528b4){var _0x4998cc=this;return new Promise(function(_0x1e0b6c,_0x5467cb){return db[_0xa344('0x23')][_0xa344('0x24')]({'raw':_0xd528b4['options']?_0xd528b4[_0xa344('0x19')][_0xa344('0x1a')]===undefined?!![]:![]:!![],'where':_0xd528b4['options']?_0xd528b4[_0xa344('0x19')][_0xa344('0x1b')]||null:null,'attributes':_0xd528b4[_0xa344('0x19')]?_0xd528b4[_0xa344('0x19')][_0xa344('0x1c')]||null:null,'include':_0xd528b4['options']?_0xd528b4[_0xa344('0x19')][_0xa344('0x1f')]?_['map'](_0xd528b4['options'][_0xa344('0x1f')],function(_0x38245f){return{'model':db[_0x38245f['model']],'as':_0x38245f['as'],'attributes':_0x38245f[_0xa344('0x1c')],'include':_0x38245f[_0xa344('0x1f')]?_['map'](_0x38245f[_0xa344('0x1f')],function(_0x1e241c){return{'model':db[_0x1e241c['model']],'as':_0x1e241c['as'],'attributes':_0x1e241c[_0xa344('0x1c')],'include':_0x1e241c['include']?_[_0xa344('0x1e')](_0x1e241c[_0xa344('0x1f')],function(_0x564f71){return{'model':db[_0x564f71['model']],'as':_0x564f71['as'],'attributes':_0x564f71[_0xa344('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa344('0xe')](function(_0x5c3754){logger[_0xa344('0xf')](_0xa344('0x22'),_0xd528b4);logger[_0xa344('0x12')](_0xa344('0x22'),_0xd528b4,JSON['stringify'](_0x5c3754));_0x1e0b6c(_0x5c3754);})[_0xa344('0x21')](function(_0x3dad9c){logger['error']('ShowUser',_0x3dad9c[_0xa344('0x17')],_0xd528b4);_0x5467cb(_0x4998cc[_0xa344('0x15')](0x1f4,_0x3dad9c['message']));});});};exports[_0xa344('0x25')]=function(_0x40a386){var _0x1f5ccf=this;return new Promise(function(_0x55cd21,_0x1f4804){var _0x59dc19;return db['User'][_0xa344('0x24')]({'where':_0x40a386[_0xa344('0x19')][_0xa344('0x1b')]||{},'attributes':['id',_0xa344('0x26'),'role',_0xa344('0x27'),_0xa344('0x28')]})[_0xa344('0xe')](function(_0x1e678d){if(_0x1e678d){_0x59dc19=_0x1e678d;return db[_0xa344('0x29')][_0xa344('0x2a')]({'paused':0x1},{'where':{'UserId':_0x59dc19['id']},'individualHooks':!![]});}})[_0xa344('0xe')](function(){if(_0x59dc19){return db['MemberReport']['findAll']({'where':{'membername':_0x59dc19[_0xa344('0x26')],'type':_0xa344('0x2b'),'exitAt':null}});}})[_0xa344('0xe')](function(_0x3f7195){if(_0x59dc19){if(_0x3f7195&&_0x3f7195[_0xa344('0x2c')]){var _0x46fdbd=moment()[_0xa344('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5bc74c=0x0,_0x458b08=_0x3f7195[_0xa344('0x2c')];_0x5bc74c<_0x458b08;_0x5bc74c++){_0x3f7195[_0x5bc74c][_0xa344('0x2e')]({'exitAt':_0x46fdbd});}}}})[_0xa344('0xe')](function(){if(_0x59dc19){var _0x580690=[];var _0x153e17=utils[_0xa344('0x2f')]();_0x153e17[_0xa344('0x30')](function(_0x5d3dfe){_0x580690[_0xa344('0x31')]({'channel':_0x5d3dfe,'membername':_0x59dc19[_0xa344('0x26')],'interface':_[_0xa344('0x32')](_0x59dc19[_0xa344('0x28')])?util[_0xa344('0x2d')](_0xa344('0x33'),_0x59dc19[_0xa344('0x26')]):_0x59dc19[_0xa344('0x28')],'type':_0xa344('0x2b'),'enterAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'data1':_0x40a386[_0xa344('0x35')]['type']||_0xa344('0x36'),'role':_0x59dc19[_0xa344('0x37')],'internal':_0x59dc19[_0xa344('0x27')],'uniqueid':_0x40a386[_0xa344('0x35')][_0xa344('0x38')]||null});});return db[_0xa344('0x39')][_0xa344('0x3a')](_0x580690,{'individualHooks':!![]});}})[_0xa344('0xe')](function(){if(_0x59dc19){return _0x59dc19[_0xa344('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x40a386['body'][_0xa344('0x3b')]||_0xa344('0x36'),'lastPauseAt':moment()[_0xa344('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xa344('0xe')](function(_0x1e95aa){_0x55cd21(_0x1e95aa);})[_0xa344('0x21')](function(_0x8f83b1){_0x1f4804(_0x1f5ccf['error'](0x1f4,_0x8f83b1['message']));});});};exports[_0xa344('0x3c')]=function(_0x3bd72c){var _0x4cc577=this;return new Promise(function(_0x26ff16,_0x1a3450){var _0x3f3a16;return db[_0xa344('0x23')]['findOne']({'where':_0x3bd72c[_0xa344('0x19')]['where']||{},'attributes':['id',_0xa344('0x26')]})[_0xa344('0xe')](function(_0x1938de){if(_0x1938de){_0x3f3a16=_0x1938de;if(_0x3bd72c['body'][_0xa344('0x3d')]&&!utils[_0xa344('0x3e')](_0x3bd72c[_0xa344('0x35')][_0xa344('0x3d')])){throw new Error(_0xa344('0x3f'));}switch(_0x3bd72c[_0xa344('0x35')][_0xa344('0x3d')]){case _0xa344('0x40'):return db[_0xa344('0x29')][_0xa344('0x2a')]({'paused':0x0},{'where':{'UserId':_0x3f3a16['id']}})[_0xa344('0xe')](function(){return db[_0xa344('0x39')][_0xa344('0x24')]({'where':{'channel':_0x3bd72c[_0xa344('0x35')][_0xa344('0x3d')],'membername':_0x3f3a16[_0xa344('0x26')],'type':_0xa344('0x2b'),'exitAt':null}});})[_0xa344('0xe')](function(_0x5261f6){if(_0x5261f6){return _0x5261f6[_0xa344('0x2a')]({'exitAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xa344('0xe')](function(){return _0x3f3a16[_0xa344('0x2a')]({'voicePause':![]});});case _0xa344('0x41'):case _0xa344('0x42'):case'fax':case _0xa344('0x43'):case _0xa344('0x44'):case _0xa344('0x45'):return db[_0xa344('0x39')][_0xa344('0x24')]({'where':{'channel':_0x3bd72c['body'][_0xa344('0x3d')],'membername':_0x3f3a16[_0xa344('0x26')],'type':_0xa344('0x2b'),'exitAt':null}})[_0xa344('0xe')](function(_0x11eb4e){return _0x11eb4e['update']({'exitAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'data2':_0xa344('0x46')},{'individualHooks':!![]});})[_0xa344('0xe')](function(){var _0x12ef34={};_[_0xa344('0x47')](_0x12ef34,util[_0xa344('0x2d')](_0xa344('0x48'),_0x3bd72c[_0xa344('0x35')][_0xa344('0x3d')],_0xa344('0x49')),![]);return _0x3f3a16[_0xa344('0x2a')](_0x12ef34);});default:return db[_0xa344('0x29')][_0xa344('0x2a')]({'paused':0x0},{'where':{'UserId':_0x3f3a16['id']}})['then'](function(){return db[_0xa344('0x39')]['findAll']({'where':{'membername':_0x3f3a16[_0xa344('0x26')],'type':_0xa344('0x2b'),'exitAt':null}});})['then'](function(_0x5f07cc){var _0x285694=[];_0x5f07cc[_0xa344('0x30')](function(_0x5be70a){_0x285694[_0xa344('0x31')](_0x5be70a[_0xa344('0x2a')]({'exitAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'data2':'system'}));});return BPromise[_0xa344('0x4a')](_0x285694);})[_0xa344('0xe')](function(){return _0x3f3a16[_0xa344('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x484d0b){_0x26ff16(_0x484d0b);})['catch'](function(_0x46c718){_0x1a3450(_0x4cc577['error'](0x1f4,_0x46c718[_0xa344('0x17')]));});});};exports[_0xa344('0x4b')]=function(_0x3e7242){var _0x427711=this;return new Promise(function(_0x446a69,_0x3b5de4){var _0x26b300;return db[_0xa344('0x23')][_0xa344('0x4c')]({'where':_0x3e7242[_0xa344('0x19')][_0xa344('0x1b')]||{},'attributes':['id','name']})['then'](function(_0xd33d98){if(_0xd33d98){_0x26b300=_0xd33d98;return db[_0xa344('0x29')][_0xa344('0x4d')]({'where':{'membername':_0x26b300['name']},'individualHooks':!![]});}})[_0xa344('0xe')](function(){if(_0x26b300){return db[_0xa344('0x39')][_0xa344('0x4e')]({'where':{'membername':_0x26b300[_0xa344('0x26')],'exitAt':null}});}})['then'](function(_0x4d3a82){if(_0x26b300){if(_0x4d3a82&&_0x4d3a82[_0xa344('0x2c')]){var _0x37cdbb=[];_0x4d3a82[_0xa344('0x30')](function(_0x19d508){_0x37cdbb['push'](_0x19d508['update']({'exitAt':moment()[_0xa344('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa344('0x4a')](_0x37cdbb);}}})[_0xa344('0xe')](function(){if(_0x26b300){return _0x26b300[_0xa344('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xa344('0xe')](function(_0x4d4439){_0x446a69(_0x4d4439);})[_0xa344('0x21')](function(_0x26d473){_0x3b5de4(_0x427711[_0xa344('0x15')](0x1f4,_0x26d473[_0xa344('0x17')]));});});};exports[_0xa344('0x4f')]=function(_0x1f4f54){var _0x1d8104=this;return new Promise(function(_0x3f1848,_0x20de60){var _0x34786c;var _0x14be67;var _0x31acc0;var _0x12375a;return db['User'][_0xa344('0x4c')]({'where':_0x1f4f54['options'][_0xa344('0x1b')]||{},'attributes':['id',_0xa344('0x26'),'role',_0xa344('0x50'),_0xa344('0x51'),_0xa344('0x27'),_0xa344('0x52'),_0xa344('0x28')]})[_0xa344('0xe')](function(_0x46a53a){if(_0x46a53a){_0x34786c=_0x46a53a;_0x12375a=_0x1f4f54[_0xa344('0x35')][_0xa344('0x28')]?_0x1f4f54[_0xa344('0x35')][_0xa344('0x28')]:util[_0xa344('0x2d')](_0xa344('0x33'),_0x34786c[_0xa344('0x26')]);return db[_0xa344('0x23')][_0xa344('0x53')]({'where':{'role':_0xa344('0x54'),'online':!![],'id':{'$ne':_0x34786c['id']}}});}})['then'](function(_0x5313d6){if(_0x5313d6){_0x31acc0=_0x5313d6;return require(_0xa344('0x55'))[_0xa344('0x56')]();}})[_0xa344('0xe')](function(_0x495b8e){if(_0x495b8e&&_0x495b8e[_0xa344('0x57')]&&_0x31acc0>=_0x495b8e[_0xa344('0x57')]){throw new Error(_0xa344('0x58'));}})['then'](function(){if(_0x34786c){return db[_0xa344('0x29')][_0xa344('0x4d')]({'where':{'membername':_0x34786c[_0xa344('0x26')]},'individualHooks':!![]});}})[_0xa344('0xe')](function(){if(_0x34786c){return _0x34786c['getVoiceQueues']({'raw':!![]});}})[_0xa344('0xe')](function(_0x545052){if(_0x34786c){if(_0x545052){var _0x3a4070=[];_0x14be67=_0x545052;if(_0x14be67[_0xa344('0x2c')]){for(var _0x5c994a=0x0;_0x5c994a<_0x14be67[_0xa344('0x2c')];_0x5c994a++){_0x3a4070[_0xa344('0x31')](db['UserVoiceQueueRt'][_0xa344('0x59')]({'membername':_0x34786c[_0xa344('0x26')],'UserId':_0x34786c['id'],'queue_name':_0x14be67[_0x5c994a][_0xa344('0x26')],'VoiceQueueId':_0x14be67[_0x5c994a]['id'],'interface':_0x12375a,'paused':_0x34786c['loginInPause']||![],'penalty':_0x14be67[_0x5c994a][_0xa344('0x5a')]||0x0}));}return BPromise[_0xa344('0x4a')](_0x3a4070);}}}})['then'](function(){if(_0x34786c){return db[_0xa344('0x39')][_0xa344('0x4e')]({'where':{'membername':_0x34786c[_0xa344('0x26')],'exitAt':null}});}})[_0xa344('0xe')](function(_0x264616){if(_0x34786c){if(_0x264616&&_0x264616[_0xa344('0x2c')]){var _0x3fbef2=[];_0x264616[_0xa344('0x30')](function(_0x4542b0){_0x3fbef2[_0xa344('0x31')](_0x4542b0['update']({'exitAt':moment()[_0xa344('0x2d')](_0xa344('0x34'))}));});return BPromise['all'](_0x3fbef2);}}})['then'](function(_0x38ade8){if(_0x34786c){var _0x101ee8=[];var _0x544530=[];var _0x25a5b8=utils[_0xa344('0x2f')]();var _0x55826c={'membername':_0x34786c[_0xa344('0x26')],'interface':_0x12375a,'enterAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'role':_0x34786c[_0xa344('0x37')],'internal':_0x34786c[_0xa344('0x27')]};_0x25a5b8[_0xa344('0x30')](function(_0x130af4){_0x101ee8[_0xa344('0x31')](_['merge']({'channel':_0x130af4,'type':'LOGIN','data1':_0xa344('0x5b'),'data2':_0x12375a},_0x55826c));if(_0x34786c[_0xa344('0x52')]){_0x544530['push'](_[_0xa344('0x5c')]({'channel':_0x130af4,'type':_0xa344('0x2b'),'data1':_0xa344('0x5d')},_0x55826c));}});return db[_0xa344('0x39')][_0xa344('0x3a')](_0x101ee8[_0xa344('0x5e')](_0x544530),{'individualHooks':!![]});}})[_0xa344('0xe')](function(){if(_0x34786c){return _0x34786c[_0xa344('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'voicePause':_0x34786c['loginInPause']||![],'mailPause':_0x34786c[_0xa344('0x52')]||![],'chatPause':_0x34786c[_0xa344('0x52')]||![],'faxPause':_0x34786c[_0xa344('0x52')]||![],'smsPause':_0x34786c[_0xa344('0x52')]||![],'openchannelPause':_0x34786c[_0xa344('0x52')]||![],'pauseType':_0x34786c[_0xa344('0x52')]?_0xa344('0x5d'):null,'lastPauseAt':moment()[_0xa344('0x2d')](_0xa344('0x34')),'interface':_0x12375a});}})[_0xa344('0xe')](function(_0x2ee78b){_0x3f1848(_0x2ee78b);})[_0xa344('0x21')](function(_0x5af8a1){_0x20de60(_0x1d8104['error'](0x1f4,_0x5af8a1[_0xa344('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b1e5231..6da8035 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 _0x1293=['user:','./user.events','save','update','emit','removeListener','register','length'];(function(_0x45301a,_0x7f8d6f){var _0x434ab8=function(_0x268997){while(--_0x268997){_0x45301a['push'](_0x45301a['shift']());}};_0x434ab8(++_0x7f8d6f);}(_0x1293,0x199));var _0x3129=function(_0x101241,_0x261d72){_0x101241=_0x101241-0x0;var _0x157874=_0x1293[_0x101241];return _0x157874;};'use strict';var UserEvents=require(_0x3129('0x0'));var events=[_0x3129('0x1'),'remove',_0x3129('0x2')];function createListener(_0x5c5bd2,_0x3368d7){return function(_0x48f875){_0x3368d7[_0x3129('0x3')](_0x5c5bd2,_0x48f875);};}function removeListener(_0x2435ca,_0x52d674){return function(){UserEvents[_0x3129('0x4')](_0x2435ca,_0x52d674);};}exports[_0x3129('0x5')]=function(_0x208d7a){for(var _0xc4b211=0x0,_0x420e54=events[_0x3129('0x6')];_0xc4b211<_0x420e54;_0xc4b211++){var _0x39d5f2=events[_0xc4b211];var _0x54b017=createListener(_0x3129('0x7')+_0x39d5f2,_0x208d7a);UserEvents['on'](_0x39d5f2,_0x54b017);}}; \ No newline at end of file +var _0x2c4f=['remove','update','emit','length','user:','./user.events','save'];(function(_0x24896c,_0x3d3472){var _0x4dbcf6=function(_0x5f0d66){while(--_0x5f0d66){_0x24896c['push'](_0x24896c['shift']());}};_0x4dbcf6(++_0x3d3472);}(_0x2c4f,0x1be));var _0xf2c4=function(_0x1ff6d7,_0x4623b9){_0x1ff6d7=_0x1ff6d7-0x0;var _0x33444b=_0x2c4f[_0x1ff6d7];return _0x33444b;};'use strict';var UserEvents=require(_0xf2c4('0x0'));var events=[_0xf2c4('0x1'),_0xf2c4('0x2'),_0xf2c4('0x3')];function createListener(_0x2184b1,_0x3ed56a){return function(_0x2fb934){_0x3ed56a[_0xf2c4('0x4')](_0x2184b1,_0x2fb934);};}function removeListener(_0x3e5389,_0x431a54){return function(){UserEvents['removeListener'](_0x3e5389,_0x431a54);};}exports['register']=function(_0x3d194d){for(var _0x4df5d0=0x0,_0x53e349=events[_0xf2c4('0x5')];_0x4df5d0<_0x53e349;_0x4df5d0++){var _0x374327=events[_0x4df5d0];var _0xd5877a=createListener(_0xf2c4('0x6')+_0x374327,_0x3d194d);UserEvents['on'](_0x374327,_0xd5877a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 574f88b..544e17b 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52cb4a,_0x217996){var _0x2d84e7=function(_0x1ecdb2){while(--_0x1ecdb2){_0x52cb4a['push'](_0x52cb4a['shift']());}};_0x2d84e7(++_0x217996);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x141ed9,_0x533fad){var _0x3addb9=function(_0x67a743){while(--_0x67a743){_0x141ed9['push'](_0x141ed9['shift']());}};_0x3addb9(++_0x533fad);}(_0xe706,0xa3));var _0x6e70=function(_0x4d50a1,_0x188247){_0x4d50a1=_0x4d50a1-0x0;var _0x2d733f=_0xe706[_0x4d50a1];return _0x2d733f;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 5e4dbbf..1764a53 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 _0x530a=['INTEGER','exports'];(function(_0x1240af,_0x2d909a){var _0x5a88bf=function(_0x3ceda2){while(--_0x3ceda2){_0x1240af['push'](_0x1240af['shift']());}};_0x5a88bf(++_0x2d909a);}(_0x530a,0x81));var _0xa530=function(_0x544087,_0x16bd93){_0x544087=_0x544087-0x0;var _0x4a3ee3=_0x530a[_0x544087];return _0x4a3ee3;};'use strict';var Sequelize=require('sequelize');module[_0xa530('0x0')]={'penalty':{'type':Sequelize[_0xa530('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6be=['sequelize','exports','INTEGER'];(function(_0x567adc,_0x2486d2){var _0xf3ed85=function(_0x2831e2){while(--_0x2831e2){_0x567adc['push'](_0x567adc['shift']());}};_0xf3ed85(++_0x2486d2);}(_0xa6be,0xab));var _0xea6b=function(_0x40dc8d,_0x3b03f7){_0x40dc8d=_0x40dc8d-0x0;var _0x57fa71=_0xa6be[_0x40dc8d];return _0x57fa71;};'use strict';var Sequelize=require(_0xea6b('0x0'));module[_0xea6b('0x1')]={'penalty':{'type':Sequelize[_0xea6b('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 eca7639..25cb51d 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 _0x8586=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x404767,_0x318248){var _0x14ad1b=function(_0x641ec3){while(--_0x641ec3){_0x404767['push'](_0x404767['shift']());}};_0x14ad1b(++_0x318248);}(_0x8586,0x12b));var _0x6858=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x8586[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x6858('0x0'));var util=require(_0x6858('0x1'));var logger=require(_0x6858('0x2'))(_0x6858('0x3'));var moment=require('moment');var BPromise=require(_0x6858('0x4'));var rp=require(_0x6858('0x5'));var fs=require('fs');var path=require(_0x6858('0x6'));var rimraf=require(_0x6858('0x7'));var config=require('../../config/environment');var attributes=require(_0x6858('0x8'));module[_0x6858('0x9')]=function(_0x4cb65f,_0x335840){return _0x4cb65f[_0x6858('0xa')](_0x6858('0xb'),attributes,{'tableName':_0x6858('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab19=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','lodash','util','moment','bluebird','rimraf'];(function(_0x56905f,_0x5c30fa){var _0x4a29c6=function(_0x2a8998){while(--_0x2a8998){_0x56905f['push'](_0x56905f['shift']());}};_0x4a29c6(++_0x5c30fa);}(_0xab19,0x73));var _0x9ab1=function(_0x149457,_0x22aac0){_0x149457=_0x149457-0x0;var _0x28649b=_0xab19[_0x149457];return _0x28649b;};'use strict';var _=require(_0x9ab1('0x0'));var util=require(_0x9ab1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9ab1('0x2'));var BPromise=require(_0x9ab1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9ab1('0x4'));var config=require(_0x9ab1('0x5'));var attributes=require(_0x9ab1('0x6'));module[_0x9ab1('0x7')]=function(_0x541df7,_0x1bf9ff){return _0x541df7[_0x9ab1('0x8')](_0x9ab1('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 8a8b2ab..0f3225b 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 _0x2629=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util'];(function(_0x1dee11,_0x191420){var _0x3485dd=function(_0x17df52){while(--_0x17df52){_0x1dee11['push'](_0x1dee11['shift']());}};_0x3485dd(++_0x191420);}(_0x2629,0x124));var _0x9262=function(_0x496c0c,_0x1497aa){_0x496c0c=_0x496c0c-0x0;var _0x2f673b=_0x2629[_0x496c0c];return _0x2f673b;};'use strict';var _=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9262('0x2'));var fs=require('fs');var Redis=require(_0x9262('0x3'));var db=require(_0x9262('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9262('0x5'));var config=require(_0x9262('0x6'));var jayson=require(_0x9262('0x7'));var client=jayson[_0x9262('0x8')][_0x9262('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3954d6,_0x56b226,_0x10808f){return new BPromise(function(_0x4b9339,_0x479e2b){return client[_0x9262('0xa')](_0x3954d6,_0x10808f)[_0x9262('0xb')](function(_0x5b846f){logger[_0x9262('0xc')](_0x9262('0xd'),_0x56b226,'request\x20sent');logger[_0x9262('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x56b226,'request\x20sent',JSON[_0x9262('0xf')](_0x5b846f));if(_0x5b846f['error']){if(_0x5b846f['error']['code']===0x1f4){logger[_0x9262('0x10')](_0x9262('0xd'),_0x56b226,_0x5b846f['error'][_0x9262('0x11')]);return _0x479e2b(_0x5b846f['error'][_0x9262('0x11')]);}logger[_0x9262('0x10')](_0x9262('0xd'),_0x56b226,_0x5b846f[_0x9262('0x10')][_0x9262('0x11')]);return _0x4b9339(_0x5b846f[_0x9262('0x10')][_0x9262('0x11')]);}else{logger[_0x9262('0xc')](_0x9262('0xd'),_0x56b226,_0x9262('0x12'));_0x4b9339(_0x5b846f[_0x9262('0x13')]['message']);}})[_0x9262('0x14')](function(_0x4c31ba){logger['error'](_0x9262('0xd'),_0x56b226,_0x4c31ba);_0x479e2b(_0x4c31ba);});});} \ No newline at end of file +var _0xde06=['debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xde06,0x17d));var _0x6de0=function(_0x3fabdd,_0x1bb381){_0x3fabdd=_0x3fabdd-0x0;var _0x51d5b0=_0xde06[_0x3fabdd];return _0x51d5b0;};'use strict';var _=require(_0x6de0('0x0'));var util=require(_0x6de0('0x1'));var moment=require(_0x6de0('0x2'));var BPromise=require(_0x6de0('0x3'));var rs=require(_0x6de0('0x4'));var fs=require('fs');var Redis=require(_0x6de0('0x5'));var db=require(_0x6de0('0x6'))['db'];var utils=require(_0x6de0('0x7'));var logger=require(_0x6de0('0x8'))(_0x6de0('0x9'));var config=require(_0x6de0('0xa'));var jayson=require(_0x6de0('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xde0d8d,_0x1322c5,_0x277ba5){return new BPromise(function(_0x521267,_0x2d68d7){return client['request'](_0xde0d8d,_0x277ba5)[_0x6de0('0xc')](function(_0x3f3683){logger[_0x6de0('0xd')](_0x6de0('0xe'),_0x1322c5,'request\x20sent');logger[_0x6de0('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1322c5,'request\x20sent',JSON['stringify'](_0x3f3683));if(_0x3f3683[_0x6de0('0x10')]){if(_0x3f3683[_0x6de0('0x10')][_0x6de0('0x11')]===0x1f4){logger[_0x6de0('0x10')](_0x6de0('0xe'),_0x1322c5,_0x3f3683['error'][_0x6de0('0x12')]);return _0x2d68d7(_0x3f3683[_0x6de0('0x10')]['message']);}logger[_0x6de0('0x10')](_0x6de0('0xe'),_0x1322c5,_0x3f3683[_0x6de0('0x10')][_0x6de0('0x12')]);return _0x521267(_0x3f3683[_0x6de0('0x10')][_0x6de0('0x12')]);}else{logger['info'](_0x6de0('0xe'),_0x1322c5,_0x6de0('0x13'));_0x521267(_0x3f3683[_0x6de0('0x14')][_0x6de0('0x12')]);}})[_0x6de0('0x15')](function(_0x4476f8){logger[_0x6de0('0x10')](_0x6de0('0xe'),_0x1322c5,_0x4476f8);_0x2d68d7(_0x4476f8);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 897b69d..ffbfc7f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x38e177,_0x59ec9f){var _0x1faf15=function(_0x4cf149){while(--_0x4cf149){_0x38e177['push'](_0x38e177['shift']());}};_0x1faf15(++_0x59ec9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x326171,_0x4d88e6){var _0x47e377=function(_0x5cdd24){while(--_0x5cdd24){_0x326171['push'](_0x326171['shift']());}};_0x47e377(++_0x4d88e6);}(_0xedd9,0xfc));var _0x9edd=function(_0x462153,_0x115dcc){_0x462153=_0x462153-0x0;var _0x581c23=_0xedd9[_0x462153];return _0x581c23;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d608ae6..1f3904a 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 _0xdb36=['INTEGER','STRING','sequelize','exports'];(function(_0x1d2244,_0x500e1a){var _0x5d89c2=function(_0x3ded41){while(--_0x3ded41){_0x1d2244['push'](_0x1d2244['shift']());}};_0x5d89c2(++_0x500e1a);}(_0xdb36,0xf6));var _0x6db3=function(_0x586ca3,_0x31140e){_0x586ca3=_0x586ca3-0x0;var _0x5577d0=_0xdb36[_0x586ca3];return _0x5577d0;};'use strict';var Sequelize=require(_0x6db3('0x0'));module[_0x6db3('0x1')]={'penalty':{'type':Sequelize[_0x6db3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6db3('0x3')]}}; \ No newline at end of file +var _0x8f82=['INTEGER','STRING','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8f82,0x194));var _0x28f8=function(_0x4e1de5,_0xac3956){_0x4e1de5=_0x4e1de5-0x0;var _0x4be012=_0x8f82[_0x4e1de5];return _0x4be012;};'use strict';var Sequelize=require(_0x28f8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x28f8('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x28f8('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x28f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index b768453..115ecfe 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 _0xf0a6=['path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f8dca,_0x50001e){var _0x1b19f7=function(_0xe387ca){while(--_0xe387ca){_0x1f8dca['push'](_0x1f8dca['shift']());}};_0x1b19f7(++_0x50001e);}(_0xf0a6,0x6e));var _0x6f0a=function(_0x2838ee,_0x2c618d){_0x2838ee=_0x2838ee-0x0;var _0x1c1090=_0xf0a6[_0x2838ee];return _0x1c1090;};'use strict';var _=require(_0x6f0a('0x0'));var util=require(_0x6f0a('0x1'));var logger=require(_0x6f0a('0x2'))(_0x6f0a('0x3'));var moment=require(_0x6f0a('0x4'));var BPromise=require(_0x6f0a('0x5'));var rp=require(_0x6f0a('0x6'));var fs=require('fs');var path=require(_0x6f0a('0x7'));var rimraf=require(_0x6f0a('0x8'));var config=require(_0x6f0a('0x9'));var attributes=require(_0x6f0a('0xa'));module['exports']=function(_0x2e4882,_0x334e9b){return _0x2e4882['define'](_0x6f0a('0xb'),attributes,{'tableName':_0x6f0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9174=['UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x4308e6,_0x1e2924){var _0x555d58=function(_0x45248e){while(--_0x45248e){_0x4308e6['push'](_0x4308e6['shift']());}};_0x555d58(++_0x1e2924);}(_0x9174,0x1e2));var _0x4917=function(_0x2ba5a1,_0x17bee8){_0x2ba5a1=_0x2ba5a1-0x0;var _0x30397a=_0x9174[_0x2ba5a1];return _0x30397a;};'use strict';var _=require(_0x4917('0x0'));var util=require('util');var logger=require(_0x4917('0x1'))(_0x4917('0x2'));var moment=require(_0x4917('0x3'));var BPromise=require('bluebird');var rp=require(_0x4917('0x4'));var fs=require('fs');var path=require(_0x4917('0x5'));var rimraf=require(_0x4917('0x6'));var config=require(_0x4917('0x7'));var attributes=require(_0x4917('0x8'));module['exports']=function(_0x24b204,_0x1650da){return _0x24b204[_0x4917('0x9')](_0x4917('0xa'),attributes,{'tableName':_0x4917('0xb'),'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 837cda6..58939f6 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 _0x3e5e=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','randomstring','ioredis','../../mysqldb'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e5e,0x140));var _0xe3e5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3e5e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe3e5('0x0'));var fs=require('fs');var Redis=require(_0xe3e5('0x1'));var db=require(_0xe3e5('0x2'))['db'];var utils=require(_0xe3e5('0x3'));var logger=require('../../config/logger')(_0xe3e5('0x4'));var config=require(_0xe3e5('0x5'));var jayson=require(_0xe3e5('0x6'));var client=jayson['client'][_0xe3e5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3abcf8,_0x19b57f,_0x342051){return new BPromise(function(_0x322844,_0x42c60f){return client[_0xe3e5('0x8')](_0x3abcf8,_0x342051)['then'](function(_0x5e783a){logger[_0xe3e5('0x9')](_0xe3e5('0xa'),_0x19b57f,'request\x20sent');logger[_0xe3e5('0xb')](_0xe3e5('0xc'),_0x19b57f,_0xe3e5('0xd'),JSON[_0xe3e5('0xe')](_0x5e783a));if(_0x5e783a[_0xe3e5('0xf')]){if(_0x5e783a[_0xe3e5('0xf')]['code']===0x1f4){logger[_0xe3e5('0xf')](_0xe3e5('0xa'),_0x19b57f,_0x5e783a['error'][_0xe3e5('0x10')]);return _0x42c60f(_0x5e783a['error'][_0xe3e5('0x10')]);}logger[_0xe3e5('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x19b57f,_0x5e783a[_0xe3e5('0xf')][_0xe3e5('0x10')]);return _0x322844(_0x5e783a['error'][_0xe3e5('0x10')]);}else{logger['info'](_0xe3e5('0xa'),_0x19b57f,_0xe3e5('0xd'));_0x322844(_0x5e783a[_0xe3e5('0x11')][_0xe3e5('0x10')]);}})[_0xe3e5('0x12')](function(_0x5346fe){logger[_0xe3e5('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x19b57f,_0x5346fe);_0x42c60f(_0x5346fe);});});} \ No newline at end of file +var _0xfa40=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa40,0xbf));var _0x0fa4=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xfa40[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0fa4('0x0'));var util=require(_0x0fa4('0x1'));var moment=require(_0x0fa4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fa4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fa4('0x4'));var logger=require(_0x0fa4('0x5'))(_0x0fa4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0fa4('0x7')][_0x0fa4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bad8c,_0x4cda54,_0xbee44c){return new BPromise(function(_0x7c7292,_0x383fc7){return client[_0x0fa4('0x9')](_0x4bad8c,_0xbee44c)[_0x0fa4('0xa')](function(_0x50d398){logger[_0x0fa4('0xb')](_0x0fa4('0xc'),_0x4cda54,_0x0fa4('0xd'));logger[_0x0fa4('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4cda54,_0x0fa4('0xd'),JSON[_0x0fa4('0xf')](_0x50d398));if(_0x50d398[_0x0fa4('0x10')]){if(_0x50d398['error']['code']===0x1f4){logger[_0x0fa4('0x10')](_0x0fa4('0xc'),_0x4cda54,_0x50d398['error']['message']);return _0x383fc7(_0x50d398[_0x0fa4('0x10')][_0x0fa4('0x11')]);}logger[_0x0fa4('0x10')](_0x0fa4('0xc'),_0x4cda54,_0x50d398[_0x0fa4('0x10')][_0x0fa4('0x11')]);return _0x7c7292(_0x50d398[_0x0fa4('0x10')]['message']);}else{logger[_0x0fa4('0xb')](_0x0fa4('0xc'),_0x4cda54,'request\x20sent');_0x7c7292(_0x50d398[_0x0fa4('0x12')]['message']);}})[_0x0fa4('0x13')](function(_0x5ba512){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4cda54,_0x5ba512);_0x383fc7(_0x5ba512);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 6767896..dee13a4 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x77ad04,_0x50b6d8){var _0xfbf0f=function(_0x259c61){while(--_0x259c61){_0x77ad04['push'](_0x77ad04['shift']());}};_0xfbf0f(++_0x50b6d8);}(_0x70e0,0x17b));var _0x070e=function(_0x326f33,_0x9c8d9f){_0x326f33=_0x326f33-0x0;var _0x2d5b4f=_0x70e0[_0x326f33];return _0x2d5b4f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5a32d9,_0x5d8879){var _0x3b71bf=function(_0x3b8126){while(--_0x3b8126){_0x5a32d9['push'](_0x5a32d9['shift']());}};_0x3b71bf(++_0x5d8879);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 313e133..71a8996 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 _0x093c=['sequelize','exports','INTEGER'];(function(_0x4c8af4,_0x556041){var _0x32fb71=function(_0x182ddb){while(--_0x182ddb){_0x4c8af4['push'](_0x4c8af4['shift']());}};_0x32fb71(++_0x556041);}(_0x093c,0x7e));var _0xc093=function(_0x131d81,_0x420cd7){_0x131d81=_0x131d81-0x0;var _0x50e259=_0x093c[_0x131d81];return _0x50e259;};'use strict';var Sequelize=require(_0xc093('0x0'));module[_0xc093('0x1')]={'penalty':{'type':Sequelize[_0xc093('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbfc0=['exports','INTEGER','sequelize'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xbfc0,0x125));var _0x0bfc=function(_0x4b7d87,_0x238711){_0x4b7d87=_0x4b7d87-0x0;var _0x3b9f82=_0xbfc0[_0x4b7d87];return _0x3b9f82;};'use strict';var Sequelize=require(_0x0bfc('0x0'));module[_0x0bfc('0x1')]={'penalty':{'type':Sequelize[_0x0bfc('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 2f6c0c3..37146c4 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 _0x9cf2=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','UserMailQueue'];(function(_0x3c188e,_0x5e771a){var _0x5b054b=function(_0x4643d1){while(--_0x4643d1){_0x3c188e['push'](_0x3c188e['shift']());}};_0x5b054b(++_0x5e771a);}(_0x9cf2,0xb1));var _0x29cf=function(_0x3544f9,_0x5ee41d){_0x3544f9=_0x3544f9-0x0;var _0x1f3599=_0x9cf2[_0x3544f9];return _0x1f3599;};'use strict';var _=require(_0x29cf('0x0'));var util=require(_0x29cf('0x1'));var logger=require(_0x29cf('0x2'))(_0x29cf('0x3'));var moment=require(_0x29cf('0x4'));var BPromise=require(_0x29cf('0x5'));var rp=require(_0x29cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x29cf('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x29cf('0x8')]=function(_0x4086ef,_0x368b95){return _0x4086ef['define'](_0x29cf('0x9'),attributes,{'tableName':_0x29cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe120=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x17db1a,_0x415e90){var _0xee3cd1=function(_0x3e485e){while(--_0x3e485e){_0x17db1a['push'](_0x17db1a['shift']());}};_0xee3cd1(++_0x415e90);}(_0xe120,0x131));var _0x0e12=function(_0x36235d,_0x228592){_0x36235d=_0x36235d-0x0;var _0x1b54ff=_0xe120[_0x36235d];return _0x1b54ff;};'use strict';var _=require(_0x0e12('0x0'));var util=require(_0x0e12('0x1'));var logger=require(_0x0e12('0x2'))(_0x0e12('0x3'));var moment=require(_0x0e12('0x4'));var BPromise=require(_0x0e12('0x5'));var rp=require(_0x0e12('0x6'));var fs=require('fs');var path=require(_0x0e12('0x7'));var rimraf=require(_0x0e12('0x8'));var config=require(_0x0e12('0x9'));var attributes=require(_0x0e12('0xa'));module[_0x0e12('0xb')]=function(_0x4e56cc,_0xe1dc9e){return _0x4e56cc['define'](_0x0e12('0xc'),attributes,{'tableName':_0x0e12('0xd'),'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 c40e620..2d34801 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x562bde,_0x55240b){var _0x3b5707=function(_0x59d111){while(--_0x59d111){_0x562bde['push'](_0x562bde['shift']());}};_0x3b5707(++_0x55240b);}(_0xa41a,0x6b));var _0xaa41=function(_0x39f2ac,_0x2ef69e){_0x39f2ac=_0x39f2ac-0x0;var _0x23adca=_0xa41a[_0x39f2ac];return _0x23adca;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x30956b,_0x650e88){var _0x19c58d=function(_0x115bc4){while(--_0x115bc4){_0x30956b['push'](_0x30956b['shift']());}};_0x19c58d(++_0x650e88);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x5fc3[_0x43fdf8];return _0x1160c6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 2318d9e..a656cb8 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 _0x9397=['./userNotification.controller','sendUserNotification','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x50ab90,_0x4f1f45){var _0x455338=function(_0x380a3a){while(--_0x380a3a){_0x50ab90['push'](_0x50ab90['shift']());}};_0x455338(++_0x4f1f45);}(_0x9397,0x1aa));var _0x7939=function(_0x1a58ac,_0x2a3cc2){_0x1a58ac=_0x1a58ac-0x0;var _0xeac505=_0x9397[_0x1a58ac];return _0xeac505;};'use strict';var multer=require(_0x7939('0x0'));var util=require(_0x7939('0x1'));var path=require(_0x7939('0x2'));var timeout=require(_0x7939('0x3'));var express=require('express');var router=express[_0x7939('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7939('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7939('0x6'));router['post']('/',auth['isAuthenticated'](),controller[_0x7939('0x7')]);module[_0x7939('0x8')]=router; \ No newline at end of file +var _0x901c=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x455efc,_0x119fd0){var _0x53e14e=function(_0x2e2ad1){while(--_0x2e2ad1){_0x455efc['push'](_0x455efc['shift']());}};_0x53e14e(++_0x119fd0);}(_0x901c,0x1e5));var _0xc901=function(_0x598948,_0x5708b4){_0x598948=_0x598948-0x0;var _0x17498b=_0x901c[_0x598948];return _0x17498b;};'use strict';var multer=require(_0xc901('0x0'));var util=require(_0xc901('0x1'));var path=require('path');var timeout=require(_0xc901('0x2'));var express=require(_0xc901('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc901('0x4'));var interaction=require(_0xc901('0x5'));var config=require('../../config/environment');var controller=require(_0xc901('0x6'));router[_0xc901('0x7')]('/',auth[_0xc901('0x8')](),controller[_0xc901('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index e944377..6f0befa 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 _0x232b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x37fd0b,_0x136247){var _0x1cc1ae=function(_0x22a9b4){while(--_0x22a9b4){_0x37fd0b['push'](_0x37fd0b['shift']());}};_0x1cc1ae(++_0x136247);}(_0x232b,0x1d9));var _0xb232=function(_0x158965,_0x117f97){_0x158965=_0x158965-0x0;var _0x3a3e9d=_0x232b[_0x158965];return _0x3a3e9d;};'use strict';var Sequelize=require(_0xb232('0x0'));module[_0xb232('0x1')]={'body':{'type':Sequelize[_0xb232('0x2')]},'senderName':{'type':Sequelize[_0xb232('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xb232('0x3')]},'beep':{'type':Sequelize[_0xb232('0x4')]}}; \ No newline at end of file +var _0xa6ae=['exports','TEXT','STRING','BOOLEAN'];(function(_0x470523,_0x121d76){var _0x96596b=function(_0x3843f0){while(--_0x3843f0){_0x470523['push'](_0x470523['shift']());}};_0x96596b(++_0x121d76);}(_0xa6ae,0xc4));var _0xea6a=function(_0x5d9d1e,_0x287c37){_0x5d9d1e=_0x5d9d1e-0x0;var _0x2fc272=_0xa6ae[_0x5d9d1e];return _0x2fc272;};'use strict';var Sequelize=require('sequelize');module[_0xea6a('0x0')]={'body':{'type':Sequelize[_0xea6a('0x1')]},'senderName':{'type':Sequelize[_0xea6a('0x2')]},'recipientsId':{'type':Sequelize[_0xea6a('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xea6a('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e6d2230..092ee09 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 _0x7e6b=['model','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','beep','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','toLowerCase','User','union','ids','includes','queue','Queue','push','all','flatten','getAgents','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some'];(function(_0x4c9d00,_0x5092d5){var _0x4a73f5=function(_0xc0bfc7){while(--_0xc0bfc7){_0x4c9d00['push'](_0x4c9d00['shift']());}};_0x4a73f5(++_0x5092d5);}(_0x7e6b,0x144));var _0xb7e6=function(_0x18eb26,_0x2cd839){_0x18eb26=_0x18eb26-0x0;var _0x225268=_0x7e6b[_0x18eb26];return _0x225268;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7e6('0x0'));var zipdir=require(_0xb7e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb7e6('0x2'));var BPromise=require(_0xb7e6('0x3'));var Mustache=require(_0xb7e6('0x4'));var util=require('util');var path=require(_0xb7e6('0x5'));var sox=require('sox');var csv=require(_0xb7e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7e6('0x7'));var squel=require(_0xb7e6('0x8'));var crypto=require(_0xb7e6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb7e6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7e6('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb7e6('0xb'));var hardwareService=require(_0xb7e6('0xc'));var logger=require(_0xb7e6('0xd'))(_0xb7e6('0xe'));var utils=require(_0xb7e6('0xf'));var config=require(_0xb7e6('0x10'));var licenseUtil=require(_0xb7e6('0x11'));var db=require(_0xb7e6('0x12'))['db'];config['redis']=_[_0xb7e6('0x13')](config[_0xb7e6('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7e6('0x15'))(new Redis(config['redis']));require(_0xb7e6('0x16'))['register'](socket);function respondWithStatusCode(_0x1db8c0,_0x11b3ac){_0x11b3ac=_0x11b3ac||0xcc;return function(_0x27ba72){if(_0x27ba72){return _0x1db8c0['sendStatus'](_0x11b3ac);}return _0x1db8c0['status'](_0x11b3ac)[_0xb7e6('0x17')]();};}function respondWithResult(_0x5eee24,_0x102be5){_0x102be5=_0x102be5||0xc8;return function(_0x283f25){if(_0x283f25){return _0x5eee24[_0xb7e6('0x18')](_0x102be5)['json'](_0x283f25);}};}function respondWithFilteredResult(_0x22608f,_0x31b2be){return function(_0x5ab4e3){if(_0x5ab4e3){var _0x5df6c8=typeof _0x31b2be[_0xb7e6('0x19')]===_0xb7e6('0x1a')&&typeof _0x31b2be[_0xb7e6('0x1b')]===_0xb7e6('0x1a');var _0x165f06=_0x5ab4e3['count'];var _0x567251=_0x5df6c8?0x0:_0x31b2be['offset'];var _0x38fbfc=_0x5df6c8?_0x5ab4e3[_0xb7e6('0x1c')]:_0x31b2be[_0xb7e6('0x19')]+_0x31b2be['limit'];var _0x59e0bb;if(_0x38fbfc>=_0x165f06){_0x38fbfc=_0x165f06;_0x59e0bb=0xc8;}else{_0x59e0bb=0xce;}_0x22608f[_0xb7e6('0x18')](_0x59e0bb);return _0x22608f[_0xb7e6('0x1d')](_0xb7e6('0x1e'),_0x567251+'-'+_0x38fbfc+'/'+_0x165f06)[_0xb7e6('0x1f')](_0x5ab4e3);}return null;};}function patchUpdates(_0x4452b8){return function(_0xbb0157){try{jsonpatch[_0xb7e6('0x20')](_0xbb0157,_0x4452b8,!![]);}catch(_0x31385c){return BPromise[_0xb7e6('0x21')](_0x31385c);}return _0xbb0157[_0xb7e6('0x22')]();};}function saveUpdates(_0x78ad7e,_0x54cc1f){return function(_0x4e9beb){if(_0x4e9beb){return _0x4e9beb[_0xb7e6('0x23')](_0x78ad7e)[_0xb7e6('0x24')](function(_0x3b619c){return _0x3b619c;});}return null;};}function removeEntity(_0x5d12de,_0x2f2ae2){return function(_0x230531){if(_0x230531){return _0x230531[_0xb7e6('0x25')]()[_0xb7e6('0x24')](function(){_0x5d12de['status'](0xcc)[_0xb7e6('0x17')]();});}};}function handleEntityNotFound(_0x671dd,_0x2462a4){return function(_0xff1f8f){if(!_0xff1f8f){_0x671dd[_0xb7e6('0x26')](0x194);}return _0xff1f8f;};}function handleError(_0x3229fa,_0x16b10a){_0x16b10a=_0x16b10a||0x1f4;return function(_0x23000b){logger['error'](_0x23000b[_0xb7e6('0x27')]);if(_0x23000b[_0xb7e6('0x28')]){delete _0x23000b[_0xb7e6('0x28')];}_0x3229fa[_0xb7e6('0x18')](_0x16b10a)[_0xb7e6('0x29')](_0x23000b);};}exports[_0xb7e6('0x2a')]=function(_0x5f22ac,_0x10bd16,_0x164ff7){if(!_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x2c')]('text')&&!_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x2c')](_0xb7e6('0x2d'))){throw new db['Sequelize']['ValidationError'](_0xb7e6('0x2e'));}else{if(_0x5f22ac['body'][_0xb7e6('0x2c')](_0xb7e6('0x2d'))&&!_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x2c')](_0xb7e6('0x2f'))){throw new db[(_0xb7e6('0x30'))][(_0xb7e6('0x31'))](_0xb7e6('0x32'));}if(!_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x2c')](_0xb7e6('0x33'))){throw new db[(_0xb7e6('0x30'))][(_0xb7e6('0x31'))](_0xb7e6('0x34'));}else{try{var _0x431754=JSON[_0xb7e6('0x35')](_0x5f22ac[_0xb7e6('0x2b')]['recipients']);}catch(_0x4eaf56){logger[_0xb7e6('0x36')](_0x4eaf56);throw new db[(_0xb7e6('0x30'))][(_0xb7e6('0x31'))](_0xb7e6('0x37'));}var _0x353b36=[_0xb7e6('0x38'),_0xb7e6('0x39'),_0xb7e6('0x3a'),'openchannelqueue',_0xb7e6('0x3b'),_0xb7e6('0x3c'),_0xb7e6('0x3d'),'team',_0xb7e6('0x3e')];if(_[_0xb7e6('0x3f')](_0x431754,function(_0x42d2d7){return!_['includes'](_0x353b36,_0x42d2d7[_0xb7e6('0x40')]['toLowerCase']());})){throw new db['Sequelize'][(_0xb7e6('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4e5b26={};_0x4e5b26['senderName']=_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x2c')]('senderName')?_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x41')]:_0x5f22ac[_0xb7e6('0x3e')][_0xb7e6('0x42')];_0x4e5b26[_0xb7e6('0x43')]=_[_0xb7e6('0x44')](_0x5f22ac['body'][_0xb7e6('0x43')])?null:_0x5f22ac[_0xb7e6('0x2b')][_0xb7e6('0x43')];_0x4e5b26['beep']=_0x5f22ac[_0xb7e6('0x2b')]['beep']||![];_0x4e5b26[_0xb7e6('0x45')]=_0x5f22ac[_0xb7e6('0x3e')]['id'];return getContent(_0x5f22ac[_0xb7e6('0x2b')])[_0xb7e6('0x24')](function(_0x5adbd5){_0x4e5b26[_0xb7e6('0x2b')]=_0x5adbd5;return getRecipients(_0x431754);})['then'](function(_0xf27d49){_0x4e5b26[_0xb7e6('0x46')]=_[_0xb7e6('0x47')](_0xf27d49)['join'](',');return db[_0xb7e6('0x48')]['transaction'](function(_0x49ce6d){return db[_0xb7e6('0x49')][_0xb7e6('0x4a')](_0x4e5b26,{'raw':!![],'transaction':_0x49ce6d})[_0xb7e6('0x24')](function(_0x41c3c0){var _0x46d70d={'sender':_0x4e5b26['senderName'],'description':_0x4e5b26['recipientsDescription'],'content':_0x4e5b26[_0xb7e6('0x2b')],'beep':_0x4e5b26[_0xb7e6('0x4b')]};_0xf27d49[_0xb7e6('0x4c')](function(_0x254545){_0x46d70d[_0xb7e6('0x4d')]=_0x254545;socket[_0xb7e6('0x4e')](_0xb7e6('0x4f'),_0x46d70d);});return _0x41c3c0;});});})[_0xb7e6('0x24')](respondWithResult(_0x10bd16,0xc9))[_0xb7e6('0x50')](handleError(_0x10bd16,null));};function getContent(_0x182d93){return new BPromise(function(_0x1106a0,_0x57ffcc){if(_0x182d93[_0xb7e6('0x51')]){_0x1106a0(_0x182d93[_0xb7e6('0x51')]);return;}return db[_0xb7e6('0x52')][_0xb7e6('0x53')]({'attributes':[_0xb7e6('0x54')],'where':{'id':_0x182d93[_0xb7e6('0x2d')]},'raw':!![]})[_0xb7e6('0x24')](function(_0x32ce7b){if(!_0x32ce7b)throw new db[(_0xb7e6('0x30'))][(_0xb7e6('0x31'))](_0xb7e6('0x55'));var _0x3ada37=Mustache['render'](_0x32ce7b[_0xb7e6('0x54')],_0x182d93[_0xb7e6('0x2f')]);_0x1106a0(_0x3ada37);})[_0xb7e6('0x50')](function(_0x4fc75b){_0x57ffcc(_0x4fc75b);});});}function getRecipients(_0x10579c){return new BPromise(function(_0x113bb7,_0x2b10ee){var _0x38d71f=[];var _0x9fa53d=[];_0x10579c[_0xb7e6('0x4c')](function(_0x725ba2){var _0x5a348a=_['startCase'](_0x725ba2[_0xb7e6('0x40')][_0xb7e6('0x56')]());if(_0x5a348a===_0xb7e6('0x57')){_0x38d71f=_[_0xb7e6('0x58')](_0x38d71f,_0x725ba2[_0xb7e6('0x59')]);}else{if(_[_0xb7e6('0x5a')](_0x5a348a,_0xb7e6('0x5b')))_0x5a348a=_0x5a348a['replace'](_0xb7e6('0x5b'),_0xb7e6('0x5c'));_0x725ba2[_0xb7e6('0x59')][_0xb7e6('0x4c')](function(_0x336bc1){_0x9fa53d[_0xb7e6('0x5d')](getAgents(_0x5a348a,_0x336bc1));});}});return BPromise[_0xb7e6('0x5e')](_0x9fa53d)[_0xb7e6('0x24')](function(_0x505d4e){_0x38d71f=_[_0xb7e6('0x58')](_0x38d71f,_[_0xb7e6('0x5f')](_0x505d4e));_0x113bb7(_0x38d71f);})[_0xb7e6('0x50')](function(_0x1b6940){_0x2b10ee(_0x1b6940);});});}function getAgents(_0x555556,_0x4e50ec){return new BPromise(function(_0x465a8d,_0x56ebbf){return db[_0x555556][_0xb7e6('0x53')]({'where':{'id':_0x4e50ec}})[_0xb7e6('0x24')](function(_0x361540){return _0x361540[_0xb7e6('0x60')]({'attributes':['id'],'raw':!![]})[_0xb7e6('0x24')](function(_0x498fe1){var _0xeab76=_['map'](_0x498fe1,'id');_0x465a8d(_0xeab76);});})[_0xb7e6('0x50')](function(_0x894283){_0x56ebbf(_0x894283);});});} \ No newline at end of file +var _0xc8fe=['flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','sendUserNotification','body','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','mailqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','beep','forEach','recipient','emit','userNotification:send','Template','findOne','html','TemplateId','render','catch','startCase','union','queue','replace','Queue','ids','all'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xc8fe,0x67));var _0xec8f=function(_0x3c6d53,_0x110b6e){_0x3c6d53=_0x3c6d53-0x0;var _0x376fe5=_0xc8fe[_0x3c6d53];return _0x376fe5;};'use strict';var emlformat=require(_0xec8f('0x0'));var rimraf=require(_0xec8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec8f('0x2'));var rp=require(_0xec8f('0x3'));var moment=require(_0xec8f('0x4'));var BPromise=require(_0xec8f('0x5'));var Mustache=require(_0xec8f('0x6'));var util=require(_0xec8f('0x7'));var path=require(_0xec8f('0x8'));var sox=require(_0xec8f('0x9'));var csv=require(_0xec8f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec8f('0xb'));var _=require('lodash');var squel=require(_0xec8f('0xc'));var crypto=require(_0xec8f('0xd'));var jsforce=require(_0xec8f('0xe'));var deskjs=require(_0xec8f('0xf'));var toCsv=require(_0xec8f('0xa'));var querystring=require(_0xec8f('0x10'));var Papa=require(_0xec8f('0x11'));var Redis=require(_0xec8f('0x12'));var authService=require(_0xec8f('0x13'));var qs=require(_0xec8f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec8f('0x15'));var logger=require('../../config/logger')(_0xec8f('0x16'));var utils=require(_0xec8f('0x17'));var config=require(_0xec8f('0x18'));var licenseUtil=require(_0xec8f('0x19'));var db=require(_0xec8f('0x1a'))['db'];config[_0xec8f('0x1b')]=_[_0xec8f('0x1c')](config[_0xec8f('0x1b')],{'host':_0xec8f('0x1d'),'port':0x18eb});var socket=require(_0xec8f('0x1e'))(new Redis(config['redis']));require('./userNotification.socket')[_0xec8f('0x1f')](socket);function respondWithStatusCode(_0x36e15b,_0xf1fe40){_0xf1fe40=_0xf1fe40||0xcc;return function(_0x42e082){if(_0x42e082){return _0x36e15b['sendStatus'](_0xf1fe40);}return _0x36e15b[_0xec8f('0x20')](_0xf1fe40)['end']();};}function respondWithResult(_0x595e9f,_0x2bc44f){_0x2bc44f=_0x2bc44f||0xc8;return function(_0x3711a0){if(_0x3711a0){return _0x595e9f[_0xec8f('0x20')](_0x2bc44f)[_0xec8f('0x21')](_0x3711a0);}};}function respondWithFilteredResult(_0x3b5157,_0x385f8f){return function(_0x2892e6){if(_0x2892e6){var _0x4a4a62=typeof _0x385f8f[_0xec8f('0x22')]===_0xec8f('0x23')&&typeof _0x385f8f['limit']===_0xec8f('0x23');var _0x97146f=_0x2892e6[_0xec8f('0x24')];var _0x4b0c0e=_0x4a4a62?0x0:_0x385f8f['offset'];var _0x41bc8a=_0x4a4a62?_0x2892e6[_0xec8f('0x24')]:_0x385f8f['offset']+_0x385f8f[_0xec8f('0x25')];var _0x86aaa;if(_0x41bc8a>=_0x97146f){_0x41bc8a=_0x97146f;_0x86aaa=0xc8;}else{_0x86aaa=0xce;}_0x3b5157['status'](_0x86aaa);return _0x3b5157['set'](_0xec8f('0x26'),_0x4b0c0e+'-'+_0x41bc8a+'/'+_0x97146f)[_0xec8f('0x21')](_0x2892e6);}return null;};}function patchUpdates(_0x3a06d1){return function(_0x16cba9){try{jsonpatch[_0xec8f('0x27')](_0x16cba9,_0x3a06d1,!![]);}catch(_0x33c1f5){return BPromise[_0xec8f('0x28')](_0x33c1f5);}return _0x16cba9[_0xec8f('0x29')]();};}function saveUpdates(_0x1380b7,_0x3626d9){return function(_0x39af15){if(_0x39af15){return _0x39af15['update'](_0x1380b7)['then'](function(_0x1c7c91){return _0x1c7c91;});}return null;};}function removeEntity(_0x596c27,_0x365078){return function(_0x5d4c81){if(_0x5d4c81){return _0x5d4c81['destroy']()[_0xec8f('0x2a')](function(){_0x596c27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dca3e,_0x57cc07){return function(_0xc3e58c){if(!_0xc3e58c){_0x4dca3e[_0xec8f('0x2b')](0x194);}return _0xc3e58c;};}function handleError(_0x51f8a9,_0x3ed5e0){_0x3ed5e0=_0x3ed5e0||0x1f4;return function(_0x1e11f0){logger[_0xec8f('0x2c')](_0x1e11f0[_0xec8f('0x2d')]);if(_0x1e11f0['name']){delete _0x1e11f0[_0xec8f('0x2e')];}_0x51f8a9[_0xec8f('0x20')](_0x3ed5e0)['send'](_0x1e11f0);};}exports[_0xec8f('0x2f')]=function(_0x389f2b,_0x219d4c,_0x5cc1f3){if(!_0x389f2b[_0xec8f('0x30')]['hasOwnProperty'](_0xec8f('0x31'))&&!_0x389f2b[_0xec8f('0x30')]['hasOwnProperty']('TemplateId')){throw new db[(_0xec8f('0x32'))]['ValidationError'](_0xec8f('0x33'));}else{if(_0x389f2b[_0xec8f('0x30')][_0xec8f('0x34')]('TemplateId')&&!_0x389f2b[_0xec8f('0x30')][_0xec8f('0x34')](_0xec8f('0x35'))){throw new db[(_0xec8f('0x32'))][(_0xec8f('0x36'))](_0xec8f('0x37'));}if(!_0x389f2b[_0xec8f('0x30')][_0xec8f('0x34')](_0xec8f('0x38'))){throw new db['Sequelize'][(_0xec8f('0x36'))](_0xec8f('0x39'));}else{try{var _0x353422=JSON['parse'](_0x389f2b['body']['recipients']);}catch(_0x1fa8bf){logger[_0xec8f('0x2c')](_0x1fa8bf);throw new db['Sequelize'][(_0xec8f('0x36'))](_0xec8f('0x3a'));}var _0x837e8c=['chatqueue','faxqueue',_0xec8f('0x3b'),'openchannelqueue',_0xec8f('0x3c'),_0xec8f('0x3d'),_0xec8f('0x3e'),_0xec8f('0x3f'),'user'];if(_[_0xec8f('0x40')](_0x353422,function(_0x2972f8){return!_[_0xec8f('0x41')](_0x837e8c,_0x2972f8[_0xec8f('0x42')][_0xec8f('0x43')]());})){throw new db[(_0xec8f('0x32'))][(_0xec8f('0x36'))](_0xec8f('0x44'));}}}var _0x6e0e3={};_0x6e0e3[_0xec8f('0x45')]=_0x389f2b['body'][_0xec8f('0x34')](_0xec8f('0x45'))?_0x389f2b[_0xec8f('0x30')][_0xec8f('0x45')]:_0x389f2b['user'][_0xec8f('0x46')];_0x6e0e3[_0xec8f('0x47')]=_[_0xec8f('0x48')](_0x389f2b[_0xec8f('0x30')]['recipientsDescription'])?null:_0x389f2b[_0xec8f('0x30')][_0xec8f('0x47')];_0x6e0e3['beep']=_0x389f2b[_0xec8f('0x30')]['beep']||![];_0x6e0e3[_0xec8f('0x49')]=_0x389f2b['user']['id'];return getContent(_0x389f2b[_0xec8f('0x30')])[_0xec8f('0x2a')](function(_0x50d285){_0x6e0e3[_0xec8f('0x30')]=_0x50d285;return getRecipients(_0x353422);})[_0xec8f('0x2a')](function(_0x5c5d5a){_0x6e0e3[_0xec8f('0x4a')]=_[_0xec8f('0x4b')](_0x5c5d5a)['join'](',');return db[_0xec8f('0x4c')]['transaction'](function(_0x322663){return db[_0xec8f('0x4d')][_0xec8f('0x4e')](_0x6e0e3,{'raw':!![],'transaction':_0x322663})[_0xec8f('0x2a')](function(_0x17c470){var _0x262cda={'sender':_0x6e0e3[_0xec8f('0x45')],'description':_0x6e0e3[_0xec8f('0x47')],'content':_0x6e0e3['body'],'beep':_0x6e0e3[_0xec8f('0x4f')]};_0x5c5d5a[_0xec8f('0x50')](function(_0x2dd4a4){_0x262cda[_0xec8f('0x51')]=_0x2dd4a4;socket[_0xec8f('0x52')](_0xec8f('0x53'),_0x262cda);});return _0x17c470;});});})[_0xec8f('0x2a')](respondWithResult(_0x219d4c,0xc9))['catch'](handleError(_0x219d4c,null));};function getContent(_0x138014){return new BPromise(function(_0x1dda53,_0x107316){if(_0x138014[_0xec8f('0x31')]){_0x1dda53(_0x138014[_0xec8f('0x31')]);return;}return db[_0xec8f('0x54')][_0xec8f('0x55')]({'attributes':[_0xec8f('0x56')],'where':{'id':_0x138014[_0xec8f('0x57')]},'raw':!![]})[_0xec8f('0x2a')](function(_0x30e98d){if(!_0x30e98d)throw new db[(_0xec8f('0x32'))][(_0xec8f('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x15302a=Mustache[_0xec8f('0x58')](_0x30e98d['html'],_0x138014[_0xec8f('0x35')]);_0x1dda53(_0x15302a);})[_0xec8f('0x59')](function(_0x30744a){_0x107316(_0x30744a);});});}function getRecipients(_0x1d215b){return new BPromise(function(_0x1f7506,_0x1e179e){var _0x2bab52=[];var _0x30aced=[];_0x1d215b[_0xec8f('0x50')](function(_0xf0520c){var _0x5c8142=_[_0xec8f('0x5a')](_0xf0520c[_0xec8f('0x42')]['toLowerCase']());if(_0x5c8142==='User'){_0x2bab52=_[_0xec8f('0x5b')](_0x2bab52,_0xf0520c['ids']);}else{if(_[_0xec8f('0x41')](_0x5c8142,_0xec8f('0x5c')))_0x5c8142=_0x5c8142[_0xec8f('0x5d')]('queue',_0xec8f('0x5e'));_0xf0520c[_0xec8f('0x5f')]['forEach'](function(_0x34ffff){_0x30aced['push'](getAgents(_0x5c8142,_0x34ffff));});}});return BPromise[_0xec8f('0x60')](_0x30aced)[_0xec8f('0x2a')](function(_0x56552b){_0x2bab52=_[_0xec8f('0x5b')](_0x2bab52,_[_0xec8f('0x61')](_0x56552b));_0x1f7506(_0x2bab52);})['catch'](function(_0x21b86f){_0x1e179e(_0x21b86f);});});}function getAgents(_0x287e5a,_0x55c1c6){return new BPromise(function(_0x272aa8,_0xc91e0d){return db[_0x287e5a][_0xec8f('0x55')]({'where':{'id':_0x55c1c6}})[_0xec8f('0x2a')](function(_0x42177a){return _0x42177a[_0xec8f('0x62')]({'attributes':['id'],'raw':!![]})[_0xec8f('0x2a')](function(_0x5619d2){var _0x344772=_[_0xec8f('0x63')](_0x5619d2,'id');_0x272aa8(_0x344772);});})[_0xec8f('0x59')](function(_0x99eeb6){_0xc91e0d(_0x99eeb6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 285cb2b..c9eb17f 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 _0xc6b0=['setMaxListeners','save','remove','emit','exports','UserNotification'];(function(_0x371c6f,_0x65302a){var _0x37ea38=function(_0x334287){while(--_0x334287){_0x371c6f['push'](_0x371c6f['shift']());}};_0x37ea38(++_0x65302a);}(_0xc6b0,0xdd));var _0x0c6b=function(_0x5555f8,_0x2bd7ec){_0x5555f8=_0x5555f8-0x0;var _0x39a854=_0xc6b0[_0x5555f8];return _0x39a854;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x0c6b('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0c6b('0x1')](0x0);var events={'afterCreate':_0x0c6b('0x2'),'afterUpdate':'update','afterDestroy':_0x0c6b('0x3')};function emitEvent(_0x5c7df2){return function(_0x2c34d4,_0x5af55b,_0x2011d6){UserNotificationEvents['emit'](_0x5c7df2+':'+_0x2c34d4['id'],_0x2c34d4);UserNotificationEvents[_0x0c6b('0x4')](_0x5c7df2,_0x2c34d4);_0x2011d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x0c6b('0x5')]=UserNotificationEvents; \ No newline at end of file +var _0x9e77=['hasOwnProperty','hook','exports','events','UserNotification','update','remove','emit'];(function(_0xe5530b,_0x4477ea){var _0x549c66=function(_0x495293){while(--_0x495293){_0xe5530b['push'](_0xe5530b['shift']());}};_0x549c66(++_0x4477ea);}(_0x9e77,0x153));var _0x79e7=function(_0x481350,_0x2000d0){_0x481350=_0x481350-0x0;var _0x18fa9d=_0x9e77[_0x481350];return _0x18fa9d;};'use strict';var EventEmitter=require(_0x79e7('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x79e7('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x79e7('0x2'),'afterDestroy':_0x79e7('0x3')};function emitEvent(_0x20b0bf){return function(_0x1447ad,_0x1df825,_0x2a1e41){UserNotificationEvents[_0x79e7('0x4')](_0x20b0bf+':'+_0x1447ad['id'],_0x1447ad);UserNotificationEvents[_0x79e7('0x4')](_0x20b0bf,_0x1447ad);_0x2a1e41(null);};}for(var e in events){if(events[_0x79e7('0x5')](e)){var event=events[e];UserNotification[_0x79e7('0x6')](e,emitEvent(event));}}module[_0x79e7('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 32ddca6..fdd2294 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 _0xb630=['bluebird','path','rimraf','exports','define','UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x12a987,_0x41df8d){var _0x4ab418=function(_0x373566){while(--_0x373566){_0x12a987['push'](_0x12a987['shift']());}};_0x4ab418(++_0x41df8d);}(_0xb630,0xb1));var _0x0b63=function(_0x4a352c,_0x1844ac){_0x4a352c=_0x4a352c-0x0;var _0x488000=_0xb630[_0x4a352c];return _0x488000;};'use strict';var _=require(_0x0b63('0x0'));var util=require(_0x0b63('0x1'));var logger=require(_0x0b63('0x2'))(_0x0b63('0x3'));var moment=require(_0x0b63('0x4'));var BPromise=require(_0x0b63('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b63('0x6'));var rimraf=require(_0x0b63('0x7'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x0b63('0x8')]=function(_0x2d167f,_0x254674){return _0x2d167f[_0x0b63('0x9')](_0x0b63('0xa'),attributes,{'tableName':_0x0b63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b63('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0efe=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efe,0x110));var _0xe0ef=function(_0x1496ba,_0x3d0804){_0x1496ba=_0x1496ba-0x0;var _0xc8747=_0x0efe[_0x1496ba];return _0xc8747;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var logger=require('../../config/logger')(_0xe0ef('0x2'));var moment=require(_0xe0ef('0x3'));var BPromise=require(_0xe0ef('0x4'));var rp=require(_0xe0ef('0x5'));var fs=require('fs');var path=require(_0xe0ef('0x6'));var rimraf=require(_0xe0ef('0x7'));var config=require(_0xe0ef('0x8'));var attributes=require(_0xe0ef('0x9'));module[_0xe0ef('0xa')]=function(_0x35a50e,_0x5e9176){return _0x35a50e['define'](_0xe0ef('0xb'),attributes,{'tableName':_0xe0ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe0ef('0xd'),'collate':_0xe0ef('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6ec1c96..55af265 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 _0xa3e4=['catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3700fd,_0x5bd346){var _0x4ffb6c=function(_0x42a3de){while(--_0x42a3de){_0x3700fd['push'](_0x3700fd['shift']());}};_0x4ffb6c(++_0x5bd346);}(_0xa3e4,0x121));var _0x4a3e=function(_0x3ba3c0,_0x129464){_0x3ba3c0=_0x3ba3c0-0x0;var _0x574ae9=_0xa3e4[_0x3ba3c0];return _0x574ae9;};'use strict';var _=require(_0x4a3e('0x0'));var util=require('util');var moment=require(_0x4a3e('0x1'));var BPromise=require(_0x4a3e('0x2'));var rs=require(_0x4a3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a3e('0x4'));var logger=require(_0x4a3e('0x5'))(_0x4a3e('0x6'));var config=require('../../config/environment');var jayson=require(_0x4a3e('0x7'));var client=jayson[_0x4a3e('0x8')][_0x4a3e('0x9')]({'port':0x232a});config[_0x4a3e('0xa')]=_[_0x4a3e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4a3e('0xc'))(new Redis(config[_0x4a3e('0xa')]));require(_0x4a3e('0xd'))[_0x4a3e('0xe')](socket);function respondWithRpcPromise(_0x242007,_0xefba76,_0x45b4ff){return new BPromise(function(_0x37037b,_0x2861d0){return client['request'](_0x242007,_0x45b4ff)[_0x4a3e('0xf')](function(_0x2af040){logger[_0x4a3e('0x10')](_0x4a3e('0x11'),_0xefba76,'request\x20sent');logger[_0x4a3e('0x12')](_0x4a3e('0x13'),_0xefba76,_0x4a3e('0x14'),JSON['stringify'](_0x2af040));if(_0x2af040[_0x4a3e('0x15')]){if(_0x2af040[_0x4a3e('0x15')]['code']===0x1f4){logger[_0x4a3e('0x15')](_0x4a3e('0x11'),_0xefba76,_0x2af040[_0x4a3e('0x15')]['message']);return _0x2861d0(_0x2af040['error'][_0x4a3e('0x16')]);}logger[_0x4a3e('0x15')]('UserNotification,\x20%s,\x20%s',_0xefba76,_0x2af040[_0x4a3e('0x15')]['message']);return _0x37037b(_0x2af040['error']['message']);}else{logger[_0x4a3e('0x10')](_0x4a3e('0x11'),_0xefba76,'request\x20sent');_0x37037b(_0x2af040['result'][_0x4a3e('0x16')]);}})[_0x4a3e('0x17')](function(_0x27a8bd){logger[_0x4a3e('0x15')](_0x4a3e('0x11'),_0xefba76,_0x27a8bd);_0x2861d0(_0x27a8bd);});});} \ No newline at end of file +var _0xa5d0=['http','redis','localhost','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x87cb2b,_0x33c1a6){var _0x152d0d=function(_0x26357e){while(--_0x26357e){_0x87cb2b['push'](_0x87cb2b['shift']());}};_0x152d0d(++_0x33c1a6);}(_0xa5d0,0xb7));var _0x0a5d=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa5d0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a5d('0x0'));var util=require('util');var moment=require(_0x0a5d('0x1'));var BPromise=require(_0x0a5d('0x2'));var rs=require(_0x0a5d('0x3'));var fs=require('fs');var Redis=require(_0x0a5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a5d('0x5'));var logger=require(_0x0a5d('0x6'))('rpc');var config=require(_0x0a5d('0x7'));var jayson=require(_0x0a5d('0x8'));var client=jayson['client'][_0x0a5d('0x9')]({'port':0x232a});config[_0x0a5d('0xa')]=_['defaults'](config[_0x0a5d('0xa')],{'host':_0x0a5d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a5d('0xa')]));require(_0x0a5d('0xc'))[_0x0a5d('0xd')](socket);function respondWithRpcPromise(_0x4f79b2,_0xe0cfc9,_0x3839cf){return new BPromise(function(_0x443cd4,_0x22b273){return client['request'](_0x4f79b2,_0x3839cf)[_0x0a5d('0xe')](function(_0x312d69){logger[_0x0a5d('0xf')](_0x0a5d('0x10'),_0xe0cfc9,_0x0a5d('0x11'));logger[_0x0a5d('0x12')](_0x0a5d('0x13'),_0xe0cfc9,_0x0a5d('0x11'),JSON[_0x0a5d('0x14')](_0x312d69));if(_0x312d69[_0x0a5d('0x15')]){if(_0x312d69[_0x0a5d('0x15')]['code']===0x1f4){logger[_0x0a5d('0x15')]('UserNotification,\x20%s,\x20%s',_0xe0cfc9,_0x312d69[_0x0a5d('0x15')][_0x0a5d('0x16')]);return _0x22b273(_0x312d69[_0x0a5d('0x15')][_0x0a5d('0x16')]);}logger[_0x0a5d('0x15')]('UserNotification,\x20%s,\x20%s',_0xe0cfc9,_0x312d69['error'][_0x0a5d('0x16')]);return _0x443cd4(_0x312d69['error'][_0x0a5d('0x16')]);}else{logger['info'](_0x0a5d('0x10'),_0xe0cfc9,_0x0a5d('0x11'));_0x443cd4(_0x312d69['result']['message']);}})[_0x0a5d('0x17')](function(_0x30c828){logger[_0x0a5d('0x15')]('UserNotification,\x20%s,\x20%s',_0xe0cfc9,_0x30c828);_0x22b273(_0x30c828);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4e2eb5b..4a60fd1 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 _0x57f0=['length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x3218f7,_0x8af5e2){var _0x3fdf19=function(_0x18a522){while(--_0x18a522){_0x3218f7['push'](_0x3218f7['shift']());}};_0x3fdf19(++_0x8af5e2);}(_0x57f0,0x77));var _0x057f=function(_0x2cdc34,_0x15e0c1){_0x2cdc34=_0x2cdc34-0x0;var _0x2be714=_0x57f0[_0x2cdc34];return _0x2be714;};'use strict';var UserNotificationEvents=require(_0x057f('0x0'));var events=[_0x057f('0x1'),_0x057f('0x2'),_0x057f('0x3')];function createListener(_0x442b42,_0x4b541c){return function(_0x17dd5b){_0x4b541c[_0x057f('0x4')](_0x442b42,_0x17dd5b);};}function removeListener(_0x5285ee,_0x1f8db2){return function(){UserNotificationEvents[_0x057f('0x5')](_0x5285ee,_0x1f8db2);};}exports[_0x057f('0x6')]=function(_0x1c2cac){for(var _0x39baac=0x0,_0x2b2f7e=events[_0x057f('0x7')];_0x39baac<_0x2b2f7e;_0x39baac++){var _0x26bea5=events[_0x39baac];var _0x383563=createListener(_0x057f('0x8')+_0x26bea5,_0x1c2cac);UserNotificationEvents['on'](_0x26bea5,_0x383563);}}; \ No newline at end of file +var _0x7f91=['userNotification:','save','remove','emit','removeListener','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7f91,0x1dd));var _0x17f9=function(_0x21eacf,_0x1d1f5b){_0x21eacf=_0x21eacf-0x0;var _0xbae3e=_0x7f91[_0x21eacf];return _0xbae3e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x17f9('0x0'),_0x17f9('0x1'),'update'];function createListener(_0x41c45d,_0x121eee){return function(_0x32e3b0){_0x121eee[_0x17f9('0x2')](_0x41c45d,_0x32e3b0);};}function removeListener(_0x86e21a,_0x45d4dd){return function(){UserNotificationEvents[_0x17f9('0x3')](_0x86e21a,_0x45d4dd);};}exports[_0x17f9('0x4')]=function(_0xc7003b){for(var _0x4eb045=0x0,_0x324f16=events[_0x17f9('0x5')];_0x4eb045<_0x324f16;_0x4eb045++){var _0x42650a=events[_0x4eb045];var _0x381c84=createListener(_0x17f9('0x6')+_0x42650a,_0xc7003b);UserNotificationEvents['on'](_0x42650a,_0x381c84);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0487e17..c9de73e 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4851ff,_0x1c9a8d){var _0x26773b=function(_0x26c33e){while(--_0x26c33e){_0x4851ff['push'](_0x4851ff['shift']());}};_0x26773b(++_0x1c9a8d);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c8309,_0x78c3df){var _0x1eee11=function(_0x89014c){while(--_0x89014c){_0x1c8309['push'](_0x1c8309['shift']());}};_0x1eee11(++_0x78c3df);}(_0x70e0,0x17b));var _0x070e=function(_0x2e0e57,_0x16dac4){_0x2e0e57=_0x2e0e57-0x0;var _0x52453f=_0x70e0[_0x2e0e57];return _0x52453f;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 8f3ee40..4c42884 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 _0x5b20=['exports','INTEGER','sequelize'];(function(_0x2203d0,_0x50c5a3){var _0x42244d=function(_0x29c079){while(--_0x29c079){_0x2203d0['push'](_0x2203d0['shift']());}};_0x42244d(++_0x50c5a3);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x05b2('0x0'));module[_0x05b2('0x1')]={'penalty':{'type':Sequelize[_0x05b2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa45a=['sequelize','exports','INTEGER'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa45a,0x192));var _0xaa45=function(_0x363bde,_0x1a1d1a){_0x363bde=_0x363bde-0x0;var _0x26b13f=_0xa45a[_0x363bde];return _0x26b13f;};'use strict';var Sequelize=require(_0xaa45('0x0'));module[_0xaa45('0x1')]={'penalty':{'type':Sequelize[_0xaa45('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 5238d60..d42530a 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 _0x46dd=['user_has_openchannel_queues','../../config/logger','moment','path','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x4d7de9,_0x51aaed){var _0x420d49=function(_0x3168de){while(--_0x3168de){_0x4d7de9['push'](_0x4d7de9['shift']());}};_0x420d49(++_0x51aaed);}(_0x46dd,0x91));var _0xd46d=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x46dd[_0x13ff53];return _0x290228;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd46d('0x0'))('api');var moment=require(_0xd46d('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46d('0x2'));var rimraf=require('rimraf');var config=require(_0xd46d('0x3'));var attributes=require(_0xd46d('0x4'));module[_0xd46d('0x5')]=function(_0x271526,_0x140638){return _0x271526['define'](_0xd46d('0x6'),attributes,{'tableName':_0xd46d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee84=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x3c84c3,_0x1114a6){var _0x49c54e=function(_0x1fed9a){while(--_0x1fed9a){_0x3c84c3['push'](_0x3c84c3['shift']());}};_0x49c54e(++_0x1114a6);}(_0xee84,0xd5));var _0x4ee8=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xee84[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x4ee8('0x0'));var util=require(_0x4ee8('0x1'));var logger=require(_0x4ee8('0x2'))(_0x4ee8('0x3'));var moment=require(_0x4ee8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ee8('0x5'));var fs=require('fs');var path=require(_0x4ee8('0x6'));var rimraf=require(_0x4ee8('0x7'));var config=require(_0x4ee8('0x8'));var attributes=require(_0x4ee8('0x9'));module[_0x4ee8('0xa')]=function(_0x547fc6,_0x555d21){return _0x547fc6[_0x4ee8('0xb')](_0x4ee8('0xc'),attributes,{'tableName':_0x4ee8('0xd'),'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 bf5f29c..a47e423 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 _0x413a=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x48de25,_0x488051){var _0xdaeb9d=function(_0x44a364){while(--_0x44a364){_0x48de25['push'](_0x48de25['shift']());}};_0xdaeb9d(++_0x488051);}(_0x413a,0x11a));var _0xa413=function(_0x288ec7,_0x5511b2){_0x288ec7=_0x288ec7-0x0;var _0x39d0db=_0x413a[_0x288ec7];return _0x39d0db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa413('0x0'));var BPromise=require(_0xa413('0x1'));var rs=require(_0xa413('0x2'));var fs=require('fs');var Redis=require(_0xa413('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa413('0x4'));var logger=require(_0xa413('0x5'))(_0xa413('0x6'));var config=require('../../config/environment');var jayson=require(_0xa413('0x7'));var client=jayson[_0xa413('0x8')][_0xa413('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d0464,_0x1c7f0d,_0x53657c){return new BPromise(function(_0x25f8c6,_0x52b8c4){return client['request'](_0x8d0464,_0x53657c)[_0xa413('0xa')](function(_0x10ac0f){logger[_0xa413('0xb')](_0xa413('0xc'),_0x1c7f0d,_0xa413('0xd'));logger['debug'](_0xa413('0xe'),_0x1c7f0d,_0xa413('0xd'),JSON[_0xa413('0xf')](_0x10ac0f));if(_0x10ac0f[_0xa413('0x10')]){if(_0x10ac0f[_0xa413('0x10')][_0xa413('0x11')]===0x1f4){logger[_0xa413('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1c7f0d,_0x10ac0f[_0xa413('0x10')]['message']);return _0x52b8c4(_0x10ac0f[_0xa413('0x10')][_0xa413('0x12')]);}logger[_0xa413('0x10')](_0xa413('0xc'),_0x1c7f0d,_0x10ac0f['error']['message']);return _0x25f8c6(_0x10ac0f[_0xa413('0x10')]['message']);}else{logger[_0xa413('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1c7f0d,'request\x20sent');_0x25f8c6(_0x10ac0f[_0xa413('0x13')][_0xa413('0x12')]);}})[_0xa413('0x14')](function(_0x2b3888){logger[_0xa413('0x10')](_0xa413('0xc'),_0x1c7f0d,_0x2b3888);_0x52b8c4(_0x2b3888);});});} \ No newline at end of file +var _0x401b=['client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x313a42,_0x21fcea){var _0x54177b=function(_0x146a0d){while(--_0x146a0d){_0x313a42['push'](_0x313a42['shift']());}};_0x54177b(++_0x21fcea);}(_0x401b,0xf2));var _0xb401=function(_0x2c7a00,_0x2d6305){_0x2c7a00=_0x2c7a00-0x0;var _0x2a2017=_0x401b[_0x2c7a00];return _0x2a2017;};'use strict';var _=require(_0xb401('0x0'));var util=require(_0xb401('0x1'));var moment=require(_0xb401('0x2'));var BPromise=require('bluebird');var rs=require(_0xb401('0x3'));var fs=require('fs');var Redis=require(_0xb401('0x4'));var db=require(_0xb401('0x5'))['db'];var utils=require(_0xb401('0x6'));var logger=require(_0xb401('0x7'))(_0xb401('0x8'));var config=require(_0xb401('0x9'));var jayson=require(_0xb401('0xa'));var client=jayson[_0xb401('0xb')][_0xb401('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52ae4c,_0xe131e9,_0x2ba7a5){return new BPromise(function(_0x20ed3a,_0xb8be09){return client['request'](_0x52ae4c,_0x2ba7a5)[_0xb401('0xd')](function(_0x1ce9c9){logger[_0xb401('0xe')](_0xb401('0xf'),_0xe131e9,'request\x20sent');logger['debug'](_0xb401('0x10'),_0xe131e9,_0xb401('0x11'),JSON['stringify'](_0x1ce9c9));if(_0x1ce9c9[_0xb401('0x12')]){if(_0x1ce9c9['error'][_0xb401('0x13')]===0x1f4){logger[_0xb401('0x12')](_0xb401('0xf'),_0xe131e9,_0x1ce9c9['error'][_0xb401('0x14')]);return _0xb8be09(_0x1ce9c9[_0xb401('0x12')][_0xb401('0x14')]);}logger[_0xb401('0x12')](_0xb401('0xf'),_0xe131e9,_0x1ce9c9['error'][_0xb401('0x14')]);return _0x20ed3a(_0x1ce9c9[_0xb401('0x12')]['message']);}else{logger[_0xb401('0xe')](_0xb401('0xf'),_0xe131e9,_0xb401('0x11'));_0x20ed3a(_0x1ce9c9[_0xb401('0x15')][_0xb401('0x14')]);}})[_0xb401('0x16')](function(_0x59fc7d){logger[_0xb401('0x12')](_0xb401('0xf'),_0xe131e9,_0x59fc7d);_0xb8be09(_0x59fc7d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 074ac39..ba584d8 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 _0x3fb5=['/:id/clone','addSections','addResources','put','update','delete','destroy','/:id/sections','removeSections','/:id/resources','removeResources','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getSections','getResources','post'];(function(_0x479eba,_0x528986){var _0x34487b=function(_0xae9198){while(--_0xae9198){_0x479eba['push'](_0x479eba['shift']());}};_0x34487b(++_0x528986);}(_0x3fb5,0x73));var _0x53fb=function(_0x5bea0d,_0x21f680){_0x5bea0d=_0x5bea0d-0x0;var _0xa7734c=_0x3fb5[_0x5bea0d];return _0xa7734c;};'use strict';var multer=require(_0x53fb('0x0'));var util=require(_0x53fb('0x1'));var path=require(_0x53fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x53fb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x53fb('0x4'));var interaction=require(_0x53fb('0x5'));var config=require(_0x53fb('0x6'));var controller=require('./userProfile.controller');router[_0x53fb('0x7')]('/',auth['isAuthenticated'](),controller[_0x53fb('0x8')]);router[_0x53fb('0x7')]('/describe',auth[_0x53fb('0x9')](),controller[_0x53fb('0xa')]);router[_0x53fb('0x7')](_0x53fb('0xb'),auth[_0x53fb('0x9')](),controller['show']);router[_0x53fb('0x7')]('/:id/sections',auth['isAuthenticated'](),controller[_0x53fb('0xc')]);router[_0x53fb('0x7')]('/:id/resources',auth['isAuthenticated'](),controller[_0x53fb('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x53fb('0xe')](_0x53fb('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x53fb('0xe')]('/:id/sections',auth['isAuthenticated'](),controller[_0x53fb('0x10')]);router['post']('/:id/resources',auth[_0x53fb('0x9')](),controller[_0x53fb('0x11')]);router[_0x53fb('0x12')]('/:id',auth[_0x53fb('0x9')](),controller[_0x53fb('0x13')]);router[_0x53fb('0x14')]('/:id',auth[_0x53fb('0x9')](),controller[_0x53fb('0x15')]);router[_0x53fb('0x14')](_0x53fb('0x16'),auth[_0x53fb('0x9')](),controller[_0x53fb('0x17')]);router[_0x53fb('0x14')](_0x53fb('0x18'),auth[_0x53fb('0x9')](),controller[_0x53fb('0x19')]);module['exports']=router; \ No newline at end of file +var _0x9069=['get','isAuthenticated','index','describe','/:id','show','/:id/sections','/:id/resources','post','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x56d219,_0x1aca63){var _0x5158c7=function(_0x240f12){while(--_0x240f12){_0x56d219['push'](_0x56d219['shift']());}};_0x5158c7(++_0x1aca63);}(_0x9069,0x103));var _0x9906=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0x9069[_0x5e8fc];return _0x41c58c;};'use strict';var multer=require(_0x9906('0x0'));var util=require(_0x9906('0x1'));var path=require(_0x9906('0x2'));var timeout=require(_0x9906('0x3'));var express=require(_0x9906('0x4'));var router=express[_0x9906('0x5')]();var fs_extra=require(_0x9906('0x6'));var auth=require(_0x9906('0x7'));var interaction=require(_0x9906('0x8'));var config=require(_0x9906('0x9'));var controller=require(_0x9906('0xa'));router[_0x9906('0xb')]('/',auth[_0x9906('0xc')](),controller[_0x9906('0xd')]);router[_0x9906('0xb')]('/describe',auth[_0x9906('0xc')](),controller[_0x9906('0xe')]);router[_0x9906('0xb')](_0x9906('0xf'),auth[_0x9906('0xc')](),controller[_0x9906('0x10')]);router[_0x9906('0xb')](_0x9906('0x11'),auth[_0x9906('0xc')](),controller['getSections']);router[_0x9906('0xb')](_0x9906('0x12'),auth[_0x9906('0xc')](),controller['getResources']);router['post']('/',auth[_0x9906('0xc')](),controller['create']);router[_0x9906('0x13')](_0x9906('0x14'),auth['isAuthenticated'](),controller[_0x9906('0x15')]);router['post'](_0x9906('0x11'),auth['isAuthenticated'](),controller[_0x9906('0x16')]);router['post'](_0x9906('0x12'),auth[_0x9906('0xc')](),controller[_0x9906('0x17')]);router['put'](_0x9906('0xf'),auth[_0x9906('0xc')](),controller[_0x9906('0x18')]);router[_0x9906('0x19')]('/:id',auth[_0x9906('0xc')](),controller[_0x9906('0x1a')]);router[_0x9906('0x19')](_0x9906('0x11'),auth[_0x9906('0xc')](),controller[_0x9906('0x1b')]);router[_0x9906('0x19')](_0x9906('0x12'),auth[_0x9906('0xc')](),controller[_0x9906('0x1c')]);module[_0x9906('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 85fccc9..d20e68d 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 _0x9872=['BOOLEAN','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x9872,0xb7));var _0x2987=function(_0x4d31a5,_0x3592c0){_0x4d31a5=_0x4d31a5-0x0;var _0x2d2011=_0x9872[_0x4d31a5];return _0x2d2011;};'use strict';var Sequelize=require('sequelize');module[_0x2987('0x0')]={'name':{'type':Sequelize[_0x2987('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2987('0x1')],'set':function(_0x5d9599){this[_0x2987('0x2')](_0x2987('0x3'),_0x5d9599?_0x5d9599[_0x2987('0x4')](''):[]);},'get':function(){return this[_0x2987('0x5')]('crudPermissions')?this[_0x2987('0x5')](_0x2987('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2987('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2987('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2987('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x296e=['STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','exports'];(function(_0x5c0017,_0x35bce6){var _0x5d2ce7=function(_0x31339f){while(--_0x31339f){_0x5c0017['push'](_0x5c0017['shift']());}};_0x5d2ce7(++_0x35bce6);}(_0x296e,0x74));var _0xe296=function(_0x1d7cdd,_0x4f1575){_0x1d7cdd=_0x1d7cdd-0x0;var _0x23e7a0=_0x296e[_0x1d7cdd];return _0x23e7a0;};'use strict';var Sequelize=require('sequelize');module[_0xe296('0x0')]={'name':{'type':Sequelize[_0xe296('0x1')],'allowNull':![],'unique':_0xe296('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3f2d89){this[_0xe296('0x3')](_0xe296('0x4'),_0x3f2d89?_0x3f2d89[_0xe296('0x5')](''):[]);},'get':function(){return this[_0xe296('0x6')]('crudPermissions')?this[_0xe296('0x6')](_0xe296('0x4'))[_0xe296('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe296('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe296('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe296('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe296('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe296('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe296('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe296('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 f11fc70..3b80fcd 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 _0x9264=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','then','include','findAll','rows','catch','show','includeAll','find','create','clone','params','options','get','omit','createdAt','body','updatedAt','sequelize','each','autoAssociation','sectionId','Resources','UserProfileSection','UserProfileResource','destroy','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','error','name','send','index','map','UserProfile'];(function(_0x2822b3,_0x49842b){var _0x4b9178=function(_0x265ccd){while(--_0x265ccd){_0x2822b3['push'](_0x2822b3['shift']());}};_0x4b9178(++_0x49842b);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];config['redis']=_[_0x4926('0x14')](config[_0x4926('0x15')],{'host':_0x4926('0x16'),'port':0x18eb});var socket=require(_0x4926('0x17'))(new Redis(config[_0x4926('0x15')]));require(_0x4926('0x18'))[_0x4926('0x19')](socket);function respondWithStatusCode(_0x1a280b,_0x21503d){_0x21503d=_0x21503d||0xcc;return function(_0x7782aa){if(_0x7782aa){return _0x1a280b[_0x4926('0x1a')](_0x21503d);}return _0x1a280b[_0x4926('0x1b')](_0x21503d)[_0x4926('0x1c')]();};}function respondWithResult(_0x1ac74f,_0x55b957){_0x55b957=_0x55b957||0xc8;return function(_0x1703ed){if(_0x1703ed){return _0x1ac74f[_0x4926('0x1b')](_0x55b957)[_0x4926('0x1d')](_0x1703ed);}};}function respondWithFilteredResult(_0x5736dd,_0x4d2cd3){return function(_0x1dd78e){if(_0x1dd78e){var _0x5630a8=typeof _0x4d2cd3[_0x4926('0x1e')]===_0x4926('0x1f')&&typeof _0x4d2cd3['limit']===_0x4926('0x1f');var _0x49461e=_0x1dd78e[_0x4926('0x20')];var _0x3d3fbc=_0x5630a8?0x0:_0x4d2cd3[_0x4926('0x1e')];var _0x2d6239=_0x5630a8?_0x1dd78e['count']:_0x4d2cd3['offset']+_0x4d2cd3[_0x4926('0x21')];var _0x588c7a;if(_0x2d6239>=_0x49461e){_0x2d6239=_0x49461e;_0x588c7a=0xc8;}else{_0x588c7a=0xce;}_0x5736dd['status'](_0x588c7a);return _0x5736dd[_0x4926('0x22')](_0x4926('0x23'),_0x3d3fbc+'-'+_0x2d6239+'/'+_0x49461e)['json'](_0x1dd78e);}return null;};}function patchUpdates(_0xfd1095){return function(_0x4792ac){try{jsonpatch[_0x4926('0x24')](_0x4792ac,_0xfd1095,!![]);}catch(_0x55e459){return BPromise[_0x4926('0x25')](_0x55e459);}return _0x4792ac[_0x4926('0x26')]();};}function saveUpdates(_0x2df18c,_0x44eb88){return function(_0x585b91){if(_0x585b91){return _0x585b91['update'](_0x2df18c)['then'](function(_0x1c02e7){return _0x1c02e7;});}return null;};}function removeEntity(_0xbfbe1b,_0x43c077){return function(_0x2519a2){if(_0x2519a2){return _0x2519a2['destroy']()['then'](function(){_0xbfbe1b['status'](0xcc)[_0x4926('0x1c')]();});}};}function handleEntityNotFound(_0x273f4b,_0x18f56d){return function(_0x4adb87){if(!_0x4adb87){_0x273f4b['sendStatus'](0x194);}return _0x4adb87;};}function handleError(_0x50004f,_0x37701c){_0x37701c=_0x37701c||0x1f4;return function(_0x3f06a3){logger[_0x4926('0x27')](_0x3f06a3['stack']);if(_0x3f06a3[_0x4926('0x28')]){delete _0x3f06a3[_0x4926('0x28')];}_0x50004f[_0x4926('0x1b')](_0x37701c)[_0x4926('0x29')](_0x3f06a3);};}exports[_0x4926('0x2a')]=function(_0x14cc3a,_0x5a44a9){var _0x39ad37={},_0x717a1a={},_0x32a6c2={'count':0x0,'rows':[]};var _0x14d8b8=_[_0x4926('0x2b')](db[_0x4926('0x2c')][_0x4926('0x2d')],function(_0x50ea49){return{'name':_0x50ea49[_0x4926('0x2e')],'type':_0x50ea49[_0x4926('0x2f')]['key']};});_0x717a1a[_0x4926('0x30')]=_[_0x4926('0x2b')](_0x14d8b8,_0x4926('0x28'));_0x717a1a[_0x4926('0x31')]=_[_0x4926('0x32')](_0x14cc3a[_0x4926('0x31')]);_0x717a1a[_0x4926('0x33')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],_0x717a1a[_0x4926('0x31')]);_0x39ad37[_0x4926('0x35')]=_[_0x4926('0x34')](_0x717a1a[_0x4926('0x30')],qs[_0x4926('0x36')](_0x14cc3a['query'][_0x4926('0x36')]));_0x39ad37[_0x4926('0x35')]=_0x39ad37[_0x4926('0x35')][_0x4926('0x37')]?_0x39ad37['attributes']:_0x717a1a[_0x4926('0x30')];if(!_0x14cc3a[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x39ad37[_0x4926('0x21')]=qs['limit'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x21')]);_0x39ad37[_0x4926('0x1e')]=qs['offset'](_0x14cc3a[_0x4926('0x31')][_0x4926('0x1e')]);}_0x39ad37[_0x4926('0x3a')]=qs[_0x4926('0x3b')](_0x14cc3a[_0x4926('0x31')][_0x4926('0x3b')]);_0x39ad37['where']=qs[_0x4926('0x33')](_[_0x4926('0x3c')](_0x14cc3a[_0x4926('0x31')],_0x717a1a[_0x4926('0x33')]),_0x14d8b8);if(_0x14cc3a[_0x4926('0x31')]['filter']){_0x39ad37[_0x4926('0x3d')]=_[_0x4926('0x3e')](_0x39ad37[_0x4926('0x3d')],{'$or':_[_0x4926('0x2b')](_0x14d8b8,function(_0x4ea503){if(_0x4ea503['type']!=='VIRTUAL'){var _0x2e74d9={};_0x2e74d9[_0x4ea503[_0x4926('0x28')]]={'$like':'%'+_0x14cc3a[_0x4926('0x31')][_0x4926('0x3f')]+'%'};return _0x2e74d9;}})});}_0x39ad37=_[_0x4926('0x3e')]({},_0x39ad37,_0x14cc3a['options']);var _0x5a8f61={'where':_0x39ad37['where']};return db['UserProfile'][_0x4926('0x20')](_0x5a8f61)[_0x4926('0x40')](function(_0x4380da){_0x32a6c2[_0x4926('0x20')]=_0x4380da;if(_0x14cc3a[_0x4926('0x31')]['includeAll']){_0x39ad37[_0x4926('0x41')]=[{'all':!![]}];}return db[_0x4926('0x2c')][_0x4926('0x42')](_0x39ad37);})[_0x4926('0x40')](function(_0x437800){_0x32a6c2[_0x4926('0x43')]=_0x437800;return _0x32a6c2;})[_0x4926('0x40')](respondWithFilteredResult(_0x5a44a9,_0x39ad37))[_0x4926('0x44')](handleError(_0x5a44a9,null));};exports[_0x4926('0x45')]=function(_0x39329b,_0x51427e){var _0x571efa={'raw':![],'where':{'id':_0x39329b['params']['id']}},_0x3428be={};_0x3428be[_0x4926('0x30')]=_[_0x4926('0x32')](db[_0x4926('0x2c')]['rawAttributes']);_0x3428be[_0x4926('0x31')]=_[_0x4926('0x32')](_0x39329b[_0x4926('0x31')]);_0x3428be[_0x4926('0x33')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],_0x3428be[_0x4926('0x31')]);_0x571efa[_0x4926('0x35')]=_[_0x4926('0x34')](_0x3428be[_0x4926('0x30')],qs[_0x4926('0x36')](_0x39329b[_0x4926('0x31')][_0x4926('0x36')]));_0x571efa[_0x4926('0x35')]=_0x571efa[_0x4926('0x35')]['length']?_0x571efa[_0x4926('0x35')]:_0x3428be[_0x4926('0x30')];if(_0x39329b['query'][_0x4926('0x46')]){_0x571efa[_0x4926('0x41')]=[{'all':!![]}];}_0x571efa=_[_0x4926('0x3e')]({},_0x571efa,_0x39329b['options']);return db[_0x4926('0x2c')][_0x4926('0x47')](_0x571efa)[_0x4926('0x40')](handleEntityNotFound(_0x51427e,null))[_0x4926('0x40')](respondWithResult(_0x51427e,null))[_0x4926('0x44')](handleError(_0x51427e,null));};exports[_0x4926('0x48')]=function(_0x43764f,_0x12a89b){return db['UserProfile'][_0x4926('0x48')](_0x43764f['body'],{})['then'](respondWithResult(_0x12a89b,0xc9))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x49')]=function(_0x50d4b4,_0x3afe71){var _0x3ef8ec={'where':{'id':_0x50d4b4[_0x4926('0x4a')]['id']}},_0x37877f={};_0x37877f[_0x4926('0x30')]=_[_0x4926('0x32')](db['UserProfile']['rawAttributes']);_0x3ef8ec['attributes']=_['intersection'](_0x37877f[_0x4926('0x30')],qs[_0x4926('0x36')](_0x50d4b4[_0x4926('0x31')][_0x4926('0x36')]));_0x3ef8ec[_0x4926('0x35')]=_0x3ef8ec[_0x4926('0x35')]['length']?_0x3ef8ec[_0x4926('0x35')]:_0x37877f[_0x4926('0x30')];if(_0x50d4b4['query'][_0x4926('0x46')]){_0x3ef8ec[_0x4926('0x41')]=[{'all':!![]}];}_0x3ef8ec=_['merge']({},_0x3ef8ec,_0x50d4b4[_0x4926('0x4b')]);return db[_0x4926('0x2c')]['find'](_0x3ef8ec)[_0x4926('0x40')](handleEntityNotFound(_0x3afe71,null))['then'](function(_0x1b0b43){if(_0x1b0b43){var _0x691972=_0x1b0b43[_0x4926('0x4c')]({'plain':!![]});_0x691972=qs[_0x4926('0x4d')](_0x691972,['id',_0x4926('0x4e'),'updatedAt','crudPermissions']);_0x50d4b4[_0x4926('0x4f')]=_[_0x4926('0x4d')](_0x50d4b4['body'],['id',_0x4926('0x4e'),_0x4926('0x50')]);return db[_0x4926('0x51')]['transaction'](function(_0x22e537){return db[_0x4926('0x2c')][_0x4926('0x48')](_[_0x4926('0x3e')](_0x691972,_0x50d4b4['body']),{'include':_0x50d4b4['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x22e537})[_0x4926('0x40')](function(_0x391087){var _0x2efca4=_0x391087[_0x4926('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x50d4b4['params']['id']},'raw':!![]})[_0x4926('0x40')](function(_0x113907){if(_0x113907){return BPromise[_0x4926('0x52')](_0x113907,function(_0x41e090){return new BPromise(function(_0x39c072,_0x5ad039){if(_0x41e090[_0x4926('0x53')]===null||_0x41e090[_0x4926('0x53')]===0x1)_0x39c072(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x41e090['id']},'raw':!![]})[_0x4926('0x40')](function(_0x27ef63){var _0x165d08=_[_0x4926('0x2b')](_0x27ef63,function(_0x48a4ec){return qs['omit'](_0x48a4ec,['id','createdAt',_0x4926('0x50'),_0x4926('0x54')]);});_0x39c072(_0x165d08);})[_0x4926('0x44')](function(_0x55b39b){_0x5ad039(_0x55b39b);});})[_0x4926('0x40')](function(_0x538665){var _0x1696c9=qs[_0x4926('0x4d')](_0x41e090,['id','createdAt',_0x4926('0x50')]);_0x1696c9['userProfileId']=_0x2efca4['id'];if(_0x538665)_0x1696c9[_0x4926('0x55')]=_0x538665;return _0x1696c9;})[_0x4926('0x40')](function(_0x4ebdb8){return db[_0x4926('0x56')][_0x4926('0x48')](_0x4ebdb8,{'include':[{'model':db[_0x4926('0x57')],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x22e537});});})['then'](function(){return _0x2efca4;});}});});});}})[_0x4926('0x40')](respondWithResult(_0x3afe71,0xc9))[_0x4926('0x44')](handleError(_0x3afe71,null));};exports['update']=function(_0x7ed5fc,_0x155726){if(_0x7ed5fc[_0x4926('0x4f')]['id']){delete _0x7ed5fc[_0x4926('0x4f')]['id'];}return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x7ed5fc[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x155726,null))[_0x4926('0x40')](saveUpdates(_0x7ed5fc['body'],null))[_0x4926('0x40')](respondWithResult(_0x155726,null))[_0x4926('0x44')](handleError(_0x155726,null));};exports[_0x4926('0x58')]=function(_0x4b8873,_0x59df25){return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x4b8873[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59df25,null))[_0x4926('0x40')](removeEntity(_0x59df25,null))[_0x4926('0x44')](handleError(_0x59df25,null));};exports[_0x4926('0x59')]=function(_0x3180ae,_0x328380){return db[_0x4926('0x2c')][_0x4926('0x59')]()['then'](respondWithResult(_0x328380,null))[_0x4926('0x44')](handleError(_0x328380,null));};exports[_0x4926('0x5a')]=function(_0x17a414,_0x21207f){var _0x5321cc=_0x17a414[_0x4926('0x4f')];return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x17a414[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x21207f,null))['then'](function(_0x8f68cf){if(_0x8f68cf){return db['sequelize'][_0x4926('0x5b')](function(_0x129405){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x17a414['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x5321cc,function(_0x5854ae){return _0x5854ae['sectionId'];})},'transaction':_0x129405})[_0x4926('0x40')](function(){var _0x2f60f0=_[_0x4926('0x2b')](_0x5321cc,function(_0x28b118){_0x28b118[_0x4926('0x5c')]=_0x17a414[_0x4926('0x4a')]['id'];return _0x28b118;});var _0x564e51=[];return BPromise[_0x4926('0x52')](_0x2f60f0,function(_0x25a345){return db[_0x4926('0x56')][_0x4926('0x48')](_0x25a345,{'include':[{'model':db['UserProfileResource'],'as':_0x4926('0x55')}],'raw':!![],'transaction':_0x129405})[_0x4926('0x40')](function(_0x1de139){_0x564e51[_0x4926('0x5d')](_0x1de139[_0x4926('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x564e51;});});});}})['then'](function(_0x388370){return _0x388370;})[_0x4926('0x40')](respondWithResult(_0x21207f,null))[_0x4926('0x44')](handleError(_0x21207f,null));};exports[_0x4926('0x5e')]=function(_0x522b61,_0x1fad14){var _0x3d788b;return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x522b61[_0x4926('0x4a')]['id']},'attributes':['id',_0x4926('0x28')]})[_0x4926('0x40')](handleEntityNotFound(_0x1fad14,null))[_0x4926('0x40')](function(_0x36a782){if(_0x36a782){_0x3d788b=_0x36a782;return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x522b61[_0x4926('0x4a')]['id'],'sectionId':_0x522b61[_0x4926('0x31')][_0x4926('0x5f')]}});}})[_0x4926('0x40')](function(){return _0x3d788b;})[_0x4926('0x40')](respondWithStatusCode(_0x1fad14,null))[_0x4926('0x44')](handleError(_0x1fad14,null));};exports[_0x4926('0x60')]=function(_0x4ae357,_0x2889c1){var _0x30bb83=[];var _0x3f9198=[];return db['UserProfileSection'][_0x4926('0x42')]({'where':{'userProfileId':_0x4ae357[_0x4926('0x4a')]['id']},'raw':!![]})[_0x4926('0x40')](function(_0x152dbf){_0x30bb83=_[_0x4926('0x3f')](_0x152dbf,function(_0x18aa37){return _0x18aa37[_0x4926('0x61')]===0x1||_[_0x4926('0x62')]([0x3eb,0x709],_0x18aa37[_0x4926('0x54')]);});if(!_[_0x4926('0x63')](_0x30bb83)){return _[_0x4926('0x2b')](_0x30bb83,function(_0x45d7c3){return _0x45d7c3['sectionId'];});}else{return;}})['then'](function(_0x162d9c){if(_0x162d9c)_0x3f9198=_0x162d9c;if(_['includes'](_0x3f9198,0x64)){var _0x140eba=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x64});return hasDefaultDashboard(_0x140eba)['then'](function(_0x3818e4){return _[_0x4926('0x2b')](_0x30bb83,function(_0x246db8){if(_0x246db8[_0x4926('0x54')]===0x64){_0x246db8[_0x4926('0x64')]=_0x3818e4;}return _0x246db8;});});}else{return;}})['then'](function(_0x50141a){if(_0x50141a)_0x30bb83=_0x50141a;if(_[_0x4926('0x62')](_0x3f9198,0x3eb)){var _0x1314b7=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x3eb});return getCustomDashboards(_0x1314b7)['then'](function(_0x16fe37){return _['map'](_0x30bb83,function(_0x28385a){if(_0x1314b7[_0x4926('0x61')]){if(_0x28385a[_0x4926('0x54')]===0x3eb){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}else{if(_0x28385a[_0x4926('0x54')]===0x64){_0x28385a[_0x4926('0x64')]=_0x16fe37;}}return _0x28385a;});});}else{return;}})[_0x4926('0x40')](function(_0x4d6b56){if(_0x4d6b56)_0x30bb83=_0x4d6b56;if(_[_0x4926('0x62')](_0x3f9198,0x709)){var _0x3ae52e=_[_0x4926('0x47')](_0x30bb83,{'sectionId':0x709});return getPlugins(_0x3ae52e)['then'](function(_0x8d3b96){if(_0x3ae52e[_0x4926('0x61')]){return _[_0x4926('0x2b')](_0x30bb83,function(_0x49fb63){if(_0x49fb63[_0x4926('0x54')]===0x709){_0x49fb63[_0x4926('0x64')]=_0x8d3b96;}return _0x49fb63;});}else{var _0x35690d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x8d3b96};var _0xecac48=_[_0x4926('0x2b')](_0x30bb83);_0xecac48[_0x4926('0x5d')](_0x35690d);return _0xecac48;}});}else{return;}})['then'](function(_0x345922){if(_0x345922)_0x30bb83=_0x345922;return _[_0x4926('0x3f')](_0x30bb83,[_0x4926('0x61'),0x1]);})[_0x4926('0x40')](respondWithResult(_0x2889c1,null))[_0x4926('0x44')](handleError(_0x2889c1,null));};function hasDefaultDashboard(_0x20a068){var _0x3e4da9=[0x65];return new BPromise(function(_0x3ba12b,_0x5bae2b){try{if(_0x20a068[_0x4926('0x53')]){_0x3ba12b(_0x3e4da9);}else{return db['UserProfileResource'][_0x4926('0x65')]({'where':{'sectionId':_0x20a068['id']},'raw':!![]})['then'](function(_0x2c9f29){_0x2c9f29?_0x3ba12b(_0x3e4da9):_0x3ba12b();});}}catch(_0x2d5590){_0x5bae2b(_0x2d5590);}});}function getCustomDashboards(_0x1b01d3){var _0x1d8424=[];return new BPromise(function(_0x2458a5,_0x2aedb7){try{if(_0x1b01d3[_0x4926('0x53')]){return db[_0x4926('0x66')]['findAll']({'raw':!![]})[_0x4926('0x40')](function(_0x48230a){_0x48230a['forEach'](function(_0x2f524c){_0x1d8424[_0x4926('0x5d')](_0x2f524c['id']+0x1869f);});_0x2458a5(_0x1d8424);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1b01d3['id']},'raw':!![]})['then'](function(_0x5d7c70){_0x5d7c70[_0x4926('0x67')](function(_0x1edfe3){_0x1d8424[_0x4926('0x5d')](_0x1edfe3['resourceId']+0x1869f);});_0x2458a5(_0x1d8424);});}}catch(_0x4011d7){_0x2aedb7(_0x4011d7);}});}function getPlugins(_0x5d6aa0){var _0x2290db=[];return new BPromise(function(_0x4dd23b,_0x2c62e7){try{if(_0x5d6aa0[_0x4926('0x53')]){return db[_0x4926('0x68')][_0x4926('0x42')]({'raw':!![]})[_0x4926('0x40')](function(_0x5a3bcf){_0x5a3bcf[_0x4926('0x67')](function(_0x1ecf6e){_0x2290db[_0x4926('0x5d')](_0x1ecf6e['id']+0x15b38);});_0x4dd23b(_0x2290db);});}else{return db[_0x4926('0x57')][_0x4926('0x42')]({'where':{'sectionId':_0x5d6aa0['id']},'raw':!![]})['then'](function(_0x5bf140){_0x5bf140[_0x4926('0x67')](function(_0x26c5d3){_0x2290db['push'](_0x26c5d3['resourceId']+0x15b38);});_0x4dd23b(_0x2290db);});}}catch(_0x2d4d46){_0x2c62e7(_0x2d4d46);}});}exports[_0x4926('0x69')]=function(_0x3f2f37,_0x5d1adb){return db['UserProfile'][_0x4926('0x47')]({'where':{'id':_0x3f2f37['params']['id']}})[_0x4926('0x40')](handleEntityNotFound(_0x5d1adb,null))[_0x4926('0x40')](function(_0x182039){if(_0x182039){return db[_0x4926('0x51')]['transaction'](function(_0x12d9a3){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37[_0x4926('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x4926('0x40')](function(_0xa4950e){if(_0xa4950e){return db[_0x4926('0x56')][_0x4926('0x58')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'id':_[_0x4926('0x2b')](_0xa4950e,function(_0x1b78b7){return _0x1b78b7['id'];})},'transaction':_0x12d9a3});}})[_0x4926('0x40')](function(_0x1e7ce2){var _0x5a3146=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x3068cb){_0x3068cb['userProfileId']=_0x3f2f37['params']['id'];return _0x3068cb;});return db[_0x4926('0x56')]['bulkCreate'](_0x5a3146,{'raw':!![],'transaction':_0x12d9a3});})[_0x4926('0x40')](function(_0x5d8516){var _0x3a0a1a=_[_0x4926('0x3f')](_[_0x4926('0x2b')](_0x5d8516,function(_0x10072b){return _0x10072b[_0x4926('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x3a0a1a){return db[_0x4926('0x56')][_0x4926('0x42')]({'where':{'userProfileId':_0x3f2f37['params']['id'],'sectionId':_[_0x4926('0x2b')](_0x3a0a1a,function(_0xde230e){return _0xde230e['sectionId'];})},'attributes':['id',_0x4926('0x54')],'raw':!![]})['then'](function(_0x108f2c){var _0x296a0c=_[_0x4926('0x2b')](_0x3f2f37[_0x4926('0x4f')],function(_0x4bfc3a){_0x4bfc3a[_0x4926('0x5c')]=_0x3f2f37[_0x4926('0x4a')]['id'];return _0x4bfc3a;});return db[_0x4926('0x57')][_0x4926('0x6a')](_0x296a0c,{'raw':!![],'transaction':_0x12d9a3});});}})[_0x4926('0x44')](handleError(_0x5d1adb,null));});}})[_0x4926('0x40')](function(_0x574517){var _0x23e99c=_[_0x4926('0x2b')](_0x574517,function(_0x556a78){return _0x556a78['get']({'plain':!![]});});})[_0x4926('0x40')](respondWithResult(_0x5d1adb,null))['catch'](handleError(_0x5d1adb,null));};exports['removeResources']=function(_0xaa7b6d,_0x28309e,_0x23c770){return db[_0x4926('0x2c')]['find']({'where':{'id':_0xaa7b6d[_0x4926('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28309e,null))['then'](function(_0x96341a){if(_0x96341a){return _0x96341a['removeResources'](_0xaa7b6d[_0x4926('0x31')][_0x4926('0x5f')]);}})[_0x4926('0x40')](respondWithStatusCode(_0x28309e,null))[_0x4926('0x44')](handleError(_0x28309e,null));};exports[_0x4926('0x6b')]=function(_0x452fe9,_0x5426b8){var _0x41085d={};if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x6c')])throw new Error(_0x4926('0x6d'));if(!_0x452fe9[_0x4926('0x31')][_0x4926('0x38')](_0x4926('0x39'))){_0x41085d['limit']=qs['limit'](_0x452fe9['query'][_0x4926('0x21')]);_0x41085d[_0x4926('0x1e')]=qs[_0x4926('0x1e')](_0x452fe9[_0x4926('0x31')][_0x4926('0x1e')]);}return db[_0x4926('0x2c')][_0x4926('0x47')]({'where':{'id':_0x452fe9[_0x4926('0x4a')]['id']}})[_0x4926('0x40')](function(_0x2d0387){if(!_0x2d0387)throw new Error(_0x4926('0x6e')+_0x452fe9[_0x4926('0x4a')]['id']);return db['UserProfile']['getResources'](_0x452fe9);})[_0x4926('0x40')](respondWithFilteredResult(_0x5426b8,_0x41085d))[_0x4926('0x44')](handleError(_0x5426b8,null));}; \ No newline at end of file +var _0x5386=['omit','createdAt','updatedAt','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','UserProfile','findAll','catch','length','includeAll','find','create','clone','params','get'];(function(_0xd60031,_0x5efb93){var _0x43d00a=function(_0x21ac92){while(--_0x21ac92){_0xd60031['push'](_0xd60031['shift']());}};_0x43d00a(++_0x5efb93);}(_0x5386,0x1e1));var _0x6538=function(_0xb9622e,_0x91225d){_0xb9622e=_0xb9622e-0x0;var _0x12969e=_0x5386[_0xb9622e];return _0x12969e;};'use strict';var emlformat=require(_0x6538('0x0'));var rimraf=require(_0x6538('0x1'));var zipdir=require(_0x6538('0x2'));var jsonpatch=require(_0x6538('0x3'));var rp=require('request-promise');var moment=require(_0x6538('0x4'));var BPromise=require(_0x6538('0x5'));var Mustache=require(_0x6538('0x6'));var util=require(_0x6538('0x7'));var path=require(_0x6538('0x8'));var sox=require(_0x6538('0x9'));var csv=require(_0x6538('0xa'));var ejs=require(_0x6538('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6538('0xc'));var squel=require('squel');var crypto=require(_0x6538('0xd'));var jsforce=require(_0x6538('0xe'));var deskjs=require(_0x6538('0xf'));var toCsv=require(_0x6538('0xa'));var querystring=require(_0x6538('0x10'));var Papa=require(_0x6538('0x11'));var Redis=require(_0x6538('0x12'));var authService=require(_0x6538('0x13'));var qs=require(_0x6538('0x14'));var as=require(_0x6538('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6538('0x16'))(_0x6538('0x17'));var utils=require(_0x6538('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6538('0x19'));var db=require('../../mysqldb')['db'];config[_0x6538('0x1a')]=_[_0x6538('0x1b')](config['redis'],{'host':_0x6538('0x1c'),'port':0x18eb});var socket=require(_0x6538('0x1d'))(new Redis(config['redis']));require(_0x6538('0x1e'))[_0x6538('0x1f')](socket);function respondWithStatusCode(_0x266934,_0x54da50){_0x54da50=_0x54da50||0xcc;return function(_0x406b0c){if(_0x406b0c){return _0x266934['sendStatus'](_0x54da50);}return _0x266934[_0x6538('0x20')](_0x54da50)[_0x6538('0x21')]();};}function respondWithResult(_0x2407c0,_0x380edb){_0x380edb=_0x380edb||0xc8;return function(_0x57071e){if(_0x57071e){return _0x2407c0[_0x6538('0x20')](_0x380edb)[_0x6538('0x22')](_0x57071e);}};}function respondWithFilteredResult(_0x58fd79,_0x4f2a1c){return function(_0x7c32d0){if(_0x7c32d0){var _0x5c2f2c=typeof _0x4f2a1c[_0x6538('0x23')]===_0x6538('0x24')&&typeof _0x4f2a1c[_0x6538('0x25')]==='undefined';var _0x261428=_0x7c32d0[_0x6538('0x26')];var _0x31fd9a=_0x5c2f2c?0x0:_0x4f2a1c[_0x6538('0x23')];var _0x41f553=_0x5c2f2c?_0x7c32d0[_0x6538('0x26')]:_0x4f2a1c[_0x6538('0x23')]+_0x4f2a1c[_0x6538('0x25')];var _0x116c16;if(_0x41f553>=_0x261428){_0x41f553=_0x261428;_0x116c16=0xc8;}else{_0x116c16=0xce;}_0x58fd79[_0x6538('0x20')](_0x116c16);return _0x58fd79['set']('Content-Range',_0x31fd9a+'-'+_0x41f553+'/'+_0x261428)[_0x6538('0x22')](_0x7c32d0);}return null;};}function patchUpdates(_0x5b6361){return function(_0x404aca){try{jsonpatch[_0x6538('0x27')](_0x404aca,_0x5b6361,!![]);}catch(_0x421cb8){return BPromise[_0x6538('0x28')](_0x421cb8);}return _0x404aca['save']();};}function saveUpdates(_0x5a5846,_0x341b78){return function(_0x5c6806){if(_0x5c6806){return _0x5c6806[_0x6538('0x29')](_0x5a5846)['then'](function(_0x4a28a0){return _0x4a28a0;});}return null;};}function removeEntity(_0x4c39f3,_0x1cd5d2){return function(_0x1f6037){if(_0x1f6037){return _0x1f6037['destroy']()[_0x6538('0x2a')](function(){_0x4c39f3['status'](0xcc)[_0x6538('0x21')]();});}};}function handleEntityNotFound(_0x249dcb,_0xea5295){return function(_0x4fb3d6){if(!_0x4fb3d6){_0x249dcb['sendStatus'](0x194);}return _0x4fb3d6;};}function handleError(_0x24f752,_0x155581){_0x155581=_0x155581||0x1f4;return function(_0x197048){logger[_0x6538('0x2b')](_0x197048['stack']);if(_0x197048[_0x6538('0x2c')]){delete _0x197048['name'];}_0x24f752[_0x6538('0x20')](_0x155581)[_0x6538('0x2d')](_0x197048);};}exports[_0x6538('0x2e')]=function(_0x28e32f,_0x42c69e){var _0x12df00={},_0x325354={},_0x3513ec={'count':0x0,'rows':[]};var _0x2faa43=_[_0x6538('0x2f')](db['UserProfile'][_0x6538('0x30')],function(_0x42c067){return{'name':_0x42c067[_0x6538('0x31')],'type':_0x42c067['type'][_0x6538('0x32')]};});_0x325354[_0x6538('0x33')]=_[_0x6538('0x2f')](_0x2faa43,'name');_0x325354['query']=_[_0x6538('0x34')](_0x28e32f[_0x6538('0x35')]);_0x325354['filters']=_[_0x6538('0x36')](_0x325354[_0x6538('0x33')],_0x325354['query']);_0x12df00[_0x6538('0x37')]=_[_0x6538('0x36')](_0x325354['model'],qs[_0x6538('0x38')](_0x28e32f[_0x6538('0x35')][_0x6538('0x38')]));_0x12df00[_0x6538('0x37')]=_0x12df00[_0x6538('0x37')]['length']?_0x12df00[_0x6538('0x37')]:_0x325354[_0x6538('0x33')];if(!_0x28e32f[_0x6538('0x35')]['hasOwnProperty'](_0x6538('0x39'))){_0x12df00['limit']=qs['limit'](_0x28e32f['query']['limit']);_0x12df00[_0x6538('0x23')]=qs[_0x6538('0x23')](_0x28e32f[_0x6538('0x35')][_0x6538('0x23')]);}_0x12df00[_0x6538('0x3a')]=qs[_0x6538('0x3b')](_0x28e32f[_0x6538('0x35')][_0x6538('0x3b')]);_0x12df00[_0x6538('0x3c')]=qs[_0x6538('0x3d')](_[_0x6538('0x3e')](_0x28e32f[_0x6538('0x35')],_0x325354[_0x6538('0x3d')]),_0x2faa43);if(_0x28e32f['query'][_0x6538('0x3f')]){_0x12df00[_0x6538('0x3c')]=_[_0x6538('0x40')](_0x12df00['where'],{'$or':_[_0x6538('0x2f')](_0x2faa43,function(_0x53fec8){if(_0x53fec8[_0x6538('0x41')]!==_0x6538('0x42')){var _0x1f219d={};_0x1f219d[_0x53fec8[_0x6538('0x2c')]]={'$like':'%'+_0x28e32f[_0x6538('0x35')][_0x6538('0x3f')]+'%'};return _0x1f219d;}})});}_0x12df00=_[_0x6538('0x40')]({},_0x12df00,_0x28e32f[_0x6538('0x43')]);var _0x3b0755={'where':_0x12df00[_0x6538('0x3c')]};return db['UserProfile']['count'](_0x3b0755)['then'](function(_0xfc51f){_0x3513ec[_0x6538('0x26')]=_0xfc51f;if(_0x28e32f['query']['includeAll']){_0x12df00[_0x6538('0x44')]=[{'all':!![]}];}return db[_0x6538('0x45')][_0x6538('0x46')](_0x12df00);})[_0x6538('0x2a')](function(_0x273317){_0x3513ec['rows']=_0x273317;return _0x3513ec;})[_0x6538('0x2a')](respondWithFilteredResult(_0x42c69e,_0x12df00))[_0x6538('0x47')](handleError(_0x42c69e,null));};exports['show']=function(_0x34f8a9,_0x454bfa){var _0x3f61c6={'raw':![],'where':{'id':_0x34f8a9['params']['id']}},_0x3c2f2d={};_0x3c2f2d[_0x6538('0x33')]=_[_0x6538('0x34')](db[_0x6538('0x45')][_0x6538('0x30')]);_0x3c2f2d['query']=_[_0x6538('0x34')](_0x34f8a9[_0x6538('0x35')]);_0x3c2f2d[_0x6538('0x3d')]=_[_0x6538('0x36')](_0x3c2f2d[_0x6538('0x33')],_0x3c2f2d['query']);_0x3f61c6[_0x6538('0x37')]=_[_0x6538('0x36')](_0x3c2f2d[_0x6538('0x33')],qs['fields'](_0x34f8a9[_0x6538('0x35')][_0x6538('0x38')]));_0x3f61c6[_0x6538('0x37')]=_0x3f61c6['attributes'][_0x6538('0x48')]?_0x3f61c6['attributes']:_0x3c2f2d[_0x6538('0x33')];if(_0x34f8a9['query'][_0x6538('0x49')]){_0x3f61c6[_0x6538('0x44')]=[{'all':!![]}];}_0x3f61c6=_[_0x6538('0x40')]({},_0x3f61c6,_0x34f8a9[_0x6538('0x43')]);return db['UserProfile'][_0x6538('0x4a')](_0x3f61c6)[_0x6538('0x2a')](handleEntityNotFound(_0x454bfa,null))[_0x6538('0x2a')](respondWithResult(_0x454bfa,null))['catch'](handleError(_0x454bfa,null));};exports[_0x6538('0x4b')]=function(_0x86ac3e,_0x2046a8){return db['UserProfile'][_0x6538('0x4b')](_0x86ac3e['body'],{})[_0x6538('0x2a')](respondWithResult(_0x2046a8,0xc9))[_0x6538('0x47')](handleError(_0x2046a8,null));};exports[_0x6538('0x4c')]=function(_0x2e7b0f,_0x402ff6){var _0x14649a={'where':{'id':_0x2e7b0f[_0x6538('0x4d')]['id']}},_0x3adb3a={};_0x3adb3a['model']=_['keys'](db[_0x6538('0x45')][_0x6538('0x30')]);_0x14649a[_0x6538('0x37')]=_['intersection'](_0x3adb3a['model'],qs['fields'](_0x2e7b0f['query'][_0x6538('0x38')]));_0x14649a[_0x6538('0x37')]=_0x14649a[_0x6538('0x37')][_0x6538('0x48')]?_0x14649a['attributes']:_0x3adb3a[_0x6538('0x33')];if(_0x2e7b0f[_0x6538('0x35')][_0x6538('0x49')]){_0x14649a[_0x6538('0x44')]=[{'all':!![]}];}_0x14649a=_[_0x6538('0x40')]({},_0x14649a,_0x2e7b0f[_0x6538('0x43')]);return db[_0x6538('0x45')][_0x6538('0x4a')](_0x14649a)[_0x6538('0x2a')](handleEntityNotFound(_0x402ff6,null))['then'](function(_0x242ab3){if(_0x242ab3){var _0x3c95e7=_0x242ab3[_0x6538('0x4e')]({'plain':!![]});_0x3c95e7=qs[_0x6538('0x4f')](_0x3c95e7,['id',_0x6538('0x50'),_0x6538('0x51'),'crudPermissions']);_0x2e7b0f[_0x6538('0x52')]=_[_0x6538('0x4f')](_0x2e7b0f[_0x6538('0x52')],['id',_0x6538('0x50'),'updatedAt']);return db[_0x6538('0x53')][_0x6538('0x54')](function(_0x97559c){return db[_0x6538('0x45')]['create'](_[_0x6538('0x40')](_0x3c95e7,_0x2e7b0f[_0x6538('0x52')]),{'include':_0x2e7b0f[_0x6538('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x97559c})['then'](function(_0x4f1167){var _0x5879f8=_0x4f1167[_0x6538('0x4e')]({'plain':!![]});return db[_0x6538('0x55')][_0x6538('0x46')]({'where':{'userProfileId':_0x2e7b0f[_0x6538('0x4d')]['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x41346d){if(_0x41346d){return BPromise[_0x6538('0x56')](_0x41346d,function(_0x35281b){return new BPromise(function(_0x41d1aa,_0x37a6c5){if(_0x35281b[_0x6538('0x57')]===null||_0x35281b[_0x6538('0x57')]===0x1)_0x41d1aa(null);return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0x35281b['id']},'raw':!![]})['then'](function(_0x1f12d9){var _0x9c0249=_['map'](_0x1f12d9,function(_0x18f9c8){return qs['omit'](_0x18f9c8,['id',_0x6538('0x50'),_0x6538('0x51'),_0x6538('0x59')]);});_0x41d1aa(_0x9c0249);})[_0x6538('0x47')](function(_0x284f85){_0x37a6c5(_0x284f85);});})[_0x6538('0x2a')](function(_0x508c01){var _0x3eea15=qs[_0x6538('0x4f')](_0x35281b,['id',_0x6538('0x50'),_0x6538('0x51')]);_0x3eea15[_0x6538('0x5a')]=_0x5879f8['id'];if(_0x508c01)_0x3eea15['Resources']=_0x508c01;return _0x3eea15;})[_0x6538('0x2a')](function(_0x226d72){return db['UserProfileSection'][_0x6538('0x4b')](_0x226d72,{'include':[{'model':db[_0x6538('0x58')],'as':_0x6538('0x5b')}],'raw':!![],'transaction':_0x97559c});});})['then'](function(){return _0x5879f8;});}});});});}})[_0x6538('0x2a')](respondWithResult(_0x402ff6,0xc9))[_0x6538('0x47')](handleError(_0x402ff6,null));};exports[_0x6538('0x29')]=function(_0x5286c0,_0x2193c6){if(_0x5286c0[_0x6538('0x52')]['id']){delete _0x5286c0[_0x6538('0x52')]['id'];}return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x5286c0[_0x6538('0x4d')]['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0x2193c6,null))['then'](saveUpdates(_0x5286c0['body'],null))[_0x6538('0x2a')](respondWithResult(_0x2193c6,null))[_0x6538('0x47')](handleError(_0x2193c6,null));};exports[_0x6538('0x5c')]=function(_0x121a8a,_0xb61e23){return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x121a8a['params']['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0xb61e23,null))[_0x6538('0x2a')](removeEntity(_0xb61e23,null))['catch'](handleError(_0xb61e23,null));};exports[_0x6538('0x5d')]=function(_0x50dacc,_0x394d7e){return db[_0x6538('0x45')][_0x6538('0x5d')]()[_0x6538('0x2a')](respondWithResult(_0x394d7e,null))[_0x6538('0x47')](handleError(_0x394d7e,null));};exports[_0x6538('0x5e')]=function(_0x5a6f99,_0x29bca0){var _0x4a7348=_0x5a6f99['body'];return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x5a6f99[_0x6538('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29bca0,null))[_0x6538('0x2a')](function(_0x2992ee){if(_0x2992ee){return db[_0x6538('0x53')]['transaction'](function(_0x224339){return db[_0x6538('0x55')][_0x6538('0x5c')]({'where':{'userProfileId':_0x5a6f99[_0x6538('0x4d')]['id'],'sectionId':_['map'](_0x4a7348,function(_0x4c4100){return _0x4c4100[_0x6538('0x59')];})},'transaction':_0x224339})[_0x6538('0x2a')](function(){var _0xca25ef=_['map'](_0x4a7348,function(_0x553d28){_0x553d28[_0x6538('0x5a')]=_0x5a6f99[_0x6538('0x4d')]['id'];return _0x553d28;});var _0x171346=[];return BPromise[_0x6538('0x56')](_0xca25ef,function(_0x255905){return db['UserProfileSection'][_0x6538('0x4b')](_0x255905,{'include':[{'model':db[_0x6538('0x58')],'as':_0x6538('0x5b')}],'raw':!![],'transaction':_0x224339})[_0x6538('0x2a')](function(_0x22cabe){_0x171346[_0x6538('0x5f')](_0x22cabe['get']({'plain':!![]}));});})[_0x6538('0x2a')](function(){return _0x171346;});});});}})[_0x6538('0x2a')](function(_0x42afbe){return _0x42afbe;})[_0x6538('0x2a')](respondWithResult(_0x29bca0,null))[_0x6538('0x47')](handleError(_0x29bca0,null));};exports['removeSections']=function(_0x40703d,_0x223022){var _0x441b1e;return db[_0x6538('0x45')][_0x6538('0x4a')]({'where':{'id':_0x40703d['params']['id']},'attributes':['id',_0x6538('0x2c')]})[_0x6538('0x2a')](handleEntityNotFound(_0x223022,null))[_0x6538('0x2a')](function(_0x92063e){if(_0x92063e){_0x441b1e=_0x92063e;return db[_0x6538('0x55')][_0x6538('0x5c')]({'where':{'userProfileId':_0x40703d[_0x6538('0x4d')]['id'],'sectionId':_0x40703d[_0x6538('0x35')][_0x6538('0x60')]}});}})['then'](function(){return _0x441b1e;})[_0x6538('0x2a')](respondWithStatusCode(_0x223022,null))[_0x6538('0x47')](handleError(_0x223022,null));};exports[_0x6538('0x61')]=function(_0x1bef35,_0x201332){var _0x5bcd5c=[];var _0x1203e6=[];return db[_0x6538('0x55')]['findAll']({'where':{'userProfileId':_0x1bef35['params']['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x82a046){_0x5bcd5c=_[_0x6538('0x3f')](_0x82a046,function(_0x3f441f){return _0x3f441f[_0x6538('0x62')]===0x1||_[_0x6538('0x63')]([0x3eb,0x709],_0x3f441f[_0x6538('0x59')]);});if(!_[_0x6538('0x64')](_0x5bcd5c)){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x50a02c){return _0x50a02c[_0x6538('0x59')];});}else{return;}})[_0x6538('0x2a')](function(_0x2a2ce2){if(_0x2a2ce2)_0x1203e6=_0x2a2ce2;if(_['includes'](_0x1203e6,0x64)){var _0x13e977=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x64});return hasDefaultDashboard(_0x13e977)[_0x6538('0x2a')](function(_0x41aa4d){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x8518e0){if(_0x8518e0[_0x6538('0x59')]===0x64){_0x8518e0[_0x6538('0x65')]=_0x41aa4d;}return _0x8518e0;});});}else{return;}})[_0x6538('0x2a')](function(_0x50e097){if(_0x50e097)_0x5bcd5c=_0x50e097;if(_[_0x6538('0x63')](_0x1203e6,0x3eb)){var _0x293df7=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x3eb});return getCustomDashboards(_0x293df7)['then'](function(_0x575a71){return _['map'](_0x5bcd5c,function(_0x7195c4){if(_0x293df7[_0x6538('0x62')]){if(_0x7195c4[_0x6538('0x59')]===0x3eb){_0x7195c4['subsections']=_0x575a71;}}else{if(_0x7195c4['sectionId']===0x64){_0x7195c4[_0x6538('0x65')]=_0x575a71;}}return _0x7195c4;});});}else{return;}})[_0x6538('0x2a')](function(_0x559faa){if(_0x559faa)_0x5bcd5c=_0x559faa;if(_[_0x6538('0x63')](_0x1203e6,0x709)){var _0x514b57=_[_0x6538('0x4a')](_0x5bcd5c,{'sectionId':0x709});return getPlugins(_0x514b57)[_0x6538('0x2a')](function(_0x44701e){if(_0x514b57[_0x6538('0x62')]){return _[_0x6538('0x2f')](_0x5bcd5c,function(_0x528977){if(_0x528977['sectionId']===0x709){_0x528977[_0x6538('0x65')]=_0x44701e;}return _0x528977;});}else{var _0x54f6b3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x44701e};var _0x36945c=_[_0x6538('0x2f')](_0x5bcd5c);_0x36945c['push'](_0x54f6b3);return _0x36945c;}});}else{return;}})[_0x6538('0x2a')](function(_0x42942c){if(_0x42942c)_0x5bcd5c=_0x42942c;return _[_0x6538('0x3f')](_0x5bcd5c,[_0x6538('0x62'),0x1]);})[_0x6538('0x2a')](respondWithResult(_0x201332,null))['catch'](handleError(_0x201332,null));};function hasDefaultDashboard(_0x54f1c1){var _0xe557e1=[0x65];return new BPromise(function(_0xff6d23,_0x1ad805){try{if(_0x54f1c1['autoAssociation']){_0xff6d23(_0xe557e1);}else{return db['UserProfileResource'][_0x6538('0x66')]({'where':{'sectionId':_0x54f1c1['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x185896){_0x185896?_0xff6d23(_0xe557e1):_0xff6d23();});}}catch(_0x3c2926){_0x1ad805(_0x3c2926);}});}function getCustomDashboards(_0xf56d10){var _0x17aa1a=[];return new BPromise(function(_0x15e0fc,_0x599b63){try{if(_0xf56d10[_0x6538('0x57')]){return db[_0x6538('0x67')][_0x6538('0x46')]({'raw':!![]})[_0x6538('0x2a')](function(_0x276ab8){_0x276ab8[_0x6538('0x68')](function(_0xb2dfb){_0x17aa1a[_0x6538('0x5f')](_0xb2dfb['id']+0x1869f);});_0x15e0fc(_0x17aa1a);});}else{return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0xf56d10['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x38bba0){_0x38bba0[_0x6538('0x68')](function(_0x3a2e2e){_0x17aa1a[_0x6538('0x5f')](_0x3a2e2e[_0x6538('0x69')]+0x1869f);});_0x15e0fc(_0x17aa1a);});}}catch(_0x286b53){_0x599b63(_0x286b53);}});}function getPlugins(_0x40aef8){var _0x3e1067=[];return new BPromise(function(_0x5f9350,_0x2e20af){try{if(_0x40aef8[_0x6538('0x57')]){return db['Plugin'][_0x6538('0x46')]({'raw':!![]})[_0x6538('0x2a')](function(_0x4b7410){_0x4b7410[_0x6538('0x68')](function(_0x104f37){_0x3e1067[_0x6538('0x5f')](_0x104f37['id']+0x15b38);});_0x5f9350(_0x3e1067);});}else{return db[_0x6538('0x58')][_0x6538('0x46')]({'where':{'sectionId':_0x40aef8['id']},'raw':!![]})[_0x6538('0x2a')](function(_0x4b1561){_0x4b1561[_0x6538('0x68')](function(_0x3dc80a){_0x3e1067['push'](_0x3dc80a[_0x6538('0x69')]+0x15b38);});_0x5f9350(_0x3e1067);});}}catch(_0x5bb7a5){_0x2e20af(_0x5bb7a5);}});}exports[_0x6538('0x6a')]=function(_0x1c692c,_0x2064e7){return db['UserProfile'][_0x6538('0x4a')]({'where':{'id':_0x1c692c['params']['id']}})[_0x6538('0x2a')](handleEntityNotFound(_0x2064e7,null))[_0x6538('0x2a')](function(_0x414850){if(_0x414850){return db['sequelize'][_0x6538('0x54')](function(_0x5e9087){return db['UserProfileSection'][_0x6538('0x46')]({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x6538('0x2a')](function(_0x1e9499){if(_0x1e9499){return db[_0x6538('0x55')]['destroy']({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id'],'id':_['map'](_0x1e9499,function(_0x21c1b0){return _0x21c1b0['id'];})},'transaction':_0x5e9087});}})[_0x6538('0x2a')](function(_0x317f53){var _0xec2fcf=_[_0x6538('0x2f')](_0x1c692c[_0x6538('0x52')],function(_0x47124d){_0x47124d[_0x6538('0x5a')]=_0x1c692c[_0x6538('0x4d')]['id'];return _0x47124d;});return db[_0x6538('0x55')][_0x6538('0x6b')](_0xec2fcf,{'raw':!![],'transaction':_0x5e9087});})[_0x6538('0x2a')](function(_0x9953a0){var _0x6e8cd1=_[_0x6538('0x3f')](_[_0x6538('0x2f')](_0x9953a0,function(_0x238590){return _0x238590[_0x6538('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x6e8cd1){return db['UserProfileSection'][_0x6538('0x46')]({'where':{'userProfileId':_0x1c692c[_0x6538('0x4d')]['id'],'sectionId':_[_0x6538('0x2f')](_0x6e8cd1,function(_0xe8d8c8){return _0xe8d8c8['sectionId'];})},'attributes':['id',_0x6538('0x59')],'raw':!![]})[_0x6538('0x2a')](function(_0x307ad0){var _0x3074d7=_[_0x6538('0x2f')](_0x1c692c[_0x6538('0x52')],function(_0x3eceda){_0x3eceda[_0x6538('0x5a')]=_0x1c692c[_0x6538('0x4d')]['id'];return _0x3eceda;});return db['UserProfileResource'][_0x6538('0x6b')](_0x3074d7,{'raw':!![],'transaction':_0x5e9087});});}})['catch'](handleError(_0x2064e7,null));});}})[_0x6538('0x2a')](function(_0x52cdfe){var _0x55cc8a=_[_0x6538('0x2f')](_0x52cdfe,function(_0x14642a){return _0x14642a[_0x6538('0x4e')]({'plain':!![]});});})[_0x6538('0x2a')](respondWithResult(_0x2064e7,null))['catch'](handleError(_0x2064e7,null));};exports[_0x6538('0x6c')]=function(_0x3d7f25,_0x17b44d,_0x24dc28){return db[_0x6538('0x45')]['find']({'where':{'id':_0x3d7f25[_0x6538('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17b44d,null))['then'](function(_0x5de2eb){if(_0x5de2eb){return _0x5de2eb[_0x6538('0x6c')](_0x3d7f25[_0x6538('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x17b44d,null))[_0x6538('0x47')](handleError(_0x17b44d,null));};exports['getResources']=function(_0x27995b,_0x64e400){var _0x1ca01f={};if(!_0x27995b[_0x6538('0x35')][_0x6538('0x6d')])throw new Error(_0x6538('0x6e'));if(!_0x27995b[_0x6538('0x35')]['hasOwnProperty'](_0x6538('0x39'))){_0x1ca01f[_0x6538('0x25')]=qs['limit'](_0x27995b[_0x6538('0x35')][_0x6538('0x25')]);_0x1ca01f['offset']=qs['offset'](_0x27995b[_0x6538('0x35')][_0x6538('0x23')]);}return db[_0x6538('0x45')]['find']({'where':{'id':_0x27995b[_0x6538('0x4d')]['id']}})[_0x6538('0x2a')](function(_0x3a20d5){if(!_0x3a20d5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x27995b[_0x6538('0x4d')]['id']);return db[_0x6538('0x45')][_0x6538('0x6f')](_0x27995b);})['then'](respondWithFilteredResult(_0x64e400,_0x1ca01f))['catch'](handleError(_0x64e400,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 214e82a..cd0ea31 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 _0x6d11=['hook','exports','events','../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty'];(function(_0x1e869f,_0x44c25b){var _0x179a44=function(_0x137b65){while(--_0x137b65){_0x1e869f['push'](_0x1e869f['shift']());}};_0x179a44(++_0x44c25b);}(_0x6d11,0xbf));var _0x16d1=function(_0x5bc369,_0x59fa6d){_0x5bc369=_0x5bc369-0x0;var _0x58dbb0=_0x6d11[_0x5bc369];return _0x58dbb0;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var UserProfile=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x3'),'afterUpdate':'update','afterDestroy':_0x16d1('0x4')};function emitEvent(_0x2e1a35){return function(_0x4bce83,_0x48754e,_0x3e0e86){UserProfileEvents[_0x16d1('0x5')](_0x2e1a35+':'+_0x4bce83['id'],_0x4bce83);UserProfileEvents[_0x16d1('0x5')](_0x2e1a35,_0x4bce83);_0x3e0e86(null);};}for(var e in events){if(events[_0x16d1('0x6')](e)){var event=events[e];UserProfile[_0x16d1('0x7')](e,emitEvent(event));}}module[_0x16d1('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x975b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x975b,0x1c9));var _0xb975=function(_0x1b8185,_0x3aa1b6){_0x1b8185=_0x1b8185-0x0;var _0x5e008c=_0x975b[_0x1b8185];return _0x5e008c;};'use strict';var EventEmitter=require(_0xb975('0x0'));var UserProfile=require(_0xb975('0x1'))['db'][_0xb975('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb975('0x3')](0x0);var events={'afterCreate':_0xb975('0x4'),'afterUpdate':_0xb975('0x5'),'afterDestroy':_0xb975('0x6')};function emitEvent(_0x5e662b){return function(_0xa92c72,_0xfb173,_0x2007e4){UserProfileEvents[_0xb975('0x7')](_0x5e662b+':'+_0xa92c72['id'],_0xa92c72);UserProfileEvents[_0xb975('0x7')](_0x5e662b,_0xa92c72);_0x2007e4(null);};}for(var e in events){if(events[_0xb975('0x8')](e)){var event=events[e];UserProfile[_0xb975('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6f97216..c1ea0a4 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 _0xd1e4=['name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','SquareProject','odbc','childModel','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','agents','Users','user','Agents','ZendeskAccount','salesforceaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','Interval','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','OpenTabs','define','UserProfile','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','params','ignore','union','push','all','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','where','key','VIRTUAL','find','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','CustomReports','count','Tags','color','tag','rows','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources'];(function(_0x33a92d,_0x4de136){var _0x4df857=function(_0x31fadf){while(--_0x31fadf){_0x33a92d['push'](_0x33a92d['shift']());}};_0x4df857(++_0x4de136);}(_0xd1e4,0x172));var _0x4d1e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd1e4[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x4d1e('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x4d1e('0x1'));var squel=require(_0x4d1e('0x2'));module[_0x4d1e('0x3')]=function(_0x4942a4){var _0x556353=_0x4942a4[_0x4d1e('0x4')];function _0x43a035(_0x448aae,_0x138233){return new Promise(function(_0x41b1f2,_0x1f366f){if(!_0x138233)return _0x41b1f2(null);var _0x29ec1=_0x138233['filter']?{[_0x138233[_0x4d1e('0x5')][_0x4d1e('0x6')]]:_0x138233[_0x4d1e('0x5')][_0x4d1e('0x7')]}:undefined;return _0x556353[_0x448aae][_0x4d1e('0x8')]({'where':_0x29ec1,'raw':!![]})[_0x4d1e('0x9')](function(_0xb47474){_0x138233['associatedResources']=_[_0x4d1e('0xa')](_0xb47474,'id');_0x41b1f2(_0x138233);})[_0x4d1e('0xb')](function(_0xe7eba1){_0x1f366f(_0xe7eba1);});});}function _0x207bca(_0x315d4e,_0x470b64){return new Promise(function(_0x25cdc4,_0x189cf8){var _0x29d104=_0x315d4e[_0x4d1e('0x5')]?{[_0x315d4e['filter'][_0x4d1e('0x6')]]:_0x315d4e[_0x4d1e('0x5')][_0x4d1e('0x7')]}:undefined;return _0x556353[_0x315d4e[_0x4d1e('0xc')]][_0x4d1e('0x8')]({'where':_0x29d104,'raw':!![]})[_0x4d1e('0x9')](function(_0x40c6cd){_0x470b64[_0x4d1e('0xd')]=_[_0x4d1e('0xa')](_0x40c6cd,function(_0x1fbaf6){return _0x1fbaf6[_0x4d1e('0xe')];});_0x25cdc4(_0x470b64);})[_0x4d1e('0xb')](function(_0x4b9eef){_0x189cf8(_0x4b9eef);});});}function _0x59a91e(_0x5036ba,_0xc3bbb1,_0x550f55){if(!_0xc3bbb1)return Promise[_0x4d1e('0xf')](null);return new Promise(function(_0x34c29e,_0x3e2a8b){return _0x556353[_0x4d1e('0x10')]['findAll']({'where':{'sectionId':_0xc3bbb1['id']},'raw':!![]})[_0x4d1e('0x9')](function(_0x4ce9b7){if(_0x5036ba[_0x4d1e('0x6')]&&_0x5036ba[_0x4d1e('0x6')]!=='id'){_0xc3bbb1[_0x4d1e('0xd')]=_['map'](_0x4ce9b7,function(_0x382423){return _0x382423[_0x5036ba[_0x4d1e('0x6')]];});}else{if(_0x550f55===_0x4d1e('0x11')){_0xc3bbb1[_0x4d1e('0xd')]=_[_0x4d1e('0xa')](_0x4ce9b7,function(_0x591fa6){return{'id':_0x591fa6[_0x4d1e('0x12')],'type':_0x591fa6[_0x4d1e('0x13')]};});}else{_0xc3bbb1[_0x4d1e('0xd')]=_[_0x4d1e('0xa')](_0x4ce9b7,function(_0x84b161){return _0x84b161[_0x4d1e('0x12')];});}}_0x34c29e(_0xc3bbb1);})['catch'](function(_0x5eaff6){_0x3e2a8b(_0x5eaff6);});});}function _0x5030ee(_0x16c603,_0x5bc670){var _0x4d0564={'parentSections':[]};switch(_0x16c603[_0x4d1e('0x14')]()){case'squareprojects':_0x4d0564['childModel']=_0x4d1e('0x15');break;case _0x4d1e('0x16'):_0x4d0564['childModel']='SquareOdbc';break;case'squarerecordings':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x18');_0x4d0564[_0x4d1e('0x19')]=[{'name':_0x4d1e('0x1a'),'field':_0x4d1e('0xe'),'foreignKey':_0x4d1e('0x1b')}];break;case _0x4d1e('0x1c'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x1d');break;case _0x4d1e('0x1e'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x1f');_0x4d0564[_0x4d1e('0x19')]=[{'name':'Lists','field':'id','foreignKey':_0x4d1e('0x20')}];break;case _0x4d1e('0x21'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x22');break;case _0x4d1e('0x23'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x24');break;case _0x4d1e('0x25'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x26');break;case _0x4d1e('0x27'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x28');break;case _0x4d1e('0x29'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x2a');break;case _0x4d1e('0x2b'):_0x4d0564['childModel']='FaxQueue';break;case'faxaccounts':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x2c');break;case'inboundroutes':case _0x4d1e('0x2d'):case'outboundroutes':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x2e');break;case _0x4d1e('0x2f'):_0x4d0564[_0x4d1e('0x17')]='VoiceContext';break;case _0x4d1e('0x30'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x31');break;case _0x4d1e('0x32'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x33');_0x4d0564[_0x4d1e('0x19')]=[{'name':'Agents','field':_0x4d1e('0xe'),'foreignKey':_0x4d1e('0x34'),'model':_0x4d1e('0x35'),'filter':{'field':_0x4d1e('0x36'),'value':[_0x4d1e('0x37')]}},{'name':_0x4d1e('0x38'),'field':_0x4d1e('0xe'),'foreignKey':_0x4d1e('0x34'),'model':_0x4d1e('0x35'),'filter':{'field':_0x4d1e('0x36'),'value':[_0x4d1e('0x39')]}},{'name':_0x4d1e('0x3a'),'field':'name','foreignKey':_0x4d1e('0x3b'),'model':_0x4d1e('0x3c'),'filter':{'field':'type','value':[_0x4d1e('0x3d')]}},{'name':'QueueCampaigns','field':_0x4d1e('0xe'),'foreignKey':_0x4d1e('0x3b'),'model':'VoiceQueue','filter':{'field':_0x4d1e('0x13'),'value':[_0x4d1e('0x3e')]}}];break;case _0x4d1e('0x3f'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x40');break;case _0x4d1e('0x41'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x42');break;case _0x4d1e('0x43'):_0x4d0564['childModel']=_0x4d1e('0x44');break;case _0x4d1e('0x45'):_0x4d0564['childModel']='Campaign';break;case'mailqueues':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x46');break;case _0x4d1e('0x47'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x48');break;case _0x4d1e('0x49'):_0x4d0564['childModel']='MailSubstatus';break;case _0x4d1e('0x4a'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x4b');break;case _0x4d1e('0x4c'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x4d');break;case _0x4d1e('0x4e'):_0x4d0564['childModel']=_0x4d1e('0x4f');break;case _0x4d1e('0x50'):_0x4d0564[_0x4d1e('0x17')]='SmsAccount';break;case _0x4d1e('0x51'):_0x4d0564['childModel']=_0x4d1e('0x52');break;case _0x4d1e('0x53'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x54');break;case _0x4d1e('0x55'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x56');break;case _0x4d1e('0x57'):case _0x4d1e('0x58'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x3c');if(_0x5bc670){_0x4d0564[_0x4d1e('0x19')]=[{'name':_0x4d1e('0x3a')},{'name':_0x4d1e('0x59')}];}break;case'users':case _0x4d1e('0x5a'):case'telephones':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x35');if(_0x5bc670){_0x4d0564[_0x4d1e('0x19')]=[{'name':_0x4d1e('0x5b'),'filter':{'field':'role','value':['admin',_0x4d1e('0x5c')]},'ignore':!![]},{'name':_0x4d1e('0x5d')},{'name':_0x4d1e('0x38')}];}break;case'zendeskaccounts':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x5e');break;case _0x4d1e('0x5f'):_0x4d0564['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x4d0564['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x60');break;case _0x4d1e('0x61'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x62');break;case'zohoaccounts':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x63');break;case _0x4d1e('0x64'):_0x4d0564[_0x4d1e('0x17')]='User';break;case'cannedanswers':_0x4d0564['childModel']=_0x4d1e('0x65');break;case _0x4d1e('0x66'):_0x4d0564[_0x4d1e('0x17')]='Disposition';break;case _0x4d1e('0x67'):_0x4d0564['childModel']=_0x4d1e('0x68');break;case'intervals':_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x69');break;case'pauses':_0x4d0564['childModel']=_0x4d1e('0x6a');break;case'scheduler':_0x4d0564['childModel']=_0x4d1e('0x6b');break;case _0x4d1e('0x6c'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x6d');break;case _0x4d1e('0x6e'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x6f');break;case _0x4d1e('0x70'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x71');break;case _0x4d1e('0x72'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x73');break;case _0x4d1e('0x74'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x75');break;case _0x4d1e('0x76'):_0x4d0564[_0x4d1e('0x17')]='Variable';break;case _0x4d1e('0x77'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x78');break;case'extractedreports':_0x4d0564[_0x4d1e('0x17')]='AnalyticExtractedReport';_0x4d0564[_0x4d1e('0x19')]=[{'name':_0x4d1e('0x79'),'field':'id','foreignKey':_0x4d1e('0x7a')}];break;case _0x4d1e('0x7b'):_0x4d0564[_0x4d1e('0x17')]=_0x4d1e('0x7c');break;}return _0x4d0564;}function _0x48ab2f(_0x2c26ac,_0xe93489){var _0x3fafb4=_0x2c26ac[_0x4d1e('0x7d')](0x0)[_0x4d1e('0x7e')]()+_0x2c26ac[_0x4d1e('0x7f')](0x1);var _0x16a15e={'type':_0x556353[_0x4d1e('0x80')][_0x4d1e('0x81')][_0x4d1e('0x82')],'raw':!![]};return new Promise(function(_0x56ade6,_0xa9a0bf){var _0xdd11cb=squel['select']()[_0x4d1e('0x6')](_0x4d1e('0x83')+_0x3fafb4+_0x4d1e('0x84'),'id')[_0x4d1e('0x6')]('ui.createdAt')[_0x4d1e('0x85')](_0x4d1e('0x86')+_0x2c26ac+_0x4d1e('0x87'),'ui')['where'](_0x4d1e('0x88'),_0xe93489['id']);return _0x556353[_0x4d1e('0x89')]['query'](_0xdd11cb['toString'](),_0x16a15e)[_0x4d1e('0x9')](function(_0x154fd8){_0xe93489[_0x3fafb4+_0x4d1e('0x8a')]=_0x154fd8;_0x56ade6(_0x154fd8);})[_0x4d1e('0xb')](function(_0x24ef4a){_0xa9a0bf(_0x24ef4a);});});}return _0x4942a4[_0x4d1e('0x8b')](_0x4d1e('0x8c'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x7c8542){var _0x21cf84={'raw':_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0x8e')],'where':{}};var _0x4d1f9e={};var _0x2782a9={'count':0x0,'rows':[]};var _0x2e87c6=_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0x8f')];var _0x5bb49c=_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0x90')]||![];var _0x4e751f=_0x5030ee(_0x2e87c6,_0x5bb49c);if(!_0x4e751f['childModel'])throw new Error(_0x4d1e('0x91')+_0x2e87c6+'\x27');var _0x2aec3=[{'name':_0x2e87c6}];if(!_[_0x4d1e('0x92')](_0x4e751f[_0x4d1e('0x19')]))_0x2aec3=_0x4e751f['parentSections'];var _0x221b73=[];for(var _0x49ab39=0x0;_0x49ab39<_0x2aec3[_0x4d1e('0x93')];_0x49ab39++){_0x221b73['push'](_0x556353[_0x4d1e('0x94')]['find']({'where':{'userProfileId':_0x7c8542[_0x4d1e('0x95')]['id'],'name':_0x2aec3[_0x49ab39][_0x4d1e('0xe')]},'raw':!![]}));}return Promise['all'](_0x221b73)[_0x4d1e('0x9')](function(_0x3484c0){var _0x9a18f2=_['filter'](_0x3484c0,function(_0x5f4b37){return _0x5f4b37?_0x5f4b37:undefined;});var _0x1e21fe=_['filter'](_0x2aec3,[_0x4d1e('0x96'),!![]]);var _0x5d66c8=_[_0x4d1e('0x92')](_0x9a18f2)&&_[_0x4d1e('0x92')](_0x1e21fe)?null:_[_0x4d1e('0x97')](_0x1e21fe,_0x9a18f2);if(!_0x5d66c8)return null;var _0xe826b9=[];for(var _0x28da35=0x0;_0x28da35<_0x5d66c8['length'];_0x28da35++){var _0x4ff276=_['find'](_0x2aec3,function(_0x28bc31){return _0x5d66c8[_0x28da35]?_0x28bc31[_0x4d1e('0xe')]===_0x5d66c8[_0x28da35]['name']:null;});if(_0x4ff276){if(_0x5d66c8[_0x28da35][_0x4d1e('0x96')]){_0xe826b9[_0x4d1e('0x98')](_0x43a035(_0x4e751f[_0x4d1e('0x17')],_0x5d66c8[_0x28da35]));}else{if(!_0x5d66c8[_0x28da35]['autoAssociation']){_0xe826b9[_0x4d1e('0x98')](_0x59a91e(_0x4ff276,_0x5d66c8[_0x28da35],_0x4e751f[_0x4d1e('0x17')]));}else{if(_0x4ff276[_0x4d1e('0xc')]){_0xe826b9[_0x4d1e('0x98')](_0x207bca(_0x4ff276,_0x5d66c8[_0x28da35]));}}}}}return Promise[_0x4d1e('0x99')](_0xe826b9);})['then'](function(_0xdd40bd){var _0x302f66=_0xdd40bd;var _0x480af8=null;if(_0x302f66){_0x480af8=_0x302f66['length']===0x1?_0x302f66[0x0]:null;}if(!_0x480af8&&!_0x302f66)return _0x2782a9;var _0x525a6a=_0x556353[_0x4e751f[_0x4d1e('0x17')]]['rawAttributes'];_0x4d1f9e[_0x4d1e('0xc')]=_['keys'](_0x525a6a);_0x4d1f9e['query']=_[_0x4d1e('0x9a')](_0x7c8542[_0x4d1e('0x8d')]);_0x4d1f9e[_0x4d1e('0x9b')]=_['intersection'](_0x4d1f9e[_0x4d1e('0xc')],_0x4d1f9e[_0x4d1e('0x8d')]);_0x21cf84['attributes']=_[_0x4d1e('0x9c')](_0x4d1f9e[_0x4d1e('0xc')],qs[_0x4d1e('0x9d')](_0x7c8542['query'][_0x4d1e('0x9d')]));_0x21cf84['attributes']=_0x21cf84[_0x4d1e('0x9e')]['length']?_0x21cf84['attributes']:_0x4d1f9e[_0x4d1e('0xc')];if(!_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0x9f')](_0x4d1e('0xa0'))){_0x21cf84[_0x4d1e('0xa1')]=qs[_0x4d1e('0xa1')](_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xa1')]);_0x21cf84['offset']=qs[_0x4d1e('0xa2')](_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xa2')]);}_0x21cf84['order']=qs[_0x4d1e('0xa3')](_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xa3')]);_0x21cf84[_0x4d1e('0xa4')]=qs[_0x4d1e('0x9b')](_['pick'](_0x7c8542[_0x4d1e('0x8d')],_0x4d1f9e[_0x4d1e('0x9b')]));if(_0x7c8542['query'][_0x4d1e('0x5')]){_0x21cf84['where']=_['merge'](_0x21cf84[_0x4d1e('0xa4')],{'$or':_[_0x4d1e('0xa')](_0x525a6a,function(_0x4498b4){if(_0x4498b4[_0x4d1e('0x13')][_0x4d1e('0xa5')]!==_0x4d1e('0xa6')){var _0xaac9c={};_0xaac9c[_0x4498b4['field']]={'$like':'%'+_0x7c8542['query']['filter']+'%'};return _0xaac9c;}})});}var _0x1ecb54=[];var _0x2ed31c=null;var _0xc62a85={};if(_0x480af8){_0x2ed31c=_[_0x4d1e('0xa7')](_0x2aec3,[_0x4d1e('0xe'),_0x480af8[_0x4d1e('0xe')]]);if(_0x2ed31c[_0x4d1e('0x6')]){_0xc62a85={};if(_0x4e751f[_0x4d1e('0x17')]===_0x4d1e('0x11')){_0xc62a85[_0x2ed31c[_0x4d1e('0xa8')]]=_[_0x4d1e('0xa')](_0x480af8[_0x4d1e('0xd')],'id');}else{_0xc62a85[_0x2ed31c[_0x4d1e('0xa8')]]=_0x480af8[_0x4d1e('0xd')];}_0x1ecb54[_0x4d1e('0x98')](_0xc62a85);}else{_0x21cf84[_0x4d1e('0xa4')]['id']=_0x480af8['associatedResources'];}}else{for(var _0x386539=0x0;_0x386539<_0x302f66[_0x4d1e('0x93')];_0x386539++){_0x2ed31c=_['find'](_0x2aec3,[_0x4d1e('0xe'),_0x302f66[_0x386539][_0x4d1e('0xe')]]);if(_0x2ed31c[_0x4d1e('0x6')]){_0xc62a85={};_0xc62a85[_0x2ed31c['foreignKey']]=_0x302f66[_0x386539]['associatedResources'];_0x1ecb54[_0x4d1e('0x98')](_0xc62a85);}else{if(!_0x21cf84['where']['id'])_0x21cf84['where']['id']=[];_0x302f66[_0x386539][_0x4d1e('0xd')][_0x4d1e('0xa9')](function(_0x4e3945){_0x21cf84[_0x4d1e('0xa4')]['id'][_0x4d1e('0x98')](_0x4e3945);});}}}if(!_[_0x4d1e('0x92')](_0x1ecb54)){_0x21cf84['where']=_[_0x4d1e('0xaa')](_0x21cf84[_0x4d1e('0xa4')],{'$and':{'$or':_0x1ecb54}});}_0x21cf84=_[_0x4d1e('0xaa')]({},_0x21cf84,_0x7c8542[_0x4d1e('0xab')]);if(_0x480af8&&!_0x480af8['autoAssociation']&&_0x4e751f[_0x4d1e('0x17')]==='AnalyticExtractedReport'){if(_0x7c8542['query'][_0x4d1e('0xac')]){_0x21cf84[_0x4d1e('0xad')]=[{'all':!![]}];}return _0x556353[_0x4e751f['childModel']][_0x4d1e('0x8')](_0x21cf84)[_0x4d1e('0x9')](function(_0xcf51de){var _0x22ed3e=[];_0xcf51de[_0x4d1e('0xa9')](function(_0x13528a){var _0x38b77a;switch(_0x13528a[_0x4d1e('0xae')]){case _0x4d1e('0xaf'):_0x38b77a=_['find'](_0x480af8['associatedResources'],function(_0x54f82b){return _0x54f82b['id']===_0x13528a[_0x4d1e('0x7a')]&&_0x54f82b[_0x4d1e('0x13')]===_0x4d1e('0xb0');});break;case'custom':_0x38b77a=_[_0x4d1e('0xa7')](_0x480af8['associatedResources'],function(_0xff2587){return _0xff2587['id']===_0x13528a[_0x4d1e('0x7a')]&&_0xff2587[_0x4d1e('0x13')]===_0x4d1e('0xb1');});break;}if(_0x38b77a)_0x22ed3e['push'](_0x13528a);});_0x2782a9[_0x4d1e('0xb2')]=_0x22ed3e[_0x4d1e('0x93')];_0x2782a9['rows']=_0x22ed3e;return _0x2782a9;});}else{return _0x556353[_0x4e751f[_0x4d1e('0x17')]]['count']({'where':_0x21cf84[_0x4d1e('0xa4')]})['then'](function(_0x16b2de){_0x2782a9[_0x4d1e('0xb2')]=_0x16b2de;if(_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xac')]){if(_0x4e751f[_0x4d1e('0x17')]===_0x4d1e('0x1f')){_0x21cf84[_0x4d1e('0xad')]=[{'model':_0x556353[_0x4d1e('0x6f')],'as':_0x4d1e('0xb3'),'attributes':['id','name',_0x4d1e('0xb4')],'required':_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xb5')]?!![]:![]},{'model':_0x556353[_0x4d1e('0x6f')],'as':'ThroughTags','attributes':['id',_0x4d1e('0xe'),_0x4d1e('0xb4')],'through':_0x7c8542[_0x4d1e('0x8d')][_0x4d1e('0xb5')]?{'attributes':[],'where':{'TagId':_0x7c8542[_0x4d1e('0x8d')]['tag']||undefined}}:{},'required':_0x7c8542['query'][_0x4d1e('0xb5')]?!![]:![]}];}else{_0x21cf84['include']=[{'all':!![]}];}}return _0x556353[_0x4e751f['childModel']][_0x4d1e('0x8')](_0x21cf84);})['then'](function(_0x3a6174){_0x2782a9[_0x4d1e('0xb6')]=_0x3a6174;if(_0x2e87c6==='Agents'&&_0x7c8542['query'][_0x4d1e('0xb7')]===_0x4d1e('0xb8')){var _0x43adcb=[];for(var _0x43636c=0x0;_0x43636c<_0x2782a9[_0x4d1e('0xb6')][_0x4d1e('0x93')];_0x43636c++){_0x43adcb[_0x4d1e('0x98')](_0x48ab2f(_0x4d1e('0xb9'),_0x2782a9[_0x4d1e('0xb6')][_0x43636c][_0x4d1e('0xba')]));_0x43adcb[_0x4d1e('0x98')](_0x48ab2f(_0x4d1e('0xbb'),_0x2782a9[_0x4d1e('0xb6')][_0x43636c][_0x4d1e('0xba')]));_0x43adcb[_0x4d1e('0x98')](_0x48ab2f(_0x4d1e('0xbc'),_0x2782a9[_0x4d1e('0xb6')][_0x43636c][_0x4d1e('0xba')]));_0x43adcb['push'](_0x48ab2f(_0x4d1e('0xbd'),_0x2782a9[_0x4d1e('0xb6')][_0x43636c][_0x4d1e('0xba')]));_0x43adcb['push'](_0x48ab2f(_0x4d1e('0xbe'),_0x2782a9['rows'][_0x43636c][_0x4d1e('0xba')]));_0x43adcb[_0x4d1e('0x98')](_0x48ab2f(_0x4d1e('0xbf'),_0x2782a9[_0x4d1e('0xb6')][_0x43636c]['dataValues']));}return Promise[_0x4d1e('0x99')](_0x43adcb)['then'](function(){return _0x2782a9;});}return _0x2782a9;});}});}}});}; \ No newline at end of file +var _0x4e2a=['voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','VoiceQueues','users','telephones','Users','admin','user','Agents','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','ui.createdAt','from','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','raw','isEmpty','length','push','UserProfileSection','params','all','find','ignore','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','key','foreignKey','forEach','options','includeAll','default','custom','CustomReports','count','rows','include','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','Lists','lists','CmCompany','globalcustomfields','chatqueues','ChatQueue','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','role','Telephones','telephone','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','chanspies'];(function(_0x2ad9f5,_0x37607e){var _0x59c214=function(_0x5bb776){while(--_0x5bb776){_0x2ad9f5['push'](_0x2ad9f5['shift']());}};_0x59c214(++_0x37607e);}(_0x4e2a,0x1df));var _0xa4e2=function(_0x4c0511,_0x23721f){_0x4c0511=_0x4c0511-0x0;var _0xd4e76b=_0x4e2a[_0x4c0511];return _0xd4e76b;};'use strict';var _=require(_0xa4e2('0x0'));var attributes=require(_0xa4e2('0x1'));var qs=require(_0xa4e2('0x2'));var squel=require(_0xa4e2('0x3'));module[_0xa4e2('0x4')]=function(_0x593633){var _0x485c24=_0x593633[_0xa4e2('0x5')];function _0x54bd3e(_0x5b2521,_0x26a5ed){return new Promise(function(_0x4a560d,_0x4250f7){if(!_0x26a5ed)return _0x4a560d(null);var _0xca7be7=_0x26a5ed[_0xa4e2('0x6')]?{[_0x26a5ed[_0xa4e2('0x6')][_0xa4e2('0x7')]]:_0x26a5ed['filter'][_0xa4e2('0x8')]}:undefined;return _0x485c24[_0x5b2521][_0xa4e2('0x9')]({'where':_0xca7be7,'raw':!![]})[_0xa4e2('0xa')](function(_0x28c529){_0x26a5ed['associatedResources']=_[_0xa4e2('0xb')](_0x28c529,'id');_0x4a560d(_0x26a5ed);})[_0xa4e2('0xc')](function(_0x1d573c){_0x4250f7(_0x1d573c);});});}function _0x5c0644(_0x14ec6d,_0x5a71ab){return new Promise(function(_0x3326a8,_0x305bd4){var _0x3eefe2=_0x14ec6d[_0xa4e2('0x6')]?{[_0x14ec6d[_0xa4e2('0x6')]['field']]:_0x14ec6d['filter'][_0xa4e2('0x8')]}:undefined;return _0x485c24[_0x14ec6d[_0xa4e2('0xd')]][_0xa4e2('0x9')]({'where':_0x3eefe2,'raw':!![]})['then'](function(_0x2f04d9){_0x5a71ab[_0xa4e2('0xe')]=_[_0xa4e2('0xb')](_0x2f04d9,function(_0x18c457){return _0x18c457['name'];});_0x3326a8(_0x5a71ab);})['catch'](function(_0x5a290a){_0x305bd4(_0x5a290a);});});}function _0x118355(_0x4bd63e,_0x179e42,_0x192c22){if(!_0x179e42)return Promise[_0xa4e2('0xf')](null);return new Promise(function(_0x2d66b7,_0x1d182e){return _0x485c24[_0xa4e2('0x10')]['findAll']({'where':{'sectionId':_0x179e42['id']},'raw':!![]})['then'](function(_0x5c7f97){if(_0x4bd63e[_0xa4e2('0x7')]&&_0x4bd63e[_0xa4e2('0x7')]!=='id'){_0x179e42[_0xa4e2('0xe')]=_[_0xa4e2('0xb')](_0x5c7f97,function(_0x2ffa03){return _0x2ffa03[_0x4bd63e[_0xa4e2('0x7')]];});}else{if(_0x192c22===_0xa4e2('0x11')){_0x179e42[_0xa4e2('0xe')]=_[_0xa4e2('0xb')](_0x5c7f97,function(_0x4e50f1){return{'id':_0x4e50f1[_0xa4e2('0x12')],'type':_0x4e50f1[_0xa4e2('0x13')]};});}else{_0x179e42['associatedResources']=_['map'](_0x5c7f97,function(_0x5ce77e){return _0x5ce77e[_0xa4e2('0x12')];});}}_0x2d66b7(_0x179e42);})[_0xa4e2('0xc')](function(_0x8d5201){_0x1d182e(_0x8d5201);});});}function _0x1488d0(_0x18b714,_0x44a471){var _0x64569d={'parentSections':[]};switch(_0x18b714[_0xa4e2('0x14')]()){case'squareprojects':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x16');break;case'odbc':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x17');break;case _0xa4e2('0x18'):_0x64569d[_0xa4e2('0x15')]='SquareRecording';_0x64569d['parentSections']=[{'name':_0xa4e2('0x19'),'field':_0xa4e2('0x1a'),'foreignKey':_0xa4e2('0x1b')}];break;case _0xa4e2('0x1c'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x1d');break;case _0xa4e2('0x1e'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x1f');_0x64569d[_0xa4e2('0x20')]=[{'name':_0xa4e2('0x21'),'field':'id','foreignKey':'ListId'}];break;case _0xa4e2('0x22'):_0x64569d[_0xa4e2('0x15')]='CmList';break;case'companies':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x23');break;case _0xa4e2('0x24'):_0x64569d['childModel']='CmCustomField';break;case _0xa4e2('0x25'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x26');break;case'chatwebsites':_0x64569d['childModel']='ChatWebsite';break;case'faxqueues':_0x64569d['childModel']=_0xa4e2('0x27');break;case _0xa4e2('0x28'):_0x64569d[_0xa4e2('0x15')]='FaxAccount';break;case _0xa4e2('0x29'):case _0xa4e2('0x2a'):case _0xa4e2('0x2b'):_0x64569d[_0xa4e2('0x15')]='VoiceExtension';break;case _0xa4e2('0x2c'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x2d');break;case _0xa4e2('0x2e'):_0x64569d[_0xa4e2('0x15')]='VoiceMail';break;case _0xa4e2('0x2f'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x30');_0x64569d[_0xa4e2('0x20')]=[{'name':'Agents','field':_0xa4e2('0x1a'),'foreignKey':_0xa4e2('0x31'),'model':_0xa4e2('0x32'),'filter':{'field':_0xa4e2('0x33'),'value':['agent']}},{'name':_0xa4e2('0x34'),'field':'name','foreignKey':_0xa4e2('0x31'),'model':'User','filter':{'field':'role','value':[_0xa4e2('0x35')]}},{'name':'VoiceQueues','field':_0xa4e2('0x1a'),'foreignKey':_0xa4e2('0x36'),'model':'VoiceQueue','filter':{'field':_0xa4e2('0x13'),'value':[_0xa4e2('0x37')]}},{'name':_0xa4e2('0x38'),'field':'name','foreignKey':_0xa4e2('0x36'),'model':_0xa4e2('0x39'),'filter':{'field':_0xa4e2('0x13'),'value':[_0xa4e2('0x3a')]}}];break;case _0xa4e2('0x3b'):_0x64569d[_0xa4e2('0x15')]='VoiceMusicOnHold';break;case _0xa4e2('0x3c'):_0x64569d[_0xa4e2('0x15')]='VoiceChanSpy';break;case _0xa4e2('0x3d'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x3e');break;case _0xa4e2('0x3f'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x40');break;case _0xa4e2('0x41'):_0x64569d['childModel']=_0xa4e2('0x42');break;case _0xa4e2('0x43'):_0x64569d['childModel']='MailAccount';break;case _0xa4e2('0x44'):_0x64569d[_0xa4e2('0x15')]='MailSubstatus';break;case'openchannelqueues':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x45');break;case _0xa4e2('0x46'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x47');break;case'smsqueues':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x48');break;case'smsaccounts':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x49');break;case _0xa4e2('0x4a'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x4b');break;case'whatsappaccounts':_0x64569d['childModel']=_0xa4e2('0x4c');break;case _0xa4e2('0x4d'):_0x64569d['childModel']=_0xa4e2('0x4e');break;case _0xa4e2('0x4f'):case'queuecampaigns':_0x64569d[_0xa4e2('0x15')]='VoiceQueue';if(_0x44a471){_0x64569d[_0xa4e2('0x20')]=[{'name':_0xa4e2('0x50')},{'name':_0xa4e2('0x38')}];}break;case _0xa4e2('0x51'):case'agents':case _0xa4e2('0x52'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x32');if(_0x44a471){_0x64569d['parentSections']=[{'name':_0xa4e2('0x53'),'filter':{'field':_0xa4e2('0x33'),'value':[_0xa4e2('0x54'),_0xa4e2('0x55')]},'ignore':!![]},{'name':_0xa4e2('0x56')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x64569d[_0xa4e2('0x15')]='ZendeskAccount';break;case _0xa4e2('0x57'):_0x64569d['childModel']=_0xa4e2('0x58');break;case _0xa4e2('0x59'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x5a');break;case'sugarcrmaccounts':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x5b');break;case _0xa4e2('0x5c'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x5d');break;case _0xa4e2('0x5e'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x5f');break;case _0xa4e2('0x60'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x32');break;case _0xa4e2('0x61'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x62');break;case _0xa4e2('0x63'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x64');break;case _0xa4e2('0x65'):_0x64569d[_0xa4e2('0x15')]='Dashboard';break;case _0xa4e2('0x66'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x67');break;case'pauses':_0x64569d['childModel']=_0xa4e2('0x68');break;case _0xa4e2('0x69'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x6a');break;case'sounds':_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x6b');break;case _0xa4e2('0x6c'):_0x64569d['childModel']=_0xa4e2('0x6d');break;case _0xa4e2('0x6e'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x6f');break;case _0xa4e2('0x70'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x71');break;case'trunks':_0x64569d['childModel']=_0xa4e2('0x72');break;case _0xa4e2('0x73'):_0x64569d['childModel']=_0xa4e2('0x74');break;case _0xa4e2('0x75'):_0x64569d[_0xa4e2('0x15')]='Plugin';break;case _0xa4e2('0x76'):_0x64569d[_0xa4e2('0x15')]=_0xa4e2('0x11');_0x64569d[_0xa4e2('0x20')]=[{'name':_0xa4e2('0x77'),'field':'id','foreignKey':_0xa4e2('0x78')}];break;case _0xa4e2('0x79'):_0x64569d[_0xa4e2('0x15')]='AnalyticMetric';break;}return _0x64569d;}function _0x1b2433(_0x34eb65,_0x339ddb){var _0x1e7c8d=_0x34eb65['charAt'](0x0)[_0xa4e2('0x7a')]()+_0x34eb65[_0xa4e2('0x7b')](0x1);var _0x40ce20={'type':_0x485c24[_0xa4e2('0x7c')][_0xa4e2('0x7d')]['SELECT'],'raw':!![]};return new Promise(function(_0x206e78,_0x3d537d){var _0x1d0586=squel[_0xa4e2('0x7e')]()[_0xa4e2('0x7')](_0xa4e2('0x7f')+_0x1e7c8d+'InteractionId','id')[_0xa4e2('0x7')](_0xa4e2('0x80'))[_0xa4e2('0x81')]('user_has_'+_0x34eb65+'_interactions','ui')['where'](_0xa4e2('0x82'),_0x339ddb['id']);return _0x485c24[_0xa4e2('0x83')][_0xa4e2('0x84')](_0x1d0586['toString'](),_0x40ce20)[_0xa4e2('0xa')](function(_0x27bda0){_0x339ddb[_0x1e7c8d+'OpenTabs']=_0x27bda0;_0x206e78(_0x27bda0);})[_0xa4e2('0xc')](function(_0xf3f24f){_0x3d537d(_0xf3f24f);});});}return _0x593633[_0xa4e2('0x85')](_0xa4e2('0x86'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x580df7){var _0x3e9542={'raw':_0x580df7[_0xa4e2('0x84')][_0xa4e2('0x87')],'where':{}};var _0x351b54={};var _0x20ae6c={'count':0x0,'rows':[]};var _0x68f861=_0x580df7[_0xa4e2('0x84')]['section'];var _0x10134a=_0x580df7[_0xa4e2('0x84')]['mergeResources']||![];var _0x42fb9d=_0x1488d0(_0x68f861,_0x10134a);if(!_0x42fb9d[_0xa4e2('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x68f861+'\x27');var _0x3c93e8=[{'name':_0x68f861}];if(!_[_0xa4e2('0x88')](_0x42fb9d[_0xa4e2('0x20')]))_0x3c93e8=_0x42fb9d[_0xa4e2('0x20')];var _0xedebf1=[];for(var _0x570406=0x0;_0x570406<_0x3c93e8[_0xa4e2('0x89')];_0x570406++){_0xedebf1[_0xa4e2('0x8a')](_0x485c24[_0xa4e2('0x8b')]['find']({'where':{'userProfileId':_0x580df7[_0xa4e2('0x8c')]['id'],'name':_0x3c93e8[_0x570406][_0xa4e2('0x1a')]},'raw':!![]}));}return Promise[_0xa4e2('0x8d')](_0xedebf1)[_0xa4e2('0xa')](function(_0x57987c){var _0x5b31bc=_[_0xa4e2('0x6')](_0x57987c,function(_0x44e557){return _0x44e557?_0x44e557:undefined;});var _0xed638b=_['filter'](_0x3c93e8,['ignore',!![]]);var _0x330d3c=_[_0xa4e2('0x88')](_0x5b31bc)&&_['isEmpty'](_0xed638b)?null:_['union'](_0xed638b,_0x5b31bc);if(!_0x330d3c)return null;var _0x40a4ea=[];for(var _0x1ba886=0x0;_0x1ba886<_0x330d3c[_0xa4e2('0x89')];_0x1ba886++){var _0x5423c8=_[_0xa4e2('0x8e')](_0x3c93e8,function(_0x59ffc1){return _0x330d3c[_0x1ba886]?_0x59ffc1[_0xa4e2('0x1a')]===_0x330d3c[_0x1ba886][_0xa4e2('0x1a')]:null;});if(_0x5423c8){if(_0x330d3c[_0x1ba886][_0xa4e2('0x8f')]){_0x40a4ea[_0xa4e2('0x8a')](_0x54bd3e(_0x42fb9d[_0xa4e2('0x15')],_0x330d3c[_0x1ba886]));}else{if(!_0x330d3c[_0x1ba886][_0xa4e2('0x90')]){_0x40a4ea[_0xa4e2('0x8a')](_0x118355(_0x5423c8,_0x330d3c[_0x1ba886],_0x42fb9d[_0xa4e2('0x15')]));}else{if(_0x5423c8[_0xa4e2('0xd')]){_0x40a4ea['push'](_0x5c0644(_0x5423c8,_0x330d3c[_0x1ba886]));}}}}}return Promise['all'](_0x40a4ea);})[_0xa4e2('0xa')](function(_0x287b40){var _0x306098=_0x287b40;var _0x1f0a2d=null;if(_0x306098){_0x1f0a2d=_0x306098[_0xa4e2('0x89')]===0x1?_0x306098[0x0]:null;}if(!_0x1f0a2d&&!_0x306098)return _0x20ae6c;var _0x1f6247=_0x485c24[_0x42fb9d[_0xa4e2('0x15')]]['rawAttributes'];_0x351b54[_0xa4e2('0xd')]=_[_0xa4e2('0x91')](_0x1f6247);_0x351b54['query']=_['keys'](_0x580df7['query']);_0x351b54[_0xa4e2('0x92')]=_['intersection'](_0x351b54[_0xa4e2('0xd')],_0x351b54[_0xa4e2('0x84')]);_0x3e9542['attributes']=_[_0xa4e2('0x93')](_0x351b54[_0xa4e2('0xd')],qs[_0xa4e2('0x94')](_0x580df7['query']['fields']));_0x3e9542[_0xa4e2('0x95')]=_0x3e9542[_0xa4e2('0x95')]['length']?_0x3e9542['attributes']:_0x351b54[_0xa4e2('0xd')];if(!_0x580df7['query'][_0xa4e2('0x96')](_0xa4e2('0x97'))){_0x3e9542['limit']=qs['limit'](_0x580df7[_0xa4e2('0x84')][_0xa4e2('0x98')]);_0x3e9542[_0xa4e2('0x99')]=qs[_0xa4e2('0x99')](_0x580df7['query'][_0xa4e2('0x99')]);}_0x3e9542[_0xa4e2('0x9a')]=qs[_0xa4e2('0x9b')](_0x580df7[_0xa4e2('0x84')]['sort']);_0x3e9542['where']=qs['filters'](_[_0xa4e2('0x9c')](_0x580df7[_0xa4e2('0x84')],_0x351b54[_0xa4e2('0x92')]));if(_0x580df7[_0xa4e2('0x84')][_0xa4e2('0x6')]){_0x3e9542[_0xa4e2('0x9d')]=_['merge'](_0x3e9542['where'],{'$or':_[_0xa4e2('0xb')](_0x1f6247,function(_0x251313){if(_0x251313[_0xa4e2('0x13')][_0xa4e2('0x9e')]!=='VIRTUAL'){var _0x33843e={};_0x33843e[_0x251313[_0xa4e2('0x7')]]={'$like':'%'+_0x580df7[_0xa4e2('0x84')][_0xa4e2('0x6')]+'%'};return _0x33843e;}})});}var _0x2b95db=[];var _0x40e2c9=null;var _0x50f142={};if(_0x1f0a2d){_0x40e2c9=_['find'](_0x3c93e8,['name',_0x1f0a2d[_0xa4e2('0x1a')]]);if(_0x40e2c9[_0xa4e2('0x7')]){_0x50f142={};if(_0x42fb9d[_0xa4e2('0x15')]===_0xa4e2('0x11')){_0x50f142[_0x40e2c9[_0xa4e2('0x9f')]]=_[_0xa4e2('0xb')](_0x1f0a2d[_0xa4e2('0xe')],'id');}else{_0x50f142[_0x40e2c9[_0xa4e2('0x9f')]]=_0x1f0a2d[_0xa4e2('0xe')];}_0x2b95db[_0xa4e2('0x8a')](_0x50f142);}else{_0x3e9542[_0xa4e2('0x9d')]['id']=_0x1f0a2d['associatedResources'];}}else{for(var _0x7edf12=0x0;_0x7edf12<_0x306098[_0xa4e2('0x89')];_0x7edf12++){_0x40e2c9=_[_0xa4e2('0x8e')](_0x3c93e8,['name',_0x306098[_0x7edf12][_0xa4e2('0x1a')]]);if(_0x40e2c9[_0xa4e2('0x7')]){_0x50f142={};_0x50f142[_0x40e2c9[_0xa4e2('0x9f')]]=_0x306098[_0x7edf12][_0xa4e2('0xe')];_0x2b95db[_0xa4e2('0x8a')](_0x50f142);}else{if(!_0x3e9542[_0xa4e2('0x9d')]['id'])_0x3e9542[_0xa4e2('0x9d')]['id']=[];_0x306098[_0x7edf12]['associatedResources'][_0xa4e2('0xa0')](function(_0x32d598){_0x3e9542[_0xa4e2('0x9d')]['id'][_0xa4e2('0x8a')](_0x32d598);});}}}if(!_['isEmpty'](_0x2b95db)){_0x3e9542[_0xa4e2('0x9d')]=_['merge'](_0x3e9542[_0xa4e2('0x9d')],{'$and':{'$or':_0x2b95db}});}_0x3e9542=_['merge']({},_0x3e9542,_0x580df7[_0xa4e2('0xa1')]);if(_0x1f0a2d&&!_0x1f0a2d[_0xa4e2('0x90')]&&_0x42fb9d['childModel']===_0xa4e2('0x11')){if(_0x580df7[_0xa4e2('0x84')][_0xa4e2('0xa2')]){_0x3e9542['include']=[{'all':!![]}];}return _0x485c24[_0x42fb9d['childModel']][_0xa4e2('0x9')](_0x3e9542)[_0xa4e2('0xa')](function(_0x322afd){var _0xdb0a87=[];_0x322afd[_0xa4e2('0xa0')](function(_0x280a62){var _0x99e978;switch(_0x280a62['reportType']){case _0xa4e2('0xa3'):_0x99e978=_['find'](_0x1f0a2d['associatedResources'],function(_0x4542b8){return _0x4542b8['id']===_0x280a62[_0xa4e2('0x78')]&&_0x4542b8['type']==='DefaultReports';});break;case _0xa4e2('0xa4'):_0x99e978=_['find'](_0x1f0a2d['associatedResources'],function(_0x54f84c){return _0x54f84c['id']===_0x280a62[_0xa4e2('0x78')]&&_0x54f84c[_0xa4e2('0x13')]===_0xa4e2('0xa5');});break;}if(_0x99e978)_0xdb0a87['push'](_0x280a62);});_0x20ae6c[_0xa4e2('0xa6')]=_0xdb0a87[_0xa4e2('0x89')];_0x20ae6c[_0xa4e2('0xa7')]=_0xdb0a87;return _0x20ae6c;});}else{return _0x485c24[_0x42fb9d['childModel']][_0xa4e2('0xa6')]({'where':_0x3e9542['where']})[_0xa4e2('0xa')](function(_0x57061b){_0x20ae6c[_0xa4e2('0xa6')]=_0x57061b;if(_0x580df7[_0xa4e2('0x84')]['includeAll']){if(_0x42fb9d[_0xa4e2('0x15')]===_0xa4e2('0x1f')){_0x3e9542[_0xa4e2('0xa8')]=[{'model':_0x485c24[_0xa4e2('0x6d')],'as':'Tags','attributes':['id',_0xa4e2('0x1a'),_0xa4e2('0xa9')],'required':_0x580df7[_0xa4e2('0x84')][_0xa4e2('0xaa')]?!![]:![]},{'model':_0x485c24[_0xa4e2('0x6d')],'as':_0xa4e2('0xab'),'attributes':['id',_0xa4e2('0x1a'),_0xa4e2('0xa9')],'through':_0x580df7['query'][_0xa4e2('0xaa')]?{'attributes':[],'where':{'TagId':_0x580df7[_0xa4e2('0x84')][_0xa4e2('0xaa')]||undefined}}:{},'required':_0x580df7[_0xa4e2('0x84')]['tag']?!![]:![]}];}else{_0x3e9542['include']=[{'all':!![]}];}}return _0x485c24[_0x42fb9d['childModel']][_0xa4e2('0x9')](_0x3e9542);})['then'](function(_0x249cad){_0x20ae6c['rows']=_0x249cad;if(_0x68f861==='Agents'&&_0x580df7[_0xa4e2('0x84')][_0xa4e2('0xac')]===_0xa4e2('0xad')){var _0xef6707=[];for(var _0x1d7c71=0x0;_0x1d7c71<_0x20ae6c['rows'][_0xa4e2('0x89')];_0x1d7c71++){_0xef6707[_0xa4e2('0x8a')](_0x1b2433('chat',_0x20ae6c[_0xa4e2('0xa7')][_0x1d7c71][_0xa4e2('0xae')]));_0xef6707[_0xa4e2('0x8a')](_0x1b2433(_0xa4e2('0xaf'),_0x20ae6c['rows'][_0x1d7c71][_0xa4e2('0xae')]));_0xef6707[_0xa4e2('0x8a')](_0x1b2433(_0xa4e2('0xb0'),_0x20ae6c['rows'][_0x1d7c71][_0xa4e2('0xae')]));_0xef6707['push'](_0x1b2433(_0xa4e2('0xb1'),_0x20ae6c[_0xa4e2('0xa7')][_0x1d7c71][_0xa4e2('0xae')]));_0xef6707[_0xa4e2('0x8a')](_0x1b2433(_0xa4e2('0xb2'),_0x20ae6c[_0xa4e2('0xa7')][_0x1d7c71][_0xa4e2('0xae')]));_0xef6707[_0xa4e2('0x8a')](_0x1b2433(_0xa4e2('0xb3'),_0x20ae6c['rows'][_0x1d7c71][_0xa4e2('0xae')]));}return Promise['all'](_0xef6707)['then'](function(){return _0x20ae6c;});}return _0x20ae6c;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5d22feb..e853d9f 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 _0x4279=['redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x2c32ad,_0x1a12d4){var _0x1d474f=function(_0xa83df7){while(--_0xa83df7){_0x2c32ad['push'](_0x2c32ad['shift']());}};_0x1d474f(++_0x1a12d4);}(_0x4279,0x8d));var _0x9427=function(_0x78cbc7,_0x37cf46){_0x78cbc7=_0x78cbc7-0x0;var _0x4058e4=_0x4279[_0x78cbc7];return _0x4058e4;};'use strict';var _=require('lodash');var util=require(_0x9427('0x0'));var moment=require(_0x9427('0x1'));var BPromise=require('bluebird');var rs=require(_0x9427('0x2'));var fs=require('fs');var Redis=require(_0x9427('0x3'));var db=require(_0x9427('0x4'))['db'];var utils=require(_0x9427('0x5'));var logger=require('../../config/logger')(_0x9427('0x6'));var config=require('../../config/environment');var jayson=require(_0x9427('0x7'));var client=jayson[_0x9427('0x8')]['http']({'port':0x232a});config[_0x9427('0x9')]=_[_0x9427('0xa')](config[_0x9427('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9427('0xb'))(new Redis(config['redis']));require(_0x9427('0xc'))['register'](socket);function respondWithRpcPromise(_0x559a48,_0xc62445,_0x12b94e){return new BPromise(function(_0xfe89e1,_0x2aff5b){return client[_0x9427('0xd')](_0x559a48,_0x12b94e)[_0x9427('0xe')](function(_0x4f1a57){logger[_0x9427('0xf')]('UserProfile,\x20%s,\x20%s',_0xc62445,_0x9427('0x10'));logger[_0x9427('0x11')](_0x9427('0x12'),_0xc62445,_0x9427('0x10'),JSON[_0x9427('0x13')](_0x4f1a57));if(_0x4f1a57[_0x9427('0x14')]){if(_0x4f1a57[_0x9427('0x14')][_0x9427('0x15')]===0x1f4){logger[_0x9427('0x14')](_0x9427('0x16'),_0xc62445,_0x4f1a57[_0x9427('0x14')][_0x9427('0x17')]);return _0x2aff5b(_0x4f1a57[_0x9427('0x14')]['message']);}logger[_0x9427('0x14')](_0x9427('0x16'),_0xc62445,_0x4f1a57[_0x9427('0x14')]['message']);return _0xfe89e1(_0x4f1a57['error'][_0x9427('0x17')]);}else{logger['info'](_0x9427('0x16'),_0xc62445,_0x9427('0x10'));_0xfe89e1(_0x4f1a57['result']['message']);}})[_0x9427('0x18')](function(_0xd64381){logger[_0x9427('0x14')](_0x9427('0x16'),_0xc62445,_0xd64381);_0x2aff5b(_0xd64381);});});} \ No newline at end of file +var _0x7c1a=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x39051f,_0x38ef3f){var _0x41ae14=function(_0x1427e3){while(--_0x1427e3){_0x39051f['push'](_0x39051f['shift']());}};_0x41ae14(++_0x38ef3f);}(_0x7c1a,0x159));var _0xa7c1=function(_0x4f9b35,_0x14d869){_0x4f9b35=_0x4f9b35-0x0;var _0x243002=_0x7c1a[_0x4f9b35];return _0x243002;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var moment=require(_0xa7c1('0x2'));var BPromise=require(_0xa7c1('0x3'));var rs=require(_0xa7c1('0x4'));var fs=require('fs');var Redis=require(_0xa7c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c1('0x6'));var logger=require(_0xa7c1('0x7'))('rpc');var config=require(_0xa7c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7c1('0x9')][_0xa7c1('0xa')]({'port':0x232a});config[_0xa7c1('0xb')]=_[_0xa7c1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c1('0xd'))(new Redis(config[_0xa7c1('0xb')]));require(_0xa7c1('0xe'))['register'](socket);function respondWithRpcPromise(_0x3cdeaa,_0x16bf94,_0x359454){return new BPromise(function(_0x4f2957,_0x169d72){return client[_0xa7c1('0xf')](_0x3cdeaa,_0x359454)['then'](function(_0x309790){logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));logger[_0xa7c1('0x12')](_0xa7c1('0x13'),_0x16bf94,_0xa7c1('0x11'),JSON[_0xa7c1('0x14')](_0x309790));if(_0x309790[_0xa7c1('0x15')]){if(_0x309790[_0xa7c1('0x15')][_0xa7c1('0x16')]===0x1f4){logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x169d72(_0x309790[_0xa7c1('0x15')]['message']);}logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x4f2957(_0x309790[_0xa7c1('0x15')]['message']);}else{logger[_0xa7c1('0x10')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));_0x4f2957(_0x309790[_0xa7c1('0x19')]['message']);}})[_0xa7c1('0x1a')](function(_0x19198b){logger[_0xa7c1('0x15')]('UserProfile,\x20%s,\x20%s',_0x16bf94,_0x19198b);_0x169d72(_0x19198b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d7943b5..76a86a2 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 _0x69d8=['register','userProfile:','save','remove','update','emit','removeListener'];(function(_0x584131,_0x7378a7){var _0x522ded=function(_0x355f01){while(--_0x355f01){_0x584131['push'](_0x584131['shift']());}};_0x522ded(++_0x7378a7);}(_0x69d8,0x8e));var _0x869d=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x69d8[_0x2f7d18];return _0x425175;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x869d('0x0'),_0x869d('0x1'),_0x869d('0x2')];function createListener(_0x2b8ad2,_0x572114){return function(_0x396448){_0x572114[_0x869d('0x3')](_0x2b8ad2,_0x396448);};}function removeListener(_0x2ab698,_0x225078){return function(){UserProfileEvents[_0x869d('0x4')](_0x2ab698,_0x225078);};}exports[_0x869d('0x5')]=function(_0x3fef6e){for(var _0x58ee2a=0x0,_0x421cf3=events['length'];_0x58ee2a<_0x421cf3;_0x58ee2a++){var _0x279588=events[_0x58ee2a];var _0x48053c=createListener(_0x869d('0x6')+_0x279588,_0x3fef6e);UserProfileEvents['on'](_0x279588,_0x48053c);}}; \ No newline at end of file +var _0xa1e2=['remove','emit','removeListener','register','length','userProfile:','./userProfile.events','save'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa1e2,0xce));var _0x2a1e=function(_0x731a06,_0x41a566){_0x731a06=_0x731a06-0x0;var _0x1cca65=_0xa1e2[_0x731a06];return _0x1cca65;};'use strict';var UserProfileEvents=require(_0x2a1e('0x0'));var events=[_0x2a1e('0x1'),_0x2a1e('0x2'),'update'];function createListener(_0x560d03,_0x1514f9){return function(_0x3f3736){_0x1514f9[_0x2a1e('0x3')](_0x560d03,_0x3f3736);};}function removeListener(_0x28d322,_0x5c7dba){return function(){UserProfileEvents[_0x2a1e('0x4')](_0x28d322,_0x5c7dba);};}exports[_0x2a1e('0x5')]=function(_0x1c14cb){for(var _0x1c6e46=0x0,_0x54791b=events[_0x2a1e('0x6')];_0x1c6e46<_0x54791b;_0x1c6e46++){var _0x5e08da=events[_0x1c6e46];var _0x5e7f6e=createListener(_0x2a1e('0x7')+_0x5e08da,_0x1c14cb);UserProfileEvents['on'](_0x5e08da,_0x5e7f6e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 42505a2..4c13df2 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 _0xb17d=['delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5c6cf5,_0x782e49){var _0x17913a=function(_0x59b199){while(--_0x59b199){_0x5c6cf5['push'](_0x5c6cf5['shift']());}};_0x17913a(++_0x782e49);}(_0xb17d,0xab));var _0xdb17=function(_0x6beac1,_0x3a261b){_0x6beac1=_0x6beac1-0x0;var _0x220136=_0xb17d[_0x6beac1];return _0x220136;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb17('0x0'));var timeout=require(_0xdb17('0x1'));var express=require(_0xdb17('0x2'));var router=express['Router']();var fs_extra=require(_0xdb17('0x3'));var auth=require(_0xdb17('0x4'));var interaction=require(_0xdb17('0x5'));var config=require(_0xdb17('0x6'));var controller=require('./userProfileResource.controller');router[_0xdb17('0x7')]('/',auth[_0xdb17('0x8')](),controller[_0xdb17('0x9')]);router[_0xdb17('0x7')](_0xdb17('0xa'),auth[_0xdb17('0x8')](),controller[_0xdb17('0xb')]);router[_0xdb17('0x7')](_0xdb17('0xc'),auth[_0xdb17('0x8')](),controller[_0xdb17('0xd')]);router[_0xdb17('0xe')]('/',auth['isAuthenticated'](),controller[_0xdb17('0xf')]);router[_0xdb17('0x10')](_0xdb17('0xc'),auth['isAuthenticated'](),controller[_0xdb17('0x11')]);router[_0xdb17('0x12')]('/:id',auth[_0xdb17('0x8')](),controller[_0xdb17('0x13')]);module[_0xdb17('0x14')]=router; \ No newline at end of file +var _0x70a6=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','destroy','multer'];(function(_0x4888c9,_0x23072d){var _0x8b9eb8=function(_0x468e5b){while(--_0x468e5b){_0x4888c9['push'](_0x4888c9['shift']());}};_0x8b9eb8(++_0x23072d);}(_0x70a6,0x1c7));var _0x670a=function(_0x889022,_0x16f19f){_0x889022=_0x889022-0x0;var _0x4d9ead=_0x70a6[_0x889022];return _0x4d9ead;};'use strict';var multer=require(_0x670a('0x0'));var util=require(_0x670a('0x1'));var path=require(_0x670a('0x2'));var timeout=require('connect-timeout');var express=require(_0x670a('0x3'));var router=express[_0x670a('0x4')]();var fs_extra=require(_0x670a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x670a('0x6'));var config=require(_0x670a('0x7'));var controller=require(_0x670a('0x8'));router[_0x670a('0x9')]('/',auth[_0x670a('0xa')](),controller['index']);router[_0x670a('0x9')](_0x670a('0xb'),auth[_0x670a('0xa')](),controller[_0x670a('0xc')]);router[_0x670a('0x9')](_0x670a('0xd'),auth[_0x670a('0xa')](),controller[_0x670a('0xe')]);router[_0x670a('0xf')]('/',auth[_0x670a('0xa')](),controller[_0x670a('0x10')]);router['put'](_0x670a('0xd'),auth[_0x670a('0xa')](),controller[_0x670a('0x11')]);router['delete'](_0x670a('0xd'),auth[_0x670a('0xa')](),controller[_0x670a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index cda4c68..246d72e 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 _0x4276=['STRING','INTEGER','sequelize','exports'];(function(_0x4cdd5a,_0x57e480){var _0x4133d9=function(_0x3c3f4b){while(--_0x3c3f4b){_0x4cdd5a['push'](_0x4cdd5a['shift']());}};_0x4133d9(++_0x57e480);}(_0x4276,0xca));var _0x6427=function(_0x3a613e,_0x23eea5){_0x3a613e=_0x3a613e-0x0;var _0x5cf308=_0x4276[_0x3a613e];return _0x5cf308;};'use strict';var Sequelize=require(_0x6427('0x0'));module[_0x6427('0x1')]={'name':{'type':Sequelize[_0x6427('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6427('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x6427('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf2ba=['STRING','INTEGER','sequelize'];(function(_0x45723f,_0x5d914c){var _0x2be279=function(_0x27bcdd){while(--_0x27bcdd){_0x45723f['push'](_0x45723f['shift']());}};_0x2be279(++_0x5d914c);}(_0xf2ba,0xe9));var _0xaf2b=function(_0x1bb939,_0x5905e9){_0x1bb939=_0x1bb939-0x0;var _0xf8e8a6=_0xf2ba[_0x1bb939];return _0xf8e8a6;};'use strict';var Sequelize=require(_0xaf2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf2b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xaf2b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaf2b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 7e329d4..9971269 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 _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','UserProfileResource','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x348e74,_0x1ff546){var _0x45b264=function(_0x323a22){while(--_0x323a22){_0x348e74['push'](_0x348e74['shift']());}};_0x45b264(++_0x1ff546);}(_0xd117,0x182));var _0x7d11=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xd117[_0x56825b];return _0x69ce77;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['UserProfileResource'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));}; \ No newline at end of file +var _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 07d69ff..8ab1485 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 _0x8a8b=['compositeIndex','resourceId','sectionId','../../config/logger','api','moment','path','rimraf','../../config/environment','UserProfileResource','user_profile_has_resources'];(function(_0x414371,_0x50aff4){var _0x216784=function(_0x20d00e){while(--_0x20d00e){_0x414371['push'](_0x414371['shift']());}};_0x216784(++_0x50aff4);}(_0x8a8b,0x66));var _0xb8a8=function(_0x106a1c,_0x404b13){_0x106a1c=_0x106a1c-0x0;var _0x4fceb4=_0x8a8b[_0x106a1c];return _0x4fceb4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb8a8('0x0'))(_0xb8a8('0x1'));var moment=require(_0xb8a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8a8('0x3'));var rimraf=require(_0xb8a8('0x4'));var config=require(_0xb8a8('0x5'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x1981bc,_0x35796f){return _0x1981bc['define'](_0xb8a8('0x6'),attributes,{'tableName':_0xb8a8('0x7'),'paranoid':![],'indexes':[{'name':_0xb8a8('0x8'),'fields':[_0xb8a8('0x9'),_0xb8a8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf3b=['exports','define','UserProfileResource','user_profile_has_resources','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x5c448c,_0x1480e9){var _0x570ac3=function(_0x52c8af){while(--_0x52c8af){_0x5c448c['push'](_0x5c448c['shift']());}};_0x570ac3(++_0x1480e9);}(_0xaf3b,0xe5));var _0xbaf3=function(_0x3fdb62,_0x2e5f98){_0x3fdb62=_0x3fdb62-0x0;var _0x8f3787=_0xaf3b[_0x3fdb62];return _0x8f3787;};'use strict';var _=require(_0xbaf3('0x0'));var util=require(_0xbaf3('0x1'));var logger=require(_0xbaf3('0x2'))(_0xbaf3('0x3'));var moment=require(_0xbaf3('0x4'));var BPromise=require(_0xbaf3('0x5'));var rp=require(_0xbaf3('0x6'));var fs=require('fs');var path=require(_0xbaf3('0x7'));var rimraf=require(_0xbaf3('0x8'));var config=require(_0xbaf3('0x9'));var attributes=require(_0xbaf3('0xa'));module[_0xbaf3('0xb')]=function(_0x24cdb2,_0x4783e7){return _0x24cdb2[_0xbaf3('0xc')](_0xbaf3('0xd'),attributes,{'tableName':_0xbaf3('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xbaf3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e9d204b..a912fe0 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 _0x54b0=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','request'];(function(_0x518d5f,_0x2401ae){var _0x518b99=function(_0x1276bc){while(--_0x1276bc){_0x518d5f['push'](_0x518d5f['shift']());}};_0x518b99(++_0x2401ae);}(_0x54b0,0xbf));var _0x054b=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x54b0[_0x5f46e7];return _0x567e95;};'use strict';var _=require('lodash');var util=require(_0x054b('0x0'));var moment=require(_0x054b('0x1'));var BPromise=require(_0x054b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x054b('0x3'));var db=require(_0x054b('0x4'))['db'];var utils=require(_0x054b('0x5'));var logger=require('../../config/logger')(_0x054b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x054b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8cb1b9,_0x350321,_0xe34f85){return new BPromise(function(_0x8a6bb4,_0x1a7110){return client[_0x054b('0x8')](_0x8cb1b9,_0xe34f85)[_0x054b('0x9')](function(_0x4264da){logger[_0x054b('0xa')](_0x054b('0xb'),_0x350321,_0x054b('0xc'));logger[_0x054b('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x350321,_0x054b('0xc'),JSON[_0x054b('0xe')](_0x4264da));if(_0x4264da['error']){if(_0x4264da[_0x054b('0xf')][_0x054b('0x10')]===0x1f4){logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x4264da[_0x054b('0xf')]['message']);return _0x1a7110(_0x4264da['error'][_0x054b('0x11')]);}logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x4264da[_0x054b('0xf')][_0x054b('0x11')]);return _0x8a6bb4(_0x4264da[_0x054b('0xf')][_0x054b('0x11')]);}else{logger[_0x054b('0xa')](_0x054b('0xb'),_0x350321,_0x054b('0xc'));_0x8a6bb4(_0x4264da[_0x054b('0x12')][_0x054b('0x11')]);}})[_0x054b('0x13')](function(_0x27499a){logger[_0x054b('0xf')](_0x054b('0xb'),_0x350321,_0x27499a);_0x1a7110(_0x27499a);});});} \ No newline at end of file +var _0xfc56=['message','info','result','catch','lodash','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s'];(function(_0x34635a,_0x1fdb39){var _0x4187f8=function(_0x29ec09){while(--_0x29ec09){_0x34635a['push'](_0x34635a['shift']());}};_0x4187f8(++_0x1fdb39);}(_0xfc56,0xac));var _0x6fc5=function(_0x10c035,_0x3e7076){_0x10c035=_0x10c035-0x0;var _0x51eb2b=_0xfc56[_0x10c035];return _0x51eb2b;};'use strict';var _=require(_0x6fc5('0x0'));var util=require(_0x6fc5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6fc5('0x2'));var fs=require('fs');var Redis=require(_0x6fc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6fc5('0x4'));var config=require(_0x6fc5('0x5'));var jayson=require(_0x6fc5('0x6'));var client=jayson[_0x6fc5('0x7')][_0x6fc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x276170,_0x57e998,_0x323c42){return new BPromise(function(_0x8383d5,_0x4209a4){return client[_0x6fc5('0x9')](_0x276170,_0x323c42)[_0x6fc5('0xa')](function(_0x63931){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x57e998,_0x6fc5('0xb'));logger[_0x6fc5('0xc')](_0x6fc5('0xd'),_0x57e998,_0x6fc5('0xb'),JSON['stringify'](_0x63931));if(_0x63931['error']){if(_0x63931[_0x6fc5('0xe')][_0x6fc5('0xf')]===0x1f4){logger[_0x6fc5('0xe')](_0x6fc5('0x10'),_0x57e998,_0x63931[_0x6fc5('0xe')][_0x6fc5('0x11')]);return _0x4209a4(_0x63931[_0x6fc5('0xe')][_0x6fc5('0x11')]);}logger['error'](_0x6fc5('0x10'),_0x57e998,_0x63931[_0x6fc5('0xe')][_0x6fc5('0x11')]);return _0x8383d5(_0x63931['error']['message']);}else{logger[_0x6fc5('0x12')](_0x6fc5('0x10'),_0x57e998,'request\x20sent');_0x8383d5(_0x63931[_0x6fc5('0x13')][_0x6fc5('0x11')]);}})[_0x6fc5('0x14')](function(_0xf01293){logger[_0x6fc5('0xe')](_0x6fc5('0x10'),_0x57e998,_0xf01293);_0x4209a4(_0xf01293);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 13dfd1b..02ba166 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 _0x8e8c=['index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated'];(function(_0x419eb4,_0x187535){var _0x2e4f2c=function(_0x520515){while(--_0x520515){_0x419eb4['push'](_0x419eb4['shift']());}};_0x2e4f2c(++_0x187535);}(_0x8e8c,0x129));var _0xc8e8=function(_0x36b444,_0x505b35){_0x36b444=_0x36b444-0x0;var _0x786323=_0x8e8c[_0x36b444];return _0x786323;};'use strict';var multer=require(_0xc8e8('0x0'));var util=require(_0xc8e8('0x1'));var path=require(_0xc8e8('0x2'));var timeout=require(_0xc8e8('0x3'));var express=require(_0xc8e8('0x4'));var router=express[_0xc8e8('0x5')]();var fs_extra=require(_0xc8e8('0x6'));var auth=require(_0xc8e8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc8e8('0x8'));var controller=require(_0xc8e8('0x9'));router['get']('/',auth[_0xc8e8('0xa')](),controller[_0xc8e8('0xb')]);router['get'](_0xc8e8('0xc'),auth[_0xc8e8('0xa')](),controller[_0xc8e8('0xd')]);router['get'](_0xc8e8('0xe'),auth[_0xc8e8('0xa')](),controller[_0xc8e8('0xf')]);router[_0xc8e8('0x10')]('/',auth[_0xc8e8('0xa')](),controller[_0xc8e8('0x11')]);router[_0xc8e8('0x12')](_0xc8e8('0xe'),auth[_0xc8e8('0xa')](),controller[_0xc8e8('0x13')]);router[_0xc8e8('0x14')](_0xc8e8('0xe'),auth[_0xc8e8('0xa')](),controller['destroy']);module[_0xc8e8('0x15')]=router; \ No newline at end of file +var _0xb75f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path'];(function(_0x463119,_0x3e0fc2){var _0x1a3429=function(_0x377423){while(--_0x377423){_0x463119['push'](_0x463119['shift']());}};_0x1a3429(++_0x3e0fc2);}(_0xb75f,0x13e));var _0xfb75=function(_0xe2a8bf,_0x36f6e4){_0xe2a8bf=_0xe2a8bf-0x0;var _0x34b028=_0xb75f[_0xe2a8bf];return _0x34b028;};'use strict';var multer=require(_0xfb75('0x0'));var util=require('util');var path=require(_0xfb75('0x1'));var timeout=require(_0xfb75('0x2'));var express=require(_0xfb75('0x3'));var router=express[_0xfb75('0x4')]();var fs_extra=require(_0xfb75('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb75('0x6'));var config=require('../../config/environment');var controller=require(_0xfb75('0x7'));router[_0xfb75('0x8')]('/',auth[_0xfb75('0x9')](),controller['index']);router[_0xfb75('0x8')](_0xfb75('0xa'),auth[_0xfb75('0x9')](),controller[_0xfb75('0xb')]);router['get'](_0xfb75('0xc'),auth[_0xfb75('0x9')](),controller[_0xfb75('0xd')]);router[_0xfb75('0xe')]('/',auth[_0xfb75('0x9')](),controller[_0xfb75('0xf')]);router[_0xfb75('0x10')](_0xfb75('0xc'),auth['isAuthenticated'](),controller[_0xfb75('0x11')]);router[_0xfb75('0x12')](_0xfb75('0xc'),auth[_0xfb75('0x9')](),controller['destroy']);module[_0xfb75('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 187574f..8a1b79a 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 _0x6b20=['getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x19ed35,_0x545abf){var _0x467258=function(_0x3f005d){while(--_0x3f005d){_0x19ed35['push'](_0x19ed35['shift']());}};_0x467258(++_0x545abf);}(_0x6b20,0xd1));var _0x06b2=function(_0x1bc0c6,_0x248831){_0x1bc0c6=_0x1bc0c6-0x0;var _0x3ec973=_0x6b20[_0x1bc0c6];return _0x3ec973;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x06b2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x06b2('0x2')],'set':function(_0x5ba392){this[_0x06b2('0x4')](_0x06b2('0x5'),_0x5ba392?_0x5ba392[_0x06b2('0x6')](''):[]);},'get':function(){return this[_0x06b2('0x7')](_0x06b2('0x5'))?this[_0x06b2('0x7')](_0x06b2('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x140290,_0x496d13){var _0x4e205f=function(_0x149c26){while(--_0x149c26){_0x140290['push'](_0x140290['shift']());}};_0x4e205f(++_0x496d13);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5d8dd6,_0x888c4b){_0x5d8dd6=_0x5d8dd6-0x0;var _0x588b9c=_0x9ffd[_0x5d8dd6];return _0x588b9c;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd9ff('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd9ff('0x2')],'set':function(_0x53e962){this[_0xd9ff('0x5')](_0xd9ff('0x6'),_0x53e962?_0x53e962['join'](''):[]);},'get':function(){return this[_0xd9ff('0x7')](_0xd9ff('0x6'))?this[_0xd9ff('0x7')](_0xd9ff('0x6'))[_0xd9ff('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b0e0985..17c9955 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 _0x893f=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','map','UserProfileSection','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','rawAttributes','fields','include','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x893f,0x86));var _0xf893=function(_0x1f28c3,_0x524430){_0x1f28c3=_0x1f28c3-0x0;var _0x38a14f=_0x893f[_0x1f28c3];return _0x38a14f;};'use strict';var emlformat=require(_0xf893('0x0'));var rimraf=require(_0xf893('0x1'));var zipdir=require(_0xf893('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf893('0x3'));var BPromise=require(_0xf893('0x4'));var Mustache=require(_0xf893('0x5'));var util=require(_0xf893('0x6'));var path=require(_0xf893('0x7'));var sox=require(_0xf893('0x8'));var csv=require('to-csv');var ejs=require(_0xf893('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf893('0xa'));var squel=require(_0xf893('0xb'));var crypto=require(_0xf893('0xc'));var jsforce=require(_0xf893('0xd'));var deskjs=require(_0xf893('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf893('0xf'));var Papa=require(_0xf893('0x10'));var Redis=require(_0xf893('0x11'));var authService=require(_0xf893('0x12'));var qs=require(_0xf893('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf893('0x14'));var logger=require('../../config/logger')(_0xf893('0x15'));var utils=require(_0xf893('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf893('0x17'));var db=require(_0xf893('0x18'))['db'];function respondWithStatusCode(_0x4f7cf7,_0x44fe46){_0x44fe46=_0x44fe46||0xcc;return function(_0xb075e8){if(_0xb075e8){return _0x4f7cf7[_0xf893('0x19')](_0x44fe46);}return _0x4f7cf7['status'](_0x44fe46)[_0xf893('0x1a')]();};}function respondWithResult(_0xefea2,_0x10e6c8){_0x10e6c8=_0x10e6c8||0xc8;return function(_0x575f90){if(_0x575f90){return _0xefea2[_0xf893('0x1b')](_0x10e6c8)[_0xf893('0x1c')](_0x575f90);}};}function respondWithFilteredResult(_0x51313a,_0x5577c9){return function(_0x52597c){if(_0x52597c){var _0x7edd40=typeof _0x5577c9[_0xf893('0x1d')]===_0xf893('0x1e')&&typeof _0x5577c9[_0xf893('0x1f')]==='undefined';var _0x142407=_0x52597c[_0xf893('0x20')];var _0x1a91fe=_0x7edd40?0x0:_0x5577c9[_0xf893('0x1d')];var _0x2d785f=_0x7edd40?_0x52597c[_0xf893('0x20')]:_0x5577c9[_0xf893('0x1d')]+_0x5577c9[_0xf893('0x1f')];var _0x475219;if(_0x2d785f>=_0x142407){_0x2d785f=_0x142407;_0x475219=0xc8;}else{_0x475219=0xce;}_0x51313a['status'](_0x475219);return _0x51313a[_0xf893('0x21')]('Content-Range',_0x1a91fe+'-'+_0x2d785f+'/'+_0x142407)[_0xf893('0x1c')](_0x52597c);}return null;};}function patchUpdates(_0x4dbbf2){return function(_0x5b6277){try{jsonpatch[_0xf893('0x22')](_0x5b6277,_0x4dbbf2,!![]);}catch(_0x1bace2){return BPromise[_0xf893('0x23')](_0x1bace2);}return _0x5b6277[_0xf893('0x24')]();};}function saveUpdates(_0x2b0935,_0x2d1a36){return function(_0x463cbf){if(_0x463cbf){return _0x463cbf[_0xf893('0x25')](_0x2b0935)['then'](function(_0x436268){return _0x436268;});}return null;};}function removeEntity(_0x34d82a,_0x5e7903){return function(_0x439106){if(_0x439106){return _0x439106[_0xf893('0x26')]()[_0xf893('0x27')](function(){_0x34d82a[_0xf893('0x1b')](0xcc)[_0xf893('0x1a')]();});}};}function handleEntityNotFound(_0x575290,_0x390cc6){return function(_0x5a7f17){if(!_0x5a7f17){_0x575290[_0xf893('0x19')](0x194);}return _0x5a7f17;};}function handleError(_0x5374d8,_0x53aaf0){_0x53aaf0=_0x53aaf0||0x1f4;return function(_0x4425bf){logger['error'](_0x4425bf['stack']);if(_0x4425bf[_0xf893('0x28')]){delete _0x4425bf[_0xf893('0x28')];}_0x5374d8[_0xf893('0x1b')](_0x53aaf0)[_0xf893('0x29')](_0x4425bf);};}exports[_0xf893('0x2a')]=function(_0x3ecd05,_0x93e879){var _0xc90f46={},_0x44a785={},_0x15721f={'count':0x0,'rows':[]};var _0x5d5f8d=_[_0xf893('0x2b')](db[_0xf893('0x2c')]['rawAttributes'],function(_0x257cfd){return{'name':_0x257cfd[_0xf893('0x2d')],'type':_0x257cfd['type'][_0xf893('0x2e')]};});_0x44a785[_0xf893('0x2f')]=_[_0xf893('0x2b')](_0x5d5f8d,_0xf893('0x28'));_0x44a785[_0xf893('0x30')]=_[_0xf893('0x31')](_0x3ecd05[_0xf893('0x30')]);_0x44a785[_0xf893('0x32')]=_[_0xf893('0x33')](_0x44a785['model'],_0x44a785['query']);_0xc90f46['attributes']=_[_0xf893('0x33')](_0x44a785['model'],qs['fields'](_0x3ecd05['query']['fields']));_0xc90f46['attributes']=_0xc90f46[_0xf893('0x34')][_0xf893('0x35')]?_0xc90f46[_0xf893('0x34')]:_0x44a785[_0xf893('0x2f')];if(!_0x3ecd05[_0xf893('0x30')]['hasOwnProperty'](_0xf893('0x36'))){_0xc90f46['limit']=qs[_0xf893('0x1f')](_0x3ecd05[_0xf893('0x30')][_0xf893('0x1f')]);_0xc90f46[_0xf893('0x1d')]=qs['offset'](_0x3ecd05[_0xf893('0x30')][_0xf893('0x1d')]);}_0xc90f46['order']=qs[_0xf893('0x37')](_0x3ecd05[_0xf893('0x30')]['sort']);_0xc90f46['where']=qs[_0xf893('0x32')](_[_0xf893('0x38')](_0x3ecd05[_0xf893('0x30')],_0x44a785[_0xf893('0x32')]),_0x5d5f8d);if(_0x3ecd05[_0xf893('0x30')][_0xf893('0x39')]){_0xc90f46[_0xf893('0x3a')]=_[_0xf893('0x3b')](_0xc90f46[_0xf893('0x3a')],{'$or':_[_0xf893('0x2b')](_0x5d5f8d,function(_0x11630d){if(_0x11630d[_0xf893('0x3c')]!=='VIRTUAL'){var _0x5d761f={};_0x5d761f[_0x11630d[_0xf893('0x28')]]={'$like':'%'+_0x3ecd05['query'][_0xf893('0x39')]+'%'};return _0x5d761f;}})});}_0xc90f46=_['merge']({},_0xc90f46,_0x3ecd05[_0xf893('0x3d')]);var _0x2aceb1={'where':_0xc90f46[_0xf893('0x3a')]};return db[_0xf893('0x2c')][_0xf893('0x20')](_0x2aceb1)[_0xf893('0x27')](function(_0x38e5a7){_0x15721f[_0xf893('0x20')]=_0x38e5a7;if(_0x3ecd05[_0xf893('0x30')][_0xf893('0x3e')]){_0xc90f46['include']=[{'all':!![]}];}return db[_0xf893('0x2c')][_0xf893('0x3f')](_0xc90f46);})[_0xf893('0x27')](function(_0x47409e){_0x15721f[_0xf893('0x40')]=_0x47409e;return _0x15721f;})[_0xf893('0x27')](respondWithFilteredResult(_0x93e879,_0xc90f46))['catch'](handleError(_0x93e879,null));};exports['show']=function(_0x5a33c0,_0x5492a5){var _0x252307={'raw':![],'where':{'id':_0x5a33c0['params']['id']}},_0x2a88bc={};_0x2a88bc[_0xf893('0x2f')]=_[_0xf893('0x31')](db[_0xf893('0x2c')][_0xf893('0x41')]);_0x2a88bc[_0xf893('0x30')]=_['keys'](_0x5a33c0[_0xf893('0x30')]);_0x2a88bc['filters']=_[_0xf893('0x33')](_0x2a88bc[_0xf893('0x2f')],_0x2a88bc[_0xf893('0x30')]);_0x252307[_0xf893('0x34')]=_[_0xf893('0x33')](_0x2a88bc[_0xf893('0x2f')],qs[_0xf893('0x42')](_0x5a33c0['query'][_0xf893('0x42')]));_0x252307['attributes']=_0x252307[_0xf893('0x34')]['length']?_0x252307[_0xf893('0x34')]:_0x2a88bc[_0xf893('0x2f')];if(_0x5a33c0[_0xf893('0x30')]['includeAll']){_0x252307[_0xf893('0x43')]=[{'all':!![]}];}_0x252307=_['merge']({},_0x252307,_0x5a33c0['options']);return db[_0xf893('0x2c')][_0xf893('0x44')](_0x252307)['then'](handleEntityNotFound(_0x5492a5,null))['then'](respondWithResult(_0x5492a5,null))['catch'](handleError(_0x5492a5,null));};exports[_0xf893('0x45')]=function(_0x484f70,_0x1b20b7){return db[_0xf893('0x2c')][_0xf893('0x45')](_0x484f70[_0xf893('0x46')],{})[_0xf893('0x27')](respondWithResult(_0x1b20b7,0xc9))[_0xf893('0x47')](handleError(_0x1b20b7,null));};exports[_0xf893('0x25')]=function(_0x5c9ddb,_0x57e879){if(_0x5c9ddb[_0xf893('0x46')]['id']){delete _0x5c9ddb['body']['id'];}return db[_0xf893('0x2c')][_0xf893('0x44')]({'where':{'id':_0x5c9ddb[_0xf893('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e879,null))[_0xf893('0x27')](saveUpdates(_0x5c9ddb['body'],null))[_0xf893('0x27')](respondWithResult(_0x57e879,null))[_0xf893('0x47')](handleError(_0x57e879,null));};exports[_0xf893('0x26')]=function(_0x4f36d2,_0x268915){return db[_0xf893('0x2c')][_0xf893('0x44')]({'where':{'id':_0x4f36d2['params']['id']}})[_0xf893('0x27')](handleEntityNotFound(_0x268915,null))[_0xf893('0x27')](removeEntity(_0x268915,null))[_0xf893('0x47')](handleError(_0x268915,null));};exports[_0xf893('0x49')]=function(_0x1f5020,_0x2c1cf0){return db[_0xf893('0x2c')][_0xf893('0x49')]()[_0xf893('0x27')](respondWithResult(_0x2c1cf0,null))['catch'](handleError(_0x2c1cf0,null));}; \ No newline at end of file +var _0x7df8=['where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','params','fields','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','then','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','limit','order','sort'];(function(_0x3eaa90,_0x3d5c44){var _0x191d0f=function(_0x5dfb06){while(--_0x5dfb06){_0x3eaa90['push'](_0x3eaa90['shift']());}};_0x191d0f(++_0x3d5c44);}(_0x7df8,0x176));var _0x87df=function(_0x229675,_0x255138){_0x229675=_0x229675-0x0;var _0x2061a1=_0x7df8[_0x229675];return _0x2061a1;};'use strict';var emlformat=require(_0x87df('0x0'));var rimraf=require(_0x87df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x87df('0x2'));var BPromise=require(_0x87df('0x3'));var Mustache=require('mustache');var util=require(_0x87df('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x87df('0x5'));var ejs=require(_0x87df('0x6'));var fs=require('fs');var fs_extra=require(_0x87df('0x7'));var _=require(_0x87df('0x8'));var squel=require(_0x87df('0x9'));var crypto=require(_0x87df('0xa'));var jsforce=require(_0x87df('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x87df('0xc'));var Papa=require(_0x87df('0xd'));var Redis=require(_0x87df('0xe'));var authService=require(_0x87df('0xf'));var qs=require(_0x87df('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87df('0x11'));var logger=require('../../config/logger')(_0x87df('0x12'));var utils=require(_0x87df('0x13'));var config=require(_0x87df('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x87df('0x15'))['db'];function respondWithStatusCode(_0x367c4c,_0x5ec489){_0x5ec489=_0x5ec489||0xcc;return function(_0x432d86){if(_0x432d86){return _0x367c4c[_0x87df('0x16')](_0x5ec489);}return _0x367c4c[_0x87df('0x17')](_0x5ec489)[_0x87df('0x18')]();};}function respondWithResult(_0x3e8416,_0x1af09){_0x1af09=_0x1af09||0xc8;return function(_0x4cb3a9){if(_0x4cb3a9){return _0x3e8416['status'](_0x1af09)[_0x87df('0x19')](_0x4cb3a9);}};}function respondWithFilteredResult(_0x517ab1,_0x662732){return function(_0xfa24d4){if(_0xfa24d4){var _0x2b7738=typeof _0x662732['offset']===_0x87df('0x1a')&&typeof _0x662732['limit']===_0x87df('0x1a');var _0x130cca=_0xfa24d4['count'];var _0x49eb2c=_0x2b7738?0x0:_0x662732['offset'];var _0x2b70d8=_0x2b7738?_0xfa24d4[_0x87df('0x1b')]:_0x662732[_0x87df('0x1c')]+_0x662732['limit'];var _0x24d12e;if(_0x2b70d8>=_0x130cca){_0x2b70d8=_0x130cca;_0x24d12e=0xc8;}else{_0x24d12e=0xce;}_0x517ab1[_0x87df('0x17')](_0x24d12e);return _0x517ab1[_0x87df('0x1d')](_0x87df('0x1e'),_0x49eb2c+'-'+_0x2b70d8+'/'+_0x130cca)['json'](_0xfa24d4);}return null;};}function patchUpdates(_0x463d78){return function(_0x4f2f86){try{jsonpatch['apply'](_0x4f2f86,_0x463d78,!![]);}catch(_0x4b5528){return BPromise[_0x87df('0x1f')](_0x4b5528);}return _0x4f2f86['save']();};}function saveUpdates(_0x17b9e5,_0x5d61e6){return function(_0x46d478){if(_0x46d478){return _0x46d478['update'](_0x17b9e5)[_0x87df('0x20')](function(_0x312cef){return _0x312cef;});}return null;};}function removeEntity(_0x3e9c65,_0x2f996b){return function(_0x1a98c3){if(_0x1a98c3){return _0x1a98c3['destroy']()[_0x87df('0x20')](function(){_0x3e9c65[_0x87df('0x17')](0xcc)[_0x87df('0x18')]();});}};}function handleEntityNotFound(_0x151819,_0x2283af){return function(_0x237e69){if(!_0x237e69){_0x151819[_0x87df('0x16')](0x194);}return _0x237e69;};}function handleError(_0x5d0f52,_0x1d9454){_0x1d9454=_0x1d9454||0x1f4;return function(_0x2cd05b){logger['error'](_0x2cd05b['stack']);if(_0x2cd05b[_0x87df('0x21')]){delete _0x2cd05b['name'];}_0x5d0f52['status'](_0x1d9454)[_0x87df('0x22')](_0x2cd05b);};}exports[_0x87df('0x23')]=function(_0x240e55,_0x28fbd1){var _0x2097ef={},_0x191f87={},_0x20c9f4={'count':0x0,'rows':[]};var _0x19bb0b=_[_0x87df('0x24')](db[_0x87df('0x25')][_0x87df('0x26')],function(_0x2b1003){return{'name':_0x2b1003[_0x87df('0x27')],'type':_0x2b1003['type'][_0x87df('0x28')]};});_0x191f87['model']=_[_0x87df('0x24')](_0x19bb0b,_0x87df('0x21'));_0x191f87[_0x87df('0x29')]=_[_0x87df('0x2a')](_0x240e55['query']);_0x191f87[_0x87df('0x2b')]=_[_0x87df('0x2c')](_0x191f87[_0x87df('0x2d')],_0x191f87[_0x87df('0x29')]);_0x2097ef[_0x87df('0x2e')]=_[_0x87df('0x2c')](_0x191f87[_0x87df('0x2d')],qs['fields'](_0x240e55[_0x87df('0x29')]['fields']));_0x2097ef[_0x87df('0x2e')]=_0x2097ef['attributes'][_0x87df('0x2f')]?_0x2097ef[_0x87df('0x2e')]:_0x191f87[_0x87df('0x2d')];if(!_0x240e55[_0x87df('0x29')][_0x87df('0x30')]('nolimit')){_0x2097ef[_0x87df('0x31')]=qs['limit'](_0x240e55[_0x87df('0x29')][_0x87df('0x31')]);_0x2097ef[_0x87df('0x1c')]=qs['offset'](_0x240e55[_0x87df('0x29')][_0x87df('0x1c')]);}_0x2097ef[_0x87df('0x32')]=qs[_0x87df('0x33')](_0x240e55[_0x87df('0x29')][_0x87df('0x33')]);_0x2097ef[_0x87df('0x34')]=qs[_0x87df('0x2b')](_[_0x87df('0x35')](_0x240e55[_0x87df('0x29')],_0x191f87['filters']),_0x19bb0b);if(_0x240e55[_0x87df('0x29')][_0x87df('0x36')]){_0x2097ef[_0x87df('0x34')]=_[_0x87df('0x37')](_0x2097ef[_0x87df('0x34')],{'$or':_[_0x87df('0x24')](_0x19bb0b,function(_0x1c8285){if(_0x1c8285[_0x87df('0x38')]!==_0x87df('0x39')){var _0x5f54be={};_0x5f54be[_0x1c8285['name']]={'$like':'%'+_0x240e55[_0x87df('0x29')][_0x87df('0x36')]+'%'};return _0x5f54be;}})});}_0x2097ef=_[_0x87df('0x37')]({},_0x2097ef,_0x240e55[_0x87df('0x3a')]);var _0xb2cb28={'where':_0x2097ef[_0x87df('0x34')]};return db[_0x87df('0x25')]['count'](_0xb2cb28)[_0x87df('0x20')](function(_0x27852f){_0x20c9f4[_0x87df('0x1b')]=_0x27852f;if(_0x240e55[_0x87df('0x29')]['includeAll']){_0x2097ef['include']=[{'all':!![]}];}return db[_0x87df('0x25')][_0x87df('0x3b')](_0x2097ef);})[_0x87df('0x20')](function(_0x4c59a7){_0x20c9f4[_0x87df('0x3c')]=_0x4c59a7;return _0x20c9f4;})['then'](respondWithFilteredResult(_0x28fbd1,_0x2097ef))[_0x87df('0x3d')](handleError(_0x28fbd1,null));};exports['show']=function(_0x326cc9,_0x47651d){var _0x43084b={'raw':![],'where':{'id':_0x326cc9[_0x87df('0x3e')]['id']}},_0x317e38={};_0x317e38[_0x87df('0x2d')]=_['keys'](db[_0x87df('0x25')][_0x87df('0x26')]);_0x317e38['query']=_['keys'](_0x326cc9[_0x87df('0x29')]);_0x317e38[_0x87df('0x2b')]=_[_0x87df('0x2c')](_0x317e38['model'],_0x317e38[_0x87df('0x29')]);_0x43084b[_0x87df('0x2e')]=_['intersection'](_0x317e38[_0x87df('0x2d')],qs[_0x87df('0x3f')](_0x326cc9['query'][_0x87df('0x3f')]));_0x43084b[_0x87df('0x2e')]=_0x43084b[_0x87df('0x2e')][_0x87df('0x2f')]?_0x43084b[_0x87df('0x2e')]:_0x317e38[_0x87df('0x2d')];if(_0x326cc9['query'][_0x87df('0x40')]){_0x43084b[_0x87df('0x41')]=[{'all':!![]}];}_0x43084b=_['merge']({},_0x43084b,_0x326cc9[_0x87df('0x3a')]);return db[_0x87df('0x25')][_0x87df('0x42')](_0x43084b)['then'](handleEntityNotFound(_0x47651d,null))[_0x87df('0x20')](respondWithResult(_0x47651d,null))[_0x87df('0x3d')](handleError(_0x47651d,null));};exports[_0x87df('0x43')]=function(_0x5c072f,_0x2769cd){return db[_0x87df('0x25')][_0x87df('0x43')](_0x5c072f['body'],{})[_0x87df('0x20')](respondWithResult(_0x2769cd,0xc9))[_0x87df('0x3d')](handleError(_0x2769cd,null));};exports['update']=function(_0x5f1483,_0xecf747){if(_0x5f1483[_0x87df('0x44')]['id']){delete _0x5f1483['body']['id'];}return db['UserProfileSection'][_0x87df('0x42')]({'where':{'id':_0x5f1483[_0x87df('0x3e')]['id']}})[_0x87df('0x20')](handleEntityNotFound(_0xecf747,null))[_0x87df('0x20')](saveUpdates(_0x5f1483[_0x87df('0x44')],null))[_0x87df('0x20')](respondWithResult(_0xecf747,null))[_0x87df('0x3d')](handleError(_0xecf747,null));};exports[_0x87df('0x45')]=function(_0x3ed1e,_0x224126){return db[_0x87df('0x25')][_0x87df('0x42')]({'where':{'id':_0x3ed1e[_0x87df('0x3e')]['id']}})[_0x87df('0x20')](handleEntityNotFound(_0x224126,null))[_0x87df('0x20')](removeEntity(_0x224126,null))[_0x87df('0x3d')](handleError(_0x224126,null));};exports['describe']=function(_0x405280,_0x258333){return db['UserProfileSection'][_0x87df('0x46')]()[_0x87df('0x20')](respondWithResult(_0x258333,null))[_0x87df('0x3d')](handleError(_0x258333,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 8590a8c..c53c404 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 _0xce80=['userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId'];(function(_0x393438,_0x4883a6){var _0x2a0986=function(_0x15a93b){while(--_0x15a93b){_0x393438['push'](_0x393438['shift']());}};_0x2a0986(++_0x4883a6);}(_0xce80,0x1a5));var _0x0ce8=function(_0x3dd992,_0x539413){_0x3dd992=_0x3dd992-0x0;var _0x216f94=_0xce80[_0x3dd992];return _0x216f94;};'use strict';var _=require(_0x0ce8('0x0'));var util=require('util');var logger=require(_0x0ce8('0x1'))(_0x0ce8('0x2'));var moment=require(_0x0ce8('0x3'));var BPromise=require(_0x0ce8('0x4'));var rp=require(_0x0ce8('0x5'));var fs=require('fs');var path=require(_0x0ce8('0x6'));var rimraf=require(_0x0ce8('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ce8('0x8'));module[_0x0ce8('0x9')]=function(_0x29e3a7,_0x402975){return _0x29e3a7[_0x0ce8('0xa')]('UserProfileSection',attributes,{'tableName':_0x0ce8('0xb'),'paranoid':![],'indexes':[{'name':_0x0ce8('0xc'),'fields':[_0x0ce8('0xd'),_0x0ce8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2452=['compositeIndex','sectionId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection'];(function(_0x19b391,_0x390cdb){var _0x201037=function(_0x405ad3){while(--_0x405ad3){_0x19b391['push'](_0x19b391['shift']());}};_0x201037(++_0x390cdb);}(_0x2452,0x1bc));var _0x2245=function(_0xdfdeb7,_0x29649c){_0xdfdeb7=_0xdfdeb7-0x0;var _0x1db931=_0x2452[_0xdfdeb7];return _0x1db931;};'use strict';var _=require(_0x2245('0x0'));var util=require(_0x2245('0x1'));var logger=require(_0x2245('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2245('0x3'));var rp=require(_0x2245('0x4'));var fs=require('fs');var path=require(_0x2245('0x5'));var rimraf=require(_0x2245('0x6'));var config=require(_0x2245('0x7'));var attributes=require(_0x2245('0x8'));module[_0x2245('0x9')]=function(_0x312015,_0x277e9b){return _0x312015['define'](_0x2245('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x2245('0xb'),'fields':[_0x2245('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 8320646..d933d7a 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 _0xd881=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x7e1aaa,_0x111fde){var _0x3b813a=function(_0x26ff00){while(--_0x26ff00){_0x7e1aaa['push'](_0x7e1aaa['shift']());}};_0x3b813a(++_0x111fde);}(_0xd881,0x182));var _0x1d88=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd881[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1d88('0x0'));var util=require('util');var moment=require(_0x1d88('0x1'));var BPromise=require(_0x1d88('0x2'));var rs=require(_0x1d88('0x3'));var fs=require('fs');var Redis=require(_0x1d88('0x4'));var db=require(_0x1d88('0x5'))['db'];var utils=require(_0x1d88('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d88('0x7'));var jayson=require(_0x1d88('0x8'));var client=jayson[_0x1d88('0x9')][_0x1d88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x576757,_0x3aa622,_0x19534b){return new BPromise(function(_0x4f09c7,_0x35e35f){return client[_0x1d88('0xb')](_0x576757,_0x19534b)[_0x1d88('0xc')](function(_0x34a5b9){logger[_0x1d88('0xd')](_0x1d88('0xe'),_0x3aa622,_0x1d88('0xf'));logger[_0x1d88('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3aa622,_0x1d88('0xf'),JSON[_0x1d88('0x11')](_0x34a5b9));if(_0x34a5b9[_0x1d88('0x12')]){if(_0x34a5b9['error'][_0x1d88('0x13')]===0x1f4){logger['error'](_0x1d88('0xe'),_0x3aa622,_0x34a5b9['error']['message']);return _0x35e35f(_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);}logger['error'](_0x1d88('0xe'),_0x3aa622,_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);return _0x4f09c7(_0x34a5b9[_0x1d88('0x12')][_0x1d88('0x14')]);}else{logger['info'](_0x1d88('0xe'),_0x3aa622,_0x1d88('0xf'));_0x4f09c7(_0x34a5b9[_0x1d88('0x15')]['message']);}})[_0x1d88('0x16')](function(_0x4bb9a1){logger[_0x1d88('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x3aa622,_0x4bb9a1);_0x35e35f(_0x4bb9a1);});});} \ No newline at end of file +var _0x7ae8=['jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x7ae8,0x142));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x87ae('0x0'));var moment=require('moment');var BPromise=require(_0x87ae('0x1'));var rs=require(_0x87ae('0x2'));var fs=require('fs');var Redis=require(_0x87ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x87ae('0x4'));var logger=require(_0x87ae('0x5'))(_0x87ae('0x6'));var config=require(_0x87ae('0x7'));var jayson=require(_0x87ae('0x8'));var client=jayson[_0x87ae('0x9')][_0x87ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22bb85,_0x18f38b,_0x4c9b61){return new BPromise(function(_0x2ee482,_0x4c6ab1){return client[_0x87ae('0xb')](_0x22bb85,_0x4c9b61)[_0x87ae('0xc')](function(_0x2bd586){logger[_0x87ae('0xd')](_0x87ae('0xe'),_0x18f38b,'request\x20sent');logger[_0x87ae('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x18f38b,_0x87ae('0x10'),JSON[_0x87ae('0x11')](_0x2bd586));if(_0x2bd586['error']){if(_0x2bd586[_0x87ae('0x12')]['code']===0x1f4){logger[_0x87ae('0x12')](_0x87ae('0xe'),_0x18f38b,_0x2bd586[_0x87ae('0x12')][_0x87ae('0x13')]);return _0x4c6ab1(_0x2bd586[_0x87ae('0x12')][_0x87ae('0x13')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x18f38b,_0x2bd586[_0x87ae('0x12')]['message']);return _0x2ee482(_0x2bd586['error']['message']);}else{logger[_0x87ae('0xd')](_0x87ae('0xe'),_0x18f38b,_0x87ae('0x10'));_0x2ee482(_0x2bd586[_0x87ae('0x14')]['message']);}})[_0x87ae('0x15')](function(_0x3e7143){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x18f38b,_0x3e7143);_0x4c6ab1(_0x3e7143);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c739b5f..988f0cd 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf57e93,_0x459863){var _0x15228b=function(_0x3fcce8){while(--_0x3fcce8){_0xf57e93['push'](_0xf57e93['shift']());}};_0x15228b(++_0x459863);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x11b1ec,_0x8020c2){var _0x2c4351=function(_0x28680c){while(--_0x28680c){_0x11b1ec['push'](_0x11b1ec['shift']());}};_0x2c4351(++_0x8020c2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0xcb91[_0x5311a1];return _0x2acb9f;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 1df4556..2627f54 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 _0x0a61=['sequelize','exports','INTEGER'];(function(_0x40166a,_0x5838ad){var _0x37a483=function(_0x7f902e){while(--_0x7f902e){_0x40166a['push'](_0x40166a['shift']());}};_0x37a483(++_0x5838ad);}(_0x0a61,0x12c));var _0x10a6=function(_0x53bc7d,_0x455de0){_0x53bc7d=_0x53bc7d-0x0;var _0x44b724=_0x0a61[_0x53bc7d];return _0x44b724;};'use strict';var Sequelize=require(_0x10a6('0x0'));module[_0x10a6('0x1')]={'penalty':{'type':Sequelize[_0x10a6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6873=['INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6873,0xac));var _0x3687=function(_0x4001ad,_0x1e22dd){_0x4001ad=_0x4001ad-0x0;var _0x4c7ec2=_0x6873[_0x4001ad];return _0x4c7ec2;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3687('0x0')],'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 d64a209..a8bdced 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 _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x158279,_0x110989){var _0x5e826e=function(_0x3ccf0e){while(--_0x3ccf0e){_0x158279['push'](_0x158279['shift']());}};_0x5e826e(++_0x110989);}(_0x4ccb,0x196));var _0xb4cc=function(_0x34dacb,_0x30bbd7){_0x34dacb=_0x34dacb-0x0;var _0x592ac3=_0x4ccb[_0x34dacb];return _0x592ac3;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7de=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0x3e0736,_0x416a4b){var _0x2496c9=function(_0x475caa){while(--_0x475caa){_0x3e0736['push'](_0x3e0736['shift']());}};_0x2496c9(++_0x416a4b);}(_0xb7de,0xc7));var _0xeb7d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xb7de[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))('api');var moment=require(_0xeb7d('0x3'));var BPromise=require(_0xeb7d('0x4'));var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0xadf4,_0x433c32){return _0xadf4[_0xeb7d('0xa')]('UserSmsQueue',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 f1ec1b4..9ed8e43 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 _0xa0db=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa0db,0xeb));var _0xba0d=function(_0x1ab97b,_0x1e46b7){_0x1ab97b=_0x1ab97b-0x0;var _0x870be4=_0xa0db[_0x1ab97b];return _0x870be4;};'use strict';var _=require(_0xba0d('0x0'));var util=require(_0xba0d('0x1'));var moment=require(_0xba0d('0x2'));var BPromise=require('bluebird');var rs=require(_0xba0d('0x3'));var fs=require('fs');var Redis=require(_0xba0d('0x4'));var db=require(_0xba0d('0x5'))['db'];var utils=require(_0xba0d('0x6'));var logger=require(_0xba0d('0x7'))(_0xba0d('0x8'));var config=require(_0xba0d('0x9'));var jayson=require(_0xba0d('0xa'));var client=jayson[_0xba0d('0xb')][_0xba0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e3b2,_0x565654,_0x37ece3){return new BPromise(function(_0x190ebc,_0x440ad0){return client['request'](_0x53e3b2,_0x37ece3)[_0xba0d('0xd')](function(_0x3c9fe7){logger[_0xba0d('0xe')](_0xba0d('0xf'),_0x565654,_0xba0d('0x10'));logger['debug'](_0xba0d('0x11'),_0x565654,_0xba0d('0x10'),JSON[_0xba0d('0x12')](_0x3c9fe7));if(_0x3c9fe7[_0xba0d('0x13')]){if(_0x3c9fe7[_0xba0d('0x13')]['code']===0x1f4){logger[_0xba0d('0x13')](_0xba0d('0xf'),_0x565654,_0x3c9fe7[_0xba0d('0x13')][_0xba0d('0x14')]);return _0x440ad0(_0x3c9fe7[_0xba0d('0x13')]['message']);}logger[_0xba0d('0x13')](_0xba0d('0xf'),_0x565654,_0x3c9fe7['error'][_0xba0d('0x14')]);return _0x190ebc(_0x3c9fe7[_0xba0d('0x13')][_0xba0d('0x14')]);}else{logger[_0xba0d('0xe')](_0xba0d('0xf'),_0x565654,_0xba0d('0x10'));_0x190ebc(_0x3c9fe7[_0xba0d('0x15')][_0xba0d('0x14')]);}})[_0xba0d('0x16')](function(_0x12287c){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x565654,_0x12287c);_0x440ad0(_0x12287c);});});} \ No newline at end of file +var _0xb064=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5d3a98,_0x3992c9){var _0x54137b=function(_0x581eed){while(--_0x581eed){_0x5d3a98['push'](_0x5d3a98['shift']());}};_0x54137b(++_0x3992c9);}(_0xb064,0x155));var _0x4b06=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb064[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x4b06('0x0'));var util=require(_0x4b06('0x1'));var moment=require(_0x4b06('0x2'));var BPromise=require(_0x4b06('0x3'));var rs=require(_0x4b06('0x4'));var fs=require('fs');var Redis=require(_0x4b06('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b06('0x6'));var logger=require(_0x4b06('0x7'))(_0x4b06('0x8'));var config=require(_0x4b06('0x9'));var jayson=require(_0x4b06('0xa'));var client=jayson[_0x4b06('0xb')][_0x4b06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fe4,_0x410330,_0x58eb12){return new BPromise(function(_0x8ac241,_0xf4c724){return client[_0x4b06('0xd')](_0x5f2fe4,_0x58eb12)['then'](function(_0x5f499b){logger['info'](_0x4b06('0xe'),_0x410330,_0x4b06('0xf'));logger[_0x4b06('0x10')](_0x4b06('0x11'),_0x410330,_0x4b06('0xf'),JSON['stringify'](_0x5f499b));if(_0x5f499b['error']){if(_0x5f499b[_0x4b06('0x12')]['code']===0x1f4){logger[_0x4b06('0x12')](_0x4b06('0xe'),_0x410330,_0x5f499b['error'][_0x4b06('0x13')]);return _0xf4c724(_0x5f499b[_0x4b06('0x12')][_0x4b06('0x13')]);}logger['error'](_0x4b06('0xe'),_0x410330,_0x5f499b[_0x4b06('0x12')][_0x4b06('0x13')]);return _0x8ac241(_0x5f499b[_0x4b06('0x12')][_0x4b06('0x13')]);}else{logger[_0x4b06('0x14')](_0x4b06('0xe'),_0x410330,_0x4b06('0xf'));_0x8ac241(_0x5f499b['result'][_0x4b06('0x13')]);}})['catch'](function(_0x42520f){logger['error'](_0x4b06('0xe'),_0x410330,_0x42520f);_0xf4c724(_0x42520f);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 1fb9251..097e3d6 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 _0x0370=['exports','INTEGER'];(function(_0x2b9181,_0x501b0b){var _0x3237ed=function(_0x2be491){while(--_0x2be491){_0x2b9181['push'](_0x2b9181['shift']());}};_0x3237ed(++_0x501b0b);}(_0x0370,0x14c));var _0x0037=function(_0x3a8f60,_0x34acda){_0x3a8f60=_0x3a8f60-0x0;var _0x56081c=_0x0370[_0x3a8f60];return _0x56081c;};'use strict';var Sequelize=require('sequelize');module[_0x0037('0x0')]={'UserId':{'type':Sequelize[_0x0037('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x0037('0x1')]}}; \ No newline at end of file +var _0xe87a=['sequelize','exports','INTEGER'];(function(_0x3646c2,_0x3389e9){var _0x459d96=function(_0x4ed27a){while(--_0x4ed27a){_0x3646c2['push'](_0x3646c2['shift']());}};_0x459d96(++_0x3389e9);}(_0xe87a,0xf3));var _0xae87=function(_0x10a534,_0x3c5e92){_0x10a534=_0x10a534-0x0;var _0x5163d7=_0xe87a[_0x10a534];return _0x5163d7;};'use strict';var Sequelize=require(_0xae87('0x0'));module[_0xae87('0x1')]={'UserId':{'type':Sequelize[_0xae87('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 50b8581..d0d8078 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(_0x21699c,_0x93bb2d){var _0x593fc6=function(_0x282e75){while(--_0x282e75){_0x21699c['push'](_0x21699c['shift']());}};_0x593fc6(++_0x93bb2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x227582,_0x41eca9){var _0x40d0f9=function(_0x46ca68){while(--_0x46ca68){_0x227582['push'](_0x227582['shift']());}};_0x40d0f9(++_0x41eca9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 6783e68..56c1559 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(_0x492c7a,_0xe88954){var _0x1ef0af=function(_0x322d76){while(--_0x322d76){_0x492c7a['push'](_0x492c7a['shift']());}};_0x1ef0af(++_0xe88954);}(_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(_0x487a72,_0x4ee2df){var _0xcd3559=function(_0x1becd3){while(--_0x1becd3){_0x487a72['push'](_0x487a72['shift']());}};_0xcd3559(++_0x4ee2df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 18f548e..aee65e9 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 _0x3442=['sequelize','exports'];(function(_0x24ac51,_0x2145ba){var _0x13a5fe=function(_0x402e80){while(--_0x402e80){_0x24ac51['push'](_0x24ac51['shift']());}};_0x13a5fe(++_0x2145ba);}(_0x3442,0x118));var _0x2344=function(_0x142c52,_0x3bc610){_0x142c52=_0x142c52-0x0;var _0x4a2988=_0x3442[_0x142c52];return _0x4a2988;};'use strict';var Sequelize=require(_0x2344('0x0'));module[_0x2344('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf324=['INTEGER','sequelize','exports'];(function(_0x3903a0,_0x455c23){var _0x259755=function(_0x3950d8){while(--_0x3950d8){_0x3903a0['push'](_0x3903a0['shift']());}};_0x259755(++_0x455c23);}(_0xf324,0xa6));var _0x4f32=function(_0xd61d86,_0x4b30cb){_0xd61d86=_0xd61d86-0x0;var _0x411f3f=_0xf324[_0xd61d86];return _0x411f3f;};'use strict';var Sequelize=require(_0x4f32('0x0'));module[_0x4f32('0x1')]={'penalty':{'type':Sequelize[_0x4f32('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 5d3a7ba..e35e307 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 _0xc1c7=['util','api','bluebird','path','rimraf','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc1c7,0x199));var _0x7c1c=function(_0x534a85,_0x11c863){_0x534a85=_0x534a85-0x0;var _0x498792=_0xc1c7[_0x534a85];return _0x498792;};'use strict';var _=require(_0x7c1c('0x0'));var util=require(_0x7c1c('0x1'));var logger=require('../../config/logger')(_0x7c1c('0x2'));var moment=require('moment');var BPromise=require(_0x7c1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c1c('0x4'));var rimraf=require(_0x7c1c('0x5'));var config=require(_0x7c1c('0x6'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x4a6cdf,_0xdf03f0){return _0x4a6cdf[_0x7c1c('0x7')](_0x7c1c('0x8'),attributes,{'tableName':_0x7c1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a23=['exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x33400e,_0x4a116e){var _0x6ebd29=function(_0x3c6c51){while(--_0x3c6c51){_0x33400e['push'](_0x33400e['shift']());}};_0x6ebd29(++_0x4a116e);}(_0x3a23,0xc4));var _0x33a2=function(_0x51f0d7,_0x17e705){_0x51f0d7=_0x51f0d7-0x0;var _0x33be8c=_0x3a23[_0x51f0d7];return _0x33be8c;};'use strict';var _=require(_0x33a2('0x0'));var util=require(_0x33a2('0x1'));var logger=require(_0x33a2('0x2'))('api');var moment=require(_0x33a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x33a2('0x4'));var rimraf=require(_0x33a2('0x5'));var config=require(_0x33a2('0x6'));var attributes=require(_0x33a2('0x7'));module[_0x33a2('0x8')]=function(_0x57fec7,_0x36dd01){return _0x57fec7[_0x33a2('0x9')](_0x33a2('0xa'),attributes,{'tableName':_0x33a2('0xb'),'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 9d01685..42765af 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 _0x5478=['request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x5e19c,_0x58d696){var _0x553232=function(_0x298c84){while(--_0x298c84){_0x5e19c['push'](_0x5e19c['shift']());}};_0x553232(++_0x58d696);}(_0x5478,0xd4));var _0x8547=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x5478[_0x1ed116];return _0x574066;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8547('0x0'));var BPromise=require(_0x8547('0x1'));var rs=require(_0x8547('0x2'));var fs=require('fs');var Redis=require(_0x8547('0x3'));var db=require(_0x8547('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8547('0x5'))('rpc');var config=require(_0x8547('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8547('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa332,_0xef636,_0x3bf38b){return new BPromise(function(_0x1a31d5,_0x73b566){return client[_0x8547('0x8')](_0x2fa332,_0x3bf38b)[_0x8547('0x9')](function(_0x551ba0){logger[_0x8547('0xa')](_0x8547('0xb'),_0xef636,'request\x20sent');logger[_0x8547('0xc')](_0x8547('0xd'),_0xef636,'request\x20sent',JSON[_0x8547('0xe')](_0x551ba0));if(_0x551ba0[_0x8547('0xf')]){if(_0x551ba0['error'][_0x8547('0x10')]===0x1f4){logger['error'](_0x8547('0xb'),_0xef636,_0x551ba0[_0x8547('0xf')][_0x8547('0x11')]);return _0x73b566(_0x551ba0[_0x8547('0xf')]['message']);}logger[_0x8547('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0xef636,_0x551ba0[_0x8547('0xf')][_0x8547('0x11')]);return _0x1a31d5(_0x551ba0[_0x8547('0xf')]['message']);}else{logger['info'](_0x8547('0xb'),_0xef636,_0x8547('0x12'));_0x1a31d5(_0x551ba0[_0x8547('0x13')]['message']);}})['catch'](function(_0x12fe92){logger[_0x8547('0xf')](_0x8547('0xb'),_0xef636,_0x12fe92);_0x73b566(_0x12fe92);});});} \ No newline at end of file +var _0x1b05=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1da691,_0x48cdaa){var _0x56766b=function(_0x5bf781){while(--_0x5bf781){_0x1da691['push'](_0x1da691['shift']());}};_0x56766b(++_0x48cdaa);}(_0x1b05,0x138));var _0x51b0=function(_0x2580fd,_0x1135ea){_0x2580fd=_0x2580fd-0x0;var _0x2afbe8=_0x1b05[_0x2580fd];return _0x2afbe8;};'use strict';var _=require('lodash');var util=require(_0x51b0('0x0'));var moment=require(_0x51b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x51b0('0x2'));var fs=require('fs');var Redis=require(_0x51b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51b0('0x4'))(_0x51b0('0x5'));var config=require(_0x51b0('0x6'));var jayson=require(_0x51b0('0x7'));var client=jayson[_0x51b0('0x8')][_0x51b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29adf3,_0x351b69,_0x389d0f){return new BPromise(function(_0x7278a0,_0x511d1a){return client['request'](_0x29adf3,_0x389d0f)[_0x51b0('0xa')](function(_0x51432c){logger[_0x51b0('0xb')](_0x51b0('0xc'),_0x351b69,_0x51b0('0xd'));logger[_0x51b0('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x351b69,_0x51b0('0xd'),JSON['stringify'](_0x51432c));if(_0x51432c[_0x51b0('0xf')]){if(_0x51432c[_0x51b0('0xf')]['code']===0x1f4){logger[_0x51b0('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x351b69,_0x51432c[_0x51b0('0xf')][_0x51b0('0x10')]);return _0x511d1a(_0x51432c[_0x51b0('0xf')][_0x51b0('0x10')]);}logger[_0x51b0('0xf')](_0x51b0('0xc'),_0x351b69,_0x51432c['error'][_0x51b0('0x10')]);return _0x7278a0(_0x51432c[_0x51b0('0xf')]['message']);}else{logger[_0x51b0('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x351b69,_0x51b0('0xd'));_0x7278a0(_0x51432c[_0x51b0('0x11')][_0x51b0('0x10')]);}})[_0x51b0('0x12')](function(_0x2162a0){logger[_0x51b0('0xf')](_0x51b0('0xc'),_0x351b69,_0x2162a0);_0x511d1a(_0x2162a0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 0fb9e17..9a5c873 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x18e12a,_0x2e9880){var _0x218066=function(_0x355a2e){while(--_0x355a2e){_0x18e12a['push'](_0x18e12a['shift']());}};_0x218066(++_0x2e9880);}(_0xe706,0xa3));var _0x6e70=function(_0x912e23,_0x15f457){_0x912e23=_0x912e23-0x0;var _0x453f72=_0xe706[_0x912e23];return _0x453f72;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x19290f,_0x84ddc1){var _0x331b09=function(_0x7b61a){while(--_0x7b61a){_0x19290f['push'](_0x19290f['shift']());}};_0x331b09(++_0x84ddc1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xcb91[_0x2aa0e7];return _0x1472c0;};'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 f37532e..10b7b2a 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 _0x6570=['exports','INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk','sequelize'];(function(_0x210fea,_0x408cc1){var _0x1ec710=function(_0x285b53){while(--_0x285b53){_0x210fea['push'](_0x210fea['shift']());}};_0x1ec710(++_0x408cc1);}(_0x6570,0x1a3));var _0x0657=function(_0x245690,_0x3bf938){_0x245690=_0x245690-0x0;var _0x3fb9a4=_0x6570[_0x245690];return _0x3fb9a4;};'use strict';var Sequelize=require(_0x0657('0x0'));module[_0x0657('0x1')]={'uniqueid':{'type':Sequelize[_0x0657('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x0657('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0657('0x3')],'allowNull':![],'unique':_0x0657('0x4'),'comment':_0x0657('0x5')},'VoiceQueueId':{'type':Sequelize[_0x0657('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x0657('0x3')],'allowNull':![],'unique':_0x0657('0x4'),'comment':_0x0657('0x5')},'penalty':{'type':Sequelize[_0x0657('0x2')](0xb),'defaultValue':0x0,'comment':_0x0657('0x5')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x4540=['INTEGER','sequelize','exports','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x402ed3,_0x5c0558){var _0x22b1e7=function(_0x334b58){while(--_0x334b58){_0x402ed3['push'](_0x402ed3['shift']());}};_0x22b1e7(++_0x5c0558);}(_0x4540,0x17b));var _0x0454=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4540[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0454('0x0'));module[_0x0454('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0454('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0454('0x3')],'allowNull':![],'unique':_0x0454('0x4'),'comment':_0x0454('0x2')},'VoiceQueueId':{'type':Sequelize[_0x0454('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0x0454('0x3')],'allowNull':![],'unique':_0x0454('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x0454('0x5')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x0454('0x5')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 015e209..25db7ba 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 _0x465c=['emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt','save','update','remove'];(function(_0x5567dc,_0x59c6d8){var _0x34b58a=function(_0x276c49){while(--_0x276c49){_0x5567dc['push'](_0x5567dc['shift']());}};_0x34b58a(++_0x59c6d8);}(_0x465c,0xc0));var _0xc465=function(_0x5b670d,_0x3eb770){_0x5b670d=_0x5b670d-0x0;var _0x6bc7b6=_0x465c[_0x5b670d];return _0x6bc7b6;};'use strict';var EventEmitter=require(_0xc465('0x0'));var UserVoiceQueueRt=require(_0xc465('0x1'))['db'][_0xc465('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc465('0x3'),'afterUpdate':_0xc465('0x4'),'afterDestroy':_0xc465('0x5')};function emitEvent(_0x5c99f2){return function(_0x33af29,_0x54bbaa,_0x128eae){UserVoiceQueueRtEvents[_0xc465('0x6')](_0x5c99f2+':'+_0x33af29['id'],_0x33af29);UserVoiceQueueRtEvents[_0xc465('0x6')](_0x5c99f2,_0x33af29);_0x128eae(null);};}for(var e in events){if(events[_0xc465('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xc465('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xceb4=['setMaxListeners','save','update','remove','emit','exports','events','UserVoiceQueueRt'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xceb4,0x1a6));var _0x4ceb=function(_0x54174f,_0x34d079){_0x54174f=_0x54174f-0x0;var _0x71d0fb=_0xceb4[_0x54174f];return _0x71d0fb;};'use strict';var EventEmitter=require(_0x4ceb('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4ceb('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4ceb('0x2')](0x0);var events={'afterCreate':_0x4ceb('0x3'),'afterUpdate':_0x4ceb('0x4'),'afterDestroy':_0x4ceb('0x5')};function emitEvent(_0x5f2570){return function(_0x188685,_0x571cd4,_0x524a57){UserVoiceQueueRtEvents[_0x4ceb('0x6')](_0x5f2570+':'+_0x188685['id'],_0x188685);UserVoiceQueueRtEvents[_0x4ceb('0x6')](_0x5f2570,_0x188685);_0x524a57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4ceb('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index e8d7840..2a0bb7b 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 _0x8446=['../../config/logger','api','moment','bluebird','request-promise','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','util'];(function(_0x146574,_0x140578){var _0x2298e3=function(_0x9a6beb){while(--_0x9a6beb){_0x146574['push'](_0x146574['shift']());}};_0x2298e3(++_0x140578);}(_0x8446,0xb3));var _0x6844=function(_0x30b06d,_0x1c51f1){_0x30b06d=_0x30b06d-0x0;var _0x2c0b5b=_0x8446[_0x30b06d];return _0x2c0b5b;};'use strict';var _=require('lodash');var util=require(_0x6844('0x0'));var logger=require(_0x6844('0x1'))(_0x6844('0x2'));var moment=require(_0x6844('0x3'));var BPromise=require(_0x6844('0x4'));var rp=require(_0x6844('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6844('0x6'));module['exports']=function(_0x36643c,_0x4a72a9){return _0x36643c[_0x6844('0x7')](_0x6844('0x8'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8db4=['../../config/environment','exports','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x30662f,_0x4d202e){var _0x40d038=function(_0x10bb41){while(--_0x10bb41){_0x30662f['push'](_0x30662f['shift']());}};_0x40d038(++_0x4d202e);}(_0x8db4,0x111));var _0x48db=function(_0x616ef5,_0x169e0d){_0x616ef5=_0x616ef5-0x0;var _0x2dde95=_0x8db4[_0x616ef5];return _0x2dde95;};'use strict';var _=require(_0x48db('0x0'));var util=require(_0x48db('0x1'));var logger=require(_0x48db('0x2'))(_0x48db('0x3'));var moment=require(_0x48db('0x4'));var BPromise=require(_0x48db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x48db('0x6'));var config=require(_0x48db('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x48db('0x8')]=function(_0x1900d3,_0x164fca){return _0x1900d3['define']('UserVoiceQueueRt',attributes,{'tableName':_0x48db('0x9'),'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 d33917e..b5d50ef 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 _0xd324=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x396e83,_0x19a7b8){var _0x520bdb=function(_0xe42cfb){while(--_0xe42cfb){_0x396e83['push'](_0x396e83['shift']());}};_0x520bdb(++_0x19a7b8);}(_0xd324,0xea));var _0x4d32=function(_0x9148ba,_0x2cb1b5){_0x9148ba=_0x9148ba-0x0;var _0x355e3b=_0xd324[_0x9148ba];return _0x355e3b;};'use strict';var _=require('lodash');var util=require(_0x4d32('0x0'));var moment=require(_0x4d32('0x1'));var BPromise=require(_0x4d32('0x2'));var rs=require(_0x4d32('0x3'));var fs=require('fs');var Redis=require(_0x4d32('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d32('0x5'));var logger=require(_0x4d32('0x6'))('rpc');var config=require(_0x4d32('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d32('0x8')][_0x4d32('0x9')]({'port':0x232a});config['redis']=_[_0x4d32('0xa')](config[_0x4d32('0xb')],{'host':_0x4d32('0xc'),'port':0x18eb});var socket=require(_0x4d32('0xd'))(new Redis(config[_0x4d32('0xb')]));require(_0x4d32('0xe'))[_0x4d32('0xf')](socket);function respondWithRpcPromise(_0x20a9e1,_0x80592c,_0x361b9d){return new BPromise(function(_0x664cde,_0x3baf16){return client[_0x4d32('0x10')](_0x20a9e1,_0x361b9d)[_0x4d32('0x11')](function(_0x434220){logger[_0x4d32('0x12')](_0x4d32('0x13'),_0x80592c,_0x4d32('0x14'));logger[_0x4d32('0x15')](_0x4d32('0x16'),_0x80592c,_0x4d32('0x14'),JSON[_0x4d32('0x17')](_0x434220));if(_0x434220[_0x4d32('0x18')]){if(_0x434220[_0x4d32('0x18')]['code']===0x1f4){logger['error'](_0x4d32('0x13'),_0x80592c,_0x434220[_0x4d32('0x18')][_0x4d32('0x19')]);return _0x3baf16(_0x434220[_0x4d32('0x18')]['message']);}logger[_0x4d32('0x18')](_0x4d32('0x13'),_0x80592c,_0x434220[_0x4d32('0x18')][_0x4d32('0x19')]);return _0x664cde(_0x434220[_0x4d32('0x18')][_0x4d32('0x19')]);}else{logger[_0x4d32('0x12')](_0x4d32('0x13'),_0x80592c,_0x4d32('0x14'));_0x664cde(_0x434220[_0x4d32('0x1a')]['message']);}})[_0x4d32('0x1b')](function(_0x29fc85){logger['error'](_0x4d32('0x13'),_0x80592c,_0x29fc85);_0x3baf16(_0x29fc85);});});}exports[_0x4d32('0x1c')]=function(_0x25df72){var _0x1be926=this;return new Promise(function(_0x151ea1,_0x3dd146){return db[_0x4d32('0x1d')][_0x4d32('0x1e')]({'raw':_0x25df72[_0x4d32('0x1f')]?_0x25df72[_0x4d32('0x1f')][_0x4d32('0x20')]===undefined?!![]:![]:!![],'where':_0x25df72[_0x4d32('0x1f')]?_0x25df72[_0x4d32('0x1f')][_0x4d32('0x21')]||null:null,'attributes':[[db[_0x4d32('0x22')]['fn'](_0x4d32('0x23'),db[_0x4d32('0x22')]['fn']('IF',db[_0x4d32('0x22')][_0x4d32('0x24')](_0x4d32('0x25')))),_0x4d32('0x26')]]})[_0x4d32('0x11')](function(_0x246a77){logger[_0x4d32('0x12')](_0x4d32('0x1c'),_0x25df72);logger[_0x4d32('0x15')]('GetVoiceQueueRtPauses',_0x25df72,JSON[_0x4d32('0x17')](_0x246a77));_0x151ea1(_0x246a77);})[_0x4d32('0x1b')](function(_0x3a1019){logger['error'](_0x4d32('0x1c'),_0x3a1019[_0x4d32('0x19')],_0x25df72);_0x3dd146(_0x1be926[_0x4d32('0x18')](0x1f4,_0x3a1019[_0x4d32('0x19')]));});});}; \ No newline at end of file +var _0x85e4=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','GetVoiceQueueRtPauses','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3c1f79,_0x3a6313){var _0x23155e=function(_0x253549){while(--_0x253549){_0x3c1f79['push'](_0x3c1f79['shift']());}};_0x23155e(++_0x3a6313);}(_0x85e4,0x1f3));var _0x485e=function(_0x23e7bc,_0x3d0933){_0x23e7bc=_0x23e7bc-0x0;var _0x440a87=_0x85e4[_0x23e7bc];return _0x440a87;};'use strict';var _=require(_0x485e('0x0'));var util=require(_0x485e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x485e('0x2'));var fs=require('fs');var Redis=require(_0x485e('0x3'));var db=require(_0x485e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x485e('0x5'))(_0x485e('0x6'));var config=require(_0x485e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x485e('0x8')][_0x485e('0x9')]({'port':0x232a});config[_0x485e('0xa')]=_['defaults'](config['redis'],{'host':_0x485e('0xb'),'port':0x18eb});var socket=require(_0x485e('0xc'))(new Redis(config[_0x485e('0xa')]));require(_0x485e('0xd'))[_0x485e('0xe')](socket);function respondWithRpcPromise(_0x3e75b3,_0x1aeca8,_0x73146f){return new BPromise(function(_0x42d5a7,_0x4c978f){return client[_0x485e('0xf')](_0x3e75b3,_0x73146f)['then'](function(_0x40c9fa){logger[_0x485e('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1aeca8,'request\x20sent');logger[_0x485e('0x11')](_0x485e('0x12'),_0x1aeca8,_0x485e('0x13'),JSON[_0x485e('0x14')](_0x40c9fa));if(_0x40c9fa[_0x485e('0x15')]){if(_0x40c9fa[_0x485e('0x15')][_0x485e('0x16')]===0x1f4){logger[_0x485e('0x15')](_0x485e('0x17'),_0x1aeca8,_0x40c9fa['error']['message']);return _0x4c978f(_0x40c9fa['error'][_0x485e('0x18')]);}logger[_0x485e('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1aeca8,_0x40c9fa[_0x485e('0x15')]['message']);return _0x42d5a7(_0x40c9fa[_0x485e('0x15')][_0x485e('0x18')]);}else{logger[_0x485e('0x10')](_0x485e('0x17'),_0x1aeca8,_0x485e('0x13'));_0x42d5a7(_0x40c9fa[_0x485e('0x19')][_0x485e('0x18')]);}})[_0x485e('0x1a')](function(_0x4a47b0){logger[_0x485e('0x15')](_0x485e('0x17'),_0x1aeca8,_0x4a47b0);_0x4c978f(_0x4a47b0);});});}exports['GetVoiceQueueRtPauses']=function(_0x29f4d3){var _0x2c5c7d=this;return new Promise(function(_0x120edd,_0x349462){return db[_0x485e('0x1b')][_0x485e('0x1c')]({'raw':_0x29f4d3[_0x485e('0x1d')]?_0x29f4d3[_0x485e('0x1d')][_0x485e('0x1e')]===undefined?!![]:![]:!![],'where':_0x29f4d3[_0x485e('0x1d')]?_0x29f4d3['options'][_0x485e('0x1f')]||null:null,'attributes':[[db[_0x485e('0x20')]['fn'](_0x485e('0x21'),db[_0x485e('0x20')]['fn']('IF',db[_0x485e('0x20')][_0x485e('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x1be574){logger[_0x485e('0x10')]('GetVoiceQueueRtPauses',_0x29f4d3);logger[_0x485e('0x11')](_0x485e('0x23'),_0x29f4d3,JSON[_0x485e('0x14')](_0x1be574));_0x120edd(_0x1be574);})[_0x485e('0x1a')](function(_0x35c8f2){logger[_0x485e('0x15')](_0x485e('0x23'),_0x35c8f2['message'],_0x29f4d3);_0x349462(_0x2c5c7d[_0x485e('0x15')](0x1f4,_0x35c8f2[_0x485e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5b6ac1a..bbcf59c 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 _0x7dfd=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x53bbbc,_0x2a1ed9){var _0x43239b=function(_0x33af74){while(--_0x33af74){_0x53bbbc['push'](_0x53bbbc['shift']());}};_0x43239b(++_0x2a1ed9);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd7df('0x0'));var events=[_0xd7df('0x1'),_0xd7df('0x2'),_0xd7df('0x3')];function createListener(_0x346f5f,_0x28c3c9){return function(_0x176418){_0x28c3c9[_0xd7df('0x4')](_0x346f5f,_0x176418);};}function removeListener(_0x3ef231,_0x3d8c5a){return function(){UserVoiceQueueRtEvents[_0xd7df('0x5')](_0x3ef231,_0x3d8c5a);};}exports[_0xd7df('0x6')]=function(_0x36cf0f){for(var _0x39ce98=0x0,_0x354ea7=events[_0xd7df('0x7')];_0x39ce98<_0x354ea7;_0x39ce98++){var _0x2c48a4=events[_0x39ce98];var _0x5c220a=createListener(_0xd7df('0x8')+_0x2c48a4,_0x36cf0f);UserVoiceQueueRtEvents['on'](_0x2c48a4,_0x5c220a);}}; \ No newline at end of file +var _0xb1d3=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x13a3fb,_0x8e5e6b){_0x13a3fb=_0x13a3fb-0x0;var _0x98011f=_0xb1d3[_0x13a3fb];return _0x98011f;};'use strict';var UserVoiceQueueRtEvents=require(_0x3b1d('0x0'));var events=['save','remove','update'];function createListener(_0x1ca377,_0x49262a){return function(_0x8705ca){_0x49262a[_0x3b1d('0x1')](_0x1ca377,_0x8705ca);};}function removeListener(_0x5b94ab,_0x18e301){return function(){UserVoiceQueueRtEvents[_0x3b1d('0x2')](_0x5b94ab,_0x18e301);};}exports[_0x3b1d('0x3')]=function(_0x477115){for(var _0x524e93=0x0,_0x5cbdab=events[_0x3b1d('0x4')];_0x524e93<_0x5cbdab;_0x524e93++){var _0x233d62=events[_0x524e93];var _0x36457=createListener(_0x3b1d('0x5')+_0x233d62,_0x477115);UserVoiceQueueRtEvents['on'](_0x233d62,_0x36457);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 51f811d..0e7e8c4 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(_0x2e8131,_0x57709d){var _0x5c95e9=function(_0x1795c9){while(--_0x1795c9){_0x2e8131['push'](_0x2e8131['shift']());}};_0x5c95e9(++_0x57709d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x853fbb,_0x50d955){var _0x5553e2=function(_0x1cef7){while(--_0x1cef7){_0x853fbb['push'](_0x853fbb['shift']());}};_0x5553e2(++_0x50d955);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index cec2c4e..dc37b1e 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 _0x655d=['sequelize','INTEGER'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x655d,0x172));var _0xd655=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x655d[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xd655('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd655('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc925=['INTEGER','exports'];(function(_0x4d9205,_0x8e02b2){var _0x2d6e01=function(_0x35841a){while(--_0x35841a){_0x4d9205['push'](_0x4d9205['shift']());}};_0x2d6e01(++_0x8e02b2);}(_0xc925,0x71));var _0x5c92=function(_0x16f926,_0x1ba232){_0x16f926=_0x16f926-0x0;var _0x5987f6=_0xc925[_0x16f926];return _0x5987f6;};'use strict';var Sequelize=require('sequelize');module[_0x5c92('0x0')]={'penalty':{'type':Sequelize[_0x5c92('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 723880d..1d838a6 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 _0x40e3=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise','path'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x40e3,0x1da));var _0x340e=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x40e3[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x340e('0x2'));var BPromise=require(_0x340e('0x3'));var rp=require(_0x340e('0x4'));var fs=require('fs');var path=require(_0x340e('0x5'));var rimraf=require('rimraf');var config=require(_0x340e('0x6'));var attributes=require(_0x340e('0x7'));module[_0x340e('0x8')]=function(_0x4c1a64,_0x46dbe1){return _0x4c1a64[_0x340e('0x9')](_0x340e('0xa'),attributes,{'tableName':_0x340e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x616d=['./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x616d,0x18a));var _0xd616=function(_0xbfddb7,_0x1d2da5){_0xbfddb7=_0xbfddb7-0x0;var _0x35c18d=_0x616d[_0xbfddb7];return _0x35c18d;};'use strict';var _=require('lodash');var util=require(_0xd616('0x0'));var logger=require(_0xd616('0x1'))(_0xd616('0x2'));var moment=require(_0xd616('0x3'));var BPromise=require(_0xd616('0x4'));var rp=require(_0xd616('0x5'));var fs=require('fs');var path=require(_0xd616('0x6'));var rimraf=require(_0xd616('0x7'));var config=require(_0xd616('0x8'));var attributes=require(_0xd616('0x9'));module['exports']=function(_0x522960,_0xa18134){return _0x522960[_0xd616('0xa')](_0xd616('0xb'),attributes,{'tableName':_0xd616('0xc'),'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 c8f65de..fdf7957 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 _0x589f=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x587bbe,_0x1bb503){var _0x2cd8ae=function(_0x4b7ced){while(--_0x4b7ced){_0x587bbe['push'](_0x587bbe['shift']());}};_0x2cd8ae(++_0x1bb503);}(_0x589f,0x64));var _0xf589=function(_0x409ad2,_0x5129c1){_0x409ad2=_0x409ad2-0x0;var _0x595b5f=_0x589f[_0x409ad2];return _0x595b5f;};'use strict';var _=require(_0xf589('0x0'));var util=require(_0xf589('0x1'));var moment=require(_0xf589('0x2'));var BPromise=require('bluebird');var rs=require(_0xf589('0x3'));var fs=require('fs');var Redis=require(_0xf589('0x4'));var db=require(_0xf589('0x5'))['db'];var utils=require(_0xf589('0x6'));var logger=require('../../config/logger')(_0xf589('0x7'));var config=require(_0xf589('0x8'));var jayson=require(_0xf589('0x9'));var client=jayson[_0xf589('0xa')][_0xf589('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fce7c,_0x586a5a,_0x1dfe64){return new BPromise(function(_0x377eed,_0x173aa9){return client[_0xf589('0xc')](_0x4fce7c,_0x1dfe64)[_0xf589('0xd')](function(_0x544af6){logger['info'](_0xf589('0xe'),_0x586a5a,_0xf589('0xf'));logger[_0xf589('0x10')](_0xf589('0x11'),_0x586a5a,_0xf589('0xf'),JSON[_0xf589('0x12')](_0x544af6));if(_0x544af6[_0xf589('0x13')]){if(_0x544af6[_0xf589('0x13')][_0xf589('0x14')]===0x1f4){logger[_0xf589('0x13')](_0xf589('0xe'),_0x586a5a,_0x544af6[_0xf589('0x13')][_0xf589('0x15')]);return _0x173aa9(_0x544af6[_0xf589('0x13')][_0xf589('0x15')]);}logger[_0xf589('0x13')](_0xf589('0xe'),_0x586a5a,_0x544af6[_0xf589('0x13')]['message']);return _0x377eed(_0x544af6['error'][_0xf589('0x15')]);}else{logger[_0xf589('0x16')](_0xf589('0xe'),_0x586a5a,_0xf589('0xf'));_0x377eed(_0x544af6[_0xf589('0x17')]['message']);}})[_0xf589('0x18')](function(_0x41faf5){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x586a5a,_0x41faf5);_0x173aa9(_0x41faf5);});});} \ No newline at end of file +var _0x1755=['request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1755,0x1d0));var _0x5175=function(_0x2f236f,_0x36a5a4){_0x2f236f=_0x2f236f-0x0;var _0x45850b=_0x1755[_0x2f236f];return _0x45850b;};'use strict';var _=require('lodash');var util=require(_0x5175('0x0'));var moment=require(_0x5175('0x1'));var BPromise=require(_0x5175('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5175('0x3'));var db=require(_0x5175('0x4'))['db'];var utils=require(_0x5175('0x5'));var logger=require(_0x5175('0x6'))(_0x5175('0x7'));var config=require(_0x5175('0x8'));var jayson=require(_0x5175('0x9'));var client=jayson[_0x5175('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x196d70,_0x246e93,_0x287aa9){return new BPromise(function(_0x206d61,_0x486fa4){return client[_0x5175('0xb')](_0x196d70,_0x287aa9)['then'](function(_0x1bd171){logger[_0x5175('0xc')](_0x5175('0xd'),_0x246e93,_0x5175('0xe'));logger['debug'](_0x5175('0xf'),_0x246e93,_0x5175('0xe'),JSON['stringify'](_0x1bd171));if(_0x1bd171[_0x5175('0x10')]){if(_0x1bd171['error'][_0x5175('0x11')]===0x1f4){logger[_0x5175('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x246e93,_0x1bd171[_0x5175('0x10')]['message']);return _0x486fa4(_0x1bd171[_0x5175('0x10')][_0x5175('0x12')]);}logger[_0x5175('0x10')](_0x5175('0xd'),_0x246e93,_0x1bd171[_0x5175('0x10')][_0x5175('0x12')]);return _0x206d61(_0x1bd171['error']['message']);}else{logger[_0x5175('0xc')](_0x5175('0xd'),_0x246e93,_0x5175('0xe'));_0x206d61(_0x1bd171['result'][_0x5175('0x12')]);}})['catch'](function(_0x432b44){logger['error'](_0x5175('0xd'),_0x246e93,_0x432b44);_0x486fa4(_0x432b44);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 57fd048..a8c7d57 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 _0x8e63=['get','index','/:id','isAuthenticated','create','put','destroy','util','express','Router','fs-extra','../../config/environment','./variable.controller'];(function(_0x1bc0ae,_0x439dfe){var _0x501104=function(_0x2ade0d){while(--_0x2ade0d){_0x1bc0ae['push'](_0x1bc0ae['shift']());}};_0x501104(++_0x439dfe);}(_0x8e63,0x7c));var _0x38e6=function(_0x26b246,_0x2551f4){_0x26b246=_0x26b246-0x0;var _0x8f5c7e=_0x8e63[_0x26b246];return _0x8f5c7e;};'use strict';var multer=require('multer');var util=require(_0x38e6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38e6('0x1'));var router=express[_0x38e6('0x2')]();var fs_extra=require(_0x38e6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x38e6('0x4'));var controller=require(_0x38e6('0x5'));router[_0x38e6('0x6')]('/',auth['isAuthenticated'](),controller[_0x38e6('0x7')]);router[_0x38e6('0x6')](_0x38e6('0x8'),auth[_0x38e6('0x9')](),controller['show']);router['post']('/',auth[_0x38e6('0x9')](),controller[_0x38e6('0xa')]);router[_0x38e6('0xb')](_0x38e6('0x8'),auth[_0x38e6('0x9')](),controller['update']);router['delete'](_0x38e6('0x8'),auth['isAuthenticated'](),controller[_0x38e6('0xc')]);module['exports']=router; \ No newline at end of file +var _0x0aaf=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0x0aaf[_0x173113];return _0x3bea89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0aa('0x0'));var timeout=require(_0xf0aa('0x1'));var express=require(_0xf0aa('0x2'));var router=express[_0xf0aa('0x3')]();var fs_extra=require(_0xf0aa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0aa('0x5'));var config=require(_0xf0aa('0x6'));var controller=require('./variable.controller');router[_0xf0aa('0x7')]('/',auth['isAuthenticated'](),controller[_0xf0aa('0x8')]);router['get'](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xb')]);router['post']('/',auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xc')]);router['put'](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xd')]);router[_0xf0aa('0xe')](_0xf0aa('0x9'),auth[_0xf0aa('0xa')](),controller[_0xf0aa('0xf')]);module[_0xf0aa('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 39022ac..961b62e 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 _0xe88a=['name','sequelize','exports','STRING'];(function(_0x321421,_0x555332){var _0x5374a4=function(_0x31158f){while(--_0x31158f){_0x321421['push'](_0x321421['shift']());}};_0x5374a4(++_0x555332);}(_0xe88a,0xb1));var _0xae88=function(_0x3a608c,_0x4b7d2d){_0x3a608c=_0x3a608c-0x0;var _0x11b84f=_0xe88a[_0x3a608c];return _0x11b84f;};'use strict';var Sequelize=require(_0xae88('0x0'));module[_0xae88('0x1')]={'name':{'type':Sequelize[_0xae88('0x2')],'unique':_0xae88('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae88('0x2')]}}; \ No newline at end of file +var _0x7d26=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d26,0xcb));var _0x67d2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7d26[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x67d2('0x0'));module[_0x67d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a82ba52..0aacd8b 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 _0x834c=['error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','Variable','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x834c,0x170));var _0xc834=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x834c[_0x35ef6b];return _0x3ad145;};'use strict';var emlformat=require(_0xc834('0x0'));var rimraf=require(_0xc834('0x1'));var zipdir=require(_0xc834('0x2'));var jsonpatch=require(_0xc834('0x3'));var rp=require(_0xc834('0x4'));var moment=require('moment');var BPromise=require(_0xc834('0x5'));var Mustache=require(_0xc834('0x6'));var util=require(_0xc834('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc834('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc834('0x9'));var _=require(_0xc834('0xa'));var squel=require(_0xc834('0xb'));var crypto=require(_0xc834('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc834('0xd'));var toCsv=require(_0xc834('0x8'));var querystring=require(_0xc834('0xe'));var Papa=require(_0xc834('0xf'));var Redis=require(_0xc834('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc834('0x11'));var as=require(_0xc834('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc834('0x13'))(_0xc834('0x14'));var utils=require(_0xc834('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc834('0x16'));var db=require(_0xc834('0x17'))['db'];function respondWithStatusCode(_0x35bb85,_0x256e65){_0x256e65=_0x256e65||0xcc;return function(_0x3bf735){if(_0x3bf735){return _0x35bb85[_0xc834('0x18')](_0x256e65);}return _0x35bb85[_0xc834('0x19')](_0x256e65)[_0xc834('0x1a')]();};}function respondWithResult(_0x2190f5,_0x11f171){_0x11f171=_0x11f171||0xc8;return function(_0x45e825){if(_0x45e825){return _0x2190f5['status'](_0x11f171)[_0xc834('0x1b')](_0x45e825);}};}function respondWithFilteredResult(_0x5062d3,_0x30e76d){return function(_0x444770){if(_0x444770){var _0x3619ac=typeof _0x30e76d['offset']===_0xc834('0x1c')&&typeof _0x30e76d[_0xc834('0x1d')]==='undefined';var _0x1ed16d=_0x444770[_0xc834('0x1e')];var _0x3706e0=_0x3619ac?0x0:_0x30e76d[_0xc834('0x1f')];var _0x359216=_0x3619ac?_0x444770['count']:_0x30e76d['offset']+_0x30e76d[_0xc834('0x1d')];var _0x3ae005;if(_0x359216>=_0x1ed16d){_0x359216=_0x1ed16d;_0x3ae005=0xc8;}else{_0x3ae005=0xce;}_0x5062d3['status'](_0x3ae005);return _0x5062d3[_0xc834('0x20')]('Content-Range',_0x3706e0+'-'+_0x359216+'/'+_0x1ed16d)[_0xc834('0x1b')](_0x444770);}return null;};}function patchUpdates(_0x214f8a){return function(_0x39aabe){try{jsonpatch[_0xc834('0x21')](_0x39aabe,_0x214f8a,!![]);}catch(_0x3233e5){return BPromise[_0xc834('0x22')](_0x3233e5);}return _0x39aabe[_0xc834('0x23')]();};}function saveUpdates(_0x47eee0,_0x1ad744){return function(_0x20b23a){if(_0x20b23a){return _0x20b23a[_0xc834('0x24')](_0x47eee0)[_0xc834('0x25')](function(_0x57039b){return _0x57039b;});}return null;};}function removeEntity(_0x209999,_0x1f54fb){return function(_0x5d4fef){if(_0x5d4fef){return _0x5d4fef[_0xc834('0x26')]()['then'](function(){var _0xe57cdc=_0x5d4fef[_0xc834('0x27')]({'plain':!![]});var _0x2e5967=_0xc834('0x28');return db[_0xc834('0x29')][_0xc834('0x26')]({'where':{'type':_0x2e5967,'resourceId':_0xe57cdc['id']}})[_0xc834('0x25')](function(){return _0x5d4fef;});})[_0xc834('0x25')](function(){_0x209999['status'](0xcc)[_0xc834('0x1a')]();});}};}function handleEntityNotFound(_0x465359,_0x12dff3){return function(_0x5e1bc2){if(!_0x5e1bc2){_0x465359[_0xc834('0x18')](0x194);}return _0x5e1bc2;};}function handleError(_0x3e6b46,_0x43ee0a){_0x43ee0a=_0x43ee0a||0x1f4;return function(_0x3ba422){logger[_0xc834('0x2a')](_0x3ba422[_0xc834('0x2b')]);if(_0x3ba422['name']){delete _0x3ba422[_0xc834('0x2c')];}_0x3e6b46[_0xc834('0x19')](_0x43ee0a)[_0xc834('0x2d')](_0x3ba422);};}exports[_0xc834('0x2e')]=function(_0x993f57,_0x2539fd){var _0x202fa2={},_0xd6e7d1={},_0xbf3f52={'count':0x0,'rows':[]};var _0x3c0fab=_[_0xc834('0x2f')](db['Variable'][_0xc834('0x30')],function(_0x54dc25){return{'name':_0x54dc25[_0xc834('0x31')],'type':_0x54dc25['type'][_0xc834('0x32')]};});_0xd6e7d1[_0xc834('0x33')]=_[_0xc834('0x2f')](_0x3c0fab,_0xc834('0x2c'));_0xd6e7d1[_0xc834('0x34')]=_[_0xc834('0x35')](_0x993f57[_0xc834('0x34')]);_0xd6e7d1[_0xc834('0x36')]=_[_0xc834('0x37')](_0xd6e7d1[_0xc834('0x33')],_0xd6e7d1[_0xc834('0x34')]);_0x202fa2[_0xc834('0x38')]=_[_0xc834('0x37')](_0xd6e7d1[_0xc834('0x33')],qs['fields'](_0x993f57[_0xc834('0x34')][_0xc834('0x39')]));_0x202fa2[_0xc834('0x38')]=_0x202fa2[_0xc834('0x38')]['length']?_0x202fa2[_0xc834('0x38')]:_0xd6e7d1['model'];if(!_0x993f57['query'][_0xc834('0x3a')](_0xc834('0x3b'))){_0x202fa2[_0xc834('0x1d')]=qs[_0xc834('0x1d')](_0x993f57[_0xc834('0x34')][_0xc834('0x1d')]);_0x202fa2[_0xc834('0x1f')]=qs[_0xc834('0x1f')](_0x993f57[_0xc834('0x34')][_0xc834('0x1f')]);}_0x202fa2['order']=qs['sort'](_0x993f57['query']['sort']);_0x202fa2[_0xc834('0x3c')]=qs[_0xc834('0x36')](_[_0xc834('0x3d')](_0x993f57[_0xc834('0x34')],_0xd6e7d1[_0xc834('0x36')]),_0x3c0fab);if(_0x993f57[_0xc834('0x34')][_0xc834('0x3e')]){_0x202fa2[_0xc834('0x3c')]=_[_0xc834('0x3f')](_0x202fa2[_0xc834('0x3c')],{'$or':_[_0xc834('0x2f')](_0x3c0fab,function(_0x51c9d1){if(_0x51c9d1[_0xc834('0x40')]!==_0xc834('0x41')){var _0x4231ce={};_0x4231ce[_0x51c9d1[_0xc834('0x2c')]]={'$like':'%'+_0x993f57[_0xc834('0x34')][_0xc834('0x3e')]+'%'};return _0x4231ce;}})});}_0x202fa2=_[_0xc834('0x3f')]({},_0x202fa2,_0x993f57[_0xc834('0x42')]);var _0x2ad040={'where':_0x202fa2[_0xc834('0x3c')]};return db[_0xc834('0x43')][_0xc834('0x1e')](_0x2ad040)[_0xc834('0x25')](function(_0xfca29e){_0xbf3f52[_0xc834('0x1e')]=_0xfca29e;if(_0x993f57[_0xc834('0x34')]['includeAll']){_0x202fa2['include']=[{'all':!![]}];}return db['Variable'][_0xc834('0x44')](_0x202fa2);})['then'](function(_0x57c984){_0xbf3f52[_0xc834('0x45')]=_0x57c984;return _0xbf3f52;})[_0xc834('0x25')](respondWithFilteredResult(_0x2539fd,_0x202fa2))[_0xc834('0x46')](handleError(_0x2539fd,null));};exports[_0xc834('0x47')]=function(_0x321022,_0x2bf898){var _0x48b9c2={'raw':!![],'where':{'id':_0x321022[_0xc834('0x48')]['id']}},_0x278212={};_0x278212[_0xc834('0x33')]=_[_0xc834('0x35')](db[_0xc834('0x43')][_0xc834('0x30')]);_0x278212[_0xc834('0x34')]=_['keys'](_0x321022[_0xc834('0x34')]);_0x278212[_0xc834('0x36')]=_[_0xc834('0x37')](_0x278212[_0xc834('0x33')],_0x278212['query']);_0x48b9c2[_0xc834('0x38')]=_['intersection'](_0x278212[_0xc834('0x33')],qs['fields'](_0x321022[_0xc834('0x34')][_0xc834('0x39')]));_0x48b9c2['attributes']=_0x48b9c2['attributes'][_0xc834('0x49')]?_0x48b9c2[_0xc834('0x38')]:_0x278212[_0xc834('0x33')];if(_0x321022[_0xc834('0x34')]['includeAll']){_0x48b9c2[_0xc834('0x4a')]=[{'all':!![]}];}_0x48b9c2=_['merge']({},_0x48b9c2,_0x321022['options']);return db['Variable'][_0xc834('0x4b')](_0x48b9c2)['then'](handleEntityNotFound(_0x2bf898,null))['then'](respondWithResult(_0x2bf898,null))[_0xc834('0x46')](handleError(_0x2bf898,null));};exports[_0xc834('0x4c')]=function(_0x4f3e48,_0x46a3be){return db[_0xc834('0x43')]['create'](_0x4f3e48[_0xc834('0x4d')],{})[_0xc834('0x25')](function(_0x328737){var _0x91aab=_0x4f3e48[_0xc834('0x4e')]['get']({'plain':!![]});if(!_0x91aab)throw new Error(_0xc834('0x4f'));if(_0x91aab['role']===_0xc834('0x4e')){var _0x4279b6=_0x328737[_0xc834('0x27')]({'plain':!![]});var _0x303ff3=_0xc834('0x28');return db['UserProfileSection'][_0xc834('0x4b')]({'where':{'name':_0x303ff3,'userProfileId':_0x91aab[_0xc834('0x50')]},'raw':!![]})[_0xc834('0x25')](function(_0x2ce0f4){if(_0x2ce0f4&&_0x2ce0f4['autoAssociation']===0x0){return db[_0xc834('0x29')]['create']({'name':_0x4279b6['name'],'resourceId':_0x4279b6['id'],'type':_0x2ce0f4['name'],'sectionId':_0x2ce0f4['id']},{})['then'](function(){return _0x328737;});}else{return _0x328737;}})[_0xc834('0x46')](function(_0x4a536d){logger[_0xc834('0x2a')](_0xc834('0x51'),_0x4a536d);throw _0x4a536d;});}return _0x328737;})[_0xc834('0x25')](respondWithResult(_0x46a3be,0xc9))[_0xc834('0x46')](handleError(_0x46a3be,null));};exports[_0xc834('0x24')]=function(_0x5a4822,_0x1502f5){if(_0x5a4822[_0xc834('0x4d')]['id']){delete _0x5a4822[_0xc834('0x4d')]['id'];}return db['Variable']['find']({'where':{'id':_0x5a4822['params']['id']}})['then'](handleEntityNotFound(_0x1502f5,null))['then'](saveUpdates(_0x5a4822[_0xc834('0x4d')],null))[_0xc834('0x25')](respondWithResult(_0x1502f5,null))[_0xc834('0x46')](handleError(_0x1502f5,null));};exports['destroy']=function(_0xea30c0,_0x1f9623){return db[_0xc834('0x43')][_0xc834('0x4b')]({'where':{'id':_0xea30c0['params']['id']}})[_0xc834('0x25')](handleEntityNotFound(_0x1f9623,null))[_0xc834('0x25')](removeEntity(_0x1f9623,null))['catch'](handleError(_0x1f9623,null));}; \ No newline at end of file +var _0xff71=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','Variables','end','error','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','show','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf'];(function(_0x6978c0,_0x1f6765){var _0x361377=function(_0x2d6cfd){while(--_0x2d6cfd){_0x6978c0['push'](_0x6978c0['shift']());}};_0x361377(++_0x1f6765);}(_0xff71,0x9c));var _0x1ff7=function(_0x1c081d,_0x10b432){_0x1c081d=_0x1c081d-0x0;var _0x2deb0e=_0xff71[_0x1c081d];return _0x2deb0e;};'use strict';var emlformat=require(_0x1ff7('0x0'));var rimraf=require(_0x1ff7('0x1'));var zipdir=require(_0x1ff7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1ff7('0x3'));var BPromise=require(_0x1ff7('0x4'));var Mustache=require(_0x1ff7('0x5'));var util=require(_0x1ff7('0x6'));var path=require(_0x1ff7('0x7'));var sox=require(_0x1ff7('0x8'));var csv=require(_0x1ff7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ff7('0xa'));var _=require(_0x1ff7('0xb'));var squel=require(_0x1ff7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ff7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1ff7('0xe'));var Papa=require(_0x1ff7('0xf'));var Redis=require(_0x1ff7('0x10'));var authService=require(_0x1ff7('0x11'));var qs=require(_0x1ff7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ff7('0x13'));var logger=require(_0x1ff7('0x14'))(_0x1ff7('0x15'));var utils=require('../../config/utils');var config=require(_0x1ff7('0x16'));var licenseUtil=require(_0x1ff7('0x17'));var db=require(_0x1ff7('0x18'))['db'];function respondWithStatusCode(_0x14c3da,_0x18b7a4){_0x18b7a4=_0x18b7a4||0xcc;return function(_0x23c289){if(_0x23c289){return _0x14c3da[_0x1ff7('0x19')](_0x18b7a4);}return _0x14c3da['status'](_0x18b7a4)['end']();};}function respondWithResult(_0x3f294d,_0x17326f){_0x17326f=_0x17326f||0xc8;return function(_0x3218c7){if(_0x3218c7){return _0x3f294d[_0x1ff7('0x1a')](_0x17326f)[_0x1ff7('0x1b')](_0x3218c7);}};}function respondWithFilteredResult(_0x35d161,_0x39cb88){return function(_0x4b1d98){if(_0x4b1d98){var _0x6315c5=typeof _0x39cb88[_0x1ff7('0x1c')]===_0x1ff7('0x1d')&&typeof _0x39cb88[_0x1ff7('0x1e')]===_0x1ff7('0x1d');var _0x211ac7=_0x4b1d98[_0x1ff7('0x1f')];var _0x490667=_0x6315c5?0x0:_0x39cb88['offset'];var _0x330898=_0x6315c5?_0x4b1d98['count']:_0x39cb88[_0x1ff7('0x1c')]+_0x39cb88[_0x1ff7('0x1e')];var _0x177a89;if(_0x330898>=_0x211ac7){_0x330898=_0x211ac7;_0x177a89=0xc8;}else{_0x177a89=0xce;}_0x35d161[_0x1ff7('0x1a')](_0x177a89);return _0x35d161[_0x1ff7('0x20')]('Content-Range',_0x490667+'-'+_0x330898+'/'+_0x211ac7)[_0x1ff7('0x1b')](_0x4b1d98);}return null;};}function patchUpdates(_0x22d46d){return function(_0x5407f0){try{jsonpatch[_0x1ff7('0x21')](_0x5407f0,_0x22d46d,!![]);}catch(_0x4e8027){return BPromise['reject'](_0x4e8027);}return _0x5407f0[_0x1ff7('0x22')]();};}function saveUpdates(_0x3f7d9c,_0x310f1b){return function(_0x43df1c){if(_0x43df1c){return _0x43df1c['update'](_0x3f7d9c)[_0x1ff7('0x23')](function(_0xea8999){return _0xea8999;});}return null;};}function removeEntity(_0xd73230,_0x31213e){return function(_0xb8df5b){if(_0xb8df5b){return _0xb8df5b[_0x1ff7('0x24')]()[_0x1ff7('0x23')](function(){var _0x126027=_0xb8df5b['get']({'plain':!![]});var _0x299908=_0x1ff7('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x299908,'resourceId':_0x126027['id']}})[_0x1ff7('0x23')](function(){return _0xb8df5b;});})[_0x1ff7('0x23')](function(){_0xd73230[_0x1ff7('0x1a')](0xcc)[_0x1ff7('0x26')]();});}};}function handleEntityNotFound(_0x374fa3,_0x4b00fe){return function(_0x3da8c2){if(!_0x3da8c2){_0x374fa3[_0x1ff7('0x19')](0x194);}return _0x3da8c2;};}function handleError(_0x171e7a,_0x312c46){_0x312c46=_0x312c46||0x1f4;return function(_0x559726){logger[_0x1ff7('0x27')](_0x559726[_0x1ff7('0x28')]);if(_0x559726['name']){delete _0x559726[_0x1ff7('0x29')];}_0x171e7a[_0x1ff7('0x1a')](_0x312c46)['send'](_0x559726);};}exports[_0x1ff7('0x2a')]=function(_0x2046d9,_0x1065fb){var _0xc473ce={},_0x1aff84={},_0xf1e6b7={'count':0x0,'rows':[]};var _0x22c393=_[_0x1ff7('0x2b')](db['Variable'][_0x1ff7('0x2c')],function(_0x12d6b4){return{'name':_0x12d6b4['fieldName'],'type':_0x12d6b4['type']['key']};});_0x1aff84[_0x1ff7('0x2d')]=_[_0x1ff7('0x2b')](_0x22c393,_0x1ff7('0x29'));_0x1aff84[_0x1ff7('0x2e')]=_[_0x1ff7('0x2f')](_0x2046d9[_0x1ff7('0x2e')]);_0x1aff84[_0x1ff7('0x30')]=_['intersection'](_0x1aff84[_0x1ff7('0x2d')],_0x1aff84[_0x1ff7('0x2e')]);_0xc473ce['attributes']=_[_0x1ff7('0x31')](_0x1aff84['model'],qs[_0x1ff7('0x32')](_0x2046d9['query'][_0x1ff7('0x32')]));_0xc473ce[_0x1ff7('0x33')]=_0xc473ce[_0x1ff7('0x33')][_0x1ff7('0x34')]?_0xc473ce[_0x1ff7('0x33')]:_0x1aff84[_0x1ff7('0x2d')];if(!_0x2046d9[_0x1ff7('0x2e')]['hasOwnProperty'](_0x1ff7('0x35'))){_0xc473ce[_0x1ff7('0x1e')]=qs[_0x1ff7('0x1e')](_0x2046d9[_0x1ff7('0x2e')][_0x1ff7('0x1e')]);_0xc473ce[_0x1ff7('0x1c')]=qs[_0x1ff7('0x1c')](_0x2046d9[_0x1ff7('0x2e')][_0x1ff7('0x1c')]);}_0xc473ce[_0x1ff7('0x36')]=qs[_0x1ff7('0x37')](_0x2046d9[_0x1ff7('0x2e')][_0x1ff7('0x37')]);_0xc473ce['where']=qs[_0x1ff7('0x30')](_['pick'](_0x2046d9[_0x1ff7('0x2e')],_0x1aff84[_0x1ff7('0x30')]),_0x22c393);if(_0x2046d9[_0x1ff7('0x2e')]['filter']){_0xc473ce[_0x1ff7('0x38')]=_['merge'](_0xc473ce['where'],{'$or':_[_0x1ff7('0x2b')](_0x22c393,function(_0x459b6e){if(_0x459b6e['type']!==_0x1ff7('0x39')){var _0x259787={};_0x259787[_0x459b6e[_0x1ff7('0x29')]]={'$like':'%'+_0x2046d9[_0x1ff7('0x2e')]['filter']+'%'};return _0x259787;}})});}_0xc473ce=_['merge']({},_0xc473ce,_0x2046d9[_0x1ff7('0x3a')]);var _0x582306={'where':_0xc473ce[_0x1ff7('0x38')]};return db[_0x1ff7('0x3b')][_0x1ff7('0x1f')](_0x582306)[_0x1ff7('0x23')](function(_0x47869d){_0xf1e6b7[_0x1ff7('0x1f')]=_0x47869d;if(_0x2046d9[_0x1ff7('0x2e')][_0x1ff7('0x3c')]){_0xc473ce[_0x1ff7('0x3d')]=[{'all':!![]}];}return db[_0x1ff7('0x3b')][_0x1ff7('0x3e')](_0xc473ce);})[_0x1ff7('0x23')](function(_0x1e47da){_0xf1e6b7[_0x1ff7('0x3f')]=_0x1e47da;return _0xf1e6b7;})[_0x1ff7('0x23')](respondWithFilteredResult(_0x1065fb,_0xc473ce))[_0x1ff7('0x40')](handleError(_0x1065fb,null));};exports[_0x1ff7('0x41')]=function(_0x365908,_0x35c9af){var _0x56bd11={'raw':!![],'where':{'id':_0x365908[_0x1ff7('0x42')]['id']}},_0x5ba314={};_0x5ba314[_0x1ff7('0x2d')]=_[_0x1ff7('0x2f')](db[_0x1ff7('0x3b')][_0x1ff7('0x2c')]);_0x5ba314[_0x1ff7('0x2e')]=_[_0x1ff7('0x2f')](_0x365908[_0x1ff7('0x2e')]);_0x5ba314['filters']=_['intersection'](_0x5ba314[_0x1ff7('0x2d')],_0x5ba314[_0x1ff7('0x2e')]);_0x56bd11[_0x1ff7('0x33')]=_[_0x1ff7('0x31')](_0x5ba314[_0x1ff7('0x2d')],qs[_0x1ff7('0x32')](_0x365908[_0x1ff7('0x2e')][_0x1ff7('0x32')]));_0x56bd11['attributes']=_0x56bd11[_0x1ff7('0x33')][_0x1ff7('0x34')]?_0x56bd11[_0x1ff7('0x33')]:_0x5ba314['model'];if(_0x365908[_0x1ff7('0x2e')][_0x1ff7('0x3c')]){_0x56bd11[_0x1ff7('0x3d')]=[{'all':!![]}];}_0x56bd11=_['merge']({},_0x56bd11,_0x365908[_0x1ff7('0x3a')]);return db['Variable']['find'](_0x56bd11)[_0x1ff7('0x23')](handleEntityNotFound(_0x35c9af,null))[_0x1ff7('0x23')](respondWithResult(_0x35c9af,null))[_0x1ff7('0x40')](handleError(_0x35c9af,null));};exports[_0x1ff7('0x43')]=function(_0x4b2bda,_0x2cd19a){return db[_0x1ff7('0x3b')][_0x1ff7('0x43')](_0x4b2bda['body'],{})[_0x1ff7('0x23')](function(_0x35431a){var _0x54ecfe=_0x4b2bda['user'][_0x1ff7('0x44')]({'plain':!![]});if(!_0x54ecfe)throw new Error(_0x1ff7('0x45'));if(_0x54ecfe[_0x1ff7('0x46')]===_0x1ff7('0x47')){var _0x289aa1=_0x35431a[_0x1ff7('0x44')]({'plain':!![]});var _0x46f3ff=_0x1ff7('0x25');return db[_0x1ff7('0x48')][_0x1ff7('0x49')]({'where':{'name':_0x46f3ff,'userProfileId':_0x54ecfe[_0x1ff7('0x4a')]},'raw':!![]})['then'](function(_0x3dfedd){if(_0x3dfedd&&_0x3dfedd[_0x1ff7('0x4b')]===0x0){return db[_0x1ff7('0x4c')][_0x1ff7('0x43')]({'name':_0x289aa1[_0x1ff7('0x29')],'resourceId':_0x289aa1['id'],'type':_0x3dfedd[_0x1ff7('0x29')],'sectionId':_0x3dfedd['id']},{})[_0x1ff7('0x23')](function(){return _0x35431a;});}else{return _0x35431a;}})[_0x1ff7('0x40')](function(_0x3fb831){logger[_0x1ff7('0x27')](_0x1ff7('0x4d'),_0x3fb831);throw _0x3fb831;});}return _0x35431a;})['then'](respondWithResult(_0x2cd19a,0xc9))[_0x1ff7('0x40')](handleError(_0x2cd19a,null));};exports[_0x1ff7('0x4e')]=function(_0x47cd60,_0x5a452d){if(_0x47cd60['body']['id']){delete _0x47cd60['body']['id'];}return db[_0x1ff7('0x3b')]['find']({'where':{'id':_0x47cd60[_0x1ff7('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a452d,null))[_0x1ff7('0x23')](saveUpdates(_0x47cd60['body'],null))[_0x1ff7('0x23')](respondWithResult(_0x5a452d,null))[_0x1ff7('0x40')](handleError(_0x5a452d,null));};exports[_0x1ff7('0x24')]=function(_0x28b67c,_0x6fefa2){return db[_0x1ff7('0x3b')][_0x1ff7('0x49')]({'where':{'id':_0x28b67c['params']['id']}})[_0x1ff7('0x23')](handleEntityNotFound(_0x6fefa2,null))['then'](removeEntity(_0x6fefa2,null))[_0x1ff7('0x40')](handleError(_0x6fefa2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4361b46..f06f35c 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 _0x4257=['./variable.attributes','exports','Variable','tools_variables','lodash','../../config/logger','bluebird','path','rimraf'];(function(_0x5178b5,_0x59d85c){var _0x41a902=function(_0x1f9177){while(--_0x1f9177){_0x5178b5['push'](_0x5178b5['shift']());}};_0x41a902(++_0x59d85c);}(_0x4257,0xdc));var _0x7425=function(_0xb2b990,_0x13a655){_0xb2b990=_0xb2b990-0x0;var _0x2e1f05=_0x4257[_0xb2b990];return _0x2e1f05;};'use strict';var _=require(_0x7425('0x0'));var util=require('util');var logger=require(_0x7425('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7425('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7425('0x3'));var rimraf=require(_0x7425('0x4'));var config=require('../../config/environment');var attributes=require(_0x7425('0x5'));module[_0x7425('0x6')]=function(_0x5b87ec,_0x23ac61){return _0x5b87ec['define'](_0x7425('0x7'),attributes,{'tableName':_0x7425('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f0f=['request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','bluebird'];(function(_0xace1ac,_0x2d20a8){var _0x103c4c=function(_0x12ed69){while(--_0x12ed69){_0xace1ac['push'](_0xace1ac['shift']());}};_0x103c4c(++_0x2d20a8);}(_0x3f0f,0x1dc));var _0xf3f0=function(_0x351a14,_0x2ee0ef){_0x351a14=_0x351a14-0x0;var _0x156f70=_0x3f0f[_0x351a14];return _0x156f70;};'use strict';var _=require(_0xf3f0('0x0'));var util=require(_0xf3f0('0x1'));var logger=require(_0xf3f0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf3f0('0x3'));var rp=require(_0xf3f0('0x4'));var fs=require('fs');var path=require(_0xf3f0('0x5'));var rimraf=require(_0xf3f0('0x6'));var config=require(_0xf3f0('0x7'));var attributes=require(_0xf3f0('0x8'));module['exports']=function(_0x2edc0a,_0x5385e5){return _0x2edc0a[_0xf3f0('0x9')](_0xf3f0('0xa'),attributes,{'tableName':_0xf3f0('0xb'),'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 64fe1fc..62b0a24 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x1cb9,0x14e));var _0x91cb=function(_0x262c77,_0xcab200){_0x262c77=_0x262c77-0x0;var _0x3c35e4=_0x1cb9[_0x262c77];return _0x3c35e4;};'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')]('Variable,\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);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ 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(_0x517823,_0x396658){var _0x1622df=function(_0x5d5f98){while(--_0x5d5f98){_0x517823['push'](_0x517823['shift']());}};_0x1622df(++_0x396658);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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 6666ede..beb5f42 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 _0xae45=['./version.controller','get','isAuthenticated','canUpdate','fetch','/pull','pull','restart','/migrations','express','Router','../../components/auth/service'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xae45,0xed));var _0x5ae4=function(_0x633f85,_0x46e2db){_0x633f85=_0x633f85-0x0;var _0x59b77e=_0xae45[_0x633f85];return _0x59b77e;};'use strict';var express=require(_0x5ae4('0x0'));var router=express[_0x5ae4('0x1')]();var auth=require(_0x5ae4('0x2'));var controller=require(_0x5ae4('0x3'));router[_0x5ae4('0x4')]('/',controller['index']);router['get']('/fetch',auth[_0x5ae4('0x5')](),auth[_0x5ae4('0x6')](),controller[_0x5ae4('0x7')]);router[_0x5ae4('0x4')]('/reset',auth['isAuthenticated'](),auth[_0x5ae4('0x6')](),controller['reset']);router['get'](_0x5ae4('0x8'),auth[_0x5ae4('0x5')](),auth[_0x5ae4('0x6')](),controller[_0x5ae4('0x9')]);router[_0x5ae4('0x4')]('/restart',auth[_0x5ae4('0x5')](),controller[_0x5ae4('0xa')]);router[_0x5ae4('0x4')](_0x5ae4('0xb'),controller['migrations']);module['exports']=router; \ No newline at end of file +var _0xef59=['index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','get'];(function(_0x387e87,_0x5e4954){var _0x2bb7ca=function(_0x32cc3a){while(--_0x32cc3a){_0x387e87['push'](_0x387e87['shift']());}};_0x2bb7ca(++_0x5e4954);}(_0xef59,0xfc));var _0x9ef5=function(_0x3a89dc,_0x54bb1e){_0x3a89dc=_0x3a89dc-0x0;var _0x11c5c9=_0xef59[_0x3a89dc];return _0x11c5c9;};'use strict';var express=require('express');var router=express[_0x9ef5('0x0')]();var auth=require(_0x9ef5('0x1'));var controller=require('./version.controller');router[_0x9ef5('0x2')]('/',controller[_0x9ef5('0x3')]);router[_0x9ef5('0x2')](_0x9ef5('0x4'),auth[_0x9ef5('0x5')](),auth[_0x9ef5('0x6')](),controller['fetch']);router[_0x9ef5('0x2')](_0x9ef5('0x7'),auth[_0x9ef5('0x5')](),auth[_0x9ef5('0x6')](),controller[_0x9ef5('0x8')]);router[_0x9ef5('0x2')]('/pull',auth[_0x9ef5('0x5')](),auth[_0x9ef5('0x6')](),controller[_0x9ef5('0x9')]);router['get'](_0x9ef5('0xa'),auth[_0x9ef5('0x5')](),controller[_0x9ef5('0xb')]);router[_0x9ef5('0x2')](_0x9ef5('0xc'),controller[_0x9ef5('0xd')]);module[_0x9ef5('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index b341a3b..45b283c 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 _0x704a=['exports','version','query','latest','fetch','tags','2.0.0','status','json','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','length','replace','.js','push','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','catch','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index'];(function(_0x5279cb,_0x1601be){var _0x55785a=function(_0x33fd36){while(--_0x33fd36){_0x5279cb['push'](_0x5279cb['shift']());}};_0x55785a(++_0x1601be);}(_0x704a,0x193));var _0xa704=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x704a[_0x21549c];return _0x426cbd;};'use strict';var Umzug=require(_0xa704('0x0'));var path=require(_0xa704('0x1'));var fs=require('fs');var _=require(_0xa704('0x2'));var pkginfo=require(_0xa704('0x3'))(module,'version');var compareVersions=require(_0xa704('0x4'));var exec=require(_0xa704('0x5'))['exec'];var db=require(_0xa704('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xa704('0x7'));var logger=require(_0xa704('0x8'))(_0xa704('0x9'));var git=require(_0xa704('0xa'))(config[_0xa704('0xb')]);exports[_0xa704('0xc')]=function(_0x84cc04,_0x77260){var _0x462894={'current':module[_0xa704('0xd')][_0xa704('0xe')],'phonebar':0x2};if(_0x84cc04[_0xa704('0xf')]&&_0x84cc04['query'][_0xa704('0x10')]){return git[_0xa704('0x11')]()[_0xa704('0x12')](function(_0x53072f,_0x8360ce){_0x462894[_0xa704('0x10')]=(_0x53072f?module[_0xa704('0xd')]['version']:_0x8360ce[_0xa704('0x10')])||_0xa704('0x13');return _0x77260[_0xa704('0x14')](0xc8)[_0xa704('0x15')](_0x462894);});}else{return _0x77260[_0xa704('0x14')](0xc8)[_0xa704('0x15')](_0x462894);}};exports['fetch']=function(_0x31edaa,_0x1b8cf9){return git[_0xa704('0x11')](['origin',_0xa704('0x16')],function(_0x2d53f8){if(_0x2d53f8){logger['error'](_0x2d53f8);return _0x1b8cf9[_0xa704('0x14')](0x1f4)['json'](_0x2d53f8);}logger['info'](_0xa704('0x17'));return _0x1b8cf9[_0xa704('0x14')](0xc8)['json']({'output':_0xa704('0x18')});});};exports['reset']=function(_0x7b06cf,_0x3c5a13){return git[_0xa704('0x19')](['--hard',_0xa704('0x1a')],function(_0x4558e6){if(_0x4558e6){logger['error'](_0x4558e6);return _0x3c5a13[_0xa704('0x14')](0x1f4)[_0xa704('0x15')](_0x4558e6);}logger[_0xa704('0x1b')](_0xa704('0x1c'));return _0x3c5a13[_0xa704('0x14')](0xc8)[_0xa704('0x15')]({'output':_0xa704('0x1d')});});};exports[_0xa704('0x1e')]=function(_0x1a4529,_0x5adbb4){exec(_0xa704('0x1f'),function(_0x45425c,_0x2a1015,_0x4dab23){logger[_0xa704('0x1b')](_0x2a1015);logger[_0xa704('0x1b')](_0x4dab23);if(_0x45425c){logger[_0xa704('0x20')](_0x45425c);return _0x5adbb4[_0xa704('0x14')](0x1f4)['json'](_0x45425c);}return _0x5adbb4[_0xa704('0x14')](0xc8)[_0xa704('0x15')]({'output':_0x2a1015});});};exports[_0xa704('0x21')]=function(_0x3c9ec9,_0x78f3a7){return pm2[_0xa704('0x21')](_0xa704('0x22'))[_0xa704('0x23')](function(_0x111987){logger[_0xa704('0x1b')](_0xa704('0x24'),_0x111987);return _0x78f3a7['status'](0xc8)['json']({'output':_0xa704('0x25')});})['catch'](function(_0x5e8bbf){logger[_0xa704('0x20')](_0x5e8bbf);return _0x78f3a7[_0xa704('0x14')](0x1f4)[_0xa704('0x15')](_0x5e8bbf);});};exports[_0xa704('0x26')]=function(_0xb9bd31,_0x5051eb){var _0x3a38d3=fs['readdirSync'](path[_0xa704('0x27')](config[_0xa704('0xb')],_0xa704('0x28'),_0xa704('0x26')));var _0x478080=[];for(var _0x5ea5d8=0x0;_0x5ea5d8<_0x3a38d3[_0xa704('0x29')];_0x5ea5d8++){var _0x3e7cf1=_0x3a38d3[_0x5ea5d8][_0xa704('0x2a')](_0xa704('0x2b'),'');if(compareVersions(module[_0xa704('0xd')][_0xa704('0xe')],_0x3e7cf1)===-0x1){_0x478080[_0xa704('0x2c')](_0x3e7cf1);}}if(_0x478080[_0xa704('0x29')]){var _0x1e91c8=_0x478080['sort'](compareVersions);var _0x4a6e04=new Umzug({'storage':_0xa704('0x2d'),'storageOptions':{'model':db[_0xa704('0x2e')],'modelName':_0xa704('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0xa704('0x2d')]['getQueryInterface'](),db[_0xa704('0x2d')][_0xa704('0x2f')],function(){throw new Error(_0xa704('0x30'));}],'path':path[_0xa704('0x27')](config['root'],_0xa704('0x28'),_0xa704('0x26')),'pattern':/\.js$/}});_0x4a6e04['up']({'migrations':_['map'](_0x1e91c8,function(_0x558f7d){return _0x558f7d+_0xa704('0x2b');})})[_0xa704('0x23')](function(){return _0x5051eb[_0xa704('0x14')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xa704('0xd')][_0xa704('0xe')]+_0xa704('0x31')+_['last'](_0x1e91c8),'migrations':_[_0xa704('0x27')](_0x1e91c8)});})[_0xa704('0x32')](function(_0x161c03){if(_0x161c03 instanceof db[_0xa704('0x2d')]['UniqueConstraintError']){return _0x5051eb[_0xa704('0x14')](0xc8)[_0xa704('0x15')]({'output':_0xa704('0x33')});}else{return _0x5051eb[_0xa704('0x14')](0x1f4)[_0xa704('0x15')](_0x161c03);}});}else{return _0x5051eb['status'](0xc8)[_0xa704('0x15')]({'output':_0xa704('0x33')});}}; \ No newline at end of file +var _0x2e58=['exec','../../mysqldb','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions'];(function(_0x5f3cab,_0x1b523d){var _0x2db243=function(_0x13ea97){while(--_0x13ea97){_0x5f3cab['push'](_0x5f3cab['shift']());}};_0x2db243(++_0x1b523d);}(_0x2e58,0x1e1));var _0x82e5=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x2e58[_0x4b91c4];return _0x25cb80;};'use strict';var Umzug=require(_0x82e5('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x82e5('0x1'));var pkginfo=require(_0x82e5('0x2'))(module,_0x82e5('0x3'));var compareVersions=require(_0x82e5('0x4'));var exec=require('child_process')[_0x82e5('0x5')];var db=require(_0x82e5('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x82e5('0x7'));var logger=require('../../config/logger')(_0x82e5('0x8'));var git=require(_0x82e5('0x9'))(config[_0x82e5('0xa')]);exports[_0x82e5('0xb')]=function(_0x35369a,_0x1aaeac){var _0x5cf760={'current':module[_0x82e5('0xc')][_0x82e5('0x3')],'phonebar':0x2};if(_0x35369a['query']&&_0x35369a[_0x82e5('0xd')][_0x82e5('0xe')]){return git[_0x82e5('0xf')]()[_0x82e5('0x10')](function(_0x54b2a9,_0x5b85ed){_0x5cf760['latest']=(_0x54b2a9?module[_0x82e5('0xc')][_0x82e5('0x3')]:_0x5b85ed[_0x82e5('0xe')])||_0x82e5('0x11');return _0x1aaeac['status'](0xc8)[_0x82e5('0x12')](_0x5cf760);});}else{return _0x1aaeac[_0x82e5('0x13')](0xc8)[_0x82e5('0x12')](_0x5cf760);}};exports[_0x82e5('0xf')]=function(_0x27f4c4,_0x26e41c){return git[_0x82e5('0xf')](['origin',_0x82e5('0x14')],function(_0x574198){if(_0x574198){logger[_0x82e5('0x15')](_0x574198);return _0x26e41c['status'](0x1f4)['json'](_0x574198);}logger[_0x82e5('0x16')](_0x82e5('0x17'));return _0x26e41c[_0x82e5('0x13')](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x18')});});};exports[_0x82e5('0x19')]=function(_0x235ef0,_0x3fcbe5){return git[_0x82e5('0x19')](['--hard',_0x82e5('0x1a')],function(_0x42cb94){if(_0x42cb94){logger[_0x82e5('0x15')](_0x42cb94);return _0x3fcbe5[_0x82e5('0x13')](0x1f4)[_0x82e5('0x12')](_0x42cb94);}logger[_0x82e5('0x16')](_0x82e5('0x1b'));return _0x3fcbe5['status'](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x1c')});});};exports[_0x82e5('0x1d')]=function(_0x3aa348,_0x23e2c4){exec(_0x82e5('0x1e'),function(_0x15c401,_0x2bc510,_0x4d376a){logger[_0x82e5('0x16')](_0x2bc510);logger[_0x82e5('0x16')](_0x4d376a);if(_0x15c401){logger[_0x82e5('0x15')](_0x15c401);return _0x23e2c4[_0x82e5('0x13')](0x1f4)[_0x82e5('0x12')](_0x15c401);}return _0x23e2c4[_0x82e5('0x13')](0xc8)[_0x82e5('0x12')]({'output':_0x2bc510});});};exports[_0x82e5('0x1f')]=function(_0x36073f,_0x123ad0){return pm2[_0x82e5('0x1f')](_0x82e5('0x20'))[_0x82e5('0x21')](function(_0x3d0386){logger[_0x82e5('0x16')](_0x82e5('0x22'),_0x3d0386);return _0x123ad0[_0x82e5('0x13')](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x23')});})[_0x82e5('0x24')](function(_0x27be6b){logger[_0x82e5('0x15')](_0x27be6b);return _0x123ad0[_0x82e5('0x13')](0x1f4)['json'](_0x27be6b);});};exports[_0x82e5('0x25')]=function(_0x5c6f60,_0x5703a0){var _0x40d8ed=fs[_0x82e5('0x26')](path['join'](config[_0x82e5('0xa')],_0x82e5('0x27'),'migrations'));var _0x377dff=[];for(var _0x274c02=0x0;_0x274c02<_0x40d8ed[_0x82e5('0x28')];_0x274c02++){var _0x186b1c=_0x40d8ed[_0x274c02]['replace']('.js','');if(compareVersions(module[_0x82e5('0xc')][_0x82e5('0x3')],_0x186b1c)===-0x1){_0x377dff[_0x82e5('0x29')](_0x186b1c);}}if(_0x377dff['length']){var _0x4872de=_0x377dff[_0x82e5('0x2a')](compareVersions);var _0x4d1bcf=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x82e5('0x2b'),'columnName':_0x82e5('0x3')},'migrations':{'params':[db[_0x82e5('0x2c')][_0x82e5('0x2d')](),db['sequelize'][_0x82e5('0x2e')],function(){throw new Error(_0x82e5('0x2f'));}],'path':path[_0x82e5('0x30')](config[_0x82e5('0xa')],'server',_0x82e5('0x25')),'pattern':/\.js$/}});_0x4d1bcf['up']({'migrations':_['map'](_0x4872de,function(_0x3f0880){return _0x3f0880+_0x82e5('0x31');})})[_0x82e5('0x21')](function(){return _0x5703a0['status'](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x32')+module[_0x82e5('0xc')][_0x82e5('0x3')]+'\x20to\x20'+_[_0x82e5('0x33')](_0x4872de),'migrations':_[_0x82e5('0x30')](_0x4872de)});})[_0x82e5('0x24')](function(_0xcf017){if(_0xcf017 instanceof db[_0x82e5('0x2c')][_0x82e5('0x34')]){return _0x5703a0['status'](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x35')});}else{return _0x5703a0[_0x82e5('0x13')](0x1f4)[_0x82e5('0x12')](_0xcf017);}});}else{return _0x5703a0[_0x82e5('0x13')](0xc8)[_0x82e5('0x12')]({'output':_0x82e5('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index bcc9284..3dee584 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 _0x65a7=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x65a7,0x1b9));var _0x765a=function(_0x3433d7,_0x6ecebb){_0x3433d7=_0x3433d7-0x0;var _0x918f57=_0x65a7[_0x3433d7];return _0x918f57;};'use strict';var multer=require(_0x765a('0x0'));var util=require(_0x765a('0x1'));var path=require(_0x765a('0x2'));var timeout=require(_0x765a('0x3'));var express=require(_0x765a('0x4'));var router=express[_0x765a('0x5')]();var fs_extra=require(_0x765a('0x6'));var auth=require(_0x765a('0x7'));var interaction=require(_0x765a('0x8'));var config=require(_0x765a('0x9'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x765a('0xa')](),controller[_0x765a('0xb')]);router[_0x765a('0xc')](_0x765a('0xd'),auth[_0x765a('0xa')](),controller[_0x765a('0xe')]);router['get'](_0x765a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x765a('0x10')]('/',auth[_0x765a('0xa')](),controller['create']);router[_0x765a('0x11')](_0x765a('0xf'),auth[_0x765a('0xa')](),controller[_0x765a('0x12')]);router[_0x765a('0x13')](_0x765a('0xf'),auth['isAuthenticated'](),controller[_0x765a('0x14')]);module[_0x765a('0x15')]=router; \ No newline at end of file +var _0x5ca4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x21c869,_0x574e36){var _0x53b30a=function(_0x4abdeb){while(--_0x4abdeb){_0x21c869['push'](_0x21c869['shift']());}};_0x53b30a(++_0x574e36);}(_0x5ca4,0x89));var _0x45ca=function(_0x2c9f58,_0x5637bc){_0x2c9f58=_0x2c9f58-0x0;var _0x1bfaa0=_0x5ca4[_0x2c9f58];return _0x1bfaa0;};'use strict';var multer=require('multer');var util=require(_0x45ca('0x0'));var path=require('path');var timeout=require(_0x45ca('0x1'));var express=require(_0x45ca('0x2'));var router=express['Router']();var fs_extra=require(_0x45ca('0x3'));var auth=require(_0x45ca('0x4'));var interaction=require(_0x45ca('0x5'));var config=require(_0x45ca('0x6'));var controller=require(_0x45ca('0x7'));router[_0x45ca('0x8')]('/',auth[_0x45ca('0x9')](),controller[_0x45ca('0xa')]);router[_0x45ca('0x8')](_0x45ca('0xb'),auth['isAuthenticated'](),controller[_0x45ca('0xc')]);router[_0x45ca('0x8')](_0x45ca('0xd'),auth[_0x45ca('0x9')](),controller[_0x45ca('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x45ca('0xf')](_0x45ca('0xd'),auth['isAuthenticated'](),controller[_0x45ca('0x10')]);router[_0x45ca('0x11')](_0x45ca('0xd'),auth[_0x45ca('0x9')](),controller[_0x45ca('0x12')]);module[_0x45ca('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 454bbcf..70d965b 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 _0xf4f4=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x4fe77d,_0xaad1f1){var _0x296a48=function(_0x444659){while(--_0x444659){_0x4fe77d['push'](_0x4fe77d['shift']());}};_0x296a48(++_0xaad1f1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3c1928,_0x35b748){_0x3c1928=_0x3c1928-0x0;var _0x465e03=_0xf4f4[_0x3c1928];return _0x465e03;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4f4f('0x2')]},'calleridnum':{'type':Sequelize[_0x4f4f('0x2')]},'calleridname':{'type':Sequelize[_0x4f4f('0x2')]},'queue':{'type':Sequelize[_0x4f4f('0x2')]},'interface':{'type':Sequelize[_0x4f4f('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4f4f('0x3')]},'holdtime':{'type':Sequelize[_0x4f4f('0x4')]},'agentcomplete':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4f4f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4f4f('0x4')]},'reason':{'type':Sequelize[_0x4f4f('0x2')]},'lastevent':{'type':Sequelize[_0x4f4f('0x2')]},'channel':{'type':Sequelize[_0x4f4f('0x2')]},'channelstate':{'type':Sequelize[_0x4f4f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4f4f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4f4f('0x2')]},'connectedlinename':{'type':Sequelize[_0x4f4f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4f4f('0x2')]},'exten':{'type':Sequelize[_0x4f4f('0x2')]},'priority':{'type':Sequelize[_0x4f4f('0x2')]},'destchannel':{'type':Sequelize[_0x4f4f('0x2')]},'destchannelstate':{'type':Sequelize[_0x4f4f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4f4f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4f4f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x4f4f('0x2')]},'destlanguage':{'type':Sequelize[_0x4f4f('0x2')]},'destaccountcode':{'type':Sequelize[_0x4f4f('0x2')]},'destcontext':{'type':Sequelize[_0x4f4f('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4f4f('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4f4f('0x2')],'comment':_0x4f4f('0x6')},'transferexten':{'type':Sequelize[_0x4f4f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4f4f('0x2')]},'agententerreason':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8ed7=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x8ed7,0x8b));var _0x78ed=function(_0x5e7dd7,_0x2cb723){_0x5e7dd7=_0x5e7dd7-0x0;var _0x5a9112=_0x8ed7[_0x5e7dd7];return _0x5a9112;};'use strict';var Sequelize=require('sequelize');module[_0x78ed('0x0')]={'type':{'type':Sequelize[_0x78ed('0x1')]},'uniqueid':{'type':Sequelize[_0x78ed('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x78ed('0x1')]},'interface':{'type':Sequelize[_0x78ed('0x1')]},'membername':{'type':Sequelize[_0x78ed('0x1')]},'agentcalledAt':{'type':Sequelize[_0x78ed('0x2')]},'agentconnectAt':{'type':Sequelize[_0x78ed('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x78ed('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x78ed('0x2')]},'agentdumpAt':{'type':Sequelize[_0x78ed('0x2')]},'holdtime':{'type':Sequelize[_0x78ed('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x78ed('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x78ed('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x78ed('0x1')]},'channelstate':{'type':Sequelize[_0x78ed('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'connectedlinename':{'type':Sequelize[_0x78ed('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x78ed('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x78ed('0x1')]},'priority':{'type':Sequelize[_0x78ed('0x1')]},'destchannel':{'type':Sequelize[_0x78ed('0x1')]},'destchannelstate':{'type':Sequelize[_0x78ed('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridnum':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x78ed('0x1')]},'destuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x78ed('0x1')]},'transfer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x78ed('0x1')],'comment':_0x78ed('0x5')},'transferexten':{'type':Sequelize[_0x78ed('0x1')]},'transferuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'agententerreason':{'type':Sequelize[_0x78ed('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index ec9c3f7..d4fcdb1 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 45ce551..d3b6e1c 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 _0x6011=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6011,0x196));var _0x1601=function(_0x239ab9,_0x4dab7a){_0x239ab9=_0x239ab9-0x0;var _0x4304f0=_0x6011[_0x239ab9];return _0x4304f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1601('0x0'));var rp=require(_0x1601('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1601('0x2'));var config=require(_0x1601('0x3'));var attributes=require(_0x1601('0x4'));module[_0x1601('0x5')]=function(_0x3c9c29,_0x38cc43){return _0x3c9c29[_0x1601('0x6')](_0x1601('0x7'),attributes,{'tableName':_0x1601('0x8'),'paranoid':![],'indexes':[{'fields':[_0x1601('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x089f=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','VoiceAgentReport','report_agent','uniqueid','util'];(function(_0x80544e,_0x37a3f3){var _0x4f9b90=function(_0x4f95d6){while(--_0x4f95d6){_0x80544e['push'](_0x80544e['shift']());}};_0x4f9b90(++_0x37a3f3);}(_0x089f,0x1c7));var _0xf089=function(_0x1edac3,_0x2d420a){_0x1edac3=_0x1edac3-0x0;var _0x4c3eff=_0x089f[_0x1edac3];return _0x4c3eff;};'use strict';var _=require('lodash');var util=require(_0xf089('0x0'));var logger=require(_0xf089('0x1'))(_0xf089('0x2'));var moment=require(_0xf089('0x3'));var BPromise=require(_0xf089('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf089('0x5'));var rimraf=require(_0xf089('0x6'));var config=require(_0xf089('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0xf089('0x8')]=function(_0x126d3d,_0x21bce2){return _0x126d3d['define'](_0xf089('0x9'),attributes,{'tableName':_0xf089('0xa'),'paranoid':![],'indexes':[{'fields':[_0xf089('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0ea33f5..5936a19 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 _0x1e2b=['../../mysqldb','rpc','jayson/promise','http','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceAgentReport','options','raw','then','UpdateVoiceAgentReport','update','body','where','limit','util','randomstring','ioredis'];(function(_0x61f2fa,_0x482d91){var _0x4c5518=function(_0x47ddc9){while(--_0x47ddc9){_0x61f2fa['push'](_0x61f2fa['shift']());}};_0x4c5518(++_0x482d91);}(_0x1e2b,0x185));var _0xb1e2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1e2b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xb1e2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb1e2('0x1'));var fs=require('fs');var Redis=require(_0xb1e2('0x2'));var db=require(_0xb1e2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1e2('0x4'));var config=require('../../config/environment');var jayson=require(_0xb1e2('0x5'));var client=jayson['client'][_0xb1e2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1e442c,_0x5f5662,_0x45621f){return new BPromise(function(_0x56d56a,_0x3d92a3){return client[_0xb1e2('0x7')](_0x1e442c,_0x45621f)['then'](function(_0x2535c8){logger['info'](_0xb1e2('0x8'),_0x5f5662,_0xb1e2('0x9'));logger[_0xb1e2('0xa')](_0xb1e2('0xb'),_0x5f5662,_0xb1e2('0x9'),JSON[_0xb1e2('0xc')](_0x2535c8));if(_0x2535c8['error']){if(_0x2535c8[_0xb1e2('0xd')][_0xb1e2('0xe')]===0x1f4){logger[_0xb1e2('0xd')](_0xb1e2('0x8'),_0x5f5662,_0x2535c8['error'][_0xb1e2('0xf')]);return _0x3d92a3(_0x2535c8['error'][_0xb1e2('0xf')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5f5662,_0x2535c8[_0xb1e2('0xd')][_0xb1e2('0xf')]);return _0x56d56a(_0x2535c8['error'][_0xb1e2('0xf')]);}else{logger[_0xb1e2('0x10')](_0xb1e2('0x8'),_0x5f5662,'request\x20sent');_0x56d56a(_0x2535c8[_0xb1e2('0x11')][_0xb1e2('0xf')]);}})[_0xb1e2('0x12')](function(_0x4754ab){logger[_0xb1e2('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x5f5662,_0x4754ab);_0x3d92a3(_0x4754ab);});});}exports['CreateVoiceAgentReport']=function(_0x5b961b){var _0x187c02=this;return new Promise(function(_0x2375a4,_0x388d46){return db[_0xb1e2('0x13')]['create'](_0x5b961b['body'],{'raw':_0x5b961b[_0xb1e2('0x14')]?_0x5b961b[_0xb1e2('0x14')][_0xb1e2('0x15')]===undefined?!![]:![]:!![]})[_0xb1e2('0x16')](function(_0x1d4f6e){logger['info']('CreateVoiceAgentReport',_0x5b961b);logger['debug']('CreateVoiceAgentReport',_0x5b961b,JSON[_0xb1e2('0xc')](_0x1d4f6e));_0x2375a4(_0x1d4f6e);})[_0xb1e2('0x12')](function(_0x28618b){logger[_0xb1e2('0xd')]('CreateVoiceAgentReport',_0x28618b[_0xb1e2('0xf')],_0x5b961b);_0x388d46(_0x187c02[_0xb1e2('0xd')](0x1f4,_0x28618b[_0xb1e2('0xf')]));});});};exports[_0xb1e2('0x17')]=function(_0x3f9bf3){var _0x28e883=this;return new Promise(function(_0x3c183e,_0x3df055){return db[_0xb1e2('0x13')][_0xb1e2('0x18')](_0x3f9bf3[_0xb1e2('0x19')],{'raw':_0x3f9bf3[_0xb1e2('0x14')]?_0x3f9bf3[_0xb1e2('0x14')][_0xb1e2('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9bf3[_0xb1e2('0x14')]?_0x3f9bf3[_0xb1e2('0x14')][_0xb1e2('0x1a')]||null:null,'attributes':_0x3f9bf3[_0xb1e2('0x14')]?_0x3f9bf3[_0xb1e2('0x14')]['attributes']||null:null,'limit':_0x3f9bf3['options']?_0x3f9bf3[_0xb1e2('0x14')][_0xb1e2('0x1b')]||null:null})[_0xb1e2('0x16')](function(_0x2e045d){logger['info'](_0xb1e2('0x17'),_0x3f9bf3);logger[_0xb1e2('0xa')]('UpdateVoiceAgentReport',_0x3f9bf3,JSON[_0xb1e2('0xc')](_0x2e045d));_0x3c183e(_0x2e045d);})[_0xb1e2('0x12')](function(_0x4ad559){logger[_0xb1e2('0xd')](_0xb1e2('0x17'),_0x4ad559[_0xb1e2('0xf')],_0x3f9bf3);_0x3df055(_0x28e883[_0xb1e2('0xd')](0x1f4,_0x4ad559[_0xb1e2('0xf')]));});});}; \ No newline at end of file +var _0x9a21=['create','body','options','raw','debug','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9a21,0x176));var _0x19a2=function(_0x2edea8,_0x56b134){_0x2edea8=_0x2edea8-0x0;var _0x98d4=_0x9a21[_0x2edea8];return _0x98d4;};'use strict';var _=require(_0x19a2('0x0'));var util=require(_0x19a2('0x1'));var moment=require(_0x19a2('0x2'));var BPromise=require(_0x19a2('0x3'));var rs=require(_0x19a2('0x4'));var fs=require('fs');var Redis=require(_0x19a2('0x5'));var db=require(_0x19a2('0x6'))['db'];var utils=require(_0x19a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x19a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x19a2('0x9')][_0x19a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3abce3,_0x13ad08,_0x3866fe){return new BPromise(function(_0x4a4ddf,_0x527ec1){return client[_0x19a2('0xb')](_0x3abce3,_0x3866fe)[_0x19a2('0xc')](function(_0x524620){logger[_0x19a2('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x13ad08,_0x19a2('0xe'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x13ad08,_0x19a2('0xe'),JSON['stringify'](_0x524620));if(_0x524620[_0x19a2('0xf')]){if(_0x524620['error'][_0x19a2('0x10')]===0x1f4){logger[_0x19a2('0xf')](_0x19a2('0x11'),_0x13ad08,_0x524620['error']['message']);return _0x527ec1(_0x524620['error'][_0x19a2('0x12')]);}logger[_0x19a2('0xf')](_0x19a2('0x11'),_0x13ad08,_0x524620['error'][_0x19a2('0x12')]);return _0x4a4ddf(_0x524620[_0x19a2('0xf')]['message']);}else{logger[_0x19a2('0xd')](_0x19a2('0x11'),_0x13ad08,_0x19a2('0xe'));_0x4a4ddf(_0x524620[_0x19a2('0x13')][_0x19a2('0x12')]);}})[_0x19a2('0x14')](function(_0x2a14a3){logger[_0x19a2('0xf')](_0x19a2('0x11'),_0x13ad08,_0x2a14a3);_0x527ec1(_0x2a14a3);});});}exports[_0x19a2('0x15')]=function(_0x5122ee){var _0x31a8f1=this;return new Promise(function(_0x18a0bb,_0x43634b){return db['VoiceAgentReport'][_0x19a2('0x16')](_0x5122ee[_0x19a2('0x17')],{'raw':_0x5122ee[_0x19a2('0x18')]?_0x5122ee[_0x19a2('0x18')][_0x19a2('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xe4ce69){logger[_0x19a2('0xd')](_0x19a2('0x15'),_0x5122ee);logger[_0x19a2('0x1a')]('CreateVoiceAgentReport',_0x5122ee,JSON[_0x19a2('0x1b')](_0xe4ce69));_0x18a0bb(_0xe4ce69);})[_0x19a2('0x14')](function(_0xf58250){logger[_0x19a2('0xf')](_0x19a2('0x15'),_0xf58250[_0x19a2('0x12')],_0x5122ee);_0x43634b(_0x31a8f1[_0x19a2('0xf')](0x1f4,_0xf58250[_0x19a2('0x12')]));});});};exports[_0x19a2('0x1c')]=function(_0x4b1c93){var _0x4b1bc2=this;return new Promise(function(_0x3a3633,_0x30ca24){return db['VoiceAgentReport'][_0x19a2('0x1d')](_0x4b1c93[_0x19a2('0x17')],{'raw':_0x4b1c93[_0x19a2('0x18')]?_0x4b1c93['options'][_0x19a2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1c93[_0x19a2('0x18')]?_0x4b1c93[_0x19a2('0x18')][_0x19a2('0x1e')]||null:null,'attributes':_0x4b1c93[_0x19a2('0x18')]?_0x4b1c93[_0x19a2('0x18')][_0x19a2('0x1f')]||null:null,'limit':_0x4b1c93['options']?_0x4b1c93[_0x19a2('0x18')][_0x19a2('0x20')]||null:null})[_0x19a2('0xc')](function(_0x292006){logger['info'](_0x19a2('0x1c'),_0x4b1c93);logger['debug'](_0x19a2('0x1c'),_0x4b1c93,JSON[_0x19a2('0x1b')](_0x292006));_0x3a3633(_0x292006);})[_0x19a2('0x14')](function(_0x83b4e9){logger[_0x19a2('0xf')]('UpdateVoiceAgentReport',_0x83b4e9[_0x19a2('0x12')],_0x4b1c93);_0x30ca24(_0x4b1bc2[_0x19a2('0xf')](0x1f4,_0x83b4e9[_0x19a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9c055a6..213473d 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 _0x0e85=['/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index'];(function(_0x35644c,_0x3c80a0){var _0xc2e514=function(_0x588b4c){while(--_0x588b4c){_0x35644c['push'](_0x35644c['shift']());}};_0xc2e514(++_0x3c80a0);}(_0x0e85,0x7c));var _0x50e8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x0e85[_0x369151];return _0x4292d5;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['show']);router[_0x50e8('0xc')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x50e8('0x11')]);module[_0x50e8('0x12')]=router; \ No newline at end of file +var _0x9957=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5353,_0x185bc6){var _0x4866f8=function(_0x226de1){while(--_0x226de1){_0x5353['push'](_0x5353['shift']());}};_0x4866f8(++_0x185bc6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0x12'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);module[_0x7995('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index aa5878a..810574b 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 _0xd1eb=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','inbound-fax'];(function(_0xdc86e3,_0x44dd42){var _0x2533db=function(_0x156619){while(--_0x156619){_0xdc86e3['push'](_0xdc86e3['shift']());}};_0x2533db(++_0x44dd42);}(_0xd1eb,0xc3));var _0xbd1e=function(_0xcd6df,_0x4dfe4a){_0xcd6df=_0xcd6df-0x0;var _0x25369b=_0xd1eb[_0xcd6df];return _0x25369b;};'use strict';var Sequelize=require(_0xbd1e('0x0'));module[_0xbd1e('0x1')]={'uniqueid':{'type':Sequelize[_0xbd1e('0x2')]},'type':{'type':Sequelize['ENUM'](_0xbd1e('0x3'),'internal','outbound',_0xbd1e('0x4'),_0xbd1e('0x5'),_0xbd1e('0x6'))},'tag':{'type':Sequelize[_0xbd1e('0x2')]},'accountcode':{'type':Sequelize[_0xbd1e('0x2')]},'source':{'type':Sequelize[_0xbd1e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xbd1e('0x2')]},'channel':{'type':Sequelize[_0xbd1e('0x2')]},'destinationchannel':{'type':Sequelize[_0xbd1e('0x2')]},'lastapplication':{'type':Sequelize[_0xbd1e('0x2')]},'lastdata':{'type':Sequelize[_0xbd1e('0x7')]},'starttime':{'type':Sequelize[_0xbd1e('0x8')]},'systemanswertime':{'type':Sequelize[_0xbd1e('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xbd1e('0x9')]},'billableseconds':{'type':Sequelize[_0xbd1e('0x9')]},'mohtime':{'type':Sequelize[_0xbd1e('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbd1e('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbd1e('0x2')]},'userDisposition':{'type':Sequelize[_0xbd1e('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xbd1e('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xbd1e('0x2')]},'note':{'type':Sequelize[_0xbd1e('0x2')]},'prefix':{'type':Sequelize[_0xbd1e('0x2')]},'routeid':{'type':Sequelize[_0xbd1e('0x9')]},'sipcallid':{'type':Sequelize[_0xbd1e('0x2')]}}; \ No newline at end of file +var _0x7edd=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax'];(function(_0x310afd,_0x44e250){var _0x18fc48=function(_0x30f5df){while(--_0x30f5df){_0x310afd['push'](_0x310afd['shift']());}};_0x18fc48(++_0x44e250);}(_0x7edd,0x72));var _0xd7ed=function(_0x4aee37,_0x2ab26e){_0x4aee37=_0x4aee37-0x0;var _0x547fb8=_0x7edd[_0x4aee37];return _0x547fb8;};'use strict';var Sequelize=require(_0xd7ed('0x0'));module[_0xd7ed('0x1')]={'uniqueid':{'type':Sequelize[_0xd7ed('0x2')]},'type':{'type':Sequelize[_0xd7ed('0x3')](_0xd7ed('0x4'),'internal',_0xd7ed('0x5'),_0xd7ed('0x6'),'outbound-fax',_0xd7ed('0x7'))},'tag':{'type':Sequelize[_0xd7ed('0x2')]},'accountcode':{'type':Sequelize[_0xd7ed('0x2')]},'source':{'type':Sequelize[_0xd7ed('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xd7ed('0x2')]},'callerid':{'type':Sequelize[_0xd7ed('0x2')]},'channel':{'type':Sequelize[_0xd7ed('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd7ed('0x8')]},'starttime':{'type':Sequelize[_0xd7ed('0x9')]},'systemanswertime':{'type':Sequelize[_0xd7ed('0x9')]},'answertime':{'type':Sequelize[_0xd7ed('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xd7ed('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xd7ed('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd7ed('0x2')]},'amaflags':{'type':Sequelize[_0xd7ed('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xd7ed('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xd7ed('0x2')]},'note':{'type':Sequelize[_0xd7ed('0x2')]},'prefix':{'type':Sequelize[_0xd7ed('0x2')]},'routeid':{'type':Sequelize[_0xd7ed('0xa')]},'sipcallid':{'type':Sequelize[_0xd7ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 4c5705e..4eb2135 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xadb5,0xad));var _0x5adb=function(_0x58a6cf,_0x3acf79){_0x58a6cf=_0x58a6cf-0x0;var _0xd71932=_0xadb5[_0x58a6cf];return _0xd71932;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57b4ff,_0x3f3be0){_0x57b4ff=_0x57b4ff-0x0;var _0x28642e=_0x5f2f[_0x57b4ff];return _0x28642e;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3b07f4c..455e628 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 _0x3bc8=['../../config/environment','./voiceCallReport.attributes','VoiceCallReport','uniqueid','util','../../config/logger','api','bluebird','rimraf'];(function(_0x1fcc94,_0x3e038c){var _0x26f26f=function(_0x51519f){while(--_0x51519f){_0x1fcc94['push'](_0x1fcc94['shift']());}};_0x26f26f(++_0x3e038c);}(_0x3bc8,0x1f3));var _0x83bc=function(_0x15718e,_0x2f5096){_0x15718e=_0x15718e-0x0;var _0xf3b1d2=_0x3bc8[_0x15718e];return _0xf3b1d2;};'use strict';var _=require('lodash');var util=require(_0x83bc('0x0'));var logger=require(_0x83bc('0x1'))(_0x83bc('0x2'));var moment=require('moment');var BPromise=require(_0x83bc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x83bc('0x4'));var config=require(_0x83bc('0x5'));var attributes=require(_0x83bc('0x6'));module['exports']=function(_0x4f5953,_0x434f01){return _0x4f5953['define'](_0x83bc('0x7'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x83bc('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0bd=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xe22c4c,_0x1532dd){var _0x17e9dd=function(_0x7fc8eb){while(--_0x7fc8eb){_0xe22c4c['push'](_0xe22c4c['shift']());}};_0x17e9dd(++_0x1532dd);}(_0xa0bd,0x17e));var _0xda0b=function(_0x18e75e,_0x4c1b65){_0x18e75e=_0x18e75e-0x0;var _0x16bf09=_0xa0bd[_0x18e75e];return _0x16bf09;};'use strict';var _=require('lodash');var util=require(_0xda0b('0x0'));var logger=require(_0xda0b('0x1'))(_0xda0b('0x2'));var moment=require(_0xda0b('0x3'));var BPromise=require(_0xda0b('0x4'));var rp=require(_0xda0b('0x5'));var fs=require('fs');var path=require(_0xda0b('0x6'));var rimraf=require(_0xda0b('0x7'));var config=require(_0xda0b('0x8'));var attributes=require(_0xda0b('0x9'));module[_0xda0b('0xa')]=function(_0x103ef8,_0xc7ce90){return _0x103ef8[_0xda0b('0xb')](_0xda0b('0xc'),attributes,{'tableName':_0xda0b('0xd'),'paranoid':![],'indexes':[{'fields':[_0xda0b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 71d1af0..7f71307 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 _0x5876=['findAll','options','raw','where','include','map','model','attributes','then','stringify','catch','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceCallReport','VoiceCallReport'];(function(_0x2970e0,_0x3c6e49){var _0x44d8e8=function(_0x2dc6b4){while(--_0x2dc6b4){_0x2970e0['push'](_0x2970e0['shift']());}};_0x44d8e8(++_0x3c6e49);}(_0x5876,0x1cc));var _0x6587=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x5876[_0x2b8347];return _0x15e93e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6587('0x0'));var BPromise=require(_0x6587('0x1'));var rs=require(_0x6587('0x2'));var fs=require('fs');var Redis=require(_0x6587('0x3'));var db=require(_0x6587('0x4'))['db'];var utils=require(_0x6587('0x5'));var logger=require('../../config/logger')(_0x6587('0x6'));var config=require('../../config/environment');var jayson=require(_0x6587('0x7'));var client=jayson[_0x6587('0x8')][_0x6587('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2846ac,_0x3a55a9,_0xd1334e){return new BPromise(function(_0x57d3c9,_0x1dd460){return client[_0x6587('0xa')](_0x2846ac,_0xd1334e)['then'](function(_0x2f6c2a){logger[_0x6587('0xb')](_0x6587('0xc'),_0x3a55a9,_0x6587('0xd'));logger[_0x6587('0xe')](_0x6587('0xf'),_0x3a55a9,'request\x20sent',JSON['stringify'](_0x2f6c2a));if(_0x2f6c2a[_0x6587('0x10')]){if(_0x2f6c2a['error'][_0x6587('0x11')]===0x1f4){logger[_0x6587('0x10')](_0x6587('0xc'),_0x3a55a9,_0x2f6c2a[_0x6587('0x10')][_0x6587('0x12')]);return _0x1dd460(_0x2f6c2a[_0x6587('0x10')][_0x6587('0x12')]);}logger[_0x6587('0x10')](_0x6587('0xc'),_0x3a55a9,_0x2f6c2a['error']['message']);return _0x57d3c9(_0x2f6c2a[_0x6587('0x10')][_0x6587('0x12')]);}else{logger[_0x6587('0xb')](_0x6587('0xc'),_0x3a55a9,_0x6587('0xd'));_0x57d3c9(_0x2f6c2a['result'][_0x6587('0x12')]);}})['catch'](function(_0x5c321f){logger[_0x6587('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x3a55a9,_0x5c321f);_0x1dd460(_0x5c321f);});});}exports[_0x6587('0x13')]=function(_0xf2b048){var _0x591178=this;return new Promise(function(_0x32680f,_0x3d3448){return db[_0x6587('0x14')][_0x6587('0x15')]({'raw':_0xf2b048[_0x6587('0x16')]?_0xf2b048[_0x6587('0x16')][_0x6587('0x17')]===undefined?!![]:![]:!![],'where':_0xf2b048[_0x6587('0x16')]?_0xf2b048[_0x6587('0x16')][_0x6587('0x18')]||null:null,'attributes':_0xf2b048[_0x6587('0x16')]?_0xf2b048[_0x6587('0x16')]['attributes']||null:null,'limit':_0xf2b048['options']?_0xf2b048[_0x6587('0x16')]['limit']||null:null,'include':_0xf2b048[_0x6587('0x16')]?_0xf2b048[_0x6587('0x16')][_0x6587('0x19')]?_[_0x6587('0x1a')](_0xf2b048[_0x6587('0x16')][_0x6587('0x19')],function(_0x5f24fd){return{'model':db[_0x5f24fd['model']],'as':_0x5f24fd['as'],'attributes':_0x5f24fd['attributes'],'include':_0x5f24fd[_0x6587('0x19')]?_[_0x6587('0x1a')](_0x5f24fd[_0x6587('0x19')],function(_0x12e308){return{'model':db[_0x12e308[_0x6587('0x1b')]],'as':_0x12e308['as'],'attributes':_0x12e308[_0x6587('0x1c')],'include':_0x12e308['include']?_[_0x6587('0x1a')](_0x12e308[_0x6587('0x19')],function(_0x4c747d){return{'model':db[_0x4c747d[_0x6587('0x1b')]],'as':_0x4c747d['as'],'attributes':_0x4c747d[_0x6587('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6587('0x1d')](function(_0x386862){logger[_0x6587('0xb')](_0x6587('0x13'),_0xf2b048);logger[_0x6587('0xe')](_0x6587('0x13'),_0xf2b048,JSON[_0x6587('0x1e')](_0x386862));_0x32680f(_0x386862);})[_0x6587('0x1f')](function(_0x7d0844){logger[_0x6587('0x10')](_0x6587('0x13'),_0x7d0844[_0x6587('0x12')],_0xf2b048);_0x3d3448(_0x591178[_0x6587('0x10')](0x1f4,_0x7d0844[_0x6587('0x12')]));});});};exports[_0x6587('0x20')]=function(_0x3c8db7){var _0x1bf47c=this;return new Promise(function(_0x22ffcb,_0xf1e326){return db[_0x6587('0x14')][_0x6587('0x21')](_0x3c8db7[_0x6587('0x22')],{'raw':_0x3c8db7[_0x6587('0x16')]?_0x3c8db7[_0x6587('0x16')][_0x6587('0x17')]===undefined?!![]:![]:!![]})[_0x6587('0x1d')](function(_0x452f33){logger[_0x6587('0xb')]('CreateVoiceCallReport',_0x3c8db7);logger[_0x6587('0xe')](_0x6587('0x20'),_0x3c8db7,JSON[_0x6587('0x1e')](_0x452f33));_0x22ffcb(_0x452f33);})[_0x6587('0x1f')](function(_0x51bd07){logger[_0x6587('0x10')](_0x6587('0x20'),_0x51bd07['message'],_0x3c8db7);_0xf1e326(_0x1bf47c['error'](0x1f4,_0x51bd07[_0x6587('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x5576db){var _0x2e7f01=this;return new Promise(function(_0x4ff57a,_0x20fe13){return db[_0x6587('0x14')][_0x6587('0x23')](_0x5576db[_0x6587('0x22')],{'raw':_0x5576db[_0x6587('0x16')]?_0x5576db[_0x6587('0x16')][_0x6587('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5576db[_0x6587('0x16')]?_0x5576db[_0x6587('0x16')][_0x6587('0x18')]||null:null,'attributes':_0x5576db[_0x6587('0x16')]?_0x5576db['options'][_0x6587('0x1c')]||null:null,'limit':_0x5576db[_0x6587('0x16')]?_0x5576db[_0x6587('0x16')]['limit']||null:null})[_0x6587('0x1d')](function(_0x156bfb){logger[_0x6587('0xb')]('UpdateVoiceCallReport',_0x5576db);logger[_0x6587('0xe')](_0x6587('0x24'),_0x5576db,JSON[_0x6587('0x1e')](_0x156bfb));_0x4ff57a(_0x156bfb);})['catch'](function(_0x395c7e){logger[_0x6587('0x10')](_0x6587('0x24'),_0x395c7e[_0x6587('0x12')],_0x5576db);_0x20fe13(_0x2e7f01[_0x6587('0x10')](0x1f4,_0x395c7e[_0x6587('0x12')]));});});}; \ No newline at end of file +var _0x1657=['result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','map','model','CreateVoiceCallReport','create','raw','body','where','UpdateVoiceCallReport','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x21e6fa,_0x1f2528){var _0x7dc8bf=function(_0x4018bb){while(--_0x4018bb){_0x21e6fa['push'](_0x21e6fa['shift']());}};_0x7dc8bf(++_0x1f2528);}(_0x1657,0xdd));var _0x7165=function(_0x1cbf66,_0x77cb3c){_0x1cbf66=_0x1cbf66-0x0;var _0x370571=_0x1657[_0x1cbf66];return _0x370571;};'use strict';var _=require(_0x7165('0x0'));var util=require('util');var moment=require(_0x7165('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7165('0x2'));var db=require(_0x7165('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7165('0x4'))(_0x7165('0x5'));var config=require(_0x7165('0x6'));var jayson=require(_0x7165('0x7'));var client=jayson[_0x7165('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4de32d,_0x1a0fa7,_0x40b4eb){return new BPromise(function(_0x182534,_0x1ae1a3){return client['request'](_0x4de32d,_0x40b4eb)[_0x7165('0x9')](function(_0xe6cf5d){logger[_0x7165('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x1a0fa7,_0x7165('0xb'));logger[_0x7165('0xc')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1a0fa7,'request\x20sent',JSON[_0x7165('0xd')](_0xe6cf5d));if(_0xe6cf5d[_0x7165('0xe')]){if(_0xe6cf5d['error']['code']===0x1f4){logger[_0x7165('0xe')](_0x7165('0xf'),_0x1a0fa7,_0xe6cf5d[_0x7165('0xe')][_0x7165('0x10')]);return _0x1ae1a3(_0xe6cf5d[_0x7165('0xe')][_0x7165('0x10')]);}logger[_0x7165('0xe')](_0x7165('0xf'),_0x1a0fa7,_0xe6cf5d[_0x7165('0xe')][_0x7165('0x10')]);return _0x182534(_0xe6cf5d[_0x7165('0xe')]['message']);}else{logger[_0x7165('0xa')](_0x7165('0xf'),_0x1a0fa7,_0x7165('0xb'));_0x182534(_0xe6cf5d[_0x7165('0x11')][_0x7165('0x10')]);}})[_0x7165('0x12')](function(_0x66fb8e){logger['error'](_0x7165('0xf'),_0x1a0fa7,_0x66fb8e);_0x1ae1a3(_0x66fb8e);});});}exports[_0x7165('0x13')]=function(_0x2130c0){var _0x513e71=this;return new Promise(function(_0x21e02c,_0x150f56){return db[_0x7165('0x14')][_0x7165('0x15')]({'raw':_0x2130c0[_0x7165('0x16')]?_0x2130c0[_0x7165('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2130c0[_0x7165('0x16')]?_0x2130c0[_0x7165('0x16')]['where']||null:null,'attributes':_0x2130c0[_0x7165('0x16')]?_0x2130c0[_0x7165('0x16')][_0x7165('0x17')]||null:null,'limit':_0x2130c0[_0x7165('0x16')]?_0x2130c0[_0x7165('0x16')][_0x7165('0x18')]||null:null,'include':_0x2130c0[_0x7165('0x16')]?_0x2130c0[_0x7165('0x16')][_0x7165('0x19')]?_[_0x7165('0x1a')](_0x2130c0[_0x7165('0x16')][_0x7165('0x19')],function(_0x34e177){return{'model':db[_0x34e177[_0x7165('0x1b')]],'as':_0x34e177['as'],'attributes':_0x34e177[_0x7165('0x17')],'include':_0x34e177['include']?_[_0x7165('0x1a')](_0x34e177['include'],function(_0xbb01b5){return{'model':db[_0xbb01b5['model']],'as':_0xbb01b5['as'],'attributes':_0xbb01b5[_0x7165('0x17')],'include':_0xbb01b5[_0x7165('0x19')]?_[_0x7165('0x1a')](_0xbb01b5['include'],function(_0x106967){return{'model':db[_0x106967['model']],'as':_0x106967['as'],'attributes':_0x106967['attributes']};}):[]};}):[]};}):[]:[]})[_0x7165('0x9')](function(_0x3b967f){logger[_0x7165('0xa')]('GetVoiceCallReport',_0x2130c0);logger[_0x7165('0xc')](_0x7165('0x13'),_0x2130c0,JSON[_0x7165('0xd')](_0x3b967f));_0x21e02c(_0x3b967f);})[_0x7165('0x12')](function(_0xfeda2d){logger[_0x7165('0xe')](_0x7165('0x13'),_0xfeda2d[_0x7165('0x10')],_0x2130c0);_0x150f56(_0x513e71[_0x7165('0xe')](0x1f4,_0xfeda2d['message']));});});};exports[_0x7165('0x1c')]=function(_0x4b03f7){var _0x1c35f4=this;return new Promise(function(_0x454167,_0x58c638){return db[_0x7165('0x14')][_0x7165('0x1d')](_0x4b03f7['body'],{'raw':_0x4b03f7[_0x7165('0x16')]?_0x4b03f7[_0x7165('0x16')][_0x7165('0x1e')]===undefined?!![]:![]:!![]})[_0x7165('0x9')](function(_0x5aa4dd){logger[_0x7165('0xa')](_0x7165('0x1c'),_0x4b03f7);logger['debug'](_0x7165('0x1c'),_0x4b03f7,JSON[_0x7165('0xd')](_0x5aa4dd));_0x454167(_0x5aa4dd);})[_0x7165('0x12')](function(_0x170924){logger[_0x7165('0xe')](_0x7165('0x1c'),_0x170924[_0x7165('0x10')],_0x4b03f7);_0x58c638(_0x1c35f4[_0x7165('0xe')](0x1f4,_0x170924[_0x7165('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x2544a2){var _0x20483f=this;return new Promise(function(_0x42dfbf,_0x17fb79){return db[_0x7165('0x14')]['update'](_0x2544a2[_0x7165('0x1f')],{'raw':_0x2544a2['options']?_0x2544a2[_0x7165('0x16')][_0x7165('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2544a2[_0x7165('0x16')]?_0x2544a2[_0x7165('0x16')][_0x7165('0x20')]||null:null,'attributes':_0x2544a2[_0x7165('0x16')]?_0x2544a2[_0x7165('0x16')][_0x7165('0x17')]||null:null,'limit':_0x2544a2['options']?_0x2544a2['options'][_0x7165('0x18')]||null:null})[_0x7165('0x9')](function(_0x46b708){logger['info'](_0x7165('0x21'),_0x2544a2);logger[_0x7165('0xc')](_0x7165('0x21'),_0x2544a2,JSON['stringify'](_0x46b708));_0x42dfbf(_0x46b708);})[_0x7165('0x12')](function(_0x48a4df){logger[_0x7165('0xe')]('UpdateVoiceCallReport',_0x48a4df['message'],_0x2544a2);_0x17fb79(_0x20483f[_0x7165('0xe')](0x1f4,_0x48a4df[_0x7165('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 146228b..e53d1e1 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 _0x63b5=['get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','index'];(function(_0x4a758e,_0x23d77d){var _0x4626f4=function(_0x5b4dcf){while(--_0x5b4dcf){_0x4a758e['push'](_0x4a758e['shift']());}};_0x4626f4(++_0x23d77d);}(_0x63b5,0x125));var _0x563b=function(_0x4ebd1e,_0xb8cecd){_0x4ebd1e=_0x4ebd1e-0x0;var _0x1eb74b=_0x63b5[_0x4ebd1e];return _0x1eb74b;};'use strict';var multer=require(_0x563b('0x0'));var util=require('util');var path=require(_0x563b('0x1'));var timeout=require(_0x563b('0x2'));var express=require(_0x563b('0x3'));var router=express[_0x563b('0x4')]();var fs_extra=require(_0x563b('0x5'));var auth=require(_0x563b('0x6'));var interaction=require(_0x563b('0x7'));var config=require(_0x563b('0x8'));var controller=require(_0x563b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x563b('0xa')]);router[_0x563b('0xb')](_0x563b('0xc'),auth[_0x563b('0xd')](),controller[_0x563b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x563b('0xf')]('/:id',auth[_0x563b('0xd')](),controller['update']);router[_0x563b('0x10')](_0x563b('0xc'),auth[_0x563b('0xd')](),controller[_0x563b('0x11')]);module[_0x563b('0x12')]=router; \ No newline at end of file +var _0x680f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','multer','util','path'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x680f,0x10b));var _0xf680=function(_0x2890ad,_0x197305){_0x2890ad=_0x2890ad-0x0;var _0x173d28=_0x680f[_0x2890ad];return _0x173d28;};'use strict';var multer=require(_0xf680('0x0'));var util=require(_0xf680('0x1'));var path=require(_0xf680('0x2'));var timeout=require('connect-timeout');var express=require(_0xf680('0x3'));var router=express['Router']();var fs_extra=require(_0xf680('0x4'));var auth=require(_0xf680('0x5'));var interaction=require(_0xf680('0x6'));var config=require(_0xf680('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xf680('0x8')](),controller[_0xf680('0x9')]);router[_0xf680('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf680('0xb')]);router[_0xf680('0xc')]('/',auth['isAuthenticated'](),controller[_0xf680('0xd')]);router[_0xf680('0xe')](_0xf680('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xf680('0x10')](_0xf680('0xf'),auth[_0xf680('0x8')](),controller[_0xf680('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 7ea72e7..d4b6e12 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 _0xf6ea=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','split'];(function(_0x37eb8a,_0x53ec7d){var _0x287b3c=function(_0x150628){while(--_0x150628){_0x37eb8a['push'](_0x37eb8a['shift']());}};_0x287b3c(++_0x53ec7d);}(_0xf6ea,0x151));var _0xaf6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf6ea[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xaf6e('0x0'));module[_0xaf6e('0x1')]={'name':{'type':Sequelize[_0xaf6e('0x2')]},'prefix':{'type':Sequelize[_0xaf6e('0x2')],'unique':_0xaf6e('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xaf6e('0x2')],'set':function(_0x3ccbe9){this[_0xaf6e('0x4')](_0xaf6e('0x5'),_0x3ccbe9?_0x3ccbe9['join'](''):[]);},'get':function(){return this['getDataValue'](_0xaf6e('0x5'))?this['getDataValue'](_0xaf6e('0x5'))[_0xaf6e('0x6')](''):[];}},'auth':{'type':Sequelize[_0xaf6e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xaf6e('0x2')]},'record':{'type':Sequelize[_0xaf6e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xaf6e('0x2')]},'description':{'type':Sequelize[_0xaf6e('0x2')]}}; \ No newline at end of file +var _0x95e2=['BOOLEAN','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x95e2,0x199));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x295e('0x0')]},'prefix':{'type':Sequelize[_0x295e('0x0')],'unique':_0x295e('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x295e('0x0')],'set':function(_0x233495){this[_0x295e('0x2')](_0x295e('0x3'),_0x233495?_0x233495[_0x295e('0x4')](''):[]);},'get':function(){return this[_0x295e('0x5')](_0x295e('0x3'))?this['getDataValue'](_0x295e('0x3'))[_0x295e('0x6')](''):[];}},'auth':{'type':Sequelize[_0x295e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x295e('0x0')]},'record':{'type':Sequelize[_0x295e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x295e('0x0')]},'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 c41ee4e..4905d11 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 _0xc79f=['stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','user','role','ChanSpies','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error'];(function(_0x2cc78b,_0x1c9f1c){var _0x37466f=function(_0xfe0a30){while(--_0xfe0a30){_0x2cc78b['push'](_0x2cc78b['shift']());}};_0x37466f(++_0x1c9f1c);}(_0xc79f,0x82));var _0xfc79=function(_0x4d9a4b,_0x430486){_0x4d9a4b=_0x4d9a4b-0x0;var _0x5326cc=_0xc79f[_0x4d9a4b];return _0x5326cc;};'use strict';var emlformat=require(_0xfc79('0x0'));var rimraf=require(_0xfc79('0x1'));var zipdir=require(_0xfc79('0x2'));var jsonpatch=require(_0xfc79('0x3'));var rp=require(_0xfc79('0x4'));var moment=require('moment');var BPromise=require(_0xfc79('0x5'));var Mustache=require(_0xfc79('0x6'));var util=require(_0xfc79('0x7'));var path=require(_0xfc79('0x8'));var sox=require(_0xfc79('0x9'));var csv=require(_0xfc79('0xa'));var ejs=require(_0xfc79('0xb'));var fs=require('fs');var fs_extra=require(_0xfc79('0xc'));var _=require(_0xfc79('0xd'));var squel=require('squel');var crypto=require(_0xfc79('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfc79('0xf'));var toCsv=require(_0xfc79('0xa'));var querystring=require(_0xfc79('0x10'));var Papa=require('papaparse');var Redis=require(_0xfc79('0x11'));var authService=require(_0xfc79('0x12'));var qs=require(_0xfc79('0x13'));var as=require(_0xfc79('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc79('0x15'))(_0xfc79('0x16'));var utils=require(_0xfc79('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfc79('0x18'));var db=require(_0xfc79('0x19'))['db'];function respondWithStatusCode(_0x4b7f0e,_0xc2f79){_0xc2f79=_0xc2f79||0xcc;return function(_0x493a04){if(_0x493a04){return _0x4b7f0e[_0xfc79('0x1a')](_0xc2f79);}return _0x4b7f0e[_0xfc79('0x1b')](_0xc2f79)[_0xfc79('0x1c')]();};}function respondWithResult(_0x4996b6,_0x33bf71){_0x33bf71=_0x33bf71||0xc8;return function(_0x29c937){if(_0x29c937){return _0x4996b6[_0xfc79('0x1b')](_0x33bf71)[_0xfc79('0x1d')](_0x29c937);}};}function respondWithFilteredResult(_0x895b17,_0x7ef734){return function(_0x4cb052){if(_0x4cb052){var _0x228dab=typeof _0x7ef734[_0xfc79('0x1e')]===_0xfc79('0x1f')&&typeof _0x7ef734[_0xfc79('0x20')]==='undefined';var _0x39983a=_0x4cb052[_0xfc79('0x21')];var _0x216501=_0x228dab?0x0:_0x7ef734[_0xfc79('0x1e')];var _0x489e9a=_0x228dab?_0x4cb052['count']:_0x7ef734[_0xfc79('0x1e')]+_0x7ef734['limit'];var _0x816333;if(_0x489e9a>=_0x39983a){_0x489e9a=_0x39983a;_0x816333=0xc8;}else{_0x816333=0xce;}_0x895b17[_0xfc79('0x1b')](_0x816333);return _0x895b17[_0xfc79('0x22')](_0xfc79('0x23'),_0x216501+'-'+_0x489e9a+'/'+_0x39983a)['json'](_0x4cb052);}return null;};}function patchUpdates(_0x8187e2){return function(_0x418f64){try{jsonpatch[_0xfc79('0x24')](_0x418f64,_0x8187e2,!![]);}catch(_0x3c3c54){return BPromise[_0xfc79('0x25')](_0x3c3c54);}return _0x418f64[_0xfc79('0x26')]();};}function saveUpdates(_0x287549,_0x5009d5){return function(_0x1d6551){if(_0x1d6551){return _0x1d6551[_0xfc79('0x27')](_0x287549)[_0xfc79('0x28')](function(_0x2042ee){return _0x2042ee;});}return null;};}function removeEntity(_0x44ab6b,_0x5a1c6e){return function(_0x4d8636){if(_0x4d8636){return _0x4d8636['destroy']()[_0xfc79('0x28')](function(){var _0x3dc4e4=_0x4d8636[_0xfc79('0x29')]({'plain':!![]});var _0x324191='ChanSpies';return db[_0xfc79('0x2a')]['destroy']({'where':{'type':_0x324191,'resourceId':_0x3dc4e4['id']}})[_0xfc79('0x28')](function(){return _0x4d8636;});})['then'](function(){_0x44ab6b[_0xfc79('0x1b')](0xcc)[_0xfc79('0x1c')]();});}};}function handleEntityNotFound(_0x96ceeb,_0x523270){return function(_0x14fd6c){if(!_0x14fd6c){_0x96ceeb[_0xfc79('0x1a')](0x194);}return _0x14fd6c;};}function handleError(_0x168ec2,_0x3a8ca3){_0x3a8ca3=_0x3a8ca3||0x1f4;return function(_0x2ae979){logger[_0xfc79('0x2b')](_0x2ae979[_0xfc79('0x2c')]);if(_0x2ae979['name']){delete _0x2ae979[_0xfc79('0x2d')];}_0x168ec2[_0xfc79('0x1b')](_0x3a8ca3)[_0xfc79('0x2e')](_0x2ae979);};}exports[_0xfc79('0x2f')]=function(_0x52212b,_0x386b1b){var _0x106f1a={},_0x184921={},_0x25c703={'count':0x0,'rows':[]};var _0x43c181=_[_0xfc79('0x30')](db['VoiceChanSpy']['rawAttributes'],function(_0x3a57c3){return{'name':_0x3a57c3['fieldName'],'type':_0x3a57c3[_0xfc79('0x31')][_0xfc79('0x32')]};});_0x184921[_0xfc79('0x33')]=_[_0xfc79('0x30')](_0x43c181,_0xfc79('0x2d'));_0x184921[_0xfc79('0x34')]=_[_0xfc79('0x35')](_0x52212b[_0xfc79('0x34')]);_0x184921[_0xfc79('0x36')]=_['intersection'](_0x184921[_0xfc79('0x33')],_0x184921[_0xfc79('0x34')]);_0x106f1a[_0xfc79('0x37')]=_[_0xfc79('0x38')](_0x184921[_0xfc79('0x33')],qs['fields'](_0x52212b[_0xfc79('0x34')][_0xfc79('0x39')]));_0x106f1a['attributes']=_0x106f1a['attributes']['length']?_0x106f1a[_0xfc79('0x37')]:_0x184921[_0xfc79('0x33')];if(!_0x52212b[_0xfc79('0x34')][_0xfc79('0x3a')](_0xfc79('0x3b'))){_0x106f1a['limit']=qs[_0xfc79('0x20')](_0x52212b[_0xfc79('0x34')][_0xfc79('0x20')]);_0x106f1a['offset']=qs[_0xfc79('0x1e')](_0x52212b[_0xfc79('0x34')]['offset']);}_0x106f1a['order']=qs[_0xfc79('0x3c')](_0x52212b[_0xfc79('0x34')][_0xfc79('0x3c')]);_0x106f1a[_0xfc79('0x3d')]=qs[_0xfc79('0x36')](_[_0xfc79('0x3e')](_0x52212b[_0xfc79('0x34')],_0x184921[_0xfc79('0x36')]),_0x43c181);if(_0x52212b[_0xfc79('0x34')]['filter']){_0x106f1a[_0xfc79('0x3d')]=_[_0xfc79('0x3f')](_0x106f1a[_0xfc79('0x3d')],{'$or':_['map'](_0x43c181,function(_0xa409ff){if(_0xa409ff['type']!==_0xfc79('0x40')){var _0x36cb81={};_0x36cb81[_0xa409ff[_0xfc79('0x2d')]]={'$like':'%'+_0x52212b[_0xfc79('0x34')][_0xfc79('0x41')]+'%'};return _0x36cb81;}})});}_0x106f1a=_[_0xfc79('0x3f')]({},_0x106f1a,_0x52212b[_0xfc79('0x42')]);var _0x3022a7={'where':_0x106f1a[_0xfc79('0x3d')]};return db[_0xfc79('0x43')][_0xfc79('0x21')](_0x3022a7)[_0xfc79('0x28')](function(_0x305cec){_0x25c703[_0xfc79('0x21')]=_0x305cec;if(_0x52212b[_0xfc79('0x34')][_0xfc79('0x44')]){_0x106f1a[_0xfc79('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xfc79('0x46')](_0x106f1a);})['then'](function(_0xdfcefb){_0x25c703[_0xfc79('0x47')]=_0xdfcefb;return _0x25c703;})[_0xfc79('0x28')](respondWithFilteredResult(_0x386b1b,_0x106f1a))[_0xfc79('0x48')](handleError(_0x386b1b,null));};exports[_0xfc79('0x49')]=function(_0x98f935,_0x39bd13){var _0x3f6840={'raw':![],'where':{'id':_0x98f935[_0xfc79('0x4a')]['id']}},_0x17028c={};_0x17028c[_0xfc79('0x33')]=_['keys'](db['VoiceChanSpy'][_0xfc79('0x4b')]);_0x17028c['query']=_[_0xfc79('0x35')](_0x98f935['query']);_0x17028c['filters']=_[_0xfc79('0x38')](_0x17028c['model'],_0x17028c[_0xfc79('0x34')]);_0x3f6840[_0xfc79('0x37')]=_[_0xfc79('0x38')](_0x17028c[_0xfc79('0x33')],qs['fields'](_0x98f935[_0xfc79('0x34')][_0xfc79('0x39')]));_0x3f6840['attributes']=_0x3f6840[_0xfc79('0x37')][_0xfc79('0x4c')]?_0x3f6840[_0xfc79('0x37')]:_0x17028c[_0xfc79('0x33')];if(_0x98f935[_0xfc79('0x34')][_0xfc79('0x44')]){_0x3f6840[_0xfc79('0x45')]=[{'all':!![]}];}_0x3f6840=_[_0xfc79('0x3f')]({},_0x3f6840,_0x98f935[_0xfc79('0x42')]);return db[_0xfc79('0x43')]['find'](_0x3f6840)['then'](handleEntityNotFound(_0x39bd13,null))['then'](respondWithResult(_0x39bd13,null))[_0xfc79('0x48')](handleError(_0x39bd13,null));};exports[_0xfc79('0x4d')]=function(_0x4ce140,_0x549407){return db[_0xfc79('0x43')][_0xfc79('0x4d')](_0x4ce140[_0xfc79('0x4e')],{})[_0xfc79('0x28')](function(_0x12f970){var _0x47f525=_0x4ce140[_0xfc79('0x4f')][_0xfc79('0x29')]({'plain':!![]});if(!_0x47f525)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47f525[_0xfc79('0x50')]==='user'){var _0x2cada8=_0x12f970[_0xfc79('0x29')]({'plain':!![]});var _0x45893b=_0xfc79('0x51');return db['UserProfileSection'][_0xfc79('0x52')]({'where':{'name':_0x45893b,'userProfileId':_0x47f525[_0xfc79('0x53')]},'raw':!![]})[_0xfc79('0x28')](function(_0x44804b){if(_0x44804b&&_0x44804b[_0xfc79('0x54')]===0x0){return db['UserProfileResource'][_0xfc79('0x4d')]({'name':_0x2cada8[_0xfc79('0x2d')],'resourceId':_0x2cada8['id'],'type':_0x44804b['name'],'sectionId':_0x44804b['id']},{})[_0xfc79('0x28')](function(){return _0x12f970;});}else{return _0x12f970;}})[_0xfc79('0x48')](function(_0x4363ec){logger[_0xfc79('0x2b')](_0xfc79('0x55'),_0x4363ec);throw _0x4363ec;});}return _0x12f970;})[_0xfc79('0x28')](respondWithResult(_0x549407,0xc9))[_0xfc79('0x48')](handleError(_0x549407,null));};exports['update']=function(_0x55cc38,_0x2017d0){if(_0x55cc38[_0xfc79('0x4e')]['id']){delete _0x55cc38[_0xfc79('0x4e')]['id'];}return db[_0xfc79('0x43')]['find']({'where':{'id':_0x55cc38[_0xfc79('0x4a')]['id']}})[_0xfc79('0x28')](handleEntityNotFound(_0x2017d0,null))[_0xfc79('0x28')](saveUpdates(_0x55cc38[_0xfc79('0x4e')],null))['then'](respondWithResult(_0x2017d0,null))[_0xfc79('0x48')](handleError(_0x2017d0,null));};exports[_0xfc79('0x56')]=function(_0x272761,_0x1dac37){return db[_0xfc79('0x43')][_0xfc79('0x52')]({'where':{'id':_0x272761[_0xfc79('0x4a')]['id']}})[_0xfc79('0x28')](handleEntityNotFound(_0x1dac37,null))['then'](removeEntity(_0x1dac37,null))[_0xfc79('0x48')](handleError(_0x1dac37,null));}; \ No newline at end of file +var _0xde50=['findAll','rows','show','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','UserProfileResource','destroy','then','error','name','index','map','VoiceChanSpy','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x500039,_0x1a73a6){var _0x13f541=function(_0x5cfe6b){while(--_0x5cfe6b){_0x500039['push'](_0x500039['shift']());}};_0x13f541(++_0x1a73a6);}(_0xde50,0x140));var _0x0de5=function(_0x26174f,_0x12a275){_0x26174f=_0x26174f-0x0;var _0x982737=_0xde50[_0x26174f];return _0x982737;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0de5('0x0'));var jsonpatch=require(_0x0de5('0x1'));var rp=require(_0x0de5('0x2'));var moment=require(_0x0de5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0de5('0x4'));var util=require('util');var path=require(_0x0de5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0de5('0x6'));var _=require(_0x0de5('0x7'));var squel=require(_0x0de5('0x8'));var crypto=require('crypto');var jsforce=require(_0x0de5('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0de5('0xa'));var Redis=require(_0x0de5('0xb'));var authService=require(_0x0de5('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0de5('0xd'));var hardwareService=require(_0x0de5('0xe'));var logger=require('../../config/logger')(_0x0de5('0xf'));var utils=require(_0x0de5('0x10'));var config=require(_0x0de5('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24573e,_0x4672f7){_0x4672f7=_0x4672f7||0xcc;return function(_0x3793c6){if(_0x3793c6){return _0x24573e[_0x0de5('0x12')](_0x4672f7);}return _0x24573e[_0x0de5('0x13')](_0x4672f7)['end']();};}function respondWithResult(_0xee8dcb,_0x5eaad2){_0x5eaad2=_0x5eaad2||0xc8;return function(_0x544703){if(_0x544703){return _0xee8dcb[_0x0de5('0x13')](_0x5eaad2)[_0x0de5('0x14')](_0x544703);}};}function respondWithFilteredResult(_0x443218,_0x92fe6d){return function(_0x5cbab){if(_0x5cbab){var _0x2be086=typeof _0x92fe6d['offset']===_0x0de5('0x15')&&typeof _0x92fe6d[_0x0de5('0x16')]===_0x0de5('0x15');var _0x4b3218=_0x5cbab[_0x0de5('0x17')];var _0x2860e8=_0x2be086?0x0:_0x92fe6d['offset'];var _0x21e4b6=_0x2be086?_0x5cbab['count']:_0x92fe6d[_0x0de5('0x18')]+_0x92fe6d[_0x0de5('0x16')];var _0x219f62;if(_0x21e4b6>=_0x4b3218){_0x21e4b6=_0x4b3218;_0x219f62=0xc8;}else{_0x219f62=0xce;}_0x443218[_0x0de5('0x13')](_0x219f62);return _0x443218['set'](_0x0de5('0x19'),_0x2860e8+'-'+_0x21e4b6+'/'+_0x4b3218)['json'](_0x5cbab);}return null;};}function patchUpdates(_0x2a2abc){return function(_0x30a2c1){try{jsonpatch[_0x0de5('0x1a')](_0x30a2c1,_0x2a2abc,!![]);}catch(_0x4d1b98){return BPromise[_0x0de5('0x1b')](_0x4d1b98);}return _0x30a2c1[_0x0de5('0x1c')]();};}function saveUpdates(_0x203aa8,_0x224745){return function(_0x55cc87){if(_0x55cc87){return _0x55cc87[_0x0de5('0x1d')](_0x203aa8)['then'](function(_0x135446){return _0x135446;});}return null;};}function removeEntity(_0xf979a0,_0x3bf543){return function(_0x2bacf4){if(_0x2bacf4){return _0x2bacf4['destroy']()['then'](function(){var _0x7bdc61=_0x2bacf4['get']({'plain':!![]});var _0x378089='ChanSpies';return db[_0x0de5('0x1e')][_0x0de5('0x1f')]({'where':{'type':_0x378089,'resourceId':_0x7bdc61['id']}})[_0x0de5('0x20')](function(){return _0x2bacf4;});})[_0x0de5('0x20')](function(){_0xf979a0[_0x0de5('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf116a1,_0x17b0f9){return function(_0x3880e8){if(!_0x3880e8){_0xf116a1[_0x0de5('0x12')](0x194);}return _0x3880e8;};}function handleError(_0x46cb47,_0x238206){_0x238206=_0x238206||0x1f4;return function(_0x4c8444){logger[_0x0de5('0x21')](_0x4c8444['stack']);if(_0x4c8444['name']){delete _0x4c8444[_0x0de5('0x22')];}_0x46cb47['status'](_0x238206)['send'](_0x4c8444);};}exports[_0x0de5('0x23')]=function(_0x3781d4,_0x31ff95){var _0x523b4f={},_0xbefe67={},_0x50a222={'count':0x0,'rows':[]};var _0x1a9638=_[_0x0de5('0x24')](db[_0x0de5('0x25')][_0x0de5('0x26')],function(_0x4e460c){return{'name':_0x4e460c['fieldName'],'type':_0x4e460c[_0x0de5('0x27')][_0x0de5('0x28')]};});_0xbefe67[_0x0de5('0x29')]=_[_0x0de5('0x24')](_0x1a9638,_0x0de5('0x22'));_0xbefe67['query']=_[_0x0de5('0x2a')](_0x3781d4[_0x0de5('0x2b')]);_0xbefe67['filters']=_['intersection'](_0xbefe67[_0x0de5('0x29')],_0xbefe67[_0x0de5('0x2b')]);_0x523b4f[_0x0de5('0x2c')]=_[_0x0de5('0x2d')](_0xbefe67[_0x0de5('0x29')],qs[_0x0de5('0x2e')](_0x3781d4[_0x0de5('0x2b')]['fields']));_0x523b4f[_0x0de5('0x2c')]=_0x523b4f[_0x0de5('0x2c')]['length']?_0x523b4f[_0x0de5('0x2c')]:_0xbefe67[_0x0de5('0x29')];if(!_0x3781d4[_0x0de5('0x2b')][_0x0de5('0x2f')](_0x0de5('0x30'))){_0x523b4f[_0x0de5('0x16')]=qs[_0x0de5('0x16')](_0x3781d4[_0x0de5('0x2b')]['limit']);_0x523b4f[_0x0de5('0x18')]=qs['offset'](_0x3781d4[_0x0de5('0x2b')]['offset']);}_0x523b4f[_0x0de5('0x31')]=qs[_0x0de5('0x32')](_0x3781d4[_0x0de5('0x2b')]['sort']);_0x523b4f[_0x0de5('0x33')]=qs[_0x0de5('0x34')](_[_0x0de5('0x35')](_0x3781d4[_0x0de5('0x2b')],_0xbefe67[_0x0de5('0x34')]),_0x1a9638);if(_0x3781d4['query'][_0x0de5('0x36')]){_0x523b4f['where']=_['merge'](_0x523b4f['where'],{'$or':_[_0x0de5('0x24')](_0x1a9638,function(_0x303740){if(_0x303740[_0x0de5('0x27')]!==_0x0de5('0x37')){var _0x1f79b5={};_0x1f79b5[_0x303740['name']]={'$like':'%'+_0x3781d4['query'][_0x0de5('0x36')]+'%'};return _0x1f79b5;}})});}_0x523b4f=_[_0x0de5('0x38')]({},_0x523b4f,_0x3781d4[_0x0de5('0x39')]);var _0xbb9bf7={'where':_0x523b4f[_0x0de5('0x33')]};return db['VoiceChanSpy'][_0x0de5('0x17')](_0xbb9bf7)[_0x0de5('0x20')](function(_0x40110b){_0x50a222[_0x0de5('0x17')]=_0x40110b;if(_0x3781d4[_0x0de5('0x2b')][_0x0de5('0x3a')]){_0x523b4f[_0x0de5('0x3b')]=[{'all':!![]}];}return db[_0x0de5('0x25')][_0x0de5('0x3c')](_0x523b4f);})[_0x0de5('0x20')](function(_0x1b0923){_0x50a222[_0x0de5('0x3d')]=_0x1b0923;return _0x50a222;})[_0x0de5('0x20')](respondWithFilteredResult(_0x31ff95,_0x523b4f))['catch'](handleError(_0x31ff95,null));};exports[_0x0de5('0x3e')]=function(_0x217ff1,_0x11db79){var _0x5bfb6d={'raw':![],'where':{'id':_0x217ff1['params']['id']}},_0x56bcf3={};_0x56bcf3[_0x0de5('0x29')]=_[_0x0de5('0x2a')](db['VoiceChanSpy'][_0x0de5('0x26')]);_0x56bcf3[_0x0de5('0x2b')]=_[_0x0de5('0x2a')](_0x217ff1['query']);_0x56bcf3[_0x0de5('0x34')]=_[_0x0de5('0x2d')](_0x56bcf3[_0x0de5('0x29')],_0x56bcf3[_0x0de5('0x2b')]);_0x5bfb6d[_0x0de5('0x2c')]=_[_0x0de5('0x2d')](_0x56bcf3[_0x0de5('0x29')],qs[_0x0de5('0x2e')](_0x217ff1[_0x0de5('0x2b')][_0x0de5('0x2e')]));_0x5bfb6d[_0x0de5('0x2c')]=_0x5bfb6d[_0x0de5('0x2c')][_0x0de5('0x3f')]?_0x5bfb6d[_0x0de5('0x2c')]:_0x56bcf3[_0x0de5('0x29')];if(_0x217ff1[_0x0de5('0x2b')][_0x0de5('0x3a')]){_0x5bfb6d[_0x0de5('0x3b')]=[{'all':!![]}];}_0x5bfb6d=_[_0x0de5('0x38')]({},_0x5bfb6d,_0x217ff1['options']);return db['VoiceChanSpy'][_0x0de5('0x40')](_0x5bfb6d)[_0x0de5('0x20')](handleEntityNotFound(_0x11db79,null))['then'](respondWithResult(_0x11db79,null))[_0x0de5('0x41')](handleError(_0x11db79,null));};exports['create']=function(_0xc138c4,_0x4fbd4d){return db[_0x0de5('0x25')][_0x0de5('0x42')](_0xc138c4['body'],{})[_0x0de5('0x20')](function(_0x4bccaa){var _0x2c03b2=_0xc138c4[_0x0de5('0x43')]['get']({'plain':!![]});if(!_0x2c03b2)throw new Error(_0x0de5('0x44'));if(_0x2c03b2['role']===_0x0de5('0x43')){var _0x2d1fcd=_0x4bccaa[_0x0de5('0x45')]({'plain':!![]});var _0x3ca2ad=_0x0de5('0x46');return db[_0x0de5('0x47')]['find']({'where':{'name':_0x3ca2ad,'userProfileId':_0x2c03b2['userProfileId']},'raw':!![]})[_0x0de5('0x20')](function(_0x564309){if(_0x564309&&_0x564309[_0x0de5('0x48')]===0x0){return db[_0x0de5('0x1e')][_0x0de5('0x42')]({'name':_0x2d1fcd[_0x0de5('0x22')],'resourceId':_0x2d1fcd['id'],'type':_0x564309[_0x0de5('0x22')],'sectionId':_0x564309['id']},{})['then'](function(){return _0x4bccaa;});}else{return _0x4bccaa;}})[_0x0de5('0x41')](function(_0x2ffc7e){logger['error'](_0x0de5('0x49'),_0x2ffc7e);throw _0x2ffc7e;});}return _0x4bccaa;})['then'](respondWithResult(_0x4fbd4d,0xc9))[_0x0de5('0x41')](handleError(_0x4fbd4d,null));};exports[_0x0de5('0x1d')]=function(_0x3e79f4,_0x515b79){if(_0x3e79f4[_0x0de5('0x4a')]['id']){delete _0x3e79f4[_0x0de5('0x4a')]['id'];}return db[_0x0de5('0x25')]['find']({'where':{'id':_0x3e79f4[_0x0de5('0x4b')]['id']}})[_0x0de5('0x20')](handleEntityNotFound(_0x515b79,null))[_0x0de5('0x20')](saveUpdates(_0x3e79f4[_0x0de5('0x4a')],null))[_0x0de5('0x20')](respondWithResult(_0x515b79,null))[_0x0de5('0x41')](handleError(_0x515b79,null));};exports['destroy']=function(_0x44f2f5,_0x2b9081){return db[_0x0de5('0x25')][_0x0de5('0x40')]({'where':{'id':_0x44f2f5[_0x0de5('0x4b')]['id']}})[_0x0de5('0x20')](handleEntityNotFound(_0x2b9081,null))[_0x0de5('0x20')](removeEntity(_0x2b9081,null))[_0x0de5('0x41')](handleError(_0x2b9081,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 037ff54..7b12f23 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 _0x06f4=['Authenticate','ChanSpy','options','join','length','concat','internal','name','User','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','from-sip','format','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x06f4,0x15e));var _0x406f=function(_0x30e378,_0x31dd4b){_0x30e378=_0x30e378-0x0;var _0x3ac5dd=_0x06f4[_0x30e378];return _0x3ac5dd;};'use strict';var _=require(_0x406f('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x34e259,_0x58cf02,_0x2ecd63){var _0x4afdb4=0x1;var _0x12cc17=[];var _0x34c4dc={'context':_0x58cf02['context']||_0x406f('0x1'),'exten':util[_0x406f('0x2')]('%s%s',_0x34e259['prefix'],_0x2ecd63),'type':_0x406f('0x3'),'isApp':![],'ChanSpyId':_0x34e259['id'],'UserId':_0x58cf02['id']};_0x12cc17[_0x406f('0x4')](_[_0x406f('0x5')]({'app':_0x406f('0x6'),'appdata':util[_0x406f('0x2')](_0x406f('0x7'),_0x406f('0x8')),'priority':_0x4afdb4++},_0x34c4dc));if(_0x34e259[_0x406f('0x9')]){_0x12cc17[_0x406f('0x4')](_['merge']({'app':_0x406f('0xa'),'appdata':util[_0x406f('0x2')]('${UNIQUEID}.%s,a',_0x34e259[_0x406f('0xb')]),'priority':_0x4afdb4++},_0x34c4dc));}if(_0x34e259[_0x406f('0xc')]){_0x12cc17[_0x406f('0x4')](_[_0x406f('0x5')]({'app':_0x406f('0xd'),'appdata':_0x34e259['password'],'priority':_0x4afdb4++},_0x34c4dc));}_0x12cc17['push'](_[_0x406f('0x5')]({'app':_0x406f('0xe'),'appdata':util[_0x406f('0x2')]('SIP/%s,%s',_0x58cf02['name'],_0x34e259[_0x406f('0xf')]?_0x34e259['options'][_0x406f('0x10')](''):''),'priority':_0x4afdb4++},_0x34c4dc));if(_0x34e259[_0x406f('0x9')]){_0x12cc17[_0x406f('0x4')](_['merge']({'app':'StopMixMonitor','priority':_0x4afdb4++},_0x34c4dc));}return _0x12cc17;};var getChanSpyApplications=function(_0xb8fe1d,_0xdab878){var _0x55cd73=[];for(var _0x58d7dc=0x0,_0x6e02b1=0x1;_0x58d7dc<_0xdab878[_0x406f('0x11')];_0x58d7dc++,_0x6e02b1=0x1){_0x55cd73=_0x55cd73[_0x406f('0x12')](getUserApplications(_0xb8fe1d,_0xdab878[_0x58d7dc],_0xdab878[_0x58d7dc][_0x406f('0x13')]));if(_0xdab878[_0x58d7dc][_0x406f('0x13')]!=_0xdab878[_0x58d7dc][_0x406f('0x14')]){_0x55cd73=_0x55cd73[_0x406f('0x12')](getUserApplications(_0xb8fe1d,_0xdab878[_0x58d7dc],_0xdab878[_0x58d7dc][_0x406f('0x14')]));}}return _0x55cd73;};var getChanSpyPromise=function(_0x2d326d,_0x1cd945){return new BPromise(function(_0x1e4445,_0x59ada2){return _0x2d326d[_0x406f('0x15')]['findAll']({'attributes':['id','name',_0x406f('0x13')],'where':{'role':_0x406f('0x16'),'chanspy':!![]},'raw':!![]})[_0x406f('0x17')](function(_0x1ec53b){if(_0x1ec53b){return _0x1e4445(getChanSpyApplications(_0x1cd945,_0x1ec53b));}return _0x1e4445([]);})[_0x406f('0x18')](function(_0x1f5197){_0x59ada2(_0x1f5197);});});};module[_0x406f('0x19')]=function(_0x1819c2,_0x37534e){var _0x5e9edc=_0x1819c2[_0x406f('0x1a')];return _0x1819c2[_0x406f('0x1b')](_0x406f('0x1c'),attributes,{'tableName':_0x406f('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e2f96,_0xbfd4cf,_0x5ea1f6){return getChanSpyPromise(_0x5e9edc,_0x3e2f96)[_0x406f('0x17')](function(_0x85fc7d){if(_0x85fc7d&&_0x85fc7d[_0x406f('0x11')]){return _0x5e9edc[_0x406f('0x1e')][_0x406f('0x1f')](_0x85fc7d);}})[_0x406f('0x17')](function(){_0x5ea1f6();})[_0x406f('0x18')](function(_0x41aa11){_0x5ea1f6(_0x41aa11);});},'afterUpdate':function(_0x5e1e35,_0x2cbe31,_0x95c9f8){return _0x5e9edc[_0x406f('0x1e')]['destroy']({'where':{'ChanSpyId':_0x5e1e35['id']}})[_0x406f('0x17')](function(){return getChanSpyPromise(_0x5e9edc,_0x5e1e35);})[_0x406f('0x17')](function(_0x513f37){if(_0x513f37&&_0x513f37[_0x406f('0x11')]){return _0x5e9edc[_0x406f('0x1e')][_0x406f('0x1f')](_0x513f37);}})[_0x406f('0x17')](function(){_0x95c9f8();})[_0x406f('0x18')](function(_0x4d73fd){_0x95c9f8(_0x4d73fd);});},'afterDestroy':function(_0x2a49bb,_0x2b6d96,_0x3b12b5){return _0x5e9edc[_0x406f('0x1e')][_0x406f('0x20')]({'where':{'ChanSpyId':_0x2a49bb['id']}})[_0x406f('0x17')](function(){_0x3b12b5();})[_0x406f('0x18')](function(_0x164302){_0x3b12b5(_0x164302);});}}});}; \ No newline at end of file +var _0xa3c9=['then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','lodash','util','bluebird','context','from-sip','format','prefix','push','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','merge','Authenticate','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','User','findAll','internal','agent'];(function(_0x52f8e5,_0x1734f4){var _0x4780a3=function(_0x5ae83a){while(--_0x5ae83a){_0x52f8e5['push'](_0x52f8e5['shift']());}};_0x4780a3(++_0x1734f4);}(_0xa3c9,0x156));var _0x9a3c=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa3c9[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x9a3c('0x0'));var util=require(_0x9a3c('0x1'));var BPromise=require(_0x9a3c('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x4bca78,_0x4815e9,_0x2fe31f){var _0x6c8f57=0x1;var _0x24f717=[];var _0xf302aa={'context':_0x4815e9[_0x9a3c('0x3')]||_0x9a3c('0x4'),'exten':util[_0x9a3c('0x5')]('%s%s',_0x4bca78[_0x9a3c('0x6')],_0x2fe31f),'type':'system','isApp':![],'ChanSpyId':_0x4bca78['id'],'UserId':_0x4815e9['id']};_0x24f717[_0x9a3c('0x7')](_['merge']({'app':_0x9a3c('0x8'),'appdata':util['format'](_0x9a3c('0x9'),_0x9a3c('0xa')),'priority':_0x6c8f57++},_0xf302aa));if(_0x4bca78[_0x9a3c('0xb')]){_0x24f717[_0x9a3c('0x7')](_['merge']({'app':_0x9a3c('0xc'),'appdata':util['format'](_0x9a3c('0xd'),_0x4bca78[_0x9a3c('0xe')]),'priority':_0x6c8f57++},_0xf302aa));}if(_0x4bca78['auth']){_0x24f717[_0x9a3c('0x7')](_[_0x9a3c('0xf')]({'app':_0x9a3c('0x10'),'appdata':_0x4bca78['password'],'priority':_0x6c8f57++},_0xf302aa));}_0x24f717[_0x9a3c('0x7')](_['merge']({'app':_0x9a3c('0x11'),'appdata':util[_0x9a3c('0x5')](_0x9a3c('0x12'),_0x4815e9[_0x9a3c('0x13')],_0x4bca78[_0x9a3c('0x14')]?_0x4bca78[_0x9a3c('0x14')]['join'](''):''),'priority':_0x6c8f57++},_0xf302aa));if(_0x4bca78[_0x9a3c('0xb')]){_0x24f717[_0x9a3c('0x7')](_[_0x9a3c('0xf')]({'app':_0x9a3c('0x15'),'priority':_0x6c8f57++},_0xf302aa));}return _0x24f717;};var getChanSpyApplications=function(_0x3364b3,_0x1a9c8f){var _0x15b453=[];for(var _0xdbfad7=0x0,_0x3b380b=0x1;_0xdbfad7<_0x1a9c8f[_0x9a3c('0x16')];_0xdbfad7++,_0x3b380b=0x1){_0x15b453=_0x15b453['concat'](getUserApplications(_0x3364b3,_0x1a9c8f[_0xdbfad7],_0x1a9c8f[_0xdbfad7]['internal']));if(_0x1a9c8f[_0xdbfad7]['internal']!=_0x1a9c8f[_0xdbfad7][_0x9a3c('0x13')]){_0x15b453=_0x15b453[_0x9a3c('0x17')](getUserApplications(_0x3364b3,_0x1a9c8f[_0xdbfad7],_0x1a9c8f[_0xdbfad7]['name']));}}return _0x15b453;};var getChanSpyPromise=function(_0x42400d,_0xf1e0cf){return new BPromise(function(_0x5df07b,_0x4f7551){return _0x42400d[_0x9a3c('0x18')][_0x9a3c('0x19')]({'attributes':['id',_0x9a3c('0x13'),_0x9a3c('0x1a')],'where':{'role':_0x9a3c('0x1b'),'chanspy':!![]},'raw':!![]})[_0x9a3c('0x1c')](function(_0x21d0da){if(_0x21d0da){return _0x5df07b(getChanSpyApplications(_0xf1e0cf,_0x21d0da));}return _0x5df07b([]);})[_0x9a3c('0x1d')](function(_0x443b6a){_0x4f7551(_0x443b6a);});});};module[_0x9a3c('0x1e')]=function(_0x488af7,_0x5dd9ba){var _0x3ecb8a=_0x488af7[_0x9a3c('0x1f')];return _0x488af7[_0x9a3c('0x20')](_0x9a3c('0x21'),attributes,{'tableName':_0x9a3c('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41e0de,_0x374bb5,_0xa86be9){return getChanSpyPromise(_0x3ecb8a,_0x41e0de)['then'](function(_0x175591){if(_0x175591&&_0x175591[_0x9a3c('0x16')]){return _0x3ecb8a['VoiceExtension'][_0x9a3c('0x23')](_0x175591);}})[_0x9a3c('0x1c')](function(){_0xa86be9();})[_0x9a3c('0x1d')](function(_0x5d608a){_0xa86be9(_0x5d608a);});},'afterUpdate':function(_0x167275,_0x5acf4f,_0x9eb857){return _0x3ecb8a[_0x9a3c('0x24')]['destroy']({'where':{'ChanSpyId':_0x167275['id']}})[_0x9a3c('0x1c')](function(){return getChanSpyPromise(_0x3ecb8a,_0x167275);})['then'](function(_0x2718bc){if(_0x2718bc&&_0x2718bc[_0x9a3c('0x16')]){return _0x3ecb8a[_0x9a3c('0x24')][_0x9a3c('0x23')](_0x2718bc);}})[_0x9a3c('0x1c')](function(){_0x9eb857();})[_0x9a3c('0x1d')](function(_0x245b1b){_0x9eb857(_0x245b1b);});},'afterDestroy':function(_0x22c811,_0x422f0f,_0x3f1faf){return _0x3ecb8a[_0x9a3c('0x24')]['destroy']({'where':{'ChanSpyId':_0x22c811['id']}})[_0x9a3c('0x1c')](function(){_0x3f1faf();})['catch'](function(_0x1d9b21){_0x3f1faf(_0x1d9b21);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 96757fd..c6833d0 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 _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6953,0x91));var _0x3695=function(_0x334c14,_0x1df988){_0x334c14=_0x334c14-0x0;var _0x1e7875=_0x6953[_0x334c14];return _0x1e7875;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0x4fdb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x37dcf8,_0x50437b){var _0x1d121c=function(_0x5bf87f){while(--_0x5bf87f){_0x37dcf8['push'](_0x37dcf8['shift']());}};_0x1d121c(++_0x50437b);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x495041,_0x1a82c5){_0x495041=_0x495041-0x0;var _0x175e0c=_0x4fdb[_0x495041];return _0x175e0c;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 338afa4..ebeced1 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 _0xdae5=['put','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdae5,0x1a1));var _0x5dae=function(_0x542a7b,_0x563884){_0x542a7b=_0x542a7b-0x0;var _0x26f109=_0xdae5[_0x542a7b];return _0x26f109;};'use strict';var multer=require(_0x5dae('0x0'));var util=require('util');var path=require(_0x5dae('0x1'));var timeout=require(_0x5dae('0x2'));var express=require(_0x5dae('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5dae('0x4'));var interaction=require(_0x5dae('0x5'));var config=require(_0x5dae('0x6'));var controller=require(_0x5dae('0x7'));router[_0x5dae('0x8')]('/',auth[_0x5dae('0x9')](),controller[_0x5dae('0xa')]);router[_0x5dae('0x8')](_0x5dae('0xb'),auth[_0x5dae('0x9')](),controller[_0x5dae('0xc')]);router[_0x5dae('0xd')]('/',auth['isAuthenticated'](),controller[_0x5dae('0xe')]);router[_0x5dae('0xf')](_0x5dae('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5dae('0x10')]('/:id',auth[_0x5dae('0x9')](),controller['destroy']);module[_0x5dae('0x11')]=router; \ No newline at end of file +var _0x0121=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x11a3c2,_0xb7f165){var _0x846cea=function(_0x303f79){while(--_0x303f79){_0x11a3c2['push'](_0x11a3c2['shift']());}};_0x846cea(++_0xb7f165);}(_0x0121,0x1db));var _0x1012=function(_0x1c1e80,_0x1a551e){_0x1c1e80=_0x1c1e80-0x0;var _0x2fa4de=_0x0121[_0x1c1e80];return _0x2fa4de;};'use strict';var multer=require('multer');var util=require(_0x1012('0x0'));var path=require(_0x1012('0x1'));var timeout=require(_0x1012('0x2'));var express=require(_0x1012('0x3'));var router=express[_0x1012('0x4')]();var fs_extra=require(_0x1012('0x5'));var auth=require(_0x1012('0x6'));var interaction=require(_0x1012('0x7'));var config=require('../../config/environment');var controller=require(_0x1012('0x8'));router[_0x1012('0x9')]('/',auth['isAuthenticated'](),controller[_0x1012('0xa')]);router[_0x1012('0x9')](_0x1012('0xb'),auth['isAuthenticated'](),controller[_0x1012('0xc')]);router[_0x1012('0xd')]('/',auth[_0x1012('0xe')](),controller[_0x1012('0xf')]);router[_0x1012('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1012('0x11')]);router[_0x1012('0x12')](_0x1012('0xb'),auth[_0x1012('0xe')](),controller['destroy']);module[_0x1012('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 19b56b8..f65827e 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 _0x9489=['exports','name','STRING','sequelize'];(function(_0x5374eb,_0x4e5e18){var _0x406a25=function(_0x3dfa42){while(--_0x3dfa42){_0x5374eb['push'](_0x5374eb['shift']());}};_0x406a25(++_0x4e5e18);}(_0x9489,0xd3));var _0x9948=function(_0x5d1fe6,_0x37ed86){_0x5d1fe6=_0x5d1fe6-0x0;var _0x1c9ebf=_0x9489[_0x5d1fe6];return _0x1c9ebf;};'use strict';var Sequelize=require(_0x9948('0x0'));module[_0x9948('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9948('0x2')},'description':{'type':Sequelize[_0x9948('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc28f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc28f,0xcf));var _0xfc28=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc28f[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xfc28('0x0'));module[_0xfc28('0x1')]={'name':{'type':Sequelize[_0xfc28('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xfc28('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfc28('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 06231ba..bf248e4 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 _0x0a03=['render','/etc/asterisk/extensions_xcally_contexts.conf','findAll','Reload','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','find','create','body','readFileSync','join','root','utf8','writeFileSync','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params'];(function(_0x508329,_0x434519){var _0x142d22=function(_0x44d2d3){while(--_0x44d2d3){_0x508329['push'](_0x508329['shift']());}};_0x142d22(++_0x434519);}(_0x0a03,0xd4));var _0x30a0=function(_0x3264ca,_0x4b7745){_0x3264ca=_0x3264ca-0x0;var _0x5197f2=_0x0a03[_0x3264ca];return _0x5197f2;};'use strict';var emlformat=require(_0x30a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x30a0('0x1'));var jsonpatch=require(_0x30a0('0x2'));var rp=require(_0x30a0('0x3'));var moment=require(_0x30a0('0x4'));var BPromise=require(_0x30a0('0x5'));var Mustache=require(_0x30a0('0x6'));var util=require(_0x30a0('0x7'));var path=require(_0x30a0('0x8'));var sox=require(_0x30a0('0x9'));var csv=require('to-csv');var ejs=require(_0x30a0('0xa'));var fs=require('fs');var fs_extra=require(_0x30a0('0xb'));var _=require(_0x30a0('0xc'));var squel=require(_0x30a0('0xd'));var crypto=require('crypto');var jsforce=require(_0x30a0('0xe'));var deskjs=require(_0x30a0('0xf'));var toCsv=require(_0x30a0('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x30a0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x30a0('0x12'));var as=require(_0x30a0('0x13'));var hardwareService=require(_0x30a0('0x14'));var logger=require(_0x30a0('0x15'))(_0x30a0('0x16'));var utils=require('../../config/utils');var config=require(_0x30a0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x30a0('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x30a0('0x19')][_0x30a0('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1a9cb3,_0x34c967,_0x52ac64,_0x2b3836){return new BPromise(function(_0xee5913,_0x1c12b3){var _0x5de090=_0x2b3836||client;return _0x5de090[_0x30a0('0x1b')](_0x1a9cb3,_0x52ac64)[_0x30a0('0x1c')](function(_0x86dbf6){logger['info'](_0x30a0('0x1d'),_0x34c967,'request\x20sent');logger[_0x30a0('0x1e')](_0x30a0('0x1f'),_0x34c967,_0x30a0('0x20'),JSON[_0x30a0('0x21')](_0x86dbf6));if(_0x86dbf6[_0x30a0('0x22')]){if(_0x86dbf6[_0x30a0('0x22')]['code']===0x1f4){logger[_0x30a0('0x22')](_0x30a0('0x1d'),_0x34c967,_0x86dbf6[_0x30a0('0x22')][_0x30a0('0x23')]);return _0x1c12b3(_0x86dbf6[_0x30a0('0x22')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x34c967,_0x86dbf6[_0x30a0('0x22')][_0x30a0('0x23')]);return _0xee5913(_0x86dbf6[_0x30a0('0x22')]['message']);}else{logger[_0x30a0('0x24')](_0x30a0('0x1d'),_0x34c967,_0x30a0('0x20'));_0xee5913(_0x86dbf6[_0x30a0('0x25')][_0x30a0('0x23')]);}})[_0x30a0('0x26')](function(_0x4b4c8c){logger[_0x30a0('0x22')](_0x30a0('0x1d'),_0x34c967,_0x4b4c8c);_0x1c12b3(_0x4b4c8c);});});}function respondWithStatusCode(_0x422801,_0x4e8530){_0x4e8530=_0x4e8530||0xcc;return function(_0x26584b){if(_0x26584b){return _0x422801['sendStatus'](_0x4e8530);}return _0x422801[_0x30a0('0x27')](_0x4e8530)[_0x30a0('0x28')]();};}function respondWithResult(_0x18045b,_0x537026){_0x537026=_0x537026||0xc8;return function(_0x1ce112){if(_0x1ce112){return _0x18045b[_0x30a0('0x27')](_0x537026)[_0x30a0('0x29')](_0x1ce112);}};}function respondWithFilteredResult(_0x3fc380,_0x59c9ac){return function(_0x53fc54){if(_0x53fc54){var _0x4f4cde=typeof _0x59c9ac[_0x30a0('0x2a')]===_0x30a0('0x2b')&&typeof _0x59c9ac['limit']==='undefined';var _0x190040=_0x53fc54['count'];var _0x2234c5=_0x4f4cde?0x0:_0x59c9ac[_0x30a0('0x2a')];var _0x1e3bad=_0x4f4cde?_0x53fc54[_0x30a0('0x2c')]:_0x59c9ac[_0x30a0('0x2a')]+_0x59c9ac[_0x30a0('0x2d')];var _0x4fcee8;if(_0x1e3bad>=_0x190040){_0x1e3bad=_0x190040;_0x4fcee8=0xc8;}else{_0x4fcee8=0xce;}_0x3fc380['status'](_0x4fcee8);return _0x3fc380[_0x30a0('0x2e')]('Content-Range',_0x2234c5+'-'+_0x1e3bad+'/'+_0x190040)[_0x30a0('0x29')](_0x53fc54);}return null;};}function patchUpdates(_0x127f9c){return function(_0x548b15){try{jsonpatch[_0x30a0('0x2f')](_0x548b15,_0x127f9c,!![]);}catch(_0x4e000b){return BPromise[_0x30a0('0x30')](_0x4e000b);}return _0x548b15[_0x30a0('0x31')]();};}function saveUpdates(_0x1c7b82,_0x24206b){return function(_0x3b8476){if(_0x3b8476){return _0x3b8476[_0x30a0('0x32')](_0x1c7b82)[_0x30a0('0x1c')](function(_0x3e9852){return _0x3e9852;});}return null;};}function removeEntity(_0x41ce2d,_0x1ffb6a){return function(_0x311d67){if(_0x311d67){return _0x311d67[_0x30a0('0x33')]()[_0x30a0('0x1c')](function(){var _0x122528=_0x311d67[_0x30a0('0x34')]({'plain':!![]});var _0x50f282=_0x30a0('0x35');return db[_0x30a0('0x36')][_0x30a0('0x33')]({'where':{'type':_0x50f282,'resourceId':_0x122528['id']}})[_0x30a0('0x1c')](function(){return _0x311d67;});})[_0x30a0('0x1c')](function(){_0x41ce2d[_0x30a0('0x27')](0xcc)[_0x30a0('0x28')]();});}};}function handleEntityNotFound(_0x49eefc,_0x3bdc0a){return function(_0x140b69){if(!_0x140b69){_0x49eefc[_0x30a0('0x37')](0x194);}return _0x140b69;};}function handleError(_0xdccef3,_0x23784f){_0x23784f=_0x23784f||0x1f4;return function(_0x304366){logger[_0x30a0('0x22')](_0x304366[_0x30a0('0x38')]);if(_0x304366['name']){delete _0x304366[_0x30a0('0x39')];}_0xdccef3['status'](_0x23784f)[_0x30a0('0x3a')](_0x304366);};}exports[_0x30a0('0x3b')]=function(_0x3c66b,_0x2e5a8e){var _0x25e473={},_0x57667c={},_0x5c1135={'count':0x0,'rows':[]};var _0x3b8bb2=_[_0x30a0('0x3c')](db[_0x30a0('0x3d')][_0x30a0('0x3e')],function(_0x4ec0ab){return{'name':_0x4ec0ab['fieldName'],'type':_0x4ec0ab['type'][_0x30a0('0x3f')]};});_0x57667c[_0x30a0('0x40')]=_[_0x30a0('0x3c')](_0x3b8bb2,'name');_0x57667c['query']=_[_0x30a0('0x41')](_0x3c66b[_0x30a0('0x42')]);_0x57667c[_0x30a0('0x43')]=_[_0x30a0('0x44')](_0x57667c[_0x30a0('0x40')],_0x57667c[_0x30a0('0x42')]);_0x25e473['attributes']=_['intersection'](_0x57667c[_0x30a0('0x40')],qs['fields'](_0x3c66b['query'][_0x30a0('0x45')]));_0x25e473['attributes']=_0x25e473[_0x30a0('0x46')][_0x30a0('0x47')]?_0x25e473[_0x30a0('0x46')]:_0x57667c[_0x30a0('0x40')];if(!_0x3c66b['query']['hasOwnProperty'](_0x30a0('0x48'))){_0x25e473[_0x30a0('0x2d')]=qs['limit'](_0x3c66b[_0x30a0('0x42')][_0x30a0('0x2d')]);_0x25e473[_0x30a0('0x2a')]=qs['offset'](_0x3c66b[_0x30a0('0x42')]['offset']);}_0x25e473[_0x30a0('0x49')]=qs['sort'](_0x3c66b[_0x30a0('0x42')][_0x30a0('0x4a')]);_0x25e473[_0x30a0('0x4b')]=qs[_0x30a0('0x43')](_['pick'](_0x3c66b[_0x30a0('0x42')],_0x57667c[_0x30a0('0x43')]),_0x3b8bb2);if(_0x3c66b[_0x30a0('0x42')][_0x30a0('0x4c')]){_0x25e473[_0x30a0('0x4b')]=_[_0x30a0('0x4d')](_0x25e473[_0x30a0('0x4b')],{'$or':_[_0x30a0('0x3c')](_0x3b8bb2,function(_0x2f8d91){if(_0x2f8d91[_0x30a0('0x4e')]!==_0x30a0('0x4f')){var _0x5116c8={};_0x5116c8[_0x2f8d91[_0x30a0('0x39')]]={'$like':'%'+_0x3c66b[_0x30a0('0x42')]['filter']+'%'};return _0x5116c8;}})});}_0x25e473=_[_0x30a0('0x4d')]({},_0x25e473,_0x3c66b[_0x30a0('0x50')]);var _0x41ade5={'where':_0x25e473[_0x30a0('0x4b')]};return db[_0x30a0('0x3d')]['count'](_0x41ade5)[_0x30a0('0x1c')](function(_0x5aaf35){_0x5c1135[_0x30a0('0x2c')]=_0x5aaf35;if(_0x3c66b[_0x30a0('0x42')][_0x30a0('0x51')]){_0x25e473[_0x30a0('0x52')]=[{'all':!![]}];}return db[_0x30a0('0x3d')]['findAll'](_0x25e473);})['then'](function(_0x3dd4e7){_0x5c1135[_0x30a0('0x53')]=_0x3dd4e7;return _0x5c1135;})[_0x30a0('0x1c')](respondWithFilteredResult(_0x2e5a8e,_0x25e473))[_0x30a0('0x26')](handleError(_0x2e5a8e,null));};exports[_0x30a0('0x54')]=function(_0x2c6fd2,_0x34c1aa){var _0x38776b={'raw':![],'where':{'id':_0x2c6fd2['params']['id']}},_0x4dbbf8={};_0x4dbbf8['model']=_[_0x30a0('0x41')](db[_0x30a0('0x3d')][_0x30a0('0x3e')]);_0x4dbbf8[_0x30a0('0x42')]=_[_0x30a0('0x41')](_0x2c6fd2['query']);_0x4dbbf8['filters']=_[_0x30a0('0x44')](_0x4dbbf8[_0x30a0('0x40')],_0x4dbbf8['query']);_0x38776b['attributes']=_['intersection'](_0x4dbbf8[_0x30a0('0x40')],qs['fields'](_0x2c6fd2[_0x30a0('0x42')][_0x30a0('0x45')]));_0x38776b[_0x30a0('0x46')]=_0x38776b[_0x30a0('0x46')]['length']?_0x38776b[_0x30a0('0x46')]:_0x4dbbf8[_0x30a0('0x40')];if(_0x2c6fd2[_0x30a0('0x42')][_0x30a0('0x51')]){_0x38776b[_0x30a0('0x52')]=[{'all':!![]}];}_0x38776b=_['merge']({},_0x38776b,_0x2c6fd2[_0x30a0('0x50')]);return db[_0x30a0('0x3d')][_0x30a0('0x55')](_0x38776b)[_0x30a0('0x1c')](handleEntityNotFound(_0x34c1aa,null))[_0x30a0('0x1c')](respondWithResult(_0x34c1aa,null))['catch'](handleError(_0x34c1aa,null));};exports[_0x30a0('0x56')]=function(_0x1226a2,_0x11f4bd,_0x196925){var _0x2d9331;return db['VoiceContext'][_0x30a0('0x56')](_0x1226a2[_0x30a0('0x57')],{'raw':!![]})[_0x30a0('0x1c')](function(_0x2e7640){_0x2d9331=_0x2e7640;return db[_0x30a0('0x3d')]['findAll']({'raw':!![]});})[_0x30a0('0x1c')](function(_0x4482d8){var _0x4983e0=fs[_0x30a0('0x58')](path[_0x30a0('0x59')](config[_0x30a0('0x5a')],'server/files/templates/context.ejs'),_0x30a0('0x5b'));var _0x4b33bd=ejs['render'](_0x4983e0,{'contexts':_0x4482d8||[]});fs[_0x30a0('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4b33bd);})[_0x30a0('0x1c')](function(){return respondWithRpcPromise('Reload',_0x30a0('0x56'),{'module':_0x30a0('0x5d')});})[_0x30a0('0x1c')](function(){var _0x4b6102=_0x1226a2[_0x30a0('0x5e')][_0x30a0('0x34')]({'plain':!![]});if(!_0x4b6102)throw new Error(_0x30a0('0x5f'));if(_0x4b6102[_0x30a0('0x60')]==='user'){var _0x374f6d=_0x2d9331[_0x30a0('0x34')]({'plain':!![]});return db[_0x30a0('0x61')][_0x30a0('0x55')]({'where':{'name':_0x30a0('0x35'),'userProfileId':_0x4b6102[_0x30a0('0x62')]},'raw':!![]})[_0x30a0('0x1c')](function(_0x231581){if(_0x231581&&_0x231581['autoAssociation']===0x0){return db[_0x30a0('0x36')][_0x30a0('0x56')]({'name':_0x374f6d[_0x30a0('0x39')],'resourceId':_0x374f6d['id'],'type':_0x231581[_0x30a0('0x39')],'sectionId':_0x231581['id']},{})[_0x30a0('0x1c')](function(){return _0x2d9331;});}else{return _0x2d9331;}})[_0x30a0('0x26')](function(_0x32e0f7){logger[_0x30a0('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e0f7);throw _0x32e0f7;});}return _0x2d9331;})['then'](respondWithResult(_0x11f4bd,0xc9))[_0x30a0('0x26')](handleError(_0x11f4bd,null));};exports['update']=function(_0x2a6447,_0x2b415c,_0x2e88e0){var _0x5e6895;return db[_0x30a0('0x3d')][_0x30a0('0x55')]({'where':{'id':_0x2a6447[_0x30a0('0x63')]['id']}})['then'](handleEntityNotFound(_0x2b415c,null))[_0x30a0('0x1c')](saveUpdates(_0x2a6447[_0x30a0('0x57')],null))[_0x30a0('0x1c')](function(_0x2247ec){if(_0x2247ec){_0x5e6895=_0x2247ec;return db[_0x30a0('0x3d')]['findAll']({'raw':!![]});}})[_0x30a0('0x1c')](function(_0x44fb86){var _0x1d1c21=fs['readFileSync'](path[_0x30a0('0x59')](config[_0x30a0('0x5a')],'server/files/templates/context.ejs'),'utf8');var _0x5eff03=ejs[_0x30a0('0x64')](_0x1d1c21,{'contexts':_0x44fb86||[]});fs['writeFileSync'](_0x30a0('0x65'),_0x5eff03);})[_0x30a0('0x1c')](function(){return respondWithRpcPromise('Reload',_0x30a0('0x32'),{'module':'chan_sip.so'});})[_0x30a0('0x1c')](function(){return _0x5e6895;})[_0x30a0('0x1c')](respondWithResult(_0x2b415c,null))[_0x30a0('0x26')](handleError(_0x2b415c,null));};exports[_0x30a0('0x33')]=function(_0x12f6c8,_0x45866f,_0x219671){var _0x5bb562;return db['VoiceContext']['find']({'where':{'id':_0x12f6c8['params']['id']}})[_0x30a0('0x1c')](handleEntityNotFound(_0x45866f,null))[_0x30a0('0x1c')](removeEntity(_0x45866f,null))[_0x30a0('0x1c')](function(){return db['VoiceContext'][_0x30a0('0x66')]({'raw':!![]});})[_0x30a0('0x1c')](function(_0x111364){var _0x847c66=fs[_0x30a0('0x58')](path[_0x30a0('0x59')](config['root'],'server/files/templates/context.ejs'),_0x30a0('0x5b'));var _0x116b67=ejs['render'](_0x847c66,{'contexts':_0x111364});fs[_0x30a0('0x5c')](_0x30a0('0x65'),_0x116b67);return respondWithRpcPromise(_0x30a0('0x67'),_0x30a0('0x33'),{'module':'chan_sip.so'});})[_0x30a0('0x26')](handleError(_0x45866f,null));}; \ No newline at end of file +var _0xfb8c=['http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','include','findAll','rows','params','includeAll','options','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client'];(function(_0x307579,_0x231cdf){var _0xc1d543=function(_0x28b1a5){while(--_0x28b1a5){_0x307579['push'](_0x307579['shift']());}};_0xc1d543(++_0x231cdf);}(_0xfb8c,0x17f));var _0xcfb8=function(_0x44b88c,_0x219b6a){_0x44b88c=_0x44b88c-0x0;var _0x135f43=_0xfb8c[_0x44b88c];return _0x135f43;};'use strict';var emlformat=require(_0xcfb8('0x0'));var rimraf=require(_0xcfb8('0x1'));var zipdir=require(_0xcfb8('0x2'));var jsonpatch=require(_0xcfb8('0x3'));var rp=require(_0xcfb8('0x4'));var moment=require(_0xcfb8('0x5'));var BPromise=require(_0xcfb8('0x6'));var Mustache=require(_0xcfb8('0x7'));var util=require('util');var path=require(_0xcfb8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcfb8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfb8('0xa'));var squel=require(_0xcfb8('0xb'));var crypto=require(_0xcfb8('0xc'));var jsforce=require(_0xcfb8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcfb8('0xe'));var querystring=require(_0xcfb8('0xf'));var Papa=require(_0xcfb8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcfb8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfb8('0x12'));var logger=require(_0xcfb8('0x13'))('api');var utils=require(_0xcfb8('0x14'));var config=require(_0xcfb8('0x15'));var licenseUtil=require(_0xcfb8('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcfb8('0x17'));var client=jayson[_0xcfb8('0x18')][_0xcfb8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x162e1a,_0x471278,_0x266dcc,_0x4808a4){return new BPromise(function(_0x1f129b,_0x45d847){var _0x2ae5bb=_0x4808a4||client;return _0x2ae5bb[_0xcfb8('0x1a')](_0x162e1a,_0x266dcc)[_0xcfb8('0x1b')](function(_0x181e7c){logger['info'](_0xcfb8('0x1c'),_0x471278,_0xcfb8('0x1d'));logger[_0xcfb8('0x1e')](_0xcfb8('0x1f'),_0x471278,'request\x20sent',JSON['stringify'](_0x181e7c));if(_0x181e7c[_0xcfb8('0x20')]){if(_0x181e7c['error'][_0xcfb8('0x21')]===0x1f4){logger[_0xcfb8('0x20')](_0xcfb8('0x1c'),_0x471278,_0x181e7c[_0xcfb8('0x20')][_0xcfb8('0x22')]);return _0x45d847(_0x181e7c[_0xcfb8('0x20')][_0xcfb8('0x22')]);}logger[_0xcfb8('0x20')](_0xcfb8('0x1c'),_0x471278,_0x181e7c[_0xcfb8('0x20')][_0xcfb8('0x22')]);return _0x1f129b(_0x181e7c[_0xcfb8('0x20')]['message']);}else{logger[_0xcfb8('0x23')](_0xcfb8('0x1c'),_0x471278,'request\x20sent');_0x1f129b(_0x181e7c[_0xcfb8('0x24')]['message']);}})[_0xcfb8('0x25')](function(_0x423174){logger[_0xcfb8('0x20')](_0xcfb8('0x1c'),_0x471278,_0x423174);_0x45d847(_0x423174);});});}function respondWithStatusCode(_0x67448f,_0x5ae536){_0x5ae536=_0x5ae536||0xcc;return function(_0x711ece){if(_0x711ece){return _0x67448f[_0xcfb8('0x26')](_0x5ae536);}return _0x67448f[_0xcfb8('0x27')](_0x5ae536)[_0xcfb8('0x28')]();};}function respondWithResult(_0x53fe36,_0x30daa9){_0x30daa9=_0x30daa9||0xc8;return function(_0x200750){if(_0x200750){return _0x53fe36[_0xcfb8('0x27')](_0x30daa9)[_0xcfb8('0x29')](_0x200750);}};}function respondWithFilteredResult(_0x34639d,_0x263686){return function(_0x591481){if(_0x591481){var _0x51cee0=typeof _0x263686[_0xcfb8('0x2a')]===_0xcfb8('0x2b')&&typeof _0x263686[_0xcfb8('0x2c')]===_0xcfb8('0x2b');var _0x28d539=_0x591481[_0xcfb8('0x2d')];var _0x315152=_0x51cee0?0x0:_0x263686[_0xcfb8('0x2a')];var _0x5b4fd0=_0x51cee0?_0x591481[_0xcfb8('0x2d')]:_0x263686[_0xcfb8('0x2a')]+_0x263686[_0xcfb8('0x2c')];var _0x3d47bf;if(_0x5b4fd0>=_0x28d539){_0x5b4fd0=_0x28d539;_0x3d47bf=0xc8;}else{_0x3d47bf=0xce;}_0x34639d[_0xcfb8('0x27')](_0x3d47bf);return _0x34639d[_0xcfb8('0x2e')](_0xcfb8('0x2f'),_0x315152+'-'+_0x5b4fd0+'/'+_0x28d539)[_0xcfb8('0x29')](_0x591481);}return null;};}function patchUpdates(_0x5a2073){return function(_0x2dfb29){try{jsonpatch['apply'](_0x2dfb29,_0x5a2073,!![]);}catch(_0x2f86bc){return BPromise[_0xcfb8('0x30')](_0x2f86bc);}return _0x2dfb29['save']();};}function saveUpdates(_0x581c6c,_0x4674bf){return function(_0x2b93c9){if(_0x2b93c9){return _0x2b93c9[_0xcfb8('0x31')](_0x581c6c)[_0xcfb8('0x1b')](function(_0x4fe2d9){return _0x4fe2d9;});}return null;};}function removeEntity(_0x36a79f,_0x366ab5){return function(_0x341e90){if(_0x341e90){return _0x341e90[_0xcfb8('0x32')]()[_0xcfb8('0x1b')](function(){var _0x1edc1a=_0x341e90[_0xcfb8('0x33')]({'plain':!![]});var _0xb01dae='Contexts';return db[_0xcfb8('0x34')][_0xcfb8('0x32')]({'where':{'type':_0xb01dae,'resourceId':_0x1edc1a['id']}})[_0xcfb8('0x1b')](function(){return _0x341e90;});})[_0xcfb8('0x1b')](function(){_0x36a79f[_0xcfb8('0x27')](0xcc)[_0xcfb8('0x28')]();});}};}function handleEntityNotFound(_0x3faea3,_0x3546ef){return function(_0x523112){if(!_0x523112){_0x3faea3['sendStatus'](0x194);}return _0x523112;};}function handleError(_0x3dd295,_0x45742f){_0x45742f=_0x45742f||0x1f4;return function(_0x4b4348){logger[_0xcfb8('0x20')](_0x4b4348[_0xcfb8('0x35')]);if(_0x4b4348[_0xcfb8('0x36')]){delete _0x4b4348[_0xcfb8('0x36')];}_0x3dd295[_0xcfb8('0x27')](_0x45742f)['send'](_0x4b4348);};}exports[_0xcfb8('0x37')]=function(_0x49e121,_0x3f9d88){var _0xf889ab={},_0xcdc5c5={},_0xa73bd7={'count':0x0,'rows':[]};var _0x35601a=_[_0xcfb8('0x38')](db[_0xcfb8('0x39')][_0xcfb8('0x3a')],function(_0x131e55){return{'name':_0x131e55[_0xcfb8('0x3b')],'type':_0x131e55['type']['key']};});_0xcdc5c5[_0xcfb8('0x3c')]=_[_0xcfb8('0x38')](_0x35601a,_0xcfb8('0x36'));_0xcdc5c5[_0xcfb8('0x3d')]=_[_0xcfb8('0x3e')](_0x49e121['query']);_0xcdc5c5[_0xcfb8('0x3f')]=_[_0xcfb8('0x40')](_0xcdc5c5[_0xcfb8('0x3c')],_0xcdc5c5['query']);_0xf889ab[_0xcfb8('0x41')]=_[_0xcfb8('0x40')](_0xcdc5c5['model'],qs[_0xcfb8('0x42')](_0x49e121['query'][_0xcfb8('0x42')]));_0xf889ab['attributes']=_0xf889ab[_0xcfb8('0x41')][_0xcfb8('0x43')]?_0xf889ab[_0xcfb8('0x41')]:_0xcdc5c5['model'];if(!_0x49e121[_0xcfb8('0x3d')][_0xcfb8('0x44')](_0xcfb8('0x45'))){_0xf889ab[_0xcfb8('0x2c')]=qs[_0xcfb8('0x2c')](_0x49e121['query'][_0xcfb8('0x2c')]);_0xf889ab['offset']=qs['offset'](_0x49e121[_0xcfb8('0x3d')][_0xcfb8('0x2a')]);}_0xf889ab[_0xcfb8('0x46')]=qs[_0xcfb8('0x47')](_0x49e121['query']['sort']);_0xf889ab[_0xcfb8('0x48')]=qs[_0xcfb8('0x3f')](_['pick'](_0x49e121[_0xcfb8('0x3d')],_0xcdc5c5[_0xcfb8('0x3f')]),_0x35601a);if(_0x49e121['query']['filter']){_0xf889ab['where']=_[_0xcfb8('0x49')](_0xf889ab[_0xcfb8('0x48')],{'$or':_[_0xcfb8('0x38')](_0x35601a,function(_0x4781d4){if(_0x4781d4[_0xcfb8('0x4a')]!==_0xcfb8('0x4b')){var _0x27fee0={};_0x27fee0[_0x4781d4[_0xcfb8('0x36')]]={'$like':'%'+_0x49e121[_0xcfb8('0x3d')][_0xcfb8('0x4c')]+'%'};return _0x27fee0;}})});}_0xf889ab=_[_0xcfb8('0x49')]({},_0xf889ab,_0x49e121['options']);var _0x13d7de={'where':_0xf889ab[_0xcfb8('0x48')]};return db[_0xcfb8('0x39')][_0xcfb8('0x2d')](_0x13d7de)['then'](function(_0x186c19){_0xa73bd7[_0xcfb8('0x2d')]=_0x186c19;if(_0x49e121[_0xcfb8('0x3d')]['includeAll']){_0xf889ab[_0xcfb8('0x4d')]=[{'all':!![]}];}return db['VoiceContext'][_0xcfb8('0x4e')](_0xf889ab);})[_0xcfb8('0x1b')](function(_0x2c6f42){_0xa73bd7[_0xcfb8('0x4f')]=_0x2c6f42;return _0xa73bd7;})[_0xcfb8('0x1b')](respondWithFilteredResult(_0x3f9d88,_0xf889ab))[_0xcfb8('0x25')](handleError(_0x3f9d88,null));};exports['show']=function(_0x5929f5,_0x49626d){var _0x56ab49={'raw':![],'where':{'id':_0x5929f5[_0xcfb8('0x50')]['id']}},_0x9e58ec={};_0x9e58ec[_0xcfb8('0x3c')]=_[_0xcfb8('0x3e')](db['VoiceContext'][_0xcfb8('0x3a')]);_0x9e58ec[_0xcfb8('0x3d')]=_[_0xcfb8('0x3e')](_0x5929f5['query']);_0x9e58ec['filters']=_[_0xcfb8('0x40')](_0x9e58ec[_0xcfb8('0x3c')],_0x9e58ec[_0xcfb8('0x3d')]);_0x56ab49[_0xcfb8('0x41')]=_[_0xcfb8('0x40')](_0x9e58ec['model'],qs[_0xcfb8('0x42')](_0x5929f5[_0xcfb8('0x3d')][_0xcfb8('0x42')]));_0x56ab49[_0xcfb8('0x41')]=_0x56ab49[_0xcfb8('0x41')][_0xcfb8('0x43')]?_0x56ab49['attributes']:_0x9e58ec[_0xcfb8('0x3c')];if(_0x5929f5[_0xcfb8('0x3d')][_0xcfb8('0x51')]){_0x56ab49[_0xcfb8('0x4d')]=[{'all':!![]}];}_0x56ab49=_[_0xcfb8('0x49')]({},_0x56ab49,_0x5929f5[_0xcfb8('0x52')]);return db['VoiceContext'][_0xcfb8('0x53')](_0x56ab49)[_0xcfb8('0x1b')](handleEntityNotFound(_0x49626d,null))[_0xcfb8('0x1b')](respondWithResult(_0x49626d,null))[_0xcfb8('0x25')](handleError(_0x49626d,null));};exports[_0xcfb8('0x54')]=function(_0x256211,_0xe9c67b,_0x31f16d){var _0x4d5e61;return db[_0xcfb8('0x39')][_0xcfb8('0x54')](_0x256211[_0xcfb8('0x55')],{'raw':!![]})[_0xcfb8('0x1b')](function(_0x4b4c51){_0x4d5e61=_0x4b4c51;return db[_0xcfb8('0x39')][_0xcfb8('0x4e')]({'raw':!![]});})[_0xcfb8('0x1b')](function(_0x44b610){var _0x41538e=fs[_0xcfb8('0x56')](path[_0xcfb8('0x57')](config['root'],_0xcfb8('0x58')),_0xcfb8('0x59'));var _0x185218=ejs[_0xcfb8('0x5a')](_0x41538e,{'contexts':_0x44b610||[]});fs['writeFileSync'](_0xcfb8('0x5b'),_0x185218);})[_0xcfb8('0x1b')](function(){return respondWithRpcPromise(_0xcfb8('0x5c'),_0xcfb8('0x54'),{'module':_0xcfb8('0x5d')});})['then'](function(){var _0x1fcf27=_0x256211[_0xcfb8('0x5e')]['get']({'plain':!![]});if(!_0x1fcf27)throw new Error(_0xcfb8('0x5f'));if(_0x1fcf27['role']===_0xcfb8('0x5e')){var _0x5117c5=_0x4d5e61[_0xcfb8('0x33')]({'plain':!![]});return db[_0xcfb8('0x60')][_0xcfb8('0x53')]({'where':{'name':_0xcfb8('0x61'),'userProfileId':_0x1fcf27[_0xcfb8('0x62')]},'raw':!![]})[_0xcfb8('0x1b')](function(_0x4d5933){if(_0x4d5933&&_0x4d5933['autoAssociation']===0x0){return db[_0xcfb8('0x34')][_0xcfb8('0x54')]({'name':_0x5117c5[_0xcfb8('0x36')],'resourceId':_0x5117c5['id'],'type':_0x4d5933[_0xcfb8('0x36')],'sectionId':_0x4d5933['id']},{})[_0xcfb8('0x1b')](function(){return _0x4d5e61;});}else{return _0x4d5e61;}})[_0xcfb8('0x25')](function(_0x36a3a7){logger[_0xcfb8('0x20')](_0xcfb8('0x63'),_0x36a3a7);throw _0x36a3a7;});}return _0x4d5e61;})[_0xcfb8('0x1b')](respondWithResult(_0xe9c67b,0xc9))[_0xcfb8('0x25')](handleError(_0xe9c67b,null));};exports['update']=function(_0x58a044,_0x3cf49c,_0x24be4a){var _0xa27580;return db[_0xcfb8('0x39')][_0xcfb8('0x53')]({'where':{'id':_0x58a044[_0xcfb8('0x50')]['id']}})[_0xcfb8('0x1b')](handleEntityNotFound(_0x3cf49c,null))['then'](saveUpdates(_0x58a044['body'],null))[_0xcfb8('0x1b')](function(_0x4a4613){if(_0x4a4613){_0xa27580=_0x4a4613;return db[_0xcfb8('0x39')][_0xcfb8('0x4e')]({'raw':!![]});}})[_0xcfb8('0x1b')](function(_0x22c589){var _0x5caf17=fs[_0xcfb8('0x56')](path[_0xcfb8('0x57')](config[_0xcfb8('0x64')],_0xcfb8('0x58')),_0xcfb8('0x59'));var _0x5daa35=ejs[_0xcfb8('0x5a')](_0x5caf17,{'contexts':_0x22c589||[]});fs['writeFileSync'](_0xcfb8('0x5b'),_0x5daa35);})[_0xcfb8('0x1b')](function(){return respondWithRpcPromise(_0xcfb8('0x5c'),_0xcfb8('0x31'),{'module':_0xcfb8('0x5d')});})['then'](function(){return _0xa27580;})[_0xcfb8('0x1b')](respondWithResult(_0x3cf49c,null))[_0xcfb8('0x25')](handleError(_0x3cf49c,null));};exports[_0xcfb8('0x32')]=function(_0x410666,_0x1bdf5f,_0xfc4800){var _0x4a9a54;return db[_0xcfb8('0x39')][_0xcfb8('0x53')]({'where':{'id':_0x410666[_0xcfb8('0x50')]['id']}})[_0xcfb8('0x1b')](handleEntityNotFound(_0x1bdf5f,null))[_0xcfb8('0x1b')](removeEntity(_0x1bdf5f,null))[_0xcfb8('0x1b')](function(){return db[_0xcfb8('0x39')][_0xcfb8('0x4e')]({'raw':!![]});})[_0xcfb8('0x1b')](function(_0xee6c01){var _0x11debd=fs[_0xcfb8('0x56')](path['join'](config[_0xcfb8('0x64')],'server/files/templates/context.ejs'),_0xcfb8('0x59'));var _0x228d76=ejs['render'](_0x11debd,{'contexts':_0xee6c01});fs[_0xcfb8('0x65')](_0xcfb8('0x5b'),_0x228d76);return respondWithRpcPromise(_0xcfb8('0x5c'),_0xcfb8('0x32'),{'module':_0xcfb8('0x5d')});})['catch'](handleError(_0x1bdf5f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e2a0e62..25a6c3e 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 _0x6324=['../../config/logger','api','request-promise','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6324,0x17b));var _0x4632=function(_0x5d1dad,_0x2cbdd4){_0x5d1dad=_0x5d1dad-0x0;var _0x334f8d=_0x6324[_0x5d1dad];return _0x334f8d;};'use strict';var _=require('lodash');var util=require(_0x4632('0x0'));var logger=require(_0x4632('0x1'))(_0x4632('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4632('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4632('0x4'));var config=require('../../config/environment');var attributes=require(_0x4632('0x5'));module[_0x4632('0x6')]=function(_0x130b5e,_0x5aade7){return _0x130b5e[_0x4632('0x7')](_0x4632('0x8'),attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaa6=['voice_contexts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext'];(function(_0x595a4b,_0x18475a){var _0x3bc83c=function(_0x54d8a2){while(--_0x54d8a2){_0x595a4b['push'](_0x595a4b['shift']());}};_0x3bc83c(++_0x18475a);}(_0xaaa6,0xfd));var _0x6aaa=function(_0x29fcaf,_0x20c943){_0x29fcaf=_0x29fcaf-0x0;var _0x4adcb2=_0xaaa6[_0x29fcaf];return _0x4adcb2;};'use strict';var _=require(_0x6aaa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6aaa('0x1'));var moment=require(_0x6aaa('0x2'));var BPromise=require(_0x6aaa('0x3'));var rp=require(_0x6aaa('0x4'));var fs=require('fs');var path=require(_0x6aaa('0x5'));var rimraf=require(_0x6aaa('0x6'));var config=require(_0x6aaa('0x7'));var attributes=require(_0x6aaa('0x8'));module[_0x6aaa('0x9')]=function(_0xa57124,_0x35b6f0){return _0xa57124['define'](_0x6aaa('0xa'),attributes,{'tableName':_0x6aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3ad7b92..c96256f 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 _0xf81a=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x37b533,_0x49bb2f){var _0x4e0588=function(_0x3a0c93){while(--_0x3a0c93){_0x37b533['push'](_0x37b533['shift']());}};_0x4e0588(++_0x49bb2f);}(_0xf81a,0x16b));var _0xaf81=function(_0x31af76,_0x396c12){_0x31af76=_0x31af76-0x0;var _0x5757e9=_0xf81a[_0x31af76];return _0x5757e9;};'use strict';var _=require(_0xaf81('0x0'));var util=require(_0xaf81('0x1'));var moment=require(_0xaf81('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf81('0x3'));var fs=require('fs');var Redis=require(_0xaf81('0x4'));var db=require(_0xaf81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf81('0x6'))(_0xaf81('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf81('0x8'));var client=jayson[_0xaf81('0x9')][_0xaf81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfd36,_0x268973,_0x365b31){return new BPromise(function(_0x4c3052,_0x3f0ac8){return client[_0xaf81('0xb')](_0x5cfd36,_0x365b31)[_0xaf81('0xc')](function(_0x3efaaf){logger['info'](_0xaf81('0xd'),_0x268973,_0xaf81('0xe'));logger[_0xaf81('0xf')](_0xaf81('0x10'),_0x268973,_0xaf81('0xe'),JSON[_0xaf81('0x11')](_0x3efaaf));if(_0x3efaaf['error']){if(_0x3efaaf['error'][_0xaf81('0x12')]===0x1f4){logger['error'](_0xaf81('0xd'),_0x268973,_0x3efaaf[_0xaf81('0x13')][_0xaf81('0x14')]);return _0x3f0ac8(_0x3efaaf[_0xaf81('0x13')]['message']);}logger[_0xaf81('0x13')](_0xaf81('0xd'),_0x268973,_0x3efaaf[_0xaf81('0x13')][_0xaf81('0x14')]);return _0x4c3052(_0x3efaaf[_0xaf81('0x13')]['message']);}else{logger[_0xaf81('0x15')](_0xaf81('0xd'),_0x268973,'request\x20sent');_0x4c3052(_0x3efaaf[_0xaf81('0x16')][_0xaf81('0x14')]);}})[_0xaf81('0x17')](function(_0x508df4){logger[_0xaf81('0x13')](_0xaf81('0xd'),_0x268973,_0x508df4);_0x3f0ac8(_0x508df4);});});} \ No newline at end of file +var _0xe1ee=['request\x20sent','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xe1ee,0x158));var _0xee1e=function(_0x5673f2,_0x74fc53){_0x5673f2=_0x5673f2-0x0;var _0x1d457d=_0xe1ee[_0x5673f2];return _0x1d457d;};'use strict';var _=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var moment=require('moment');var BPromise=require(_0xee1e('0x2'));var rs=require(_0xee1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee1e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee1e('0x6'));var client=jayson[_0xee1e('0x7')][_0xee1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dbd99,_0x4dcff2,_0x335d60){return new BPromise(function(_0x5d549e,_0x575700){return client['request'](_0x3dbd99,_0x335d60)[_0xee1e('0x9')](function(_0x14d58b){logger[_0xee1e('0xa')]('VoiceContext,\x20%s,\x20%s',_0x4dcff2,'request\x20sent');logger[_0xee1e('0xb')](_0xee1e('0xc'),_0x4dcff2,'request\x20sent',JSON['stringify'](_0x14d58b));if(_0x14d58b[_0xee1e('0xd')]){if(_0x14d58b[_0xee1e('0xd')][_0xee1e('0xe')]===0x1f4){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b['error'][_0xee1e('0x10')]);return _0x575700(_0x14d58b[_0xee1e('0xd')][_0xee1e('0x10')]);}logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b[_0xee1e('0xd')]['message']);return _0x5d549e(_0x14d58b[_0xee1e('0xd')]['message']);}else{logger[_0xee1e('0xa')]('VoiceContext,\x20%s,\x20%s',_0x4dcff2,_0xee1e('0x11'));_0x5d549e(_0x14d58b['result'][_0xee1e('0x10')]);}})[_0xee1e('0x12')](function(_0x3f579f){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x3f579f);_0x575700(_0x3f579f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 568909d..845124b 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 _0x5b96=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x37a0e2,_0x5248ac){var _0x2b9fb1=function(_0x5d2034){while(--_0x5d2034){_0x37a0e2['push'](_0x37a0e2['shift']());}};_0x2b9fb1(++_0x5248ac);}(_0x5b96,0xbc));var _0x65b9=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x5b96[_0x5c768b];return _0x335af8;};'use strict';var multer=require(_0x65b9('0x0'));var util=require('util');var path=require(_0x65b9('0x1'));var timeout=require(_0x65b9('0x2'));var express=require('express');var router=express[_0x65b9('0x3')]();var fs_extra=require(_0x65b9('0x4'));var auth=require(_0x65b9('0x5'));var interaction=require(_0x65b9('0x6'));var config=require(_0x65b9('0x7'));var controller=require(_0x65b9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x65b9('0x9')]);router[_0x65b9('0xa')](_0x65b9('0xb'),auth[_0x65b9('0xc')](),controller['describe']);router[_0x65b9('0xa')](_0x65b9('0xd'),auth[_0x65b9('0xc')](),controller[_0x65b9('0xe')]);router[_0x65b9('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x65b9('0x10')](_0x65b9('0xd'),auth[_0x65b9('0xc')](),controller[_0x65b9('0x11')]);router[_0x65b9('0x12')]('/:id',auth[_0x65b9('0xc')](),controller[_0x65b9('0x13')]);module[_0x65b9('0x14')]=router; \ No newline at end of file +var _0x8938=['describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x8938,0xb2));var _0x8893=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x8938[_0x142ec2];return _0x45ef4e;};'use strict';var multer=require(_0x8893('0x0'));var util=require(_0x8893('0x1'));var path=require(_0x8893('0x2'));var timeout=require(_0x8893('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8893('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8893('0x5'));var config=require(_0x8893('0x6'));var controller=require(_0x8893('0x7'));router[_0x8893('0x8')]('/',auth[_0x8893('0x9')](),controller[_0x8893('0xa')]);router[_0x8893('0x8')](_0x8893('0xb'),auth[_0x8893('0x9')](),controller[_0x8893('0xc')]);router[_0x8893('0x8')](_0x8893('0xd'),auth[_0x8893('0x9')](),controller[_0x8893('0xe')]);router[_0x8893('0xf')]('/',auth[_0x8893('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8893('0x10')](_0x8893('0xd'),auth[_0x8893('0x9')](),controller[_0x8893('0x11')]);module[_0x8893('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5700567..1cded6b 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 _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x59c647,_0x8153f8){var _0x425452=function(_0x27e04e){while(--_0x27e04e){_0x59c647['push'](_0x59c647['shift']());}};_0x425452(++_0x8153f8);}(_0x55ca,0x126));var _0xa55c=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0x55ca[_0x491468];return _0x5b8c22;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index e13ed04..deb278e 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 _0x972e=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status'];(function(_0x401a4d,_0x4bb835){var _0x1faaff=function(_0x57539e){while(--_0x57539e){_0x401a4d['push'](_0x401a4d['shift']());}};_0x1faaff(++_0x4bb835);}(_0x972e,0x14e));var _0xe972=function(_0x3066c5,_0x4d4edf){_0x3066c5=_0x3066c5-0x0;var _0x2dcd8e=_0x972e[_0x3066c5];return _0x2dcd8e;};'use strict';var emlformat=require(_0xe972('0x0'));var rimraf=require(_0xe972('0x1'));var zipdir=require(_0xe972('0x2'));var jsonpatch=require(_0xe972('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe972('0x4'));var Mustache=require('mustache');var util=require(_0xe972('0x5'));var path=require(_0xe972('0x6'));var sox=require(_0xe972('0x7'));var csv=require(_0xe972('0x8'));var ejs=require(_0xe972('0x9'));var fs=require('fs');var fs_extra=require(_0xe972('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe972('0xb'));var deskjs=require(_0xe972('0xc'));var toCsv=require(_0xe972('0x8'));var querystring=require('querystring');var Papa=require(_0xe972('0xd'));var Redis=require('ioredis');var authService=require(_0xe972('0xe'));var qs=require(_0xe972('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe972('0x10'))(_0xe972('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe972('0x12'));var db=require(_0xe972('0x13'))['db'];function respondWithStatusCode(_0x5a19ed,_0xb35d3){_0xb35d3=_0xb35d3||0xcc;return function(_0x34aac5){if(_0x34aac5){return _0x5a19ed['sendStatus'](_0xb35d3);}return _0x5a19ed[_0xe972('0x14')](_0xb35d3)[_0xe972('0x15')]();};}function respondWithResult(_0x3323d9,_0x3192c6){_0x3192c6=_0x3192c6||0xc8;return function(_0x2b7f44){if(_0x2b7f44){return _0x3323d9[_0xe972('0x14')](_0x3192c6)[_0xe972('0x16')](_0x2b7f44);}};}function respondWithFilteredResult(_0x4196d7,_0xa66212){return function(_0x1b7b8c){if(_0x1b7b8c){var _0x4c2d5b=typeof _0xa66212[_0xe972('0x17')]===_0xe972('0x18')&&typeof _0xa66212[_0xe972('0x19')]===_0xe972('0x18');var _0x587f10=_0x1b7b8c[_0xe972('0x1a')];var _0x2504eb=_0x4c2d5b?0x0:_0xa66212[_0xe972('0x17')];var _0x5a9206=_0x4c2d5b?_0x1b7b8c[_0xe972('0x1a')]:_0xa66212[_0xe972('0x17')]+_0xa66212[_0xe972('0x19')];var _0x3d2a8c;if(_0x5a9206>=_0x587f10){_0x5a9206=_0x587f10;_0x3d2a8c=0xc8;}else{_0x3d2a8c=0xce;}_0x4196d7['status'](_0x3d2a8c);return _0x4196d7['set'](_0xe972('0x1b'),_0x2504eb+'-'+_0x5a9206+'/'+_0x587f10)[_0xe972('0x16')](_0x1b7b8c);}return null;};}function patchUpdates(_0x47098c){return function(_0x34f4bc){try{jsonpatch[_0xe972('0x1c')](_0x34f4bc,_0x47098c,!![]);}catch(_0x124b3b){return BPromise[_0xe972('0x1d')](_0x124b3b);}return _0x34f4bc[_0xe972('0x1e')]();};}function saveUpdates(_0x53c4c2,_0x40ba16){return function(_0x5c7221){if(_0x5c7221){return _0x5c7221[_0xe972('0x1f')](_0x53c4c2)[_0xe972('0x20')](function(_0x5a574e){return _0x5a574e;});}return null;};}function removeEntity(_0x416873,_0x1a02be){return function(_0x1a1043){if(_0x1a1043){return _0x1a1043[_0xe972('0x21')]()['then'](function(){_0x416873[_0xe972('0x14')](0xcc)[_0xe972('0x15')]();});}};}function handleEntityNotFound(_0x1c4987,_0xfc28f1){return function(_0x2bffae){if(!_0x2bffae){_0x1c4987['sendStatus'](0x194);}return _0x2bffae;};}function handleError(_0x249b57,_0x5b8c62){_0x5b8c62=_0x5b8c62||0x1f4;return function(_0x539759){logger[_0xe972('0x22')](_0x539759[_0xe972('0x23')]);if(_0x539759[_0xe972('0x24')]){delete _0x539759['name'];}_0x249b57[_0xe972('0x14')](_0x5b8c62)[_0xe972('0x25')](_0x539759);};}exports[_0xe972('0x26')]=function(_0x5b5f31,_0x362ab1){var _0x1cf823={},_0x53c61f={},_0x46c030={'count':0x0,'rows':[]};var _0x1a7c90=_[_0xe972('0x27')](db[_0xe972('0x28')][_0xe972('0x29')],function(_0x16dbb5){return{'name':_0x16dbb5['fieldName'],'type':_0x16dbb5[_0xe972('0x2a')][_0xe972('0x2b')]};});_0x53c61f[_0xe972('0x2c')]=_[_0xe972('0x27')](_0x1a7c90,_0xe972('0x24'));_0x53c61f[_0xe972('0x2d')]=_[_0xe972('0x2e')](_0x5b5f31[_0xe972('0x2d')]);_0x53c61f[_0xe972('0x2f')]=_[_0xe972('0x30')](_0x53c61f[_0xe972('0x2c')],_0x53c61f[_0xe972('0x2d')]);_0x1cf823[_0xe972('0x31')]=_[_0xe972('0x30')](_0x53c61f[_0xe972('0x2c')],qs[_0xe972('0x32')](_0x5b5f31[_0xe972('0x2d')][_0xe972('0x32')]));_0x1cf823[_0xe972('0x31')]=_0x1cf823[_0xe972('0x31')][_0xe972('0x33')]?_0x1cf823[_0xe972('0x31')]:_0x53c61f[_0xe972('0x2c')];if(!_0x5b5f31['query'][_0xe972('0x34')]('nolimit')){_0x1cf823['limit']=qs[_0xe972('0x19')](_0x5b5f31[_0xe972('0x2d')][_0xe972('0x19')]);_0x1cf823[_0xe972('0x17')]=qs['offset'](_0x5b5f31[_0xe972('0x2d')][_0xe972('0x17')]);}_0x1cf823[_0xe972('0x35')]=qs[_0xe972('0x36')](_0x5b5f31[_0xe972('0x2d')][_0xe972('0x36')]);_0x1cf823['where']=qs['filters'](_[_0xe972('0x37')](_0x5b5f31[_0xe972('0x2d')],_0x53c61f[_0xe972('0x2f')]),_0x1a7c90);if(_0x5b5f31[_0xe972('0x2d')]['filter']){_0x1cf823['where']=_[_0xe972('0x38')](_0x1cf823[_0xe972('0x39')],{'$or':_['map'](_0x1a7c90,function(_0x570fbd){if(_0x570fbd[_0xe972('0x2a')]!==_0xe972('0x3a')){var _0x2bfc2b={};_0x2bfc2b[_0x570fbd[_0xe972('0x24')]]={'$like':'%'+_0x5b5f31[_0xe972('0x2d')][_0xe972('0x3b')]+'%'};return _0x2bfc2b;}})});}_0x1cf823=_[_0xe972('0x38')]({},_0x1cf823,_0x5b5f31[_0xe972('0x3c')]);var _0x13581a={'where':_0x1cf823[_0xe972('0x39')]};return db['VoiceDialReport'][_0xe972('0x1a')](_0x13581a)['then'](function(_0x36bcd0){_0x46c030['count']=_0x36bcd0;if(_0x5b5f31['query']['includeAll']){_0x1cf823['include']=[{'all':!![]}];}return db[_0xe972('0x28')][_0xe972('0x3d')](_0x1cf823);})['then'](function(_0x1b739c){_0x46c030[_0xe972('0x3e')]=_0x1b739c;return _0x46c030;})[_0xe972('0x20')](respondWithFilteredResult(_0x362ab1,_0x1cf823))[_0xe972('0x3f')](handleError(_0x362ab1,null));};exports[_0xe972('0x40')]=function(_0x28109,_0x18dda1){var _0x5d666b={'raw':!![],'where':{'id':_0x28109['params']['id']}},_0x3bb521={};_0x3bb521['model']=_['keys'](db[_0xe972('0x28')][_0xe972('0x29')]);_0x3bb521[_0xe972('0x2d')]=_[_0xe972('0x2e')](_0x28109['query']);_0x3bb521[_0xe972('0x2f')]=_[_0xe972('0x30')](_0x3bb521['model'],_0x3bb521['query']);_0x5d666b[_0xe972('0x31')]=_['intersection'](_0x3bb521[_0xe972('0x2c')],qs['fields'](_0x28109['query'][_0xe972('0x32')]));_0x5d666b['attributes']=_0x5d666b[_0xe972('0x31')][_0xe972('0x33')]?_0x5d666b[_0xe972('0x31')]:_0x3bb521[_0xe972('0x2c')];if(_0x28109[_0xe972('0x2d')][_0xe972('0x41')]){_0x5d666b['include']=[{'all':!![]}];}_0x5d666b=_[_0xe972('0x38')]({},_0x5d666b,_0x28109[_0xe972('0x3c')]);return db[_0xe972('0x28')][_0xe972('0x42')](_0x5d666b)[_0xe972('0x20')](handleEntityNotFound(_0x18dda1,null))[_0xe972('0x20')](respondWithResult(_0x18dda1,null))[_0xe972('0x3f')](handleError(_0x18dda1,null));};exports[_0xe972('0x43')]=function(_0x1e1c64,_0x8197df){return db['VoiceDialReport'][_0xe972('0x43')](_0x1e1c64[_0xe972('0x44')],{})[_0xe972('0x20')](respondWithResult(_0x8197df,0xc9))[_0xe972('0x3f')](handleError(_0x8197df,null));};exports[_0xe972('0x1f')]=function(_0x4221b3,_0xc56d0f){if(_0x4221b3[_0xe972('0x44')]['id']){delete _0x4221b3[_0xe972('0x44')]['id'];}return db[_0xe972('0x28')][_0xe972('0x42')]({'where':{'id':_0x4221b3[_0xe972('0x45')]['id']}})[_0xe972('0x20')](handleEntityNotFound(_0xc56d0f,null))[_0xe972('0x20')](saveUpdates(_0x4221b3[_0xe972('0x44')],null))[_0xe972('0x20')](respondWithResult(_0xc56d0f,null))['catch'](handleError(_0xc56d0f,null));};exports[_0xe972('0x21')]=function(_0x24d180,_0x524a34){return db['VoiceDialReport'][_0xe972('0x42')]({'where':{'id':_0x24d180['params']['id']}})[_0xe972('0x20')](handleEntityNotFound(_0x524a34,null))[_0xe972('0x20')](removeEntity(_0x524a34,null))['catch'](handleError(_0x524a34,null));};exports[_0xe972('0x46')]=function(_0x2067d7,_0x9385bd){return db[_0xe972('0x28')][_0xe972('0x46')]()[_0xe972('0x20')](respondWithResult(_0x9385bd,null))['catch'](handleError(_0x9385bd,null));}; \ No newline at end of file +var _0xd916=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','then','end','error','stack','name','send','index','VoiceDialReport','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x4eecb8,_0x5c2ee2){var _0x3d32dc=function(_0x136b6c){while(--_0x136b6c){_0x4eecb8['push'](_0x4eecb8['shift']());}};_0x3d32dc(++_0x5c2ee2);}(_0xd916,0xa5));var _0x6d91=function(_0x215d56,_0x3f1db2){_0x215d56=_0x215d56-0x0;var _0x28078e=_0xd916[_0x215d56];return _0x28078e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d91('0x0'));var zipdir=require(_0x6d91('0x1'));var jsonpatch=require(_0x6d91('0x2'));var rp=require(_0x6d91('0x3'));var moment=require(_0x6d91('0x4'));var BPromise=require(_0x6d91('0x5'));var Mustache=require('mustache');var util=require(_0x6d91('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6d91('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d91('0x8'));var _=require(_0x6d91('0x9'));var squel=require(_0x6d91('0xa'));var crypto=require(_0x6d91('0xb'));var jsforce=require(_0x6d91('0xc'));var deskjs=require(_0x6d91('0xd'));var toCsv=require(_0x6d91('0x7'));var querystring=require('querystring');var Papa=require(_0x6d91('0xe'));var Redis=require(_0x6d91('0xf'));var authService=require(_0x6d91('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d91('0x11'));var logger=require(_0x6d91('0x12'))(_0x6d91('0x13'));var utils=require(_0x6d91('0x14'));var config=require(_0x6d91('0x15'));var licenseUtil=require(_0x6d91('0x16'));var db=require(_0x6d91('0x17'))['db'];function respondWithStatusCode(_0x2c4f1c,_0x57ac57){_0x57ac57=_0x57ac57||0xcc;return function(_0xbb1d90){if(_0xbb1d90){return _0x2c4f1c[_0x6d91('0x18')](_0x57ac57);}return _0x2c4f1c[_0x6d91('0x19')](_0x57ac57)['end']();};}function respondWithResult(_0x36c004,_0x449c97){_0x449c97=_0x449c97||0xc8;return function(_0x10df20){if(_0x10df20){return _0x36c004[_0x6d91('0x19')](_0x449c97)['json'](_0x10df20);}};}function respondWithFilteredResult(_0x325054,_0xd39eab){return function(_0x286149){if(_0x286149){var _0x52a962=typeof _0xd39eab[_0x6d91('0x1a')]===_0x6d91('0x1b')&&typeof _0xd39eab[_0x6d91('0x1c')]===_0x6d91('0x1b');var _0x3e531=_0x286149[_0x6d91('0x1d')];var _0x50aeea=_0x52a962?0x0:_0xd39eab['offset'];var _0xfa2c57=_0x52a962?_0x286149[_0x6d91('0x1d')]:_0xd39eab[_0x6d91('0x1a')]+_0xd39eab[_0x6d91('0x1c')];var _0x50d02c;if(_0xfa2c57>=_0x3e531){_0xfa2c57=_0x3e531;_0x50d02c=0xc8;}else{_0x50d02c=0xce;}_0x325054['status'](_0x50d02c);return _0x325054['set'](_0x6d91('0x1e'),_0x50aeea+'-'+_0xfa2c57+'/'+_0x3e531)['json'](_0x286149);}return null;};}function patchUpdates(_0x2a721a){return function(_0x4f6593){try{jsonpatch[_0x6d91('0x1f')](_0x4f6593,_0x2a721a,!![]);}catch(_0x44a253){return BPromise[_0x6d91('0x20')](_0x44a253);}return _0x4f6593['save']();};}function saveUpdates(_0xb9ec70,_0x4c9b08){return function(_0x498991){if(_0x498991){return _0x498991['update'](_0xb9ec70)['then'](function(_0x5ef4cb){return _0x5ef4cb;});}return null;};}function removeEntity(_0x2b2a25,_0x24c0b3){return function(_0x42aeff){if(_0x42aeff){return _0x42aeff['destroy']()[_0x6d91('0x21')](function(){_0x2b2a25[_0x6d91('0x19')](0xcc)[_0x6d91('0x22')]();});}};}function handleEntityNotFound(_0x4d4f33,_0x39b2c2){return function(_0x7a99fe){if(!_0x7a99fe){_0x4d4f33[_0x6d91('0x18')](0x194);}return _0x7a99fe;};}function handleError(_0x314bed,_0x2eeeb7){_0x2eeeb7=_0x2eeeb7||0x1f4;return function(_0x152f11){logger[_0x6d91('0x23')](_0x152f11[_0x6d91('0x24')]);if(_0x152f11[_0x6d91('0x25')]){delete _0x152f11[_0x6d91('0x25')];}_0x314bed[_0x6d91('0x19')](_0x2eeeb7)[_0x6d91('0x26')](_0x152f11);};}exports[_0x6d91('0x27')]=function(_0xe0f90f,_0x180bab){var _0x196211={},_0x13d227={},_0x1d0176={'count':0x0,'rows':[]};var _0x5c9fba=_['map'](db[_0x6d91('0x28')][_0x6d91('0x29')],function(_0x4a2ef4){return{'name':_0x4a2ef4['fieldName'],'type':_0x4a2ef4[_0x6d91('0x2a')]['key']};});_0x13d227[_0x6d91('0x2b')]=_[_0x6d91('0x2c')](_0x5c9fba,'name');_0x13d227[_0x6d91('0x2d')]=_[_0x6d91('0x2e')](_0xe0f90f[_0x6d91('0x2d')]);_0x13d227[_0x6d91('0x2f')]=_[_0x6d91('0x30')](_0x13d227[_0x6d91('0x2b')],_0x13d227['query']);_0x196211[_0x6d91('0x31')]=_[_0x6d91('0x30')](_0x13d227['model'],qs[_0x6d91('0x32')](_0xe0f90f[_0x6d91('0x2d')]['fields']));_0x196211[_0x6d91('0x31')]=_0x196211[_0x6d91('0x31')]['length']?_0x196211['attributes']:_0x13d227[_0x6d91('0x2b')];if(!_0xe0f90f[_0x6d91('0x2d')][_0x6d91('0x33')]('nolimit')){_0x196211[_0x6d91('0x1c')]=qs[_0x6d91('0x1c')](_0xe0f90f[_0x6d91('0x2d')][_0x6d91('0x1c')]);_0x196211['offset']=qs[_0x6d91('0x1a')](_0xe0f90f[_0x6d91('0x2d')][_0x6d91('0x1a')]);}_0x196211[_0x6d91('0x34')]=qs[_0x6d91('0x35')](_0xe0f90f[_0x6d91('0x2d')][_0x6d91('0x35')]);_0x196211[_0x6d91('0x36')]=qs[_0x6d91('0x2f')](_[_0x6d91('0x37')](_0xe0f90f[_0x6d91('0x2d')],_0x13d227[_0x6d91('0x2f')]),_0x5c9fba);if(_0xe0f90f['query'][_0x6d91('0x38')]){_0x196211[_0x6d91('0x36')]=_[_0x6d91('0x39')](_0x196211[_0x6d91('0x36')],{'$or':_[_0x6d91('0x2c')](_0x5c9fba,function(_0xe300d8){if(_0xe300d8[_0x6d91('0x2a')]!==_0x6d91('0x3a')){var _0x5ce51c={};_0x5ce51c[_0xe300d8[_0x6d91('0x25')]]={'$like':'%'+_0xe0f90f[_0x6d91('0x2d')]['filter']+'%'};return _0x5ce51c;}})});}_0x196211=_['merge']({},_0x196211,_0xe0f90f[_0x6d91('0x3b')]);var _0xc721ad={'where':_0x196211[_0x6d91('0x36')]};return db[_0x6d91('0x28')][_0x6d91('0x1d')](_0xc721ad)[_0x6d91('0x21')](function(_0xae1369){_0x1d0176[_0x6d91('0x1d')]=_0xae1369;if(_0xe0f90f[_0x6d91('0x2d')][_0x6d91('0x3c')]){_0x196211[_0x6d91('0x3d')]=[{'all':!![]}];}return db[_0x6d91('0x28')][_0x6d91('0x3e')](_0x196211);})[_0x6d91('0x21')](function(_0x1cc1b6){_0x1d0176['rows']=_0x1cc1b6;return _0x1d0176;})['then'](respondWithFilteredResult(_0x180bab,_0x196211))['catch'](handleError(_0x180bab,null));};exports[_0x6d91('0x3f')]=function(_0x95b430,_0xc5f0e0){var _0x33f0d4={'raw':!![],'where':{'id':_0x95b430[_0x6d91('0x40')]['id']}},_0x1e6eeb={};_0x1e6eeb['model']=_[_0x6d91('0x2e')](db[_0x6d91('0x28')][_0x6d91('0x29')]);_0x1e6eeb[_0x6d91('0x2d')]=_[_0x6d91('0x2e')](_0x95b430[_0x6d91('0x2d')]);_0x1e6eeb[_0x6d91('0x2f')]=_['intersection'](_0x1e6eeb[_0x6d91('0x2b')],_0x1e6eeb[_0x6d91('0x2d')]);_0x33f0d4[_0x6d91('0x31')]=_[_0x6d91('0x30')](_0x1e6eeb['model'],qs['fields'](_0x95b430['query'][_0x6d91('0x32')]));_0x33f0d4['attributes']=_0x33f0d4[_0x6d91('0x31')][_0x6d91('0x41')]?_0x33f0d4[_0x6d91('0x31')]:_0x1e6eeb[_0x6d91('0x2b')];if(_0x95b430[_0x6d91('0x2d')][_0x6d91('0x3c')]){_0x33f0d4[_0x6d91('0x3d')]=[{'all':!![]}];}_0x33f0d4=_['merge']({},_0x33f0d4,_0x95b430['options']);return db['VoiceDialReport'][_0x6d91('0x42')](_0x33f0d4)[_0x6d91('0x21')](handleEntityNotFound(_0xc5f0e0,null))['then'](respondWithResult(_0xc5f0e0,null))[_0x6d91('0x43')](handleError(_0xc5f0e0,null));};exports[_0x6d91('0x44')]=function(_0x3becf7,_0x2b4879){return db[_0x6d91('0x28')][_0x6d91('0x44')](_0x3becf7['body'],{})[_0x6d91('0x21')](respondWithResult(_0x2b4879,0xc9))[_0x6d91('0x43')](handleError(_0x2b4879,null));};exports[_0x6d91('0x45')]=function(_0x210c78,_0x12c867){if(_0x210c78[_0x6d91('0x46')]['id']){delete _0x210c78[_0x6d91('0x46')]['id'];}return db[_0x6d91('0x28')]['find']({'where':{'id':_0x210c78[_0x6d91('0x40')]['id']}})[_0x6d91('0x21')](handleEntityNotFound(_0x12c867,null))['then'](saveUpdates(_0x210c78['body'],null))['then'](respondWithResult(_0x12c867,null))['catch'](handleError(_0x12c867,null));};exports[_0x6d91('0x47')]=function(_0xe74260,_0x4e5851){return db[_0x6d91('0x28')][_0x6d91('0x42')]({'where':{'id':_0xe74260[_0x6d91('0x40')]['id']}})['then'](handleEntityNotFound(_0x4e5851,null))['then'](removeEntity(_0x4e5851,null))[_0x6d91('0x43')](handleError(_0x4e5851,null));};exports['describe']=function(_0x2f8c1a,_0xfdc570){return db[_0x6d91('0x28')][_0x6d91('0x48')]()[_0x6d91('0x21')](respondWithResult(_0xfdc570,null))['catch'](handleError(_0xfdc570,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 8f06771..0f94c8d 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 _0x7d55=['./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x5434b2,_0x1165e4){var _0x529056=function(_0x3a8c9b){while(--_0x3a8c9b){_0x5434b2['push'](_0x5434b2['shift']());}};_0x529056(++_0x1165e4);}(_0x7d55,0x1bc));var _0x57d5=function(_0x2ac4dc,_0x24eb29){_0x2ac4dc=_0x2ac4dc-0x0;var _0x157506=_0x7d55[_0x2ac4dc];return _0x157506;};'use strict';var _=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var logger=require(_0x57d5('0x2'))(_0x57d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x57d5('0x4'));var fs=require('fs');var path=require(_0x57d5('0x5'));var rimraf=require(_0x57d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x57d5('0x7'));module[_0x57d5('0x8')]=function(_0x15c349,_0x30fcfe){return _0x15c349[_0x57d5('0x9')](_0x57d5('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb83=['./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x242e9c,_0xdad33){var _0x2a3f42=function(_0x2aad25){while(--_0x2aad25){_0x242e9c['push'](_0x242e9c['shift']());}};_0x2a3f42(++_0xdad33);}(_0xcb83,0x1c5));var _0x3cb8=function(_0x3cb7d4,_0x4a504d){_0x3cb7d4=_0x3cb7d4-0x0;var _0x37be9c=_0xcb83[_0x3cb7d4];return _0x37be9c;};'use strict';var _=require(_0x3cb8('0x0'));var util=require('util');var logger=require(_0x3cb8('0x1'))(_0x3cb8('0x2'));var moment=require(_0x3cb8('0x3'));var BPromise=require(_0x3cb8('0x4'));var rp=require(_0x3cb8('0x5'));var fs=require('fs');var path=require(_0x3cb8('0x6'));var rimraf=require(_0x3cb8('0x7'));var config=require(_0x3cb8('0x8'));var attributes=require(_0x3cb8('0x9'));module[_0x3cb8('0xa')]=function(_0x548aaf,_0x7964a8){return _0x548aaf[_0x3cb8('0xb')](_0x3cb8('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x3cb8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d0ca751..a54b416 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 _0x5a9c=['attributes','limit','lodash','util','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','where'];(function(_0x4ea3db,_0x511e7c){var _0x5328ac=function(_0x20ac2e){while(--_0x20ac2e){_0x4ea3db['push'](_0x4ea3db['shift']());}};_0x5328ac(++_0x511e7c);}(_0x5a9c,0x176));var _0xc5a9=function(_0x5793c2,_0x27f5d9){_0x5793c2=_0x5793c2-0x0;var _0xf89c7=_0x5a9c[_0x5793c2];return _0xf89c7;};'use strict';var _=require(_0xc5a9('0x0'));var util=require(_0xc5a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc5a9('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xc5a9('0x5')][_0xc5a9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x19c401,_0x137fb6,_0x574642){return new BPromise(function(_0x551c36,_0x453dec){return client[_0xc5a9('0x7')](_0x19c401,_0x574642)[_0xc5a9('0x8')](function(_0xd2cac){logger[_0xc5a9('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x137fb6,_0xc5a9('0xa'));logger[_0xc5a9('0xb')](_0xc5a9('0xc'),_0x137fb6,_0xc5a9('0xa'),JSON[_0xc5a9('0xd')](_0xd2cac));if(_0xd2cac[_0xc5a9('0xe')]){if(_0xd2cac[_0xc5a9('0xe')][_0xc5a9('0xf')]===0x1f4){logger[_0xc5a9('0xe')](_0xc5a9('0x10'),_0x137fb6,_0xd2cac[_0xc5a9('0xe')][_0xc5a9('0x11')]);return _0x453dec(_0xd2cac[_0xc5a9('0xe')][_0xc5a9('0x11')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x137fb6,_0xd2cac[_0xc5a9('0xe')][_0xc5a9('0x11')]);return _0x551c36(_0xd2cac['error']['message']);}else{logger[_0xc5a9('0x9')](_0xc5a9('0x10'),_0x137fb6,_0xc5a9('0xa'));_0x551c36(_0xd2cac[_0xc5a9('0x12')][_0xc5a9('0x11')]);}})[_0xc5a9('0x13')](function(_0x4d4561){logger['error'](_0xc5a9('0x10'),_0x137fb6,_0x4d4561);_0x453dec(_0x4d4561);});});}exports[_0xc5a9('0x14')]=function(_0x41b111){var _0x498add=this;return new Promise(function(_0x194247,_0xc89ef2){return db['VoiceDialReport'][_0xc5a9('0x15')](_0x41b111[_0xc5a9('0x16')],{'raw':_0x41b111[_0xc5a9('0x17')]?_0x41b111[_0xc5a9('0x17')][_0xc5a9('0x18')]===undefined?!![]:![]:!![]})[_0xc5a9('0x8')](function(_0x432838){logger['info']('CreateVoiceDialReport',_0x41b111);logger['debug'](_0xc5a9('0x14'),_0x41b111,JSON[_0xc5a9('0xd')](_0x432838));_0x194247(_0x432838);})[_0xc5a9('0x13')](function(_0x5996c4){logger[_0xc5a9('0xe')](_0xc5a9('0x14'),_0x5996c4[_0xc5a9('0x11')],_0x41b111);_0xc89ef2(_0x498add[_0xc5a9('0xe')](0x1f4,_0x5996c4[_0xc5a9('0x11')]));});});};exports[_0xc5a9('0x19')]=function(_0x4b9b8c){var _0x1f8f7b=this;return new Promise(function(_0x28ca13,_0x1ead4a){return db[_0xc5a9('0x1a')][_0xc5a9('0x1b')](_0x4b9b8c[_0xc5a9('0x16')],{'raw':_0x4b9b8c['options']?_0x4b9b8c[_0xc5a9('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b9b8c[_0xc5a9('0x17')]?_0x4b9b8c[_0xc5a9('0x17')][_0xc5a9('0x1c')]||null:null,'attributes':_0x4b9b8c[_0xc5a9('0x17')]?_0x4b9b8c[_0xc5a9('0x17')][_0xc5a9('0x1d')]||null:null,'limit':_0x4b9b8c[_0xc5a9('0x17')]?_0x4b9b8c[_0xc5a9('0x17')][_0xc5a9('0x1e')]||null:null})[_0xc5a9('0x8')](function(_0x304156){logger['info'](_0xc5a9('0x19'),_0x4b9b8c);logger[_0xc5a9('0xb')](_0xc5a9('0x19'),_0x4b9b8c,JSON['stringify'](_0x304156));_0x28ca13(_0x304156);})[_0xc5a9('0x13')](function(_0x418df7){logger['error'](_0xc5a9('0x19'),_0x418df7[_0xc5a9('0x11')],_0x4b9b8c);_0x1ead4a(_0x1f8f7b[_0xc5a9('0xe')](0x1f4,_0x418df7[_0xc5a9('0x11')]));});});}; \ No newline at end of file +var _0xbbee=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','update','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbee,0x1e8));var _0xebbe=function(_0x3a73d9,_0x264578){_0x3a73d9=_0x3a73d9-0x0;var _0x36d01f=_0xbbee[_0x3a73d9];return _0x36d01f;};'use strict';var _=require(_0xebbe('0x0'));var util=require(_0xebbe('0x1'));var moment=require(_0xebbe('0x2'));var BPromise=require(_0xebbe('0x3'));var rs=require(_0xebbe('0x4'));var fs=require('fs');var Redis=require(_0xebbe('0x5'));var db=require(_0xebbe('0x6'))['db'];var utils=require(_0xebbe('0x7'));var logger=require(_0xebbe('0x8'))(_0xebbe('0x9'));var config=require(_0xebbe('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xebbe('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ef672,_0x598b49,_0xf88d43){return new BPromise(function(_0x49bde7,_0x3e6c9d){return client[_0xebbe('0xc')](_0x2ef672,_0xf88d43)[_0xebbe('0xd')](function(_0x4055d2){logger['info'](_0xebbe('0xe'),_0x598b49,_0xebbe('0xf'));logger[_0xebbe('0x10')](_0xebbe('0x11'),_0x598b49,_0xebbe('0xf'),JSON[_0xebbe('0x12')](_0x4055d2));if(_0x4055d2[_0xebbe('0x13')]){if(_0x4055d2[_0xebbe('0x13')]['code']===0x1f4){logger[_0xebbe('0x13')](_0xebbe('0xe'),_0x598b49,_0x4055d2[_0xebbe('0x13')][_0xebbe('0x14')]);return _0x3e6c9d(_0x4055d2['error'][_0xebbe('0x14')]);}logger[_0xebbe('0x13')](_0xebbe('0xe'),_0x598b49,_0x4055d2[_0xebbe('0x13')][_0xebbe('0x14')]);return _0x49bde7(_0x4055d2[_0xebbe('0x13')][_0xebbe('0x14')]);}else{logger[_0xebbe('0x15')](_0xebbe('0xe'),_0x598b49,'request\x20sent');_0x49bde7(_0x4055d2[_0xebbe('0x16')][_0xebbe('0x14')]);}})[_0xebbe('0x17')](function(_0x2702c9){logger[_0xebbe('0x13')](_0xebbe('0xe'),_0x598b49,_0x2702c9);_0x3e6c9d(_0x2702c9);});});}exports[_0xebbe('0x18')]=function(_0x166b0d){var _0x4ea36b=this;return new Promise(function(_0x16301e,_0x5780ef){return db[_0xebbe('0x19')][_0xebbe('0x1a')](_0x166b0d[_0xebbe('0x1b')],{'raw':_0x166b0d[_0xebbe('0x1c')]?_0x166b0d['options'][_0xebbe('0x1d')]===undefined?!![]:![]:!![]})[_0xebbe('0xd')](function(_0x64e7f9){logger[_0xebbe('0x15')]('CreateVoiceDialReport',_0x166b0d);logger[_0xebbe('0x10')]('CreateVoiceDialReport',_0x166b0d,JSON['stringify'](_0x64e7f9));_0x16301e(_0x64e7f9);})[_0xebbe('0x17')](function(_0x541d7a){logger['error'](_0xebbe('0x18'),_0x541d7a['message'],_0x166b0d);_0x5780ef(_0x4ea36b[_0xebbe('0x13')](0x1f4,_0x541d7a['message']));});});};exports['UpdateVoiceDialReport']=function(_0x16646d){var _0x1eb158=this;return new Promise(function(_0x5ad04b,_0x10e747){return db[_0xebbe('0x19')][_0xebbe('0x1e')](_0x16646d['body'],{'raw':_0x16646d[_0xebbe('0x1c')]?_0x16646d[_0xebbe('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16646d[_0xebbe('0x1c')]?_0x16646d['options']['where']||null:null,'attributes':_0x16646d['options']?_0x16646d['options']['attributes']||null:null,'limit':_0x16646d['options']?_0x16646d[_0xebbe('0x1c')][_0xebbe('0x1f')]||null:null})['then'](function(_0x301312){logger['info'](_0xebbe('0x20'),_0x16646d);logger[_0xebbe('0x10')]('UpdateVoiceDialReport',_0x16646d,JSON[_0xebbe('0x12')](_0x301312));_0x5ad04b(_0x301312);})['catch'](function(_0x109539){logger[_0xebbe('0x13')](_0xebbe('0x20'),_0x109539[_0xebbe('0x14')],_0x16646d);_0x10e747(_0x1eb158[_0xebbe('0x13')](0x1f4,_0x109539[_0xebbe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 12164a5..205ef64 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 _0x291d=['get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x5a5c7a,_0x15a886){var _0x51d347=function(_0x21b4d7){while(--_0x21b4d7){_0x5a5c7a['push'](_0x5a5c7a['shift']());}};_0x51d347(++_0x15a886);}(_0x291d,0xb5));var _0xd291=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x291d[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xd291('0x0'));var util=require(_0xd291('0x1'));var path=require(_0xd291('0x2'));var timeout=require(_0xd291('0x3'));var express=require('express');var router=express[_0xd291('0x4')]();var fs_extra=require(_0xd291('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd291('0x6'));var config=require(_0xd291('0x7'));var controller=require(_0xd291('0x8'));router[_0xd291('0x9')]('/',auth[_0xd291('0xa')](),controller[_0xd291('0xb')]);router[_0xd291('0x9')](_0xd291('0xc'),auth[_0xd291('0xa')](),controller['show']);router[_0xd291('0xd')]('/',auth[_0xd291('0xa')](),controller[_0xd291('0xe')]);router[_0xd291('0xd')](_0xd291('0xf'),auth[_0xd291('0xa')](),controller[_0xd291('0x10')]);router[_0xd291('0x11')]('/:id',auth[_0xd291('0xa')](),controller['update']);router['delete'](_0xd291('0xc'),auth['isAuthenticated'](),controller[_0xd291('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6f53=['post','create','/:id/applications','addApplications','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2844b1,_0x3e32fa){var _0x5d7e55=function(_0x22638a){while(--_0x22638a){_0x2844b1['push'](_0x2844b1['shift']());}};_0x5d7e55(++_0x3e32fa);}(_0x6f53,0x99));var _0x36f5=function(_0x1c7f80,_0x5ef343){_0x1c7f80=_0x1c7f80-0x0;var _0x39bdee=_0x6f53[_0x1c7f80];return _0x39bdee;};'use strict';var multer=require(_0x36f5('0x0'));var util=require('util');var path=require(_0x36f5('0x1'));var timeout=require(_0x36f5('0x2'));var express=require(_0x36f5('0x3'));var router=express[_0x36f5('0x4')]();var fs_extra=require(_0x36f5('0x5'));var auth=require(_0x36f5('0x6'));var interaction=require(_0x36f5('0x7'));var config=require(_0x36f5('0x8'));var controller=require(_0x36f5('0x9'));router[_0x36f5('0xa')]('/',auth[_0x36f5('0xb')](),controller[_0x36f5('0xc')]);router['get'](_0x36f5('0xd'),auth[_0x36f5('0xb')](),controller[_0x36f5('0xe')]);router[_0x36f5('0xf')]('/',auth[_0x36f5('0xb')](),controller[_0x36f5('0x10')]);router[_0x36f5('0xf')](_0x36f5('0x11'),auth['isAuthenticated'](),controller[_0x36f5('0x12')]);router['put'](_0x36f5('0xd'),auth[_0x36f5('0xb')](),controller[_0x36f5('0x13')]);router['delete'](_0x36f5('0xd'),auth[_0x36f5('0xb')](),controller['destroy']);module[_0x36f5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 70d2de1..8489de6 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 _0x8b3e=['exten','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','wav'];(function(_0x4d602e,_0x4b2d5b){var _0x140b40=function(_0x2100b4){while(--_0x2100b4){_0x4d602e['push'](_0x4d602e['shift']());}};_0x140b40(++_0x4b2d5b);}(_0x8b3e,0x10b));var _0xe8b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b3e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':![],'unique':_0xe8b3('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe8b3('0x2')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe8b3('0x3')](_0xe8b3('0x4'),_0xe8b3('0x5'),'internal',_0xe8b3('0x6'),_0xe8b3('0x7'),'system',_0xe8b3('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xe8b3('0x0')]},'interval':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':![],'defaultValue':_0xe8b3('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xe8b3('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe8b3('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe8b3('0x0')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe8b3('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xe8b3('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4f963e){return this['getDataValue'](_0xe8b3('0xd'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xfe6a=['outbound','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0xfe6a,0x171));var _0xafe6=function(_0x500915,_0x18f72e){_0x500915=_0x500915-0x0;var _0xa372ef=_0xfe6a[_0x500915];return _0xa372ef;};'use strict';var Sequelize=require(_0xafe6('0x0'));module[_0xafe6('0x1')]={'context':{'type':Sequelize[_0xafe6('0x2')],'allowNull':![],'unique':_0xafe6('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xafe6('0x2')],'allowNull':![],'unique':_0xafe6('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xafe6('0x3')},'tag':{'type':Sequelize[_0xafe6('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xafe6('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xafe6('0x4')](_0xafe6('0x5'),_0xafe6('0x6'),'internal','inbound-fax',_0xafe6('0x7'),_0xafe6('0x8'),_0xafe6('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xafe6('0x2')]},'interval':{'type':Sequelize[_0xafe6('0x2')],'allowNull':![],'defaultValue':_0xafe6('0xa')},'IntervalId':{'type':Sequelize[_0xafe6('0xb')]},'isApp':{'type':Sequelize[_0xafe6('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xafe6('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xafe6('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xafe6('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xafe6('0xb')]},'recordingFormat':{'type':Sequelize[_0xafe6('0x2')],'defaultValue':_0xafe6('0xd')},'answer':{'type':Sequelize[_0xafe6('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x23da24){return this['getDataValue'](_0xafe6('0xe'));}},'alias':{'type':Sequelize[_0xafe6('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 2714e93..78359fc 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 _0xf9c7=['internal','ignore','map','value','includes','find','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','include','catch','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','update','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','localhost','redis','register','sendStatus','status','end','json','offset','undefined','count','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes'];(function(_0x34348b,_0x36571e){var _0xa7c5dd=function(_0x29ba7a){while(--_0x29ba7a){_0x34348b['push'](_0x34348b['shift']());}};_0xa7c5dd(++_0x36571e);}(_0xf9c7,0x1aa));var _0x7f9c=function(_0x21a3e5,_0xe6c66b){_0x21a3e5=_0x21a3e5-0x0;var _0x21d28d=_0xf9c7[_0x21a3e5];return _0x21d28d;};'use strict';var _=require(_0x7f9c('0x0'));var Redis=require('ioredis');var qs=require(_0x7f9c('0x1'));var logger=require(_0x7f9c('0x2'))(_0x7f9c('0x3'));var config=require(_0x7f9c('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7f9c('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f9c('0x6')]));require('./voiceExtension.socket')[_0x7f9c('0x7')](socket);function respondWithStatusCode(_0x58c738,_0x15b24c){_0x15b24c=_0x15b24c||0xcc;return function(_0x50b75d){if(_0x50b75d){return _0x58c738[_0x7f9c('0x8')](_0x15b24c);}return _0x58c738[_0x7f9c('0x9')](_0x15b24c)[_0x7f9c('0xa')]();};}function respondWithResult(_0x184790,_0x43bb38){_0x43bb38=_0x43bb38||0xc8;return function(_0xbceb01){if(_0xbceb01){return _0x184790[_0x7f9c('0x9')](_0x43bb38)[_0x7f9c('0xb')](_0xbceb01);}};}function respondWithFilteredResult(_0x1d5dd6,_0x3d100f){return function(_0x4ffb93){if(_0x4ffb93){var _0x20aef5=typeof _0x3d100f[_0x7f9c('0xc')]===_0x7f9c('0xd')&&typeof _0x3d100f['limit']===_0x7f9c('0xd');var _0x5841d8=_0x4ffb93[_0x7f9c('0xe')];var _0x42fcca=_0x20aef5?0x0:_0x3d100f[_0x7f9c('0xc')];var _0x2c2c90=_0x20aef5?_0x4ffb93[_0x7f9c('0xe')]:_0x3d100f['offset']+_0x3d100f['limit'];var _0x116c46;if(_0x2c2c90>=_0x5841d8){_0x2c2c90=_0x5841d8;_0x116c46=0xc8;}else{_0x116c46=0xce;}_0x1d5dd6['status'](_0x116c46);return _0x1d5dd6[_0x7f9c('0xf')]('Content-Range',_0x42fcca+'-'+_0x2c2c90+'/'+_0x5841d8)[_0x7f9c('0xb')](_0x4ffb93);}return null;};}function removeEntity(_0x2ba309){return function(_0x258106){if(_0x258106){return _0x258106[_0x7f9c('0x10')]()[_0x7f9c('0x11')](function(){var _0x2af4f2=_0x258106[_0x7f9c('0x12')]({'plain':!![]});var _0x405347=[{'name':_0x7f9c('0x13'),'value':_0x7f9c('0x14'),'ignore':![]},{'name':_0x7f9c('0x15'),'value':_0x7f9c('0x16'),'ignore':![]},{'name':_0x7f9c('0x17'),'value':_0x7f9c('0x18'),'ignore':![]}];var _0x176f3f=_(_0x405347)['filter'](_0x7f9c('0x19'))[_0x7f9c('0x1a')](_0x7f9c('0x1b'))[_0x7f9c('0x1b')]();if(_[_0x7f9c('0x1c')](_0x176f3f,_0x2af4f2['type'])){return;}var _0x509a6d=_[_0x7f9c('0x1d')](_0x405347,[_0x7f9c('0x1b'),_0x2af4f2['type']])['name'];return db[_0x7f9c('0x1e')][_0x7f9c('0x10')]({'where':{'type':_0x509a6d,'resourceId':_0x2af4f2['id']}})[_0x7f9c('0x11')](function(){return _0x258106;});})[_0x7f9c('0x11')](function(){_0x2ba309[_0x7f9c('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112693){return function(_0x4c2efe){if(!_0x4c2efe){_0x112693[_0x7f9c('0x8')](0x194);}return _0x4c2efe;};}function handleError(_0x321a7c,_0x19b7eb){_0x19b7eb=_0x19b7eb||0x1f4;return function(_0x28ee70){logger[_0x7f9c('0x1f')](_0x28ee70[_0x7f9c('0x20')]);if(_0x28ee70[_0x7f9c('0x21')]){delete _0x28ee70[_0x7f9c('0x21')];}_0x321a7c['status'](_0x19b7eb)[_0x7f9c('0x22')](_0x28ee70);};}exports[_0x7f9c('0x23')]=function(_0x1a63a3,_0x6a315d){var _0x50616c={},_0x2e74bb={},_0x547b26={'count':0x0,'rows':[]};var _0x5b5a4b=_[_0x7f9c('0x1a')](db[_0x7f9c('0x24')][_0x7f9c('0x25')],function(_0x4a2778){return{'name':_0x4a2778[_0x7f9c('0x26')],'type':_0x4a2778[_0x7f9c('0x27')][_0x7f9c('0x28')]};});_0x2e74bb[_0x7f9c('0x29')]=_['map'](_0x5b5a4b,_0x7f9c('0x21'));_0x2e74bb[_0x7f9c('0x2a')]=_[_0x7f9c('0x2b')](_0x1a63a3[_0x7f9c('0x2a')]);_0x2e74bb[_0x7f9c('0x2c')]=_[_0x7f9c('0x2d')](_0x2e74bb[_0x7f9c('0x29')],_0x2e74bb['query']);_0x50616c[_0x7f9c('0x2e')]=_[_0x7f9c('0x2d')](_0x2e74bb[_0x7f9c('0x29')],qs[_0x7f9c('0x2f')](_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0x2f')]));_0x50616c['attributes']=_0x50616c[_0x7f9c('0x2e')][_0x7f9c('0x30')]?_0x50616c['attributes']:_0x2e74bb[_0x7f9c('0x29')];if(!_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0x31')]('nolimit')){_0x50616c[_0x7f9c('0x32')]=qs[_0x7f9c('0x32')](_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0x32')]);_0x50616c[_0x7f9c('0xc')]=qs[_0x7f9c('0xc')](_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0xc')]);}_0x50616c['order']=qs['sort'](_0x1a63a3[_0x7f9c('0x2a')]['sort']);_0x50616c[_0x7f9c('0x33')]=qs['filters'](_[_0x7f9c('0x34')](_0x1a63a3[_0x7f9c('0x2a')],_0x2e74bb[_0x7f9c('0x2c')]),_0x5b5a4b);if(_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0x35')]){_0x50616c[_0x7f9c('0x33')]=_[_0x7f9c('0x36')](_0x50616c[_0x7f9c('0x33')],{'$or':_[_0x7f9c('0x1a')](_0x5b5a4b,function(_0x3ebc2d){if(_0x3ebc2d[_0x7f9c('0x27')]!==_0x7f9c('0x37')){var _0x1a6d66={};_0x1a6d66[_0x3ebc2d['name']]={'$like':'%'+_0x1a63a3[_0x7f9c('0x2a')]['filter']+'%'};return _0x1a6d66;}})});}_0x50616c=_[_0x7f9c('0x36')]({},_0x50616c,_0x1a63a3[_0x7f9c('0x38')]);var _0x35b2cf={'where':_0x50616c[_0x7f9c('0x33')]};return db[_0x7f9c('0x24')][_0x7f9c('0xe')](_0x35b2cf)['then'](function(_0x4b4424){_0x547b26['count']=_0x4b4424;if(_0x1a63a3[_0x7f9c('0x2a')][_0x7f9c('0x39')]){_0x50616c['include']=[{'all':!![]}];}return db[_0x7f9c('0x24')]['findAll'](_0x50616c);})[_0x7f9c('0x11')](function(_0x21e0cc){_0x547b26[_0x7f9c('0x3a')]=_0x21e0cc;return _0x547b26;})[_0x7f9c('0x11')](respondWithFilteredResult(_0x6a315d,_0x50616c))['catch'](handleError(_0x6a315d,null));};exports['show']=function(_0x4fd2f7,_0x4ae0a2){var _0x4cfca3={'raw':![],'where':{'id':_0x4fd2f7[_0x7f9c('0x3b')]['id']}},_0x57147c={};_0x57147c[_0x7f9c('0x29')]=_['keys'](db[_0x7f9c('0x24')][_0x7f9c('0x25')]);_0x57147c[_0x7f9c('0x2a')]=_[_0x7f9c('0x2b')](_0x4fd2f7[_0x7f9c('0x2a')]);_0x57147c[_0x7f9c('0x2c')]=_[_0x7f9c('0x2d')](_0x57147c[_0x7f9c('0x29')],_0x57147c[_0x7f9c('0x2a')]);_0x4cfca3['attributes']=_['intersection'](_0x57147c[_0x7f9c('0x29')],qs['fields'](_0x4fd2f7[_0x7f9c('0x2a')][_0x7f9c('0x2f')]));_0x4cfca3[_0x7f9c('0x2e')]=_0x4cfca3[_0x7f9c('0x2e')][_0x7f9c('0x30')]?_0x4cfca3['attributes']:_0x57147c[_0x7f9c('0x29')];if(_0x4fd2f7[_0x7f9c('0x2a')][_0x7f9c('0x39')]){_0x4cfca3[_0x7f9c('0x3c')]=[{'all':!![]}];}_0x4cfca3=_[_0x7f9c('0x36')]({},_0x4cfca3,_0x4fd2f7[_0x7f9c('0x38')]);return db[_0x7f9c('0x24')][_0x7f9c('0x1d')](_0x4cfca3)[_0x7f9c('0x11')](handleEntityNotFound(_0x4ae0a2,null))[_0x7f9c('0x11')](respondWithResult(_0x4ae0a2,null))[_0x7f9c('0x3d')](handleError(_0x4ae0a2,null));};exports[_0x7f9c('0x10')]=function(_0x117711,_0x53e221){return db['VoiceExtension'][_0x7f9c('0x1d')]({'where':{'id':_0x117711[_0x7f9c('0x3b')]['id']}})[_0x7f9c('0x11')](handleEntityNotFound(_0x53e221,null))[_0x7f9c('0x11')](removeEntity(_0x53e221,null))['catch'](handleError(_0x53e221,null));};exports['create']=function(_0x4ce4f2,_0x7a2a1d){if(_0x4ce4f2[_0x7f9c('0x3e')][_0x7f9c('0x27')]===_0x7f9c('0x16')&&!_[_0x7f9c('0x3f')](_0x4ce4f2['body'][_0x7f9c('0x40')],'_')){_0x4ce4f2[_0x7f9c('0x3e')][_0x7f9c('0x40')]='_'['concat'](_0x4ce4f2[_0x7f9c('0x3e')][_0x7f9c('0x40')]);}return db['VoiceExtension']['create'](_0x4ce4f2['body'],{'raw':![]})[_0x7f9c('0x11')](function(_0x3298dc){var _0x10eede=_0x4ce4f2['user']['get']({'plain':!![]});if(!_0x10eede)throw new Error(_0x7f9c('0x41'));if(_0x10eede[_0x7f9c('0x42')]==='user'){var _0x119e0e=_0x3298dc[_0x7f9c('0x12')]({'plain':!![]});var _0x4fccfb=[{'name':_0x7f9c('0x13'),'value':_0x7f9c('0x14')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':_0x7f9c('0x18')}];var _0x3bad3e=_[_0x7f9c('0x1d')](_0x4fccfb,[_0x7f9c('0x1b'),_0x119e0e[_0x7f9c('0x27')]])[_0x7f9c('0x21')];return db[_0x7f9c('0x43')]['find']({'where':{'name':_0x3bad3e,'userProfileId':_0x10eede[_0x7f9c('0x44')]},'raw':!![]})[_0x7f9c('0x11')](function(_0x532d96){if(_0x532d96&&_0x532d96[_0x7f9c('0x45')]===0x0){return db[_0x7f9c('0x1e')][_0x7f9c('0x46')]({'name':_0x119e0e[_0x7f9c('0x21')],'resourceId':_0x119e0e['id'],'type':_0x532d96[_0x7f9c('0x21')],'sectionId':_0x532d96['id']},{})[_0x7f9c('0x11')](function(){return _0x3298dc;});}else{return _0x3298dc;}})['catch'](function(_0x2bd62b){logger[_0x7f9c('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bd62b);throw _0x2bd62b;});}return _0x3298dc;})['then'](respondWithResult(_0x7a2a1d,0xc9))[_0x7f9c('0x3d')](handleError(_0x7a2a1d,null));};exports[_0x7f9c('0x47')]=function(_0x20d468,_0x392922){if(_0x20d468['body']['id']){delete _0x20d468[_0x7f9c('0x3e')]['id'];}return db['VoiceExtension'][_0x7f9c('0x1d')]({'where':{'id':_0x20d468['params']['id']}})[_0x7f9c('0x11')](handleEntityNotFound(_0x392922,null))[_0x7f9c('0x11')](function(_0x1a741d){if(_0x1a741d){return db[_0x7f9c('0x24')][_0x7f9c('0x47')](_[_0x7f9c('0x34')](_0x20d468['body'],['exten',_0x7f9c('0x48'),_0x7f9c('0x49'),_0x7f9c('0x4a'),_0x7f9c('0x4b'),'mandatoryDisposition',_0x7f9c('0x4c')]),{'where':{'context':_0x1a741d['context'],'exten':_0x1a741d[_0x7f9c('0x40')]},'individualHooks':!![]})[_0x7f9c('0x11')](function(_0x5e89f8){return _0x5e89f8;});}return null;})[_0x7f9c('0x11')](respondWithStatusCode(_0x392922,null))[_0x7f9c('0x3d')](handleError(_0x392922,null));};exports[_0x7f9c('0x4d')]=function(_0x33af7e,_0xe74932){var _0x10579d=_0x33af7e[_0x7f9c('0x3b')]['id'];var _0x167338=_0x33af7e[_0x7f9c('0x3e')];var _0x41c076=0xc8;var _0x2f93b0=null;return db[_0x7f9c('0x4e')][_0x7f9c('0x4f')]({'isolationLevel':db[_0x7f9c('0x4e')][_0x7f9c('0x50')][_0x7f9c('0x51')][_0x7f9c('0x52')]},function(_0x20817b){return db[_0x7f9c('0x24')][_0x7f9c('0x53')]({'where':{'id':_0x10579d},'transaction':_0x20817b})[_0x7f9c('0x11')](function(_0x4142af){if(_0x4142af){return db[_0x7f9c('0x24')][_0x7f9c('0x10')]({'where':{'VoiceExtensionId':_0x10579d},'transaction':_0x20817b})[_0x7f9c('0x11')](function(){var _0x37e5e5=_[_0x7f9c('0x1a')](_0x167338,function(_0x352e68){_0x352e68[_0x7f9c('0x54')]=_0x10579d;_0x352e68[_0x7f9c('0x55')]=!![];return _0x352e68;});return _0x4142af[_0x7f9c('0x56')](_0x37e5e5);})[_0x7f9c('0x11')](function(_0x4aea5e){return db[_0x7f9c('0x24')][_0x7f9c('0x57')](_0x4aea5e,{'transaction':_0x20817b});});}else{_0x41c076=0x194;_0x2f93b0=[];}});})[_0x7f9c('0x11')](function(){if(_0x41c076!==0x194){return db[_0x7f9c('0x24')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x10579d},'order':_0x7f9c('0x58')})[_0x7f9c('0x11')](function(_0x32ffd7){_0x2f93b0=_0x32ffd7;});}})[_0x7f9c('0x3d')](function(_0x52d3f9){_0x41c076=0x1f4;logger[_0x7f9c('0x1f')](_0x52d3f9[_0x7f9c('0x20')]);if(_0x52d3f9[_0x7f9c('0x21')]){delete _0x52d3f9[_0x7f9c('0x21')];}_0x2f93b0=_0x52d3f9;})[_0x7f9c('0x59')](function(){if(_0x2f93b0===null){_0xe74932[_0x7f9c('0x8')](_0x41c076);}else{if(_0x41c076===0x1f4){_0xe74932['status'](_0x41c076)['send'](_0x2f93b0);}else{_0xe74932[_0x7f9c('0x9')](_0x41c076)[_0x7f9c('0xb')](_0x2f93b0);}}});}; \ No newline at end of file +var _0x428d=['includes','type','find','UserProfileResource','destroy','stack','name','send','index','VoiceExtension','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','rows','catch','params','rawAttributes','includeAll','options','exten','body','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','map','value'];(function(_0x1ab219,_0x122a3b){var _0x59326a=function(_0x2ae6de){while(--_0x2ae6de){_0x1ab219['push'](_0x1ab219['shift']());}};_0x59326a(++_0x122a3b);}(_0x428d,0x1b3));var _0xd428=function(_0x17aadc,_0x5d4f89){_0x17aadc=_0x17aadc-0x0;var _0x2ff72d=_0x428d[_0x17aadc];return _0x2ff72d;};'use strict';var _=require(_0xd428('0x0'));var Redis=require(_0xd428('0x1'));var qs=require(_0xd428('0x2'));var logger=require(_0xd428('0x3'))(_0xd428('0x4'));var config=require(_0xd428('0x5'));var db=require('../../mysqldb')['db'];config[_0xd428('0x6')]=_[_0xd428('0x7')](config[_0xd428('0x6')],{'host':_0xd428('0x8'),'port':0x18eb});var socket=require(_0xd428('0x9'))(new Redis(config[_0xd428('0x6')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x994bcd,_0x1f5a2f){_0x1f5a2f=_0x1f5a2f||0xcc;return function(_0x5c0a3){if(_0x5c0a3){return _0x994bcd[_0xd428('0xa')](_0x1f5a2f);}return _0x994bcd[_0xd428('0xb')](_0x1f5a2f)[_0xd428('0xc')]();};}function respondWithResult(_0x57422a,_0x243a75){_0x243a75=_0x243a75||0xc8;return function(_0xad94e4){if(_0xad94e4){return _0x57422a['status'](_0x243a75)['json'](_0xad94e4);}};}function respondWithFilteredResult(_0x4b755a,_0x51a539){return function(_0x20f403){if(_0x20f403){var _0x4b3469=typeof _0x51a539['offset']===_0xd428('0xd')&&typeof _0x51a539['limit']===_0xd428('0xd');var _0x334a81=_0x20f403[_0xd428('0xe')];var _0x35c2b5=_0x4b3469?0x0:_0x51a539[_0xd428('0xf')];var _0x2e7570=_0x4b3469?_0x20f403[_0xd428('0xe')]:_0x51a539[_0xd428('0xf')]+_0x51a539[_0xd428('0x10')];var _0x4d53a7;if(_0x2e7570>=_0x334a81){_0x2e7570=_0x334a81;_0x4d53a7=0xc8;}else{_0x4d53a7=0xce;}_0x4b755a[_0xd428('0xb')](_0x4d53a7);return _0x4b755a[_0xd428('0x11')](_0xd428('0x12'),_0x35c2b5+'-'+_0x2e7570+'/'+_0x334a81)[_0xd428('0x13')](_0x20f403);}return null;};}function removeEntity(_0x5060bd){return function(_0x3058ca){if(_0x3058ca){return _0x3058ca['destroy']()[_0xd428('0x14')](function(){var _0x56a482=_0x3058ca[_0xd428('0x15')]({'plain':!![]});var _0x166e1d=[{'name':_0xd428('0x16'),'value':_0xd428('0x17'),'ignore':![]},{'name':_0xd428('0x18'),'value':_0xd428('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0xd428('0x1a'),'ignore':![]}];var _0x46efb4=_(_0x166e1d)[_0xd428('0x1b')]('ignore')[_0xd428('0x1c')](_0xd428('0x1d'))['value']();if(_[_0xd428('0x1e')](_0x46efb4,_0x56a482[_0xd428('0x1f')])){return;}var _0x5ae488=_[_0xd428('0x20')](_0x166e1d,[_0xd428('0x1d'),_0x56a482[_0xd428('0x1f')]])['name'];return db[_0xd428('0x21')][_0xd428('0x22')]({'where':{'type':_0x5ae488,'resourceId':_0x56a482['id']}})[_0xd428('0x14')](function(){return _0x3058ca;});})[_0xd428('0x14')](function(){_0x5060bd[_0xd428('0xb')](0xcc)[_0xd428('0xc')]();});}};}function handleEntityNotFound(_0x41298f){return function(_0x1a359a){if(!_0x1a359a){_0x41298f[_0xd428('0xa')](0x194);}return _0x1a359a;};}function handleError(_0x1563d0,_0x3fb681){_0x3fb681=_0x3fb681||0x1f4;return function(_0x4b1537){logger['error'](_0x4b1537[_0xd428('0x23')]);if(_0x4b1537[_0xd428('0x24')]){delete _0x4b1537[_0xd428('0x24')];}_0x1563d0[_0xd428('0xb')](_0x3fb681)[_0xd428('0x25')](_0x4b1537);};}exports[_0xd428('0x26')]=function(_0x16d20e,_0x26b261){var _0x457f65={},_0x57aa8a={},_0x3a92b6={'count':0x0,'rows':[]};var _0x41a190=_[_0xd428('0x1c')](db[_0xd428('0x27')]['rawAttributes'],function(_0x5d75b8){return{'name':_0x5d75b8[_0xd428('0x28')],'type':_0x5d75b8[_0xd428('0x1f')]['key']};});_0x57aa8a['model']=_[_0xd428('0x1c')](_0x41a190,_0xd428('0x24'));_0x57aa8a[_0xd428('0x29')]=_[_0xd428('0x2a')](_0x16d20e[_0xd428('0x29')]);_0x57aa8a[_0xd428('0x2b')]=_['intersection'](_0x57aa8a[_0xd428('0x2c')],_0x57aa8a[_0xd428('0x29')]);_0x457f65[_0xd428('0x2d')]=_[_0xd428('0x2e')](_0x57aa8a[_0xd428('0x2c')],qs[_0xd428('0x2f')](_0x16d20e[_0xd428('0x29')][_0xd428('0x2f')]));_0x457f65[_0xd428('0x2d')]=_0x457f65[_0xd428('0x2d')][_0xd428('0x30')]?_0x457f65[_0xd428('0x2d')]:_0x57aa8a['model'];if(!_0x16d20e[_0xd428('0x29')][_0xd428('0x31')](_0xd428('0x32'))){_0x457f65[_0xd428('0x10')]=qs[_0xd428('0x10')](_0x16d20e['query'][_0xd428('0x10')]);_0x457f65[_0xd428('0xf')]=qs['offset'](_0x16d20e['query'][_0xd428('0xf')]);}_0x457f65[_0xd428('0x33')]=qs[_0xd428('0x34')](_0x16d20e[_0xd428('0x29')][_0xd428('0x34')]);_0x457f65[_0xd428('0x35')]=qs['filters'](_[_0xd428('0x36')](_0x16d20e[_0xd428('0x29')],_0x57aa8a['filters']),_0x41a190);if(_0x16d20e[_0xd428('0x29')][_0xd428('0x1b')]){_0x457f65[_0xd428('0x35')]=_[_0xd428('0x37')](_0x457f65[_0xd428('0x35')],{'$or':_[_0xd428('0x1c')](_0x41a190,function(_0x1d0602){if(_0x1d0602[_0xd428('0x1f')]!=='VIRTUAL'){var _0x1d98bc={};_0x1d98bc[_0x1d0602[_0xd428('0x24')]]={'$like':'%'+_0x16d20e[_0xd428('0x29')][_0xd428('0x1b')]+'%'};return _0x1d98bc;}})});}_0x457f65=_[_0xd428('0x37')]({},_0x457f65,_0x16d20e['options']);var _0x1fbd35={'where':_0x457f65[_0xd428('0x35')]};return db[_0xd428('0x27')]['count'](_0x1fbd35)[_0xd428('0x14')](function(_0x23223a){_0x3a92b6[_0xd428('0xe')]=_0x23223a;if(_0x16d20e[_0xd428('0x29')]['includeAll']){_0x457f65[_0xd428('0x38')]=[{'all':!![]}];}return db[_0xd428('0x27')]['findAll'](_0x457f65);})[_0xd428('0x14')](function(_0x39a94d){_0x3a92b6[_0xd428('0x39')]=_0x39a94d;return _0x3a92b6;})[_0xd428('0x14')](respondWithFilteredResult(_0x26b261,_0x457f65))[_0xd428('0x3a')](handleError(_0x26b261,null));};exports['show']=function(_0x4f80bb,_0xb79858){var _0x4ab3f8={'raw':![],'where':{'id':_0x4f80bb[_0xd428('0x3b')]['id']}},_0x58d6d7={};_0x58d6d7[_0xd428('0x2c')]=_[_0xd428('0x2a')](db[_0xd428('0x27')][_0xd428('0x3c')]);_0x58d6d7[_0xd428('0x29')]=_[_0xd428('0x2a')](_0x4f80bb[_0xd428('0x29')]);_0x58d6d7[_0xd428('0x2b')]=_['intersection'](_0x58d6d7[_0xd428('0x2c')],_0x58d6d7['query']);_0x4ab3f8[_0xd428('0x2d')]=_[_0xd428('0x2e')](_0x58d6d7[_0xd428('0x2c')],qs[_0xd428('0x2f')](_0x4f80bb[_0xd428('0x29')][_0xd428('0x2f')]));_0x4ab3f8['attributes']=_0x4ab3f8[_0xd428('0x2d')][_0xd428('0x30')]?_0x4ab3f8[_0xd428('0x2d')]:_0x58d6d7[_0xd428('0x2c')];if(_0x4f80bb['query'][_0xd428('0x3d')]){_0x4ab3f8['include']=[{'all':!![]}];}_0x4ab3f8=_[_0xd428('0x37')]({},_0x4ab3f8,_0x4f80bb[_0xd428('0x3e')]);return db[_0xd428('0x27')][_0xd428('0x20')](_0x4ab3f8)[_0xd428('0x14')](handleEntityNotFound(_0xb79858,null))[_0xd428('0x14')](respondWithResult(_0xb79858,null))[_0xd428('0x3a')](handleError(_0xb79858,null));};exports['destroy']=function(_0x17f1f9,_0xb44ec3){return db[_0xd428('0x27')][_0xd428('0x20')]({'where':{'id':_0x17f1f9[_0xd428('0x3b')]['id']}})[_0xd428('0x14')](handleEntityNotFound(_0xb44ec3,null))[_0xd428('0x14')](removeEntity(_0xb44ec3,null))[_0xd428('0x3a')](handleError(_0xb44ec3,null));};exports['create']=function(_0x21b769,_0x58999e){if(_0x21b769['body'][_0xd428('0x1f')]==='outbound'&&!_['startsWith'](_0x21b769['body'][_0xd428('0x3f')],'_')){_0x21b769[_0xd428('0x40')]['exten']='_'[_0xd428('0x41')](_0x21b769[_0xd428('0x40')][_0xd428('0x3f')]);}return db[_0xd428('0x27')][_0xd428('0x42')](_0x21b769[_0xd428('0x40')],{'raw':![]})[_0xd428('0x14')](function(_0x326803){var _0x28d5dd=_0x21b769[_0xd428('0x43')]['get']({'plain':!![]});if(!_0x28d5dd)throw new Error(_0xd428('0x44'));if(_0x28d5dd[_0xd428('0x45')]==='user'){var _0x567bf4=_0x326803[_0xd428('0x15')]({'plain':!![]});var _0x1b30c3=[{'name':_0xd428('0x16'),'value':_0xd428('0x17')},{'name':_0xd428('0x18'),'value':_0xd428('0x19')},{'name':_0xd428('0x46'),'value':_0xd428('0x1a')}];var _0x41d746=_[_0xd428('0x20')](_0x1b30c3,[_0xd428('0x1d'),_0x567bf4['type']])[_0xd428('0x24')];return db[_0xd428('0x47')][_0xd428('0x20')]({'where':{'name':_0x41d746,'userProfileId':_0x28d5dd['userProfileId']},'raw':!![]})['then'](function(_0x34b91f){if(_0x34b91f&&_0x34b91f[_0xd428('0x48')]===0x0){return db[_0xd428('0x21')][_0xd428('0x42')]({'name':_0x567bf4[_0xd428('0x24')],'resourceId':_0x567bf4['id'],'type':_0x34b91f[_0xd428('0x24')],'sectionId':_0x34b91f['id']},{})[_0xd428('0x14')](function(){return _0x326803;});}else{return _0x326803;}})['catch'](function(_0x1f87c2){logger['error'](_0xd428('0x49'),_0x1f87c2);throw _0x1f87c2;});}return _0x326803;})[_0xd428('0x14')](respondWithResult(_0x58999e,0xc9))[_0xd428('0x3a')](handleError(_0x58999e,null));};exports[_0xd428('0x4a')]=function(_0x5bfeee,_0x731562){if(_0x5bfeee[_0xd428('0x40')]['id']){delete _0x5bfeee[_0xd428('0x40')]['id'];}return db['VoiceExtension'][_0xd428('0x20')]({'where':{'id':_0x5bfeee[_0xd428('0x3b')]['id']}})[_0xd428('0x14')](handleEntityNotFound(_0x731562,null))['then'](function(_0x6f0ac4){if(_0x6f0ac4){return db[_0xd428('0x27')]['update'](_['pick'](_0x5bfeee['body'],[_0xd428('0x3f'),_0xd428('0x4b'),_0xd428('0x4c'),_0xd428('0x4d'),_0xd428('0x4e'),'mandatoryDisposition',_0xd428('0x4f')]),{'where':{'context':_0x6f0ac4[_0xd428('0x4b')],'exten':_0x6f0ac4[_0xd428('0x3f')]},'individualHooks':!![]})[_0xd428('0x14')](function(_0x46ecca){return _0x46ecca;});}return null;})['then'](respondWithStatusCode(_0x731562,null))[_0xd428('0x3a')](handleError(_0x731562,null));};exports[_0xd428('0x50')]=function(_0x28df6a,_0x482098){var _0x58b72f=_0x28df6a[_0xd428('0x3b')]['id'];var _0x386de5=_0x28df6a[_0xd428('0x40')];var _0x5d2109=0xc8;var _0x5f50a7=null;return db[_0xd428('0x51')][_0xd428('0x52')]({'isolationLevel':db[_0xd428('0x51')][_0xd428('0x53')][_0xd428('0x54')][_0xd428('0x55')]},function(_0x1ff5da){return db[_0xd428('0x27')][_0xd428('0x56')]({'where':{'id':_0x58b72f},'transaction':_0x1ff5da})[_0xd428('0x14')](function(_0x1db3d8){if(_0x1db3d8){return db[_0xd428('0x27')][_0xd428('0x22')]({'where':{'VoiceExtensionId':_0x58b72f},'transaction':_0x1ff5da})[_0xd428('0x14')](function(){var _0x384deb=_[_0xd428('0x1c')](_0x386de5,function(_0x4eb2cc){_0x4eb2cc[_0xd428('0x57')]=_0x58b72f;_0x4eb2cc['isApp']=!![];return _0x4eb2cc;});return _0x1db3d8[_0xd428('0x58')](_0x384deb);})[_0xd428('0x14')](function(_0x2009ae){return db[_0xd428('0x27')][_0xd428('0x59')](_0x2009ae,{'transaction':_0x1ff5da});});}else{_0x5d2109=0x194;_0x5f50a7=[];}});})[_0xd428('0x14')](function(){if(_0x5d2109!==0x194){return db['VoiceExtension'][_0xd428('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x58b72f},'order':_0xd428('0x5b')})[_0xd428('0x14')](function(_0x3d72fc){_0x5f50a7=_0x3d72fc;});}})['catch'](function(_0x1e37dc){_0x5d2109=0x1f4;logger['error'](_0x1e37dc[_0xd428('0x23')]);if(_0x1e37dc[_0xd428('0x24')]){delete _0x1e37dc['name'];}_0x5f50a7=_0x1e37dc;})[_0xd428('0x5c')](function(){if(_0x5f50a7===null){_0x482098['sendStatus'](_0x5d2109);}else{if(_0x5d2109===0x1f4){_0x482098['status'](_0x5d2109)[_0xd428('0x25')](_0x5f50a7);}else{_0x482098['status'](_0x5d2109)[_0xd428('0x13')](_0x5f50a7);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b77c685..5b75861 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 _0x1e87=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5c62a3,_0x1b4f8d){var _0x1723cf=function(_0x4d110f){while(--_0x4d110f){_0x5c62a3['push'](_0x5c62a3['shift']());}};_0x1723cf(++_0x1b4f8d);}(_0x1e87,0x1b6));var _0x71e8=function(_0x327b49,_0xc232b8){_0x327b49=_0x327b49-0x0;var _0x4e7265=_0x1e87[_0x327b49];return _0x4e7265;};'use strict';var EventEmitter=require(_0x71e8('0x0'));var VoiceExtension=require(_0x71e8('0x1'))['db'][_0x71e8('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x71e8('0x3')](0x0);var events={'afterCreate':_0x71e8('0x4'),'afterUpdate':_0x71e8('0x5'),'afterDestroy':_0x71e8('0x6')};function emitEvent(_0x30eb30){return function(_0xbec88,_0x4d0c4d,_0x5776f6){VoiceExtensionEvents[_0x71e8('0x7')](_0x30eb30+':'+_0xbec88['id'],_0xbec88);VoiceExtensionEvents[_0x71e8('0x7')](_0x30eb30,_0xbec88);_0x5776f6(null);};}for(var e in events){if(events[_0x71e8('0x8')](e)){var event=events[e];VoiceExtension[_0x71e8('0x9')](e,emitEvent(event));}}module[_0x71e8('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x9b2e=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b2e,0x102));var _0xe9b2=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9b2e[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0xe9b2('0x0'));var VoiceExtension=require(_0xe9b2('0x1'))['db'][_0xe9b2('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe9b2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9b2('0x4'),'afterDestroy':_0xe9b2('0x5')};function emitEvent(_0x2f22c0){return function(_0x497d10,_0x344a12,_0x1191fc){VoiceExtensionEvents['emit'](_0x2f22c0+':'+_0x497d10['id'],_0x497d10);VoiceExtensionEvents[_0xe9b2('0x6')](_0x2f22c0,_0x497d10);_0x1191fc(null);};}for(var e in events){if(events[_0xe9b2('0x7')](e)){var event=events[e];VoiceExtension[_0xe9b2('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 33756dc..990c5bc 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 _0xcc0b=['interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','CDR(tag)=','toLowerCase','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','outboundDial','appdata','priority','concat','catch','VoiceExtension','voice_extensions','get','last','Hangup','lodash','./voiceExtension.attributes','models','type','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN}','SIP','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcc0b,0xc0));var _0xbcc0=function(_0x1ca59f,_0x1a5cd7){_0x1ca59f=_0x1ca59f-0x0;var _0x2f3153=_0xcc0b[_0x1ca59f];return _0x2f3153;};'use strict';var _=require(_0xbcc0('0x0'));var attributes=require(_0xbcc0('0x1'));module['exports']=function(_0x411ebf){var _0x349222=_0x411ebf[_0xbcc0('0x2')];function _0x1d8c5c(_0x3287dc){var _0x5259e3=0x2;var _0x30bf9d=[{'type':_0x3287dc[_0xbcc0('0x3')],'app':'Set','appdata':_0xbcc0('0x4')+_0x3287dc[_0xbcc0('0x3')],'context':_0x3287dc[_0xbcc0('0x5')],'exten':_0x3287dc[_0xbcc0('0x6')],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']},{'type':_0x3287dc[_0xbcc0('0x3')],'app':_0x3287dc[_0xbcc0('0x7')]?'Set':_0xbcc0('0x8'),'appdata':_0x3287dc[_0xbcc0('0x7')]?_0xbcc0('0x9')+_0x3287dc[_0xbcc0('0x7')]:_0xbcc0('0xa'),'context':_0x3287dc[_0xbcc0('0x5')],'exten':_0x3287dc[_0xbcc0('0x6')],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']}];if(_0x3287dc[_0xbcc0('0x3')]===_0xbcc0('0xb')){_0x30bf9d[_0xbcc0('0xc')]({'type':_0xbcc0('0xb'),'app':_0xbcc0('0xd'),'appdata':'CDR(routeid)='+_0x3287dc['id'],'context':_0x3287dc[_0xbcc0('0x5')],'exten':_0x3287dc['exten'],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']});}_0x30bf9d['push']({'type':_0x3287dc[_0xbcc0('0x3')],'app':_0xbcc0('0xd'),'appdata':_0xbcc0('0xe'),'context':_0x3287dc[_0xbcc0('0x5')],'exten':_0x3287dc[_0xbcc0('0x6')],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']},{'type':_0x3287dc[_0xbcc0('0x3')],'app':'Set','appdata':_0xbcc0('0xf'),'context':_0x3287dc['context'],'exten':_0x3287dc[_0xbcc0('0x6')],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']},{'type':_0x3287dc['type'],'app':'Set','appdata':_0xbcc0('0x10'),'context':_0x3287dc[_0xbcc0('0x5')],'exten':_0x3287dc[_0xbcc0('0x6')],'priority':_0x5259e3++,'VoiceExtensionId':_0x3287dc['id']});return _0x30bf9d;}function _0x4c2401(_0x428975){var _0x4ee2ca=0x2;var _0xaaff5d=[{'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':_0xbcc0('0x12'),'context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':_0x428975[_0xbcc0('0x7')]?_0xbcc0('0xd'):_0xbcc0('0x8'),'appdata':_0x428975[_0xbcc0('0x7')]?_0xbcc0('0x9')+_0x428975[_0xbcc0('0x7')]:_0xbcc0('0xa'),'context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':'CDR(destination)='+(_0x428975[_0xbcc0('0x13')]?_0xbcc0('0x14')+_0x428975[_0xbcc0('0x13')]+'}':'${EXTEN}'),'context':_0x428975['context'],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':'Set','appdata':_0xbcc0('0x15')+_0x428975['id'],'context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':'outbound','app':_0xbcc0('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4ee2ca+0x2)+_0xbcc0('0x17')+(_0x4ee2ca+0x1)+')','context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':_0x428975[_0xbcc0('0x13')]?_0xbcc0('0x18')+_0x428975[_0xbcc0('0x13')]+'}':_0xbcc0('0x19'),'context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975['exten'],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':_0xbcc0('0xf'),'context':_0x428975['context'],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':'Set','appdata':_0xbcc0('0x10'),'context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':'outbound','app':_0xbcc0('0xd'),'appdata':'outboundrouteid='+_0x428975['id'],'context':_0x428975['context'],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']}];if(_0x428975[_0xbcc0('0x1a')](_0xbcc0('0x1b'))&&_0x428975[_0xbcc0('0x1b')]!==_0xbcc0('0x1c')){_0xaaff5d[_0xbcc0('0xc')]({'type':_0xbcc0('0x11'),'app':_0xbcc0('0xd'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x428975['context'],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']},{'type':_0xbcc0('0x11'),'app':'Set','appdata':_0xbcc0('0x1d')+_0x428975[_0xbcc0('0x1b')]||'wav','context':_0x428975[_0xbcc0('0x5')],'exten':_0x428975[_0xbcc0('0x6')],'priority':_0x4ee2ca++,'VoiceExtensionId':_0x428975['id']});}return _0xaaff5d;}function _0x7b4e9d(_0x3b74a3,_0x7f7bbb){var _0x3bf05a=[{'name':_0xbcc0('0x1e'),'param':0x0},{'name':_0xbcc0('0x1f'),'param':0x1},{'name':_0xbcc0('0x20'),'param':0x2},{'name':_0xbcc0('0x21'),'param':0x3}];var _0x143079={};var _0x5bb3fd=_0x7f7bbb[_0xbcc0('0x22')](',');var _0x14a206=[];for(var _0x5f255b=0x0;_0x5f255b<_0x3bf05a[_0xbcc0('0x23')];_0x5f255b++){switch(_0x3bf05a[_0x5f255b][_0xbcc0('0x24')]){case _0xbcc0('0x1e'):_0x143079[_0xbcc0('0x1e')]=_0x5bb3fd[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]][_0xbcc0('0x22')]('/')[0x1];_0x143079[_0xbcc0('0x26')]=_0x5bb3fd[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]][_0xbcc0('0x22')]('/')[0x2];_0x143079[_0xbcc0('0x27')]=_0x143079[_0xbcc0('0x26')]?_0x143079[_0xbcc0('0x26')][_0xbcc0('0x22')]('$')[0x0]:undefined;_0x143079[_0xbcc0('0x26')]=_0x3b74a3[_0xbcc0('0x13')]?(_0x143079['prefix']||'')+'${EXTEN:'+_0x3b74a3['cutdigits']+'}':(_0x143079['prefix']||'')+_0xbcc0('0x28');_0x14a206[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]]=[_0xbcc0('0x29'),_0x143079['trunk'],_0x143079[_0xbcc0('0x26')]]['join']('/');break;case _0xbcc0('0x20'):_0x143079[_0xbcc0('0x20')]=_0x5bb3fd[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]];if(_0x3b74a3[_0xbcc0('0x1b')]!=='none'){if(_0x143079[_0xbcc0('0x20')][_0xbcc0('0x2a')](_0xbcc0('0x2b'))<0x0){_0x143079['options']+=_0xbcc0('0x2b');}}else{_0x143079['options']=_0x143079['options'][_0xbcc0('0x2c')]('U(xcally-mixmonitor-context)','');}_0x14a206[_0x3bf05a[_0x5f255b]['param']]=_0x143079[_0xbcc0('0x20')];break;default:_0x14a206[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]]=_0x5bb3fd[_0x3bf05a[_0x5f255b][_0xbcc0('0x25')]];}}return _0x14a206['join'](',');}function _0xb5a718(_0x11ab3c,_0x2cb705,_0x1d4923){return new Promise(function(_0x1bd3ff,_0x137947){var _0x1ad122=[];if(_[_0xbcc0('0x2d')](_0x2cb705))return _0x1bd3ff(_0x1ad122);_0x349222[_0xbcc0('0x2e')][_0xbcc0('0x2f')]({'attributes':['id',_0xbcc0('0x30'),_0xbcc0('0x31')],'raw':!![]})[_0xbcc0('0x32')](function(_0x252381){for(var _0x52974f=0x0,_0x2fd925=0x0;_0x52974f<_0x2cb705[_0xbcc0('0x23')];_0x52974f++,_0x2fd925=0x0){var _0x4d7b8d=_0x2cb705[_0x52974f];var _0x461386=[];var _0x15cd16=[];delete _0x4d7b8d['id'];if(_0x4d7b8d['interval']!==_0xbcc0('0x33')){_0x4d7b8d[_0xbcc0('0x34')]=[_0x4d7b8d['interval']];}else{_0x4d7b8d[_0xbcc0('0x34')]=_0x4d7b8d[_0xbcc0('0x31')]?_[_0xbcc0('0x35')](_[_0xbcc0('0x36')](_0x252381,{'IntervalId':_0x4d7b8d[_0xbcc0('0x31')]}),_0xbcc0('0x30')):[];}_0x4d7b8d[_0xbcc0('0x5')]=_0x11ab3c[_0xbcc0('0x5')];_0x4d7b8d['exten']=_0x11ab3c[_0xbcc0('0x6')];if(_0x4d7b8d[_0xbcc0('0x3')])_0x4d7b8d[_0xbcc0('0x3')]=_0x4d7b8d[_0xbcc0('0x3')]['toLowerCase']();if(_0x11ab3c['type']===_0xbcc0('0x11')){if(_0x4d7b8d[_0xbcc0('0x1a')](_0xbcc0('0x37'))&&_0x4d7b8d['tag']&&_0x4d7b8d['tag']!=='--'){_0x461386['push']({'type':_0x4d7b8d['type']['toLowerCase'](),'app':_0xbcc0('0xd'),'appdata':_0xbcc0('0x38')+_0x4d7b8d['tag'],'context':_0x11ab3c[_0xbcc0('0x5')],'exten':_0x11ab3c['exten'],'priority':_0x4d7b8d['intervals']['length']+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});}_0x461386['push']({'type':_0x4d7b8d['type'][_0xbcc0('0x39')](),'app':_0xbcc0('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x4d7b8d[_0xbcc0('0x3a')]?_0xbcc0('0x3b')+_0x4d7b8d[_0xbcc0('0x3a')]+')':_0xbcc0('0x3c')),'context':_0x11ab3c[_0xbcc0('0x5')],'exten':_0x11ab3c[_0xbcc0('0x6')],'priority':_0x4d7b8d[_0xbcc0('0x34')][_0xbcc0('0x23')]+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});}else{if(_0x4d7b8d[_0xbcc0('0x1a')](_0xbcc0('0x3d'))){if(['queue',_0xbcc0('0x3e')][_0xbcc0('0x3f')](_0x4d7b8d[_0xbcc0('0x40')]['toLowerCase']())&&_0x4d7b8d[_0xbcc0('0x41')]!=='custom'){if(_0x4d7b8d[_0xbcc0('0x3d')]){_0x461386['push']({'type':_0x4d7b8d[_0xbcc0('0x3')][_0xbcc0('0x39')](),'app':_0xbcc0('0x16'),'appdata':_0xbcc0('0x42'),'context':_0x11ab3c[_0xbcc0('0x5')],'exten':_0x11ab3c['exten'],'priority':_0x4d7b8d[_0xbcc0('0x34')][_0xbcc0('0x23')]+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});_0x461386[_0xbcc0('0xc')]({'type':_0x4d7b8d[_0xbcc0('0x3')][_0xbcc0('0x39')](),'app':'Set','appdata':_0xbcc0('0x43'),'context':_0x11ab3c[_0xbcc0('0x5')],'exten':_0x11ab3c[_0xbcc0('0x6')],'priority':_0x4d7b8d[_0xbcc0('0x34')][_0xbcc0('0x23')]+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});}else{_0x461386['push']({'type':_0x4d7b8d[_0xbcc0('0x3')][_0xbcc0('0x39')](),'app':'ExecIf','appdata':_0xbcc0('0x44'),'context':_0x11ab3c[_0xbcc0('0x5')],'exten':_0x11ab3c[_0xbcc0('0x6')],'priority':_0x4d7b8d['intervals']['length']+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});_0x461386['push']({'type':_0x4d7b8d[_0xbcc0('0x3')][_0xbcc0('0x39')](),'app':'Set','appdata':_0xbcc0('0x45'),'context':_0x11ab3c['context'],'exten':_0x11ab3c[_0xbcc0('0x6')],'priority':_0x4d7b8d[_0xbcc0('0x34')][_0xbcc0('0x23')]+_0x1d4923+_0x2fd925++,'VoiceExtensionId':_0x11ab3c['id']});}}}}for(var _0x12386e=0x0;_0x12386e<_0x4d7b8d[_0xbcc0('0x34')][_0xbcc0('0x23')];_0x12386e++){var _0x62f534=_0x1d4923+_0x4d7b8d[_0xbcc0('0x34')]['length'];var _0x114e09=_0x12386e===_0x4d7b8d[_0xbcc0('0x34')]['length']-0x1?_0x1d4923+_0x461386[_0xbcc0('0x23')]+_0x15cd16['length']+0x2:_0x1d4923+_0x12386e+0x1;_0x461386['splice'](_0x12386e,0x0,{'type':_0x11ab3c[_0xbcc0('0x3')],'app':'GotoIfTime','appdata':_0x4d7b8d[_0xbcc0('0x34')][_0x12386e]+'?'+_0x11ab3c[_0xbcc0('0x5')]+',${EXTEN},'+_0x62f534+':'+_0x11ab3c[_0xbcc0('0x5')]+',${EXTEN},'+_0x114e09,'exten':_0x11ab3c['exten'],'context':_0x11ab3c['context'],'priority':_0x1d4923+_0x12386e,'VoiceExtensionId':_0x11ab3c['id']});}if(_0x4d7b8d[_0xbcc0('0x41')]===_0xbcc0('0x46'))_0x4d7b8d['appdata']=_0x7b4e9d(_0x11ab3c,_0x4d7b8d[_0xbcc0('0x47')]);_0x4d7b8d['priority']=_0x461386[_0xbcc0('0x23')]?_['last'](_0x461386)[_0xbcc0('0x48')]+0x1:_0x1d4923;_0x1ad122=_[_0xbcc0('0x49')](_0x1ad122,_0x461386,[_0x4d7b8d],_0x15cd16);_0x1d4923=_['last'](_0x1ad122)[_0xbcc0('0x48')]+0x1;}return _0x1bd3ff(_0x1ad122);})[_0xbcc0('0x4a')](function(_0x4d579d){_0x137947(_0x4d579d);});});}return _0x411ebf['define'](_0xbcc0('0x4b'),attributes,{'tableName':_0xbcc0('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x365b05){var _0x2f586a=this[_0xbcc0('0x4d')]({'plain':!![]});var _0x47db63=_0x2f586a['type']==='outbound'?_0x4c2401(_0x2f586a):_0x1d8c5c(_0x2f586a);return _0xb5a718(_0x2f586a,_0x365b05,_[_0xbcc0('0x4e')](_0x47db63)[_0xbcc0('0x48')]+0x1)['then'](function(_0x5f27ec){var _0xc817a1=_[_0xbcc0('0x49')](_0x47db63,_0x5f27ec);_0xc817a1[_0xbcc0('0xc')]({'type':_0x2f586a[_0xbcc0('0x3')],'app':_0xbcc0('0x4f'),'exten':_0x2f586a[_0xbcc0('0x6')],'context':_0x2f586a['context'],'priority':_[_0xbcc0('0x4e')](_0xc817a1)[_0xbcc0('0x48')]+0x1,'VoiceExtensionId':_0x2f586a['id']});return _0xc817a1;});}}});}; \ No newline at end of file +var _0x6011=['appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','get','Hangup','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','param','phone','prefix','SIP','join','indexOf','replace','isEmpty','findAll','interval','then','length','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app'];(function(_0x15c8ef,_0x431c76){var _0x2a8654=function(_0x3aebfd){while(--_0x3aebfd){_0x15c8ef['push'](_0x15c8ef['shift']());}};_0x2a8654(++_0x431c76);}(_0x6011,0x196));var _0x1601=function(_0x10a1a8,_0x2e9f50){_0x10a1a8=_0x10a1a8-0x0;var _0x2f2cdd=_0x6011[_0x10a1a8];return _0x2f2cdd;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x55f0f0){var _0x59212c=_0x55f0f0[_0x1601('0x0')];function _0x40c20f(_0x56c468){var _0x23ed9e=0x2;var _0x2ede55=[{'type':_0x56c468[_0x1601('0x1')],'app':_0x1601('0x2'),'appdata':_0x1601('0x3')+_0x56c468[_0x1601('0x1')],'context':_0x56c468[_0x1601('0x4')],'exten':_0x56c468[_0x1601('0x5')],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']},{'type':_0x56c468[_0x1601('0x1')],'app':_0x56c468[_0x1601('0x6')]?'Set':_0x1601('0x7'),'appdata':_0x56c468[_0x1601('0x6')]?_0x1601('0x8')+_0x56c468[_0x1601('0x6')]:_0x1601('0x9'),'context':_0x56c468['context'],'exten':_0x56c468['exten'],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']}];if(_0x56c468['type']===_0x1601('0xa')){_0x2ede55['push']({'type':_0x1601('0xa'),'app':_0x1601('0x2'),'appdata':_0x1601('0xb')+_0x56c468['id'],'context':_0x56c468[_0x1601('0x4')],'exten':_0x56c468[_0x1601('0x5')],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']});}_0x2ede55[_0x1601('0xc')]({'type':_0x56c468[_0x1601('0x1')],'app':_0x1601('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x56c468[_0x1601('0x4')],'exten':_0x56c468['exten'],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']},{'type':_0x56c468[_0x1601('0x1')],'app':'Set','appdata':_0x1601('0xd'),'context':_0x56c468[_0x1601('0x4')],'exten':_0x56c468['exten'],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']},{'type':_0x56c468[_0x1601('0x1')],'app':_0x1601('0x2'),'appdata':_0x1601('0xe'),'context':_0x56c468['context'],'exten':_0x56c468['exten'],'priority':_0x23ed9e++,'VoiceExtensionId':_0x56c468['id']});return _0x2ede55;}function _0x24c0ab(_0x1cdb14){var _0x3621e2=0x2;var _0x42bef2=[{'type':_0x1601('0xf'),'app':_0x1601('0x2'),'appdata':_0x1601('0x10'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':'outbound','app':_0x1cdb14['alias']?_0x1601('0x2'):_0x1601('0x7'),'appdata':_0x1cdb14[_0x1601('0x6')]?'CDR(routeAlias)='+_0x1cdb14[_0x1601('0x6')]:_0x1601('0x9'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':'Set','appdata':_0x1601('0x11')+(_0x1cdb14[_0x1601('0x12')]?_0x1601('0x13')+_0x1cdb14['cutdigits']+'}':_0x1601('0x14')),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14['exten'],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':_0x1601('0x2'),'appdata':'CDR(routeid)='+_0x1cdb14['id'],'context':_0x1cdb14['context'],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':_0x1601('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3621e2+0x2)+_0x1601('0x16')+(_0x3621e2+0x1)+')','context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':_0x1601('0x2'),'appdata':_0x1cdb14['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x1cdb14[_0x1601('0x12')]+'}':_0x1601('0x17'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14['exten'],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':'Set','appdata':_0x1601('0x18'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':'outbound','app':_0x1601('0x2'),'appdata':_0x1601('0xd'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':'outbound','app':_0x1601('0x2'),'appdata':_0x1601('0xe'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':_0x1601('0xf'),'app':_0x1601('0x2'),'appdata':_0x1601('0x19')+_0x1cdb14['id'],'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']}];if(_0x1cdb14[_0x1601('0x1a')](_0x1601('0x1b'))&&_0x1cdb14[_0x1601('0x1b')]!==_0x1601('0x1c')){_0x42bef2['push']({'type':_0x1601('0xf'),'app':_0x1601('0x2'),'appdata':_0x1601('0x1d'),'context':_0x1cdb14[_0x1601('0x4')],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']},{'type':'outbound','app':_0x1601('0x2'),'appdata':_0x1601('0x1e')+_0x1cdb14['recordingFormat']||_0x1601('0x1f'),'context':_0x1cdb14['context'],'exten':_0x1cdb14[_0x1601('0x5')],'priority':_0x3621e2++,'VoiceExtensionId':_0x1cdb14['id']});}return _0x42bef2;}function _0x39e89f(_0x4b2f6c,_0x7a11dd){var _0xefc661=[{'name':_0x1601('0x20'),'param':0x0},{'name':_0x1601('0x21'),'param':0x1},{'name':_0x1601('0x22'),'param':0x2},{'name':_0x1601('0x23'),'param':0x3}];var _0xf2648={};var _0x4970d4=_0x7a11dd[_0x1601('0x24')](',');var _0x31d5b5=[];for(var _0x5d4cdd=0x0;_0x5d4cdd<_0xefc661['length'];_0x5d4cdd++){switch(_0xefc661[_0x5d4cdd][_0x1601('0x25')]){case _0x1601('0x20'):_0xf2648[_0x1601('0x20')]=_0x4970d4[_0xefc661[_0x5d4cdd][_0x1601('0x26')]][_0x1601('0x24')]('/')[0x1];_0xf2648[_0x1601('0x27')]=_0x4970d4[_0xefc661[_0x5d4cdd][_0x1601('0x26')]]['split']('/')[0x2];_0xf2648[_0x1601('0x28')]=_0xf2648[_0x1601('0x27')]?_0xf2648['phone']['split']('$')[0x0]:undefined;_0xf2648[_0x1601('0x27')]=_0x4b2f6c['cutdigits']?(_0xf2648['prefix']||'')+'${EXTEN:'+_0x4b2f6c[_0x1601('0x12')]+'}':(_0xf2648[_0x1601('0x28')]||'')+_0x1601('0x14');_0x31d5b5[_0xefc661[_0x5d4cdd][_0x1601('0x26')]]=[_0x1601('0x29'),_0xf2648[_0x1601('0x20')],_0xf2648[_0x1601('0x27')]][_0x1601('0x2a')]('/');break;case _0x1601('0x22'):_0xf2648[_0x1601('0x22')]=_0x4970d4[_0xefc661[_0x5d4cdd][_0x1601('0x26')]];if(_0x4b2f6c[_0x1601('0x1b')]!==_0x1601('0x1c')){if(_0xf2648['options'][_0x1601('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0xf2648['options']+='U(xcally-mixmonitor-context)';}}else{_0xf2648[_0x1601('0x22')]=_0xf2648[_0x1601('0x22')][_0x1601('0x2c')]('U(xcally-mixmonitor-context)','');}_0x31d5b5[_0xefc661[_0x5d4cdd]['param']]=_0xf2648[_0x1601('0x22')];break;default:_0x31d5b5[_0xefc661[_0x5d4cdd][_0x1601('0x26')]]=_0x4970d4[_0xefc661[_0x5d4cdd][_0x1601('0x26')]];}}return _0x31d5b5['join'](',');}function _0xcdd4af(_0x5dd4e1,_0x3aba50,_0x109928){return new Promise(function(_0x38bc04,_0x2eaab6){var _0x5077a0=[];if(_[_0x1601('0x2d')](_0x3aba50))return _0x38bc04(_0x5077a0);_0x59212c['Interval'][_0x1601('0x2e')]({'attributes':['id',_0x1601('0x2f'),'IntervalId'],'raw':!![]})[_0x1601('0x30')](function(_0x13b0ad){for(var _0x42399c=0x0,_0x4835f6=0x0;_0x42399c<_0x3aba50[_0x1601('0x31')];_0x42399c++,_0x4835f6=0x0){var _0x4948f4=_0x3aba50[_0x42399c];var _0x2c7e51=[];var _0x2391a1=[];delete _0x4948f4['id'];if(_0x4948f4[_0x1601('0x2f')]!==_0x1601('0x32')){_0x4948f4[_0x1601('0x33')]=[_0x4948f4[_0x1601('0x2f')]];}else{_0x4948f4[_0x1601('0x33')]=_0x4948f4[_0x1601('0x34')]?_[_0x1601('0x35')](_['filter'](_0x13b0ad,{'IntervalId':_0x4948f4[_0x1601('0x34')]}),'interval'):[];}_0x4948f4[_0x1601('0x4')]=_0x5dd4e1[_0x1601('0x4')];_0x4948f4['exten']=_0x5dd4e1[_0x1601('0x5')];if(_0x4948f4[_0x1601('0x1')])_0x4948f4['type']=_0x4948f4[_0x1601('0x1')][_0x1601('0x36')]();if(_0x5dd4e1[_0x1601('0x1')]===_0x1601('0xf')){if(_0x4948f4[_0x1601('0x1a')](_0x1601('0x37'))&&_0x4948f4[_0x1601('0x37')]&&_0x4948f4[_0x1601('0x37')]!=='--'){_0x2c7e51[_0x1601('0xc')]({'type':_0x4948f4[_0x1601('0x1')]['toLowerCase'](),'app':_0x1601('0x2'),'appdata':'CDR(tag)='+_0x4948f4[_0x1601('0x37')],'context':_0x5dd4e1[_0x1601('0x4')],'exten':_0x5dd4e1[_0x1601('0x5')],'priority':_0x4948f4['intervals']['length']+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});}_0x2c7e51[_0x1601('0xc')]({'type':_0x4948f4[_0x1601('0x1')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x4948f4[_0x1601('0x38')]?'Set(CALLERID(all)='+_0x4948f4[_0x1601('0x38')]+')':_0x1601('0x39')),'context':_0x5dd4e1[_0x1601('0x4')],'exten':_0x5dd4e1[_0x1601('0x5')],'priority':_0x4948f4['intervals']['length']+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});}else{if(_0x4948f4[_0x1601('0x1a')](_0x1601('0x3a'))){if(['queue',_0x1601('0x3b')][_0x1601('0x3c')](_0x4948f4[_0x1601('0x3d')][_0x1601('0x36')]())&&_0x4948f4[_0x1601('0x3e')]!==_0x1601('0x3f')){if(_0x4948f4[_0x1601('0x3a')]){_0x2c7e51['push']({'type':_0x4948f4[_0x1601('0x1')][_0x1601('0x36')](),'app':_0x1601('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5dd4e1['context'],'exten':_0x5dd4e1[_0x1601('0x5')],'priority':_0x4948f4[_0x1601('0x33')]['length']+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});_0x2c7e51[_0x1601('0xc')]({'type':_0x4948f4[_0x1601('0x1')][_0x1601('0x36')](),'app':_0x1601('0x2'),'appdata':_0x1601('0x40'),'context':_0x5dd4e1[_0x1601('0x4')],'exten':_0x5dd4e1[_0x1601('0x5')],'priority':_0x4948f4[_0x1601('0x33')][_0x1601('0x31')]+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});}else{_0x2c7e51[_0x1601('0xc')]({'type':_0x4948f4[_0x1601('0x1')][_0x1601('0x36')](),'app':_0x1601('0x15'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5dd4e1[_0x1601('0x4')],'exten':_0x5dd4e1[_0x1601('0x5')],'priority':_0x4948f4['intervals'][_0x1601('0x31')]+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});_0x2c7e51['push']({'type':_0x4948f4[_0x1601('0x1')]['toLowerCase'](),'app':_0x1601('0x2'),'appdata':_0x1601('0x41'),'context':_0x5dd4e1[_0x1601('0x4')],'exten':_0x5dd4e1['exten'],'priority':_0x4948f4[_0x1601('0x33')][_0x1601('0x31')]+_0x109928+_0x4835f6++,'VoiceExtensionId':_0x5dd4e1['id']});}}}}for(var _0x32079f=0x0;_0x32079f<_0x4948f4[_0x1601('0x33')]['length'];_0x32079f++){var _0x4949b0=_0x109928+_0x4948f4['intervals'][_0x1601('0x31')];var _0x573c34=_0x32079f===_0x4948f4['intervals'][_0x1601('0x31')]-0x1?_0x109928+_0x2c7e51[_0x1601('0x31')]+_0x2391a1[_0x1601('0x31')]+0x2:_0x109928+_0x32079f+0x1;_0x2c7e51[_0x1601('0x42')](_0x32079f,0x0,{'type':_0x5dd4e1[_0x1601('0x1')],'app':_0x1601('0x43'),'appdata':_0x4948f4[_0x1601('0x33')][_0x32079f]+'?'+_0x5dd4e1['context']+_0x1601('0x44')+_0x4949b0+':'+_0x5dd4e1['context']+_0x1601('0x44')+_0x573c34,'exten':_0x5dd4e1[_0x1601('0x5')],'context':_0x5dd4e1[_0x1601('0x4')],'priority':_0x109928+_0x32079f,'VoiceExtensionId':_0x5dd4e1['id']});}if(_0x4948f4[_0x1601('0x3e')]===_0x1601('0x45'))_0x4948f4[_0x1601('0x46')]=_0x39e89f(_0x5dd4e1,_0x4948f4[_0x1601('0x46')]);_0x4948f4[_0x1601('0x47')]=_0x2c7e51[_0x1601('0x31')]?_['last'](_0x2c7e51)[_0x1601('0x47')]+0x1:_0x109928;_0x5077a0=_[_0x1601('0x48')](_0x5077a0,_0x2c7e51,[_0x4948f4],_0x2391a1);_0x109928=_[_0x1601('0x49')](_0x5077a0)[_0x1601('0x47')]+0x1;}return _0x38bc04(_0x5077a0);})[_0x1601('0x4a')](function(_0x5a87b0){_0x2eaab6(_0x5a87b0);});});}return _0x55f0f0[_0x1601('0x4b')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1d7271){var _0x5e1f90=this[_0x1601('0x4c')]({'plain':!![]});var _0x517f34=_0x5e1f90['type']===_0x1601('0xf')?_0x24c0ab(_0x5e1f90):_0x40c20f(_0x5e1f90);return _0xcdd4af(_0x5e1f90,_0x1d7271,_[_0x1601('0x49')](_0x517f34)[_0x1601('0x47')]+0x1)['then'](function(_0x56c472){var _0x136b31=_[_0x1601('0x48')](_0x517f34,_0x56c472);_0x136b31[_0x1601('0xc')]({'type':_0x5e1f90[_0x1601('0x1')],'app':_0x1601('0x4d'),'exten':_0x5e1f90['exten'],'context':_0x5e1f90[_0x1601('0x4')],'priority':_['last'](_0x136b31)[_0x1601('0x47')]+0x1,'VoiceExtensionId':_0x5e1f90['id']});return _0x136b31;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 341d3b1..3dcdeab 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 _0x7b84=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceExtension','findAll','options','raw','where','limit','map','include','model','attributes','info','GetVoiceExtension','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7b84,0x167));var _0x47b8=function(_0x1d128f,_0x534ce1){_0x1d128f=_0x1d128f-0x0;var _0x1a5790=_0x7b84[_0x1d128f];return _0x1a5790;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47b8('0x3'));var db=require(_0x47b8('0x4'))['db'];var utils=require(_0x47b8('0x5'));var logger=require(_0x47b8('0x6'))(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var jayson=require(_0x47b8('0x9'));var client=jayson[_0x47b8('0xa')][_0x47b8('0xb')]({'port':0x232a});config[_0x47b8('0xc')]=_[_0x47b8('0xd')](config[_0x47b8('0xc')],{'host':_0x47b8('0xe'),'port':0x18eb});var socket=require(_0x47b8('0xf'))(new Redis(config[_0x47b8('0xc')]));require(_0x47b8('0x10'))[_0x47b8('0x11')](socket);function respondWithRpcPromise(_0x3ddbfd,_0xb3f2b8,_0x520569){return new BPromise(function(_0x5450f6,_0x245bf5){return client[_0x47b8('0x12')](_0x3ddbfd,_0x520569)[_0x47b8('0x13')](function(_0x320fdf){logger['info'](_0x47b8('0x14'),_0xb3f2b8,_0x47b8('0x15'));logger['debug'](_0x47b8('0x16'),_0xb3f2b8,_0x47b8('0x15'),JSON[_0x47b8('0x17')](_0x320fdf));if(_0x320fdf[_0x47b8('0x18')]){if(_0x320fdf[_0x47b8('0x18')]['code']===0x1f4){logger['error'](_0x47b8('0x14'),_0xb3f2b8,_0x320fdf['error'][_0x47b8('0x19')]);return _0x245bf5(_0x320fdf[_0x47b8('0x18')][_0x47b8('0x19')]);}logger[_0x47b8('0x18')](_0x47b8('0x14'),_0xb3f2b8,_0x320fdf[_0x47b8('0x18')][_0x47b8('0x19')]);return _0x5450f6(_0x320fdf[_0x47b8('0x18')][_0x47b8('0x19')]);}else{logger['info'](_0x47b8('0x14'),_0xb3f2b8,_0x47b8('0x15'));_0x5450f6(_0x320fdf[_0x47b8('0x1a')][_0x47b8('0x19')]);}})[_0x47b8('0x1b')](function(_0x593f36){logger[_0x47b8('0x18')]('VoiceExtension,\x20%s,\x20%s',_0xb3f2b8,_0x593f36);_0x245bf5(_0x593f36);});});}exports['GetVoiceExtension']=function(_0x20731c){var _0x5e15d5=this;return new Promise(function(_0x1d44a9,_0x227cd7){return db[_0x47b8('0x1c')][_0x47b8('0x1d')]({'raw':_0x20731c[_0x47b8('0x1e')]?_0x20731c[_0x47b8('0x1e')][_0x47b8('0x1f')]===undefined?!![]:![]:!![],'where':_0x20731c[_0x47b8('0x1e')]?_0x20731c['options'][_0x47b8('0x20')]||null:null,'attributes':_0x20731c[_0x47b8('0x1e')]?_0x20731c[_0x47b8('0x1e')]['attributes']||null:null,'limit':_0x20731c[_0x47b8('0x1e')]?_0x20731c[_0x47b8('0x1e')][_0x47b8('0x21')]||null:null,'include':_0x20731c['options']?_0x20731c[_0x47b8('0x1e')]['include']?_[_0x47b8('0x22')](_0x20731c['options'][_0x47b8('0x23')],function(_0x3e40a1){return{'model':db[_0x3e40a1[_0x47b8('0x24')]],'as':_0x3e40a1['as'],'attributes':_0x3e40a1[_0x47b8('0x25')],'include':_0x3e40a1[_0x47b8('0x23')]?_[_0x47b8('0x22')](_0x3e40a1[_0x47b8('0x23')],function(_0x315fd7){return{'model':db[_0x315fd7[_0x47b8('0x24')]],'as':_0x315fd7['as'],'attributes':_0x315fd7[_0x47b8('0x25')],'include':_0x315fd7[_0x47b8('0x23')]?_[_0x47b8('0x22')](_0x315fd7[_0x47b8('0x23')],function(_0x19a605){return{'model':db[_0x19a605['model']],'as':_0x19a605['as'],'attributes':_0x19a605['attributes']};}):[]};}):[]};}):[]:[]})[_0x47b8('0x13')](function(_0x9edecd){logger[_0x47b8('0x26')](_0x47b8('0x27'),_0x20731c);logger[_0x47b8('0x28')]('GetVoiceExtension',_0x20731c,JSON[_0x47b8('0x17')](_0x9edecd));_0x1d44a9(_0x9edecd);})[_0x47b8('0x1b')](function(_0x4edc09){logger[_0x47b8('0x18')](_0x47b8('0x27'),_0x4edc09[_0x47b8('0x19')],_0x20731c);_0x227cd7(_0x5e15d5['error'](0x1f4,_0x4edc09[_0x47b8('0x19')]));});});}; \ No newline at end of file +var _0x0c42=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x508628,_0x474f36){var _0x372436=function(_0x1d75cd){while(--_0x1d75cd){_0x508628['push'](_0x508628['shift']());}};_0x372436(++_0x474f36);}(_0x0c42,0x191));var _0x20c4=function(_0x2dd446,_0x299ce9){_0x2dd446=_0x2dd446-0x0;var _0x5ecb0d=_0x0c42[_0x2dd446];return _0x5ecb0d;};'use strict';var _=require(_0x20c4('0x0'));var util=require(_0x20c4('0x1'));var moment=require(_0x20c4('0x2'));var BPromise=require(_0x20c4('0x3'));var rs=require(_0x20c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x20c4('0x5'));var logger=require(_0x20c4('0x6'))(_0x20c4('0x7'));var config=require(_0x20c4('0x8'));var jayson=require(_0x20c4('0x9'));var client=jayson['client'][_0x20c4('0xa')]({'port':0x232a});config['redis']=_[_0x20c4('0xb')](config['redis'],{'host':_0x20c4('0xc'),'port':0x18eb});var socket=require(_0x20c4('0xd'))(new Redis(config[_0x20c4('0xe')]));require('./voiceExtension.socket')[_0x20c4('0xf')](socket);function respondWithRpcPromise(_0x219b9f,_0x94a2e8,_0xf3917){return new BPromise(function(_0xdc42c3,_0x312ee0){return client[_0x20c4('0x10')](_0x219b9f,_0xf3917)[_0x20c4('0x11')](function(_0x4ae2fd){logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));logger[_0x20c4('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x94a2e8,_0x20c4('0x14'),JSON['stringify'](_0x4ae2fd));if(_0x4ae2fd[_0x20c4('0x16')]){if(_0x4ae2fd[_0x20c4('0x16')]['code']===0x1f4){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0x312ee0(_0x4ae2fd[_0x20c4('0x16')]['message']);}logger[_0x20c4('0x16')](_0x20c4('0x13'),_0x94a2e8,_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);return _0xdc42c3(_0x4ae2fd[_0x20c4('0x16')][_0x20c4('0x17')]);}else{logger[_0x20c4('0x12')](_0x20c4('0x13'),_0x94a2e8,_0x20c4('0x14'));_0xdc42c3(_0x4ae2fd[_0x20c4('0x18')][_0x20c4('0x17')]);}})['catch'](function(_0x513dc7){logger[_0x20c4('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x94a2e8,_0x513dc7);_0x312ee0(_0x513dc7);});});}exports[_0x20c4('0x19')]=function(_0x2c1892){var _0x805816=this;return new Promise(function(_0x294c37,_0x28ba0a){return db[_0x20c4('0x1a')][_0x20c4('0x1b')]({'raw':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1e')]||null:null,'attributes':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x1f')]||null:null,'limit':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x20')]||null:null,'include':_0x2c1892[_0x20c4('0x1c')]?_0x2c1892[_0x20c4('0x1c')][_0x20c4('0x21')]?_[_0x20c4('0x22')](_0x2c1892[_0x20c4('0x1c')]['include'],function(_0x5efa2b){return{'model':db[_0x5efa2b[_0x20c4('0x23')]],'as':_0x5efa2b['as'],'attributes':_0x5efa2b[_0x20c4('0x1f')],'include':_0x5efa2b['include']?_[_0x20c4('0x22')](_0x5efa2b[_0x20c4('0x21')],function(_0x5bc23a){return{'model':db[_0x5bc23a[_0x20c4('0x23')]],'as':_0x5bc23a['as'],'attributes':_0x5bc23a[_0x20c4('0x1f')],'include':_0x5bc23a['include']?_[_0x20c4('0x22')](_0x5bc23a['include'],function(_0x19907c){return{'model':db[_0x19907c['model']],'as':_0x19907c['as'],'attributes':_0x19907c[_0x20c4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x20c4('0x11')](function(_0x26a63e){logger[_0x20c4('0x12')](_0x20c4('0x19'),_0x2c1892);logger[_0x20c4('0x15')]('GetVoiceExtension',_0x2c1892,JSON['stringify'](_0x26a63e));_0x294c37(_0x26a63e);})[_0x20c4('0x24')](function(_0x1673ff){logger[_0x20c4('0x16')](_0x20c4('0x19'),_0x1673ff[_0x20c4('0x17')],_0x2c1892);_0x28ba0a(_0x805816['error'](0x1f4,_0x1673ff[_0x20c4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 86b58ed..a248b8d 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4c2745,_0x43790d){var _0x39beb2=function(_0x3cd5c3){while(--_0x3cd5c3){_0x4c2745['push'](_0x4c2745['shift']());}};_0x39beb2(++_0x43790d);}(_0x1261,0x144));var _0x1126=function(_0x1b4bef,_0x5bb6be){_0x1b4bef=_0x1b4bef-0x0;var _0xf377eb=_0x1261[_0x1b4bef];return _0xf377eb;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x3dc5a,_0x4f34ee){var _0x362ed4=function(_0x4317e4){while(--_0x4317e4){_0x3dc5a['push'](_0x3dc5a['shift']());}};_0x362ed4(++_0x4f34ee);}(_0x53ec,0x192));var _0xc53e=function(_0x179039,_0x1fb713){_0x179039=_0x179039-0x0;var _0xeb427=_0x53ec[_0x179039];return _0xeb427;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 183fce9..93a6f96 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['show','/:id/messages','post','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated'];(function(_0x29b90d,_0x2ffba9){var _0x5c1ebf=function(_0x250c29){while(--_0x250c29){_0x29b90d['push'](_0x29b90d['shift']());}};_0x5c1ebf(++_0x2ffba9);}(_0x4991,0xf7));var _0x1499=function(_0x320dbf,_0x1b2893){_0x320dbf=_0x320dbf-0x0;var _0x3502f8=_0x4991[_0x320dbf];return _0x3502f8;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['getMessages']);router[_0x1499('0xf')]('/',auth[_0x1499('0xc')](),controller['create']);router[_0x1499('0x10')](_0x1499('0xb'),auth['isAuthenticated'](),controller[_0x1499('0x11')]);router[_0x1499('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1499('0x13')]=router; \ No newline at end of file +var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2246e5,_0x4bbc60){var _0x3f1162=function(_0x11fd1c){while(--_0x11fd1c){_0x2246e5['push'](_0x2246e5['shift']());}};_0x3f1162(++_0x4bbc60);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router[_0x901d('0x13')]('/:id',auth[_0x901d('0xd')](),controller['update']);router[_0x901d('0x14')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0x15')]);module[_0x901d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 8163f3f..1ce4ad6 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 _0xab5f=['email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x4adc50,_0x149b13){var _0x55cb86=function(_0x2027bc){while(--_0x2027bc){_0x4adc50['push'](_0x4adc50['shift']());}};_0x55cb86(++_0x149b13);}(_0xab5f,0xb0));var _0xfab5=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xab5f[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xfab5('0x0')]},'context':{'type':Sequelize[_0xfab5('0x0')],'defaultValue':_0xfab5('0x1'),'unique':_0xfab5('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xfab5('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xfab5('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x185235){this[_0xfab5('0x3')](_0xfab5('0x4'),typeof _0x185235==='string'&&_0x185235['trim']()?_0x185235[_0xfab5('0x5')]():null);}},'pager':{'type':Sequelize[_0xfab5('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xfab5('0x6')},'attach':{'type':Sequelize[_0xfab5('0x7')]('yes','no'),'defaultValue':_0xfab5('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xfab5('0x8'),'no'),'defaultValue':_0xfab5('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfab5('0x0')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xfab5('0x7')](_0xfab5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xfab5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfab5('0x7')](_0xfab5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xfab5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfab5('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfab5('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xfab5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xfab5('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfab5('0x7')](_0xfab5('0x8'),'no'),'defaultValue':_0xfab5('0x8'),'allowNull':![]},'stamp':{'type':_0xfab5('0xa')},'emailsubject':{'type':Sequelize[_0xfab5('0x0')]},'emailbody':{'type':Sequelize[_0xfab5('0x0')]},'maxsecs':{'type':Sequelize[_0xfab5('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xfab5('0xc')],'get':function(){return this['getDataValue'](_0xfab5('0xd'))+'\x20-\x20'+this[_0xfab5('0xe')]('mailbox');}}}; \ No newline at end of file +var _0xed64=['exports','STRING','from-voicemail','setDataValue','email','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x58b44a,_0x1a7aa6){var _0xd6779d=function(_0x40d8f3){while(--_0x40d8f3){_0x58b44a['push'](_0x58b44a['shift']());}};_0xd6779d(++_0x1a7aa6);}(_0xed64,0xed));var _0x4ed6=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0xed64[_0x54f7c0];return _0x245d03;};'use strict';var Sequelize=require(_0x4ed6('0x0'));module[_0x4ed6('0x1')]={'customer_id':{'type':Sequelize[_0x4ed6('0x2')]},'context':{'type':Sequelize[_0x4ed6('0x2')],'defaultValue':_0x4ed6('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4ed6('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4ed6('0x2')]},'fullname':{'type':Sequelize[_0x4ed6('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x4634be){this[_0x4ed6('0x4')](_0x4ed6('0x5'),typeof _0x4634be==='string'&&_0x4634be[_0x4ed6('0x6')]()?_0x4634be[_0x4ed6('0x6')]():null);}},'pager':{'type':Sequelize[_0x4ed6('0x2')]},'tz':{'type':Sequelize[_0x4ed6('0x2')],'defaultValue':_0x4ed6('0x7')},'attach':{'type':Sequelize['ENUM'](_0x4ed6('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x4ed6('0x9')](_0x4ed6('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x4ed6('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x4ed6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4ed6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4ed6('0x9')](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4ed6('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4ed6('0x9')]('yes','no'),'defaultValue':_0x4ed6('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4ed6('0x9')](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4ed6('0x9')](_0x4ed6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4ed6('0x9')](_0x4ed6('0x8'),'no'),'defaultValue':_0x4ed6('0x8'),'allowNull':![]},'stamp':{'type':_0x4ed6('0xb')},'emailsubject':{'type':Sequelize[_0x4ed6('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x4ed6('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4ed6('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4ed6('0xd')],'get':function(){return this['getDataValue']('fullname')+_0x4ed6('0xe')+this[_0x4ed6('0xf')](_0x4ed6('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d048104..438ad16 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 _0x36ee=['set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','stack','index','map','VoiceMail','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x89a1e7,_0x242359){var _0x16c5e3=function(_0x3fe007){while(--_0x3fe007){_0x89a1e7['push'](_0x89a1e7['shift']());}};_0x16c5e3(++_0x242359);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':!![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['VoiceMail'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='Voicemails';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x25')]=function(_0x3e1040,_0x206f75){if(_0x3e1040[_0xe36e('0x4b')]['id']){delete _0x3e1040['body']['id'];}return db['VoiceMail']['find']({'where':{'id':_0x3e1040['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](saveUpdates(_0x3e1040[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x206f75,null))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x27')]=function(_0x7c3766,_0x17965c){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x7c3766[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x17965c,null))['then'](removeEntity(_0x17965c,null))[_0xe36e('0x44')](handleError(_0x17965c,null));};exports[_0xe36e('0x54')]=function(_0x169369,_0x443154,_0x700b63){return db[_0xe36e('0x2d')][_0xe36e('0x55')]({'where':{'id':_0x169369[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x443154,null))[_0xe36e('0x26')](function(_0x56718a){var _0x2cf7fc;var _0x389e91={},_0x6f979f={};_0x6f979f[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x56')][_0xe36e('0x2e')]);_0x6f979f[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x169369[_0xe36e('0x33')]);_0x6f979f[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],_0x6f979f[_0xe36e('0x33')]);_0x389e91['attributes']=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],qs['fields'](_0x169369[_0xe36e('0x33')][_0xe36e('0x38')]));_0x389e91[_0xe36e('0x37')]=_0x389e91[_0xe36e('0x37')][_0xe36e('0x39')]?_0x389e91[_0xe36e('0x37')]:_0x6f979f['model'];if(!_0x169369[_0xe36e('0x33')]['hasOwnProperty'](_0xe36e('0x3a'))){_0x389e91[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x169369[_0xe36e('0x33')][_0xe36e('0x1e')]);_0x389e91[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x169369[_0xe36e('0x33')]['offset']);}_0x389e91[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x169369['query'][_0xe36e('0x3c')]);_0x389e91[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x169369[_0xe36e('0x33')],_0x6f979f[_0xe36e('0x35')]));if(_0x169369[_0xe36e('0x33')]['filter']){_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x389e91[_0xe36e('0x37')],function(_0x43d8c2){var _0xc1daf8={};_0xc1daf8[_0x43d8c2]={'$like':'%'+_0x169369[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0xc1daf8;})});}_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91['where'],{'mailboxuser':_0x56718a[_0xe36e('0x57')]});_0x389e91=_[_0xe36e('0x40')]({},_0x389e91,_0x169369[_0xe36e('0x48')]);return db[_0xe36e('0x56')]['findAndCountAll'](_0x389e91)['then'](respondWithFilteredResult(_0x443154,_0x389e91));})[_0xe36e('0x44')](handleError(_0x443154,null));}; \ No newline at end of file +var _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0xcf66,0x71));var _0x6cf6=function(_0x40fcfd,_0x323c79){_0x40fcfd=_0x40fcfd-0x0;var _0x5208f9=_0xcf66[_0x40fcfd];return _0x5208f9;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9a2f9b1..75d94d7 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 _0x816d=['context','lodash','util','../../config/logger','api','moment','bluebird','path','./voiceMail.attributes','exports','VoiceMail','mailbox_context','mailbox'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x816d,0x1d5));var _0xd816=function(_0x3817a8,_0x40766c){_0x3817a8=_0x3817a8-0x0;var _0x550bd6=_0x816d[_0x3817a8];return _0x550bd6;};'use strict';var _=require(_0xd816('0x0'));var util=require(_0xd816('0x1'));var logger=require(_0xd816('0x2'))(_0xd816('0x3'));var moment=require(_0xd816('0x4'));var BPromise=require(_0xd816('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd816('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd816('0x7'));module[_0xd816('0x8')]=function(_0x56cd0d,_0x5e6d0c){return _0x56cd0d['define'](_0xd816('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd816('0xa'),'fields':[_0xd816('0xb'),_0xd816('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c95=['request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','mailbox','context','lodash','util','../../config/logger','api','bluebird'];(function(_0x101c13,_0x5a2646){var _0x5e50f4=function(_0x27c186){while(--_0x27c186){_0x101c13['push'](_0x101c13['shift']());}};_0x5e50f4(++_0x5a2646);}(_0x6c95,0x1bb));var _0x56c9=function(_0x486a7c,_0x443732){_0x486a7c=_0x486a7c-0x0;var _0x214ce1=_0x6c95[_0x486a7c];return _0x214ce1;};'use strict';var _=require(_0x56c9('0x0'));var util=require(_0x56c9('0x1'));var logger=require(_0x56c9('0x2'))(_0x56c9('0x3'));var moment=require('moment');var BPromise=require(_0x56c9('0x4'));var rp=require(_0x56c9('0x5'));var fs=require('fs');var path=require(_0x56c9('0x6'));var rimraf=require(_0x56c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x56c9('0x8'));module[_0x56c9('0x9')]=function(_0x2c09bb,_0x56e32a){return _0x2c09bb[_0x56c9('0xa')](_0x56c9('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x56c9('0xc'),_0x56c9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index cee7631..d36e657 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 _0x381d=['client','http','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','VoiceMail,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x381d,0x166));var _0xd381=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x381d[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require(_0xd381('0x0'));var util=require(_0xd381('0x1'));var moment=require(_0xd381('0x2'));var BPromise=require(_0xd381('0x3'));var rs=require(_0xd381('0x4'));var fs=require('fs');var Redis=require(_0xd381('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd381('0x6'))(_0xd381('0x7'));var config=require(_0xd381('0x8'));var jayson=require(_0xd381('0x9'));var client=jayson[_0xd381('0xa')][_0xd381('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17cd02,_0x4f5787,_0x2795d0){return new BPromise(function(_0x5b7358,_0x348396){return client['request'](_0x17cd02,_0x2795d0)[_0xd381('0xc')](function(_0xa38db8){logger['info']('VoiceMail,\x20%s,\x20%s',_0x4f5787,_0xd381('0xd'));logger[_0xd381('0xe')](_0xd381('0xf'),_0x4f5787,_0xd381('0xd'),JSON['stringify'](_0xa38db8));if(_0xa38db8[_0xd381('0x10')]){if(_0xa38db8[_0xd381('0x10')][_0xd381('0x11')]===0x1f4){logger['error'](_0xd381('0x12'),_0x4f5787,_0xa38db8[_0xd381('0x10')]['message']);return _0x348396(_0xa38db8[_0xd381('0x10')][_0xd381('0x13')]);}logger[_0xd381('0x10')](_0xd381('0x12'),_0x4f5787,_0xa38db8[_0xd381('0x10')]['message']);return _0x5b7358(_0xa38db8[_0xd381('0x10')][_0xd381('0x13')]);}else{logger[_0xd381('0x14')]('VoiceMail,\x20%s,\x20%s',_0x4f5787,_0xd381('0xd'));_0x5b7358(_0xa38db8[_0xd381('0x15')]['message']);}})[_0xd381('0x16')](function(_0x2d18e9){logger[_0xd381('0x10')](_0xd381('0x12'),_0x4f5787,_0x2d18e9);_0x348396(_0x2d18e9);});});} \ No newline at end of file +var _0x31d7=['rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37f788,_0x1dd5fd){var _0x194896=function(_0x27aafd){while(--_0x27aafd){_0x37f788['push'](_0x37f788['shift']());}};_0x194896(++_0x1dd5fd);}(_0x31d7,0x93));var _0x731d=function(_0x33a364,_0x458fdb){_0x33a364=_0x33a364-0x0;var _0xb681c8=_0x31d7[_0x33a364];return _0xb681c8;};'use strict';var _=require(_0x731d('0x0'));var util=require(_0x731d('0x1'));var moment=require(_0x731d('0x2'));var BPromise=require(_0x731d('0x3'));var rs=require(_0x731d('0x4'));var fs=require('fs');var Redis=require(_0x731d('0x5'));var db=require(_0x731d('0x6'))['db'];var utils=require(_0x731d('0x7'));var logger=require(_0x731d('0x8'))(_0x731d('0x9'));var config=require(_0x731d('0xa'));var jayson=require(_0x731d('0xb'));var client=jayson[_0x731d('0xc')][_0x731d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x250d8f,_0x318d77,_0x1916c8){return new BPromise(function(_0x1d9697,_0x2df2a3){return client[_0x731d('0xe')](_0x250d8f,_0x1916c8)[_0x731d('0xf')](function(_0x557b7e){logger['info'](_0x731d('0x10'),_0x318d77,_0x731d('0x11'));logger[_0x731d('0x12')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x318d77,_0x731d('0x11'),JSON[_0x731d('0x13')](_0x557b7e));if(_0x557b7e['error']){if(_0x557b7e['error'][_0x731d('0x14')]===0x1f4){logger['error'](_0x731d('0x10'),_0x318d77,_0x557b7e[_0x731d('0x15')][_0x731d('0x16')]);return _0x2df2a3(_0x557b7e[_0x731d('0x15')][_0x731d('0x16')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x318d77,_0x557b7e[_0x731d('0x15')][_0x731d('0x16')]);return _0x1d9697(_0x557b7e[_0x731d('0x15')][_0x731d('0x16')]);}else{logger[_0x731d('0x17')](_0x731d('0x10'),_0x318d77,'request\x20sent');_0x1d9697(_0x557b7e[_0x731d('0x18')][_0x731d('0x16')]);}})[_0x731d('0x19')](function(_0x94b90a){logger[_0x731d('0x15')]('VoiceMail,\x20%s,\x20%s',_0x318d77,_0x94b90a);_0x2df2a3(_0x94b90a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 8907319..a3ee57b 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 _0x330f=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','./voiceMailMessage.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put','update','delete'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x330f,0x192));var _0xf330=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0x330f[_0x57a670];return _0x41ce21;};'use strict';var multer=require(_0xf330('0x0'));var util=require(_0xf330('0x1'));var path=require(_0xf330('0x2'));var timeout=require('connect-timeout');var express=require(_0xf330('0x3'));var router=express['Router']();var fs_extra=require(_0xf330('0x4'));var auth=require(_0xf330('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf330('0x6'));router['get']('/',auth[_0xf330('0x7')](),controller['index']);router[_0xf330('0x8')](_0xf330('0x9'),auth['isAuthenticated'](),controller[_0xf330('0xa')]);router[_0xf330('0x8')](_0xf330('0xb'),auth[_0xf330('0x7')](),controller[_0xf330('0xc')]);router[_0xf330('0xd')]('/',auth[_0xf330('0x7')](),controller[_0xf330('0xe')]);router[_0xf330('0xf')](_0xf330('0x9'),auth['isAuthenticated'](),controller[_0xf330('0x10')]);router[_0xf330('0x11')](_0xf330('0x9'),auth[_0xf330('0x7')](),controller[_0xf330('0x12')]);module[_0xf330('0x13')]=router; \ No newline at end of file +var _0xe620=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','get','/:id','show','download','create','multer','util','path','connect-timeout','express'];(function(_0x441912,_0x46e1f2){var _0x4923e2=function(_0x1c6711){while(--_0x1c6711){_0x441912['push'](_0x441912['shift']());}};_0x4923e2(++_0x46e1f2);}(_0xe620,0xfb));var _0x0e62=function(_0x2fd21f,_0x104a24){_0x2fd21f=_0x2fd21f-0x0;var _0x50d9de=_0xe620[_0x2fd21f];return _0x50d9de;};'use strict';var multer=require(_0x0e62('0x0'));var util=require(_0x0e62('0x1'));var path=require(_0x0e62('0x2'));var timeout=require(_0x0e62('0x3'));var express=require(_0x0e62('0x4'));var router=express['Router']();var fs_extra=require(_0x0e62('0x5'));var auth=require(_0x0e62('0x6'));var interaction=require(_0x0e62('0x7'));var config=require(_0x0e62('0x8'));var controller=require(_0x0e62('0x9'));router['get']('/',auth[_0x0e62('0xa')](),controller['index']);router[_0x0e62('0xb')](_0x0e62('0xc'),auth[_0x0e62('0xa')](),controller[_0x0e62('0xd')]);router[_0x0e62('0xb')]('/:id/download',auth[_0x0e62('0xa')](),controller[_0x0e62('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0e62('0xf')]);router['put'](_0x0e62('0xc'),auth[_0x0e62('0xa')](),controller['update']);router['delete'](_0x0e62('0xc'),auth[_0x0e62('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7681860..82faea5 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 _0x6dea=['INTEGER','STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3ea5e1,_0x17c486){var _0x1b81d7=function(_0x5af999){while(--_0x5af999){_0x3ea5e1['push'](_0x3ea5e1['shift']());}};_0x1b81d7(++_0x17c486);}(_0x6dea,0x1d6));var _0xa6de=function(_0x2ef4ff,_0x3e2335){_0x2ef4ff=_0x2ef4ff-0x0;var _0x57a6f2=_0x6dea[_0x2ef4ff];return _0x57a6f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5272f6){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xa6de('0x0')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'context':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'duration':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'recording':{'type':Sequelize[_0xa6de('0x2')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xa6de('0x1')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xa6de('0x3')](_0xa6de('0x4'))}}; \ No newline at end of file +var _0x3c63=['BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c63,0x1d4));var _0x33c6=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0x3c63[_0x1d5ba8];return _0x1022a2;};'use strict';var Sequelize=require(_0x33c6('0x0'));module['exports']={'name':{'type':Sequelize[_0x33c6('0x1')],'get':function(_0x2d98e2){return this[_0x33c6('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x33c6('0x4')](_0x33c6('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x33c6('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x33c6('0x6')](_0x33c6('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index e7da3b5..d6c56cf 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 _0x823d=['query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','count','rows','catch','show','params','rawAttributes','include','find','create','update','body','destroy','download','recording','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','sendStatus','end','status','offset','undefined','set','json','apply','reject','then','error','stack','name','index','map','VoiceMailMessage','fieldName','type','key','differenceBy'];(function(_0xdfbefd,_0x5916b2){var _0x2b7fb2=function(_0xb06b7f){while(--_0xb06b7f){_0xdfbefd['push'](_0xdfbefd['shift']());}};_0x2b7fb2(++_0x5916b2);}(_0x823d,0xce));var _0xd823=function(_0x208cf0,_0x486665){_0x208cf0=_0x208cf0-0x0;var _0x372d0d=_0x823d[_0x208cf0];return _0x372d0d;};'use strict';var emlformat=require(_0xd823('0x0'));var rimraf=require(_0xd823('0x1'));var zipdir=require(_0xd823('0x2'));var jsonpatch=require(_0xd823('0x3'));var rp=require('request-promise');var moment=require(_0xd823('0x4'));var BPromise=require(_0xd823('0x5'));var Mustache=require(_0xd823('0x6'));var util=require(_0xd823('0x7'));var path=require(_0xd823('0x8'));var sox=require(_0xd823('0x9'));var csv=require(_0xd823('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd823('0xb'));var squel=require(_0xd823('0xc'));var crypto=require(_0xd823('0xd'));var jsforce=require(_0xd823('0xe'));var deskjs=require(_0xd823('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd823('0x10'));var Papa=require('papaparse');var Redis=require(_0xd823('0x11'));var authService=require(_0xd823('0x12'));var qs=require(_0xd823('0x13'));var as=require(_0xd823('0x14'));var hardwareService=require(_0xd823('0x15'));var logger=require(_0xd823('0x16'))(_0xd823('0x17'));var utils=require('../../config/utils');var config=require(_0xd823('0x18'));var licenseUtil=require(_0xd823('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15b19f,_0x465be5){_0x465be5=_0x465be5||0xcc;return function(_0x28051b){if(_0x28051b){return _0x15b19f[_0xd823('0x1a')](_0x465be5);}return _0x15b19f['status'](_0x465be5)[_0xd823('0x1b')]();};}function respondWithResult(_0x5b0a1e,_0x5a1151){_0x5a1151=_0x5a1151||0xc8;return function(_0x4e2ee7){if(_0x4e2ee7){return _0x5b0a1e[_0xd823('0x1c')](_0x5a1151)['json'](_0x4e2ee7);}};}function respondWithFilteredResult(_0x1cc1d8,_0x1984ca){return function(_0x128174){if(_0x128174){var _0x2d3efd=typeof _0x1984ca[_0xd823('0x1d')]===_0xd823('0x1e')&&typeof _0x1984ca['limit']===_0xd823('0x1e');var _0x292bd1=_0x128174['count'];var _0x58ce14=_0x2d3efd?0x0:_0x1984ca['offset'];var _0x30d64d=_0x2d3efd?_0x128174['count']:_0x1984ca[_0xd823('0x1d')]+_0x1984ca['limit'];var _0x2fe7ed;if(_0x30d64d>=_0x292bd1){_0x30d64d=_0x292bd1;_0x2fe7ed=0xc8;}else{_0x2fe7ed=0xce;}_0x1cc1d8[_0xd823('0x1c')](_0x2fe7ed);return _0x1cc1d8[_0xd823('0x1f')]('Content-Range',_0x58ce14+'-'+_0x30d64d+'/'+_0x292bd1)[_0xd823('0x20')](_0x128174);}return null;};}function patchUpdates(_0x3ca126){return function(_0x6617b4){try{jsonpatch[_0xd823('0x21')](_0x6617b4,_0x3ca126,!![]);}catch(_0x598dae){return BPromise[_0xd823('0x22')](_0x598dae);}return _0x6617b4['save']();};}function saveUpdates(_0x50c8ad,_0x5a943f){return function(_0x3f3878){if(_0x3f3878){return _0x3f3878['update'](_0x50c8ad)[_0xd823('0x23')](function(_0x44cf93){return _0x44cf93;});}return null;};}function removeEntity(_0x3f9ce,_0x23f1ec){return function(_0xf98f94){if(_0xf98f94){return _0xf98f94['destroy']()['then'](function(){_0x3f9ce[_0xd823('0x1c')](0xcc)[_0xd823('0x1b')]();});}};}function handleEntityNotFound(_0xed5f42,_0x197a9b){return function(_0x3bf295){if(!_0x3bf295){_0xed5f42[_0xd823('0x1a')](0x194);}return _0x3bf295;};}function handleError(_0x283b18,_0xb74ca6){_0xb74ca6=_0xb74ca6||0x1f4;return function(_0x1cd31b){logger[_0xd823('0x24')](_0x1cd31b[_0xd823('0x25')]);if(_0x1cd31b[_0xd823('0x26')]){delete _0x1cd31b[_0xd823('0x26')];}_0x283b18[_0xd823('0x1c')](_0xb74ca6)['send'](_0x1cd31b);};}exports[_0xd823('0x27')]=function(_0x17d2b4,_0x19a2ce){var _0x331983={},_0x14c0a9={},_0x344c53={'count':0x0,'rows':[]};var _0x505b3f=_[_0xd823('0x28')](db[_0xd823('0x29')]['rawAttributes'],function(_0x42f76c){return{'name':_0x42f76c[_0xd823('0x2a')],'type':_0x42f76c[_0xd823('0x2b')][_0xd823('0x2c')]};});_0x14c0a9['model']=_[_0xd823('0x2d')](_[_0xd823('0x28')](_0x505b3f,_0xd823('0x26')),[_0xd823('0x26')]);_0x14c0a9[_0xd823('0x2e')]=_[_0xd823('0x2f')](_0x17d2b4[_0xd823('0x2e')]);_0x14c0a9[_0xd823('0x30')]=_[_0xd823('0x31')](_0x14c0a9['model'],_0x14c0a9['query']);_0x331983[_0xd823('0x32')]=_[_0xd823('0x31')](_0x14c0a9[_0xd823('0x33')],qs[_0xd823('0x34')](_0x17d2b4[_0xd823('0x2e')][_0xd823('0x34')]));_0x331983[_0xd823('0x32')]=_0x331983[_0xd823('0x32')][_0xd823('0x35')]?_0x331983[_0xd823('0x32')]:_0x14c0a9[_0xd823('0x33')];if(!_0x17d2b4['query'][_0xd823('0x36')](_0xd823('0x37'))){_0x331983[_0xd823('0x38')]=qs[_0xd823('0x38')](_0x17d2b4[_0xd823('0x2e')][_0xd823('0x38')]);_0x331983[_0xd823('0x1d')]=qs[_0xd823('0x1d')](_0x17d2b4[_0xd823('0x2e')]['offset']);}_0x331983['order']=qs[_0xd823('0x39')](_0x17d2b4[_0xd823('0x2e')][_0xd823('0x39')]);_0x331983[_0xd823('0x3a')]=qs[_0xd823('0x30')](_[_0xd823('0x3b')](_0x17d2b4[_0xd823('0x2e')],_0x14c0a9[_0xd823('0x30')]),_0x505b3f);if(_0x17d2b4[_0xd823('0x2e')][_0xd823('0x3c')]){_0x331983[_0xd823('0x3a')]=_['merge'](_0x331983[_0xd823('0x3a')],{'$or':_[_0xd823('0x28')](_0x505b3f,function(_0x44706b){if(_0x44706b[_0xd823('0x2b')]!==_0xd823('0x3d')){var _0x4b9423={};_0x4b9423[_0x44706b[_0xd823('0x26')]]={'$like':'%'+_0x17d2b4[_0xd823('0x2e')][_0xd823('0x3c')]+'%'};return _0x4b9423;}})});}_0x331983=_[_0xd823('0x3e')]({},_0x331983,_0x17d2b4[_0xd823('0x3f')]);var _0x16baad={'where':_0x331983['where']};return db[_0xd823('0x29')][_0xd823('0x40')](_0x16baad)[_0xd823('0x23')](function(_0x166e21){_0x344c53['count']=_0x166e21;if(_0x17d2b4[_0xd823('0x2e')]['includeAll']){_0x331983['include']=[{'all':!![]}];}return db[_0xd823('0x29')]['findAll'](_0x331983);})[_0xd823('0x23')](function(_0x7c00a){_0x344c53[_0xd823('0x41')]=_0x7c00a;return _0x344c53;})[_0xd823('0x23')](respondWithFilteredResult(_0x19a2ce,_0x331983))[_0xd823('0x42')](handleError(_0x19a2ce,null));};exports[_0xd823('0x43')]=function(_0x3767f4,_0x50e3ed){var _0x5e05e1={'raw':!![],'where':{'id':_0x3767f4[_0xd823('0x44')]['id']}},_0x53c54e={};_0x53c54e[_0xd823('0x33')]=_[_0xd823('0x2f')](db[_0xd823('0x29')][_0xd823('0x45')]);_0x53c54e[_0xd823('0x2e')]=_['keys'](_0x3767f4['query']);_0x53c54e[_0xd823('0x30')]=_['intersection'](_0x53c54e[_0xd823('0x33')],_0x53c54e[_0xd823('0x2e')]);_0x5e05e1[_0xd823('0x32')]=_[_0xd823('0x31')](_0x53c54e[_0xd823('0x33')],qs[_0xd823('0x34')](_0x3767f4[_0xd823('0x2e')][_0xd823('0x34')]));_0x5e05e1['attributes']=_0x5e05e1[_0xd823('0x32')][_0xd823('0x35')]?_0x5e05e1[_0xd823('0x32')]:_0x53c54e[_0xd823('0x33')];if(_0x3767f4[_0xd823('0x2e')]['includeAll']){_0x5e05e1[_0xd823('0x46')]=[{'all':!![]}];}_0x5e05e1=_[_0xd823('0x3e')]({},_0x5e05e1,_0x3767f4[_0xd823('0x3f')]);return db['VoiceMailMessage'][_0xd823('0x47')](_0x5e05e1)[_0xd823('0x23')](handleEntityNotFound(_0x50e3ed,null))['then'](respondWithResult(_0x50e3ed,null))['catch'](handleError(_0x50e3ed,null));};exports[_0xd823('0x48')]=function(_0x15c2b5,_0x223f89){return db[_0xd823('0x29')]['create'](_0x15c2b5['body'],{})['then'](respondWithResult(_0x223f89,0xc9))['catch'](handleError(_0x223f89,null));};exports[_0xd823('0x49')]=function(_0x28ddf3,_0x2bd12f){if(_0x28ddf3[_0xd823('0x4a')]['id']){delete _0x28ddf3[_0xd823('0x4a')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x28ddf3['params']['id']}})[_0xd823('0x23')](handleEntityNotFound(_0x2bd12f,null))[_0xd823('0x23')](saveUpdates(_0x28ddf3[_0xd823('0x4a')],null))[_0xd823('0x23')](respondWithResult(_0x2bd12f,null))[_0xd823('0x42')](handleError(_0x2bd12f,null));};exports[_0xd823('0x4b')]=function(_0x1ba9c1,_0x6ce950){return db[_0xd823('0x29')][_0xd823('0x47')]({'where':{'id':_0x1ba9c1[_0xd823('0x44')]['id']}})[_0xd823('0x23')](handleEntityNotFound(_0x6ce950,null))[_0xd823('0x23')](removeEntity(_0x6ce950,null))['catch'](handleError(_0x6ce950,null));};exports[_0xd823('0x4c')]=function(_0x42b06c,_0x367953,_0x98d8c){return db[_0xd823('0x29')][_0xd823('0x47')]({'where':{'id':_0x42b06c['params']['id']},'attributes':['id',_0xd823('0x4d'),'msg_id']})['then'](handleEntityNotFound(_0x367953,null))[_0xd823('0x23')](function(_0xdde30c){if(_0xdde30c){if(!_0xdde30c[_0xd823('0x4d')]){throw new db['Sequelize']['ValidationError'](_0xd823('0x4e'));}var _0x41a1a0={'Content-Type':_0xd823('0x4f'),'Content-Disposition':'attachment'};if(_0xdde30c[_0xd823('0x50')]){_0x41a1a0[_0xd823('0x51')]=_0xd823('0x52')+_0xdde30c[_0xd823('0x50')]+_0xd823('0x53');}_0x367953[_0xd823('0x1f')](_0x41a1a0);return _0x367953['send'](new Buffer(_0xdde30c[_0xd823('0x4d')]));}})[_0xd823('0x42')](handleError(_0x367953,null));}; \ No newline at end of file +var _0x066b=['error','stack','name','index','VoiceMailMessage','rawAttributes','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','show','params','include','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy'];(function(_0x4c5e5e,_0x384573){var _0x5c764c=function(_0x4119b4){while(--_0x4119b4){_0x4c5e5e['push'](_0x4c5e5e['shift']());}};_0x5c764c(++_0x384573);}(_0x066b,0x1d5));var _0xb066=function(_0x2c9bbb,_0x48c27a){_0x2c9bbb=_0x2c9bbb-0x0;var _0x5981cc=_0x066b[_0x2c9bbb];return _0x5981cc;};'use strict';var emlformat=require(_0xb066('0x0'));var rimraf=require(_0xb066('0x1'));var zipdir=require(_0xb066('0x2'));var jsonpatch=require(_0xb066('0x3'));var rp=require(_0xb066('0x4'));var moment=require(_0xb066('0x5'));var BPromise=require(_0xb066('0x6'));var Mustache=require(_0xb066('0x7'));var util=require(_0xb066('0x8'));var path=require('path');var sox=require(_0xb066('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb066('0xa'));var _=require('lodash');var squel=require(_0xb066('0xb'));var crypto=require(_0xb066('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb066('0xd'));var toCsv=require(_0xb066('0xe'));var querystring=require(_0xb066('0xf'));var Papa=require(_0xb066('0x10'));var Redis=require('ioredis');var authService=require(_0xb066('0x11'));var qs=require(_0xb066('0x12'));var as=require(_0xb066('0x13'));var hardwareService=require(_0xb066('0x14'));var logger=require(_0xb066('0x15'))(_0xb066('0x16'));var utils=require(_0xb066('0x17'));var config=require(_0xb066('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb066('0x19'))['db'];function respondWithStatusCode(_0x420995,_0x5035f3){_0x5035f3=_0x5035f3||0xcc;return function(_0x42b425){if(_0x42b425){return _0x420995[_0xb066('0x1a')](_0x5035f3);}return _0x420995[_0xb066('0x1b')](_0x5035f3)[_0xb066('0x1c')]();};}function respondWithResult(_0x179f25,_0x38dab9){_0x38dab9=_0x38dab9||0xc8;return function(_0x4a5243){if(_0x4a5243){return _0x179f25[_0xb066('0x1b')](_0x38dab9)['json'](_0x4a5243);}};}function respondWithFilteredResult(_0x44a16d,_0x485523){return function(_0x5b4585){if(_0x5b4585){var _0x1254af=typeof _0x485523[_0xb066('0x1d')]===_0xb066('0x1e')&&typeof _0x485523[_0xb066('0x1f')]===_0xb066('0x1e');var _0x2b6666=_0x5b4585[_0xb066('0x20')];var _0x12ec7b=_0x1254af?0x0:_0x485523[_0xb066('0x1d')];var _0x1b5bc4=_0x1254af?_0x5b4585[_0xb066('0x20')]:_0x485523[_0xb066('0x1d')]+_0x485523[_0xb066('0x1f')];var _0x54c6fd;if(_0x1b5bc4>=_0x2b6666){_0x1b5bc4=_0x2b6666;_0x54c6fd=0xc8;}else{_0x54c6fd=0xce;}_0x44a16d['status'](_0x54c6fd);return _0x44a16d[_0xb066('0x21')](_0xb066('0x22'),_0x12ec7b+'-'+_0x1b5bc4+'/'+_0x2b6666)[_0xb066('0x23')](_0x5b4585);}return null;};}function patchUpdates(_0x10e4c3){return function(_0x201460){try{jsonpatch[_0xb066('0x24')](_0x201460,_0x10e4c3,!![]);}catch(_0x30b138){return BPromise[_0xb066('0x25')](_0x30b138);}return _0x201460['save']();};}function saveUpdates(_0x2ebefe,_0x50f578){return function(_0xd3abf3){if(_0xd3abf3){return _0xd3abf3[_0xb066('0x26')](_0x2ebefe)[_0xb066('0x27')](function(_0xf8f4c8){return _0xf8f4c8;});}return null;};}function removeEntity(_0xafb131,_0x4dd414){return function(_0x417624){if(_0x417624){return _0x417624[_0xb066('0x28')]()['then'](function(){_0xafb131[_0xb066('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x582475,_0x1a7a91){return function(_0x404439){if(!_0x404439){_0x582475[_0xb066('0x1a')](0x194);}return _0x404439;};}function handleError(_0x3d8207,_0x1d7aec){_0x1d7aec=_0x1d7aec||0x1f4;return function(_0x2ccde6){logger[_0xb066('0x29')](_0x2ccde6[_0xb066('0x2a')]);if(_0x2ccde6[_0xb066('0x2b')]){delete _0x2ccde6['name'];}_0x3d8207['status'](_0x1d7aec)['send'](_0x2ccde6);};}exports[_0xb066('0x2c')]=function(_0x579de3,_0x3e6ce0){var _0x44ae23={},_0x53fb6d={},_0x4b3f44={'count':0x0,'rows':[]};var _0xaa726a=_['map'](db[_0xb066('0x2d')][_0xb066('0x2e')],function(_0xe55a73){return{'name':_0xe55a73['fieldName'],'type':_0xe55a73[_0xb066('0x2f')]['key']};});_0x53fb6d[_0xb066('0x30')]=_[_0xb066('0x31')](_['map'](_0xaa726a,_0xb066('0x2b')),[_0xb066('0x2b')]);_0x53fb6d[_0xb066('0x32')]=_[_0xb066('0x33')](_0x579de3['query']);_0x53fb6d[_0xb066('0x34')]=_[_0xb066('0x35')](_0x53fb6d[_0xb066('0x30')],_0x53fb6d[_0xb066('0x32')]);_0x44ae23[_0xb066('0x36')]=_[_0xb066('0x35')](_0x53fb6d[_0xb066('0x30')],qs[_0xb066('0x37')](_0x579de3[_0xb066('0x32')]['fields']));_0x44ae23[_0xb066('0x36')]=_0x44ae23[_0xb066('0x36')][_0xb066('0x38')]?_0x44ae23[_0xb066('0x36')]:_0x53fb6d[_0xb066('0x30')];if(!_0x579de3[_0xb066('0x32')]['hasOwnProperty'](_0xb066('0x39'))){_0x44ae23['limit']=qs[_0xb066('0x1f')](_0x579de3[_0xb066('0x32')][_0xb066('0x1f')]);_0x44ae23[_0xb066('0x1d')]=qs[_0xb066('0x1d')](_0x579de3[_0xb066('0x32')]['offset']);}_0x44ae23[_0xb066('0x3a')]=qs[_0xb066('0x3b')](_0x579de3['query'][_0xb066('0x3b')]);_0x44ae23[_0xb066('0x3c')]=qs[_0xb066('0x34')](_[_0xb066('0x3d')](_0x579de3[_0xb066('0x32')],_0x53fb6d[_0xb066('0x34')]),_0xaa726a);if(_0x579de3[_0xb066('0x32')][_0xb066('0x3e')]){_0x44ae23['where']=_[_0xb066('0x3f')](_0x44ae23[_0xb066('0x3c')],{'$or':_[_0xb066('0x40')](_0xaa726a,function(_0x9bc557){if(_0x9bc557[_0xb066('0x2f')]!=='VIRTUAL'){var _0x309869={};_0x309869[_0x9bc557[_0xb066('0x2b')]]={'$like':'%'+_0x579de3[_0xb066('0x32')][_0xb066('0x3e')]+'%'};return _0x309869;}})});}_0x44ae23=_[_0xb066('0x3f')]({},_0x44ae23,_0x579de3['options']);var _0xce31fa={'where':_0x44ae23[_0xb066('0x3c')]};return db['VoiceMailMessage'][_0xb066('0x20')](_0xce31fa)['then'](function(_0x4704c4){_0x4b3f44[_0xb066('0x20')]=_0x4704c4;if(_0x579de3['query'][_0xb066('0x41')]){_0x44ae23['include']=[{'all':!![]}];}return db[_0xb066('0x2d')][_0xb066('0x42')](_0x44ae23);})[_0xb066('0x27')](function(_0x383d08){_0x4b3f44[_0xb066('0x43')]=_0x383d08;return _0x4b3f44;})[_0xb066('0x27')](respondWithFilteredResult(_0x3e6ce0,_0x44ae23))[_0xb066('0x44')](handleError(_0x3e6ce0,null));};exports[_0xb066('0x45')]=function(_0x41fd1a,_0x57586a){var _0x303192={'raw':!![],'where':{'id':_0x41fd1a[_0xb066('0x46')]['id']}},_0x328fb1={};_0x328fb1['model']=_[_0xb066('0x33')](db['VoiceMailMessage'][_0xb066('0x2e')]);_0x328fb1[_0xb066('0x32')]=_[_0xb066('0x33')](_0x41fd1a[_0xb066('0x32')]);_0x328fb1['filters']=_['intersection'](_0x328fb1[_0xb066('0x30')],_0x328fb1[_0xb066('0x32')]);_0x303192[_0xb066('0x36')]=_[_0xb066('0x35')](_0x328fb1['model'],qs[_0xb066('0x37')](_0x41fd1a[_0xb066('0x32')][_0xb066('0x37')]));_0x303192[_0xb066('0x36')]=_0x303192[_0xb066('0x36')][_0xb066('0x38')]?_0x303192['attributes']:_0x328fb1[_0xb066('0x30')];if(_0x41fd1a[_0xb066('0x32')][_0xb066('0x41')]){_0x303192[_0xb066('0x47')]=[{'all':!![]}];}_0x303192=_[_0xb066('0x3f')]({},_0x303192,_0x41fd1a['options']);return db[_0xb066('0x2d')][_0xb066('0x48')](_0x303192)['then'](handleEntityNotFound(_0x57586a,null))[_0xb066('0x27')](respondWithResult(_0x57586a,null))[_0xb066('0x44')](handleError(_0x57586a,null));};exports[_0xb066('0x49')]=function(_0x5ee620,_0x4f3552){return db[_0xb066('0x2d')]['create'](_0x5ee620[_0xb066('0x4a')],{})['then'](respondWithResult(_0x4f3552,0xc9))[_0xb066('0x44')](handleError(_0x4f3552,null));};exports[_0xb066('0x26')]=function(_0x506742,_0x5c307e){if(_0x506742[_0xb066('0x4a')]['id']){delete _0x506742[_0xb066('0x4a')]['id'];}return db[_0xb066('0x2d')]['find']({'where':{'id':_0x506742[_0xb066('0x46')]['id']}})[_0xb066('0x27')](handleEntityNotFound(_0x5c307e,null))['then'](saveUpdates(_0x506742[_0xb066('0x4a')],null))[_0xb066('0x27')](respondWithResult(_0x5c307e,null))[_0xb066('0x44')](handleError(_0x5c307e,null));};exports[_0xb066('0x28')]=function(_0xbe8010,_0x28a25e){return db[_0xb066('0x2d')]['find']({'where':{'id':_0xbe8010[_0xb066('0x46')]['id']}})['then'](handleEntityNotFound(_0x28a25e,null))[_0xb066('0x27')](removeEntity(_0x28a25e,null))[_0xb066('0x44')](handleError(_0x28a25e,null));};exports[_0xb066('0x4b')]=function(_0xafa470,_0x40de34,_0x412c34){return db['VoiceMailMessage'][_0xb066('0x48')]({'where':{'id':_0xafa470['params']['id']},'attributes':['id',_0xb066('0x4c'),_0xb066('0x4d')]})['then'](handleEntityNotFound(_0x40de34,null))[_0xb066('0x27')](function(_0x45149e){if(_0x45149e){if(!_0x45149e['recording']){throw new db[(_0xb066('0x4e'))][(_0xb066('0x4f'))](_0xb066('0x50'));}var _0x33bf1f={'Content-Type':_0xb066('0x51'),'Content-Disposition':_0xb066('0x52')};if(_0x45149e[_0xb066('0x4d')]){_0x33bf1f['Content-Disposition']='attachment;\x20filename=\x22'+_0x45149e['msg_id']+_0xb066('0x53');}_0x40de34['set'](_0x33bf1f);return _0x40de34[_0xb066('0x54')](new Buffer(_0x45149e['recording']));}})[_0xb066('0x44')](handleError(_0x40de34,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5bb3c47..b5a16f7 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 _0x0663=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0663,0x16a));var _0x3066=function(_0x2ca1ff,_0x5ac0b0){_0x2ca1ff=_0x2ca1ff-0x0;var _0x4504fa=_0x0663[_0x2ca1ff];return _0x4504fa;};'use strict';var _=require('lodash');var util=require(_0x3066('0x0'));var logger=require(_0x3066('0x1'))(_0x3066('0x2'));var moment=require(_0x3066('0x3'));var BPromise=require(_0x3066('0x4'));var rp=require(_0x3066('0x5'));var fs=require('fs');var path=require(_0x3066('0x6'));var rimraf=require(_0x3066('0x7'));var config=require(_0x3066('0x8'));var attributes=require(_0x3066('0x9'));module[_0x3066('0xa')]=function(_0xefcda4,_0x29928c){return _0xefcda4[_0x3066('0xb')]('VoiceMailMessage',attributes,{'tableName':_0x3066('0xc'),'paranoid':![],'indexes':[{'name':_0x3066('0xd'),'fields':[_0x3066('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x05dc=['lodash','util','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x2c670e,_0x481dc2){var _0x5f386e=function(_0x2a4477){while(--_0x2a4477){_0x2c670e['push'](_0x2c670e['shift']());}};_0x5f386e(++_0x481dc2);}(_0x05dc,0x155));var _0xc05d=function(_0x22f53f,_0x14ef66){_0x22f53f=_0x22f53f-0x0;var _0x57bc67=_0x05dc[_0x22f53f];return _0x57bc67;};'use strict';var _=require(_0xc05d('0x0'));var util=require(_0xc05d('0x1'));var logger=require('../../config/logger')(_0xc05d('0x2'));var moment=require(_0xc05d('0x3'));var BPromise=require(_0xc05d('0x4'));var rp=require(_0xc05d('0x5'));var fs=require('fs');var path=require(_0xc05d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc05d('0x7'));module['exports']=function(_0xfa648f,_0x303213){return _0xfa648f['define'](_0xc05d('0x8'),attributes,{'tableName':_0xc05d('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xc05d('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 654b185..285ef4a 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 _0x8ee9=['moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x8ee9,0x129));var _0x98ee=function(_0x196db5,_0xc0dd0e){_0x196db5=_0x196db5-0x0;var _0xc196ed=_0x8ee9[_0x196db5];return _0xc196ed;};'use strict';var _=require(_0x98ee('0x0'));var util=require(_0x98ee('0x1'));var moment=require(_0x98ee('0x2'));var BPromise=require(_0x98ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x98ee('0x5'));var config=require(_0x98ee('0x6'));var jayson=require(_0x98ee('0x7'));var client=jayson[_0x98ee('0x8')][_0x98ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a976a,_0x4201da,_0x13a7c6){return new BPromise(function(_0x4b65e8,_0x406a40){return client[_0x98ee('0xa')](_0x2a976a,_0x13a7c6)[_0x98ee('0xb')](function(_0x5a007f){logger['info'](_0x98ee('0xc'),_0x4201da,'request\x20sent');logger[_0x98ee('0xd')](_0x98ee('0xe'),_0x4201da,_0x98ee('0xf'),JSON[_0x98ee('0x10')](_0x5a007f));if(_0x5a007f[_0x98ee('0x11')]){if(_0x5a007f[_0x98ee('0x11')][_0x98ee('0x12')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4201da,_0x5a007f[_0x98ee('0x11')]['message']);return _0x406a40(_0x5a007f[_0x98ee('0x11')][_0x98ee('0x13')]);}logger[_0x98ee('0x11')](_0x98ee('0xc'),_0x4201da,_0x5a007f[_0x98ee('0x11')][_0x98ee('0x13')]);return _0x4b65e8(_0x5a007f['error'][_0x98ee('0x13')]);}else{logger[_0x98ee('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x4201da,_0x98ee('0xf'));_0x4b65e8(_0x5a007f[_0x98ee('0x15')][_0x98ee('0x13')]);}})[_0x98ee('0x16')](function(_0x25a4f6){logger[_0x98ee('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x4201da,_0x25a4f6);_0x406a40(_0x25a4f6);});});} \ No newline at end of file +var _0xa5e6=['../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa5e6,0x119));var _0x6a5e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa5e6[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x6a5e('0x0'));var util=require(_0x6a5e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a5e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a5e('0x3'))['db'];var utils=require(_0x6a5e('0x4'));var logger=require(_0x6a5e('0x5'))(_0x6a5e('0x6'));var config=require(_0x6a5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6a5e('0x8')][_0x6a5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e443a,_0x2d8d59,_0x3d4809){return new BPromise(function(_0x19f686,_0x3e1479){return client[_0x6a5e('0xa')](_0x4e443a,_0x3d4809)[_0x6a5e('0xb')](function(_0x589562){logger['info'](_0x6a5e('0xc'),_0x2d8d59,'request\x20sent');logger[_0x6a5e('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2d8d59,'request\x20sent',JSON[_0x6a5e('0xe')](_0x589562));if(_0x589562[_0x6a5e('0xf')]){if(_0x589562[_0x6a5e('0xf')][_0x6a5e('0x10')]===0x1f4){logger[_0x6a5e('0xf')](_0x6a5e('0xc'),_0x2d8d59,_0x589562['error'][_0x6a5e('0x11')]);return _0x3e1479(_0x589562[_0x6a5e('0xf')][_0x6a5e('0x11')]);}logger[_0x6a5e('0xf')](_0x6a5e('0xc'),_0x2d8d59,_0x589562[_0x6a5e('0xf')][_0x6a5e('0x11')]);return _0x19f686(_0x589562['error'][_0x6a5e('0x11')]);}else{logger[_0x6a5e('0x12')](_0x6a5e('0xc'),_0x2d8d59,_0x6a5e('0x13'));_0x19f686(_0x589562[_0x6a5e('0x14')]['message']);}})[_0x6a5e('0x15')](function(_0xeb92f2){logger['error'](_0x6a5e('0xc'),_0x2d8d59,_0xeb92f2);_0x3e1479(_0xeb92f2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index eea8d3a..d555ea7 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 _0xb6b6=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x1d0b74,_0x2b9295){var _0x1c18e7=function(_0x2c06e0){while(--_0x2c06e0){_0x1d0b74['push'](_0x1d0b74['shift']());}};_0x1c18e7(++_0x2b9295);}(_0xb6b6,0x19d));var _0x6b6b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb6b6[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x6b6b('0x0'));var util=require(_0x6b6b('0x1'));var path=require(_0x6b6b('0x2'));var timeout=require(_0x6b6b('0x3'));var express=require(_0x6b6b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b6b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b6b('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x6b6b('0x7')]('/',auth[_0x6b6b('0x8')](),controller[_0x6b6b('0x9')]);router['get'](_0x6b6b('0xa'),auth[_0x6b6b('0x8')](),controller[_0x6b6b('0xb')]);router[_0x6b6b('0x7')](_0x6b6b('0xc'),auth['isAuthenticated'](),controller[_0x6b6b('0xd')]);router['post']('/',auth[_0x6b6b('0x8')](),controller[_0x6b6b('0xe')]);router['post'](_0x6b6b('0xc'),auth[_0x6b6b('0x8')](),controller[_0x6b6b('0xf')]);router[_0x6b6b('0x10')](_0x6b6b('0xa'),auth[_0x6b6b('0x8')](),controller[_0x6b6b('0x11')]);router[_0x6b6b('0x12')](_0x6b6b('0xa'),auth[_0x6b6b('0x8')](),controller[_0x6b6b('0x13')]);router[_0x6b6b('0x12')](_0x6b6b('0x14'),auth[_0x6b6b('0x8')](),controller[_0x6b6b('0x15')]);module[_0x6b6b('0x16')]=router; \ No newline at end of file +var _0xfea2=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','/:id/sounds/:id2','multer','path','Router','../../components/auth/service'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xfea2,0xba));var _0x2fea=function(_0x4da62b,_0x469719){_0x4da62b=_0x4da62b-0x0;var _0x39bb0c=_0xfea2[_0x4da62b];return _0x39bb0c;};'use strict';var multer=require(_0x2fea('0x0'));var util=require('util');var path=require(_0x2fea('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fea('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2fea('0x3'));var interaction=require(_0x2fea('0x4'));var config=require(_0x2fea('0x5'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x2fea('0x6')](),controller[_0x2fea('0x7')]);router[_0x2fea('0x8')](_0x2fea('0x9'),auth[_0x2fea('0x6')](),controller['show']);router[_0x2fea('0x8')](_0x2fea('0xa'),auth['isAuthenticated'](),controller[_0x2fea('0xb')]);router[_0x2fea('0xc')]('/',auth[_0x2fea('0x6')](),controller[_0x2fea('0xd')]);router[_0x2fea('0xc')](_0x2fea('0xa'),auth[_0x2fea('0x6')](),controller[_0x2fea('0xe')]);router[_0x2fea('0xf')](_0x2fea('0x9'),auth['isAuthenticated'](),controller[_0x2fea('0x10')]);router[_0x2fea('0x11')]('/:id',auth[_0x2fea('0x6')](),controller['destroy']);router[_0x2fea('0x11')](_0x2fea('0x12'),auth[_0x2fea('0x6')](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f89b5fc..59bb61b 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 _0x9301=['name','files','quietmp3nb','quietmp3','mp3','alpha','BOOLEAN','sequelize','exports','STRING'];(function(_0x2398f7,_0x999073){var _0x2c5cc4=function(_0x340fb0){while(--_0x340fb0){_0x2398f7['push'](_0x2398f7['shift']());}};_0x2c5cc4(++_0x999073);}(_0x9301,0x1bf));var _0x1930=function(_0x291461,_0x47f5c4){_0x291461=_0x291461-0x0;var _0x42370a=_0x9301[_0x291461];return _0x42370a;};'use strict';var Sequelize=require(_0x1930('0x0'));module[_0x1930('0x1')]={'name':{'type':Sequelize[_0x1930('0x2')],'allowNull':![],'unique':_0x1930('0x3')},'mode':{'type':Sequelize['ENUM']('custom',_0x1930('0x4'),'mp3nb',_0x1930('0x5'),_0x1930('0x6'),_0x1930('0x7')),'allowNull':!![],'defaultValue':_0x1930('0x4')},'directory':{'type':Sequelize[_0x1930('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x1930('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1930('0x8')},'format':{'type':Sequelize[_0x1930('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x1930('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x96af=['alpha','TIMESTAMP','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','mp3'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x96af,0xca));var _0xf96a=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x96af[_0x33c603];return _0xae96f4;};'use strict';var Sequelize=require('sequelize');module[_0xf96a('0x0')]={'name':{'type':Sequelize[_0xf96a('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xf96a('0x2')](_0xf96a('0x3'),_0xf96a('0x4'),_0xf96a('0x5'),_0xf96a('0x6'),'quietmp3',_0xf96a('0x7')),'allowNull':!![],'defaultValue':_0xf96a('0x4')},'directory':{'type':Sequelize[_0xf96a('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xf96a('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf96a('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf96a('0x1')],'allowNull':!![],'defaultValue':_0xf96a('0x8')},'format':{'type':Sequelize[_0xf96a('0x1')],'allowNull':!![]},'stamp':{'type':_0xf96a('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index d900a14..817e12d 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 _0x756d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','params','body','create','sequelize','directory','root','server/files/moh','mode','files','mkdirSync','0777','user','userProfileId','transaction','readdirSync','unlinkSync','join','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','extname','%s.%s','symlinkSync','message','removeSound','id2','getSounds','order','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','fs-extra','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x756d,0x12e));var _0xd756=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x756d[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xd756('0x0'));var rimraf=require(_0xd756('0x1'));var zipdir=require(_0xd756('0x2'));var jsonpatch=require(_0xd756('0x3'));var rp=require(_0xd756('0x4'));var moment=require(_0xd756('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd756('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(_0xd756('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd756('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd756('0x9'));var toCsv=require(_0xd756('0xa'));var querystring=require(_0xd756('0xb'));var Papa=require(_0xd756('0xc'));var Redis=require(_0xd756('0xd'));var authService=require(_0xd756('0xe'));var qs=require(_0xd756('0xf'));var as=require(_0xd756('0x10'));var hardwareService=require(_0xd756('0x11'));var logger=require(_0xd756('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd756('0x13'));var licenseUtil=require(_0xd756('0x14'));var db=require(_0xd756('0x15'))['db'];function respondWithStatusCode(_0x518479,_0x49d002){_0x49d002=_0x49d002||0xcc;return function(_0x15ab6f){if(_0x15ab6f){return _0x518479['sendStatus'](_0x49d002);}return _0x518479[_0xd756('0x16')](_0x49d002)[_0xd756('0x17')]();};}function respondWithResult(_0x4fd64e,_0x5f1cbb){_0x5f1cbb=_0x5f1cbb||0xc8;return function(_0x428831){if(_0x428831){return _0x4fd64e[_0xd756('0x16')](_0x5f1cbb)[_0xd756('0x18')](_0x428831);}};}function respondWithFilteredResult(_0x50efaa,_0x8dc42b){return function(_0x3bf848){if(_0x3bf848){var _0x2bb3c1=typeof _0x8dc42b[_0xd756('0x19')]==='undefined'&&typeof _0x8dc42b[_0xd756('0x1a')]===_0xd756('0x1b');var _0x2b512b=_0x3bf848[_0xd756('0x1c')];var _0x204bbc=_0x2bb3c1?0x0:_0x8dc42b[_0xd756('0x19')];var _0x220214=_0x2bb3c1?_0x3bf848[_0xd756('0x1c')]:_0x8dc42b[_0xd756('0x19')]+_0x8dc42b['limit'];var _0x2945f8;if(_0x220214>=_0x2b512b){_0x220214=_0x2b512b;_0x2945f8=0xc8;}else{_0x2945f8=0xce;}_0x50efaa[_0xd756('0x16')](_0x2945f8);return _0x50efaa[_0xd756('0x1d')](_0xd756('0x1e'),_0x204bbc+'-'+_0x220214+'/'+_0x2b512b)[_0xd756('0x18')](_0x3bf848);}return null;};}function patchUpdates(_0x2d3e71){return function(_0x4e1036){try{jsonpatch[_0xd756('0x1f')](_0x4e1036,_0x2d3e71,!![]);}catch(_0x40f638){return BPromise[_0xd756('0x20')](_0x40f638);}return _0x4e1036[_0xd756('0x21')]();};}function saveUpdates(_0x32a3a2,_0x24cc72){return function(_0x3568f5){if(_0x3568f5){return _0x3568f5['update'](_0x32a3a2)[_0xd756('0x22')](function(_0x3e9be5){return _0x3e9be5;});}return null;};}function removeEntity(_0x8a5b5d,_0x3653ce){return function(_0x433c4d){if(_0x433c4d){return _0x433c4d[_0xd756('0x23')]()[_0xd756('0x22')](function(){var _0x12e989=_0x433c4d['get']({'plain':!![]});var _0x3ac95a=_0xd756('0x24');return db[_0xd756('0x25')]['destroy']({'where':{'type':_0x3ac95a,'resourceId':_0x12e989['id']}})[_0xd756('0x22')](function(){return _0x433c4d;});})[_0xd756('0x22')](function(){_0x8a5b5d[_0xd756('0x16')](0xcc)[_0xd756('0x17')]();});}};}function handleEntityNotFound(_0x4045eb,_0x2db318){return function(_0x1a8afc){if(!_0x1a8afc){_0x4045eb[_0xd756('0x26')](0x194);}return _0x1a8afc;};}function handleError(_0x33e18f,_0xcf7b87){_0xcf7b87=_0xcf7b87||0x1f4;return function(_0x27d3e0){logger[_0xd756('0x27')](_0x27d3e0[_0xd756('0x28')]);if(_0x27d3e0[_0xd756('0x29')]){delete _0x27d3e0[_0xd756('0x29')];}_0x33e18f[_0xd756('0x16')](_0xcf7b87)['send'](_0x27d3e0);};}exports[_0xd756('0x2a')]=function(_0x507ee7,_0x45dd1c){var _0xfa32b0={},_0x43e25a={},_0x44f5e9={'count':0x0,'rows':[]};var _0x4d9e77=_['map'](db[_0xd756('0x2b')][_0xd756('0x2c')],function(_0x134f88){return{'name':_0x134f88[_0xd756('0x2d')],'type':_0x134f88['type']['key']};});_0x43e25a[_0xd756('0x2e')]=_[_0xd756('0x2f')](_0x4d9e77,_0xd756('0x29'));_0x43e25a[_0xd756('0x30')]=_[_0xd756('0x31')](_0x507ee7[_0xd756('0x30')]);_0x43e25a[_0xd756('0x32')]=_['intersection'](_0x43e25a[_0xd756('0x2e')],_0x43e25a[_0xd756('0x30')]);_0xfa32b0[_0xd756('0x33')]=_[_0xd756('0x34')](_0x43e25a[_0xd756('0x2e')],qs[_0xd756('0x35')](_0x507ee7[_0xd756('0x30')][_0xd756('0x35')]));_0xfa32b0[_0xd756('0x33')]=_0xfa32b0[_0xd756('0x33')][_0xd756('0x36')]?_0xfa32b0['attributes']:_0x43e25a[_0xd756('0x2e')];if(!_0x507ee7[_0xd756('0x30')]['hasOwnProperty']('nolimit')){_0xfa32b0['limit']=qs['limit'](_0x507ee7[_0xd756('0x30')][_0xd756('0x1a')]);_0xfa32b0[_0xd756('0x19')]=qs[_0xd756('0x19')](_0x507ee7[_0xd756('0x30')][_0xd756('0x19')]);}_0xfa32b0['order']=qs['sort'](_0x507ee7[_0xd756('0x30')][_0xd756('0x37')]);delete _0x507ee7[_0xd756('0x30')][_0xd756('0x37')];_0xfa32b0[_0xd756('0x38')]=qs[_0xd756('0x32')](_['pick'](_0x507ee7['query'],_0x43e25a[_0xd756('0x32')]),_0x4d9e77);if(_0x507ee7[_0xd756('0x30')][_0xd756('0x39')]){_0xfa32b0[_0xd756('0x38')]=_['merge'](_0xfa32b0['where'],{'$or':_['map'](_0x4d9e77,function(_0x5511f9){if(_0x5511f9['type']!=='VIRTUAL'){var _0x524367={};_0x524367[_0x5511f9['name']]={'$like':'%'+_0x507ee7[_0xd756('0x30')][_0xd756('0x39')]+'%'};return _0x524367;}})});}_0xfa32b0=_[_0xd756('0x3a')]({},_0xfa32b0,_0x507ee7[_0xd756('0x3b')]);var _0x174577={'where':_0xfa32b0[_0xd756('0x38')]};return db[_0xd756('0x2b')][_0xd756('0x1c')](_0x174577)['then'](function(_0x32afaa){_0x44f5e9[_0xd756('0x1c')]=_0x32afaa;if(_0x507ee7[_0xd756('0x30')][_0xd756('0x3c')]){_0xfa32b0['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xd756('0x3d')](_0xfa32b0);})[_0xd756('0x22')](function(_0x4227fe){_0x44f5e9[_0xd756('0x3e')]=_0x4227fe;return _0x44f5e9;})['then'](respondWithFilteredResult(_0x45dd1c,_0xfa32b0))[_0xd756('0x3f')](handleError(_0x45dd1c,null));};exports[_0xd756('0x40')]=function(_0x1aa03d,_0x4f59e2){var _0x92787={'raw':![],'where':{'id':_0x1aa03d['params']['id']}},_0x48eaa5={};_0x48eaa5[_0xd756('0x2e')]=_[_0xd756('0x31')](db[_0xd756('0x2b')]['rawAttributes']);_0x48eaa5[_0xd756('0x30')]=_['keys'](_0x1aa03d[_0xd756('0x30')]);_0x48eaa5[_0xd756('0x32')]=_[_0xd756('0x34')](_0x48eaa5[_0xd756('0x2e')],_0x48eaa5['query']);_0x92787[_0xd756('0x33')]=_['intersection'](_0x48eaa5[_0xd756('0x2e')],qs[_0xd756('0x35')](_0x1aa03d['query']['fields']));_0x92787[_0xd756('0x33')]=_0x92787[_0xd756('0x33')][_0xd756('0x36')]?_0x92787[_0xd756('0x33')]:_0x48eaa5[_0xd756('0x2e')];if(_0x1aa03d['query'][_0xd756('0x3c')]){_0x92787[_0xd756('0x41')]=[{'all':!![]}];}_0x92787=_['merge']({},_0x92787,_0x1aa03d[_0xd756('0x3b')]);return db[_0xd756('0x2b')][_0xd756('0x42')](_0x92787)['then'](handleEntityNotFound(_0x4f59e2,null))[_0xd756('0x22')](respondWithResult(_0x4f59e2,null))[_0xd756('0x3f')](handleError(_0x4f59e2,null));};exports['update']=function(_0x22ca6b,_0x9642af){if(_0x22ca6b['body']['id']){delete _0x22ca6b['body']['id'];}return db[_0xd756('0x2b')][_0xd756('0x42')]({'where':{'id':_0x22ca6b[_0xd756('0x43')]['id']}})[_0xd756('0x22')](handleEntityNotFound(_0x9642af,null))[_0xd756('0x22')](saveUpdates(_0x22ca6b[_0xd756('0x44')],null))[_0xd756('0x22')](respondWithResult(_0x9642af,null))['catch'](handleError(_0x9642af,null));};exports[_0xd756('0x45')]=function(_0x3277bc,_0x45c09d,_0xf733c3){return db[_0xd756('0x46')]['transaction'](function(_0x148d8e){if(_0x3277bc['body']['mode']==='files'){_0x3277bc[_0xd756('0x44')][_0xd756('0x47')]=path['join'](config[_0xd756('0x48')],_0xd756('0x49'),_0x3277bc[_0xd756('0x44')][_0xd756('0x29')]);}return db['VoiceMusicOnHold'][_0xd756('0x45')](_0x3277bc[_0xd756('0x44')],{'transaction':_0x148d8e})['then'](function(_0x10fc65){if(_0x3277bc['body'][_0xd756('0x4a')]===_0xd756('0x4b')){fs[_0xd756('0x4c')](_0x10fc65[_0xd756('0x47')],parseInt(_0xd756('0x4d'),0x8));}var _0x30210b=_0x3277bc[_0xd756('0x4e')]['get']({'plain':!![]});if(!_0x30210b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30210b['role']==='user'){var _0x5ca2e0=_0x10fc65['get']({'plain':!![]});return db['UserProfileSection'][_0xd756('0x42')]({'where':{'name':_0xd756('0x24'),'userProfileId':_0x30210b[_0xd756('0x4f')]},'raw':!![]})['then'](function(_0x342e7c){if(_0x342e7c&&_0x342e7c['autoAssociation']===0x0){return db['UserProfileResource'][_0xd756('0x45')]({'name':_0x5ca2e0[_0xd756('0x29')],'resourceId':_0x5ca2e0['id'],'type':_0x342e7c[_0xd756('0x29')],'sectionId':_0x342e7c['id']},{})[_0xd756('0x22')](function(){return _0x10fc65;});}else{return _0x10fc65;}})['catch'](function(_0x39727c){logger[_0xd756('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39727c);});}return _0x10fc65;});})['then'](respondWithResult(_0x45c09d,0xc9))['catch'](handleError(_0x45c09d,null));};exports['destroy']=function(_0x384890,_0x42558a,_0x9970a7){var _0x18464e;return db['VoiceMusicOnHold'][_0xd756('0x42')]({'where':{'id':_0x384890[_0xd756('0x43')]['id']}})['then'](function(_0x5e0fde){if(_0x5e0fde){return db[_0xd756('0x46')][_0xd756('0x50')](function(_0x1defa1){return _0x5e0fde[_0xd756('0x23')]({'transaction':_0x1defa1,'raw':!![]})[_0xd756('0x22')](function(_0x1e106e){if(_0x1e106e['directory']){fs[_0xd756('0x51')](_0x1e106e[_0xd756('0x47')])['forEach'](function(_0x4e0a01){fs[_0xd756('0x52')](path[_0xd756('0x53')](_0x1e106e['directory'],_0x4e0a01));});fs[_0xd756('0x54')](_0x1e106e[_0xd756('0x47')]);}return _0x1e106e;});})[_0xd756('0x3f')](function(_0x5c178a){throw new db[(_0xd756('0x55'))][(_0xd756('0x56'))](_0x5c178a['message']);});}})[_0xd756('0x22')](handleEntityNotFound(_0x42558a,null))[_0xd756('0x22')](removeEntity(_0x42558a,null))[_0xd756('0x3f')](handleError(_0x42558a,null));};exports[_0xd756('0x57')]=function(_0x35257e,_0x29e633,_0x284a6f){return db[_0xd756('0x46')][_0xd756('0x50')](function(_0x15636f){var _0x31898c;return db[_0xd756('0x2b')][_0xd756('0x42')]({'where':{'id':_0x35257e[_0xd756('0x43')]['id']}})[_0xd756('0x22')](function(_0x14a5a6){if(_0x14a5a6){_0x31898c=_0x14a5a6;return _0x14a5a6[_0xd756('0x57')](_0x35257e[_0xd756('0x44')]['id'],{'transaction':_0x15636f});}})[_0xd756('0x22')](function(_0x5e73c5){if(_0x5e73c5){return db[_0xd756('0x58')][_0xd756('0x59')]({'where':{'id':_0x35257e[_0xd756('0x44')]['id']},'attributes':['id',_0xd756('0x29'),_0xd756('0x5a'),_0xd756('0x5b'),_0xd756('0x5c')],'raw':!![]});}})['then'](function(_0x1ef4d6){if(_0x1ef4d6){var _0x3b0343=path[_0xd756('0x53')](config['root'],_0xd756('0x5d'),util[_0xd756('0x5e')]('%s.%s',path['basename'](_0x1ef4d6[_0xd756('0x5a')],path[_0xd756('0x5f')](_0x1ef4d6[_0xd756('0x5a')])),_0x1ef4d6[_0xd756('0x5b')]));var _0x29c893=path[_0xd756('0x53')](config[_0xd756('0x48')],_0xd756('0x49'),_0x31898c[_0xd756('0x29')],util[_0xd756('0x5e')](_0xd756('0x60'),_0x1ef4d6[_0xd756('0x29')],_0x1ef4d6['converted_format']));fs[_0xd756('0x61')](_0x3b0343,_0x29c893);return _0x1ef4d6;}})[_0xd756('0x3f')](function(_0x4244b9){throw new db['Sequelize']['ValidationError'](_0x4244b9[_0xd756('0x62')]);});})[_0xd756('0x22')](handleEntityNotFound(_0x29e633,null))[_0xd756('0x22')](respondWithResult(_0x29e633,0xc9))[_0xd756('0x3f')](handleError(_0x29e633,null));};exports[_0xd756('0x63')]=function(_0x15653c,_0x2fba7f,_0x458018){return db[_0xd756('0x46')]['transaction'](function(_0x168b0d){var _0x27b621;return db[_0xd756('0x2b')][_0xd756('0x59')]({'where':{'id':_0x15653c[_0xd756('0x43')]['id']}})[_0xd756('0x22')](handleEntityNotFound(_0x2fba7f,null))[_0xd756('0x22')](function(_0x26460d){if(_0x26460d){_0x27b621=_0x26460d;return _0x26460d[_0xd756('0x63')](_0x15653c[_0xd756('0x43')][_0xd756('0x64')]);}})[_0xd756('0x22')](function(_0x6eb485){if(_0x6eb485){return db['Sound'][_0xd756('0x59')]({'where':{'id':_0x15653c[_0xd756('0x43')][_0xd756('0x64')]},'attributes':['id',_0xd756('0x29'),_0xd756('0x5a'),_0xd756('0x5b'),_0xd756('0x5c')],'raw':!![]});}})[_0xd756('0x22')](function(_0x43b90f){if(_0x43b90f){fs[_0xd756('0x52')](path[_0xd756('0x53')](_0x27b621[_0xd756('0x47')],util[_0xd756('0x5e')](_0xd756('0x60'),_0x43b90f[_0xd756('0x29')],_0x43b90f[_0xd756('0x5b')])));return _0x43b90f;}})[_0xd756('0x3f')](function(_0xf51774){throw new db[(_0xd756('0x55'))][(_0xd756('0x56'))](_0xf51774[_0xd756('0x62')]);});})[_0xd756('0x22')](handleEntityNotFound(_0x2fba7f,null))[_0xd756('0x22')](respondWithStatusCode(_0x2fba7f,0xcc))[_0xd756('0x3f')](handleError(_0x2fba7f,null));};exports[_0xd756('0x65')]=function(_0x12a8ee,_0x7ad286,_0x2c2123){var _0x5da78a={};var _0x40b997={};var _0x5d07f3;var _0x46dc02;return db[_0xd756('0x2b')][_0xd756('0x59')]({'where':{'id':_0x12a8ee['params']['id']}})[_0xd756('0x22')](handleEntityNotFound(_0x7ad286,null))[_0xd756('0x22')](function(_0x18f070){if(_0x18f070){_0x5d07f3=_0x18f070;_0x40b997[_0xd756('0x2e')]=_['keys'](db['Sound'][_0xd756('0x2c')]);_0x40b997[_0xd756('0x30')]=_[_0xd756('0x31')](_0x12a8ee[_0xd756('0x30')]);_0x40b997[_0xd756('0x32')]=_[_0xd756('0x34')](_0x40b997['model'],_0x40b997[_0xd756('0x30')]);_0x5da78a[_0xd756('0x33')]=_['intersection'](_0x40b997['model'],qs[_0xd756('0x35')](_0x12a8ee[_0xd756('0x30')][_0xd756('0x35')]));_0x5da78a['attributes']=_0x5da78a[_0xd756('0x33')]['length']?_0x5da78a[_0xd756('0x33')]:_0x40b997[_0xd756('0x2e')];_0x5da78a[_0xd756('0x66')]=qs[_0xd756('0x37')](_0x12a8ee[_0xd756('0x30')][_0xd756('0x37')]);_0x5da78a[_0xd756('0x38')]=qs[_0xd756('0x32')](_[_0xd756('0x67')](_0x12a8ee['query'],_0x40b997[_0xd756('0x32')]));if(_0x12a8ee['query']['filter']){_0x5da78a[_0xd756('0x38')]=_[_0xd756('0x3a')](_0x5da78a[_0xd756('0x38')],{'$or':_[_0xd756('0x2f')](_0x5da78a[_0xd756('0x33')],function(_0x229fde){var _0x2cd691={};_0x2cd691[_0x229fde]={'$like':'%'+_0x12a8ee['query'][_0xd756('0x39')]+'%'};return _0x2cd691;})});}_0x5da78a=_[_0xd756('0x3a')]({},_0x5da78a,_0x12a8ee[_0xd756('0x3b')]);return _0x5d07f3[_0xd756('0x65')](_0x5da78a);}})['then'](function(_0x524e17){if(_0x524e17){_0x46dc02=_0x524e17[_0xd756('0x36')];if(!_0x12a8ee[_0xd756('0x30')]['hasOwnProperty'](_0xd756('0x68'))){_0x5da78a[_0xd756('0x1a')]=qs[_0xd756('0x1a')](_0x12a8ee['query']['limit']);_0x5da78a[_0xd756('0x19')]=qs[_0xd756('0x19')](_0x12a8ee['query'][_0xd756('0x19')]);}return _0x5d07f3[_0xd756('0x65')](_0x5da78a);}})[_0xd756('0x22')](function(_0x4a672d){if(_0x4a672d){return _0x4a672d?{'count':_0x46dc02,'rows':_0x4a672d}:null;}})[_0xd756('0x22')](respondWithResult(_0x7ad286,null))[_0xd756('0x3f')](handleError(_0x7ad286,null));}; \ No newline at end of file +var _0x09ca=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VoiceMusicOnHold','includeAll','include','findAll','show','rawAttributes','options','find','catch','body','params','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','extname','%s.%s','removeSound','id2','findOne','getSounds','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject'];(function(_0x1ec7bb,_0x9d6c76){var _0x207e7b=function(_0x2fe48c){while(--_0x2fe48c){_0x1ec7bb['push'](_0x1ec7bb['shift']());}};_0x207e7b(++_0x9d6c76);}(_0x09ca,0xbf));var _0xa09c=function(_0x5ae0c6,_0x4a5119){_0x5ae0c6=_0x5ae0c6-0x0;var _0x3dfb99=_0x09ca[_0x5ae0c6];return _0x3dfb99;};'use strict';var emlformat=require(_0xa09c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa09c('0x1'));var jsonpatch=require(_0xa09c('0x2'));var rp=require(_0xa09c('0x3'));var moment=require('moment');var BPromise=require(_0xa09c('0x4'));var Mustache=require(_0xa09c('0x5'));var util=require(_0xa09c('0x6'));var path=require(_0xa09c('0x7'));var sox=require(_0xa09c('0x8'));var csv=require('to-csv');var ejs=require(_0xa09c('0x9'));var fs=require('fs');var fs_extra=require(_0xa09c('0xa'));var _=require(_0xa09c('0xb'));var squel=require('squel');var crypto=require(_0xa09c('0xc'));var jsforce=require(_0xa09c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa09c('0xe'));var querystring=require(_0xa09c('0xf'));var Papa=require('papaparse');var Redis=require(_0xa09c('0x10'));var authService=require(_0xa09c('0x11'));var qs=require(_0xa09c('0x12'));var as=require(_0xa09c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa09c('0x14'))(_0xa09c('0x15'));var utils=require('../../config/utils');var config=require(_0xa09c('0x16'));var licenseUtil=require(_0xa09c('0x17'));var db=require(_0xa09c('0x18'))['db'];function respondWithStatusCode(_0x1d92ef,_0x4c2845){_0x4c2845=_0x4c2845||0xcc;return function(_0x55e829){if(_0x55e829){return _0x1d92ef[_0xa09c('0x19')](_0x4c2845);}return _0x1d92ef[_0xa09c('0x1a')](_0x4c2845)[_0xa09c('0x1b')]();};}function respondWithResult(_0x9e3871,_0x35fc52){_0x35fc52=_0x35fc52||0xc8;return function(_0x1df8c8){if(_0x1df8c8){return _0x9e3871[_0xa09c('0x1a')](_0x35fc52)[_0xa09c('0x1c')](_0x1df8c8);}};}function respondWithFilteredResult(_0x109175,_0x1d4521){return function(_0x2f7704){if(_0x2f7704){var _0x4dd0c7=typeof _0x1d4521[_0xa09c('0x1d')]==='undefined'&&typeof _0x1d4521[_0xa09c('0x1e')]==='undefined';var _0x555a2a=_0x2f7704[_0xa09c('0x1f')];var _0x38bcf1=_0x4dd0c7?0x0:_0x1d4521[_0xa09c('0x1d')];var _0x53ca71=_0x4dd0c7?_0x2f7704['count']:_0x1d4521[_0xa09c('0x1d')]+_0x1d4521[_0xa09c('0x1e')];var _0x125ebf;if(_0x53ca71>=_0x555a2a){_0x53ca71=_0x555a2a;_0x125ebf=0xc8;}else{_0x125ebf=0xce;}_0x109175[_0xa09c('0x1a')](_0x125ebf);return _0x109175[_0xa09c('0x20')](_0xa09c('0x21'),_0x38bcf1+'-'+_0x53ca71+'/'+_0x555a2a)[_0xa09c('0x1c')](_0x2f7704);}return null;};}function patchUpdates(_0x221ea0){return function(_0x90c1b8){try{jsonpatch['apply'](_0x90c1b8,_0x221ea0,!![]);}catch(_0x3e18bb){return BPromise[_0xa09c('0x22')](_0x3e18bb);}return _0x90c1b8[_0xa09c('0x23')]();};}function saveUpdates(_0x32b013,_0x14da6a){return function(_0xfd4173){if(_0xfd4173){return _0xfd4173[_0xa09c('0x24')](_0x32b013)[_0xa09c('0x25')](function(_0x46fa8b){return _0x46fa8b;});}return null;};}function removeEntity(_0x45b415,_0x369186){return function(_0x574c69){if(_0x574c69){return _0x574c69[_0xa09c('0x26')]()[_0xa09c('0x25')](function(){var _0x3a0064=_0x574c69[_0xa09c('0x27')]({'plain':!![]});var _0x1361a2='MusicOnHolds';return db[_0xa09c('0x28')][_0xa09c('0x26')]({'where':{'type':_0x1361a2,'resourceId':_0x3a0064['id']}})[_0xa09c('0x25')](function(){return _0x574c69;});})[_0xa09c('0x25')](function(){_0x45b415[_0xa09c('0x1a')](0xcc)[_0xa09c('0x1b')]();});}};}function handleEntityNotFound(_0x1e863e,_0x1f4a26){return function(_0x30bb93){if(!_0x30bb93){_0x1e863e['sendStatus'](0x194);}return _0x30bb93;};}function handleError(_0x2c96b0,_0x25ed3d){_0x25ed3d=_0x25ed3d||0x1f4;return function(_0x2a07ba){logger[_0xa09c('0x29')](_0x2a07ba[_0xa09c('0x2a')]);if(_0x2a07ba[_0xa09c('0x2b')]){delete _0x2a07ba[_0xa09c('0x2b')];}_0x2c96b0['status'](_0x25ed3d)[_0xa09c('0x2c')](_0x2a07ba);};}exports[_0xa09c('0x2d')]=function(_0x247f61,_0x39528b){var _0x35f56c={},_0x31c6c7={},_0x31eea2={'count':0x0,'rows':[]};var _0x3a4652=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x56cc97){return{'name':_0x56cc97[_0xa09c('0x2e')],'type':_0x56cc97[_0xa09c('0x2f')][_0xa09c('0x30')]};});_0x31c6c7[_0xa09c('0x31')]=_[_0xa09c('0x32')](_0x3a4652,_0xa09c('0x2b'));_0x31c6c7['query']=_[_0xa09c('0x33')](_0x247f61[_0xa09c('0x34')]);_0x31c6c7['filters']=_[_0xa09c('0x35')](_0x31c6c7[_0xa09c('0x31')],_0x31c6c7[_0xa09c('0x34')]);_0x35f56c['attributes']=_['intersection'](_0x31c6c7[_0xa09c('0x31')],qs[_0xa09c('0x36')](_0x247f61[_0xa09c('0x34')]['fields']));_0x35f56c[_0xa09c('0x37')]=_0x35f56c['attributes'][_0xa09c('0x38')]?_0x35f56c['attributes']:_0x31c6c7[_0xa09c('0x31')];if(!_0x247f61[_0xa09c('0x34')][_0xa09c('0x39')](_0xa09c('0x3a'))){_0x35f56c['limit']=qs['limit'](_0x247f61[_0xa09c('0x34')][_0xa09c('0x1e')]);_0x35f56c[_0xa09c('0x1d')]=qs[_0xa09c('0x1d')](_0x247f61[_0xa09c('0x34')][_0xa09c('0x1d')]);}_0x35f56c[_0xa09c('0x3b')]=qs[_0xa09c('0x3c')](_0x247f61['query'][_0xa09c('0x3c')]);delete _0x247f61[_0xa09c('0x34')][_0xa09c('0x3c')];_0x35f56c[_0xa09c('0x3d')]=qs['filters'](_[_0xa09c('0x3e')](_0x247f61[_0xa09c('0x34')],_0x31c6c7[_0xa09c('0x3f')]),_0x3a4652);if(_0x247f61[_0xa09c('0x34')][_0xa09c('0x40')]){_0x35f56c[_0xa09c('0x3d')]=_['merge'](_0x35f56c[_0xa09c('0x3d')],{'$or':_[_0xa09c('0x32')](_0x3a4652,function(_0x1107d6){if(_0x1107d6[_0xa09c('0x2f')]!=='VIRTUAL'){var _0x283707={};_0x283707[_0x1107d6[_0xa09c('0x2b')]]={'$like':'%'+_0x247f61[_0xa09c('0x34')][_0xa09c('0x40')]+'%'};return _0x283707;}})});}_0x35f56c=_[_0xa09c('0x41')]({},_0x35f56c,_0x247f61['options']);var _0x14af48={'where':_0x35f56c['where']};return db[_0xa09c('0x42')][_0xa09c('0x1f')](_0x14af48)['then'](function(_0xfc2dc2){_0x31eea2['count']=_0xfc2dc2;if(_0x247f61[_0xa09c('0x34')][_0xa09c('0x43')]){_0x35f56c[_0xa09c('0x44')]=[{'all':!![]}];}return db[_0xa09c('0x42')][_0xa09c('0x45')](_0x35f56c);})['then'](function(_0x57b775){_0x31eea2['rows']=_0x57b775;return _0x31eea2;})[_0xa09c('0x25')](respondWithFilteredResult(_0x39528b,_0x35f56c))['catch'](handleError(_0x39528b,null));};exports[_0xa09c('0x46')]=function(_0x351384,_0x46fa61){var _0x2c3695={'raw':![],'where':{'id':_0x351384['params']['id']}},_0xfbe860={};_0xfbe860[_0xa09c('0x31')]=_[_0xa09c('0x33')](db[_0xa09c('0x42')][_0xa09c('0x47')]);_0xfbe860['query']=_[_0xa09c('0x33')](_0x351384['query']);_0xfbe860[_0xa09c('0x3f')]=_[_0xa09c('0x35')](_0xfbe860[_0xa09c('0x31')],_0xfbe860[_0xa09c('0x34')]);_0x2c3695[_0xa09c('0x37')]=_[_0xa09c('0x35')](_0xfbe860[_0xa09c('0x31')],qs[_0xa09c('0x36')](_0x351384[_0xa09c('0x34')][_0xa09c('0x36')]));_0x2c3695[_0xa09c('0x37')]=_0x2c3695['attributes'][_0xa09c('0x38')]?_0x2c3695[_0xa09c('0x37')]:_0xfbe860['model'];if(_0x351384['query'][_0xa09c('0x43')]){_0x2c3695[_0xa09c('0x44')]=[{'all':!![]}];}_0x2c3695=_['merge']({},_0x2c3695,_0x351384[_0xa09c('0x48')]);return db['VoiceMusicOnHold'][_0xa09c('0x49')](_0x2c3695)[_0xa09c('0x25')](handleEntityNotFound(_0x46fa61,null))[_0xa09c('0x25')](respondWithResult(_0x46fa61,null))[_0xa09c('0x4a')](handleError(_0x46fa61,null));};exports[_0xa09c('0x24')]=function(_0x47ea30,_0xf07078){if(_0x47ea30[_0xa09c('0x4b')]['id']){delete _0x47ea30['body']['id'];}return db[_0xa09c('0x42')][_0xa09c('0x49')]({'where':{'id':_0x47ea30[_0xa09c('0x4c')]['id']}})[_0xa09c('0x25')](handleEntityNotFound(_0xf07078,null))[_0xa09c('0x25')](saveUpdates(_0x47ea30[_0xa09c('0x4b')],null))['then'](respondWithResult(_0xf07078,null))['catch'](handleError(_0xf07078,null));};exports[_0xa09c('0x4d')]=function(_0x36626d,_0x553e45,_0x3b3840){return db[_0xa09c('0x4e')][_0xa09c('0x4f')](function(_0x43f8da){if(_0x36626d[_0xa09c('0x4b')][_0xa09c('0x50')]===_0xa09c('0x51')){_0x36626d[_0xa09c('0x4b')]['directory']=path[_0xa09c('0x52')](config[_0xa09c('0x53')],_0xa09c('0x54'),_0x36626d[_0xa09c('0x4b')][_0xa09c('0x2b')]);}return db['VoiceMusicOnHold'][_0xa09c('0x4d')](_0x36626d['body'],{'transaction':_0x43f8da})[_0xa09c('0x25')](function(_0x47633c){if(_0x36626d[_0xa09c('0x4b')]['mode']==='files'){fs[_0xa09c('0x55')](_0x47633c[_0xa09c('0x56')],parseInt(_0xa09c('0x57'),0x8));}var _0x5c1095=_0x36626d['user']['get']({'plain':!![]});if(!_0x5c1095)throw new Error(_0xa09c('0x58'));if(_0x5c1095[_0xa09c('0x59')]==='user'){var _0x523c5d=_0x47633c[_0xa09c('0x27')]({'plain':!![]});return db[_0xa09c('0x5a')]['find']({'where':{'name':_0xa09c('0x5b'),'userProfileId':_0x5c1095[_0xa09c('0x5c')]},'raw':!![]})[_0xa09c('0x25')](function(_0x279c38){if(_0x279c38&&_0x279c38[_0xa09c('0x5d')]===0x0){return db[_0xa09c('0x28')][_0xa09c('0x4d')]({'name':_0x523c5d[_0xa09c('0x2b')],'resourceId':_0x523c5d['id'],'type':_0x279c38[_0xa09c('0x2b')],'sectionId':_0x279c38['id']},{})[_0xa09c('0x25')](function(){return _0x47633c;});}else{return _0x47633c;}})[_0xa09c('0x4a')](function(_0x375bd3){logger[_0xa09c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x375bd3);});}return _0x47633c;});})[_0xa09c('0x25')](respondWithResult(_0x553e45,0xc9))[_0xa09c('0x4a')](handleError(_0x553e45,null));};exports[_0xa09c('0x26')]=function(_0x2bc814,_0x20a7c5,_0x5b5d4e){var _0x301d24;return db[_0xa09c('0x42')][_0xa09c('0x49')]({'where':{'id':_0x2bc814['params']['id']}})[_0xa09c('0x25')](function(_0x5d2880){if(_0x5d2880){return db[_0xa09c('0x4e')]['transaction'](function(_0x217f4e){return _0x5d2880['destroy']({'transaction':_0x217f4e,'raw':!![]})[_0xa09c('0x25')](function(_0x12480b){if(_0x12480b['directory']){fs[_0xa09c('0x5e')](_0x12480b[_0xa09c('0x56')])[_0xa09c('0x5f')](function(_0x41188d){fs[_0xa09c('0x60')](path[_0xa09c('0x52')](_0x12480b[_0xa09c('0x56')],_0x41188d));});fs['rmdirSync'](_0x12480b[_0xa09c('0x56')]);}return _0x12480b;});})[_0xa09c('0x4a')](function(_0x451c91){throw new db[(_0xa09c('0x61'))][(_0xa09c('0x62'))](_0x451c91[_0xa09c('0x63')]);});}})[_0xa09c('0x25')](handleEntityNotFound(_0x20a7c5,null))[_0xa09c('0x25')](removeEntity(_0x20a7c5,null))['catch'](handleError(_0x20a7c5,null));};exports[_0xa09c('0x64')]=function(_0x251e16,_0x45221a,_0x1df117){return db[_0xa09c('0x4e')][_0xa09c('0x4f')](function(_0x3db555){var _0x101ce5;return db[_0xa09c('0x42')]['find']({'where':{'id':_0x251e16[_0xa09c('0x4c')]['id']}})['then'](function(_0x15f2ae){if(_0x15f2ae){_0x101ce5=_0x15f2ae;return _0x15f2ae[_0xa09c('0x64')](_0x251e16[_0xa09c('0x4b')]['id'],{'transaction':_0x3db555});}})['then'](function(_0x24f9b1){if(_0x24f9b1){return db[_0xa09c('0x65')]['findOne']({'where':{'id':_0x251e16[_0xa09c('0x4b')]['id']},'attributes':['id',_0xa09c('0x2b'),_0xa09c('0x66'),_0xa09c('0x67'),_0xa09c('0x68')],'raw':!![]});}})[_0xa09c('0x25')](function(_0x4645ea){if(_0x4645ea){var _0x451319=path['join'](config[_0xa09c('0x53')],_0xa09c('0x69'),util[_0xa09c('0x6a')]('%s.%s',path['basename'](_0x4645ea[_0xa09c('0x66')],path[_0xa09c('0x6b')](_0x4645ea['save_name'])),_0x4645ea[_0xa09c('0x67')]));var _0x429b0d=path[_0xa09c('0x52')](config[_0xa09c('0x53')],'server/files/moh',_0x101ce5[_0xa09c('0x2b')],util[_0xa09c('0x6a')](_0xa09c('0x6c'),_0x4645ea['name'],_0x4645ea['converted_format']));fs['symlinkSync'](_0x451319,_0x429b0d);return _0x4645ea;}})[_0xa09c('0x4a')](function(_0x8b6369){throw new db['Sequelize'][(_0xa09c('0x62'))](_0x8b6369['message']);});})['then'](handleEntityNotFound(_0x45221a,null))[_0xa09c('0x25')](respondWithResult(_0x45221a,0xc9))[_0xa09c('0x4a')](handleError(_0x45221a,null));};exports[_0xa09c('0x6d')]=function(_0x444749,_0x5b0505,_0x5db095){return db[_0xa09c('0x4e')][_0xa09c('0x4f')](function(_0x430ae0){var _0x258015;return db[_0xa09c('0x42')]['findOne']({'where':{'id':_0x444749[_0xa09c('0x4c')]['id']}})[_0xa09c('0x25')](handleEntityNotFound(_0x5b0505,null))[_0xa09c('0x25')](function(_0x2ef5a8){if(_0x2ef5a8){_0x258015=_0x2ef5a8;return _0x2ef5a8[_0xa09c('0x6d')](_0x444749[_0xa09c('0x4c')][_0xa09c('0x6e')]);}})['then'](function(_0x36ee5f){if(_0x36ee5f){return db['Sound']['findOne']({'where':{'id':_0x444749['params'][_0xa09c('0x6e')]},'attributes':['id',_0xa09c('0x2b'),_0xa09c('0x66'),_0xa09c('0x67'),_0xa09c('0x68')],'raw':!![]});}})['then'](function(_0x49dadb){if(_0x49dadb){fs[_0xa09c('0x60')](path['join'](_0x258015[_0xa09c('0x56')],util['format'](_0xa09c('0x6c'),_0x49dadb[_0xa09c('0x2b')],_0x49dadb[_0xa09c('0x67')])));return _0x49dadb;}})['catch'](function(_0x3e296e){throw new db[(_0xa09c('0x61'))][(_0xa09c('0x62'))](_0x3e296e[_0xa09c('0x63')]);});})['then'](handleEntityNotFound(_0x5b0505,null))[_0xa09c('0x25')](respondWithStatusCode(_0x5b0505,0xcc))[_0xa09c('0x4a')](handleError(_0x5b0505,null));};exports['getSounds']=function(_0x501774,_0x3c006d,_0x5e7787){var _0x2cab8e={};var _0x18070d={};var _0x98768;var _0x3c6c7b;return db[_0xa09c('0x42')][_0xa09c('0x6f')]({'where':{'id':_0x501774['params']['id']}})[_0xa09c('0x25')](handleEntityNotFound(_0x3c006d,null))[_0xa09c('0x25')](function(_0xd2efb8){if(_0xd2efb8){_0x98768=_0xd2efb8;_0x18070d[_0xa09c('0x31')]=_['keys'](db[_0xa09c('0x65')][_0xa09c('0x47')]);_0x18070d[_0xa09c('0x34')]=_['keys'](_0x501774[_0xa09c('0x34')]);_0x18070d[_0xa09c('0x3f')]=_[_0xa09c('0x35')](_0x18070d[_0xa09c('0x31')],_0x18070d[_0xa09c('0x34')]);_0x2cab8e[_0xa09c('0x37')]=_[_0xa09c('0x35')](_0x18070d['model'],qs[_0xa09c('0x36')](_0x501774[_0xa09c('0x34')]['fields']));_0x2cab8e[_0xa09c('0x37')]=_0x2cab8e['attributes'][_0xa09c('0x38')]?_0x2cab8e[_0xa09c('0x37')]:_0x18070d[_0xa09c('0x31')];_0x2cab8e[_0xa09c('0x3b')]=qs[_0xa09c('0x3c')](_0x501774['query'][_0xa09c('0x3c')]);_0x2cab8e[_0xa09c('0x3d')]=qs['filters'](_['pick'](_0x501774[_0xa09c('0x34')],_0x18070d[_0xa09c('0x3f')]));if(_0x501774['query'][_0xa09c('0x40')]){_0x2cab8e['where']=_[_0xa09c('0x41')](_0x2cab8e[_0xa09c('0x3d')],{'$or':_[_0xa09c('0x32')](_0x2cab8e['attributes'],function(_0x1094d4){var _0x5bdd3f={};_0x5bdd3f[_0x1094d4]={'$like':'%'+_0x501774['query'][_0xa09c('0x40')]+'%'};return _0x5bdd3f;})});}_0x2cab8e=_[_0xa09c('0x41')]({},_0x2cab8e,_0x501774[_0xa09c('0x48')]);return _0x98768[_0xa09c('0x70')](_0x2cab8e);}})[_0xa09c('0x25')](function(_0x382272){if(_0x382272){_0x3c6c7b=_0x382272[_0xa09c('0x38')];if(!_0x501774[_0xa09c('0x34')][_0xa09c('0x39')](_0xa09c('0x3a'))){_0x2cab8e[_0xa09c('0x1e')]=qs[_0xa09c('0x1e')](_0x501774[_0xa09c('0x34')][_0xa09c('0x1e')]);_0x2cab8e[_0xa09c('0x1d')]=qs[_0xa09c('0x1d')](_0x501774[_0xa09c('0x34')][_0xa09c('0x1d')]);}return _0x98768[_0xa09c('0x70')](_0x2cab8e);}})[_0xa09c('0x25')](function(_0x18fee6){if(_0x18fee6){return _0x18fee6?{'count':_0x3c6c7b,'rows':_0x18fee6}:null;}})[_0xa09c('0x25')](respondWithResult(_0x3c006d,null))[_0xa09c('0x4a')](handleError(_0x3c006d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2cfdb1b..e9af3bf 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 _0xcf0e=['api','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcf0e,0x1ad));var _0xecf0=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xcf0e[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xecf0('0x0'));var util=require(_0xecf0('0x1'));var logger=require(_0xecf0('0x2'))(_0xecf0('0x3'));var moment=require('moment');var BPromise=require(_0xecf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecf0('0x5'));var rimraf=require(_0xecf0('0x6'));var config=require(_0xecf0('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xecf0('0x8')]=function(_0x32a9a0,_0x337be2){return _0x32a9a0[_0xecf0('0x9')](_0xecf0('0xa'),attributes,{'tableName':_0xecf0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8208=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold'];(function(_0x267646,_0x8c2c0){var _0x2dcc60=function(_0x21a692){while(--_0x21a692){_0x267646['push'](_0x267646['shift']());}};_0x2dcc60(++_0x8c2c0);}(_0x8208,0x16d));var _0x8820=function(_0x1ef4cd,_0x4eb12f){_0x1ef4cd=_0x1ef4cd-0x0;var _0x4d57b0=_0x8208[_0x1ef4cd];return _0x4d57b0;};'use strict';var _=require(_0x8820('0x0'));var util=require(_0x8820('0x1'));var logger=require(_0x8820('0x2'))(_0x8820('0x3'));var moment=require(_0x8820('0x4'));var BPromise=require(_0x8820('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8820('0x6'));var rimraf=require(_0x8820('0x7'));var config=require(_0x8820('0x8'));var attributes=require(_0x8820('0x9'));module[_0x8820('0xa')]=function(_0x31b443,_0x4ac5be){return _0x31b443['define'](_0x8820('0xb'),attributes,{'tableName':_0x8820('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 9bd8b3a..bddb76b 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5a6235,_0x24852a){var _0x24d0a9=function(_0x5eabae){while(--_0x5eabae){_0x5a6235['push'](_0x5a6235['shift']());}};_0x24d0a9(++_0x24852a);}(_0xe706,0xa3));var _0x6e70=function(_0x5d0725,_0x1ae8ad){_0x5d0725=_0x5d0725-0x0;var _0x157c30=_0xe706[_0x5d0725];return _0x157c30;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x2f0f74,_0x4f2d37){var _0x36cec0=function(_0x5d9adf){while(--_0x5d9adf){_0x2f0f74['push'](_0x2f0f74['shift']());}};_0x36cec0(++_0x4f2d37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index 7d8c681..ee4668f 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 _0x9335=['post','create','addAgents','addTeams','update','destroy','removeAgents','delete','removeTeams','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','/:id/users','getAgents','/:id/teams','getTeams'];(function(_0x6a8cb3,_0xcc695f){var _0x14e37c=function(_0x395342){while(--_0x395342){_0x6a8cb3['push'](_0x6a8cb3['shift']());}};_0x14e37c(++_0xcc695f);}(_0x9335,0xab));var _0x5933=function(_0x7c6641,_0x380ba0){_0x7c6641=_0x7c6641-0x0;var _0x5ebe76=_0x9335[_0x7c6641];return _0x5ebe76;};'use strict';var multer=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var path=require('path');var timeout=require(_0x5933('0x2'));var express=require(_0x5933('0x3'));var router=express[_0x5933('0x4')]();var fs_extra=require(_0x5933('0x5'));var auth=require(_0x5933('0x6'));var interaction=require(_0x5933('0x7'));var config=require(_0x5933('0x8'));var controller=require('./voicePrefix.controller');router[_0x5933('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5933('0x9')](_0x5933('0xa'),auth[_0x5933('0xb')](),controller['describe']);router[_0x5933('0x9')](_0x5933('0xc'),auth[_0x5933('0xb')](),controller[_0x5933('0xd')]);router[_0x5933('0x9')](_0x5933('0xe'),auth[_0x5933('0xb')](),controller[_0x5933('0xf')]);router[_0x5933('0x9')](_0x5933('0x10'),auth[_0x5933('0xb')](),controller[_0x5933('0x11')]);router[_0x5933('0x12')]('/',auth['isAuthenticated'](),controller[_0x5933('0x13')]);router['post'](_0x5933('0xe'),auth[_0x5933('0xb')](),controller[_0x5933('0x14')]);router['post'](_0x5933('0x10'),auth['isAuthenticated'](),controller[_0x5933('0x15')]);router['put'](_0x5933('0xc'),auth['isAuthenticated'](),controller[_0x5933('0x16')]);router['delete'](_0x5933('0xc'),auth[_0x5933('0xb')](),controller[_0x5933('0x17')]);router['delete']('/:id/users',auth[_0x5933('0xb')](),controller[_0x5933('0x18')]);router[_0x5933('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5933('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xea04=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','put','delete','destroy','removeAgents','removeTeams','exports','multer','util','path'];(function(_0x134d5e,_0x2a47d8){var _0x1e166a=function(_0x53f10d){while(--_0x53f10d){_0x134d5e['push'](_0x134d5e['shift']());}};_0x1e166a(++_0x2a47d8);}(_0xea04,0x1d1));var _0x4ea0=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0xea04[_0x3dee92];return _0x44d36e;};'use strict';var multer=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var path=require(_0x4ea0('0x2'));var timeout=require(_0x4ea0('0x3'));var express=require('express');var router=express[_0x4ea0('0x4')]();var fs_extra=require(_0x4ea0('0x5'));var auth=require(_0x4ea0('0x6'));var interaction=require(_0x4ea0('0x7'));var config=require(_0x4ea0('0x8'));var controller=require('./voicePrefix.controller');router[_0x4ea0('0x9')]('/',auth[_0x4ea0('0xa')](),controller['index']);router[_0x4ea0('0x9')]('/describe',auth[_0x4ea0('0xa')](),controller[_0x4ea0('0xb')]);router[_0x4ea0('0x9')](_0x4ea0('0xc'),auth['isAuthenticated'](),controller[_0x4ea0('0xd')]);router[_0x4ea0('0x9')](_0x4ea0('0xe'),auth['isAuthenticated'](),controller[_0x4ea0('0xf')]);router[_0x4ea0('0x9')](_0x4ea0('0x10'),auth['isAuthenticated'](),controller[_0x4ea0('0x11')]);router[_0x4ea0('0x12')]('/',auth[_0x4ea0('0xa')](),controller['create']);router[_0x4ea0('0x12')](_0x4ea0('0xe'),auth[_0x4ea0('0xa')](),controller[_0x4ea0('0x13')]);router[_0x4ea0('0x12')](_0x4ea0('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4ea0('0x14')](_0x4ea0('0xc'),auth[_0x4ea0('0xa')](),controller['update']);router[_0x4ea0('0x15')](_0x4ea0('0xc'),auth['isAuthenticated'](),controller[_0x4ea0('0x16')]);router['delete']('/:id/users',auth[_0x4ea0('0xa')](),controller[_0x4ea0('0x17')]);router['delete'](_0x4ea0('0x10'),auth[_0x4ea0('0xa')](),controller[_0x4ea0('0x18')]);module[_0x4ea0('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 09ec5ed..d75a9f9 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 _0xd428=['name','INTEGER','sequelize','STRING','VIRTUAL','system-','getDataValue'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xd428,0x8e));var _0x8d42=function(_0x5656d8,_0x36b1f5){_0x5656d8=_0x5656d8-0x0;var _0xaf934f=_0xd428[_0x5656d8];return _0xaf934f;};'use strict';var Sequelize=require(_0x8d42('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d42('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x8d42('0x2')],'get':function(_0xbafeaa){return _0x8d42('0x3')+this[_0x8d42('0x4')](_0x8d42('0x5'))+'-';}},'description':{'type':Sequelize[_0x8d42('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x8d42('0x6')]}}; \ No newline at end of file +var _0x0ebb=['STRING','name','VIRTUAL','INTEGER','exports'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0ebb,0x86));var _0xb0eb=function(_0x3f7136,_0x50745c){_0x3f7136=_0x3f7136-0x0;var _0x2575a2=_0x0ebb[_0x3f7136];return _0x2575a2;};'use strict';var Sequelize=require('sequelize');module[_0xb0eb('0x0')]={'name':{'type':Sequelize[_0xb0eb('0x1')],'allowNull':![],'unique':_0xb0eb('0x2')},'prefix':{'type':Sequelize[_0xb0eb('0x3')],'get':function(_0x25b771){return'system-'+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xb0eb('0x1')]},'callerIdAll':{'type':Sequelize[_0xb0eb('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xb0eb('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c25b287..8048058 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(_0x2e913b,_0x4b7071){var _0x173899=function(_0x2a7d22){while(--_0x2a7d22){_0x2e913b['push'](_0x2e913b['shift']());}};_0x173899(++_0x4b7071);}(_0x3266,0x6a));var _0x6326=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x3266[_0xf73c09];return _0xa8923c;};'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 _0xe2cf=['socket.io-emitter','register','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','addAgents','ids','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','nolimit','getTeams','addTeams','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','field','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x17f78f,_0x436b6f){var _0x1f2465=function(_0x196c1c){while(--_0x196c1c){_0x17f78f['push'](_0x17f78f['shift']());}};_0x1f2465(++_0x436b6f);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x2ff252,_0x222a1b){_0x2ff252=_0x2ff252-0x0;var _0x327741=_0xe2cf[_0x2ff252];return _0x327741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2c('0x1'));var rp=require('request-promise');var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var Mustache=require(_0xfe2c('0x4'));var util=require(_0xfe2c('0x5'));var path=require('path');var sox=require(_0xfe2c('0x6'));var csv=require(_0xfe2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0x7'));var querystring=require(_0xfe2c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xc'));var qs=require(_0xfe2c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xe'));var logger=require(_0xfe2c('0xf'))(_0xfe2c('0x10'));var utils=require(_0xfe2c('0x11'));var config=require(_0xfe2c('0x12'));var licenseUtil=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0x15'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xfe2c('0x16')](socket);function respondWithStatusCode(_0x4d0a10,_0x2aa7df){_0x2aa7df=_0x2aa7df||0xcc;return function(_0x12e4c4){if(_0x12e4c4){return _0x4d0a10['sendStatus'](_0x2aa7df);}return _0x4d0a10['status'](_0x2aa7df)[_0xfe2c('0x17')]();};}function respondWithResult(_0x3b3ebd,_0x1dbed4){_0x1dbed4=_0x1dbed4||0xc8;return function(_0x56cebc){if(_0x56cebc){return _0x3b3ebd['status'](_0x1dbed4)[_0xfe2c('0x18')](_0x56cebc);}};}function respondWithFilteredResult(_0x96a3a3,_0x135436){return function(_0x23242b){if(_0x23242b){var _0x36aeec=typeof _0x135436[_0xfe2c('0x19')]==='undefined'&&typeof _0x135436[_0xfe2c('0x1a')]===_0xfe2c('0x1b');var _0x1d7852=_0x23242b[_0xfe2c('0x1c')];var _0x55f751=_0x36aeec?0x0:_0x135436[_0xfe2c('0x19')];var _0x59bdeb=_0x36aeec?_0x23242b['count']:_0x135436[_0xfe2c('0x19')]+_0x135436[_0xfe2c('0x1a')];var _0x4bf7c0;if(_0x59bdeb>=_0x1d7852){_0x59bdeb=_0x1d7852;_0x4bf7c0=0xc8;}else{_0x4bf7c0=0xce;}_0x96a3a3[_0xfe2c('0x1d')](_0x4bf7c0);return _0x96a3a3[_0xfe2c('0x1e')]('Content-Range',_0x55f751+'-'+_0x59bdeb+'/'+_0x1d7852)[_0xfe2c('0x18')](_0x23242b);}return null;};}function patchUpdates(_0x5dd54b){return function(_0x4481ff){try{jsonpatch[_0xfe2c('0x1f')](_0x4481ff,_0x5dd54b,!![]);}catch(_0x8b5c0d){return BPromise[_0xfe2c('0x20')](_0x8b5c0d);}return _0x4481ff[_0xfe2c('0x21')]();};}function saveUpdates(_0x2ee3b3,_0x57cd6d){return function(_0x41a545){if(_0x41a545){return _0x41a545[_0xfe2c('0x22')](_0x2ee3b3)[_0xfe2c('0x23')](function(_0x26448c){return _0x26448c;});}return null;};}function removeEntity(_0x3486b5,_0x10afde){return function(_0x53bab0){if(_0x53bab0){return _0x53bab0[_0xfe2c('0x24')]()['then'](function(){var _0x16daf3=_0x53bab0[_0xfe2c('0x25')]({'plain':!![]});var _0x1c35d3='VoicePrefixes';return db[_0xfe2c('0x26')][_0xfe2c('0x24')]({'where':{'type':_0x1c35d3,'resourceId':_0x16daf3['id']}})['then'](function(){return _0x53bab0;});})[_0xfe2c('0x23')](function(){_0x3486b5[_0xfe2c('0x1d')](0xcc)[_0xfe2c('0x17')]();});}};}function handleEntityNotFound(_0x53a8c1,_0x170026){return function(_0x1b7c91){if(!_0x1b7c91){_0x53a8c1['sendStatus'](0x194);}return _0x1b7c91;};}function handleError(_0x481219,_0x1cf1d7){_0x1cf1d7=_0x1cf1d7||0x1f4;return function(_0x13e9a9){logger[_0xfe2c('0x27')](_0x13e9a9[_0xfe2c('0x28')]);if(_0x13e9a9[_0xfe2c('0x29')]){delete _0x13e9a9['name'];}_0x481219[_0xfe2c('0x1d')](_0x1cf1d7)[_0xfe2c('0x2a')](_0x13e9a9);};}exports[_0xfe2c('0x2b')]=function(_0x210c2e,_0x2843a5){var _0xabc499={},_0x69d23a={},_0x3f8696={'count':0x0,'rows':[]};var _0x2e09fe=_[_0xfe2c('0x2c')](db[_0xfe2c('0x2d')][_0xfe2c('0x2e')],function(_0x4e6b92){return{'name':_0x4e6b92[_0xfe2c('0x2f')],'type':_0x4e6b92[_0xfe2c('0x30')][_0xfe2c('0x31')]};});_0x69d23a['model']=_[_0xfe2c('0x2c')](_0x2e09fe,_0xfe2c('0x29'));_0x69d23a['query']=_[_0xfe2c('0x32')](_0x210c2e[_0xfe2c('0x33')]);_0x69d23a[_0xfe2c('0x34')]=_['intersection'](_0x69d23a[_0xfe2c('0x35')],_0x69d23a[_0xfe2c('0x33')]);_0xabc499[_0xfe2c('0x36')]=_[_0xfe2c('0x37')](_0x69d23a[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x210c2e[_0xfe2c('0x33')]['fields']));_0xabc499['attributes']=_0xabc499[_0xfe2c('0x36')][_0xfe2c('0x39')]?_0xabc499[_0xfe2c('0x36')]:_0x69d23a[_0xfe2c('0x35')];if(!_0x210c2e['query'][_0xfe2c('0x3a')]('nolimit')){_0xabc499[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x210c2e['query'][_0xfe2c('0x1a')]);_0xabc499['offset']=qs['offset'](_0x210c2e[_0xfe2c('0x33')][_0xfe2c('0x19')]);}_0xabc499[_0xfe2c('0x3b')]=qs[_0xfe2c('0x3c')](_0x210c2e[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0xabc499[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x210c2e[_0xfe2c('0x33')],_0x69d23a[_0xfe2c('0x34')]),_0x2e09fe);if(_0x210c2e['query'][_0xfe2c('0x3f')]){_0xabc499[_0xfe2c('0x3d')]=_[_0xfe2c('0x40')](_0xabc499['where'],{'$or':_['map'](_0x2e09fe,function(_0x4e5f0b){if(_0x4e5f0b[_0xfe2c('0x30')]!==_0xfe2c('0x41')){var _0x428b32={};_0x428b32[_0x4e5f0b[_0xfe2c('0x29')]]={'$like':'%'+_0x210c2e['query'][_0xfe2c('0x3f')]+'%'};return _0x428b32;}})});}_0xabc499=_[_0xfe2c('0x40')]({},_0xabc499,_0x210c2e[_0xfe2c('0x42')]);var _0x278acb={'where':_0xabc499[_0xfe2c('0x3d')]};return db['VoicePrefix'][_0xfe2c('0x1c')](_0x278acb)[_0xfe2c('0x23')](function(_0x6055dd){_0x3f8696[_0xfe2c('0x1c')]=_0x6055dd;if(_0x210c2e['query']['includeAll']){_0xabc499[_0xfe2c('0x43')]=[{'all':!![]}];}return db[_0xfe2c('0x2d')]['findAll'](_0xabc499);})[_0xfe2c('0x23')](function(_0x27862d){_0x3f8696[_0xfe2c('0x44')]=_0x27862d;return _0x3f8696;})[_0xfe2c('0x23')](respondWithFilteredResult(_0x2843a5,_0xabc499))['catch'](handleError(_0x2843a5,null));};exports[_0xfe2c('0x45')]=function(_0xfe35e5,_0x331a8a){var _0x466cdb={'raw':![],'where':{'id':_0xfe35e5[_0xfe2c('0x46')]['id']}},_0x122a05={};_0x122a05[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db['VoicePrefix'][_0xfe2c('0x2e')]);_0x122a05['query']=_[_0xfe2c('0x32')](_0xfe35e5[_0xfe2c('0x33')]);_0x122a05[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x122a05['model'],_0x122a05['query']);_0x466cdb['attributes']=_['intersection'](_0x122a05['model'],qs[_0xfe2c('0x38')](_0xfe35e5['query']['fields']));_0x466cdb[_0xfe2c('0x36')]=_0x466cdb['attributes'][_0xfe2c('0x39')]?_0x466cdb['attributes']:_0x122a05[_0xfe2c('0x35')];if(_0xfe35e5[_0xfe2c('0x33')][_0xfe2c('0x47')]){_0x466cdb[_0xfe2c('0x43')]=[{'all':!![]}];}_0x466cdb=_[_0xfe2c('0x40')]({},_0x466cdb,_0xfe35e5['options']);return db[_0xfe2c('0x2d')][_0xfe2c('0x48')](_0x466cdb)[_0xfe2c('0x23')](handleEntityNotFound(_0x331a8a,null))['then'](respondWithResult(_0x331a8a,null))[_0xfe2c('0x49')](handleError(_0x331a8a,null));};exports[_0xfe2c('0x24')]=function(_0x579b6b,_0x56f716){return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x579b6b[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x56f716,null))[_0xfe2c('0x23')](removeEntity(_0x56f716,null))[_0xfe2c('0x49')](handleError(_0x56f716,null));};exports['describe']=function(_0x24cdce,_0x2983b0){return db[_0xfe2c('0x2d')]['describe']()['then'](respondWithResult(_0x2983b0,null))[_0xfe2c('0x49')](handleError(_0x2983b0,null));};exports[_0xfe2c('0x4a')]=function(_0x2daa5f,_0x154381){var _0x384766;return db[_0xfe2c('0x4b')][_0xfe2c('0x4c')](function(_0x37e3de){return db[_0xfe2c('0x2d')][_0xfe2c('0x4a')](_0x2daa5f['body'],{'transaction':_0x37e3de})[_0xfe2c('0x23')](function(_0x34e8e0){_0x384766=_0x34e8e0[_0xfe2c('0x25')]({'plain':!![]});return db[_0xfe2c('0x4d')][_0xfe2c('0x48')]({'where':{'id':_0x384766[_0xfe2c('0x4e')]},'raw':!![]})[_0xfe2c('0x23')](function(_0x158e70){return createVoicePrefixExtensions(_0x384766,_0x158e70,_0x37e3de);});});})[_0xfe2c('0x23')](function(){var _0xf54c02=_0x2daa5f[_0xfe2c('0x4f')]['get']({'plain':!![]});if(!_0xf54c02)throw new Error(_0xfe2c('0x50'));if(_0xf54c02['role']===_0xfe2c('0x4f')){var _0x4f4bc6=_0x384766;return db['UserProfileSection']['find']({'where':{'name':_0xfe2c('0x51'),'userProfileId':_0xf54c02['userProfileId']},'raw':!![]})[_0xfe2c('0x23')](function(_0x5f47cc){if(_0x5f47cc&&_0x5f47cc[_0xfe2c('0x52')]===0x0){return db[_0xfe2c('0x26')][_0xfe2c('0x4a')]({'name':_0x4f4bc6[_0xfe2c('0x29')],'resourceId':_0x4f4bc6['id'],'type':_0x5f47cc[_0xfe2c('0x29')],'sectionId':_0x5f47cc['id']},{})[_0xfe2c('0x23')](function(){return _0x384766;});}else{return _0x384766;}})[_0xfe2c('0x49')](function(_0x11d99e){logger[_0xfe2c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11d99e);throw _0x11d99e;});}return _0x384766;})[_0xfe2c('0x23')](respondWithResult(_0x154381,null))[_0xfe2c('0x49')](handleError(_0x154381,null));};function Extension(_0xf9ed12,_0x385c21,_0x366687,_0x5e6d96){this[_0xfe2c('0x53')]=_0xfe2c('0x54');this['exten']=_0xf9ed12;this['app']=_0x366687;this[_0xfe2c('0x30')]=_0xfe2c('0x55');this[_0xfe2c('0x56')]=_0xfe2c('0x57');this[_0xfe2c('0x58')]=_0x385c21;this[_0xfe2c('0x59')]=_0x5e6d96;}function createVoicePrefixExtensions(_0x306f81,_0x510c61,_0x1a2278){return new BPromise(function(_0x33df71,_0x4679){var _0x821144=new Extension(formatPrefixName(_0x306f81[_0xfe2c('0x5a')]),0x1,_0xfe2c('0x5b'),_0xfe2c('0x5c'));_0x821144['VoicePrefixId']=_0x306f81['id'];return db[_0xfe2c('0x4d')]['create'](_0x821144,{'transaction':_0x1a2278})[_0xfe2c('0x23')](function(_0x349d72){var _0x4cede1=_0x349d72[_0xfe2c('0x25')]({'plain':!![]});var _0x5caca7=_[_0xfe2c('0x2c')](addVoicePrefixExtensions(_0x306f81,_0x510c61),function(_0x377064){_0x377064['VoiceExtensionId']=_0x4cede1['id'];_0x377064[_0xfe2c('0x5d')]=_0x306f81['id'];return _0x377064;});return db['VoiceExtension'][_0xfe2c('0x5e')](_0x5caca7,{'transaction':_0x1a2278})['then'](function(_0x23827b){if(!_0x23827b){return _0x4679(_0xfe2c('0x5f'));}else{return _0x33df71(_0x23827b);}})['catch'](function(_0x661798){return _0x4679(_0x661798);});});;});};function addVoicePrefixExtensions(_0x7a0a77,_0x17b42a){var _0xda63e=[];var _0xa47aeb=formatPrefixName(_0x7a0a77['prefix']);_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x2,_0xfe2c('0x61'),_0xfe2c('0x62')+_0x7a0a77[_0xfe2c('0x29')]));if(_0x7a0a77['callerIdAll']){_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x3,'Set',_0xfe2c('0x63')+_0x7a0a77['callerIdAll']));}else{_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x3,_0xfe2c('0x5b'),_0xfe2c('0x64')));}_0xda63e[_0xfe2c('0x60')](new Extension(_0xa47aeb,0x4,_0xfe2c('0x65'),_0x17b42a[_0xfe2c('0x53')]+','+_0xfe2c('0x66')+(0x8+_0x7a0a77[_0xfe2c('0x29')][_0xfe2c('0x39')])+'}'+','+0x1));return _0xda63e;}function formatPrefixName(_0x21b07a){var _0x3da347='_';for(var _0x2fcb15=0x0;_0x2fcb15<_0x21b07a[_0xfe2c('0x39')];_0x2fcb15++){if(_0x21b07a[_0xfe2c('0x67')](_0x2fcb15)=='-'){_0x3da347+=_0x21b07a[_0xfe2c('0x67')](_0x2fcb15);}else{_0x3da347+='['+_0x21b07a[_0xfe2c('0x67')](_0x2fcb15)+']';}}_0x3da347+='.';return _0x3da347;}exports['update']=function(_0x2f48d5,_0x53513a,_0xdafb46){var _0x5aee3f=_0x2f48d5[_0xfe2c('0x68')];_0x5aee3f['prefix']='system-'+_0x5aee3f[_0xfe2c('0x29')]+'-';return db[_0xfe2c('0x4b')][_0xfe2c('0x4c')](function(_0x40124f){return db[_0xfe2c('0x2d')]['update'](_0x5aee3f,{'where':{'id':_0x5aee3f['id']},'transaction':_0x40124f})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x4d')]['destroy']({'where':{'VoicePrefixId':_0x5aee3f['id']},'transaction':_0x40124f})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x4d')]['find']({'where':{'id':_0x5aee3f['VoiceExtensionId']},'raw':!![]})['then'](function(_0x14d619){return createVoicePrefixExtensions(_0x5aee3f,_0x14d619,_0x40124f);});});});})[_0xfe2c('0x23')](function(){return db[_0xfe2c('0x2d')]['findById'](_0x5aee3f['id']);})['then'](respondWithResult(_0x53513a,null))[_0xfe2c('0x49')](handleError(_0x53513a,null));};exports[_0xfe2c('0x69')]=function(_0x56a3be,_0x3508c2,_0x9c07d5){return db[_0xfe2c('0x2d')][_0xfe2c('0x48')]({'where':{'id':_0x56a3be['params']['id']}})['then'](handleEntityNotFound(_0x3508c2,null))[_0xfe2c('0x23')](function(_0x414b87){if(_0x414b87){return _0x414b87['addAgents'](_0x56a3be[_0xfe2c('0x68')][_0xfe2c('0x6a')],_['omit'](_0x56a3be[_0xfe2c('0x68')],['ids','id'])||{})['spread'](function(_0x1f5190){for(var _0x157ad0=0x0;_0x157ad0<_0x56a3be['body'][_0xfe2c('0x6a')][_0xfe2c('0x39')];_0x157ad0+=0x1){socket['emit'](_0xfe2c('0x6b'),{'UserId':Number(_0x56a3be['body'][_0xfe2c('0x6a')][_0x157ad0]),'VoicePrefixId':Number(_0x56a3be[_0xfe2c('0x46')]['id'])});}return _0x1f5190;});}})[_0xfe2c('0x23')](respondWithResult(_0x3508c2,null))[_0xfe2c('0x49')](handleError(_0x3508c2,null));};exports['removeAgents']=function(_0x10e0a0,_0x85c898,_0x5317e4){return db[_0xfe2c('0x2d')]['find']({'where':{'id':_0x10e0a0[_0xfe2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x85c898,null))[_0xfe2c('0x23')](function(_0x23311a){if(_0x23311a){return _0x23311a['removeAgents'](_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')])[_0xfe2c('0x23')](function(){if(_[_0xfe2c('0x6c')](_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')])){for(var _0x52627b=0x0;_0x52627b<_0x10e0a0[_0xfe2c('0x33')]['ids']['length'];_0x52627b+=0x1){socket[_0xfe2c('0x6d')](_0xfe2c('0x6e'),{'UserId':Number(_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')][_0x52627b]),'VoicePrefixId':Number(_0x10e0a0[_0xfe2c('0x46')]['id'])});}}else{socket[_0xfe2c('0x6d')]('userVoicePrefix:remove',{'UserId':Number(_0x10e0a0[_0xfe2c('0x33')][_0xfe2c('0x6a')]),'VoicePrefixId':Number(_0x10e0a0[_0xfe2c('0x46')]['id'])});}});}})[_0xfe2c('0x23')](respondWithStatusCode(_0x85c898,null))['catch'](handleError(_0x85c898,null));};exports[_0xfe2c('0x6f')]=function(_0x4f595d,_0x392232,_0x114553){var _0x512137={};var _0x1baccd={};var _0x540a67;var _0x49f9e1;return db['VoicePrefix'][_0xfe2c('0x70')]({'where':{'id':_0x4f595d[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](handleEntityNotFound(_0x392232,null))[_0xfe2c('0x23')](function(_0x4147fc){if(_0x4147fc){_0x540a67=_0x4147fc;_0x1baccd[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db[_0xfe2c('0x71')][_0xfe2c('0x2e')]);_0x1baccd['query']=_['keys'](_0x4f595d[_0xfe2c('0x33')]);_0x1baccd[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x1baccd[_0xfe2c('0x35')],_0x1baccd[_0xfe2c('0x33')]);_0x512137[_0xfe2c('0x36')]=_['intersection'](_0x1baccd[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x38')]));_0x512137[_0xfe2c('0x36')]=_0x512137[_0xfe2c('0x36')][_0xfe2c('0x39')]?_0x512137[_0xfe2c('0x36')]:_0x1baccd[_0xfe2c('0x35')];_0x512137['order']=qs[_0xfe2c('0x3c')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0x512137[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x4f595d['query'],_0x1baccd[_0xfe2c('0x34')]));if(_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3f')]){_0x512137[_0xfe2c('0x3d')]=_['merge'](_0x512137['where'],{'$or':_[_0xfe2c('0x2c')](_0x512137[_0xfe2c('0x36')],function(_0x312e84){var _0x57643d={};_0x57643d[_0x312e84]={'$like':'%'+_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3f')]+'%'};return _0x57643d;})});}_0x512137=_[_0xfe2c('0x40')]({},_0x512137,_0x4f595d['options']);return _0x540a67[_0xfe2c('0x6f')](_0x512137);}})[_0xfe2c('0x23')](function(_0x1193c2){if(_0x1193c2){_0x49f9e1=_0x1193c2[_0xfe2c('0x39')];if(!_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x3a')](_0xfe2c('0x72'))){_0x512137[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x4f595d['query'][_0xfe2c('0x1a')]);_0x512137['offset']=qs[_0xfe2c('0x19')](_0x4f595d[_0xfe2c('0x33')][_0xfe2c('0x19')]);}return _0x540a67['getAgents'](_0x512137);}})['then'](function(_0x4f39af){if(_0x4f39af){return _0x4f39af?{'count':_0x49f9e1,'rows':_0x4f39af}:null;}})[_0xfe2c('0x23')](respondWithResult(_0x392232,null))[_0xfe2c('0x49')](handleError(_0x392232,null));};exports[_0xfe2c('0x73')]=function(_0x3b07e7,_0x37e3d8,_0x27d025){var _0x23e1db={};var _0x14ebf0={};var _0x20c22a;var _0xb283e0;return db[_0xfe2c('0x2d')][_0xfe2c('0x70')]({'where':{'id':_0x3b07e7[_0xfe2c('0x46')]['id']}})['then'](handleEntityNotFound(_0x37e3d8,null))[_0xfe2c('0x23')](function(_0x532f06){if(_0x532f06){_0x20c22a=_0x532f06;_0x14ebf0[_0xfe2c('0x35')]=_[_0xfe2c('0x32')](db['Team']['rawAttributes']);_0x14ebf0['query']=_[_0xfe2c('0x32')](_0x3b07e7[_0xfe2c('0x33')]);_0x14ebf0[_0xfe2c('0x34')]=_[_0xfe2c('0x37')](_0x14ebf0[_0xfe2c('0x35')],_0x14ebf0[_0xfe2c('0x33')]);_0x23e1db['attributes']=_['intersection'](_0x14ebf0[_0xfe2c('0x35')],qs[_0xfe2c('0x38')](_0x3b07e7[_0xfe2c('0x33')]['fields']));_0x23e1db[_0xfe2c('0x36')]=_0x23e1db['attributes'][_0xfe2c('0x39')]?_0x23e1db[_0xfe2c('0x36')]:_0x14ebf0[_0xfe2c('0x35')];_0x23e1db[_0xfe2c('0x3b')]=qs['sort'](_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x3c')]);_0x23e1db[_0xfe2c('0x3d')]=qs[_0xfe2c('0x34')](_[_0xfe2c('0x3e')](_0x3b07e7['query'],_0x14ebf0[_0xfe2c('0x34')]));if(_0x3b07e7[_0xfe2c('0x33')]['filter']){_0x23e1db[_0xfe2c('0x3d')]=_[_0xfe2c('0x40')](_0x23e1db[_0xfe2c('0x3d')],{'$or':_[_0xfe2c('0x2c')](_0x23e1db[_0xfe2c('0x36')],function(_0x50f27e){var _0x995423={};_0x995423[_0x50f27e]={'$like':'%'+_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x3f')]+'%'};return _0x995423;})});}_0x23e1db=_[_0xfe2c('0x40')]({},_0x23e1db,_0x3b07e7[_0xfe2c('0x42')]);return _0x20c22a[_0xfe2c('0x73')](_0x23e1db);}})[_0xfe2c('0x23')](function(_0x142bf1){if(_0x142bf1){_0xb283e0=_0x142bf1['length'];if(!_0x3b07e7['query'][_0xfe2c('0x3a')](_0xfe2c('0x72'))){_0x23e1db[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x3b07e7[_0xfe2c('0x33')][_0xfe2c('0x1a')]);_0x23e1db['offset']=qs['offset'](_0x3b07e7['query'][_0xfe2c('0x19')]);}return _0x20c22a[_0xfe2c('0x73')](_0x23e1db);}})[_0xfe2c('0x23')](function(_0x2351d5){if(_0x2351d5){return _0x2351d5?{'count':_0xb283e0,'rows':_0x2351d5}:null;}})[_0xfe2c('0x23')](respondWithResult(_0x37e3d8,null))[_0xfe2c('0x49')](handleError(_0x37e3d8,null));};exports[_0xfe2c('0x74')]=function(_0x3f2102,_0x1cc35d,_0x246d5d){var _0x5f34d3=_0x3f2102[_0xfe2c('0x68')][_0xfe2c('0x6a')];var _0x14631f;return db['Team'][_0xfe2c('0x75')]({'where':{'id':_0x5f34d3},'attributes':['id'],'include':[{'model':db[_0xfe2c('0x71')],'as':_0xfe2c('0x76'),'attributes':['id',_0xfe2c('0x29'),_0xfe2c('0x77'),_0xfe2c('0x78'),'interface'],'raw':!![]}]})['then'](function(_0x5f4744){if(_0x5f4744){_0x14631f=_0x5f4744;var _0x18ad4f=_[_0xfe2c('0x79')](_0x5f4744,function(_0x24faae){var _0x450e1d=_0x24faae[_0xfe2c('0x25')]({'plain':!![]});return _0x450e1d[_0xfe2c('0x76')];});return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x3f2102['params']['id']}})[_0xfe2c('0x23')](function(_0x552cd3){return db['sequelize'][_0xfe2c('0x4c')](function(_0x32ed72){return _0x552cd3[_0xfe2c('0x74')](_0x5f34d3,{'transaction':_0x32ed72})['then'](function(){return BPromise[_0xfe2c('0x7a')](_0x14631f,function(_0x4f946d){return db[_0xfe2c('0x7b')][_0xfe2c('0x7c')]({'TeamId':_0x4f946d['id'],'VoicePrefixId':_0x3f2102[_0xfe2c('0x46')]['id']},{'transaction':_0x32ed72});});})[_0xfe2c('0x23')](function(){return BPromise['each'](_0x18ad4f,function(_0x42495d){return db[_0xfe2c('0x7d')]['findOrCreate']({'where':{'UserId':_0x42495d['id'],'VoicePrefixId':_0x3f2102[_0xfe2c('0x46')]['id']},'transaction':_0x32ed72});});})[_0xfe2c('0x23')](function(){_0x18ad4f[_0xfe2c('0x7e')](function(_0x1682b2){socket[_0xfe2c('0x6d')]('userVoicePrefix:save',{'UserId':_0x1682b2['id'],'VoicePrefixId':_0x552cd3['id']});});});});});}})[_0xfe2c('0x23')](respondWithStatusCode(_0x1cc35d,null))[_0xfe2c('0x49')](handleError(_0x1cc35d,null));};exports[_0xfe2c('0x7f')]=function(_0x3027f9,_0x3d6fba,_0x2523cc){return db['Team'][_0xfe2c('0x75')]({'where':{'id':_0x3027f9[_0xfe2c('0x33')][_0xfe2c('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe2c('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3d6fba,null))[_0xfe2c('0x23')](function(_0x5cbd7f){var _0x3dba12=_[_0xfe2c('0x2c')](_0x5cbd7f,'id');var _0x40be3c=[];var _0x4dd915=[];var _0x6efab6=squel['select']();_0x6efab6[_0xfe2c('0x80')](_0xfe2c('0x81'))[_0xfe2c('0x82')]('team_has_voice_prefixes','tq')[_0xfe2c('0x83')](_0xfe2c('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfe2c('0x3d')](_0xfe2c('0x85'),_0x3027f9['params']['id']);for(var _0x3b6535=0x0;_0x3b6535<_0x5cbd7f[_0xfe2c('0x39')];_0x3b6535+=0x1){let _0x1d712e=_0x5cbd7f[_0x3b6535];for(var _0x14696e=0x0;_0x14696e<_0x1d712e[_0xfe2c('0x76')][_0xfe2c('0x39')];_0x14696e+=0x1){let _0x252527=_0x1d712e[_0xfe2c('0x76')][_0x14696e];var _0x1c0877=_0x6efab6[_0xfe2c('0x86')]();_0x1c0877[_0xfe2c('0x3d')](_0xfe2c('0x87'),_0x252527['id']);_0x4dd915[_0xfe2c('0x60')](db[_0xfe2c('0x4b')][_0xfe2c('0x33')](_0x1c0877[_0xfe2c('0x88')](),{'type':db['sequelize'][_0xfe2c('0x89')]['SELECT']})[_0xfe2c('0x23')](function(_0x5f3a0f){if(_0x5f3a0f[_0xfe2c('0x39')]===0x1){return _0x252527['id'];}else{var _0x329de0=_[_0xfe2c('0x8a')](_[_0xfe2c('0x2c')](_0x5f3a0f,_0xfe2c('0x8b')),function(_0x5b6e4f){return _[_0xfe2c('0x8c')](_0x3dba12,_0x5b6e4f);});if(_0x329de0){return _0x252527['id'];}}}));}}return BPromise[_0xfe2c('0x8d')](_0x4dd915)[_0xfe2c('0x23')](function(_0x57d173){_0x40be3c=_(_0x40be3c)['union'](_0x57d173)[_0xfe2c('0x8e')]()[_0xfe2c('0x8f')]();return db['VoicePrefix'][_0xfe2c('0x48')]({'where':{'id':_0x3027f9[_0xfe2c('0x46')]['id']}})[_0xfe2c('0x23')](function(_0x2f3af6){return db[_0xfe2c('0x4b')]['transaction'](function(_0x36abbf){return _0x2f3af6[_0xfe2c('0x7f')](_0x3027f9[_0xfe2c('0x33')][_0xfe2c('0x6a')],{'transaction':_0x36abbf})[_0xfe2c('0x23')](function(){if(!_[_0xfe2c('0x90')](_0x40be3c)){return _0x2f3af6[_0xfe2c('0x91')](_0x40be3c,{'transaction':_0x36abbf});}})[_0xfe2c('0x23')](function(){_0x40be3c['forEach'](function(_0x29c9ef){socket['emit'](_0xfe2c('0x6e'),{'UserId':_0x29c9ef,'VoicePrefixId':_0x2f3af6['id']});});});});});});})[_0xfe2c('0x23')](respondWithStatusCode(_0x3d6fba,null))[_0xfe2c('0x49')](handleError(_0x3d6fba,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 91cb048..e7aff5f 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 _0x95f6=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x4ea5fb,_0x1bcc80){var _0x39c9c8=function(_0x4b087e){while(--_0x4b087e){_0x4ea5fb['push'](_0x4ea5fb['shift']());}};_0x39c9c8(++_0x1bcc80);}(_0x95f6,0x66));var _0x695f=function(_0x511a19,_0x417e36){_0x511a19=_0x511a19-0x0;var _0x499aa6=_0x95f6[_0x511a19];return _0x499aa6;};'use strict';var EventEmitter=require(_0x695f('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x695f('0x1')](0x0);var events={'afterCreate':_0x695f('0x2'),'afterUpdate':_0x695f('0x3'),'afterDestroy':_0x695f('0x4')};function emitEvent(_0x4a068e){return function(_0xbd71bd,_0x33f34d,_0x4ac2ad){VoicePrefixEvents[_0x695f('0x5')](_0x4a068e+':'+_0xbd71bd['id'],_0xbd71bd);VoicePrefixEvents[_0x695f('0x5')](_0x4a068e,_0xbd71bd);_0x4ac2ad(null);};}for(var e in events){if(events[_0x695f('0x6')](e)){var event=events[e];VoicePrefix[_0x695f('0x7')](e,emitEvent(event));}}module[_0x695f('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x8c7a=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x2c6465,_0x53237b){var _0x5973b4=function(_0x45c898){while(--_0x45c898){_0x2c6465['push'](_0x2c6465['shift']());}};_0x5973b4(++_0x53237b);}(_0x8c7a,0x197));var _0xa8c7=function(_0x441148,_0x48d49a){_0x441148=_0x441148-0x0;var _0x266f65=_0x8c7a[_0x441148];return _0x266f65;};'use strict';var EventEmitter=require(_0xa8c7('0x0'));var VoicePrefix=require(_0xa8c7('0x1'))['db'][_0xa8c7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa8c7('0x3')](0x0);var events={'afterCreate':_0xa8c7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b31d1){return function(_0x189754,_0x44d295,_0x40d483){VoicePrefixEvents[_0xa8c7('0x5')](_0x5b31d1+':'+_0x189754['id'],_0x189754);VoicePrefixEvents['emit'](_0x5b31d1,_0x189754);_0x40d483(null);};}for(var e in events){if(events[_0xa8c7('0x6')](e)){var event=events[e];VoicePrefix[_0xa8c7('0x7')](e,emitEvent(event));}}module[_0xa8c7('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 7503478..b14f327 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 _0x5dc0=['define','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x5cd635,_0x28e48f){var _0x191bc0=function(_0x24daba){while(--_0x24daba){_0x5cd635['push'](_0x5cd635['shift']());}};_0x191bc0(++_0x28e48f);}(_0x5dc0,0x1e1));var _0x05dc=function(_0x511b77,_0xe65b0d){_0x511b77=_0x511b77-0x0;var _0x14ed29=_0x5dc0[_0x511b77];return _0x14ed29;};'use strict';var _=require('lodash');var util=require(_0x05dc('0x0'));var logger=require(_0x05dc('0x1'))(_0x05dc('0x2'));var moment=require(_0x05dc('0x3'));var BPromise=require(_0x05dc('0x4'));var rp=require(_0x05dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05dc('0x6'));var config=require(_0x05dc('0x7'));var attributes=require(_0x05dc('0x8'));module['exports']=function(_0x3e47f3,_0x5cee10){return _0x3e47f3[_0x05dc('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61fa=['exports','define','VoicePrefix','voice_prefixes','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x3ccada,_0x342f0c){var _0x18d11f=function(_0x55c211){while(--_0x55c211){_0x3ccada['push'](_0x3ccada['shift']());}};_0x18d11f(++_0x342f0c);}(_0x61fa,0x1c0));var _0xa61f=function(_0x4eaf7e,_0x2afb74){_0x4eaf7e=_0x4eaf7e-0x0;var _0x31cb6a=_0x61fa[_0x4eaf7e];return _0x31cb6a;};'use strict';var _=require(_0xa61f('0x0'));var util=require(_0xa61f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa61f('0x2'));var BPromise=require('bluebird');var rp=require(_0xa61f('0x3'));var fs=require('fs');var path=require(_0xa61f('0x4'));var rimraf=require(_0xa61f('0x5'));var config=require(_0xa61f('0x6'));var attributes=require(_0xa61f('0x7'));module[_0xa61f('0x8')]=function(_0x2fdb3a,_0x4b02f5){return _0x2fdb3a[_0xa61f('0x9')](_0xa61f('0xa'),attributes,{'tableName':_0xa61f('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 39a70e1..ead2ff7 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 _0x68b3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x68b3,0x1d8));var _0x368b=function(_0x461937,_0x140111){_0x461937=_0x461937-0x0;var _0x3b64a8=_0x68b3[_0x461937];return _0x3b64a8;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});config[_0x368b('0xc')]=_[_0x368b('0xd')](config[_0x368b('0xc')],{'host':_0x368b('0xe'),'port':0x18eb});var socket=require(_0x368b('0xf'))(new Redis(config[_0x368b('0xc')]));require(_0x368b('0x10'))[_0x368b('0x11')](socket);function respondWithRpcPromise(_0x5a46f9,_0x160e12,_0xdbd344){return new BPromise(function(_0x34a110,_0x51d513){return client[_0x368b('0x12')](_0x5a46f9,_0xdbd344)[_0x368b('0x13')](function(_0x253e4b){logger['info'](_0x368b('0x14'),_0x160e12,_0x368b('0x15'));logger['debug'](_0x368b('0x16'),_0x160e12,_0x368b('0x15'),JSON[_0x368b('0x17')](_0x253e4b));if(_0x253e4b[_0x368b('0x18')]){if(_0x253e4b[_0x368b('0x18')]['code']===0x1f4){logger[_0x368b('0x18')](_0x368b('0x14'),_0x160e12,_0x253e4b['error'][_0x368b('0x19')]);return _0x51d513(_0x253e4b[_0x368b('0x18')][_0x368b('0x19')]);}logger['error'](_0x368b('0x14'),_0x160e12,_0x253e4b[_0x368b('0x18')][_0x368b('0x19')]);return _0x34a110(_0x253e4b['error'][_0x368b('0x19')]);}else{logger[_0x368b('0x1a')](_0x368b('0x14'),_0x160e12,'request\x20sent');_0x34a110(_0x253e4b['result'][_0x368b('0x19')]);}})[_0x368b('0x1b')](function(_0x2c3cec){logger[_0x368b('0x18')](_0x368b('0x14'),_0x160e12,_0x2c3cec);_0x51d513(_0x2c3cec);});});} \ No newline at end of file +var _0xba6f=['request\x20sent','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x392669,_0x3b060a){var _0x233103=function(_0x7c8b79){while(--_0x7c8b79){_0x392669['push'](_0x392669['shift']());}};_0x233103(++_0x3b060a);}(_0xba6f,0x1d0));var _0xfba6=function(_0x179cce,_0x239422){_0x179cce=_0x179cce-0x0;var _0x54ac6d=_0xba6f[_0x179cce];return _0x54ac6d;};'use strict';var _=require(_0xfba6('0x0'));var util=require('util');var moment=require(_0xfba6('0x1'));var BPromise=require(_0xfba6('0x2'));var rs=require(_0xfba6('0x3'));var fs=require('fs');var Redis=require(_0xfba6('0x4'));var db=require(_0xfba6('0x5'))['db'];var utils=require(_0xfba6('0x6'));var logger=require(_0xfba6('0x7'))(_0xfba6('0x8'));var config=require(_0xfba6('0x9'));var jayson=require(_0xfba6('0xa'));var client=jayson[_0xfba6('0xb')][_0xfba6('0xc')]({'port':0x232a});config[_0xfba6('0xd')]=_['defaults'](config[_0xfba6('0xd')],{'host':_0xfba6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0xfba6('0xf')](socket);function respondWithRpcPromise(_0x122858,_0x135378,_0x12ac8a){return new BPromise(function(_0x1ef8fd,_0x366c0e){return client[_0xfba6('0x10')](_0x122858,_0x12ac8a)[_0xfba6('0x11')](function(_0x3d4005){logger[_0xfba6('0x12')](_0xfba6('0x13'),_0x135378,'request\x20sent');logger[_0xfba6('0x14')](_0xfba6('0x15'),_0x135378,_0xfba6('0x16'),JSON[_0xfba6('0x17')](_0x3d4005));if(_0x3d4005['error']){if(_0x3d4005[_0xfba6('0x18')]['code']===0x1f4){logger['error'](_0xfba6('0x13'),_0x135378,_0x3d4005[_0xfba6('0x18')][_0xfba6('0x19')]);return _0x366c0e(_0x3d4005[_0xfba6('0x18')][_0xfba6('0x19')]);}logger[_0xfba6('0x18')](_0xfba6('0x13'),_0x135378,_0x3d4005[_0xfba6('0x18')][_0xfba6('0x19')]);return _0x1ef8fd(_0x3d4005[_0xfba6('0x18')][_0xfba6('0x19')]);}else{logger[_0xfba6('0x12')](_0xfba6('0x13'),_0x135378,'request\x20sent');_0x1ef8fd(_0x3d4005[_0xfba6('0x1a')][_0xfba6('0x19')]);}})['catch'](function(_0x581d0d){logger[_0xfba6('0x18')](_0xfba6('0x13'),_0x135378,_0x581d0d);_0x366c0e(_0x581d0d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d6dce98..e5ff2df 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 _0xc99a=['remove','update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0xf10bd7,_0x16b720){var _0x12b5c9=function(_0x498d98){while(--_0x498d98){_0xf10bd7['push'](_0xf10bd7['shift']());}};_0x12b5c9(++_0x16b720);}(_0xc99a,0x7c));var _0xac99=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc99a[_0x321bb2];return _0x9c12ed;};'use strict';var VoicePrefixEvents=require(_0xac99('0x0'));var events=[_0xac99('0x1'),_0xac99('0x2'),_0xac99('0x3')];function createListener(_0x3de0c0,_0xb984d0){return function(_0x4ef612){_0xb984d0[_0xac99('0x4')](_0x3de0c0,_0x4ef612);};}function removeListener(_0x98e7e4,_0x3054b0){return function(){VoicePrefixEvents[_0xac99('0x5')](_0x98e7e4,_0x3054b0);};}exports[_0xac99('0x6')]=function(_0x44294b){for(var _0x1a9116=0x0,_0x4594ec=events[_0xac99('0x7')];_0x1a9116<_0x4594ec;_0x1a9116++){var _0x1ae607=events[_0x1a9116];var _0x458f0b=createListener(_0xac99('0x8')+_0x1ae607,_0x44294b);VoicePrefixEvents['on'](_0x1ae607,_0x458f0b);}}; \ No newline at end of file +var _0x19c3=['emit','removeListener','length','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x19c3,0xf9));var _0x319c=function(_0x2f070c,_0x449fec){_0x2f070c=_0x2f070c-0x0;var _0x2e9788=_0x19c3[_0x2f070c];return _0x2e9788;};'use strict';var VoicePrefixEvents=require(_0x319c('0x0'));var events=['save',_0x319c('0x1'),_0x319c('0x2')];function createListener(_0x55e0b2,_0x1db6c9){return function(_0x259d2e){_0x1db6c9[_0x319c('0x3')](_0x55e0b2,_0x259d2e);};}function removeListener(_0x350517,_0x3a96b1){return function(){VoicePrefixEvents[_0x319c('0x4')](_0x350517,_0x3a96b1);};}exports['register']=function(_0x20f77e){for(var _0x53a1de=0x0,_0x2e38c4=events[_0x319c('0x5')];_0x53a1de<_0x2e38c4;_0x53a1de++){var _0x9a5cf8=events[_0x53a1de];var _0x306a4b=createListener(_0x319c('0x6')+_0x9a5cf8,_0x20f77e);VoicePrefixEvents['on'](_0x9a5cf8,_0x306a4b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 366f2a7..f6b02d3 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x12e52d,_0x5a9c86){var _0x23490e=function(_0x131434){while(--_0x131434){_0x12e52d['push'](_0x12e52d['shift']());}};_0x23490e(++_0x5a9c86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 a0ae0e9..fcf1a68 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 _0xf145=['power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','outbound','inbound','default','STRING','ringall','leastrecent','fewestcalls','rrmemory','linear','rrordered','setDataValue','getDataValue','booked','roundrobin','progressive','predictive','INTEGER','yes','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0x533489,_0xd4da83){var _0xc874fb=function(_0x38cafb){while(--_0x38cafb){_0x533489['push'](_0x533489['shift']());}};_0xc874fb(++_0xd4da83);}(_0xf145,0x17e));var _0x5f14=function(_0xb7bd46,_0x941298){_0xb7bd46=_0xb7bd46-0x0;var _0x2abe45=_0xf145[_0xb7bd46];return _0x2abe45;};'use strict';var Sequelize=require(_0x5f14('0x0'));module[_0x5f14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5f14('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5f14('0x3')]('inbound',_0x5f14('0x4')),'allowNull':![],'defaultValue':_0x5f14('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x5f14('0x6')},'announce':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5f14('0x3')]('rr',_0x5f14('0x8'),_0x5f14('0x9'),_0x5f14('0xa'),'random',_0x5f14('0xb'),_0x5f14('0xc'),'wrandom',_0x5f14('0xd')),'allowNull':![],'defaultValue':_0x5f14('0x8'),'set':function(_0x5a05a7){this[_0x5f14('0xe')]('strategy',_0x5a05a7?_0x5a05a7:_0x5f14('0xb'));},'get':function(){var _0x39f77c=this[_0x5f14('0xf')]('type');var _0x495d4d=this[_0x5f14('0xf')]('dialMethod');var _0x327356=this[_0x5f14('0xf')]('strategy');if(_0x39f77c==='inbound'){return _0x327356;}if(_0x495d4d===_0x5f14('0x10')&&_0x327356===_0x5f14('0xb')||_0x495d4d===_0x5f14('0x10')&&_0x327356===_0x5f14('0x11')){return _0x327356;}if(_0x495d4d===_0x5f14('0x12')||_0x495d4d===_0x5f14('0x13')||_0x495d4d==='power'){return _0x327356;}return null;}},'servicelevel':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x5f14('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':_0x5f14('0x15')},'autopause':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5f14('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5f14('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5f14('0x7')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x5f14('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x5f14('0x15'),'no'),'defaultValue':_0x5f14('0x15')},'announce_holdtime':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x5f14('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x5f14('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5f14('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5f14('0x7')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5f14('0x7')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5f14('0x7')]},'periodic_announce':{'type':Sequelize[_0x5f14('0x16')],'set':function(_0x2671df){this['setDataValue']('periodic_announce',_0x2671df?_0x2671df[_0x5f14('0x17')](','):[]);},'get':function(){return this[_0x5f14('0xf')]('periodic_announce')?this[_0x5f14('0xf')](_0x5f14('0x18'))[_0x5f14('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':_0x5f14('0x15'),'set':function(_0x4bb6f4){this[_0x5f14('0xe')](_0x5f14('0x1a'),_0x4bb6f4?_0x4bb6f4[_0x5f14('0x17')](','):undefined);},'get':function(){return this[_0x5f14('0xf')](_0x5f14('0x1a'))?this[_0x5f14('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':'no','set':function(_0x325c64){this[_0x5f14('0xe')](_0x5f14('0x1b'),_0x325c64?_0x325c64[_0x5f14('0x17')](','):undefined);},'get':function(){return this[_0x5f14('0xf')](_0x5f14('0x1b'))?this['getDataValue'](_0x5f14('0x1b'))[_0x5f14('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5f14('0x7')]},'description':{'type':Sequelize[_0x5f14('0x7')]},'acw':{'type':Sequelize[_0x5f14('0x1c')],'defaultValue':0x0,'set':function(_0x113f04){this[_0x5f14('0xe')](_0x5f14('0x1d'),_0x113f04);if(_0x113f04){if(this[_0x5f14('0xf')](_0x5f14('0x1e'))<0x2){this['setDataValue'](_0x5f14('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5f14('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5f14('0x1f')},'dialMethod':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x20'),_0x5f14('0x12'),_0x5f14('0x21'),'predictive','booked'),'defaultValue':_0x5f14('0x12'),'comment':_0x5f14('0x22')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x5f14('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5f14('0x24')},'dialLimitQueue':{'type':Sequelize[_0x5f14('0x14')](0x4)[_0x5f14('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5f14('0x25')},'dialPowerLevel':{'type':Sequelize[_0x5f14('0x26')](0x2)[_0x5f14('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5f14('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x28'),_0x5f14('0x29')),'defaultValue':_0x5f14('0x29'),'comment':_0x5f14('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5f14('0x26')](0x2)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5f14('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5f14('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5f14('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x5f14('0x2e'),'comment':_0x5f14('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x30')},'dialQueueProject':{'type':Sequelize[_0x5f14('0x7')],'comment':_0x5f14('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f14('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'comment':_0x5f14('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5f14('0x36')},'dialTimezone':{'type':Sequelize[_0x5f14('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5f14('0x3')](_0x5f14('0x37'),_0x5f14('0x38'),'onlyIfOpen'),'defaultValue':_0x5f14('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5f14('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5f14('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5f14('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5f14('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5f14('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x5f14('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5f14('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5f14('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5f14('0x14')](0x9)[_0x5f14('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5f14('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5f14('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5f14('0x41')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x5f14('0x42')),'defaultValue':_0x5f14('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x5f14('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5f14('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5f14('0x44')},'dialCutDigit':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5f14('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f14('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f14('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f14('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5f14('0x14')](0x3)[_0x5f14('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5f14('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5f14('0x14')](0x5)[_0x5f14('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5f14('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5f14('0x14')],'allowNull':!![],'comment':_0x5f14('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x5f14('0x1c')],'defaultValue':![],'comment':_0x5f14('0x50'),'set':function(_0x3d40fc){if(!_0x3d40fc)this[_0x5f14('0xe')](_0x5f14('0x51'),null);this['setDataValue'](_0x5f14('0x52'),_0x3d40fc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x5f14('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5f14('0x1c')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5f14('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0x5ec3=['inbound','outbound','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5ec3,0x147));var _0x35ec=function(_0x5ef540,_0x344730){_0x5ef540=_0x5ef540-0x0;var _0x53df7c=_0x5ec3[_0x5ef540];return _0x53df7c;};'use strict';var Sequelize=require(_0x35ec('0x0'));module[_0x35ec('0x1')]={'name':{'type':Sequelize[_0x35ec('0x2')],'allowNull':![],'unique':_0x35ec('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x5'),_0x35ec('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x35ec('0x4')]('rr',_0x35ec('0x7'),_0x35ec('0x8'),'fewestcalls',_0x35ec('0x9'),_0x35ec('0xa'),_0x35ec('0xb'),_0x35ec('0xc'),_0x35ec('0xd')),'allowNull':![],'defaultValue':_0x35ec('0x7'),'set':function(_0x457a4f){this[_0x35ec('0xe')](_0x35ec('0xf'),_0x457a4f?_0x457a4f:_0x35ec('0xa'));},'get':function(){var _0x54bfb5=this[_0x35ec('0x10')]('type');var _0x2a5b1c=this[_0x35ec('0x10')](_0x35ec('0x11'));var _0x1dce30=this[_0x35ec('0x10')](_0x35ec('0xf'));if(_0x54bfb5===_0x35ec('0x5')){return _0x1dce30;}if(_0x2a5b1c==='booked'&&_0x1dce30===_0x35ec('0xa')||_0x2a5b1c===_0x35ec('0x12')&&_0x1dce30===_0x35ec('0x13')){return _0x1dce30;}if(_0x2a5b1c===_0x35ec('0x14')||_0x2a5b1c===_0x35ec('0x15')||_0x2a5b1c===_0x35ec('0x16')){return _0x1dce30;}return null;}},'servicelevel':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x35ec('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':_0x35ec('0x18')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x35ec('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x35ec('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x35ec('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x35ec('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x35ec('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x35ec('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x35ec('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x35ec('0x4')]('yes','no'),'defaultValue':_0x35ec('0x18')},'announce_holdtime':{'type':Sequelize[_0x35ec('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x35ec('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x35ec('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x35ec('0x2')]},'queue_youarenext':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x35ec('0x2')]},'queue_quantity1':{'type':Sequelize[_0x35ec('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x35ec('0x2')]},'queue_less_than':{'type':Sequelize[_0x35ec('0x2')]},'periodic_announce':{'type':Sequelize[_0x35ec('0x1a')],'set':function(_0x586514){this[_0x35ec('0xe')](_0x35ec('0x1b'),_0x586514?_0x586514['join'](','):[]);},'get':function(){return this['getDataValue'](_0x35ec('0x1b'))?this[_0x35ec('0x10')](_0x35ec('0x1b'))[_0x35ec('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x35ec('0x18'),'set':function(_0x15d9b2){this[_0x35ec('0xe')](_0x35ec('0x1d'),_0x15d9b2?_0x15d9b2[_0x35ec('0x1e')](','):undefined);},'get':function(){return this[_0x35ec('0x10')](_0x35ec('0x1d'))?this[_0x35ec('0x10')]('joinempty')[_0x35ec('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x368b09){this[_0x35ec('0xe')](_0x35ec('0x1f'),_0x368b09?_0x368b09[_0x35ec('0x1e')](','):undefined);},'get':function(){return this[_0x35ec('0x10')](_0x35ec('0x1f'))?this[_0x35ec('0x10')](_0x35ec('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x35ec('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ec('0x2')]},'acw':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':0x0,'set':function(_0x317e2f){this[_0x35ec('0xe')](_0x35ec('0x21'),_0x317e2f);if(_0x317e2f){if(this[_0x35ec('0x10')](_0x35ec('0x22'))<0x2){this[_0x35ec('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x35ec('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':0x0,'comment':_0x35ec('0x23')},'dialMethod':{'type':Sequelize[_0x35ec('0x4')]('preview',_0x35ec('0x14'),_0x35ec('0x16'),_0x35ec('0x15'),_0x35ec('0x12')),'defaultValue':_0x35ec('0x14'),'comment':_0x35ec('0x24')},'dialLimitChannel':{'type':Sequelize[_0x35ec('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x35ec('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x35ec('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x35ec('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x35ec('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x35ec('0x4')]('agentBusyFactor','dropRate'),'defaultValue':_0x35ec('0x28'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x35ec('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x35ec('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x35ec('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x35ec('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x35ec('0x2c'),'comment':_0x35ec('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x35ec('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x35ec('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x35ec('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'comment':_0x35ec('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x35ec('0x17')](0x5)[_0x35ec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x33')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x35ec('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x35ec('0x34')},'dialTimezone':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':_0x35ec('0x35')},'dialPrefix':{'type':Sequelize[_0x35ec('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x35ec('0x4')]('always',_0x35ec('0x36'),_0x35ec('0x37')),'defaultValue':_0x35ec('0x38')},'dialAMDActive':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':0x0,'comment':_0x35ec('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x35ec('0x17')](0x9)[_0x35ec('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x35ec('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x35ec('0x17')](0x9)[_0x35ec('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x35ec('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x35ec('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x35ec('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x35ec('0x17')](0x9)[_0x35ec('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x35ec('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x35ec('0x17')](0x9)[_0x35ec('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x35ec('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x35ec('0x17')](0x9)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x35ec('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x35ec('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x35ec('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x35ec('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x35ec('0x17')](0x5)[_0x35ec('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x35ec('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':0x0,'comment':_0x35ec('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x35ec('0x4')](_0x35ec('0x43'),_0x35ec('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x35ec('0x2')],'comment':_0x35ec('0x45')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x35ec('0x46')},'dialCutDigit':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x35ec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x35ec('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x35ec('0x17')](0x5)[_0x35ec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x35ec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x35ec('0x17')](0x3)[_0x35ec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x35ec('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x35ec('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35ec('0x17')],'allowNull':!![],'comment':_0x35ec('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':![],'comment':_0x35ec('0x50'),'set':function(_0x2b7f28){if(!_0x2b7f28)this[_0x35ec('0xe')](_0x35ec('0x51'),null);this['setDataValue'](_0x35ec('0x52'),_0x2b7f28);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x35ec('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x35ec('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x35ec('0x20')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 42920c5..56b14d3 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 _0x4f79=['UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','all','union','ids','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','SIP/%s','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','ContactId','ListId','field','scheduledAt','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper','COALESCE(phone,\x27\x27)','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','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','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','count','limit','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','type','name','UserProfileResource','error','stack','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','params','getHoppers','findOne','CmHopper','pick','getHopperHistories','CmHopperHistory','getHopperFinals','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','transaction','TeamVoiceQueue','upsert','each'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4f79,0xf0));var _0x94f7=function(_0x2db143,_0x1c7fa2){_0x2db143=_0x2db143-0x0;var _0x3fdb56=_0x4f79[_0x2db143];return _0x3fdb56;};'use strict';var emlformat=require(_0x94f7('0x0'));var rimraf=require(_0x94f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94f7('0x2'));var rp=require(_0x94f7('0x3'));var moment=require(_0x94f7('0x4'));var BPromise=require(_0x94f7('0x5'));var Mustache=require(_0x94f7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x94f7('0x7'));var csv=require(_0x94f7('0x8'));var ejs=require(_0x94f7('0x9'));var fs=require('fs');var fs_extra=require(_0x94f7('0xa'));var _=require('lodash');var squel=require(_0x94f7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x94f7('0xc'));var toCsv=require(_0x94f7('0x8'));var querystring=require(_0x94f7('0xd'));var Papa=require(_0x94f7('0xe'));var Redis=require(_0x94f7('0xf'));var authService=require(_0x94f7('0x10'));var qs=require(_0x94f7('0x11'));var as=require(_0x94f7('0x12'));var hardwareService=require(_0x94f7('0x13'));var logger=require(_0x94f7('0x14'))(_0x94f7('0x15'));var utils=require('../../config/utils');var config=require(_0x94f7('0x16'));var licenseUtil=require(_0x94f7('0x17'));var db=require(_0x94f7('0x18'))['db'];config[_0x94f7('0x19')]=_['defaults'](config[_0x94f7('0x19')],{'host':_0x94f7('0x1a'),'port':0x18eb});var socket=require(_0x94f7('0x1b'))(new Redis(config[_0x94f7('0x19')]));require(_0x94f7('0x1c'))[_0x94f7('0x1d')](socket);function respondWithStatusCode(_0x3ba549,_0x46afc7){_0x46afc7=_0x46afc7||0xcc;return function(_0x9efc28){if(_0x9efc28){return _0x3ba549[_0x94f7('0x1e')](_0x46afc7);}return _0x3ba549[_0x94f7('0x1f')](_0x46afc7)[_0x94f7('0x20')]();};}function respondWithResult(_0x52904e,_0x283368){_0x283368=_0x283368||0xc8;return function(_0x5ae328){if(_0x5ae328){return _0x52904e['status'](_0x283368)[_0x94f7('0x21')](_0x5ae328);}};}function respondWithFilteredResult(_0x22bfb0,_0x54e592){return function(_0x1a7bf5){if(_0x1a7bf5){var _0x16e44b=typeof _0x54e592[_0x94f7('0x22')]==='undefined'&&typeof _0x54e592['limit']==='undefined';var _0x37d02b=_0x1a7bf5['count'];var _0x39dfb8=_0x16e44b?0x0:_0x54e592[_0x94f7('0x22')];var _0x53d063=_0x16e44b?_0x1a7bf5[_0x94f7('0x23')]:_0x54e592[_0x94f7('0x22')]+_0x54e592[_0x94f7('0x24')];var _0x5468ae;if(_0x53d063>=_0x37d02b){_0x53d063=_0x37d02b;_0x5468ae=0xc8;}else{_0x5468ae=0xce;}_0x22bfb0[_0x94f7('0x1f')](_0x5468ae);return _0x22bfb0['set'](_0x94f7('0x25'),_0x39dfb8+'-'+_0x53d063+'/'+_0x37d02b)['json'](_0x1a7bf5);}return null;};}function patchUpdates(_0x31099f){return function(_0x5e12eb){try{jsonpatch['apply'](_0x5e12eb,_0x31099f,!![]);}catch(_0x4b125a){return BPromise[_0x94f7('0x26')](_0x4b125a);}return _0x5e12eb[_0x94f7('0x27')]();};}function saveUpdates(_0x215a05,_0x13552e){return function(_0x529e00){if(_0x529e00){return _0x529e00[_0x94f7('0x28')](_0x215a05)[_0x94f7('0x29')](function(_0x5dad13){return _0x5dad13;});}return null;};}function removeEntity(_0x2bb37a,_0x5be43a){return function(_0x50999e){if(_0x50999e){return _0x50999e[_0x94f7('0x2a')]()[_0x94f7('0x29')](function(){var _0xa98f3d=_0x50999e[_0x94f7('0x2b')]({'plain':!![]});var _0x54539b=[{'name':_0x94f7('0x2c'),'value':_0x94f7('0x2d'),'ignore':![]},{'name':_0x94f7('0x2e'),'value':_0x94f7('0x2f'),'ignore':![]}];var _0x7558fc=_(_0x54539b)['filter'](_0x94f7('0x30'))[_0x94f7('0x31')](_0x94f7('0x32'))[_0x94f7('0x32')]();if(_['includes'](_0x7558fc,_0xa98f3d[_0x94f7('0x33')])){return;}var _0x215ede=_['find'](_0x54539b,[_0x94f7('0x32'),_0xa98f3d[_0x94f7('0x33')]])[_0x94f7('0x34')];return db[_0x94f7('0x35')][_0x94f7('0x2a')]({'where':{'type':_0x215ede,'resourceId':_0xa98f3d['id']}})['then'](function(){return _0x50999e;});})[_0x94f7('0x29')](function(){_0x2bb37a['status'](0xcc)[_0x94f7('0x20')]();});}};}function handleEntityNotFound(_0x1d5c54,_0x29b280){return function(_0xe6048d){if(!_0xe6048d){_0x1d5c54['sendStatus'](0x194);}return _0xe6048d;};}function handleError(_0x5576da,_0x31479f){_0x31479f=_0x31479f||0x1f4;return function(_0x157ea0){logger[_0x94f7('0x36')](_0x157ea0[_0x94f7('0x37')]);if(_0x157ea0[_0x94f7('0x34')]){delete _0x157ea0[_0x94f7('0x34')];}_0x5576da[_0x94f7('0x1f')](_0x31479f)['send'](_0x157ea0);};}exports[_0x94f7('0x38')]=function(_0x2d7279,_0x458b19){var _0x1ab53e={},_0x28e78a={},_0x14acc6={'count':0x0,'rows':[]};var _0xdad6c1=_[_0x94f7('0x31')](db[_0x94f7('0x39')][_0x94f7('0x3a')],function(_0x4837b8){return{'name':_0x4837b8[_0x94f7('0x3b')],'type':_0x4837b8[_0x94f7('0x33')]['key']};});_0x28e78a[_0x94f7('0x3c')]=_[_0x94f7('0x31')](_0xdad6c1,'name');_0x28e78a[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x2d7279[_0x94f7('0x3d')]);_0x28e78a[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x28e78a[_0x94f7('0x3c')],_0x28e78a[_0x94f7('0x3d')]);_0x1ab53e[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x28e78a[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0x2d7279[_0x94f7('0x3d')]['fields']));_0x1ab53e[_0x94f7('0x41')]=_0x1ab53e['attributes']['length']?_0x1ab53e[_0x94f7('0x41')]:_0x28e78a[_0x94f7('0x3c')];if(!_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x43')](_0x94f7('0x44'))){_0x1ab53e[_0x94f7('0x24')]=qs[_0x94f7('0x24')](_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x1ab53e['offset']=qs['offset'](_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x22')]);}_0x1ab53e[_0x94f7('0x45')]=qs[_0x94f7('0x46')](_0x2d7279['query'][_0x94f7('0x46')]);_0x1ab53e[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_['pick'](_0x2d7279[_0x94f7('0x3d')],_0x28e78a[_0x94f7('0x3f')]),_0xdad6c1);if(_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x1ab53e[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x1ab53e['where'],{'$or':_['map'](_0xdad6c1,function(_0x2a2453){if(_0x2a2453[_0x94f7('0x33')]!=='VIRTUAL'){var _0x22c45c={};_0x22c45c[_0x2a2453['name']]={'$like':'%'+_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x22c45c;}})});}_0x1ab53e=_[_0x94f7('0x49')]({},_0x1ab53e,_0x2d7279[_0x94f7('0x4a')]);var _0xbeb943={'where':_0x1ab53e[_0x94f7('0x47')]};return db['VoiceQueue'][_0x94f7('0x23')](_0xbeb943)[_0x94f7('0x29')](function(_0x34c935){_0x14acc6['count']=_0x34c935;if(_0x2d7279[_0x94f7('0x3d')][_0x94f7('0x4b')]){_0x1ab53e[_0x94f7('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0x94f7('0x4d')](_0x1ab53e);})['then'](function(_0x17fe54){_0x14acc6[_0x94f7('0x4e')]=_0x17fe54;return _0x14acc6;})[_0x94f7('0x29')](respondWithFilteredResult(_0x458b19,_0x1ab53e))[_0x94f7('0x4f')](handleError(_0x458b19,null));};exports[_0x94f7('0x50')]=function(_0x205d3c,_0x32076b){var _0x412a1e={'raw':![],'where':{'id':_0x205d3c['params']['id']}},_0x1536fe={};_0x1536fe[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db[_0x94f7('0x39')][_0x94f7('0x3a')]);_0x1536fe[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x205d3c[_0x94f7('0x3d')]);_0x1536fe['filters']=_[_0x94f7('0x40')](_0x1536fe[_0x94f7('0x3c')],_0x1536fe['query']);_0x412a1e[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x1536fe['model'],qs['fields'](_0x205d3c[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x412a1e[_0x94f7('0x41')]=_0x412a1e[_0x94f7('0x41')][_0x94f7('0x51')]?_0x412a1e[_0x94f7('0x41')]:_0x1536fe[_0x94f7('0x3c')];if(_0x205d3c['query'][_0x94f7('0x4b')]){_0x412a1e['include']=[{'all':!![]}];}_0x412a1e=_[_0x94f7('0x49')]({},_0x412a1e,_0x205d3c[_0x94f7('0x4a')]);return db[_0x94f7('0x39')][_0x94f7('0x52')](_0x412a1e)['then'](handleEntityNotFound(_0x32076b,null))[_0x94f7('0x29')](respondWithResult(_0x32076b,null))['catch'](handleError(_0x32076b,null));};exports[_0x94f7('0x53')]=function(_0x1c4c5f,_0x1518f5){return db[_0x94f7('0x39')][_0x94f7('0x53')](_0x1c4c5f[_0x94f7('0x54')],{})['then'](function(_0x2808c9){var _0x2e052c=_0x1c4c5f['user']['get']({'plain':!![]});if(!_0x2e052c)throw new Error(_0x94f7('0x55'));if(_0x2e052c['role']===_0x94f7('0x56')){var _0x5a33e7=_0x2808c9['get']({'plain':!![]});var _0x305899=[{'name':_0x94f7('0x2c'),'value':_0x94f7('0x2d')},{'name':_0x94f7('0x2e'),'value':_0x94f7('0x2f')}];var _0x4149b7=_['find'](_0x305899,[_0x94f7('0x32'),_0x5a33e7['type']])[_0x94f7('0x34')];return db[_0x94f7('0x57')][_0x94f7('0x52')]({'where':{'name':_0x4149b7,'userProfileId':_0x2e052c[_0x94f7('0x58')]},'raw':!![]})[_0x94f7('0x29')](function(_0x730a49){if(_0x730a49&&_0x730a49[_0x94f7('0x59')]===0x0){return db[_0x94f7('0x35')][_0x94f7('0x53')]({'name':_0x5a33e7[_0x94f7('0x34')],'resourceId':_0x5a33e7['id'],'type':_0x730a49[_0x94f7('0x34')],'sectionId':_0x730a49['id']},{})[_0x94f7('0x29')](function(){return _0x2808c9;});}else{return _0x2808c9;}})['catch'](function(_0x3a324f){logger[_0x94f7('0x36')](_0x94f7('0x5a'),_0x3a324f);throw _0x3a324f;});}return _0x2808c9;})[_0x94f7('0x29')](respondWithResult(_0x1518f5,0xc9))[_0x94f7('0x4f')](handleError(_0x1518f5,null));};exports['clone']=function(_0x4ce44e,_0x2b1ccf){var _0x27fecf={'where':{'id':_0x4ce44e['params']['id']}},_0x11cbfa={};_0x11cbfa['model']=_[_0x94f7('0x3e')](db[_0x94f7('0x39')][_0x94f7('0x3a')]);_0x27fecf[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x11cbfa[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0x4ce44e[_0x94f7('0x3d')]['fields']));_0x27fecf[_0x94f7('0x41')]=_0x27fecf[_0x94f7('0x41')][_0x94f7('0x51')]?_0x27fecf[_0x94f7('0x41')]:_0x11cbfa[_0x94f7('0x3c')];if(_0x4ce44e['query']['includeAll']){_0x27fecf[_0x94f7('0x4c')]=[{'all':!![]}];}_0x27fecf=_['merge']({},_0x27fecf,_0x4ce44e[_0x94f7('0x4a')]);return db['VoiceQueue']['find'](_0x27fecf)['then'](handleEntityNotFound(_0x2b1ccf,null))['then'](function(_0x48f7c3){if(_0x48f7c3){var _0x1d56df=_0x48f7c3[_0x94f7('0x2b')]({'plain':!![]});_0x1d56df=qs[_0x94f7('0x5b')](_0x1d56df,['id',_0x94f7('0x5c'),_0x94f7('0x5d')]);_0x4ce44e[_0x94f7('0x54')]=_[_0x94f7('0x5b')](_0x4ce44e[_0x94f7('0x54')],['id',_0x94f7('0x5c'),_0x94f7('0x5d')]);return db[_0x94f7('0x39')][_0x94f7('0x53')](_[_0x94f7('0x49')](_0x1d56df,_0x4ce44e['body']),{'include':_0x4ce44e[_0x94f7('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0x94f7('0x29')](function(_0x189e0a){var _0x3b77c8=_0x4ce44e[_0x94f7('0x56')][_0x94f7('0x2b')]({'plain':!![]});if(!_0x3b77c8)throw new Error(_0x94f7('0x55'));if(_0x3b77c8[_0x94f7('0x5e')]===_0x94f7('0x56')){var _0x1130fb=_0x189e0a[_0x94f7('0x2b')]({'plain':!![]});var _0x14c107=[{'name':_0x94f7('0x2c'),'value':_0x94f7('0x2d')},{'name':'QueueCampaigns','value':'outbound'}];var _0x1fcb3f=_['find'](_0x14c107,['value',_0x1130fb['type']])[_0x94f7('0x34')];return db[_0x94f7('0x57')][_0x94f7('0x52')]({'where':{'name':_0x1fcb3f,'userProfileId':_0x3b77c8[_0x94f7('0x58')]},'raw':!![]})[_0x94f7('0x29')](function(_0x56fc21){if(_0x56fc21&&_0x56fc21['autoAssociation']===0x0){return db['UserProfileResource'][_0x94f7('0x53')]({'name':_0x1130fb[_0x94f7('0x34')],'resourceId':_0x1130fb['id'],'type':_0x56fc21['name'],'sectionId':_0x56fc21['id']},{})[_0x94f7('0x29')](function(){return _0x189e0a;});}else{return _0x189e0a;}})[_0x94f7('0x4f')](function(_0x9056c7){logger[_0x94f7('0x36')](_0x94f7('0x5a'),_0x9056c7);throw _0x9056c7;});}return _0x189e0a;});}})[_0x94f7('0x29')](respondWithResult(_0x2b1ccf,0xc9))[_0x94f7('0x4f')](handleError(_0x2b1ccf,null));};exports[_0x94f7('0x28')]=function(_0x1e87d7,_0x46339e){if(_0x1e87d7[_0x94f7('0x54')]['id']){delete _0x1e87d7['body']['id'];}return db[_0x94f7('0x39')][_0x94f7('0x52')]({'where':{'id':_0x1e87d7['params']['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x46339e,null))[_0x94f7('0x29')](saveUpdates(_0x1e87d7[_0x94f7('0x54')],null))['then'](respondWithResult(_0x46339e,null))[_0x94f7('0x4f')](handleError(_0x46339e,null));};exports[_0x94f7('0x2a')]=function(_0x2c4e92,_0x398436){return db[_0x94f7('0x39')]['find']({'where':{'id':_0x2c4e92[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x398436,null))['then'](removeEntity(_0x398436,null))[_0x94f7('0x4f')](handleError(_0x398436,null));};exports[_0x94f7('0x60')]=function(_0xe3a392,_0x3a3ee9,_0x1721a6){var _0x351ede={'raw':![],'where':{}};var _0x14fb6f={};var _0x308b90={'count':0x0,'rows':[]};return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0xe3a392['params']['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x3a3ee9,null))[_0x94f7('0x29')](function(_0x531a28){if(_0x531a28){_0x14fb6f['model']=_[_0x94f7('0x3e')](db[_0x94f7('0x62')]['rawAttributes']);_0x14fb6f[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0xe3a392[_0x94f7('0x3d')]);_0x14fb6f[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x14fb6f[_0x94f7('0x3c')],_0x14fb6f['query']);_0x351ede[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x14fb6f[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0xe3a392[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x351ede['attributes']=_0x351ede[_0x94f7('0x41')]['length']?_0x351ede['attributes']:_0x14fb6f[_0x94f7('0x3c')];if(!_0xe3a392['query'][_0x94f7('0x43')](_0x94f7('0x44'))){_0x351ede[_0x94f7('0x24')]=qs[_0x94f7('0x24')](_0xe3a392[_0x94f7('0x3d')]['limit']);_0x351ede[_0x94f7('0x22')]=qs[_0x94f7('0x22')](_0xe3a392['query'][_0x94f7('0x22')]);}_0x351ede['order']=qs[_0x94f7('0x46')](_0xe3a392['query'][_0x94f7('0x46')]);_0x351ede[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0xe3a392[_0x94f7('0x3d')],_0x14fb6f[_0x94f7('0x3f')]));_0x351ede[_0x94f7('0x47')]['VoiceQueueId']=_0x531a28['id'];if(_0xe3a392[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x351ede[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x351ede[_0x94f7('0x47')],{'$or':_['map'](_0x351ede['attributes'],function(_0x184597){var _0x3faf1d={};_0x3faf1d[_0x184597]={'$like':'%'+_0xe3a392[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x3faf1d;})});}_0x351ede=_[_0x94f7('0x49')]({},_0x351ede,_0xe3a392[_0x94f7('0x4a')]);return db[_0x94f7('0x62')]['count']({'where':_0x351ede[_0x94f7('0x47')]})['then'](function(_0x4f7b6f){_0x308b90[_0x94f7('0x23')]=_0x4f7b6f;if(_0xe3a392[_0x94f7('0x3d')][_0x94f7('0x4b')]){_0x351ede[_0x94f7('0x4c')]=[{'all':!![]}];}return db[_0x94f7('0x62')][_0x94f7('0x4d')](_0x351ede);})[_0x94f7('0x29')](function(_0x334f63){_0x308b90[_0x94f7('0x4e')]=_0x334f63;return _0x308b90;});}})['then'](respondWithFilteredResult(_0x3a3ee9,_0x351ede))[_0x94f7('0x4f')](handleError(_0x3a3ee9,null));};exports[_0x94f7('0x64')]=function(_0x5624cf,_0x228a95,_0x2cdc6c){var _0x563e68={'raw':!![],'where':{}};var _0x358470={};var _0x19eb94={'count':0x0,'rows':[]};return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x5624cf[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x228a95,null))[_0x94f7('0x29')](function(_0x107ab1){if(_0x107ab1){_0x358470[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db['CmHopperHistory']['rawAttributes']);_0x358470[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x5624cf[_0x94f7('0x3d')]);_0x358470['filters']=_[_0x94f7('0x40')](_0x358470['model'],_0x358470[_0x94f7('0x3d')]);_0x563e68[_0x94f7('0x41')]=_['intersection'](_0x358470[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0x5624cf[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x563e68[_0x94f7('0x41')]=_0x563e68[_0x94f7('0x41')][_0x94f7('0x51')]?_0x563e68['attributes']:_0x358470[_0x94f7('0x3c')];if(!_0x5624cf[_0x94f7('0x3d')]['hasOwnProperty'](_0x94f7('0x44'))){_0x563e68['limit']=qs[_0x94f7('0x24')](_0x5624cf[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x563e68[_0x94f7('0x22')]=qs['offset'](_0x5624cf[_0x94f7('0x3d')][_0x94f7('0x22')]);}_0x563e68[_0x94f7('0x45')]=qs[_0x94f7('0x46')](_0x5624cf[_0x94f7('0x3d')]['sort']);_0x563e68['where']=qs[_0x94f7('0x3f')](_['pick'](_0x5624cf['query'],_0x358470[_0x94f7('0x3f')]));_0x563e68['where']['VoiceQueueId']=_0x107ab1['id'];if(_0x5624cf[_0x94f7('0x3d')]['filter']){_0x563e68[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x563e68['where'],{'$or':_[_0x94f7('0x31')](_0x563e68['attributes'],function(_0x21ee14){var _0x477b3c={};_0x477b3c[_0x21ee14]={'$like':'%'+_0x5624cf['query']['filter']+'%'};return _0x477b3c;})});}_0x563e68=_[_0x94f7('0x49')]({},_0x563e68,_0x5624cf[_0x94f7('0x4a')]);return db[_0x94f7('0x65')]['count']({'where':_0x563e68[_0x94f7('0x47')]})[_0x94f7('0x29')](function(_0x53e1a1){_0x19eb94['count']=_0x53e1a1;if(_0x5624cf[_0x94f7('0x3d')][_0x94f7('0x4b')]){_0x563e68['include']=[{'all':!![]}];}return db[_0x94f7('0x65')][_0x94f7('0x4d')](_0x563e68);})[_0x94f7('0x29')](function(_0x513dbe){_0x19eb94[_0x94f7('0x4e')]=_0x513dbe;return _0x19eb94;});}})[_0x94f7('0x29')](respondWithFilteredResult(_0x228a95,_0x563e68))[_0x94f7('0x4f')](handleError(_0x228a95,null));};exports[_0x94f7('0x66')]=function(_0x3d494e,_0x1dc77e,_0x1661ca){var _0x478105={'raw':!![],'where':{}};var _0x1b9b9a={};var _0x4ee863={'count':0x0,'rows':[]};return db[_0x94f7('0x39')]['findOne']({'where':{'id':_0x3d494e['params']['id']}})['then'](handleEntityNotFound(_0x1dc77e,null))[_0x94f7('0x29')](function(_0x8e6561){if(_0x8e6561){_0x1b9b9a[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db['CmHopperFinal'][_0x94f7('0x3a')]);_0x1b9b9a[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x3d494e[_0x94f7('0x3d')]);_0x1b9b9a[_0x94f7('0x3f')]=_['intersection'](_0x1b9b9a[_0x94f7('0x3c')],_0x1b9b9a[_0x94f7('0x3d')]);_0x478105[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x1b9b9a[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0x3d494e[_0x94f7('0x3d')]['fields']));_0x478105['attributes']=_0x478105[_0x94f7('0x41')][_0x94f7('0x51')]?_0x478105[_0x94f7('0x41')]:_0x1b9b9a[_0x94f7('0x3c')];if(!_0x3d494e[_0x94f7('0x3d')][_0x94f7('0x43')](_0x94f7('0x44'))){_0x478105[_0x94f7('0x24')]=qs[_0x94f7('0x24')](_0x3d494e[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x478105['offset']=qs[_0x94f7('0x22')](_0x3d494e[_0x94f7('0x3d')][_0x94f7('0x22')]);}_0x478105[_0x94f7('0x45')]=qs['sort'](_0x3d494e[_0x94f7('0x3d')][_0x94f7('0x46')]);_0x478105[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0x3d494e[_0x94f7('0x3d')],_0x1b9b9a[_0x94f7('0x3f')]));_0x478105[_0x94f7('0x47')][_0x94f7('0x67')]=_0x8e6561['id'];if(_0x3d494e['query'][_0x94f7('0x48')]){_0x478105[_0x94f7('0x47')]=_['merge'](_0x478105[_0x94f7('0x47')],{'$or':_['map'](_0x478105[_0x94f7('0x41')],function(_0x502a01){var _0x1898b3={};_0x1898b3[_0x502a01]={'$like':'%'+_0x3d494e['query']['filter']+'%'};return _0x1898b3;})});}_0x478105=_[_0x94f7('0x49')]({},_0x478105,_0x3d494e['options']);return db[_0x94f7('0x68')][_0x94f7('0x23')]({'where':_0x478105['where']})[_0x94f7('0x29')](function(_0x1f4b71){_0x4ee863[_0x94f7('0x23')]=_0x1f4b71;if(_0x3d494e[_0x94f7('0x3d')][_0x94f7('0x4b')]){_0x478105[_0x94f7('0x4c')]=[{'all':!![]}];}return db[_0x94f7('0x68')]['findAll'](_0x478105);})[_0x94f7('0x29')](function(_0x26ee0d){_0x4ee863[_0x94f7('0x4e')]=_0x26ee0d;return _0x4ee863;});}})[_0x94f7('0x29')](respondWithFilteredResult(_0x1dc77e,_0x478105))['catch'](handleError(_0x1dc77e,null));};exports[_0x94f7('0x69')]=function(_0x2302ab,_0x320a45,_0x1921a7){var _0x22a7e7={'raw':!![],'where':{}};var _0x16f112={};var _0x34f2af={'count':0x0,'rows':[]};return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x2302ab['params']['id']}})['then'](handleEntityNotFound(_0x320a45,null))[_0x94f7('0x29')](function(_0x3bfb25){if(_0x3bfb25){_0x16f112[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db['CmHopperBlack'][_0x94f7('0x3a')]);_0x16f112[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x2302ab[_0x94f7('0x3d')]);_0x16f112[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x16f112[_0x94f7('0x3c')],_0x16f112['query']);_0x22a7e7[_0x94f7('0x41')]=_['intersection'](_0x16f112['model'],qs[_0x94f7('0x42')](_0x2302ab[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x22a7e7[_0x94f7('0x41')]=_0x22a7e7[_0x94f7('0x41')][_0x94f7('0x51')]?_0x22a7e7[_0x94f7('0x41')]:_0x16f112['model'];if(!_0x2302ab[_0x94f7('0x3d')][_0x94f7('0x43')](_0x94f7('0x44'))){_0x22a7e7['limit']=qs[_0x94f7('0x24')](_0x2302ab['query'][_0x94f7('0x24')]);_0x22a7e7[_0x94f7('0x22')]=qs[_0x94f7('0x22')](_0x2302ab['query'][_0x94f7('0x22')]);}_0x22a7e7['order']=qs['sort'](_0x2302ab[_0x94f7('0x3d')][_0x94f7('0x46')]);_0x22a7e7[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0x2302ab[_0x94f7('0x3d')],_0x16f112[_0x94f7('0x3f')]));_0x22a7e7[_0x94f7('0x47')][_0x94f7('0x67')]=_0x3bfb25['id'];if(_0x2302ab[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x22a7e7[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x22a7e7[_0x94f7('0x47')],{'$or':_['map'](_0x22a7e7['attributes'],function(_0x1a2843){var _0x4fcd0a={};_0x4fcd0a[_0x1a2843]={'$like':'%'+_0x2302ab[_0x94f7('0x3d')]['filter']+'%'};return _0x4fcd0a;})});}_0x22a7e7=_['merge']({},_0x22a7e7,_0x2302ab['options']);return db['CmHopperBlack'][_0x94f7('0x23')]({'where':_0x22a7e7[_0x94f7('0x47')]})[_0x94f7('0x29')](function(_0x311745){_0x34f2af[_0x94f7('0x23')]=_0x311745;if(_0x2302ab[_0x94f7('0x3d')][_0x94f7('0x4b')]){_0x22a7e7[_0x94f7('0x4c')]=[{'all':!![]}];}return db[_0x94f7('0x6a')][_0x94f7('0x4d')](_0x22a7e7);})[_0x94f7('0x29')](function(_0x115cee){_0x34f2af['rows']=_0x115cee;return _0x34f2af;});}})[_0x94f7('0x29')](respondWithFilteredResult(_0x320a45,_0x22a7e7))[_0x94f7('0x4f')](handleError(_0x320a45,null));};exports[_0x94f7('0x6b')]=function(_0x475ad4,_0x4c1204,_0x43778d){var _0x1afadd={};var _0x278cad={};var _0xa769dd;var _0x362bec;return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x475ad4[_0x94f7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4c1204,null))[_0x94f7('0x29')](function(_0x48a4bc){if(_0x48a4bc){_0xa769dd=_0x48a4bc;_0x278cad[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db[_0x94f7('0x6c')]['rawAttributes']);_0x278cad[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0x475ad4[_0x94f7('0x3d')]);_0x278cad[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x278cad[_0x94f7('0x3c')],_0x278cad[_0x94f7('0x3d')]);_0x1afadd[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x278cad['model'],qs['fields'](_0x475ad4['query']['fields']));_0x1afadd[_0x94f7('0x41')]=_0x1afadd[_0x94f7('0x41')]['length']?_0x1afadd[_0x94f7('0x41')]:_0x278cad[_0x94f7('0x3c')];_0x1afadd[_0x94f7('0x45')]=qs['sort'](_0x475ad4[_0x94f7('0x3d')][_0x94f7('0x46')]);_0x1afadd[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0x475ad4[_0x94f7('0x3d')],_0x278cad[_0x94f7('0x3f')]));if(_0x475ad4['query'][_0x94f7('0x48')]){_0x1afadd[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x1afadd[_0x94f7('0x47')],{'$or':_[_0x94f7('0x31')](_0x1afadd['attributes'],function(_0x43e04f){var _0x2b5fa9={};_0x2b5fa9[_0x43e04f]={'$like':'%'+_0x475ad4[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x2b5fa9;})});}_0x1afadd=_[_0x94f7('0x49')]({},_0x1afadd,_0x475ad4[_0x94f7('0x4a')]);return _0xa769dd[_0x94f7('0x6b')](_0x1afadd);}})[_0x94f7('0x29')](function(_0x1669da){if(_0x1669da){_0x362bec=_0x1669da[_0x94f7('0x51')];if(!_0x475ad4[_0x94f7('0x3d')][_0x94f7('0x43')]('nolimit')){_0x1afadd[_0x94f7('0x24')]=qs[_0x94f7('0x24')](_0x475ad4['query'][_0x94f7('0x24')]);_0x1afadd['offset']=qs[_0x94f7('0x22')](_0x475ad4[_0x94f7('0x3d')][_0x94f7('0x22')]);}return _0xa769dd[_0x94f7('0x6b')](_0x1afadd);}})[_0x94f7('0x29')](function(_0x1c75f7){if(_0x1c75f7){return _0x1c75f7?{'count':_0x362bec,'rows':_0x1c75f7}:null;}})['then'](respondWithResult(_0x4c1204,null))[_0x94f7('0x4f')](handleError(_0x4c1204,null));};exports[_0x94f7('0x6d')]=function(_0x139cf1,_0x2ee1b8,_0x3051c9){var _0x4e8278=_0x139cf1[_0x94f7('0x54')]['teams'];var _0x2bd39e=_[_0x94f7('0x31')](_0x4e8278,'id');return db[_0x94f7('0x6c')]['findAll']({'where':{'id':_0x2bd39e},'attributes':['id'],'include':[{'model':db[_0x94f7('0x6e')],'as':'Agents','attributes':['id','name',_0x94f7('0x6f'),_0x94f7('0x70'),_0x94f7('0x71')],'raw':!![]}]})[_0x94f7('0x29')](function(_0x573c42){if(_0x573c42){var _0x2d602b=_[_0x94f7('0x72')](_0x573c42,function(_0x466b71){var _0x38ac30=_0x466b71[_0x94f7('0x2b')]({'plain':!![]});_0x38ac30[_0x94f7('0x73')][_0x94f7('0x74')](function(_0x342825){_0x342825[_0x94f7('0x75')]=_['find'](_0x4e8278,{'id':_0x38ac30['id']})[_0x94f7('0x75')];});return _0x38ac30[_0x94f7('0x73')];});return db[_0x94f7('0x39')]['find']({'where':{'id':_0x139cf1['params']['id']}})[_0x94f7('0x29')](function(_0x4ffd51){return db['sequelize'][_0x94f7('0x76')](function(_0x6f44bf){return _0x4ffd51['addTeams'](_0x2bd39e,{'transaction':_0x6f44bf})[_0x94f7('0x29')](function(){return BPromise['each'](_0x4e8278,function(_0x530c19){return db[_0x94f7('0x77')][_0x94f7('0x78')]({'TeamId':_0x530c19['id'],'VoiceQueueId':_0x139cf1[_0x94f7('0x5f')]['id'],'penalty':_0x530c19['penalty']},{'transaction':_0x6f44bf});});})[_0x94f7('0x29')](function(){return BPromise[_0x94f7('0x79')](_0x2d602b,function(_0x2df6cb){return db[_0x94f7('0x7a')][_0x94f7('0x7b')]({'where':{'UserId':_0x2df6cb['id'],'VoiceQueueId':_0x139cf1[_0x94f7('0x5f')]['id']},'defaults':{'penalty':_0x2df6cb[_0x94f7('0x75')]},'transaction':_0x6f44bf});});})[_0x94f7('0x29')](function(){return BPromise[_0x94f7('0x79')](_['filter'](_0x2d602b,{'online':!![]}),function(_0x2216a9){return db[_0x94f7('0x7c')][_0x94f7('0x78')]({'membername':_0x2216a9[_0x94f7('0x34')],'UserId':_0x2216a9['id'],'queue_name':_0x4ffd51[_0x94f7('0x34')],'VoiceQueueId':_0x4ffd51['id'],'interface':_[_0x94f7('0x7d')](_0x2216a9[_0x94f7('0x71')])?util[_0x94f7('0x7e')]('SIP/%s',_0x2216a9[_0x94f7('0x34')]):_0x2216a9[_0x94f7('0x71')],'paused':_0x2216a9[_0x94f7('0x70')]||![],'penalty':_0x2216a9[_0x94f7('0x75')]},{'transaction':_0x6f44bf});});})['then'](function(){_0x2d602b[_0x94f7('0x74')](function(_0x413533){socket[_0x94f7('0x7f')](_0x94f7('0x80'),{'UserId':_0x413533['id'],'VoiceQueueId':_0x4ffd51['id']});});});});});}})['then'](respondWithStatusCode(_0x2ee1b8,null))['catch'](handleError(_0x2ee1b8,null));};exports['removeTeams']=function(_0x1dad19,_0x477712,_0x2c3483){return db[_0x94f7('0x6c')][_0x94f7('0x4d')]({'where':{'id':_0x1dad19[_0x94f7('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x94f7('0x73'),'attributes':['id'],'raw':!![]}]})[_0x94f7('0x29')](handleEntityNotFound(_0x477712,null))[_0x94f7('0x29')](function(_0x2e56fa){var _0x1c4053=_[_0x94f7('0x31')](_0x2e56fa,'id');var _0x588644=[];var _0x5b4ec1=[];var _0x237f60=squel['select']();_0x237f60['field'](_0x94f7('0x81'))[_0x94f7('0x82')]('team_has_voice_queues','tq')[_0x94f7('0x83')](_0x94f7('0x84'),'ut',_0x94f7('0x85'))['where'](_0x94f7('0x86'),_0x1dad19[_0x94f7('0x5f')]['id']);for(var _0x2dab7d=0x0;_0x2dab7d<_0x2e56fa[_0x94f7('0x51')];_0x2dab7d+=0x1){let _0x304349=_0x2e56fa[_0x2dab7d];for(var _0x4dd880=0x0;_0x4dd880<_0x304349[_0x94f7('0x73')][_0x94f7('0x51')];_0x4dd880+=0x1){let _0x31163d=_0x304349[_0x94f7('0x73')][_0x4dd880];var _0x5db9a4=_0x237f60['clone']();_0x5db9a4[_0x94f7('0x47')](_0x94f7('0x87'),_0x31163d['id']);_0x5b4ec1[_0x94f7('0x88')](db[_0x94f7('0x89')]['query'](_0x5db9a4[_0x94f7('0x8a')](),{'type':db[_0x94f7('0x89')][_0x94f7('0x8b')]['SELECT']})[_0x94f7('0x29')](function(_0x26d057){if(_0x26d057[_0x94f7('0x51')]===0x1){return _0x31163d['id'];}else{var _0x17149c=_['every'](_['map'](_0x26d057,_0x94f7('0x8c')),function(_0x33d83a){return _['includes'](_0x1c4053,_0x33d83a);});if(_0x17149c){return _0x31163d['id'];}}}));}}return BPromise[_0x94f7('0x8d')](_0x5b4ec1)['then'](function(_0xaa9e53){_0x588644=_(_0x588644)[_0x94f7('0x8e')](_0xaa9e53)['compact']()['value']();return db[_0x94f7('0x39')]['find']({'where':{'id':_0x1dad19[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](function(_0x4c2051){return db[_0x94f7('0x89')][_0x94f7('0x76')](function(_0x1bef11){return _0x4c2051['removeTeams'](_0x1dad19[_0x94f7('0x3d')][_0x94f7('0x8f')],{'transaction':_0x1bef11})[_0x94f7('0x29')](function(){if(!_['isEmpty'](_0x588644)){return _0x4c2051[_0x94f7('0x90')](_0x588644,{'transaction':_0x1bef11})[_0x94f7('0x29')](function(){return db[_0x94f7('0x7c')][_0x94f7('0x2a')]({'where':{'VoiceQueueId':_0x1dad19[_0x94f7('0x5f')]['id'],'UserId':_0x588644},'transaction':_0x1bef11});});}})['then'](function(){_0x588644['forEach'](function(_0x8073a2){socket[_0x94f7('0x7f')](_0x94f7('0x91'),{'UserId':_0x8073a2,'VoiceQueueId':_0x4c2051['id']});});});});});});})['then'](respondWithStatusCode(_0x477712,null))['catch'](handleError(_0x477712,null));};exports['addAgents']=function(_0x1b58e3,_0xc2582f,_0xc74c1a){var _0x530544,_0xd2ac0d;return db[_0x94f7('0x39')][_0x94f7('0x52')]({'where':{'id':_0x1b58e3['params']['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0xc2582f,null))[_0x94f7('0x29')](function(_0x505f9e){if(_0x505f9e){_0xd2ac0d=_0x505f9e;return _0x505f9e[_0x94f7('0x92')](_0x1b58e3[_0x94f7('0x54')]['ids'],_[_0x94f7('0x5b')](_0x1b58e3[_0x94f7('0x54')],[_0x94f7('0x8f'),'id'])||{})[_0x94f7('0x93')](function(_0x37ca1b){for(var _0x18ce9b=0x0;_0x18ce9b<_0x1b58e3[_0x94f7('0x54')]['ids'][_0x94f7('0x51')];_0x18ce9b+=0x1){socket[_0x94f7('0x7f')](_0x94f7('0x80'),{'UserId':Number(_0x1b58e3[_0x94f7('0x54')][_0x94f7('0x8f')][_0x18ce9b]),'VoiceQueueId':Number(_0x1b58e3[_0x94f7('0x5f')]['id'])});}return _0x37ca1b;});}})['then'](function(_0x24fbd3){_0x530544=_0x24fbd3||[];if(_0xd2ac0d){return db['User'][_0x94f7('0x4d')]({'where':{'id':_0x1b58e3['body']['ids']},'attributes':['id','name',_0x94f7('0x6f'),_0x94f7('0x70'),'interface'],'raw':!![]});}})[_0x94f7('0x29')](function(_0x25f522){if(!_[_0x94f7('0x94')](_0x25f522)){var _0x16a283=[];for(var _0x2acac3=0x0;_0x2acac3<_0x25f522[_0x94f7('0x51')];_0x2acac3++){if(_0x25f522[_0x2acac3][_0x94f7('0x6f')]){_0x16a283[_0x94f7('0x88')](db[_0x94f7('0x7c')]['upsert']({'membername':_0x25f522[_0x2acac3][_0x94f7('0x34')],'UserId':_0x25f522[_0x2acac3]['id'],'queue_name':_0xd2ac0d[_0x94f7('0x34')],'VoiceQueueId':_0xd2ac0d['id'],'interface':_[_0x94f7('0x7d')](_0x25f522[_0x2acac3][_0x94f7('0x71')])?util[_0x94f7('0x7e')](_0x94f7('0x95'),_0x25f522[_0x2acac3][_0x94f7('0x34')]):_0x25f522[_0x2acac3][_0x94f7('0x71')],'paused':_0x25f522[_0x2acac3][_0x94f7('0x70')]||![],'penalty':_0x1b58e3['body'][_0x94f7('0x75')]||0x0}));}}return BPromise[_0x94f7('0x8d')](_0x16a283);}})['then'](function(){return _0x530544;})[_0x94f7('0x29')](respondWithResult(_0xc2582f,null))['catch'](handleError(_0xc2582f,null));};exports[_0x94f7('0x90')]=function(_0x23c656,_0x59e2b4,_0x34b81e){return db[_0x94f7('0x39')][_0x94f7('0x52')]({'where':{'id':_0x23c656[_0x94f7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x59e2b4,null))['then'](function(_0x317c9b){if(_0x317c9b){return _0x317c9b[_0x94f7('0x90')](_0x23c656['query'][_0x94f7('0x8f')])['then'](function(){if(_['isArray'](_0x23c656[_0x94f7('0x3d')]['ids'])){for(var _0x5ecd5a=0x0;_0x5ecd5a<_0x23c656[_0x94f7('0x3d')]['ids']['length'];_0x5ecd5a+=0x1){socket[_0x94f7('0x7f')](_0x94f7('0x91'),{'UserId':Number(_0x23c656[_0x94f7('0x3d')]['ids'][_0x5ecd5a]),'VoiceQueueId':Number(_0x23c656[_0x94f7('0x5f')]['id'])});}}else{socket[_0x94f7('0x7f')](_0x94f7('0x91'),{'UserId':Number(_0x23c656[_0x94f7('0x3d')]['ids']),'VoiceQueueId':Number(_0x23c656[_0x94f7('0x5f')]['id'])});}});}})[_0x94f7('0x29')](function(_0xceeaa6){return db[_0x94f7('0x7c')][_0x94f7('0x2a')]({'where':{'VoiceQueueId':_0x23c656['params']['id'],'UserId':_0x23c656[_0x94f7('0x3d')]['ids']}})['then'](function(){return _0xceeaa6;});})[_0x94f7('0x29')](respondWithStatusCode(_0x59e2b4,null))[_0x94f7('0x4f')](handleError(_0x59e2b4,null));};exports[_0x94f7('0x96')]=function(_0x2c8c12,_0x4c75bb,_0xedf3d3){var _0x3fba49={};var _0x43ef11={};var _0xfc098f;var _0x3df48c;return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x2c8c12[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x4c75bb,null))[_0x94f7('0x29')](function(_0xd1bac1){if(_0xd1bac1){_0xfc098f=_0xd1bac1;_0x43ef11[_0x94f7('0x3c')]=_['keys'](db['User'][_0x94f7('0x3a')]);_0x43ef11[_0x94f7('0x3d')]=_['keys'](_0x2c8c12[_0x94f7('0x3d')]);_0x43ef11[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x43ef11[_0x94f7('0x3c')],_0x43ef11['query']);_0x3fba49[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x43ef11[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0x2c8c12[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x3fba49[_0x94f7('0x41')]=_0x3fba49[_0x94f7('0x41')][_0x94f7('0x51')]?_0x3fba49[_0x94f7('0x41')]:_0x43ef11[_0x94f7('0x3c')];_0x3fba49[_0x94f7('0x45')]=qs[_0x94f7('0x46')](_0x2c8c12['query'][_0x94f7('0x46')]);_0x3fba49[_0x94f7('0x47')]=qs['filters'](_[_0x94f7('0x63')](_0x2c8c12[_0x94f7('0x3d')],_0x43ef11[_0x94f7('0x3f')]));if(_0x2c8c12[_0x94f7('0x3d')]['filter']){_0x3fba49[_0x94f7('0x47')]=_['merge'](_0x3fba49[_0x94f7('0x47')],{'$or':_['map'](_0x3fba49[_0x94f7('0x41')],function(_0x59ae56){var _0x373bbb={};_0x373bbb[_0x59ae56]={'$like':'%'+_0x2c8c12[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x373bbb;})});}_0x3fba49=_['merge']({},_0x3fba49,_0x2c8c12[_0x94f7('0x4a')]);return _0xfc098f[_0x94f7('0x96')](_0x3fba49);}})[_0x94f7('0x29')](function(_0xbf55db){if(_0xbf55db){_0x3df48c=_0xbf55db[_0x94f7('0x51')];if(!_0x2c8c12[_0x94f7('0x3d')]['hasOwnProperty'](_0x94f7('0x44'))){_0x3fba49['limit']=qs[_0x94f7('0x24')](_0x2c8c12[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x3fba49[_0x94f7('0x22')]=qs[_0x94f7('0x22')](_0x2c8c12[_0x94f7('0x3d')][_0x94f7('0x22')]);}return _0xfc098f[_0x94f7('0x96')](_0x3fba49);}})[_0x94f7('0x29')](function(_0x272e79){if(_0x272e79){return _0x272e79?{'count':_0x3df48c,'rows':_0x272e79}:null;}})[_0x94f7('0x29')](respondWithResult(_0x4c75bb,null))[_0x94f7('0x4f')](handleError(_0x4c75bb,null));};exports['getMembers']=function(_0x5e1513,_0x45f71d,_0x2aab5b){var _0x14631d={};var _0x31b312={};var _0x3692eb;var _0x3595a9;return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x5e1513['params']['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x45f71d,null))[_0x94f7('0x29')](function(_0x1ccd73){if(_0x1ccd73){_0x3692eb=_0x1ccd73;_0x31b312[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db[_0x94f7('0x7c')]['rawAttributes']);_0x31b312['query']=_[_0x94f7('0x3e')](_0x5e1513[_0x94f7('0x3d')]);_0x31b312['filters']=_[_0x94f7('0x40')](_0x31b312[_0x94f7('0x3c')],_0x31b312[_0x94f7('0x3d')]);_0x14631d[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x31b312['model'],qs[_0x94f7('0x42')](_0x5e1513[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x14631d[_0x94f7('0x41')]=_0x14631d['attributes'][_0x94f7('0x51')]?_0x14631d[_0x94f7('0x41')]:_0x31b312[_0x94f7('0x3c')];_0x14631d[_0x94f7('0x45')]=qs['sort'](_0x5e1513[_0x94f7('0x3d')][_0x94f7('0x46')]);_0x14631d[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0x5e1513[_0x94f7('0x3d')],_0x31b312[_0x94f7('0x3f')]));if(_0x5e1513[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x14631d[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x14631d[_0x94f7('0x47')],{'$or':_[_0x94f7('0x31')](_0x14631d[_0x94f7('0x41')],function(_0x228c3d){var _0x2b441e={};_0x2b441e[_0x228c3d]={'$like':'%'+_0x5e1513[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x2b441e;})});}_0x14631d=_[_0x94f7('0x49')]({},_0x14631d,_0x5e1513['options']);return _0x3692eb[_0x94f7('0x97')](_0x14631d);}})['then'](function(_0x27e625){if(_0x27e625){_0x3595a9=_0x27e625[_0x94f7('0x51')];if(!_0x5e1513['query'][_0x94f7('0x43')](_0x94f7('0x44'))){_0x14631d[_0x94f7('0x24')]=qs['limit'](_0x5e1513['query'][_0x94f7('0x24')]);_0x14631d['offset']=qs['offset'](_0x5e1513['query'][_0x94f7('0x22')]);}return _0x3692eb['getMembers'](_0x14631d);}})[_0x94f7('0x29')](function(_0x162da2){return _0x162da2?{'count':_0x3595a9,'rows':_0x162da2}:null;})[_0x94f7('0x29')](respondWithResult(_0x45f71d,null))['catch'](handleError(_0x45f71d,null));};exports[_0x94f7('0x98')]=function(_0xfb0125,_0x4d1cb8,_0x5c6f89){var _0x2a915f={};var _0x38975e={};var _0x1d685d;var _0x8307ed;return db['VoiceQueue'][_0x94f7('0x61')]({'where':{'id':_0xfb0125[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x4d1cb8,null))['then'](function(_0x1b1ef8){if(_0x1b1ef8){_0x1d685d=_0x1b1ef8;_0x38975e[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db['CmList'][_0x94f7('0x3a')]);_0x38975e[_0x94f7('0x3d')]=_[_0x94f7('0x3e')](_0xfb0125[_0x94f7('0x3d')]);_0x38975e['filters']=_[_0x94f7('0x40')](_0x38975e[_0x94f7('0x3c')],_0x38975e[_0x94f7('0x3d')]);_0x2a915f[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x38975e[_0x94f7('0x3c')],qs[_0x94f7('0x42')](_0xfb0125[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x2a915f['attributes']=_0x2a915f[_0x94f7('0x41')][_0x94f7('0x51')]?_0x2a915f[_0x94f7('0x41')]:_0x38975e[_0x94f7('0x3c')];_0x2a915f[_0x94f7('0x45')]=qs[_0x94f7('0x46')](_0xfb0125[_0x94f7('0x3d')][_0x94f7('0x46')]);_0x2a915f[_0x94f7('0x47')]=qs[_0x94f7('0x3f')](_[_0x94f7('0x63')](_0xfb0125[_0x94f7('0x3d')],_0x38975e[_0x94f7('0x3f')]));if(_0xfb0125[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x2a915f[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x2a915f['where'],{'$or':_['map'](_0x2a915f[_0x94f7('0x41')],function(_0x53b214){var _0x2b7c3c={};_0x2b7c3c[_0x53b214]={'$like':'%'+_0xfb0125['query']['filter']+'%'};return _0x2b7c3c;})});}_0x2a915f=_[_0x94f7('0x49')]({},_0x2a915f,_0xfb0125['options']);return _0x1d685d[_0x94f7('0x98')](_0x2a915f);}})[_0x94f7('0x29')](function(_0x4ef681){if(_0x4ef681){_0x8307ed=_0x4ef681[_0x94f7('0x51')];if(!_0xfb0125[_0x94f7('0x3d')]['hasOwnProperty']('nolimit')){_0x2a915f['limit']=qs['limit'](_0xfb0125[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x2a915f[_0x94f7('0x22')]=qs[_0x94f7('0x22')](_0xfb0125[_0x94f7('0x3d')][_0x94f7('0x22')]);}return _0x1d685d[_0x94f7('0x98')](_0x2a915f);}})[_0x94f7('0x29')](function(_0x512fcb){if(_0x512fcb){return _0x512fcb?{'count':_0x8307ed,'rows':_0x512fcb}:null;}})['then'](respondWithResult(_0x4d1cb8,null))[_0x94f7('0x4f')](handleError(_0x4d1cb8,null));};exports['addLists']=function(_0x5a6612,_0xfd969b,_0xd2af34){var _0x3355bf,_0x12dfb8;return db[_0x94f7('0x39')][_0x94f7('0x52')]({'where':{'id':_0x5a6612[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0xfd969b,null))[_0x94f7('0x29')](function(_0x5bb50d){if(_0x5bb50d){_0x12dfb8=_0x5bb50d;return _0x5bb50d[_0x94f7('0x99')](_0x5a6612['body'][_0x94f7('0x8f')],_[_0x94f7('0x5b')](_0x5a6612[_0x94f7('0x54')],[_0x94f7('0x8f'),'id'])||{});}return null;})[_0x94f7('0x93')](function(_0x5e68dc){var _0x3a3f29;_0x3355bf=_0x5e68dc||[];var _0x3ea901=[];if(_0x5e68dc){for(var _0x3c590d=0x0;_0x3c590d<_0x5e68dc['length'];_0x3c590d+=0x1){var _0x493122=_0x5e68dc[_0x3c590d][_0x94f7('0x2b')]({'plain':!![]});_0x12dfb8['dialCheckDuplicateType']=_0x5a6612[_0x94f7('0x54')]['dialCheckDuplicateType']?_0x5a6612['body'][_0x94f7('0x9a')]:_0x12dfb8[_0x94f7('0x9a')];switch(_0x12dfb8[_0x94f7('0x9a')]){case'always':_0x3a3f29=squel[_0x94f7('0x9b')]()[_0x94f7('0x9c')]('cm_hopper')[_0x94f7('0x9d')]([_0x94f7('0x9e'),'scheduledAt',_0x94f7('0x9f'),_0x94f7('0xa0'),_0x94f7('0x67'),_0x94f7('0x5c'),_0x94f7('0x5d')],squel['select']()[_0x94f7('0xa1')](_0x94f7('0x9e'),'phone')['field']('NOW()',_0x94f7('0xa2'))['field']('id',_0x94f7('0x9f'))[_0x94f7('0xa1')](_0x493122[_0x94f7('0xa3')][_0x94f7('0x8a')](),'ListId')[_0x94f7('0xa1')](_0x5a6612[_0x94f7('0x5f')]['id']['toString'](),_0x94f7('0x67'))[_0x94f7('0xa1')](_0x94f7('0xa4'),_0x94f7('0x5c'))[_0x94f7('0xa1')](_0x94f7('0xa4'),_0x94f7('0x5d'))[_0x94f7('0x82')](_0x94f7('0xa5'))[_0x94f7('0x47')](_0x94f7('0xa6'))[_0x94f7('0x47')](_0x94f7('0xa7'),_0x493122[_0x94f7('0xa3')][_0x94f7('0x8a')]())[_0x94f7('0x47')](_0x94f7('0xa8'))[_0x94f7('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x94f7('0xa9')]()[_0x94f7('0xa1')](_0x94f7('0xaa'))[_0x94f7('0x82')](_0x94f7('0xab'))['where'](_0x94f7('0x86'),_0x5a6612[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')]()))[_0x94f7('0x47')](_0x94f7('0xac'),squel['select']()[_0x94f7('0xa1')]('COALESCE(phone,\x27\x27)')[_0x94f7('0x82')]('cm_hopper')['where'](_0x94f7('0x86'),_0x5a6612[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')]())))[_0x94f7('0x8a')]();break;case'onlyIfOpen':_0x3a3f29=squel[_0x94f7('0x9b')]()[_0x94f7('0x9c')](_0x94f7('0xad'))[_0x94f7('0x9d')](['phone',_0x94f7('0xa2'),_0x94f7('0x9f'),'ListId',_0x94f7('0x67'),_0x94f7('0x5c'),'updatedAt'],squel[_0x94f7('0xa9')]()[_0x94f7('0xa1')](_0x94f7('0x9e'),_0x94f7('0x9e'))[_0x94f7('0xa1')](_0x94f7('0xa4'),_0x94f7('0xa2'))['field']('id',_0x94f7('0x9f'))['field'](_0x493122[_0x94f7('0xa3')]['toString'](),'ListId')[_0x94f7('0xa1')](_0x5a6612[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')](),_0x94f7('0x67'))[_0x94f7('0xa1')](_0x94f7('0xa4'),'createdAt')[_0x94f7('0xa1')]('NOW()',_0x94f7('0x5d'))['from'](_0x94f7('0xa5'))[_0x94f7('0x47')]('deletedAt\x20IS\x20NULL')[_0x94f7('0x47')](_0x94f7('0xa7'),_0x493122[_0x94f7('0xa3')][_0x94f7('0x8a')]())[_0x94f7('0x47')](_0x94f7('0xa8'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x94f7('0xa9')]()['field'](_0x94f7('0xae'))['from'](_0x94f7('0xad'))['where'](_0x94f7('0x86'),_0x5a6612[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')]())))[_0x94f7('0x8a')]();break;default:_0x3a3f29=squel[_0x94f7('0x9b')]()[_0x94f7('0x9c')](_0x94f7('0xad'))['fromQuery']([_0x94f7('0x9e'),_0x94f7('0xa2'),_0x94f7('0x9f'),'ListId',_0x94f7('0x67'),_0x94f7('0x5c'),_0x94f7('0x5d')],squel[_0x94f7('0xa9')]()['field'](_0x94f7('0x9e'),_0x94f7('0x9e'))['field'](_0x94f7('0xa4'),_0x94f7('0xa2'))['field']('id',_0x94f7('0x9f'))[_0x94f7('0xa1')](_0x493122[_0x94f7('0xa3')][_0x94f7('0x8a')](),'ListId')[_0x94f7('0xa1')](_0x5a6612[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')](),_0x94f7('0x67'))[_0x94f7('0xa1')](_0x94f7('0xa4'),_0x94f7('0x5c'))['field']('NOW()',_0x94f7('0x5d'))[_0x94f7('0x82')](_0x94f7('0xa5'))[_0x94f7('0x47')](_0x94f7('0xa6'))[_0x94f7('0x47')](_0x94f7('0xa7'),_0x493122[_0x94f7('0xa3')][_0x94f7('0x8a')]())[_0x94f7('0x47')](_0x94f7('0xa8')))[_0x94f7('0x8a')]();}_0x3ea901['push'](db[_0x94f7('0x89')][_0x94f7('0x3d')](_0x3a3f29));}return BPromise[_0x94f7('0x8d')](_0x3ea901);}})[_0x94f7('0x29')](function(){return _0x3355bf;})['then'](respondWithResult(_0xfd969b,null))[_0x94f7('0x4f')](handleError(_0xfd969b,null));};exports[_0x94f7('0xaf')]=function(_0xf1fbd7,_0xcda5ab,_0x3333e5){return db['VoiceQueue'][_0x94f7('0x52')]({'where':{'id':_0xf1fbd7[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0xcda5ab,null))[_0x94f7('0x29')](function(_0x410726){if(_0x410726){return _0x410726[_0x94f7('0xaf')](_0xf1fbd7[_0x94f7('0x3d')][_0x94f7('0x8f')]);}})[_0x94f7('0x29')](function(_0x20bc70){if(_0x20bc70){return db['CmHopper'][_0x94f7('0x2a')]({'where':{'ListId':_0xf1fbd7[_0x94f7('0x3d')][_0x94f7('0x8f')],'VoiceQueueId':_0xf1fbd7[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](function(){return _0x20bc70;});}})[_0x94f7('0x29')](respondWithStatusCode(_0xcda5ab,null))[_0x94f7('0x4f')](handleError(_0xcda5ab,null));};exports['getBlackLists']=function(_0x4b5660,_0x26b6b4,_0x1d53ab){var _0x1ec723={};var _0x4cb035={};var _0x9f0214;var _0x4606b8;return db[_0x94f7('0x39')][_0x94f7('0x61')]({'where':{'id':_0x4b5660[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x26b6b4,null))[_0x94f7('0x29')](function(_0x107abf){if(_0x107abf){_0x9f0214=_0x107abf;_0x4cb035[_0x94f7('0x3c')]=_[_0x94f7('0x3e')](db[_0x94f7('0xb0')][_0x94f7('0x3a')]);_0x4cb035[_0x94f7('0x3d')]=_['keys'](_0x4b5660[_0x94f7('0x3d')]);_0x4cb035[_0x94f7('0x3f')]=_[_0x94f7('0x40')](_0x4cb035[_0x94f7('0x3c')],_0x4cb035[_0x94f7('0x3d')]);_0x1ec723[_0x94f7('0x41')]=_[_0x94f7('0x40')](_0x4cb035['model'],qs[_0x94f7('0x42')](_0x4b5660[_0x94f7('0x3d')][_0x94f7('0x42')]));_0x1ec723['attributes']=_0x1ec723[_0x94f7('0x41')][_0x94f7('0x51')]?_0x1ec723[_0x94f7('0x41')]:_0x4cb035[_0x94f7('0x3c')];_0x1ec723[_0x94f7('0x45')]=qs[_0x94f7('0x46')](_0x4b5660[_0x94f7('0x3d')]['sort']);_0x1ec723[_0x94f7('0x47')]=qs['filters'](_['pick'](_0x4b5660['query'],_0x4cb035[_0x94f7('0x3f')]));if(_0x4b5660[_0x94f7('0x3d')][_0x94f7('0x48')]){_0x1ec723[_0x94f7('0x47')]=_[_0x94f7('0x49')](_0x1ec723[_0x94f7('0x47')],{'$or':_[_0x94f7('0x31')](_0x1ec723[_0x94f7('0x41')],function(_0x5c7891){var _0x3f7052={};_0x3f7052[_0x5c7891]={'$like':'%'+_0x4b5660[_0x94f7('0x3d')][_0x94f7('0x48')]+'%'};return _0x3f7052;})});}_0x1ec723=_[_0x94f7('0x49')]({},_0x1ec723,_0x4b5660[_0x94f7('0x4a')]);return _0x9f0214[_0x94f7('0xb1')](_0x1ec723);}})[_0x94f7('0x29')](function(_0x3fd645){if(_0x3fd645){_0x4606b8=_0x3fd645[_0x94f7('0x51')];if(!_0x4b5660['query']['hasOwnProperty'](_0x94f7('0x44'))){_0x1ec723[_0x94f7('0x24')]=qs[_0x94f7('0x24')](_0x4b5660[_0x94f7('0x3d')][_0x94f7('0x24')]);_0x1ec723['offset']=qs[_0x94f7('0x22')](_0x4b5660[_0x94f7('0x3d')]['offset']);}return _0x9f0214[_0x94f7('0xb1')](_0x1ec723);}})[_0x94f7('0x29')](function(_0x242936){if(_0x242936){return _0x242936?{'count':_0x4606b8,'rows':_0x242936}:null;}})[_0x94f7('0x29')](respondWithResult(_0x26b6b4,null))[_0x94f7('0x4f')](handleError(_0x26b6b4,null));};exports[_0x94f7('0xb2')]=function(_0x105248,_0x324583,_0x3969ac){var _0xa6877d,_0x419ceb;return db[_0x94f7('0x39')]['find']({'where':{'id':_0x105248[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](handleEntityNotFound(_0x324583,null))[_0x94f7('0x29')](function(_0x1d1c97){if(_0x1d1c97){_0x419ceb=_0x1d1c97;return _0x1d1c97[_0x94f7('0xb2')](_0x105248[_0x94f7('0x54')][_0x94f7('0x8f')],_[_0x94f7('0x5b')](_0x105248['body'],[_0x94f7('0x8f'),'id'])||{});}return null;})[_0x94f7('0x93')](function(_0x5d97bf){var _0x2ec343;_0xa6877d=_0x5d97bf||[];var _0x2a4228=[];if(_0x5d97bf){for(var _0x3d19a5=0x0;_0x3d19a5<_0x5d97bf[_0x94f7('0x51')];_0x3d19a5+=0x1){var _0xdd6021=_0x5d97bf[_0x3d19a5][_0x94f7('0x2b')]({'plain':!![]});_0x2ec343=squel[_0x94f7('0x9b')]()[_0x94f7('0x9c')](_0x94f7('0xb3'))[_0x94f7('0x9d')]([_0x94f7('0x9e'),_0x94f7('0x9f'),_0x94f7('0xa0'),_0x94f7('0x67'),_0x94f7('0x5c'),_0x94f7('0x5d')],squel[_0x94f7('0xa9')]()[_0x94f7('0xa1')](_0x94f7('0x9e'),_0x94f7('0x9e'))[_0x94f7('0xa1')]('id',_0x94f7('0x9f'))[_0x94f7('0xa1')](_0xdd6021[_0x94f7('0xa3')][_0x94f7('0x8a')](),_0x94f7('0xa0'))[_0x94f7('0xa1')](_0x105248[_0x94f7('0x5f')]['id'][_0x94f7('0x8a')](),_0x94f7('0x67'))['field'](_0x94f7('0xa4'),_0x94f7('0x5c'))[_0x94f7('0xa1')](_0x94f7('0xa4'),_0x94f7('0x5d'))[_0x94f7('0x82')](_0x94f7('0xa5'))[_0x94f7('0x47')]('deletedAt\x20IS\x20NULL')[_0x94f7('0x47')](_0x94f7('0xa7'),_0xdd6021[_0x94f7('0xa3')][_0x94f7('0x8a')]())[_0x94f7('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0x94f7('0x8a')]();_0x2a4228['push'](db['sequelize']['query'](_0x2ec343));}return BPromise['all'](_0x2a4228);}})[_0x94f7('0x29')](function(){return _0xa6877d;})[_0x94f7('0x29')](respondWithResult(_0x324583,null))['catch'](handleError(_0x324583,null));};exports['removeBlackLists']=function(_0x52c363,_0xab1332,_0x3765d7){return db[_0x94f7('0x39')][_0x94f7('0x52')]({'where':{'id':_0x52c363[_0x94f7('0x5f')]['id']}})['then'](handleEntityNotFound(_0xab1332,null))['then'](function(_0x10f4a5){if(_0x10f4a5){return _0x10f4a5[_0x94f7('0xb4')](_0x52c363[_0x94f7('0x3d')][_0x94f7('0x8f')]);}})['then'](function(_0xc5af50){if(_0xc5af50){return db['CmHopperBlack'][_0x94f7('0x2a')]({'where':{'ListId':_0x52c363[_0x94f7('0x3d')][_0x94f7('0x8f')],'VoiceQueueId':_0x52c363[_0x94f7('0x5f')]['id']}})[_0x94f7('0x29')](function(){return _0xc5af50;});}})[_0x94f7('0x29')](respondWithStatusCode(_0xab1332,null))[_0x94f7('0x4f')](handleError(_0xab1332,null));}; \ No newline at end of file +var _0x1f80=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','from','COALESCE(phone,\x27\x27)','removeLists','addBlackLists','spread','fromQuery','deletedAt\x20IS\x20NULL','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','includeAll','include','findAll','rows','catch','params','fields','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','findOne','CmHopper','nolimit','VoiceQueueId','CmHopperHistory','pick','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','User','Agents','online','interface','flatMap','forEach','penalty','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','push','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','cm_contacts'];(function(_0x2d0289,_0x5256f9){var _0xa72968=function(_0x5589d2){while(--_0x5589d2){_0x2d0289['push'](_0x2d0289['shift']());}};_0xa72968(++_0x5256f9);}(_0x1f80,0xbf));var _0x01f8=function(_0x33bec2,_0x3b4f7e){_0x33bec2=_0x33bec2-0x0;var _0xcb875b=_0x1f80[_0x33bec2];return _0xcb875b;};'use strict';var emlformat=require(_0x01f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x01f8('0x1'));var rp=require(_0x01f8('0x2'));var moment=require(_0x01f8('0x3'));var BPromise=require(_0x01f8('0x4'));var Mustache=require(_0x01f8('0x5'));var util=require(_0x01f8('0x6'));var path=require(_0x01f8('0x7'));var sox=require(_0x01f8('0x8'));var csv=require(_0x01f8('0x9'));var ejs=require(_0x01f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01f8('0xb'));var squel=require(_0x01f8('0xc'));var crypto=require('crypto');var jsforce=require(_0x01f8('0xd'));var deskjs=require(_0x01f8('0xe'));var toCsv=require(_0x01f8('0x9'));var querystring=require(_0x01f8('0xf'));var Papa=require(_0x01f8('0x10'));var Redis=require(_0x01f8('0x11'));var authService=require(_0x01f8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x01f8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f8('0x14'))(_0x01f8('0x15'));var utils=require(_0x01f8('0x16'));var config=require(_0x01f8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x01f8('0x18')]=_[_0x01f8('0x19')](config[_0x01f8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x01f8('0x1a'))(new Redis(config[_0x01f8('0x18')]));require(_0x01f8('0x1b'))[_0x01f8('0x1c')](socket);function respondWithStatusCode(_0x111029,_0x2d75c9){_0x2d75c9=_0x2d75c9||0xcc;return function(_0x4fcdfa){if(_0x4fcdfa){return _0x111029['sendStatus'](_0x2d75c9);}return _0x111029['status'](_0x2d75c9)['end']();};}function respondWithResult(_0x47754e,_0x4d4e31){_0x4d4e31=_0x4d4e31||0xc8;return function(_0x3dd60b){if(_0x3dd60b){return _0x47754e['status'](_0x4d4e31)[_0x01f8('0x1d')](_0x3dd60b);}};}function respondWithFilteredResult(_0x3df64b,_0x9a7dea){return function(_0x1339af){if(_0x1339af){var _0x4d0ead=typeof _0x9a7dea[_0x01f8('0x1e')]==='undefined'&&typeof _0x9a7dea['limit']===_0x01f8('0x1f');var _0x590498=_0x1339af[_0x01f8('0x20')];var _0x48800f=_0x4d0ead?0x0:_0x9a7dea['offset'];var _0x4b3b40=_0x4d0ead?_0x1339af[_0x01f8('0x20')]:_0x9a7dea[_0x01f8('0x1e')]+_0x9a7dea[_0x01f8('0x21')];var _0x15eb70;if(_0x4b3b40>=_0x590498){_0x4b3b40=_0x590498;_0x15eb70=0xc8;}else{_0x15eb70=0xce;}_0x3df64b['status'](_0x15eb70);return _0x3df64b['set'](_0x01f8('0x22'),_0x48800f+'-'+_0x4b3b40+'/'+_0x590498)[_0x01f8('0x1d')](_0x1339af);}return null;};}function patchUpdates(_0x2c7a03){return function(_0x42ce56){try{jsonpatch[_0x01f8('0x23')](_0x42ce56,_0x2c7a03,!![]);}catch(_0x240595){return BPromise[_0x01f8('0x24')](_0x240595);}return _0x42ce56[_0x01f8('0x25')]();};}function saveUpdates(_0x3e9350,_0x38aec2){return function(_0x4eb125){if(_0x4eb125){return _0x4eb125[_0x01f8('0x26')](_0x3e9350)[_0x01f8('0x27')](function(_0x385a26){return _0x385a26;});}return null;};}function removeEntity(_0x4e32b3,_0x170c75){return function(_0x406929){if(_0x406929){return _0x406929[_0x01f8('0x28')]()['then'](function(){var _0x5b48d6=_0x406929['get']({'plain':!![]});var _0x285189=[{'name':_0x01f8('0x29'),'value':_0x01f8('0x2a'),'ignore':![]},{'name':_0x01f8('0x2b'),'value':'outbound','ignore':![]}];var _0x4ea9ff=_(_0x285189)[_0x01f8('0x2c')](_0x01f8('0x2d'))[_0x01f8('0x2e')](_0x01f8('0x2f'))[_0x01f8('0x2f')]();if(_[_0x01f8('0x30')](_0x4ea9ff,_0x5b48d6[_0x01f8('0x31')])){return;}var _0x4e115f=_[_0x01f8('0x32')](_0x285189,[_0x01f8('0x2f'),_0x5b48d6[_0x01f8('0x31')]])[_0x01f8('0x33')];return db[_0x01f8('0x34')][_0x01f8('0x28')]({'where':{'type':_0x4e115f,'resourceId':_0x5b48d6['id']}})[_0x01f8('0x27')](function(){return _0x406929;});})[_0x01f8('0x27')](function(){_0x4e32b3['status'](0xcc)[_0x01f8('0x35')]();});}};}function handleEntityNotFound(_0x25b910,_0x5bb10b){return function(_0x27fff5){if(!_0x27fff5){_0x25b910['sendStatus'](0x194);}return _0x27fff5;};}function handleError(_0x57c837,_0xb5e7ef){_0xb5e7ef=_0xb5e7ef||0x1f4;return function(_0x1ac07c){logger[_0x01f8('0x36')](_0x1ac07c[_0x01f8('0x37')]);if(_0x1ac07c[_0x01f8('0x33')]){delete _0x1ac07c[_0x01f8('0x33')];}_0x57c837['status'](_0xb5e7ef)[_0x01f8('0x38')](_0x1ac07c);};}exports[_0x01f8('0x39')]=function(_0x4dd9a9,_0x283dda){var _0x99f5b7={},_0x2ead8f={},_0x5d7374={'count':0x0,'rows':[]};var _0x108d09=_[_0x01f8('0x2e')](db[_0x01f8('0x3a')][_0x01f8('0x3b')],function(_0x38258c){return{'name':_0x38258c[_0x01f8('0x3c')],'type':_0x38258c[_0x01f8('0x31')]['key']};});_0x2ead8f[_0x01f8('0x3d')]=_['map'](_0x108d09,_0x01f8('0x33'));_0x2ead8f[_0x01f8('0x3e')]=_[_0x01f8('0x3f')](_0x4dd9a9['query']);_0x2ead8f[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0x2ead8f[_0x01f8('0x3d')],_0x2ead8f['query']);_0x99f5b7[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x2ead8f[_0x01f8('0x3d')],qs['fields'](_0x4dd9a9['query']['fields']));_0x99f5b7[_0x01f8('0x42')]=_0x99f5b7[_0x01f8('0x42')][_0x01f8('0x43')]?_0x99f5b7[_0x01f8('0x42')]:_0x2ead8f[_0x01f8('0x3d')];if(!_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x44')]('nolimit')){_0x99f5b7['limit']=qs['limit'](_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x21')]);_0x99f5b7[_0x01f8('0x1e')]=qs['offset'](_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x1e')]);}_0x99f5b7[_0x01f8('0x45')]=qs['sort'](_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x99f5b7[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_['pick'](_0x4dd9a9[_0x01f8('0x3e')],_0x2ead8f[_0x01f8('0x40')]),_0x108d09);if(_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x2c')]){_0x99f5b7[_0x01f8('0x47')]=_[_0x01f8('0x48')](_0x99f5b7[_0x01f8('0x47')],{'$or':_['map'](_0x108d09,function(_0x5ddeaf){if(_0x5ddeaf[_0x01f8('0x31')]!=='VIRTUAL'){var _0x403c57={};_0x403c57[_0x5ddeaf[_0x01f8('0x33')]]={'$like':'%'+_0x4dd9a9[_0x01f8('0x3e')]['filter']+'%'};return _0x403c57;}})});}_0x99f5b7=_['merge']({},_0x99f5b7,_0x4dd9a9['options']);var _0x58a1fe={'where':_0x99f5b7['where']};return db[_0x01f8('0x3a')][_0x01f8('0x20')](_0x58a1fe)[_0x01f8('0x27')](function(_0x20ab64){_0x5d7374[_0x01f8('0x20')]=_0x20ab64;if(_0x4dd9a9[_0x01f8('0x3e')][_0x01f8('0x49')]){_0x99f5b7[_0x01f8('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0x01f8('0x4b')](_0x99f5b7);})[_0x01f8('0x27')](function(_0x321c5f){_0x5d7374[_0x01f8('0x4c')]=_0x321c5f;return _0x5d7374;})['then'](respondWithFilteredResult(_0x283dda,_0x99f5b7))[_0x01f8('0x4d')](handleError(_0x283dda,null));};exports['show']=function(_0x43306a,_0x7807a){var _0x4dc0fe={'raw':![],'where':{'id':_0x43306a[_0x01f8('0x4e')]['id']}},_0x328581={};_0x328581[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db[_0x01f8('0x3a')][_0x01f8('0x3b')]);_0x328581['query']=_[_0x01f8('0x3f')](_0x43306a['query']);_0x328581['filters']=_['intersection'](_0x328581[_0x01f8('0x3d')],_0x328581[_0x01f8('0x3e')]);_0x4dc0fe['attributes']=_['intersection'](_0x328581[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x43306a['query'][_0x01f8('0x4f')]));_0x4dc0fe[_0x01f8('0x42')]=_0x4dc0fe['attributes']['length']?_0x4dc0fe['attributes']:_0x328581[_0x01f8('0x3d')];if(_0x43306a['query'][_0x01f8('0x49')]){_0x4dc0fe[_0x01f8('0x4a')]=[{'all':!![]}];}_0x4dc0fe=_[_0x01f8('0x48')]({},_0x4dc0fe,_0x43306a[_0x01f8('0x50')]);return db[_0x01f8('0x3a')][_0x01f8('0x32')](_0x4dc0fe)['then'](handleEntityNotFound(_0x7807a,null))[_0x01f8('0x27')](respondWithResult(_0x7807a,null))[_0x01f8('0x4d')](handleError(_0x7807a,null));};exports[_0x01f8('0x51')]=function(_0x573eff,_0x14ecfc){return db[_0x01f8('0x3a')][_0x01f8('0x51')](_0x573eff[_0x01f8('0x52')],{})[_0x01f8('0x27')](function(_0x2294be){var _0x79e19a=_0x573eff[_0x01f8('0x53')][_0x01f8('0x54')]({'plain':!![]});if(!_0x79e19a)throw new Error(_0x01f8('0x55'));if(_0x79e19a[_0x01f8('0x56')]===_0x01f8('0x53')){var _0x56ed72=_0x2294be[_0x01f8('0x54')]({'plain':!![]});var _0x5ef3c9=[{'name':_0x01f8('0x29'),'value':_0x01f8('0x2a')},{'name':_0x01f8('0x2b'),'value':_0x01f8('0x57')}];var _0x3b760f=_[_0x01f8('0x32')](_0x5ef3c9,[_0x01f8('0x2f'),_0x56ed72[_0x01f8('0x31')]])[_0x01f8('0x33')];return db[_0x01f8('0x58')][_0x01f8('0x32')]({'where':{'name':_0x3b760f,'userProfileId':_0x79e19a[_0x01f8('0x59')]},'raw':!![]})[_0x01f8('0x27')](function(_0x368509){if(_0x368509&&_0x368509[_0x01f8('0x5a')]===0x0){return db[_0x01f8('0x34')]['create']({'name':_0x56ed72[_0x01f8('0x33')],'resourceId':_0x56ed72['id'],'type':_0x368509[_0x01f8('0x33')],'sectionId':_0x368509['id']},{})[_0x01f8('0x27')](function(){return _0x2294be;});}else{return _0x2294be;}})[_0x01f8('0x4d')](function(_0x326347){logger[_0x01f8('0x36')](_0x01f8('0x5b'),_0x326347);throw _0x326347;});}return _0x2294be;})['then'](respondWithResult(_0x14ecfc,0xc9))[_0x01f8('0x4d')](handleError(_0x14ecfc,null));};exports[_0x01f8('0x5c')]=function(_0x214e0b,_0x58bf4e){var _0x333c2e={'where':{'id':_0x214e0b['params']['id']}},_0x4f9cce={};_0x4f9cce[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db[_0x01f8('0x3a')][_0x01f8('0x3b')]);_0x333c2e[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x4f9cce[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x214e0b[_0x01f8('0x3e')][_0x01f8('0x4f')]));_0x333c2e[_0x01f8('0x42')]=_0x333c2e[_0x01f8('0x42')][_0x01f8('0x43')]?_0x333c2e[_0x01f8('0x42')]:_0x4f9cce[_0x01f8('0x3d')];if(_0x214e0b[_0x01f8('0x3e')][_0x01f8('0x49')]){_0x333c2e[_0x01f8('0x4a')]=[{'all':!![]}];}_0x333c2e=_['merge']({},_0x333c2e,_0x214e0b[_0x01f8('0x50')]);return db[_0x01f8('0x3a')][_0x01f8('0x32')](_0x333c2e)['then'](handleEntityNotFound(_0x58bf4e,null))['then'](function(_0xb33f24){if(_0xb33f24){var _0x33f798=_0xb33f24[_0x01f8('0x54')]({'plain':!![]});_0x33f798=qs[_0x01f8('0x5d')](_0x33f798,['id',_0x01f8('0x5e'),_0x01f8('0x5f')]);_0x214e0b[_0x01f8('0x52')]=_['omit'](_0x214e0b[_0x01f8('0x52')],['id',_0x01f8('0x5e'),_0x01f8('0x5f')]);return db['VoiceQueue']['create'](_[_0x01f8('0x48')](_0x33f798,_0x214e0b[_0x01f8('0x52')]),{'include':_0x214e0b['query'][_0x01f8('0x49')]?[{'all':!![]}]:undefined})[_0x01f8('0x27')](function(_0x17dd90){var _0x29da42=_0x214e0b[_0x01f8('0x53')][_0x01f8('0x54')]({'plain':!![]});if(!_0x29da42)throw new Error(_0x01f8('0x55'));if(_0x29da42[_0x01f8('0x56')]===_0x01f8('0x53')){var _0x2b313f=_0x17dd90['get']({'plain':!![]});var _0x35371f=[{'name':'VoiceQueues','value':_0x01f8('0x2a')},{'name':_0x01f8('0x2b'),'value':_0x01f8('0x57')}];var _0x397339=_['find'](_0x35371f,[_0x01f8('0x2f'),_0x2b313f[_0x01f8('0x31')]])[_0x01f8('0x33')];return db[_0x01f8('0x58')][_0x01f8('0x32')]({'where':{'name':_0x397339,'userProfileId':_0x29da42[_0x01f8('0x59')]},'raw':!![]})[_0x01f8('0x27')](function(_0x356919){if(_0x356919&&_0x356919[_0x01f8('0x5a')]===0x0){return db[_0x01f8('0x34')][_0x01f8('0x51')]({'name':_0x2b313f[_0x01f8('0x33')],'resourceId':_0x2b313f['id'],'type':_0x356919['name'],'sectionId':_0x356919['id']},{})[_0x01f8('0x27')](function(){return _0x17dd90;});}else{return _0x17dd90;}})[_0x01f8('0x4d')](function(_0x3167a9){logger[_0x01f8('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3167a9);throw _0x3167a9;});}return _0x17dd90;});}})[_0x01f8('0x27')](respondWithResult(_0x58bf4e,0xc9))[_0x01f8('0x4d')](handleError(_0x58bf4e,null));};exports[_0x01f8('0x26')]=function(_0x2281d8,_0x351e16){if(_0x2281d8[_0x01f8('0x52')]['id']){delete _0x2281d8['body']['id'];}return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x2281d8['params']['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x351e16,null))[_0x01f8('0x27')](saveUpdates(_0x2281d8[_0x01f8('0x52')],null))['then'](respondWithResult(_0x351e16,null))['catch'](handleError(_0x351e16,null));};exports[_0x01f8('0x28')]=function(_0x485cce,_0x5676ce){return db['VoiceQueue'][_0x01f8('0x32')]({'where':{'id':_0x485cce['params']['id']}})['then'](handleEntityNotFound(_0x5676ce,null))[_0x01f8('0x27')](removeEntity(_0x5676ce,null))['catch'](handleError(_0x5676ce,null));};exports['getHoppers']=function(_0x39f005,_0x3c5a97,_0x49b81e){var _0x46163b={'raw':![],'where':{}};var _0x105ae2={};var _0x12c546={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x01f8('0x60')]({'where':{'id':_0x39f005[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x3c5a97,null))['then'](function(_0x161632){if(_0x161632){_0x105ae2['model']=_[_0x01f8('0x3f')](db[_0x01f8('0x61')][_0x01f8('0x3b')]);_0x105ae2['query']=_[_0x01f8('0x3f')](_0x39f005[_0x01f8('0x3e')]);_0x105ae2['filters']=_[_0x01f8('0x41')](_0x105ae2[_0x01f8('0x3d')],_0x105ae2['query']);_0x46163b[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x105ae2[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x39f005[_0x01f8('0x3e')][_0x01f8('0x4f')]));_0x46163b[_0x01f8('0x42')]=_0x46163b[_0x01f8('0x42')][_0x01f8('0x43')]?_0x46163b['attributes']:_0x105ae2[_0x01f8('0x3d')];if(!_0x39f005[_0x01f8('0x3e')][_0x01f8('0x44')](_0x01f8('0x62'))){_0x46163b['limit']=qs[_0x01f8('0x21')](_0x39f005['query']['limit']);_0x46163b['offset']=qs['offset'](_0x39f005[_0x01f8('0x3e')][_0x01f8('0x1e')]);}_0x46163b['order']=qs[_0x01f8('0x46')](_0x39f005[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x46163b[_0x01f8('0x47')]=qs['filters'](_['pick'](_0x39f005[_0x01f8('0x3e')],_0x105ae2['filters']));_0x46163b[_0x01f8('0x47')][_0x01f8('0x63')]=_0x161632['id'];if(_0x39f005['query'][_0x01f8('0x2c')]){_0x46163b[_0x01f8('0x47')]=_['merge'](_0x46163b[_0x01f8('0x47')],{'$or':_['map'](_0x46163b[_0x01f8('0x42')],function(_0x3c03f4){var _0x5eda68={};_0x5eda68[_0x3c03f4]={'$like':'%'+_0x39f005['query'][_0x01f8('0x2c')]+'%'};return _0x5eda68;})});}_0x46163b=_[_0x01f8('0x48')]({},_0x46163b,_0x39f005[_0x01f8('0x50')]);return db[_0x01f8('0x61')][_0x01f8('0x20')]({'where':_0x46163b[_0x01f8('0x47')]})['then'](function(_0xa10985){_0x12c546['count']=_0xa10985;if(_0x39f005[_0x01f8('0x3e')][_0x01f8('0x49')]){_0x46163b['include']=[{'all':!![]}];}return db[_0x01f8('0x61')][_0x01f8('0x4b')](_0x46163b);})[_0x01f8('0x27')](function(_0x21b4e2){_0x12c546[_0x01f8('0x4c')]=_0x21b4e2;return _0x12c546;});}})[_0x01f8('0x27')](respondWithFilteredResult(_0x3c5a97,_0x46163b))[_0x01f8('0x4d')](handleError(_0x3c5a97,null));};exports['getHopperHistories']=function(_0x2ef676,_0xb19865,_0x43439b){var _0x4cfbeb={'raw':!![],'where':{}};var _0x4b6833={};var _0x1436d6={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x01f8('0x60')]({'where':{'id':_0x2ef676[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0xb19865,null))[_0x01f8('0x27')](function(_0x3577ab){if(_0x3577ab){_0x4b6833['model']=_[_0x01f8('0x3f')](db[_0x01f8('0x64')][_0x01f8('0x3b')]);_0x4b6833['query']=_[_0x01f8('0x3f')](_0x2ef676[_0x01f8('0x3e')]);_0x4b6833[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0x4b6833[_0x01f8('0x3d')],_0x4b6833['query']);_0x4cfbeb[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x4b6833[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x2ef676[_0x01f8('0x3e')][_0x01f8('0x4f')]));_0x4cfbeb[_0x01f8('0x42')]=_0x4cfbeb['attributes']['length']?_0x4cfbeb[_0x01f8('0x42')]:_0x4b6833[_0x01f8('0x3d')];if(!_0x2ef676[_0x01f8('0x3e')][_0x01f8('0x44')](_0x01f8('0x62'))){_0x4cfbeb[_0x01f8('0x21')]=qs[_0x01f8('0x21')](_0x2ef676[_0x01f8('0x3e')][_0x01f8('0x21')]);_0x4cfbeb[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x2ef676['query'][_0x01f8('0x1e')]);}_0x4cfbeb[_0x01f8('0x45')]=qs[_0x01f8('0x46')](_0x2ef676['query'][_0x01f8('0x46')]);_0x4cfbeb[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_[_0x01f8('0x65')](_0x2ef676[_0x01f8('0x3e')],_0x4b6833['filters']));_0x4cfbeb[_0x01f8('0x47')]['VoiceQueueId']=_0x3577ab['id'];if(_0x2ef676['query'][_0x01f8('0x2c')]){_0x4cfbeb[_0x01f8('0x47')]=_[_0x01f8('0x48')](_0x4cfbeb[_0x01f8('0x47')],{'$or':_[_0x01f8('0x2e')](_0x4cfbeb[_0x01f8('0x42')],function(_0x20a59d){var _0x226147={};_0x226147[_0x20a59d]={'$like':'%'+_0x2ef676['query'][_0x01f8('0x2c')]+'%'};return _0x226147;})});}_0x4cfbeb=_[_0x01f8('0x48')]({},_0x4cfbeb,_0x2ef676[_0x01f8('0x50')]);return db['CmHopperHistory'][_0x01f8('0x20')]({'where':_0x4cfbeb[_0x01f8('0x47')]})[_0x01f8('0x27')](function(_0x20108b){_0x1436d6[_0x01f8('0x20')]=_0x20108b;if(_0x2ef676['query'][_0x01f8('0x49')]){_0x4cfbeb[_0x01f8('0x4a')]=[{'all':!![]}];}return db[_0x01f8('0x64')][_0x01f8('0x4b')](_0x4cfbeb);})[_0x01f8('0x27')](function(_0xd4a041){_0x1436d6['rows']=_0xd4a041;return _0x1436d6;});}})[_0x01f8('0x27')](respondWithFilteredResult(_0xb19865,_0x4cfbeb))[_0x01f8('0x4d')](handleError(_0xb19865,null));};exports['getHopperFinals']=function(_0x2e2d0b,_0x27b190,_0x46e1ab){var _0x5211d3={'raw':!![],'where':{}};var _0x4d1350={};var _0x99fe1b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x01f8('0x60')]({'where':{'id':_0x2e2d0b['params']['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x27b190,null))[_0x01f8('0x27')](function(_0x56a82f){if(_0x56a82f){_0x4d1350['model']=_[_0x01f8('0x3f')](db['CmHopperFinal'][_0x01f8('0x3b')]);_0x4d1350['query']=_['keys'](_0x2e2d0b[_0x01f8('0x3e')]);_0x4d1350['filters']=_[_0x01f8('0x41')](_0x4d1350[_0x01f8('0x3d')],_0x4d1350['query']);_0x5211d3[_0x01f8('0x42')]=_['intersection'](_0x4d1350['model'],qs[_0x01f8('0x4f')](_0x2e2d0b[_0x01f8('0x3e')][_0x01f8('0x4f')]));_0x5211d3[_0x01f8('0x42')]=_0x5211d3[_0x01f8('0x42')][_0x01f8('0x43')]?_0x5211d3[_0x01f8('0x42')]:_0x4d1350[_0x01f8('0x3d')];if(!_0x2e2d0b['query'][_0x01f8('0x44')](_0x01f8('0x62'))){_0x5211d3['limit']=qs['limit'](_0x2e2d0b[_0x01f8('0x3e')][_0x01f8('0x21')]);_0x5211d3[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x2e2d0b[_0x01f8('0x3e')]['offset']);}_0x5211d3[_0x01f8('0x45')]=qs['sort'](_0x2e2d0b[_0x01f8('0x3e')]['sort']);_0x5211d3[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_[_0x01f8('0x65')](_0x2e2d0b[_0x01f8('0x3e')],_0x4d1350[_0x01f8('0x40')]));_0x5211d3[_0x01f8('0x47')][_0x01f8('0x63')]=_0x56a82f['id'];if(_0x2e2d0b[_0x01f8('0x3e')]['filter']){_0x5211d3[_0x01f8('0x47')]=_[_0x01f8('0x48')](_0x5211d3[_0x01f8('0x47')],{'$or':_[_0x01f8('0x2e')](_0x5211d3['attributes'],function(_0x10290b){var _0x23b836={};_0x23b836[_0x10290b]={'$like':'%'+_0x2e2d0b[_0x01f8('0x3e')][_0x01f8('0x2c')]+'%'};return _0x23b836;})});}_0x5211d3=_['merge']({},_0x5211d3,_0x2e2d0b[_0x01f8('0x50')]);return db[_0x01f8('0x66')][_0x01f8('0x20')]({'where':_0x5211d3['where']})[_0x01f8('0x27')](function(_0x2cc99c){_0x99fe1b[_0x01f8('0x20')]=_0x2cc99c;if(_0x2e2d0b[_0x01f8('0x3e')][_0x01f8('0x49')]){_0x5211d3['include']=[{'all':!![]}];}return db[_0x01f8('0x66')][_0x01f8('0x4b')](_0x5211d3);})[_0x01f8('0x27')](function(_0x1afd5d){_0x99fe1b[_0x01f8('0x4c')]=_0x1afd5d;return _0x99fe1b;});}})['then'](respondWithFilteredResult(_0x27b190,_0x5211d3))[_0x01f8('0x4d')](handleError(_0x27b190,null));};exports['getHopperBlacks']=function(_0x1be7c2,_0x4c11db,_0x45d0a6){var _0x134244={'raw':!![],'where':{}};var _0x6e5d19={};var _0x5708d9={'count':0x0,'rows':[]};return db[_0x01f8('0x3a')][_0x01f8('0x60')]({'where':{'id':_0x1be7c2['params']['id']}})['then'](handleEntityNotFound(_0x4c11db,null))['then'](function(_0x31a14e){if(_0x31a14e){_0x6e5d19[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db[_0x01f8('0x67')][_0x01f8('0x3b')]);_0x6e5d19['query']=_[_0x01f8('0x3f')](_0x1be7c2[_0x01f8('0x3e')]);_0x6e5d19[_0x01f8('0x40')]=_['intersection'](_0x6e5d19['model'],_0x6e5d19[_0x01f8('0x3e')]);_0x134244['attributes']=_[_0x01f8('0x41')](_0x6e5d19[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x1be7c2[_0x01f8('0x3e')]['fields']));_0x134244[_0x01f8('0x42')]=_0x134244[_0x01f8('0x42')][_0x01f8('0x43')]?_0x134244[_0x01f8('0x42')]:_0x6e5d19['model'];if(!_0x1be7c2[_0x01f8('0x3e')][_0x01f8('0x44')](_0x01f8('0x62'))){_0x134244['limit']=qs['limit'](_0x1be7c2['query']['limit']);_0x134244[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x1be7c2[_0x01f8('0x3e')]['offset']);}_0x134244['order']=qs[_0x01f8('0x46')](_0x1be7c2[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x134244['where']=qs[_0x01f8('0x40')](_[_0x01f8('0x65')](_0x1be7c2[_0x01f8('0x3e')],_0x6e5d19[_0x01f8('0x40')]));_0x134244[_0x01f8('0x47')][_0x01f8('0x63')]=_0x31a14e['id'];if(_0x1be7c2['query'][_0x01f8('0x2c')]){_0x134244['where']=_[_0x01f8('0x48')](_0x134244['where'],{'$or':_[_0x01f8('0x2e')](_0x134244[_0x01f8('0x42')],function(_0x58ad9a){var _0x5e6776={};_0x5e6776[_0x58ad9a]={'$like':'%'+_0x1be7c2[_0x01f8('0x3e')]['filter']+'%'};return _0x5e6776;})});}_0x134244=_['merge']({},_0x134244,_0x1be7c2['options']);return db[_0x01f8('0x67')][_0x01f8('0x20')]({'where':_0x134244[_0x01f8('0x47')]})['then'](function(_0x3cddd7){_0x5708d9[_0x01f8('0x20')]=_0x3cddd7;if(_0x1be7c2['query']['includeAll']){_0x134244[_0x01f8('0x4a')]=[{'all':!![]}];}return db[_0x01f8('0x67')][_0x01f8('0x4b')](_0x134244);})[_0x01f8('0x27')](function(_0x59a8af){_0x5708d9[_0x01f8('0x4c')]=_0x59a8af;return _0x5708d9;});}})['then'](respondWithFilteredResult(_0x4c11db,_0x134244))[_0x01f8('0x4d')](handleError(_0x4c11db,null));};exports[_0x01f8('0x68')]=function(_0x5a3848,_0x409890,_0x2abf23){var _0x121812={};var _0x1d72f5={};var _0x59fc88;var _0x1086c2;return db['VoiceQueue']['findOne']({'where':{'id':_0x5a3848[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x409890,null))[_0x01f8('0x27')](function(_0x444c51){if(_0x444c51){_0x59fc88=_0x444c51;_0x1d72f5[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db[_0x01f8('0x69')][_0x01f8('0x3b')]);_0x1d72f5[_0x01f8('0x3e')]=_[_0x01f8('0x3f')](_0x5a3848[_0x01f8('0x3e')]);_0x1d72f5[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0x1d72f5[_0x01f8('0x3d')],_0x1d72f5[_0x01f8('0x3e')]);_0x121812[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x1d72f5['model'],qs[_0x01f8('0x4f')](_0x5a3848[_0x01f8('0x3e')]['fields']));_0x121812[_0x01f8('0x42')]=_0x121812[_0x01f8('0x42')]['length']?_0x121812[_0x01f8('0x42')]:_0x1d72f5[_0x01f8('0x3d')];_0x121812[_0x01f8('0x45')]=qs['sort'](_0x5a3848[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x121812[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_['pick'](_0x5a3848[_0x01f8('0x3e')],_0x1d72f5['filters']));if(_0x5a3848['query']['filter']){_0x121812['where']=_[_0x01f8('0x48')](_0x121812[_0x01f8('0x47')],{'$or':_['map'](_0x121812[_0x01f8('0x42')],function(_0x5a283d){var _0x4d5fb6={};_0x4d5fb6[_0x5a283d]={'$like':'%'+_0x5a3848[_0x01f8('0x3e')][_0x01f8('0x2c')]+'%'};return _0x4d5fb6;})});}_0x121812=_[_0x01f8('0x48')]({},_0x121812,_0x5a3848[_0x01f8('0x50')]);return _0x59fc88[_0x01f8('0x68')](_0x121812);}})[_0x01f8('0x27')](function(_0x1f4b16){if(_0x1f4b16){_0x1086c2=_0x1f4b16['length'];if(!_0x5a3848['query'][_0x01f8('0x44')](_0x01f8('0x62'))){_0x121812['limit']=qs[_0x01f8('0x21')](_0x5a3848[_0x01f8('0x3e')][_0x01f8('0x21')]);_0x121812[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x5a3848[_0x01f8('0x3e')][_0x01f8('0x1e')]);}return _0x59fc88[_0x01f8('0x68')](_0x121812);}})[_0x01f8('0x27')](function(_0x1b4e39){if(_0x1b4e39){return _0x1b4e39?{'count':_0x1086c2,'rows':_0x1b4e39}:null;}})[_0x01f8('0x27')](respondWithResult(_0x409890,null))[_0x01f8('0x4d')](handleError(_0x409890,null));};exports['addTeams']=function(_0x42ef97,_0x3844f8,_0x293056){var _0x557c8d=_0x42ef97[_0x01f8('0x52')][_0x01f8('0x6a')];var _0x8a6c25=_[_0x01f8('0x2e')](_0x557c8d,'id');return db[_0x01f8('0x69')][_0x01f8('0x4b')]({'where':{'id':_0x8a6c25},'attributes':['id'],'include':[{'model':db[_0x01f8('0x6b')],'as':_0x01f8('0x6c'),'attributes':['id',_0x01f8('0x33'),_0x01f8('0x6d'),'voicePause',_0x01f8('0x6e')],'raw':!![]}]})[_0x01f8('0x27')](function(_0x5a200a){if(_0x5a200a){var _0x5ccf0d=_[_0x01f8('0x6f')](_0x5a200a,function(_0x180ec0){var _0x1c85ca=_0x180ec0[_0x01f8('0x54')]({'plain':!![]});_0x1c85ca['Agents'][_0x01f8('0x70')](function(_0x4d0dcf){_0x4d0dcf[_0x01f8('0x71')]=_[_0x01f8('0x32')](_0x557c8d,{'id':_0x1c85ca['id']})['penalty'];});return _0x1c85ca[_0x01f8('0x6c')];});return db[_0x01f8('0x3a')]['find']({'where':{'id':_0x42ef97[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](function(_0x2bbfb0){return db['sequelize'][_0x01f8('0x72')](function(_0x419a09){return _0x2bbfb0[_0x01f8('0x73')](_0x8a6c25,{'transaction':_0x419a09})['then'](function(){return BPromise[_0x01f8('0x74')](_0x557c8d,function(_0x2ccc7a){return db[_0x01f8('0x75')][_0x01f8('0x76')]({'TeamId':_0x2ccc7a['id'],'VoiceQueueId':_0x42ef97[_0x01f8('0x4e')]['id'],'penalty':_0x2ccc7a[_0x01f8('0x71')]},{'transaction':_0x419a09});});})[_0x01f8('0x27')](function(){return BPromise['each'](_0x5ccf0d,function(_0x1819ce){return db[_0x01f8('0x77')][_0x01f8('0x78')]({'where':{'UserId':_0x1819ce['id'],'VoiceQueueId':_0x42ef97['params']['id']},'defaults':{'penalty':_0x1819ce['penalty']},'transaction':_0x419a09});});})[_0x01f8('0x27')](function(){return BPromise[_0x01f8('0x74')](_[_0x01f8('0x2c')](_0x5ccf0d,{'online':!![]}),function(_0x1205d){return db[_0x01f8('0x79')][_0x01f8('0x76')]({'membername':_0x1205d[_0x01f8('0x33')],'UserId':_0x1205d['id'],'queue_name':_0x2bbfb0['name'],'VoiceQueueId':_0x2bbfb0['id'],'interface':_[_0x01f8('0x7a')](_0x1205d[_0x01f8('0x6e')])?util[_0x01f8('0x7b')](_0x01f8('0x7c'),_0x1205d[_0x01f8('0x33')]):_0x1205d[_0x01f8('0x6e')],'paused':_0x1205d[_0x01f8('0x7d')]||![],'penalty':_0x1205d[_0x01f8('0x71')]},{'transaction':_0x419a09});});})[_0x01f8('0x27')](function(){_0x5ccf0d[_0x01f8('0x70')](function(_0x3c1ad8){socket[_0x01f8('0x7e')](_0x01f8('0x7f'),{'UserId':_0x3c1ad8['id'],'VoiceQueueId':_0x2bbfb0['id']});});});});});}})[_0x01f8('0x27')](respondWithStatusCode(_0x3844f8,null))['catch'](handleError(_0x3844f8,null));};exports[_0x01f8('0x80')]=function(_0x42b021,_0x497708,_0x20fc5b){return db['Team'][_0x01f8('0x4b')]({'where':{'id':_0x42b021[_0x01f8('0x3e')][_0x01f8('0x81')]},'attributes':['id'],'include':[{'model':db[_0x01f8('0x6b')],'as':_0x01f8('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x01f8('0x27')](handleEntityNotFound(_0x497708,null))[_0x01f8('0x27')](function(_0x3b2dff){var _0x180c62=_['map'](_0x3b2dff,'id');var _0x4e6f77=[];var _0x2eb033=[];var _0x78a2bb=squel[_0x01f8('0x82')]();_0x78a2bb[_0x01f8('0x83')](_0x01f8('0x84'))['from']('team_has_voice_queues','tq')['join'](_0x01f8('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x01f8('0x47')](_0x01f8('0x86'),_0x42b021[_0x01f8('0x4e')]['id']);for(var _0xf591dd=0x0;_0xf591dd<_0x3b2dff['length'];_0xf591dd+=0x1){let _0x4b5519=_0x3b2dff[_0xf591dd];for(var _0x1fa01c=0x0;_0x1fa01c<_0x4b5519['Agents'][_0x01f8('0x43')];_0x1fa01c+=0x1){let _0x4a0985=_0x4b5519['Agents'][_0x1fa01c];var _0x3547d8=_0x78a2bb['clone']();_0x3547d8[_0x01f8('0x47')](_0x01f8('0x87'),_0x4a0985['id']);_0x2eb033['push'](db[_0x01f8('0x88')][_0x01f8('0x3e')](_0x3547d8[_0x01f8('0x89')](),{'type':db[_0x01f8('0x88')][_0x01f8('0x8a')][_0x01f8('0x8b')]})[_0x01f8('0x27')](function(_0x306701){if(_0x306701['length']===0x1){return _0x4a0985['id'];}else{var _0x46e36b=_[_0x01f8('0x8c')](_[_0x01f8('0x2e')](_0x306701,_0x01f8('0x8d')),function(_0x2fb497){return _[_0x01f8('0x30')](_0x180c62,_0x2fb497);});if(_0x46e36b){return _0x4a0985['id'];}}}));}}return BPromise[_0x01f8('0x8e')](_0x2eb033)[_0x01f8('0x27')](function(_0x192a18){_0x4e6f77=_(_0x4e6f77)[_0x01f8('0x8f')](_0x192a18)['compact']()['value']();return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x42b021[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](function(_0x26608d){return db[_0x01f8('0x88')][_0x01f8('0x72')](function(_0x2efd1d){return _0x26608d[_0x01f8('0x80')](_0x42b021['query'][_0x01f8('0x81')],{'transaction':_0x2efd1d})[_0x01f8('0x27')](function(){if(!_[_0x01f8('0x90')](_0x4e6f77)){return _0x26608d[_0x01f8('0x91')](_0x4e6f77,{'transaction':_0x2efd1d})[_0x01f8('0x27')](function(){return db[_0x01f8('0x79')][_0x01f8('0x28')]({'where':{'VoiceQueueId':_0x42b021[_0x01f8('0x4e')]['id'],'UserId':_0x4e6f77},'transaction':_0x2efd1d});});}})[_0x01f8('0x27')](function(){_0x4e6f77['forEach'](function(_0x2ff5eb){socket[_0x01f8('0x7e')](_0x01f8('0x92'),{'UserId':_0x2ff5eb,'VoiceQueueId':_0x26608d['id']});});});});});});})[_0x01f8('0x27')](respondWithStatusCode(_0x497708,null))[_0x01f8('0x4d')](handleError(_0x497708,null));};exports['addAgents']=function(_0x384939,_0x3e168c,_0x41f259){var _0x4cbcfb,_0xdb626a;return db[_0x01f8('0x3a')]['find']({'where':{'id':_0x384939[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x3e168c,null))[_0x01f8('0x27')](function(_0x3428d5){if(_0x3428d5){_0xdb626a=_0x3428d5;return _0x3428d5[_0x01f8('0x93')](_0x384939[_0x01f8('0x52')][_0x01f8('0x81')],_['omit'](_0x384939[_0x01f8('0x52')],[_0x01f8('0x81'),'id'])||{})['spread'](function(_0x12cd40){for(var _0x938cc5=0x0;_0x938cc5<_0x384939[_0x01f8('0x52')][_0x01f8('0x81')][_0x01f8('0x43')];_0x938cc5+=0x1){socket['emit'](_0x01f8('0x7f'),{'UserId':Number(_0x384939['body']['ids'][_0x938cc5]),'VoiceQueueId':Number(_0x384939[_0x01f8('0x4e')]['id'])});}return _0x12cd40;});}})[_0x01f8('0x27')](function(_0x34d53c){_0x4cbcfb=_0x34d53c||[];if(_0xdb626a){return db[_0x01f8('0x6b')]['findAll']({'where':{'id':_0x384939[_0x01f8('0x52')][_0x01f8('0x81')]},'attributes':['id',_0x01f8('0x33'),_0x01f8('0x6d'),_0x01f8('0x7d'),'interface'],'raw':!![]});}})[_0x01f8('0x27')](function(_0x1f9c68){if(!_['isEmpty'](_0x1f9c68)){var _0x175ff0=[];for(var _0x3c61a6=0x0;_0x3c61a6<_0x1f9c68[_0x01f8('0x43')];_0x3c61a6++){if(_0x1f9c68[_0x3c61a6][_0x01f8('0x6d')]){_0x175ff0[_0x01f8('0x94')](db['UserVoiceQueueRt'][_0x01f8('0x76')]({'membername':_0x1f9c68[_0x3c61a6][_0x01f8('0x33')],'UserId':_0x1f9c68[_0x3c61a6]['id'],'queue_name':_0xdb626a[_0x01f8('0x33')],'VoiceQueueId':_0xdb626a['id'],'interface':_[_0x01f8('0x7a')](_0x1f9c68[_0x3c61a6][_0x01f8('0x6e')])?util[_0x01f8('0x7b')](_0x01f8('0x7c'),_0x1f9c68[_0x3c61a6][_0x01f8('0x33')]):_0x1f9c68[_0x3c61a6][_0x01f8('0x6e')],'paused':_0x1f9c68[_0x3c61a6][_0x01f8('0x7d')]||![],'penalty':_0x384939[_0x01f8('0x52')]['penalty']||0x0}));}}return BPromise['all'](_0x175ff0);}})[_0x01f8('0x27')](function(){return _0x4cbcfb;})[_0x01f8('0x27')](respondWithResult(_0x3e168c,null))['catch'](handleError(_0x3e168c,null));};exports[_0x01f8('0x91')]=function(_0x5b862b,_0x355b03,_0x401732){return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x5b862b[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x355b03,null))[_0x01f8('0x27')](function(_0x25ce4c){if(_0x25ce4c){return _0x25ce4c['removeAgents'](_0x5b862b[_0x01f8('0x3e')][_0x01f8('0x81')])['then'](function(){if(_['isArray'](_0x5b862b['query'][_0x01f8('0x81')])){for(var _0x3421ee=0x0;_0x3421ee<_0x5b862b[_0x01f8('0x3e')]['ids'][_0x01f8('0x43')];_0x3421ee+=0x1){socket[_0x01f8('0x7e')](_0x01f8('0x92'),{'UserId':Number(_0x5b862b[_0x01f8('0x3e')][_0x01f8('0x81')][_0x3421ee]),'VoiceQueueId':Number(_0x5b862b[_0x01f8('0x4e')]['id'])});}}else{socket['emit'](_0x01f8('0x92'),{'UserId':Number(_0x5b862b['query'][_0x01f8('0x81')]),'VoiceQueueId':Number(_0x5b862b[_0x01f8('0x4e')]['id'])});}});}})[_0x01f8('0x27')](function(_0x5f2f45){return db['UserVoiceQueueRt'][_0x01f8('0x28')]({'where':{'VoiceQueueId':_0x5b862b[_0x01f8('0x4e')]['id'],'UserId':_0x5b862b[_0x01f8('0x3e')][_0x01f8('0x81')]}})[_0x01f8('0x27')](function(){return _0x5f2f45;});})['then'](respondWithStatusCode(_0x355b03,null))[_0x01f8('0x4d')](handleError(_0x355b03,null));};exports[_0x01f8('0x95')]=function(_0x15a8ef,_0x3e19e6,_0x1bec5e){var _0x1f3aab={};var _0x313692={};var _0x378825;var _0x3251b5;return db[_0x01f8('0x3a')][_0x01f8('0x60')]({'where':{'id':_0x15a8ef[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x3e19e6,null))['then'](function(_0xf7ab61){if(_0xf7ab61){_0x378825=_0xf7ab61;_0x313692['model']=_[_0x01f8('0x3f')](db['User'][_0x01f8('0x3b')]);_0x313692['query']=_[_0x01f8('0x3f')](_0x15a8ef['query']);_0x313692[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0x313692['model'],_0x313692['query']);_0x1f3aab[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x313692['model'],qs[_0x01f8('0x4f')](_0x15a8ef['query']['fields']));_0x1f3aab[_0x01f8('0x42')]=_0x1f3aab[_0x01f8('0x42')][_0x01f8('0x43')]?_0x1f3aab[_0x01f8('0x42')]:_0x313692[_0x01f8('0x3d')];_0x1f3aab['order']=qs['sort'](_0x15a8ef[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x1f3aab['where']=qs[_0x01f8('0x40')](_['pick'](_0x15a8ef['query'],_0x313692['filters']));if(_0x15a8ef['query'][_0x01f8('0x2c')]){_0x1f3aab[_0x01f8('0x47')]=_[_0x01f8('0x48')](_0x1f3aab[_0x01f8('0x47')],{'$or':_[_0x01f8('0x2e')](_0x1f3aab[_0x01f8('0x42')],function(_0x378556){var _0x52fec4={};_0x52fec4[_0x378556]={'$like':'%'+_0x15a8ef[_0x01f8('0x3e')][_0x01f8('0x2c')]+'%'};return _0x52fec4;})});}_0x1f3aab=_[_0x01f8('0x48')]({},_0x1f3aab,_0x15a8ef['options']);return _0x378825[_0x01f8('0x95')](_0x1f3aab);}})[_0x01f8('0x27')](function(_0x2119c6){if(_0x2119c6){_0x3251b5=_0x2119c6[_0x01f8('0x43')];if(!_0x15a8ef[_0x01f8('0x3e')]['hasOwnProperty']('nolimit')){_0x1f3aab[_0x01f8('0x21')]=qs[_0x01f8('0x21')](_0x15a8ef[_0x01f8('0x3e')]['limit']);_0x1f3aab[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x15a8ef[_0x01f8('0x3e')][_0x01f8('0x1e')]);}return _0x378825[_0x01f8('0x95')](_0x1f3aab);}})[_0x01f8('0x27')](function(_0x3884ef){if(_0x3884ef){return _0x3884ef?{'count':_0x3251b5,'rows':_0x3884ef}:null;}})[_0x01f8('0x27')](respondWithResult(_0x3e19e6,null))['catch'](handleError(_0x3e19e6,null));};exports[_0x01f8('0x96')]=function(_0x50fa15,_0x203af6,_0x1215a4){var _0x5700ef={};var _0x166ae4={};var _0xd2dac1;var _0x549408;return db[_0x01f8('0x3a')]['findOne']({'where':{'id':_0x50fa15['params']['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x203af6,null))[_0x01f8('0x27')](function(_0x230802){if(_0x230802){_0xd2dac1=_0x230802;_0x166ae4[_0x01f8('0x3d')]=_['keys'](db['UserVoiceQueueRt'][_0x01f8('0x3b')]);_0x166ae4[_0x01f8('0x3e')]=_[_0x01f8('0x3f')](_0x50fa15[_0x01f8('0x3e')]);_0x166ae4[_0x01f8('0x40')]=_['intersection'](_0x166ae4[_0x01f8('0x3d')],_0x166ae4[_0x01f8('0x3e')]);_0x5700ef[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0x166ae4[_0x01f8('0x3d')],qs['fields'](_0x50fa15[_0x01f8('0x3e')][_0x01f8('0x4f')]));_0x5700ef[_0x01f8('0x42')]=_0x5700ef[_0x01f8('0x42')][_0x01f8('0x43')]?_0x5700ef[_0x01f8('0x42')]:_0x166ae4[_0x01f8('0x3d')];_0x5700ef['order']=qs[_0x01f8('0x46')](_0x50fa15[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x5700ef[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_[_0x01f8('0x65')](_0x50fa15[_0x01f8('0x3e')],_0x166ae4[_0x01f8('0x40')]));if(_0x50fa15[_0x01f8('0x3e')][_0x01f8('0x2c')]){_0x5700ef['where']=_[_0x01f8('0x48')](_0x5700ef[_0x01f8('0x47')],{'$or':_['map'](_0x5700ef[_0x01f8('0x42')],function(_0x104fce){var _0x57a295={};_0x57a295[_0x104fce]={'$like':'%'+_0x50fa15[_0x01f8('0x3e')][_0x01f8('0x2c')]+'%'};return _0x57a295;})});}_0x5700ef=_['merge']({},_0x5700ef,_0x50fa15['options']);return _0xd2dac1[_0x01f8('0x96')](_0x5700ef);}})[_0x01f8('0x27')](function(_0x1198d7){if(_0x1198d7){_0x549408=_0x1198d7[_0x01f8('0x43')];if(!_0x50fa15[_0x01f8('0x3e')][_0x01f8('0x44')](_0x01f8('0x62'))){_0x5700ef['limit']=qs[_0x01f8('0x21')](_0x50fa15[_0x01f8('0x3e')]['limit']);_0x5700ef['offset']=qs[_0x01f8('0x1e')](_0x50fa15[_0x01f8('0x3e')]['offset']);}return _0xd2dac1[_0x01f8('0x96')](_0x5700ef);}})['then'](function(_0xe318f){return _0xe318f?{'count':_0x549408,'rows':_0xe318f}:null;})[_0x01f8('0x27')](respondWithResult(_0x203af6,null))[_0x01f8('0x4d')](handleError(_0x203af6,null));};exports[_0x01f8('0x97')]=function(_0x12188f,_0x19dc25,_0x5ea904){var _0x104d3a={};var _0xdb4286={};var _0x5b369f;var _0x1e76e9;return db[_0x01f8('0x3a')][_0x01f8('0x60')]({'where':{'id':_0x12188f[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x19dc25,null))[_0x01f8('0x27')](function(_0x20b5f8){if(_0x20b5f8){_0x5b369f=_0x20b5f8;_0xdb4286[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db[_0x01f8('0x98')]['rawAttributes']);_0xdb4286[_0x01f8('0x3e')]=_[_0x01f8('0x3f')](_0x12188f[_0x01f8('0x3e')]);_0xdb4286[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0xdb4286['model'],_0xdb4286[_0x01f8('0x3e')]);_0x104d3a[_0x01f8('0x42')]=_[_0x01f8('0x41')](_0xdb4286[_0x01f8('0x3d')],qs[_0x01f8('0x4f')](_0x12188f[_0x01f8('0x3e')]['fields']));_0x104d3a[_0x01f8('0x42')]=_0x104d3a['attributes'][_0x01f8('0x43')]?_0x104d3a[_0x01f8('0x42')]:_0xdb4286[_0x01f8('0x3d')];_0x104d3a[_0x01f8('0x45')]=qs[_0x01f8('0x46')](_0x12188f['query'][_0x01f8('0x46')]);_0x104d3a[_0x01f8('0x47')]=qs['filters'](_[_0x01f8('0x65')](_0x12188f[_0x01f8('0x3e')],_0xdb4286[_0x01f8('0x40')]));if(_0x12188f['query'][_0x01f8('0x2c')]){_0x104d3a[_0x01f8('0x47')]=_[_0x01f8('0x48')](_0x104d3a[_0x01f8('0x47')],{'$or':_[_0x01f8('0x2e')](_0x104d3a[_0x01f8('0x42')],function(_0x315444){var _0x1076e8={};_0x1076e8[_0x315444]={'$like':'%'+_0x12188f[_0x01f8('0x3e')][_0x01f8('0x2c')]+'%'};return _0x1076e8;})});}_0x104d3a=_[_0x01f8('0x48')]({},_0x104d3a,_0x12188f[_0x01f8('0x50')]);return _0x5b369f[_0x01f8('0x97')](_0x104d3a);}})[_0x01f8('0x27')](function(_0x19ce8d){if(_0x19ce8d){_0x1e76e9=_0x19ce8d[_0x01f8('0x43')];if(!_0x12188f[_0x01f8('0x3e')]['hasOwnProperty']('nolimit')){_0x104d3a[_0x01f8('0x21')]=qs[_0x01f8('0x21')](_0x12188f[_0x01f8('0x3e')][_0x01f8('0x21')]);_0x104d3a[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x12188f['query'][_0x01f8('0x1e')]);}return _0x5b369f[_0x01f8('0x97')](_0x104d3a);}})[_0x01f8('0x27')](function(_0x5997cf){if(_0x5997cf){return _0x5997cf?{'count':_0x1e76e9,'rows':_0x5997cf}:null;}})[_0x01f8('0x27')](respondWithResult(_0x19dc25,null))['catch'](handleError(_0x19dc25,null));};exports[_0x01f8('0x99')]=function(_0x16a68c,_0x4e48c7,_0x5bd809){var _0x39ebb7,_0xe28cfe;return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x16a68c[_0x01f8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e48c7,null))[_0x01f8('0x27')](function(_0x1cd7c2){if(_0x1cd7c2){_0xe28cfe=_0x1cd7c2;return _0x1cd7c2[_0x01f8('0x99')](_0x16a68c[_0x01f8('0x52')]['ids'],_[_0x01f8('0x5d')](_0x16a68c[_0x01f8('0x52')],[_0x01f8('0x81'),'id'])||{});}return null;})['spread'](function(_0x49a357){var _0x40fab8;_0x39ebb7=_0x49a357||[];var _0x85b5d9=[];if(_0x49a357){for(var _0x597ebb=0x0;_0x597ebb<_0x49a357[_0x01f8('0x43')];_0x597ebb+=0x1){var _0x22856b=_0x49a357[_0x597ebb][_0x01f8('0x54')]({'plain':!![]});_0xe28cfe[_0x01f8('0x9a')]=_0x16a68c['body'][_0x01f8('0x9a')]?_0x16a68c[_0x01f8('0x52')][_0x01f8('0x9a')]:_0xe28cfe[_0x01f8('0x9a')];switch(_0xe28cfe['dialCheckDuplicateType']){case'always':_0x40fab8=squel[_0x01f8('0x9b')]()[_0x01f8('0x9c')](_0x01f8('0x9d'))['fromQuery']([_0x01f8('0x9e'),_0x01f8('0x9f'),'ContactId',_0x01f8('0xa0'),_0x01f8('0x63'),'createdAt',_0x01f8('0x5f')],squel[_0x01f8('0x82')]()[_0x01f8('0x83')](_0x01f8('0x9e'),_0x01f8('0x9e'))['field'](_0x01f8('0xa1'),_0x01f8('0x9f'))[_0x01f8('0x83')]('id',_0x01f8('0xa2'))[_0x01f8('0x83')](_0x22856b[_0x01f8('0xa3')][_0x01f8('0x89')](),_0x01f8('0xa0'))[_0x01f8('0x83')](_0x16a68c[_0x01f8('0x4e')]['id'][_0x01f8('0x89')](),_0x01f8('0x63'))[_0x01f8('0x83')](_0x01f8('0xa1'),_0x01f8('0x5e'))['field']('NOW()',_0x01f8('0x5f'))['from'](_0x01f8('0xa4'))[_0x01f8('0x47')]('deletedAt\x20IS\x20NULL')[_0x01f8('0x47')](_0x01f8('0xa5'),_0x22856b[_0x01f8('0xa3')][_0x01f8('0x89')]())[_0x01f8('0x47')](_0x01f8('0xa6'))[_0x01f8('0x47')](_0x01f8('0xa7'),squel[_0x01f8('0x82')]()[_0x01f8('0x83')](_0x01f8('0xa8'))['from'](_0x01f8('0xa9'))[_0x01f8('0x47')](_0x01f8('0x86'),_0x16a68c['params']['id'][_0x01f8('0x89')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x01f8('0x82')]()[_0x01f8('0x83')]('COALESCE(phone,\x27\x27)')[_0x01f8('0xaa')]('cm_hopper')[_0x01f8('0x47')](_0x01f8('0x86'),_0x16a68c[_0x01f8('0x4e')]['id']['toString']())))[_0x01f8('0x89')]();break;case'onlyIfOpen':_0x40fab8=squel[_0x01f8('0x9b')]()['into'](_0x01f8('0x9d'))['fromQuery']([_0x01f8('0x9e'),'scheduledAt',_0x01f8('0xa2'),_0x01f8('0xa0'),_0x01f8('0x63'),_0x01f8('0x5e'),_0x01f8('0x5f')],squel[_0x01f8('0x82')]()[_0x01f8('0x83')](_0x01f8('0x9e'),_0x01f8('0x9e'))[_0x01f8('0x83')](_0x01f8('0xa1'),_0x01f8('0x9f'))['field']('id','ContactId')[_0x01f8('0x83')](_0x22856b[_0x01f8('0xa3')][_0x01f8('0x89')](),_0x01f8('0xa0'))[_0x01f8('0x83')](_0x16a68c[_0x01f8('0x4e')]['id'][_0x01f8('0x89')](),_0x01f8('0x63'))['field'](_0x01f8('0xa1'),_0x01f8('0x5e'))[_0x01f8('0x83')](_0x01f8('0xa1'),_0x01f8('0x5f'))[_0x01f8('0xaa')](_0x01f8('0xa4'))[_0x01f8('0x47')]('deletedAt\x20IS\x20NULL')[_0x01f8('0x47')](_0x01f8('0xa5'),_0x22856b[_0x01f8('0xa3')][_0x01f8('0x89')]())[_0x01f8('0x47')](_0x01f8('0xa6'))[_0x01f8('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x01f8('0x82')]()[_0x01f8('0x83')](_0x01f8('0xab'))['from'](_0x01f8('0x9d'))[_0x01f8('0x47')](_0x01f8('0x86'),_0x16a68c[_0x01f8('0x4e')]['id'][_0x01f8('0x89')]())))[_0x01f8('0x89')]();break;default:_0x40fab8=squel['insert']()[_0x01f8('0x9c')]('cm_hopper')['fromQuery']([_0x01f8('0x9e'),_0x01f8('0x9f'),'ContactId',_0x01f8('0xa0'),_0x01f8('0x63'),_0x01f8('0x5e'),_0x01f8('0x5f')],squel[_0x01f8('0x82')]()[_0x01f8('0x83')](_0x01f8('0x9e'),_0x01f8('0x9e'))[_0x01f8('0x83')](_0x01f8('0xa1'),_0x01f8('0x9f'))[_0x01f8('0x83')]('id',_0x01f8('0xa2'))[_0x01f8('0x83')](_0x22856b[_0x01f8('0xa3')][_0x01f8('0x89')](),_0x01f8('0xa0'))[_0x01f8('0x83')](_0x16a68c[_0x01f8('0x4e')]['id']['toString'](),_0x01f8('0x63'))['field']('NOW()','createdAt')[_0x01f8('0x83')](_0x01f8('0xa1'),_0x01f8('0x5f'))[_0x01f8('0xaa')](_0x01f8('0xa4'))[_0x01f8('0x47')]('deletedAt\x20IS\x20NULL')[_0x01f8('0x47')]('ListId\x20=\x20?',_0x22856b[_0x01f8('0xa3')]['toString']())[_0x01f8('0x47')](_0x01f8('0xa6')))[_0x01f8('0x89')]();}_0x85b5d9[_0x01f8('0x94')](db[_0x01f8('0x88')][_0x01f8('0x3e')](_0x40fab8));}return BPromise[_0x01f8('0x8e')](_0x85b5d9);}})[_0x01f8('0x27')](function(){return _0x39ebb7;})[_0x01f8('0x27')](respondWithResult(_0x4e48c7,null))[_0x01f8('0x4d')](handleError(_0x4e48c7,null));};exports[_0x01f8('0xac')]=function(_0x347e7f,_0x3b120a,_0x116d14){return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x347e7f['params']['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x3b120a,null))['then'](function(_0x5f2c2d){if(_0x5f2c2d){return _0x5f2c2d[_0x01f8('0xac')](_0x347e7f[_0x01f8('0x3e')]['ids']);}})[_0x01f8('0x27')](function(_0x5b287e){if(_0x5b287e){return db[_0x01f8('0x61')][_0x01f8('0x28')]({'where':{'ListId':_0x347e7f[_0x01f8('0x3e')]['ids'],'VoiceQueueId':_0x347e7f['params']['id']}})[_0x01f8('0x27')](function(){return _0x5b287e;});}})[_0x01f8('0x27')](respondWithStatusCode(_0x3b120a,null))['catch'](handleError(_0x3b120a,null));};exports['getBlackLists']=function(_0x37e6b9,_0x258da0,_0xcf3f14){var _0x2e5e89={};var _0x5b7526={};var _0x39ae7d;var _0x3d84c1;return db[_0x01f8('0x3a')][_0x01f8('0x60')]({'where':{'id':_0x37e6b9['params']['id']}})['then'](handleEntityNotFound(_0x258da0,null))['then'](function(_0x472a35){if(_0x472a35){_0x39ae7d=_0x472a35;_0x5b7526[_0x01f8('0x3d')]=_[_0x01f8('0x3f')](db['CmList'][_0x01f8('0x3b')]);_0x5b7526['query']=_['keys'](_0x37e6b9[_0x01f8('0x3e')]);_0x5b7526[_0x01f8('0x40')]=_[_0x01f8('0x41')](_0x5b7526['model'],_0x5b7526[_0x01f8('0x3e')]);_0x2e5e89['attributes']=_[_0x01f8('0x41')](_0x5b7526['model'],qs[_0x01f8('0x4f')](_0x37e6b9['query'][_0x01f8('0x4f')]));_0x2e5e89[_0x01f8('0x42')]=_0x2e5e89[_0x01f8('0x42')][_0x01f8('0x43')]?_0x2e5e89[_0x01f8('0x42')]:_0x5b7526[_0x01f8('0x3d')];_0x2e5e89[_0x01f8('0x45')]=qs['sort'](_0x37e6b9[_0x01f8('0x3e')][_0x01f8('0x46')]);_0x2e5e89[_0x01f8('0x47')]=qs[_0x01f8('0x40')](_[_0x01f8('0x65')](_0x37e6b9['query'],_0x5b7526[_0x01f8('0x40')]));if(_0x37e6b9[_0x01f8('0x3e')][_0x01f8('0x2c')]){_0x2e5e89['where']=_[_0x01f8('0x48')](_0x2e5e89[_0x01f8('0x47')],{'$or':_[_0x01f8('0x2e')](_0x2e5e89[_0x01f8('0x42')],function(_0x53764b){var _0x5aef10={};_0x5aef10[_0x53764b]={'$like':'%'+_0x37e6b9['query'][_0x01f8('0x2c')]+'%'};return _0x5aef10;})});}_0x2e5e89=_[_0x01f8('0x48')]({},_0x2e5e89,_0x37e6b9[_0x01f8('0x50')]);return _0x39ae7d['getBlackLists'](_0x2e5e89);}})[_0x01f8('0x27')](function(_0x3b2dfc){if(_0x3b2dfc){_0x3d84c1=_0x3b2dfc[_0x01f8('0x43')];if(!_0x37e6b9[_0x01f8('0x3e')][_0x01f8('0x44')](_0x01f8('0x62'))){_0x2e5e89['limit']=qs[_0x01f8('0x21')](_0x37e6b9[_0x01f8('0x3e')]['limit']);_0x2e5e89[_0x01f8('0x1e')]=qs[_0x01f8('0x1e')](_0x37e6b9[_0x01f8('0x3e')][_0x01f8('0x1e')]);}return _0x39ae7d['getBlackLists'](_0x2e5e89);}})['then'](function(_0x5c2836){if(_0x5c2836){return _0x5c2836?{'count':_0x3d84c1,'rows':_0x5c2836}:null;}})[_0x01f8('0x27')](respondWithResult(_0x258da0,null))[_0x01f8('0x4d')](handleError(_0x258da0,null));};exports[_0x01f8('0xad')]=function(_0x3e29d8,_0x23cb96,_0x275558){var _0x97c82c,_0x2777e6;return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x3e29d8['params']['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x23cb96,null))['then'](function(_0x53b940){if(_0x53b940){_0x2777e6=_0x53b940;return _0x53b940[_0x01f8('0xad')](_0x3e29d8[_0x01f8('0x52')][_0x01f8('0x81')],_[_0x01f8('0x5d')](_0x3e29d8[_0x01f8('0x52')],[_0x01f8('0x81'),'id'])||{});}return null;})[_0x01f8('0xae')](function(_0x19db81){var _0x43bf5e;_0x97c82c=_0x19db81||[];var _0x16bed2=[];if(_0x19db81){for(var _0xd6ee7a=0x0;_0xd6ee7a<_0x19db81[_0x01f8('0x43')];_0xd6ee7a+=0x1){var _0x22260b=_0x19db81[_0xd6ee7a][_0x01f8('0x54')]({'plain':!![]});_0x43bf5e=squel[_0x01f8('0x9b')]()['into']('cm_hopper_black')[_0x01f8('0xaf')]([_0x01f8('0x9e'),_0x01f8('0xa2'),_0x01f8('0xa0'),'VoiceQueueId',_0x01f8('0x5e'),_0x01f8('0x5f')],squel[_0x01f8('0x82')]()[_0x01f8('0x83')]('phone',_0x01f8('0x9e'))[_0x01f8('0x83')]('id','ContactId')['field'](_0x22260b[_0x01f8('0xa3')]['toString'](),_0x01f8('0xa0'))['field'](_0x3e29d8['params']['id']['toString'](),'VoiceQueueId')['field'](_0x01f8('0xa1'),_0x01f8('0x5e'))[_0x01f8('0x83')](_0x01f8('0xa1'),'updatedAt')[_0x01f8('0xaa')](_0x01f8('0xa4'))[_0x01f8('0x47')](_0x01f8('0xb0'))[_0x01f8('0x47')](_0x01f8('0xa5'),_0x22260b[_0x01f8('0xa3')][_0x01f8('0x89')]())[_0x01f8('0x47')](_0x01f8('0xa6')))['toString']();_0x16bed2['push'](db['sequelize'][_0x01f8('0x3e')](_0x43bf5e));}return BPromise['all'](_0x16bed2);}})[_0x01f8('0x27')](function(){return _0x97c82c;})['then'](respondWithResult(_0x23cb96,null))[_0x01f8('0x4d')](handleError(_0x23cb96,null));};exports[_0x01f8('0xb1')]=function(_0x561079,_0x122378,_0xb333c0){return db[_0x01f8('0x3a')][_0x01f8('0x32')]({'where':{'id':_0x561079[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x122378,null))['then'](function(_0x23871a){if(_0x23871a){return _0x23871a[_0x01f8('0xb1')](_0x561079[_0x01f8('0x3e')]['ids']);}})['then'](function(_0x4507ad){if(_0x4507ad){return db['CmHopperBlack'][_0x01f8('0x28')]({'where':{'ListId':_0x561079[_0x01f8('0x3e')][_0x01f8('0x81')],'VoiceQueueId':_0x561079[_0x01f8('0x4e')]['id']}})[_0x01f8('0x27')](function(){return _0x4507ad;});}})['then'](respondWithStatusCode(_0x122378,null))['catch'](handleError(_0x122378,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index e992c15..708ec3d 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 _0x24c4=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x45322a,_0x138b74){var _0x3a4358=function(_0x3b4fc2){while(--_0x3b4fc2){_0x45322a['push'](_0x45322a['shift']());}};_0x3a4358(++_0x138b74);}(_0x24c4,0xbe));var _0x424c=function(_0x2a346c,_0x205808){_0x2a346c=_0x2a346c-0x0;var _0x1945e0=_0x24c4[_0x2a346c];return _0x1945e0;};'use strict';var EventEmitter=require(_0x424c('0x0'));var VoiceQueue=require(_0x424c('0x1'))['db'][_0x424c('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x424c('0x3')](0x0);var events={'afterCreate':_0x424c('0x4'),'afterUpdate':_0x424c('0x5'),'afterDestroy':_0x424c('0x6')};function emitEvent(_0x1544e5){return function(_0xb64756,_0x53b370,_0x9d7c85){VoiceQueueEvents[_0x424c('0x7')](_0x1544e5+':'+_0xb64756['id'],_0xb64756);VoiceQueueEvents['emit'](_0x1544e5,_0xb64756);_0x9d7c85(null);};}for(var e in events){if(events[_0x424c('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x424c('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x517d=['exports','../../mysqldb','VoiceQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x3be8af,_0x268852){var _0x4e1ff8=function(_0x280c84){while(--_0x280c84){_0x3be8af['push'](_0x3be8af['shift']());}};_0x4e1ff8(++_0x268852);}(_0x517d,0x109));var _0xd517=function(_0x26caa9,_0x4fb87a){_0x26caa9=_0x26caa9-0x0;var _0x353094=_0x517d[_0x26caa9];return _0x353094;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xd517('0x0'))['db'][_0xd517('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd517('0x2'),'afterUpdate':_0xd517('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4bae2d){return function(_0x3c81c2,_0x364850,_0x2c0a33){VoiceQueueEvents[_0xd517('0x4')](_0x4bae2d+':'+_0x3c81c2['id'],_0x3c81c2);VoiceQueueEvents[_0xd517('0x4')](_0x4bae2d,_0x3c81c2);_0x2c0a33(null);};}for(var e in events){if(events[_0xd517('0x5')](e)){var event=events[e];VoiceQueue[_0xd517('0x6')](e,emitEvent(event));}}module[_0xd517('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 4e6bd4d..cee6531 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x72e9a9,_0x50c5c1){var _0x40f7fe=function(_0x580304){while(--_0x580304){_0x72e9a9['push'](_0x72e9a9['shift']());}};_0x40f7fe(++_0x50c5c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x34a752,_0x152aa1){_0x34a752=_0x34a752-0x0;var _0x121f4e=_0xedd9[_0x34a752];return _0x121f4e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x53e611,_0x207d96){var _0x9e34f7=function(_0x222b25){while(--_0x222b25){_0x53e611['push'](_0x53e611['shift']());}};_0x9e34f7(++_0x207d96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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':'voice_queues','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 8262d63..feb9b8c 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 _0xf752=['VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf752,0x1b1));var _0x2f75=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf752[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x2f75('0x0'));var util=require(_0x2f75('0x1'));var moment=require(_0x2f75('0x2'));var BPromise=require(_0x2f75('0x3'));var rs=require(_0x2f75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f75('0x5'))['db'];var utils=require(_0x2f75('0x6'));var logger=require(_0x2f75('0x7'))('rpc');var config=require(_0x2f75('0x8'));var jayson=require(_0x2f75('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2f75('0xa')]=_[_0x2f75('0xb')](config['redis'],{'host':_0x2f75('0xc'),'port':0x18eb});var socket=require(_0x2f75('0xd'))(new Redis(config[_0x2f75('0xa')]));require(_0x2f75('0xe'))[_0x2f75('0xf')](socket);function respondWithRpcPromise(_0x22fa4b,_0x322dff,_0x452578){return new BPromise(function(_0xe107e1,_0x30102b){return client[_0x2f75('0x10')](_0x22fa4b,_0x452578)[_0x2f75('0x11')](function(_0x394b7e){logger['info'](_0x2f75('0x12'),_0x322dff,'request\x20sent');logger['debug'](_0x2f75('0x13'),_0x322dff,_0x2f75('0x14'),JSON[_0x2f75('0x15')](_0x394b7e));if(_0x394b7e['error']){if(_0x394b7e[_0x2f75('0x16')][_0x2f75('0x17')]===0x1f4){logger[_0x2f75('0x16')](_0x2f75('0x12'),_0x322dff,_0x394b7e[_0x2f75('0x16')]['message']);return _0x30102b(_0x394b7e['error'][_0x2f75('0x18')]);}logger[_0x2f75('0x16')](_0x2f75('0x12'),_0x322dff,_0x394b7e[_0x2f75('0x16')][_0x2f75('0x18')]);return _0xe107e1(_0x394b7e[_0x2f75('0x16')][_0x2f75('0x18')]);}else{logger[_0x2f75('0x19')](_0x2f75('0x12'),_0x322dff,'request\x20sent');_0xe107e1(_0x394b7e[_0x2f75('0x1a')][_0x2f75('0x18')]);}})[_0x2f75('0x1b')](function(_0xfcebb2){logger[_0x2f75('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x322dff,_0xfcebb2);_0x30102b(_0xfcebb2);});});}exports[_0x2f75('0x1c')]=function(_0x364755){var _0xe92d71=this;return new Promise(function(_0x2ac4a0,_0x452af6){return db[_0x2f75('0x1d')][_0x2f75('0x1e')]({'raw':_0x364755[_0x2f75('0x1f')]?_0x364755['options'][_0x2f75('0x20')]===undefined?!![]:![]:!![],'where':_0x364755[_0x2f75('0x1f')]?_0x364755['options'][_0x2f75('0x21')]||null:null,'attributes':_0x364755[_0x2f75('0x1f')]?_0x364755[_0x2f75('0x1f')][_0x2f75('0x22')]||null:null,'limit':_0x364755[_0x2f75('0x1f')]?_0x364755[_0x2f75('0x1f')][_0x2f75('0x23')]||null:null,'include':_0x364755[_0x2f75('0x1f')]?_0x364755['options'][_0x2f75('0x24')]?_[_0x2f75('0x25')](_0x364755['options'][_0x2f75('0x24')],function(_0x393ec7){return{'model':db[_0x393ec7[_0x2f75('0x26')]],'as':_0x393ec7['as'],'attributes':_0x393ec7[_0x2f75('0x22')],'include':_0x393ec7['include']?_[_0x2f75('0x25')](_0x393ec7[_0x2f75('0x24')],function(_0x17e701){return{'model':db[_0x17e701['model']],'as':_0x17e701['as'],'attributes':_0x17e701[_0x2f75('0x22')],'include':_0x17e701['include']?_[_0x2f75('0x25')](_0x17e701[_0x2f75('0x24')],function(_0x5d0f41){return{'model':db[_0x5d0f41[_0x2f75('0x26')]],'as':_0x5d0f41['as'],'attributes':_0x5d0f41[_0x2f75('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16945e){logger[_0x2f75('0x19')](_0x2f75('0x1c'),_0x364755);logger[_0x2f75('0x27')](_0x2f75('0x1c'),_0x364755,JSON[_0x2f75('0x15')](_0x16945e));_0x2ac4a0(_0x16945e);})[_0x2f75('0x1b')](function(_0xdfabda){logger[_0x2f75('0x16')]('GetVoiceQueue',_0xdfabda[_0x2f75('0x18')],_0x364755);_0x452af6(_0xe92d71[_0x2f75('0x16')](0x1f4,_0xdfabda[_0x2f75('0x18')]));});});};exports[_0x2f75('0x28')]=function(_0x33fc6a){var _0x287b60=this;return new Promise(function(_0x51ea76,_0x5b1f80){return db['VoiceQueue'][_0x2f75('0x29')]({'raw':_0x33fc6a[_0x2f75('0x1f')]?_0x33fc6a[_0x2f75('0x1f')][_0x2f75('0x20')]===undefined?!![]:![]:!![],'where':_0x33fc6a['options']?_0x33fc6a['options'][_0x2f75('0x21')]||null:null,'attributes':_0x33fc6a[_0x2f75('0x1f')]?_0x33fc6a['options']['attributes']||null:null,'include':_0x33fc6a['options']?_0x33fc6a[_0x2f75('0x1f')][_0x2f75('0x24')]?_[_0x2f75('0x25')](_0x33fc6a[_0x2f75('0x1f')]['include'],function(_0x2904ba){return{'model':db[_0x2904ba[_0x2f75('0x26')]],'as':_0x2904ba['as'],'attributes':_0x2904ba['attributes'],'include':_0x2904ba[_0x2f75('0x24')]?_[_0x2f75('0x25')](_0x2904ba[_0x2f75('0x24')],function(_0x443b5e){return{'model':db[_0x443b5e['model']],'as':_0x443b5e['as'],'attributes':_0x443b5e[_0x2f75('0x22')],'include':_0x443b5e[_0x2f75('0x24')]?_[_0x2f75('0x25')](_0x443b5e[_0x2f75('0x24')],function(_0x333c77){return{'model':db[_0x333c77['model']],'as':_0x333c77['as'],'attributes':_0x333c77[_0x2f75('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1893df){logger[_0x2f75('0x19')](_0x2f75('0x28'),_0x33fc6a);logger[_0x2f75('0x27')](_0x2f75('0x28'),_0x33fc6a,JSON[_0x2f75('0x15')](_0x1893df));_0x51ea76(_0x1893df);})[_0x2f75('0x1b')](function(_0xd013f5){logger['error'](_0x2f75('0x28'),_0xd013f5['message'],_0x33fc6a);_0x5b1f80(_0x287b60[_0x2f75('0x16')](0x1f4,_0xd013f5['message']));});});}; \ No newline at end of file +var _0xc3d8=['ShowVoiceQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xc3d8,0x79));var _0x8c3d=function(_0x2ea975,_0x540a2f){_0x2ea975=_0x2ea975-0x0;var _0x4939a4=_0xc3d8[_0x2ea975];return _0x4939a4;};'use strict';var _=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var moment=require('moment');var BPromise=require(_0x8c3d('0x2'));var rs=require(_0x8c3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c3d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c3d('0x5'))(_0x8c3d('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c3d('0x7'));var client=jayson[_0x8c3d('0x8')][_0x8c3d('0x9')]({'port':0x232a});config['redis']=_[_0x8c3d('0xa')](config[_0x8c3d('0xb')],{'host':_0x8c3d('0xc'),'port':0x18eb});var socket=require(_0x8c3d('0xd'))(new Redis(config[_0x8c3d('0xb')]));require(_0x8c3d('0xe'))[_0x8c3d('0xf')](socket);function respondWithRpcPromise(_0x42eb7c,_0x1cbb12,_0x4b4ed6){return new BPromise(function(_0x170a41,_0x24ee2a){return client[_0x8c3d('0x10')](_0x42eb7c,_0x4b4ed6)[_0x8c3d('0x11')](function(_0xa4308e){logger[_0x8c3d('0x12')](_0x8c3d('0x13'),_0x1cbb12,_0x8c3d('0x14'));logger[_0x8c3d('0x15')](_0x8c3d('0x16'),_0x1cbb12,_0x8c3d('0x14'),JSON[_0x8c3d('0x17')](_0xa4308e));if(_0xa4308e['error']){if(_0xa4308e[_0x8c3d('0x18')][_0x8c3d('0x19')]===0x1f4){logger['error'](_0x8c3d('0x13'),_0x1cbb12,_0xa4308e[_0x8c3d('0x18')][_0x8c3d('0x1a')]);return _0x24ee2a(_0xa4308e['error'][_0x8c3d('0x1a')]);}logger[_0x8c3d('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x1cbb12,_0xa4308e['error'][_0x8c3d('0x1a')]);return _0x170a41(_0xa4308e[_0x8c3d('0x18')][_0x8c3d('0x1a')]);}else{logger[_0x8c3d('0x12')](_0x8c3d('0x13'),_0x1cbb12,_0x8c3d('0x14'));_0x170a41(_0xa4308e['result'][_0x8c3d('0x1a')]);}})[_0x8c3d('0x1b')](function(_0xd69fa5){logger['error'](_0x8c3d('0x13'),_0x1cbb12,_0xd69fa5);_0x24ee2a(_0xd69fa5);});});}exports['GetVoiceQueue']=function(_0x1d8c2f){var _0x1e57e3=this;return new Promise(function(_0x314ed1,_0x5a25ad){return db[_0x8c3d('0x1c')][_0x8c3d('0x1d')]({'raw':_0x1d8c2f[_0x8c3d('0x1e')]?_0x1d8c2f[_0x8c3d('0x1e')][_0x8c3d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1d8c2f[_0x8c3d('0x1e')]?_0x1d8c2f['options'][_0x8c3d('0x20')]||null:null,'attributes':_0x1d8c2f['options']?_0x1d8c2f['options'][_0x8c3d('0x21')]||null:null,'limit':_0x1d8c2f['options']?_0x1d8c2f['options'][_0x8c3d('0x22')]||null:null,'include':_0x1d8c2f[_0x8c3d('0x1e')]?_0x1d8c2f[_0x8c3d('0x1e')][_0x8c3d('0x23')]?_[_0x8c3d('0x24')](_0x1d8c2f['options'][_0x8c3d('0x23')],function(_0x202406){return{'model':db[_0x202406[_0x8c3d('0x25')]],'as':_0x202406['as'],'attributes':_0x202406[_0x8c3d('0x21')],'include':_0x202406[_0x8c3d('0x23')]?_[_0x8c3d('0x24')](_0x202406['include'],function(_0x27f6c1){return{'model':db[_0x27f6c1[_0x8c3d('0x25')]],'as':_0x27f6c1['as'],'attributes':_0x27f6c1[_0x8c3d('0x21')],'include':_0x27f6c1[_0x8c3d('0x23')]?_['map'](_0x27f6c1[_0x8c3d('0x23')],function(_0x590e48){return{'model':db[_0x590e48[_0x8c3d('0x25')]],'as':_0x590e48['as'],'attributes':_0x590e48[_0x8c3d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8c3d('0x11')](function(_0x5e5c25){logger[_0x8c3d('0x12')](_0x8c3d('0x26'),_0x1d8c2f);logger['debug']('GetVoiceQueue',_0x1d8c2f,JSON[_0x8c3d('0x17')](_0x5e5c25));_0x314ed1(_0x5e5c25);})[_0x8c3d('0x1b')](function(_0x5b6c0d){logger['error'](_0x8c3d('0x26'),_0x5b6c0d[_0x8c3d('0x1a')],_0x1d8c2f);_0x5a25ad(_0x1e57e3[_0x8c3d('0x18')](0x1f4,_0x5b6c0d[_0x8c3d('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x379797){var _0x33f712=this;return new Promise(function(_0x5afb29,_0x5d0af4){return db[_0x8c3d('0x1c')]['find']({'raw':_0x379797[_0x8c3d('0x1e')]?_0x379797[_0x8c3d('0x1e')][_0x8c3d('0x1f')]===undefined?!![]:![]:!![],'where':_0x379797[_0x8c3d('0x1e')]?_0x379797['options'][_0x8c3d('0x20')]||null:null,'attributes':_0x379797[_0x8c3d('0x1e')]?_0x379797[_0x8c3d('0x1e')][_0x8c3d('0x21')]||null:null,'include':_0x379797[_0x8c3d('0x1e')]?_0x379797[_0x8c3d('0x1e')][_0x8c3d('0x23')]?_[_0x8c3d('0x24')](_0x379797[_0x8c3d('0x1e')]['include'],function(_0x350cc3){return{'model':db[_0x350cc3[_0x8c3d('0x25')]],'as':_0x350cc3['as'],'attributes':_0x350cc3[_0x8c3d('0x21')],'include':_0x350cc3[_0x8c3d('0x23')]?_[_0x8c3d('0x24')](_0x350cc3[_0x8c3d('0x23')],function(_0x4c31c7){return{'model':db[_0x4c31c7[_0x8c3d('0x25')]],'as':_0x4c31c7['as'],'attributes':_0x4c31c7['attributes'],'include':_0x4c31c7['include']?_[_0x8c3d('0x24')](_0x4c31c7[_0x8c3d('0x23')],function(_0x33171c){return{'model':db[_0x33171c[_0x8c3d('0x25')]],'as':_0x33171c['as'],'attributes':_0x33171c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x485f21){logger['info'](_0x8c3d('0x27'),_0x379797);logger[_0x8c3d('0x15')](_0x8c3d('0x27'),_0x379797,JSON['stringify'](_0x485f21));_0x5afb29(_0x485f21);})['catch'](function(_0x24560f){logger['error'](_0x8c3d('0x27'),_0x24560f[_0x8c3d('0x1a')],_0x379797);_0x5d0af4(_0x33f712['error'](0x1f4,_0x24560f[_0x8c3d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 72d5917..306ebe7 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 _0xa84e=['./voiceQueue.events','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x487eb0,_0x4ca69c){var _0x360818=function(_0xd6ca1){while(--_0xd6ca1){_0x487eb0['push'](_0x487eb0['shift']());}};_0x360818(++_0x4ca69c);}(_0xa84e,0x16c));var _0xea84=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0xa84e[_0x51bb38];return _0x51c09b;};'use strict';var VoiceQueueEvents=require(_0xea84('0x0'));var events=['save',_0xea84('0x1'),'update'];function createListener(_0x5c07a4,_0x3d205c){return function(_0x2a3415){_0x3d205c[_0xea84('0x2')](_0x5c07a4,_0x2a3415);};}function removeListener(_0x5b0c13,_0x4c35ec){return function(){VoiceQueueEvents[_0xea84('0x3')](_0x5b0c13,_0x4c35ec);};}exports[_0xea84('0x4')]=function(_0x4db101){for(var _0x1604dc=0x0,_0x44f937=events[_0xea84('0x5')];_0x1604dc<_0x44f937;_0x1604dc++){var _0x40885e=events[_0x1604dc];var _0x3731b3=createListener(_0xea84('0x6')+_0x40885e,_0x4db101);VoiceQueueEvents['on'](_0x40885e,_0x3731b3);}}; \ No newline at end of file +var _0xeeac=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeeac,0x146));var _0xceea=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xeeac[_0x3fe6df];return _0x372a0e;};'use strict';var VoiceQueueEvents=require(_0xceea('0x0'));var events=[_0xceea('0x1'),_0xceea('0x2'),_0xceea('0x3')];function createListener(_0x542512,_0x892626){return function(_0x5a3ad7){_0x892626[_0xceea('0x4')](_0x542512,_0x5a3ad7);};}function removeListener(_0x5c061b,_0x514034){return function(){VoiceQueueEvents[_0xceea('0x5')](_0x5c061b,_0x514034);};}exports[_0xceea('0x6')]=function(_0x140882){for(var _0x1eb3c3=0x0,_0x514c4e=events[_0xceea('0x7')];_0x1eb3c3<_0x514c4e;_0x1eb3c3++){var _0x363c82=events[_0x1eb3c3];var _0x4f48d3=createListener(_0xceea('0x8')+_0x363c82,_0x140882);VoiceQueueEvents['on'](_0x363c82,_0x4f48d3);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index fec766d..18310fa 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 _0x5367=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x247dc6,_0x2356a7){var _0x3b0b80=function(_0x1bfaa1){while(--_0x1bfaa1){_0x247dc6['push'](_0x247dc6['shift']());}};_0x3b0b80(++_0x2356a7);}(_0x5367,0x6e));var _0x7536=function(_0x574d7d,_0x3ec17b){_0x574d7d=_0x574d7d-0x0;var _0x2aa234=_0x5367[_0x574d7d];return _0x2aa234;};'use strict';var multer=require(_0x7536('0x0'));var util=require(_0x7536('0x1'));var path=require(_0x7536('0x2'));var timeout=require('connect-timeout');var express=require(_0x7536('0x3'));var router=express[_0x7536('0x4')]();var fs_extra=require(_0x7536('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7536('0x6'));var config=require('../../config/environment');var controller=require(_0x7536('0x7'));router[_0x7536('0x8')]('/',auth[_0x7536('0x9')](),controller[_0x7536('0xa')]);router[_0x7536('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7536('0xb')]);router[_0x7536('0x8')]('/index',auth[_0x7536('0x9')](),controller[_0x7536('0xc')]);router[_0x7536('0x8')](_0x7536('0xd'),auth['isAuthenticated'](),controller[_0x7536('0xe')]);router[_0x7536('0xf')]('/',auth['isAuthenticated'](),controller[_0x7536('0x10')]);router[_0x7536('0x11')](_0x7536('0xd'),auth['isAuthenticated'](),controller[_0x7536('0x12')]);router[_0x7536('0x13')]('/:id',auth[_0x7536('0x9')](),controller[_0x7536('0x14')]);module[_0x7536('0x15')]=router; \ No newline at end of file +var _0x5c90=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete'];(function(_0x317226,_0x44415d){var _0x4dd967=function(_0x3ea2dd){while(--_0x3ea2dd){_0x317226['push'](_0x317226['shift']());}};_0x4dd967(++_0x44415d);}(_0x5c90,0x1ca));var _0x05c9=function(_0x58aaba,_0x23f884){_0x58aaba=_0x58aaba-0x0;var _0x1175bf=_0x5c90[_0x58aaba];return _0x1175bf;};'use strict';var multer=require(_0x05c9('0x0'));var util=require(_0x05c9('0x1'));var path=require(_0x05c9('0x2'));var timeout=require(_0x05c9('0x3'));var express=require(_0x05c9('0x4'));var router=express[_0x05c9('0x5')]();var fs_extra=require(_0x05c9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x05c9('0x7'));var config=require('../../config/environment');var controller=require(_0x05c9('0x8'));router[_0x05c9('0x9')]('/',auth['isAuthenticated'](),controller[_0x05c9('0xa')]);router[_0x05c9('0x9')](_0x05c9('0xb'),auth[_0x05c9('0xc')](),controller[_0x05c9('0xd')]);router[_0x05c9('0x9')](_0x05c9('0xe'),auth[_0x05c9('0xc')](),controller[_0x05c9('0xf')]);router[_0x05c9('0x9')](_0x05c9('0x10'),auth[_0x05c9('0xc')](),controller[_0x05c9('0x11')]);router[_0x05c9('0x12')]('/',auth['isAuthenticated'](),controller[_0x05c9('0x13')]);router['put']('/:id',auth[_0x05c9('0xc')](),controller[_0x05c9('0x14')]);router[_0x05c9('0x15')](_0x05c9('0x10'),auth['isAuthenticated'](),controller[_0x05c9('0x16')]);module[_0x05c9('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index edd0274..2cf7ae1 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 _0x4932=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x376511,_0x4d57f0){var _0x167310=function(_0x31114f){while(--_0x31114f){_0x376511['push'](_0x376511['shift']());}};_0x167310(++_0x4d57f0);}(_0x4932,0x1aa));var _0x2493=function(_0x5e48b4,_0x2e63f5){_0x5e48b4=_0x5e48b4-0x0;var _0x1c2cec=_0x4932[_0x5e48b4];return _0x1c2cec;};'use strict';var Sequelize=require(_0x2493('0x0'));var moment=require(_0x2493('0x1'));module['exports']={'type':{'type':Sequelize[_0x2493('0x2')]},'uniqueid':{'type':Sequelize[_0x2493('0x2')]},'calleridnum':{'type':Sequelize[_0x2493('0x2')]},'calleridname':{'type':Sequelize[_0x2493('0x2')]},'queue':{'type':Sequelize[_0x2493('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x2493('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x340a78){var _0x3b3a60=moment(_0x340a78);var _0xd0a5a2=moment(this[_0x2493('0x4')](_0x2493('0x5')))['format'](_0x2493('0x6'));var _0x4c7974=_0x3b3a60[_0x2493('0x7')](_0xd0a5a2,_0x2493('0x8'));this[_0x2493('0x9')]('queuecallerleaveAt',_0x340a78);this['setDataValue'](_0x2493('0xa'),_0x4c7974||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x2493('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x2493('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2493('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x2493('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2493('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2493('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x2493('0xd')},'originalposition':{'type':Sequelize[_0x2493('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2493('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2493('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x2493('0xb')]},'mohtime':{'type':Sequelize[_0x2493('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2493('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2493('0x2')]},'transfer':{'type':Sequelize[_0x2493('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2493('0x2')],'comment':_0x2493('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2493('0x2')]},'disposition':{'type':Sequelize[_0x2493('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2493('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xae6a=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x526fbf,_0x405787){var _0x1ee737=function(_0x366114){while(--_0x366114){_0x526fbf['push'](_0x526fbf['shift']());}};_0x1ee737(++_0x405787);}(_0xae6a,0x1f3));var _0xaae6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xae6a[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaae6('0x0'));module[_0xaae6('0x1')]={'type':{'type':Sequelize[_0xaae6('0x2')]},'uniqueid':{'type':Sequelize[_0xaae6('0x2')]},'calleridnum':{'type':Sequelize[_0xaae6('0x2')]},'calleridname':{'type':Sequelize[_0xaae6('0x2')]},'queue':{'type':Sequelize[_0xaae6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xaae6('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xaae6('0x3')],'set':function(_0x352975){var _0xbc0588=moment(_0x352975);var _0x3446fd=moment(this[_0xaae6('0x4')](_0xaae6('0x5')))[_0xaae6('0x6')](_0xaae6('0x7'));var _0x5a6f35=_0xbc0588[_0xaae6('0x8')](_0x3446fd,_0xaae6('0x9'));this[_0xaae6('0xa')](_0xaae6('0xb'),_0x352975);this['setDataValue'](_0xaae6('0xc'),_0x5a6f35||null);}},'position':{'type':Sequelize[_0xaae6('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xaae6('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xaae6('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaae6('0x3')]},'queuecallerexit':{'type':Sequelize[_0xaae6('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaae6('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xaae6('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xaae6('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaae6('0x2')]},'connectedlinename':{'type':Sequelize[_0xaae6('0x2')]},'accountcode':{'type':Sequelize[_0xaae6('0x2')]},'context':{'type':Sequelize[_0xaae6('0x2')]},'exten':{'type':Sequelize[_0xaae6('0x2')]},'priority':{'type':Sequelize[_0xaae6('0x2')]},'holdtime':{'type':Sequelize[_0xaae6('0xd')]},'mohtime':{'type':Sequelize[_0xaae6('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xaae6('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaae6('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xaae6('0xf')},'transferexten':{'type':Sequelize[_0xaae6('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaae6('0x2')]},'disposition':{'type':Sequelize[_0xaae6('0x2')]},'secondDisposition':{'type':Sequelize[_0xaae6('0x2')]},'thirdDisposition':{'type':Sequelize[_0xaae6('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 a99e736..d506508 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 _0x936a=['defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','describe','sort','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x42cffa,_0x1e360a){var _0xe98dfd=function(_0xf0caf1){while(--_0xf0caf1){_0x42cffa['push'](_0x42cffa['shift']());}};_0xe98dfd(++_0x1e360a);}(_0x936a,0x1e6));var _0xa936=function(_0x2428da,_0x34fbf2){_0x2428da=_0x2428da-0x0;var _0x3b4d80=_0x936a[_0x2428da];return _0x3b4d80;};'use strict';var emlformat=require(_0xa936('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa936('0x1'));var jsonpatch=require(_0xa936('0x2'));var rp=require(_0xa936('0x3'));var moment=require(_0xa936('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa936('0x5'));var util=require(_0xa936('0x6'));var path=require(_0xa936('0x7'));var sox=require(_0xa936('0x8'));var csv=require(_0xa936('0x9'));var ejs=require(_0xa936('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa936('0xb'));var squel=require(_0xa936('0xc'));var crypto=require(_0xa936('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa936('0x9'));var querystring=require(_0xa936('0xe'));var Papa=require(_0xa936('0xf'));var Redis=require(_0xa936('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa936('0x11'));var as=require(_0xa936('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa936('0x13'))(_0xa936('0x14'));var utils=require('../../config/utils');var config=require(_0xa936('0x15'));var licenseUtil=require(_0xa936('0x16'));var db=require(_0xa936('0x17'))['db'];config['redis']=_[_0xa936('0x18')](config[_0xa936('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa936('0x1a'))(new Redis(config[_0xa936('0x19')]));require(_0xa936('0x1b'))[_0xa936('0x1c')](socket);function respondWithStatusCode(_0x2fcd30,_0x23d864){_0x23d864=_0x23d864||0xcc;return function(_0x3c98e7){if(_0x3c98e7){return _0x2fcd30['sendStatus'](_0x23d864);}return _0x2fcd30[_0xa936('0x1d')](_0x23d864)[_0xa936('0x1e')]();};}function respondWithResult(_0xc719a6,_0x2ad974){_0x2ad974=_0x2ad974||0xc8;return function(_0x4da637){if(_0x4da637){return _0xc719a6[_0xa936('0x1d')](_0x2ad974)[_0xa936('0x1f')](_0x4da637);}};}function respondWithFilteredResult(_0x10f2a1,_0x31c26f){return function(_0x28c1f2){if(_0x28c1f2){var _0x32b19b=typeof _0x31c26f[_0xa936('0x20')]===_0xa936('0x21')&&typeof _0x31c26f[_0xa936('0x22')]===_0xa936('0x21');var _0x28f615=_0x28c1f2[_0xa936('0x23')];var _0xfac4b4=_0x32b19b?0x0:_0x31c26f[_0xa936('0x20')];var _0x24bfb6=_0x32b19b?_0x28c1f2[_0xa936('0x23')]:_0x31c26f[_0xa936('0x20')]+_0x31c26f[_0xa936('0x22')];var _0x4fc6b0;if(_0x24bfb6>=_0x28f615){_0x24bfb6=_0x28f615;_0x4fc6b0=0xc8;}else{_0x4fc6b0=0xce;}_0x10f2a1['status'](_0x4fc6b0);return _0x10f2a1['set'](_0xa936('0x24'),_0xfac4b4+'-'+_0x24bfb6+'/'+_0x28f615)[_0xa936('0x1f')](_0x28c1f2);}return null;};}function patchUpdates(_0x39f686){return function(_0x14b2f9){try{jsonpatch[_0xa936('0x25')](_0x14b2f9,_0x39f686,!![]);}catch(_0x1432de){return BPromise[_0xa936('0x26')](_0x1432de);}return _0x14b2f9[_0xa936('0x27')]();};}function saveUpdates(_0x4a8d84,_0x1d39e3){return function(_0x50937f){if(_0x50937f){return _0x50937f[_0xa936('0x28')](_0x4a8d84)[_0xa936('0x29')](function(_0x153176){return _0x153176;});}return null;};}function removeEntity(_0x1ec5e9,_0x1a2c34){return function(_0x32a050){if(_0x32a050){return _0x32a050['destroy']()[_0xa936('0x29')](function(){_0x1ec5e9['status'](0xcc)[_0xa936('0x1e')]();});}};}function handleEntityNotFound(_0x59a4d0,_0x387d78){return function(_0x44f60d){if(!_0x44f60d){_0x59a4d0[_0xa936('0x2a')](0x194);}return _0x44f60d;};}function handleError(_0x142bd0,_0x3af956){_0x3af956=_0x3af956||0x1f4;return function(_0x466beb){logger[_0xa936('0x2b')](_0x466beb[_0xa936('0x2c')]);if(_0x466beb['name']){delete _0x466beb[_0xa936('0x2d')];}_0x142bd0[_0xa936('0x1d')](_0x3af956)[_0xa936('0x2e')](_0x466beb);};}exports[_0xa936('0x2f')]=function(_0x5df991,_0x4da53d){var _0x3a4e60={},_0x4ad0d1={},_0xe85756={'count':0x0,'rows':[]};var _0x75e8d=_[_0xa936('0x30')](db[_0xa936('0x31')][_0xa936('0x32')],function(_0x58aa3c){return{'name':_0x58aa3c[_0xa936('0x33')],'type':_0x58aa3c[_0xa936('0x34')][_0xa936('0x35')]};});_0x4ad0d1['model']=_[_0xa936('0x30')](_0x75e8d,'name');_0x4ad0d1['query']=_[_0xa936('0x36')](_0x5df991[_0xa936('0x37')]);_0x4ad0d1[_0xa936('0x38')]=_['intersection'](_0x4ad0d1[_0xa936('0x39')],_0x4ad0d1[_0xa936('0x37')]);_0x3a4e60[_0xa936('0x3a')]=_[_0xa936('0x3b')](_0x4ad0d1[_0xa936('0x39')],qs['fields'](_0x5df991[_0xa936('0x37')][_0xa936('0x3c')]));_0x3a4e60[_0xa936('0x3a')]=_0x3a4e60[_0xa936('0x3a')][_0xa936('0x3d')]?_0x3a4e60[_0xa936('0x3a')]:_0x4ad0d1[_0xa936('0x39')];if(!_0x5df991['query'][_0xa936('0x3e')](_0xa936('0x3f'))){_0x3a4e60['limit']=qs['limit'](_0x5df991['query']['limit']);_0x3a4e60[_0xa936('0x20')]=qs[_0xa936('0x20')](_0x5df991['query'][_0xa936('0x20')]);}_0x3a4e60[_0xa936('0x40')]=qs['sort'](_0x5df991[_0xa936('0x37')]['sort']);_0x3a4e60[_0xa936('0x41')]=qs[_0xa936('0x38')](_[_0xa936('0x42')](_0x5df991['query'],_0x4ad0d1[_0xa936('0x38')]),_0x75e8d);if(_0x5df991[_0xa936('0x37')]['filter']){_0x3a4e60['where']=_['merge'](_0x3a4e60[_0xa936('0x41')],{'$or':_[_0xa936('0x30')](_0x75e8d,function(_0x269fe9){if(_0x269fe9[_0xa936('0x34')]!==_0xa936('0x43')){var _0x1f1d99={};_0x1f1d99[_0x269fe9[_0xa936('0x2d')]]={'$like':'%'+_0x5df991[_0xa936('0x37')][_0xa936('0x44')]+'%'};return _0x1f1d99;}})});}_0x3a4e60=_[_0xa936('0x45')]({},_0x3a4e60,_0x5df991[_0xa936('0x46')]);var _0xd4bb33={'where':_0x3a4e60[_0xa936('0x41')]};return db['VoiceQueueReport']['count'](_0xd4bb33)[_0xa936('0x29')](function(_0x4d2e28){_0xe85756[_0xa936('0x23')]=_0x4d2e28;if(_0x5df991[_0xa936('0x37')][_0xa936('0x47')]){_0x3a4e60['include']=[{'all':!![]}];}return db[_0xa936('0x31')][_0xa936('0x48')](_0x3a4e60);})[_0xa936('0x29')](function(_0x40110c){_0xe85756[_0xa936('0x49')]=_0x40110c;return _0xe85756;})[_0xa936('0x29')](respondWithFilteredResult(_0x4da53d,_0x3a4e60))['catch'](handleError(_0x4da53d,null));};exports[_0xa936('0x4a')]=function(_0x4af2a7,_0x298f20){var _0x1b8e74={'raw':![],'where':{'id':_0x4af2a7[_0xa936('0x4b')]['id']}},_0x48e9ef={};_0x48e9ef[_0xa936('0x39')]=_['keys'](db['VoiceQueueReport'][_0xa936('0x32')]);_0x48e9ef[_0xa936('0x37')]=_['keys'](_0x4af2a7[_0xa936('0x37')]);_0x48e9ef[_0xa936('0x38')]=_[_0xa936('0x3b')](_0x48e9ef[_0xa936('0x39')],_0x48e9ef[_0xa936('0x37')]);_0x1b8e74[_0xa936('0x3a')]=_[_0xa936('0x3b')](_0x48e9ef[_0xa936('0x39')],qs[_0xa936('0x3c')](_0x4af2a7[_0xa936('0x37')][_0xa936('0x3c')]));_0x1b8e74[_0xa936('0x3a')]=_0x1b8e74[_0xa936('0x3a')][_0xa936('0x3d')]?_0x1b8e74['attributes']:_0x48e9ef['model'];if(_0x4af2a7[_0xa936('0x37')][_0xa936('0x47')]){_0x1b8e74[_0xa936('0x4c')]=[{'all':!![]}];}_0x1b8e74=_[_0xa936('0x45')]({},_0x1b8e74,_0x4af2a7[_0xa936('0x46')]);return db[_0xa936('0x31')][_0xa936('0x4d')](_0x1b8e74)[_0xa936('0x29')](handleEntityNotFound(_0x298f20,null))[_0xa936('0x29')](respondWithResult(_0x298f20,null))[_0xa936('0x4e')](handleError(_0x298f20,null));};exports[_0xa936('0x4f')]=function(_0x37234b,_0x2402dc){return db[_0xa936('0x31')]['create'](_0x37234b[_0xa936('0x50')],{})[_0xa936('0x29')](respondWithResult(_0x2402dc,0xc9))['catch'](handleError(_0x2402dc,null));};exports[_0xa936('0x28')]=function(_0x169fd2,_0x421d7d){if(_0x169fd2[_0xa936('0x50')]['id']){delete _0x169fd2['body']['id'];}return db[_0xa936('0x31')][_0xa936('0x4d')]({'where':{'id':_0x169fd2['params']['id']}})[_0xa936('0x29')](handleEntityNotFound(_0x421d7d,null))[_0xa936('0x29')](saveUpdates(_0x169fd2[_0xa936('0x50')],null))[_0xa936('0x29')](respondWithResult(_0x421d7d,null))['catch'](handleError(_0x421d7d,null));};exports[_0xa936('0x51')]=function(_0x562545,_0x40f408){return db[_0xa936('0x31')][_0xa936('0x4d')]({'where':{'id':_0x562545['params']['id']}})[_0xa936('0x29')](handleEntityNotFound(_0x40f408,null))[_0xa936('0x29')](removeEntity(_0x40f408,null))[_0xa936('0x4e')](handleError(_0x40f408,null));};exports[_0xa936('0x52')]=function(_0x3496b7,_0x51eb51){return db['VoiceQueueReport'][_0xa936('0x52')]()[_0xa936('0x29')](respondWithResult(_0x51eb51,null))['catch'](handleError(_0x51eb51,null));};exports['getVoiceQueuesReport']=function(_0x1dff37,_0x1bc0bf){var _0xaaad9f={},_0x48b6c3={},_0x15db92={'count':0x0,'rows':[]};_0x48b6c3[_0xa936('0x39')]=_[_0xa936('0x36')](db[_0xa936('0x31')][_0xa936('0x32')]);_0x48b6c3[_0xa936('0x37')]=_[_0xa936('0x36')](_0x1dff37[_0xa936('0x37')]);_0x48b6c3['filters']=_[_0xa936('0x3b')](_0x48b6c3[_0xa936('0x39')],_0x48b6c3[_0xa936('0x37')]);_0xaaad9f['attributes']=_[_0xa936('0x3b')](_0x48b6c3[_0xa936('0x39')],qs[_0xa936('0x3c')](_0x1dff37[_0xa936('0x37')][_0xa936('0x3c')]));_0xaaad9f[_0xa936('0x3a')]=_0xaaad9f[_0xa936('0x3a')]['length']?_0xaaad9f['attributes']:_0x48b6c3[_0xa936('0x39')];if(!_0x1dff37[_0xa936('0x37')][_0xa936('0x3e')](_0xa936('0x3f'))){_0xaaad9f['limit']=qs[_0xa936('0x22')](_0x1dff37[_0xa936('0x37')][_0xa936('0x22')]);_0xaaad9f[_0xa936('0x20')]=qs[_0xa936('0x20')](_0x1dff37[_0xa936('0x37')]['offset']);}_0xaaad9f['order']=qs['sort'](_0x1dff37['query'][_0xa936('0x53')]);_0xaaad9f[_0xa936('0x41')]=qs[_0xa936('0x38')](_[_0xa936('0x42')](_0x1dff37[_0xa936('0x37')],_0x48b6c3[_0xa936('0x38')]));if(_0x1dff37[_0xa936('0x37')]['filter']){_0xaaad9f[_0xa936('0x41')]=_[_0xa936('0x45')](_0xaaad9f[_0xa936('0x41')],{'$or':_[_0xa936('0x30')](_0xaaad9f[_0xa936('0x3a')],function(_0x2b9de0){var _0x29cd60={};_0x29cd60[_0x2b9de0]={'$like':'%'+_0x1dff37[_0xa936('0x37')][_0xa936('0x44')]+'%'};return _0x29cd60;})});}_0xaaad9f=_[_0xa936('0x45')]({},_0xaaad9f,_0x1dff37[_0xa936('0x46')]);var _0x16f2f3={'where':_0xaaad9f[_0xa936('0x41')]};return db[_0xa936('0x31')][_0xa936('0x23')](_0x16f2f3)[_0xa936('0x29')](function(_0x375084){_0x15db92[_0xa936('0x23')]=_0x375084;if(_0x1dff37['query'][_0xa936('0x47')]){_0xaaad9f[_0xa936('0x4c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa936('0x48')](_0xaaad9f);})[_0xa936('0x29')](function(_0x3ef7bf){_0x15db92[_0xa936('0x49')]=_0x3ef7bf;return _0x15db92;})[_0xa936('0x29')](respondWithFilteredResult(_0x1bc0bf,_0xaaad9f,_0xa936('0x54')))[_0xa936('0x4e')](handleError(_0x1bc0bf,null,_0xa936('0x54')));}; \ No newline at end of file +var _0xf135=['../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','key','map','keys','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','findAll','then','rows','catch','show','params','includeAll','options','body','find','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf135,0x87));var _0x5f13=function(_0xc73200,_0x492760){_0xc73200=_0xc73200-0x0;var _0x355aa4=_0xf135[_0xc73200];return _0x355aa4;};'use strict';var emlformat=require(_0x5f13('0x0'));var rimraf=require(_0x5f13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f13('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f13('0x3'));var Mustache=require(_0x5f13('0x4'));var util=require(_0x5f13('0x5'));var path=require('path');var sox=require(_0x5f13('0x6'));var csv=require(_0x5f13('0x7'));var ejs=require(_0x5f13('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5f13('0x9'));var crypto=require('crypto');var jsforce=require(_0x5f13('0xa'));var deskjs=require(_0x5f13('0xb'));var toCsv=require(_0x5f13('0x7'));var querystring=require(_0x5f13('0xc'));var Papa=require('papaparse');var Redis=require(_0x5f13('0xd'));var authService=require(_0x5f13('0xe'));var qs=require(_0x5f13('0xf'));var as=require(_0x5f13('0x10'));var hardwareService=require(_0x5f13('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5f13('0x12'));var config=require(_0x5f13('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f13('0x14'))['db'];config['redis']=_['defaults'](config[_0x5f13('0x15')],{'host':_0x5f13('0x16'),'port':0x18eb});var socket=require(_0x5f13('0x17'))(new Redis(config['redis']));require(_0x5f13('0x18'))[_0x5f13('0x19')](socket);function respondWithStatusCode(_0x9f0a64,_0x23f2f7){_0x23f2f7=_0x23f2f7||0xcc;return function(_0x4ebf9e){if(_0x4ebf9e){return _0x9f0a64[_0x5f13('0x1a')](_0x23f2f7);}return _0x9f0a64[_0x5f13('0x1b')](_0x23f2f7)[_0x5f13('0x1c')]();};}function respondWithResult(_0x2045fe,_0xf9ebb0){_0xf9ebb0=_0xf9ebb0||0xc8;return function(_0x97864f){if(_0x97864f){return _0x2045fe[_0x5f13('0x1b')](_0xf9ebb0)[_0x5f13('0x1d')](_0x97864f);}};}function respondWithFilteredResult(_0x27bc96,_0x307043){return function(_0xb34a8d){if(_0xb34a8d){var _0x3c5266=typeof _0x307043[_0x5f13('0x1e')]==='undefined'&&typeof _0x307043[_0x5f13('0x1f')]==='undefined';var _0xe55d62=_0xb34a8d['count'];var _0x507c1a=_0x3c5266?0x0:_0x307043[_0x5f13('0x1e')];var _0x3ec6c8=_0x3c5266?_0xb34a8d[_0x5f13('0x20')]:_0x307043[_0x5f13('0x1e')]+_0x307043[_0x5f13('0x1f')];var _0x1f4663;if(_0x3ec6c8>=_0xe55d62){_0x3ec6c8=_0xe55d62;_0x1f4663=0xc8;}else{_0x1f4663=0xce;}_0x27bc96[_0x5f13('0x1b')](_0x1f4663);return _0x27bc96['set'](_0x5f13('0x21'),_0x507c1a+'-'+_0x3ec6c8+'/'+_0xe55d62)[_0x5f13('0x1d')](_0xb34a8d);}return null;};}function patchUpdates(_0x3eec38){return function(_0x25a892){try{jsonpatch[_0x5f13('0x22')](_0x25a892,_0x3eec38,!![]);}catch(_0x36349b){return BPromise[_0x5f13('0x23')](_0x36349b);}return _0x25a892['save']();};}function saveUpdates(_0x38d19d,_0x4bd01e){return function(_0x5e78a6){if(_0x5e78a6){return _0x5e78a6[_0x5f13('0x24')](_0x38d19d)['then'](function(_0x598862){return _0x598862;});}return null;};}function removeEntity(_0x53720c,_0x7b2905){return function(_0x4bfa1c){if(_0x4bfa1c){return _0x4bfa1c[_0x5f13('0x25')]()['then'](function(){_0x53720c[_0x5f13('0x1b')](0xcc)[_0x5f13('0x1c')]();});}};}function handleEntityNotFound(_0x330543,_0x1cc45a){return function(_0x469307){if(!_0x469307){_0x330543[_0x5f13('0x1a')](0x194);}return _0x469307;};}function handleError(_0x167504,_0x191530){_0x191530=_0x191530||0x1f4;return function(_0x352c6b){logger['error'](_0x352c6b[_0x5f13('0x26')]);if(_0x352c6b[_0x5f13('0x27')]){delete _0x352c6b[_0x5f13('0x27')];}_0x167504['status'](_0x191530)[_0x5f13('0x28')](_0x352c6b);};}exports[_0x5f13('0x29')]=function(_0x1612bd,_0x40068b){var _0x462bf1={},_0x566544={},_0x51efb4={'count':0x0,'rows':[]};var _0x424ad5=_['map'](db[_0x5f13('0x2a')][_0x5f13('0x2b')],function(_0x4e7d1f){return{'name':_0x4e7d1f[_0x5f13('0x2c')],'type':_0x4e7d1f['type'][_0x5f13('0x2d')]};});_0x566544['model']=_[_0x5f13('0x2e')](_0x424ad5,_0x5f13('0x27'));_0x566544['query']=_[_0x5f13('0x2f')](_0x1612bd['query']);_0x566544['filters']=_[_0x5f13('0x30')](_0x566544[_0x5f13('0x31')],_0x566544[_0x5f13('0x32')]);_0x462bf1[_0x5f13('0x33')]=_[_0x5f13('0x30')](_0x566544['model'],qs['fields'](_0x1612bd[_0x5f13('0x32')][_0x5f13('0x34')]));_0x462bf1[_0x5f13('0x33')]=_0x462bf1[_0x5f13('0x33')][_0x5f13('0x35')]?_0x462bf1[_0x5f13('0x33')]:_0x566544[_0x5f13('0x31')];if(!_0x1612bd[_0x5f13('0x32')]['hasOwnProperty'](_0x5f13('0x36'))){_0x462bf1['limit']=qs['limit'](_0x1612bd[_0x5f13('0x32')][_0x5f13('0x1f')]);_0x462bf1['offset']=qs['offset'](_0x1612bd[_0x5f13('0x32')][_0x5f13('0x1e')]);}_0x462bf1[_0x5f13('0x37')]=qs[_0x5f13('0x38')](_0x1612bd[_0x5f13('0x32')][_0x5f13('0x38')]);_0x462bf1[_0x5f13('0x39')]=qs[_0x5f13('0x3a')](_[_0x5f13('0x3b')](_0x1612bd['query'],_0x566544['filters']),_0x424ad5);if(_0x1612bd[_0x5f13('0x32')][_0x5f13('0x3c')]){_0x462bf1[_0x5f13('0x39')]=_[_0x5f13('0x3d')](_0x462bf1[_0x5f13('0x39')],{'$or':_[_0x5f13('0x2e')](_0x424ad5,function(_0x1df93a){if(_0x1df93a[_0x5f13('0x3e')]!==_0x5f13('0x3f')){var _0x553083={};_0x553083[_0x1df93a[_0x5f13('0x27')]]={'$like':'%'+_0x1612bd[_0x5f13('0x32')][_0x5f13('0x3c')]+'%'};return _0x553083;}})});}_0x462bf1=_[_0x5f13('0x3d')]({},_0x462bf1,_0x1612bd['options']);var _0x292af6={'where':_0x462bf1[_0x5f13('0x39')]};return db['VoiceQueueReport'][_0x5f13('0x20')](_0x292af6)['then'](function(_0x5bbdad){_0x51efb4[_0x5f13('0x20')]=_0x5bbdad;if(_0x1612bd['query']['includeAll']){_0x462bf1[_0x5f13('0x40')]=[{'all':!![]}];}return db[_0x5f13('0x2a')][_0x5f13('0x41')](_0x462bf1);})[_0x5f13('0x42')](function(_0x310f27){_0x51efb4[_0x5f13('0x43')]=_0x310f27;return _0x51efb4;})[_0x5f13('0x42')](respondWithFilteredResult(_0x40068b,_0x462bf1))[_0x5f13('0x44')](handleError(_0x40068b,null));};exports[_0x5f13('0x45')]=function(_0x105a5c,_0x27db5f){var _0x3c69d0={'raw':![],'where':{'id':_0x105a5c[_0x5f13('0x46')]['id']}},_0x1b2c40={};_0x1b2c40[_0x5f13('0x31')]=_[_0x5f13('0x2f')](db[_0x5f13('0x2a')][_0x5f13('0x2b')]);_0x1b2c40[_0x5f13('0x32')]=_[_0x5f13('0x2f')](_0x105a5c[_0x5f13('0x32')]);_0x1b2c40[_0x5f13('0x3a')]=_[_0x5f13('0x30')](_0x1b2c40['model'],_0x1b2c40[_0x5f13('0x32')]);_0x3c69d0['attributes']=_['intersection'](_0x1b2c40[_0x5f13('0x31')],qs[_0x5f13('0x34')](_0x105a5c['query'][_0x5f13('0x34')]));_0x3c69d0['attributes']=_0x3c69d0[_0x5f13('0x33')][_0x5f13('0x35')]?_0x3c69d0[_0x5f13('0x33')]:_0x1b2c40[_0x5f13('0x31')];if(_0x105a5c[_0x5f13('0x32')][_0x5f13('0x47')]){_0x3c69d0[_0x5f13('0x40')]=[{'all':!![]}];}_0x3c69d0=_['merge']({},_0x3c69d0,_0x105a5c[_0x5f13('0x48')]);return db[_0x5f13('0x2a')]['find'](_0x3c69d0)[_0x5f13('0x42')](handleEntityNotFound(_0x27db5f,null))[_0x5f13('0x42')](respondWithResult(_0x27db5f,null))[_0x5f13('0x44')](handleError(_0x27db5f,null));};exports['create']=function(_0x2f8bb5,_0x18f817){return db[_0x5f13('0x2a')]['create'](_0x2f8bb5[_0x5f13('0x49')],{})[_0x5f13('0x42')](respondWithResult(_0x18f817,0xc9))[_0x5f13('0x44')](handleError(_0x18f817,null));};exports[_0x5f13('0x24')]=function(_0x5cc74b,_0x2daf82){if(_0x5cc74b[_0x5f13('0x49')]['id']){delete _0x5cc74b[_0x5f13('0x49')]['id'];}return db['VoiceQueueReport'][_0x5f13('0x4a')]({'where':{'id':_0x5cc74b[_0x5f13('0x46')]['id']}})[_0x5f13('0x42')](handleEntityNotFound(_0x2daf82,null))[_0x5f13('0x42')](saveUpdates(_0x5cc74b['body'],null))[_0x5f13('0x42')](respondWithResult(_0x2daf82,null))[_0x5f13('0x44')](handleError(_0x2daf82,null));};exports[_0x5f13('0x25')]=function(_0x78cfc4,_0x123a2c){return db[_0x5f13('0x2a')]['find']({'where':{'id':_0x78cfc4[_0x5f13('0x46')]['id']}})['then'](handleEntityNotFound(_0x123a2c,null))['then'](removeEntity(_0x123a2c,null))[_0x5f13('0x44')](handleError(_0x123a2c,null));};exports[_0x5f13('0x4b')]=function(_0x3be148,_0x40307f){return db[_0x5f13('0x2a')][_0x5f13('0x4b')]()[_0x5f13('0x42')](respondWithResult(_0x40307f,null))['catch'](handleError(_0x40307f,null));};exports[_0x5f13('0x4c')]=function(_0x1b5de2,_0xf59a2d){var _0x5dfb0d={},_0x3ad592={},_0x49d8f9={'count':0x0,'rows':[]};_0x3ad592[_0x5f13('0x31')]=_[_0x5f13('0x2f')](db['VoiceQueueReport'][_0x5f13('0x2b')]);_0x3ad592['query']=_[_0x5f13('0x2f')](_0x1b5de2[_0x5f13('0x32')]);_0x3ad592['filters']=_[_0x5f13('0x30')](_0x3ad592['model'],_0x3ad592[_0x5f13('0x32')]);_0x5dfb0d[_0x5f13('0x33')]=_[_0x5f13('0x30')](_0x3ad592['model'],qs[_0x5f13('0x34')](_0x1b5de2[_0x5f13('0x32')]['fields']));_0x5dfb0d[_0x5f13('0x33')]=_0x5dfb0d[_0x5f13('0x33')][_0x5f13('0x35')]?_0x5dfb0d[_0x5f13('0x33')]:_0x3ad592[_0x5f13('0x31')];if(!_0x1b5de2[_0x5f13('0x32')]['hasOwnProperty'](_0x5f13('0x36'))){_0x5dfb0d[_0x5f13('0x1f')]=qs['limit'](_0x1b5de2[_0x5f13('0x32')][_0x5f13('0x1f')]);_0x5dfb0d[_0x5f13('0x1e')]=qs[_0x5f13('0x1e')](_0x1b5de2[_0x5f13('0x32')][_0x5f13('0x1e')]);}_0x5dfb0d[_0x5f13('0x37')]=qs[_0x5f13('0x38')](_0x1b5de2[_0x5f13('0x32')][_0x5f13('0x38')]);_0x5dfb0d['where']=qs[_0x5f13('0x3a')](_[_0x5f13('0x3b')](_0x1b5de2[_0x5f13('0x32')],_0x3ad592['filters']));if(_0x1b5de2[_0x5f13('0x32')][_0x5f13('0x3c')]){_0x5dfb0d[_0x5f13('0x39')]=_['merge'](_0x5dfb0d[_0x5f13('0x39')],{'$or':_[_0x5f13('0x2e')](_0x5dfb0d[_0x5f13('0x33')],function(_0x2e3825){var _0x3d540e={};_0x3d540e[_0x2e3825]={'$like':'%'+_0x1b5de2[_0x5f13('0x32')][_0x5f13('0x3c')]+'%'};return _0x3d540e;})});}_0x5dfb0d=_[_0x5f13('0x3d')]({},_0x5dfb0d,_0x1b5de2[_0x5f13('0x48')]);var _0x2d7bdc={'where':_0x5dfb0d['where']};return db[_0x5f13('0x2a')][_0x5f13('0x20')](_0x2d7bdc)[_0x5f13('0x42')](function(_0x403a03){_0x49d8f9[_0x5f13('0x20')]=_0x403a03;if(_0x1b5de2[_0x5f13('0x32')]['includeAll']){_0x5dfb0d[_0x5f13('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5dfb0d);})['then'](function(_0x2ff8d8){_0x49d8f9[_0x5f13('0x43')]=_0x2ff8d8;return _0x49d8f9;})[_0x5f13('0x42')](respondWithFilteredResult(_0xf59a2d,_0x5dfb0d,'getVoiceQueuesReport'))[_0x5f13('0x44')](handleError(_0xf59a2d,null,_0x5f13('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0c26d5f..ffd2507 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 _0x9ccd=['exports','events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hook'];(function(_0x26c358,_0x265af8){var _0x57b00c=function(_0xb5133c){while(--_0xb5133c){_0x26c358['push'](_0x26c358['shift']());}};_0x57b00c(++_0x265af8);}(_0x9ccd,0x1d5));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xd9cc('0x0'));var VoiceQueueReport=require(_0xd9cc('0x1'))['db'][_0xd9cc('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9cc('0x3'),'afterUpdate':_0xd9cc('0x4'),'afterDestroy':_0xd9cc('0x5')};function emitEvent(_0x51089b){return function(_0x1e1d1c,_0x2c3e4c,_0x5d1cd3){VoiceQueueReportEvents[_0xd9cc('0x6')](_0x51089b+':'+_0x1e1d1c['id'],_0x1e1d1c);VoiceQueueReportEvents[_0xd9cc('0x6')](_0x51089b,_0x1e1d1c);_0x5d1cd3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xd9cc('0x7')](e,emitEvent(event));}}module[_0xd9cc('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x2740=['hook','exports','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x2740,0xd2));var _0x0274=function(_0x5b6111,_0x1acf59){_0x5b6111=_0x5b6111-0x0;var _0x373cea=_0x2740[_0x5b6111];return _0x373cea;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x0274('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0274('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0274('0x2'),'afterDestroy':_0x0274('0x3')};function emitEvent(_0x4f83f5){return function(_0x2775d7,_0x891dbd,_0x4b167e){VoiceQueueReportEvents['emit'](_0x4f83f5+':'+_0x2775d7['id'],_0x2775d7);VoiceQueueReportEvents[_0x0274('0x4')](_0x4f83f5,_0x2775d7);_0x4b167e(null);};}for(var e in events){if(events[_0x0274('0x5')](e)){var event=events[e];VoiceQueueReport[_0x0274('0x6')](e,emitEvent(event));}}module[_0x0274('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 19c28ce..7f73993 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 _0xb768=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2ec316,_0x19f5a3){var _0x27378b=function(_0x29e310){while(--_0x29e310){_0x2ec316['push'](_0x2ec316['shift']());}};_0x27378b(++_0x19f5a3);}(_0xb768,0xaf));var _0x8b76=function(_0x5a2d39,_0x218bbc){_0x5a2d39=_0x5a2d39-0x0;var _0x9c44fa=_0xb768[_0x5a2d39];return _0x9c44fa;};'use strict';var _=require(_0x8b76('0x0'));var util=require(_0x8b76('0x1'));var logger=require(_0x8b76('0x2'))(_0x8b76('0x3'));var moment=require(_0x8b76('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b76('0x5'));var fs=require('fs');var path=require(_0x8b76('0x6'));var rimraf=require(_0x8b76('0x7'));var config=require(_0x8b76('0x8'));var attributes=require(_0x8b76('0x9'));module[_0x8b76('0xa')]=function(_0x351176,_0x31a0f8){return _0x351176[_0x8b76('0xb')](_0x8b76('0xc'),attributes,{'tableName':_0x8b76('0xd'),'paranoid':![],'indexes':[{'fields':[_0x8b76('0xe')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x612d=['util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x523c81,_0x4274c8){var _0x2a54dd=function(_0x23d9a1){while(--_0x23d9a1){_0x523c81['push'](_0x523c81['shift']());}};_0x2a54dd(++_0x4274c8);}(_0x612d,0x176));var _0xd612=function(_0x3e690a,_0x31aa0f){_0x3e690a=_0x3e690a-0x0;var _0x435ca0=_0x612d[_0x3e690a];return _0x435ca0;};'use strict';var _=require(_0xd612('0x0'));var util=require(_0xd612('0x1'));var logger=require(_0xd612('0x2'))(_0xd612('0x3'));var moment=require(_0xd612('0x4'));var BPromise=require('bluebird');var rp=require(_0xd612('0x5'));var fs=require('fs');var path=require(_0xd612('0x6'));var rimraf=require(_0xd612('0x7'));var config=require('../../config/environment');var attributes=require(_0xd612('0x8'));module[_0xd612('0x9')]=function(_0x2e498d,_0x36c51d){return _0x2e498d[_0xd612('0xa')](_0xd612('0xb'),attributes,{'tableName':_0xd612('0xc'),'paranoid':![],'indexes':[{'fields':[_0xd612('0xd')]},{'fields':[_0xd612('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c00e380..b69813b 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 _0x4612=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','CreateVoiceQueueReport','raw','update','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x4612,0x1a9));var _0x2461=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4612[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x2461('0x0'));var util=require(_0x2461('0x1'));var moment=require(_0x2461('0x2'));var BPromise=require('bluebird');var rs=require(_0x2461('0x3'));var fs=require('fs');var Redis=require(_0x2461('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2461('0x5'));var logger=require(_0x2461('0x6'))(_0x2461('0x7'));var config=require(_0x2461('0x8'));var jayson=require(_0x2461('0x9'));var client=jayson[_0x2461('0xa')][_0x2461('0xb')]({'port':0x232a});config[_0x2461('0xc')]=_[_0x2461('0xd')](config[_0x2461('0xc')],{'host':_0x2461('0xe'),'port':0x18eb});var socket=require(_0x2461('0xf'))(new Redis(config['redis']));require(_0x2461('0x10'))[_0x2461('0x11')](socket);function respondWithRpcPromise(_0x4aa206,_0xcfc548,_0x57f791){return new BPromise(function(_0x8626f,_0x324f7f){return client[_0x2461('0x12')](_0x4aa206,_0x57f791)[_0x2461('0x13')](function(_0x538aa1){logger[_0x2461('0x14')](_0x2461('0x15'),_0xcfc548,'request\x20sent');logger[_0x2461('0x16')](_0x2461('0x17'),_0xcfc548,'request\x20sent',JSON[_0x2461('0x18')](_0x538aa1));if(_0x538aa1['error']){if(_0x538aa1['error'][_0x2461('0x19')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0xcfc548,_0x538aa1[_0x2461('0x1a')][_0x2461('0x1b')]);return _0x324f7f(_0x538aa1['error'][_0x2461('0x1b')]);}logger['error'](_0x2461('0x15'),_0xcfc548,_0x538aa1[_0x2461('0x1a')][_0x2461('0x1b')]);return _0x8626f(_0x538aa1[_0x2461('0x1a')]['message']);}else{logger['info'](_0x2461('0x15'),_0xcfc548,'request\x20sent');_0x8626f(_0x538aa1['result'][_0x2461('0x1b')]);}})[_0x2461('0x1c')](function(_0x20f09f){logger[_0x2461('0x1a')](_0x2461('0x15'),_0xcfc548,_0x20f09f);_0x324f7f(_0x20f09f);});});}exports[_0x2461('0x1d')]=function(_0x506fbb){var _0x25b288=this;return new Promise(function(_0x3571c5,_0x101332){return db[_0x2461('0x1e')][_0x2461('0x1f')]({'raw':_0x506fbb['options']?_0x506fbb[_0x2461('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x506fbb[_0x2461('0x20')]?_0x506fbb[_0x2461('0x20')]['where']||null:null,'attributes':_0x506fbb[_0x2461('0x20')]?_0x506fbb[_0x2461('0x20')][_0x2461('0x21')]||null:null,'limit':_0x506fbb[_0x2461('0x20')]?_0x506fbb[_0x2461('0x20')][_0x2461('0x22')]||null:null,'include':_0x506fbb[_0x2461('0x20')]?_0x506fbb[_0x2461('0x20')]['include']?_[_0x2461('0x23')](_0x506fbb['options'][_0x2461('0x24')],function(_0x39ef2f){return{'model':db[_0x39ef2f[_0x2461('0x25')]],'as':_0x39ef2f['as'],'attributes':_0x39ef2f[_0x2461('0x21')],'include':_0x39ef2f[_0x2461('0x24')]?_[_0x2461('0x23')](_0x39ef2f['include'],function(_0x49242a){return{'model':db[_0x49242a[_0x2461('0x25')]],'as':_0x49242a['as'],'attributes':_0x49242a[_0x2461('0x21')],'include':_0x49242a[_0x2461('0x24')]?_[_0x2461('0x23')](_0x49242a['include'],function(_0x3571e5){return{'model':db[_0x3571e5[_0x2461('0x25')]],'as':_0x3571e5['as'],'attributes':_0x3571e5[_0x2461('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb3bcbc){logger[_0x2461('0x14')]('GetVoiceQueueReport',_0x506fbb);logger[_0x2461('0x16')](_0x2461('0x1d'),_0x506fbb,JSON['stringify'](_0xb3bcbc));_0x3571c5(_0xb3bcbc);})[_0x2461('0x1c')](function(_0x531138){logger[_0x2461('0x1a')](_0x2461('0x1d'),_0x531138[_0x2461('0x1b')],_0x506fbb);_0x101332(_0x25b288[_0x2461('0x1a')](0x1f4,_0x531138[_0x2461('0x1b')]));});});};exports[_0x2461('0x26')]=function(_0x16e4e1){var _0x27fcd0=this;return new Promise(function(_0x15b306,_0x2d1d19){return db[_0x2461('0x1e')]['create'](_0x16e4e1['body'],{'raw':_0x16e4e1['options']?_0x16e4e1[_0x2461('0x20')][_0x2461('0x27')]===undefined?!![]:![]:!![]})[_0x2461('0x13')](function(_0x202f9a){logger['info']('CreateVoiceQueueReport',_0x16e4e1);logger[_0x2461('0x16')]('CreateVoiceQueueReport',_0x16e4e1,JSON[_0x2461('0x18')](_0x202f9a));_0x15b306(_0x202f9a);})[_0x2461('0x1c')](function(_0x134fbf){logger[_0x2461('0x1a')](_0x2461('0x26'),_0x134fbf[_0x2461('0x1b')],_0x16e4e1);_0x2d1d19(_0x27fcd0['error'](0x1f4,_0x134fbf[_0x2461('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x1d254c){var _0x2e966c=this;return new Promise(function(_0x4b35b1,_0x3b46c6){return db[_0x2461('0x1e')][_0x2461('0x28')](_0x1d254c[_0x2461('0x29')],{'raw':_0x1d254c['options']?_0x1d254c[_0x2461('0x20')][_0x2461('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d254c[_0x2461('0x20')]?_0x1d254c['options']['where']||null:null,'attributes':_0x1d254c[_0x2461('0x20')]?_0x1d254c[_0x2461('0x20')][_0x2461('0x21')]||null:null,'limit':_0x1d254c[_0x2461('0x20')]?_0x1d254c[_0x2461('0x20')][_0x2461('0x22')]||null:null})['then'](function(_0xb7a046){logger[_0x2461('0x14')](_0x2461('0x2a'),_0x1d254c);logger['debug'](_0x2461('0x2a'),_0x1d254c,JSON[_0x2461('0x18')](_0xb7a046));_0x4b35b1(_0xb7a046);})[_0x2461('0x1c')](function(_0x188768){logger[_0x2461('0x1a')](_0x2461('0x2a'),_0x188768['message'],_0x1d254c);_0x3b46c6(_0x2e966c['error'](0x1f4,_0x188768[_0x2461('0x1b')]));});});}; \ No newline at end of file +var _0x8744=['info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','create','debug','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then'];(function(_0x30d719,_0x22729b){var _0x21358e=function(_0x9c8042){while(--_0x9c8042){_0x30d719['push'](_0x30d719['shift']());}};_0x21358e(++_0x22729b);}(_0x8744,0x194));var _0x4874=function(_0x545475,_0x4b03fc){_0x545475=_0x545475-0x0;var _0x35f19c=_0x8744[_0x545475];return _0x35f19c;};'use strict';var _=require(_0x4874('0x0'));var util=require(_0x4874('0x1'));var moment=require('moment');var BPromise=require(_0x4874('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4874('0x3'));var db=require(_0x4874('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4874('0x5'))(_0x4874('0x6'));var config=require('../../config/environment');var jayson=require(_0x4874('0x7'));var client=jayson[_0x4874('0x8')][_0x4874('0x9')]({'port':0x232a});config[_0x4874('0xa')]=_['defaults'](config['redis'],{'host':_0x4874('0xb'),'port':0x18eb});var socket=require(_0x4874('0xc'))(new Redis(config[_0x4874('0xa')]));require(_0x4874('0xd'))['register'](socket);function respondWithRpcPromise(_0x3390fd,_0x3971fc,_0x56c9fd){return new BPromise(function(_0x832b71,_0x1bc516){return client[_0x4874('0xe')](_0x3390fd,_0x56c9fd)[_0x4874('0xf')](function(_0x4dfc22){logger[_0x4874('0x10')](_0x4874('0x11'),_0x3971fc,_0x4874('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3971fc,'request\x20sent',JSON[_0x4874('0x13')](_0x4dfc22));if(_0x4dfc22[_0x4874('0x14')]){if(_0x4dfc22[_0x4874('0x14')][_0x4874('0x15')]===0x1f4){logger[_0x4874('0x14')](_0x4874('0x11'),_0x3971fc,_0x4dfc22[_0x4874('0x14')][_0x4874('0x16')]);return _0x1bc516(_0x4dfc22[_0x4874('0x14')][_0x4874('0x16')]);}logger[_0x4874('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x3971fc,_0x4dfc22[_0x4874('0x14')][_0x4874('0x16')]);return _0x832b71(_0x4dfc22[_0x4874('0x14')][_0x4874('0x16')]);}else{logger[_0x4874('0x10')](_0x4874('0x11'),_0x3971fc,_0x4874('0x12'));_0x832b71(_0x4dfc22[_0x4874('0x17')]['message']);}})['catch'](function(_0x1be454){logger[_0x4874('0x14')](_0x4874('0x11'),_0x3971fc,_0x1be454);_0x1bc516(_0x1be454);});});}exports['GetVoiceQueueReport']=function(_0x150dec){var _0x2133b7=this;return new Promise(function(_0x4aee01,_0x351e29){return db[_0x4874('0x18')][_0x4874('0x19')]({'raw':_0x150dec['options']?_0x150dec['options'][_0x4874('0x1a')]===undefined?!![]:![]:!![],'where':_0x150dec[_0x4874('0x1b')]?_0x150dec['options'][_0x4874('0x1c')]||null:null,'attributes':_0x150dec[_0x4874('0x1b')]?_0x150dec[_0x4874('0x1b')][_0x4874('0x1d')]||null:null,'limit':_0x150dec[_0x4874('0x1b')]?_0x150dec[_0x4874('0x1b')][_0x4874('0x1e')]||null:null,'include':_0x150dec['options']?_0x150dec['options'][_0x4874('0x1f')]?_[_0x4874('0x20')](_0x150dec[_0x4874('0x1b')][_0x4874('0x1f')],function(_0x199a8b){return{'model':db[_0x199a8b[_0x4874('0x21')]],'as':_0x199a8b['as'],'attributes':_0x199a8b[_0x4874('0x1d')],'include':_0x199a8b[_0x4874('0x1f')]?_[_0x4874('0x20')](_0x199a8b[_0x4874('0x1f')],function(_0x4c8dbf){return{'model':db[_0x4c8dbf[_0x4874('0x21')]],'as':_0x4c8dbf['as'],'attributes':_0x4c8dbf[_0x4874('0x1d')],'include':_0x4c8dbf[_0x4874('0x1f')]?_[_0x4874('0x20')](_0x4c8dbf[_0x4874('0x1f')],function(_0x470980){return{'model':db[_0x470980[_0x4874('0x21')]],'as':_0x470980['as'],'attributes':_0x470980[_0x4874('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x537bb8){logger['info']('GetVoiceQueueReport',_0x150dec);logger['debug']('GetVoiceQueueReport',_0x150dec,JSON['stringify'](_0x537bb8));_0x4aee01(_0x537bb8);})['catch'](function(_0x27be56){logger[_0x4874('0x14')](_0x4874('0x22'),_0x27be56[_0x4874('0x16')],_0x150dec);_0x351e29(_0x2133b7[_0x4874('0x14')](0x1f4,_0x27be56[_0x4874('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0xd6db13){var _0x3fc0ed=this;return new Promise(function(_0x52a0b7,_0xc335fa){return db['VoiceQueueReport'][_0x4874('0x23')](_0xd6db13['body'],{'raw':_0xd6db13[_0x4874('0x1b')]?_0xd6db13[_0x4874('0x1b')][_0x4874('0x1a')]===undefined?!![]:![]:!![]})[_0x4874('0xf')](function(_0x5984f1){logger[_0x4874('0x10')]('CreateVoiceQueueReport',_0xd6db13);logger[_0x4874('0x24')](_0x4874('0x25'),_0xd6db13,JSON[_0x4874('0x13')](_0x5984f1));_0x52a0b7(_0x5984f1);})['catch'](function(_0x59c5f3){logger['error'](_0x4874('0x25'),_0x59c5f3[_0x4874('0x16')],_0xd6db13);_0xc335fa(_0x3fc0ed[_0x4874('0x14')](0x1f4,_0x59c5f3[_0x4874('0x16')]));});});};exports[_0x4874('0x26')]=function(_0x632069){var _0x273a48=this;return new Promise(function(_0x373dbc,_0x11ee5f){return db[_0x4874('0x18')][_0x4874('0x27')](_0x632069[_0x4874('0x28')],{'raw':_0x632069['options']?_0x632069[_0x4874('0x1b')][_0x4874('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x632069[_0x4874('0x1b')]?_0x632069[_0x4874('0x1b')][_0x4874('0x1c')]||null:null,'attributes':_0x632069[_0x4874('0x1b')]?_0x632069[_0x4874('0x1b')][_0x4874('0x1d')]||null:null,'limit':_0x632069[_0x4874('0x1b')]?_0x632069[_0x4874('0x1b')][_0x4874('0x1e')]||null:null})[_0x4874('0xf')](function(_0x2b3066){logger['info'](_0x4874('0x26'),_0x632069);logger[_0x4874('0x24')](_0x4874('0x26'),_0x632069,JSON['stringify'](_0x2b3066));_0x373dbc(_0x2b3066);})[_0x4874('0x29')](function(_0x10a03f){logger[_0x4874('0x14')](_0x4874('0x26'),_0x10a03f[_0x4874('0x16')],_0x632069);_0x11ee5f(_0x273a48[_0x4874('0x14')](0x1f4,_0x10a03f[_0x4874('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b3bbad5..a8c451e 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 _0xd493=['./voiceQueueReport.events','remove','update','length','voiceQueueReport:'];(function(_0x1ad901,_0x852d9e){var _0x3c0249=function(_0x319eda){while(--_0x319eda){_0x1ad901['push'](_0x1ad901['shift']());}};_0x3c0249(++_0x852d9e);}(_0xd493,0x1bd));var _0x3d49=function(_0x416320,_0x36fb4f){_0x416320=_0x416320-0x0;var _0xfd38ca=_0xd493[_0x416320];return _0xfd38ca;};'use strict';var VoiceQueueReportEvents=require(_0x3d49('0x0'));var events=['save',_0x3d49('0x1'),_0x3d49('0x2')];function createListener(_0x55cb43,_0x4c751d){return function(_0x4a877d){_0x4c751d['emit'](_0x55cb43,_0x4a877d);};}function removeListener(_0x439989,_0xab52eb){return function(){VoiceQueueReportEvents['removeListener'](_0x439989,_0xab52eb);};}exports['register']=function(_0x1550e0){for(var _0x1316f4=0x0,_0x1ef537=events[_0x3d49('0x3')];_0x1316f4<_0x1ef537;_0x1316f4++){var _0x5d3a0a=events[_0x1316f4];var _0x3d2d14=createListener(_0x3d49('0x4')+_0x5d3a0a,_0x1550e0);VoiceQueueReportEvents['on'](_0x5d3a0a,_0x3d2d14);}}; \ No newline at end of file +var _0x7d33=['./voiceQueueReport.events','remove','update','removeListener','length','voiceQueueReport:'];(function(_0x5bf35e,_0x24dd1b){var _0x533fa1=function(_0x30b4b5){while(--_0x30b4b5){_0x5bf35e['push'](_0x5bf35e['shift']());}};_0x533fa1(++_0x24dd1b);}(_0x7d33,0x162));var _0x37d3=function(_0x532e1f,_0x2c9840){_0x532e1f=_0x532e1f-0x0;var _0x317678=_0x7d33[_0x532e1f];return _0x317678;};'use strict';var VoiceQueueReportEvents=require(_0x37d3('0x0'));var events=['save',_0x37d3('0x1'),_0x37d3('0x2')];function createListener(_0x1020ab,_0xd0a7fd){return function(_0x2ee12b){_0xd0a7fd['emit'](_0x1020ab,_0x2ee12b);};}function removeListener(_0x1eb9d2,_0x3154e1){return function(){VoiceQueueReportEvents[_0x37d3('0x3')](_0x1eb9d2,_0x3154e1);};}exports['register']=function(_0x4a5bba){for(var _0x18ca57=0x0,_0x446563=events[_0x37d3('0x4')];_0x18ca57<_0x446563;_0x18ca57++){var _0x59907c=events[_0x18ca57];var _0x1bdc48=createListener(_0x37d3('0x5')+_0x59907c,_0x4a5bba);VoiceQueueReportEvents['on'](_0x59907c,_0x1bdc48);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index e57b612..98549f8 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 _0x616c=['/:id','post','put','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x58bdca,_0x1204cf){var _0x476770=function(_0x3b18e5){while(--_0x3b18e5){_0x58bdca['push'](_0x58bdca['shift']());}};_0x476770(++_0x1204cf);}(_0x616c,0x1b6));var _0xc616=function(_0x1ebecf,_0x384739){_0x1ebecf=_0x1ebecf-0x0;var _0x522a28=_0x616c[_0x1ebecf];return _0x522a28;};'use strict';var multer=require('multer');var util=require(_0xc616('0x0'));var path=require(_0xc616('0x1'));var timeout=require('connect-timeout');var express=require(_0xc616('0x2'));var router=express[_0xc616('0x3')]();var fs_extra=require(_0xc616('0x4'));var auth=require(_0xc616('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc616('0x6'));router[_0xc616('0x7')]('/',auth[_0xc616('0x8')](),controller[_0xc616('0x9')]);router[_0xc616('0x7')](_0xc616('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc616('0xb')]('/',auth[_0xc616('0x8')](),controller['create']);router[_0xc616('0xc')]('/:id',auth[_0xc616('0x8')](),controller['update']);router['delete'](_0xc616('0xa'),auth[_0xc616('0x8')](),controller[_0xc616('0xd')]);module['exports']=router; \ No newline at end of file +var _0xed95=['Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x11f779,_0x1b1a05){var _0xa5a6a1=function(_0x51f1c4){while(--_0x51f1c4){_0x11f779['push'](_0x11f779['shift']());}};_0xa5a6a1(++_0x1b1a05);}(_0xed95,0x1d0));var _0x5ed9=function(_0x3f81a9,_0x27ffb4){_0x3f81a9=_0x3f81a9-0x0;var _0x27532f=_0xed95[_0x3f81a9];return _0x27532f;};'use strict';var multer=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var path=require(_0x5ed9('0x2'));var timeout=require(_0x5ed9('0x3'));var express=require('express');var router=express[_0x5ed9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ed9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ed9('0x6'));var controller=require(_0x5ed9('0x7'));router[_0x5ed9('0x8')]('/',auth['isAuthenticated'](),controller[_0x5ed9('0x9')]);router[_0x5ed9('0x8')]('/:id',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xb')]);router[_0x5ed9('0xc')]('/',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xd')]);router[_0x5ed9('0xe')]('/:id',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xf')]);router['delete'](_0x5ed9('0x10'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 98e7c44..8ed8467 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 _0x995e=['DATE','format','sequelize','exports','STRING'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x995e,0x1b5));var _0xe995=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x995e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe995('0x0'));var moment=require('moment');module[_0xe995('0x1')]={'time':{'type':Sequelize[_0xe995('0x2')]},'callid':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe995('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe995('0x3')],'allowNull':![],'defaultValue':moment()[_0xe995('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x09da=['exports','STRING','DATE','format','moment'];(function(_0x69fa30,_0x51c3e6){var _0x4b86b1=function(_0x32eb85){while(--_0x32eb85){_0x69fa30['push'](_0x69fa30['shift']());}};_0x4b86b1(++_0x51c3e6);}(_0x09da,0xf4));var _0xa09d=function(_0x30c215,_0x322580){_0x30c215=_0x30c215-0x0;var _0x4becc9=_0x09da[_0x30c215];return _0x4becc9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa09d('0x0'));module[_0xa09d('0x1')]={'time':{'type':Sequelize[_0xa09d('0x2')]},'callid':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa09d('0x3')],'allowNull':![],'defaultValue':moment()[_0xa09d('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1049557..c6419d9 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 _0x1e8d=['fields','length','attributes','order','sort','where','pick','filter','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','end','sendStatus','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','type','key','map','query','filters','intersection','model'];(function(_0xc70602,_0x531f15){var _0x338b62=function(_0x47bec1){while(--_0x47bec1){_0xc70602['push'](_0xc70602['shift']());}};_0x338b62(++_0x531f15);}(_0x1e8d,0xf2));var _0xd1e8=function(_0x4b2231,_0x379f87){_0x4b2231=_0x4b2231-0x0;var _0xb11ccc=_0x1e8d[_0x4b2231];return _0xb11ccc;};'use strict';var emlformat=require(_0xd1e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1e8('0x1'));var jsonpatch=require(_0xd1e8('0x2'));var rp=require(_0xd1e8('0x3'));var moment=require(_0xd1e8('0x4'));var BPromise=require(_0xd1e8('0x5'));var Mustache=require(_0xd1e8('0x6'));var util=require(_0xd1e8('0x7'));var path=require(_0xd1e8('0x8'));var sox=require(_0xd1e8('0x9'));var csv=require('to-csv');var ejs=require(_0xd1e8('0xa'));var fs=require('fs');var fs_extra=require(_0xd1e8('0xb'));var _=require('lodash');var squel=require(_0xd1e8('0xc'));var crypto=require('crypto');var jsforce=require(_0xd1e8('0xd'));var deskjs=require(_0xd1e8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd1e8('0xf'));var Papa=require(_0xd1e8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd1e8('0x11'));var hardwareService=require(_0xd1e8('0x12'));var logger=require(_0xd1e8('0x13'))(_0xd1e8('0x14'));var utils=require('../../config/utils');var config=require(_0xd1e8('0x15'));var licenseUtil=require(_0xd1e8('0x16'));var db=require(_0xd1e8('0x17'))['db'];function respondWithStatusCode(_0x39003d,_0x539453){_0x539453=_0x539453||0xcc;return function(_0x3382fd){if(_0x3382fd){return _0x39003d['sendStatus'](_0x539453);}return _0x39003d[_0xd1e8('0x18')](_0x539453)['end']();};}function respondWithResult(_0x3d4c03,_0x160d59){_0x160d59=_0x160d59||0xc8;return function(_0x4c8a34){if(_0x4c8a34){return _0x3d4c03[_0xd1e8('0x18')](_0x160d59)['json'](_0x4c8a34);}};}function respondWithFilteredResult(_0x299255,_0xad12cc){return function(_0x9f467e){if(_0x9f467e){var _0x5c809e=typeof _0xad12cc[_0xd1e8('0x19')]==='undefined'&&typeof _0xad12cc[_0xd1e8('0x1a')]===_0xd1e8('0x1b');var _0x4209a0=_0x9f467e[_0xd1e8('0x1c')];var _0x386eec=_0x5c809e?0x0:_0xad12cc[_0xd1e8('0x19')];var _0x4e21f6=_0x5c809e?_0x9f467e[_0xd1e8('0x1c')]:_0xad12cc['offset']+_0xad12cc[_0xd1e8('0x1a')];var _0x48fbe5;if(_0x4e21f6>=_0x4209a0){_0x4e21f6=_0x4209a0;_0x48fbe5=0xc8;}else{_0x48fbe5=0xce;}_0x299255[_0xd1e8('0x18')](_0x48fbe5);return _0x299255[_0xd1e8('0x1d')](_0xd1e8('0x1e'),_0x386eec+'-'+_0x4e21f6+'/'+_0x4209a0)[_0xd1e8('0x1f')](_0x9f467e);}return null;};}function patchUpdates(_0x2033d3){return function(_0x6ba6be){try{jsonpatch[_0xd1e8('0x20')](_0x6ba6be,_0x2033d3,!![]);}catch(_0x4abe60){return BPromise[_0xd1e8('0x21')](_0x4abe60);}return _0x6ba6be['save']();};}function saveUpdates(_0x303717,_0x154006){return function(_0x453751){if(_0x453751){return _0x453751['update'](_0x303717)['then'](function(_0x39ebac){return _0x39ebac;});}return null;};}function removeEntity(_0x11b917,_0x2b3a2c){return function(_0x218f3b){if(_0x218f3b){return _0x218f3b['destroy']()['then'](function(){_0x11b917[_0xd1e8('0x18')](0xcc)[_0xd1e8('0x22')]();});}};}function handleEntityNotFound(_0x5b22b6,_0x4d56ba){return function(_0x33deac){if(!_0x33deac){_0x5b22b6[_0xd1e8('0x23')](0x194);}return _0x33deac;};}function handleError(_0x5dd69a,_0x4b8020){_0x4b8020=_0x4b8020||0x1f4;return function(_0x288e41){logger[_0xd1e8('0x24')](_0x288e41[_0xd1e8('0x25')]);if(_0x288e41[_0xd1e8('0x26')]){delete _0x288e41[_0xd1e8('0x26')];}_0x5dd69a[_0xd1e8('0x18')](_0x4b8020)[_0xd1e8('0x27')](_0x288e41);};}exports[_0xd1e8('0x28')]=function(_0x5dd80a,_0xfb8d05){var _0x5a68f1={},_0x4271c1={},_0x5dd468={'count':0x0,'rows':[]};var _0xca23a9=_['map'](db[_0xd1e8('0x29')][_0xd1e8('0x2a')],function(_0x453bca){return{'name':_0x453bca['fieldName'],'type':_0x453bca[_0xd1e8('0x2b')][_0xd1e8('0x2c')]};});_0x4271c1['model']=_[_0xd1e8('0x2d')](_0xca23a9,'name');_0x4271c1[_0xd1e8('0x2e')]=_['keys'](_0x5dd80a[_0xd1e8('0x2e')]);_0x4271c1[_0xd1e8('0x2f')]=_[_0xd1e8('0x30')](_0x4271c1[_0xd1e8('0x31')],_0x4271c1['query']);_0x5a68f1['attributes']=_[_0xd1e8('0x30')](_0x4271c1['model'],qs[_0xd1e8('0x32')](_0x5dd80a[_0xd1e8('0x2e')][_0xd1e8('0x32')]));_0x5a68f1['attributes']=_0x5a68f1['attributes'][_0xd1e8('0x33')]?_0x5a68f1[_0xd1e8('0x34')]:_0x4271c1['model'];if(!_0x5dd80a[_0xd1e8('0x2e')]['hasOwnProperty']('nolimit')){_0x5a68f1[_0xd1e8('0x1a')]=qs[_0xd1e8('0x1a')](_0x5dd80a[_0xd1e8('0x2e')][_0xd1e8('0x1a')]);_0x5a68f1[_0xd1e8('0x19')]=qs[_0xd1e8('0x19')](_0x5dd80a[_0xd1e8('0x2e')][_0xd1e8('0x19')]);}_0x5a68f1[_0xd1e8('0x35')]=qs['sort'](_0x5dd80a['query'][_0xd1e8('0x36')]);_0x5a68f1[_0xd1e8('0x37')]=qs[_0xd1e8('0x2f')](_[_0xd1e8('0x38')](_0x5dd80a[_0xd1e8('0x2e')],_0x4271c1[_0xd1e8('0x2f')]),_0xca23a9);if(_0x5dd80a[_0xd1e8('0x2e')][_0xd1e8('0x39')]){_0x5a68f1[_0xd1e8('0x37')]=_['merge'](_0x5a68f1[_0xd1e8('0x37')],{'$or':_[_0xd1e8('0x2d')](_0xca23a9,function(_0x97e39d){if(_0x97e39d[_0xd1e8('0x2b')]!==_0xd1e8('0x3a')){var _0x16bb51={};_0x16bb51[_0x97e39d[_0xd1e8('0x26')]]={'$like':'%'+_0x5dd80a[_0xd1e8('0x2e')][_0xd1e8('0x39')]+'%'};return _0x16bb51;}})});}_0x5a68f1=_[_0xd1e8('0x3b')]({},_0x5a68f1,_0x5dd80a[_0xd1e8('0x3c')]);var _0x3edaba={'where':_0x5a68f1[_0xd1e8('0x37')]};return db[_0xd1e8('0x29')][_0xd1e8('0x1c')](_0x3edaba)[_0xd1e8('0x3d')](function(_0x24122f){_0x5dd468[_0xd1e8('0x1c')]=_0x24122f;if(_0x5dd80a[_0xd1e8('0x2e')]['includeAll']){_0x5a68f1[_0xd1e8('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xd1e8('0x3f')](_0x5a68f1);})['then'](function(_0xb5ff8c){_0x5dd468[_0xd1e8('0x40')]=_0xb5ff8c;return _0x5dd468;})['then'](respondWithFilteredResult(_0xfb8d05,_0x5a68f1))[_0xd1e8('0x41')](handleError(_0xfb8d05,null));};exports[_0xd1e8('0x42')]=function(_0x40b901,_0x341e26){var _0x483aba={'raw':!![],'where':{'id':_0x40b901[_0xd1e8('0x43')]['id']}},_0x3d2190={};_0x3d2190[_0xd1e8('0x31')]=_[_0xd1e8('0x44')](db[_0xd1e8('0x29')]['rawAttributes']);_0x3d2190[_0xd1e8('0x2e')]=_['keys'](_0x40b901[_0xd1e8('0x2e')]);_0x3d2190[_0xd1e8('0x2f')]=_['intersection'](_0x3d2190[_0xd1e8('0x31')],_0x3d2190[_0xd1e8('0x2e')]);_0x483aba[_0xd1e8('0x34')]=_['intersection'](_0x3d2190['model'],qs[_0xd1e8('0x32')](_0x40b901[_0xd1e8('0x2e')][_0xd1e8('0x32')]));_0x483aba[_0xd1e8('0x34')]=_0x483aba['attributes'][_0xd1e8('0x33')]?_0x483aba[_0xd1e8('0x34')]:_0x3d2190[_0xd1e8('0x31')];if(_0x40b901['query']['includeAll']){_0x483aba[_0xd1e8('0x3e')]=[{'all':!![]}];}_0x483aba=_[_0xd1e8('0x3b')]({},_0x483aba,_0x40b901['options']);return db[_0xd1e8('0x29')][_0xd1e8('0x45')](_0x483aba)[_0xd1e8('0x3d')](handleEntityNotFound(_0x341e26,null))[_0xd1e8('0x3d')](respondWithResult(_0x341e26,null))['catch'](handleError(_0x341e26,null));};exports[_0xd1e8('0x46')]=function(_0x33db9e,_0x4ac51f){return db['VoiceQueuesLog'][_0xd1e8('0x46')](_0x33db9e[_0xd1e8('0x47')],{})[_0xd1e8('0x3d')](respondWithResult(_0x4ac51f,0xc9))[_0xd1e8('0x41')](handleError(_0x4ac51f,null));};exports[_0xd1e8('0x48')]=function(_0x4820b0,_0x4196cc){if(_0x4820b0[_0xd1e8('0x47')]['id']){delete _0x4820b0['body']['id'];}return db[_0xd1e8('0x29')][_0xd1e8('0x45')]({'where':{'id':_0x4820b0[_0xd1e8('0x43')]['id']}})[_0xd1e8('0x3d')](handleEntityNotFound(_0x4196cc,null))[_0xd1e8('0x3d')](saveUpdates(_0x4820b0[_0xd1e8('0x47')],null))[_0xd1e8('0x3d')](respondWithResult(_0x4196cc,null))['catch'](handleError(_0x4196cc,null));};exports['destroy']=function(_0x541d96,_0x27fa65){return db[_0xd1e8('0x29')]['find']({'where':{'id':_0x541d96['params']['id']}})[_0xd1e8('0x3d')](handleEntityNotFound(_0x27fa65,null))[_0xd1e8('0x3d')](removeEntity(_0x27fa65,null))[_0xd1e8('0x41')](handleError(_0x27fa65,null));}; \ No newline at end of file +var _0xabfe=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','options','count','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','eml-format'];(function(_0x170f7e,_0x1f444a){var _0x54aca1=function(_0x3fce86){while(--_0x3fce86){_0x170f7e['push'](_0x170f7e['shift']());}};_0x54aca1(++_0x1f444a);}(_0xabfe,0x1e9));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xeabf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeabf('0x1'));var jsonpatch=require(_0xeabf('0x2'));var rp=require(_0xeabf('0x3'));var moment=require(_0xeabf('0x4'));var BPromise=require(_0xeabf('0x5'));var Mustache=require(_0xeabf('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xeabf('0x7'));var ejs=require(_0xeabf('0x8'));var fs=require('fs');var fs_extra=require(_0xeabf('0x9'));var _=require(_0xeabf('0xa'));var squel=require(_0xeabf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeabf('0xc'));var toCsv=require(_0xeabf('0x7'));var querystring=require(_0xeabf('0xd'));var Papa=require('papaparse');var Redis=require(_0xeabf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xeabf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeabf('0x10'));var logger=require(_0xeabf('0x11'))(_0xeabf('0x12'));var utils=require(_0xeabf('0x13'));var config=require(_0xeabf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xeabf('0x15'))['db'];function respondWithStatusCode(_0x4b06a8,_0x1a45b5){_0x1a45b5=_0x1a45b5||0xcc;return function(_0x1fd0b7){if(_0x1fd0b7){return _0x4b06a8[_0xeabf('0x16')](_0x1a45b5);}return _0x4b06a8['status'](_0x1a45b5)['end']();};}function respondWithResult(_0x2349c4,_0xed0de6){_0xed0de6=_0xed0de6||0xc8;return function(_0x33e429){if(_0x33e429){return _0x2349c4[_0xeabf('0x17')](_0xed0de6)['json'](_0x33e429);}};}function respondWithFilteredResult(_0x2d5c0a,_0x457ea1){return function(_0x527833){if(_0x527833){var _0x5e5da1=typeof _0x457ea1['offset']===_0xeabf('0x18')&&typeof _0x457ea1[_0xeabf('0x19')]===_0xeabf('0x18');var _0xa063e0=_0x527833['count'];var _0x3bc721=_0x5e5da1?0x0:_0x457ea1['offset'];var _0x477e4f=_0x5e5da1?_0x527833['count']:_0x457ea1[_0xeabf('0x1a')]+_0x457ea1[_0xeabf('0x19')];var _0x55c8ca;if(_0x477e4f>=_0xa063e0){_0x477e4f=_0xa063e0;_0x55c8ca=0xc8;}else{_0x55c8ca=0xce;}_0x2d5c0a[_0xeabf('0x17')](_0x55c8ca);return _0x2d5c0a[_0xeabf('0x1b')](_0xeabf('0x1c'),_0x3bc721+'-'+_0x477e4f+'/'+_0xa063e0)[_0xeabf('0x1d')](_0x527833);}return null;};}function patchUpdates(_0x325ed2){return function(_0x4a4013){try{jsonpatch[_0xeabf('0x1e')](_0x4a4013,_0x325ed2,!![]);}catch(_0x534f4e){return BPromise[_0xeabf('0x1f')](_0x534f4e);}return _0x4a4013[_0xeabf('0x20')]();};}function saveUpdates(_0xf71d7a,_0x15e2a6){return function(_0x2d2b2e){if(_0x2d2b2e){return _0x2d2b2e['update'](_0xf71d7a)[_0xeabf('0x21')](function(_0x5a44b9){return _0x5a44b9;});}return null;};}function removeEntity(_0x334cac,_0x62bb38){return function(_0x1c984e){if(_0x1c984e){return _0x1c984e[_0xeabf('0x22')]()[_0xeabf('0x21')](function(){_0x334cac[_0xeabf('0x17')](0xcc)[_0xeabf('0x23')]();});}};}function handleEntityNotFound(_0x3b2c37,_0x28f8d6){return function(_0x4dc9a6){if(!_0x4dc9a6){_0x3b2c37[_0xeabf('0x16')](0x194);}return _0x4dc9a6;};}function handleError(_0x290a7,_0x17a5ac){_0x17a5ac=_0x17a5ac||0x1f4;return function(_0x2c2421){logger[_0xeabf('0x24')](_0x2c2421['stack']);if(_0x2c2421['name']){delete _0x2c2421[_0xeabf('0x25')];}_0x290a7[_0xeabf('0x17')](_0x17a5ac)['send'](_0x2c2421);};}exports[_0xeabf('0x26')]=function(_0x45f182,_0x506521){var _0x4c841a={},_0x1e2a50={},_0x16a322={'count':0x0,'rows':[]};var _0x2616ac=_[_0xeabf('0x27')](db[_0xeabf('0x28')]['rawAttributes'],function(_0x1bf3af){return{'name':_0x1bf3af[_0xeabf('0x29')],'type':_0x1bf3af[_0xeabf('0x2a')][_0xeabf('0x2b')]};});_0x1e2a50[_0xeabf('0x2c')]=_[_0xeabf('0x27')](_0x2616ac,'name');_0x1e2a50[_0xeabf('0x2d')]=_[_0xeabf('0x2e')](_0x45f182[_0xeabf('0x2d')]);_0x1e2a50[_0xeabf('0x2f')]=_[_0xeabf('0x30')](_0x1e2a50['model'],_0x1e2a50['query']);_0x4c841a[_0xeabf('0x31')]=_[_0xeabf('0x30')](_0x1e2a50[_0xeabf('0x2c')],qs[_0xeabf('0x32')](_0x45f182[_0xeabf('0x2d')][_0xeabf('0x32')]));_0x4c841a[_0xeabf('0x31')]=_0x4c841a[_0xeabf('0x31')][_0xeabf('0x33')]?_0x4c841a[_0xeabf('0x31')]:_0x1e2a50['model'];if(!_0x45f182[_0xeabf('0x2d')]['hasOwnProperty'](_0xeabf('0x34'))){_0x4c841a[_0xeabf('0x19')]=qs[_0xeabf('0x19')](_0x45f182[_0xeabf('0x2d')][_0xeabf('0x19')]);_0x4c841a[_0xeabf('0x1a')]=qs[_0xeabf('0x1a')](_0x45f182['query'][_0xeabf('0x1a')]);}_0x4c841a[_0xeabf('0x35')]=qs[_0xeabf('0x36')](_0x45f182[_0xeabf('0x2d')][_0xeabf('0x36')]);_0x4c841a[_0xeabf('0x37')]=qs['filters'](_[_0xeabf('0x38')](_0x45f182[_0xeabf('0x2d')],_0x1e2a50[_0xeabf('0x2f')]),_0x2616ac);if(_0x45f182[_0xeabf('0x2d')]['filter']){_0x4c841a['where']=_['merge'](_0x4c841a[_0xeabf('0x37')],{'$or':_[_0xeabf('0x27')](_0x2616ac,function(_0x5859a8){if(_0x5859a8[_0xeabf('0x2a')]!=='VIRTUAL'){var _0x152038={};_0x152038[_0x5859a8[_0xeabf('0x25')]]={'$like':'%'+_0x45f182[_0xeabf('0x2d')]['filter']+'%'};return _0x152038;}})});}_0x4c841a=_['merge']({},_0x4c841a,_0x45f182[_0xeabf('0x39')]);var _0xa7c925={'where':_0x4c841a['where']};return db['VoiceQueuesLog'][_0xeabf('0x3a')](_0xa7c925)['then'](function(_0x516111){_0x16a322[_0xeabf('0x3a')]=_0x516111;if(_0x45f182[_0xeabf('0x2d')]['includeAll']){_0x4c841a[_0xeabf('0x3b')]=[{'all':!![]}];}return db[_0xeabf('0x28')][_0xeabf('0x3c')](_0x4c841a);})[_0xeabf('0x21')](function(_0x43a88c){_0x16a322[_0xeabf('0x3d')]=_0x43a88c;return _0x16a322;})[_0xeabf('0x21')](respondWithFilteredResult(_0x506521,_0x4c841a))['catch'](handleError(_0x506521,null));};exports[_0xeabf('0x3e')]=function(_0x4c2247,_0x22dec8){var _0x53f4b0={'raw':!![],'where':{'id':_0x4c2247[_0xeabf('0x3f')]['id']}},_0xc1e22c={};_0xc1e22c['model']=_[_0xeabf('0x2e')](db['VoiceQueuesLog']['rawAttributes']);_0xc1e22c[_0xeabf('0x2d')]=_[_0xeabf('0x2e')](_0x4c2247[_0xeabf('0x2d')]);_0xc1e22c['filters']=_[_0xeabf('0x30')](_0xc1e22c[_0xeabf('0x2c')],_0xc1e22c[_0xeabf('0x2d')]);_0x53f4b0[_0xeabf('0x31')]=_[_0xeabf('0x30')](_0xc1e22c[_0xeabf('0x2c')],qs[_0xeabf('0x32')](_0x4c2247[_0xeabf('0x2d')][_0xeabf('0x32')]));_0x53f4b0[_0xeabf('0x31')]=_0x53f4b0['attributes'][_0xeabf('0x33')]?_0x53f4b0[_0xeabf('0x31')]:_0xc1e22c['model'];if(_0x4c2247[_0xeabf('0x2d')][_0xeabf('0x40')]){_0x53f4b0[_0xeabf('0x3b')]=[{'all':!![]}];}_0x53f4b0=_['merge']({},_0x53f4b0,_0x4c2247[_0xeabf('0x39')]);return db[_0xeabf('0x28')][_0xeabf('0x41')](_0x53f4b0)[_0xeabf('0x21')](handleEntityNotFound(_0x22dec8,null))[_0xeabf('0x21')](respondWithResult(_0x22dec8,null))[_0xeabf('0x42')](handleError(_0x22dec8,null));};exports[_0xeabf('0x43')]=function(_0x3ac52d,_0xd38d24){return db[_0xeabf('0x28')][_0xeabf('0x43')](_0x3ac52d[_0xeabf('0x44')],{})['then'](respondWithResult(_0xd38d24,0xc9))[_0xeabf('0x42')](handleError(_0xd38d24,null));};exports[_0xeabf('0x45')]=function(_0x3ab725,_0x56956c){if(_0x3ab725[_0xeabf('0x44')]['id']){delete _0x3ab725[_0xeabf('0x44')]['id'];}return db[_0xeabf('0x28')][_0xeabf('0x41')]({'where':{'id':_0x3ab725[_0xeabf('0x3f')]['id']}})[_0xeabf('0x21')](handleEntityNotFound(_0x56956c,null))[_0xeabf('0x21')](saveUpdates(_0x3ab725['body'],null))['then'](respondWithResult(_0x56956c,null))[_0xeabf('0x42')](handleError(_0x56956c,null));};exports[_0xeabf('0x22')]=function(_0x2e8b91,_0x14480d){return db[_0xeabf('0x28')][_0xeabf('0x41')]({'where':{'id':_0x2e8b91[_0xeabf('0x3f')]['id']}})[_0xeabf('0x21')](handleEntityNotFound(_0x14480d,null))[_0xeabf('0x21')](removeEntity(_0x14480d,null))['catch'](handleError(_0x14480d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5fa8ced..50accc2 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 _0x827d=['VoiceQueuesLog','event_dtm','dtm','lodash','util','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x827d,0xdf));var _0xd827=function(_0x510b12,_0xa08206){_0x510b12=_0x510b12-0x0;var _0x2673e2=_0x827d[_0x510b12];return _0x2673e2;};'use strict';var _=require(_0xd827('0x0'));var util=require(_0xd827('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd827('0x2'));var rp=require(_0xd827('0x3'));var fs=require('fs');var path=require(_0xd827('0x4'));var rimraf=require('rimraf');var config=require(_0xd827('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0xd827('0x6')]=function(_0x357c0b,_0x105998){return _0x357c0b[_0xd827('0x7')](_0xd827('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xd827('0x9'),'fields':['event',_0xd827('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6f0d=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x6fc67a,_0x54d3b8){_0x6fc67a=_0x6fc67a-0x0;var _0x535543=_0x6f0d[_0x6fc67a];return _0x535543;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[{'name':_0xd6f0('0xc'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2563c91..5848ee2 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 _0x1020=['http','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x1020,0x1a4));var _0x0102=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x1020[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0x0102('0x0'));var util=require('util');var moment=require(_0x0102('0x1'));var BPromise=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var fs=require('fs');var Redis=require(_0x0102('0x4'));var db=require(_0x0102('0x5'))['db'];var utils=require(_0x0102('0x6'));var logger=require(_0x0102('0x7'))(_0x0102('0x8'));var config=require(_0x0102('0x9'));var jayson=require(_0x0102('0xa'));var client=jayson[_0x0102('0xb')][_0x0102('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55229f,_0x26804d,_0x1aa60e){return new BPromise(function(_0x43df9f,_0x5ea57e){return client['request'](_0x55229f,_0x1aa60e)[_0x0102('0xd')](function(_0x566659){logger['info'](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));logger[_0x0102('0x10')](_0x0102('0x11'),_0x26804d,_0x0102('0xf'),JSON['stringify'](_0x566659));if(_0x566659[_0x0102('0x12')]){if(_0x566659[_0x0102('0x12')][_0x0102('0x13')]===0x1f4){logger[_0x0102('0x12')](_0x0102('0xe'),_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x5ea57e(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x43df9f(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}else{logger[_0x0102('0x15')](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));_0x43df9f(_0x566659[_0x0102('0x16')][_0x0102('0x14')]);}})[_0x0102('0x17')](function(_0x38fab3){logger['error'](_0x0102('0xe'),_0x26804d,_0x38fab3);_0x5ea57e(_0x38fab3);});});} \ No newline at end of file +var _0xdd32=['rpc','../../config/environment','jayson/promise','http','then','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','VoiceQueuesLog,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x553bf7,_0x4acdaa){var _0x24437f=function(_0x499e83){while(--_0x499e83){_0x553bf7['push'](_0x553bf7['shift']());}};_0x24437f(++_0x4acdaa);}(_0xdd32,0x98));var _0x2dd3=function(_0x4b6537,_0x57e419){_0x4b6537=_0x4b6537-0x0;var _0xb3fb98=_0xdd32[_0x4b6537];return _0xb3fb98;};'use strict';var _=require(_0x2dd3('0x0'));var util=require(_0x2dd3('0x1'));var moment=require(_0x2dd3('0x2'));var BPromise=require(_0x2dd3('0x3'));var rs=require(_0x2dd3('0x4'));var fs=require('fs');var Redis=require(_0x2dd3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2dd3('0x6'));var logger=require(_0x2dd3('0x7'))(_0x2dd3('0x8'));var config=require(_0x2dd3('0x9'));var jayson=require(_0x2dd3('0xa'));var client=jayson['client'][_0x2dd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbb8917,_0x5e8fb1,_0xe2814f){return new BPromise(function(_0x337424,_0x1baebd){return client['request'](_0xbb8917,_0xe2814f)[_0x2dd3('0xc')](function(_0x43f8d0){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x5e8fb1,_0x2dd3('0xd'));logger['debug'](_0x2dd3('0xe'),_0x5e8fb1,_0x2dd3('0xd'),JSON['stringify'](_0x43f8d0));if(_0x43f8d0['error']){if(_0x43f8d0[_0x2dd3('0xf')]['code']===0x1f4){logger[_0x2dd3('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5e8fb1,_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);return _0x1baebd(_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);}logger[_0x2dd3('0xf')](_0x2dd3('0x11'),_0x5e8fb1,_0x43f8d0[_0x2dd3('0xf')][_0x2dd3('0x10')]);return _0x337424(_0x43f8d0['error'][_0x2dd3('0x10')]);}else{logger[_0x2dd3('0x12')](_0x2dd3('0x11'),_0x5e8fb1,_0x2dd3('0xd'));_0x337424(_0x43f8d0[_0x2dd3('0x13')][_0x2dd3('0x10')]);}})['catch'](function(_0x5ad554){logger[_0x2dd3('0xf')](_0x2dd3('0x11'),_0x5e8fb1,_0x5ad554);_0x1baebd(_0x5ad554);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 983254b..eb84f4b 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 _0x1d64=['/:id','isAuthenticated','show','download','/:id/downloads','downloads','downloadTranscribe','post','runTranscribe','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','describe'];(function(_0x3477d0,_0x35a21e){var _0x10e8bd=function(_0x55e669){while(--_0x55e669){_0x3477d0['push'](_0x3477d0['shift']());}};_0x10e8bd(++_0x35a21e);}(_0x1d64,0x14f));var _0x41d6=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x1d64[_0x547add];return _0x2ed1f3;};'use strict';var multer=require(_0x41d6('0x0'));var util=require('util');var path=require(_0x41d6('0x1'));var timeout=require(_0x41d6('0x2'));var express=require('express');var router=express[_0x41d6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x41d6('0x4'));var config=require(_0x41d6('0x5'));var controller=require(_0x41d6('0x6'));router[_0x41d6('0x7')]('/',auth['isAuthenticated'](),controller[_0x41d6('0x8')]);router[_0x41d6('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x41d6('0x9')]);router[_0x41d6('0x7')](_0x41d6('0xa'),auth[_0x41d6('0xb')](),controller[_0x41d6('0xc')]);router['get']('/:id/download',auth[_0x41d6('0xb')](),controller[_0x41d6('0xd')]);router[_0x41d6('0x7')](_0x41d6('0xe'),controller[_0x41d6('0xf')]);router[_0x41d6('0x7')]('/:id/transcribe',auth[_0x41d6('0xb')](),controller[_0x41d6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x41d6('0x11')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x41d6('0x12')]);router[_0x41d6('0x13')]('/:id',auth[_0x41d6('0xb')](),controller[_0x41d6('0x14')]);router[_0x41d6('0x15')]('/:id',auth[_0x41d6('0xb')](),controller['destroy']);module[_0x41d6('0x16')]=router; \ No newline at end of file +var _0x86cc=['/:id','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0x86cc,0x1c6));var _0xc86c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86cc[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xc86c('0x0'));var path=require(_0xc86c('0x1'));var timeout=require(_0xc86c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc86c('0x3'));var auth=require(_0xc86c('0x4'));var interaction=require(_0xc86c('0x5'));var config=require(_0xc86c('0x6'));var controller=require(_0xc86c('0x7'));router[_0xc86c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc86c('0x8')]('/describe',auth[_0xc86c('0x9')](),controller['describe']);router[_0xc86c('0x8')]('/:id',auth[_0xc86c('0x9')](),controller[_0xc86c('0xa')]);router['get'](_0xc86c('0xb'),auth[_0xc86c('0x9')](),controller[_0xc86c('0xc')]);router[_0xc86c('0x8')](_0xc86c('0xd'),controller[_0xc86c('0xe')]);router['get']('/:id/transcribe',auth[_0xc86c('0x9')](),controller[_0xc86c('0xf')]);router[_0xc86c('0x10')]('/',auth[_0xc86c('0x9')](),controller[_0xc86c('0x11')]);router[_0xc86c('0x10')](_0xc86c('0x12'),auth['isAuthenticated'](),controller[_0xc86c('0x13')]);router[_0xc86c('0x14')](_0xc86c('0x15'),auth[_0xc86c('0x9')](),controller['update']);router[_0xc86c('0x16')]('/:id',auth[_0xc86c('0x9')](),controller[_0xc86c('0x17')]);module[_0xc86c('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1064eba..2bcf2ca 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 892fa42..005478d 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 _0x686f=['keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','rawAttributes','intersection','includeAll','find','create','update','body','describe','download','../../components/encryptor','params','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','downloads','sequelize','MD5','col','uniqueid','token','$and','push','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','runSentiment','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','destroy','then','end','error','stack','name','map','VoiceRecording','type','key','model','differenceBy'];(function(_0x1e252f,_0x2e8785){var _0x469682=function(_0x3f0e30){while(--_0x3f0e30){_0x1e252f['push'](_0x1e252f['shift']());}};_0x469682(++_0x2e8785);}(_0x686f,0x19c));var _0xf686=function(_0xe9f055,_0x258b96){_0xe9f055=_0xe9f055-0x0;var _0xea96bf=_0x686f[_0xe9f055];return _0xea96bf;};'use strict';var emlformat=require(_0xf686('0x0'));var rimraf=require(_0xf686('0x1'));var zipdir=require(_0xf686('0x2'));var jsonpatch=require(_0xf686('0x3'));var rp=require(_0xf686('0x4'));var moment=require(_0xf686('0x5'));var BPromise=require(_0xf686('0x6'));var Mustache=require(_0xf686('0x7'));var util=require(_0xf686('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf686('0x9'));var ejs=require(_0xf686('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf686('0xb'));var squel=require(_0xf686('0xc'));var crypto=require(_0xf686('0xd'));var jsforce=require(_0xf686('0xe'));var deskjs=require(_0xf686('0xf'));var toCsv=require(_0xf686('0x9'));var querystring=require(_0xf686('0x10'));var Papa=require(_0xf686('0x11'));var AWS=require(_0xf686('0x12'));var uuidv4=require(_0xf686('0x13'));var Redis=require(_0xf686('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf686('0x15'));var as=require(_0xf686('0x16'));var hardwareService=require(_0xf686('0x17'));var logger=require(_0xf686('0x18'))(_0xf686('0x19'));var utils=require(_0xf686('0x1a'));var config=require(_0xf686('0x1b'));var licenseUtil=require(_0xf686('0x1c'));var db=require(_0xf686('0x1d'))['db'];function respondWithStatusCode(_0xce5d51,_0x2992cc){_0x2992cc=_0x2992cc||0xcc;return function(_0x1f08d9){if(_0x1f08d9){return _0xce5d51[_0xf686('0x1e')](_0x2992cc);}return _0xce5d51['status'](_0x2992cc)['end']();};}function respondWithResult(_0x2d6cf6,_0xd034b7){_0xd034b7=_0xd034b7||0xc8;return function(_0x450fb0){if(_0x450fb0){return _0x2d6cf6[_0xf686('0x1f')](_0xd034b7)['json'](_0x450fb0);}};}function respondWithFilteredResult(_0x52f050,_0x3c2d8c){return function(_0x16d0d1){if(_0x16d0d1){var _0x328c86=typeof _0x3c2d8c[_0xf686('0x20')]===_0xf686('0x21')&&typeof _0x3c2d8c[_0xf686('0x22')]===_0xf686('0x21');var _0x11525c=_0x16d0d1[_0xf686('0x23')];var _0x29e701=_0x328c86?0x0:_0x3c2d8c['offset'];var _0x4a141b=_0x328c86?_0x16d0d1[_0xf686('0x23')]:_0x3c2d8c['offset']+_0x3c2d8c['limit'];var _0x3d05e3;if(_0x4a141b>=_0x11525c){_0x4a141b=_0x11525c;_0x3d05e3=0xc8;}else{_0x3d05e3=0xce;}_0x52f050[_0xf686('0x1f')](_0x3d05e3);return _0x52f050[_0xf686('0x24')](_0xf686('0x25'),_0x29e701+'-'+_0x4a141b+'/'+_0x11525c)[_0xf686('0x26')](_0x16d0d1);}return null;};}function patchUpdates(_0xd0c8f5){return function(_0x52ab4d){try{jsonpatch[_0xf686('0x27')](_0x52ab4d,_0xd0c8f5,!![]);}catch(_0x24f6cf){return BPromise[_0xf686('0x28')](_0x24f6cf);}return _0x52ab4d['save']();};}function saveUpdates(_0x563973,_0x40e7a9){return function(_0x499836){if(_0x499836){return _0x499836['update'](_0x563973)['then'](function(_0x3f35bc){return _0x3f35bc;});}return null;};}function removeEntity(_0x1888e5,_0x2fa82f){return function(_0x458506){if(_0x458506){return _0x458506[_0xf686('0x29')]()[_0xf686('0x2a')](function(){_0x1888e5[_0xf686('0x1f')](0xcc)[_0xf686('0x2b')]();});}};}function handleEntityNotFound(_0x173ac8,_0x421f35){return function(_0x1ec87f){if(!_0x1ec87f){_0x173ac8[_0xf686('0x1e')](0x194);}return _0x1ec87f;};}function handleError(_0x311fb8,_0x32d8e5){_0x32d8e5=_0x32d8e5||0x1f4;return function(_0x93a6fa){logger[_0xf686('0x2c')](_0x93a6fa[_0xf686('0x2d')]);if(_0x93a6fa[_0xf686('0x2e')]){delete _0x93a6fa['name'];}_0x311fb8[_0xf686('0x1f')](_0x32d8e5)['send'](_0x93a6fa);};}exports['index']=function(_0x2abf86,_0x2bf0c4){var _0xccf3e0={},_0x58e1c8={},_0x42389c={'count':0x0,'rows':[]};var _0x2ce16d=_[_0xf686('0x2f')](db[_0xf686('0x30')]['rawAttributes'],function(_0xf1b7c){return{'name':_0xf1b7c['fieldName'],'type':_0xf1b7c[_0xf686('0x31')][_0xf686('0x32')]};});_0x58e1c8[_0xf686('0x33')]=_[_0xf686('0x34')](_['map'](_0x2ce16d,_0xf686('0x2e')),['format']);_0x58e1c8['query']=_[_0xf686('0x35')](_0x2abf86[_0xf686('0x36')]);_0x58e1c8[_0xf686('0x37')]=_['intersection'](_0x58e1c8[_0xf686('0x33')],_0x58e1c8['query']);_0xccf3e0[_0xf686('0x38')]=_['intersection'](_0x58e1c8[_0xf686('0x33')],qs[_0xf686('0x39')](_0x2abf86[_0xf686('0x36')][_0xf686('0x39')]));_0xccf3e0[_0xf686('0x38')]=_0xccf3e0[_0xf686('0x38')][_0xf686('0x3a')]?_0xccf3e0[_0xf686('0x38')]:_0x58e1c8[_0xf686('0x33')];if(!_0x2abf86[_0xf686('0x36')][_0xf686('0x3b')](_0xf686('0x3c'))){_0xccf3e0[_0xf686('0x22')]=qs[_0xf686('0x22')](_0x2abf86[_0xf686('0x36')][_0xf686('0x22')]);_0xccf3e0[_0xf686('0x20')]=qs[_0xf686('0x20')](_0x2abf86[_0xf686('0x36')]['offset']);}_0xccf3e0[_0xf686('0x3d')]=qs[_0xf686('0x3e')](_0x2abf86[_0xf686('0x36')][_0xf686('0x3e')]);_0xccf3e0[_0xf686('0x3f')]=qs[_0xf686('0x37')](_[_0xf686('0x40')](_0x2abf86['query'],_0x58e1c8[_0xf686('0x37')]),_0x2ce16d);if(_0x2abf86[_0xf686('0x36')][_0xf686('0x41')]){_0xccf3e0[_0xf686('0x3f')]=_['merge'](_0xccf3e0['where'],{'$or':_['map'](_0x2ce16d,function(_0x5e40b9){if(_0x5e40b9['type']!==_0xf686('0x42')){var _0x91e44a={};_0x91e44a[_0x5e40b9[_0xf686('0x2e')]]={'$like':'%'+_0x2abf86[_0xf686('0x36')][_0xf686('0x41')]+'%'};return _0x91e44a;}})});}_0xccf3e0=_[_0xf686('0x43')]({},_0xccf3e0,_0x2abf86[_0xf686('0x44')]);var _0x236cbb={'where':_0xccf3e0[_0xf686('0x3f')]};return db['VoiceRecording'][_0xf686('0x23')](_0x236cbb)[_0xf686('0x2a')](function(_0x39e2f9){_0x42389c['count']=_0x39e2f9;if(_0x2abf86[_0xf686('0x36')]['includeAll']){_0xccf3e0[_0xf686('0x45')]=[{'all':!![]}];}return db[_0xf686('0x30')][_0xf686('0x46')](_0xccf3e0);})['then'](function(_0x3c9efc){_0x42389c[_0xf686('0x47')]=_0x3c9efc;return _0x42389c;})[_0xf686('0x2a')](respondWithFilteredResult(_0x2bf0c4,_0xccf3e0))[_0xf686('0x48')](handleError(_0x2bf0c4,null));};exports[_0xf686('0x49')]=function(_0x31c783,_0x34e97a){var _0x45b3f1={'raw':![],'where':{'id':_0x31c783['params']['id']}},_0x4b5a54={};_0x4b5a54['model']=_[_0xf686('0x35')](db[_0xf686('0x30')][_0xf686('0x4a')]);_0x4b5a54['query']=_[_0xf686('0x35')](_0x31c783[_0xf686('0x36')]);_0x4b5a54[_0xf686('0x37')]=_[_0xf686('0x4b')](_0x4b5a54['model'],_0x4b5a54['query']);_0x45b3f1[_0xf686('0x38')]=_[_0xf686('0x4b')](_0x4b5a54[_0xf686('0x33')],qs['fields'](_0x31c783[_0xf686('0x36')]['fields']));_0x45b3f1[_0xf686('0x38')]=_0x45b3f1[_0xf686('0x38')][_0xf686('0x3a')]?_0x45b3f1[_0xf686('0x38')]:_0x4b5a54[_0xf686('0x33')];if(_0x31c783[_0xf686('0x36')][_0xf686('0x4c')]){_0x45b3f1[_0xf686('0x45')]=[{'all':!![]}];}_0x45b3f1=_[_0xf686('0x43')]({},_0x45b3f1,_0x31c783[_0xf686('0x44')]);return db[_0xf686('0x30')][_0xf686('0x4d')](_0x45b3f1)[_0xf686('0x2a')](handleEntityNotFound(_0x34e97a,null))[_0xf686('0x2a')](respondWithResult(_0x34e97a,null))[_0xf686('0x48')](handleError(_0x34e97a,null));};exports[_0xf686('0x4e')]=function(_0x218693,_0x24563f){return db[_0xf686('0x30')][_0xf686('0x4e')](_0x218693['body'],{})[_0xf686('0x2a')](respondWithResult(_0x24563f,0xc9))[_0xf686('0x48')](handleError(_0x24563f,null));};exports[_0xf686('0x4f')]=function(_0x4cb03c,_0x497420){if(_0x4cb03c['body']['id']){delete _0x4cb03c[_0xf686('0x50')]['id'];}return db['VoiceRecording'][_0xf686('0x4d')]({'where':{'id':_0x4cb03c['params']['id']}})[_0xf686('0x2a')](handleEntityNotFound(_0x497420,null))[_0xf686('0x2a')](saveUpdates(_0x4cb03c['body'],null))['then'](respondWithResult(_0x497420,null))['catch'](handleError(_0x497420,null));};exports['describe']=function(_0x1dcf4f,_0x1b87d5){return db[_0xf686('0x30')][_0xf686('0x51')]()[_0xf686('0x2a')](respondWithResult(_0x1b87d5,null))[_0xf686('0x48')](handleError(_0x1b87d5,null));};exports[_0xf686('0x52')]=function(_0x49ae46,_0x3b08be,_0x2215a8){var _0x3ae6f5=require(_0xf686('0x53'));var _0x274d54=![];var _0x36b352={};if(_0x49ae46['query'][_0xf686('0x31')]&&_0x49ae46[_0xf686('0x36')]['type']==='uniqueid'){_0x36b352['uniqueid']=_0x49ae46[_0xf686('0x54')]['id'];}else{_0x36b352['id']=_0x49ae46['params']['id'];}return db['VoiceRecording']['find']({'where':_0x36b352,'attributes':['id',_0xf686('0x55')],'raw':!![]})[_0xf686('0x2a')](handleEntityNotFound(_0x3b08be,null))[_0xf686('0x2a')](function(_0x49a550){if(_0x49a550){var _0x461c33=_0x49a550[_0xf686('0x55')];var _0x1b54a5=util[_0xf686('0x56')](_0xf686('0x57'),_0x461c33);if(fs[_0xf686('0x58')](_0x1b54a5)){_0x274d54=!![];return _0x3ae6f5[_0xf686('0x59')](_0x1b54a5,_0x461c33,config[_0xf686('0x5a')][_0xf686('0x5b')])[_0xf686('0x2a')](function(){return _0x49a550;});}return _0x49a550;}})[_0xf686('0x2a')](function(_0x5c4aec){if(_0x5c4aec){var _0x3bbeeb=_0x5c4aec[_0xf686('0x55')];if(!fs[_0xf686('0x58')](_0x3bbeeb)){throw new db[(_0xf686('0x5c'))][(_0xf686('0x5d'))](_0xf686('0x5e'));}if(_0x5c4aec['filename']){return _0x3b08be[_0xf686('0x52')](_0x3bbeeb,_0x5c4aec[_0xf686('0x5f')]+path[_0xf686('0x60')](_0x3bbeeb),function(){if(_0x274d54){fs[_0xf686('0x61')](_0x3bbeeb);}});}else{return _0x3b08be['download'](_0x3bbeeb,function(_0x3a0c31){if(_0x274d54){fs[_0xf686('0x61')](_0x3bbeeb);}});}}})['catch'](function(_0x19a627){if(_0x19a627[_0xf686('0x62')]===_0xf686('0x5e')){_0x3b08be[_0xf686('0x1f')](0x194)[_0xf686('0x63')]('Not\x20found');}else{return handleError(_0x3b08be,null);}});};exports[_0xf686('0x64')]=function(_0x38f510,_0x1931a2,_0x577602){var _0x126eb8=require(_0xf686('0x53'));var _0x3209b3=![];var _0x240870={'$and':[db[_0xf686('0x65')][_0xf686('0x3f')](db[_0xf686('0x65')]['fn'](_0xf686('0x66'),db[_0xf686('0x65')][_0xf686('0x67')](_0xf686('0x68'))),_0x38f510['query'][_0xf686('0x69')])]};if(_0x38f510[_0xf686('0x36')][_0xf686('0x31')]&&_0x38f510[_0xf686('0x36')][_0xf686('0x31')]===_0xf686('0x68')){_0x240870['$and']['push']({'uniqueid':_0x38f510[_0xf686('0x54')]['id']});}else{_0x240870[_0xf686('0x6a')][_0xf686('0x6b')]({'id':_0x38f510[_0xf686('0x54')]['id']});}return db[_0xf686('0x30')][_0xf686('0x4d')]({'where':_0x240870,'attributes':['id','value'],'raw':!![]})[_0xf686('0x2a')](handleEntityNotFound(_0x1931a2,null))['then'](function(_0x25a7f7){if(_0x25a7f7){var _0x141342=util[_0xf686('0x56')]('%s.cypher',_0x25a7f7['value']);if(fs[_0xf686('0x58')](_0x141342)){_0x3209b3=!![];return _0x126eb8[_0xf686('0x59')](_0x141342,_0x25a7f7[_0xf686('0x55')],config[_0xf686('0x5a')][_0xf686('0x5b')])[_0xf686('0x2a')](function(){return _0x25a7f7;});}return _0x25a7f7;}})[_0xf686('0x2a')](function(_0xa4dc74){if(_0xa4dc74){if(!fs['existsSync'](_0xa4dc74[_0xf686('0x55')])){throw new db['Sequelize'][(_0xf686('0x5d'))](_0xf686('0x5e'));}if(_0xa4dc74[_0xf686('0x5f')]){return _0x1931a2['download'](_0xa4dc74[_0xf686('0x55')],_0xa4dc74[_0xf686('0x5f')]+path['extname'](_0xa4dc74['value']),function(){if(_0x3209b3){fs[_0xf686('0x61')](_0xa4dc74[_0xf686('0x55')]);}});}else{return _0x1931a2[_0xf686('0x52')](_0xa4dc74[_0xf686('0x55')],function(_0x5005c8){if(_0x3209b3){fs[_0xf686('0x61')](_0xa4dc74[_0xf686('0x55')]);}});}}})['catch'](handleError(_0x1931a2,null));};exports[_0xf686('0x29')]=function(_0x5b4f46,_0x5a01e7){return db['VoiceRecording']['find']({'where':{'id':_0x5b4f46[_0xf686('0x54')]['id']}})[_0xf686('0x2a')](function(_0x4b3b88){if(_['isNil'](_0x4b3b88)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4b3b88;})['then'](function(_0x59a2f5){var _0x11f091=_0x59a2f5[_0xf686('0x55')];logger[_0xf686('0x6c')](_0xf686('0x6d'),_0x11f091);if(!_['isNil'](_0x59a2f5[_0xf686('0x55')])&&fs[_0xf686('0x58')](_0x11f091)){logger['info']('File:\x20\x22'+_0x11f091+_0xf686('0x6e'));fs[_0xf686('0x6f')](_0x11f091);}_0x11f091=_0x11f091+'.cypher';if(!_['isNil'](_0x59a2f5['value'])&&fs[_0xf686('0x58')](_0x11f091)){logger[_0xf686('0x6c')](_0xf686('0x70')+_0x11f091+_0xf686('0x6e'));fs[_0xf686('0x6f')](_0x11f091);}return _0x59a2f5;})['then'](function(_0x58c199){if(!_0x58c199)throw new InternalError();return _0x58c199[_0xf686('0x29')]();})[_0xf686('0x2a')](function(){_0x5a01e7[_0xf686('0x1f')](0xcc)['end']();})[_0xf686('0x48')](handleError(_0x5a01e7,null));};function getBucketslist(_0x5d0365,_0x46cac8,_0x17618c){return new Promise(function(_0x2f59e2,_0x518437){var _0x329f2c=new AWS['S3']({'accessKeyId':_0x46cac8,'secretAccessKey':_0x5d0365,'region':_0x17618c});_0x329f2c[_0xf686('0x71')]({},function(_0xfe3edc,_0x4b6a38){if(_0xfe3edc){return _0x518437(_0xfe3edc);}else{return _0x2f59e2(_0x4b6a38);}});});}function createBucket(_0x40ea58,_0x9bcccf,_0x24bbde,_0x3855cf){return new Promise(function(_0x4e555a,_0x26e3ab){var _0x171c8e=new AWS['S3']({'accessKeyId':_0x9bcccf,'secretAccessKey':_0x40ea58,'region':_0x24bbde});_0x171c8e['createBucket']({'Bucket':_0x3855cf},function(_0x1fdd5a,_0x1c1069){if(_0x1fdd5a){return _0x26e3ab(_0x1fdd5a);}else{return _0x4e555a(_0x1c1069);}});});}function uploadFile(_0xb753ae,_0x1d24ac,_0x2bfd03,_0x48bad9,_0x2f13bb,_0x140030){return new Promise(function(_0x2fa0b3,_0x509575){var _0x33193a=new AWS['S3']({'accessKeyId':_0x1d24ac,'secretAccessKey':_0xb753ae,'region':_0x2bfd03});_0x33193a['upload']({'Bucket':_0x48bad9,'Key':_0x2f13bb,'Body':_0x140030},function(_0x133530,_0x154865){if(_0x133530){return _0x509575(_0x133530);}else{return _0x2fa0b3(_0x154865);}});});}function startTranscribe(_0x419e37,_0x1033b3,_0x680de5,_0x8902ac,_0x27cd69,_0x43d628){return new Promise(function(_0x2c62bd,_0x5ef7e4){var _0x2973ac=new AWS['TranscribeService']({'accessKeyId':_0x1033b3,'secretAccessKey':_0x419e37,'region':_0x680de5});_0x2973ac[_0xf686('0x72')]({'TranscriptionJobName':_0x8902ac,'LanguageCode':_0x27cd69,'Media':{'MediaFileUri':_0x43d628}},function(_0x22e4c5,_0x169f7c){if(_0x22e4c5){return _0x5ef7e4(_0x22e4c5);}else{return _0x2c62bd(_0x169f7c);}});});}function transcribe(_0x588e50,_0x5902cc,_0x5ce4f9,_0x4188b3,_0x24f106,_0x482e7b,_0x2d6cb5){return new Promise(function(_0xfdffa7,_0x2e6e34){var _0x890e08={};logger[_0xf686('0x6c')](util['format'](_0xf686('0x73'),_0x588e50,_0x24f106));return uploadFile(_0x5902cc,_0x5ce4f9,_0x4188b3,_0x24f106,path[_0xf686('0x74')](_0x482e7b),fs['readFileSync'](_0x482e7b))[_0xf686('0x2a')](function(_0x264193){logger[_0xf686('0x6c')](util['format'](_0xf686('0x75'),_0x588e50,_0x24f106,_0x264193[_0xf686('0x76')]));_0x890e08[_0xf686('0x77')]=_0x264193[_0xf686('0x78')];_0x890e08[_0xf686('0x79')]=_0x264193['Location'];logger[_0xf686('0x6c')](util[_0xf686('0x56')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x588e50));return startTranscribe(_0x5902cc,_0x5ce4f9,_0x4188b3,uuidv4(),_0x2d6cb5,_0x264193[_0xf686('0x76')]);})[_0xf686('0x2a')](function(_0x4430a4){logger[_0xf686('0x6c')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x588e50,_0x4430a4[_0xf686('0x7a')][_0xf686('0x7b')]));_0x890e08['transcribeName']=_0x4430a4[_0xf686('0x7a')][_0xf686('0x7b')];_0x890e08[_0xf686('0x7c')]=_0x4430a4['TranscriptionJob']['TranscriptionJobStatus'];return _0xfdffa7(_0x890e08);})[_0xf686('0x48')](function(_0x242873){return _0x2e6e34(_0x242873);});});}exports[_0xf686('0x7d')]=function(_0x29bac6,_0x1d54b2,_0x4238f3){var _0x4addf0;var _0x4b9520;var _0x5b93e7;var _0xef5cfe=require(_0xf686('0x53'));return db[_0xf686('0x30')][_0xf686('0x7e')]({'where':{'id':_0x29bac6['params']['id']}})['then'](function(_0x1b4802){if(_0x1b4802){var _0x4bdb38=util[_0xf686('0x56')](_0xf686('0x57'),_0x1b4802['value']);if(fs[_0xf686('0x58')](_0x4bdb38)){cypher=!![];return _0xef5cfe[_0xf686('0x59')](_0x4bdb38,_0x1b4802[_0xf686('0x55')],config[_0xf686('0x5a')]['recording'])[_0xf686('0x2a')](function(){return _0x1b4802;});}return _0x1b4802;}})[_0xf686('0x2a')](function(_0x4cc44f){if(!_0x4cc44f){throw new db['Sequelize'][(_0xf686('0x5d'))](_0xf686('0x7f'));}_0x4b9520=_0x4cc44f;return db[_0xf686('0x80')]['findOne']({'where':{'id':0x1}});})[_0xf686('0x2a')](handleEntityNotFound(_0x1d54b2,null))[_0xf686('0x2a')](function(_0x5d95d8){if(_0x5d95d8){_0x4addf0=_0x5d95d8;if(!_0x4addf0[_0xf686('0x81')]||!_0x4addf0[_0xf686('0x82')]||!_0x4addf0[_0xf686('0x83')]||!_0x4addf0['language']||!_0x4addf0['bucket']){throw new db[(_0xf686('0x5c'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x29bac6[_0xf686('0x50')][_0xf686('0x84')]&&(!_0x4addf0[_0xf686('0x85')]||!_0x4addf0['sentimentAccountId']||!_0x4addf0[_0xf686('0x86')]||!_0x4addf0[_0xf686('0x87')]||!_0x4addf0[_0xf686('0x77')])){throw new db[(_0xf686('0x5c'))]['ValidationError'](_0xf686('0x88'));}return db[_0xf686('0x89')][_0xf686('0x7e')]({'where':{'id':_0x4addf0[_0xf686('0x82')]}});}})[_0xf686('0x2a')](function(_0x5c5a9a){if(!_0x5c5a9a){throw new db[(_0xf686('0x5c'))][(_0xf686('0x5d'))](_0xf686('0x8a'));}if(!_0x5c5a9a[_0xf686('0x8b')]||!_0x5c5a9a['data2']){throw new db[(_0xf686('0x5c'))][(_0xf686('0x5d'))](_0xf686('0x8c'));}_0x5b93e7=_0x5c5a9a;return getBucketslist(_0x5b93e7[_0xf686('0x8b')],_0x5b93e7['data2'],_0x4addf0[_0xf686('0x83')]);})['then'](function(_0xb30ad1){if(_0xb30ad1&&_0xb30ad1[_0xf686('0x8d')]){var _0xbd135d=_[_0xf686('0x4d')](_0xb30ad1[_0xf686('0x8d')],function(_0x19b694){return _0x19b694[_0xf686('0x8e')]===_0x4addf0[_0xf686('0x77')];});if(!_0xbd135d){logger[_0xf686('0x6c')](util[_0xf686('0x56')](_0xf686('0x8f'),_0x29bac6['params']['id'],_0x4addf0[_0xf686('0x77')]));return createBucket(_0x5b93e7['data1'],_0x5b93e7[_0xf686('0x90')],_0x4addf0['transcribeRegion'],_0x4addf0[_0xf686('0x77')]);}logger[_0xf686('0x6c')](util[_0xf686('0x56')](_0xf686('0x91'),_0x29bac6[_0xf686('0x54')]['id'],_0x4addf0['bucket']));return;}})[_0xf686('0x2a')](function(_0x2a89f5){if(_0x4b9520[_0xf686('0x7c')]===_0xf686('0x92')){return transcribe(_0x29bac6[_0xf686('0x54')]['id'],_0x5b93e7['data1'],_0x5b93e7[_0xf686('0x90')],_0x4addf0[_0xf686('0x83')],_0x4addf0[_0xf686('0x77')],_0x4b9520[_0xf686('0x55')],_0x4addf0[_0xf686('0x87')]);}else{logger[_0xf686('0x6c')](util[_0xf686('0x56')](_0xf686('0x93'),_0x29bac6[_0xf686('0x54')]['id']));return{'transcribeStatus':_0xf686('0x94')};}})[_0xf686('0x2a')](function(_0x36ab70){if(_0x36ab70){_0x36ab70[_0xf686('0x95')]=_0x29bac6[_0xf686('0x50')][_0xf686('0x84')];return _0x4b9520['updateAttributes'](_0x36ab70);}})['then'](respondWithResult(_0x1d54b2,null))['catch'](handleError(_0x1d54b2,null));};function writeFile(_0x9977b1,_0x19fc03){return new Promise(function(_0x36de0d,_0x7f0a49){fs['writeFile'](_0x19fc03,_0x9977b1,function(_0x1b62c8,_0x567109){if(_0x1b62c8){return _0x7f0a49(_0x1b62c8);}else{return _0x36de0d(_0x567109);}});});}exports[_0xf686('0x96')]=function(_0x425e94,_0x4a9ae4,_0x25ff28){return db[_0xf686('0x30')][_0xf686('0x7e')]({'where':{'id':_0x425e94['params']['id']}})[_0xf686('0x2a')](handleEntityNotFound(_0x4a9ae4))[_0xf686('0x2a')](function(_0x547b71){if(_0x547b71&&_0x547b71[_0xf686('0x97')]){var _0x22bd4e=_0x547b71[_0xf686('0x97')];var _0x57e916=config[_0xf686('0x98')]+'/server/files/transcribes/transcribe_'+_0x547b71['id']+_0xf686('0x99');if(fs[_0xf686('0x58')](_0x57e916)){return _0x57e916;}return writeFile(_0x22bd4e,_0x57e916)['then'](function(){return _0x57e916;});}else{throw new db['Sequelize'][(_0xf686('0x5d'))](_0xf686('0x9a'));}})['then'](function(_0x43ead4){return _0x4a9ae4[_0xf686('0x52')](_0x43ead4);})[_0xf686('0x48')](handleError(_0x4a9ae4));}; \ No newline at end of file +var _0x6a4b=['/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','squel','to-csv','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','VoiceRecording','rawAttributes','key','differenceBy','map','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','rows','show','includeAll','include','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','params','value','secrets','recording','existsSync','Sequelize','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','$and','push','decryptFile','ValidationError','VoiceRecording\x20not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','fileText'];(function(_0x942af8,_0x199e49){var _0x594904=function(_0x58b651){while(--_0x58b651){_0x942af8['push'](_0x942af8['shift']());}};_0x594904(++_0x199e49);}(_0x6a4b,0x1b8));var _0xb6a4=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x6a4b[_0x19b3f9];return _0x18c3f6;};'use strict';var emlformat=require(_0xb6a4('0x0'));var rimraf=require(_0xb6a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a4('0x2'));var rp=require('request-promise');var moment=require(_0xb6a4('0x3'));var BPromise=require(_0xb6a4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb6a4('0x5'));var sox=require(_0xb6a4('0x6'));var csv=require('to-csv');var ejs=require(_0xb6a4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6a4('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb6a4('0x9'));var querystring=require(_0xb6a4('0xa'));var Papa=require('papaparse');var AWS=require(_0xb6a4('0xb'));var uuidv4=require('uuid/v4');var Redis=require(_0xb6a4('0xc'));var authService=require(_0xb6a4('0xd'));var qs=require(_0xb6a4('0xe'));var as=require(_0xb6a4('0xf'));var hardwareService=require(_0xb6a4('0x10'));var logger=require('../../config/logger')(_0xb6a4('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb6a4('0x12'));var db=require(_0xb6a4('0x13'))['db'];function respondWithStatusCode(_0x4c9815,_0x3a041e){_0x3a041e=_0x3a041e||0xcc;return function(_0x5d22e9){if(_0x5d22e9){return _0x4c9815[_0xb6a4('0x14')](_0x3a041e);}return _0x4c9815[_0xb6a4('0x15')](_0x3a041e)[_0xb6a4('0x16')]();};}function respondWithResult(_0x1c9012,_0x351b28){_0x351b28=_0x351b28||0xc8;return function(_0xb9850c){if(_0xb9850c){return _0x1c9012[_0xb6a4('0x15')](_0x351b28)[_0xb6a4('0x17')](_0xb9850c);}};}function respondWithFilteredResult(_0x2d028a,_0x3700cc){return function(_0x16b9fb){if(_0x16b9fb){var _0x3c5203=typeof _0x3700cc[_0xb6a4('0x18')]==='undefined'&&typeof _0x3700cc[_0xb6a4('0x19')]===_0xb6a4('0x1a');var _0x5ad950=_0x16b9fb[_0xb6a4('0x1b')];var _0x9f6350=_0x3c5203?0x0:_0x3700cc['offset'];var _0x1ebb44=_0x3c5203?_0x16b9fb[_0xb6a4('0x1b')]:_0x3700cc['offset']+_0x3700cc[_0xb6a4('0x19')];var _0x184aaf;if(_0x1ebb44>=_0x5ad950){_0x1ebb44=_0x5ad950;_0x184aaf=0xc8;}else{_0x184aaf=0xce;}_0x2d028a[_0xb6a4('0x15')](_0x184aaf);return _0x2d028a[_0xb6a4('0x1c')](_0xb6a4('0x1d'),_0x9f6350+'-'+_0x1ebb44+'/'+_0x5ad950)[_0xb6a4('0x17')](_0x16b9fb);}return null;};}function patchUpdates(_0x39549d){return function(_0x2269bc){try{jsonpatch[_0xb6a4('0x1e')](_0x2269bc,_0x39549d,!![]);}catch(_0x386cdb){return BPromise[_0xb6a4('0x1f')](_0x386cdb);}return _0x2269bc[_0xb6a4('0x20')]();};}function saveUpdates(_0x53b32f,_0xcd80a6){return function(_0x22c48a){if(_0x22c48a){return _0x22c48a[_0xb6a4('0x21')](_0x53b32f)['then'](function(_0x5be5c5){return _0x5be5c5;});}return null;};}function removeEntity(_0x4a38f8,_0x1dfebc){return function(_0x1e1b17){if(_0x1e1b17){return _0x1e1b17[_0xb6a4('0x22')]()[_0xb6a4('0x23')](function(){_0x4a38f8[_0xb6a4('0x15')](0xcc)[_0xb6a4('0x16')]();});}};}function handleEntityNotFound(_0x364e10,_0x49a461){return function(_0x503b34){if(!_0x503b34){_0x364e10[_0xb6a4('0x14')](0x194);}return _0x503b34;};}function handleError(_0x36cb6b,_0x48d6b0){_0x48d6b0=_0x48d6b0||0x1f4;return function(_0x5e570f){logger['error'](_0x5e570f[_0xb6a4('0x24')]);if(_0x5e570f['name']){delete _0x5e570f[_0xb6a4('0x25')];}_0x36cb6b[_0xb6a4('0x15')](_0x48d6b0)['send'](_0x5e570f);};}exports[_0xb6a4('0x26')]=function(_0x2c2ba3,_0x4b6287){var _0x3d8df5={},_0x5c41af={},_0x9fdb4a={'count':0x0,'rows':[]};var _0x1b8e72=_['map'](db[_0xb6a4('0x27')][_0xb6a4('0x28')],function(_0x10232b){return{'name':_0x10232b['fieldName'],'type':_0x10232b['type'][_0xb6a4('0x29')]};});_0x5c41af['model']=_[_0xb6a4('0x2a')](_[_0xb6a4('0x2b')](_0x1b8e72,_0xb6a4('0x25')),[_0xb6a4('0x2c')]);_0x5c41af[_0xb6a4('0x2d')]=_[_0xb6a4('0x2e')](_0x2c2ba3[_0xb6a4('0x2d')]);_0x5c41af[_0xb6a4('0x2f')]=_[_0xb6a4('0x30')](_0x5c41af[_0xb6a4('0x31')],_0x5c41af[_0xb6a4('0x2d')]);_0x3d8df5[_0xb6a4('0x32')]=_[_0xb6a4('0x30')](_0x5c41af['model'],qs[_0xb6a4('0x33')](_0x2c2ba3[_0xb6a4('0x2d')][_0xb6a4('0x33')]));_0x3d8df5['attributes']=_0x3d8df5['attributes'][_0xb6a4('0x34')]?_0x3d8df5[_0xb6a4('0x32')]:_0x5c41af[_0xb6a4('0x31')];if(!_0x2c2ba3['query'][_0xb6a4('0x35')](_0xb6a4('0x36'))){_0x3d8df5['limit']=qs[_0xb6a4('0x19')](_0x2c2ba3['query'][_0xb6a4('0x19')]);_0x3d8df5[_0xb6a4('0x18')]=qs[_0xb6a4('0x18')](_0x2c2ba3[_0xb6a4('0x2d')]['offset']);}_0x3d8df5[_0xb6a4('0x37')]=qs[_0xb6a4('0x38')](_0x2c2ba3[_0xb6a4('0x2d')][_0xb6a4('0x38')]);_0x3d8df5[_0xb6a4('0x39')]=qs[_0xb6a4('0x2f')](_['pick'](_0x2c2ba3['query'],_0x5c41af[_0xb6a4('0x2f')]),_0x1b8e72);if(_0x2c2ba3[_0xb6a4('0x2d')][_0xb6a4('0x3a')]){_0x3d8df5['where']=_['merge'](_0x3d8df5[_0xb6a4('0x39')],{'$or':_['map'](_0x1b8e72,function(_0x5793de){if(_0x5793de[_0xb6a4('0x3b')]!==_0xb6a4('0x3c')){var _0x463955={};_0x463955[_0x5793de[_0xb6a4('0x25')]]={'$like':'%'+_0x2c2ba3[_0xb6a4('0x2d')][_0xb6a4('0x3a')]+'%'};return _0x463955;}})});}_0x3d8df5=_[_0xb6a4('0x3d')]({},_0x3d8df5,_0x2c2ba3[_0xb6a4('0x3e')]);var _0x576400={'where':_0x3d8df5['where']};return db[_0xb6a4('0x27')][_0xb6a4('0x1b')](_0x576400)[_0xb6a4('0x23')](function(_0x19aa9b){_0x9fdb4a[_0xb6a4('0x1b')]=_0x19aa9b;if(_0x2c2ba3[_0xb6a4('0x2d')]['includeAll']){_0x3d8df5['include']=[{'all':!![]}];}return db[_0xb6a4('0x27')]['findAll'](_0x3d8df5);})[_0xb6a4('0x23')](function(_0x16fa07){_0x9fdb4a[_0xb6a4('0x3f')]=_0x16fa07;return _0x9fdb4a;})[_0xb6a4('0x23')](respondWithFilteredResult(_0x4b6287,_0x3d8df5))['catch'](handleError(_0x4b6287,null));};exports[_0xb6a4('0x40')]=function(_0x541c64,_0x2dd12f){var _0x1e885a={'raw':![],'where':{'id':_0x541c64['params']['id']}},_0x5db0ce={};_0x5db0ce['model']=_[_0xb6a4('0x2e')](db[_0xb6a4('0x27')][_0xb6a4('0x28')]);_0x5db0ce[_0xb6a4('0x2d')]=_['keys'](_0x541c64[_0xb6a4('0x2d')]);_0x5db0ce[_0xb6a4('0x2f')]=_[_0xb6a4('0x30')](_0x5db0ce[_0xb6a4('0x31')],_0x5db0ce['query']);_0x1e885a[_0xb6a4('0x32')]=_[_0xb6a4('0x30')](_0x5db0ce['model'],qs[_0xb6a4('0x33')](_0x541c64['query']['fields']));_0x1e885a[_0xb6a4('0x32')]=_0x1e885a[_0xb6a4('0x32')][_0xb6a4('0x34')]?_0x1e885a[_0xb6a4('0x32')]:_0x5db0ce[_0xb6a4('0x31')];if(_0x541c64[_0xb6a4('0x2d')][_0xb6a4('0x41')]){_0x1e885a[_0xb6a4('0x42')]=[{'all':!![]}];}_0x1e885a=_[_0xb6a4('0x3d')]({},_0x1e885a,_0x541c64['options']);return db[_0xb6a4('0x27')][_0xb6a4('0x43')](_0x1e885a)[_0xb6a4('0x23')](handleEntityNotFound(_0x2dd12f,null))[_0xb6a4('0x23')](respondWithResult(_0x2dd12f,null))[_0xb6a4('0x44')](handleError(_0x2dd12f,null));};exports[_0xb6a4('0x45')]=function(_0x528289,_0x5f0307){return db[_0xb6a4('0x27')][_0xb6a4('0x45')](_0x528289[_0xb6a4('0x46')],{})[_0xb6a4('0x23')](respondWithResult(_0x5f0307,0xc9))['catch'](handleError(_0x5f0307,null));};exports['update']=function(_0xbaf79f,_0x124bd3){if(_0xbaf79f[_0xb6a4('0x46')]['id']){delete _0xbaf79f[_0xb6a4('0x46')]['id'];}return db[_0xb6a4('0x27')][_0xb6a4('0x43')]({'where':{'id':_0xbaf79f['params']['id']}})['then'](handleEntityNotFound(_0x124bd3,null))[_0xb6a4('0x23')](saveUpdates(_0xbaf79f[_0xb6a4('0x46')],null))[_0xb6a4('0x23')](respondWithResult(_0x124bd3,null))[_0xb6a4('0x44')](handleError(_0x124bd3,null));};exports['describe']=function(_0x177d37,_0x3653e4){return db[_0xb6a4('0x27')][_0xb6a4('0x47')]()[_0xb6a4('0x23')](respondWithResult(_0x3653e4,null))[_0xb6a4('0x44')](handleError(_0x3653e4,null));};exports[_0xb6a4('0x48')]=function(_0x3c6087,_0x426d7b,_0x34d628){var _0x1abcfa=require(_0xb6a4('0x49'));var _0x1fe8ab=![];var _0x104b0f={};if(_0x3c6087[_0xb6a4('0x2d')][_0xb6a4('0x3b')]&&_0x3c6087['query']['type']===_0xb6a4('0x4a')){_0x104b0f[_0xb6a4('0x4a')]=_0x3c6087[_0xb6a4('0x4b')]['id'];}else{_0x104b0f['id']=_0x3c6087[_0xb6a4('0x4b')]['id'];}return db[_0xb6a4('0x27')]['find']({'where':_0x104b0f,'attributes':['id',_0xb6a4('0x4c')],'raw':!![]})[_0xb6a4('0x23')](handleEntityNotFound(_0x426d7b,null))['then'](function(_0x210e44){if(_0x210e44){var _0xd8ee28=_0x210e44[_0xb6a4('0x4c')];var _0x19365c=util[_0xb6a4('0x2c')]('%s.cypher',_0xd8ee28);if(fs['existsSync'](_0x19365c)){_0x1fe8ab=!![];return _0x1abcfa['decryptFile'](_0x19365c,_0xd8ee28,config[_0xb6a4('0x4d')][_0xb6a4('0x4e')])[_0xb6a4('0x23')](function(){return _0x210e44;});}return _0x210e44;}})[_0xb6a4('0x23')](function(_0x55e9e7){if(_0x55e9e7){var _0x4f29f7=_0x55e9e7['value'];if(!fs[_0xb6a4('0x4f')](_0x4f29f7)){throw new db[(_0xb6a4('0x50'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x55e9e7[_0xb6a4('0x51')]){return _0x426d7b[_0xb6a4('0x48')](_0x4f29f7,_0x55e9e7[_0xb6a4('0x51')]+path[_0xb6a4('0x52')](_0x4f29f7),function(){if(_0x1fe8ab){fs[_0xb6a4('0x53')](_0x4f29f7);}});}else{return _0x426d7b['download'](_0x4f29f7,function(_0x4f2f43){if(_0x1fe8ab){fs[_0xb6a4('0x53')](_0x4f29f7);}});}}})[_0xb6a4('0x44')](function(_0x1655ae){if(_0x1655ae[_0xb6a4('0x54')]==='VoiceRecording\x20not\x20found'){_0x426d7b[_0xb6a4('0x15')](0x194)[_0xb6a4('0x55')](_0xb6a4('0x56'));}else{return handleError(_0x426d7b,null);}});};exports[_0xb6a4('0x57')]=function(_0x35fcf3,_0x163499,_0x181f45){var _0x42bc09=require(_0xb6a4('0x49'));var _0x5380bf=![];var _0x1d5abf={'$and':[db[_0xb6a4('0x58')]['where'](db[_0xb6a4('0x58')]['fn']('MD5',db[_0xb6a4('0x58')]['col'](_0xb6a4('0x4a'))),_0x35fcf3[_0xb6a4('0x2d')]['token'])]};if(_0x35fcf3[_0xb6a4('0x2d')][_0xb6a4('0x3b')]&&_0x35fcf3['query'][_0xb6a4('0x3b')]===_0xb6a4('0x4a')){_0x1d5abf[_0xb6a4('0x59')][_0xb6a4('0x5a')]({'uniqueid':_0x35fcf3[_0xb6a4('0x4b')]['id']});}else{_0x1d5abf[_0xb6a4('0x59')][_0xb6a4('0x5a')]({'id':_0x35fcf3[_0xb6a4('0x4b')]['id']});}return db[_0xb6a4('0x27')][_0xb6a4('0x43')]({'where':_0x1d5abf,'attributes':['id',_0xb6a4('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x163499,null))[_0xb6a4('0x23')](function(_0x2f8c6e){if(_0x2f8c6e){var _0x29ed86=util['format']('%s.cypher',_0x2f8c6e['value']);if(fs[_0xb6a4('0x4f')](_0x29ed86)){_0x5380bf=!![];return _0x42bc09[_0xb6a4('0x5b')](_0x29ed86,_0x2f8c6e['value'],config[_0xb6a4('0x4d')][_0xb6a4('0x4e')])[_0xb6a4('0x23')](function(){return _0x2f8c6e;});}return _0x2f8c6e;}})[_0xb6a4('0x23')](function(_0x5e5aaf){if(_0x5e5aaf){if(!fs[_0xb6a4('0x4f')](_0x5e5aaf[_0xb6a4('0x4c')])){throw new db['Sequelize'][(_0xb6a4('0x5c'))](_0xb6a4('0x5d'));}if(_0x5e5aaf['filename']){return _0x163499[_0xb6a4('0x48')](_0x5e5aaf[_0xb6a4('0x4c')],_0x5e5aaf[_0xb6a4('0x51')]+path[_0xb6a4('0x52')](_0x5e5aaf[_0xb6a4('0x4c')]),function(){if(_0x5380bf){fs[_0xb6a4('0x53')](_0x5e5aaf[_0xb6a4('0x4c')]);}});}else{return _0x163499['download'](_0x5e5aaf[_0xb6a4('0x4c')],function(_0x12b1e4){if(_0x5380bf){fs[_0xb6a4('0x53')](_0x5e5aaf[_0xb6a4('0x4c')]);}});}}})[_0xb6a4('0x44')](handleError(_0x163499,null));};exports[_0xb6a4('0x22')]=function(_0x501068,_0x48faa9){return db[_0xb6a4('0x27')][_0xb6a4('0x43')]({'where':{'id':_0x501068[_0xb6a4('0x4b')]['id']}})[_0xb6a4('0x23')](function(_0x5988e7){if(_[_0xb6a4('0x5e')](_0x5988e7)){throw new ReferenceError(_0xb6a4('0x5f'));}return _0x5988e7;})[_0xb6a4('0x23')](function(_0x28df48){var _0x365afe=_0x28df48['value'];logger[_0xb6a4('0x60')](_0xb6a4('0x61'),_0x365afe);if(!_['isNil'](_0x28df48['value'])&&fs['existsSync'](_0x365afe)){logger['info'](_0xb6a4('0x62')+_0x365afe+_0xb6a4('0x63'));fs[_0xb6a4('0x64')](_0x365afe);}_0x365afe=_0x365afe+'.cypher';if(!_[_0xb6a4('0x5e')](_0x28df48['value'])&&fs[_0xb6a4('0x4f')](_0x365afe)){logger[_0xb6a4('0x60')](_0xb6a4('0x62')+_0x365afe+_0xb6a4('0x63'));fs['unlinkSync'](_0x365afe);}return _0x28df48;})[_0xb6a4('0x23')](function(_0x478376){if(!_0x478376)throw new InternalError();return _0x478376[_0xb6a4('0x22')]();})['then'](function(){_0x48faa9[_0xb6a4('0x15')](0xcc)[_0xb6a4('0x16')]();})[_0xb6a4('0x44')](handleError(_0x48faa9,null));};function getBucketslist(_0x47a61e,_0x597b62,_0x168586){return new Promise(function(_0x53aa1d,_0x425763){var _0x24397c=new AWS['S3']({'accessKeyId':_0x597b62,'secretAccessKey':_0x47a61e,'region':_0x168586});_0x24397c[_0xb6a4('0x65')]({},function(_0x581a8d,_0xe11e29){if(_0x581a8d){return _0x425763(_0x581a8d);}else{return _0x53aa1d(_0xe11e29);}});});}function createBucket(_0x13479f,_0x1a7b49,_0xaca414,_0x3dc57d){return new Promise(function(_0x1f4f3a,_0x1ae118){var _0x1759c1=new AWS['S3']({'accessKeyId':_0x1a7b49,'secretAccessKey':_0x13479f,'region':_0xaca414});_0x1759c1[_0xb6a4('0x66')]({'Bucket':_0x3dc57d},function(_0x19ebc9,_0x44c259){if(_0x19ebc9){return _0x1ae118(_0x19ebc9);}else{return _0x1f4f3a(_0x44c259);}});});}function uploadFile(_0x2e1f76,_0x2c91b6,_0x2c074e,_0x1d12ba,_0x16c8db,_0xae9fef){return new Promise(function(_0x43acbe,_0x5e6649){var _0x24a181=new AWS['S3']({'accessKeyId':_0x2c91b6,'secretAccessKey':_0x2e1f76,'region':_0x2c074e});_0x24a181[_0xb6a4('0x67')]({'Bucket':_0x1d12ba,'Key':_0x16c8db,'Body':_0xae9fef},function(_0x4a8f06,_0x448684){if(_0x4a8f06){return _0x5e6649(_0x4a8f06);}else{return _0x43acbe(_0x448684);}});});}function startTranscribe(_0x13d038,_0x43486d,_0x2dd6bc,_0x83a5a7,_0x44ff40,_0x41fd26){return new Promise(function(_0xf03221,_0x4f1503){var _0x207b00=new AWS[(_0xb6a4('0x68'))]({'accessKeyId':_0x43486d,'secretAccessKey':_0x13d038,'region':_0x2dd6bc});_0x207b00[_0xb6a4('0x69')]({'TranscriptionJobName':_0x83a5a7,'LanguageCode':_0x44ff40,'Media':{'MediaFileUri':_0x41fd26}},function(_0x4a5713,_0x286b2c){if(_0x4a5713){return _0x4f1503(_0x4a5713);}else{return _0xf03221(_0x286b2c);}});});}function transcribe(_0xe107b,_0x28e522,_0x3351a9,_0x178273,_0x3e6a1d,_0x5cc979,_0x1e851d){return new Promise(function(_0x3c3b22,_0x358cad){var _0x645bec={};logger[_0xb6a4('0x60')](util[_0xb6a4('0x2c')](_0xb6a4('0x6a'),_0xe107b,_0x3e6a1d));return uploadFile(_0x28e522,_0x3351a9,_0x178273,_0x3e6a1d,path[_0xb6a4('0x6b')](_0x5cc979),fs[_0xb6a4('0x6c')](_0x5cc979))[_0xb6a4('0x23')](function(_0x423720){logger[_0xb6a4('0x60')](util[_0xb6a4('0x2c')](_0xb6a4('0x6d'),_0xe107b,_0x3e6a1d,_0x423720[_0xb6a4('0x6e')]));_0x645bec[_0xb6a4('0x6f')]=_0x423720[_0xb6a4('0x70')];_0x645bec['location']=_0x423720['Location'];logger[_0xb6a4('0x60')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xe107b));return startTranscribe(_0x28e522,_0x3351a9,_0x178273,uuidv4(),_0x1e851d,_0x423720['Location']);})[_0xb6a4('0x23')](function(_0xadeacc){logger[_0xb6a4('0x60')](util[_0xb6a4('0x2c')](_0xb6a4('0x71'),_0xe107b,_0xadeacc[_0xb6a4('0x72')]['TranscriptionJobName']));_0x645bec[_0xb6a4('0x73')]=_0xadeacc['TranscriptionJob'][_0xb6a4('0x74')];_0x645bec[_0xb6a4('0x75')]=_0xadeacc[_0xb6a4('0x72')][_0xb6a4('0x76')];return _0x3c3b22(_0x645bec);})[_0xb6a4('0x44')](function(_0x4b2ab7){return _0x358cad(_0x4b2ab7);});});}exports['runTranscribe']=function(_0xd111f1,_0x28d3a7,_0x3a064d){var _0xfd4a09;var _0x11bbe5;var _0x5316b0;var _0x55d13e=require(_0xb6a4('0x49'));return db[_0xb6a4('0x27')][_0xb6a4('0x77')]({'where':{'id':_0xd111f1['params']['id']}})[_0xb6a4('0x23')](function(_0x4421f5){if(_0x4421f5){var _0x172d04=util[_0xb6a4('0x2c')](_0xb6a4('0x78'),_0x4421f5[_0xb6a4('0x4c')]);if(fs[_0xb6a4('0x4f')](_0x172d04)){cypher=!![];return _0x55d13e[_0xb6a4('0x5b')](_0x172d04,_0x4421f5[_0xb6a4('0x4c')],config[_0xb6a4('0x4d')]['recording'])['then'](function(){return _0x4421f5;});}return _0x4421f5;}})[_0xb6a4('0x23')](function(_0x296451){if(!_0x296451){throw new db['Sequelize'][(_0xb6a4('0x5c'))](_0xb6a4('0x79'));}_0x11bbe5=_0x296451;return db[_0xb6a4('0x7a')][_0xb6a4('0x77')]({'where':{'id':0x1}});})[_0xb6a4('0x23')](handleEntityNotFound(_0x28d3a7,null))[_0xb6a4('0x23')](function(_0x2a672c){if(_0x2a672c){_0xfd4a09=_0x2a672c;if(!_0xfd4a09[_0xb6a4('0x7b')]||!_0xfd4a09[_0xb6a4('0x7c')]||!_0xfd4a09[_0xb6a4('0x7d')]||!_0xfd4a09[_0xb6a4('0x7e')]||!_0xfd4a09['bucket']){throw new db['Sequelize']['ValidationError'](_0xb6a4('0x7f'));}if(_0xd111f1[_0xb6a4('0x46')][_0xb6a4('0x80')]&&(!_0xfd4a09[_0xb6a4('0x81')]||!_0xfd4a09['sentimentAccountId']||!_0xfd4a09['sentimentRegion']||!_0xfd4a09[_0xb6a4('0x7e')]||!_0xfd4a09[_0xb6a4('0x6f')])){throw new db[(_0xb6a4('0x50'))]['ValidationError'](_0xb6a4('0x82'));}return db[_0xb6a4('0x83')][_0xb6a4('0x77')]({'where':{'id':_0xfd4a09[_0xb6a4('0x7c')]}});}})['then'](function(_0x221553){if(!_0x221553){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x221553[_0xb6a4('0x84')]||!_0x221553[_0xb6a4('0x85')]){throw new db[(_0xb6a4('0x50'))][(_0xb6a4('0x5c'))](_0xb6a4('0x86'));}_0x5316b0=_0x221553;return getBucketslist(_0x5316b0['data1'],_0x5316b0['data2'],_0xfd4a09[_0xb6a4('0x7d')]);})[_0xb6a4('0x23')](function(_0x16f2e4){if(_0x16f2e4&&_0x16f2e4[_0xb6a4('0x87')]){var _0x412eec=_[_0xb6a4('0x43')](_0x16f2e4[_0xb6a4('0x87')],function(_0x3bfa6f){return _0x3bfa6f[_0xb6a4('0x88')]===_0xfd4a09['bucket'];});if(!_0x412eec){logger[_0xb6a4('0x60')](util[_0xb6a4('0x2c')](_0xb6a4('0x89'),_0xd111f1[_0xb6a4('0x4b')]['id'],_0xfd4a09[_0xb6a4('0x6f')]));return createBucket(_0x5316b0['data1'],_0x5316b0[_0xb6a4('0x85')],_0xfd4a09[_0xb6a4('0x7d')],_0xfd4a09[_0xb6a4('0x6f')]);}logger['info'](util['format'](_0xb6a4('0x8a'),_0xd111f1[_0xb6a4('0x4b')]['id'],_0xfd4a09[_0xb6a4('0x6f')]));return;}})[_0xb6a4('0x23')](function(_0x219292){if(_0x11bbe5[_0xb6a4('0x75')]==='NEW'){return transcribe(_0xd111f1['params']['id'],_0x5316b0[_0xb6a4('0x84')],_0x5316b0[_0xb6a4('0x85')],_0xfd4a09[_0xb6a4('0x7d')],_0xfd4a09[_0xb6a4('0x6f')],_0x11bbe5['value'],_0xfd4a09[_0xb6a4('0x7e')]);}else{logger['info'](util[_0xb6a4('0x2c')](_0xb6a4('0x8b'),_0xd111f1[_0xb6a4('0x4b')]['id']));return{'transcribeStatus':_0xb6a4('0x8c')};}})[_0xb6a4('0x23')](function(_0x346101){if(_0x346101){_0x346101[_0xb6a4('0x8d')]=_0xd111f1['body'][_0xb6a4('0x80')];return _0x11bbe5['updateAttributes'](_0x346101);}})[_0xb6a4('0x23')](respondWithResult(_0x28d3a7,null))[_0xb6a4('0x44')](handleError(_0x28d3a7,null));};function writeFile(_0x7d8b6d,_0x2d6dfc){return new Promise(function(_0x596169,_0x562835){fs[_0xb6a4('0x8e')](_0x2d6dfc,_0x7d8b6d,function(_0x23fe66,_0x1be937){if(_0x23fe66){return _0x562835(_0x23fe66);}else{return _0x596169(_0x1be937);}});});}exports['downloadTranscribe']=function(_0x28227e,_0x40bb33,_0x2ad441){return db['VoiceRecording'][_0xb6a4('0x77')]({'where':{'id':_0x28227e[_0xb6a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40bb33))[_0xb6a4('0x23')](function(_0x11667b){if(_0x11667b&&_0x11667b['fileText']){var _0x43f382=_0x11667b[_0xb6a4('0x8f')];var _0xb7b213=config['root']+_0xb6a4('0x90')+_0x11667b['id']+'.txt';if(fs['existsSync'](_0xb7b213)){return _0xb7b213;}return writeFile(_0x43f382,_0xb7b213)['then'](function(){return _0xb7b213;});}else{throw new db[(_0xb6a4('0x50'))]['ValidationError'](_0xb6a4('0x91'));}})[_0xb6a4('0x23')](function(_0x18b710){return _0x40bb33['download'](_0x18b710);})[_0xb6a4('0x44')](handleError(_0x40bb33));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 100d4b5..847c772 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 _0x7da6=['rimraf','../../config/environment','./voiceRecording.attributes','exports','define','uniqueid','../../config/logger','api','moment','bluebird','path'];(function(_0x1b2566,_0x4b3059){var _0x4eb987=function(_0x20fef6){while(--_0x20fef6){_0x1b2566['push'](_0x1b2566['shift']());}};_0x4eb987(++_0x4b3059);}(_0x7da6,0x124));var _0x67da=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x7da6[_0x16ea87];return _0x6e7b1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67da('0x0'))(_0x67da('0x1'));var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67da('0x4'));var rimraf=require(_0x67da('0x5'));var config=require(_0x67da('0x6'));var attributes=require(_0x67da('0x7'));module[_0x67da('0x8')]=function(_0x40d5f8,_0x59af9a){return _0x40d5f8[_0x67da('0x9')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x67da('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x034e=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x46d119,_0x167fb4){var _0x4f4816=function(_0x946273){while(--_0x946273){_0x46d119['push'](_0x46d119['shift']());}};_0x4f4816(++_0x167fb4);}(_0x034e,0x118));var _0xe034=function(_0x1986d8,_0x1910a7){_0x1986d8=_0x1986d8-0x0;var _0x28b3c3=_0x034e[_0x1986d8];return _0x28b3c3;};'use strict';var _=require(_0xe034('0x0'));var util=require('util');var logger=require(_0xe034('0x1'))('api');var moment=require(_0xe034('0x2'));var BPromise=require(_0xe034('0x3'));var rp=require(_0xe034('0x4'));var fs=require('fs');var path=require(_0xe034('0x5'));var rimraf=require(_0xe034('0x6'));var config=require(_0xe034('0x7'));var attributes=require(_0xe034('0x8'));module[_0xe034('0x9')]=function(_0x2a7f0d,_0x4ac1a0){return _0x2a7f0d[_0xe034('0xa')](_0xe034('0xb'),attributes,{'tableName':_0xe034('0xc'),'paranoid':![],'indexes':[{'name':_0xe034('0xd'),'fields':[_0xe034('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 1af4db1..1fcaec4 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 _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x4a7529,_0xba0830){var _0x254252=function(_0x53cbea){while(--_0x53cbea){_0x4a7529['push'](_0x4a7529['shift']());}};_0x254252(++_0xba0830);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0xbff5=['catch','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','%s.cypher','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','where','attributes','then','UpdateVoiceRecording','debug'];(function(_0x5106c1,_0x13233a){var _0x5bcaac=function(_0x18c12e){while(--_0x18c12e){_0x5106c1['push'](_0x5106c1['shift']());}};_0x5bcaac(++_0x13233a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x401804,_0xe44b2a){_0x401804=_0x401804-0x0;var _0x4152c7=_0xbff5[_0x401804];return _0x4152c7;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['UpdateVoiceRecording']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['VoiceRecording'][_0x5bff('0x15')](_0xc9fbc3['body'],{'raw':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3['options'][_0x5bff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')]['limit']||null:null})[_0x5bff('0x1a')](function(_0x263cf5){logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0xc9fbc3);logger[_0x5bff('0x1c')](_0x5bff('0x1b'),_0xc9fbc3,JSON[_0x5bff('0xf')](_0x263cf5));_0x36653b(_0x263cf5);})[_0x5bff('0x1d')](function(_0x5e2ae8){logger['error'](_0x5bff('0x1b'),_0x5e2ae8['message'],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x5e2ae8[_0x5bff('0x12')]));});});};exports[_0x5bff('0x1e')]=function(_0x6f18f1){var _0xfa361d=this;return new Promise(function(_0x1140eb,_0x271f3c){var _0xedba9d=require('../../components/encryptor');var _0x4df57a;return db[_0x5bff('0x1f')][_0x5bff('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5bff('0x1a')](function(_0x588078){_0x4df57a=_0x588078;return db['VoiceRecording'][_0x5bff('0x21')](_0x6f18f1['body']);})[_0x5bff('0x1a')](function(_0x64e22){if(_0x4df57a[_0x5bff('0x22')]&&fs[_0x5bff('0x23')](_0x64e22['value'])){var _0x71783=util['format'](_0x5bff('0x24'),_0x64e22['value']);return _0xedba9d[_0x5bff('0x25')](_0x64e22[_0x5bff('0x26')],_0x71783,config[_0x5bff('0x27')][_0x5bff('0x28')])[_0x5bff('0x1a')](function(){fs[_0x5bff('0x29')](_0x64e22['value']);logger[_0x5bff('0x13')](_0x5bff('0x2a'));return _0x64e22;});}return _0x64e22;})[_0x5bff('0x1a')](function(_0x42fe4a){logger[_0x5bff('0x13')](_0x5bff('0x1e'),_0x6f18f1);logger[_0x5bff('0x1c')](_0x5bff('0x1e'),_0x6f18f1,JSON['stringify'](_0x42fe4a));_0x1140eb(_0x42fe4a);})[_0x5bff('0x1d')](function(_0x16042d){logger[_0x5bff('0x10')](_0x5bff('0x1e'),_0x16042d['message'],_0x6f18f1);_0x271f3c(_0xfa361d[_0x5bff('0x10')](0x1f4,_0x16042d[_0x5bff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9cec95b..7a192c1 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 _0x0760=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c7201,_0x45388f){var _0x4bddca=function(_0x1312f1){while(--_0x1312f1){_0x4c7201['push'](_0x4c7201['shift']());}};_0x4bddca(++_0x45388f);}(_0x0760,0xf6));var _0x0076=function(_0x58c10d,_0x1d5885){_0x58c10d=_0x58c10d-0x0;var _0x6b0ecd=_0x0760[_0x58c10d];return _0x6b0ecd;};'use strict';var multer=require('multer');var util=require(_0x0076('0x0'));var path=require(_0x0076('0x1'));var timeout=require(_0x0076('0x2'));var express=require(_0x0076('0x3'));var router=express[_0x0076('0x4')]();var fs_extra=require(_0x0076('0x5'));var auth=require(_0x0076('0x6'));var interaction=require(_0x0076('0x7'));var config=require(_0x0076('0x8'));var controller=require(_0x0076('0x9'));router[_0x0076('0xa')]('/',auth[_0x0076('0xb')](),controller[_0x0076('0xc')]);router[_0x0076('0xa')]('/describe',auth[_0x0076('0xb')](),controller[_0x0076('0xd')]);router[_0x0076('0xa')](_0x0076('0xe'),auth[_0x0076('0xb')](),controller['show']);router[_0x0076('0xf')]('/',auth['isAuthenticated'](),controller[_0x0076('0x10')]);router[_0x0076('0x11')]('/:id',auth[_0x0076('0xb')](),controller['update']);router[_0x0076('0x12')](_0x0076('0xe'),auth[_0x0076('0xb')](),controller[_0x0076('0x13')]);module[_0x0076('0x14')]=router; \ No newline at end of file +var _0x1cad=['isAuthenticated','index','/describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1cad,0x88));var _0xd1ca=function(_0x56e124,_0x23c48c){_0x56e124=_0x56e124-0x0;var _0x6d955b=_0x1cad[_0x56e124];return _0x6d955b;};'use strict';var multer=require(_0xd1ca('0x0'));var util=require(_0xd1ca('0x1'));var path=require(_0xd1ca('0x2'));var timeout=require(_0xd1ca('0x3'));var express=require(_0xd1ca('0x4'));var router=express[_0xd1ca('0x5')]();var fs_extra=require(_0xd1ca('0x6'));var auth=require(_0xd1ca('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd1ca('0x8'));var controller=require(_0xd1ca('0x9'));router[_0xd1ca('0xa')]('/',auth[_0xd1ca('0xb')](),controller[_0xd1ca('0xc')]);router['get'](_0xd1ca('0xd'),auth[_0xd1ca('0xb')](),controller['describe']);router[_0xd1ca('0xa')](_0xd1ca('0xe'),auth[_0xd1ca('0xb')](),controller[_0xd1ca('0xf')]);router[_0xd1ca('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd1ca('0xe'),auth[_0xd1ca('0xb')](),controller[_0xd1ca('0x11')]);router[_0xd1ca('0x12')](_0xd1ca('0xe'),auth[_0xd1ca('0xb')](),controller[_0xd1ca('0x13')]);module[_0xd1ca('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 2ed55c4..7382591 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 _0x70f3=['Yes','moment','ENUM','blind','attended','STRING'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x70f3,0x79));var _0x370f=function(_0x159e29,_0x53d9ca){_0x159e29=_0x159e29-0x0;var _0x429903=_0x70f3[_0x159e29];return _0x429903;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x370f('0x0'));module['exports']={'type':{'type':Sequelize[_0x370f('0x1')](_0x370f('0x2'),_0x370f('0x3'))},'result':{'type':Sequelize[_0x370f('0x4')]},'transfererchannel':{'type':Sequelize[_0x370f('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x370f('0x4')]},'transferercalleridname':{'type':Sequelize[_0x370f('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x370f('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x370f('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x370f('0x4')]},'transferercontext':{'type':Sequelize[_0x370f('0x4')]},'transfererexten':{'type':Sequelize[_0x370f('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x370f('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x370f('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x370f('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x370f('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x370f('0x4')]},'isexternal':{'type':Sequelize[_0x370f('0x1')](_0x370f('0x5'),'No')},'context':{'type':Sequelize[_0x370f('0x4')]},'extension':{'type':Sequelize[_0x370f('0x4')]}}; \ No newline at end of file +var _0x9ac7=['blind','attended','STRING','ENUM','Yes','exports'];(function(_0xc69fda,_0x367f93){var _0x721842=function(_0x521bf7){while(--_0x521bf7){_0xc69fda['push'](_0xc69fda['shift']());}};_0x721842(++_0x367f93);}(_0x9ac7,0x7d));var _0x79ac=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9ac7[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x79ac('0x0')]={'type':{'type':Sequelize['ENUM'](_0x79ac('0x1'),_0x79ac('0x2'))},'result':{'type':Sequelize[_0x79ac('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x79ac('0x3')]},'transferercalleridname':{'type':Sequelize[_0x79ac('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x79ac('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x79ac('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x79ac('0x3')]},'transferercontext':{'type':Sequelize[_0x79ac('0x3')]},'transfererexten':{'type':Sequelize[_0x79ac('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x79ac('0x3')]},'transfereechannel':{'type':Sequelize[_0x79ac('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x79ac('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x79ac('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x79ac('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x79ac('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x79ac('0x3')]},'transfereecontext':{'type':Sequelize[_0x79ac('0x3')]},'transfereeexten':{'type':Sequelize[_0x79ac('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x79ac('0x3')]},'isexternal':{'type':Sequelize[_0x79ac('0x4')](_0x79ac('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x79ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3d528bd..bcacea2 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 _0xcad0=['api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','fields','length','includeAll','find','create','update','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x50b139,_0x15ded7){var _0x3ccbb5=function(_0x4df0a3){while(--_0x4df0a3){_0x50b139['push'](_0x50b139['shift']());}};_0x3ccbb5(++_0x15ded7);}(_0xcad0,0x195));var _0x0cad=function(_0x3bd208,_0x3a59c2){_0x3bd208=_0x3bd208-0x0;var _0x97a34f=_0xcad0[_0x3bd208];return _0x97a34f;};'use strict';var emlformat=require(_0x0cad('0x0'));var rimraf=require(_0x0cad('0x1'));var zipdir=require(_0x0cad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0cad('0x3'));var moment=require('moment');var BPromise=require(_0x0cad('0x4'));var Mustache=require(_0x0cad('0x5'));var util=require('util');var path=require(_0x0cad('0x6'));var sox=require(_0x0cad('0x7'));var csv=require(_0x0cad('0x8'));var ejs=require(_0x0cad('0x9'));var fs=require('fs');var fs_extra=require(_0x0cad('0xa'));var _=require(_0x0cad('0xb'));var squel=require('squel');var crypto=require(_0x0cad('0xc'));var jsforce=require(_0x0cad('0xd'));var deskjs=require(_0x0cad('0xe'));var toCsv=require(_0x0cad('0x8'));var querystring=require(_0x0cad('0xf'));var Papa=require(_0x0cad('0x10'));var Redis=require('ioredis');var authService=require(_0x0cad('0x11'));var qs=require(_0x0cad('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cad('0x13'));var logger=require(_0x0cad('0x14'))(_0x0cad('0x15'));var utils=require('../../config/utils');var config=require(_0x0cad('0x16'));var licenseUtil=require(_0x0cad('0x17'));var db=require(_0x0cad('0x18'))['db'];function respondWithStatusCode(_0x912308,_0x43a889){_0x43a889=_0x43a889||0xcc;return function(_0x52324c){if(_0x52324c){return _0x912308['sendStatus'](_0x43a889);}return _0x912308[_0x0cad('0x19')](_0x43a889)['end']();};}function respondWithResult(_0x2e35fb,_0x640f4){_0x640f4=_0x640f4||0xc8;return function(_0x19444e){if(_0x19444e){return _0x2e35fb['status'](_0x640f4)[_0x0cad('0x1a')](_0x19444e);}};}function respondWithFilteredResult(_0x2da7fd,_0x126879){return function(_0x207651){if(_0x207651){var _0x31f775=typeof _0x126879[_0x0cad('0x1b')]===_0x0cad('0x1c')&&typeof _0x126879[_0x0cad('0x1d')]===_0x0cad('0x1c');var _0x15ea42=_0x207651[_0x0cad('0x1e')];var _0x3cce2c=_0x31f775?0x0:_0x126879[_0x0cad('0x1b')];var _0x4042b6=_0x31f775?_0x207651[_0x0cad('0x1e')]:_0x126879[_0x0cad('0x1b')]+_0x126879[_0x0cad('0x1d')];var _0x2adfc2;if(_0x4042b6>=_0x15ea42){_0x4042b6=_0x15ea42;_0x2adfc2=0xc8;}else{_0x2adfc2=0xce;}_0x2da7fd[_0x0cad('0x19')](_0x2adfc2);return _0x2da7fd['set'](_0x0cad('0x1f'),_0x3cce2c+'-'+_0x4042b6+'/'+_0x15ea42)[_0x0cad('0x1a')](_0x207651);}return null;};}function patchUpdates(_0xca6358){return function(_0xdd8a33){try{jsonpatch[_0x0cad('0x20')](_0xdd8a33,_0xca6358,!![]);}catch(_0x5c6f22){return BPromise[_0x0cad('0x21')](_0x5c6f22);}return _0xdd8a33['save']();};}function saveUpdates(_0x37ae50,_0x1e69ca){return function(_0x33b020){if(_0x33b020){return _0x33b020['update'](_0x37ae50)[_0x0cad('0x22')](function(_0x4c19de){return _0x4c19de;});}return null;};}function removeEntity(_0x318cae,_0x576f46){return function(_0x308137){if(_0x308137){return _0x308137[_0x0cad('0x23')]()['then'](function(){_0x318cae[_0x0cad('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18cb58,_0x49f6be){return function(_0x2b8196){if(!_0x2b8196){_0x18cb58[_0x0cad('0x24')](0x194);}return _0x2b8196;};}function handleError(_0x148f71,_0x352f95){_0x352f95=_0x352f95||0x1f4;return function(_0x3a4da0){logger['error'](_0x3a4da0[_0x0cad('0x25')]);if(_0x3a4da0[_0x0cad('0x26')]){delete _0x3a4da0[_0x0cad('0x26')];}_0x148f71[_0x0cad('0x19')](_0x352f95)[_0x0cad('0x27')](_0x3a4da0);};}exports['index']=function(_0x30f0f6,_0x185726){var _0xb6ad57={},_0x49bcd4={},_0x41fee8={'count':0x0,'rows':[]};var _0x59a3f0=_[_0x0cad('0x28')](db[_0x0cad('0x29')][_0x0cad('0x2a')],function(_0x11a325){return{'name':_0x11a325[_0x0cad('0x2b')],'type':_0x11a325['type']['key']};});_0x49bcd4['model']=_['map'](_0x59a3f0,_0x0cad('0x26'));_0x49bcd4[_0x0cad('0x2c')]=_['keys'](_0x30f0f6[_0x0cad('0x2c')]);_0x49bcd4[_0x0cad('0x2d')]=_[_0x0cad('0x2e')](_0x49bcd4[_0x0cad('0x2f')],_0x49bcd4[_0x0cad('0x2c')]);_0xb6ad57['attributes']=_[_0x0cad('0x2e')](_0x49bcd4['model'],qs['fields'](_0x30f0f6[_0x0cad('0x2c')]['fields']));_0xb6ad57['attributes']=_0xb6ad57[_0x0cad('0x30')]['length']?_0xb6ad57[_0x0cad('0x30')]:_0x49bcd4['model'];if(!_0x30f0f6[_0x0cad('0x2c')]['hasOwnProperty'](_0x0cad('0x31'))){_0xb6ad57[_0x0cad('0x1d')]=qs[_0x0cad('0x1d')](_0x30f0f6[_0x0cad('0x2c')][_0x0cad('0x1d')]);_0xb6ad57[_0x0cad('0x1b')]=qs[_0x0cad('0x1b')](_0x30f0f6[_0x0cad('0x2c')]['offset']);}_0xb6ad57[_0x0cad('0x32')]=qs[_0x0cad('0x33')](_0x30f0f6[_0x0cad('0x2c')][_0x0cad('0x33')]);_0xb6ad57[_0x0cad('0x34')]=qs[_0x0cad('0x2d')](_[_0x0cad('0x35')](_0x30f0f6[_0x0cad('0x2c')],_0x49bcd4['filters']),_0x59a3f0);if(_0x30f0f6[_0x0cad('0x2c')][_0x0cad('0x36')]){_0xb6ad57[_0x0cad('0x34')]=_[_0x0cad('0x37')](_0xb6ad57[_0x0cad('0x34')],{'$or':_['map'](_0x59a3f0,function(_0x1e0c9d){if(_0x1e0c9d['type']!==_0x0cad('0x38')){var _0x4e9d8c={};_0x4e9d8c[_0x1e0c9d[_0x0cad('0x26')]]={'$like':'%'+_0x30f0f6['query'][_0x0cad('0x36')]+'%'};return _0x4e9d8c;}})});}_0xb6ad57=_[_0x0cad('0x37')]({},_0xb6ad57,_0x30f0f6[_0x0cad('0x39')]);var _0x1ed6e5={'where':_0xb6ad57[_0x0cad('0x34')]};return db[_0x0cad('0x29')]['count'](_0x1ed6e5)[_0x0cad('0x22')](function(_0x246641){_0x41fee8[_0x0cad('0x1e')]=_0x246641;if(_0x30f0f6[_0x0cad('0x2c')]['includeAll']){_0xb6ad57[_0x0cad('0x3a')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0cad('0x3b')](_0xb6ad57);})[_0x0cad('0x22')](function(_0x1101a6){_0x41fee8['rows']=_0x1101a6;return _0x41fee8;})[_0x0cad('0x22')](respondWithFilteredResult(_0x185726,_0xb6ad57))[_0x0cad('0x3c')](handleError(_0x185726,null));};exports[_0x0cad('0x3d')]=function(_0x4ba1c0,_0x508bef){var _0x5d47e8={'raw':!![],'where':{'id':_0x4ba1c0[_0x0cad('0x3e')]['id']}},_0x2528a9={};_0x2528a9['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x2528a9[_0x0cad('0x2c')]=_[_0x0cad('0x3f')](_0x4ba1c0[_0x0cad('0x2c')]);_0x2528a9['filters']=_['intersection'](_0x2528a9[_0x0cad('0x2f')],_0x2528a9['query']);_0x5d47e8[_0x0cad('0x30')]=_[_0x0cad('0x2e')](_0x2528a9['model'],qs[_0x0cad('0x40')](_0x4ba1c0[_0x0cad('0x2c')][_0x0cad('0x40')]));_0x5d47e8['attributes']=_0x5d47e8[_0x0cad('0x30')][_0x0cad('0x41')]?_0x5d47e8['attributes']:_0x2528a9['model'];if(_0x4ba1c0[_0x0cad('0x2c')][_0x0cad('0x42')]){_0x5d47e8[_0x0cad('0x3a')]=[{'all':!![]}];}_0x5d47e8=_[_0x0cad('0x37')]({},_0x5d47e8,_0x4ba1c0['options']);return db[_0x0cad('0x29')][_0x0cad('0x43')](_0x5d47e8)[_0x0cad('0x22')](handleEntityNotFound(_0x508bef,null))[_0x0cad('0x22')](respondWithResult(_0x508bef,null))[_0x0cad('0x3c')](handleError(_0x508bef,null));};exports[_0x0cad('0x44')]=function(_0x174a3a,_0x470baa){return db['VoiceTransferReport']['create'](_0x174a3a['body'],{})[_0x0cad('0x22')](respondWithResult(_0x470baa,0xc9))[_0x0cad('0x3c')](handleError(_0x470baa,null));};exports[_0x0cad('0x45')]=function(_0x530cc9,_0x31d1c8){if(_0x530cc9['body']['id']){delete _0x530cc9['body']['id'];}return db[_0x0cad('0x29')][_0x0cad('0x43')]({'where':{'id':_0x530cc9['params']['id']}})[_0x0cad('0x22')](handleEntityNotFound(_0x31d1c8,null))[_0x0cad('0x22')](saveUpdates(_0x530cc9['body'],null))[_0x0cad('0x22')](respondWithResult(_0x31d1c8,null))[_0x0cad('0x3c')](handleError(_0x31d1c8,null));};exports[_0x0cad('0x23')]=function(_0x3bd494,_0xc192b6){return db['VoiceTransferReport'][_0x0cad('0x43')]({'where':{'id':_0x3bd494[_0x0cad('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc192b6,null))[_0x0cad('0x22')](removeEntity(_0xc192b6,null))['catch'](handleError(_0xc192b6,null));};exports[_0x0cad('0x46')]=function(_0x286f55,_0x405fe9){return db[_0x0cad('0x29')][_0x0cad('0x46')]()[_0x0cad('0x22')](respondWithResult(_0x405fe9,null))[_0x0cad('0x3c')](handleError(_0x405fe9,null));}; \ No newline at end of file +var _0x21c4=['map','VoiceTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x21ea1d,_0x3956cc){var _0xe69b53=function(_0x1a9aeb){while(--_0x1a9aeb){_0x21ea1d['push'](_0x21ea1d['shift']());}};_0xe69b53(++_0x3956cc);}(_0x21c4,0x1f4));var _0x421c=function(_0x112d20,_0x4bd3b6){_0x112d20=_0x112d20-0x0;var _0x48c4ce=_0x21c4[_0x112d20];return _0x48c4ce;};'use strict';var emlformat=require(_0x421c('0x0'));var rimraf=require(_0x421c('0x1'));var zipdir=require(_0x421c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x421c('0x3'));var moment=require(_0x421c('0x4'));var BPromise=require(_0x421c('0x5'));var Mustache=require(_0x421c('0x6'));var util=require('util');var path=require(_0x421c('0x7'));var sox=require(_0x421c('0x8'));var csv=require(_0x421c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x421c('0xa'));var _=require(_0x421c('0xb'));var squel=require(_0x421c('0xc'));var crypto=require(_0x421c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x421c('0xe'));var toCsv=require(_0x421c('0x9'));var querystring=require(_0x421c('0xf'));var Papa=require(_0x421c('0x10'));var Redis=require(_0x421c('0x11'));var authService=require(_0x421c('0x12'));var qs=require(_0x421c('0x13'));var as=require(_0x421c('0x14'));var hardwareService=require(_0x421c('0x15'));var logger=require(_0x421c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x421c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x421c('0x18'))['db'];function respondWithStatusCode(_0x563185,_0x1d0a53){_0x1d0a53=_0x1d0a53||0xcc;return function(_0x3c9e61){if(_0x3c9e61){return _0x563185[_0x421c('0x19')](_0x1d0a53);}return _0x563185[_0x421c('0x1a')](_0x1d0a53)[_0x421c('0x1b')]();};}function respondWithResult(_0x25c2c0,_0x2d8360){_0x2d8360=_0x2d8360||0xc8;return function(_0x3b22b5){if(_0x3b22b5){return _0x25c2c0[_0x421c('0x1a')](_0x2d8360)[_0x421c('0x1c')](_0x3b22b5);}};}function respondWithFilteredResult(_0x352045,_0x23446c){return function(_0x583206){if(_0x583206){var _0x27b8d0=typeof _0x23446c['offset']===_0x421c('0x1d')&&typeof _0x23446c[_0x421c('0x1e')]===_0x421c('0x1d');var _0x280240=_0x583206[_0x421c('0x1f')];var _0x1a9006=_0x27b8d0?0x0:_0x23446c[_0x421c('0x20')];var _0x43133c=_0x27b8d0?_0x583206['count']:_0x23446c[_0x421c('0x20')]+_0x23446c[_0x421c('0x1e')];var _0x5ca8d8;if(_0x43133c>=_0x280240){_0x43133c=_0x280240;_0x5ca8d8=0xc8;}else{_0x5ca8d8=0xce;}_0x352045['status'](_0x5ca8d8);return _0x352045[_0x421c('0x21')](_0x421c('0x22'),_0x1a9006+'-'+_0x43133c+'/'+_0x280240)[_0x421c('0x1c')](_0x583206);}return null;};}function patchUpdates(_0x3d1911){return function(_0x11756a){try{jsonpatch[_0x421c('0x23')](_0x11756a,_0x3d1911,!![]);}catch(_0xd09f74){return BPromise[_0x421c('0x24')](_0xd09f74);}return _0x11756a[_0x421c('0x25')]();};}function saveUpdates(_0x1cc504,_0x3dcc94){return function(_0x557d2d){if(_0x557d2d){return _0x557d2d[_0x421c('0x26')](_0x1cc504)[_0x421c('0x27')](function(_0x5bb680){return _0x5bb680;});}return null;};}function removeEntity(_0x3219e9,_0x3e9e7d){return function(_0x427b7c){if(_0x427b7c){return _0x427b7c[_0x421c('0x28')]()['then'](function(){_0x3219e9['status'](0xcc)[_0x421c('0x1b')]();});}};}function handleEntityNotFound(_0x4243cb,_0x47d24f){return function(_0x5c800f){if(!_0x5c800f){_0x4243cb[_0x421c('0x19')](0x194);}return _0x5c800f;};}function handleError(_0x4e9d54,_0xc663b1){_0xc663b1=_0xc663b1||0x1f4;return function(_0x12623d){logger[_0x421c('0x29')](_0x12623d[_0x421c('0x2a')]);if(_0x12623d[_0x421c('0x2b')]){delete _0x12623d[_0x421c('0x2b')];}_0x4e9d54[_0x421c('0x1a')](_0xc663b1)[_0x421c('0x2c')](_0x12623d);};}exports[_0x421c('0x2d')]=function(_0x2f9718,_0x1f8894){var _0x29edee={},_0x46615a={},_0x2221d9={'count':0x0,'rows':[]};var _0x1ad886=_[_0x421c('0x2e')](db[_0x421c('0x2f')][_0x421c('0x30')],function(_0x31b0b5){return{'name':_0x31b0b5['fieldName'],'type':_0x31b0b5[_0x421c('0x31')][_0x421c('0x32')]};});_0x46615a[_0x421c('0x33')]=_[_0x421c('0x2e')](_0x1ad886,_0x421c('0x2b'));_0x46615a['query']=_[_0x421c('0x34')](_0x2f9718[_0x421c('0x35')]);_0x46615a[_0x421c('0x36')]=_[_0x421c('0x37')](_0x46615a['model'],_0x46615a[_0x421c('0x35')]);_0x29edee['attributes']=_[_0x421c('0x37')](_0x46615a[_0x421c('0x33')],qs['fields'](_0x2f9718[_0x421c('0x35')]['fields']));_0x29edee[_0x421c('0x38')]=_0x29edee[_0x421c('0x38')][_0x421c('0x39')]?_0x29edee[_0x421c('0x38')]:_0x46615a['model'];if(!_0x2f9718[_0x421c('0x35')]['hasOwnProperty'](_0x421c('0x3a'))){_0x29edee[_0x421c('0x1e')]=qs[_0x421c('0x1e')](_0x2f9718[_0x421c('0x35')]['limit']);_0x29edee['offset']=qs[_0x421c('0x20')](_0x2f9718['query']['offset']);}_0x29edee[_0x421c('0x3b')]=qs['sort'](_0x2f9718['query'][_0x421c('0x3c')]);_0x29edee[_0x421c('0x3d')]=qs[_0x421c('0x36')](_[_0x421c('0x3e')](_0x2f9718[_0x421c('0x35')],_0x46615a[_0x421c('0x36')]),_0x1ad886);if(_0x2f9718[_0x421c('0x35')][_0x421c('0x3f')]){_0x29edee[_0x421c('0x3d')]=_[_0x421c('0x40')](_0x29edee[_0x421c('0x3d')],{'$or':_[_0x421c('0x2e')](_0x1ad886,function(_0x30fbd1){if(_0x30fbd1[_0x421c('0x31')]!==_0x421c('0x41')){var _0x5e1d50={};_0x5e1d50[_0x30fbd1[_0x421c('0x2b')]]={'$like':'%'+_0x2f9718[_0x421c('0x35')]['filter']+'%'};return _0x5e1d50;}})});}_0x29edee=_[_0x421c('0x40')]({},_0x29edee,_0x2f9718[_0x421c('0x42')]);var _0x137786={'where':_0x29edee['where']};return db['VoiceTransferReport'][_0x421c('0x1f')](_0x137786)[_0x421c('0x27')](function(_0x1dd832){_0x2221d9[_0x421c('0x1f')]=_0x1dd832;if(_0x2f9718[_0x421c('0x35')][_0x421c('0x43')]){_0x29edee[_0x421c('0x44')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x29edee);})[_0x421c('0x27')](function(_0x3073ee){_0x2221d9[_0x421c('0x45')]=_0x3073ee;return _0x2221d9;})[_0x421c('0x27')](respondWithFilteredResult(_0x1f8894,_0x29edee))[_0x421c('0x46')](handleError(_0x1f8894,null));};exports[_0x421c('0x47')]=function(_0x1b3194,_0x26bf38){var _0x5bed34={'raw':!![],'where':{'id':_0x1b3194[_0x421c('0x48')]['id']}},_0x4fa6b6={};_0x4fa6b6[_0x421c('0x33')]=_['keys'](db['VoiceTransferReport'][_0x421c('0x30')]);_0x4fa6b6[_0x421c('0x35')]=_['keys'](_0x1b3194[_0x421c('0x35')]);_0x4fa6b6['filters']=_[_0x421c('0x37')](_0x4fa6b6['model'],_0x4fa6b6[_0x421c('0x35')]);_0x5bed34['attributes']=_[_0x421c('0x37')](_0x4fa6b6['model'],qs[_0x421c('0x49')](_0x1b3194[_0x421c('0x35')]['fields']));_0x5bed34[_0x421c('0x38')]=_0x5bed34['attributes']['length']?_0x5bed34[_0x421c('0x38')]:_0x4fa6b6[_0x421c('0x33')];if(_0x1b3194[_0x421c('0x35')]['includeAll']){_0x5bed34[_0x421c('0x44')]=[{'all':!![]}];}_0x5bed34=_[_0x421c('0x40')]({},_0x5bed34,_0x1b3194[_0x421c('0x42')]);return db['VoiceTransferReport'][_0x421c('0x4a')](_0x5bed34)['then'](handleEntityNotFound(_0x26bf38,null))['then'](respondWithResult(_0x26bf38,null))[_0x421c('0x46')](handleError(_0x26bf38,null));};exports['create']=function(_0x21c7a1,_0x329246){return db[_0x421c('0x2f')][_0x421c('0x4b')](_0x21c7a1[_0x421c('0x4c')],{})[_0x421c('0x27')](respondWithResult(_0x329246,0xc9))[_0x421c('0x46')](handleError(_0x329246,null));};exports[_0x421c('0x26')]=function(_0x2122ae,_0x2e3417){if(_0x2122ae['body']['id']){delete _0x2122ae['body']['id'];}return db['VoiceTransferReport'][_0x421c('0x4a')]({'where':{'id':_0x2122ae[_0x421c('0x48')]['id']}})[_0x421c('0x27')](handleEntityNotFound(_0x2e3417,null))[_0x421c('0x27')](saveUpdates(_0x2122ae[_0x421c('0x4c')],null))[_0x421c('0x27')](respondWithResult(_0x2e3417,null))[_0x421c('0x46')](handleError(_0x2e3417,null));};exports[_0x421c('0x28')]=function(_0x1ba090,_0x5d9832){return db[_0x421c('0x2f')][_0x421c('0x4a')]({'where':{'id':_0x1ba090[_0x421c('0x48')]['id']}})[_0x421c('0x27')](handleEntityNotFound(_0x5d9832,null))[_0x421c('0x27')](removeEntity(_0x5d9832,null))[_0x421c('0x46')](handleError(_0x5d9832,null));};exports[_0x421c('0x4d')]=function(_0x14386a,_0x395871){return db[_0x421c('0x2f')][_0x421c('0x4d')]()[_0x421c('0x27')](respondWithResult(_0x395871,null))[_0x421c('0x46')](handleError(_0x395871,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 9451dbd..7d6caaa 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 _0x9505=['rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x4a47dc,_0xc5f364){var _0xb2a931=function(_0x3cd598){while(--_0x3cd598){_0x4a47dc['push'](_0x4a47dc['shift']());}};_0xb2a931(++_0xc5f364);}(_0x9505,0xe0));var _0x5950=function(_0x3ffd3a,_0x3cd68a){_0x3ffd3a=_0x3ffd3a-0x0;var _0x5278db=_0x9505[_0x3ffd3a];return _0x5278db;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var logger=require(_0x5950('0x2'))(_0x5950('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5950('0x4'));var fs=require('fs');var path=require(_0x5950('0x5'));var rimraf=require(_0x5950('0x6'));var config=require(_0x5950('0x7'));var attributes=require(_0x5950('0x8'));module['exports']=function(_0x283241,_0x13f2fa){return _0x283241['define'](_0x5950('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dab=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x4dab,0xaf));var _0xb4da=function(_0x30ff44,_0x143800){_0x30ff44=_0x30ff44-0x0;var _0x126c3c=_0x4dab[_0x30ff44];return _0x126c3c;};'use strict';var _=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var logger=require(_0xb4da('0x2'))('api');var moment=require(_0xb4da('0x3'));var BPromise=require(_0xb4da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4da('0x5'));var rimraf=require(_0xb4da('0x6'));var config=require(_0xb4da('0x7'));var attributes=require(_0xb4da('0x8'));module[_0xb4da('0x9')]=function(_0x189052,_0x44d337){return _0x189052[_0xb4da('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 5ba3388..8fc63cb 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 _0xc7d8=['client','http','request','then','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4709df,_0x2e6d05){var _0x45d096=function(_0x165216){while(--_0x165216){_0x4709df['push'](_0x4709df['shift']());}};_0x45d096(++_0x2e6d05);}(_0xc7d8,0x1d5));var _0x8c7d=function(_0x4f50ae,_0x1ba3f3){_0x4f50ae=_0x4f50ae-0x0;var _0x67ebc1=_0xc7d8[_0x4f50ae];return _0x67ebc1;};'use strict';var _=require(_0x8c7d('0x0'));var util=require(_0x8c7d('0x1'));var moment=require(_0x8c7d('0x2'));var BPromise=require(_0x8c7d('0x3'));var rs=require(_0x8c7d('0x4'));var fs=require('fs');var Redis=require(_0x8c7d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c7d('0x6'));var logger=require(_0x8c7d('0x7'))(_0x8c7d('0x8'));var config=require(_0x8c7d('0x9'));var jayson=require(_0x8c7d('0xa'));var client=jayson[_0x8c7d('0xb')][_0x8c7d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf70d2f,_0x400a94,_0x419660){return new BPromise(function(_0x4a79ea,_0x18412e){return client[_0x8c7d('0xd')](_0xf70d2f,_0x419660)[_0x8c7d('0xe')](function(_0x1b41e6){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x400a94,_0x8c7d('0xf'));logger['debug'](_0x8c7d('0x10'),_0x400a94,_0x8c7d('0xf'),JSON[_0x8c7d('0x11')](_0x1b41e6));if(_0x1b41e6[_0x8c7d('0x12')]){if(_0x1b41e6['error'][_0x8c7d('0x13')]===0x1f4){logger['error'](_0x8c7d('0x14'),_0x400a94,_0x1b41e6[_0x8c7d('0x12')][_0x8c7d('0x15')]);return _0x18412e(_0x1b41e6[_0x8c7d('0x12')][_0x8c7d('0x15')]);}logger[_0x8c7d('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x400a94,_0x1b41e6['error']['message']);return _0x4a79ea(_0x1b41e6[_0x8c7d('0x12')]['message']);}else{logger[_0x8c7d('0x16')](_0x8c7d('0x14'),_0x400a94,_0x8c7d('0xf'));_0x4a79ea(_0x1b41e6[_0x8c7d('0x17')][_0x8c7d('0x15')]);}})['catch'](function(_0xbb9c2c){logger[_0x8c7d('0x12')](_0x8c7d('0x14'),_0x400a94,_0xbb9c2c);_0x18412e(_0xbb9c2c);});});}exports[_0x8c7d('0x18')]=function(_0x23f112){var _0x3dcac4=this;return new Promise(function(_0x18aa0c,_0x2c9658){return db[_0x8c7d('0x19')][_0x8c7d('0x1a')](_0x23f112[_0x8c7d('0x1b')],{'raw':_0x23f112['options']?_0x23f112[_0x8c7d('0x1c')][_0x8c7d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xc17f8c){logger['info'](_0x8c7d('0x18'),_0x23f112);logger['debug']('CreateVoiceTransferReport',_0x23f112,JSON[_0x8c7d('0x11')](_0xc17f8c));_0x18aa0c(_0xc17f8c);})['catch'](function(_0xd1d91c){logger[_0x8c7d('0x12')]('CreateVoiceTransferReport',_0xd1d91c[_0x8c7d('0x15')],_0x23f112);_0x2c9658(_0x3dcac4[_0x8c7d('0x12')](0x1f4,_0xd1d91c[_0x8c7d('0x15')]));});});}; \ No newline at end of file +var _0x49f2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','info','CreateVoiceTransferReport','stringify','lodash','util','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x49f2,0xc5));var _0x249f=function(_0x25eab6,_0x20e822){_0x25eab6=_0x25eab6-0x0;var _0x4a0681=_0x49f2[_0x25eab6];return _0x4a0681;};'use strict';var _=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var moment=require('moment');var BPromise=require(_0x249f('0x2'));var rs=require(_0x249f('0x3'));var fs=require('fs');var Redis=require(_0x249f('0x4'));var db=require(_0x249f('0x5'))['db'];var utils=require(_0x249f('0x6'));var logger=require(_0x249f('0x7'))(_0x249f('0x8'));var config=require('../../config/environment');var jayson=require(_0x249f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48c930,_0x8143a2,_0x4580c0){return new BPromise(function(_0x3d1839,_0x3b6248){return client['request'](_0x48c930,_0x4580c0)['then'](function(_0x199d3d){logger['info'](_0x249f('0xa'),_0x8143a2,_0x249f('0xb'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x8143a2,_0x249f('0xb'),JSON['stringify'](_0x199d3d));if(_0x199d3d[_0x249f('0xc')]){if(_0x199d3d[_0x249f('0xc')][_0x249f('0xd')]===0x1f4){logger[_0x249f('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x8143a2,_0x199d3d[_0x249f('0xc')][_0x249f('0xe')]);return _0x3b6248(_0x199d3d['error'][_0x249f('0xe')]);}logger[_0x249f('0xc')](_0x249f('0xa'),_0x8143a2,_0x199d3d[_0x249f('0xc')][_0x249f('0xe')]);return _0x3d1839(_0x199d3d[_0x249f('0xc')][_0x249f('0xe')]);}else{logger['info'](_0x249f('0xa'),_0x8143a2,_0x249f('0xb'));_0x3d1839(_0x199d3d[_0x249f('0xf')][_0x249f('0xe')]);}})[_0x249f('0x10')](function(_0x4d8d8c){logger[_0x249f('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x8143a2,_0x4d8d8c);_0x3b6248(_0x4d8d8c);});});}exports['CreateVoiceTransferReport']=function(_0xa03e10){var _0x3c87f7=this;return new Promise(function(_0x50ec24,_0x2d6642){return db[_0x249f('0x11')][_0x249f('0x12')](_0xa03e10[_0x249f('0x13')],{'raw':_0xa03e10[_0x249f('0x14')]?_0xa03e10[_0x249f('0x14')][_0x249f('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x3f0e6c){logger[_0x249f('0x16')](_0x249f('0x17'),_0xa03e10);logger['debug']('CreateVoiceTransferReport',_0xa03e10,JSON[_0x249f('0x18')](_0x3f0e6c));_0x50ec24(_0x3f0e6c);})[_0x249f('0x10')](function(_0x3284c3){logger[_0x249f('0xc')](_0x249f('0x17'),_0x3284c3['message'],_0xa03e10);_0x2d6642(_0x3c87f7[_0x249f('0xc')](0x1f4,_0x3284c3['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b336c73..934ffb0 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 _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3fcfb6,_0x515024){_0x3fcfb6=_0x3fcfb6-0x0;var _0x3b99a7=_0xf3cd[_0x3fcfb6];return _0x3b99a7;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file +var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x352b44,_0x4a91a1){_0x352b44=_0x352b44-0x0;var _0x3e8baa=_0xf3cd[_0x352b44];return _0x3e8baa;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('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 e9d9754..cc7ab5d 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 _0xa588=['client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','emit','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','transfer','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xa588,0xe1));var _0x8a58=function(_0x38dcff,_0x5f249d){_0x38dcff=_0x38dcff-0x0;var _0x6cb881=_0xa588[_0x38dcff];return _0x6cb881;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8a58('0x0'));var db=require(_0x8a58('0x1'))['db'];var config=require(_0x8a58('0x2'));var util=require(_0x8a58('0x3'));var BPromise=require(_0x8a58('0x4'));var jayson=require(_0x8a58('0x5'));var amiClient=jayson[_0x8a58('0x6')][_0x8a58('0x7')]({'port':0x232a});var logger=require(_0x8a58('0x8'))('webbarapi');var Redis=require(_0x8a58('0x9'));config[_0x8a58('0xa')]=_[_0x8a58('0xb')](config[_0x8a58('0xa')],{'host':_0x8a58('0xc'),'port':0x18eb});var io=require(_0x8a58('0xd'))(new Redis(config[_0x8a58('0xa')]));var Schema=require(_0x8a58('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'callNumber':{'type':_0x8a58('0x10'),'required':[!![],_0x8a58('0x11')]},'callerId':{'type':_0x8a58('0x10')},'callbackUrl':{'type':_0x8a58('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'sessionId':{'type':_0x8a58('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':[!![],_0x8a58('0x13')]},'transferNumber':{'type':_0x8a58('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]}});function emit(_0x26e3a8,_0xd967db,_0xddfaae){logger['info'](_0x26e3a8,_0xd967db,JSON['stringify'](_0xddfaae));io['to'](_0x26e3a8)[_0x8a58('0x14')](_0xd967db,_0xddfaae);}function handleError(_0x107e0a){return function(_0x18a14d){console['log'](_0x8a58('0x15'),_0x18a14d,_0x18a14d instanceof RangeError);logger[_0x8a58('0x16')](_0x18a14d['stack']);if(_0x18a14d instanceof RangeError){if(_0x18a14d[_0x8a58('0x17')]){delete _0x18a14d[_0x8a58('0x17')];}_0x107e0a[_0x8a58('0x18')](0x194)[_0x8a58('0x19')](_0x18a14d);}else{if(_0x18a14d[_0x8a58('0x17')]){delete _0x18a14d[_0x8a58('0x17')];}_0x107e0a[_0x8a58('0x18')](0x1f4)[_0x8a58('0x19')](_0x18a14d);}};}function checkError(){return function(_0x92951){if(!_0x92951){throw new RangeError(_0x8a58('0x1a'));}return _0x92951;};}function respondWithRpcPromise(_0xb20cfe,_0x844b58){return new BPromise(function(_0x3758fa,_0x34adb8){var _0x561a9a=amiClient;return _0x561a9a[_0x8a58('0x1b')](_0xb20cfe,_0x844b58)[_0x8a58('0x1c')](function(_0x20a6c5){if(_0x20a6c5[_0x8a58('0x16')]){if(_0x20a6c5[_0x8a58('0x16')][_0x8a58('0x1d')]===0x1f4){return _0x34adb8(_0x20a6c5[_0x8a58('0x16')]['message']);}return _0x3758fa(_0x20a6c5[_0x8a58('0x16')][_0x8a58('0x1e')]);}else{_0x3758fa(_0x20a6c5[_0x8a58('0x1f')]);}})[_0x8a58('0x20')](function(_0x4fb0fb){_0x34adb8(_0x4fb0fb);});});}function getAgent(_0x1e9c3b){return db[_0x8a58('0x21')][_0x8a58('0x22')]({'where':{'id':_0x1e9c3b,'role':'agent'}})[_0x8a58('0x1c')](checkError());}function getAgentCheckSession(_0x31abcc,_0x4426ff){return new BPromise(function(_0x27d7c8,_0x367aec){var _0x3e317f=respondWithRpcPromise(_0x8a58('0x23'));var _0x4d5041=getAgent(_0x31abcc);Promise[_0x8a58('0x24')]([_0x3e317f,_0x4d5041])['then'](function(_0x501aa1){var _0x5e7265=_0x501aa1[0x0];var _0x4cfc96=_0x501aa1[0x1];var _0x5a9c53=_[_0x8a58('0x25')](_0x5e7265[_0x8a58('0x26')],function(_0x1b2d9e){return _0x1b2d9e[_0x8a58('0x27')]==_0x4cfc96['id']&&_0x1b2d9e[_0x8a58('0x28')]==_0x4426ff;});if(_0x5a9c53[_0x8a58('0x29')]==0x1){_0x27d7c8(_0x4cfc96);}else{_0x367aec(new RangeError(_0x8a58('0x2a')+_0x4426ff+_0x8a58('0x2b')));}});});}exports[_0x8a58('0x2c')]=function(_0x3d9e3a,_0x8ab99c){logger[_0x8a58('0x2d')](_0x8a58('0x2e'),_0x3d9e3a['body']);var _0x330e8a=originateValidation[_0x8a58('0xe')](_0x3d9e3a[_0x8a58('0x2f')]);if(_0x330e8a[_0x8a58('0x29')]>0x0){return _0x8ab99c[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x330e8a);}var _0x50c73d=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x25ecd6=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x32')];var _0x264cc7=_0x3d9e3a[_0x8a58('0x2f')]['callerId'];var _0x3d1fb0=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x33')];return getAgent(_0x50c73d)['then'](function(_0x5ecfea){logger['info'](_0x8a58('0x34'),_0x5ecfea[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x5ecfea['name']),_0x8a58('0x37'),{'callNumber':_0x25ecd6,'callerId':_0x264cc7,'callbackUrl':_0x3d1fb0});return _0x8ab99c[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x38')});})['catch'](handleError(_0x8ab99c));};exports[_0x8a58('0x39')]=function(_0x2a7c70,_0x5aad83){logger[_0x8a58('0x2d')](_0x8a58('0x3a'),_0x2a7c70[_0x8a58('0x2f')]);var _0x35d930=hangupValidation[_0x8a58('0xe')](_0x2a7c70[_0x8a58('0x2f')]);if(_0x35d930['length']>0x0){return _0x5aad83['status'](0x190)[_0x8a58('0x30')](_0x35d930);}var _0x31b8fe=_0x2a7c70['body'][_0x8a58('0x31')];var _0x2e1d71=_0x2a7c70[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x31b8fe)[_0x8a58('0x1c')](function(_0x4e9e04){logger[_0x8a58('0x2d')]('entityFound:',_0x4e9e04[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x4e9e04[_0x8a58('0x17')]),_0x8a58('0x3b'),{'sessionId':_0x2e1d71});return _0x5aad83[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x5aad83));};exports[_0x8a58('0x3c')]=function(_0x54e454,_0x53fd19){logger[_0x8a58('0x2d')](_0x8a58('0x3d'),_0x54e454[_0x8a58('0x2f')]);var _0x573cd3=answerValidation['validate'](_0x54e454[_0x8a58('0x2f')]);if(_0x573cd3['length']>0x0){return _0x53fd19[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x573cd3);}var _0x3feec0=_0x54e454[_0x8a58('0x2f')]['userId'];var _0x417951=_0x54e454[_0x8a58('0x2f')]['sessionId'];return getAgent(_0x3feec0)[_0x8a58('0x1c')](function(_0xba52de){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0xba52de['name']);emit(util[_0x8a58('0x35')]('user:%s',_0xba52de[_0x8a58('0x17')]),_0x8a58('0x3e'),{'sessionId':_0x417951});return _0x53fd19['status'](0xc8)[_0x8a58('0x30')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x53fd19));};exports[_0x8a58('0x3f')]=function(_0x417b08,_0x177ba9){logger[_0x8a58('0x2d')](_0x8a58('0x40'),_0x417b08[_0x8a58('0x2f')]);var _0x507423=holdValidation['validate'](_0x417b08[_0x8a58('0x2f')]);if(_0x507423[_0x8a58('0x29')]>0x0){return _0x177ba9[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x507423);}var _0x1ec51b=_0x417b08[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x903c85=_0x417b08[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x1ec51b)[_0x8a58('0x1c')](function(_0x392c32){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x392c32['name']);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x392c32[_0x8a58('0x17')]),_0x8a58('0x41'),{'sessionId':_0x903c85});return _0x177ba9[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x42')});})['catch'](handleError(_0x177ba9));};exports['unhold']=function(_0x5ab682,_0x31e12a){logger[_0x8a58('0x2d')](_0x8a58('0x43'),_0x5ab682['body']);var _0x3883ee=unholdValidation[_0x8a58('0xe')](_0x5ab682[_0x8a58('0x2f')]);if(_0x3883ee[_0x8a58('0x29')]>0x0){return _0x31e12a[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x3883ee);}var _0x22f5aa=_0x5ab682[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x2f48ef=_0x5ab682[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x22f5aa)['then'](function(_0xf44eaa){logger[_0x8a58('0x2d')]('entityFound:',_0xf44eaa[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0xf44eaa['name']),_0x8a58('0x44'),{'sessionId':_0x2f48ef});return _0x31e12a['status'](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x45')});})[_0x8a58('0x20')](handleError(_0x31e12a));};exports[_0x8a58('0x46')]=function(_0x3c7225,_0xfd0229){logger[_0x8a58('0x2d')](_0x8a58('0x47'),_0xfd0229[_0x8a58('0x2f')]);var _0x53fbde=callsValidation[_0x8a58('0xe')](_0x3c7225[_0x8a58('0x2f')]);if(_0x53fbde[_0x8a58('0x29')]>0x0){return _0xfd0229[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x53fbde);}var _0x57adf4=_0x3c7225[_0x8a58('0x2f')][_0x8a58('0x31')];var _0xa01a37=respondWithRpcPromise(_0x8a58('0x23'));var _0x1022d5=getAgent(_0x57adf4);return Promise[_0x8a58('0x24')]([_0xa01a37,_0x1022d5])[_0x8a58('0x1c')](function(_0x38e435){var _0x515f26=_0x38e435[0x0];var _0x415dea=_0x38e435[0x1];var _0xbf6332=_[_0x8a58('0x25')](_0x515f26['rows'],function(_0x229e68){return _0x229e68['UserId']==_0x415dea['id'];});return _0xfd0229[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'count':_0xbf6332[_0x8a58('0x29')],'rows':_0xbf6332});})[_0x8a58('0x20')](handleError(_0xfd0229));};exports[_0x8a58('0x48')]=function(_0x2f653d,_0x1b8292){logger[_0x8a58('0x2d')]('conference\x20fired:',_0x2f653d['body']);var _0x455aeb=conferenceValidation[_0x8a58('0xe')](_0x2f653d[_0x8a58('0x2f')]);if(_0x455aeb[_0x8a58('0x29')]>0x0){return _0x1b8292[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x455aeb);}var _0x1b4f68=_0x2f653d['body'][_0x8a58('0x31')];return getAgent(_0x1b4f68)[_0x8a58('0x1c')](function(_0x493ccd){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x493ccd[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x493ccd[_0x8a58('0x17')]),'webbar:conference');return _0x1b8292[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':'conference\x20executed!'});})[_0x8a58('0x20')](handleError(_0x1b8292));};exports[_0x8a58('0x49')]=function(_0x19e256,_0x26b333){logger['info']('transfer\x20fired:',_0x19e256[_0x8a58('0x2f')]);var _0x5ce699=transferValidation[_0x8a58('0xe')](_0x19e256[_0x8a58('0x2f')]);if(_0x5ce699[_0x8a58('0x29')]>0x0){return _0x26b333[_0x8a58('0x18')](0x190)['json'](_0x5ce699);}var _0xb0b5da=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x371930=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x28')];var _0x9046f1=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x4a')];return getAgent(_0xb0b5da)[_0x8a58('0x1c')](function(_0x318acd){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x318acd['name']);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x318acd[_0x8a58('0x17')]),_0x8a58('0x4b'),{'sessionId':_0x371930,'transferNumber':_0x9046f1});return _0x26b333[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x4c')});})[_0x8a58('0x20')](handleError(_0x26b333));}; \ No newline at end of file +var _0xc3fe=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','status','json','userId','callNumber','callbackUrl','format','user:%s','webbar:originate','hangup','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','defaults','redis','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','request','then','message','catch','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','length'];(function(_0x233798,_0x54a0ad){var _0x27517c=function(_0x14529d){while(--_0x14529d){_0x233798['push'](_0x233798['shift']());}};_0x27517c(++_0x54a0ad);}(_0xc3fe,0xff));var _0xec3f=function(_0x554614,_0x51e831){_0x554614=_0x554614-0x0;var _0x32c089=_0xc3fe[_0x554614];return _0x32c089;};'use strict';var path=require(_0xec3f('0x0'));var fs=require('fs');var _=require(_0xec3f('0x1'));var db=require(_0xec3f('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var jayson=require(_0xec3f('0x5'));var amiClient=jayson['client'][_0xec3f('0x6')]({'port':0x232a});var logger=require(_0xec3f('0x7'))(_0xec3f('0x8'));var Redis=require('ioredis');config['redis']=_[_0xec3f('0x9')](config[_0xec3f('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec3f('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'callNumber':{'type':_0xec3f('0xd'),'required':[!![],_0xec3f('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xec3f('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xec3f('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});function emit(_0x10ff81,_0x5bd7c0,_0x225edd){logger[_0xec3f('0x10')](_0x10ff81,_0x5bd7c0,JSON[_0xec3f('0x11')](_0x225edd));io['to'](_0x10ff81)[_0xec3f('0x12')](_0x5bd7c0,_0x225edd);}function handleError(_0x54d20c){return function(_0x7805c){console[_0xec3f('0x13')](_0xec3f('0x14'),_0x7805c,_0x7805c instanceof RangeError);logger[_0xec3f('0x15')](_0x7805c[_0xec3f('0x16')]);if(_0x7805c instanceof RangeError){if(_0x7805c['name']){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x194)[_0xec3f('0x18')](_0x7805c);}else{if(_0x7805c[_0xec3f('0x17')]){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x1f4)[_0xec3f('0x18')](_0x7805c);}};}function checkError(){return function(_0x21fda1){if(!_0x21fda1){throw new RangeError('NotFound');}return _0x21fda1;};}function respondWithRpcPromise(_0x35fc70,_0x317805){return new BPromise(function(_0x1f173f,_0x395b9a){var _0x4d9598=amiClient;return _0x4d9598[_0xec3f('0x19')](_0x35fc70,_0x317805)[_0xec3f('0x1a')](function(_0x2f45bb){if(_0x2f45bb['error']){if(_0x2f45bb[_0xec3f('0x15')]['code']===0x1f4){return _0x395b9a(_0x2f45bb[_0xec3f('0x15')]['message']);}return _0x1f173f(_0x2f45bb['error'][_0xec3f('0x1b')]);}else{_0x1f173f(_0x2f45bb['result']);}})[_0xec3f('0x1c')](function(_0xa12054){_0x395b9a(_0xa12054);});});}function getAgent(_0x31c7ff){return db['User'][_0xec3f('0x1d')]({'where':{'id':_0x31c7ff,'role':_0xec3f('0x1e')}})['then'](checkError());}function getAgentCheckSession(_0x53cc0d,_0x3e5244){return new BPromise(function(_0x48e166,_0x1300a8){var _0x1b3155=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2eac8d=getAgent(_0x53cc0d);Promise[_0xec3f('0x20')]([_0x1b3155,_0x2eac8d])[_0xec3f('0x1a')](function(_0x2f2d15){var _0x237134=_0x2f2d15[0x0];var _0x56217e=_0x2f2d15[0x1];var _0x1c2a9c=_[_0xec3f('0x21')](_0x237134['rows'],function(_0x91c11a){return _0x91c11a[_0xec3f('0x22')]==_0x56217e['id']&&_0x91c11a[_0xec3f('0x23')]==_0x3e5244;});if(_0x1c2a9c[_0xec3f('0x24')]==0x1){_0x48e166(_0x56217e);}else{_0x1300a8(new RangeError(_0xec3f('0x25')+_0x3e5244+_0xec3f('0x26')));}});});}exports[_0xec3f('0x27')]=function(_0x29af36,_0x32a522){logger[_0xec3f('0x10')](_0xec3f('0x28'),_0x29af36[_0xec3f('0x29')]);var _0x3d95d4=originateValidation[_0xec3f('0x2a')](_0x29af36[_0xec3f('0x29')]);if(_0x3d95d4['length']>0x0){return _0x32a522[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x3d95d4);}var _0x37504a=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x598fdc=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2e')];var _0x20b655=_0x29af36['body']['callerId'];var _0x1aded9=_0x29af36['body'][_0xec3f('0x2f')];return getAgent(_0x37504a)['then'](function(_0x131839){logger['info']('entityFound:',_0x131839[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x131839[_0xec3f('0x17')]),_0xec3f('0x32'),{'callNumber':_0x598fdc,'callerId':_0x20b655,'callbackUrl':_0x1aded9});return _0x32a522[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x32a522));};exports[_0xec3f('0x33')]=function(_0x3bff24,_0xbbb4f9){logger[_0xec3f('0x10')](_0xec3f('0x34'),_0x3bff24[_0xec3f('0x29')]);var _0x4bd7a5=hangupValidation[_0xec3f('0x2a')](_0x3bff24['body']);if(_0x4bd7a5[_0xec3f('0x24')]>0x0){return _0xbbb4f9[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x4bd7a5);}var _0x2d91db=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x54fbb9=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x23')];return getAgent(_0x2d91db)[_0xec3f('0x1a')](function(_0x38a9e3){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x38a9e3['name']);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x38a9e3['name']),_0xec3f('0x36'),{'sessionId':_0x54fbb9});return _0xbbb4f9[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':_0xec3f('0x37')});})[_0xec3f('0x1c')](handleError(_0xbbb4f9));};exports[_0xec3f('0x38')]=function(_0xe96e53,_0xef42fc){logger[_0xec3f('0x10')]('answer\x20fired:',_0xe96e53[_0xec3f('0x29')]);var _0x386e96=answerValidation[_0xec3f('0x2a')](_0xe96e53[_0xec3f('0x29')]);if(_0x386e96[_0xec3f('0x24')]>0x0){return _0xef42fc[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x386e96);}var _0x18c560=_0xe96e53[_0xec3f('0x29')]['userId'];var _0x8d0f18=_0xe96e53['body'][_0xec3f('0x23')];return getAgent(_0x18c560)[_0xec3f('0x1a')](function(_0x33beca){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x33beca[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x33beca[_0xec3f('0x17')]),_0xec3f('0x39'),{'sessionId':_0x8d0f18});return _0xef42fc[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0xef42fc));};exports[_0xec3f('0x3a')]=function(_0x531c21,_0x2e21c7){logger[_0xec3f('0x10')](_0xec3f('0x3b'),_0x531c21[_0xec3f('0x29')]);var _0x50039e=holdValidation['validate'](_0x531c21[_0xec3f('0x29')]);if(_0x50039e[_0xec3f('0x24')]>0x0){return _0x2e21c7['status'](0x190)[_0xec3f('0x2c')](_0x50039e);}var _0x28acd1=_0x531c21[_0xec3f('0x29')]['userId'];var _0x377ff7=_0x531c21['body']['sessionId'];return getAgent(_0x28acd1)['then'](function(_0x97c57d){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x97c57d[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x97c57d['name']),_0xec3f('0x3c'),{'sessionId':_0x377ff7});return _0x2e21c7[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x3d')});})[_0xec3f('0x1c')](handleError(_0x2e21c7));};exports[_0xec3f('0x3e')]=function(_0x515bf2,_0x2ab636){logger['info'](_0xec3f('0x3f'),_0x515bf2['body']);var _0x425d90=unholdValidation['validate'](_0x515bf2[_0xec3f('0x29')]);if(_0x425d90[_0xec3f('0x24')]>0x0){return _0x2ab636[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x425d90);}var _0x5603c8=_0x515bf2[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x10eb47=_0x515bf2['body'][_0xec3f('0x23')];return getAgent(_0x5603c8)[_0xec3f('0x1a')](function(_0x4daab6){logger[_0xec3f('0x10')]('entityFound:',_0x4daab6[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4daab6['name']),_0xec3f('0x40'),{'sessionId':_0x10eb47});return _0x2ab636['status'](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x41')});})[_0xec3f('0x1c')](handleError(_0x2ab636));};exports[_0xec3f('0x42')]=function(_0x2c2b81,_0x24ca77){logger['info'](_0xec3f('0x43'),_0x24ca77['body']);var _0x13825e=callsValidation[_0xec3f('0x2a')](_0x2c2b81[_0xec3f('0x29')]);if(_0x13825e[_0xec3f('0x24')]>0x0){return _0x24ca77[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x13825e);}var _0x1a9073=_0x2c2b81['body'][_0xec3f('0x2d')];var _0x218682=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2e56c8=getAgent(_0x1a9073);return Promise[_0xec3f('0x20')]([_0x218682,_0x2e56c8])[_0xec3f('0x1a')](function(_0x5269b7){var _0x31eb9f=_0x5269b7[0x0];var _0x2a5a1f=_0x5269b7[0x1];var _0x2dc0b8=_[_0xec3f('0x21')](_0x31eb9f[_0xec3f('0x44')],function(_0x59d4cd){return _0x59d4cd[_0xec3f('0x22')]==_0x2a5a1f['id'];});return _0x24ca77[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'count':_0x2dc0b8['length'],'rows':_0x2dc0b8});})[_0xec3f('0x1c')](handleError(_0x24ca77));};exports[_0xec3f('0x45')]=function(_0xced939,_0x5526f5){logger['info']('conference\x20fired:',_0xced939[_0xec3f('0x29')]);var _0x32ecf3=conferenceValidation[_0xec3f('0x2a')](_0xced939['body']);if(_0x32ecf3['length']>0x0){return _0x5526f5[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x32ecf3);}var _0xc69314=_0xced939[_0xec3f('0x29')][_0xec3f('0x2d')];return getAgent(_0xc69314)[_0xec3f('0x1a')](function(_0x4e4361){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x4e4361[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4e4361['name']),'webbar:conference');return _0x5526f5[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5526f5));};exports[_0xec3f('0x46')]=function(_0xfef5e8,_0x5247db){logger[_0xec3f('0x10')]('transfer\x20fired:',_0xfef5e8[_0xec3f('0x29')]);var _0x17ef99=transferValidation[_0xec3f('0x2a')](_0xfef5e8[_0xec3f('0x29')]);if(_0x17ef99['length']>0x0){return _0x5247db[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x17ef99);}var _0x557a8d=_0xfef5e8['body'][_0xec3f('0x2d')];var _0x27c38d=_0xfef5e8['body']['sessionId'];var _0x1f8041=_0xfef5e8[_0xec3f('0x29')][_0xec3f('0x47')];return getAgent(_0x557a8d)['then'](function(_0x53502c){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x53502c[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x53502c[_0xec3f('0x17')]),_0xec3f('0x48'),{'sessionId':_0x27c38d,'transferNumber':_0x1f8041});return _0x5247db[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5247db));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 0c9aa33..313274c 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 _0x93e9=['/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x93e9,0xcc));var _0x993e=function(_0x3255a7,_0x50267c){_0x3255a7=_0x3255a7-0x0;var _0x25ba82=_0x93e9[_0x3255a7];return _0x25ba82;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getDispositions']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x993e('0x9')]('/:id/users',auth[_0x993e('0xa')](),controller['getAgents']);router['get'](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x12')]);router[_0x993e('0x13')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);router[_0x993e('0x13')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller[_0x993e('0x15')]);router[_0x993e('0x13')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x16')]);router[_0x993e('0x13')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller['addAgents']);router[_0x993e('0x13')](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x18')]);router[_0x993e('0x13')](_0x993e('0x19'),controller['notify']);router[_0x993e('0x13')](_0x993e('0x1a'),auth[_0x993e('0xa')](),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0x1d')]);router['delete'](_0x993e('0xd'),auth['isAuthenticated'](),controller[_0x993e('0x1e')]);router[_0x993e('0x1f')](_0x993e('0xf'),auth['isAuthenticated'](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x21')]);router[_0x993e('0x1f')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router; \ No newline at end of file +var _0xf61e=['getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','notify','send','put','/:id','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions'];(function(_0x234acf,_0x5ab170){var _0x10b74b=function(_0x1eb7dd){while(--_0x1eb7dd){_0x234acf['push'](_0x234acf['shift']());}};_0x10b74b(++_0x5ab170);}(_0xf61e,0x191));var _0xef61=function(_0x57a946,_0x2ad1c9){_0x57a946=_0x57a946-0x0;var _0x267f7a=_0xf61e[_0x57a946];return _0x267f7a;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0xb')]('/:id/applications',auth[_0xef61('0xd')](),controller['getApplications']);router[_0xef61('0x16')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x17')]);router[_0xef61('0x16')]('/:id/dispositions',auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x16')](_0xef61('0x12'),auth['isAuthenticated'](),controller[_0xef61('0x19')]);router[_0xef61('0x16')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x1a')]);router[_0xef61('0x16')](_0xef61('0x1b'),auth[_0xef61('0xd')](),controller[_0xef61('0x1c')]);router[_0xef61('0x16')]('/:id/notify',controller[_0xef61('0x1d')]);router[_0xef61('0x16')]('/:id/send',auth[_0xef61('0xd')](),controller[_0xef61('0x1e')]);router[_0xef61('0x1f')](_0xef61('0x20'),auth[_0xef61('0xd')](),controller[_0xef61('0x21')]);router[_0xef61('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0x23')]);router['delete'](_0xef61('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xef61('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef61('0x24')]);router[_0xef61('0x22')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller['removeAgents']);module[_0xef61('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3567359..f573f52 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 _0x7a1a=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x34b48c,_0xe97afa){var _0x3b9957=function(_0x33095d){while(--_0x33095d){_0x34b48c['push'](_0x34b48c['shift']());}};_0x3b9957(++_0xe97afa);}(_0x7a1a,0xd5));var _0xa7a1=function(_0x204cd8,_0x26ef48){_0x204cd8=_0x204cd8-0x0;var _0x1ac385=_0x7a1a[_0x204cd8];return _0x1ac385;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa7a1('0x0'));module[_0xa7a1('0x1')]={'name':{'type':Sequelize[_0xa7a1('0x2')],'unique':_0xa7a1('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa7a1('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa7a1('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa7a1('0x2')],'defaultValue':function(){return rs[_0xa7a1('0x4')]();}},'phone':{'type':Sequelize[_0xa7a1('0x2')]},'type':{'type':Sequelize['ENUM'](_0xa7a1('0x5'),_0xa7a1('0x6'))},'accountSid':{'type':Sequelize[_0xa7a1('0x2')]},'baseUrl':{'type':Sequelize[_0xa7a1('0x2')]},'authToken':{'type':Sequelize[_0xa7a1('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa7a1('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa7a1('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa7a1('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa7a1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa7a1('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa7a1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7a1('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa7a1('0x9')],'comment':_0xa7a1('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa7a1('0xb'),'set':function(_0x5cc5c7){if(!_0x5cc5c7){this[_0xa7a1('0xc')](_0xa7a1('0xd'),null);}this[_0xa7a1('0xc')](_0xa7a1('0xe'),_0x5cc5c7);}},'description':{'type':Sequelize[_0xa7a1('0x2')]}}; \ No newline at end of file +var _0xec2f=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','STRING','name','generate','ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3a715b,_0x3264e1){var _0x1b8de0=function(_0x4d6cbc){while(--_0x4d6cbc){_0x3a715b['push'](_0x3a715b['shift']());}};_0x1b8de0(++_0x3264e1);}(_0xec2f,0x85));var _0xfec2=function(_0xdb3c1b,_0x2a339b){_0xdb3c1b=_0xdb3c1b-0x0;var _0x3e23e0=_0xec2f[_0xdb3c1b];return _0x3e23e0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xfec2('0x0')],'unique':_0xfec2('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xfec2('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0xfec2('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0xfec2('0x0')],'defaultValue':function(){return rs[_0xfec2('0x2')]();}},'phone':{'type':Sequelize[_0xfec2('0x0')]},'type':{'type':Sequelize[_0xfec2('0x3')](_0xfec2('0x4'),'sinch')},'accountSid':{'type':Sequelize[_0xfec2('0x0')]},'baseUrl':{'type':Sequelize[_0xfec2('0x0')]},'authToken':{'type':Sequelize[_0xfec2('0x0')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfec2('0x5');}},'notificationSound':{'type':Sequelize[_0xfec2('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xfec2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfec2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfec2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfec2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfec2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfec2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfec2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xfec2('0x6')],'defaultValue':![],'comment':_0xfec2('0x9'),'set':function(_0x480ad9){if(!_0x480ad9){this['setDataValue'](_0xfec2('0xa'),null);}this[_0xfec2('0xb')](_0xfec2('0xc'),_0x480ad9);}},'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 0f79f84..c4e0867 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 _0xec3b=['map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','WhatsappAccount','includeAll','findAll','catch','show','params','rawAttributes','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','body','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','pick','rows','removeDispositions','ids','CannedAnswer','getAnswers','include','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','stack','finally','send','getApplications','notify','whatsapp','account','sinch','statuses','state','timestamp','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','twilio','From','replace','Body','messageId','MessageSid','notifications','from','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','Messages','dataValues','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause'];(function(_0x1f3b1d,_0x52e366){var _0x7ff69d=function(_0x1f2ecc){while(--_0x1f2ecc){_0x1f3b1d['push'](_0x1f3b1d['shift']());}};_0x7ff69d(++_0x52e366);}(_0xec3b,0x134));var _0xbec3=function(_0x52094b,_0x426ca3){_0x52094b=_0x52094b-0x0;var _0x1e7ffe=_0xec3b[_0x52094b];return _0x1e7ffe;};'use strict';var emlformat=require(_0xbec3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbec3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec3('0x2'));var moment=require(_0xbec3('0x3'));var BPromise=require(_0xbec3('0x4'));var Mustache=require(_0xbec3('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbec3('0x6'));var csv=require(_0xbec3('0x7'));var ejs=require(_0xbec3('0x8'));var fs=require('fs');var fs_extra=require(_0xbec3('0x9'));var _=require('lodash');var squel=require(_0xbec3('0xa'));var crypto=require('crypto');var jsforce=require(_0xbec3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbec3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbec3('0xd'));var qs=require(_0xbec3('0xe'));var as=require(_0xbec3('0xf'));var hardwareService=require(_0xbec3('0x10'));var logger=require(_0xbec3('0x11'))(_0xbec3('0x12'));var utils=require('../../config/utils');var config=require(_0xbec3('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbec3('0x14')]=_[_0xbec3('0x15')](config[_0xbec3('0x14')],{'host':_0xbec3('0x16'),'port':0x18eb});var socket=require(_0xbec3('0x17'))(new Redis(config[_0xbec3('0x14')]));require(_0xbec3('0x18'))[_0xbec3('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbec3('0x1a')][_0xbec3('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x11871a,_0x5b8bf7,_0x3672f5,_0x3109d5){return new BPromise(function(_0x3b4e4b,_0x1205ef){var _0xea6deb=_0x3109d5||client;return _0xea6deb[_0xbec3('0x1c')](_0x11871a,_0x3672f5)[_0xbec3('0x1d')](function(_0x16ee98){logger[_0xbec3('0x1e')](_0xbec3('0x1f'),_0x5b8bf7,_0xbec3('0x20'));logger[_0xbec3('0x21')](_0xbec3('0x22'),_0x5b8bf7,_0xbec3('0x20'),JSON[_0xbec3('0x23')](_0x16ee98));if(_0x16ee98['error']){if(_0x16ee98[_0xbec3('0x24')][_0xbec3('0x25')]===0x1f4){logger[_0xbec3('0x24')](_0xbec3('0x1f'),_0x5b8bf7,_0x16ee98[_0xbec3('0x24')][_0xbec3('0x26')]);return _0x1205ef(_0x16ee98[_0xbec3('0x24')]['message']);}logger[_0xbec3('0x24')](_0xbec3('0x1f'),_0x5b8bf7,_0x16ee98[_0xbec3('0x24')]['message']);return _0x3b4e4b(_0x16ee98[_0xbec3('0x24')][_0xbec3('0x26')]);}else{logger[_0xbec3('0x1e')](_0xbec3('0x1f'),_0x5b8bf7,_0xbec3('0x20'));_0x3b4e4b(_0x16ee98[_0xbec3('0x27')][_0xbec3('0x26')]);}})['catch'](function(_0x10c703){logger[_0xbec3('0x24')](_0xbec3('0x1f'),_0x5b8bf7,_0x10c703);_0x1205ef(_0x10c703);});});}function respondWithStatusCode(_0x26c24a,_0x4d3810){_0x4d3810=_0x4d3810||0xcc;return function(_0x2c5ad8){if(_0x2c5ad8){return _0x26c24a['sendStatus'](_0x4d3810);}return _0x26c24a[_0xbec3('0x28')](_0x4d3810)[_0xbec3('0x29')]();};}function respondWithResult(_0x4a664a,_0x1a6a50){_0x1a6a50=_0x1a6a50||0xc8;return function(_0x422c26){if(_0x422c26){return _0x4a664a['status'](_0x1a6a50)[_0xbec3('0x2a')](_0x422c26);}};}function respondWithFilteredResult(_0x4474af,_0x2a3835){return function(_0x11482f){if(_0x11482f){var _0x5dc596=typeof _0x2a3835[_0xbec3('0x2b')]==='undefined'&&typeof _0x2a3835['limit']===_0xbec3('0x2c');var _0x271489=_0x11482f[_0xbec3('0x2d')];var _0x2882f1=_0x5dc596?0x0:_0x2a3835[_0xbec3('0x2b')];var _0x4e260b=_0x5dc596?_0x11482f[_0xbec3('0x2d')]:_0x2a3835['offset']+_0x2a3835[_0xbec3('0x2e')];var _0x521f49;if(_0x4e260b>=_0x271489){_0x4e260b=_0x271489;_0x521f49=0xc8;}else{_0x521f49=0xce;}_0x4474af[_0xbec3('0x28')](_0x521f49);return _0x4474af[_0xbec3('0x2f')](_0xbec3('0x30'),_0x2882f1+'-'+_0x4e260b+'/'+_0x271489)[_0xbec3('0x2a')](_0x11482f);}return null;};}function patchUpdates(_0x5134c4){return function(_0x51d3fc){try{jsonpatch['apply'](_0x51d3fc,_0x5134c4,!![]);}catch(_0xddc93a){return BPromise[_0xbec3('0x31')](_0xddc93a);}return _0x51d3fc['save']();};}function saveUpdates(_0x1eeab5,_0x512eae){return function(_0x10fd85){if(_0x10fd85){return _0x10fd85[_0xbec3('0x32')](_0x1eeab5)['then'](function(_0x21ab9d){return _0x21ab9d;});}return null;};}function removeEntity(_0x287d62,_0x41939c){return function(_0x4720e5){if(_0x4720e5){return _0x4720e5[_0xbec3('0x33')]()[_0xbec3('0x1d')](function(){var _0x3e0333=_0x4720e5[_0xbec3('0x34')]({'plain':!![]});var _0x556fc4=_0xbec3('0x35');return db[_0xbec3('0x36')]['destroy']({'where':{'type':_0x556fc4,'resourceId':_0x3e0333['id']}})[_0xbec3('0x1d')](function(){return _0x4720e5;});})[_0xbec3('0x1d')](function(){_0x287d62['status'](0xcc)[_0xbec3('0x29')]();});}};}function handleEntityNotFound(_0x4322ed,_0xcdc3cf){return function(_0x37567b){if(!_0x37567b){_0x4322ed[_0xbec3('0x37')](0x194);}return _0x37567b;};}function handleError(_0x5c0639,_0xaf6bca){_0xaf6bca=_0xaf6bca||0x1f4;return function(_0x250cf8){logger[_0xbec3('0x24')](_0x250cf8['stack']);if(_0x250cf8[_0xbec3('0x38')]){delete _0x250cf8[_0xbec3('0x38')];}_0x5c0639[_0xbec3('0x28')](_0xaf6bca)['send'](_0x250cf8);};}exports[_0xbec3('0x39')]=function(_0x245974,_0x16bd7f){var _0x12a5c5={'include':[{'model':db[_0xbec3('0x3a')],'as':_0xbec3('0x3b')}]},_0x1983ad={},_0x50f70c={'count':0x0,'rows':[]};var _0x41845e=_[_0xbec3('0x3c')](db['WhatsappAccount']['rawAttributes'],function(_0x8316c3){return{'name':_0x8316c3[_0xbec3('0x3d')],'type':_0x8316c3[_0xbec3('0x3e')][_0xbec3('0x3f')]};});_0x1983ad[_0xbec3('0x40')]=_[_0xbec3('0x3c')](_0x41845e,'name');_0x1983ad[_0xbec3('0x41')]=_['keys'](_0x245974[_0xbec3('0x41')]);_0x1983ad[_0xbec3('0x42')]=_[_0xbec3('0x43')](_0x1983ad[_0xbec3('0x40')],_0x1983ad['query']);_0x12a5c5[_0xbec3('0x44')]=_[_0xbec3('0x43')](_0x1983ad[_0xbec3('0x40')],qs[_0xbec3('0x45')](_0x245974[_0xbec3('0x41')]['fields']));_0x12a5c5[_0xbec3('0x44')]=_0x12a5c5['attributes'][_0xbec3('0x46')]?_0x12a5c5[_0xbec3('0x44')]:_0x1983ad[_0xbec3('0x40')];if(!_0x245974[_0xbec3('0x41')][_0xbec3('0x47')]('nolimit')){_0x12a5c5[_0xbec3('0x2e')]=qs[_0xbec3('0x2e')](_0x245974[_0xbec3('0x41')][_0xbec3('0x2e')]);_0x12a5c5['offset']=qs[_0xbec3('0x2b')](_0x245974[_0xbec3('0x41')][_0xbec3('0x2b')]);}_0x12a5c5[_0xbec3('0x48')]=qs[_0xbec3('0x49')](_0x245974[_0xbec3('0x41')]['sort']);_0x12a5c5['where']=qs[_0xbec3('0x42')](_['pick'](_0x245974[_0xbec3('0x41')],_0x1983ad[_0xbec3('0x42')]),_0x41845e);if(_0x245974[_0xbec3('0x41')][_0xbec3('0x4a')]){_0x12a5c5[_0xbec3('0x4b')]=_[_0xbec3('0x4c')](_0x12a5c5['where'],{'$or':_['map'](_0x41845e,function(_0x31ab5a){if(_0x31ab5a[_0xbec3('0x3e')]!=='VIRTUAL'){var _0x35018c={};_0x35018c[_0x31ab5a[_0xbec3('0x38')]]={'$like':'%'+_0x245974['query']['filter']+'%'};return _0x35018c;}})});}_0x12a5c5=_['merge']({},_0x12a5c5,_0x245974[_0xbec3('0x4d')]);var _0x33eccf={'where':_0x12a5c5[_0xbec3('0x4b')]};return db[_0xbec3('0x4e')][_0xbec3('0x2d')](_0x33eccf)[_0xbec3('0x1d')](function(_0x51637d){_0x50f70c[_0xbec3('0x2d')]=_0x51637d;if(_0x245974[_0xbec3('0x41')][_0xbec3('0x4f')]){_0x12a5c5['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xbec3('0x50')](_0x12a5c5);})[_0xbec3('0x1d')](function(_0x14615e){_0x50f70c['rows']=_0x14615e;return _0x50f70c;})[_0xbec3('0x1d')](respondWithFilteredResult(_0x16bd7f,_0x12a5c5))[_0xbec3('0x51')](handleError(_0x16bd7f,null));};exports[_0xbec3('0x52')]=function(_0x15cf95,_0x14f1c2){var _0x5e1cc6={'raw':![],'where':{'id':_0x15cf95[_0xbec3('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xbec3('0x3b')}]},_0x205656={};_0x205656[_0xbec3('0x40')]=_['keys'](db[_0xbec3('0x4e')][_0xbec3('0x54')]);_0x205656[_0xbec3('0x41')]=_[_0xbec3('0x55')](_0x15cf95[_0xbec3('0x41')]);_0x205656[_0xbec3('0x42')]=_[_0xbec3('0x43')](_0x205656[_0xbec3('0x40')],_0x205656['query']);_0x5e1cc6[_0xbec3('0x44')]=_[_0xbec3('0x43')](_0x205656[_0xbec3('0x40')],qs['fields'](_0x15cf95[_0xbec3('0x41')][_0xbec3('0x45')]));_0x5e1cc6[_0xbec3('0x44')]=_0x5e1cc6[_0xbec3('0x44')][_0xbec3('0x46')]?_0x5e1cc6[_0xbec3('0x44')]:_0x205656[_0xbec3('0x40')];if(_0x15cf95[_0xbec3('0x41')]['includeAll']){_0x5e1cc6['include']=[{'all':!![]}];}_0x5e1cc6=_[_0xbec3('0x4c')]({},_0x5e1cc6,_0x15cf95[_0xbec3('0x4d')]);return db['WhatsappAccount']['find'](_0x5e1cc6)[_0xbec3('0x1d')](handleEntityNotFound(_0x14f1c2,null))[_0xbec3('0x1d')](respondWithResult(_0x14f1c2,null))[_0xbec3('0x51')](handleError(_0x14f1c2,null));};exports[_0xbec3('0x56')]=function(_0xd297b1,_0x219821){return db[_0xbec3('0x4e')]['create'](_0xd297b1['body'],{})['then'](function(_0x33aade){var _0x50ee0b=_0xd297b1[_0xbec3('0x57')][_0xbec3('0x34')]({'plain':!![]});if(!_0x50ee0b)throw new Error(_0xbec3('0x58'));if(_0x50ee0b['role']===_0xbec3('0x57')){var _0x404d32=_0x33aade[_0xbec3('0x34')]({'plain':!![]});var _0x5690c3=_0xbec3('0x35');return db['UserProfileSection'][_0xbec3('0x59')]({'where':{'name':_0x5690c3,'userProfileId':_0x50ee0b['userProfileId']},'raw':!![]})[_0xbec3('0x1d')](function(_0x1d82e0){if(_0x1d82e0&&_0x1d82e0[_0xbec3('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x404d32[_0xbec3('0x38')],'resourceId':_0x404d32['id'],'type':_0x1d82e0['name'],'sectionId':_0x1d82e0['id']},{})[_0xbec3('0x1d')](function(){return _0x33aade;});}else{return _0x33aade;}})['catch'](function(_0x5c217a){logger[_0xbec3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c217a);throw _0x5c217a;});}return _0x33aade;})[_0xbec3('0x1d')](respondWithResult(_0x219821,0xc9))[_0xbec3('0x51')](handleError(_0x219821,null));};exports[_0xbec3('0x32')]=function(_0x4fe9d7,_0xd5590d){if(_0x4fe9d7[_0xbec3('0x5b')]['id']){delete _0x4fe9d7['body']['id'];}return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x4fe9d7[_0xbec3('0x53')]['id']},'include':[{'model':db[_0xbec3('0x3a')],'as':_0xbec3('0x3b')}]})[_0xbec3('0x1d')](handleEntityNotFound(_0xd5590d,null))[_0xbec3('0x1d')](saveUpdates(_0x4fe9d7[_0xbec3('0x5b')],null))[_0xbec3('0x1d')](respondWithResult(_0xd5590d,null))[_0xbec3('0x51')](handleError(_0xd5590d,null));};exports[_0xbec3('0x33')]=function(_0x5bea88,_0x430936){return db['WhatsappAccount']['find']({'where':{'id':_0x5bea88[_0xbec3('0x53')]['id']}})['then'](handleEntityNotFound(_0x430936,null))[_0xbec3('0x1d')](removeEntity(_0x430936,null))[_0xbec3('0x51')](handleError(_0x430936,null));};exports['describe']=function(_0x43ff0c,_0x230c7a){return db[_0xbec3('0x4e')]['describe']()[_0xbec3('0x1d')](respondWithResult(_0x230c7a,null))[_0xbec3('0x51')](handleError(_0x230c7a,null));};exports['addDisposition']=function(_0xb27827,_0x66324d,_0x1e3133){if(_0xb27827[_0xbec3('0x5b')]['id']){delete _0xb27827['body']['id'];}return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0xb27827[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x66324d,null))[_0xbec3('0x1d')](function(_0x4d2117){if(_0x4d2117){_0xb27827[_0xbec3('0x5b')][_0xbec3('0x5c')]=_0x4d2117['id'];return db[_0xbec3('0x5d')]['create'](_0xb27827[_0xbec3('0x5b')]);}})[_0xbec3('0x1d')](respondWithResult(_0x66324d,null))[_0xbec3('0x51')](handleError(_0x66324d,null));};exports[_0xbec3('0x5e')]=function(_0x3608ba,_0x1232c6,_0x21e2a7){var _0x3870d7={'raw':![],'where':{}};var _0x144525={};var _0x3401b6={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xbec3('0x5f')]({'where':{'id':_0x3608ba[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x1232c6,null))[_0xbec3('0x1d')](function(_0x444fa3){if(_0x444fa3){_0x144525['model']=_[_0xbec3('0x55')](db[_0xbec3('0x5d')]['rawAttributes']);_0x144525[_0xbec3('0x41')]=_[_0xbec3('0x55')](_0x3608ba[_0xbec3('0x41')]);_0x144525[_0xbec3('0x42')]=_[_0xbec3('0x43')](_0x144525[_0xbec3('0x40')],_0x144525['query']);_0x3870d7[_0xbec3('0x44')]=_[_0xbec3('0x43')](_0x144525['model'],qs[_0xbec3('0x45')](_0x3608ba[_0xbec3('0x41')]['fields']));_0x3870d7['attributes']=_0x3870d7['attributes'][_0xbec3('0x46')]?_0x3870d7[_0xbec3('0x44')]:_0x144525[_0xbec3('0x40')];if(!_0x3608ba[_0xbec3('0x41')][_0xbec3('0x47')](_0xbec3('0x60'))){_0x3870d7[_0xbec3('0x2e')]=qs[_0xbec3('0x2e')](_0x3608ba[_0xbec3('0x41')][_0xbec3('0x2e')]);_0x3870d7['offset']=qs['offset'](_0x3608ba[_0xbec3('0x41')][_0xbec3('0x2b')]);}_0x3870d7[_0xbec3('0x48')]=qs[_0xbec3('0x49')](_0x3608ba[_0xbec3('0x41')][_0xbec3('0x49')]);_0x3870d7[_0xbec3('0x4b')]=qs[_0xbec3('0x42')](_[_0xbec3('0x61')](_0x3608ba['query'],_0x144525[_0xbec3('0x42')]));_0x3870d7[_0xbec3('0x4b')][_0xbec3('0x5c')]=_0x444fa3['id'];if(_0x3608ba[_0xbec3('0x41')][_0xbec3('0x4a')]){_0x3870d7['where']=_[_0xbec3('0x4c')](_0x3870d7[_0xbec3('0x4b')],{'$or':_[_0xbec3('0x3c')](_0x3870d7['attributes'],function(_0x5194ef){var _0x5d7ea0={};_0x5d7ea0[_0x5194ef]={'$like':'%'+_0x3608ba[_0xbec3('0x41')][_0xbec3('0x4a')]+'%'};return _0x5d7ea0;})});}_0x3870d7=_[_0xbec3('0x4c')]({},_0x3870d7,_0x3608ba[_0xbec3('0x4d')]);return db['Disposition'][_0xbec3('0x2d')]({'where':_0x3870d7[_0xbec3('0x4b')]})[_0xbec3('0x1d')](function(_0x9ab870){_0x3401b6[_0xbec3('0x2d')]=_0x9ab870;if(_0x3608ba[_0xbec3('0x41')][_0xbec3('0x4f')]){_0x3870d7['include']=[{'all':!![]}];}return db['Disposition'][_0xbec3('0x50')](_0x3870d7);})[_0xbec3('0x1d')](function(_0x498a4d){_0x3401b6[_0xbec3('0x62')]=_0x498a4d;return _0x3401b6;});}})[_0xbec3('0x1d')](respondWithFilteredResult(_0x1232c6,_0x3870d7))['catch'](handleError(_0x1232c6,null));};exports[_0xbec3('0x63')]=function(_0x301408,_0x538dd7,_0x1fd40f){return db['WhatsappAccount']['find']({'where':{'id':_0x301408['params']['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x538dd7,null))['then'](function(_0x57fc7a){if(_0x57fc7a){return _0x57fc7a[_0xbec3('0x63')](_0x301408[_0xbec3('0x41')][_0xbec3('0x64')]);}})[_0xbec3('0x1d')](respondWithStatusCode(_0x538dd7,null))[_0xbec3('0x51')](handleError(_0x538dd7,null));};exports['addAnswer']=function(_0x20c14d,_0x1f4248,_0x2fed0b){if(_0x20c14d[_0xbec3('0x5b')]['id']){delete _0x20c14d[_0xbec3('0x5b')]['id'];}return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x20c14d[_0xbec3('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f4248,null))[_0xbec3('0x1d')](function(_0x1ab955){if(_0x1ab955){_0x20c14d[_0xbec3('0x5b')][_0xbec3('0x5c')]=_0x1ab955['id'];return db[_0xbec3('0x65')]['create'](_0x20c14d['body']);}})[_0xbec3('0x1d')](respondWithResult(_0x1f4248,null))[_0xbec3('0x51')](handleError(_0x1f4248,null));};exports[_0xbec3('0x66')]=function(_0x12f13b,_0x507519,_0x31d146){var _0x4932b8={'raw':![],'where':{}};var _0x5b9816={};var _0x2cc715={'count':0x0,'rows':[]};return db[_0xbec3('0x4e')]['findOne']({'where':{'id':_0x12f13b[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x507519,null))[_0xbec3('0x1d')](function(_0x43cf2f){if(_0x43cf2f){_0x5b9816[_0xbec3('0x40')]=_[_0xbec3('0x55')](db['CannedAnswer'][_0xbec3('0x54')]);_0x5b9816[_0xbec3('0x41')]=_[_0xbec3('0x55')](_0x12f13b[_0xbec3('0x41')]);_0x5b9816['filters']=_[_0xbec3('0x43')](_0x5b9816[_0xbec3('0x40')],_0x5b9816[_0xbec3('0x41')]);_0x4932b8[_0xbec3('0x44')]=_['intersection'](_0x5b9816[_0xbec3('0x40')],qs['fields'](_0x12f13b[_0xbec3('0x41')]['fields']));_0x4932b8[_0xbec3('0x44')]=_0x4932b8[_0xbec3('0x44')][_0xbec3('0x46')]?_0x4932b8[_0xbec3('0x44')]:_0x5b9816[_0xbec3('0x40')];if(!_0x12f13b[_0xbec3('0x41')]['hasOwnProperty']('nolimit')){_0x4932b8[_0xbec3('0x2e')]=qs['limit'](_0x12f13b[_0xbec3('0x41')][_0xbec3('0x2e')]);_0x4932b8[_0xbec3('0x2b')]=qs[_0xbec3('0x2b')](_0x12f13b[_0xbec3('0x41')][_0xbec3('0x2b')]);}_0x4932b8[_0xbec3('0x48')]=qs[_0xbec3('0x49')](_0x12f13b['query'][_0xbec3('0x49')]);_0x4932b8[_0xbec3('0x4b')]=qs['filters'](_['pick'](_0x12f13b[_0xbec3('0x41')],_0x5b9816['filters']));_0x4932b8[_0xbec3('0x4b')][_0xbec3('0x5c')]=_0x43cf2f['id'];if(_0x12f13b[_0xbec3('0x41')]['filter']){_0x4932b8[_0xbec3('0x4b')]=_[_0xbec3('0x4c')](_0x4932b8[_0xbec3('0x4b')],{'$or':_[_0xbec3('0x3c')](_0x4932b8[_0xbec3('0x44')],function(_0x4238f7){var _0x3b8d9a={};_0x3b8d9a[_0x4238f7]={'$like':'%'+_0x12f13b[_0xbec3('0x41')][_0xbec3('0x4a')]+'%'};return _0x3b8d9a;})});}_0x4932b8=_['merge']({},_0x4932b8,_0x12f13b[_0xbec3('0x4d')]);return db[_0xbec3('0x65')][_0xbec3('0x2d')]({'where':_0x4932b8['where']})[_0xbec3('0x1d')](function(_0x43d621){_0x2cc715[_0xbec3('0x2d')]=_0x43d621;if(_0x12f13b[_0xbec3('0x41')][_0xbec3('0x4f')]){_0x4932b8[_0xbec3('0x67')]=[{'all':!![]}];}return db[_0xbec3('0x65')]['findAll'](_0x4932b8);})['then'](function(_0x227fb2){_0x2cc715[_0xbec3('0x62')]=_0x227fb2;return _0x2cc715;});}})['then'](respondWithFilteredResult(_0x507519,_0x4932b8))[_0xbec3('0x51')](handleError(_0x507519,null));};exports[_0xbec3('0x68')]=function(_0x189955,_0x1766ed,_0x65b1b1){return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x189955[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x1766ed,null))[_0xbec3('0x1d')](function(_0x3111af){if(_0x3111af){return _0x3111af[_0xbec3('0x68')](_0x189955['query']['ids']);}})[_0xbec3('0x1d')](respondWithStatusCode(_0x1766ed,null))[_0xbec3('0x51')](handleError(_0x1766ed,null));};exports[_0xbec3('0x69')]=function(_0x4aafdc,_0x524471,_0x3f3003){return db['WhatsappAccount']['find']({'where':{'id':_0x4aafdc[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x524471,null))[_0xbec3('0x1d')](function(_0x54553b){if(_0x54553b){return _0x54553b[_0xbec3('0x69')](_0x4aafdc[_0xbec3('0x5b')][_0xbec3('0x64')],_[_0xbec3('0x6a')](_0x4aafdc[_0xbec3('0x5b')],[_0xbec3('0x64'),'id'])||{})['spread'](function(_0x41b399){for(var _0x585138=0x0;_0x585138<_0x4aafdc[_0xbec3('0x5b')][_0xbec3('0x64')][_0xbec3('0x46')];_0x585138+=0x1){socket[_0xbec3('0x6b')]('userWhatsappAccount:save',{'UserId':Number(_0x4aafdc['body'][_0xbec3('0x64')][_0x585138]),'WhatsappAccountId':Number(_0x4aafdc[_0xbec3('0x53')]['id'])});}return _0x41b399;});}})[_0xbec3('0x1d')](respondWithResult(_0x524471,null))[_0xbec3('0x51')](handleError(_0x524471,null));};exports['removeAgents']=function(_0x416bcb,_0x4a0b88,_0xc96962){return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x416bcb['params']['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x4a0b88,null))[_0xbec3('0x1d')](function(_0x52a305){if(_0x52a305){return _0x52a305[_0xbec3('0x6c')](_0x416bcb[_0xbec3('0x41')]['ids'])[_0xbec3('0x1d')](function(){if(_[_0xbec3('0x6d')](_0x416bcb['query'][_0xbec3('0x64')])){for(var _0x19e058=0x0;_0x19e058<_0x416bcb[_0xbec3('0x41')]['ids']['length'];_0x19e058+=0x1){socket[_0xbec3('0x6b')]('userWhatsappAccount:remove',{'UserId':Number(_0x416bcb[_0xbec3('0x41')]['ids'][_0x19e058]),'WhatsappAccountId':Number(_0x416bcb[_0xbec3('0x53')]['id'])});}}else{socket['emit'](_0xbec3('0x6e'),{'UserId':Number(_0x416bcb[_0xbec3('0x41')]['ids']),'WhatsappAccountId':Number(_0x416bcb[_0xbec3('0x53')]['id'])});}});}})[_0xbec3('0x1d')](respondWithStatusCode(_0x4a0b88,null))['catch'](handleError(_0x4a0b88,null));};exports[_0xbec3('0x6f')]=function(_0x3faf21,_0x4023c3,_0x460eb7){var _0x37ccb8={};var _0xe31674={};var _0x593d69;var _0x86dc82;return db[_0xbec3('0x4e')][_0xbec3('0x5f')]({'where':{'id':_0x3faf21[_0xbec3('0x53')]['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x4023c3,null))[_0xbec3('0x1d')](function(_0x535b3b){if(_0x535b3b){_0x593d69=_0x535b3b;_0xe31674[_0xbec3('0x40')]=_[_0xbec3('0x55')](db[_0xbec3('0x70')][_0xbec3('0x54')]);_0xe31674[_0xbec3('0x41')]=_['keys'](_0x3faf21['query']);_0xe31674[_0xbec3('0x42')]=_[_0xbec3('0x43')](_0xe31674[_0xbec3('0x40')],_0xe31674[_0xbec3('0x41')]);_0x37ccb8[_0xbec3('0x44')]=_['intersection'](_0xe31674[_0xbec3('0x40')],qs[_0xbec3('0x45')](_0x3faf21[_0xbec3('0x41')][_0xbec3('0x45')]));_0x37ccb8[_0xbec3('0x44')]=_0x37ccb8['attributes'][_0xbec3('0x46')]?_0x37ccb8['attributes']:_0xe31674['model'];_0x37ccb8[_0xbec3('0x48')]=qs[_0xbec3('0x49')](_0x3faf21[_0xbec3('0x41')][_0xbec3('0x49')]);_0x37ccb8[_0xbec3('0x4b')]=qs[_0xbec3('0x42')](_[_0xbec3('0x61')](_0x3faf21[_0xbec3('0x41')],_0xe31674[_0xbec3('0x42')]));if(_0x3faf21['query'][_0xbec3('0x4a')]){_0x37ccb8[_0xbec3('0x4b')]=_[_0xbec3('0x4c')](_0x37ccb8[_0xbec3('0x4b')],{'$or':_[_0xbec3('0x3c')](_0x37ccb8['attributes'],function(_0x5b8ca9){var _0x438fc0={};_0x438fc0[_0x5b8ca9]={'$like':'%'+_0x3faf21[_0xbec3('0x41')][_0xbec3('0x4a')]+'%'};return _0x438fc0;})});}_0x37ccb8=_[_0xbec3('0x4c')]({},_0x37ccb8,_0x3faf21[_0xbec3('0x4d')]);return _0x593d69['getAgents'](_0x37ccb8);}})[_0xbec3('0x1d')](function(_0x366b28){if(_0x366b28){_0x86dc82=_0x366b28[_0xbec3('0x46')];if(!_0x3faf21[_0xbec3('0x41')][_0xbec3('0x47')](_0xbec3('0x60'))){_0x37ccb8[_0xbec3('0x2e')]=qs['limit'](_0x3faf21[_0xbec3('0x41')][_0xbec3('0x2e')]);_0x37ccb8[_0xbec3('0x2b')]=qs[_0xbec3('0x2b')](_0x3faf21['query'][_0xbec3('0x2b')]);}return _0x593d69[_0xbec3('0x6f')](_0x37ccb8);}})[_0xbec3('0x1d')](function(_0xe9941e){if(_0xe9941e){return _0xe9941e?{'count':_0x86dc82,'rows':_0xe9941e}:null;}})[_0xbec3('0x1d')](respondWithResult(_0x4023c3,null))[_0xbec3('0x51')](handleError(_0x4023c3,null));};exports[_0xbec3('0x71')]=function(_0xddeb6c,_0x3df02c){var _0x26e1db=_0xddeb6c[_0xbec3('0x53')]['id'];var _0x2f4cae=_0xddeb6c[_0xbec3('0x5b')];var _0x49511b=0xc8;var _0x1c174a=null;return db['sequelize'][_0xbec3('0x72')]({'isolationLevel':db[_0xbec3('0x73')][_0xbec3('0x74')][_0xbec3('0x75')][_0xbec3('0x76')]},function(_0x448728){return db[_0xbec3('0x4e')]['findOne']({'where':{'id':_0x26e1db},'transaction':_0x448728})[_0xbec3('0x1d')](function(_0x22c725){if(_0x22c725){return db['WhatsappApplication'][_0xbec3('0x33')]({'where':{'WhatsappAccountId':_0x26e1db},'transaction':_0x448728})[_0xbec3('0x1d')](function(){var _0x211eec=_['map'](_0x2f4cae,function(_0xe2c11b){_0xe2c11b[_0xbec3('0x5c')]=_0x26e1db;return _0xe2c11b;});return db[_0xbec3('0x77')][_0xbec3('0x78')](_0x211eec,{'transaction':_0x448728});});}else{_0x49511b=0x194;_0x1c174a=[];}});})['then'](function(){if(_0x49511b!==0x194){return db[_0xbec3('0x77')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x26e1db},'order':_0xbec3('0x79')})[_0xbec3('0x1d')](function(_0x24c6a1){_0x1c174a=_0x24c6a1;});}})[_0xbec3('0x51')](function(_0x27abe2){_0x49511b=0x1f4;logger[_0xbec3('0x24')](_0x27abe2[_0xbec3('0x7a')]);if(_0x27abe2[_0xbec3('0x38')]){delete _0x27abe2[_0xbec3('0x38')];}_0x1c174a=_0x27abe2;})[_0xbec3('0x7b')](function(){if(_0x1c174a===null){_0x3df02c[_0xbec3('0x37')](_0x49511b);}else{if(_0x49511b===0x1f4){_0x3df02c[_0xbec3('0x28')](_0x49511b)[_0xbec3('0x7c')](_0x1c174a);}else{_0x3df02c[_0xbec3('0x28')](_0x49511b)[_0xbec3('0x2a')](_0x1c174a);}}});};exports[_0xbec3('0x7d')]=function(_0x304bd2,_0x55622e,_0x17e085){var _0x452fd0={};var _0x421876={};var _0x1ae929;var _0x2123e1;return db['WhatsappAccount'][_0xbec3('0x5f')]({'where':{'id':_0x304bd2['params']['id']}})[_0xbec3('0x1d')](handleEntityNotFound(_0x55622e,null))['then'](function(_0x431e9d){if(_0x431e9d){_0x1ae929=_0x431e9d;_0x421876[_0xbec3('0x40')]=_['keys'](db[_0xbec3('0x77')][_0xbec3('0x54')]);_0x421876['query']=_[_0xbec3('0x55')](_0x304bd2[_0xbec3('0x41')]);_0x421876[_0xbec3('0x42')]=_[_0xbec3('0x43')](_0x421876[_0xbec3('0x40')],_0x421876['query']);_0x452fd0[_0xbec3('0x44')]=_[_0xbec3('0x43')](_0x421876[_0xbec3('0x40')],qs['fields'](_0x304bd2[_0xbec3('0x41')][_0xbec3('0x45')]));_0x452fd0[_0xbec3('0x44')]=_0x452fd0[_0xbec3('0x44')][_0xbec3('0x46')]?_0x452fd0[_0xbec3('0x44')]:_0x421876[_0xbec3('0x40')];_0x452fd0[_0xbec3('0x48')]=qs[_0xbec3('0x49')](_0x304bd2[_0xbec3('0x41')][_0xbec3('0x49')]);_0x452fd0['where']=qs['filters'](_[_0xbec3('0x61')](_0x304bd2[_0xbec3('0x41')],_0x421876[_0xbec3('0x42')]));if(_0x304bd2[_0xbec3('0x41')][_0xbec3('0x4a')]){_0x452fd0[_0xbec3('0x4b')]=_[_0xbec3('0x4c')](_0x452fd0[_0xbec3('0x4b')],{'$or':_['map'](_0x452fd0['attributes'],function(_0x2d65d5){var _0x1bdf38={};_0x1bdf38[_0x2d65d5]={'$like':'%'+_0x304bd2[_0xbec3('0x41')][_0xbec3('0x4a')]+'%'};return _0x1bdf38;})});}_0x452fd0=_[_0xbec3('0x4c')]({},_0x452fd0,_0x304bd2[_0xbec3('0x4d')]);return _0x1ae929[_0xbec3('0x7d')](_0x452fd0);}})['then'](function(_0x3c8dcc){if(_0x3c8dcc){_0x2123e1=_0x3c8dcc[_0xbec3('0x46')];if(!_0x304bd2[_0xbec3('0x41')]['hasOwnProperty'](_0xbec3('0x60'))){_0x452fd0[_0xbec3('0x2e')]=qs[_0xbec3('0x2e')](_0x304bd2[_0xbec3('0x41')][_0xbec3('0x2e')]);_0x452fd0['offset']=qs[_0xbec3('0x2b')](_0x304bd2['query'][_0xbec3('0x2b')]);}return _0x1ae929[_0xbec3('0x7d')](_0x452fd0);}})[_0xbec3('0x1d')](function(_0x366e77){if(_0x366e77){return _0x366e77?{'count':_0x2123e1,'rows':_0x366e77}:null;}})[_0xbec3('0x1d')](respondWithResult(_0x55622e,null))['catch'](handleError(_0x55622e,null));};exports[_0xbec3('0x7e')]=function(_0x9377ae,_0x3d348d,_0x404ba7){var _0x5d1769={'channel':_0xbec3('0x7f')};var _0x9d11c8=[];var _0x5a35eb=[];var _0x1acade={};return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x9377ae[_0xbec3('0x53')]['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x3d348d,null))['then'](function(_0x3bb7fd){_0x5d1769['account']=_0x3bb7fd;if(_0x5d1769[_0xbec3('0x80')]&&_0x5d1769[_0xbec3('0x80')]['type']===_0xbec3('0x81')&&_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x82')]){if(_0x9377ae['body']['statuses'][_0xbec3('0x46')]===0x0)return;if(_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x82')][0x0][_0xbec3('0x83')]!=='read')return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x82')][0x0][_0xbec3('0x84')]},{'where':{'messageId':_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x82')][0x0][_0xbec3('0x85')]},'individualHooks':!![]})['then'](function(_0x133033){return _0x3d348d['status'](0xc8)[_0xbec3('0x2a')](_0x133033);});}_0x5d1769[_0xbec3('0x86')]=_[_0xbec3('0x87')](_0x3bb7fd[_0xbec3('0x88')],['priority'],[_0xbec3('0x89')]);if(_0x5d1769[_0xbec3('0x80')]['Applications']){delete _0x5d1769[_0xbec3('0x80')][_0xbec3('0x88')];}return db[_0xbec3('0x8a')]['describe']()['then'](function(_0x235916){if(!_0x235916){throw new db[(_0xbec3('0x8b'))][(_0xbec3('0x8c'))](_0xbec3('0x8d'));}_0x9d11c8=_[_0xbec3('0x8e')](_[_0xbec3('0x55')](_0x235916),['createdAt',_0xbec3('0x8f')]);_0x5a35eb=_[_0xbec3('0x8e')](_['keys'](_0x235916),['createdAt','updatedAt',_0xbec3('0x90'),'ListId']);_0x5d1769[_0xbec3('0x5b')]={'mapKey':'mobile'};if(_0x5d1769[_0xbec3('0x80')]&&_0x5d1769[_0xbec3('0x80')][_0xbec3('0x3e')]===_0xbec3('0x91')){_0x5d1769[_0xbec3('0x5b')]['from']=_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x92')][_0xbec3('0x93')]('whatsapp:','');_0x5d1769[_0xbec3('0x5b')]['body']=_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x94')];_0x5d1769['body'][_0xbec3('0x95')]=_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x96')];}if(_0x5d1769[_0xbec3('0x80')]&&_0x5d1769[_0xbec3('0x80')][_0xbec3('0x3e')]==='sinch'){_0x5d1769[_0xbec3('0x5b')]['from']=_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x97')][0x0][_0xbec3('0x98')];_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x5b')]=_0x9377ae[_0xbec3('0x5b')][_0xbec3('0x97')][0x0]['message']['body'];_0x5d1769['body'][_0xbec3('0x95')]=_0x9377ae['body'][_0xbec3('0x97')][0x0][_0xbec3('0x85')];}if(_0x5d1769[_0xbec3('0x5b')]['id']){delete _0x5d1769[_0xbec3('0x5b')]['id'];}if(_['isNil'](_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x98')])){throw new db[(_0xbec3('0x8b'))][(_0xbec3('0x8c'))]('from\x20is\x20mandatory');}if(_[_0xbec3('0x99')](_0x5d1769['body'][_0xbec3('0x5b')])||_0x5d1769['body'][_0xbec3('0x5b')]===''){throw new db[(_0xbec3('0x8b'))][(_0xbec3('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x9a')])){throw new db[(_0xbec3('0x8b'))][(_0xbec3('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a35eb);}if(!_['includes'](_0x5a35eb,_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x9a')])){throw new db[(_0xbec3('0x8b'))]['ValidationError'](_0xbec3('0x9b')+_0x5a35eb);}_0x1acade[_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x9a')]]=_0x5d1769['body'][_0xbec3('0x98')];return db['CmList'][_0xbec3('0x59')]({'where':{'id':_0x5d1769[_0xbec3('0x80')][_0xbec3('0x9c')]},'include':[{'model':db[_0xbec3('0x8a')],'as':_0xbec3('0x9d'),'where':_0x1acade,'limit':0x1,'order':[[_0xbec3('0x8f'),_0xbec3('0x9e')]]}]});})['then'](handleEntityNotFound(_0x3d348d,null))['then'](function(_0x52606e){if(_0x52606e){_0x5d1769['list']=_[_0xbec3('0x6a')](_0x52606e,[_0xbec3('0x9d')]);if(_0x52606e[_0xbec3('0x9d')]['length']){return _0x52606e[_0xbec3('0x9d')][0x0];}var _0x3ca6db=_['defaults'](_0x5d1769[_0xbec3('0x5b')],{'firstName':_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x98')],'ListId':_0x52606e['id']});_0x3ca6db[_0x5d1769['body'][_0xbec3('0x9a')]]=_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x98')];return db['CmContact']['create'](_0x3ca6db,{'fields':_0x9d11c8,'raw':!![]});}})[_0xbec3('0x1d')](handleEntityNotFound(_0x3d348d,null))['then'](function(_0x43474e){if(_0x43474e){_0x5d1769[_0xbec3('0x9f')]=_0x43474e;var _0x37aa36={'ContactId':_0x43474e['id'],'phone':_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x98')],'WhatsappAccountId':_0x9377ae['params']['id']};var _0x32c6be={'ContactId':_0x43474e['id'],'WhatsappAccountId':_0x9377ae[_0xbec3('0x53')]['id'],'closed':![]};return db[_0xbec3('0xa0')]['find']({'where':_0x32c6be})[_0xbec3('0x1d')](function(_0x300e21){if(_0x300e21){return[_0x300e21,![]];}return db[_0xbec3('0xa0')][_0xbec3('0x56')](_0x37aa36)[_0xbec3('0x1d')](function(_0x5495e1){return[_0x5495e1,!![]];});});}})[_0xbec3('0xa1')](function(_0x4e7b5b,_0x5a28db){_0x5d1769[_0xbec3('0xa2')]=_0x4e7b5b['get']({'plain':!![]});_0x5d1769[_0xbec3('0xa2')][_0xbec3('0xa3')]=![];if(_0x5a28db){if(_0x5d1769[_0xbec3('0x80')][_0xbec3('0xa4')]){_0x5d1769[_0xbec3('0x86')][_0xbec3('0xa5')]({'id':0x0,'priority':_0x5d1769[_0xbec3('0x86')][_0xbec3('0x46')]+0x1,'app':_0xbec3('0xa6'),'appdata':_0xbec3('0xa7'),'interval':_0xbec3('0xa8')});}_0x5d1769[_0xbec3('0xa2')][_0xbec3('0xa3')]=!![];}return db[_0xbec3('0xa9')][_0xbec3('0x56')]({'phone':_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x98')],'messageId':_0x5d1769[_0xbec3('0x5b')][_0xbec3('0x95')],'body':_0x5d1769['body'][_0xbec3('0x5b')],'WhatsappAccountId':_0x9377ae[_0xbec3('0x53')]['id'],'WhatsappInteractionId':_0x4e7b5b['id'],'direction':'in','ContactId':_0x4e7b5b[_0xbec3('0xaa')],'AttachmentId':_0x5d1769[_0xbec3('0x5b')][_0xbec3('0xab')]});})[_0xbec3('0x1d')](function(_0x501efb){_0x5d1769[_0xbec3('0x26')]=_0x501efb;if(_0x5d1769[_0xbec3('0xa2')][_0xbec3('0xac')]){return db[_0xbec3('0x70')][_0xbec3('0x59')]({'attributes':['id',_0xbec3('0x38')],'where':{'id':_0x5d1769['interaction'][_0xbec3('0xac')]}})[_0xbec3('0x1d')](function(_0x5f3f0e){if(_0x5f3f0e){_0x5d1769[_0xbec3('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f3f0e[_0xbec3('0x38')]+','+(_0x5d1769[_0xbec3('0x80')]['waitForTheAssignedAgent']||0xa),'interval':_0xbec3('0xa8')});}return respondWithRpcPromise(_0xbec3('0xad'),'startRouting',_0x5d1769);});}return respondWithRpcPromise(_0xbec3('0xad'),'startRouting',_0x5d1769);})['then'](function(_0xcd632e){if(_0xcd632e){var _0x3673f4=0xc8;var _0x20c369='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x20c369,_0x3673f4,_0xbec3('0xae'));logger['debug'](_0xbec3('0xaf'),_0x20c369,_0x3673f4,_0xbec3('0xae'),JSON[_0xbec3('0x23')](_0xcd632e));if(_0x5d1769[_0xbec3('0x80')][_0xbec3('0x3e')]==='twilio'){return _0x3d348d[_0xbec3('0x28')](_0x3673f4)[_0xbec3('0x2f')](_0xbec3('0xb0'),_0xbec3('0xb1'))[_0xbec3('0x7c')]('\x0a');}else{return _0x3d348d[_0xbec3('0x28')](_0x3673f4)['json'](_0xcd632e);}}});})['catch'](handleError(_0x3d348d,null));};exports[_0xbec3('0x7c')]=function(_0x2d9787,_0x230590,_0x59a95b){var _0x63f5eb,_0x2d34d5,_0x223be7;if(_[_0xbec3('0x99')](_0x2d9787[_0xbec3('0x5b')]['body'])||_0x2d9787[_0xbec3('0x5b')][_0xbec3('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0xbec3('0xb2'));}if(_['isNil'](_0x2d9787['body']['to'])){throw new db['Sequelize'][(_0xbec3('0x8c'))](_0xbec3('0xb3'));}_0x63f5eb=_0x2d9787[_0xbec3('0x5b')]['to'];return db[_0xbec3('0x4e')][_0xbec3('0x59')]({'where':{'id':_0x2d9787[_0xbec3('0x53')]['id']},'include':[{'model':db[_0xbec3('0xb4')],'as':_0xbec3('0xb5'),'include':[{'model':db[_0xbec3('0x8a')],'as':_0xbec3('0x9d'),'where':{'mobile':_0x63f5eb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xbec3('0x1d')](handleEntityNotFound(_0x230590,null))['then'](function(_0x4d1594){if(_0x4d1594&&_0x4d1594[_0xbec3('0xb5')]){_0x2d34d5=_0x4d1594[_0xbec3('0x34')]({'plain':!![]});if(_0x2d34d5[_0xbec3('0xb5')]&&_0x2d34d5['List'][_0xbec3('0x9d')][_0xbec3('0x46')]){return _0x2d34d5[_0xbec3('0xb5')][_0xbec3('0x9d')][0x0];}return db[_0xbec3('0x8a')][_0xbec3('0x56')](_[_0xbec3('0x15')](_0x2d9787[_0xbec3('0x5b')],{'firstName':_0x63f5eb,'mobile':_0x63f5eb,'phone':_0x63f5eb,'ListId':_0x2d34d5['ListId']}));}})[_0xbec3('0x1d')](handleEntityNotFound(_0x230590,null))[_0xbec3('0x1d')](function(_0x44911c){if(_0x44911c){_0x223be7=_0x44911c;return db[_0xbec3('0xa0')][_0xbec3('0x59')]({'where':{'ContactId':_0x223be7['id'],'closed':![],'WhatsappAccountId':_0x2d34d5['id']}})[_0xbec3('0x1d')](function(_0x2ef432){if(_0x2ef432){return[_0x2ef432,![]];}return db[_0xbec3('0xa0')]['create']({'UserId':_0x2d9787[_0xbec3('0x57')]['id'],'ContactId':_0x223be7['id'],'WhatsappAccountId':_0x2d34d5['id'],'phone':_0x63f5eb,'firstMsgDirection':'out','Messages':[_['merge'](_0x2d9787[_0xbec3('0x5b')],{'read':![],'body':_0x2d9787[_0xbec3('0x5b')][_0xbec3('0x5b')],'phone':_0x63f5eb,'WhatsappAccountId':_0x2d34d5['id'],'UserId':_0x2d9787[_0xbec3('0x57')]['id'],'ContactId':_0x223be7['id']})]},{'include':[{'model':db[_0xbec3('0xa9')],'as':_0xbec3('0xb6')}]})[_0xbec3('0x1d')](function(_0x7e8c8a){return[_0x7e8c8a,!![]];});});}})[_0xbec3('0xa1')](function(_0x4a18d0,_0x41c4ca){if(_0x41c4ca){return _0x4a18d0;}return db['WhatsappMessage'][_0xbec3('0x56')](_['merge'](_0x2d9787[_0xbec3('0x5b')],{'read':![],'body':_0x2d9787[_0xbec3('0x5b')][_0xbec3('0x5b')],'phone':_0x63f5eb,'WhatsappAccountId':_0x2d34d5['id'],'WhatsappInteractionId':_0x4a18d0['id'],'UserId':_0x2d9787['user']['id'],'ContactId':_0x223be7['id']}))[_0xbec3('0x1d')](function(_0x15dfd0){_0x4a18d0['dataValues'][_0xbec3('0xb6')]=[];_0x4a18d0[_0xbec3('0xb7')][_0xbec3('0xb6')][_0xbec3('0xa5')](_0x15dfd0[_0xbec3('0xb7')]);return _0x4a18d0;});})[_0xbec3('0x1d')](respondWithResult(_0x230590,null))[_0xbec3('0x51')](handleError(_0x230590,null));}; \ No newline at end of file +var _0xa421=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addDisposition','findOne','WhatsappAccountId','Disposition','removeDispositions','ids','CannedAnswer','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','message_id','orderBy','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','MessageSid','notifications','messageId','from\x20is\x20mandatory','ValidationError','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','DESC','List','out','Messages','dataValues','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','WhatsappAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x5ca0cd,_0x6a360a){var _0x1f2ee4=function(_0x1a7973){while(--_0x1a7973){_0x5ca0cd['push'](_0x5ca0cd['shift']());}};_0x1f2ee4(++_0x6a360a);}(_0xa421,0x148));var _0x1a42=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xa421[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0x1a42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a42('0x1'));var rp=require(_0x1a42('0x2'));var moment=require(_0x1a42('0x3'));var BPromise=require(_0x1a42('0x4'));var Mustache=require('mustache');var util=require(_0x1a42('0x5'));var path=require(_0x1a42('0x6'));var sox=require(_0x1a42('0x7'));var csv=require(_0x1a42('0x8'));var ejs=require(_0x1a42('0x9'));var fs=require('fs');var fs_extra=require(_0x1a42('0xa'));var _=require('lodash');var squel=require(_0x1a42('0xb'));var crypto=require(_0x1a42('0xc'));var jsforce=require(_0x1a42('0xd'));var deskjs=require(_0x1a42('0xe'));var toCsv=require(_0x1a42('0x8'));var querystring=require(_0x1a42('0xf'));var Papa=require(_0x1a42('0x10'));var Redis=require(_0x1a42('0x11'));var authService=require(_0x1a42('0x12'));var qs=require(_0x1a42('0x13'));var as=require(_0x1a42('0x14'));var hardwareService=require(_0x1a42('0x15'));var logger=require(_0x1a42('0x16'))(_0x1a42('0x17'));var utils=require('../../config/utils');var config=require(_0x1a42('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a42('0x19'))['db'];config[_0x1a42('0x1a')]=_['defaults'](config[_0x1a42('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a42('0x1b'))(new Redis(config['redis']));require(_0x1a42('0x1c'))[_0x1a42('0x1d')](socket);var jayson=require(_0x1a42('0x1e'));var client=jayson[_0x1a42('0x1f')][_0x1a42('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5e17f2,_0x357d00,_0x3ce092,_0x42deb5){return new BPromise(function(_0x14bfa0,_0x5e3caa){var _0x14b3ac=_0x42deb5||client;return _0x14b3ac[_0x1a42('0x21')](_0x5e17f2,_0x3ce092)[_0x1a42('0x22')](function(_0x48a18e){logger['info'](_0x1a42('0x23'),_0x357d00,_0x1a42('0x24'));logger[_0x1a42('0x25')](_0x1a42('0x26'),_0x357d00,_0x1a42('0x24'),JSON[_0x1a42('0x27')](_0x48a18e));if(_0x48a18e[_0x1a42('0x28')]){if(_0x48a18e[_0x1a42('0x28')][_0x1a42('0x29')]===0x1f4){logger[_0x1a42('0x28')](_0x1a42('0x23'),_0x357d00,_0x48a18e['error']['message']);return _0x5e3caa(_0x48a18e[_0x1a42('0x28')][_0x1a42('0x2a')]);}logger['error'](_0x1a42('0x23'),_0x357d00,_0x48a18e[_0x1a42('0x28')][_0x1a42('0x2a')]);return _0x14bfa0(_0x48a18e['error'][_0x1a42('0x2a')]);}else{logger[_0x1a42('0x2b')]('WhatsappAccount,\x20%s,\x20%s',_0x357d00,_0x1a42('0x24'));_0x14bfa0(_0x48a18e['result'][_0x1a42('0x2a')]);}})[_0x1a42('0x2c')](function(_0x296312){logger['error'](_0x1a42('0x23'),_0x357d00,_0x296312);_0x5e3caa(_0x296312);});});}function respondWithStatusCode(_0x343429,_0x526681){_0x526681=_0x526681||0xcc;return function(_0x4540ad){if(_0x4540ad){return _0x343429[_0x1a42('0x2d')](_0x526681);}return _0x343429['status'](_0x526681)[_0x1a42('0x2e')]();};}function respondWithResult(_0x1fb0db,_0x202ddb){_0x202ddb=_0x202ddb||0xc8;return function(_0x304aae){if(_0x304aae){return _0x1fb0db[_0x1a42('0x2f')](_0x202ddb)[_0x1a42('0x30')](_0x304aae);}};}function respondWithFilteredResult(_0x15934f,_0xb41435){return function(_0x84ca91){if(_0x84ca91){var _0x577383=typeof _0xb41435[_0x1a42('0x31')]===_0x1a42('0x32')&&typeof _0xb41435[_0x1a42('0x33')]===_0x1a42('0x32');var _0x2f21ec=_0x84ca91[_0x1a42('0x34')];var _0x45ade0=_0x577383?0x0:_0xb41435[_0x1a42('0x31')];var _0xf37c5f=_0x577383?_0x84ca91[_0x1a42('0x34')]:_0xb41435['offset']+_0xb41435[_0x1a42('0x33')];var _0x27af60;if(_0xf37c5f>=_0x2f21ec){_0xf37c5f=_0x2f21ec;_0x27af60=0xc8;}else{_0x27af60=0xce;}_0x15934f['status'](_0x27af60);return _0x15934f[_0x1a42('0x35')](_0x1a42('0x36'),_0x45ade0+'-'+_0xf37c5f+'/'+_0x2f21ec)[_0x1a42('0x30')](_0x84ca91);}return null;};}function patchUpdates(_0x3aa5ed){return function(_0x12469d){try{jsonpatch[_0x1a42('0x37')](_0x12469d,_0x3aa5ed,!![]);}catch(_0x243476){return BPromise[_0x1a42('0x38')](_0x243476);}return _0x12469d['save']();};}function saveUpdates(_0x541048,_0x5cb23d){return function(_0x4c9d8a){if(_0x4c9d8a){return _0x4c9d8a[_0x1a42('0x39')](_0x541048)['then'](function(_0x452765){return _0x452765;});}return null;};}function removeEntity(_0x16f787,_0x4cc74a){return function(_0x9066af){if(_0x9066af){return _0x9066af['destroy']()[_0x1a42('0x22')](function(){var _0x2b2873=_0x9066af[_0x1a42('0x3a')]({'plain':!![]});var _0x3a8fa8=_0x1a42('0x3b');return db['UserProfileResource'][_0x1a42('0x3c')]({'where':{'type':_0x3a8fa8,'resourceId':_0x2b2873['id']}})[_0x1a42('0x22')](function(){return _0x9066af;});})['then'](function(){_0x16f787[_0x1a42('0x2f')](0xcc)[_0x1a42('0x2e')]();});}};}function handleEntityNotFound(_0x55b652,_0x3400d6){return function(_0x16484c){if(!_0x16484c){_0x55b652[_0x1a42('0x2d')](0x194);}return _0x16484c;};}function handleError(_0x57e958,_0x49e2d9){_0x49e2d9=_0x49e2d9||0x1f4;return function(_0x4cc750){logger[_0x1a42('0x28')](_0x4cc750[_0x1a42('0x3d')]);if(_0x4cc750[_0x1a42('0x3e')]){delete _0x4cc750[_0x1a42('0x3e')];}_0x57e958[_0x1a42('0x2f')](_0x49e2d9)[_0x1a42('0x3f')](_0x4cc750);};}exports[_0x1a42('0x40')]=function(_0xb2eba2,_0x1f9908){var _0x586bef={'include':[{'model':db[_0x1a42('0x41')],'as':_0x1a42('0x42')}]},_0x468ce7={},_0x544858={'count':0x0,'rows':[]};var _0x506a09=_['map'](db[_0x1a42('0x43')][_0x1a42('0x44')],function(_0x549224){return{'name':_0x549224[_0x1a42('0x45')],'type':_0x549224[_0x1a42('0x46')][_0x1a42('0x47')]};});_0x468ce7[_0x1a42('0x48')]=_[_0x1a42('0x49')](_0x506a09,_0x1a42('0x3e'));_0x468ce7[_0x1a42('0x4a')]=_[_0x1a42('0x4b')](_0xb2eba2['query']);_0x468ce7[_0x1a42('0x4c')]=_[_0x1a42('0x4d')](_0x468ce7['model'],_0x468ce7['query']);_0x586bef[_0x1a42('0x4e')]=_[_0x1a42('0x4d')](_0x468ce7[_0x1a42('0x48')],qs[_0x1a42('0x4f')](_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x4f')]));_0x586bef[_0x1a42('0x4e')]=_0x586bef['attributes'][_0x1a42('0x50')]?_0x586bef[_0x1a42('0x4e')]:_0x468ce7[_0x1a42('0x48')];if(!_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x51')](_0x1a42('0x52'))){_0x586bef[_0x1a42('0x33')]=qs[_0x1a42('0x33')](_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x33')]);_0x586bef[_0x1a42('0x31')]=qs[_0x1a42('0x31')](_0xb2eba2[_0x1a42('0x4a')]['offset']);}_0x586bef[_0x1a42('0x53')]=qs[_0x1a42('0x54')](_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x54')]);_0x586bef[_0x1a42('0x55')]=qs[_0x1a42('0x4c')](_[_0x1a42('0x56')](_0xb2eba2['query'],_0x468ce7[_0x1a42('0x4c')]),_0x506a09);if(_0xb2eba2['query'][_0x1a42('0x57')]){_0x586bef[_0x1a42('0x55')]=_[_0x1a42('0x58')](_0x586bef['where'],{'$or':_['map'](_0x506a09,function(_0x127321){if(_0x127321[_0x1a42('0x46')]!==_0x1a42('0x59')){var _0x2481b2={};_0x2481b2[_0x127321[_0x1a42('0x3e')]]={'$like':'%'+_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x57')]+'%'};return _0x2481b2;}})});}_0x586bef=_[_0x1a42('0x58')]({},_0x586bef,_0xb2eba2[_0x1a42('0x5a')]);var _0xc50939={'where':_0x586bef[_0x1a42('0x55')]};return db['WhatsappAccount'][_0x1a42('0x34')](_0xc50939)['then'](function(_0x2ac2cf){_0x544858['count']=_0x2ac2cf;if(_0xb2eba2[_0x1a42('0x4a')][_0x1a42('0x5b')]){_0x586bef[_0x1a42('0x5c')]=[{'all':!![]}];}return db[_0x1a42('0x43')][_0x1a42('0x5d')](_0x586bef);})[_0x1a42('0x22')](function(_0x674162){_0x544858[_0x1a42('0x5e')]=_0x674162;return _0x544858;})[_0x1a42('0x22')](respondWithFilteredResult(_0x1f9908,_0x586bef))['catch'](handleError(_0x1f9908,null));};exports[_0x1a42('0x5f')]=function(_0x54131f,_0x457bc7){var _0x1736fd={'raw':![],'where':{'id':_0x54131f['params']['id']},'include':[{'model':db['Pause'],'as':_0x1a42('0x42')}]},_0x5c0a08={};_0x5c0a08['model']=_['keys'](db[_0x1a42('0x43')][_0x1a42('0x44')]);_0x5c0a08[_0x1a42('0x4a')]=_['keys'](_0x54131f['query']);_0x5c0a08[_0x1a42('0x4c')]=_[_0x1a42('0x4d')](_0x5c0a08[_0x1a42('0x48')],_0x5c0a08[_0x1a42('0x4a')]);_0x1736fd[_0x1a42('0x4e')]=_['intersection'](_0x5c0a08[_0x1a42('0x48')],qs[_0x1a42('0x4f')](_0x54131f[_0x1a42('0x4a')]['fields']));_0x1736fd[_0x1a42('0x4e')]=_0x1736fd[_0x1a42('0x4e')]['length']?_0x1736fd[_0x1a42('0x4e')]:_0x5c0a08[_0x1a42('0x48')];if(_0x54131f[_0x1a42('0x4a')][_0x1a42('0x5b')]){_0x1736fd[_0x1a42('0x5c')]=[{'all':!![]}];}_0x1736fd=_['merge']({},_0x1736fd,_0x54131f[_0x1a42('0x5a')]);return db[_0x1a42('0x43')]['find'](_0x1736fd)[_0x1a42('0x22')](handleEntityNotFound(_0x457bc7,null))[_0x1a42('0x22')](respondWithResult(_0x457bc7,null))[_0x1a42('0x2c')](handleError(_0x457bc7,null));};exports[_0x1a42('0x60')]=function(_0x225273,_0x270c4e){return db[_0x1a42('0x43')]['create'](_0x225273['body'],{})[_0x1a42('0x22')](function(_0xb32dbb){var _0x514652=_0x225273[_0x1a42('0x61')][_0x1a42('0x3a')]({'plain':!![]});if(!_0x514652)throw new Error(_0x1a42('0x62'));if(_0x514652[_0x1a42('0x63')]===_0x1a42('0x61')){var _0x2ef8bc=_0xb32dbb[_0x1a42('0x3a')]({'plain':!![]});var _0x2009fd='WhatsappAccounts';return db[_0x1a42('0x64')][_0x1a42('0x65')]({'where':{'name':_0x2009fd,'userProfileId':_0x514652['userProfileId']},'raw':!![]})[_0x1a42('0x22')](function(_0x21f649){if(_0x21f649&&_0x21f649['autoAssociation']===0x0){return db[_0x1a42('0x66')]['create']({'name':_0x2ef8bc[_0x1a42('0x3e')],'resourceId':_0x2ef8bc['id'],'type':_0x21f649[_0x1a42('0x3e')],'sectionId':_0x21f649['id']},{})[_0x1a42('0x22')](function(){return _0xb32dbb;});}else{return _0xb32dbb;}})[_0x1a42('0x2c')](function(_0x2d9112){logger[_0x1a42('0x28')](_0x1a42('0x67'),_0x2d9112);throw _0x2d9112;});}return _0xb32dbb;})[_0x1a42('0x22')](respondWithResult(_0x270c4e,0xc9))[_0x1a42('0x2c')](handleError(_0x270c4e,null));};exports['update']=function(_0x235fe9,_0x1d35e1){if(_0x235fe9['body']['id']){delete _0x235fe9[_0x1a42('0x68')]['id'];}return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x235fe9[_0x1a42('0x69')]['id']},'include':[{'model':db[_0x1a42('0x41')],'as':'mandatoryDispositionPause'}]})[_0x1a42('0x22')](handleEntityNotFound(_0x1d35e1,null))[_0x1a42('0x22')](saveUpdates(_0x235fe9['body'],null))[_0x1a42('0x22')](respondWithResult(_0x1d35e1,null))['catch'](handleError(_0x1d35e1,null));};exports['destroy']=function(_0x5f0686,_0x59d913){return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x5f0686['params']['id']}})['then'](handleEntityNotFound(_0x59d913,null))[_0x1a42('0x22')](removeEntity(_0x59d913,null))[_0x1a42('0x2c')](handleError(_0x59d913,null));};exports['describe']=function(_0x2e39da,_0x51159c){return db[_0x1a42('0x43')]['describe']()['then'](respondWithResult(_0x51159c,null))[_0x1a42('0x2c')](handleError(_0x51159c,null));};exports[_0x1a42('0x6a')]=function(_0x707fb6,_0x430710,_0x3c8995){if(_0x707fb6[_0x1a42('0x68')]['id']){delete _0x707fb6[_0x1a42('0x68')]['id'];}return db['WhatsappAccount'][_0x1a42('0x65')]({'where':{'id':_0x707fb6['params']['id']}})['then'](handleEntityNotFound(_0x430710,null))['then'](function(_0x1cd442){if(_0x1cd442){_0x707fb6[_0x1a42('0x68')]['WhatsappAccountId']=_0x1cd442['id'];return db['Disposition'][_0x1a42('0x60')](_0x707fb6[_0x1a42('0x68')]);}})['then'](respondWithResult(_0x430710,null))['catch'](handleError(_0x430710,null));};exports['getDispositions']=function(_0x4549b1,_0x2e0f3e,_0x21d355){var _0x940697={'raw':![],'where':{}};var _0x2147d5={};var _0x12d327={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x1a42('0x6b')]({'where':{'id':_0x4549b1[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x2e0f3e,null))[_0x1a42('0x22')](function(_0x93aa81){if(_0x93aa81){_0x2147d5[_0x1a42('0x48')]=_[_0x1a42('0x4b')](db['Disposition'][_0x1a42('0x44')]);_0x2147d5[_0x1a42('0x4a')]=_[_0x1a42('0x4b')](_0x4549b1[_0x1a42('0x4a')]);_0x2147d5[_0x1a42('0x4c')]=_[_0x1a42('0x4d')](_0x2147d5[_0x1a42('0x48')],_0x2147d5['query']);_0x940697[_0x1a42('0x4e')]=_[_0x1a42('0x4d')](_0x2147d5['model'],qs[_0x1a42('0x4f')](_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x4f')]));_0x940697[_0x1a42('0x4e')]=_0x940697[_0x1a42('0x4e')]['length']?_0x940697[_0x1a42('0x4e')]:_0x2147d5[_0x1a42('0x48')];if(!_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x51')]('nolimit')){_0x940697[_0x1a42('0x33')]=qs[_0x1a42('0x33')](_0x4549b1['query'][_0x1a42('0x33')]);_0x940697[_0x1a42('0x31')]=qs['offset'](_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x31')]);}_0x940697[_0x1a42('0x53')]=qs[_0x1a42('0x54')](_0x4549b1[_0x1a42('0x4a')]['sort']);_0x940697[_0x1a42('0x55')]=qs['filters'](_[_0x1a42('0x56')](_0x4549b1[_0x1a42('0x4a')],_0x2147d5['filters']));_0x940697[_0x1a42('0x55')][_0x1a42('0x6c')]=_0x93aa81['id'];if(_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x57')]){_0x940697[_0x1a42('0x55')]=_[_0x1a42('0x58')](_0x940697['where'],{'$or':_[_0x1a42('0x49')](_0x940697[_0x1a42('0x4e')],function(_0x101df3){var _0x3c5187={};_0x3c5187[_0x101df3]={'$like':'%'+_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x57')]+'%'};return _0x3c5187;})});}_0x940697=_[_0x1a42('0x58')]({},_0x940697,_0x4549b1[_0x1a42('0x5a')]);return db[_0x1a42('0x6d')][_0x1a42('0x34')]({'where':_0x940697[_0x1a42('0x55')]})[_0x1a42('0x22')](function(_0x2e7783){_0x12d327[_0x1a42('0x34')]=_0x2e7783;if(_0x4549b1[_0x1a42('0x4a')][_0x1a42('0x5b')]){_0x940697['include']=[{'all':!![]}];}return db[_0x1a42('0x6d')]['findAll'](_0x940697);})[_0x1a42('0x22')](function(_0x3a7e3f){_0x12d327['rows']=_0x3a7e3f;return _0x12d327;});}})[_0x1a42('0x22')](respondWithFilteredResult(_0x2e0f3e,_0x940697))[_0x1a42('0x2c')](handleError(_0x2e0f3e,null));};exports[_0x1a42('0x6e')]=function(_0x400d5b,_0xa4868b,_0x1b6958){return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x400d5b[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0xa4868b,null))[_0x1a42('0x22')](function(_0x5c136d){if(_0x5c136d){return _0x5c136d[_0x1a42('0x6e')](_0x400d5b['query'][_0x1a42('0x6f')]);}})[_0x1a42('0x22')](respondWithStatusCode(_0xa4868b,null))[_0x1a42('0x2c')](handleError(_0xa4868b,null));};exports['addAnswer']=function(_0x4e5e04,_0x4e2ed8,_0x5eec18){if(_0x4e5e04[_0x1a42('0x68')]['id']){delete _0x4e5e04[_0x1a42('0x68')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x4e5e04[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x4e2ed8,null))[_0x1a42('0x22')](function(_0x12383c){if(_0x12383c){_0x4e5e04[_0x1a42('0x68')][_0x1a42('0x6c')]=_0x12383c['id'];return db['CannedAnswer'][_0x1a42('0x60')](_0x4e5e04[_0x1a42('0x68')]);}})['then'](respondWithResult(_0x4e2ed8,null))[_0x1a42('0x2c')](handleError(_0x4e2ed8,null));};exports['getAnswers']=function(_0x16c4db,_0x1781b2,_0x4a3d58){var _0x4832da={'raw':![],'where':{}};var _0x7bcf8f={};var _0x1f13f7={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x1a42('0x6b')]({'where':{'id':_0x16c4db[_0x1a42('0x69')]['id']}})['then'](handleEntityNotFound(_0x1781b2,null))[_0x1a42('0x22')](function(_0x580236){if(_0x580236){_0x7bcf8f[_0x1a42('0x48')]=_[_0x1a42('0x4b')](db[_0x1a42('0x70')][_0x1a42('0x44')]);_0x7bcf8f[_0x1a42('0x4a')]=_[_0x1a42('0x4b')](_0x16c4db[_0x1a42('0x4a')]);_0x7bcf8f[_0x1a42('0x4c')]=_['intersection'](_0x7bcf8f[_0x1a42('0x48')],_0x7bcf8f[_0x1a42('0x4a')]);_0x4832da[_0x1a42('0x4e')]=_[_0x1a42('0x4d')](_0x7bcf8f['model'],qs[_0x1a42('0x4f')](_0x16c4db[_0x1a42('0x4a')][_0x1a42('0x4f')]));_0x4832da[_0x1a42('0x4e')]=_0x4832da[_0x1a42('0x4e')][_0x1a42('0x50')]?_0x4832da[_0x1a42('0x4e')]:_0x7bcf8f[_0x1a42('0x48')];if(!_0x16c4db[_0x1a42('0x4a')][_0x1a42('0x51')]('nolimit')){_0x4832da['limit']=qs[_0x1a42('0x33')](_0x16c4db[_0x1a42('0x4a')]['limit']);_0x4832da['offset']=qs[_0x1a42('0x31')](_0x16c4db[_0x1a42('0x4a')]['offset']);}_0x4832da[_0x1a42('0x53')]=qs['sort'](_0x16c4db[_0x1a42('0x4a')][_0x1a42('0x54')]);_0x4832da[_0x1a42('0x55')]=qs['filters'](_[_0x1a42('0x56')](_0x16c4db[_0x1a42('0x4a')],_0x7bcf8f['filters']));_0x4832da[_0x1a42('0x55')][_0x1a42('0x6c')]=_0x580236['id'];if(_0x16c4db[_0x1a42('0x4a')][_0x1a42('0x57')]){_0x4832da[_0x1a42('0x55')]=_[_0x1a42('0x58')](_0x4832da[_0x1a42('0x55')],{'$or':_[_0x1a42('0x49')](_0x4832da[_0x1a42('0x4e')],function(_0x28303b){var _0xf97da0={};_0xf97da0[_0x28303b]={'$like':'%'+_0x16c4db['query'][_0x1a42('0x57')]+'%'};return _0xf97da0;})});}_0x4832da=_['merge']({},_0x4832da,_0x16c4db[_0x1a42('0x5a')]);return db[_0x1a42('0x70')][_0x1a42('0x34')]({'where':_0x4832da['where']})[_0x1a42('0x22')](function(_0x2ca6e6){_0x1f13f7[_0x1a42('0x34')]=_0x2ca6e6;if(_0x16c4db[_0x1a42('0x4a')][_0x1a42('0x5b')]){_0x4832da[_0x1a42('0x5c')]=[{'all':!![]}];}return db[_0x1a42('0x70')][_0x1a42('0x5d')](_0x4832da);})[_0x1a42('0x22')](function(_0x10d641){_0x1f13f7[_0x1a42('0x5e')]=_0x10d641;return _0x1f13f7;});}})[_0x1a42('0x22')](respondWithFilteredResult(_0x1781b2,_0x4832da))[_0x1a42('0x2c')](handleError(_0x1781b2,null));};exports['removeAnswers']=function(_0x158bad,_0x5e2d5d,_0x4154b3){return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x158bad[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x5e2d5d,null))['then'](function(_0x784431){if(_0x784431){return _0x784431['removeAnswers'](_0x158bad[_0x1a42('0x4a')][_0x1a42('0x6f')]);}})['then'](respondWithStatusCode(_0x5e2d5d,null))[_0x1a42('0x2c')](handleError(_0x5e2d5d,null));};exports['addAgents']=function(_0x3d96c8,_0x1665c1,_0x5b362f){return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x3d96c8['params']['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x1665c1,null))[_0x1a42('0x22')](function(_0x471144){if(_0x471144){return _0x471144[_0x1a42('0x71')](_0x3d96c8[_0x1a42('0x68')][_0x1a42('0x6f')],_[_0x1a42('0x72')](_0x3d96c8[_0x1a42('0x68')],['ids','id'])||{})[_0x1a42('0x73')](function(_0x35bf3a){for(var _0x259571=0x0;_0x259571<_0x3d96c8[_0x1a42('0x68')][_0x1a42('0x6f')]['length'];_0x259571+=0x1){socket[_0x1a42('0x74')]('userWhatsappAccount:save',{'UserId':Number(_0x3d96c8[_0x1a42('0x68')][_0x1a42('0x6f')][_0x259571]),'WhatsappAccountId':Number(_0x3d96c8[_0x1a42('0x69')]['id'])});}return _0x35bf3a;});}})['then'](respondWithResult(_0x1665c1,null))[_0x1a42('0x2c')](handleError(_0x1665c1,null));};exports[_0x1a42('0x75')]=function(_0x5ec6cd,_0x5d21ca,_0x3c6c67){return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x5ec6cd[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x5d21ca,null))[_0x1a42('0x22')](function(_0x1dd868){if(_0x1dd868){return _0x1dd868['removeAgents'](_0x5ec6cd[_0x1a42('0x4a')][_0x1a42('0x6f')])[_0x1a42('0x22')](function(){if(_[_0x1a42('0x76')](_0x5ec6cd[_0x1a42('0x4a')][_0x1a42('0x6f')])){for(var _0x40556c=0x0;_0x40556c<_0x5ec6cd[_0x1a42('0x4a')][_0x1a42('0x6f')][_0x1a42('0x50')];_0x40556c+=0x1){socket[_0x1a42('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x5ec6cd[_0x1a42('0x4a')][_0x1a42('0x6f')][_0x40556c]),'WhatsappAccountId':Number(_0x5ec6cd['params']['id'])});}}else{socket[_0x1a42('0x74')](_0x1a42('0x77'),{'UserId':Number(_0x5ec6cd[_0x1a42('0x4a')][_0x1a42('0x6f')]),'WhatsappAccountId':Number(_0x5ec6cd[_0x1a42('0x69')]['id'])});}});}})[_0x1a42('0x22')](respondWithStatusCode(_0x5d21ca,null))[_0x1a42('0x2c')](handleError(_0x5d21ca,null));};exports[_0x1a42('0x78')]=function(_0x4b0062,_0x538d2d,_0x5a1856){var _0x1f8244={};var _0x2747c6={};var _0x4b3e86;var _0x452ba4;return db['WhatsappAccount'][_0x1a42('0x6b')]({'where':{'id':_0x4b0062[_0x1a42('0x69')]['id']}})[_0x1a42('0x22')](handleEntityNotFound(_0x538d2d,null))['then'](function(_0x3afeee){if(_0x3afeee){_0x4b3e86=_0x3afeee;_0x2747c6[_0x1a42('0x48')]=_[_0x1a42('0x4b')](db[_0x1a42('0x79')][_0x1a42('0x44')]);_0x2747c6[_0x1a42('0x4a')]=_[_0x1a42('0x4b')](_0x4b0062[_0x1a42('0x4a')]);_0x2747c6['filters']=_[_0x1a42('0x4d')](_0x2747c6[_0x1a42('0x48')],_0x2747c6[_0x1a42('0x4a')]);_0x1f8244[_0x1a42('0x4e')]=_['intersection'](_0x2747c6[_0x1a42('0x48')],qs[_0x1a42('0x4f')](_0x4b0062[_0x1a42('0x4a')][_0x1a42('0x4f')]));_0x1f8244['attributes']=_0x1f8244['attributes'][_0x1a42('0x50')]?_0x1f8244['attributes']:_0x2747c6[_0x1a42('0x48')];_0x1f8244[_0x1a42('0x53')]=qs[_0x1a42('0x54')](_0x4b0062[_0x1a42('0x4a')][_0x1a42('0x54')]);_0x1f8244[_0x1a42('0x55')]=qs[_0x1a42('0x4c')](_[_0x1a42('0x56')](_0x4b0062[_0x1a42('0x4a')],_0x2747c6[_0x1a42('0x4c')]));if(_0x4b0062['query'][_0x1a42('0x57')]){_0x1f8244['where']=_[_0x1a42('0x58')](_0x1f8244[_0x1a42('0x55')],{'$or':_[_0x1a42('0x49')](_0x1f8244[_0x1a42('0x4e')],function(_0x7057ba){var _0x5a88d8={};_0x5a88d8[_0x7057ba]={'$like':'%'+_0x4b0062[_0x1a42('0x4a')]['filter']+'%'};return _0x5a88d8;})});}_0x1f8244=_[_0x1a42('0x58')]({},_0x1f8244,_0x4b0062[_0x1a42('0x5a')]);return _0x4b3e86[_0x1a42('0x78')](_0x1f8244);}})[_0x1a42('0x22')](function(_0x2ffe1f){if(_0x2ffe1f){_0x452ba4=_0x2ffe1f[_0x1a42('0x50')];if(!_0x4b0062['query']['hasOwnProperty'](_0x1a42('0x52'))){_0x1f8244[_0x1a42('0x33')]=qs[_0x1a42('0x33')](_0x4b0062['query']['limit']);_0x1f8244['offset']=qs[_0x1a42('0x31')](_0x4b0062[_0x1a42('0x4a')]['offset']);}return _0x4b3e86[_0x1a42('0x78')](_0x1f8244);}})[_0x1a42('0x22')](function(_0x46accd){if(_0x46accd){return _0x46accd?{'count':_0x452ba4,'rows':_0x46accd}:null;}})[_0x1a42('0x22')](respondWithResult(_0x538d2d,null))[_0x1a42('0x2c')](handleError(_0x538d2d,null));};exports[_0x1a42('0x7a')]=function(_0x939a3a,_0x986051){var _0x350195=_0x939a3a[_0x1a42('0x69')]['id'];var _0x366a5f=_0x939a3a[_0x1a42('0x68')];var _0x300fc3=0xc8;var _0x479329=null;return db[_0x1a42('0x7b')][_0x1a42('0x7c')]({'isolationLevel':db['sequelize'][_0x1a42('0x7d')][_0x1a42('0x7e')][_0x1a42('0x7f')]},function(_0x14e3cc){return db[_0x1a42('0x43')][_0x1a42('0x6b')]({'where':{'id':_0x350195},'transaction':_0x14e3cc})[_0x1a42('0x22')](function(_0x2db668){if(_0x2db668){return db['WhatsappApplication'][_0x1a42('0x3c')]({'where':{'WhatsappAccountId':_0x350195},'transaction':_0x14e3cc})['then'](function(){var _0x54f0c1=_['map'](_0x366a5f,function(_0x1ff1c0){_0x1ff1c0[_0x1a42('0x6c')]=_0x350195;return _0x1ff1c0;});return db[_0x1a42('0x80')][_0x1a42('0x81')](_0x54f0c1,{'transaction':_0x14e3cc});});}else{_0x300fc3=0x194;_0x479329=[];}});})['then'](function(){if(_0x300fc3!==0x194){return db[_0x1a42('0x80')][_0x1a42('0x82')]({'where':{'WhatsappAccountId':_0x350195},'order':_0x1a42('0x83')})['then'](function(_0x43ceb8){_0x479329=_0x43ceb8;});}})[_0x1a42('0x2c')](function(_0x54d0e9){_0x300fc3=0x1f4;logger[_0x1a42('0x28')](_0x54d0e9[_0x1a42('0x3d')]);if(_0x54d0e9['name']){delete _0x54d0e9['name'];}_0x479329=_0x54d0e9;})[_0x1a42('0x84')](function(){if(_0x479329===null){_0x986051['sendStatus'](_0x300fc3);}else{if(_0x300fc3===0x1f4){_0x986051[_0x1a42('0x2f')](_0x300fc3)['send'](_0x479329);}else{_0x986051[_0x1a42('0x2f')](_0x300fc3)[_0x1a42('0x30')](_0x479329);}}});};exports[_0x1a42('0x85')]=function(_0x244524,_0x457746,_0x5d9692){var _0x10172c={};var _0xaeb6c={};var _0x38ade6;var _0x318ea;return db[_0x1a42('0x43')]['findOne']({'where':{'id':_0x244524['params']['id']}})['then'](handleEntityNotFound(_0x457746,null))[_0x1a42('0x22')](function(_0x364610){if(_0x364610){_0x38ade6=_0x364610;_0xaeb6c[_0x1a42('0x48')]=_[_0x1a42('0x4b')](db[_0x1a42('0x80')][_0x1a42('0x44')]);_0xaeb6c[_0x1a42('0x4a')]=_[_0x1a42('0x4b')](_0x244524[_0x1a42('0x4a')]);_0xaeb6c['filters']=_[_0x1a42('0x4d')](_0xaeb6c[_0x1a42('0x48')],_0xaeb6c['query']);_0x10172c['attributes']=_[_0x1a42('0x4d')](_0xaeb6c['model'],qs[_0x1a42('0x4f')](_0x244524[_0x1a42('0x4a')][_0x1a42('0x4f')]));_0x10172c[_0x1a42('0x4e')]=_0x10172c[_0x1a42('0x4e')][_0x1a42('0x50')]?_0x10172c[_0x1a42('0x4e')]:_0xaeb6c[_0x1a42('0x48')];_0x10172c[_0x1a42('0x53')]=qs[_0x1a42('0x54')](_0x244524[_0x1a42('0x4a')]['sort']);_0x10172c[_0x1a42('0x55')]=qs['filters'](_[_0x1a42('0x56')](_0x244524[_0x1a42('0x4a')],_0xaeb6c[_0x1a42('0x4c')]));if(_0x244524[_0x1a42('0x4a')]['filter']){_0x10172c['where']=_['merge'](_0x10172c[_0x1a42('0x55')],{'$or':_[_0x1a42('0x49')](_0x10172c[_0x1a42('0x4e')],function(_0x21ccc3){var _0x311ede={};_0x311ede[_0x21ccc3]={'$like':'%'+_0x244524[_0x1a42('0x4a')][_0x1a42('0x57')]+'%'};return _0x311ede;})});}_0x10172c=_[_0x1a42('0x58')]({},_0x10172c,_0x244524[_0x1a42('0x5a')]);return _0x38ade6[_0x1a42('0x85')](_0x10172c);}})[_0x1a42('0x22')](function(_0x572c9d){if(_0x572c9d){_0x318ea=_0x572c9d[_0x1a42('0x50')];if(!_0x244524[_0x1a42('0x4a')][_0x1a42('0x51')]('nolimit')){_0x10172c[_0x1a42('0x33')]=qs[_0x1a42('0x33')](_0x244524[_0x1a42('0x4a')][_0x1a42('0x33')]);_0x10172c[_0x1a42('0x31')]=qs['offset'](_0x244524['query'][_0x1a42('0x31')]);}return _0x38ade6['getApplications'](_0x10172c);}})[_0x1a42('0x22')](function(_0x405d35){if(_0x405d35){return _0x405d35?{'count':_0x318ea,'rows':_0x405d35}:null;}})[_0x1a42('0x22')](respondWithResult(_0x457746,null))[_0x1a42('0x2c')](handleError(_0x457746,null));};exports[_0x1a42('0x86')]=function(_0x3e18c7,_0x950c7a,_0x34500c){var _0x757dea={'channel':_0x1a42('0x87')};var _0x529353=[];var _0x31317f=[];var _0x590a6e={};return db[_0x1a42('0x43')][_0x1a42('0x65')]({'where':{'id':_0x3e18c7[_0x1a42('0x69')]['id']},'include':[{'model':db[_0x1a42('0x80')],'as':_0x1a42('0x88')}]})['then'](handleEntityNotFound(_0x950c7a,null))[_0x1a42('0x22')](function(_0x3e0b21){_0x757dea[_0x1a42('0x89')]=_0x3e0b21;if(_0x757dea[_0x1a42('0x89')]&&_0x757dea[_0x1a42('0x89')][_0x1a42('0x46')]===_0x1a42('0x8a')&&_0x3e18c7['body']['statuses']){if(_0x3e18c7['body'][_0x1a42('0x8b')][_0x1a42('0x50')]===0x0)return;if(_0x3e18c7[_0x1a42('0x68')][_0x1a42('0x8b')][0x0]['state']!==_0x1a42('0x8c'))return;return db[_0x1a42('0x8d')]['update']({'read':!![],'readAt':_0x3e18c7[_0x1a42('0x68')][_0x1a42('0x8b')][0x0]['timestamp']},{'where':{'messageId':_0x3e18c7['body']['statuses'][0x0][_0x1a42('0x8e')]},'individualHooks':!![]})['then'](function(_0xe5129){return _0x950c7a['status'](0xc8)['json'](_0xe5129);});}_0x757dea['applications']=_[_0x1a42('0x8f')](_0x3e0b21[_0x1a42('0x88')],['priority'],[_0x1a42('0x90')]);if(_0x757dea[_0x1a42('0x89')]['Applications']){delete _0x757dea['account'][_0x1a42('0x88')];}return db[_0x1a42('0x91')][_0x1a42('0x92')]()[_0x1a42('0x22')](function(_0x352328){if(!_0x352328){throw new db[(_0x1a42('0x93'))]['ValidationError'](_0x1a42('0x94'));}_0x529353=_[_0x1a42('0x95')](_[_0x1a42('0x4b')](_0x352328),[_0x1a42('0x96'),_0x1a42('0x97')]);_0x31317f=_[_0x1a42('0x95')](_['keys'](_0x352328),[_0x1a42('0x96'),_0x1a42('0x97'),_0x1a42('0x98'),_0x1a42('0x99')]);_0x757dea[_0x1a42('0x68')]={'mapKey':_0x1a42('0x9a')};if(_0x757dea[_0x1a42('0x89')]&&_0x757dea[_0x1a42('0x89')][_0x1a42('0x46')]===_0x1a42('0x9b')){_0x757dea[_0x1a42('0x68')][_0x1a42('0x9c')]=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0x9d')][_0x1a42('0x9e')](_0x1a42('0x9f'),'');_0x757dea[_0x1a42('0x68')][_0x1a42('0x68')]=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0xa0')];_0x757dea['body']['messageId']=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0xa1')];}if(_0x757dea[_0x1a42('0x89')]&&_0x757dea['account'][_0x1a42('0x46')]===_0x1a42('0x8a')){_0x757dea[_0x1a42('0x68')][_0x1a42('0x9c')]=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0xa2')][0x0]['from'];_0x757dea[_0x1a42('0x68')][_0x1a42('0x68')]=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0xa2')][0x0][_0x1a42('0x2a')][_0x1a42('0x68')];_0x757dea[_0x1a42('0x68')][_0x1a42('0xa3')]=_0x3e18c7[_0x1a42('0x68')][_0x1a42('0xa2')][0x0][_0x1a42('0x8e')];}if(_0x757dea[_0x1a42('0x68')]['id']){delete _0x757dea['body']['id'];}if(_['isNil'](_0x757dea[_0x1a42('0x68')][_0x1a42('0x9c')])){throw new db[(_0x1a42('0x93'))]['ValidationError'](_0x1a42('0xa4'));}if(_['isNil'](_0x757dea[_0x1a42('0x68')][_0x1a42('0x68')])||_0x757dea[_0x1a42('0x68')]['body']===''){throw new db[(_0x1a42('0x93'))][(_0x1a42('0xa5'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1a42('0xa6')](_0x757dea['body'][_0x1a42('0xa7')])){throw new db[(_0x1a42('0x93'))][(_0x1a42('0xa5'))](_0x1a42('0xa8')+_0x31317f);}if(!_['includes'](_0x31317f,_0x757dea[_0x1a42('0x68')]['mapKey'])){throw new db[(_0x1a42('0x93'))]['ValidationError'](_0x1a42('0xa9')+_0x31317f);}_0x590a6e[_0x757dea[_0x1a42('0x68')][_0x1a42('0xa7')]]=_0x757dea['body'][_0x1a42('0x9c')];return db[_0x1a42('0xaa')][_0x1a42('0x65')]({'where':{'id':_0x757dea[_0x1a42('0x89')]['ListId']},'include':[{'model':db[_0x1a42('0x91')],'as':_0x1a42('0xab'),'where':_0x590a6e,'limit':0x1,'order':[[_0x1a42('0x97'),'DESC']]}]});})[_0x1a42('0x22')](handleEntityNotFound(_0x950c7a,null))[_0x1a42('0x22')](function(_0x189a4a){if(_0x189a4a){_0x757dea['list']=_[_0x1a42('0x72')](_0x189a4a,[_0x1a42('0xab')]);if(_0x189a4a['Contacts'][_0x1a42('0x50')]){return _0x189a4a[_0x1a42('0xab')][0x0];}var _0x3b42c3=_[_0x1a42('0xac')](_0x757dea['body'],{'firstName':_0x757dea['body'][_0x1a42('0x9c')],'ListId':_0x189a4a['id']});_0x3b42c3[_0x757dea[_0x1a42('0x68')]['mapKey']]=_0x757dea[_0x1a42('0x68')]['from'];return db[_0x1a42('0x91')][_0x1a42('0x60')](_0x3b42c3,{'fields':_0x529353,'raw':!![]});}})[_0x1a42('0x22')](handleEntityNotFound(_0x950c7a,null))[_0x1a42('0x22')](function(_0x36c572){if(_0x36c572){_0x757dea[_0x1a42('0xad')]=_0x36c572;var _0x12ba18={'ContactId':_0x36c572['id'],'phone':_0x757dea[_0x1a42('0x68')][_0x1a42('0x9c')],'WhatsappAccountId':_0x3e18c7[_0x1a42('0x69')]['id']};var _0x590e35={'ContactId':_0x36c572['id'],'WhatsappAccountId':_0x3e18c7['params']['id'],'closed':![]};return db[_0x1a42('0xae')][_0x1a42('0x65')]({'where':_0x590e35})[_0x1a42('0x22')](function(_0x49c37d){if(_0x49c37d){return[_0x49c37d,![]];}return db[_0x1a42('0xae')][_0x1a42('0x60')](_0x12ba18)[_0x1a42('0x22')](function(_0x1d2da6){return[_0x1d2da6,!![]];});});}})['spread'](function(_0x1cdad6,_0x4174df){_0x757dea[_0x1a42('0xaf')]=_0x1cdad6[_0x1a42('0x3a')]({'plain':!![]});_0x757dea['interaction'][_0x1a42('0xb0')]=![];if(_0x4174df){if(_0x757dea[_0x1a42('0x89')][_0x1a42('0xb1')]){_0x757dea['applications'][_0x1a42('0xb2')]({'id':0x0,'priority':_0x757dea[_0x1a42('0xb3')]['length']+0x1,'app':_0x1a42('0xb4'),'appdata':_0x1a42('0xb5'),'interval':_0x1a42('0xb6')});}_0x757dea[_0x1a42('0xaf')]['created']=!![];}return db[_0x1a42('0x8d')][_0x1a42('0x60')]({'phone':_0x757dea[_0x1a42('0x68')][_0x1a42('0x9c')],'messageId':_0x757dea[_0x1a42('0x68')][_0x1a42('0xa3')],'body':_0x757dea['body'][_0x1a42('0x68')],'WhatsappAccountId':_0x3e18c7[_0x1a42('0x69')]['id'],'WhatsappInteractionId':_0x1cdad6['id'],'direction':'in','ContactId':_0x1cdad6[_0x1a42('0xb7')],'AttachmentId':_0x757dea[_0x1a42('0x68')][_0x1a42('0xb8')]});})['then'](function(_0x5c1729){_0x757dea[_0x1a42('0x2a')]=_0x5c1729;if(_0x757dea['interaction']['UserId']){return db[_0x1a42('0x79')][_0x1a42('0x65')]({'attributes':['id','name'],'where':{'id':_0x757dea['interaction'][_0x1a42('0xb9')]}})[_0x1a42('0x22')](function(_0x42540c){if(_0x42540c){_0x757dea[_0x1a42('0xb3')][_0x1a42('0xba')]({'id':0x0,'priority':0x0,'app':_0x1a42('0xbb'),'appdata':_0x42540c[_0x1a42('0x3e')]+','+(_0x757dea['account'][_0x1a42('0xbc')]||0xa),'interval':_0x1a42('0xb6')});}return respondWithRpcPromise(_0x1a42('0xbd'),_0x1a42('0xbe'),_0x757dea);});}return respondWithRpcPromise(_0x1a42('0xbd'),_0x1a42('0xbe'),_0x757dea);})['then'](function(_0x1f7e57){if(_0x1f7e57){var _0x46e6bf=0xc8;var _0x28fb8d=_0x1a42('0xbf');logger[_0x1a42('0x2b')](_0x1a42('0x26'),_0x28fb8d,_0x46e6bf,_0x1a42('0xc0'));logger[_0x1a42('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x28fb8d,_0x46e6bf,_0x1a42('0xc0'),JSON[_0x1a42('0x27')](_0x1f7e57));if(_0x757dea[_0x1a42('0x89')][_0x1a42('0x46')]===_0x1a42('0x9b')){return _0x950c7a[_0x1a42('0x2f')](_0x46e6bf)[_0x1a42('0x35')](_0x1a42('0xc1'),_0x1a42('0xc2'))['send'](_0x1a42('0xc3'));}else{return _0x950c7a[_0x1a42('0x2f')](_0x46e6bf)[_0x1a42('0x30')](_0x1f7e57);}}});})[_0x1a42('0x2c')](handleError(_0x950c7a,null));};exports[_0x1a42('0x3f')]=function(_0x111175,_0x5f1cca,_0x2d29a4){var _0x4eb87e,_0x2bc8cd,_0x55c0a5;if(_[_0x1a42('0xa6')](_0x111175[_0x1a42('0x68')][_0x1a42('0x68')])||_0x111175[_0x1a42('0x68')]['body']===''){throw new db['Sequelize'][(_0x1a42('0xa5'))](_0x1a42('0xc4'));}if(_[_0x1a42('0xa6')](_0x111175[_0x1a42('0x68')]['to'])){throw new db[(_0x1a42('0x93'))][(_0x1a42('0xa5'))](_0x1a42('0xc5'));}_0x4eb87e=_0x111175[_0x1a42('0x68')]['to'];return db['WhatsappAccount'][_0x1a42('0x65')]({'where':{'id':_0x111175[_0x1a42('0x69')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1a42('0x91')],'as':_0x1a42('0xab'),'where':{'mobile':_0x4eb87e},'limit':0x1,'order':[[_0x1a42('0x97'),_0x1a42('0xc6')]]}]}]})[_0x1a42('0x22')](handleEntityNotFound(_0x5f1cca,null))['then'](function(_0x17650c){if(_0x17650c&&_0x17650c[_0x1a42('0xc7')]){_0x2bc8cd=_0x17650c[_0x1a42('0x3a')]({'plain':!![]});if(_0x2bc8cd[_0x1a42('0xc7')]&&_0x2bc8cd[_0x1a42('0xc7')][_0x1a42('0xab')][_0x1a42('0x50')]){return _0x2bc8cd[_0x1a42('0xc7')][_0x1a42('0xab')][0x0];}return db[_0x1a42('0x91')][_0x1a42('0x60')](_[_0x1a42('0xac')](_0x111175[_0x1a42('0x68')],{'firstName':_0x4eb87e,'mobile':_0x4eb87e,'phone':_0x4eb87e,'ListId':_0x2bc8cd[_0x1a42('0x99')]}));}})[_0x1a42('0x22')](handleEntityNotFound(_0x5f1cca,null))[_0x1a42('0x22')](function(_0x3aaa92){if(_0x3aaa92){_0x55c0a5=_0x3aaa92;return db[_0x1a42('0xae')][_0x1a42('0x65')]({'where':{'ContactId':_0x55c0a5['id'],'closed':![],'WhatsappAccountId':_0x2bc8cd['id']}})[_0x1a42('0x22')](function(_0x1f401a){if(_0x1f401a){return[_0x1f401a,![]];}return db['WhatsappInteraction'][_0x1a42('0x60')]({'UserId':_0x111175[_0x1a42('0x61')]['id'],'ContactId':_0x55c0a5['id'],'WhatsappAccountId':_0x2bc8cd['id'],'phone':_0x4eb87e,'firstMsgDirection':_0x1a42('0xc8'),'Messages':[_[_0x1a42('0x58')](_0x111175['body'],{'read':![],'body':_0x111175[_0x1a42('0x68')][_0x1a42('0x68')],'phone':_0x4eb87e,'WhatsappAccountId':_0x2bc8cd['id'],'UserId':_0x111175[_0x1a42('0x61')]['id'],'ContactId':_0x55c0a5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x1a42('0xc9')}]})['then'](function(_0x47ed23){return[_0x47ed23,!![]];});});}})[_0x1a42('0x73')](function(_0x8c7c01,_0xe314dd){if(_0xe314dd){return _0x8c7c01;}return db[_0x1a42('0x8d')]['create'](_['merge'](_0x111175['body'],{'read':![],'body':_0x111175[_0x1a42('0x68')][_0x1a42('0x68')],'phone':_0x4eb87e,'WhatsappAccountId':_0x2bc8cd['id'],'WhatsappInteractionId':_0x8c7c01['id'],'UserId':_0x111175['user']['id'],'ContactId':_0x55c0a5['id']}))[_0x1a42('0x22')](function(_0x5adefd){_0x8c7c01[_0x1a42('0xca')][_0x1a42('0xc9')]=[];_0x8c7c01[_0x1a42('0xca')][_0x1a42('0xc9')]['push'](_0x5adefd[_0x1a42('0xca')]);return _0x8c7c01;});})[_0x1a42('0x22')](respondWithResult(_0x5f1cca,null))['catch'](handleError(_0x5f1cca,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index a59ae52..04f0db5 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 _0xd897=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x5da2b0,_0x573f18){var _0x3b967f=function(_0x3704ed){while(--_0x3704ed){_0x5da2b0['push'](_0x5da2b0['shift']());}};_0x3b967f(++_0x573f18);}(_0xd897,0xb7));var _0x7d89=function(_0x2c4424,_0x5cc73e){_0x2c4424=_0x2c4424-0x0;var _0x1e217b=_0xd897[_0x2c4424];return _0x1e217b;};'use strict';var EventEmitter=require(_0x7d89('0x0'));var WhatsappAccount=require(_0x7d89('0x1'))['db'][_0x7d89('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7d89('0x3')](0x0);var events={'afterCreate':_0x7d89('0x4'),'afterUpdate':_0x7d89('0x5'),'afterDestroy':_0x7d89('0x6')};function emitEvent(_0x1de311){return function(_0x195f53,_0x248730,_0x52268e){WhatsappAccountEvents['emit'](_0x1de311+':'+_0x195f53['id'],_0x195f53);WhatsappAccountEvents[_0x7d89('0x7')](_0x1de311,_0x195f53);_0x52268e(null);};}for(var e in events){if(events[_0x7d89('0x8')](e)){var event=events[e];WhatsappAccount[_0x7d89('0x9')](e,emitEvent(event));}}module[_0x7d89('0xa')]=WhatsappAccountEvents; \ No newline at end of file +var _0xc915=['../../mysqldb','setMaxListeners','emit','hook','events'];(function(_0x36944e,_0x24a620){var _0x58d88=function(_0x112e25){while(--_0x112e25){_0x36944e['push'](_0x36944e['shift']());}};_0x58d88(++_0x24a620);}(_0xc915,0x1da));var _0x5c91=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc915[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0x5c91('0x0'));var WhatsappAccount=require(_0x5c91('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5c91('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x18c422){return function(_0xfd7fc6,_0x2c088d,_0x566779){WhatsappAccountEvents[_0x5c91('0x3')](_0x18c422+':'+_0xfd7fc6['id'],_0xfd7fc6);WhatsappAccountEvents[_0x5c91('0x3')](_0x18c422,_0xfd7fc6);_0x566779(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x5c91('0x4')](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 f33217d..9bec011 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 _0xd210=['whatsapp_accounts','lodash','util','../../config/logger','api','bluebird','path','./whatsappAccount.attributes','exports','WhatsappAccount'];(function(_0x601222,_0x2c4cb0){var _0x3f07c6=function(_0x93c1e5){while(--_0x93c1e5){_0x601222['push'](_0x601222['shift']());}};_0x3f07c6(++_0x2c4cb0);}(_0xd210,0x137));var _0x0d21=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0xd210[_0x127c7b];return _0x1708eb;};'use strict';var _=require(_0x0d21('0x0'));var util=require(_0x0d21('0x1'));var logger=require(_0x0d21('0x2'))(_0x0d21('0x3'));var moment=require('moment');var BPromise=require(_0x0d21('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d21('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0d21('0x6'));module[_0x0d21('0x7')]=function(_0x2e2b66,_0x505364){return _0x2e2b66['define'](_0x0d21('0x8'),attributes,{'tableName':_0x0d21('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa87c=['whatsapp_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x37388e,_0x2ebf06){var _0x55fc88=function(_0x129454){while(--_0x129454){_0x37388e['push'](_0x37388e['shift']());}};_0x55fc88(++_0x2ebf06);}(_0xa87c,0xf1));var _0xca87=function(_0x1f97e8,_0x445a4a){_0x1f97e8=_0x1f97e8-0x0;var _0x1ed77c=_0xa87c[_0x1f97e8];return _0x1ed77c;};'use strict';var _=require(_0xca87('0x0'));var util=require(_0xca87('0x1'));var logger=require('../../config/logger')(_0xca87('0x2'));var moment=require('moment');var BPromise=require(_0xca87('0x3'));var rp=require(_0xca87('0x4'));var fs=require('fs');var path=require(_0xca87('0x5'));var rimraf=require(_0xca87('0x6'));var config=require(_0xca87('0x7'));var attributes=require(_0xca87('0x8'));module['exports']=function(_0x565633,_0x3636d2){return _0x565633['define']('WhatsappAccount',attributes,{'tableName':_0xca87('0x9'),'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 889d0da..7310bba 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 _0x6bc9=['redis','defaults','./whatsappAccount.socket','register','then','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','map','include','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x6bc9,0x1bc));var _0x96bc=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x6bc9[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var moment=require(_0x96bc('0x2'));var BPromise=require(_0x96bc('0x3'));var rs=require(_0x96bc('0x4'));var fs=require('fs');var Redis=require(_0x96bc('0x5'));var db=require(_0x96bc('0x6'))['db'];var utils=require(_0x96bc('0x7'));var logger=require(_0x96bc('0x8'))(_0x96bc('0x9'));var config=require('../../config/environment');var jayson=require(_0x96bc('0xa'));var client=jayson[_0x96bc('0xb')]['http']({'port':0x232a});config[_0x96bc('0xc')]=_[_0x96bc('0xd')](config[_0x96bc('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x96bc('0xe'))[_0x96bc('0xf')](socket);function respondWithRpcPromise(_0x111504,_0x58e751,_0x32c875){return new BPromise(function(_0x30a6dd,_0x5346f7){return client['request'](_0x111504,_0x32c875)[_0x96bc('0x10')](function(_0x573227){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x58e751,'request\x20sent');logger['debug'](_0x96bc('0x11'),_0x58e751,'request\x20sent',JSON[_0x96bc('0x12')](_0x573227));if(_0x573227[_0x96bc('0x13')]){if(_0x573227['error'][_0x96bc('0x14')]===0x1f4){logger[_0x96bc('0x13')](_0x96bc('0x15'),_0x58e751,_0x573227[_0x96bc('0x13')]['message']);return _0x5346f7(_0x573227[_0x96bc('0x13')][_0x96bc('0x16')]);}logger[_0x96bc('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x58e751,_0x573227[_0x96bc('0x13')]['message']);return _0x30a6dd(_0x573227[_0x96bc('0x13')][_0x96bc('0x16')]);}else{logger[_0x96bc('0x17')](_0x96bc('0x15'),_0x58e751,_0x96bc('0x18'));_0x30a6dd(_0x573227[_0x96bc('0x19')][_0x96bc('0x16')]);}})[_0x96bc('0x1a')](function(_0x117a6a){logger[_0x96bc('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x58e751,_0x117a6a);_0x5346f7(_0x117a6a);});});}exports[_0x96bc('0x1b')]=function(_0x5f46f6){var _0x5788a1=this;return new Promise(function(_0x526940,_0x152d8a){return db[_0x96bc('0x1c')][_0x96bc('0x1d')]({'raw':_0x5f46f6[_0x96bc('0x1e')]?_0x5f46f6[_0x96bc('0x1e')][_0x96bc('0x1f')]===undefined?!![]:![]:!![],'where':_0x5f46f6['options']?_0x5f46f6[_0x96bc('0x1e')][_0x96bc('0x20')]||null:null,'attributes':_0x5f46f6[_0x96bc('0x1e')]?_0x5f46f6['options']['attributes']||null:null,'include':_0x5f46f6[_0x96bc('0x1e')]?_0x5f46f6[_0x96bc('0x1e')]['include']?_[_0x96bc('0x21')](_0x5f46f6[_0x96bc('0x1e')][_0x96bc('0x22')],function(_0x52c046){return{'model':db[_0x52c046[_0x96bc('0x23')]],'as':_0x52c046['as'],'attributes':_0x52c046[_0x96bc('0x24')],'include':_0x52c046['include']?_[_0x96bc('0x21')](_0x52c046['include'],function(_0x56757a){return{'model':db[_0x56757a[_0x96bc('0x23')]],'as':_0x56757a['as'],'attributes':_0x56757a[_0x96bc('0x24')],'include':_0x56757a[_0x96bc('0x22')]?_['map'](_0x56757a['include'],function(_0x39bf05){return{'model':db[_0x39bf05['model']],'as':_0x39bf05['as'],'attributes':_0x39bf05[_0x96bc('0x24')]};}):[]};}):[]};}):[]:[]})[_0x96bc('0x10')](function(_0x8a8a88){logger[_0x96bc('0x17')](_0x96bc('0x1b'),_0x5f46f6);logger[_0x96bc('0x25')](_0x96bc('0x1b'),_0x5f46f6,JSON[_0x96bc('0x12')](_0x8a8a88));_0x526940(_0x8a8a88);})['catch'](function(_0x4f62ee){logger[_0x96bc('0x13')](_0x96bc('0x1b'),_0x4f62ee[_0x96bc('0x16')],_0x5f46f6);_0x152d8a(_0x5788a1['error'](0x1f4,_0x4f62ee['message']));});});}; \ No newline at end of file +var _0xc0c5=['error','WhatsappAccount,\x20%s,\x20%s','message','result','WhatsappAccount','find','options','attributes','include','map','model','ShowWhatsappAccount','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1a1856,_0x51f362){var _0x53dfe7=function(_0x56e1bf){while(--_0x56e1bf){_0x1a1856['push'](_0x1a1856['shift']());}};_0x53dfe7(++_0x51f362);}(_0xc0c5,0x7a));var _0x5c0c=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0xc0c5[_0x23c6f2];return _0x4c270b;};'use strict';var _=require(_0x5c0c('0x0'));var util=require(_0x5c0c('0x1'));var moment=require(_0x5c0c('0x2'));var BPromise=require(_0x5c0c('0x3'));var rs=require(_0x5c0c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c0c('0x5'));var logger=require(_0x5c0c('0x6'))(_0x5c0c('0x7'));var config=require(_0x5c0c('0x8'));var jayson=require(_0x5c0c('0x9'));var client=jayson[_0x5c0c('0xa')][_0x5c0c('0xb')]({'port':0x232a});config[_0x5c0c('0xc')]=_[_0x5c0c('0xd')](config[_0x5c0c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c0c('0xe'))(new Redis(config[_0x5c0c('0xc')]));require(_0x5c0c('0xf'))[_0x5c0c('0x10')](socket);function respondWithRpcPromise(_0x339073,_0x4f67be,_0xed89a3){return new BPromise(function(_0x5d2f3d,_0x1b6a76){return client[_0x5c0c('0x11')](_0x339073,_0xed89a3)['then'](function(_0x2b4749){logger[_0x5c0c('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x4f67be,_0x5c0c('0x13'));logger[_0x5c0c('0x14')](_0x5c0c('0x15'),_0x4f67be,'request\x20sent',JSON['stringify'](_0x2b4749));if(_0x2b4749[_0x5c0c('0x16')]){if(_0x2b4749['error']['code']===0x1f4){logger[_0x5c0c('0x16')](_0x5c0c('0x17'),_0x4f67be,_0x2b4749[_0x5c0c('0x16')][_0x5c0c('0x18')]);return _0x1b6a76(_0x2b4749[_0x5c0c('0x16')][_0x5c0c('0x18')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4f67be,_0x2b4749[_0x5c0c('0x16')][_0x5c0c('0x18')]);return _0x5d2f3d(_0x2b4749[_0x5c0c('0x16')]['message']);}else{logger['info'](_0x5c0c('0x17'),_0x4f67be,'request\x20sent');_0x5d2f3d(_0x2b4749[_0x5c0c('0x19')][_0x5c0c('0x18')]);}})['catch'](function(_0x359d7a){logger[_0x5c0c('0x16')](_0x5c0c('0x17'),_0x4f67be,_0x359d7a);_0x1b6a76(_0x359d7a);});});}exports['ShowWhatsappAccount']=function(_0x142098){var _0x339ccf=this;return new Promise(function(_0xa2edff,_0x5cf200){return db[_0x5c0c('0x1a')][_0x5c0c('0x1b')]({'raw':_0x142098[_0x5c0c('0x1c')]?_0x142098[_0x5c0c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x142098[_0x5c0c('0x1c')]?_0x142098[_0x5c0c('0x1c')]['where']||null:null,'attributes':_0x142098['options']?_0x142098[_0x5c0c('0x1c')][_0x5c0c('0x1d')]||null:null,'include':_0x142098['options']?_0x142098[_0x5c0c('0x1c')][_0x5c0c('0x1e')]?_[_0x5c0c('0x1f')](_0x142098[_0x5c0c('0x1c')][_0x5c0c('0x1e')],function(_0x1c537f){return{'model':db[_0x1c537f[_0x5c0c('0x20')]],'as':_0x1c537f['as'],'attributes':_0x1c537f[_0x5c0c('0x1d')],'include':_0x1c537f['include']?_['map'](_0x1c537f['include'],function(_0x1942ae){return{'model':db[_0x1942ae[_0x5c0c('0x20')]],'as':_0x1942ae['as'],'attributes':_0x1942ae[_0x5c0c('0x1d')],'include':_0x1942ae[_0x5c0c('0x1e')]?_[_0x5c0c('0x1f')](_0x1942ae[_0x5c0c('0x1e')],function(_0x1de2dd){return{'model':db[_0x1de2dd[_0x5c0c('0x20')]],'as':_0x1de2dd['as'],'attributes':_0x1de2dd[_0x5c0c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x475242){logger['info'](_0x5c0c('0x21'),_0x142098);logger[_0x5c0c('0x14')](_0x5c0c('0x21'),_0x142098,JSON[_0x5c0c('0x22')](_0x475242));_0xa2edff(_0x475242);})[_0x5c0c('0x23')](function(_0xa242bc){logger[_0x5c0c('0x16')](_0x5c0c('0x21'),_0xa242bc[_0x5c0c('0x18')],_0x142098);_0x5cf200(_0x339ccf[_0x5c0c('0x16')](0x1f4,_0xa242bc[_0x5c0c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7eda509..1d0e3f4 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 _0x9280=['length','whatsappAccount:','save','remove','update','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9280,0x92));var _0x0928=function(_0x5102fa,_0x7ffdb0){_0x5102fa=_0x5102fa-0x0;var _0x53c822=_0x9280[_0x5102fa];return _0x53c822;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x0928('0x0'),_0x0928('0x1'),_0x0928('0x2')];function createListener(_0x403c30,_0x4df119){return function(_0x45ba0a){_0x4df119['emit'](_0x403c30,_0x45ba0a);};}function removeListener(_0x48897b,_0x264464){return function(){WhatsappAccountEvents['removeListener'](_0x48897b,_0x264464);};}exports[_0x0928('0x3')]=function(_0x2ec533){for(var _0x165579=0x0,_0x29d46c=events[_0x0928('0x4')];_0x165579<_0x29d46c;_0x165579++){var _0x40c364=events[_0x165579];var _0xa3777a=createListener(_0x0928('0x5')+_0x40c364,_0x2ec533);WhatsappAccountEvents['on'](_0x40c364,_0xa3777a);}}; \ No newline at end of file +var _0x21ea=['update','emit','removeListener','register','length','whatsappAccount:','save'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x21ea,0xd1));var _0xa21e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x21ea[_0x47a7d0];return _0xb9bd08;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xa21e('0x0'),'remove',_0xa21e('0x1')];function createListener(_0x2b8989,_0x49603e){return function(_0x5cce5a){_0x49603e[_0xa21e('0x2')](_0x2b8989,_0x5cce5a);};}function removeListener(_0x4f044f,_0x41e792){return function(){WhatsappAccountEvents[_0xa21e('0x3')](_0x4f044f,_0x41e792);};}exports[_0xa21e('0x4')]=function(_0x4fad1e){for(var _0x1dc999=0x0,_0x52ff34=events[_0xa21e('0x5')];_0x1dc999<_0x52ff34;_0x1dc999++){var _0x39988b=events[_0x1dc999];var _0x4117f7=createListener(_0xa21e('0x6')+_0x39988b,_0x4fad1e);WhatsappAccountEvents['on'](_0x39988b,_0x4117f7);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3034daf..246a58a 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 _0x5668=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','show','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4dc763,_0x22bff4){var _0x292fe1=function(_0x409c8a){while(--_0x409c8a){_0x4dc763['push'](_0x4dc763['shift']());}};_0x292fe1(++_0x22bff4);}(_0x5668,0x13d));var _0x8566=function(_0x3e801d,_0x568036){_0x3e801d=_0x3e801d-0x0;var _0x5a9008=_0x5668[_0x3e801d];return _0x5a9008;};'use strict';var multer=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var path=require(_0x8566('0x2'));var timeout=require(_0x8566('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8566('0x4'));var auth=require(_0x8566('0x5'));var interaction=require(_0x8566('0x6'));var config=require(_0x8566('0x7'));var controller=require(_0x8566('0x8'));router[_0x8566('0x9')]('/',auth['isAuthenticated'](),controller[_0x8566('0xa')]);router[_0x8566('0x9')]('/:id',auth[_0x8566('0xb')](),controller[_0x8566('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8566('0xd')]);router[_0x8566('0xe')](_0x8566('0xf'),auth[_0x8566('0xb')](),controller['update']);router[_0x8566('0x10')](_0x8566('0xf'),auth[_0x8566('0xb')](),controller[_0x8566('0x11')]);module[_0x8566('0x12')]=router; \ No newline at end of file +var _0x724a=['index','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x724a,0x106));var _0xa724=function(_0x14122b,_0x1df7c5){_0x14122b=_0x14122b-0x0;var _0x1b0b9d=_0x724a[_0x14122b];return _0x1b0b9d;};'use strict';var multer=require(_0xa724('0x0'));var util=require(_0xa724('0x1'));var path=require(_0xa724('0x2'));var timeout=require(_0xa724('0x3'));var express=require('express');var router=express[_0xa724('0x4')]();var fs_extra=require(_0xa724('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa724('0x6'));var config=require(_0xa724('0x7'));var controller=require('./whatsappApplication.controller');router[_0xa724('0x8')]('/',auth[_0xa724('0x9')](),controller[_0xa724('0xa')]);router[_0xa724('0x8')](_0xa724('0xb'),auth[_0xa724('0x9')](),controller[_0xa724('0xc')]);router[_0xa724('0xd')]('/',auth[_0xa724('0x9')](),controller[_0xa724('0xe')]);router['put'](_0xa724('0xb'),auth['isAuthenticated'](),controller[_0xa724('0xf')]);router[_0xa724('0x10')](_0xa724('0xb'),auth[_0xa724('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 664b0c4..bee1b2b 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 _0xf990=['noop','sequelize','exports','INTEGER','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf990,0x146));var _0x0f99=function(_0x50b033,_0x126481){_0x50b033=_0x50b033-0x0;var _0x5ae38f=_0xf990[_0x50b033];return _0x5ae38f;};'use strict';var Sequelize=require(_0x0f99('0x0'));module[_0x0f99('0x1')]={'priority':{'type':Sequelize[_0x0f99('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0f99('0x3')],'allowNull':![],'defaultValue':_0x0f99('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0f99('0x3')]},'interval':{'type':Sequelize[_0x0f99('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6a77=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x4e13cd,_0x40971c){var _0x1a6c91=function(_0x135344){while(--_0x135344){_0x4e13cd['push'](_0x4e13cd['shift']());}};_0x1a6c91(++_0x40971c);}(_0x6a77,0x133));var _0x76a7=function(_0xe61dec,_0xb2372d){_0xe61dec=_0xe61dec-0x0;var _0x4f3f6d=_0x6a77[_0xe61dec];return _0x4f3f6d;};'use strict';var Sequelize=require(_0x76a7('0x0'));module[_0x76a7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x76a7('0x2')],'allowNull':![],'defaultValue':_0x76a7('0x3')},'appdata':{'type':Sequelize[_0x76a7('0x4')]()},'description':{'type':Sequelize[_0x76a7('0x2')]},'interval':{'type':Sequelize[_0x76a7('0x2')],'defaultValue':_0x76a7('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index eb26080..0161459 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 _0x9512=['update','then','destroy','error','stack','name','send','WhatsappApplication','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x7cec73,_0x473323){var _0x42ef34=function(_0x13384b){while(--_0x13384b){_0x7cec73['push'](_0x7cec73['shift']());}};_0x42ef34(++_0x473323);}(_0x9512,0x75));var _0x2951=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0x9512[_0x3815c2];return _0x271f88;};'use strict';var emlformat=require(_0x2951('0x0'));var rimraf=require(_0x2951('0x1'));var zipdir=require(_0x2951('0x2'));var jsonpatch=require(_0x2951('0x3'));var rp=require(_0x2951('0x4'));var moment=require(_0x2951('0x5'));var BPromise=require(_0x2951('0x6'));var Mustache=require('mustache');var util=require(_0x2951('0x7'));var path=require(_0x2951('0x8'));var sox=require(_0x2951('0x9'));var csv=require(_0x2951('0xa'));var ejs=require(_0x2951('0xb'));var fs=require('fs');var fs_extra=require(_0x2951('0xc'));var _=require(_0x2951('0xd'));var squel=require('squel');var crypto=require(_0x2951('0xe'));var jsforce=require(_0x2951('0xf'));var deskjs=require(_0x2951('0x10'));var toCsv=require(_0x2951('0xa'));var querystring=require(_0x2951('0x11'));var Papa=require(_0x2951('0x12'));var Redis=require('ioredis');var authService=require(_0x2951('0x13'));var qs=require(_0x2951('0x14'));var as=require(_0x2951('0x15'));var hardwareService=require(_0x2951('0x16'));var logger=require('../../config/logger')(_0x2951('0x17'));var utils=require(_0x2951('0x18'));var config=require(_0x2951('0x19'));var licenseUtil=require(_0x2951('0x1a'));var db=require(_0x2951('0x1b'))['db'];function respondWithStatusCode(_0x48a757,_0x3ca182){_0x3ca182=_0x3ca182||0xcc;return function(_0x2dc786){if(_0x2dc786){return _0x48a757[_0x2951('0x1c')](_0x3ca182);}return _0x48a757[_0x2951('0x1d')](_0x3ca182)[_0x2951('0x1e')]();};}function respondWithResult(_0x13a494,_0x240479){_0x240479=_0x240479||0xc8;return function(_0x25d7fc){if(_0x25d7fc){return _0x13a494[_0x2951('0x1d')](_0x240479)[_0x2951('0x1f')](_0x25d7fc);}};}function respondWithFilteredResult(_0x40de23,_0x402072){return function(_0x3ea695){if(_0x3ea695){var _0x5750e9=typeof _0x402072[_0x2951('0x20')]===_0x2951('0x21')&&typeof _0x402072[_0x2951('0x22')]===_0x2951('0x21');var _0x3d0a9c=_0x3ea695[_0x2951('0x23')];var _0x4a9cb2=_0x5750e9?0x0:_0x402072[_0x2951('0x20')];var _0xdbc682=_0x5750e9?_0x3ea695[_0x2951('0x23')]:_0x402072[_0x2951('0x20')]+_0x402072[_0x2951('0x22')];var _0x54e060;if(_0xdbc682>=_0x3d0a9c){_0xdbc682=_0x3d0a9c;_0x54e060=0xc8;}else{_0x54e060=0xce;}_0x40de23['status'](_0x54e060);return _0x40de23[_0x2951('0x24')](_0x2951('0x25'),_0x4a9cb2+'-'+_0xdbc682+'/'+_0x3d0a9c)[_0x2951('0x1f')](_0x3ea695);}return null;};}function patchUpdates(_0x367343){return function(_0x55e473){try{jsonpatch['apply'](_0x55e473,_0x367343,!![]);}catch(_0x2b8938){return BPromise['reject'](_0x2b8938);}return _0x55e473[_0x2951('0x26')]();};}function saveUpdates(_0x17f5d0,_0x24a027){return function(_0x579f2b){if(_0x579f2b){return _0x579f2b[_0x2951('0x27')](_0x17f5d0)[_0x2951('0x28')](function(_0x567fcd){return _0x567fcd;});}return null;};}function removeEntity(_0x22c841,_0x3e86b0){return function(_0x4afea7){if(_0x4afea7){return _0x4afea7[_0x2951('0x29')]()[_0x2951('0x28')](function(){_0x22c841[_0x2951('0x1d')](0xcc)[_0x2951('0x1e')]();});}};}function handleEntityNotFound(_0x5ee6e2,_0x1269d5){return function(_0x7082b){if(!_0x7082b){_0x5ee6e2[_0x2951('0x1c')](0x194);}return _0x7082b;};}function handleError(_0x1acb0a,_0xaa447c){_0xaa447c=_0xaa447c||0x1f4;return function(_0x263380){logger[_0x2951('0x2a')](_0x263380[_0x2951('0x2b')]);if(_0x263380[_0x2951('0x2c')]){delete _0x263380['name'];}_0x1acb0a[_0x2951('0x1d')](_0xaa447c)[_0x2951('0x2d')](_0x263380);};}exports['index']=function(_0x1bfca1,_0x287628){var _0x233c14={},_0xd55127={},_0x275824={'count':0x0,'rows':[]};var _0x2dc926=_['map'](db[_0x2951('0x2e')][_0x2951('0x2f')],function(_0x53b493){return{'name':_0x53b493[_0x2951('0x30')],'type':_0x53b493[_0x2951('0x31')]['key']};});_0xd55127[_0x2951('0x32')]=_[_0x2951('0x33')](_0x2dc926,_0x2951('0x2c'));_0xd55127['query']=_[_0x2951('0x34')](_0x1bfca1[_0x2951('0x35')]);_0xd55127[_0x2951('0x36')]=_[_0x2951('0x37')](_0xd55127[_0x2951('0x32')],_0xd55127['query']);_0x233c14['attributes']=_[_0x2951('0x37')](_0xd55127[_0x2951('0x32')],qs['fields'](_0x1bfca1[_0x2951('0x35')][_0x2951('0x38')]));_0x233c14[_0x2951('0x39')]=_0x233c14['attributes'][_0x2951('0x3a')]?_0x233c14[_0x2951('0x39')]:_0xd55127['model'];if(!_0x1bfca1[_0x2951('0x35')][_0x2951('0x3b')](_0x2951('0x3c'))){_0x233c14['limit']=qs[_0x2951('0x22')](_0x1bfca1[_0x2951('0x35')]['limit']);_0x233c14['offset']=qs[_0x2951('0x20')](_0x1bfca1[_0x2951('0x35')][_0x2951('0x20')]);}_0x233c14[_0x2951('0x3d')]=qs[_0x2951('0x3e')](_0x1bfca1['query']['sort']);_0x233c14[_0x2951('0x3f')]=qs[_0x2951('0x36')](_['pick'](_0x1bfca1['query'],_0xd55127[_0x2951('0x36')]),_0x2dc926);if(_0x1bfca1[_0x2951('0x35')][_0x2951('0x40')]){_0x233c14[_0x2951('0x3f')]=_['merge'](_0x233c14[_0x2951('0x3f')],{'$or':_[_0x2951('0x33')](_0x2dc926,function(_0x39d292){if(_0x39d292[_0x2951('0x31')]!==_0x2951('0x41')){var _0x3eabe9={};_0x3eabe9[_0x39d292[_0x2951('0x2c')]]={'$like':'%'+_0x1bfca1[_0x2951('0x35')][_0x2951('0x40')]+'%'};return _0x3eabe9;}})});}_0x233c14=_[_0x2951('0x42')]({},_0x233c14,_0x1bfca1[_0x2951('0x43')]);var _0x4aefb9={'where':_0x233c14[_0x2951('0x3f')]};return db['WhatsappApplication'][_0x2951('0x23')](_0x4aefb9)[_0x2951('0x28')](function(_0x23fc09){_0x275824['count']=_0x23fc09;if(_0x1bfca1[_0x2951('0x35')][_0x2951('0x44')]){_0x233c14[_0x2951('0x45')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x2951('0x46')](_0x233c14);})[_0x2951('0x28')](function(_0x37fb45){_0x275824[_0x2951('0x47')]=_0x37fb45;return _0x275824;})[_0x2951('0x28')](respondWithFilteredResult(_0x287628,_0x233c14))[_0x2951('0x48')](handleError(_0x287628,null));};exports[_0x2951('0x49')]=function(_0x259dfa,_0x180a04){var _0x1091f9={'raw':!![],'where':{'id':_0x259dfa[_0x2951('0x4a')]['id']}},_0x97f532={};_0x97f532[_0x2951('0x32')]=_[_0x2951('0x34')](db[_0x2951('0x2e')][_0x2951('0x2f')]);_0x97f532[_0x2951('0x35')]=_['keys'](_0x259dfa[_0x2951('0x35')]);_0x97f532[_0x2951('0x36')]=_[_0x2951('0x37')](_0x97f532['model'],_0x97f532[_0x2951('0x35')]);_0x1091f9[_0x2951('0x39')]=_['intersection'](_0x97f532[_0x2951('0x32')],qs[_0x2951('0x38')](_0x259dfa[_0x2951('0x35')][_0x2951('0x38')]));_0x1091f9['attributes']=_0x1091f9['attributes'][_0x2951('0x3a')]?_0x1091f9[_0x2951('0x39')]:_0x97f532[_0x2951('0x32')];if(_0x259dfa[_0x2951('0x35')][_0x2951('0x44')]){_0x1091f9[_0x2951('0x45')]=[{'all':!![]}];}_0x1091f9=_[_0x2951('0x42')]({},_0x1091f9,_0x259dfa[_0x2951('0x43')]);return db[_0x2951('0x2e')][_0x2951('0x4b')](_0x1091f9)[_0x2951('0x28')](handleEntityNotFound(_0x180a04,null))[_0x2951('0x28')](respondWithResult(_0x180a04,null))['catch'](handleError(_0x180a04,null));};exports[_0x2951('0x4c')]=function(_0x1e68bc,_0x4b3382){return db[_0x2951('0x2e')][_0x2951('0x4c')](_0x1e68bc['body'],{})[_0x2951('0x28')](respondWithResult(_0x4b3382,0xc9))[_0x2951('0x48')](handleError(_0x4b3382,null));};exports['update']=function(_0x44cfa1,_0x5c11ef){if(_0x44cfa1['body']['id']){delete _0x44cfa1[_0x2951('0x4d')]['id'];}return db[_0x2951('0x2e')][_0x2951('0x4b')]({'where':{'id':_0x44cfa1[_0x2951('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c11ef,null))['then'](saveUpdates(_0x44cfa1[_0x2951('0x4d')],null))[_0x2951('0x28')](respondWithResult(_0x5c11ef,null))['catch'](handleError(_0x5c11ef,null));};exports['destroy']=function(_0x4bbcfd,_0xf1adc8){return db[_0x2951('0x2e')][_0x2951('0x4b')]({'where':{'id':_0x4bbcfd[_0x2951('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf1adc8,null))['then'](removeEntity(_0xf1adc8,null))[_0x2951('0x48')](handleError(_0xf1adc8,null));}; \ No newline at end of file +var _0x8f4c=['../../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','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','WhatsappApplication','includeAll','include','findAll','catch','show','params','find','create','update','body','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'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x8f4c,0x113));var _0xc8f4=function(_0x4ab7a6,_0x32b113){_0x4ab7a6=_0x4ab7a6-0x0;var _0x38d525=_0x8f4c[_0x4ab7a6];return _0x38d525;};'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(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x177a44,_0x3dd717){return function(_0x5c94c6){if(!_0x5c94c6){_0x177a44[_0xc8f4('0x17')](0x194);}return _0x5c94c6;};}function handleError(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0x1f4;return function(_0x2fa052){logger['error'](_0x2fa052[_0xc8f4('0x26')]);if(_0x2fa052[_0xc8f4('0x27')]){delete _0x2fa052['name'];}_0x21062f[_0xc8f4('0x18')](_0x11f766)[_0xc8f4('0x28')](_0x2fa052);};}exports[_0xc8f4('0x29')]=function(_0x1b70bc,_0x24bef0){var _0x385e41={},_0x4a25da={},_0x45f972={'count':0x0,'rows':[]};var _0x24bb78=_[_0xc8f4('0x2a')](db['WhatsappApplication'][_0xc8f4('0x2b')],function(_0x3a4b1b){return{'name':_0x3a4b1b['fieldName'],'type':_0x3a4b1b['type']['key']};});_0x4a25da[_0xc8f4('0x2c')]=_[_0xc8f4('0x2a')](_0x24bb78,_0xc8f4('0x27'));_0x4a25da[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x1b70bc[_0xc8f4('0x2d')]);_0x4a25da[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x4a25da['model'],_0x4a25da[_0xc8f4('0x2d')]);_0x385e41[_0xc8f4('0x31')]=_[_0xc8f4('0x30')](_0x4a25da['model'],qs[_0xc8f4('0x32')](_0x1b70bc[_0xc8f4('0x2d')]['fields']));_0x385e41[_0xc8f4('0x31')]=_0x385e41[_0xc8f4('0x31')][_0xc8f4('0x33')]?_0x385e41['attributes']:_0x4a25da[_0xc8f4('0x2c')];if(!_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x34')]('nolimit')){_0x385e41[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1e')]);_0x385e41[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1d')]);}_0x385e41[_0xc8f4('0x35')]=qs[_0xc8f4('0x36')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x36')]);_0x385e41[_0xc8f4('0x37')]=qs[_0xc8f4('0x2f')](_[_0xc8f4('0x38')](_0x1b70bc[_0xc8f4('0x2d')],_0x4a25da['filters']),_0x24bb78);if(_0x1b70bc[_0xc8f4('0x2d')]['filter']){_0x385e41[_0xc8f4('0x37')]=_['merge'](_0x385e41[_0xc8f4('0x37')],{'$or':_[_0xc8f4('0x2a')](_0x24bb78,function(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x39')]!==_0xc8f4('0x3a')){var _0x724060={};_0x724060[_0x7ef69a[_0xc8f4('0x27')]]={'$like':'%'+_0x1b70bc['query'][_0xc8f4('0x3b')]+'%'};return _0x724060;}})});}_0x385e41=_[_0xc8f4('0x3c')]({},_0x385e41,_0x1b70bc[_0xc8f4('0x3d')]);var _0x14ce2e={'where':_0x385e41['where']};return db[_0xc8f4('0x3e')][_0xc8f4('0x1c')](_0x14ce2e)[_0xc8f4('0x24')](function(_0x1d0b2d){_0x45f972[_0xc8f4('0x1c')]=_0x1d0b2d;if(_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x385e41[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x3e')][_0xc8f4('0x41')](_0x385e41);})[_0xc8f4('0x24')](function(_0xd56415){_0x45f972['rows']=_0xd56415;return _0x45f972;})[_0xc8f4('0x24')](respondWithFilteredResult(_0x24bef0,_0x385e41))[_0xc8f4('0x42')](handleError(_0x24bef0,null));};exports[_0xc8f4('0x43')]=function(_0x275f4a,_0x588ff9){var _0x49da16={'raw':!![],'where':{'id':_0x275f4a[_0xc8f4('0x44')]['id']}},_0x413a55={};_0x413a55['model']=_[_0xc8f4('0x2e')](db[_0xc8f4('0x3e')]['rawAttributes']);_0x413a55['query']=_[_0xc8f4('0x2e')](_0x275f4a[_0xc8f4('0x2d')]);_0x413a55[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x413a55[_0xc8f4('0x2c')],_0x413a55[_0xc8f4('0x2d')]);_0x49da16['attributes']=_['intersection'](_0x413a55[_0xc8f4('0x2c')],qs[_0xc8f4('0x32')](_0x275f4a[_0xc8f4('0x2d')]['fields']));_0x49da16['attributes']=_0x49da16['attributes']['length']?_0x49da16['attributes']:_0x413a55[_0xc8f4('0x2c')];if(_0x275f4a[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x49da16[_0xc8f4('0x40')]=[{'all':!![]}];}_0x49da16=_[_0xc8f4('0x3c')]({},_0x49da16,_0x275f4a[_0xc8f4('0x3d')]);return db['WhatsappApplication'][_0xc8f4('0x45')](_0x49da16)[_0xc8f4('0x24')](handleEntityNotFound(_0x588ff9,null))['then'](respondWithResult(_0x588ff9,null))['catch'](handleError(_0x588ff9,null));};exports[_0xc8f4('0x46')]=function(_0x82a5e,_0x3ca0d6){return db[_0xc8f4('0x3e')]['create'](_0x82a5e['body'],{})[_0xc8f4('0x24')](respondWithResult(_0x3ca0d6,0xc9))[_0xc8f4('0x42')](handleError(_0x3ca0d6,null));};exports[_0xc8f4('0x47')]=function(_0x2bc4db,_0x141f81){if(_0x2bc4db[_0xc8f4('0x48')]['id']){delete _0x2bc4db['body']['id'];}return db['WhatsappApplication'][_0xc8f4('0x45')]({'where':{'id':_0x2bc4db[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x141f81,null))[_0xc8f4('0x24')](saveUpdates(_0x2bc4db[_0xc8f4('0x48')],null))[_0xc8f4('0x24')](respondWithResult(_0x141f81,null))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports[_0xc8f4('0x25')]=function(_0x3d9d67,_0x5b4035){return db['WhatsappApplication'][_0xc8f4('0x45')]({'where':{'id':_0x3d9d67[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x5b4035,null))[_0xc8f4('0x24')](removeEntity(_0x5b4035,null))[_0xc8f4('0x42')](handleError(_0x5b4035,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index d349f6d..b88e4d1 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 _0x2a3a=['./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x1042fa,_0x433b12){var _0x250863=function(_0x8122e4){while(--_0x8122e4){_0x1042fa['push'](_0x1042fa['shift']());}};_0x250863(++_0x433b12);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x3650ac,_0x2e2859){_0x3650ac=_0x3650ac-0x0;var _0x381453=_0x2a3a[_0x3650ac];return _0x381453;};'use strict';var _=require(_0xa2a3('0x0'));var util=require(_0xa2a3('0x1'));var logger=require(_0xa2a3('0x2'))(_0xa2a3('0x3'));var moment=require(_0xa2a3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2a3('0x5'));var rimraf=require(_0xa2a3('0x6'));var config=require(_0xa2a3('0x7'));var attributes=require(_0xa2a3('0x8'));module[_0xa2a3('0x9')]=function(_0xf652d7,_0x186655){return _0xf652d7['define'](_0xa2a3('0xa'),attributes,{'tableName':_0xa2a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2a3('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7f42=['bluebird','path','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x7f42,0x1dd));var _0x27f4=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7f42[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require('moment');var BPromise=require(_0x27f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27f4('0x4'));var rimraf=require('rimraf');var config=require(_0x27f4('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0x27f4('0x6')]=function(_0x5c9286,_0x256ac9){return _0x5c9286[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27f4('0xa'),'collate':_0x27f4('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 5537af9..040a18c 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x271b53,_0x53c008){var _0x157909=function(_0x4c921c){while(--_0x4c921c){_0x271b53['push'](_0x271b53['shift']());}};_0x157909(++_0x53c008);}(_0x425d,0x1e0));var _0xd425=function(_0xa21fee,_0x11d555){_0xa21fee=_0xa21fee-0x0;var _0x467965=_0x425d[_0xa21fee];return _0x467965;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});} \ No newline at end of file +var _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x7bae[_0x5e36d1];return _0x950b9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 80722e7..5886406 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 _0x6b8f=['/:id/messages','getMessages','post','create','addMessage','tracked','whatsapp','addTags','whatsappinteraction:update','delete','/:id/tags','removeTags','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x140f08,_0x4b90db){var _0x1d79cd=function(_0x1489ac){while(--_0x1489ac){_0x140f08['push'](_0x140f08['shift']());}};_0x1d79cd(++_0x4b90db);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x563ffe,_0x1170f8){_0x563ffe=_0x563ffe-0x0;var _0xdb507f=_0x6b8f[_0x563ffe];return _0xdb507f;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0x6')](_0xf6b8('0xc'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf6b8('0xe')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);router[_0xf6b8('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf6b8('0x10')]);router[_0xf6b8('0xe')]('/:id/tags',auth[_0xf6b8('0x9')](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),'whatsappinteraction:addtags'),controller[_0xf6b8('0x13')]);router['put'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),_0xf6b8('0x14')),controller['update']);router['delete'](_0xf6b8('0xa'),auth['isAuthenticated'](),interaction[_0xf6b8('0x11')](_0xf6b8('0x12'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xf6b8('0x15')](_0xf6b8('0x16'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf072=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','/:id/tags','removeTags'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xf072,0x1cf));var _0x2f07=function(_0x40e77b,_0x35c9d6){_0x40e77b=_0x40e77b-0x0;var _0x58c769=_0xf072[_0x40e77b];return _0x58c769;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0x8')](_0x2f07('0xf'),auth[_0x2f07('0x9')](),controller['getMessages']);router[_0x2f07('0x8')](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f07('0x12')]);router[_0x2f07('0x13')]('/:id/messages',auth[_0x2f07('0x9')](),controller[_0x2f07('0x14')]);router[_0x2f07('0x13')]('/:id/tags',auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),_0x2f07('0x17')),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')]('/:id',auth[_0x2f07('0x9')](),interaction['tracked'](_0x2f07('0x16'),_0x2f07('0x1a')),controller[_0x2f07('0x1b')]);router[_0x2f07('0x1c')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),'whatsappinteraction:destroy'),controller[_0x2f07('0x1d')]);router['delete'](_0x2f07('0x1e'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x1f')]);module[_0x2f07('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 cefb128..98742ef 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 _0x41fe=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xd7f258,_0x4d054f){var _0x255d4c=function(_0x3e8f74){while(--_0x3e8f74){_0xd7f258['push'](_0xd7f258['shift']());}};_0x255d4c(++_0x4d054f);}(_0x41fe,0xd1));var _0xe41f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x41fe[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0xe41f('0x0'));var moment=require(_0xe41f('0x1'));module[_0xe41f('0x2')]={'closed':{'type':Sequelize[_0xe41f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe41f('0x4')]},'disposition':{'type':Sequelize[_0xe41f('0x5')]},'secondDisposition':{'type':Sequelize[_0xe41f('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe41f('0x5')]},'note':{'type':Sequelize[_0xe41f('0x5')]},'phone':{'type':Sequelize[_0xe41f('0x5')]},'read1stAt':{'type':Sequelize[_0xe41f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe41f('0x6')]('in',_0xe41f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe41f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe41f('0x6')]('in',_0xe41f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe41f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ff3=['out','ENUM','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x28ad8b,_0x47975a){var _0x30d0b9=function(_0xa859a5){while(--_0xa859a5){_0x28ad8b['push'](_0x28ad8b['shift']());}};_0x30d0b9(++_0x47975a);}(_0x8ff3,0x72));var _0x38ff=function(_0x59ce68,_0x98d1b5){_0x59ce68=_0x59ce68-0x0;var _0x37c816=_0x8ff3[_0x59ce68];return _0x37c816;};'use strict';var Sequelize=require(_0x38ff('0x0'));var moment=require(_0x38ff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x38ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x38ff('0x3')]},'disposition':{'type':Sequelize[_0x38ff('0x4')]},'secondDisposition':{'type':Sequelize[_0x38ff('0x4')]},'thirdDisposition':{'type':Sequelize[_0x38ff('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x38ff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x38ff('0x6')]('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x38ff('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c5763a0..cb792e0 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 _0x0c6b=['end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','pick','select','field','color','from','tools_tags','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','push','all','rows','show','params','include','merge','options','create','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','createdAt','WhatsappAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','disposition','basename','existsSync','pipe','direction','out','System','Contact','firstName','views','downloadInteraction.ejs','transcript-','Whatsapp','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status'];(function(_0x50c944,_0x33e196){var _0x29eefa=function(_0x116939){while(--_0x116939){_0x50c944['push'](_0x50c944['shift']());}};_0x29eefa(++_0x33e196);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x32bc88,_0x40909b){_0x32bc88=_0x32bc88-0x0;var _0x106dc3=_0x0c6b[_0x32bc88];return _0x106dc3;};'use strict';var emlformat=require(_0xb0c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0c6('0x1'));var jsonpatch=require(_0xb0c6('0x2'));var rp=require(_0xb0c6('0x3'));var moment=require(_0xb0c6('0x4'));var BPromise=require(_0xb0c6('0x5'));var Mustache=require(_0xb0c6('0x6'));var util=require(_0xb0c6('0x7'));var path=require(_0xb0c6('0x8'));var sox=require(_0xb0c6('0x9'));var csv=require(_0xb0c6('0xa'));var ejs=require(_0xb0c6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb0c6('0xc'));var deskjs=require(_0xb0c6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb0c6('0xe'));var Redis=require(_0xb0c6('0xf'));var authService=require(_0xb0c6('0x10'));var qs=require(_0xb0c6('0x11'));var as=require(_0xb0c6('0x12'));var pdf=require(_0xb0c6('0x13'));var hardwareService=require(_0xb0c6('0x14'));var logger=require(_0xb0c6('0x15'))('api');var utils=require(_0xb0c6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb0c6('0x17'));var db=require(_0xb0c6('0x18'))['db'];config[_0xb0c6('0x19')]=_['defaults'](config[_0xb0c6('0x19')],{'host':_0xb0c6('0x1a'),'port':0x18eb});var socket=require(_0xb0c6('0x1b'))(new Redis(config[_0xb0c6('0x19')]));require(_0xb0c6('0x1c'))[_0xb0c6('0x1d')](socket);function respondWithStatusCode(_0xb021af,_0xf94004){_0xf94004=_0xf94004||0xcc;return function(_0x527b2c){if(_0x527b2c){return _0xb021af[_0xb0c6('0x1e')](_0xf94004);}return _0xb021af[_0xb0c6('0x1f')](_0xf94004)[_0xb0c6('0x20')]();};}function respondWithResult(_0xb6e21b,_0x4e4642){_0x4e4642=_0x4e4642||0xc8;return function(_0x19a09e){if(_0x19a09e){return _0xb6e21b[_0xb0c6('0x1f')](_0x4e4642)[_0xb0c6('0x21')](_0x19a09e);}};}function respondWithFilteredResult(_0x49a3a7,_0x188fc4){return function(_0xbbc184){if(_0xbbc184){var _0x210c54=typeof _0x188fc4[_0xb0c6('0x22')]===_0xb0c6('0x23')&&typeof _0x188fc4[_0xb0c6('0x24')]===_0xb0c6('0x23');var _0x5f49b8=_0xbbc184[_0xb0c6('0x25')];var _0xffd7fa=_0x210c54?0x0:_0x188fc4['offset'];var _0x50091c=_0x210c54?_0xbbc184[_0xb0c6('0x25')]:_0x188fc4[_0xb0c6('0x22')]+_0x188fc4[_0xb0c6('0x24')];var _0x52d002;if(_0x50091c>=_0x5f49b8){_0x50091c=_0x5f49b8;_0x52d002=0xc8;}else{_0x52d002=0xce;}_0x49a3a7['status'](_0x52d002);return _0x49a3a7[_0xb0c6('0x26')]('Content-Range',_0xffd7fa+'-'+_0x50091c+'/'+_0x5f49b8)[_0xb0c6('0x21')](_0xbbc184);}return null;};}function patchUpdates(_0x6508c1){return function(_0x110290){try{jsonpatch['apply'](_0x110290,_0x6508c1,!![]);}catch(_0x2b4d60){return BPromise[_0xb0c6('0x27')](_0x2b4d60);}return _0x110290[_0xb0c6('0x28')]();};}function saveUpdates(_0x340150,_0x1a3c46){return function(_0x38b714){if(_0x38b714){return _0x38b714[_0xb0c6('0x29')](_0x340150)[_0xb0c6('0x2a')](function(_0x3c43c3){return _0x3c43c3;});}return null;};}function removeEntity(_0x2a748c,_0x555470){return function(_0x19b471){if(_0x19b471){return _0x19b471[_0xb0c6('0x2b')]()[_0xb0c6('0x2a')](function(){_0x2a748c[_0xb0c6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e922e,_0x14f3d0){return function(_0x4ed574){if(!_0x4ed574){_0x5e922e['sendStatus'](0x194);}return _0x4ed574;};}function handleError(_0xe49839,_0x1d48f3){_0x1d48f3=_0x1d48f3||0x1f4;return function(_0x10c9a3){logger[_0xb0c6('0x2c')](_0x10c9a3[_0xb0c6('0x2d')]);if(_0x10c9a3[_0xb0c6('0x2e')]){delete _0x10c9a3[_0xb0c6('0x2e')];}_0xe49839[_0xb0c6('0x1f')](_0x1d48f3)[_0xb0c6('0x2f')](_0x10c9a3);};}function getInteractionUsers(_0x408a7b,_0x50cec8){return new BPromise(function(_0x9b9482,_0xe482db){try{if(_0x50cec8[_0x408a7b['id']]){_0x408a7b[_0xb0c6('0x30')]=_[_0xb0c6('0x31')](_0x50cec8[_0x408a7b['id']],function(_0x3613de){return{'id':_0x3613de['id'],'fullname':_0x3613de[_0xb0c6('0x32')]};});}}catch(_0x2282c2){_0xe482db(_0x2282c2);}_0x9b9482(_0x408a7b);});}function getInteractionTags(_0x29232c,_0x33ec86){return new BPromise(function(_0x1f3191,_0x18c7c5){try{if(_0x29232c['TagIds']){_0x29232c[_0xb0c6('0x33')]=[];_0x29232c[_0xb0c6('0x34')][_0xb0c6('0x35')](',')[_0xb0c6('0x36')](function(_0x264fe0){_0x29232c[_0xb0c6('0x33')]['push'](_0x33ec86[_0x264fe0]);});}delete _0x29232c[_0xb0c6('0x34')];}catch(_0xf0cf61){_0x18c7c5(_0xf0cf61);}_0x1f3191(_0x29232c);});}function updateWhatsappInteraction(_0x2f8321,_0x3c7f31,_0x42262f){return new BPromise(function(_0x2c50b0,_0x30e586){return getInteractionUsers(_0x2f8321,_0x42262f)[_0xb0c6('0x2a')](function(_0x2acff1){return getInteractionTags(_0x2acff1,_0x3c7f31);})[_0xb0c6('0x2a')](function(_0x45417e){return getStateInteraction(_0x45417e);})['then'](function(_0x3bf60c){_0x2c50b0(_0x3bf60c);})[_0xb0c6('0x37')](function(_0x4cfca2){_0x30e586(_0x4cfca2);});});}function getStateInteraction(_0x5ae6c7){return new BPromise(function(_0x3cd144){_0x5ae6c7[_0xb0c6('0x38')]=0x0;_0x5ae6c7[_0xb0c6('0x39')]=0x0;_0x5ae6c7[_0xb0c6('0x3a')]=0x0;_0x5ae6c7['unmanaged']=0x0;_0x5ae6c7[_0xb0c6('0x3b')]=0x0;if(!_0x5ae6c7[_0xb0c6('0x3c')]&&!_0x5ae6c7[_0xb0c6('0x3d')]){_0x5ae6c7[_0xb0c6('0x38')]+=0x1;}if(!_0x5ae6c7['closed']&&_0x5ae6c7[_0xb0c6('0x3d')]){_0x5ae6c7['talking']+=0x1;if(_0x5ae6c7[_0xb0c6('0x38')]){_0x5ae6c7[_0xb0c6('0x38')]-=0x1;}}if(_0x5ae6c7[_0xb0c6('0x3c')]&&_0x5ae6c7['UserId']){_0x5ae6c7[_0xb0c6('0x3a')]+=0x1;if(_0x5ae6c7[_0xb0c6('0x39')]){_0x5ae6c7['talking']-=0x1;}}if(_0x5ae6c7['closed']&&!_0x5ae6c7[_0xb0c6('0x3d')]){_0x5ae6c7[_0xb0c6('0x3e')]+=0x1;if(_0x5ae6c7[_0xb0c6('0x38')]){_0x5ae6c7[_0xb0c6('0x38')]-=0x1;}}_0x5ae6c7[_0xb0c6('0x3b')]+=0x1;_0x3cd144(_0x5ae6c7);});}exports[_0xb0c6('0x3f')]=function(_0x1dbf1b,_0x4bb5e8){var _0x2c4d7b={},_0x224ec1={},_0x113040={'count':0x0,'rows':[]};var _0x19d593=_['map'](db[_0xb0c6('0x40')][_0xb0c6('0x41')],function(_0x47e522){return{'name':_0x47e522['fieldName'],'type':_0x47e522[_0xb0c6('0x42')][_0xb0c6('0x43')]};});_0x224ec1[_0xb0c6('0x44')]=_[_0xb0c6('0x31')](_0x19d593,'name');_0x224ec1[_0xb0c6('0x45')]=_[_0xb0c6('0x46')](_0x1dbf1b[_0xb0c6('0x45')]);_0x224ec1[_0xb0c6('0x47')]=_[_0xb0c6('0x48')](_0x224ec1[_0xb0c6('0x44')],_0x224ec1['query']);_0x2c4d7b['attributes']=_[_0xb0c6('0x48')](_0x224ec1[_0xb0c6('0x44')],qs[_0xb0c6('0x49')](_0x1dbf1b['query'][_0xb0c6('0x49')]));_0x2c4d7b[_0xb0c6('0x4a')]=_0x2c4d7b['attributes'][_0xb0c6('0x4b')]?_0x2c4d7b[_0xb0c6('0x4a')]:_0x224ec1[_0xb0c6('0x44')];if(!_0x1dbf1b[_0xb0c6('0x45')]['hasOwnProperty']('nolimit')){_0x2c4d7b['limit']=qs['limit'](_0x1dbf1b[_0xb0c6('0x45')]['limit']);_0x2c4d7b[_0xb0c6('0x22')]=qs[_0xb0c6('0x22')](_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x22')]);}_0x2c4d7b[_0xb0c6('0x4c')]=qs[_0xb0c6('0x4d')](_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x4d')]);_0x2c4d7b['where']=qs['filters'](_[_0xb0c6('0x4e')](_0x1dbf1b[_0xb0c6('0x45')],_0x224ec1['filters']),_0x19d593);var _0xb86f84=[];var _0x548865=squel[_0xb0c6('0x4f')]()['field']('id')[_0xb0c6('0x50')](_0xb0c6('0x2e'))['field'](_0xb0c6('0x51'))[_0xb0c6('0x52')](_0xb0c6('0x53'));var _0x455fba=squel[_0xb0c6('0x4f')]()[_0xb0c6('0x50')]('u.id')[_0xb0c6('0x50')](_0xb0c6('0x54'))[_0xb0c6('0x50')]('ui.WhatsappInteractionId')[_0xb0c6('0x52')]('user_has_whatsapp_interactions','ui')[_0xb0c6('0x55')](_0xb0c6('0x56'),'u',_0xb0c6('0x57'));var _0x222e96=squel['select']()[_0xb0c6('0x52')](_0xb0c6('0x58'),'i')['left_join'](_0xb0c6('0x59'),'c',_0xb0c6('0x5a'))[_0xb0c6('0x55')](_0xb0c6('0x56'),'o',_0xb0c6('0x5b'))[_0xb0c6('0x55')]('whatsapp_accounts','a',_0xb0c6('0x5c'))['left_join'](_0xb0c6('0x5d'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join']('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0xb0c6('0x53'),'t',_0xb0c6('0x5e'));var _0x4fe0b4=squel[_0xb0c6('0x5f')]();var _0x158d5a=[];var _0x1c0115=squel[_0xb0c6('0x5f')]();var _0x416844;if(_0x1dbf1b['query'][_0xb0c6('0x60')]){_0x416844=as['parseSearch'](_0x1dbf1b[_0xb0c6('0x45')]['search']);var _0x27e0b1=_0x416844[_0xb0c6('0x61')];for(var _0x3fa007=0x0;_0x3fa007<_0x416844[_0xb0c6('0x62')][_0xb0c6('0x4b')];_0x3fa007++){var _0x67fc8d=_0x416844['conditions'][_0x3fa007];var _0x1e9fce='i';var _0x3626a1=_['find'](_0x19d593,[_0xb0c6('0x2e'),_0x67fc8d[_0xb0c6('0x50')]]);if(!_0x3626a1){switch(_0x67fc8d[_0xb0c6('0x50')]){case _0xb0c6('0x63'):if(_0x67fc8d[_0xb0c6('0x64')]==0x1){_0x222e96[_0xb0c6('0x65')]('`'+_0x67fc8d['field']+_0xb0c6('0x66'));}else{_0x222e96[_0xb0c6('0x65')]('`'+_0x67fc8d[_0xb0c6('0x50')]+_0xb0c6('0x67'));}break;case'Contact':if(_0x67fc8d['operator']==='$substring'){if(_0x67fc8d['value'][_0xb0c6('0x35')]('\x20')[_0xb0c6('0x4b')]>0x1){_0x4fe0b4[_0x27e0b1]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb0c6('0x68')](_0x67fc8d[_0xb0c6('0x64')]),null);}else{var _0x12be33='%'+_0x67fc8d[_0xb0c6('0x64')]+'%';_0x4fe0b4[_0x27e0b1](_0xb0c6('0x69'),_0x12be33,_0x12be33,_0x12be33);}}else{_0x3626a1=_[_0xb0c6('0x6a')](_0x19d593,['name',_0xb0c6('0x6b')]);_0x67fc8d[_0xb0c6('0x50')]=_0xb0c6('0x6b');_0x266217=as[_0xb0c6('0x6c')](_0x1e9fce,_0x3626a1[_0xb0c6('0x42')],_0x67fc8d);_0x4fe0b4[_0x27e0b1](_0x266217['text'],_0x266217[_0xb0c6('0x64')][_0xb0c6('0x6d')],_0x266217[_0xb0c6('0x64')][_0xb0c6('0x20')]);}break;case _0xb0c6('0x6e'):var _0x417668=_0x67fc8d[_0xb0c6('0x64')][_0xb0c6('0x35')](',')[_0xb0c6('0x31')](function(_0x5b26a5){return Number(_0x5b26a5);});_0x417668['forEach'](function(_0x4dc505){_0x1c0115['or'](_0xb0c6('0x6f'),'%,'+_0x4dc505+',%');});_0x158d5a=_['union'](_0x158d5a,_0x417668);break;case _0xb0c6('0x70'):if(_0x67fc8d['operator']===_0xb0c6('0x71')){_0x4fe0b4[_0x27e0b1](_0xb0c6('0x72'),'%'+_0x67fc8d[_0xb0c6('0x64')]+'%',null);}else{_0x3626a1=_['find'](_0x19d593,['name',_0xb0c6('0x3d')]);_0x67fc8d[_0xb0c6('0x50')]=_0xb0c6('0x3d');_0x266217=as[_0xb0c6('0x6c')](_0x1e9fce,_0x3626a1[_0xb0c6('0x42')],_0x67fc8d);_0x4fe0b4[_0x27e0b1](_0x266217[_0xb0c6('0x73')],_0x266217[_0xb0c6('0x64')]['start'],_0x266217[_0xb0c6('0x64')][_0xb0c6('0x20')]);}break;case _0xb0c6('0x74'):_0x266217=as[_0xb0c6('0x6c')]('me',null,_0x67fc8d);_0x4fe0b4[_0x27e0b1](_0x266217[_0xb0c6('0x73')],_0x266217[_0xb0c6('0x64')][_0xb0c6('0x6d')],_0x266217[_0xb0c6('0x64')]['end']);break;}}else{var _0x266217=as[_0xb0c6('0x6c')](_0x1e9fce,_0x3626a1[_0xb0c6('0x42')],_0x67fc8d);_0x4fe0b4[_0x27e0b1](_0x266217[_0xb0c6('0x73')],_0x266217[_0xb0c6('0x64')]['start'],_0x266217[_0xb0c6('0x64')][_0xb0c6('0x20')]);}}}else{var _0x55dcd4=_(_0x1dbf1b['query'])[_0xb0c6('0x46')]()[_0xb0c6('0x31')](function(_0x2e554c){return _[_0xb0c6('0x75')](_0x19d593,[_0xb0c6('0x2e'),_0x2e554c])?_0x2e554c:undefined;})[_0xb0c6('0x76')]()[_0xb0c6('0x64')]();if(!_['isEmpty'](_0x55dcd4)){_0x55dcd4[_0xb0c6('0x36')](function(_0x35db48){if(_0x35db48===_0xb0c6('0x77')){_0x222e96[_0xb0c6('0x78')](_0xb0c6('0x79'),[][_0xb0c6('0x7a')](_0x1dbf1b['query'][_0x35db48]));}else if(_0x35db48==='createdAt'){var _0x2b3641=JSON[_0xb0c6('0x7b')](_0x1dbf1b[_0xb0c6('0x45')][_0x35db48])[_0xb0c6('0x7c')];var _0x1a638c=JSON['parse'](_0x1dbf1b[_0xb0c6('0x45')][_0x35db48])['$lte'];_0x222e96[_0xb0c6('0x78')](_0xb0c6('0x7d'),_0x2b3641,_0x1a638c);}else{if(_0x1dbf1b[_0xb0c6('0x45')][_0x35db48]===_0xb0c6('0x7e')){_0x222e96['where']('i.'+_0x35db48+_0xb0c6('0x7f'));}else{_0x222e96['where']('i.'+_0x35db48+_0xb0c6('0x80'),_0x1dbf1b['query'][_0x35db48]);}}});}if(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x81')]){if(_0x1dbf1b['query'][_0xb0c6('0x81')]==0x1){_0x222e96['having'](_0xb0c6('0x82'));}else{_0x222e96[_0xb0c6('0x65')](_0xb0c6('0x83'));}}if(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x84')]){_0x158d5a=_['isArray'](_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x84')])?_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x84')]:new Array(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x84')]);_0x158d5a[_0xb0c6('0x36')](function(_0x562d6e){_0x1c0115['or'](_0xb0c6('0x6f'),'%,'+_0x562d6e+',%');});}if(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x85')]){var _0x371560=_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x85')][_0xb0c6('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb0c6('0x87')](_0x371560)){_0x4fe0b4['or']('i.id\x20LIKE\x20?',_0x371560+'%')['or']('i.phone\x20LIKE\x20?',_0x371560+'%');}else{_0x4fe0b4['or'](_0xb0c6('0x88'),qs['getFullTextValue'](_0x371560))['or'](_0xb0c6('0x89'),_0x371560+'%');}}}_0x222e96['where'](_0x4fe0b4);_0x222e96[_0xb0c6('0x8a')]('i.id');var _0x181153={'type':db[_0xb0c6('0x8b')][_0xb0c6('0x8c')]['SELECT'],'raw':!![]};var _0x43bfa4=_0x222e96[_0xb0c6('0x8d')]();_0x43bfa4['field'](_0xb0c6('0x8e'));_0x43bfa4['field'](_0xb0c6('0x8f'),_0xb0c6('0x63'));if(_0x2c4d7b['order']){_0x2c4d7b[_0xb0c6('0x4c')][_0xb0c6('0x36')](function(_0x5112cb){var _0xd88183=_0x5112cb[0x0]===_0xb0c6('0x90')?_0x5112cb[0x0]:'i.'+_0x5112cb[0x0];_0x222e96[_0xb0c6('0x4c')](_0xd88183,_0x5112cb[0x1]===_0xb0c6('0x91')?![]:!![]);});}if(!_[_0xb0c6('0x92')](_0x158d5a)){_0x222e96[_0xb0c6('0x65')](_0x1c0115);_0x43bfa4[_0xb0c6('0x78')](_0xb0c6('0x93'),_0x158d5a);}BPromise[_0xb0c6('0x94')]()['then'](function(){if(!_0x416844){if(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x77')])return;_0x43bfa4[_0xb0c6('0x78')](_0xb0c6('0x95'));_0x222e96[_0xb0c6('0x78')](_0xb0c6('0x95'));return;}if(_0x1dbf1b[_0xb0c6('0x96')]['role']!=='agent')return;return _0x1dbf1b[_0xb0c6('0x96')][_0xb0c6('0x97')]({'attributes':['id'],'raw':!![]})[_0xb0c6('0x2a')](function(_0x275a8c){if(_[_0xb0c6('0x92')](_0x275a8c)){_0x43bfa4[_0xb0c6('0x78')](_0xb0c6('0x98'));_0x222e96[_0xb0c6('0x78')](_0xb0c6('0x98'));}else{_0x43bfa4['where']('i.WhatsappAccountId\x20IN\x20?',_[_0xb0c6('0x31')](_0x275a8c,'id'));_0x222e96[_0xb0c6('0x78')](_0xb0c6('0x79'),_['map'](_0x275a8c,'id'));}});})[_0xb0c6('0x2a')](function(){if(_0x1dbf1b[_0xb0c6('0x96')][_0xb0c6('0x99')]===_0xb0c6('0x9a')&&!_0x416844&&!_0x1dbf1b['query']['WhatsappAccountId'])return[];return db[_0xb0c6('0x9b')][_0xb0c6('0x45')](_0x43bfa4['toString'](),_0x181153);})[_0xb0c6('0x2a')](function(_0x13c0f9){_0x113040[_0xb0c6('0x25')]=_0x13c0f9[_0xb0c6('0x4b')];if(_0x113040[_0xb0c6('0x25')]===0x0)return[];return db['sequelize']['query'](_0x548865[_0xb0c6('0x9c')](),_0x181153)['then'](function(_0x3d5c0f){_0xb86f84=_[_0xb0c6('0x9d')](_0x3d5c0f,'id');_0x181153=_['merge'](_0x181153,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1dbf1b[_0xb0c6('0x45')][_0xb0c6('0x49')]){_0x2c4d7b[_0xb0c6('0x4a')][_0xb0c6('0x36')](function(_0x2a38cc){_0x222e96[_0xb0c6('0x50')]('i.'+_0x2a38cc);});}else{_0x222e96[_0xb0c6('0x50')](_0xb0c6('0x8f'),_0xb0c6('0x63'));_0x222e96[_0xb0c6('0x50')](_0xb0c6('0x9e'),_0xb0c6('0x9f'));_0x222e96[_0xb0c6('0x50')]('a.mandatoryDisposition',_0xb0c6('0xa0'));_0x222e96[_0xb0c6('0x50')]('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',_0xb0c6('0x90'));_0x222e96[_0xb0c6('0x50')]('i.*');_0x222e96[_0xb0c6('0x50')]('c.firstName',_0xb0c6('0xa1'));_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xa2'),'Contact.lastName');_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xa3'),_0xb0c6('0xa4'));_0x222e96['field'](_0xb0c6('0xa5'),_0xb0c6('0xa6'));_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xa7'),_0xb0c6('0xa8'));_0x222e96['field']('c.fax',_0xb0c6('0xa9'));_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xaa'),_0xb0c6('0xab'));_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xac'),'Owner.internal');_0x222e96[_0xb0c6('0x50')](_0xb0c6('0xad'),_0xb0c6('0x34'));}if(_0x2c4d7b[_0xb0c6('0x24')])_0x222e96[_0xb0c6('0x24')](_0x2c4d7b[_0xb0c6('0x24')]);if(_0x2c4d7b['offset'])_0x222e96[_0xb0c6('0x22')](_0x2c4d7b[_0xb0c6('0x22')]);return db[_0xb0c6('0x9b')][_0xb0c6('0x45')](_0x222e96['toString'](),_0x181153);})[_0xb0c6('0x2a')](function(_0x34cd64){if(_0x34cd64['length']>0x0)_0x455fba['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0xb0c6('0x31')](_0x34cd64,'id'));return db[_0xb0c6('0x9b')]['query'](_0x455fba[_0xb0c6('0x9c')](),_0x181153)[_0xb0c6('0x2a')](function(_0x2f34ba){var _0x2988e=_[_0xb0c6('0xae')](_0x2f34ba,_0xb0c6('0xaf'));var _0x3520ee=[];_0x34cd64[_0xb0c6('0x36')](function(_0x27c67f){_0x3520ee[_0xb0c6('0xb0')](updateWhatsappInteraction(_0x27c67f,_0xb86f84,_0x2988e));});return BPromise[_0xb0c6('0xb1')](_0x3520ee);});});})[_0xb0c6('0x2a')](function(_0x707d0e){_0x113040[_0xb0c6('0xb2')]=_0x707d0e;return _0x113040;})['then'](respondWithFilteredResult(_0x4bb5e8,_0x2c4d7b))[_0xb0c6('0x37')](handleError(_0x4bb5e8,null));};exports[_0xb0c6('0xb3')]=function(_0x45be8b,_0x21b548){var _0x3317f3={'raw':![],'where':{'id':_0x45be8b[_0xb0c6('0xb4')]['id']}},_0x5bfd3f={};_0x5bfd3f[_0xb0c6('0x44')]=_[_0xb0c6('0x46')](db[_0xb0c6('0x40')][_0xb0c6('0x41')]);_0x5bfd3f['query']=_['keys'](_0x45be8b[_0xb0c6('0x45')]);_0x5bfd3f[_0xb0c6('0x47')]=_['intersection'](_0x5bfd3f['model'],_0x5bfd3f[_0xb0c6('0x45')]);_0x3317f3[_0xb0c6('0x4a')]=_[_0xb0c6('0x48')](_0x5bfd3f[_0xb0c6('0x44')],qs[_0xb0c6('0x49')](_0x45be8b[_0xb0c6('0x45')]['fields']));_0x3317f3[_0xb0c6('0x4a')]=_0x3317f3[_0xb0c6('0x4a')][_0xb0c6('0x4b')]?_0x3317f3[_0xb0c6('0x4a')]:_0x5bfd3f[_0xb0c6('0x44')];if(_0x45be8b[_0xb0c6('0x45')]['includeAll']){_0x3317f3[_0xb0c6('0xb5')]=[{'all':!![]}];}_0x3317f3=_[_0xb0c6('0xb6')]({},_0x3317f3,_0x45be8b[_0xb0c6('0xb7')]);return db[_0xb0c6('0x40')][_0xb0c6('0x6a')](_0x3317f3)['then'](handleEntityNotFound(_0x21b548,null))[_0xb0c6('0x2a')](respondWithResult(_0x21b548,null))[_0xb0c6('0x37')](handleError(_0x21b548,null));};exports[_0xb0c6('0xb8')]=function(_0x2a0d61,_0x4fb199){return db[_0xb0c6('0x40')]['create'](_0x2a0d61[_0xb0c6('0x74')],{})['then'](respondWithResult(_0x4fb199,0xc9))['catch'](handleError(_0x4fb199,null));};exports[_0xb0c6('0x29')]=function(_0x2e5d42,_0x3fa88b){if(_0x2e5d42[_0xb0c6('0x74')]['id']){delete _0x2e5d42['body']['id'];}return db[_0xb0c6('0x40')]['find']({'where':{'id':_0x2e5d42[_0xb0c6('0xb4')]['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x3fa88b,null))[_0xb0c6('0x2a')](saveUpdates(_0x2e5d42['body'],null))['then'](respondWithResult(_0x3fa88b,null))[_0xb0c6('0x37')](handleError(_0x3fa88b,null));};exports[_0xb0c6('0x2b')]=function(_0x2737b4,_0x538ece){return db[_0xb0c6('0x40')][_0xb0c6('0x6a')]({'where':{'id':_0x2737b4[_0xb0c6('0xb4')]['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x538ece,null))[_0xb0c6('0x2a')](removeEntity(_0x538ece,null))['catch'](handleError(_0x538ece,null));};exports[_0xb0c6('0xb9')]=function(_0x31c5a7,_0xc08ea3){return db[_0xb0c6('0x40')]['describe']()['then'](respondWithResult(_0xc08ea3,null))[_0xb0c6('0x37')](handleError(_0xc08ea3,null));};exports[_0xb0c6('0xba')]=function(_0x1a7e88,_0x4119df,_0x29f1e7){return db[_0xb0c6('0xbb')]['find']({'where':{'id':_0x1a7e88['params']['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x4119df,null))[_0xb0c6('0x2a')](function(_0x181fc7){if(_0x181fc7){return _0x181fc7[_0xb0c6('0xba')](_0x1a7e88[_0xb0c6('0x74')][_0xb0c6('0xbc')],_[_0xb0c6('0xbd')](_0x1a7e88['body'],[_0xb0c6('0xbc'),'id'])||{});}})[_0xb0c6('0x2a')](respondWithResult(_0x4119df,null))[_0xb0c6('0x37')](handleError(_0x4119df,null));};exports['getMessages']=function(_0x5272e1,_0x1bb211,_0x3ebffb){var _0x48a770={'raw':![],'where':{}};var _0x3757f8={};var _0x50d187={'count':0x0,'rows':[]};return db[_0xb0c6('0x40')][_0xb0c6('0xbe')]({'where':{'id':_0x5272e1[_0xb0c6('0xb4')]['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x1bb211,null))[_0xb0c6('0x2a')](function(_0x4c68fe){if(_0x4c68fe){_0x3757f8['model']=_[_0xb0c6('0x46')](db['WhatsappMessage'][_0xb0c6('0x41')]);_0x3757f8[_0xb0c6('0x45')]=_['keys'](_0x5272e1[_0xb0c6('0x45')]);_0x3757f8[_0xb0c6('0x47')]=_[_0xb0c6('0x48')](_0x3757f8['model'],_0x3757f8[_0xb0c6('0x45')]);_0x48a770[_0xb0c6('0x4a')]=_[_0xb0c6('0x48')](_0x3757f8[_0xb0c6('0x44')],qs[_0xb0c6('0x49')](_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0x49')]));_0x48a770[_0xb0c6('0x4a')]=_0x48a770[_0xb0c6('0x4a')][_0xb0c6('0x4b')]?_0x48a770['attributes']:_0x3757f8[_0xb0c6('0x44')];if(!_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0xbf')]('nolimit')){_0x48a770[_0xb0c6('0x24')]=qs[_0xb0c6('0x24')](_0x5272e1['query'][_0xb0c6('0x24')]);_0x48a770[_0xb0c6('0x22')]=qs['offset'](_0x5272e1[_0xb0c6('0x45')]['offset']);}_0x48a770[_0xb0c6('0x4c')]=qs[_0xb0c6('0x4d')](_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0x4d')]);_0x48a770['where']=qs[_0xb0c6('0x47')](_[_0xb0c6('0x4e')](_0x5272e1['query'],_0x3757f8['filters']));_0x48a770['where'][_0xb0c6('0xaf')]=_0x4c68fe['id'];if(_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0x85')]){_0x48a770[_0xb0c6('0x78')]=_[_0xb0c6('0xb6')](_0x48a770['where'],{'$or':_[_0xb0c6('0x31')](_0x48a770[_0xb0c6('0x4a')],function(_0x49af16){var _0x21aacf={};_0x21aacf[_0x49af16]={'$like':'%'+_0x5272e1['query'][_0xb0c6('0x85')]+'%'};return _0x21aacf;})});}if(_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0x7c')]){var _0x59b66b=_0x5272e1['query'][_0xb0c6('0x7c')][_0xb0c6('0x35')](',');var _0x1dccf5={};_0x1dccf5[_0x59b66b[0x0]]={'$gte':moment(_0x59b66b[0x1])[_0xb0c6('0xc0')](_0xb0c6('0xc1'))};_0x48a770[_0xb0c6('0x78')]=_[_0xb0c6('0xb6')](_0x48a770[_0xb0c6('0x78')],_0x1dccf5);}_0x48a770=_[_0xb0c6('0xb6')]({},_0x48a770,_0x5272e1[_0xb0c6('0xb7')]);return db[_0xb0c6('0xbb')][_0xb0c6('0x25')]({'where':_0x48a770[_0xb0c6('0x78')]})['then'](function(_0x1dbb6c){_0x50d187[_0xb0c6('0x25')]=_0x1dbb6c;if(_0x5272e1[_0xb0c6('0x45')][_0xb0c6('0xc2')]){_0x48a770['include']=[{'all':!![]}];}return db[_0xb0c6('0xbb')][_0xb0c6('0xc3')](_0x48a770);})['then'](function(_0x10495b){_0x50d187[_0xb0c6('0xb2')]=_0x10495b;return _0x50d187;});}})[_0xb0c6('0x2a')](respondWithFilteredResult(_0x1bb211,_0x48a770))[_0xb0c6('0x37')](handleError(_0x1bb211,null));};exports[_0xb0c6('0xc4')]=function(_0xf131d6,_0x4437cb,_0x43cc07){return db[_0xb0c6('0x40')]['find']({'where':{'id':_0xf131d6['params']['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x4437cb,null))[_0xb0c6('0x2a')](function(_0x17e7c4){if(_0x17e7c4){return _0x17e7c4[_0xb0c6('0xc5')](_0xf131d6['body'][_0xb0c6('0xbc')],_[_0xb0c6('0xbd')](_0xf131d6[_0xb0c6('0x74')],[_0xb0c6('0xbc'),'id'])||{})['spread'](function(){return db[_0xb0c6('0x6e')]['findAll']({'attributes':['id','name',_0xb0c6('0x51')],'where':{'id':_0xf131d6['body'][_0xb0c6('0xbc')]}});})[_0xb0c6('0x2a')](function(_0x12fd2e){socket[_0xb0c6('0xc6')](_0xb0c6('0xc7'),{'id':Number(_0xf131d6[_0xb0c6('0xb4')]['id']),'tags':_0x12fd2e||[]});return{'id':Number(_0xf131d6[_0xb0c6('0xb4')]['id']),'tags':_0x12fd2e||[]};});}})[_0xb0c6('0x2a')](respondWithResult(_0x4437cb,null))[_0xb0c6('0x37')](handleError(_0x4437cb,null));};exports[_0xb0c6('0xc8')]=function(_0x4eaa97,_0x1028e8,_0x555a3c){return db['WhatsappInteraction']['find']({'where':{'id':_0x4eaa97['params']['id']}})[_0xb0c6('0x2a')](handleEntityNotFound(_0x1028e8,null))[_0xb0c6('0x2a')](function(_0x514cf4){if(_0x514cf4){return _0x514cf4[_0xb0c6('0xc8')](_0x4eaa97[_0xb0c6('0x45')][_0xb0c6('0xbc')]);}})[_0xb0c6('0x2a')](respondWithStatusCode(_0x1028e8,null))['catch'](handleError(_0x1028e8,null));};exports[_0xb0c6('0xc9')]=function(_0x54d2b4,_0x333939){var _0x50ffc8=moment()[_0xb0c6('0xca')]()['toString']();var _0x1fb003=path[_0xb0c6('0xcb')](config[_0xb0c6('0xcc')],_0xb0c6('0xcd'),_0xb0c6('0xce'),_0xb0c6('0xcf'));var _0x23a247=path[_0xb0c6('0xcb')](config[_0xb0c6('0xcc')],_0xb0c6('0xcd'),'files',_0xb0c6('0xd0'));var _0x188284=path[_0xb0c6('0xcb')](_0x1fb003,_0x50ffc8);var _0x234c18=util[_0xb0c6('0xc0')](_0xb0c6('0xd1'),_0x54d2b4[_0xb0c6('0xb4')]['id'],_0x50ffc8);var _0x5e1bcd=path[_0xb0c6('0xcb')](_0x1fb003,_0x234c18);var _0x16b3a2=[];_0x16b3a2[_0xb0c6('0xb0')]({'model':db[_0xb0c6('0x70')],'as':_0xb0c6('0x70'),'attributes':['id',_0xb0c6('0x32')],'raw':!![]});_0x16b3a2[_0xb0c6('0xb0')]({'model':db[_0xb0c6('0xd2')],'as':'Contact','attributes':['id','firstName',_0xb0c6('0xd3')],'raw':!![]});if(_0x54d2b4[_0xb0c6('0x45')]['attachments']){_0x16b3a2[_0xb0c6('0xb0')]({'model':db[_0xb0c6('0xd4')],'as':_0xb0c6('0xd4'),'raw':!![]});}var _0x282c9c=[{'model':db[_0xb0c6('0xbb')],'as':_0xb0c6('0xd5'),'attributes':['id',_0xb0c6('0x74'),_0xb0c6('0xd6'),'direction','secret',_0xb0c6('0x81')],'include':_0x16b3a2}];_0x282c9c[_0xb0c6('0xb0')]({'model':db[_0xb0c6('0xd7')],'as':'Account','attributes':['id','name']});_0x282c9c[_0xb0c6('0xb0')]({'model':db[_0xb0c6('0x70')],'as':_0xb0c6('0xd8'),'attributes':['id',_0xb0c6('0x32')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x54d2b4[_0xb0c6('0xb4')]['id']},'include':_0x282c9c})[_0xb0c6('0x2a')](handleEntityNotFound(_0x333939,null))[_0xb0c6('0x2a')](function(_0x1d3a92){if(_0x1d3a92){var _0x29e40c=_0x1d3a92[_0xb0c6('0xd9')]({'plain':!![]});fs[_0xb0c6('0xda')](_0x188284);var _0x4462d9={'channel':'Whatsapp','account':_0x29e40c[_0xb0c6('0xdb')][_0xb0c6('0x2e')],'agent':_0x29e40c[_0xb0c6('0xd8')]?_0x29e40c[_0xb0c6('0xd8')][_0xb0c6('0x32')]:_0xb0c6('0xdc'),'createdAt':moment(_0x29e40c['createdAt'])['format'](_0xb0c6('0xc1'))['toString'](),'closedAt':_0x29e40c[_0xb0c6('0x3c')]?moment(_0x29e40c[_0xb0c6('0xdd')])[_0xb0c6('0xc0')](_0xb0c6('0xc1'))['toString']():'','disposition':_0x29e40c[_0xb0c6('0xde')],'messages':_(_0x29e40c[_0xb0c6('0xd5')])[_0xb0c6('0x85')]({'secret':![]})[_0xb0c6('0x31')](function(_0x2a3815){if(_0x2a3815[_0xb0c6('0xd4')]){var _0x40cedc=path['join'](_0x23a247,_0x2a3815['Attachment'][_0xb0c6('0xdf')]);if(fs[_0xb0c6('0xe0')](_0x40cedc)){fs['createReadStream'](_0x40cedc)[_0xb0c6('0xe1')](fs['createWriteStream'](path[_0xb0c6('0xcb')](_0x188284,_0x2a3815[_0xb0c6('0xd4')][_0xb0c6('0xdf')])));}}return{'date':moment(_0x2a3815[_0xb0c6('0xd6')])[_0xb0c6('0xc0')](_0xb0c6('0xc1'))[_0xb0c6('0x9c')](),'sender':_0x2a3815[_0xb0c6('0xe2')]===_0xb0c6('0xe3')?_0x2a3815[_0xb0c6('0x70')]?_0x2a3815['User'][_0xb0c6('0x32')]:_0xb0c6('0xe4'):_0x2a3815[_0xb0c6('0xe5')][_0xb0c6('0xe6')]+(_0x2a3815[_0xb0c6('0xe5')][_0xb0c6('0xd3')]?'\x20'+_0x2a3815[_0xb0c6('0xe5')][_0xb0c6('0xd3')]:''),'body':_0x2a3815[_0xb0c6('0xd4')]?_0x2a3815[_0xb0c6('0xd4')][_0xb0c6('0xdf')]:_0x2a3815[_0xb0c6('0x74')],'direction':_0x2a3815[_0xb0c6('0xe2')]===_0xb0c6('0xe3')?'A':'C','secret':_0x2a3815['secret'],'read':_0x2a3815['read'],'attachment':_0x2a3815['Attachment']};})[_0xb0c6('0x64')]()};return ejs['renderFile'](path[_0xb0c6('0xcb')](config[_0xb0c6('0xcc')],_0xb0c6('0xcd'),_0xb0c6('0xe7'),_0xb0c6('0xe8')),{'interaction':_0x4462d9})[_0xb0c6('0x2a')](function(_0x22e00a){var _0x50e5a6=path['join'](_0x188284,_0xb0c6('0xe9')+_0x29e40c['id']+'-'+_0x50ffc8+'.pdf');var _0x2f5d6e={'path':_0x50e5a6,'channel':_0xb0c6('0xea'),'interactionId':_0x29e40c['id']};return pdf[_0xb0c6('0xeb')](_0x22e00a,_0x2f5d6e);})[_0xb0c6('0x2a')](function(){return new BPromise(function(_0x5cb4f4,_0x5deded){zipdir(_0x188284,{'saveTo':_0x5e1bcd},function(_0xab7b73,_0x392c58){if(_0xab7b73)return _0x5deded(_0xab7b73);return _0x5cb4f4(_0x392c58);});})[_0xb0c6('0x2a')](function(){return new BPromise(function(_0x7834dc,_0x4f90e5){rimraf(_0x188284,function(_0x1d8197){if(_0x1d8197)_0x4f90e5(_0x1d8197);return _0x7834dc();});});})[_0xb0c6('0x2a')](function(){return _0x333939[_0xb0c6('0xc9')](_0x5e1bcd,_0x234c18,function(_0x1935c7){if(_0x1935c7){console[_0xb0c6('0xec')]('err',_0x1935c7);}else{fs[_0xb0c6('0xed')](_0x5e1bcd);}});});});}else{return _0x333939[_0xb0c6('0x1e')](0xc8);}})[_0xb0c6('0x37')](handleError(_0x333939,null));}; \ No newline at end of file +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(_0x4992e0,_0x515dc1){var _0x80d309=function(_0x47888f){while(--_0x47888f){_0x4992e0['push'](_0x4992e0['shift']());}};_0x80d309(++_0x515dc1);}(_0x0c19,0xf5));var _0x90c1=function(_0x416ce4,_0x1d1f29){_0x416ce4=_0x416ce4-0x0;var _0x3152eb=_0x0c19[_0x416ce4];return _0x3152eb;};'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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 0f15fc8..2b23931 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 _0xfb30=['setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','save','update','remove','getUsers','then'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xfb30,0x88));var _0x0fb3=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfb30[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x0fb3('0x0'));var WhatsappInteraction=require(_0x0fb3('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x0fb3('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fb3('0x3'),'afterUpdate':_0x0fb3('0x4'),'afterDestroy':_0x0fb3('0x5')};function emitEvent(_0x309947){return function(_0xeae902,_0x26a227,_0x2f2a96){_0xeae902[_0x0fb3('0x6')]({'attributes':['id'],'raw':!![]})[_0x0fb3('0x7')](function(_0x1042d9){_0xeae902[_0x0fb3('0x8')]('Users',_0x1042d9[_0x0fb3('0x9')](function(_0x51a30b){return{'id':_0x51a30b['id']};}));return WhatsappMessage[_0x0fb3('0xa')]({'where':{'WhatsappInteractionId':_0xeae902['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0fb3('0x7')](function(_0x3b5f43){_0xeae902[_0x0fb3('0x8')](_0x0fb3('0xb'),_0x3b5f43['length']);WhatsappInteractionEvents['emit'](_0x309947+':'+_0xeae902['id'],_0xeae902);WhatsappInteractionEvents[_0x0fb3('0xc')](_0x309947,_0xeae902);_0x2f2a96(null);})[_0x0fb3('0xd')](_0x2f2a96(null));};}for(var e in events){if(events[_0x0fb3('0xe')](e)){var event=events[e];WhatsappInteraction[_0x0fb3('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xa20a=['emit','hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x4cf920,_0x50c757){var _0x3ba78f=function(_0x1eb6ce){while(--_0x1eb6ce){_0x4cf920['push'](_0x4cf920['shift']());}};_0x3ba78f(++_0x50c757);}(_0xa20a,0x74));var _0xaa20=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xa20a[_0x44946b];return _0x249bc4;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xaa20('0x0')];var WhatsappMessage=require(_0xaa20('0x1'))['db'][_0xaa20('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaa20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa20('0x4'),'afterDestroy':_0xaa20('0x5')};function emitEvent(_0x1497a0){return function(_0x40cb4c,_0x46ae89,_0x5ac74e){_0x40cb4c['getUsers']({'attributes':['id'],'raw':!![]})[_0xaa20('0x6')](function(_0x6d1518){_0x40cb4c[_0xaa20('0x7')](_0xaa20('0x8'),_0x6d1518[_0xaa20('0x9')](function(_0x1983e8){return{'id':_0x1983e8['id']};}));return WhatsappMessage[_0xaa20('0xa')]({'where':{'WhatsappInteractionId':_0x40cb4c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa20('0x6')](function(_0x17692f){_0x40cb4c[_0xaa20('0x7')](_0xaa20('0xb'),_0x17692f['length']);WhatsappInteractionEvents[_0xaa20('0xc')](_0x1497a0+':'+_0x40cb4c['id'],_0x40cb4c);WhatsappInteractionEvents[_0xaa20('0xc')](_0x1497a0,_0x40cb4c);_0x5ac74e(null);})['catch'](_0x5ac74e(null));};}for(var e in events){if(events[_0xaa20('0xd')](e)){var event=events[e];WhatsappInteraction[_0xaa20('0xe')](e,emitEvent(event));}}module[_0xaa20('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 f6c479a..b2419fe 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 _0x5464=['changed','closed','closedAt','format','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions'];(function(_0x2d1d1d,_0x32d7ac){var _0x1a6c24=function(_0x1dab92){while(--_0x1dab92){_0x2d1d1d['push'](_0x2d1d1d['shift']());}};_0x1a6c24(++_0x32d7ac);}(_0x5464,0x15d));var _0x4546=function(_0x4dca9d,_0xb9472d){_0x4dca9d=_0x4dca9d-0x0;var _0x4e5301=_0x5464[_0x4dca9d];return _0x4e5301;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a76c1,_0x2e860a,_0x2f0376){if(_0x1a76c1[_0x4546('0xb')](_0x4546('0xc'))){_0x1a76c1[_0x4546('0xd')]=moment()[_0x4546('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2f0376(null,_0x1a76c1);}}});}; \ No newline at end of file +var _0xfb2f=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappInteraction','changed','closed','format'];(function(_0x5e0926,_0x5f5ca7){var _0x2ffe9e=function(_0x4f23c2){while(--_0x4f23c2){_0x5e0926['push'](_0x5e0926['shift']());}};_0x2ffe9e(++_0x5f5ca7);}(_0xfb2f,0x112));var _0xffb2=function(_0x122e8d,_0x2c8458){_0x122e8d=_0x122e8d-0x0;var _0x3ea1ae=_0xfb2f[_0x122e8d];return _0x3ea1ae;};'use strict';var _=require(_0xffb2('0x0'));var util=require('util');var logger=require(_0xffb2('0x1'))('api');var moment=require(_0xffb2('0x2'));var BPromise=require(_0xffb2('0x3'));var rp=require(_0xffb2('0x4'));var fs=require('fs');var path=require(_0xffb2('0x5'));var rimraf=require('rimraf');var config=require(_0xffb2('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0xffb2('0x7')]=function(_0x5e8670,_0x3c5eff){return _0x5e8670['define'](_0xffb2('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51e964,_0x38976e,_0xe190b3){if(_0x51e964[_0xffb2('0x9')](_0xffb2('0xa'))){_0x51e964['closedAt']=moment()[_0xffb2('0xb')](_0xffb2('0xc'));}_0xe190b3(null,_0x51e964);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 30926dc..8c02a88 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 _0x42f0=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b59b1,_0x46c17c){var _0x4a44bb=function(_0x47c007){while(--_0x47c007){_0x2b59b1['push'](_0x2b59b1['shift']());}};_0x4a44bb(++_0x46c17c);}(_0x42f0,0x1c1));var _0x042f=function(_0x4dec07,_0x5d12c8){_0x4dec07=_0x4dec07-0x0;var _0x17c8d4=_0x42f0[_0x4dec07];return _0x17c8d4;};'use strict';var _=require(_0x042f('0x0'));var util=require(_0x042f('0x1'));var moment=require(_0x042f('0x2'));var BPromise=require(_0x042f('0x3'));var rs=require(_0x042f('0x4'));var fs=require('fs');var Redis=require(_0x042f('0x5'));var db=require(_0x042f('0x6'))['db'];var utils=require(_0x042f('0x7'));var logger=require(_0x042f('0x8'))(_0x042f('0x9'));var config=require(_0x042f('0xa'));var jayson=require(_0x042f('0xb'));var client=jayson[_0x042f('0xc')][_0x042f('0xd')]({'port':0x232a});config[_0x042f('0xe')]=_[_0x042f('0xf')](config[_0x042f('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x042f('0x10'))(new Redis(config[_0x042f('0xe')]));require(_0x042f('0x11'))[_0x042f('0x12')](socket);function respondWithRpcPromise(_0x2d5d6d,_0x576158,_0x56904e){return new BPromise(function(_0x15367d,_0x19d322){return client[_0x042f('0x13')](_0x2d5d6d,_0x56904e)[_0x042f('0x14')](function(_0x1b7cf0){logger[_0x042f('0x15')](_0x042f('0x16'),_0x576158,_0x042f('0x17'));logger[_0x042f('0x18')](_0x042f('0x19'),_0x576158,'request\x20sent',JSON['stringify'](_0x1b7cf0));if(_0x1b7cf0[_0x042f('0x1a')]){if(_0x1b7cf0['error'][_0x042f('0x1b')]===0x1f4){logger[_0x042f('0x1a')](_0x042f('0x16'),_0x576158,_0x1b7cf0['error'][_0x042f('0x1c')]);return _0x19d322(_0x1b7cf0[_0x042f('0x1a')]['message']);}logger['error'](_0x042f('0x16'),_0x576158,_0x1b7cf0['error'][_0x042f('0x1c')]);return _0x15367d(_0x1b7cf0['error'][_0x042f('0x1c')]);}else{logger[_0x042f('0x15')](_0x042f('0x16'),_0x576158,'request\x20sent');_0x15367d(_0x1b7cf0[_0x042f('0x1d')][_0x042f('0x1c')]);}})[_0x042f('0x1e')](function(_0x35e2cc){logger['error'](_0x042f('0x16'),_0x576158,_0x35e2cc);_0x19d322(_0x35e2cc);});});}exports[_0x042f('0x1f')]=function(_0x578e67){var _0x11f8ea=this;return new Promise(function(_0x33e471,_0x59ded8){return db['WhatsappInteraction'][_0x042f('0x20')](_0x578e67[_0x042f('0x21')],{'raw':_0x578e67[_0x042f('0x22')]?_0x578e67['options'][_0x042f('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x578e67['options']?_0x578e67[_0x042f('0x22')][_0x042f('0x24')]||null:null,'attributes':_0x578e67[_0x042f('0x22')]?_0x578e67[_0x042f('0x22')]['attributes']||null:null,'limit':_0x578e67[_0x042f('0x22')]?_0x578e67[_0x042f('0x22')][_0x042f('0x25')]||null:null})[_0x042f('0x14')](function(_0x424bd6){logger[_0x042f('0x15')](_0x042f('0x1f'),_0x578e67);logger[_0x042f('0x18')](_0x042f('0x1f'),_0x578e67,JSON[_0x042f('0x26')](_0x424bd6));_0x33e471(_0x424bd6);})['catch'](function(_0x4c72ee){logger[_0x042f('0x1a')](_0x042f('0x1f'),_0x4c72ee[_0x042f('0x1c')],_0x578e67);_0x59ded8(_0x11f8ea[_0x042f('0x1a')](0x1f4,_0x4c72ee['message']));});});};exports[_0x042f('0x27')]=function(_0x2bab36){return new Promise(function(_0x354251,_0x566b95){return db['WhatsappInteraction'][_0x042f('0x28')]({'where':_0x2bab36[_0x042f('0x22')]?_0x2bab36['options']['where']||null:null})['then'](function(_0x2b6b8b){if(_0x2b6b8b){return _0x2b6b8b[_0x042f('0x29')](_0x2bab36[_0x042f('0x21')][_0x042f('0x2a')],_[_0x042f('0x2b')](_0x2bab36['body'],[_0x042f('0x2a'),'id'])||{});}})[_0x042f('0x2c')](function(_0x1fdf3e){logger['info'](_0x042f('0x2d'),_0x2bab36);logger[_0x042f('0x18')](_0x042f('0x2d'),_0x2bab36,JSON[_0x042f('0x26')](_0x1fdf3e));_0x354251(_0x1fdf3e);})['catch'](function(_0x5c808e){logger[_0x042f('0x1a')](_0x042f('0x2d'),_0x5c808e[_0x042f('0x1c')],_0x2bab36);_0x566b95(_this[_0x042f('0x1a')](0x1f4,_0x5c808e[_0x042f('0x1c')]));});});}; \ No newline at end of file +var _0xe29b=['then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','addTags','ids','spread','debug','catch','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./whatsappInteraction.socket','request'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xe29b,0x12a));var _0xbe29=function(_0xe25170,_0x4d5ead){_0xe25170=_0xe25170-0x0;var _0x431b6f=_0xe29b[_0xe25170];return _0x431b6f;};'use strict';var _=require(_0xbe29('0x0'));var util=require(_0xbe29('0x1'));var moment=require(_0xbe29('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe29('0x4'))['db'];var utils=require(_0xbe29('0x5'));var logger=require(_0xbe29('0x6'))('rpc');var config=require(_0xbe29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbe29('0x8')][_0xbe29('0x9')]({'port':0x232a});config[_0xbe29('0xa')]=_[_0xbe29('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe29('0xc'))['register'](socket);function respondWithRpcPromise(_0x1b8247,_0x4ebb4d,_0x37f121){return new BPromise(function(_0x3de0f4,_0xa56971){return client[_0xbe29('0xd')](_0x1b8247,_0x37f121)[_0xbe29('0xe')](function(_0x3bb21e){logger['info'](_0xbe29('0xf'),_0x4ebb4d,_0xbe29('0x10'));logger['debug'](_0xbe29('0x11'),_0x4ebb4d,_0xbe29('0x10'),JSON[_0xbe29('0x12')](_0x3bb21e));if(_0x3bb21e[_0xbe29('0x13')]){if(_0x3bb21e[_0xbe29('0x13')][_0xbe29('0x14')]===0x1f4){logger[_0xbe29('0x13')](_0xbe29('0xf'),_0x4ebb4d,_0x3bb21e[_0xbe29('0x13')][_0xbe29('0x15')]);return _0xa56971(_0x3bb21e[_0xbe29('0x13')][_0xbe29('0x15')]);}logger[_0xbe29('0x13')](_0xbe29('0xf'),_0x4ebb4d,_0x3bb21e[_0xbe29('0x13')][_0xbe29('0x15')]);return _0x3de0f4(_0x3bb21e[_0xbe29('0x13')][_0xbe29('0x15')]);}else{logger[_0xbe29('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x4ebb4d,_0xbe29('0x10'));_0x3de0f4(_0x3bb21e[_0xbe29('0x17')]['message']);}})['catch'](function(_0xf3b46e){logger[_0xbe29('0x13')](_0xbe29('0xf'),_0x4ebb4d,_0xf3b46e);_0xa56971(_0xf3b46e);});});}exports[_0xbe29('0x18')]=function(_0x3b55c2){var _0x1238b8=this;return new Promise(function(_0x83b612,_0x6ef8b9){return db[_0xbe29('0x19')][_0xbe29('0x1a')](_0x3b55c2[_0xbe29('0x1b')],{'raw':_0x3b55c2[_0xbe29('0x1c')]?_0x3b55c2[_0xbe29('0x1c')][_0xbe29('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b55c2[_0xbe29('0x1c')]?_0x3b55c2[_0xbe29('0x1c')][_0xbe29('0x1e')]||null:null,'attributes':_0x3b55c2[_0xbe29('0x1c')]?_0x3b55c2[_0xbe29('0x1c')][_0xbe29('0x1f')]||null:null,'limit':_0x3b55c2[_0xbe29('0x1c')]?_0x3b55c2[_0xbe29('0x1c')][_0xbe29('0x20')]||null:null})[_0xbe29('0xe')](function(_0x462263){logger['info']('UpdateWhatsappInteraction',_0x3b55c2);logger['debug']('UpdateWhatsappInteraction',_0x3b55c2,JSON[_0xbe29('0x12')](_0x462263));_0x83b612(_0x462263);})['catch'](function(_0x1fcbf5){logger[_0xbe29('0x13')](_0xbe29('0x18'),_0x1fcbf5[_0xbe29('0x15')],_0x3b55c2);_0x6ef8b9(_0x1238b8['error'](0x1f4,_0x1fcbf5[_0xbe29('0x15')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x281c50){return new Promise(function(_0x5db97d,_0x32ea49){return db[_0xbe29('0x19')]['find']({'where':_0x281c50['options']?_0x281c50['options'][_0xbe29('0x1e')]||null:null})[_0xbe29('0xe')](function(_0x323496){if(_0x323496){return _0x323496[_0xbe29('0x21')](_0x281c50[_0xbe29('0x1b')][_0xbe29('0x22')],_['omit'](_0x281c50['body'],['ids','id'])||{});}})[_0xbe29('0x23')](function(_0x9c346b){logger[_0xbe29('0x16')]('AddTags',_0x281c50);logger[_0xbe29('0x24')]('AddTags',_0x281c50,JSON[_0xbe29('0x12')](_0x9c346b));_0x5db97d(_0x9c346b);})[_0xbe29('0x25')](function(_0x4eceec){logger[_0xbe29('0x13')](_0xbe29('0x26'),_0x4eceec[_0xbe29('0x15')],_0x281c50);_0x32ea49(_this['error'](0x1f4,_0x4eceec['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9446a69..7e12e4a 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 _0x113f=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','removeListener'];(function(_0xc2e05e,_0xc18cfe){var _0x2e4174=function(_0x250bf0){while(--_0x250bf0){_0xc2e05e['push'](_0xc2e05e['shift']());}};_0x2e4174(++_0xc18cfe);}(_0x113f,0xb2));var _0xf113=function(_0x167fb4,_0x4955de){_0x167fb4=_0x167fb4-0x0;var _0x51a385=_0x113f[_0x167fb4];return _0x51a385;};'use strict';var WhatsappInteractionEvents=require(_0xf113('0x0'));var events=[_0xf113('0x1'),_0xf113('0x2'),'update'];function createListener(_0x2f19a8,_0x50d80c){return function(_0x2dc28e){_0x50d80c['emit'](_0x2f19a8,_0x2dc28e);};}function removeListener(_0x2ca988,_0x1a3b4a){return function(){WhatsappInteractionEvents[_0xf113('0x3')](_0x2ca988,_0x1a3b4a);};}exports[_0xf113('0x4')]=function(_0xad9998){for(var _0x2c5d00=0x0,_0xc0aa33=events[_0xf113('0x5')];_0x2c5d00<_0xc0aa33;_0x2c5d00++){var _0x3297d9=events[_0x2c5d00];var _0x2532d2=createListener(_0xf113('0x6')+_0x3297d9,_0xad9998);WhatsappInteractionEvents['on'](_0x3297d9,_0x2532d2);}}; \ No newline at end of file +var _0xa2fd=['emit','removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa2fd,0x104));var _0xda2f=function(_0x14341f,_0x18a9d1){_0x14341f=_0x14341f-0x0;var _0x4422c4=_0xa2fd[_0x14341f];return _0x4422c4;};'use strict';var WhatsappInteractionEvents=require(_0xda2f('0x0'));var events=[_0xda2f('0x1'),_0xda2f('0x2'),_0xda2f('0x3')];function createListener(_0x34ad8f,_0x299e32){return function(_0xa45678){_0x299e32[_0xda2f('0x4')](_0x34ad8f,_0xa45678);};}function removeListener(_0x4fba69,_0x40a041){return function(){WhatsappInteractionEvents[_0xda2f('0x5')](_0x4fba69,_0x40a041);};}exports[_0xda2f('0x6')]=function(_0x56011c){for(var _0x576913=0x0,_0x59edc1=events[_0xda2f('0x7')];_0x576913<_0x59edc1;_0x576913++){var _0x43c0e7=events[_0x576913];var _0x5b76b1=createListener('whatsappInteraction:'+_0x43c0e7,_0x56011c);WhatsappInteractionEvents['on'](_0x43c0e7,_0x5b76b1);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9965db9..46b766f 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 _0x3ade=['put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create'];(function(_0x53fda3,_0x5cc847){var _0x3c0742=function(_0x1c8f43){while(--_0x1c8f43){_0x53fda3['push'](_0x53fda3['shift']());}};_0x3c0742(++_0x5cc847);}(_0x3ade,0x6a));var _0xe3ad=function(_0x5a24de,_0x542232){_0x5a24de=_0x5a24de-0x0;var _0x388e2e=_0x3ade[_0x5a24de];return _0x388e2e;};'use strict';var multer=require(_0xe3ad('0x0'));var util=require(_0xe3ad('0x1'));var path=require(_0xe3ad('0x2'));var timeout=require(_0xe3ad('0x3'));var express=require('express');var router=express[_0xe3ad('0x4')]();var fs_extra=require(_0xe3ad('0x5'));var auth=require(_0xe3ad('0x6'));var interaction=require(_0xe3ad('0x7'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xe3ad('0x8')]('/',auth[_0xe3ad('0x9')](),controller[_0xe3ad('0xa')]);router[_0xe3ad('0x8')](_0xe3ad('0xb'),auth[_0xe3ad('0x9')](),controller['describe']);router['get'](_0xe3ad('0xc'),auth['isAuthenticated'](),controller[_0xe3ad('0xd')]);router[_0xe3ad('0xe')]('/',auth[_0xe3ad('0x9')](),interaction[_0xe3ad('0xf')](_0xe3ad('0x10'),_0xe3ad('0x11')),controller[_0xe3ad('0x12')]);router[_0xe3ad('0xe')]('/:id/status',controller['status']);router[_0xe3ad('0x13')](_0xe3ad('0xc'),auth[_0xe3ad('0x9')](),controller['update']);router['put'](_0xe3ad('0x14'),auth[_0xe3ad('0x9')](),controller[_0xe3ad('0x15')]);router[_0xe3ad('0x13')](_0xe3ad('0x16'),auth[_0xe3ad('0x9')](),controller['reject']);router[_0xe3ad('0x17')](_0xe3ad('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe3ad('0x18')]=router; \ No newline at end of file +var _0xdae5=['../../config/environment','get','isAuthenticated','index','/describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdae5,0xd1));var _0x5dae=function(_0x43f807,_0x120629){_0x43f807=_0x43f807-0x0;var _0x5439ca=_0xdae5[_0x43f807];return _0x5439ca;};'use strict';var multer=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var path=require('path');var timeout=require(_0x5dae('0x2'));var express=require(_0x5dae('0x3'));var router=express[_0x5dae('0x4')]();var fs_extra=require(_0x5dae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5dae('0x6'));var config=require(_0x5dae('0x7'));var controller=require('./whatsappMessage.controller');router[_0x5dae('0x8')]('/',auth[_0x5dae('0x9')](),controller[_0x5dae('0xa')]);router[_0x5dae('0x8')](_0x5dae('0xb'),auth[_0x5dae('0x9')](),controller['describe']);router['get'](_0x5dae('0xc'),auth[_0x5dae('0x9')](),controller['show']);router[_0x5dae('0xd')]('/',auth[_0x5dae('0x9')](),interaction[_0x5dae('0xe')](_0x5dae('0xf'),_0x5dae('0x10')),controller[_0x5dae('0x11')]);router['post'](_0x5dae('0x12'),controller[_0x5dae('0x13')]);router[_0x5dae('0x14')](_0x5dae('0xc'),auth['isAuthenticated'](),controller[_0x5dae('0x15')]);router[_0x5dae('0x14')]('/:id/accept',auth[_0x5dae('0x9')](),controller[_0x5dae('0x16')]);router[_0x5dae('0x14')](_0x5dae('0x17'),auth[_0x5dae('0x9')](),controller[_0x5dae('0x18')]);router[_0x5dae('0x19')](_0x5dae('0xc'),auth['isAuthenticated'](),controller[_0x5dae('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index c4b603c..514347d 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 _0xa1b8=['TEXT','medium','BOOLEAN','out','STRING','sequelize','exports'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0xa1b8,0x1b7));var _0x8a1b=function(_0x10dbdd,_0x91235){_0x10dbdd=_0x10dbdd-0x0;var _0x3d3ef8=_0xa1b8[_0x10dbdd];return _0x3d3ef8;};'use strict';var Sequelize=require(_0x8a1b('0x0'));module[_0x8a1b('0x1')]={'body':{'type':Sequelize[_0x8a1b('0x2')](_0x8a1b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8a1b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8a1b('0x5')),'defaultValue':_0x8a1b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8a1b('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x8a1b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8a1b('0x6')]},'providerResponse':{'type':Sequelize[_0x8a1b('0x2')]}}; \ No newline at end of file +var _0xff16=['exports','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xff16,0x7f));var _0x6ff1=function(_0x3541cc,_0x3aec60){_0x3541cc=_0x3541cc-0x0;var _0x1294d3=_0xff16[_0x3541cc];return _0x1294d3;};'use strict';var Sequelize=require(_0x6ff1('0x0'));module[_0x6ff1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6ff1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6ff1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6ff1('0x4')]('in',_0x6ff1('0x5')),'defaultValue':_0x6ff1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6ff1('0x6')](0xbe)},'phone':{'type':Sequelize[_0x6ff1('0x6')]},'readAt':{'type':Sequelize[_0x6ff1('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6ff1('0x6')]},'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 6c92bb5..e96e92c 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 _0xef22=['options','find','create','body','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','stack','map','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','WhatsappMessage','includeAll','include','findAll','rows','show','rawAttributes','length'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xef22,0x158));var _0x2ef2=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xef22[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ef2('0x0'));var zipdir=require(_0x2ef2('0x1'));var jsonpatch=require(_0x2ef2('0x2'));var rp=require(_0x2ef2('0x3'));var moment=require(_0x2ef2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ef2('0x5'));var util=require(_0x2ef2('0x6'));var path=require(_0x2ef2('0x7'));var sox=require(_0x2ef2('0x8'));var csv=require(_0x2ef2('0x9'));var ejs=require(_0x2ef2('0xa'));var fs=require('fs');var fs_extra=require(_0x2ef2('0xb'));var _=require(_0x2ef2('0xc'));var squel=require('squel');var crypto=require(_0x2ef2('0xd'));var jsforce=require(_0x2ef2('0xe'));var deskjs=require(_0x2ef2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ef2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ef2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2ef2('0x12'));var hardwareService=require(_0x2ef2('0x13'));var logger=require(_0x2ef2('0x14'))(_0x2ef2('0x15'));var utils=require('../../config/utils');var config=require(_0x2ef2('0x16'));var licenseUtil=require(_0x2ef2('0x17'));var db=require(_0x2ef2('0x18'))['db'];config['redis']=_[_0x2ef2('0x19')](config[_0x2ef2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ef2('0x1b'))(new Redis(config[_0x2ef2('0x1a')]));require(_0x2ef2('0x1c'))[_0x2ef2('0x1d')](socket);var jayson=require(_0x2ef2('0x1e'));var client=jayson['client'][_0x2ef2('0x1f')]({'port':0x232c});var client9002=jayson[_0x2ef2('0x20')][_0x2ef2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x444a26,_0x67f69f,_0xfc2cf7,_0x592440){return new BPromise(function(_0x455f5d,_0x53b52d){var _0x3b6064=_0x592440||client;return _0x3b6064[_0x2ef2('0x21')](_0x444a26,_0xfc2cf7)[_0x2ef2('0x22')](function(_0x182e60){logger[_0x2ef2('0x23')](_0x2ef2('0x24'),_0x67f69f,_0x2ef2('0x25'));logger[_0x2ef2('0x26')](_0x2ef2('0x27'),_0x67f69f,_0x2ef2('0x25'),JSON[_0x2ef2('0x28')](_0x182e60));if(_0x182e60['error']){if(_0x182e60[_0x2ef2('0x29')]['code']===0x1f4){logger['error'](_0x2ef2('0x24'),_0x67f69f,_0x182e60[_0x2ef2('0x29')][_0x2ef2('0x2a')]);return _0x53b52d(_0x182e60[_0x2ef2('0x29')]['message']);}logger[_0x2ef2('0x29')](_0x2ef2('0x24'),_0x67f69f,_0x182e60[_0x2ef2('0x29')]['message']);return _0x455f5d(_0x182e60[_0x2ef2('0x29')][_0x2ef2('0x2a')]);}else{logger[_0x2ef2('0x23')](_0x2ef2('0x24'),_0x67f69f,_0x2ef2('0x25'));_0x455f5d(_0x182e60[_0x2ef2('0x2b')][_0x2ef2('0x2a')]);}})[_0x2ef2('0x2c')](function(_0x569da5){logger[_0x2ef2('0x29')](_0x2ef2('0x24'),_0x67f69f,_0x569da5);_0x53b52d(_0x569da5);});});}function respondWithStatusCode(_0x54ee07,_0x2fbb03){_0x2fbb03=_0x2fbb03||0xcc;return function(_0x3ab078){if(_0x3ab078){return _0x54ee07['sendStatus'](_0x2fbb03);}return _0x54ee07[_0x2ef2('0x2d')](_0x2fbb03)[_0x2ef2('0x2e')]();};}function respondWithResult(_0x50c465,_0x54fb79){_0x54fb79=_0x54fb79||0xc8;return function(_0x3041ad){if(_0x3041ad){return _0x50c465[_0x2ef2('0x2d')](_0x54fb79)[_0x2ef2('0x2f')](_0x3041ad);}};}function respondWithFilteredResult(_0x2bee29,_0x4b3a11){return function(_0x394368){if(_0x394368){var _0x47ccdc=typeof _0x4b3a11[_0x2ef2('0x30')]===_0x2ef2('0x31')&&typeof _0x4b3a11[_0x2ef2('0x32')]==='undefined';var _0x2cca7d=_0x394368[_0x2ef2('0x33')];var _0x5f31a3=_0x47ccdc?0x0:_0x4b3a11[_0x2ef2('0x30')];var _0x242c6f=_0x47ccdc?_0x394368[_0x2ef2('0x33')]:_0x4b3a11['offset']+_0x4b3a11[_0x2ef2('0x32')];var _0x5c4898;if(_0x242c6f>=_0x2cca7d){_0x242c6f=_0x2cca7d;_0x5c4898=0xc8;}else{_0x5c4898=0xce;}_0x2bee29[_0x2ef2('0x2d')](_0x5c4898);return _0x2bee29[_0x2ef2('0x34')](_0x2ef2('0x35'),_0x5f31a3+'-'+_0x242c6f+'/'+_0x2cca7d)[_0x2ef2('0x2f')](_0x394368);}return null;};}function patchUpdates(_0x2ff7e0){return function(_0x5903af){try{jsonpatch[_0x2ef2('0x36')](_0x5903af,_0x2ff7e0,!![]);}catch(_0x1e46cf){return BPromise['reject'](_0x1e46cf);}return _0x5903af[_0x2ef2('0x37')]();};}function saveUpdates(_0xf4ba14,_0x57117c){return function(_0x4dad29){if(_0x4dad29){return _0x4dad29[_0x2ef2('0x38')](_0xf4ba14)[_0x2ef2('0x22')](function(_0x3da1e9){return _0x3da1e9;});}return null;};}function removeEntity(_0x4ece92,_0x548467){return function(_0x257858){if(_0x257858){return _0x257858[_0x2ef2('0x39')]()['then'](function(){_0x4ece92[_0x2ef2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42475a,_0x41122a){return function(_0x24235d){if(!_0x24235d){_0x42475a[_0x2ef2('0x3a')](0x194);}return _0x24235d;};}function handleError(_0x206f53,_0x7c09d4){_0x7c09d4=_0x7c09d4||0x1f4;return function(_0x3af115){logger['error'](_0x3af115[_0x2ef2('0x3b')]);if(_0x3af115['name']){delete _0x3af115['name'];}_0x206f53[_0x2ef2('0x2d')](_0x7c09d4)['send'](_0x3af115);};}exports['index']=function(_0x329792,_0x10c302){var _0x4ebcc3={},_0x1934eb={},_0x26ba17={'count':0x0,'rows':[]};var _0x435b44=_[_0x2ef2('0x3c')](db['WhatsappMessage']['rawAttributes'],function(_0x28ea5a){return{'name':_0x28ea5a[_0x2ef2('0x3d')],'type':_0x28ea5a[_0x2ef2('0x3e')]['key']};});_0x1934eb[_0x2ef2('0x3f')]=_['map'](_0x435b44,_0x2ef2('0x40'));_0x1934eb[_0x2ef2('0x41')]=_[_0x2ef2('0x42')](_0x329792[_0x2ef2('0x41')]);_0x1934eb[_0x2ef2('0x43')]=_['intersection'](_0x1934eb[_0x2ef2('0x3f')],_0x1934eb[_0x2ef2('0x41')]);_0x4ebcc3['attributes']=_[_0x2ef2('0x44')](_0x1934eb[_0x2ef2('0x3f')],qs[_0x2ef2('0x45')](_0x329792[_0x2ef2('0x41')]['fields']));_0x4ebcc3['attributes']=_0x4ebcc3[_0x2ef2('0x46')]['length']?_0x4ebcc3[_0x2ef2('0x46')]:_0x1934eb[_0x2ef2('0x3f')];if(!_0x329792[_0x2ef2('0x41')][_0x2ef2('0x47')](_0x2ef2('0x48'))){_0x4ebcc3[_0x2ef2('0x32')]=qs['limit'](_0x329792[_0x2ef2('0x41')]['limit']);_0x4ebcc3[_0x2ef2('0x30')]=qs[_0x2ef2('0x30')](_0x329792['query'][_0x2ef2('0x30')]);}_0x4ebcc3[_0x2ef2('0x49')]=qs[_0x2ef2('0x4a')](_0x329792[_0x2ef2('0x41')][_0x2ef2('0x4a')]);_0x4ebcc3[_0x2ef2('0x4b')]=qs[_0x2ef2('0x43')](_[_0x2ef2('0x4c')](_0x329792[_0x2ef2('0x41')],_0x1934eb[_0x2ef2('0x43')]),_0x435b44);if(_0x329792[_0x2ef2('0x41')]['filter']){_0x4ebcc3['where']=_[_0x2ef2('0x4d')](_0x4ebcc3[_0x2ef2('0x4b')],{'$or':_['map'](_0x435b44,function(_0x5324c5){if(_0x5324c5[_0x2ef2('0x3e')]!==_0x2ef2('0x4e')){var _0x36a171={};_0x36a171[_0x5324c5[_0x2ef2('0x40')]]={'$like':'%'+_0x329792[_0x2ef2('0x41')][_0x2ef2('0x4f')]+'%'};return _0x36a171;}})});}_0x4ebcc3=_[_0x2ef2('0x4d')]({},_0x4ebcc3,_0x329792['options']);var _0x45ff0d={'where':_0x4ebcc3[_0x2ef2('0x4b')]};return db[_0x2ef2('0x50')]['count'](_0x45ff0d)[_0x2ef2('0x22')](function(_0x2eec08){_0x26ba17[_0x2ef2('0x33')]=_0x2eec08;if(_0x329792[_0x2ef2('0x41')][_0x2ef2('0x51')]){_0x4ebcc3[_0x2ef2('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x2ef2('0x53')](_0x4ebcc3);})[_0x2ef2('0x22')](function(_0x1d61f8){_0x26ba17[_0x2ef2('0x54')]=_0x1d61f8;return _0x26ba17;})[_0x2ef2('0x22')](respondWithFilteredResult(_0x10c302,_0x4ebcc3))[_0x2ef2('0x2c')](handleError(_0x10c302,null));};exports[_0x2ef2('0x55')]=function(_0x346a51,_0x1fd6fd){var _0x479448={'raw':!![],'where':{'id':_0x346a51['params']['id']}},_0x45b3af={};_0x45b3af[_0x2ef2('0x3f')]=_['keys'](db[_0x2ef2('0x50')][_0x2ef2('0x56')]);_0x45b3af[_0x2ef2('0x41')]=_[_0x2ef2('0x42')](_0x346a51['query']);_0x45b3af[_0x2ef2('0x43')]=_[_0x2ef2('0x44')](_0x45b3af[_0x2ef2('0x3f')],_0x45b3af[_0x2ef2('0x41')]);_0x479448[_0x2ef2('0x46')]=_[_0x2ef2('0x44')](_0x45b3af['model'],qs[_0x2ef2('0x45')](_0x346a51[_0x2ef2('0x41')][_0x2ef2('0x45')]));_0x479448[_0x2ef2('0x46')]=_0x479448[_0x2ef2('0x46')][_0x2ef2('0x57')]?_0x479448[_0x2ef2('0x46')]:_0x45b3af[_0x2ef2('0x3f')];if(_0x346a51['query'][_0x2ef2('0x51')]){_0x479448['include']=[{'all':!![]}];}_0x479448=_[_0x2ef2('0x4d')]({},_0x479448,_0x346a51[_0x2ef2('0x58')]);return db[_0x2ef2('0x50')][_0x2ef2('0x59')](_0x479448)[_0x2ef2('0x22')](handleEntityNotFound(_0x1fd6fd,null))[_0x2ef2('0x22')](respondWithResult(_0x1fd6fd,null))[_0x2ef2('0x2c')](handleError(_0x1fd6fd,null));};exports[_0x2ef2('0x5a')]=function(_0x46d6d7,_0x143c7d){return db['WhatsappMessage'][_0x2ef2('0x5a')](_0x46d6d7[_0x2ef2('0x5b')],{})[_0x2ef2('0x22')](respondWithResult(_0x143c7d,0xc9))[_0x2ef2('0x2c')](handleError(_0x143c7d,null));};exports['update']=function(_0x9c7d37,_0x787145){if(_0x9c7d37[_0x2ef2('0x5b')]['id']){delete _0x9c7d37['body']['id'];}return db[_0x2ef2('0x50')][_0x2ef2('0x59')]({'where':{'id':_0x9c7d37[_0x2ef2('0x5c')]['id']}})[_0x2ef2('0x22')](handleEntityNotFound(_0x787145,null))[_0x2ef2('0x22')](saveUpdates(_0x9c7d37[_0x2ef2('0x5b')],null))[_0x2ef2('0x22')](respondWithResult(_0x787145,null))[_0x2ef2('0x2c')](handleError(_0x787145,null));};exports[_0x2ef2('0x39')]=function(_0x293f7e,_0x737b8d){return db['WhatsappMessage'][_0x2ef2('0x59')]({'where':{'id':_0x293f7e[_0x2ef2('0x5c')]['id']}})[_0x2ef2('0x22')](handleEntityNotFound(_0x737b8d,null))[_0x2ef2('0x22')](removeEntity(_0x737b8d,null))[_0x2ef2('0x2c')](handleError(_0x737b8d,null));};exports[_0x2ef2('0x5d')]=function(_0x514b0f,_0x3d757f){return db['WhatsappMessage'][_0x2ef2('0x5d')]()['then'](respondWithResult(_0x3d757f,null))[_0x2ef2('0x2c')](handleError(_0x3d757f,null));};var interaction_log=require(_0x2ef2('0x14'))(_0x2ef2('0x5e'));exports[_0x2ef2('0x5f')]=function(_0x513948,_0x2f5084,_0x48fc23){var _0x216457={'agent':{},'channel':_0x2ef2('0x60')};if(_0x513948[_0x2ef2('0x5b')]['id']){delete _0x513948[_0x2ef2('0x5b')]['id'];}_0x513948['body'][_0x2ef2('0x61')]=!![];_0x513948[_0x2ef2('0x5b')][_0x2ef2('0x62')]=moment()[_0x2ef2('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x513948['body'][_0x2ef2('0x64')]=_0x513948[_0x2ef2('0x5b')]['UserId']||_0x513948['user']['id'];_0x216457[_0x2ef2('0x65')]['id']=_0x513948[_0x2ef2('0x5b')][_0x2ef2('0x64')];return db[_0x2ef2('0x50')][_0x2ef2('0x59')]({'where':{'id':_0x513948[_0x2ef2('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f5084,null))['then'](saveUpdates(_0x513948['body'],null))[_0x2ef2('0x22')](function(_0x3bd587){if(_0x3bd587){_0x216457[_0x2ef2('0x2a')]=_0x3bd587[_0x2ef2('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x2ef2('0x59')]({'where':{'id':_0x3bd587[_0x2ef2('0x67')]}});}return null;})[_0x2ef2('0x22')](handleEntityNotFound(_0x2f5084,null))[_0x2ef2('0x22')](function(_0x24373e){if(_0x24373e){return _0x24373e['update']({'UserId':_0x513948['body']['UserId'],'read1stAt':_[_0x2ef2('0x68')](_0x24373e['read1stAt'])?moment()[_0x2ef2('0x63')](_0x2ef2('0x69')):undefined});}return null;})[_0x2ef2('0x22')](function(_0x27e243){if(_0x27e243){_0x216457['interaction']=_0x27e243[_0x2ef2('0x66')]({'plain':!![]});interaction_log[_0x2ef2('0x23')](_0x2ef2('0x6a'),_0x513948[_0x2ef2('0x6b')]['id'],_0x513948[_0x2ef2('0x6b')][_0x2ef2('0x40')],_0x513948[_0x2ef2('0x6b')][_0x2ef2('0x6c')],_0x216457[_0x2ef2('0x6d')]['id'],_0x513948['body']?JSON[_0x2ef2('0x28')](_0x513948[_0x2ef2('0x5b')]):_0x2ef2('0x6e'));return respondWithRpcPromise(_0x2ef2('0x6f'),_0x2ef2('0x70'),_0x216457);}return null;})[_0x2ef2('0x22')](function(_0x3f779f){var _0xeeb109=_0x2ef2('0x71')+_0x3f779f['message'][_0x2ef2('0x72')];return db[_0x2ef2('0x73')][_0x2ef2('0x41')](_0xeeb109,{'type':db[_0x2ef2('0x74')][_0x2ef2('0x75')][_0x2ef2('0x76')],'raw':!![]})[_0x2ef2('0x22')](function(_0x46ecdc){return _0x46ecdc;});})[_0x2ef2('0x22')](function(_0x31a090){if(_0x31a090){_0x216457[_0x2ef2('0x2a')][_0x2ef2('0x77')]=_0x31a090[0x0];if(!_0x513948[_0x2ef2('0x5b')]['UserId'])return;return db[_0x2ef2('0x78')]['find']({'where':{'id':_0x513948[_0x2ef2('0x5b')][_0x2ef2('0x64')],'role':_0x2ef2('0x65')},'attributes':['id',_0x2ef2('0x40'),'fullname',_0x2ef2('0x79'),_0x2ef2('0x7a')],'raw':!![]});}return null;})[_0x2ef2('0x22')](function(_0x1fb36b){if(!_0x1fb36b)return null;_0x216457[_0x2ef2('0x2a')][_0x2ef2('0x65')]=_0x1fb36b;return _0x216457;})['then'](function(_0x411652){if(_0x411652){if(_0x513948[_0x2ef2('0x5b')][_0x2ef2('0x7b')]){_0x216457[_0x2ef2('0x2a')][_0x2ef2('0x7c')]=util['format'](_0x2ef2('0x7d'),_0x513948['user']['name']);_0x216457[_0x2ef2('0x2a')]['channel']=_0x216457[_0x2ef2('0x7e')];_0x216457[_0x2ef2('0x2a')]['motionChannel']=_0x216457['channel'];_0x216457[_0x2ef2('0x2a')]['event']=_0x2ef2('0x5f');return respondWithRpcPromise(_0x2ef2('0x7f'),_0x2ef2('0x7f'),{'event':'acceptmessage','message':_0x216457['message']},client9002)[_0x2ef2('0x22')](function(){return _0x216457;});}return _0x216457;}return null;})[_0x2ef2('0x22')](respondWithResult(_0x2f5084,null))[_0x2ef2('0x2c')](handleError(_0x2f5084,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x2ef2('0x80')]=function(_0x43d119,_0x2c3a2b,_0x725ae7){var _0x25be89={'agent':{},'channel':_0x2ef2('0x60')};if(_0x43d119['body']['id']){delete _0x43d119[_0x2ef2('0x5b')]['id'];}_0x43d119[_0x2ef2('0x5b')]['UserId']=_0x43d119[_0x2ef2('0x5b')][_0x2ef2('0x64')]||_0x43d119['user']['id'];_0x25be89[_0x2ef2('0x65')]['id']=_0x43d119[_0x2ef2('0x5b')][_0x2ef2('0x64')];return db[_0x2ef2('0x50')][_0x2ef2('0x59')]({'where':{'id':_0x43d119[_0x2ef2('0x5c')]['id'],'UserId':null}})[_0x2ef2('0x22')](handleEntityNotFound(_0x2c3a2b,null))[_0x2ef2('0x22')](function(_0x49708e){if(_0x49708e){_0x25be89['message']=_0x49708e[_0x2ef2('0x66')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x49708e['WhatsappInteractionId']}});}return null;})[_0x2ef2('0x22')](handleEntityNotFound(_0x2c3a2b,null))['then'](function(_0x11ceef){if(_0x11ceef){_0x25be89[_0x2ef2('0x6d')]=_0x11ceef[_0x2ef2('0x66')]({'plain':!![]});interaction_log[_0x2ef2('0x23')](_0x2ef2('0x81'),_0x43d119[_0x2ef2('0x6b')]['id'],_0x43d119[_0x2ef2('0x6b')][_0x2ef2('0x40')],_0x43d119[_0x2ef2('0x6b')][_0x2ef2('0x6c')],_0x25be89[_0x2ef2('0x6d')]['id'],_0x43d119[_0x2ef2('0x5b')]?JSON[_0x2ef2('0x28')](_0x43d119[_0x2ef2('0x5b')]):_0x2ef2('0x6e'));return respondWithRpcPromise(_0x2ef2('0x82'),_0x2ef2('0x83'),_0x25be89);}return null;})[_0x2ef2('0x22')](function(_0x380927){var _0x5d0a84=_0x2ef2('0x71')+_0x380927['message'][_0x2ef2('0x72')];return db[_0x2ef2('0x73')][_0x2ef2('0x41')](_0x5d0a84,{'type':db['Sequelize'][_0x2ef2('0x75')][_0x2ef2('0x76')],'raw':!![]})[_0x2ef2('0x22')](function(_0x108454){return _0x108454;});})['then'](function(_0x231699){if(_0x231699){_0x25be89['message']['contact']=_0x231699[0x0];if(!_0x43d119['body'][_0x2ef2('0x64')])return;return db[_0x2ef2('0x78')][_0x2ef2('0x59')]({'where':{'id':_0x43d119[_0x2ef2('0x5b')][_0x2ef2('0x64')],'role':'agent'},'attributes':['id',_0x2ef2('0x40'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x2ef2('0x22')](function(_0x33fde2){if(!_0x33fde2)return null;_0x25be89[_0x2ef2('0x2a')][_0x2ef2('0x65')]=_0x33fde2;return _0x25be89;})[_0x2ef2('0x22')](function(_0x24605e){if(_0x24605e){_0x24605e[_0x2ef2('0x2a')]['interface']=util[_0x2ef2('0x63')](_0x2ef2('0x7d'),_0x43d119['user']['name']);_0x24605e[_0x2ef2('0x2a')][_0x2ef2('0x7e')]=_0x25be89[_0x2ef2('0x7e')];_0x24605e[_0x2ef2('0x2a')][_0x2ef2('0x84')]=_0x25be89[_0x2ef2('0x7e')];_0x24605e[_0x2ef2('0x2a')][_0x2ef2('0x85')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x2ef2('0x86'),'message':_0x24605e['message']},client9002);return _0x25be89;}return null;})[_0x2ef2('0x22')](respondWithResult(_0x2c3a2b,null))['catch'](handleError(_0x2c3a2b,null));};exports[_0x2ef2('0x2d')]=function(_0x49160e,_0x195538,_0xb23205){if(_0x49160e['body']['id']){delete _0x49160e[_0x2ef2('0x5b')]['id'];}var _0x3913a8;return db[_0x2ef2('0x50')]['find']({'where':{'id':_0x49160e[_0x2ef2('0x5c')]['id']}})[_0x2ef2('0x22')](handleEntityNotFound(_0x195538,null))[_0x2ef2('0x22')](function(_0x4e1eca){if(_0x4e1eca){_0x3913a8=_0x4e1eca;return db[_0x2ef2('0x87')]['find']({'where':{'id':_0x4e1eca[_0x2ef2('0x88')]}});}})[_0x2ef2('0x22')](handleEntityNotFound(_0x195538,null))[_0x2ef2('0x22')](function(_0x197212){if(_0x197212){logger[_0x2ef2('0x26')](_0x2ef2('0x89'),_0x2ef2('0x2d'),'received\x20delivery\x20report\x20from',_0x197212[_0x2ef2('0x3e')],util[_0x2ef2('0x8a')](_0x49160e['body'],{'showHidden':![],'depth':null}));switch(_0x197212['type']){case _0x2ef2('0x8b'):if(_0x49160e[_0x2ef2('0x5b')][_0x2ef2('0x8c')]&&_0x49160e[_0x2ef2('0x5b')][_0x2ef2('0x8c')]===_0x3913a8[_0x2ef2('0x8d')]&&_0x49160e[_0x2ef2('0x5b')][_0x2ef2('0x8e')]&&_0x49160e[_0x2ef2('0x5b')][_0x2ef2('0x8e')]===_0x2ef2('0x61')){return _0x3913a8['update']({'read':!![]});}else{logger[_0x2ef2('0x29')](_0x2ef2('0x8f'),_0x2ef2('0x2d'),_0x2ef2('0x8b'),util[_0x2ef2('0x8a')](_0x49160e[_0x2ef2('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3913a8;}})[_0x2ef2('0x22')](respondWithResult(_0x195538,null))['catch'](handleError(_0x195538,null));}; \ No newline at end of file +var _0x0617=['set','Content-Range','json','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','WhatsappMessage','includeAll','include','show','find','create','body','params','describe','whatsapp-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','read1stAt','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','email','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x0617,0xe5));var _0x7061=function(_0x5f5239,_0x168952){_0x5f5239=_0x5f5239-0x0;var _0x1ed9ef=_0x0617[_0x5f5239];return _0x1ed9ef;};'use strict';var emlformat=require(_0x7061('0x0'));var rimraf=require(_0x7061('0x1'));var zipdir=require(_0x7061('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7061('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7061('0x4'));var path=require(_0x7061('0x5'));var sox=require(_0x7061('0x6'));var csv=require('to-csv');var ejs=require(_0x7061('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7061('0x8'));var crypto=require(_0x7061('0x9'));var jsforce=require(_0x7061('0xa'));var deskjs=require(_0x7061('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7061('0xc'));var Papa=require(_0x7061('0xd'));var Redis=require(_0x7061('0xe'));var authService=require(_0x7061('0xf'));var qs=require(_0x7061('0x10'));var as=require(_0x7061('0x11'));var hardwareService=require(_0x7061('0x12'));var logger=require(_0x7061('0x13'))(_0x7061('0x14'));var utils=require(_0x7061('0x15'));var config=require(_0x7061('0x16'));var licenseUtil=require(_0x7061('0x17'));var db=require('../../mysqldb')['db'];config[_0x7061('0x18')]=_[_0x7061('0x19')](config[_0x7061('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x7061('0x1a'))(new Redis(config[_0x7061('0x18')]));require(_0x7061('0x1b'))[_0x7061('0x1c')](socket);var jayson=require(_0x7061('0x1d'));var client=jayson[_0x7061('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x7061('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x416957,_0x4d23a9,_0x9fcf49,_0x45a292){return new BPromise(function(_0x5bae18,_0x41b45f){var _0x323d9a=_0x45a292||client;return _0x323d9a['request'](_0x416957,_0x9fcf49)[_0x7061('0x1f')](function(_0x27fe77){logger[_0x7061('0x20')](_0x7061('0x21'),_0x4d23a9,'request\x20sent');logger[_0x7061('0x22')](_0x7061('0x23'),_0x4d23a9,_0x7061('0x24'),JSON[_0x7061('0x25')](_0x27fe77));if(_0x27fe77[_0x7061('0x26')]){if(_0x27fe77[_0x7061('0x26')][_0x7061('0x27')]===0x1f4){logger[_0x7061('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x4d23a9,_0x27fe77[_0x7061('0x26')]['message']);return _0x41b45f(_0x27fe77[_0x7061('0x26')][_0x7061('0x28')]);}logger[_0x7061('0x26')](_0x7061('0x21'),_0x4d23a9,_0x27fe77[_0x7061('0x26')][_0x7061('0x28')]);return _0x5bae18(_0x27fe77[_0x7061('0x26')][_0x7061('0x28')]);}else{logger[_0x7061('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x4d23a9,'request\x20sent');_0x5bae18(_0x27fe77['result'][_0x7061('0x28')]);}})[_0x7061('0x29')](function(_0x4513a1){logger[_0x7061('0x26')](_0x7061('0x21'),_0x4d23a9,_0x4513a1);_0x41b45f(_0x4513a1);});});}function respondWithStatusCode(_0xbeb075,_0x4bf883){_0x4bf883=_0x4bf883||0xcc;return function(_0x4f2e6a){if(_0x4f2e6a){return _0xbeb075[_0x7061('0x2a')](_0x4bf883);}return _0xbeb075['status'](_0x4bf883)[_0x7061('0x2b')]();};}function respondWithResult(_0x2a0258,_0x351506){_0x351506=_0x351506||0xc8;return function(_0x19a76c){if(_0x19a76c){return _0x2a0258[_0x7061('0x2c')](_0x351506)['json'](_0x19a76c);}};}function respondWithFilteredResult(_0x8b4a35,_0x5be835){return function(_0x38b667){if(_0x38b667){var _0x28026f=typeof _0x5be835[_0x7061('0x2d')]===_0x7061('0x2e')&&typeof _0x5be835[_0x7061('0x2f')]===_0x7061('0x2e');var _0x1e6cc5=_0x38b667[_0x7061('0x30')];var _0x193c73=_0x28026f?0x0:_0x5be835[_0x7061('0x2d')];var _0x1bc1d7=_0x28026f?_0x38b667[_0x7061('0x30')]:_0x5be835[_0x7061('0x2d')]+_0x5be835[_0x7061('0x2f')];var _0x560983;if(_0x1bc1d7>=_0x1e6cc5){_0x1bc1d7=_0x1e6cc5;_0x560983=0xc8;}else{_0x560983=0xce;}_0x8b4a35[_0x7061('0x2c')](_0x560983);return _0x8b4a35[_0x7061('0x31')](_0x7061('0x32'),_0x193c73+'-'+_0x1bc1d7+'/'+_0x1e6cc5)[_0x7061('0x33')](_0x38b667);}return null;};}function patchUpdates(_0xd056af){return function(_0x13302e){try{jsonpatch['apply'](_0x13302e,_0xd056af,!![]);}catch(_0x160c27){return BPromise[_0x7061('0x34')](_0x160c27);}return _0x13302e['save']();};}function saveUpdates(_0x980176,_0x25efe2){return function(_0x2134fe){if(_0x2134fe){return _0x2134fe[_0x7061('0x35')](_0x980176)[_0x7061('0x1f')](function(_0x336ac3){return _0x336ac3;});}return null;};}function removeEntity(_0x5b9bf9,_0x45a3c8){return function(_0x438e96){if(_0x438e96){return _0x438e96[_0x7061('0x36')]()['then'](function(){_0x5b9bf9[_0x7061('0x2c')](0xcc)[_0x7061('0x2b')]();});}};}function handleEntityNotFound(_0x4e912c,_0x27c305){return function(_0x4e3764){if(!_0x4e3764){_0x4e912c[_0x7061('0x2a')](0x194);}return _0x4e3764;};}function handleError(_0x5f3896,_0x41e748){_0x41e748=_0x41e748||0x1f4;return function(_0x3011ce){logger[_0x7061('0x26')](_0x3011ce[_0x7061('0x37')]);if(_0x3011ce[_0x7061('0x38')]){delete _0x3011ce[_0x7061('0x38')];}_0x5f3896['status'](_0x41e748)[_0x7061('0x39')](_0x3011ce);};}exports[_0x7061('0x3a')]=function(_0x3707be,_0x3c8f7a){var _0x5b3aa6={},_0x31b0b0={},_0x32afe0={'count':0x0,'rows':[]};var _0x52aeb3=_[_0x7061('0x3b')](db['WhatsappMessage'][_0x7061('0x3c')],function(_0x4ab8e7){return{'name':_0x4ab8e7[_0x7061('0x3d')],'type':_0x4ab8e7[_0x7061('0x3e')][_0x7061('0x3f')]};});_0x31b0b0[_0x7061('0x40')]=_['map'](_0x52aeb3,'name');_0x31b0b0[_0x7061('0x41')]=_[_0x7061('0x42')](_0x3707be[_0x7061('0x41')]);_0x31b0b0[_0x7061('0x43')]=_['intersection'](_0x31b0b0[_0x7061('0x40')],_0x31b0b0['query']);_0x5b3aa6['attributes']=_[_0x7061('0x44')](_0x31b0b0[_0x7061('0x40')],qs[_0x7061('0x45')](_0x3707be['query']['fields']));_0x5b3aa6[_0x7061('0x46')]=_0x5b3aa6[_0x7061('0x46')][_0x7061('0x47')]?_0x5b3aa6[_0x7061('0x46')]:_0x31b0b0[_0x7061('0x40')];if(!_0x3707be[_0x7061('0x41')][_0x7061('0x48')](_0x7061('0x49'))){_0x5b3aa6[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x3707be[_0x7061('0x41')][_0x7061('0x2f')]);_0x5b3aa6[_0x7061('0x2d')]=qs[_0x7061('0x2d')](_0x3707be['query']['offset']);}_0x5b3aa6['order']=qs[_0x7061('0x4a')](_0x3707be[_0x7061('0x41')]['sort']);_0x5b3aa6['where']=qs[_0x7061('0x43')](_[_0x7061('0x4b')](_0x3707be[_0x7061('0x41')],_0x31b0b0['filters']),_0x52aeb3);if(_0x3707be[_0x7061('0x41')][_0x7061('0x4c')]){_0x5b3aa6[_0x7061('0x4d')]=_['merge'](_0x5b3aa6['where'],{'$or':_['map'](_0x52aeb3,function(_0x37b66e){if(_0x37b66e[_0x7061('0x3e')]!==_0x7061('0x4e')){var _0x563b94={};_0x563b94[_0x37b66e[_0x7061('0x38')]]={'$like':'%'+_0x3707be['query'][_0x7061('0x4c')]+'%'};return _0x563b94;}})});}_0x5b3aa6=_[_0x7061('0x4f')]({},_0x5b3aa6,_0x3707be[_0x7061('0x50')]);var _0x41ea16={'where':_0x5b3aa6[_0x7061('0x4d')]};return db[_0x7061('0x51')][_0x7061('0x30')](_0x41ea16)[_0x7061('0x1f')](function(_0x325610){_0x32afe0['count']=_0x325610;if(_0x3707be[_0x7061('0x41')][_0x7061('0x52')]){_0x5b3aa6[_0x7061('0x53')]=[{'all':!![]}];}return db[_0x7061('0x51')]['findAll'](_0x5b3aa6);})[_0x7061('0x1f')](function(_0x4ddc21){_0x32afe0['rows']=_0x4ddc21;return _0x32afe0;})['then'](respondWithFilteredResult(_0x3c8f7a,_0x5b3aa6))[_0x7061('0x29')](handleError(_0x3c8f7a,null));};exports[_0x7061('0x54')]=function(_0x292ef1,_0x5a77e6){var _0x52f319={'raw':!![],'where':{'id':_0x292ef1['params']['id']}},_0x54ac12={};_0x54ac12[_0x7061('0x40')]=_[_0x7061('0x42')](db['WhatsappMessage'][_0x7061('0x3c')]);_0x54ac12['query']=_['keys'](_0x292ef1[_0x7061('0x41')]);_0x54ac12[_0x7061('0x43')]=_[_0x7061('0x44')](_0x54ac12[_0x7061('0x40')],_0x54ac12[_0x7061('0x41')]);_0x52f319[_0x7061('0x46')]=_['intersection'](_0x54ac12[_0x7061('0x40')],qs[_0x7061('0x45')](_0x292ef1[_0x7061('0x41')][_0x7061('0x45')]));_0x52f319[_0x7061('0x46')]=_0x52f319[_0x7061('0x46')][_0x7061('0x47')]?_0x52f319[_0x7061('0x46')]:_0x54ac12['model'];if(_0x292ef1[_0x7061('0x41')][_0x7061('0x52')]){_0x52f319[_0x7061('0x53')]=[{'all':!![]}];}_0x52f319=_[_0x7061('0x4f')]({},_0x52f319,_0x292ef1[_0x7061('0x50')]);return db['WhatsappMessage'][_0x7061('0x55')](_0x52f319)['then'](handleEntityNotFound(_0x5a77e6,null))[_0x7061('0x1f')](respondWithResult(_0x5a77e6,null))[_0x7061('0x29')](handleError(_0x5a77e6,null));};exports[_0x7061('0x56')]=function(_0x294787,_0x18f433){return db[_0x7061('0x51')][_0x7061('0x56')](_0x294787['body'],{})[_0x7061('0x1f')](respondWithResult(_0x18f433,0xc9))['catch'](handleError(_0x18f433,null));};exports[_0x7061('0x35')]=function(_0x2abc20,_0x833c89){if(_0x2abc20[_0x7061('0x57')]['id']){delete _0x2abc20[_0x7061('0x57')]['id'];}return db[_0x7061('0x51')][_0x7061('0x55')]({'where':{'id':_0x2abc20['params']['id']}})['then'](handleEntityNotFound(_0x833c89,null))[_0x7061('0x1f')](saveUpdates(_0x2abc20['body'],null))[_0x7061('0x1f')](respondWithResult(_0x833c89,null))['catch'](handleError(_0x833c89,null));};exports[_0x7061('0x36')]=function(_0x6b42a9,_0x50c17d){return db[_0x7061('0x51')]['find']({'where':{'id':_0x6b42a9[_0x7061('0x58')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x50c17d,null))[_0x7061('0x1f')](removeEntity(_0x50c17d,null))[_0x7061('0x29')](handleError(_0x50c17d,null));};exports['describe']=function(_0x2bef77,_0x3de4f8){return db[_0x7061('0x51')][_0x7061('0x59')]()['then'](respondWithResult(_0x3de4f8,null))[_0x7061('0x29')](handleError(_0x3de4f8,null));};var interaction_log=require(_0x7061('0x13'))(_0x7061('0x5a'));exports[_0x7061('0x5b')]=function(_0x4cc101,_0x224744,_0x53afc0){var _0x24d739={'agent':{},'channel':'whatsapp'};if(_0x4cc101[_0x7061('0x57')]['id']){delete _0x4cc101['body']['id'];}_0x4cc101[_0x7061('0x57')]['read']=!![];_0x4cc101[_0x7061('0x57')][_0x7061('0x5c')]=moment()[_0x7061('0x5d')](_0x7061('0x5e'));_0x4cc101[_0x7061('0x57')]['UserId']=_0x4cc101[_0x7061('0x57')][_0x7061('0x5f')]||_0x4cc101[_0x7061('0x60')]['id'];_0x24d739[_0x7061('0x61')]['id']=_0x4cc101[_0x7061('0x57')]['UserId'];return db[_0x7061('0x51')][_0x7061('0x55')]({'where':{'id':_0x4cc101['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x224744,null))[_0x7061('0x1f')](saveUpdates(_0x4cc101[_0x7061('0x57')],null))[_0x7061('0x1f')](function(_0x24511f){if(_0x24511f){_0x24d739[_0x7061('0x28')]=_0x24511f['get']({'plain':!![]});return db['WhatsappInteraction'][_0x7061('0x55')]({'where':{'id':_0x24511f[_0x7061('0x62')]}});}return null;})[_0x7061('0x1f')](handleEntityNotFound(_0x224744,null))[_0x7061('0x1f')](function(_0x4fe65b){if(_0x4fe65b){return _0x4fe65b[_0x7061('0x35')]({'UserId':_0x4cc101[_0x7061('0x57')]['UserId'],'read1stAt':_[_0x7061('0x63')](_0x4fe65b[_0x7061('0x64')])?moment()[_0x7061('0x5d')](_0x7061('0x5e')):undefined});}return null;})['then'](function(_0x99a4f1){if(_0x99a4f1){_0x24d739['interaction']=_0x99a4f1[_0x7061('0x65')]({'plain':!![]});interaction_log[_0x7061('0x20')](_0x7061('0x66'),_0x4cc101[_0x7061('0x60')]['id'],_0x4cc101[_0x7061('0x60')][_0x7061('0x38')],_0x4cc101[_0x7061('0x60')][_0x7061('0x67')],_0x24d739[_0x7061('0x68')]['id'],_0x4cc101[_0x7061('0x57')]?JSON[_0x7061('0x25')](_0x4cc101[_0x7061('0x57')]):'null');return respondWithRpcPromise(_0x7061('0x69'),_0x7061('0x6a'),_0x24d739);}return null;})['then'](function(_0x779fd1){var _0x54b1b7=_0x7061('0x6b')+_0x779fd1[_0x7061('0x28')][_0x7061('0x6c')];return db['sequelize']['query'](_0x54b1b7,{'type':db['Sequelize'][_0x7061('0x6d')][_0x7061('0x6e')],'raw':!![]})[_0x7061('0x1f')](function(_0x31455c){return _0x31455c;});})['then'](function(_0x257454){if(_0x257454){_0x24d739['message'][_0x7061('0x6f')]=_0x257454[0x0];if(!_0x4cc101[_0x7061('0x57')]['UserId'])return;return db[_0x7061('0x70')]['find']({'where':{'id':_0x4cc101[_0x7061('0x57')][_0x7061('0x5f')],'role':_0x7061('0x61')},'attributes':['id',_0x7061('0x38'),_0x7061('0x71'),'email',_0x7061('0x72')],'raw':!![]});}return null;})[_0x7061('0x1f')](function(_0x182cb8){if(!_0x182cb8)return null;_0x24d739[_0x7061('0x28')][_0x7061('0x61')]=_0x182cb8;return _0x24d739;})['then'](function(_0x599b80){if(_0x599b80){if(_0x4cc101[_0x7061('0x57')]['manual']){_0x24d739[_0x7061('0x28')][_0x7061('0x73')]=util[_0x7061('0x5d')](_0x7061('0x74'),_0x4cc101[_0x7061('0x60')][_0x7061('0x38')]);_0x24d739[_0x7061('0x28')][_0x7061('0x75')]=_0x24d739[_0x7061('0x75')];_0x24d739[_0x7061('0x28')][_0x7061('0x76')]=_0x24d739[_0x7061('0x75')];_0x24d739[_0x7061('0x28')][_0x7061('0x77')]=_0x7061('0x5b');return respondWithRpcPromise(_0x7061('0x78'),'EventManager',{'event':_0x7061('0x79'),'message':_0x24d739[_0x7061('0x28')]},client9002)[_0x7061('0x1f')](function(){return _0x24d739;});}return _0x24d739;}return null;})['then'](respondWithResult(_0x224744,null))[_0x7061('0x29')](handleError(_0x224744,null));};var interaction_log=require(_0x7061('0x13'))(_0x7061('0x5a'));exports['reject']=function(_0x140500,_0x1b79ba,_0x42d5b1){var _0x28a9a3={'agent':{},'channel':'whatsapp'};if(_0x140500['body']['id']){delete _0x140500[_0x7061('0x57')]['id'];}_0x140500[_0x7061('0x57')][_0x7061('0x5f')]=_0x140500[_0x7061('0x57')][_0x7061('0x5f')]||_0x140500[_0x7061('0x60')]['id'];_0x28a9a3['agent']['id']=_0x140500[_0x7061('0x57')]['UserId'];return db[_0x7061('0x51')][_0x7061('0x55')]({'where':{'id':_0x140500[_0x7061('0x58')]['id'],'UserId':null}})[_0x7061('0x1f')](handleEntityNotFound(_0x1b79ba,null))[_0x7061('0x1f')](function(_0x5cc6b2){if(_0x5cc6b2){_0x28a9a3['message']=_0x5cc6b2['get']({'plain':!![]});return db[_0x7061('0x7a')][_0x7061('0x55')]({'where':{'id':_0x5cc6b2[_0x7061('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1b79ba,null))['then'](function(_0x4f39b1){if(_0x4f39b1){_0x28a9a3[_0x7061('0x68')]=_0x4f39b1[_0x7061('0x65')]({'plain':!![]});interaction_log[_0x7061('0x20')](_0x7061('0x7b'),_0x140500[_0x7061('0x60')]['id'],_0x140500[_0x7061('0x60')][_0x7061('0x38')],_0x140500[_0x7061('0x60')][_0x7061('0x67')],_0x28a9a3[_0x7061('0x68')]['id'],_0x140500[_0x7061('0x57')]?JSON['stringify'](_0x140500['body']):_0x7061('0x7c'));return respondWithRpcPromise(_0x7061('0x7d'),_0x7061('0x7e'),_0x28a9a3);}return null;})[_0x7061('0x1f')](function(_0xa3af49){var _0x106a06='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa3af49[_0x7061('0x28')][_0x7061('0x6c')];return db['sequelize'][_0x7061('0x41')](_0x106a06,{'type':db[_0x7061('0x7f')][_0x7061('0x6d')][_0x7061('0x6e')],'raw':!![]})[_0x7061('0x1f')](function(_0x19e33d){return _0x19e33d;});})['then'](function(_0x175b23){if(_0x175b23){_0x28a9a3['message'][_0x7061('0x6f')]=_0x175b23[0x0];if(!_0x140500[_0x7061('0x57')][_0x7061('0x5f')])return;return db['User'][_0x7061('0x55')]({'where':{'id':_0x140500[_0x7061('0x57')][_0x7061('0x5f')],'role':_0x7061('0x61')},'attributes':['id',_0x7061('0x38'),_0x7061('0x71'),_0x7061('0x80'),'internal'],'raw':!![]});}return null;})['then'](function(_0x28d22e){if(!_0x28d22e)return null;_0x28a9a3['message']['agent']=_0x28d22e;return _0x28a9a3;})[_0x7061('0x1f')](function(_0x2e72d3){if(_0x2e72d3){_0x2e72d3['message'][_0x7061('0x73')]=util[_0x7061('0x5d')](_0x7061('0x74'),_0x140500['user'][_0x7061('0x38')]);_0x2e72d3[_0x7061('0x28')][_0x7061('0x75')]=_0x28a9a3[_0x7061('0x75')];_0x2e72d3[_0x7061('0x28')]['motionChannel']=_0x28a9a3[_0x7061('0x75')];_0x2e72d3[_0x7061('0x28')]['event']=_0x7061('0x34');respondWithRpcPromise(_0x7061('0x78'),_0x7061('0x78'),{'event':_0x7061('0x81'),'message':_0x2e72d3[_0x7061('0x28')]},client9002);return _0x28a9a3;}return null;})[_0x7061('0x1f')](respondWithResult(_0x1b79ba,null))['catch'](handleError(_0x1b79ba,null));};exports[_0x7061('0x2c')]=function(_0x13061d,_0x357d7d,_0x160c2d){if(_0x13061d[_0x7061('0x57')]['id']){delete _0x13061d[_0x7061('0x57')]['id'];}var _0x4683d2;return db[_0x7061('0x51')]['find']({'where':{'id':_0x13061d[_0x7061('0x58')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x357d7d,null))[_0x7061('0x1f')](function(_0x478a6c){if(_0x478a6c){_0x4683d2=_0x478a6c;return db['WhatsappAccount'][_0x7061('0x55')]({'where':{'id':_0x478a6c[_0x7061('0x82')]}});}})[_0x7061('0x1f')](handleEntityNotFound(_0x357d7d,null))[_0x7061('0x1f')](function(_0x4bedf4){if(_0x4bedf4){logger[_0x7061('0x22')](_0x7061('0x83'),_0x7061('0x2c'),_0x7061('0x84'),_0x4bedf4[_0x7061('0x3e')],util[_0x7061('0x85')](_0x13061d[_0x7061('0x57')],{'showHidden':![],'depth':null}));switch(_0x4bedf4['type']){case _0x7061('0x86'):if(_0x13061d[_0x7061('0x57')][_0x7061('0x87')]&&_0x13061d[_0x7061('0x57')][_0x7061('0x87')]===_0x4683d2[_0x7061('0x88')]&&_0x13061d[_0x7061('0x57')][_0x7061('0x89')]&&_0x13061d[_0x7061('0x57')][_0x7061('0x89')]==='read'){return _0x4683d2[_0x7061('0x35')]({'read':!![]});}else{logger[_0x7061('0x26')](_0x7061('0x8a'),_0x7061('0x2c'),_0x7061('0x86'),util[_0x7061('0x85')](_0x13061d[_0x7061('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4683d2;}})[_0x7061('0x1f')](respondWithResult(_0x357d7d,null))[_0x7061('0x29')](handleError(_0x357d7d,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 5d47fd3..bc0fdf3 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 _0x4fc2=['emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x4fc2,0x111));var _0x24fc=function(_0x2eb4c0,_0x5806ec){_0x2eb4c0=_0x2eb4c0-0x0;var _0x272172=_0x4fc2[_0x2eb4c0];return _0x272172;};'use strict';var EventEmitter=require(_0x24fc('0x0'));var WhatsappMessage=require(_0x24fc('0x1'))['db'][_0x24fc('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x24fc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x24fc('0x4'),'afterDestroy':_0x24fc('0x5')};function emitEvent(_0x1e7fdf){return function(_0x541ad2,_0x126d90,_0x3772eb){WhatsappMessageEvents['emit'](_0x1e7fdf+':'+_0x541ad2['id'],_0x541ad2);WhatsappMessageEvents[_0x24fc('0x6')](_0x1e7fdf,_0x541ad2);_0x3772eb(null);};}for(var e in events){if(events[_0x24fc('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x24fc('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xac4a=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hook','events'];(function(_0x1cadf8,_0x3cb13b){var _0xf6bb89=function(_0xecbac1){while(--_0xecbac1){_0x1cadf8['push'](_0x1cadf8['shift']());}};_0xf6bb89(++_0x3cb13b);}(_0xac4a,0x13f));var _0xaac4=function(_0x1d948a,_0x14128d){_0x1d948a=_0x1d948a-0x0;var _0x12f970=_0xac4a[_0x1d948a];return _0x12f970;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var WhatsappMessage=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){WhatsappMessageEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);WhatsappMessageEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5b23057..e8c147f 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 _0x8ba3=['moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','then','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1576ce,_0x56ad54){var _0x494c06=function(_0x33e771){while(--_0x33e771){_0x1576ce['push'](_0x1576ce['shift']());}};_0x494c06(++_0x56ad54);}(_0x8ba3,0x1b0));var _0x38ba=function(_0x1697f9,_0x931814){_0x1697f9=_0x1697f9-0x0;var _0x1e2264=_0x8ba3[_0x1697f9];return _0x1e2264;};'use strict';var _=require('lodash');var util=require(_0x38ba('0x0'));var logger=require(_0x38ba('0x1'))('api');var moment=require(_0x38ba('0x2'));var BPromise=require(_0x38ba('0x3'));var rp=require(_0x38ba('0x4'));var fetch=require(_0x38ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38ba('0x6'));var config=require(_0x38ba('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x38ba('0x8')]=function(_0x5004a1,_0x40e313){return _0x5004a1[_0x38ba('0x9')](_0x38ba('0xa'),attributes,{'tableName':_0x38ba('0xb'),'paranoid':![],'indexes':[{'name':_0x38ba('0xc'),'fields':['messageId']},{'name':_0x38ba('0xd'),'fields':[_0x38ba('0xe')],'type':_0x38ba('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31b521,_0x4ea42b,_0x2a2587){var _0x211723=_0x5004a1[_0x38ba('0x10')];var _0x89e873=_0x31b521[_0x38ba('0x11')]({'plain':!![]});if(_0x89e873[_0x38ba('0x12')][_0x38ba('0x13')]()==='in'||_0x89e873[_0x38ba('0x12')]['toLowerCase']()===_0x38ba('0x14')&&!_0x89e873[_0x38ba('0x15')]&&!_[_0x38ba('0x16')](_0x89e873['UserId'])){_0x211723[_0x38ba('0x17')][_0x38ba('0x18')]({'where':{'id':_0x89e873['WhatsappInteractionId']}})[_0x38ba('0x19')](function(_0x3c7ae7){if(_0x3c7ae7){_0x3c7ae7['update']({'lastMsgAt':_0x89e873[_0x38ba('0x1a')],'lastMsgDirection':_0x89e873[_0x38ba('0x12')]['toLowerCase']()});}})[_0x38ba('0x1b')](function(_0x30c2f2){console[_0x38ba('0x1c')](_0x30c2f2);});}if(_0x89e873['direction']==='out'&&!_0x89e873[_0x38ba('0x15')]){var _0x246c3e;_0x211723[_0x38ba('0x1d')][_0x38ba('0x1e')]({'where':{'id':_0x89e873[_0x38ba('0x1f')]},'raw':!![]})[_0x38ba('0x19')](function(_0x624b7f){_0x246c3e=_0x624b7f;if(_0x246c3e&&_0x246c3e[_0x38ba('0x20')]){switch(_0x246c3e[_0x38ba('0x20')]){case _0x38ba('0x21'):var _0x32ee38=require(_0x38ba('0x21'));if(_0x246c3e[_0x38ba('0x22')]&&_0x246c3e['authToken']&&_0x246c3e[_0x38ba('0x23')]){var _0xa6121=new _0x32ee38(_0x246c3e[_0x38ba('0x22')],_0x246c3e[_0x38ba('0x24')]);_0xa6121[_0x38ba('0x25')][_0x38ba('0x26')]({'body':_0x89e873['body'],'to':'whatsapp:'+_0x89e873[_0x38ba('0x23')],'from':_0x38ba('0x27')+_0x246c3e['phone'],'statusCallback':_0x246c3e[_0x38ba('0x28')]+_0x38ba('0x29')+_0x89e873['id']+_0x38ba('0x2a')+_0x246c3e['token']})[_0x38ba('0x19')](function(_0x5708f2){if(_0x5708f2[_0x38ba('0x2b')]){return _0x31b521['update']({'messageId':_0x5708f2[_0x38ba('0x2b')]});}})['catch'](function(_0xb2c050){logger[_0x38ba('0x1c')](_0x38ba('0x2c'),_0x38ba('0x2d'),'twilio',util['inspect'](_0xb2c050,{'showHidden':![],'depth':null}));});}else{logger[_0x38ba('0x1c')](_0x38ba('0x2c'),_0x38ba('0x2d'),_0x38ba('0x21'),_0x38ba('0x2e'));}break;case _0x38ba('0x2f'):var _0x1c20bd=_0x246c3e[_0x38ba('0x22')];var _0x496b91=_0x246c3e[_0x38ba('0x24')];var _0x1f445f=_0x246c3e[_0x38ba('0x30')]+_0x38ba('0x31')+_0x1c20bd+_0x38ba('0x32');var _0x3fa93d={'to':[_0x89e873[_0x38ba('0x23')]],'message':{'type':_0x38ba('0x33'),'text':_0x89e873['body']}};var _0x716071={'method':_0x38ba('0x34'),'uri':_0x1f445f,'headers':{'Authorization':_0x38ba('0x35')+_0x496b91,'Content-Type':_0x38ba('0x36')},'body':_0x3fa93d,'json':!![]};rp(_0x716071)[_0x38ba('0x19')](function(_0x855a24){if(_0x855a24[_0x38ba('0x37')][0x0][_0x38ba('0x38')]){return _0x31b521['update']({'messageId':_0x855a24[_0x38ba('0x37')][0x0]['message_id']});}})[_0x38ba('0x1b')](function(_0x55fea3){logger[_0x38ba('0x39')](_0x38ba('0x3a'),_0x55fea3);});break;}}})[_0x38ba('0x3b')](function(){_0x2a2587();});}else{_0x2a2587();}}},'charset':_0x38ba('0x3c'),'collate':_0x38ba('0x3d')});}; \ No newline at end of file +var _0x6da2=['bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x534308,_0xc9339d){var _0x5ac77f=function(_0x506a46){while(--_0x506a46){_0x534308['push'](_0x534308['shift']());}};_0x5ac77f(++_0xc9339d);}(_0x6da2,0xe1));var _0x26da=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0x6da2[_0x4498a2];return _0x411aa8;};'use strict';var _=require(_0x26da('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x26da('0x1'));var moment=require(_0x26da('0x2'));var BPromise=require(_0x26da('0x3'));var rp=require(_0x26da('0x4'));var fetch=require(_0x26da('0x5'));var fs=require('fs');var path=require(_0x26da('0x6'));var rimraf=require('rimraf');var config=require(_0x26da('0x7'));var attributes=require(_0x26da('0x8'));module['exports']=function(_0x1ffca4,_0x21b52c){return _0x1ffca4['define'](_0x26da('0x9'),attributes,{'tableName':_0x26da('0xa'),'paranoid':![],'indexes':[{'name':_0x26da('0xb'),'fields':[_0x26da('0xb')]},{'name':_0x26da('0xc'),'fields':['body'],'type':_0x26da('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5645d9,_0x37b623,_0x5e91a7){var _0x12bbf8=_0x1ffca4[_0x26da('0xe')];var _0x581a74=_0x5645d9['get']({'plain':!![]});if(_0x581a74[_0x26da('0xf')][_0x26da('0x10')]()==='in'||_0x581a74[_0x26da('0xf')]['toLowerCase']()===_0x26da('0x11')&&!_0x581a74[_0x26da('0x12')]&&!_[_0x26da('0x13')](_0x581a74[_0x26da('0x14')])){_0x12bbf8[_0x26da('0x15')][_0x26da('0x16')]({'where':{'id':_0x581a74[_0x26da('0x17')]}})[_0x26da('0x18')](function(_0x65f163){if(_0x65f163){_0x65f163[_0x26da('0x19')]({'lastMsgAt':_0x581a74[_0x26da('0x1a')],'lastMsgDirection':_0x581a74[_0x26da('0xf')][_0x26da('0x10')]()});}})[_0x26da('0x1b')](function(_0x2012d6){console[_0x26da('0x1c')](_0x2012d6);});}if(_0x581a74[_0x26da('0xf')]===_0x26da('0x11')&&!_0x581a74[_0x26da('0x12')]){var _0x17d067;_0x12bbf8[_0x26da('0x1d')][_0x26da('0x1e')]({'where':{'id':_0x581a74[_0x26da('0x1f')]},'raw':!![]})['then'](function(_0x28f422){_0x17d067=_0x28f422;if(_0x17d067&&_0x17d067['type']){switch(_0x17d067[_0x26da('0x20')]){case _0x26da('0x21'):var _0x20c16f=require(_0x26da('0x21'));if(_0x17d067['accountSid']&&_0x17d067[_0x26da('0x22')]&&_0x17d067[_0x26da('0x23')]){var _0x11e260=new _0x20c16f(_0x17d067[_0x26da('0x24')],_0x17d067[_0x26da('0x22')]);_0x11e260['messages'][_0x26da('0x25')]({'body':_0x581a74[_0x26da('0x26')],'to':_0x26da('0x27')+_0x581a74[_0x26da('0x23')],'from':'whatsapp:'+_0x17d067[_0x26da('0x23')],'statusCallback':_0x17d067['remote']+_0x26da('0x28')+_0x581a74['id']+_0x26da('0x29')+_0x17d067[_0x26da('0x2a')]})[_0x26da('0x18')](function(_0x265949){if(_0x265949[_0x26da('0x2b')]){return _0x5645d9[_0x26da('0x19')]({'messageId':_0x265949[_0x26da('0x2b')]});}})[_0x26da('0x1b')](function(_0x3fe71d){logger[_0x26da('0x1c')](_0x26da('0x2c'),_0x26da('0x2d'),_0x26da('0x21'),util['inspect'](_0x3fe71d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x26da('0x2c'),_0x26da('0x2d'),_0x26da('0x21'),_0x26da('0x2e'));}break;case'sinch':var _0x2e699f=_0x17d067[_0x26da('0x24')];var _0x408b4b=_0x17d067[_0x26da('0x22')];var _0x491e85=_0x17d067[_0x26da('0x2f')]+_0x26da('0x30')+_0x2e699f+'/messages/';var _0x53aa32={'to':[_0x581a74['phone']],'message':{'type':_0x26da('0x31'),'text':_0x581a74[_0x26da('0x26')]}};var _0x5b5af8={'method':_0x26da('0x32'),'uri':_0x491e85,'headers':{'Authorization':'Bearer\x20'+_0x408b4b,'Content-Type':_0x26da('0x33')},'body':_0x53aa32,'json':!![]};rp(_0x5b5af8)[_0x26da('0x18')](function(_0x399efd){if(_0x399efd[_0x26da('0x34')][0x0]['message_id']){return _0x5645d9[_0x26da('0x19')]({'messageId':_0x399efd['statuses'][0x0][_0x26da('0x35')]});}})[_0x26da('0x1b')](function(_0x10e370){logger[_0x26da('0x36')](_0x26da('0x37'),_0x10e370);});break;}}})['finally'](function(){_0x5e91a7();});}else{_0x5e91a7();}}},'charset':'utf8mb4','collate':_0x26da('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e6da80d..354d12e 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 _0x6d6b=['localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','catch','CreateWhatsappMessage','WhatsappMessage','create','body','raw','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x2f5fa7,_0x299f74){var _0x459db6=function(_0x9acc6d){while(--_0x9acc6d){_0x2f5fa7['push'](_0x2f5fa7['shift']());}};_0x459db6(++_0x299f74);}(_0x6d6b,0x134));var _0xb6d6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6d6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb6d6('0x0'));var util=require('util');var moment=require(_0xb6d6('0x1'));var BPromise=require(_0xb6d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6d6('0x3'));var db=require(_0xb6d6('0x4'))['db'];var utils=require(_0xb6d6('0x5'));var logger=require(_0xb6d6('0x6'))(_0xb6d6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6d6('0x8'));var client=jayson[_0xb6d6('0x9')][_0xb6d6('0xa')]({'port':0x232a});config[_0xb6d6('0xb')]=_['defaults'](config[_0xb6d6('0xb')],{'host':_0xb6d6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6d6('0xb')]));require(_0xb6d6('0xd'))[_0xb6d6('0xe')](socket);function respondWithRpcPromise(_0x256abb,_0x5bda51,_0xf131d3){return new BPromise(function(_0x3af24a,_0x4e91b8){return client[_0xb6d6('0xf')](_0x256abb,_0xf131d3)[_0xb6d6('0x10')](function(_0x4060d4){logger[_0xb6d6('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x5bda51,'request\x20sent');logger['debug'](_0xb6d6('0x12'),_0x5bda51,_0xb6d6('0x13'),JSON[_0xb6d6('0x14')](_0x4060d4));if(_0x4060d4[_0xb6d6('0x15')]){if(_0x4060d4['error'][_0xb6d6('0x16')]===0x1f4){logger[_0xb6d6('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5bda51,_0x4060d4['error'][_0xb6d6('0x17')]);return _0x4e91b8(_0x4060d4[_0xb6d6('0x15')][_0xb6d6('0x17')]);}logger[_0xb6d6('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5bda51,_0x4060d4[_0xb6d6('0x15')]['message']);return _0x3af24a(_0x4060d4[_0xb6d6('0x15')][_0xb6d6('0x17')]);}else{logger['info'](_0xb6d6('0x18'),_0x5bda51,_0xb6d6('0x13'));_0x3af24a(_0x4060d4['result'][_0xb6d6('0x17')]);}})[_0xb6d6('0x19')](function(_0x4e0969){logger[_0xb6d6('0x15')](_0xb6d6('0x18'),_0x5bda51,_0x4e0969);_0x4e91b8(_0x4e0969);});});}exports[_0xb6d6('0x1a')]=function(_0x440572){var _0x225e4b=this;return new Promise(function(_0x1ca486,_0x4243ad){return db[_0xb6d6('0x1b')][_0xb6d6('0x1c')](_0x440572[_0xb6d6('0x1d')],{'raw':_0x440572['options']?_0x440572['options'][_0xb6d6('0x1e')]===undefined?!![]:![]:!![]})[_0xb6d6('0x10')](function(_0x562ec1){logger[_0xb6d6('0x11')](_0xb6d6('0x1a'),_0x440572);logger[_0xb6d6('0x1f')](_0xb6d6('0x1a'),_0x440572,JSON['stringify'](_0x562ec1));_0x1ca486(_0x562ec1);})[_0xb6d6('0x19')](function(_0xed5e3e){logger[_0xb6d6('0x15')](_0xb6d6('0x1a'),_0xed5e3e[_0xb6d6('0x17')],_0x440572);_0x4243ad(_0x225e4b[_0xb6d6('0x15')](0x1f4,_0xed5e3e[_0xb6d6('0x17')]));});});}; \ No newline at end of file +var _0xcfd9=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateWhatsappMessage','create','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x240a78,_0x2f61bd){var _0xb4caa0=function(_0x4815ee){while(--_0x4815ee){_0x240a78['push'](_0x240a78['shift']());}};_0xb4caa0(++_0x2f61bd);}(_0xcfd9,0xc7));var _0x9cfd=function(_0xc14e9b,_0x5c3047){_0xc14e9b=_0xc14e9b-0x0;var _0x48f298=_0xcfd9[_0xc14e9b];return _0x48f298;};'use strict';var _=require(_0x9cfd('0x0'));var util=require(_0x9cfd('0x1'));var moment=require(_0x9cfd('0x2'));var BPromise=require(_0x9cfd('0x3'));var rs=require(_0x9cfd('0x4'));var fs=require('fs');var Redis=require(_0x9cfd('0x5'));var db=require(_0x9cfd('0x6'))['db'];var utils=require(_0x9cfd('0x7'));var logger=require(_0x9cfd('0x8'))(_0x9cfd('0x9'));var config=require(_0x9cfd('0xa'));var jayson=require(_0x9cfd('0xb'));var client=jayson[_0x9cfd('0xc')]['http']({'port':0x232a});config[_0x9cfd('0xd')]=_[_0x9cfd('0xe')](config[_0x9cfd('0xd')],{'host':_0x9cfd('0xf'),'port':0x18eb});var socket=require(_0x9cfd('0x10'))(new Redis(config[_0x9cfd('0xd')]));require(_0x9cfd('0x11'))[_0x9cfd('0x12')](socket);function respondWithRpcPromise(_0x151cb0,_0x1bb03d,_0x2b117c){return new BPromise(function(_0x2b949d,_0x38b6e2){return client[_0x9cfd('0x13')](_0x151cb0,_0x2b117c)[_0x9cfd('0x14')](function(_0x37eb3e){logger[_0x9cfd('0x15')](_0x9cfd('0x16'),_0x1bb03d,'request\x20sent');logger['debug'](_0x9cfd('0x17'),_0x1bb03d,_0x9cfd('0x18'),JSON['stringify'](_0x37eb3e));if(_0x37eb3e[_0x9cfd('0x19')]){if(_0x37eb3e[_0x9cfd('0x19')][_0x9cfd('0x1a')]===0x1f4){logger['error'](_0x9cfd('0x16'),_0x1bb03d,_0x37eb3e[_0x9cfd('0x19')][_0x9cfd('0x1b')]);return _0x38b6e2(_0x37eb3e[_0x9cfd('0x19')]['message']);}logger[_0x9cfd('0x19')](_0x9cfd('0x16'),_0x1bb03d,_0x37eb3e['error']['message']);return _0x2b949d(_0x37eb3e[_0x9cfd('0x19')][_0x9cfd('0x1b')]);}else{logger['info'](_0x9cfd('0x16'),_0x1bb03d,_0x9cfd('0x18'));_0x2b949d(_0x37eb3e['result'][_0x9cfd('0x1b')]);}})[_0x9cfd('0x1c')](function(_0x3dea93){logger[_0x9cfd('0x19')](_0x9cfd('0x16'),_0x1bb03d,_0x3dea93);_0x38b6e2(_0x3dea93);});});}exports[_0x9cfd('0x1d')]=function(_0x5e5d7b){var _0x3af3ea=this;return new Promise(function(_0x22109e,_0x101c7e){return db['WhatsappMessage'][_0x9cfd('0x1e')](_0x5e5d7b['body'],{'raw':_0x5e5d7b[_0x9cfd('0x1f')]?_0x5e5d7b[_0x9cfd('0x1f')][_0x9cfd('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5ac718){logger['info'](_0x9cfd('0x1d'),_0x5e5d7b);logger[_0x9cfd('0x21')](_0x9cfd('0x1d'),_0x5e5d7b,JSON[_0x9cfd('0x22')](_0x5ac718));_0x22109e(_0x5ac718);})[_0x9cfd('0x1c')](function(_0x465fae){logger[_0x9cfd('0x19')](_0x9cfd('0x1d'),_0x465fae[_0x9cfd('0x1b')],_0x5e5d7b);_0x101c7e(_0x3af3ea[_0x9cfd('0x19')](0x1f4,_0x465fae[_0x9cfd('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 377728a..f813437 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 _0x4db1=['remove','removeListener','register','./whatsappMessage.events','save'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x4db1,0x116));var _0x14db=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x4db1[_0x30f030];return _0xf7614f;};'use strict';var WhatsappMessageEvents=require(_0x14db('0x0'));var events=[_0x14db('0x1'),_0x14db('0x2'),'update'];function createListener(_0x12efab,_0x5cc8d4){return function(_0x31e843){_0x5cc8d4['emit'](_0x12efab,_0x31e843);};}function removeListener(_0x3fbd86,_0x1385d0){return function(){WhatsappMessageEvents[_0x14db('0x3')](_0x3fbd86,_0x1385d0);};}exports[_0x14db('0x4')]=function(_0x371b83){for(var _0x4541de=0x0,_0x37a7b9=events['length'];_0x4541de<_0x37a7b9;_0x4541de++){var _0x33ae76=events[_0x4541de];var _0x6a2ef=createListener('whatsappMessage:'+_0x33ae76,_0x371b83);WhatsappMessageEvents['on'](_0x33ae76,_0x6a2ef);}}; \ No newline at end of file +var _0x77b9=['removeListener','register','length','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x77b9,0x1ef));var _0x977b=function(_0x5596ac,_0x1fb99a){_0x5596ac=_0x5596ac-0x0;var _0x2a0432=_0x77b9[_0x5596ac];return _0x2a0432;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save','remove',_0x977b('0x0')];function createListener(_0x3662ef,_0x1b0f5e){return function(_0x593311){_0x1b0f5e['emit'](_0x3662ef,_0x593311);};}function removeListener(_0x229caf,_0x571a5d){return function(){WhatsappMessageEvents[_0x977b('0x1')](_0x229caf,_0x571a5d);};}exports[_0x977b('0x2')]=function(_0x50474e){for(var _0xb773cb=0x0,_0x47a780=events[_0x977b('0x3')];_0xb773cb<_0x47a780;_0xb773cb++){var _0x24a539=events[_0xb773cb];var _0x2072bb=createListener('whatsappMessage:'+_0x24a539,_0x50474e);WhatsappMessageEvents['on'](_0x24a539,_0x2072bb);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index f47efb3..3b16f5a 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 _0xb1bc=['removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x254ee7,_0x9bba53){var _0x19486c=function(_0x4e9276){while(--_0x4e9276){_0x254ee7['push'](_0x254ee7['shift']());}};_0x19486c(++_0x9bba53);}(_0xb1bc,0x119));var _0xcb1b=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xb1bc[_0x51b0dc];return _0x13fa89;};'use strict';var multer=require(_0xcb1b('0x0'));var util=require(_0xcb1b('0x1'));var path=require(_0xcb1b('0x2'));var timeout=require(_0xcb1b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcb1b('0x4'));var auth=require(_0xcb1b('0x5'));var interaction=require(_0xcb1b('0x6'));var config=require(_0xcb1b('0x7'));var controller=require(_0xcb1b('0x8'));router[_0xcb1b('0x9')]('/',auth[_0xcb1b('0xa')](),controller[_0xcb1b('0xb')]);router['get'](_0xcb1b('0xc'),auth['isAuthenticated'](),controller[_0xcb1b('0xd')]);router[_0xcb1b('0x9')](_0xcb1b('0xe'),auth['isAuthenticated'](),controller[_0xcb1b('0xf')]);router[_0xcb1b('0x9')](_0xcb1b('0x10'),auth['isAuthenticated'](),controller[_0xcb1b('0x11')]);router['get'](_0xcb1b('0x12'),auth['isAuthenticated'](),controller[_0xcb1b('0x13')]);router[_0xcb1b('0x9')](_0xcb1b('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcb1b('0x15')]('/',auth[_0xcb1b('0xa')](),controller[_0xcb1b('0x16')]);router[_0xcb1b('0x15')](_0xcb1b('0x12'),auth[_0xcb1b('0xa')](),controller[_0xcb1b('0x17')]);router[_0xcb1b('0x15')](_0xcb1b('0x14'),auth[_0xcb1b('0xa')](),controller[_0xcb1b('0x18')]);router[_0xcb1b('0x19')](_0xcb1b('0xe'),auth['isAuthenticated'](),controller[_0xcb1b('0x1a')]);router['delete'](_0xcb1b('0xe'),auth[_0xcb1b('0xa')](),controller['destroy']);router[_0xcb1b('0x1b')](_0xcb1b('0x12'),auth[_0xcb1b('0xa')](),controller[_0xcb1b('0x1c')]);router[_0xcb1b('0x1b')](_0xcb1b('0x14'),auth['isAuthenticated'](),controller[_0xcb1b('0x1d')]);module[_0xcb1b('0x1e')]=router; \ No newline at end of file +var _0x6407=['getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','getMembers','getTeams','/:id/users'];(function(_0x201de6,_0x295035){var _0x2b9e31=function(_0x54b39c){while(--_0x54b39c){_0x201de6['push'](_0x201de6['shift']());}};_0x2b9e31(++_0x295035);}(_0x6407,0xb5));var _0x7640=function(_0x17266e,_0x5d273d){_0x17266e=_0x17266e-0x0;var _0x8eeaf4=_0x6407[_0x17266e];return _0x8eeaf4;};'use strict';var multer=require('multer');var util=require(_0x7640('0x0'));var path=require('path');var timeout=require(_0x7640('0x1'));var express=require(_0x7640('0x2'));var router=express[_0x7640('0x3')]();var fs_extra=require(_0x7640('0x4'));var auth=require(_0x7640('0x5'));var interaction=require(_0x7640('0x6'));var config=require(_0x7640('0x7'));var controller=require('./whatsappQueue.controller');router[_0x7640('0x8')]('/',auth[_0x7640('0x9')](),controller['index']);router[_0x7640('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7640('0xa')]);router[_0x7640('0x8')](_0x7640('0xb'),auth[_0x7640('0x9')](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x7640('0xc')]);router['get']('/:id/teams',auth[_0x7640('0x9')](),controller[_0x7640('0xd')]);router[_0x7640('0x8')](_0x7640('0xe'),auth[_0x7640('0x9')](),controller[_0x7640('0xf')]);router[_0x7640('0x10')]('/',auth[_0x7640('0x9')](),controller[_0x7640('0x11')]);router['post'](_0x7640('0x12'),auth[_0x7640('0x9')](),controller[_0x7640('0x13')]);router[_0x7640('0x10')](_0x7640('0xe'),auth['isAuthenticated'](),controller[_0x7640('0x14')]);router[_0x7640('0x15')](_0x7640('0xb'),auth['isAuthenticated'](),controller[_0x7640('0x16')]);router[_0x7640('0x17')](_0x7640('0xb'),auth['isAuthenticated'](),controller[_0x7640('0x18')]);router[_0x7640('0x17')](_0x7640('0x12'),auth[_0x7640('0x9')](),controller[_0x7640('0x19')]);router['delete'](_0x7640('0xe'),auth[_0x7640('0x9')](),controller[_0x7640('0x1a')]);module[_0x7640('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 52e5f60..b335c22 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 _0xc125=['exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x50c109,_0x1b8d3e){var _0x355214=function(_0xb6c17c){while(--_0xb6c17c){_0x50c109['push'](_0x50c109['shift']());}};_0x355214(++_0x1b8d3e);}(_0xc125,0x150));var _0x5c12=function(_0x18f76f,_0xcba2f4){_0x18f76f=_0x18f76f-0x0;var _0x4aa730=_0xc125[_0x18f76f];return _0x4aa730;};'use strict';var Sequelize=require('sequelize');module[_0x5c12('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5c12('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5c12('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c12('0x3')](_0x5c12('0x4'),_0x5c12('0x5'),_0x5c12('0x6'))},'description':{'type':Sequelize[_0x5c12('0x7')]}}; \ No newline at end of file +var _0xf430=['STRING','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x5445fe,_0x17a013){var _0x3e78ae=function(_0x4caa07){while(--_0x4caa07){_0x5445fe['push'](_0x5445fe['shift']());}};_0x3e78ae(++_0x17a013);}(_0xf430,0x1e4));var _0x0f43=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0xf430[_0x17882c];return _0x355a59;};'use strict';var Sequelize=require(_0x0f43('0x0'));module[_0x0f43('0x1')]={'name':{'type':Sequelize[_0x0f43('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0f43('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f43('0x4')]('rrmemory','beepall',_0x0f43('0x5'))},'description':{'type':Sequelize[_0x0f43('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 516c775..705aab1 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 _0xce66=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','name','send','index','map','rawAttributes','type','model','query','intersection','fields','attributes','length','order','sort','where','filters','filter','merge','VIRTUAL','options','WhatsappQueue','includeAll','rows','catch','params','keys','include','find','create','user','WhatsappQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','hasOwnProperty','pick','WhatsappQueueId','findAll','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','whatsappPause','Team','getTeams','nolimit','ids','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','UserWhatsappQueue','emit','userWhatsappQueue:save','User','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','sequelize','toString','every','TeamId','includes','compact','value','removeTeams','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','socket.io-emitter','./whatsappQueue.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce66,0xed));var _0x6ce6=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0xce66[_0x340da7];return _0x43b466;};'use strict';var emlformat=require(_0x6ce6('0x0'));var rimraf=require(_0x6ce6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ce6('0x2'));var moment=require('moment');var BPromise=require(_0x6ce6('0x3'));var Mustache=require('mustache');var util=require(_0x6ce6('0x4'));var path=require(_0x6ce6('0x5'));var sox=require('sox');var csv=require(_0x6ce6('0x6'));var ejs=require(_0x6ce6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6ce6('0x8'));var crypto=require(_0x6ce6('0x9'));var jsforce=require(_0x6ce6('0xa'));var deskjs=require(_0x6ce6('0xb'));var toCsv=require(_0x6ce6('0x6'));var querystring=require(_0x6ce6('0xc'));var Papa=require(_0x6ce6('0xd'));var Redis=require(_0x6ce6('0xe'));var authService=require(_0x6ce6('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ce6('0x10'));var logger=require(_0x6ce6('0x11'))(_0x6ce6('0x12'));var utils=require(_0x6ce6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6ce6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6ce6('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ce6('0x16'))(new Redis(config['redis']));require(_0x6ce6('0x17'))[_0x6ce6('0x18')](socket);function respondWithStatusCode(_0x34ea23,_0x5e4dc2){_0x5e4dc2=_0x5e4dc2||0xcc;return function(_0x57bad7){if(_0x57bad7){return _0x34ea23[_0x6ce6('0x19')](_0x5e4dc2);}return _0x34ea23[_0x6ce6('0x1a')](_0x5e4dc2)['end']();};}function respondWithResult(_0x4c382d,_0x5f3f6f){_0x5f3f6f=_0x5f3f6f||0xc8;return function(_0x192e9a){if(_0x192e9a){return _0x4c382d[_0x6ce6('0x1a')](_0x5f3f6f)[_0x6ce6('0x1b')](_0x192e9a);}};}function respondWithFilteredResult(_0x19fbd2,_0x2aa260){return function(_0x12f55c){if(_0x12f55c){var _0x33dc61=typeof _0x2aa260[_0x6ce6('0x1c')]===_0x6ce6('0x1d')&&typeof _0x2aa260[_0x6ce6('0x1e')]===_0x6ce6('0x1d');var _0xf81548=_0x12f55c[_0x6ce6('0x1f')];var _0x6fce75=_0x33dc61?0x0:_0x2aa260[_0x6ce6('0x1c')];var _0x35eb11=_0x33dc61?_0x12f55c[_0x6ce6('0x1f')]:_0x2aa260[_0x6ce6('0x1c')]+_0x2aa260[_0x6ce6('0x1e')];var _0x54435c;if(_0x35eb11>=_0xf81548){_0x35eb11=_0xf81548;_0x54435c=0xc8;}else{_0x54435c=0xce;}_0x19fbd2['status'](_0x54435c);return _0x19fbd2[_0x6ce6('0x20')](_0x6ce6('0x21'),_0x6fce75+'-'+_0x35eb11+'/'+_0xf81548)[_0x6ce6('0x1b')](_0x12f55c);}return null;};}function patchUpdates(_0x66ee33){return function(_0x42d298){try{jsonpatch['apply'](_0x42d298,_0x66ee33,!![]);}catch(_0x16a249){return BPromise[_0x6ce6('0x22')](_0x16a249);}return _0x42d298[_0x6ce6('0x23')]();};}function saveUpdates(_0x4a359f,_0x153987){return function(_0x2a8373){if(_0x2a8373){return _0x2a8373[_0x6ce6('0x24')](_0x4a359f)[_0x6ce6('0x25')](function(_0x22d9e6){return _0x22d9e6;});}return null;};}function removeEntity(_0x1565fe,_0x570209){return function(_0x567631){if(_0x567631){return _0x567631[_0x6ce6('0x26')]()[_0x6ce6('0x25')](function(){var _0x169dc7=_0x567631[_0x6ce6('0x27')]({'plain':!![]});var _0x17b56e='WhatsappQueues';return db['UserProfileResource'][_0x6ce6('0x26')]({'where':{'type':_0x17b56e,'resourceId':_0x169dc7['id']}})[_0x6ce6('0x25')](function(){return _0x567631;});})['then'](function(){_0x1565fe[_0x6ce6('0x1a')](0xcc)[_0x6ce6('0x28')]();});}};}function handleEntityNotFound(_0x3dec9b,_0x54d840){return function(_0x100ba4){if(!_0x100ba4){_0x3dec9b['sendStatus'](0x194);}return _0x100ba4;};}function handleError(_0x46b85b,_0x54e61c){_0x54e61c=_0x54e61c||0x1f4;return function(_0x44e68b){logger[_0x6ce6('0x29')](_0x44e68b[_0x6ce6('0x2a')]);if(_0x44e68b[_0x6ce6('0x2b')]){delete _0x44e68b[_0x6ce6('0x2b')];}_0x46b85b[_0x6ce6('0x1a')](_0x54e61c)[_0x6ce6('0x2c')](_0x44e68b);};}exports[_0x6ce6('0x2d')]=function(_0x1d01ac,_0x53a519){var _0x50115c={},_0x358de3={},_0x4ab099={'count':0x0,'rows':[]};var _0x228866=_[_0x6ce6('0x2e')](db['WhatsappQueue'][_0x6ce6('0x2f')],function(_0x12cd92){return{'name':_0x12cd92['fieldName'],'type':_0x12cd92[_0x6ce6('0x30')]['key']};});_0x358de3[_0x6ce6('0x31')]=_[_0x6ce6('0x2e')](_0x228866,_0x6ce6('0x2b'));_0x358de3[_0x6ce6('0x32')]=_['keys'](_0x1d01ac[_0x6ce6('0x32')]);_0x358de3['filters']=_[_0x6ce6('0x33')](_0x358de3[_0x6ce6('0x31')],_0x358de3['query']);_0x50115c['attributes']=_[_0x6ce6('0x33')](_0x358de3[_0x6ce6('0x31')],qs[_0x6ce6('0x34')](_0x1d01ac[_0x6ce6('0x32')][_0x6ce6('0x34')]));_0x50115c['attributes']=_0x50115c[_0x6ce6('0x35')][_0x6ce6('0x36')]?_0x50115c[_0x6ce6('0x35')]:_0x358de3['model'];if(!_0x1d01ac[_0x6ce6('0x32')]['hasOwnProperty']('nolimit')){_0x50115c['limit']=qs[_0x6ce6('0x1e')](_0x1d01ac[_0x6ce6('0x32')][_0x6ce6('0x1e')]);_0x50115c['offset']=qs[_0x6ce6('0x1c')](_0x1d01ac[_0x6ce6('0x32')][_0x6ce6('0x1c')]);}_0x50115c[_0x6ce6('0x37')]=qs[_0x6ce6('0x38')](_0x1d01ac['query']['sort']);_0x50115c[_0x6ce6('0x39')]=qs[_0x6ce6('0x3a')](_['pick'](_0x1d01ac['query'],_0x358de3[_0x6ce6('0x3a')]),_0x228866);if(_0x1d01ac[_0x6ce6('0x32')][_0x6ce6('0x3b')]){_0x50115c[_0x6ce6('0x39')]=_[_0x6ce6('0x3c')](_0x50115c[_0x6ce6('0x39')],{'$or':_[_0x6ce6('0x2e')](_0x228866,function(_0x3c1ecd){if(_0x3c1ecd[_0x6ce6('0x30')]!==_0x6ce6('0x3d')){var _0x329011={};_0x329011[_0x3c1ecd[_0x6ce6('0x2b')]]={'$like':'%'+_0x1d01ac['query'][_0x6ce6('0x3b')]+'%'};return _0x329011;}})});}_0x50115c=_[_0x6ce6('0x3c')]({},_0x50115c,_0x1d01ac[_0x6ce6('0x3e')]);var _0x1d71f9={'where':_0x50115c[_0x6ce6('0x39')]};return db[_0x6ce6('0x3f')][_0x6ce6('0x1f')](_0x1d71f9)[_0x6ce6('0x25')](function(_0x30f0ca){_0x4ab099[_0x6ce6('0x1f')]=_0x30f0ca;if(_0x1d01ac[_0x6ce6('0x32')][_0x6ce6('0x40')]){_0x50115c['include']=[{'all':!![]}];}return db[_0x6ce6('0x3f')]['findAll'](_0x50115c);})[_0x6ce6('0x25')](function(_0x4b23bb){_0x4ab099[_0x6ce6('0x41')]=_0x4b23bb;return _0x4ab099;})['then'](respondWithFilteredResult(_0x53a519,_0x50115c))[_0x6ce6('0x42')](handleError(_0x53a519,null));};exports['show']=function(_0x4ffb90,_0x1648c6){var _0x755f2={'raw':!![],'where':{'id':_0x4ffb90[_0x6ce6('0x43')]['id']}},_0x28d841={};_0x28d841[_0x6ce6('0x31')]=_['keys'](db[_0x6ce6('0x3f')][_0x6ce6('0x2f')]);_0x28d841[_0x6ce6('0x32')]=_[_0x6ce6('0x44')](_0x4ffb90['query']);_0x28d841[_0x6ce6('0x3a')]=_['intersection'](_0x28d841[_0x6ce6('0x31')],_0x28d841[_0x6ce6('0x32')]);_0x755f2[_0x6ce6('0x35')]=_[_0x6ce6('0x33')](_0x28d841[_0x6ce6('0x31')],qs[_0x6ce6('0x34')](_0x4ffb90[_0x6ce6('0x32')]['fields']));_0x755f2['attributes']=_0x755f2['attributes']['length']?_0x755f2[_0x6ce6('0x35')]:_0x28d841[_0x6ce6('0x31')];if(_0x4ffb90[_0x6ce6('0x32')][_0x6ce6('0x40')]){_0x755f2[_0x6ce6('0x45')]=[{'all':!![]}];}_0x755f2=_['merge']({},_0x755f2,_0x4ffb90[_0x6ce6('0x3e')]);return db[_0x6ce6('0x3f')][_0x6ce6('0x46')](_0x755f2)[_0x6ce6('0x25')](handleEntityNotFound(_0x1648c6,null))[_0x6ce6('0x25')](respondWithResult(_0x1648c6,null))[_0x6ce6('0x42')](handleError(_0x1648c6,null));};exports[_0x6ce6('0x47')]=function(_0xf2e7d,_0xce1454){return db[_0x6ce6('0x3f')]['create'](_0xf2e7d['body'],{})[_0x6ce6('0x25')](function(_0x9d238f){var _0x3fea45=_0xf2e7d[_0x6ce6('0x48')][_0x6ce6('0x27')]({'plain':!![]});if(!_0x3fea45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fea45['role']==='user'){var _0x1d3d55=_0x9d238f['get']({'plain':!![]});var _0x26c1ce=_0x6ce6('0x49');return db['UserProfileSection'][_0x6ce6('0x46')]({'where':{'name':_0x26c1ce,'userProfileId':_0x3fea45['userProfileId']},'raw':!![]})[_0x6ce6('0x25')](function(_0x176420){if(_0x176420&&_0x176420[_0x6ce6('0x4a')]===0x0){return db['UserProfileResource'][_0x6ce6('0x47')]({'name':_0x1d3d55['name'],'resourceId':_0x1d3d55['id'],'type':_0x176420[_0x6ce6('0x2b')],'sectionId':_0x176420['id']},{})['then'](function(){return _0x9d238f;});}else{return _0x9d238f;}})[_0x6ce6('0x42')](function(_0x3b4a7f){logger[_0x6ce6('0x29')](_0x6ce6('0x4b'),_0x3b4a7f);throw _0x3b4a7f;});}return _0x9d238f;})[_0x6ce6('0x25')](respondWithResult(_0xce1454,0xc9))[_0x6ce6('0x42')](handleError(_0xce1454,null));};exports[_0x6ce6('0x24')]=function(_0x14d308,_0x18218e){if(_0x14d308[_0x6ce6('0x4c')]['id']){delete _0x14d308[_0x6ce6('0x4c')]['id'];}return db[_0x6ce6('0x3f')][_0x6ce6('0x46')]({'where':{'id':_0x14d308[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x18218e,null))[_0x6ce6('0x25')](saveUpdates(_0x14d308[_0x6ce6('0x4c')],null))[_0x6ce6('0x25')](respondWithResult(_0x18218e,null))[_0x6ce6('0x42')](handleError(_0x18218e,null));};exports[_0x6ce6('0x26')]=function(_0xbed1a6,_0x500482){return db[_0x6ce6('0x3f')][_0x6ce6('0x46')]({'where':{'id':_0xbed1a6[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x500482,null))[_0x6ce6('0x25')](removeEntity(_0x500482,null))[_0x6ce6('0x42')](handleError(_0x500482,null));};exports['describe']=function(_0xbe1d75,_0x56f825){return db['WhatsappQueue']['describe']()[_0x6ce6('0x25')](respondWithResult(_0x56f825,null))[_0x6ce6('0x42')](handleError(_0x56f825,null));};exports[_0x6ce6('0x4d')]=function(_0x5cd6ae,_0x41c267,_0x3ebbb3){var _0x1005cc={'raw':!![],'where':{}},_0x233b42={},_0x9dad58;return db[_0x6ce6('0x3f')][_0x6ce6('0x4e')]({'where':{'id':_0x5cd6ae[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x41c267,null))['then'](function(_0x3e3079){if(_0x3e3079){_0x9dad58=_0x3e3079[_0x6ce6('0x27')]({'plain':!![]});_0x233b42[_0x6ce6('0x31')]=_[_0x6ce6('0x44')](db['UserWhatsappQueue'][_0x6ce6('0x2f')]);_0x233b42[_0x6ce6('0x32')]=_[_0x6ce6('0x44')](_0x5cd6ae[_0x6ce6('0x32')]);_0x233b42['filters']=_[_0x6ce6('0x33')](_0x233b42[_0x6ce6('0x31')],_0x233b42[_0x6ce6('0x32')]);_0x1005cc[_0x6ce6('0x35')]=_['intersection'](_0x233b42['model'],qs[_0x6ce6('0x34')](_0x5cd6ae[_0x6ce6('0x32')][_0x6ce6('0x34')]));_0x1005cc['attributes']=_0x1005cc[_0x6ce6('0x35')][_0x6ce6('0x36')]?_0x1005cc[_0x6ce6('0x35')]:_0x233b42[_0x6ce6('0x31')];if(!_0x5cd6ae[_0x6ce6('0x32')][_0x6ce6('0x4f')]('nolimit')){_0x1005cc['limit']=qs[_0x6ce6('0x1e')](_0x5cd6ae['query'][_0x6ce6('0x1e')]);_0x1005cc[_0x6ce6('0x1c')]=qs['offset'](_0x5cd6ae[_0x6ce6('0x32')]['offset']);}_0x1005cc['order']=qs[_0x6ce6('0x38')](_0x5cd6ae[_0x6ce6('0x32')][_0x6ce6('0x38')]);_0x1005cc[_0x6ce6('0x39')]=qs[_0x6ce6('0x3a')](_[_0x6ce6('0x50')](_0x5cd6ae[_0x6ce6('0x32')],_0x233b42[_0x6ce6('0x3a')]));_0x1005cc[_0x6ce6('0x39')][_0x6ce6('0x51')]=_0x3e3079['id'];if(_0x5cd6ae[_0x6ce6('0x32')][_0x6ce6('0x3b')]){_0x1005cc['where']=_[_0x6ce6('0x3c')](_0x1005cc[_0x6ce6('0x39')],{'$or':_[_0x6ce6('0x2e')](_0x1005cc['attributes'],function(_0xfbe3f){var _0x2138df={};_0x2138df[_0xfbe3f]={'$like':'%'+_0x5cd6ae[_0x6ce6('0x32')]['filter']+'%'};return _0x2138df;})});}_0x1005cc=_[_0x6ce6('0x3c')]({},_0x1005cc,_0x5cd6ae['options']);return db['UserWhatsappQueue'][_0x6ce6('0x52')](_0x1005cc);}})['then'](function(_0x419731){if(_0x419731){return db['User'][_0x6ce6('0x53')]({'where':{'id':_['map'](_0x419731,'UserId'),'role':_0x6ce6('0x54')},'attributes':['id',_0x6ce6('0x2b'),'whatsappPause',_0x6ce6('0x55'),_0x6ce6('0x56')]});}})['then'](function(_0x3dd0f5){if(_0x3dd0f5){return{'count':_0x3dd0f5['count'],'rows':_[_0x6ce6('0x2e')](_0x3dd0f5[_0x6ce6('0x41')],function(_0x2c3bed){return{'membername':_0x2c3bed[_0x6ce6('0x2b')],'UserId':_0x2c3bed['id'],'queue_name':_0x9dad58[_0x6ce6('0x2b')],'WhatsappQueueId':_0x9dad58['id'],'interface':util['format'](_0x6ce6('0x57'),_0x6ce6('0x58'),_0x2c3bed[_0x6ce6('0x2b')]),'penalty':0x0,'paused':_0x2c3bed[_0x6ce6('0x59')],'createdAt':_0x2c3bed[_0x6ce6('0x56')],'updatedAt':_0x2c3bed['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ce6('0x25')](respondWithFilteredResult(_0x41c267,_0x1005cc))['catch'](handleError(_0x41c267,null));};exports['getTeams']=function(_0x5bd9a3,_0x50ca53,_0x4c2b65){var _0x456ec6={};var _0xb821f6={};var _0xb3a717;var _0x1e3781;return db['WhatsappQueue'][_0x6ce6('0x4e')]({'where':{'id':_0x5bd9a3['params']['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x50ca53,null))[_0x6ce6('0x25')](function(_0x42c1e0){if(_0x42c1e0){_0xb3a717=_0x42c1e0;_0xb821f6['model']=_[_0x6ce6('0x44')](db[_0x6ce6('0x5a')]['rawAttributes']);_0xb821f6['query']=_[_0x6ce6('0x44')](_0x5bd9a3[_0x6ce6('0x32')]);_0xb821f6[_0x6ce6('0x3a')]=_['intersection'](_0xb821f6[_0x6ce6('0x31')],_0xb821f6[_0x6ce6('0x32')]);_0x456ec6[_0x6ce6('0x35')]=_[_0x6ce6('0x33')](_0xb821f6[_0x6ce6('0x31')],qs[_0x6ce6('0x34')](_0x5bd9a3[_0x6ce6('0x32')]['fields']));_0x456ec6[_0x6ce6('0x35')]=_0x456ec6[_0x6ce6('0x35')][_0x6ce6('0x36')]?_0x456ec6['attributes']:_0xb821f6[_0x6ce6('0x31')];_0x456ec6[_0x6ce6('0x37')]=qs[_0x6ce6('0x38')](_0x5bd9a3[_0x6ce6('0x32')][_0x6ce6('0x38')]);_0x456ec6['where']=qs[_0x6ce6('0x3a')](_[_0x6ce6('0x50')](_0x5bd9a3[_0x6ce6('0x32')],_0xb821f6[_0x6ce6('0x3a')]));if(_0x5bd9a3[_0x6ce6('0x32')][_0x6ce6('0x3b')]){_0x456ec6[_0x6ce6('0x39')]=_['merge'](_0x456ec6[_0x6ce6('0x39')],{'$or':_[_0x6ce6('0x2e')](_0x456ec6[_0x6ce6('0x35')],function(_0x4321ee){var _0x5d978d={};_0x5d978d[_0x4321ee]={'$like':'%'+_0x5bd9a3[_0x6ce6('0x32')][_0x6ce6('0x3b')]+'%'};return _0x5d978d;})});}_0x456ec6=_[_0x6ce6('0x3c')]({},_0x456ec6,_0x5bd9a3['options']);return _0xb3a717[_0x6ce6('0x5b')](_0x456ec6);}})['then'](function(_0x22ec18){if(_0x22ec18){_0x1e3781=_0x22ec18[_0x6ce6('0x36')];if(!_0x5bd9a3['query'][_0x6ce6('0x4f')](_0x6ce6('0x5c'))){_0x456ec6['limit']=qs['limit'](_0x5bd9a3[_0x6ce6('0x32')][_0x6ce6('0x1e')]);_0x456ec6[_0x6ce6('0x1c')]=qs[_0x6ce6('0x1c')](_0x5bd9a3['query'][_0x6ce6('0x1c')]);}return _0xb3a717['getTeams'](_0x456ec6);}})[_0x6ce6('0x25')](function(_0x665de2){if(_0x665de2){return _0x665de2?{'count':_0x1e3781,'rows':_0x665de2}:null;}})[_0x6ce6('0x25')](respondWithResult(_0x50ca53,null))[_0x6ce6('0x42')](handleError(_0x50ca53,null));};exports['addTeams']=function(_0x589a1a,_0x3a07db,_0x35d41e){var _0x327a36=_0x589a1a[_0x6ce6('0x4c')][_0x6ce6('0x5d')];return db['Team'][_0x6ce6('0x52')]({'where':{'id':_0x327a36},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ce6('0x5e'),'attributes':['id','name',_0x6ce6('0x5f'),_0x6ce6('0x60'),_0x6ce6('0x61')],'raw':!![]}]})[_0x6ce6('0x25')](function(_0xfa9a7d){if(_0xfa9a7d){var _0x3ef023=_[_0x6ce6('0x62')](_0xfa9a7d,function(_0x45c081){var _0xdea05d=_0x45c081[_0x6ce6('0x27')]({'plain':!![]});return _0xdea05d[_0x6ce6('0x5e')];});return db[_0x6ce6('0x3f')][_0x6ce6('0x46')]({'where':{'id':_0x589a1a['params']['id']}})['then'](function(_0x4db4bf){return db['sequelize'][_0x6ce6('0x63')](function(_0x30f249){return _0x4db4bf[_0x6ce6('0x64')](_0x327a36,{'transaction':_0x30f249})['then'](function(){return BPromise[_0x6ce6('0x65')](_0x3ef023,function(_0x14b336){return db[_0x6ce6('0x66')]['findOrCreate']({'where':{'UserId':_0x14b336['id'],'WhatsappQueueId':_0x589a1a[_0x6ce6('0x43')]['id']},'transaction':_0x30f249});});})[_0x6ce6('0x25')](function(){_0x3ef023['forEach'](function(_0x58e4b3){socket[_0x6ce6('0x67')](_0x6ce6('0x68'),{'UserId':_0x58e4b3['id'],'WhatsappQueueId':_0x4db4bf['id']});});});});});}})['then'](respondWithStatusCode(_0x3a07db,null))['catch'](handleError(_0x3a07db,null));};exports['removeTeams']=function(_0x9472de,_0x2a2e4b,_0xf6894f){return db[_0x6ce6('0x5a')][_0x6ce6('0x52')]({'where':{'id':_0x9472de['query'][_0x6ce6('0x5d')]},'attributes':['id'],'include':[{'model':db[_0x6ce6('0x69')],'as':_0x6ce6('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2a2e4b,null))['then'](function(_0x445c31){var _0x167d46=_['map'](_0x445c31,'id');var _0x1c7987=[];var _0x69e2cd=[];var _0x389d03=squel[_0x6ce6('0x6a')]();_0x389d03[_0x6ce6('0x6b')](_0x6ce6('0x6c'))['from'](_0x6ce6('0x6d'),'tq')[_0x6ce6('0x6e')]('user_has_teams','ut',_0x6ce6('0x6f'))[_0x6ce6('0x39')](_0x6ce6('0x70'),_0x9472de[_0x6ce6('0x43')]['id']);for(var _0x365857=0x0;_0x365857<_0x445c31['length'];_0x365857+=0x1){let _0x23c306=_0x445c31[_0x365857];for(var _0x3dc0fa=0x0;_0x3dc0fa<_0x23c306['Agents'][_0x6ce6('0x36')];_0x3dc0fa+=0x1){let _0x238809=_0x23c306['Agents'][_0x3dc0fa];var _0x59325d=_0x389d03[_0x6ce6('0x71')]();_0x59325d[_0x6ce6('0x39')]('ut.UserId\x20=\x20?',_0x238809['id']);_0x69e2cd[_0x6ce6('0x72')](db[_0x6ce6('0x73')][_0x6ce6('0x32')](_0x59325d[_0x6ce6('0x74')](),{'type':db[_0x6ce6('0x73')]['QueryTypes']['SELECT']})['then'](function(_0x52f119){if(_0x52f119['length']===0x1){return _0x238809['id'];}else{var _0x1205b1=_[_0x6ce6('0x75')](_[_0x6ce6('0x2e')](_0x52f119,_0x6ce6('0x76')),function(_0x434f5f){return _[_0x6ce6('0x77')](_0x167d46,_0x434f5f);});if(_0x1205b1){return _0x238809['id'];}}}));}}return BPromise['all'](_0x69e2cd)[_0x6ce6('0x25')](function(_0x4e3e04){_0x1c7987=_(_0x1c7987)['union'](_0x4e3e04)[_0x6ce6('0x78')]()[_0x6ce6('0x79')]();return db[_0x6ce6('0x3f')]['find']({'where':{'id':_0x9472de[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](function(_0x541676){return db['sequelize']['transaction'](function(_0x584215){return _0x541676[_0x6ce6('0x7a')](_0x9472de[_0x6ce6('0x32')]['ids'],{'transaction':_0x584215})[_0x6ce6('0x25')](function(){if(!_[_0x6ce6('0x7b')](_0x1c7987)){return _0x541676['removeAgents'](_0x1c7987,{'transaction':_0x584215});}})[_0x6ce6('0x25')](function(){_0x1c7987[_0x6ce6('0x7c')](function(_0xb26ed1){socket['emit'](_0x6ce6('0x7d'),{'UserId':_0xb26ed1,'WhatsappQueueId':_0x541676['id']});});});});});});})[_0x6ce6('0x25')](respondWithStatusCode(_0x2a2e4b,null))['catch'](handleError(_0x2a2e4b,null));};exports[_0x6ce6('0x7e')]=function(_0x5c486b,_0x22130b,_0x415cc4){return db[_0x6ce6('0x3f')]['find']({'where':{'id':_0x5c486b[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x22130b,null))[_0x6ce6('0x25')](function(_0x2e7ed2){if(_0x2e7ed2){return _0x2e7ed2[_0x6ce6('0x7e')](_0x5c486b[_0x6ce6('0x4c')][_0x6ce6('0x5d')],_[_0x6ce6('0x7f')](_0x5c486b['body'],[_0x6ce6('0x5d'),'id'])||{})[_0x6ce6('0x80')](function(_0x41a460){for(var _0x8da6f=0x0;_0x8da6f<_0x5c486b[_0x6ce6('0x4c')][_0x6ce6('0x5d')][_0x6ce6('0x36')];_0x8da6f+=0x1){socket['emit'](_0x6ce6('0x68'),{'UserId':Number(_0x5c486b[_0x6ce6('0x4c')]['ids'][_0x8da6f]),'WhatsappQueueId':Number(_0x5c486b['params']['id'])});}return _0x41a460;});}})[_0x6ce6('0x25')](respondWithResult(_0x22130b,null))[_0x6ce6('0x42')](handleError(_0x22130b,null));};exports['removeAgents']=function(_0x148e88,_0x225dd8,_0x2a6dda){return db[_0x6ce6('0x3f')][_0x6ce6('0x46')]({'where':{'id':_0x148e88[_0x6ce6('0x43')]['id']}})['then'](handleEntityNotFound(_0x225dd8,null))[_0x6ce6('0x25')](function(_0x318049){if(_0x318049){return _0x318049['removeAgents'](_0x148e88[_0x6ce6('0x32')][_0x6ce6('0x5d')])[_0x6ce6('0x25')](function(){if(_[_0x6ce6('0x81')](_0x148e88['query'][_0x6ce6('0x5d')])){for(var _0x2325a9=0x0;_0x2325a9<_0x148e88[_0x6ce6('0x32')][_0x6ce6('0x5d')][_0x6ce6('0x36')];_0x2325a9+=0x1){socket['emit'](_0x6ce6('0x7d'),{'UserId':Number(_0x148e88[_0x6ce6('0x32')]['ids'][_0x2325a9]),'WhatsappQueueId':Number(_0x148e88[_0x6ce6('0x43')]['id'])});}}else{socket['emit'](_0x6ce6('0x7d'),{'UserId':Number(_0x148e88['query'][_0x6ce6('0x5d')]),'WhatsappQueueId':Number(_0x148e88[_0x6ce6('0x43')]['id'])});}});}})[_0x6ce6('0x25')](respondWithStatusCode(_0x225dd8,null))[_0x6ce6('0x42')](handleError(_0x225dd8,null));};exports[_0x6ce6('0x82')]=function(_0x43a77b,_0x34c51b,_0x1a5fbd){var _0x2d17c0={};var _0x19a18a={};var _0xd157b;var _0x453239;return db[_0x6ce6('0x3f')][_0x6ce6('0x4e')]({'where':{'id':_0x43a77b[_0x6ce6('0x43')]['id']}})[_0x6ce6('0x25')](handleEntityNotFound(_0x34c51b,null))[_0x6ce6('0x25')](function(_0x181907){if(_0x181907){_0xd157b=_0x181907;_0x19a18a[_0x6ce6('0x31')]=_[_0x6ce6('0x44')](db[_0x6ce6('0x69')][_0x6ce6('0x2f')]);_0x19a18a[_0x6ce6('0x32')]=_[_0x6ce6('0x44')](_0x43a77b[_0x6ce6('0x32')]);_0x19a18a[_0x6ce6('0x3a')]=_[_0x6ce6('0x33')](_0x19a18a[_0x6ce6('0x31')],_0x19a18a['query']);_0x2d17c0[_0x6ce6('0x35')]=_[_0x6ce6('0x33')](_0x19a18a['model'],qs[_0x6ce6('0x34')](_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x34')]));_0x2d17c0[_0x6ce6('0x35')]=_0x2d17c0[_0x6ce6('0x35')]['length']?_0x2d17c0['attributes']:_0x19a18a[_0x6ce6('0x31')];_0x2d17c0['order']=qs['sort'](_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x38')]);_0x2d17c0[_0x6ce6('0x39')]=qs[_0x6ce6('0x3a')](_[_0x6ce6('0x50')](_0x43a77b[_0x6ce6('0x32')],_0x19a18a['filters']));if(_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x3b')]){_0x2d17c0[_0x6ce6('0x39')]=_[_0x6ce6('0x3c')](_0x2d17c0[_0x6ce6('0x39')],{'$or':_['map'](_0x2d17c0[_0x6ce6('0x35')],function(_0x463aca){var _0x4a189a={};_0x4a189a[_0x463aca]={'$like':'%'+_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x3b')]+'%'};return _0x4a189a;})});}_0x2d17c0=_[_0x6ce6('0x3c')]({},_0x2d17c0,_0x43a77b[_0x6ce6('0x3e')]);return _0xd157b[_0x6ce6('0x82')](_0x2d17c0);}})[_0x6ce6('0x25')](function(_0x381cc7){if(_0x381cc7){_0x453239=_0x381cc7[_0x6ce6('0x36')];if(!_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x4f')](_0x6ce6('0x5c'))){_0x2d17c0[_0x6ce6('0x1e')]=qs['limit'](_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x1e')]);_0x2d17c0[_0x6ce6('0x1c')]=qs[_0x6ce6('0x1c')](_0x43a77b[_0x6ce6('0x32')][_0x6ce6('0x1c')]);}return _0xd157b['getAgents'](_0x2d17c0);}})[_0x6ce6('0x25')](function(_0x1f74e9){if(_0x1f74e9){return _0x1f74e9?{'count':_0x453239,'rows':_0x1f74e9}:null;}})[_0x6ce6('0x25')](respondWithResult(_0x34c51b,null))[_0x6ce6('0x42')](handleError(_0x34c51b,null));}; \ No newline at end of file +var _0xd663=['../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappQueue','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','user','get','role','WhatsappQueues','userProfileId','autoAssociation','UserProfileResource','create','body','params','describe','getMembers','WhatsappQueueId','User','UserId','format','SIP','whatsappPause','createdAt','getTeams','Team','addTeams','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','Agents','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x5a5410,_0xdde8bd){var _0x337733=function(_0x4ced6e){while(--_0x4ced6e){_0x5a5410['push'](_0x5a5410['shift']());}};_0x337733(++_0xdde8bd);}(_0xd663,0x78));var _0x3d66=function(_0x23f7aa,_0x301ae6){_0x23f7aa=_0x23f7aa-0x0;var _0xf65375=_0xd663[_0x23f7aa];return _0xf65375;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require(_0x3d66('0x2'));var jsonpatch=require(_0x3d66('0x3'));var rp=require(_0x3d66('0x4'));var moment=require(_0x3d66('0x5'));var BPromise=require(_0x3d66('0x6'));var Mustache=require(_0x3d66('0x7'));var util=require(_0x3d66('0x8'));var path=require('path');var sox=require(_0x3d66('0x9'));var csv=require(_0x3d66('0xa'));var ejs=require(_0x3d66('0xb'));var fs=require('fs');var fs_extra=require(_0x3d66('0xc'));var _=require(_0x3d66('0xd'));var squel=require('squel');var crypto=require(_0x3d66('0xe'));var jsforce=require(_0x3d66('0xf'));var deskjs=require(_0x3d66('0x10'));var toCsv=require(_0x3d66('0xa'));var querystring=require(_0x3d66('0x11'));var Papa=require(_0x3d66('0x12'));var Redis=require('ioredis');var authService=require(_0x3d66('0x13'));var qs=require(_0x3d66('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d66('0x15'))(_0x3d66('0x16'));var utils=require(_0x3d66('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3d66('0x18')]=_[_0x3d66('0x19')](config[_0x3d66('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d66('0x1a'))(new Redis(config['redis']));require(_0x3d66('0x1b'))[_0x3d66('0x1c')](socket);function respondWithStatusCode(_0x5a0a0c,_0x343124){_0x343124=_0x343124||0xcc;return function(_0x4f911d){if(_0x4f911d){return _0x5a0a0c[_0x3d66('0x1d')](_0x343124);}return _0x5a0a0c[_0x3d66('0x1e')](_0x343124)[_0x3d66('0x1f')]();};}function respondWithResult(_0x42e8fe,_0x4b8cd8){_0x4b8cd8=_0x4b8cd8||0xc8;return function(_0x378445){if(_0x378445){return _0x42e8fe[_0x3d66('0x1e')](_0x4b8cd8)[_0x3d66('0x20')](_0x378445);}};}function respondWithFilteredResult(_0x58c7e8,_0x599406){return function(_0x364bf8){if(_0x364bf8){var _0x32100a=typeof _0x599406[_0x3d66('0x21')]===_0x3d66('0x22')&&typeof _0x599406[_0x3d66('0x23')]===_0x3d66('0x22');var _0x1e296e=_0x364bf8[_0x3d66('0x24')];var _0x3c4bd8=_0x32100a?0x0:_0x599406[_0x3d66('0x21')];var _0x227892=_0x32100a?_0x364bf8[_0x3d66('0x24')]:_0x599406[_0x3d66('0x21')]+_0x599406[_0x3d66('0x23')];var _0x4838a1;if(_0x227892>=_0x1e296e){_0x227892=_0x1e296e;_0x4838a1=0xc8;}else{_0x4838a1=0xce;}_0x58c7e8[_0x3d66('0x1e')](_0x4838a1);return _0x58c7e8[_0x3d66('0x25')]('Content-Range',_0x3c4bd8+'-'+_0x227892+'/'+_0x1e296e)['json'](_0x364bf8);}return null;};}function patchUpdates(_0x204056){return function(_0x134453){try{jsonpatch[_0x3d66('0x26')](_0x134453,_0x204056,!![]);}catch(_0x14e317){return BPromise[_0x3d66('0x27')](_0x14e317);}return _0x134453['save']();};}function saveUpdates(_0x5c57dc,_0x52cf36){return function(_0x2d1f51){if(_0x2d1f51){return _0x2d1f51[_0x3d66('0x28')](_0x5c57dc)[_0x3d66('0x29')](function(_0x2a8a24){return _0x2a8a24;});}return null;};}function removeEntity(_0x2c63c6,_0x152574){return function(_0x247768){if(_0x247768){return _0x247768[_0x3d66('0x2a')]()[_0x3d66('0x29')](function(){var _0xad54eb=_0x247768['get']({'plain':!![]});var _0x1c1fa4='WhatsappQueues';return db['UserProfileResource'][_0x3d66('0x2a')]({'where':{'type':_0x1c1fa4,'resourceId':_0xad54eb['id']}})['then'](function(){return _0x247768;});})['then'](function(){_0x2c63c6['status'](0xcc)[_0x3d66('0x1f')]();});}};}function handleEntityNotFound(_0x2d80ef,_0x45a415){return function(_0x5c319f){if(!_0x5c319f){_0x2d80ef['sendStatus'](0x194);}return _0x5c319f;};}function handleError(_0x4ee1c7,_0x9534e3){_0x9534e3=_0x9534e3||0x1f4;return function(_0x4399cb){logger[_0x3d66('0x2b')](_0x4399cb[_0x3d66('0x2c')]);if(_0x4399cb[_0x3d66('0x2d')]){delete _0x4399cb['name'];}_0x4ee1c7[_0x3d66('0x1e')](_0x9534e3)[_0x3d66('0x2e')](_0x4399cb);};}exports[_0x3d66('0x2f')]=function(_0x13c89b,_0x5f0749){var _0x3a313b={},_0xc0c435={},_0x1f93a4={'count':0x0,'rows':[]};var _0x3d096f=_[_0x3d66('0x30')](db[_0x3d66('0x31')]['rawAttributes'],function(_0x58e503){return{'name':_0x58e503['fieldName'],'type':_0x58e503[_0x3d66('0x32')][_0x3d66('0x33')]};});_0xc0c435[_0x3d66('0x34')]=_[_0x3d66('0x30')](_0x3d096f,'name');_0xc0c435['query']=_[_0x3d66('0x35')](_0x13c89b[_0x3d66('0x36')]);_0xc0c435[_0x3d66('0x37')]=_[_0x3d66('0x38')](_0xc0c435[_0x3d66('0x34')],_0xc0c435['query']);_0x3a313b[_0x3d66('0x39')]=_[_0x3d66('0x38')](_0xc0c435[_0x3d66('0x34')],qs[_0x3d66('0x3a')](_0x13c89b[_0x3d66('0x36')]['fields']));_0x3a313b[_0x3d66('0x39')]=_0x3a313b['attributes'][_0x3d66('0x3b')]?_0x3a313b['attributes']:_0xc0c435[_0x3d66('0x34')];if(!_0x13c89b[_0x3d66('0x36')][_0x3d66('0x3c')](_0x3d66('0x3d'))){_0x3a313b[_0x3d66('0x23')]=qs['limit'](_0x13c89b[_0x3d66('0x36')][_0x3d66('0x23')]);_0x3a313b[_0x3d66('0x21')]=qs[_0x3d66('0x21')](_0x13c89b['query']['offset']);}_0x3a313b[_0x3d66('0x3e')]=qs[_0x3d66('0x3f')](_0x13c89b[_0x3d66('0x36')]['sort']);_0x3a313b[_0x3d66('0x40')]=qs[_0x3d66('0x37')](_[_0x3d66('0x41')](_0x13c89b[_0x3d66('0x36')],_0xc0c435[_0x3d66('0x37')]),_0x3d096f);if(_0x13c89b['query'][_0x3d66('0x42')]){_0x3a313b['where']=_[_0x3d66('0x43')](_0x3a313b['where'],{'$or':_[_0x3d66('0x30')](_0x3d096f,function(_0xac9d29){if(_0xac9d29[_0x3d66('0x32')]!==_0x3d66('0x44')){var _0x258c1e={};_0x258c1e[_0xac9d29[_0x3d66('0x2d')]]={'$like':'%'+_0x13c89b[_0x3d66('0x36')][_0x3d66('0x42')]+'%'};return _0x258c1e;}})});}_0x3a313b=_[_0x3d66('0x43')]({},_0x3a313b,_0x13c89b[_0x3d66('0x45')]);var _0x42685e={'where':_0x3a313b[_0x3d66('0x40')]};return db[_0x3d66('0x31')]['count'](_0x42685e)['then'](function(_0x1e2019){_0x1f93a4[_0x3d66('0x24')]=_0x1e2019;if(_0x13c89b[_0x3d66('0x36')][_0x3d66('0x46')]){_0x3a313b['include']=[{'all':!![]}];}return db[_0x3d66('0x31')][_0x3d66('0x47')](_0x3a313b);})[_0x3d66('0x29')](function(_0x198f76){_0x1f93a4[_0x3d66('0x48')]=_0x198f76;return _0x1f93a4;})['then'](respondWithFilteredResult(_0x5f0749,_0x3a313b))[_0x3d66('0x49')](handleError(_0x5f0749,null));};exports[_0x3d66('0x4a')]=function(_0x51bfd2,_0x40f9c9){var _0x5ec13f={'raw':!![],'where':{'id':_0x51bfd2['params']['id']}},_0x3248eb={};_0x3248eb['model']=_['keys'](db[_0x3d66('0x31')][_0x3d66('0x4b')]);_0x3248eb[_0x3d66('0x36')]=_['keys'](_0x51bfd2[_0x3d66('0x36')]);_0x3248eb['filters']=_[_0x3d66('0x38')](_0x3248eb['model'],_0x3248eb[_0x3d66('0x36')]);_0x5ec13f[_0x3d66('0x39')]=_[_0x3d66('0x38')](_0x3248eb[_0x3d66('0x34')],qs[_0x3d66('0x3a')](_0x51bfd2[_0x3d66('0x36')][_0x3d66('0x3a')]));_0x5ec13f[_0x3d66('0x39')]=_0x5ec13f[_0x3d66('0x39')][_0x3d66('0x3b')]?_0x5ec13f[_0x3d66('0x39')]:_0x3248eb[_0x3d66('0x34')];if(_0x51bfd2['query'][_0x3d66('0x46')]){_0x5ec13f[_0x3d66('0x4c')]=[{'all':!![]}];}_0x5ec13f=_['merge']({},_0x5ec13f,_0x51bfd2[_0x3d66('0x45')]);return db[_0x3d66('0x31')][_0x3d66('0x4d')](_0x5ec13f)[_0x3d66('0x29')](handleEntityNotFound(_0x40f9c9,null))['then'](respondWithResult(_0x40f9c9,null))[_0x3d66('0x49')](handleError(_0x40f9c9,null));};exports['create']=function(_0x3bb3bd,_0x57630d){return db['WhatsappQueue']['create'](_0x3bb3bd['body'],{})[_0x3d66('0x29')](function(_0x2bad84){var _0x6b52b7=_0x3bb3bd[_0x3d66('0x4e')][_0x3d66('0x4f')]({'plain':!![]});if(!_0x6b52b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b52b7[_0x3d66('0x50')]===_0x3d66('0x4e')){var _0x5a07b2=_0x2bad84[_0x3d66('0x4f')]({'plain':!![]});var _0x490ced=_0x3d66('0x51');return db['UserProfileSection'][_0x3d66('0x4d')]({'where':{'name':_0x490ced,'userProfileId':_0x6b52b7[_0x3d66('0x52')]},'raw':!![]})[_0x3d66('0x29')](function(_0x43016a){if(_0x43016a&&_0x43016a[_0x3d66('0x53')]===0x0){return db[_0x3d66('0x54')][_0x3d66('0x55')]({'name':_0x5a07b2[_0x3d66('0x2d')],'resourceId':_0x5a07b2['id'],'type':_0x43016a[_0x3d66('0x2d')],'sectionId':_0x43016a['id']},{})[_0x3d66('0x29')](function(){return _0x2bad84;});}else{return _0x2bad84;}})['catch'](function(_0x757752){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x757752);throw _0x757752;});}return _0x2bad84;})[_0x3d66('0x29')](respondWithResult(_0x57630d,0xc9))['catch'](handleError(_0x57630d,null));};exports['update']=function(_0x9b5d6d,_0x468963){if(_0x9b5d6d['body']['id']){delete _0x9b5d6d[_0x3d66('0x56')]['id'];}return db[_0x3d66('0x31')][_0x3d66('0x4d')]({'where':{'id':_0x9b5d6d[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x468963,null))[_0x3d66('0x29')](saveUpdates(_0x9b5d6d[_0x3d66('0x56')],null))[_0x3d66('0x29')](respondWithResult(_0x468963,null))['catch'](handleError(_0x468963,null));};exports[_0x3d66('0x2a')]=function(_0x729933,_0x2e777d){return db['WhatsappQueue'][_0x3d66('0x4d')]({'where':{'id':_0x729933[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x2e777d,null))[_0x3d66('0x29')](removeEntity(_0x2e777d,null))[_0x3d66('0x49')](handleError(_0x2e777d,null));};exports[_0x3d66('0x58')]=function(_0x398650,_0x5be34f){return db['WhatsappQueue'][_0x3d66('0x58')]()[_0x3d66('0x29')](respondWithResult(_0x5be34f,null))[_0x3d66('0x49')](handleError(_0x5be34f,null));};exports[_0x3d66('0x59')]=function(_0x2d806d,_0x3f0509,_0x2b5d7f){var _0x21073d={'raw':!![],'where':{}},_0x57f3f2={},_0x364fec;return db[_0x3d66('0x31')]['findOne']({'where':{'id':_0x2d806d[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x3f0509,null))['then'](function(_0x24ba02){if(_0x24ba02){_0x364fec=_0x24ba02[_0x3d66('0x4f')]({'plain':!![]});_0x57f3f2[_0x3d66('0x34')]=_[_0x3d66('0x35')](db['UserWhatsappQueue'][_0x3d66('0x4b')]);_0x57f3f2['query']=_[_0x3d66('0x35')](_0x2d806d[_0x3d66('0x36')]);_0x57f3f2['filters']=_[_0x3d66('0x38')](_0x57f3f2[_0x3d66('0x34')],_0x57f3f2[_0x3d66('0x36')]);_0x21073d[_0x3d66('0x39')]=_['intersection'](_0x57f3f2[_0x3d66('0x34')],qs[_0x3d66('0x3a')](_0x2d806d['query'][_0x3d66('0x3a')]));_0x21073d['attributes']=_0x21073d['attributes'][_0x3d66('0x3b')]?_0x21073d[_0x3d66('0x39')]:_0x57f3f2[_0x3d66('0x34')];if(!_0x2d806d['query']['hasOwnProperty'](_0x3d66('0x3d'))){_0x21073d[_0x3d66('0x23')]=qs[_0x3d66('0x23')](_0x2d806d['query'][_0x3d66('0x23')]);_0x21073d[_0x3d66('0x21')]=qs[_0x3d66('0x21')](_0x2d806d['query'][_0x3d66('0x21')]);}_0x21073d['order']=qs['sort'](_0x2d806d[_0x3d66('0x36')][_0x3d66('0x3f')]);_0x21073d[_0x3d66('0x40')]=qs[_0x3d66('0x37')](_['pick'](_0x2d806d[_0x3d66('0x36')],_0x57f3f2[_0x3d66('0x37')]));_0x21073d[_0x3d66('0x40')][_0x3d66('0x5a')]=_0x24ba02['id'];if(_0x2d806d[_0x3d66('0x36')][_0x3d66('0x42')]){_0x21073d[_0x3d66('0x40')]=_[_0x3d66('0x43')](_0x21073d[_0x3d66('0x40')],{'$or':_[_0x3d66('0x30')](_0x21073d[_0x3d66('0x39')],function(_0x2869e8){var _0x4c8bb4={};_0x4c8bb4[_0x2869e8]={'$like':'%'+_0x2d806d[_0x3d66('0x36')][_0x3d66('0x42')]+'%'};return _0x4c8bb4;})});}_0x21073d=_['merge']({},_0x21073d,_0x2d806d[_0x3d66('0x45')]);return db['UserWhatsappQueue'][_0x3d66('0x47')](_0x21073d);}})[_0x3d66('0x29')](function(_0x35a549){if(_0x35a549){return db[_0x3d66('0x5b')]['findAndCountAll']({'where':{'id':_[_0x3d66('0x30')](_0x35a549,_0x3d66('0x5c')),'role':'agent'},'attributes':['id','name','whatsappPause','updatedAt','createdAt']});}})['then'](function(_0x1b1b1f){if(_0x1b1b1f){return{'count':_0x1b1b1f['count'],'rows':_[_0x3d66('0x30')](_0x1b1b1f[_0x3d66('0x48')],function(_0x38c409){return{'membername':_0x38c409['name'],'UserId':_0x38c409['id'],'queue_name':_0x364fec[_0x3d66('0x2d')],'WhatsappQueueId':_0x364fec['id'],'interface':util[_0x3d66('0x5d')]('%s/%s',_0x3d66('0x5e'),_0x38c409['name']),'penalty':0x0,'paused':_0x38c409[_0x3d66('0x5f')],'createdAt':_0x38c409[_0x3d66('0x60')],'updatedAt':_0x38c409['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3d66('0x29')](respondWithFilteredResult(_0x3f0509,_0x21073d))[_0x3d66('0x49')](handleError(_0x3f0509,null));};exports[_0x3d66('0x61')]=function(_0x1074ee,_0x116a4a,_0x1e5dab){var _0x40dfa0={};var _0x21e9d4={};var _0x1fd9af;var _0x1ee73c;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1074ee[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x116a4a,null))[_0x3d66('0x29')](function(_0x54e785){if(_0x54e785){_0x1fd9af=_0x54e785;_0x21e9d4[_0x3d66('0x34')]=_[_0x3d66('0x35')](db[_0x3d66('0x62')][_0x3d66('0x4b')]);_0x21e9d4['query']=_[_0x3d66('0x35')](_0x1074ee[_0x3d66('0x36')]);_0x21e9d4['filters']=_[_0x3d66('0x38')](_0x21e9d4[_0x3d66('0x34')],_0x21e9d4[_0x3d66('0x36')]);_0x40dfa0[_0x3d66('0x39')]=_[_0x3d66('0x38')](_0x21e9d4[_0x3d66('0x34')],qs[_0x3d66('0x3a')](_0x1074ee['query'][_0x3d66('0x3a')]));_0x40dfa0[_0x3d66('0x39')]=_0x40dfa0[_0x3d66('0x39')][_0x3d66('0x3b')]?_0x40dfa0[_0x3d66('0x39')]:_0x21e9d4[_0x3d66('0x34')];_0x40dfa0[_0x3d66('0x3e')]=qs['sort'](_0x1074ee[_0x3d66('0x36')][_0x3d66('0x3f')]);_0x40dfa0[_0x3d66('0x40')]=qs[_0x3d66('0x37')](_[_0x3d66('0x41')](_0x1074ee[_0x3d66('0x36')],_0x21e9d4['filters']));if(_0x1074ee[_0x3d66('0x36')][_0x3d66('0x42')]){_0x40dfa0['where']=_[_0x3d66('0x43')](_0x40dfa0['where'],{'$or':_[_0x3d66('0x30')](_0x40dfa0[_0x3d66('0x39')],function(_0x14628b){var _0xb7fe35={};_0xb7fe35[_0x14628b]={'$like':'%'+_0x1074ee[_0x3d66('0x36')][_0x3d66('0x42')]+'%'};return _0xb7fe35;})});}_0x40dfa0=_['merge']({},_0x40dfa0,_0x1074ee[_0x3d66('0x45')]);return _0x1fd9af['getTeams'](_0x40dfa0);}})[_0x3d66('0x29')](function(_0x2abe79){if(_0x2abe79){_0x1ee73c=_0x2abe79[_0x3d66('0x3b')];if(!_0x1074ee[_0x3d66('0x36')]['hasOwnProperty']('nolimit')){_0x40dfa0['limit']=qs[_0x3d66('0x23')](_0x1074ee[_0x3d66('0x36')][_0x3d66('0x23')]);_0x40dfa0[_0x3d66('0x21')]=qs[_0x3d66('0x21')](_0x1074ee[_0x3d66('0x36')][_0x3d66('0x21')]);}return _0x1fd9af[_0x3d66('0x61')](_0x40dfa0);}})[_0x3d66('0x29')](function(_0x4f05ba){if(_0x4f05ba){return _0x4f05ba?{'count':_0x1ee73c,'rows':_0x4f05ba}:null;}})[_0x3d66('0x29')](respondWithResult(_0x116a4a,null))[_0x3d66('0x49')](handleError(_0x116a4a,null));};exports[_0x3d66('0x63')]=function(_0x3be2c0,_0x1296cb,_0x1179be){var _0xe9fc6a=_0x3be2c0[_0x3d66('0x56')]['ids'];return db[_0x3d66('0x62')]['findAll']({'where':{'id':_0xe9fc6a},'attributes':['id'],'include':[{'model':db[_0x3d66('0x5b')],'as':'Agents','attributes':['id',_0x3d66('0x2d'),_0x3d66('0x64'),_0x3d66('0x65'),_0x3d66('0x66')],'raw':!![]}]})[_0x3d66('0x29')](function(_0x19dff8){if(_0x19dff8){var _0x53698e=_[_0x3d66('0x67')](_0x19dff8,function(_0x4127a0){var _0x164182=_0x4127a0['get']({'plain':!![]});return _0x164182['Agents'];});return db[_0x3d66('0x31')]['find']({'where':{'id':_0x3be2c0[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](function(_0x53f336){return db[_0x3d66('0x68')][_0x3d66('0x69')](function(_0x3f4cb9){return _0x53f336[_0x3d66('0x63')](_0xe9fc6a,{'transaction':_0x3f4cb9})[_0x3d66('0x29')](function(){return BPromise['each'](_0x53698e,function(_0x15a1a5){return db['UserWhatsappQueue'][_0x3d66('0x6a')]({'where':{'UserId':_0x15a1a5['id'],'WhatsappQueueId':_0x3be2c0[_0x3d66('0x57')]['id']},'transaction':_0x3f4cb9});});})['then'](function(){_0x53698e[_0x3d66('0x6b')](function(_0x2823b8){socket[_0x3d66('0x6c')](_0x3d66('0x6d'),{'UserId':_0x2823b8['id'],'WhatsappQueueId':_0x53f336['id']});});});});});}})[_0x3d66('0x29')](respondWithStatusCode(_0x1296cb,null))[_0x3d66('0x49')](handleError(_0x1296cb,null));};exports[_0x3d66('0x6e')]=function(_0x20736c,_0x11f957,_0x266d1c){return db[_0x3d66('0x62')]['findAll']({'where':{'id':_0x20736c[_0x3d66('0x36')][_0x3d66('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x3d66('0x5b')],'as':_0x3d66('0x70'),'attributes':['id'],'raw':!![]}]})[_0x3d66('0x29')](handleEntityNotFound(_0x11f957,null))[_0x3d66('0x29')](function(_0x16ea8b){var _0x1be2f8=_[_0x3d66('0x30')](_0x16ea8b,'id');var _0x1a0730=[];var _0x5f32ca=[];var _0x4fc404=squel['select']();_0x4fc404[_0x3d66('0x71')](_0x3d66('0x72'))['from'](_0x3d66('0x73'),'tq')[_0x3d66('0x74')](_0x3d66('0x75'),'ut',_0x3d66('0x76'))['where'](_0x3d66('0x77'),_0x20736c['params']['id']);for(var _0x5a3b85=0x0;_0x5a3b85<_0x16ea8b[_0x3d66('0x3b')];_0x5a3b85+=0x1){let _0x1317f7=_0x16ea8b[_0x5a3b85];for(var _0x522ce5=0x0;_0x522ce5<_0x1317f7[_0x3d66('0x70')][_0x3d66('0x3b')];_0x522ce5+=0x1){let _0x61a66e=_0x1317f7['Agents'][_0x522ce5];var _0x2bbb11=_0x4fc404[_0x3d66('0x78')]();_0x2bbb11[_0x3d66('0x40')](_0x3d66('0x79'),_0x61a66e['id']);_0x5f32ca[_0x3d66('0x7a')](db[_0x3d66('0x68')][_0x3d66('0x36')](_0x2bbb11[_0x3d66('0x7b')](),{'type':db[_0x3d66('0x68')][_0x3d66('0x7c')][_0x3d66('0x7d')]})[_0x3d66('0x29')](function(_0x3883f9){if(_0x3883f9[_0x3d66('0x3b')]===0x1){return _0x61a66e['id'];}else{var _0x187d4e=_[_0x3d66('0x7e')](_[_0x3d66('0x30')](_0x3883f9,_0x3d66('0x7f')),function(_0x4f1a22){return _[_0x3d66('0x80')](_0x1be2f8,_0x4f1a22);});if(_0x187d4e){return _0x61a66e['id'];}}}));}}return BPromise[_0x3d66('0x81')](_0x5f32ca)['then'](function(_0xe9a593){_0x1a0730=_(_0x1a0730)[_0x3d66('0x82')](_0xe9a593)[_0x3d66('0x83')]()[_0x3d66('0x84')]();return db[_0x3d66('0x31')][_0x3d66('0x4d')]({'where':{'id':_0x20736c[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](function(_0x58431b){return db['sequelize'][_0x3d66('0x69')](function(_0x47c5a3){return _0x58431b['removeTeams'](_0x20736c[_0x3d66('0x36')][_0x3d66('0x6f')],{'transaction':_0x47c5a3})['then'](function(){if(!_['isEmpty'](_0x1a0730)){return _0x58431b[_0x3d66('0x85')](_0x1a0730,{'transaction':_0x47c5a3});}})[_0x3d66('0x29')](function(){_0x1a0730['forEach'](function(_0x5c1c4f){socket[_0x3d66('0x6c')](_0x3d66('0x86'),{'UserId':_0x5c1c4f,'WhatsappQueueId':_0x58431b['id']});});});});});});})[_0x3d66('0x29')](respondWithStatusCode(_0x11f957,null))[_0x3d66('0x49')](handleError(_0x11f957,null));};exports[_0x3d66('0x87')]=function(_0x2c8965,_0xf33171,_0x2bf784){return db[_0x3d66('0x31')][_0x3d66('0x4d')]({'where':{'id':_0x2c8965[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0xf33171,null))['then'](function(_0x5df3ba){if(_0x5df3ba){return _0x5df3ba[_0x3d66('0x87')](_0x2c8965[_0x3d66('0x56')]['ids'],_['omit'](_0x2c8965[_0x3d66('0x56')],[_0x3d66('0x6f'),'id'])||{})[_0x3d66('0x88')](function(_0x2875e7){for(var _0x291103=0x0;_0x291103<_0x2c8965[_0x3d66('0x56')]['ids'][_0x3d66('0x3b')];_0x291103+=0x1){socket[_0x3d66('0x6c')]('userWhatsappQueue:save',{'UserId':Number(_0x2c8965['body'][_0x3d66('0x6f')][_0x291103]),'WhatsappQueueId':Number(_0x2c8965[_0x3d66('0x57')]['id'])});}return _0x2875e7;});}})[_0x3d66('0x29')](respondWithResult(_0xf33171,null))[_0x3d66('0x49')](handleError(_0xf33171,null));};exports[_0x3d66('0x85')]=function(_0x971a88,_0x534954,_0x3002a6){return db[_0x3d66('0x31')][_0x3d66('0x4d')]({'where':{'id':_0x971a88[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x534954,null))[_0x3d66('0x29')](function(_0x2ce8e9){if(_0x2ce8e9){return _0x2ce8e9[_0x3d66('0x85')](_0x971a88[_0x3d66('0x36')][_0x3d66('0x6f')])[_0x3d66('0x29')](function(){if(_[_0x3d66('0x89')](_0x971a88[_0x3d66('0x36')][_0x3d66('0x6f')])){for(var _0x3cbf4a=0x0;_0x3cbf4a<_0x971a88[_0x3d66('0x36')][_0x3d66('0x6f')][_0x3d66('0x3b')];_0x3cbf4a+=0x1){socket[_0x3d66('0x6c')](_0x3d66('0x86'),{'UserId':Number(_0x971a88['query'][_0x3d66('0x6f')][_0x3cbf4a]),'WhatsappQueueId':Number(_0x971a88[_0x3d66('0x57')]['id'])});}}else{socket[_0x3d66('0x6c')](_0x3d66('0x86'),{'UserId':Number(_0x971a88[_0x3d66('0x36')]['ids']),'WhatsappQueueId':Number(_0x971a88[_0x3d66('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x534954,null))[_0x3d66('0x49')](handleError(_0x534954,null));};exports['getAgents']=function(_0x2093b7,_0x4ebbf8,_0x206c5d){var _0x2a5b31={};var _0x10ffb4={};var _0x2e515c;var _0xa72032;return db['WhatsappQueue'][_0x3d66('0x8a')]({'where':{'id':_0x2093b7[_0x3d66('0x57')]['id']}})[_0x3d66('0x29')](handleEntityNotFound(_0x4ebbf8,null))[_0x3d66('0x29')](function(_0x5039e6){if(_0x5039e6){_0x2e515c=_0x5039e6;_0x10ffb4[_0x3d66('0x34')]=_['keys'](db[_0x3d66('0x5b')][_0x3d66('0x4b')]);_0x10ffb4[_0x3d66('0x36')]=_[_0x3d66('0x35')](_0x2093b7[_0x3d66('0x36')]);_0x10ffb4[_0x3d66('0x37')]=_['intersection'](_0x10ffb4[_0x3d66('0x34')],_0x10ffb4[_0x3d66('0x36')]);_0x2a5b31['attributes']=_[_0x3d66('0x38')](_0x10ffb4[_0x3d66('0x34')],qs[_0x3d66('0x3a')](_0x2093b7[_0x3d66('0x36')][_0x3d66('0x3a')]));_0x2a5b31['attributes']=_0x2a5b31[_0x3d66('0x39')][_0x3d66('0x3b')]?_0x2a5b31['attributes']:_0x10ffb4[_0x3d66('0x34')];_0x2a5b31[_0x3d66('0x3e')]=qs[_0x3d66('0x3f')](_0x2093b7['query']['sort']);_0x2a5b31[_0x3d66('0x40')]=qs[_0x3d66('0x37')](_[_0x3d66('0x41')](_0x2093b7[_0x3d66('0x36')],_0x10ffb4['filters']));if(_0x2093b7[_0x3d66('0x36')][_0x3d66('0x42')]){_0x2a5b31[_0x3d66('0x40')]=_['merge'](_0x2a5b31[_0x3d66('0x40')],{'$or':_['map'](_0x2a5b31[_0x3d66('0x39')],function(_0x53a766){var _0x1beec2={};_0x1beec2[_0x53a766]={'$like':'%'+_0x2093b7[_0x3d66('0x36')][_0x3d66('0x42')]+'%'};return _0x1beec2;})});}_0x2a5b31=_[_0x3d66('0x43')]({},_0x2a5b31,_0x2093b7[_0x3d66('0x45')]);return _0x2e515c[_0x3d66('0x8b')](_0x2a5b31);}})[_0x3d66('0x29')](function(_0x56f3d8){if(_0x56f3d8){_0xa72032=_0x56f3d8['length'];if(!_0x2093b7[_0x3d66('0x36')][_0x3d66('0x3c')](_0x3d66('0x3d'))){_0x2a5b31[_0x3d66('0x23')]=qs[_0x3d66('0x23')](_0x2093b7[_0x3d66('0x36')][_0x3d66('0x23')]);_0x2a5b31[_0x3d66('0x21')]=qs[_0x3d66('0x21')](_0x2093b7[_0x3d66('0x36')][_0x3d66('0x21')]);}return _0x2e515c[_0x3d66('0x8b')](_0x2a5b31);}})['then'](function(_0x2fc371){if(_0x2fc371){return _0x2fc371?{'count':_0xa72032,'rows':_0x2fc371}:null;}})[_0x3d66('0x29')](respondWithResult(_0x4ebbf8,null))[_0x3d66('0x49')](handleError(_0x4ebbf8,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 9e27e9c..984b6a9 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 _0xa176=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa176,0x9c));var _0x6a17=function(_0x3e70b2,_0x1c9271){_0x3e70b2=_0x3e70b2-0x0;var _0x14a451=_0xa176[_0x3e70b2];return _0x14a451;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6a17('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6a17('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6a17('0x2'),'afterDestroy':_0x6a17('0x3')};function emitEvent(_0x52ed8f){return function(_0x934e3f,_0x19b185,_0x4cb848){WhatsappQueueEvents[_0x6a17('0x4')](_0x52ed8f+':'+_0x934e3f['id'],_0x934e3f);WhatsappQueueEvents[_0x6a17('0x4')](_0x52ed8f,_0x934e3f);_0x4cb848(null);};}for(var e in events){if(events[_0x6a17('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x6a17('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x7eb7=['hasOwnProperty','hook','exports','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x348c64,_0x1266b6){var _0x3052c6=function(_0x274831){while(--_0x274831){_0x348c64['push'](_0x348c64['shift']());}};_0x3052c6(++_0x1266b6);}(_0x7eb7,0x162));var _0x77eb=function(_0x13c2d4,_0x554a15){_0x13c2d4=_0x13c2d4-0x0;var _0x41cb94=_0x7eb7[_0x13c2d4];return _0x41cb94;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x77eb('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x77eb('0x1')](0x0);var events={'afterCreate':_0x77eb('0x2'),'afterUpdate':_0x77eb('0x3'),'afterDestroy':_0x77eb('0x4')};function emitEvent(_0x52e54e){return function(_0x150bf8,_0x3e346c,_0x150ce1){WhatsappQueueEvents[_0x77eb('0x5')](_0x52e54e+':'+_0x150bf8['id'],_0x150bf8);WhatsappQueueEvents['emit'](_0x52e54e,_0x150bf8);_0x150ce1(null);};}for(var e in events){if(events[_0x77eb('0x6')](e)){var event=events[e];WhatsappQueue[_0x77eb('0x7')](e,emitEvent(event));}}module[_0x77eb('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 155e352..bd8b10c 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 _0x8705=['moment','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger'];(function(_0x2d70e3,_0xfa2091){var _0x1b91e6=function(_0x272651){while(--_0x272651){_0x2d70e3['push'](_0x2d70e3['shift']());}};_0x1b91e6(++_0xfa2091);}(_0x8705,0x1b6));var _0x5870=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8705[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5870('0x0'));var util=require(_0x5870('0x1'));var logger=require(_0x5870('0x2'))('api');var moment=require(_0x5870('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5870('0x4'));var attributes=require(_0x5870('0x5'));module[_0x5870('0x6')]=function(_0x2015fc,_0x280aaa){return _0x2015fc[_0x5870('0x7')](_0x5870('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b1=['exports','define','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes'];(function(_0x1c0273,_0x4c756d){var _0x363b33=function(_0x487ddc){while(--_0x487ddc){_0x1c0273['push'](_0x1c0273['shift']());}};_0x363b33(++_0x4c756d);}(_0xf3b1,0xf3));var _0x1f3b=function(_0x2e53b9,_0x56eeb4){_0x2e53b9=_0x2e53b9-0x0;var _0x5e1b83=_0xf3b1[_0x2e53b9];return _0x5e1b83;};'use strict';var _=require(_0x1f3b('0x0'));var util=require(_0x1f3b('0x1'));var logger=require('../../config/logger')(_0x1f3b('0x2'));var moment=require(_0x1f3b('0x3'));var BPromise=require(_0x1f3b('0x4'));var rp=require(_0x1f3b('0x5'));var fs=require('fs');var path=require(_0x1f3b('0x6'));var rimraf=require('rimraf');var config=require(_0x1f3b('0x7'));var attributes=require(_0x1f3b('0x8'));module[_0x1f3b('0x9')]=function(_0x2720a8,_0x356ef6){return _0x2720a8[_0x1f3b('0xa')]('WhatsappQueue',attributes,{'tableName':_0x1f3b('0xb'),'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 afdf7c2..a48e244 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 _0x130d=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','limit','include','map','model','attributes','stringify','ShowWhatsappQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x130d,0x1cd));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd130('0x0'));var moment=require(_0xd130('0x1'));var BPromise=require(_0xd130('0x2'));var rs=require(_0xd130('0x3'));var fs=require('fs');var Redis=require(_0xd130('0x4'));var db=require(_0xd130('0x5'))['db'];var utils=require(_0xd130('0x6'));var logger=require(_0xd130('0x7'))(_0xd130('0x8'));var config=require(_0xd130('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xd130('0xa')]=_[_0xd130('0xb')](config[_0xd130('0xa')],{'host':_0xd130('0xc'),'port':0x18eb});var socket=require(_0xd130('0xd'))(new Redis(config[_0xd130('0xa')]));require('./whatsappQueue.socket')[_0xd130('0xe')](socket);function respondWithRpcPromise(_0x48e9f7,_0x46476a,_0x2f726b){return new BPromise(function(_0x39e09e,_0x2b18d1){return client['request'](_0x48e9f7,_0x2f726b)[_0xd130('0xf')](function(_0x472fff){logger[_0xd130('0x10')](_0xd130('0x11'),_0x46476a,'request\x20sent');logger[_0xd130('0x12')](_0xd130('0x13'),_0x46476a,_0xd130('0x14'),JSON['stringify'](_0x472fff));if(_0x472fff['error']){if(_0x472fff[_0xd130('0x15')][_0xd130('0x16')]===0x1f4){logger['error'](_0xd130('0x11'),_0x46476a,_0x472fff[_0xd130('0x15')]['message']);return _0x2b18d1(_0x472fff[_0xd130('0x15')][_0xd130('0x17')]);}logger[_0xd130('0x15')](_0xd130('0x11'),_0x46476a,_0x472fff[_0xd130('0x15')][_0xd130('0x17')]);return _0x39e09e(_0x472fff[_0xd130('0x15')][_0xd130('0x17')]);}else{logger[_0xd130('0x10')](_0xd130('0x11'),_0x46476a,_0xd130('0x14'));_0x39e09e(_0x472fff[_0xd130('0x18')][_0xd130('0x17')]);}})[_0xd130('0x19')](function(_0xacecae){logger[_0xd130('0x15')](_0xd130('0x11'),_0x46476a,_0xacecae);_0x2b18d1(_0xacecae);});});}exports[_0xd130('0x1a')]=function(_0x27b3e8){var _0xff752f=this;return new Promise(function(_0x5cbcb5,_0x152ab7){return db[_0xd130('0x1b')]['findAll']({'raw':_0x27b3e8[_0xd130('0x1c')]?_0x27b3e8[_0xd130('0x1c')][_0xd130('0x1d')]===undefined?!![]:![]:!![],'where':_0x27b3e8[_0xd130('0x1c')]?_0x27b3e8[_0xd130('0x1c')]['where']||null:null,'attributes':_0x27b3e8[_0xd130('0x1c')]?_0x27b3e8['options']['attributes']||null:null,'limit':_0x27b3e8[_0xd130('0x1c')]?_0x27b3e8['options'][_0xd130('0x1e')]||null:null,'include':_0x27b3e8[_0xd130('0x1c')]?_0x27b3e8[_0xd130('0x1c')][_0xd130('0x1f')]?_[_0xd130('0x20')](_0x27b3e8['options'][_0xd130('0x1f')],function(_0x973aa5){return{'model':db[_0x973aa5[_0xd130('0x21')]],'as':_0x973aa5['as'],'attributes':_0x973aa5[_0xd130('0x22')],'include':_0x973aa5['include']?_['map'](_0x973aa5['include'],function(_0x4e44e1){return{'model':db[_0x4e44e1[_0xd130('0x21')]],'as':_0x4e44e1['as'],'attributes':_0x4e44e1[_0xd130('0x22')],'include':_0x4e44e1['include']?_[_0xd130('0x20')](_0x4e44e1[_0xd130('0x1f')],function(_0x17542a){return{'model':db[_0x17542a[_0xd130('0x21')]],'as':_0x17542a['as'],'attributes':_0x17542a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ef54){logger[_0xd130('0x10')](_0xd130('0x1a'),_0x27b3e8);logger[_0xd130('0x12')]('GetWhatsappQueue',_0x27b3e8,JSON[_0xd130('0x23')](_0x40ef54));_0x5cbcb5(_0x40ef54);})[_0xd130('0x19')](function(_0xebc13b){logger[_0xd130('0x15')](_0xd130('0x1a'),_0xebc13b[_0xd130('0x17')],_0x27b3e8);_0x152ab7(_0xff752f['error'](0x1f4,_0xebc13b[_0xd130('0x17')]));});});};exports[_0xd130('0x24')]=function(_0x2affa2){var _0x5c4f24=this;return new Promise(function(_0x50601b,_0x1d5552){return db['WhatsappQueue'][_0xd130('0x25')]({'raw':_0x2affa2['options']?_0x2affa2['options']['raw']===undefined?!![]:![]:!![],'where':_0x2affa2['options']?_0x2affa2[_0xd130('0x1c')][_0xd130('0x26')]||null:null,'attributes':_0x2affa2[_0xd130('0x1c')]?_0x2affa2['options'][_0xd130('0x22')]||null:null,'include':_0x2affa2[_0xd130('0x1c')]?_0x2affa2[_0xd130('0x1c')]['include']?_[_0xd130('0x20')](_0x2affa2[_0xd130('0x1c')]['include'],function(_0x5daaca){return{'model':db[_0x5daaca[_0xd130('0x21')]],'as':_0x5daaca['as'],'attributes':_0x5daaca[_0xd130('0x22')],'include':_0x5daaca[_0xd130('0x1f')]?_[_0xd130('0x20')](_0x5daaca['include'],function(_0x40c1bc){return{'model':db[_0x40c1bc[_0xd130('0x21')]],'as':_0x40c1bc['as'],'attributes':_0x40c1bc[_0xd130('0x22')],'include':_0x40c1bc[_0xd130('0x1f')]?_[_0xd130('0x20')](_0x40c1bc[_0xd130('0x1f')],function(_0x4e4dd1){return{'model':db[_0x4e4dd1['model']],'as':_0x4e4dd1['as'],'attributes':_0x4e4dd1[_0xd130('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd130('0xf')](function(_0x581cc5){logger['info'](_0xd130('0x24'),_0x2affa2);logger[_0xd130('0x12')](_0xd130('0x24'),_0x2affa2,JSON[_0xd130('0x23')](_0x581cc5));_0x50601b(_0x581cc5);})[_0xd130('0x19')](function(_0x5b2249){logger[_0xd130('0x15')](_0xd130('0x24'),_0x5b2249[_0xd130('0x17')],_0x2affa2);_0x1d5552(_0x5c4f24[_0xd130('0x15')](0x1f4,_0x5b2249['message']));});});}; \ No newline at end of file +var _0x4c5a=['find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x148a3c,_0x3334a2){var _0x1558eb=function(_0x3eb55e){while(--_0x3eb55e){_0x148a3c['push'](_0x148a3c['shift']());}};_0x1558eb(++_0x3334a2);}(_0x4c5a,0xd4));var _0xa4c5=function(_0x1d72d0,_0x89db32){_0x1d72d0=_0x1d72d0-0x0;var _0x234ae9=_0x4c5a[_0x1d72d0];return _0x234ae9;};'use strict';var _=require(_0xa4c5('0x0'));var util=require(_0xa4c5('0x1'));var moment=require(_0xa4c5('0x2'));var BPromise=require(_0xa4c5('0x3'));var rs=require(_0xa4c5('0x4'));var fs=require('fs');var Redis=require(_0xa4c5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4c5('0x6'));var logger=require(_0xa4c5('0x7'))(_0xa4c5('0x8'));var config=require(_0xa4c5('0x9'));var jayson=require(_0xa4c5('0xa'));var client=jayson[_0xa4c5('0xb')][_0xa4c5('0xc')]({'port':0x232a});config[_0xa4c5('0xd')]=_[_0xa4c5('0xe')](config[_0xa4c5('0xd')],{'host':_0xa4c5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa4c5('0x10'))[_0xa4c5('0x11')](socket);function respondWithRpcPromise(_0x5eb088,_0x1a011a,_0x1abbcc){return new BPromise(function(_0xc4a43d,_0x2169f9){return client[_0xa4c5('0x12')](_0x5eb088,_0x1abbcc)[_0xa4c5('0x13')](function(_0x1f71c9){logger[_0xa4c5('0x14')](_0xa4c5('0x15'),_0x1a011a,_0xa4c5('0x16'));logger[_0xa4c5('0x17')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1a011a,_0xa4c5('0x16'),JSON['stringify'](_0x1f71c9));if(_0x1f71c9[_0xa4c5('0x18')]){if(_0x1f71c9['error']['code']===0x1f4){logger[_0xa4c5('0x18')](_0xa4c5('0x15'),_0x1a011a,_0x1f71c9[_0xa4c5('0x18')][_0xa4c5('0x19')]);return _0x2169f9(_0x1f71c9['error'][_0xa4c5('0x19')]);}logger[_0xa4c5('0x18')](_0xa4c5('0x15'),_0x1a011a,_0x1f71c9[_0xa4c5('0x18')][_0xa4c5('0x19')]);return _0xc4a43d(_0x1f71c9[_0xa4c5('0x18')][_0xa4c5('0x19')]);}else{logger[_0xa4c5('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x1a011a,'request\x20sent');_0xc4a43d(_0x1f71c9[_0xa4c5('0x1a')][_0xa4c5('0x19')]);}})[_0xa4c5('0x1b')](function(_0x103f8b){logger[_0xa4c5('0x18')](_0xa4c5('0x15'),_0x1a011a,_0x103f8b);_0x2169f9(_0x103f8b);});});}exports[_0xa4c5('0x1c')]=function(_0x10f1d6){var _0x422dfa=this;return new Promise(function(_0x59d87d,_0x570136){return db[_0xa4c5('0x1d')][_0xa4c5('0x1e')]({'raw':_0x10f1d6[_0xa4c5('0x1f')]?_0x10f1d6['options'][_0xa4c5('0x20')]===undefined?!![]:![]:!![],'where':_0x10f1d6[_0xa4c5('0x1f')]?_0x10f1d6[_0xa4c5('0x1f')][_0xa4c5('0x21')]||null:null,'attributes':_0x10f1d6['options']?_0x10f1d6['options'][_0xa4c5('0x22')]||null:null,'limit':_0x10f1d6[_0xa4c5('0x1f')]?_0x10f1d6[_0xa4c5('0x1f')][_0xa4c5('0x23')]||null:null,'include':_0x10f1d6['options']?_0x10f1d6[_0xa4c5('0x1f')][_0xa4c5('0x24')]?_[_0xa4c5('0x25')](_0x10f1d6[_0xa4c5('0x1f')][_0xa4c5('0x24')],function(_0xbe752b){return{'model':db[_0xbe752b['model']],'as':_0xbe752b['as'],'attributes':_0xbe752b[_0xa4c5('0x22')],'include':_0xbe752b[_0xa4c5('0x24')]?_[_0xa4c5('0x25')](_0xbe752b[_0xa4c5('0x24')],function(_0x2a1342){return{'model':db[_0x2a1342[_0xa4c5('0x26')]],'as':_0x2a1342['as'],'attributes':_0x2a1342['attributes'],'include':_0x2a1342['include']?_[_0xa4c5('0x25')](_0x2a1342['include'],function(_0x19790c){return{'model':db[_0x19790c[_0xa4c5('0x26')]],'as':_0x19790c['as'],'attributes':_0x19790c['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4c5('0x13')](function(_0x13c30d){logger[_0xa4c5('0x14')](_0xa4c5('0x1c'),_0x10f1d6);logger[_0xa4c5('0x17')](_0xa4c5('0x1c'),_0x10f1d6,JSON[_0xa4c5('0x27')](_0x13c30d));_0x59d87d(_0x13c30d);})[_0xa4c5('0x1b')](function(_0xd0a7bf){logger[_0xa4c5('0x18')]('GetWhatsappQueue',_0xd0a7bf[_0xa4c5('0x19')],_0x10f1d6);_0x570136(_0x422dfa[_0xa4c5('0x18')](0x1f4,_0xd0a7bf[_0xa4c5('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x1767d5){var _0x197483=this;return new Promise(function(_0x5de835,_0xd0a56c){return db[_0xa4c5('0x1d')][_0xa4c5('0x28')]({'raw':_0x1767d5[_0xa4c5('0x1f')]?_0x1767d5[_0xa4c5('0x1f')][_0xa4c5('0x20')]===undefined?!![]:![]:!![],'where':_0x1767d5[_0xa4c5('0x1f')]?_0x1767d5[_0xa4c5('0x1f')][_0xa4c5('0x21')]||null:null,'attributes':_0x1767d5[_0xa4c5('0x1f')]?_0x1767d5[_0xa4c5('0x1f')]['attributes']||null:null,'include':_0x1767d5[_0xa4c5('0x1f')]?_0x1767d5[_0xa4c5('0x1f')][_0xa4c5('0x24')]?_[_0xa4c5('0x25')](_0x1767d5[_0xa4c5('0x1f')][_0xa4c5('0x24')],function(_0x1356d9){return{'model':db[_0x1356d9[_0xa4c5('0x26')]],'as':_0x1356d9['as'],'attributes':_0x1356d9[_0xa4c5('0x22')],'include':_0x1356d9['include']?_['map'](_0x1356d9['include'],function(_0x47483e){return{'model':db[_0x47483e[_0xa4c5('0x26')]],'as':_0x47483e['as'],'attributes':_0x47483e[_0xa4c5('0x22')],'include':_0x47483e[_0xa4c5('0x24')]?_[_0xa4c5('0x25')](_0x47483e[_0xa4c5('0x24')],function(_0x4add75){return{'model':db[_0x4add75[_0xa4c5('0x26')]],'as':_0x4add75['as'],'attributes':_0x4add75[_0xa4c5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa4c5('0x13')](function(_0x5f5242){logger['info'](_0xa4c5('0x29'),_0x1767d5);logger[_0xa4c5('0x17')](_0xa4c5('0x29'),_0x1767d5,JSON['stringify'](_0x5f5242));_0x5de835(_0x5f5242);})[_0xa4c5('0x1b')](function(_0x163208){logger[_0xa4c5('0x18')](_0xa4c5('0x29'),_0x163208[_0xa4c5('0x19')],_0x1767d5);_0xd0a56c(_0x197483[_0xa4c5('0x18')](0x1f4,_0x163208[_0xa4c5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9426da9..13f9d8f 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 _0x042c=['remove','update','emit','removeListener','length','save'];(function(_0x399ad3,_0x249e0f){var _0x290fed=function(_0x2c9415){while(--_0x2c9415){_0x399ad3['push'](_0x399ad3['shift']());}};_0x290fed(++_0x249e0f);}(_0x042c,0x119));var _0xc042=function(_0x497c3e,_0x2456fd){_0x497c3e=_0x497c3e-0x0;var _0x18332b=_0x042c[_0x497c3e];return _0x18332b;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xc042('0x0'),_0xc042('0x1'),_0xc042('0x2')];function createListener(_0x397968,_0x1f00d){return function(_0x1703aa){_0x1f00d[_0xc042('0x3')](_0x397968,_0x1703aa);};}function removeListener(_0xfb07e8,_0x2fa597){return function(){WhatsappQueueEvents[_0xc042('0x4')](_0xfb07e8,_0x2fa597);};}exports['register']=function(_0x5cfd05){for(var _0x4cf462=0x0,_0xadf002=events[_0xc042('0x5')];_0x4cf462<_0xadf002;_0x4cf462++){var _0x5dec7d=events[_0x4cf462];var _0x4104cb=createListener('whatsappQueue:'+_0x5dec7d,_0x5cfd05);WhatsappQueueEvents['on'](_0x5dec7d,_0x4104cb);}}; \ No newline at end of file +var _0xf1a9=['update','emit','removeListener','register','length','save','remove'];(function(_0x5afa3a,_0x886fc7){var _0x43b612=function(_0xac89ec){while(--_0xac89ec){_0x5afa3a['push'](_0x5afa3a['shift']());}};_0x43b612(++_0x886fc7);}(_0xf1a9,0x19b));var _0x9f1a=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xf1a9[_0x1cfa0d];return _0xe33279;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x9f1a('0x0'),_0x9f1a('0x1'),_0x9f1a('0x2')];function createListener(_0x273c5b,_0x4515bc){return function(_0x45dd8a){_0x4515bc[_0x9f1a('0x3')](_0x273c5b,_0x45dd8a);};}function removeListener(_0x40db81,_0x3174ae){return function(){WhatsappQueueEvents[_0x9f1a('0x4')](_0x40db81,_0x3174ae);};}exports[_0x9f1a('0x5')]=function(_0x1d1d64){for(var _0x461e31=0x0,_0x5d1eb7=events[_0x9f1a('0x6')];_0x461e31<_0x5d1eb7;_0x461e31++){var _0x1a852b=events[_0x461e31];var _0x472c85=createListener('whatsappQueue:'+_0x1a852b,_0x1d1d64);WhatsappQueueEvents['on'](_0x1a852b,_0x472c85);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2c41b7a..29abaf1 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 _0xfa0e=['post','create','update','delete','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfa0e,0x123));var _0xefa0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfa0e[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xefa0('0x0'));var express=require(_0xefa0('0x1'));var router=express['Router']();var fs_extra=require(_0xefa0('0x2'));var auth=require(_0xefa0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xefa0('0x4'));var controller=require('./whatsappQueueReport.controller');router[_0xefa0('0x5')]('/',auth[_0xefa0('0x6')](),controller[_0xefa0('0x7')]);router['get'](_0xefa0('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xefa0('0x5')]('/:id',auth[_0xefa0('0x6')](),controller['show']);router[_0xefa0('0x9')]('/',auth['isAuthenticated'](),controller[_0xefa0('0xa')]);router['put']('/:id',auth[_0xefa0('0x6')](),controller[_0xefa0('0xb')]);router[_0xefa0('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xefa0('0xd')]);module[_0xefa0('0xe')]=router; \ No newline at end of file +var _0x804f=['../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa58d3c,_0x3e40c1){var _0x2c770f=function(_0x366236){while(--_0x366236){_0xa58d3c['push'](_0xa58d3c['shift']());}};_0x2c770f(++_0x3e40c1);}(_0x804f,0x150));var _0xf804=function(_0x2937f8,_0x253a80){_0x2937f8=_0x2937f8-0x0;var _0x6eaf37=_0x804f[_0x2937f8];return _0x6eaf37;};'use strict';var multer=require(_0xf804('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf804('0x1'));var express=require(_0xf804('0x2'));var router=express[_0xf804('0x3')]();var fs_extra=require(_0xf804('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf804('0x5'));var config=require(_0xf804('0x6'));var controller=require(_0xf804('0x7'));router['get']('/',auth[_0xf804('0x8')](),controller[_0xf804('0x9')]);router[_0xf804('0xa')](_0xf804('0xb'),auth[_0xf804('0x8')](),controller['describe']);router['get'](_0xf804('0xc'),auth[_0xf804('0x8')](),controller[_0xf804('0xd')]);router[_0xf804('0xe')]('/',auth[_0xf804('0x8')](),controller['create']);router[_0xf804('0xf')](_0xf804('0xc'),auth['isAuthenticated'](),controller[_0xf804('0x10')]);router[_0xf804('0x11')]('/:id',auth[_0xf804('0x8')](),controller['destroy']);module[_0xf804('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 1d3ac0b..6b6232c 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(_0x591355,_0x533447){var _0x34c4e3=function(_0x4f2bd9){while(--_0x4f2bd9){_0x591355['push'](_0x591355['shift']());}};_0x34c4e3(++_0x533447);}(_0x7a54,0x106));var _0x47a5=function(_0x344caa,_0x2de456){_0x344caa=_0x344caa-0x0;var _0x1fddd4=_0x7a54[_0x344caa];return _0x1fddd4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x444911,_0x321937){var _0x47bdb6=function(_0x5c7b76){while(--_0x5c7b76){_0x444911['push'](_0x444911['shift']());}};_0x47bdb6(++_0x321937);}(_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')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e221792..26416ed 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 _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x5872c9,_0x37822b){var _0x13170f=function(_0x3ab494){while(--_0x3ab494){_0x5872c9['push'](_0x5872c9['shift']());}};_0x13170f(++_0x37822b);}(_0x02ce,0x1ac));var _0xe02c=function(_0x512051,_0x2efc29){_0x512051=_0x512051-0x0;var _0x177771=_0x02ce[_0x512051];return _0x177771;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));}; \ No newline at end of file +var _0x4fc2=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','error','name','send','index','map','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4fc2,0x111));var _0x24fc=function(_0x3ebf10,_0x17baf3){_0x3ebf10=_0x3ebf10-0x0;var _0x1c7231=_0x4fc2[_0x3ebf10];return _0x1c7231;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];function respondWithStatusCode(_0x5cc65e,_0x306873){_0x306873=_0x306873||0xcc;return function(_0x76cb25){if(_0x76cb25){return _0x5cc65e[_0x24fc('0x1b')](_0x306873);}return _0x5cc65e[_0x24fc('0x1c')](_0x306873)[_0x24fc('0x1d')]();};}function respondWithResult(_0x326276,_0x537b5c){_0x537b5c=_0x537b5c||0xc8;return function(_0x2a0971){if(_0x2a0971){return _0x326276[_0x24fc('0x1c')](_0x537b5c)[_0x24fc('0x1e')](_0x2a0971);}};}function respondWithFilteredResult(_0x42cbe8,_0x4acd36){return function(_0x2ac989){if(_0x2ac989){var _0x588543=typeof _0x4acd36[_0x24fc('0x1f')]===_0x24fc('0x20')&&typeof _0x4acd36[_0x24fc('0x21')]===_0x24fc('0x20');var _0x25cb40=_0x2ac989['count'];var _0x23873c=_0x588543?0x0:_0x4acd36[_0x24fc('0x1f')];var _0x6cfa0a=_0x588543?_0x2ac989[_0x24fc('0x22')]:_0x4acd36['offset']+_0x4acd36[_0x24fc('0x21')];var _0x4073e0;if(_0x6cfa0a>=_0x25cb40){_0x6cfa0a=_0x25cb40;_0x4073e0=0xc8;}else{_0x4073e0=0xce;}_0x42cbe8[_0x24fc('0x1c')](_0x4073e0);return _0x42cbe8['set'](_0x24fc('0x23'),_0x23873c+'-'+_0x6cfa0a+'/'+_0x25cb40)[_0x24fc('0x1e')](_0x2ac989);}return null;};}function patchUpdates(_0xbf1d6b){return function(_0x2d0e3d){try{jsonpatch['apply'](_0x2d0e3d,_0xbf1d6b,!![]);}catch(_0x323beb){return BPromise['reject'](_0x323beb);}return _0x2d0e3d[_0x24fc('0x24')]();};}function saveUpdates(_0x591c8f,_0x3ed464){return function(_0x44c121){if(_0x44c121){return _0x44c121[_0x24fc('0x25')](_0x591c8f)['then'](function(_0x313a25){return _0x313a25;});}return null;};}function removeEntity(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(_0x2bb93a){return _0x2bb93a[_0x24fc('0x26')]()[_0x24fc('0x27')](function(){_0x552035[_0x24fc('0x1c')](0xcc)[_0x24fc('0x1d')]();});}};}function handleEntityNotFound(_0x3f0875,_0x20192b){return function(_0x168d98){if(!_0x168d98){_0x3f0875[_0x24fc('0x1b')](0x194);}return _0x168d98;};}function handleError(_0x568441,_0x11c913){_0x11c913=_0x11c913||0x1f4;return function(_0x16f27f){logger[_0x24fc('0x28')](_0x16f27f['stack']);if(_0x16f27f[_0x24fc('0x29')]){delete _0x16f27f[_0x24fc('0x29')];}_0x568441[_0x24fc('0x1c')](_0x11c913)[_0x24fc('0x2a')](_0x16f27f);};}exports[_0x24fc('0x2b')]=function(_0x443796,_0x5ac1f2){var _0x240ae7={},_0x29a461={},_0x3c99ed={'count':0x0,'rows':[]};var _0x1c5146=_[_0x24fc('0x2c')](db['WhatsappQueueReport']['rawAttributes'],function(_0x4e6f73){return{'name':_0x4e6f73[_0x24fc('0x2d')],'type':_0x4e6f73['type'][_0x24fc('0x2e')]};});_0x29a461[_0x24fc('0x2f')]=_[_0x24fc('0x2c')](_0x1c5146,_0x24fc('0x29'));_0x29a461['query']=_[_0x24fc('0x30')](_0x443796[_0x24fc('0x31')]);_0x29a461['filters']=_[_0x24fc('0x32')](_0x29a461[_0x24fc('0x2f')],_0x29a461['query']);_0x240ae7['attributes']=_[_0x24fc('0x32')](_0x29a461['model'],qs[_0x24fc('0x33')](_0x443796[_0x24fc('0x31')]['fields']));_0x240ae7[_0x24fc('0x34')]=_0x240ae7[_0x24fc('0x34')][_0x24fc('0x35')]?_0x240ae7[_0x24fc('0x34')]:_0x29a461[_0x24fc('0x2f')];if(!_0x443796[_0x24fc('0x31')][_0x24fc('0x36')](_0x24fc('0x37'))){_0x240ae7[_0x24fc('0x21')]=qs['limit'](_0x443796[_0x24fc('0x31')][_0x24fc('0x21')]);_0x240ae7[_0x24fc('0x1f')]=qs[_0x24fc('0x1f')](_0x443796[_0x24fc('0x31')]['offset']);}_0x240ae7['order']=qs[_0x24fc('0x38')](_0x443796['query'][_0x24fc('0x38')]);_0x240ae7[_0x24fc('0x39')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x3b')](_0x443796['query'],_0x29a461[_0x24fc('0x3a')]),_0x1c5146);if(_0x443796['query'][_0x24fc('0x3c')]){_0x240ae7[_0x24fc('0x39')]=_[_0x24fc('0x3d')](_0x240ae7[_0x24fc('0x39')],{'$or':_[_0x24fc('0x2c')](_0x1c5146,function(_0x508aaf){if(_0x508aaf[_0x24fc('0x3e')]!==_0x24fc('0x3f')){var _0x2181f7={};_0x2181f7[_0x508aaf[_0x24fc('0x29')]]={'$like':'%'+_0x443796['query'][_0x24fc('0x3c')]+'%'};return _0x2181f7;}})});}_0x240ae7=_[_0x24fc('0x3d')]({},_0x240ae7,_0x443796['options']);var _0xf40435={'where':_0x240ae7['where']};return db[_0x24fc('0x40')][_0x24fc('0x22')](_0xf40435)[_0x24fc('0x27')](function(_0x1e045a){_0x3c99ed[_0x24fc('0x22')]=_0x1e045a;if(_0x443796[_0x24fc('0x31')][_0x24fc('0x41')]){_0x240ae7[_0x24fc('0x42')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x24fc('0x43')](_0x240ae7);})[_0x24fc('0x27')](function(_0x32f72c){_0x3c99ed['rows']=_0x32f72c;return _0x3c99ed;})[_0x24fc('0x27')](respondWithFilteredResult(_0x5ac1f2,_0x240ae7))[_0x24fc('0x44')](handleError(_0x5ac1f2,null));};exports['show']=function(_0x2c4a6c,_0x22f30b){var _0x2c598c={'raw':!![],'where':{'id':_0x2c4a6c[_0x24fc('0x45')]['id']}},_0x5e4e9b={};_0x5e4e9b[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x40')][_0x24fc('0x46')]);_0x5e4e9b[_0x24fc('0x31')]=_[_0x24fc('0x30')](_0x2c4a6c['query']);_0x5e4e9b[_0x24fc('0x3a')]=_[_0x24fc('0x32')](_0x5e4e9b[_0x24fc('0x2f')],_0x5e4e9b[_0x24fc('0x31')]);_0x2c598c[_0x24fc('0x34')]=_['intersection'](_0x5e4e9b[_0x24fc('0x2f')],qs[_0x24fc('0x33')](_0x2c4a6c[_0x24fc('0x31')][_0x24fc('0x33')]));_0x2c598c['attributes']=_0x2c598c[_0x24fc('0x34')][_0x24fc('0x35')]?_0x2c598c['attributes']:_0x5e4e9b['model'];if(_0x2c4a6c[_0x24fc('0x31')]['includeAll']){_0x2c598c['include']=[{'all':!![]}];}_0x2c598c=_[_0x24fc('0x3d')]({},_0x2c598c,_0x2c4a6c['options']);return db[_0x24fc('0x40')][_0x24fc('0x47')](_0x2c598c)[_0x24fc('0x27')](handleEntityNotFound(_0x22f30b,null))['then'](respondWithResult(_0x22f30b,null))[_0x24fc('0x44')](handleError(_0x22f30b,null));};exports[_0x24fc('0x48')]=function(_0x1b1f1c,_0x1ad8d6){return db[_0x24fc('0x40')][_0x24fc('0x48')](_0x1b1f1c[_0x24fc('0x49')],{})[_0x24fc('0x27')](respondWithResult(_0x1ad8d6,0xc9))['catch'](handleError(_0x1ad8d6,null));};exports['update']=function(_0x266378,_0x2f1a99){if(_0x266378[_0x24fc('0x49')]['id']){delete _0x266378['body']['id'];}return db['WhatsappQueueReport'][_0x24fc('0x47')]({'where':{'id':_0x266378[_0x24fc('0x45')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x2f1a99,null))[_0x24fc('0x27')](saveUpdates(_0x266378[_0x24fc('0x49')],null))[_0x24fc('0x27')](respondWithResult(_0x2f1a99,null))[_0x24fc('0x44')](handleError(_0x2f1a99,null));};exports[_0x24fc('0x26')]=function(_0x1671b0,_0x4574d3){return db[_0x24fc('0x40')][_0x24fc('0x47')]({'where':{'id':_0x1671b0['params']['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x4574d3,null))[_0x24fc('0x27')](removeEntity(_0x4574d3,null))[_0x24fc('0x44')](handleError(_0x4574d3,null));};exports[_0x24fc('0x4a')]=function(_0x370b6c,_0x5bdc4d){return db[_0x24fc('0x40')]['describe']()[_0x24fc('0x27')](respondWithResult(_0x5bdc4d,null))[_0x24fc('0x44')](handleError(_0x5bdc4d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 4bef11d..b4aa389 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 _0xe796=['request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0xe796,0xa2));var _0x6e79=function(_0xb591f0,_0x319160){_0xb591f0=_0xb591f0-0x0;var _0x3055ae=_0xe796[_0xb591f0];return _0x3055ae;};'use strict';var _=require('lodash');var util=require(_0x6e79('0x0'));var logger=require(_0x6e79('0x1'))(_0x6e79('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e79('0x3'));var fs=require('fs');var path=require(_0x6e79('0x4'));var rimraf=require(_0x6e79('0x5'));var config=require(_0x6e79('0x6'));var attributes=require(_0x6e79('0x7'));module['exports']=function(_0xa9ba6b,_0x1d39e1){return _0xa9ba6b['define'](_0x6e79('0x8'),attributes,{'tableName':_0x6e79('0x9'),'paranoid':![],'indexes':[{'name':_0x6e79('0xa'),'fields':[_0x6e79('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc310=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','lodash','../../config/logger','api','request-promise'];(function(_0x1d3722,_0x3158aa){var _0x1492de=function(_0x4b7c4b){while(--_0x4b7c4b){_0x1d3722['push'](_0x1d3722['shift']());}};_0x1492de(++_0x3158aa);}(_0xc310,0x11a));var _0x0c31=function(_0x69af56,_0x30bc7f){_0x69af56=_0x69af56-0x0;var _0x4e04d4=_0xc310[_0x69af56];return _0x4e04d4;};'use strict';var _=require(_0x0c31('0x0'));var util=require('util');var logger=require(_0x0c31('0x1'))(_0x0c31('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c31('0x3'));var fs=require('fs');var path=require(_0x0c31('0x4'));var rimraf=require(_0x0c31('0x5'));var config=require(_0x0c31('0x6'));var attributes=require(_0x0c31('0x7'));module['exports']=function(_0x3d1c62,_0x36e81e){return _0x3d1c62[_0x0c31('0x8')](_0x0c31('0x9'),attributes,{'tableName':_0x0c31('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2cf14a4..8575d2a 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 _0x457e=['error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','UpdateWhatsappQueueReport','body','where','attributes','limit','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x457e,0xa6));var _0xe457=function(_0x4a35c1,_0x282706){_0x4a35c1=_0x4a35c1-0x0;var _0xa8c9e8=_0x457e[_0x4a35c1];return _0xa8c9e8;};'use strict';var _=require(_0xe457('0x0'));var util=require('util');var moment=require(_0xe457('0x1'));var BPromise=require('bluebird');var rs=require(_0xe457('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe457('0x3'));var logger=require(_0xe457('0x4'))('rpc');var config=require(_0xe457('0x5'));var jayson=require(_0xe457('0x6'));var client=jayson[_0xe457('0x7')][_0xe457('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5be516,_0x3da34e,_0x27a3b0){return new BPromise(function(_0x278551,_0x5cc9df){return client[_0xe457('0x9')](_0x5be516,_0x27a3b0)[_0xe457('0xa')](function(_0x14a147){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x3da34e,'request\x20sent');logger[_0xe457('0xb')](_0xe457('0xc'),_0x3da34e,'request\x20sent',JSON[_0xe457('0xd')](_0x14a147));if(_0x14a147[_0xe457('0xe')]){if(_0x14a147[_0xe457('0xe')][_0xe457('0xf')]===0x1f4){logger['error'](_0xe457('0x10'),_0x3da34e,_0x14a147[_0xe457('0xe')]['message']);return _0x5cc9df(_0x14a147[_0xe457('0xe')][_0xe457('0x11')]);}logger[_0xe457('0xe')](_0xe457('0x10'),_0x3da34e,_0x14a147[_0xe457('0xe')][_0xe457('0x11')]);return _0x278551(_0x14a147[_0xe457('0xe')][_0xe457('0x11')]);}else{logger[_0xe457('0x12')](_0xe457('0x10'),_0x3da34e,'request\x20sent');_0x278551(_0x14a147[_0xe457('0x13')][_0xe457('0x11')]);}})[_0xe457('0x14')](function(_0x580d8a){logger[_0xe457('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3da34e,_0x580d8a);_0x5cc9df(_0x580d8a);});});}exports[_0xe457('0x15')]=function(_0x858229){var _0x3614de=this;return new Promise(function(_0x29ce6c,_0x2ca3dd){return db[_0xe457('0x16')]['create'](_0x858229['body'],{'raw':_0x858229[_0xe457('0x17')]?_0x858229['options'][_0xe457('0x18')]===undefined?!![]:![]:!![]})[_0xe457('0xa')](function(_0x43bee3){logger[_0xe457('0x12')]('CreateWhatsappQueueReport',_0x858229);logger[_0xe457('0xb')](_0xe457('0x15'),_0x858229,JSON[_0xe457('0xd')](_0x43bee3));_0x29ce6c(_0x43bee3);})['catch'](function(_0x405d07){logger[_0xe457('0xe')](_0xe457('0x15'),_0x405d07[_0xe457('0x11')],_0x858229);_0x2ca3dd(_0x3614de['error'](0x1f4,_0x405d07[_0xe457('0x11')]));});});};exports[_0xe457('0x19')]=function(_0xb157f7){var _0x126880=this;return new Promise(function(_0x3736a7,_0x54345e){return db['WhatsappQueueReport']['update'](_0xb157f7[_0xe457('0x1a')],{'raw':_0xb157f7[_0xe457('0x17')]?_0xb157f7[_0xe457('0x17')][_0xe457('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb157f7[_0xe457('0x17')]?_0xb157f7[_0xe457('0x17')][_0xe457('0x1b')]||null:null,'attributes':_0xb157f7[_0xe457('0x17')]?_0xb157f7[_0xe457('0x17')][_0xe457('0x1c')]||null:null,'limit':_0xb157f7['options']?_0xb157f7['options'][_0xe457('0x1d')]||null:null})['then'](function(_0x50cb00){logger[_0xe457('0x12')](_0xe457('0x19'),_0xb157f7);logger['debug'](_0xe457('0x19'),_0xb157f7,JSON['stringify'](_0x50cb00));_0x3736a7(_0x50cb00);})[_0xe457('0x14')](function(_0x16b82d){logger[_0xe457('0xe')]('UpdateWhatsappQueueReport',_0x16b82d['message'],_0xb157f7);_0x54345e(_0x126880['error'](0x1f4,_0x16b82d['message']));});});}; \ No newline at end of file +var _0x27ce=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueueReport','create','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes'];(function(_0xd58224,_0x4d5ee6){var _0x5f2a91=function(_0x1fe0bb){while(--_0x1fe0bb){_0xd58224['push'](_0xd58224['shift']());}};_0x5f2a91(++_0x4d5ee6);}(_0x27ce,0x1ad));var _0xe27c=function(_0x2bbaac,_0x3e65e0){_0x2bbaac=_0x2bbaac-0x0;var _0x1843b9=_0x27ce[_0x2bbaac];return _0x1843b9;};'use strict';var _=require(_0xe27c('0x0'));var util=require(_0xe27c('0x1'));var moment=require(_0xe27c('0x2'));var BPromise=require(_0xe27c('0x3'));var rs=require(_0xe27c('0x4'));var fs=require('fs');var Redis=require(_0xe27c('0x5'));var db=require(_0xe27c('0x6'))['db'];var utils=require(_0xe27c('0x7'));var logger=require('../../config/logger')(_0xe27c('0x8'));var config=require(_0xe27c('0x9'));var jayson=require(_0xe27c('0xa'));var client=jayson[_0xe27c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9a8b,_0x42eab4,_0x3d741f){return new BPromise(function(_0x2cacaa,_0x41e56e){return client[_0xe27c('0xc')](_0x2b9a8b,_0x3d741f)[_0xe27c('0xd')](function(_0x46d10a){logger[_0xe27c('0xe')](_0xe27c('0xf'),_0x42eab4,_0xe27c('0x10'));logger[_0xe27c('0x11')](_0xe27c('0x12'),_0x42eab4,_0xe27c('0x10'),JSON[_0xe27c('0x13')](_0x46d10a));if(_0x46d10a['error']){if(_0x46d10a[_0xe27c('0x14')][_0xe27c('0x15')]===0x1f4){logger[_0xe27c('0x14')](_0xe27c('0xf'),_0x42eab4,_0x46d10a[_0xe27c('0x14')]['message']);return _0x41e56e(_0x46d10a[_0xe27c('0x14')][_0xe27c('0x16')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x42eab4,_0x46d10a[_0xe27c('0x14')][_0xe27c('0x16')]);return _0x2cacaa(_0x46d10a[_0xe27c('0x14')][_0xe27c('0x16')]);}else{logger['info'](_0xe27c('0xf'),_0x42eab4,'request\x20sent');_0x2cacaa(_0x46d10a[_0xe27c('0x17')]['message']);}})[_0xe27c('0x18')](function(_0x404ddb){logger[_0xe27c('0x14')](_0xe27c('0xf'),_0x42eab4,_0x404ddb);_0x41e56e(_0x404ddb);});});}exports['CreateWhatsappQueueReport']=function(_0x5e729c){var _0x137094=this;return new Promise(function(_0x2809fb,_0x4d3baf){return db[_0xe27c('0x19')][_0xe27c('0x1a')](_0x5e729c['body'],{'raw':_0x5e729c[_0xe27c('0x1b')]?_0x5e729c[_0xe27c('0x1b')][_0xe27c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1de91c){logger[_0xe27c('0xe')]('CreateWhatsappQueueReport',_0x5e729c);logger[_0xe27c('0x11')](_0xe27c('0x1d'),_0x5e729c,JSON[_0xe27c('0x13')](_0x1de91c));_0x2809fb(_0x1de91c);})[_0xe27c('0x18')](function(_0x72a546){logger[_0xe27c('0x14')](_0xe27c('0x1d'),_0x72a546[_0xe27c('0x16')],_0x5e729c);_0x4d3baf(_0x137094[_0xe27c('0x14')](0x1f4,_0x72a546['message']));});});};exports[_0xe27c('0x1e')]=function(_0x4e25c2){var _0x284cde=this;return new Promise(function(_0x46de8e,_0x139878){return db['WhatsappQueueReport'][_0xe27c('0x1f')](_0x4e25c2['body'],{'raw':_0x4e25c2[_0xe27c('0x1b')]?_0x4e25c2[_0xe27c('0x1b')][_0xe27c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e25c2[_0xe27c('0x1b')]?_0x4e25c2[_0xe27c('0x1b')]['where']||null:null,'attributes':_0x4e25c2[_0xe27c('0x1b')]?_0x4e25c2[_0xe27c('0x1b')][_0xe27c('0x20')]||null:null,'limit':_0x4e25c2[_0xe27c('0x1b')]?_0x4e25c2[_0xe27c('0x1b')]['limit']||null:null})[_0xe27c('0xd')](function(_0x450123){logger[_0xe27c('0xe')](_0xe27c('0x1e'),_0x4e25c2);logger[_0xe27c('0x11')](_0xe27c('0x1e'),_0x4e25c2,JSON[_0xe27c('0x13')](_0x450123));_0x46de8e(_0x450123);})['catch'](function(_0x5b747b){logger[_0xe27c('0x14')](_0xe27c('0x1e'),_0x5b747b['message'],_0x4e25c2);_0x139878(_0x284cde['error'](0x1f4,_0x5b747b[_0xe27c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 54d0051..41149c9 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 _0xe72f=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0xe72f,0x102));var _0xfe72=function(_0x222cfe,_0x5387c1){_0x222cfe=_0x222cfe-0x0;var _0x560a59=_0xe72f[_0x222cfe];return _0x560a59;};'use strict';var multer=require('multer');var util=require(_0xfe72('0x0'));var path=require(_0xfe72('0x1'));var timeout=require(_0xfe72('0x2'));var express=require(_0xfe72('0x3'));var router=express[_0xfe72('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfe72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe72('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0xfe72('0x7')]('/',auth[_0xfe72('0x8')](),controller[_0xfe72('0x9')]);router[_0xfe72('0x7')](_0xfe72('0xa'),auth[_0xfe72('0x8')](),controller[_0xfe72('0xb')]);router[_0xfe72('0x7')](_0xfe72('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfe72('0xd')]('/',auth[_0xfe72('0x8')](),controller['create']);router['put'](_0xfe72('0xc'),auth[_0xfe72('0x8')](),controller[_0xfe72('0xe')]);router[_0xfe72('0xf')](_0xfe72('0xc'),auth[_0xfe72('0x8')](),controller[_0xfe72('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa404=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','util'];(function(_0x30637e,_0x3bca9c){var _0x48ab4d=function(_0x21a79b){while(--_0x21a79b){_0x30637e['push'](_0x30637e['shift']());}};_0x48ab4d(++_0x3bca9c);}(_0xa404,0x15f));var _0x4a40=function(_0x35b76f,_0x38adf0){_0x35b76f=_0x35b76f-0x0;var _0x3e8b02=_0xa404[_0x35b76f];return _0x3e8b02;};'use strict';var multer=require('multer');var util=require(_0x4a40('0x0'));var path=require(_0x4a40('0x1'));var timeout=require(_0x4a40('0x2'));var express=require(_0x4a40('0x3'));var router=express[_0x4a40('0x4')]();var fs_extra=require(_0x4a40('0x5'));var auth=require(_0x4a40('0x6'));var interaction=require(_0x4a40('0x7'));var config=require(_0x4a40('0x8'));var controller=require(_0x4a40('0x9'));router[_0x4a40('0xa')]('/',auth['isAuthenticated'](),controller[_0x4a40('0xb')]);router[_0x4a40('0xa')]('/describe',auth[_0x4a40('0xc')](),controller[_0x4a40('0xd')]);router[_0x4a40('0xa')](_0x4a40('0xe'),auth[_0x4a40('0xc')](),controller['show']);router[_0x4a40('0xf')]('/',auth[_0x4a40('0xc')](),controller[_0x4a40('0x10')]);router[_0x4a40('0x11')](_0x4a40('0xe'),auth[_0x4a40('0xc')](),controller[_0x4a40('0x12')]);router[_0x4a40('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4a40('0x14')]);module[_0x4a40('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 98d4e1b..8691dd5 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 _0xb627=['ENUM','agent','queue','DATE','sequelize'];(function(_0x3e91a6,_0x3339e8){var _0x2e6f31=function(_0x432185){while(--_0x432185){_0x3e91a6['push'](_0x3e91a6['shift']());}};_0x2e6f31(++_0x3339e8);}(_0xb627,0x144));var _0x7b62=function(_0x57d083,_0x2da924){_0x57d083=_0x57d083-0x0;var _0x40f5cd=_0xb627[_0x57d083];return _0x40f5cd;};'use strict';var Sequelize=require(_0x7b62('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b62('0x1')]('account',_0x7b62('0x2'),_0x7b62('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7b62('0x4')]}}; \ No newline at end of file +var _0x56bd=['STRING','ENUM','agent','queue','DATE','exports'];(function(_0x3d3b13,_0x5120aa){var _0x6d2d50=function(_0x20d092){while(--_0x20d092){_0x3d3b13['push'](_0x3d3b13['shift']());}};_0x6d2d50(++_0x5120aa);}(_0x56bd,0xe9));var _0xd56b=function(_0x45cac2,_0x510fd4){_0x45cac2=_0x45cac2-0x0;var _0x3a1dd5=_0x56bd[_0x45cac2];return _0x3a1dd5;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'uniqueid':{'type':Sequelize[_0xd56b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd56b('0x2')]('account',_0xd56b('0x3'),_0xd56b('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd56b('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 9cd2e67..c7a91cf 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 _0xbccd=['ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','WhatsappTransferReport','includeAll','rows','catch','show','include','merge','find','create','body','update','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv'];(function(_0x4a64d5,_0x271549){var _0x4e721a=function(_0x54011e){while(--_0x54011e){_0x4a64d5['push'](_0x4a64d5['shift']());}};_0x4e721a(++_0x271549);}(_0xbccd,0xd8));var _0xdbcc=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xbccd[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0xdbcc('0x0'));var rimraf=require(_0xdbcc('0x1'));var zipdir=require(_0xdbcc('0x2'));var jsonpatch=require(_0xdbcc('0x3'));var rp=require('request-promise');var moment=require(_0xdbcc('0x4'));var BPromise=require(_0xdbcc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdbcc('0x6'));var sox=require(_0xdbcc('0x7'));var csv=require(_0xdbcc('0x8'));var ejs=require(_0xdbcc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdbcc('0xa'));var crypto=require(_0xdbcc('0xb'));var jsforce=require(_0xdbcc('0xc'));var deskjs=require(_0xdbcc('0xd'));var toCsv=require(_0xdbcc('0x8'));var querystring=require(_0xdbcc('0xe'));var Papa=require('papaparse');var Redis=require(_0xdbcc('0xf'));var authService=require(_0xdbcc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbcc('0x11'));var logger=require('../../config/logger')(_0xdbcc('0x12'));var utils=require(_0xdbcc('0x13'));var config=require(_0xdbcc('0x14'));var licenseUtil=require(_0xdbcc('0x15'));var db=require(_0xdbcc('0x16'))['db'];function respondWithStatusCode(_0x3b0113,_0xc9253a){_0xc9253a=_0xc9253a||0xcc;return function(_0x550a2d){if(_0x550a2d){return _0x3b0113[_0xdbcc('0x17')](_0xc9253a);}return _0x3b0113[_0xdbcc('0x18')](_0xc9253a)[_0xdbcc('0x19')]();};}function respondWithResult(_0x4886ce,_0x15c804){_0x15c804=_0x15c804||0xc8;return function(_0xcc2ceb){if(_0xcc2ceb){return _0x4886ce[_0xdbcc('0x18')](_0x15c804)[_0xdbcc('0x1a')](_0xcc2ceb);}};}function respondWithFilteredResult(_0x53fe13,_0x725d3c){return function(_0x337fa8){if(_0x337fa8){var _0x292fe9=typeof _0x725d3c['offset']===_0xdbcc('0x1b')&&typeof _0x725d3c[_0xdbcc('0x1c')]===_0xdbcc('0x1b');var _0x19b097=_0x337fa8['count'];var _0x33ca24=_0x292fe9?0x0:_0x725d3c['offset'];var _0x3f2e68=_0x292fe9?_0x337fa8[_0xdbcc('0x1d')]:_0x725d3c[_0xdbcc('0x1e')]+_0x725d3c[_0xdbcc('0x1c')];var _0x390e42;if(_0x3f2e68>=_0x19b097){_0x3f2e68=_0x19b097;_0x390e42=0xc8;}else{_0x390e42=0xce;}_0x53fe13[_0xdbcc('0x18')](_0x390e42);return _0x53fe13[_0xdbcc('0x1f')](_0xdbcc('0x20'),_0x33ca24+'-'+_0x3f2e68+'/'+_0x19b097)[_0xdbcc('0x1a')](_0x337fa8);}return null;};}function patchUpdates(_0x10a999){return function(_0x465066){try{jsonpatch[_0xdbcc('0x21')](_0x465066,_0x10a999,!![]);}catch(_0x3b78fe){return BPromise[_0xdbcc('0x22')](_0x3b78fe);}return _0x465066[_0xdbcc('0x23')]();};}function saveUpdates(_0x543bc3,_0x1e9a70){return function(_0x2cb05e){if(_0x2cb05e){return _0x2cb05e['update'](_0x543bc3)['then'](function(_0x14e2a7){return _0x14e2a7;});}return null;};}function removeEntity(_0x31e6d5,_0x49a0e4){return function(_0x31f805){if(_0x31f805){return _0x31f805['destroy']()[_0xdbcc('0x24')](function(){_0x31e6d5[_0xdbcc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c3f95,_0x55165a){return function(_0x35e91b){if(!_0x35e91b){_0x3c3f95[_0xdbcc('0x17')](0x194);}return _0x35e91b;};}function handleError(_0x5d9479,_0x4e9b12){_0x4e9b12=_0x4e9b12||0x1f4;return function(_0x3278d4){logger[_0xdbcc('0x25')](_0x3278d4[_0xdbcc('0x26')]);if(_0x3278d4['name']){delete _0x3278d4[_0xdbcc('0x27')];}_0x5d9479[_0xdbcc('0x18')](_0x4e9b12)['send'](_0x3278d4);};}exports['index']=function(_0x2a5147,_0x4c7e8a){var _0x5352ae={},_0x49ff5c={},_0x417eb9={'count':0x0,'rows':[]};var _0x3d941b=_['map'](db['WhatsappTransferReport'][_0xdbcc('0x28')],function(_0x205a8d){return{'name':_0x205a8d[_0xdbcc('0x29')],'type':_0x205a8d[_0xdbcc('0x2a')][_0xdbcc('0x2b')]};});_0x49ff5c[_0xdbcc('0x2c')]=_[_0xdbcc('0x2d')](_0x3d941b,_0xdbcc('0x27'));_0x49ff5c[_0xdbcc('0x2e')]=_[_0xdbcc('0x2f')](_0x2a5147[_0xdbcc('0x2e')]);_0x49ff5c[_0xdbcc('0x30')]=_[_0xdbcc('0x31')](_0x49ff5c[_0xdbcc('0x2c')],_0x49ff5c[_0xdbcc('0x2e')]);_0x5352ae[_0xdbcc('0x32')]=_['intersection'](_0x49ff5c[_0xdbcc('0x2c')],qs[_0xdbcc('0x33')](_0x2a5147['query']['fields']));_0x5352ae['attributes']=_0x5352ae['attributes'][_0xdbcc('0x34')]?_0x5352ae[_0xdbcc('0x32')]:_0x49ff5c[_0xdbcc('0x2c')];if(!_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x35')](_0xdbcc('0x36'))){_0x5352ae[_0xdbcc('0x1c')]=qs[_0xdbcc('0x1c')](_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x1c')]);_0x5352ae['offset']=qs[_0xdbcc('0x1e')](_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x1e')]);}_0x5352ae[_0xdbcc('0x37')]=qs[_0xdbcc('0x38')](_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x38')]);_0x5352ae[_0xdbcc('0x39')]=qs['filters'](_[_0xdbcc('0x3a')](_0x2a5147[_0xdbcc('0x2e')],_0x49ff5c[_0xdbcc('0x30')]),_0x3d941b);if(_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x3b')]){_0x5352ae[_0xdbcc('0x39')]=_['merge'](_0x5352ae[_0xdbcc('0x39')],{'$or':_[_0xdbcc('0x2d')](_0x3d941b,function(_0x2aa404){if(_0x2aa404[_0xdbcc('0x2a')]!=='VIRTUAL'){var _0xcdec36={};_0xcdec36[_0x2aa404[_0xdbcc('0x27')]]={'$like':'%'+_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x3b')]+'%'};return _0xcdec36;}})});}_0x5352ae=_['merge']({},_0x5352ae,_0x2a5147[_0xdbcc('0x3c')]);var _0x57a443={'where':_0x5352ae[_0xdbcc('0x39')]};return db[_0xdbcc('0x3d')][_0xdbcc('0x1d')](_0x57a443)[_0xdbcc('0x24')](function(_0x6eb132){_0x417eb9['count']=_0x6eb132;if(_0x2a5147[_0xdbcc('0x2e')][_0xdbcc('0x3e')]){_0x5352ae['include']=[{'all':!![]}];}return db[_0xdbcc('0x3d')]['findAll'](_0x5352ae);})['then'](function(_0x4a9a0a){_0x417eb9[_0xdbcc('0x3f')]=_0x4a9a0a;return _0x417eb9;})[_0xdbcc('0x24')](respondWithFilteredResult(_0x4c7e8a,_0x5352ae))[_0xdbcc('0x40')](handleError(_0x4c7e8a,null));};exports[_0xdbcc('0x41')]=function(_0x7190ca,_0xb4f575){var _0x584030={'raw':!![],'where':{'id':_0x7190ca['params']['id']}},_0x362ba3={};_0x362ba3[_0xdbcc('0x2c')]=_['keys'](db['WhatsappTransferReport'][_0xdbcc('0x28')]);_0x362ba3[_0xdbcc('0x2e')]=_[_0xdbcc('0x2f')](_0x7190ca['query']);_0x362ba3[_0xdbcc('0x30')]=_['intersection'](_0x362ba3['model'],_0x362ba3['query']);_0x584030[_0xdbcc('0x32')]=_[_0xdbcc('0x31')](_0x362ba3['model'],qs['fields'](_0x7190ca[_0xdbcc('0x2e')][_0xdbcc('0x33')]));_0x584030[_0xdbcc('0x32')]=_0x584030[_0xdbcc('0x32')][_0xdbcc('0x34')]?_0x584030[_0xdbcc('0x32')]:_0x362ba3[_0xdbcc('0x2c')];if(_0x7190ca[_0xdbcc('0x2e')][_0xdbcc('0x3e')]){_0x584030[_0xdbcc('0x42')]=[{'all':!![]}];}_0x584030=_[_0xdbcc('0x43')]({},_0x584030,_0x7190ca[_0xdbcc('0x3c')]);return db[_0xdbcc('0x3d')][_0xdbcc('0x44')](_0x584030)['then'](handleEntityNotFound(_0xb4f575,null))[_0xdbcc('0x24')](respondWithResult(_0xb4f575,null))[_0xdbcc('0x40')](handleError(_0xb4f575,null));};exports[_0xdbcc('0x45')]=function(_0x4a590b,_0x409a70){return db[_0xdbcc('0x3d')][_0xdbcc('0x45')](_0x4a590b[_0xdbcc('0x46')],{})[_0xdbcc('0x24')](respondWithResult(_0x409a70,0xc9))[_0xdbcc('0x40')](handleError(_0x409a70,null));};exports[_0xdbcc('0x47')]=function(_0x581faf,_0x123909){if(_0x581faf[_0xdbcc('0x46')]['id']){delete _0x581faf[_0xdbcc('0x46')]['id'];}return db[_0xdbcc('0x3d')][_0xdbcc('0x44')]({'where':{'id':_0x581faf[_0xdbcc('0x48')]['id']}})[_0xdbcc('0x24')](handleEntityNotFound(_0x123909,null))[_0xdbcc('0x24')](saveUpdates(_0x581faf[_0xdbcc('0x46')],null))[_0xdbcc('0x24')](respondWithResult(_0x123909,null))[_0xdbcc('0x40')](handleError(_0x123909,null));};exports[_0xdbcc('0x49')]=function(_0x4fdb0e,_0x156ca9){return db[_0xdbcc('0x3d')][_0xdbcc('0x44')]({'where':{'id':_0x4fdb0e['params']['id']}})[_0xdbcc('0x24')](handleEntityNotFound(_0x156ca9,null))[_0xdbcc('0x24')](removeEntity(_0x156ca9,null))[_0xdbcc('0x40')](handleError(_0x156ca9,null));};exports[_0xdbcc('0x4a')]=function(_0x50b49b,_0x1f7695){return db['WhatsappTransferReport'][_0xdbcc('0x4a')]()[_0xdbcc('0x24')](respondWithResult(_0x1f7695,null))[_0xdbcc('0x40')](handleError(_0x1f7695,null));}; \ No newline at end of file +var _0xac35=['find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','length','sort','where','filters','filter','merge','type','VIRTUAL','options','WhatsappTransferReport','findAll','rows','catch','show','params','includeAll','include'];(function(_0x3d02c0,_0x4807a6){var _0x218f36=function(_0x216f7a){while(--_0x216f7a){_0x3d02c0['push'](_0x3d02c0['shift']());}};_0x218f36(++_0x4807a6);}(_0xac35,0x141));var _0x5ac3=function(_0x4f2ba1,_0x5b3257){_0x4f2ba1=_0x4f2ba1-0x0;var _0x73778e=_0xac35[_0x4f2ba1];return _0x73778e;};'use strict';var emlformat=require(_0x5ac3('0x0'));var rimraf=require(_0x5ac3('0x1'));var zipdir=require(_0x5ac3('0x2'));var jsonpatch=require(_0x5ac3('0x3'));var rp=require(_0x5ac3('0x4'));var moment=require(_0x5ac3('0x5'));var BPromise=require(_0x5ac3('0x6'));var Mustache=require(_0x5ac3('0x7'));var util=require(_0x5ac3('0x8'));var path=require(_0x5ac3('0x9'));var sox=require(_0x5ac3('0xa'));var csv=require(_0x5ac3('0xb'));var ejs=require(_0x5ac3('0xc'));var fs=require('fs');var fs_extra=require(_0x5ac3('0xd'));var _=require('lodash');var squel=require(_0x5ac3('0xe'));var crypto=require('crypto');var jsforce=require(_0x5ac3('0xf'));var deskjs=require(_0x5ac3('0x10'));var toCsv=require(_0x5ac3('0xb'));var querystring=require(_0x5ac3('0x11'));var Papa=require(_0x5ac3('0x12'));var Redis=require(_0x5ac3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5ac3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ac3('0x15'));var logger=require(_0x5ac3('0x16'))(_0x5ac3('0x17'));var utils=require(_0x5ac3('0x18'));var config=require(_0x5ac3('0x19'));var licenseUtil=require(_0x5ac3('0x1a'));var db=require(_0x5ac3('0x1b'))['db'];function respondWithStatusCode(_0x5921c6,_0x19ed64){_0x19ed64=_0x19ed64||0xcc;return function(_0x2f1c67){if(_0x2f1c67){return _0x5921c6[_0x5ac3('0x1c')](_0x19ed64);}return _0x5921c6[_0x5ac3('0x1d')](_0x19ed64)[_0x5ac3('0x1e')]();};}function respondWithResult(_0x24ed02,_0x1961f3){_0x1961f3=_0x1961f3||0xc8;return function(_0x2aaf5c){if(_0x2aaf5c){return _0x24ed02['status'](_0x1961f3)['json'](_0x2aaf5c);}};}function respondWithFilteredResult(_0x3926d0,_0x388da8){return function(_0x516c97){if(_0x516c97){var _0x2eec4a=typeof _0x388da8['offset']===_0x5ac3('0x1f')&&typeof _0x388da8[_0x5ac3('0x20')]===_0x5ac3('0x1f');var _0x5bfde8=_0x516c97[_0x5ac3('0x21')];var _0x1c2566=_0x2eec4a?0x0:_0x388da8[_0x5ac3('0x22')];var _0x141128=_0x2eec4a?_0x516c97['count']:_0x388da8[_0x5ac3('0x22')]+_0x388da8[_0x5ac3('0x20')];var _0x16ca9a;if(_0x141128>=_0x5bfde8){_0x141128=_0x5bfde8;_0x16ca9a=0xc8;}else{_0x16ca9a=0xce;}_0x3926d0[_0x5ac3('0x1d')](_0x16ca9a);return _0x3926d0[_0x5ac3('0x23')](_0x5ac3('0x24'),_0x1c2566+'-'+_0x141128+'/'+_0x5bfde8)[_0x5ac3('0x25')](_0x516c97);}return null;};}function patchUpdates(_0x2fcc26){return function(_0x26f446){try{jsonpatch[_0x5ac3('0x26')](_0x26f446,_0x2fcc26,!![]);}catch(_0xe65817){return BPromise[_0x5ac3('0x27')](_0xe65817);}return _0x26f446['save']();};}function saveUpdates(_0x462b1d,_0x3cbb52){return function(_0x14f149){if(_0x14f149){return _0x14f149[_0x5ac3('0x28')](_0x462b1d)['then'](function(_0x11915f){return _0x11915f;});}return null;};}function removeEntity(_0x1e28f6,_0x2aa7c9){return function(_0x3cce67){if(_0x3cce67){return _0x3cce67['destroy']()[_0x5ac3('0x29')](function(){_0x1e28f6['status'](0xcc)[_0x5ac3('0x1e')]();});}};}function handleEntityNotFound(_0x481a72,_0x5e6076){return function(_0x395127){if(!_0x395127){_0x481a72[_0x5ac3('0x1c')](0x194);}return _0x395127;};}function handleError(_0x47d765,_0x24f440){_0x24f440=_0x24f440||0x1f4;return function(_0x3912f6){logger[_0x5ac3('0x2a')](_0x3912f6[_0x5ac3('0x2b')]);if(_0x3912f6['name']){delete _0x3912f6[_0x5ac3('0x2c')];}_0x47d765[_0x5ac3('0x1d')](_0x24f440)[_0x5ac3('0x2d')](_0x3912f6);};}exports[_0x5ac3('0x2e')]=function(_0x84eeb4,_0xf37646){var _0x136862={},_0x5a1486={},_0x2388b8={'count':0x0,'rows':[]};var _0x1b05b5=_[_0x5ac3('0x2f')](db['WhatsappTransferReport'][_0x5ac3('0x30')],function(_0x470090){return{'name':_0x470090[_0x5ac3('0x31')],'type':_0x470090['type'][_0x5ac3('0x32')]};});_0x5a1486['model']=_[_0x5ac3('0x2f')](_0x1b05b5,'name');_0x5a1486[_0x5ac3('0x33')]=_[_0x5ac3('0x34')](_0x84eeb4['query']);_0x5a1486['filters']=_['intersection'](_0x5a1486[_0x5ac3('0x35')],_0x5a1486[_0x5ac3('0x33')]);_0x136862['attributes']=_[_0x5ac3('0x36')](_0x5a1486[_0x5ac3('0x35')],qs[_0x5ac3('0x37')](_0x84eeb4[_0x5ac3('0x33')][_0x5ac3('0x37')]));_0x136862[_0x5ac3('0x38')]=_0x136862['attributes'][_0x5ac3('0x39')]?_0x136862[_0x5ac3('0x38')]:_0x5a1486[_0x5ac3('0x35')];if(!_0x84eeb4[_0x5ac3('0x33')]['hasOwnProperty']('nolimit')){_0x136862[_0x5ac3('0x20')]=qs['limit'](_0x84eeb4[_0x5ac3('0x33')][_0x5ac3('0x20')]);_0x136862['offset']=qs[_0x5ac3('0x22')](_0x84eeb4['query'][_0x5ac3('0x22')]);}_0x136862['order']=qs['sort'](_0x84eeb4[_0x5ac3('0x33')][_0x5ac3('0x3a')]);_0x136862[_0x5ac3('0x3b')]=qs[_0x5ac3('0x3c')](_['pick'](_0x84eeb4[_0x5ac3('0x33')],_0x5a1486['filters']),_0x1b05b5);if(_0x84eeb4[_0x5ac3('0x33')][_0x5ac3('0x3d')]){_0x136862[_0x5ac3('0x3b')]=_[_0x5ac3('0x3e')](_0x136862[_0x5ac3('0x3b')],{'$or':_['map'](_0x1b05b5,function(_0x469268){if(_0x469268[_0x5ac3('0x3f')]!==_0x5ac3('0x40')){var _0x4074d7={};_0x4074d7[_0x469268[_0x5ac3('0x2c')]]={'$like':'%'+_0x84eeb4[_0x5ac3('0x33')][_0x5ac3('0x3d')]+'%'};return _0x4074d7;}})});}_0x136862=_[_0x5ac3('0x3e')]({},_0x136862,_0x84eeb4[_0x5ac3('0x41')]);var _0x5cba25={'where':_0x136862[_0x5ac3('0x3b')]};return db[_0x5ac3('0x42')][_0x5ac3('0x21')](_0x5cba25)[_0x5ac3('0x29')](function(_0x5bd8e6){_0x2388b8[_0x5ac3('0x21')]=_0x5bd8e6;if(_0x84eeb4[_0x5ac3('0x33')]['includeAll']){_0x136862['include']=[{'all':!![]}];}return db[_0x5ac3('0x42')][_0x5ac3('0x43')](_0x136862);})[_0x5ac3('0x29')](function(_0x4f8984){_0x2388b8[_0x5ac3('0x44')]=_0x4f8984;return _0x2388b8;})[_0x5ac3('0x29')](respondWithFilteredResult(_0xf37646,_0x136862))[_0x5ac3('0x45')](handleError(_0xf37646,null));};exports[_0x5ac3('0x46')]=function(_0x42579b,_0x3b1a3c){var _0x3663c9={'raw':!![],'where':{'id':_0x42579b[_0x5ac3('0x47')]['id']}},_0x241652={};_0x241652[_0x5ac3('0x35')]=_[_0x5ac3('0x34')](db[_0x5ac3('0x42')][_0x5ac3('0x30')]);_0x241652['query']=_['keys'](_0x42579b['query']);_0x241652['filters']=_['intersection'](_0x241652['model'],_0x241652[_0x5ac3('0x33')]);_0x3663c9[_0x5ac3('0x38')]=_[_0x5ac3('0x36')](_0x241652['model'],qs[_0x5ac3('0x37')](_0x42579b[_0x5ac3('0x33')][_0x5ac3('0x37')]));_0x3663c9[_0x5ac3('0x38')]=_0x3663c9[_0x5ac3('0x38')]['length']?_0x3663c9[_0x5ac3('0x38')]:_0x241652[_0x5ac3('0x35')];if(_0x42579b[_0x5ac3('0x33')][_0x5ac3('0x48')]){_0x3663c9[_0x5ac3('0x49')]=[{'all':!![]}];}_0x3663c9=_['merge']({},_0x3663c9,_0x42579b[_0x5ac3('0x41')]);return db[_0x5ac3('0x42')][_0x5ac3('0x4a')](_0x3663c9)[_0x5ac3('0x29')](handleEntityNotFound(_0x3b1a3c,null))['then'](respondWithResult(_0x3b1a3c,null))[_0x5ac3('0x45')](handleError(_0x3b1a3c,null));};exports[_0x5ac3('0x4b')]=function(_0xba49dd,_0x47332a){return db['WhatsappTransferReport'][_0x5ac3('0x4b')](_0xba49dd[_0x5ac3('0x4c')],{})[_0x5ac3('0x29')](respondWithResult(_0x47332a,0xc9))[_0x5ac3('0x45')](handleError(_0x47332a,null));};exports[_0x5ac3('0x28')]=function(_0x3a421f,_0x6293c3){if(_0x3a421f['body']['id']){delete _0x3a421f['body']['id'];}return db[_0x5ac3('0x42')][_0x5ac3('0x4a')]({'where':{'id':_0x3a421f[_0x5ac3('0x47')]['id']}})[_0x5ac3('0x29')](handleEntityNotFound(_0x6293c3,null))[_0x5ac3('0x29')](saveUpdates(_0x3a421f['body'],null))['then'](respondWithResult(_0x6293c3,null))[_0x5ac3('0x45')](handleError(_0x6293c3,null));};exports[_0x5ac3('0x4d')]=function(_0x45b054,_0xd5666c){return db[_0x5ac3('0x42')][_0x5ac3('0x4a')]({'where':{'id':_0x45b054['params']['id']}})[_0x5ac3('0x29')](handleEntityNotFound(_0xd5666c,null))[_0x5ac3('0x29')](removeEntity(_0xd5666c,null))[_0x5ac3('0x45')](handleError(_0xd5666c,null));};exports[_0x5ac3('0x4e')]=function(_0x4a2d9e,_0x271ecb){return db[_0x5ac3('0x42')][_0x5ac3('0x4e')]()['then'](respondWithResult(_0x271ecb,null))['catch'](handleError(_0x271ecb,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b83dc50..5c369b2 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 _0xce4c=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','bluebird','request-promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xce4c,0x19c));var _0xcce4=function(_0x56922f,_0x2a69ef){_0x56922f=_0x56922f-0x0;var _0x1afa72=_0xce4c[_0x56922f];return _0x1afa72;};'use strict';var _=require('lodash');var util=require(_0xcce4('0x0'));var logger=require(_0xcce4('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcce4('0x2'));var rp=require(_0xcce4('0x3'));var fs=require('fs');var path=require(_0xcce4('0x4'));var rimraf=require(_0xcce4('0x5'));var config=require(_0xcce4('0x6'));var attributes=require(_0xcce4('0x7'));module[_0xcce4('0x8')]=function(_0x4d1024,_0x44767d){return _0x4d1024[_0xcce4('0x9')](_0xcce4('0xa'),attributes,{'tableName':_0xcce4('0xb'),'paranoid':![],'indexes':[{'name':_0xcce4('0xc'),'fields':[_0xcce4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe224=['request-promise','path','rimraf','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x98461f,_0x16f9b9){var _0x129da4=function(_0x143eaf){while(--_0x143eaf){_0x98461f['push'](_0x98461f['shift']());}};_0x129da4(++_0x16f9b9);}(_0xe224,0xed));var _0x4e22=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe224[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4e22('0x0'));var util=require(_0x4e22('0x1'));var logger=require(_0x4e22('0x2'))(_0x4e22('0x3'));var moment=require(_0x4e22('0x4'));var BPromise=require('bluebird');var rp=require(_0x4e22('0x5'));var fs=require('fs');var path=require(_0x4e22('0x6'));var rimraf=require(_0x4e22('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x41c316,_0x4e8790){return _0x41c316['define'](_0x4e22('0x8'),attributes,{'tableName':_0x4e22('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4e22('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 68ab749..e126715 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 _0x42ef=['stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x42ef,0x147));var _0xf42e=function(_0x341736,_0x435bc9){_0x341736=_0x341736-0x0;var _0x3536a6=_0x42ef[_0x341736];return _0x3536a6;};'use strict';var _=require(_0xf42e('0x0'));var util=require(_0xf42e('0x1'));var moment=require('moment');var BPromise=require(_0xf42e('0x2'));var rs=require(_0xf42e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf42e('0x4'))['db'];var utils=require(_0xf42e('0x5'));var logger=require(_0xf42e('0x6'))(_0xf42e('0x7'));var config=require(_0xf42e('0x8'));var jayson=require(_0xf42e('0x9'));var client=jayson[_0xf42e('0xa')][_0xf42e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ea46,_0x9b691d,_0x265e9a){return new BPromise(function(_0x236b7b,_0x36223e){return client[_0xf42e('0xc')](_0x19ea46,_0x265e9a)[_0xf42e('0xd')](function(_0x385b65){logger[_0xf42e('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x9b691d,'request\x20sent');logger[_0xf42e('0xf')](_0xf42e('0x10'),_0x9b691d,_0xf42e('0x11'),JSON[_0xf42e('0x12')](_0x385b65));if(_0x385b65[_0xf42e('0x13')]){if(_0x385b65[_0xf42e('0x13')]['code']===0x1f4){logger[_0xf42e('0x13')](_0xf42e('0x14'),_0x9b691d,_0x385b65['error']['message']);return _0x36223e(_0x385b65[_0xf42e('0x13')][_0xf42e('0x15')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x9b691d,_0x385b65[_0xf42e('0x13')][_0xf42e('0x15')]);return _0x236b7b(_0x385b65[_0xf42e('0x13')][_0xf42e('0x15')]);}else{logger[_0xf42e('0xe')](_0xf42e('0x14'),_0x9b691d,_0xf42e('0x11'));_0x236b7b(_0x385b65['result'][_0xf42e('0x15')]);}})[_0xf42e('0x16')](function(_0x3f09ce){logger['error'](_0xf42e('0x14'),_0x9b691d,_0x3f09ce);_0x36223e(_0x3f09ce);});});} \ No newline at end of file +var _0x43d1=['code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x43d1,0x130));var _0x143d=function(_0x2cc61a,_0x4fee7e){_0x2cc61a=_0x2cc61a-0x0;var _0x2a1527=_0x43d1[_0x2cc61a];return _0x2a1527;};'use strict';var _=require(_0x143d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x143d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x143d('0x2'))['db'];var utils=require(_0x143d('0x3'));var logger=require(_0x143d('0x4'))(_0x143d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x143d('0x6')][_0x143d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d9d26,_0x480cfb,_0x4a410f){return new BPromise(function(_0x25f4c9,_0x1e5c3a){return client[_0x143d('0x8')](_0x2d9d26,_0x4a410f)[_0x143d('0x9')](function(_0x2b64a2){logger['info'](_0x143d('0xa'),_0x480cfb,_0x143d('0xb'));logger[_0x143d('0xc')](_0x143d('0xd'),_0x480cfb,_0x143d('0xb'),JSON[_0x143d('0xe')](_0x2b64a2));if(_0x2b64a2[_0x143d('0xf')]){if(_0x2b64a2[_0x143d('0xf')][_0x143d('0x10')]===0x1f4){logger['error'](_0x143d('0xa'),_0x480cfb,_0x2b64a2['error']['message']);return _0x1e5c3a(_0x2b64a2['error'][_0x143d('0x11')]);}logger['error'](_0x143d('0xa'),_0x480cfb,_0x2b64a2[_0x143d('0xf')][_0x143d('0x11')]);return _0x25f4c9(_0x2b64a2[_0x143d('0xf')][_0x143d('0x11')]);}else{logger['info'](_0x143d('0xa'),_0x480cfb,_0x143d('0xb'));_0x25f4c9(_0x2b64a2[_0x143d('0x12')][_0x143d('0x11')]);}})[_0x143d('0x13')](function(_0x25c18b){logger[_0x143d('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x480cfb,_0x25c18b);_0x1e5c3a(_0x25c18b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index dcff625..a996814 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed5f=['Online\x20apps:','filter','online','join','Offline\x20apps:','status','log','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name'];(function(_0x3cb890,_0x23836d){var _0x1e40c5=function(_0x3b8aa0){while(--_0x3b8aa0){_0x3cb890['push'](_0x3cb890['shift']());}};_0x1e40c5(++_0x23836d);}(_0xed5f,0x1e6));var _0xfed5=function(_0x1978dc,_0x35a0d6){_0x1978dc=_0x1978dc-0x0;var _0x3d4b2f=_0xed5f[_0x1978dc];return _0x3d4b2f;};'use strict';var _=require('lodash');var db=require(_0xfed5('0x0'))['db'];var seedDb=require(_0xfed5('0x1'));var checkLicense=require(_0xfed5('0x2'));var rpc=require('./rpc');var config=require(_0xfed5('0x3'));var logger=require(_0xfed5('0x4'))(_0xfed5('0x5'));var pm2=require(_0xfed5('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xfed5('0x7'));var chat=require(_0xfed5('0x8'));var whatsapp=require(_0xfed5('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xfed5('0xa'));function main(){return db[_0xfed5('0xb')]['sync']()[_0xfed5('0xc')](function(){if(config[_0xfed5('0xd')]){return seedDb[_0xfed5('0xe')]();}})[_0xfed5('0xc')](function(){return checkLicense[_0xfed5('0xe')]();})[_0xfed5('0xc')](function(){return rpc[_0xfed5('0xf')]();})[_0xfed5('0xc')](function(_0x3a68d2){logger[_0xfed5('0x10')](_0x3a68d2);return chat[_0xfed5('0x11')]();})[_0xfed5('0xc')](function(){return whatsapp['start']();})[_0xfed5('0xc')](function(){return schedule[_0xfed5('0x11')]();})[_0xfed5('0xc')](function(){return transcribe[_0xfed5('0x11')]();})['then'](function(){return provider[_0xfed5('0x11')]();})[_0xfed5('0xc')](function(_0x5bdf1e){logger[_0xfed5('0x10')](_0x5bdf1e);return pm2[_0xfed5('0x11')](pm2Config);})[_0xfed5('0xc')](function(_0x17de09){var _0x3eda9e=_0x17de09['filter'](function(_0x152cfa){return typeof _0x152cfa['exitCode']===_0xfed5('0x12')&&_0x152cfa['exitCode']>=0x0;});if(_0x3eda9e[_0xfed5('0x13')]>0x0){throw new Error(_0x3eda9e[_0xfed5('0x13')]+_0xfed5('0x14')+_[_0xfed5('0x15')](_0x3eda9e,function(_0x3a0656){return'\x22'+_0x3a0656[_0xfed5('0x16')][_0xfed5('0x17')]+'\x22';}));}logger[_0xfed5('0x10')](_0xfed5('0x18'),_[_0xfed5('0x15')](_[_0xfed5('0x19')](_0x17de09,{'status':_0xfed5('0x1a')}),_0xfed5('0x17'))[_0xfed5('0x1b')]());logger['info'](_0xfed5('0x1c'),_['map'](_[_0xfed5('0x19')](_0x17de09,function(_0x201f79){return _0x201f79[_0xfed5('0x1d')]!==_0xfed5('0x1a');}),_0xfed5('0x17'))[_0xfed5('0x1b')]()||'None');console[_0xfed5('0x1e')]('App\x20Ready!');})['catch'](function(_0x1e2e7a){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x1e2e7a);logger[_0xfed5('0x1f')](_0xfed5('0x20'),_0x1e2e7a);process[_0xfed5('0x21')](0x1);});}main(); \ No newline at end of file +var _0x9b8e=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','Offline\x20apps:','status','online','join','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','lodash','./config/seedDB','./config/license','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','default','then','info','start','filter','number','exitCode'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x9b8e,0x158));var _0xe9b8=function(_0x55b8ce,_0x3c0a14){_0x55b8ce=_0x55b8ce-0x0;var _0x3e3d38=_0x9b8e[_0x55b8ce];return _0x3e3d38;};'use strict';var _=require(_0xe9b8('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xe9b8('0x1'));var checkLicense=require(_0xe9b8('0x2'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xe9b8('0x3'))('app');var pm2=require(_0xe9b8('0x4'));var pm2Config=require(_0xe9b8('0x5'));var schedule=require('./config/schedule');var chat=require(_0xe9b8('0x6'));var whatsapp=require(_0xe9b8('0x7'));var transcribe=require(_0xe9b8('0x8'));var provider=require(_0xe9b8('0x9'));function main(){return db[_0xe9b8('0xa')][_0xe9b8('0xb')]()['then'](function(){if(config['seedDB']){return seedDb[_0xe9b8('0xc')]();}})[_0xe9b8('0xd')](function(){return checkLicense[_0xe9b8('0xc')]();})[_0xe9b8('0xd')](function(){return rpc['listen']();})[_0xe9b8('0xd')](function(_0x4cb688){logger[_0xe9b8('0xe')](_0x4cb688);return chat[_0xe9b8('0xf')]();})[_0xe9b8('0xd')](function(){return whatsapp[_0xe9b8('0xf')]();})[_0xe9b8('0xd')](function(){return schedule[_0xe9b8('0xf')]();})[_0xe9b8('0xd')](function(){return transcribe[_0xe9b8('0xf')]();})[_0xe9b8('0xd')](function(){return provider[_0xe9b8('0xf')]();})[_0xe9b8('0xd')](function(_0x3c64a3){logger[_0xe9b8('0xe')](_0x3c64a3);return pm2['start'](pm2Config);})['then'](function(_0x568fb9){var _0x4b8772=_0x568fb9[_0xe9b8('0x10')](function(_0x55de79){return typeof _0x55de79['exitCode']===_0xe9b8('0x11')&&_0x55de79[_0xe9b8('0x12')]>=0x0;});if(_0x4b8772[_0xe9b8('0x13')]>0x0){throw new Error(_0x4b8772[_0xe9b8('0x13')]+_0xe9b8('0x14')+_[_0xe9b8('0x15')](_0x4b8772,function(_0x5a58ac){return'\x22'+_0x5a58ac[_0xe9b8('0x16')][_0xe9b8('0x17')]+'\x22';}));}logger[_0xe9b8('0xe')](_0xe9b8('0x18'),_[_0xe9b8('0x15')](_[_0xe9b8('0x10')](_0x568fb9,{'status':'online'}),_0xe9b8('0x17'))['join']());logger[_0xe9b8('0xe')](_0xe9b8('0x19'),_[_0xe9b8('0x15')](_['filter'](_0x568fb9,function(_0x281b6c){return _0x281b6c[_0xe9b8('0x1a')]!==_0xe9b8('0x1b');}),_0xe9b8('0x17'))[_0xe9b8('0x1c')]()||'None');console[_0xe9b8('0x1d')]('App\x20Ready!');})[_0xe9b8('0x1e')](function(_0x6dd4fd){console[_0xe9b8('0x1d')](_0xe9b8('0x1f'),_0x6dd4fd);logger[_0xe9b8('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x6dd4fd);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c70e251..2053ff5 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 _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x55c480,_0x296686){var _0x4e7858=function(_0x44a436){while(--_0x44a436){_0x55c480['push'](_0x55c480['shift']());}};_0x4e7858(++_0x296686);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x458ed6,_0x504646){_0x458ed6=_0x458ed6-0x0;var _0xa5dfd9=_0xf3cd[_0x458ed6];return _0xa5dfd9;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file +var _0xedd9=['crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','authorization','startsWith','headers','Basic','User','find','authenticate','pass','status','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','split','unshift','join','promisify','secrets','payload','verify','hex','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware'];(function(_0x59b189,_0xfa300c){var _0x339aab=function(_0x47bdcc){while(--_0x47bdcc){_0x59b189['push'](_0x59b189['shift']());}};_0x339aab(++_0xfa300c);}(_0xedd9,0xfc));var _0x9edd=function(_0x33430b,_0x44def5){_0x33430b=_0x33430b-0x0;var _0x4c3f39=_0xedd9[_0x33430b];return _0x4c3f39;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9edd('0x0'));var hardwareConf=require(_0x9edd('0x1'));var licenseUtil=require(_0x9edd('0x2'));var encryptor=require(_0x9edd('0x3'));var _=require(_0x9edd('0x4'));var jwt=require(_0x9edd('0x5'));var expressJwt=require(_0x9edd('0x6'));var compose=require(_0x9edd('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0x9edd('0x8'));var BPromise=require(_0x9edd('0x9'));var util=require(_0x9edd('0xa'));var moment=require(_0x9edd('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x9edd('0xc')]});var userAttributes=['id','role',_0x9edd('0xd'),_0x9edd('0xe'),_0x9edd('0xf'),_0x9edd('0x10'),'userpic',_0x9edd('0x11'),'md5secret',_0x9edd('0x12'),_0x9edd('0x13'),'mailPause',_0x9edd('0x14'),_0x9edd('0x15'),'openchannelPause',_0x9edd('0x16'),_0x9edd('0x17'),_0x9edd('0x18'),_0x9edd('0x19'),_0x9edd('0x1a'),_0x9edd('0x1b'),_0x9edd('0x1c'),_0x9edd('0x1d'),'phoneBarAutoAnswer',_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24'),_0x9edd('0x25'),'phoneBarRemoteControlPort',_0x9edd('0x26'),_0x9edd('0x27'),_0x9edd('0x28'),'privacyEnabled',_0x9edd('0x29'),_0x9edd('0x2a'),_0x9edd('0x2b'),'downloadOmnichannelInteractions',_0x9edd('0x2c'),'ignorePauseForPreviewCalls',_0x9edd('0x2d'),_0x9edd('0x2e'),'chatAutoanswerDelay','emailAutoanswer',_0x9edd('0x2f'),'smsAutoanswer',_0x9edd('0x30'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x9edd('0x31'),_0x9edd('0x32'),'whatsappAutoanswer','whatsappAutoanswerDelay'];exports[_0x9edd('0x33')]=function(){return this[_0x9edd('0x34')](!![])[_0x9edd('0x35')](function(_0x542172,_0x3741c8,_0x1dca43){if(_0x542172[_0x9edd('0x36')]){_0x1dca43();}else{return db[_0x9edd('0x37')][_0x9edd('0x38')]({'where':{'id':_0x542172['params']['id']},'attributes':['id',_0x9edd('0x39'),_0x9edd('0x3a')],'raw':!![]})[_0x9edd('0x3b')](function(_0x2f9f86){if(_0x2f9f86&&_0x2f9f86[_0x9edd('0x39')]){return _0x3741c8['status'](_0x2f9f86['disposition']===_0x9edd('0x3c')?0x195:0x193)[_0x9edd('0x3d')]({'message':_0x2f9f86[_0x9edd('0x3a')]===_0x9edd('0x3c')?_0x9edd('0x3e'):'Forbidden.'});}else{_0x1dca43();}})['catch'](function(_0x214d0a){_0x1dca43(_0x214d0a);});}});};exports[_0x9edd('0x34')]=function isAuthenticated(_0x1c762c){return compose()['use'](function(_0x238b22,_0x28cfae,_0x2ae8dd){var _0x41af53;if(_0x238b22['headers'][_0x9edd('0x3f')]){if(_[_0x9edd('0x40')](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x42'))){var _0x42e664=basicAuth(_0x238b22);db[_0x9edd('0x43')][_0x9edd('0x44')]({'where':{'name':_0x42e664[_0x9edd('0xe')]}})[_0x9edd('0x3b')](function(_0x4fd03f){if(!_0x4fd03f||!_0x4fd03f[_0x9edd('0x45')](_0x42e664[_0x9edd('0x46')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':'Wrong\x20credentials.'});}_0x238b22[_0x9edd('0x36')]={'id':_0x4fd03f['id']};_0x2ae8dd();})[_0x9edd('0x48')](function(_0x267c74){_0x2ae8dd(_0x267c74);});}else if(_['startsWith'](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x49'))){validateJwt(_0x238b22,_0x28cfae,_0x2ae8dd);}else{if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':_0x9edd('0x4a')});}}}else if(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')]){try{var _0xd0fd74={'audience':hardwareConf[_0x9edd('0x4d')](),'issuer':hardwareConf[_0x9edd('0x4d')]()};verifyJwt(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')],_0xd0fd74)[_0x9edd('0x3b')](function(_0x5757fc){return db[_0x9edd('0x43')]['find']({'where':{'id':_0x5757fc[_0x9edd('0x4e')]}})[_0x9edd('0x3b')](function(_0x10d6fd){_0x41af53=_0x10d6fd;return db[_0x9edd('0x4f')][_0x9edd('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9edd('0x50')],'raw':!![]});})[_0x9edd('0x3b')](function(_0x2b3469){if(!_0x41af53||!_[_0x9edd('0x51')](_0x41af53[_0x9edd('0x52')],_0x5757fc[_0x9edd('0x53')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x54')});}if(_0x41af53[_0x9edd('0x55')]){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x41af53[_0x9edd('0x56')]){if(_0x2b3469['blockDuration']>0x0){if(moment(_0x41af53[_0x9edd('0x57')])[_0x9edd('0x58')](_0x2b3469[_0x9edd('0x50')],'minutes')>moment()){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});}}else{return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x238b22[_0x9edd('0x36')]={'id':_0x41af53['id']};_0x2ae8dd();});})[_0x9edd('0x48')](function(){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});});}catch(_0x389f51){_0x2ae8dd(_0x389f51);}}else if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)['json']({'message':_0x9edd('0x4a')});}})['use'](function(_0x2bdb3f,_0xc1e657,_0x587d74){if(_0x2bdb3f[_0x9edd('0x36')]){db['User']['find']({'where':{'id':_0x2bdb3f[_0x9edd('0x36')]['id']},'attributes':userAttributes})[_0x9edd('0x3b')](function(_0x1f276b){if(!_0x1f276b){return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5a')});}_0x2bdb3f[_0x9edd('0x36')]=_0x1f276b;_0x587d74();})[_0x9edd('0x48')](function(_0x18c149){_0x587d74(_0x18c149);});}else if(_0x1c762c){_0x587d74();}else{return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5b')});}});};exports[_0x9edd('0x5c')]=function canUpdate(){return compose()[_0x9edd('0x35')](function(_0x46e9f4,_0x5416f8,_0x13197d){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x1e5805){if(_0x1e5805[_0x9edd('0x5e')]){_0x13197d();}else{return _0x5416f8[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})['catch'](function(_0x4bc7a1){_0x13197d(_0x4bc7a1);});});};exports[_0x9edd('0x5f')]=function isWebrtcLicence(){return compose()['use'](function(_0x8b1fdb,_0x19b56b,_0x2b06d3){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x53005b){if(_0x53005b[_0x9edd('0x60')]){_0x2b06d3();}else{return _0x19b56b[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})[_0x9edd('0x48')](function(_0xfd7bd1){_0x2b06d3(_0xfd7bd1);});});};exports[_0x9edd('0x61')]=function(_0x293b03,_0x1d78c4,_0x35bdec){_0x293b03['isMiddleware']=!![];return _0x35bdec();};exports[_0x9edd('0x62')]=function signToken(_0x237e91){return signJwt(_0x237e91);};exports['setTokenCookie']=function(_0xb93816,_0x8d8701){if(!_0xb93816['user']){return _0x8d8701[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x63')});}var _0x5215b0={'payload':{'id':_0xb93816[_0x9edd('0x36')]['id'],'role':_0xb93816[_0x9edd('0x36')][_0x9edd('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5215b0)[_0x9edd('0x3b')](function(_0x53f6e3){_0x8d8701[_0x9edd('0x65')](_0x9edd('0x66'),_0x53f6e3);_0x8d8701[_0x9edd('0x67')]('/dashboards/general');})[_0x9edd('0x48')](function(_0x21f6ce){return _0x8d8701['status'](0x1f4)[_0x9edd('0x68')](_0x21f6ce);});};exports['retrieveApiKey']=function(_0x336494){if(_[_0x9edd('0x69')](_0x336494[_0x9edd('0x52')])||_[_0x9edd('0x69')](_0x336494[_0x9edd('0x6a')])){return null;}else{return createJwt(_0x336494);}};exports[_0x9edd('0x6b')]=function(_0x2334d4){_0x2334d4[_0x9edd('0x52')]=generateNonce();_0x2334d4[_0x9edd('0x6a')]=generateIssuedAt();return createJwt(_0x2334d4);};exports[_0x9edd('0x6c')]=function(_0x31272d,_0x5a3b1d){var _0x161bea=_0x31272d[_0x9edd('0x4b')][_0x9edd('0x4c')];if(_0x161bea){var _0x58fe29={'nonce':_0x5a3b1d[_0x9edd('0x52')],'iat':_0x5a3b1d['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x161bea,_0x58fe29)[_0x9edd('0x3b')](function(){return generateApiKey(_0x5a3b1d);});}else{throw{'message':_0x9edd('0x6d')};}};exports[_0x9edd('0x6e')]=function(_0x35ddb3){var _0x48a900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x48a900['test'](_0x35ddb3))throw new db['Sequelize'][(_0x9edd('0x6f'))](_0x9edd('0x70'));return;};exports[_0x9edd('0x71')]=function(_0x1091ff,_0x2e2920,_0x41ec97){var _0x25906c=encryptor[_0x9edd('0x72')](_0x2e2920)['split'](',');for(var _0x16dfdc=0x0;_0x16dfdc<_0x41ec97;_0x16dfdc++){if(!_0x25906c[_0x16dfdc])break;if(_0x1091ff['toLowerCase']()===_0x25906c[_0x16dfdc][_0x9edd('0x73')]()){var _0x6a1cfc=util['format'](_0x9edd('0x74'),_0x41ec97);if(_0x41ec97===0x1){_0x6a1cfc=_0x9edd('0x75');}throw new db[(_0x9edd('0x76'))]['ValidationError'](_0x6a1cfc);}}return;};exports[_0x9edd('0x77')]=function(_0x2e1ce3,_0x430eb4){var _0x15ebfa=_0x430eb4?encryptor[_0x9edd('0x72')](_0x430eb4)[_0x9edd('0x78')](','):[];if(_0x15ebfa['length']===0x5){_0x15ebfa['splice'](-0x1,0x1);}_0x15ebfa[_0x9edd('0x79')](_0x2e1ce3);return encryptor['encryptString'](_0x15ebfa[_0x9edd('0x7a')](','));};function signJwt(_0x3e9a3e){var _0x439083=BPromise[_0x9edd('0x7b')](jwt['sign'],{'context':jwt});var _0x21ead2=_0x3e9a3e['secret']||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0xc6bde6,_0x5ca123){_0x439083(_0x3e9a3e[_0x9edd('0x7d')],_0x21ead2,_0x3e9a3e['options'])[_0x9edd('0x3b')](function(_0x4e1eda){_0xc6bde6(_0x4e1eda);})['catch'](function(_0x236b82){_0x5ca123(_0x236b82);});});}function verifyJwt(_0x4a72d0,_0x141137,_0x134c9c){var _0x307a61=BPromise['promisify'](jwt[_0x9edd('0x7e')],{'context':jwt});var _0x321485=_0x134c9c||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0x467512,_0x4d8fbb){_0x307a61(_0x4a72d0,_0x321485,_0x141137)['then'](function(_0x2e1a96){_0x467512(_0x2e1a96);})[_0x9edd('0x48')](function(_0x5516c4){_0x4d8fbb(_0x5516c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x9edd('0x7f'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x9edd('0x80')]();}function createJwt(_0x32ff46){var _0x589348={'payload':{'iat':_0x32ff46[_0x9edd('0x6a')],'nonce':_0x32ff46[_0x9edd('0x52')]},'options':{'algorithm':_0x9edd('0x81'),'subject':_0x32ff46['id']['toString'](),'issuer':hardwareConf[_0x9edd('0x4d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x589348)[_0x9edd('0x3b')](function(_0x18d1a0){return{'iat':_0x32ff46['apiKeyIat'],'nonce':_0x32ff46[_0x9edd('0x52')],'token':_0x18d1a0};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 1548424..ebbb5ea 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 _0x8baf=['app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createCipher','data','binary','write','end','final','close','decryptFile','createReadStream','createWriteStream','createDecipher','update','unlink','encryptString','base64','decryptString','secret','utf8','bluebird','../../config/environment','../../config/logger'];(function(_0x409107,_0x23ca29){var _0x47bc15=function(_0x24cc89){while(--_0x24cc89){_0x409107['push'](_0x409107['shift']());}};_0x47bc15(++_0x23ca29);}(_0x8baf,0x89));var _0xf8ba=function(_0x5110bf,_0x580f26){_0x5110bf=_0x5110bf-0x0;var _0xf72119=_0x8baf[_0x5110bf];return _0xf72119;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xf8ba('0x0'));var _=require('lodash');var config=require(_0xf8ba('0x1'));var logger=require(_0xf8ba('0x2'))(_0xf8ba('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xf8ba('0x4')][_0xf8ba('0x5')],'algorithm':_0xf8ba('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xf8ba('0x7')]&&config[_0xf8ba('0x7')][_0xf8ba('0x8')]){var isSupported=isAlgorithmSupported(config[_0xf8ba('0x7')][_0xf8ba('0x8')]);if(isSupported){fileOptions[_0xf8ba('0x8')]=config['encrypt'][_0xf8ba('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf8ba('0x9')](',\x20');logger[_0xf8ba('0xa')](config['encrypt'][_0xf8ba('0x8')],_0xf8ba('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x495593){return AES_SUPPORTED_RX[_0xf8ba('0xc')](_0x495593);}function getSupportedCiphers(){return crypto[_0xf8ba('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x27d34c){return getSupportedCiphers()[_0xf8ba('0xe')](_0x27d34c)>-0x1;}function combineOptions(_0x359fe9){var _0x58df85={};for(var _0x1d13e8 in fileOptions){if(fileOptions[_0xf8ba('0xf')](_0x1d13e8)){_0x58df85[_0x1d13e8]=fileOptions[_0x1d13e8];}}if(_0x359fe9){for(var _0x300c4f in _0x359fe9){if(_0x359fe9[_0xf8ba('0xf')](_0x300c4f)){_0x58df85[_0x300c4f]=_0x359fe9[_0x300c4f];}}}return _0x58df85;}exports[_0xf8ba('0x10')]=function(_0x194702,_0x418aa8,_0x38638a,_0x434e0e){return new BPromise(function(_0x1c6c7c,_0x1d29f9){_0x434e0e=combineOptions(_0x434e0e);var _0x5cf599=new Buffer(_0x38638a);var _0x39911f=fs['createReadStream'](_0x194702);var _0x5fb0ca=fs['createWriteStream'](_0x418aa8);var _0x48f8dc=crypto[_0xf8ba('0x11')](_0x434e0e[_0xf8ba('0x8')],_0x5cf599);_0x39911f['on'](_0xf8ba('0x12'),function(_0x2a3ebd){var _0x482c7e=new Buffer(_0x48f8dc['update'](_0x2a3ebd),_0xf8ba('0x13'));_0x5fb0ca[_0xf8ba('0x14')](_0x482c7e);});_0x39911f['on'](_0xf8ba('0x15'),function(){try{var _0x52a032=new Buffer(_0x48f8dc[_0xf8ba('0x16')](_0xf8ba('0x13')),_0xf8ba('0x13'));_0x5fb0ca[_0xf8ba('0x14')](_0x52a032);_0x5fb0ca[_0xf8ba('0x15')]();_0x5fb0ca['on'](_0xf8ba('0x17'),function(){return _0x1c6c7c(_0x418aa8);});}catch(_0x2f3c34){fs['unlink'](_0x418aa8);return _0x1d29f9(_0x2f3c34);}});});};exports[_0xf8ba('0x18')]=function(_0x5e2c50,_0x20e7b0,_0x4ab5d8,_0xa239f7){return new BPromise(function(_0x179f10,_0x2b03b3){_0xa239f7=combineOptions(_0xa239f7);var _0x14c6c9=new Buffer(_0x4ab5d8);var _0x54623d=fs[_0xf8ba('0x19')](_0x5e2c50);var _0x115419=fs[_0xf8ba('0x1a')](_0x20e7b0);var _0x2f65d4=crypto[_0xf8ba('0x1b')](_0xa239f7[_0xf8ba('0x8')],_0x14c6c9);_0x54623d['on']('data',function(_0x3b9abb){var _0xd26027=new Buffer(_0x2f65d4[_0xf8ba('0x1c')](_0x3b9abb),_0xf8ba('0x13'));_0x115419[_0xf8ba('0x14')](_0xd26027);});_0x54623d['on'](_0xf8ba('0x15'),function(){try{var _0x277bd5=new Buffer(_0x2f65d4['final'](_0xf8ba('0x13')),'binary');_0x115419[_0xf8ba('0x14')](_0x277bd5);_0x115419[_0xf8ba('0x15')]();_0x115419['on'](_0xf8ba('0x17'),function(){return _0x179f10(_0x20e7b0);});}catch(_0x3ec8d6){fs[_0xf8ba('0x1d')](_0x20e7b0);return _0x2b03b3(_0x3ec8d6);}});});};exports[_0xf8ba('0x1e')]=function(_0x3c6c6e,_0x1af994,_0x136bb2){var _0x38e0d7=_0x136bb2||stringOptions[_0xf8ba('0x8')];var _0x24599c=_0x1af994||stringOptions['secret'];var _0x1e148b=crypto['createCipher'](_0x38e0d7,_0x24599c);var _0x5371fd=_0x1e148b['update'](_0x3c6c6e,'utf8','base64');_0x5371fd+=_0x1e148b[_0xf8ba('0x16')](_0xf8ba('0x1f'));return _0x5371fd;};exports[_0xf8ba('0x20')]=function(_0x49fb6f,_0x4baa87,_0x5b7493){var _0x3146b4=_0x5b7493||stringOptions['algorithm'];var _0x5d93be=_0x4baa87||stringOptions[_0xf8ba('0x21')];var _0x2f1257=crypto[_0xf8ba('0x1b')](_0x3146b4,_0x5d93be);var _0x1f9e09=_0x2f1257[_0xf8ba('0x1c')](_0x49fb6f,_0xf8ba('0x1f'),_0xf8ba('0x22'));_0x1f9e09+=_0x2f1257[_0xf8ba('0x16')]('utf8');return _0x1f9e09;}; \ No newline at end of file +var _0x8033=['decryptFile','close','encryptString','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','update','write','final','binary','end','unlink'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x8033,0x90));var _0x3803=function(_0x325286,_0x1c7e8c){_0x325286=_0x325286-0x0;var _0x6c154b=_0x8033[_0x325286];return _0x6c154b;};'use strict';var crypto=require(_0x3803('0x0'));var fs=require('fs');var BPromise=require(_0x3803('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x3803('0x2'))(_0x3803('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3803('0x4')][_0x3803('0x5')],'algorithm':_0x3803('0x6')};const fileOptions={'algorithm':_0x3803('0x7')};if(config[_0x3803('0x8')]&&config[_0x3803('0x8')][_0x3803('0x9')]){var isSupported=isAlgorithmSupported(config[_0x3803('0x8')][_0x3803('0x9')]);if(isSupported){fileOptions[_0x3803('0x9')]=config['encrypt'][_0x3803('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3803('0xa')](',\x20');logger[_0x3803('0xb')](config['encrypt'][_0x3803('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x224274){return AES_SUPPORTED_RX[_0x3803('0xc')](_0x224274);}function getSupportedCiphers(){return crypto[_0x3803('0xd')]()[_0x3803('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5edcb1){return getSupportedCiphers()[_0x3803('0xf')](_0x5edcb1)>-0x1;}function combineOptions(_0xcac581){var _0x38a9cd={};for(var _0x4bd0d2 in fileOptions){if(fileOptions[_0x3803('0x10')](_0x4bd0d2)){_0x38a9cd[_0x4bd0d2]=fileOptions[_0x4bd0d2];}}if(_0xcac581){for(var _0x2a6459 in _0xcac581){if(_0xcac581[_0x3803('0x10')](_0x2a6459)){_0x38a9cd[_0x2a6459]=_0xcac581[_0x2a6459];}}}return _0x38a9cd;}exports[_0x3803('0x11')]=function(_0x5bce77,_0x15a41f,_0x4cf7f8,_0xfa8afa){return new BPromise(function(_0xb4aa87,_0x1b26e5){_0xfa8afa=combineOptions(_0xfa8afa);var _0x5d3b5f=new Buffer(_0x4cf7f8);var _0x2a9e66=fs[_0x3803('0x12')](_0x5bce77);var _0x3c0a27=fs[_0x3803('0x13')](_0x15a41f);var _0x3d767e=crypto['createCipher'](_0xfa8afa[_0x3803('0x9')],_0x5d3b5f);_0x2a9e66['on']('data',function(_0x4a8473){var _0x447e86=new Buffer(_0x3d767e[_0x3803('0x14')](_0x4a8473),'binary');_0x3c0a27[_0x3803('0x15')](_0x447e86);});_0x2a9e66['on']('end',function(){try{var _0x515702=new Buffer(_0x3d767e[_0x3803('0x16')]('binary'),_0x3803('0x17'));_0x3c0a27[_0x3803('0x15')](_0x515702);_0x3c0a27[_0x3803('0x18')]();_0x3c0a27['on']('close',function(){return _0xb4aa87(_0x15a41f);});}catch(_0x2d42e9){fs[_0x3803('0x19')](_0x15a41f);return _0x1b26e5(_0x2d42e9);}});});};exports[_0x3803('0x1a')]=function(_0x4dd97e,_0x2bcde0,_0xdd3424,_0x239e0e){return new BPromise(function(_0x3c51dc,_0x12fabd){_0x239e0e=combineOptions(_0x239e0e);var _0x2e78bc=new Buffer(_0xdd3424);var _0x9af78=fs[_0x3803('0x12')](_0x4dd97e);var _0x32b706=fs[_0x3803('0x13')](_0x2bcde0);var _0xc2bf2e=crypto['createDecipher'](_0x239e0e[_0x3803('0x9')],_0x2e78bc);_0x9af78['on']('data',function(_0xc536c2){var _0x24cb8f=new Buffer(_0xc2bf2e[_0x3803('0x14')](_0xc536c2),_0x3803('0x17'));_0x32b706['write'](_0x24cb8f);});_0x9af78['on'](_0x3803('0x18'),function(){try{var _0x3a0c7d=new Buffer(_0xc2bf2e['final'](_0x3803('0x17')),'binary');_0x32b706['write'](_0x3a0c7d);_0x32b706[_0x3803('0x18')]();_0x32b706['on'](_0x3803('0x1b'),function(){return _0x3c51dc(_0x2bcde0);});}catch(_0x3b436b){fs[_0x3803('0x19')](_0x2bcde0);return _0x12fabd(_0x3b436b);}});});};exports[_0x3803('0x1c')]=function(_0x3808b2,_0x4d4085,_0x1e8e03){var _0x4272b9=_0x1e8e03||stringOptions[_0x3803('0x9')];var _0x49d574=_0x4d4085||stringOptions[_0x3803('0x1d')];var _0xf8b67b=crypto['createCipher'](_0x4272b9,_0x49d574);var _0x39fb25=_0xf8b67b[_0x3803('0x14')](_0x3808b2,'utf8',_0x3803('0x1e'));_0x39fb25+=_0xf8b67b['final'](_0x3803('0x1e'));return _0x39fb25;};exports[_0x3803('0x1f')]=function(_0x1965a0,_0x955fc9,_0x37177b){var _0x154ce9=_0x37177b||stringOptions[_0x3803('0x9')];var _0x236d5c=_0x955fc9||stringOptions[_0x3803('0x1d')];var _0x49016e=crypto[_0x3803('0x20')](_0x154ce9,_0x236d5c);var _0x29ddfa=_0x49016e['update'](_0x1965a0,'base64','utf8');_0x29ddfa+=_0x49016e[_0x3803('0x16')](_0x3803('0x21'));return _0x29ddfa;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 2217715..d56777b 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 _0xcb4a=['QueryTypes','SELECT','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','length','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Failed','finally','exit','path','lodash','to-csv','bluebird','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x52947b,_0x2326f4){var _0x4199ce=function(_0x25cc6d){while(--_0x25cc6d){_0x52947b['push'](_0x52947b['shift']());}};_0x4199ce(++_0x2326f4);}(_0xcb4a,0x74));var _0xacb4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xcb4a[_0xbca1b1];return _0x4e1686;};'use strict';var util=require('util');var path=require(_0xacb4('0x0'));var _=require(_0xacb4('0x1'));var csv=require(_0xacb4('0x2'));var fs=require('fs');var BPromise=require(_0xacb4('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xacb4('0x4'))['db'];var dbH=require(_0xacb4('0x4'))['dbH'];var logger=require(_0xacb4('0x5'))(_0xacb4('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xacb4('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xacb4('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1aed0f,_0x4be468){var _0x2d7b7a={'status':_0x1aed0f};var _0x4d284e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4be468){_0x2d7b7a[_0xacb4('0x8')]=_0x4be468;}return db[_0xacb4('0x9')]['update'](_0x2d7b7a,_0x4d284e);}function main(){var _0x4a7715=0x1388;var _0x40999d;logger[_0xacb4('0xa')](util[_0xacb4('0xb')](_0xacb4('0xc'),EXTRACTED_REPORT_ID,_0xacb4('0xd')));return db[_0xacb4('0xe')][_0xacb4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xacb4('0x10'),_0xacb4('0x11')]})[_0xacb4('0x12')](function(_0x418900){if(_0x418900){_0x40999d=_0x418900;_0x4a7715=_0x40999d['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0xacb4('0x13')][_0xacb4('0x14')](util[_0xacb4('0xb')](_0xacb4('0x15'),QUERY),{'type':dbH[_0xacb4('0x13')][_0xacb4('0x16')][_0xacb4('0x17')]});})[_0xacb4('0x12')](function(_0x3bdf26){if(!_0x3bdf26[0x0]['num']){return analyticExtractedReport('Empty');}var _0x304870=[];var _0x2e0051=0x0;if(_0x40999d['split']){if(_0x3bdf26&&_0x3bdf26['length']){var _0x53d5fa=_[_0xacb4('0x18')](_0x3bdf26[0x0][_0xacb4('0x19')]/_0x4a7715);var _0x183d4c=Number[_0xacb4('0x1a')](_0x3bdf26[0x0]['num']/_0x4a7715)?_0x3bdf26[0x0]['num']%_0x4a7715:0x0;_0x53d5fa[_0xacb4('0x1b')](function(_0x1bb7ee){if(_0x1bb7ee>0x0){_0x2e0051+=_0x4a7715;}_0x304870[_0xacb4('0x1c')](dbH[_0xacb4('0x13')][_0xacb4('0x14')](util[_0xacb4('0xb')](_0xacb4('0x1d'),QUERY,_0x4a7715,_0x2e0051),{'type':dbH[_0xacb4('0x13')][_0xacb4('0x16')][_0xacb4('0x17')]}));});if(_0x183d4c>0x0){_0x2e0051+=_0x4a7715;_0x304870['push'](dbH['sequelize'][_0xacb4('0x14')](util[_0xacb4('0xb')](_0xacb4('0x1d'),QUERY,_0x183d4c,_0x2e0051),{'type':dbH[_0xacb4('0x13')][_0xacb4('0x16')]['SELECT']}));}}}else{_0x304870[_0xacb4('0x1c')](dbH[_0xacb4('0x13')][_0xacb4('0x14')](QUERY,{'type':dbH['sequelize'][_0xacb4('0x16')][_0xacb4('0x17')]}));}var _0x1846d6=path[_0xacb4('0x1e')](PATH);var _0x4296ec=path['basename'](PATH,'.csv');var _0x534f8c=_0x40999d[_0xacb4('0x10')]&&_0x304870[_0xacb4('0x1f')]>0x1;var _0x17c3ff=[];if(!fs[_0xacb4('0x20')](path[_0xacb4('0x21')](_0x1846d6,_0x4296ec))&&_0x534f8c){fs[_0xacb4('0x22')](path['join'](_0x1846d6,_0x4296ec));}return BPromise['each'](_0x304870,function(_0x280f63){_0x17c3ff['push'](_0x280f63);})[_0xacb4('0x12')](function(){for(var _0x2fc3ad=0x0;_0x2fc3ad<_0x17c3ff[_0xacb4('0x1f')];_0x2fc3ad+=0x1){var _0x2708f1;var _0x1d3fff=_0x17c3ff[_0x2fc3ad];if(_0x534f8c){_0x2708f1=path[_0xacb4('0x21')](_0x1846d6,_0x4296ec,util['format'](_0xacb4('0x23'),_0x4296ec,_0x2fc3ad,_0xacb4('0x24')));}else{_0x2708f1=path[_0xacb4('0x21')](_0x1846d6,util['format'](_0xacb4('0x25'),_0x4296ec,_0xacb4('0x24')));}fs[_0xacb4('0x26')](_0x2708f1,csv(_0x1d3fff));}})[_0xacb4('0x12')](function(){if(_0x534f8c){return new Promise(function(_0x2ad933){zipdir(path['join'](_0x1846d6,_0x4296ec),{'saveTo':path[_0xacb4('0x21')](_0x1846d6,util['format'](_0xacb4('0x25'),_0x4296ec,_0xacb4('0x27')))},function(_0x3c3c96,_0xecbc33){rimraf(path[_0xacb4('0x21')](_0x1846d6,_0x4296ec),function(){});_0x2ad933(_0xacb4('0x28'));});});}})[_0xacb4('0x12')](function(){logger['info'](util[_0xacb4('0xb')](_0xacb4('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xacb4('0x2a'),_0x534f8c?util['format'](_0xacb4('0x25'),_0x4296ec,_0x534f8c?_0xacb4('0x27'):_0xacb4('0x24')):null);});})['catch'](function(_0x1cee7c){logger[_0xacb4('0xa')](util[_0xacb4('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x1cee7c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xacb4('0x2b'));})[_0xacb4('0x2c')](function(){process[_0xacb4('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb472=['SELECT','num','Empty','length','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','join','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x552d53,_0x56ced2){var _0x2cc575=function(_0x28bf93){while(--_0x28bf93){_0x552d53['push'](_0x552d53['shift']());}};_0x2cc575(++_0x56ced2);}(_0xb472,0x1a2));var _0x2b47=function(_0x9a9e12,_0x3c3497){_0x9a9e12=_0x9a9e12-0x0;var _0x237985=_0xb472[_0x9a9e12];return _0x237985;};'use strict';var util=require(_0x2b47('0x0'));var path=require(_0x2b47('0x1'));var _=require(_0x2b47('0x2'));var csv=require(_0x2b47('0x3'));var fs=require('fs');var BPromise=require(_0x2b47('0x4'));var zipdir=require(_0x2b47('0x5'));var rimraf=require(_0x2b47('0x6'));var db=require(_0x2b47('0x7'))['db'];var dbH=require(_0x2b47('0x7'))[_0x2b47('0x8')];var logger=require(_0x2b47('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2b47('0xa')][0x2]);var QUERY=process[_0x2b47('0xa')][0x3];var PATH=process[_0x2b47('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ec927,_0x38299a){var _0x175333={'status':_0x3ec927};var _0x6b3b6b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38299a){_0x175333[_0x2b47('0xb')]=_0x38299a;}return db[_0x2b47('0xc')]['update'](_0x175333,_0x6b3b6b);}function main(){var _0x46f251=0x1388;var _0x4a0ba1;logger[_0x2b47('0xd')](util['format'](_0x2b47('0xe'),EXTRACTED_REPORT_ID,_0x2b47('0xf')));return db['Setting'][_0x2b47('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2b47('0x11'),_0x2b47('0x12')]})[_0x2b47('0x13')](function(_0x5f568b){if(_0x5f568b){_0x4a0ba1=_0x5f568b;_0x46f251=_0x4a0ba1['splitSizeCsv']||0x1388;}})[_0x2b47('0x13')](function(){return dbH[_0x2b47('0x14')][_0x2b47('0x15')](util['format'](_0x2b47('0x16'),QUERY),{'type':dbH[_0x2b47('0x14')]['QueryTypes'][_0x2b47('0x17')]});})['then'](function(_0x347601){if(!_0x347601[0x0][_0x2b47('0x18')]){return analyticExtractedReport(_0x2b47('0x19'));}var _0x2bd08d=[];var _0x1de010=0x0;if(_0x4a0ba1[_0x2b47('0x11')]){if(_0x347601&&_0x347601[_0x2b47('0x1a')]){var _0x3cb993=_['range'](_0x347601[0x0][_0x2b47('0x18')]/_0x46f251);var _0x5f27d7=Number[_0x2b47('0x1b')](_0x347601[0x0][_0x2b47('0x18')]/_0x46f251)?_0x347601[0x0]['num']%_0x46f251:0x0;_0x3cb993[_0x2b47('0x1c')](function(_0x5350b2){if(_0x5350b2>0x0){_0x1de010+=_0x46f251;}_0x2bd08d[_0x2b47('0x1d')](dbH[_0x2b47('0x14')][_0x2b47('0x15')](util[_0x2b47('0x1e')](_0x2b47('0x1f'),QUERY,_0x46f251,_0x1de010),{'type':dbH[_0x2b47('0x14')][_0x2b47('0x20')][_0x2b47('0x17')]}));});if(_0x5f27d7>0x0){_0x1de010+=_0x46f251;_0x2bd08d[_0x2b47('0x1d')](dbH[_0x2b47('0x14')][_0x2b47('0x15')](util['format'](_0x2b47('0x1f'),QUERY,_0x5f27d7,_0x1de010),{'type':dbH[_0x2b47('0x14')][_0x2b47('0x20')][_0x2b47('0x17')]}));}}}else{_0x2bd08d[_0x2b47('0x1d')](dbH[_0x2b47('0x14')][_0x2b47('0x15')](QUERY,{'type':dbH[_0x2b47('0x14')]['QueryTypes'][_0x2b47('0x17')]}));}var _0x40ece9=path[_0x2b47('0x21')](PATH);var _0x3bce66=path[_0x2b47('0x22')](PATH,'.csv');var _0x5a01c0=_0x4a0ba1[_0x2b47('0x11')]&&_0x2bd08d[_0x2b47('0x1a')]>0x1;var _0x4e0171=[];if(!fs['existsSync'](path['join'](_0x40ece9,_0x3bce66))&&_0x5a01c0){fs['mkdirSync'](path[_0x2b47('0x23')](_0x40ece9,_0x3bce66));}return BPromise[_0x2b47('0x24')](_0x2bd08d,function(_0x459325){_0x4e0171['push'](_0x459325);})[_0x2b47('0x13')](function(){for(var _0x1d3900=0x0;_0x1d3900<_0x4e0171['length'];_0x1d3900+=0x1){var _0x9d384b;var _0x4afa00=_0x4e0171[_0x1d3900];if(_0x5a01c0){_0x9d384b=path[_0x2b47('0x23')](_0x40ece9,_0x3bce66,util['format']('%s%d.%s',_0x3bce66,_0x1d3900,_0x2b47('0x25')));}else{_0x9d384b=path[_0x2b47('0x23')](_0x40ece9,util[_0x2b47('0x1e')](_0x2b47('0x26'),_0x3bce66,_0x2b47('0x25')));}fs[_0x2b47('0x27')](_0x9d384b,csv(_0x4afa00));}})[_0x2b47('0x13')](function(){if(_0x5a01c0){return new Promise(function(_0x504306){zipdir(path[_0x2b47('0x23')](_0x40ece9,_0x3bce66),{'saveTo':path[_0x2b47('0x23')](_0x40ece9,util[_0x2b47('0x1e')]('%s.%s',_0x3bce66,_0x2b47('0x28')))},function(_0x18e4b3,_0x293abb){rimraf(path['join'](_0x40ece9,_0x3bce66),function(){});_0x504306(_0x2b47('0x29'));});});}})[_0x2b47('0x13')](function(){logger[_0x2b47('0xd')](util['format'](_0x2b47('0x2a'),EXTRACTED_REPORT_ID,_0x2b47('0xf')));return analyticExtractedReport(_0x2b47('0x2b'),_0x5a01c0?util[_0x2b47('0x1e')](_0x2b47('0x26'),_0x3bce66,_0x5a01c0?'zip':_0x2b47('0x25')):null);});})[_0x2b47('0x2c')](function(_0x6c884b){logger['info'](util[_0x2b47('0x1e')](_0x2b47('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0x2b47('0x2e')](_0x6c884b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2b47('0x2f'));})['finally'](function(){process[_0x2b47('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index e553042..0323030 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 _0x91db=['each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','then','splitSizePdf','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync'];(function(_0x528fc6,_0x1c848f){var _0x218634=function(_0x534ab6){while(--_0x534ab6){_0x528fc6['push'](_0x528fc6['shift']());}};_0x218634(++_0x1c848f);}(_0x91db,0xe4));var _0xb91d=function(_0x153eb1,_0x3154b4){_0x153eb1=_0x153eb1-0x0;var _0x3f0304=_0x91db[_0x153eb1];return _0x3f0304;};'use strict';var _=require(_0xb91d('0x0'));var fs=require('fs');var util=require(_0xb91d('0x1'));var path=require(_0xb91d('0x2'));var moment=require(_0xb91d('0x3'));var htmlToPdfmake=require(_0xb91d('0x4'));var PdfPrinter=require(_0xb91d('0x5'));var zipdir=require(_0xb91d('0x6'));var rimraf=require(_0xb91d('0x7'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xb91d('0x8')];var BPromise=require(_0xb91d('0x9'));var db=require(_0xb91d('0xa'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xb91d('0xb'))(_0xb91d('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xb91d('0xd')][0x2]);var QUERY=process[_0xb91d('0xd')][0x3];var PATH=process[_0xb91d('0xd')][0x4];var NAME=process[_0xb91d('0xd')][0x5];var FORMAT=_0xb91d('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a6f65,_0x3081ab){var _0x26e8d5={'status':_0x4a6f65};var _0x4d9d1b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3081ab){_0x26e8d5[_0xb91d('0xf')]=_0x3081ab;}return db[_0xb91d('0x10')][_0xb91d('0x11')](_0x26e8d5,_0x4d9d1b);}function getHeaders(_0xb6024d){return _[_0xb91d('0x12')](_0xb6024d,function(_0x410678){return{'text':_0x410678,'style':_0xb91d('0x13')};});}function getRows(_0x1d92cc,_0x1903b5){return _['map'](_0x1903b5,function(_0x59376e){return _(_0x59376e)[_0xb91d('0x14')](_0x1d92cc)[_0xb91d('0x12')](function(_0x13c9c4){return _0x13c9c4?_[_0xb91d('0x15')](_0x13c9c4):'';})[_0xb91d('0x16')]();});}function createTable(_0x5eaa23,_0x10f8cb){var _0x173bbb={'widths':_[_0xb91d('0x17')](Array(_0x5eaa23[_0xb91d('0x18')]),0x91),'heights':function(_0x2271e5){return _0x2271e5===0x0?_0xb91d('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x187097=getHeaders(_0x5eaa23);_0x173bbb[_0xb91d('0x1a')][_0xb91d('0x1b')](_0x187097);var _0x490f04=getRows(_0x5eaa23,_0x10f8cb);_0x173bbb['body']=_0x173bbb[_0xb91d('0x1a')][_0xb91d('0x1c')](_0x490f04);return _0x173bbb;}function createTables(_0x318d6d){var _0x49366f=[];var _0x58ba24=_[_0xb91d('0x1d')](Object[_0xb91d('0x1e')](_0x318d6d[0x0]),0x5);_0x58ba24[_0xb91d('0x1f')](function(_0x759d74){_0x49366f[_0xb91d('0x1b')](createTable(_0x759d74,_0x318d6d));});return _0x49366f;}function getPDFDocDefinition(_0x103137){var _0x1d67a6=util[_0xb91d('0x20')](_0xb91d('0x21'),NAME,EXTRACTED_REPORT[_0xb91d('0x22')],moment(EXTRACTED_REPORT[_0xb91d('0x23')])[_0xb91d('0x20')](FORMAT),moment(EXTRACTED_REPORT[_0xb91d('0x24')])[_0xb91d('0x20')](FORMAT));var _0x1f39b7=[];for(var _0x560234=0x0;_0x560234<_0x103137[_0xb91d('0x18')];_0x560234++){var _0x368e93=[];if(_0x560234===0x0){_0x368e93['push']({'text':_0x1d67a6,'style':'header'});}var _0x2dea07={'table':_0x103137[_0x560234]};if(_0x560234>0x0){_0x2dea07[_0xb91d('0x25')]=_0xb91d('0x26');_0x2dea07[_0xb91d('0x27')]=[0x0,0x46,0x0,0x0];}_0x368e93[_0xb91d('0x1b')](_0x2dea07);_0x1f39b7[_0xb91d('0x1b')](_0x368e93);}return{'pageSize':'A4','pageOrientation':_0xb91d('0x28'),'content':_0x1f39b7,'footer':function(_0xddb0b6,_0x2727ed){return{'text':_0xddb0b6['toString']()+_0xb91d('0x29')+_0x2727ed,'style':_0xb91d('0x2a')};},'defaultStyle':{'font':_0xb91d('0x2b')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb91d('0x2c')},'footer':{'alignment':_0xb91d('0x2d'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x37348c){var _0x5b544c=0x1388;var _0x26af39;if(!_0x37348c[0x0][_0xb91d('0x2e')]){return analyticExtractedReport(_0xb91d('0x2f'));}return db[_0xb91d('0x30')][_0xb91d('0x31')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb91d('0x32'),'splitSizePdf']})[_0xb91d('0x33')](function(_0x51db28){if(_0x51db28){_0x26af39=_0x51db28;_0x5b544c=_0x26af39[_0xb91d('0x34')]||0x3e8;}})[_0xb91d('0x33')](function(){var _0xd1c490=[];var _0x592492=0x0;if(_0x26af39[_0xb91d('0x32')]){if(_0x37348c&&_0x37348c[_0xb91d('0x18')]){var _0x31f451=_[_0xb91d('0x35')](_0x37348c[0x0][_0xb91d('0x2e')]/_0x5b544c);var _0x1035f0=Number[_0xb91d('0x36')](_0x37348c[0x0]['num']/_0x5b544c)?_0x37348c[0x0][_0xb91d('0x2e')]%_0x5b544c:0x0;_0x31f451[_0xb91d('0x1f')](function(_0x55c0d5){if(_0x55c0d5>0x0){_0x592492+=_0x5b544c;}_0xd1c490[_0xb91d('0x1b')](dbH[_0xb91d('0x37')]['query'](util[_0xb91d('0x20')](_0xb91d('0x38'),QUERY,_0x5b544c,_0x592492),{'type':dbH[_0xb91d('0x37')][_0xb91d('0x39')][_0xb91d('0x3a')]}));});if(_0x1035f0>0x0){_0x592492+=_0x5b544c;_0xd1c490[_0xb91d('0x1b')](dbH[_0xb91d('0x37')]['query'](util[_0xb91d('0x20')](_0xb91d('0x38'),QUERY,_0x1035f0,_0x592492),{'type':dbH['sequelize'][_0xb91d('0x39')][_0xb91d('0x3a')]}));}}}else{_0xd1c490[_0xb91d('0x1b')](dbH[_0xb91d('0x37')][_0xb91d('0x3b')](QUERY,{'type':dbH[_0xb91d('0x37')][_0xb91d('0x39')]['SELECT']}));}var _0x56a069=path[_0xb91d('0x3c')](PATH);var _0x1d2a6a=path[_0xb91d('0x3d')](PATH,_0xb91d('0x3e'));var _0x40d66c=_0x26af39['split']&&_0xd1c490[_0xb91d('0x18')]>0x1;var _0xf449c2=[];if(!fs[_0xb91d('0x3f')](path[_0xb91d('0x40')](_0x56a069,_0x1d2a6a))&&_0x40d66c){fs[_0xb91d('0x41')](path[_0xb91d('0x40')](_0x56a069,_0x1d2a6a));}return BPromise[_0xb91d('0x42')](_0xd1c490,function(_0x45be65){_0xf449c2['push'](_0x45be65);})[_0xb91d('0x33')](function(){var _0x28ada0=[];for(var _0x41fe1c=0x0;_0x41fe1c<_0xf449c2['length'];_0x41fe1c+=0x1){var _0x1d0ae8=_0xf449c2[_0x41fe1c];var _0x2b4d51=createTables(_[_0xb91d('0x43')](_0x1d0ae8));var _0x3e77be;var _0x200261=getPDFDocDefinition(_0x2b4d51);var _0x53c275=getPDFPrinter();var _0x2555a0=_0x53c275[_0xb91d('0x44')](_0x200261);if(_0x40d66c){_0x3e77be=path[_0xb91d('0x40')](_0x56a069,_0x1d2a6a,util['format'](_0xb91d('0x45'),_0x1d2a6a,_0x41fe1c,_0xb91d('0x46')));}else{_0x3e77be=path[_0xb91d('0x40')](_0x56a069,util['format']('%s.%s',_0x1d2a6a,_0xb91d('0x46')));}_0x28ada0[_0xb91d('0x1b')](writePDFDocument(_0x2555a0,_0x3e77be));}return Promise[_0xb91d('0x47')](_0x28ada0);})['then'](function(){if(_0x40d66c){return new Promise(function(_0x245115){zipdir(path['join'](_0x56a069,_0x1d2a6a),{'saveTo':path['join'](_0x56a069,util[_0xb91d('0x20')](_0xb91d('0x48'),_0x1d2a6a,_0xb91d('0x49')))},function(){rimraf(path['join'](_0x56a069,_0x1d2a6a),function(){});_0x245115('zip\x20finished');});});}})[_0xb91d('0x33')](function(){if(!_0x40d66c)return;rimraf(path['join'](_0x56a069,_0x1d2a6a),function(){});})[_0xb91d('0x33')](function(){logger[_0xb91d('0x4a')](util[_0xb91d('0x20')](_0xb91d('0x4b'),EXTRACTED_REPORT_ID,_0xb91d('0x4c')));return analyticExtractedReport(_0xb91d('0x4d'),_0x40d66c?util[_0xb91d('0x20')](_0xb91d('0x48'),_0x1d2a6a,_0x40d66c?_0xb91d('0x49'):_0xb91d('0x46')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb91d('0x4a')](util[_0xb91d('0x20')](_0xb91d('0x4e'),EXTRACTED_REPORT_ID,_0xb91d('0x4c')));return db[_0xb91d('0x10')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xe6f75a){EXTRACTED_REPORT=_0xe6f75a;return dbH[_0xb91d('0x37')]['query'](util[_0xb91d('0x20')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb91d('0x37')]['QueryTypes'][_0xb91d('0x3a')]});})[_0xb91d('0x33')](extractReport)['catch'](function(_0x54c45a){logger['info'](util[_0xb91d('0x20')](_0xb91d('0x4f'),EXTRACTED_REPORT_ID,_0xb91d('0x4c')),util[_0xb91d('0x50')](_0x54c45a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xb91d('0x51')](function(){process[_0xb91d('0x52')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xdc7e20=new PdfPrinter({'Arial':{'normal':__dirname+_0xb91d('0x53'),'bold':__dirname+_0xb91d('0x54'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xdc7e20;}function getPDFDocDefinitionFromHTML(_0xc0c2c4,_0x8ea35f){var _0x15a544=util['format']('%s\x20#%d',_0x8ea35f[_0xb91d('0x55')],_0x8ea35f[_0xb91d('0x56')]);var _0x5c49bf=moment()['format'](_0xb91d('0x57'))[_0xb91d('0x15')]();var _0x5833cb=htmlToPdfmake(_0xc0c2c4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5833cb],'defaultStyle':{'font':_0xb91d('0x2b')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb91d('0x58'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb91d('0x58'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb91d('0x58')}},'header':function(){return[{'text':_0xb91d('0x59'),'style':_0xb91d('0x5a')}];},'footer':function(_0x508355,_0x5c3e29){return[{'text':util[_0xb91d('0x20')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x15a544,_0x508355,_0x5c3e29,_0x5c49bf),'style':'footer'}];}};}function writePDFDocument(_0x40b791,_0x15d79e){return new Promise(function(_0x115591,_0x4bebe2){var _0x193ff1=_0x40b791[_0xb91d('0x5b')](fs[_0xb91d('0x5c')](_0x15d79e));_0x193ff1['on'](_0xb91d('0x5d'),function(){_0x115591('finish');});_0x193ff1['on'](_0xb91d('0x5e'),function(_0x604e79){_0x4bebe2(_0x604e79);});_0x40b791[_0xb91d('0x5f')]();});}exports[_0xb91d('0x60')]=function(_0x53de6d,_0x5015db){var _0x5003fb=getPDFPrinter();var _0x55f560=getPDFDocDefinitionFromHTML(_0x53de6d,_0x5015db);var _0x4da626=_0x5003fb[_0xb91d('0x44')](_0x55f560);return writePDFDocument(_0x4da626,_0x5015db[_0xb91d('0x2')])[_0xb91d('0x61')](function(_0x517b59){throw _0x517b59;});}; \ No newline at end of file +var _0xe481=['forEach','format','name','startDate','header','before','margin','landscape','\x20/\x20','footer','Arial','num','Empty','find','split','splitSizePdf','then','range','sequelize','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','%s.%s','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','fill','length','auto','body','push','concat','chunk'];(function(_0x35c1ad,_0x4d01a5){var _0x448f19=function(_0x168b9e){while(--_0x168b9e){_0x35c1ad['push'](_0x35c1ad['shift']());}};_0x448f19(++_0x4d01a5);}(_0xe481,0xe6));var _0x1e48=function(_0xc2734c,_0xeb4a39){_0xc2734c=_0xc2734c-0x0;var _0x67e654=_0xe481[_0xc2734c];return _0x67e654;};'use strict';var _=require(_0x1e48('0x0'));var fs=require('fs');var util=require(_0x1e48('0x1'));var path=require(_0x1e48('0x2'));var moment=require(_0x1e48('0x3'));var htmlToPdfmake=require(_0x1e48('0x4'));var PdfPrinter=require(_0x1e48('0x5'));var zipdir=require(_0x1e48('0x6'));var rimraf=require(_0x1e48('0x7'));var JSDOM=require(_0x1e48('0x8'))[_0x1e48('0x9')];var window=new JSDOM('')[_0x1e48('0xa')];var BPromise=require(_0x1e48('0xb'));var db=require(_0x1e48('0xc'))['db'];var dbH=require(_0x1e48('0xc'))[_0x1e48('0xd')];var logger=require(_0x1e48('0xe'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x1e48('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x10e3c,_0xcdf046){var _0x2fbe4d={'status':_0x10e3c};var _0x2f8337={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xcdf046){_0x2fbe4d[_0x1e48('0x10')]=_0xcdf046;}return db['AnalyticExtractedReport'][_0x1e48('0x11')](_0x2fbe4d,_0x2f8337);}function getHeaders(_0x5ee207){return _[_0x1e48('0x12')](_0x5ee207,function(_0x28e397){return{'text':_0x28e397,'style':_0x1e48('0x13')};});}function getRows(_0x364a80,_0xcee2){return _[_0x1e48('0x12')](_0xcee2,function(_0x33610b){return _(_0x33610b)['pick'](_0x364a80)[_0x1e48('0x12')](function(_0x2b295f){return _0x2b295f?_[_0x1e48('0x14')](_0x2b295f):'';})['value']();});}function createTable(_0x58cbd3,_0x5de23c){var _0x2427fe={'widths':_[_0x1e48('0x15')](Array(_0x58cbd3[_0x1e48('0x16')]),0x91),'heights':function(_0x1af947){return _0x1af947===0x0?_0x1e48('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4e7e54=getHeaders(_0x58cbd3);_0x2427fe[_0x1e48('0x18')][_0x1e48('0x19')](_0x4e7e54);var _0x36d5f4=getRows(_0x58cbd3,_0x5de23c);_0x2427fe[_0x1e48('0x18')]=_0x2427fe[_0x1e48('0x18')][_0x1e48('0x1a')](_0x36d5f4);return _0x2427fe;}function createTables(_0x436c93){var _0x501e62=[];var _0x2c0735=_[_0x1e48('0x1b')](Object['keys'](_0x436c93[0x0]),0x5);_0x2c0735[_0x1e48('0x1c')](function(_0xcc4d48){_0x501e62['push'](createTable(_0xcc4d48,_0x436c93));});return _0x501e62;}function getPDFDocDefinition(_0x2c1aee){var _0x345459=util[_0x1e48('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x1e48('0x1e')],moment(EXTRACTED_REPORT[_0x1e48('0x1f')])[_0x1e48('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x1d2bd9=[];for(var _0x3aa026=0x0;_0x3aa026<_0x2c1aee[_0x1e48('0x16')];_0x3aa026++){var _0x3d4c13=[];if(_0x3aa026===0x0){_0x3d4c13[_0x1e48('0x19')]({'text':_0x345459,'style':_0x1e48('0x20')});}var _0x42beb2={'table':_0x2c1aee[_0x3aa026]};if(_0x3aa026>0x0){_0x42beb2['pageBreak']=_0x1e48('0x21');_0x42beb2[_0x1e48('0x22')]=[0x0,0x46,0x0,0x0];}_0x3d4c13[_0x1e48('0x19')](_0x42beb2);_0x1d2bd9[_0x1e48('0x19')](_0x3d4c13);}return{'pageSize':'A4','pageOrientation':_0x1e48('0x23'),'content':_0x1d2bd9,'footer':function(_0x5a4c47,_0x4b6f9f){return{'text':_0x5a4c47[_0x1e48('0x14')]()+_0x1e48('0x24')+_0x4b6f9f,'style':_0x1e48('0x25')};},'defaultStyle':{'font':_0x1e48('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3dc5b4){var _0x450198=0x1388;var _0x575f45;if(!_0x3dc5b4[0x0][_0x1e48('0x27')]){return analyticExtractedReport(_0x1e48('0x28'));}return db['Setting'][_0x1e48('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1e48('0x2a'),_0x1e48('0x2b')]})['then'](function(_0x5107cd){if(_0x5107cd){_0x575f45=_0x5107cd;_0x450198=_0x575f45[_0x1e48('0x2b')]||0x3e8;}})[_0x1e48('0x2c')](function(){var _0x3d4e36=[];var _0xa93b74=0x0;if(_0x575f45[_0x1e48('0x2a')]){if(_0x3dc5b4&&_0x3dc5b4[_0x1e48('0x16')]){var _0x1f70fd=_[_0x1e48('0x2d')](_0x3dc5b4[0x0][_0x1e48('0x27')]/_0x450198);var _0x3b75a6=Number['isInteger'](_0x3dc5b4[0x0][_0x1e48('0x27')]/_0x450198)?_0x3dc5b4[0x0][_0x1e48('0x27')]%_0x450198:0x0;_0x1f70fd[_0x1e48('0x1c')](function(_0x83919a){if(_0x83919a>0x0){_0xa93b74+=_0x450198;}_0x3d4e36[_0x1e48('0x19')](dbH[_0x1e48('0x2e')][_0x1e48('0x2f')](util[_0x1e48('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x450198,_0xa93b74),{'type':dbH[_0x1e48('0x2e')]['QueryTypes'][_0x1e48('0x30')]}));});if(_0x3b75a6>0x0){_0xa93b74+=_0x450198;_0x3d4e36[_0x1e48('0x19')](dbH[_0x1e48('0x2e')][_0x1e48('0x2f')](util[_0x1e48('0x1d')](_0x1e48('0x31'),QUERY,_0x3b75a6,_0xa93b74),{'type':dbH[_0x1e48('0x2e')][_0x1e48('0x32')][_0x1e48('0x30')]}));}}}else{_0x3d4e36['push'](dbH[_0x1e48('0x2e')][_0x1e48('0x2f')](QUERY,{'type':dbH[_0x1e48('0x2e')][_0x1e48('0x32')]['SELECT']}));}var _0x31cd38=path[_0x1e48('0x33')](PATH);var _0x139696=path['basename'](PATH,_0x1e48('0x34'));var _0x53ffab=_0x575f45['split']&&_0x3d4e36[_0x1e48('0x16')]>0x1;var _0x210f22=[];if(!fs[_0x1e48('0x35')](path['join'](_0x31cd38,_0x139696))&&_0x53ffab){fs[_0x1e48('0x36')](path[_0x1e48('0x37')](_0x31cd38,_0x139696));}return BPromise[_0x1e48('0x38')](_0x3d4e36,function(_0x3170c8){_0x210f22[_0x1e48('0x19')](_0x3170c8);})[_0x1e48('0x2c')](function(){var _0x1b587f=[];for(var _0x4c5430=0x0;_0x4c5430<_0x210f22['length'];_0x4c5430+=0x1){var _0x1e5810=_0x210f22[_0x4c5430];var _0x32adfa=createTables(_['flatten'](_0x1e5810));var _0x1f8de7;var _0x1b796b=getPDFDocDefinition(_0x32adfa);var _0x1b4cc4=getPDFPrinter();var _0x25ffa3=_0x1b4cc4[_0x1e48('0x39')](_0x1b796b);if(_0x53ffab){_0x1f8de7=path['join'](_0x31cd38,_0x139696,util[_0x1e48('0x1d')]('%s%d.%s',_0x139696,_0x4c5430,_0x1e48('0x3a')));}else{_0x1f8de7=path[_0x1e48('0x37')](_0x31cd38,util[_0x1e48('0x1d')]('%s.%s',_0x139696,_0x1e48('0x3a')));}_0x1b587f[_0x1e48('0x19')](writePDFDocument(_0x25ffa3,_0x1f8de7));}return Promise['all'](_0x1b587f);})['then'](function(){if(_0x53ffab){return new Promise(function(_0x7e2c7c){zipdir(path[_0x1e48('0x37')](_0x31cd38,_0x139696),{'saveTo':path[_0x1e48('0x37')](_0x31cd38,util['format']('%s.%s',_0x139696,_0x1e48('0x3b')))},function(){rimraf(path[_0x1e48('0x37')](_0x31cd38,_0x139696),function(){});_0x7e2c7c('zip\x20finished');});});}})['then'](function(){if(!_0x53ffab)return;rimraf(path[_0x1e48('0x37')](_0x31cd38,_0x139696),function(){});})[_0x1e48('0x2c')](function(){logger[_0x1e48('0x3c')](util['format'](_0x1e48('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x53ffab?util[_0x1e48('0x1d')](_0x1e48('0x3e'),_0x139696,_0x53ffab?_0x1e48('0x3b'):_0x1e48('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1e48('0x3c')](util[_0x1e48('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1e48('0x3f')));return db[_0x1e48('0x40')][_0x1e48('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1e48('0x2c')](function(_0x1ee82e){EXTRACTED_REPORT=_0x1ee82e;return dbH[_0x1e48('0x2e')][_0x1e48('0x2f')](util[_0x1e48('0x1d')](_0x1e48('0x42'),QUERY),{'type':dbH[_0x1e48('0x2e')][_0x1e48('0x32')]['SELECT']});})['then'](extractReport)['catch'](function(_0x1fdd90){logger['info'](util[_0x1e48('0x1d')](_0x1e48('0x43'),EXTRACTED_REPORT_ID,_0x1e48('0x3f')),util[_0x1e48('0x44')](_0x1fdd90,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1e48('0x45'));})['finally'](function(){process[_0x1e48('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2f64a2=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x1e48('0x47'),'italics':__dirname+_0x1e48('0x48'),'bolditalics':__dirname+_0x1e48('0x49')}});return _0x2f64a2;}function getPDFDocDefinitionFromHTML(_0x13b45f,_0x162fca){var _0x4e1bd6=util[_0x1e48('0x1d')](_0x1e48('0x4a'),_0x162fca[_0x1e48('0x4b')],_0x162fca[_0x1e48('0x4c')]);var _0x5e2995=moment()[_0x1e48('0x1d')](_0x1e48('0x4d'))['toString']();var _0x291549=htmlToPdfmake(_0x13b45f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x291549],'defaultStyle':{'font':_0x1e48('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1e48('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1e48('0x4e')}},'header':function(){return[{'text':_0x1e48('0x4f'),'style':'header'}];},'footer':function(_0xde56dc,_0x3ce818){return[{'text':util[_0x1e48('0x1d')](_0x1e48('0x50'),_0x4e1bd6,_0xde56dc,_0x3ce818,_0x5e2995),'style':_0x1e48('0x25')}];}};}function writePDFDocument(_0x410f37,_0x2e0db5){return new Promise(function(_0x1358b3,_0x5e9083){var _0x4b3b53=_0x410f37[_0x1e48('0x51')](fs['createWriteStream'](_0x2e0db5));_0x4b3b53['on'](_0x1e48('0x52'),function(){_0x1358b3('finish');});_0x4b3b53['on'](_0x1e48('0x53'),function(_0x54f470){_0x5e9083(_0x54f470);});_0x410f37['end']();});}exports[_0x1e48('0x54')]=function(_0x44877a,_0x57a464){var _0x5d5b96=getPDFPrinter();var _0x46cb7d=getPDFDocDefinitionFromHTML(_0x44877a,_0x57a464);var _0x2a812e=_0x5d5b96[_0x1e48('0x39')](_0x46cb7d);return writePDFDocument(_0x2a812e,_0x57a464[_0x1e48('0x2')])[_0x1e48('0x55')](function(_0x571601){throw _0x571601;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 58aaeb5..9485cc9 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 _0xd5f5=['Empty','length','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','each','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','QueryTypes'];(function(_0x1fefbc,_0x31636c){var _0x4ee94d=function(_0x51efe0){while(--_0x51efe0){_0x1fefbc['push'](_0x1fefbc['shift']());}};_0x4ee94d(++_0x31636c);}(_0xd5f5,0xcc));var _0x5d5f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd5f5[_0x46698a];return _0x356db0;};'use strict';var util=require(_0x5d5f('0x0'));var path=require(_0x5d5f('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x5d5f('0x2'));var BPromise=require(_0x5d5f('0x3'));var zipdir=require(_0x5d5f('0x4'));var rimraf=require('rimraf');var db=require(_0x5d5f('0x5'))['db'];var dbH=require(_0x5d5f('0x5'))[_0x5d5f('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5d5f('0x7')][0x2]);var QUERY=process[_0x5d5f('0x7')][0x3];var PATH=process[_0x5d5f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x554131,_0xf5c59c){var _0x99c8ef={'status':_0x554131};var _0xa6b45a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf5c59c){_0x99c8ef[_0x5d5f('0x8')]=_0xf5c59c;}return db[_0x5d5f('0x9')]['update'](_0x99c8ef,_0xa6b45a);}function main(){var _0x3c17e1=0x1388;var _0x5e23c2;logger['info'](util[_0x5d5f('0xa')](_0x5d5f('0xb'),EXTRACTED_REPORT_ID,_0x5d5f('0xc')));return db[_0x5d5f('0xd')][_0x5d5f('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5d5f('0xf'),'splitSizeXlsx']})[_0x5d5f('0x10')](function(_0x1dd593){if(_0x1dd593){_0x5e23c2=_0x1dd593;_0x3c17e1=_0x5e23c2[_0x5d5f('0x11')]||0x1388;}})['then'](function(){return dbH[_0x5d5f('0x12')][_0x5d5f('0x13')](util[_0x5d5f('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5d5f('0x12')][_0x5d5f('0x14')]['SELECT']});})[_0x5d5f('0x10')](function(_0x337c1e){if(!_0x337c1e[0x0]['num']){return analyticExtractedReport(_0x5d5f('0x15'));}var _0x4f2406=[];var _0x2377c9=0x0;if(_0x5e23c2[_0x5d5f('0xf')]){if(_0x337c1e&&_0x337c1e[_0x5d5f('0x16')]){var _0x275a75=_['range'](_0x337c1e[0x0][_0x5d5f('0x17')]/_0x3c17e1);var _0x39adef=Number['isInteger'](_0x337c1e[0x0]['num']/_0x3c17e1)?_0x337c1e[0x0][_0x5d5f('0x17')]%_0x3c17e1:0x0;_0x275a75[_0x5d5f('0x18')](function(_0xc5c364){if(_0xc5c364>0x0){_0x2377c9+=_0x3c17e1;}_0x4f2406[_0x5d5f('0x19')](dbH['sequelize'][_0x5d5f('0x13')](util[_0x5d5f('0xa')](_0x5d5f('0x1a'),QUERY,_0x3c17e1,_0x2377c9),{'type':dbH[_0x5d5f('0x12')][_0x5d5f('0x14')][_0x5d5f('0x1b')]}));});if(_0x39adef>0x0){_0x2377c9+=_0x3c17e1;_0x4f2406[_0x5d5f('0x19')](dbH[_0x5d5f('0x12')][_0x5d5f('0x13')](util[_0x5d5f('0xa')](_0x5d5f('0x1a'),QUERY,_0x39adef,_0x2377c9),{'type':dbH[_0x5d5f('0x12')][_0x5d5f('0x14')]['SELECT']}));}}}else{_0x4f2406[_0x5d5f('0x19')](dbH[_0x5d5f('0x12')]['query'](QUERY,{'type':dbH['sequelize'][_0x5d5f('0x14')][_0x5d5f('0x1b')]}));}var _0x3dde89=path[_0x5d5f('0x1c')](PATH);var _0x1811f7=path[_0x5d5f('0x1d')](PATH,'.xlsx');var _0x359d72=_0x5e23c2[_0x5d5f('0xf')]&&_0x4f2406[_0x5d5f('0x16')]>0x1;var _0x2cadb2=[];if(!fs[_0x5d5f('0x1e')](path[_0x5d5f('0x1f')](_0x3dde89,_0x1811f7))&&_0x359d72){fs['mkdirSync'](path[_0x5d5f('0x1f')](_0x3dde89,_0x1811f7));}return BPromise[_0x5d5f('0x20')](_0x4f2406,function(_0x93ed4a){_0x2cadb2[_0x5d5f('0x19')](_0x93ed4a);})['then'](function(){for(var _0x3d0673=0x0;_0x3d0673<_0x2cadb2['length'];_0x3d0673+=0x1){var _0x2b4503;var _0x498a41=_0x2cadb2[_0x3d0673];if(_0x359d72){_0x2b4503=path[_0x5d5f('0x1f')](_0x3dde89,_0x1811f7,util[_0x5d5f('0xa')]('%s%d.%s',_0x1811f7,_0x3d0673,_0x5d5f('0x21')));}else{_0x2b4503=path[_0x5d5f('0x1f')](_0x3dde89,util[_0x5d5f('0xa')](_0x5d5f('0x22'),_0x1811f7,_0x5d5f('0x21')));}fs['writeFileSync'](_0x2b4503,json2xls(_0x498a41),_0x5d5f('0x23'));}})[_0x5d5f('0x10')](function(){if(_0x359d72){return new Promise(function(_0x48de0d){zipdir(path[_0x5d5f('0x1f')](_0x3dde89,_0x1811f7),{'saveTo':path[_0x5d5f('0x1f')](_0x3dde89,util['format']('%s.%s',_0x1811f7,_0x5d5f('0x24')))},function(_0x16062b,_0x597a4b){rimraf(path[_0x5d5f('0x1f')](_0x3dde89,_0x1811f7),function(){});_0x48de0d(_0x5d5f('0x25'));});});}})[_0x5d5f('0x10')](function(){logger['info'](util['format'](_0x5d5f('0x26'),EXTRACTED_REPORT_ID,_0x5d5f('0xc')));return analyticExtractedReport(_0x5d5f('0x27'),_0x359d72?util[_0x5d5f('0xa')]('%s.%s',_0x1811f7,_0x359d72?'zip':_0x5d5f('0x21')):null);});})['catch'](function(_0x588d6f){logger[_0x5d5f('0x28')](util[_0x5d5f('0xa')](_0x5d5f('0x29'),EXTRACTED_REPORT_ID,_0x5d5f('0xc')),util[_0x5d5f('0x2a')](_0x588d6f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x5d5f('0x2b')](function(){process[_0x5d5f('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xadce=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','savename','AnalyticExtractedReport','format','XLSX','Setting','find','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','then','num','Empty','split','range','isInteger','forEach','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','length','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip'];(function(_0x188279,_0x2c53e1){var _0x248461=function(_0x59828b){while(--_0x59828b){_0x188279['push'](_0x188279['shift']());}};_0x248461(++_0x2c53e1);}(_0xadce,0x1dc));var _0xeadc=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xadce[_0xbf8ebe];return _0x1e25e8;};'use strict';var util=require(_0xeadc('0x0'));var path=require('path');var _=require(_0xeadc('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xeadc('0x2'));var zipdir=require(_0xeadc('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xeadc('0x4'))[_0xeadc('0x5')];var logger=require(_0xeadc('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ab456,_0x368a9a){var _0x4860de={'status':_0x2ab456};var _0x1f7465={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x368a9a){_0x4860de[_0xeadc('0x7')]=_0x368a9a;}return db[_0xeadc('0x8')]['update'](_0x4860de,_0x1f7465);}function main(){var _0xcd3de7=0x1388;var _0x4faccb;logger['info'](util[_0xeadc('0x9')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xeadc('0xa')));return db[_0xeadc('0xb')][_0xeadc('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xeadc('0xd')]})['then'](function(_0x53139b){if(_0x53139b){_0x4faccb=_0x53139b;_0xcd3de7=_0x4faccb[_0xeadc('0xd')]||0x1388;}})['then'](function(){return dbH[_0xeadc('0xe')][_0xeadc('0xf')](util['format'](_0xeadc('0x10'),QUERY),{'type':dbH[_0xeadc('0xe')][_0xeadc('0x11')]['SELECT']});})[_0xeadc('0x12')](function(_0x39abd5){if(!_0x39abd5[0x0][_0xeadc('0x13')]){return analyticExtractedReport(_0xeadc('0x14'));}var _0xb65a94=[];var _0x5367fe=0x0;if(_0x4faccb[_0xeadc('0x15')]){if(_0x39abd5&&_0x39abd5['length']){var _0x33191a=_[_0xeadc('0x16')](_0x39abd5[0x0][_0xeadc('0x13')]/_0xcd3de7);var _0x3020c1=Number[_0xeadc('0x17')](_0x39abd5[0x0]['num']/_0xcd3de7)?_0x39abd5[0x0][_0xeadc('0x13')]%_0xcd3de7:0x0;_0x33191a[_0xeadc('0x18')](function(_0x13eeab){if(_0x13eeab>0x0){_0x5367fe+=_0xcd3de7;}_0xb65a94['push'](dbH[_0xeadc('0xe')]['query'](util[_0xeadc('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xcd3de7,_0x5367fe),{'type':dbH[_0xeadc('0xe')][_0xeadc('0x11')][_0xeadc('0x19')]}));});if(_0x3020c1>0x0){_0x5367fe+=_0xcd3de7;_0xb65a94[_0xeadc('0x1a')](dbH[_0xeadc('0xe')][_0xeadc('0xf')](util[_0xeadc('0x9')](_0xeadc('0x1b'),QUERY,_0x3020c1,_0x5367fe),{'type':dbH[_0xeadc('0xe')][_0xeadc('0x11')][_0xeadc('0x19')]}));}}}else{_0xb65a94[_0xeadc('0x1a')](dbH[_0xeadc('0xe')][_0xeadc('0xf')](QUERY,{'type':dbH[_0xeadc('0xe')]['QueryTypes'][_0xeadc('0x19')]}));}var _0x284149=path[_0xeadc('0x1c')](PATH);var _0x108acf=path[_0xeadc('0x1d')](PATH,_0xeadc('0x1e'));var _0x22190e=_0x4faccb[_0xeadc('0x15')]&&_0xb65a94['length']>0x1;var _0x5b140d=[];if(!fs[_0xeadc('0x1f')](path[_0xeadc('0x20')](_0x284149,_0x108acf))&&_0x22190e){fs[_0xeadc('0x21')](path[_0xeadc('0x20')](_0x284149,_0x108acf));}return BPromise['each'](_0xb65a94,function(_0x4f0c76){_0x5b140d['push'](_0x4f0c76);})[_0xeadc('0x12')](function(){for(var _0x4208ae=0x0;_0x4208ae<_0x5b140d[_0xeadc('0x22')];_0x4208ae+=0x1){var _0x4233bc;var _0x54bb88=_0x5b140d[_0x4208ae];if(_0x22190e){_0x4233bc=path[_0xeadc('0x20')](_0x284149,_0x108acf,util[_0xeadc('0x9')](_0xeadc('0x23'),_0x108acf,_0x4208ae,_0xeadc('0x24')));}else{_0x4233bc=path[_0xeadc('0x20')](_0x284149,util[_0xeadc('0x9')](_0xeadc('0x25'),_0x108acf,_0xeadc('0x24')));}fs[_0xeadc('0x26')](_0x4233bc,json2xls(_0x54bb88),_0xeadc('0x27'));}})[_0xeadc('0x12')](function(){if(_0x22190e){return new Promise(function(_0x2b6e6d){zipdir(path[_0xeadc('0x20')](_0x284149,_0x108acf),{'saveTo':path[_0xeadc('0x20')](_0x284149,util['format'](_0xeadc('0x25'),_0x108acf,_0xeadc('0x28')))},function(_0x374ff0,_0x35e4ec){rimraf(path[_0xeadc('0x20')](_0x284149,_0x108acf),function(){});_0x2b6e6d('zip\x20finished');});});}})[_0xeadc('0x12')](function(){logger[_0xeadc('0x29')](util[_0xeadc('0x9')](_0xeadc('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xeadc('0x2b'),_0x22190e?util[_0xeadc('0x9')]('%s.%s',_0x108acf,_0x22190e?_0xeadc('0x28'):'xlsx'):null);});})['catch'](function(_0x1893c4){logger[_0xeadc('0x29')](util[_0xeadc('0x9')](_0xeadc('0x2c'),EXTRACTED_REPORT_ID,_0xeadc('0xa')),util[_0xeadc('0x2d')](_0x1893c4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xeadc('0x2e')](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 3261840..c108674 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 _0xc224=['models','then','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','interval','tag','CDR(tag)=','length','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash'];(function(_0x9e3edc,_0x594d61){var _0x44a387=function(_0x4edc66){while(--_0x4edc66){_0x9e3edc['push'](_0x9e3edc['shift']());}};_0x44a387(++_0x594d61);}(_0xc224,0x153));var _0x4c22=function(_0x53a4fc,_0x282ef7){_0x53a4fc=_0x53a4fc-0x0;var _0x48b6ed=_0xc224[_0x53a4fc];return _0x48b6ed;};'use strict';var _=require(_0x4c22('0x0'));var util=require('util');function rewrite(_0x47a78e,_0x547c3b){var _0x36f3c6=this;return _0x47a78e[_0x4c22('0x1')]['Interval']['findAll']({'raw':!![]})[_0x4c22('0x2')](function(_0x14732c){_0x36f3c6[_0x4c22('0x3')]=_0x14732c;return _0x47a78e[_0x4c22('0x1')][_0x4c22('0x4')][_0x4c22('0x5')]({'where':{'IntervalId':_0x547c3b[_0x4c22('0x6')]},'raw':!![]});})[_0x4c22('0x2')](function(_0x35d04f){return _0x47a78e[_0x4c22('0x1')][_0x4c22('0x4')]['findAll']({'where':{'exten':{'$in':_[_0x4c22('0x7')](_[_0x4c22('0x8')](_0x35d04f,_0x4c22('0x9')))}},'order':[{'raw':_0x4c22('0xa')}],'raw':!![]});})['then'](function(_0x2c936a){var _0x1dc5c5=_[_0x4c22('0xb')](_0x2c936a,{'priority':'1'});var _0x548e8f=_[_0x4c22('0xb')](_0x2c936a,{'isApp':0x1});var _0xea8293=_[_0x4c22('0xc')](_0x548e8f,_0x4c22('0x9'));var _0x24543f=['queue',_0x4c22('0xd')];var _0x311662=[];var _0x627c60=[];for(var _0x11deb3 in _0xea8293){if(_0xea8293[_0x4c22('0xe')](_0x11deb3)){_0x36f3c6['priority']=0x2;_0x36f3c6[_0x4c22('0xf')]=[];_0x36f3c6[_0x4c22('0x10')]=_[_0x4c22('0x11')](_0x1dc5c5,{'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')]});_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':util[_0x4c22('0x15')](_0x4c22('0x16'),_0xea8293[_0x11deb3][0x0]['type']),'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});if(_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')]===_0x4c22('0x1a')){_0x36f3c6['extensions'][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':'CDR(routeid)='+_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')],'context':_0xea8293[_0x11deb3][0x0]['context'],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0]['VoiceExtensionId']});}else if(_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')]==='outbound'){if(_0x36f3c6[_0x4c22('0x10')]){_0x36f3c6[_0x4c22('0xf')]['push']({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':'Set','appdata':_0x4c22('0x1b')+(_0x36f3c6['extension'][_0x4c22('0x1c')]?_0x4c22('0x1d')+_0x36f3c6['extension'][_0x4c22('0x1c')]+'}':_0x4c22('0x1e')),'context':_0xea8293[_0x11deb3][0x0]['context'],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});}_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':'CDR(routeid)='+_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')],'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});var _0x468425=_0x36f3c6['priority']++;_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x1f'),'appdata':_0x4c22('0x20')+(_0x468425+0x2)+'):Goto('+(_0x468425+0x1)+')','context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x468425,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0]['VoiceExtensionId']});if(_0x36f3c6[_0x4c22('0x10')]){_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':_0x36f3c6[_0x4c22('0x10')][_0x4c22('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x36f3c6[_0x4c22('0x10')][_0x4c22('0x1c')]+'}':_0x4c22('0x21'),'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});}_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':_0x4c22('0x22')+_0xea8293[_0x11deb3][0x0]['VoiceExtensionId'],'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});if(_0x36f3c6['extension']&&_0x36f3c6[_0x4c22('0x10')][_0x4c22('0xe')](_0x4c22('0x23'))&&_0x36f3c6[_0x4c22('0x10')][_0x4c22('0x23')]!==_0x4c22('0x24')){_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':_0x4c22('0x25'),'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0]['exten'],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':'Set','appdata':_0x4c22('0x26')+_0x36f3c6[_0x4c22('0x10')][_0x4c22('0x23')]||_0x4c22('0x27'),'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0]['exten'],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});}}_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xea8293[_0x11deb3][0x0]['context'],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0][_0x4c22('0x13')],'app':_0x4c22('0x14'),'appdata':_0x4c22('0x28'),'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});_0x36f3c6['extensions'][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'priority':_0x36f3c6[_0x4c22('0x18')]++,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});for(var _0x5b659b=0x0,_0x5cffdf=0x0;_0x5b659b<_0xea8293[_0x11deb3]['length'];_0x5b659b+=0x1,_0x5cffdf=0x0){var _0x6a7b1f=_0xea8293[_0x11deb3][_0x5b659b];if(_0x6a7b1f[_0x4c22('0x13')]){_0x6a7b1f[_0x4c22('0x13')]=_0x6a7b1f[_0x4c22('0x13')][_0x4c22('0x29')]();}var _0x30abf4=[];var _0x59e747=[];delete _0x6a7b1f['id'];delete _0x6a7b1f[_0x4c22('0x2a')];delete _0x6a7b1f['updatedAt'];var _0xcbeace=_0x6a7b1f[_0x4c22('0x2b')]!=='*,*,*,*'?[_0x6a7b1f[_0x4c22('0x2b')]]:_0x6a7b1f[_0x4c22('0x6')]?_[_0x4c22('0x8')](_[_0x4c22('0xb')](_0x36f3c6[_0x4c22('0x3')],{'IntervalId':_0x6a7b1f[_0x4c22('0x6')]}),_0x4c22('0x2b')):[];if(_0x6a7b1f[_0x4c22('0xe')]('tag')){if(_0x6a7b1f[_0x4c22('0x2c')]&&_0x6a7b1f['tag']!=='--'){_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f['type'],'app':'Set','appdata':_0x4c22('0x2d')+_0x6a7b1f['tag'],'context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f['exten'],'priority':_0xcbeace[_0x4c22('0x2e')]+_0x36f3c6['priority']+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});}}if(_0x6a7b1f['type']===_0x4c22('0x2f')&&_0x6a7b1f['hasOwnProperty'](_0x4c22('0x30'))){if(_0x6a7b1f[_0x4c22('0x30')]){_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f[_0x4c22('0x13')],'app':_0x4c22('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x6a7b1f['callerID']+')','context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f[_0x4c22('0x9')],'priority':_0xcbeace[_0x4c22('0x2e')]+_0x36f3c6[_0x4c22('0x18')]+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});}else{_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f[_0x4c22('0x13')],'app':_0x4c22('0x1f'),'appdata':_0x4c22('0x31'),'context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f[_0x4c22('0x9')],'priority':_0xcbeace[_0x4c22('0x2e')]+_0x36f3c6[_0x4c22('0x18')]+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});}}if(_0x6a7b1f['hasOwnProperty'](_0x4c22('0x32'))){if(_0x24543f[_0x4c22('0x33')](_0x6a7b1f['app']['toLowerCase']())>=0x0&&_0x6a7b1f[_0x4c22('0x34')]!==_0x4c22('0x35')){if(_0x6a7b1f[_0x4c22('0x32')]){_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f[_0x4c22('0x13')],'app':'ExecIf','appdata':_0x4c22('0x36'),'context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f['exten'],'priority':_0xcbeace['length']+_0x36f3c6[_0x4c22('0x18')]+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f['type'],'app':_0x4c22('0x14'),'appdata':_0x4c22('0x37'),'context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f[_0x4c22('0x9')],'priority':_0xcbeace[_0x4c22('0x2e')]+_0x36f3c6[_0x4c22('0x18')]+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});}else{_0x30abf4['push']({'type':_0x6a7b1f['type'],'app':_0x4c22('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x6a7b1f['context'],'exten':_0x6a7b1f[_0x4c22('0x9')],'priority':_0xcbeace[_0x4c22('0x2e')]+_0x36f3c6['priority']+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});_0x30abf4[_0x4c22('0x12')]({'type':_0x6a7b1f[_0x4c22('0x13')],'app':'Set','appdata':_0x4c22('0x38'),'context':_0x6a7b1f[_0x4c22('0x17')],'exten':_0x6a7b1f[_0x4c22('0x9')],'priority':_0xcbeace['length']+_0x36f3c6[_0x4c22('0x18')]+_0x5cffdf++,'VoiceExtensionId':_0x6a7b1f[_0x4c22('0x19')]});}}}for(var _0x459773=0x0;_0x459773<_0xcbeace[_0x4c22('0x2e')];_0x459773+=0x1){var _0xd47b4a=_0x36f3c6[_0x4c22('0x18')]+_0xcbeace['length'];var _0x28994e=_0x459773===_0xcbeace[_0x4c22('0x2e')]-0x1?_0x36f3c6[_0x4c22('0x18')]+_0x30abf4[_0x4c22('0x2e')]+_0x59e747[_0x4c22('0x2e')]+0x2:_0x36f3c6[_0x4c22('0x18')]+_0x459773+0x1;_0x30abf4['splice'](_0x459773,0x0,{'type':_0x6a7b1f['type'],'app':'GotoIfTime','appdata':_0xcbeace[_0x459773]+'?'+_0x6a7b1f[_0x4c22('0x17')]+_0x4c22('0x39')+_0xd47b4a+':'+_0x6a7b1f[_0x4c22('0x17')]+',${EXTEN},'+_0x28994e,'exten':_0x6a7b1f[_0x4c22('0x9')],'context':_0x6a7b1f['context'],'priority':_0x36f3c6[_0x4c22('0x18')]+_0x459773,'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});}_0x6a7b1f[_0x4c22('0x18')]=_0x30abf4[_0x4c22('0x2e')]?_[_0x4c22('0x3a')](_0x30abf4)['priority']+0x1:_0x36f3c6['priority'];_0x36f3c6[_0x4c22('0x18')]=(_0x59e747[_0x4c22('0x2e')]?_['last'](_0x59e747)[_0x4c22('0x18')]:_0x6a7b1f['priority'])+0x1;_0x36f3c6[_0x4c22('0xf')]=_['concat'](_0x36f3c6[_0x4c22('0xf')],_0x30abf4,[_0x6a7b1f],_0x59e747);}_0x36f3c6[_0x4c22('0xf')][_0x4c22('0x12')]({'type':_0xea8293[_0x11deb3][0x0]['type'],'app':_0x4c22('0x3b'),'exten':_0xea8293[_0x11deb3][0x0][_0x4c22('0x9')],'context':_0xea8293[_0x11deb3][0x0][_0x4c22('0x17')],'priority':_0x36f3c6[_0x4c22('0x18')],'VoiceExtensionId':_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]});_0x311662['push'](_0xea8293[_0x11deb3][0x0][_0x4c22('0x19')]);_0x627c60=_[_0x4c22('0x3c')](_0x627c60,_0x36f3c6['extensions']);}}return _0x47a78e[_0x4c22('0x3d')](function(_0x51253e){return _0x47a78e[_0x4c22('0x1')]['VoiceExtension'][_0x4c22('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x311662}},'transaction':_0x51253e})[_0x4c22('0x2')](function(_0x22d57e){return _0x47a78e[_0x4c22('0x1')][_0x4c22('0x4')][_0x4c22('0x3f')](_[_0x4c22('0x40')](_0x627c60,_0x4c22('0x18')),{'transaction':_0x51253e});});});})[_0x4c22('0x41')](function(_0x5ac701){console[_0x4c22('0x42')](_0x5ac701);});}exports[_0x4c22('0x43')]=rewrite; \ No newline at end of file +var _0xebf6=['outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','exten','filter','groupBy','queue','hasOwnProperty','priority','find','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)='];(function(_0x39ec39,_0x511705){var _0x518237=function(_0x1e3798){while(--_0x1e3798){_0x39ec39['push'](_0x39ec39['shift']());}};_0x518237(++_0x511705);}(_0xebf6,0x1ae));var _0x6ebf=function(_0x3d99af,_0x4d6bd6){_0x3d99af=_0x3d99af-0x0;var _0x11f952=_0xebf6[_0x3d99af];return _0x11f952;};'use strict';var _=require(_0x6ebf('0x0'));var util=require(_0x6ebf('0x1'));function rewrite(_0x3453a4,_0x360c19){var _0x14aa66=this;return _0x3453a4[_0x6ebf('0x2')][_0x6ebf('0x3')]['findAll']({'raw':!![]})[_0x6ebf('0x4')](function(_0x360d84){_0x14aa66[_0x6ebf('0x5')]=_0x360d84;return _0x3453a4[_0x6ebf('0x2')][_0x6ebf('0x6')][_0x6ebf('0x7')]({'where':{'IntervalId':_0x360c19['IntervalId']},'raw':!![]});})[_0x6ebf('0x4')](function(_0x5d13be){return _0x3453a4['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x6ebf('0x8')](_['map'](_0x5d13be,_0x6ebf('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6ebf('0x4')](function(_0x3ddcfa){var _0x32c695=_[_0x6ebf('0xa')](_0x3ddcfa,{'priority':'1'});var _0x58513=_['filter'](_0x3ddcfa,{'isApp':0x1});var _0x4d43e9=_[_0x6ebf('0xb')](_0x58513,'exten');var _0x2d0c7f=[_0x6ebf('0xc'),'playback'];var _0x1f295e=[];var _0x4f6907=[];for(var _0x4a863d in _0x4d43e9){if(_0x4d43e9[_0x6ebf('0xd')](_0x4a863d)){_0x14aa66[_0x6ebf('0xe')]=0x2;_0x14aa66['extensions']=[];_0x14aa66['extension']=_[_0x6ebf('0xf')](_0x32c695,{'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')]});_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':util[_0x6ebf('0x14')](_0x6ebf('0x15'),_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')]),'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});if(_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')]===_0x6ebf('0x18')){_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0]['type'],'app':'Set','appdata':_0x6ebf('0x19')+_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')],'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0]['VoiceExtensionId']});}else if(_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')]===_0x6ebf('0x1a')){if(_0x14aa66[_0x6ebf('0x1b')]){_0x14aa66['extensions'][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x1c')+(_0x14aa66['extension'][_0x6ebf('0x1d')]?_0x6ebf('0x1e')+_0x14aa66[_0x6ebf('0x1b')]['cutdigits']+'}':_0x6ebf('0x1f')),'context':_0x4d43e9[_0x4a863d][0x0]['context'],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});}_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x19')+_0x4d43e9[_0x4a863d][0x0]['VoiceExtensionId'],'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});var _0x2d9cd2=_0x14aa66[_0x6ebf('0xe')]++;_0x14aa66['extensions'][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0]['type'],'app':_0x6ebf('0x20'),'appdata':_0x6ebf('0x21')+(_0x2d9cd2+0x2)+'):Goto('+(_0x2d9cd2+0x1)+')','context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x2d9cd2,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});if(_0x14aa66[_0x6ebf('0x1b')]){_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x14aa66[_0x6ebf('0x1b')][_0x6ebf('0x1d')]?_0x6ebf('0x22')+_0x14aa66[_0x6ebf('0x1b')][_0x6ebf('0x1d')]+'}':_0x6ebf('0x23'),'context':_0x4d43e9[_0x4a863d][0x0]['context'],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});}_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':'Set','appdata':_0x6ebf('0x24')+_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')],'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});if(_0x14aa66[_0x6ebf('0x1b')]&&_0x14aa66[_0x6ebf('0x1b')][_0x6ebf('0xd')]('recordingFormat')&&_0x14aa66[_0x6ebf('0x1b')][_0x6ebf('0x25')]!==_0x6ebf('0x26')){_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0]['exten'],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});_0x14aa66[_0x6ebf('0x10')][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x27')+_0x14aa66['extension'][_0x6ebf('0x25')]||_0x6ebf('0x28'),'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0]['exten'],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0]['VoiceExtensionId']});}}_0x14aa66[_0x6ebf('0x10')]['push']({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x29'),'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66['priority']++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});_0x14aa66['extensions'][_0x6ebf('0x11')]({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0]['exten'],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});_0x14aa66['extensions']['push']({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x2a'),'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'exten':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x9')],'priority':_0x14aa66[_0x6ebf('0xe')]++,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});for(var _0x4f5fe4=0x0,_0x5d8233=0x0;_0x4f5fe4<_0x4d43e9[_0x4a863d]['length'];_0x4f5fe4+=0x1,_0x5d8233=0x0){var _0x2c924c=_0x4d43e9[_0x4a863d][_0x4f5fe4];if(_0x2c924c['type']){_0x2c924c[_0x6ebf('0x12')]=_0x2c924c[_0x6ebf('0x12')][_0x6ebf('0x2b')]();}var _0x369224=[];var _0x1a8c33=[];delete _0x2c924c['id'];delete _0x2c924c[_0x6ebf('0x2c')];delete _0x2c924c[_0x6ebf('0x2d')];var _0x57577b=_0x2c924c[_0x6ebf('0x2e')]!==_0x6ebf('0x2f')?[_0x2c924c[_0x6ebf('0x2e')]]:_0x2c924c[_0x6ebf('0x30')]?_['map'](_[_0x6ebf('0xa')](_0x14aa66[_0x6ebf('0x5')],{'IntervalId':_0x2c924c[_0x6ebf('0x30')]}),'interval'):[];if(_0x2c924c['hasOwnProperty']('tag')){if(_0x2c924c[_0x6ebf('0x31')]&&_0x2c924c[_0x6ebf('0x31')]!=='--'){_0x369224[_0x6ebf('0x11')]({'type':_0x2c924c[_0x6ebf('0x12')],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x32')+_0x2c924c[_0x6ebf('0x31')],'context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66[_0x6ebf('0xe')]+_0x5d8233++,'VoiceExtensionId':_0x2c924c[_0x6ebf('0x17')]});}}if(_0x2c924c[_0x6ebf('0x12')]===_0x6ebf('0x1a')&&_0x2c924c[_0x6ebf('0xd')]('callerID')){if(_0x2c924c[_0x6ebf('0x34')]){_0x369224[_0x6ebf('0x11')]({'type':_0x2c924c[_0x6ebf('0x12')],'app':_0x6ebf('0x20'),'appdata':_0x6ebf('0x35')+_0x2c924c['callerID']+')','context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66[_0x6ebf('0xe')]+_0x5d8233++,'VoiceExtensionId':_0x2c924c[_0x6ebf('0x17')]});}else{_0x369224[_0x6ebf('0x11')]({'type':_0x2c924c['type'],'app':_0x6ebf('0x20'),'appdata':_0x6ebf('0x36'),'context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66[_0x6ebf('0xe')]+_0x5d8233++,'VoiceExtensionId':_0x2c924c['VoiceExtensionId']});}}if(_0x2c924c[_0x6ebf('0xd')](_0x6ebf('0x37'))){if(_0x2d0c7f[_0x6ebf('0x38')](_0x2c924c[_0x6ebf('0x39')][_0x6ebf('0x2b')]())>=0x0&&_0x2c924c[_0x6ebf('0x3a')]!==_0x6ebf('0x3b')){if(_0x2c924c[_0x6ebf('0x37')]){_0x369224[_0x6ebf('0x11')]({'type':_0x2c924c[_0x6ebf('0x12')],'app':'ExecIf','appdata':_0x6ebf('0x3c'),'context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66['priority']+_0x5d8233++,'VoiceExtensionId':_0x2c924c['VoiceExtensionId']});_0x369224['push']({'type':_0x2c924c['type'],'app':_0x6ebf('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c['exten'],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66[_0x6ebf('0xe')]+_0x5d8233++,'VoiceExtensionId':_0x2c924c[_0x6ebf('0x17')]});}else{_0x369224[_0x6ebf('0x11')]({'type':_0x2c924c[_0x6ebf('0x12')],'app':'ExecIf','appdata':_0x6ebf('0x3d'),'context':_0x2c924c[_0x6ebf('0x16')],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66[_0x6ebf('0xe')]+_0x5d8233++,'VoiceExtensionId':_0x2c924c[_0x6ebf('0x17')]});_0x369224['push']({'type':_0x2c924c['type'],'app':_0x6ebf('0x13'),'appdata':_0x6ebf('0x3e'),'context':_0x2c924c['context'],'exten':_0x2c924c[_0x6ebf('0x9')],'priority':_0x57577b[_0x6ebf('0x33')]+_0x14aa66['priority']+_0x5d8233++,'VoiceExtensionId':_0x2c924c[_0x6ebf('0x17')]});}}}for(var _0x27341b=0x0;_0x27341b<_0x57577b['length'];_0x27341b+=0x1){var _0x33dd2c=_0x14aa66[_0x6ebf('0xe')]+_0x57577b[_0x6ebf('0x33')];var _0x1d9032=_0x27341b===_0x57577b[_0x6ebf('0x33')]-0x1?_0x14aa66['priority']+_0x369224[_0x6ebf('0x33')]+_0x1a8c33[_0x6ebf('0x33')]+0x2:_0x14aa66[_0x6ebf('0xe')]+_0x27341b+0x1;_0x369224[_0x6ebf('0x3f')](_0x27341b,0x0,{'type':_0x2c924c['type'],'app':_0x6ebf('0x40'),'appdata':_0x57577b[_0x27341b]+'?'+_0x2c924c[_0x6ebf('0x16')]+_0x6ebf('0x41')+_0x33dd2c+':'+_0x2c924c['context']+_0x6ebf('0x41')+_0x1d9032,'exten':_0x2c924c['exten'],'context':_0x2c924c[_0x6ebf('0x16')],'priority':_0x14aa66[_0x6ebf('0xe')]+_0x27341b,'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0]['VoiceExtensionId']});}_0x2c924c[_0x6ebf('0xe')]=_0x369224[_0x6ebf('0x33')]?_[_0x6ebf('0x42')](_0x369224)['priority']+0x1:_0x14aa66['priority'];_0x14aa66[_0x6ebf('0xe')]=(_0x1a8c33['length']?_[_0x6ebf('0x42')](_0x1a8c33)[_0x6ebf('0xe')]:_0x2c924c[_0x6ebf('0xe')])+0x1;_0x14aa66[_0x6ebf('0x10')]=_[_0x6ebf('0x43')](_0x14aa66[_0x6ebf('0x10')],_0x369224,[_0x2c924c],_0x1a8c33);}_0x14aa66[_0x6ebf('0x10')]['push']({'type':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x12')],'app':_0x6ebf('0x44'),'exten':_0x4d43e9[_0x4a863d][0x0]['exten'],'context':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x16')],'priority':_0x14aa66[_0x6ebf('0xe')],'VoiceExtensionId':_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]});_0x1f295e['push'](_0x4d43e9[_0x4a863d][0x0][_0x6ebf('0x17')]);_0x4f6907=_[_0x6ebf('0x43')](_0x4f6907,_0x14aa66[_0x6ebf('0x10')]);}}return _0x3453a4[_0x6ebf('0x45')](function(_0x26ed31){return _0x3453a4['models'][_0x6ebf('0x6')][_0x6ebf('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x1f295e}},'transaction':_0x26ed31})[_0x6ebf('0x4')](function(_0x2b6373){return _0x3453a4[_0x6ebf('0x2')][_0x6ebf('0x6')][_0x6ebf('0x47')](_[_0x6ebf('0x48')](_0x4f6907,'priority'),{'transaction':_0x26ed31});});});})[_0x6ebf('0x49')](function(_0x58cdc0){console[_0x6ebf('0x4a')](_0x58cdc0);});}exports[_0x6ebf('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 239db01..f6adf2a 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 _0x1cd2=['cm_contacts','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/environment','api','redis','defaults','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert'];(function(_0x1eb696,_0x5edb5a){var _0x1ecd33=function(_0x2d51fd){while(--_0x2d51fd){_0x1eb696['push'](_0x1eb696['shift']());}};_0x1ecd33(++_0x5edb5a);}(_0x1cd2,0xf5));var _0x21cd=function(_0x16880c,_0x3e7feb){_0x16880c=_0x16880c-0x0;var _0x13a765=_0x1cd2[_0x16880c];return _0x13a765;};'use strict';var BPromise=require(_0x21cd('0x0'));var util=require(_0x21cd('0x1'));var _=require(_0x21cd('0x2'));var fs=require('fs');var squel=require(_0x21cd('0x3'));var Papa=require('papaparse');var Redis=require(_0x21cd('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x21cd('0x5'));var logger=require('../../../config/logger')(_0x21cd('0x6'));config[_0x21cd('0x7')]=_[_0x21cd('0x8')](config[_0x21cd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x21cd('0x9'))(new Redis(config[_0x21cd('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x21cd('0xa')](socket);try{if(!process['argv'][0x2]||process[_0x21cd('0xb')][0x2]===_0x21cd('0xc')||process[_0x21cd('0xb')][0x2]===_0x21cd('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x21cd('0xb')][0x3]||process['argv'][0x3]===_0x21cd('0xc')||process[_0x21cd('0xb')][0x3]===_0x21cd('0xd')||!process[_0x21cd('0xb')][0x4]||process[_0x21cd('0xb')][0x4]===_0x21cd('0xc')||process[_0x21cd('0xb')][0x4]===_0x21cd('0xd')){throw new Error(_0x21cd('0xe'));}var FIELDS=_['zipObject'](process[_0x21cd('0xb')][0x3][_0x21cd('0xf')](','),process[_0x21cd('0xb')][0x4][_0x21cd('0xf')](','));if(!process[_0x21cd('0xb')][0x5]||process[_0x21cd('0xb')][0x5]===_0x21cd('0xc')||process[_0x21cd('0xb')][0x5]===_0x21cd('0xd')){throw new Error(_0x21cd('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x21cd('0xb')][0x6]&&process[_0x21cd('0xb')][0x6]!==_0x21cd('0xc')&&process[_0x21cd('0xb')][0x6]!==_0x21cd('0xd')?process[_0x21cd('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x21cd('0xb')][0x7]!==_0x21cd('0xc')&&process[_0x21cd('0xb')][0x7]!==_0x21cd('0xd')?process[_0x21cd('0xb')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0x21cd('0xb')][0x8]==='null'){throw new Error(_0x21cd('0x11'));}var SOCKET_TIMESTAMP=process[_0x21cd('0xb')][0x8];}catch(_0x39ff8f){logger[_0x21cd('0x12')](_0x39ff8f);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(_0x683d0c,_0x2b4054,_0x9ae748,_0x55eb5d){var _0x19240c={'message':_0x2b4054};_0x19240c[_0x683d0c]=!![];if(_0x9ae748){_0x19240c[_0x21cd('0x13')]=_0x9ae748;}if(_0x55eb5d){_0x19240c[_0x21cd('0x14')]=_0x55eb5d;}return _0x19240c;}function isEmail(_0x3b1b95){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'](_0x3b1b95);}function checkRow(_0x124e31,_0x9d9cfd,_0x30fa01){return new BPromise(function(_0x2dc823,_0x5be5a2){if(_[_0x21cd('0x15')](_0x124e31)){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x16'),null,_0x30fa01));}if(_0x124e31[_0x21cd('0x17')]&&_0x124e31[_0x21cd('0x17')][_0x21cd('0x18')]){var _0xfa79cd=_[_0x21cd('0x19')](_0x124e31['errors'],'message')[_0x21cd('0x1a')](';');return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0xfa79cd,null,_0x30fa01));}var _0x1df9e5={};for(var _0x480622 in FIELDS){if(FIELDS[_0x21cd('0x1b')](_0x480622)&&FIELDS[_0x480622]){_0x1df9e5[_0x480622]=_0x124e31[_0x21cd('0x1c')][0x0][FIELDS[_0x480622]]||_0x124e31[_0x21cd('0x1c')][0x0]['\ufeff'+FIELDS[_0x480622]];}}if(!_0x1df9e5['firstName']){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x1d'),null,_0x30fa01));}if(!_0x1df9e5[_0x21cd('0x1e')]){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x1f'),null,_0x30fa01));}if(_0x1df9e5['birthDate']){var _0x11283b=moment(_0x1df9e5[_0x21cd('0x20')],_0x21cd('0x21'));if(!_0x11283b[_0x21cd('0x22')]()){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x23'),null,_0x30fa01));}}if(_0x1df9e5[_0x21cd('0x24')]){if(!isEmail(_0x1df9e5[_0x21cd('0x24')])){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x25'),null,_0x30fa01));}}_0x1df9e5[_0x21cd('0x26')]=LISTID;_0x1df9e5['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x21cd('0x18')]&&_0x9d9cfd){var _0x42ed8c={};for(var _0x155a4d=0x0,_0x258328=DUPLICATES[_0x21cd('0x18')];_0x155a4d<_0x258328;_0x155a4d+=0x1){_0x42ed8c[DUPLICATES[_0x155a4d]]=_0x1df9e5[DUPLICATES[_0x155a4d]];}var _0x2a0d7d=_['find'](_0x9d9cfd,_0x42ed8c);if(_0x2a0d7d){return _0x5be5a2(handleCheckRowError(_0x21cd('0x27'),_0x21cd('0x28'),_0x2a0d7d,_0x30fa01));}}return db[_0x21cd('0x29')][_0x21cd('0x2a')](_0x1df9e5,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1df9e5)})[_0x21cd('0x2b')](function(_0x4d9a6c){if(DUPLICATES&&DUPLICATES[_0x21cd('0x18')]&&_0x9d9cfd){_0x9d9cfd[_0x21cd('0x2c')](_[_0x21cd('0x2d')](_0x1df9e5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4d9a6c['id'];return _0x2dc823();})[_0x21cd('0x2e')](function(_0x494e46){return _0x5be5a2(handleCheckRowError(_0x21cd('0x12'),_0x21cd('0x2f')+(_0x494e46[_0x21cd('0x30')]||JSON[_0x21cd('0x31')](_0x494e46)),null,_0x30fa01));});});}function checkHopper(){function _0x113d50(){return function(_0x302c92){logger[_0x21cd('0x12')](_0x21cd('0x32'),'checkHopper',util[_0x21cd('0x33')](_0x302c92,{'showHidden':![],'depth':null}));};}var _0x937d22=function(_0x2d4edd,_0x56e6b1){var _0x45a08d=squel['insert']()[_0x21cd('0x34')](_0x21cd('0x35'))[_0x21cd('0x36')]([_0x21cd('0x1e'),_0x21cd('0x37'),_0x21cd('0x38'),_0x21cd('0x26'),_0x56e6b1,_0x21cd('0x39'),'updatedAt'],squel[_0x21cd('0x3a')]()[_0x21cd('0x3b')](_0x21cd('0x1e'),_0x21cd('0x1e'))[_0x21cd('0x3b')](_0x21cd('0x3c'),_0x21cd('0x37'))[_0x21cd('0x3b')]('id','ContactId')[_0x21cd('0x3b')](LISTID[_0x21cd('0x3d')](),_0x21cd('0x26'))[_0x21cd('0x3b')](_0x2d4edd['id']['toString'](),_0x56e6b1)['field']('NOW()',_0x21cd('0x39'))['field']('NOW()',_0x21cd('0x3e'))[_0x21cd('0x3f')]('cm_contacts')['where'](_0x21cd('0x40'))[_0x21cd('0x41')]('ListId\x20=\x20?',LISTID[_0x21cd('0x3d')]())['where'](_0x21cd('0x42'))[_0x21cd('0x41')](_0x21cd('0x43'),squel[_0x21cd('0x3a')]()[_0x21cd('0x3b')](_0x21cd('0x1e'))[_0x21cd('0x3f')](_0x21cd('0x35'))[_0x21cd('0x41')](_0x56e6b1+_0x21cd('0x44'),_0x2d4edd['id'][_0x21cd('0x3d')]())))[_0x21cd('0x3d')]();return _0x45a08d;};var _0x1a4848=function(_0x4fd47d,_0x2c2fcb){var _0x55440f=squel[_0x21cd('0x45')]()['into'](_0x21cd('0x35'))[_0x21cd('0x36')]([_0x21cd('0x1e'),_0x21cd('0x37'),_0x21cd('0x38'),_0x21cd('0x26'),_0x2c2fcb,_0x21cd('0x39'),'updatedAt'],squel['select']()['field'](_0x21cd('0x1e'),_0x21cd('0x1e'))['field']('NOW()',_0x21cd('0x37'))[_0x21cd('0x3b')]('id','ContactId')[_0x21cd('0x3b')](LISTID['toString'](),_0x21cd('0x26'))[_0x21cd('0x3b')](_0x4fd47d['id'][_0x21cd('0x3d')](),_0x2c2fcb)['field'](_0x21cd('0x3c'),'createdAt')[_0x21cd('0x3b')](_0x21cd('0x3c'),_0x21cd('0x3e'))['from'](_0x21cd('0x46'))[_0x21cd('0x41')](_0x21cd('0x40'))[_0x21cd('0x41')](_0x21cd('0x47'),LISTID[_0x21cd('0x3d')]())[_0x21cd('0x41')]('id\x20IN\x20?',squel[_0x21cd('0x48')](hopperContacts))[_0x21cd('0x41')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x21cd('0x43'),squel['select']()['field'](_0x21cd('0x49'))[_0x21cd('0x3f')](_0x21cd('0x4a'))[_0x21cd('0x41')](_0x2c2fcb+_0x21cd('0x44'),_0x4fd47d['id'][_0x21cd('0x3d')]()))[_0x21cd('0x41')](_0x21cd('0x43'),squel[_0x21cd('0x3a')]()['field']('phone')[_0x21cd('0x3f')](_0x21cd('0x35'))[_0x21cd('0x41')](_0x2c2fcb+_0x21cd('0x44'),_0x4fd47d['id']['toString']())))['toString']();return _0x55440f;};function _0x2ef7c1(_0x11ca54,_0x79f395){var _0x5b5c21=squel[_0x21cd('0x45')]()[_0x21cd('0x34')](_0x21cd('0x35'))[_0x21cd('0x36')]([_0x21cd('0x1e'),_0x21cd('0x37'),_0x21cd('0x38'),_0x21cd('0x26'),_0x79f395,_0x21cd('0x39'),'updatedAt'],squel[_0x21cd('0x3a')]()[_0x21cd('0x3b')](_0x21cd('0x1e'),_0x21cd('0x1e'))[_0x21cd('0x3b')](_0x21cd('0x3c'),_0x21cd('0x37'))[_0x21cd('0x3b')]('id','ContactId')[_0x21cd('0x3b')](LISTID['toString'](),_0x21cd('0x26'))[_0x21cd('0x3b')](_0x11ca54['id'][_0x21cd('0x3d')](),_0x79f395)['field'](_0x21cd('0x3c'),_0x21cd('0x39'))['field'](_0x21cd('0x3c'),_0x21cd('0x3e'))[_0x21cd('0x3f')](_0x21cd('0x46'))[_0x21cd('0x41')]('deletedAt\x20IS\x20NULL')[_0x21cd('0x41')](_0x21cd('0x47'),LISTID['toString']())[_0x21cd('0x41')]('id\x20IN\x20?',squel[_0x21cd('0x48')](hopperContacts))['where'](_0x21cd('0x42')))[_0x21cd('0x3d')]();return _0x5b5c21;}function _0x1aba6c(_0x39d44b,_0x2dd261){var _0x14c114=squel[_0x21cd('0x45')]()[_0x21cd('0x34')](_0x21cd('0x4b'))['fromQuery']([_0x21cd('0x1e'),_0x21cd('0x38'),_0x21cd('0x26'),_0x2dd261,_0x21cd('0x39'),'updatedAt'],squel[_0x21cd('0x3a')]()[_0x21cd('0x3b')](_0x21cd('0x1e'),_0x21cd('0x1e'))[_0x21cd('0x3b')]('id',_0x21cd('0x38'))[_0x21cd('0x3b')](LISTID[_0x21cd('0x3d')](),_0x21cd('0x26'))[_0x21cd('0x3b')](_0x39d44b['id']['toString'](),_0x2dd261)['field']('NOW()',_0x21cd('0x39'))[_0x21cd('0x3b')]('NOW()',_0x21cd('0x3e'))['from']('cm_contacts')['where'](_0x21cd('0x40'))[_0x21cd('0x41')](_0x21cd('0x47'),LISTID['toString']())[_0x21cd('0x41')]('id\x20IN\x20?',squel[_0x21cd('0x48')](hopperContacts))[_0x21cd('0x41')](_0x21cd('0x42')))[_0x21cd('0x3d')]();return _0x14c114;}return db[_0x21cd('0x4c')][_0x21cd('0x4d')]({'where':{'type':_0x21cd('0x4e')},'attributes':['id',_0x21cd('0x4f')],'include':[{'model':db[_0x21cd('0x50')],'as':_0x21cd('0x51'),'where':{'id':LISTID}}]})[_0x21cd('0x2b')](function(_0x268ee2){var _0x4f7a3d=[];if(_0x268ee2){var _0x1976af;for(var _0xe64fe7=0x0,_0x5d0e68;_0xe64fe7<_0x268ee2[_0x21cd('0x18')];_0xe64fe7+=0x1){_0x5d0e68=_0x268ee2[_0xe64fe7][_0x21cd('0x52')]({'plain':!![]});switch(_0x5d0e68[_0x21cd('0x4f')]){case'always':_0x4f7a3d['push'](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x1a4848(_0x5d0e68,_0x21cd('0x55')))['then'](function(){})[_0x21cd('0x2e')](_0x113d50()));break;case _0x21cd('0x56'):_0x4f7a3d[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x937d22(_0x5d0e68,_0x21cd('0x55')))['then'](function(){})[_0x21cd('0x2e')](_0x113d50()));break;default:_0x4f7a3d[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x2ef7c1(_0x5d0e68,'VoiceQueueId'))[_0x21cd('0x2b')](function(){})[_0x21cd('0x2e')](_0x113d50()));}}}return _0x4f7a3d;})['all']()[_0x21cd('0x2b')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x21cd('0x4e')},'attributes':['id'],'include':[{'model':db[_0x21cd('0x50')],'as':_0x21cd('0x57'),'where':{'id':LISTID}}]})[_0x21cd('0x2b')](function(_0x35f48d){var _0x5de66a=[];if(_0x35f48d){var _0x2f87f9;for(var _0x1bc8b7=0x0,_0x3ca1bf;_0x1bc8b7<_0x35f48d[_0x21cd('0x18')];_0x1bc8b7+=0x1){_0x3ca1bf=_0x35f48d[_0x1bc8b7]['get']({'plain':!![]});_0x5de66a[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x1aba6c(_0x3ca1bf,'VoiceQueueId'))[_0x21cd('0x2b')](function(){})[_0x21cd('0x2e')](_0x113d50()));}}return _0x5de66a;})[_0x21cd('0x58')]();})[_0x21cd('0x2b')](function(){return db[_0x21cd('0x59')][_0x21cd('0x4d')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x21cd('0x50')],'as':_0x21cd('0x51'),'where':{'id':LISTID}}]})[_0x21cd('0x2b')](function(_0x1a227b){var _0x4902d2=[];if(_0x1a227b){for(var _0x2226b4=0x0,_0x2646c3;_0x2226b4<_0x1a227b[_0x21cd('0x18')];_0x2226b4+=0x1){_0x2646c3=_0x1a227b[_0x2226b4]['get']({'plain':!![]});switch(_0x2646c3['dialCheckDuplicateType']){case _0x21cd('0x5a'):_0x4902d2[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x1a4848(_0x2646c3,_0x21cd('0x5b')))[_0x21cd('0x2b')](function(){})[_0x21cd('0x2e')](_0x113d50()));break;case _0x21cd('0x56'):_0x4902d2['push'](db['sequelize'][_0x21cd('0x54')](_0x937d22(_0x2646c3,_0x21cd('0x5b')))['then'](function(){})[_0x21cd('0x2e')](_0x113d50()));break;default:_0x4902d2[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x2ef7c1(_0x2646c3,_0x21cd('0x5b')))['then'](function(){})[_0x21cd('0x2e')](_0x113d50()));}}}return _0x4902d2;})[_0x21cd('0x58')]();})[_0x21cd('0x2b')](function(){return db[_0x21cd('0x59')][_0x21cd('0x4d')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x21cd('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x5b6e23){var _0xc9ddc1=[];if(_0x5b6e23){for(var _0x486aa9=0x0,_0x53c683;_0x486aa9<_0x5b6e23[_0x21cd('0x18')];_0x486aa9+=0x1){_0x53c683=_0x5b6e23[_0x486aa9]['get']({'plain':!![]});_0xc9ddc1[_0x21cd('0x2c')](db[_0x21cd('0x53')][_0x21cd('0x54')](_0x1aba6c(_0x53c683,_0x21cd('0x5b')))[_0x21cd('0x2b')](function(){})['catch'](_0x113d50()));}}return _0xc9ddc1;})[_0x21cd('0x58')]();})[_0x21cd('0x2e')](function(_0x574d23){logger[_0x21cd('0x12')]('cmContact,\x20%s,\x20%s',_0x21cd('0x5c'),_0x574d23['message']);});}var processPromises=function(_0x224e44){return BPromise[_0x21cd('0x58')](promises)[_0x21cd('0x2b')](function(_0x586bc8){})[_0x21cd('0x2e')](function(_0x3e67bf){logger[_0x21cd('0x12')](_0x21cd('0x5d'),JSON['stringify'](_0x3e67bf));})[_0x21cd('0x5e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x224e44){return _0x224e44['resume']();}});};var endCsv=function(){return BPromise[_0x21cd('0x5f')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x21cd('0x2b')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x21cd('0x60')](FILEPATH);}catch(_0x1985a5){logger['error'](_0x21cd('0x61'),JSON[_0x21cd('0x31')](_0x1985a5));}finally{process[_0x21cd('0x62')](0x0);}});};process['on'](_0x21cd('0x63'),function(){logger[_0x21cd('0x64')](_0x21cd('0x65'));endCsv();});function main(){return BPromise[_0x21cd('0x5f')]()[_0x21cd('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x21cd('0xf')](',');return db[_0x21cd('0x29')][_0x21cd('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x21cd('0x2b')](function(_0x1de9fc){var _0x56694f=fs[_0x21cd('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x21cd('0x67')](_0x56694f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x577e1d,_0x4ef28e){total+=0x1;var _0x4e28c9=total;promises[_0x21cd('0x2c')](checkRow(_0x577e1d,_0x1de9fc,_0x4e28c9)[_0x21cd('0x2b')](function(){success+=0x1;})[_0x21cd('0x2e')](function(_0x4fb4a2){if(_0x4fb4a2[_0x21cd('0x12')]){errors+=0x1;delete _0x4fb4a2[_0x21cd('0x12')];}else if(_0x4fb4a2[_0x21cd('0x27')]){duplicates+=0x1;delete _0x4fb4a2[_0x21cd('0x27')];}rows[_0x21cd('0x2c')](_0x4fb4a2);}));if(total%0xc8===0x0){_0x4ef28e['pause']();return processPromises(_0x4ef28e);}},'complete':function(){return processPromises()[_0x21cd('0x2b')](function(){logger[_0x21cd('0x64')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2e2a32,_0x34c6d8){logger[_0x21cd('0x64')](_0x21cd('0x68'),JSON[_0x21cd('0x31')](_0x2e2a32));endCsv();}});})[_0x21cd('0x2e')](function(_0x24cd24){logger[_0x21cd('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x24cd24));});}main(); \ No newline at end of file +var _0xb4ed=['checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','message','finally','emit','resume','resolve','contact:csv_','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','errors','length','map','join','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact'];(function(_0x3841b1,_0x274194){var _0x42aa9e=function(_0xd33e41){while(--_0xd33e41){_0x3841b1['push'](_0x3841b1['shift']());}};_0x42aa9e(++_0x274194);}(_0xb4ed,0xae));var _0xdb4e=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0xb4ed[_0x845505];return _0x2513b9;};'use strict';var BPromise=require(_0xdb4e('0x0'));var util=require(_0xdb4e('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xdb4e('0x2'));var Papa=require(_0xdb4e('0x3'));var Redis=require('ioredis');var db=require(_0xdb4e('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0xdb4e('0x5'))(_0xdb4e('0x6'));config['redis']=_[_0xdb4e('0x7')](config[_0xdb4e('0x8')],{'host':_0xdb4e('0x9'),'port':0x18eb});var socket=require(_0xdb4e('0xa'))(new Redis(config[_0xdb4e('0x8')]));require(_0xdb4e('0xb'))[_0xdb4e('0xc')](socket);try{if(!process[_0xdb4e('0xd')][0x2]||process[_0xdb4e('0xd')][0x2]===_0xdb4e('0xe')||process[_0xdb4e('0xd')][0x2]===_0xdb4e('0xf')){throw new Error(_0xdb4e('0x10'));}var FILEPATH=process[_0xdb4e('0xd')][0x2];if(!process[_0xdb4e('0xd')][0x3]||process[_0xdb4e('0xd')][0x3]===_0xdb4e('0xe')||process[_0xdb4e('0xd')][0x3]===_0xdb4e('0xf')||!process[_0xdb4e('0xd')][0x4]||process[_0xdb4e('0xd')][0x4]===_0xdb4e('0xe')||process['argv'][0x4]===_0xdb4e('0xf')){throw new Error(_0xdb4e('0x11'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xdb4e('0x12')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xdb4e('0xd')][0x5]===_0xdb4e('0xe')||process[_0xdb4e('0xd')][0x5]===_0xdb4e('0xf')){throw new Error(_0xdb4e('0x13'));}var LISTID=process[_0xdb4e('0xd')][0x5];var COMPANYID=process[_0xdb4e('0xd')][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0xdb4e('0xd')][0x6]!==_0xdb4e('0xf')?process[_0xdb4e('0xd')][0x6]:null;var DUPLICATES=process[_0xdb4e('0xd')][0x7]&&process['argv'][0x7]!==_0xdb4e('0xe')&&process['argv'][0x7]!==_0xdb4e('0xf')?process[_0xdb4e('0xd')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0xdb4e('0xe')||process['argv'][0x8]===_0xdb4e('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4cb56e){logger[_0xdb4e('0x14')](_0x4cb56e);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(_0x320bdc,_0x5d8514,_0x4e0f0e,_0x37cedd){var _0xb5b05={'message':_0x5d8514};_0xb5b05[_0x320bdc]=!![];if(_0x4e0f0e){_0xb5b05[_0xdb4e('0x15')]=_0x4e0f0e;}if(_0x37cedd){_0xb5b05[_0xdb4e('0x16')]=_0x37cedd;}return _0xb5b05;}function isEmail(_0x2ce1ae){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))*$/[_0xdb4e('0x17')](_0x2ce1ae);}function checkRow(_0x508797,_0x3c6142,_0x1eaf03){return new BPromise(function(_0x4ab092,_0x392560){if(_[_0xdb4e('0x18')](_0x508797)){return _0x392560(handleCheckRowError(_0xdb4e('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1eaf03));}if(_0x508797[_0xdb4e('0x19')]&&_0x508797[_0xdb4e('0x19')][_0xdb4e('0x1a')]){var _0x3da2ff=_[_0xdb4e('0x1b')](_0x508797[_0xdb4e('0x19')],'message')[_0xdb4e('0x1c')](';');return _0x392560(handleCheckRowError(_0xdb4e('0x14'),_0x3da2ff,null,_0x1eaf03));}var _0x401187={};for(var _0x5c8a86 in FIELDS){if(FIELDS[_0xdb4e('0x1d')](_0x5c8a86)&&FIELDS[_0x5c8a86]){_0x401187[_0x5c8a86]=_0x508797[_0xdb4e('0x1e')][0x0][FIELDS[_0x5c8a86]]||_0x508797[_0xdb4e('0x1e')][0x0]['\ufeff'+FIELDS[_0x5c8a86]];}}if(!_0x401187[_0xdb4e('0x1f')]){return _0x392560(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1eaf03));}if(!_0x401187[_0xdb4e('0x20')]){return _0x392560(handleCheckRowError(_0xdb4e('0x14'),'phone\x20not\x20specified!',null,_0x1eaf03));}if(_0x401187[_0xdb4e('0x21')]){var _0x342841=moment(_0x401187['birthDate'],_0xdb4e('0x22'));if(!_0x342841[_0xdb4e('0x23')]()){return _0x392560(handleCheckRowError('error',_0xdb4e('0x24'),null,_0x1eaf03));}}if(_0x401187[_0xdb4e('0x25')]){if(!isEmail(_0x401187[_0xdb4e('0x25')])){return _0x392560(handleCheckRowError('error',_0xdb4e('0x26'),null,_0x1eaf03));}}_0x401187[_0xdb4e('0x27')]=LISTID;_0x401187[_0xdb4e('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3c6142){var _0x1ebfd3={};for(var _0x311380=0x0,_0x5fb9b7=DUPLICATES[_0xdb4e('0x1a')];_0x311380<_0x5fb9b7;_0x311380+=0x1){_0x1ebfd3[DUPLICATES[_0x311380]]=_0x401187[DUPLICATES[_0x311380]];}var _0x1688a0=_[_0xdb4e('0x29')](_0x3c6142,_0x1ebfd3);if(_0x1688a0){return _0x392560(handleCheckRowError('duplicate',_0xdb4e('0x2a'),_0x1688a0,_0x1eaf03));}}return db[_0xdb4e('0x2b')]['create'](_0x401187,{'raw':!![],'hooks':![],'fields':_[_0xdb4e('0x2c')](_0x401187)})[_0xdb4e('0x2d')](function(_0x4fcf59){if(DUPLICATES&&DUPLICATES['length']&&_0x3c6142){_0x3c6142['push'](_['pick'](_0x401187,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4fcf59['id'];return _0x4ab092();})[_0xdb4e('0x2e')](function(_0x65f098){return _0x392560(handleCheckRowError('error',_0xdb4e('0x2f')+(_0x65f098['message']||JSON[_0xdb4e('0x30')](_0x65f098)),null,_0x1eaf03));});});}function checkHopper(){function _0x33eef6(){return function(_0x64f45c){logger[_0xdb4e('0x14')](_0xdb4e('0x31'),_0xdb4e('0x32'),util[_0xdb4e('0x33')](_0x64f45c,{'showHidden':![],'depth':null}));};}var _0x542486=function(_0x1eef8c,_0x55fb3d){var _0x158b0a=squel[_0xdb4e('0x34')]()[_0xdb4e('0x35')](_0xdb4e('0x36'))[_0xdb4e('0x37')]([_0xdb4e('0x20'),_0xdb4e('0x38'),_0xdb4e('0x39'),_0xdb4e('0x27'),_0x55fb3d,'createdAt',_0xdb4e('0x3a')],squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')](_0xdb4e('0x20'),_0xdb4e('0x20'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x38'))[_0xdb4e('0x3c')]('id',_0xdb4e('0x39'))['field'](LISTID[_0xdb4e('0x3e')](),_0xdb4e('0x27'))[_0xdb4e('0x3c')](_0x1eef8c['id']['toString'](),_0x55fb3d)[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x3f'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),'updatedAt')[_0xdb4e('0x40')](_0xdb4e('0x41'))[_0xdb4e('0x42')](_0xdb4e('0x43'))[_0xdb4e('0x42')](_0xdb4e('0x44'),LISTID[_0xdb4e('0x3e')]())[_0xdb4e('0x42')](_0xdb4e('0x45'))[_0xdb4e('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')](_0xdb4e('0x20'))[_0xdb4e('0x40')]('cm_hopper')[_0xdb4e('0x42')](_0x55fb3d+_0xdb4e('0x46'),_0x1eef8c['id'][_0xdb4e('0x3e')]())))[_0xdb4e('0x3e')]();return _0x158b0a;};var _0x2887a0=function(_0x228c70,_0xf3b4f2){var _0x122741=squel[_0xdb4e('0x34')]()[_0xdb4e('0x35')](_0xdb4e('0x36'))[_0xdb4e('0x37')](['phone',_0xdb4e('0x38'),_0xdb4e('0x39'),_0xdb4e('0x27'),_0xf3b4f2,_0xdb4e('0x3f'),_0xdb4e('0x3a')],squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')]('phone',_0xdb4e('0x20'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x38'))[_0xdb4e('0x3c')]('id',_0xdb4e('0x39'))['field'](LISTID[_0xdb4e('0x3e')](),_0xdb4e('0x27'))[_0xdb4e('0x3c')](_0x228c70['id']['toString'](),_0xf3b4f2)[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x3f'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x3a'))[_0xdb4e('0x40')](_0xdb4e('0x41'))[_0xdb4e('0x42')](_0xdb4e('0x43'))[_0xdb4e('0x42')](_0xdb4e('0x44'),LISTID[_0xdb4e('0x3e')]())[_0xdb4e('0x42')](_0xdb4e('0x47'),squel[_0xdb4e('0x48')](hopperContacts))['where'](_0xdb4e('0x45'))['where'](_0xdb4e('0x49'),squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')](_0xdb4e('0x4a'))[_0xdb4e('0x40')](_0xdb4e('0x4b'))[_0xdb4e('0x42')](_0xf3b4f2+_0xdb4e('0x46'),_0x228c70['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')](_0xdb4e('0x20'))[_0xdb4e('0x40')](_0xdb4e('0x36'))[_0xdb4e('0x42')](_0xf3b4f2+'\x20=\x20?',_0x228c70['id'][_0xdb4e('0x3e')]())))[_0xdb4e('0x3e')]();return _0x122741;};function _0x55f1ec(_0x254f1d,_0x507c01){var _0x4d0a7c=squel[_0xdb4e('0x34')]()[_0xdb4e('0x35')]('cm_hopper')[_0xdb4e('0x37')](['phone',_0xdb4e('0x38'),'ContactId','ListId',_0x507c01,'createdAt','updatedAt'],squel['select']()[_0xdb4e('0x3c')]('phone',_0xdb4e('0x20'))[_0xdb4e('0x3c')]('NOW()',_0xdb4e('0x38'))[_0xdb4e('0x3c')]('id',_0xdb4e('0x39'))[_0xdb4e('0x3c')](LISTID[_0xdb4e('0x3e')](),_0xdb4e('0x27'))[_0xdb4e('0x3c')](_0x254f1d['id'][_0xdb4e('0x3e')](),_0x507c01)[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x3f'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),_0xdb4e('0x3a'))['from'](_0xdb4e('0x41'))[_0xdb4e('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0xdb4e('0x3e')]())[_0xdb4e('0x42')](_0xdb4e('0x47'),squel[_0xdb4e('0x48')](hopperContacts))[_0xdb4e('0x42')](_0xdb4e('0x45')))[_0xdb4e('0x3e')]();return _0x4d0a7c;}function _0x288e40(_0x118ed7,_0x176992){var _0x300052=squel[_0xdb4e('0x34')]()[_0xdb4e('0x35')](_0xdb4e('0x4c'))[_0xdb4e('0x37')]([_0xdb4e('0x20'),_0xdb4e('0x39'),_0xdb4e('0x27'),_0x176992,_0xdb4e('0x3f'),'updatedAt'],squel[_0xdb4e('0x3b')]()[_0xdb4e('0x3c')](_0xdb4e('0x20'),'phone')['field']('id','ContactId')[_0xdb4e('0x3c')](LISTID[_0xdb4e('0x3e')](),_0xdb4e('0x27'))[_0xdb4e('0x3c')](_0x118ed7['id'][_0xdb4e('0x3e')](),_0x176992)['field'](_0xdb4e('0x3d'),_0xdb4e('0x3f'))[_0xdb4e('0x3c')](_0xdb4e('0x3d'),'updatedAt')[_0xdb4e('0x40')](_0xdb4e('0x41'))[_0xdb4e('0x42')](_0xdb4e('0x43'))[_0xdb4e('0x42')](_0xdb4e('0x44'),LISTID[_0xdb4e('0x3e')]())[_0xdb4e('0x42')]('id\x20IN\x20?',squel[_0xdb4e('0x48')](hopperContacts))[_0xdb4e('0x42')](_0xdb4e('0x45')))[_0xdb4e('0x3e')]();return _0x300052;}return db[_0xdb4e('0x4d')][_0xdb4e('0x4e')]({'where':{'type':_0xdb4e('0x4f')},'attributes':['id',_0xdb4e('0x50')],'include':[{'model':db[_0xdb4e('0x51')],'as':_0xdb4e('0x52'),'where':{'id':LISTID}}]})[_0xdb4e('0x2d')](function(_0x45f050){var _0x424a39=[];if(_0x45f050){var _0x2b50a8;for(var _0x1243de=0x0,_0x54a6a8;_0x1243de<_0x45f050[_0xdb4e('0x1a')];_0x1243de+=0x1){_0x54a6a8=_0x45f050[_0x1243de][_0xdb4e('0x53')]({'plain':!![]});switch(_0x54a6a8['dialCheckDuplicateType']){case _0xdb4e('0x54'):_0x424a39[_0xdb4e('0x55')](db[_0xdb4e('0x56')][_0xdb4e('0x57')](_0x2887a0(_0x54a6a8,'VoiceQueueId'))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));break;case _0xdb4e('0x58'):_0x424a39[_0xdb4e('0x55')](db[_0xdb4e('0x56')][_0xdb4e('0x57')](_0x542486(_0x54a6a8,_0xdb4e('0x59')))['then'](function(){})['catch'](_0x33eef6()));break;default:_0x424a39[_0xdb4e('0x55')](db[_0xdb4e('0x56')]['query'](_0x55f1ec(_0x54a6a8,'VoiceQueueId'))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));}}}return _0x424a39;})['all']()['then'](function(){return db[_0xdb4e('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xdb4e('0x51')],'as':_0xdb4e('0x5a'),'where':{'id':LISTID}}]})[_0xdb4e('0x2d')](function(_0x4f06eb){var _0x57ae83=[];if(_0x4f06eb){var _0x2abc81;for(var _0x1a2d49=0x0,_0x423c0;_0x1a2d49<_0x4f06eb[_0xdb4e('0x1a')];_0x1a2d49+=0x1){_0x423c0=_0x4f06eb[_0x1a2d49][_0xdb4e('0x53')]({'plain':!![]});_0x57ae83['push'](db[_0xdb4e('0x56')]['query'](_0x288e40(_0x423c0,_0xdb4e('0x59')))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));}}return _0x57ae83;})[_0xdb4e('0x5b')]();})[_0xdb4e('0x2d')](function(){return db[_0xdb4e('0x5c')][_0xdb4e('0x4e')]({'attributes':['id',_0xdb4e('0x50')],'include':[{'model':db[_0xdb4e('0x51')],'as':_0xdb4e('0x52'),'where':{'id':LISTID}}]})[_0xdb4e('0x2d')](function(_0x24320e){var _0x2d4f6d=[];if(_0x24320e){for(var _0x4794d8=0x0,_0x6fce9e;_0x4794d8<_0x24320e['length'];_0x4794d8+=0x1){_0x6fce9e=_0x24320e[_0x4794d8][_0xdb4e('0x53')]({'plain':!![]});switch(_0x6fce9e[_0xdb4e('0x50')]){case _0xdb4e('0x54'):_0x2d4f6d['push'](db[_0xdb4e('0x56')][_0xdb4e('0x57')](_0x2887a0(_0x6fce9e,_0xdb4e('0x5d')))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));break;case'onlyIfOpen':_0x2d4f6d[_0xdb4e('0x55')](db['sequelize'][_0xdb4e('0x57')](_0x542486(_0x6fce9e,_0xdb4e('0x5d')))['then'](function(){})['catch'](_0x33eef6()));break;default:_0x2d4f6d['push'](db['sequelize']['query'](_0x55f1ec(_0x6fce9e,_0xdb4e('0x5d')))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));}}}return _0x2d4f6d;})[_0xdb4e('0x5b')]();})[_0xdb4e('0x2d')](function(){return db[_0xdb4e('0x5c')][_0xdb4e('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xdb4e('0x51')],'as':_0xdb4e('0x5a'),'where':{'id':LISTID}}]})[_0xdb4e('0x2d')](function(_0x109354){var _0x2bfb91=[];if(_0x109354){for(var _0x3648ac=0x0,_0x54edde;_0x3648ac<_0x109354[_0xdb4e('0x1a')];_0x3648ac+=0x1){_0x54edde=_0x109354[_0x3648ac]['get']({'plain':!![]});_0x2bfb91[_0xdb4e('0x55')](db[_0xdb4e('0x56')][_0xdb4e('0x57')](_0x288e40(_0x54edde,_0xdb4e('0x5d')))[_0xdb4e('0x2d')](function(){})[_0xdb4e('0x2e')](_0x33eef6()));}}return _0x2bfb91;})[_0xdb4e('0x5b')]();})[_0xdb4e('0x2e')](function(_0x545a6c){logger[_0xdb4e('0x14')](_0xdb4e('0x5e'),_0xdb4e('0x5f'),_0x545a6c[_0xdb4e('0x60')]);});}var processPromises=function(_0x2cfe94){return BPromise[_0xdb4e('0x5b')](promises)[_0xdb4e('0x2d')](function(_0x296f7a){})['catch'](function(_0x24c0f9){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xdb4e('0x30')](_0x24c0f9));})[_0xdb4e('0x61')](function(){socket[_0xdb4e('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2cfe94){return _0x2cfe94[_0xdb4e('0x63')]();}});};var endCsv=function(){return BPromise[_0xdb4e('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xdb4e('0x2d')](function(){socket[_0xdb4e('0x62')](_0xdb4e('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdb4e('0x66')](FILEPATH);}catch(_0x57748d){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xdb4e('0x30')](_0x57748d));}finally{process[_0xdb4e('0x67')](0x0);}});};process['on'](_0xdb4e('0x68'),function(){logger[_0xdb4e('0x69')](_0xdb4e('0x6a'));endCsv();});function main(){return BPromise[_0xdb4e('0x64')]()[_0xdb4e('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xdb4e('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xdb4e('0x2d')](function(_0x401804){var _0xabdcaa=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdb4e('0x6b')](_0xabdcaa,{'header':!![],'skipEmptyLines':!![],'step':function(_0x29b28d,_0xf995c7){total+=0x1;var _0x125793=total;promises[_0xdb4e('0x55')](checkRow(_0x29b28d,_0x401804,_0x125793)[_0xdb4e('0x2d')](function(){success+=0x1;})[_0xdb4e('0x2e')](function(_0x15d4c8){if(_0x15d4c8[_0xdb4e('0x14')]){errors+=0x1;delete _0x15d4c8[_0xdb4e('0x14')];}else if(_0x15d4c8['duplicate']){duplicates+=0x1;delete _0x15d4c8[_0xdb4e('0x6c')];}rows['push'](_0x15d4c8);}));if(total%0xc8===0x0){_0xf995c7[_0xdb4e('0x6d')]();return processPromises(_0xf995c7);}},'complete':function(){return processPromises()[_0xdb4e('0x2d')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2e4f90,_0x18b019){logger[_0xdb4e('0x69')](_0xdb4e('0x6e'),JSON[_0xdb4e('0x30')](_0x2e4f90));endCsv();}});})['catch'](function(_0x1ba2a3){logger[_0xdb4e('0x14')](_0xdb4e('0x6f'),JSON[_0xdb4e('0x30')](_0x1ba2a3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 6c37715..fd76e36 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 _0xd4c4=['ContactId','ListId','createdAt','UserId','recallme','select','fields','cm_contacts','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_hopper_black','fromQuery','updatedAt','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','priority','cm_contacts.ListId\x20=\x20','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','all','then','catch','timezones','dialTimezone','isNil','utcOffset','set','offset','stringify','start','socket_timestamp','root','server/files/tmp','keys','includes','header',',utcOffset','writeFileSync','createReadStream','data','rows','errors','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','scheduledat'];(function(_0x33d0fb,_0x59aa45){var _0x4d6fd7=function(_0x347c03){while(--_0x347c03){_0x33d0fb['push'](_0x33d0fb['shift']());}};_0x4d6fd7(++_0x59aa45);}(_0xd4c4,0x1c3));var _0x4d4c=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xd4c4[_0x162780];return _0x1ea2dc;};'use strict';var fs=require('fs');var path=require(_0x4d4c('0x0'));var _=require(_0x4d4c('0x1'));var Papa=require(_0x4d4c('0x2'));var util=require(_0x4d4c('0x3'));var BPromise=require(_0x4d4c('0x4'));var moment=require(_0x4d4c('0x5'));var squel=require(_0x4d4c('0x6'));var Redis=require('ioredis');var db=require(_0x4d4c('0x7'))['db'];var config=require(_0x4d4c('0x8'));var shared=require(_0x4d4c('0x9'));var logger=require(_0x4d4c('0xa'))('import');config[_0x4d4c('0xb')]=_[_0x4d4c('0xc')](config[_0x4d4c('0xb')],{'host':_0x4d4c('0xd'),'port':0x18eb});var socket=require(_0x4d4c('0xe'))(new Redis(config[_0x4d4c('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x4d4c('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x53166c){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'](_0x53166c);}function selectNotIn(_0x57fd8c,_0x277056,_0x2e3744,_0x27cbf0,_0x14c961){return squel['select']()[_0x4d4c('0x10')](_0x4d4c('0x11'))[_0x4d4c('0x12')](_0x27cbf0)[_0x4d4c('0x13')](_0x277056,null,_0x277056+_0x4d4c('0x14')+_0x27cbf0+'.'+_0x2e3744)[_0x4d4c('0x15')](_0x27cbf0+'.'+_0x2e3744+_0x4d4c('0x16')+_0x57fd8c+'.'+_0x2e3744)[_0x4d4c('0x15')](_0x277056+'.dialCheckDuplicateType\x20IN\x20('+_0x14c961[_0x4d4c('0x13')]()+')');}function insertCmHopper(_0x515468,_0x89b717,_0x54961f,_0x460c09,_0x54cec0){var _0x314873=[_0x4d4c('0x17'),'cm_contacts.scheduledat',_0x4d4c('0x18'),_0x4d4c('0x19'),_0x89b717+'.'+_0x460c09,_0x4d4c('0x1a'),_0x4d4c('0x1b'),_0x4d4c('0x1c'),'cm_contacts.UserId','\x22'+_0x54cec0+'\x22'];return squel[_0x4d4c('0x1d')]()[_0x4d4c('0x1e')]('cm_hopper')['fromQuery']([_0x4d4c('0x11'),_0x4d4c('0x1f'),_0x4d4c('0x20'),_0x4d4c('0x21'),_0x460c09,_0x4d4c('0x22'),'updatedAt','priority',_0x4d4c('0x23'),_0x4d4c('0x24')],squel[_0x4d4c('0x25')]()[_0x4d4c('0x26')](_0x314873)[_0x4d4c('0x12')](_0x89b717)[_0x4d4c('0x13')](_0x4d4c('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x89b717+'.CmListId')[_0x4d4c('0x13')](_0x54961f,null,_0x54961f+'.id\x20=\x20'+_0x89b717+'.'+_0x460c09)[_0x4d4c('0x15')](_0x89b717+'.CmListId\x20=\x20?',_0x515468)[_0x4d4c('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4d4c('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x89b717,_0x54961f,_0x460c09,_0x4d4c('0x28'),[_0x4d4c('0x29'),_0x4d4c('0x2a')]))[_0x4d4c('0x15')](_0x4d4c('0x2b'),selectNotIn(_0x89b717,_0x54961f,_0x460c09,_0x4d4c('0x28'),[_0x4d4c('0x29')])))[_0x4d4c('0x2c')]();}function insertCmHopperBlack(_0x53ee7d,_0x348f66,_0x129c42,_0x1f0622){var _0x36af94=[_0x4d4c('0x17'),'cm_contacts.id',_0x4d4c('0x19'),_0x348f66+'.'+_0x1f0622,_0x4d4c('0x1a'),_0x4d4c('0x1b')];return squel[_0x4d4c('0x1d')]()[_0x4d4c('0x1e')](_0x4d4c('0x2d'))[_0x4d4c('0x2e')]([_0x4d4c('0x11'),'ContactId',_0x4d4c('0x21'),_0x1f0622,'createdAt',_0x4d4c('0x2f')],squel[_0x4d4c('0x25')]()[_0x4d4c('0x26')](_0x36af94)[_0x4d4c('0x12')](_0x348f66)[_0x4d4c('0x13')](_0x4d4c('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x348f66+_0x4d4c('0x30'))[_0x4d4c('0x13')](_0x129c42,null,_0x129c42+_0x4d4c('0x14')+_0x348f66+'.'+_0x1f0622)[_0x4d4c('0x15')](_0x348f66+_0x4d4c('0x31'),_0x53ee7d)[_0x4d4c('0x15')](_0x4d4c('0x32'),NOW)[_0x4d4c('0x15')](_0x4d4c('0x2b'),squel['select']()[_0x4d4c('0x10')](_0x4d4c('0x11'))[_0x4d4c('0x12')](_0x4d4c('0x2d'))[_0x4d4c('0x15')](_0x4d4c('0x33'),_0x53ee7d)[_0x4d4c('0x15')](_0x1f0622+_0x4d4c('0x34'),_0x348f66+'.'+_0x1f0622)))[_0x4d4c('0x2c')]();}function insertTzCmHopper(_0x3f5ebc,_0x314ffc,_0x595199,_0x1ecb6c,_0x4f8331,_0x1a679d){var _0x5e6fd1=[_0x4d4c('0x17'),_0x4d4c('0x35')+_0x1a679d+_0x4d4c('0x36'),_0x4d4c('0x18'),_0x4d4c('0x19'),_0x314ffc+'.'+_0x1ecb6c,_0x4d4c('0x1a'),'cm_contacts.updatedAt',_0x4d4c('0x1c'),_0x4d4c('0x37'),'\x22'+_0x4f8331+'\x22'];var _0xd5cbf1=squel[_0x4d4c('0x1d')]()['into'](_0x4d4c('0x28'))[_0x4d4c('0x2e')](['phone','scheduledat',_0x4d4c('0x20'),_0x4d4c('0x21'),_0x1ecb6c,_0x4d4c('0x22'),_0x4d4c('0x2f'),_0x4d4c('0x38'),'UserId','recallme'],squel['select']()['fields'](_0x5e6fd1)['from'](_0x314ffc)[_0x4d4c('0x13')]('cm_contacts',null,_0x4d4c('0x39')+_0x314ffc+'.CmListId')[_0x4d4c('0x13')](_0x595199,null,_0x595199+_0x4d4c('0x14')+_0x314ffc+'.'+_0x1ecb6c)[_0x4d4c('0x13')](_0x1a679d,null,_0x1a679d+_0x4d4c('0x14')+_0x314ffc+'.'+_0x1ecb6c)['where'](_0x314ffc+'.CmListId\x20=\x20?',_0x3f5ebc)['where'](_0x4d4c('0x32'),NOW)['where'](_0x4d4c('0x2b'),selectNotIn(_0x314ffc,_0x595199,_0x1ecb6c,_0x4d4c('0x28'),[_0x4d4c('0x29'),'\x22onlyIfOpen\x22']))[_0x4d4c('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x314ffc,_0x595199,_0x1ecb6c,_0x4d4c('0x28'),['\x22always\x22'])))[_0x4d4c('0x2c')]();return _0xd5cbf1;}function insertTzCmHopperBlack(_0x30b240,_0x1f0a3d,_0x3d0c3f,_0x35397e){var _0x224c75=[_0x4d4c('0x17'),_0x4d4c('0x18'),_0x4d4c('0x19'),_0x1f0a3d+'.'+_0x35397e,_0x4d4c('0x1a'),'cm_contacts.updatedAt'];return squel[_0x4d4c('0x1d')]()['into'](_0x4d4c('0x2d'))['fromQuery']([_0x4d4c('0x11'),'ContactId','ListId',_0x35397e,_0x4d4c('0x22'),'updatedAt'],squel[_0x4d4c('0x25')]()[_0x4d4c('0x26')](_0x224c75)['from'](_0x1f0a3d)[_0x4d4c('0x13')](_0x4d4c('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x1f0a3d+_0x4d4c('0x30'))['join'](_0x3d0c3f,null,_0x3d0c3f+_0x4d4c('0x14')+_0x1f0a3d+'.'+_0x35397e)[_0x4d4c('0x15')](_0x1f0a3d+_0x4d4c('0x31'),_0x30b240)[_0x4d4c('0x15')](_0x4d4c('0x32'),NOW)[_0x4d4c('0x15')](_0x4d4c('0x2b'),squel[_0x4d4c('0x25')]()[_0x4d4c('0x10')](_0x4d4c('0x11'))['from'](_0x4d4c('0x2d'))['where']('ListId\x20=\x20?',_0x30b240)[_0x4d4c('0x15')](_0x35397e+_0x4d4c('0x34'),_0x1f0a3d+'.'+_0x35397e)))['toString']();}function insertCmContact(_0x12057e,_0x53f3bf,_0x335ce7,_0x5b01ae){var _0x5571d3=_['concat'](_['keys'](_0x5b01ae),['ListId','CompanyId',_0x4d4c('0x22'),_0x4d4c('0x2f')]);return squel[_0x4d4c('0x1d')]()['into'](_0x4d4c('0x27'))[_0x4d4c('0x2e')](_0x5571d3,squel['select']()[_0x4d4c('0x26')](_0x5571d3)['from'](_0x53f3bf)[_0x4d4c('0x15')]('('+_0x335ce7[_0x4d4c('0x13')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4d4c('0x26')](_0x335ce7)[_0x4d4c('0x12')](_0x4d4c('0x27'))['where'](_0x4d4c('0x33'),_0x12057e)['where'](_0x4d4c('0x3a')))[_0x4d4c('0x15')]('id\x20IN\x20?',squel[_0x4d4c('0x25')]()[_0x4d4c('0x10')](_0x4d4c('0x3b'),_0x4d4c('0x3c'))[_0x4d4c('0x12')](_0x53f3bf)[_0x4d4c('0x3d')](_0x335ce7['join'](','))))[_0x4d4c('0x2c')]();}function handleStop(){logger[_0x4d4c('0x3e')](_0x4d4c('0x3f'));stopped=!![];}function handleUncaughtException(_0x39adb8){logger[_0x4d4c('0x40')](_0x39adb8[_0x4d4c('0x41')]);process[_0x4d4c('0x42')](0x1);}function handleError(_0x51ea8d,_0x1f406f){stats['errors'][_0x4d4c('0x43')]({'name':_0x1f406f[_0x4d4c('0x44')],'message':_0x1f406f[_0x4d4c('0x41')],'row':_0x51ea8d});}function handleQuery(_0x4dc535){logger[_0x4d4c('0x3e')](_0x4dc535);return db[_0x4d4c('0x45')][_0x4d4c('0x46')](_0x4dc535)[_0x4d4c('0x47')](function(_0xc9c73e){results[_0x4d4c('0x43')](_0xc9c73e);})['catch'](function(_0x2ccf44){logger[_0x4d4c('0x40')](_0x2ccf44[_0x4d4c('0x41')]);});}function updateTzCampaigns(_0x4bfc9b){return new Promise(function(_0x32676f,_0x44d03f){var _0x198dbe=squel[_0x4d4c('0x25')]()[_0x4d4c('0x26')]([_0x4d4c('0x48'),'campaigns.dialTimezone'])[_0x4d4c('0x12')]('campaigns')[_0x4d4c('0x13')](_0x4d4c('0x49'),null,_0x4d4c('0x4a'))['where'](_0x4d4c('0x4b')+_0x4bfc9b);db['sequelize']['query'](_0x198dbe[_0x4d4c('0x2c')]())[_0x4d4c('0x47')](function(_0x2cc5c5){var _0x44b4e7=[];for(var _0x4b354c=0x0;_0x4b354c<_0x2cc5c5[_0x4d4c('0x4c')];_0x4b354c++){_0x44b4e7[_0x4d4c('0x43')](getTimezoneData(_0x2cc5c5[_0x4b354c],tmp_campaigns));}BPromise['all'](_0x44b4e7)['then'](function(){_0x32676f({'val':0x1});});})['catch'](function(_0x363aaa){logger[_0x4d4c('0x40')](_0x363aaa['message']);_0x32676f({'val':0x0});});});}function updateTzVoiceQueues(_0x185055){return new Promise(function(_0x76557f,_0x86aa87){var _0x1d37ba=squel[_0x4d4c('0x25')]()['fields']([_0x4d4c('0x4d'),_0x4d4c('0x4e')])[_0x4d4c('0x12')](_0x4d4c('0x4f'))['join'](_0x4d4c('0x50'),null,_0x4d4c('0x51'))[_0x4d4c('0x15')](_0x4d4c('0x52')+_0x185055);db[_0x4d4c('0x45')][_0x4d4c('0x46')](_0x1d37ba[_0x4d4c('0x2c')]())[_0x4d4c('0x47')](function(_0xb35082){var _0x4fc358=[];for(var _0x238bdb=0x0;_0x238bdb<_0xb35082[_0x4d4c('0x4c')];_0x238bdb++){_0x4fc358['push'](getTimezoneData(_0xb35082[_0x238bdb],tmp_voice_queues));}BPromise[_0x4d4c('0x53')](_0x4fc358)[_0x4d4c('0x54')](function(){_0x76557f({'val':0x1});});})[_0x4d4c('0x55')](function(_0x1bebaf){logger[_0x4d4c('0x40')](_0x1bebaf[_0x4d4c('0x41')]);_0x76557f({'val':0x0});});});}function getTimezoneData(_0x4bf8d3,_0x3f59a3){return new Promise(function(_0xf77841,_0x4559d6){var _0x1c4204=shared[_0x4d4c('0x56')];var _0xf745b2=_0x1c4204[_0x4bf8d3[_0x4d4c('0x57')]];if(_[_0x4d4c('0x58')](_0xf745b2)){_0xf77841({'ret':0x1});}else{var _0x548a8d=_0xf745b2[_0x4d4c('0x59')];var _0x3b33f5=squel[_0x4d4c('0x1d')]()[_0x4d4c('0x1e')](_0x3f59a3)['set']('id',_0x4bf8d3['id'])[_0x4d4c('0x5a')](_0x4d4c('0x5b'),_0x548a8d)[_0x4d4c('0x5a')](_0x4d4c('0x57'),_0x4bf8d3[_0x4d4c('0x57')])[_0x4d4c('0x2c')]();return db['sequelize'][_0x4d4c('0x46')](_0x3b33f5)[_0x4d4c('0x47')](function(_0x7a6965){_0xf77841({'ret':0x1});})['catch'](function(_0x542eda){logger[_0x4d4c('0x40')](_0x542eda['message']);_0x4559d6({'ret':0x1});});}});}function handleTZQuery(_0x494c20){logger[_0x4d4c('0x3e')](_0x494c20);return db['sequelize']['query'](_0x494c20)[_0x4d4c('0x47')](function(_0x428900){})[_0x4d4c('0x55')](function(_0x5d3d9e){logger[_0x4d4c('0x40')](_0x5d3d9e[_0x4d4c('0x41')]);});}function main(_0x5546b4,_0x139a36,_0x1f41bd,_0x17753d){logger['info']('main',_0x5546b4,JSON[_0x4d4c('0x5c')](_0x139a36));process['send'](_0x4d4c('0x5d'));var _0x47855a=_0x139a36['binding'];var _0x4ae18d=_0x139a36[_0x4d4c('0x5e')];var _0x5beb97=path[_0x4d4c('0x13')](config[_0x4d4c('0x5f')],_0x4d4c('0x60'),_0x4ae18d+'.csv');hasTZ=_[_0x4d4c('0x61')](_0x47855a)[_0x4d4c('0x62')](_0x4d4c('0x57'));var _0x246cc1=_[_0x4d4c('0x61')](_0x47855a)[_0x4d4c('0x13')]();logger[_0x4d4c('0x3e')](_0x4d4c('0x63'),_0x246cc1);if(hasTZ)_0x246cc1+=_0x4d4c('0x64');fs[_0x4d4c('0x65')](_0x5beb97,_0x246cc1+'\x0a');Papa['parse'](fs[_0x4d4c('0x66')](_0x5546b4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x39fd6d,_0x20210c){try{for(var _0xd0c2e=0x0,_0x22e86e=[];_0xd0c2e<_0x39fd6d[_0x4d4c('0x67')]['length'];_0xd0c2e++){stats[_0x4d4c('0x68')]+=0x1;if(_0x39fd6d['errors'][_0xd0c2e]){handleError(_0x39fd6d['data'][_0xd0c2e],_0x39fd6d[_0x4d4c('0x69')][_0xd0c2e]);}else{var _0x89afbe=[];for(var _0x5713a2 in _0x47855a){if(_0x47855a[_0x4d4c('0x6a')](_0x5713a2)){if(_0x39fd6d['data'][_0xd0c2e][_0x47855a[_0x5713a2]]){var _0x212610=_[_0x4d4c('0x6b')](_0x39fd6d[_0x4d4c('0x67')][_0xd0c2e][_0x47855a[_0x5713a2]][_0x4d4c('0x6c')](/"/g,'\x27'));switch(_0x5713a2){case _0x4d4c('0x1f'):var _0x2d1240=moment(_0x212610,_0x4d4c('0x6d'),!![]);if(_0x2d1240[_0x4d4c('0x6e')]()){_0x22e86e[_0x4d4c('0x43')]('\x22'+_0x212610+'\x22');}else{_0x89afbe[_0x4d4c('0x43')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x16ddba=parseInt(_0x212610);_0x212610=_[_0x4d4c('0x6f')](_0x16ddba)||_0x16ddba<0x0||_0x16ddba>0x4?_0x17753d?0x3:0x2:_0x16ddba;_0x22e86e[_0x4d4c('0x43')]('\x22'+_0x212610+'\x22');break;case _0x4d4c('0x23'):var _0x4d1947=parseInt(_0x212610);if(_['isNumber'](_0x4d1947)&&_[_0x4d4c('0x62')](_0x1f41bd,_0x4d1947)){_0x22e86e[_0x4d4c('0x43')]('\x22'+_0x4d1947+'\x22');}else{_0x89afbe[_0x4d4c('0x43')](_0x4d4c('0x70'));}break;case _0x4d4c('0x71'):if(isEmail(_0x212610)){_0x22e86e['push']('\x22'+_0x212610+'\x22');}else{_0x89afbe[_0x4d4c('0x43')](_0x4d4c('0x72'));}break;case _0x4d4c('0x73'):var _0x4e17a7=moment(_0x212610,_0x4d4c('0x74'),!![]);if(_0x4e17a7[_0x4d4c('0x6e')]()){_0x22e86e['push']('\x22'+_0x212610+'\x22');}else{_0x89afbe['push'](_0x4d4c('0x75'));}break;case _0x4d4c('0x57'):var _0x5a9a1f=shared[_0x4d4c('0x56')];var _0x2eee1a=_0x5a9a1f[_0x212610];if(!_[_0x4d4c('0x58')](_0x2eee1a)){var _0x4ee11c=_0x2eee1a[_0x4d4c('0x59')];_0x22e86e['push']('\x22'+_0x212610+'\x22');_0x22e86e['push']('\x22'+_0x4ee11c+'\x22');}break;default:_0x22e86e[_0x4d4c('0x43')]('\x22'+_0x212610+'\x22');}}else{switch(_0x5713a2){case _0x4d4c('0x76'):case _0x4d4c('0x11'):_0x89afbe[_0x4d4c('0x43')](_0x5713a2+_0x4d4c('0x77'));break;default:_0x22e86e[_0x4d4c('0x43')]('\x22\x22');}}}}if(_0x89afbe[_0x4d4c('0x4c')]){handleError(_0x39fd6d[_0x4d4c('0x67')][_0xd0c2e],{'code':'SystemRow','message':_0x89afbe[_0x4d4c('0x13')]()});}else{fs[_0x4d4c('0x78')](_0x5beb97,_0x22e86e[_0x4d4c('0x13')]()+'\x0a');}_0x22e86e=[];}if(!(stats[_0x4d4c('0x68')]%0xc8)){socket[_0x4d4c('0x79')](_0x4d4c('0x7a')+_0x4ae18d,stats);stats[_0x4d4c('0x69')]=[];}}if(stopped){logger[_0x4d4c('0x3e')]('Abort\x20parser');_0x20210c[_0x4d4c('0x7b')]();}}catch(_0x483f54){handleError(_0x39fd6d[_0x4d4c('0x67')][_0xd0c2e],{'code':_0x4d4c('0x7c'),'message':_0x483f54[_0x4d4c('0x41')]});logger[_0x4d4c('0x40')](_0x4d4c('0x7d'),_0x483f54[_0x4d4c('0x41')]);}},'complete':function(){try{var _0x48cdd8=[];var _0x5d4ac4=[];var _0x437401=_0x4d4c('0x27');if(_0x139a36[_0x4d4c('0x7e')]&&_0x139a36[_0x4d4c('0x7e')]['length']){_0x437401=_0x4d4c('0x7f')+_0x4ae18d;_0x48cdd8[_0x4d4c('0x43')](_0x4d4c('0x80')+_0x437401+_0x4d4c('0x81'));}tmp_campaigns=_0x4d4c('0x82')+_0x4ae18d;tmp_voice_queues=_0x4d4c('0x83')+_0x4ae18d;_0x5d4ac4[_0x4d4c('0x43')](_0x4d4c('0x80')+tmp_campaigns+_0x4d4c('0x84'));_0x5d4ac4[_0x4d4c('0x43')](_0x4d4c('0x80')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x4d4c('0x85')](_0x5d4ac4,handleTZQuery)[_0x4d4c('0x54')](function(_0x2fc92a){updateTzCampaigns(_0x139a36[_0x4d4c('0x21')])[_0x4d4c('0x54')](function(_0x5d98d){updateTzVoiceQueues(_0x139a36[_0x4d4c('0x21')])['then'](function(_0x351a9a){var _0x529ac5=util['format'](_0x4d4c('0x86'),_0x5beb97,_0x437401,_0x246cc1,_0x139a36['ListId'],_0x139a36[_0x4d4c('0x87')]||null,NOW,NOW);if(_['isNil'](_0x47855a['scheduledat'])){_0x529ac5+=_0x4d4c('0x88');}_0x48cdd8[_0x4d4c('0x43')](_0x529ac5);if(_0x139a36['duplicates']&&_0x139a36[_0x4d4c('0x7e')][_0x4d4c('0x4c')]){_0x48cdd8[_0x4d4c('0x43')](insertCmContact(_0x139a36[_0x4d4c('0x21')],_0x437401,_0x139a36[_0x4d4c('0x7e')],_0x47855a));_0x48cdd8[_0x4d4c('0x43')](_0x4d4c('0x89')+_0x437401+';');}if(hasTZ){_0x48cdd8['push'](insertTzCmHopper(_0x139a36[_0x4d4c('0x21')],_0x4d4c('0x50'),'voice_queues',_0x4d4c('0x8a'),_0x17753d,tmp_voice_queues));_0x48cdd8['push'](insertTzCmHopperBlack(_0x139a36[_0x4d4c('0x21')],'voice_queues_has_cm_blacklists',_0x4d4c('0x4f'),_0x4d4c('0x8a')));_0x48cdd8[_0x4d4c('0x43')](insertTzCmHopper(_0x139a36['ListId'],_0x4d4c('0x49'),_0x4d4c('0x8b'),_0x4d4c('0x8c'),_0x17753d,tmp_campaigns));_0x48cdd8['push'](insertTzCmHopperBlack(_0x139a36[_0x4d4c('0x21')],_0x4d4c('0x8d'),_0x4d4c('0x8b'),_0x4d4c('0x8c')));}else{_0x48cdd8[_0x4d4c('0x43')](insertCmHopper(_0x139a36['ListId'],_0x4d4c('0x50'),'voice_queues',_0x4d4c('0x8a'),_0x17753d));_0x48cdd8[_0x4d4c('0x43')](insertCmHopperBlack(_0x139a36['ListId'],_0x4d4c('0x8e'),_0x4d4c('0x4f'),_0x4d4c('0x8a')));_0x48cdd8[_0x4d4c('0x43')](insertCmHopper(_0x139a36[_0x4d4c('0x21')],_0x4d4c('0x49'),_0x4d4c('0x8b'),_0x4d4c('0x8c'),_0x17753d));_0x48cdd8[_0x4d4c('0x43')](insertCmHopperBlack(_0x139a36[_0x4d4c('0x21')],'campaigns_has_cm_blacklists','campaigns',_0x4d4c('0x8c')));}_0x48cdd8[_0x4d4c('0x43')](_0x4d4c('0x89')+tmp_campaigns+';');_0x48cdd8[_0x4d4c('0x43')](_0x4d4c('0x89')+tmp_voice_queues+';');BPromise[_0x4d4c('0x85')](_0x48cdd8,handleQuery)[_0x4d4c('0x54')](function(_0x571c55){stats[_0x4d4c('0x8f')]=!![];stats[_0x4d4c('0x90')]=_0x139a36['duplicates']&&_0x139a36[_0x4d4c('0x7e')][_0x4d4c('0x4c')]?results[0x2][_0x4d4c('0x90')]:results[0x0]['affectedRows'];socket[_0x4d4c('0x79')](_0x4d4c('0x7a')+_0x4ae18d,stats);fs[_0x4d4c('0x91')](_0x5546b4);fs['unlink'](_0x5beb97);process[_0x4d4c('0x42')](0x0);})[_0x4d4c('0x55')](function(_0x598a17){logger[_0x4d4c('0x40')](_0x598a17[_0x4d4c('0x41')]);process[_0x4d4c('0x42')](0x1);});});});});}catch(_0x568c5c){logger[_0x4d4c('0x40')](_0x4d4c('0x92'),_0x568c5c[_0x4d4c('0x41')]);process[_0x4d4c('0x42')](0x1);}},'error':function(_0x419e18,_0x35dcaf,_0x3a7741,_0x1249f5){throw new Error(_0x1249f5);}});}function validate(){if(process['argv']&&process[_0x4d4c('0x93')][_0x4d4c('0x4c')]<0x4){throw new Error(_0x4d4c('0x94'));}var _0x56918f=path[_0x4d4c('0x13')](config['root'],'server/files/tmp',process[_0x4d4c('0x93')][0x2]);if(!fs[_0x4d4c('0x95')](_0x56918f)){throw new Error(_0x4d4c('0x96'));}var _0x4cbd2e={};try{_0x4cbd2e=JSON['parse'](process[_0x4d4c('0x93')][0x3]);if(!_0x4cbd2e[_0x4d4c('0x97')]){throw new Error(_0x4d4c('0x98'));}if(!_0x4cbd2e[_0x4d4c('0x97')][_0x4d4c('0x11')]){throw new Error(_0x4d4c('0x99'));}if(!_0x4cbd2e['binding'][_0x4d4c('0x76')]){throw new Error(_0x4d4c('0x9a'));}var _0x3d3ad7=0x0;if(_0x4cbd2e['binding'][_0x4d4c('0x23')]){_0x3d3ad7=0x1;}if(!_0x4cbd2e['ListId']){throw new Error(_0x4d4c('0x9b'));}}catch(_0x293008){throw new Error(_0x4d4c('0x9c'));}var _0x5a345d=[];try{_0x5a345d=_[_0x4d4c('0x9d')](JSON[_0x4d4c('0x9e')](process[_0x4d4c('0x93')][0x4]),'id');}catch(_0x212ba5){logger[_0x4d4c('0x3e')](_0x4d4c('0x9f'));}main(_0x56918f,_0x4cbd2e,_0x5a345d,_0x3d3ad7);}validate();process['on']('SIGINT',handleStop);process['on'](_0x4d4c('0xa0'),handleUncaughtException); \ No newline at end of file +var _0xba62=['\x22onlyIfOpen\x22','cm_contacts.ListId','cm_hopper_black','fromQuery','ContactId','ListId','field','ListId\x20=\x20?','\x20=\x20?','toString','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','priority','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','group','info','Received\x20SIGINT','error','message','errors','push','code','sequelize','spread','catch','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','length','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','all','then','timezones','dialTimezone','utcOffset','set','offset','main','stringify','start','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header',',utcOffset','writeFileSync','parse','data','rows','hasOwnProperty','replace','scheduledat','isValid','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xba62,0x197));var _0x2ba6=function(_0x38616d,_0x22fbe5){_0x38616d=_0x38616d-0x0;var _0x505626=_0xba62[_0x38616d];return _0x505626;};'use strict';var fs=require('fs');var path=require(_0x2ba6('0x0'));var _=require(_0x2ba6('0x1'));var Papa=require(_0x2ba6('0x2'));var util=require('util');var BPromise=require(_0x2ba6('0x3'));var moment=require(_0x2ba6('0x4'));var squel=require(_0x2ba6('0x5'));var Redis=require('ioredis');var db=require(_0x2ba6('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0x2ba6('0x7'));var logger=require(_0x2ba6('0x8'))('import');config[_0x2ba6('0x9')]=_[_0x2ba6('0xa')](config[_0x2ba6('0x9')],{'host':_0x2ba6('0xb'),'port':0x18eb});var socket=require(_0x2ba6('0xc'))(new Redis(config[_0x2ba6('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2ba6('0xd')](_0x2ba6('0xe'));function isEmail(_0x90d8b0){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'](_0x90d8b0);}function selectNotIn(_0x5b91b7,_0x17fbb6,_0x3f9549,_0x4798b7,_0x1a26f9){return squel[_0x2ba6('0xf')]()['field'](_0x2ba6('0x10'))[_0x2ba6('0x11')](_0x4798b7)[_0x2ba6('0x12')](_0x17fbb6,null,_0x17fbb6+_0x2ba6('0x13')+_0x4798b7+'.'+_0x3f9549)[_0x2ba6('0x14')](_0x4798b7+'.'+_0x3f9549+_0x2ba6('0x15')+_0x5b91b7+'.'+_0x3f9549)[_0x2ba6('0x14')](_0x17fbb6+_0x2ba6('0x16')+_0x1a26f9[_0x2ba6('0x12')]()+')');}function insertCmHopper(_0x313fd7,_0x1ef7d9,_0x481d16,_0x4a5844,_0x25b3b3){var _0x180972=['cm_contacts.phone',_0x2ba6('0x17'),_0x2ba6('0x18'),'cm_contacts.ListId',_0x1ef7d9+'.'+_0x4a5844,_0x2ba6('0x19'),_0x2ba6('0x1a'),'cm_contacts.priority',_0x2ba6('0x1b'),'\x22'+_0x25b3b3+'\x22'];return squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x2ba6('0x1e'))['fromQuery']([_0x2ba6('0x10'),'scheduledat','ContactId','ListId',_0x4a5844,_0x2ba6('0x1f'),_0x2ba6('0x20'),'priority',_0x2ba6('0x21'),_0x2ba6('0x22')],squel['select']()[_0x2ba6('0x23')](_0x180972)[_0x2ba6('0x11')](_0x1ef7d9)[_0x2ba6('0x12')](_0x2ba6('0x24'),null,_0x2ba6('0x25')+_0x1ef7d9+_0x2ba6('0x26'))['join'](_0x481d16,null,_0x481d16+_0x2ba6('0x13')+_0x1ef7d9+'.'+_0x4a5844)[_0x2ba6('0x14')](_0x1ef7d9+_0x2ba6('0x27'),_0x313fd7)[_0x2ba6('0x14')](_0x2ba6('0x28'),NOW)['where'](_0x2ba6('0x29'),selectNotIn(_0x1ef7d9,_0x481d16,_0x4a5844,'cm_hopper',[_0x2ba6('0x2a'),_0x2ba6('0x2b')]))['where'](_0x2ba6('0x29'),selectNotIn(_0x1ef7d9,_0x481d16,_0x4a5844,_0x2ba6('0x1e'),[_0x2ba6('0x2a')])))['toString']();}function insertCmHopperBlack(_0x4b47cf,_0x51a46f,_0xdcc3e0,_0x173695){var _0x45bca8=['cm_contacts.phone',_0x2ba6('0x18'),_0x2ba6('0x2c'),_0x51a46f+'.'+_0x173695,_0x2ba6('0x19'),_0x2ba6('0x1a')];return squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x2ba6('0x2d'))[_0x2ba6('0x2e')]([_0x2ba6('0x10'),_0x2ba6('0x2f'),_0x2ba6('0x30'),_0x173695,_0x2ba6('0x1f'),'updatedAt'],squel[_0x2ba6('0xf')]()['fields'](_0x45bca8)[_0x2ba6('0x11')](_0x51a46f)[_0x2ba6('0x12')]('cm_contacts',null,_0x2ba6('0x25')+_0x51a46f+'.CmListId')['join'](_0xdcc3e0,null,_0xdcc3e0+_0x2ba6('0x13')+_0x51a46f+'.'+_0x173695)[_0x2ba6('0x14')](_0x51a46f+'.CmListId\x20=\x20?',_0x4b47cf)[_0x2ba6('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2ba6('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2ba6('0x31')](_0x2ba6('0x10'))[_0x2ba6('0x11')](_0x2ba6('0x2d'))[_0x2ba6('0x14')](_0x2ba6('0x32'),_0x4b47cf)[_0x2ba6('0x14')](_0x173695+_0x2ba6('0x33'),_0x51a46f+'.'+_0x173695)))[_0x2ba6('0x34')]();}function insertTzCmHopper(_0x336b4b,_0x373bf8,_0x2bafbb,_0x2f6b49,_0x8c12d1,_0x54dba5){var _0x329a0f=[_0x2ba6('0x35'),_0x2ba6('0x36')+_0x54dba5+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','cm_contacts.ListId',_0x373bf8+'.'+_0x2f6b49,_0x2ba6('0x19'),_0x2ba6('0x1a'),'cm_contacts.priority',_0x2ba6('0x1b'),'\x22'+_0x8c12d1+'\x22'];var _0x4ff021=squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x2ba6('0x1e'))['fromQuery']([_0x2ba6('0x10'),'scheduledat','ContactId',_0x2ba6('0x30'),_0x2f6b49,_0x2ba6('0x1f'),_0x2ba6('0x20'),_0x2ba6('0x37'),_0x2ba6('0x21'),'recallme'],squel[_0x2ba6('0xf')]()[_0x2ba6('0x23')](_0x329a0f)['from'](_0x373bf8)[_0x2ba6('0x12')](_0x2ba6('0x24'),null,_0x2ba6('0x25')+_0x373bf8+'.CmListId')[_0x2ba6('0x12')](_0x2bafbb,null,_0x2bafbb+_0x2ba6('0x13')+_0x373bf8+'.'+_0x2f6b49)[_0x2ba6('0x12')](_0x54dba5,null,_0x54dba5+_0x2ba6('0x13')+_0x373bf8+'.'+_0x2f6b49)[_0x2ba6('0x14')](_0x373bf8+_0x2ba6('0x27'),_0x336b4b)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2ba6('0x14')](_0x2ba6('0x29'),selectNotIn(_0x373bf8,_0x2bafbb,_0x2f6b49,_0x2ba6('0x1e'),[_0x2ba6('0x2a'),'\x22onlyIfOpen\x22']))[_0x2ba6('0x14')](_0x2ba6('0x29'),selectNotIn(_0x373bf8,_0x2bafbb,_0x2f6b49,_0x2ba6('0x1e'),['\x22always\x22'])))['toString']();return _0x4ff021;}function insertTzCmHopperBlack(_0x5a1b47,_0x28a0c8,_0x148196,_0x272880){var _0x271bfe=[_0x2ba6('0x35'),_0x2ba6('0x18'),_0x2ba6('0x2c'),_0x28a0c8+'.'+_0x272880,_0x2ba6('0x19'),_0x2ba6('0x1a')];return squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x2ba6('0x2d'))['fromQuery']([_0x2ba6('0x10'),_0x2ba6('0x2f'),'ListId',_0x272880,_0x2ba6('0x1f'),_0x2ba6('0x20')],squel[_0x2ba6('0xf')]()[_0x2ba6('0x23')](_0x271bfe)[_0x2ba6('0x11')](_0x28a0c8)['join']('cm_contacts',null,_0x2ba6('0x25')+_0x28a0c8+_0x2ba6('0x26'))[_0x2ba6('0x12')](_0x148196,null,_0x148196+_0x2ba6('0x13')+_0x28a0c8+'.'+_0x272880)[_0x2ba6('0x14')](_0x28a0c8+'.CmListId\x20=\x20?',_0x5a1b47)[_0x2ba6('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2ba6('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2ba6('0xf')]()[_0x2ba6('0x31')]('phone')['from']('cm_hopper_black')[_0x2ba6('0x14')](_0x2ba6('0x32'),_0x5a1b47)[_0x2ba6('0x14')](_0x272880+_0x2ba6('0x33'),_0x28a0c8+'.'+_0x272880)))[_0x2ba6('0x34')]();}function insertCmContact(_0x198656,_0x3e6288,_0x341346,_0x1d3f31){var _0x4842bc=_['concat'](_['keys'](_0x1d3f31),[_0x2ba6('0x30'),_0x2ba6('0x38'),'createdAt',_0x2ba6('0x20')]);return squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x2ba6('0x24'))['fromQuery'](_0x4842bc,squel['select']()[_0x2ba6('0x23')](_0x4842bc)[_0x2ba6('0x11')](_0x3e6288)['where']('('+_0x341346[_0x2ba6('0x12')](',')+_0x2ba6('0x39'),squel[_0x2ba6('0xf')]()[_0x2ba6('0x23')](_0x341346)[_0x2ba6('0x11')](_0x2ba6('0x24'))['where']('ListId\x20=\x20?',_0x198656)[_0x2ba6('0x14')](_0x2ba6('0x3a')))[_0x2ba6('0x14')]('id\x20IN\x20?',squel[_0x2ba6('0xf')]()['field'](_0x2ba6('0x3b'),'min_id')[_0x2ba6('0x11')](_0x3e6288)[_0x2ba6('0x3c')](_0x341346[_0x2ba6('0x12')](','))))[_0x2ba6('0x34')]();}function handleStop(){logger[_0x2ba6('0x3d')](_0x2ba6('0x3e'));stopped=!![];}function handleUncaughtException(_0x473c27){logger[_0x2ba6('0x3f')](_0x473c27[_0x2ba6('0x40')]);process['exit'](0x1);}function handleError(_0x2a1f2a,_0x4ee0a8){stats[_0x2ba6('0x41')][_0x2ba6('0x42')]({'name':_0x4ee0a8[_0x2ba6('0x43')],'message':_0x4ee0a8[_0x2ba6('0x40')],'row':_0x2a1f2a});}function handleQuery(_0x2092fc){logger[_0x2ba6('0x3d')](_0x2092fc);return db[_0x2ba6('0x44')]['query'](_0x2092fc)[_0x2ba6('0x45')](function(_0x1e1c6a){results['push'](_0x1e1c6a);})[_0x2ba6('0x46')](function(_0x3248b5){logger[_0x2ba6('0x3f')](_0x3248b5[_0x2ba6('0x40')]);});}function updateTzCampaigns(_0x1423d9){return new Promise(function(_0x13f0b7,_0x5a99e8){var _0x1ac094=squel[_0x2ba6('0xf')]()[_0x2ba6('0x23')](['campaigns.id','campaigns.dialTimezone'])[_0x2ba6('0x11')](_0x2ba6('0x47'))[_0x2ba6('0x12')]('campaigns_has_cm_lists',null,_0x2ba6('0x48'))[_0x2ba6('0x14')]('campaigns_has_cm_lists.CmListId='+_0x1423d9);db[_0x2ba6('0x44')][_0x2ba6('0x49')](_0x1ac094[_0x2ba6('0x34')]())[_0x2ba6('0x45')](function(_0x24d54e){var _0x1162f8=[];for(var _0x20f367=0x0;_0x20f367<_0x24d54e[_0x2ba6('0x4a')];_0x20f367++){_0x1162f8[_0x2ba6('0x42')](getTimezoneData(_0x24d54e[_0x20f367],tmp_campaigns));}BPromise['all'](_0x1162f8)['then'](function(){_0x13f0b7({'val':0x1});});})['catch'](function(_0x5f41f5){logger[_0x2ba6('0x3f')](_0x5f41f5['message']);_0x13f0b7({'val':0x0});});});}function updateTzVoiceQueues(_0x40633a){return new Promise(function(_0xe89b15,_0x1a071f){var _0x153f46=squel[_0x2ba6('0xf')]()['fields']([_0x2ba6('0x4b'),_0x2ba6('0x4c')])[_0x2ba6('0x11')](_0x2ba6('0x4d'))[_0x2ba6('0x12')](_0x2ba6('0x4e'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x2ba6('0x14')](_0x2ba6('0x4f')+_0x40633a);db[_0x2ba6('0x44')][_0x2ba6('0x49')](_0x153f46[_0x2ba6('0x34')]())[_0x2ba6('0x45')](function(_0xacad3f){var _0x57d98f=[];for(var _0x354306=0x0;_0x354306<_0xacad3f[_0x2ba6('0x4a')];_0x354306++){_0x57d98f[_0x2ba6('0x42')](getTimezoneData(_0xacad3f[_0x354306],tmp_voice_queues));}BPromise[_0x2ba6('0x50')](_0x57d98f)[_0x2ba6('0x51')](function(){_0xe89b15({'val':0x1});});})[_0x2ba6('0x46')](function(_0x52666d){logger[_0x2ba6('0x3f')](_0x52666d[_0x2ba6('0x40')]);_0xe89b15({'val':0x0});});});}function getTimezoneData(_0x5a2b65,_0x101d16){return new Promise(function(_0x341194,_0x42991f){var _0x51ab25=shared[_0x2ba6('0x52')];var _0x28fea2=_0x51ab25[_0x5a2b65[_0x2ba6('0x53')]];if(_['isNil'](_0x28fea2)){_0x341194({'ret':0x1});}else{var _0x11b9c9=_0x28fea2[_0x2ba6('0x54')];var _0x1f84e1=squel[_0x2ba6('0x1c')]()[_0x2ba6('0x1d')](_0x101d16)[_0x2ba6('0x55')]('id',_0x5a2b65['id'])[_0x2ba6('0x55')](_0x2ba6('0x56'),_0x11b9c9)[_0x2ba6('0x55')](_0x2ba6('0x53'),_0x5a2b65[_0x2ba6('0x53')])[_0x2ba6('0x34')]();return db[_0x2ba6('0x44')]['query'](_0x1f84e1)[_0x2ba6('0x45')](function(_0x39a012){_0x341194({'ret':0x1});})[_0x2ba6('0x46')](function(_0x41efb6){logger[_0x2ba6('0x3f')](_0x41efb6[_0x2ba6('0x40')]);_0x42991f({'ret':0x1});});}});}function handleTZQuery(_0x3a6eb1){logger['info'](_0x3a6eb1);return db[_0x2ba6('0x44')][_0x2ba6('0x49')](_0x3a6eb1)[_0x2ba6('0x45')](function(_0xf0e833){})[_0x2ba6('0x46')](function(_0x1818bf){logger['error'](_0x1818bf[_0x2ba6('0x40')]);});}function main(_0x122eeb,_0x3e3d30,_0x2d01c7,_0x549c06){logger[_0x2ba6('0x3d')](_0x2ba6('0x57'),_0x122eeb,JSON[_0x2ba6('0x58')](_0x3e3d30));process['send'](_0x2ba6('0x59'));var _0x35928e=_0x3e3d30['binding'];var _0x30f307=_0x3e3d30[_0x2ba6('0x5a')];var _0x100361=path[_0x2ba6('0x12')](config[_0x2ba6('0x5b')],_0x2ba6('0x5c'),_0x30f307+_0x2ba6('0x5d'));hasTZ=_[_0x2ba6('0x5e')](_0x35928e)[_0x2ba6('0x5f')](_0x2ba6('0x53'));var _0x507af1=_[_0x2ba6('0x5e')](_0x35928e)[_0x2ba6('0x12')]();logger[_0x2ba6('0x3d')](_0x2ba6('0x60'),_0x507af1);if(hasTZ)_0x507af1+=_0x2ba6('0x61');fs[_0x2ba6('0x62')](_0x100361,_0x507af1+'\x0a');Papa[_0x2ba6('0x63')](fs['createReadStream'](_0x122eeb),{'header':!![],'skipEmptyLines':!![],'step':function(_0xbcc35d,_0x452047){try{for(var _0x2d17c0=0x0,_0x2d2db7=[];_0x2d17c0<_0xbcc35d[_0x2ba6('0x64')][_0x2ba6('0x4a')];_0x2d17c0++){stats[_0x2ba6('0x65')]+=0x1;if(_0xbcc35d[_0x2ba6('0x41')][_0x2d17c0]){handleError(_0xbcc35d['data'][_0x2d17c0],_0xbcc35d[_0x2ba6('0x41')][_0x2d17c0]);}else{var _0x426e40=[];for(var _0xcd0841 in _0x35928e){if(_0x35928e[_0x2ba6('0x66')](_0xcd0841)){if(_0xbcc35d[_0x2ba6('0x64')][_0x2d17c0][_0x35928e[_0xcd0841]]){var _0x2c36f2=_['trim'](_0xbcc35d[_0x2ba6('0x64')][_0x2d17c0][_0x35928e[_0xcd0841]][_0x2ba6('0x67')](/"/g,'\x27'));switch(_0xcd0841){case _0x2ba6('0x68'):var _0x2719f2=moment(_0x2c36f2,_0x2ba6('0xe'),!![]);if(_0x2719f2[_0x2ba6('0x69')]()){_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');}else{_0x426e40[_0x2ba6('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2ba6('0x37'):var _0x557f91=parseInt(_0x2c36f2);_0x2c36f2=_['isNaN'](_0x557f91)||_0x557f91<0x0||_0x557f91>0x4?_0x549c06?0x3:0x2:_0x557f91;_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');break;case'UserId':var _0x20cec4=parseInt(_0x2c36f2);if(_['isNumber'](_0x20cec4)&&_[_0x2ba6('0x5f')](_0x2d01c7,_0x20cec4)){_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x20cec4+'\x22');}else{_0x426e40[_0x2ba6('0x42')](_0x2ba6('0x6a'));}break;case _0x2ba6('0x6b'):if(isEmail(_0x2c36f2)){_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');}else{_0x426e40[_0x2ba6('0x42')]('email\x20wrong\x20format');}break;case _0x2ba6('0x6c'):var _0x3ba267=moment(_0x2c36f2,_0x2ba6('0x6d'),!![]);if(_0x3ba267[_0x2ba6('0x69')]()){_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');}else{_0x426e40['push'](_0x2ba6('0x6e'));}break;case _0x2ba6('0x53'):var _0x98476f=shared['timezones'];var _0x3aae9e=_0x98476f[_0x2c36f2];if(!_[_0x2ba6('0x6f')](_0x3aae9e)){var _0x431a31=_0x3aae9e['utcOffset'];_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x431a31+'\x22');}break;default:_0x2d2db7[_0x2ba6('0x42')]('\x22'+_0x2c36f2+'\x22');}}else{switch(_0xcd0841){case'firstName':case _0x2ba6('0x10'):_0x426e40[_0x2ba6('0x42')](_0xcd0841+_0x2ba6('0x70'));break;default:_0x2d2db7[_0x2ba6('0x42')]('\x22\x22');}}}}if(_0x426e40[_0x2ba6('0x4a')]){handleError(_0xbcc35d[_0x2ba6('0x64')][_0x2d17c0],{'code':'SystemRow','message':_0x426e40['join']()});}else{fs[_0x2ba6('0x71')](_0x100361,_0x2d2db7[_0x2ba6('0x12')]()+'\x0a');}_0x2d2db7=[];}if(!(stats[_0x2ba6('0x65')]%0xc8)){socket[_0x2ba6('0x72')](_0x2ba6('0x73')+_0x30f307,stats);stats['errors']=[];}}if(stopped){logger[_0x2ba6('0x3d')](_0x2ba6('0x74'));_0x452047[_0x2ba6('0x75')]();}}catch(_0x3c94a5){handleError(_0xbcc35d[_0x2ba6('0x64')][_0x2d17c0],{'code':_0x2ba6('0x76'),'message':_0x3c94a5['message']});logger[_0x2ba6('0x3f')](_0x2ba6('0x77'),_0x3c94a5[_0x2ba6('0x40')]);}},'complete':function(){try{var _0x3c2348=[];var _0x166ecd=[];var _0x2f0de6=_0x2ba6('0x24');if(_0x3e3d30[_0x2ba6('0x78')]&&_0x3e3d30[_0x2ba6('0x78')][_0x2ba6('0x4a')]){_0x2f0de6=_0x2ba6('0x79')+_0x30f307;_0x3c2348[_0x2ba6('0x42')](_0x2ba6('0x7a')+_0x2f0de6+_0x2ba6('0x7b'));}tmp_campaigns=_0x2ba6('0x7c')+_0x30f307;tmp_voice_queues=_0x2ba6('0x7d')+_0x30f307;_0x166ecd[_0x2ba6('0x42')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x2ba6('0x7e'));_0x166ecd[_0x2ba6('0x42')](_0x2ba6('0x7a')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x2ba6('0x7f')](_0x166ecd,handleTZQuery)[_0x2ba6('0x51')](function(_0x18839d){updateTzCampaigns(_0x3e3d30['ListId'])[_0x2ba6('0x51')](function(_0x2c6377){updateTzVoiceQueues(_0x3e3d30[_0x2ba6('0x30')])[_0x2ba6('0x51')](function(_0x2fb82b){var _0x4d1e28=util[_0x2ba6('0xd')](_0x2ba6('0x80'),_0x100361,_0x2f0de6,_0x507af1,_0x3e3d30[_0x2ba6('0x30')],_0x3e3d30['CompanyId']||null,NOW,NOW);if(_[_0x2ba6('0x6f')](_0x35928e[_0x2ba6('0x68')])){_0x4d1e28+=',\x20scheduledAt\x20=\x20NOW()';}_0x3c2348[_0x2ba6('0x42')](_0x4d1e28);if(_0x3e3d30[_0x2ba6('0x78')]&&_0x3e3d30[_0x2ba6('0x78')][_0x2ba6('0x4a')]){_0x3c2348['push'](insertCmContact(_0x3e3d30[_0x2ba6('0x30')],_0x2f0de6,_0x3e3d30['duplicates'],_0x35928e));_0x3c2348['push'](_0x2ba6('0x81')+_0x2f0de6+';');}if(hasTZ){_0x3c2348[_0x2ba6('0x42')](insertTzCmHopper(_0x3e3d30['ListId'],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x549c06,tmp_voice_queues));_0x3c2348[_0x2ba6('0x42')](insertTzCmHopperBlack(_0x3e3d30['ListId'],_0x2ba6('0x82'),_0x2ba6('0x4d'),_0x2ba6('0x83')));_0x3c2348[_0x2ba6('0x42')](insertTzCmHopper(_0x3e3d30[_0x2ba6('0x30')],'campaigns_has_cm_lists',_0x2ba6('0x47'),_0x2ba6('0x84'),_0x549c06,tmp_campaigns));_0x3c2348[_0x2ba6('0x42')](insertTzCmHopperBlack(_0x3e3d30[_0x2ba6('0x30')],'campaigns_has_cm_blacklists',_0x2ba6('0x47'),'CampaignId'));}else{_0x3c2348[_0x2ba6('0x42')](insertCmHopper(_0x3e3d30[_0x2ba6('0x30')],_0x2ba6('0x4e'),_0x2ba6('0x4d'),'VoiceQueueId',_0x549c06));_0x3c2348[_0x2ba6('0x42')](insertCmHopperBlack(_0x3e3d30[_0x2ba6('0x30')],'voice_queues_has_cm_blacklists',_0x2ba6('0x4d'),_0x2ba6('0x83')));_0x3c2348[_0x2ba6('0x42')](insertCmHopper(_0x3e3d30['ListId'],'campaigns_has_cm_lists',_0x2ba6('0x47'),'CampaignId',_0x549c06));_0x3c2348[_0x2ba6('0x42')](insertCmHopperBlack(_0x3e3d30[_0x2ba6('0x30')],'campaigns_has_cm_blacklists',_0x2ba6('0x47'),_0x2ba6('0x84')));}_0x3c2348[_0x2ba6('0x42')](_0x2ba6('0x81')+tmp_campaigns+';');_0x3c2348['push'](_0x2ba6('0x81')+tmp_voice_queues+';');BPromise['each'](_0x3c2348,handleQuery)[_0x2ba6('0x51')](function(_0x48c7f4){stats[_0x2ba6('0x85')]=!![];stats[_0x2ba6('0x86')]=_0x3e3d30['duplicates']&&_0x3e3d30[_0x2ba6('0x78')][_0x2ba6('0x4a')]?results[0x2][_0x2ba6('0x86')]:results[0x0][_0x2ba6('0x86')];socket['emit'](_0x2ba6('0x73')+_0x30f307,stats);fs[_0x2ba6('0x87')](_0x122eeb);fs[_0x2ba6('0x87')](_0x100361);process[_0x2ba6('0x88')](0x0);})[_0x2ba6('0x46')](function(_0x3095d7){logger['error'](_0x3095d7[_0x2ba6('0x40')]);process['exit'](0x1);});});});});}catch(_0x2b1c4f){logger['error'](_0x2ba6('0x89'),_0x2b1c4f[_0x2ba6('0x40')]);process[_0x2ba6('0x88')](0x1);}},'error':function(_0x3952a5,_0x2613d0,_0x5dae08,_0xd95673){throw new Error(_0xd95673);}});}function validate(){if(process[_0x2ba6('0x8a')]&&process['argv'][_0x2ba6('0x4a')]<0x4){throw new Error(_0x2ba6('0x8b'));}var _0x1c1047=path[_0x2ba6('0x12')](config[_0x2ba6('0x5b')],_0x2ba6('0x5c'),process[_0x2ba6('0x8a')][0x2]);if(!fs[_0x2ba6('0x8c')](_0x1c1047)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5a8c82={};try{_0x5a8c82=JSON[_0x2ba6('0x63')](process[_0x2ba6('0x8a')][0x3]);if(!_0x5a8c82[_0x2ba6('0x8d')]){throw new Error(_0x2ba6('0x8e'));}if(!_0x5a8c82[_0x2ba6('0x8d')][_0x2ba6('0x10')]){throw new Error(_0x2ba6('0x8f'));}if(!_0x5a8c82[_0x2ba6('0x8d')][_0x2ba6('0x90')]){throw new Error('firstName\x20is\x20mandatory');}var _0x23dad3=0x0;if(_0x5a8c82['binding'][_0x2ba6('0x21')]){_0x23dad3=0x1;}if(!_0x5a8c82[_0x2ba6('0x30')]){throw new Error(_0x2ba6('0x91'));}}catch(_0x58cc39){throw new Error(_0x2ba6('0x92'));}var _0x4e47e0=[];try{_0x4e47e0=_['map'](JSON[_0x2ba6('0x63')](process[_0x2ba6('0x8a')][0x4]),'id');}catch(_0x3723d0){logger['info'](_0x2ba6('0x93'));}main(_0x1c1047,_0x5a8c82,_0x4e47e0,_0x23dad3);}validate();process['on'](_0x2ba6('0x94'),handleStop);process['on'](_0x2ba6('0x95'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 9c9ba93..a68678c 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 _0x2a07=['agentcalledAt','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','starttime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date'];(function(_0x1e7b9f,_0x2f2bbe){var _0x53f9a9=function(_0x3a7fd8){while(--_0x3a7fd8){_0x1e7b9f['push'](_0x1e7b9f['shift']());}};_0x53f9a9(++_0x2f2bbe);}(_0x2a07,0x171));var _0x72a0=function(_0x3d3817,_0x5d0b91){_0x3d3817=_0x3d3817-0x0;var _0x4f23ce=_0x2a07[_0x3d3817];return _0x4f23ce;};'use strict';exports[_0x72a0('0x0')]=function(_0x48a71f,_0x2d8fc5){var _0x3799c2=[{'type':_0x72a0('0x1'),'content':_0x72a0('0x2'),'variableName':null}];switch(_0x48a71f['toLowerCase']()){case _0x72a0('0x3'):switch(_0x2d8fc5[_0x72a0('0x4')]()){case _0x72a0('0x5'):_0x3799c2['push']({'type':'variable','content':'','variableName':'queue'});_0x3799c2['push']({'type':_0x72a0('0x6'),'content':'','variableName':_0x72a0('0x7')});break;case _0x72a0('0x8'):_0x3799c2['push']({'type':_0x72a0('0x1'),'content':_0x72a0('0x9'),'variableName':null});_0x3799c2['push']({'type':_0x72a0('0x6'),'content':'','variableName':_0x72a0('0xa')});break;}}return _0x3799c2;};exports['getDescriptions']=function(_0x567d55,_0x13fa81){var _0x40049c=[];switch(_0x567d55['toLowerCase']()){case _0x72a0('0x3'):switch(_0x13fa81[_0x72a0('0x4')]()){case _0x72a0('0x5'):_0x40049c=[{'type':_0x72a0('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x7')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0xc'),'keyType':_0x72a0('0x6'),'variableName':_0x72a0('0xd')},{'type':'keyValue','content':'','key':_0x72a0('0xe'),'keyType':_0x72a0('0x6'),'variableName':_0x72a0('0xf')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x10'),'keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x11')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x12'),'keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x13')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x14'),'keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x16')},{'type':_0x72a0('0xb'),'content':'','key':'Agent\x20Number','keyType':_0x72a0('0x6'),'variableName':_0x72a0('0xa')},{'type':_0x72a0('0x1'),'content':_0x72a0('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x18'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x19')},{'type':'keyValue','content':'','key':_0x72a0('0x1a'),'keyType':_0x72a0('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0x72a0('0x1b'),'keyType':_0x72a0('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x72a0('0x6'),'variableName':_0x72a0('0x1c')}];break;case _0x72a0('0x8'):_0x40049c=[{'type':_0x72a0('0x1'),'content':_0x72a0('0x1d'),'variableName':null},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x72a0('0xa')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x1f'),'keyType':_0x72a0('0x6'),'keyContent':'','variableName':_0x72a0('0x20')},{'type':_0x72a0('0xb'),'content':'','key':'UniqueId','keyType':_0x72a0('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x14'),'keyType':_0x72a0('0x6'),'keyContent':'','variableName':_0x72a0('0x21')},{'type':'string','content':_0x72a0('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x72a0('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x72a0('0x22'),'keyType':_0x72a0('0x6'),'keyContent':'','variableName':_0x72a0('0x23')},{'type':_0x72a0('0xb'),'content':'','key':_0x72a0('0x24'),'keyType':_0x72a0('0x6'),'keyContent':'','variableName':_0x72a0('0x25')},{'type':_0x72a0('0xb'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x72a0('0x26')}];break;}}return _0x40049c;}; \ No newline at end of file +var _0xba13=['destexten','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Date','starttime','answertime','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0xba13,0x128));var _0x3ba1=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xba13[_0x5c3ae9];return _0x3f5950;};'use strict';exports[_0x3ba1('0x0')]=function(_0x3f44c2,_0x3ec414){var _0x423708=[{'type':_0x3ba1('0x1'),'content':_0x3ba1('0x2'),'variableName':null}];switch(_0x3f44c2['toLowerCase']()){case'voice':switch(_0x3ec414[_0x3ba1('0x3')]()){case _0x3ba1('0x4'):_0x423708[_0x3ba1('0x5')]({'type':_0x3ba1('0x6'),'content':'','variableName':_0x3ba1('0x7')});_0x423708[_0x3ba1('0x5')]({'type':_0x3ba1('0x6'),'content':'','variableName':_0x3ba1('0x8')});break;case _0x3ba1('0x9'):_0x423708[_0x3ba1('0x5')]({'type':'string','content':_0x3ba1('0xa'),'variableName':null});_0x423708['push']({'type':_0x3ba1('0x6'),'content':'','variableName':_0x3ba1('0xb')});break;}}return _0x423708;};exports[_0x3ba1('0xc')]=function(_0x608e6f,_0x54a92f){var _0x5de3a4=[];switch(_0x608e6f[_0x3ba1('0x3')]()){case _0x3ba1('0xd'):switch(_0x54a92f['toLowerCase']()){case'inbound':_0x5de3a4=[{'type':_0x3ba1('0x1'),'content':_0x3ba1('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x3ba1('0xf'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x3ba1('0x8')},{'type':'keyValue','content':'','key':_0x3ba1('0x10'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x11')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x12'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x13')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x14'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x7')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x15'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x16')},{'type':_0x3ba1('0xf'),'content':'','key':'Date','keyType':_0x3ba1('0x6'),'variableName':'agentcalledAt'},{'type':_0x3ba1('0x1'),'content':_0x3ba1('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x18'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x19')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x1a'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x3ba1('0x1'),'content':_0x3ba1('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x1c'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x1d')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x1e'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x1f')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x20'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x21')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x22'),'keyType':_0x3ba1('0x6'),'variableName':_0x3ba1('0x23')},{'type':_0x3ba1('0xf'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x3ba1('0x24')}];break;case _0x3ba1('0x9'):_0x5de3a4=[{'type':_0x3ba1('0x1'),'content':_0x3ba1('0xe'),'variableName':null},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x25'),'keyType':'variable','keyContent':'','variableName':_0x3ba1('0xb')},{'type':_0x3ba1('0xf'),'content':'','key':'Member\x20Name','keyType':_0x3ba1('0x6'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x3ba1('0x15'),'keyType':_0x3ba1('0x6'),'keyContent':'','variableName':_0x3ba1('0x16')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x26'),'keyType':_0x3ba1('0x6'),'keyContent':'','variableName':_0x3ba1('0x27')},{'type':'string','content':_0x3ba1('0x1b')},{'type':_0x3ba1('0xf'),'content':'','key':'Answer\x20Time','keyType':_0x3ba1('0x6'),'keyContent':'','variableName':_0x3ba1('0x28')},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x29'),'keyType':_0x3ba1('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x2a'),'keyType':_0x3ba1('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x3ba1('0xf'),'content':'','key':_0x3ba1('0x2b'),'keyType':'variable','keyContent':'','variableName':_0x3ba1('0x2c')}];break;}}return _0x5de3a4;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 85b8ba6..30144e6 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 _0xd8d2=['name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','omit','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xd8d2,0x103));var _0x2d8d=function(_0x5b95ec,_0x16e0d0){_0x5b95ec=_0x5b95ec-0x0;var _0x2af647=_0xd8d2[_0x5b95ec];return _0x2af647;};'use strict';var _=require(_0x2d8d('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x2d8d('0x1'))(_0x2d8d('0x2')),'mail':require('../../config/logger')(_0x2d8d('0x3')),'fax':require(_0x2d8d('0x1'))(_0x2d8d('0x4')),'sms':require('../../config/logger')(_0x2d8d('0x5')),'chat':require(_0x2d8d('0x1'))(_0x2d8d('0x6')),'whatsapp':require(_0x2d8d('0x1'))(_0x2d8d('0x7'))};function getInteractionId(_0x3c0845,_0xd36277,_0x1cd20b){if(_0x3c0845&&_0x3c0845[_[_0x2d8d('0x8')](_0x1cd20b)+_0x2d8d('0x9')]){return _0x3c0845[_['upperFirst'](_0x1cd20b)+_0x2d8d('0x9')];}else if(_0x3c0845&&_0x3c0845['id']){return _0x3c0845['id'];}else if(_0xd36277&&_0xd36277['id']){return _0xd36277['id'];}else{return'unknown';}}function log(_0x1f0bf9,_0x5e4387,_0xb829aa,_0x78c095,_0xbad4f1,_0x4d21e2){loggers[_0xbad4f1['toLowerCase']()][_0x1f0bf9](_0x2d8d('0xa'),_0x4d21e2['toUpperCase'](),_0x5e4387?_0x5e4387['id']:null,_0x5e4387?_0x5e4387[_0x2d8d('0xb')]:null,_0x5e4387?_0x5e4387[_0x2d8d('0xc')]:null,getInteractionId(_0xb829aa,_0x78c095,_0xbad4f1),_0xb829aa?JSON[_0x2d8d('0xd')](_0xb829aa):_0x2d8d('0xe'));}function updateUser(_0x494413,_0x320474,_0x400ddb,_0x217372,_0x30829e){db[_['upperFirst'](_0x217372)+_0x2d8d('0xf')][_0x2d8d('0x10')]({'where':{'id':getInteractionId(_0x320474,_0x400ddb,_0x217372)}})[_0x2d8d('0x11')](function(_0x241971){if(_0x241971){return _0x241971[_0x2d8d('0x12')]({'UserId':_0x494413?_0x494413['id']:null});}})[_0x2d8d('0x11')](function(_0x504319){if(_0x504319){log(_0x2d8d('0x13'),_0x494413,_0x320474,_0x400ddb,_0x217372,_0x30829e);}})[_0x2d8d('0x14')](function(){log(_0x2d8d('0x15'),_0x494413,_0x320474,_0x400ddb,_0x217372,_0x30829e);});}exports['tracked']=function(_0x1ee735,_0x44c9ed){return function(_0x4d2900,_0x4ab286,_0x316a35){var _0x14f813=_0x4d2900[_0x2d8d('0x16')];var _0x30e98f={};var _0x95b5a4=_0x4d2900[_0x2d8d('0x17')];if(_0x30e98f){_0x30e98f=_[_0x2d8d('0x18')](_0x4d2900[_0x2d8d('0x19')]);_0x30e98f=_[_0x2d8d('0x1a')](_0x30e98f,['body','html',_0x2d8d('0x1b'),_0x2d8d('0x1c'),_0x2d8d('0x1d')]);}updateUser(_0x14f813,_0x30e98f,_0x95b5a4,_0x1ee735,_0x44c9ed);_0x316a35(null);};}; \ No newline at end of file +var _0xe343=['../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','phone','fax','lodash','../../mysqldb'];(function(_0x1a12c8,_0x2df4dc){var _0x305109=function(_0x438bfb){while(--_0x438bfb){_0x1a12c8['push'](_0x1a12c8['shift']());}};_0x305109(++_0x2df4dc);}(_0xe343,0x6e));var _0x3e34=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0xe343[_0x68c4d9];return _0x62da93;};'use strict';var _=require(_0x3e34('0x0'));var db=require(_0x3e34('0x1'))['db'];var loggers={'openchannel':require(_0x3e34('0x2'))('openchannel-interactions'),'mail':require(_0x3e34('0x2'))(_0x3e34('0x3')),'fax':require(_0x3e34('0x2'))('fax-interactions'),'sms':require('../../config/logger')(_0x3e34('0x4')),'chat':require(_0x3e34('0x2'))(_0x3e34('0x5')),'whatsapp':require(_0x3e34('0x2'))(_0x3e34('0x6'))};function getInteractionId(_0x3260b4,_0x4a39ce,_0x110f98){if(_0x3260b4&&_0x3260b4[_[_0x3e34('0x7')](_0x110f98)+_0x3e34('0x8')]){return _0x3260b4[_['upperFirst'](_0x110f98)+_0x3e34('0x8')];}else if(_0x3260b4&&_0x3260b4['id']){return _0x3260b4['id'];}else if(_0x4a39ce&&_0x4a39ce['id']){return _0x4a39ce['id'];}else{return _0x3e34('0x9');}}function log(_0x142885,_0x2adf40,_0x100466,_0x5b7ee3,_0x3128c2,_0x3ffb4b){loggers[_0x3128c2['toLowerCase']()][_0x142885](_0x3e34('0xa'),_0x3ffb4b[_0x3e34('0xb')](),_0x2adf40?_0x2adf40['id']:null,_0x2adf40?_0x2adf40['name']:null,_0x2adf40?_0x2adf40[_0x3e34('0xc')]:null,getInteractionId(_0x100466,_0x5b7ee3,_0x3128c2),_0x100466?JSON[_0x3e34('0xd')](_0x100466):'null');}function updateUser(_0x2eac63,_0x4a7861,_0x4a94d6,_0x462bff,_0x3c2a1c){db[_[_0x3e34('0x7')](_0x462bff)+_0x3e34('0xe')][_0x3e34('0xf')]({'where':{'id':getInteractionId(_0x4a7861,_0x4a94d6,_0x462bff)}})[_0x3e34('0x10')](function(_0x26ae00){if(_0x26ae00){return _0x26ae00[_0x3e34('0x11')]({'UserId':_0x2eac63?_0x2eac63['id']:null});}})[_0x3e34('0x10')](function(_0x3b0cd8){if(_0x3b0cd8){log(_0x3e34('0x12'),_0x2eac63,_0x4a7861,_0x4a94d6,_0x462bff,_0x3c2a1c);}})[_0x3e34('0x13')](function(){log(_0x3e34('0x14'),_0x2eac63,_0x4a7861,_0x4a94d6,_0x462bff,_0x3c2a1c);});}exports[_0x3e34('0x15')]=function(_0x4a23df,_0x466eb6){return function(_0x5aa5d1,_0x27e2a0,_0x272da3){var _0x1d2277=_0x5aa5d1[_0x3e34('0x16')];var _0x472992={};var _0x5a5467=_0x5aa5d1[_0x3e34('0x17')];if(_0x472992){_0x472992=_[_0x3e34('0x18')](_0x5aa5d1[_0x3e34('0x19')]);_0x472992=_['omit'](_0x472992,[_0x3e34('0x19'),'html',_0x3e34('0x1a'),_0x3e34('0x1b'),'mobile']);}updateUser(_0x1d2277,_0x472992,_0x5a5467,_0x4a23df,_0x466eb6);_0x272da3(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d4cdc20..0451678 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 _0x7dfa=['isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x7dfa,0x1ee));var _0xa7df=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x7dfa[_0x309d93];return _0x2dd61d;};'use strict';var crypto=require(_0xa7df('0x0'));var util=require(_0xa7df('0x1'));var compose=require(_0xa7df('0x2'));var db=require(_0xa7df('0x3'))['db'];var config=require(_0xa7df('0x4'));function getValueFromLicense(_0x26b736,_0x1a79f4){if(_0x26b736&&_0x1a79f4){if(_0x1a79f4[_0xa7df('0x5')]&&_0x1a79f4[_0xa7df('0x6')]){var _0x45daa7=_0x1a79f4[_0xa7df('0x5')];var _0x31d0c2=_0x1a79f4[_0xa7df('0x6')];var _0x1ef56e=_0x45daa7[_0xa7df('0x7')]('-')[0x4];var _0x14bb0f=_0x45daa7[_0xa7df('0x7')]('-')[0x0];var _0x2babbd=crypto[_0xa7df('0x8')](_0xa7df('0x9'),util[_0xa7df('0xa')](_0xa7df('0xb'),_0x1ef56e,_0x45daa7,_0x14bb0f));var _0x57e581=_0x2babbd[_0xa7df('0xc')](_0x31d0c2,_0xa7df('0xd'),_0xa7df('0xe'));_0x57e581+=_0x2babbd[_0xa7df('0xf')]('utf8');var _0x26f2f3=JSON[_0xa7df('0x10')](_0x57e581);return _0x26f2f3[_0xa7df('0x11')](_0x26b736)?_0x26f2f3[_0x26b736]:null;}}return null;}function isLimit(_0x35defd,_0x3984f5,_0x7741c3,_0x32a03e){var _0x1c2cd8=_0x3984f5;return compose()['use'](function(_0x4ed151,_0x30741b,_0x3fdaca){return db[_0xa7df('0x12')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x317ec2){var _0x5dcc07=getValueFromLicense(_0x35defd,_0x317ec2);return _0x5dcc07?_0x5dcc07:_0x1c2cd8;})[_0xa7df('0x13')](function(_0x5d32ac){_0x1c2cd8=_0x5d32ac;return _0x7741c3[_0xa7df('0x14')](_0x32a03e);})['then'](function(_0x4c8358){if(_0x4c8358>=_0x1c2cd8){return _0x30741b[_0xa7df('0x15')](0x193)[_0xa7df('0x16')]({'message':util['format'](_0xa7df('0x17'),_0x35defd)});}_0x3fdaca();})['catch'](function(_0x304aff){_0x3fdaca(_0x304aff);});});}function isUserLimit(){return isLimit(_0xa7df('0x18'),0x1,db[_0xa7df('0x19')],{'where':{'$or':[{'role':_0xa7df('0x1a')},{'role':_0xa7df('0x1b')}]}});}exports[_0xa7df('0x1c')]=isUserLimit; \ No newline at end of file +var _0x3cd2=['aes-256-ctr','format','update','base64','utf8','final','hasOwnProperty','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','split','createDecipher'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x3cd2,0x101));var _0x23cd=function(_0x522233,_0x164305){_0x522233=_0x522233-0x0;var _0x119914=_0x3cd2[_0x522233];return _0x119914;};'use strict';var crypto=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var compose=require('composable-middleware');var db=require(_0x23cd('0x2'))['db'];var config=require(_0x23cd('0x3'));function getValueFromLicense(_0x45f119,_0x40f732){if(_0x45f119&&_0x40f732){if(_0x40f732[_0x23cd('0x4')]&&_0x40f732['license']){var _0x2fdc82=_0x40f732[_0x23cd('0x4')];var _0x301042=_0x40f732['license'];var _0x519d95=_0x2fdc82[_0x23cd('0x5')]('-')[0x4];var _0x3e08a3=_0x2fdc82['split']('-')[0x0];var _0x155768=crypto[_0x23cd('0x6')](_0x23cd('0x7'),util[_0x23cd('0x8')]('%s:%s:%s',_0x519d95,_0x2fdc82,_0x3e08a3));var _0x5d9018=_0x155768[_0x23cd('0x9')](_0x301042,_0x23cd('0xa'),_0x23cd('0xb'));_0x5d9018+=_0x155768[_0x23cd('0xc')](_0x23cd('0xb'));var _0x2238fc=JSON['parse'](_0x5d9018);return _0x2238fc[_0x23cd('0xd')](_0x45f119)?_0x2238fc[_0x45f119]:null;}}return null;}function isLimit(_0x27ad75,_0x2dee9b,_0x4d5d3e,_0x41b45a){var _0x365edd=_0x2dee9b;return compose()['use'](function(_0x8eec86,_0x2bc789,_0x42c4bc){return db['License'][_0x23cd('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x23cd('0xf')](function(_0x314d3f){var _0x415586=getValueFromLicense(_0x27ad75,_0x314d3f);return _0x415586?_0x415586:_0x365edd;})[_0x23cd('0xf')](function(_0xe38722){_0x365edd=_0xe38722;return _0x4d5d3e['count'](_0x41b45a);})[_0x23cd('0xf')](function(_0x14cd8c){if(_0x14cd8c>=_0x365edd){return _0x2bc789['status'](0x193)[_0x23cd('0x10')]({'message':util['format'](_0x23cd('0x11'),_0x27ad75)});}_0x42c4bc();})[_0x23cd('0x12')](function(_0x4b854f){_0x42c4bc(_0x4b854f);});});}function isUserLimit(){return isLimit(_0x23cd('0x13'),0x1,db[_0x23cd('0x14')],{'where':{'$or':[{'role':_0x23cd('0x15')},{'role':_0x23cd('0x16')}]}});}exports[_0x23cd('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 5be07a5..2f5ea3f 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 _0x05bc=['$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','filter','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','CAST(','field','\x20AS\x20','castTo','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte'];(function(_0x38a136,_0x174636){var _0x1a0f58=function(_0x552c20){while(--_0x552c20){_0x38a136['push'](_0x38a136['shift']());}};_0x1a0f58(++_0x174636);}(_0x05bc,0xb2));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc05b('0x0'));var moment=require(_0xc05b('0x1'));exports[_0xc05b('0x2')]=function(_0x3f5827){var _0x3aa02e={'conditions':[]};_0x3aa02e[_0xc05b('0x3')]=_[_0xc05b('0x4')](_0x3f5827,_0xc05b('0x5'))?'or':_0xc05b('0x6');var _0x5a616e=_0x3f5827[_0xc05b('0x7')](_0xc05b('0x8'),'')[_0xc05b('0x7')](_0xc05b('0x5'),'')[_0xc05b('0x9')]('||');for(var _0x3fafcd=0x0;_0x3fafcd<_0x5a616e[_0xc05b('0xa')];_0x3fafcd++){var _0x57a303=_0x5a616e[_0x3fafcd][_0xc05b('0x9')](':=');var _0x185d68=_0x57a303[0x0];var _0x71282d=_0x57a303[_0xc05b('0xb')](0x1);_0x71282d[_0xc05b('0xc')](function(_0x545864){var _0x1a17f0=_0x545864[_0xc05b('0x9')]('[')[_0xc05b('0xd')]();var _0x19f24b=_0x545864['match'](/\[(.*?)\]/g);_0x19f24b[_0xc05b('0xc')](function(_0xb97618){var _0x434906=_0xb97618[_0xc05b('0x9')]('[')[_0xc05b('0xe')](function(_0x3b2432){return _0x3b2432['indexOf'](']')>-0x1;})[_0xc05b('0xf')](function(_0x25fdad){return _0x25fdad[_0xc05b('0x9')](']')[0x0];})[0x0];_0x3aa02e[_0xc05b('0x10')][_0xc05b('0x11')]({'field':_0x185d68,'operator':_0x1a17f0,'value':_0x434906});});});}return _0x3aa02e;};exports[_0xc05b('0x12')]=function(_0x4fc77d,_0x4cc970,_0x34bd0c){var _0x398365={};if(_0x4cc970===_0xc05b('0x13')){if(_0x34bd0c[_0xc05b('0x14')]===_0xc05b('0x15')){_0x34bd0c[_0xc05b('0x14')]='$between';_0x34bd0c['value']+=','+_0x34bd0c[_0xc05b('0x16')];}else if(_[_0xc05b('0x17')]([_0xc05b('0x18'),_0xc05b('0x19')],_0x34bd0c[_0xc05b('0x14')])){_0x34bd0c[_0xc05b('0x16')]=moment(_0x34bd0c[_0xc05b('0x16')])[_0xc05b('0x1a')](0x1,_0xc05b('0x1b'))[_0xc05b('0x1c')](_0xc05b('0x1d'));}}if(_0x34bd0c['castTo']){_0x4cc970=_0x34bd0c['castTo'];_0x398365['text']=_0xc05b('0x1e')+_0x4fc77d+'.'+_0x34bd0c[_0xc05b('0x1f')]+_0xc05b('0x20')+_0x34bd0c[_0xc05b('0x21')]+')\x20'+parseOperator(_0x34bd0c[_0xc05b('0x14')]);}else{_0x398365[_0xc05b('0x22')]=_0x4fc77d+'.'+_0x34bd0c[_0xc05b('0x1f')]+'\x20'+parseOperator(_0x34bd0c[_0xc05b('0x14')]);}if(_[_0xc05b('0x17')]([_0xc05b('0x23'),_0xc05b('0x24')],_0x34bd0c[_0xc05b('0x14')]))_0x398365[_0xc05b('0x22')]='('+_0x398365[_0xc05b('0x22')]+_0xc05b('0x25')+_0x4fc77d+'.'+_0x34bd0c[_0xc05b('0x1f')]+_0xc05b('0x26');_0x398365[_0xc05b('0x16')]=parseValue(_0x4cc970,_0x34bd0c[_0xc05b('0x14')],_0x34bd0c[_0xc05b('0x16')]);return _0x398365;};function parseOperator(_0x467a9d){var _0x50fa12;switch(_0x467a9d){case _0xc05b('0x27'):_0x50fa12='IN\x20?';break;case _0xc05b('0x24'):_0x50fa12=_0xc05b('0x28');break;case _0xc05b('0x15'):_0x50fa12=_0xc05b('0x29');break;case'$ne':_0x50fa12='<>\x20?';break;case _0xc05b('0x2a'):case _0xc05b('0x2b'):case _0xc05b('0x2c'):_0x50fa12='LIKE\x20?';break;case _0xc05b('0x2d'):_0x50fa12=_0xc05b('0x2e');break;case _0xc05b('0x18'):_0x50fa12=_0xc05b('0x2f');break;case _0xc05b('0x19'):_0x50fa12=_0xc05b('0x30');break;case _0xc05b('0x31'):_0x50fa12='>=\x20?';break;case _0xc05b('0x32'):_0x50fa12=_0xc05b('0x33');break;}return _0x50fa12;}function parseValue(_0x1b6d58,_0x50ca02,_0x35a385){var _0x3acd2c={'start':undefined,'end':undefined};switch(_0x50ca02){case _0xc05b('0x27'):case _0xc05b('0x24'):_0x3acd2c['start']=_0x35a385[_0xc05b('0x9')](',');break;case _0xc05b('0x2a'):_0x3acd2c[_0xc05b('0x34')]='%'+_0x35a385+'%';break;case _0xc05b('0x2b'):_0x3acd2c[_0xc05b('0x34')]=_0x35a385+'%';break;case _0xc05b('0x2c'):_0x3acd2c[_0xc05b('0x34')]='%'+_0x35a385;break;case _0xc05b('0x32'):var _0x4198e3=_0x35a385[_0xc05b('0x9')](',');var _0x35a385=_0x4198e3['shift']();var _0x391df0=_0x4198e3[_0xc05b('0x35')]();if(_0x1b6d58===_0xc05b('0x13')){_0x35a385=moment(_0x35a385)[_0xc05b('0x36')](0x0,!![])[_0xc05b('0x1c')]();_0x391df0=moment(_0x391df0)[_0xc05b('0x36')](0x0,!![])[_0xc05b('0x1a')](0x17,'hours')['add'](0x3b,_0xc05b('0x37'))['add'](0x3b,_0xc05b('0x38'))[_0xc05b('0x1c')]();}_0x3acd2c={'start':_0x35a385,'end':_0x391df0};break;default:_0x3acd2c['start']=_0x35a385;break;}return _0x3acd2c;} \ No newline at end of file +var _0xc9ba=['conditions','DATE','operator','$eq','value','includes','$lte','add','days','text','\x20AS\x20','castTo','$ne','$notIn','\x20OR\x20','field','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','hours','minutes','seconds','format','lodash','moment','parseSearch','startsWith','[$or]','replace','[$and]','split','length','slice','match','forEach','filter','indexOf'];(function(_0xc339a4,_0x2ad57c){var _0x1fbb74=function(_0x183a6c){while(--_0x183a6c){_0xc339a4['push'](_0xc339a4['shift']());}};_0x1fbb74(++_0x2ad57c);}(_0xc9ba,0xce));var _0xac9b=function(_0x531b74,_0x3a473b){_0x531b74=_0x531b74-0x0;var _0x513d17=_0xc9ba[_0x531b74];return _0x513d17;};'use strict';var _=require(_0xac9b('0x0'));var moment=require(_0xac9b('0x1'));exports[_0xac9b('0x2')]=function(_0x37de4a){var _0x47baa5={'conditions':[]};_0x47baa5['sqlOperator']=_[_0xac9b('0x3')](_0x37de4a,_0xac9b('0x4'))?'or':'and';var _0x361171=_0x37de4a[_0xac9b('0x5')](_0xac9b('0x6'),'')[_0xac9b('0x5')](_0xac9b('0x4'),'')[_0xac9b('0x7')]('||');for(var _0x112828=0x0;_0x112828<_0x361171[_0xac9b('0x8')];_0x112828++){var _0x249af5=_0x361171[_0x112828]['split'](':=');var _0x3c33de=_0x249af5[0x0];var _0x491793=_0x249af5[_0xac9b('0x9')](0x1);_0x491793['forEach'](function(_0x288a0c){var _0x5d7d79=_0x288a0c[_0xac9b('0x7')]('[')['shift']();var _0x3d9210=_0x288a0c[_0xac9b('0xa')](/\[(.*?)\]/g);_0x3d9210[_0xac9b('0xb')](function(_0x42cf7b){var _0x48ed1a=_0x42cf7b[_0xac9b('0x7')]('[')[_0xac9b('0xc')](function(_0x57f882){return _0x57f882[_0xac9b('0xd')](']')>-0x1;})['map'](function(_0x4b4225){return _0x4b4225['split'](']')[0x0];})[0x0];_0x47baa5[_0xac9b('0xe')]['push']({'field':_0x3c33de,'operator':_0x5d7d79,'value':_0x48ed1a});});});}return _0x47baa5;};exports['buildExpression']=function(_0x1805e9,_0x3a9cd3,_0x48b9ce){var _0x1507ab={};if(_0x3a9cd3===_0xac9b('0xf')){if(_0x48b9ce[_0xac9b('0x10')]===_0xac9b('0x11')){_0x48b9ce[_0xac9b('0x10')]='$between';_0x48b9ce[_0xac9b('0x12')]+=','+_0x48b9ce['value'];}else if(_[_0xac9b('0x13')](['$gt',_0xac9b('0x14')],_0x48b9ce[_0xac9b('0x10')])){_0x48b9ce['value']=moment(_0x48b9ce[_0xac9b('0x12')])[_0xac9b('0x15')](0x1,_0xac9b('0x16'))['format']('YYYY-MM-DD');}}if(_0x48b9ce['castTo']){_0x3a9cd3=_0x48b9ce['castTo'];_0x1507ab[_0xac9b('0x17')]='CAST('+_0x1805e9+'.'+_0x48b9ce['field']+_0xac9b('0x18')+_0x48b9ce[_0xac9b('0x19')]+')\x20'+parseOperator(_0x48b9ce[_0xac9b('0x10')]);}else{_0x1507ab[_0xac9b('0x17')]=_0x1805e9+'.'+_0x48b9ce['field']+'\x20'+parseOperator(_0x48b9ce[_0xac9b('0x10')]);}if(_['includes']([_0xac9b('0x1a'),_0xac9b('0x1b')],_0x48b9ce[_0xac9b('0x10')]))_0x1507ab[_0xac9b('0x17')]='('+_0x1507ab[_0xac9b('0x17')]+_0xac9b('0x1c')+_0x1805e9+'.'+_0x48b9ce[_0xac9b('0x1d')]+'\x20IS\x20NULL)';_0x1507ab['value']=parseValue(_0x3a9cd3,_0x48b9ce[_0xac9b('0x10')],_0x48b9ce['value']);return _0x1507ab;};function parseOperator(_0x6e3d8d){var _0x2cda4c;switch(_0x6e3d8d){case _0xac9b('0x1e'):_0x2cda4c=_0xac9b('0x1f');break;case _0xac9b('0x1b'):_0x2cda4c=_0xac9b('0x20');break;case _0xac9b('0x11'):_0x2cda4c=_0xac9b('0x21');break;case _0xac9b('0x1a'):_0x2cda4c='<>\x20?';break;case _0xac9b('0x22'):case _0xac9b('0x23'):case _0xac9b('0x24'):_0x2cda4c=_0xac9b('0x25');break;case _0xac9b('0x26'):_0x2cda4c=_0xac9b('0x27');break;case _0xac9b('0x28'):_0x2cda4c=_0xac9b('0x29');break;case'$lte':_0x2cda4c=_0xac9b('0x2a');break;case _0xac9b('0x2b'):_0x2cda4c=_0xac9b('0x2c');break;case _0xac9b('0x2d'):_0x2cda4c=_0xac9b('0x2e');break;}return _0x2cda4c;}function parseValue(_0x2f375c,_0x1d7dfa,_0x1163c2){var _0x594998={'start':undefined,'end':undefined};switch(_0x1d7dfa){case'$in':case _0xac9b('0x1b'):_0x594998[_0xac9b('0x2f')]=_0x1163c2['split'](',');break;case _0xac9b('0x22'):_0x594998['start']='%'+_0x1163c2+'%';break;case _0xac9b('0x23'):_0x594998['start']=_0x1163c2+'%';break;case'$endsWith':_0x594998[_0xac9b('0x2f')]='%'+_0x1163c2;break;case _0xac9b('0x2d'):var _0x4d59ea=_0x1163c2[_0xac9b('0x7')](',');var _0x1163c2=_0x4d59ea[_0xac9b('0x30')]();var _0x426b26=_0x4d59ea[_0xac9b('0x31')]();if(_0x2f375c==='DATE'){_0x1163c2=moment(_0x1163c2)[_0xac9b('0x32')](0x0,!![])['format']();_0x426b26=moment(_0x426b26)['utcOffset'](0x0,!![])['add'](0x17,_0xac9b('0x33'))[_0xac9b('0x15')](0x3b,_0xac9b('0x34'))[_0xac9b('0x15')](0x3b,_0xac9b('0x35'))[_0xac9b('0x36')]();}_0x594998={'start':_0x1163c2,'end':_0x426b26};break;default:_0x594998[_0xac9b('0x2f')]=_0x1163c2;break;}return _0x594998;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 7a5d50b..be8d864 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 _0x277c=['DATE','$gte','YYYY-MM-DD','utc','format','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','isEmpty','length','omit','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','$id','query','model','attributes','nolimit','pick','filter','object','columns','type','VIRTUAL','where','lower','merge','options','lodash','moment','parse','keys','includes','fields','split','filters','find'];(function(_0x298f8c,_0x21cf71){var _0x468f84=function(_0x30202a){while(--_0x30202a){_0x298f8c['push'](_0x298f8c['shift']());}};_0x468f84(++_0x21cf71);}(_0x277c,0x153));var _0xc277=function(_0x4005f4,_0x39c22e){_0x4005f4=_0x4005f4-0x0;var _0x1af721=_0x277c[_0x4005f4];return _0x1af721;};'use strict';var _=require(_0xc277('0x0'));var sequelize=require('sequelize');var moment=require(_0xc277('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3420cf){var _0x3cd265=['ne'];try{var _0x21d6f2=JSON[_0xc277('0x2')](_0x3420cf);var _0x1fcae3=Object[_0xc277('0x3')](_0x21d6f2)[0x0];return _0x3cd265[_0xc277('0x4')](_0x1fcae3);}catch(_0x4f78ab){return![];}}function getOperatorValue(_0x4bfaeb){var _0x1a6582=JSON['parse'](_0x4bfaeb);var _0x77e168=Object['keys'](_0x1a6582)[0x0];var _0x378158=_0x1a6582[_0x77e168];return{['$'+_0x77e168]:_0x378158};}exports[_0xc277('0x5')]=function(_0x55be1f){var _0x324ef7=null;if(_0x55be1f){_0x324ef7=_0x55be1f[_0xc277('0x6')](',');}return _0x324ef7;};exports[_0xc277('0x7')]=function(_0x1b1db0,_0x3f766f){var _0x1e4087={};if(!_['isEmpty'](_0x1b1db0)){_['forOwn'](_0x1b1db0,function(_0x30a5dc,_0x1632bb){try{if(_0x3f766f){var _0x2df373=_[_0xc277('0x8')](_0x3f766f,{'name':_0x1632bb})||{};if(hasSequelizeOperator(_0x30a5dc)){_0x1e4087[_0x1632bb]=getOperatorValue(_0x30a5dc);}else if(_0x2df373['type']===_0xc277('0x9')&&_['isPlainObject'](_0x30a5dc)){var _0xb6b933=JSON[_0xc277('0x2')](_0x30a5dc);var _0x1850eb={'$gte':moment(moment(_0xb6b933[_0xc277('0xa')])['format'](_0xc277('0xb')))[_0xc277('0xc')]()[_0xc277('0xd')](),'$lte':moment(moment(_0xb6b933['$lte'])['format'](_0xc277('0xb')))['utc']()[_0xc277('0xe')](0x1,'s')['format']()};_0x1e4087[_0x1632bb]=_0x1850eb;}else if(_0x2df373[_0xc277('0xf')]===_0xc277('0x10')){_0x1e4087[_0x1632bb]=_0x30a5dc;}else{_0x1e4087[_0x1632bb]=_[_0xc277('0x11')](_0x30a5dc)?_0x30a5dc:JSON['parse'](_0x30a5dc);}}else{_0x1e4087[_0x1632bb]=_['isArray'](_0x30a5dc)?_0x30a5dc:JSON[_0xc277('0x2')](_0x30a5dc);}}catch(_0x4d23a7){_0x1e4087[_0x1632bb]=_0x30a5dc['split'](',');}});}return _0x1e4087;};exports[_0xc277('0x12')]=function(_0xba31f6){_0xba31f6=parseInt(_0xba31f6,0xa);if(!_0xba31f6||_0xba31f6<0x0){_0xba31f6=LIMIT_VALUE;}return _0xba31f6;};exports[_0xc277('0x13')]=function(_0x176dfb){_0x176dfb=parseInt(_0x176dfb,0xa);if(!_0x176dfb||_0x176dfb<0x0){_0x176dfb=0x0;}return _0x176dfb;};exports[_0xc277('0x14')]=function(_0x355eee){var _0x391cc3,_0x4a7a79=null;if(_0x355eee){_0x391cc3=_0x355eee['split'](',');_0x4a7a79=_[_0xc277('0x15')](_0x391cc3,function(_0x28900e){if(_0x28900e[_0xc277('0x16')]('-')===0x0){return[_0x28900e===_0xc277('0x17')?sequelize[_0xc277('0x18')](sequelize[_0xc277('0x19')](_0xc277('0x17')),_0xc277('0x1a')):_0x28900e[_0xc277('0x1b')](0x1),_0xc277('0x1c')];}else{return[_0x28900e===_0xc277('0x17')?sequelize['cast'](sequelize[_0xc277('0x19')](_0xc277('0x17')),'unsigned'):_0x28900e,_0xc277('0x1d')];}});}return _0x4a7a79;};exports['omit']=function(_0x48124d,_0x3292ab){if(_[_0xc277('0x1e')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x11')](_0x48124d)){for(var _0x436784=0x0;_0x436784<_0x48124d[_0xc277('0x1f')];_0x436784+=0x1){_0x48124d[_0x436784]=this[_0xc277('0x20')](_0x48124d[_0x436784],_0x3292ab);}return _0x48124d;}if(!_[_0xc277('0x21')](_0x48124d)){return _0x48124d;}if(_[_0xc277('0x22')](_0x3292ab)){_0x3292ab=[_0x3292ab];}if(!_[_0xc277('0x11')](_0x3292ab)){return _0x48124d;}for(var _0x3e04cb=0x0;_0x3e04cb<_0x3292ab[_0xc277('0x1f')];_0x3e04cb+=0x1){_['unset'](_0x48124d,_0x3292ab[_0x3e04cb]);}for(var _0x5f3933 in _0x48124d){if(_0x48124d[_0xc277('0x23')](_0x5f3933)){_0x48124d[_0x5f3933]=this[_0xc277('0x20')](_0x48124d[_0x5f3933],_0x3292ab);}}return _0x48124d;};exports['isNumeric']=function(_0x4efc1e){return _0x4efc1e[_0xc277('0x24')](RegExp(_0xc277('0x25')))?!![]:![];};exports[_0xc277('0x26')]=function(_0x21c78c){return _0x21c78c[_0xc277('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43757c){var _0x5edf7e=[];_0x43757c[_0xc277('0x6')](/[ ,]+/)[_0xc277('0x27')](function(_0x4348d9){_0x4348d9=_0x4348d9[_0xc277('0x28')](/([^:]")"+/g,'$1');_0x4348d9='+'+_0x4348d9+'*';var _0x5e9f22=/[ `!@#$%^&*()_\-?~]/;if(_0x4348d9[_0xc277('0x24')](_0x5e9f22))_0x4348d9='\x22'+_0x4348d9+'\x22';_0x5edf7e['push'](_0x4348d9);});return _0x5edf7e[_0xc277('0x29')]('\x20');};exports[_0xc277('0x2a')]=function(_0xbc1a66,_0x3591ab,_0x4f1603){var _0x278e56={},_0x3a7294={};if(_0x3591ab['query'][_0xc277('0x2b')]){_0x3591ab['query']['id']=_0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];delete _0x3591ab[_0xc277('0x2c')][_0xc277('0x2b')];}_0x278e56[_0xc277('0x2d')]=_[_0xc277('0x15')](_0xbc1a66,_0xc277('0xf'));_0x278e56[_0xc277('0x2c')]=_[_0xc277('0x3')](_0x3591ab[_0xc277('0x2c')]);_0x278e56[_0xc277('0x7')]=_['intersection'](_0x278e56[_0xc277('0x2d')],_0x278e56[_0xc277('0x2c')]);_0x3a7294[_0xc277('0x2e')]=_['intersection'](_0x278e56[_0xc277('0x2d')],this[_0xc277('0x5')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x5')]));_0x3a7294[_0xc277('0x2e')]=_0x3a7294['attributes']['length']?_0x3a7294[_0xc277('0x2e')]:_0x278e56['model'];if(!_0x3591ab[_0xc277('0x2c')][_0xc277('0x23')](_0xc277('0x2f'))){_0x3a7294[_0xc277('0x12')]=this[_0xc277('0x12')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x12')]);_0x3a7294[_0xc277('0x13')]=this[_0xc277('0x13')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x13')]);}_0x3a7294['order']=this[_0xc277('0x14')](_0x3591ab[_0xc277('0x2c')][_0xc277('0x14')]);_0x3a7294['where']=this[_0xc277('0x7')](_[_0xc277('0x30')](_0x3591ab['query'],_0x278e56['filters']),_0xbc1a66);if(_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')]){var _0x22c5b3=_0xbc1a66;var _0x1ca33a=_0x3591ab[_0xc277('0x2c')][_0xc277('0x31')];if(typeof _0x1ca33a===_0xc277('0x32')){_0x22c5b3=_['filter'](_0xbc1a66,function(_0x2561dd){return _[_0xc277('0x4')](_0x1ca33a[_0xc277('0x33')],_0x2561dd['name']);});_0x1ca33a=_0x1ca33a['value'];}_0x3a7294['where']=_['merge'](_0x3a7294['where'],{'$or':_[_0xc277('0x15')](_0x22c5b3,function(_0x4a26e3){if(_0x4a26e3[_0xc277('0x34')]!==_0xc277('0x35')){if(_0x4f1603){return sequelize[_0xc277('0x36')](sequelize['fn']('lower',sequelize[_0xc277('0x19')](_0x4a26e3[_0xc277('0xf')])),{'$like':sequelize['fn'](_0xc277('0x37'),'%'+_0x3591ab[_0xc277('0x2c')]['filter']+'%')});}else{var _0x284630={};_0x284630[_0x4a26e3[_0xc277('0xf')]]={'$like':'%'+_0x3591ab['query'][_0xc277('0x31')]+'%'};return _0x284630;}}})});}_0x3a7294=_[_0xc277('0x38')]({},_0x3a7294,_0x3591ab[_0xc277('0x39')]);return _0x3a7294;}; \ No newline at end of file +var _0xee14=['isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','split','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','pick','filter','object','columns','where','lower','merge','options','moment','parse','keys','includes','fields','filters'];(function(_0x44aad7,_0x49d1d2){var _0x25b35e=function(_0x2acd68){while(--_0x2acd68){_0x44aad7['push'](_0x44aad7['shift']());}};_0x25b35e(++_0x49d1d2);}(_0xee14,0x13a));var _0x4ee1=function(_0x351a99,_0x2738b1){_0x351a99=_0x351a99-0x0;var _0x5359d5=_0xee14[_0x351a99];return _0x5359d5;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x4ee1('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x674696){var _0x34e49d=['ne'];try{var _0x1fa407=JSON[_0x4ee1('0x1')](_0x674696);var _0x236ccd=Object[_0x4ee1('0x2')](_0x1fa407)[0x0];return _0x34e49d[_0x4ee1('0x3')](_0x236ccd);}catch(_0x3ccbc6){return![];}}function getOperatorValue(_0x4bc729){var _0xba6d36=JSON['parse'](_0x4bc729);var _0x327c18=Object[_0x4ee1('0x2')](_0xba6d36)[0x0];var _0x187656=_0xba6d36[_0x327c18];return{['$'+_0x327c18]:_0x187656};}exports[_0x4ee1('0x4')]=function(_0xdfe9c1){var _0x1fd8c8=null;if(_0xdfe9c1){_0x1fd8c8=_0xdfe9c1['split'](',');}return _0x1fd8c8;};exports[_0x4ee1('0x5')]=function(_0x38be25,_0x4e88e8){var _0x3fa61b={};if(!_[_0x4ee1('0x6')](_0x38be25)){_[_0x4ee1('0x7')](_0x38be25,function(_0x191da7,_0x5cbcb0){try{if(_0x4e88e8){var _0x1b3737=_[_0x4ee1('0x8')](_0x4e88e8,{'name':_0x5cbcb0})||{};if(hasSequelizeOperator(_0x191da7)){_0x3fa61b[_0x5cbcb0]=getOperatorValue(_0x191da7);}else if(_0x1b3737[_0x4ee1('0x9')]===_0x4ee1('0xa')&&_[_0x4ee1('0xb')](_0x191da7)){var _0x174427=JSON['parse'](_0x191da7);var _0x390aab={'$gte':moment(moment(_0x174427[_0x4ee1('0xc')])[_0x4ee1('0xd')](_0x4ee1('0xe')))[_0x4ee1('0xf')]()[_0x4ee1('0xd')](),'$lte':moment(moment(_0x174427[_0x4ee1('0x10')])[_0x4ee1('0xd')](_0x4ee1('0xe')))['utc']()[_0x4ee1('0x11')](0x1,'s')[_0x4ee1('0xd')]()};_0x3fa61b[_0x5cbcb0]=_0x390aab;}else if(_0x1b3737[_0x4ee1('0x12')]===_0x4ee1('0x13')){_0x3fa61b[_0x5cbcb0]=_0x191da7;}else{_0x3fa61b[_0x5cbcb0]=_[_0x4ee1('0x14')](_0x191da7)?_0x191da7:JSON[_0x4ee1('0x1')](_0x191da7);}}else{_0x3fa61b[_0x5cbcb0]=_[_0x4ee1('0x14')](_0x191da7)?_0x191da7:JSON[_0x4ee1('0x1')](_0x191da7);}}catch(_0x360056){_0x3fa61b[_0x5cbcb0]=_0x191da7[_0x4ee1('0x15')](',');}});}return _0x3fa61b;};exports[_0x4ee1('0x16')]=function(_0x5d76de){_0x5d76de=parseInt(_0x5d76de,0xa);if(!_0x5d76de||_0x5d76de<0x0){_0x5d76de=LIMIT_VALUE;}return _0x5d76de;};exports[_0x4ee1('0x17')]=function(_0x3db827){_0x3db827=parseInt(_0x3db827,0xa);if(!_0x3db827||_0x3db827<0x0){_0x3db827=0x0;}return _0x3db827;};exports[_0x4ee1('0x18')]=function(_0x1034fb){var _0x43f9a2,_0x383ab0=null;if(_0x1034fb){_0x43f9a2=_0x1034fb['split'](',');_0x383ab0=_[_0x4ee1('0x19')](_0x43f9a2,function(_0x333e96){if(_0x333e96[_0x4ee1('0x1a')]('-')===0x0){return[_0x333e96===_0x4ee1('0x1b')?sequelize[_0x4ee1('0x1c')](sequelize[_0x4ee1('0x1d')](_0x4ee1('0x1b')),_0x4ee1('0x1e')):_0x333e96[_0x4ee1('0x1f')](0x1),_0x4ee1('0x20')];}else{return[_0x333e96==='priority'?sequelize['cast'](sequelize[_0x4ee1('0x1d')](_0x4ee1('0x1b')),_0x4ee1('0x1e')):_0x333e96,_0x4ee1('0x21')];}});}return _0x383ab0;};exports[_0x4ee1('0x22')]=function(_0x28efdc,_0x57d45d){if(_['isEmpty'](_0x28efdc)){return _0x28efdc;}if(_[_0x4ee1('0x14')](_0x28efdc)){for(var _0x28b7e1=0x0;_0x28b7e1<_0x28efdc['length'];_0x28b7e1+=0x1){_0x28efdc[_0x28b7e1]=this[_0x4ee1('0x22')](_0x28efdc[_0x28b7e1],_0x57d45d);}return _0x28efdc;}if(!_[_0x4ee1('0x23')](_0x28efdc)){return _0x28efdc;}if(_[_0x4ee1('0x24')](_0x57d45d)){_0x57d45d=[_0x57d45d];}if(!_[_0x4ee1('0x14')](_0x57d45d)){return _0x28efdc;}for(var _0x2d699c=0x0;_0x2d699c<_0x57d45d[_0x4ee1('0x25')];_0x2d699c+=0x1){_[_0x4ee1('0x26')](_0x28efdc,_0x57d45d[_0x2d699c]);}for(var _0x56c4d3 in _0x28efdc){if(_0x28efdc[_0x4ee1('0x27')](_0x56c4d3)){_0x28efdc[_0x56c4d3]=this['omit'](_0x28efdc[_0x56c4d3],_0x57d45d);}}return _0x28efdc;};exports[_0x4ee1('0x28')]=function(_0x4ec408){return _0x4ec408[_0x4ee1('0x29')](RegExp(_0x4ee1('0x2a')))?!![]:![];};exports[_0x4ee1('0x2b')]=function(_0x13944c){return _0x13944c[_0x4ee1('0x29')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x1f7483){var _0x5b3792=[];_0x1f7483[_0x4ee1('0x15')](/[ ,]+/)[_0x4ee1('0x2c')](function(_0x33fd38){_0x33fd38=_0x33fd38[_0x4ee1('0x2d')](/([^:]")"+/g,'$1');_0x33fd38='+'+_0x33fd38+'*';var _0xac31e9=/[ `!@#$%^&*()_\-?~]/;if(_0x33fd38['match'](_0xac31e9))_0x33fd38='\x22'+_0x33fd38+'\x22';_0x5b3792[_0x4ee1('0x2e')](_0x33fd38);});return _0x5b3792[_0x4ee1('0x2f')]('\x20');};exports[_0x4ee1('0x30')]=function(_0x2e37a3,_0x79f87c,_0x393990){var _0x5dbb15={},_0x4aa2b8={};if(_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x32')]){_0x79f87c[_0x4ee1('0x31')]['id']=_0x79f87c['query'][_0x4ee1('0x32')];delete _0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x32')];}_0x5dbb15[_0x4ee1('0x33')]=_[_0x4ee1('0x19')](_0x2e37a3,_0x4ee1('0x12'));_0x5dbb15[_0x4ee1('0x31')]=_[_0x4ee1('0x2')](_0x79f87c[_0x4ee1('0x31')]);_0x5dbb15[_0x4ee1('0x5')]=_[_0x4ee1('0x34')](_0x5dbb15[_0x4ee1('0x33')],_0x5dbb15[_0x4ee1('0x31')]);_0x4aa2b8['attributes']=_[_0x4ee1('0x34')](_0x5dbb15[_0x4ee1('0x33')],this[_0x4ee1('0x4')](_0x79f87c['query']['fields']));_0x4aa2b8[_0x4ee1('0x35')]=_0x4aa2b8[_0x4ee1('0x35')][_0x4ee1('0x25')]?_0x4aa2b8[_0x4ee1('0x35')]:_0x5dbb15['model'];if(!_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x27')](_0x4ee1('0x36'))){_0x4aa2b8[_0x4ee1('0x16')]=this[_0x4ee1('0x16')](_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x16')]);_0x4aa2b8[_0x4ee1('0x17')]=this['offset'](_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x17')]);}_0x4aa2b8[_0x4ee1('0x37')]=this[_0x4ee1('0x18')](_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x18')]);_0x4aa2b8['where']=this[_0x4ee1('0x5')](_[_0x4ee1('0x38')](_0x79f87c[_0x4ee1('0x31')],_0x5dbb15[_0x4ee1('0x5')]),_0x2e37a3);if(_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x39')]){var _0x3f0d8b=_0x2e37a3;var _0xaac883=_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x39')];if(typeof _0xaac883===_0x4ee1('0x3a')){_0x3f0d8b=_[_0x4ee1('0x39')](_0x2e37a3,function(_0x34fc7a){return _['includes'](_0xaac883[_0x4ee1('0x3b')],_0x34fc7a[_0x4ee1('0x12')]);});_0xaac883=_0xaac883['value'];}_0x4aa2b8[_0x4ee1('0x3c')]=_['merge'](_0x4aa2b8[_0x4ee1('0x3c')],{'$or':_['map'](_0x3f0d8b,function(_0x14c333){if(_0x14c333[_0x4ee1('0x9')]!=='VIRTUAL'){if(_0x393990){return sequelize[_0x4ee1('0x3c')](sequelize['fn'](_0x4ee1('0x3d'),sequelize[_0x4ee1('0x1d')](_0x14c333[_0x4ee1('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x79f87c[_0x4ee1('0x31')][_0x4ee1('0x39')]+'%')});}else{var _0x1a4157={};_0x1a4157[_0x14c333['name']]={'$like':'%'+_0x79f87c['query'][_0x4ee1('0x39')]+'%'};return _0x1a4157;}}})});}_0x4aa2b8=_[_0x4ee1('0x3e')]({},_0x4aa2b8,_0x79f87c[_0x4ee1('0x3f')]);return _0x4aa2b8;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index df826e2..aa80f8d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3e23fd,_0x324cb8){var _0x23e70d=function(_0x34ce32){while(--_0x34ce32){_0x3e23fd['push'](_0x3e23fd['shift']());}};_0x23e70d(++_0x324cb8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +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(_0x48e43a,_0x1c83af){var _0x4b0da4=function(_0x1afa9a){while(--_0x1afa9a){_0x48e43a['push'](_0x48e43a['shift']());}};_0x4b0da4(++_0x1c83af);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 defe87f..e1edad2 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 _0xb8cf=['orderBy','keys','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','createHash','md5','update','digest','getUuid','platform','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces'];(function(_0x3b6554,_0x52ce17){var _0x1e2195=function(_0x235639){while(--_0x235639){_0x3b6554['push'](_0x3b6554['shift']());}};_0x1e2195(++_0x52ce17);}(_0xb8cf,0x1d6));var _0xfb8c=function(_0x83b7b9,_0x554605){_0x83b7b9=_0x83b7b9-0x0;var _0x5057a2=_0xb8cf[_0x83b7b9];return _0x5057a2;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xfb8c('0x0'));var machine=require(_0xfb8c('0x1'));var exec=require(_0xfb8c('0x2'))[_0xfb8c('0x3')];var config=require(_0xfb8c('0x4'));function getInterfaces(){var _0x22ee13=[];var _0x8cc0d5=os[_0xfb8c('0x5')]();var _0x2d7831=_[_0xfb8c('0x6')](_[_0xfb8c('0x7')](_0x8cc0d5));for(var _0x565da3=0x0;_0x565da3<_0x2d7831['length'];_0x565da3++){var _0x5bd3d5=_0x8cc0d5[_0x2d7831[_0x565da3]]['filter'](function(_0x39265a){return _0x39265a[_0xfb8c('0x8')]===_0xfb8c('0x9')&&_0x39265a['internal']===![];});_0x22ee13=_0x22ee13[_0xfb8c('0xa')](_0x5bd3d5);}return _0x22ee13;}function getFirstInterface(){var _0x15a108=_[_0xfb8c('0xb')](getInterfaces());return{'macAddress':_0x15a108&&_0x15a108[_0xfb8c('0xc')]?_0x15a108[_0xfb8c('0xc')]:_0xfb8c('0xd'),'ipAddress':_0x15a108&&_0x15a108[_0xfb8c('0xe')]?_0x15a108['address']:_0xfb8c('0xf')};}exports[_0xfb8c('0x10')]=getFirstInterface;function getCPUhash(){var _0x3920e0=_[_0xfb8c('0x6')](os['cpus']()['map'](function(_0x4cfada){return _0x4cfada[_0xfb8c('0x11')];}))['join'](':');return crypto[_0xfb8c('0x12')](_0xfb8c('0x13'))[_0xfb8c('0x14')](_0x3920e0)[_0xfb8c('0x15')]('hex');}exports[_0xfb8c('0x16')]=function(){var _0x1878f3=os[_0xfb8c('0x17')]();var _0xc9131b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xc9131b[_0xfb8c('0x18')](config['licenseToken'])){return config['licenseToken'];}else if(_0x1878f3===_0xfb8c('0x19')){return exec(_0xfb8c('0x1a'),{'encoding':_0xfb8c('0x1b')})[_0xfb8c('0x1c')]('\x0d\x0a','');}else{var _0x576f7e=getFirstInterface();var _0x11d24d=getCPUhash();var _0x5f487b=_0x11d24d+'|'+os[_0xfb8c('0x1d')]()+'|'+_0x576f7e[_0xfb8c('0x1e')]+'|'+_0x576f7e[_0xfb8c('0x1f')];var _0x462f8b=crypto['createHash']('md5')['update'](_0x5f487b)[_0xfb8c('0x15')](_0xfb8c('0x20'));return _0x462f8b[_0xfb8c('0x21')](0x0,0x8)+'-'+_0x462f8b[_0xfb8c('0x21')](0x8,0xc)+'-'+_0x462f8b[_0xfb8c('0x21')](0xc,0x10)+'-'+_0x462f8b[_0xfb8c('0x21')](0x10,0x14)+'-'+_0x462f8b[_0xfb8c('0x21')](0x14);}}; \ No newline at end of file +var _0x73d4=['getFirstInterface','cpus','join','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','md5','update','substring','lodash','execSync','networkInterfaces','orderBy','length','filter','family','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1'];(function(_0x2815e1,_0x370f75){var _0x568dcb=function(_0x25df03){while(--_0x25df03){_0x2815e1['push'](_0x2815e1['shift']());}};_0x568dcb(++_0x370f75);}(_0x73d4,0x1a5));var _0x473d=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x73d4[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0x473d('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x473d('0x1')];var config=require('../environment');function getInterfaces(){var _0x40d696=[];var _0x3c0548=os[_0x473d('0x2')]();var _0x436063=_[_0x473d('0x3')](_['keys'](_0x3c0548));for(var _0x56e40d=0x0;_0x56e40d<_0x436063[_0x473d('0x4')];_0x56e40d++){var _0x10843b=_0x3c0548[_0x436063[_0x56e40d]][_0x473d('0x5')](function(_0x57a409){return _0x57a409[_0x473d('0x6')]==='IPv4'&&_0x57a409['internal']===![];});_0x40d696=_0x40d696[_0x473d('0x7')](_0x10843b);}return _0x40d696;}function getFirstInterface(){var _0x290737=_[_0x473d('0x8')](getInterfaces());return{'macAddress':_0x290737&&_0x290737[_0x473d('0x9')]?_0x290737[_0x473d('0x9')]:_0x473d('0xa'),'ipAddress':_0x290737&&_0x290737[_0x473d('0xb')]?_0x290737['address']:_0x473d('0xc')};}exports[_0x473d('0xd')]=getFirstInterface;function getCPUhash(){var _0x54073e=_[_0x473d('0x3')](os[_0x473d('0xe')]()['map'](function(_0x288cb7){return _0x288cb7['model'];}))[_0x473d('0xf')](':');return crypto['createHash']('md5')['update'](_0x54073e)[_0x473d('0x10')](_0x473d('0x11'));}exports[_0x473d('0x12')]=function(){var _0x331365=os[_0x473d('0x13')]();var _0x9b3527=/[0-9a-f-]{36}/;if(config[_0x473d('0x14')]&&_0x9b3527[_0x473d('0x15')](config[_0x473d('0x14')])){return config[_0x473d('0x14')];}else if(_0x331365===_0x473d('0x16')){return exec(_0x473d('0x17'),{'encoding':_0x473d('0x18')})[_0x473d('0x19')]('\x0d\x0a','');}else{var _0x19479f=getFirstInterface();var _0x2692fe=getCPUhash();var _0x204cfd=_0x2692fe+'|'+os[_0x473d('0x1a')]()+'|'+_0x19479f['macAddress']+'|'+_0x19479f[_0x473d('0x1b')];var _0xbf7e09=crypto['createHash'](_0x473d('0x1c'))[_0x473d('0x1d')](_0x204cfd)[_0x473d('0x10')]('hex');return _0xbf7e09[_0x473d('0x1e')](0x0,0x8)+'-'+_0xbf7e09[_0x473d('0x1e')](0x8,0xc)+'-'+_0xbf7e09['substring'](0xc,0x10)+'-'+_0xbf7e09['substring'](0x10,0x14)+'-'+_0xbf7e09[_0x473d('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index aaf789e..0e8f5fb 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 _0x0557=['encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','spread','error','default','util','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm'];(function(_0x1fe69b,_0x245bf7){var _0x1a4ba8=function(_0x49968b){while(--_0x49968b){_0x1fe69b['push'](_0x1fe69b['shift']());}};_0x1a4ba8(++_0x245bf7);}(_0x0557,0xaa));var _0x7055=function(_0x4c23bb,_0x1d491c){_0x4c23bb=_0x4c23bb-0x0;var _0x32949e=_0x0557[_0x4c23bb];return _0x32949e;};'use strict';var util=require(_0x7055('0x0'));var moment=require('moment');var rp=require(_0x7055('0x1'));var BPromise=require(_0x7055('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x7055('0x3'))['db'];var encryptor=require(_0x7055('0x4'));var hardware=require(_0x7055('0x5'));var logger=require(_0x7055('0x6'))(_0x7055('0x7'));var HOST=_0x7055('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x307748){return new BPromise(function(_0x984d8f,_0x2c35cd){var _0x41fc15=util[_0x7055('0x9')](_0x7055('0xa'),HOST,_0x307748,module['exports'][_0x7055('0xb')]);if(oldToken){_0x41fc15=util[_0x7055('0x9')](_0x7055('0xc'),HOST,_0x307748,module[_0x7055('0xd')][_0x7055('0xb')],oldToken);}var _0x233a8e={'uri':_0x41fc15,'method':_0x7055('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x233a8e)[_0x7055('0xf')](function(_0x1e4c36){_0x984d8f(_0x1e4c36);})[_0x7055('0x10')](function(_0x2e9050){_0x2c35cd(_0x2e9050);});});}function manageLicense(_0xa2bc24,_0x244f01){var _0x23ca92=_0x244f01[_0x7055('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x23ca92['data1']!==_0xa2bc24&&!_0x23ca92[_0x7055('0x12')]){oldToken=_0x23ca92[_0x7055('0x13')];}httpRequest(_0xa2bc24)[_0x7055('0xf')](function(_0x1d1ad8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1d1ad8[_0x7055('0x14')]){isOldTokenSent=![];if(!_0x23ca92['license']&&_0x23ca92[_0x7055('0x7')]!=_0x1d1ad8[_0x7055('0x7')]||_0x23ca92[_0x7055('0x7')]&&_0x23ca92[_0x7055('0x12')]){logger[_0x7055('0x15')](_0x7055('0x16'));}if(_0x23ca92[_0x7055('0x7')]&&!_0x23ca92['data2']&&_0x23ca92['license']!=_0x1d1ad8[_0x7055('0x7')]){logger[_0x7055('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x23ca92['license']&&!_0x23ca92[_0x7055('0x12')]&&_0x23ca92[_0x7055('0x7')]==_0x1d1ad8[_0x7055('0x7')]){return _0x244f01;}return _0x244f01[_0x7055('0x17')]({'data1':_0xa2bc24,'data2':null,'license':_0x1d1ad8['license']});}else{if(_0x1d1ad8[_0x7055('0x7')]||_0x23ca92[_0x7055('0x7')]){if(!_0x23ca92[_0x7055('0x12')]){if(_0x23ca92[_0x7055('0x13')]==_0xa2bc24){GRAY_PERIOD_REASON=_0x7055('0x18');logger[_0x7055('0x15')](_0x7055('0x19'));}else{GRAY_PERIOD_REASON=_0x7055('0x1a');logger[_0x7055('0x15')](_0x7055('0x1b'),_0x23ca92[_0x7055('0x13')],_0xa2bc24);}logger['info'](_0x7055('0x1c'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x7055('0x1d')));return _0x244f01[_0x7055('0x17')]({'data2':encryptor[_0x7055('0x1e')](moment()[_0x7055('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x7055('0x1f')](_0x23ca92['data2']),_0x7055('0x20'))>DAYS){logger[_0x7055('0x15')](_0x7055('0x21'),moment()[_0x7055('0x9')](_0x7055('0x1d')));isOldTokenSent=![];return _0x244f01['update']({'data1':_0xa2bc24,'data2':null,'license':null});}}}else{if(_0x23ca92[_0x7055('0x13')]!=_0xa2bc24){logger['info'](_0x7055('0x1b'),_0x23ca92[_0x7055('0x13')],_0xa2bc24);return _0x244f01[_0x7055('0x17')]({'data1':_0xa2bc24,'data2':null,'license':null});}}}return _0x244f01;})[_0x7055('0xf')](function(_0x41e454){_0x244f01=_0x41e454;})['catch'](function(_0x2b05d6){logger['error'](_0x2b05d6[_0x7055('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x7055('0x23')](),_0x244f01);},TIME);});}function defaultLicense(){var _0x28af78=hardware['getUuid']();if(_0x28af78){return db[_0x7055('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x28af78}})[_0x7055('0x25')](function(_0x487dcd,_0x5c3d04){logger[_0x7055('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x28af78);manageLicense(_0x28af78,_0x487dcd);})[_0x7055('0x10')](function(_0x252373){logger[_0x7055('0x26')](_0x252373[_0x7055('0x22')]);});}}exports[_0x7055('0x27')]=defaultLicense; \ No newline at end of file +var _0x9d40=['version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','default','util','request-promise','bluebird'];(function(_0x5d4818,_0x3ccae2){var _0x578a9c=function(_0x530284){while(--_0x530284){_0x5d4818['push'](_0x5d4818['shift']());}};_0x578a9c(++_0x3ccae2);}(_0x9d40,0x125));var _0x09d4=function(_0x7a30d6,_0x241d08){_0x7a30d6=_0x7a30d6-0x0;var _0x4f6237=_0x9d40[_0x7a30d6];return _0x4f6237;};'use strict';var util=require(_0x09d4('0x0'));var moment=require('moment');var rp=require(_0x09d4('0x1'));var BPromise=require(_0x09d4('0x2'));var pkginfo=require('pkginfo')(module,_0x09d4('0x3'));var db=require(_0x09d4('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x09d4('0x5'));var logger=require(_0x09d4('0x6'))(_0x09d4('0x7'));var HOST=_0x09d4('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2e753c){return new BPromise(function(_0x55ec30,_0x59e783){var _0x394179=util[_0x09d4('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2e753c,module[_0x09d4('0xa')][_0x09d4('0x3')]);if(oldToken){_0x394179=util[_0x09d4('0x9')](_0x09d4('0xb'),HOST,_0x2e753c,module[_0x09d4('0xa')][_0x09d4('0x3')],oldToken);}var _0x13320c={'uri':_0x394179,'method':_0x09d4('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x13320c)[_0x09d4('0xd')](function(_0x5647ce){_0x55ec30(_0x5647ce);})[_0x09d4('0xe')](function(_0x3b3dca){_0x59e783(_0x3b3dca);});});}function manageLicense(_0x4db792,_0x37a80c){var _0x4bc633=_0x37a80c[_0x09d4('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x4bc633[_0x09d4('0x10')]!==_0x4db792&&!_0x4bc633[_0x09d4('0x11')]){oldToken=_0x4bc633[_0x09d4('0x10')];}httpRequest(_0x4db792)[_0x09d4('0xd')](function(_0x262be4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x262be4[_0x09d4('0x12')]){isOldTokenSent=![];if(!_0x4bc633[_0x09d4('0x7')]&&_0x4bc633['license']!=_0x262be4['license']||_0x4bc633['license']&&_0x4bc633['data2']){logger[_0x09d4('0x13')](_0x09d4('0x14'));}if(_0x4bc633[_0x09d4('0x7')]&&!_0x4bc633[_0x09d4('0x11')]&&_0x4bc633[_0x09d4('0x7')]!=_0x262be4[_0x09d4('0x7')]){logger['info'](_0x09d4('0x15'));}if(_0x4bc633['license']&&!_0x4bc633[_0x09d4('0x11')]&&_0x4bc633[_0x09d4('0x7')]==_0x262be4[_0x09d4('0x7')]){return _0x37a80c;}return _0x37a80c[_0x09d4('0x16')]({'data1':_0x4db792,'data2':null,'license':_0x262be4[_0x09d4('0x7')]});}else{if(_0x262be4[_0x09d4('0x7')]||_0x4bc633[_0x09d4('0x7')]){if(!_0x4bc633[_0x09d4('0x11')]){if(_0x4bc633['data1']==_0x4db792){GRAY_PERIOD_REASON=_0x09d4('0x17');logger[_0x09d4('0x13')](_0x09d4('0x18'));}else{GRAY_PERIOD_REASON=_0x09d4('0x19');logger[_0x09d4('0x13')](_0x09d4('0x1a'),_0x4bc633[_0x09d4('0x10')],_0x4db792);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x09d4('0x1b')](),moment()[_0x09d4('0x9')](_0x09d4('0x1c')));return _0x37a80c['update']({'data2':encryptor[_0x09d4('0x1d')](moment()[_0x09d4('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x4bc633[_0x09d4('0x11')]),'days')>DAYS){logger['info'](_0x09d4('0x1e'),moment()[_0x09d4('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x37a80c[_0x09d4('0x16')]({'data1':_0x4db792,'data2':null,'license':null});}}}else{if(_0x4bc633[_0x09d4('0x10')]!=_0x4db792){logger[_0x09d4('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4bc633['data1'],_0x4db792);return _0x37a80c[_0x09d4('0x16')]({'data1':_0x4db792,'data2':null,'license':null});}}}return _0x37a80c;})[_0x09d4('0xd')](function(_0x1d1333){_0x37a80c=_0x1d1333;})[_0x09d4('0xe')](function(_0x2b6a1f){logger[_0x09d4('0x1f')](_0x2b6a1f[_0x09d4('0x20')]);})[_0x09d4('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x09d4('0x22')](),_0x37a80c);},TIME);});}function defaultLicense(){var _0x53812d=hardware['getUuid']();if(_0x53812d){return db['License'][_0x09d4('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x53812d}})['spread'](function(_0xa4fbc3,_0x5a51e5){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x53812d);manageLicense(_0x53812d,_0xa4fbc3);})[_0x09d4('0xe')](function(_0x3c699e){logger['error'](_0x3c699e[_0x09d4('0x20')]);});}}exports[_0x09d4('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 4327029..2ed4ec8 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 _0xe589=['User','findAll','role','COUNT','sequelize','user','users','telephones','admin','count','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','uuid','data1','license','split','decryptString','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','format','grayReason','changed','disabled','message'];(function(_0x37b4df,_0x36f349){var _0x4e6250=function(_0x2c9f23){while(--_0x2c9f23){_0x37b4df['push'](_0x37b4df['shift']());}};_0x4e6250(++_0x36f349);}(_0xe589,0x12b));var _0x9e58=function(_0x20298a,_0x7ad1e8){_0x20298a=_0x20298a-0x0;var _0x1ca713=_0xe589[_0x20298a];return _0x1ca713;};'use strict';var util=require(_0x9e58('0x0'));var _=require('lodash');var moment=require(_0x9e58('0x1'));var BPromise=require('bluebird');var hardware=require(_0x9e58('0x2'));var encryptor=require(_0x9e58('0x3'));var db=require(_0x9e58('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e58('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9e58('0x6'),'machineUuid':hardware[_0x9e58('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e58('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9e58('0x8'),'machineUuid':hardware[_0x9e58('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x324480){return new BPromise(function(_0x4fde16,_0x28c47a){return db[_0x9e58('0x9')]['find'](_[_0x9e58('0xa')](_0x324480,{'raw':!![],'where':{'id':0x1}}))[_0x9e58('0xb')](function(_0x61057b){return checkLicense(_0x61057b,null);})['then'](function(_0x5dd41c){_0x4fde16(_0x5dd41c);return;})['catch'](function(_0x7b4786){_0x28c47a(_0x7b4786);});});}function checkLicense(_0x14f046,_0x3c8ddf){if(!_0x14f046){demoLicense[_0x9e58('0xc')]=_0x14f046[_0x9e58('0xd')];return demoLicense;}try{var _0x163256=_0x3c8ddf||_0x14f046[_0x9e58('0xe')];if(_['isEmpty'](_0x163256)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3a5e94=_0x14f046['data1'];var _0x310295=_0x14f046['data2'];var _0x338628=_0x3a5e94[_0x9e58('0xf')]('-')[0x4];var _0xf62469=_0x3a5e94[_0x9e58('0xf')]('-')[0x0];var _0x501975=encryptor[_0x9e58('0x10')](_0x163256,util['format'](_0x9e58('0x11'),_0x338628,_0x3a5e94,_0xf62469));var _0x20c713=JSON[_0x9e58('0x12')](_0x501975);_0x20c713[_0x9e58('0x13')]=![];_0x20c713[_0x9e58('0xc')]=_0x3a5e94;_0x20c713[_0x9e58('0x14')]=hardware[_0x9e58('0x7')]();if(_0x310295){var _0x25934a=encryptor['decryptString'](_0x310295);_0x20c713[_0x9e58('0x15')]=_0x25934a;_0x20c713[_0x9e58('0x16')]=moment(_0x25934a)[_0x9e58('0x17')](0x7,_0x9e58('0x18'))[_0x9e58('0x19')]();_0x20c713[_0x9e58('0x1a')]=_0x20c713['uuid']!=_0x20c713[_0x9e58('0x14')]?_0x9e58('0x1b'):_0x9e58('0x1c');}return _0x20c713;}catch(_0x1ccc75){breakingLicense[_0x9e58('0xc')]=_0x14f046['data1'];breakingLicense[_0x9e58('0x1d')]=_0x1ccc75[_0x9e58('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5635bf,_0x3178cc){getLicense()[_0x9e58('0xb')](function(_0x1cc6f7){return db[_0x9e58('0x1e')][_0x9e58('0x1f')]({'attributes':[_0x9e58('0x20'),[db['sequelize']['fn'](_0x9e58('0x21'),db[_0x9e58('0x22')]['col'](_0x9e58('0x20'))),'count']],'group':'role','where':{'role':{'$or':['admin',_0x9e58('0x23'),'telephone']}},'raw':!![]})[_0x9e58('0xb')](function(_0x3d1dd5){var _0x33e0e7={'user':_0x1cc6f7[_0x9e58('0x24')]||0x0,'telephone':_0x1cc6f7[_0x9e58('0x25')]||0x0};_0x3d1dd5['forEach'](function(_0x27011c){var _0x5618ec=_0x27011c[_0x9e58('0x20')]===_0x9e58('0x26')?_0x9e58('0x23'):_0x27011c[_0x9e58('0x20')];_0x33e0e7[_0x5618ec]-=_0x27011c[_0x9e58('0x27')];if(_0x33e0e7[_0x5618ec]<0x0)_0x33e0e7[_0x5618ec]=0x0;});_0x5635bf(_0x33e0e7);return;});})['catch'](function(_0x2e835d){_0x3178cc(_0x2e835d);});});}function checkUserLimits(_0x36b02c){return new BPromise(function(_0x5a18f0,_0xacaa7e){getLimits()['then'](function(_0x499036){var _0x2c2633=_[_0x9e58('0x28')](_[_0x9e58('0x29')](_0x36b02c,_0x9e58('0x20')),[_0x9e58('0x26'),_0x9e58('0x23'),_0x9e58('0x2a')]);var _0x2dce93=(_0x2c2633[_0x9e58('0x26')]||0x0)+(_0x2c2633['user']||0x0);var _0x13e3c0=_0x2c2633['telephone']||0x0;if(_0x2dce93>_0x499036[_0x9e58('0x23')])return _0xacaa7e(_0x9e58('0x2b'));if(_0x13e3c0>_0x499036[_0x9e58('0x2a')])return _0xacaa7e(_0x9e58('0x2c'));return _0x5a18f0();})[_0x9e58('0x2d')](function(_0x51dff9){_0xacaa7e(_0x51dff9);});});}module[_0x9e58('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4342=['License','then','catch','uuid','data1','license','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','changed','disabled','message','User','role','sequelize','COUNT','count','user','telephone','users','telephones','forEach','pick','countBy','admin','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid'];(function(_0x574a64,_0x51de06){var _0x325421=function(_0x2f8473){while(--_0x2f8473){_0x574a64['push'](_0x574a64['shift']());}};_0x325421(++_0x51de06);}(_0x4342,0xe1));var _0x2434=function(_0x5413f5,_0x3154c7){_0x5413f5=_0x5413f5-0x0;var _0x639288=_0x4342[_0x5413f5];return _0x639288;};'use strict';var util=require('util');var _=require(_0x2434('0x0'));var moment=require(_0x2434('0x1'));var BPromise=require(_0x2434('0x2'));var hardware=require(_0x2434('0x3'));var encryptor=require(_0x2434('0x4'));var db=require(_0x2434('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2434('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2434('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2434('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2434('0x8'),'machineUuid':hardware[_0x2434('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5afba8){return new BPromise(function(_0x241019,_0x1e1a4b){return db[_0x2434('0xa')]['find'](_['defaults'](_0x5afba8,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x195476){return checkLicense(_0x195476,null);})[_0x2434('0xb')](function(_0x281484){_0x241019(_0x281484);return;})[_0x2434('0xc')](function(_0xb2c78c){_0x1e1a4b(_0xb2c78c);});});}function checkLicense(_0x26fe27,_0x5f04cf){if(!_0x26fe27){demoLicense[_0x2434('0xd')]=_0x26fe27[_0x2434('0xe')];return demoLicense;}try{var _0xdb7d7b=_0x5f04cf||_0x26fe27[_0x2434('0xf')];if(_['isEmpty'](_0xdb7d7b)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2db0fd=_0x26fe27['data1'];var _0x195bbd=_0x26fe27[_0x2434('0x10')];var _0x511d3c=_0x2db0fd[_0x2434('0x11')]('-')[0x4];var _0x104c28=_0x2db0fd[_0x2434('0x11')]('-')[0x0];var _0x591f9f=encryptor[_0x2434('0x12')](_0xdb7d7b,util[_0x2434('0x13')](_0x2434('0x14'),_0x511d3c,_0x2db0fd,_0x104c28));var _0x25d077=JSON[_0x2434('0x15')](_0x591f9f);_0x25d077[_0x2434('0x16')]=![];_0x25d077[_0x2434('0xd')]=_0x2db0fd;_0x25d077[_0x2434('0x17')]=hardware[_0x2434('0x9')]();if(_0x195bbd){var _0x439be0=encryptor[_0x2434('0x12')](_0x195bbd);_0x25d077[_0x2434('0x18')]=_0x439be0;_0x25d077[_0x2434('0x19')]=moment(_0x439be0)[_0x2434('0x1a')](0x7,_0x2434('0x1b'))[_0x2434('0x13')]();_0x25d077['grayReason']=_0x25d077['uuid']!=_0x25d077[_0x2434('0x17')]?_0x2434('0x1c'):_0x2434('0x1d');}return _0x25d077;}catch(_0x58c011){breakingLicense[_0x2434('0xd')]=_0x26fe27[_0x2434('0xe')];breakingLicense[_0x2434('0x1e')]=_0x58c011[_0x2434('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x355dd7,_0x4c2432){getLicense()['then'](function(_0x1fea9a){return db[_0x2434('0x1f')]['findAll']({'attributes':[_0x2434('0x20'),[db[_0x2434('0x21')]['fn'](_0x2434('0x22'),db[_0x2434('0x21')]['col'](_0x2434('0x20'))),_0x2434('0x23')]],'group':'role','where':{'role':{'$or':['admin',_0x2434('0x24'),_0x2434('0x25')]}},'raw':!![]})[_0x2434('0xb')](function(_0x22c8b7){var _0x545aca={'user':_0x1fea9a[_0x2434('0x26')]||0x0,'telephone':_0x1fea9a[_0x2434('0x27')]||0x0};_0x22c8b7[_0x2434('0x28')](function(_0x30d1a7){var _0x2e48d7=_0x30d1a7[_0x2434('0x20')]==='admin'?_0x2434('0x24'):_0x30d1a7[_0x2434('0x20')];_0x545aca[_0x2e48d7]-=_0x30d1a7[_0x2434('0x23')];if(_0x545aca[_0x2e48d7]<0x0)_0x545aca[_0x2e48d7]=0x0;});_0x355dd7(_0x545aca);return;});})[_0x2434('0xc')](function(_0xd6cba6){_0x4c2432(_0xd6cba6);});});}function checkUserLimits(_0x2efa3c){return new BPromise(function(_0x1a29b3,_0x45558e){getLimits()[_0x2434('0xb')](function(_0x1d3110){var _0x6968bd=_[_0x2434('0x29')](_[_0x2434('0x2a')](_0x2efa3c,_0x2434('0x20')),['admin','user','telephone']);var _0x46d3ba=(_0x6968bd[_0x2434('0x2b')]||0x0)+(_0x6968bd[_0x2434('0x24')]||0x0);var _0x320c1e=_0x6968bd[_0x2434('0x25')]||0x0;if(_0x46d3ba>_0x1d3110[_0x2434('0x24')])return _0x45558e(_0x2434('0x2c'));if(_0x320c1e>_0x1d3110[_0x2434('0x25')])return _0x45558e(_0x2434('0x2d'));return _0x1a29b3();})['catch'](function(_0x462c97){_0x45558e(_0x462c97);});});}module[_0x2434('0x2e')]={'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 d45b4f0..0d37c33 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 _0x2da6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1d6e6e,_0x536992){var _0xa2795e=function(_0x2544fc){while(--_0x2544fc){_0x1d6e6e['push'](_0x1d6e6e['shift']());}};_0xa2795e(++_0x536992);}(_0x2da6,0x1dd));var _0x62da=function(_0x5896f4,_0x2546b4){_0x5896f4=_0x5896f4-0x0;var _0x3b4b60=_0x2da6[_0x5896f4];return _0x3b4b60;};'use strict';module[_0x62da('0x0')]={'DOMAIN':_0x62da('0x1'),'SESSION_SECRET':_0x62da('0x2'),'GOOGLE_ID':_0x62da('0x3'),'GOOGLE_SECRET':_0x62da('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xea28=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x55ca10,_0xdaa291){var _0x4a6324=function(_0x125f54){while(--_0x125f54){_0x55ca10['push'](_0x55ca10['shift']());}};_0x4a6324(++_0xdaa291);}(_0xea28,0x13a));var _0x8ea2=function(_0x333ccc,_0x52dab9){_0x333ccc=_0x333ccc-0x0;var _0x1c4d0c=_0xea28[_0x333ccc];return _0x1c4d0c;};'use strict';module[_0x8ea2('0x0')]={'DOMAIN':_0x8ea2('0x1'),'SESSION_SECRET':_0x8ea2('0x2'),'GOOGLE_ID':_0x8ea2('0x3'),'GOOGLE_SECRET':_0x8ea2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4414a97..d9bba11 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e0=['fileLogger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xb4e0,0x97));var _0x0b4e=function(_0xf04b13,_0x3baf4e){_0xf04b13=_0xf04b13-0x0;var _0x179f6e=_0xb4e0[_0xf04b13];return _0x179f6e;};'use strict';var fileLogger=require('../utils/loggers')[_0x0b4e('0x0')];module['exports']=fileLogger; \ No newline at end of file +var _0x17c8=['exports','../utils/loggers'];(function(_0x54bf9f,_0xd558b){var _0x58518d=function(_0x44a700){while(--_0x44a700){_0x54bf9f['push'](_0x54bf9f['shift']());}};_0x58518d(++_0xd558b);}(_0x17c8,0xa1));var _0x817c=function(_0x46d9ab,_0x1e643b){_0x46d9ab=_0x46d9ab-0x0;var _0x152fbc=_0x17c8[_0x46d9ab];return _0x152fbc;};'use strict';var fileLogger=require(_0x817c('0x0'))['fileLogger'];module[_0x817c('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 1674a87..0341d43 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 _0x7ea4=['express','join','../../services/express/index.js','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x4a9431,_0x14063f){var _0x2517cf=function(_0x30d274){while(--_0x30d274){_0x4a9431['push'](_0x4a9431['shift']());}};_0x2517cf(++_0x14063f);}(_0x7ea4,0x9f));var _0x47ea=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7ea4[_0x1e4360];return _0x31e6b4;};'use strict';var path=require(_0x47ea('0x0'));var os=require('os');var config={'apps':[{'name':_0x47ea('0x1'),'script':path[_0x47ea('0x2')](__dirname,_0x47ea('0x3'))},{'name':'ami','script':path[_0x47ea('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x47ea('0x2')](__dirname,_0x47ea('0x4'))},{'name':'email','script':path[_0x47ea('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x47ea('0x5'),'script':path[_0x47ea('0x2')](__dirname,_0x47ea('0x6'))},{'name':_0x47ea('0x7'),'script':path[_0x47ea('0x2')](__dirname,_0x47ea('0x8'))}]};module[_0x47ea('0x9')]=config; \ No newline at end of file +var _0xa0b7=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','express','join','../../services/express/index.js','../../services/ami/index.js','../../services/email/index.js'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xa0b7,0x187));var _0x7a0b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xa0b7[_0x5f1391];return _0x50ebe3;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x7a0b('0x0'),'script':path[_0x7a0b('0x1')](__dirname,_0x7a0b('0x2'))},{'name':'ami','script':path[_0x7a0b('0x1')](__dirname,_0x7a0b('0x3'))},{'name':'agi','script':path[_0x7a0b('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x7a0b('0x1')](__dirname,_0x7a0b('0x4'))},{'name':_0x7a0b('0x5'),'script':path[_0x7a0b('0x1')](__dirname,_0x7a0b('0x6'))},{'name':_0x7a0b('0x7'),'script':path[_0x7a0b('0x1')](__dirname,_0x7a0b('0x8'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index fd87e51..bc04c26 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 _0xbfe4=['pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','list','describe','delete','dump','saved'];(function(_0x406618,_0xef5e1){var _0x58d993=function(_0x2c2d9b){while(--_0x2c2d9b){_0x406618['push'](_0x406618['shift']());}};_0x58d993(++_0xef5e1);}(_0xbfe4,0x1c0));var _0x4bfe=function(_0x45a12b,_0x5d7caa){_0x45a12b=_0x45a12b-0x0;var _0x33cb4c=_0xbfe4[_0x45a12b];return _0x33cb4c;};'use strict';var pm2=require(_0x4bfe('0x0'));var BPromise=require(_0x4bfe('0x1'));var config=require(_0x4bfe('0x2'));function connect(){return new BPromise(function(_0xb1ba7d,_0x45ba4e){return pm2[_0x4bfe('0x3')](function(_0x1b492c){if(_0x1b492c){return _0x45ba4e(_0x1b492c);}return _0xb1ba7d(_0x4bfe('0x4'));});});};exports[_0x4bfe('0x5')]=function(_0x2c7dc0){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x205842,_0x39a731){return pm2[_0x4bfe('0x5')](_0x2c7dc0,function(_0x39e373,_0x54cdb6){if(_0x39e373){return _0x39a731(_0x39e373);}pm2[_0x4bfe('0x7')]();return _0x205842(_0x54cdb6);});});});};exports[_0x4bfe('0x8')]=function(_0x439524){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x53cf39,_0x325230){return pm2[_0x4bfe('0x8')](_0x439524,function(_0x2222f7,_0x89645e){if(_0x2222f7){return _0x325230(_0x2222f7);}pm2[_0x4bfe('0x7')]();return _0x53cf39(_0x89645e);});});});};exports['restart']=function(_0x460276){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x3c5e59,_0x48e74f){return pm2['restart'](_0x460276,function(_0x528956,_0xa2813c){if(_0x528956){return _0x48e74f(_0x528956);}pm2[_0x4bfe('0x7')]();return _0x3c5e59(_0xa2813c);});});});};exports[_0x4bfe('0x9')]=function(){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x5dcff1,_0x22cd5e){return pm2[_0x4bfe('0x9')](function(_0x1f2aaf,_0x44932e){if(_0x1f2aaf){return _0x22cd5e(_0x1f2aaf);}pm2[_0x4bfe('0x7')]();return _0x5dcff1(_0x44932e);});});});};exports[_0x4bfe('0xa')]=function(_0x1a3e8c){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x167a7c,_0x345ae1){return pm2[_0x4bfe('0xa')](_0x1a3e8c,function(_0x49d890,_0x26f581){if(_0x49d890){return _0x345ae1(_0x49d890);}pm2['disconnect']();return _0x167a7c(_0x26f581);});});});};exports[_0x4bfe('0xb')]=function(_0x59d5dd){return connect()['then'](function(){return new BPromise(function(_0x5dc8df,_0x17c927){return pm2[_0x4bfe('0xb')](_0x59d5dd,function(_0x1cf464,_0xd35593){if(_0x1cf464){return _0x17c927(_0x1cf464);}pm2[_0x4bfe('0x7')]();return _0x5dc8df(_0xd35593);});});});};exports[_0x4bfe('0xc')]=function(){return connect()[_0x4bfe('0x6')](function(){return new BPromise(function(_0x307063,_0x250eeb){return pm2[_0x4bfe('0xc')](function(_0x332adb){if(_0x332adb){return _0x250eeb(_0x332adb);}return _0x307063(_0x4bfe('0xd'));});});});}; \ No newline at end of file +var _0x0018=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','start','then','disconnect'];(function(_0x27a914,_0x5a1f99){var _0x4acf6a=function(_0x1b3104){while(--_0x1b3104){_0x27a914['push'](_0x27a914['shift']());}};_0x4acf6a(++_0x5a1f99);}(_0x0018,0x1b9));var _0x8001=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0018[_0x17d9e3];return _0x14192d;};'use strict';var pm2=require(_0x8001('0x0'));var BPromise=require(_0x8001('0x1'));var config=require(_0x8001('0x2'));function connect(){return new BPromise(function(_0xfe035e,_0xe988e3){return pm2[_0x8001('0x3')](function(_0x2607fe){if(_0x2607fe){return _0xe988e3(_0x2607fe);}return _0xfe035e('connected');});});};exports[_0x8001('0x4')]=function(_0x45405e){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0xfb7b8b,_0x56a5a1){return pm2[_0x8001('0x4')](_0x45405e,function(_0x262be6,_0x4dee03){if(_0x262be6){return _0x56a5a1(_0x262be6);}pm2[_0x8001('0x6')]();return _0xfb7b8b(_0x4dee03);});});});};exports[_0x8001('0x7')]=function(_0x32451a){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x3fac2f,_0x922b0c){return pm2[_0x8001('0x7')](_0x32451a,function(_0x555d0e,_0x51e5a3){if(_0x555d0e){return _0x922b0c(_0x555d0e);}pm2[_0x8001('0x6')]();return _0x3fac2f(_0x51e5a3);});});});};exports[_0x8001('0x8')]=function(_0x80ec2f){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x1f224b,_0xd09c9d){return pm2['restart'](_0x80ec2f,function(_0x363600,_0x327c09){if(_0x363600){return _0xd09c9d(_0x363600);}pm2[_0x8001('0x6')]();return _0x1f224b(_0x327c09);});});});};exports[_0x8001('0x9')]=function(){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x1137a6,_0xe5c996){return pm2['list'](function(_0x371c5d,_0x192b44){if(_0x371c5d){return _0xe5c996(_0x371c5d);}pm2[_0x8001('0x6')]();return _0x1137a6(_0x192b44);});});});};exports[_0x8001('0xa')]=function(_0x2702ee){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x5b87df,_0x1e47a7){return pm2[_0x8001('0xa')](_0x2702ee,function(_0x22a9c0,_0x1cf675){if(_0x22a9c0){return _0x1e47a7(_0x22a9c0);}pm2['disconnect']();return _0x5b87df(_0x1cf675);});});});};exports[_0x8001('0xb')]=function(_0x2e1cb8){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x27ac9a,_0x4c5c73){return pm2['delete'](_0x2e1cb8,function(_0x1b5a15,_0x20c424){if(_0x1b5a15){return _0x4c5c73(_0x1b5a15);}pm2['disconnect']();return _0x27ac9a(_0x20c424);});});});};exports[_0x8001('0xc')]=function(){return connect()[_0x8001('0x5')](function(){return new BPromise(function(_0x45a676,_0x122657){return pm2[_0x8001('0xc')](function(_0x54842f){if(_0x54842f){return _0x122657(_0x54842f);}return _0x45a676(_0x8001('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3fc2c9e..f52a155 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 _0x5a72=['chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','Setting','find','then'];(function(_0x52c52d,_0x209e15){var _0x1a9b68=function(_0x3eaa4b){while(--_0x3eaa4b){_0x52c52d['push'](_0x52c52d['shift']());}};_0x1a9b68(++_0x209e15);}(_0x5a72,0x103));var _0x25a7=function(_0x136269,_0x26c699){_0x136269=_0x136269-0x0;var _0x501dfe=_0x5a72[_0x136269];return _0x501dfe;};'use strict';var _=require(_0x25a7('0x0'));var moment=require(_0x25a7('0x1'));var Redis=require(_0x25a7('0x2'));var util=require(_0x25a7('0x3'));var config=require(_0x25a7('0x4'));var db=require(_0x25a7('0x5'))['db'];var logger=require('../logger')(_0x25a7('0x6'));config['redis']=_['defaults'](config[_0x25a7('0x7')],{'host':_0x25a7('0x8'),'port':0x18eb});var io=require(_0x25a7('0x9'))(new Redis(config[_0x25a7('0x7')]));function closeInteractions(){var _0x1ac2e7=0x0;var _0x3ca58a=[];return db[_0x25a7('0xa')][_0x25a7('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x25a7('0xc')](function(_0x5e54e6){_0x1ac2e7=_0x5e54e6[_0x25a7('0xd')];if(_0x1ac2e7){return db[_0x25a7('0xe')]['findAll']({'raw':!![],'attributes':['id',_0x25a7('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x25a7('0x10')](_0x5e54e6['chatTimeout'],_0x25a7('0x11'))}}});}else{return[];}})[_0x25a7('0xc')](function(_0xed04d5){if(_0xed04d5&&_0xed04d5[_0x25a7('0x12')]){_0x3ca58a=_[_0x25a7('0x13')](_0xed04d5||[],'id');logger[_0x25a7('0x14')](_0x25a7('0x15'),_0x3ca58a['join']());return db[_0x25a7('0xe')][_0x25a7('0x16')]({'closeReason':_0x25a7('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x25a7('0x18')](_0x25a7('0x19'))},{'where':{'id':_0x3ca58a}});}})[_0x25a7('0xc')](function(){if(_0x3ca58a&&_0x3ca58a['length']){logger[_0x25a7('0x14')](_0x25a7('0x1a'),_0x3ca58a[_0x25a7('0x1b')]());for(var _0x126bc6=0x0;_0x126bc6<_0x3ca58a[_0x25a7('0x12')];_0x126bc6++){io[_0x25a7('0x1c')](_0x25a7('0x1d'),{'id':_0x3ca58a[_0x126bc6],'closed':!![]});}}})[_0x25a7('0x1e')](function(_0x54bda0){logger['error'](_0x25a7('0x1f'),_0x54bda0?util[_0x25a7('0x20')](_0x54bda0,{'showHidden':![],'depth':null}):'');});}exports[_0x25a7('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x526a=['minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x4fae86,_0x27a5b8){var _0x5e1595=function(_0x3ba393){while(--_0x3ba393){_0x4fae86['push'](_0x4fae86['shift']());}};_0x5e1595(++_0x27a5b8);}(_0x526a,0xae));var _0xa526=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x526a[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xa526('0x0'));var moment=require(_0xa526('0x1'));var Redis=require('ioredis');var util=require(_0xa526('0x2'));var config=require(_0xa526('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xa526('0x4'))(_0xa526('0x5'));config[_0xa526('0x6')]=_[_0xa526('0x7')](config['redis'],{'host':_0xa526('0x8'),'port':0x18eb});var io=require(_0xa526('0x9'))(new Redis(config[_0xa526('0x6')]));function closeInteractions(){var _0x482746=0x0;var _0x30f5dd=[];return db[_0xa526('0xa')][_0xa526('0xb')]({'raw':!![],'attributes':['id',_0xa526('0xc')],'where':{'id':0x1}})[_0xa526('0xd')](function(_0x33da47){_0x482746=_0x33da47['chatTimeout'];if(_0x482746){return db[_0xa526('0xe')][_0xa526('0xf')]({'raw':!![],'attributes':['id',_0xa526('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa526('0x11')](_0x33da47[_0xa526('0xc')],_0xa526('0x12'))}}});}else{return[];}})[_0xa526('0xd')](function(_0x19ec88){if(_0x19ec88&&_0x19ec88['length']){_0x30f5dd=_['map'](_0x19ec88||[],'id');logger[_0xa526('0x13')](_0xa526('0x14'),_0x30f5dd[_0xa526('0x15')]());return db['ChatInteraction']['update']({'closeReason':_0xa526('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xa526('0x17')](_0xa526('0x18'))},{'where':{'id':_0x30f5dd}});}})['then'](function(){if(_0x30f5dd&&_0x30f5dd[_0xa526('0x19')]){logger[_0xa526('0x13')](_0xa526('0x1a'),_0x30f5dd['join']());for(var _0x308a00=0x0;_0x308a00<_0x30f5dd[_0xa526('0x19')];_0x308a00++){io['emit'](_0xa526('0x1b'),{'id':_0x30f5dd[_0x308a00],'closed':!![]});}}})['catch'](function(_0xe82b0f){logger[_0xa526('0x1c')](_0xa526('0x1d'),_0xe82b0f?util[_0xa526('0x1e')](_0xe82b0f,{'showHidden':![],'depth':null}):'');});}exports[_0xa526('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index e5b77ad..4dcb869 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 _0x7cb8=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1ea061,_0x2c572e){var _0x5057c0=function(_0xcc049f){while(--_0xcc049f){_0x1ea061['push'](_0x1ea061['shift']());}};_0x5057c0(++_0x2c572e);}(_0x7cb8,0x11b));var _0x87cb=function(_0x12485d,_0x4915f6){_0x12485d=_0x12485d-0x0;var _0x52a311=_0x7cb8[_0x12485d];return _0x52a311;};'use strict';function start(){var _0x2e7f19=require(_0x87cb('0x0'));return _0x2e7f19['startAllRefreshIntervals']();}module[_0x87cb('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x68b7=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x376a57,_0x4bb9c0){var _0x5bc933=function(_0x20ee5c){while(--_0x20ee5c){_0x376a57['push'](_0x376a57['shift']());}};_0x5bc933(++_0x4bb9c0);}(_0x68b7,0x7d));var _0x768b=function(_0x43d403,_0x1f8f86){_0x43d403=_0x43d403-0x0;var _0x1d34b2=_0x68b7[_0x43d403];return _0x1d34b2;};'use strict';function start(){var _0x36fd19=require(_0x768b('0x0'));return _0x36fd19[_0x768b('0x1')]();}module[_0x768b('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 25df599..9f7f2cd 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 _0x1e6b=['\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','run','util','path','lodash','moment','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','user','format'];(function(_0x481f99,_0x458b72){var _0x721d60=function(_0x42b5c3){while(--_0x42b5c3){_0x481f99['push'](_0x481f99['shift']());}};_0x721d60(++_0x458b72);}(_0x1e6b,0x181));var _0xb1e6=function(_0x43e8cd,_0x359cb9){_0x43e8cd=_0x43e8cd-0x0;var _0x14da96=_0x1e6b[_0x43e8cd];return _0x14da96;};'use strict';var fs=require('fs');var util=require(_0xb1e6('0x0'));var path=require(_0xb1e6('0x1'));var _=require(_0xb1e6('0x2'));var moment=require(_0xb1e6('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xb1e6('0x4'));var logger=require(_0xb1e6('0x5'))('schedule');var db=require(_0xb1e6('0x6'))['db'];var analyticCustomReportController=require(_0xb1e6('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xb1e6('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e3d46,_0x282ef7){return function(){logger[_0xb1e6('0x9')](_0xb1e6('0xa'),_0x1e3d46[_0xb1e6('0xb')]);var _0x41a8b4=!![];var _0xa851df={'tls':{'rejectUnauthorized':![]}};if(_0x1e3d46[_0xb1e6('0xc')]['Smtp'][_0xb1e6('0xd')]){_0xa851df[_0xb1e6('0xd')]=_0x1e3d46[_0xb1e6('0xc')][_0xb1e6('0xe')]['service'];}else{_0xa851df[_0xb1e6('0xf')]=_0x1e3d46[_0xb1e6('0xc')][_0xb1e6('0xe')][_0xb1e6('0xf')];_0xa851df[_0xb1e6('0x10')]=_0x1e3d46[_0xb1e6('0xc')][_0xb1e6('0xe')][_0xb1e6('0x10')];_0xa851df[_0xb1e6('0x11')]=_0x1e3d46[_0xb1e6('0xc')][_0xb1e6('0xe')]['secure'];}if(_0x1e3d46['MailAccount']['Smtp']['authentication']){_0xa851df['auth']={'user':_0x1e3d46[_0xb1e6('0xc')][_0xb1e6('0xe')][_0xb1e6('0x12')],'pass':_0x1e3d46[_0xb1e6('0xc')]['Smtp']['pass']};}var _0x25cc8c={'account':_0xa851df,'message':{'from':util[_0xb1e6('0x13')](_0xb1e6('0x14'),_0x1e3d46['MailAccount'][_0xb1e6('0x15')],_0x1e3d46['MailAccount'][_0xb1e6('0xb')]||_0x1e3d46['MailAccount'][_0xb1e6('0xe')][_0xb1e6('0x12')]),'to':_0x1e3d46[_0xb1e6('0xb')],'cc':_0x1e3d46['cc'],'bcc':_0x1e3d46[_0xb1e6('0x16')],'subject':util[_0xb1e6('0x13')](_0xb1e6('0x17'),_0x282ef7[_0xb1e6('0x15')],_0x1e3d46[_0xb1e6('0x18')],_0x1e3d46[_0xb1e6('0x19')])}};var _0x5ed00e=path[_0xb1e6('0x1a')](__dirname,_0xb1e6('0x1b'));var _0x448dad=_0x282ef7[_0xb1e6('0x1c')];var _0x391a55=util[_0xb1e6('0x13')](_0xb1e6('0x1d'),path['basename'](_0x282ef7[_0xb1e6('0x1c')],path[_0xb1e6('0x1e')](_0x282ef7[_0xb1e6('0x1c')])),_0xb1e6('0x1f'));var _0xbd446=path[_0xb1e6('0x1a')](_0x5ed00e,_0x448dad);var _0x96a3b5=path[_0xb1e6('0x1a')](_0x5ed00e,_0x391a55);if(fs['existsSync'](_0xbd446)){_0x282ef7['status']='Sent';_0x25cc8c[_0xb1e6('0x20')]['attachments']=[{'filename':_0x448dad,'path':_0xbd446}];_0x25cc8c[_0xb1e6('0x20')]['text']=util[_0xb1e6('0x13')](_0xb1e6('0x21'),JSON[_0xb1e6('0x22')](_0x282ef7,null,0x2));}else if(fs['existsSync'](_0x96a3b5)){_0x282ef7['status']='Sent';_0x25cc8c[_0xb1e6('0x20')]['attachments']=[{'filename':_0x391a55,'path':_0x96a3b5}];}else{_0x25cc8c[_0xb1e6('0x20')][_0xb1e6('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x1e3d46[_0xb1e6('0x24')]){_0x41a8b4=![];logger['info'](_0xb1e6('0x25'));}}if(_0x41a8b4){return client[_0xb1e6('0x26')](_0xb1e6('0x27'),_0x25cc8c)[_0xb1e6('0x28')](function(_0x124ba6){if(_0x124ba6[_0xb1e6('0x29')]){return logger[_0xb1e6('0x29')](_0xb1e6('0x2a'),JSON[_0xb1e6('0x22')](_0x124ba6));}return logger['info'](_0xb1e6('0x2b'));})[_0xb1e6('0x2c')](function(_0x4dea2c){return logger['error'](_0xb1e6('0x2a'),JSON[_0xb1e6('0x22')](_0x4dea2c));});}};}function handleError(){return function(_0x57b4a9){return logger['error'](JSON[_0xb1e6('0x22')](_0x57b4a9));};}function handleResult(_0x407999){return function(_0x342f12){logger[_0xb1e6('0x9')](_0xb1e6('0x2d'),JSON[_0xb1e6('0x22')](_0x342f12));if(_0x407999[_0xb1e6('0xc')]&&_0x407999[_0xb1e6('0xc')][_0xb1e6('0xe')]&&!_[_0xb1e6('0x2e')](_0x407999[_0xb1e6('0xb')])){setTimeout(handleSendEmail(_0x407999,_0x342f12),0x3c*0x3e8);}};}function handleJob(_0x3c11aa){return function(){try{if(_[_0xb1e6('0x2e')](_0x3c11aa[_0xb1e6('0x18')])){return logger[_0xb1e6('0x9')](_0xb1e6('0x2f'));}if(_[_0xb1e6('0x2e')](_0x3c11aa[_0xb1e6('0x19')])){return logger[_0xb1e6('0x9')](_0xb1e6('0x30'));}var _0x3c5f03={'startDate':moment()['subtract'](_0x3c11aa[_0xb1e6('0x18')],_0x3c11aa[_0xb1e6('0x19')])[_0xb1e6('0x13')](_0xb1e6('0x31')),'endDate':moment()[_0xb1e6('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb1e6('0x32'),'output':_0x3c11aa[_0xb1e6('0x33')],'name':_0x3c11aa[_0xb1e6('0x15')]};if(!_['isNil'](_0x3c11aa[_0xb1e6('0x34')])){logger[_0xb1e6('0x9')](_0xb1e6('0x35'),_0x3c11aa[_0xb1e6('0x34')]);return analyticDefaultReportController[_0xb1e6('0x36')]({'id':_0x3c11aa[_0xb1e6('0x34')]},_0x3c5f03)[_0xb1e6('0x28')](handleResult(_0x3c11aa))[_0xb1e6('0x2c')](handleError());}if(!_[_0xb1e6('0x2e')](_0x3c11aa[_0xb1e6('0x37')])){logger[_0xb1e6('0x9')]('exec\x20custom\x20report\x20id:%s',_0x3c11aa['CustomReportId']);return analyticCustomReportController[_0xb1e6('0x36')]({'id':_0x3c11aa['CustomReportId']},_0x3c5f03)[_0xb1e6('0x28')](handleResult(_0x3c11aa))['catch'](handleError());}}catch(_0x38ad0f){logger[_0xb1e6('0x29')](JSON[_0xb1e6('0x22')](_0x38ad0f));}return logger[_0xb1e6('0x9')](_0xb1e6('0x38'));};}function getJobs(_0x46e551){var _0x2be1ab={};if(_0x46e551){_0x2be1ab['id']=_0x46e551;}return db[_0xb1e6('0x39')]['findAll']({'where':_0x2be1ab,'include':[{'model':db[_0xb1e6('0xc')],'attributes':['id','name','email'],'include':[{'model':db[_0xb1e6('0x3a')],'as':_0xb1e6('0xe')}]}]})[_0xb1e6('0x28')](function(_0xe47336){var _0x383d68=_[_0xb1e6('0x3b')](manager[_0xb1e6('0x3c')]);var _0x3ca396=_[_0xb1e6('0x3d')](_0xe47336,function(_0x1a4863){return _0x1a4863['id'][_0xb1e6('0x3e')]();});var _0x2098ff=_[_0xb1e6('0x3f')](_0xe47336,function(_0x69f365){return _0x69f365['id']['toString']();});var _0x30106e=_0x46e551?_0x3ca396:_[_0xb1e6('0x40')](_0x3ca396,_0x383d68);var _0x5d47ff=_['intersection'](_0x3ca396,_0x383d68);var _0x15569d=_[_0xb1e6('0x40')](_0x383d68,_0x3ca396);var _0x23dae1;var _0x2e252d;for(_0x23dae1=0x0;_0x23dae1<_0x15569d[_0xb1e6('0x41')]&&!_0x46e551;_0x23dae1+=0x1){_0x2e252d=_0x15569d[_0x23dae1][_0xb1e6('0x3e')]();if(manager[_0xb1e6('0x42')](_0x2e252d)){manager[_0xb1e6('0x43')](_0x2e252d);manager[_0xb1e6('0x44')](_0x2e252d);logger[_0xb1e6('0x9')](_0xb1e6('0x45'),_0x2e252d);}}logger[_0xb1e6('0x9')]('toRun',JSON[_0xb1e6('0x22')](_0x30106e));for(_0x23dae1=0x0;_0x23dae1<_0x30106e[_0xb1e6('0x41')];_0x23dae1+=0x1){_0x2e252d=_0x30106e[_0x23dae1][_0xb1e6('0x3e')]();logger[_0xb1e6('0x9')](_0xb1e6('0x46'),_0x2e252d);if(_0x46e551){logger[_0xb1e6('0x9')](_0xb1e6('0x47'),_0x46e551);logger['info'](JSON['stringify'](_0x2098ff[_0x2e252d]));BPromise['resolve']()[_0xb1e6('0x28')](handleJob(_0x2098ff[_0x2e252d]));logger['info']('run\x20job',_0x2098ff[_0x2e252d][_0xb1e6('0x15')],_0x2098ff[_0x2e252d]['cron']);}else if(_0x2098ff[_0x2e252d][_0xb1e6('0x48')]&&_0x2098ff[_0x2e252d][_0xb1e6('0x49')]&&moment()[_0xb1e6('0x4a')](_0x2098ff[_0x2e252d][_0xb1e6('0x4b')],_0x2098ff[_0x2e252d][_0xb1e6('0x4c')])){manager['add'](_0x2e252d,_0x2098ff[_0x2e252d][_0xb1e6('0x48')],handleJob(_0x2098ff[_0x2e252d]));manager[_0xb1e6('0x4d')](_0x2e252d);logger[_0xb1e6('0x9')](_0xb1e6('0x4e'),_0x2098ff[_0x2e252d][_0xb1e6('0x15')],_0x2098ff[_0x2e252d][_0xb1e6('0x48')]);}else if(manager['exists'](_0x2e252d)){manager['stop'](_0x2e252d);manager[_0xb1e6('0x44')](_0x2e252d);logger[_0xb1e6('0x9')](_0xb1e6('0x4f'),_0x2098ff[_0x2e252d]['name'],_0x2098ff[_0x2e252d][_0xb1e6('0x48')]);}}for(_0x23dae1=0x0,_0x2e252d;_0x23dae1<_0x5d47ff[_0xb1e6('0x41')]&&!_0x46e551;_0x23dae1+=0x1){_0x2e252d=_0x5d47ff[_0x23dae1][_0xb1e6('0x3e')]();if(manager[_0xb1e6('0x42')](_0x2e252d)){if(_0x2098ff[_0x2e252d]['cron']&&_0x2098ff[_0x2e252d]['active']&&moment()[_0xb1e6('0x4a')](_0x2098ff[_0x2e252d][_0xb1e6('0x4b')],_0x2098ff[_0x2e252d][_0xb1e6('0x4c')])){manager['update'](_0x2e252d,_0x2098ff[_0x2e252d][_0xb1e6('0x48')],handleJob(_0x2098ff[_0x2e252d]));logger[_0xb1e6('0x9')]('update\x20cron',_0x2098ff[_0x2e252d][_0xb1e6('0x15')],_0x2098ff[_0x2e252d][_0xb1e6('0x48')]);}else{manager['stop'](_0x2e252d);manager[_0xb1e6('0x44')](_0x2e252d);logger[_0xb1e6('0x9')](_0xb1e6('0x4f'),_0x2098ff[_0x2e252d][_0xb1e6('0x15')],_0x2098ff[_0x2e252d][_0xb1e6('0x48')]);}}}})[_0xb1e6('0x2c')](function(_0x759c0e){logger['error'](JSON[_0xb1e6('0x22')](_0x759c0e));});}exports[_0xb1e6('0x50')]=function(_0x1c3295){return getJobs(_0x1c3295);};exports[_0xb1e6('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xba25=['findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','stop\x20cron','length','update','update\x20cron','run','path','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','user','pass','format','\x22%s\x22\x20<%s>','bcc','name','subtractNumber','subtractUnit','join','basename','savename','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xba25,0x1c1));var _0x5ba2=function(_0x2628c7,_0x57079d){_0x2628c7=_0x2628c7-0x0;var _0x2696a1=_0xba25[_0x2628c7];return _0x2696a1;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x5ba2('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x5ba2('0x1'));var BPromise=require(_0x5ba2('0x2'));var logger=require(_0x5ba2('0x3'))('schedule');var db=require(_0x5ba2('0x4'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x5ba2('0x5'));var client=jayson[_0x5ba2('0x6')][_0x5ba2('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50a082,_0x3affa6){return function(){logger[_0x5ba2('0x8')](_0x5ba2('0x9'),_0x50a082[_0x5ba2('0xa')]);var _0x187a68=!![];var _0x3575a6={'tls':{'rejectUnauthorized':![]}};if(_0x50a082[_0x5ba2('0xb')][_0x5ba2('0xc')][_0x5ba2('0xd')]){_0x3575a6[_0x5ba2('0xd')]=_0x50a082['MailAccount'][_0x5ba2('0xc')][_0x5ba2('0xd')];}else{_0x3575a6[_0x5ba2('0xe')]=_0x50a082[_0x5ba2('0xb')]['Smtp'][_0x5ba2('0xe')];_0x3575a6[_0x5ba2('0xf')]=_0x50a082[_0x5ba2('0xb')][_0x5ba2('0xc')][_0x5ba2('0xf')];_0x3575a6[_0x5ba2('0x10')]=_0x50a082['MailAccount'][_0x5ba2('0xc')][_0x5ba2('0x10')];}if(_0x50a082[_0x5ba2('0xb')][_0x5ba2('0xc')]['authentication']){_0x3575a6['auth']={'user':_0x50a082[_0x5ba2('0xb')][_0x5ba2('0xc')][_0x5ba2('0x11')],'pass':_0x50a082[_0x5ba2('0xb')]['Smtp'][_0x5ba2('0x12')]};}var _0x598d63={'account':_0x3575a6,'message':{'from':util[_0x5ba2('0x13')](_0x5ba2('0x14'),_0x50a082[_0x5ba2('0xb')]['name'],_0x50a082[_0x5ba2('0xb')][_0x5ba2('0xa')]||_0x50a082['MailAccount'][_0x5ba2('0xc')][_0x5ba2('0x11')]),'to':_0x50a082[_0x5ba2('0xa')],'cc':_0x50a082['cc'],'bcc':_0x50a082[_0x5ba2('0x15')],'subject':util[_0x5ba2('0x13')]('Report\x20%s\x20last\x20%s\x20%s',_0x3affa6[_0x5ba2('0x16')],_0x50a082[_0x5ba2('0x17')],_0x50a082[_0x5ba2('0x18')])}};var _0x1a4ca2=path[_0x5ba2('0x19')](__dirname,'../../files/reports');var _0x50c10f=_0x3affa6['savename'];var _0x38deee=util[_0x5ba2('0x13')]('%s.%s',path[_0x5ba2('0x1a')](_0x3affa6[_0x5ba2('0x1b')],path['extname'](_0x3affa6['savename'])),_0x5ba2('0x1c'));var _0x38a671=path[_0x5ba2('0x19')](_0x1a4ca2,_0x50c10f);var _0x18e6cf=path[_0x5ba2('0x19')](_0x1a4ca2,_0x38deee);if(fs['existsSync'](_0x38a671)){_0x3affa6[_0x5ba2('0x1d')]=_0x5ba2('0x1e');_0x598d63[_0x5ba2('0x1f')][_0x5ba2('0x20')]=[{'filename':_0x50c10f,'path':_0x38a671}];_0x598d63[_0x5ba2('0x1f')][_0x5ba2('0x21')]=util['format'](_0x5ba2('0x22'),JSON[_0x5ba2('0x23')](_0x3affa6,null,0x2));}else if(fs['existsSync'](_0x18e6cf)){_0x3affa6[_0x5ba2('0x1d')]='Sent';_0x598d63[_0x5ba2('0x1f')][_0x5ba2('0x20')]=[{'filename':_0x38deee,'path':_0x18e6cf}];}else{_0x598d63['message']['text']=_0x5ba2('0x24');if(!_0x50a082['sendIfEmpty']){_0x187a68=![];logger[_0x5ba2('0x8')](_0x5ba2('0x25'));}}if(_0x187a68){return client['request'](_0x5ba2('0x26'),_0x598d63)[_0x5ba2('0x27')](function(_0x171a35){if(_0x171a35['error']){return logger[_0x5ba2('0x28')](_0x5ba2('0x29'),JSON[_0x5ba2('0x23')](_0x171a35));}return logger[_0x5ba2('0x8')](_0x5ba2('0x2a'));})[_0x5ba2('0x2b')](function(_0x2869d3){return logger[_0x5ba2('0x28')]('error\x20mail',JSON[_0x5ba2('0x23')](_0x2869d3));});}};}function handleError(){return function(_0x498147){return logger[_0x5ba2('0x28')](JSON[_0x5ba2('0x23')](_0x498147));};}function handleResult(_0xffaf61){return function(_0x6f91c2){logger[_0x5ba2('0x8')]('data',JSON['stringify'](_0x6f91c2));if(_0xffaf61[_0x5ba2('0xb')]&&_0xffaf61[_0x5ba2('0xb')][_0x5ba2('0xc')]&&!_[_0x5ba2('0x2c')](_0xffaf61[_0x5ba2('0xa')])){setTimeout(handleSendEmail(_0xffaf61,_0x6f91c2),0x3c*0x3e8);}};}function handleJob(_0x41937c){return function(){try{if(_[_0x5ba2('0x2c')](_0x41937c[_0x5ba2('0x17')])){return logger[_0x5ba2('0x8')](_0x5ba2('0x2d'));}if(_[_0x5ba2('0x2c')](_0x41937c[_0x5ba2('0x18')])){return logger['info'](_0x5ba2('0x2e'));}var _0x206dc3={'startDate':moment()[_0x5ba2('0x2f')](_0x41937c['subtractNumber'],_0x41937c[_0x5ba2('0x18')])['format'](_0x5ba2('0x30')),'endDate':moment()[_0x5ba2('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5ba2('0x31'),'output':_0x41937c['output'],'name':_0x41937c[_0x5ba2('0x16')]};if(!_['isNil'](_0x41937c[_0x5ba2('0x32')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x41937c[_0x5ba2('0x32')]);return analyticDefaultReportController[_0x5ba2('0x33')]({'id':_0x41937c[_0x5ba2('0x32')]},_0x206dc3)[_0x5ba2('0x27')](handleResult(_0x41937c))[_0x5ba2('0x2b')](handleError());}if(!_[_0x5ba2('0x2c')](_0x41937c['CustomReportId'])){logger['info'](_0x5ba2('0x34'),_0x41937c[_0x5ba2('0x35')]);return analyticCustomReportController[_0x5ba2('0x33')]({'id':_0x41937c['CustomReportId']},_0x206dc3)[_0x5ba2('0x27')](handleResult(_0x41937c))[_0x5ba2('0x2b')](handleError());}}catch(_0x25ea25){logger[_0x5ba2('0x28')](JSON[_0x5ba2('0x23')](_0x25ea25));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x228d08){var _0x43adb1={};if(_0x228d08){_0x43adb1['id']=_0x228d08;}return db[_0x5ba2('0x36')][_0x5ba2('0x37')]({'where':_0x43adb1,'include':[{'model':db[_0x5ba2('0xb')],'attributes':['id',_0x5ba2('0x16'),_0x5ba2('0xa')],'include':[{'model':db[_0x5ba2('0x38')],'as':_0x5ba2('0xc')}]}]})[_0x5ba2('0x27')](function(_0x149d9e){var _0x1ca50e=_[_0x5ba2('0x39')](manager[_0x5ba2('0x3a')]);var _0x14217d=_[_0x5ba2('0x3b')](_0x149d9e,function(_0x24fe2a){return _0x24fe2a['id'][_0x5ba2('0x3c')]();});var _0x2fb7c0=_[_0x5ba2('0x3d')](_0x149d9e,function(_0x350591){return _0x350591['id'][_0x5ba2('0x3c')]();});var _0x1fbf8f=_0x228d08?_0x14217d:_[_0x5ba2('0x3e')](_0x14217d,_0x1ca50e);var _0x4dfe17=_[_0x5ba2('0x3f')](_0x14217d,_0x1ca50e);var _0x7212c4=_[_0x5ba2('0x3e')](_0x1ca50e,_0x14217d);var _0x5cce0e;var _0x493b3d;for(_0x5cce0e=0x0;_0x5cce0e<_0x7212c4['length']&&!_0x228d08;_0x5cce0e+=0x1){_0x493b3d=_0x7212c4[_0x5cce0e][_0x5ba2('0x3c')]();if(manager[_0x5ba2('0x40')](_0x493b3d)){manager[_0x5ba2('0x41')](_0x493b3d);manager[_0x5ba2('0x42')](_0x493b3d);logger[_0x5ba2('0x8')](_0x5ba2('0x43'),_0x493b3d);}}logger[_0x5ba2('0x8')](_0x5ba2('0x44'),JSON[_0x5ba2('0x23')](_0x1fbf8f));for(_0x5cce0e=0x0;_0x5cce0e<_0x1fbf8f['length'];_0x5cce0e+=0x1){_0x493b3d=_0x1fbf8f[_0x5cce0e][_0x5ba2('0x3c')]();logger[_0x5ba2('0x8')](_0x5ba2('0x45'),_0x493b3d);if(_0x228d08){logger[_0x5ba2('0x8')](_0x5ba2('0x46'),_0x228d08);logger['info'](JSON['stringify'](_0x2fb7c0[_0x493b3d]));BPromise[_0x5ba2('0x47')]()[_0x5ba2('0x27')](handleJob(_0x2fb7c0[_0x493b3d]));logger[_0x5ba2('0x8')](_0x5ba2('0x48'),_0x2fb7c0[_0x493b3d][_0x5ba2('0x16')],_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')]);}else if(_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')]&&_0x2fb7c0[_0x493b3d][_0x5ba2('0x4a')]&&moment()[_0x5ba2('0x4b')](_0x2fb7c0[_0x493b3d][_0x5ba2('0x4c')],_0x2fb7c0[_0x493b3d]['endAt'])){manager[_0x5ba2('0x4d')](_0x493b3d,_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')],handleJob(_0x2fb7c0[_0x493b3d]));manager[_0x5ba2('0x4e')](_0x493b3d);logger[_0x5ba2('0x8')]('add\x20cron',_0x2fb7c0[_0x493b3d]['name'],_0x2fb7c0[_0x493b3d]['cron']);}else if(manager[_0x5ba2('0x40')](_0x493b3d)){manager[_0x5ba2('0x41')](_0x493b3d);manager[_0x5ba2('0x42')](_0x493b3d);logger[_0x5ba2('0x8')](_0x5ba2('0x4f'),_0x2fb7c0[_0x493b3d][_0x5ba2('0x16')],_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')]);}}for(_0x5cce0e=0x0,_0x493b3d;_0x5cce0e<_0x4dfe17[_0x5ba2('0x50')]&&!_0x228d08;_0x5cce0e+=0x1){_0x493b3d=_0x4dfe17[_0x5cce0e]['toString']();if(manager[_0x5ba2('0x40')](_0x493b3d)){if(_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')]&&_0x2fb7c0[_0x493b3d]['active']&&moment()['isBetween'](_0x2fb7c0[_0x493b3d][_0x5ba2('0x4c')],_0x2fb7c0[_0x493b3d]['endAt'])){manager[_0x5ba2('0x51')](_0x493b3d,_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')],handleJob(_0x2fb7c0[_0x493b3d]));logger[_0x5ba2('0x8')](_0x5ba2('0x52'),_0x2fb7c0[_0x493b3d][_0x5ba2('0x16')],_0x2fb7c0[_0x493b3d][_0x5ba2('0x49')]);}else{manager['stop'](_0x493b3d);manager[_0x5ba2('0x42')](_0x493b3d);logger[_0x5ba2('0x8')]('stop\x20cron',_0x2fb7c0[_0x493b3d][_0x5ba2('0x16')],_0x2fb7c0[_0x493b3d]['cron']);}}}})['catch'](function(_0x13f254){logger['error'](JSON[_0x5ba2('0x23')](_0x13f254));});}exports[_0x5ba2('0x53')]=function(_0x2edf44){return getJobs(_0x2edf44);};exports[_0x5ba2('0x4e')]=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 90da8c6..23a0a2b 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 _0x56dc=['Cloud\x20Provider\x20not\x20configured','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','inspect','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','ValidationError','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};var _=require(_0xc56d('0x0'));var AWS=require('aws-sdk');var rp=require(_0xc56d('0x1'));var util=require(_0xc56d('0x2'));var BPromise=require(_0xc56d('0x3'));var db=require(_0xc56d('0x4'))['db'];var logger=require(_0xc56d('0x5'))('transcribe');function getTranscriptionJob(_0x2ffdfe,_0x2e7620,_0x289bb7,_0x464c0a){return new Promise(function(_0x3eb4ed,_0x3e68f4){var _0x571341=new AWS[(_0xc56d('0x6'))]({'accessKeyId':_0x2e7620,'secretAccessKey':_0x2ffdfe,'region':_0x289bb7});_0x571341[_0xc56d('0x7')]({'TranscriptionJobName':_0x464c0a},function(_0x3ac7cd,_0x51ca01){if(_0x3ac7cd){return _0x3e68f4(_0x3ac7cd);}else{return _0x3eb4ed(_0x51ca01);}});});}function sentiment(_0x146dc4,_0x1043f9,_0x3ff2cb,_0x1df34e,_0x3a6456){return new Promise(function(_0x544cef,_0x3bfd34){var _0x2d459d=new AWS[(_0xc56d('0x8'))]({'accessKeyId':_0x1043f9,'secretAccessKey':_0x146dc4,'region':_0x3ff2cb});_0x2d459d['detectSentiment']({'Text':_0x1df34e,'LanguageCode':_0x3a6456[_0xc56d('0x9')](0x0,0x2)},function(_0x2eeb7d,_0x247cea){if(_0x2eeb7d){return _0x3bfd34(_0x2eeb7d);}else{return _0x544cef(_0x247cea);}});});}function checkTranscribeJob(_0x14b82e,_0x585ca5,_0xf82e05){var _0x2f120a;return new BPromise(function(_0x26744e,_0x4b60cd){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0xc'),_0x14b82e['id'],_0x14b82e[_0xc56d('0xd')]));return getTranscriptionJob(_0xf82e05['data1'],_0xf82e05[_0xc56d('0xe')],_0x585ca5[_0xc56d('0xf')],_0x14b82e['transcribeName'])['then'](function(_0x259967){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x10'),_0x14b82e['id'],_0x14b82e['transcribeName'],_0x259967[_0xc56d('0x11')]['TranscriptionJobStatus']));if(!_0x14b82e[_0xc56d('0x12')]){switch(_0x259967[_0xc56d('0x11')]['TranscriptionJobStatus']){case _0xc56d('0x13'):var _0x22f20a={'transcribeStatus':_0x259967[_0xc56d('0x11')][_0xc56d('0x14')],'fileUri':_0x259967[_0xc56d('0x11')]['Transcript'][_0xc56d('0x15')]};logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x16'),_0x14b82e['id']));return rp({'uri':_0x259967['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0xc56d('0x17')](function(_0x1c9a1c){logger[_0xc56d('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x14b82e['id']));if(_0x1c9a1c&&_0x1c9a1c[_0xc56d('0x18')]&&_0x1c9a1c[_0xc56d('0x18')]['transcripts']&&_0x1c9a1c[_0xc56d('0x18')][_0xc56d('0x19')][_0xc56d('0x1a')]){_0x22f20a[_0xc56d('0x12')]='';for(var _0x527929=0x0;_0x527929<_0x1c9a1c['results'][_0xc56d('0x19')][_0xc56d('0x1a')];_0x527929++){_0x22f20a['fileText']+=_0x1c9a1c[_0xc56d('0x18')][_0xc56d('0x19')][_0x527929][_0xc56d('0x1b')]+'';}}return _0x14b82e['update'](_0x22f20a);})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));if(!_0x14b82e[_0xc56d('0x1d')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x1f'));}if(!_0x585ca5['sentiment']||!_0x585ca5[_0xc56d('0x20')]||!_0x585ca5[_0xc56d('0x21')]||!_0x585ca5[_0xc56d('0x22')]||!_0x585ca5[_0xc56d('0x23')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x24'));}if(!_0x22f20a['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x585ca5['sentimentAccountId']===_0xf82e05['id']){return _0xf82e05;}else{return db[_0xc56d('0x25')]['findOne']({'where':{'id':_settings[_0xc56d('0x20')]}});}})[_0xc56d('0x17')](function(_0x32d057){if(!_0x32d057){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0x32d057[_0xc56d('0x28')]||!_0x32d057[_0xc56d('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2f120a=_0x32d057;logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x29'),_0x14b82e['id']));return sentiment(_0x2f120a[_0xc56d('0x28')],_0x2f120a[_0xc56d('0xe')],_0x585ca5['sentimentRegion'],_0x22f20a[_0xc56d('0x12')],_0x585ca5[_0xc56d('0x22')]);})[_0xc56d('0x17')](function(_0x3f1b42){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x2a'),_0x14b82e['id']));return _0x14b82e['update']({'sentiment':_0x3f1b42[_0xc56d('0x2b')],'sPositive':_0x3f1b42['SentimentScore'][_0xc56d('0x2c')],'sNegative':_0x3f1b42[_0xc56d('0x2d')]['Negative'],'sMixed':_0x3f1b42[_0xc56d('0x2d')][_0xc56d('0x2e')],'sNeutral':_0x3f1b42[_0xc56d('0x2d')][_0xc56d('0x2f')]});})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});case _0xc56d('0x30'):return _0x14b82e[_0xc56d('0x31')]({'transcribeStatus':_0xc56d('0x30'),'failureReason':_0x259967[_0xc56d('0x11')][_0xc56d('0x32')]})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});default:logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x33'),_0x14b82e['id']));break;}}else{return BPromise[_0xc56d('0x34')]()[_0xc56d('0x17')](function(){if(!_0x14b82e[_0xc56d('0x1d')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x1f'));}if(!_0x585ca5[_0xc56d('0x35')]||!_0x585ca5[_0xc56d('0x20')]||!_0x585ca5[_0xc56d('0x21')]||!_0x585ca5['language']||!_0x585ca5[_0xc56d('0x23')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x14b82e['fileText']){throw new Error(_0xc56d('0x36'));}if(_0x585ca5['sentimentAccountId']===_0xf82e05['id']){return _0xf82e05;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1bb678){if(!_0x1bb678){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0x1bb678[_0xc56d('0x28')]||!_0x1bb678[_0xc56d('0xe')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x37'));}_0x2f120a=_0x1bb678;logger[_0xc56d('0xa')](util['format'](_0xc56d('0x29'),_0x14b82e['id']));return sentiment(_0x2f120a[_0xc56d('0x28')],_0x2f120a[_0xc56d('0xe')],_0x585ca5['sentimentRegion'],_0x14b82e[_0xc56d('0x12')],_0x585ca5[_0xc56d('0x22')]);})[_0xc56d('0x17')](function(_0x12e5c2){logger[_0xc56d('0xa')](util[_0xc56d('0xb')](_0xc56d('0x2a'),_0x14b82e['id']));return _0x14b82e[_0xc56d('0x31')]({'sentiment':_0x12e5c2['Sentiment'],'sPositive':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x2c')],'sNegative':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x38')],'sMixed':_0x12e5c2[_0xc56d('0x2d')][_0xc56d('0x2e')],'sNeutral':_0x12e5c2[_0xc56d('0x2d')]['Neutral'],'transcribeStatus':_0xc56d('0x13')});})[_0xc56d('0x17')](function(){logger[_0xc56d('0xa')](util['format'](_0xc56d('0x1c'),_0x14b82e['id']));_0x26744e();});}})[_0xc56d('0x39')](function(_0x2b79b7){if(_0x2b79b7){if(!_0x2b79b7[_0xc56d('0x3a')]||_0x2b79b7[_0xc56d('0x3a')]!==_0xc56d('0x3b')){logger[_0xc56d('0x3c')](util['format'](_0xc56d('0x3d'),_0x14b82e['id']),util['inspect'](_0x2b79b7,{'showHidden':![],'depth':null}));}}_0x26744e();});});}function checkTranscribe(){var _0x3ed7b9;var _0x3d39ee;var _0x5280d1;return db[_0xc56d('0x3e')][_0xc56d('0x3f')]({'where':{'transcribeStatus':_0xc56d('0x40')}})['then'](function(_0x21e643){if(!_0x21e643||!_0x21e643[_0xc56d('0x1a')]){throw new db[(_0xc56d('0x1e'))]['ValidationError'](_0xc56d('0x41'));}_0x3ed7b9=_0x21e643;return db[_0xc56d('0x42')][_0xc56d('0x43')]({'where':{'id':0x1}});})[_0xc56d('0x17')](function(_0x4451a5){if(!_0x4451a5){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x44'));}_0x3d39ee=_0x4451a5;if(!_0x3d39ee[_0xc56d('0x45')]||!_0x3d39ee[_0xc56d('0x46')]||!_0x3d39ee[_0xc56d('0xf')]||!_0x3d39ee[_0xc56d('0x22')]||!_0x3d39ee['bucket']){throw new db['Sequelize'][(_0xc56d('0x26'))](_0xc56d('0x47'));}return db[_0xc56d('0x25')][_0xc56d('0x43')]({'where':{'id':_0x3d39ee['transcribeAccountId']}});})[_0xc56d('0x17')](function(_0xa54d26){if(!_0xa54d26){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))](_0xc56d('0x27'));}if(!_0xa54d26['data1']||!_0xa54d26[_0xc56d('0xe')]){throw new db[(_0xc56d('0x1e'))][(_0xc56d('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x5280d1=_0xa54d26;var _0x1f2bd7=[];_0x3ed7b9[_0xc56d('0x48')](function(_0x4f6d64){_0x1f2bd7[_0xc56d('0x49')](checkTranscribeJob(_0x4f6d64,_0x3d39ee,_0x5280d1));});return BPromise[_0xc56d('0x4a')](_0x1f2bd7);})[_0xc56d('0x39')](function(_0x4bb37c){if(_0x4bb37c){if(!_0x4bb37c[_0xc56d('0x3a')]||_0x4bb37c[_0xc56d('0x3a')]!==_0xc56d('0x3b')){logger[_0xc56d('0x3c')](util[_0xc56d('0x4b')](_0x4bb37c,{'showHidden':![],'depth':null}));}}});}exports[_0xc56d('0x4c')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xef38=['util','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','sentimentAccountId','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','Negative','Mixed','SentimentScore','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','aws-sdk','request-promise'];(function(_0x2d1a4e,_0xfbb7c6){var _0x15ec47=function(_0x358edb){while(--_0x358edb){_0x2d1a4e['push'](_0x2d1a4e['shift']());}};_0x15ec47(++_0xfbb7c6);}(_0xef38,0x122));var _0x8ef3=function(_0xaf09c2,_0x1b997a){_0xaf09c2=_0xaf09c2-0x0;var _0x58ce9e=_0xef38[_0xaf09c2];return _0x58ce9e;};var _=require('lodash');var AWS=require(_0x8ef3('0x0'));var rp=require(_0x8ef3('0x1'));var util=require(_0x8ef3('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x8ef3('0x3'))(_0x8ef3('0x4'));function getTranscriptionJob(_0x1966e7,_0x38a671,_0x86b30,_0x5d2783){return new Promise(function(_0x142b71,_0x25d6ca){var _0x50ee13=new AWS[(_0x8ef3('0x5'))]({'accessKeyId':_0x38a671,'secretAccessKey':_0x1966e7,'region':_0x86b30});_0x50ee13[_0x8ef3('0x6')]({'TranscriptionJobName':_0x5d2783},function(_0x217874,_0x12b6c0){if(_0x217874){return _0x25d6ca(_0x217874);}else{return _0x142b71(_0x12b6c0);}});});}function sentiment(_0x2cdf8a,_0x2367d2,_0xc4b3b3,_0x48d639,_0x3c4d82){return new Promise(function(_0x23533d,_0x13a559){var _0x37825a=new AWS[(_0x8ef3('0x7'))]({'accessKeyId':_0x2367d2,'secretAccessKey':_0x2cdf8a,'region':_0xc4b3b3});_0x37825a[_0x8ef3('0x8')]({'Text':_0x48d639,'LanguageCode':_0x3c4d82[_0x8ef3('0x9')](0x0,0x2)},function(_0x13bd18,_0x60b595){if(_0x13bd18){return _0x13a559(_0x13bd18);}else{return _0x23533d(_0x60b595);}});});}function checkTranscribeJob(_0xd26f60,_0x1cf33a,_0x451cfe){var _0x6fea77;return new BPromise(function(_0x3902fb,_0x4778e8){logger[_0x8ef3('0xa')](util[_0x8ef3('0xb')](_0x8ef3('0xc'),_0xd26f60['id'],_0xd26f60[_0x8ef3('0xd')]));return getTranscriptionJob(_0x451cfe['data1'],_0x451cfe[_0x8ef3('0xe')],_0x1cf33a['transcribeRegion'],_0xd26f60[_0x8ef3('0xd')])['then'](function(_0x22feec){logger[_0x8ef3('0xa')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xd26f60['id'],_0xd26f60[_0x8ef3('0xd')],_0x22feec[_0x8ef3('0xf')][_0x8ef3('0x10')]));if(!_0xd26f60[_0x8ef3('0x11')]){switch(_0x22feec['TranscriptionJob']['TranscriptionJobStatus']){case _0x8ef3('0x12'):var _0x65e9f2={'transcribeStatus':_0x22feec[_0x8ef3('0xf')][_0x8ef3('0x10')],'fileUri':_0x22feec['TranscriptionJob'][_0x8ef3('0x13')][_0x8ef3('0x14')]};logger[_0x8ef3('0xa')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xd26f60['id']));return rp({'uri':_0x22feec[_0x8ef3('0xf')][_0x8ef3('0x13')][_0x8ef3('0x14')],'json':!![]})[_0x8ef3('0x15')](function(_0x15825e){logger[_0x8ef3('0xa')](util[_0x8ef3('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xd26f60['id']));if(_0x15825e&&_0x15825e[_0x8ef3('0x16')]&&_0x15825e[_0x8ef3('0x16')]['transcripts']&&_0x15825e[_0x8ef3('0x16')][_0x8ef3('0x17')][_0x8ef3('0x18')]){_0x65e9f2[_0x8ef3('0x11')]='';for(var _0x7d8a6c=0x0;_0x7d8a6c<_0x15825e['results'][_0x8ef3('0x17')][_0x8ef3('0x18')];_0x7d8a6c++){_0x65e9f2[_0x8ef3('0x11')]+=_0x15825e[_0x8ef3('0x16')]['transcripts'][_0x7d8a6c][_0x8ef3('0x19')]+'';}}return _0xd26f60[_0x8ef3('0x1a')](_0x65e9f2);})[_0x8ef3('0x15')](function(){logger[_0x8ef3('0xa')](util[_0x8ef3('0xb')](_0x8ef3('0x1b'),_0xd26f60['id']));if(!_0xd26f60[_0x8ef3('0x1c')]){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x1f'));}if(!_0x1cf33a[_0x8ef3('0x20')]||!_0x1cf33a['sentimentAccountId']||!_0x1cf33a[_0x8ef3('0x21')]||!_0x1cf33a[_0x8ef3('0x22')]||!_0x1cf33a[_0x8ef3('0x23')]){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x24'));}if(!_0x65e9f2[_0x8ef3('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x1cf33a['sentimentAccountId']===_0x451cfe['id']){return _0x451cfe;}else{return db[_0x8ef3('0x25')]['findOne']({'where':{'id':_settings[_0x8ef3('0x26')]}});}})[_0x8ef3('0x15')](function(_0x442ed2){if(!_0x442ed2){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x442ed2['data1']||!_0x442ed2['data2']){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x27'));}_0x6fea77=_0x442ed2;logger['info'](util[_0x8ef3('0xb')](_0x8ef3('0x28'),_0xd26f60['id']));return sentiment(_0x6fea77['data1'],_0x6fea77[_0x8ef3('0xe')],_0x1cf33a[_0x8ef3('0x21')],_0x65e9f2[_0x8ef3('0x11')],_0x1cf33a['language']);})[_0x8ef3('0x15')](function(_0x55aeee){logger[_0x8ef3('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xd26f60['id']));return _0xd26f60['update']({'sentiment':_0x55aeee['Sentiment'],'sPositive':_0x55aeee['SentimentScore'][_0x8ef3('0x29')],'sNegative':_0x55aeee['SentimentScore'][_0x8ef3('0x2a')],'sMixed':_0x55aeee['SentimentScore'][_0x8ef3('0x2b')],'sNeutral':_0x55aeee[_0x8ef3('0x2c')][_0x8ef3('0x2d')]});})['then'](function(){logger['info'](util[_0x8ef3('0xb')](_0x8ef3('0x1b'),_0xd26f60['id']));_0x3902fb();});case _0x8ef3('0x2e'):return _0xd26f60[_0x8ef3('0x1a')]({'transcribeStatus':_0x8ef3('0x2e'),'failureReason':_0x22feec['TranscriptionJob'][_0x8ef3('0x2f')]})[_0x8ef3('0x15')](function(){logger[_0x8ef3('0xa')](util['format'](_0x8ef3('0x1b'),_0xd26f60['id']));_0x3902fb();});default:logger['info'](util[_0x8ef3('0xb')](_0x8ef3('0x30'),_0xd26f60['id']));break;}}else{return BPromise[_0x8ef3('0x31')]()[_0x8ef3('0x15')](function(){if(!_0xd26f60['tempSentiment']){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1cf33a[_0x8ef3('0x20')]||!_0x1cf33a[_0x8ef3('0x26')]||!_0x1cf33a[_0x8ef3('0x21')]||!_0x1cf33a[_0x8ef3('0x22')]||!_0x1cf33a[_0x8ef3('0x23')]){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x24'));}if(!_0xd26f60['fileText']){throw new Error(_0x8ef3('0x32'));}if(_0x1cf33a[_0x8ef3('0x26')]===_0x451cfe['id']){return _0x451cfe;}else{return db[_0x8ef3('0x25')][_0x8ef3('0x33')]({'where':{'id':_settings[_0x8ef3('0x26')]}});}})['then'](function(_0x454beb){if(!_0x454beb){throw new db['Sequelize'][(_0x8ef3('0x1e'))](_0x8ef3('0x34'));}if(!_0x454beb[_0x8ef3('0x35')]||!_0x454beb[_0x8ef3('0xe')]){throw new db['Sequelize']['ValidationError'](_0x8ef3('0x27'));}_0x6fea77=_0x454beb;logger['info'](util[_0x8ef3('0xb')](_0x8ef3('0x28'),_0xd26f60['id']));return sentiment(_0x6fea77[_0x8ef3('0x35')],_0x6fea77[_0x8ef3('0xe')],_0x1cf33a['sentimentRegion'],_0xd26f60[_0x8ef3('0x11')],_0x1cf33a[_0x8ef3('0x22')]);})[_0x8ef3('0x15')](function(_0x1ac8d2){logger[_0x8ef3('0xa')](util['format'](_0x8ef3('0x36'),_0xd26f60['id']));return _0xd26f60['update']({'sentiment':_0x1ac8d2[_0x8ef3('0x37')],'sPositive':_0x1ac8d2[_0x8ef3('0x2c')][_0x8ef3('0x29')],'sNegative':_0x1ac8d2['SentimentScore'][_0x8ef3('0x2a')],'sMixed':_0x1ac8d2[_0x8ef3('0x2c')][_0x8ef3('0x2b')],'sNeutral':_0x1ac8d2['SentimentScore'][_0x8ef3('0x2d')],'transcribeStatus':_0x8ef3('0x12')});})[_0x8ef3('0x15')](function(){logger['info'](util[_0x8ef3('0xb')](_0x8ef3('0x1b'),_0xd26f60['id']));_0x3902fb();});}})['catch'](function(_0x55a55d){if(_0x55a55d){if(!_0x55a55d[_0x8ef3('0x38')]||_0x55a55d[_0x8ef3('0x38')]!==_0x8ef3('0x39')){logger[_0x8ef3('0x3a')](util['format'](_0x8ef3('0x3b'),_0xd26f60['id']),util[_0x8ef3('0x3c')](_0x55a55d,{'showHidden':![],'depth':null}));}}_0x3902fb();});});}function checkTranscribe(){var _0x309ea1;var _0x56ce02;var _0x14f83b;return db[_0x8ef3('0x3d')][_0x8ef3('0x3e')]({'where':{'transcribeStatus':_0x8ef3('0x3f')}})[_0x8ef3('0x15')](function(_0x208fbd){if(!_0x208fbd||!_0x208fbd[_0x8ef3('0x18')]){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x40'));}_0x309ea1=_0x208fbd;return db[_0x8ef3('0x41')][_0x8ef3('0x33')]({'where':{'id':0x1}});})['then'](function(_0xf85b28){if(!_0xf85b28){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x42'));}_0x56ce02=_0xf85b28;if(!_0x56ce02['transcribe']||!_0x56ce02[_0x8ef3('0x43')]||!_0x56ce02['transcribeRegion']||!_0x56ce02['language']||!_0x56ce02[_0x8ef3('0x23')]){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x44'));}return db[_0x8ef3('0x25')][_0x8ef3('0x33')]({'where':{'id':_0x56ce02[_0x8ef3('0x43')]}});})[_0x8ef3('0x15')](function(_0x344d74){if(!_0x344d74){throw new db[(_0x8ef3('0x1d'))][(_0x8ef3('0x1e'))](_0x8ef3('0x34'));}if(!_0x344d74[_0x8ef3('0x35')]||!_0x344d74[_0x8ef3('0xe')]){throw new db[(_0x8ef3('0x1d'))]['ValidationError'](_0x8ef3('0x27'));}_0x14f83b=_0x344d74;var _0x4f9e66=[];_0x309ea1[_0x8ef3('0x45')](function(_0x46f2bb){_0x4f9e66[_0x8ef3('0x46')](checkTranscribeJob(_0x46f2bb,_0x56ce02,_0x14f83b));});return BPromise[_0x8ef3('0x47')](_0x4f9e66);})[_0x8ef3('0x48')](function(_0x3d6055){if(_0x3d6055){if(!_0x3d6055[_0x8ef3('0x38')]||_0x3d6055[_0x8ef3('0x38')]!==_0x8ef3('0x39')){logger[_0x8ef3('0x3a')](util[_0x8ef3('0x3c')](_0x3d6055,{'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 e265d9c..de242dd 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 _0xbeff=['join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x3d648e,_0x344357){var _0x1594b3=function(_0x19d3b0){while(--_0x19d3b0){_0x3d648e['push'](_0x3d648e['shift']());}};_0x1594b3(++_0x344357);}(_0xbeff,0x8d));var _0xfbef=function(_0x43a559,_0x2358ac){_0x43a559=_0x43a559-0x0;var _0xe67963=_0xbeff[_0x43a559];return _0xe67963;};'use strict';var _=require('lodash');var moment=require(_0xfbef('0x0'));var Redis=require(_0xfbef('0x1'));var util=require(_0xfbef('0x2'));var config=require(_0xfbef('0x3'));var db=require(_0xfbef('0x4'))['db'];var logger=require(_0xfbef('0x5'))('schedule');config[_0xfbef('0x6')]=_[_0xfbef('0x7')](config[_0xfbef('0x6')],{'host':_0xfbef('0x8'),'port':0x18eb});var io=require(_0xfbef('0x9'))(new Redis(config[_0xfbef('0x6')]));function closeInteractions(){var _0x4c677d=[];return db[_0xfbef('0xa')][_0xfbef('0xb')]({'raw':!![],'attributes':['id',_0xfbef('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfbef('0xd')](0x18,_0xfbef('0xe'))}}})['then'](function(_0x3a069d){if(_0x3a069d&&_0x3a069d[_0xfbef('0xf')]){_0x4c677d=_[_0xfbef('0x10')](_0x3a069d||[],'id');logger[_0xfbef('0x11')](_0xfbef('0x12'),_0x4c677d[_0xfbef('0x13')]());return db[_0xfbef('0xa')]['update']({'closeReason':_0xfbef('0x14'),'disposition':_0xfbef('0x15'),'closed':!![],'closedAt':moment()[_0xfbef('0x16')](_0xfbef('0x17'))},{'where':{'id':_0x4c677d}});}})[_0xfbef('0x18')](function(){if(_0x4c677d&&_0x4c677d[_0xfbef('0xf')]){logger[_0xfbef('0x11')](_0xfbef('0x19'),_0x4c677d[_0xfbef('0x13')]());for(var _0x3c3f7c=0x0;_0x3c3f7c<_0x4c677d[_0xfbef('0xf')];_0x3c3f7c++){io[_0xfbef('0x1a')](_0xfbef('0x1b'),{'id':_0x4c677d[_0x3c3f7c],'closed':!![]});}}})[_0xfbef('0x1c')](function(_0x184209){logger[_0xfbef('0x1d')](_0xfbef('0x1e'),_0x184209?util[_0xfbef('0x1f')](_0x184209,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6eaa=['subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','inspect','start','ioredis','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x6eaa,0x1ed));var _0xa6ea=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x6eaa[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xa6ea('0x0'));var util=require('util');var config=require(_0xa6ea('0x1'));var db=require(_0xa6ea('0x2'))['db'];var logger=require(_0xa6ea('0x3'))(_0xa6ea('0x4'));config['redis']=_[_0xa6ea('0x5')](config[_0xa6ea('0x6')],{'host':_0xa6ea('0x7'),'port':0x18eb});var io=require(_0xa6ea('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x2e580a=[];return db[_0xa6ea('0x9')][_0xa6ea('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa6ea('0xb')](0x18,_0xa6ea('0xc'))}}})[_0xa6ea('0xd')](function(_0x4836dd){if(_0x4836dd&&_0x4836dd[_0xa6ea('0xe')]){_0x2e580a=_[_0xa6ea('0xf')](_0x4836dd||[],'id');logger['info'](_0xa6ea('0x10'),_0x2e580a[_0xa6ea('0x11')]());return db[_0xa6ea('0x9')][_0xa6ea('0x12')]({'closeReason':_0xa6ea('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xa6ea('0x14')](_0xa6ea('0x15'))},{'where':{'id':_0x2e580a}});}})[_0xa6ea('0xd')](function(){if(_0x2e580a&&_0x2e580a[_0xa6ea('0xe')]){logger['info'](_0xa6ea('0x16'),_0x2e580a[_0xa6ea('0x11')]());for(var _0x12a698=0x0;_0x12a698<_0x2e580a[_0xa6ea('0xe')];_0x12a698++){io[_0xa6ea('0x17')](_0xa6ea('0x18'),{'id':_0x2e580a[_0x12a698],'closed':!![]});}}})['catch'](function(_0x57332b){logger[_0xa6ea('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x57332b?util[_0xa6ea('0x1a')](_0x57332b,{'showHidden':![],'depth':null}):'');});}exports[_0xa6ea('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 2bb8b3d..ca353e8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x149e=['contacts2','hopper2','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0x149e,0xb6));var _0xe149=function(_0xc33495,_0x34d9a8){_0xc33495=_0xc33495-0x0;var _0x4033=_0x149e[_0xc33495];return _0x4033;};'use strict';var util=require(_0xe149('0x0'));var db=require(_0xe149('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xe149('0x2')+i,'lastName':_0xe149('0x3')+i,'phone':0xf879fb460+i,'email':_0xe149('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe149('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xe149('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xe149('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe149('0x5')]({'id':i,'firstName':_0xe149('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe149('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe149('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe149('0x6')](),'updatedAt':Date['now']()});}db[_0xe149('0x7')][_0xe149('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0xe149('0x9')](contacts);})[_0xe149('0xa')](function(){console[_0xe149('0xb')](_0xe149('0xc'),_0xe149('0xd'));return db['CmHopper']['destroy']({'where':{}});})[_0xe149('0xa')](function(){return db[_0xe149('0xe')][_0xe149('0x9')](hopper);})[_0xe149('0xa')](function(){console[_0xe149('0xb')](_0xe149('0xc'),_0xe149('0xf'));return db[_0xe149('0x7')][_0xe149('0x9')](contacts2);})['then'](function(){console['log'](_0xe149('0xc'),_0xe149('0x10'));return db['CmHopper'][_0xe149('0x9')](hopper2);})[_0xe149('0xa')](function(){console['log'](_0xe149('0xc'),_0xe149('0x11'));})['catch'](function(_0x230132){console[_0xe149('0xb')](_0x230132);}); \ No newline at end of file +var _0xe1ed=['innocenzo.biondo','now','push','@xcally.com','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','CmContact','contacts2','catch','util','Innocenzo','Biondo'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe1ed,0x9f));var _0xde1e=function(_0x5f5c74,_0x330dca){_0x5f5c74=_0x5f5c74-0x0;var _0x130b4b=_0xe1ed[_0x5f5c74];return _0x130b4b;};'use strict';var util=require(_0xde1e('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xde1e('0x1')+i,'lastName':_0xde1e('0x2')+i,'phone':0xf879fb460+i,'email':_0xde1e('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xde1e('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xde1e('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xde1e('0x5')]({'id':i,'firstName':_0xde1e('0x1')+i,'lastName':_0xde1e('0x2')+i,'phone':0xf879fb460+i,'email':_0xde1e('0x3')+i+_0xde1e('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xde1e('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xde1e('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db['CmContact'][_0xde1e('0x7')]({'where':{}})[_0xde1e('0x8')](function(){return db['CmContact'][_0xde1e('0x9')](contacts);})['then'](function(){console[_0xde1e('0xa')](_0xde1e('0xb'),_0xde1e('0xc'));return db[_0xde1e('0xd')][_0xde1e('0x7')]({'where':{}});})[_0xde1e('0x8')](function(){return db[_0xde1e('0xd')][_0xde1e('0x9')](hopper);})[_0xde1e('0x8')](function(){console[_0xde1e('0xa')](_0xde1e('0xb'),_0xde1e('0xe'));return db[_0xde1e('0xf')]['bulkCreate'](contacts2);})[_0xde1e('0x8')](function(){console[_0xde1e('0xa')](_0xde1e('0xb'),_0xde1e('0x10'));return db[_0xde1e('0xd')]['bulkCreate'](hopper2);})[_0xde1e('0x8')](function(){console['log'](_0xde1e('0xb'),'hopper2');})[_0xde1e('0x11')](function(_0x202735){console[_0xde1e('0xa')](_0x202735);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 94014f9..3e35a8b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c86=['log','util','format','%s%s','agent','password','udp','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user'];(function(_0x284fc3,_0x2c5973){var _0x4e1297=function(_0x481fa3){while(--_0x481fa3){_0x284fc3['push'](_0x284fc3['shift']());}};_0x4e1297(++_0x2c5973);}(_0x0c86,0x181));var _0x60c8=function(_0x4f7c31,_0x4ef205){_0x4f7c31=_0x4f7c31-0x0;var _0x1783a9=_0x0c86[_0x4f7c31];return _0x1783a9;};'use strict';var util=require(_0x60c8('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x60c8('0x1')](_0x60c8('0x2'),_0x60c8('0x3'),i),'fullname':util['format'](_0x60c8('0x2'),_0x60c8('0x3'),i),'email':util[_0x60c8('0x1')]('%s%s@xcally.com',_0x60c8('0x3'),i),'role':_0x60c8('0x3'),'password':_0x60c8('0x4'),'internal':0xfa0+i,'type':'friend','transport':[_0x60c8('0x5'),'ws',_0x60c8('0x6')],'disallow':[_0x60c8('0x7')],'allow':['ulaw'],'defaultuser':util['format'](_0x60c8('0x2'),_0x60c8('0x3'),i),'encryption':_0x60c8('0x8'),'avpf':'yes','force_avp':_0x60c8('0x8'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x60c8('0x9'),'dtlssetup':'actpass','callerid':util[_0x60c8('0x1')](_0x60c8('0xa'),util[_0x60c8('0x1')](_0x60c8('0x2'),_0x60c8('0x3'),i),0xfa0+i)});}db[_0x60c8('0xb')][_0x60c8('0xc')](users)[_0x60c8('0xd')](function(){console['log'](_0x60c8('0xe'));})['catch'](function(_0x3d9c6c){console[_0x60c8('0xf')](_0x3d9c6c);}); \ No newline at end of file +var _0x6d98=['\x22%s\x22\x20<%s>','User','log','catch','util','../mysqldb','push','format','%s%s','agent','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x2ad5ac,_0x3ce592){var _0x5151d0=function(_0xd75499){while(--_0xd75499){_0x2ad5ac['push'](_0x2ad5ac['shift']());}};_0x5151d0(++_0x3ce592);}(_0x6d98,0x114));var _0x86d9=function(_0x3ef001,_0x3362fd){_0x3ef001=_0x3ef001-0x0;var _0x3aba77=_0x6d98[_0x3ef001];return _0x3aba77;};'use strict';var util=require(_0x86d9('0x0'));var db=require(_0x86d9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x86d9('0x2')]({'name':util[_0x86d9('0x3')](_0x86d9('0x4'),_0x86d9('0x5'),i),'fullname':util[_0x86d9('0x3')](_0x86d9('0x4'),_0x86d9('0x5'),i),'email':util['format']('%s%s@xcally.com','agent',i),'role':'agent','password':_0x86d9('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x86d9('0x7'),'ws',_0x86d9('0x8')],'disallow':['all'],'allow':[_0x86d9('0x9')],'defaultuser':util[_0x86d9('0x3')](_0x86d9('0x4'),_0x86d9('0x5'),i),'encryption':_0x86d9('0xa'),'avpf':_0x86d9('0xa'),'force_avp':_0x86d9('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x86d9('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x86d9('0x3')](_0x86d9('0xc'),util[_0x86d9('0x3')](_0x86d9('0x4'),_0x86d9('0x5'),i),0xfa0+i)});}db[_0x86d9('0xd')]['bulkCreate'](users)['then'](function(){console[_0x86d9('0xe')]('add\x20user');})[_0x86d9('0xf')](function(_0x31b0b1){console['log'](_0x31b0b1);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 0842205..e268c80 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb939=['trunk:%s','campaign:%s:%s','user_has_chat_interactions:remove','user_has_mail_interactions:remove','leave','removeFaxInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','Trunk','user','SmsQueues','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','getChatQueues','getSmsQueues','getWhatsappQueues','chat','fax','sms','openchannel'];(function(_0x19e529,_0x4d5347){var _0x308117=function(_0x267f8d){while(--_0x267f8d){_0x19e529['push'](_0x19e529['shift']());}};_0x308117(++_0x4d5347);}(_0xb939,0x137));var _0x9b93=function(_0x4e658c,_0x3139a5){_0x4e658c=_0x4e658c-0x0;var _0x3a2973=_0xb939[_0x4e658c];return _0x3a2973;};'use strict';var _=require(_0x9b93('0x0'));var util=require('util');var BPromise=require(_0x9b93('0x1'));var db=require(_0x9b93('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x9b93('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x9b93('0x4')],'raw':!![],'where':{'role':_0x9b93('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x9b93('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9b93('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x9b93('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x9b93('0x7')],'where':{'type':_0x9b93('0x8')}};function getAssociatedResources(_0x407290,_0x5492aa,_0x56d2d0){return db[_0x9b93('0x9')][_0x9b93('0xa')]({'where':{'name':_0x407290,'userProfileId':_0x5492aa},'raw':!![]})[_0x9b93('0xb')](function(_0x6a8218){if(_0x6a8218){if(_0x6a8218[_0x9b93('0xc')]){switch(_0x407290){case _0x9b93('0xd'):case _0x9b93('0xe'):case _0x9b93('0xf'):case'SmsQueues':case _0x9b93('0x10'):case _0x9b93('0x11'):case _0x9b93('0x12'):return db[_0x56d2d0]['findAll'](queryQueues);case _0x9b93('0x13'):return db[_0x56d2d0][_0x9b93('0x14')](queryTelephones);case _0x9b93('0x15'):return db[_0x56d2d0][_0x9b93('0x14')](queryTrunks);case _0x9b93('0x16'):return db[_0x56d2d0][_0x9b93('0x14')](queryCampaigns);}}else{return db[_0x9b93('0x17')][_0x9b93('0x14')]({'attributes':[_0x9b93('0x18')],'where':{'sectionId':_0x6a8218['id']},'raw':!![]})['then'](function(_0x28f58d){if(_0x28f58d){var _0x325912={'where':{'id':_[_0x9b93('0x19')](_0x28f58d,_0x9b93('0x18'))},'raw':!![]};switch(_0x56d2d0){case _0x9b93('0x1a'):_0x325912[_0x9b93('0x1b')][_0x9b93('0x4')]=_0x9b93('0x6');break;case _0x9b93('0x1c'):_0x325912[_0x9b93('0x1b')][_0x9b93('0x7')]='ivr';break;}return db[_0x56d2d0][_0x9b93('0x14')](_0x325912);}else{return[];}});}}else{return[];}})[_0x9b93('0xb')](function(_0x4964a8){return _0x4964a8;});}function joinOrLeaveQueues(_0x2f411b,_0x5e0b4c,_0x31cf9d,_0x490313){_0x2f411b[_0x5e0b4c](util[_0x9b93('0x1d')](_0x9b93('0x1e'),_0x31cf9d,_0x490313[_0x9b93('0x3')]));if(_0x490313[_0x9b93('0x1f')]){for(var _0x1bbd4f=0x0;_0x1bbd4f<_0x490313['Agents'][_0x9b93('0x20')];_0x1bbd4f+=0x1){_0x2f411b[_0x5e0b4c](util['format'](_0x9b93('0x21'),_0x490313[_0x9b93('0x1f')][_0x1bbd4f][_0x9b93('0x3')]));}}}function joinOrLeave(_0x256ae9,_0x319f5b,_0x464d8a){var _0x1118ed;if(_0x256ae9['handshake'][_0x9b93('0x22')]['id']){db['User'][_0x9b93('0x23')]({'attributes':['id',_0x9b93('0x3'),_0x9b93('0x4'),_0x9b93('0x24')],'where':{'id':_0x256ae9[_0x9b93('0x25')][_0x9b93('0x22')]['id']},'include':[{'model':db[_0x9b93('0x26')],'as':_0x9b93('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9b93('0x28')],'as':_0x9b93('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x9b93('0x2a')],'as':_0x9b93('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9b93('0x2c')],'as':_0x9b93('0x2d'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x1a1801){if(_0x1a1801){_0x1118ed=_0x1a1801;_0x256ae9[_0x319f5b](util['format']('user:%s',_0x1a1801['name']));var _0x112a89=[];switch(_0x1a1801[_0x9b93('0x4')]){case _0x9b93('0x2e'):_0x256ae9[_0x319f5b](_0x9b93('0x2f'));_0x256ae9[_0x319f5b](_0x9b93('0x30'));if(queryQueues[_0x9b93('0x31')]('include')){delete queryQueues[_0x9b93('0x32')];}_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x34')][_0x9b93('0x14')](queryQueues));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x35')][_0x9b93('0x14')](queryQueues));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x36')][_0x9b93('0x14')](queryQueues));_0x112a89[_0x9b93('0x33')](db['SmsQueue']['findAll'](queryQueues));_0x112a89[_0x9b93('0x33')](db['MailQueue'][_0x9b93('0x14')](queryQueues));_0x112a89['push'](db['OpenchannelQueue'][_0x9b93('0x14')](queryQueues));_0x112a89['push'](db['WhatsappQueue'][_0x9b93('0x14')](queryQueues));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x1a')][_0x9b93('0x14')](queryTelephones));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x37')][_0x9b93('0x14')](queryTrunks));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x1c')][_0x9b93('0x14')](queryCampaigns));_0x112a89['push'](db['User']['findAll'](queryAgents));break;case _0x9b93('0x38'):_0x256ae9[_0x319f5b]('voice:inbound');_0x256ae9[_0x319f5b]('voice:outbound');_0x112a89['push'](getAssociatedResources(_0x9b93('0xd'),_0x1a1801[_0x9b93('0x24')],_0x9b93('0x34')));_0x112a89[_0x9b93('0x33')](getAssociatedResources(_0x9b93('0xe'),_0x1a1801[_0x9b93('0x24')],_0x9b93('0x35')));_0x112a89['push'](getAssociatedResources(_0x9b93('0xf'),_0x1a1801[_0x9b93('0x24')],_0x9b93('0x36')));_0x112a89[_0x9b93('0x33')](getAssociatedResources(_0x9b93('0x39'),_0x1a1801[_0x9b93('0x24')],_0x9b93('0x3a')));_0x112a89[_0x9b93('0x33')](getAssociatedResources(_0x9b93('0x10'),_0x1a1801[_0x9b93('0x24')],_0x9b93('0x3b')));_0x112a89['push'](getAssociatedResources('OpenchannelQueues',_0x1a1801[_0x9b93('0x24')],_0x9b93('0x3c')));_0x112a89['push'](getAssociatedResources('WhatsappQueues',_0x1a1801[_0x9b93('0x24')],_0x9b93('0x3d')));_0x112a89[_0x9b93('0x33')](getAssociatedResources(_0x9b93('0x13'),_0x1a1801['userProfileId'],'User'));_0x112a89[_0x9b93('0x33')](getAssociatedResources(_0x9b93('0x15'),_0x1a1801['userProfileId'],'Trunk'));_0x112a89[_0x9b93('0x33')](getAssociatedResources('IvrCampaigns',_0x1a1801['userProfileId'],_0x9b93('0x1c')));_0x112a89[_0x9b93('0x33')](db[_0x9b93('0x1a')][_0x9b93('0x14')](queryAgents));break;case'agent':_0x256ae9[_0x319f5b](_0x9b93('0x2f'));_0x256ae9[_0x319f5b]('voice:outbound');_0x112a89[_0x9b93('0x33')](_0x1a1801['getVoiceQueues']({'attributes':['id',_0x9b93('0x3')]}));_0x112a89[_0x9b93('0x33')](_0x1a1801[_0x9b93('0x3e')]({'attributes':['id','name']}));_0x112a89[_0x9b93('0x33')](_0x1a1801['getFaxQueues']({'attributes':['id',_0x9b93('0x3')]}));_0x112a89['push'](_0x1a1801[_0x9b93('0x3f')]({'attributes':['id',_0x9b93('0x3')]}));_0x112a89[_0x9b93('0x33')](_0x1a1801['getMailQueues']({'attributes':['id','name']}));_0x112a89['push'](_0x1a1801['getOpenchannelQueues']({'attributes':['id',_0x9b93('0x3')]}));_0x112a89[_0x9b93('0x33')](_0x1a1801[_0x9b93('0x40')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x112a89);}})[_0x9b93('0xb')](function(_0x1e3182){if(_0x1e3182&&_0x1e3182[_0x9b93('0x20')]){for(var _0x1865b9=0x0;_0x1865b9<_0x1e3182[_0x9b93('0x20')];_0x1865b9+=0x1){for(var _0x17a9ea=0x0;_0x17a9ea<_0x1e3182[_0x1865b9]['length'];_0x17a9ea+=0x1){switch(_0x1865b9){case 0x0:joinOrLeaveQueues(_0x256ae9,_0x319f5b,'voice',_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x1:joinOrLeaveQueues(_0x256ae9,_0x319f5b,_0x9b93('0x41'),_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x2:joinOrLeaveQueues(_0x256ae9,_0x319f5b,_0x9b93('0x42'),_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x3:joinOrLeaveQueues(_0x256ae9,_0x319f5b,_0x9b93('0x43'),_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x4:joinOrLeaveQueues(_0x256ae9,_0x319f5b,'mail',_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x5:joinOrLeaveQueues(_0x256ae9,_0x319f5b,_0x9b93('0x44'),_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x6:joinOrLeaveQueues(_0x256ae9,_0x319f5b,'whatsapp',_0x1e3182[_0x1865b9][_0x17a9ea]);break;case 0x7:if(_0x1118ed['role']!==_0x9b93('0x5'))_0x256ae9[_0x319f5b](util[_0x9b93('0x1d')]('telephone:%s',_0x1e3182[_0x1865b9][_0x17a9ea][_0x9b93('0x3')]));break;case 0x8:if(_0x1118ed[_0x9b93('0x4')]!=='agent')_0x256ae9[_0x319f5b](util[_0x9b93('0x1d')](_0x9b93('0x45'),_0x1e3182[_0x1865b9][_0x17a9ea][_0x9b93('0x3')]));break;case 0x9:if(_0x1118ed['role']!=='agent')_0x256ae9[_0x319f5b](util[_0x9b93('0x1d')](_0x9b93('0x46'),_0x1e3182[_0x1865b9][_0x17a9ea][_0x9b93('0x7')],_0x1e3182[_0x1865b9][_0x17a9ea][_0x9b93('0x3')]));break;case 0xa:_0x256ae9[_0x319f5b](util[_0x9b93('0x1d')]('user:%s',_0x1e3182[_0x1865b9][_0x17a9ea]['name']));break;}}}}})[_0x9b93('0xb')](function(){if(_0x319f5b==='leave'){var _0x332f10=_[_0x9b93('0x19')](_0x1118ed[_0x9b93('0x27')],'id');return _0x1118ed['removeChatInteractions'](_0x332f10)[_0x9b93('0xb')](function(){for(var _0x36772e=0x0;_0x36772e<_0x332f10[_0x9b93('0x20')];_0x36772e+=0x1){_0x464d8a['emit'](_0x9b93('0x47'),{'ChatInteractionId':Number(_0x332f10[_0x36772e]),'UserId':Number(_0x1118ed['id'])});}});}})[_0x9b93('0xb')](function(){if(_0x319f5b==='leave'){var _0x1c8079=_[_0x9b93('0x19')](_0x1118ed[_0x9b93('0x29')],'id');return _0x1118ed['removeMailInteractions'](_0x1c8079)['then'](function(){for(var _0x458ae2=0x0;_0x458ae2<_0x1c8079[_0x9b93('0x20')];_0x458ae2+=0x1){_0x464d8a['emit'](_0x9b93('0x48'),{'MailInteractionId':Number(_0x1c8079[_0x458ae2]),'UserId':Number(_0x1118ed['id'])});}});}})[_0x9b93('0xb')](function(){if(_0x319f5b===_0x9b93('0x49')){var _0x51fc96=_[_0x9b93('0x19')](_0x1118ed[_0x9b93('0x2b')],'id');return _0x1118ed[_0x9b93('0x4a')](_0x51fc96)[_0x9b93('0xb')](function(){for(var _0x46fb28=0x0;_0x46fb28<_0x51fc96[_0x9b93('0x20')];_0x46fb28+=0x1){_0x464d8a[_0x9b93('0x4b')](_0x9b93('0x4c'),{'FaxInteractionId':Number(_0x51fc96[_0x46fb28]),'UserId':Number(_0x1118ed['id'])});}});}})[_0x9b93('0xb')](function(){if(_0x319f5b===_0x9b93('0x49')){var _0x38a9d9=_['map'](_0x1118ed[_0x9b93('0x4d')],'id');return _0x1118ed[_0x9b93('0x4e')](_0x38a9d9)['then'](function(){for(var _0x47ca0d=0x0;_0x47ca0d<_0x38a9d9[_0x9b93('0x20')];_0x47ca0d+=0x1){_0x464d8a[_0x9b93('0x4b')](_0x9b93('0x4f'),{'SmsInteractionId':Number(_0x38a9d9[_0x47ca0d]),'UserId':Number(_0x1118ed['id'])});}});}})[_0x9b93('0xb')](function(){if(_0x319f5b===_0x9b93('0x49')){var _0x20a92a=_[_0x9b93('0x19')](_0x1118ed[_0x9b93('0x2d')],'id');return _0x1118ed['removeOpenchannelInteractions'](_0x20a92a)[_0x9b93('0xb')](function(){for(var _0xb86577=0x0;_0xb86577<_0x20a92a['length'];_0xb86577+=0x1){_0x464d8a[_0x9b93('0x4b')](_0x9b93('0x50'),{'OpenchannelInteractionId':Number(_0x20a92a[_0xb86577]),'UserId':Number(_0x1118ed['id'])});}});}})[_0x9b93('0xb')](function(){if(_0x319f5b===_0x9b93('0x49')){var _0x251954=_[_0x9b93('0x19')](_0x1118ed['WhatsappInteractions'],'id');return _0x1118ed[_0x9b93('0x51')](_0x251954)[_0x9b93('0xb')](function(){for(var _0x5acc41=0x0;_0x5acc41<_0x251954['length'];_0x5acc41+=0x1){_0x464d8a[_0x9b93('0x4b')](_0x9b93('0x52'),{'WhatsappInteractionId':Number(_0x251954[_0x5acc41]),'UserId':Number(_0x1118ed['id'])});}});}})['catch'](function(_0x53ee89){_0x256ae9[_0x9b93('0x53')](_0x53ee89);});}}function onDisconnect(_0x436624,_0x307168){joinOrLeave(_0x436624,'leave',_0x307168);}function onConnect(_0x1aeba5){joinOrLeave(_0x1aeba5,_0x9b93('0x54'));}exports['default']=function(_0x3ba1bd){_0x3ba1bd['on'](_0x9b93('0x55'),function(_0x57fe98){_0x57fe98['setMaxListeners'](0x0);_0x57fe98[_0x9b93('0x56')]=_0x57fe98[_0x9b93('0x57')][_0x9b93('0x55')][_0x9b93('0x58')]+':'+_0x57fe98[_0x9b93('0x57')][_0x9b93('0x55')][_0x9b93('0x59')];_0x57fe98[_0x9b93('0x5a')]=new Date();_0x57fe98['log']=function(_0x47da2b){console[_0x9b93('0x53')](_0x9b93('0x5b')+_0x57fe98[_0x9b93('0x5c')][_0x9b93('0x3')]+'['+_0x57fe98['address']+']',_0x47da2b);};_0x57fe98['on']('disconnect',function(){onDisconnect(_0x57fe98,_0x3ba1bd);_0x57fe98[_0x9b93('0x53')](_0x9b93('0x5d'));});onConnect(_0x57fe98);_0x57fe98[_0x9b93('0x53')](_0x9b93('0x5e'));});}; \ No newline at end of file +var _0xb758=['leave','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','then','map','where','%s:queue:%s','user:%s','Agents','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','format','admin','voice:inbound','hasOwnProperty','include','VoiceQueue','FaxQueue','push','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','voice:outbound','userProfileId','ChatQueue','OpenchannelQueues','Telephones','Trunk','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','emit','user_has_chat_interactions:remove'];(function(_0x2dd82b,_0x384905){var _0x31d2df=function(_0x59bcad){while(--_0x59bcad){_0x2dd82b['push'](_0x2dd82b['shift']());}};_0x31d2df(++_0x384905);}(_0xb758,0x14a));var _0x8b75=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0xb758[_0x235f49];return _0x551139;};'use strict';var _=require(_0x8b75('0x0'));var util=require(_0x8b75('0x1'));var BPromise=require(_0x8b75('0x2'));var db=require(_0x8b75('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x8b75('0x4')],'include':[{'as':'Agents','model':db[_0x8b75('0x5')],'attributes':['id','name',_0x8b75('0x6')],'raw':!![],'where':{'role':_0x8b75('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8b75('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8b75('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x8b75('0x4')],'where':{'role':_0x8b75('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8b75('0x4'),_0x8b75('0x9')],'where':{'type':_0x8b75('0xa')}};function getAssociatedResources(_0x4467ff,_0x3ec1f7,_0x137eb5){return db[_0x8b75('0xb')][_0x8b75('0xc')]({'where':{'name':_0x4467ff,'userProfileId':_0x3ec1f7},'raw':!![]})['then'](function(_0x275f63){if(_0x275f63){if(_0x275f63[_0x8b75('0xd')]){switch(_0x4467ff){case _0x8b75('0xe'):case _0x8b75('0xf'):case _0x8b75('0x10'):case _0x8b75('0x11'):case _0x8b75('0x12'):case'OpenchannelQueues':case _0x8b75('0x13'):return db[_0x137eb5][_0x8b75('0x14')](queryQueues);case'Telephones':return db[_0x137eb5][_0x8b75('0x14')](queryTelephones);case'Trunks':return db[_0x137eb5][_0x8b75('0x14')](queryTrunks);case _0x8b75('0x15'):return db[_0x137eb5][_0x8b75('0x14')](queryCampaigns);}}else{return db[_0x8b75('0x16')][_0x8b75('0x14')]({'attributes':[_0x8b75('0x17')],'where':{'sectionId':_0x275f63['id']},'raw':!![]})[_0x8b75('0x18')](function(_0x49fd2b){if(_0x49fd2b){var _0x10b52c={'where':{'id':_[_0x8b75('0x19')](_0x49fd2b,_0x8b75('0x17'))},'raw':!![]};switch(_0x137eb5){case _0x8b75('0x5'):_0x10b52c[_0x8b75('0x1a')][_0x8b75('0x6')]=_0x8b75('0x8');break;case'Campaign':_0x10b52c['where']['type']=_0x8b75('0xa');break;}return db[_0x137eb5][_0x8b75('0x14')](_0x10b52c);}else{return[];}});}}else{return[];}})[_0x8b75('0x18')](function(_0x131f77){return _0x131f77;});}function joinOrLeaveQueues(_0x3b37f4,_0x26d0cd,_0x3cec0a,_0x3799fa){_0x3b37f4[_0x26d0cd](util['format'](_0x8b75('0x1b'),_0x3cec0a,_0x3799fa[_0x8b75('0x4')]));if(_0x3799fa['Agents']){for(var _0x28644f=0x0;_0x28644f<_0x3799fa['Agents']['length'];_0x28644f+=0x1){_0x3b37f4[_0x26d0cd](util['format'](_0x8b75('0x1c'),_0x3799fa[_0x8b75('0x1d')][_0x28644f][_0x8b75('0x4')]));}}}function joinOrLeave(_0x1dad16,_0x167de6,_0x3091aa){var _0x56284c;if(_0x1dad16[_0x8b75('0x1e')][_0x8b75('0x1f')]['id']){db[_0x8b75('0x5')]['find']({'attributes':['id',_0x8b75('0x4'),_0x8b75('0x6'),'userProfileId'],'where':{'id':_0x1dad16['handshake'][_0x8b75('0x1f')]['id']},'include':[{'model':db[_0x8b75('0x20')],'as':_0x8b75('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x8b75('0x22')],'as':_0x8b75('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x8b75('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8b75('0x25')],'as':_0x8b75('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x8b75('0x27')],'as':_0x8b75('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x8b75('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x8b75('0x18')](function(_0xe35c84){if(_0xe35c84){_0x56284c=_0xe35c84;_0x1dad16[_0x167de6](util[_0x8b75('0x2a')](_0x8b75('0x1c'),_0xe35c84['name']));var _0x1122a0=[];switch(_0xe35c84['role']){case _0x8b75('0x2b'):_0x1dad16[_0x167de6](_0x8b75('0x2c'));_0x1dad16[_0x167de6]('voice:outbound');if(queryQueues[_0x8b75('0x2d')](_0x8b75('0x2e'))){delete queryQueues[_0x8b75('0x2e')];}_0x1122a0['push'](db[_0x8b75('0x2f')][_0x8b75('0x14')](queryQueues));_0x1122a0['push'](db['ChatQueue'][_0x8b75('0x14')](queryQueues));_0x1122a0['push'](db[_0x8b75('0x30')][_0x8b75('0x14')](queryQueues));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x32')][_0x8b75('0x14')](queryQueues));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x33')]['findAll'](queryQueues));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x34')]['findAll'](queryQueues));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x35')]['findAll'](queryQueues));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x5')][_0x8b75('0x14')](queryTelephones));_0x1122a0[_0x8b75('0x31')](db['Trunk']['findAll'](queryTrunks));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x36')][_0x8b75('0x14')](queryCampaigns));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x5')][_0x8b75('0x14')](queryAgents));break;case _0x8b75('0x37'):_0x1dad16[_0x167de6](_0x8b75('0x2c'));_0x1dad16[_0x167de6](_0x8b75('0x38'));_0x1122a0[_0x8b75('0x31')](getAssociatedResources(_0x8b75('0xe'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x2f')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources(_0x8b75('0xf'),_0xe35c84['userProfileId'],_0x8b75('0x3a')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources(_0x8b75('0x10'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x30')));_0x1122a0['push'](getAssociatedResources(_0x8b75('0x11'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x32')));_0x1122a0['push'](getAssociatedResources(_0x8b75('0x12'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x33')));_0x1122a0['push'](getAssociatedResources(_0x8b75('0x3b'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x34')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources(_0x8b75('0x13'),_0xe35c84[_0x8b75('0x39')],_0x8b75('0x35')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources(_0x8b75('0x3c'),_0xe35c84['userProfileId'],_0x8b75('0x5')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources('Trunks',_0xe35c84[_0x8b75('0x39')],_0x8b75('0x3d')));_0x1122a0[_0x8b75('0x31')](getAssociatedResources('IvrCampaigns',_0xe35c84[_0x8b75('0x39')],_0x8b75('0x36')));_0x1122a0[_0x8b75('0x31')](db[_0x8b75('0x5')][_0x8b75('0x14')](queryAgents));break;case _0x8b75('0x7'):_0x1dad16[_0x167de6](_0x8b75('0x2c'));_0x1dad16[_0x167de6](_0x8b75('0x38'));_0x1122a0[_0x8b75('0x31')](_0xe35c84[_0x8b75('0x3e')]({'attributes':['id',_0x8b75('0x4')]}));_0x1122a0[_0x8b75('0x31')](_0xe35c84['getChatQueues']({'attributes':['id',_0x8b75('0x4')]}));_0x1122a0[_0x8b75('0x31')](_0xe35c84[_0x8b75('0x3f')]({'attributes':['id','name']}));_0x1122a0['push'](_0xe35c84[_0x8b75('0x40')]({'attributes':['id',_0x8b75('0x4')]}));_0x1122a0[_0x8b75('0x31')](_0xe35c84['getMailQueues']({'attributes':['id',_0x8b75('0x4')]}));_0x1122a0[_0x8b75('0x31')](_0xe35c84[_0x8b75('0x41')]({'attributes':['id',_0x8b75('0x4')]}));_0x1122a0[_0x8b75('0x31')](_0xe35c84[_0x8b75('0x42')]({'attributes':['id',_0x8b75('0x4')]}));break;}return BPromise[_0x8b75('0x43')](_0x1122a0);}})['then'](function(_0x486a21){if(_0x486a21&&_0x486a21[_0x8b75('0x44')]){for(var _0x586875=0x0;_0x586875<_0x486a21['length'];_0x586875+=0x1){for(var _0xe53d89=0x0;_0xe53d89<_0x486a21[_0x586875][_0x8b75('0x44')];_0xe53d89+=0x1){switch(_0x586875){case 0x0:joinOrLeaveQueues(_0x1dad16,_0x167de6,_0x8b75('0x45'),_0x486a21[_0x586875][_0xe53d89]);break;case 0x1:joinOrLeaveQueues(_0x1dad16,_0x167de6,'chat',_0x486a21[_0x586875][_0xe53d89]);break;case 0x2:joinOrLeaveQueues(_0x1dad16,_0x167de6,'fax',_0x486a21[_0x586875][_0xe53d89]);break;case 0x3:joinOrLeaveQueues(_0x1dad16,_0x167de6,_0x8b75('0x46'),_0x486a21[_0x586875][_0xe53d89]);break;case 0x4:joinOrLeaveQueues(_0x1dad16,_0x167de6,_0x8b75('0x47'),_0x486a21[_0x586875][_0xe53d89]);break;case 0x5:joinOrLeaveQueues(_0x1dad16,_0x167de6,_0x8b75('0x48'),_0x486a21[_0x586875][_0xe53d89]);break;case 0x6:joinOrLeaveQueues(_0x1dad16,_0x167de6,_0x8b75('0x49'),_0x486a21[_0x586875][_0xe53d89]);break;case 0x7:if(_0x56284c['role']!=='agent')_0x1dad16[_0x167de6](util[_0x8b75('0x2a')](_0x8b75('0x4a'),_0x486a21[_0x586875][_0xe53d89][_0x8b75('0x4')]));break;case 0x8:if(_0x56284c[_0x8b75('0x6')]!==_0x8b75('0x7'))_0x1dad16[_0x167de6](util[_0x8b75('0x2a')](_0x8b75('0x4b'),_0x486a21[_0x586875][_0xe53d89][_0x8b75('0x4')]));break;case 0x9:if(_0x56284c[_0x8b75('0x6')]!==_0x8b75('0x7'))_0x1dad16[_0x167de6](util[_0x8b75('0x2a')]('campaign:%s:%s',_0x486a21[_0x586875][_0xe53d89][_0x8b75('0x9')],_0x486a21[_0x586875][_0xe53d89][_0x8b75('0x4')]));break;case 0xa:_0x1dad16[_0x167de6](util['format']('user:%s',_0x486a21[_0x586875][_0xe53d89][_0x8b75('0x4')]));break;}}}}})[_0x8b75('0x18')](function(){if(_0x167de6==='leave'){var _0x385c5c=_['map'](_0x56284c[_0x8b75('0x21')],'id');return _0x56284c['removeChatInteractions'](_0x385c5c)[_0x8b75('0x18')](function(){for(var _0x36cb1b=0x0;_0x36cb1b<_0x385c5c['length'];_0x36cb1b+=0x1){_0x3091aa[_0x8b75('0x4c')](_0x8b75('0x4d'),{'ChatInteractionId':Number(_0x385c5c[_0x36cb1b]),'UserId':Number(_0x56284c['id'])});}});}})[_0x8b75('0x18')](function(){if(_0x167de6===_0x8b75('0x4e')){var _0x467d59=_[_0x8b75('0x19')](_0x56284c[_0x8b75('0x23')],'id');return _0x56284c['removeMailInteractions'](_0x467d59)['then'](function(){for(var _0x5e8e21=0x0;_0x5e8e21<_0x467d59[_0x8b75('0x44')];_0x5e8e21+=0x1){_0x3091aa[_0x8b75('0x4c')](_0x8b75('0x4f'),{'MailInteractionId':Number(_0x467d59[_0x5e8e21]),'UserId':Number(_0x56284c['id'])});}});}})[_0x8b75('0x18')](function(){if(_0x167de6===_0x8b75('0x4e')){var _0x347211=_[_0x8b75('0x19')](_0x56284c[_0x8b75('0x50')],'id');return _0x56284c[_0x8b75('0x51')](_0x347211)[_0x8b75('0x18')](function(){for(var _0x10d4f9=0x0;_0x10d4f9<_0x347211[_0x8b75('0x44')];_0x10d4f9+=0x1){_0x3091aa[_0x8b75('0x4c')](_0x8b75('0x52'),{'FaxInteractionId':Number(_0x347211[_0x10d4f9]),'UserId':Number(_0x56284c['id'])});}});}})[_0x8b75('0x18')](function(){if(_0x167de6===_0x8b75('0x4e')){var _0x2cf0be=_[_0x8b75('0x19')](_0x56284c[_0x8b75('0x26')],'id');return _0x56284c[_0x8b75('0x53')](_0x2cf0be)[_0x8b75('0x18')](function(){for(var _0x2b744c=0x0;_0x2b744c<_0x2cf0be[_0x8b75('0x44')];_0x2b744c+=0x1){_0x3091aa[_0x8b75('0x4c')](_0x8b75('0x54'),{'SmsInteractionId':Number(_0x2cf0be[_0x2b744c]),'UserId':Number(_0x56284c['id'])});}});}})['then'](function(){if(_0x167de6===_0x8b75('0x4e')){var _0x2fd4ae=_[_0x8b75('0x19')](_0x56284c[_0x8b75('0x28')],'id');return _0x56284c['removeOpenchannelInteractions'](_0x2fd4ae)[_0x8b75('0x18')](function(){for(var _0x3c0aac=0x0;_0x3c0aac<_0x2fd4ae[_0x8b75('0x44')];_0x3c0aac+=0x1){_0x3091aa[_0x8b75('0x4c')](_0x8b75('0x55'),{'OpenchannelInteractionId':Number(_0x2fd4ae[_0x3c0aac]),'UserId':Number(_0x56284c['id'])});}});}})[_0x8b75('0x18')](function(){if(_0x167de6===_0x8b75('0x4e')){var _0x107ef5=_[_0x8b75('0x19')](_0x56284c[_0x8b75('0x56')],'id');return _0x56284c[_0x8b75('0x57')](_0x107ef5)[_0x8b75('0x18')](function(){for(var _0x1f7776=0x0;_0x1f7776<_0x107ef5[_0x8b75('0x44')];_0x1f7776+=0x1){_0x3091aa[_0x8b75('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x107ef5[_0x1f7776]),'UserId':Number(_0x56284c['id'])});}});}})[_0x8b75('0x58')](function(_0x352566){_0x1dad16[_0x8b75('0x59')](_0x352566);});}}function onDisconnect(_0x531064,_0x3b2145){joinOrLeave(_0x531064,'leave',_0x3b2145);}function onConnect(_0x2f057a){joinOrLeave(_0x2f057a,_0x8b75('0x5a'));}exports[_0x8b75('0x5b')]=function(_0x44a562){_0x44a562['on'](_0x8b75('0x5c'),function(_0x4b2c50){_0x4b2c50[_0x8b75('0x5d')](0x0);_0x4b2c50[_0x8b75('0x5e')]=_0x4b2c50['request']['connection'][_0x8b75('0x5f')]+':'+_0x4b2c50[_0x8b75('0x60')][_0x8b75('0x5c')][_0x8b75('0x61')];_0x4b2c50[_0x8b75('0x62')]=new Date();_0x4b2c50['log']=function(_0x3c671d){console[_0x8b75('0x59')](_0x8b75('0x63')+_0x4b2c50['nsp']['name']+'['+_0x4b2c50['address']+']',_0x3c671d);};_0x4b2c50['on'](_0x8b75('0x64'),function(){onDisconnect(_0x4b2c50,_0x44a562);_0x4b2c50['log']('DISCONNECTED');});onConnect(_0x4b2c50);_0x4b2c50[_0x8b75('0x59')](_0x8b75('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7c19660..f86c28d 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 _0xdbe0=['util','../../mysqldb','triggers','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','code','catch','channel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','contact','UserId','interface','format','SIP/%s','agent','incomingmessage','AfterCreateMessage','get','offlineMessage','motionChannel','opened','resolve','SELECT','name','AfterCreate','changed','closed','substatus','QueryTypes','AfterUpdate','User','find','fullname','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','condition'];(function(_0xfb3805,_0x1845c1){var _0x2d119b=function(_0x3ce7a9){while(--_0x3ce7a9){_0xfb3805['push'](_0xfb3805['shift']());}};_0x2d119b(++_0x1845c1);}(_0xdbe0,0x163));var _0x0dbe=function(_0x2bb91a,_0x1c8e72){_0x2bb91a=_0x2bb91a-0x0;var _0x3b82c1=_0xdbe0[_0x2bb91a];return _0x3b82c1;};'use strict';var util=require(_0x0dbe('0x0'));var db=require(_0x0dbe('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x0dbe('0x2'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x0dbe('0x3'),'model':_0x0dbe('0x4'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0x6'),'callback':afterCreate},{'channel':_0x0dbe('0x3'),'model':_0x0dbe('0x4'),'event':_0x0dbe('0x7'),'condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':_0x0dbe('0x3'),'model':_0x0dbe('0x9'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateMessage},{'channel':_0x0dbe('0x3'),'model':'ChatOfflineMessage','event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x0dbe('0xb'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0x6'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x0dbe('0x7'),'condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':_0x0dbe('0xc'),'model':_0x0dbe('0xd'),'event':'afterCreate','condition':_0x0dbe('0xa'),'callback':afterCreateMessage},{'channel':_0x0dbe('0xe'),'model':_0x0dbe('0xf'),'event':_0x0dbe('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0dbe('0xe'),'model':_0x0dbe('0xf'),'event':_0x0dbe('0x7'),'condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':_0x0dbe('0xe'),'model':'WhatsappMessage','event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateMessage},{'channel':_0x0dbe('0x10'),'model':_0x0dbe('0x11'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0x6'),'callback':afterCreate},{'channel':_0x0dbe('0x10'),'model':_0x0dbe('0x11'),'event':_0x0dbe('0x7'),'condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':'Fax','model':_0x0dbe('0x12'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateMessage},{'channel':_0x0dbe('0x13'),'model':'MailInteraction','event':_0x0dbe('0x5'),'condition':_0x0dbe('0x6'),'callback':afterCreate},{'channel':_0x0dbe('0x13'),'model':_0x0dbe('0x14'),'event':'afterUpdate','condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':_0x0dbe('0x13'),'model':'MailMessage','event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateMessage},{'channel':_0x0dbe('0x15'),'model':_0x0dbe('0x16'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0x6'),'callback':afterCreate},{'channel':_0x0dbe('0x15'),'model':'OpenchannelInteraction','event':_0x0dbe('0x7'),'condition':_0x0dbe('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x0dbe('0x17'),'event':_0x0dbe('0x5'),'condition':_0x0dbe('0xa'),'callback':afterCreateMessage}];function request(_0x19bc46){return client['request'](_0x0dbe('0x18'),_0x19bc46)[_0x0dbe('0x19')](function(_0x529bfe){logger['info'](_0x0dbe('0x1a'),'EventManager',_0x529bfe);if(_0x529bfe[_0x0dbe('0x1b')]){if(_0x529bfe[_0x0dbe('0x1b')][_0x0dbe('0x1c')]===0x1f4){logger[_0x0dbe('0x1b')]('Trigger,\x20%s',_0x0dbe('0x18'),_0x529bfe[_0x0dbe('0x1b')]);}}})[_0x0dbe('0x1d')](function(_0x16d110){logger[_0x0dbe('0x1b')](_0x0dbe('0x1a'),'EventManager',_0x16d110);});}function afterCreateMessage(_0x30e2f0){return function(_0x1d69c8){_0x1d69c8=_0x1d69c8['get']({'plain':!![]});_0x1d69c8[_0x0dbe('0x1e')]=_0x30e2f0;_0x1d69c8['motionChannel']=_0x30e2f0;_0x1d69c8[_0x0dbe('0x1f')]=_0x1d69c8[_0x0dbe('0x20')];Promise['resolve']()[_0x0dbe('0x19')](function(){if(typeof _0x1d69c8[_0x0dbe('0x21')]===_0x0dbe('0x22'))return null;var _0x432113=_0x0dbe('0x23')+_0x1d69c8[_0x0dbe('0x21')];return db[_0x0dbe('0x24')][_0x0dbe('0x25')](_0x432113,{'type':db[_0x0dbe('0x26')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x158300){if(_0x158300){_0x1d69c8[_0x0dbe('0x27')]=_0x158300[0x0];}if(typeof _0x1d69c8[_0x0dbe('0x28')]==='undefined')return;return getAgent(_0x1d69c8['UserId']);})['then'](function(_0x3b1dae){if(_0x3b1dae){_0x1d69c8[_0x0dbe('0x29')]=util[_0x0dbe('0x2a')](_0x0dbe('0x2b'),_0x3b1dae['name']);_0x1d69c8[_0x0dbe('0x2c')]=_0x3b1dae;_0x1d69c8['channel']=_0x30e2f0;return request({'event':_0x0dbe('0x2d'),'message':_0x1d69c8});}else{return request({'event':'outgoingmessage','message':_0x1d69c8});}})[_0x0dbe('0x1d')](function(_0x299412){logger['error'](_0x0dbe('0x1a'),_0x0dbe('0x2e'),_0x299412);});};}function afterCreateOfflineMessage(_0xd65b5d){return function(_0x576d2e){_0x576d2e=_0x576d2e[_0x0dbe('0x2f')]({'plain':!![]});_0x576d2e[_0x0dbe('0x1e')]=_0xd65b5d;_0x576d2e['motionChannel']=_0xd65b5d;_0x576d2e['event']=_0x0dbe('0x30');return request({'event':_0x576d2e['event'],'message':_0x576d2e});};}function afterCreate(_0xc96869,_0x523ae6){return function(_0x15f4ec){_0x15f4ec=_0x15f4ec[_0x0dbe('0x2f')]({'plain':!![]});_0x15f4ec[_0x0dbe('0x1e')]=_0xc96869;_0x15f4ec[_0x0dbe('0x31')]=_0xc96869;_0x15f4ec['event']=_0x0dbe('0x32');Promise[_0x0dbe('0x33')]()[_0x0dbe('0x19')](function(){var _0x20229a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15f4ec[_0x0dbe('0x21')];return db[_0x0dbe('0x24')]['query'](_0x20229a,{'type':db[_0x0dbe('0x26')]['QueryTypes'][_0x0dbe('0x34')],'raw':!![]});})['then'](function(_0x548b9e){if(_0x548b9e){_0x15f4ec[_0x0dbe('0x27')]=_0x548b9e[0x0];}if(typeof _0x15f4ec[_0x0dbe('0x28')]===_0x0dbe('0x22'))return;return getAgent(_0x15f4ec[_0x0dbe('0x28')]);})['then'](function(_0x1e312e){if(_0x1e312e){_0x15f4ec[_0x0dbe('0x29')]=util[_0x0dbe('0x2a')](_0x0dbe('0x2b'),_0x1e312e[_0x0dbe('0x35')]);_0x15f4ec[_0x0dbe('0x2c')]=_0x1e312e;}return request({'event':_0x523ae6,'message':_0x15f4ec});})['catch'](function(_0x1e34d3){logger[_0x0dbe('0x1b')]('Trigger,\x20%s',_0x0dbe('0x36'),_0x1e34d3);});};}function afterUpdate(_0xffb536){return function(_0x940cd9){var _0x4cb604=_0x940cd9[_0x0dbe('0x37')](_0x0dbe('0x38'))&&_0x940cd9[_0x0dbe('0x38')];var _0x717d14=_0x940cd9[_0x0dbe('0x37')](_0x0dbe('0x39'));if(_0x4cb604||_0x717d14){var _0x237e57=_0x4cb604?_0x0dbe('0x8'):_0x0dbe('0x39');var _0x4930c2=_0x940cd9[_0x0dbe('0x2f')]({'plain':!![]});_0x4930c2[_0x0dbe('0x1e')]=_0xffb536;_0x4930c2[_0x0dbe('0x31')]=_0xffb536;_0x4930c2[_0x0dbe('0x1f')]=_0x4cb604?_0x0dbe('0x38'):'substatus';var _0x4a453c=_0x0dbe('0x23')+_0x4930c2[_0x0dbe('0x21')];return db[_0x0dbe('0x24')][_0x0dbe('0x25')](_0x4a453c,{'type':db[_0x0dbe('0x26')][_0x0dbe('0x3a')][_0x0dbe('0x34')],'raw':!![]})[_0x0dbe('0x19')](function(_0x292654){if(_0x292654){_0x4930c2[_0x0dbe('0x27')]=_0x292654[0x0];}if(typeof _0x4930c2[_0x0dbe('0x28')]==='undefined')return;return getAgent(_0x4930c2[_0x0dbe('0x28')]);})['then'](function(_0xf19ef6){if(_0xf19ef6){_0x4930c2[_0x0dbe('0x29')]=util[_0x0dbe('0x2a')](_0x0dbe('0x2b'),_0xf19ef6[_0x0dbe('0x35')]);_0x4930c2[_0x0dbe('0x2c')]=_0xf19ef6;}return request({'event':_0x237e57,'message':_0x4930c2});})['catch'](function(_0x523295){logger['error'](_0x0dbe('0x1a'),_0x0dbe('0x3b'),_0x523295);});}};}function getAgent(_0x5b687c){return db[_0x0dbe('0x3c')][_0x0dbe('0x3d')]({'where':{'id':_0x5b687c},'attributes':['id',_0x0dbe('0x35'),_0x0dbe('0x3e'),'email',_0x0dbe('0x3f')],'raw':!![]})[_0x0dbe('0x19')](function(_0x146d84){return _0x146d84;});}exports['default']=function(){for(var _0x89a50e=0x0;_0x89a50e=_0x3973bb['agents']){throw Error(_0x6c3d('0x11'));}_0x1ba8ba(_0x136347);})[_0x6c3d('0x12')](function(_0x5affda){_0x2c023c(_0x5affda);});});}; \ No newline at end of file +var _0xf4f1=['mail','fax','sms','openchannel','toLowerCase','clearBlockUser','blockedAt','updateAttributes','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util','voice'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xf4f1,0x8c));var _0x1f4f=function(_0x914afb,_0x44d71e){_0x914afb=_0x914afb-0x0;var _0x317292=_0xf4f1[_0x914afb];return _0x317292;};'use strict';var _=require(_0x1f4f('0x0'));var BPromise=require(_0x1f4f('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x1f4f('0x2'));var channels=[_0x1f4f('0x3'),_0x1f4f('0x4'),'chat',_0x1f4f('0x5'),_0x1f4f('0x6'),'whatsapp',_0x1f4f('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x2cd766){_0x2cd766=_0x2cd766[_0x1f4f('0x8')]();return _['includes'](channels,_0x2cd766);};exports[_0x1f4f('0x9')]=function(_0xc461c9,_0x4e4c9f,_0x139886,_0x5793cc){var _0x49b40f={'loginAttempts':_0x4e4c9f,'blocked':_0x139886};if(!_['isUndefined'](_0x5793cc)){_0x49b40f[_0x1f4f('0xa')]=_0x5793cc;}return _0xc461c9[_0x1f4f('0xb')](_0x49b40f);};exports['getLicense']=function(_0x232bad){return new BPromise(function(_0x882799,_0x23894c){var _0x150665=0x0;if(_0x232bad[_0x1f4f('0xc')]!==_0x1f4f('0xd')){_0x882799(_0x232bad);}db[_0x1f4f('0xe')]['count']({'where':{'role':_0x1f4f('0xd'),'online':!![],'id':{'$ne':_0x232bad['id']}}})[_0x1f4f('0xf')](function(_0x28ac6a){_0x150665=_0x28ac6a;return util['getLicense']();})['then'](function(_0x4af8d2){if(_0x4af8d2&&_0x4af8d2[_0x1f4f('0x10')]&&_0x150665>=_0x4af8d2[_0x1f4f('0x10')]){throw Error(_0x1f4f('0x11'));}_0x882799(_0x232bad);})['catch'](function(_0x3800bd){_0x23894c(_0x3800bd);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fe0cb68..01afa8f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc116=['json','send','exports','404','status','render'];(function(_0x1616fb,_0x275597){var _0x150f94=function(_0x1518f9){while(--_0x1518f9){_0x1616fb['push'](_0x1616fb['shift']());}};_0x150f94(++_0x275597);}(_0xc116,0x164));var _0x6c11=function(_0x5f23fd,_0x1f8c43){_0x5f23fd=_0x5f23fd-0x0;var _0x5c060e=_0xc116[_0x5f23fd];return _0x5c060e;};'use strict';module[_0x6c11('0x0')][0x194]=function pageNotFound(_0x3c7164,_0x30bc5f){var _0x3194e1=_0x6c11('0x1');var _0xeb5522=0x194;var _0x186e6a={'status':_0xeb5522};_0x30bc5f[_0x6c11('0x2')](_0x186e6a['status']);_0x30bc5f[_0x6c11('0x3')](_0x3194e1,{},function(_0x3d1a9b,_0x2d7a3e){if(_0x3d1a9b){return _0x30bc5f[_0x6c11('0x2')](_0x186e6a['status'])[_0x6c11('0x4')](_0x186e6a);}_0x30bc5f[_0x6c11('0x5')](_0x2d7a3e);});}; \ No newline at end of file +var _0x57df=['json','send','exports','404','status'];(function(_0x3fac1b,_0x3c60da){var _0x3460ae=function(_0x2a4ae3){while(--_0x2a4ae3){_0x3fac1b['push'](_0x3fac1b['shift']());}};_0x3460ae(++_0x3c60da);}(_0x57df,0xd4));var _0xf57d=function(_0x2bc61b,_0x38f103){_0x2bc61b=_0x2bc61b-0x0;var _0x4d2214=_0x57df[_0x2bc61b];return _0x4d2214;};'use strict';module[_0xf57d('0x0')][0x194]=function pageNotFound(_0x5d8ede,_0x12da08){var _0x5540bd=_0xf57d('0x1');var _0x2b12f3=0x194;var _0x4171d4={'status':_0x2b12f3};_0x12da08[_0xf57d('0x2')](_0x4171d4['status']);_0x12da08['render'](_0x5540bd,{},function(_0x176ee7,_0xe9c5b5){if(_0x176ee7){return _0x12da08[_0xf57d('0x2')](_0x4171d4[_0xf57d('0x2')])[_0xf57d('0x3')](_0x4171d4);}_0x12da08[_0xf57d('0x4')](_0xe9c5b5);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b6cc97c..20dd254 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b16=['../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../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/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../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','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.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','WhatsappMessage','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','ChatInteraction','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueues','SmsQueue','UserSmsQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','Applications','Sound','Sounds','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','ScreenRecording','VoiceMailMessage','mailbox','mailboxuser','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Smtp','Dispositions','CannedAnswer','Messages','Interactions','MailApplication','ListId','TemplateId','Agents','team_has_mail_queues','Account','Owner','ThroughTags','Users','MailInteractionId','Attachment','Attachments','Interaction','ChatWebsiteId','List','Dashboard','DashboardItem','Items','Answers','FaxAccountId','Exntensions','mandatoryDispositionPause','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','AttachmentId','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','CmHopperBlack','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','moh_has_sounds','mail_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','VtigerAccount','ServicenowAccount','FreshsalesAccount','ChatQueueReport','FromId','ToId','SessionId','ProjectId','user_has_square_projects','SmsQueues','team_has_whatsapp_queues','VoicePrefixes','HopperBlacks','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','TeamVoicePrefix','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','lodash','determine','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt'];(function(_0x399a1f,_0x108aa2){var _0x1b0e9f=function(_0x15e26d){while(--_0x15e26d){_0x399a1f['push'](_0x399a1f['shift']());}};_0x1b0e9f(++_0x108aa2);}(_0x6b16,0x1c8));var _0x66b1=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0x6b16[_0x10c16d];return _0x5896f4;};'use strict';var config=require(_0x66b1('0x0'));var Sequelize=require('sequelize');var _=require(_0x66b1('0x1'));var jstz=require('jstz');var timezone=jstz[_0x66b1('0x2')]();config[_0x66b1('0x3')]=_[_0x66b1('0x4')](config[_0x66b1('0x3')],{'database':'motion2','username':_0x66b1('0x5'),'password':_0x66b1('0x6'),'options':{'host':_0x66b1('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x66b1('0x8')},'logging':![],'timezone':timezone[_0x66b1('0x9')](),'define':{'charset':_0x66b1('0xa'),'collate':_0x66b1('0xb')}}});config[_0x66b1('0xc')]=_['defaultsDeep'](config[_0x66b1('0xc')],{'database':_0x66b1('0xd'),'username':_0x66b1('0x5'),'password':_0x66b1('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x66b1('0xa'),'collate':_0x66b1('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x66b1('0x3')][_0x66b1('0xe')],config[_0x66b1('0x3')][_0x66b1('0xf')],config[_0x66b1('0x3')][_0x66b1('0x10')],config['sequelize'][_0x66b1('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x66b1('0xc')][_0x66b1('0xe')],config[_0x66b1('0xc')][_0x66b1('0xf')],config[_0x66b1('0xc')]['password'],config[_0x66b1('0xc')][_0x66b1('0x11')])};db[_0x66b1('0x12')]=db['sequelize'][_0x66b1('0x13')]('../api/user/user.model');db[_0x66b1('0x14')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x15'));db[_0x66b1('0x16')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x17'));db[_0x66b1('0x18')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x19'));db[_0x66b1('0x1a')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x1b'));db[_0x66b1('0x1c')]=db['sequelize']['import']('../api/voiceQueue/voiceQueue.model');db[_0x66b1('0x1d')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x1e'));db[_0x66b1('0x1f')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x20'));db['VoiceMailMessage']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x21'));db[_0x66b1('0x22')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x66b1('0x23')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x24'));db[_0x66b1('0x25')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x66b1('0x26')]=db[_0x66b1('0x3')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x66b1('0x3')]['import'](_0x66b1('0x27'));db['Trunk']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x28'));db[_0x66b1('0x29')]=db['sequelize']['import'](_0x66b1('0x2a'));db[_0x66b1('0x2b')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x2c'));db[_0x66b1('0x2d')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db['sequelize']['import'](_0x66b1('0x2e'));db['UserMailQueue']=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x66b1('0x2f')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x30'));db['UserSmsQueue']=db[_0x66b1('0x3')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x66b1('0x31')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x32'));db[_0x66b1('0x33')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x34'));db[_0x66b1('0x35')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x36'));db[_0x66b1('0x37')]=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db[_0x66b1('0x38')]=db[_0x66b1('0x3')]['import']('../api/mailAccount/mailAccount.model');db[_0x66b1('0x39')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x3a'));db[_0x66b1('0x3b')]=db[_0x66b1('0x3')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x66b1('0x3c')]=db['sequelize'][_0x66b1('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x66b1('0x3d')]=db[_0x66b1('0x3')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/mailApplication/mailApplication.model');db[_0x66b1('0x3e')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x3f'));db['Dashboard']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x40'));db['DashboardItem']=db[_0x66b1('0x3')]['import'](_0x66b1('0x41'));db[_0x66b1('0x42')]=db[_0x66b1('0x3')]['import']('../api/faxAccount/faxAccount.model');db[_0x66b1('0x43')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x44'));db[_0x66b1('0x45')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x66b1('0x46')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x47'));db[_0x66b1('0x48')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x49'));db[_0x66b1('0x4a')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x4b'));db['SmsAccount']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x4c'));db[_0x66b1('0x4d')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x4e'));db[_0x66b1('0x4f')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x50'));db[_0x66b1('0x51')]=db['sequelize']['import'](_0x66b1('0x52'));db['SmsQueue']=db[_0x66b1('0x3')]['import'](_0x66b1('0x53'));db[_0x66b1('0x54')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x55'));db[_0x66b1('0x56')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x66b1('0x57')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x58'));db[_0x66b1('0x59')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x5a'));db[_0x66b1('0x5b')]=db[_0x66b1('0x3')]['import']('../api/chatWebsite/chatWebsite.model');db[_0x66b1('0x5c')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x66b1('0x5d')]=db['sequelize']['import'](_0x66b1('0x5e'));db['ChatInteraction']=db['sequelize'][_0x66b1('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x66b1('0x5f')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x60'));db[_0x66b1('0x61')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x62'));db[_0x66b1('0x63')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x64'));db[_0x66b1('0x65')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x66'));db[_0x66b1('0x67')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x68'));db['CmCompany']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x69'));db[_0x66b1('0x6a')]=db['sequelize'][_0x66b1('0x13')]('../api/cmContact/cmContact.model');db[_0x66b1('0x6b')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x6c'));db['CmHopperBlack']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x6d'));db['CmHopperFinal']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x6e'));db[_0x66b1('0x6f')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x70'));db[_0x66b1('0x71')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x72'));db[_0x66b1('0x73')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x74'));db['Action']=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/action/action.model');db[_0x66b1('0x75')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x76'));db['CannedAnswer']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x77'));db[_0x66b1('0x78')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x79'));db[_0x66b1('0x7a')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x7b'));db[_0x66b1('0x7c')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x7d'));db['Pause']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x7e'));db['Cdr']=db['sequelize']['import']('../api/cdr/cdr.model');db[_0x66b1('0x7f')]=db['sequelize'][_0x66b1('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x66b1('0x80')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x81'));db['Sound']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x82'));db[_0x66b1('0x83')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x84'));db[_0x66b1('0x85')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x86'));db[_0x66b1('0x87')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x88'));db[_0x66b1('0x89')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x8a'));db[_0x66b1('0x8b')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x8c'));db['IntegrationReport']=db['sequelize']['import'](_0x66b1('0x8d'));db['AnalyticCustomReport']=db[_0x66b1('0x3')]['import'](_0x66b1('0x8e'));db[_0x66b1('0x8f')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x90'));db[_0x66b1('0x91')]=db[_0x66b1('0x3')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x66b1('0x92')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x93'));db['AnalyticFieldReport']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x94'));db[_0x66b1('0x95')]=db[_0x66b1('0x3')]['import'](_0x66b1('0x96'));db[_0x66b1('0x97')]=db['sequelize'][_0x66b1('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x66b1('0x98')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x99'));db[_0x66b1('0x9a')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x66b1('0x9b')]=db[_0x66b1('0x3')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x66b1('0x9c')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x66b1('0x9d')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x9e'));db[_0x66b1('0x9f')]=db[_0x66b1('0x3')]['import']('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xa0'));db['DeskField']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xa1'));db['ZohoAccount']=db[_0x66b1('0x3')]['import'](_0x66b1('0xa2'));db[_0x66b1('0xa3')]=db['sequelize']['import'](_0x66b1('0xa4'));db[_0x66b1('0xa5')]=db['sequelize'][_0x66b1('0x13')]('../api/intZohoField/intZohoField.model');db[_0x66b1('0xa6')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xa7'));db[_0x66b1('0xa8')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xa9'));db[_0x66b1('0xaa')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xab'));db['FreshdeskAccount']=db['sequelize'][_0x66b1('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x66b1('0xac')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x66b1('0xad')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xae'));db['VtigerAccount']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xaf'));db[_0x66b1('0xb0')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xb1'));db[_0x66b1('0xb2')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xb3'));db['ServicenowAccount']=db['sequelize'][_0x66b1('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x66b1('0xb4')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xb5'));db[_0x66b1('0xb6')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xb7'));db[_0x66b1('0xb8')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xb9'));db[_0x66b1('0xba')]=db['sequelize'][_0x66b1('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x66b1('0xbb')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xbc'));db['FreshsalesAccount']=db[_0x66b1('0x3')]['import'](_0x66b1('0xbd'));db[_0x66b1('0xbe')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xbf'));db[_0x66b1('0xc0')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xc1'));db[_0x66b1('0x8b')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0x8c'));db['Network']=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xc2'));db[_0x66b1('0xc3')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xc4'));db[_0x66b1('0xc5')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x66b1('0xc6')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xc7'));db[_0x66b1('0xc8')]=db[_0x66b1('0x3')]['import'](_0x66b1('0xc9'));db[_0x66b1('0xca')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xcb'));db['SquareReport']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xcc'));db[_0x66b1('0xcd')]=db['sequelize'][_0x66b1('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x66b1('0xce')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xcf'));db[_0x66b1('0xd0')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xd1'));db[_0x66b1('0xd2')]=db[_0x66b1('0x3')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x66b1('0xd3')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xd4'));db[_0x66b1('0xd5')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/squareRecording/squareRecording.model');db[_0x66b1('0xd6')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xd7'));db[_0x66b1('0xd8')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xd9'));db[_0x66b1('0xda')]=db[_0x66b1('0x3')]['import'](_0x66b1('0xdb'));db[_0x66b1('0xdc')]=db['sequelize'][_0x66b1('0x13')]('../api/campaign/campaign.model');db[_0x66b1('0xdd')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xde'));db['Attachment']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xdf'));db['Plugin']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xe0'));db[_0x66b1('0xe1')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x66b1('0xe2')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xe3'));db[_0x66b1('0xe4')]=db[_0x66b1('0x3')]['import'](_0x66b1('0xe5'));db[_0x66b1('0xe6')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xe7'));db[_0x66b1('0xe8')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xe9'));db[_0x66b1('0xea')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xeb'));db[_0x66b1('0xec')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xed'));db['UserProfile']=db['sequelize'][_0x66b1('0x13')]('../api/userProfile/userProfile.model');db[_0x66b1('0xee')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xef'));db[_0x66b1('0xf0')]=db[_0x66b1('0x3')]['import'](_0x66b1('0xf1'));db[_0x66b1('0xf2')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xf3'));db['WhatsappAccount']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xf4'));db[_0x66b1('0xf5')]=db['sequelize']['import'](_0x66b1('0xf6'));db['WhatsappInteraction']=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xf7'));db[_0x66b1('0xf8')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x66b1('0xf9')]=db[_0x66b1('0x3')][_0x66b1('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize']['import'](_0x66b1('0xfa'));db[_0x66b1('0xfb')]=db['sequelize'][_0x66b1('0x13')](_0x66b1('0xfc'));db[_0x66b1('0xfd')]=db['sequelize']['import']('../api/cloudProvider/cloudProvider.model');db[_0x66b1('0xfe')]=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0xff'));db['TeamVoicePrefix']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x100'));db['UserVoicePrefix']=db[_0x66b1('0x3')][_0x66b1('0x13')](_0x66b1('0x101'));db[_0x66b1('0x102')]=db['sequelize']['import']('../api/user-setting/user-setting.model');db[_0x66b1('0x12')][_0x66b1('0x103')](db[_0x66b1('0x1f')],{'as':_0x66b1('0x1f'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')][_0x66b1('0x103')](db['UserSetting'],{'as':_0x66b1('0x106'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')][_0x66b1('0x107')](db['VoiceRecording'],{'as':_0x66b1('0x108'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')][_0x66b1('0x107')](db[_0x66b1('0x2b')],{'as':_0x66b1('0x109'),'foreignKey':'UserId'});db[_0x66b1('0x12')][_0x66b1('0x107')](db['VoiceExtension'],{'as':_0x66b1('0x10a'),'onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x12')][_0x66b1('0x107')](db[_0x66b1('0x10b')],{'as':_0x66b1('0x10c'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')]['hasMany'](db[_0x66b1('0x6f')],{'as':_0x66b1('0x10d'),'foreignKey':'UserId'});db[_0x66b1('0x12')][_0x66b1('0x107')](db[_0x66b1('0x71')],{'as':_0x66b1('0x71'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')]['hasMany'](db[_0x66b1('0x57')],{'as':_0x66b1('0x10e'),'foreignKey':_0x66b1('0x105')});db['User'][_0x66b1('0x107')](db['ChatInteraction'],{'as':_0x66b1('0x10f'),'foreignKey':_0x66b1('0x105')});db['User']['hasMany'](db[_0x66b1('0x4f')],{'as':'SmsInteractions','foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')]['hasMany'](db['FaxInteraction'],{'as':_0x66b1('0x110'),'foreignKey':_0x66b1('0x105')});db['User'][_0x66b1('0x107')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x66b1('0x105')});db[_0x66b1('0x12')][_0x66b1('0x107')](db[_0x66b1('0x111')],{'as':_0x66b1('0x112'),'foreignKey':_0x66b1('0x105')});db['User']['hasMany'](db[_0x66b1('0xf2')],{'as':_0x66b1('0x113'),'foreignKey':'SenderId'});db[_0x66b1('0x12')][_0x66b1('0x114')](db[_0x66b1('0x115')],{'as':_0x66b1('0x115'),'foreignKey':_0x66b1('0x116')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x65')],{'as':_0x66b1('0x118'),'through':_0x66b1('0x119')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x11a'),'through':_0x66b1('0x11b')});db[_0x66b1('0x12')][_0x66b1('0x117')](db['CmList'],{'as':_0x66b1('0x11c'),'through':_0x66b1('0x11d')});db['User'][_0x66b1('0x117')](db[_0x66b1('0xd8')],{'through':_0x66b1('0x11e')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x3c')],{'as':_0x66b1('0x11f'),'through':'user_has_mail_interactions'});db['User'][_0x66b1('0x117')](db[_0x66b1('0x120')],{'as':_0x66b1('0x10f'),'through':'user_has_chat_interactions'});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x45')],{'as':_0x66b1('0x110'),'through':_0x66b1('0x121')});db[_0x66b1('0x12')][_0x66b1('0x117')](db['SmsInteraction'],{'as':_0x66b1('0x122'),'through':_0x66b1('0x123')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x57')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x66b1('0x12')][_0x66b1('0x117')](db['WhatsappInteraction'],{'as':_0x66b1('0x112'),'through':_0x66b1('0x124')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x1c')],{'as':_0x66b1('0x125'),'through':'UserVoiceQueue','required':![]});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0xec')],{'as':'VoicePrefixes','through':_0x66b1('0x126'),'required':![]});db['User'][_0x66b1('0x117')](db[_0x66b1('0x39')],{'as':_0x66b1('0x127'),'through':_0x66b1('0x128'),'required':![]});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x63')],{'as':_0x66b1('0x129'),'through':_0x66b1('0x12a'),'required':![],'hooks':!![]});db[_0x66b1('0x12')]['belongsToMany'](db[_0x66b1('0x48')],{'as':_0x66b1('0x12b'),'through':_0x66b1('0x2f'),'required':![]});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x12c')],{'as':'SmsQueues','through':_0x66b1('0x12d'),'required':![]});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x59')],{'as':_0x66b1('0x12e'),'through':_0x66b1('0x31'),'required':![]});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0xfb')],{'as':_0x66b1('0x12f'),'through':_0x66b1('0x33'),'required':![]});db['User'][_0x66b1('0x117')](db[_0x66b1('0xea')],{'through':'cm_user_has_lists'});db['User'][_0x66b1('0x117')](db[_0x66b1('0x5b')],{'as':_0x66b1('0x130'),'through':'user_has_chat_websites'});db[_0x66b1('0x12')]['belongsToMany'](db[_0x66b1('0x42')],{'as':_0x66b1('0x131'),'through':'user_has_fax_accounts'});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x38')],{'as':_0x66b1('0x132'),'through':_0x66b1('0x133')});db[_0x66b1('0x12')]['belongsToMany'](db[_0x66b1('0x54')],{'as':_0x66b1('0x134'),'through':_0x66b1('0x135')});db['User'][_0x66b1('0x117')](db[_0x66b1('0x136')],{'as':_0x66b1('0x137'),'through':_0x66b1('0x138')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0x139')],{'as':_0x66b1('0x13a'),'through':_0x66b1('0x13b')});db[_0x66b1('0x12')][_0x66b1('0x117')](db[_0x66b1('0xd3')],{'as':_0x66b1('0x13c'),'through':'user_has_square_projects'});db[_0x66b1('0x14')][_0x66b1('0x107')](db[_0x66b1('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db['VoiceContext'][_0x66b1('0x107')](db[_0x66b1('0x18')],{'onDelete':_0x66b1('0x104')});db['VoiceExtension'][_0x66b1('0x107')](db[_0x66b1('0x18')],{'as':_0x66b1('0x13d'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x1a')][_0x66b1('0x117')](db[_0x66b1('0x13e')],{'as':_0x66b1('0x13f'),'through':'moh_has_sounds'});db[_0x66b1('0x1c')][_0x66b1('0x107')](db[_0x66b1('0x2b')],{'as':_0x66b1('0x140'),'foreignKey':'VoiceQueueId'});db[_0x66b1('0x1c')][_0x66b1('0x107')](db[_0x66b1('0x6b')],{'as':_0x66b1('0x141'),'foreignKey':_0x66b1('0x142')});db[_0x66b1('0x1c')][_0x66b1('0x107')](db[_0x66b1('0x10b')],{'as':'HopperFinals','foreignKey':_0x66b1('0x142')});db[_0x66b1('0x1c')][_0x66b1('0x107')](db[_0x66b1('0x6f')],{'as':_0x66b1('0x143'),'foreignKey':_0x66b1('0x142')});db[_0x66b1('0x1c')][_0x66b1('0x107')](db['ReportAgentPreview'],{'as':_0x66b1('0x71'),'foreignKey':_0x66b1('0x142')});db[_0x66b1('0x1c')][_0x66b1('0x107')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x66b1('0x142')});db[_0x66b1('0x1c')][_0x66b1('0x107')](db[_0x66b1('0xc8')],{'as':_0x66b1('0x144'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0x66b1('0x145')],{'as':_0x66b1('0x145'),'foreignKey':_0x66b1('0x146')});db[_0x66b1('0x1c')][_0x66b1('0x114')](db['Trunk'],{'as':_0x66b1('0x147'),'foreignKey':'TrunkBackupId'});db[_0x66b1('0x1c')][_0x66b1('0x114')](db['Interval'],{'as':_0x66b1('0x7c'),'foreignKey':_0x66b1('0x148')});db['VoiceQueue'][_0x66b1('0x114')](db[_0x66b1('0x149')],{'as':'mandatoryDispositionPause','foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x1c')]['belongsToMany'](db[_0x66b1('0xea')],{'as':'Lists','through':_0x66b1('0x14b')});db[_0x66b1('0x1c')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x66b1('0x2d')});db[_0x66b1('0x1c')][_0x66b1('0x117')](db[_0x66b1('0xd8')],{'as':_0x66b1('0x14c'),'through':_0x66b1('0xfe')});db['VoiceQueue']['belongsToMany'](db[_0x66b1('0xea')],{'as':_0x66b1('0x14d'),'through':'voice_queues_has_cm_blacklists'});db[_0x66b1('0x1d')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':'User','foreignKey':_0x66b1('0x105')});db[_0x66b1('0x14e')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x12'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x1f')][_0x66b1('0x107')](db[_0x66b1('0x14f')],{'as':'Messages','onDelete':_0x66b1('0x104'),'foreignKey':'mailboxuser','sourceKey':_0x66b1('0x150')});db[_0x66b1('0x14f')][_0x66b1('0x114')](db[_0x66b1('0x1f')],{'foreignKey':_0x66b1('0x151'),'targetKey':_0x66b1('0x150')});db['VoiceCallReport'][_0x66b1('0x107')](db[_0x66b1('0x26')],{'as':_0x66b1('0x152'),'foreignKey':'uniqueid','constraints':![]});db[_0x66b1('0x22')][_0x66b1('0x107')](db[_0x66b1('0x25')],{'as':'AgentReports','foreignKey':_0x66b1('0x153'),'constraints':![]});db[_0x66b1('0x22')]['belongsTo'](db[_0x66b1('0x12')],{'as':_0x66b1('0x12'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x22')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db['MailServerIn'][_0x66b1('0x114')](db[_0x66b1('0x38')],{'as':_0x66b1('0x38'),'foreignKey':_0x66b1('0x156')});db['MailServerIn'][_0x66b1('0x114')](db[_0x66b1('0xfd')],{'as':_0x66b1('0xfd'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x66b1('0x37')]['belongsTo'](db[_0x66b1('0x38')],{'as':_0x66b1('0x38'),'foreignKey':_0x66b1('0x156')});db[_0x66b1('0x37')][_0x66b1('0x114')](db[_0x66b1('0xfd')],{'as':'CloudProvider','foreignKey':_0x66b1('0x157'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x38')][_0x66b1('0x103')](db[_0x66b1('0x35')],{'as':'Imap','onDelete':_0x66b1('0x104')});db[_0x66b1('0x38')][_0x66b1('0x103')](db[_0x66b1('0x37')],{'as':_0x66b1('0x159'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x38')][_0x66b1('0x107')](db['Disposition'],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x156'),'onDelete':'cascade'});db[_0x66b1('0x38')][_0x66b1('0x107')](db[_0x66b1('0x15b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x66b1('0x38')][_0x66b1('0x107')](db[_0x66b1('0x3d')],{'as':_0x66b1('0x15c'),'foreignKey':_0x66b1('0x156')});db[_0x66b1('0x38')][_0x66b1('0x107')](db[_0x66b1('0x3c')],{'as':_0x66b1('0x15d')});db[_0x66b1('0x38')][_0x66b1('0x107')](db[_0x66b1('0x15e')],{'as':_0x66b1('0x13d')});db[_0x66b1('0x38')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':'List','foreignKey':_0x66b1('0x15f')});db['MailAccount'][_0x66b1('0x114')](db['Template'],{'as':_0x66b1('0x85'),'foreignKey':_0x66b1('0x160')});db['MailAccount'][_0x66b1('0x114')](db[_0x66b1('0x149')],{'as':'mandatoryDispositionPause','foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x38')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x133')});db['MailQueue'][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':'UserMailQueue'});db['MailQueue']['belongsToMany'](db[_0x66b1('0xd8')],{'through':_0x66b1('0x162'),'as':'Teams'});db['MailInteraction']['hasMany'](db[_0x66b1('0x3d')],{'as':_0x66b1('0x15c'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x66b1('0x3c')][_0x66b1('0x114')](db[_0x66b1('0x38')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x156')});db[_0x66b1('0x3c')]['belongsTo'](db[_0x66b1('0x6a')],{'as':'Contact','foreignKey':_0x66b1('0x155')});db[_0x66b1('0x3c')]['belongsTo'](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x3c')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x66b1('0x3c')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':'mail_interaction_has_tags','as':_0x66b1('0x165')});db['MailInteraction'][_0x66b1('0x117')](db['User'],{'as':_0x66b1('0x166'),'through':'user_has_mail_interactions','foreignKey':_0x66b1('0x167')});db[_0x66b1('0x3d')][_0x66b1('0x107')](db[_0x66b1('0x168')],{'as':_0x66b1('0x169'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x3d')]['belongsTo'](db[_0x66b1('0x12')],{'as':_0x66b1('0x12')});db['MailMessage']['belongsTo'](db[_0x66b1('0x6a')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x154')});db[_0x66b1('0x3d')][_0x66b1('0x114')](db[_0x66b1('0x3c')],{'as':_0x66b1('0x16a'),'foreignKey':'MailInteractionId'});db[_0x66b1('0x3d')]['belongsTo'](db[_0x66b1('0x38')],{'as':'Account','foreignKey':_0x66b1('0x156')});db[_0x66b1('0x3d')][_0x66b1('0x114')](db['ChatWebsite'],{'as':_0x66b1('0x5b'),'foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x3d')][_0x66b1('0x114')](db[_0x66b1('0x61')],{'as':_0x66b1('0x61'),'foreignKey':'ChatOfflineMessageId'});db[_0x66b1('0x15e')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':_0x66b1('0x158')});db['MailApplication'][_0x66b1('0x114')](db['MailQueue'],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x15e')][_0x66b1('0x114')](db[_0x66b1('0x38')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x15e')][_0x66b1('0x114')](db[_0x66b1('0x7c')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x148')});db[_0x66b1('0x15e')]['belongsTo'](db[_0x66b1('0x83')],{'onDelete':_0x66b1('0x158'),'foreignKey':'TagId'});db['MailQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x38')],{});db[_0x66b1('0x3e')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0x3e')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db['MailQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x3c')],{});db[_0x66b1('0x3e')][_0x66b1('0x114')](db[_0x66b1('0x3d')],{});db[_0x66b1('0x3e')]['belongsTo'](db[_0x66b1('0x12')],{});db['MailQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x39')],{});db[_0x66b1('0x16d')][_0x66b1('0x107')](db[_0x66b1('0x16e')],{'as':_0x66b1('0x16f'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x42')][_0x66b1('0x107')](db['Disposition'],{'as':_0x66b1('0x15a'),'foreignKey':'FaxAccountId','onDelete':_0x66b1('0x104')});db['FaxAccount']['hasMany'](db[_0x66b1('0x15b')],{'as':_0x66b1('0x170'),'foreignKey':_0x66b1('0x171')});db[_0x66b1('0x42')][_0x66b1('0x107')](db[_0x66b1('0x45')],{'as':_0x66b1('0x15d')});db[_0x66b1('0x42')][_0x66b1('0x107')](db[_0x66b1('0x43')],{'as':_0x66b1('0x13d')});db[_0x66b1('0x42')]['hasMany'](db[_0x66b1('0x18')],{'as':_0x66b1('0x172'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x42')]['hasMany'](db[_0x66b1('0x46')],{'as':_0x66b1('0x15c')});db[_0x66b1('0x42')][_0x66b1('0x114')](db[_0x66b1('0x145')],{'as':_0x66b1('0x145')});db[_0x66b1('0x42')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0x42')][_0x66b1('0x114')](db['Pause'],{'as':_0x66b1('0x173'),'foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x42')]['belongsToMany'](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x174')});db['FaxApplication'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x43')][_0x66b1('0x114')](db[_0x66b1('0x48')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x43')]['belongsTo'](db[_0x66b1('0x42')],{'onDelete':_0x66b1('0x158')});db['FaxApplication'][_0x66b1('0x114')](db['Tag'],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x175')});db[_0x66b1('0x45')][_0x66b1('0x107')](db['FaxMessage'],{'as':_0x66b1('0x15c'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x176')});db[_0x66b1('0x45')][_0x66b1('0x114')](db[_0x66b1('0x42')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x171')});db['FaxInteraction'][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db['FaxInteraction']['belongsTo'](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':_0x66b1('0x105')});db[_0x66b1('0x45')][_0x66b1('0x117')](db['Tag'],{'through':_0x66b1('0x177'),'as':_0x66b1('0x178')});db[_0x66b1('0x45')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x66b1('0x45')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x166'),'through':_0x66b1('0x121'),'foreignKey':'FaxInteractionId'});db[_0x66b1('0x46')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x12')});db['FaxMessage'][_0x66b1('0x114')](db['FaxInteraction'],{'as':_0x66b1('0x16a'),'foreignKey':_0x66b1('0x176')});db[_0x66b1('0x46')]['belongsTo'](db['CmContact'],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x154')});db[_0x66b1('0x46')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x66b1('0x46')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x66b1('0x171')});db['FaxQueue'][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x2f')});db[_0x66b1('0x48')]['belongsToMany'](db[_0x66b1('0xd8')],{'through':_0x66b1('0x179'),'as':_0x66b1('0x14c')});db['FaxQueueReport']['belongsTo'](db[_0x66b1('0x42')],{});db[_0x66b1('0x4a')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0x4a')][_0x66b1('0x114')](db['CmContact'],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db['FaxQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x45')],{});db['FaxQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x46')],{});db[_0x66b1('0x4a')][_0x66b1('0x114')](db[_0x66b1('0x12')],{});db['FaxQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x48')],{});db['SmsAccount'][_0x66b1('0x107')](db[_0x66b1('0x78')],{'as':_0x66b1('0x15a'),'foreignKey':'SmsAccountId','onDelete':_0x66b1('0x104')});db['SmsAccount'][_0x66b1('0x107')](db[_0x66b1('0x15b')],{'as':_0x66b1('0x170'),'foreignKey':'SmsAccountId'});db[_0x66b1('0x136')][_0x66b1('0x107')](db[_0x66b1('0x51')],{'as':_0x66b1('0x15c'),'foreignKey':_0x66b1('0x17a')});db[_0x66b1('0x136')][_0x66b1('0x107')](db[_0x66b1('0x4f')],{'as':'Interactions'});db[_0x66b1('0x136')][_0x66b1('0x107')](db[_0x66b1('0x4d')],{'as':'Applications'});db[_0x66b1('0x136')]['belongsTo'](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':'ListId'});db[_0x66b1('0x136')][_0x66b1('0x114')](db[_0x66b1('0x149')],{'as':_0x66b1('0x173'),'foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x136')][_0x66b1('0x117')](db['User'],{'as':_0x66b1('0x161'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':'restrict'});db[_0x66b1('0x4d')][_0x66b1('0x114')](db[_0x66b1('0x12c')],{'onDelete':_0x66b1('0x158')});db['SmsApplication']['belongsTo'](db[_0x66b1('0x136')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x4d')][_0x66b1('0x114')](db[_0x66b1('0x7c')],{'onDelete':_0x66b1('0x158'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x66b1('0x114')](db[_0x66b1('0x83')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x175')});db['SmsInteraction'][_0x66b1('0x107')](db[_0x66b1('0x51')],{'as':_0x66b1('0x15c'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x17b')});db[_0x66b1('0x4f')][_0x66b1('0x114')](db[_0x66b1('0x136')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x17a')});db[_0x66b1('0x4f')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0x4f')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':_0x66b1('0x105')});db['SmsInteraction'][_0x66b1('0x117')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x66b1('0x178')});db[_0x66b1('0x4f')][_0x66b1('0x117')](db['Tag'],{'through':_0x66b1('0x17c'),'as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db['User'],{'as':_0x66b1('0x166'),'through':_0x66b1('0x123'),'foreignKey':_0x66b1('0x17b')});db['SmsMessage'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x12')});db[_0x66b1('0x51')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'onDelete':'cascade','as':_0x66b1('0x154')});db[_0x66b1('0x51')][_0x66b1('0x114')](db[_0x66b1('0x4f')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x16a'),'foreignKey':_0x66b1('0x17b')});db[_0x66b1('0x51')][_0x66b1('0x114')](db['SmsAccount'],{'as':'Account','foreignKey':_0x66b1('0x17a')});db[_0x66b1('0x12c')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x12d'),'foreignKey':_0x66b1('0x17d')});db[_0x66b1('0x12c')][_0x66b1('0x117')](db[_0x66b1('0xd8')],{'through':_0x66b1('0x17e'),'as':_0x66b1('0x14c')});db[_0x66b1('0x54')][_0x66b1('0x107')](db['Disposition'],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x17f'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x66b1('0x107')](db[_0x66b1('0x15b')],{'as':_0x66b1('0x170'),'foreignKey':_0x66b1('0x17f')});db[_0x66b1('0x54')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x66b1('0x15d'),'foreignKey':_0x66b1('0x17f')});db[_0x66b1('0x54')]['hasMany'](db[_0x66b1('0x180')],{'as':_0x66b1('0x15c'),'foreignKey':'OpenchannelAccountId'});db[_0x66b1('0x54')][_0x66b1('0x107')](db[_0x66b1('0x56')],{'as':_0x66b1('0x13d'),'foreignKey':_0x66b1('0x17f')});db['OpenchannelAccount']['belongsTo'](db[_0x66b1('0xea')],{'as':'List','foreignKey':'ListId'});db[_0x66b1('0x54')]['belongsTo'](db['Pause'],{'as':_0x66b1('0x173'),'foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x54')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':'Agents','through':_0x66b1('0x135')});db['OpenchannelApplication'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0x56')][_0x66b1('0x114')](db['OpenchannelQueue'],{'onDelete':_0x66b1('0x158'),'foreignKey':'OpenchannelQueueId'});db[_0x66b1('0x56')][_0x66b1('0x114')](db[_0x66b1('0x54')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x17f')});db['OpenchannelApplication'][_0x66b1('0x114')](db[_0x66b1('0x7c')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x148')});db[_0x66b1('0x56')][_0x66b1('0x114')](db[_0x66b1('0x83')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x175')});db[_0x66b1('0x57')][_0x66b1('0x107')](db[_0x66b1('0x180')],{'as':_0x66b1('0x15c'),'onDelete':'cascade','foreignKey':_0x66b1('0x181')});db[_0x66b1('0x57')]['belongsTo'](db[_0x66b1('0x54')],{'as':_0x66b1('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x66b1('0x57')][_0x66b1('0x114')](db['CmContact'],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0x57')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':'UserId'});db[_0x66b1('0x57')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':_0x66b1('0x182'),'as':'Tags'});db[_0x66b1('0x57')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x66b1('0x57')]['belongsToMany'](db['User'],{'as':_0x66b1('0x166'),'through':'user_has_openchannel_interactions','foreignKey':_0x66b1('0x181')});db[_0x66b1('0x180')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x12')});db['OpenchannelMessage'][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x154')});db[_0x66b1('0x180')]['belongsTo'](db[_0x66b1('0x57')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x16a'),'foreignKey':_0x66b1('0x181')});db[_0x66b1('0x180')]['belongsTo'](db[_0x66b1('0x168')],{'as':_0x66b1('0x168'),'foreignKey':'AttachmentId'});db[_0x66b1('0x180')][_0x66b1('0x114')](db[_0x66b1('0x54')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x17f')});db['OpenchannelQueue'][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':'UserOpenchannelQueue','foreignKey':_0x66b1('0x183')});db[_0x66b1('0x59')][_0x66b1('0x117')](db['Team'],{'through':_0x66b1('0x184'),'as':'Teams'});db[_0x66b1('0x5b')][_0x66b1('0x107')](db['Disposition'],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x16b'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x5b')][_0x66b1('0x107')](db[_0x66b1('0x15b')],{'as':_0x66b1('0x170'),'foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x5b')]['hasMany'](db[_0x66b1('0x67')],{'as':_0x66b1('0x185')});db[_0x66b1('0x5b')][_0x66b1('0x107')](db['ChatInteraction'],{'as':'Interactions'});db[_0x66b1('0x5b')][_0x66b1('0x107')](db[_0x66b1('0x5d')],{'as':_0x66b1('0x13d')});db['ChatWebsite'][_0x66b1('0x107')](db['ChatMessage'],{'as':_0x66b1('0x15c')});db[_0x66b1('0x5b')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db['ChatWebsite']['belongsTo'](db[_0x66b1('0x7c')],{'as':_0x66b1('0x7c'),'foreignKey':_0x66b1('0x148')});db[_0x66b1('0x5b')][_0x66b1('0x114')](db['MailAccount'],{'as':_0x66b1('0x38'),'foreignKey':_0x66b1('0x156')});db[_0x66b1('0x5b')][_0x66b1('0x114')](db[_0x66b1('0x149')],{'as':_0x66b1('0x173'),'foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x5b')]['belongsToMany'](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x186')});db[_0x66b1('0x5c')][_0x66b1('0x114')](db[_0x66b1('0x54')],{});db[_0x66b1('0x5c')]['belongsTo'](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0x5c')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0x5c')][_0x66b1('0x114')](db[_0x66b1('0x57')],{});db[_0x66b1('0x5c')][_0x66b1('0x114')](db[_0x66b1('0x180')],{});db['OpenchannelQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x12')],{});db[_0x66b1('0x5c')][_0x66b1('0x114')](db[_0x66b1('0x59')],{});db[_0x66b1('0x5d')]['belongsTo'](db[_0x66b1('0x12')],{'as':_0x66b1('0x187'),'foreignKey':_0x66b1('0x105'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x5d')][_0x66b1('0x114')](db['ChatQueue'],{'as':_0x66b1('0x188'),'foreignKey':_0x66b1('0x189'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x5d')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'as':_0x66b1('0x18a'),'foreignKey':_0x66b1('0x16b'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x5d')]['belongsTo'](db[_0x66b1('0x83')],{'onDelete':'restrict','foreignKey':_0x66b1('0x175')});db[_0x66b1('0x120')][_0x66b1('0x107')](db['ChatMessage'],{'as':_0x66b1('0x15c'),'onDelete':_0x66b1('0x104'),'foreignKey':'ChatInteractionId'});db[_0x66b1('0x120')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'as':'Account','foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x120')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':'Contact','foreignKey':_0x66b1('0x155')});db[_0x66b1('0x120')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':'UserId'});db[_0x66b1('0x120')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':_0x66b1('0x18b'),'as':_0x66b1('0x178')});db['ChatInteraction'][_0x66b1('0x117')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x66b1('0x165')});db['ChatInteraction'][_0x66b1('0x117')](db['User'],{'as':_0x66b1('0x166'),'through':_0x66b1('0x18c'),'foreignKey':_0x66b1('0x18d')});db['ChatMessage']['belongsTo'](db['User'],{'onDelete':_0x66b1('0x104'),'as':'User'});db['ChatMessage'][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'onDelete':_0x66b1('0x104'),'as':_0x66b1('0x154'),'foreignKey':'ContactId'});db['ChatMessage'][_0x66b1('0x114')](db[_0x66b1('0x120')],{'onDelete':_0x66b1('0x104'),'as':'Interaction','foreignKey':_0x66b1('0x18d')});db[_0x66b1('0x5f')]['belongsTo'](db[_0x66b1('0x168')],{'as':_0x66b1('0x168'),'foreignKey':_0x66b1('0x18e')});db[_0x66b1('0x5f')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'as':'Account','foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x61')][_0x66b1('0x107')](db[_0x66b1('0x168')],{'as':_0x66b1('0x169'),'foreignKey':_0x66b1('0x18f'),'onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x61')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'onDelete':_0x66b1('0x104'),'as':'Contact','foreignKey':_0x66b1('0x155')});db[_0x66b1('0x61')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x63')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x12a'),'hooks':!![]});db[_0x66b1('0x63')][_0x66b1('0x117')](db[_0x66b1('0xd8')],{'through':_0x66b1('0x190'),'as':_0x66b1('0x14c')});db[_0x66b1('0x65')][_0x66b1('0x107')](db[_0x66b1('0xc3')],{'as':_0x66b1('0x15c'),'foreignKey':_0x66b1('0x191'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x65')]['belongsToMany'](db[_0x66b1('0x12')],{'as':_0x66b1('0x140'),'through':'chat_group_has_users'});db[_0x66b1('0x67')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'as':'Website','foreignKey':_0x66b1('0x16b')});db[_0x66b1('0x192')]['hasMany'](db[_0x66b1('0x6a')],{'as':_0x66b1('0x11a'),'foreignKey':_0x66b1('0x193')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db[_0x66b1('0x6b')],{'as':_0x66b1('0x141'),'foreignKey':_0x66b1('0x155')});db['CmContact'][_0x66b1('0x107')](db[_0x66b1('0x10b')],{'as':'HopperFinals','foreignKey':_0x66b1('0x155')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db[_0x66b1('0x6f')],{'as':_0x66b1('0x143'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0x6a')]['hasMany'](db[_0x66b1('0x71')],{'as':_0x66b1('0x71'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db[_0x66b1('0xc8')],{'as':'JscriptySessions','foreignKey':_0x66b1('0x155')});db['CmContact'][_0x66b1('0x107')](db[_0x66b1('0x57')],{'as':'OpenchannelInteractions','foreignKey':_0x66b1('0x155'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db[_0x66b1('0x120')],{'as':'ChatInteractions','foreignKey':_0x66b1('0x155'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db['SmsInteraction'],{'as':_0x66b1('0x122'),'foreignKey':_0x66b1('0x155'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x6a')][_0x66b1('0x107')](db['FaxInteraction'],{'as':_0x66b1('0x110'),'foreignKey':'ContactId','onDelete':_0x66b1('0x158')});db[_0x66b1('0x6a')]['hasMany'](db[_0x66b1('0x3c')],{'as':_0x66b1('0x11f'),'foreignKey':_0x66b1('0x155'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x6a')][_0x66b1('0x114')](db[_0x66b1('0x192')],{'as':_0x66b1('0x194'),'foreignKey':_0x66b1('0x193')});db[_0x66b1('0x6a')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f'),'onDelete':'cascade'});db[_0x66b1('0x6a')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x166'),'through':_0x66b1('0x11b')});db['CmContact'][_0x66b1('0x117')](db[_0x66b1('0x83')],{'as':'Tags','through':_0x66b1('0x195')});db[_0x66b1('0x6a')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper'][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':'Contact','foreignKey':_0x66b1('0x155'),'onDelete':'cascade'});db[_0x66b1('0x6b')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x6b')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':'Agent','foreignKey':'UserId'});db['CmHopper'][_0x66b1('0x114')](db[_0x66b1('0x1c')],{'as':_0x66b1('0x188'),'foreignKey':_0x66b1('0x142'),'onDelete':'cascade'});db['CmHopper'][_0x66b1('0x114')](db[_0x66b1('0xdc')],{'as':_0x66b1('0xdc'),'foreignKey':_0x66b1('0x196'),'onDelete':_0x66b1('0x104')});db['CmHopper'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':'Owner','foreignKey':_0x66b1('0x197')});db[_0x66b1('0x198')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':'Contact','foreignKey':_0x66b1('0x155'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x198')][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f'),'onDelete':_0x66b1('0x104')});db['CmHopperBlack'][_0x66b1('0x114')](db[_0x66b1('0x1c')],{'as':_0x66b1('0x188'),'foreignKey':_0x66b1('0x142'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0x198')][_0x66b1('0x114')](db[_0x66b1('0xdc')],{'as':_0x66b1('0xdc'),'foreignKey':_0x66b1('0x196'),'onDelete':_0x66b1('0x104')});db['Automation'][_0x66b1('0x107')](db[_0x66b1('0x7a')],{'as':{'plural':_0x66b1('0x199'),'singular':_0x66b1('0x19a')},'foreignKey':_0x66b1('0x19b'),'onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x75')][_0x66b1('0x107')](db['Condition'],{'as':{'plural':_0x66b1('0x19c'),'singular':_0x66b1('0x19d')},'foreignKey':_0x66b1('0x19e'),'onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x75')][_0x66b1('0x107')](db[_0x66b1('0x19f')],{'as':_0x66b1('0x1a0'),'foreignKey':'AutomationId','onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x78')]['hasMany'](db[_0x66b1('0x78')],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x1a1'),'onDelete':'cascade'});db[_0x66b1('0x7c')][_0x66b1('0x107')](db['Interval'],{'as':_0x66b1('0x1a2'),'foreignKey':_0x66b1('0x148'),'onDelete':_0x66b1('0x104'),'hooks':!![],'required':![]});db['Interval'][_0x66b1('0x107')](db[_0x66b1('0x18')],{'as':_0x66b1('0x10a'),'foreignKey':_0x66b1('0x148'),'onDelete':_0x66b1('0x158')});db[_0x66b1('0x7c')][_0x66b1('0x107')](db['MailApplication'],{'as':_0x66b1('0x1a3'),'foreignKey':_0x66b1('0x148')});db[_0x66b1('0x7c')][_0x66b1('0x107')](db[_0x66b1('0x5d')],{'as':_0x66b1('0x1a4'),'foreignKey':'IntervalId'});db[_0x66b1('0x7c')][_0x66b1('0x107')](db[_0x66b1('0x43')],{'as':_0x66b1('0x1a5'),'foreignKey':_0x66b1('0x148')});db[_0x66b1('0x7c')][_0x66b1('0x107')](db[_0x66b1('0x4d')],{'as':_0x66b1('0x1a6'),'foreignKey':'IntervalId'});db[_0x66b1('0x80')][_0x66b1('0x114')](db[_0x66b1('0x38')],{});db[_0x66b1('0x80')][_0x66b1('0x114')](db[_0x66b1('0x8f')],{'foreignKey':_0x66b1('0x1a7')});db['Schedule'][_0x66b1('0x114')](db[_0x66b1('0x1a8')],{'foreignKey':_0x66b1('0x1a9')});db[_0x66b1('0x13e')][_0x66b1('0x117')](db[_0x66b1('0x1a')],{'as':'Mohs','through':_0x66b1('0x1aa'),'onDelete':'restrict'});db['Tag'][_0x66b1('0x117')](db[_0x66b1('0x6a')],{'through':'cm_contact_has_tags'});db[_0x66b1('0x83')][_0x66b1('0x117')](db[_0x66b1('0x120')],{'through':_0x66b1('0x18b')});db[_0x66b1('0x83')][_0x66b1('0x117')](db['MailInteraction'],{'through':_0x66b1('0x1ab')});db[_0x66b1('0x83')][_0x66b1('0x117')](db[_0x66b1('0x4f')],{'through':_0x66b1('0x17c')});db[_0x66b1('0x83')]['belongsToMany'](db[_0x66b1('0x45')],{'through':'fax_interaction_has_tags'});db[_0x66b1('0x83')][_0x66b1('0x117')](db[_0x66b1('0x57')],{'through':'openchannel_interaction_has_tags'});db[_0x66b1('0x83')][_0x66b1('0x117')](db[_0x66b1('0x111')],{'through':_0x66b1('0x1ac')});db[_0x66b1('0x87')][_0x66b1('0x107')](db[_0x66b1('0x7a')],{'as':{'plural':_0x66b1('0x1ad'),'singular':_0x66b1('0x1ae')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x66b1('0x107')](db['Condition'],{'as':{'plural':_0x66b1('0x1af'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x87')][_0x66b1('0x107')](db['Action'],{'as':_0x66b1('0x1a0'),'foreignKey':_0x66b1('0x1b0'),'onDelete':_0x66b1('0x104'),'hooks':!![]});db[_0x66b1('0x1a8')][_0x66b1('0x107')](db[_0x66b1('0x1b1')],{'as':_0x66b1('0x1b2'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x66b1('0x8f')][_0x66b1('0x107')](db[_0x66b1('0x1b1')],{'as':_0x66b1('0x1b2'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1a7')});db[_0x66b1('0x92')][_0x66b1('0x107')](db[_0x66b1('0x1b1')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x66b1('0x1b3')});db[_0x66b1('0x1b1')][_0x66b1('0x114')](db[_0x66b1('0x92')],{'foreignKey':_0x66b1('0x1b3')});db[_0x66b1('0x97')][_0x66b1('0x107')](db[_0x66b1('0x98')],{'as':_0x66b1('0x1b4'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db['SalesforceConfiguration'][_0x66b1('0x107')](db[_0x66b1('0x9a')],{'as':_0x66b1('0x1b6'),'onDelete':'cascade','foreignKey':_0x66b1('0x1b7')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x66b1('0x1b8'),'onDelete':'cascade','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0x98')][_0x66b1('0x107')](db['SalesforceField'],{'as':'Fields','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0x98')][_0x66b1('0x114')](db['SalesforceAccount'],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0x9a')][_0x66b1('0x107')](db[_0x66b1('0x9a')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db['SalesforceField'][_0x66b1('0x107')](db[_0x66b1('0x9a')],{'as':_0x66b1('0x1bc'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0x9a')][_0x66b1('0x107')](db[_0x66b1('0x9a')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db['SalesforceField'][_0x66b1('0x114')](db[_0x66b1('0x89')],{'as':'Variable','foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x9b')][_0x66b1('0x107')](db[_0x66b1('0x9c')],{'as':_0x66b1('0x1b4'),'onDelete':'cascade','foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0x9c')]['hasMany'](db[_0x66b1('0x9d')],{'as':'Subjects','onDelete':_0x66b1('0x104'),'foreignKey':'SubjectId'});db[_0x66b1('0x9c')][_0x66b1('0x107')](db['SugarcrmField'],{'as':_0x66b1('0x1b8'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b9')});db['SugarcrmConfiguration'][_0x66b1('0x107')](db[_0x66b1('0x9d')],{'as':_0x66b1('0x1b2'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0x9c')][_0x66b1('0x114')](db['SugarcrmAccount'],{'as':_0x66b1('0x163'),'foreignKey':'AccountId'});db[_0x66b1('0x9d')][_0x66b1('0x107')](db[_0x66b1('0x9d')],{'as':'Subject','foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0x9d')][_0x66b1('0x107')](db[_0x66b1('0x9d')],{'as':_0x66b1('0x1bc'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x66b1('0x107')](db[_0x66b1('0x9d')],{'as':'Field','foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0x9d')]['belongsTo'](db[_0x66b1('0x89')],{'as':_0x66b1('0x89'),'foreignKey':'VariableId'});db['DeskAccount'][_0x66b1('0x107')](db[_0x66b1('0x1bf')],{'as':'Configurations','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db['DeskConfiguration'][_0x66b1('0x107')](db[_0x66b1('0x1c0')],{'as':_0x66b1('0x1b6'),'onDelete':_0x66b1('0x104'),'foreignKey':'SubjectId'});db[_0x66b1('0x1bf')][_0x66b1('0x107')](db[_0x66b1('0x1c0')],{'as':_0x66b1('0x1b8'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0x1bf')][_0x66b1('0x107')](db[_0x66b1('0x1c0')],{'as':'Fields','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ba')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0x66b1('0x163'),'foreignKey':'AccountId'});db[_0x66b1('0x1bf')]['belongsToMany'](db['Tag'],{'through':_0x66b1('0x1c1')});db[_0x66b1('0x1c0')]['hasMany'](db[_0x66b1('0x1c0')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0x1c0')][_0x66b1('0x107')](db[_0x66b1('0x1c0')],{'as':'Description','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0x1c0')][_0x66b1('0x107')](db[_0x66b1('0x1c0')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0x1c0')][_0x66b1('0x114')](db['Variable'],{'as':_0x66b1('0x89'),'foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x1c2')][_0x66b1('0x107')](db['ZohoConfiguration'],{'as':_0x66b1('0x1b4'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xa3')]['hasMany'](db[_0x66b1('0xa5')],{'as':_0x66b1('0x1b6'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xa3')]['hasMany'](db[_0x66b1('0xa5')],{'as':_0x66b1('0x1b8'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xa3')][_0x66b1('0x107')](db[_0x66b1('0xa5')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x66b1('0xa3')][_0x66b1('0x114')](db['ZohoAccount'],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db['ZohoField'][_0x66b1('0x107')](db[_0x66b1('0xa5')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xa5')][_0x66b1('0x107')](db[_0x66b1('0xa5')],{'as':_0x66b1('0x1bc'),'foreignKey':_0x66b1('0x1b9')});db['ZohoField'][_0x66b1('0x107')](db[_0x66b1('0xa5')],{'as':'Field','foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xa5')][_0x66b1('0x114')](db[_0x66b1('0x89')],{'as':_0x66b1('0x89'),'foreignKey':_0x66b1('0x1be')});db['ZendeskAccount'][_0x66b1('0x107')](db[_0x66b1('0xa8')],{'as':'Configurations','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xa8')][_0x66b1('0x107')](db[_0x66b1('0xaa')],{'as':_0x66b1('0x1b6'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xa8')][_0x66b1('0x107')](db[_0x66b1('0xaa')],{'as':'Descriptions','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xa8')]['hasMany'](db[_0x66b1('0xaa')],{'as':_0x66b1('0x1b2'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xa8')]['belongsTo'](db[_0x66b1('0xa6')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db['ZendeskConfiguration'][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':_0x66b1('0x1c3')});db[_0x66b1('0xaa')]['hasMany'](db[_0x66b1('0xaa')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xaa')][_0x66b1('0x107')](db[_0x66b1('0xaa')],{'as':_0x66b1('0x1bc'),'foreignKey':_0x66b1('0x1b9')});db['ZendeskField'][_0x66b1('0x107')](db[_0x66b1('0xaa')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db['ZendeskField'][_0x66b1('0x114')](db[_0x66b1('0x89')],{'as':'Variable','foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x1c4')][_0x66b1('0x107')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x66b1('0x1b6'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xac')][_0x66b1('0x107')](db[_0x66b1('0xad')],{'as':_0x66b1('0x1b8'),'onDelete':'cascade','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xac')][_0x66b1('0x107')](db[_0x66b1('0xad')],{'as':'Fields','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xac')][_0x66b1('0x114')](db['FreshdeskAccount'],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xac')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x66b1('0xad')]['hasMany'](db['FreshdeskField'],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db['FreshdeskField'][_0x66b1('0x107')](db['FreshdeskField'],{'as':_0x66b1('0x1bc'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xad')]['hasMany'](db[_0x66b1('0xad')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xad')][_0x66b1('0x114')](db[_0x66b1('0x89')],{'as':_0x66b1('0x89'),'foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x1c5')][_0x66b1('0x107')](db[_0x66b1('0xb0')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x66b1('0xb0')]['hasMany'](db[_0x66b1('0xb2')],{'as':_0x66b1('0x1b6'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xb0')][_0x66b1('0x107')](db[_0x66b1('0xb2')],{'as':_0x66b1('0x1b8'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x66b1('0x107')](db['VtigerField'],{'as':_0x66b1('0x1b2'),'foreignKey':_0x66b1('0x1ba')});db['VtigerConfiguration'][_0x66b1('0x114')](db[_0x66b1('0x1c5')],{'as':'Account','foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xb2')][_0x66b1('0x107')](db['VtigerField'],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db['VtigerField'][_0x66b1('0x107')](db[_0x66b1('0xb2')],{'as':'Description','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xb2')][_0x66b1('0x107')](db[_0x66b1('0xb2')],{'as':_0x66b1('0x1bd'),'foreignKey':'FieldId'});db[_0x66b1('0xb2')]['belongsTo'](db['Variable'],{'as':_0x66b1('0x89'),'foreignKey':'VariableId'});db[_0x66b1('0x1c6')][_0x66b1('0x107')](db[_0x66b1('0xb4')],{'as':_0x66b1('0x1b4'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xb4')]['hasMany'](db[_0x66b1('0xb6')],{'as':_0x66b1('0x1b6'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xb4')][_0x66b1('0x107')](db['ServicenowField'],{'as':_0x66b1('0x1b8'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xb4')][_0x66b1('0x107')](db[_0x66b1('0xb6')],{'as':_0x66b1('0x1b2'),'foreignKey':_0x66b1('0x1ba')});db['ServicenowConfiguration'][_0x66b1('0x114')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x66b1('0x1b5')});db['ServicenowField']['hasMany'](db[_0x66b1('0xb6')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xb6')][_0x66b1('0x107')](db[_0x66b1('0xb6')],{'as':'Description','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xb6')][_0x66b1('0x107')](db[_0x66b1('0xb6')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xb6')][_0x66b1('0x114')](db[_0x66b1('0x89')],{'as':'Variable','foreignKey':_0x66b1('0x1be')});db[_0x66b1('0xb8')][_0x66b1('0x107')](db['Dynamics365Configuration'],{'as':_0x66b1('0x1b4'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xba')][_0x66b1('0x107')](db[_0x66b1('0xbb')],{'as':_0x66b1('0x1b6'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x66b1('0xba')]['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x66b1('0x1b9')});db['Dynamics365Configuration'][_0x66b1('0x107')](db[_0x66b1('0xbb')],{'as':'Fields','onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ba')});db[_0x66b1('0xba')][_0x66b1('0x114')](db[_0x66b1('0xb8')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xbb')][_0x66b1('0x107')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xbb')]['hasMany'](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xbb')][_0x66b1('0x107')](db[_0x66b1('0xbb')],{'as':'Field','foreignKey':_0x66b1('0x1ba')});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':_0x66b1('0x89'),'foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x1c7')]['hasMany'](db[_0x66b1('0xbe')],{'as':_0x66b1('0x1b4'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xbe')][_0x66b1('0x107')](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1b6'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xbe')][_0x66b1('0x107')](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1b8'),'foreignKey':'DescriptionId'});db[_0x66b1('0xbe')][_0x66b1('0x107')](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1b2'),'foreignKey':_0x66b1('0x1ba')});db['FreshsalesConfiguration'][_0x66b1('0x114')](db[_0x66b1('0x1c7')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1b5')});db[_0x66b1('0xc0')]['hasMany'](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1bb'),'foreignKey':_0x66b1('0x1b7')});db[_0x66b1('0xc0')]['hasMany'](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1bc'),'foreignKey':_0x66b1('0x1b9')});db[_0x66b1('0xc0')]['hasMany'](db[_0x66b1('0xc0')],{'as':_0x66b1('0x1bd'),'foreignKey':_0x66b1('0x1ba')});db['FreshsalesField']['belongsTo'](db[_0x66b1('0x89')],{'as':_0x66b1('0x89'),'foreignKey':_0x66b1('0x1be')});db[_0x66b1('0x1c8')]['belongsTo'](db[_0x66b1('0x5b')],{});db['ChatQueueReport'][_0x66b1('0x114')](db[_0x66b1('0xea')],{'as':'List','foreignKey':_0x66b1('0x15f')});db['ChatQueueReport'][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':'ContactId'});db[_0x66b1('0x1c8')]['belongsTo'](db[_0x66b1('0x120')],{});db[_0x66b1('0x1c8')][_0x66b1('0x114')](db[_0x66b1('0x5f')],{});db[_0x66b1('0x1c8')][_0x66b1('0x114')](db[_0x66b1('0x12')],{});db[_0x66b1('0x1c8')][_0x66b1('0x114')](db[_0x66b1('0x63')],{});db[_0x66b1('0xc3')][_0x66b1('0x114')](db['User'],{'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1c9')});db[_0x66b1('0xc3')][_0x66b1('0x114')](db['User'],{'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x1ca')});db[_0x66b1('0xc8')][_0x66b1('0x107')](db[_0x66b1('0xc6')],{'foreignKey':_0x66b1('0x1cb'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0xc8')][_0x66b1('0x107')](db[_0x66b1('0xc5')],{'foreignKey':_0x66b1('0x1cb'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0xca')]['belongsTo'](db[_0x66b1('0x136')],{});db[_0x66b1('0xca')][_0x66b1('0x114')](db['CmList'],{'as':_0x66b1('0x16c'),'foreignKey':'ListId'});db[_0x66b1('0xca')][_0x66b1('0x114')](db['CmContact'],{'as':_0x66b1('0x154'),'foreignKey':'ContactId'});db[_0x66b1('0xca')]['belongsTo'](db['SmsInteraction'],{});db[_0x66b1('0xca')][_0x66b1('0x114')](db[_0x66b1('0x51')],{});db[_0x66b1('0xca')][_0x66b1('0x114')](db[_0x66b1('0x12')],{});db[_0x66b1('0xca')][_0x66b1('0x114')](db['SmsQueue'],{});db[_0x66b1('0xce')]['hasMany'](db[_0x66b1('0xc8')],{'foreignKey':_0x66b1('0x1cc')});db[_0x66b1('0xce')][_0x66b1('0x107')](db[_0x66b1('0xc6')],{'foreignKey':_0x66b1('0x1cc')});db[_0x66b1('0xce')]['hasMany'](db[_0x66b1('0xc5')],{'foreignKey':_0x66b1('0x1cc')});db[_0x66b1('0xd3')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x166'),'through':_0x66b1('0x1cd')});db['Team'][_0x66b1('0x117')](db['User'],{'as':_0x66b1('0x161'),'through':_0x66b1('0x11e')});db[_0x66b1('0xd8')][_0x66b1('0x117')](db[_0x66b1('0x1c')],{'through':_0x66b1('0xfe'),'as':'VoiceQueues'});db[_0x66b1('0xd8')][_0x66b1('0x117')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x66b1('0x127')});db[_0x66b1('0xd8')][_0x66b1('0x117')](db[_0x66b1('0x63')],{'through':_0x66b1('0x190'),'as':'ChatQueues'});db[_0x66b1('0xd8')][_0x66b1('0x117')](db['FaxQueue'],{'through':_0x66b1('0x179'),'as':_0x66b1('0x12b')});db[_0x66b1('0xd8')][_0x66b1('0x117')](db[_0x66b1('0x12c')],{'through':_0x66b1('0x17e'),'as':_0x66b1('0x1ce')});db[_0x66b1('0xd8')][_0x66b1('0x117')](db[_0x66b1('0x59')],{'through':_0x66b1('0x184'),'as':_0x66b1('0x12e')});db['Team']['belongsToMany'](db[_0x66b1('0xfb')],{'through':_0x66b1('0x1cf'),'as':_0x66b1('0x12f')});db['Team'][_0x66b1('0x117')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x66b1('0x1d0')});db[_0x66b1('0xdc')][_0x66b1('0x107')](db[_0x66b1('0x6b')],{'as':_0x66b1('0x141'),'foreignKey':'CampaignId'});db[_0x66b1('0xdc')][_0x66b1('0x107')](db[_0x66b1('0x10b')],{'as':_0x66b1('0x10c'),'foreignKey':_0x66b1('0x196')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':_0x66b1('0x143'),'foreignKey':'CampaignId'});db[_0x66b1('0xdc')][_0x66b1('0x107')](db[_0x66b1('0x198')],{'as':_0x66b1('0x1d1'),'foreignKey':_0x66b1('0x196')});db[_0x66b1('0xdc')][_0x66b1('0x114')](db[_0x66b1('0x145')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x66b1('0xdc')][_0x66b1('0x114')](db[_0x66b1('0x145')],{'as':'TrunkBackup','foreignKey':_0x66b1('0x1d2')});db['Campaign'][_0x66b1('0x114')](db[_0x66b1('0x7c')],{'as':_0x66b1('0x7c'),'foreignKey':'IntervalId'});db[_0x66b1('0xdc')][_0x66b1('0x114')](db[_0x66b1('0xd3')],{'as':_0x66b1('0xd3'),'foreignKey':_0x66b1('0x1d3')});db['Campaign'][_0x66b1('0x117')](db[_0x66b1('0xea')],{'as':_0x66b1('0x11c'),'through':'campaigns_has_cm_lists'});db[_0x66b1('0xdc')][_0x66b1('0x117')](db[_0x66b1('0xea')],{'as':_0x66b1('0x14d'),'through':_0x66b1('0x1d4')});db[_0x66b1('0x168')][_0x66b1('0x114')](db[_0x66b1('0x61')],{'as':_0x66b1('0x61'),'foreignKey':_0x66b1('0x18f')});db[_0x66b1('0xe1')][_0x66b1('0x114')](db[_0x66b1('0x3d')],{});db[_0x66b1('0xe1')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x66b1('0x38')],{'foreignKey':_0x66b1('0x1d5'),'as':_0x66b1('0x1d6')});db['MailTransferReport'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d7'),'as':_0x66b1('0x1d8')});db[_0x66b1('0xe1')]['belongsTo'](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d9'),'as':'ToAgent'});db[_0x66b1('0xe1')][_0x66b1('0x114')](db[_0x66b1('0x39')],{'foreignKey':_0x66b1('0x1da'),'as':_0x66b1('0x1db')});db[_0x66b1('0xe1')][_0x66b1('0x114')](db['MailAccount'],{'foreignKey':_0x66b1('0x1dc'),'as':_0x66b1('0x1dd')});db['ChatTransferReport']['belongsTo'](db[_0x66b1('0x5f')],{});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x120')],{});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'foreignKey':'FromChatWebsiteId','as':_0x66b1('0x1d6')});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d7'),'as':'FromAgent'});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d9'),'as':_0x66b1('0x1de')});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x63')],{'foreignKey':_0x66b1('0x1df'),'as':_0x66b1('0x1db')});db[_0x66b1('0xe2')][_0x66b1('0x114')](db[_0x66b1('0x5b')],{'foreignKey':_0x66b1('0x1e0'),'as':_0x66b1('0x1dd')});db[_0x66b1('0xe4')][_0x66b1('0x114')](db[_0x66b1('0x46')],{});db[_0x66b1('0xe4')]['belongsTo'](db[_0x66b1('0x45')],{});db['FaxTransferReport'][_0x66b1('0x114')](db[_0x66b1('0x42')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d7'),'as':_0x66b1('0x1d8')});db[_0x66b1('0xe4')]['belongsTo'](db['User'],{'foreignKey':_0x66b1('0x1d9'),'as':_0x66b1('0x1de')});db[_0x66b1('0xe4')][_0x66b1('0x114')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x66b1('0x1db')});db[_0x66b1('0xe4')]['belongsTo'](db[_0x66b1('0x42')],{'foreignKey':_0x66b1('0x1e1'),'as':_0x66b1('0x1dd')});db['OpenchannelTransferReport'][_0x66b1('0x114')](db['OpenchannelMessage'],{});db[_0x66b1('0xe6')][_0x66b1('0x114')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x66b1('0x114')](db[_0x66b1('0x54')],{'foreignKey':_0x66b1('0x1e2'),'as':_0x66b1('0x1d6')});db[_0x66b1('0xe6')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d7'),'as':_0x66b1('0x1d8')});db[_0x66b1('0xe6')][_0x66b1('0x114')](db[_0x66b1('0x12')],{'foreignKey':_0x66b1('0x1d9'),'as':_0x66b1('0x1de')});db[_0x66b1('0xe6')][_0x66b1('0x114')](db[_0x66b1('0x59')],{'foreignKey':_0x66b1('0x1e3'),'as':_0x66b1('0x1db')});db[_0x66b1('0xe6')][_0x66b1('0x114')](db[_0x66b1('0x54')],{'foreignKey':_0x66b1('0x1e4'),'as':'ToAccount'});db[_0x66b1('0xe8')]['belongsTo'](db['SmsMessage'],{});db[_0x66b1('0xe8')][_0x66b1('0x114')](db[_0x66b1('0x4f')],{});db[_0x66b1('0xe8')][_0x66b1('0x114')](db[_0x66b1('0x136')],{'foreignKey':_0x66b1('0x1e5'),'as':_0x66b1('0x1d6')});db[_0x66b1('0xe8')][_0x66b1('0x114')](db['User'],{'foreignKey':_0x66b1('0x1d7'),'as':_0x66b1('0x1d8')});db[_0x66b1('0xe8')][_0x66b1('0x114')](db['User'],{'foreignKey':_0x66b1('0x1d9'),'as':_0x66b1('0x1de')});db[_0x66b1('0xe8')]['belongsTo'](db[_0x66b1('0x12c')],{'foreignKey':_0x66b1('0x1e6'),'as':_0x66b1('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0x66b1('0x136')],{'foreignKey':_0x66b1('0x1e7'),'as':_0x66b1('0x1dd')});db[_0x66b1('0xea')][_0x66b1('0x107')](db['Disposition'],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x15f'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0xea')][_0x66b1('0x107')](db[_0x66b1('0x73')],{'as':_0x66b1('0x1e8'),'foreignKey':'ListId'});db[_0x66b1('0xea')][_0x66b1('0x107')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x11a'),'onDelete':_0x66b1('0x104'),'foreignKey':_0x66b1('0x15f')});db['CmList'][_0x66b1('0x107')](db[_0x66b1('0x10b')],{'as':_0x66b1('0x10c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0xea')]['hasMany'](db[_0x66b1('0x6f')],{'as':_0x66b1('0x10d'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0xea')][_0x66b1('0x107')](db[_0x66b1('0x71')],{'as':_0x66b1('0x71'),'foreignKey':'ListId'});db[_0x66b1('0xea')][_0x66b1('0x117')](db['VoiceQueue'],{'as':_0x66b1('0x1e9'),'through':_0x66b1('0x14b')});db['CmList'][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x11d')});db['VoicePrefix'][_0x66b1('0x107')](db[_0x66b1('0x18')],{'as':_0x66b1('0x10a'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0xec')]['belongsToMany'](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':_0x66b1('0x126')});db[_0x66b1('0xec')][_0x66b1('0x117')](db['Team'],{'through':_0x66b1('0x1ea'),'as':_0x66b1('0x14c')});db[_0x66b1('0x115')][_0x66b1('0x107')](db[_0x66b1('0x12')],{'as':_0x66b1('0x166'),'foreignKey':_0x66b1('0x116')});db[_0x66b1('0x115')][_0x66b1('0x107')](db[_0x66b1('0xee')],{'as':_0x66b1('0x1eb'),'foreignKey':_0x66b1('0x116'),'onDelete':_0x66b1('0x104')});db[_0x66b1('0xee')][_0x66b1('0x107')](db[_0x66b1('0xf0')],{'as':_0x66b1('0x1ec'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0x66b1('0x139')][_0x66b1('0x107')](db[_0x66b1('0x78')],{'as':_0x66b1('0x15a'),'foreignKey':_0x66b1('0x1ed'),'onDelete':'cascade'});db[_0x66b1('0x139')][_0x66b1('0x107')](db[_0x66b1('0x15b')],{'as':'Answers','foreignKey':_0x66b1('0x1ed')});db['WhatsappAccount'][_0x66b1('0x107')](db[_0x66b1('0xf8')],{'as':'Messages','foreignKey':_0x66b1('0x1ed')});db[_0x66b1('0x139')]['hasMany'](db[_0x66b1('0x111')],{'as':_0x66b1('0x15d')});db[_0x66b1('0x139')][_0x66b1('0x107')](db[_0x66b1('0xf5')],{'as':_0x66b1('0x13d')});db[_0x66b1('0x139')]['belongsTo'](db[_0x66b1('0xea')],{'as':_0x66b1('0x16c'),'foreignKey':'ListId'});db[_0x66b1('0x139')]['belongsTo'](db[_0x66b1('0x149')],{'as':_0x66b1('0x173'),'foreignKey':_0x66b1('0x14a')});db[_0x66b1('0x139')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x161'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'onDelete':'restrict'});db[_0x66b1('0xf5')][_0x66b1('0x114')](db[_0x66b1('0xfb')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x66b1('0x114')](db[_0x66b1('0x139')],{'onDelete':_0x66b1('0x158')});db[_0x66b1('0xf5')][_0x66b1('0x114')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x66b1('0xf5')][_0x66b1('0x114')](db[_0x66b1('0x83')],{'onDelete':_0x66b1('0x158'),'foreignKey':_0x66b1('0x175')});db[_0x66b1('0x111')][_0x66b1('0x107')](db[_0x66b1('0xf8')],{'as':_0x66b1('0x15c'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x66b1('0x111')]['belongsTo'](db[_0x66b1('0x139')],{'as':_0x66b1('0x163'),'foreignKey':_0x66b1('0x1ed')});db[_0x66b1('0x111')]['belongsTo'](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':_0x66b1('0x164'),'foreignKey':'UserId'});db[_0x66b1('0x111')][_0x66b1('0x117')](db['Tag'],{'through':_0x66b1('0x1ac'),'as':_0x66b1('0x178')});db[_0x66b1('0x111')][_0x66b1('0x117')](db[_0x66b1('0x83')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x66b1('0x111')][_0x66b1('0x117')](db[_0x66b1('0x12')],{'as':_0x66b1('0x166'),'through':_0x66b1('0x124'),'foreignKey':_0x66b1('0x1ee')});db[_0x66b1('0xf8')][_0x66b1('0x114')](db['User'],{'as':_0x66b1('0x12')});db[_0x66b1('0xf8')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'onDelete':_0x66b1('0x104'),'as':'Contact'});db[_0x66b1('0xf8')][_0x66b1('0x114')](db[_0x66b1('0x111')],{'onDelete':'cascade','as':_0x66b1('0x16a'),'foreignKey':_0x66b1('0x1ee')});db[_0x66b1('0xf8')]['belongsTo'](db[_0x66b1('0x139')],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0x66b1('0x139')],{});db[_0x66b1('0xf9')][_0x66b1('0x114')](db['CmList'],{'as':_0x66b1('0x16c'),'foreignKey':_0x66b1('0x15f')});db[_0x66b1('0xf9')][_0x66b1('0x114')](db[_0x66b1('0x6a')],{'as':_0x66b1('0x154'),'foreignKey':_0x66b1('0x155')});db[_0x66b1('0xf9')][_0x66b1('0x114')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x66b1('0x114')](db[_0x66b1('0xfb')],{});db['WhatsappQueueReport'][_0x66b1('0x114')](db['WhatsappMessage'],{});db[_0x66b1('0xf9')]['belongsTo'](db['User'],{});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db[_0x66b1('0xf8')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x66b1('0x111')],{});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db[_0x66b1('0x139')],{'foreignKey':_0x66b1('0x1f0'),'as':'FromAccount'});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db[_0x66b1('0x139')],{'foreignKey':_0x66b1('0x1f1'),'as':_0x66b1('0x1dd')});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db[_0x66b1('0xfb')],{'foreignKey':'ToQueueId','as':_0x66b1('0x1db')});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db['User'],{'foreignKey':'FromUserId','as':_0x66b1('0x1d8')});db[_0x66b1('0x1ef')][_0x66b1('0x114')](db['User'],{'foreignKey':_0x66b1('0x1d9'),'as':_0x66b1('0x1de')});db[_0x66b1('0xfb')]['belongsToMany'](db['User'],{'as':_0x66b1('0x161'),'through':_0x66b1('0x33'),'foreignKey':_0x66b1('0x1f2')});db[_0x66b1('0xfb')][_0x66b1('0x117')](db['Team'],{'through':_0x66b1('0x1cf'),'as':_0x66b1('0x14c')});db['UserSetting'][_0x66b1('0x114')](db[_0x66b1('0x12')],{'as':'user','foreignKey':_0x66b1('0x105'),'onDelete':'cascade','hooks':!![]});db[_0x66b1('0xfd')]['hasOne'](db[_0x66b1('0x35')],{'as':'Imap','onDelete':'restrict'});db[_0x66b1('0xfd')]['hasOne'](db[_0x66b1('0x37')],{'as':_0x66b1('0x159'),'onDelete':_0x66b1('0x158')});module[_0x66b1('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x5aef=['openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','Attachments','team_has_chat_queues','ChatGroupId','Hoppers','CmCompany','Company','CompanyId','cm_contact_has_tags','Queue','OwnerId','CampaignId','Condition','OneAll','Any','OneAny','Action','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','FieldId','Subject','SubjectId','Description','DescriptionId','Field','VariableId','SugarcrmConfiguration','SugarcrmField','Descriptions','int_desk_configuration_has_tags','ZohoConfiguration','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowField','FromId','ToId','SessionId','JscriptyProject','ProjectId','VoiceQueues','OpenchannelQueues','WhatsappQueue','TeamVoicePrefix','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','voice_queues_has_cm_lists','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','VoiceMail','cascade','hasOne','userSetting','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','belongsToMany','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','UserMailQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','UserOpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','moh_has_sounds','Members','VoiceQueueId','CmHopperHistory','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','MailServerOut','Imap','Smtp','Dispositions','MailApplication','List','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Interaction','ChatOfflineMessageId','restrict','TagId','ListId','FaxAccountId','Answers','Interactions','FaxApplication','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId'];(function(_0x55ea21,_0x50f2bb){var _0x1c4eec=function(_0x37c83d){while(--_0x37c83d){_0x55ea21['push'](_0x55ea21['shift']());}};_0x1c4eec(++_0x50f2bb);}(_0x5aef,0x73));var _0xf5ae=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x5aef[_0x4c05da];return _0x1614db;};'use strict';var config=require(_0xf5ae('0x0'));var Sequelize=require(_0xf5ae('0x1'));var _=require(_0xf5ae('0x2'));var jstz=require(_0xf5ae('0x3'));var timezone=jstz['determine']();config[_0xf5ae('0x1')]=_[_0xf5ae('0x4')](config[_0xf5ae('0x1')],{'database':_0xf5ae('0x5'),'username':_0xf5ae('0x6'),'password':_0xf5ae('0x7'),'options':{'host':_0xf5ae('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf5ae('0x9')},'logging':![],'timezone':timezone[_0xf5ae('0xa')](),'define':{'charset':'utf8','collate':_0xf5ae('0xb')}}});config[_0xf5ae('0xc')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':'xcall','password':_0xf5ae('0x7'),'options':{'host':_0xf5ae('0x8'),'port':0xcea,'dialect':_0xf5ae('0xd'),'dialectOptions':{'charset':_0xf5ae('0x9')},'logging':![],'timezone':timezone[_0xf5ae('0xa')](),'define':{'charset':_0xf5ae('0xe'),'collate':_0xf5ae('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf5ae('0x1')][_0xf5ae('0xf')],config[_0xf5ae('0x1')][_0xf5ae('0x10')],config['sequelize'][_0xf5ae('0x11')],config[_0xf5ae('0x1')][_0xf5ae('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf5ae('0xc')][_0xf5ae('0xf')],config[_0xf5ae('0xc')][_0xf5ae('0x10')],config[_0xf5ae('0xc')][_0xf5ae('0x11')],config[_0xf5ae('0xc')]['options'])};db[_0xf5ae('0x13')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x15'));db[_0xf5ae('0x16')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x17'));db['VoiceContext']=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db['sequelize'][_0xf5ae('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xf5ae('0x18')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xf5ae('0x19')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x1a'));db['VoiceRecording']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x1b'));db[_0xf5ae('0x1c')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x1d'));db['VoiceMail']=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x1e'));db[_0xf5ae('0x1f')]=db[_0xf5ae('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xf5ae('0x20')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x21'));db[_0xf5ae('0x22')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x23'));db['VoiceAgentReport']=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x24'));db[_0xf5ae('0x25')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x26'));db['MemberReport']=db['sequelize']['import'](_0xf5ae('0x27'));db[_0xf5ae('0x28')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x29'));db[_0xf5ae('0x2a')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x2b'));db[_0xf5ae('0x2c')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x2d'));db[_0xf5ae('0x2e')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x2f'));db['UserMailQueue']=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x30'));db[_0xf5ae('0x31')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0xf5ae('0x32')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x33'));db[_0xf5ae('0x34')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x35'));db[_0xf5ae('0x36')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x37'));db['MailAccount']=db['sequelize']['import'](_0xf5ae('0x38'));db[_0xf5ae('0x39')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x3a'));db[_0xf5ae('0x3b')]=db[_0xf5ae('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xf5ae('0x3c')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x3d'));db[_0xf5ae('0x3e')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x3f'));db['MailApplication']=db['sequelize']['import'](_0xf5ae('0x40'));db[_0xf5ae('0x41')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x42'));db['Dashboard']=db['sequelize']['import']('../api/dashboard/dashboard.model');db[_0xf5ae('0x43')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x44'));db[_0xf5ae('0x45')]=db['sequelize']['import'](_0xf5ae('0x46'));db['FaxApplication']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x47'));db[_0xf5ae('0x48')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x49'));db[_0xf5ae('0x4a')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x4b'));db['FaxQueue']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x4c'));db[_0xf5ae('0x4d')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x4e'));db[_0xf5ae('0x4f')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x50'));db[_0xf5ae('0x51')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x52'));db[_0xf5ae('0x53')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x54'));db[_0xf5ae('0x55')]=db['sequelize'][_0xf5ae('0x14')]('../api/smsMessage/smsMessage.model');db[_0xf5ae('0x56')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x57'));db[_0xf5ae('0x58')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x59'));db['OpenchannelApplication']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x5a'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xf5ae('0x5b'));db[_0xf5ae('0x5c')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0xf5ae('0x5d')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x5e'));db[_0xf5ae('0x5f')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x60'));db[_0xf5ae('0x61')]=db['sequelize']['import'](_0xf5ae('0x62'));db[_0xf5ae('0x63')]=db['sequelize']['import'](_0xf5ae('0x64'));db[_0xf5ae('0x65')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xf5ae('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0xf5ae('0x66')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x67'));db[_0xf5ae('0x68')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x69'));db[_0xf5ae('0x6a')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x6b'));db[_0xf5ae('0x6c')]=db['sequelize']['import'](_0xf5ae('0x6d'));db['CmCompany']=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x6e'));db['CmContact']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x6f'));db[_0xf5ae('0x70')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x71'));db[_0xf5ae('0x72')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x73'));db[_0xf5ae('0x74')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x75'));db['CmHopperHistory']=db['sequelize']['import'](_0xf5ae('0x76'));db[_0xf5ae('0x77')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x78'));db['CmCustomField']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x79'));db['Action']=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x7a'));db[_0xf5ae('0x7b')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/automation/automation.model');db[_0xf5ae('0x7c')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x7d'));db[_0xf5ae('0x7e')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x7f'));db['Condition']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x80'));db[_0xf5ae('0x81')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x82'));db[_0xf5ae('0x83')]=db['sequelize'][_0xf5ae('0x14')]('../api/pause/pause.model');db[_0xf5ae('0x84')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x85'));db['VoiceQueuesLog']=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x86'));db[_0xf5ae('0x87')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0x88'));db[_0xf5ae('0x89')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/sound/sound.model');db[_0xf5ae('0x8a')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x8b'));db[_0xf5ae('0x8c')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x8d'));db[_0xf5ae('0x8e')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x8f'));db[_0xf5ae('0x90')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/variable/variable.model');db[_0xf5ae('0x91')]=db['sequelize']['import'](_0xf5ae('0x92'));db['IntegrationReport']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x93'));db[_0xf5ae('0x94')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x95'));db[_0xf5ae('0x96')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x97'));db[_0xf5ae('0x98')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xf5ae('0x99')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x9a'));db[_0xf5ae('0x9b')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x9c'));db[_0xf5ae('0x9d')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0x9e'));db['SalesforceAccount']=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xf5ae('0x9f')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xa0'));db[_0xf5ae('0xa1')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xa2'));db['SugarcrmConfiguration']=db[_0xf5ae('0x1')]['import'](_0xf5ae('0xa3'));db['SugarcrmField']=db['sequelize'][_0xf5ae('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xf5ae('0xa4')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0xf5ae('0xa5')]=db[_0xf5ae('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xf5ae('0xa6')]=db['sequelize']['import'](_0xf5ae('0xa7'));db['ZohoAccount']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xa8'));db['ZohoConfiguration']=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xf5ae('0xa9')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xaa'));db[_0xf5ae('0xab')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xac'));db[_0xf5ae('0xad')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf5ae('0xae')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xaf'));db['FreshdeskAccount']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xb0'));db[_0xf5ae('0xb1')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xb2'));db[_0xf5ae('0xb3')]=db[_0xf5ae('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf5ae('0xb4')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0xb5'));db[_0xf5ae('0xb6')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xb7'));db[_0xf5ae('0xb8')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xb9'));db[_0xf5ae('0xba')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xbb'));db['ServicenowField']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xbc'));db[_0xf5ae('0xbd')]=db[_0xf5ae('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xf5ae('0xbe')]=db[_0xf5ae('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xf5ae('0xbf')]=db[_0xf5ae('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xf5ae('0xc0')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xc1'));db[_0xf5ae('0xc2')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xc3'));db[_0xf5ae('0xc4')]=db['sequelize']['import'](_0xf5ae('0xc5'));db[_0xf5ae('0x91')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0x92'));db[_0xf5ae('0xc6')]=db[_0xf5ae('0x1')]['import'](_0xf5ae('0xc7'));db[_0xf5ae('0xc8')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xc9'));db[_0xf5ae('0xca')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xcb'));db[_0xf5ae('0xcc')]=db['sequelize']['import'](_0xf5ae('0xcd'));db[_0xf5ae('0xce')]=db['sequelize'][_0xf5ae('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0xf5ae('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xf5ae('0xcf')]=db['sequelize'][_0xf5ae('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xf5ae('0xd0')]=db[_0xf5ae('0x1')]['import']('../api/squareReport/squareReport.model');db[_0xf5ae('0xd1')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xd2'));db['JscriptyProject']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xd3'));db[_0xf5ae('0xd4')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xd5'));db[_0xf5ae('0xd6')]=db[_0xf5ae('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0xf5ae('0xd7')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xd8'));db[_0xf5ae('0xd9')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xda'));db[_0xf5ae('0xdb')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xdc'));db['Team']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xdd'));db[_0xf5ae('0xde')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xdf'));db[_0xf5ae('0xe0')]=db['sequelize'][_0xf5ae('0x14')]('../api/campaign/campaign.model');db[_0xf5ae('0xe1')]=db['sequelize']['import'](_0xf5ae('0xe2'));db[_0xf5ae('0xe3')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/attachment/attachment.model');db['Plugin']=db[_0xf5ae('0x1')]['import']('../api/plugin/plugin.model');db[_0xf5ae('0xe4')]=db['sequelize']['import'](_0xf5ae('0xe5'));db[_0xf5ae('0xe6')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xe7'));db[_0xf5ae('0xe8')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xe9'));db[_0xf5ae('0xea')]=db['sequelize']['import'](_0xf5ae('0xeb'));db['SmsTransferReport']=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0xf5ae('0xec')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xed'));db[_0xf5ae('0xee')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xf5ae('0xef')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/userProfile/userProfile.model');db[_0xf5ae('0xf0')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xf1'));db['UserProfileResource']=db[_0xf5ae('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0xf5ae('0xf2')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/userNotification/userNotification.model');db[_0xf5ae('0xf3')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xf4'));db['WhatsappApplication']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xf5'));db['WhatsappInteraction']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xf6'));db['WhatsappMessage']=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xf5ae('0xf7')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xf8'));db[_0xf5ae('0xf9')]=db['sequelize'][_0xf5ae('0x14')](_0xf5ae('0xfa'));db['WhatsappQueue']=db['sequelize'][_0xf5ae('0x14')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xfb'));db['TeamVoicePrefix']=db['sequelize'][_0xf5ae('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xf5ae('0xfc')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xf5ae('0xfd')]=db[_0xf5ae('0x1')][_0xf5ae('0x14')](_0xf5ae('0xfe'));db['User']['hasOne'](db[_0xf5ae('0xff')],{'as':_0xf5ae('0xff'),'onDelete':_0xf5ae('0x100'),'foreignKey':'UserId'});db[_0xf5ae('0x13')][_0xf5ae('0x101')](db[_0xf5ae('0xfd')],{'as':_0xf5ae('0x102'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x103')});db['User'][_0xf5ae('0x104')](db[_0xf5ae('0x105')],{'as':_0xf5ae('0x106'),'foreignKey':'UserId'});db[_0xf5ae('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xf5ae('0x107'),'foreignKey':_0xf5ae('0x103')});db['User']['hasMany'](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x109'),'onDelete':'cascade','hooks':!![]});db[_0xf5ae('0x13')][_0xf5ae('0x104')](db[_0xf5ae('0x74')],{'as':_0xf5ae('0x10a'),'foreignKey':'UserId'});db[_0xf5ae('0x13')][_0xf5ae('0x104')](db['CmHopperHistory'],{'as':_0xf5ae('0x10b'),'foreignKey':_0xf5ae('0x103')});db['User'][_0xf5ae('0x104')](db[_0xf5ae('0x77')],{'as':_0xf5ae('0x77'),'foreignKey':'UserId'});db[_0xf5ae('0x13')][_0xf5ae('0x104')](db[_0xf5ae('0x10c')],{'as':_0xf5ae('0x10d'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x13')][_0xf5ae('0x104')](db[_0xf5ae('0x65')],{'as':_0xf5ae('0x10e'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x13')]['hasMany'](db[_0xf5ae('0x53')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xf5ae('0x48')],{'as':_0xf5ae('0x10f'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x13')]['hasMany'](db[_0xf5ae('0x3c')],{'as':_0xf5ae('0x110'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x13')][_0xf5ae('0x104')](db[_0xf5ae('0x111')],{'as':_0xf5ae('0x112'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x13')]['hasMany'](db[_0xf5ae('0xf2')],{'as':_0xf5ae('0x113'),'foreignKey':_0xf5ae('0x114')});db[_0xf5ae('0x13')][_0xf5ae('0x115')](db[_0xf5ae('0xef')],{'as':_0xf5ae('0xef'),'foreignKey':_0xf5ae('0x116')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0x6a')],{'as':_0xf5ae('0x117'),'through':'chat_group_has_users'});db['User']['belongsToMany'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x119'),'through':_0xf5ae('0x11a')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x11b'),'through':_0xf5ae('0x11c')});db['User'][_0xf5ae('0x11d')](db[_0xf5ae('0x11e')],{'through':_0xf5ae('0x11f')});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0x3c')],{'as':_0xf5ae('0x110'),'through':_0xf5ae('0x120')});db['User'][_0xf5ae('0x11d')](db['ChatInteraction'],{'as':_0xf5ae('0x10e'),'through':_0xf5ae('0x121')});db['User'][_0xf5ae('0x11d')](db[_0xf5ae('0x48')],{'as':_0xf5ae('0x10f'),'through':_0xf5ae('0x122')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0x53')],{'as':_0xf5ae('0x123'),'through':_0xf5ae('0x124')});db['User'][_0xf5ae('0x11d')](db['OpenchannelInteraction'],{'as':_0xf5ae('0x10d'),'through':_0xf5ae('0x125')});db['User'][_0xf5ae('0x11d')](db['WhatsappInteraction'],{'as':_0xf5ae('0x112'),'through':_0xf5ae('0x126')});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0x19')],{'as':'VoiceQueues','through':_0xf5ae('0x2c'),'required':![]});db['User'][_0xf5ae('0x11d')](db[_0xf5ae('0xee')],{'as':'VoicePrefixes','through':_0xf5ae('0xfc'),'required':![]});db['User']['belongsToMany'](db[_0xf5ae('0x39')],{'as':_0xf5ae('0x127'),'through':_0xf5ae('0x128'),'required':![]});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0x68')],{'as':_0xf5ae('0x129'),'through':_0xf5ae('0x2e'),'required':![],'hooks':!![]});db['User'][_0xf5ae('0x11d')](db[_0xf5ae('0x12a')],{'as':_0xf5ae('0x12b'),'through':_0xf5ae('0x31'),'required':![]});db['User']['belongsToMany'](db[_0xf5ae('0x56')],{'as':_0xf5ae('0x12c'),'through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db[_0xf5ae('0x5d')],{'as':'OpenchannelQueues','through':_0xf5ae('0x12d'),'required':![]});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0xf5ae('0x34'),'required':![]});db['User']['belongsToMany'](db[_0xf5ae('0xec')],{'through':'cm_user_has_lists'});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0x5f')],{'as':_0xf5ae('0x12e'),'through':_0xf5ae('0x12f')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0x45')],{'as':_0xf5ae('0x130'),'through':_0xf5ae('0x131')});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0x132')],{'as':_0xf5ae('0x133'),'through':_0xf5ae('0x134')});db['User'][_0xf5ae('0x11d')](db[_0xf5ae('0x58')],{'as':_0xf5ae('0x135'),'through':_0xf5ae('0x136')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0x4f')],{'as':'SmsAccounts','through':_0xf5ae('0x137')});db[_0xf5ae('0x13')]['belongsToMany'](db[_0xf5ae('0xf3')],{'as':_0xf5ae('0x138'),'through':_0xf5ae('0x139')});db[_0xf5ae('0x13')][_0xf5ae('0x11d')](db[_0xf5ae('0xd7')],{'as':_0xf5ae('0x13a'),'through':_0xf5ae('0x13b')});db[_0xf5ae('0x16')][_0xf5ae('0x104')](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x13c'),'onDelete':'cascade','foreignKey':_0xf5ae('0x13d')});db[_0xf5ae('0x13e')]['hasMany'](db[_0xf5ae('0x108')],{'onDelete':'cascade'});db[_0xf5ae('0x108')]['hasMany'](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x13f'),'onDelete':'cascade'});db[_0xf5ae('0x18')][_0xf5ae('0x11d')](db[_0xf5ae('0x89')],{'as':'Sounds','through':_0xf5ae('0x140')});db[_0xf5ae('0x19')]['hasMany'](db[_0xf5ae('0x2a')],{'as':_0xf5ae('0x141'),'foreignKey':_0xf5ae('0x142')});db[_0xf5ae('0x19')][_0xf5ae('0x104')](db[_0xf5ae('0x70')],{'as':'Hoppers','foreignKey':_0xf5ae('0x142')});db['VoiceQueue'][_0xf5ae('0x104')](db[_0xf5ae('0x74')],{'as':_0xf5ae('0x10a'),'foreignKey':_0xf5ae('0x142')});db[_0xf5ae('0x19')][_0xf5ae('0x104')](db[_0xf5ae('0x143')],{'as':_0xf5ae('0x144'),'foreignKey':'VoiceQueueId'});db[_0xf5ae('0x19')][_0xf5ae('0x104')](db[_0xf5ae('0x77')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf5ae('0x104')](db['CmHopperBlack'],{'as':_0xf5ae('0x145'),'foreignKey':'VoiceQueueId'});db[_0xf5ae('0x19')][_0xf5ae('0x104')](db[_0xf5ae('0x146')],{'as':_0xf5ae('0x147'),'foreignKey':_0xf5ae('0x142')});db['VoiceQueue'][_0xf5ae('0x115')](db['Trunk'],{'as':_0xf5ae('0x28'),'foreignKey':_0xf5ae('0x148')});db[_0xf5ae('0x19')][_0xf5ae('0x115')](db['Trunk'],{'as':_0xf5ae('0x149'),'foreignKey':_0xf5ae('0x14a')});db['VoiceQueue'][_0xf5ae('0x115')](db[_0xf5ae('0x81')],{'as':_0xf5ae('0x81'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x19')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf5ae('0x19')][_0xf5ae('0x11d')](db[_0xf5ae('0xec')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xf5ae('0x19')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0xf5ae('0x11d')](db[_0xf5ae('0x11e')],{'as':_0xf5ae('0x14c'),'through':_0xf5ae('0x14d')});db[_0xf5ae('0x19')][_0xf5ae('0x11d')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x14e'),'through':_0xf5ae('0x14f')});db['VoiceRecording'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x13'),'foreignKey':'UserId'});db['ScreenRecording'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':'User','foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0xff')]['hasMany'](db[_0xf5ae('0x1f')],{'as':_0xf5ae('0x150'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x151'),'sourceKey':_0xf5ae('0x152')});db['VoiceMailMessage'][_0xf5ae('0x115')](db[_0xf5ae('0xff')],{'foreignKey':_0xf5ae('0x151'),'targetKey':_0xf5ae('0x152')});db[_0xf5ae('0x20')][_0xf5ae('0x104')](db[_0xf5ae('0x25')],{'as':'QueueCalls','foreignKey':_0xf5ae('0x153'),'constraints':![]});db[_0xf5ae('0x20')][_0xf5ae('0x104')](db[_0xf5ae('0x154')],{'as':_0xf5ae('0x155'),'foreignKey':_0xf5ae('0x153'),'constraints':![]});db[_0xf5ae('0x20')][_0xf5ae('0x115')](db['User'],{'as':_0xf5ae('0x13'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x20')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db['MailServerIn']['belongsTo'](db[_0xf5ae('0x132')],{'as':'MailAccount','foreignKey':_0xf5ae('0x158')});db[_0xf5ae('0x36')][_0xf5ae('0x115')](db[_0xf5ae('0x159')],{'as':_0xf5ae('0x159'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xf5ae('0x15a')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{'as':_0xf5ae('0x132'),'foreignKey':_0xf5ae('0x158')});db['MailServerOut'][_0xf5ae('0x115')](db['CloudProvider'],{'as':_0xf5ae('0x159'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xf5ae('0x132')][_0xf5ae('0x101')](db[_0xf5ae('0x36')],{'as':_0xf5ae('0x15b'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x132')][_0xf5ae('0x101')](db[_0xf5ae('0x15a')],{'as':_0xf5ae('0x15c'),'onDelete':'cascade'});db['MailAccount'][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x158'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x132')][_0xf5ae('0x104')](db[_0xf5ae('0x7c')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xf5ae('0x132')]['hasMany'](db['MailMessage'],{'as':_0xf5ae('0x150'),'foreignKey':_0xf5ae('0x158')});db[_0xf5ae('0x132')][_0xf5ae('0x104')](db[_0xf5ae('0x3c')],{'as':'Interactions'});db[_0xf5ae('0x132')][_0xf5ae('0x104')](db[_0xf5ae('0x15e')],{'as':'Applications'});db['MailAccount'][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':'ListId'});db[_0xf5ae('0x132')]['belongsTo'](db[_0xf5ae('0x8c')],{'as':'Template','foreignKey':'TemplateId'});db[_0xf5ae('0x132')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':_0xf5ae('0x160'),'foreignKey':_0xf5ae('0x161')});db['MailAccount'][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x134')});db[_0xf5ae('0x39')]['belongsToMany'](db['User'],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x128')});db[_0xf5ae('0x39')][_0xf5ae('0x11d')](db[_0xf5ae('0x11e')],{'through':_0xf5ae('0x163'),'as':_0xf5ae('0x14c')});db[_0xf5ae('0x3c')][_0xf5ae('0x104')](db[_0xf5ae('0x3e')],{'as':_0xf5ae('0x150'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x164')});db[_0xf5ae('0x3c')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x158')});db[_0xf5ae('0x3c')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':'Contact','foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x3c')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x3c')]['belongsToMany'](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x167'),'as':_0xf5ae('0x168')});db[_0xf5ae('0x3c')][_0xf5ae('0x11d')](db['Tag'],{'through':_0xf5ae('0x167'),'as':'ThroughTags'});db[_0xf5ae('0x3c')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x120'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xf5ae('0x104')](db[_0xf5ae('0xe3')],{'as':'Attachments','onDelete':_0xf5ae('0x100')});db['MailMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x13')});db[_0xf5ae('0x3e')]['belongsTo'](db['CmContact'],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x156')});db[_0xf5ae('0x3e')][_0xf5ae('0x115')](db[_0xf5ae('0x3c')],{'as':_0xf5ae('0x16a'),'foreignKey':_0xf5ae('0x164')});db[_0xf5ae('0x3e')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{'as':_0xf5ae('0x165'),'foreignKey':'MailAccountId'});db[_0xf5ae('0x3e')]['belongsTo'](db['ChatWebsite'],{'as':_0xf5ae('0x5f'),'foreignKey':'ChatWebsiteId'});db[_0xf5ae('0x3e')][_0xf5ae('0x115')](db[_0xf5ae('0x66')],{'as':_0xf5ae('0x66'),'foreignKey':_0xf5ae('0x16b')});db[_0xf5ae('0x15e')]['belongsTo'](db[_0xf5ae('0x13')],{'onDelete':_0xf5ae('0x16c')});db['MailApplication'][_0xf5ae('0x115')](db[_0xf5ae('0x39')],{'onDelete':_0xf5ae('0x16c')});db['MailApplication'][_0xf5ae('0x115')](db['MailAccount'],{'onDelete':_0xf5ae('0x16c')});db['MailApplication']['belongsTo'](db[_0xf5ae('0x81')],{'onDelete':'restrict','foreignKey':_0xf5ae('0x14b')});db['MailApplication'][_0xf5ae('0x115')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf5ae('0x16d')});db[_0xf5ae('0x41')]['belongsTo'](db['MailAccount'],{});db[_0xf5ae('0x41')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0x41')]['belongsTo'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x41')][_0xf5ae('0x115')](db['MailInteraction'],{});db['MailQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x3e')],{});db[_0xf5ae('0x41')][_0xf5ae('0x115')](db['User'],{});db[_0xf5ae('0x41')][_0xf5ae('0x115')](db[_0xf5ae('0x39')],{});db['Dashboard'][_0xf5ae('0x104')](db[_0xf5ae('0x43')],{'as':'Items','onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x45')][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x16f'),'onDelete':_0xf5ae('0x100')});db['FaxAccount'][_0xf5ae('0x104')](db[_0xf5ae('0x7c')],{'as':_0xf5ae('0x170'),'foreignKey':_0xf5ae('0x16f')});db[_0xf5ae('0x45')][_0xf5ae('0x104')](db[_0xf5ae('0x48')],{'as':_0xf5ae('0x171')});db[_0xf5ae('0x45')]['hasMany'](db[_0xf5ae('0x172')],{'as':_0xf5ae('0x13f')});db['FaxAccount'][_0xf5ae('0x104')](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x173'),'onDelete':'cascade'});db[_0xf5ae('0x45')][_0xf5ae('0x104')](db['FaxMessage'],{'as':_0xf5ae('0x150')});db[_0xf5ae('0x45')][_0xf5ae('0x115')](db['Trunk'],{'as':_0xf5ae('0x28')});db[_0xf5ae('0x45')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':'ListId'});db[_0xf5ae('0x45')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':_0xf5ae('0x160'),'foreignKey':_0xf5ae('0x161')});db['FaxAccount'][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x131')});db['FaxApplication'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x172')][_0xf5ae('0x115')](db[_0xf5ae('0x12a')],{'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x172')][_0xf5ae('0x115')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xf5ae('0x172')][_0xf5ae('0x115')](db[_0xf5ae('0x8a')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x16d')});db[_0xf5ae('0x48')]['hasMany'](db['FaxMessage'],{'as':_0xf5ae('0x150'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x174')});db[_0xf5ae('0x48')][_0xf5ae('0x115')](db[_0xf5ae('0x45')],{'as':_0xf5ae('0x165'),'foreignKey':'FaxAccountId'});db[_0xf5ae('0x48')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':'Contact','foreignKey':'ContactId'});db['FaxInteraction'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':'UserId'});db[_0xf5ae('0x48')][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x175'),'as':_0xf5ae('0x168')});db['FaxInteraction'][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x175'),'as':_0xf5ae('0x176')});db[_0xf5ae('0x48')][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x122'),'foreignKey':'FaxInteractionId'});db[_0xf5ae('0x4a')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x13')});db[_0xf5ae('0x4a')][_0xf5ae('0x115')](db['FaxInteraction'],{'as':_0xf5ae('0x16a'),'foreignKey':'FaxInteractionId'});db[_0xf5ae('0x4a')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x156')});db[_0xf5ae('0x4a')][_0xf5ae('0x115')](db[_0xf5ae('0xe3')],{'as':_0xf5ae('0xe3'),'foreignKey':_0xf5ae('0x177')});db[_0xf5ae('0x4a')][_0xf5ae('0x115')](db[_0xf5ae('0x45')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x16f')});db[_0xf5ae('0x12a')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':'UserFaxQueue'});db[_0xf5ae('0x12a')][_0xf5ae('0x11d')](db[_0xf5ae('0x11e')],{'through':_0xf5ae('0x178'),'as':'Teams'});db['FaxQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x45')],{});db['FaxQueueReport'][_0xf5ae('0x115')](db['CmList'],{'as':_0xf5ae('0x15f'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x48')],{});db['FaxQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x4a')],{});db[_0xf5ae('0x4d')][_0xf5ae('0x115')](db['User'],{});db[_0xf5ae('0x4d')][_0xf5ae('0x115')](db[_0xf5ae('0x12a')],{});db[_0xf5ae('0x4f')][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x179'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x4f')][_0xf5ae('0x104')](db['CannedAnswer'],{'as':_0xf5ae('0x170'),'foreignKey':'SmsAccountId'});db[_0xf5ae('0x4f')][_0xf5ae('0x104')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xf5ae('0x4f')][_0xf5ae('0x104')](db[_0xf5ae('0x53')],{'as':_0xf5ae('0x171')});db[_0xf5ae('0x4f')][_0xf5ae('0x104')](db[_0xf5ae('0x51')],{'as':_0xf5ae('0x13f')});db[_0xf5ae('0x4f')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':'List','foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0x4f')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':_0xf5ae('0x160'),'foreignKey':_0xf5ae('0x161')});db[_0xf5ae('0x4f')]['belongsToMany'](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x137')});db[_0xf5ae('0x51')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'onDelete':_0xf5ae('0x16c')});db['SmsApplication'][_0xf5ae('0x115')](db[_0xf5ae('0x56')],{'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x51')][_0xf5ae('0x115')](db['SmsAccount'],{'onDelete':_0xf5ae('0x16c')});db['SmsApplication']['belongsTo'](db[_0xf5ae('0x81')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x51')][_0xf5ae('0x115')](db[_0xf5ae('0x8a')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x16d')});db['SmsInteraction']['hasMany'](db[_0xf5ae('0x55')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf5ae('0x17a')});db[_0xf5ae('0x53')][_0xf5ae('0x115')](db[_0xf5ae('0x4f')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x179')});db[_0xf5ae('0x53')]['belongsTo'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x53')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x53')][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':'sms_interaction_has_tags','as':_0xf5ae('0x168')});db[_0xf5ae('0x53')][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x17b'),'as':_0xf5ae('0x176')});db[_0xf5ae('0x53')]['belongsToMany'](db[_0xf5ae('0x13')],{'as':'Users','through':_0xf5ae('0x124'),'foreignKey':_0xf5ae('0x17a')});db['SmsMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':'User'});db[_0xf5ae('0x55')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'onDelete':_0xf5ae('0x100'),'as':'Contact'});db[_0xf5ae('0x55')][_0xf5ae('0x115')](db['SmsInteraction'],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x16a'),'foreignKey':_0xf5ae('0x17a')});db[_0xf5ae('0x55')][_0xf5ae('0x115')](db[_0xf5ae('0x4f')],{'as':'Account','foreignKey':_0xf5ae('0x179')});db[_0xf5ae('0x56')][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x32'),'foreignKey':_0xf5ae('0x17c')});db['SmsQueue'][_0xf5ae('0x11d')](db['Team'],{'through':_0xf5ae('0x17d'),'as':_0xf5ae('0x14c')});db[_0xf5ae('0x58')]['hasMany'](db['Disposition'],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x17e'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x58')][_0xf5ae('0x104')](db[_0xf5ae('0x7c')],{'as':_0xf5ae('0x170'),'foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x58')]['hasMany'](db[_0xf5ae('0x10c')],{'as':'Interactions','foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x58')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x58')]['hasMany'](db[_0xf5ae('0x17f')],{'as':_0xf5ae('0x13f'),'foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x58')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0x58')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf5ae('0x58')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x136')});db[_0xf5ae('0x17f')][_0xf5ae('0x115')](db['User'],{'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x17f')][_0xf5ae('0x115')](db['OpenchannelQueue'],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x180')});db['OpenchannelApplication']['belongsTo'](db[_0xf5ae('0x58')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0xf5ae('0x17f')][_0xf5ae('0x115')](db[_0xf5ae('0x81')],{'onDelete':'restrict','foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x17f')]['belongsTo'](db['Tag'],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x16d')});db[_0xf5ae('0x10c')][_0xf5ae('0x104')](db[_0xf5ae('0x5c')],{'as':_0xf5ae('0x150'),'onDelete':'cascade','foreignKey':_0xf5ae('0x181')});db[_0xf5ae('0x10c')][_0xf5ae('0x115')](db[_0xf5ae('0x58')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x10c')][_0xf5ae('0x115')](db['CmContact'],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db['OpenchannelInteraction'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':'UserId'});db[_0xf5ae('0x10c')][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x182'),'as':_0xf5ae('0x168')});db[_0xf5ae('0x10c')][_0xf5ae('0x11d')](db['Tag'],{'through':_0xf5ae('0x182'),'as':_0xf5ae('0x176')});db[_0xf5ae('0x10c')][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x125'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xf5ae('0x115')](db['User'],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x13')});db[_0xf5ae('0x5c')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'onDelete':_0xf5ae('0x100'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0xf5ae('0x10c')],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x16a'),'foreignKey':_0xf5ae('0x181')});db[_0xf5ae('0x5c')][_0xf5ae('0x115')](db[_0xf5ae('0xe3')],{'as':_0xf5ae('0xe3'),'foreignKey':_0xf5ae('0x177')});db['OpenchannelMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x58')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x17e')});db[_0xf5ae('0x5d')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x12d'),'foreignKey':_0xf5ae('0x180')});db[_0xf5ae('0x5d')]['belongsToMany'](db['Team'],{'through':_0xf5ae('0x183'),'as':'Teams'});db[_0xf5ae('0x5f')]['hasMany'](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x184'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x5f')][_0xf5ae('0x104')](db[_0xf5ae('0x7c')],{'as':_0xf5ae('0x170'),'foreignKey':_0xf5ae('0x184')});db[_0xf5ae('0x5f')]['hasMany'](db['ChatProactiveAction'],{'as':_0xf5ae('0x185')});db[_0xf5ae('0x5f')][_0xf5ae('0x104')](db[_0xf5ae('0x65')],{'as':'Interactions'});db[_0xf5ae('0x5f')]['hasMany'](db['ChatApplication'],{'as':_0xf5ae('0x13f')});db['ChatWebsite']['hasMany'](db[_0xf5ae('0x186')],{'as':_0xf5ae('0x150')});db[_0xf5ae('0x5f')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':'List','foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0x5f')][_0xf5ae('0x115')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0xf5ae('0x5f')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{'as':_0xf5ae('0x132'),'foreignKey':_0xf5ae('0x158')});db[_0xf5ae('0x5f')]['belongsTo'](db[_0xf5ae('0x83')],{'as':_0xf5ae('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf5ae('0x5f')]['belongsToMany'](db['User'],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x12f')});db[_0xf5ae('0x61')][_0xf5ae('0x115')](db[_0xf5ae('0x58')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xf5ae('0xec')],{'as':'List','foreignKey':_0xf5ae('0x16e')});db['OpenchannelQueueReport']['belongsTo'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x61')][_0xf5ae('0x115')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x5c')],{});db[_0xf5ae('0x61')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{});db[_0xf5ae('0x61')]['belongsTo'](db['OpenchannelQueue'],{});db[_0xf5ae('0x63')]['belongsTo'](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x187'),'foreignKey':_0xf5ae('0x103'),'onDelete':'restrict'});db[_0xf5ae('0x63')][_0xf5ae('0x115')](db[_0xf5ae('0x68')],{'as':'Queue','foreignKey':_0xf5ae('0x188'),'onDelete':'restrict'});db['ChatApplication'][_0xf5ae('0x115')](db[_0xf5ae('0x5f')],{'as':_0xf5ae('0x189'),'foreignKey':_0xf5ae('0x184'),'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x63')]['belongsTo'](db[_0xf5ae('0x8a')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x16d')});db['ChatInteraction'][_0xf5ae('0x104')](db[_0xf5ae('0x186')],{'as':_0xf5ae('0x150'),'onDelete':_0xf5ae('0x100'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0xf5ae('0x115')](db[_0xf5ae('0x5f')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x184')});db['ChatInteraction'][_0xf5ae('0x115')](db['CmContact'],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x65')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x65')]['belongsToMany'](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x18a'),'as':_0xf5ae('0x168')});db['ChatInteraction'][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction'][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x121'),'foreignKey':_0xf5ae('0x18b')});db[_0xf5ae('0x186')][_0xf5ae('0x115')](db['User'],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x13')});db['ChatMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db['ChatMessage']['belongsTo'](db[_0xf5ae('0x65')],{'onDelete':_0xf5ae('0x100'),'as':'Interaction','foreignKey':_0xf5ae('0x18b')});db['ChatMessage'][_0xf5ae('0x115')](db['Attachment'],{'as':_0xf5ae('0xe3'),'foreignKey':_0xf5ae('0x177')});db[_0xf5ae('0x186')]['belongsTo'](db[_0xf5ae('0x5f')],{'as':'Account','foreignKey':_0xf5ae('0x184')});db['ChatOfflineMessage'][_0xf5ae('0x104')](db[_0xf5ae('0xe3')],{'as':_0xf5ae('0x18c'),'foreignKey':_0xf5ae('0x16b'),'onDelete':_0xf5ae('0x100'),'hooks':!![]});db[_0xf5ae('0x66')]['belongsTo'](db['CmContact'],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x156'),'foreignKey':'ContactId'});db[_0xf5ae('0x66')][_0xf5ae('0x115')](db[_0xf5ae('0x5f')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x184')});db['ChatQueue'][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x2e'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db['Team'],{'through':_0xf5ae('0x18d'),'as':_0xf5ae('0x14c')});db[_0xf5ae('0x6a')][_0xf5ae('0x104')](db['ChatInternalMessage'],{'as':_0xf5ae('0x150'),'foreignKey':_0xf5ae('0x18e'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x6a')][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x141'),'through':'chat_group_has_users'});db[_0xf5ae('0x6c')][_0xf5ae('0x115')](db[_0xf5ae('0x5f')],{'as':'Website','foreignKey':_0xf5ae('0x184')});db['CmCompany'][_0xf5ae('0x104')](db['CmContact'],{'as':_0xf5ae('0x119'),'foreignKey':'CompanyId'});db['CmContact'][_0xf5ae('0x104')](db['CmHopper'],{'as':_0xf5ae('0x18f'),'foreignKey':'ContactId'});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db['CmHopperHistory'],{'as':_0xf5ae('0x144'),'foreignKey':_0xf5ae('0x157')});db['CmContact'][_0xf5ae('0x104')](db[_0xf5ae('0x77')],{'as':_0xf5ae('0x77'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db[_0xf5ae('0x146')],{'as':_0xf5ae('0x147'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db[_0xf5ae('0x10c')],{'as':_0xf5ae('0x10d'),'foreignKey':'ContactId','onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db[_0xf5ae('0x65')],{'as':'ChatInteractions','foreignKey':_0xf5ae('0x157'),'onDelete':'restrict'});db[_0xf5ae('0x118')][_0xf5ae('0x104')](db[_0xf5ae('0x53')],{'as':_0xf5ae('0x123'),'foreignKey':_0xf5ae('0x157'),'onDelete':'restrict'});db[_0xf5ae('0x118')]['hasMany'](db[_0xf5ae('0x48')],{'as':_0xf5ae('0x10f'),'foreignKey':_0xf5ae('0x157'),'onDelete':_0xf5ae('0x16c')});db['CmContact'][_0xf5ae('0x104')](db[_0xf5ae('0x3c')],{'as':_0xf5ae('0x110'),'foreignKey':_0xf5ae('0x157'),'onDelete':_0xf5ae('0x16c')});db['CmContact'][_0xf5ae('0x115')](db[_0xf5ae('0x190')],{'as':_0xf5ae('0x191'),'foreignKey':_0xf5ae('0x192')});db[_0xf5ae('0x118')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':_0xf5ae('0x16e'),'onDelete':'cascade'});db['CmContact'][_0xf5ae('0x11d')](db['User'],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x11a')});db[_0xf5ae('0x118')][_0xf5ae('0x11d')](db['Tag'],{'as':_0xf5ae('0x168'),'through':'cm_contact_has_tags'});db[_0xf5ae('0x118')][_0xf5ae('0x11d')](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x193'),'as':_0xf5ae('0x176')});db[_0xf5ae('0x70')]['belongsTo'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157'),'onDelete':_0xf5ae('0x100')});db['CmHopper'][_0xf5ae('0x115')](db['CmList'],{'as':_0xf5ae('0x15f'),'foreignKey':'ListId','onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x70')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x187'),'foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x70')][_0xf5ae('0x115')](db['VoiceQueue'],{'as':_0xf5ae('0x194'),'foreignKey':_0xf5ae('0x142'),'onDelete':'cascade'});db[_0xf5ae('0x70')]['belongsTo'](db[_0xf5ae('0xe0')],{'as':_0xf5ae('0xe0'),'foreignKey':'CampaignId','onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x70')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x166'),'foreignKey':_0xf5ae('0x195')});db[_0xf5ae('0x72')]['belongsTo'](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x72')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':'List','foreignKey':_0xf5ae('0x16e'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x72')][_0xf5ae('0x115')](db[_0xf5ae('0x19')],{'as':_0xf5ae('0x194'),'foreignKey':_0xf5ae('0x142'),'onDelete':'cascade'});db['CmHopperBlack'][_0xf5ae('0x115')](db['Campaign'],{'as':_0xf5ae('0xe0'),'foreignKey':_0xf5ae('0x196'),'onDelete':'cascade'});db[_0xf5ae('0x7b')]['hasMany'](db[_0xf5ae('0x197')],{'as':{'plural':'All','singular':_0xf5ae('0x198')},'foreignKey':'AutomationAllId','onDelete':_0xf5ae('0x100'),'hooks':!![]});db[_0xf5ae('0x7b')]['hasMany'](db['Condition'],{'as':{'plural':_0xf5ae('0x199'),'singular':_0xf5ae('0x19a')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xf5ae('0x7b')][_0xf5ae('0x104')](db[_0xf5ae('0x19b')],{'as':'Actions','foreignKey':_0xf5ae('0x19c'),'onDelete':_0xf5ae('0x100'),'hooks':!![]});db[_0xf5ae('0x7e')][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':_0xf5ae('0x19d'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0x81')][_0xf5ae('0x104')](db['Interval'],{'as':_0xf5ae('0x19e'),'foreignKey':_0xf5ae('0x14b'),'onDelete':_0xf5ae('0x100'),'hooks':!![],'required':![]});db['Interval'][_0xf5ae('0x104')](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x109'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0xf5ae('0x81')][_0xf5ae('0x104')](db[_0xf5ae('0x15e')],{'as':_0xf5ae('0x19f'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x81')][_0xf5ae('0x104')](db['ChatApplication'],{'as':_0xf5ae('0x1a0'),'foreignKey':'IntervalId'});db[_0xf5ae('0x81')][_0xf5ae('0x104')](db[_0xf5ae('0x172')],{'as':_0xf5ae('0x1a1'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x81')][_0xf5ae('0x104')](db[_0xf5ae('0x51')],{'as':_0xf5ae('0x1a2'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x87')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{});db[_0xf5ae('0x87')][_0xf5ae('0x115')](db[_0xf5ae('0x96')],{'foreignKey':_0xf5ae('0x1a3')});db['Schedule']['belongsTo'](db[_0xf5ae('0x94')],{'foreignKey':_0xf5ae('0x1a4')});db[_0xf5ae('0x89')][_0xf5ae('0x11d')](db[_0xf5ae('0x18')],{'as':_0xf5ae('0x1a5'),'through':_0xf5ae('0x140'),'onDelete':_0xf5ae('0x16c')});db['Tag'][_0xf5ae('0x11d')](db[_0xf5ae('0x118')],{'through':_0xf5ae('0x193')});db[_0xf5ae('0x8a')]['belongsToMany'](db[_0xf5ae('0x65')],{'through':_0xf5ae('0x18a')});db[_0xf5ae('0x8a')][_0xf5ae('0x11d')](db[_0xf5ae('0x3c')],{'through':_0xf5ae('0x167')});db['Tag']['belongsToMany'](db[_0xf5ae('0x53')],{'through':_0xf5ae('0x17b')});db[_0xf5ae('0x8a')][_0xf5ae('0x11d')](db[_0xf5ae('0x48')],{'through':_0xf5ae('0x175')});db['Tag'][_0xf5ae('0x11d')](db[_0xf5ae('0x10c')],{'through':_0xf5ae('0x182')});db[_0xf5ae('0x8a')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xf5ae('0x1a6')});db[_0xf5ae('0x8e')][_0xf5ae('0x104')](db[_0xf5ae('0x197')],{'as':{'plural':'AllConditions','singular':_0xf5ae('0x1a7')},'foreignKey':_0xf5ae('0x1a8'),'onDelete':_0xf5ae('0x100'),'hooks':!![]});db[_0xf5ae('0x8e')][_0xf5ae('0x104')](db[_0xf5ae('0x197')],{'as':{'plural':_0xf5ae('0x1a9'),'singular':_0xf5ae('0x1aa')},'foreignKey':_0xf5ae('0x1ab'),'onDelete':'cascade','hooks':!![]});db[_0xf5ae('0x8e')]['hasMany'](db[_0xf5ae('0x19b')],{'as':_0xf5ae('0x1ac'),'foreignKey':'TriggerId','onDelete':_0xf5ae('0x100'),'hooks':!![]});db[_0xf5ae('0x94')]['hasMany'](db[_0xf5ae('0x9b')],{'as':_0xf5ae('0x1ad'),'onDelete':'cascade','foreignKey':_0xf5ae('0x1a4'),'hooks':!![]});db['AnalyticDefaultReport'][_0xf5ae('0x104')](db['AnalyticFieldReport'],{'as':_0xf5ae('0x1ad'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1a3')});db['AnalyticMetric'][_0xf5ae('0x104')](db[_0xf5ae('0x9b')],{'as':'Fields','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1ae')});db['AnalyticFieldReport'][_0xf5ae('0x115')](db[_0xf5ae('0x99')],{'foreignKey':_0xf5ae('0x1ae')});db[_0xf5ae('0x1af')][_0xf5ae('0x104')](db[_0xf5ae('0x9f')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db['SalesforceConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0x1b2')],{'as':_0xf5ae('0x1b3'),'onDelete':_0xf5ae('0x100'),'foreignKey':'SubjectId'});db[_0xf5ae('0x9f')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xf5ae('0x100'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0x1b2')],{'as':_0xf5ae('0x1ad'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0x9f')][_0xf5ae('0x115')](db[_0xf5ae('0x1af')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0x1b2')][_0xf5ae('0x104')](db[_0xf5ae('0x1b2')],{'as':_0xf5ae('0x1b5'),'foreignKey':_0xf5ae('0x1b6')});db['SalesforceField']['hasMany'](db[_0xf5ae('0x1b2')],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0x1b2')][_0xf5ae('0x104')](db['SalesforceField'],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db['SalesforceField'][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':'Variable','foreignKey':_0xf5ae('0x1ba')});db[_0xf5ae('0xa1')][_0xf5ae('0x104')](db[_0xf5ae('0x1bb')],{'as':'Configurations','onDelete':_0xf5ae('0x100'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0x1bc')],{'as':_0xf5ae('0x1b3'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0x1bb')][_0xf5ae('0x104')](db[_0xf5ae('0x1bc')],{'as':_0xf5ae('0x1bd'),'onDelete':_0xf5ae('0x100'),'foreignKey':'DescriptionId'});db[_0xf5ae('0x1bb')][_0xf5ae('0x104')](db[_0xf5ae('0x1bc')],{'as':'Fields','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b4')});db['SugarcrmConfiguration'][_0xf5ae('0x115')](db[_0xf5ae('0xa1')],{'as':'Account','foreignKey':_0xf5ae('0x1b1')});db['SugarcrmField'][_0xf5ae('0x104')](db[_0xf5ae('0x1bc')],{'as':_0xf5ae('0x1b5'),'foreignKey':'SubjectId'});db['SugarcrmField']['hasMany'](db[_0xf5ae('0x1bc')],{'as':'Description','foreignKey':_0xf5ae('0x1b8')});db['SugarcrmField']['hasMany'](db[_0xf5ae('0x1bc')],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0x1bc')]['belongsTo'](db[_0xf5ae('0x90')],{'as':'Variable','foreignKey':_0xf5ae('0x1ba')});db[_0xf5ae('0xa4')][_0xf5ae('0x104')](db[_0xf5ae('0xa5')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0xa6')],{'as':_0xf5ae('0x1b3'),'onDelete':_0xf5ae('0x100'),'foreignKey':'SubjectId'});db[_0xf5ae('0xa5')][_0xf5ae('0x104')](db['DeskField'],{'as':'Descriptions','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xa5')][_0xf5ae('0x104')](db[_0xf5ae('0xa6')],{'as':_0xf5ae('0x1ad'),'onDelete':_0xf5ae('0x100'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0xf5ae('0x115')](db['DeskAccount'],{'as':_0xf5ae('0x165'),'foreignKey':'AccountId'});db[_0xf5ae('0xa5')][_0xf5ae('0x11d')](db['Tag'],{'through':_0xf5ae('0x1be')});db[_0xf5ae('0xa6')][_0xf5ae('0x104')](db[_0xf5ae('0xa6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf5ae('0xa6')][_0xf5ae('0x104')](db[_0xf5ae('0xa6')],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xa6')][_0xf5ae('0x104')](db[_0xf5ae('0xa6')],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xa6')][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':_0xf5ae('0x90'),'foreignKey':_0xf5ae('0x1ba')});db['ZohoAccount']['hasMany'](db[_0xf5ae('0x1bf')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0x1bf')][_0xf5ae('0x104')](db[_0xf5ae('0xa9')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0x1bf')][_0xf5ae('0x104')](db[_0xf5ae('0xa9')],{'as':_0xf5ae('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xf5ae('0x104')](db['ZohoField'],{'as':_0xf5ae('0x1ad'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0x1bf')][_0xf5ae('0x115')](db[_0xf5ae('0x1c0')],{'as':_0xf5ae('0x165'),'foreignKey':'AccountId'});db['ZohoField'][_0xf5ae('0x104')](db['ZohoField'],{'as':'Subject','foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xa9')]['hasMany'](db[_0xf5ae('0xa9')],{'as':_0xf5ae('0x1b7'),'foreignKey':'DescriptionId'});db[_0xf5ae('0xa9')][_0xf5ae('0x104')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db['ZohoField'][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':_0xf5ae('0x90'),'foreignKey':_0xf5ae('0x1ba')});db[_0xf5ae('0xab')]['hasMany'](db[_0xf5ae('0xad')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0xae')],{'as':_0xf5ae('0x1b3'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0xae')],{'as':_0xf5ae('0x1bd'),'foreignKey':_0xf5ae('0x1b8')});db['ZendeskConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0xae')],{'as':_0xf5ae('0x1ad'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xad')][_0xf5ae('0x115')](db[_0xf5ae('0xab')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xf5ae('0x1c1')});db[_0xf5ae('0xae')][_0xf5ae('0x104')](db[_0xf5ae('0xae')],{'as':_0xf5ae('0x1b5'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xae')][_0xf5ae('0x104')](db['ZendeskField'],{'as':'Description','foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xae')]['hasMany'](db[_0xf5ae('0xae')],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db['ZendeskField'][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':_0xf5ae('0x90'),'foreignKey':_0xf5ae('0x1ba')});db[_0xf5ae('0x1c2')][_0xf5ae('0x104')](db[_0xf5ae('0xb1')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xb1')][_0xf5ae('0x104')](db[_0xf5ae('0xb3')],{'as':'Subjects','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xb1')][_0xf5ae('0x104')](db[_0xf5ae('0xb3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xf5ae('0x1b8')});db['FreshdeskConfiguration']['hasMany'](db[_0xf5ae('0xb3')],{'as':_0xf5ae('0x1ad'),'onDelete':'cascade','foreignKey':_0xf5ae('0x1b4')});db['FreshdeskConfiguration']['belongsTo'](db[_0xf5ae('0x1c2')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db['FreshdeskConfiguration']['belongsToMany'](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x1c3')});db[_0xf5ae('0xb3')][_0xf5ae('0x104')](db[_0xf5ae('0xb3')],{'as':_0xf5ae('0x1b5'),'foreignKey':'SubjectId'});db[_0xf5ae('0xb3')][_0xf5ae('0x104')](db[_0xf5ae('0xb3')],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xb3')]['hasMany'](db[_0xf5ae('0xb3')],{'as':'Field','foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xb3')][_0xf5ae('0x115')](db['Variable'],{'as':_0xf5ae('0x90'),'foreignKey':'VariableId'});db[_0xf5ae('0xb4')][_0xf5ae('0x104')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xb6')][_0xf5ae('0x104')](db[_0xf5ae('0xb8')],{'as':_0xf5ae('0x1b3'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xb6')][_0xf5ae('0x104')](db['VtigerField'],{'as':_0xf5ae('0x1bd'),'foreignKey':_0xf5ae('0x1b8')});db['VtigerConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0xb8')],{'as':'Fields','foreignKey':_0xf5ae('0x1b4')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xb8')][_0xf5ae('0x104')](db[_0xf5ae('0xb8')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf5ae('0xb8')][_0xf5ae('0x104')](db[_0xf5ae('0xb8')],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xb8')][_0xf5ae('0x104')](db[_0xf5ae('0xb8')],{'as':'Field','foreignKey':_0xf5ae('0x1b4')});db['VtigerField'][_0xf5ae('0x115')](db['Variable'],{'as':_0xf5ae('0x90'),'foreignKey':'VariableId'});db[_0xf5ae('0x1c4')][_0xf5ae('0x104')](db['ServicenowConfiguration'],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xba')][_0xf5ae('0x104')](db[_0xf5ae('0x1c5')],{'as':_0xf5ae('0x1b3'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xba')][_0xf5ae('0x104')](db[_0xf5ae('0x1c5')],{'as':_0xf5ae('0x1bd'),'foreignKey':_0xf5ae('0x1b8')});db['ServicenowConfiguration'][_0xf5ae('0x104')](db[_0xf5ae('0x1c5')],{'as':'Fields','foreignKey':_0xf5ae('0x1b4')});db['ServicenowConfiguration'][_0xf5ae('0x115')](db[_0xf5ae('0x1c4')],{'as':_0xf5ae('0x165'),'foreignKey':'AccountId'});db[_0xf5ae('0x1c5')][_0xf5ae('0x104')](db[_0xf5ae('0x1c5')],{'as':_0xf5ae('0x1b5'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0x1c5')][_0xf5ae('0x104')](db['ServicenowField'],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0x1c5')][_0xf5ae('0x104')](db['ServicenowField'],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0x1c5')][_0xf5ae('0x115')](db['Variable'],{'as':_0xf5ae('0x90'),'foreignKey':_0xf5ae('0x1ba')});db[_0xf5ae('0xbd')]['hasMany'](db[_0xf5ae('0xbe')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xbe')][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1b3'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xbe')][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1bd'),'onDelete':'cascade','foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xbe')][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1ad'),'onDelete':_0xf5ae('0x100'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xf5ae('0x115')](db[_0xf5ae('0xbd')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xbf')][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1b5'),'foreignKey':_0xf5ae('0x1b6')});db['Dynamics365Field'][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1b7'),'foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xbf')][_0xf5ae('0x104')](db[_0xf5ae('0xbf')],{'as':_0xf5ae('0x1b9'),'foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xbf')][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':_0xf5ae('0x90'),'foreignKey':'VariableId'});db[_0xf5ae('0xc0')][_0xf5ae('0x104')](db[_0xf5ae('0xc2')],{'as':_0xf5ae('0x1b0'),'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xc2')][_0xf5ae('0x104')](db[_0xf5ae('0xc4')],{'as':'Subjects','foreignKey':_0xf5ae('0x1b6')});db[_0xf5ae('0xc2')][_0xf5ae('0x104')](db['FreshsalesField'],{'as':_0xf5ae('0x1bd'),'foreignKey':_0xf5ae('0x1b8')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':'Fields','foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xc2')][_0xf5ae('0x115')](db[_0xf5ae('0xc0')],{'as':_0xf5ae('0x165'),'foreignKey':_0xf5ae('0x1b1')});db[_0xf5ae('0xc4')]['hasMany'](db[_0xf5ae('0xc4')],{'as':_0xf5ae('0x1b5'),'foreignKey':'SubjectId'});db[_0xf5ae('0xc4')]['hasMany'](db['FreshsalesField'],{'as':'Description','foreignKey':_0xf5ae('0x1b8')});db[_0xf5ae('0xc4')]['hasMany'](db[_0xf5ae('0xc4')],{'as':'Field','foreignKey':_0xf5ae('0x1b4')});db[_0xf5ae('0xc4')][_0xf5ae('0x115')](db[_0xf5ae('0x90')],{'as':_0xf5ae('0x90'),'foreignKey':_0xf5ae('0x1ba')});db['ChatQueueReport'][_0xf5ae('0x115')](db['ChatWebsite'],{});db[_0xf5ae('0xc8')]['belongsTo'](db['CmList'],{'as':_0xf5ae('0x15f'),'foreignKey':_0xf5ae('0x16e')});db['ChatQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0xc8')]['belongsTo'](db['ChatInteraction'],{});db[_0xf5ae('0xc8')][_0xf5ae('0x115')](db[_0xf5ae('0x186')],{});db[_0xf5ae('0xc8')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{});db[_0xf5ae('0xc8')][_0xf5ae('0x115')](db[_0xf5ae('0x68')],{});db['ChatInternalMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x1c6')});db[_0xf5ae('0xca')][_0xf5ae('0x115')](db['User'],{'onDelete':'cascade','foreignKey':_0xf5ae('0x1c7')});db[_0xf5ae('0x146')]['hasMany'](db[_0xf5ae('0xce')],{'foreignKey':_0xf5ae('0x1c8'),'onDelete':'cascade'});db[_0xf5ae('0x146')][_0xf5ae('0x104')](db[_0xf5ae('0xcc')],{'foreignKey':'SessionId','onDelete':_0xf5ae('0x100')});db[_0xf5ae('0xcf')][_0xf5ae('0x115')](db[_0xf5ae('0x4f')],{});db['SmsQueueReport'][_0xf5ae('0x115')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xf5ae('0xcf')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0xcf')][_0xf5ae('0x115')](db[_0xf5ae('0x53')],{});db['SmsQueueReport']['belongsTo'](db[_0xf5ae('0x55')],{});db[_0xf5ae('0xcf')][_0xf5ae('0x115')](db['User'],{});db['SmsQueueReport'][_0xf5ae('0x115')](db[_0xf5ae('0x56')],{});db[_0xf5ae('0x1c9')][_0xf5ae('0x104')](db[_0xf5ae('0x146')],{'foreignKey':_0xf5ae('0x1ca')});db[_0xf5ae('0x1c9')][_0xf5ae('0x104')](db['JscriptyQuestionReport'],{'foreignKey':_0xf5ae('0x1ca')});db[_0xf5ae('0x1c9')][_0xf5ae('0x104')](db[_0xf5ae('0xcc')],{'foreignKey':_0xf5ae('0x1ca')});db[_0xf5ae('0xd7')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':'Users','through':_0xf5ae('0x13b')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x11f')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x19')],{'through':_0xf5ae('0x14d'),'as':_0xf5ae('0x1cb')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x39')],{'through':_0xf5ae('0x163'),'as':_0xf5ae('0x127')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db['ChatQueue'],{'through':_0xf5ae('0x18d'),'as':_0xf5ae('0x129')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x12a')],{'through':_0xf5ae('0x178'),'as':_0xf5ae('0x12b')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x56')],{'through':'team_has_sms_queues','as':_0xf5ae('0x12c')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x5d')],{'through':_0xf5ae('0x183'),'as':_0xf5ae('0x1cc')});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0x1cd')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xf5ae('0x11e')][_0xf5ae('0x11d')](db[_0xf5ae('0xee')],{'through':_0xf5ae('0x1ce'),'as':_0xf5ae('0x1cf')});db[_0xf5ae('0xe0')][_0xf5ae('0x104')](db[_0xf5ae('0x70')],{'as':_0xf5ae('0x18f'),'foreignKey':_0xf5ae('0x196')});db[_0xf5ae('0xe0')]['hasMany'](db[_0xf5ae('0x74')],{'as':_0xf5ae('0x10a'),'foreignKey':_0xf5ae('0x196')});db[_0xf5ae('0xe0')][_0xf5ae('0x104')](db['CmHopperHistory'],{'as':_0xf5ae('0x144'),'foreignKey':_0xf5ae('0x196')});db['Campaign'][_0xf5ae('0x104')](db[_0xf5ae('0x72')],{'as':_0xf5ae('0x145'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0xf5ae('0x28')],{'as':_0xf5ae('0x28'),'foreignKey':'TrunkId'});db[_0xf5ae('0xe0')][_0xf5ae('0x115')](db[_0xf5ae('0x28')],{'as':_0xf5ae('0x149'),'foreignKey':_0xf5ae('0x14a')});db[_0xf5ae('0xe0')][_0xf5ae('0x115')](db[_0xf5ae('0x81')],{'as':_0xf5ae('0x81'),'foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0xe0')][_0xf5ae('0x115')](db['SquareProject'],{'as':_0xf5ae('0xd7'),'foreignKey':_0xf5ae('0x1d0')});db['Campaign'][_0xf5ae('0x11d')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x11b'),'through':_0xf5ae('0x1d1')});db['Campaign']['belongsToMany'](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x14e'),'through':_0xf5ae('0x1d2')});db[_0xf5ae('0xe3')][_0xf5ae('0x115')](db[_0xf5ae('0x66')],{'as':_0xf5ae('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0xf5ae('0xe4')][_0xf5ae('0x115')](db[_0xf5ae('0x3e')],{});db['MailTransferReport'][_0xf5ae('0x115')](db['MailInteraction'],{});db[_0xf5ae('0xe4')][_0xf5ae('0x115')](db[_0xf5ae('0x132')],{'foreignKey':_0xf5ae('0x1d3'),'as':_0xf5ae('0x1d4')});db['MailTransferReport']['belongsTo'](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db['MailTransferReport'][_0xf5ae('0x115')](db['User'],{'foreignKey':_0xf5ae('0x1d7'),'as':_0xf5ae('0x1d8')});db[_0xf5ae('0xe4')][_0xf5ae('0x115')](db['MailQueue'],{'foreignKey':_0xf5ae('0x1d9'),'as':'ToQueue'});db[_0xf5ae('0xe4')]['belongsTo'](db[_0xf5ae('0x132')],{'foreignKey':_0xf5ae('0x1da'),'as':'ToAccount'});db['ChatTransferReport'][_0xf5ae('0x115')](db[_0xf5ae('0x186')],{});db[_0xf5ae('0xe6')][_0xf5ae('0x115')](db[_0xf5ae('0x65')],{});db['ChatTransferReport'][_0xf5ae('0x115')](db[_0xf5ae('0x5f')],{'foreignKey':_0xf5ae('0x1db'),'as':_0xf5ae('0x1d4')});db[_0xf5ae('0xe6')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db[_0xf5ae('0xe6')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d7'),'as':_0xf5ae('0x1d8')});db[_0xf5ae('0xe6')][_0xf5ae('0x115')](db['ChatQueue'],{'foreignKey':_0xf5ae('0x1dc'),'as':_0xf5ae('0x1dd')});db[_0xf5ae('0xe6')][_0xf5ae('0x115')](db['ChatWebsite'],{'foreignKey':_0xf5ae('0x1de'),'as':'ToAccount'});db[_0xf5ae('0xe8')][_0xf5ae('0x115')](db[_0xf5ae('0x4a')],{});db[_0xf5ae('0xe8')][_0xf5ae('0x115')](db['FaxInteraction'],{});db[_0xf5ae('0xe8')]['belongsTo'](db[_0xf5ae('0x45')],{'foreignKey':_0xf5ae('0x1df'),'as':'FromAccount'});db['FaxTransferReport'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db[_0xf5ae('0xe8')]['belongsTo'](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d7'),'as':_0xf5ae('0x1d8')});db[_0xf5ae('0xe8')][_0xf5ae('0x115')](db['FaxQueue'],{'foreignKey':_0xf5ae('0x1e0'),'as':'ToQueue'});db[_0xf5ae('0xe8')][_0xf5ae('0x115')](db[_0xf5ae('0x45')],{'foreignKey':_0xf5ae('0x1e1'),'as':_0xf5ae('0x1e2')});db[_0xf5ae('0xea')]['belongsTo'](db[_0xf5ae('0x5c')],{});db[_0xf5ae('0xea')][_0xf5ae('0x115')](db[_0xf5ae('0x10c')],{});db[_0xf5ae('0xea')][_0xf5ae('0x115')](db[_0xf5ae('0x58')],{'foreignKey':_0xf5ae('0x1e3'),'as':_0xf5ae('0x1d4')});db[_0xf5ae('0xea')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db[_0xf5ae('0xea')][_0xf5ae('0x115')](db['User'],{'foreignKey':_0xf5ae('0x1d7'),'as':'ToAgent'});db[_0xf5ae('0xea')][_0xf5ae('0x115')](db[_0xf5ae('0x5d')],{'foreignKey':_0xf5ae('0x1e4'),'as':_0xf5ae('0x1dd')});db[_0xf5ae('0xea')]['belongsTo'](db[_0xf5ae('0x58')],{'foreignKey':_0xf5ae('0x1e5'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0xf5ae('0x55')],{});db[_0xf5ae('0x1e6')][_0xf5ae('0x115')](db[_0xf5ae('0x53')],{});db[_0xf5ae('0x1e6')]['belongsTo'](db[_0xf5ae('0x4f')],{'foreignKey':'FromSmsAccountId','as':_0xf5ae('0x1d4')});db[_0xf5ae('0x1e6')]['belongsTo'](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db[_0xf5ae('0x1e6')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d7'),'as':_0xf5ae('0x1d8')});db[_0xf5ae('0x1e6')][_0xf5ae('0x115')](db[_0xf5ae('0x56')],{'foreignKey':_0xf5ae('0x1e7'),'as':_0xf5ae('0x1dd')});db[_0xf5ae('0x1e6')][_0xf5ae('0x115')](db[_0xf5ae('0x4f')],{'foreignKey':_0xf5ae('0x1e8'),'as':_0xf5ae('0x1e2')});db['CmList'][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':_0xf5ae('0x15d'),'foreignKey':'ListId','onDelete':_0xf5ae('0x100')});db[_0xf5ae('0xec')][_0xf5ae('0x104')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0xec')]['hasMany'](db[_0xf5ae('0x118')],{'as':'Contacts','onDelete':_0xf5ae('0x100'),'foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0xec')]['hasMany'](db['CmHopperFinal'],{'as':_0xf5ae('0x10a'),'foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0xec')][_0xf5ae('0x104')](db[_0xf5ae('0x143')],{'as':_0xf5ae('0x10b'),'foreignKey':'ListId'});db['CmList'][_0xf5ae('0x104')](db[_0xf5ae('0x77')],{'as':_0xf5ae('0x77'),'foreignKey':_0xf5ae('0x16e')});db['CmList']['belongsToMany'](db[_0xf5ae('0x19')],{'as':'Queues','through':_0xf5ae('0x1e9')});db['CmList'][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x11c')});db[_0xf5ae('0xee')]['hasMany'](db[_0xf5ae('0x108')],{'as':_0xf5ae('0x109'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0xee')]['belongsToMany'](db[_0xf5ae('0x13')],{'as':'Agents','through':_0xf5ae('0xfc')});db[_0xf5ae('0xee')][_0xf5ae('0x11d')](db['Team'],{'through':_0xf5ae('0x1ce'),'as':_0xf5ae('0x14c')});db[_0xf5ae('0xef')]['hasMany'](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x169'),'foreignKey':_0xf5ae('0x116')});db[_0xf5ae('0xef')][_0xf5ae('0x104')](db[_0xf5ae('0xf0')],{'as':_0xf5ae('0x1ea'),'foreignKey':_0xf5ae('0x116'),'onDelete':'cascade'});db[_0xf5ae('0xf0')][_0xf5ae('0x104')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xf5ae('0x1eb'),'onDelete':_0xf5ae('0x100')});db[_0xf5ae('0xf3')][_0xf5ae('0x104')](db[_0xf5ae('0x7e')],{'as':'Dispositions','foreignKey':_0xf5ae('0x1ec'),'onDelete':'cascade'});db[_0xf5ae('0xf3')][_0xf5ae('0x104')](db[_0xf5ae('0x7c')],{'as':'Answers','foreignKey':_0xf5ae('0x1ec')});db[_0xf5ae('0xf3')][_0xf5ae('0x104')](db[_0xf5ae('0x1ed')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0xf5ae('0xf3')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0xf5ae('0x104')](db[_0xf5ae('0x1ee')],{'as':_0xf5ae('0x13f')});db[_0xf5ae('0xf3')][_0xf5ae('0x115')](db[_0xf5ae('0xec')],{'as':_0xf5ae('0x15f'),'foreignKey':_0xf5ae('0x16e')});db[_0xf5ae('0xf3')][_0xf5ae('0x115')](db[_0xf5ae('0x83')],{'as':_0xf5ae('0x160'),'foreignKey':_0xf5ae('0x161')});db[_0xf5ae('0xf3')]['belongsToMany'](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x162'),'through':_0xf5ae('0x139')});db[_0xf5ae('0x1ee')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'onDelete':'restrict'});db[_0xf5ae('0x1ee')]['belongsTo'](db[_0xf5ae('0x1cd')],{'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x1ee')][_0xf5ae('0x115')](db[_0xf5ae('0xf3')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0xf5ae('0x81')],{'onDelete':'restrict','foreignKey':_0xf5ae('0x14b')});db[_0xf5ae('0x1ee')][_0xf5ae('0x115')](db[_0xf5ae('0x8a')],{'onDelete':_0xf5ae('0x16c'),'foreignKey':_0xf5ae('0x16d')});db[_0xf5ae('0x111')][_0xf5ae('0x104')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf5ae('0x1ef')});db[_0xf5ae('0x111')]['belongsTo'](db[_0xf5ae('0xf3')],{'as':_0xf5ae('0x165'),'foreignKey':'WhatsappAccountId'});db[_0xf5ae('0x111')]['belongsTo'](db['CmContact'],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0x111')]['belongsTo'](db[_0xf5ae('0x13')],{'as':'Owner','foreignKey':_0xf5ae('0x103')});db[_0xf5ae('0x111')][_0xf5ae('0x11d')](db['Tag'],{'through':_0xf5ae('0x1a6'),'as':_0xf5ae('0x168')});db[_0xf5ae('0x111')]['belongsToMany'](db[_0xf5ae('0x8a')],{'through':_0xf5ae('0x1a6'),'as':_0xf5ae('0x176')});db['WhatsappInteraction']['belongsToMany'](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x169'),'through':_0xf5ae('0x126'),'foreignKey':_0xf5ae('0x1ef')});db[_0xf5ae('0x1ed')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xf5ae('0x118')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0xf5ae('0x115')](db[_0xf5ae('0x111')],{'onDelete':_0xf5ae('0x100'),'as':_0xf5ae('0x16a'),'foreignKey':_0xf5ae('0x1ef')});db[_0xf5ae('0x1ed')][_0xf5ae('0x115')](db['WhatsappAccount'],{'as':_0xf5ae('0x165'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xf5ae('0x115')](db['WhatsappAccount'],{});db[_0xf5ae('0xf7')][_0xf5ae('0x115')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xf5ae('0xf7')][_0xf5ae('0x115')](db[_0xf5ae('0x118')],{'as':_0xf5ae('0x156'),'foreignKey':_0xf5ae('0x157')});db[_0xf5ae('0xf7')][_0xf5ae('0x115')](db['WhatsappInteraction'],{});db[_0xf5ae('0xf7')]['belongsTo'](db[_0xf5ae('0x1cd')],{});db[_0xf5ae('0xf7')][_0xf5ae('0x115')](db[_0xf5ae('0x1ed')],{});db[_0xf5ae('0xf7')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{});db[_0xf5ae('0xf9')][_0xf5ae('0x115')](db['WhatsappMessage'],{});db[_0xf5ae('0xf9')][_0xf5ae('0x115')](db['WhatsappInteraction'],{});db[_0xf5ae('0xf9')]['belongsTo'](db[_0xf5ae('0xf3')],{'foreignKey':_0xf5ae('0x1f0'),'as':'FromAccount'});db[_0xf5ae('0xf9')][_0xf5ae('0x115')](db[_0xf5ae('0xf3')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db['WhatsappTransferReport'][_0xf5ae('0x115')](db['WhatsappQueue'],{'foreignKey':_0xf5ae('0x1f1'),'as':'ToQueue'});db[_0xf5ae('0xf9')][_0xf5ae('0x115')](db['User'],{'foreignKey':_0xf5ae('0x1d5'),'as':_0xf5ae('0x1d6')});db['WhatsappTransferReport'][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'foreignKey':_0xf5ae('0x1d7'),'as':'ToAgent'});db[_0xf5ae('0x1cd')][_0xf5ae('0x11d')](db[_0xf5ae('0x13')],{'as':'Agents','through':_0xf5ae('0x34'),'foreignKey':_0xf5ae('0x1f2')});db[_0xf5ae('0x1cd')][_0xf5ae('0x11d')](db['Team'],{'through':_0xf5ae('0x1f3'),'as':_0xf5ae('0x14c')});db[_0xf5ae('0xfd')][_0xf5ae('0x115')](db[_0xf5ae('0x13')],{'as':_0xf5ae('0x1f4'),'foreignKey':_0xf5ae('0x103'),'onDelete':'cascade','hooks':!![]});db['CloudProvider'][_0xf5ae('0x101')](db[_0xf5ae('0x36')],{'as':_0xf5ae('0x15b'),'onDelete':_0xf5ae('0x16c')});db[_0xf5ae('0x159')][_0xf5ae('0x101')](db['MailServerOut'],{'as':'Smtp','onDelete':_0xf5ae('0x16c')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3ca16df..d957374 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./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/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','appPath','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./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/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog'];(function(_0x15f649,_0x3281fe){var _0x5a0484=function(_0x20b817){while(--_0x20b817){_0x15f649['push'](_0x15f649['shift']());}};_0x5a0484(++_0x3281fe);}(_0xeec6,0x1c2));var _0x6eec=function(_0x43e2e4,_0x4ad3b4){_0x43e2e4=_0x43e2e4-0x0;var _0x1b71d0=_0xeec6[_0x43e2e4];return _0x1b71d0;};'use strict';var path=require(_0x6eec('0x0'));var express=require(_0x6eec('0x1'));var errors=require(_0x6eec('0x2'));var config=require(_0x6eec('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x6eec('0x4')];var clientSideLogs=require(_0x6eec('0x5'));exports[_0x6eec('0x6')]=function(_0x2d7a15){return setupLoggers(_0x2d7a15)[_0x6eec('0x7')](function(){_0x2d7a15[_0x6eec('0x8')]('/api/users',require(_0x6eec('0x9')));_0x2d7a15[_0x6eec('0x8')]('/api/voice/chanspy',require(_0x6eec('0xa')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb'),require(_0x6eec('0xc')));_0x2d7a15['use'](_0x6eec('0xd'),require(_0x6eec('0xe')));_0x2d7a15[_0x6eec('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x2d7a15['use'](_0x6eec('0xf'),require(_0x6eec('0x10')));_0x2d7a15['use']('/api/voice/recordings',require(_0x6eec('0x11')));_0x2d7a15['use'](_0x6eec('0x12'),require(_0x6eec('0x13')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x14'),require(_0x6eec('0x15')));_0x2d7a15['use'](_0x6eec('0x16'),require(_0x6eec('0x17')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x18'),require(_0x6eec('0x19')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x1a'),require(_0x6eec('0x1b')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x1c'),require('./api/voiceAgentReport'));_0x2d7a15[_0x6eec('0x8')]('/api/voice/queues/reports',require(_0x6eec('0x1d')));_0x2d7a15[_0x6eec('0x8')]('/api/members/reports',require(_0x6eec('0x1e')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x1f'),require('./api/trunk'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x20'),require(_0x6eec('0x21')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x22'),require(_0x6eec('0x23')));_0x2d7a15['use'](_0x6eec('0x24'),require(_0x6eec('0x25')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x26'),require(_0x6eec('0x27')));_0x2d7a15[_0x6eec('0x8')]('/api/mail/substatuses',require(_0x6eec('0x28')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x29'),require(_0x6eec('0x2a')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x2b'),require('./api/mailMessage'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x2c'),require(_0x6eec('0x2d')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x2e'),require(_0x6eec('0x2f')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x30'),require(_0x6eec('0x31')));_0x2d7a15['use'](_0x6eec('0x32'),require(_0x6eec('0x33')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x34'),require('./api/faxAccount'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x35'),require('./api/faxApplication'));_0x2d7a15['use'](_0x6eec('0x36'),require('./api/faxInteraction'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x37'),require(_0x6eec('0x38')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x39'),require(_0x6eec('0x3a')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x3b'),require(_0x6eec('0x3c')));_0x2d7a15[_0x6eec('0x8')]('/api/sms/accounts',require(_0x6eec('0x3d')));_0x2d7a15['use'](_0x6eec('0x3e'),require(_0x6eec('0x3f')));_0x2d7a15[_0x6eec('0x8')]('/api/sms/interactions',require('./api/smsInteraction'));_0x2d7a15['use'](_0x6eec('0x40'),require(_0x6eec('0x41')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x42'),require(_0x6eec('0x43')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x44'),require(_0x6eec('0x45')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x46'),require(_0x6eec('0x47')));_0x2d7a15[_0x6eec('0x8')]('/api/openchannel/interactions',require(_0x6eec('0x48')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x49'),require('./api/openchannelMessage'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x4a'),require(_0x6eec('0x4b')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x4c'),require(_0x6eec('0x4d')));_0x2d7a15['use'](_0x6eec('0x4e'),require(_0x6eec('0x4f')));_0x2d7a15[_0x6eec('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x50'),require(_0x6eec('0x51')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x52'),require('./api/chatMessage'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x53'),require(_0x6eec('0x54')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x55'),require(_0x6eec('0x56')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x57'),require('./api/chatGroup'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x58'),require('./api/chatProactiveAction'));_0x2d7a15['use'](_0x6eec('0x59'),require(_0x6eec('0x5a')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x5b'),require('./api/cmContact'));_0x2d7a15['use'](_0x6eec('0x5c'),require('./api/cmHopper'));_0x2d7a15['use'](_0x6eec('0x5d'),require(_0x6eec('0x5e')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x5f'),require(_0x6eec('0x60')));_0x2d7a15['use'](_0x6eec('0x61'),require(_0x6eec('0x62')));_0x2d7a15['use'](_0x6eec('0x63'),require(_0x6eec('0x64')));_0x2d7a15['use'](_0x6eec('0x65'),require(_0x6eec('0x66')));_0x2d7a15['use'](_0x6eec('0x67'),require(_0x6eec('0x68')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x69'),require('./api/cannedAnswer'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x6a'),require(_0x6eec('0x6b')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x6c'),require('./api/condition'));_0x2d7a15['use'](_0x6eec('0x6d'),require(_0x6eec('0x6e')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x6f'),require(_0x6eec('0x70')));_0x2d7a15['use'](_0x6eec('0x71'),require('./api/cdr'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x72'),require(_0x6eec('0x73')));_0x2d7a15['use'](_0x6eec('0x74'),require(_0x6eec('0x75')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x76'),require(_0x6eec('0x77')));_0x2d7a15['use'](_0x6eec('0x78'),require('./api/tag'));_0x2d7a15['use'](_0x6eec('0x79'),require('./api/template'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x7a'),require(_0x6eec('0x7b')));_0x2d7a15['use']('/api/variables',require(_0x6eec('0x7c')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x7d'),require(_0x6eec('0x7e')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x7f'),require(_0x6eec('0x80')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x81'),require(_0x6eec('0x82')));_0x2d7a15['use']('/api/analytics/default_reports',require(_0x6eec('0x83')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x84'),require('./api/analyticExtractedReport'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x85'),require(_0x6eec('0x86')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x87'),require(_0x6eec('0x88')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x89'),require('./api/analyticTreeReport'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x8a'),require(_0x6eec('0x8b')));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x2d7a15['use'](_0x6eec('0x8c'),require(_0x6eec('0x8d')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x8e'),require('./api/intSugarcrmAccount'));_0x2d7a15['use'](_0x6eec('0x8f'),require(_0x6eec('0x90')));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/sugarcrm/fields',require(_0x6eec('0x91')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x92'),require(_0x6eec('0x93')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x94'),require(_0x6eec('0x95')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x96'),require('./api/intDeskField'));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/zoho/accounts',require(_0x6eec('0x97')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x98'),require(_0x6eec('0x99')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x9a'),require(_0x6eec('0x9b')));_0x2d7a15['use'](_0x6eec('0x9c'),require('./api/intZendeskAccount'));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/zendesk/configurations',require(_0x6eec('0x9d')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x9e'),require(_0x6eec('0x9f')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xa0'),require(_0x6eec('0xa1')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xa2'),require(_0x6eec('0xa3')));_0x2d7a15['use']('/api/integrations/freshdesk/fields',require(_0x6eec('0xa4')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xa5'),require(_0x6eec('0xa6')));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/vtiger/configurations',require(_0x6eec('0xa7')));_0x2d7a15[_0x6eec('0x8')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x2d7a15['use'](_0x6eec('0xa8'),require(_0x6eec('0xa9')));_0x2d7a15['use'](_0x6eec('0xaa'),require(_0x6eec('0xab')));_0x2d7a15['use'](_0x6eec('0xac'),require(_0x6eec('0xad')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xae'),require('./api/intDynamics365Account'));_0x2d7a15['use'](_0x6eec('0xaf'),require(_0x6eec('0xb0')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb1'),require(_0x6eec('0xb2')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb3'),require(_0x6eec('0xb4')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb5'),require(_0x6eec('0xb6')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb7'),require(_0x6eec('0xb8')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xb9'),require(_0x6eec('0xba')));_0x2d7a15['use'](_0x6eec('0xbb'),require(_0x6eec('0xbc')));_0x2d7a15['use'](_0x6eec('0xbd'),require(_0x6eec('0xbe')));_0x2d7a15['use'](_0x6eec('0xbf'),require(_0x6eec('0xc0')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xc1'),require('./api/jscriptyQuestionReport'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xc2'),require(_0x6eec('0xc3')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xc4'),require(_0x6eec('0xc5')));_0x2d7a15['use'](_0x6eec('0xc6'),require('./api/squareReport'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xc7'),require(_0x6eec('0xc8')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xc9'),require(_0x6eec('0xca')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xcb'),require(_0x6eec('0xcc')));_0x2d7a15['use'](_0x6eec('0xcd'),require(_0x6eec('0xce')));_0x2d7a15[_0x6eec('0x8')]('/api/square/projects',require(_0x6eec('0xcf')));_0x2d7a15[_0x6eec('0x8')]('/api/square/recordings',require(_0x6eec('0xd0')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xd1'),require(_0x6eec('0xd2')));_0x2d7a15[_0x6eec('0x8')]('/api/teams',require(_0x6eec('0xd3')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xd4'),require(_0x6eec('0xd5')));_0x2d7a15[_0x6eec('0x8')]('/api/campaigns',require(_0x6eec('0xd6')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xd7'),require(_0x6eec('0xd8')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xd9'),require(_0x6eec('0xda')));_0x2d7a15[_0x6eec('0x8')]('/api/plugins',require(_0x6eec('0xdb')));_0x2d7a15['use'](_0x6eec('0xdc'),require(_0x6eec('0xdd')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xde'),require('./api/chatTransferReport'));_0x2d7a15[_0x6eec('0x8')]('/api/fax/reports/transfer',require(_0x6eec('0xdf')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xe0'),require(_0x6eec('0xe1')));_0x2d7a15['use']('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xe2'),require(_0x6eec('0xe3')));_0x2d7a15[_0x6eec('0x8')]('/api/voice/prefixes',require(_0x6eec('0xe4')));_0x2d7a15['use'](_0x6eec('0xe5'),require(_0x6eec('0xe6')));_0x2d7a15['use'](_0x6eec('0xe7'),require(_0x6eec('0xe8')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xe9'),require(_0x6eec('0xea')));_0x2d7a15[_0x6eec('0x8')]('/api/userNotifications',require(_0x6eec('0xeb')));_0x2d7a15['use'](_0x6eec('0xec'),require(_0x6eec('0xed')));_0x2d7a15['use'](_0x6eec('0xee'),require('./api/whatsappApplication'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xef'),require(_0x6eec('0xf0')));_0x2d7a15[_0x6eec('0x8')]('/api/whatsapp/messages',require(_0x6eec('0xf1')));_0x2d7a15['use'](_0x6eec('0xf2'),require(_0x6eec('0xf3')));_0x2d7a15['use'](_0x6eec('0xf4'),require(_0x6eec('0xf5')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xf6'),require(_0x6eec('0xf7')));_0x2d7a15['use'](_0x6eec('0xf8'),require(_0x6eec('0xf9')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xfa'),require(_0x6eec('0xfb')));_0x2d7a15[_0x6eec('0x8')]('/api/user-settings',require('./api/user-setting'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0xfc'),require('./api/authLocal'));_0x2d7a15['use'](_0x6eec('0xfd'),require(_0x6eec('0xfe')));_0x2d7a15['use'](_0x6eec('0xff'),require(_0x6eec('0x100')));_0x2d7a15[_0x6eec('0x8')]('/api/jira',require(_0x6eec('0x101')));_0x2d7a15['use'](_0x6eec('0x102'),require(_0x6eec('0x103')));_0x2d7a15['use'](_0x6eec('0x104'),require(_0x6eec('0x105')));_0x2d7a15[_0x6eec('0x8')]('/api/system',require(_0x6eec('0x106')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x107'),require(_0x6eec('0x108')));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x109'),require('./api/webbar'));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x10a'),clientSideLogs);_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x10b'),express[_0x6eec('0x10c')](path[_0x6eec('0x10d')](config[_0x6eec('0x10e')],_0x6eec('0x10b'))));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x10f'),express[_0x6eec('0x10c')](path[_0x6eec('0x10d')](config['root'],_0x6eec('0x10f'))));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x110'),express[_0x6eec('0x10c')](path[_0x6eec('0x10d')](config[_0x6eec('0x10e')],_0x6eec('0x110'))));_0x2d7a15[_0x6eec('0x8')](_0x6eec('0x111'),express[_0x6eec('0x10c')](path[_0x6eec('0x10d')](config[_0x6eec('0x10e')],_0x6eec('0x112'),_0x6eec('0x113'))));_0x2d7a15[_0x6eec('0x8')]('/plugins',express[_0x6eec('0x10c')](path['join'](config[_0x6eec('0x10e')],_0x6eec('0x114'))));_0x2d7a15[_0x6eec('0x115')](_0x6eec('0x116'))['get'](errors[0x194]);_0x2d7a15[_0x6eec('0x115')]('/*')['get'](function(_0x205310,_0x340f8c){_0x340f8c[_0x6eec('0x117')](path[_0x6eec('0x118')](_0x2d7a15[_0x6eec('0x119')](_0x6eec('0x11a'))+'/index.html'));});return _0x2d7a15;});}; \ No newline at end of file +var _0x3eea=['./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./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/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','static','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/messages','/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/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue'];(function(_0x437ba0,_0x519ea3){var _0x56350f=function(_0x25b939){while(--_0x25b939){_0x437ba0['push'](_0x437ba0['shift']());}};_0x56350f(++_0x519ea3);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1b50c8,_0x3b08bf){_0x1b50c8=_0x1b50c8-0x0;var _0x490167=_0x3eea[_0x1b50c8];return _0x490167;};'use strict';var path=require(_0xa3ee('0x0'));var express=require('express');var errors=require(_0xa3ee('0x1'));var config=require(_0xa3ee('0x2'));var setupLoggers=require(_0xa3ee('0x3'))[_0xa3ee('0x4')];var clientSideLogs=require(_0xa3ee('0x5'));exports[_0xa3ee('0x6')]=function(_0x104913){return setupLoggers(_0x104913)[_0xa3ee('0x7')](function(){_0x104913[_0xa3ee('0x8')](_0xa3ee('0x9'),require(_0xa3ee('0xa')));_0x104913['use']('/api/voice/chanspy',require(_0xa3ee('0xb')));_0x104913['use'](_0xa3ee('0xc'),require('./api/voiceContext'));_0x104913[_0xa3ee('0x8')]('/api/voice/extensions',require(_0xa3ee('0xd')));_0x104913['use'](_0xa3ee('0xe'),require(_0xa3ee('0xf')));_0x104913[_0xa3ee('0x8')]('/api/voice/queues',require(_0xa3ee('0x10')));_0x104913[_0xa3ee('0x8')]('/api/voice/recordings',require('./api/voiceRecording'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x11'),require(_0xa3ee('0x12')));_0x104913[_0xa3ee('0x8')]('/api/voice/mails',require(_0xa3ee('0x13')));_0x104913['use'](_0xa3ee('0x14'),require(_0xa3ee('0x15')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x16'),require('./api/voiceCallReport'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x17'),require('./api/voiceDialReport'));_0x104913['use']('/api/voice/agents/reports',require(_0xa3ee('0x18')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x19'),require(_0xa3ee('0x1a')));_0x104913['use'](_0xa3ee('0x1b'),require(_0xa3ee('0x1c')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x1d'),require(_0xa3ee('0x1e')));_0x104913['use'](_0xa3ee('0x1f'),require(_0xa3ee('0x20')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x21'),require(_0xa3ee('0x22')));_0x104913[_0xa3ee('0x8')]('/api/mail/accounts',require(_0xa3ee('0x23')));_0x104913[_0xa3ee('0x8')]('/api/mail/queues',require(_0xa3ee('0x24')));_0x104913['use'](_0xa3ee('0x25'),require(_0xa3ee('0x26')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x27'),require(_0xa3ee('0x28')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x29'),require(_0xa3ee('0x2a')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x2b'),require('./api/mailApplication'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x2c'),require(_0xa3ee('0x2d')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x2e'),require('./api/dashboard'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x2f'),require(_0xa3ee('0x30')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x31'),require(_0xa3ee('0x32')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x33'),require(_0xa3ee('0x34')));_0x104913[_0xa3ee('0x8')]('/api/fax/interactions',require('./api/faxInteraction'));_0x104913['use'](_0xa3ee('0x35'),require('./api/faxMessage'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x36'),require(_0xa3ee('0x37')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x38'),require(_0xa3ee('0x39')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x3a'),require(_0xa3ee('0x3b')));_0x104913[_0xa3ee('0x8')]('/api/sms/applications',require(_0xa3ee('0x3c')));_0x104913['use'](_0xa3ee('0x3d'),require(_0xa3ee('0x3e')));_0x104913['use'](_0xa3ee('0x3f'),require('./api/smsMessage'));_0x104913[_0xa3ee('0x8')]('/api/sms/queues',require(_0xa3ee('0x40')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x41'),require(_0xa3ee('0x42')));_0x104913[_0xa3ee('0x8')]('/api/openchannel/applications',require(_0xa3ee('0x43')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x44'),require('./api/openchannelInteraction'));_0x104913[_0xa3ee('0x8')]('/api/openchannel/messages',require(_0xa3ee('0x45')));_0x104913['use'](_0xa3ee('0x46'),require('./api/openchannelQueue'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x47'),require(_0xa3ee('0x48')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x49'),require(_0xa3ee('0x4a')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x4b'),require(_0xa3ee('0x4c')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x4d'),require(_0xa3ee('0x4e')));_0x104913[_0xa3ee('0x8')]('/api/chat/messages',require(_0xa3ee('0x4f')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x50'),require(_0xa3ee('0x51')));_0x104913['use'](_0xa3ee('0x52'),require(_0xa3ee('0x53')));_0x104913[_0xa3ee('0x8')]('/api/chat/groups',require(_0xa3ee('0x54')));_0x104913[_0xa3ee('0x8')]('/api/chat/proactive_actions',require(_0xa3ee('0x55')));_0x104913[_0xa3ee('0x8')]('/api/cm/companies',require(_0xa3ee('0x56')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x57'),require(_0xa3ee('0x58')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x59'),require(_0xa3ee('0x5a')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x5b'),require(_0xa3ee('0x5c')));_0x104913[_0xa3ee('0x8')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x104913['use'](_0xa3ee('0x5d'),require(_0xa3ee('0x5e')));_0x104913['use'](_0xa3ee('0x5f'),require(_0xa3ee('0x60')));_0x104913[_0xa3ee('0x8')]('/api/actions',require(_0xa3ee('0x61')));_0x104913['use'](_0xa3ee('0x62'),require(_0xa3ee('0x63')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x64'),require(_0xa3ee('0x65')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x66'),require(_0xa3ee('0x67')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x68'),require(_0xa3ee('0x69')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x6a'),require(_0xa3ee('0x6b')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x6c'),require(_0xa3ee('0x6d')));_0x104913[_0xa3ee('0x8')]('/api/cdr',require(_0xa3ee('0x6e')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x6f'),require(_0xa3ee('0x70')));_0x104913['use'](_0xa3ee('0x71'),require('./api/schedule'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x72'),require(_0xa3ee('0x73')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x74'),require(_0xa3ee('0x75')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x76'),require(_0xa3ee('0x77')));_0x104913[_0xa3ee('0x8')]('/api/triggers',require(_0xa3ee('0x78')));_0x104913['use']('/api/variables',require(_0xa3ee('0x79')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x7a'),require(_0xa3ee('0x7b')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x7c'),require(_0xa3ee('0x7d')));_0x104913['use'](_0xa3ee('0x7e'),require(_0xa3ee('0x7f')));_0x104913['use'](_0xa3ee('0x80'),require(_0xa3ee('0x81')));_0x104913[_0xa3ee('0x8')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x82'),require(_0xa3ee('0x83')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x84'),require('./api/analyticFieldReport'));_0x104913['use'](_0xa3ee('0x85'),require(_0xa3ee('0x86')));_0x104913['use'](_0xa3ee('0x87'),require(_0xa3ee('0x88')));_0x104913[_0xa3ee('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x104913[_0xa3ee('0x8')]('/api/integrations/salesforce/fields',require(_0xa3ee('0x89')));_0x104913[_0xa3ee('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xa3ee('0x8a')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x8b'),require('./api/intSugarcrmConfiguration'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x8c'),require('./api/intSugarcrmField'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x8d'),require(_0xa3ee('0x8e')));_0x104913['use']('/api/integrations/desk/configurations',require(_0xa3ee('0x8f')));_0x104913[_0xa3ee('0x8')]('/api/integrations/desk/fields',require(_0xa3ee('0x90')));_0x104913[_0xa3ee('0x8')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x91'),require(_0xa3ee('0x92')));_0x104913['use'](_0xa3ee('0x93'),require(_0xa3ee('0x94')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x95'),require(_0xa3ee('0x96')));_0x104913[_0xa3ee('0x8')]('/api/integrations/zendesk/configurations',require(_0xa3ee('0x97')));_0x104913[_0xa3ee('0x8')]('/api/integrations/zendesk/fields',require(_0xa3ee('0x98')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x99'),require(_0xa3ee('0x9a')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x9b'),require('./api/intFreshdeskConfiguration'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x9c'),require(_0xa3ee('0x9d')));_0x104913['use'](_0xa3ee('0x9e'),require(_0xa3ee('0x9f')));_0x104913['use']('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x104913['use'](_0xa3ee('0xa0'),require(_0xa3ee('0xa1')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xa2'),require(_0xa3ee('0xa3')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xa4'),require('./api/intServicenowConfiguration'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xa5'),require(_0xa3ee('0xa6')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xa7'),require('./api/intDynamics365Account'));_0x104913['use'](_0xa3ee('0xa8'),require(_0xa3ee('0xa9')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xaa'),require(_0xa3ee('0xab')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xac'),require(_0xa3ee('0xad')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xae'),require(_0xa3ee('0xaf')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xb0'),require(_0xa3ee('0xb1')));_0x104913[_0xa3ee('0x8')]('/api/networks',require(_0xa3ee('0xb2')));_0x104913['use']('/api/chat/reports/queue',require(_0xa3ee('0xb3')));_0x104913['use'](_0xa3ee('0xb4'),require(_0xa3ee('0xb5')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xb6'),require('./api/jscriptyAnswerReport'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xb7'),require(_0xa3ee('0xb8')));_0x104913[_0xa3ee('0x8')]('/api/jscripty/sessions/reports',require(_0xa3ee('0xb9')));_0x104913[_0xa3ee('0x8')]('/api/sms/reports/queue',require(_0xa3ee('0xba')));_0x104913['use']('/api/square/reports',require(_0xa3ee('0xbb')));_0x104913['use']('/api/square/details/reports',require(_0xa3ee('0xbc')));_0x104913['use']('/api/jscripty/projects',require(_0xa3ee('0xbd')));_0x104913[_0xa3ee('0x8')]('/api/settings',require('./api/setting'));_0x104913['use'](_0xa3ee('0xbe'),require(_0xa3ee('0xbf')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xc0'),require(_0xa3ee('0xc1')));_0x104913[_0xa3ee('0x8')]('/api/square/recordings',require('./api/squareRecording'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xc2'),require(_0xa3ee('0xc3')));_0x104913['use'](_0xa3ee('0xc4'),require(_0xa3ee('0xc5')));_0x104913['use'](_0xa3ee('0xc6'),require(_0xa3ee('0xc7')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xc8'),require(_0xa3ee('0xc9')));_0x104913['use'](_0xa3ee('0xca'),require(_0xa3ee('0xcb')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xcc'),require(_0xa3ee('0xcd')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xce'),require(_0xa3ee('0xcf')));_0x104913[_0xa3ee('0x8')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x104913[_0xa3ee('0x8')]('/api/chat/reports/transfer',require(_0xa3ee('0xd0')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xd1'),require(_0xa3ee('0xd2')));_0x104913['use'](_0xa3ee('0xd3'),require(_0xa3ee('0xd4')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xd5'),require(_0xa3ee('0xd6')));_0x104913['use'](_0xa3ee('0xd7'),require(_0xa3ee('0xd8')));_0x104913[_0xa3ee('0x8')]('/api/voice/prefixes',require(_0xa3ee('0xd9')));_0x104913['use'](_0xa3ee('0xda'),require('./api/userProfile'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xdb'),require(_0xa3ee('0xdc')));_0x104913[_0xa3ee('0x8')]('/api/userProfile/resources',require(_0xa3ee('0xdd')));_0x104913[_0xa3ee('0x8')]('/api/userNotifications',require(_0xa3ee('0xde')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xdf'),require(_0xa3ee('0xe0')));_0x104913[_0xa3ee('0x8')]('/api/whatsapp/applications',require(_0xa3ee('0xe1')));_0x104913[_0xa3ee('0x8')]('/api/whatsapp/interactions',require(_0xa3ee('0xe2')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xe3'),require(_0xa3ee('0xe4')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xe5'),require(_0xa3ee('0xe6')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xe7'),require(_0xa3ee('0xe8')));_0x104913['use'](_0xa3ee('0xe9'),require(_0xa3ee('0xea')));_0x104913[_0xa3ee('0x8')]('/api/cloudProviders',require(_0xa3ee('0xeb')));_0x104913['use'](_0xa3ee('0xec'),require(_0xa3ee('0xed')));_0x104913['use'](_0xa3ee('0xee'),require(_0xa3ee('0xef')));_0x104913['use'](_0xa3ee('0xf0'),require(_0xa3ee('0xf1')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xf2'),require(_0xa3ee('0xf3')));_0x104913[_0xa3ee('0x8')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x104913['use'](_0xa3ee('0xf4'),require('./api/jira'));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xf5'),require(_0xa3ee('0xf6')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xf7'),require(_0xa3ee('0xf8')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xf9'),require(_0xa3ee('0xfa')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xfb'),require(_0xa3ee('0xfc')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xfd'),require(_0xa3ee('0xfe')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0xff'),clientSideLogs);_0x104913[_0xa3ee('0x8')](_0xa3ee('0x100'),express['static'](path[_0xa3ee('0x101')](config[_0xa3ee('0x102')],_0xa3ee('0x100'))));_0x104913['use']('/www',express[_0xa3ee('0x103')](path[_0xa3ee('0x101')](config['root'],'/www')));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x104'),express[_0xa3ee('0x103')](path[_0xa3ee('0x101')](config[_0xa3ee('0x102')],_0xa3ee('0x104'))));_0x104913[_0xa3ee('0x8')](_0xa3ee('0x105'),express[_0xa3ee('0x103')](path[_0xa3ee('0x101')](config[_0xa3ee('0x102')],_0xa3ee('0x106'),_0xa3ee('0x107'))));_0x104913['use'](_0xa3ee('0x108'),express[_0xa3ee('0x103')](path[_0xa3ee('0x101')](config[_0xa3ee('0x102')],_0xa3ee('0x109'))));_0x104913[_0xa3ee('0x10a')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x104913[_0xa3ee('0x10a')]('/*')[_0xa3ee('0x10b')](function(_0xdc8b7a,_0x48c73c){_0x48c73c[_0xa3ee('0x10c')](path['resolve'](_0x104913[_0xa3ee('0x10b')](_0xa3ee('0x10d'))+_0xa3ee('0x10e')));});return _0x104913;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9025f97..a2ef3bd 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6239=['listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','jayson/promise','lodash'];(function(_0x2406bd,_0x262586){var _0x262964=function(_0x5e06ce){while(--_0x5e06ce){_0x2406bd['push'](_0x2406bd['shift']());}};_0x262964(++_0x262586);}(_0x6239,0x126));var _0x9623=function(_0x408e33,_0x3ee9f6){_0x408e33=_0x408e33-0x0;var _0x4d9043=_0x6239[_0x408e33];return _0x4d9043;};'use strict';var jayson=require(_0x9623('0x0'));var _=require(_0x9623('0x1'));var config=require('../config/environment');exports[_0x9623('0x2')]=function(){return new Promise(function(_0x3c46e6,_0x33c083){var _0x3e8218={};_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/user/user.rpc'));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x4')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x5')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x6')));_0x3e8218=_['merge'](_0x3e8218,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x7')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x8')));_0x3e8218=_['merge'](_0x3e8218,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/memberReport/memberReport.rpc'));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x9')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0xa')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0xb')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0xc')));_0x3e8218=_['merge'](_0x3e8218,require('../api/mailAccount/mailAccount.rpc'));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0xd')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0xe')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/mailMessage/mailMessage.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0xf')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x10')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x11')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x12')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x13')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x14')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x15')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x16')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/smsAccount/smsAccount.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x17')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x18')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x19')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1a')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1b')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1c')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1d')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1e')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x1f')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x20')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x21')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x22')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x23')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x24')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x25')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x26')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x27')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x28')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x29')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/template/template.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x2a')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x2b')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x2c')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x2d')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x2e')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x2f')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x30')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x31')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x32')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x33')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x34')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x35')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x36')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x37')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x38')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x39')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3a')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3b')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3c')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3d')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3e')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x3f')));_0x3e8218=_['merge'](_0x3e8218,require(_0x9623('0x40')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x41')));_0x3e8218=_[_0x9623('0x3')](_0x3e8218,require(_0x9623('0x42')));var _0x336cb6=jayson[_0x9623('0x43')](_0x3e8218)[_0x9623('0x44')]();var _0x4ca805=config[_0x9623('0x45')][_0x9623('0x46')]||config[_0x9623('0x46')]+0x1;var _0x2549ae=config[_0x9623('0x45')]['ip']||_0x9623('0x47');_0x336cb6['on'](_0x9623('0x48'),function(_0x5b7661){return _0x33c083(_0x5b7661);});_0x336cb6[_0x9623('0x2')](_0x4ca805,_0x2549ae,function(){console[_0x9623('0x49')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x2549ae,_0x4ca805);require('../config/triggers')['default']();return _0x3c46e6('RPC\x20listening\x20on\x20'+_0x2549ae+':'+_0x4ca805);});});}; \ No newline at end of file +var _0x1543=['../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc'];(function(_0x5e62aa,_0x6bd14c){var _0x4c1e7b=function(_0x2ad7d6){while(--_0x2ad7d6){_0x5e62aa['push'](_0x5e62aa['shift']());}};_0x4c1e7b(++_0x6bd14c);}(_0x1543,0x1ba));var _0x3154=function(_0x23f1fa,_0x127e2c){_0x23f1fa=_0x23f1fa-0x0;var _0x4816ce=_0x1543[_0x23f1fa];return _0x4816ce;};'use strict';var jayson=require(_0x3154('0x0'));var _=require(_0x3154('0x1'));var config=require('../config/environment');exports[_0x3154('0x2')]=function(){return new Promise(function(_0x52766f,_0x4e8089){var _0x3b1993={};_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x4')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x5')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x6')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x7')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x8')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x9')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0xa')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0xb')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/memberReport/memberReport.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0xc')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0xd')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0xe')));_0x3b1993=_['merge'](_0x3b1993,require('../api/mailAccount/mailAccount.rpc'));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0xf')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x10')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/mailMessage/mailMessage.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x11')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/faxAccount/faxAccount.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x12')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x13')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x14')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/faxQueue/faxQueue.rpc'));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x15')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x16')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/smsInteraction/smsInteraction.rpc'));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x17')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x18')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x19')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x1a')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x1b')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x1c')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x1d')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x1e')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/chatMessage/chatMessage.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x1f')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x20')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x21')));_0x3b1993=_['merge'](_0x3b1993,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x22')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x23')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x24')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x25')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x26')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x27')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x28')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x29')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x2a')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x2b')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x2c')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x2d')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x2e')));_0x3b1993=_['merge'](_0x3b1993,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x2f')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x30')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x31')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x32')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/squareReport/squareReport.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x33')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x34')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/squareOdbc/squareOdbc.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x35')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x36')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/squareMessage/squareMessage.rpc'));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x37')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x38')));_0x3b1993=_['merge'](_0x3b1993,require(_0x3154('0x39')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x3a')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x3b')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x3c')));_0x3b1993=_[_0x3154('0x3')](_0x3b1993,require(_0x3154('0x3d')));var _0x30a85d=jayson[_0x3154('0x3e')](_0x3b1993)['http']();var _0x28a87a=config[_0x3154('0x3f')][_0x3154('0x40')]||config[_0x3154('0x40')]+0x1;var _0x27bf35=config['rpc']['ip']||_0x3154('0x41');_0x30a85d['on'](_0x3154('0x42'),function(_0x4eaa53){return _0x4e8089(_0x4eaa53);});_0x30a85d[_0x3154('0x2')](_0x28a87a,_0x27bf35,function(){console[_0x3154('0x43')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x27bf35,_0x28a87a);require(_0x3154('0x44'))['default']();return _0x52766f(_0x3154('0x45')+_0x27bf35+':'+_0x28a87a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4c41f80..6dfc87d 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 _0xeae4=['setTimeout','setEncoding','headers','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','function','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8'];(function(_0x2e4f96,_0x3f7d0c){var _0x548233=function(_0x213183){while(--_0x213183){_0x2e4f96['push'](_0x2e4f96['shift']());}};_0x548233(++_0x3f7d0c);}(_0xeae4,0xe8));var _0x4eae=function(_0x41e019,_0x1d1b8a){_0x41e019=_0x41e019-0x0;var _0xf1e101=_0xeae4[_0x41e019];return _0xf1e101;};'use strict';var util=require(_0x4eae('0x0'));var _=require(_0x4eae('0x1'));var EventEmitter=require(_0x4eae('0x2'))[_0x4eae('0x3')];var AGIReply=require(_0x4eae('0x4'));var AGIError=require(_0x4eae('0x5'));function AGIChannel(_0x3bf52b){var _0x1bbfec=this,_0x177aae=new AGIReply(),_0x3358d5=![],_0x4e940a={};EventEmitter[_0x4eae('0x6')](_0x1bbfec);_0x3bf52b['setEncoding'](_0x4eae('0x7'));_0x3bf52b[_0x4eae('0x8')](0x8*0x3c*0x3c*0x3e8);_0x177aae[_0x4eae('0x9')](_0x4eae('0x7'));_0x177aae['on'](_0x4eae('0xa'),function(_0x1c8370){for(var _0x4f7adc in _0x1c8370){_0x1bbfec[_0x4f7adc]=_0x1c8370[_0x4f7adc];}_0x1bbfec[_0x4eae('0xb')](_0x4eae('0xc'));});_0x177aae['on']('line',function(_0x532bf9){if(_0x532bf9['toLowerCase']()==_0x4eae('0xd')){_0x1bbfec[_0x4eae('0xb')](_0x4eae('0xd'));return;}if(_0x532bf9[_0x4eae('0xe')](0x0,0xb)==_0x4eae('0xf')){_0x3358d5=!![];}if(_0x3358d5){_0x4e940a['rx']+=_0x532bf9+'\x0a';if(_0x532bf9[_0x4eae('0x10')](_0x4eae('0x11'))!=-0x1){_0x3358d5=![];}}else{_0x4e940a['rx']=_0x532bf9;}if(_0x3358d5){return;}if(typeof _0x4e940a['cb']=='function'){var _0x47d076=_0x4e940a['rx'][_0x4eae('0xe')](0x0,0x3),_0x51f1f4=null,_0x53986f=null;_0x47d076=parseInt(_0x47d076);if(isNaN(_0x47d076)){_0x4e940a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x47d076!=0xc8){_0x4e940a['cb'](null,{'code':_0x47d076,'result':-0x1,'extra':'KO'});return;}_0x51f1f4=_0x4e940a['rx'][_0x4eae('0xe')](0x4)[_0x4eae('0x12')](_0x4eae('0x13'),'');if(_0x51f1f4[_0x4eae('0x14')]('\x20')!=-0x1){_0x51f1f4=_0x51f1f4[_0x4eae('0x15')](0x0,_0x51f1f4[_0x4eae('0x14')]('\x20'));}if(_[_0x4eae('0x16')](_0x51f1f4,'-1')){_0x51f1f4=parseInt(_0x51f1f4);}_0x53986f=_0x4e940a['rx'][_0x4eae('0x17')]('\x20');if(_0x53986f[_0x4eae('0x18')]==0x3){_0x53986f=_0x53986f[0x2]['substring'](0x1,_0x53986f[0x2]['length']-0x1);}else if(_0x53986f[_0x4eae('0x18')]>0x3){var _0x54a9d7=/\((.+)\)/;var _0x51321f=_0x4e940a['rx'][_0x4eae('0x19')](_0x54a9d7);if(_0x51321f){_0x53986f=_0x51321f[0x1];}else{_0x53986f=null;}}else{_0x53986f=null;}_0x4e940a['cb'](null,{'code':_0x47d076,'result':_0x51f1f4,'extra':_0x53986f});}});_0x3bf52b['on']('error',function(_0x83fa03){_0x1bbfec[_0x4eae('0xb')](_0x4eae('0x1a'),new AGIError(_0x4eae('0x1b'),_0x83fa03['code']));});_0x3bf52b['on'](_0x4eae('0x1c'),function(){_0x1bbfec[_0x4eae('0xb')]('close',new AGIError(_0x4eae('0x1d')));});_0x3bf52b['on']('timeout',function(){_0x1bbfec[_0x4eae('0xb')](_0x4eae('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3bf52b[_0x4eae('0x1f')]();});_0x3bf52b[_0x4eae('0x20')](_0x177aae);this[_0x4eae('0x21')]=function(_0x58e18d,_0x229266){var _0x58e18d=_0x58e18d||'',_0x229266=typeof _0x229266==_0x4eae('0x22')?_0x229266:new Function();_0x4e940a={'tx':_0x58e18d,'rx':'','cb':_0x229266};_0x3bf52b['write'](_0x58e18d+'\x0a');},this[_0x4eae('0x1c')]=function(){_0x3bf52b[_0x4eae('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x4eae('0x23')]=function(_0x3c7b07){return this[_0x4eae('0x21')][_0x4eae('0x24')](this,_0x3c7b07);};AGIChannel[_0x4eae('0x25')][_0x4eae('0x26')]=function(){return this[_0x4eae('0x23')](_0x4eae('0x27'));};AGIChannel['prototype'][_0x4eae('0x28')]=function(_0x5ca5cb,_0x307846,_0x49b32a){_0x5ca5cb=_0x5ca5cb===undefined?_0x4eae('0x29'):_0x5ca5cb;_0x307846=_0x307846===undefined?'5':_0x307846;_0x49b32a=_0x49b32a===undefined?'1':_0x49b32a;return this['sendRequest'](util[_0x4eae('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5ca5cb,_0x307846*0x3e8,_0x49b32a));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x2b')]=function(_0x352956){_0x352956=_0x352956||_0x4eae('0x2c');return this[_0x4eae('0x23')](util[_0x4eae('0x2a')](_0x4eae('0x2d'),_0x352956));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x2e')]=function(_0x10e6e5,_0x15c6d4){if(_[_0x4eae('0x2f')](_0x15c6d4)){return this[_0x4eae('0x23')](util['format'](_0x4eae('0x30'),_0x10e6e5,_0x15c6d4[_0x4eae('0x31')](',')));}return this['sendRequest'](util[_0x4eae('0x2a')](_0x4eae('0x30'),_0x10e6e5,_0x15c6d4));};AGIChannel['prototype'][_0x4eae('0x32')]=function(_0x38ea61){return this[_0x4eae('0x23')](util['format'](_0x4eae('0x33'),_0x38ea61));};AGIChannel['prototype'][_0x4eae('0x34')]=function(_0x2d7299){return this[_0x4eae('0x23')](util['format'](_0x4eae('0x35'),_0x2d7299));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x36')]=function(_0x23594d){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x23594d));};AGIChannel['prototype']['hangup']=function(){return this[_0x4eae('0x23')](_0x4eae('0x37'));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x38')]=function(_0x1bea0a,_0x3fb29b){var _0x2dd5a0=_[_0x4eae('0x39')](_0x3fb29b)||_[_0x4eae('0x3a')](_0x3fb29b)?_0x3fb29b[_0x4eae('0x3b')]():_0x3fb29b;return this['sendRequest'](util[_0x4eae('0x2a')](_0x4eae('0x3c'),_0x1bea0a,_0x2dd5a0?_0x2dd5a0[_0x4eae('0x3b')]()[_0x4eae('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x4eae('0x3d')]=function(_0x1e9973,_0x135398){return this[_0x4eae('0x23')](util['format'](_0x4eae('0x3e'),_0x1e9973,_0x135398));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x3f')]=function(_0x14dab5,_0x10d9c0){return this[_0x4eae('0x23')](util[_0x4eae('0x2a')](_0x4eae('0x40'),_0x14dab5,_0x10d9c0));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x41')]=function(_0x580427,_0x5c4ca7){return this[_0x4eae('0x23')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x580427,_0x5c4ca7));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x42')]=function(_0x621ee0,_0x2c12d5,_0x559a9c){_0x2c12d5=_0x2c12d5||this[_0x4eae('0x43')];_0x559a9c=_0x559a9c||0x1;this[_0x4eae('0x32')](_0x621ee0);this[_0x4eae('0x34')](_0x2c12d5);this[_0x4eae('0x36')](_0x559a9c);return this[_0x4eae('0x2b')](util[_0x4eae('0x2a')](_0x4eae('0x44'),_0x621ee0,_0x2c12d5,_0x559a9c));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x45')]=function(_0xf065c0){return this[_0x4eae('0x23')](util['format'](_0x4eae('0x46'),_0xf065c0));};AGIChannel['prototype'][_0x4eae('0x47')]=function(_0x4afb97,_0x3d216e,_0x2c311d,_0x354b0f,_0x5dc4c1,_0x452e1f){_0x3d216e=_0x3d216e||'wav';_0x2c311d=_0x2c311d||'';_0x354b0f=_0x354b0f===undefined?-0x1:_0x354b0f==='-1'?-0x1:_0x354b0f*0x3e8;_0x5dc4c1=_0x5dc4c1===undefined?'':'s='+_0x5dc4c1;_0x452e1f=_0x452e1f?'BEEP':'';return this['sendRequest'](util[_0x4eae('0x2a')](_0x4eae('0x48'),_0x4afb97,_0x3d216e,_0x2c311d,_0x354b0f,_0x452e1f,_0x5dc4c1));};AGIChannel[_0x4eae('0x25')]['streamFile']=function(_0x320908,_0x2dc50d){_0x2dc50d=_0x2dc50d||'';return this[_0x4eae('0x23')](util[_0x4eae('0x2a')](_0x4eae('0x49'),_0x320908,_0x2dc50d));};AGIChannel[_0x4eae('0x25')][_0x4eae('0x4a')]=function(_0x278150){return this[_0x4eae('0x2e')](_0x4eae('0x4b'),_0x278150);};AGIChannel['prototype']['wait']=function(_0x76e166){return this['exec'](_0x4eae('0x4c'),_0x76e166);};AGIChannel[_0x4eae('0x25')]['error']=function(_0x2ba96a,_0x162125){this[_0x4eae('0x2b')](util[_0x4eae('0x2a')](_0x4eae('0x4d'),_0x2ba96a['id'],_0x2ba96a[_0x4eae('0x4e')],_0x162125));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4eae('0x4f')]=AGIChannel; \ No newline at end of file +var _0x8085=['match','error','E_AGI_SOCKET_ERROR','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','close','prototype','sendRequest','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20PRIORITY\x20%s','isBoolean','toString','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','label','util','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','startsWith','split','length'];(function(_0x14cfac,_0x4eb1bf){var _0x24dfc4=function(_0x503819){while(--_0x503819){_0x14cfac['push'](_0x14cfac['shift']());}};_0x24dfc4(++_0x4eb1bf);}(_0x8085,0x71));var _0x5808=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8085[_0x4b055c];return _0x4b62bb;};'use strict';var util=require(_0x5808('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x5808('0x1')];var AGIReply=require(_0x5808('0x2'));var AGIError=require(_0x5808('0x3'));function AGIChannel(_0x2d5e17){var _0x5565fd=this,_0x55952d=new AGIReply(),_0x46a877=![],_0x32aa93={};EventEmitter['call'](_0x5565fd);_0x2d5e17[_0x5808('0x4')](_0x5808('0x5'));_0x2d5e17[_0x5808('0x6')](0x8*0x3c*0x3c*0x3e8);_0x55952d[_0x5808('0x4')](_0x5808('0x5'));_0x55952d['on'](_0x5808('0x7'),function(_0x30e63c){for(var _0xd77963 in _0x30e63c){_0x5565fd[_0xd77963]=_0x30e63c[_0xd77963];}_0x5565fd[_0x5808('0x8')](_0x5808('0x9'));});_0x55952d['on'](_0x5808('0xa'),function(_0x422c41){if(_0x422c41[_0x5808('0xb')]()==_0x5808('0xc')){_0x5565fd[_0x5808('0x8')]('hangup');return;}if(_0x422c41['substring'](0x0,0xb)==_0x5808('0xd')){_0x46a877=!![];}if(_0x46a877){_0x32aa93['rx']+=_0x422c41+'\x0a';if(_0x422c41[_0x5808('0xe')](_0x5808('0xf'))!=-0x1){_0x46a877=![];}}else{_0x32aa93['rx']=_0x422c41;}if(_0x46a877){return;}if(typeof _0x32aa93['cb']==_0x5808('0x10')){var _0xab4f46=_0x32aa93['rx']['substring'](0x0,0x3),_0x19be03=null,_0x10572d=null;_0xab4f46=parseInt(_0xab4f46);if(isNaN(_0xab4f46)){_0x32aa93['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xab4f46!=0xc8){_0x32aa93['cb'](null,{'code':_0xab4f46,'result':-0x1,'extra':'KO'});return;}_0x19be03=_0x32aa93['rx'][_0x5808('0x11')](0x4)[_0x5808('0x12')](_0x5808('0x13'),'');if(_0x19be03[_0x5808('0x14')]('\x20')!=-0x1){_0x19be03=_0x19be03[_0x5808('0x15')](0x0,_0x19be03[_0x5808('0x14')]('\x20'));}if(_[_0x5808('0x16')](_0x19be03,'-1')){_0x19be03=parseInt(_0x19be03);}_0x10572d=_0x32aa93['rx'][_0x5808('0x17')]('\x20');if(_0x10572d[_0x5808('0x18')]==0x3){_0x10572d=_0x10572d[0x2][_0x5808('0x11')](0x1,_0x10572d[0x2][_0x5808('0x18')]-0x1);}else if(_0x10572d['length']>0x3){var _0x3342ae=/\((.+)\)/;var _0x5cd687=_0x32aa93['rx'][_0x5808('0x19')](_0x3342ae);if(_0x5cd687){_0x10572d=_0x5cd687[0x1];}else{_0x10572d=null;}}else{_0x10572d=null;}_0x32aa93['cb'](null,{'code':_0xab4f46,'result':_0x19be03,'extra':_0x10572d});}});_0x2d5e17['on'](_0x5808('0x1a'),function(_0x3bf0ee){_0x5565fd['emit'](_0x5808('0x1a'),new AGIError(_0x5808('0x1b'),_0x3bf0ee['code']));});_0x2d5e17['on']('close',function(){_0x5565fd[_0x5808('0x8')]('close',new AGIError(_0x5808('0x1c')));});_0x2d5e17['on'](_0x5808('0x1d'),function(){_0x5565fd[_0x5808('0x8')](_0x5808('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2d5e17['destroy']();});_0x2d5e17[_0x5808('0x1e')](_0x55952d);this[_0x5808('0x1f')]=function(_0x2b82c5,_0x39bca3){var _0x2b82c5=_0x2b82c5||'',_0x39bca3=typeof _0x39bca3==_0x5808('0x10')?_0x39bca3:new Function();_0x32aa93={'tx':_0x2b82c5,'rx':'','cb':_0x39bca3};_0x2d5e17[_0x5808('0x20')](_0x2b82c5+'\x0a');},this[_0x5808('0x21')]=function(){_0x2d5e17['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x5808('0x22')][_0x5808('0x23')]=function(_0x5048a1){return this['command'][_0x5808('0x24')](this,_0x5048a1);};AGIChannel[_0x5808('0x22')][_0x5808('0x25')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x5808('0x22')][_0x5808('0x26')]=function(_0x27c991,_0x37a21f,_0x1da724){_0x27c991=_0x27c991===undefined?'beep':_0x27c991;_0x37a21f=_0x37a21f===undefined?'5':_0x37a21f;_0x1da724=_0x1da724===undefined?'1':_0x1da724;return this[_0x5808('0x23')](util[_0x5808('0x27')](_0x5808('0x28'),_0x27c991,_0x37a21f*0x3e8,_0x1da724));};AGIChannel[_0x5808('0x22')][_0x5808('0x29')]=function(_0x19ac63){_0x19ac63=_0x19ac63||_0x5808('0x2a');return this['sendRequest'](util['format'](_0x5808('0x2b'),_0x19ac63));};AGIChannel[_0x5808('0x22')][_0x5808('0x2c')]=function(_0x5ad84b,_0x3faa07){if(_[_0x5808('0x2d')](_0x3faa07)){return this[_0x5808('0x23')](util[_0x5808('0x27')](_0x5808('0x2e'),_0x5ad84b,_0x3faa07[_0x5808('0x2f')](',')));}return this['sendRequest'](util[_0x5808('0x27')](_0x5808('0x2e'),_0x5ad84b,_0x3faa07));};AGIChannel[_0x5808('0x22')]['setContext']=function(_0x5214c8){return this[_0x5808('0x23')](util['format'](_0x5808('0x30'),_0x5214c8));};AGIChannel[_0x5808('0x22')]['setExtension']=function(_0x3dfd9a){return this[_0x5808('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x3dfd9a));};AGIChannel[_0x5808('0x22')]['setPriority']=function(_0x103f72){return this['sendRequest'](util[_0x5808('0x27')](_0x5808('0x31'),_0x103f72));};AGIChannel[_0x5808('0x22')]['hangup']=function(){return this[_0x5808('0x23')]('HANGUP');};AGIChannel[_0x5808('0x22')]['setVariable']=function(_0x5361a5,_0x12268a){var _0x22700f=_[_0x5808('0x32')](_0x12268a)||_['isNumber'](_0x12268a)?_0x12268a['toString']():_0x12268a;return this[_0x5808('0x23')](util[_0x5808('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5361a5,_0x22700f?_0x22700f[_0x5808('0x33')]()[_0x5808('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5808('0x22')]['sayNumber']=function(_0x22b366,_0x44327d){return this[_0x5808('0x23')](util['format'](_0x5808('0x34'),_0x22b366,_0x44327d));};AGIChannel[_0x5808('0x22')]['sayDigits']=function(_0x5d4dff,_0x477278){return this['sendRequest'](util[_0x5808('0x27')](_0x5808('0x35'),_0x5d4dff,_0x477278));};AGIChannel[_0x5808('0x22')][_0x5808('0x36')]=function(_0x21fc36,_0x5300a7){return this['sendRequest'](util[_0x5808('0x27')](_0x5808('0x37'),_0x21fc36,_0x5300a7));};AGIChannel[_0x5808('0x22')]['continueAt']=function(_0xfd3b1d,_0x31d42b,_0x273c26){_0x31d42b=_0x31d42b||this[_0x5808('0x38')];_0x273c26=_0x273c26||0x1;this[_0x5808('0x39')](_0xfd3b1d);this['setExtension'](_0x31d42b);this[_0x5808('0x3a')](_0x273c26);return this[_0x5808('0x29')](util[_0x5808('0x27')]('GOTO\x20%s\x20%s\x20%s',_0xfd3b1d,_0x31d42b,_0x273c26));};AGIChannel[_0x5808('0x22')][_0x5808('0x3b')]=function(_0xc62608){return this['sendRequest'](util['format'](_0x5808('0x3c'),_0xc62608));};AGIChannel[_0x5808('0x22')][_0x5808('0x3d')]=function(_0x15c5ab,_0x2fe11d,_0x465199,_0x214032,_0x26c40c,_0x116dd4){_0x2fe11d=_0x2fe11d||_0x5808('0x3e');_0x465199=_0x465199||'';_0x214032=_0x214032===undefined?-0x1:_0x214032==='-1'?-0x1:_0x214032*0x3e8;_0x26c40c=_0x26c40c===undefined?'':'s='+_0x26c40c;_0x116dd4=_0x116dd4?_0x5808('0x3f'):'';return this[_0x5808('0x23')](util[_0x5808('0x27')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x15c5ab,_0x2fe11d,_0x465199,_0x214032,_0x116dd4,_0x26c40c));};AGIChannel['prototype'][_0x5808('0x40')]=function(_0x1cc0da,_0x437976){_0x437976=_0x437976||'';return this[_0x5808('0x23')](util[_0x5808('0x27')](_0x5808('0x41'),_0x1cc0da,_0x437976));};AGIChannel[_0x5808('0x22')]['agi']=function(_0x5cf743){return this['exec'](_0x5808('0x42'),_0x5cf743);};AGIChannel['prototype'][_0x5808('0x43')]=function(_0x507bb5){return this['exec']('WAIT',_0x507bb5);};AGIChannel[_0x5808('0x22')][_0x5808('0x1a')]=function(_0x4e27d5,_0x46c8ed){this[_0x5808('0x29')](util[_0x5808('0x27')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4e27d5['id'],_0x4e27d5[_0x5808('0x44')],_0x46c8ed));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9736541..1e1baaf 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 _0x31b0=['E_AGI_UNDEFINED','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x4a3135,_0x4a3600){var _0x1506ad=function(_0x10ee1d){while(--_0x10ee1d){_0x4a3135['push'](_0x4a3135['shift']());}};_0x1506ad(++_0x4a3600);}(_0x31b0,0xa5));var _0x031b=function(_0x24fd75,_0x3e4969){_0x24fd75=_0x24fd75-0x0;var _0x31d947=_0x31b0[_0x24fd75];return _0x31d947;};'use strict';var util=require(_0x031b('0x0'));var error={'E_AGI_UNDEFINED':_0x031b('0x1'),'E_AGI_ARGUMENT_PORT':_0x031b('0x2'),'E_AGI_SERVER_ERROR':_0x031b('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x031b('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x031b('0x5'),'E_AGI_SOCKET_ERROR':_0x031b('0x6'),'E_AGI_SOCKET_CLOSE':_0x031b('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x031b('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x031b('0x9'),'E_AGI_IVR_ENTRY':_0x031b('0xa')};function AGIError(_0x5ae30a){var _0x5ae30a=_0x5ae30a||null,_0x2a8d1c=_0x2a8d1c||[],_0x26aff9=0x1,_0x47e838='';if(!error[_0x5ae30a]){_0x5ae30a=_0x031b('0xb');}_0x2a8d1c[_0x031b('0xc')](error[_0x5ae30a]);while(arguments[_0x26aff9]){_0x2a8d1c[_0x031b('0xc')](arguments[_0x26aff9]);_0x26aff9++;}_0x47e838=util[_0x031b('0xd')][_0x031b('0xe')](util,_0x2a8d1c);this['message']=_0x47e838;this['name']=_0x5ae30a;}module[_0x031b('0xf')]=AGIError; \ No newline at end of file +var _0x2afe=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x373813,_0x507355){var _0x91dfe0=function(_0x32e54e){while(--_0x32e54e){_0x373813['push'](_0x373813['shift']());}};_0x91dfe0(++_0x507355);}(_0x2afe,0xc9));var _0xe2af=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2afe[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xe2af('0x0'));var error={'E_AGI_UNDEFINED':_0xe2af('0x1'),'E_AGI_ARGUMENT_PORT':_0xe2af('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xe2af('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xe2af('0x4'),'E_AGI_SOCKET_ERROR':_0xe2af('0x5'),'E_AGI_SOCKET_CLOSE':_0xe2af('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xe2af('0x7'),'E_AGI_COMMAND_EMPTY':_0xe2af('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe2af('0x9'),'E_AGI_IVR_ENTRY':_0xe2af('0xa')};function AGIError(_0x58b68e){var _0x58b68e=_0x58b68e||null,_0xf85432=_0xf85432||[],_0x47ead3=0x1,_0x43a0ed='';if(!error[_0x58b68e]){_0x58b68e=_0xe2af('0xb');}_0xf85432[_0xe2af('0xc')](error[_0x58b68e]);while(arguments[_0x47ead3]){_0xf85432[_0xe2af('0xc')](arguments[_0x47ead3]);_0x47ead3++;}_0x43a0ed=util['format'][_0xe2af('0xd')](util,_0xf85432);this[_0xe2af('0xe')]=_0x43a0ed;this[_0xe2af('0xf')]=_0x58b68e;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ddcbd0c..20ad77d 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 _0x7505=['addVertex','prototype','push','size','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','menu','invalid','agicommand','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges'];(function(_0x680fa6,_0x1b2622){var _0x5d514e=function(_0x397c3c){while(--_0x397c3c){_0x680fa6['push'](_0x680fa6['shift']());}};_0x5d514e(++_0x1b2622);}(_0x7505,0x1cc));var _0x5750=function(_0x43827b,_0x58be33){_0x43827b=_0x43827b-0x0;var _0x4599f0=_0x7505[_0x43827b];return _0x4599f0;};'use strict';var _=require(_0x5750('0x0'));var logger=require(_0x5750('0x1'))(_0x5750('0x2'));var verticesWithRetry=['menu',_0x5750('0x3'),_0x5750('0x4')];var Graph=function(){this[_0x5750('0x5')]={};this[_0x5750('0x6')]={};this[_0x5750('0x7')]=0x0;};Graph['prototype'][_0x5750('0x8')]=function(_0x539c55){this[_0x5750('0x5')][_0x539c55['id']]=_0x539c55;this['edges'][_0x539c55['id']]=[];};Graph[_0x5750('0x9')]['addEdge']=function(_0x53bbaf,_0x1301e0,_0x1a80e7){this['edges'][_0x53bbaf][_0x5750('0xa')]({'target':_0x1301e0,'condition':_0x1a80e7});this[_0x5750('0x7')]+=0x1;};Graph[_0x5750('0x9')][_0x5750('0xb')]=function(){return _[_0x5750('0xb')](this[_0x5750('0x5')]);};Graph[_0x5750('0x9')]['relations']=function(){return this[_0x5750('0x7')];};Graph['prototype']['getVertex']=function(_0x441093){return this['vertices'][_0x441093];};Graph[_0x5750('0x9')][_0x5750('0xc')]=function(_0x4b94c8,_0x180970){if(!this[_0x5750('0x5')][_0x4b94c8]){return logger[_0x5750('0xd')]('no\x20vertex\x20found');}var _0x45f479=_0x180970(this[_0x5750('0x5')][_0x4b94c8]);if(!_0x45f479){return logger['info'](_0x5750('0xe'));}if(this['edges'][_0x4b94c8][_0x5750('0xf')]===0x0){return logger['info'](_0x5750('0x10'));}for(var _0x2a8128=0x0,_0x34a767=[],_0x43edc4=![];_0x2a8128\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','./rpc','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','calleridname','callerid','evtHangup','toJson','root','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','sync','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result'];(function(_0x1bf446,_0x2a92e1){var _0x67eecd=function(_0x2dc476){while(--_0x2dc476){_0x1bf446['push'](_0x1bf446['shift']());}};_0x67eecd(++_0x2a92e1);}(_0x816e,0x1db));var _0xe816=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x816e[_0x209941];return _0x1e8729;};'use strict';var parser=require(_0xe816('0x0'));var _=require('lodash');var syncho=require(_0xe816('0x1'));var util=require(_0xe816('0x2'));var moment=require(_0xe816('0x3'));var config=require(_0xe816('0x4'));var logger=require(_0xe816('0x5'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0xe816('0x6'));var mailRpc=require(_0xe816('0x7'));var Graph=require(_0xe816('0x8'));var Vertices=require(_0xe816('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xe816('0xa')]=_[_0xe816('0xb')](config['agi'],{'ip':_0xe816('0xc'),'port':0x11dd});function connectionHandler(_0x39f5cb){process[_0xe816('0xd')](function(){syncho(function(){try{setChannelVariables(_0x39f5cb);agiHandler(_0x39f5cb);}catch(_0x2e9495){logger[_0xe816('0xe')](_0x2e9495[_0xe816('0xf')]);}});});}function listeningHandler(){console['log'](_0xe816('0x10'),config[_0xe816('0xa')][_0xe816('0x11')]);logger[_0xe816('0x12')](util[_0xe816('0x13')](_0xe816('0x14'),config[_0xe816('0xa')]['ip'],config[_0xe816('0xa')]['port']));}function errorHandler(_0x3b609a){if(_0x3b609a&&_0x3b609a[_0xe816('0x15')]&&_0x3b609a[_0xe816('0x16')]){logger[_0xe816('0xe')](util[_0xe816('0x13')](_0xe816('0x17'),_0x3b609a[_0xe816('0x15')],_0x3b609a[_0xe816('0x16')]));}else{logger[_0xe816('0xe')](util[_0xe816('0x13')](_0xe816('0x18'),_0x3b609a[_0xe816('0xf')]));}}function closeHandler(){logger[_0xe816('0x12')](util[_0xe816('0x13')](_0xe816('0x19'),this[_0xe816('0x1a')],this['calleridname'],this['callerid'],this[_0xe816('0x1b')],this[_0xe816('0x1c')]));try{createSquareReport(this);}catch(_0x8c6ce7){logger['error'](_0x8c6ce7[_0xe816('0xf')]);}}function timeoutHandler(){logger[_0xe816('0x12')](util[_0xe816('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xe816('0x1a')],this[_0xe816('0x1d')],this['callerid'],this[_0xe816('0x1b')],this[_0xe816('0x1c')]));}function hangupHandler(){logger[_0xe816('0x12')](util[_0xe816('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xe816('0x1a')],this[_0xe816('0x1d')],this[_0xe816('0x1e')],this[_0xe816('0x1b')],this[_0xe816('0x1c')]));this[_0xe816('0x1f')]=!![];}function getRoot(_0x143566){return parser[_0xe816('0x20')](_0x143566,{'object':!![]})['mxGraphModel'][_0xe816('0x21')];}function addVertex(_0x3661ed,_0x9484cc,_0x461271){_0x9484cc['agicommand']=_0x461271;if(_0x9484cc[_0xe816('0x22')](_0xe816('0x23'))){_0x9484cc[_0xe816('0x24')]=parseInt(_0x9484cc[_0xe816('0x23')],0xa);}_0x3661ed[_0xe816('0x25')](_[_0xe816('0x26')](_0x9484cc,_0xe816('0x27')));}function initGraph(_0x3998e1,_0x5b3369){var _0x2512dd=new Graph();for(var _0x2a1755 in _0x3998e1){if(_0x3998e1[_0xe816('0x22')](_0x2a1755)){if(_['isArray'](_0x3998e1[_0x2a1755])){for(var _0x11b19d=0x0;_0x11b19d<_0x3998e1[_0x2a1755][_0xe816('0x28')];_0x11b19d+=0x1){addVertex(_0x2512dd,_0x3998e1[_0x2a1755][_0x11b19d],_0x2a1755);}}else{addVertex(_0x2512dd,_0x3998e1[_0x2a1755],_0x2a1755);}}}for(var _0x4a7458=0x0;_0x4a7458<_0x5b3369[_0xe816('0x28')];_0x4a7458+=0x1){if(_0x5b3369[_0x4a7458]['source']&&_0x5b3369[_0x4a7458]['target']){_0x2512dd['addEdge'](_0x5b3369[_0x4a7458][_0xe816('0x29')],_0x5b3369[_0x4a7458][_0xe816('0x2a')],_0x5b3369[_0x4a7458]['value']);}}return _0x2512dd;}function getSquareProject(_0x23d78b,_0x439405){rpc[_0xe816('0x2b')](_0x23d78b)[_0xe816('0x2c')](function(_0x350ab2){_0x439405(null,_0x350ab2);})['catch'](function(_0x5abcb3){_0x439405(null,_0x5abcb3);});}function createSquareReport(_0x178ffe,_0x9ad71f){rpc[_0xe816('0x2d')](_0x178ffe)[_0xe816('0x2c')](function(_0xd919e2){if(_0x9ad71f){_0x9ad71f(null,_0xd919e2);}})[_0xe816('0x2e')](function(_0x502bad){if(_0x9ad71f){_0x9ad71f(null,_0x502bad);}});}function setChannelVariables(_0xa7c286){for(var _0x278324 in _0xa7c286){if(_0xa7c286[_0xe816('0x22')](_0x278324)){if(_0x278324[_0xe816('0x2f')](_0xe816('0x30'))===0x0){_0xa7c286[_0x278324[_0xe816('0x31')](0x4)]=_0xa7c286[_0x278324];delete _0xa7c286[_0x278324];}}}}function getLogFromObject(_0x463e38){return util[_0xe816('0x32')](_0x463e38,{'showHidden':![],'depth':null});}function agiHandler(_0x4b3813){var _0x28c1a8,_0x188cdb,_0x255a09,_0x2b25e5,_0x1f369c;logger[_0xe816('0x33')]('variables',JSON[_0xe816('0x34')](_0x4b3813,null,0x2));logger[_0xe816('0x12')](util[_0xe816('0x13')](_0xe816('0x35'),_0x4b3813[_0xe816('0x1a')],_0x4b3813['calleridname'],_0x4b3813[_0xe816('0x1e')],_0x4b3813[_0xe816('0x1b')],_0x4b3813[_0xe816('0x1c')]));_0x4b3813['on'](_0xe816('0xe'),errorHandler);_0x4b3813['on'](_0xe816('0x36'),closeHandler);_0x4b3813['on']('timeout',timeoutHandler);_0x4b3813[_0xe816('0x1f')]=![];_0x4b3813['on']('hangup',hangupHandler);var _0x4a469e=getSquareProject[_0xe816('0x37')](null,_0x4b3813[_0xe816('0x1a')]);if(_0x4a469e){if(_0x4a469e['production']){_0x28c1a8=getRoot(_0x4a469e['production']);if(_0x28c1a8&&_0x28c1a8[_0xe816('0x38')]){logger[_0xe816('0x33')]('root',JSON['stringify'](_0x28c1a8,null,0x2));_0x4b3813[_0xe816('0x39')]=moment()[_0xe816('0x13')](_0xe816('0x3a'));_0x188cdb=initGraph(_['omit'](_0x28c1a8,'mxCell'),_0x28c1a8[_0xe816('0x27')]);_0x255a09=new Vertices(_0x4b3813,rpc,mailRpc);logger[_0xe816('0x12')](util[_0xe816('0x13')](_0xe816('0x3b'),_0x4b3813[_0xe816('0x1a')],_0x4b3813['calleridname'],_0x4b3813[_0xe816('0x1e')],_0x4b3813[_0xe816('0x1b')],_0x4b3813[_0xe816('0x1c')]));_0x188cdb[_0xe816('0x3c')](_0x28c1a8[_0xe816('0x38')]['id'],function(_0xa1e8a9){try{_0xa1e8a9=_0x255a09[_0xe816('0x3d')](_0xa1e8a9);logger['debug'](_0xe816('0x3e'),JSON[_0xe816('0x34')](_0xa1e8a9,null,0x2));if(_0xa1e8a9[_0xe816('0x3f')]===_0xe816('0x40')){logger[_0xe816('0x12')](_0xe816('0x41'));_0x4b3813[_0xe816('0x42')]=_0xa1e8a9[_0xe816('0x42')]||_0x4b3813[_0xe816('0x42')];_0x4b3813['extension']=_0xa1e8a9[_0xe816('0x43')];_0x4b3813['priority']=_0xa1e8a9[_0xe816('0x44')]?_0xa1e8a9['priority']-0x1:0x1;return null;}else if(_0xa1e8a9&&_0x255a09[_0xa1e8a9['agicommand']]){_0x1f369c=_0x255a09[_0xa1e8a9[_0xe816('0x3f')]](_0xa1e8a9);logger[_0xe816('0x12')](_0xe816('0x45'),JSON[_0xe816('0x34')](_0x1f369c,null,0x2));if(_0x1f369c&&_0x1f369c['code']===AGI_CODE_SUCCESS&&_0x1f369c[_0xe816('0x46')]!==AGI_RESULT_ERROR&&!_0x4b3813[_0xe816('0x1f')]){logger[_0xe816('0x33')](_0xe816('0x45'),getLogFromObject(_0x1f369c));return _[_0xe816('0x47')](_0x1f369c[_0xe816('0x46')])?null:_0x1f369c[_0xe816('0x46')][_0xe816('0x48')]();}else{logger[_0xe816('0xe')](_0xe816('0x45'),getLogFromObject(_0x1f369c));return null;}}else{logger[_0xe816('0xe')](_0xe816('0x49'));return null;}}catch(_0x15e284){logger[_0xe816('0xe')](_0x15e284['stack']);return null;}});if(_0x28c1a8[_0xe816('0x4a')]){logger[_0xe816('0x12')](util['format'](_0xe816('0x4b'),_0x4b3813['arg_1'],_0x4b3813[_0xe816('0x1d')],_0x4b3813[_0xe816('0x1e')],_0x4b3813['dnid'],_0x4b3813[_0xe816('0x1c')]));_0x188cdb[_0xe816('0x3c')](_0x28c1a8[_0xe816('0x4a')]['id'],function(_0x3741e6){try{_0x3741e6=_0x255a09[_0xe816('0x3d')](_0x3741e6);logger[_0xe816('0x33')]('vertex',JSON[_0xe816('0x34')](_0x3741e6,null,0x2));if(_0x3741e6&&_0x255a09[_0x3741e6[_0xe816('0x3f')]]){_0x1f369c=_0x255a09[_0x3741e6[_0xe816('0x3f')]](_0x3741e6);if(_0x1f369c){logger['debug']('response',getLogFromObject(_0x1f369c));return _[_0xe816('0x47')](_0x1f369c[_0xe816('0x46')])?null:_0x1f369c[_0xe816('0x46')]['toString']();}else{logger[_0xe816('0xe')]('response',getLogFromObject(_0x1f369c));return null;}}else{logger[_0xe816('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x41fc98){logger['error'](_0x41fc98[_0xe816('0xf')]);return null;}});}logger[_0xe816('0x12')](util['format'](_0xe816('0x4c'),_0x4b3813[_0xe816('0x1a')],_0x4b3813['calleridname'],_0x4b3813['callerid'],_0x4b3813[_0xe816('0x1b')],_0x4b3813[_0xe816('0x1c')]));logger[_0xe816('0x12')](util[_0xe816('0x13')](_0xe816('0x4d'),_0x4b3813[_0xe816('0x42')],_0x4b3813[_0xe816('0x43')],parseInt(_0x4b3813[_0xe816('0x44')],0xa)+0x1));_0x4b3813[_0xe816('0x4e')](_0x4b3813[_0xe816('0x42')],_0x4b3813[_0xe816('0x43')],parseInt(_0x4b3813[_0xe816('0x44')],0xa)+0x1);_0x4b3813[_0xe816('0x36')]();}}else{logger[_0xe816('0xe')](util[_0xe816('0x13')](_0xe816('0x4f'),_0x4b3813[_0xe816('0x1a')]));_0x4b3813[_0xe816('0x4e')](_0x4b3813['context'],_0x4b3813[_0xe816('0x43')],parseInt(_0x4b3813[_0xe816('0x44')],0xa)+0x1);_0x4b3813[_0xe816('0x36')]();}}else{logger['error'](util['format'](_0xe816('0x50'),_0x4b3813[_0xe816('0x1a')]));_0x4b3813['continueAt'](_0x4b3813['context'],_0x4b3813['extension'],parseInt(_0x4b3813['priority'],0xa)+0x1);_0x4b3813['close']();}}function main(){var _0x2e8ef6;return utilLicense[_0xe816('0x51')]()[_0xe816('0x2c')](function(_0x2b7721){if(_0x2b7721){if(_0x2b7721[_0xe816('0x52')]){if(_0x2b7721[_0xe816('0x53')]&&_0x2b7721['callysquare']>0x0){logger['info'](util[_0xe816('0x13')](_0xe816('0x54'),_0x2b7721[_0xe816('0x53')]));_0x2e8ef6=_0x2b7721['callysquare'];}else{logger['info'](_0xe816('0x55'));}}else{logger[_0xe816('0x12')](_0xe816('0x56'));_0x2e8ef6=-0x1;}}})[_0xe816('0x2e')](function(_0x1ad5a3){logger[_0xe816('0xe')](_0xe816('0x57'),_0x1ad5a3[_0xe816('0xf')]);})[_0xe816('0x4a')](function(){var _0x58e2de=require(_0xe816('0x58'))(config[_0xe816('0xa')][_0xe816('0x11')],config['agi']['ip'],_0x2e8ef6);_0x58e2de['on']('error',errorHandler);_0x58e2de['on'](_0xe816('0x59'),listeningHandler);_0x58e2de['on'](_0xe816('0x5a'),connectionHandler);_0x58e2de['on'](_0xe816('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x7cce=['xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','[ERROR]\x20%s','stack','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','omit','mxCell','isArray','length','source','target','addEdge','then','catch','createSquareReport','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20found','continueAt','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x7cce,0xb2));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0xe7cc('0x0'));var _=require(_0xe7cc('0x1'));var syncho=require(_0xe7cc('0x2'));var util=require(_0xe7cc('0x3'));var moment=require('moment');var config=require(_0xe7cc('0x4'));var logger=require(_0xe7cc('0x5'))(_0xe7cc('0x6'));var utilLicense=require(_0xe7cc('0x7'));var rpc=require('./rpc');var mailRpc=require(_0xe7cc('0x8'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xe7cc('0x6')]=_['defaults'](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x506497){process[_0xe7cc('0x9')](function(){syncho(function(){try{setChannelVariables(_0x506497);agiHandler(_0x506497);}catch(_0x163582){logger['error'](_0x163582['stack']);}});});}function listeningHandler(){console[_0xe7cc('0xa')](_0xe7cc('0xb'),config[_0xe7cc('0x6')][_0xe7cc('0xc')]);logger[_0xe7cc('0xd')](util[_0xe7cc('0xe')](_0xe7cc('0xf'),config[_0xe7cc('0x6')]['ip'],config['agi']['port']));}function errorHandler(_0x163a1b){if(_0x163a1b&&_0x163a1b[_0xe7cc('0x10')]&&_0x163a1b[_0xe7cc('0x11')]){logger[_0xe7cc('0x12')](util['format'](_0xe7cc('0x13'),_0x163a1b[_0xe7cc('0x10')],_0x163a1b[_0xe7cc('0x11')]));}else{logger[_0xe7cc('0x12')](util[_0xe7cc('0xe')](_0xe7cc('0x14'),_0x163a1b[_0xe7cc('0x15')]));}}function closeHandler(){logger[_0xe7cc('0xd')](util[_0xe7cc('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0xe7cc('0x16')],this[_0xe7cc('0x17')]));try{createSquareReport(this);}catch(_0x19bdf1){logger['error'](_0x19bdf1[_0xe7cc('0x15')]);}}function timeoutHandler(){logger[_0xe7cc('0xd')](util[_0xe7cc('0xe')](_0xe7cc('0x18'),this['arg_1'],this['calleridname'],this[_0xe7cc('0x19')],this[_0xe7cc('0x16')],this['uniqueid']));}function hangupHandler(){logger['info'](util['format'](_0xe7cc('0x1a'),this[_0xe7cc('0x1b')],this[_0xe7cc('0x1c')],this['callerid'],this[_0xe7cc('0x16')],this[_0xe7cc('0x17')]));this[_0xe7cc('0x1d')]=!![];}function getRoot(_0x134a12){return parser[_0xe7cc('0x1e')](_0x134a12,{'object':!![]})[_0xe7cc('0x1f')][_0xe7cc('0x20')];}function addVertex(_0x49edb3,_0xc68e51,_0x9231f0){_0xc68e51[_0xe7cc('0x21')]=_0x9231f0;if(_0xc68e51[_0xe7cc('0x22')](_0xe7cc('0x23'))){_0xc68e51['maxRetry']=parseInt(_0xc68e51[_0xe7cc('0x23')],0xa);}_0x49edb3['addVertex'](_[_0xe7cc('0x24')](_0xc68e51,_0xe7cc('0x25')));}function initGraph(_0x184058,_0x2d1059){var _0x2b89c0=new Graph();for(var _0x16eec0 in _0x184058){if(_0x184058['hasOwnProperty'](_0x16eec0)){if(_[_0xe7cc('0x26')](_0x184058[_0x16eec0])){for(var _0x36b884=0x0;_0x36b884<_0x184058[_0x16eec0][_0xe7cc('0x27')];_0x36b884+=0x1){addVertex(_0x2b89c0,_0x184058[_0x16eec0][_0x36b884],_0x16eec0);}}else{addVertex(_0x2b89c0,_0x184058[_0x16eec0],_0x16eec0);}}}for(var _0x35753e=0x0;_0x35753e<_0x2d1059[_0xe7cc('0x27')];_0x35753e+=0x1){if(_0x2d1059[_0x35753e][_0xe7cc('0x28')]&&_0x2d1059[_0x35753e][_0xe7cc('0x29')]){_0x2b89c0[_0xe7cc('0x2a')](_0x2d1059[_0x35753e]['source'],_0x2d1059[_0x35753e][_0xe7cc('0x29')],_0x2d1059[_0x35753e]['value']);}}return _0x2b89c0;}function getSquareProject(_0x20e508,_0xcfc2ef){rpc['getSquareProject'](_0x20e508)[_0xe7cc('0x2b')](function(_0x54a0a1){_0xcfc2ef(null,_0x54a0a1);})[_0xe7cc('0x2c')](function(_0x2b826f){_0xcfc2ef(null,_0x2b826f);});}function createSquareReport(_0x3bfa93,_0x1b7081){rpc[_0xe7cc('0x2d')](_0x3bfa93)['then'](function(_0x1a342f){if(_0x1b7081){_0x1b7081(null,_0x1a342f);}})[_0xe7cc('0x2c')](function(_0x47e8f4){if(_0x1b7081){_0x1b7081(null,_0x47e8f4);}});}function setChannelVariables(_0x4d4316){for(var _0x130e63 in _0x4d4316){if(_0x4d4316[_0xe7cc('0x22')](_0x130e63)){if(_0x130e63[_0xe7cc('0x2e')](_0xe7cc('0x2f'))===0x0){_0x4d4316[_0x130e63[_0xe7cc('0x30')](0x4)]=_0x4d4316[_0x130e63];delete _0x4d4316[_0x130e63];}}}}function getLogFromObject(_0x18787d){return util['inspect'](_0x18787d,{'showHidden':![],'depth':null});}function agiHandler(_0x6ec00f){var _0x15fe9b,_0x142f0f,_0x124dfa,_0x59334f,_0x419722;logger['debug'](_0xe7cc('0x31'),JSON[_0xe7cc('0x32')](_0x6ec00f,null,0x2));logger['info'](util[_0xe7cc('0xe')](_0xe7cc('0x33'),_0x6ec00f[_0xe7cc('0x1b')],_0x6ec00f[_0xe7cc('0x1c')],_0x6ec00f[_0xe7cc('0x19')],_0x6ec00f[_0xe7cc('0x16')],_0x6ec00f['uniqueid']));_0x6ec00f['on'](_0xe7cc('0x12'),errorHandler);_0x6ec00f['on'](_0xe7cc('0x34'),closeHandler);_0x6ec00f['on'](_0xe7cc('0x35'),timeoutHandler);_0x6ec00f[_0xe7cc('0x1d')]=![];_0x6ec00f['on'](_0xe7cc('0x36'),hangupHandler);var _0x35de79=getSquareProject[_0xe7cc('0x37')](null,_0x6ec00f['arg_1']);if(_0x35de79){if(_0x35de79[_0xe7cc('0x38')]){_0x15fe9b=getRoot(_0x35de79[_0xe7cc('0x38')]);if(_0x15fe9b&&_0x15fe9b[_0xe7cc('0x39')]){logger[_0xe7cc('0x3a')]('root',JSON['stringify'](_0x15fe9b,null,0x2));_0x6ec00f[_0xe7cc('0x3b')]=moment()[_0xe7cc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x142f0f=initGraph(_['omit'](_0x15fe9b,_0xe7cc('0x25')),_0x15fe9b['mxCell']);_0x124dfa=new Vertices(_0x6ec00f,rpc,mailRpc);logger[_0xe7cc('0xd')](util[_0xe7cc('0xe')](_0xe7cc('0x3c'),_0x6ec00f[_0xe7cc('0x1b')],_0x6ec00f['calleridname'],_0x6ec00f[_0xe7cc('0x19')],_0x6ec00f[_0xe7cc('0x16')],_0x6ec00f[_0xe7cc('0x17')]));_0x142f0f[_0xe7cc('0x3d')](_0x15fe9b[_0xe7cc('0x39')]['id'],function(_0x18bbe8){try{_0x18bbe8=_0x124dfa[_0xe7cc('0x3e')](_0x18bbe8);logger[_0xe7cc('0x3a')]('vertex',JSON['stringify'](_0x18bbe8,null,0x2));if(_0x18bbe8['agicommand']===_0xe7cc('0x3f')){logger[_0xe7cc('0xd')](_0xe7cc('0x40'));_0x6ec00f[_0xe7cc('0x41')]=_0x18bbe8[_0xe7cc('0x41')]||_0x6ec00f[_0xe7cc('0x41')];_0x6ec00f[_0xe7cc('0x42')]=_0x18bbe8[_0xe7cc('0x42')];_0x6ec00f['priority']=_0x18bbe8['priority']?_0x18bbe8[_0xe7cc('0x43')]-0x1:0x1;return null;}else if(_0x18bbe8&&_0x124dfa[_0x18bbe8[_0xe7cc('0x21')]]){_0x419722=_0x124dfa[_0x18bbe8[_0xe7cc('0x21')]](_0x18bbe8);logger[_0xe7cc('0xd')]('response',JSON[_0xe7cc('0x32')](_0x419722,null,0x2));if(_0x419722&&_0x419722['code']===AGI_CODE_SUCCESS&&_0x419722[_0xe7cc('0x44')]!==AGI_RESULT_ERROR&&!_0x6ec00f['evtHangup']){logger['debug'](_0xe7cc('0x45'),getLogFromObject(_0x419722));return _[_0xe7cc('0x46')](_0x419722[_0xe7cc('0x44')])?null:_0x419722['result']['toString']();}else{logger[_0xe7cc('0x12')](_0xe7cc('0x45'),getLogFromObject(_0x419722));return null;}}else{logger[_0xe7cc('0x12')](_0xe7cc('0x47'));return null;}}catch(_0x446c82){logger['error'](_0x446c82[_0xe7cc('0x15')]);return null;}});if(_0x15fe9b[_0xe7cc('0x48')]){logger['info'](util['format'](_0xe7cc('0x49'),_0x6ec00f[_0xe7cc('0x1b')],_0x6ec00f['calleridname'],_0x6ec00f[_0xe7cc('0x19')],_0x6ec00f[_0xe7cc('0x16')],_0x6ec00f[_0xe7cc('0x17')]));_0x142f0f[_0xe7cc('0x3d')](_0x15fe9b[_0xe7cc('0x48')]['id'],function(_0x5aca27){try{_0x5aca27=_0x124dfa[_0xe7cc('0x3e')](_0x5aca27);logger[_0xe7cc('0x3a')](_0xe7cc('0x4a'),JSON[_0xe7cc('0x32')](_0x5aca27,null,0x2));if(_0x5aca27&&_0x124dfa[_0x5aca27[_0xe7cc('0x21')]]){_0x419722=_0x124dfa[_0x5aca27['agicommand']](_0x5aca27);if(_0x419722){logger[_0xe7cc('0x3a')](_0xe7cc('0x45'),getLogFromObject(_0x419722));return _[_0xe7cc('0x46')](_0x419722[_0xe7cc('0x44')])?null:_0x419722[_0xe7cc('0x44')][_0xe7cc('0x4b')]();}else{logger[_0xe7cc('0x12')]('response',getLogFromObject(_0x419722));return null;}}else{logger['error'](_0xe7cc('0x47'));return null;}}catch(_0x890014){logger[_0xe7cc('0x12')](_0x890014[_0xe7cc('0x15')]);return null;}});}logger['info'](util[_0xe7cc('0xe')](_0xe7cc('0x4c'),_0x6ec00f[_0xe7cc('0x1b')],_0x6ec00f[_0xe7cc('0x1c')],_0x6ec00f[_0xe7cc('0x19')],_0x6ec00f[_0xe7cc('0x16')],_0x6ec00f[_0xe7cc('0x17')]));logger[_0xe7cc('0xd')](util[_0xe7cc('0xe')](_0xe7cc('0x4d'),_0x6ec00f[_0xe7cc('0x41')],_0x6ec00f[_0xe7cc('0x42')],parseInt(_0x6ec00f['priority'],0xa)+0x1));_0x6ec00f['continueAt'](_0x6ec00f[_0xe7cc('0x41')],_0x6ec00f[_0xe7cc('0x42')],parseInt(_0x6ec00f[_0xe7cc('0x43')],0xa)+0x1);_0x6ec00f[_0xe7cc('0x34')]();}}else{logger[_0xe7cc('0x12')](util['format']('Project\x20%s\x20not\x20published',_0x6ec00f[_0xe7cc('0x1b')]));_0x6ec00f['continueAt'](_0x6ec00f[_0xe7cc('0x41')],_0x6ec00f[_0xe7cc('0x42')],parseInt(_0x6ec00f[_0xe7cc('0x43')],0xa)+0x1);_0x6ec00f[_0xe7cc('0x34')]();}}else{logger[_0xe7cc('0x12')](util[_0xe7cc('0xe')](_0xe7cc('0x4e'),_0x6ec00f[_0xe7cc('0x1b')]));_0x6ec00f[_0xe7cc('0x4f')](_0x6ec00f[_0xe7cc('0x41')],_0x6ec00f[_0xe7cc('0x42')],parseInt(_0x6ec00f['priority'],0xa)+0x1);_0x6ec00f[_0xe7cc('0x34')]();}}function main(){var _0x4d1048;return utilLicense[_0xe7cc('0x50')]()[_0xe7cc('0x2b')](function(_0x3e141e){if(_0x3e141e){if(_0x3e141e['voice']){if(_0x3e141e[_0xe7cc('0x51')]&&_0x3e141e[_0xe7cc('0x51')]>0x0){logger['info'](util[_0xe7cc('0xe')](_0xe7cc('0x52'),_0x3e141e[_0xe7cc('0x51')]));_0x4d1048=_0x3e141e['callysquare'];}else{logger['info'](_0xe7cc('0x53'));}}else{logger[_0xe7cc('0xd')](_0xe7cc('0x54'));_0x4d1048=-0x1;}}})[_0xe7cc('0x2c')](function(_0x642ee5){logger['error'](_0xe7cc('0x55'),_0x642ee5[_0xe7cc('0x15')]);})['finally'](function(){var _0x36b7d8=require(_0xe7cc('0x56'))(config['agi'][_0xe7cc('0xc')],config[_0xe7cc('0x6')]['ip'],_0x4d1048);_0x36b7d8['on'](_0xe7cc('0x12'),errorHandler);_0x36b7d8['on'](_0xe7cc('0x57'),listeningHandler);_0x36b7d8['on'](_0xe7cc('0x58'),connectionHandler);_0x36b7d8['on'](_0xe7cc('0x34'),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 770af1d..b2b7810 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 _0x5170=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5170,0x1a7));var _0x0517=function(_0x54377b,_0x2f06e5){_0x54377b=_0x54377b-0x0;var _0x35ec2a=_0x5170[_0x54377b];return _0x35ec2a;};'use strict';var BPromise=require(_0x0517('0x0'));var jayson=require(_0x0517('0x1'));var client=jayson[_0x0517('0x2')][_0x0517('0x3')]({'port':0x232b});function request(_0x3801ea,_0x5d4fe0){return new BPromise(function(_0x540341,_0x20c920){return client[_0x0517('0x4')](_0x3801ea,_0x5d4fe0)[_0x0517('0x5')](function(_0x353d4b){if(_0x353d4b[_0x0517('0x6')]){return _0x20c920(_0x353d4b[_0x0517('0x6')][_0x0517('0x7')]);}else{return _0x540341(_0x353d4b[_0x0517('0x8')]);}})[_0x0517('0x9')](function(_0x256f18){return _0x20c920(_0x256f18);});});}exports[_0x0517('0xa')]=function(_0x47c9ab,_0x302d0f){return request(_0x0517('0xb'),{'account':_0x47c9ab,'message':_0x302d0f});}; \ No newline at end of file +var _0xf5fc=['message','result','sendMailMessage','SendMail','bluebird','http','request','then','error'];(function(_0xa2287b,_0x4bca6a){var _0x16153a=function(_0x33f32b){while(--_0x33f32b){_0xa2287b['push'](_0xa2287b['shift']());}};_0x16153a(++_0x4bca6a);}(_0xf5fc,0x17e));var _0xcf5f=function(_0x9f47cf,_0x2da62c){_0x9f47cf=_0x9f47cf-0x0;var _0xe0f94c=_0xf5fc[_0x9f47cf];return _0xe0f94c;};'use strict';var BPromise=require(_0xcf5f('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf5f('0x1')]({'port':0x232b});function request(_0x44db10,_0x28fff8){return new BPromise(function(_0x33fa31,_0x14bb34){return client[_0xcf5f('0x2')](_0x44db10,_0x28fff8)[_0xcf5f('0x3')](function(_0x1749d9){if(_0x1749d9[_0xcf5f('0x4')]){return _0x14bb34(_0x1749d9[_0xcf5f('0x4')][_0xcf5f('0x5')]);}else{return _0x33fa31(_0x1749d9[_0xcf5f('0x6')]);}})['catch'](function(_0x4474df){return _0x14bb34(_0x4474df);});});}exports[_0xcf5f('0x7')]=function(_0xcf41cb,_0x5005a5){return request(_0xcf5f('0x8'),{'account':_0xcf41cb,'message':_0x5005a5});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 4db16a2..0032900 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 _0x75b0=['call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','emit','line','exports','stream','Transform'];(function(_0x280d3c,_0x54f132){var _0x81dbab=function(_0x23ee60){while(--_0x23ee60){_0x280d3c['push'](_0x280d3c['shift']());}};_0x81dbab(++_0x54f132);}(_0x75b0,0xe8));var _0x075b=function(_0x34c56f,_0x599298){_0x34c56f=_0x34c56f-0x0;var _0x20d25c=_0x75b0[_0x34c56f];return _0x20d25c;};'use strict';var util=require('util');var Transform=require(_0x075b('0x0'))[_0x075b('0x1')];function AGIReply(_0x4d03ad){Transform[_0x075b('0x2')](this,_0x4d03ad);this[_0x075b('0x3')]='';this[_0x075b('0x4')]=![];}util[_0x075b('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x075b('0x6')]=function(_0x17914d,_0x1637d8,_0x5b1f91){var _0x575dbd='\x0a',_0x44eac1=['\x0a\x0a',_0x075b('0x7')],_0x521bbe=-0x1,_0x130b10=-0x1,_0x2febc9='',_0x60df11=0x0,_0x91a69b='',_0x3f3068='';this[_0x075b('0x3')]+=_0x17914d[_0x075b('0x8')]();_0x91a69b=this[_0x075b('0x3')];if(!this[_0x075b('0x4')]){_0x60df11=0x0;while(_0x44eac1[_0x60df11]){while((_0x130b10=_0x91a69b['indexOf'](_0x44eac1[_0x60df11]))!=-0x1){_0x2febc9=_0x44eac1[_0x60df11];_0x3f3068=_0x91a69b['substring'](0x0,_0x130b10);_0x91a69b=_0x91a69b[_0x075b('0x9')](_0x130b10+_0x2febc9[_0x075b('0xa')]);var _0x4057cf=_0x3f3068[_0x075b('0xb')](_0x575dbd),_0x4d48fd=0x0,_0x4ace4e={},_0x4ba02c='',_0xe320bc='',_0x59738e=-0x1;while(_0x4057cf[_0x4d48fd]){_0x59738e=_0x4057cf[_0x4d48fd][_0x075b('0xc')](':');if(_0x59738e!=-0x1){_0x4ba02c=_0x4057cf[_0x4d48fd][_0x075b('0xd')](0x0,_0x59738e)['trim']();_0xe320bc=_0x4057cf[_0x4d48fd][_0x075b('0xd')](_0x59738e+0x1)[_0x075b('0xe')]();if(_0x4ba02c[_0x075b('0xa')]>0x0){_0x4ace4e[_0x4ba02c]=_0xe320bc;}}else{}_0x4d48fd++;}this[_0x075b('0xf')]('headers',_0x4ace4e);this[_0x075b('0x4')]=!![];}_0x60df11++;}this['_localBuffer']=_0x91a69b;}else{while((_0x521bbe=_0x91a69b[_0x075b('0xc')](_0x575dbd))!=-0x1){_0x3f3068=_0x91a69b[_0x075b('0x9')](0x0,_0x521bbe);this[_0x075b('0xf')](_0x075b('0x10'),_0x3f3068);_0x91a69b=_0x91a69b['substring'](_0x521bbe+_0x575dbd[_0x075b('0xa')]);}this[_0x075b('0x3')]=_0x91a69b;}_0x5b1f91();};module[_0x075b('0x11')]=AGIReply; \ No newline at end of file +var _0x790c=['line','length','exports','util','stream','Transform','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','slice','trim','emit'];(function(_0x3f7673,_0x146a87){var _0x3c537f=function(_0x50465a){while(--_0x50465a){_0x3f7673['push'](_0x3f7673['shift']());}};_0x3c537f(++_0x146a87);}(_0x790c,0x102));var _0xc790=function(_0x1f194e,_0x197a04){_0x1f194e=_0x1f194e-0x0;var _0x4c62bd=_0x790c[_0x1f194e];return _0x4c62bd;};'use strict';var util=require(_0xc790('0x0'));var Transform=require(_0xc790('0x1'))[_0xc790('0x2')];function AGIReply(_0xb2fb4f){Transform['call'](this,_0xb2fb4f);this['_localBuffer']='';this[_0xc790('0x3')]=![];}util[_0xc790('0x4')](AGIReply,Transform);AGIReply['prototype'][_0xc790('0x5')]=function(_0x5551fa,_0x55f4a9,_0x13b5a0){var _0x5ec292='\x0a',_0x185367=['\x0a\x0a',_0xc790('0x6')],_0x51c2e0=-0x1,_0x3f65ca=-0x1,_0x1b2db6='',_0x3e4546=0x0,_0x146215='',_0x5ba13f='';this['_localBuffer']+=_0x5551fa[_0xc790('0x7')]();_0x146215=this[_0xc790('0x8')];if(!this[_0xc790('0x3')]){_0x3e4546=0x0;while(_0x185367[_0x3e4546]){while((_0x3f65ca=_0x146215[_0xc790('0x9')](_0x185367[_0x3e4546]))!=-0x1){_0x1b2db6=_0x185367[_0x3e4546];_0x5ba13f=_0x146215[_0xc790('0xa')](0x0,_0x3f65ca);_0x146215=_0x146215['substring'](_0x3f65ca+_0x1b2db6['length']);var _0x58b997=_0x5ba13f['split'](_0x5ec292),_0x174806=0x0,_0x178a1c={},_0x237934='',_0xaee864='',_0x2a5c36=-0x1;while(_0x58b997[_0x174806]){_0x2a5c36=_0x58b997[_0x174806][_0xc790('0x9')](':');if(_0x2a5c36!=-0x1){_0x237934=_0x58b997[_0x174806][_0xc790('0xb')](0x0,_0x2a5c36)[_0xc790('0xc')]();_0xaee864=_0x58b997[_0x174806][_0xc790('0xb')](_0x2a5c36+0x1)[_0xc790('0xc')]();if(_0x237934['length']>0x0){_0x178a1c[_0x237934]=_0xaee864;}}else{}_0x174806++;}this[_0xc790('0xd')]('headers',_0x178a1c);this['_inBody']=!![];}_0x3e4546++;}this[_0xc790('0x8')]=_0x146215;}else{while((_0x51c2e0=_0x146215[_0xc790('0x9')](_0x5ec292))!=-0x1){_0x5ba13f=_0x146215[_0xc790('0xa')](0x0,_0x51c2e0);this['emit'](_0xc790('0xe'),_0x5ba13f);_0x146215=_0x146215[_0xc790('0xa')](_0x51c2e0+_0x5ec292[_0xc790('0xf')]);}this[_0xc790('0x8')]=_0x146215;}_0x13b5a0();};module[_0xc790('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 83b59a9..7ce512e 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 _0x303a=['agentUnpause','agentLogout','LogoutUser','bluebird','lodash','util','jayson/promise','client','request','then','error','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser'];(function(_0x52264b,_0x13e49e){var _0x5b6391=function(_0x447b84){while(--_0x447b84){_0x52264b['push'](_0x52264b['shift']());}};_0x5b6391(++_0x13e49e);}(_0x303a,0x1a0));var _0xa303=function(_0x5d4600,_0x2c572f){_0x5d4600=_0x5d4600-0x0;var _0x5e71ef=_0x303a[_0x5d4600];return _0x5e71ef;};'use strict';var BPromise=require(_0xa303('0x0'));var moment=require('moment');var _=require(_0xa303('0x1'));var util=require(_0xa303('0x2'));var jayson=require(_0xa303('0x3'));var client=jayson[_0xa303('0x4')]['http']({'port':0x2329});function request(_0x46c56b,_0x26b47c){return new BPromise(function(_0x38a354,_0x217275){return client[_0xa303('0x5')](_0x46c56b,_0x26b47c)[_0xa303('0x6')](function(_0x2bc3d7){if(_0x2bc3d7[_0xa303('0x7')]){return _0x217275(_0x2bc3d7[_0xa303('0x7')]['message']);}else{return _0x38a354(_0x2bc3d7['result']);}})['catch'](function(_0x9142e7){return _0x217275(_0x9142e7);});});}exports[_0xa303('0x8')]=function(_0x5e2e48){return request(_0xa303('0x9'),{'options':{'raw':![],'where':{'name':_0x5e2e48},'attributes':['production']}});};exports[_0xa303('0xa')]=function(_0x59f18a){return request(_0xa303('0xb'),{'options':{'raw':![],'where':{'id':_0x59f18a},'include':[{'model':_0xa303('0xc'),'as':_0xa303('0xd')}],'attributes':['id',_0xa303('0xe'),'email']}});};exports[_0xa303('0xf')]=function(_0x4c0169){return request(_0xa303('0x9'),{'options':{'where':{'id':_0x4c0169},'attributes':[_0xa303('0xe')]}});};exports[_0xa303('0x10')]=function(_0x5b530d){return request(_0xa303('0x11'),{'options':{'where':{'id':_0x5b530d},'attributes':[_0xa303('0xe')]}});};exports[_0xa303('0x12')]=function(_0xfa522c){return request(_0xa303('0x13'),{'options':{'where':{'id':_0xfa522c},'attributes':[_0xa303('0xe')]}});};exports[_0xa303('0x14')]=function(_0x2d1110){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2d1110},'attributes':[_0xa303('0x15')]}});};exports[_0xa303('0x16')]=function(_0x1f3ede){return request(_0xa303('0x17'),{'options':{'where':{'id':_0x1f3ede},'attributes':[_0xa303('0xe')]}});};exports[_0xa303('0x18')]=function(_0x5ec243){return request(_0xa303('0x19'),{'options':{'where':{'phone':_0x5ec243['phone']},'attributes':['id']}});};exports[_0xa303('0x1a')]=function(_0x4cf535){return request(_0xa303('0x1b'),{'options':{'where':{'id':_0x4cf535},'attributes':['name']}});};exports[_0xa303('0x1c')]=function(_0xe263f9){return request(_0xa303('0x1d'),{'options':{'where':{'id':_0xe263f9},'attributes':['save_name']}});};exports[_0xa303('0x1e')]=function(_0x188cb6){return request(_0xa303('0x1f'),{'options':{'raw':![],'where':{'id':_0x188cb6},'include':[{'model':'Interval','as':_0xa303('0x20')}]}});};exports[_0xa303('0x21')]=function(_0x21deee){return request(_0xa303('0x22'),{'options':{'where':{'id':_0x21deee},'attributes':['id','name']}});};exports[_0xa303('0x23')]=function(_0x2a2512){return request('CreateSmsMessage',{'body':_0x2a2512});};exports[_0xa303('0x24')]=function(_0x27c1d7){return request(_0xa303('0x25'),{'body':_0x27c1d7});};exports[_0xa303('0x26')]=function(_0x65ab0e){return request(_0xa303('0x27'),{'body':_[_0xa303('0x28')](_0x65ab0e,{'project_name':_0x65ab0e[_0xa303('0x29')],'prev_project_name':_0x65ab0e[_0xa303('0x2a')]||'','is_subproject':_0x65ab0e['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x5da2d2){return request(_0xa303('0x2b'),{'body':_0x5da2d2});};exports[_0xa303('0x2c')]=function(_0x3680fb){return request(_0xa303('0x2d'),{'body':_0x3680fb});};exports[_0xa303('0x2e')]=function(_0x48e79f){return request(_0xa303('0x2f'),{'options':{'raw':![],'where':{'phone':_0x48e79f[_0xa303('0x30')],'ListId':_0x48e79f['ListId']}}})[_0xa303('0x6')](function(_0xef04b){if(_0xef04b){return _0xef04b;}return request(_0xa303('0x31'),{'body':_0x48e79f});});};exports[_0xa303('0x32')]=function(_0x3c85de){return request(_0xa303('0x33'),{'options':{'where':{'id':_0x3c85de},'attributes':[_0xa303('0xe')]}});};exports[_0xa303('0x34')]=function(_0x411b42,_0x3383f4){return request(_0xa303('0x35'),{'body':{'interface':_0x3383f4},'options':{'where':_0x411b42}});};exports[_0xa303('0x36')]=function(_0x2f7775,_0x1a44fc,_0x35e324){return request(_0xa303('0x37'),{'body':{'type':_0x1a44fc,'uniqueid':_0x35e324},'options':{'where':_0x2f7775}});};exports[_0xa303('0x38')]=function(_0x5de180){return request('UnpauseUser',{'body':{},'options':{'where':_0x5de180}});};exports[_0xa303('0x39')]=function(_0x37cda6){return request(_0xa303('0x3a'),{'body':{},'options':{'where':_0x37cda6}});}; \ No newline at end of file +var _0xf8b2=['getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue'];(function(_0x2dc5a7,_0x335803){var _0x195d68=function(_0x59b62a){while(--_0x59b62a){_0x2dc5a7['push'](_0x2dc5a7['shift']());}};_0x195d68(++_0x335803);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x5f49f6,_0x4c1875){_0x5f49f6=_0x5f49f6-0x0;var _0xc1dd2c=_0xf8b2[_0x5f49f6];return _0xc1dd2c;};'use strict';var BPromise=require(_0x2f8b('0x0'));var moment=require(_0x2f8b('0x1'));var _=require(_0x2f8b('0x2'));var util=require(_0x2f8b('0x3'));var jayson=require(_0x2f8b('0x4'));var client=jayson[_0x2f8b('0x5')][_0x2f8b('0x6')]({'port':0x2329});function request(_0x2952c2,_0x50dae3){return new BPromise(function(_0x4b33e9,_0x2a1c7a){return client[_0x2f8b('0x7')](_0x2952c2,_0x50dae3)[_0x2f8b('0x8')](function(_0x1d133a){if(_0x1d133a[_0x2f8b('0x9')]){return _0x2a1c7a(_0x1d133a[_0x2f8b('0x9')][_0x2f8b('0xa')]);}else{return _0x4b33e9(_0x1d133a[_0x2f8b('0xb')]);}})[_0x2f8b('0xc')](function(_0x5ca31b){return _0x2a1c7a(_0x5ca31b);});});}exports[_0x2f8b('0xd')]=function(_0xb352e8){return request(_0x2f8b('0xe'),{'options':{'raw':![],'where':{'name':_0xb352e8},'attributes':['production']}});};exports[_0x2f8b('0xf')]=function(_0xed22c){return request(_0x2f8b('0x10'),{'options':{'raw':![],'where':{'id':_0xed22c},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x2f8b('0x11'),_0x2f8b('0x12')]}});};exports[_0x2f8b('0x13')]=function(_0x6cdacb){return request(_0x2f8b('0xe'),{'options':{'where':{'id':_0x6cdacb},'attributes':['name']}});};exports[_0x2f8b('0x14')]=function(_0x4d75d1){return request(_0x2f8b('0x15'),{'options':{'where':{'id':_0x4d75d1},'attributes':[_0x2f8b('0x11')]}});};exports[_0x2f8b('0x16')]=function(_0x15634){return request(_0x2f8b('0x17'),{'options':{'where':{'id':_0x15634},'attributes':[_0x2f8b('0x11')]}});};exports[_0x2f8b('0x18')]=function(_0x2b6003){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2b6003},'attributes':[_0x2f8b('0x19')]}});};exports[_0x2f8b('0x1a')]=function(_0x2daba9){return request(_0x2f8b('0x1b'),{'options':{'where':{'id':_0x2daba9},'attributes':[_0x2f8b('0x11')]}});};exports[_0x2f8b('0x1c')]=function(_0x3d65ee){return request(_0x2f8b('0x1d'),{'options':{'where':{'phone':_0x3d65ee[_0x2f8b('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x23dd63){return request(_0x2f8b('0x1f'),{'options':{'where':{'id':_0x23dd63},'attributes':[_0x2f8b('0x11')]}});};exports['getSoundById']=function(_0xdc8171){return request('ShowSound',{'options':{'where':{'id':_0xdc8171},'attributes':[_0x2f8b('0x20')]}});};exports[_0x2f8b('0x21')]=function(_0x1da005){return request(_0x2f8b('0x22'),{'options':{'raw':![],'where':{'id':_0x1da005},'include':[{'model':_0x2f8b('0x23'),'as':'Intervals'}]}});};exports[_0x2f8b('0x24')]=function(_0x23c6c0){return request(_0x2f8b('0x25'),{'options':{'where':{'id':_0x23c6c0},'attributes':['id',_0x2f8b('0x11')]}});};exports[_0x2f8b('0x26')]=function(_0x1ffbae){return request(_0x2f8b('0x27'),{'body':_0x1ffbae});};exports['createSquareDetailsReport']=function(_0x273950){return request(_0x2f8b('0x28'),{'body':_0x273950});};exports[_0x2f8b('0x29')]=function(_0x41e12b){return request(_0x2f8b('0x2a'),{'body':_['merge'](_0x41e12b,{'project_name':_0x41e12b[_0x2f8b('0x2b')],'prev_project_name':_0x41e12b[_0x2f8b('0x2c')]||'','is_subproject':_0x41e12b[_0x2f8b('0x2c')]?!![]:![],'leaveAt':moment()[_0x2f8b('0x2d')](_0x2f8b('0x2e'))})});};exports[_0x2f8b('0x2f')]=function(_0x45e313){return request(_0x2f8b('0x30'),{'body':_0x45e313});};exports[_0x2f8b('0x31')]=function(_0x5642a2){return request(_0x2f8b('0x32'),{'body':_0x5642a2});};exports['createCmContact']=function(_0x44e667){return request(_0x2f8b('0x33'),{'options':{'raw':![],'where':{'phone':_0x44e667[_0x2f8b('0x1e')],'ListId':_0x44e667[_0x2f8b('0x34')]}}})[_0x2f8b('0x8')](function(_0x4adacd){if(_0x4adacd){return _0x4adacd;}return request(_0x2f8b('0x35'),{'body':_0x44e667});});};exports['getPauseById']=function(_0x5207a8){return request(_0x2f8b('0x36'),{'options':{'where':{'id':_0x5207a8},'attributes':[_0x2f8b('0x11')]}});};exports['agentLogin']=function(_0x163dd8,_0x20d80c){return request(_0x2f8b('0x37'),{'body':{'interface':_0x20d80c},'options':{'where':_0x163dd8}});};exports[_0x2f8b('0x38')]=function(_0x1fe3d0,_0x3fea08,_0x5b2879){return request(_0x2f8b('0x39'),{'body':{'type':_0x3fea08,'uniqueid':_0x5b2879},'options':{'where':_0x1fe3d0}});};exports[_0x2f8b('0x3a')]=function(_0x296eac){return request(_0x2f8b('0x3b'),{'body':{},'options':{'where':_0x296eac}});};exports[_0x2f8b('0x3c')]=function(_0x278edc){return request(_0x2f8b('0x3d'),{'body':{},'options':{'where':_0x278edc}});}; \ 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 943dc2b..681463e 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 _0xdc86=['./lex'];(function(_0x3647d3,_0x4c6857){var _0x557f88=function(_0x57efb7){while(--_0x57efb7){_0x3647d3['push'](_0x3647d3['shift']());}};_0x557f88(++_0x4c6857);}(_0xdc86,0x118));var _0x6dc8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xdc86[_0x31a371];return _0x2a5bd6;};var polly=require('./polly');var lex=require(_0x6dc8('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x5a63=['./lex','./polly'];(function(_0x7b534f,_0x8e91bc){var _0x2fae25=function(_0x85442b){while(--_0x85442b){_0x7b534f['push'](_0x7b534f['shift']());}};_0x2fae25(++_0x8e91bc);}(_0x5a63,0xe3));var _0x35a6=function(_0x267e56,_0x5dd6cf){_0x267e56=_0x267e56-0x0;var _0x464c86=_0x5a63[_0x267e56];return _0x464c86;};var polly=require(_0x35a6('0x0'));var lex=require(_0x35a6('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index a968403..80c1543 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 _0x55e0=['./lib/api','exports'];(function(_0x272ce4,_0xcc9405){var _0x2d3aaa=function(_0x43bf19){while(--_0x43bf19){_0x272ce4['push'](_0x272ce4['shift']());}};_0x2d3aaa(++_0xcc9405);}(_0x55e0,0xdc));var _0x055e=function(_0x394939,_0xc426dd){_0x394939=_0x394939-0x0;var _0x335251=_0x55e0[_0x394939];return _0x335251;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ No newline at end of file +var _0xac4a=['exports','./lib/api'];(function(_0x445356,_0x119f04){var _0x338208=function(_0x12cd36){while(--_0x12cd36){_0x445356['push'](_0x445356['shift']());}};_0x338208(++_0x119f04);}(_0xac4a,0x13f));var _0xaac4=function(_0x40f552,_0x6e6815){_0x40f552=_0x40f552-0x0;var _0x568487=_0xac4a[_0x40f552];return _0x568487;};'use strict';var lex=require(_0xaac4('0x0'));module[_0xaac4('0x1')]=function(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e){return lex(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e);}; \ 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 3c96e2a..ebb638a 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(_0x37bd34,_0x3c1983){var _0x4abdb3=function(_0x2912a3){while(--_0x2912a3){_0x37bd34['push'](_0x37bd34['shift']());}};_0x4abdb3(++_0x3c1983);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x37ce68,_0x1df6ef){var _0x219f72=function(_0xe61d0){while(--_0xe61d0){_0x37ce68['push'](_0x37ce68['shift']());}};_0x219f72(++_0x1df6ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 ab1d7d8..7bbbb12 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 _0xb05a=['exports'];(function(_0x3804d6,_0x440bb8){var _0x5e7d4d=function(_0x513616){while(--_0x513616){_0x3804d6['push'](_0x3804d6['shift']());}};_0x5e7d4d(++_0x440bb8);}(_0xb05a,0x8a));var _0xab05=function(_0x4d12c0,_0x19f3af){_0x4d12c0=_0x4d12c0-0x0;var _0x216508=_0xb05a[_0x4d12c0];return _0x216508;};'use strict';var polly=require('./lib/api');module[_0xab05('0x0')]=function(_0x349ee3,_0xbadbbd,_0x1de958,_0xf3a3e,_0x3904c9,_0x2532ea,_0x579fb3){return polly(_0x349ee3,_0xbadbbd,_0x1de958,_0xf3a3e,_0x3904c9,_0x2532ea,_0x579fb3);}; \ No newline at end of file +var _0x970f=['./lib/api','exports'];(function(_0x376c9c,_0x339ef2){var _0x1881bb=function(_0xa41c94){while(--_0xa41c94){_0x376c9c['push'](_0x376c9c['shift']());}};_0x1881bb(++_0x339ef2);}(_0x970f,0x148));var _0xf970=function(_0xdf06bb,_0x599b27){_0xdf06bb=_0xdf06bb-0x0;var _0x441bc1=_0x970f[_0xdf06bb];return _0x441bc1;};'use strict';var polly=require(_0xf970('0x0'));module[_0xf970('0x1')]=function(_0x2f81a9,_0x3b86f4,_0x238673,_0x1bcb8c,_0x34cc83,_0x4b0222,_0x51adff){return polly(_0x2f81a9,_0x3b86f4,_0x238673,_0x1bcb8c,_0x34cc83,_0x4b0222,_0x51adff);}; \ 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 e4671d3..2b7a041 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 _0xb25d=['path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x203437,_0x2202c8){var _0x3b9557=function(_0xc69066){while(--_0xc69066){_0x203437['push'](_0x203437['shift']());}};_0x3b9557(++_0x2202c8);}(_0xb25d,0x82));var _0xdb25=function(_0x36eeff,_0x228d2f){_0x36eeff=_0x36eeff-0x0;var _0x4e1bc5=_0xb25d[_0x36eeff];return _0x4e1bc5;};'use strict';var fs=require('fs');var path=require(_0xdb25('0x0'));var BPromise=require('bluebird');var rs=require(_0xdb25('0x1'));var AWS=require(_0xdb25('0x2'));function pollyResult(_0x436876,_0x400228,_0x9bb581){return new BPromise(function(_0x302a21,_0x2590ec){_0x436876[_0xdb25('0x3')](_0x400228,function(_0x1dd571,_0x38fef1){if(_0x1dd571){_0x2590ec(_0x1dd571);}else if(_0x38fef1){if(_0x38fef1[_0xdb25('0x4')]instanceof Buffer){fs['writeFile'](_0x9bb581,_0x38fef1[_0xdb25('0x4')],function(_0x350424){if(_0x350424){_0x2590ec(_0x350424);}else{_0x302a21();}});}else{_0x2590ec(new Error(_0xdb25('0x5')));}}else{_0x2590ec(new Error(_0xdb25('0x6')));}});});}module[_0xdb25('0x7')]=function(_0x2f5384,_0x1436ca,_0x4e4086,_0x962a95,_0x40dd78,_0x519f93,_0x35d41b){var _0x41100d=new AWS[(_0xdb25('0x8'))]({'accessKeyId':_0x2f5384,'secretAccessKey':_0x1436ca,'region':_0x4e4086});var _0x2b5a07={'Text':_0x40dd78,'TextType':_0x519f93||_0xdb25('0x9'),'OutputFormat':'mp3','VoiceId':_0x962a95};return pollyResult(_0x41100d,_0x2b5a07,_0x35d41b);}; \ No newline at end of file +var _0x0f07=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0f07,0x19f));var _0x70f0=function(_0x50e914,_0x4e6f92){_0x50e914=_0x50e914-0x0;var _0x5374b5=_0x0f07[_0x50e914];return _0x5374b5;};'use strict';var fs=require('fs');var path=require(_0x70f0('0x0'));var BPromise=require(_0x70f0('0x1'));var rs=require(_0x70f0('0x2'));var AWS=require(_0x70f0('0x3'));function pollyResult(_0x30d162,_0x46c929,_0x120a4d){return new BPromise(function(_0x3cb614,_0x1e341f){_0x30d162['synthesizeSpeech'](_0x46c929,function(_0x24a6b0,_0x516f50){if(_0x24a6b0){_0x1e341f(_0x24a6b0);}else if(_0x516f50){if(_0x516f50[_0x70f0('0x4')]instanceof Buffer){fs[_0x70f0('0x5')](_0x120a4d,_0x516f50[_0x70f0('0x4')],function(_0x146598){if(_0x146598){_0x1e341f(_0x146598);}else{_0x3cb614();}});}else{_0x1e341f(new Error(_0x70f0('0x6')));}}else{_0x1e341f(new Error(_0x70f0('0x7')));}});});}module[_0x70f0('0x8')]=function(_0x28dd39,_0x53fa74,_0x2d870c,_0x4ecd0e,_0x3012c5,_0x519fe4,_0x2f8000){var _0x4306db=new AWS[(_0x70f0('0x9'))]({'accessKeyId':_0x28dd39,'secretAccessKey':_0x53fa74,'region':_0x2d870c});var _0xbe7167={'Text':_0x3012c5,'TextType':_0x519fe4||_0x70f0('0xa'),'OutputFormat':_0x70f0('0xb'),'VoiceId':_0x4ecd0e};return pollyResult(_0x4306db,_0xbe7167,_0x2f8000);}; \ 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 73cde3c..997c56f 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 _0x802f=['./lib/api'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x802f,0x1ee));var _0xf802=function(_0x29276c,_0x2e6cf8){_0x29276c=_0x29276c-0x0;var _0x2e82f9=_0x802f[_0x29276c];return _0x2e82f9;};'use strict';var asr=require(_0xf802('0x0'));module['exports']=function(_0x15fda5,_0x364dbf,_0x4891a8,_0x3211e2){return asr(_0x15fda5,_0x364dbf,_0x4891a8);}; \ No newline at end of file +var _0x360d=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x360d,0x105));var _0xd360=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x360d[_0x2a8c21];return _0x5f3061;};'use strict';var asr=require(_0xd360('0x0'));module[_0xd360('0x1')]=function(_0x2d1ab1,_0x40d033,_0x2866d2,_0x4de0f3){return asr(_0x2d1ab1,_0x40d033,_0x2866d2);}; \ 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 c3cdf0f..1adeb47 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 _0x1b73=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x1b73,0x1d5));var _0x31b7=function(_0x4647a7,_0x2cd7b4){_0x4647a7=_0x4647a7-0x0;var _0x198dda=_0x1b73[_0x4647a7];return _0x198dda;};'use strict';var url=require('url');var BPromise=require(_0x31b7('0x0'));var fs=require('fs');var host=_0x31b7('0x1');module[_0x31b7('0x2')]=function(_0x5c767e,_0x4bf5ae,_0x17c0ef){return new BPromise(function(_0x59e606,_0x40fef2){var _0x3682cc;if(typeof _0x5c767e!=='string'||_0x5c767e[_0x31b7('0x3')]===0x0){return _0x40fef2(_0x31b7('0x4'));}if(typeof _0x4bf5ae!==_0x31b7('0x5')||_0x4bf5ae['length']===0x0){return _0x40fef2(_0x31b7('0x6'));}if(typeof _0x17c0ef!==_0x31b7('0x7')&&(typeof _0x17c0ef!==_0x31b7('0x5')||_0x17c0ef[_0x31b7('0x3')]===0x0)){return _0x40fef2(_0x31b7('0x8'));}try{_0x3682cc=fs[_0x31b7('0x9')](_0x5c767e)[_0x31b7('0xa')]('base64');}catch(_0x268428){return _0x40fef2(_0x268428);}return _0x59e606({'method':_0x31b7('0xb'),'uri':host+_0x31b7('0xc')+_0x4bf5ae,'body':{'config':{'encoding':_0x31b7('0xd'),'sampleRateHertz':_0x31b7('0xe'),'languageCode':_0x17c0ef},'audio':{'content':_0x3682cc}},'json':!![]});});}; \ No newline at end of file +var _0x80df=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird'];(function(_0x4cf825,_0x34c13e){var _0x4ef403=function(_0x2edbe2){while(--_0x2edbe2){_0x4cf825['push'](_0x4cf825['shift']());}};_0x4ef403(++_0x34c13e);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var url=require(_0xf80d('0x0'));var BPromise=require(_0xf80d('0x1'));var fs=require('fs');var host=_0xf80d('0x2');module[_0xf80d('0x3')]=function(_0x5390c8,_0x3aee0a,_0x216488){return new BPromise(function(_0xfd239e,_0x21365c){var _0x15d302;if(typeof _0x5390c8!==_0xf80d('0x4')||_0x5390c8[_0xf80d('0x5')]===0x0){return _0x21365c(_0xf80d('0x6'));}if(typeof _0x3aee0a!==_0xf80d('0x4')||_0x3aee0a[_0xf80d('0x5')]===0x0){return _0x21365c('key\x20should\x20be\x20a\x20string');}if(typeof _0x216488!==_0xf80d('0x7')&&(typeof _0x216488!==_0xf80d('0x4')||_0x216488[_0xf80d('0x5')]===0x0)){return _0x21365c(_0xf80d('0x8'));}try{_0x15d302=fs[_0xf80d('0x9')](_0x5390c8)[_0xf80d('0xa')](_0xf80d('0xb'));}catch(_0x45d290){return _0x21365c(_0x45d290);}return _0xfd239e({'method':_0xf80d('0xc'),'uri':host+_0xf80d('0xd')+_0x3aee0a,'body':{'config':{'encoding':_0xf80d('0xe'),'sampleRateHertz':_0xf80d('0xf'),'languageCode':_0x216488},'audio':{'content':_0x15d302}},'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 0e268ea..ad76290 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 _0x2ce2=['exports','./asr'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x2ce2,0xab));var _0x22ce=function(_0x5491e5,_0x37a869){_0x5491e5=_0x5491e5-0x0;var _0x214eb5=_0x2ce2[_0x5491e5];return _0x214eb5;};var asr=require(_0x22ce('0x0'));module[_0x22ce('0x1')]={'asr':asr}; \ No newline at end of file +var _0x499f=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x499f,0x183));var _0xf499=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x499f[_0x5e709a];return _0x57401a;};var asr=require('./asr');module[_0xf499('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ecca14a..fbdbdd4 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 _0x20cd=['host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','download\x20error','pipe','end','path','request\x20to\x20','wav','error\x20convert','finish\x20to\x20convert','start','generate','writeFileSync','base64','unlink','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','then','resolve','tmp','.mp3','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','code','metadata','googleDialogflowV2','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20confidence','polly','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','apiai-promise','bluebird','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:'];(function(_0x4456d4,_0x3cf810){var _0x459e9c=function(_0x210b2d){while(--_0x210b2d){_0x4456d4['push'](_0x4456d4['shift']());}};_0x459e9c(++_0x3cf810);}(_0x20cd,0x72));var _0xd20c=function(_0x3ee722,_0x3f02a7){_0x3ee722=_0x3ee722-0x0;var _0x49d55c=_0x20cd[_0x3ee722];return _0x49d55c;};'use strict';var apiai=require(_0xd20c('0x0'));var BPromise=require(_0xd20c('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xd20c('0x2'));var https=require(_0xd20c('0x3'));var md5=require(_0xd20c('0x4'));var path=require('path');var querystring=require(_0xd20c('0x5'));var rp=require(_0xd20c('0x6'));var rs=require(_0xd20c('0x7'));var sox=require(_0xd20c('0x8'));var tts=require(_0xd20c('0x9'));var urlParse=require(_0xd20c('0xa'))[_0xd20c('0xb')];var util=require(_0xd20c('0xc'));var aws=require(_0xd20c('0xd'));var google=require('./google');var sestek=require(_0xd20c('0xe'));var tilde=require(_0xd20c('0xf'));var logger=require(_0xd20c('0x10'))(_0xd20c('0x11'));var ISPEECH_API=_0xd20c('0x12');function downloadFile(_0x250c9e,_0x559c92){return new BPromise(function(_0x443035,_0x521351){var _0x4d2a35=urlParse(_0x250c9e);var _0x30f587=_0x4d2a35[_0xd20c('0x13')]===_0xd20c('0x14')?https:http;var _0x3db6e2={'host':_0x4d2a35[_0xd20c('0x15')],'path':_0x4d2a35['path'],'headers':{'user-agent':_0xd20c('0x16')}};_0x30f587[_0xd20c('0x17')](_0x3db6e2,function(_0x5ec667){if(_0x5ec667[_0xd20c('0x18')]!==0xc8){logger[_0xd20c('0x19')]('request\x20to\x20'+_0x250c9e+_0xd20c('0x1a')+_0x5ec667[_0xd20c('0x18')]+'\x20('+_0x5ec667[_0xd20c('0x1b')]+')');_0x521351(new Error('request\x20to\x20'+_0x250c9e+'\x20failed,\x20status\x20code\x20=\x20'+_0x5ec667[_0xd20c('0x18')]+'\x20('+_0x5ec667['statusMessage']+')'));return;}var _0x210fb6=fs[_0xd20c('0x1c')](_0x559c92);_0x210fb6['on']('finish',function(){logger[_0xd20c('0x1d')](_0xd20c('0x1e'));_0x210fb6['close'](_0x443035);});_0x210fb6['on'](_0xd20c('0x19'),function(_0x52208d){fs['unlink'](_0x559c92);logger[_0xd20c('0x19')](_0xd20c('0x1f'),_0x52208d);_0x521351(_0x52208d);});_0x5ec667[_0xd20c('0x20')](_0x210fb6);})['on'](_0xd20c('0x19'),function(_0xebc49a){logger[_0xd20c('0x19')](_0xebc49a);_0x521351(_0xebc49a);})[_0xd20c('0x21')]();});}function uploadFile(_0x4b62a7){return new BPromise(function(_0x20758b,_0x57a788){var _0x441d49=urlParse(_0x4b62a7);var _0x42605d=_0x441d49[_0xd20c('0x13')]==='https:'?https:http;var _0x1c5e36={'host':_0x441d49[_0xd20c('0x15')],'path':_0x441d49[_0xd20c('0x22')],'headers':{'user-agent':'WHAT_EVER'}};_0x42605d['get'](_0x1c5e36,function(_0x142bd2){if(_0x142bd2['statusCode']!==0xc8){_0x57a788(new Error(_0xd20c('0x23')+_0x4b62a7+_0xd20c('0x1a')+_0x142bd2[_0xd20c('0x18')]+'\x20('+_0x142bd2[_0xd20c('0x1b')]+')'));return;}var _0x4aeb60='';_0x142bd2['on']('data',function(_0x4b1d02){_0x4aeb60+=_0x4b1d02;});_0x142bd2['on'](_0xd20c('0x21'),function(){_0x20758b(_0x4aeb60);});})['on']('error',function(_0x5cf87d){_0x57a788(_0x5cf87d);})[_0xd20c('0x21')]();});}function convertFile(_0x3f3617,_0x416673){return new BPromise(function(_0x123bb7,_0x2e510d){var _0x53e263=sox['transcode'](_0x3f3617,_0x416673,{'sampleRate':0x1f40,'format':_0xd20c('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53e263['on'](_0xd20c('0x19'),function(_0x506261){logger[_0xd20c('0x19')](_0xd20c('0x25'),_0x506261);_0x2e510d(_0x506261);});_0x53e263['on']('end',function(){logger[_0xd20c('0x1d')](_0xd20c('0x26'));_0x123bb7();});_0x53e263[_0xd20c('0x27')]();});}function base64Decode(_0x49daf2,_0x2f9455){var _0x31bc3c=path['resolve'](__dirname,'tmp',rs[_0xd20c('0x28')](0x4)+'.wav');fs[_0xd20c('0x29')](_0x31bc3c,_0x49daf2,_0xd20c('0x2a'));return convertFile(_0x31bc3c,_0x2f9455)['then'](function(){try{fs[_0xd20c('0x2b')](_0x31bc3c);fs[_0xd20c('0x2c')](_0x2f9455,_0xd20c('0x2d'));}catch(_0x41ccbc){logger[_0xd20c('0x19')](_0x41ccbc);}return _0x2f9455[_0xd20c('0x2e')]('.')[0x0];});}function base64Encode(_0x184884){var _0x1fceb6=fs[_0xd20c('0x2f')](_0x184884);return new Buffer(_0x1fceb6)[_0xd20c('0x30')](_0xd20c('0x2a'));}exports['googleCloudTTS']=function(_0x7129bc,_0x222c6f,_0x273e51,_0x63194,_0x2b7a16,_0x5d8ea2){var _0x173b7d,_0x353968;var _0x422416='https://texttospeech.googleapis.com/v1/';var _0x456a68=_0xd20c('0x31')+_0x7129bc;var _0x136fde={};if(_0x222c6f===_0xd20c('0x32')){_0x136fde['input']={'ssml':_0x273e51};}else{_0x136fde[_0xd20c('0x33')]={'text':_0x273e51};};_0x136fde[_0xd20c('0x34')]={'languageCode':_0x63194,'ssmlGender':_0x2b7a16};_0x136fde[_0xd20c('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x50ada0={'url':_0x422416+_0xd20c('0x36')+_0x456a68,'method':_0xd20c('0x37'),'json':!![],'body':_0x136fde};return rp(_0x50ada0)[_0xd20c('0x38')](function(_0x2f040d){return new BPromise(function(_0x472c1c,_0x177e5a){_0x173b7d=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs['generate'](0x4)+_0xd20c('0x3b'));var _0x3007f3=Buffer[_0xd20c('0x3c')](_0x2f040d[_0xd20c('0x3d')],_0xd20c('0x2a'));return fs[_0xd20c('0x3e')](_0x173b7d,_0x3007f3,function(_0x4f464f){_0x177e5a(_0x4f464f);},function(_0x50236d){fs['chmodSync'](_0x173b7d,_0xd20c('0x2d'));_0x472c1c(_0x50236d);});});})['then'](function(_0x46f781){_0x353968=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs[_0xd20c('0x28')](0x4)+_0xd20c('0x3f'));return convertFile(_0x173b7d,_0x353968);})[_0xd20c('0x38')](function(){try{fs[_0xd20c('0x2b')](_0x173b7d);fs[_0xd20c('0x2c')](_0x353968,'777');}catch(_0x241715){logger[_0xd20c('0x19')](_0x241715);}logger[_0xd20c('0x1d')](_0xd20c('0x40'),_0x353968[_0xd20c('0x2e')]('.')[0x0]);return _0x353968[_0xd20c('0x2e')]('.')[0x0];});};exports[_0xd20c('0x41')]=function(_0x2d3efa,_0x187bc7){var _0x4e298d=_0xd20c('0x42');var _0x4a0b7f,_0x4df5f9;var _0x1a2b15;var _0x1e136f={'encoding':_0xd20c('0x43'),'method':'POST','timeout':0x2710,'url':_0x4e298d,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xd20c('0x44')+encodeURIComponent(JSON[_0xd20c('0x45')]([[[_0xd20c('0x46'),JSON[_0xd20c('0x45')]([_0x2d3efa,_0x187bc7||'en',![],_0xd20c('0x47')]),null,_0xd20c('0x48')]]]))};return rp(_0x1e136f)[_0xd20c('0x38')](function(_0xed52b9){try{_0x1a2b15=eval(_0xed52b9[_0xd20c('0x49')](0x5))[0x0][0x2];}catch(_0x1a3c23){throw new Error(_0xd20c('0x4a')+_0xed52b9[_0xd20c('0x4b')]);}if(!_0x1a2b15){if(_0x2d3efa[_0xd20c('0x4c')]>0xc8){throw new Error(_0xd20c('0x4d'));}else{throw new Error('lang\x20\x22'+_0x187bc7+_0xd20c('0x4e'));}}try{_0x1a2b15=eval(_0x1a2b15)[0x0];}catch(_0x3de2b3){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xd20c('0x4b')]);}const _0x43fc51=_0x1a2b15;_0x4a0b7f=path['resolve'](__dirname,'tmp',rs[_0xd20c('0x28')](0x4)+_0xd20c('0x3b'));fs[_0xd20c('0x29')](_0x4a0b7f,_0x1a2b15,{'encoding':_0xd20c('0x2a')});_0x4df5f9=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs[_0xd20c('0x28')](0x4)+'.wav');return convertFile(_0x4a0b7f,_0x4df5f9);})['then'](function(){try{fs[_0xd20c('0x2b')](_0x4a0b7f);fs[_0xd20c('0x2c')](_0x4df5f9,_0xd20c('0x2d'));}catch(_0x17f4f9){logger[_0xd20c('0x19')](_0x17f4f9);}logger[_0xd20c('0x1d')]('goggleTTS\x20path',_0x4df5f9[_0xd20c('0x2e')]('.')[0x0]);return _0x4df5f9['split']('.')[0x0];});};exports[_0xd20c('0x4f')]=function(_0x576a72,_0x22edbc,_0x3064be){return google[_0xd20c('0x50')](_0x576a72,_0x22edbc,_0x3064be)[_0xd20c('0x38')](function(_0x3ec327){logger[_0xd20c('0x1d')](_0x3ec327[_0xd20c('0x51')]);return rp(_0x3ec327);})['then'](function(_0x99e088){var _0x241868='';var _0x23112d=0x0;try{fs[_0xd20c('0x2b')](_0x576a72);}catch(_0x203e51){logger[_0xd20c('0x19')](_0x203e51);}if(_0x99e088&&_0x99e088['results']){_0x241868=_0x99e088[_0xd20c('0x52')][_0xd20c('0x53')](function(_0x3d6306){return _0x3d6306&&_0x3d6306[_0xd20c('0x54')][0x0]&&_0x3d6306[_0xd20c('0x54')][0x0]['transcript']?_0x3d6306['alternatives'][0x0][_0xd20c('0x55')]:'';})[_0xd20c('0x56')]('\x0a');_0x23112d=_0x99e088[_0xd20c('0x52')]['map'](function(_0x2c80ed){return _0x2c80ed&&_0x2c80ed[_0xd20c('0x54')][0x0]&&_0x2c80ed[_0xd20c('0x54')][0x0][_0xd20c('0x57')]?_0x2c80ed[_0xd20c('0x54')][0x0][_0xd20c('0x57')]:0x0;})['join']('\x0a');}logger['info'](_0xd20c('0x58'),_0x241868);logger[_0xd20c('0x1d')](_0xd20c('0x59'),_0x23112d);return{'transcript':_0x241868,'confidence':_0x23112d};})['catch'](function(_0x52548c){logger[_0xd20c('0x19')]('[%s]\x20%s:%s',_0x52548c['statusCode'],_0x52548c[_0xd20c('0x5a')],_0x52548c['message']);});};exports[_0xd20c('0x5b')]=function(_0x1349b2,_0x4ad918,_0x349b37,_0xca56cb){var _0x19356c=apiai(_0x4ad918,{'language':_0xca56cb||'en'});return _0x19356c[_0xd20c('0x5c')](_0x349b37,{'sessionId':md5(_0x1349b2)})[_0xd20c('0x38')](function(_0x402644){logger[_0xd20c('0x1d')](JSON[_0xd20c('0x45')](_0x402644));return{'source':_0x402644[_0xd20c('0x5d')][_0xd20c('0x5e')],'resolvedQuery':_0x402644[_0xd20c('0x5d')][_0xd20c('0x5f')],'action':_0x402644[_0xd20c('0x5d')][_0xd20c('0x60')],'actionIncomplete':_0x402644[_0xd20c('0x5d')][_0xd20c('0x61')],'speech':_0x402644['result']['fulfillment'][_0xd20c('0x62')],'score':_0x402644[_0xd20c('0x5d')][_0xd20c('0x63')],'statusCode':_0x402644[_0xd20c('0x64')][_0xd20c('0x65')],'endConversation':_0x402644[_0xd20c('0x5d')][_0xd20c('0x66')]['endConversation']||![],'isFallbackIntent':_0x402644['result'][_0xd20c('0x66')]['isFallbackIntent']};});};exports[_0xd20c('0x67')]=function(_0x3888cf,_0x1161dd,_0x20fe20,_0x595c16,_0x568b89,_0x41e0f6){var _0x3a84a8=_0x595c16[_0xd20c('0x68')](/\\n/g,'\x0a');var _0x5f1873={'credentials':{'private_key':_0x3a84a8,'client_email':_0x20fe20}};var _0x1fb25e=new dialogflow['SessionsClient'](_0x5f1873);var _0x1c4453=_0x1fb25e[_0xd20c('0x69')](_0x1161dd,md5(_0x3888cf));var _0x198c90={'session':_0x1c4453,'queryInput':{'text':{'text':_0x568b89,'languageCode':_0x41e0f6}}};return _0x1fb25e['detectIntent'](_0x198c90)[_0xd20c('0x38')](function(_0x45b296){if(_0x45b296&&_0x45b296['length']){logger[_0xd20c('0x1d')](_0xd20c('0x6a'),JSON[_0xd20c('0x45')](_0x45b296));var _0x39e220=_0x45b296[0x0];if(_0x39e220){var _0x523932={'action':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x60')],'allRequiredParamsPresent':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x6c')],'endConversation':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x6d')]&&_0x39e220[_0xd20c('0x6b')][_0xd20c('0x6d')]['fields']?_0x39e220[_0xd20c('0x6b')][_0xd20c('0x6d')][_0xd20c('0x6e')]['end_conversation'][_0xd20c('0x6f')]:![],'fulfillmentText':_0x39e220['queryResult']['fulfillmentText'],'intentName':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x70')][_0xd20c('0x5a')],'intentDisplayName':_0x39e220['queryResult'][_0xd20c('0x70')][_0xd20c('0x71')],'isFallbackIntent':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x70')][_0xd20c('0x72')],'languageCode':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x73')],'queryText':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x74')],'responseId':_0x39e220[_0xd20c('0x75')],'score':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x76')],'speech':_0x39e220[_0xd20c('0x6b')][_0xd20c('0x77')],'providerResponse':JSON[_0xd20c('0x45')](_0x45b296)};return _0x523932;}}});};exports[_0xd20c('0x78')]=function(_0x5c1caf,_0x29b9e1,_0x23641d,_0x42e29a){return tilde[_0xd20c('0x50')](_0x5c1caf,_0x29b9e1,_0x23641d,_0x42e29a)[_0xd20c('0x38')](function(_0x26f908){try{fs[_0xd20c('0x2b')](_0x5c1caf);}catch(_0x596611){logger[_0xd20c('0x19')](_0x596611);}logger['info']('Tilde\x20ASR\x20transcription',_0x26f908[_0xd20c('0x55')]);logger[_0xd20c('0x1d')](_0xd20c('0x79'),_0x26f908[_0xd20c('0x57')]);return _0x26f908;});};exports['awsPolly']=function(_0x1f6012,_0x2e6c98,_0x25d385,_0x479017,_0x32a44f,_0x297b42){var _0x22a32e=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs[_0xd20c('0x28')](0x4)+_0xd20c('0x3b'));var _0x3df018;return aws[_0xd20c('0x7a')](_0x1f6012,_0x2e6c98,_0x25d385,_0x479017,_0x32a44f,_0x297b42,_0x22a32e)[_0xd20c('0x38')](function(){_0x3df018=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs[_0xd20c('0x28')](0x4)+_0xd20c('0x3f'));return convertFile(_0x22a32e,_0x3df018);})[_0xd20c('0x38')](function(){try{fs[_0xd20c('0x2b')](_0x22a32e);fs['chmodSync'](_0x3df018,_0xd20c('0x2d'));}catch(_0x1563c3){logger[_0xd20c('0x19')](_0x1563c3);}return _0x3df018[_0xd20c('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x1bd3bf,_0x41225e,_0x47e943,_0x4c1fb9,_0x2cda80,_0x2aafcb){return aws['lex'](_0x1bd3bf,_0x41225e,_0x47e943,_0x4c1fb9,_0x2cda80,_0x2aafcb)[_0xd20c('0x38')](function(_0x42d00c){logger[_0xd20c('0x1d')](JSON['stringify'](_0x42d00c));return _0x42d00c;});};exports[_0xd20c('0x7b')]=function(_0x5412f3,_0x3d9932,_0x2a87ea,_0x4064b1){var _0x158ce0=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x5412f3,encodeURIComponent(_0x3d9932),_0x2a87ea,_0x4064b1);var _0x18323d=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs['generate'](0x4)+_0xd20c('0x3b'));var _0x725150;return downloadFile(_0x158ce0,_0x18323d)['then'](function(){_0x725150=path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs[_0xd20c('0x28')](0x4)+'.wav');return convertFile(_0x18323d,_0x725150);})['then'](function(){try{fs[_0xd20c('0x2b')](_0x18323d);fs[_0xd20c('0x2c')](_0x725150,_0xd20c('0x2d'));}catch(_0x113de3){logger[_0xd20c('0x19')](_0x113de3);}return _0x725150[_0xd20c('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x40e9c6,_0x3e3397,_0x1e137e,_0x13e7a9){var _0xe2dcd1=util[_0xd20c('0x7c')](_0xd20c('0x7d'),ISPEECH_API,_0x3e3397,_0x1e137e,base64Encode(_0x40e9c6),_0x13e7a9?util['format'](_0xd20c('0x7e'),encodeURIComponent(_0x13e7a9)):_0xd20c('0x7f'));return uploadFile(_0xe2dcd1)['then'](function(_0x5c8531){return querystring['parse'](_0x5c8531);});};exports[_0xd20c('0x80')]=function(_0x3a9400,_0x278a59){return sestek[_0xd20c('0x81')](_0x3a9400,_0x278a59)[_0xd20c('0x38')](function(_0xbcaed4){logger[_0xd20c('0x1d')](JSON[_0xd20c('0x45')](_0xbcaed4));var _0x240553={'speech':_0xbcaed4[_0xd20c('0x82')],'action':_0xbcaed4[_0xd20c('0x83')]?_0xbcaed4[_0xd20c('0x83')][_0xd20c('0x84')]:undefined,'actiondata':_0xbcaed4[_0xd20c('0x83')]?_0xbcaed4[_0xd20c('0x83')]['CustomActionData']:undefined};if(_0xbcaed4['channelData']&&_0xbcaed4['channelData']['AudioFromTts']){return base64Decode(_0xbcaed4[_0xd20c('0x83')][_0xd20c('0x85')]['Data'],path[_0xd20c('0x39')](__dirname,_0xd20c('0x3a'),rs['generate'](0x4)+_0xd20c('0x3f')))[_0xd20c('0x38')](function(_0x25b3b7){_0x240553[_0xd20c('0x86')]=_0x25b3b7;return _0x240553;});}return _0x240553;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x93f7=['freeform=3','sestekNDA','nda','text','CustomAction','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','info','finish\x20download\x20file','close','download\x20error','path','end','transcode','finish\x20to\x20convert','resolve','generate','.wav','writeFileSync','unlink','chmodSync','777','base64','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','.mp3','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','data','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','replace','SessionsClient','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s'];(function(_0x288799,_0x275c7){var _0x271e63=function(_0x3bbe5a){while(--_0x3bbe5a){_0x288799['push'](_0x288799['shift']());}};_0x271e63(++_0x275c7);}(_0x93f7,0x191));var _0x793f=function(_0x50f091,_0x29afec){_0x50f091=_0x50f091-0x0;var _0x2fb348=_0x93f7[_0x50f091];return _0x2fb348;};'use strict';var apiai=require(_0x793f('0x0'));var BPromise=require(_0x793f('0x1'));var dialogflow=require(_0x793f('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require('md5');var path=require('path');var querystring=require(_0x793f('0x3'));var rp=require(_0x793f('0x4'));var rs=require(_0x793f('0x5'));var sox=require(_0x793f('0x6'));var tts=require(_0x793f('0x7'));var urlParse=require(_0x793f('0x8'))[_0x793f('0x9')];var util=require(_0x793f('0xa'));var aws=require(_0x793f('0xb'));var google=require('./google');var sestek=require(_0x793f('0xc'));var tilde=require(_0x793f('0xd'));var logger=require(_0x793f('0xe'))('agi');var ISPEECH_API=_0x793f('0xf');function downloadFile(_0x34cc99,_0x1af5c9){return new BPromise(function(_0x37507c,_0x23c50c){var _0x4437a4=urlParse(_0x34cc99);var _0x2a9615=_0x4437a4[_0x793f('0x10')]===_0x793f('0x11')?https:http;var _0x67857a={'host':_0x4437a4[_0x793f('0x12')],'path':_0x4437a4['path'],'headers':{'user-agent':_0x793f('0x13')}};_0x2a9615[_0x793f('0x14')](_0x67857a,function(_0x42d8cd){if(_0x42d8cd[_0x793f('0x15')]!==0xc8){logger[_0x793f('0x16')](_0x793f('0x17')+_0x34cc99+'\x20failed,\x20status\x20code\x20=\x20'+_0x42d8cd['statusCode']+'\x20('+_0x42d8cd[_0x793f('0x18')]+')');_0x23c50c(new Error(_0x793f('0x17')+_0x34cc99+'\x20failed,\x20status\x20code\x20=\x20'+_0x42d8cd[_0x793f('0x15')]+'\x20('+_0x42d8cd[_0x793f('0x18')]+')'));return;}var _0x23266d=fs['createWriteStream'](_0x1af5c9);_0x23266d['on']('finish',function(){logger[_0x793f('0x19')](_0x793f('0x1a'));_0x23266d[_0x793f('0x1b')](_0x37507c);});_0x23266d['on']('error',function(_0x7b8520){fs['unlink'](_0x1af5c9);logger[_0x793f('0x16')](_0x793f('0x1c'),_0x7b8520);_0x23c50c(_0x7b8520);});_0x42d8cd['pipe'](_0x23266d);})['on'](_0x793f('0x16'),function(_0x49e77b){logger[_0x793f('0x16')](_0x49e77b);_0x23c50c(_0x49e77b);})['end']();});}function uploadFile(_0x9a1949){return new BPromise(function(_0x174cd7,_0x45c50f){var _0x16a233=urlParse(_0x9a1949);var _0x165957=_0x16a233[_0x793f('0x10')]===_0x793f('0x11')?https:http;var _0x435632={'host':_0x16a233['host'],'path':_0x16a233[_0x793f('0x1d')],'headers':{'user-agent':'WHAT_EVER'}};_0x165957['get'](_0x435632,function(_0x3bca7b){if(_0x3bca7b[_0x793f('0x15')]!==0xc8){_0x45c50f(new Error(_0x793f('0x17')+_0x9a1949+'\x20failed,\x20status\x20code\x20=\x20'+_0x3bca7b['statusCode']+'\x20('+_0x3bca7b[_0x793f('0x18')]+')'));return;}var _0x24431e='';_0x3bca7b['on']('data',function(_0xeaf805){_0x24431e+=_0xeaf805;});_0x3bca7b['on']('end',function(){_0x174cd7(_0x24431e);});})['on'](_0x793f('0x16'),function(_0x512ebe){_0x45c50f(_0x512ebe);})[_0x793f('0x1e')]();});}function convertFile(_0xc3ed7c,_0x21988c){return new BPromise(function(_0x549164,_0x2ae24f){var _0x94a367=sox[_0x793f('0x1f')](_0xc3ed7c,_0x21988c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x94a367['on'](_0x793f('0x16'),function(_0x2cbafe){logger[_0x793f('0x16')]('error\x20convert',_0x2cbafe);_0x2ae24f(_0x2cbafe);});_0x94a367['on'](_0x793f('0x1e'),function(){logger[_0x793f('0x19')](_0x793f('0x20'));_0x549164();});_0x94a367['start']();});}function base64Decode(_0x4b89fb,_0x326aba){var _0x478a9e=path[_0x793f('0x21')](__dirname,'tmp',rs[_0x793f('0x22')](0x4)+_0x793f('0x23'));fs[_0x793f('0x24')](_0x478a9e,_0x4b89fb,'base64');return convertFile(_0x478a9e,_0x326aba)['then'](function(){try{fs[_0x793f('0x25')](_0x478a9e);fs[_0x793f('0x26')](_0x326aba,_0x793f('0x27'));}catch(_0x1625e0){logger[_0x793f('0x16')](_0x1625e0);}return _0x326aba['split']('.')[0x0];});}function base64Encode(_0x10d518){var _0xd69f8d=fs['readFileSync'](_0x10d518);return new Buffer(_0xd69f8d)['toString'](_0x793f('0x28'));}exports['googleCloudTTS']=function(_0x10a93f,_0x2b34d9,_0x453b96,_0x3ed815,_0x5808a7,_0x2a7791){var _0x358b41,_0x588def;var _0x31f73c='https://texttospeech.googleapis.com/v1/';var _0x4f1233=_0x793f('0x29')+_0x10a93f;var _0x144b28={};if(_0x2b34d9===_0x793f('0x2a')){_0x144b28['input']={'ssml':_0x453b96};}else{_0x144b28[_0x793f('0x2b')]={'text':_0x453b96};};_0x144b28[_0x793f('0x2c')]={'languageCode':_0x3ed815,'ssmlGender':_0x5808a7};_0x144b28[_0x793f('0x2d')]={'audioEncoding':_0x793f('0x2e'),'sampleRateHertz':0x1f40};var _0x2d6ff8={'url':_0x31f73c+_0x793f('0x2f')+_0x4f1233,'method':_0x793f('0x30'),'json':!![],'body':_0x144b28};return rp(_0x2d6ff8)[_0x793f('0x31')](function(_0x2082e6){return new BPromise(function(_0x267ce2,_0x53817a){_0x358b41=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs['generate'](0x4)+_0x793f('0x33'));var _0x48a742=Buffer['from'](_0x2082e6[_0x793f('0x34')],_0x793f('0x28'));return fs[_0x793f('0x35')](_0x358b41,_0x48a742,function(_0x19845b){_0x53817a(_0x19845b);},function(_0x13a0fd){fs[_0x793f('0x26')](_0x358b41,_0x793f('0x27'));_0x267ce2(_0x13a0fd);});});})[_0x793f('0x31')](function(_0x20b861){_0x588def=path['resolve'](__dirname,_0x793f('0x32'),rs['generate'](0x4)+_0x793f('0x23'));return convertFile(_0x358b41,_0x588def);})[_0x793f('0x31')](function(){try{fs[_0x793f('0x25')](_0x358b41);fs['chmodSync'](_0x588def,_0x793f('0x27'));}catch(_0x4f5431){logger['error'](_0x4f5431);}logger[_0x793f('0x19')](_0x793f('0x36'),_0x588def[_0x793f('0x37')]('.')[0x0]);return _0x588def['split']('.')[0x0];});};exports[_0x793f('0x38')]=function(_0x23e020,_0x98724b){var _0x210833='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x555af2,_0x190498;var _0x3d4395;var _0x1fa19c={'encoding':_0x793f('0x39'),'method':_0x793f('0x30'),'timeout':0x2710,'url':_0x210833,'headers':{'Content-Type':_0x793f('0x3a')},'body':_0x793f('0x3b')+encodeURIComponent(JSON[_0x793f('0x3c')]([[[_0x793f('0x3d'),JSON[_0x793f('0x3c')]([_0x23e020,_0x98724b||'en',![],'null']),null,_0x793f('0x3e')]]]))};return rp(_0x1fa19c)['then'](function(_0x76948d){try{_0x3d4395=eval(_0x76948d[_0x793f('0x3f')](0x5))[0x0][0x2];}catch(_0x672a7d){throw new Error('parse\x20response\x20failed:\x0a'+_0x76948d['data']);}if(!_0x3d4395){if(_0x23e020['length']>0xc8){throw new Error(_0x793f('0x40'));}else{throw new Error(_0x793f('0x41')+_0x98724b+_0x793f('0x42'));}}try{_0x3d4395=eval(_0x3d4395)[0x0];}catch(_0x1a0d9d){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x793f('0x43')]);}const _0x3ca180=_0x3d4395;_0x555af2=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs[_0x793f('0x22')](0x4)+_0x793f('0x33'));fs[_0x793f('0x24')](_0x555af2,_0x3d4395,{'encoding':_0x793f('0x28')});_0x190498=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs[_0x793f('0x22')](0x4)+'.wav');return convertFile(_0x555af2,_0x190498);})[_0x793f('0x31')](function(){try{fs['unlink'](_0x555af2);fs[_0x793f('0x26')](_0x190498,_0x793f('0x27'));}catch(_0x3506c1){logger[_0x793f('0x16')](_0x3506c1);}logger[_0x793f('0x19')](_0x793f('0x44'),_0x190498[_0x793f('0x37')]('.')[0x0]);return _0x190498[_0x793f('0x37')]('.')[0x0];});};exports[_0x793f('0x45')]=function(_0x59cc8e,_0x2fa6e1,_0xcd8fe1){return google[_0x793f('0x46')](_0x59cc8e,_0x2fa6e1,_0xcd8fe1)[_0x793f('0x31')](function(_0x3d2215){logger[_0x793f('0x19')](_0x3d2215[_0x793f('0x47')]);return rp(_0x3d2215);})['then'](function(_0x386ac8){var _0x568a5f='';var _0x56db3e=0x0;try{fs[_0x793f('0x25')](_0x59cc8e);}catch(_0x4f755a){logger[_0x793f('0x16')](_0x4f755a);}if(_0x386ac8&&_0x386ac8[_0x793f('0x48')]){_0x568a5f=_0x386ac8[_0x793f('0x48')][_0x793f('0x49')](function(_0x3fd19d){return _0x3fd19d&&_0x3fd19d['alternatives'][0x0]&&_0x3fd19d['alternatives'][0x0]['transcript']?_0x3fd19d[_0x793f('0x4a')][0x0]['transcript']:'';})[_0x793f('0x4b')]('\x0a');_0x56db3e=_0x386ac8[_0x793f('0x48')]['map'](function(_0xec67de){return _0xec67de&&_0xec67de[_0x793f('0x4a')][0x0]&&_0xec67de['alternatives'][0x0][_0x793f('0x4c')]?_0xec67de[_0x793f('0x4a')][0x0]['confidence']:0x0;})[_0x793f('0x4b')]('\x0a');}logger['info']('googleASR\x20transcription',_0x568a5f);logger[_0x793f('0x19')](_0x793f('0x4d'),_0x56db3e);return{'transcript':_0x568a5f,'confidence':_0x56db3e};})[_0x793f('0x4e')](function(_0x30cb6c){logger[_0x793f('0x16')](_0x793f('0x4f'),_0x30cb6c['statusCode'],_0x30cb6c[_0x793f('0x50')],_0x30cb6c[_0x793f('0x51')]);});};exports['googleDialogflow']=function(_0x35f61b,_0x5e5299,_0x25b402,_0x1da7c5){var _0xdcf7aa=apiai(_0x5e5299,{'language':_0x1da7c5||'en'});return _0xdcf7aa[_0x793f('0x52')](_0x25b402,{'sessionId':md5(_0x35f61b)})[_0x793f('0x31')](function(_0x4f9a72){logger[_0x793f('0x19')](JSON['stringify'](_0x4f9a72));return{'source':_0x4f9a72['result'][_0x793f('0x53')],'resolvedQuery':_0x4f9a72[_0x793f('0x54')][_0x793f('0x55')],'action':_0x4f9a72['result'][_0x793f('0x56')],'actionIncomplete':_0x4f9a72[_0x793f('0x54')][_0x793f('0x57')],'speech':_0x4f9a72[_0x793f('0x54')][_0x793f('0x58')][_0x793f('0x59')],'score':_0x4f9a72[_0x793f('0x54')][_0x793f('0x5a')],'statusCode':_0x4f9a72[_0x793f('0x5b')][_0x793f('0x5c')],'endConversation':_0x4f9a72[_0x793f('0x54')][_0x793f('0x5d')][_0x793f('0x5e')]||![],'isFallbackIntent':_0x4f9a72[_0x793f('0x54')][_0x793f('0x5d')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x252923,_0x7b2800,_0x3203aa,_0x179040,_0x23af21,_0x1798f9){var _0x56314f=_0x179040[_0x793f('0x5f')](/\\n/g,'\x0a');var _0x3d9b92={'credentials':{'private_key':_0x56314f,'client_email':_0x3203aa}};var _0x438def=new dialogflow[(_0x793f('0x60'))](_0x3d9b92);var _0x116cc8=_0x438def['sessionPath'](_0x7b2800,md5(_0x252923));var _0x38d86b={'session':_0x116cc8,'queryInput':{'text':{'text':_0x23af21,'languageCode':_0x1798f9}}};return _0x438def[_0x793f('0x61')](_0x38d86b)['then'](function(_0x320ba2){if(_0x320ba2&&_0x320ba2[_0x793f('0x62')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x793f('0x3c')](_0x320ba2));var _0x3c2733=_0x320ba2[0x0];if(_0x3c2733){var _0x2b9289={'action':_0x3c2733[_0x793f('0x63')][_0x793f('0x56')],'allRequiredParamsPresent':_0x3c2733[_0x793f('0x63')]['allRequiredParamsPresent'],'endConversation':_0x3c2733['queryResult'][_0x793f('0x64')]&&_0x3c2733[_0x793f('0x63')][_0x793f('0x64')][_0x793f('0x65')]?_0x3c2733[_0x793f('0x63')][_0x793f('0x64')][_0x793f('0x65')][_0x793f('0x66')]['boolValue']:![],'fulfillmentText':_0x3c2733[_0x793f('0x63')][_0x793f('0x67')],'intentName':_0x3c2733[_0x793f('0x63')][_0x793f('0x68')][_0x793f('0x50')],'intentDisplayName':_0x3c2733['queryResult'][_0x793f('0x68')][_0x793f('0x69')],'isFallbackIntent':_0x3c2733[_0x793f('0x63')][_0x793f('0x68')][_0x793f('0x6a')],'languageCode':_0x3c2733[_0x793f('0x63')][_0x793f('0x6b')],'queryText':_0x3c2733['queryResult'][_0x793f('0x6c')],'responseId':_0x3c2733['responseId'],'score':_0x3c2733['queryResult']['intentDetectionConfidence'],'speech':_0x3c2733[_0x793f('0x63')][_0x793f('0x67')],'providerResponse':JSON[_0x793f('0x3c')](_0x320ba2)};return _0x2b9289;}}});};exports['tildeASR']=function(_0x39267e,_0x1751f7,_0x238a1b,_0x2f2a52){return tilde[_0x793f('0x46')](_0x39267e,_0x1751f7,_0x238a1b,_0x2f2a52)['then'](function(_0x11b3f0){try{fs[_0x793f('0x25')](_0x39267e);}catch(_0x509b38){logger[_0x793f('0x16')](_0x509b38);}logger[_0x793f('0x19')](_0x793f('0x6d'),_0x11b3f0[_0x793f('0x6e')]);logger['info'](_0x793f('0x6f'),_0x11b3f0[_0x793f('0x4c')]);return _0x11b3f0;});};exports[_0x793f('0x70')]=function(_0x1017f5,_0x13064f,_0x5e16ed,_0x50799f,_0x242420,_0x2f73c9){var _0x4a599f=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs[_0x793f('0x22')](0x4)+_0x793f('0x33'));var _0x4a1cac;return aws['polly'](_0x1017f5,_0x13064f,_0x5e16ed,_0x50799f,_0x242420,_0x2f73c9,_0x4a599f)[_0x793f('0x31')](function(){_0x4a1cac=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs[_0x793f('0x22')](0x4)+_0x793f('0x23'));return convertFile(_0x4a599f,_0x4a1cac);})[_0x793f('0x31')](function(){try{fs[_0x793f('0x25')](_0x4a599f);fs['chmodSync'](_0x4a1cac,_0x793f('0x27'));}catch(_0x564c36){logger[_0x793f('0x16')](_0x564c36);}return _0x4a1cac[_0x793f('0x37')]('.')[0x0];});};exports['awsLex']=function(_0x2adb2f,_0x187446,_0x398de0,_0x436bce,_0x5acfa0,_0x28dbe5){return aws[_0x793f('0x71')](_0x2adb2f,_0x187446,_0x398de0,_0x436bce,_0x5acfa0,_0x28dbe5)['then'](function(_0x156197){logger[_0x793f('0x19')](JSON[_0x793f('0x3c')](_0x156197));return _0x156197;});};exports[_0x793f('0x72')]=function(_0x4f1f68,_0x1522f1,_0x4ab167,_0x34a804){var _0x46c8d8=util[_0x793f('0x73')](_0x793f('0x74'),ISPEECH_API,_0x4f1f68,encodeURIComponent(_0x1522f1),_0x4ab167,_0x34a804);var _0x30ffd0=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs[_0x793f('0x22')](0x4)+_0x793f('0x33'));var _0x278cc7;return downloadFile(_0x46c8d8,_0x30ffd0)[_0x793f('0x31')](function(){_0x278cc7=path[_0x793f('0x21')](__dirname,_0x793f('0x32'),rs['generate'](0x4)+_0x793f('0x23'));return convertFile(_0x30ffd0,_0x278cc7);})[_0x793f('0x31')](function(){try{fs['unlink'](_0x30ffd0);fs[_0x793f('0x26')](_0x278cc7,_0x793f('0x27'));}catch(_0x5b1290){logger[_0x793f('0x16')](_0x5b1290);}return _0x278cc7[_0x793f('0x37')]('.')[0x0];});};exports[_0x793f('0x75')]=function(_0x40c0b0,_0x37a1b6,_0x513ba4,_0x4d0270){var _0x140434=util['format'](_0x793f('0x76'),ISPEECH_API,_0x37a1b6,_0x513ba4,base64Encode(_0x40c0b0),_0x4d0270?util[_0x793f('0x73')]('model=%s',encodeURIComponent(_0x4d0270)):_0x793f('0x77'));return uploadFile(_0x140434)['then'](function(_0x485eb1){return querystring[_0x793f('0x9')](_0x485eb1);});};exports[_0x793f('0x78')]=function(_0x1f1020,_0x484af2){return sestek[_0x793f('0x79')](_0x1f1020,_0x484af2)[_0x793f('0x31')](function(_0x55c9ed){logger[_0x793f('0x19')](JSON['stringify'](_0x55c9ed));var _0x341685={'speech':_0x55c9ed[_0x793f('0x7a')],'action':_0x55c9ed['channelData']?_0x55c9ed['channelData'][_0x793f('0x7b')]:undefined,'actiondata':_0x55c9ed[_0x793f('0x7c')]?_0x55c9ed[_0x793f('0x7c')][_0x793f('0x7d')]:undefined};if(_0x55c9ed['channelData']&&_0x55c9ed[_0x793f('0x7c')]['AudioFromTts']){return base64Decode(_0x55c9ed['channelData'][_0x793f('0x7e')][_0x793f('0x7f')],path[_0x793f('0x21')](__dirname,'tmp',rs[_0x793f('0x22')](0x4)+_0x793f('0x23')))[_0x793f('0x31')](function(_0xedcaca){_0x341685[_0x793f('0x80')]=_0xedcaca;return _0x341685;});}return _0x341685;});};exports[_0x793f('0x81')]=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 b2f8bdc..8d4fb27 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 _0xcff4=['exports','./nda'];(function(_0x59c774,_0x28d516){var _0x4067d6=function(_0x2b78c3){while(--_0x2b78c3){_0x59c774['push'](_0x59c774['shift']());}};_0x4067d6(++_0x28d516);}(_0xcff4,0x1cf));var _0x4cff=function(_0x21d01a,_0x55f706){_0x21d01a=_0x21d01a-0x0;var _0x981991=_0xcff4[_0x21d01a];return _0x981991;};var nda=require(_0x4cff('0x0'));module[_0x4cff('0x1')]={'nda':nda}; \ No newline at end of file +var _0x2fcd=['exports','./nda'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x2fcd,0x1eb));var _0xd2fc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2fcd[_0x17d9e3];return _0x14192d;};var nda=require(_0xd2fc('0x0'));module[_0xd2fc('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 2af35b7..14ad96f 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 _0x9aea=['custom_action','CustomAction','custom_action_data','CustomActionData','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x45e604,_0x58a542){var _0x4948f8=function(_0x47a93e){while(--_0x47a93e){_0x45e604['push'](_0x45e604['shift']());}};_0x4948f8(++_0x58a542);}(_0x9aea,0xdd));var _0xa9ae=function(_0x205647,_0x57d3d0){_0x205647=_0x205647-0x0;var _0x46c644=_0x9aea[_0x205647];return _0x46c644;};'use strict';var rp=require(_0xa9ae('0x0'));var url=require('url');var logger=require(_0xa9ae('0x1'))('agi');module[_0xa9ae('0x2')]=function(_0x13679e,_0x563a24){var _0x414638={'method':_0xa9ae('0x3'),'uri':url[_0xa9ae('0x4')](_0x563a24[_0xa9ae('0x5')],_0xa9ae('0x6')),'form':{'grant_type':'password','username':_0x563a24[_0xa9ae('0x7')],'password':_0x563a24[_0xa9ae('0x8')]},'json':!![]};return rp(_0x414638)[_0xa9ae('0x9')](function(_0x53e52c){var _0x1f2e4b={'method':_0xa9ae('0x3'),'uri':url[_0xa9ae('0x4')](_0x563a24[_0xa9ae('0xa')],_0xa9ae('0xb')),'body':{'type':_0x563a24[_0xa9ae('0xc')]||_0xa9ae('0xd'),'channelId':_0xa9ae('0xe'),'conversation':{'id':_0x13679e[_0xa9ae('0xf')]},'from':{'id':_0x13679e['callerid'],'name':_0x13679e[_0xa9ae('0x10')]},'recipient':{'id':_0x13679e['dnid'],'name':_0x13679e[_0xa9ae('0x11')]},'text':_0x563a24[_0xa9ae('0x12')],'channelData':{}},'headers':{'Authorization':_0xa9ae('0x13')+_0x53e52c[_0xa9ae('0x14')]},'json':!![]};if(_0x563a24[_0xa9ae('0x15')]){_0x1f2e4b[_0xa9ae('0x16')][_0xa9ae('0x17')][_0xa9ae('0x18')]=_0x563a24['project'];}if(_0x563a24[_0xa9ae('0x19')]=='1'){_0x1f2e4b[_0xa9ae('0x16')][_0xa9ae('0x17')][_0xa9ae('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x563a24[_0xa9ae('0x1b')]){_0x1f2e4b[_0xa9ae('0x16')][_0xa9ae('0x17')][_0xa9ae('0x1c')]=_0x563a24[_0xa9ae('0x1b')];if(_0x563a24[_0xa9ae('0x1d')]){_0x1f2e4b['body'][_0xa9ae('0x17')][_0xa9ae('0x1e')]=_0x563a24[_0xa9ae('0x1d')];}}logger['info'](JSON['stringify'](_0x1f2e4b));return rp(_0x1f2e4b);});}; \ No newline at end of file +var _0xc0d6=['/token','password','ndassistant_url','ndaactivity_type','message','uniqueid','callerid','text','Bearer\x20','access_token','project','ProjectName','ndagenerate_audio','body','channelData','audio/wav','custom_action','custom_action_data','info','stringify','url','agi','exports','POST','resolve','ndauth_url'];(function(_0x10e1ce,_0x1f28eb){var _0x5be2ea=function(_0x31904a){while(--_0x31904a){_0x10e1ce['push'](_0x10e1ce['shift']());}};_0x5be2ea(++_0x1f28eb);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x32da82,_0x339097){_0x32da82=_0x32da82-0x0;var _0x1876f2=_0xc0d6[_0x32da82];return _0x1876f2;};'use strict';var rp=require('request-promise');var url=require(_0x6c0d('0x0'));var logger=require('../../../../../config/logger')(_0x6c0d('0x1'));module[_0x6c0d('0x2')]=function(_0x83bbbc,_0xa6bfd8){var _0x22bb65={'method':_0x6c0d('0x3'),'uri':url[_0x6c0d('0x4')](_0xa6bfd8[_0x6c0d('0x5')],_0x6c0d('0x6')),'form':{'grant_type':_0x6c0d('0x7'),'username':_0xa6bfd8['username'],'password':_0xa6bfd8['password']},'json':!![]};return rp(_0x22bb65)['then'](function(_0x987707){var _0x266f0c={'method':_0x6c0d('0x3'),'uri':url[_0x6c0d('0x4')](_0xa6bfd8[_0x6c0d('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0xa6bfd8[_0x6c0d('0x9')]||_0x6c0d('0xa'),'channelId':'Nda','conversation':{'id':_0x83bbbc[_0x6c0d('0xb')]},'from':{'id':_0x83bbbc[_0x6c0d('0xc')],'name':_0x83bbbc['calleridname']},'recipient':{'id':_0x83bbbc['dnid'],'name':_0x83bbbc['extension']},'text':_0xa6bfd8[_0x6c0d('0xd')],'channelData':{}},'headers':{'Authorization':_0x6c0d('0xe')+_0x987707[_0x6c0d('0xf')]},'json':!![]};if(_0xa6bfd8[_0x6c0d('0x10')]){_0x266f0c['body']['channelData'][_0x6c0d('0x11')]=_0xa6bfd8['project'];}if(_0xa6bfd8[_0x6c0d('0x12')]=='1'){_0x266f0c[_0x6c0d('0x13')][_0x6c0d('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6c0d('0x15')};}if(_0xa6bfd8[_0x6c0d('0x16')]){_0x266f0c['body']['channelData']['CustomAction']=_0xa6bfd8[_0x6c0d('0x16')];if(_0xa6bfd8[_0x6c0d('0x17')]){_0x266f0c[_0x6c0d('0x13')][_0x6c0d('0x14')]['CustomActionData']=_0xa6bfd8['custom_action_data'];}}logger[_0x6c0d('0x18')](JSON[_0x6c0d('0x19')](_0x266f0c));return rp(_0x266f0c);});}; \ 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 291e3f8..0aafd25 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 _0x0b52=['exports','./lib/api'];(function(_0x6a1f54,_0x278cd5){var _0x28b84a=function(_0x3d9f47){while(--_0x3d9f47){_0x6a1f54['push'](_0x6a1f54['shift']());}};_0x28b84a(++_0x278cd5);}(_0x0b52,0xb9));var _0x20b5=function(_0x39a56b,_0x46e82f){_0x39a56b=_0x39a56b-0x0;var _0x9c9af5=_0x0b52[_0x39a56b];return _0x9c9af5;};'use strict';var asr=require(_0x20b5('0x0'));module[_0x20b5('0x1')]=function(_0x5f5a19,_0x30623d,_0x14f8ad,_0x1dad00){return asr(_0x5f5a19,_0x30623d,_0x14f8ad,_0x1dad00);}; \ No newline at end of file +var _0x53a8=['./lib/api'];(function(_0x5772c5,_0xa72fa9){var _0x3c9151=function(_0x30a6c7){while(--_0x30a6c7){_0x5772c5['push'](_0x5772c5['shift']());}};_0x3c9151(++_0xa72fa9);}(_0x53a8,0xa5));var _0x853a=function(_0x287a3e,_0x1bc90f){_0x287a3e=_0x287a3e-0x0;var _0x3923a8=_0x53a8[_0x287a3e];return _0x3923a8;};'use strict';var asr=require(_0x853a('0x0'));module['exports']=function(_0x5d6ea4,_0x37a510,_0xf348c,_0x18f57c){return asr(_0x5d6ea4,_0x37a510,_0xf348c,_0x18f57c);}; \ 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 fc3aa64..81988a9 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 _0x4639=['Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','Open\x20Tilde\x20ASR\x20socket','stringify','send','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x64c82a,_0x34e6dd){var _0x1574f7=function(_0x11fd61){while(--_0x11fd61){_0x64c82a['push'](_0x64c82a['shift']());}};_0x1574f7(++_0x34e6dd);}(_0x4639,0x1b9));var _0x9463=function(_0x30bf81,_0x4c00c5){_0x30bf81=_0x30bf81-0x0;var _0x148a30=_0x4639[_0x30bf81];return _0x148a30;};'use strict';var BPromise=require(_0x9463('0x0'));var _=require(_0x9463('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9463('0x2'));var crypto=require(_0x9463('0x3'));var logger=require(_0x9463('0x4'))('agi');module[_0x9463('0x5')]=function(_0x497152,_0xa99c24,_0x1ef9c7,_0x36ae8d){return new BPromise(function(_0x4f4baf,_0x32f219){logger[_0x9463('0x6')](_0x9463('0x7'),_0x36ae8d||_0x9463('0x8'));var _0x48d5b5=new WebSocket(_0x36ae8d||_0x9463('0x8'),{'perMessageDeflate':![]});var _0x437f73='';var _0x367b77='0';var _0x3de8aa='1';var _0x2b3a9a=_0x9463('0x9');function _0x452a39(_0x3d4f06){var _0x193032=crypto[_0x9463('0xa')](_0x9463('0xb'));_0x193032['update'](_0x3d4f06);return _0x193032['digest']('hex');}function _0x29c062(){try{logger['info'](_0x9463('0xc'));var _0xfc119d=moment()['unix']();var _0x1d0e6a=_0x452a39(_0xfc119d+_0xa99c24+_0x1ef9c7);_0x48d5b5['send'](JSON[_0x9463('0xd')]({'appID':_0xa99c24,'timestamp':_0xfc119d,'appKey':_0x1d0e6a}));var _0x13f6ee=fs['createReadStream'](_0x497152);_0x13f6ee['on']('data',function(_0x17d0cd){_0x48d5b5[_0x9463('0xe')](_0x17d0cd);});_0x13f6ee['on'](_0x9463('0xf'),function(){_0x48d5b5['send']('EOS');});}catch(_0x569d5c){logger['error'](_0x9463('0x10'),JSON[_0x9463('0xd')](_0x569d5c));_0x48d5b5[_0x9463('0x11')]();}}function _0x2b3cee(_0x4ab9e7){try{if(_0x4ab9e7){var _0xef3a7=JSON[_0x9463('0x12')](_0x4ab9e7);switch(_0xef3a7[_0x9463('0x13')]){case 0x0:if(_0xef3a7[_0x9463('0x14')]){if(_0xef3a7[_0x9463('0x14')][_0x9463('0x15')]){logger[_0x9463('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0x9463('0xd')](_0xef3a7['result'][_0x9463('0x16')]));_0x437f73=_0xef3a7[_0x9463('0x14')][_0x9463('0x16')][0x0][_0x9463('0x17')];_0x367b77=_0xef3a7[_0x9463('0x14')][_0x9463('0x16')][0x0]['likelihood'];_0x3de8aa='0';_0x2b3a9a=_0x9463('0x18');_0x48d5b5['terminate']();}}break;case 0x1:logger['info'](_0x9463('0x9'));_0x3de8aa='1';_0x2b3a9a=_0x9463('0x9');break;case 0x2:logger[_0x9463('0x6')](_0x9463('0x19'));_0x3de8aa='2';_0x2b3a9a=_0x9463('0x19');break;case 0x9:logger[_0x9463('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3de8aa='9';_0x2b3a9a=_0x9463('0x1a');break;case 0xa:logger[_0x9463('0x6')](_0x9463('0x1b'));_0x3de8aa='10';_0x2b3a9a=_0x9463('0x1b');break;case 0xb:logger[_0x9463('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3de8aa='11';_0x2b3a9a=_0x9463('0x1c');}}}catch(_0x1615c8){logger[_0x9463('0x1d')](_0x9463('0x1e'),JSON[_0x9463('0xd')](_0x1615c8));_0x48d5b5[_0x9463('0x11')]();}}function _0x3ac46b(){logger[_0x9463('0x6')](_0x9463('0x1f'));_0x4f4baf({'transcript':_0x437f73,'confidence':_0x367b77,'status':_0x3de8aa,'status_message':_0x2b3a9a});}function _0x78248c(_0x48a24a){logger[_0x9463('0x1d')](_0x9463('0x20'));if(!_[_0x9463('0x21')](_0x48a24a)){logger[_0x9463('0x1d')](_['isObject'](_0x48a24a)?JSON['stringify'](_0x48a24a):_0x48a24a);}}_0x48d5b5['on'](_0x9463('0x22'),_0x29c062);_0x48d5b5['on'](_0x9463('0x23'),_0x2b3cee);_0x48d5b5['on']('close',_0x3ac46b);_0x48d5b5['on']('error',_0x78248c);});}; \ No newline at end of file +var _0xd4c2=['Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','data','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','close','bluebird','lodash','moment','../../../../../../config/logger','agi','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd4c2,0x8e));var _0x2d4c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd4c2[_0x4a53d];return _0x27410e;};'use strict';var BPromise=require(_0x2d4c('0x0'));var _=require(_0x2d4c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2d4c('0x2'));var crypto=require('crypto');var logger=require(_0x2d4c('0x3'))(_0x2d4c('0x4'));module[_0x2d4c('0x5')]=function(_0x3098e5,_0x3e7c76,_0x290103,_0x563bae){return new BPromise(function(_0x5eda38,_0x25f299){logger['info'](_0x2d4c('0x6'),_0x563bae||_0x2d4c('0x7'));var _0xd18e20=new WebSocket(_0x563bae||_0x2d4c('0x7'),{'perMessageDeflate':![]});var _0x20c549='';var _0x3c92d7='0';var _0x42e2f6='1';var _0x10734e=_0x2d4c('0x8');function _0x38e6e7(_0x2d941d){var _0x5b7040=crypto[_0x2d4c('0x9')]('sha1');_0x5b7040[_0x2d4c('0xa')](_0x2d941d);return _0x5b7040['digest'](_0x2d4c('0xb'));}function _0x2520bf(){try{logger[_0x2d4c('0xc')](_0x2d4c('0xd'));var _0x464ed1=moment()[_0x2d4c('0xe')]();var _0x476c4d=_0x38e6e7(_0x464ed1+_0x3e7c76+_0x290103);_0xd18e20[_0x2d4c('0xf')](JSON['stringify']({'appID':_0x3e7c76,'timestamp':_0x464ed1,'appKey':_0x476c4d}));var _0x2339ba=fs['createReadStream'](_0x3098e5);_0x2339ba['on'](_0x2d4c('0x10'),function(_0x1173cb){_0xd18e20[_0x2d4c('0xf')](_0x1173cb);});_0x2339ba['on']('close',function(){_0xd18e20[_0x2d4c('0xf')]('EOS');});}catch(_0x14a902){logger[_0x2d4c('0x11')](_0x2d4c('0x12'),JSON[_0x2d4c('0x13')](_0x14a902));_0xd18e20[_0x2d4c('0x14')]();}}function _0x47e8b1(_0x87e055){try{if(_0x87e055){var _0x385f17=JSON[_0x2d4c('0x15')](_0x87e055);switch(_0x385f17['status']){case 0x0:if(_0x385f17['result']){if(_0x385f17[_0x2d4c('0x16')]['final']){logger['info'](_0x2d4c('0x17'),JSON['stringify'](_0x385f17[_0x2d4c('0x16')][_0x2d4c('0x18')]));_0x20c549=_0x385f17[_0x2d4c('0x16')][_0x2d4c('0x18')][0x0]['transcript'];_0x3c92d7=_0x385f17[_0x2d4c('0x16')][_0x2d4c('0x18')][0x0][_0x2d4c('0x19')];_0x42e2f6='0';_0x10734e=_0x2d4c('0x1a');_0xd18e20['terminate']();}}break;case 0x1:logger[_0x2d4c('0xc')](_0x2d4c('0x8'));_0x42e2f6='1';_0x10734e=_0x2d4c('0x8');break;case 0x2:logger[_0x2d4c('0xc')](_0x2d4c('0x1b'));_0x42e2f6='2';_0x10734e='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2d4c('0xc')](_0x2d4c('0x1c'));_0x42e2f6='9';_0x10734e=_0x2d4c('0x1c');break;case 0xa:logger[_0x2d4c('0xc')](_0x2d4c('0x1d'));_0x42e2f6='10';_0x10734e=_0x2d4c('0x1d');break;case 0xb:logger['info'](_0x2d4c('0x1e'));_0x42e2f6='11';_0x10734e='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x205445){logger[_0x2d4c('0x11')](_0x2d4c('0x1f'),JSON[_0x2d4c('0x13')](_0x205445));_0xd18e20['terminate']();}}function _0x1615e4(){logger['info'](_0x2d4c('0x20'));_0x5eda38({'transcript':_0x20c549,'confidence':_0x3c92d7,'status':_0x42e2f6,'status_message':_0x10734e});}function _0x4f935a(_0xa6f5eb){logger[_0x2d4c('0x11')](_0x2d4c('0x21'));if(!_[_0x2d4c('0x22')](_0xa6f5eb)){logger[_0x2d4c('0x11')](_['isObject'](_0xa6f5eb)?JSON[_0x2d4c('0x13')](_0xa6f5eb):_0xa6f5eb);}}_0xd18e20['on']('open',_0x2520bf);_0xd18e20['on'](_0x2d4c('0x23'),_0x47e8b1);_0xd18e20['on'](_0x2d4c('0x24'),_0x1615e4);_0xd18e20['on']('error',_0x4f935a);});}; \ 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 4988482..863e5eb 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 _0xd811=['./asr','exports'];(function(_0x4520c9,_0x578868){var _0x310387=function(_0x31f909){while(--_0x31f909){_0x4520c9['push'](_0x4520c9['shift']());}};_0x310387(++_0x578868);}(_0xd811,0x7e));var _0x1d81=function(_0x185832,_0x53aeea){_0x185832=_0x185832-0x0;var _0x253dda=_0xd811[_0x185832];return _0x253dda;};var asr=require(_0x1d81('0x0'));module[_0x1d81('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd6c3=['./asr','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd6c3,0x92));var _0x3d6c=function(_0x177a8d,_0x46261a){_0x177a8d=_0x177a8d-0x0;var _0x3a2b5b=_0xd6c3[_0x177a8d];return _0x3a2b5b;};var asr=require(_0x3d6c('0x0'));module[_0x3d6c('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5d59483..6bacf2d 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 _0x72e1=['127.0.0.1','call','emit','error','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','EventEmitter','./error','./channel'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x72e1,0x6d));var _0x172e=function(_0x62dd40,_0x5e0390){_0x62dd40=_0x62dd40-0x0;var _0x13d8be=_0x72e1[_0x62dd40];return _0x13d8be;};'use strict';var util=require(_0x172e('0x0'));var net=require(_0x172e('0x1'));var EventEmitter=require(_0x172e('0x2'))[_0x172e('0x3')];var AGIError=require(_0x172e('0x4'));var AGIChannel=require(_0x172e('0x5'));var AGIServer=function(_0x5a18a7,_0x2fde38,_0x25a850){var _0x5095f7=this,_0x5a18a7=_0x5a18a7||0x11dd,_0x2fde38=_0x2fde38||_0x172e('0x6'),_0x169818=null,_0xc4646f=0x0;EventEmitter[_0x172e('0x7')](_0x5095f7);function _0x3f47b7(){if(!_0x5a18a7){_0x5095f7[_0x172e('0x8')](_0x172e('0x9'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x169818=net[_0x172e('0xa')]();_0x169818[_0x172e('0xb')](_0x5a18a7,_0x2fde38);_0x169818['on']('listening',function(){_0x5095f7[_0x172e('0x8')](_0x172e('0xc'));});_0x169818['on'](_0x172e('0xd'),function(_0x2df67a){_0x169818['getConnections'](function(_0x2196df,_0x357e1b){if(_0x2196df){_0x5095f7[_0x172e('0x8')](_0x172e('0x9'),new AGIError(_0x172e('0xe'),_0x2196df));}else if(_0x25a850&&_0x25a850<0x0){_0x5095f7[_0x172e('0x8')]('error',new AGIError(_0x172e('0xf')));_0x2df67a[_0x172e('0x10')]();}else if(_0x25a850&&_0x25a850>0x0&&_0x25a850<_0x357e1b){_0xc4646f+=0x1;_0x5095f7[_0x172e('0x8')](_0x172e('0x9'),new AGIError(_0x172e('0x11'),_0xc4646f));_0x2df67a[_0x172e('0x10')]();}else{var _0x42be0f=new AGIChannel(_0x2df67a);_0x42be0f['on'](_0x172e('0x12'),function(){_0x5095f7[_0x172e('0x8')]('connection',_0x42be0f);});}});});_0x169818['on'](_0x172e('0x9'),function(_0x4a6e47){_0x5095f7[_0x172e('0x8')](_0x172e('0x9'),new AGIError(_0x172e('0xe'),_0x4a6e47[_0x172e('0x13')]));});_0x169818['on'](_0x172e('0x14'),function(){_0x5095f7[_0x172e('0x8')](_0x172e('0x14'),new AGIError(_0x172e('0x15')));});}process['nextTick'](function(){_0x3f47b7();});};util['inherits'](AGIServer,EventEmitter);module[_0x172e('0x16')]=function(_0x19d6ae,_0x162c6f,_0x5016b0){return new AGIServer(_0x19d6ae,_0x162c6f,_0x5016b0);}; \ No newline at end of file +var _0x0c9e=['emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_CLOSE','nextTick','util','events','EventEmitter','./error','error','createServer','listen','listening','connection'];(function(_0x32565f,_0x24510b){var _0x23a966=function(_0x1006bc){while(--_0x1006bc){_0x32565f['push'](_0x32565f['shift']());}};_0x23a966(++_0x24510b);}(_0x0c9e,0x17e));var _0xe0c9=function(_0x3e478a,_0x46580f){_0x3e478a=_0x3e478a-0x0;var _0x4c6cee=_0x0c9e[_0x3e478a];return _0x4c6cee;};'use strict';var util=require(_0xe0c9('0x0'));var net=require('net');var EventEmitter=require(_0xe0c9('0x1'))[_0xe0c9('0x2')];var AGIError=require(_0xe0c9('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x15622a,_0xf1c25b,_0x36f211){var _0x579927=this,_0x15622a=_0x15622a||0x11dd,_0xf1c25b=_0xf1c25b||'127.0.0.1',_0x2b652b=null,_0x2bf295=0x0;EventEmitter['call'](_0x579927);function _0xd0540c(){if(!_0x15622a){_0x579927['emit'](_0xe0c9('0x4'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x2b652b=net[_0xe0c9('0x5')]();_0x2b652b[_0xe0c9('0x6')](_0x15622a,_0xf1c25b);_0x2b652b['on']('listening',function(){_0x579927['emit'](_0xe0c9('0x7'));});_0x2b652b['on'](_0xe0c9('0x8'),function(_0x14e9d0){_0x2b652b['getConnections'](function(_0x73a2a9,_0x251878){if(_0x73a2a9){_0x579927[_0xe0c9('0x9')](_0xe0c9('0x4'),new AGIError(_0xe0c9('0xa'),_0x73a2a9));}else if(_0x36f211&&_0x36f211<0x0){_0x579927['emit'](_0xe0c9('0x4'),new AGIError(_0xe0c9('0xb')));_0x14e9d0[_0xe0c9('0xc')]();}else if(_0x36f211&&_0x36f211>0x0&&_0x36f211<_0x251878){_0x2bf295+=0x1;_0x579927[_0xe0c9('0x9')]('error',new AGIError(_0xe0c9('0xd'),_0x2bf295));_0x14e9d0['destroy']();}else{var _0x463e2a=new AGIChannel(_0x14e9d0);_0x463e2a['on'](_0xe0c9('0xe'),function(){_0x579927['emit'](_0xe0c9('0x8'),_0x463e2a);});}});});_0x2b652b['on'](_0xe0c9('0x4'),function(_0x56176e){_0x579927[_0xe0c9('0x9')](_0xe0c9('0x4'),new AGIError('E_AGI_SERVER_ERROR',_0x56176e['code']));});_0x2b652b['on']('close',function(){_0x579927[_0xe0c9('0x9')]('close',new AGIError(_0xe0c9('0xf')));});}process[_0xe0c9('0x10')](function(){_0xd0540c();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x22c49a,_0x583efd,_0x5381b1){return new AGIServer(_0x22c49a,_0x583efd,_0x5381b1);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 020ed90..abd331b 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 _0x2830=['MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','getData','digit','output','pause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_MESSAGE','statusMessage','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','start','yes','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','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','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','prototype','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','uniqueid','label','agicommand','arg_1','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','dialTimezone','CALLERID(dialTimezone)','timezones','utcOffset','scheduledat','add','insertContact','minutes','getPause','agentPause','agent','callerid','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','headers','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','%s.%s','length','saveRestApiResult','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','createSquareDetailsReport','sync','retry','maxRetry','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()'];(function(_0x4fdd64,_0x4ec5d4){var _0x1e9ae1=function(_0x60bf04){while(--_0x60bf04){_0x4fdd64['push'](_0x4fdd64['shift']());}};_0x1e9ae1(++_0x4ec5d4);}(_0x2830,0x117));var _0x0283=function(_0x25588a,_0x159564){_0x25588a=_0x25588a-0x0;var _0x13fe3a=_0x2830[_0x25588a];return _0x13fe3a;};'use strict';var fs=require('fs');var path=require(_0x0283('0x0'));var util=require(_0x0283('0x1'));var _=require(_0x0283('0x2'));var sh=require(_0x0283('0x3'));var odbc=require(_0x0283('0x4'))();var rs=require(_0x0283('0x5'));var moment=require(_0x0283('0x6'));var Mustache=require('mustache');var rp=require(_0x0283('0x7'));var logger=require('../../config/logger')(_0x0283('0x8'));var config=require(_0x0283('0x9'));var shared=require(_0x0283('0xa'));var scripts=require(_0x0283('0xb'));var FILES_PATH=_0x0283('0xc');var recursiveMapAttributes=[_0x0283('0xd'),_0x0283('0xe')];var verticesWithRetry=['menu',_0x0283('0xf'),_0x0283('0x10')];var AGIVertices=function(_0x1f0d10,_0x3a25f8,_0x27bf23){this[_0x0283('0x11')]=_0x1f0d10;this[_0x0283('0x12')]=_0x3a25f8;this[_0x0283('0x13')]=_0x27bf23;};AGIVertices['prototype'][_0x0283('0x14')]=function(_0x3cff0c,_0x1d77cc){this[_0x0283('0x12')][_0x0283('0x15')](_0x3cff0c)[_0x0283('0x16')](function(_0xccfdc8){_0x1d77cc(null,_0xccfdc8?_0xccfdc8['name']:![]);})[_0x0283('0x17')](function(_0x5cd101){_0x1d77cc(_0x5cd101);});};AGIVertices['prototype'][_0x0283('0x18')]=function(_0x3d05c4,_0x3e8141){this[_0x0283('0x12')][_0x0283('0x19')](_0x3d05c4)['then'](function(_0x566e68){_0x3e8141(null,_0x566e68?_0x566e68['name']:![]);})[_0x0283('0x17')](function(_0x414d92){_0x3e8141(_0x414d92);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x1b')]=function(_0x2a801b,_0x282fac){this[_0x0283('0x12')][_0x0283('0x1c')](_0x2a801b)[_0x0283('0x16')](function(_0x26f1c5){_0x282fac(null,_0x26f1c5?_0x26f1c5[_0x0283('0x1d')]:![]);})['catch'](function(_0x3bbb8c){_0x282fac(_0x3bbb8c);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x1e')]=function(_0x475acc,_0x1f12b5){this['rpc'][_0x0283('0x1f')](_0x475acc)[_0x0283('0x16')](function(_0x44f137){_0x1f12b5(null,_0x44f137?_0x44f137[_0x0283('0x20')]:![]);})[_0x0283('0x17')](function(_0x35952b){_0x1f12b5(_0x35952b);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x21')]=function(_0x4e2822,_0x17f52e){this[_0x0283('0x12')]['getUserById'](_0x4e2822)[_0x0283('0x16')](function(_0x4206e3){_0x17f52e(null,_0x4206e3?_0x4206e3[_0x0283('0x1d')]:![]);})[_0x0283('0x17')](function(_0x2138c1){_0x17f52e(_0x2138c1);});};AGIVertices['prototype']['getTrunk']=function(_0x3d73c0,_0x458787){this[_0x0283('0x12')][_0x0283('0x22')](_0x3d73c0)[_0x0283('0x16')](function(_0x209c1f){_0x458787(null,_0x209c1f?_0x209c1f['name']:![]);})[_0x0283('0x17')](function(_0x3c16db){_0x458787(_0x3c16db);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x23')]=function(_0x5ce2da,_0x24c124){var _0x115283=this;this[_0x0283('0x12')]['getSoundById'](_0x5ce2da)[_0x0283('0x16')](function(_0x7bf1e3){_0x24c124(null,_0x7bf1e3?_0x115283[_0x0283('0x24')](_0x7bf1e3[_0x0283('0x25')]):![]);})['catch'](function(_0x5743ce){_0x24c124(_0x5743ce);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x26')]=function(_0x45de1f,_0xcc53b2){this['rpc'][_0x0283('0x27')](_0x45de1f)['then'](function(_0x4ce58e){_0xcc53b2(null,_0x4ce58e?_0x4ce58e:![]);})[_0x0283('0x17')](function(_0x405649){_0xcc53b2(_0x405649);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x28')]=function(_0x8063c7,_0x1e0440,_0xab03e9){this[_0x0283('0x13')]['sendMailMessage'](_0x8063c7,_0x1e0440)['then'](function(){_0xab03e9(null);})[_0x0283('0x17')](function(_0x43cb59){_0xab03e9(_0x43cb59);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x29')]=function(_0x380b8a,_0xc269db){this[_0x0283('0x12')][_0x0283('0x2a')](_0x380b8a)['then'](function(_0x56bbba){if(_0x56bbba){if(_0x56bbba[_0x0283('0x2b')]){_0xc269db(null,[_0x56bbba[_0x0283('0x2c')]]);}else{_0xc269db(null,_[_0x0283('0x2d')](_0x56bbba['Intervals'],_0x0283('0x2c')));}}else{_0xc269db(null,![]);}})['catch'](function(_0x4be411){_0xc269db(_0x4be411);});};AGIVertices['prototype'][_0x0283('0x24')]=function(_0x4e9437){return util['format'](_0x0283('0x2e'),FILES_PATH,_0x4e9437);};AGIVertices['prototype'][_0x0283('0x2f')]=function(_0x3c49c5,_0x158510,_0x221a97){odbc[_0x0283('0x30')](_0x3c49c5,function(_0x1a4ee8){if(_0x1a4ee8){logger[_0x0283('0x31')](_0x0283('0x32'),_0x1a4ee8);_0x221a97(_0x1a4ee8);}else{logger['info'](_0x0283('0x33'));odbc[_0x0283('0x34')](_0x158510,function(_0x5c4f49,_0x1ea3d9){if(_0x5c4f49){logger[_0x0283('0x35')](_0x0283('0x36'),_0x158510);_0x221a97(_0x5c4f49);}else{logger[_0x0283('0x35')](_0x0283('0x37'),_0x158510);odbc[_0x0283('0x38')](function(_0x358a6b){if(_0x358a6b){logger[_0x0283('0x31')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x358a6b);}_0x221a97(null,_0x1ea3d9);});}});}});};AGIVertices['prototype'][_0x0283('0x39')]=function(_0x3936f1,_0x636192){this[_0x0283('0x12')][_0x0283('0x3a')](_0x3936f1)[_0x0283('0x16')](function(_0x3786f3){_0x636192(null,_0x3786f3?_0x3786f3:![]);})[_0x0283('0x17')](function(_0x5bf2a0){_0x636192(_0x5bf2a0);});};AGIVertices['prototype'][_0x0283('0x3b')]=function(_0x4d5443,_0x571ae8){this[_0x0283('0x12')][_0x0283('0x3b')](_0x4d5443)[_0x0283('0x16')](function(_0x492135){_0x571ae8(null,_0x492135);})[_0x0283('0x17')](function(_0x5914f5){_0x571ae8(_0x5914f5);});};AGIVertices[_0x0283('0x1a')]['createSquareDetailsReport']=function(_0x19c0e6,_0x2b3ac6,_0x16a71e){this[_0x0283('0x12')]['createSquareDetailsReport']({'uniqueid':this[_0x0283('0x11')][_0x0283('0x3c')],'node':_0x19c0e6[_0x0283('0x3d')],'application':_0x19c0e6[_0x0283('0x3e')],'data':_0x2b3ac6||null,'project_name':this['channel'][_0x0283('0x3f')],'callerid':this[_0x0283('0x11')]['callerid']})['then'](function(_0x3b285b){if(_0x16a71e){_0x16a71e(null,_0x3b285b);}})['catch'](function(_0x386521){if(_0x16a71e){_0x16a71e(_0x386521);}});};AGIVertices['prototype'][_0x0283('0x40')]=function(_0x1dfcbf,_0xed9b96,_0x451299,_0x4675e8){this[_0x0283('0x12')][_0x0283('0x40')]({'uniqueid':this[_0x0283('0x11')][_0x0283('0x3c')],'callerid':this[_0x0283('0x11')]['callerid'],'calleridname':this[_0x0283('0x11')]['calleridname'],'context':this[_0x0283('0x11')][_0x0283('0x41')],'extension':this['channel'][_0x0283('0x42')],'priority':this[_0x0283('0x11')][_0x0283('0x43')],'accountcode':this[_0x0283('0x11')][_0x0283('0x44')],'dnid':this[_0x0283('0x11')][_0x0283('0x45')],'projectName':this['channel']['arg_1'],'saveName':_0xed9b96,'filename':_0x1dfcbf[_0x0283('0x46')]||_0xed9b96,'savePath':_0x451299})[_0x0283('0x16')](function(_0x16ae13){_0x4675e8(null,_0x16ae13);})[_0x0283('0x17')](function(_0x4d7669){_0x4675e8(_0x4d7669);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x47')]=function(_0xf8bfd8,_0x201494,_0x3f689d,_0x1c4940,_0x5a020a){this[_0x0283('0x12')][_0x0283('0x47')]({'uniqueid':this[_0x0283('0x11')]['uniqueid'],'body':_0xf8bfd8,'direction':_0x201494,'providerName':_0x3f689d,'providerResponse':_0x1c4940})[_0x0283('0x16')](function(_0x157235){if(_0x5a020a){_0x5a020a(null,_0x157235);}})[_0x0283('0x17')](function(_0x269d42){if(_0x5a020a){_0x5a020a(_0x269d42);}});};AGIVertices['prototype'][_0x0283('0x48')]=function(_0x16c9b9,_0x50790a){var _0x59bd39=this;var _0x2a4268=0x0;var _0x3389ad={'firstName':_['isEmpty'](_0x16c9b9['name'])||_[_0x0283('0x49')](_0x16c9b9['name'])?_0x0283('0x4a')+Math[_0x0283('0x4b')]():_0x16c9b9[_0x0283('0x1d')],'lastName':_[_0x0283('0x4c')](_0x16c9b9[_0x0283('0x4d')])||_[_0x0283('0x49')](_0x16c9b9[_0x0283('0x4d')])?null:_0x16c9b9['lastName'],'phone':_0x16c9b9[_0x0283('0x4e')],'ListId':_0x16c9b9[_0x0283('0x4f')],'scheduledat':_0x16c9b9[_0x0283('0x50')],'callbackUniqueid':this['channel'][_0x0283('0x3c')],'tags':_0x0283('0x51'),'description':_0x0283('0x52')+_0x16c9b9[_0x0283('0x50')][_0x0283('0x53')](),'priority':_0x16c9b9[_0x0283('0x54')]};if(_['has'](_0x16c9b9,_0x0283('0x55'))){if(!_['isNil'](_0x16c9b9[_0x0283('0x55')])){var _0x154da4=_0x16c9b9[_0x0283('0x55')];if(_0x16c9b9[_0x0283('0x55')]==_0x0283('0x56')){this[_0x0283('0x12')]['getContactByPhone']({'phone':_0x16c9b9[_0x0283('0x4e')]})[_0x0283('0x16')](function(_0x450bb5){if(!_[_0x0283('0x49')](_0x450bb5)){var _0x14538a=_0x450bb5[_0x0283('0x55')];if(!_[_0x0283('0x49')](_0x14538a)){var _0x37454d=shared[_0x0283('0x57')][_0x14538a];if(!_[_0x0283('0x49')](_0x37454d)){var _0x5843fe=-0x1*_0x37454d[_0x0283('0x58')];_0x3389ad[_0x0283('0x59')]=moment(_0x16c9b9[_0x0283('0x59')])[_0x0283('0x5a')](_0x5843fe,'minutes');_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}else{_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}}else{_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}}else{_0x59bd39['insertContact'](_0x3389ad,_0x16c9b9,_0x50790a);}});}else{var _0x2a4268=shared[_0x0283('0x57')][_0x154da4];if(!_[_0x0283('0x49')](_0x2a4268)){var _0x3fb7bd=-0x1*_0x2a4268[_0x0283('0x58')];_0x3389ad['scheduledat']=moment(_0x16c9b9[_0x0283('0x59')])[_0x0283('0x5a')](_0x3fb7bd,_0x0283('0x5c'));_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}else{_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}}}else{_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}}else{_0x59bd39[_0x0283('0x5b')](_0x3389ad,_0x16c9b9,_0x50790a);}};AGIVertices['prototype'][_0x0283('0x5d')]=function(_0x2c47d1,_0x26e7a0){this[_0x0283('0x12')]['getPauseById'](_0x2c47d1)['then'](function(_0x2c1de7){_0x26e7a0(null,_0x2c1de7?_0x2c1de7['name']:![]);})[_0x0283('0x17')](function(_0x241b27){_0x26e7a0(_0x241b27);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x5e')]=function(_0xd4be36,_0xa5f163,_0x5306da){var _0x262042={'role':_0x0283('0x5f')};_0x262042[_0xd4be36]=this[_0x0283('0x11')][_0x0283('0x60')];this[_0x0283('0x12')][_0x0283('0x5e')](_0x262042,_0xa5f163,this[_0x0283('0x11')][_0x0283('0x3c')])['then'](function(_0x1fa496){_0x5306da(null,_[_0x0283('0x49')](_0x1fa496)?![]:!![]);})[_0x0283('0x17')](function(_0x1b1331){logger[_0x0283('0x31')](_0x1b1331);_0x5306da(null,![]);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x61')]=function(_0x4dc694,_0x2a82ed){var _0xaa1bb2={'role':_0x0283('0x5f')};_0xaa1bb2[_0x4dc694]=this['channel']['callerid'];this['rpc'][_0x0283('0x61')](_0xaa1bb2)[_0x0283('0x16')](function(_0x3294bb){_0x2a82ed(null,_[_0x0283('0x49')](_0x3294bb)?![]:!![]);})[_0x0283('0x17')](function(_0x4c5f97){logger[_0x0283('0x31')](_0x4c5f97);_0x2a82ed(null,![]);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x62')]=function(_0x261cbe,_0x530474){var _0x155ff9={'role':'agent'};_0x155ff9[_0x261cbe]=this[_0x0283('0x11')][_0x0283('0x60')];this[_0x0283('0x12')][_0x0283('0x62')](_0x155ff9)[_0x0283('0x16')](function(_0x56eab1){_0x530474(null,_[_0x0283('0x49')](_0x56eab1)?![]:!![]);})[_0x0283('0x17')](function(_0x223df2){logger[_0x0283('0x31')](_0x223df2);_0x530474(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x725b6d,_0x251165){var _0x2a554b={'role':_0x0283('0x5f')};_0x2a554b[_0x725b6d]=this['channel'][_0x0283('0x60')];var _0x1149e9=_0x725b6d!=_0x0283('0x63')?util[_0x0283('0x64')](_0x0283('0x65'),'LOCAL',this[_0x0283('0x11')][_0x0283('0x60')]):undefined;this[_0x0283('0x12')][_0x0283('0x66')](_0x2a554b,_0x1149e9)[_0x0283('0x16')](function(_0x1f2eec){_0x251165(null,_[_0x0283('0x49')](_0x1f2eec)?![]:!![]);})[_0x0283('0x17')](function(_0x2ef953){logger[_0x0283('0x31')](_0x2ef953);_0x251165(null,![]);});};AGIVertices[_0x0283('0x1a')]['shellCommand']=function(_0x1894a4,_0x1f5b3a){sh[_0x0283('0x67')](_[_0x0283('0x68')](_0x1894a4),function(_0x9ab33,_0x162b06){var _0x5835f9=_0x162b06[_0x0283('0x69')](/(\r\n|\n|\r)/gm,'');_0x1f5b3a(null,_0x5835f9);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x6a')]=function(_0x283da3,_0x17aea9){scripts['googleCloudTTS'](_0x283da3[_0x0283('0x6b')],_0x283da3[_0x0283('0x6c')]||_0x0283('0x6d'),_0x283da3[_0x0283('0x6d')],_0x283da3[_0x0283('0x6e')]||'en-US',_0x283da3[_0x0283('0x6f')]||_0x0283('0x70'),_0x283da3['audioEncoding']||_0x0283('0x71'))['then'](function(_0x1ab49d){_0x17aea9(null,_0x1ab49d);})[_0x0283('0x17')](function(_0x2b8052){_0x17aea9(_0x2b8052);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x72')]=function(_0x313598,_0x5b6b27){scripts[_0x0283('0x72')](_0x313598[_0x0283('0x6d')],_0x313598[_0x0283('0x73')]||'en',0x1)[_0x0283('0x16')](function(_0x296d22){_0x5b6b27(null,_0x296d22);})[_0x0283('0x17')](function(_0x33713c){_0x5b6b27(_0x33713c);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x74')]=function(_0x5c5ce0,_0x184ecd){var _0x3a4d47={'uri':_0x5c5ce0[_0x0283('0x75')],'method':_0x5c5ce0['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5c5ce0['timeout'])===_0x0283('0x76')&&parseInt(_0x5c5ce0[_0x0283('0x77')])>=0x1?parseInt(_0x5c5ce0[_0x0283('0x77')])*0x3e8:0x5*0x3e8};if(_[_0x0283('0x78')]([_0x0283('0x79'),_0x0283('0x7a')],_0x3a4d47[_0x0283('0x7b')][_0x0283('0x7c')]())){try{_0x3a4d47[_0x0283('0x7d')]=_0x5c5ce0[_0x0283('0xe')]?JSON[_0x0283('0x7e')](_0x5c5ce0[_0x0283('0xe')]):{};}catch(_0x46faf5){logger['error'](_0x0283('0x7f'),_0x46faf5);}}try{_0x3a4d47['headers']=_0x5c5ce0[_0x0283('0xd')]?JSON[_0x0283('0x7e')](_0x5c5ce0[_0x0283('0xd')]):{};}catch(_0x4c19f5){logger[_0x0283('0x31')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4c19f5);}if(_0x5c5ce0[_0x0283('0x80')]){try{var _0x53c85b=require(_0x5c5ce0[_0x0283('0x80')])['sync'](this,_0x3a4d47);_0x3a4d47[_0x0283('0x81')]=Mustache['render'](_0x5c5ce0['url'],_0x53c85b,{},['$$','$$']);if(_0x3a4d47['headers']){_0x3a4d47['headers']=JSON[_0x0283('0x7e')](Mustache['render'](JSON['stringify'](_0x3a4d47[_0x0283('0x82')]),_0x53c85b,{},['$$','$$']));}if(_0x3a4d47[_0x0283('0x7d')]){_0x3a4d47[_0x0283('0x7d')]=JSON[_0x0283('0x7e')](Mustache[_0x0283('0x83')](JSON[_0x0283('0x84')](_0x3a4d47['body']),_0x53c85b,{},['$$','$$']));}}catch(_0xaa0615){logger[_0x0283('0x31')](_0x0283('0x85'),_0xaa0615);}}rp(_0x3a4d47)['then'](function(_0x35514f){var _0x308963={'statusCode':_0x35514f[_0x0283('0x86')]||0xc8,'statusMessage':_0x35514f['statusMessage']||'OK','headers':_0x35514f[_0x0283('0x82')]||{},'body':_0x35514f[_0x0283('0x7d')]||{}};_0x184ecd(null,_0x308963);})['catch'](function(_0x320c6f){var _0x4523f6={'statusCode':_0x320c6f[_0x0283('0x86')]||0x1f4,'statusMessage':_0x320c6f[_0x0283('0x87')]||_0x0283('0x88'),'headers':_0x320c6f[_0x0283('0x89')][_0x0283('0x82')]||{},'body':_0x320c6f[_0x0283('0x89')][_0x0283('0x7d')]||{}};_0x184ecd(null,_0x4523f6);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x8a')]=function(_0x48bfaa,_0x29c08f){scripts['googleDialogflow'](this[_0x0283('0x11')]['uniqueid'],_0x48bfaa[_0x0283('0x8b')],_0x48bfaa[_0x0283('0x6d')],_0x48bfaa[_0x0283('0x8c')]||'en')['then'](function(_0x2e6e9f){_0x29c08f(null,_0x2e6e9f);})[_0x0283('0x17')](function(_0x1b6b25){_0x29c08f(_0x1b6b25);});};AGIVertices[_0x0283('0x1a')]['googleDialogflowV2']=function(_0x59b129,_0x47c5bc){scripts[_0x0283('0x8d')](this[_0x0283('0x11')][_0x0283('0x3c')],_0x59b129[_0x0283('0x8e')],_0x59b129[_0x0283('0x8f')],_0x59b129['private_key'],_0x59b129[_0x0283('0x6d')],_0x59b129['dialogflowV2_language']||'en')[_0x0283('0x16')](function(_0x29d9c5){_0x47c5bc(null,_0x29d9c5);})[_0x0283('0x17')](function(_0x1679f7){_0x47c5bc(_0x1679f7);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x90')]=function(_0x4c87fc,_0x103fd1){scripts[_0x0283('0x90')](this['channel'],_0x4c87fc)['then'](function(_0x46f097){_0x103fd1(null,_0x46f097);})[_0x0283('0x17')](function(_0x51123f){_0x103fd1(_0x51123f);});};AGIVertices[_0x0283('0x1a')]['ispeechTTS']=function(_0x2301a1,_0x4e902d){scripts['ispeechTTS'](_0x2301a1[_0x0283('0x8b')],_0x2301a1['text'],_0x2301a1[_0x0283('0x91')]||_0x0283('0x92'),_0x2301a1[_0x0283('0x93')])[_0x0283('0x16')](function(_0x3fe7a6){_0x4e902d(null,_0x3fe7a6);})['catch'](function(_0x35f9c5){_0x4e902d(_0x35f9c5);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x94')]=function(_0x4fe045,_0x107d6d,_0x4676fc){scripts[_0x0283('0x94')](_0x107d6d,_0x4fe045[_0x0283('0x8b')],_0x4fe045['ispeech_asr_language']||_0x0283('0x92'),this[_0x0283('0x95')](_0x4fe045['model'])?_0x4fe045['model']:undefined)[_0x0283('0x16')](function(_0x5ed0e9){_0x4676fc(null,_0x5ed0e9);})['catch'](function(_0x341e93){_0x4676fc(_0x341e93);});};AGIVertices['prototype']['awsPolly']=function(_0xc78a6,_0x4f5df2){scripts[_0x0283('0x96')](_0xc78a6[_0x0283('0x97')],_0xc78a6[_0x0283('0x98')],_0xc78a6['aws_polly_region'],_0xc78a6[_0x0283('0x99')]||'Amy',_0xc78a6[_0x0283('0x6d')],_0xc78a6[_0x0283('0x9a')]||_0x0283('0x6d'))[_0x0283('0x16')](function(_0x4a53f5){_0x4f5df2(null,_0x4a53f5);})[_0x0283('0x17')](function(_0xba1ebe){_0x4f5df2(_0xba1ebe);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x9b')]=function(_0x4d53d7,_0x554e84){scripts[_0x0283('0x9b')](this[_0x0283('0x11')][_0x0283('0x3c')],_0x4d53d7[_0x0283('0x97')],_0x4d53d7[_0x0283('0x98')],_0x4d53d7[_0x0283('0x9c')],_0x4d53d7['text'],_0x4d53d7[_0x0283('0x9d')])[_0x0283('0x16')](function(_0x411acb){_0x554e84(null,_0x411acb);})[_0x0283('0x17')](function(_0x3e5542){_0x554e84(_0x3e5542);});};AGIVertices[_0x0283('0x1a')][_0x0283('0x9e')]=function(_0xe1aae4,_0x3b922d,_0x22049c){scripts[_0x0283('0x9e')](_0x3b922d,_0xe1aae4['key'],_0xe1aae4[_0x0283('0x9f')]||_0x0283('0x92'))['then'](function(_0x50c47e){_0x22049c(null,_0x50c47e);})['catch'](function(_0x131fc7){_0x22049c(_0x131fc7);});};AGIVertices[_0x0283('0x1a')][_0x0283('0xa0')]=function(_0xc80e2,_0x505e86,_0x5de4c9){scripts[_0x0283('0xa0')](_0x505e86,_0xc80e2['appid'],_0xc80e2[_0x0283('0xa1')],_0xc80e2[_0x0283('0x81')])['then'](function(_0x211afd){_0x5de4c9(null,_0x211afd);})['catch'](function(_0x915342){_0x5de4c9(_0x915342);});};AGIVertices[_0x0283('0x1a')]['clear']=function(_0x37d353){var _0x2402b9=_['includes'](verticesWithRetry,_0x37d353[_0x0283('0x3e')])?_0x37d353:_[_0x0283('0xa2')](_0x37d353);for(var _0x1e5ad0 in _0x2402b9){if(_0x2402b9[_0x0283('0xa3')](_0x1e5ad0)){if(_0x2402b9[_0x1e5ad0]&&_[_0x0283('0xa4')](_0x2402b9[_0x1e5ad0])){if(_[_0x0283('0x78')](recursiveMapAttributes,_0x1e5ad0)){_0x2402b9[_0x1e5ad0]=this['replaceObjectAllVariables'](_0x2402b9[_0x1e5ad0]);}else{_0x2402b9[_0x1e5ad0]=this[_0x0283('0xa5')](_0x2402b9[_0x1e5ad0]);}}}}return _0x2402b9;};AGIVertices['prototype'][_0x0283('0xa6')]=function(_0x2dfb1d){for(var _0x3b4fd2 in _0x2dfb1d){if(_0x2dfb1d['hasOwnProperty'](_0x3b4fd2)){if(_[_0x0283('0xa7')](_0x2dfb1d[_0x3b4fd2])){this[_0x0283('0xa6')](_0x2dfb1d[_0x3b4fd2]);}else if(_[_0x0283('0xa8')](_0x2dfb1d[_0x3b4fd2])){for(var _0x50cb8d=0x0;_0x50cb8d<_0x2dfb1d[_0x3b4fd2]['length'];_0x50cb8d++){this[_0x0283('0xa6')](_0x2dfb1d[_0x3b4fd2][_0x50cb8d]);}}else if(_[_0x0283('0xa4')](_0x2dfb1d[_0x3b4fd2])){_0x2dfb1d[_0x3b4fd2]=this[_0x0283('0xa5')](_0x2dfb1d[_0x3b4fd2]);}}}};AGIVertices[_0x0283('0x1a')]['saveRestApiResult']=function(_0x407d8a,_0x2fc8a2){for(var _0x55db23 in _0x407d8a){if(_0x407d8a[_0x0283('0xa3')](_0x55db23)){if(_[_0x0283('0xa7')](_0x407d8a[_0x55db23])){if(!_['isEmpty'](_0x407d8a[_0x55db23])){this['saveRestApiResult'](_0x407d8a[_0x55db23],util[_0x0283('0x64')](_0x0283('0xa9'),_0x2fc8a2,_0x55db23));}}else if(_[_0x0283('0xa8')](_0x407d8a[_0x55db23])){for(var _0x4951c2=0x0;_0x4951c2<_0x407d8a[_0x55db23][_0x0283('0xaa')];_0x4951c2++){this[_0x0283('0xab')](_0x407d8a[_0x55db23][_0x4951c2],util['format']('%s.%s',_0x2fc8a2,_0x55db23+'['+_0x4951c2+']'));}}else{if(!_['isNil'](_0x407d8a[_0x55db23])){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')]('%s.%s',_0x2fc8a2,_0x55db23),_0x407d8a[_0x55db23]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0xb96788){try{var _0x34f9e6=JSON[_0x0283('0x7e')](_0xb96788);this['recursiveNodeIndex'](_0x34f9e6);return JSON[_0x0283('0x84')](_0x34f9e6);}catch(_0x431c8c){return this[_0x0283('0xa5')](_0xb96788);}};AGIVertices[_0x0283('0x1a')][_0x0283('0xa5')]=function(_0x519195){var _0x4fbb5d=_0x519195[_0x0283('0xad')]('{');for(var _0x2c9c6d=0x1;_0x2c9c6d<_0x4fbb5d[_0x0283('0xaa')];_0x2c9c6d+=0x1){var _0x20da62=_0x4fbb5d[_0x2c9c6d]['split']('}');if(_0x20da62[_0x0283('0xaa')]>0x1){_0x519195=_0x519195[_0x0283('0xae')]('{'+_0x20da62[0x0]+'}',this[_0x0283('0x11')][_0x0283('0x14')](_0x20da62[0x0])[_0x0283('0xaf')]||_0x20da62[0x0]);}}if(_0x4fbb5d['length']===0x1){return _0x519195['toString']();}return this[_0x0283('0xa5')](_0x519195);};AGIVertices[_0x0283('0x1a')]['getAndSetVariable']=function(_0x44fa2f,_0xa186a6){var _0x219ac6=this[_0x0283('0x11')][_0x0283('0x14')](_0x44fa2f);if(_0x219ac6[_0x0283('0xb0')]===-0x1){return _0x219ac6;}logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0xb1'),_0xa186a6,_0x219ac6[_0x0283('0xaf')]));return this[_0x0283('0x11')][_0x0283('0xac')](_0xa186a6,_0x219ac6[_0x0283('0xaf')]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x95')]=function(_0x20ce47){return _0x20ce47&&_0x20ce47!=='0'&&_0x20ce47!=='-1'&&_0x20ce47!=='';};AGIVertices[_0x0283('0x1a')]['maxRetry']=function(_0x4776f9){this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x4776f9,'-');_0x4776f9[_0x0283('0xb4')]=_0x4776f9[_0x0283('0xb5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0283('0x1a')]['mrcpsynth']=function(_0x5b0fac){logger[_0x0283('0x35')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x5b0fac['label']));if(!this['isConfigured'](_0x5b0fac[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20text\x20configured');}var _0x5a5f24='\x22'+_0x5b0fac[_0x0283('0x6d')]+'\x22';if(this['isConfigured'](_0x5b0fac[_0x0283('0x89')])){_0x5a5f24+=','+_0x5b0fac['options'];}var _0x29d865=this[_0x0283('0x11')][_0x0283('0x67')](_0x0283('0xb7'),_0x5a5f24);if(_0x29d865[_0x0283('0xb0')]===-0x1){return _0x29d865;}return this['channel'][_0x0283('0xb6')](util['format'](_0x0283('0xb8'),_0x5a5f24));};AGIVertices[_0x0283('0x1a')]['mrcprecog']=function(_0x11308c){logger['info'](util[_0x0283('0x64')](_0x0283('0xb9'),_0x11308c[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x11308c[_0x0283('0xba')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xbb'));}var _0x49378b=_0x11308c['grammar'];if(this['isConfigured'](_0x11308c[_0x0283('0x89')])){_0x49378b+=','+_0x11308c[_0x0283('0x89')];}var _0x48d33=this[_0x0283('0x11')][_0x0283('0x67')](_0x0283('0xbc'),_0x49378b);if(_0x48d33[_0x0283('0xb0')]===-0x1){return _0x48d33;}var _0x5f2c78=this[_0x0283('0xbd')]('RECOG_CONFIDENCE()',_0x0283('0xbe'));if(_0x5f2c78[_0x0283('0xb0')]===-0x1){return _0x5f2c78;}var _0x3fc404=this[_0x0283('0xbd')](_0x0283('0xbf'),_0x0283('0xc0'));if(_0x3fc404[_0x0283('0xb0')]===-0x1){return _0x3fc404;}var _0x1d3c9f=this[_0x0283('0xbd')](_0x0283('0xc1'),_0x0283('0xc2'));if(_0x1d3c9f[_0x0283('0xb0')]===-0x1){return _0x1d3c9f;}return this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xc3'),_0x49378b));};AGIVertices[_0x0283('0x1a')][_0x0283('0x8')]=function(_0x13daf9){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0xc4'),_0x13daf9[_0x0283('0x3d')]));return this['channel'][_0x0283('0x8')]([_0x13daf9['command'],_0x13daf9[_0x0283('0xc5')]]);};AGIVertices[_0x0283('0x1a')][_0x0283('0xc6')]=function(_0x3b8247){logger[_0x0283('0x35')](util['format'](_0x0283('0xc7'),_0x3b8247['label']));if(this['isConfigured'](_0x3b8247[_0x0283('0x77')])){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0xc8'),_0x3b8247[_0x0283('0x77')]));var _0x5d348f=this[_0x0283('0x11')][_0x0283('0xc9')](_0x3b8247[_0x0283('0x77')]);if(_0x5d348f[_0x0283('0xb0')]===-0x1){return _0x5d348f;}}return this[_0x0283('0x11')][_0x0283('0xc6')]();};AGIVertices[_0x0283('0x1a')][_0x0283('0x51')]=function(_0x367908){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x367908[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x367908['list_id'])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x367908,_0x0283('0xca'));}_0x367908[_0x0283('0x50')]=moment();if(this[_0x0283('0x95')](_0x367908[_0x0283('0xcb')])){_0x367908['scheduledAt']=moment()['add'](_0x367908[_0x0283('0xcb')],'minutes');}if(!this[_0x0283('0x95')](_0x367908[_0x0283('0x54')])){_0x367908[_0x0283('0x54')]=0x2;}this[_0x0283('0x48')][_0x0283('0xb3')](this,_0x367908);return this[_0x0283('0x11')][_0x0283('0xb6')](util['format'](_0x0283('0xcc'),_0x367908['phone'],_0x367908['list_id'],_0x367908['scheduledAt']));};AGIVertices[_0x0283('0x1a')][_0x0283('0xcd')]=function(_0x10b247){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0xce'),_0x10b247['label']));var _0x4a9e30=this[_0x0283('0x11')][_0x0283('0x67')](_0x10b247[_0x0283('0xcf')],_0x10b247[_0x0283('0x89')]);if(_0x4a9e30[_0x0283('0xb0')]===-0x1){return _0x4a9e30;}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xd0'),_0x10b247[_0x0283('0xcf')],_0x10b247[_0x0283('0x89')]));};AGIVertices['prototype'][_0x0283('0xd1')]=function(_0x56ff4c){logger[_0x0283('0x35')](util['format'](_0x0283('0xd2'),_0x56ff4c[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x56ff4c[_0x0283('0x6d')])){return this[_0x0283('0x11')]['noop'](_0x0283('0xd3'));}var _0x5c9d2a='\x22'+_0x56ff4c[_0x0283('0x6d')]+'\x22';if(this[_0x0283('0x95')](_0x56ff4c['options'])){_0x5c9d2a+=','+_0x56ff4c[_0x0283('0x89')];}var _0x18c7e4=this['channel'][_0x0283('0x67')](_0x0283('0xb7'),_0x5c9d2a);if(_0x18c7e4[_0x0283('0xb0')]===-0x1){return _0x18c7e4;}return this[_0x0283('0x11')][_0x0283('0xb6')](util['format'](_0x0283('0xb8'),_0x5c9d2a));};AGIVertices['prototype']['sestektts']=function(_0x46d08e){logger['info'](util['format'](_0x0283('0xd4'),_0x46d08e[_0x0283('0x3d')]));if(!this['isConfigured'](_0x46d08e[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20text\x20configured');}var _0x40b37f='\x22'+_0x46d08e[_0x0283('0x6d')]+'\x22';if(this[_0x0283('0x95')](_0x46d08e[_0x0283('0x89')])){_0x40b37f+=','+_0x46d08e[_0x0283('0x89')];}var _0x4f4481=this[_0x0283('0x11')]['exec']('MRCPSynth',_0x40b37f);if(_0x4f4481[_0x0283('0xb0')]===-0x1){return _0x4f4481;}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xb8'),_0x40b37f));};AGIVertices['prototype'][_0x0283('0xd5')]=function(_0xeb3cea){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xeb3cea['label']));if(!this['isConfigured'](_0xeb3cea[_0x0283('0xba')])){return this['channel'][_0x0283('0xb6')]('no\x20grammar\x20configured');}var _0x4a1257=_0xeb3cea[_0x0283('0xba')];if(this[_0x0283('0x95')](_0xeb3cea[_0x0283('0x89')])){_0x4a1257+=','+_0xeb3cea[_0x0283('0x89')];}var _0x30eb92=this[_0x0283('0x11')]['exec'](_0x0283('0xbc'),_0x4a1257);if(_0x30eb92['result']===-0x1){return _0x30eb92;}var _0x43f943=this['getAndSetVariable'](_0x0283('0xd6'),_0x0283('0xd7'));if(_0x43f943['result']===-0x1){return _0x43f943;}var _0x5cf02a=this['getAndSetVariable'](_0x0283('0xbf'),_0x0283('0xd8'));if(_0x5cf02a[_0x0283('0xb0')]===-0x1){return _0x5cf02a;}var _0x30c797=this['getAndSetVariable'](_0x0283('0xc1'),'LUMENVOX_ASR_INSTANCE');if(_0x30c797['result']===-0x1){return _0x30c797;}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xc3'),_0x4a1257));};AGIVertices['prototype'][_0x0283('0xd9')]=function(_0x300812){logger['info'](util[_0x0283('0x64')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x300812[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x300812[_0x0283('0xba')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20grammar\x20configured');}var _0x409326=_0x300812[_0x0283('0xba')];if(this['isConfigured'](_0x300812[_0x0283('0x89')])){_0x409326+=','+_0x300812[_0x0283('0x89')];}var _0x562f4f=this['channel'][_0x0283('0x67')]('MRCPRecog',_0x409326);if(_0x562f4f[_0x0283('0xb0')]===-0x1){return _0x562f4f;}var _0x369ec7=this['getAndSetVariable'](_0x0283('0xd6'),_0x0283('0xda'));if(_0x369ec7[_0x0283('0xb0')]===-0x1){return _0x369ec7;}var _0x2ad398=this[_0x0283('0xbd')](_0x0283('0xbf'),_0x0283('0xdb'));if(_0x2ad398[_0x0283('0xb0')]===-0x1){return _0x2ad398;}var _0x58b273=this[_0x0283('0xbd')](_0x0283('0xc1'),'SESTEK_ASR_INSTANCE');if(_0x58b273['result']===-0x1){return _0x58b273;}return this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xc3'),_0x409326));};AGIVertices['prototype'][_0x0283('0xdc')]=function(_0x2e5153){logger['info'](util[_0x0283('0x64')](_0x0283('0xdd'),_0x2e5153[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x2e5153[_0x0283('0xde')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x2e5153,_0x0283('0xdf'));}var _0x537354=this[_0x0283('0x1e')][_0x0283('0xb3')](this,_0x2e5153[_0x0283('0xde')]);if(!_0x537354){return this[_0x0283('0x11')][_0x0283('0x31')](_0x2e5153,_0x0283('0xe0'));}if(!this[_0x0283('0x95')](_0x2e5153['query'])){return this['channel'][_0x0283('0x31')](_0x2e5153,'no\x20query\x20configured');}var _0x391440=_0x2e5153['query'][_0x0283('0x69')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0283('0x11')]['noop'](util['format'](_0x0283('0xe1'),_0x391440));var _0x8a2ec1=this[_0x0283('0x2f')][_0x0283('0xb3')](this,_0x537354,_0x391440);this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x2e5153,_0x391440);if(!this[_0x0283('0x95')](_0x2e5153[_0x0283('0xe2')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xe3'));}var _0x57ee68=this['getVariable'][_0x0283('0xb3')](this,_0x2e5153['variable_id']);if(!_0x57ee68){return this[_0x0283('0x11')][_0x0283('0x31')](_0x2e5153,'no\x20variable\x20found');}var _0x13bb8c=this;_0x8a2ec1[_0x0283('0xe4')](function(_0x33679d,_0x211820){Object['keys'](_0x33679d)[_0x0283('0xe4')](function(_0x23b275){_0x13bb8c[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0xe5'),_0x57ee68,_0x211820,_0x23b275),_0x33679d[_0x23b275]);});});this[_0x0283('0x11')][_0x0283('0xac')](util['format'](_0x0283('0xe6'),_0x57ee68),_0x8a2ec1['length']);return this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0xe7'),_0x57ee68));};AGIVertices[_0x0283('0x1a')][_0x0283('0xe8')]=function(_0x132159){logger[_0x0283('0xe9')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x132159['label']));if(!this[_0x0283('0x95')](_0x132159['sip_id'])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x132159,'no\x20user\x20selected');}var _0x4b921b=this[_0x0283('0x21')]['sync'](this,_0x132159[_0x0283('0xea')]);if(!_0x4b921b){return this['channel'][_0x0283('0x31')](_0x132159,'no\x20user\x20found');}var _0x2a759b=this['channel'][_0x0283('0x67')](_0x0283('0xeb'),[util[_0x0283('0x64')](_0x0283('0xec'),_0x4b921b),_0x132159[_0x0283('0x77')],_0x132159[_0x0283('0xed')],_0x132159[_0x0283('0x75')]]);if(_0x2a759b[_0x0283('0xb0')]===-0x1){return _0x2a759b;}return this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xee'),_0x0283('0xeb')));};AGIVertices[_0x0283('0x1a')][_0x0283('0xef')]=function(_0x263ac4){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0xf0'),_0x263ac4[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x263ac4['key'])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xf1'));}if(!this[_0x0283('0x95')](_0x263ac4[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xd3'));}this[_0x0283('0x11')][_0x0283('0xf2')]=!![];this[_0x0283('0xb2')](_0x263ac4);this[_0x0283('0x47')](_0x263ac4[_0x0283('0x6d')],'in','','');this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0xf3'),_0x263ac4[_0x0283('0x6d')]));var _0x34e63f=this['googleDialogflow'][_0x0283('0xb3')](this,_0x263ac4);if(_0x34e63f){for(var _0x131e37 in _0x34e63f){if(_0x34e63f[_0x0283('0xa3')](_0x131e37)){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0xf4'),_0x131e37[_0x0283('0x7c')]()),_0x34e63f[_0x131e37]);}}this['createSquareMessage'](_0x34e63f['speech'],'out','dialogflow','');return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xf5'),_0x34e63f[_0x0283('0xf6')]));}return this[_0x0283('0x11')][_0x0283('0x31')](_0x263ac4,_0x0283('0xf7'));};AGIVertices[_0x0283('0x1a')][_0x0283('0xf8')]=function(_0x420493){logger[_0x0283('0x35')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x420493['label']));if(!this['isConfigured'](_0x420493[_0x0283('0x8e')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xf9'));}if(!this[_0x0283('0x95')](_0x420493[_0x0283('0x8f')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20client_email\x20configured');}if(!this[_0x0283('0x95')](_0x420493[_0x0283('0xfa')])){return this[_0x0283('0x11')]['noop'](_0x0283('0xfb'));}if(!this[_0x0283('0x95')](_0x420493[_0x0283('0xfc')])){return this['channel']['noop'](_0x0283('0xfd'));}if(!this[_0x0283('0x95')](_0x420493[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xd3'));}this[_0x0283('0x11')][_0x0283('0xf2')]=!![];this['createSquareDetailsReport'](_0x420493);this[_0x0283('0x47')](_0x420493[_0x0283('0x6d')],'in','','');this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0xfe'),_0x420493[_0x0283('0x6d')]));var _0x97f86d=this['googleDialogflowV2'][_0x0283('0xb3')](this,_0x420493);if(_0x97f86d){for(var _0x43b4a8 in _0x97f86d){if(_0x97f86d['hasOwnProperty'](_0x43b4a8)){if(_0x43b4a8!==_0x0283('0xff')){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')]('DIALOGFLOW_%s',_0x43b4a8['toUpperCase']()),_0x97f86d[_0x43b4a8]);}}}this[_0x0283('0x47')](_0x97f86d['speech'],'out',_0x0283('0xf8'),_0x97f86d[_0x0283('0xff')]);return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x100'),_0x97f86d['speech']));}return this[_0x0283('0x11')][_0x0283('0x31')](_0x420493,_0x0283('0x101'));};AGIVertices[_0x0283('0x1a')][_0x0283('0x102')]=function(_0x3dc12){logger['info'](util[_0x0283('0x64')](_0x0283('0x103'),_0x3dc12[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x3dc12[_0x0283('0x104')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x0283('0x95')](_0x3dc12[_0x0283('0x105')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x106'));}if(!this['isConfigured'](_0x3dc12[_0x0283('0x107')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x108'));}if(!this[_0x0283('0x95')](_0x3dc12[_0x0283('0x109')])){return this['channel'][_0x0283('0xb6')](_0x0283('0xd3'));}this['channel']['bot']=!![];this[_0x0283('0xb2')](_0x3dc12);this['createSquareMessage'](_0x3dc12[_0x0283('0x6d')],'in','','');this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x10a'),_0x3dc12[_0x0283('0x6d')]));var _0x25783e=this['sestekNDA']['sync'](this,_0x3dc12);if(_0x25783e){for(var _0x1cb294 in _0x25783e){if(_0x25783e[_0x0283('0xa3')](_0x1cb294)){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0x10b'),_0x1cb294[_0x0283('0x7c')]()),_0x25783e[_0x1cb294]);}}this[_0x0283('0x47')](_0x25783e[_0x0283('0xf6')],_0x0283('0x10c'),_0x0283('0x102'),'');if(_0x25783e[_0x0283('0x10d')]){this[_0x0283('0x11')][_0x0283('0xb6')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x25783e[_0x0283('0x10d')]));var _0x3c5d5e=this[_0x0283('0x11')][_0x0283('0x10e')](_0x25783e['audiofile']);try{fs[_0x0283('0x10f')](_0x25783e[_0x0283('0x10d')]+_0x0283('0x110'));}catch(_0x4e9112){logger[_0x0283('0x31')](_0x4e9112);}return _0x3c5d5e;}else{return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x111'),_0x25783e[_0x0283('0xf6')]));}}return this[_0x0283('0x11')]['error'](_0x3dc12,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x0283('0x1a')]['end']=function(_0x7de48e){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x112'),_0x7de48e[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0xb6')]('end');};AGIVertices[_0x0283('0x1a')][_0x0283('0x113')]=function(_0xbbc5bc){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x114'),_0xbbc5bc[_0x0283('0x3d')]));var _0x8d8ebe='';if(_0xbbc5bc[_0x0283('0x115')]){if(!this[_0x0283('0x95')](_0xbbc5bc[_0x0283('0x115')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0xbbc5bc,_0x0283('0x116'));}else{var _0x18b96f=parseInt(_0xbbc5bc[_0x0283('0x115')],0xa);if(isNaN(_0x18b96f)){_0x8d8ebe=_0xbbc5bc['trunk_id'];}else{_0x8d8ebe=this[_0x0283('0x117')]['sync'](this,_0xbbc5bc[_0x0283('0x115')]);if(!_0x8d8ebe){return this[_0x0283('0x11')][_0x0283('0x31')](_0xbbc5bc,_0x0283('0x118'));}}}}else if(_0xbbc5bc['trunk_name']){_0x8d8ebe=_0xbbc5bc[_0x0283('0x119')];}else{return this['channel'][_0x0283('0x31')](_0xbbc5bc,'no\x20trunk\x20selected');}var _0x3e0409=this[_0x0283('0x11')][_0x0283('0x67')](_0x0283('0xeb'),[util[_0x0283('0x64')](_0x0283('0x11a'),_0x8d8ebe,_0xbbc5bc[_0x0283('0x4e')]),_0xbbc5bc[_0x0283('0x77')],_0xbbc5bc[_0x0283('0xed')],_0xbbc5bc[_0x0283('0x75')]]);if(_0x3e0409[_0x0283('0xb0')]===-0x1){return _0x3e0409;}return this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0xee'),_0x0283('0xeb')));};AGIVertices[_0x0283('0x1a')]['finally']=function(_0x2df59b){logger['info'](util[_0x0283('0x64')](_0x0283('0x11b'),_0x2df59b[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x11c'));};AGIVertices[_0x0283('0x1a')][_0x0283('0xf')]=function(_0x474bbc){logger[_0x0283('0x35')](util['format'](_0x0283('0x11d'),_0x474bbc[_0x0283('0x3d')]));if(_0x474bbc[_0x0283('0xb4')]===0x0){return this['maxRetry'](_0x474bbc);}_0x474bbc[_0x0283('0xb4')]-=0x1;if(!this[_0x0283('0x95')](_0x474bbc['file_id'])){return this['channel'][_0x0283('0x31')](_0x474bbc,'no\x20file\x20audio\x20selected');}var _0xce2b=this[_0x0283('0x23')][_0x0283('0xb3')](this,_0x474bbc['file_id']);if(!_0xce2b){return this[_0x0283('0x11')]['error'](_0x474bbc,_0x0283('0x11e'));}if(!this['isConfigured'](_0x474bbc[_0x0283('0xe2')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x0283('0xe3'));}var _0x13a9b2=this[_0x0283('0x11')]['getData'](_0xce2b,_0x474bbc[_0x0283('0x11f')],_0x474bbc[_0x0283('0x120')]);var _0x345612=_0x13a9b2[_0x0283('0xb0')]?_0x13a9b2[_0x0283('0xb0')][_0x0283('0x53')]():'';logger[_0x0283('0x35')](_0x0283('0x121'),JSON[_0x0283('0x84')](_0x13a9b2));if(_0x13a9b2[_0x0283('0xb0')]===-0x1){this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x474bbc,_0x345612);return _0x13a9b2;}else if(_0x13a9b2[_0x0283('0xaf')]==='timeout'){_0x13a9b2[_0x0283('0xb0')]=_0x345612[_0x0283('0xaa')]>=parseInt(_0x474bbc[_0x0283('0x122')])?'x':'i';}else{_0x13a9b2[_0x0283('0xb0')]=_0x345612[_0x0283('0xaa')]>=parseInt(_0x474bbc[_0x0283('0x122')])&&_0x345612['length']<=parseInt(_0x474bbc[_0x0283('0x120')])?'x':'i';}var _0x1a6c32=this[_0x0283('0x14')]['sync'](this,_0x474bbc[_0x0283('0xe2')]);if(!_0x1a6c32){return this['channel'][_0x0283('0x31')](_0x474bbc,_0x0283('0x123'));}this[_0x0283('0x11')][_0x0283('0xac')](_0x1a6c32,_0x345612);if(this[_0x0283('0x95')](_0x474bbc['hiddendigitsnum'])){var _0x42c891=parseInt(_0x474bbc['hiddendigitsnum'],0xa);var _0x1bda16=rs['generate']({'charset':'*','length':_0x42c891});var _0x2101e0=_0x345612[_0x0283('0xaa')];if(_0x2101e0>0x0){if(_0x2101e0>_0x42c891){this['createSquareDetailsReport'][_0x0283('0xb3')](this,_0x474bbc,_0x474bbc[_0x0283('0x124')]===_0x0283('0x125')?_0x1bda16+_0x345612[_0x0283('0x126')](_0x42c891):_0x345612[_0x0283('0x126')](0x0,_0x2101e0-_0x42c891)+_0x1bda16);}else{this[_0x0283('0xb2')]['sync'](this,_0x474bbc,rs[_0x0283('0x127')]({'charset':'*','length':_0x2101e0}));}}else{this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x474bbc,'');}}else{this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x474bbc,_0x345612);}return _0x13a9b2;};AGIVertices[_0x0283('0x1a')]['getsecretdigits']=function(_0x3feb3d){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x128'),_0x3feb3d['label']));return this['getdigits'](_0x3feb3d);};AGIVertices[_0x0283('0x1a')][_0x0283('0x129')]=function(_0x143210){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x12a'),_0x143210[_0x0283('0x3d')]));this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x143210,_0x143210[_0x0283('0x12b')]);return this['channel']['noop'](util[_0x0283('0x64')](_0x0283('0x12c'),_0x143210[_0x0283('0x12b')]));};AGIVertices['prototype'][_0x0283('0x12d')]=function(_0x1ea9f5){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x12e'),_0x1ea9f5['label']));if(!this[_0x0283('0x95')](_0x1ea9f5[_0x0283('0x97')])||!this[_0x0283('0x95')](_0x1ea9f5[_0x0283('0x98')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x12f'));}if(!this[_0x0283('0x95')](_0x1ea9f5[_0x0283('0x6d')])){return this[_0x0283('0x11')]['noop']('no\x20text\x20configured');}this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x130'),_0x1ea9f5[_0x0283('0x6d')]));var _0x525a56=this['awsPolly'][_0x0283('0xb3')](this,_0x1ea9f5);if(_0x525a56){this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')]('aws\x20Polly\x20%s\x20file\x20created',_0x525a56));var _0x57429f=this['channel'][_0x0283('0x10e')](_0x525a56);try{fs[_0x0283('0x10f')](_0x525a56+_0x0283('0x110'));}catch(_0x3e41db){logger['error'](_0x3e41db);}return _0x57429f;}return this[_0x0283('0x11')]['error'](_0x1ea9f5,_0x0283('0x131'));};AGIVertices[_0x0283('0x1a')][_0x0283('0x132')]=function(_0xfec778){logger[_0x0283('0x35')](util['format'](_0x0283('0x133'),_0xfec778[_0x0283('0x3d')]));if(!this['isConfigured'](_0xfec778[_0x0283('0x97')])||!this[_0x0283('0x95')](_0xfec778['aws_secret_access_key'])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0283('0x95')](_0xfec778[_0x0283('0x9d')])){return this[_0x0283('0x11')]['noop'](_0x0283('0x134'));}if(!this[_0x0283('0x95')](_0xfec778[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20text\x20configured');}this['channel'][_0x0283('0xf2')]=!![];this[_0x0283('0xb2')](_0xfec778);this[_0x0283('0x47')](_0xfec778[_0x0283('0x6d')],'in','','');this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x135'),_0xfec778[_0x0283('0x6d')]));var _0x133aac=this[_0x0283('0x9b')][_0x0283('0xb3')](this,_0xfec778);if(_0x133aac){for(var _0x2e5843 in _0x133aac){if(_0x133aac[_0x0283('0xa3')](_0x2e5843)&&_[_0x0283('0xa4')](_0x133aac[_0x2e5843])){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0x136'),_0x2e5843[_0x0283('0x7c')]()),_0x133aac[_0x2e5843]);}}if(_[_0x0283('0x49')](_0x133aac[_0x0283('0x87')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x0283('0x47')](_0x133aac[_0x0283('0x87')],_0x0283('0x10c'),_0x0283('0x137'),'');return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x138'),_0x133aac['message']));}}return this[_0x0283('0x11')][_0x0283('0x31')](_0xfec778,_0x0283('0x139'));};AGIVertices[_0x0283('0x1a')][_0x0283('0x13a')]=function(_0x1ac0e0){logger[_0x0283('0x35')](util['format'](_0x0283('0x13b'),_0x1ac0e0[_0x0283('0x3d')],_0x1ac0e0[_0x0283('0x77')]));if(!this[_0x0283('0x95')](_0x1ac0e0['key'])){return this['channel'][_0x0283('0xb6')](_0x0283('0xf1'));}var _0x37d59a=_0x0283('0x13c');var _0x452593=util[_0x0283('0x64')]('%s/recordings/%s',FILES_PATH,rs[_0x0283('0x127')](0x4));var _0x3c6bb9=util[_0x0283('0x64')](_0x0283('0xa9'),_0x452593,_0x37d59a);var _0x57f618=!![];if(_0x1ac0e0[_0x0283('0x13d')]===_0x0283('0x13e')){_0x57f618=![];}var _0x2c131f=this[_0x0283('0x11')][_0x0283('0x13f')](_0x452593,_0x37d59a,_0x1ac0e0[_0x0283('0x140')],_0x1ac0e0['timeout'],undefined,_0x57f618);if(_0x2c131f[_0x0283('0xb0')]!==-0x1){this[_0x0283('0x11')][_0x0283('0xb6')](util['format']('google\x20%s\x20file\x20created',_0x3c6bb9));var _0x326d1f=this['googleASR'][_0x0283('0xb3')](this,_0x1ac0e0,_0x3c6bb9);if(_0x326d1f){for(var _0x5217de in _0x326d1f){if(_0x326d1f[_0x0283('0xa3')](_0x5217de)){this[_0x0283('0x11')][_0x0283('0xac')](util['format'](_0x0283('0x141'),_0x5217de[_0x0283('0x7c')]()),_0x326d1f[_0x5217de]);}}return this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')]('GoogleASR\x20Result\x20%s',JSON[_0x0283('0x84')](_0x326d1f)));}}return _0x2c131f;};AGIVertices[_0x0283('0x1a')][_0x0283('0x142')]=function(_0x17e920){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x143'),_0x17e920[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x17e920[_0x0283('0x144')])){return this['channel']['noop'](_0x0283('0x145'));}if(!this['isConfigured'](_0x17e920['appsecret'])){return this['channel']['noop'](_0x0283('0x146'));}var _0x5edb0c='wav';var _0x420ca6=util[_0x0283('0x64')](_0x0283('0x147'),FILES_PATH,rs[_0x0283('0x127')](0x4));var _0x3ba445=util['format']('%s.%s',_0x420ca6,_0x5edb0c);var _0x5432b3=!![];if(_0x17e920[_0x0283('0x13d')]===_0x0283('0x13e')){_0x5432b3=![];}var _0x16a6cd=this[_0x0283('0x11')]['recordFile'](_0x420ca6,_0x5edb0c,_0x17e920[_0x0283('0x140')],_0x17e920['timeout'],undefined,_0x5432b3);if(_0x16a6cd['result']!==-0x1){this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x148'),_0x3ba445));var _0x365e2c=this[_0x0283('0xa0')]['sync'](this,_0x17e920,_0x3ba445);if(_0x365e2c){for(var _0x45eb94 in _0x365e2c){if(_0x365e2c[_0x0283('0xa3')](_0x45eb94)){this[_0x0283('0x11')][_0x0283('0xac')](util['format'](_0x0283('0x149'),_0x45eb94[_0x0283('0x7c')]()),_0x365e2c[_0x45eb94]);}}return this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')]('TildeASR\x20Result\x20%s',JSON[_0x0283('0x84')](_0x365e2c)));}}return _0x16a6cd;};AGIVertices['prototype'][_0x0283('0x14a')]=function(_0x327236){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x14b'),_0x327236[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0x14c')](_0x327236[_0x0283('0x41')],_0x327236[_0x0283('0x42')],_0x327236['priority']);};AGIVertices[_0x0283('0x1a')][_0x0283('0x14d')]=function(_0x59b1c8){logger[_0x0283('0x35')](util['format'](_0x0283('0x14e'),_0x59b1c8['label']));if(!this[_0x0283('0x95')](_0x59b1c8[_0x0283('0x14f')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x59b1c8,'no\x20condition\x20configured');}try{var _0x47dd69=eval(_0x59b1c8[_0x0283('0x14f')])?_0x0283('0x150'):_0x0283('0x151');this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0x152'),_0x59b1c8[_0x0283('0x14f')],_0x47dd69));return{'code':0xc8,'result':_0x47dd69};}catch(_0xf62f5e){return{'code':0xc8,'result':_0x0283('0x151')};}};AGIVertices[_0x0283('0x1a')][_0x0283('0x153')]=function(_0x2d3fc1){logger['info'](util[_0x0283('0x64')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2d3fc1[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x2d3fc1[_0x0283('0x154')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x2d3fc1,_0x0283('0x155'));}var _0x1f6269=this[_0x0283('0x29')][_0x0283('0xb3')](this,_0x2d3fc1[_0x0283('0x154')]);if(!_0x1f6269){return this[_0x0283('0x11')][_0x0283('0x31')](_0x2d3fc1,_0x0283('0x156'));}for(var _0x1355f7=0x0;_0x1355f7<_0x1f6269[_0x0283('0xaa')];_0x1355f7+=0x1){var _0x54774c=this['channel'][_0x0283('0x14')](util[_0x0283('0x64')](_0x0283('0x157'),_0x1f6269[_0x1355f7]));if(_0x54774c['result']===-0x1){return _0x54774c;}logger[_0x0283('0x35')](util[_0x0283('0x64')]('IFTIME\x20%s\x20%s',_0x1f6269[_0x1355f7],_0x54774c[_0x0283('0xaf')]));if(_0x54774c[_0x0283('0xaf')]===_0x0283('0x150')){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x1f6269[_0x1355f7],_0x0283('0x150')));this['channel'][_0x0283('0xb6')](util['format']('IFTIME\x20%s\x20%s',_0x1f6269[_0x1355f7],_0x0283('0x150')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x0283('0x64')]('IFTIME\x20%s\x20%s',_0x1f6269[_0x1355f7],_0x0283('0x151')));this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x158'),_0x1f6269[_0x1355f7],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x0283('0x159')]=function(_0x4a6e54){logger['info'](util[_0x0283('0x64')](_0x0283('0x15a'),_0x4a6e54[_0x0283('0x3d')]));return this['channel'][_0x0283('0x159')]();};AGIVertices['prototype'][_0x0283('0x15b')]=function(_0x7b9af6){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x15c'),_0x7b9af6['label']));if(!this[_0x0283('0x95')](_0x7b9af6[_0x0283('0x8b')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20key\x20configured');}var _0x1a069f=_0x0283('0x13c');var _0x20bf5f=util[_0x0283('0x64')](_0x0283('0x147'),FILES_PATH,rs['generate'](0x4));var _0x320d65=util[_0x0283('0x64')](_0x0283('0xa9'),_0x20bf5f,_0x1a069f);var _0xc5e8af=!![];if(_0x7b9af6[_0x0283('0x13d')]===_0x0283('0x13e')){_0xc5e8af=![];}var _0x106765=this[_0x0283('0x11')][_0x0283('0x13f')](_0x20bf5f,_0x1a069f,_0x7b9af6[_0x0283('0x140')],_0x7b9af6['timeout'],undefined,_0xc5e8af);if(_0x106765[_0x0283('0xb0')]!==-0x1){this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')]('ispeech\x20%s\x20file\x20created',_0x320d65));var _0x4a200d=this['ispeechASR'][_0x0283('0xb3')](this,_0x7b9af6,_0x320d65);if(_0x4a200d){for(var _0x23c404 in _0x4a200d){if(_0x4a200d[_0x0283('0xa3')](_0x23c404)){this[_0x0283('0x11')][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0x15d'),_0x23c404[_0x0283('0x7c')]()),_0x4a200d[_0x23c404]);}}return this['channel']['noop'](util['format'](_0x0283('0x15e'),JSON[_0x0283('0x84')](_0x4a200d)));}}return _0x106765;};AGIVertices[_0x0283('0x1a')][_0x0283('0x15f')]=function(_0x109f3e){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x109f3e[_0x0283('0x3d')]));if(!this['isConfigured'](_0x109f3e[_0x0283('0x8b')])){return this[_0x0283('0x11')][_0x0283('0xb6')]('no\x20key\x20configured');}if(!this[_0x0283('0x95')](_0x109f3e[_0x0283('0x6d')])){return this['channel']['noop'](_0x0283('0xd3'));}this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x160'),_0x109f3e['text']));var _0x1b6723=this[_0x0283('0x161')]['sync'](this,_0x109f3e);if(_0x1b6723){this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')]('ispeech\x20%s\x20file\x20created',_0x1b6723));var _0x4a43fc=this[_0x0283('0x11')]['streamFile'](_0x1b6723,_0x109f3e[_0x0283('0x140')]);try{fs['unlink'](_0x1b6723+'.wav');}catch(_0x26e44c){logger[_0x0283('0x31')](_0x26e44c);}return _0x4a43fc;}return this[_0x0283('0x11')]['error'](_0x109f3e,_0x0283('0x162'));};AGIVertices[_0x0283('0x1a')]['login']=function(_0xa953fc){logger['info'](util[_0x0283('0x64')](_0x0283('0x163'),_0xa953fc['label']));if(!this[_0x0283('0x95')](_0xa953fc[_0x0283('0x164')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0xa953fc,'no\x20find\x20by\x20configured');}logger[_0x0283('0x35')](util['format'](_0x0283('0x165'),this[_0x0283('0x11')][_0x0283('0x60')],_0xa953fc[_0x0283('0x164')]));var _0x354195=this[_0x0283('0x66')][_0x0283('0xb3')](this,_0xa953fc['findBy']);if(_0x354195){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x166'),this['channel'][_0x0283('0x60')],_0xa953fc['findBy']));this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0283('0x11')][_0x0283('0x60')],_0xa953fc['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x167'),this[_0x0283('0x11')][_0x0283('0x60')],_0xa953fc[_0x0283('0x164')]));this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x167'),this[_0x0283('0x11')][_0x0283('0x60')],_0xa953fc[_0x0283('0x164')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x0283('0x168')]=function(_0xb16921){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x169'),_0xb16921[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0xb16921['findBy'])){return this[_0x0283('0x11')]['error'](_0xb16921,_0x0283('0x16a'));}logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x165'),this[_0x0283('0x11')][_0x0283('0x60')],_0xb16921['findBy']));var _0x435917=this[_0x0283('0x62')][_0x0283('0xb3')](this,_0xb16921[_0x0283('0x164')]);if(_0x435917){logger[_0x0283('0x35')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0283('0x11')][_0x0283('0x60')],_0xb16921[_0x0283('0x164')]));this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x166'),this[_0x0283('0x11')][_0x0283('0x60')],_0xb16921[_0x0283('0x164')]));return{'code':0xc8,'result':_0x0283('0x16b')};}else{logger['info'](util['format'](_0x0283('0x167'),this[_0x0283('0x11')][_0x0283('0x60')],_0xb16921[_0x0283('0x164')]));this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0283('0x11')][_0x0283('0x60')],_0xb16921[_0x0283('0x164')]));return{'code':0xc8,'result':_0x0283('0x16c')};}};AGIVertices[_0x0283('0x1a')][_0x0283('0x16d')]=function(_0x25a8a0){logger['info'](util[_0x0283('0x64')](_0x0283('0x16e'),_0x25a8a0[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x25a8a0[_0x0283('0x16f')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x25a8a0,_0x0283('0x170'));}this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x171'),_0x25a8a0[_0x0283('0x16f')]));var _0x56ffaf=eval(_0x25a8a0['operation']);if(!this[_0x0283('0x95')](_0x25a8a0[_0x0283('0xe2')])){return this['channel'][_0x0283('0xb6')](_0x0283('0xe3'));}var _0x1fa087=this['getVariable']['sync'](this,_0x25a8a0[_0x0283('0xe2')]);if(!_0x1fa087){return this[_0x0283('0x11')][_0x0283('0x31')](_0x25a8a0,_0x0283('0x123'));}if(_[_0x0283('0xa8')](_0x56ffaf)){var _0x16c902=this;_0x56ffaf[_0x0283('0xe4')](function(_0x5ecdc6,_0x5a741c){_0x16c902[_0x0283('0x11')]['setVariable'](util[_0x0283('0x64')](_0x0283('0x172'),_0x1fa087,_0x5a741c),_0x5ecdc6);});return this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')]('variable\x20%s[key]\x20set',_0x1fa087));}else{return this['channel']['setVariable'](_0x1fa087,_0x56ffaf);}};AGIVertices[_0x0283('0x1a')][_0x0283('0x173')]=function(_0x367794){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x174'),_0x367794[_0x0283('0x3d')]));if(_0x367794['retry']===0x0){return this['maxRetry'](_0x367794);}_0x367794[_0x0283('0xb4')]-=0x1;if(!this['isConfigured'](_0x367794[_0x0283('0x175')])){return this[_0x0283('0x11')]['error'](_0x367794,'no\x20file\x20audio\x20selected');}var _0x43f10e=this[_0x0283('0x23')][_0x0283('0xb3')](this,_0x367794[_0x0283('0x175')]);if(!_0x43f10e){return this['channel']['error'](_0x367794,_0x0283('0x11e'));}var _0x268e8d=this[_0x0283('0x11')][_0x0283('0x176')](_0x43f10e,_0x367794[_0x0283('0x11f')],_0x367794[_0x0283('0x177')]);var _0x22cb94=_0x268e8d[_0x0283('0xb0')];if(_0x268e8d['result']===-0x1){this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x367794,'-1');return _0x268e8d;}else if(_0x268e8d['extra']===_0x0283('0x77')){_0x268e8d[_0x0283('0xb0')]=_0x268e8d[_0x0283('0xb0')][_0x0283('0xaa')]>0x0?_0x268e8d[_0x0283('0xb0')]:'t';}else if(_[_0x0283('0x4c')](_0x268e8d[_0x0283('0xb0')])){_0x268e8d['result']='#';_0x22cb94='#';}if(!this[_0x0283('0x95')](_0x367794[_0x0283('0xe2')])){this[_0x0283('0x11')]['noop'](_0x0283('0xe3'));}else{var _0x760b43=this[_0x0283('0x14')][_0x0283('0xb3')](this,_0x367794[_0x0283('0xe2')]);if(!_0x760b43){return this[_0x0283('0x11')][_0x0283('0x31')](_0x367794,_0x0283('0x123'));}this['channel'][_0x0283('0xac')](_0x760b43,_0x22cb94);}this['createSquareDetailsReport'][_0x0283('0xb3')](this,_0x367794,_0x22cb94);return _0x268e8d;};AGIVertices[_0x0283('0x1a')][_0x0283('0xb6')]=function(_0x3f4a7c){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3f4a7c[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0xb6')](_0x3f4a7c[_0x0283('0x178')]||_0x3f4a7c[_0x0283('0x3d')]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x179')]=function(_0x29060a){logger[_0x0283('0x35')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x29060a[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x29060a[_0x0283('0x164')])){return this[_0x0283('0x11')]['error'](_0x29060a,_0x0283('0x16a'));}logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x165'),this['channel']['callerid'],_0x29060a[_0x0283('0x164')]));var _0x58b62b=this[_0x0283('0x5d')][_0x0283('0xb3')](this,_0x29060a['pause_id']);var _0x5618e4=this[_0x0283('0x5e')][_0x0283('0xb3')](this,_0x29060a[_0x0283('0x164')],_0x58b62b);if(_0x5618e4){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x166'),this[_0x0283('0x11')][_0x0283('0x60')],_0x29060a['findBy']));this[_0x0283('0x11')]['noop'](util['format'](_0x0283('0x166'),this[_0x0283('0x11')]['callerid'],_0x29060a[_0x0283('0x164')]));return{'code':0xc8,'result':_0x0283('0x16b')};}else{logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x167'),this['channel'][_0x0283('0x60')],_0x29060a[_0x0283('0x164')]));this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x29060a[_0x0283('0x164')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x0283('0x17a')]=function(_0x4dd422){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x17b'),_0x4dd422[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x4dd422[_0x0283('0x175')])){return this['channel']['error'](_0x4dd422,_0x0283('0x17c'));}var _0xa5552e=this[_0x0283('0x23')][_0x0283('0xb3')](this,_0x4dd422[_0x0283('0x175')]);if(!_0xa5552e){return this['channel'][_0x0283('0x31')](_0x4dd422,_0x0283('0x11e'));}var _0x4c1b75=this[_0x0283('0x11')][_0x0283('0x67')](_0x0283('0x17d'),[_0xa5552e,_0x4dd422[_0x0283('0xed')]]);if(_0x4c1b75[_0x0283('0xb0')]===-0x1){return _0x4c1b75;}return this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xd0'),_0x0283('0x17d'),_0xa5552e));};AGIVertices[_0x0283('0x1a')][_0x0283('0x17e')]=function(_0x43bf1f){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x43bf1f[_0x0283('0x3d')]));if(!this['isConfigured'](_0x43bf1f[_0x0283('0x17f')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x43bf1f,_0x0283('0x180'));}var _0x50eaf7='';var _0x1dad9f=parseInt(_0x43bf1f[_0x0283('0x17f')],0xa);if(isNaN(_0x1dad9f)){_0x50eaf7=_0x43bf1f[_0x0283('0x17f')];}else{_0x50eaf7=this['getVoiceQueue']['sync'](this,_0x43bf1f[_0x0283('0x17f')]);if(!_0x50eaf7){return this[_0x0283('0x11')]['error'](_0x43bf1f,'no\x20queue\x20found');}}var _0x30d44f='';if(this['isConfigured'](_0x43bf1f[_0x0283('0x175')])){var _0x328267=this[_0x0283('0x23')]['sync'](this,_0x43bf1f[_0x0283('0x175')]);if(_0x328267){_0x30d44f=_0x328267;}}this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x43bf1f,_0x50eaf7);if(_0x43bf1f['opts'][_0x0283('0x181')]('x')<0x0){_0x43bf1f[_0x0283('0xed')]+='x';}if(_0x43bf1f[_0x0283('0xed')][_0x0283('0x181')]('X')<0x0){_0x43bf1f['opts']+='X';}this[_0x0283('0x11')]['setVariable'](_0x0283('0x182'),_0x50eaf7?_0x50eaf7[_0x0283('0x183')]():'');var _0x56e493=this[_0x0283('0x11')][_0x0283('0x67')]('QUEUE',[_0x50eaf7,_0x43bf1f[_0x0283('0xed')],_0x43bf1f[_0x0283('0x75')],_0x30d44f,_0x43bf1f[_0x0283('0x77')],_0x43bf1f['agi'],_0x43bf1f[_0x0283('0x184')],_0x43bf1f['gosub'],'',_0x43bf1f[_0x0283('0x185')]]);if(_0x56e493['result']===-0x1){return _0x56e493;}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xd0'),'QUEUE',_0x50eaf7));};AGIVertices[_0x0283('0x1a')][_0x0283('0x186')]=function(_0x31a984){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x187'),_0x31a984[_0x0283('0x3d')]));var _0x368af0=_0x31a984[_0x0283('0x188')]||_0x0283('0x13c');var _0x1ebe3c=util[_0x0283('0x64')]('%s_%s',this[_0x0283('0x11')][_0x0283('0x3c')],rs[_0x0283('0x127')](0x5));var _0x2f3a02=util[_0x0283('0x64')]('%s/recordings/%s.%s',FILES_PATH,_0x1ebe3c,_0x368af0);var _0x3fd494=util[_0x0283('0x64')](_0x0283('0x147'),FILES_PATH,_0x1ebe3c);this[_0x0283('0x40')][_0x0283('0xb3')](this,_0x31a984,_0x1ebe3c,_0x2f3a02);this[_0x0283('0x11')][_0x0283('0xac')](_0x0283('0x189'),_0x1ebe3c);logger[_0x0283('0x35')](_0x0283('0x18a'),_0x3fd494,_0x368af0,_0x31a984[_0x0283('0x18b')],_0x31a984['timeout']);return this[_0x0283('0x11')][_0x0283('0x13f')](_0x3fd494,_0x368af0,_0x31a984['escape_digits'],_0x31a984[_0x0283('0x77')],undefined,!![]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x18c')]=function(_0x396b47){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x396b47['label']));if(!this[_0x0283('0x95')](_0x396b47[_0x0283('0x75')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x18d'));}var _0x30879b=this[_0x0283('0x74')][_0x0283('0xb3')](this,_0x396b47);logger['info'](util[_0x0283('0x64')](_0x0283('0x18e'),util[_0x0283('0x18f')](_0x30879b,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x396b47[_0x0283('0xe2')])){return this[_0x0283('0x11')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x307a28=this['getVariable'][_0x0283('0xb3')](this,_0x396b47[_0x0283('0xe2')]);if(!_0x307a28){return this[_0x0283('0x11')]['error'](_0x396b47,_0x0283('0x123'));}this['channel'][_0x0283('0xac')](util[_0x0283('0x64')]('%s_STATUS_CODE',_0x307a28),_0x30879b[_0x0283('0x86')]?_0x30879b[_0x0283('0x86')]:'200');this['channel'][_0x0283('0xac')](util[_0x0283('0x64')](_0x0283('0x190'),_0x307a28),_0x30879b[_0x0283('0x191')]?_0x30879b[_0x0283('0x191')]:'OK');if(_0x30879b['body']){try{this[_0x0283('0xab')](_0x30879b[_0x0283('0x7d')],_0x307a28);}catch(_0x217d76){logger[_0x0283('0x31')](util[_0x0283('0x64')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x307a28));}}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0xe7'),_0x307a28));};AGIVertices[_0x0283('0x1a')]['saydigits']=function(_0xc8030b){logger[_0x0283('0x35')](util['format'](_0x0283('0x192'),_0xc8030b[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0x193')](_0xc8030b[_0x0283('0x194')][_0x0283('0x69')](/\s+/g,''),_0xc8030b['escape_digits']);};AGIVertices[_0x0283('0x1a')][_0x0283('0x195')]=function(_0x3fe86c){logger['info'](util[_0x0283('0x64')](_0x0283('0x196'),_0x3fe86c['label']));return this[_0x0283('0x11')][_0x0283('0x197')](_0x3fe86c[_0x0283('0x76')][_0x0283('0x69')](/\s+/g,''),_0x3fe86c[_0x0283('0x18b')]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x198')]=function(_0x37f0f6){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x199'),_0x37f0f6[_0x0283('0x3d')]));return this[_0x0283('0x11')][_0x0283('0x19a')](_0x37f0f6[_0x0283('0x6d')],_0x37f0f6[_0x0283('0x18b')]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x19b')]=function(_0x38236b){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x19c'),_0x38236b[_0x0283('0x3d')]));if(!this['isConfigured'](_0x38236b[_0x0283('0x19d')])){return this['channel']['noop'](_0x0283('0x19e'));}var _0x2d608c=this['getMailAccount']['sync'](this,_0x38236b[_0x0283('0x19d')]);if(!_0x2d608c||!_0x2d608c[_0x0283('0x19f')]){return this['channel'][_0x0283('0x31')](_0x38236b,_0x0283('0x1a0'));}var _0x4e7c48={'from':util[_0x0283('0x64')]('\x22%s\x22\x20<%s>',_0x2d608c[_0x0283('0x1d')],_0x2d608c[_0x0283('0x1a1')]||_0x2d608c['Smtp'][_0x0283('0x1a2')]),'to':_0x38236b['to']||'','cc':_0x38236b['cc']||'','bcc':_0x38236b[_0x0283('0x1a3')]||'','subject':_0x38236b[_0x0283('0x1a4')],'html':_0x38236b[_0x0283('0x6d')],'text':_0x38236b[_0x0283('0x6d')]};var _0x42c0e7={'tls':{'rejectUnauthorized':![]}};if(_0x2d608c[_0x0283('0x19f')]['service']){_0x42c0e7[_0x0283('0x1a5')]=_0x2d608c[_0x0283('0x19f')][_0x0283('0x1a5')];}else{_0x42c0e7[_0x0283('0x1a6')]=_0x2d608c['Smtp'][_0x0283('0x1a6')];_0x42c0e7[_0x0283('0x1a7')]=_0x2d608c[_0x0283('0x19f')][_0x0283('0x1a7')];_0x42c0e7['secure']=_0x2d608c[_0x0283('0x19f')][_0x0283('0x1a8')];}if(_0x2d608c['Smtp']['authentication']){_0x42c0e7[_0x0283('0x1a9')]={'user':_0x2d608c[_0x0283('0x19f')][_0x0283('0x1a2')],'pass':_0x2d608c[_0x0283('0x19f')][_0x0283('0x1aa')]};}if(this[_0x0283('0x95')](_0x38236b['template_id'])){}logger[_0x0283('0xe9')](_0x0283('0x1ab'),JSON[_0x0283('0x84')](_0x4e7c48));this[_0x0283('0xb2')]['sync'](this,_0x38236b,_0x38236b[_0x0283('0x19d')]);this['channel']['noop'](util[_0x0283('0x64')](_0x0283('0x1ac'),_0x2d608c[_0x0283('0x1d')]));this['sendMailMessage'][_0x0283('0xb3')](this,_0x42c0e7,_0x4e7c48);return this['channel']['noop'](_0x0283('0x1ad'));};AGIVertices[_0x0283('0x1a')]['sendFax']=function(_0xa7b46d){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1ae'),_0xa7b46d[_0x0283('0x3d')]));return this[_0x0283('0x11')]['noop'](_0x0283('0x1af'));};AGIVertices[_0x0283('0x1a')][_0x0283('0x1b0')]=function(_0x4ac32d){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1b1'),_0x4ac32d[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x4ac32d[_0x0283('0x1b2')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x1b3'));}var _0x4e31c5=this[_0x0283('0x39')][_0x0283('0xb3')](this,_0x4ac32d['sms_account_id']);if(!_0x4e31c5){return this['channel'][_0x0283('0x31')](_0x4ac32d,_0x0283('0x1b4'));}var _0x332e5b={'body':_0x4ac32d['sms_text'],'phone':_0x4ac32d['to']||'','SmsAccountId':_0x4e31c5['id']};logger['debug'](_0x0283('0x1b5'),JSON[_0x0283('0x84')](_0x332e5b));this['createSquareDetailsReport']['sync'](this,_0x4ac32d,_0x4ac32d['sms_account_id']);this['channel']['noop'](util[_0x0283('0x64')](_0x0283('0x1b6'),_0x4e31c5[_0x0283('0x1d')]));this[_0x0283('0x3b')][_0x0283('0xb3')](this,_0x332e5b);return this[_0x0283('0x11')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x0283('0x1b7')]=function(_0x4b096e){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4b096e['label']));if(!this[_0x0283('0x95')](_0x4b096e[_0x0283('0xe2')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x4b096e,_0x0283('0x1b8'));}var _0x5a1b8d=this['getVariable'][_0x0283('0xb3')](this,_0x4b096e['variable_id']);if(!_0x5a1b8d){return this[_0x0283('0x11')][_0x0283('0x31')](_0x4b096e,_0x0283('0x123'));}return this['channel'][_0x0283('0xac')](_0x5a1b8d,_0x4b096e[_0x0283('0x1b9')]);};AGIVertices[_0x0283('0x1a')][_0x0283('0x1ba')]=function(_0x5f1c96){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5f1c96[_0x0283('0x3d')]));this[_0x0283('0x11')]['noop']('START\x20CALLY\x20SQUARE');if(_0x5f1c96['answer']===_0x0283('0x1bb')){this[_0x0283('0x11')][_0x0283('0xb6')]('Answer');return this['channel'][_0x0283('0xc6')]();}return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0x1bc'));};AGIVertices[_0x0283('0x1a')]['subproject']=function(_0x5d50ae){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1bd'),_0x5d50ae[_0x0283('0x3d')]));if(!this['isConfigured'](_0x5d50ae[_0x0283('0x1be')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x5d50ae,_0x0283('0x1bf'));}var _0x1228c1=this[_0x0283('0x1b')][_0x0283('0xb3')](this,_0x5d50ae[_0x0283('0x1be')]);if(!this[_0x0283('0x95')](_0x1228c1)){return this['channel'][_0x0283('0x31')](_0x5d50ae,util[_0x0283('0x64')](_0x0283('0x1c0'),_0x5d50ae[_0x0283('0x1be')]));}if(_0x1228c1===this[_0x0283('0x11')][_0x0283('0x3f')]){return this[_0x0283('0x11')]['error'](_0x5d50ae,_0x0283('0x1c1'));}this[_0x0283('0xb2')][_0x0283('0xb3')](this,_0x5d50ae,_0x1228c1);var _0x2d773c=this[_0x0283('0x11')][_0x0283('0x67')](_0x0283('0x1c2'),util[_0x0283('0x64')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x0283('0x1a6')]||'127.0.0.1',_0x1228c1,this[_0x0283('0x11')][_0x0283('0x3f')]));if(_0x2d773c[_0x0283('0xb0')]===-0x1){return _0x2d773c;}return this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')]('Executed\x20command\x20%s\x20%s',_0x0283('0x1c2'),_0x1228c1));};AGIVertices[_0x0283('0x1a')]['system']=function(_0x20439c){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1c3'),_0x20439c[_0x0283('0x3d')]));var _0x5f2d51=this['shellCommand']['sync'](this,_0x20439c[_0x0283('0x1c4')]);this['createSquareDetailsReport'][_0x0283('0xb3')](this,_0x20439c,_0x20439c['command']);if(this['isConfigured'](_0x20439c[_0x0283('0xe2')])){var _0x5947fa=this[_0x0283('0x14')][_0x0283('0xb3')](this,_0x20439c[_0x0283('0xe2')]);if(_0x5947fa){this[_0x0283('0x11')][_0x0283('0xac')](_0x5947fa,_0x5f2d51);return this['channel']['noop'](util[_0x0283('0x64')](_0x0283('0x1c5'),_0x20439c[_0x0283('0x1c4')],_0x5947fa));}}return this['channel'][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x1c6'),_0x20439c[_0x0283('0x1c4')]));};AGIVertices[_0x0283('0x1a')][_0x0283('0x1c7')]=function(_0x39f09d){logger['info'](util[_0x0283('0x64')](_0x0283('0x1c8'),_0x39f09d['label']));_0x39f09d[_0x0283('0x6d')]=_0x39f09d[_0x0283('0x6d')][_0x0283('0x69')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0283('0x95')](_0x39f09d[_0x0283('0x6b')])){return this[_0x0283('0x11')]['noop'](_0x0283('0x1c9'));}if(!this[_0x0283('0x95')](_0x39f09d[_0x0283('0x6d')])){return this[_0x0283('0x11')][_0x0283('0xb6')](_0x0283('0xd3'));}this[_0x0283('0x11')][_0x0283('0xb6')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x39f09d['text']));var _0x5da1e=this['googleCloudTTS']['sync'](this,_0x39f09d);if(_0x5da1e){this['channel']['noop'](util['format'](_0x0283('0x1ca'),_0x5da1e));var _0x1c9988=this[_0x0283('0x11')][_0x0283('0x10e')](_0x5da1e);try{fs[_0x0283('0x10f')](_0x5da1e+_0x0283('0x110'));}catch(_0x45cd30){logger[_0x0283('0x31')](_0x45cd30);}return _0x1c9988;}return this[_0x0283('0x11')][_0x0283('0x31')](_0x39f09d,_0x0283('0x1cb'));};AGIVertices[_0x0283('0x1a')][_0x0283('0x1cc')]=function(_0x3d678c){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1cd'),_0x3d678c[_0x0283('0x3d')]));_0x3d678c[_0x0283('0x6d')]=_0x3d678c[_0x0283('0x6d')][_0x0283('0x69')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0283('0x95')](_0x3d678c['text'])){return this['channel'][_0x0283('0xb6')](_0x0283('0xd3'));}this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x1ce'),_0x3d678c[_0x0283('0x6d')]));var _0x2bf770=this[_0x0283('0x72')][_0x0283('0xb3')](this,_0x3d678c);if(_0x2bf770){this[_0x0283('0x11')][_0x0283('0xb6')](util['format'](_0x0283('0x1cf'),_0x2bf770));var _0x2641fd=this[_0x0283('0x11')]['streamFile'](_0x2bf770);try{fs[_0x0283('0x10f')](_0x2bf770+_0x0283('0x110'));}catch(_0x394b2d){logger['error'](_0x394b2d);}return _0x2641fd;}return this[_0x0283('0x11')][_0x0283('0x31')](_0x3d678c,_0x0283('0x1d0'));};AGIVertices[_0x0283('0x1a')]['unpause']=function(_0x5e15f9){logger[_0x0283('0x35')](util[_0x0283('0x64')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5e15f9[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x5e15f9[_0x0283('0x164')])){return this[_0x0283('0x11')][_0x0283('0x31')](_0x5e15f9,_0x0283('0x16a'));}logger[_0x0283('0x35')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0283('0x11')]['callerid'],_0x5e15f9[_0x0283('0x164')]));var _0x563d76=this[_0x0283('0x61')][_0x0283('0xb3')](this,_0x5e15f9[_0x0283('0x164')]);if(_0x563d76){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x166'),this[_0x0283('0x11')][_0x0283('0x60')],_0x5e15f9[_0x0283('0x164')]));this[_0x0283('0x11')][_0x0283('0xb6')](util[_0x0283('0x64')](_0x0283('0x166'),this[_0x0283('0x11')][_0x0283('0x60')],_0x5e15f9[_0x0283('0x164')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x167'),this[_0x0283('0x11')][_0x0283('0x60')],_0x5e15f9[_0x0283('0x164')]));this[_0x0283('0x11')]['noop'](util[_0x0283('0x64')](_0x0283('0x167'),this[_0x0283('0x11')][_0x0283('0x60')],_0x5e15f9[_0x0283('0x164')]));return{'code':0xc8,'result':_0x0283('0x16c')};}};AGIVertices[_0x0283('0x1a')][_0x0283('0x1d1')]=function(_0x165935){logger[_0x0283('0x35')](util['format'](_0x0283('0x1d2'),_0x165935[_0x0283('0x3d')]));var _0x4fa4c9=this[_0x0283('0x11')]['exec']('VOICEMAIL',[_0x165935[_0x0283('0x1d3')],_0x165935[_0x0283('0x89')]]);if(_0x4fa4c9['result']===-0x1){return _0x4fa4c9;}return this[_0x0283('0x11')][_0x0283('0xb6')](util['format']('Executed\x20command\x20%s\x20%s',_0x0283('0x1d4'),_0x165935['mailbox']));};AGIVertices['prototype'][_0x0283('0x1d5')]=function(_0x26568f){logger[_0x0283('0x35')](util[_0x0283('0x64')](_0x0283('0x1d6'),_0x26568f[_0x0283('0x3d')]));if(!this[_0x0283('0x95')](_0x26568f[_0x0283('0xe2')])){return this[_0x0283('0x11')]['error'](_0x26568f,_0x0283('0x1b8'));}var _0x2f6d48=this[_0x0283('0x14')][_0x0283('0xb3')](this,_0x26568f[_0x0283('0xe2')]);if(!_0x2f6d48){return this['channel'][_0x0283('0x31')](_0x26568f,_0x0283('0x123'));}var _0x1ade0=this['channel']['getVariable'](_0x2f6d48);return{'code':0xc8,'result':_0x1ade0['extra']?_0x1ade0[_0x0283('0xaf')]:'-'};};String[_0x0283('0x1a')][_0x0283('0xae')]=function(_0x2f6e33,_0x5f095f){return this['split'](_0x2f6e33)[_0x0283('0x1d7')](_0x5f095f);};module[_0x0283('0x1d8')]=AGIVertices; \ No newline at end of file +var _0xe3c5=['agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','restAPI','method','timeout','includes','PUT','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','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_access_key_id','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','retry','maxRetry','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','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','getData','response','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','interval_id','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','toLowerCase','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','system','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariable','name','catch','prototype','getVoiceQueue','then','getSquareProject','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','scheduledAt','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','utcOffset','scheduledat','minutes','insertContact','timezones','add','getPause','getPauseById','agentPause'];(function(_0x23af91,_0x425b1e){var _0x9d3c4e=function(_0x2fa16d){while(--_0x2fa16d){_0x23af91['push'](_0x23af91['shift']());}};_0x9d3c4e(++_0x425b1e);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0xe3c5[_0x5e77db];return _0x34b675;};'use strict';var fs=require('fs');var path=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var _=require(_0x5e3c('0x2'));var sh=require(_0x5e3c('0x3'));var odbc=require(_0x5e3c('0x4'))();var rs=require(_0x5e3c('0x5'));var moment=require('moment');var Mustache=require(_0x5e3c('0x6'));var rp=require(_0x5e3c('0x7'));var logger=require(_0x5e3c('0x8'))(_0x5e3c('0x9'));var config=require(_0x5e3c('0xa'));var shared=require(_0x5e3c('0xb'));var scripts=require(_0x5e3c('0xc'));var FILES_PATH=_0x5e3c('0xd');var recursiveMapAttributes=[_0x5e3c('0xe'),_0x5e3c('0xf')];var verticesWithRetry=[_0x5e3c('0x10'),_0x5e3c('0x11'),'getsecretdigits'];var AGIVertices=function(_0x58769f,_0x32942e,_0x125a7c){this[_0x5e3c('0x12')]=_0x58769f;this[_0x5e3c('0x13')]=_0x32942e;this[_0x5e3c('0x14')]=_0x125a7c;};AGIVertices['prototype'][_0x5e3c('0x15')]=function(_0x375352,_0x5e110b){this[_0x5e3c('0x13')]['getVariableById'](_0x375352)['then'](function(_0x3b547c){_0x5e110b(null,_0x3b547c?_0x3b547c[_0x5e3c('0x16')]:![]);})[_0x5e3c('0x17')](function(_0x3b3ee8){_0x5e110b(_0x3b3ee8);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x19')]=function(_0x324a36,_0x1427d5){this['rpc']['getVoiceQueueById'](_0x324a36)[_0x5e3c('0x1a')](function(_0x2183ba){_0x1427d5(null,_0x2183ba?_0x2183ba[_0x5e3c('0x16')]:![]);})['catch'](function(_0x4f7318){_0x1427d5(_0x4f7318);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1b')]=function(_0x321487,_0x2c7c83){this['rpc']['getSquareProjectById'](_0x321487)[_0x5e3c('0x1a')](function(_0x5e4a11){_0x2c7c83(null,_0x5e4a11?_0x5e4a11['name']:![]);})[_0x5e3c('0x17')](function(_0x551ccb){_0x2c7c83(_0x551ccb);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x1f26d4,_0x189480){this['rpc'][_0x5e3c('0x1c')](_0x1f26d4)['then'](function(_0x1a4523){_0x189480(null,_0x1a4523?_0x1a4523[_0x5e3c('0x1d')]:![]);})[_0x5e3c('0x17')](function(_0x1e9bae){_0x189480(_0x1e9bae);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1e')]=function(_0xf2a06c,_0x5ddd09){this['rpc']['getUserById'](_0xf2a06c)['then'](function(_0x3c0679){_0x5ddd09(null,_0x3c0679?_0x3c0679[_0x5e3c('0x16')]:![]);})[_0x5e3c('0x17')](function(_0x1cf57f){_0x5ddd09(_0x1cf57f);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1f')]=function(_0x5d254a,_0x33b1dc){this[_0x5e3c('0x13')][_0x5e3c('0x20')](_0x5d254a)[_0x5e3c('0x1a')](function(_0x535155){_0x33b1dc(null,_0x535155?_0x535155['name']:![]);})[_0x5e3c('0x17')](function(_0x22418b){_0x33b1dc(_0x22418b);});};AGIVertices['prototype'][_0x5e3c('0x21')]=function(_0x134b29,_0x17fac8){var _0x40cfb5=this;this[_0x5e3c('0x13')]['getSoundById'](_0x134b29)[_0x5e3c('0x1a')](function(_0x59acbb){_0x17fac8(null,_0x59acbb?_0x40cfb5['getSoundPath'](_0x59acbb[_0x5e3c('0x22')]):![]);})[_0x5e3c('0x17')](function(_0xe61c3){_0x17fac8(_0xe61c3);});};AGIVertices[_0x5e3c('0x18')]['getMailAccount']=function(_0x20d813,_0x17223c){this[_0x5e3c('0x13')][_0x5e3c('0x23')](_0x20d813)['then'](function(_0x57145c){_0x17223c(null,_0x57145c?_0x57145c:![]);})[_0x5e3c('0x17')](function(_0x1ba87b){_0x17223c(_0x1ba87b);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x24')]=function(_0x58f1c6,_0x2ec738,_0x2acef1){this[_0x5e3c('0x14')]['sendMailMessage'](_0x58f1c6,_0x2ec738)[_0x5e3c('0x1a')](function(){_0x2acef1(null);})['catch'](function(_0x10b007){_0x2acef1(_0x10b007);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x25')]=function(_0x4dcb7b,_0x969b1e){this['rpc'][_0x5e3c('0x26')](_0x4dcb7b)[_0x5e3c('0x1a')](function(_0x198883){if(_0x198883){if(_0x198883[_0x5e3c('0x27')]){_0x969b1e(null,[_0x198883['interval']]);}else{_0x969b1e(null,_[_0x5e3c('0x28')](_0x198883[_0x5e3c('0x29')],_0x5e3c('0x2a')));}}else{_0x969b1e(null,![]);}})[_0x5e3c('0x17')](function(_0x30991b){_0x969b1e(_0x30991b);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x2b')]=function(_0x46e60c){return util['format'](_0x5e3c('0x2c'),FILES_PATH,_0x46e60c);};AGIVertices[_0x5e3c('0x18')]['getQueryOdbc']=function(_0x547003,_0xe71887,_0x56470e){odbc[_0x5e3c('0x2d')](_0x547003,function(_0x14c006){if(_0x14c006){logger[_0x5e3c('0x2e')](_0x5e3c('0x2f'),_0x14c006);_0x56470e(_0x14c006);}else{logger[_0x5e3c('0x30')]('ODBC\x20connection\x20successfully');odbc[_0x5e3c('0x31')](_0xe71887,function(_0x4a2d52,_0x41f0e3){if(_0x4a2d52){logger[_0x5e3c('0x30')](_0x5e3c('0x32'),_0xe71887);_0x56470e(_0x4a2d52);}else{logger[_0x5e3c('0x30')](_0x5e3c('0x33'),_0xe71887);odbc[_0x5e3c('0x34')](function(_0x244f01){if(_0x244f01){logger[_0x5e3c('0x2e')](_0x5e3c('0x35'),_0x244f01);}_0x56470e(null,_0x41f0e3);});}});}});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x36')]=function(_0x45823e,_0x3318a6){this[_0x5e3c('0x13')][_0x5e3c('0x37')](_0x45823e)['then'](function(_0x4b8242){_0x3318a6(null,_0x4b8242?_0x4b8242:![]);})[_0x5e3c('0x17')](function(_0x147f5a){_0x3318a6(_0x147f5a);});};AGIVertices['prototype'][_0x5e3c('0x38')]=function(_0x274ae4,_0x36dcad){this[_0x5e3c('0x13')][_0x5e3c('0x38')](_0x274ae4)['then'](function(_0x4aaf4f){_0x36dcad(null,_0x4aaf4f);})[_0x5e3c('0x17')](function(_0x492adb){_0x36dcad(_0x492adb);});};AGIVertices[_0x5e3c('0x18')]['createSquareDetailsReport']=function(_0x4e0fbc,_0x306431,_0x51da8a){this[_0x5e3c('0x13')][_0x5e3c('0x39')]({'uniqueid':this[_0x5e3c('0x12')][_0x5e3c('0x3a')],'node':_0x4e0fbc[_0x5e3c('0x3b')],'application':_0x4e0fbc[_0x5e3c('0x3c')],'data':_0x306431||null,'project_name':this['channel'][_0x5e3c('0x3d')],'callerid':this[_0x5e3c('0x12')][_0x5e3c('0x3e')]})[_0x5e3c('0x1a')](function(_0x5a6c80){if(_0x51da8a){_0x51da8a(null,_0x5a6c80);}})[_0x5e3c('0x17')](function(_0xdc834){if(_0x51da8a){_0x51da8a(_0xdc834);}});};AGIVertices[_0x5e3c('0x18')]['createSquareRecording']=function(_0x1cc6f4,_0x3837b2,_0x3ca581,_0x1d5c5d){this[_0x5e3c('0x13')]['createSquareRecording']({'uniqueid':this[_0x5e3c('0x12')][_0x5e3c('0x3a')],'callerid':this['channel'][_0x5e3c('0x3e')],'calleridname':this['channel'][_0x5e3c('0x3f')],'context':this[_0x5e3c('0x12')][_0x5e3c('0x40')],'extension':this[_0x5e3c('0x12')][_0x5e3c('0x41')],'priority':this[_0x5e3c('0x12')][_0x5e3c('0x42')],'accountcode':this[_0x5e3c('0x12')]['accountcode'],'dnid':this[_0x5e3c('0x12')][_0x5e3c('0x43')],'projectName':this[_0x5e3c('0x12')][_0x5e3c('0x3d')],'saveName':_0x3837b2,'filename':_0x1cc6f4[_0x5e3c('0x44')]||_0x3837b2,'savePath':_0x3ca581})[_0x5e3c('0x1a')](function(_0xd1281c){_0x1d5c5d(null,_0xd1281c);})[_0x5e3c('0x17')](function(_0x20b7e0){_0x1d5c5d(_0x20b7e0);});};AGIVertices[_0x5e3c('0x18')]['createSquareMessage']=function(_0x546dd6,_0x64bbd1,_0x57ff61,_0x233f9e,_0x27b10a){this[_0x5e3c('0x13')][_0x5e3c('0x45')]({'uniqueid':this[_0x5e3c('0x12')][_0x5e3c('0x3a')],'body':_0x546dd6,'direction':_0x64bbd1,'providerName':_0x57ff61,'providerResponse':_0x233f9e})[_0x5e3c('0x1a')](function(_0x48f6bf){if(_0x27b10a){_0x27b10a(null,_0x48f6bf);}})[_0x5e3c('0x17')](function(_0x4a2258){if(_0x27b10a){_0x27b10a(_0x4a2258);}});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x46')]=function(_0x183668,_0x2d9f26){var _0x169f3f=this;var _0x5251f2=0x0;var _0x1daabe={'firstName':_['isEmpty'](_0x183668[_0x5e3c('0x16')])||_[_0x5e3c('0x47')](_0x183668['name'])?_0x5e3c('0x48')+Math[_0x5e3c('0x49')]():_0x183668['name'],'lastName':_[_0x5e3c('0x4a')](_0x183668[_0x5e3c('0x4b')])||_[_0x5e3c('0x47')](_0x183668['lastName'])?null:_0x183668[_0x5e3c('0x4b')],'phone':_0x183668[_0x5e3c('0x4c')],'ListId':_0x183668['list_id'],'scheduledat':_0x183668[_0x5e3c('0x4d')],'callbackUniqueid':this[_0x5e3c('0x12')][_0x5e3c('0x3a')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x183668[_0x5e3c('0x4d')][_0x5e3c('0x4e')](),'priority':_0x183668[_0x5e3c('0x4f')]};if(_[_0x5e3c('0x50')](_0x183668,'dialTimezone')){if(!_['isNil'](_0x183668['dialTimezone'])){var _0x2dc93e=_0x183668[_0x5e3c('0x51')];if(_0x183668[_0x5e3c('0x51')]==_0x5e3c('0x52')){this[_0x5e3c('0x13')]['getContactByPhone']({'phone':_0x183668[_0x5e3c('0x4c')]})[_0x5e3c('0x1a')](function(_0x4b32ec){if(!_[_0x5e3c('0x47')](_0x4b32ec)){var _0x50dfc4=_0x4b32ec[_0x5e3c('0x51')];if(!_[_0x5e3c('0x47')](_0x50dfc4)){var _0x56eff1=shared['timezones'][_0x50dfc4];if(!_[_0x5e3c('0x47')](_0x56eff1)){var _0x4af609=-0x1*_0x56eff1[_0x5e3c('0x53')];_0x1daabe[_0x5e3c('0x54')]=moment(_0x183668[_0x5e3c('0x54')])['add'](_0x4af609,_0x5e3c('0x55'));_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}else{_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}}else{_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}}else{_0x169f3f['insertContact'](_0x1daabe,_0x183668,_0x2d9f26);}});}else{var _0x5251f2=shared[_0x5e3c('0x57')][_0x2dc93e];if(!_['isNil'](_0x5251f2)){var _0x57266b=-0x1*_0x5251f2['utcOffset'];_0x1daabe[_0x5e3c('0x54')]=moment(_0x183668[_0x5e3c('0x54')])[_0x5e3c('0x58')](_0x57266b,_0x5e3c('0x55'));_0x169f3f['insertContact'](_0x1daabe,_0x183668,_0x2d9f26);}else{_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}}}else{_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}}else{_0x169f3f[_0x5e3c('0x56')](_0x1daabe,_0x183668,_0x2d9f26);}};AGIVertices['prototype'][_0x5e3c('0x59')]=function(_0x2633b3,_0xebde78){this['rpc'][_0x5e3c('0x5a')](_0x2633b3)[_0x5e3c('0x1a')](function(_0x2ec921){_0xebde78(null,_0x2ec921?_0x2ec921[_0x5e3c('0x16')]:![]);})[_0x5e3c('0x17')](function(_0x3f54fd){_0xebde78(_0x3f54fd);});};AGIVertices['prototype'][_0x5e3c('0x5b')]=function(_0x592e7f,_0x17eedf,_0xba64cc){var _0x5f964a={'role':_0x5e3c('0x5c')};_0x5f964a[_0x592e7f]=this[_0x5e3c('0x12')][_0x5e3c('0x3e')];this[_0x5e3c('0x13')][_0x5e3c('0x5b')](_0x5f964a,_0x17eedf,this[_0x5e3c('0x12')][_0x5e3c('0x3a')])[_0x5e3c('0x1a')](function(_0x27fe20){_0xba64cc(null,_[_0x5e3c('0x47')](_0x27fe20)?![]:!![]);})[_0x5e3c('0x17')](function(_0x426046){logger['error'](_0x426046);_0xba64cc(null,![]);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x5d')]=function(_0x2bf908,_0x10c5f4){var _0x2b28f0={'role':_0x5e3c('0x5c')};_0x2b28f0[_0x2bf908]=this['channel']['callerid'];this[_0x5e3c('0x13')][_0x5e3c('0x5d')](_0x2b28f0)[_0x5e3c('0x1a')](function(_0x86eeb7){_0x10c5f4(null,_[_0x5e3c('0x47')](_0x86eeb7)?![]:!![]);})['catch'](function(_0x1c8c96){logger[_0x5e3c('0x2e')](_0x1c8c96);_0x10c5f4(null,![]);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x5e')]=function(_0x185ba0,_0x22de41){var _0x543f46={'role':_0x5e3c('0x5c')};_0x543f46[_0x185ba0]=this[_0x5e3c('0x12')][_0x5e3c('0x3e')];this[_0x5e3c('0x13')][_0x5e3c('0x5e')](_0x543f46)[_0x5e3c('0x1a')](function(_0x46c5df){_0x22de41(null,_[_0x5e3c('0x47')](_0x46c5df)?![]:!![]);})[_0x5e3c('0x17')](function(_0xbf163e){logger[_0x5e3c('0x2e')](_0xbf163e);_0x22de41(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1e7f87,_0x403ea1){var _0x1f5ad4={'role':_0x5e3c('0x5c')};_0x1f5ad4[_0x1e7f87]=this['channel'][_0x5e3c('0x3e')];var _0x389b79=_0x1e7f87!=_0x5e3c('0x5f')?util[_0x5e3c('0x60')](_0x5e3c('0x61'),_0x5e3c('0x62'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')]):undefined;this[_0x5e3c('0x13')][_0x5e3c('0x63')](_0x1f5ad4,_0x389b79)[_0x5e3c('0x1a')](function(_0x3cfedd){_0x403ea1(null,_[_0x5e3c('0x47')](_0x3cfedd)?![]:!![]);})[_0x5e3c('0x17')](function(_0x20dfcf){logger['error'](_0x20dfcf);_0x403ea1(null,![]);});};AGIVertices['prototype'][_0x5e3c('0x64')]=function(_0x2a55c1,_0x268dbc){sh[_0x5e3c('0x65')](_[_0x5e3c('0x66')](_0x2a55c1),function(_0x4e9e3e,_0x13195b){var _0xdd778c=_0x13195b['replace'](/(\r\n|\n|\r)/gm,'');_0x268dbc(null,_0xdd778c);});};AGIVertices['prototype'][_0x5e3c('0x67')]=function(_0x5a213b,_0x5b57d3){scripts['googleCloudTTS'](_0x5a213b[_0x5e3c('0x68')],_0x5a213b[_0x5e3c('0x69')]||_0x5e3c('0x6a'),_0x5a213b[_0x5e3c('0x6a')],_0x5a213b[_0x5e3c('0x6b')]||_0x5e3c('0x6c'),_0x5a213b[_0x5e3c('0x6d')]||_0x5e3c('0x6e'),_0x5a213b[_0x5e3c('0x6f')]||'MP3')['then'](function(_0x35aeb6){_0x5b57d3(null,_0x35aeb6);})[_0x5e3c('0x17')](function(_0x2e0fb4){_0x5b57d3(_0x2e0fb4);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x70')]=function(_0x18c487,_0x58150e){scripts[_0x5e3c('0x70')](_0x18c487[_0x5e3c('0x6a')],_0x18c487['google_tts_language']||'en',0x1)[_0x5e3c('0x1a')](function(_0x55b4da){_0x58150e(null,_0x55b4da);})[_0x5e3c('0x17')](function(_0x4d5d52){_0x58150e(_0x4d5d52);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x71')]=function(_0x343605,_0x2b08f2){var _0xc1e77={'uri':_0x343605['url'],'method':_0x343605[_0x5e3c('0x72')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x343605['timeout'])==='number'&&parseInt(_0x343605[_0x5e3c('0x73')])>=0x1?parseInt(_0x343605[_0x5e3c('0x73')])*0x3e8:0x5*0x3e8};if(_[_0x5e3c('0x74')](['POST',_0x5e3c('0x75')],_0xc1e77['method'][_0x5e3c('0x76')]())){try{_0xc1e77[_0x5e3c('0x77')]=_0x343605['rawBody']?JSON[_0x5e3c('0x78')](_0x343605[_0x5e3c('0xf')]):{};}catch(_0xbbe79e){logger[_0x5e3c('0x2e')](_0x5e3c('0x79'),_0xbbe79e);}}try{_0xc1e77['headers']=_0x343605[_0x5e3c('0xe')]?JSON[_0x5e3c('0x78')](_0x343605[_0x5e3c('0xe')]):{};}catch(_0x382c57){logger[_0x5e3c('0x2e')](_0x5e3c('0x7a'),_0x382c57);}if(_0x343605['computedVariables']){try{var _0x12f6cf=require(_0x343605[_0x5e3c('0x7b')])['sync'](this,_0xc1e77);_0xc1e77[_0x5e3c('0x7c')]=Mustache[_0x5e3c('0x7d')](_0x343605[_0x5e3c('0x7e')],_0x12f6cf,{},['$$','$$']);if(_0xc1e77['headers']){_0xc1e77[_0x5e3c('0x7f')]=JSON[_0x5e3c('0x78')](Mustache['render'](JSON['stringify'](_0xc1e77[_0x5e3c('0x7f')]),_0x12f6cf,{},['$$','$$']));}if(_0xc1e77[_0x5e3c('0x77')]){_0xc1e77[_0x5e3c('0x77')]=JSON[_0x5e3c('0x78')](Mustache[_0x5e3c('0x7d')](JSON[_0x5e3c('0x80')](_0xc1e77[_0x5e3c('0x77')]),_0x12f6cf,{},['$$','$$']));}}catch(_0x2905a5){logger[_0x5e3c('0x2e')](_0x5e3c('0x81'),_0x2905a5);}}rp(_0xc1e77)[_0x5e3c('0x1a')](function(_0x33498f){var _0x231d15={'statusCode':_0x33498f[_0x5e3c('0x82')]||0xc8,'statusMessage':_0x33498f['statusMessage']||'OK','headers':_0x33498f[_0x5e3c('0x7f')]||{},'body':_0x33498f[_0x5e3c('0x77')]||{}};_0x2b08f2(null,_0x231d15);})[_0x5e3c('0x17')](function(_0x584bc8){var _0x2c5898={'statusCode':_0x584bc8[_0x5e3c('0x82')]||0x1f4,'statusMessage':_0x584bc8[_0x5e3c('0x83')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x584bc8[_0x5e3c('0x84')][_0x5e3c('0x7f')]||{},'body':_0x584bc8[_0x5e3c('0x84')]['body']||{}};_0x2b08f2(null,_0x2c5898);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x85')]=function(_0x3757f5,_0x3b5ed6){scripts['googleDialogflow'](this[_0x5e3c('0x12')][_0x5e3c('0x3a')],_0x3757f5[_0x5e3c('0x86')],_0x3757f5[_0x5e3c('0x6a')],_0x3757f5['dialogflow_language']||'en')[_0x5e3c('0x1a')](function(_0x3750ec){_0x3b5ed6(null,_0x3750ec);})[_0x5e3c('0x17')](function(_0xe810c4){_0x3b5ed6(_0xe810c4);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x87')]=function(_0x5d0fa2,_0x2c9c5d){scripts[_0x5e3c('0x87')](this[_0x5e3c('0x12')][_0x5e3c('0x3a')],_0x5d0fa2[_0x5e3c('0x88')],_0x5d0fa2[_0x5e3c('0x89')],_0x5d0fa2['private_key'],_0x5d0fa2[_0x5e3c('0x6a')],_0x5d0fa2[_0x5e3c('0x8a')]||'en')[_0x5e3c('0x1a')](function(_0x7b62f1){_0x2c9c5d(null,_0x7b62f1);})[_0x5e3c('0x17')](function(_0x14645b){_0x2c9c5d(_0x14645b);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x8b')]=function(_0x29683e,_0x3dfca3){scripts['sestekNDA'](this[_0x5e3c('0x12')],_0x29683e)[_0x5e3c('0x1a')](function(_0x1d8a72){_0x3dfca3(null,_0x1d8a72);})['catch'](function(_0x21796f){_0x3dfca3(_0x21796f);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x8c')]=function(_0x20abeb,_0x45aeaf){scripts[_0x5e3c('0x8c')](_0x20abeb[_0x5e3c('0x86')],_0x20abeb[_0x5e3c('0x6a')],_0x20abeb[_0x5e3c('0x8d')]||_0x5e3c('0x6c'),_0x20abeb[_0x5e3c('0x8e')])[_0x5e3c('0x1a')](function(_0x29b74f){_0x45aeaf(null,_0x29b74f);})[_0x5e3c('0x17')](function(_0xb84e07){_0x45aeaf(_0xb84e07);});};AGIVertices['prototype'][_0x5e3c('0x8f')]=function(_0x5b9592,_0x50b20e,_0x577879){scripts[_0x5e3c('0x8f')](_0x50b20e,_0x5b9592[_0x5e3c('0x86')],_0x5b9592['ispeech_asr_language']||'en-US',this[_0x5e3c('0x90')](_0x5b9592[_0x5e3c('0x91')])?_0x5b9592['model']:undefined)[_0x5e3c('0x1a')](function(_0x400b00){_0x577879(null,_0x400b00);})['catch'](function(_0x1be707){_0x577879(_0x1be707);});};AGIVertices['prototype'][_0x5e3c('0x92')]=function(_0xedeb0f,_0x208686){scripts[_0x5e3c('0x92')](_0xedeb0f['aws_access_key_id'],_0xedeb0f['aws_secret_access_key'],_0xedeb0f[_0x5e3c('0x93')],_0xedeb0f[_0x5e3c('0x94')]||_0x5e3c('0x95'),_0xedeb0f[_0x5e3c('0x6a')],_0xedeb0f['aws_text_type']||_0x5e3c('0x6a'))[_0x5e3c('0x1a')](function(_0x25987d){_0x208686(null,_0x25987d);})['catch'](function(_0x228b69){_0x208686(_0x228b69);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x96')]=function(_0x227a1a,_0x3a08a8){scripts[_0x5e3c('0x96')](this[_0x5e3c('0x12')][_0x5e3c('0x3a')],_0x227a1a[_0x5e3c('0x97')],_0x227a1a[_0x5e3c('0x98')],_0x227a1a['aws_lex_region'],_0x227a1a[_0x5e3c('0x6a')],_0x227a1a[_0x5e3c('0x99')])[_0x5e3c('0x1a')](function(_0x3630c5){_0x3a08a8(null,_0x3630c5);})[_0x5e3c('0x17')](function(_0x3493f2){_0x3a08a8(_0x3493f2);});};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x9a')]=function(_0x54cbeb,_0x24e8d9,_0x28ba19){scripts['googleASR'](_0x24e8d9,_0x54cbeb[_0x5e3c('0x86')],_0x54cbeb[_0x5e3c('0x9b')]||_0x5e3c('0x6c'))[_0x5e3c('0x1a')](function(_0x1d8d40){_0x28ba19(null,_0x1d8d40);})[_0x5e3c('0x17')](function(_0x5a08f4){_0x28ba19(_0x5a08f4);});};AGIVertices['prototype'][_0x5e3c('0x9c')]=function(_0x2213f4,_0x24b46d,_0x92c9b8){scripts['tildeASR'](_0x24b46d,_0x2213f4[_0x5e3c('0x9d')],_0x2213f4[_0x5e3c('0x9e')],_0x2213f4[_0x5e3c('0x7c')])['then'](function(_0x4c20a0){_0x92c9b8(null,_0x4c20a0);})[_0x5e3c('0x17')](function(_0x40c3fc){_0x92c9b8(_0x40c3fc);});};AGIVertices['prototype'][_0x5e3c('0x9f')]=function(_0x3a4b0d){var _0x1c08a2=_[_0x5e3c('0x74')](verticesWithRetry,_0x3a4b0d[_0x5e3c('0x3c')])?_0x3a4b0d:_[_0x5e3c('0xa0')](_0x3a4b0d);for(var _0x57649f in _0x1c08a2){if(_0x1c08a2[_0x5e3c('0xa1')](_0x57649f)){if(_0x1c08a2[_0x57649f]&&_['isString'](_0x1c08a2[_0x57649f])){if(_[_0x5e3c('0x74')](recursiveMapAttributes,_0x57649f)){_0x1c08a2[_0x57649f]=this['replaceObjectAllVariables'](_0x1c08a2[_0x57649f]);}else{_0x1c08a2[_0x57649f]=this[_0x5e3c('0xa2')](_0x1c08a2[_0x57649f]);}}}}return _0x1c08a2;};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xa3')]=function(_0xaab30b){for(var _0x1f92f7 in _0xaab30b){if(_0xaab30b[_0x5e3c('0xa1')](_0x1f92f7)){if(_[_0x5e3c('0xa4')](_0xaab30b[_0x1f92f7])){this['recursiveNodeIndex'](_0xaab30b[_0x1f92f7]);}else if(_[_0x5e3c('0xa5')](_0xaab30b[_0x1f92f7])){for(var _0x59d1c3=0x0;_0x59d1c3<_0xaab30b[_0x1f92f7][_0x5e3c('0xa6')];_0x59d1c3++){this['recursiveNodeIndex'](_0xaab30b[_0x1f92f7][_0x59d1c3]);}}else if(_['isString'](_0xaab30b[_0x1f92f7])){_0xaab30b[_0x1f92f7]=this[_0x5e3c('0xa2')](_0xaab30b[_0x1f92f7]);}}}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xa7')]=function(_0x3e1d7d,_0x925b70){for(var _0x5d1dbf in _0x3e1d7d){if(_0x3e1d7d['hasOwnProperty'](_0x5d1dbf)){if(_[_0x5e3c('0xa4')](_0x3e1d7d[_0x5d1dbf])){if(!_['isEmpty'](_0x3e1d7d[_0x5d1dbf])){this['saveRestApiResult'](_0x3e1d7d[_0x5d1dbf],util[_0x5e3c('0x60')](_0x5e3c('0xa8'),_0x925b70,_0x5d1dbf));}}else if(_[_0x5e3c('0xa5')](_0x3e1d7d[_0x5d1dbf])){for(var _0x2b8f3a=0x0;_0x2b8f3a<_0x3e1d7d[_0x5d1dbf]['length'];_0x2b8f3a++){this[_0x5e3c('0xa7')](_0x3e1d7d[_0x5d1dbf][_0x2b8f3a],util[_0x5e3c('0x60')](_0x5e3c('0xa8'),_0x925b70,_0x5d1dbf+'['+_0x2b8f3a+']'));}}else{if(!_[_0x5e3c('0x47')](_0x3e1d7d[_0x5d1dbf])){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0xa8'),_0x925b70,_0x5d1dbf),_0x3e1d7d[_0x5d1dbf]);}}}}};AGIVertices[_0x5e3c('0x18')]['replaceObjectAllVariables']=function(_0x20a469){try{var _0x25584c=JSON[_0x5e3c('0x78')](_0x20a469);this[_0x5e3c('0xa3')](_0x25584c);return JSON[_0x5e3c('0x80')](_0x25584c);}catch(_0x23af4b){return this[_0x5e3c('0xa2')](_0x20a469);}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xa2')]=function(_0x20fa58){var _0x312b18=_0x20fa58[_0x5e3c('0xaa')]('{');for(var _0x61ef7a=0x1;_0x61ef7a<_0x312b18[_0x5e3c('0xa6')];_0x61ef7a+=0x1){var _0x8ed011=_0x312b18[_0x61ef7a]['split']('}');if(_0x8ed011[_0x5e3c('0xa6')]>0x1){_0x20fa58=_0x20fa58[_0x5e3c('0xab')]('{'+_0x8ed011[0x0]+'}',this[_0x5e3c('0x12')][_0x5e3c('0x15')](_0x8ed011[0x0])[_0x5e3c('0xac')]||_0x8ed011[0x0]);}}if(_0x312b18[_0x5e3c('0xa6')]===0x1){return _0x20fa58[_0x5e3c('0x4e')]();}return this[_0x5e3c('0xa2')](_0x20fa58);};AGIVertices['prototype']['getAndSetVariable']=function(_0x1992ea,_0x1f15fc){var _0x26b9b3=this[_0x5e3c('0x12')]['getVariable'](_0x1992ea);if(_0x26b9b3[_0x5e3c('0xad')]===-0x1){return _0x26b9b3;}logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0xae'),_0x1f15fc,_0x26b9b3['extra']));return this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0x1f15fc,_0x26b9b3[_0x5e3c('0xac')]);};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x90')]=function(_0x38aa99){return _0x38aa99&&_0x38aa99!=='0'&&_0x38aa99!=='-1'&&_0x38aa99!=='';};AGIVertices[_0x5e3c('0x18')]['maxRetry']=function(_0x1ab125){this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x1ab125,'-');_0x1ab125[_0x5e3c('0xb0')]=_0x1ab125[_0x5e3c('0xb1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xb2')]=function(_0x4151fd){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0xb3'),_0x4151fd[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x4151fd[_0x5e3c('0x6a')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0xb5'));}var _0xd3280c='\x22'+_0x4151fd['text']+'\x22';if(this[_0x5e3c('0x90')](_0x4151fd[_0x5e3c('0x84')])){_0xd3280c+=','+_0x4151fd[_0x5e3c('0x84')];}var _0x55c482=this[_0x5e3c('0x12')][_0x5e3c('0x65')]('MRCPSynth',_0xd3280c);if(_0x55c482[_0x5e3c('0xad')]===-0x1){return _0x55c482;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xb6'),_0xd3280c));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xb7')]=function(_0x31aa14){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0xb8'),_0x31aa14[_0x5e3c('0x3b')]));if(!this['isConfigured'](_0x31aa14[_0x5e3c('0xb9')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xba'));}var _0x569964=_0x31aa14['grammar'];if(this[_0x5e3c('0x90')](_0x31aa14['options'])){_0x569964+=','+_0x31aa14[_0x5e3c('0x84')];}var _0x373d89=this[_0x5e3c('0x12')][_0x5e3c('0x65')](_0x5e3c('0xbb'),_0x569964);if(_0x373d89[_0x5e3c('0xad')]===-0x1){return _0x373d89;}var _0x59a184=this[_0x5e3c('0xbc')](_0x5e3c('0xbd'),_0x5e3c('0xbe'));if(_0x59a184[_0x5e3c('0xad')]===-0x1){return _0x59a184;}var _0x4c84e7=this[_0x5e3c('0xbc')](_0x5e3c('0xbf'),_0x5e3c('0xc0'));if(_0x4c84e7[_0x5e3c('0xad')]===-0x1){return _0x4c84e7;}var _0x4f5fd2=this[_0x5e3c('0xbc')](_0x5e3c('0xc1'),_0x5e3c('0xc2'));if(_0x4f5fd2[_0x5e3c('0xad')]===-0x1){return _0x4f5fd2;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xc3'),_0x569964));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x9')]=function(_0x51e480){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0xc4'),_0x51e480['label']));return this[_0x5e3c('0x12')][_0x5e3c('0x9')]([_0x51e480[_0x5e3c('0xc5')],_0x51e480[_0x5e3c('0xc6')]]);};AGIVertices[_0x5e3c('0x18')]['answer']=function(_0xcc3869){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0xc7'),_0xcc3869[_0x5e3c('0x3b')]));if(this[_0x5e3c('0x90')](_0xcc3869['timeout'])){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0xc8'),_0xcc3869[_0x5e3c('0x73')]));var _0x411153=this[_0x5e3c('0x12')]['wait'](_0xcc3869[_0x5e3c('0x73')]);if(_0x411153['result']===-0x1){return _0x411153;}}return this[_0x5e3c('0x12')][_0x5e3c('0xc9')]();};AGIVertices[_0x5e3c('0x18')]['callback']=function(_0xcd93db){logger['info'](util['format'](_0x5e3c('0xca'),_0xcd93db[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0xcd93db[_0x5e3c('0xcb')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0xcd93db,_0x5e3c('0xcc'));}_0xcd93db[_0x5e3c('0x4d')]=moment();if(this[_0x5e3c('0x90')](_0xcd93db[_0x5e3c('0xcd')])){_0xcd93db['scheduledAt']=moment()[_0x5e3c('0x58')](_0xcd93db['delay'],_0x5e3c('0x55'));}if(!this[_0x5e3c('0x90')](_0xcd93db[_0x5e3c('0x4f')])){_0xcd93db[_0x5e3c('0x4f')]=0x2;}this['createCmContact']['sync'](this,_0xcd93db);return this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xce'),_0xcd93db[_0x5e3c('0x4c')],_0xcd93db[_0x5e3c('0xcb')],_0xcd93db[_0x5e3c('0x4d')]));};AGIVertices['prototype'][_0x5e3c('0xcf')]=function(_0x2fe3a8){logger[_0x5e3c('0x30')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2fe3a8['label']));var _0x26c689=this[_0x5e3c('0x12')][_0x5e3c('0x65')](_0x2fe3a8['application'],_0x2fe3a8[_0x5e3c('0x84')]);if(_0x26c689['result']===-0x1){return _0x26c689;}return this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')]('Executed\x20command\x20%s\x20%s',_0x2fe3a8['application'],_0x2fe3a8[_0x5e3c('0x84')]));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xd0')]=function(_0x243968){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0xd1'),_0x243968[_0x5e3c('0x3b')]));if(!this['isConfigured'](_0x243968[_0x5e3c('0x6a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xb5'));}var _0x33ffef='\x22'+_0x243968[_0x5e3c('0x6a')]+'\x22';if(this['isConfigured'](_0x243968[_0x5e3c('0x84')])){_0x33ffef+=','+_0x243968[_0x5e3c('0x84')];}var _0x3f4df7=this[_0x5e3c('0x12')][_0x5e3c('0x65')](_0x5e3c('0xd2'),_0x33ffef);if(_0x3f4df7[_0x5e3c('0xad')]===-0x1){return _0x3f4df7;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0xb6'),_0x33ffef));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xd3')]=function(_0x1d9b2f){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x1d9b2f[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x1d9b2f['text'])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20text\x20configured');}var _0x58cf60='\x22'+_0x1d9b2f[_0x5e3c('0x6a')]+'\x22';if(this['isConfigured'](_0x1d9b2f[_0x5e3c('0x84')])){_0x58cf60+=','+_0x1d9b2f[_0x5e3c('0x84')];}var _0x4cc042=this[_0x5e3c('0x12')]['exec']('MRCPSynth',_0x58cf60);if(_0x4cc042['result']===-0x1){return _0x4cc042;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0xb6'),_0x58cf60));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xd4')]=function(_0x19344d){logger['info'](util['format'](_0x5e3c('0xd5'),_0x19344d[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x19344d[_0x5e3c('0xb9')])){return this['channel'][_0x5e3c('0xb4')]('no\x20grammar\x20configured');}var _0xb1b7db=_0x19344d[_0x5e3c('0xb9')];if(this[_0x5e3c('0x90')](_0x19344d[_0x5e3c('0x84')])){_0xb1b7db+=','+_0x19344d[_0x5e3c('0x84')];}var _0x30d2a2=this['channel']['exec']('MRCPRecog',_0xb1b7db);if(_0x30d2a2[_0x5e3c('0xad')]===-0x1){return _0x30d2a2;}var _0x452e81=this[_0x5e3c('0xbc')](_0x5e3c('0xbd'),_0x5e3c('0xd6'));if(_0x452e81[_0x5e3c('0xad')]===-0x1){return _0x452e81;}var _0x470e91=this[_0x5e3c('0xbc')](_0x5e3c('0xbf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x470e91[_0x5e3c('0xad')]===-0x1){return _0x470e91;}var _0x588ab0=this['getAndSetVariable'](_0x5e3c('0xc1'),_0x5e3c('0xd7'));if(_0x588ab0[_0x5e3c('0xad')]===-0x1){return _0x588ab0;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0xc3'),_0xb1b7db));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xd8')]=function(_0x1f8bcc){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1f8bcc[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x1f8bcc[_0x5e3c('0xb9')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0xba'));}var _0xeca2c1=_0x1f8bcc[_0x5e3c('0xb9')];if(this[_0x5e3c('0x90')](_0x1f8bcc[_0x5e3c('0x84')])){_0xeca2c1+=','+_0x1f8bcc[_0x5e3c('0x84')];}var _0x20faa5=this['channel'][_0x5e3c('0x65')](_0x5e3c('0xbb'),_0xeca2c1);if(_0x20faa5['result']===-0x1){return _0x20faa5;}var _0xa9acd2=this['getAndSetVariable'](_0x5e3c('0xbd'),_0x5e3c('0xd9'));if(_0xa9acd2[_0x5e3c('0xad')]===-0x1){return _0xa9acd2;}var _0x165302=this['getAndSetVariable']('RECOG_INPUT()',_0x5e3c('0xda'));if(_0x165302[_0x5e3c('0xad')]===-0x1){return _0x165302;}var _0x84459a=this[_0x5e3c('0xbc')](_0x5e3c('0xc1'),_0x5e3c('0xdb'));if(_0x84459a[_0x5e3c('0xad')]===-0x1){return _0x84459a;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('Executed\x20command\x20MRCPRecog\x20%s',_0xeca2c1));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xdc')]=function(_0x53f8c1){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0xdd'),_0x53f8c1[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x53f8c1[_0x5e3c('0xde')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x53f8c1,_0x5e3c('0xdf'));}var _0x36af6c=this[_0x5e3c('0xe0')][_0x5e3c('0xaf')](this,_0x53f8c1[_0x5e3c('0xde')]);if(!_0x36af6c){return this['channel'][_0x5e3c('0x2e')](_0x53f8c1,_0x5e3c('0xe1'));}if(!this['isConfigured'](_0x53f8c1[_0x5e3c('0x31')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x53f8c1,_0x5e3c('0xe2'));}var _0x37575c=_0x53f8c1[_0x5e3c('0x31')][_0x5e3c('0xe3')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0xe4'),_0x37575c));var _0x3eebe9=this['getQueryOdbc'][_0x5e3c('0xaf')](this,_0x36af6c,_0x37575c);this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x53f8c1,_0x37575c);if(!this[_0x5e3c('0x90')](_0x53f8c1['variable_id'])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xe5'));}var _0x25c9e3=this[_0x5e3c('0x15')][_0x5e3c('0xaf')](this,_0x53f8c1['variable_id']);if(!_0x25c9e3){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x53f8c1,_0x5e3c('0xe6'));}var _0x518612=this;_0x3eebe9[_0x5e3c('0xe7')](function(_0x41738d,_0x55b314){Object[_0x5e3c('0xe8')](_0x41738d)[_0x5e3c('0xe7')](function(_0x17beae){_0x518612[_0x5e3c('0x12')]['setVariable'](util[_0x5e3c('0x60')](_0x5e3c('0xe9'),_0x25c9e3,_0x55b314,_0x17beae),_0x41738d[_0x17beae]);});});this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util['format'](_0x5e3c('0xea'),_0x25c9e3),_0x3eebe9[_0x5e3c('0xa6')]);return this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xeb'),_0x25c9e3));};AGIVertices['prototype'][_0x5e3c('0xec')]=function(_0x4434bf){logger[_0x5e3c('0xed')](util[_0x5e3c('0x60')](_0x5e3c('0xee'),_0x4434bf['label']));if(!this[_0x5e3c('0x90')](_0x4434bf['sip_id'])){return this['channel'][_0x5e3c('0x2e')](_0x4434bf,'no\x20user\x20selected');}var _0x538da4=this[_0x5e3c('0x1e')][_0x5e3c('0xaf')](this,_0x4434bf[_0x5e3c('0xef')]);if(!_0x538da4){return this['channel'][_0x5e3c('0x2e')](_0x4434bf,_0x5e3c('0xf0'));}var _0x16421f=this['channel']['exec'](_0x5e3c('0xf1'),[util[_0x5e3c('0x60')](_0x5e3c('0xf2'),_0x538da4),_0x4434bf[_0x5e3c('0x73')],_0x4434bf[_0x5e3c('0xf3')],_0x4434bf[_0x5e3c('0x7e')]]);if(_0x16421f[_0x5e3c('0xad')]===-0x1){return _0x16421f;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format']('Executed\x20command\x20%s',_0x5e3c('0xf1')));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xf4')]=function(_0x235455){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0xf5'),_0x235455[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x235455[_0x5e3c('0x86')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x235455[_0x5e3c('0x6a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20text\x20configured');}this[_0x5e3c('0x12')][_0x5e3c('0xf6')]=!![];this['createSquareDetailsReport'](_0x235455);this[_0x5e3c('0x45')](_0x235455[_0x5e3c('0x6a')],'in','','');this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('Trying\x20Dialogflow:\x20%s',_0x235455[_0x5e3c('0x6a')]));var _0x5a6628=this[_0x5e3c('0x85')]['sync'](this,_0x235455);if(_0x5a6628){for(var _0x437861 in _0x5a6628){if(_0x5a6628[_0x5e3c('0xa1')](_0x437861)){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util[_0x5e3c('0x60')]('DIALOGFLOW_%s',_0x437861[_0x5e3c('0x76')]()),_0x5a6628[_0x437861]);}}this[_0x5e3c('0x45')](_0x5a6628[_0x5e3c('0xf7')],'out','dialogflow','');return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xf8'),_0x5a6628[_0x5e3c('0xf7')]));}return this[_0x5e3c('0x12')]['error'](_0x235455,_0x5e3c('0xf9'));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xfa')]=function(_0x26cc2d){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0xfb'),_0x26cc2d['label']));if(!this[_0x5e3c('0x90')](_0x26cc2d[_0x5e3c('0x88')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xfc'));}if(!this[_0x5e3c('0x90')](_0x26cc2d['client_email'])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0xfd'));}if(!this[_0x5e3c('0x90')](_0x26cc2d[_0x5e3c('0xfe')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0xff'));}if(!this['isConfigured'](_0x26cc2d[_0x5e3c('0x8a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x100'));}if(!this[_0x5e3c('0x90')](_0x26cc2d[_0x5e3c('0x6a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xb5'));}this['channel'][_0x5e3c('0xf6')]=!![];this[_0x5e3c('0x39')](_0x26cc2d);this[_0x5e3c('0x45')](_0x26cc2d[_0x5e3c('0x6a')],'in','','');this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x101'),_0x26cc2d[_0x5e3c('0x6a')]));var _0x371873=this[_0x5e3c('0x87')][_0x5e3c('0xaf')](this,_0x26cc2d);if(_0x371873){for(var _0x297bb2 in _0x371873){if(_0x371873[_0x5e3c('0xa1')](_0x297bb2)){if(_0x297bb2!==_0x5e3c('0x102')){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0x103'),_0x297bb2[_0x5e3c('0x76')]()),_0x371873[_0x297bb2]);}}}this[_0x5e3c('0x45')](_0x371873['speech'],_0x5e3c('0x104'),'dialogflowV2',_0x371873['providerResponse']);return this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')]('DialogflowV2\x20Result\x20%s',_0x371873[_0x5e3c('0xf7')]));}return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x26cc2d,_0x5e3c('0x105'));};AGIVertices['prototype']['sesteknda']=function(_0x27f8fb){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x106'),_0x27f8fb[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x27f8fb[_0x5e3c('0x107')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x108'));}if(!this[_0x5e3c('0x90')](_0x27f8fb[_0x5e3c('0x109')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x10a'));}if(!this[_0x5e3c('0x90')](_0x27f8fb[_0x5e3c('0x10b')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x10c'));}if(!this[_0x5e3c('0x90')](_0x27f8fb['ndassistant_url'])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0xb5'));}this['channel'][_0x5e3c('0xf6')]=!![];this[_0x5e3c('0x39')](_0x27f8fb);this['createSquareMessage'](_0x27f8fb[_0x5e3c('0x6a')],'in','','');this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x10d'),_0x27f8fb[_0x5e3c('0x6a')]));var _0x10c1e0=this[_0x5e3c('0x8b')]['sync'](this,_0x27f8fb);if(_0x10c1e0){for(var _0x16d05c in _0x10c1e0){if(_0x10c1e0[_0x5e3c('0xa1')](_0x16d05c)){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0x10e'),_0x16d05c[_0x5e3c('0x76')]()),_0x10c1e0[_0x16d05c]);}}this[_0x5e3c('0x45')](_0x10c1e0[_0x5e3c('0xf7')],'out',_0x5e3c('0x10f'),'');if(_0x10c1e0['audiofile']){this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x10c1e0[_0x5e3c('0x110')]));var _0x48524a=this['channel'][_0x5e3c('0x111')](_0x10c1e0[_0x5e3c('0x110')]);try{fs[_0x5e3c('0x112')](_0x10c1e0['audiofile']+_0x5e3c('0x113'));}catch(_0x4320d6){logger[_0x5e3c('0x2e')](_0x4320d6);}return _0x48524a;}else{return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x114'),_0x10c1e0[_0x5e3c('0xf7')]));}}return this['channel'][_0x5e3c('0x2e')](_0x27f8fb,_0x5e3c('0x115'));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x116')]=function(_0x489881){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x117'),_0x489881[_0x5e3c('0x3b')]));return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('end');};AGIVertices[_0x5e3c('0x18')]['ext_dial']=function(_0x3a44df){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x118'),_0x3a44df[_0x5e3c('0x3b')]));var _0x115101='';if(_0x3a44df[_0x5e3c('0x119')]){if(!this[_0x5e3c('0x90')](_0x3a44df[_0x5e3c('0x119')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x3a44df,_0x5e3c('0x11a'));}else{var _0x157b78=parseInt(_0x3a44df[_0x5e3c('0x119')],0xa);if(isNaN(_0x157b78)){_0x115101=_0x3a44df[_0x5e3c('0x119')];}else{_0x115101=this[_0x5e3c('0x1f')][_0x5e3c('0xaf')](this,_0x3a44df[_0x5e3c('0x119')]);if(!_0x115101){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x3a44df,_0x5e3c('0x11b'));}}}}else if(_0x3a44df[_0x5e3c('0x11c')]){_0x115101=_0x3a44df['trunk_name'];}else{return this[_0x5e3c('0x12')]['error'](_0x3a44df,_0x5e3c('0x11a'));}var _0x44fe57=this['channel']['exec'](_0x5e3c('0xf1'),[util[_0x5e3c('0x60')](_0x5e3c('0x11d'),_0x115101,_0x3a44df[_0x5e3c('0x4c')]),_0x3a44df[_0x5e3c('0x73')],_0x3a44df['opts'],_0x3a44df[_0x5e3c('0x7e')]]);if(_0x44fe57['result']===-0x1){return _0x44fe57;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x11e'),_0x5e3c('0xf1')));};AGIVertices['prototype'][_0x5e3c('0x11f')]=function(_0x260afd){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x120'),_0x260afd[_0x5e3c('0x3b')]));return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x11f'));};AGIVertices[_0x5e3c('0x18')]['getdigits']=function(_0x5cc8a6){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x121'),_0x5cc8a6[_0x5e3c('0x3b')]));if(_0x5cc8a6[_0x5e3c('0xb0')]===0x0){return this['maxRetry'](_0x5cc8a6);}_0x5cc8a6[_0x5e3c('0xb0')]-=0x1;if(!this['isConfigured'](_0x5cc8a6[_0x5e3c('0x122')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x5cc8a6,_0x5e3c('0x123'));}var _0x35b928=this[_0x5e3c('0x21')][_0x5e3c('0xaf')](this,_0x5cc8a6[_0x5e3c('0x122')]);if(!_0x35b928){return this[_0x5e3c('0x12')]['error'](_0x5cc8a6,_0x5e3c('0x124'));}if(!this[_0x5e3c('0x90')](_0x5cc8a6[_0x5e3c('0x125')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x5e3c('0xe5'));}var _0x44e5fc=this[_0x5e3c('0x12')][_0x5e3c('0x126')](_0x35b928,_0x5cc8a6[_0x5e3c('0x127')],_0x5cc8a6['maxdigit']);var _0x419e26=_0x44e5fc[_0x5e3c('0xad')]?_0x44e5fc[_0x5e3c('0xad')][_0x5e3c('0x4e')]():'';logger[_0x5e3c('0x30')]('test',JSON[_0x5e3c('0x80')](_0x44e5fc));if(_0x44e5fc['result']===-0x1){this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x5cc8a6,_0x419e26);return _0x44e5fc;}else if(_0x44e5fc[_0x5e3c('0xac')]===_0x5e3c('0x73')){_0x44e5fc[_0x5e3c('0xad')]=_0x419e26[_0x5e3c('0xa6')]>=parseInt(_0x5cc8a6['mindigit'])?'x':'i';}else{_0x44e5fc[_0x5e3c('0xad')]=_0x419e26[_0x5e3c('0xa6')]>=parseInt(_0x5cc8a6[_0x5e3c('0x128')])&&_0x419e26[_0x5e3c('0xa6')]<=parseInt(_0x5cc8a6[_0x5e3c('0x129')])?'x':'i';}var _0x5e915c=this[_0x5e3c('0x15')][_0x5e3c('0xaf')](this,_0x5cc8a6[_0x5e3c('0x125')]);if(!_0x5e915c){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x5cc8a6,_0x5e3c('0xe6'));}this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0x5e915c,_0x419e26);if(this['isConfigured'](_0x5cc8a6['hiddendigitsnum'])){var _0x362f0d=parseInt(_0x5cc8a6[_0x5e3c('0x12a')],0xa);var _0x35a20d=rs[_0x5e3c('0x12b')]({'charset':'*','length':_0x362f0d});var _0x2b7404=_0x419e26[_0x5e3c('0xa6')];if(_0x2b7404>0x0){if(_0x2b7404>_0x362f0d){this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x5cc8a6,_0x5cc8a6[_0x5e3c('0x12c')]===_0x5e3c('0x12d')?_0x35a20d+_0x419e26[_0x5e3c('0x12e')](_0x362f0d):_0x419e26[_0x5e3c('0x12e')](0x0,_0x2b7404-_0x362f0d)+_0x35a20d);}else{this[_0x5e3c('0x39')]['sync'](this,_0x5cc8a6,rs[_0x5e3c('0x12b')]({'charset':'*','length':_0x2b7404}));}}else{this['createSquareDetailsReport'][_0x5e3c('0xaf')](this,_0x5cc8a6,'');}}else{this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x5cc8a6,_0x419e26);}return _0x44e5fc;};AGIVertices[_0x5e3c('0x18')]['getsecretdigits']=function(_0x36555f){logger['info'](util[_0x5e3c('0x60')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x36555f['label']));return this[_0x5e3c('0x11')](_0x36555f);};AGIVertices[_0x5e3c('0x18')]['goal']=function(_0x4bf8ee){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x12f'),_0x4bf8ee[_0x5e3c('0x3b')]));this['createSquareDetailsReport']['sync'](this,_0x4bf8ee,_0x4bf8ee[_0x5e3c('0x130')]);return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x131'),_0x4bf8ee['goalname']));};AGIVertices['prototype'][_0x5e3c('0x132')]=function(_0x138ddc){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x133'),_0x138ddc['label']));if(!this['isConfigured'](_0x138ddc[_0x5e3c('0x97')])||!this[_0x5e3c('0x90')](_0x138ddc[_0x5e3c('0x98')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x134'));}if(!this[_0x5e3c('0x90')](_0x138ddc[_0x5e3c('0x6a')])){return this['channel']['noop'](_0x5e3c('0xb5'));}this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')](_0x5e3c('0x135'),_0x138ddc[_0x5e3c('0x6a')]));var _0x5693dd=this[_0x5e3c('0x92')][_0x5e3c('0xaf')](this,_0x138ddc);if(_0x5693dd){this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x136'),_0x5693dd));var _0x5b33be=this['channel'][_0x5e3c('0x111')](_0x5693dd);try{fs['unlink'](_0x5693dd+'.wav');}catch(_0x1f2713){logger[_0x5e3c('0x2e')](_0x1f2713);}return _0x5b33be;}return this['channel'][_0x5e3c('0x2e')](_0x138ddc,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x5e3c('0x137')]=function(_0x7c5e31){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x138'),_0x7c5e31[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x7c5e31['aws_access_key_id'])||!this[_0x5e3c('0x90')](_0x7c5e31[_0x5e3c('0x98')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x134'));}if(!this[_0x5e3c('0x90')](_0x7c5e31[_0x5e3c('0x99')])){return this[_0x5e3c('0x12')]['noop'](_0x5e3c('0x139'));}if(!this[_0x5e3c('0x90')](_0x7c5e31['text'])){return this['channel']['noop'](_0x5e3c('0xb5'));}this[_0x5e3c('0x12')]['bot']=!![];this[_0x5e3c('0x39')](_0x7c5e31);this[_0x5e3c('0x45')](_0x7c5e31[_0x5e3c('0x6a')],'in','','');this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('Trying\x20Amazon\x20Lex:\x20%s',_0x7c5e31['text']));var _0x33e785=this[_0x5e3c('0x96')][_0x5e3c('0xaf')](this,_0x7c5e31);if(_0x33e785){for(var _0x23c1d8 in _0x33e785){if(_0x33e785[_0x5e3c('0xa1')](_0x23c1d8)&&_[_0x5e3c('0x13a')](_0x33e785[_0x23c1d8])){this['channel'][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0x13b'),_0x23c1d8[_0x5e3c('0x76')]()),_0x33e785[_0x23c1d8]);}}if(_[_0x5e3c('0x47')](_0x33e785['message'])){return this[_0x5e3c('0x12')]['noop'](_0x5e3c('0x13c'));}else{this['createSquareMessage'](_0x33e785[_0x5e3c('0x83')],'out',_0x5e3c('0x13d'),'');return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x33e785[_0x5e3c('0x83')]));}}return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x7c5e31,_0x5e3c('0x13e'));};AGIVertices[_0x5e3c('0x18')]['googleasr']=function(_0x329b6a){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x13f'),_0x329b6a['label'],_0x329b6a[_0x5e3c('0x73')]));if(!this[_0x5e3c('0x90')](_0x329b6a['key'])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x140'));}var _0x45e114='wav';var _0x1000e1=util[_0x5e3c('0x60')](_0x5e3c('0x141'),FILES_PATH,rs[_0x5e3c('0x12b')](0x4));var _0x280473=util[_0x5e3c('0x60')](_0x5e3c('0xa8'),_0x1000e1,_0x45e114);var _0xc648d8=!![];if(_0x329b6a[_0x5e3c('0x142')]===_0x5e3c('0x143')){_0xc648d8=![];}var _0x19cfc9=this[_0x5e3c('0x12')][_0x5e3c('0x144')](_0x1000e1,_0x45e114,_0x329b6a[_0x5e3c('0x145')],_0x329b6a[_0x5e3c('0x73')],undefined,_0xc648d8);if(_0x19cfc9['result']!==-0x1){this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('google\x20%s\x20file\x20created',_0x280473));var _0x1aac6f=this['googleASR'][_0x5e3c('0xaf')](this,_0x329b6a,_0x280473);if(_0x1aac6f){for(var _0x55e580 in _0x1aac6f){if(_0x1aac6f[_0x5e3c('0xa1')](_0x55e580)){this['channel'][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0x146'),_0x55e580[_0x5e3c('0x76')]()),_0x1aac6f[_0x55e580]);}}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x147'),JSON['stringify'](_0x1aac6f)));}}return _0x19cfc9;};AGIVertices['prototype'][_0x5e3c('0x148')]=function(_0x50e690){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x149'),_0x50e690[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x50e690['appid'])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20appid\x20configured');}if(!this[_0x5e3c('0x90')](_0x50e690[_0x5e3c('0x9e')])){return this['channel']['noop'](_0x5e3c('0x14a'));}var _0x30bf48='wav';var _0x2938e3=util[_0x5e3c('0x60')](_0x5e3c('0x141'),FILES_PATH,rs[_0x5e3c('0x12b')](0x4));var _0x32f3ea=util[_0x5e3c('0x60')](_0x5e3c('0xa8'),_0x2938e3,_0x30bf48);var _0x568fa0=!![];if(_0x50e690[_0x5e3c('0x142')]==='NOBEEP'){_0x568fa0=![];}var _0x3ada56=this[_0x5e3c('0x12')][_0x5e3c('0x144')](_0x2938e3,_0x30bf48,_0x50e690[_0x5e3c('0x145')],_0x50e690['timeout'],undefined,_0x568fa0);if(_0x3ada56[_0x5e3c('0xad')]!==-0x1){this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x14b'),_0x32f3ea));var _0x7de464=this[_0x5e3c('0x9c')][_0x5e3c('0xaf')](this,_0x50e690,_0x32f3ea);if(_0x7de464){for(var _0x199aec in _0x7de464){if(_0x7de464[_0x5e3c('0xa1')](_0x199aec)){this[_0x5e3c('0x12')]['setVariable'](util[_0x5e3c('0x60')](_0x5e3c('0x14c'),_0x199aec['toUpperCase']()),_0x7de464[_0x199aec]);}}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x14d'),JSON[_0x5e3c('0x80')](_0x7de464)));}}return _0x3ada56;};AGIVertices['prototype'][_0x5e3c('0x14e')]=function(_0x52f531){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x14f'),_0x52f531[_0x5e3c('0x3b')]));return this['channel'][_0x5e3c('0x150')](_0x52f531['context'],_0x52f531[_0x5e3c('0x41')],_0x52f531[_0x5e3c('0x42')]);};AGIVertices['prototype'][_0x5e3c('0x151')]=function(_0x20b4a5){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x152'),_0x20b4a5[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x20b4a5[_0x5e3c('0x153')])){return this['channel'][_0x5e3c('0x2e')](_0x20b4a5,'no\x20condition\x20configured');}try{var _0x27ac20=eval(_0x20b4a5[_0x5e3c('0x153')])?_0x5e3c('0x154'):_0x5e3c('0x155');this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('EVAL\x20CONDITION\x20%s\x20%s',_0x20b4a5[_0x5e3c('0x153')],_0x27ac20));return{'code':0xc8,'result':_0x27ac20};}catch(_0xc37b8f){return{'code':0xc8,'result':_0x5e3c('0x155')};}};AGIVertices['prototype'][_0x5e3c('0x156')]=function(_0x4c5a72){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4c5a72[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x4c5a72['interval_id'])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4c5a72,'no\x20interval\x20configured');}var _0x5c3518=this[_0x5e3c('0x25')][_0x5e3c('0xaf')](this,_0x4c5a72[_0x5e3c('0x157')]);if(!_0x5c3518){return this[_0x5e3c('0x12')]['error'](_0x4c5a72,'no\x20intervals\x20found');}for(var _0x5c99a1=0x0;_0x5c99a1<_0x5c3518[_0x5e3c('0xa6')];_0x5c99a1+=0x1){var _0x35768c=this[_0x5e3c('0x12')]['getVariable'](util[_0x5e3c('0x60')]('IFTIME(%s?true:false)',_0x5c3518[_0x5c99a1]));if(_0x35768c[_0x5e3c('0xad')]===-0x1){return _0x35768c;}logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x158'),_0x5c3518[_0x5c99a1],_0x35768c[_0x5e3c('0xac')]));if(_0x35768c[_0x5e3c('0xac')]===_0x5e3c('0x154')){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x158'),_0x5c3518[_0x5c99a1],'true'));this['channel'][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x158'),_0x5c3518[_0x5c99a1],_0x5e3c('0x154')));return{'code':0xc8,'result':_0x5e3c('0x154')};}else{logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('IFTIME\x20%s\x20%s',_0x5c3518[_0x5c99a1],_0x5e3c('0x155')));this[_0x5e3c('0x12')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x5c3518[_0x5c99a1],_0x5e3c('0x155')));}}return{'code':0xc8,'result':_0x5e3c('0x155')};};AGIVertices['prototype'][_0x5e3c('0x159')]=function(_0x2fa2d3){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x15a'),_0x2fa2d3[_0x5e3c('0x3b')]));return this[_0x5e3c('0x12')]['hangup']();};AGIVertices['prototype'][_0x5e3c('0x15b')]=function(_0x47023c){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x15c'),_0x47023c['label']));if(!this[_0x5e3c('0x90')](_0x47023c[_0x5e3c('0x86')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x140'));}var _0x3b7ed0=_0x5e3c('0x15d');var _0x22dce9=util[_0x5e3c('0x60')](_0x5e3c('0x141'),FILES_PATH,rs[_0x5e3c('0x12b')](0x4));var _0x350a6b=util['format'](_0x5e3c('0xa8'),_0x22dce9,_0x3b7ed0);var _0x4dc84b=!![];if(_0x47023c[_0x5e3c('0x142')]===_0x5e3c('0x143')){_0x4dc84b=![];}var _0x3bfb5a=this[_0x5e3c('0x12')][_0x5e3c('0x144')](_0x22dce9,_0x3b7ed0,_0x47023c[_0x5e3c('0x145')],_0x47023c[_0x5e3c('0x73')],undefined,_0x4dc84b);if(_0x3bfb5a[_0x5e3c('0xad')]!==-0x1){this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x15e'),_0x350a6b));var _0x34e627=this['ispeechASR'][_0x5e3c('0xaf')](this,_0x47023c,_0x350a6b);if(_0x34e627){for(var _0x568d0e in _0x34e627){if(_0x34e627[_0x5e3c('0xa1')](_0x568d0e)){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](util['format'](_0x5e3c('0x15f'),_0x568d0e[_0x5e3c('0x76')]()),_0x34e627[_0x568d0e]);}}return this['channel']['noop'](util[_0x5e3c('0x60')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x34e627)));}}return _0x3bfb5a;};AGIVertices[_0x5e3c('0x18')]['ispeechtts']=function(_0x187299){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x160'),_0x187299[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x187299[_0x5e3c('0x86')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x140'));}if(!this[_0x5e3c('0x90')](_0x187299[_0x5e3c('0x6a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xb5'));}this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')]('Trying\x20ispeech\x20TTS\x20%s',_0x187299[_0x5e3c('0x6a')]));var _0x19af9d=this[_0x5e3c('0x8c')][_0x5e3c('0xaf')](this,_0x187299);if(_0x19af9d){this['channel'][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x15e'),_0x19af9d));var _0x4dea07=this[_0x5e3c('0x12')]['streamFile'](_0x19af9d,_0x187299[_0x5e3c('0x145')]);try{fs[_0x5e3c('0x112')](_0x19af9d+_0x5e3c('0x113'));}catch(_0x3153aa){logger['error'](_0x3153aa);}return _0x4dea07;}return this[_0x5e3c('0x12')]['error'](_0x187299,_0x5e3c('0x161'));};AGIVertices['prototype'][_0x5e3c('0x162')]=function(_0x1bb6f3){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x163'),_0x1bb6f3['label']));if(!this['isConfigured'](_0x1bb6f3[_0x5e3c('0x164')])){return this['channel'][_0x5e3c('0x2e')](_0x1bb6f3,_0x5e3c('0x165'));}logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x166'),this['channel'][_0x5e3c('0x3e')],_0x1bb6f3['findBy']));var _0x700494=this[_0x5e3c('0x63')][_0x5e3c('0xaf')](this,_0x1bb6f3[_0x5e3c('0x164')]);if(_0x700494){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x167'),this[_0x5e3c('0x12')]['callerid'],_0x1bb6f3[_0x5e3c('0x164')]));this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5e3c('0x3e')],_0x1bb6f3[_0x5e3c('0x164')]));return{'code':0xc8,'result':_0x5e3c('0x168')};}else{logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x169'),this['channel'][_0x5e3c('0x3e')],_0x1bb6f3[_0x5e3c('0x164')]));this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1bb6f3['findBy']));return{'code':0xc8,'result':_0x5e3c('0x16a')};}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x16b')]=function(_0x721db0){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x16c'),_0x721db0[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x721db0[_0x5e3c('0x164')])){return this[_0x5e3c('0x12')]['error'](_0x721db0,_0x5e3c('0x165'));}logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x166'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x721db0[_0x5e3c('0x164')]));var _0x14bcc9=this[_0x5e3c('0x5e')][_0x5e3c('0xaf')](this,_0x721db0[_0x5e3c('0x164')]);if(_0x14bcc9){logger['info'](util['format'](_0x5e3c('0x167'),this['channel']['callerid'],_0x721db0['findBy']));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x167'),this[_0x5e3c('0x12')]['callerid'],_0x721db0[_0x5e3c('0x164')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x169'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x721db0['findBy']));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5e3c('0x12')]['callerid'],_0x721db0[_0x5e3c('0x164')]));return{'code':0xc8,'result':_0x5e3c('0x16a')};}};AGIVertices[_0x5e3c('0x18')]['math']=function(_0x571217){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x571217[_0x5e3c('0x3b')]));if(!this['isConfigured'](_0x571217[_0x5e3c('0x16d')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x571217,_0x5e3c('0x16e'));}this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('math\x20%s',_0x571217[_0x5e3c('0x16d')]));var _0xe56d29=eval(_0x571217[_0x5e3c('0x16d')]);if(!this[_0x5e3c('0x90')](_0x571217[_0x5e3c('0x125')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0xe5'));}var _0x3c8a2b=this[_0x5e3c('0x15')][_0x5e3c('0xaf')](this,_0x571217[_0x5e3c('0x125')]);if(!_0x3c8a2b){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x571217,_0x5e3c('0xe6'));}if(_['isArray'](_0xe56d29)){var _0x454c42=this;_0xe56d29['forEach'](function(_0x370bf8,_0x30cfa){_0x454c42[_0x5e3c('0x12')][_0x5e3c('0xa9')](util[_0x5e3c('0x60')](_0x5e3c('0x16f'),_0x3c8a2b,_0x30cfa),_0x370bf8);});return this['channel'][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x170'),_0x3c8a2b));}else{return this['channel'][_0x5e3c('0xa9')](_0x3c8a2b,_0xe56d29);}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x10')]=function(_0xa20fe5){logger['info'](util[_0x5e3c('0x60')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0xa20fe5[_0x5e3c('0x3b')]));if(_0xa20fe5[_0x5e3c('0xb0')]===0x0){return this[_0x5e3c('0xb1')](_0xa20fe5);}_0xa20fe5[_0x5e3c('0xb0')]-=0x1;if(!this['isConfigured'](_0xa20fe5[_0x5e3c('0x122')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0xa20fe5,'no\x20file\x20audio\x20selected');}var _0x3cf144=this[_0x5e3c('0x21')]['sync'](this,_0xa20fe5[_0x5e3c('0x122')]);if(!_0x3cf144){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0xa20fe5,'no\x20file\x20audio\x20found');}var _0x442551=this[_0x5e3c('0x12')][_0x5e3c('0x126')](_0x3cf144,_0xa20fe5[_0x5e3c('0x127')],_0xa20fe5[_0x5e3c('0x171')]);var _0xc4b555=_0x442551[_0x5e3c('0xad')];if(_0x442551[_0x5e3c('0xad')]===-0x1){this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0xa20fe5,'-1');return _0x442551;}else if(_0x442551[_0x5e3c('0xac')]===_0x5e3c('0x73')){_0x442551['result']=_0x442551['result'][_0x5e3c('0xa6')]>0x0?_0x442551[_0x5e3c('0xad')]:'t';}else if(_[_0x5e3c('0x4a')](_0x442551[_0x5e3c('0xad')])){_0x442551[_0x5e3c('0xad')]='#';_0xc4b555='#';}if(!this['isConfigured'](_0xa20fe5[_0x5e3c('0x125')])){this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xadad85=this[_0x5e3c('0x15')]['sync'](this,_0xa20fe5[_0x5e3c('0x125')]);if(!_0xadad85){return this['channel']['error'](_0xa20fe5,_0x5e3c('0xe6'));}this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0xadad85,_0xc4b555);}this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0xa20fe5,_0xc4b555);return _0x442551;};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0xb4')]=function(_0x591de1){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x172'),_0x591de1[_0x5e3c('0x3b')]));return this['channel']['noop'](_0x591de1[_0x5e3c('0x173')]||_0x591de1[_0x5e3c('0x3b')]);};AGIVertices['prototype'][_0x5e3c('0x174')]=function(_0x4fae91){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x175'),_0x4fae91[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x4fae91[_0x5e3c('0x164')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4fae91,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x5e3c('0x166'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x4fae91[_0x5e3c('0x164')]));var _0x2c6900=this[_0x5e3c('0x59')][_0x5e3c('0xaf')](this,_0x4fae91[_0x5e3c('0x176')]);var _0x3eb0b6=this[_0x5e3c('0x5b')][_0x5e3c('0xaf')](this,_0x4fae91[_0x5e3c('0x164')],_0x2c6900);if(_0x3eb0b6){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x4fae91[_0x5e3c('0x164')]));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5e3c('0x3e')],_0x4fae91[_0x5e3c('0x164')]));return{'code':0xc8,'result':_0x5e3c('0x168')};}else{logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x169'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x4fae91['findBy']));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5e3c('0x12')]['callerid'],_0x4fae91[_0x5e3c('0x164')]));return{'code':0xc8,'result':_0x5e3c('0x16a')};}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x177')]=function(_0x4d70cc){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x178'),_0x4d70cc[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x4d70cc[_0x5e3c('0x122')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4d70cc,_0x5e3c('0x123'));}var _0x18c64e=this[_0x5e3c('0x21')]['sync'](this,_0x4d70cc[_0x5e3c('0x122')]);if(!_0x18c64e){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4d70cc,_0x5e3c('0x124'));}var _0x5c7975=this[_0x5e3c('0x12')][_0x5e3c('0x65')](_0x5e3c('0x179'),[_0x18c64e,_0x4d70cc[_0x5e3c('0xf3')]]);if(_0x5c7975[_0x5e3c('0xad')]===-0x1){return _0x5c7975;}return this[_0x5e3c('0x12')]['noop'](util['format'](_0x5e3c('0x17a'),_0x5e3c('0x179'),_0x18c64e));};AGIVertices['prototype']['queue']=function(_0x22a07f){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x17b'),_0x22a07f[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x22a07f['queue_id'])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x22a07f,_0x5e3c('0x17c'));}var _0x4c3b15='';var _0x19d22b=parseInt(_0x22a07f[_0x5e3c('0x17d')],0xa);if(isNaN(_0x19d22b)){_0x4c3b15=_0x22a07f[_0x5e3c('0x17d')];}else{_0x4c3b15=this[_0x5e3c('0x19')][_0x5e3c('0xaf')](this,_0x22a07f[_0x5e3c('0x17d')]);if(!_0x4c3b15){return this['channel'][_0x5e3c('0x2e')](_0x22a07f,_0x5e3c('0x17e'));}}var _0x362bc0='';if(this['isConfigured'](_0x22a07f[_0x5e3c('0x122')])){var _0x4a973b=this[_0x5e3c('0x21')]['sync'](this,_0x22a07f[_0x5e3c('0x122')]);if(_0x4a973b){_0x362bc0=_0x4a973b;}}this['createSquareDetailsReport']['sync'](this,_0x22a07f,_0x4c3b15);if(_0x22a07f[_0x5e3c('0xf3')]['indexOf']('x')<0x0){_0x22a07f['opts']+='x';}if(_0x22a07f[_0x5e3c('0xf3')]['indexOf']('X')<0x0){_0x22a07f[_0x5e3c('0xf3')]+='X';}this[_0x5e3c('0x12')][_0x5e3c('0xa9')]('XMCS-QUEUE',_0x4c3b15?_0x4c3b15[_0x5e3c('0x17f')]():'');var _0xf68014=this[_0x5e3c('0x12')][_0x5e3c('0x65')]('QUEUE',[_0x4c3b15,_0x22a07f[_0x5e3c('0xf3')],_0x22a07f[_0x5e3c('0x7e')],_0x362bc0,_0x22a07f['timeout'],_0x22a07f[_0x5e3c('0x9')],_0x22a07f['macro'],_0x22a07f[_0x5e3c('0x180')],'',_0x22a07f[_0x5e3c('0x181')]]);if(_0xf68014['result']===-0x1){return _0xf68014;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x17a'),_0x5e3c('0x182'),_0x4c3b15));};AGIVertices['prototype'][_0x5e3c('0x183')]=function(_0x306687){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x184'),_0x306687[_0x5e3c('0x3b')]));var _0x2f9888=_0x306687['recordingFormat']||'wav';var _0x2ef46a=util[_0x5e3c('0x60')](_0x5e3c('0x185'),this[_0x5e3c('0x12')][_0x5e3c('0x3a')],rs[_0x5e3c('0x12b')](0x5));var _0x551963=util['format'](_0x5e3c('0x186'),FILES_PATH,_0x2ef46a,_0x2f9888);var _0x1b551b=util[_0x5e3c('0x60')]('%s/recordings/%s',FILES_PATH,_0x2ef46a);this['createSquareRecording']['sync'](this,_0x306687,_0x2ef46a,_0x551963);this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0x5e3c('0x187'),_0x2ef46a);logger[_0x5e3c('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x1b551b,_0x2f9888,_0x306687[_0x5e3c('0x188')],_0x306687[_0x5e3c('0x73')]);return this[_0x5e3c('0x12')][_0x5e3c('0x144')](_0x1b551b,_0x2f9888,_0x306687[_0x5e3c('0x188')],_0x306687[_0x5e3c('0x73')],undefined,!![]);};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x189')]=function(_0x16935e){logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x18a'),_0x16935e[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x16935e[_0x5e3c('0x7e')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x18b'));}var _0x251e52=this[_0x5e3c('0x71')]['sync'](this,_0x16935e);logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x18c'),util['inspect'](_0x251e52,{'showHidden':![],'depth':null})));if(!this[_0x5e3c('0x90')](_0x16935e[_0x5e3c('0x125')])){return this[_0x5e3c('0x12')]['noop'](_0x5e3c('0x18d'));}var _0x58a49a=this[_0x5e3c('0x15')][_0x5e3c('0xaf')](this,_0x16935e['variable_id']);if(!_0x58a49a){return this['channel']['error'](_0x16935e,_0x5e3c('0xe6'));}this[_0x5e3c('0x12')]['setVariable'](util[_0x5e3c('0x60')](_0x5e3c('0x18e'),_0x58a49a),_0x251e52['statusCode']?_0x251e52[_0x5e3c('0x82')]:_0x5e3c('0x18f'));this[_0x5e3c('0x12')]['setVariable'](util[_0x5e3c('0x60')](_0x5e3c('0x190'),_0x58a49a),_0x251e52['statusMessage']?_0x251e52[_0x5e3c('0x191')]:'OK');if(_0x251e52[_0x5e3c('0x77')]){try{this[_0x5e3c('0xa7')](_0x251e52['body'],_0x58a49a);}catch(_0x5d722e){logger[_0x5e3c('0x2e')](util[_0x5e3c('0x60')](_0x5e3c('0x192'),_0x58a49a));}}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0xeb'),_0x58a49a));};AGIVertices[_0x5e3c('0x18')]['saydigits']=function(_0x443bd9){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x193'),_0x443bd9['label']));return this[_0x5e3c('0x12')][_0x5e3c('0x194')](_0x443bd9[_0x5e3c('0x195')]['replace'](/\s+/g,''),_0x443bd9[_0x5e3c('0x188')]);};AGIVertices[_0x5e3c('0x18')]['saynumber']=function(_0xbfd3ef){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xbfd3ef['label']));return this[_0x5e3c('0x12')][_0x5e3c('0x196')](_0xbfd3ef['number']['replace'](/\s+/g,''),_0xbfd3ef['escape_digits']);};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x197')]=function(_0x1da27b){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x198'),_0x1da27b[_0x5e3c('0x3b')]));return this[_0x5e3c('0x12')][_0x5e3c('0x199')](_0x1da27b[_0x5e3c('0x6a')],_0x1da27b[_0x5e3c('0x188')]);};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x19a')]=function(_0x257fbe){logger['info'](util['format'](_0x5e3c('0x19b'),_0x257fbe[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x257fbe[_0x5e3c('0x19c')])){return this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x19d'));}var _0x2bb69d=this[_0x5e3c('0x19e')]['sync'](this,_0x257fbe[_0x5e3c('0x19c')]);if(!_0x2bb69d||!_0x2bb69d[_0x5e3c('0x19f')]){return this[_0x5e3c('0x12')]['error'](_0x257fbe,_0x5e3c('0x1a0'));}var _0x4ec719={'from':util[_0x5e3c('0x60')](_0x5e3c('0x1a1'),_0x2bb69d[_0x5e3c('0x16')],_0x2bb69d[_0x5e3c('0x1a2')]||_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a3')]),'to':_0x257fbe['to']||'','cc':_0x257fbe['cc']||'','bcc':_0x257fbe[_0x5e3c('0x1a4')]||'','subject':_0x257fbe[_0x5e3c('0x1a5')],'html':_0x257fbe[_0x5e3c('0x6a')],'text':_0x257fbe['text']};var _0x3de139={'tls':{'rejectUnauthorized':![]}};if(_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a6')]){_0x3de139[_0x5e3c('0x1a6')]=_0x2bb69d[_0x5e3c('0x19f')]['service'];}else{_0x3de139[_0x5e3c('0x1a7')]=_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a7')];_0x3de139[_0x5e3c('0x1a8')]=_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a8')];_0x3de139['secure']=_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a9')];}if(_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1aa')]){_0x3de139[_0x5e3c('0x1ab')]={'user':_0x2bb69d[_0x5e3c('0x19f')][_0x5e3c('0x1a3')],'pass':_0x2bb69d['Smtp'][_0x5e3c('0x1ac')]};}if(this[_0x5e3c('0x90')](_0x257fbe[_0x5e3c('0x1ad')])){}logger[_0x5e3c('0xed')](_0x5e3c('0x1ae'),JSON[_0x5e3c('0x80')](_0x4ec719));this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x257fbe,_0x257fbe[_0x5e3c('0x19c')]);this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x1af'),_0x2bb69d['name']));this[_0x5e3c('0x24')][_0x5e3c('0xaf')](this,_0x3de139,_0x4ec719);return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x1b0'));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1b1')]=function(_0x464ee5){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x1b2'),_0x464ee5['label']));return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x5e3c('0x18')]['sendSMS']=function(_0x2afd15){logger[_0x5e3c('0x30')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2afd15[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x2afd15[_0x5e3c('0x1b3')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x1b4'));}var _0x1d0311=this[_0x5e3c('0x36')][_0x5e3c('0xaf')](this,_0x2afd15[_0x5e3c('0x1b3')]);if(!_0x1d0311){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x2afd15,_0x5e3c('0x1b5'));}var _0x3f781b={'body':_0x2afd15[_0x5e3c('0x1b6')],'phone':_0x2afd15['to']||'','SmsAccountId':_0x1d0311['id']};logger[_0x5e3c('0xed')]('sendSMS\x20message',JSON[_0x5e3c('0x80')](_0x3f781b));this[_0x5e3c('0x39')]['sync'](this,_0x2afd15,_0x2afd15[_0x5e3c('0x1b3')]);this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x1b7'),_0x1d0311[_0x5e3c('0x16')]));this[_0x5e3c('0x38')][_0x5e3c('0xaf')](this,_0x3f781b);return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1b8')]=function(_0x59162f){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x1b9'),_0x59162f[_0x5e3c('0x3b')]));if(!this['isConfigured'](_0x59162f[_0x5e3c('0x125')])){return this['channel'][_0x5e3c('0x2e')](_0x59162f,_0x5e3c('0x1ba'));}var _0x1adb5f=this[_0x5e3c('0x15')]['sync'](this,_0x59162f[_0x5e3c('0x125')]);if(!_0x1adb5f){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x59162f,_0x5e3c('0xe6'));}return this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0x1adb5f,_0x59162f[_0x5e3c('0x1bb')]);};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1bc')]=function(_0x54f1a3){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x1bd'),_0x54f1a3[_0x5e3c('0x3b')]));this['channel'][_0x5e3c('0xb4')](_0x5e3c('0x1be'));if(_0x54f1a3['answer']===_0x5e3c('0x1bf')){this['channel']['noop'](_0x5e3c('0x1c0'));return this[_0x5e3c('0x12')][_0x5e3c('0xc9')]();}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('Skipped\x20Answer');};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1c1')]=function(_0x4bf2a4){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x1c2'),_0x4bf2a4[_0x5e3c('0x3b')]));if(!this['isConfigured'](_0x4bf2a4[_0x5e3c('0x1c3')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4bf2a4,_0x5e3c('0x1c4'));}var _0x590a88=this['getSquareProject']['sync'](this,_0x4bf2a4[_0x5e3c('0x1c3')]);if(!this[_0x5e3c('0x90')](_0x590a88)){return this[_0x5e3c('0x12')]['error'](_0x4bf2a4,util[_0x5e3c('0x60')](_0x5e3c('0x1c5'),_0x4bf2a4[_0x5e3c('0x1c3')]));}if(_0x590a88===this[_0x5e3c('0x12')][_0x5e3c('0x3d')]){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x4bf2a4,_0x5e3c('0x1c6'));}this['createSquareDetailsReport'][_0x5e3c('0xaf')](this,_0x4bf2a4,_0x590a88);var _0x3c943c=this['channel'][_0x5e3c('0x65')]('AGI',util['format'](_0x5e3c('0x1c7'),config[_0x5e3c('0x9')][_0x5e3c('0x1a7')]||'127.0.0.1',_0x590a88,this['channel']['arg_1']));if(_0x3c943c[_0x5e3c('0xad')]===-0x1){return _0x3c943c;}return this[_0x5e3c('0x12')]['noop'](util[_0x5e3c('0x60')]('Executed\x20command\x20%s\x20%s',_0x5e3c('0x1c8'),_0x590a88));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1c9')]=function(_0x567a64){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x567a64['label']));var _0x44d152=this[_0x5e3c('0x64')][_0x5e3c('0xaf')](this,_0x567a64[_0x5e3c('0xc5')]);this[_0x5e3c('0x39')][_0x5e3c('0xaf')](this,_0x567a64,_0x567a64[_0x5e3c('0xc5')]);if(this[_0x5e3c('0x90')](_0x567a64[_0x5e3c('0x125')])){var _0x33ad4f=this['getVariable']['sync'](this,_0x567a64['variable_id']);if(_0x33ad4f){this[_0x5e3c('0x12')][_0x5e3c('0xa9')](_0x33ad4f,_0x44d152);return this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x567a64['command'],_0x33ad4f));}}return this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x1ca'),_0x567a64['command']));};AGIVertices[_0x5e3c('0x18')]['google_cloud_tts']=function(_0x387794){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x387794[_0x5e3c('0x3b')]));_0x387794[_0x5e3c('0x6a')]=_0x387794[_0x5e3c('0x6a')][_0x5e3c('0xe3')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x387794[_0x5e3c('0x68')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](_0x5e3c('0x1cb'));}if(!this['isConfigured'](_0x387794[_0x5e3c('0x6a')])){return this['channel']['noop'](_0x5e3c('0xb5'));}this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x1cc'),_0x387794['text']));var _0x20cfc8=this[_0x5e3c('0x67')][_0x5e3c('0xaf')](this,_0x387794);if(_0x20cfc8){this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x1cd'),_0x20cfc8));var _0x166f46=this['channel'][_0x5e3c('0x111')](_0x20cfc8);try{fs['unlink'](_0x20cfc8+'.wav');}catch(_0x3ad9ec){logger['error'](_0x3ad9ec);}return _0x166f46;}return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x387794,_0x5e3c('0x1ce'));};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1cf')]=function(_0x180eb8){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x1d0'),_0x180eb8[_0x5e3c('0x3b')]));_0x180eb8[_0x5e3c('0x6a')]=_0x180eb8['text'][_0x5e3c('0xe3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5e3c('0x90')](_0x180eb8[_0x5e3c('0x6a')])){return this[_0x5e3c('0x12')][_0x5e3c('0xb4')]('no\x20text\x20configured');}this['channel'][_0x5e3c('0xb4')](util[_0x5e3c('0x60')]('Trying\x20Google\x20TTS\x20%s',_0x180eb8[_0x5e3c('0x6a')]));var _0x51c518=this[_0x5e3c('0x70')][_0x5e3c('0xaf')](this,_0x180eb8);if(_0x51c518){this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x1d1'),_0x51c518));var _0x51a959=this[_0x5e3c('0x12')][_0x5e3c('0x111')](_0x51c518);try{fs[_0x5e3c('0x112')](_0x51c518+_0x5e3c('0x113'));}catch(_0x135c44){logger[_0x5e3c('0x2e')](_0x135c44);}return _0x51a959;}return this[_0x5e3c('0x12')]['error'](_0x180eb8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1d2')]=function(_0x1de9f3){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x1d3'),_0x1de9f3[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x1de9f3[_0x5e3c('0x164')])){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x1de9f3,_0x5e3c('0x165'));}logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')](_0x5e3c('0x166'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x1de9f3['findBy']));var _0x263bdb=this['agentUnpause'][_0x5e3c('0xaf')](this,_0x1de9f3[_0x5e3c('0x164')]);if(_0x263bdb){logger[_0x5e3c('0x30')](util[_0x5e3c('0x60')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5e3c('0x3e')],_0x1de9f3[_0x5e3c('0x164')]));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util['format'](_0x5e3c('0x167'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x1de9f3['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5e3c('0x60')](_0x5e3c('0x169'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x1de9f3['findBy']));this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x169'),this[_0x5e3c('0x12')][_0x5e3c('0x3e')],_0x1de9f3[_0x5e3c('0x164')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5e3c('0x18')][_0x5e3c('0x1d4')]=function(_0x2ab7b0){logger[_0x5e3c('0x30')](util['format'](_0x5e3c('0x1d5'),_0x2ab7b0[_0x5e3c('0x3b')]));var _0x4ab497=this[_0x5e3c('0x12')]['exec'](_0x5e3c('0x1d6'),[_0x2ab7b0['mailbox'],_0x2ab7b0[_0x5e3c('0x84')]]);if(_0x4ab497[_0x5e3c('0xad')]===-0x1){return _0x4ab497;}return this[_0x5e3c('0x12')][_0x5e3c('0xb4')](util[_0x5e3c('0x60')](_0x5e3c('0x17a'),_0x5e3c('0x1d6'),_0x2ab7b0[_0x5e3c('0x1d7')]));};AGIVertices['prototype']['vswitch']=function(_0x862eb2){logger['info'](util[_0x5e3c('0x60')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x862eb2[_0x5e3c('0x3b')]));if(!this[_0x5e3c('0x90')](_0x862eb2[_0x5e3c('0x125')])){return this['channel'][_0x5e3c('0x2e')](_0x862eb2,_0x5e3c('0x1ba'));}var _0xe682d3=this[_0x5e3c('0x15')]['sync'](this,_0x862eb2[_0x5e3c('0x125')]);if(!_0xe682d3){return this[_0x5e3c('0x12')][_0x5e3c('0x2e')](_0x862eb2,_0x5e3c('0xe6'));}var _0x7ed06a=this['channel'][_0x5e3c('0x15')](_0xe682d3);return{'code':0xc8,'result':_0x7ed06a[_0x5e3c('0xac')]?_0x7ed06a[_0x5e3c('0xac')]:'-'};};String[_0x5e3c('0x18')][_0x5e3c('0xab')]=function(_0x458355,_0x550137){return this['split'](_0x458355)[_0x5e3c('0x1d8')](_0x550137);};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 41bfeed..12eb944 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 _0x6694=['../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x6694,0x1a9));var _0x4669=function(_0x166f2f,_0x58b359){_0x166f2f=_0x166f2f-0x0;var _0x1e98a9=_0x6694[_0x166f2f];return _0x1e98a9;};'use strict';var util=require(_0x4669('0x0'));var _=require(_0x4669('0x1'));var moment=require(_0x4669('0x2'));var ami=require('../ami');var logger=require(_0x4669('0x3'))(_0x4669('0x4'));var RpcUser=require(_0x4669('0x5'));var RpcVoiceAgentReport=require(_0x4669('0x6'));function Acw(_0x11ae85){this[_0x4669('0x7')]=_0x11ae85['voiceQueues'];this[_0x4669('0x8')]=_0x11ae85[_0x4669('0x8')];this['timers']=_0x11ae85[_0x4669('0x9')];this[_0x4669('0xa')]={};ami['on'](_0x4669('0xb'),this[_0x4669('0xc')][_0x4669('0xd')](this));ami['on']('hanguprequest',this[_0x4669('0xe')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x4669('0xd')](this));ami['on']('agentringnoanswer',this[_0x4669('0xf')][_0x4669('0xd')](this));ami['on']('attendedtransfer',this[_0x4669('0x10')][_0x4669('0xd')](this));ami['on'](_0x4669('0x11'),this[_0x4669('0x12')]['bind'](this));ami['on'](_0x4669('0x13'),this[_0x4669('0x14')][_0x4669('0xd')](this));}function getDiff(_0x289e64){var _0x1ac998=moment()['milliseconds'](0x0);var _0x2660ed=moment(_0x289e64)[_0x4669('0x15')](0x0);return _0x1ac998[_0x4669('0x16')](_0x2660ed,_0x4669('0x17'));}Acw[_0x4669('0x18')][_0x4669('0x19')]=function(_0x47ecd3){try{var _0x38ecd9=this;var _0x490603=this[_0x4669('0xa')][_0x47ecd3][_0x4669('0x1a')];var _0x2021d0=this[_0x4669('0xa')][_0x47ecd3][_0x4669('0x1b')];var _0x5e1873=this['voiceQueues'][_0x2021d0];var _0x675fc6=![];var _0x1ecda5=_0x4669('0x1c');if(_0x5e1873[_0x4669('0x1d')]){if(_0x5e1873[_0x4669('0x1e')][_0x4669('0x1f')]){_0x675fc6=!![];_0x1ecda5=_0x5e1873['mandatoryDispositionPause'][_0x4669('0x1f')];}}ami['Action']({'action':_0x4669('0x20'),'interface':_0x490603,'paused':!![],'reason':_0x1ecda5})[_0x4669('0x21')](function(_0x13b8be){if(_0x38ecd9[_0x4669('0x8')][_0x490603]){return RpcUser[_0x4669('0x22')](_0x38ecd9[_0x4669('0x8')][_0x490603]['id'])['then'](function(_0x5e6e1e){if(_0x5e6e1e&&!_0x5e6e1e['voicePause']){logger[_0x4669('0x23')](_0x4669('0x24'),_0x47ecd3,_0x490603,_0x2021d0);var _0x285080=_0x38ecd9[_0x4669('0xa')][_0x47ecd3][_0x4669('0x25')]&&_0x38ecd9[_0x4669('0xa')][_0x47ecd3][_0x4669('0x26')]?_0x38ecd9['channels'][_0x47ecd3][_0x4669('0x26')]:_0x47ecd3;return RpcUser[_0x4669('0x27')](_0x38ecd9['agents'][_0x490603],_0x1ecda5,_0x285080)['then'](function(_0x3f5a20){if(!_0x675fc6){_0x38ecd9[_0x4669('0x9')][_0x490603]={};logger['info'](_0x4669('0x28'),_0x47ecd3,_0x38ecd9['voiceQueues'][_0x2021d0][_0x4669('0x29')],_0x490603,_0x2021d0);_0x38ecd9[_0x4669('0x9')][_0x490603][_0x4669('0x2a')]=setTimeout(_0x38ecd9[_0x4669('0x2b')][_0x4669('0xd')](_0x38ecd9,_0x490603),_0x38ecd9[_0x4669('0x7')][_0x2021d0][_0x4669('0x29')]*0x3e8);_0x38ecd9['timers'][_0x490603][_0x4669('0x2c')]=moment()[_0x4669('0x2d')](_0x4669('0x2e'));_0x38ecd9['timers'][_0x490603]['uniqueid']=_0x47ecd3;_0x38ecd9['timers'][_0x490603][_0x4669('0x1b')]=_0x2021d0;_0x38ecd9[_0x4669('0x9')][_0x490603][_0x4669('0x2f')]=function(){var _0x2b9aab=getDiff(_0x38ecd9[_0x4669('0x9')][_0x490603][_0x4669('0x2c')]);clearTimeout(_0x38ecd9[_0x4669('0x9')][_0x490603][_0x4669('0x2a')]);_0x38ecd9[_0x4669('0x9')][_0x490603][_0x4669('0x2a')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2b9aab},_0x38ecd9['timers'][_0x490603][_0x4669('0x30')],_0x490603)[_0x4669('0x21')](function(_0x16b1ab){logger[_0x4669('0x23')](_0x4669('0x31'),_0x47ecd3,_0x2b9aab,_0x16b1ab);})['catch'](function(_0x1c742e){logger[_0x4669('0x32')](_0x4669('0x33'),_0x47ecd3,_0x1c742e);});delete _0x38ecd9[_0x4669('0x9')][_0x490603];};}});}else{logger[_0x4669('0x23')](_0x4669('0x34'),_0x47ecd3,_0x490603,_0x2021d0);}});}})['catch'](function(_0x2116c9){logger[_0x4669('0x32')](_0x4669('0x28'),_0x47ecd3,_0x38ecd9['voiceQueues'][_0x2021d0][_0x4669('0x29')],_0x490603,_0x2021d0);})[_0x4669('0x35')](function(){delete _0x38ecd9['channels'][_0x47ecd3];});}catch(_0x35f7a7){logger[_0x4669('0x32')](_0x4669('0x36'),_0x35f7a7[_0x4669('0x37')]);}};Acw[_0x4669('0x18')]['stopAcw']=function(_0x3f48b2){try{var _0x2483c1=this;if(_0x2483c1['timers'][_0x3f48b2]){_0x2483c1[_0x4669('0x9')][_0x3f48b2][_0x4669('0x2a')]=![];var _0x11805a=_0x2483c1['timers'][_0x3f48b2][_0x4669('0x30')];var _0x25a738=_0x2483c1['timers'][_0x3f48b2][_0x4669('0x1b')];var _0x3dcea9=_0x2483c1[_0x4669('0x7')][_0x25a738]['acwTimeout'];logger[_0x4669('0x23')](_0x4669('0x38'),_0x11805a,_0x3f48b2);RpcUser[_0x4669('0x39')](this[_0x4669('0x8')][_0x3f48b2]);RpcVoiceAgentReport[_0x4669('0x3a')]({'acwtime':_0x3dcea9,'agentacw':!![]},_0x11805a,_0x3f48b2)[_0x4669('0x21')](function(_0x847562){logger[_0x4669('0x23')](_0x4669('0x31'),_0x11805a,_0x3dcea9,_0x847562);})['catch'](function(_0x4ec00e){logger[_0x4669('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x11805a,_0x4ec00e);});}else{logger['error'](_0x4669('0x3b'),_0x3f48b2);if(_0x2483c1['timers']){logger['info'](_0x4669('0x3c'),JSON['stringify'](_0x2483c1['timers']));}}}catch(_0x2311fd){logger[_0x4669('0x32')](_0x4669('0x3d'),_0x2311fd['message']);}};Acw[_0x4669('0x18')][_0x4669('0xc')]=function(_0x4ba65e){try{if(this[_0x4669('0x7')][_0x4ba65e[_0x4669('0x1b')]]&&(this[_0x4669('0x7')][_0x4ba65e[_0x4669('0x1b')]][_0x4669('0x4')]||this[_0x4669('0x7')][_0x4ba65e[_0x4669('0x1b')]][_0x4669('0x1d')])){if(this[_0x4669('0x8')][_0x4ba65e['interface']]){this['channels'][_0x4ba65e[_0x4669('0x30')]]={'queue':_0x4ba65e[_0x4669('0x1b')],'interface':_0x4ba65e[_0x4669('0x1a')],'destlinkedid':_0x4ba65e[_0x4669('0x26')]};}}}catch(_0x2ccec7){logger[_0x4669('0x32')](_0x4669('0x3e'),_0x2ccec7[_0x4669('0x37')]);}};Acw['prototype'][_0x4669('0x14')]=function(_0x14c76b){try{if(this[_0x4669('0x7')][_0x14c76b['queue']]&&(this['voiceQueues'][_0x14c76b[_0x4669('0x1b')]][_0x4669('0x4')]||this[_0x4669('0x7')][_0x14c76b[_0x4669('0x1b')]][_0x4669('0x1d')])){if(this['agents'][_0x14c76b[_0x4669('0x1a')]]){this[_0x4669('0xa')][_0x14c76b[_0x4669('0x30')]]={'queue':_0x14c76b['queue'],'interface':_0x14c76b[_0x4669('0x1a')]};}}}catch(_0x4e081f){logger[_0x4669('0x32')](_0x4669('0x3f'),_0x4e081f[_0x4669('0x37')]);}};Acw[_0x4669('0x18')][_0x4669('0xe')]=function(_0x1e8dd9){try{if(this['channels'][_0x1e8dd9[_0x4669('0x30')]]&&_[_0x4669('0x40')](this['channels'][_0x1e8dd9[_0x4669('0x30')]][_0x4669('0x25')])){logger[_0x4669('0x23')](_0x4669('0x41'),_0x1e8dd9[_0x4669('0x30')]);this[_0x4669('0x19')](_0x1e8dd9[_0x4669('0x30')]);}else if(this[_0x4669('0xa')][_0x1e8dd9['linkedid']]&&_['isUndefined'](this['channels'][_0x1e8dd9[_0x4669('0x42')]]['attended'])){logger['info'](_0x4669('0x43'),_0x1e8dd9[_0x4669('0x42')]);this[_0x4669('0x19')](_0x1e8dd9[_0x4669('0x42')]);}}catch(_0x41aa90){logger[_0x4669('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x41aa90['message']);}};Acw[_0x4669('0x18')][_0x4669('0x44')]=function(_0x43ec69){try{if(this[_0x4669('0xa')][_0x43ec69[_0x4669('0x30')]]&&this[_0x4669('0xa')][_0x43ec69['uniqueid']][_0x4669('0x25')]){logger[_0x4669('0x23')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x43ec69[_0x4669('0x30')]);this[_0x4669('0x19')](_0x43ec69[_0x4669('0x30')]);}else if(this[_0x4669('0xa')][_0x43ec69['linkedid']]&&this['channels'][_0x43ec69[_0x4669('0x42')]][_0x4669('0x25')]){logger[_0x4669('0x23')](_0x4669('0x45'),_0x43ec69['linkedid']);this['startAcw'](_0x43ec69[_0x4669('0x42')]);}}catch(_0xe1f3d3){logger[_0x4669('0x32')](_0x4669('0x46'),_0xe1f3d3['message']);}};Acw[_0x4669('0x18')][_0x4669('0x10')]=function(_0x6f8931){try{if(!_['isNil'](this[_0x4669('0xa')][_0x6f8931[_0x4669('0x47')]])){this['startAcw'](_0x6f8931['transfereeuniqueid']);if(this[_0x4669('0xa')][_0x6f8931['secondtransfereruniqueid']]){this[_0x4669('0xa')][_0x6f8931[_0x4669('0x48')]][_0x4669('0x25')]=!![];this[_0x4669('0xa')][_0x6f8931[_0x4669('0x49')]]=this[_0x4669('0xa')][_0x6f8931[_0x4669('0x48')]];delete this[_0x4669('0xa')][_0x6f8931['secondtransfereruniqueid']];}}else if(!_[_0x4669('0x4a')](this[_0x4669('0xa')][_0x6f8931[_0x4669('0x49')]])){this[_0x4669('0x19')](_0x6f8931[_0x4669('0x49')]);if(this['channels'][_0x6f8931[_0x4669('0x4b')]]){this[_0x4669('0xa')][_0x6f8931[_0x4669('0x4b')]][_0x4669('0x25')]=!![];this['channels'][_0x6f8931[_0x4669('0x47')]]=this[_0x4669('0xa')][_0x6f8931[_0x4669('0x4b')]];delete this[_0x4669('0xa')][_0x6f8931[_0x4669('0x4b')]];}}}catch(_0x48b6cf){logger[_0x4669('0x32')](_0x4669('0x4c'),_0x48b6cf['message']);}};Acw[_0x4669('0x18')]['syncBlindTransfer']=function(_0x4c4a4c){try{if(this[_0x4669('0xa')][_0x4c4a4c[_0x4669('0x4d')]]){logger[_0x4669('0x23')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x4669('0x4e')](_0x4c4a4c['transfereruniqueid']));this[_0x4669('0x19')](_0x4c4a4c[_0x4669('0x4d')]);}else if(this['channels'][_0x4c4a4c['transfererlinkedid']]){logger[_0x4669('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4669('0x4e')](_0x4c4a4c[_0x4669('0x4f')]));this[_0x4669('0x19')](_0x4c4a4c[_0x4669('0x4f')]);}}catch(_0x3ef4bd){logger[_0x4669('0x32')](_0x4669('0x50'),_0x3ef4bd[_0x4669('0x37')]);}};Acw[_0x4669('0x18')][_0x4669('0xf')]=function(_0x58f2fb){try{if(this[_0x4669('0x7')][_0x58f2fb[_0x4669('0x1b')]]&&this['voiceQueues'][_0x58f2fb[_0x4669('0x1b')]]['autopause']===_0x4669('0x51')){if(this[_0x4669('0x8')][_0x58f2fb['interface']]){logger['info'](_0x4669('0x52'),_0x58f2fb[_0x4669('0x30')],_0x58f2fb[_0x4669('0x1a')],_0x58f2fb[_0x4669('0x1b')]);return RpcUser[_0x4669('0x27')](this['agents'][_0x58f2fb[_0x4669('0x1a')]],_0x4669('0x53'),_0x58f2fb['uniqueid']);}}}catch(_0x3104ee){logger['error'](_0x4669('0x54'),_0x3104ee['message']);}};module[_0x4669('0x55')]=Acw; \ No newline at end of file +var _0xa4b6=['name','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition'];(function(_0x29b4aa,_0x5afea4){var _0x4c9dbe=function(_0x14632d){while(--_0x14632d){_0x29b4aa['push'](_0x29b4aa['shift']());}};_0x4c9dbe(++_0x5afea4);}(_0xa4b6,0x133));var _0x6a4b=function(_0x2bd26c,_0x5055bf){_0x2bd26c=_0x2bd26c-0x0;var _0x2a9a03=_0xa4b6[_0x2bd26c];return _0x2a9a03;};'use strict';var util=require(_0x6a4b('0x0'));var _=require('lodash');var moment=require(_0x6a4b('0x1'));var ami=require('../ami');var logger=require(_0x6a4b('0x2'))(_0x6a4b('0x3'));var RpcUser=require(_0x6a4b('0x4'));var RpcVoiceAgentReport=require(_0x6a4b('0x5'));function Acw(_0x390233){this[_0x6a4b('0x6')]=_0x390233[_0x6a4b('0x6')];this[_0x6a4b('0x7')]=_0x390233[_0x6a4b('0x7')];this[_0x6a4b('0x8')]=_0x390233[_0x6a4b('0x8')];this[_0x6a4b('0x9')]={};ami['on'](_0x6a4b('0xa'),this[_0x6a4b('0xb')][_0x6a4b('0xc')](this));ami['on']('hanguprequest',this[_0x6a4b('0xd')][_0x6a4b('0xc')](this));ami['on'](_0x6a4b('0xe'),this[_0x6a4b('0xf')]['bind'](this));ami['on'](_0x6a4b('0x10'),this[_0x6a4b('0x11')][_0x6a4b('0xc')](this));ami['on'](_0x6a4b('0x12'),this[_0x6a4b('0x13')]['bind'](this));ami['on'](_0x6a4b('0x14'),this['syncBlindTransfer'][_0x6a4b('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x6a4b('0xc')](this));}function getDiff(_0x425a3e){var _0x51f42a=moment()['milliseconds'](0x0);var _0x364849=moment(_0x425a3e)[_0x6a4b('0x15')](0x0);return _0x51f42a[_0x6a4b('0x16')](_0x364849,_0x6a4b('0x17'));}Acw[_0x6a4b('0x18')]['startAcw']=function(_0x542be0){try{var _0x2bed69=this;var _0x144377=this[_0x6a4b('0x9')][_0x542be0][_0x6a4b('0x19')];var _0x41ed6d=this[_0x6a4b('0x9')][_0x542be0][_0x6a4b('0x1a')];var _0x2825c6=this['voiceQueues'][_0x41ed6d];var _0x3983bc=![];var _0x318469=_0x6a4b('0x1b');if(_0x2825c6[_0x6a4b('0x1c')]){if(_0x2825c6['mandatoryDispositionPause'][_0x6a4b('0x1d')]){_0x3983bc=!![];_0x318469=_0x2825c6[_0x6a4b('0x1e')][_0x6a4b('0x1d')];}}ami[_0x6a4b('0x1f')]({'action':_0x6a4b('0x20'),'interface':_0x144377,'paused':!![],'reason':_0x318469})['then'](function(_0x4faef2){if(_0x2bed69[_0x6a4b('0x7')][_0x144377]){return RpcUser['getAgent'](_0x2bed69['agents'][_0x144377]['id'])[_0x6a4b('0x21')](function(_0x2bfbd2){if(_0x2bfbd2&&!_0x2bfbd2[_0x6a4b('0x22')]){logger[_0x6a4b('0x23')](_0x6a4b('0x24'),_0x542be0,_0x144377,_0x41ed6d);var _0x1907ae=_0x2bed69['channels'][_0x542be0]['attended']&&_0x2bed69[_0x6a4b('0x9')][_0x542be0]['destlinkedid']?_0x2bed69[_0x6a4b('0x9')][_0x542be0][_0x6a4b('0x25')]:_0x542be0;return RpcUser[_0x6a4b('0x26')](_0x2bed69[_0x6a4b('0x7')][_0x144377],_0x318469,_0x1907ae)[_0x6a4b('0x21')](function(_0x2c5f8c){if(!_0x3983bc){_0x2bed69['timers'][_0x144377]={};logger[_0x6a4b('0x23')](_0x6a4b('0x27'),_0x542be0,_0x2bed69['voiceQueues'][_0x41ed6d][_0x6a4b('0x28')],_0x144377,_0x41ed6d);_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x29')]=setTimeout(_0x2bed69['stopAcw']['bind'](_0x2bed69,_0x144377),_0x2bed69[_0x6a4b('0x6')][_0x41ed6d][_0x6a4b('0x28')]*0x3e8);_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x2a')]=moment()['format'](_0x6a4b('0x2b'));_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x2c')]=_0x542be0;_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x1a')]=_0x41ed6d;_0x2bed69['timers'][_0x144377][_0x6a4b('0x2d')]=function(){var _0x1e51aa=getDiff(_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x2a')]);clearTimeout(_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x29')]);_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x29')]=![];RpcVoiceAgentReport[_0x6a4b('0x2e')]({'acwtime':_0x1e51aa},_0x2bed69[_0x6a4b('0x8')][_0x144377][_0x6a4b('0x2c')],_0x144377)['then'](function(_0x43dc1d){logger[_0x6a4b('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x542be0,_0x1e51aa,_0x43dc1d);})[_0x6a4b('0x2f')](function(_0x4ae529){logger[_0x6a4b('0x30')](_0x6a4b('0x31'),_0x542be0,_0x4ae529);});delete _0x2bed69[_0x6a4b('0x8')][_0x144377];};}});}else{logger[_0x6a4b('0x23')](_0x6a4b('0x32'),_0x542be0,_0x144377,_0x41ed6d);}});}})['catch'](function(_0x3c9c5d){logger[_0x6a4b('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x542be0,_0x2bed69[_0x6a4b('0x6')][_0x41ed6d]['acwTimeout'],_0x144377,_0x41ed6d);})[_0x6a4b('0x33')](function(){delete _0x2bed69[_0x6a4b('0x9')][_0x542be0];});}catch(_0x13c177){logger[_0x6a4b('0x30')](_0x6a4b('0x34'),_0x13c177[_0x6a4b('0x35')]);}};Acw['prototype'][_0x6a4b('0x36')]=function(_0x43b30a){try{var _0x1d3dbb=this;if(_0x1d3dbb[_0x6a4b('0x8')][_0x43b30a]){_0x1d3dbb['timers'][_0x43b30a]['timer']=![];var _0x8f8d40=_0x1d3dbb[_0x6a4b('0x8')][_0x43b30a]['uniqueid'];var _0x4857a8=_0x1d3dbb[_0x6a4b('0x8')][_0x43b30a][_0x6a4b('0x1a')];var _0xda0920=_0x1d3dbb[_0x6a4b('0x6')][_0x4857a8][_0x6a4b('0x28')];logger[_0x6a4b('0x23')](_0x6a4b('0x37'),_0x8f8d40,_0x43b30a);RpcUser[_0x6a4b('0x38')](this['agents'][_0x43b30a]);RpcVoiceAgentReport[_0x6a4b('0x2e')]({'acwtime':_0xda0920,'agentacw':!![]},_0x8f8d40,_0x43b30a)['then'](function(_0x3f401d){logger[_0x6a4b('0x23')](_0x6a4b('0x39'),_0x8f8d40,_0xda0920,_0x3f401d);})[_0x6a4b('0x2f')](function(_0x111ff6){logger['error'](_0x6a4b('0x31'),_0x8f8d40,_0x111ff6);});}else{logger[_0x6a4b('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x43b30a);if(_0x1d3dbb['timers']){logger['info']('[ACW][TIMERS]',JSON[_0x6a4b('0x3a')](_0x1d3dbb[_0x6a4b('0x8')]));}}}catch(_0xa43dda){logger[_0x6a4b('0x30')](_0x6a4b('0x3b'),_0xa43dda['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x1839f7){try{if(this[_0x6a4b('0x6')][_0x1839f7[_0x6a4b('0x1a')]]&&(this['voiceQueues'][_0x1839f7['queue']][_0x6a4b('0x3')]||this['voiceQueues'][_0x1839f7['queue']]['mandatoryDisposition'])){if(this['agents'][_0x1839f7[_0x6a4b('0x19')]]){this[_0x6a4b('0x9')][_0x1839f7['uniqueid']]={'queue':_0x1839f7[_0x6a4b('0x1a')],'interface':_0x1839f7[_0x6a4b('0x19')],'destlinkedid':_0x1839f7[_0x6a4b('0x25')]};}}}catch(_0x2b29fa){logger[_0x6a4b('0x30')]('[ACW][syncAgentConnect]\x20%s',_0x2b29fa['message']);}};Acw[_0x6a4b('0x18')]['syncAgentConnectPreview']=function(_0x5ef761){try{if(this[_0x6a4b('0x6')][_0x5ef761[_0x6a4b('0x1a')]]&&(this[_0x6a4b('0x6')][_0x5ef761['queue']][_0x6a4b('0x3')]||this[_0x6a4b('0x6')][_0x5ef761[_0x6a4b('0x1a')]]['mandatoryDisposition'])){if(this[_0x6a4b('0x7')][_0x5ef761[_0x6a4b('0x19')]]){this[_0x6a4b('0x9')][_0x5ef761['uniqueid']]={'queue':_0x5ef761[_0x6a4b('0x1a')],'interface':_0x5ef761['interface']};}}}catch(_0x4d4dc6){logger[_0x6a4b('0x30')](_0x6a4b('0x3c'),_0x4d4dc6[_0x6a4b('0x35')]);}};Acw['prototype'][_0x6a4b('0xd')]=function(_0x388179){try{if(this[_0x6a4b('0x9')][_0x388179['uniqueid']]&&_[_0x6a4b('0x3d')](this['channels'][_0x388179['uniqueid']]['attended'])){logger[_0x6a4b('0x23')](_0x6a4b('0x3e'),_0x388179[_0x6a4b('0x2c')]);this['startAcw'](_0x388179[_0x6a4b('0x2c')]);}else if(this[_0x6a4b('0x9')][_0x388179[_0x6a4b('0x3f')]]&&_[_0x6a4b('0x3d')](this[_0x6a4b('0x9')][_0x388179[_0x6a4b('0x3f')]][_0x6a4b('0x40')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x388179[_0x6a4b('0x3f')]);this['startAcw'](_0x388179['linkedid']);}}catch(_0x2679a5){logger['error'](_0x6a4b('0x41'),_0x2679a5[_0x6a4b('0x35')]);}};Acw[_0x6a4b('0x18')]['syncHangup']=function(_0x32ae40){try{if(this[_0x6a4b('0x9')][_0x32ae40[_0x6a4b('0x2c')]]&&this[_0x6a4b('0x9')][_0x32ae40[_0x6a4b('0x2c')]][_0x6a4b('0x40')]){logger[_0x6a4b('0x23')](_0x6a4b('0x42'),_0x32ae40[_0x6a4b('0x2c')]);this[_0x6a4b('0x43')](_0x32ae40[_0x6a4b('0x2c')]);}else if(this[_0x6a4b('0x9')][_0x32ae40[_0x6a4b('0x3f')]]&&this[_0x6a4b('0x9')][_0x32ae40[_0x6a4b('0x3f')]][_0x6a4b('0x40')]){logger[_0x6a4b('0x23')](_0x6a4b('0x44'),_0x32ae40[_0x6a4b('0x3f')]);this[_0x6a4b('0x43')](_0x32ae40[_0x6a4b('0x3f')]);}}catch(_0x29665b){logger[_0x6a4b('0x30')]('[ACW][syncHangup]\x20%s',_0x29665b[_0x6a4b('0x35')]);}};Acw['prototype'][_0x6a4b('0x13')]=function(_0x5de0e0){try{if(!_[_0x6a4b('0x45')](this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x46')]])){this[_0x6a4b('0x43')](_0x5de0e0[_0x6a4b('0x46')]);if(this[_0x6a4b('0x9')][_0x5de0e0['secondtransfereruniqueid']]){this['channels'][_0x5de0e0[_0x6a4b('0x47')]]['attended']=!![];this['channels'][_0x5de0e0['transfertargetuniqueid']]=this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x47')]];delete this[_0x6a4b('0x9')][_0x5de0e0['secondtransfereruniqueid']];}}else if(!_[_0x6a4b('0x45')](this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x48')]])){this[_0x6a4b('0x43')](_0x5de0e0[_0x6a4b('0x48')]);if(this['channels'][_0x5de0e0[_0x6a4b('0x49')]]){this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x49')]][_0x6a4b('0x40')]=!![];this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x46')]]=this['channels'][_0x5de0e0[_0x6a4b('0x49')]];delete this[_0x6a4b('0x9')][_0x5de0e0[_0x6a4b('0x49')]];}}}catch(_0x32014c){logger[_0x6a4b('0x30')](_0x6a4b('0x4a'),_0x32014c['message']);}};Acw[_0x6a4b('0x18')][_0x6a4b('0x4b')]=function(_0x55dbf1){try{if(this[_0x6a4b('0x9')][_0x55dbf1[_0x6a4b('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6a4b('0x3a')](_0x55dbf1[_0x6a4b('0x4c')]));this[_0x6a4b('0x43')](_0x55dbf1[_0x6a4b('0x4c')]);}else if(this[_0x6a4b('0x9')][_0x55dbf1[_0x6a4b('0x4d')]]){logger[_0x6a4b('0x23')](_0x6a4b('0x4e'),JSON['stringify'](_0x55dbf1[_0x6a4b('0x4d')]));this[_0x6a4b('0x43')](_0x55dbf1[_0x6a4b('0x4d')]);}}catch(_0x26a08a){logger[_0x6a4b('0x30')](_0x6a4b('0x4f'),_0x26a08a[_0x6a4b('0x35')]);}};Acw[_0x6a4b('0x18')][_0x6a4b('0x11')]=function(_0x34ec4e){try{if(this[_0x6a4b('0x6')][_0x34ec4e[_0x6a4b('0x1a')]]&&this['voiceQueues'][_0x34ec4e[_0x6a4b('0x1a')]][_0x6a4b('0x50')]==='all'){if(this[_0x6a4b('0x7')][_0x34ec4e[_0x6a4b('0x19')]]){logger['info'](_0x6a4b('0x51'),_0x34ec4e[_0x6a4b('0x2c')],_0x34ec4e[_0x6a4b('0x19')],_0x34ec4e[_0x6a4b('0x1a')]);return RpcUser[_0x6a4b('0x26')](this[_0x6a4b('0x7')][_0x34ec4e['interface']],'Auto-Pause',_0x34ec4e['uniqueid']);}}}catch(_0x5fa6b0){logger[_0x6a4b('0x30')](_0x6a4b('0x52'),_0x5fa6b0[_0x6a4b('0x35')]);}};module[_0x6a4b('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 061659f..219f75e 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x404460,_0x53dcf8){var _0x423a08=function(_0x23ffb6){while(--_0x23ffb6){_0x404460['push'](_0x404460['shift']());}};_0x423a08(++_0x53dcf8);}(_0x757a,0xde));var _0xa757=function(_0x320f44,_0x2a200e){_0x320f44=_0x320f44-0x0;var _0x908b46=_0x757a[_0x320f44];return _0x908b46;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x5c749a,_0x186545){var _0x147293=function(_0x6a58e9){while(--_0x6a58e9){_0x5c749a['push'](_0x5c749a['shift']());}};_0x147293(++_0x186545);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 594fb7f..4e684e6 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x174e10,_0x32f58c){var _0x4184c5=function(_0x4988aa){while(--_0x4988aa){_0x174e10['push'](_0x174e10['shift']());}};_0x4184c5(++_0x32f58c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x33e678,_0x536cd9){_0x33e678=_0x33e678-0x0;var _0x16b4a6=_0xb43b[_0x33e678];return _0x16b4a6;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0x9bde,0xe1));var _0xe9bd=function(_0x185a43,_0x51f176){_0x185a43=_0x185a43-0x0;var _0x1ecf7d=_0x9bde[_0x185a43];return _0x1ecf7d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 5a0d795..c440fa6 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 _0x99c5=['ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','name','substring','getQueue','exports','lodash','isNil','string','voiceQueue','uniqueid','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x5a6a86,_0xc94d06){var _0x30b169=function(_0x55ed0c){while(--_0x55ed0c){_0x5a6a86['push'](_0x5a6a86['shift']());}};_0x30b169(++_0xc94d06);}(_0x99c5,0xc0));var _0x599c=function(_0x4b1314,_0xbdac65){_0x4b1314=_0x4b1314-0x0;var _0x3a25ca=_0x99c5[_0x4b1314];return _0x3a25ca;};'use strict';var util=require('util');var _=require(_0x599c('0x0'));var moment=require('moment');function checkNameSurname(_0x51e7d0,_0x80f30c,_0x501c03){var _0x269395='';if(!_[_0x599c('0x1')](_0x80f30c)&&_0x599c('0x2')===typeof _0x80f30c){_0x269395+=_0x80f30c;}if(!_['isNil'](_0x501c03)&&_0x599c('0x2')===typeof _0x501c03){_0x269395+='\x20'+_0x501c03;}if(_0x269395!==''){return _0x269395;}return _0x51e7d0;}function Action(_0x22ed59,_0x51a91d,_0x47d3ff){this[_0x599c('0x3')]=_0x22ed59;this[_0x599c('0x4')]=_0x47d3ff||undefined;this['name']=checkNameSurname(_0x51a91d[_0x599c('0x5')]['phone'],_0x51a91d[_0x599c('0x5')]['firstName'],_0x51a91d[_0x599c('0x5')][_0x599c('0x6')]);this[_0x599c('0x7')]=_0x51a91d['Contact'][_0x599c('0x8')];this[_0x599c('0x9')]=_0x22ed59['name'];this['active']=_0x51a91d[_0x599c('0xa')]||![];this[_0x599c('0xb')]=_0x22ed59[_0x599c('0xb')];this['dialQueueTimeout']=_0x22ed59[_0x599c('0xc')]||0x3;this[_0x599c('0xd')]=_0x51a91d[_0x599c('0xd')];this[_0x599c('0xe')]=_0x51a91d[_0x599c('0xe')];this[_0x599c('0xf')]=_0x51a91d[_0x599c('0xf')];this[_0x599c('0x10')]=_0x51a91d[_0x599c('0x10')];this[_0x599c('0x11')]=_0x51a91d[_0x599c('0x11')];this['countdropretry']=_0x51a91d[_0x599c('0x12')];this['countabandonedretry']=_0x51a91d[_0x599c('0x13')];this['countmachineretry']=_0x51a91d[_0x599c('0x14')];this[_0x599c('0x15')]=_0x51a91d['countagentrejectretry'];this[_0x599c('0x16')]=_0x51a91d[_0x599c('0x16')];this['ListId']=_0x51a91d[_0x599c('0x17')];this[_0x599c('0x18')]=_0x51a91d[_0x599c('0x18')];this[_0x599c('0x19')]=_0x51a91d['VoiceQueueId'];this[_0x599c('0x1a')]=_0x51a91d[_0x599c('0x1a')];this[_0x599c('0x1b')]=_0x51a91d['id'];this[_0x599c('0x1c')]=_0x51a91d[_0x599c('0x5')][_0x599c('0x1d')]||'';this[_0x599c('0x1e')]=moment()[_0x599c('0x1f')](_0x599c('0x20'));this['callback']=_0x51a91d['callback'];this['callbackuniqueid']=_0x51a91d[_0x599c('0x21')];this[_0x599c('0x22')]=_0x51a91d[_0x599c('0x22')];this[_0x599c('0x23')]=_0x51a91d[_0x599c('0x23')];this[_0x599c('0x24')]='';this['originatecalleridname']='';}Action[_0x599c('0x25')][_0x599c('0x26')]=function(){return util[_0x599c('0x1f')](_0x599c('0x27'),this[_0x599c('0x28')],this[_0x599c('0x3')]['dialCutDigit']>0x0?this[_0x599c('0x7')][_0x599c('0x29')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0x599c('0x25')][_0x599c('0x2a')]=function(){return this[_0x599c('0x9')];};module[_0x599c('0x2b')]=Action; \ No newline at end of file +var _0xbcbc=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x295a5c,_0xfd0b5){var _0x53339e=function(_0x5ee71d){while(--_0x5ee71d){_0x295a5c['push'](_0x295a5c['shift']());}};_0x53339e(++_0xfd0b5);}(_0xbcbc,0x12e));var _0xcbcb=function(_0x659c06,_0x45d95f){_0x659c06=_0x659c06-0x0;var _0x40d312=_0xbcbc[_0x659c06];return _0x40d312;};'use strict';var util=require(_0xcbcb('0x0'));var _=require(_0xcbcb('0x1'));var moment=require(_0xcbcb('0x2'));function checkNameSurname(_0x4ad6b4,_0x32a37b,_0x520fef){var _0x3d89f1='';if(!_[_0xcbcb('0x3')](_0x32a37b)&&'string'===typeof _0x32a37b){_0x3d89f1+=_0x32a37b;}if(!_['isNil'](_0x520fef)&&_0xcbcb('0x4')===typeof _0x520fef){_0x3d89f1+='\x20'+_0x520fef;}if(_0x3d89f1!==''){return _0x3d89f1;}return _0x4ad6b4;}function Action(_0x25f14a,_0x146fbd,_0x5be8c5){this[_0xcbcb('0x5')]=_0x25f14a;this[_0xcbcb('0x6')]=_0x5be8c5||undefined;this[_0xcbcb('0x7')]=checkNameSurname(_0x146fbd['Contact'][_0xcbcb('0x8')],_0x146fbd[_0xcbcb('0x9')]['firstName'],_0x146fbd[_0xcbcb('0x9')][_0xcbcb('0xa')]);this[_0xcbcb('0xb')]=_0x146fbd[_0xcbcb('0x9')][_0xcbcb('0x8')];this[_0xcbcb('0xc')]=_0x25f14a[_0xcbcb('0x7')];this[_0xcbcb('0xd')]=_0x146fbd['active']||![];this['type']=_0x25f14a[_0xcbcb('0xe')];this['dialQueueTimeout']=_0x25f14a['dialQueueTimeout']||0x3;this[_0xcbcb('0xf')]=_0x146fbd[_0xcbcb('0xf')];this['countbusyretry']=_0x146fbd[_0xcbcb('0x10')];this['countcongestionretry']=_0x146fbd[_0xcbcb('0x11')];this[_0xcbcb('0x12')]=_0x146fbd['countnoanswerretry'];this[_0xcbcb('0x13')]=_0x146fbd[_0xcbcb('0x13')];this[_0xcbcb('0x14')]=_0x146fbd['countdropretry'];this[_0xcbcb('0x15')]=_0x146fbd[_0xcbcb('0x15')];this[_0xcbcb('0x16')]=_0x146fbd['countmachineretry'];this['countagentrejectretry']=_0x146fbd[_0xcbcb('0x17')];this[_0xcbcb('0x18')]=_0x146fbd['ContactId'];this['ListId']=_0x146fbd[_0xcbcb('0x19')];this[_0xcbcb('0x1a')]=_0x146fbd['UserId'];this['VoiceQueueId']=_0x146fbd[_0xcbcb('0x1b')];this['CampaignId']=_0x146fbd[_0xcbcb('0x1c')];this[_0xcbcb('0x1d')]=_0x146fbd['id'];this[_0xcbcb('0x1e')]=_0x146fbd['Contact'][_0xcbcb('0x1f')]||'';this[_0xcbcb('0x20')]=moment()[_0xcbcb('0x21')](_0xcbcb('0x22'));this[_0xcbcb('0x23')]=_0x146fbd[_0xcbcb('0x23')];this[_0xcbcb('0x24')]=_0x146fbd[_0xcbcb('0x24')];this[_0xcbcb('0x25')]=_0x146fbd['callbackat'];this['recallme']=_0x146fbd[_0xcbcb('0x26')];this[_0xcbcb('0x27')]='';this[_0xcbcb('0x28')]='';}Action[_0xcbcb('0x29')][_0xcbcb('0x2a')]=function(){return util[_0xcbcb('0x21')](_0xcbcb('0x2b'),this[_0xcbcb('0x7')],this[_0xcbcb('0x5')]['dialCutDigit']>0x0?this['number'][_0xcbcb('0x2c')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0xcbcb('0x29')][_0xcbcb('0x2d')]=function(){return this['queue'];};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 1a5891d..341fb00 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 _0x2fe6=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x2fe6,0xc1));var _0x62fe=function(_0x537964,_0x101826){_0x537964=_0x537964-0x0;var _0x44d361=_0x2fe6[_0x537964];return _0x44d361;};'use strict';var util=require('util');var _=require(_0x62fe('0x0'));var moment=require(_0x62fe('0x1'));function getSeconds(_0xc6c271,_0xa3ca12){var _0x515232=moment(_0xc6c271)[_0x62fe('0x2')](0x0);var _0x2175ad=moment(_0xa3ca12)[_0x62fe('0x2')](0x0);return _0x515232['diff'](_0x2175ad,_0x62fe('0x3'));}function AgentComplete(_0x1b258e,_0x37bde5){this[_0x62fe('0x4')]=0x4;this[_0x62fe('0x5')]=_0x62fe('0x6');this[_0x62fe('0x7')]=_0x1b258e[_0x62fe('0x7')];this[_0x62fe('0x8')]=_0x1b258e[_0x62fe('0x8')];this[_0x62fe('0x9')]=_0x1b258e[_0x62fe('0x8')]===_0x62fe('0xa')?_0x62fe('0xb'):_0x1b258e[_0x62fe('0x8')];this[_0x62fe('0xc')]=_0x1b258e[_0x62fe('0xc')];this[_0x62fe('0xd')]=_0x1b258e[_0x62fe('0xd')];this['countnoanswerretry']=_0x1b258e[_0x62fe('0xe')];this[_0x62fe('0xf')]=_0x1b258e[_0x62fe('0xc')]+_0x1b258e[_0x62fe('0xd')]+_0x1b258e['countnoanswerretry']+_0x1b258e['countnosuchnumberretry']+_0x1b258e[_0x62fe('0x10')]+_0x1b258e['countabandonedretry']+_0x1b258e[_0x62fe('0x11')]+_0x1b258e[_0x62fe('0x12')];this[_0x62fe('0x13')]=_0x1b258e['countnosuchnumberretry'];this[_0x62fe('0x10')]=_0x1b258e[_0x62fe('0x10')];this[_0x62fe('0x14')]=_0x1b258e[_0x62fe('0x14')];this[_0x62fe('0x11')]=_0x1b258e['countmachineretry'];this[_0x62fe('0x12')]=_0x1b258e['countagentrejectretry'];this['uniqueid']=_0x37bde5[_0x62fe('0x15')];this['calleridname']=_0x1b258e['name'];this[_0x62fe('0x16')]=_0x1b258e[_0x62fe('0x17')];this[_0x62fe('0x18')]=_0x1b258e[_0x62fe('0x18')];this[_0x62fe('0x19')]=_0x1b258e[_0x62fe('0x19')];this[_0x62fe('0x1a')]=_0x1b258e[_0x62fe('0x1a')];this[_0x62fe('0x1b')]=moment()[_0x62fe('0x1c')](_0x62fe('0x1d'));this[_0x62fe('0x1e')]=getSeconds(_0x1b258e[_0x62fe('0x19')],_0x1b258e[_0x62fe('0x18')]);this[_0x62fe('0x1f')]=getSeconds(_0x1b258e[_0x62fe('0x1a')],_0x1b258e['responsetime']);this[_0x62fe('0x20')]=getSeconds(this[_0x62fe('0x1b')],_0x1b258e[_0x62fe('0x1a')]);this[_0x62fe('0xb')]=_0x37bde5[_0x62fe('0xb')];this['membername']=_0x37bde5[_0x62fe('0x21')];this['reason']=_0x37bde5[_0x62fe('0x22')];this[_0x62fe('0x23')]=_0x1b258e[_0x62fe('0x23')];this['callbackuniqueid']=_0x1b258e[_0x62fe('0x24')];this[_0x62fe('0x25')]=_0x1b258e['callbackat'];this['recallme']=_0x1b258e[_0x62fe('0x26')];this[_0x62fe('0x27')]=_0x1b258e[_0x62fe('0x27')];this[_0x62fe('0x28')]=_0x1b258e[_0x62fe('0x28')];this[_0x62fe('0x29')]=_0x1b258e[_0x62fe('0x29')];this[_0x62fe('0x2a')]=_0x1b258e[_0x62fe('0x2a')];this[_0x62fe('0x2b')]=_0x1b258e[_0x62fe('0x2b')];this[_0x62fe('0x2c')]=_0x1b258e[_0x62fe('0x2c')]||'';this['originatecalleridname']=_0x1b258e['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xc5c8=['name','calleridnum','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','membername','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','queue','countcongestionretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0xc5c8,0x118));var _0x8c5c=function(_0x11a683,_0x305e3f){_0x11a683=_0x11a683-0x0;var _0x43a0bb=_0xc5c8[_0x11a683];return _0x43a0bb;};'use strict';var util=require(_0x8c5c('0x0'));var _=require(_0x8c5c('0x1'));var moment=require(_0x8c5c('0x2'));function getSeconds(_0x55065c,_0x1217bd){var _0x5eb28f=moment(_0x55065c)['milliseconds'](0x0);var _0xf33a8e=moment(_0x1217bd)[_0x8c5c('0x3')](0x0);return _0x5eb28f['diff'](_0xf33a8e,_0x8c5c('0x4'));}function AgentComplete(_0x6bfa4f,_0x390b86){this[_0x8c5c('0x5')]=0x4;this[_0x8c5c('0x6')]=_0x8c5c('0x7');this[_0x8c5c('0x8')]=_0x6bfa4f[_0x8c5c('0x8')];this[_0x8c5c('0x9')]=_0x6bfa4f[_0x8c5c('0x9')];this['campaigntype']=_0x6bfa4f['type']==='outbound'?_0x8c5c('0xa'):_0x6bfa4f[_0x8c5c('0x9')];this['countbusyretry']=_0x6bfa4f['countbusyretry'];this[_0x8c5c('0xb')]=_0x6bfa4f[_0x8c5c('0xb')];this['countnoanswerretry']=_0x6bfa4f['countnoanswerretry'];this[_0x8c5c('0xc')]=_0x6bfa4f[_0x8c5c('0xd')]+_0x6bfa4f['countcongestionretry']+_0x6bfa4f['countnoanswerretry']+_0x6bfa4f[_0x8c5c('0xe')]+_0x6bfa4f[_0x8c5c('0xf')]+_0x6bfa4f[_0x8c5c('0x10')]+_0x6bfa4f['countmachineretry']+_0x6bfa4f[_0x8c5c('0x11')];this[_0x8c5c('0xe')]=_0x6bfa4f['countnosuchnumberretry'];this['countdropretry']=_0x6bfa4f[_0x8c5c('0xf')];this['countabandonedretry']=_0x6bfa4f[_0x8c5c('0x10')];this[_0x8c5c('0x12')]=_0x6bfa4f[_0x8c5c('0x12')];this[_0x8c5c('0x11')]=_0x6bfa4f[_0x8c5c('0x11')];this[_0x8c5c('0x13')]=_0x390b86[_0x8c5c('0x13')];this[_0x8c5c('0x14')]=_0x6bfa4f[_0x8c5c('0x15')];this[_0x8c5c('0x16')]=_0x6bfa4f['number'];this['starttime']=_0x6bfa4f['starttime'];this['responsetime']=_0x6bfa4f[_0x8c5c('0x17')];this['answertime']=_0x6bfa4f[_0x8c5c('0x18')];this[_0x8c5c('0x19')]=moment()[_0x8c5c('0x1a')](_0x8c5c('0x1b'));this[_0x8c5c('0x1c')]=getSeconds(_0x6bfa4f[_0x8c5c('0x17')],_0x6bfa4f[_0x8c5c('0x1d')]);this[_0x8c5c('0x1e')]=getSeconds(_0x6bfa4f[_0x8c5c('0x18')],_0x6bfa4f[_0x8c5c('0x17')]);this['talktime']=getSeconds(this[_0x8c5c('0x19')],_0x6bfa4f[_0x8c5c('0x18')]);this[_0x8c5c('0xa')]=_0x390b86['queue'];this[_0x8c5c('0x1f')]=_0x390b86['membername'];this['reason']=_0x390b86['reason'];this[_0x8c5c('0x20')]=_0x6bfa4f[_0x8c5c('0x20')];this[_0x8c5c('0x21')]=_0x6bfa4f[_0x8c5c('0x21')];this[_0x8c5c('0x22')]=_0x6bfa4f['callbackat'];this['recallme']=_0x6bfa4f['recallme'];this[_0x8c5c('0x23')]=_0x6bfa4f[_0x8c5c('0x23')];this[_0x8c5c('0x24')]=_0x6bfa4f[_0x8c5c('0x24')];this[_0x8c5c('0x25')]=_0x6bfa4f[_0x8c5c('0x25')];this[_0x8c5c('0x26')]=_0x6bfa4f[_0x8c5c('0x26')];this[_0x8c5c('0x27')]=_0x6bfa4f[_0x8c5c('0x27')];this[_0x8c5c('0x28')]=_0x6bfa4f[_0x8c5c('0x28')]||'';this[_0x8c5c('0x29')]=_0x6bfa4f['originatecalleridname']||'';}module[_0x8c5c('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a9fb651..546b9e3 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 _0xfd20=['lodash','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname'];(function(_0x30e069,_0xb94d4){var _0x138c47=function(_0x186d60){while(--_0x186d60){_0x30e069['push'](_0x30e069['shift']());}};_0x138c47(++_0xb94d4);}(_0xfd20,0x66));var _0x0fd2=function(_0x25b50a,_0x364868){_0x25b50a=_0x25b50a-0x0;var _0xf6a93=_0xfd20[_0x25b50a];return _0xf6a93;};'use strict';var util=require('util');var _=require(_0x0fd2('0x0'));var moment=require('moment');function getSeconds(_0x54f464,_0x429df4){var _0x28eb77=moment(_0x54f464)['milliseconds'](0x0);var _0x27bee6=moment(_0x429df4)['milliseconds'](0x0);return _0x28eb77[_0x0fd2('0x1')](_0x27bee6,_0x0fd2('0x2'));}function Final(_0x2ef0c3){this[_0x0fd2('0x3')]=_0x2ef0c3[_0x0fd2('0x3')];this['scheduledat']=_0x2ef0c3['scheduledat'];this[_0x0fd2('0x4')]=_0x2ef0c3[_0x0fd2('0x4')];this[_0x0fd2('0x5')]=_0x2ef0c3[_0x0fd2('0x4')]===_0x0fd2('0x6')?_0x0fd2('0x7'):_0x2ef0c3[_0x0fd2('0x4')];this['countbusyretry']=_0x2ef0c3[_0x0fd2('0x8')];this[_0x0fd2('0x9')]=_0x2ef0c3['countcongestionretry'];this[_0x0fd2('0xa')]=_0x2ef0c3['countnoanswerretry'];this[_0x0fd2('0xb')]=_0x2ef0c3[_0x0fd2('0x8')]+_0x2ef0c3[_0x0fd2('0x9')]+_0x2ef0c3[_0x0fd2('0xa')]+_0x2ef0c3[_0x0fd2('0xc')]+_0x2ef0c3[_0x0fd2('0xd')]+_0x2ef0c3[_0x0fd2('0xe')]+_0x2ef0c3[_0x0fd2('0xf')]+_0x2ef0c3['countagentrejectretry'];this['countnosuchnumberretry']=_0x2ef0c3[_0x0fd2('0xc')];this[_0x0fd2('0xd')]=_0x2ef0c3[_0x0fd2('0xd')];this[_0x0fd2('0xe')]=_0x2ef0c3['countabandonedretry'];this[_0x0fd2('0xf')]=_0x2ef0c3['countmachineretry'];this['countagentrejectretry']=_0x2ef0c3[_0x0fd2('0x10')];this['queue']=_0x2ef0c3[_0x0fd2('0x7')];this['calleridname']=_0x2ef0c3[_0x0fd2('0x11')];this['calleridnum']=_0x2ef0c3[_0x0fd2('0x12')];this[_0x0fd2('0x13')]=_0x2ef0c3['starttime'];this[_0x0fd2('0x14')]=_0x2ef0c3['responsetime'];this[_0x0fd2('0x15')]=_0x2ef0c3[_0x0fd2('0x14')];this[_0x0fd2('0x16')]=_0x2ef0c3[_0x0fd2('0x16')]||0x0;this[_0x0fd2('0x17')]=_0x2ef0c3[_0x0fd2('0x17')]||0x0;this[_0x0fd2('0x18')]=_0x2ef0c3[_0x0fd2('0x18')]||0x0;this[_0x0fd2('0x19')]=_0x2ef0c3[_0x0fd2('0x19')];this['callbackuniqueid']=_0x2ef0c3['callbackuniqueid'];this['callbackat']=_0x2ef0c3[_0x0fd2('0x1a')];this[_0x0fd2('0x1b')]=_0x2ef0c3['recallme'];this['ContactId']=_0x2ef0c3[_0x0fd2('0x1c')];this[_0x0fd2('0x1d')]=_0x2ef0c3[_0x0fd2('0x1d')];this[_0x0fd2('0x1e')]=_0x2ef0c3[_0x0fd2('0x1e')];this['VoiceQueueId']=_0x2ef0c3[_0x0fd2('0x1f')];this[_0x0fd2('0x20')]=_0x2ef0c3[_0x0fd2('0x20')];this['originatecalleridnum']=_0x2ef0c3['originatecalleridnum']||'';this[_0x0fd2('0x21')]=_0x2ef0c3[_0x0fd2('0x21')]||'';}module['exports']=Final; \ No newline at end of file +var _0x61a5=['scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','moment','milliseconds','diff','uniqueid'];(function(_0x166e04,_0x416601){var _0x118515=function(_0x3c82df){while(--_0x3c82df){_0x166e04['push'](_0x166e04['shift']());}};_0x118515(++_0x416601);}(_0x61a5,0xf0));var _0x561a=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x61a5[_0x31eb67];return _0x2a8cb8;};'use strict';var util=require(_0x561a('0x0'));var _=require('lodash');var moment=require(_0x561a('0x1'));function getSeconds(_0x28892d,_0xc164c0){var _0x862a0e=moment(_0x28892d)[_0x561a('0x2')](0x0);var _0x58f636=moment(_0xc164c0)[_0x561a('0x2')](0x0);return _0x862a0e[_0x561a('0x3')](_0x58f636,'seconds');}function Final(_0x18902a){this[_0x561a('0x4')]=_0x18902a[_0x561a('0x4')];this[_0x561a('0x5')]=_0x18902a[_0x561a('0x5')];this[_0x561a('0x6')]=_0x18902a[_0x561a('0x6')];this['campaigntype']=_0x18902a[_0x561a('0x6')]==='outbound'?_0x561a('0x7'):_0x18902a[_0x561a('0x6')];this['countbusyretry']=_0x18902a[_0x561a('0x8')];this[_0x561a('0x9')]=_0x18902a['countcongestionretry'];this[_0x561a('0xa')]=_0x18902a['countnoanswerretry'];this[_0x561a('0xb')]=_0x18902a[_0x561a('0x8')]+_0x18902a[_0x561a('0x9')]+_0x18902a[_0x561a('0xa')]+_0x18902a[_0x561a('0xc')]+_0x18902a[_0x561a('0xd')]+_0x18902a[_0x561a('0xe')]+_0x18902a[_0x561a('0xf')]+_0x18902a[_0x561a('0x10')];this[_0x561a('0xc')]=_0x18902a[_0x561a('0xc')];this[_0x561a('0xd')]=_0x18902a['countdropretry'];this[_0x561a('0xe')]=_0x18902a[_0x561a('0xe')];this[_0x561a('0xf')]=_0x18902a[_0x561a('0xf')];this[_0x561a('0x10')]=_0x18902a[_0x561a('0x10')];this[_0x561a('0x7')]=_0x18902a[_0x561a('0x7')];this[_0x561a('0x11')]=_0x18902a[_0x561a('0x11')];this[_0x561a('0x12')]=_0x18902a['calleridnum'];this[_0x561a('0x13')]=_0x18902a[_0x561a('0x13')];this['responsetime']=_0x18902a[_0x561a('0x14')];this[_0x561a('0x15')]=_0x18902a['responsetime'];this[_0x561a('0x16')]=_0x18902a['ringtime']||0x0;this['holdtime']=_0x18902a[_0x561a('0x17')]||0x0;this[_0x561a('0x18')]=_0x18902a['talktime']||0x0;this[_0x561a('0x19')]=_0x18902a[_0x561a('0x19')];this[_0x561a('0x1a')]=_0x18902a[_0x561a('0x1a')];this[_0x561a('0x1b')]=_0x18902a[_0x561a('0x1b')];this['recallme']=_0x18902a[_0x561a('0x1c')];this[_0x561a('0x1d')]=_0x18902a[_0x561a('0x1d')];this['ListId']=_0x18902a['ListId'];this[_0x561a('0x1e')]=_0x18902a[_0x561a('0x1e')];this[_0x561a('0x1f')]=_0x18902a[_0x561a('0x1f')];this[_0x561a('0x20')]=_0x18902a[_0x561a('0x20')];this[_0x561a('0x21')]=_0x18902a[_0x561a('0x21')]||'';this['originatecalleridname']=_0x18902a['originatecalleridname']||'';}module[_0x561a('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 223f69f..bc1d98a 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 _0xfcc3=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x517a86,_0x1b0466){var _0x5abb1c=function(_0x459bd9){while(--_0x459bd9){_0x517a86['push'](_0x517a86['shift']());}};_0x5abb1c(++_0x1b0466);}(_0xfcc3,0x152));var _0x3fcc=function(_0x365fd0,_0x4859a3){_0x365fd0=_0x365fd0-0x0;var _0x69f41e=_0xfcc3[_0x365fd0];return _0x69f41e;};'use strict';var util=require(_0x3fcc('0x0'));var _=require('lodash');var moment=require(_0x3fcc('0x1'));function getSeconds(_0x1b907b,_0x4c45be){var _0x10013d=moment(_0x1b907b)[_0x3fcc('0x2')](0x0);var _0x2d2ce5=moment(_0x4c45be)[_0x3fcc('0x2')](0x0);return _0x10013d[_0x3fcc('0x3')](_0x2d2ce5,_0x3fcc('0x4'));}function Hangup(_0x3162fd,_0x142409){this['state']=0x4;this[_0x3fcc('0x5')]=_0x3fcc('0x6');this[_0x3fcc('0x7')]=_0x3162fd[_0x3fcc('0x7')];this[_0x3fcc('0x8')]=_0x3162fd['type'];this[_0x3fcc('0x9')]=_0x3162fd[_0x3fcc('0x8')]===_0x3fcc('0xa')?_0x3fcc('0xb'):_0x3162fd[_0x3fcc('0x8')];this[_0x3fcc('0xc')]=_0x3162fd[_0x3fcc('0xc')];this[_0x3fcc('0xd')]=_0x3162fd['countcongestionretry'];this[_0x3fcc('0xe')]=_0x3162fd[_0x3fcc('0xe')];this[_0x3fcc('0xf')]=_0x3162fd['countbusyretry']+_0x3162fd[_0x3fcc('0xd')]+_0x3162fd[_0x3fcc('0xe')]+_0x3162fd[_0x3fcc('0x10')]+_0x3162fd[_0x3fcc('0x11')]+_0x3162fd['countabandonedretry']+_0x3162fd['countmachineretry']+_0x3162fd[_0x3fcc('0x12')];this[_0x3fcc('0x10')]=_0x3162fd[_0x3fcc('0x10')];this['countdropretry']=_0x3162fd[_0x3fcc('0x11')];this[_0x3fcc('0x13')]=_0x3162fd['countabandonedretry'];this[_0x3fcc('0x14')]=_0x3162fd[_0x3fcc('0x14')];this[_0x3fcc('0x12')]=_0x3162fd[_0x3fcc('0x12')];this[_0x3fcc('0x15')]=_0x142409['uniqueid'];this[_0x3fcc('0x16')]=_0x3162fd['name'];this[_0x3fcc('0x17')]=_0x3162fd[_0x3fcc('0x18')];this[_0x3fcc('0x19')]=_0x3162fd[_0x3fcc('0x19')];this[_0x3fcc('0x1a')]=_0x3162fd['responsetime'];this[_0x3fcc('0x1b')]=moment()[_0x3fcc('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3fcc('0x1d')]=getSeconds(_0x3162fd[_0x3fcc('0x1a')],_0x3162fd[_0x3fcc('0x19')]);this[_0x3fcc('0x1e')]=0x0;this[_0x3fcc('0x1f')]=getSeconds(this[_0x3fcc('0x1b')],_0x3162fd[_0x3fcc('0x1a')]);this[_0x3fcc('0xb')]=_0x3162fd[_0x3fcc('0xb')];this['membername']=_0x3fcc('0x20');this[_0x3fcc('0x21')]=_0x142409[_0x3fcc('0x22')];this[_0x3fcc('0x23')]=_0x3162fd[_0x3fcc('0x23')];this['callbackuniqueid']=_0x3162fd[_0x3fcc('0x24')];this['callbackat']=_0x3162fd[_0x3fcc('0x25')];this[_0x3fcc('0x26')]=_0x3162fd[_0x3fcc('0x26')];this[_0x3fcc('0x27')]=_0x3162fd[_0x3fcc('0x27')];this[_0x3fcc('0x28')]=_0x3162fd[_0x3fcc('0x28')];this[_0x3fcc('0x29')]=_0x3162fd[_0x3fcc('0x29')];this[_0x3fcc('0x2a')]=_0x3162fd[_0x3fcc('0x2a')];this['CampaignId']=_0x3162fd['CampaignId'];}module[_0x3fcc('0x2b')]=Hangup; \ No newline at end of file +var _0x316b=['CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x52157e,_0x1ab288){var _0x21fde5=function(_0x40e1c6){while(--_0x40e1c6){_0x52157e['push'](_0x52157e['shift']());}};_0x21fde5(++_0x1ab288);}(_0x316b,0x12f));var _0xb316=function(_0x2962b4,_0x4b0786){_0x2962b4=_0x2962b4-0x0;var _0x411b7d=_0x316b[_0x2962b4];return _0x411b7d;};'use strict';var util=require(_0xb316('0x0'));var _=require(_0xb316('0x1'));var moment=require('moment');function getSeconds(_0x9348c3,_0x124e59){var _0x1bb5d8=moment(_0x9348c3)[_0xb316('0x2')](0x0);var _0x3c62ab=moment(_0x124e59)[_0xb316('0x2')](0x0);return _0x1bb5d8[_0xb316('0x3')](_0x3c62ab,_0xb316('0x4'));}function Hangup(_0x5814b7,_0x8c42f4){this[_0xb316('0x5')]=0x4;this[_0xb316('0x6')]=_0xb316('0x7');this[_0xb316('0x8')]=_0x5814b7[_0xb316('0x8')];this[_0xb316('0x9')]=_0x5814b7[_0xb316('0x9')];this['campaigntype']=_0x5814b7[_0xb316('0x9')]===_0xb316('0xa')?_0xb316('0xb'):_0x5814b7[_0xb316('0x9')];this[_0xb316('0xc')]=_0x5814b7['countbusyretry'];this[_0xb316('0xd')]=_0x5814b7[_0xb316('0xd')];this[_0xb316('0xe')]=_0x5814b7[_0xb316('0xe')];this['countglobal']=_0x5814b7[_0xb316('0xc')]+_0x5814b7[_0xb316('0xd')]+_0x5814b7['countnoanswerretry']+_0x5814b7[_0xb316('0xf')]+_0x5814b7['countdropretry']+_0x5814b7[_0xb316('0x10')]+_0x5814b7['countmachineretry']+_0x5814b7[_0xb316('0x11')];this[_0xb316('0xf')]=_0x5814b7[_0xb316('0xf')];this[_0xb316('0x12')]=_0x5814b7['countdropretry'];this[_0xb316('0x10')]=_0x5814b7[_0xb316('0x10')];this['countmachineretry']=_0x5814b7[_0xb316('0x13')];this['countagentrejectretry']=_0x5814b7[_0xb316('0x11')];this[_0xb316('0x14')]=_0x8c42f4[_0xb316('0x14')];this[_0xb316('0x15')]=_0x5814b7[_0xb316('0x16')];this['calleridnum']=_0x5814b7['number'];this[_0xb316('0x17')]=_0x5814b7[_0xb316('0x17')];this['responsetime']=_0x5814b7[_0xb316('0x18')];this['endtime']=moment()[_0xb316('0x19')](_0xb316('0x1a'));this[_0xb316('0x1b')]=getSeconds(_0x5814b7[_0xb316('0x18')],_0x5814b7[_0xb316('0x17')]);this[_0xb316('0x1c')]=0x0;this[_0xb316('0x1d')]=getSeconds(this[_0xb316('0x1e')],_0x5814b7[_0xb316('0x18')]);this[_0xb316('0xb')]=_0x5814b7[_0xb316('0xb')];this[_0xb316('0x1f')]='IVR';this['reason']=_0x8c42f4[_0xb316('0x20')];this[_0xb316('0x21')]=_0x5814b7[_0xb316('0x21')];this['callbackuniqueid']=_0x5814b7[_0xb316('0x22')];this[_0xb316('0x23')]=_0x5814b7['callbackat'];this['recallme']=_0x5814b7[_0xb316('0x24')];this[_0xb316('0x25')]=_0x5814b7['ContactId'];this[_0xb316('0x26')]=_0x5814b7[_0xb316('0x26')];this[_0xb316('0x27')]=_0x5814b7[_0xb316('0x27')];this['VoiceQueueId']=_0x5814b7[_0xb316('0x28')];this[_0xb316('0x29')]=_0x5814b7[_0xb316('0x29')];}module[_0xb316('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index f09157d..4ece6a5 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 _0x8c04=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','name','calleridnum','number','starttime','responsetime','endtime','talktime','callback','callbackuniqueid'];(function(_0x2ef1d1,_0x37f6c4){var _0x4aa104=function(_0x341c75){while(--_0x341c75){_0x2ef1d1['push'](_0x2ef1d1['shift']());}};_0x4aa104(++_0x37f6c4);}(_0x8c04,0x155));var _0x48c0=function(_0x618ad6,_0x4992d2){_0x618ad6=_0x618ad6-0x0;var _0x277505=_0x8c04[_0x618ad6];return _0x277505;};'use strict';var util=require(_0x48c0('0x0'));var _=require(_0x48c0('0x1'));var moment=require(_0x48c0('0x2'));function getSeconds(_0x1d6d08,_0x3faf1b){var _0x4df881=moment(_0x1d6d08)[_0x48c0('0x3')](0x0);var _0x172479=moment(_0x3faf1b)[_0x48c0('0x3')](0x0);return _0x4df881[_0x48c0('0x4')](_0x172479,_0x48c0('0x5'));}function History(_0x39125f){this[_0x48c0('0x6')]=_0x39125f['uniqueid'];this['scheduledat']=_0x39125f[_0x48c0('0x7')]||undefined;this[_0x48c0('0x8')]=_0x39125f[_0x48c0('0x8')];this[_0x48c0('0x9')]=_0x39125f['type']==='outbound'?_0x48c0('0xa'):_0x39125f['type'];this[_0x48c0('0xb')]=_0x39125f['countbusyretry'];this['countcongestionretry']=_0x39125f[_0x48c0('0xc')];this[_0x48c0('0xd')]=_0x39125f[_0x48c0('0xd')];this[_0x48c0('0xe')]=_0x39125f[_0x48c0('0xb')]+_0x39125f[_0x48c0('0xc')]+_0x39125f[_0x48c0('0xd')]+_0x39125f['countnosuchnumberretry']+_0x39125f[_0x48c0('0xf')]+_0x39125f['countabandonedretry']+_0x39125f[_0x48c0('0x10')]+_0x39125f[_0x48c0('0x11')];this['countnosuchnumberretry']=_0x39125f[_0x48c0('0x12')];this['countdropretry']=_0x39125f[_0x48c0('0xf')];this[_0x48c0('0x13')]=_0x39125f[_0x48c0('0x13')];this['countmachineretry']=_0x39125f[_0x48c0('0x10')];this[_0x48c0('0x11')]=_0x39125f[_0x48c0('0x11')];this['queue']=_0x39125f[_0x48c0('0xa')];this['calleridname']=_0x39125f[_0x48c0('0x14')];this[_0x48c0('0x15')]=_0x39125f[_0x48c0('0x16')];this[_0x48c0('0x17')]=_0x39125f['starttime'];this['responsetime']=_0x39125f[_0x48c0('0x18')];this[_0x48c0('0x19')]=_0x39125f[_0x48c0('0x18')];this['ringtime']=getSeconds(_0x39125f[_0x48c0('0x18')],_0x39125f['starttime']);this['holdtime']=0x0;this[_0x48c0('0x1a')]=0x0;this[_0x48c0('0x1b')]=_0x39125f[_0x48c0('0x1b')];this['callbackuniqueid']=_0x39125f[_0x48c0('0x1c')];this['callbackat']=_0x39125f[_0x48c0('0x1d')];this[_0x48c0('0x1e')]=_0x39125f['recallme'];this['ContactId']=_0x39125f[_0x48c0('0x1f')];this[_0x48c0('0x20')]=_0x39125f[_0x48c0('0x20')];this[_0x48c0('0x21')]=_0x39125f[_0x48c0('0x21')];this['VoiceQueueId']=_0x39125f[_0x48c0('0x22')];this[_0x48c0('0x23')]=_0x39125f['CampaignId'];this['originatecalleridnum']=_0x39125f['originatecalleridnum']||'';this[_0x48c0('0x24')]=_0x39125f['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file +var _0xed43=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0xed43,0x13f));var _0x3ed4=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xed43[_0x497b1e];return _0x3f72e1;};'use strict';var util=require(_0x3ed4('0x0'));var _=require(_0x3ed4('0x1'));var moment=require(_0x3ed4('0x2'));function getSeconds(_0x4f34de,_0x6c4b33){var _0x52ba30=moment(_0x4f34de)[_0x3ed4('0x3')](0x0);var _0x1bc1f0=moment(_0x6c4b33)['milliseconds'](0x0);return _0x52ba30[_0x3ed4('0x4')](_0x1bc1f0,_0x3ed4('0x5'));}function History(_0x21f83a){this[_0x3ed4('0x6')]=_0x21f83a['uniqueid'];this[_0x3ed4('0x7')]=_0x21f83a[_0x3ed4('0x7')]||undefined;this[_0x3ed4('0x8')]=_0x21f83a[_0x3ed4('0x8')];this['campaigntype']=_0x21f83a[_0x3ed4('0x8')]===_0x3ed4('0x9')?_0x3ed4('0xa'):_0x21f83a[_0x3ed4('0x8')];this[_0x3ed4('0xb')]=_0x21f83a[_0x3ed4('0xb')];this[_0x3ed4('0xc')]=_0x21f83a[_0x3ed4('0xc')];this[_0x3ed4('0xd')]=_0x21f83a[_0x3ed4('0xd')];this['countglobal']=_0x21f83a[_0x3ed4('0xb')]+_0x21f83a[_0x3ed4('0xc')]+_0x21f83a[_0x3ed4('0xd')]+_0x21f83a[_0x3ed4('0xe')]+_0x21f83a[_0x3ed4('0xf')]+_0x21f83a['countabandonedretry']+_0x21f83a['countmachineretry']+_0x21f83a['countagentrejectretry'];this[_0x3ed4('0xe')]=_0x21f83a[_0x3ed4('0xe')];this['countdropretry']=_0x21f83a[_0x3ed4('0xf')];this[_0x3ed4('0x10')]=_0x21f83a[_0x3ed4('0x10')];this[_0x3ed4('0x11')]=_0x21f83a[_0x3ed4('0x11')];this['countagentrejectretry']=_0x21f83a[_0x3ed4('0x12')];this[_0x3ed4('0xa')]=_0x21f83a['queue'];this['calleridname']=_0x21f83a[_0x3ed4('0x13')];this[_0x3ed4('0x14')]=_0x21f83a[_0x3ed4('0x15')];this['starttime']=_0x21f83a[_0x3ed4('0x16')];this['responsetime']=_0x21f83a[_0x3ed4('0x17')];this[_0x3ed4('0x18')]=_0x21f83a[_0x3ed4('0x17')];this[_0x3ed4('0x19')]=getSeconds(_0x21f83a['responsetime'],_0x21f83a['starttime']);this[_0x3ed4('0x1a')]=0x0;this[_0x3ed4('0x1b')]=0x0;this['callback']=_0x21f83a[_0x3ed4('0x1c')];this['callbackuniqueid']=_0x21f83a['callbackuniqueid'];this[_0x3ed4('0x1d')]=_0x21f83a[_0x3ed4('0x1d')];this[_0x3ed4('0x1e')]=_0x21f83a[_0x3ed4('0x1e')];this[_0x3ed4('0x1f')]=_0x21f83a[_0x3ed4('0x1f')];this[_0x3ed4('0x20')]=_0x21f83a['ListId'];this['UserId']=_0x21f83a[_0x3ed4('0x21')];this[_0x3ed4('0x22')]=_0x21f83a[_0x3ed4('0x22')];this[_0x3ed4('0x23')]=_0x21f83a[_0x3ed4('0x23')];this[_0x3ed4('0x24')]=_0x21f83a[_0x3ed4('0x24')]||'';this[_0x3ed4('0x25')]=_0x21f83a[_0x3ed4('0x25')]||'';}module[_0x3ed4('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 288286a..bf24619 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 _0x0acc=['XMD-','toUpper','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','check\x20failure','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[countReScheduled]\x20','[handlePredictive][limitChannel]','tryOriginatePredictive','Contact.phone','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','redis','localhost','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','\x20AGENTS\x20NOT\x20LOGGED','message','INTERVAL_IS_NULL','name','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','outbound','strategy','available','pTalking','sumBillable','sumDuration','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','Action','status','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','prototype','resolve','countReScheduled','catch','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','membername','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','add','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','outboundAnswerAgiCallsDay','emit','countdropretry','reason19\x20machine....','dialMachineMaxRetry','dialMachineRetryFrequency','minutes','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','syncNewExten','channel','actionid','locked','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','[Catch][Preview][syncQueueStatusComplete]','_rr','paused','unlockRR','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','isArray','iftime\x20%s,%s','content','indexOf','true','command','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0acc,0x9a));var _0xc0ac=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0x0acc[_0x5e8fc];return _0x41c58c;};'use strict';var util=require('util');var _=require(_0xc0ac('0x0'));var BPromise=require('bluebird');var uuid=require(_0xc0ac('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xc0ac('0x2'));var Redis=require(_0xc0ac('0x3'));var ut=require(_0xc0ac('0x4'));var config=require(_0xc0ac('0x5'));var logger=require(_0xc0ac('0x6'))(_0xc0ac('0x7'));var loggerBooked=require(_0xc0ac('0x6'))(_0xc0ac('0x8'));var loggerPredictive=require(_0xc0ac('0x6'))(_0xc0ac('0x9'));var loggerPredictiveCalls=require(_0xc0ac('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xc0ac('0x6'))(_0xc0ac('0xa'));var ami=require('../ami');config[_0xc0ac('0xb')]=_['defaults'](config[_0xc0ac('0xb')],{'host':_0xc0ac('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc0ac('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc0ac('0xd'));var voiceQueueRt=require(_0xc0ac('0xe'));var RpcSetting=require(_0xc0ac('0xf'));var Action=require(_0xc0ac('0x10'));var History=require(_0xc0ac('0x11'));var Final=require('./final');var AgentComplete=require(_0xc0ac('0x12'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xc0ac('0x13'));var ipAgi=process[_0xc0ac('0x14')][_0xc0ac('0x15')]||'127.0.0.1';var strategy={'rrmemory':_0xc0ac('0x16'),'roundrobin':_0xc0ac('0x17')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xc0ac('0x18')]=function(_0x5c46de){this[_0xc0ac('0x19')]=this[_0xc0ac('0x19')]?this['tail'][_0xc0ac('0x1a')](_0x5c46de):_0x5c46de();};function Dialer(_0x146c9f,_0x9152be){this['sequence']=new Sequence();this[_0xc0ac('0x1b')]=_0x9152be;this[_0xc0ac('0x1c')]=_0x146c9f[_0xc0ac('0x1c')];this[_0xc0ac('0x1d')]=_0x146c9f['campaigns'];this[_0xc0ac('0x1e')]=_0x146c9f[_0xc0ac('0x1e')];this[_0xc0ac('0x1f')]=_0x146c9f[_0xc0ac('0x1f')];this[_0xc0ac('0x20')]=config[_0xc0ac('0x20')]||0x2;this[_0xc0ac('0x21')]={};this[_0xc0ac('0x22')]={};this[_0xc0ac('0x23')]={};this[_0xc0ac('0x24')]={};this[_0xc0ac('0x25')]={};this[_0xc0ac('0x26')]={};this[_0xc0ac('0x27')]={};this[_0xc0ac('0x28')]={};this[_0xc0ac('0x29')]={};this[_0xc0ac('0x2a')]={};ami['on']('agentconnect',this[_0xc0ac('0x2b')][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x2d'),this[_0xc0ac('0x2e')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0xc0ac('0x2f'),this[_0xc0ac('0x30')][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x31'),this[_0xc0ac('0xa')]['bind'](this));ami['on'](_0xc0ac('0x32'),this[_0xc0ac('0x33')][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x34'),this['syncNewExten'][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x35'),this[_0xc0ac('0x36')][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x37'),this[_0xc0ac('0x38')][_0xc0ac('0x2c')](this));ami['on'](_0xc0ac('0x39'),this[_0xc0ac('0x3a')][_0xc0ac('0x2c')](this));this[_0xc0ac('0x3b')]();this[_0xc0ac('0x3c')]();RpcSetting[_0xc0ac('0x3d')]()[_0xc0ac('0x3e')](function(_0x1b9105){previewRecallmeReminderInterval=_0x1b9105[_0xc0ac('0x3f')];});}function isNotNull(_0x1d79db){return _0x1d79db!==null&&!_[_0xc0ac('0x40')](_0x1d79db);}function checkIsLoggedIn(_0x2f097e,_0x14148c){return function(){if(_0x14148c<=0x0){_0x2f097e['message']='AGENTS_NOT_LOGGED';throw _0x2f097e['name']+_0xc0ac('0x41');}};}function isActive(_0x365394){return _0x365394;}function checkIsActive(_0x3654f4,_0x4a4560){return function(){if(!isActive(_0x4a4560)){_0x3654f4[_0xc0ac('0x42')]='NOT_ACTIVE';throw _0x3654f4['name']+'\x20NOT\x20Active';}};}function checkInterval(_0xab4987){return function(){if(!isNotNull(_0xab4987['Interval'])){_0xab4987[_0xc0ac('0x42')]=_0xc0ac('0x43');throw _0xab4987[_0xc0ac('0x44')]+_0xc0ac('0x45');}if(!isNotNull(_0xab4987[_0xc0ac('0x46')]['Intervals'])){_0xab4987[_0xc0ac('0x42')]='INTERVAL_IS_NULL';throw _0xab4987['name']+_0xc0ac('0x45');}if(!isNotNull(_[_0xc0ac('0x47')](_0xab4987[_0xc0ac('0x46')][_0xc0ac('0x48')]))){_0xab4987[_0xc0ac('0x42')]=_0xc0ac('0x43');throw _0xab4987[_0xc0ac('0x44')]+_0xc0ac('0x45');}};}function msgResponse(_0x3ef462,_0x264ac4,_0x50ba33){return{'action':_0x3ef462,'response':_0x264ac4,'message':_0x50ba33,'stack':_0x50ba33};}function myreject(_0x21f9e0){return function(_0x5d4069){return _0x21f9e0(msgResponse(_0xc0ac('0x49'),_0xc0ac('0x4a'),JSON[_0xc0ac('0x4b')](_0x5d4069)));};}function getSeconds(_0x2c186b,_0x30bcaf){var _0xe212a8=moment(_0x2c186b)[_0xc0ac('0x4c')](0x0);var _0x5cc576=moment(_0x30bcaf)[_0xc0ac('0x4c')](0x0);return _0xe212a8[_0xc0ac('0x4d')](_0x5cc576,_0xc0ac('0x4e'));}function emit(_0x5786c4,_0x52ec53,_0x1b6437){io['to'](_0x5786c4)['emit'](_0x52ec53,_0x1b6437);}function emitVoiceQueueSummary(_0x1abb6e){if(_0x1abb6e['type']===_0xc0ac('0x4f')){var _0x29d77a={'id':_0x1abb6e['id'],'name':_0x1abb6e[_0xc0ac('0x44')],'strategy':_0x1abb6e[_0xc0ac('0x50')],'answered':_0x1abb6e['answered'],'available':_0x1abb6e[_0xc0ac('0x51')],'loggedIn':_0x1abb6e['loggedIn'],'pTalking':_0x1abb6e[_0xc0ac('0x52')],'sumBillable':_0x1abb6e[_0xc0ac('0x53')],'sumDuration':_0x1abb6e[_0xc0ac('0x54')],'sumHoldTime':_0x1abb6e['sumHoldTime']||0x0,'talking':_0x1abb6e['talking'],'total':_0x1abb6e[_0xc0ac('0x55')],'type':_0x1abb6e[_0xc0ac('0x56')],'unmanaged':_0x1abb6e[_0xc0ac('0x57')],'abandoned':_0x1abb6e[_0xc0ac('0x58')],'waiting':_0x1abb6e[_0xc0ac('0x59')],'loggedInDb':_0x1abb6e[_0xc0ac('0x5a')],'dialActive':_0x1abb6e[_0xc0ac('0x5b')],'dialMethod':_0x1abb6e[_0xc0ac('0x5c')],'dialOriginateCallerIdName':_0x1abb6e[_0xc0ac('0x5d')],'dialOriginateCallerIdNumber':_0x1abb6e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1abb6e[_0xc0ac('0x5e')],'dialPrefix':_0x1abb6e[_0xc0ac('0x5f')],'outboundAnswerAgiCallsDay':_0x1abb6e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1abb6e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1abb6e[_0xc0ac('0x60')],'outboundBusyCallsDay':_0x1abb6e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1abb6e['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1abb6e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1abb6e['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1abb6e[_0xc0ac('0x61')],'outboundNoAnswerCallsDay':_0x1abb6e[_0xc0ac('0x62')],'outboundNoSuchCallsDay':_0x1abb6e['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1abb6e[_0xc0ac('0x63')],'outboundReCallsDay':_0x1abb6e[_0xc0ac('0x64')],'outboundRejectCallsDay':_0x1abb6e[_0xc0ac('0x65')],'outboundUnknownCallsDay':_0x1abb6e[_0xc0ac('0x66')],'predictiveIntervalAnsweredCalls':_0x1abb6e[_0xc0ac('0x67')],'predictiveIntervalAvgHoldtime':_0x1abb6e[_0xc0ac('0x68')],'predictiveIntervalAvgTalktime':_0x1abb6e[_0xc0ac('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x1abb6e[_0xc0ac('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x1abb6e[_0xc0ac('0x6b')],'predictiveIntervalErlangCalls':_0x1abb6e[_0xc0ac('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x1abb6e[_0xc0ac('0x6d')],'predictiveIntervalHitRate':_0x1abb6e['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1abb6e[_0xc0ac('0x6e')],'predictiveIntervalPauses':_0x1abb6e[_0xc0ac('0x6f')],'predictiveIntervalAvailable':_0x1abb6e['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1abb6e[_0xc0ac('0x70')],'message':_0x1abb6e[_0xc0ac('0x42')],'originated':_0x1abb6e[_0xc0ac('0x71')],'erlangCalls':_0x1abb6e['erlangCalls'],'erlangCallToSecond':_0x1abb6e[_0xc0ac('0x72')],'erlangAbandonmentRate':_0x1abb6e[_0xc0ac('0x73')],'erlangBusyFactor':_0x1abb6e[_0xc0ac('0x74')],'startPredictive':_0x1abb6e[_0xc0ac('0x26')],'startProgressive':_0x1abb6e[_0xc0ac('0x27')]};if(_0x1abb6e[_0xc0ac('0x75')]){_0x29d77a['Trunk']={'id':_0x1abb6e[_0xc0ac('0x75')]['id'],'name':_0x1abb6e['Trunk'][_0xc0ac('0x44')],'active':_0x1abb6e[_0xc0ac('0x75')][_0xc0ac('0x76')],'callerid':_0x1abb6e[_0xc0ac('0x75')][_0xc0ac('0x77')]};}if(_0x1abb6e[_0xc0ac('0x46')]){_0x29d77a['Interval']={'id':_0x1abb6e[_0xc0ac('0x46')]['id'],'name':_0x1abb6e[_0xc0ac('0x46')][_0xc0ac('0x44')]};}var _0x408fd5=md5(JSON[_0xc0ac('0x4b')](_0x29d77a));if(_0x1abb6e[_0xc0ac('0x2')]!==_0x408fd5){_0x1abb6e['md5']=_0x408fd5;emit(util[_0xc0ac('0x78')]('voice:queue:%s',_0x29d77a[_0xc0ac('0x44')]),'voice_queue:save',_0x29d77a);}}}function emitCampaignSummary(_0x5175ae){if(_0x5175ae[_0xc0ac('0x56')]==='ivr'){emit(util[_0xc0ac('0x78')](_0xc0ac('0x79'),_0x5175ae[_0xc0ac('0x44')]),_0xc0ac('0x7a'),_0x5175ae);}}function checkGetDataPredictive(_0x2cb3d2){if(isNotNull(_0x2cb3d2)&&!_[_0xc0ac('0x47')](_0x2cb3d2)){loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x7c'));loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x7d'),_0x2cb3d2[_0xc0ac('0x70')]);loggerPredictive[_0xc0ac('0x7b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2cb3d2['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xc0ac('0x7e'),_0x2cb3d2[_0xc0ac('0x6b')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x7f'),_0x2cb3d2[_0xc0ac('0x6a')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x80'),_0x2cb3d2[_0xc0ac('0x68')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x81'),_0x2cb3d2['predictiveIntervalAvgTalktime']);loggerPredictive[_0xc0ac('0x7b')]('---------------------------');if(_0x2cb3d2[_0xc0ac('0x70')]>0x0){if(!_['isUndefined'](_0x2cb3d2['predictiveIntervalAvgTalktime'])&&_0x2cb3d2[_0xc0ac('0x69')]>0x0){return!![];}loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x82'));if(!_[_0xc0ac('0x40')](_0x2cb3d2[_0xc0ac('0x68')])&&_0x2cb3d2[_0xc0ac('0x68')]>0x0){return!![];}loggerPredictive[_0xc0ac('0x7b')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x83'));}}else{loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x84'));}return![];}function mergeDataErlangB(_0x85bb60){return function(_0x25c240){loggerPredictive[_0xc0ac('0x7b')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x85'),_0x25c240[_0xc0ac('0x86')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x87'),_0x25c240[_0xc0ac('0x72')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x88'),_0x25c240[_0xc0ac('0x73')]);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x89'),_0x25c240[_0xc0ac('0x74')]);loggerPredictive['info'](_0xc0ac('0x88'),_0x25c240['erlangAbandonmentRate']);loggerPredictive['info'](_0xc0ac('0x8a'));_[_0xc0ac('0x8b')](_0x85bb60,_0x25c240);};}function getDiff(_0x3827d7){var _0x300ed9=moment()[_0xc0ac('0x4c')](0x0);var _0xd20706=moment(_0x3827d7)[_0xc0ac('0x4c')](0x0);return _0x300ed9[_0xc0ac('0x4d')](_0xd20706,_0xc0ac('0x4e'));}function ifInterval(_0x399f1a,_0x21a760){if(_[_0xc0ac('0x40')](_0x21a760)){return![];}return getDiff(_0x21a760)<_0x399f1a*0x3c;}function freeVariablesPredictive(_0x5d4eec){if(isNotNull(_0x5d4eec)){if(!_['isUndefined'](_0x5d4eec[_0xc0ac('0x27')])){_0x5d4eec[_0xc0ac('0x27')]=undefined;loggerPredictive[_0xc0ac('0x7b')](_0x5d4eec[_0xc0ac('0x44')],_0xc0ac('0x8c'));}if(!_[_0xc0ac('0x40')](_0x5d4eec[_0xc0ac('0x26')])){_0x5d4eec[_0xc0ac('0x26')]=undefined;loggerPredictive['info'](_0x5d4eec[_0xc0ac('0x44')],_0xc0ac('0x8d'));}if(!_[_0xc0ac('0x40')](_0x5d4eec['handlePredictive'])){clearInterval(_0x5d4eec[_0xc0ac('0x8e')]);_0x5d4eec[_0xc0ac('0x8e')]=undefined;loggerPredictive['info'](_0x5d4eec[_0xc0ac('0x44')],_0xc0ac('0x8f'));}}}function erlangb(_0x2cd446,_0x2fc7c7){if(_0x2fc7c7===0x0){return 0x0;}var _0x8aaba2=0x1;for(var _0x3f606c=0x1;_0x3f606c<=_0x2fc7c7;_0x3f606c+=0x1){_0x8aaba2=0x1+_0x8aaba2*_0x3f606c/_0x2cd446;}return 0x1/_0x8aaba2;}function isVoiceQueueOutbound(_0x47ee54){return _0x47ee54==='outbound';}function isNotPreview(_0x1c26e1){return _0x1c26e1!==_0xc0ac('0x1b');}function isCampaignIvr(_0x5ea3f0){return _0x5ea3f0===_0xc0ac('0x90');}function getCallerId(_0x4fdb39,_0x4afaeb,_0x3f78cb){if(!_['isUndefined'](_0x3f78cb)&&typeof _0x3f78cb===_0xc0ac('0x91')&&!_[_0xc0ac('0x47')](_0x3f78cb)){if(!_[_0xc0ac('0x40')](_0x4afaeb)&&typeof _0x4afaeb===_0xc0ac('0x91')&&!_['isEmpty'](_0x4afaeb)){return util[_0xc0ac('0x78')]('\x22%s\x22\x20<%s>',_0x4afaeb,_0x3f78cb);}return util[_0xc0ac('0x78')](_0xc0ac('0x92'),_0x3f78cb,_0x3f78cb);}if(!_[_0xc0ac('0x40')](_0x4fdb39)&&typeof _0x4fdb39===_0xc0ac('0x91')&&!_['isEmpty'](_0x4fdb39)){return _0x4fdb39;}return _0xc0ac('0x93');}function loggerCatchQueueSummary(_0x2db312,_0x1dc6a4){return function(_0x595a7c){freeVariablesPredictive(_0x1dc6a4);emitVoiceQueueSummary(_0x1dc6a4);emitCampaignSummary(_0x1dc6a4);loggerSyncQueueSummary['error'](_0x2db312,util[_0xc0ac('0x94')](_0x595a7c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x460328,_0x2d4c7f){return function(_0x4158e0){loggerPredictive[_0xc0ac('0x95')](_0x2d4c7f[_0xc0ac('0x44')],_0x460328);loggerPredictive[_0xc0ac('0x95')](_0x4158e0['stack']);freeVariablesPredictive(_0x2d4c7f);};}function loggerCatch(_0x188bb0){return function(_0x301b09){logger['error'](_0x188bb0,util[_0xc0ac('0x94')](_0x301b09,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x911699){return _0x911699&&!_[_0xc0ac('0x40')](_0x911699)&&_0x911699[_0xc0ac('0x96')]>0x0;}function decremetOriginate(_0x354f32){if(!_[_0xc0ac('0x40')](_0x354f32)&&_0x354f32!==null){if(typeof _0x354f32['originated']!==_0xc0ac('0x97')){if(_0x354f32[_0xc0ac('0x71')]>0x0){_0x354f32[_0xc0ac('0x71')]-=0x1;}else{logger['error'](_0xc0ac('0x98'));}}}else{logger[_0xc0ac('0x95')](_0xc0ac('0x99'));}}function checkContactLowerLimitOriginate(_0x47db69,_0x4e82a1,_0x1bbc3c){if(_0x4e82a1>_0x1bbc3c){for(var _0x367eee=0x0;_0x367eee<_0x4e82a1-_0x1bbc3c;_0x367eee+=0x1){decremetOriginate(_0x47db69);}}}function loggerGetContactDialer(_0x4ef6ff,_0x49d2cd,_0x199297){return function(_0xa04e11){checkContactLowerLimitOriginate(_0x49d2cd,_0x199297,0x0);logger['error'](_0x4ef6ff,util[_0xc0ac('0x94')](_0xa04e11,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5afff7){return function(_0x1221e5){if(isNotNull(_0x1221e5)&&isNotNull(_0x1221e5[0x0])){if(_0x1221e5[0x0][_0xc0ac('0x9a')]>0x0){_0x5afff7[_0xc0ac('0x42')]=_0xc0ac('0x9b');logger[_0xc0ac('0x7b')]('[getContactDialer2][ReScheduled]'+_0x5afff7['name'],_0x1221e5[0x0][_0xc0ac('0x9a')],_0xc0ac('0x9c'));}else{_0x5afff7['message']=_0xc0ac('0x9d');logger[_0xc0ac('0x7b')](_0xc0ac('0x9e')+_0x5afff7['name']);}}};}function notSendMessagesQueue(_0xd3a081){if(_0xd3a081[_0xc0ac('0x9f')]){freeVariablesPredictive(_0xd3a081);if(_0xd3a081['originated']===0x0&&_0xd3a081[_0xc0ac('0xa0')]===0x0&&_0xd3a081[_0xc0ac('0x59')]===0x0&&(_0xd3a081['pTalking']||0x0)===0x0){_0xd3a081[_0xc0ac('0x9f')]=![];_0xd3a081[_0xc0ac('0x51')]=0x0;_0xd3a081['message']=_0xc0ac('0xa1');loggerSyncQueueSummary[_0xc0ac('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xd3a081[_0xc0ac('0x44')],_0xc0ac('0xa2'));}else{_0xd3a081['message']=_0xc0ac('0xa3');loggerSyncQueueSummary[_0xc0ac('0x95')](_0xc0ac('0xa4'),_0xd3a081[_0xc0ac('0x44')],_0xc0ac('0xa5'));}emitVoiceQueueSummary(_0xd3a081);}}function notSendMessagesCampaign(_0x4a934b){if(_0x4a934b[_0xc0ac('0x9f')]){if(_0x4a934b[_0xc0ac('0x71')]===0x0){_0x4a934b[_0xc0ac('0x9f')]=![];_0x4a934b[_0xc0ac('0x42')]=_0xc0ac('0xa1');loggerSyncQueueSummary[_0xc0ac('0x95')](_0xc0ac('0xa6'),_0x4a934b['name'],'is\x20not\x20active');}else{_0x4a934b[_0xc0ac('0x42')]=_0xc0ac('0xa3');loggerSyncQueueSummary[_0xc0ac('0x95')](_0xc0ac('0xa6'),_0x4a934b[_0xc0ac('0x44')],_0xc0ac('0xa5'));}emitCampaignSummary(_0x4a934b);}}function createObjHistory(_0x5f3311,_0x2f6833,_0x4b3e03,_0x3d641c,_0x499285){_0x5f3311['message']=_0x4b3e03;var _0x56961a=new Action(_0x5f3311,_0x2f6833);var _0x405612=new History(_0x56961a);_0x405612[_0xc0ac('0xa7')]=_0x3d641c;_0x405612[_0xc0ac('0xa8')]=_0x499285;_0x405612[_0xc0ac('0xa9')]=_0x56961a[_0xc0ac('0xaa')];return _0x405612;}Dialer['prototype'][_0xc0ac('0x3c')]=function(){var _0x5da57a=this;setInterval(function(){_0x5da57a[_0xc0ac('0xab')](_0x5da57a[_0xc0ac('0x24')],_0xc0ac('0xac'));_0x5da57a['clearZombieChannels'](_0x5da57a[_0xc0ac('0x22')],_0xc0ac('0xad'));},0x32c8);};Dialer['prototype'][_0xc0ac('0xab')]=function(_0x30c165,_0x46c7f0){var _0x1d5e03=this;for(var _0x5f4228 in _0x30c165){if(typeof _0x30c165[_0x5f4228]!=='undefined'){this[_0xc0ac('0xae')][_0xc0ac('0x18')](function(){if(!_[_0xc0ac('0xaf')](_0x30c165[_0x5f4228])){return ami[_0xc0ac('0xb0')]({'action':_0xc0ac('0xb1'),'channel':_0x30c165[_0x5f4228]['channel']})['catch'](function(_0x25d770){if(_0x25d770[_0xc0ac('0x42')]===_0xc0ac('0xb2')){setTimeout(function(){if(_0x30c165[_0x5f4228]&&_0x30c165[_0x5f4228][_0xc0ac('0x56')]!==_0xc0ac('0x90')){_0x1d5e03[_0xc0ac('0xb3')](_0x1d5e03[_0xc0ac('0x1c')][_0x30c165[_0x5f4228][_0xc0ac('0xb4')]]);logger[_0xc0ac('0x95')](_0xc0ac('0xb5'),_0x46c7f0,_0x5f4228,_0x30c165[_0x5f4228][_0xc0ac('0xb4')]);delete _0x30c165[_0x5f4228];}if(_0x30c165[_0x5f4228]&&_0x30c165[_0x5f4228][_0xc0ac('0x56')]===_0xc0ac('0x90')){_0x1d5e03[_0xc0ac('0xb3')](_0x1d5e03[_0xc0ac('0x1d')][_0x30c165[_0x5f4228]['queue']]);logger[_0xc0ac('0x95')](_0xc0ac('0xb6'),_0x46c7f0,_0x5f4228,_0x30c165[_0x5f4228][_0xc0ac('0xb4')]);delete _0x30c165[_0x5f4228];}},0x2328);}});}});}}};Dialer[_0xc0ac('0xb7')]['countReScheduled']=function(_0x482fbb){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xb9')](_0x482fbb))[_0xc0ac('0xba')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xbb')]=function(_0x4bbc7e){return BPromise[_0xc0ac('0xb8')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4bbc7e))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xbc')));};Dialer[_0xc0ac('0xb7')]['checkIsBlackListIvr']=function(_0x1fd49b){return BPromise[_0xc0ac('0xb8')]()['then'](cmHopperBlack[_0xc0ac('0xbd')](_0x1fd49b))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xbe')));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xbf')]=function(_0xd8a167){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopperHistory[_0xc0ac('0xc0')](_0xd8a167))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xc1')]=function(_0x304b18){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xc1')](_0x304b18))[_0xc0ac('0xba')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xc2')]=function(_0x1e59da,_0x45db59,_0x251eb0){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xc2')](_0x1e59da,_0x45db59,_0x251eb0))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xc3')));};Dialer['prototype'][_0xc0ac('0xc4')]=function(_0x1cda93,_0x459011,_0x133e8a,_0x476bf1,_0x28dcf5){return BPromise['resolve']()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xc4')](_0x1cda93,_0x459011,_0x133e8a,_0x476bf1))[_0xc0ac('0xba')](function(_0x154e6c){_0x28dcf5[_0xc0ac('0xc5')]-=_0x133e8a;_0x28dcf5[_0xc0ac('0xc5')]=_0x28dcf5[_0xc0ac('0xc5')]>0x0?_0x28dcf5[_0xc0ac('0xc5')]:0x0;loggerCatch(_0xc0ac('0xc6'))(_0x154e6c);});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xc7')]=function(_0x2beb18,_0x2f2821,_0x1e3b6e,_0x40e29f){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xc7')](_0x2beb18,_0x2f2821,_0x1e3b6e))[_0xc0ac('0xba')](function(_0x27641e){_0x40e29f[_0xc0ac('0xc5')]-=_0x2f2821;_0x40e29f[_0xc0ac('0xc5')]=_0x40e29f['temp']>0x0?_0x40e29f[_0xc0ac('0xc5')]:0x0;loggerCatch(_0xc0ac('0xc8'))(_0x27641e);});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xc9')]=function(_0x4250b0){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](voiceQueueRt[_0xc0ac('0xc9')](_0x4250b0))['catch'](loggerCatch(_0xc0ac('0xca')));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xcb')]=function(_0x185f08){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0xcb')](_0x185f08))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xcc')));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xcd')]=function(_0x3d1020){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopperHistory[_0xc0ac('0xcd')](_0x3d1020))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xce')));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xb3')]=function(_0x1960e7){if(!_[_0xc0ac('0x40')](_0x1960e7)&&_0x1960e7!==null){if(typeof _0x1960e7[_0xc0ac('0x71')]!==_0xc0ac('0x97')){if(_0x1960e7[_0xc0ac('0x71')]>0x0){_0x1960e7[_0xc0ac('0x71')]-=0x1;}else{logger[_0xc0ac('0x95')](_0xc0ac('0xcf'));}}}else{logger['error'](_0xc0ac('0xd0'));}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xd1')]=function(_0x32cddd,_0x28b980){var _0x5aaf23=this;return function(_0x510f86){_0x5aaf23[_0xc0ac('0xb3')](_0x28b980);logger['error'](_0x32cddd,util[_0xc0ac('0x94')](_0x510f86,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x33480a,_0x103877,_0x4f8208){var _0x45db08={'state':0x19,'statedesc':_0xc0ac('0xd2')};this['updateOriginated'](_0x103877);this[_0xc0ac('0xd3')](_[_0xc0ac('0x8b')](_0x45db08,_['pick'](_0x4f8208,[_0xc0ac('0xd4'),_0xc0ac('0xd5'),_0xc0ac('0xd6'),_0xc0ac('0xd7'),_0xc0ac('0xd8')])),_0xc0ac('0xd9'),_0xc0ac('0xda'));logger[_0xc0ac('0x95')](_0x33480a);};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xdb')]=function(_0x14971d){return _0x14971d===_0xc0ac('0xdc');};Dialer['prototype'][_0xc0ac('0xdd')]=function(_0x3fe1be){return!_[_0xc0ac('0x40')](_0x3fe1be)&&_0x3fe1be&&!_[_0xc0ac('0x40')](_0x3fe1be['name'])&&!_[_0xc0ac('0x40')](_0x3fe1be[_0xc0ac('0x76')])&&_0x3fe1be[_0xc0ac('0x76')]&&(this['trunks'][util['format']('SIP/%s',_0x3fe1be['name'])]['status']===_0xc0ac('0xde')||this['trunks'][util['format'](_0xc0ac('0xdf'),_0x3fe1be[_0xc0ac('0x44')])][_0xc0ac('0xb1')]===_0xc0ac('0xe0'));};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xd3')]=function(_0x4d9765,_0x4764a2,_0x2ba192){this[_0xc0ac('0xcd')](_0x4d9765)[_0xc0ac('0xba')](loggerCatch(_0x4764a2));this['moveContactManagedDialer'](_0x4d9765)[_0xc0ac('0xba')](loggerCatch(_0x2ba192));};Dialer['prototype'][_0xc0ac('0x36')]=function(_0x437805){var _0xad4c2f=this[_0xc0ac('0x24')][_0x437805[_0xc0ac('0xe1')]];var _0x4e9197;if(!_['isNil'](_0x437805)&&!_[_0xc0ac('0xaf')](_0x437805[_0xc0ac('0xe2')])&&!_[_0xc0ac('0xaf')](_0x437805['variable']['amdstatus'])&&_0x437805['exten']===_0xc0ac('0xe3')&&_0xad4c2f){if(_0xad4c2f[_0xc0ac('0x56')]!==_0xc0ac('0x90')&&this[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]][_0xc0ac('0xe4')]&&_0x437805[_0xc0ac('0xe5')]===_0xc0ac('0xe6')){delete this['uniqueId'][_0x437805[_0xc0ac('0xe1')]];this['updateOriginated'](this[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]]);this[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]][_0xc0ac('0xe7')]+=0x1;this[_0xc0ac('0x1c')][_0xad4c2f['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4e9197=new Hangup(_0xad4c2f,_0x437805);_0x4e9197[_0xc0ac('0xa7')]=0x12;_0x4e9197[_0xc0ac('0xa8')]='HangupInAMD';_0x4e9197[_0xc0ac('0xe8')]='AMD';ami['emit'](_0xc0ac('0xe9'),ut[_0xc0ac('0xea')](_0x4e9197,_0xc0ac('0xeb')));this[_0xc0ac('0xd3')](_0x4e9197,_0xc0ac('0xec'),'[syncHangupInAMD]');}if(_0xad4c2f[_0xc0ac('0x56')]!==_0xc0ac('0x90')&&this[_0xc0ac('0x1c')][_0xad4c2f['queue']]['dialAMDActive']&&_0x437805['value']===_0xc0ac('0xed')){var _0x4a21fd=this;return new BPromise(function(_0x4f71b9,_0x3ef0ad){delete _0x4a21fd[_0xc0ac('0x24')][_0x437805[_0xc0ac('0xe1')]];_0x4a21fd['updateOriginated'](_0x4a21fd[_0xc0ac('0x1c')][_0xad4c2f['queue']]);_0x4a21fd[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x4a21fd[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x291bcc=_0x4a21fd[_0xc0ac('0x1c')][_0xad4c2f[_0xc0ac('0xb4')]];var _0x21ecf0=new Hangup(_0xad4c2f,_0x437805);_0x21ecf0[_0xc0ac('0xa7')]=0x13;_0x21ecf0[_0xc0ac('0xa8')]=_0xc0ac('0xee');_0x21ecf0[_0xc0ac('0xe8')]=_0xc0ac('0xef');_0x21ecf0[_0xc0ac('0xf0')]+=0x1;_0x21ecf0[_0xc0ac('0xf1')]+=0x1;_0x21ecf0[_0xc0ac('0xeb')]=!![];ami['emit'](_0xc0ac('0xe9'),ut[_0xc0ac('0xea')](_0x21ecf0,_0xc0ac('0xeb')));_0x4a21fd[_0xc0ac('0xcd')](_0x21ecf0)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xf2')));if(_0x21ecf0[_0xc0ac('0xf3')]+_0x21ecf0[_0xc0ac('0xf4')]+_0x21ecf0[_0xc0ac('0xf5')]+_0x21ecf0[_0xc0ac('0xf6')]+_0x21ecf0['countdropretry']+_0x21ecf0[_0xc0ac('0xf7')]+_0x21ecf0['countmachineretry']+_0x21ecf0[_0xc0ac('0xf8')]>=_0x291bcc[_0xc0ac('0xf9')]){_0x4a21fd[_0xc0ac('0xfa')](_0x21ecf0,_0x4f71b9,_0x3ef0ad,'reason19\x20machine....');}else{if(_0x21ecf0[_0xc0ac('0xf0')]>=_0x291bcc['dialMachineMaxRetry']){_0x4a21fd[_0xc0ac('0xfb')](_0x21ecf0,_0x4f71b9,_0x3ef0ad,'reason\x2019\x20machine....');}else{_0x4a21fd[_0xc0ac('0xc1')]({'active':![],'countmachineretry':_0x21ecf0[_0xc0ac('0xf0')],'scheduledat':moment()[_0xc0ac('0xfc')](_0x291bcc['dialMachineRetryFrequency'],'minutes')['format'](_0xc0ac('0xfd')),'ContactId':_0x21ecf0['ContactId'],'ListId':_0x21ecf0[_0xc0ac('0xd5')],'VoiceQueueId':_0x21ecf0[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x21ecf0['CampaignId']||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xfe')));_0x4f71b9({'reschedule':0x1});}}});}if(_0xad4c2f[_0xc0ac('0x56')]===_0xc0ac('0x90')&&this['campaigns'][_0xad4c2f[_0xc0ac('0xb4')]]['dialAMDActive']&&_0x437805[_0xc0ac('0xe5')]==='HANGUP'){delete this[_0xc0ac('0x24')][_0x437805[_0xc0ac('0xe1')]];this['updateOriginated'](this[_0xc0ac('0x1d')][_0xad4c2f['queue']]);_0x4e9197=new Hangup(_0xad4c2f,_0x437805);_0x4e9197[_0xc0ac('0xa7')]=0x12;_0x4e9197['statedesc']=_0xc0ac('0xff');_0x4e9197[_0xc0ac('0xe8')]=_0xc0ac('0xef');ami['emit'](_0xc0ac('0xe9'),ut['buildObj'](_0x4e9197,_0xc0ac('0xeb')));this[_0xc0ac('0xd3')](_0x4e9197,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0xad4c2f[_0xc0ac('0x56')]==='ivr'&&this[_0xc0ac('0x1d')][_0xad4c2f['queue']][_0xc0ac('0xe4')]&&_0x437805[_0xc0ac('0xe5')]===_0xc0ac('0xed')){var _0x4a21fd=this;return new BPromise(function(_0x66d958,_0xe3eb56){delete _0x4a21fd[_0xc0ac('0x24')][_0x437805[_0xc0ac('0xe1')]];_0x4a21fd['updateOriginated'](_0x4a21fd[_0xc0ac('0x1d')][_0xad4c2f[_0xc0ac('0xb4')]]);_0x4a21fd['campaigns'][_0xad4c2f[_0xc0ac('0xb4')]][_0xc0ac('0xe7')]+=0x1;_0x4a21fd[_0xc0ac('0x1d')][_0xad4c2f['queue']][_0xc0ac('0x100')]+=0x1;var _0x387947=_0x4a21fd[_0xc0ac('0x1d')][_0xad4c2f['queue']];var _0x51c1df=new Hangup(_0xad4c2f,_0x437805);_0x51c1df['state']=0x13;_0x51c1df['statedesc']=_0xc0ac('0xee');_0x51c1df[_0xc0ac('0xe8')]=_0xc0ac('0xef');_0x51c1df['countmachineretry']+=0x1;_0x51c1df[_0xc0ac('0xf1')]+=0x1;_0x51c1df['amd']=!![];ami[_0xc0ac('0x101')]('custom:amd',ut[_0xc0ac('0xea')](_0x51c1df,_0xc0ac('0xeb')));_0x4a21fd['createHistory'](_0x51c1df)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xf2')));if(_0x51c1df[_0xc0ac('0xf3')]+_0x51c1df[_0xc0ac('0xf4')]+_0x51c1df[_0xc0ac('0xf5')]+_0x51c1df[_0xc0ac('0xf6')]+_0x51c1df[_0xc0ac('0x102')]+_0x51c1df[_0xc0ac('0xf7')]+_0x51c1df[_0xc0ac('0xf0')]+_0x51c1df[_0xc0ac('0xf8')]>=_0x387947[_0xc0ac('0xf9')]){_0x4a21fd[_0xc0ac('0xfa')](_0x51c1df,_0x66d958,_0xe3eb56,_0xc0ac('0x103'));}else{if(_0x51c1df[_0xc0ac('0xf0')]>=_0x387947[_0xc0ac('0x104')]){_0x4a21fd[_0xc0ac('0xfb')](_0x51c1df,_0x66d958,_0xe3eb56,'reason\x2019\x20machine....');}else{_0x4a21fd[_0xc0ac('0xc1')]({'active':![],'countmachineretry':_0x51c1df['countmachineretry'],'scheduledat':moment()[_0xc0ac('0xfc')](_0x387947[_0xc0ac('0x105')],_0xc0ac('0x106'))[_0xc0ac('0x78')](_0xc0ac('0xfd')),'ContactId':_0x51c1df[_0xc0ac('0xd4')],'ListId':_0x51c1df[_0xc0ac('0xd5')],'VoiceQueueId':_0x51c1df[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x51c1df[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch('[rescheduleContact][Machine]'));_0x66d958({'reschedule':0x1});}}});}}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x33')]=function(_0x3b7165){var _0x7b2e1=this['uniqueId'][_0x3b7165[_0xc0ac('0xe1')]];var _0x10f165=this;var _0x3b36ce;if(_0x7b2e1&&_0x7b2e1[_0xc0ac('0x56')]==='ivr'){delete this['uniqueId'][_0x3b7165[_0xc0ac('0xe1')]];this['updateOriginated'](this['campaigns'][_0x7b2e1[_0xc0ac('0xb4')]]);this[_0xc0ac('0x1d')][_0x7b2e1[_0xc0ac('0xb4')]][_0xc0ac('0x107')]+=0x1;_0x3b36ce=new Hangup(_0x7b2e1,_0x3b7165);this[_0xc0ac('0xcd')](_0x3b36ce)[_0xc0ac('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3b36ce)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x108')));}if(_0x7b2e1&&_0x7b2e1[_0xc0ac('0x56')]!=='ivr'&&isNotNull(this[_0xc0ac('0x1c')][_0x7b2e1[_0xc0ac('0xb4')]]['dialQueueProject'])){delete this[_0xc0ac('0x24')][_0x3b7165[_0xc0ac('0xe1')]];this['updateOriginated'](this[_0xc0ac('0x1c')][_0x7b2e1[_0xc0ac('0xb4')]]);this[_0xc0ac('0x1c')][_0x7b2e1[_0xc0ac('0xb4')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x7b2e1['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3b36ce=new Hangup(_0x7b2e1,_0x3b7165);_0x3b36ce[_0xc0ac('0xa7')]=0x10;_0x3b36ce[_0xc0ac('0xa8')]=_0xc0ac('0x109');_0x3b36ce['membername']=_0xc0ac('0x10a');this['createHistory'](_0x3b36ce)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x10b')));this['moveContactManagedDialer'](_0x3b36ce)['catch'](loggerCatch(_0xc0ac('0x108')));}if(_0x7b2e1&&_0x7b2e1[_0xc0ac('0x56')]!==_0xc0ac('0x90')&&!isNotNull(this[_0xc0ac('0x1c')][_0x7b2e1[_0xc0ac('0xb4')]]['dialQueueProject'])){delete this['uniqueId'][_0x3b7165[_0xc0ac('0xe1')]];this[_0xc0ac('0xb3')](this[_0xc0ac('0x1c')][_0x7b2e1[_0xc0ac('0xb4')]]);this['voiceQueues'][_0x7b2e1[_0xc0ac('0xb4')]][_0xc0ac('0x66')]+=0x1;_0x3b36ce=new Hangup(_0x7b2e1,_0x3b7165);_0x3b36ce[_0xc0ac('0xa7')]=0xc;_0x3b36ce[_0xc0ac('0xa8')]=_0x3b7165[_0xc0ac('0x10c')];_0x3b36ce[_0xc0ac('0xe8')]=_0xc0ac('0x10d');this['createHistory'](_0x3b36ce)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc0ac('0xcb')](_0x3b36ce)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x108')));}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x30')]=function(_0x21beed){var _0x23540f=this[_0xc0ac('0x24')][_0x21beed[_0xc0ac('0xe1')]];var _0x3f2898=this;if(this[_0xc0ac('0x1c')][_0x21beed[_0xc0ac('0xb4')]]){if(_0x23540f&&_0x23540f['type']!==_0xc0ac('0x90')){delete this[_0xc0ac('0x24')][_0x21beed['uniqueid']];this[_0xc0ac('0x1c')][_0x21beed['queue']]['outboundAnswerCallsDay']+=0x1;var _0x152c6a=new AgentComplete(_0x23540f,_0x21beed);if(_0x21beed[_0xc0ac('0x10e')]===_0xc0ac('0x10f')){_0x152c6a[_0xc0ac('0x110')]=this[_0xc0ac('0x1c')][_0x21beed[_0xc0ac('0xb4')]][_0xc0ac('0x111')]&&this[_0xc0ac('0x1c')][_0x21beed[_0xc0ac('0xb4')]]['dialAgiAfterHangupAgent']?moment()[_0xc0ac('0x78')](_0xc0ac('0xfd')):undefined;}this['createHistory'](_0x152c6a)['catch'](loggerCatch(_0xc0ac('0x112')));this[_0xc0ac('0xcb')](_0x152c6a)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x113')));}}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x2b')]=function(_0x5a3b52){if(this['voiceQueues'][_0x5a3b52[_0xc0ac('0xb4')]]){if(this[_0xc0ac('0x24')][_0x5a3b52['uniqueid']]&&this[_0xc0ac('0x24')][_0x5a3b52[_0xc0ac('0xe1')]][_0xc0ac('0x56')]!==_0xc0ac('0x90')){this[_0xc0ac('0xb3')](this[_0xc0ac('0x1c')][_0x5a3b52[_0xc0ac('0xb4')]]);this['uniqueId'][_0x5a3b52[_0xc0ac('0xe1')]][_0xc0ac('0x114')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));}}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x115')]=function(_0x3c3a4b){this[_0xc0ac('0xcd')](_0x3c3a4b)[_0xc0ac('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xc0ac('0xcb')](_0x3c3a4b)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x116')));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x44a3cf){var _0x15707e=this[_0xc0ac('0x24')][_0x44a3cf[_0xc0ac('0xe1')]];var _0xd91a36=this;if(this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]]){if(_0x15707e&&_0x15707e['type']!==_0xc0ac('0x90')){delete this[_0xc0ac('0x24')][_0x44a3cf[_0xc0ac('0xe1')]];this[_0xc0ac('0xb3')](this[_0xc0ac('0x1c')][_0x44a3cf['queue']]);_0x15707e[_0xc0ac('0x117')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));var _0x3303bf=new QueueCallerAbandon(_0x15707e,_0x44a3cf);if(getSeconds(_0x15707e['droptime'],_0x15707e['responsetime'])>=_0x15707e[_0xc0ac('0x118')]){this['voiceQueues'][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x6b')]+=0x1;this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x61')]+=0x1;this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x6d')]+=0x1;_0x3303bf[_0xc0ac('0xa7')]=0xa;_0x3303bf['statedesc']=_0xc0ac('0x119');_0x3303bf[_0xc0ac('0x11a')]='TIMEOUT';_0x3303bf[_0xc0ac('0x110')]=this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x111')]?moment()[_0xc0ac('0x78')](_0xc0ac('0xfd')):undefined;_0x3303bf['countdropretry']+=0x1;_0x3303bf[_0xc0ac('0xf1')]+=0x1;if(_0x3303bf['countdropretry']>=this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x11b')]){this[_0xc0ac('0x115')](_0x3303bf);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3303bf[_0xc0ac('0x102')],'scheduledat':moment()[_0xc0ac('0xfc')](this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x11c')],_0xc0ac('0x106'))[_0xc0ac('0x78')](_0xc0ac('0xfd')),'ContactId':_0x15707e['ContactId'],'ListId':_0x15707e[_0xc0ac('0xd5')],'VoiceQueueId':_0x15707e['VoiceQueueId']||undefined,'CampaignId':_0x15707e[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x11d')));var _0x3156b1=new History(_0x3303bf);_0x3156b1['state']=0xa;_0x3156b1['statedesc']='Drop';_0x3156b1[_0xc0ac('0xaa')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));_0x3156b1[_0xc0ac('0xa9')]=_0x3156b1[_0xc0ac('0xaa')];_0x3156b1[_0xc0ac('0x11e')]=_0x3303bf[_0xc0ac('0x11e')];_0x3156b1[_0xc0ac('0x11f')]=_0x3303bf[_0xc0ac('0x11f')];this[_0xc0ac('0xcd')](_0x3156b1)['catch'](loggerCatch(_0xc0ac('0x120')));}}else{this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x6a')]+=0x1;this[_0xc0ac('0x1c')][_0x44a3cf['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x3303bf['state']=0xb;_0x3303bf[_0xc0ac('0xa8')]='Abandoned';_0x3303bf[_0xc0ac('0x11a')]='CALLEREXIT';_0x3303bf[_0xc0ac('0xf7')]+=0x1;_0x3303bf[_0xc0ac('0xf1')]+=0x1;if(_0x3303bf[_0xc0ac('0xf7')]>=this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x121')]){this[_0xc0ac('0x115')](_0x3303bf);}else{this[_0xc0ac('0xc1')]({'active':![],'countabandonedretry':_0x3303bf[_0xc0ac('0xf7')],'scheduledat':moment()['add'](this[_0xc0ac('0x1c')][_0x44a3cf[_0xc0ac('0xb4')]][_0xc0ac('0x122')],_0xc0ac('0x106'))[_0xc0ac('0x78')](_0xc0ac('0xfd')),'ContactId':_0x15707e[_0xc0ac('0xd4')],'ListId':_0x15707e[_0xc0ac('0xd5')],'VoiceQueueId':_0x15707e['VoiceQueueId']||undefined,'CampaignId':_0x15707e[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x123')));var _0x3156b1=new History(_0x3303bf);_0x3156b1['state']=0xb;_0x3156b1[_0xc0ac('0xa8')]=_0xc0ac('0x124');_0x3156b1['starttime']=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));_0x3156b1[_0xc0ac('0xa9')]=_0x3156b1[_0xc0ac('0xaa')];_0x3156b1[_0xc0ac('0x11e')]=_0x3303bf[_0xc0ac('0x11e')];_0x3156b1['calleridnum']=_0x3303bf[_0xc0ac('0x11f')];this[_0xc0ac('0xcd')](_0x3156b1)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x125')]=function(_0x563aad){if(this[_0xc0ac('0x22')][_0x563aad[_0xc0ac('0xe1')]]){this[_0xc0ac('0x22')][_0x563aad[_0xc0ac('0xe1')]][_0xc0ac('0x126')]=_0x563aad['channel'];}if(this['uniqueId'][_0x563aad['uniqueid']]){this[_0xc0ac('0x24')][_0x563aad[_0xc0ac('0xe1')]][_0xc0ac('0x126')]=_0x563aad[_0xc0ac('0x126')];}};Dialer[_0xc0ac('0xb7')]['syncQueueMember']=function(_0x44aeb6){if(strategy[this[_0xc0ac('0x1c')][this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]]['queue']][_0xc0ac('0x50')]]===_0xc0ac('0x17')){if(this[_0xc0ac('0x22')][_0x44aeb6['actionid']]&&_['isNil'](this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]][_0xc0ac('0x128')])&&_0x44aeb6[_0xc0ac('0xb1')]==='1'&&_0x44aeb6['paused']==='0'){if(this[_0xc0ac('0x1e')][_0x44aeb6[_0xc0ac('0x129')]]){if(!this[_0xc0ac('0x1e')][_0x44aeb6[_0xc0ac('0x129')]][_0xc0ac('0x128')]){this['agents'][_0x44aeb6[_0xc0ac('0x129')]][_0xc0ac('0x128')]=!![];this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]][_0xc0ac('0x128')]=!![];this[_0xc0ac('0x22')][_0x44aeb6['actionid']]['stateinterface']=_0x44aeb6[_0xc0ac('0x129')];}}}}else if((strategy[this[_0xc0ac('0x1c')][this['actions'][_0x44aeb6['actionid']][_0xc0ac('0xb4')]]['strategy']]||_0xc0ac('0x16'))===_0xc0ac('0x16')){if(this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]]){if(this[_0xc0ac('0x1e')][_0x44aeb6['stateinterface']]){this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]][_0xc0ac('0x129')]=_0x44aeb6[_0xc0ac('0x129')];if(_['isNil'](this[_0xc0ac('0x29')][this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]]['queue']])){this['queueBooked'][this['actions'][_0x44aeb6[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]=[];}this['queueBooked'][this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]][_0xc0ac('0xb4')]][_0xc0ac('0x12a')](_[_0xc0ac('0x8b')](_['pick'](this[_0xc0ac('0x22')][_0x44aeb6[_0xc0ac('0x127')]],[_0xc0ac('0x12b'),'stateinterface']),{'status':_0x44aeb6[_0xc0ac('0xb1')],'paused':_0x44aeb6['paused']}));}}}};function unlockQueueStatus(_0x231fc1,_0x2c23c8){setTimeout(function(){if(_[_0xc0ac('0x40')](_0x231fc1[_0xc0ac('0x12c')])){loggerBooked[_0xc0ac('0x95')](_0xc0ac('0x12d'),_0x2c23c8);}_0x231fc1[_0xc0ac('0x12c')]=!![];loggerBooked[_0xc0ac('0x7b')](_0xc0ac('0x12e'),_0x2c23c8,JSON['stringify'](_[_0xc0ac('0x12f')](_0x231fc1,[_0xc0ac('0x44'),_0xc0ac('0x12c')])));},0x1f3);}Dialer[_0xc0ac('0xb7')][_0xc0ac('0x3a')]=function(_0x588f11){var _0x2ea552=this;var _0x5c07d2=_0x2ea552[_0xc0ac('0x1c')][_0x2ea552[_0xc0ac('0x22')][_0x588f11['actionid']][_0xc0ac('0xb4')]];if(strategy[this[_0xc0ac('0x1c')][this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]][_0xc0ac('0x50')]]==='roundrobin'){if(this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]]&&this['actions'][_0x588f11[_0xc0ac('0x127')]]['stateinterface']){this[_0xc0ac('0x1b')][_0xc0ac('0x130')](this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0x12b')],this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0x129')])['catch'](function(_0x18ea5e){logger[_0xc0ac('0x95')](_0xc0ac('0x131'),util[_0xc0ac('0x94')](_0x18ea5e,{'showHidden':![],'depth':null}));})[_0xc0ac('0x1a')](function(){_0x2ea552[_0xc0ac('0xb3')](_0x2ea552[_0xc0ac('0x1c')][_0x2ea552[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]);_0x2ea552[_0xc0ac('0x1e')][_0x2ea552[_0xc0ac('0x22')][_0x588f11['actionid']][_0xc0ac('0x129')]]['locked']=![];delete _0x2ea552[_0xc0ac('0x22')][_0x588f11['actionid']];unlockQueueStatus(_0x5c07d2);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]);this[_0xc0ac('0xc1')]({'active':![],'ContactId':this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xd4')],'ListId':this['actions'][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xd5')],'VoiceQueueId':this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc0ac('0x22')][_0x588f11['actionid']];unlockQueueStatus(_0x5c07d2);}}else if((strategy[this[_0xc0ac('0x1c')][this['actions'][_0x588f11[_0xc0ac('0x127')]]['queue']][_0xc0ac('0x50')]]||_0xc0ac('0x16'))===_0xc0ac('0x16')){var _0x54d52d;if(this['actions'][_0x588f11[_0xc0ac('0x127')]]&&!_['isEmpty'](this[_0xc0ac('0x29')][this['actions'][_0x588f11[_0xc0ac('0x127')]]['queue']])){if(this[_0xc0ac('0x2a')][_0x2ea552[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]]['queue']]){this[_0xc0ac('0x2a')][_0x2ea552['actions'][_0x588f11[_0xc0ac('0x127')]]['queue']]=this[_0xc0ac('0x2a')][this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]?this[_0xc0ac('0x2a')][this['actions'][_0x588f11[_0xc0ac('0x127')]]['queue']]:this['queueBooked'][this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]?this[_0xc0ac('0x29')][this[_0xc0ac('0x22')][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]]['_rr']||0x0:0x0;}this['queueBooked'][this['actions'][_0x588f11[_0xc0ac('0x127')]][_0xc0ac('0xb4')]][_0xc0ac('0x132')]=this[_0xc0ac('0x2a')][this[_0xc0ac('0x22')][_0x588f11['actionid']][_0xc0ac('0xb4')]];for(var _0x28b29e=0x0;_0x28b29e=0x0;})['catch'](myreject(_0x54d7f4)));}}else{_0x4eeae3['push'](ami['Action']({'action':_0xc0ac('0x14c'),'command':util[_0xc0ac('0x78')]('iftime\x20%s,%s',_0x492616,!_[_0xc0ac('0x40')](config[_0xc0ac('0x146')][_0x2a553f])?_0x2a553f:'')})[_0xc0ac('0x3e')](function(_0x45698a){return _0x45698a[_0xc0ac('0x149')][_0xc0ac('0x14a')](_0xc0ac('0x14b'))>=0x0;})['catch'](myreject(_0x54d7f4)));}BPromise[_0xc0ac('0x14d')](_0x4eeae3)[_0xc0ac('0x3e')](function(_0x3b600f){var _0x18f5c2=_[_0xc0ac('0x14e')](_0x3b600f);if(_0x18f5c2){return _0x326d00(_0x18f5c2);}else{_0x578ef5[_0xc0ac('0x42')]=_0x62b9de?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc0ac('0x14f');return _0x54d7f4(msgResponse(_0xc0ac('0x150'),_0xc0ac('0x144'),_0xc0ac('0x151')+_0x62b9de+'\x20'+_0x57e5a1+_0xc0ac('0x152')+util[_0xc0ac('0x94')](_0x492616,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2a553f));}})[_0xc0ac('0xba')](function(_0x1024b5){return _0x54d7f4(msgResponse(_0xc0ac('0x141'),_0xc0ac('0x144'),JSON[_0xc0ac('0x4b')](_0x1024b5)));});});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x153')]=function(_0x504a6a){var _0x1555e9=this;return function(){switch(_0x504a6a[_0xc0ac('0x5c')]){case _0xc0ac('0x154'):freeVariablesPredictive(_0x504a6a);_0x1555e9[_0xc0ac('0x155')](_0x504a6a,0x1);break;case _0xc0ac('0x156'):freeVariablesPredictive(_0x504a6a);_0x1555e9[_0xc0ac('0x155')](_0x504a6a,_0x504a6a['dialPowerLevel']);break;case _0xc0ac('0x9'):_0x1555e9[_0xc0ac('0x9')](_0x504a6a);break;case'booked':freeVariablesPredictive(_0x504a6a);_0x1555e9[_0xc0ac('0x155')](_0x504a6a,0x1);break;default:freeVariablesPredictive(_0x504a6a);logger[_0xc0ac('0x95')](_0xc0ac('0x157'),_0x504a6a[_0xc0ac('0x44')],'method\x20not\x20recognized');}};};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x158')]=function(_0x58ae0d){return BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](cmHopper[_0xc0ac('0x159')](_0x58ae0d['id'],previewRecallmeReminderInterval))[_0xc0ac('0x3e')](function(_0x5c2f64){for(var _0x22e501=0x0;_0x22e501<_0x5c2f64['length'];_0x22e501++){var _0x5151a9=_0x5c2f64[_0x22e501][_0xc0ac('0x15a')][_0xc0ac('0x44')];if(_0x5151a9)io['to'](util[_0xc0ac('0x78')](_0xc0ac('0x15b'),_0x5151a9))[_0xc0ac('0x101')](_0xc0ac('0x15c'),{'hopper':_0x5c2f64[_0x22e501]});}})[_0xc0ac('0xba')](function(_0x303c97){});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x15d')]=function(_0x1ee5dc){var _0x277fc0=this;return function(){_0x277fc0['handleIvr'](_0x1ee5dc);};};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xa')]=function(_0x2c2c7e){var _0x164276=this;if(isNotPreview(_0x2c2c7e[_0xc0ac('0x5c')])){if(isVoiceQueueOutbound(_0x2c2c7e[_0xc0ac('0x56')])&&isActive(_0x2c2c7e[_0xc0ac('0x5b')])){_0x2c2c7e[_0xc0ac('0x9f')]=!![];BPromise[_0xc0ac('0xb8')]()['then'](checkIsLoggedIn(_0x2c2c7e,_0x2c2c7e[_0xc0ac('0x15e')]))[_0xc0ac('0x3e')](checkIsActive(_0x2c2c7e,_0x2c2c7e[_0xc0ac('0x5b')]))[_0xc0ac('0x3e')](checkInterval(_0x2c2c7e))[_0xc0ac('0x3e')](_0x164276[_0xc0ac('0x15f')](_0x2c2c7e))[_0xc0ac('0x3e')](_0x164276[_0xc0ac('0x140')](_0x2c2c7e[_0xc0ac('0x160')],_0x2c2c7e['dialTimezone'],_0x2c2c7e[_0xc0ac('0x44')],_0x2c2c7e))[_0xc0ac('0x3e')](_0x164276['checkIfTimeIntervals'](_0x2c2c7e[_0xc0ac('0x46')],_0x2c2c7e[_0xc0ac('0x161')],_0x2c2c7e[_0xc0ac('0x44')],_0x2c2c7e))[_0xc0ac('0x3e')](_0x164276[_0xc0ac('0x153')](_0x2c2c7e))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x2c2c7e));}else{notSendMessagesQueue(_0x2c2c7e);}}else{freeVariablesPredictive(_0x2c2c7e);if(_0x2c2c7e[_0xc0ac('0x162')]){_0x164276['checkPreviewRecallReminder'](_0x2c2c7e);}}};Dialer[_0xc0ac('0xb7')]['syncCampaigns']=function(){var _0x1aedd7=this;var _0x2d5d11;for(var _0x48f345 in this['campaigns']){if(typeof this[_0xc0ac('0x1d')][_0x48f345]!==_0xc0ac('0x97')){_0x2d5d11=this['campaigns'][_0x48f345];if(isCampaignIvr(_0x2d5d11[_0xc0ac('0x56')])&&isActive(_0x2d5d11['active'])){_0x2d5d11[_0xc0ac('0x9f')]=!![];BPromise[_0xc0ac('0xb8')]()[_0xc0ac('0x3e')](checkIsActive(_0x2d5d11,_0x2d5d11[_0xc0ac('0x76')]))[_0xc0ac('0x3e')](checkInterval(_0x2d5d11))[_0xc0ac('0x3e')](_0x1aedd7[_0xc0ac('0x15f')](_0x2d5d11))[_0xc0ac('0x3e')](_0x1aedd7[_0xc0ac('0x140')](_0x2d5d11[_0xc0ac('0x160')],_0x2d5d11['dialTimezone'],_0x2d5d11['name'],_0x2d5d11))[_0xc0ac('0x3e')](_0x1aedd7[_0xc0ac('0x142')](_0x2d5d11['Interval'],_0x2d5d11[_0xc0ac('0x161')],_0x2d5d11[_0xc0ac('0x44')],_0x2d5d11))[_0xc0ac('0x3e')](_0x1aedd7[_0xc0ac('0x15d')](_0x2d5d11))['catch'](loggerCatchQueueSummary(_0xc0ac('0x163'),_0x2d5d11));}else{notSendMessagesCampaign(_0x2d5d11);}}}};function getCallerIdRandom(_0x446390,_0x58c2a5){var _0x3e4744;var _0x33eea4;var _0x385825;if(_0x58c2a5<=0x0){_0x58c2a5=0x1;}_0x3e4744=new RegExp(_0xc0ac('0x164')+_0x58c2a5+'}$');_0x33eea4=Math[_0xc0ac('0x165')](0xa,_0x58c2a5-0x1);_0x385825=Math[_0xc0ac('0x165')](0xa,_0x58c2a5)-0x1;return util[_0xc0ac('0x78')]('%s',_['replace'](_0x446390,_0x3e4744,_[_0xc0ac('0x166')](_0x33eea4,_0x385825)));}function extractCalleridName(_0x46e9ad){var _0x26c702=_0x46e9ad[_0xc0ac('0x167')](/"(.*?)"/);return _0x26c702?_0x26c702[0x1]:_0x46e9ad;}function extractCalleridNumber(_0x283c78){var _0x48fd7f=_0x283c78[_0xc0ac('0x167')](/<(.*?)>/);return _0x48fd7f?_0x48fd7f[0x1]:_0x283c78;}Dialer[_0xc0ac('0xb7')][_0xc0ac('0x168')]=function(_0x5a6133,_0x4a83b3){var _0x3a7b5e=this;var _0x58eaee=uuid['v4']();this[_0xc0ac('0x22')][_0x58eaee]=new Action(_0x5a6133,_0x4a83b3,_0x58eaee);return new BPromise(function(_0x5cc88c,_0x422c18){if(_[_0xc0ac('0x40')](_0x5a6133)&&typeof _0x5a6133!=='object'){return _0x422c18(msgResponse(_0xc0ac('0x169'),_0xc0ac('0x144'),_0xc0ac('0x16a')));}if(_['isUndefined'](_0x4a83b3[_0xc0ac('0x16b')]['phone'])||_0x4a83b3[_0xc0ac('0x16b')][_0xc0ac('0x16c')]===null){return _0x422c18(msgResponse('originate',_0xc0ac('0x144'),_0xc0ac('0x16d')));}var _0x1dfd7f={'XMD-CALLERID':_0x3a7b5e[_0xc0ac('0x22')][_0x58eaee][_0xc0ac('0x16e')](),'XMD-AGI':_0x5a6133[_0xc0ac('0x16f')]?util[_0xc0ac('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5a6133[_0xc0ac('0x16f')]):_0xc0ac('0x170'),'XMD-AGIAFTER':_0x5a6133['dialQueueProject2']?util[_0xc0ac('0x78')](_0xc0ac('0x171'),ipAgi,_0x5a6133[_0xc0ac('0x111')]):_0xc0ac('0x170'),'XMD-QUEUE':_0x5a6133['type']===_0xc0ac('0x4f')?util['format'](_0xc0ac('0x172'),_0x5a6133[_0xc0ac('0x44')],_0x5a6133[_0xc0ac('0x173')]||'',_0x5a6133[_0xc0ac('0x174')]?'c':'',_0x5a6133[_0xc0ac('0x118')]||0x3):'NONE','XMD-CONTACTID':_0x4a83b3['ContactId'],'XMD-CDRTYPE':_0xc0ac('0x7'),'CALLERID(all)':_0x3a7b5e[_0xc0ac('0x22')][_0x58eaee][_0xc0ac('0x16e')](),'XMD-AMD':_0x5a6133[_0xc0ac('0xe4')]?_0xc0ac('0x175'):'NONE','XMD-DESTINATION':_0xc0ac('0xe3')};if(_0x5a6133[_0xc0ac('0xe4')]){_0x1dfd7f[_0xc0ac('0x176')]=_0x5a6133['dialAMDInitialSilence']||0x9c4;_0x1dfd7f[_0xc0ac('0x177')]=_0x5a6133['dialAMDGreeting']||0x5dc;_0x1dfd7f['XMD-AMDAFTERGREETINGSILENCE']=_0x5a6133[_0xc0ac('0x178')]||0x320;_0x1dfd7f['XMD-AMDTOTALANALYSISTIME']=_0x5a6133[_0xc0ac('0x179')]||0x1388;_0x1dfd7f['XMD-AMDMINWORDLENGTH']=_0x5a6133[_0xc0ac('0x17a')]||0x64;_0x1dfd7f[_0xc0ac('0x17b')]=_0x5a6133[_0xc0ac('0x17c')]||0x32;_0x1dfd7f[_0xc0ac('0x17d')]=_0x5a6133['dialAMDMaximumNumberOfWords']||0x3;_0x1dfd7f['XMD-AMDSILENCETHRESHOLD']=_0x5a6133[_0xc0ac('0x17e')]||0x100;_0x1dfd7f[_0xc0ac('0x17f')]=_0x5a6133['dialAMDMaximumWordLength']||0x1388;}if(_0x5a6133[_0xc0ac('0x56')]===_0xc0ac('0x4f')){_0x1dfd7f[_0xc0ac('0x180')]=_0x4a83b3[_0xc0ac('0xd7')];}else{_0x1dfd7f[_0xc0ac('0x181')]=_0x4a83b3[_0xc0ac('0xd8')];}for(var _0x3deab3 in _0x4a83b3[_0xc0ac('0x16b')]){if(typeof _0x4a83b3[_0xc0ac('0x16b')][_0x3deab3]!==_0xc0ac('0x97')){if(isNotNull(_0x4a83b3[_0xc0ac('0x16b')][_0x3deab3])&&_0x3deab3!=='id'&&_0x3deab3!==_0xc0ac('0x182')&&_0x3deab3!==_0xc0ac('0x183')&&_0x3deab3!=='updatedAt'){_0x1dfd7f[util['format']('%s%s',_0xc0ac('0x184'),_[_0xc0ac('0x185')](_0x3deab3))]=_0x4a83b3[_0xc0ac('0x16b')][_0x3deab3];}}}var _0x207027=_0x3a7b5e[_0xc0ac('0xdd')](_0x5a6133[_0xc0ac('0x75')])?getCallerId(_0x5a6133['Trunk'][_0xc0ac('0x77')],_0x5a6133['dialOriginateCallerIdName'],_0x5a6133['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5a6133[_0xc0ac('0x186')],_0x5a6133[_0xc0ac('0x187')]):_0x5a6133[_0xc0ac('0x186')]):getCallerId(_[_0xc0ac('0xaf')](_0x5a6133[_0xc0ac('0x13d')])?_0x5a6133['Trunk']['callerid']:_0x5a6133['TrunkBackup'][_0xc0ac('0x77')],_0x5a6133[_0xc0ac('0x5d')],_0x5a6133['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5a6133[_0xc0ac('0x186')],_0x5a6133[_0xc0ac('0x187')]):_0x5a6133[_0xc0ac('0x186')]);if(_0x207027){_0x1dfd7f[_0xc0ac('0x188')]=_0x3a7b5e[_0xc0ac('0x22')][_0x58eaee][_0xc0ac('0x189')]=extractCalleridName(_0x207027);_0x1dfd7f[_0xc0ac('0x18a')]=_0x3a7b5e['actions'][_0x58eaee][_0xc0ac('0x18b')]=extractCalleridNumber(_0x207027);}return ami['Action']({'actionid':_0x58eaee,'action':_0xc0ac('0x169'),'channel':_0x3a7b5e[_0xc0ac('0xdd')](_0x5a6133['Trunk'])?util['format'](_0xc0ac('0x18c'),_0x5a6133[_0xc0ac('0x75')][_0xc0ac('0x44')],isNotNull(_0x5a6133[_0xc0ac('0x5f')])?_0x5a6133[_0xc0ac('0x5f')]['trim']()||'':'',_0x5a6133['dialCutDigit']>0x0?_0x4a83b3[_0xc0ac('0x16b')][_0xc0ac('0x16c')]['substring'](_0x5a6133[_0xc0ac('0x18d')]):_0x4a83b3[_0xc0ac('0x16b')][_0xc0ac('0x16c')]):util[_0xc0ac('0x78')](_0xc0ac('0x18c'),_[_0xc0ac('0xaf')](_0x5a6133[_0xc0ac('0x13d')])?_0x5a6133[_0xc0ac('0x75')][_0xc0ac('0x44')]:_0x5a6133[_0xc0ac('0x13d')][_0xc0ac('0x44')],isNotNull(_0x5a6133[_0xc0ac('0x5f')])?_0x5a6133[_0xc0ac('0x5f')][_0xc0ac('0x18e')]()||'':'',_0x5a6133[_0xc0ac('0x18d')]>0x0?_0x4a83b3['Contact'][_0xc0ac('0x16c')][_0xc0ac('0x18f')](_0x5a6133[_0xc0ac('0x18d')]):_0x4a83b3[_0xc0ac('0x16b')][_0xc0ac('0x16c')]),'callerid':_0x207027,'Exten':_0xc0ac('0xe3'),'Context':_0xc0ac('0x190'),'Priority':'1','variable':_0x1dfd7f,'timeout':(_0x5a6133['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x58eaee})[_0xc0ac('0x3e')](function(_0x1a3a95){return _0x5cc88c(_0x1a3a95);})['catch'](function(_0x21e0c5){_0x5a6133[_0xc0ac('0x63')]+=0x1;var _0x2a54d3=new History(_0x3a7b5e[_0xc0ac('0x22')][_0x58eaee]);logger[_0xc0ac('0x95')](util[_0xc0ac('0x78')](_0xc0ac('0x191'),JSON[_0xc0ac('0x4b')](_0x21e0c5)));_0x2a54d3[_0xc0ac('0xa7')]=0xe;_0x2a54d3['statedesc']=_0xc0ac('0x192');_0x2a54d3[_0xc0ac('0xaa')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));_0x2a54d3[_0xc0ac('0xa9')]=_0x2a54d3[_0xc0ac('0xaa')];_0x3a7b5e[_0xc0ac('0xcd')](_0x2a54d3)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x193')));_0x3a7b5e[_0xc0ac('0xcb')](_0x2a54d3)[_0xc0ac('0xba')](loggerCatch('[originate][error]'))[_0xc0ac('0x1a')](function(){delete _0x3a7b5e[_0xc0ac('0x22')][_0x58eaee];return _0x422c18(msgResponse(_0xc0ac('0x169'),_0xc0ac('0x4a'),_0xc0ac('0x194')));});});});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x195')]=function(_0xe2eb6f){var _0x3252f8=this[_0xc0ac('0x22')][_0xe2eb6f['actionid']];if(_0x3252f8){delete this[_0xc0ac('0x22')][_0xe2eb6f['actionid']];_0x3252f8[_0xc0ac('0x196')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));var _0x1d678f=_0x3252f8[_0xc0ac('0x56')]==='ivr'?this[_0xc0ac('0x1d')][_0x3252f8['queue']]:this['voiceQueues'][_0x3252f8[_0xc0ac('0x197')]()];if(!this[_0xc0ac('0xdb')](_0xe2eb6f[_0xc0ac('0x198')])){this[_0xc0ac('0xb3')](_0x1d678f);return this[_0xc0ac('0x199')](_0x3252f8,_0x1d678f,_0xe2eb6f)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x19a')));}this[_0xc0ac('0x24')][_0xe2eb6f['uniqueid']]=_0x3252f8;}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x19b')]=function(_0x3ca764,_0x3b85ce,_0xdfbd06){var _0x46d36f=new History(_0x3b85ce);if(_0x46d36f[_0xc0ac('0xf3')]+_0x46d36f[_0xc0ac('0xf4')]+_0x46d36f['countnoanswerretry']+_0x46d36f[_0xc0ac('0xf6')]+_0x46d36f[_0xc0ac('0x102')]+_0x46d36f[_0xc0ac('0xf7')]+_0x46d36f[_0xc0ac('0xf0')]+_0x46d36f[_0xc0ac('0xf8')]>=_0xdfbd06[_0xc0ac('0xf9')]-0x1){return!![];}switch(_0x3ca764){case 0x3:if(_0x46d36f[_0xc0ac('0xf5')]>=_0xdfbd06[_0xc0ac('0x19c')]-0x1){return!![];}this[_0xc0ac('0xc1')]({'active':![],'countnoanswerretry':_0x46d36f[_0xc0ac('0xf5')]+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06[_0xc0ac('0x19d')],_0xc0ac('0x106'))['format'](_0xc0ac('0xfd')),'ContactId':_0x46d36f['ContactId'],'ListId':_0x46d36f[_0xc0ac('0xd5')],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x19e')));break;case 0x5:if(_0x46d36f['countbusyretry']>=_0xdfbd06[_0xc0ac('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x46d36f[_0xc0ac('0xf3')]+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06['dialBusyRetryFrequency'],_0xc0ac('0x106'))[_0xc0ac('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f[_0xc0ac('0xd5')],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})['catch'](loggerCatch(_0xc0ac('0x1a0')));break;case 0x8:if(_0x46d36f[_0xc0ac('0xf4')]>=_0xdfbd06[_0xc0ac('0x1a1')]-0x1){return!![];}this[_0xc0ac('0xc1')]({'active':![],'countcongestionretry':_0x46d36f[_0xc0ac('0xf4')]+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06[_0xc0ac('0x1a2')],_0xc0ac('0x106'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f[_0xc0ac('0xd5')],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1a3')));break;case 0x0:if(_0x46d36f['countnosuchnumberretry']>=_0xdfbd06['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x46d36f[_0xc0ac('0xf6')]+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06[_0xc0ac('0x1a4')],_0xc0ac('0x106'))[_0xc0ac('0x78')](_0xc0ac('0xfd')),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f[_0xc0ac('0xd5')],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})['catch'](loggerCatch(_0xc0ac('0x1a5')));}break;case 0xa:if(_0x46d36f[_0xc0ac('0x102')]>=_0xdfbd06[_0xc0ac('0x11b')]-0x1){return!![];}this[_0xc0ac('0xc1')]({'active':![],'countdropretry':_0x46d36f[_0xc0ac('0x102')]+=0x1,'scheduledat':moment()['add'](_0xdfbd06[_0xc0ac('0x11c')],_0xc0ac('0x106'))['format'](_0xc0ac('0xfd')),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f['ListId'],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x11d')));break;case 0xb:if(_0x46d36f[_0xc0ac('0xf7')]>=_0xdfbd06[_0xc0ac('0x121')]-0x1){return!![];}this[_0xc0ac('0xc1')]({'active':![],'countabandonedretry':_0x46d36f[_0xc0ac('0xf7')]+=0x1,'scheduledat':moment()['add'](_0xdfbd06[_0xc0ac('0x122')],_0xc0ac('0x106'))[_0xc0ac('0x78')](_0xc0ac('0xfd')),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f['ListId'],'VoiceQueueId':_0x46d36f['VoiceQueueId']||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x46d36f[_0xc0ac('0xf0')]>=_0xdfbd06[_0xc0ac('0x104')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x46d36f[_0xc0ac('0xf0')]+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06['dialMachineRetryFrequency'],_0xc0ac('0x106'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f['ListId'],'VoiceQueueId':_0x46d36f[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x46d36f[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xfe')));break;case 0x14:if(_0x46d36f['countagentrejectretry']>=_0xdfbd06['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x46d36f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xc0ac('0xfc')](_0xdfbd06[_0xc0ac('0x1a6')],_0xc0ac('0x106'))[_0xc0ac('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46d36f[_0xc0ac('0xd4')],'ListId':_0x46d36f[_0xc0ac('0xd5')],'VoiceQueueId':_0x46d36f['VoiceQueueId']||undefined,'CampaignId':_0x46d36f['CampaignId']||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1a7')));break;default:return!![];}};Dialer[_0xc0ac('0xb7')]['callProgressDetecting']=function(_0x152b5e,_0x11fc33,_0x12053b){var _0x503b1f=this;var _0x522e68=new History(_0x152b5e);return new BPromise(function(_0x8a5381,_0x42429e){if(_['isUndefined'](_0x11fc33)&&typeof _0x11fc33!=='object'){return _0x42429e(msgResponse(_0xc0ac('0x1a8'),'Failure',_0xc0ac('0x1a9')));}if(_['isUndefined'](_0x12053b)&&typeof _0x12053b!==_0xc0ac('0x1aa')){return _0x42429e(msgResponse(_0xc0ac('0x1a8'),_0xc0ac('0x144'),_0xc0ac('0x1ab')));}switch(_0x12053b[_0xc0ac('0x10e')]){case'0':_0x11fc33['outboundNoSuchCallsDay']+=0x1;_0x522e68[_0xc0ac('0xa7')]=0x0;_0x522e68[_0xc0ac('0xa8')]=_0xc0ac('0x1ac');_0x522e68[_0xc0ac('0xf6')]+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;ami[_0xc0ac('0x101')](_0xc0ac('0x1ad'),ut[_0xc0ac('0xea')](_0x152b5e,'nosuchnumber'));_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0xf2')));if(_0x503b1f[_0xc0ac('0x19b')](0x0,_0x152b5e,_0x11fc33)){if(_0x522e68['countnosuchnumberretry']>=_0x11fc33['dialNoSuchNumberMaxRetry']){_0x503b1f[_0xc0ac('0xfb')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1ae'));}else{_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1ae'));}}break;case'3':_0x11fc33[_0xc0ac('0x62')]+=0x1;_0x522e68['state']=0x3;_0x522e68['statedesc']='NoAnswer';_0x522e68[_0xc0ac('0xf5')]+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;ami[_0xc0ac('0x101')](_0xc0ac('0x1af'),ut[_0xc0ac('0xea')](_0x152b5e,_0xc0ac('0x1b0')));_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1b1')));if(_0x503b1f[_0xc0ac('0x19b')](0x3,_0x152b5e,_0x11fc33)){if(_0x522e68[_0xc0ac('0xf5')]>=_0x11fc33[_0xc0ac('0x19c')]){_0x503b1f[_0xc0ac('0xfb')](_0x522e68,_0x8a5381,_0x42429e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1b2'));}}break;case'5':_0x11fc33['outboundBusyCallsDay']+=0x1;_0x522e68[_0xc0ac('0xa7')]=0x5;_0x522e68['statedesc']='Busy';_0x522e68[_0xc0ac('0xf3')]+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0x152b5e,_0xc0ac('0x1b3')));_0x503b1f['createHistory'](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1b4')));if(_0x503b1f['checkRetriveMax'](0x5,_0x152b5e,_0x11fc33)){if(_0x522e68[_0xc0ac('0xf3')]>=_0x11fc33[_0xc0ac('0x19f')]){_0x503b1f[_0xc0ac('0xfb')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1b5'));}else{_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1b5'));}}break;case'8':_0x11fc33[_0xc0ac('0x1b6')]+=0x1;_0x522e68['state']=0x8;_0x522e68[_0xc0ac('0xa8')]=_0xc0ac('0x1b7');_0x522e68[_0xc0ac('0xf4')]+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;ami[_0xc0ac('0x101')]('custom:agentcongestion',ut[_0xc0ac('0xea')](_0x152b5e,_0xc0ac('0x1b8')));_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1b9')));if(_0x503b1f[_0xc0ac('0x19b')](0x8,_0x152b5e,_0x11fc33)){if(_0x522e68[_0xc0ac('0xf4')]>=_0x11fc33[_0xc0ac('0x1a1')]){_0x503b1f[_0xc0ac('0xfb')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1ba'));}else{_0x503b1f['stateGlobal'](_0x522e68,_0x8a5381,_0x42429e,'reason\x208\x20congestion');}}break;case'11':_0x11fc33['outboundAbandonedCallsDay']+=0x1;_0x522e68[_0xc0ac('0xa7')]=0xb;_0x522e68['statedesc']=_0xc0ac('0x124');_0x522e68['countabandonedretry']+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x503b1f['checkRetriveMax'](0xb,_0x152b5e,_0x11fc33)){if(_0x522e68[_0xc0ac('0xf7')]>=_0x11fc33[_0xc0ac('0x121')]){_0x503b1f['createStateFinal'](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1bb'));}else{_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1bb'));}}break;case'20':_0x11fc33[_0xc0ac('0x65')]+=0x1;_0x522e68[_0xc0ac('0xa7')]=0x14;_0x522e68[_0xc0ac('0xa8')]='AgentReject';_0x522e68[_0xc0ac('0xf8')]+=0x1;_0x522e68[_0xc0ac('0xf1')]+=0x1;ami[_0xc0ac('0x101')](_0xc0ac('0x1bc'),ut[_0xc0ac('0xea')](_0x152b5e,'agentreject'));_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1bd')));if(_0x503b1f[_0xc0ac('0x19b')](0x14,_0x152b5e,_0x11fc33)){if(_0x522e68['countagentrejectretry']>=_0x11fc33[_0xc0ac('0x1be')]){_0x503b1f[_0xc0ac('0xfb')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1bf'));}else{_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0xc0ac('0x1bf'));}}break;default:_0x11fc33[_0xc0ac('0x66')]+=0x1;_0x522e68['state']=0xc;_0x522e68[_0xc0ac('0xa8')]=_0x12053b[_0xc0ac('0x10e')];_0x503b1f[_0xc0ac('0xcd')](_0x522e68)[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1c0')));if(_0x503b1f['checkRetriveMax'](_0x12053b[_0xc0ac('0x10e')],_0x152b5e,_0x11fc33)){if(_0x522e68[_0xc0ac('0xf3')]+_0x522e68[_0xc0ac('0xf4')]+_0x522e68['countnoanswerretry']+_0x522e68[_0xc0ac('0xf6')]+_0x522e68[_0xc0ac('0x102')]+_0x522e68[_0xc0ac('0xf7')]+_0x522e68[_0xc0ac('0xf0')]+_0x522e68[_0xc0ac('0xf8')]>=_0x11fc33[_0xc0ac('0xf9')]){_0x503b1f[_0xc0ac('0xfa')](_0x522e68,_0x8a5381,_0x42429e,_0x12053b[_0xc0ac('0x10e')]);}else{_0x503b1f['createStateFinal'](_0x522e68,_0x8a5381,_0x42429e,_0x12053b[_0xc0ac('0x10e')]);}}}});};Dialer['prototype'][_0xc0ac('0xfa')]=function(_0xcbc04a,_0x36c9d4,_0x4cebac,_0x38b8fd){var _0x9b6d77=new Final(_0xcbc04a);_0x9b6d77[_0xc0ac('0xa7')]=0xf;_0x9b6d77[_0xc0ac('0xa8')]='Global';this[_0xc0ac('0xfb')](_0x9b6d77,_0x36c9d4,_0x4cebac,_0x38b8fd);};Dialer[_0xc0ac('0xb7')][_0xc0ac('0xfb')]=function(_0x1a49fb,_0x3402e0,_0x477086,_0x5b78ed){this[_0xc0ac('0xcb')](_0x1a49fb)[_0xc0ac('0x3e')](function(){return _0x3402e0(msgResponse(_0xc0ac('0x1a8'),'Success',_0x5b78ed));})['catch'](function(){return _0x477086(msgResponse(_0xc0ac('0x1c1'),_0xc0ac('0x144'),_0xc0ac('0x1c2')));});};Dialer['prototype'][_0xc0ac('0x9')]=function(_0x51c4c7){var _0x6fd8ab=_0x51c4c7[_0xc0ac('0x1c3')]/0x64;var _0x4a4da0=_0x51c4c7['outboundDropCallsDayTimeout']/(_0x51c4c7[_0xc0ac('0x61')]+_0x51c4c7['outboundAnswerCallsDay']);var _0x435128=Math[_0xc0ac('0x1c4')](_0x51c4c7[_0xc0ac('0x1c5')]*(_0x51c4c7[_0xc0ac('0x1c6')]/0x64));var _0x129850=Math[_0xc0ac('0x1c4')](_0x51c4c7[_0xc0ac('0x1c5')]*(_0x51c4c7['predictiveIntervalMinThreshold']/0x64));var _0x2df32f=_0x51c4c7['available']+_0x51c4c7['talking'];var _0x231fc8=Math[_0xc0ac('0x1c7')](_0x51c4c7['erlangCalls']*_0x51c4c7[_0xc0ac('0x73')]*_0x51c4c7[_0xc0ac('0x1c8')]*_0x51c4c7['predictiveIntervalMultiplicativeFactor']);if(_[_0xc0ac('0x40')](_0x51c4c7[_0xc0ac('0x27')])){if(!_[_0xc0ac('0x40')](_0x51c4c7['startPredictive'])){_0x51c4c7[_0xc0ac('0x26')]=undefined;loggerPredictive[_0xc0ac('0x95')](_0xc0ac('0x1c9'),_0xc0ac('0x1ca'));}if(!_[_0xc0ac('0x40')](_0x51c4c7[_0xc0ac('0x8e')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xc0ac('0x1cb'));clearInterval(_0x51c4c7['handlePredictive']);_0x51c4c7[_0xc0ac('0x8e')]=undefined;}_0x51c4c7['startProgressive']=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));loggerPredictive['info'](_0x51c4c7[_0xc0ac('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x51c4c7[_0xc0ac('0x27')]);this[_0xc0ac('0x155')](_0x51c4c7,0x1);}else if(ifInterval(_0x51c4c7[_0xc0ac('0x1cc')],_0x51c4c7[_0xc0ac('0x27')])){this[_0xc0ac('0x155')](_0x51c4c7,0x1);loggerPredictiveCalls[_0xc0ac('0x7b')](_0xc0ac('0x1cd'),_0x51c4c7[_0xc0ac('0x27')],_0x51c4c7[_0xc0ac('0x44')]);_0x51c4c7[_0xc0ac('0x86')]=0x0;_0x51c4c7[_0xc0ac('0x6d')]=0x0;}else if(_0x6fd8ab<_0x4a4da0&&_0x51c4c7['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x51c4c7);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x1ce'),_0xc0ac('0x1cf'),_0x4a4da0,_0xc0ac('0x27'),_0x51c4c7[_0xc0ac('0x44')]);}else if(_0x231fc8<_0x51c4c7[_0xc0ac('0x6d')]&&_0x51c4c7[_0xc0ac('0x1d0')]==='dropRate'){freeVariablesPredictive(_0x51c4c7);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x1d1'),_0xc0ac('0x1d2'),_0x231fc8,'Drop\x20in\x20this\x20interval',_0x51c4c7[_0xc0ac('0x6d')],'startProgressive',_0x51c4c7[_0xc0ac('0x44')]);}else if(!ifInterval(_0x51c4c7[_0xc0ac('0x1cc')],_0x51c4c7[_0xc0ac('0x27')])&&_[_0xc0ac('0x40')](_0x51c4c7[_0xc0ac('0x26')])&&!_[_0xc0ac('0x40')](_0x51c4c7[_0xc0ac('0x27')])){_0x51c4c7['startPredictive']=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));loggerPredictive[_0xc0ac('0x7b')](_0x51c4c7[_0xc0ac('0x44')],_0xc0ac('0x1d3'),_0x51c4c7[_0xc0ac('0x26')]);this[_0xc0ac('0xbf')](_0x51c4c7[_0xc0ac('0x1cc')])[_0xc0ac('0x3e')](this[_0xc0ac('0x1d4')](_0x51c4c7))[_0xc0ac('0x3e')](mergeDataErlangB(_0x51c4c7))[_0xc0ac('0x3e')](this[_0xc0ac('0x1d5')](_0x51c4c7))[_0xc0ac('0xba')](loggerCatchPredictive(_0xc0ac('0x1d6'),_0x51c4c7));}else if(!ifInterval(_0x51c4c7[_0xc0ac('0x1cc')],_0x51c4c7[_0xc0ac('0x26')])){_0x51c4c7[_0xc0ac('0x6d')]=0x0;_0x51c4c7[_0xc0ac('0x26')]=moment()[_0xc0ac('0x78')](_0xc0ac('0xfd'));loggerPredictive[_0xc0ac('0x7b')](_0x51c4c7[_0xc0ac('0x44')],_0xc0ac('0x1d7'),_0x51c4c7[_0xc0ac('0x26')]);clearInterval(_0x51c4c7['handlePredictive']);_0x51c4c7[_0xc0ac('0x8e')]=undefined;this[_0xc0ac('0xbf')](_0x51c4c7[_0xc0ac('0x1cc')])[_0xc0ac('0x3e')](this[_0xc0ac('0x1d4')](_0x51c4c7))[_0xc0ac('0x3e')](mergeDataErlangB(_0x51c4c7))['then'](this[_0xc0ac('0x1d5')](_0x51c4c7))['catch'](loggerCatchPredictive(_0xc0ac('0x1d8'),_0x51c4c7));}else if(_0x51c4c7['predictiveIntervalAvailable']&&_0x2df32f<_0x51c4c7[_0xc0ac('0x1c5')]-_0x129850){freeVariablesPredictive(_0x51c4c7);loggerPredictive[_0xc0ac('0x7b')](_0x51c4c7[_0xc0ac('0x44')],_0xc0ac('0x1d9'),_0x2df32f,')\x20are\x20less\x20than\x20threshold\x20(',_0x51c4c7[_0xc0ac('0x1c5')],'-',_0x129850,'=',_0x51c4c7[_0xc0ac('0x1c5')]-_0x129850,')');}else if(_0x51c4c7[_0xc0ac('0x1c5')]&&_0x2df32f>_0x51c4c7['predictiveIntervalAvailable']+_0x435128){freeVariablesPredictive(_0x51c4c7);loggerPredictive[_0xc0ac('0x7b')](_0x51c4c7[_0xc0ac('0x44')],_0xc0ac('0x1d9'),_0x2df32f,_0xc0ac('0x1da'),_0x51c4c7[_0xc0ac('0x1c5')],'+',_0x435128,'=',_0x51c4c7[_0xc0ac('0x1c5')]+_0x435128,')');}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1d4')]=function(_0x3bcb8f){var _0x50a82e=this;return function(_0x2c63ac){return new BPromise(function(_0x18a8b6,_0x273f18){_[_0xc0ac('0x8b')](_0x3bcb8f,_0x2c63ac[0x0]);if(checkGetDataPredictive(_0x2c63ac[0x0])){var _0x20603e=_0x3bcb8f[_0xc0ac('0x1c5')]=_0x3bcb8f['talking']+_0x3bcb8f[_0xc0ac('0x51')];var _0x5323dd=_0x3bcb8f[_0xc0ac('0x1cc')]*0x3c;var _0x3b3e67=_0x2c63ac[0x0][_0xc0ac('0x69')]+_0x2c63ac[0x0][_0xc0ac('0x68')];var _0x3a33a2=(_0x2c63ac[0x0][_0xc0ac('0x67')]+_0x2c63ac[0x0][_0xc0ac('0x6b')]+_0x2c63ac[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2c63ac[0x0][_0xc0ac('0x70')];_0x3bcb8f[_0xc0ac('0x1c8')]=_0x3a33a2>0x0?_0x3a33a2:0x1;switch(_0x3bcb8f[_0xc0ac('0x1d0')]){case _0xc0ac('0x1db'):var _0x1db85f=_0x3bcb8f['dialPredictiveOptimizationPercentage']/0x64;return _0x50a82e[_0xc0ac('0x1dc')](_0x20603e,_0x5323dd,_0x3b3e67,_0x3a33a2,_0x1db85f)['then'](function(_0x315f1f){return _0x18a8b6(_0x315f1f);});case'agentBusyFactor':var _0xc097c1=_0x3bcb8f['dialPredictiveOptimizationPercentage']/0x64;return _0x50a82e[_0xc0ac('0x1dd')](_0x20603e,_0x5323dd,_0x3b3e67,_0x3a33a2,_0xc097c1)[_0xc0ac('0x3e')](function(_0x35803a){return _0x18a8b6(_0x35803a);});default:return _0x273f18(msgResponse(_0xc0ac('0x1de'),_0xc0ac('0x144'),_0xc0ac('0x1df')));}}else{return _0x273f18(msgResponse(_0xc0ac('0x1de'),_0xc0ac('0x144'),'check\x20failure'));}});};};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1e0')]=function(_0x112dd7){var _0x55651c=this;return function(_0x5d8841){return new BPromise(function(_0x5b892d,_0x4188c1){_['merge'](_0x112dd7,_0x5d8841[0x0]);if(checkGetDataPredictive(_0x5d8841[0x0])){loggerPredictive[_0xc0ac('0x7b')](JSON[_0xc0ac('0x4b')](_0x5d8841[0x0]));if(_0x112dd7['dialPredictiveOptimization']===_0xc0ac('0x1db')){return _0x55651c[_0xc0ac('0xc9')](_0x112dd7['id'])[_0xc0ac('0x3e')](function(_0x54a80c){var _0x15f1bf=_0x112dd7[_0xc0ac('0x15e')]-_0x54a80c[0x0][_0xc0ac('0x1e1')];var _0x543f02=_0x112dd7[_0xc0ac('0x1cc')]*0x3c;var _0x5b7d06=_0x5d8841[0x0][_0xc0ac('0x69')]+_0x5d8841[0x0][_0xc0ac('0x68')];var _0x115829=(_0x5d8841[0x0][_0xc0ac('0x67')]+_0x5d8841[0x0][_0xc0ac('0x6b')]+_0x5d8841[0x0][_0xc0ac('0x6a')])/_0x5d8841[0x0][_0xc0ac('0x70')];var _0x236d4f=_0x112dd7[_0xc0ac('0x1c3')]/0x64;_0x112dd7[_0xc0ac('0x6f')]=_0x54a80c[0x0][_0xc0ac('0x1e1')]||0x0;_0x112dd7[_0xc0ac('0x1c8')]=_0x115829>0x0?_0x115829:0x1;return _0x55651c['abandonmentRate'](_0x15f1bf,_0x543f02,_0x5b7d06,_0x115829,_0x236d4f);})['then'](function(_0x2bb660){return _0x5b892d(_0x2bb660);})['catch'](function(_0x2122b4){return _0x4188c1(msgResponse(_0xc0ac('0x1e2'),_0xc0ac('0x144'),JSON[_0xc0ac('0x4b')](_0x2122b4)));});}if(_0x112dd7[_0xc0ac('0x1d0')]===_0xc0ac('0x1e3')){return _0x55651c[_0xc0ac('0xc9')](_0x112dd7['id'])[_0xc0ac('0x3e')](function(_0x3f1c48){var _0x586b78=_0x112dd7['loggedIn']-_0x3f1c48[0x0][_0xc0ac('0x1e1')];var _0x1580cb=_0x112dd7[_0xc0ac('0x1cc')]*0x3c;var _0x53ae42=_0x5d8841[0x0]['predictiveIntervalAvgTalktime']+_0x5d8841[0x0][_0xc0ac('0x68')];var _0x36a645=(_0x5d8841[0x0][_0xc0ac('0x67')]+_0x5d8841[0x0][_0xc0ac('0x6b')]+_0x5d8841[0x0][_0xc0ac('0x6a')])/_0x5d8841[0x0]['predictiveIntervalTotalCalls'];var _0x2198ef=_0x112dd7[_0xc0ac('0x1c3')]/0x64;_0x112dd7['predictiveIntervalPauses']=_0x3f1c48[0x0][_0xc0ac('0x1e1')]||0x0;_0x112dd7[_0xc0ac('0x1c8')]=_0x36a645>0x0?_0x36a645:0x1;return _0x55651c[_0xc0ac('0x1dd')](_0x586b78,_0x1580cb,_0x53ae42,_0x36a645,_0x2198ef);})['then'](function(_0x2caf75){return _0x5b892d(_0x2caf75);})[_0xc0ac('0xba')](function(_0x578cfb){return _0x4188c1(msgResponse(_0xc0ac('0x1e2'),_0xc0ac('0x144'),JSON[_0xc0ac('0x4b')](_0x578cfb)));});}}else{return _0x4188c1(msgResponse('[getDataPredictive]','Failure',_0xc0ac('0x1e4')));}});};};Dialer[_0xc0ac('0xb7')]['startMethodPredictive']=function(_0xae8a3){var _0x5736b5=this;return function(){var _0x25b2dc=0x0;var _0x16cd2e=Math['floor'](_0xae8a3[_0xc0ac('0x72')]*0x3e8);if(_0x16cd2e>0x0){_0x16cd2e=_0x16cd2e<0x64?0x64:_0x16cd2e;loggerPredictive['info'](_0xae8a3[_0xc0ac('0x44')],'one\x20call\x20every:',_0x16cd2e,'milliseconds');_0xae8a3[_0xc0ac('0x8e')]=setInterval(function(){_0x5736b5['handlePredictive'](_0xae8a3);loggerPredictiveCalls[_0xc0ac('0x7b')](_0xc0ac('0x1e5'),_0x25b2dc+=0x1);},_0x16cd2e);}else{loggerPredictive[_0xc0ac('0x7b')](_0xae8a3['name'],_0xc0ac('0x1e6'));}};};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1e7')]=function(_0x394494,_0x59d2ae){var _0x790541=this;return function(_0x37fc52){if(_['isEmpty'](_0x37fc52)){if(_[_0xc0ac('0xaf')](_0x59d2ae[_0xc0ac('0xd6')])||!_0x59d2ae[_0xc0ac('0x1e8')]){if(_0x394494[_0xc0ac('0x5c')]===_0xc0ac('0x8')){_0x394494[_0xc0ac('0x12c')]=_[_0xc0ac('0x40')](_0x394494[_0xc0ac('0x12c')])?!![]:_0x394494[_0xc0ac('0x12c')];var _0x57d3ef=uuid['v4']();_0x790541[_0xc0ac('0x22')][_0x57d3ef]=new Action(_0x394494,_0x59d2ae,_0x57d3ef);loggerBooked[_0xc0ac('0x7b')](_0xc0ac('0x1e9'),_0x57d3ef,_0xc0ac('0x1ea'),JSON[_0xc0ac('0x4b')](_0x394494[_0xc0ac('0x12c')]),_0xc0ac('0x1eb'),_0x394494[_0xc0ac('0x44')]);if(_0x394494['queueStatusComplete']){_0x394494[_0xc0ac('0x12c')]=![];_0x790541[_0xc0ac('0x29')][_0x790541[_0xc0ac('0x22')][_0x57d3ef][_0xc0ac('0xb4')]]=[];ami['Action']({'actionid':_0x57d3ef,'action':_0xc0ac('0x1ec'),'queue':_0x394494[_0xc0ac('0x44')]})[_0xc0ac('0xba')](function(){_0x790541[_0xc0ac('0xb3')](_0x394494);_0x790541['rescheduleContact']({'active':![],'ContactId':_0x790541[_0xc0ac('0x22')][_0x57d3ef][_0xc0ac('0xd4')],'ListId':_0x790541[_0xc0ac('0x22')][_0x57d3ef]['ListId'],'VoiceQueueId':_0x790541[_0xc0ac('0x22')][_0x57d3ef][_0xc0ac('0xd7')]||undefined,'CampaignId':_0x790541[_0xc0ac('0x22')][_0x57d3ef][_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1ed')));delete _0x790541[_0xc0ac('0x22')][_0x57d3ef];});}else{loggerBooked[_0xc0ac('0x7b')](_0xc0ac('0x1ee'),JSON['stringify'](_0x394494['queueStatusComplete']),_0xc0ac('0x1eb'),_0x394494['name']);_0x790541[_0xc0ac('0xb3')](_0x394494);_0x790541[_0xc0ac('0xc1')]({'active':![],'ContactId':_0x790541['actions'][_0x57d3ef]['ContactId'],'ListId':_0x790541[_0xc0ac('0x22')][_0x57d3ef][_0xc0ac('0xd5')],'VoiceQueueId':_0x790541[_0xc0ac('0x22')][_0x57d3ef]['VoiceQueueId']||undefined,'CampaignId':_0x790541['actions'][_0x57d3ef]['CampaignId']||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1ed')));delete _0x790541[_0xc0ac('0x22')][_0x57d3ef];}}else{return _0x790541[_0xc0ac('0x168')](_0x394494,_0x59d2ae);}}else{if(getDiff(_0x59d2ae[_0xc0ac('0x1ef')])<_0x394494[_0xc0ac('0x1f0')]*0x3c){if(_0x59d2ae[_0xc0ac('0x15a')]&&!_0x59d2ae[_0xc0ac('0x15a')][_0xc0ac('0x1f1')]){_0x790541['preview'][_0xc0ac('0x130')](_0x59d2ae['id'])['finally'](function(){_0x790541[_0xc0ac('0xb3')](_0x394494);});}else{_0x790541[_0xc0ac('0xc2')]({'active':![]},_0x59d2ae['id'],0x1)[_0xc0ac('0x1a')](function(){_0x790541[_0xc0ac('0xb3')](_0x394494);});}}else{_0x394494[_0xc0ac('0x64')]+=0x1;_0x790541['updateOriginated'](_0x394494);if(_0x394494[_0xc0ac('0x1f2')]){_0x790541[_0xc0ac('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59d2ae['ContactId'],'ListId':_0x59d2ae[_0xc0ac('0xd5')],'VoiceQueueId':_0x59d2ae[_0xc0ac('0xd7')]||undefined,'CampaignId':_0x59d2ae[_0xc0ac('0xd8')]||undefined})[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1f3')));_0x790541[_0xc0ac('0xcd')](createObjHistory(_0x394494,_0x59d2ae,'RECALLINQUEUE',0x17,_0xc0ac('0x1f4')))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x1f5')));}else{_0x790541[_0xc0ac('0xd3')](createObjHistory(_0x394494,_0x59d2ae,_0xc0ac('0x1f6'),0x16,_0xc0ac('0x1f7')),_0xc0ac('0x1f8'),_0xc0ac('0x1f9'));}}}}else{_0x394494['outboundBlacklistCallsDay']+=0x1;_0x790541[_0xc0ac('0xd3')](createObjHistory(_0x394494,_0x59d2ae,_0xc0ac('0x1fa'),0xd,'Blacklist'),_0xc0ac('0x1fb'),_0xc0ac('0x1fc'));throw _0xc0ac('0x1fd');}};};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1fe')]=function(_0xf3bbd){var _0x25feed=this;var _0x2da7c2=_0xf3bbd[_0xc0ac('0x1ff')]-_0xf3bbd['originated']-_0xf3bbd['temp'];emitCampaignSummary(_0xf3bbd);if(_0x2da7c2>0x0){if(_0x2da7c2>this[_0xc0ac('0x20')]){_0x2da7c2=this['maxNumberOriginate'];}_0xf3bbd['temp']+=_0x2da7c2;this[_0xc0ac('0xc7')](_0xf3bbd['id'],_0x2da7c2,_0xf3bbd['dialOrderByScheduledAt'],_0xf3bbd)[_0xc0ac('0x3e')](function(_0x387973){_0xf3bbd['temp']-=_0x2da7c2;_0xf3bbd['temp']=_0xf3bbd[_0xc0ac('0xc5')]>0x0?_0xf3bbd[_0xc0ac('0xc5')]:0x0;if(!checkContactEmpty(_0x387973)){_0xf3bbd[_0xc0ac('0x42')]=_0xc0ac('0x9d');logger[_0xc0ac('0x7b')](_0xc0ac('0x200')+_0xf3bbd[_0xc0ac('0x44')]);}else{_0xf3bbd['originated']+=_0x387973[_0xc0ac('0x96')];_0xf3bbd[_0xc0ac('0x42')]=_0xc0ac('0x201');for(var _0x1ed03e=0x0;_0x1ed03e<_0x387973[_0xc0ac('0x96')];_0x1ed03e+=0x1){_0xf3bbd[_0xc0ac('0x202')]+=0x1;if(_[_0xc0ac('0xaf')](_0x387973[_0x1ed03e])||_['isNil'](_0x387973[_0x1ed03e]['Contact'])||_[_0xc0ac('0xaf')](_0x387973[_0x1ed03e][_0xc0ac('0x16b')][_0xc0ac('0x16c')])){_0x25feed[_0xc0ac('0x203')](_0xc0ac('0x204'),_0xf3bbd,_0x387973[_0x1ed03e]);}else{_0x25feed[_0xc0ac('0xbd')](_[_0xc0ac('0x12f')](_0x387973[_0x1ed03e],[_0xc0ac('0xd8'),'Contact.phone']))[_0xc0ac('0x3e')](_0x25feed[_0xc0ac('0x1e7')](_0xf3bbd,_0x387973[_0x1ed03e]))[_0xc0ac('0xba')](_0x25feed['loggerHandler'](_0xc0ac('0x205'),_0xf3bbd));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0xf3bbd,_0x2da7c2));}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x155')]=function(_0x2ce3b1,_0xfc47ca){var _0x27c094=this;var _0x2a39a9=[];var _0x4826f9=_0xfc47ca>=0x1?_0xfc47ca:0x1;if(_0x2ce3b1[_0xc0ac('0x5c')]===_0xc0ac('0x8')){_0x4826f9=0x1;}var _0x1bdab9=Math[_0xc0ac('0x1c7')](_0x2ce3b1[_0xc0ac('0x51')]*_0x4826f9)-_0x2ce3b1[_0xc0ac('0x71')]-_0x2ce3b1[_0xc0ac('0xc5')];emitVoiceQueueSummary(_0x2ce3b1);if(_0x2ce3b1[_0xc0ac('0x206')]>0x0){var _0x148d5e=_0x2ce3b1[_0xc0ac('0x206')]-_0x2ce3b1[_0xc0ac('0x71')]-_0x2ce3b1[_0xc0ac('0xa0')]-_0x2ce3b1['temp']-_0x2ce3b1[_0xc0ac('0x52')];if(_0x1bdab9>_0x148d5e){_0x1bdab9=_0x148d5e;}}if(_0x1bdab9>0x0){if(_0x2ce3b1[_0xc0ac('0x5c')]===_0xc0ac('0x8')){_0x1bdab9=0x1;}if(_0x1bdab9>this[_0xc0ac('0x20')]){_0x1bdab9=this[_0xc0ac('0x20')];}_0x2ce3b1[_0xc0ac('0xc5')]+=_0x1bdab9;for(var _0x459296 in this[_0xc0ac('0x1e')]){if(typeof this[_0xc0ac('0x1e')][_0x459296]!==_0xc0ac('0x97')){if(this[_0xc0ac('0x1e')][_0x459296][_0xc0ac('0xa7')]===_0xc0ac('0x207')&&this[_0xc0ac('0x1e')][_0x459296][_0xc0ac('0xb1')]==='reachable'){_0x2a39a9[_0xc0ac('0x12a')](this['agents'][_0x459296]['id']);}}}this[_0xc0ac('0xc4')](_0x2ce3b1['id'],_0x2a39a9,_0x1bdab9,_0x2ce3b1[_0xc0ac('0x208')],_0x2ce3b1)[_0xc0ac('0x3e')](function(_0x508117){_0x2ce3b1[_0xc0ac('0xc5')]-=_0x1bdab9;_0x2ce3b1['temp']=_0x2ce3b1[_0xc0ac('0xc5')]>0x0?_0x2ce3b1[_0xc0ac('0xc5')]:0x0;if(!checkContactEmpty(_0x508117)){_0x27c094[_0xc0ac('0xb9')](_0x2ce3b1)[_0xc0ac('0x3e')](sendMessageReschedule(_0x2ce3b1))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x209')));}else{_0x2ce3b1[_0xc0ac('0x71')]+=_0x508117[_0xc0ac('0x96')];_0x2ce3b1['message']=_0x2ce3b1['dialMethod']==='booked'?_0xc0ac('0x175'):'RUNNING';for(var _0x1eae0c=0x0;_0x1eae0c<_0x508117['length'];_0x1eae0c+=0x1){if(_[_0xc0ac('0xaf')](_0x508117[_0x1eae0c])||_[_0xc0ac('0xaf')](_0x508117[_0x1eae0c][_0xc0ac('0x16b')])||_['isNil'](_0x508117[_0x1eae0c]['Contact']['phone'])){_0x27c094[_0xc0ac('0x203')]('[actionOriginate]\x20',_0x2ce3b1,_0x508117[_0x1eae0c]);}else{_0x27c094[_0xc0ac('0xbb')](_[_0xc0ac('0x12f')](_0x508117[_0x1eae0c],[_0xc0ac('0xd7'),'Contact.phone']))['then'](_0x27c094[_0xc0ac('0x1e7')](_0x2ce3b1,_0x508117[_0x1eae0c]))[_0xc0ac('0xba')](_0x27c094[_0xc0ac('0xd1')](_0xc0ac('0x204'),_0x2ce3b1));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x2ce3b1,_0x1bdab9));}};Dialer['prototype'][_0xc0ac('0x8e')]=function(_0x4392f3){if(_0x4392f3[_0xc0ac('0x206')]>0x0){var _0x2d75d9=_0x4392f3[_0xc0ac('0x206')]-_0x4392f3[_0xc0ac('0x71')]-_0x4392f3[_0xc0ac('0xa0')];if(_0x2d75d9>0x0){this['tryOriginatePredictive'](_0x4392f3);}else{loggerPredictiveCalls[_0xc0ac('0x7b')](_0xc0ac('0x20a'));}}else{this[_0xc0ac('0x20b')](_0x4392f3);}};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x20b')]=function(_0x5842b1){var _0x27ee4f=this;var _0x7fb6a=[];_0x5842b1[_0xc0ac('0x71')]+=0x1;for(var _0x13551f in this[_0xc0ac('0x1e')]){if(typeof this[_0xc0ac('0x1e')][_0x13551f]!=='undefined'){if(this[_0xc0ac('0x1e')][_0x13551f]['state']==='not_inuse'&&this[_0xc0ac('0x1e')][_0x13551f][_0xc0ac('0xb1')]===_0xc0ac('0xde')){_0x7fb6a['push'](this[_0xc0ac('0x1e')][_0x13551f]['id']);}}}this[_0xc0ac('0xc4')](_0x5842b1['id'],_0x7fb6a,0x1,_0x5842b1[_0xc0ac('0x208')],_0x5842b1)['then'](function(_0x540abc){if(!checkContactEmpty(_0x540abc)){checkContactLowerLimitOriginate(_0x5842b1,0x1,0x0);_0x27ee4f[_0xc0ac('0xb9')](_0x5842b1)[_0xc0ac('0x3e')](sendMessageReschedule(_0x5842b1))[_0xc0ac('0xba')](loggerCatch(_0xc0ac('0x209')));}else{_0x5842b1[_0xc0ac('0x42')]=_0xc0ac('0x201');if(_[_0xc0ac('0xaf')](_0x540abc[0x0])||_[_0xc0ac('0xaf')](_0x540abc[0x0][_0xc0ac('0x16b')])||_[_0xc0ac('0xaf')](_0x540abc[0x0]['Contact']['phone'])){_0x27ee4f[_0xc0ac('0x203')](_0xc0ac('0x204'),_0x5842b1,_0x540abc[0x0]);}else{_0x27ee4f[_0xc0ac('0xbb')](_[_0xc0ac('0x12f')](_0x540abc[0x0],[_0xc0ac('0xd7'),_0xc0ac('0x20c')]))[_0xc0ac('0x3e')](_0x27ee4f['checkContactBlack'](_0x5842b1,_0x540abc[0x0]))['catch'](_0x27ee4f['loggerHandler'](_0xc0ac('0x20d'),_0x5842b1));}}})['catch'](loggerGetContactDialer(_0xc0ac('0x20e'),_0x5842b1,0x1));emitVoiceQueueSummary(_0x5842b1);};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1dc')]=function(_0x22b2b4,_0x24ce60,_0xad6051,_0x361eef,_0x3745b5,_0x3b8007){loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x20f'));loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x210'),_0x22b2b4);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x211'),_0x24ce60);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x212'),_0xad6051);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x213'),_0x361eef);loggerPredictive[_0xc0ac('0x7b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3745b5);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x8a'));return new BPromise(function(_0x41b897,_0x550fd5){if(_0x22b2b4<=0x0||isNaN(_0x22b2b4)){return _0x550fd5(msgResponse('[abandonmentRate]',_0xc0ac('0x4a'),_0xc0ac('0x214')+_0x22b2b4));}if(_0xad6051<=0x0||isNaN(_0xad6051)){return _0x550fd5(msgResponse(_0xc0ac('0x215'),_0xc0ac('0x4a'),_0xc0ac('0x216')+_0xad6051));}if(_0x361eef<=0x0||isNaN(_0x361eef)){return _0x550fd5(msgResponse('[abandonmentRate]',_0xc0ac('0x4a'),_0xc0ac('0x217')+_0x361eef));}if(_0x24ce60<=0x0||isNaN(_0x24ce60)){return _0x550fd5(msgResponse(_0xc0ac('0x215'),'Error','interval\x20=\x20'+_0x24ce60));}if(_0x3745b5<=0x0||isNaN(_0x3745b5)){return _0x550fd5(msgResponse(_0xc0ac('0x215'),_0xc0ac('0x4a'),_0xc0ac('0x218')+_0x3745b5));}_0x3b8007=_0x3b8007||0x0;var _0x74cc33=0x1/_0xad6051;var _0x233c01=0x0;var _0x4ad574=0x0;var _0x6d7fe6=0x0;var _0x527f98=0x0;for(var _0x1535b5=0x0;_0x6d7fe6<_0x3745b5;_0x1535b5+=0x1){_0x4ad574=_0x1535b5/_0x24ce60;_0x233c01=(_0x361eef*_0x4ad574+_0x3b8007)/_0x74cc33;_0x6d7fe6=erlangb(_0x233c01,_0x22b2b4);_0x527f98=_0x233c01/_0x22b2b4*(0x1-erlangb(_0x233c01,_0x22b2b4));}return _0x41b897({'erlangCalls':_0x1535b5,'erlangCallToSecond':_0x24ce60/_0x1535b5,'erlangAbandonmentRate':_0x6d7fe6,'erlangBusyFactor':_0x527f98});});};Dialer[_0xc0ac('0xb7')][_0xc0ac('0x1dd')]=function(_0xbbb546,_0x209c5e,_0x14ce27,_0x324f85,_0x38eba2,_0x556f94){loggerPredictive[_0xc0ac('0x7b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x210'),_0xbbb546);loggerPredictive[_0xc0ac('0x7b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x209c5e);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x212'),_0x14ce27);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x213'),_0x324f85);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x219'),_0x38eba2);loggerPredictive[_0xc0ac('0x7b')](_0xc0ac('0x8a'));return new BPromise(function(_0x2e9e26,_0x371cda){if(_0xbbb546<=0x0||isNaN(_0xbbb546)){return _0x371cda(msgResponse(_0xc0ac('0x21a'),_0xc0ac('0x4a'),_0xc0ac('0x214')+_0xbbb546));}if(_0x14ce27<=0x0||isNaN(_0x14ce27)){return _0x371cda(msgResponse(_0xc0ac('0x21a'),_0xc0ac('0x4a'),_0xc0ac('0x216')+_0x14ce27));}if(_0x324f85<=0x0||isNaN(_0x324f85)){return _0x371cda(msgResponse(_0xc0ac('0x21a'),_0xc0ac('0x4a'),_0xc0ac('0x217')+_0x324f85));}if(_0x209c5e<=0x0||isNaN(_0x209c5e)){return _0x371cda(msgResponse(_0xc0ac('0x21a'),_0xc0ac('0x4a'),_0xc0ac('0x21b')+_0x209c5e));}if(_0x38eba2<=0x0||isNaN(_0x38eba2)){return _0x371cda(msgResponse(_0xc0ac('0x21a'),_0xc0ac('0x4a'),_0xc0ac('0x21c')+_0x38eba2));}_0x556f94=_0x556f94||0x0;var _0x3bbc13=0x1/_0x14ce27;var _0x51cef5=0x0;var _0x39a4ab=0x0;var _0x402222=0x0;var _0x5d7bf6=0x0;for(var _0x178902=0x0;_0x5d7bf6<_0x38eba2;_0x178902+=0x1){_0x39a4ab=_0x178902/_0x209c5e;_0x51cef5=(_0x324f85*_0x39a4ab+_0x556f94)/_0x3bbc13;_0x402222=erlangb(_0x51cef5,_0xbbb546);_0x5d7bf6=_0x51cef5/_0xbbb546*(0x1-erlangb(_0x51cef5,_0xbbb546));}return _0x2e9e26({'erlangCalls':_0x178902,'erlangCallToSecond':_0x209c5e/_0x178902,'erlangAbandonmentRate':_0x402222,'erlangBusyFactor':_0x5d7bf6});});};module[_0xc0ac('0x21d')]=Dialer; \ No newline at end of file +var _0xc920=['countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','floor','erlangAbandonmentRate','[startMethodPredictive][StartProgressive]','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','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','[CatchErlangB]','outboundQueuePauses','predictiveIntervalPauses','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','inBlackList','limitCalls','maxNumberOriginate','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','MACHINE','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','true','indexOf','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','checkPreviewRecallReminder','[syncCampaigns]','\x5cw{0,','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','Error','getQueue','callProgressDetecting','checkRetriveMax'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xc920,0x7c));var _0x0c92=function(_0x4e2272,_0x2e1ae0){_0x4e2272=_0x4e2272-0x0;var _0x45511c=_0xc920[_0x4e2272];return _0x45511c;};'use strict';var util=require(_0x0c92('0x0'));var _=require('lodash');var BPromise=require(_0x0c92('0x1'));var uuid=require(_0x0c92('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x0c92('0x3'));var Redis=require(_0x0c92('0x4'));var ut=require(_0x0c92('0x5'));var config=require(_0x0c92('0x6'));var logger=require(_0x0c92('0x7'))(_0x0c92('0x8'));var loggerBooked=require(_0x0c92('0x7'))(_0x0c92('0x9'));var loggerPredictive=require(_0x0c92('0x7'))('predictive');var loggerPredictiveCalls=require(_0x0c92('0x7'))(_0x0c92('0xa'));var loggerSyncQueueSummary=require(_0x0c92('0x7'))(_0x0c92('0xb'));var ami=require('../ami');config[_0x0c92('0xc')]=_[_0x0c92('0xd')](config[_0x0c92('0xc')],{'host':_0x0c92('0xe'),'port':0x18eb});var io=require(_0x0c92('0xf'))(new Redis(config[_0x0c92('0xc')]));var cmHopper=require(_0x0c92('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0c92('0x11'));var voiceQueueRt=require(_0x0c92('0x12'));var RpcSetting=require(_0x0c92('0x13'));var Action=require(_0x0c92('0x14'));var History=require(_0x0c92('0x15'));var Final=require(_0x0c92('0x16'));var AgentComplete=require(_0x0c92('0x17'));var QueueCallerAbandon=require(_0x0c92('0x18'));var Hangup=require(_0x0c92('0x19'));var ipAgi=process['env'][_0x0c92('0x1a')]||_0x0c92('0x1b');var strategy={'rrmemory':_0x0c92('0x1c'),'roundrobin':_0x0c92('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0c92('0x1e')][_0x0c92('0x1f')]=function(_0x28a39b){this[_0x0c92('0x20')]=this['tail']?this[_0x0c92('0x20')][_0x0c92('0x21')](_0x28a39b):_0x28a39b();};function Dialer(_0x611ef2,_0x44272e){this[_0x0c92('0x22')]=new Sequence();this[_0x0c92('0x23')]=_0x44272e;this[_0x0c92('0x24')]=_0x611ef2[_0x0c92('0x24')];this[_0x0c92('0x25')]=_0x611ef2[_0x0c92('0x25')];this[_0x0c92('0x26')]=_0x611ef2[_0x0c92('0x26')];this['trunks']=_0x611ef2[_0x0c92('0x27')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x0c92('0x28')]={};this[_0x0c92('0x29')]={};this['contactsId']={};this[_0x0c92('0x2a')]={};this[_0x0c92('0x2b')]={};this[_0x0c92('0x2c')]={};this['startProgressive']={};this[_0x0c92('0x2d')]={};this[_0x0c92('0x2e')]={};this[_0x0c92('0x2f')]={};ami['on'](_0x0c92('0x30'),this['syncAgentConnect'][_0x0c92('0x31')](this));ami['on']('queuecallerabandon',this[_0x0c92('0x32')][_0x0c92('0x31')](this));ami['on']('originateresponse',this[_0x0c92('0x33')][_0x0c92('0x31')](this));ami['on'](_0x0c92('0x34'),this[_0x0c92('0x35')][_0x0c92('0x31')](this));ami['on'](_0x0c92('0x36'),this[_0x0c92('0xb')]['bind'](this));ami['on'](_0x0c92('0x37'),this[_0x0c92('0x38')][_0x0c92('0x31')](this));ami['on'](_0x0c92('0x39'),this[_0x0c92('0x3a')]['bind'](this));ami['on'](_0x0c92('0x3b'),this[_0x0c92('0x3c')]['bind'](this));ami['on'](_0x0c92('0x3d'),this[_0x0c92('0x3e')][_0x0c92('0x31')](this));ami['on'](_0x0c92('0x3f'),this[_0x0c92('0x40')][_0x0c92('0x31')](this));this['loopCampaigns']();this[_0x0c92('0x41')]();RpcSetting['getSettings']()[_0x0c92('0x42')](function(_0x1be47d){previewRecallmeReminderInterval=_0x1be47d[_0x0c92('0x43')];});}function isNotNull(_0x3523a7){return _0x3523a7!==null&&!_[_0x0c92('0x44')](_0x3523a7);}function checkIsLoggedIn(_0x3b9741,_0x2627f6){return function(){if(_0x2627f6<=0x0){_0x3b9741['message']=_0x0c92('0x45');throw _0x3b9741[_0x0c92('0x46')]+_0x0c92('0x47');}};}function isActive(_0x5eb9e4){return _0x5eb9e4;}function checkIsActive(_0x57863f,_0xab4667){return function(){if(!isActive(_0xab4667)){_0x57863f[_0x0c92('0x48')]='NOT_ACTIVE';throw _0x57863f[_0x0c92('0x46')]+_0x0c92('0x49');}};}function checkInterval(_0x227532){return function(){if(!isNotNull(_0x227532[_0x0c92('0x4a')])){_0x227532[_0x0c92('0x48')]=_0x0c92('0x4b');throw _0x227532['name']+_0x0c92('0x4c');}if(!isNotNull(_0x227532[_0x0c92('0x4a')][_0x0c92('0x4d')])){_0x227532[_0x0c92('0x48')]=_0x0c92('0x4b');throw _0x227532[_0x0c92('0x46')]+_0x0c92('0x4c');}if(!isNotNull(_[_0x0c92('0x4e')](_0x227532['Interval']['Intervals']))){_0x227532[_0x0c92('0x48')]=_0x0c92('0x4b');throw _0x227532[_0x0c92('0x46')]+_0x0c92('0x4c');}};}function msgResponse(_0x384ea5,_0x2446e4,_0x314f49){return{'action':_0x384ea5,'response':_0x2446e4,'message':_0x314f49,'stack':_0x314f49};}function myreject(_0x36c35e){return function(_0x119795){return _0x36c35e(msgResponse(_0x0c92('0x4f'),'Error',JSON[_0x0c92('0x50')](_0x119795)));};}function getSeconds(_0x232829,_0x45c04a){var _0x55a2d7=moment(_0x232829)[_0x0c92('0x51')](0x0);var _0x4fffbc=moment(_0x45c04a)[_0x0c92('0x51')](0x0);return _0x55a2d7[_0x0c92('0x52')](_0x4fffbc,_0x0c92('0x53'));}function emit(_0x59566c,_0xb6df15,_0xf0b127){io['to'](_0x59566c)[_0x0c92('0x54')](_0xb6df15,_0xf0b127);}function emitVoiceQueueSummary(_0x3dddc3){if(_0x3dddc3[_0x0c92('0x55')]===_0x0c92('0x56')){var _0x1aaa7a={'id':_0x3dddc3['id'],'name':_0x3dddc3[_0x0c92('0x46')],'strategy':_0x3dddc3[_0x0c92('0x57')],'answered':_0x3dddc3['answered'],'available':_0x3dddc3[_0x0c92('0x58')],'loggedIn':_0x3dddc3['loggedIn'],'pTalking':_0x3dddc3[_0x0c92('0x59')],'sumBillable':_0x3dddc3[_0x0c92('0x5a')],'sumDuration':_0x3dddc3[_0x0c92('0x5b')],'sumHoldTime':_0x3dddc3[_0x0c92('0x5c')]||0x0,'talking':_0x3dddc3['talking'],'total':_0x3dddc3[_0x0c92('0x5d')],'type':_0x3dddc3[_0x0c92('0x55')],'unmanaged':_0x3dddc3[_0x0c92('0x5e')],'abandoned':_0x3dddc3[_0x0c92('0x5f')],'waiting':_0x3dddc3[_0x0c92('0x60')],'loggedInDb':_0x3dddc3[_0x0c92('0x61')],'dialActive':_0x3dddc3[_0x0c92('0x62')],'dialMethod':_0x3dddc3[_0x0c92('0x63')],'dialOriginateCallerIdName':_0x3dddc3[_0x0c92('0x64')],'dialOriginateCallerIdNumber':_0x3dddc3['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3dddc3[_0x0c92('0x65')],'dialPrefix':_0x3dddc3[_0x0c92('0x66')],'outboundAnswerAgiCallsDay':_0x3dddc3[_0x0c92('0x67')],'outboundAnswerCallsDay':_0x3dddc3[_0x0c92('0x68')],'outboundBlacklistCallsDay':_0x3dddc3[_0x0c92('0x69')],'outboundBusyCallsDay':_0x3dddc3[_0x0c92('0x6a')],'outboundCongestionCallsDay':_0x3dddc3['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3dddc3['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3dddc3[_0x0c92('0x6b')],'outboundDropCallsDayTimeout':_0x3dddc3['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3dddc3[_0x0c92('0x6c')],'outboundNoSuchCallsDay':_0x3dddc3[_0x0c92('0x6d')],'outboundOriginateFailureCallsDay':_0x3dddc3[_0x0c92('0x6e')],'outboundReCallsDay':_0x3dddc3[_0x0c92('0x6f')],'outboundRejectCallsDay':_0x3dddc3[_0x0c92('0x70')],'outboundUnknownCallsDay':_0x3dddc3[_0x0c92('0x71')],'predictiveIntervalAnsweredCalls':_0x3dddc3[_0x0c92('0x72')],'predictiveIntervalAvgHoldtime':_0x3dddc3[_0x0c92('0x73')],'predictiveIntervalAvgTalktime':_0x3dddc3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3dddc3[_0x0c92('0x74')],'predictiveIntervalDroppedCallsTimeout':_0x3dddc3[_0x0c92('0x75')],'predictiveIntervalErlangCalls':_0x3dddc3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3dddc3[_0x0c92('0x76')],'predictiveIntervalHitRate':_0x3dddc3[_0x0c92('0x77')],'predictiveIntervalMultiplicativeFactor':_0x3dddc3['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3dddc3['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3dddc3[_0x0c92('0x78')],'predictiveIntervalTotalCalls':_0x3dddc3[_0x0c92('0x79')],'message':_0x3dddc3[_0x0c92('0x48')],'originated':_0x3dddc3[_0x0c92('0x7a')],'erlangCalls':_0x3dddc3[_0x0c92('0x7b')],'erlangCallToSecond':_0x3dddc3[_0x0c92('0x7c')],'erlangAbandonmentRate':_0x3dddc3['erlangAbandonmentRate'],'erlangBusyFactor':_0x3dddc3[_0x0c92('0x7d')],'startPredictive':_0x3dddc3['startPredictive'],'startProgressive':_0x3dddc3[_0x0c92('0x7e')]};if(_0x3dddc3[_0x0c92('0x7f')]){_0x1aaa7a[_0x0c92('0x7f')]={'id':_0x3dddc3[_0x0c92('0x7f')]['id'],'name':_0x3dddc3[_0x0c92('0x7f')][_0x0c92('0x46')],'active':_0x3dddc3[_0x0c92('0x7f')][_0x0c92('0x80')],'callerid':_0x3dddc3[_0x0c92('0x7f')][_0x0c92('0x81')]};}if(_0x3dddc3[_0x0c92('0x4a')]){_0x1aaa7a[_0x0c92('0x4a')]={'id':_0x3dddc3[_0x0c92('0x4a')]['id'],'name':_0x3dddc3[_0x0c92('0x4a')]['name']};}var _0x3a9653=md5(JSON[_0x0c92('0x50')](_0x1aaa7a));if(_0x3dddc3[_0x0c92('0x3')]!==_0x3a9653){_0x3dddc3[_0x0c92('0x3')]=_0x3a9653;emit(util[_0x0c92('0x82')](_0x0c92('0x83'),_0x1aaa7a[_0x0c92('0x46')]),_0x0c92('0x84'),_0x1aaa7a);}}}function emitCampaignSummary(_0x1d8a4a){if(_0x1d8a4a['type']===_0x0c92('0x85')){emit(util['format'](_0x0c92('0x86'),_0x1d8a4a[_0x0c92('0x46')]),_0x0c92('0x87'),_0x1d8a4a);}}function checkGetDataPredictive(_0x194940){if(isNotNull(_0x194940)&&!_[_0x0c92('0x4e')](_0x194940)){loggerPredictive[_0x0c92('0x88')](_0x0c92('0x89'));loggerPredictive[_0x0c92('0x88')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x194940[_0x0c92('0x79')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x8a'),_0x194940[_0x0c92('0x72')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x8b'),_0x194940[_0x0c92('0x75')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x8c'),_0x194940[_0x0c92('0x74')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x8d'),_0x194940[_0x0c92('0x73')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x8e'),_0x194940[_0x0c92('0x8f')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x90'));if(_0x194940[_0x0c92('0x79')]>0x0){if(!_[_0x0c92('0x44')](_0x194940['predictiveIntervalAvgTalktime'])&&_0x194940[_0x0c92('0x8f')]>0x0){return!![];}loggerPredictive[_0x0c92('0x88')](_0x0c92('0x91'));if(!_[_0x0c92('0x44')](_0x194940['predictiveIntervalAvgHoldtime'])&&_0x194940[_0x0c92('0x73')]>0x0){return!![];}loggerPredictive[_0x0c92('0x88')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x0c92('0x88')](_0x0c92('0x92'));}}else{loggerPredictive[_0x0c92('0x88')](_0x0c92('0x93'));}return![];}function mergeDataErlangB(_0x39a1c7){return function(_0x3f71ce){loggerPredictive[_0x0c92('0x88')](_0x0c92('0x94'));loggerPredictive['info'](_0x0c92('0x95'),_0x3f71ce[_0x0c92('0x7b')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x96'),_0x3f71ce[_0x0c92('0x7c')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f71ce['erlangAbandonmentRate']);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x97'),_0x3f71ce[_0x0c92('0x7d')]);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x98'),_0x3f71ce['erlangAbandonmentRate']);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x90'));_[_0x0c92('0x99')](_0x39a1c7,_0x3f71ce);};}function getDiff(_0x2e9294){var _0x339ce7=moment()['milliseconds'](0x0);var _0x8ca6b3=moment(_0x2e9294)['milliseconds'](0x0);return _0x339ce7[_0x0c92('0x52')](_0x8ca6b3,'seconds');}function ifInterval(_0x21dd1d,_0x4ba184){if(_['isUndefined'](_0x4ba184)){return![];}return getDiff(_0x4ba184)<_0x21dd1d*0x3c;}function freeVariablesPredictive(_0x30e1bd){if(isNotNull(_0x30e1bd)){if(!_['isUndefined'](_0x30e1bd['startProgressive'])){_0x30e1bd[_0x0c92('0x7e')]=undefined;loggerPredictive[_0x0c92('0x88')](_0x30e1bd[_0x0c92('0x46')],_0x0c92('0x9a'));}if(!_[_0x0c92('0x44')](_0x30e1bd[_0x0c92('0x2c')])){_0x30e1bd['startPredictive']=undefined;loggerPredictive[_0x0c92('0x88')](_0x30e1bd[_0x0c92('0x46')],_0x0c92('0x9b'));}if(!_['isUndefined'](_0x30e1bd[_0x0c92('0x9c')])){clearInterval(_0x30e1bd['handlePredictive']);_0x30e1bd[_0x0c92('0x9c')]=undefined;loggerPredictive['info'](_0x30e1bd[_0x0c92('0x46')],_0x0c92('0x9d'));}}}function erlangb(_0x43ea20,_0x1db6f7){if(_0x1db6f7===0x0){return 0x0;}var _0x2aa40a=0x1;for(var _0xb9021a=0x1;_0xb9021a<=_0x1db6f7;_0xb9021a+=0x1){_0x2aa40a=0x1+_0x2aa40a*_0xb9021a/_0x43ea20;}return 0x1/_0x2aa40a;}function isVoiceQueueOutbound(_0x3229c2){return _0x3229c2===_0x0c92('0x56');}function isNotPreview(_0x23184d){return _0x23184d!==_0x0c92('0x23');}function isCampaignIvr(_0x1d669b){return _0x1d669b===_0x0c92('0x85');}function getCallerId(_0x14061b,_0x2b6bdc,_0x56c324){if(!_[_0x0c92('0x44')](_0x56c324)&&typeof _0x56c324===_0x0c92('0x9e')&&!_[_0x0c92('0x4e')](_0x56c324)){if(!_['isUndefined'](_0x2b6bdc)&&typeof _0x2b6bdc===_0x0c92('0x9e')&&!_[_0x0c92('0x4e')](_0x2b6bdc)){return util[_0x0c92('0x82')](_0x0c92('0x9f'),_0x2b6bdc,_0x56c324);}return util[_0x0c92('0x82')](_0x0c92('0x9f'),_0x56c324,_0x56c324);}if(!_['isUndefined'](_0x14061b)&&typeof _0x14061b===_0x0c92('0x9e')&&!_[_0x0c92('0x4e')](_0x14061b)){return _0x14061b;}return _0x0c92('0xa0');}function loggerCatchQueueSummary(_0x87ffdd,_0x461426){return function(_0x38d304){freeVariablesPredictive(_0x461426);emitVoiceQueueSummary(_0x461426);emitCampaignSummary(_0x461426);loggerSyncQueueSummary[_0x0c92('0xa1')](_0x87ffdd,util[_0x0c92('0xa2')](_0x38d304,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2bb29f,_0x580de5){return function(_0x5aa725){loggerPredictive[_0x0c92('0xa1')](_0x580de5[_0x0c92('0x46')],_0x2bb29f);loggerPredictive['error'](_0x5aa725[_0x0c92('0xa3')]);freeVariablesPredictive(_0x580de5);};}function loggerCatch(_0x2e9de9){return function(_0x324246){logger['error'](_0x2e9de9,util[_0x0c92('0xa2')](_0x324246,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x237b33){return _0x237b33&&!_[_0x0c92('0x44')](_0x237b33)&&_0x237b33[_0x0c92('0xa4')]>0x0;}function decremetOriginate(_0x240e90){if(!_['isUndefined'](_0x240e90)&&_0x240e90!==null){if(typeof _0x240e90[_0x0c92('0x7a')]!==_0x0c92('0xa5')){if(_0x240e90[_0x0c92('0x7a')]>0x0){_0x240e90[_0x0c92('0x7a')]-=0x1;}else{logger[_0x0c92('0xa1')](_0x0c92('0xa6'));}}}else{logger['error'](_0x0c92('0xa7'));}}function checkContactLowerLimitOriginate(_0x5f0a40,_0x2c134f,_0x3d3a0f){if(_0x2c134f>_0x3d3a0f){for(var _0x40737a=0x0;_0x40737a<_0x2c134f-_0x3d3a0f;_0x40737a+=0x1){decremetOriginate(_0x5f0a40);}}}function loggerGetContactDialer(_0x1aa8db,_0x449854,_0xa23692){return function(_0x3deb08){checkContactLowerLimitOriginate(_0x449854,_0xa23692,0x0);logger['error'](_0x1aa8db,util['inspect'](_0x3deb08,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1aa3f8){return function(_0x2cdabd){if(isNotNull(_0x2cdabd)&&isNotNull(_0x2cdabd[0x0])){if(_0x2cdabd[0x0][_0x0c92('0xa8')]>0x0){_0x1aa3f8[_0x0c92('0x48')]=_0x0c92('0xa9');logger[_0x0c92('0x88')](_0x0c92('0xaa')+_0x1aa3f8['name'],_0x2cdabd[0x0]['contactsRescheduled'],_0x0c92('0xab'));}else{_0x1aa3f8[_0x0c92('0x48')]=_0x0c92('0xac');logger['info'](_0x0c92('0xad')+_0x1aa3f8[_0x0c92('0x46')]);}}};}function notSendMessagesQueue(_0x222591){if(_0x222591[_0x0c92('0xae')]){freeVariablesPredictive(_0x222591);if(_0x222591[_0x0c92('0x7a')]===0x0&&_0x222591[_0x0c92('0xaf')]===0x0&&_0x222591[_0x0c92('0x60')]===0x0&&(_0x222591[_0x0c92('0x59')]||0x0)===0x0){_0x222591['sendMessageOneNotActive']=![];_0x222591[_0x0c92('0x58')]=0x0;_0x222591[_0x0c92('0x48')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0c92('0xa1')](_0x0c92('0xb0'),_0x222591[_0x0c92('0x46')],_0x0c92('0xb1'));}else{_0x222591[_0x0c92('0x48')]=_0x0c92('0xb2');loggerSyncQueueSummary['error'](_0x0c92('0xb0'),_0x222591[_0x0c92('0x46')],_0x0c92('0xb3'));}emitVoiceQueueSummary(_0x222591);}}function notSendMessagesCampaign(_0x2298cd){if(_0x2298cd[_0x0c92('0xae')]){if(_0x2298cd[_0x0c92('0x7a')]===0x0){_0x2298cd[_0x0c92('0xae')]=![];_0x2298cd[_0x0c92('0x48')]=_0x0c92('0xb4');loggerSyncQueueSummary[_0x0c92('0xa1')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2298cd[_0x0c92('0x46')],_0x0c92('0xb1'));}else{_0x2298cd['message']=_0x0c92('0xb2');loggerSyncQueueSummary[_0x0c92('0xa1')](_0x0c92('0xb5'),_0x2298cd[_0x0c92('0x46')],'is\x20disactive');}emitCampaignSummary(_0x2298cd);}}function createObjHistory(_0x253416,_0x12767e,_0x9d9362,_0x402abf,_0x4d0621){_0x253416['message']=_0x9d9362;var _0x3babd0=new Action(_0x253416,_0x12767e);var _0x53bd0=new History(_0x3babd0);_0x53bd0[_0x0c92('0xb6')]=_0x402abf;_0x53bd0[_0x0c92('0xb7')]=_0x4d0621;_0x53bd0[_0x0c92('0xb8')]=_0x3babd0[_0x0c92('0xb9')];return _0x53bd0;}Dialer[_0x0c92('0x1e')][_0x0c92('0x41')]=function(){var _0x47d5d4=this;setInterval(function(){_0x47d5d4[_0x0c92('0xba')](_0x47d5d4[_0x0c92('0x2a')],_0x0c92('0xbb'));_0x47d5d4['clearZombieChannels'](_0x47d5d4[_0x0c92('0x29')],_0x0c92('0xbc'));},0x32c8);};Dialer['prototype'][_0x0c92('0xba')]=function(_0xef9661,_0x455549){var _0x3f0d02=this;for(var _0xc3e63e in _0xef9661){if(typeof _0xef9661[_0xc3e63e]!==_0x0c92('0xa5')){this[_0x0c92('0x22')]['enqueue'](function(){if(!_[_0x0c92('0xbd')](_0xef9661[_0xc3e63e])){return ami[_0x0c92('0xbe')]({'action':_0x0c92('0xbf'),'channel':_0xef9661[_0xc3e63e][_0x0c92('0xc0')]})[_0x0c92('0xc1')](function(_0x4d2261){if(_0x4d2261[_0x0c92('0x48')]===_0x0c92('0xc2')){setTimeout(function(){if(_0xef9661[_0xc3e63e]&&_0xef9661[_0xc3e63e][_0x0c92('0x55')]!=='ivr'){_0x3f0d02[_0x0c92('0xc3')](_0x3f0d02[_0x0c92('0x24')][_0xef9661[_0xc3e63e]['queue']]);logger['error']('[Dialer][checkChannel]',_0x455549,_0xc3e63e,_0xef9661[_0xc3e63e]['queue']);delete _0xef9661[_0xc3e63e];}if(_0xef9661[_0xc3e63e]&&_0xef9661[_0xc3e63e]['type']==='ivr'){_0x3f0d02[_0x0c92('0xc3')](_0x3f0d02[_0x0c92('0x25')][_0xef9661[_0xc3e63e][_0x0c92('0xc4')]]);logger['error'](_0x0c92('0xc5'),_0x455549,_0xc3e63e,_0xef9661[_0xc3e63e][_0x0c92('0xc4')]);delete _0xef9661[_0xc3e63e];}},0x2328);}});}});}}};Dialer[_0x0c92('0x1e')][_0x0c92('0xc6')]=function(_0x5c78e2){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper[_0x0c92('0xc6')](_0x5c78e2))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xc8')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xc9')]=function(_0x260321){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopperBlack[_0x0c92('0xc9')](_0x260321))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xca')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xcb')]=function(_0x4e8316){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopperBlack[_0x0c92('0xcb')](_0x4e8316))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xcc')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xcd')]=function(_0x3c3a50){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopperHistory[_0x0c92('0xce')](_0x3c3a50))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xcf')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xd0')]=function(_0x3aafd1){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper[_0x0c92('0xd0')](_0x3aafd1))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xd1')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xd2')]=function(_0x24e825,_0x20f3d9,_0x2f3fc8){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper['unlockContact'](_0x24e825,_0x20f3d9,_0x2f3fc8))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xd3')));};Dialer[_0x0c92('0x1e')]['getContactDialer']=function(_0x55913f,_0x31394f,_0x674cdf,_0x193fdf,_0x4af12e){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper[_0x0c92('0xd4')](_0x55913f,_0x31394f,_0x674cdf,_0x193fdf))['catch'](function(_0x3d9dc5){_0x4af12e['temp']-=_0x674cdf;_0x4af12e[_0x0c92('0xd5')]=_0x4af12e[_0x0c92('0xd5')]>0x0?_0x4af12e['temp']:0x0;loggerCatch(_0x0c92('0xd6'))(_0x3d9dc5);});};Dialer[_0x0c92('0x1e')]['getContactDialerIvr']=function(_0x517388,_0x49fc08,_0x34b309,_0x1c2411){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper[_0x0c92('0xd7')](_0x517388,_0x49fc08,_0x34b309))['catch'](function(_0x436f7f){_0x1c2411['temp']-=_0x49fc08;_0x1c2411['temp']=_0x1c2411[_0x0c92('0xd5')]>0x0?_0x1c2411[_0x0c92('0xd5')]:0x0;loggerCatch(_0x0c92('0xd8'))(_0x436f7f);});};Dialer['prototype'][_0x0c92('0xd9')]=function(_0x3bbed6){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](voiceQueueRt[_0x0c92('0xd9')](_0x3bbed6))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xda')));};Dialer['prototype'][_0x0c92('0xdb')]=function(_0x320acb){return BPromise['resolve']()['then'](cmHopper[_0x0c92('0xdb')](_0x320acb))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xdc')));};Dialer[_0x0c92('0x1e')][_0x0c92('0xdd')]=function(_0x592c10){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopperHistory['createHistory'](_0x592c10))[_0x0c92('0xc1')](loggerCatch('[createHistory]\x20'));};Dialer[_0x0c92('0x1e')][_0x0c92('0xc3')]=function(_0x125851){if(!_[_0x0c92('0x44')](_0x125851)&&_0x125851!==null){if(typeof _0x125851[_0x0c92('0x7a')]!=='undefined'){if(_0x125851[_0x0c92('0x7a')]>0x0){_0x125851[_0x0c92('0x7a')]-=0x1;}else{logger['error'](_0x0c92('0xde'));}}}else{logger[_0x0c92('0xa1')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x0c92('0x1e')][_0x0c92('0xdf')]=function(_0x54aa0a,_0x468ac2){var _0xa140f0=this;return function(_0x57895d){_0xa140f0[_0x0c92('0xc3')](_0x468ac2);logger[_0x0c92('0xa1')](_0x54aa0a,util['inspect'](_0x57895d,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x512cdc,_0x350eaa,_0x526e75){var _0x5a5e87={'state':0x19,'statedesc':_0x0c92('0xe0')};this[_0x0c92('0xc3')](_0x350eaa);this[_0x0c92('0xe1')](_[_0x0c92('0x99')](_0x5a5e87,_[_0x0c92('0xe2')](_0x526e75,[_0x0c92('0xe3'),_0x0c92('0xe4'),_0x0c92('0xe5'),_0x0c92('0xe6'),_0x0c92('0xe7')])),_0x0c92('0xe8'),'[emptyContact]');logger[_0x0c92('0xa1')](_0x512cdc);};Dialer[_0x0c92('0x1e')]['isSuccess']=function(_0x596d41){return _0x596d41===_0x0c92('0xe9');};Dialer['prototype'][_0x0c92('0xea')]=function(_0x48e4bb){return!_[_0x0c92('0x44')](_0x48e4bb)&&_0x48e4bb&&!_[_0x0c92('0x44')](_0x48e4bb['name'])&&!_[_0x0c92('0x44')](_0x48e4bb[_0x0c92('0x80')])&&_0x48e4bb[_0x0c92('0x80')]&&(this['trunks'][util[_0x0c92('0x82')]('SIP/%s',_0x48e4bb[_0x0c92('0x46')])][_0x0c92('0xbf')]===_0x0c92('0xeb')||this[_0x0c92('0x27')][util[_0x0c92('0x82')](_0x0c92('0xec'),_0x48e4bb[_0x0c92('0x46')])][_0x0c92('0xbf')]===_0x0c92('0xed'));};Dialer['prototype'][_0x0c92('0xe1')]=function(_0x6f3e6c,_0x48a51a,_0x48b094){this[_0x0c92('0xdd')](_0x6f3e6c)[_0x0c92('0xc1')](loggerCatch(_0x48a51a));this[_0x0c92('0xdb')](_0x6f3e6c)['catch'](loggerCatch(_0x48b094));};Dialer[_0x0c92('0x1e')][_0x0c92('0x3c')]=function(_0x4c2bda){var _0x4ec068=this['uniqueId'][_0x4c2bda[_0x0c92('0xee')]];var _0x3c6fd5;if(!_[_0x0c92('0xbd')](_0x4c2bda)&&!_['isNil'](_0x4c2bda[_0x0c92('0xef')])&&!_[_0x0c92('0xbd')](_0x4c2bda[_0x0c92('0xef')][_0x0c92('0xf0')])&&_0x4c2bda['exten']==='xcally-motion-dialer'&&_0x4ec068){if(_0x4ec068[_0x0c92('0x55')]!==_0x0c92('0x85')&&this['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]][_0x0c92('0xf1')]&&_0x4c2bda[_0x0c92('0xf2')]===_0x0c92('0xf3')){delete this[_0x0c92('0x2a')][_0x4c2bda[_0x0c92('0xee')]];this['updateOriginated'](this['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]]);this[_0x0c92('0x24')][_0x4ec068[_0x0c92('0xc4')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c6fd5=new Hangup(_0x4ec068,_0x4c2bda);_0x3c6fd5[_0x0c92('0xb6')]=0x12;_0x3c6fd5[_0x0c92('0xb7')]=_0x0c92('0xf4');_0x3c6fd5[_0x0c92('0xf5')]=_0x0c92('0xf6');ami['emit'](_0x0c92('0xf7'),ut[_0x0c92('0xf8')](_0x3c6fd5,_0x0c92('0xf9')));this[_0x0c92('0xe1')](_0x3c6fd5,_0x0c92('0xfa'),'[syncHangupInAMD]');}if(_0x4ec068['type']!==_0x0c92('0x85')&&this[_0x0c92('0x24')][_0x4ec068[_0x0c92('0xc4')]][_0x0c92('0xf1')]&&_0x4c2bda[_0x0c92('0xf2')]==='MACHINE'){var _0x58cbd2=this;return new BPromise(function(_0x5bee30,_0x10ad45){delete _0x58cbd2[_0x0c92('0x2a')][_0x4c2bda[_0x0c92('0xee')]];_0x58cbd2[_0x0c92('0xc3')](_0x58cbd2['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]]);_0x58cbd2[_0x0c92('0x24')][_0x4ec068[_0x0c92('0xc4')]][_0x0c92('0x68')]+=0x1;_0x58cbd2['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]][_0x0c92('0x67')]+=0x1;var _0x440ab7=_0x58cbd2['voiceQueues'][_0x4ec068[_0x0c92('0xc4')]];var _0x34fdd4=new Hangup(_0x4ec068,_0x4c2bda);_0x34fdd4[_0x0c92('0xb6')]=0x13;_0x34fdd4[_0x0c92('0xb7')]=_0x0c92('0xfb');_0x34fdd4[_0x0c92('0xf5')]=_0x0c92('0xf6');_0x34fdd4[_0x0c92('0xfc')]+=0x1;_0x34fdd4[_0x0c92('0xfd')]+=0x1;_0x34fdd4['amd']=!![];ami['emit'](_0x0c92('0xf7'),ut[_0x0c92('0xf8')](_0x34fdd4,'amd'));_0x58cbd2[_0x0c92('0xdd')](_0x34fdd4)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xfe')));if(_0x34fdd4[_0x0c92('0xff')]+_0x34fdd4[_0x0c92('0x100')]+_0x34fdd4['countnoanswerretry']+_0x34fdd4[_0x0c92('0x101')]+_0x34fdd4[_0x0c92('0x102')]+_0x34fdd4[_0x0c92('0x103')]+_0x34fdd4['countmachineretry']+_0x34fdd4[_0x0c92('0x104')]>=_0x440ab7['dialGlobalMaxRetry']){_0x58cbd2['stateGlobal'](_0x34fdd4,_0x5bee30,_0x10ad45,'reason19\x20machine....');}else{if(_0x34fdd4[_0x0c92('0xfc')]>=_0x440ab7[_0x0c92('0x105')]){_0x58cbd2[_0x0c92('0x106')](_0x34fdd4,_0x5bee30,_0x10ad45,'reason\x2019\x20machine....');}else{_0x58cbd2[_0x0c92('0xd0')]({'active':![],'countmachineretry':_0x34fdd4[_0x0c92('0xfc')],'scheduledat':moment()[_0x0c92('0x107')](_0x440ab7[_0x0c92('0x108')],_0x0c92('0x109'))['format'](_0x0c92('0x10a')),'ContactId':_0x34fdd4['ContactId'],'ListId':_0x34fdd4[_0x0c92('0xe4')],'VoiceQueueId':_0x34fdd4['VoiceQueueId']||undefined,'CampaignId':_0x34fdd4[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x10b')));_0x5bee30({'reschedule':0x1});}}});}if(_0x4ec068['type']===_0x0c92('0x85')&&this[_0x0c92('0x25')][_0x4ec068['queue']][_0x0c92('0xf1')]&&_0x4c2bda[_0x0c92('0xf2')]===_0x0c92('0xf3')){delete this[_0x0c92('0x2a')][_0x4c2bda[_0x0c92('0xee')]];this[_0x0c92('0xc3')](this[_0x0c92('0x25')][_0x4ec068[_0x0c92('0xc4')]]);_0x3c6fd5=new Hangup(_0x4ec068,_0x4c2bda);_0x3c6fd5['state']=0x12;_0x3c6fd5['statedesc']=_0x0c92('0xf4');_0x3c6fd5[_0x0c92('0xf5')]=_0x0c92('0xf6');ami[_0x0c92('0x54')](_0x0c92('0xf7'),ut[_0x0c92('0xf8')](_0x3c6fd5,_0x0c92('0xf9')));this['saveInDb'](_0x3c6fd5,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x4ec068[_0x0c92('0x55')]===_0x0c92('0x85')&&this[_0x0c92('0x25')][_0x4ec068['queue']][_0x0c92('0xf1')]&&_0x4c2bda[_0x0c92('0xf2')]===_0x0c92('0x10c')){var _0x58cbd2=this;return new BPromise(function(_0x350926,_0x501ee1){delete _0x58cbd2['uniqueId'][_0x4c2bda[_0x0c92('0xee')]];_0x58cbd2[_0x0c92('0xc3')](_0x58cbd2['campaigns'][_0x4ec068[_0x0c92('0xc4')]]);_0x58cbd2[_0x0c92('0x25')][_0x4ec068['queue']]['outboundAnswerCallsDay']+=0x1;_0x58cbd2[_0x0c92('0x25')][_0x4ec068[_0x0c92('0xc4')]][_0x0c92('0x67')]+=0x1;var _0x1defad=_0x58cbd2['campaigns'][_0x4ec068[_0x0c92('0xc4')]];var _0x43ce86=new Hangup(_0x4ec068,_0x4c2bda);_0x43ce86['state']=0x13;_0x43ce86['statedesc']=_0x0c92('0xfb');_0x43ce86[_0x0c92('0xf5')]=_0x0c92('0xf6');_0x43ce86['countmachineretry']+=0x1;_0x43ce86[_0x0c92('0xfd')]+=0x1;_0x43ce86['amd']=!![];ami['emit']('custom:amd',ut[_0x0c92('0xf8')](_0x43ce86,_0x0c92('0xf9')));_0x58cbd2[_0x0c92('0xdd')](_0x43ce86)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xfe')));if(_0x43ce86['countbusyretry']+_0x43ce86[_0x0c92('0x100')]+_0x43ce86['countnoanswerretry']+_0x43ce86[_0x0c92('0x101')]+_0x43ce86['countdropretry']+_0x43ce86['countabandonedretry']+_0x43ce86[_0x0c92('0xfc')]+_0x43ce86[_0x0c92('0x104')]>=_0x1defad[_0x0c92('0x10d')]){_0x58cbd2[_0x0c92('0x10e')](_0x43ce86,_0x350926,_0x501ee1,_0x0c92('0x10f'));}else{if(_0x43ce86['countmachineretry']>=_0x1defad[_0x0c92('0x105')]){_0x58cbd2[_0x0c92('0x106')](_0x43ce86,_0x350926,_0x501ee1,_0x0c92('0x110'));}else{_0x58cbd2[_0x0c92('0xd0')]({'active':![],'countmachineretry':_0x43ce86[_0x0c92('0xfc')],'scheduledat':moment()['add'](_0x1defad[_0x0c92('0x108')],_0x0c92('0x109'))[_0x0c92('0x82')](_0x0c92('0x10a')),'ContactId':_0x43ce86[_0x0c92('0xe3')],'ListId':_0x43ce86[_0x0c92('0xe4')],'VoiceQueueId':_0x43ce86['VoiceQueueId']||undefined,'CampaignId':_0x43ce86[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x10b')));_0x350926({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x0c92('0x38')]=function(_0x862e3a){var _0x3f234d=this[_0x0c92('0x2a')][_0x862e3a[_0x0c92('0xee')]];var _0x5cdcb4=this;var _0x86a3c4;if(_0x3f234d&&_0x3f234d['type']===_0x0c92('0x85')){delete this[_0x0c92('0x2a')][_0x862e3a['uniqueid']];this[_0x0c92('0xc3')](this[_0x0c92('0x25')][_0x3f234d[_0x0c92('0xc4')]]);this[_0x0c92('0x25')][_0x3f234d[_0x0c92('0xc4')]]['ivrAnswerCallsDay']+=0x1;_0x86a3c4=new Hangup(_0x3f234d,_0x862e3a);this[_0x0c92('0xdd')](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x111')));this[_0x0c92('0xdb')](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x112')));}if(_0x3f234d&&_0x3f234d['type']!==_0x0c92('0x85')&&isNotNull(this[_0x0c92('0x24')][_0x3f234d['queue']][_0x0c92('0x113')])){delete this['uniqueId'][_0x862e3a[_0x0c92('0xee')]];this['updateOriginated'](this['voiceQueues'][_0x3f234d[_0x0c92('0xc4')]]);this['voiceQueues'][_0x3f234d[_0x0c92('0xc4')]][_0x0c92('0x68')]+=0x1;this[_0x0c92('0x24')][_0x3f234d['queue']][_0x0c92('0x67')]+=0x1;_0x86a3c4=new Hangup(_0x3f234d,_0x862e3a);_0x86a3c4[_0x0c92('0xb6')]=0x10;_0x86a3c4['statedesc']=_0x0c92('0x114');_0x86a3c4[_0x0c92('0xf5')]='AGI';this[_0x0c92('0xdd')](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch('[syncHangupIvr]'));}if(_0x3f234d&&_0x3f234d[_0x0c92('0x55')]!==_0x0c92('0x85')&&!isNotNull(this[_0x0c92('0x24')][_0x3f234d[_0x0c92('0xc4')]][_0x0c92('0x113')])){delete this[_0x0c92('0x2a')][_0x862e3a['uniqueid']];this[_0x0c92('0xc3')](this[_0x0c92('0x24')][_0x3f234d[_0x0c92('0xc4')]]);this[_0x0c92('0x24')][_0x3f234d[_0x0c92('0xc4')]][_0x0c92('0x71')]+=0x1;_0x86a3c4=new Hangup(_0x3f234d,_0x862e3a);_0x86a3c4[_0x0c92('0xb6')]=0xc;_0x86a3c4['statedesc']=_0x862e3a[_0x0c92('0x115')];_0x86a3c4[_0x0c92('0xf5')]=_0x0c92('0x116');this['createHistory'](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x111')));this[_0x0c92('0xdb')](_0x86a3c4)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x112')));}};Dialer[_0x0c92('0x1e')][_0x0c92('0x35')]=function(_0x470dea){var _0x5c6bce=this[_0x0c92('0x2a')][_0x470dea['uniqueid']];var _0x37af39=this;if(this[_0x0c92('0x24')][_0x470dea[_0x0c92('0xc4')]]){if(_0x5c6bce&&_0x5c6bce[_0x0c92('0x55')]!==_0x0c92('0x85')){delete this[_0x0c92('0x2a')][_0x470dea['uniqueid']];this[_0x0c92('0x24')][_0x470dea[_0x0c92('0xc4')]][_0x0c92('0x68')]+=0x1;var _0x46d798=new AgentComplete(_0x5c6bce,_0x470dea);if(_0x470dea[_0x0c92('0x117')]===_0x0c92('0x118')){_0x46d798['agiafterat']=this[_0x0c92('0x24')][_0x470dea[_0x0c92('0xc4')]]['dialQueueProject2']&&this[_0x0c92('0x24')][_0x470dea['queue']][_0x0c92('0x119')]?moment()[_0x0c92('0x82')](_0x0c92('0x10a')):undefined;}this[_0x0c92('0xdd')](_0x46d798)[_0x0c92('0xc1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0c92('0xdb')](_0x46d798)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x11a')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x5eca52){if(this[_0x0c92('0x24')][_0x5eca52[_0x0c92('0xc4')]]){if(this[_0x0c92('0x2a')][_0x5eca52[_0x0c92('0xee')]]&&this[_0x0c92('0x2a')][_0x5eca52[_0x0c92('0xee')]][_0x0c92('0x55')]!==_0x0c92('0x85')){this['updateOriginated'](this[_0x0c92('0x24')][_0x5eca52[_0x0c92('0xc4')]]);this[_0x0c92('0x2a')][_0x5eca52[_0x0c92('0xee')]][_0x0c92('0x11b')]=moment()[_0x0c92('0x82')](_0x0c92('0x10a'));}}};Dialer[_0x0c92('0x1e')]['queueCallerAbandonCreateState']=function(_0x4d834f){this[_0x0c92('0xdd')](_0x4d834f)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x11c')));this[_0x0c92('0xdb')](_0x4d834f)[_0x0c92('0xc1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x0c92('0x1e')][_0x0c92('0x32')]=function(_0x270d1f){var _0x59d212=this['uniqueId'][_0x270d1f['uniqueid']];var _0x20ebf8=this;if(this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]]){if(_0x59d212&&_0x59d212[_0x0c92('0x55')]!==_0x0c92('0x85')){delete this['uniqueId'][_0x270d1f[_0x0c92('0xee')]];this[_0x0c92('0xc3')](this['voiceQueues'][_0x270d1f['queue']]);_0x59d212[_0x0c92('0x11d')]=moment()[_0x0c92('0x82')](_0x0c92('0x10a'));var _0x1b7eb5=new QueueCallerAbandon(_0x59d212,_0x270d1f);if(getSeconds(_0x59d212[_0x0c92('0x11d')],_0x59d212[_0x0c92('0x11e')])>=_0x59d212[_0x0c92('0x11f')]){this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]][_0x0c92('0x75')]+=0x1;this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x270d1f['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1b7eb5[_0x0c92('0xb6')]=0xa;_0x1b7eb5['statedesc']='Drop';_0x1b7eb5[_0x0c92('0x120')]=_0x0c92('0x121');_0x1b7eb5['agiafterat']=this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]]['dialQueueProject2']?moment()[_0x0c92('0x82')](_0x0c92('0x10a')):undefined;_0x1b7eb5['countdropretry']+=0x1;_0x1b7eb5['countglobal']+=0x1;if(_0x1b7eb5[_0x0c92('0x102')]>=this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]]['dialDropMaxRetry']){this[_0x0c92('0x122')](_0x1b7eb5);}else{this[_0x0c92('0xd0')]({'active':![],'countdropretry':_0x1b7eb5[_0x0c92('0x102')],'scheduledat':moment()[_0x0c92('0x107')](this[_0x0c92('0x24')][_0x270d1f['queue']][_0x0c92('0x123')],_0x0c92('0x109'))[_0x0c92('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59d212[_0x0c92('0xe3')],'ListId':_0x59d212[_0x0c92('0xe4')],'VoiceQueueId':_0x59d212[_0x0c92('0xe6')]||undefined,'CampaignId':_0x59d212[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x124')));var _0x34437b=new History(_0x1b7eb5);_0x34437b[_0x0c92('0xb6')]=0xa;_0x34437b[_0x0c92('0xb7')]=_0x0c92('0x125');_0x34437b[_0x0c92('0xb9')]=moment()[_0x0c92('0x82')](_0x0c92('0x10a'));_0x34437b['endtime']=_0x34437b[_0x0c92('0xb9')];_0x34437b[_0x0c92('0x126')]=_0x1b7eb5[_0x0c92('0x126')];_0x34437b['calleridnum']=_0x1b7eb5[_0x0c92('0x127')];this[_0x0c92('0xdd')](_0x34437b)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x128')));}}else{this[_0x0c92('0x24')][_0x270d1f['queue']][_0x0c92('0x74')]+=0x1;this[_0x0c92('0x24')][_0x270d1f['queue']][_0x0c92('0x6b')]+=0x1;_0x1b7eb5[_0x0c92('0xb6')]=0xb;_0x1b7eb5[_0x0c92('0xb7')]=_0x0c92('0x129');_0x1b7eb5['dropreason']=_0x0c92('0x12a');_0x1b7eb5[_0x0c92('0x103')]+=0x1;_0x1b7eb5[_0x0c92('0xfd')]+=0x1;if(_0x1b7eb5[_0x0c92('0x103')]>=this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]][_0x0c92('0x12b')]){this[_0x0c92('0x122')](_0x1b7eb5);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x1b7eb5['countabandonedretry'],'scheduledat':moment()[_0x0c92('0x107')](this[_0x0c92('0x24')][_0x270d1f[_0x0c92('0xc4')]][_0x0c92('0x12c')],_0x0c92('0x109'))[_0x0c92('0x82')](_0x0c92('0x10a')),'ContactId':_0x59d212['ContactId'],'ListId':_0x59d212[_0x0c92('0xe4')],'VoiceQueueId':_0x59d212['VoiceQueueId']||undefined,'CampaignId':_0x59d212[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x12d')));var _0x34437b=new History(_0x1b7eb5);_0x34437b[_0x0c92('0xb6')]=0xb;_0x34437b['statedesc']=_0x0c92('0x129');_0x34437b[_0x0c92('0xb9')]=moment()['format'](_0x0c92('0x10a'));_0x34437b['endtime']=_0x34437b['starttime'];_0x34437b[_0x0c92('0x126')]=_0x1b7eb5[_0x0c92('0x126')];_0x34437b[_0x0c92('0x127')]=_0x1b7eb5[_0x0c92('0x127')];this[_0x0c92('0xdd')](_0x34437b)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x12e')));}}}}};Dialer['prototype'][_0x0c92('0x3a')]=function(_0xb00b87){if(this[_0x0c92('0x29')][_0xb00b87[_0x0c92('0xee')]]){this[_0x0c92('0x29')][_0xb00b87[_0x0c92('0xee')]]['channel']=_0xb00b87['channel'];}if(this[_0x0c92('0x2a')][_0xb00b87[_0x0c92('0xee')]]){this[_0x0c92('0x2a')][_0xb00b87[_0x0c92('0xee')]][_0x0c92('0xc0')]=_0xb00b87[_0x0c92('0xc0')];}};Dialer[_0x0c92('0x1e')][_0x0c92('0x3e')]=function(_0x1982bf){if(strategy[this[_0x0c92('0x24')][this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0xc4')]][_0x0c92('0x57')]]===_0x0c92('0x1d')){if(this['actions'][_0x1982bf[_0x0c92('0x12f')]]&&_['isNil'](this['actions'][_0x1982bf[_0x0c92('0x12f')]]['locked'])&&_0x1982bf[_0x0c92('0xbf')]==='1'&&_0x1982bf[_0x0c92('0x130')]==='0'){if(this[_0x0c92('0x26')][_0x1982bf[_0x0c92('0x131')]]){if(!this[_0x0c92('0x26')][_0x1982bf['stateinterface']][_0x0c92('0x132')]){this[_0x0c92('0x26')][_0x1982bf['stateinterface']][_0x0c92('0x132')]=!![];this['actions'][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0x132')]=!![];this[_0x0c92('0x29')][_0x1982bf['actionid']][_0x0c92('0x131')]=_0x1982bf['stateinterface'];}}}}else if((strategy[this[_0x0c92('0x24')][this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0xc4')]][_0x0c92('0x57')]]||_0x0c92('0x1c'))==='rrmemory'){if(this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]]){if(this['agents'][_0x1982bf['stateinterface']]){this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0x131')]=_0x1982bf[_0x0c92('0x131')];if(_['isNil'](this[_0x0c92('0x2e')][this['actions'][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0xc4')]])){this[_0x0c92('0x2e')][this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0xc4')]]=[];}this['queueBooked'][this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]][_0x0c92('0xc4')]][_0x0c92('0x133')](_[_0x0c92('0x99')](_['pick'](this[_0x0c92('0x29')][_0x1982bf[_0x0c92('0x12f')]],[_0x0c92('0x134'),_0x0c92('0x131')]),{'status':_0x1982bf[_0x0c92('0xbf')],'paused':_0x1982bf[_0x0c92('0x130')]}));}}}};function unlockQueueStatus(_0x966775,_0x394521){setTimeout(function(){if(_['isUndefined'](_0x966775[_0x0c92('0x135')])){loggerBooked['error'](_0x0c92('0x136'),_0x394521);}_0x966775[_0x0c92('0x135')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x394521,JSON[_0x0c92('0x50')](_[_0x0c92('0xe2')](_0x966775,[_0x0c92('0x46'),_0x0c92('0x135')])));},0x1f3);}Dialer[_0x0c92('0x1e')][_0x0c92('0x40')]=function(_0x5de79b){var _0x16afbf=this;var _0x4ac48f=_0x16afbf[_0x0c92('0x24')][_0x16afbf['actions'][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]];if(strategy[this['voiceQueues'][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]][_0x0c92('0x57')]]==='roundrobin'){if(this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]]&&this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0x131')]){this['preview'][_0x0c92('0x137')](this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0x134')],this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]]['stateinterface'])[_0x0c92('0xc1')](function(_0x40430f){logger[_0x0c92('0xa1')](_0x0c92('0x138'),util['inspect'](_0x40430f,{'showHidden':![],'depth':null}));})[_0x0c92('0x21')](function(){_0x16afbf['updateOriginated'](_0x16afbf[_0x0c92('0x24')][_0x16afbf[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]]);_0x16afbf['agents'][_0x16afbf['actions'][_0x5de79b[_0x0c92('0x12f')]]['stateinterface']][_0x0c92('0x132')]=![];delete _0x16afbf[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]];unlockQueueStatus(_0x4ac48f);});}else{this['updateOriginated'](this[_0x0c92('0x24')][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]]);this[_0x0c92('0xd0')]({'active':![],'ContactId':this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xe3')],'ListId':this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xe4')],'VoiceQueueId':this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xe6')]||undefined,'CampaignId':this[_0x0c92('0x29')][_0x5de79b['actionid']][_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x139')));delete this[_0x0c92('0x29')][_0x5de79b['actionid']];unlockQueueStatus(_0x4ac48f);}}else if((strategy[this[_0x0c92('0x24')][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]]['strategy']]||_0x0c92('0x1c'))===_0x0c92('0x1c')){var _0x2d0980;if(this['actions'][_0x5de79b[_0x0c92('0x12f')]]&&!_[_0x0c92('0x4e')](this[_0x0c92('0x2e')][this['actions'][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]])){if(this[_0x0c92('0x2f')][_0x16afbf[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]]['queue']]){this[_0x0c92('0x2f')][_0x16afbf[_0x0c92('0x29')][_0x5de79b['actionid']][_0x0c92('0xc4')]]=this[_0x0c92('0x2f')][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]]?this[_0x0c92('0x2f')][this['actions'][_0x5de79b[_0x0c92('0x12f')]]['queue']]:this[_0x0c92('0x2e')][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]]?this['queueBooked'][this[_0x0c92('0x29')][_0x5de79b['actionid']][_0x0c92('0xc4')]][_0x0c92('0x13a')]||0x0:0x0;}this[_0x0c92('0x2e')][this[_0x0c92('0x29')][_0x5de79b[_0x0c92('0x12f')]][_0x0c92('0xc4')]][_0x0c92('0x13a')]=this[_0x0c92('0x2f')][this[_0x0c92('0x29')][_0x5de79b['actionid']][_0x0c92('0xc4')]];for(var _0x1a2d17=0x0;_0x1a2d17=0x0;})[_0x0c92('0xc1')](myreject(_0x3e5a39)));}}else{_0x1dd1fd['push'](ami[_0x0c92('0xbe')]({'action':_0x0c92('0x153'),'command':util[_0x0c92('0x82')]('iftime\x20%s,%s',_0x43a0ca,!_[_0x0c92('0x44')](config[_0x0c92('0x150')][_0x31477b])?_0x31477b:'')})[_0x0c92('0x42')](function(_0x37b878){return _0x37b878['content'][_0x0c92('0x157')]('true')>=0x0;})['catch'](myreject(_0x3e5a39)));}BPromise['all'](_0x1dd1fd)[_0x0c92('0x42')](function(_0x11b465){var _0x45fc1=_['some'](_0x11b465);if(_0x45fc1){return _0x5e2658(_0x45fc1);}else{_0x400701[_0x0c92('0x48')]=_0x5f5ae5?'GLOBAL_INTERVAL_IS_OVERTIME':_0x0c92('0x158');return _0x3e5a39(msgResponse(_0x0c92('0x159'),_0x0c92('0x14c'),_0x0c92('0x15a')+_0x5f5ae5+'\x20'+_0x5287dc+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0c92('0xa2')](_0x43a0ca,{'showHidden':![],'depth':null})+_0x0c92('0x15b')+_0x31477b));}})['catch'](function(_0x81eb2f){return _0x3e5a39(msgResponse(_0x0c92('0x14b'),'Failure',JSON[_0x0c92('0x50')](_0x81eb2f)));});});};Dialer[_0x0c92('0x1e')][_0x0c92('0x15c')]=function(_0x51363f){var _0x2caa89=this;return function(){switch(_0x51363f['dialMethod']){case _0x0c92('0x15d'):freeVariablesPredictive(_0x51363f);_0x2caa89[_0x0c92('0x15e')](_0x51363f,0x1);break;case _0x0c92('0x15f'):freeVariablesPredictive(_0x51363f);_0x2caa89[_0x0c92('0x15e')](_0x51363f,_0x51363f[_0x0c92('0x160')]);break;case _0x0c92('0x161'):_0x2caa89[_0x0c92('0x161')](_0x51363f);break;case'booked':freeVariablesPredictive(_0x51363f);_0x2caa89[_0x0c92('0x15e')](_0x51363f,0x1);break;default:freeVariablesPredictive(_0x51363f);logger['error'](_0x0c92('0x162'),_0x51363f[_0x0c92('0x46')],'method\x20not\x20recognized');}};};Dialer[_0x0c92('0x1e')]['checkPreviewRecallReminder']=function(_0x592677){return BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](cmHopper[_0x0c92('0x163')](_0x592677['id'],previewRecallmeReminderInterval))[_0x0c92('0x42')](function(_0x4f9370){for(var _0x2199d9=0x0;_0x2199d9<_0x4f9370[_0x0c92('0xa4')];_0x2199d9++){var _0x287685=_0x4f9370[_0x2199d9][_0x0c92('0x164')][_0x0c92('0x46')];if(_0x287685)io['to'](util[_0x0c92('0x82')](_0x0c92('0x165'),_0x287685))['emit'](_0x0c92('0x166'),{'hopper':_0x4f9370[_0x2199d9]});}})[_0x0c92('0xc1')](function(_0x188e9b){});};Dialer['prototype'][_0x0c92('0x167')]=function(_0xc8d6c5){var _0x4105c7=this;return function(){_0x4105c7[_0x0c92('0x168')](_0xc8d6c5);};};Dialer[_0x0c92('0x1e')][_0x0c92('0xb')]=function(_0x5a7382){var _0x21a09=this;if(isNotPreview(_0x5a7382[_0x0c92('0x63')])){if(isVoiceQueueOutbound(_0x5a7382[_0x0c92('0x55')])&&isActive(_0x5a7382['dialActive'])){_0x5a7382['sendMessageOneNotActive']=!![];BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](checkIsLoggedIn(_0x5a7382,_0x5a7382[_0x0c92('0x169')]))[_0x0c92('0x42')](checkIsActive(_0x5a7382,_0x5a7382[_0x0c92('0x62')]))['then'](checkInterval(_0x5a7382))[_0x0c92('0x42')](_0x21a09[_0x0c92('0x147')](_0x5a7382))[_0x0c92('0x42')](_0x21a09[_0x0c92('0x14a')](_0x5a7382[_0x0c92('0x16a')],_0x5a7382[_0x0c92('0x16b')],_0x5a7382[_0x0c92('0x46')],_0x5a7382))[_0x0c92('0x42')](_0x21a09['checkIfTimeIntervals'](_0x5a7382[_0x0c92('0x4a')],_0x5a7382['dialTimezone'],_0x5a7382[_0x0c92('0x46')],_0x5a7382))[_0x0c92('0x42')](_0x21a09[_0x0c92('0x15c')](_0x5a7382))['catch'](loggerCatchQueueSummary(_0x0c92('0x16c'),_0x5a7382));}else{notSendMessagesQueue(_0x5a7382);}}else{freeVariablesPredictive(_0x5a7382);if(_0x5a7382[_0x0c92('0x16d')]){_0x21a09[_0x0c92('0x16e')](_0x5a7382);}}};Dialer['prototype'][_0x0c92('0x146')]=function(){var _0x3bf918=this;var _0x56a011;for(var _0x3f9f3f in this[_0x0c92('0x25')]){if(typeof this['campaigns'][_0x3f9f3f]!==_0x0c92('0xa5')){_0x56a011=this[_0x0c92('0x25')][_0x3f9f3f];if(isCampaignIvr(_0x56a011[_0x0c92('0x55')])&&isActive(_0x56a011[_0x0c92('0x80')])){_0x56a011[_0x0c92('0xae')]=!![];BPromise[_0x0c92('0xc7')]()[_0x0c92('0x42')](checkIsActive(_0x56a011,_0x56a011[_0x0c92('0x80')]))[_0x0c92('0x42')](checkInterval(_0x56a011))[_0x0c92('0x42')](_0x3bf918[_0x0c92('0x147')](_0x56a011))['then'](_0x3bf918[_0x0c92('0x14a')](_0x56a011[_0x0c92('0x16a')],_0x56a011[_0x0c92('0x16b')],_0x56a011[_0x0c92('0x46')],_0x56a011))[_0x0c92('0x42')](_0x3bf918['checkIfTimeIntervals'](_0x56a011['Interval'],_0x56a011[_0x0c92('0x16b')],_0x56a011[_0x0c92('0x46')],_0x56a011))[_0x0c92('0x42')](_0x3bf918[_0x0c92('0x167')](_0x56a011))[_0x0c92('0xc1')](loggerCatchQueueSummary(_0x0c92('0x16f'),_0x56a011));}else{notSendMessagesCampaign(_0x56a011);}}}};function getCallerIdRandom(_0x340b95,_0x31edbe){var _0x37a334;var _0x35d736;var _0x42a050;if(_0x31edbe<=0x0){_0x31edbe=0x1;}_0x37a334=new RegExp(_0x0c92('0x170')+_0x31edbe+'}$');_0x35d736=Math['pow'](0xa,_0x31edbe-0x1);_0x42a050=Math['pow'](0xa,_0x31edbe)-0x1;return util[_0x0c92('0x82')]('%s',_[_0x0c92('0x171')](_0x340b95,_0x37a334,_[_0x0c92('0x172')](_0x35d736,_0x42a050)));}function extractCalleridName(_0x56798c){var _0x57b1f5=_0x56798c['match'](/"(.*?)"/);return _0x57b1f5?_0x57b1f5[0x1]:_0x56798c;}function extractCalleridNumber(_0x354c8d){var _0x535795=_0x354c8d[_0x0c92('0x173')](/<(.*?)>/);return _0x535795?_0x535795[0x1]:_0x354c8d;}Dialer['prototype'][_0x0c92('0x174')]=function(_0x2cbb83,_0x5ab3d0){var _0x16183a=this;var _0x3f57fa=uuid['v4']();this[_0x0c92('0x29')][_0x3f57fa]=new Action(_0x2cbb83,_0x5ab3d0,_0x3f57fa);return new BPromise(function(_0x9c09d1,_0x473ae9){if(_[_0x0c92('0x44')](_0x2cbb83)&&typeof _0x2cbb83!=='object'){return _0x473ae9(msgResponse(_0x0c92('0x175'),_0x0c92('0x14c'),_0x0c92('0x176')));}if(_[_0x0c92('0x44')](_0x5ab3d0[_0x0c92('0x177')][_0x0c92('0x178')])||_0x5ab3d0[_0x0c92('0x177')]['phone']===null){return _0x473ae9(msgResponse(_0x0c92('0x175'),_0x0c92('0x14c'),_0x0c92('0x179')));}var _0x339349={'XMD-CALLERID':_0x16183a[_0x0c92('0x29')][_0x3f57fa][_0x0c92('0x17a')](),'XMD-AGI':_0x2cbb83[_0x0c92('0x113')]?util[_0x0c92('0x82')](_0x0c92('0x17b'),ipAgi,_0x2cbb83[_0x0c92('0x113')]):_0x0c92('0x17c'),'XMD-AGIAFTER':_0x2cbb83['dialQueueProject2']?util[_0x0c92('0x82')](_0x0c92('0x17b'),ipAgi,_0x2cbb83[_0x0c92('0x17d')]):_0x0c92('0x17c'),'XMD-QUEUE':_0x2cbb83['type']===_0x0c92('0x56')?util['format'](_0x0c92('0x17e'),_0x2cbb83['name'],_0x2cbb83['dialQueueOptions']||'',_0x2cbb83[_0x0c92('0x119')]?'c':'',_0x2cbb83['dialQueueTimeout']||0x3):_0x0c92('0x17c'),'XMD-CONTACTID':_0x5ab3d0[_0x0c92('0xe3')],'XMD-CDRTYPE':_0x0c92('0x8'),'CALLERID(all)':_0x16183a[_0x0c92('0x29')][_0x3f57fa][_0x0c92('0x17a')](),'XMD-AMD':_0x2cbb83[_0x0c92('0xf1')]?_0x0c92('0x17f'):'NONE','XMD-DESTINATION':_0x0c92('0x180')};if(_0x2cbb83['dialAMDActive']){_0x339349[_0x0c92('0x181')]=_0x2cbb83[_0x0c92('0x182')]||0x9c4;_0x339349[_0x0c92('0x183')]=_0x2cbb83[_0x0c92('0x184')]||0x5dc;_0x339349[_0x0c92('0x185')]=_0x2cbb83['dialAMDAfterGreetingSilence']||0x320;_0x339349['XMD-AMDTOTALANALYSISTIME']=_0x2cbb83['dialAMDTotalAnalysisTime']||0x1388;_0x339349[_0x0c92('0x186')]=_0x2cbb83[_0x0c92('0x187')]||0x64;_0x339349[_0x0c92('0x188')]=_0x2cbb83[_0x0c92('0x189')]||0x32;_0x339349['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2cbb83[_0x0c92('0x18a')]||0x3;_0x339349['XMD-AMDSILENCETHRESHOLD']=_0x2cbb83[_0x0c92('0x18b')]||0x100;_0x339349[_0x0c92('0x18c')]=_0x2cbb83['dialAMDMaximumWordLength']||0x1388;}if(_0x2cbb83['type']===_0x0c92('0x56')){_0x339349[_0x0c92('0x18d')]=_0x5ab3d0[_0x0c92('0xe6')];}else{_0x339349[_0x0c92('0x18e')]=_0x5ab3d0[_0x0c92('0xe7')];}for(var _0xd5eb19 in _0x5ab3d0[_0x0c92('0x177')]){if(typeof _0x5ab3d0[_0x0c92('0x177')][_0xd5eb19]!==_0x0c92('0xa5')){if(isNotNull(_0x5ab3d0['Contact'][_0xd5eb19])&&_0xd5eb19!=='id'&&_0xd5eb19!==_0x0c92('0x18f')&&_0xd5eb19!==_0x0c92('0x190')&&_0xd5eb19!=='updatedAt'){_0x339349[util['format'](_0x0c92('0x191'),_0x0c92('0x192'),_[_0x0c92('0x193')](_0xd5eb19))]=_0x5ab3d0[_0x0c92('0x177')][_0xd5eb19];}}}var _0x24fc76=_0x16183a[_0x0c92('0xea')](_0x2cbb83[_0x0c92('0x7f')])?getCallerId(_0x2cbb83[_0x0c92('0x7f')][_0x0c92('0x81')],_0x2cbb83[_0x0c92('0x64')],_0x2cbb83[_0x0c92('0x194')]>0x0?getCallerIdRandom(_0x2cbb83[_0x0c92('0x195')],_0x2cbb83[_0x0c92('0x194')]):_0x2cbb83['dialOriginateCallerIdNumber']):getCallerId(_[_0x0c92('0xbd')](_0x2cbb83['TrunkBackup'])?_0x2cbb83[_0x0c92('0x7f')]['callerid']:_0x2cbb83[_0x0c92('0x196')][_0x0c92('0x81')],_0x2cbb83['dialOriginateCallerIdName'],_0x2cbb83['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2cbb83['dialOriginateCallerIdNumber'],_0x2cbb83[_0x0c92('0x194')]):_0x2cbb83[_0x0c92('0x195')]);if(_0x24fc76){_0x339349[_0x0c92('0x197')]=_0x16183a['actions'][_0x3f57fa][_0x0c92('0x198')]=extractCalleridName(_0x24fc76);_0x339349[_0x0c92('0x199')]=_0x16183a[_0x0c92('0x29')][_0x3f57fa][_0x0c92('0x19a')]=extractCalleridNumber(_0x24fc76);}return ami[_0x0c92('0xbe')]({'actionid':_0x3f57fa,'action':'originate','channel':_0x16183a[_0x0c92('0xea')](_0x2cbb83[_0x0c92('0x7f')])?util['format'](_0x0c92('0x19b'),_0x2cbb83[_0x0c92('0x7f')]['name'],isNotNull(_0x2cbb83[_0x0c92('0x66')])?_0x2cbb83[_0x0c92('0x66')][_0x0c92('0x19c')]()||'':'',_0x2cbb83[_0x0c92('0x19d')]>0x0?_0x5ab3d0[_0x0c92('0x177')]['phone'][_0x0c92('0x19e')](_0x2cbb83[_0x0c92('0x19d')]):_0x5ab3d0['Contact']['phone']):util[_0x0c92('0x82')](_0x0c92('0x19b'),_[_0x0c92('0xbd')](_0x2cbb83[_0x0c92('0x196')])?_0x2cbb83[_0x0c92('0x7f')]['name']:_0x2cbb83[_0x0c92('0x196')][_0x0c92('0x46')],isNotNull(_0x2cbb83[_0x0c92('0x66')])?_0x2cbb83[_0x0c92('0x66')]['trim']()||'':'',_0x2cbb83['dialCutDigit']>0x0?_0x5ab3d0[_0x0c92('0x177')][_0x0c92('0x178')][_0x0c92('0x19e')](_0x2cbb83[_0x0c92('0x19d')]):_0x5ab3d0[_0x0c92('0x177')]['phone']),'callerid':_0x24fc76,'Exten':'xcally-motion-dialer','Context':_0x0c92('0x19f'),'Priority':'1','variable':_0x339349,'timeout':(_0x2cbb83[_0x0c92('0x65')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f57fa})[_0x0c92('0x42')](function(_0x2e0d62){return _0x9c09d1(_0x2e0d62);})[_0x0c92('0xc1')](function(_0x120dc0){_0x2cbb83[_0x0c92('0x6e')]+=0x1;var _0x4c945b=new History(_0x16183a['actions'][_0x3f57fa]);logger[_0x0c92('0xa1')](util[_0x0c92('0x82')](_0x0c92('0x1a0'),JSON[_0x0c92('0x50')](_0x120dc0)));_0x4c945b[_0x0c92('0xb6')]=0xe;_0x4c945b[_0x0c92('0xb7')]='OriginateError';_0x4c945b['starttime']=moment()['format'](_0x0c92('0x10a'));_0x4c945b[_0x0c92('0xb8')]=_0x4c945b[_0x0c92('0xb9')];_0x16183a['createHistory'](_0x4c945b)['catch'](loggerCatch(_0x0c92('0x1a1')));_0x16183a[_0x0c92('0xdb')](_0x4c945b)['catch'](loggerCatch(_0x0c92('0x1a1')))[_0x0c92('0x21')](function(){delete _0x16183a[_0x0c92('0x29')][_0x3f57fa];return _0x473ae9(msgResponse(_0x0c92('0x175'),_0x0c92('0x1a2'),'originate\x20action\x20Error'));});});});};Dialer[_0x0c92('0x1e')]['syncOriginateResponse']=function(_0x4e0059){var _0x59ee6b=this[_0x0c92('0x29')][_0x4e0059[_0x0c92('0x12f')]];if(_0x59ee6b){delete this[_0x0c92('0x29')][_0x4e0059['actionid']];_0x59ee6b[_0x0c92('0x11e')]=moment()['format'](_0x0c92('0x10a'));var _0x1f6c34=_0x59ee6b['type']===_0x0c92('0x85')?this[_0x0c92('0x25')][_0x59ee6b[_0x0c92('0xc4')]]:this[_0x0c92('0x24')][_0x59ee6b[_0x0c92('0x1a3')]()];if(!this['isSuccess'](_0x4e0059['response'])){this['updateOriginated'](_0x1f6c34);return this[_0x0c92('0x1a4')](_0x59ee6b,_0x1f6c34,_0x4e0059)[_0x0c92('0xc1')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x0c92('0x2a')][_0x4e0059['uniqueid']]=_0x59ee6b;}};Dialer[_0x0c92('0x1e')][_0x0c92('0x1a5')]=function(_0x181666,_0x4fd5d0,_0x2b3e77){var _0x24028a=new History(_0x4fd5d0);if(_0x24028a[_0x0c92('0xff')]+_0x24028a[_0x0c92('0x100')]+_0x24028a['countnoanswerretry']+_0x24028a[_0x0c92('0x101')]+_0x24028a['countdropretry']+_0x24028a[_0x0c92('0x103')]+_0x24028a[_0x0c92('0xfc')]+_0x24028a[_0x0c92('0x104')]>=_0x2b3e77[_0x0c92('0x10d')]-0x1){return!![];}switch(_0x181666){case 0x3:if(_0x24028a[_0x0c92('0x1a6')]>=_0x2b3e77[_0x0c92('0x1a7')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x24028a[_0x0c92('0x1a6')]+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x1a8')],_0x0c92('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24028a['ContactId'],'ListId':_0x24028a[_0x0c92('0xe4')],'VoiceQueueId':_0x24028a[_0x0c92('0xe6')]||undefined,'CampaignId':_0x24028a['CampaignId']||undefined})[_0x0c92('0xc1')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x24028a[_0x0c92('0xff')]>=_0x2b3e77[_0x0c92('0x1a9')]-0x1){return!![];}this[_0x0c92('0xd0')]({'active':![],'countbusyretry':_0x24028a[_0x0c92('0xff')]+=0x1,'scheduledat':moment()['add'](_0x2b3e77[_0x0c92('0x1aa')],_0x0c92('0x109'))[_0x0c92('0x82')](_0x0c92('0x10a')),'ContactId':_0x24028a[_0x0c92('0xe3')],'ListId':_0x24028a['ListId'],'VoiceQueueId':_0x24028a[_0x0c92('0xe6')]||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1ab')));break;case 0x8:if(_0x24028a[_0x0c92('0x100')]>=_0x2b3e77[_0x0c92('0x1ac')]-0x1){return!![];}this[_0x0c92('0xd0')]({'active':![],'countcongestionretry':_0x24028a[_0x0c92('0x100')]+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77['dialCongestionRetryFrequency'],_0x0c92('0x109'))[_0x0c92('0x82')](_0x0c92('0x10a')),'ContactId':_0x24028a[_0x0c92('0xe3')],'ListId':_0x24028a[_0x0c92('0xe4')],'VoiceQueueId':_0x24028a[_0x0c92('0xe6')]||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1ad')));break;case 0x0:if(_0x24028a[_0x0c92('0x101')]>=_0x2b3e77[_0x0c92('0x1ae')]-0x1){return!![];}else{this[_0x0c92('0xd0')]({'active':![],'countnosuchnumberretry':_0x24028a['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x1af')],_0x0c92('0x109'))['format'](_0x0c92('0x10a')),'ContactId':_0x24028a['ContactId'],'ListId':_0x24028a['ListId'],'VoiceQueueId':_0x24028a['VoiceQueueId']||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x24028a[_0x0c92('0x102')]>=_0x2b3e77[_0x0c92('0x1b0')]-0x1){return!![];}this[_0x0c92('0xd0')]({'active':![],'countdropretry':_0x24028a[_0x0c92('0x102')]+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x123')],_0x0c92('0x109'))['format'](_0x0c92('0x10a')),'ContactId':_0x24028a['ContactId'],'ListId':_0x24028a[_0x0c92('0xe4')],'VoiceQueueId':_0x24028a['VoiceQueueId']||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x124')));break;case 0xb:if(_0x24028a[_0x0c92('0x103')]>=_0x2b3e77[_0x0c92('0x12b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x24028a['countabandonedretry']+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x12c')],_0x0c92('0x109'))['format'](_0x0c92('0x10a')),'ContactId':_0x24028a['ContactId'],'ListId':_0x24028a['ListId'],'VoiceQueueId':_0x24028a['VoiceQueueId']||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x12d')));break;case 0x13:if(_0x24028a['countmachineretry']>=_0x2b3e77['dialMachineMaxRetry']-0x1){return!![];}this[_0x0c92('0xd0')]({'active':![],'countmachineretry':_0x24028a['countmachineretry']+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x108')],'minutes')[_0x0c92('0x82')](_0x0c92('0x10a')),'ContactId':_0x24028a[_0x0c92('0xe3')],'ListId':_0x24028a[_0x0c92('0xe4')],'VoiceQueueId':_0x24028a[_0x0c92('0xe6')]||undefined,'CampaignId':_0x24028a['CampaignId']||undefined})['catch'](loggerCatch(_0x0c92('0x10b')));break;case 0x14:if(_0x24028a[_0x0c92('0x104')]>=_0x2b3e77['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x24028a[_0x0c92('0x104')]+=0x1,'scheduledat':moment()[_0x0c92('0x107')](_0x2b3e77[_0x0c92('0x1b1')],_0x0c92('0x109'))[_0x0c92('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x24028a[_0x0c92('0xe3')],'ListId':_0x24028a['ListId'],'VoiceQueueId':_0x24028a[_0x0c92('0xe6')]||undefined,'CampaignId':_0x24028a[_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1b2')));break;default:return!![];}};Dialer[_0x0c92('0x1e')][_0x0c92('0x1a4')]=function(_0x9cabd7,_0x2adcc0,_0x49da07){var _0x243dd5=this;var _0xdbfc51=new History(_0x9cabd7);return new BPromise(function(_0x249e5f,_0x555ee3){if(_[_0x0c92('0x44')](_0x2adcc0)&&typeof _0x2adcc0!==_0x0c92('0x1b3')){return _0x555ee3(msgResponse('[callProgressDetecting]',_0x0c92('0x14c'),'entity\x20is\x20undefine'));}if(_[_0x0c92('0x44')](_0x49da07)&&typeof _0x49da07!==_0x0c92('0x1b3')){return _0x555ee3(msgResponse(_0x0c92('0x1b4'),_0x0c92('0x14c'),'evt\x20is\x20undefine'));}switch(_0x49da07[_0x0c92('0x117')]){case'0':_0x2adcc0[_0x0c92('0x6d')]+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0x0;_0xdbfc51[_0x0c92('0xb7')]=_0x0c92('0x1b5');_0xdbfc51[_0x0c92('0x101')]+=0x1;_0xdbfc51['countglobal']+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x9cabd7,'nosuchnumber'));_0x243dd5[_0x0c92('0xdd')](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xfe')));if(_0x243dd5[_0x0c92('0x1a5')](0x0,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51[_0x0c92('0x101')]>=_0x2adcc0['dialNoSuchNumberMaxRetry']){_0x243dd5[_0x0c92('0x106')](_0xdbfc51,_0x249e5f,_0x555ee3,'reason\x200\x20no\x20such\x20number....');}else{_0x243dd5[_0x0c92('0x10e')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1b6'));}}break;case'3':_0x2adcc0['outboundNoAnswerCallsDay']+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0x3;_0xdbfc51['statedesc']=_0x0c92('0x1b7');_0xdbfc51[_0x0c92('0x1a6')]+=0x1;_0xdbfc51['countglobal']+=0x1;ami['emit'](_0x0c92('0x1b8'),ut['buildObj'](_0x9cabd7,'noanswer'));_0x243dd5[_0x0c92('0xdd')](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1b9')));if(_0x243dd5[_0x0c92('0x1a5')](0x3,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51['countnoanswerretry']>=_0x2adcc0[_0x0c92('0x1a7')]){_0x243dd5[_0x0c92('0x106')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1ba'));}else{_0x243dd5['stateGlobal'](_0xdbfc51,_0x249e5f,_0x555ee3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2adcc0['outboundBusyCallsDay']+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0x5;_0xdbfc51['statedesc']='Busy';_0xdbfc51[_0x0c92('0xff')]+=0x1;_0xdbfc51[_0x0c92('0xfd')]+=0x1;ami['emit'](_0x0c92('0x1bb'),ut[_0x0c92('0xf8')](_0x9cabd7,_0x0c92('0x1bc')));_0x243dd5['createHistory'](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1bd')));if(_0x243dd5[_0x0c92('0x1a5')](0x5,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51['countbusyretry']>=_0x2adcc0[_0x0c92('0x1a9')]){_0x243dd5[_0x0c92('0x106')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1be'));}else{_0x243dd5['stateGlobal'](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1be'));}}break;case'8':_0x2adcc0['outboundCongestionCallsDay']+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0x8;_0xdbfc51[_0x0c92('0xb7')]='Congestion';_0xdbfc51[_0x0c92('0x100')]+=0x1;_0xdbfc51[_0x0c92('0xfd')]+=0x1;ami['emit'](_0x0c92('0x1bf'),ut[_0x0c92('0xf8')](_0x9cabd7,_0x0c92('0x1c0')));_0x243dd5['createHistory'](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1c1')));if(_0x243dd5[_0x0c92('0x1a5')](0x8,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51['countcongestionretry']>=_0x2adcc0['dialCongestionMaxRetry']){_0x243dd5['createStateFinal'](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1c2'));}else{_0x243dd5[_0x0c92('0x10e')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1c2'));}}break;case'11':_0x2adcc0['outboundAbandonedCallsDay']+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0xb;_0xdbfc51['statedesc']=_0x0c92('0x129');_0xdbfc51[_0x0c92('0x103')]+=0x1;_0xdbfc51[_0x0c92('0xfd')]+=0x1;_0x243dd5[_0x0c92('0xdd')](_0xdbfc51)['catch'](loggerCatch(_0x0c92('0x12e')));if(_0x243dd5['checkRetriveMax'](0xb,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51['countabandonedretry']>=_0x2adcc0[_0x0c92('0x12b')]){_0x243dd5[_0x0c92('0x106')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1c3'));}else{_0x243dd5['stateGlobal'](_0xdbfc51,_0x249e5f,_0x555ee3,'reason\x2011\x20abandoned');}}break;case'20':_0x2adcc0['outboundRejectCallsDay']+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0x14;_0xdbfc51[_0x0c92('0xb7')]=_0x0c92('0x1c4');_0xdbfc51[_0x0c92('0x104')]+=0x1;_0xdbfc51[_0x0c92('0xfd')]+=0x1;ami[_0x0c92('0x54')](_0x0c92('0x1c5'),ut['buildObj'](_0x9cabd7,_0x0c92('0x1c6')));_0x243dd5['createHistory'](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1c7')));if(_0x243dd5['checkRetriveMax'](0x14,_0x9cabd7,_0x2adcc0)){if(_0xdbfc51[_0x0c92('0x104')]>=_0x2adcc0[_0x0c92('0x1c8')]){_0x243dd5['createStateFinal'](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1c9'));}else{_0x243dd5[_0x0c92('0x10e')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x0c92('0x1c9'));}}break;default:_0x2adcc0[_0x0c92('0x71')]+=0x1;_0xdbfc51[_0x0c92('0xb6')]=0xc;_0xdbfc51[_0x0c92('0xb7')]=_0x49da07[_0x0c92('0x117')];_0x243dd5['createHistory'](_0xdbfc51)[_0x0c92('0xc1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x243dd5[_0x0c92('0x1a5')](_0x49da07['reason'],_0x9cabd7,_0x2adcc0)){if(_0xdbfc51['countbusyretry']+_0xdbfc51[_0x0c92('0x100')]+_0xdbfc51[_0x0c92('0x1a6')]+_0xdbfc51[_0x0c92('0x101')]+_0xdbfc51['countdropretry']+_0xdbfc51[_0x0c92('0x103')]+_0xdbfc51[_0x0c92('0xfc')]+_0xdbfc51[_0x0c92('0x104')]>=_0x2adcc0[_0x0c92('0x10d')]){_0x243dd5[_0x0c92('0x10e')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x49da07[_0x0c92('0x117')]);}else{_0x243dd5[_0x0c92('0x106')](_0xdbfc51,_0x249e5f,_0x555ee3,_0x49da07['reason']);}}}});};Dialer['prototype'][_0x0c92('0x10e')]=function(_0x4d15bc,_0x4250fb,_0x3ee69f,_0xcf969){var _0x150b59=new Final(_0x4d15bc);_0x150b59[_0x0c92('0xb6')]=0xf;_0x150b59[_0x0c92('0xb7')]=_0x0c92('0x1ca');this['createStateFinal'](_0x150b59,_0x4250fb,_0x3ee69f,_0xcf969);};Dialer[_0x0c92('0x1e')][_0x0c92('0x106')]=function(_0x43013f,_0x48b209,_0x4413b0,_0x434b3d){this['moveContactManagedDialer'](_0x43013f)[_0x0c92('0x42')](function(){return _0x48b209(msgResponse(_0x0c92('0x1b4'),'Success',_0x434b3d));})['catch'](function(){return _0x4413b0(msgResponse(_0x0c92('0x1cb'),'Failure',_0x0c92('0x1cc')));});};Dialer[_0x0c92('0x1e')]['predictive']=function(_0x4fee40){var _0x1cce8b=_0x4fee40[_0x0c92('0x1cd')]/0x64;var _0x4ce249=_0x4fee40[_0x0c92('0x1ce')]/(_0x4fee40[_0x0c92('0x1ce')]+_0x4fee40[_0x0c92('0x68')]);var _0x3c7872=Math[_0x0c92('0x1cf')](_0x4fee40[_0x0c92('0x78')]*(_0x4fee40[_0x0c92('0x1d0')]/0x64));var _0x6ddc4=Math[_0x0c92('0x1cf')](_0x4fee40[_0x0c92('0x78')]*(_0x4fee40['predictiveIntervalMinThreshold']/0x64));var _0xa77671=_0x4fee40['available']+_0x4fee40[_0x0c92('0xaf')];var _0x3e5ebf=Math[_0x0c92('0x1d1')](_0x4fee40[_0x0c92('0x7b')]*_0x4fee40[_0x0c92('0x1d2')]*_0x4fee40['predictiveIntervalHitRate']*_0x4fee40['predictiveIntervalMultiplicativeFactor']);if(_[_0x0c92('0x44')](_0x4fee40[_0x0c92('0x7e')])){if(!_[_0x0c92('0x44')](_0x4fee40[_0x0c92('0x2c')])){_0x4fee40[_0x0c92('0x2c')]=undefined;loggerPredictive[_0x0c92('0xa1')](_0x0c92('0x1d3'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x0c92('0x44')](_0x4fee40[_0x0c92('0x9c')])){loggerPredictive['error'](_0x0c92('0x1d3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4fee40['handlePredictive']);_0x4fee40[_0x0c92('0x9c')]=undefined;}_0x4fee40[_0x0c92('0x7e')]=moment()[_0x0c92('0x82')](_0x0c92('0x10a'));loggerPredictive[_0x0c92('0x88')](_0x4fee40['name'],'collection\x20data\x20in\x20progressive\x20at',_0x4fee40[_0x0c92('0x7e')]);this[_0x0c92('0x15e')](_0x4fee40,0x1);}else if(ifInterval(_0x4fee40[_0x0c92('0x1d4')],_0x4fee40[_0x0c92('0x7e')])){this['handlePower'](_0x4fee40,0x1);loggerPredictiveCalls[_0x0c92('0x88')](_0x0c92('0x1d5'),_0x4fee40[_0x0c92('0x7e')],_0x4fee40[_0x0c92('0x46')]);_0x4fee40[_0x0c92('0x7b')]=0x0;_0x4fee40[_0x0c92('0x76')]=0x0;}else if(_0x1cce8b<_0x4ce249&&_0x4fee40[_0x0c92('0x1d6')]===_0x0c92('0x1d7')){freeVariablesPredictive(_0x4fee40);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x1d8'),_0x0c92('0x1d9'),_0x4ce249,'startProgressive',_0x4fee40['name']);}else if(_0x3e5ebf<_0x4fee40[_0x0c92('0x76')]&&_0x4fee40['dialPredictiveOptimization']===_0x0c92('0x1d7')){freeVariablesPredictive(_0x4fee40);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x1da'),_0x0c92('0x1db'),_0x3e5ebf,'Drop\x20in\x20this\x20interval',_0x4fee40[_0x0c92('0x76')],_0x0c92('0x7e'),_0x4fee40[_0x0c92('0x46')]);}else if(!ifInterval(_0x4fee40[_0x0c92('0x1d4')],_0x4fee40[_0x0c92('0x7e')])&&_[_0x0c92('0x44')](_0x4fee40[_0x0c92('0x2c')])&&!_[_0x0c92('0x44')](_0x4fee40[_0x0c92('0x7e')])){_0x4fee40['startPredictive']=moment()[_0x0c92('0x82')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0c92('0x88')](_0x4fee40[_0x0c92('0x46')],_0x0c92('0x1dc'),_0x4fee40[_0x0c92('0x2c')]);this[_0x0c92('0xcd')](_0x4fee40[_0x0c92('0x1d4')])[_0x0c92('0x42')](this[_0x0c92('0x1dd')](_0x4fee40))['then'](mergeDataErlangB(_0x4fee40))[_0x0c92('0x42')](this[_0x0c92('0x1de')](_0x4fee40))['catch'](loggerCatchPredictive(_0x0c92('0x1df'),_0x4fee40));}else if(!ifInterval(_0x4fee40['dialPredictiveInterval'],_0x4fee40[_0x0c92('0x2c')])){_0x4fee40['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4fee40[_0x0c92('0x2c')]=moment()[_0x0c92('0x82')](_0x0c92('0x10a'));loggerPredictive[_0x0c92('0x88')](_0x4fee40['name'],_0x0c92('0x1e0'),_0x4fee40[_0x0c92('0x2c')]);clearInterval(_0x4fee40[_0x0c92('0x9c')]);_0x4fee40[_0x0c92('0x9c')]=undefined;this[_0x0c92('0xcd')](_0x4fee40['dialPredictiveInterval'])[_0x0c92('0x42')](this[_0x0c92('0x1dd')](_0x4fee40))[_0x0c92('0x42')](mergeDataErlangB(_0x4fee40))[_0x0c92('0x42')](this[_0x0c92('0x1de')](_0x4fee40))['catch'](loggerCatchPredictive(_0x0c92('0x1e1'),_0x4fee40));}else if(_0x4fee40[_0x0c92('0x78')]&&_0xa77671<_0x4fee40['predictiveIntervalAvailable']-_0x6ddc4){freeVariablesPredictive(_0x4fee40);loggerPredictive['info'](_0x4fee40['name'],_0x0c92('0x1e2'),_0xa77671,_0x0c92('0x1e3'),_0x4fee40['predictiveIntervalAvailable'],'-',_0x6ddc4,'=',_0x4fee40[_0x0c92('0x78')]-_0x6ddc4,')');}else if(_0x4fee40[_0x0c92('0x78')]&&_0xa77671>_0x4fee40[_0x0c92('0x78')]+_0x3c7872){freeVariablesPredictive(_0x4fee40);loggerPredictive['info'](_0x4fee40[_0x0c92('0x46')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xa77671,_0x0c92('0x1e4'),_0x4fee40[_0x0c92('0x78')],'+',_0x3c7872,'=',_0x4fee40[_0x0c92('0x78')]+_0x3c7872,')');}};Dialer['prototype'][_0x0c92('0x1dd')]=function(_0x1c7159){var _0x195a0e=this;return function(_0x59c676){return new BPromise(function(_0x1b797a,_0xf174b5){_['merge'](_0x1c7159,_0x59c676[0x0]);if(checkGetDataPredictive(_0x59c676[0x0])){var _0x2fdca8=_0x1c7159[_0x0c92('0x78')]=_0x1c7159[_0x0c92('0xaf')]+_0x1c7159['available'];var _0x5c9140=_0x1c7159[_0x0c92('0x1d4')]*0x3c;var _0xc16222=_0x59c676[0x0]['predictiveIntervalAvgTalktime']+_0x59c676[0x0][_0x0c92('0x73')];var _0xfba70e=(_0x59c676[0x0]['predictiveIntervalAnsweredCalls']+_0x59c676[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59c676[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x59c676[0x0][_0x0c92('0x79')];_0x1c7159[_0x0c92('0x77')]=_0xfba70e>0x0?_0xfba70e:0x1;switch(_0x1c7159[_0x0c92('0x1d6')]){case _0x0c92('0x1d7'):var _0x44eeb1=_0x1c7159[_0x0c92('0x1cd')]/0x64;return _0x195a0e[_0x0c92('0x1e5')](_0x2fdca8,_0x5c9140,_0xc16222,_0xfba70e,_0x44eeb1)[_0x0c92('0x42')](function(_0xb987c3){return _0x1b797a(_0xb987c3);});case _0x0c92('0x1e6'):var _0xfa6785=_0x1c7159[_0x0c92('0x1cd')]/0x64;return _0x195a0e[_0x0c92('0x1e7')](_0x2fdca8,_0x5c9140,_0xc16222,_0xfba70e,_0xfa6785)['then'](function(_0x4ff2e3){return _0x1b797a(_0x4ff2e3);});default:return _0xf174b5(msgResponse(_0x0c92('0x1e8'),_0x0c92('0x14c'),_0x0c92('0x1e9')));}}else{return _0xf174b5(msgResponse(_0x0c92('0x1e8'),_0x0c92('0x14c'),_0x0c92('0x1ea')));}});};};Dialer[_0x0c92('0x1e')][_0x0c92('0x1eb')]=function(_0x5069b3){var _0x278ada=this;return function(_0x16f7b7){return new BPromise(function(_0x37e1bd,_0x48121f){_[_0x0c92('0x99')](_0x5069b3,_0x16f7b7[0x0]);if(checkGetDataPredictive(_0x16f7b7[0x0])){loggerPredictive[_0x0c92('0x88')](JSON['stringify'](_0x16f7b7[0x0]));if(_0x5069b3[_0x0c92('0x1d6')]===_0x0c92('0x1d7')){return _0x278ada[_0x0c92('0xd9')](_0x5069b3['id'])['then'](function(_0x5d374a){var _0x362c98=_0x5069b3['loggedIn']-_0x5d374a[0x0]['outboundQueuePauses'];var _0x432132=_0x5069b3[_0x0c92('0x1d4')]*0x3c;var _0x24be25=_0x16f7b7[0x0][_0x0c92('0x8f')]+_0x16f7b7[0x0][_0x0c92('0x73')];var _0x541e59=(_0x16f7b7[0x0]['predictiveIntervalAnsweredCalls']+_0x16f7b7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x16f7b7[0x0][_0x0c92('0x74')])/_0x16f7b7[0x0][_0x0c92('0x79')];var _0x11b7ce=_0x5069b3[_0x0c92('0x1cd')]/0x64;_0x5069b3['predictiveIntervalPauses']=_0x5d374a[0x0]['outboundQueuePauses']||0x0;_0x5069b3[_0x0c92('0x77')]=_0x541e59>0x0?_0x541e59:0x1;return _0x278ada[_0x0c92('0x1e5')](_0x362c98,_0x432132,_0x24be25,_0x541e59,_0x11b7ce);})[_0x0c92('0x42')](function(_0x48b854){return _0x37e1bd(_0x48b854);})[_0x0c92('0xc1')](function(_0x26f54a){return _0x48121f(msgResponse(_0x0c92('0x1ec'),_0x0c92('0x14c'),JSON[_0x0c92('0x50')](_0x26f54a)));});}if(_0x5069b3[_0x0c92('0x1d6')]===_0x0c92('0x1e6')){return _0x278ada[_0x0c92('0xd9')](_0x5069b3['id'])['then'](function(_0x57e35e){var _0x41f1ab=_0x5069b3['loggedIn']-_0x57e35e[0x0][_0x0c92('0x1ed')];var _0x3e11c5=_0x5069b3['dialPredictiveInterval']*0x3c;var _0x1d2353=_0x16f7b7[0x0][_0x0c92('0x8f')]+_0x16f7b7[0x0][_0x0c92('0x73')];var _0x122485=(_0x16f7b7[0x0]['predictiveIntervalAnsweredCalls']+_0x16f7b7[0x0][_0x0c92('0x75')]+_0x16f7b7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x16f7b7[0x0][_0x0c92('0x79')];var _0x4d72f8=_0x5069b3[_0x0c92('0x1cd')]/0x64;_0x5069b3[_0x0c92('0x1ee')]=_0x57e35e[0x0][_0x0c92('0x1ed')]||0x0;_0x5069b3[_0x0c92('0x77')]=_0x122485>0x0?_0x122485:0x1;return _0x278ada[_0x0c92('0x1e7')](_0x41f1ab,_0x3e11c5,_0x1d2353,_0x122485,_0x4d72f8);})[_0x0c92('0x42')](function(_0x265ca9){return _0x37e1bd(_0x265ca9);})[_0x0c92('0xc1')](function(_0x2a6395){return _0x48121f(msgResponse('[CatchErlangB]',_0x0c92('0x14c'),JSON['stringify'](_0x2a6395)));});}}else{return _0x48121f(msgResponse(_0x0c92('0x1e8'),_0x0c92('0x14c'),_0x0c92('0x1ea')));}});};};Dialer[_0x0c92('0x1e')][_0x0c92('0x1de')]=function(_0x48ac62){var _0x157a4d=this;return function(){var _0x29277b=0x0;var _0x404100=Math[_0x0c92('0x1d1')](_0x48ac62[_0x0c92('0x7c')]*0x3e8);if(_0x404100>0x0){_0x404100=_0x404100<0x64?0x64:_0x404100;loggerPredictive['info'](_0x48ac62['name'],'one\x20call\x20every:',_0x404100,'milliseconds');_0x48ac62[_0x0c92('0x9c')]=setInterval(function(){_0x157a4d[_0x0c92('0x9c')](_0x48ac62);loggerPredictiveCalls[_0x0c92('0x88')]('[handlePredictive]',_0x29277b+=0x1);},_0x404100);}else{loggerPredictive[_0x0c92('0x88')](_0x48ac62['name'],_0x0c92('0x1ef'));}};};Dialer[_0x0c92('0x1e')][_0x0c92('0x1f0')]=function(_0x1abe1f,_0x16d67f){var _0x526fe4=this;return function(_0x1ec3e9){if(_['isEmpty'](_0x1ec3e9)){if(_[_0x0c92('0xbd')](_0x16d67f[_0x0c92('0xe5')])||!_0x16d67f[_0x0c92('0x1f1')]){if(_0x1abe1f['dialMethod']==='booked'){_0x1abe1f['queueStatusComplete']=_[_0x0c92('0x44')](_0x1abe1f[_0x0c92('0x135')])?!![]:_0x1abe1f[_0x0c92('0x135')];var _0x966c6b=uuid['v4']();_0x526fe4[_0x0c92('0x29')][_0x966c6b]=new Action(_0x1abe1f,_0x16d67f,_0x966c6b);loggerBooked[_0x0c92('0x88')](_0x0c92('0x1f2'),_0x966c6b,_0x0c92('0x1f3'),JSON[_0x0c92('0x50')](_0x1abe1f[_0x0c92('0x135')]),'Queue:\x20',_0x1abe1f['name']);if(_0x1abe1f[_0x0c92('0x135')]){_0x1abe1f[_0x0c92('0x135')]=![];_0x526fe4[_0x0c92('0x2e')][_0x526fe4[_0x0c92('0x29')][_0x966c6b]['queue']]=[];ami[_0x0c92('0xbe')]({'actionid':_0x966c6b,'action':_0x0c92('0x1f4'),'queue':_0x1abe1f[_0x0c92('0x46')]})[_0x0c92('0xc1')](function(){_0x526fe4[_0x0c92('0xc3')](_0x1abe1f);_0x526fe4[_0x0c92('0xd0')]({'active':![],'ContactId':_0x526fe4[_0x0c92('0x29')][_0x966c6b][_0x0c92('0xe3')],'ListId':_0x526fe4[_0x0c92('0x29')][_0x966c6b][_0x0c92('0xe4')],'VoiceQueueId':_0x526fe4['actions'][_0x966c6b][_0x0c92('0xe6')]||undefined,'CampaignId':_0x526fe4['actions'][_0x966c6b]['CampaignId']||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1f5')));delete _0x526fe4[_0x0c92('0x29')][_0x966c6b];});}else{loggerBooked[_0x0c92('0x88')](_0x0c92('0x1f6'),JSON['stringify'](_0x1abe1f[_0x0c92('0x135')]),_0x0c92('0x1f7'),_0x1abe1f[_0x0c92('0x46')]);_0x526fe4[_0x0c92('0xc3')](_0x1abe1f);_0x526fe4[_0x0c92('0xd0')]({'active':![],'ContactId':_0x526fe4['actions'][_0x966c6b][_0x0c92('0xe3')],'ListId':_0x526fe4[_0x0c92('0x29')][_0x966c6b][_0x0c92('0xe4')],'VoiceQueueId':_0x526fe4['actions'][_0x966c6b]['VoiceQueueId']||undefined,'CampaignId':_0x526fe4[_0x0c92('0x29')][_0x966c6b][_0x0c92('0xe7')]||undefined})[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1f5')));delete _0x526fe4[_0x0c92('0x29')][_0x966c6b];}}else{return _0x526fe4['actionOriginate'](_0x1abe1f,_0x16d67f);}}else{if(getDiff(_0x16d67f[_0x0c92('0x1f8')])<_0x1abe1f[_0x0c92('0x1f9')]*0x3c){if(_0x16d67f[_0x0c92('0x164')]&&!_0x16d67f[_0x0c92('0x164')][_0x0c92('0x1fa')]){_0x526fe4[_0x0c92('0x23')][_0x0c92('0x137')](_0x16d67f['id'])[_0x0c92('0x21')](function(){_0x526fe4['updateOriginated'](_0x1abe1f);});}else{_0x526fe4['unlockContact']({'active':![]},_0x16d67f['id'],0x1)[_0x0c92('0x21')](function(){_0x526fe4['updateOriginated'](_0x1abe1f);});}}else{_0x1abe1f[_0x0c92('0x6f')]+=0x1;_0x526fe4['updateOriginated'](_0x1abe1f);if(_0x1abe1f[_0x0c92('0x1fb')]){_0x526fe4[_0x0c92('0xd0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16d67f[_0x0c92('0xe3')],'ListId':_0x16d67f[_0x0c92('0xe4')],'VoiceQueueId':_0x16d67f[_0x0c92('0xe6')]||undefined,'CampaignId':_0x16d67f[_0x0c92('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x526fe4[_0x0c92('0xdd')](createObjHistory(_0x1abe1f,_0x16d67f,_0x0c92('0x1fc'),0x17,_0x0c92('0x1fd')))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0x1fe')));}else{_0x526fe4[_0x0c92('0xe1')](createObjHistory(_0x1abe1f,_0x16d67f,_0x0c92('0x1ff'),0x16,_0x0c92('0x200')),_0x0c92('0x201'),_0x0c92('0x202'));}}}}else{_0x1abe1f['outboundBlacklistCallsDay']+=0x1;_0x526fe4[_0x0c92('0xe1')](createObjHistory(_0x1abe1f,_0x16d67f,_0x0c92('0x203'),0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x0c92('0x204');}};};Dialer[_0x0c92('0x1e')][_0x0c92('0x168')]=function(_0x39a619){var _0x4c1b03=this;var _0x419c88=_0x39a619[_0x0c92('0x205')]-_0x39a619[_0x0c92('0x7a')]-_0x39a619[_0x0c92('0xd5')];emitCampaignSummary(_0x39a619);if(_0x419c88>0x0){if(_0x419c88>this[_0x0c92('0x206')]){_0x419c88=this[_0x0c92('0x206')];}_0x39a619[_0x0c92('0xd5')]+=_0x419c88;this[_0x0c92('0xd7')](_0x39a619['id'],_0x419c88,_0x39a619[_0x0c92('0x207')],_0x39a619)[_0x0c92('0x42')](function(_0x19f413){_0x39a619[_0x0c92('0xd5')]-=_0x419c88;_0x39a619['temp']=_0x39a619[_0x0c92('0xd5')]>0x0?_0x39a619[_0x0c92('0xd5')]:0x0;if(!checkContactEmpty(_0x19f413)){_0x39a619[_0x0c92('0x48')]=_0x0c92('0xac');logger['info'](_0x0c92('0x208')+_0x39a619['name']);}else{_0x39a619['originated']+=_0x19f413[_0x0c92('0xa4')];_0x39a619[_0x0c92('0x48')]=_0x0c92('0x209');for(var _0x5f0037=0x0;_0x5f0037<_0x19f413[_0x0c92('0xa4')];_0x5f0037+=0x1){_0x39a619[_0x0c92('0x20a')]+=0x1;if(_['isNil'](_0x19f413[_0x5f0037])||_[_0x0c92('0xbd')](_0x19f413[_0x5f0037][_0x0c92('0x177')])||_[_0x0c92('0xbd')](_0x19f413[_0x5f0037]['Contact'][_0x0c92('0x178')])){_0x4c1b03[_0x0c92('0x20b')]('[actionOriginate]\x20',_0x39a619,_0x19f413[_0x5f0037]);}else{_0x4c1b03[_0x0c92('0xcb')](_[_0x0c92('0xe2')](_0x19f413[_0x5f0037],[_0x0c92('0xe7'),'Contact.phone']))['then'](_0x4c1b03['checkContactBlack'](_0x39a619,_0x19f413[_0x5f0037]))[_0x0c92('0xc1')](_0x4c1b03[_0x0c92('0xdf')](_0x0c92('0x20c'),_0x39a619));}}}})[_0x0c92('0xc1')](loggerGetContactDialer('[getContactCampaign2]',_0x39a619,_0x419c88));}};Dialer['prototype'][_0x0c92('0x15e')]=function(_0xd2fae8,_0x2476a9){var _0x21e4d5=this;var _0x46ddae=[];var _0x4ef017=_0x2476a9>=0x1?_0x2476a9:0x1;if(_0xd2fae8[_0x0c92('0x63')]===_0x0c92('0x9')){_0x4ef017=0x1;}var _0x360d24=Math[_0x0c92('0x1d1')](_0xd2fae8[_0x0c92('0x58')]*_0x4ef017)-_0xd2fae8['originated']-_0xd2fae8[_0x0c92('0xd5')];emitVoiceQueueSummary(_0xd2fae8);if(_0xd2fae8[_0x0c92('0x20d')]>0x0){var _0x4ecfc8=_0xd2fae8[_0x0c92('0x20d')]-_0xd2fae8[_0x0c92('0x7a')]-_0xd2fae8[_0x0c92('0xaf')]-_0xd2fae8[_0x0c92('0xd5')]-_0xd2fae8[_0x0c92('0x59')];if(_0x360d24>_0x4ecfc8){_0x360d24=_0x4ecfc8;}}if(_0x360d24>0x0){if(_0xd2fae8['dialMethod']==='booked'){_0x360d24=0x1;}if(_0x360d24>this[_0x0c92('0x206')]){_0x360d24=this[_0x0c92('0x206')];}_0xd2fae8[_0x0c92('0xd5')]+=_0x360d24;for(var _0x1fd478 in this[_0x0c92('0x26')]){if(typeof this[_0x0c92('0x26')][_0x1fd478]!==_0x0c92('0xa5')){if(this['agents'][_0x1fd478][_0x0c92('0xb6')]===_0x0c92('0x20e')&&this[_0x0c92('0x26')][_0x1fd478][_0x0c92('0xbf')]===_0x0c92('0xeb')){_0x46ddae[_0x0c92('0x133')](this[_0x0c92('0x26')][_0x1fd478]['id']);}}}this['getContactDialer'](_0xd2fae8['id'],_0x46ddae,_0x360d24,_0xd2fae8[_0x0c92('0x207')],_0xd2fae8)[_0x0c92('0x42')](function(_0x569eb5){_0xd2fae8[_0x0c92('0xd5')]-=_0x360d24;_0xd2fae8[_0x0c92('0xd5')]=_0xd2fae8['temp']>0x0?_0xd2fae8[_0x0c92('0xd5')]:0x0;if(!checkContactEmpty(_0x569eb5)){_0x21e4d5['countReScheduled'](_0xd2fae8)['then'](sendMessageReschedule(_0xd2fae8))['catch'](loggerCatch(_0x0c92('0xc8')));}else{_0xd2fae8[_0x0c92('0x7a')]+=_0x569eb5[_0x0c92('0xa4')];_0xd2fae8[_0x0c92('0x48')]=_0xd2fae8[_0x0c92('0x63')]===_0x0c92('0x9')?_0x0c92('0x17f'):'RUNNING';for(var _0x5655e9=0x0;_0x5655e9<_0x569eb5[_0x0c92('0xa4')];_0x5655e9+=0x1){if(_['isNil'](_0x569eb5[_0x5655e9])||_[_0x0c92('0xbd')](_0x569eb5[_0x5655e9][_0x0c92('0x177')])||_[_0x0c92('0xbd')](_0x569eb5[_0x5655e9][_0x0c92('0x177')][_0x0c92('0x178')])){_0x21e4d5[_0x0c92('0x20b')](_0x0c92('0x20f'),_0xd2fae8,_0x569eb5[_0x5655e9]);}else{_0x21e4d5[_0x0c92('0xc9')](_[_0x0c92('0xe2')](_0x569eb5[_0x5655e9],['VoiceQueueId',_0x0c92('0x210')]))['then'](_0x21e4d5[_0x0c92('0x1f0')](_0xd2fae8,_0x569eb5[_0x5655e9]))[_0x0c92('0xc1')](_0x21e4d5['loggerHandler'](_0x0c92('0x20f'),_0xd2fae8));}}}})['catch'](loggerGetContactDialer(_0x0c92('0x211'),_0xd2fae8,_0x360d24));}};Dialer['prototype'][_0x0c92('0x9c')]=function(_0x1407cf){if(_0x1407cf[_0x0c92('0x20d')]>0x0){var _0x222f77=_0x1407cf[_0x0c92('0x20d')]-_0x1407cf[_0x0c92('0x7a')]-_0x1407cf['talking'];if(_0x222f77>0x0){this['tryOriginatePredictive'](_0x1407cf);}else{loggerPredictiveCalls[_0x0c92('0x88')]('[handlePredictive][limitChannel]');}}else{this[_0x0c92('0x212')](_0x1407cf);}};Dialer[_0x0c92('0x1e')][_0x0c92('0x212')]=function(_0x308bd6){var _0x1d7d70=this;var _0x38c53f=[];_0x308bd6[_0x0c92('0x7a')]+=0x1;for(var _0x34ba8f in this[_0x0c92('0x26')]){if(typeof this[_0x0c92('0x26')][_0x34ba8f]!=='undefined'){if(this[_0x0c92('0x26')][_0x34ba8f]['state']===_0x0c92('0x20e')&&this[_0x0c92('0x26')][_0x34ba8f][_0x0c92('0xbf')]===_0x0c92('0xeb')){_0x38c53f['push'](this[_0x0c92('0x26')][_0x34ba8f]['id']);}}}this[_0x0c92('0xd4')](_0x308bd6['id'],_0x38c53f,0x1,_0x308bd6[_0x0c92('0x207')],_0x308bd6)[_0x0c92('0x42')](function(_0x3eefaa){if(!checkContactEmpty(_0x3eefaa)){checkContactLowerLimitOriginate(_0x308bd6,0x1,0x0);_0x1d7d70[_0x0c92('0xc6')](_0x308bd6)[_0x0c92('0x42')](sendMessageReschedule(_0x308bd6))[_0x0c92('0xc1')](loggerCatch(_0x0c92('0xc8')));}else{_0x308bd6['message']=_0x0c92('0x209');if(_[_0x0c92('0xbd')](_0x3eefaa[0x0])||_['isNil'](_0x3eefaa[0x0]['Contact'])||_['isNil'](_0x3eefaa[0x0][_0x0c92('0x177')]['phone'])){_0x1d7d70[_0x0c92('0x20b')](_0x0c92('0x20f'),_0x308bd6,_0x3eefaa[0x0]);}else{_0x1d7d70[_0x0c92('0xc9')](_['pick'](_0x3eefaa[0x0],[_0x0c92('0xe6'),_0x0c92('0x210')]))['then'](_0x1d7d70[_0x0c92('0x1f0')](_0x308bd6,_0x3eefaa[0x0]))[_0x0c92('0xc1')](_0x1d7d70['loggerHandler'](_0x0c92('0x213'),_0x308bd6));}}})[_0x0c92('0xc1')](loggerGetContactDialer(_0x0c92('0x214'),_0x308bd6,0x1));emitVoiceQueueSummary(_0x308bd6);};Dialer[_0x0c92('0x1e')][_0x0c92('0x1e5')]=function(_0x446eb5,_0x306cee,_0x32b127,_0x380a68,_0x2865e3,_0x20beab){loggerPredictive[_0x0c92('0x88')](_0x0c92('0x215'));loggerPredictive[_0x0c92('0x88')](_0x0c92('0x216'),_0x446eb5);loggerPredictive['info'](_0x0c92('0x217'),_0x306cee);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x218'),_0x32b127);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x219'),_0x380a68);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2865e3);loggerPredictive['info'](_0x0c92('0x90'));return new BPromise(function(_0x5ebbcd,_0x30b79f){if(_0x446eb5<=0x0||isNaN(_0x446eb5)){return _0x30b79f(msgResponse(_0x0c92('0x21a'),_0x0c92('0x1a2'),_0x0c92('0x21b')+_0x446eb5));}if(_0x32b127<=0x0||isNaN(_0x32b127)){return _0x30b79f(msgResponse(_0x0c92('0x21a'),_0x0c92('0x1a2'),_0x0c92('0x21c')+_0x32b127));}if(_0x380a68<=0x0||isNaN(_0x380a68)){return _0x30b79f(msgResponse(_0x0c92('0x21a'),'Error','p\x20=\x20'+_0x380a68));}if(_0x306cee<=0x0||isNaN(_0x306cee)){return _0x30b79f(msgResponse(_0x0c92('0x21a'),_0x0c92('0x1a2'),_0x0c92('0x21d')+_0x306cee));}if(_0x2865e3<=0x0||isNaN(_0x2865e3)){return _0x30b79f(msgResponse(_0x0c92('0x21a'),'Error','Amax\x20=\x20'+_0x2865e3));}_0x20beab=_0x20beab||0x0;var _0x5dddc8=0x1/_0x32b127;var _0x454c45=0x0;var _0x361fef=0x0;var _0x2f0bed=0x0;var _0x4f0e65=0x0;for(var _0xafdc37=0x0;_0x2f0bed<_0x2865e3;_0xafdc37+=0x1){_0x361fef=_0xafdc37/_0x306cee;_0x454c45=(_0x380a68*_0x361fef+_0x20beab)/_0x5dddc8;_0x2f0bed=erlangb(_0x454c45,_0x446eb5);_0x4f0e65=_0x454c45/_0x446eb5*(0x1-erlangb(_0x454c45,_0x446eb5));}return _0x5ebbcd({'erlangCalls':_0xafdc37,'erlangCallToSecond':_0x306cee/_0xafdc37,'erlangAbandonmentRate':_0x2f0bed,'erlangBusyFactor':_0x4f0e65});});};Dialer[_0x0c92('0x1e')][_0x0c92('0x1e7')]=function(_0x2ec901,_0x322075,_0x41915f,_0x16c1d0,_0x48da07,_0x37ec13){loggerPredictive['info'](_0x0c92('0x21e'));loggerPredictive[_0x0c92('0x88')]('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',_0x2ec901);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x217'),_0x322075);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x218'),_0x41915f);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x219'),_0x16c1d0);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48da07);loggerPredictive[_0x0c92('0x88')](_0x0c92('0x90'));return new BPromise(function(_0x2bde1f,_0x4e1dc5){if(_0x2ec901<=0x0||isNaN(_0x2ec901)){return _0x4e1dc5(msgResponse(_0x0c92('0x21f'),_0x0c92('0x1a2'),'m\x20=\x20'+_0x2ec901));}if(_0x41915f<=0x0||isNaN(_0x41915f)){return _0x4e1dc5(msgResponse(_0x0c92('0x21f'),'Error','Ts\x20=\x20'+_0x41915f));}if(_0x16c1d0<=0x0||isNaN(_0x16c1d0)){return _0x4e1dc5(msgResponse('[busyFactor]',_0x0c92('0x1a2'),'p\x20=\x20'+_0x16c1d0));}if(_0x322075<=0x0||isNaN(_0x322075)){return _0x4e1dc5(msgResponse(_0x0c92('0x21f'),_0x0c92('0x1a2'),_0x0c92('0x21d')+_0x322075));}if(_0x48da07<=0x0||isNaN(_0x48da07)){return _0x4e1dc5(msgResponse(_0x0c92('0x21f'),_0x0c92('0x1a2'),_0x0c92('0x220')+_0x48da07));}_0x37ec13=_0x37ec13||0x0;var _0x37fa69=0x1/_0x41915f;var _0x1bbb7f=0x0;var _0x5cd8d4=0x0;var _0x4298b4=0x0;var _0x3e8126=0x0;for(var _0x28342d=0x0;_0x3e8126<_0x48da07;_0x28342d+=0x1){_0x5cd8d4=_0x28342d/_0x322075;_0x1bbb7f=(_0x16c1d0*_0x5cd8d4+_0x37ec13)/_0x37fa69;_0x4298b4=erlangb(_0x1bbb7f,_0x2ec901);_0x3e8126=_0x1bbb7f/_0x2ec901*(0x1-erlangb(_0x1bbb7f,_0x2ec901));}return _0x2bde1f({'erlangCalls':_0x28342d,'erlangCallToSecond':_0x322075/_0x28342d,'erlangAbandonmentRate':_0x4298b4,'erlangBusyFactor':_0x3e8126});});};module[_0x0c92('0x221')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 155f8e2..3dcd94e 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 _0x395e=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','endtime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x395e,0x1af));var _0xe395=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x395e[_0x5b644e];return _0x49c6bf;};'use strict';var util=require('util');var _=require(_0xe395('0x0'));var moment=require(_0xe395('0x1'));function getSeconds(_0x53a848,_0x189a1a){var _0xeb4993=moment(_0x53a848)[_0xe395('0x2')](0x0);var _0x513871=moment(_0x189a1a)[_0xe395('0x2')](0x0);return _0xeb4993[_0xe395('0x3')](_0x513871,_0xe395('0x4'));}function QueueCallerAbandon(_0x2a9475,_0x3ea55f){this[_0xe395('0x5')]=_0x2a9475[_0xe395('0x5')];this[_0xe395('0x6')]=_0x2a9475[_0xe395('0x6')];this['campaigntype']=_0x2a9475[_0xe395('0x6')]==='outbound'?_0xe395('0x7'):_0x2a9475[_0xe395('0x6')];this[_0xe395('0x8')]=_0x2a9475[_0xe395('0x8')];this['countcongestionretry']=_0x2a9475[_0xe395('0x9')];this['countnoanswerretry']=_0x2a9475[_0xe395('0xa')];this[_0xe395('0xb')]=_0x2a9475[_0xe395('0x8')]+_0x2a9475[_0xe395('0x9')]+_0x2a9475[_0xe395('0xa')]+_0x2a9475[_0xe395('0xc')]+_0x2a9475[_0xe395('0xd')]+_0x2a9475[_0xe395('0xe')]+_0x2a9475['countmachineretry']+_0x2a9475[_0xe395('0xf')];this['countnosuchnumberretry']=_0x2a9475['countnosuchnumberretry'];this[_0xe395('0xd')]=_0x2a9475[_0xe395('0xd')];this['countabandonedretry']=_0x2a9475[_0xe395('0xe')];this[_0xe395('0x10')]=_0x2a9475['countmachineretry'];this[_0xe395('0xf')]=_0x2a9475[_0xe395('0xf')];this[_0xe395('0x11')]=_0x3ea55f[_0xe395('0x11')];this[_0xe395('0x12')]=_0x2a9475[_0xe395('0x13')];this['calleridnum']=_0x2a9475['number'];this[_0xe395('0x14')]=_0x2a9475['starttime'];this[_0xe395('0x15')]=_0x2a9475[_0xe395('0x15')];this['droptime']=_0x2a9475['droptime'];this[_0xe395('0x16')]=this[_0xe395('0x17')];this[_0xe395('0x18')]=getSeconds(_0x2a9475[_0xe395('0x15')],_0x2a9475[_0xe395('0x14')]);this[_0xe395('0x19')]=getSeconds(this['droptime'],_0x2a9475[_0xe395('0x15')]);this[_0xe395('0x1a')]=0x0;this[_0xe395('0x7')]=_0x3ea55f[_0xe395('0x7')];this[_0xe395('0x1b')]=_0x3ea55f[_0xe395('0x1c')];this[_0xe395('0x1d')]=_0x3ea55f[_0xe395('0x1d')];this[_0xe395('0x1e')]=_0x2a9475[_0xe395('0x1e')];this[_0xe395('0x1f')]=_0x2a9475[_0xe395('0x1f')];this[_0xe395('0x20')]=_0x2a9475[_0xe395('0x20')];this[_0xe395('0x21')]=_0x2a9475[_0xe395('0x21')];this[_0xe395('0x22')]=_0x2a9475['ContactId'];this[_0xe395('0x23')]=_0x2a9475[_0xe395('0x23')];this[_0xe395('0x24')]=_0x2a9475['UserId'];this[_0xe395('0x25')]=_0x2a9475[_0xe395('0x25')];this[_0xe395('0x26')]=_0x2a9475['CampaignId'];this[_0xe395('0x27')]=_0x2a9475[_0xe395('0x27')]||'';this['originatecalleridname']=_0x2a9475[_0xe395('0x28')]||'';}module[_0xe395('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xce27=['countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0xce27,0xef));var _0x7ce2=function(_0xe08e51,_0x855a1f){_0xe08e51=_0xe08e51-0x0;var _0x37a453=_0xce27[_0xe08e51];return _0x37a453;};'use strict';var util=require(_0x7ce2('0x0'));var _=require(_0x7ce2('0x1'));var moment=require(_0x7ce2('0x2'));function getSeconds(_0x41e565,_0xabb414){var _0x291fba=moment(_0x41e565)[_0x7ce2('0x3')](0x0);var _0x12083b=moment(_0xabb414)['milliseconds'](0x0);return _0x291fba['diff'](_0x12083b,_0x7ce2('0x4'));}function QueueCallerAbandon(_0xee85a6,_0x394d0b){this['scheduledat']=_0xee85a6['scheduledat'];this[_0x7ce2('0x5')]=_0xee85a6[_0x7ce2('0x5')];this['campaigntype']=_0xee85a6[_0x7ce2('0x5')]===_0x7ce2('0x6')?'queue':_0xee85a6[_0x7ce2('0x5')];this['countbusyretry']=_0xee85a6[_0x7ce2('0x7')];this['countcongestionretry']=_0xee85a6[_0x7ce2('0x8')];this[_0x7ce2('0x9')]=_0xee85a6[_0x7ce2('0x9')];this[_0x7ce2('0xa')]=_0xee85a6[_0x7ce2('0x7')]+_0xee85a6[_0x7ce2('0x8')]+_0xee85a6[_0x7ce2('0x9')]+_0xee85a6[_0x7ce2('0xb')]+_0xee85a6[_0x7ce2('0xc')]+_0xee85a6['countabandonedretry']+_0xee85a6[_0x7ce2('0xd')]+_0xee85a6['countagentrejectretry'];this[_0x7ce2('0xb')]=_0xee85a6[_0x7ce2('0xb')];this['countdropretry']=_0xee85a6[_0x7ce2('0xc')];this[_0x7ce2('0xe')]=_0xee85a6[_0x7ce2('0xe')];this[_0x7ce2('0xd')]=_0xee85a6[_0x7ce2('0xd')];this[_0x7ce2('0xf')]=_0xee85a6[_0x7ce2('0xf')];this[_0x7ce2('0x10')]=_0x394d0b[_0x7ce2('0x10')];this[_0x7ce2('0x11')]=_0xee85a6[_0x7ce2('0x12')];this[_0x7ce2('0x13')]=_0xee85a6[_0x7ce2('0x14')];this[_0x7ce2('0x15')]=_0xee85a6[_0x7ce2('0x15')];this[_0x7ce2('0x16')]=_0xee85a6[_0x7ce2('0x16')];this[_0x7ce2('0x17')]=_0xee85a6[_0x7ce2('0x17')];this['endtime']=this[_0x7ce2('0x17')];this[_0x7ce2('0x18')]=getSeconds(_0xee85a6['responsetime'],_0xee85a6[_0x7ce2('0x15')]);this['holdtime']=getSeconds(this['droptime'],_0xee85a6['responsetime']);this[_0x7ce2('0x19')]=0x0;this[_0x7ce2('0x1a')]=_0x394d0b['queue'];this[_0x7ce2('0x1b')]=_0x394d0b[_0x7ce2('0x1c')];this[_0x7ce2('0x1d')]=_0x394d0b[_0x7ce2('0x1d')];this[_0x7ce2('0x1e')]=_0xee85a6[_0x7ce2('0x1e')];this[_0x7ce2('0x1f')]=_0xee85a6[_0x7ce2('0x1f')];this[_0x7ce2('0x20')]=_0xee85a6[_0x7ce2('0x20')];this[_0x7ce2('0x21')]=_0xee85a6[_0x7ce2('0x21')];this['ContactId']=_0xee85a6[_0x7ce2('0x22')];this[_0x7ce2('0x23')]=_0xee85a6[_0x7ce2('0x23')];this[_0x7ce2('0x24')]=_0xee85a6[_0x7ce2('0x24')];this[_0x7ce2('0x25')]=_0xee85a6[_0x7ce2('0x25')];this[_0x7ce2('0x26')]=_0xee85a6['CampaignId'];this['originatecalleridnum']=_0xee85a6[_0x7ce2('0x27')]||'';this[_0x7ce2('0x28')]=_0xee85a6['originatecalleridname']||'';}module[_0x7ce2('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index daef2f1..d8de0e0 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(_0x102121,_0x582086){var _0x402b5e=function(_0x51d8f5){while(--_0x51d8f5){_0x102121['push'](_0x102121['shift']());}};_0x402b5e(++_0x582086);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x367f8c,_0x2a17f7){var _0x1c6483=function(_0x41faaa){while(--_0x41faaa){_0x367f8c['push'](_0x367f8c['shift']());}};_0x1c6483(++_0x2a17f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 4c265f9..d777c64 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 _0x8603=['filename','calleridnum','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','reason','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','path','Action','variablesAction','addVariables','ext','isTrunkReachable','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','isNil','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate'];(function(_0x573063,_0x248ba0){var _0x6b3284=function(_0x234b84){while(--_0x234b84){_0x573063['push'](_0x573063['shift']());}};_0x6b3284(++_0x248ba0);}(_0x8603,0x190));var _0x3860=function(_0x5a0697,_0x135d87){_0x5a0697=_0x5a0697-0x0;var _0x494b79=_0x8603[_0x5a0697];return _0x494b79;};'use strict';var util=require('util');var _=require(_0x3860('0x0'));var BPromise=require(_0x3860('0x1'));var uuid=require(_0x3860('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3860('0x3'));var gs=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('fax');var ami=require(_0x3860('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x3860('0x7'));var ut=require(_0x3860('0x8'));var Action=require(_0x3860('0x9'));var faxAccount=require(_0x3860('0xa'));var attachment=require(_0x3860('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5c7350){this['channels']={};this[_0x3860('0xc')]=_0x5c7350[_0x3860('0xc')];this['trunks']=_0x5c7350[_0x3860('0xd')];this[_0x3860('0xe')]={};ami['on']('newchannel',this[_0x3860('0xf')][_0x3860('0x10')](this));ami['on']('varset',this[_0x3860('0x11')][_0x3860('0x10')](this));ami['on']('newstate',this[_0x3860('0x12')][_0x3860('0x10')](this));ami['on'](_0x3860('0x13'),this[_0x3860('0x14')][_0x3860('0x10')](this));ami['on'](_0x3860('0x15'),this[_0x3860('0x16')][_0x3860('0x10')](this));ami['on'](_0x3860('0x17'),this[_0x3860('0x18')]['bind'](this));ami['on'](_0x3860('0x19'),this[_0x3860('0x1a')][_0x3860('0x10')](this));ami['on'](_0x3860('0x1b'),this[_0x3860('0x1c')][_0x3860('0x10')](this));}Fax[_0x3860('0x1d')][_0x3860('0xf')]=function(_0x311fdb){if(_0x311fdb[_0x3860('0x1e')]===_0x3860('0x1f')){for(var _0x45b799 in this['faxAccounts']){if(this['faxAccounts'][_0x3860('0x20')](_0x45b799)){if(_0x311fdb[_0x3860('0x21')]===this[_0x3860('0xc')][_0x45b799]['localstationid']){this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]={};this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]][_0x3860('0x24')]=_0x311fdb[_0x3860('0x24')];this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]['id']=this[_0x3860('0xc')][_0x45b799]['id'];this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]][_0x3860('0x25')]=this[_0x3860('0xc')][_0x45b799][_0x3860('0x25')];logger[_0x3860('0x26')](_0x311fdb['uniqueid'],_0x3860('0x27'));}}}}if(this[_0x3860('0xe')][_0x311fdb[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x311fdb[_0x3860('0x23')]]={};this['channels'][_0x311fdb[_0x3860('0x23')]]['channel']=_0x311fdb['channel'];logger[_0x3860('0x26')](_0x311fdb[_0x3860('0x23')],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x1b2e4d){if(this[_0x3860('0x22')][_0x1b2e4d[_0x3860('0x23')]]){for(var _0x371f3a in _0x1b2e4d[_0x3860('0x28')]){if(_0x1b2e4d[_0x3860('0x28')]['hasOwnProperty'](_0x371f3a)){this['channels'][_0x1b2e4d[_0x3860('0x23')]][_0x371f3a]=_0x1b2e4d[_0x3860('0x29')];}}}};Fax['prototype'][_0x3860('0x12')]=function(_0x3d5143){if(this[_0x3860('0x22')][_0x3d5143[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x3d5143['uniqueid']][_0x3860('0x2a')]=_0x3d5143[_0x3860('0x2a')];this[_0x3860('0x22')][_0x3d5143['uniqueid']][_0x3860('0x2b')]=_0x3d5143['channelstatedesc'];}};Fax[_0x3860('0x1d')]['syncNewExten']=function(_0x1c498c){if(this[_0x3860('0x22')][_0x1c498c[_0x3860('0x23')]]){for(var _0x47e350 in _0x1c498c[_0x3860('0x28')]){if(_0x1c498c[_0x3860('0x28')]['hasOwnProperty'](_0x47e350)){this[_0x3860('0x22')][_0x1c498c['uniqueid']][_0x47e350]=_0x1c498c[_0x3860('0x29')];}}}};Fax[_0x3860('0x1d')][_0x3860('0x16')]=function(_0x2fc231){if(this[_0x3860('0x22')][_0x2fc231[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x2fc231['uniqueid']][_0x3860('0x2c')]=_0x2fc231[_0x3860('0x2c')];this['channels'][_0x2fc231[_0x3860('0x23')]][_0x3860('0x2d')]=_0x2fc231[_0x3860('0x2d')];this['channels'][_0x2fc231['uniqueid']][_0x3860('0x2e')]=_0x2fc231[_0x3860('0x2e')];this[_0x3860('0x22')][_0x2fc231[_0x3860('0x23')]]['filename']=_0x2fc231['filename'];logger[_0x3860('0x26')](_0x2fc231[_0x3860('0x23')],_0x3860('0x2f'));}};Fax[_0x3860('0x1d')][_0x3860('0x18')]=function(_0x4df2a9){var _0x424424=this;if(this[_0x3860('0x22')][_0x4df2a9['uniqueid']]){var _0x59c662=this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]]['id'];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x30')]=_0x4df2a9['remotestationid'];this[_0x3860('0x22')][_0x4df2a9['uniqueid']][_0x3860('0x31')]=_0x4df2a9[_0x3860('0x31')];this['channels'][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x2e')]=_0x4df2a9['localstationid'];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x32')]=_0x4df2a9[_0x3860('0x32')];this['channels'][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x33')]=_0x4df2a9[_0x3860('0x33')];this['channels'][_0x4df2a9[_0x3860('0x23')]]['filename']=_0x4df2a9[_0x3860('0x34')];this[_0x3860('0x22')][_0x4df2a9[_0x3860('0x23')]][_0x3860('0x35')]=_0x4df2a9[_0x3860('0x35')];if(this[_0x3860('0x22')][_0x4df2a9['uniqueid']][_0x3860('0x31')]>0x0){tiff2pdf(_0x4df2a9[_0x3860('0x34')],'/var/opt/motion2/server/files/attachments/',function(_0x531402){logger[_0x3860('0x26')](_0x4df2a9[_0x3860('0x23')],'\x20result\x20conversion\x20file\x20',_0x531402[_0x3860('0x36')]);attachment[_0x3860('0x37')]({'name':path['parse'](_0x4df2a9[_0x3860('0x34')])[_0x3860('0x25')],'basename':path[_0x3860('0x38')](_0x4df2a9[_0x3860('0x34')])[_0x3860('0x25')]+_0x3860('0x39'),'type':_0x3860('0x3a')})[_0x3860('0x3b')](function(_0x1a3f39){faxAccount[_0x3860('0x3c')](_0x59c662,{'from':_0x4df2a9[_0x3860('0x35')],'mapKey':_0x3860('0x3d'),'body':path[_0x3860('0x38')](_0x4df2a9['filename'])[_0x3860('0x25')]+'.pdf','AttachmentId':_0x1a3f39['id']})[_0x3860('0x3e')](function(_0x770334){logger[_0x3860('0x3f')](_0x4df2a9[_0x3860('0x23')],_0x3860('0x40'),JSON[_0x3860('0x41')](_0x770334));});})[_0x3860('0x3e')](function(_0x27ef92){logger['error'](_0x4df2a9[_0x3860('0x23')],_0x3860('0x42'),JSON[_0x3860('0x41')](_0x27ef92));});});}logger['info'](_0x4df2a9[_0x3860('0x23')],_0x3860('0x42'));}};Fax[_0x3860('0x1d')][_0x3860('0x1c')]=function(_0x5ed2db){if(this['actions'][_0x5ed2db[_0x3860('0x23')]]){_['merge'](this[_0x3860('0x22')][_0x5ed2db[_0x3860('0x23')]],_[_0x3860('0x43')](_0x5ed2db,['response',_0x3860('0x44')]));}};function updateStatus(_0x5a019a){if(_0x5a019a[_0x3860('0x45')]){faxMessage['update'](_0x5a019a[_0x3860('0x45')],{'failMessage':_0x3860('0x46')})[_0x3860('0x3b')](function(_0x4b5790){ut['logger'](_0x3860('0x47'),_0x4b5790);})[_0x3860('0x3e')](function(_0x478dd9){ut[_0x3860('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x478dd9);});}else{ut[_0x3860('0x48')](_0x3860('0x49'));}}Fax[_0x3860('0x1d')][_0x3860('0x4a')]=function(_0x426497,_0xe93a04,_0x3fad85){var _0x5a9987=this;var _0x2fb762={};if(_0xe93a04){_0x2fb762={'read':_0xe93a04};}else{_0x2fb762={'failMessage':_0x3fad85};}if(this[_0x3860('0xe')][_0x426497][_0x3860('0x45')]){faxMessage[_0x3860('0x4b')](this[_0x3860('0xe')][_0x426497][_0x3860('0x45')],_0x2fb762)['then'](function(_0x2cf48c){ut[_0x3860('0x48')](_0x3860('0x4c'),_0x2cf48c);})[_0x3860('0x3e')](function(_0x3a55e7){ut[_0x3860('0x48')](_0x3860('0x4d'),_0x3a55e7);})[_0x3860('0x4e')](function(){delete _0x5a9987['channels'][_0x426497];delete _0x5a9987[_0x3860('0xe')][_0x426497];});}else{ut[_0x3860('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x3860('0x22')][_0x426497];delete this[_0x3860('0xe')][_0x426497];}};Fax[_0x3860('0x1d')]['syncHangup']=function(_0x17d2df){var _0x5f4b87=this;if(this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]){if(this[_0x3860('0xe')][_0x17d2df[_0x3860('0x23')]]){this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]['id']=this[_0x3860('0xe')][_0x17d2df[_0x3860('0x23')]]['id'];this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]][_0x3860('0x25')]=this[_0x3860('0xe')][_0x17d2df['uniqueid']]['name'];}logger['info'](_0x17d2df[_0x3860('0x23')],this['actions'][_0x17d2df['uniqueid']]?_0x3860('0x4f'):_0x3860('0x50'),JSON[_0x3860('0x41')](this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]));if(this[_0x3860('0xe')][_0x17d2df['uniqueid']]){if(this['channels'][_0x17d2df['uniqueid']][_0x3860('0x51')]>0x0&&this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]]['faxstatus']===_0x3860('0x52')){this['updateStatus'](_0x17d2df[_0x3860('0x23')],!![]);}else{this[_0x3860('0x4a')](_0x17d2df['uniqueid'],![],this[_0x3860('0x22')][_0x17d2df[_0x3860('0x23')]][_0x3860('0x53')]?_0x3860('0x54')+this['channels'][_0x17d2df[_0x3860('0x23')]][_0x3860('0x53')]:_0x3860('0x55'));}}}};Fax['prototype']['send']=function(_0x26e54b){var _0x2ba958=this;return new BPromise(function(_0xe67023,_0x1ca0e7){_0x2ba958[_0x3860('0x56')](_0x26e54b,_0x2ba958[_0x3860('0xc')][_0x26e54b['FaxAccountId']])[_0x3860('0x3b')](function(_0x4fe4e8){ut['logger'](_0x3860('0x57'),_0x4fe4e8);_0xe67023(ut[_0x3860('0x36')](_0x3860('0x58')));})[_0x3860('0x3e')](function(_0x36431e){ut[_0x3860('0x48')]('[Fax][execOriginate][failure]',_0x36431e);updateStatus(_0x26e54b);_0x1ca0e7(ut[_0x3860('0x36')](_0x3860('0x59')));});});};Fax[_0x3860('0x1d')][_0x3860('0x5a')]=function(_0x1478d9){var _0x2a5c06=this;return new BPromise(function(_0x5f2c66,_0x1ae31b){var _0x81010b=_0x2a5c06[_0x3860('0x5b')](_0x2a5c06['faxAccounts'][_0x1478d9['FaxAccountId']][_0x3860('0x5c')],_0x1478d9);if(_0x81010b[_0x3860('0x5d')]){_0x5f2c66(ut[_0x3860('0x36')](_0x3860('0x5e')));}else{_0x1ae31b(ut[_0x3860('0x36')](_0x81010b['message']));}});};function originate(_0x48ade7,_0x2db53f,_0x393bc4){return new BPromise(function(_0x47e144,_0x5d9416){if(_0x393bc4){var _0x2fd2ec=util[_0x3860('0x5f')]('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[_0x3860('0x38')](_0x48ade7[_0x3860('0x60')])[_0x3860('0x25')],_0x48ade7[_0x3860('0x60')]);gs['execute'](_0x2fd2ec)[_0x3860('0x3b')](function(){_0x48ade7[_0x3860('0x60')]=util['format']('%s/%s.tif',path[_0x3860('0x38')](_0x48ade7[_0x3860('0x60')])['dir'],path[_0x3860('0x38')](_0x48ade7['path'])[_0x3860('0x25')]);_0x2db53f['XMF-PATH']=_0x48ade7['path'];ut[_0x3860('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x3860('0x61')](ut[_0x3860('0x62')](_0x48ade7,_0x2db53f))[_0x3860('0x3b')](function(_0x2fd2f4){_0x47e144(_0x2fd2f4);})[_0x3860('0x3e')](function(_0x43c5a1){_0x5d9416(_0x43c5a1);});})['catch'](function(_0x3756b3){_0x5d9416(_0x3756b3);});}else{ami[_0x3860('0x61')](ut[_0x3860('0x62')](_0x48ade7,_0x2db53f))['then'](function(_0x352a44){_0x47e144(_0x352a44);})['catch'](function(_0x30e093){_0x5d9416(_0x30e093);});}});}Fax[_0x3860('0x1d')]['execOriginate']=function(_0x73732c,_0x2cd731){var _0x1e94c4=this;return new BPromise(function(_0x5e3276,_0x572707){var _0x5a282a=uuid['v4']();var _0x4c0914=ut[_0x3860('0x63')](_0x73732c,_0x2cd731);_0x1e94c4[_0x3860('0xe')][_0x5a282a]=new Action(_0x5a282a,_0x2cd731,_0x73732c);var _0x3f8b7c=_0x1e94c4[_0x3860('0xe')][_0x5a282a];if(path['parse'](_0x73732c['path'])[_0x3860('0x64')]===_0x3860('0x39')){originate(_0x3f8b7c,_0x4c0914,!![])[_0x3860('0x3b')](function(_0x61798b){_0x5e3276(_0x61798b);})['catch'](function(_0x3a7c0c){_0x572707(_0x3a7c0c);});}else{originate(_0x3f8b7c,_0x4c0914,![])[_0x3860('0x3b')](function(_0x49a4e6){_0x5e3276(_0x49a4e6);})['catch'](function(_0x32cbe8){_0x572707(_0x32cbe8);});}});};Fax[_0x3860('0x1d')][_0x3860('0x65')]=function(_0x27894f){return!_['isNil'](_0x27894f)&&!_['isNil'](_0x27894f[_0x3860('0x25')])&&!_['isNil'](_0x27894f[_0x3860('0x66')])&&_0x27894f[_0x3860('0x66')]&&!_['isNil'](this['trunks'][util['format'](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])])&&!_['isNil'](this[_0x3860('0xd')][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')])&&(this['trunks'][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')]===_0x3860('0x68')||this['trunks'][util[_0x3860('0x5f')](_0x3860('0x67'),_0x27894f[_0x3860('0x25')])][_0x3860('0x2d')]===_0x3860('0x69'));};Fax['prototype']['checkTrunk']=function(_0x196c50,_0x2f3eb6){if(!this[_0x3860('0x65')](_0x196c50)){ut[_0x3860('0x48')](_0x3860('0x6a'),_[_0x3860('0x6b')](_0x196c50)?'':_0x196c50[_0x3860('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3860('0x6c')};}if(_[_0x3860('0x6b')](_0x2f3eb6['fax'])){ut[_0x3860('0x48')](_0x3860('0x6d'),JSON[_0x3860('0x41')](_0x2f3eb6));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3860('0x6b')](_0x2f3eb6[_0x3860('0x60')])){ut['logger'](_0x3860('0x6e'),JSON['stringify'](_0x2f3eb6));return{'isValid':![],'message':_0x3860('0x6f')};}return{'isValid':!![],'message':_0x3860('0x70')};};module['exports']=Fax; \ No newline at end of file +var _0xbee3=['actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','.pdf','error','catch','\x20receiveFax\x20','syncOriginateResponse','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','stringify','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks'];(function(_0x21c693,_0x2bf1be){var _0x1597cc=function(_0x54542e){while(--_0x54542e){_0x21c693['push'](_0x21c693['shift']());}};_0x1597cc(++_0x2bf1be);}(_0xbee3,0xd5));var _0x3bee=function(_0x4f8886,_0x9be826){_0x4f8886=_0x4f8886-0x0;var _0x3c49e4=_0xbee3[_0x4f8886];return _0x3c49e4;};'use strict';var util=require('util');var _=require(_0x3bee('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x3bee('0x1'));var path=require(_0x3bee('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var ami=require('../ami');var rpcDb=require(_0x3bee('0x6'));var Channel=require(_0x3bee('0x7'));var ut=require('./util/util');var Action=require(_0x3bee('0x8'));var faxAccount=require(_0x3bee('0x9'));var attachment=require(_0x3bee('0xa'));var faxMessage=require(_0x3bee('0xb'));function Fax(_0xbdd5d5){this[_0x3bee('0xc')]={};this[_0x3bee('0xd')]=_0xbdd5d5['faxAccounts'];this[_0x3bee('0xe')]=_0xbdd5d5[_0x3bee('0xe')];this[_0x3bee('0xf')]={};ami['on'](_0x3bee('0x10'),this[_0x3bee('0x11')][_0x3bee('0x12')](this));ami['on']('varset',this[_0x3bee('0x13')]['bind'](this));ami['on'](_0x3bee('0x14'),this[_0x3bee('0x15')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x16'),this[_0x3bee('0x17')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x18'),this['syncFaxStatus'][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x19'),this[_0x3bee('0x1a')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x1b'),this['syncHangup']['bind'](this));ami['on'](_0x3bee('0x1c'),this['syncOriginateResponse'][_0x3bee('0x12')](this));}Fax[_0x3bee('0x1d')]['syncNewchannel']=function(_0x5c87cf){if(_0x5c87cf[_0x3bee('0x1e')]===_0x3bee('0x1f')){for(var _0xfdba3b in this[_0x3bee('0xd')]){if(this['faxAccounts'][_0x3bee('0x20')](_0xfdba3b)){if(_0x5c87cf[_0x3bee('0x21')]===this[_0x3bee('0xd')][_0xfdba3b][_0x3bee('0x22')]){this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]]={};this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]['channel']=_0x5c87cf[_0x3bee('0x24')];this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]['id']=this[_0x3bee('0xd')][_0xfdba3b]['id'];this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]][_0x3bee('0x25')]=this[_0x3bee('0xd')][_0xfdba3b][_0x3bee('0x25')];logger[_0x3bee('0x26')](_0x5c87cf['uniqueid'],_0x3bee('0x27'));}}}}if(this[_0x3bee('0xf')][_0x5c87cf[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]={};this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]][_0x3bee('0x24')]=_0x5c87cf['channel'];logger['info'](_0x5c87cf[_0x3bee('0x23')],_0x3bee('0x27'));}};Fax['prototype'][_0x3bee('0x13')]=function(_0x1b4ce0){if(this[_0x3bee('0xc')][_0x1b4ce0['uniqueid']]){for(var _0x1984c4 in _0x1b4ce0[_0x3bee('0x28')]){if(_0x1b4ce0[_0x3bee('0x28')]['hasOwnProperty'](_0x1984c4)){this[_0x3bee('0xc')][_0x1b4ce0[_0x3bee('0x23')]][_0x1984c4]=_0x1b4ce0[_0x3bee('0x29')];}}}};Fax['prototype'][_0x3bee('0x15')]=function(_0x24d523){if(this[_0x3bee('0xc')][_0x24d523[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x24d523['uniqueid']]['channelstate']=_0x24d523[_0x3bee('0x2a')];this[_0x3bee('0xc')][_0x24d523[_0x3bee('0x23')]][_0x3bee('0x2b')]=_0x24d523['channelstatedesc'];}};Fax['prototype'][_0x3bee('0x17')]=function(_0x42cb58){if(this['channels'][_0x42cb58['uniqueid']]){for(var _0xf4701f in _0x42cb58[_0x3bee('0x28')]){if(_0x42cb58[_0x3bee('0x28')][_0x3bee('0x20')](_0xf4701f)){this[_0x3bee('0xc')][_0x42cb58[_0x3bee('0x23')]][_0xf4701f]=_0x42cb58[_0x3bee('0x29')];}}}};Fax[_0x3bee('0x1d')][_0x3bee('0x2c')]=function(_0x42291d){if(this['channels'][_0x42291d['uniqueid']]){this[_0x3bee('0xc')][_0x42291d['uniqueid']]['operation']=_0x42291d[_0x3bee('0x2d')];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]][_0x3bee('0x2e')]=_0x42291d[_0x3bee('0x2e')];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]][_0x3bee('0x22')]=_0x42291d['localstationid'];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]]['filename']=_0x42291d[_0x3bee('0x2f')];logger[_0x3bee('0x26')](_0x42291d[_0x3bee('0x23')],_0x3bee('0x30'));}};Fax[_0x3bee('0x1d')]['syncReceiveFax']=function(_0x57a895){var _0x1a7460=this;if(this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]){var _0x428953=this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]['id'];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x31')]=_0x57a895[_0x3bee('0x31')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]['pagestransferred']=_0x57a895[_0x3bee('0x32')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x22')]=_0x57a895[_0x3bee('0x22')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x33')]=_0x57a895[_0x3bee('0x33')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x34')]=_0x57a895[_0x3bee('0x34')];this['channels'][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x2f')]=_0x57a895[_0x3bee('0x2f')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x35')]=_0x57a895[_0x3bee('0x35')];if(this[_0x3bee('0xc')][_0x57a895['uniqueid']][_0x3bee('0x32')]>0x0){tiff2pdf(_0x57a895[_0x3bee('0x2f')],_0x3bee('0x36'),function(_0x53e73c){logger[_0x3bee('0x26')](_0x57a895['uniqueid'],_0x3bee('0x37'),_0x53e73c['message']);attachment['create']({'name':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])[_0x3bee('0x25')],'basename':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])['name']+'.pdf','type':_0x3bee('0x39')})['then'](function(_0x5aa15f){faxAccount['notify'](_0x428953,{'from':_0x57a895[_0x3bee('0x35')],'mapKey':'fax','body':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])[_0x3bee('0x25')]+_0x3bee('0x3a'),'AttachmentId':_0x5aa15f['id']})['catch'](function(_0x5deb3e){logger[_0x3bee('0x3b')](_0x57a895['uniqueid'],'\x20notify\x20',JSON['stringify'](_0x5deb3e));});})[_0x3bee('0x3c')](function(_0x4e1c3f){logger[_0x3bee('0x3b')](_0x57a895[_0x3bee('0x23')],_0x3bee('0x3d'),JSON['stringify'](_0x4e1c3f));});});}logger[_0x3bee('0x26')](_0x57a895['uniqueid'],_0x3bee('0x3d'));}};Fax['prototype'][_0x3bee('0x3e')]=function(_0x16b096){if(this[_0x3bee('0xf')][_0x16b096['uniqueid']]){_[_0x3bee('0x3f')](this[_0x3bee('0xc')][_0x16b096[_0x3bee('0x23')]],_['pick'](_0x16b096,['response',_0x3bee('0x40')]));}};function updateStatus(_0x3c1220){if(_0x3c1220[_0x3bee('0x41')]){faxMessage[_0x3bee('0x42')](_0x3c1220[_0x3bee('0x41')],{'failMessage':_0x3bee('0x43')})[_0x3bee('0x44')](function(_0x521ceb){ut[_0x3bee('0x45')](_0x3bee('0x46'),_0x521ceb);})['catch'](function(_0x4dca26){ut[_0x3bee('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x4dca26);});}else{ut[_0x3bee('0x45')](_0x3bee('0x47'));}}Fax[_0x3bee('0x1d')]['updateStatus']=function(_0x1a13fd,_0x3beac9,_0x127cb8){var _0x5f5272=this;var _0x1ee4f0={};if(_0x3beac9){_0x1ee4f0={'read':_0x3beac9};}else{_0x1ee4f0={'failMessage':_0x127cb8};}if(this[_0x3bee('0xf')][_0x1a13fd]['AttachmentId']){faxMessage[_0x3bee('0x42')](this[_0x3bee('0xf')][_0x1a13fd]['AttachmentId'],_0x1ee4f0)[_0x3bee('0x44')](function(_0x29bf8c){ut[_0x3bee('0x45')](_0x3bee('0x48'),_0x29bf8c);})[_0x3bee('0x3c')](function(_0x1d563e){ut[_0x3bee('0x45')](_0x3bee('0x49'),_0x1d563e);})['finally'](function(){delete _0x5f5272['channels'][_0x1a13fd];delete _0x5f5272[_0x3bee('0xf')][_0x1a13fd];});}else{ut['logger'](_0x3bee('0x4a'));delete this[_0x3bee('0xc')][_0x1a13fd];delete this[_0x3bee('0xf')][_0x1a13fd];}};Fax['prototype'][_0x3bee('0x4b')]=function(_0x2949d7){var _0x2ef55b=this;if(this['channels'][_0x2949d7[_0x3bee('0x23')]]){if(this['actions'][_0x2949d7[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['id']=this['actions'][_0x2949d7[_0x3bee('0x23')]]['id'];this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['name']=this['actions'][_0x2949d7[_0x3bee('0x23')]][_0x3bee('0x25')];}logger[_0x3bee('0x26')](_0x2949d7['uniqueid'],this['actions'][_0x2949d7[_0x3bee('0x23')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x3bee('0x4c')](this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]));if(this['actions'][_0x2949d7['uniqueid']]){if(this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['faxpages']>0x0&&this[_0x3bee('0xc')][_0x2949d7['uniqueid']][_0x3bee('0x18')]===_0x3bee('0x4d')){this[_0x3bee('0x4e')](_0x2949d7[_0x3bee('0x23')],!![]);}else{this[_0x3bee('0x4e')](_0x2949d7[_0x3bee('0x23')],![],this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]][_0x3bee('0x4f')]?_0x3bee('0x50')+this[_0x3bee('0xc')][_0x2949d7['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x3bee('0x1d')][_0x3bee('0x51')]=function(_0x4acba2){var _0x9828ad=this;return new BPromise(function(_0x5d2cad,_0x154a35){_0x9828ad[_0x3bee('0x52')](_0x4acba2,_0x9828ad['faxAccounts'][_0x4acba2['FaxAccountId']])[_0x3bee('0x44')](function(_0xf5a4e3){ut[_0x3bee('0x45')]('[Fax][execOriginate][success]',_0xf5a4e3);_0x5d2cad(ut[_0x3bee('0x53')](_0x3bee('0x54')));})[_0x3bee('0x3c')](function(_0x5926bc){ut[_0x3bee('0x45')](_0x3bee('0x55'),_0x5926bc);updateStatus(_0x4acba2);_0x154a35(ut[_0x3bee('0x53')](_0x3bee('0x56')));});});};Fax['prototype']['checkAfterSend']=function(_0x169f36){var _0x8f2cb=this;return new BPromise(function(_0x16e56c,_0x3f239a){var _0x167552=_0x8f2cb['checkTrunk'](_0x8f2cb[_0x3bee('0xd')][_0x169f36['FaxAccountId']][_0x3bee('0x57')],_0x169f36);if(_0x167552[_0x3bee('0x58')]){_0x16e56c(ut[_0x3bee('0x53')](_0x3bee('0x59')));}else{_0x3f239a(ut[_0x3bee('0x53')](_0x167552[_0x3bee('0x53')]));}});};function originate(_0x3f7dad,_0x4d52f3,_0x25f936){return new BPromise(function(_0x28c16e,_0x42045d){if(_0x25f936){var _0x3a6f56=util['format'](_0x3bee('0x5a'),path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])[_0x3bee('0x25')],_0x3f7dad[_0x3bee('0x2')]);gs[_0x3bee('0x5b')](_0x3a6f56)[_0x3bee('0x44')](function(){_0x3f7dad[_0x3bee('0x2')]=util['format'](_0x3bee('0x5c'),path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])['dir'],path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])[_0x3bee('0x25')]);_0x4d52f3[_0x3bee('0x5d')]=_0x3f7dad[_0x3bee('0x2')];ut[_0x3bee('0x45')](_0x3bee('0x5e'),'');ami[_0x3bee('0x5f')](ut[_0x3bee('0x60')](_0x3f7dad,_0x4d52f3))[_0x3bee('0x44')](function(_0x3f72f7){_0x28c16e(_0x3f72f7);})[_0x3bee('0x3c')](function(_0xda3a9d){_0x42045d(_0xda3a9d);});})[_0x3bee('0x3c')](function(_0x5e054){_0x42045d(_0x5e054);});}else{ami[_0x3bee('0x5f')](ut[_0x3bee('0x60')](_0x3f7dad,_0x4d52f3))[_0x3bee('0x44')](function(_0x38e1be){_0x28c16e(_0x38e1be);})[_0x3bee('0x3c')](function(_0x3c5600){_0x42045d(_0x3c5600);});}});}Fax[_0x3bee('0x1d')][_0x3bee('0x52')]=function(_0x44c0c3,_0x75ba50){var _0x556e60=this;return new BPromise(function(_0x35f0fb,_0xef6d20){var _0x46bf22=uuid['v4']();var _0x6f0320=ut[_0x3bee('0x61')](_0x44c0c3,_0x75ba50);_0x556e60[_0x3bee('0xf')][_0x46bf22]=new Action(_0x46bf22,_0x75ba50,_0x44c0c3);var _0x2d6a3d=_0x556e60[_0x3bee('0xf')][_0x46bf22];if(path[_0x3bee('0x38')](_0x44c0c3['path'])[_0x3bee('0x62')]===_0x3bee('0x3a')){originate(_0x2d6a3d,_0x6f0320,!![])['then'](function(_0xbfb4af){_0x35f0fb(_0xbfb4af);})['catch'](function(_0x1c260a){_0xef6d20(_0x1c260a);});}else{originate(_0x2d6a3d,_0x6f0320,![])[_0x3bee('0x44')](function(_0x3b6709){_0x35f0fb(_0x3b6709);})['catch'](function(_0x541484){_0xef6d20(_0x541484);});}});};Fax[_0x3bee('0x1d')][_0x3bee('0x63')]=function(_0x3c055b){return!_[_0x3bee('0x64')](_0x3c055b)&&!_[_0x3bee('0x64')](_0x3c055b[_0x3bee('0x25')])&&!_[_0x3bee('0x64')](_0x3c055b[_0x3bee('0x65')])&&_0x3c055b['active']&&!_[_0x3bee('0x64')](this[_0x3bee('0xe')][util[_0x3bee('0x66')](_0x3bee('0x67'),_0x3c055b[_0x3bee('0x25')])])&&!_[_0x3bee('0x64')](this[_0x3bee('0xe')][util['format'](_0x3bee('0x67'),_0x3c055b[_0x3bee('0x25')])]['status'])&&(this[_0x3bee('0xe')][util[_0x3bee('0x66')]('SIP/%s',_0x3c055b[_0x3bee('0x25')])]['status']===_0x3bee('0x68')||this[_0x3bee('0xe')][util[_0x3bee('0x66')](_0x3bee('0x67'),_0x3c055b['name'])][_0x3bee('0x2e')]===_0x3bee('0x69'));};Fax[_0x3bee('0x1d')]['checkTrunk']=function(_0x1fb398,_0xe164fc){if(!this['isTrunkReachable'](_0x1fb398)){ut[_0x3bee('0x45')](_0x3bee('0x6a'),_['isNil'](_0x1fb398)?'':_0x1fb398[_0x3bee('0x25')]+_0x3bee('0x6b'));return{'isValid':![],'message':_0x3bee('0x6c')};}if(_[_0x3bee('0x64')](_0xe164fc[_0x3bee('0x5')])){ut['logger'](_0x3bee('0x6d'),JSON[_0x3bee('0x4c')](_0xe164fc));return{'isValid':![],'message':_0x3bee('0x6e')};}if(_['isNil'](_0xe164fc['path'])){ut[_0x3bee('0x45')](_0x3bee('0x6f'),JSON[_0x3bee('0x4c')](_0xe164fc));return{'isValid':![],'message':_0x3bee('0x70')};}return{'isValid':!![],'message':_0x3bee('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2d6a1c6..d5f2c08 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 _0x5e74=['util','bluebird','../../../config/logger','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5e74,0x14a));var _0x45e7=function(_0x176b84,_0x58014f){_0x176b84=_0x176b84-0x0;var _0x27b306=_0x5e74[_0x176b84];return _0x27b306;};'use strict';var util=require(_0x45e7('0x0'));var BPromise=require(_0x45e7('0x1'));var logger=require(_0x45e7('0x2'))('preview');var _=require('lodash');var faxAccount=require(_0x45e7('0x3'));function loggerCatch(_0x2fe94b){return function(_0x519106){logger[_0x45e7('0x4')](_0x2fe94b,util[_0x45e7('0x5')](_0x519106,{'showHidden':![],'depth':null}));};}exports[_0x45e7('0x6')]=function(_0x550e70,_0x195a57){return BPromise[_0x45e7('0x7')]()[_0x45e7('0x8')](faxAccount[_0x45e7('0x6')](_0x550e70,_0x195a57))[_0x45e7('0x9')](loggerCatch(_0x45e7('0xa')));}; \ No newline at end of file +var _0x26f2=['catch','[Notify]\x20','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x41e0f2,_0x44f75a){var _0x453249=function(_0x83d99a){while(--_0x83d99a){_0x41e0f2['push'](_0x41e0f2['shift']());}};_0x453249(++_0x44f75a);}(_0x26f2,0x1d8));var _0x226f=function(_0x345bf6,_0x9bf6bd){_0x345bf6=_0x345bf6-0x0;var _0x20c768=_0x26f2[_0x345bf6];return _0x20c768;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x226f('0x0'));var _=require(_0x226f('0x1'));var faxAccount=require(_0x226f('0x2'));function loggerCatch(_0xc5a9e9){return function(_0x2c281f){logger[_0x226f('0x3')](_0xc5a9e9,util[_0x226f('0x4')](_0x2c281f,{'showHidden':![],'depth':null}));};}exports[_0x226f('0x5')]=function(_0x1ad373,_0x3570d0){return BPromise[_0x226f('0x6')]()[_0x226f('0x7')](faxAccount[_0x226f('0x5')](_0x1ad373,_0x3570d0))[_0x226f('0x8')](loggerCatch(_0x226f('0x9')));}; \ 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 f575ac1..a5316ae 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 _0x0bcc=['info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','Exec\x20gs'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x0bcc,0x92));var _0xc0bc=function(_0x56811d,_0x2a4ac7){_0x56811d=_0x56811d-0x0;var _0x38e02c=_0x0bcc[_0x56811d];return _0x38e02c;};'use strict';var util=require(_0xc0bc('0x0'));var logger=require(_0xc0bc('0x1'))(_0xc0bc('0x2'));var BPromise=require(_0xc0bc('0x3'));var exec=require(_0xc0bc('0x4'))[_0xc0bc('0x5')];exports[_0xc0bc('0x6')]=function(_0x3616f){return new BPromise(function(_0x3e1f0a,_0x3a4cb1){exec(_0x3616f,function(_0x266ce2,_0x1b8fff,_0x5adc3a){logger['info'](_0xc0bc('0x7'),_0x1b8fff);if(_0x266ce2){logger[_0xc0bc('0x8')]('Exec\x20gs',_0xc0bc('0x9'),util[_0xc0bc('0xa')](_0x266ce2,{'showHidden':![],'depth':null}),_0x1b8fff,_0x5adc3a);_0x3a4cb1(_0x266ce2);}_0x3e1f0a(_0x1b8fff);});});}; \ No newline at end of file +var _0xe56c=['util','fax','child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0xe56c,0x88));var _0xce56=function(_0x1285da,_0x1ea03a){_0x1285da=_0x1285da-0x0;var _0x2f6ba7=_0xe56c[_0x1285da];return _0x2f6ba7;};'use strict';var util=require(_0xce56('0x0'));var logger=require('../../../../config/logger')(_0xce56('0x1'));var BPromise=require('bluebird');var exec=require(_0xce56('0x2'))[_0xce56('0x3')];exports['execute']=function(_0x46e3ed){return new BPromise(function(_0x2e1b87,_0x13bbe5){exec(_0x46e3ed,function(_0x4d4ea5,_0x561a79,_0x38843f){logger[_0xce56('0x4')](_0xce56('0x5'),_0x561a79);if(_0x4d4ea5){logger[_0xce56('0x4')](_0xce56('0x5'),_0xce56('0x6'),util[_0xce56('0x7')](_0x4d4ea5,{'showHidden':![],'depth':null}),_0x561a79,_0x38843f);_0x13bbe5(_0x4d4ea5);}_0x2e1b87(_0x561a79);});});}; \ 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 3b035bb..e40f52e 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 _0xb453=['gateway','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>','headerinfo','util','moment','../../../../config/logger','info','addVariables','ecm','minrate','maxrate','\x22%s\x22','modem'];(function(_0x398e59,_0x183560){var _0x409032=function(_0x31ad91){while(--_0x31ad91){_0x398e59['push'](_0x398e59['shift']());}};_0x409032(++_0x183560);}(_0xb453,0x68));var _0x3b45=function(_0x39849d,_0x162048){_0x39849d=_0x39849d-0x0;var _0x4b0657=_0xb453[_0x39849d];return _0x4b0657;};'use strict';var util=require(_0x3b45('0x0'));var _=require('lodash');var moment=require(_0x3b45('0x1'));var logger=require(_0x3b45('0x2'))('fax');exports['message']=function(_0x60d0d5){return{'message':_0x60d0d5};};exports['logger']=function(_0x35372f,_0xfb602d){logger[_0x3b45('0x3')](_0x35372f,util['inspect'](_0xfb602d,{'showHidden':![],'depth':null}));};exports[_0x3b45('0x4')]=function(_0x237843,_0xafe2b1){var _0x4c5c69={'XMF-ECM':_0xafe2b1[_0x3b45('0x5')],'XMF-HEADERINFO':_0xafe2b1['headerinfo'],'XMF-MINRATE':_0xafe2b1[_0x3b45('0x6')],'XMF-MAXRATE':_0xafe2b1[_0x3b45('0x7')],'XMF-MODEM':util['format'](_0x3b45('0x8'),_0xafe2b1[_0x3b45('0x9')]),'XMF-GATEWAY':_0xafe2b1[_0x3b45('0xa')],'XMF-FAXDETECT':_0xafe2b1['faxdetect'],'XMF-T38TIMEOUT':_0xafe2b1['t38timeout'],'XMF-LOCALSTATIONID':_0xafe2b1[_0x3b45('0xb')],'XMF-PATH':_0x237843['path']};return _0x4c5c69;};exports[_0x3b45('0xc')]=function(_0x6b9a01,_0x154a25){return{'actionid':_0x6b9a01[_0x3b45('0xd')],'action':'originate','channel':_0x6b9a01[_0x3b45('0xe')],'Exten':_0x3b45('0xf'),'Context':'from-sip','Priority':'1','callerid':util[_0x3b45('0x10')](_0x3b45('0x11'),_0x6b9a01[_0x3b45('0x12')]?_0x6b9a01[_0x3b45('0x12')]:'',_0x6b9a01[_0x3b45('0xb')]),'variable':_0x154a25,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x6b9a01[_0x3b45('0xd')]};}; \ No newline at end of file +var _0x9fdb=['minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash','message','logger','info','inspect','addVariables','ecm'];(function(_0x4c7e4,_0x30ab4d){var _0xd8677=function(_0x3b1e29){while(--_0x3b1e29){_0x4c7e4['push'](_0x4c7e4['shift']());}};_0xd8677(++_0x30ab4d);}(_0x9fdb,0xc8));var _0xb9fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fdb[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0xb9fd('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports[_0xb9fd('0x1')]=function(_0x59accd){return{'message':_0x59accd};};exports[_0xb9fd('0x2')]=function(_0x1366c3,_0x2fbebd){logger[_0xb9fd('0x3')](_0x1366c3,util[_0xb9fd('0x4')](_0x2fbebd,{'showHidden':![],'depth':null}));};exports[_0xb9fd('0x5')]=function(_0x4a9646,_0x21f55b){var _0x921d73={'XMF-ECM':_0x21f55b[_0xb9fd('0x6')],'XMF-HEADERINFO':_0x21f55b['headerinfo'],'XMF-MINRATE':_0x21f55b[_0xb9fd('0x7')],'XMF-MAXRATE':_0x21f55b[_0xb9fd('0x8')],'XMF-MODEM':util[_0xb9fd('0x9')](_0xb9fd('0xa'),_0x21f55b[_0xb9fd('0xb')]),'XMF-GATEWAY':_0x21f55b[_0xb9fd('0xc')],'XMF-FAXDETECT':_0x21f55b['faxdetect'],'XMF-T38TIMEOUT':_0x21f55b[_0xb9fd('0xd')],'XMF-LOCALSTATIONID':_0x21f55b[_0xb9fd('0xe')],'XMF-PATH':_0x4a9646[_0xb9fd('0xf')]};return _0x921d73;};exports[_0xb9fd('0x10')]=function(_0x209f22,_0x44b3da){return{'actionid':_0x209f22['uniqueid'],'action':_0xb9fd('0x11'),'channel':_0x209f22[_0xb9fd('0x12')],'Exten':_0xb9fd('0x13'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0xb9fd('0x14'),_0x209f22[_0xb9fd('0x15')]?_0x209f22['headerinfo']:'',_0x209f22[_0xb9fd('0xe')]),'variable':_0x44b3da,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x209f22[_0xb9fd('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 74547e0..3c9a981 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 _0xa121=['getVoiceQueues','getTriggers','initTriggers','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','initTrunks'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xa121,0xb7));var _0x1a12=function(_0x4e8603,_0x34acb9){_0x4e8603=_0x4e8603-0x0;var _0x259613=_0xa121[_0x4e8603];return _0x259613;};'use strict';var BPromise=require('bluebird');var util=require(_0x1a12('0x0'));var moment=require(_0x1a12('0x1'));var server=require(_0x1a12('0x2'));var Realtime=require(_0x1a12('0x3'));var Report=require('./report');var Acw=require(_0x1a12('0x4'));var Trigger=require(_0x1a12('0x5'));var Dialer=require(_0x1a12('0x6'));var Preview=require(_0x1a12('0x7'));var Fax=require(_0x1a12('0x8'));var user=require(_0x1a12('0x9'));var voiceQueue=require(_0x1a12('0xa'));var voiceQueueReport=require(_0x1a12('0xb'));var voiceCallReport=require(_0x1a12('0xc'));var trunk=require(_0x1a12('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x1a12('0xe'));var cmHopperHistory=require(_0x1a12('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x1a12('0x10'));var salesforce=require(_0x1a12('0x11'));var sugarcrm=require(_0x1a12('0x12'));var freshdesk=require(_0x1a12('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x1a12('0x14'));var freshsales=require(_0x1a12('0x15'));var servicenow=require(_0x1a12('0x16'));var dynamics365=require(_0x1a12('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('../../config/logger')(_0x1a12('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1a12('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1a12('0x19')](_0x1a12('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1a12('0x1b')]()[_0x1a12('0x1c')](user[_0x1a12('0x1d')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x1e')]())[_0x1a12('0x1c')](user['getTelephones']())[_0x1a12('0x1c')](realtime[_0x1a12('0x1f')]())['then'](trunk['getTrunks']())['then'](realtime[_0x1a12('0x20')]())[_0x1a12('0x1c')](voiceQueue[_0x1a12('0x21')]())[_0x1a12('0x1c')](realtime['initVoiceQueues']())[_0x1a12('0x1c')](trigger[_0x1a12('0x22')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x23')]())[_0x1a12('0x1c')](template['getTemplates']())['then'](realtime['initTemplates']())[_0x1a12('0x1c')](zendesk['getZendeskAccounts']())[_0x1a12('0x1c')](realtime[_0x1a12('0x24')]())['then'](salesforce[_0x1a12('0x25')]())[_0x1a12('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x1a12('0x26')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x27')]())[_0x1a12('0x1c')](freshdesk[_0x1a12('0x28')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x29')]())['then'](desk[_0x1a12('0x2a')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x2b')]())['then'](zoho[_0x1a12('0x2c')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x2d')]())[_0x1a12('0x1c')](vtiger['getVtigerAccounts']())[_0x1a12('0x1c')](realtime[_0x1a12('0x2e')]())[_0x1a12('0x1c')](freshsales[_0x1a12('0x2f')]())['then'](realtime[_0x1a12('0x30')]())['then'](servicenow[_0x1a12('0x31')]())['then'](realtime[_0x1a12('0x32')]())[_0x1a12('0x1c')](dynamics365[_0x1a12('0x33')]())['then'](realtime[_0x1a12('0x34')]())[_0x1a12('0x1c')](campaign[_0x1a12('0x35')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x36')]())['then'](voiceExtension[_0x1a12('0x37')]())[_0x1a12('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x1a12('0x38')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x39')]())[_0x1a12('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x1a12('0x1b')]()[_0x1a12('0x1c')](voiceQueueReport[_0x1a12('0x3a')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x3b')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x1a12('0x1c')](realtime[_0x1a12('0x3c')]())['then'](cmHopperHistory[_0x1a12('0x3d')]())['then'](realtime[_0x1a12('0x3e')]())[_0x1a12('0x1c')](voiceCallReport[_0x1a12('0x3f')]())[_0x1a12('0x1c')](realtime[_0x1a12('0x40')]())['catch'](function(_0x3cb8ed){logger[_0x1a12('0x41')](_0x1a12('0x42'),util[_0x1a12('0x43')](_0x3cb8ed,{'showHidden':![],'depth':null}));});}function main(){return server[_0x1a12('0x44')](realtime,preview,fax)[_0x1a12('0x1c')](function(_0x20697b){return initRealtime();})['then'](function(){return initParams();})[_0x1a12('0x1c')](function(){report[_0x1a12('0x45')]();setInterval(initRealtime,0x1388);})[_0x1a12('0x46')](function(_0x5b39cc){logger[_0x1a12('0x41')](_0x1a12('0x47'),util['inspect'](_0x5b39cc,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xbbe3=['initTelephones','getTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./report','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','getTelephones'];(function(_0x216196,_0x344ac5){var _0x594562=function(_0x1e146d){while(--_0x1e146d){_0x216196['push'](_0x216196['shift']());}};_0x594562(++_0x344ac5);}(_0xbbe3,0x185));var _0x3bbe=function(_0x839a8f,_0x317610){_0x839a8f=_0x839a8f-0x0;var _0xe918f=_0xbbe3[_0x839a8f];return _0xe918f;};'use strict';var BPromise=require(_0x3bbe('0x0'));var util=require(_0x3bbe('0x1'));var moment=require(_0x3bbe('0x2'));var server=require(_0x3bbe('0x3'));var Realtime=require('./realtime');var Report=require(_0x3bbe('0x4'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x3bbe('0x5'));var Preview=require(_0x3bbe('0x6'));var Fax=require(_0x3bbe('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x3bbe('0x8'));var voiceQueueReport=require(_0x3bbe('0x9'));var voiceCallReport=require(_0x3bbe('0xa'));var trunk=require(_0x3bbe('0xb'));var trigger=require(_0x3bbe('0xc'));var template=require(_0x3bbe('0xd'));var cmHopperHistory=require(_0x3bbe('0xe'));var campaign=require(_0x3bbe('0xf'));var voiceExtension=require(_0x3bbe('0x10'));var faxAccount=require(_0x3bbe('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x3bbe('0x12'));var sugarcrm=require(_0x3bbe('0x13'));var freshdesk=require(_0x3bbe('0x14'));var desk=require(_0x3bbe('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x3bbe('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x3bbe('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('../../config/logger')(_0x3bbe('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3bbe('0x19')](_0x3bbe('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3bbe('0x19')](_0x3bbe('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3bbe('0x1b')]()[_0x3bbe('0x1c')](user[_0x3bbe('0x1d')]())[_0x3bbe('0x1c')](realtime['initAgents']())[_0x3bbe('0x1c')](user[_0x3bbe('0x1e')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x1f')]())['then'](trunk[_0x3bbe('0x20')]())[_0x3bbe('0x1c')](realtime['initTrunks']())['then'](voiceQueue[_0x3bbe('0x21')]())[_0x3bbe('0x1c')](realtime['initVoiceQueues']())[_0x3bbe('0x1c')](trigger['getTriggers']())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x22')]())['then'](template[_0x3bbe('0x23')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x24')]())[_0x3bbe('0x1c')](zendesk[_0x3bbe('0x25')]())['then'](realtime[_0x3bbe('0x26')]())[_0x3bbe('0x1c')](salesforce[_0x3bbe('0x27')]())[_0x3bbe('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x3bbe('0x28')]())['then'](realtime[_0x3bbe('0x29')]())[_0x3bbe('0x1c')](freshdesk[_0x3bbe('0x2a')]())['then'](realtime[_0x3bbe('0x2b')]())[_0x3bbe('0x1c')](desk['getDeskAccounts']())[_0x3bbe('0x1c')](realtime['initDeskAccounts']())[_0x3bbe('0x1c')](zoho['getZohoAccounts']())['then'](realtime[_0x3bbe('0x2c')]())[_0x3bbe('0x1c')](vtiger[_0x3bbe('0x2d')]())['then'](realtime[_0x3bbe('0x2e')]())[_0x3bbe('0x1c')](freshsales[_0x3bbe('0x2f')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x30')]())[_0x3bbe('0x1c')](servicenow[_0x3bbe('0x31')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x32')]())[_0x3bbe('0x1c')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x3bbe('0x33')]())[_0x3bbe('0x1c')](campaign['getCampaigns']())[_0x3bbe('0x1c')](realtime['initCampaigns']())['then'](voiceExtension[_0x3bbe('0x34')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x35')]())[_0x3bbe('0x1c')](faxAccount[_0x3bbe('0x36')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x37')]())[_0x3bbe('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x3bbe('0x1b')]()[_0x3bbe('0x1c')](voiceQueueReport[_0x3bbe('0x38')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x39')]())[_0x3bbe('0x1c')](cmHopperHistory[_0x3bbe('0x3a')]())[_0x3bbe('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0x3bbe('0x1c')](cmHopperHistory[_0x3bbe('0x3b')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x3c')]())[_0x3bbe('0x1c')](voiceCallReport[_0x3bbe('0x3d')]())[_0x3bbe('0x1c')](realtime[_0x3bbe('0x3e')]())[_0x3bbe('0x3f')](function(_0x22efda){logger[_0x3bbe('0x40')](_0x3bbe('0x41'),util[_0x3bbe('0x42')](_0x22efda,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3bbe('0x43')](realtime,preview,fax)[_0x3bbe('0x1c')](function(_0x4bc17d){return initRealtime();})[_0x3bbe('0x1c')](function(){return initParams();})[_0x3bbe('0x1c')](function(){report[_0x3bbe('0x44')]();setInterval(initRealtime,0x1388);})[_0x3bbe('0x3f')](function(_0xdeff5){logger[_0x3bbe('0x40')](_0x3bbe('0x45'),util['inspect'](_0xdeff5,{'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 270e47b..cecc6f8 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0xddd396,_0x32a0e2){var _0x1b458f=function(_0x350d34){while(--_0x350d34){_0xddd396['push'](_0xddd396['shift']());}};_0x1b458f(++_0x32a0e2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1c11da,_0x347394){var _0x92ead0=function(_0x4034c1){while(--_0x4034c1){_0x1c11da['push'](_0x1c11da['shift']());}};_0x92ead0(++_0x347394);}(_0x70e0,0x17b));var _0x070e=function(_0x216134,_0x10ec48){_0x216134=_0x216134-0x0;var _0x242a31=_0x70e0[_0x216134];return _0x242a31;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c23431d..9c89e7a 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 _0x1a4e=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x704940,_0x15a3b3){var _0x17460a=function(_0x29fb66){while(--_0x29fb66){_0x704940['push'](_0x704940['shift']());}};_0x17460a(++_0x15a3b3);}(_0x1a4e,0x15a));var _0xe1a4=function(_0x258b00,_0x28e9b0){_0x258b00=_0x258b00-0x0;var _0x3ca676=_0x1a4e[_0x258b00];return _0x3ca676;};'use strict';function Campaign(_0x2d7a98){this['id']=_0x2d7a98['id']||0x0;this[_0xe1a4('0x0')]=_0x2d7a98[_0xe1a4('0x0')]||'';this[_0xe1a4('0x1')]=_0x2d7a98[_0xe1a4('0x1')]||_0xe1a4('0x2');this[_0xe1a4('0x3')]=0x0;this[_0xe1a4('0x4')]=0x0;this[_0xe1a4('0x5')]=0x0;this[_0xe1a4('0x6')]=0x0;this[_0xe1a4('0x7')]='';this[_0xe1a4('0x8')]=!![];this[_0xe1a4('0x9')]=_0x2d7a98['active'];this[_0xe1a4('0xa')]=_0x2d7a98[_0xe1a4('0xa')];this[_0xe1a4('0xb')]=_0x2d7a98[_0xe1a4('0xb')]||null;this['dialGlobalInterval']=_0x2d7a98['dialGlobalInterval']?_0x2d7a98[_0xe1a4('0xc')]:null;this[_0xe1a4('0xd')]=_0x2d7a98[_0xe1a4('0xd')];this[_0xe1a4('0xe')]=_0x2d7a98[_0xe1a4('0xe')];this[_0xe1a4('0xf')]=_0x2d7a98[_0xe1a4('0xf')]||0x1e;this[_0xe1a4('0x10')]=_0x2d7a98['dialCongestionMaxRetry'];this[_0xe1a4('0x11')]=_0x2d7a98['dialCongestionRetryFrequency'];this[_0xe1a4('0x12')]=_0x2d7a98[_0xe1a4('0x12')];this['dialBusyRetryFrequency']=_0x2d7a98[_0xe1a4('0x13')];this[_0xe1a4('0x14')]=_0x2d7a98[_0xe1a4('0x14')];this[_0xe1a4('0x15')]=_0x2d7a98[_0xe1a4('0x15')];this[_0xe1a4('0x16')]=_0x2d7a98[_0xe1a4('0x16')];this['dialNoSuchNumberMaxRetry']=_0x2d7a98[_0xe1a4('0x17')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2d7a98[_0xe1a4('0x18')]||0x96;this[_0xe1a4('0x19')]=_0x2d7a98['dialDropMaxRetry']||0x3;this[_0xe1a4('0x1a')]=_0x2d7a98[_0xe1a4('0x1a')]||0x96;this[_0xe1a4('0x1b')]=_0x2d7a98[_0xe1a4('0x1b')]||0x3;this['dialAbandonedRetryFrequency']=_0x2d7a98[_0xe1a4('0x1c')]||0x96;this['dialMachineMaxRetry']=_0x2d7a98['dialMachineMaxRetry']||0x3;this[_0xe1a4('0x1d')]=_0x2d7a98[_0xe1a4('0x1d')]||0x96;this[_0xe1a4('0x1e')]=_0x2d7a98[_0xe1a4('0x1e')]||0x3;this[_0xe1a4('0x1f')]=_0x2d7a98[_0xe1a4('0x1f')]||0x96;this[_0xe1a4('0x20')]=_0x2d7a98[_0xe1a4('0x20')]||_0xe1a4('0x21');this['dialPrefix']=_0x2d7a98[_0xe1a4('0x22')]||undefined;this[_0xe1a4('0x23')]=_0x2d7a98[_0xe1a4('0x23')]||undefined;this['dialCutDigit']=_0x2d7a98[_0xe1a4('0x24')]||undefined;this[_0xe1a4('0x25')]=_0x2d7a98['TrunkBackup']?_0x2d7a98[_0xe1a4('0x25')]:undefined;this['Trunk']=_0x2d7a98[_0xe1a4('0x26')]?_0x2d7a98[_0xe1a4('0x26')]:undefined;this[_0xe1a4('0x27')]=_0x2d7a98['Interval']?_0x2d7a98[_0xe1a4('0x27')]:undefined;this[_0xe1a4('0x28')]=_0x2d7a98[_0xe1a4('0x28')]?_0x2d7a98[_0xe1a4('0x28')]:undefined;this[_0xe1a4('0x29')]=_0x2d7a98[_0xe1a4('0x28')]?_0x2d7a98[_0xe1a4('0x28')][_0xe1a4('0x0')]:undefined;this['dialAMDActive']=_0x2d7a98[_0xe1a4('0x2a')]||![];this[_0xe1a4('0x2b')]=_0x2d7a98[_0xe1a4('0x2b')];this[_0xe1a4('0x2c')]=_0x2d7a98[_0xe1a4('0x2c')];this[_0xe1a4('0x2d')]=_0x2d7a98['dialAMDAfterGreetingSilence'];this[_0xe1a4('0x2e')]=_0x2d7a98[_0xe1a4('0x2e')];this[_0xe1a4('0x2f')]=_0x2d7a98[_0xe1a4('0x2f')];this[_0xe1a4('0x30')]=_0x2d7a98[_0xe1a4('0x30')];this[_0xe1a4('0x31')]=_0x2d7a98[_0xe1a4('0x31')];this[_0xe1a4('0x32')]=_0x2d7a98['dialAMDSilenceThreshold'];this[_0xe1a4('0x33')]=_0x2d7a98['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x12ab=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC'];(function(_0x274c20,_0x12f596){var _0x270896=function(_0x381070){while(--_0x381070){_0x274c20['push'](_0x274c20['shift']());}};_0x270896(++_0x12f596);}(_0x12ab,0x11c));var _0xb12a=function(_0xd21390,_0x1dd264){_0xd21390=_0xd21390-0x0;var _0x5d09ef=_0x12ab[_0xd21390];return _0x5d09ef;};'use strict';function Campaign(_0x510dbe){this['id']=_0x510dbe['id']||0x0;this[_0xb12a('0x0')]=_0x510dbe[_0xb12a('0x0')]||'';this[_0xb12a('0x1')]=_0x510dbe['type']||_0xb12a('0x2');this[_0xb12a('0x3')]=0x0;this[_0xb12a('0x4')]=0x0;this[_0xb12a('0x5')]=0x0;this[_0xb12a('0x6')]=0x0;this[_0xb12a('0x7')]='';this[_0xb12a('0x8')]=!![];this[_0xb12a('0x9')]=_0x510dbe[_0xb12a('0x9')];this['limitCalls']=_0x510dbe[_0xb12a('0xa')];this[_0xb12a('0xb')]=_0x510dbe[_0xb12a('0xb')]||null;this[_0xb12a('0xc')]=_0x510dbe[_0xb12a('0xc')]?_0x510dbe[_0xb12a('0xc')]:null;this[_0xb12a('0xd')]=_0x510dbe['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x510dbe['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x510dbe[_0xb12a('0xe')]||0x1e;this[_0xb12a('0xf')]=_0x510dbe[_0xb12a('0xf')];this[_0xb12a('0x10')]=_0x510dbe[_0xb12a('0x10')];this[_0xb12a('0x11')]=_0x510dbe[_0xb12a('0x11')];this[_0xb12a('0x12')]=_0x510dbe['dialBusyRetryFrequency'];this[_0xb12a('0x13')]=_0x510dbe[_0xb12a('0x13')];this[_0xb12a('0x14')]=_0x510dbe[_0xb12a('0x14')];this[_0xb12a('0x15')]=_0x510dbe[_0xb12a('0x15')];this[_0xb12a('0x16')]=_0x510dbe[_0xb12a('0x16')]||0x3;this[_0xb12a('0x17')]=_0x510dbe[_0xb12a('0x17')]||0x96;this[_0xb12a('0x18')]=_0x510dbe[_0xb12a('0x18')]||0x3;this['dialDropRetryFrequency']=_0x510dbe[_0xb12a('0x19')]||0x96;this[_0xb12a('0x1a')]=_0x510dbe[_0xb12a('0x1a')]||0x3;this[_0xb12a('0x1b')]=_0x510dbe[_0xb12a('0x1b')]||0x96;this[_0xb12a('0x1c')]=_0x510dbe[_0xb12a('0x1c')]||0x3;this[_0xb12a('0x1d')]=_0x510dbe[_0xb12a('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x510dbe[_0xb12a('0x1e')]||0x3;this[_0xb12a('0x1f')]=_0x510dbe[_0xb12a('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x510dbe[_0xb12a('0x20')]||_0xb12a('0x21');this['dialPrefix']=_0x510dbe[_0xb12a('0x22')]||undefined;this[_0xb12a('0x23')]=_0x510dbe[_0xb12a('0x23')]||undefined;this[_0xb12a('0x24')]=_0x510dbe[_0xb12a('0x24')]||undefined;this[_0xb12a('0x25')]=_0x510dbe[_0xb12a('0x25')]?_0x510dbe[_0xb12a('0x25')]:undefined;this[_0xb12a('0x26')]=_0x510dbe[_0xb12a('0x26')]?_0x510dbe[_0xb12a('0x26')]:undefined;this[_0xb12a('0x27')]=_0x510dbe['Interval']?_0x510dbe[_0xb12a('0x27')]:undefined;this[_0xb12a('0x28')]=_0x510dbe[_0xb12a('0x28')]?_0x510dbe['SquareProject']:undefined;this[_0xb12a('0x29')]=_0x510dbe[_0xb12a('0x28')]?_0x510dbe['SquareProject']['name']:undefined;this['dialAMDActive']=_0x510dbe[_0xb12a('0x2a')]||![];this[_0xb12a('0x2b')]=_0x510dbe['dialAMDInitialSilence'];this[_0xb12a('0x2c')]=_0x510dbe[_0xb12a('0x2c')];this[_0xb12a('0x2d')]=_0x510dbe['dialAMDAfterGreetingSilence'];this[_0xb12a('0x2e')]=_0x510dbe[_0xb12a('0x2e')];this['dialAMDMinWordLength']=_0x510dbe[_0xb12a('0x2f')];this[_0xb12a('0x30')]=_0x510dbe['dialAMDBetweenWordsSilence'];this[_0xb12a('0x31')]=_0x510dbe[_0xb12a('0x31')];this['dialAMDSilenceThreshold']=_0x510dbe[_0xb12a('0x32')];this[_0xb12a('0x33')]=_0x510dbe[_0xb12a('0x33')];}module[_0xb12a('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 4833787..cb79621 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 _0xc0a6=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','lastapplication','lastdata','billableseconds','type','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','calleridname'];(function(_0x19fe01,_0x2242d6){var _0x16bf47=function(_0x1eee7d){while(--_0x1eee7d){_0x19fe01['push'](_0x19fe01['shift']());}};_0x16bf47(++_0x2242d6);}(_0xc0a6,0xcb));var _0x6c0a=function(_0x57012c,_0x457dd9){_0x57012c=_0x57012c-0x0;var _0x3bb06d=_0xc0a6[_0x57012c];return _0x3bb06d;};'use strict';function Channel(){this[_0x6c0a('0x0')]=null;this[_0x6c0a('0x1')]='';this['destinationchannel']='';this[_0x6c0a('0x2')]=0x0;this[_0x6c0a('0x3')]='';this[_0x6c0a('0x4')]=undefined;this[_0x6c0a('0x5')]=undefined;this[_0x6c0a('0x6')]=0x0;this[_0x6c0a('0x7')]='';this[_0x6c0a('0x8')]=0x0;this[_0x6c0a('0x9')]=0x0;this['exten']=0x0;this[_0x6c0a('0xa')]=![];this[_0x6c0a('0xb')]=null;this[_0x6c0a('0xc')]=null;this[_0x6c0a('0xd')]=![];this['abandoned']=![];this[_0x6c0a('0xe')]='';this[_0x6c0a('0xf')]='';this['duration']=0x0;this[_0x6c0a('0x10')]=0x0;this['holdtime']=0x0;this[_0x6c0a('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x6c0a('0x12')]=null;this['monitors']=[];this[_0x6c0a('0x13')]=undefined;this[_0x6c0a('0x14')]=undefined;this[_0x6c0a('0x15')]=undefined;this['mohtime']=0x0;}module[_0x6c0a('0x16')]=Channel; \ No newline at end of file +var _0xdf62=['channel','destinationchannel','calleridnum','calleridname','connectedlinenum','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime'];(function(_0x11b547,_0x5c83eb){var _0x4253c4=function(_0x1d15de){while(--_0x1d15de){_0x11b547['push'](_0x11b547['shift']());}};_0x4253c4(++_0x5c83eb);}(_0xdf62,0x151));var _0x2df6=function(_0x11aee7,_0x182443){_0x11aee7=_0x11aee7-0x0;var _0x4a9985=_0xdf62[_0x11aee7];return _0x4a9985;};'use strict';function Channel(){this[_0x2df6('0x0')]=null;this[_0x2df6('0x1')]='';this[_0x2df6('0x2')]='';this[_0x2df6('0x3')]=0x0;this[_0x2df6('0x4')]='';this[_0x2df6('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x2df6('0x6')]='';this[_0x2df6('0x7')]=0x0;this[_0x2df6('0x8')]=0x0;this[_0x2df6('0x9')]=0x0;this[_0x2df6('0xa')]=![];this[_0x2df6('0xb')]=null;this[_0x2df6('0xc')]=null;this['unmanaged']=![];this[_0x2df6('0xd')]=![];this['lastapplication']='';this[_0x2df6('0xe')]='';this[_0x2df6('0xf')]=0x0;this[_0x2df6('0x10')]=0x0;this[_0x2df6('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x2df6('0x12')]=null;this[_0x2df6('0x13')]=![];this[_0x2df6('0x14')]=null;this[_0x2df6('0x15')]=null;this['monitors']=[];this[_0x2df6('0x16')]=undefined;this[_0x2df6('0x17')]=undefined;this['transferType']=undefined;this[_0x2df6('0x18')]=0x0;}module[_0x2df6('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 411f3ca..463d440 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 _0x8a53=['consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0xb60962,_0x1e85a1){var _0x2a892c=function(_0x2e73f3){while(--_0x2e73f3){_0xb60962['push'](_0xb60962['shift']());}};_0x2a892c(++_0x1e85a1);}(_0x8a53,0x125));var _0x38a5=function(_0x1b11ea,_0xe164b){_0x1b11ea=_0x1b11ea-0x0;var _0x5e9a75=_0x8a53[_0x1b11ea];return _0x5e9a75;};'use strict';function DeskAccount(_0x4249fb){this['id']=_0x4249fb['id']||0x0;this[_0x38a5('0x0')]=_0x4249fb[_0x38a5('0x0')]||'';this[_0x38a5('0x1')]=_0x4249fb['username']||'';this['remoteUri']=_0x4249fb[_0x38a5('0x2')]||'';this['authType']=_0x4249fb['authType']||'';this[_0x38a5('0x3')]=_0x4249fb['password']||'';this[_0x38a5('0x4')]=_0x4249fb[_0x38a5('0x4')]||'';this[_0x38a5('0x5')]=_0x4249fb[_0x38a5('0x5')]||'';this[_0x38a5('0x6')]=_0x4249fb[_0x38a5('0x6')]||'';this[_0x38a5('0x7')]=_0x4249fb[_0x38a5('0x7')]||'';this['type']=_0x4249fb['type']||'';this['serverUrl']=_0x4249fb[_0x38a5('0x8')]||'';this[_0x38a5('0x9')]=_0x4249fb[_0x38a5('0x9')]||{};}module[_0x38a5('0xa')]=DeskAccount; \ No newline at end of file +var _0x1754=['authType','password','consumerKey','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x4ba508,_0x1706bd){var _0x334627=function(_0x2748ef){while(--_0x2748ef){_0x4ba508['push'](_0x4ba508['shift']());}};_0x334627(++_0x1706bd);}(_0x1754,0xf9));var _0x4175=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0x1754[_0x593752];return _0x4612be;};'use strict';function DeskAccount(_0x34b62a){this['id']=_0x34b62a['id']||0x0;this[_0x4175('0x0')]=_0x34b62a[_0x4175('0x0')]||'';this[_0x4175('0x1')]=_0x34b62a[_0x4175('0x1')]||'';this['remoteUri']=_0x34b62a[_0x4175('0x2')]||'';this[_0x4175('0x3')]=_0x34b62a[_0x4175('0x3')]||'';this[_0x4175('0x4')]=_0x34b62a['password']||'';this['consumerKey']=_0x34b62a[_0x4175('0x5')]||'';this['consumerSecret']=_0x34b62a['consumerSecret']||'';this[_0x4175('0x6')]=_0x34b62a[_0x4175('0x6')]||'';this[_0x4175('0x7')]=_0x34b62a[_0x4175('0x7')]||'';this[_0x4175('0x8')]=_0x34b62a[_0x4175('0x8')]||'';this[_0x4175('0x9')]=_0x34b62a[_0x4175('0x9')]||'';this[_0x4175('0xa')]=_0x34b62a[_0x4175('0xa')]||{};}module[_0x4175('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 7ef5b4f..934d199 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 _0x750a=['tenantId','clientId','clientSecret','serverUrl','exports','name','username','password','remoteUri'];(function(_0x102536,_0x3331a7){var _0x49bb85=function(_0x8ef7e1){while(--_0x8ef7e1){_0x102536['push'](_0x102536['shift']());}};_0x49bb85(++_0x3331a7);}(_0x750a,0x140));var _0xa750=function(_0x536350,_0x25e29e){_0x536350=_0x536350-0x0;var _0x47401a=_0x750a[_0x536350];return _0x47401a;};'use strict';function Dynamics365Account(_0x4eae95){this['id']=_0x4eae95['id']||0x0;this[_0xa750('0x0')]=_0x4eae95['name']||'';this['username']=_0x4eae95[_0xa750('0x1')]||'';this[_0xa750('0x2')]=_0x4eae95[_0xa750('0x2')]||'';this[_0xa750('0x3')]=_0x4eae95[_0xa750('0x3')]||'';this[_0xa750('0x4')]=_0x4eae95[_0xa750('0x4')]||'';this[_0xa750('0x5')]=_0x4eae95[_0xa750('0x5')]||'';this[_0xa750('0x6')]=_0x4eae95[_0xa750('0x6')]||{};this[_0xa750('0x7')]=_0x4eae95[_0xa750('0x7')]||'';this['Configurations']=_0x4eae95['Configurations']||{};}module[_0xa750('0x8')]=Dynamics365Account; \ No newline at end of file +var _0x087b=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xc55cb5,_0x353064){var _0x46cdf5=function(_0x23c89c){while(--_0x23c89c){_0xc55cb5['push'](_0xc55cb5['shift']());}};_0x46cdf5(++_0x353064);}(_0x087b,0x11a));var _0xb087=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x087b[_0x17406a];return _0x1501ff;};'use strict';function Dynamics365Account(_0x534915){this['id']=_0x534915['id']||0x0;this[_0xb087('0x0')]=_0x534915['name']||'';this['username']=_0x534915[_0xb087('0x1')]||'';this['password']=_0x534915[_0xb087('0x2')]||'';this[_0xb087('0x3')]=_0x534915[_0xb087('0x3')]||'';this[_0xb087('0x4')]=_0x534915[_0xb087('0x4')]||'';this[_0xb087('0x5')]=_0x534915[_0xb087('0x5')]||'';this[_0xb087('0x6')]=_0x534915[_0xb087('0x6')]||{};this[_0xb087('0x7')]=_0x534915[_0xb087('0x7')]||'';this[_0xb087('0x8')]=_0x534915[_0xb087('0x8')]||{};}module[_0xb087('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 30000b4..9e01adf 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 _0x02fe=['gateway','faxdetect','t38timeout','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x02fe,0x1c7));var _0xe02f=function(_0x54279a,_0x24eaca){_0x54279a=_0x54279a-0x0;var _0xb24b1=_0x02fe[_0x54279a];return _0xb24b1;};'use strict';function FaxAccount(_0x323954){this['id']=_0x323954['id']||0x0;this[_0xe02f('0x0')]=_0x323954[_0xe02f('0x0')]||'';this[_0xe02f('0x1')]=_0x323954['description'];this[_0xe02f('0x2')]=_0x323954[_0xe02f('0x2')];this[_0xe02f('0x3')]=_0x323954[_0xe02f('0x3')];this['localstationid']=_0x323954[_0xe02f('0x4')];this['minrate']=_0x323954[_0xe02f('0x5')]||0x960;this[_0xe02f('0x6')]=_0x323954[_0xe02f('0x6')]||0x3840;this[_0xe02f('0x7')]=_0x323954[_0xe02f('0x7')]||_0xe02f('0x8');this[_0xe02f('0x9')]=_0x323954[_0xe02f('0x9')]||'no';this[_0xe02f('0xa')]=_0x323954[_0xe02f('0xa')]||'no';this[_0xe02f('0xb')]=_0x323954['t38timeout']||0x1388;this['tech']=_0x323954['tech']||_0xe02f('0xc');this['Trunk']=_0x323954[_0xe02f('0xd')]?_0x323954['Trunk']:undefined;this['ListId']=_0x323954['ListId'];this[_0xe02f('0xe')]=_0x323954[_0xe02f('0xe')];}module[_0xe02f('0xf')]=FaxAccount; \ No newline at end of file +var _0x0317=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x44ab86,_0x3f2835){var _0x4de990=function(_0x4c64b5){while(--_0x4c64b5){_0x44ab86['push'](_0x44ab86['shift']());}};_0x4de990(++_0x3f2835);}(_0x0317,0x13e));var _0x7031=function(_0xc2267f,_0x3dacce){_0xc2267f=_0xc2267f-0x0;var _0x2ae701=_0x0317[_0xc2267f];return _0x2ae701;};'use strict';function FaxAccount(_0x1bd22e){this['id']=_0x1bd22e['id']||0x0;this[_0x7031('0x0')]=_0x1bd22e[_0x7031('0x0')]||'';this['description']=_0x1bd22e[_0x7031('0x1')];this[_0x7031('0x2')]=_0x1bd22e[_0x7031('0x2')];this[_0x7031('0x3')]=_0x1bd22e[_0x7031('0x3')];this[_0x7031('0x4')]=_0x1bd22e[_0x7031('0x4')];this[_0x7031('0x5')]=_0x1bd22e['minrate']||0x960;this[_0x7031('0x6')]=_0x1bd22e[_0x7031('0x6')]||0x3840;this[_0x7031('0x7')]=_0x1bd22e[_0x7031('0x7')]||_0x7031('0x8');this[_0x7031('0x9')]=_0x1bd22e[_0x7031('0x9')]||'no';this[_0x7031('0xa')]=_0x1bd22e[_0x7031('0xa')]||'no';this['t38timeout']=_0x1bd22e[_0x7031('0xb')]||0x1388;this[_0x7031('0xc')]=_0x1bd22e[_0x7031('0xc')]||_0x7031('0xd');this['Trunk']=_0x1bd22e['Trunk']?_0x1bd22e[_0x7031('0xe')]:undefined;this[_0x7031('0xf')]=_0x1bd22e[_0x7031('0xf')];this[_0x7031('0x10')]=_0x1bd22e[_0x7031('0x10')];}module[_0x7031('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d9d972b..3805743 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 _0x75ee=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x3fd132,_0x284b33){var _0x48a1b3=function(_0x1434a0){while(--_0x1434a0){_0x3fd132['push'](_0x3fd132['shift']());}};_0x48a1b3(++_0x284b33);}(_0x75ee,0x1b7));var _0xe75e=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x75ee[_0x72895a];return _0x5226d5;};'use strict';function FreshdeskAccount(_0x5c04e1){this['id']=_0x5c04e1['id']||0x0;this[_0xe75e('0x0')]=_0x5c04e1[_0xe75e('0x0')]||'';this[_0xe75e('0x1')]=_0x5c04e1[_0xe75e('0x1')]||'';this[_0xe75e('0x2')]=_0x5c04e1['token']||'';this[_0xe75e('0x3')]=_0x5c04e1[_0xe75e('0x3')]||'';this[_0xe75e('0x4')]=_0x5c04e1[_0xe75e('0x4')]||'';this[_0xe75e('0x5')]=_0x5c04e1[_0xe75e('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xff7b=['remoteUri','serverUrl','Configurations','name','username','token'];(function(_0x19adaa,_0x3e8fc7){var _0x39701e=function(_0x26ad94){while(--_0x26ad94){_0x19adaa['push'](_0x19adaa['shift']());}};_0x39701e(++_0x3e8fc7);}(_0xff7b,0x1e9));var _0xbff7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xff7b[_0x2641f9];return _0x585741;};'use strict';function FreshdeskAccount(_0x10ad49){this['id']=_0x10ad49['id']||0x0;this[_0xbff7('0x0')]=_0x10ad49[_0xbff7('0x0')]||'';this[_0xbff7('0x1')]=_0x10ad49[_0xbff7('0x1')]||'';this['apiKey']=_0x10ad49[_0xbff7('0x2')]||'';this[_0xbff7('0x3')]=_0x10ad49[_0xbff7('0x3')]||'';this[_0xbff7('0x4')]=_0x10ad49['serverUrl']||'';this[_0xbff7('0x5')]=_0x10ad49[_0xbff7('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3b35865..c604e31 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 _0x3468=['Configurations','username','token','remoteUri'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x3468,0x8d));var _0x8346=function(_0x4c920c,_0x1ee00b){_0x4c920c=_0x4c920c-0x0;var _0x2a6282=_0x3468[_0x4c920c];return _0x2a6282;};'use strict';function FreshsalesAccount(_0x1e11ac){this['id']=_0x1e11ac['id']||0x0;this['name']=_0x1e11ac['name']||'';this[_0x8346('0x0')]=_0x1e11ac['username']||'';this['apiKey']=_0x1e11ac[_0x8346('0x1')]||'';this[_0x8346('0x2')]=_0x1e11ac[_0x8346('0x2')]||'';this['serverUrl']=_0x1e11ac['serverUrl']||'';this['Configurations']=_0x1e11ac[_0x8346('0x3')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xfcbe=['username','apiKey','token','remoteUri','serverUrl','exports','name'];(function(_0x218312,_0x532982){var _0x316e47=function(_0x23e73a){while(--_0x23e73a){_0x218312['push'](_0x218312['shift']());}};_0x316e47(++_0x532982);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x24597b,_0x41b5af){_0x24597b=_0x24597b-0x0;var _0x26839b=_0xfcbe[_0x24597b];return _0x26839b;};'use strict';function FreshsalesAccount(_0x54e93d){this['id']=_0x54e93d['id']||0x0;this[_0xefcb('0x0')]=_0x54e93d[_0xefcb('0x0')]||'';this[_0xefcb('0x1')]=_0x54e93d[_0xefcb('0x1')]||'';this[_0xefcb('0x2')]=_0x54e93d[_0xefcb('0x3')]||'';this['remoteUri']=_0x54e93d[_0xefcb('0x4')]||'';this[_0xefcb('0x5')]=_0x54e93d['serverUrl']||'';this['Configurations']=_0x54e93d['Configurations']||{};}module[_0xefcb('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 17749bc..42c0e58 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 _0x1f12=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','motionChannel','voice','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1f12,0xac));var _0x21f1=function(_0x482228,_0x51cc63){_0x482228=_0x482228-0x0;var _0x28f38f=_0x1f12[_0x482228];return _0x28f38f;};'use strict';function QueueReport(){this[_0x21f1('0x0')]=_0x21f1('0x1');this[_0x21f1('0x2')]='';this[_0x21f1('0x3')]='';this[_0x21f1('0x4')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x21f1('0x5')]=null;this['position']=0x1;this[_0x21f1('0x6')]=0x1;this[_0x21f1('0x7')]=![];this[_0x21f1('0x8')]=null;this[_0x21f1('0x9')]=![];this[_0x21f1('0xa')]=null;this[_0x21f1('0xb')]=![];this[_0x21f1('0xc')]=null;this[_0x21f1('0xd')]=0x1;this[_0x21f1('0xe')]='';this[_0x21f1('0xf')]='';this['connectedlinename']='';this[_0x21f1('0x10')]='';this[_0x21f1('0x11')]='';this[_0x21f1('0x12')]='';this[_0x21f1('0x13')]='';this[_0x21f1('0x14')]=0x0;this[_0x21f1('0x15')]=![];this['lastAssignedTo']='';this[_0x21f1('0x16')]=_0x21f1('0x17');this[_0x21f1('0x18')]=0x0;this['variables']={};}module[_0x21f1('0x19')]=QueueReport; \ No newline at end of file +var _0xab3a=['context','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename'];(function(_0x5fef87,_0x2fda24){var _0x4498be=function(_0x233784){while(--_0x233784){_0x5fef87['push'](_0x5fef87['shift']());}};_0x4498be(++_0x2fda24);}(_0xab3a,0x1be));var _0xaab3=function(_0x5ce34a,_0x57887e){_0x5ce34a=_0x5ce34a-0x0;var _0x309350=_0xab3a[_0x5ce34a];return _0x309350;};'use strict';function QueueReport(){this[_0xaab3('0x0')]=_0xaab3('0x1');this['uniqueid']='';this['calleridnum']='';this[_0xaab3('0x2')]='';this[_0xaab3('0x3')]='';this[_0xaab3('0x4')]=null;this[_0xaab3('0x5')]=null;this['position']=0x1;this[_0xaab3('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xaab3('0x7')]=null;this[_0xaab3('0x8')]=![];this['queuecallercompleteAt']=null;this[_0xaab3('0x9')]=![];this[_0xaab3('0xa')]=null;this[_0xaab3('0xb')]=0x1;this['channel']='';this[_0xaab3('0xc')]='';this[_0xaab3('0xd')]='';this['accountcode']='';this[_0xaab3('0xe')]='';this['exten']='';this[_0xaab3('0xf')]='';this[_0xaab3('0x10')]=0x0;this[_0xaab3('0x11')]=![];this[_0xaab3('0x12')]='';this[_0xaab3('0x13')]=_0xaab3('0x14');this[_0xaab3('0x15')]=0x0;this[_0xaab3('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 2e5efd0..929efb4 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 _0xc6ef=['password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6ef,0x81));var _0xfc6e=function(_0x12e6e9,_0x280fd0){_0x12e6e9=_0x12e6e9-0x0;var _0x491607=_0xc6ef[_0x12e6e9];return _0x491607;};'use strict';function SalesforceAccount(_0x439e73){this['id']=_0x439e73['id']||0x0;this[_0xfc6e('0x0')]=_0x439e73[_0xfc6e('0x0')]||'';this[_0xfc6e('0x1')]=_0x439e73['username']||'';this[_0xfc6e('0x2')]=_0x439e73[_0xfc6e('0x2')]||'';this[_0xfc6e('0x3')]=_0x439e73[_0xfc6e('0x3')]||'';this['clientId']=_0x439e73['clientId']||'';this[_0xfc6e('0x4')]=_0x439e73[_0xfc6e('0x4')]||'';this['securityToken']=_0x439e73[_0xfc6e('0x5')]||'';this['type']=_0x439e73[_0xfc6e('0x6')]||_0xfc6e('0x7');this[_0xfc6e('0x8')]=_0x439e73[_0xfc6e('0x8')]||'';this[_0xfc6e('0x9')]=_0x439e73['Configurations']||{};}module[_0xfc6e('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xfa4d=['type','integrationTab','serverUrl','Configurations','name','username','password','clientId','clientSecret','securityToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa4d,0x90));var _0xdfa4=function(_0x3e7263,_0x57065b){_0x3e7263=_0x3e7263-0x0;var _0x2c41f6=_0xfa4d[_0x3e7263];return _0x2c41f6;};'use strict';function SalesforceAccount(_0x2c5ccd){this['id']=_0x2c5ccd['id']||0x0;this[_0xdfa4('0x0')]=_0x2c5ccd['name']||'';this[_0xdfa4('0x1')]=_0x2c5ccd['username']||'';this['remoteUri']=_0x2c5ccd['remoteUri']||'';this[_0xdfa4('0x2')]=_0x2c5ccd[_0xdfa4('0x2')]||'';this[_0xdfa4('0x3')]=_0x2c5ccd[_0xdfa4('0x3')]||'';this[_0xdfa4('0x4')]=_0x2c5ccd[_0xdfa4('0x4')]||'';this[_0xdfa4('0x5')]=_0x2c5ccd[_0xdfa4('0x5')]||'';this[_0xdfa4('0x6')]=_0x2c5ccd[_0xdfa4('0x6')]||_0xdfa4('0x7');this[_0xdfa4('0x8')]=_0x2c5ccd[_0xdfa4('0x8')]||'';this[_0xdfa4('0x9')]=_0x2c5ccd[_0xdfa4('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a7e7cef..6b84b9b 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 _0x50f9=['serverUrl','Configurations','name','username'];(function(_0x345373,_0x587875){var _0x28e6c1=function(_0x56536a){while(--_0x56536a){_0x345373['push'](_0x345373['shift']());}};_0x28e6c1(++_0x587875);}(_0x50f9,0x18a));var _0x950f=function(_0x4dd2a7,_0x1fa277){_0x4dd2a7=_0x4dd2a7-0x0;var _0x3a8cf5=_0x50f9[_0x4dd2a7];return _0x3a8cf5;};'use strict';function ServicenowAccount(_0x339f74){this['id']=_0x339f74['id']||0x0;this[_0x950f('0x0')]=_0x339f74[_0x950f('0x0')]||'';this[_0x950f('0x1')]=_0x339f74['username']||'';this['password']=_0x339f74['password']||'';this['remoteUri']=_0x339f74['remoteUri']||'';this[_0x950f('0x2')]=_0x339f74['serverUrl']||'';this[_0x950f('0x3')]=_0x339f74['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x9d29=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x9d29,0x165));var _0x99d2=function(_0x3eaf91,_0x550f66){_0x3eaf91=_0x3eaf91-0x0;var _0x5aa8b2=_0x9d29[_0x3eaf91];return _0x5aa8b2;};'use strict';function ServicenowAccount(_0x35d76f){this['id']=_0x35d76f['id']||0x0;this[_0x99d2('0x0')]=_0x35d76f[_0x99d2('0x0')]||'';this[_0x99d2('0x1')]=_0x35d76f[_0x99d2('0x1')]||'';this[_0x99d2('0x2')]=_0x35d76f[_0x99d2('0x2')]||'';this[_0x99d2('0x3')]=_0x35d76f[_0x99d2('0x3')]||'';this[_0x99d2('0x4')]=_0x35d76f[_0x99d2('0x4')]||'';this[_0x99d2('0x5')]=_0x35d76f[_0x99d2('0x5')]||{};}module[_0x99d2('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index bd67e4e..6bc5d71 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 _0x54b2=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x54b2,0x6e));var _0x254b=function(_0x311b11,_0xceebac){_0x311b11=_0x311b11-0x0;var _0x20848b=_0x54b2[_0x311b11];return _0x20848b;};'use strict';function SugarcrmAccount(_0x39694b){this['id']=_0x39694b['id']||0x0;this['name']=_0x39694b[_0x254b('0x0')]||'';this[_0x254b('0x1')]=_0x39694b[_0x254b('0x1')]||'';this[_0x254b('0x2')]=_0x39694b[_0x254b('0x2')]||'';this['remoteUri']=_0x39694b[_0x254b('0x3')]||'';this[_0x254b('0x4')]=_0x39694b[_0x254b('0x4')]||'';this[_0x254b('0x5')]=_0x39694b[_0x254b('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xbfd0=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xbfd0,0x14f));var _0x0bfd=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbfd0[_0x23e7c1];return _0x1add43;};'use strict';function SugarcrmAccount(_0x2f7d85){this['id']=_0x2f7d85['id']||0x0;this['name']=_0x2f7d85[_0x0bfd('0x0')]||'';this[_0x0bfd('0x1')]=_0x2f7d85[_0x0bfd('0x1')]||'';this[_0x0bfd('0x2')]=_0x2f7d85[_0x0bfd('0x2')]||'';this[_0x0bfd('0x3')]=_0x2f7d85[_0x0bfd('0x3')]||'';this[_0x0bfd('0x4')]=_0x2f7d85[_0x0bfd('0x4')]||'';this[_0x0bfd('0x5')]=_0x2f7d85[_0x0bfd('0x5')]||{};}module[_0x0bfd('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9a732a3..20a2760 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 _0x58d6=['accountcode','stateTime','status','unknown','address','name'];(function(_0x460ad6,_0x10a748){var _0x391879=function(_0x530b17){while(--_0x530b17){_0x460ad6['push'](_0x460ad6['shift']());}};_0x391879(++_0x10a748);}(_0x58d6,0x1d3));var _0x658d=function(_0x1e7944,_0x5a1ee7){_0x1e7944=_0x1e7944-0x0;var _0x4be825=_0x58d6[_0x1e7944];return _0x4be825;};'use strict';function Telephone(_0x9e566c){this['id']=_0x9e566c['id']||0x0;this[_0x658d('0x0')]=_0x9e566c[_0x658d('0x0')]||'';this['accountcode']=_0x9e566c[_0x658d('0x1')]||'';this['state']='unknown';this[_0x658d('0x2')]=0x0;this[_0x658d('0x3')]=_0x658d('0x4');this[_0x658d('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x3f64=['name','accountcode','unknown','stateTime','status','address'];(function(_0x12c3a0,_0x37b939){var _0x5203ca=function(_0x1a4ac1){while(--_0x1a4ac1){_0x12c3a0['push'](_0x12c3a0['shift']());}};_0x5203ca(++_0x37b939);}(_0x3f64,0xf0));var _0x43f6=function(_0x23de4b,_0x3e233a){_0x23de4b=_0x23de4b-0x0;var _0x483ec5=_0x3f64[_0x23de4b];return _0x483ec5;};'use strict';function Telephone(_0x5383e8){this['id']=_0x5383e8['id']||0x0;this['name']=_0x5383e8[_0x43f6('0x0')]||'';this[_0x43f6('0x1')]=_0x5383e8['accountcode']||'';this['state']=_0x43f6('0x2');this[_0x43f6('0x3')]=0x0;this[_0x43f6('0x4')]=_0x43f6('0x2');this[_0x43f6('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ea5cbb5..3a001d9 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(_0x11596e,_0x545390){var _0x4f7be1=function(_0x37be13){while(--_0x37be13){_0x11596e['push'](_0x11596e['shift']());}};_0x4f7be1(++_0x545390);}(_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 +var _0xb10b=['name','html'];(function(_0x1931a9,_0x3b30f4){var _0x15054b=function(_0x2fa437){while(--_0x2fa437){_0x1931a9['push'](_0x1931a9['shift']());}};_0x15054b(++_0x3b30f4);}(_0xb10b,0x12a));var _0xbb10=function(_0x214a03,_0x2e4061){_0x214a03=_0x214a03-0x0;var _0xda476a=_0xb10b[_0x214a03];return _0xda476a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index eccadb0..24d5b21 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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x4af0dc,_0x2acbeb){var _0xd30e7f=function(_0x442dd2){while(--_0x442dd2){_0x4af0dc['push'](_0x4af0dc['shift']());}};_0xd30e7f(++_0x2acbeb);}(_0x8603,0x190));var _0x3860=function(_0x55dba4,_0x38c942){_0x55dba4=_0x55dba4-0x0;var _0x54c6df=_0x8603[_0x55dba4];return _0x54c6df;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0x0b0e[_0x277721];return _0x286051;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b22b82c..f43fdcc 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 _0xb5bc=['address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime'];(function(_0x1221a8,_0x42fafa){var _0x81b49e=function(_0x4f3b44){while(--_0x4f3b44){_0x1221a8['push'](_0x1221a8['shift']());}};_0x81b49e(++_0x42fafa);}(_0xb5bc,0xed));var _0xcb5b=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0xb5bc[_0x187399];return _0x40fa92;};'use strict';function Trunk(_0x282b08){this['id']=_0x282b08['id']||0x0;this[_0xcb5b('0x0')]=_0x282b08[_0xcb5b('0x0')]||![];this[_0xcb5b('0x1')]=_0x282b08[_0xcb5b('0x1')]||'';this[_0xcb5b('0x2')]=_0xcb5b('0x3');this[_0xcb5b('0x4')]=0x0;this[_0xcb5b('0x5')]=_0xcb5b('0x3');this[_0xcb5b('0x6')]=_0x282b08[_0xcb5b('0x6')]&&_0x282b08['registry'][_0xcb5b('0x7')](':')?_0x282b08['registry'][_0xcb5b('0x8')](':')[0x0]:'';this[_0xcb5b('0x9')]='';this[_0xcb5b('0xa')]='';this[_0xcb5b('0xb')]='';this['domainport']='';this[_0xcb5b('0xc')]='';this[_0xcb5b('0xd')]=_0xcb5b('0x3');this[_0xcb5b('0xe')]='';this[_0xcb5b('0xf')]='';this['defaultuser']=_0x282b08[_0xcb5b('0x10')]||'';}module[_0xcb5b('0x11')]=Trunk; \ No newline at end of file +var _0x0dbb=['domain','domainport','refresh','registrationtime','address','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0dbb,0x132));var _0xb0db=function(_0x378bb8,_0xbcd196){_0x378bb8=_0x378bb8-0x0;var _0x56b4e9=_0x0dbb[_0x378bb8];return _0x56b4e9;};'use strict';function Trunk(_0x116d45){this['id']=_0x116d45['id']||0x0;this[_0xb0db('0x0')]=_0x116d45[_0xb0db('0x0')]||![];this['name']=_0x116d45[_0xb0db('0x1')]||'';this[_0xb0db('0x2')]='unknown';this[_0xb0db('0x3')]=0x0;this[_0xb0db('0x4')]=_0xb0db('0x5');this[_0xb0db('0x6')]=_0x116d45['registry']&&_0x116d45[_0xb0db('0x6')][_0xb0db('0x7')](':')?_0x116d45[_0xb0db('0x6')][_0xb0db('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0xb0db('0x9')]='';this[_0xb0db('0xa')]='';this[_0xb0db('0xb')]='';this['stateRegistry']=_0xb0db('0x5');this[_0xb0db('0xc')]='';this[_0xb0db('0xd')]='';this['defaultuser']=_0x116d45['defaultuser']||'';}module[_0xb0db('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 19d2557..1af845f 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 _0x787f=['none','mandatoryDisposition','exports','recordingFormat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x787f,0x1c7));var _0xf787=function(_0xc7c78d,_0x1dd9fb){_0xc7c78d=_0xc7c78d-0x0;var _0x175f3d=_0x787f[_0xc7c78d];return _0x175f3d;};'use strict';function voiceExtension(_0x11af01){this['id']=_0x11af01['id']||0x0;this['exten']=_0x11af01['exten']||'';this[_0xf787('0x0')]=_0x11af01[_0xf787('0x0')]||_0xf787('0x1');this[_0xf787('0x2')]=_0x11af01[_0xf787('0x2')]||![];}module[_0xf787('0x3')]=voiceExtension; \ No newline at end of file +var _0xf44c=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x151e75,_0x491df9){var _0x50395b=function(_0x2e8b47){while(--_0x2e8b47){_0x151e75['push'](_0x151e75['shift']());}};_0x50395b(++_0x491df9);}(_0xf44c,0x10a));var _0xcf44=function(_0x20e66d,_0x3a677b){_0x20e66d=_0x20e66d-0x0;var _0x4833c0=_0xf44c[_0x20e66d];return _0x4833c0;};'use strict';function voiceExtension(_0x4ea556){this['id']=_0x4ea556['id']||0x0;this[_0xcf44('0x0')]=_0x4ea556['exten']||'';this[_0xcf44('0x1')]=_0x4ea556[_0xcf44('0x1')]||_0xcf44('0x2');this[_0xcf44('0x3')]=_0x4ea556[_0xcf44('0x3')]||![];}module[_0xcf44('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 56d82fe..6c29767 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 _0x7c0d=['dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'];(function(_0x37fea4,_0x15e543){var _0x462ced=function(_0x22410b){while(--_0x22410b){_0x37fea4['push'](_0x37fea4['shift']());}};_0x462ced(++_0x15e543);}(_0x7c0d,0x7c));var _0xd7c0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7c0d[_0x57b54c];return _0x59cc19;};'use strict';var statusDesc=[_0xd7c0('0x0'),_0xd7c0('0x1'),'inuse',_0xd7c0('0x2'),_0xd7c0('0x3'),_0xd7c0('0x4'),_0xd7c0('0x5'),_0xd7c0('0x6'),_0xd7c0('0x7')];var monitorFormat={'wav':_0xd7c0('0x8'),'wav49':_0xd7c0('0x9'),'gsm':_0xd7c0('0xa')};var strategy={'rrmemory':_0xd7c0('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2bc9ef){this['id']=_0x2bc9ef['id']||0x0;this[_0xd7c0('0xc')]=_0x2bc9ef[_0xd7c0('0xc')]||'';this[_0xd7c0('0xd')]=_0x2bc9ef[_0xd7c0('0xd')]||'';this[_0xd7c0('0xe')]=_0x2bc9ef['type']||_0xd7c0('0xf');this[_0xd7c0('0x10')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0xd7c0('0x11')]=0x0;this[_0xd7c0('0x12')]=0x0;this[_0xd7c0('0x13')]=0x0;this[_0xd7c0('0x14')]=0x0;this[_0xd7c0('0x15')]=0x0;this[_0xd7c0('0x16')]=0x0;this[_0xd7c0('0x17')]=0x0;this['available']=0x0;this[_0xd7c0('0x18')]=_0x2bc9ef[_0xd7c0('0x18')]||![];this[_0xd7c0('0x19')]=_0x2bc9ef[_0xd7c0('0x19')]||0xa;this[_0xd7c0('0x1a')]=_0x2bc9ef[_0xd7c0('0x1a')]||'no';this[_0xd7c0('0x1b')]=!![];this['message']='';this[_0xd7c0('0x1c')]=0x0;this[_0xd7c0('0x1d')]=0x0;this[_0xd7c0('0x1e')]=_0x2bc9ef['dialTimezone']||null;this[_0xd7c0('0x1f')]=_0x2bc9ef[_0xd7c0('0x1f')]?_0x2bc9ef[_0xd7c0('0x1f')]:null;this[_0xd7c0('0x20')]=_0x2bc9ef[_0xd7c0('0x20')];this[_0xd7c0('0x21')]=_0x2bc9ef[_0xd7c0('0x21')]||'progressive';this[_0xd7c0('0x22')]=_0x2bc9ef[_0xd7c0('0x22')]||0x0;this['dialLimitQueue']=_0x2bc9ef[_0xd7c0('0x23')]||0x0;this['dialPowerLevel']=_0x2bc9ef[_0xd7c0('0x24')]||0x1;this[_0xd7c0('0x25')]=_0x2bc9ef['dialPredictiveOptimization']||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x2bc9ef[_0xd7c0('0x26')]||0.03;this[_0xd7c0('0x27')]=_0x2bc9ef[_0xd7c0('0x27')]||0x258;this[_0xd7c0('0x28')]=_0x2bc9ef['dialOriginateCallerIdName']||'anonymous';this[_0xd7c0('0x29')]=_0x2bc9ef[_0xd7c0('0x29')]||_0xd7c0('0x2a');this['dialOriginateTimeout']=_0x2bc9ef[_0xd7c0('0x2b')]||0x1e;this[_0xd7c0('0x2c')]=_0x2bc9ef[_0xd7c0('0x2c')]||'tTxX';this[_0xd7c0('0x2d')]=_0x2bc9ef[_0xd7c0('0x2d')]||0x3;this[_0xd7c0('0x2e')]=_0x2bc9ef[_0xd7c0('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x2bc9ef[_0xd7c0('0x2f')]||0x3;this[_0xd7c0('0x30')]=_0x2bc9ef[_0xd7c0('0x30')]||0x96;this[_0xd7c0('0x31')]=_0x2bc9ef[_0xd7c0('0x31')]||0x3;this[_0xd7c0('0x32')]=_0x2bc9ef[_0xd7c0('0x32')]||0x96;this[_0xd7c0('0x33')]=_0x2bc9ef[_0xd7c0('0x33')]||0x3;this[_0xd7c0('0x34')]=_0x2bc9ef[_0xd7c0('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2bc9ef[_0xd7c0('0x35')]||0x3;this[_0xd7c0('0x36')]=_0x2bc9ef[_0xd7c0('0x36')]||0x96;this[_0xd7c0('0x37')]=_0x2bc9ef[_0xd7c0('0x37')]||0x3;this[_0xd7c0('0x38')]=_0x2bc9ef[_0xd7c0('0x38')]||0x96;this[_0xd7c0('0x39')]=_0x2bc9ef[_0xd7c0('0x39')]||0x3;this[_0xd7c0('0x3a')]=_0x2bc9ef[_0xd7c0('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x2bc9ef[_0xd7c0('0x3b')]||0x3;this[_0xd7c0('0x3c')]=_0x2bc9ef['dialMachineRetryFrequency']||0x96;this[_0xd7c0('0x3d')]=_0x2bc9ef[_0xd7c0('0x3d')]||0x3;this[_0xd7c0('0x3e')]=_0x2bc9ef['dialAgentRejectRetryFrequency']||0x96;this[_0xd7c0('0x3f')]=_0x2bc9ef[_0xd7c0('0x3f')]||0x4;this[_0xd7c0('0x40')]=_0x2bc9ef[_0xd7c0('0x40')]?_0x2bc9ef['Trunk']:undefined;this['TrunkBackup']=_0x2bc9ef[_0xd7c0('0x41')]?_0x2bc9ef[_0xd7c0('0x41')]:undefined;this[_0xd7c0('0x42')]=_0x2bc9ef[_0xd7c0('0x42')]||undefined;this[_0xd7c0('0x43')]=_0x2bc9ef[_0xd7c0('0x43')]?_0x2bc9ef['Interval']:undefined;this[_0xd7c0('0x44')]=_0x2bc9ef[_0xd7c0('0x44')]||'DESC';this[_0xd7c0('0x45')]=_0x2bc9ef[_0xd7c0('0x45')]||undefined;this[_0xd7c0('0x46')]=_0x2bc9ef[_0xd7c0('0x46')]||undefined;this['strategy']=strategy[_0x2bc9ef['strategy']]||_0xd7c0('0xb');this[_0xd7c0('0x47')]=!![];this[_0xd7c0('0x48')]=_0x2bc9ef['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2bc9ef[_0xd7c0('0x49')];this[_0xd7c0('0x4a')]=_0x2bc9ef[_0xd7c0('0x4a')];this[_0xd7c0('0x4b')]=_0x2bc9ef[_0xd7c0('0x4b')];this[_0xd7c0('0x4c')]=_0x2bc9ef[_0xd7c0('0x4c')];this['dialAMDMinWordLength']=_0x2bc9ef[_0xd7c0('0x4d')];this[_0xd7c0('0x4e')]=_0x2bc9ef[_0xd7c0('0x4e')];this['dialAMDMaximumNumberOfWords']=_0x2bc9ef[_0xd7c0('0x4f')];this[_0xd7c0('0x50')]=_0x2bc9ef[_0xd7c0('0x50')];this[_0xd7c0('0x51')]=_0x2bc9ef[_0xd7c0('0x51')];this[_0xd7c0('0x52')]=0x0;this[_0xd7c0('0x53')]=0x0;this[_0xd7c0('0x54')]=_0x2bc9ef[_0xd7c0('0x54')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xd7c0('0x55')]=0x0;this[_0xd7c0('0x56')]=0x0;this[_0xd7c0('0x57')]=0x0;this[_0xd7c0('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd7c0('0x59')]=0x0;this[_0xd7c0('0x5a')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xd7c0('0x5b')]=0x0;this[_0xd7c0('0x5c')]=0x0;this[_0xd7c0('0x5d')]=0x0;this[_0xd7c0('0x5e')]=undefined;this[_0xd7c0('0x5f')]=undefined;this[_0xd7c0('0x60')]=undefined;this[_0xd7c0('0x61')]=1.05;this[_0xd7c0('0x62')]=0x0;this[_0xd7c0('0x63')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xd7c0('0x64')]=0x0;this[_0xd7c0('0x65')]=0x0;this[_0xd7c0('0x66')]=0x0;this[_0xd7c0('0x67')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2bc9ef['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xd7c0('0x68')]=_0x2bc9ef[_0xd7c0('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd7c0('0x6a')]=0x0;this[_0xd7c0('0x6b')]=0x1;this[_0xd7c0('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this[_0xd7c0('0x6d')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x2bc9ef[_0xd7c0('0x6e')]||0x1e;this[_0xd7c0('0x6f')]=_0x2bc9ef['dialRecallInQueue']||![];this[_0xd7c0('0x70')]=!!_0x2bc9ef[_0xd7c0('0x70')]||![];this['dialPreviewRecallmeReminder']=!!_0x2bc9ef[_0xd7c0('0x71')]||![];this['dialQueueProject2']=_0x2bc9ef[_0xd7c0('0x72')]||undefined;this[_0xd7c0('0x73')]=_0x2bc9ef[_0xd7c0('0x73')]||![];this['dialAgiAfterHangupAgent']=_0x2bc9ef[_0xd7c0('0x74')]||![];this[_0xd7c0('0xd')]=monitorFormat[_0x2bc9ef[_0xd7c0('0xd')]]?monitorFormat[_0x2bc9ef['monitor_format']]:undefined;this[_0xd7c0('0x75')]=_0x2bc9ef[_0xd7c0('0x75')]||![];this['mandatoryDispositionPause']=_0x2bc9ef[_0xd7c0('0x76')]?_0x2bc9ef[_0xd7c0('0x76')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x3e04=['mandatoryDisposition','mandatoryDispositionPause','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','rrmemory','name','monitor_format','type','waiting','talking','total','answered','sumDuration','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent'];(function(_0x44486f,_0x3e640d){var _0xf631ae=function(_0x2b0bd9){while(--_0x2b0bd9){_0x44486f['push'](_0x44486f['shift']());}};_0xf631ae(++_0x3e640d);}(_0x3e04,0xf2));var _0x43e0=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3e04[_0x37bd26];return _0xe83dc4;};'use strict';var statusDesc=['unknown',_0x43e0('0x0'),_0x43e0('0x1'),_0x43e0('0x2'),_0x43e0('0x3'),_0x43e0('0x4'),'ringing',_0x43e0('0x5'),_0x43e0('0x6')];var monitorFormat={'wav':_0x43e0('0x7'),'wav49':_0x43e0('0x8'),'gsm':'gsm'};var strategy={'rrmemory':_0x43e0('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x351378){this['id']=_0x351378['id']||0x0;this[_0x43e0('0xa')]=_0x351378[_0x43e0('0xa')]||'';this['monitor_format']=_0x351378[_0x43e0('0xb')]||'';this[_0x43e0('0xc')]=_0x351378[_0x43e0('0xc')]||'inbound';this[_0x43e0('0xd')]=0x0;this[_0x43e0('0xe')]=0x0;this[_0x43e0('0xf')]=0x0;this[_0x43e0('0x10')]=0x0;this[_0x43e0('0x11')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x43e0('0x12')]=0x0;this[_0x43e0('0x13')]=0x0;this[_0x43e0('0x14')]=0x0;this[_0x43e0('0x15')]=0x0;this[_0x43e0('0x16')]=_0x351378[_0x43e0('0x16')]||![];this[_0x43e0('0x17')]=_0x351378[_0x43e0('0x17')]||0xa;this[_0x43e0('0x18')]=_0x351378[_0x43e0('0x18')]||'no';this[_0x43e0('0x19')]=!![];this[_0x43e0('0x1a')]='';this[_0x43e0('0x1b')]=0x0;this[_0x43e0('0x1c')]=0x0;this[_0x43e0('0x1d')]=_0x351378[_0x43e0('0x1d')]||null;this[_0x43e0('0x1e')]=_0x351378[_0x43e0('0x1e')]?_0x351378[_0x43e0('0x1e')]:null;this['dialActive']=_0x351378[_0x43e0('0x1f')];this[_0x43e0('0x20')]=_0x351378[_0x43e0('0x20')]||'progressive';this[_0x43e0('0x21')]=_0x351378[_0x43e0('0x21')]||0x0;this[_0x43e0('0x22')]=_0x351378[_0x43e0('0x22')]||0x0;this[_0x43e0('0x23')]=_0x351378['dialPowerLevel']||0x1;this[_0x43e0('0x24')]=_0x351378[_0x43e0('0x24')]||_0x43e0('0x25');this['dialPredictiveOptimizationPercentage']=_0x351378['dialPredictiveOptimizationPercentage']||0.03;this[_0x43e0('0x26')]=_0x351378[_0x43e0('0x26')]||0x258;this[_0x43e0('0x27')]=_0x351378[_0x43e0('0x27')]||_0x43e0('0x28');this[_0x43e0('0x29')]=_0x351378[_0x43e0('0x29')]||'anonymous';this[_0x43e0('0x2a')]=_0x351378[_0x43e0('0x2a')]||0x1e;this[_0x43e0('0x2b')]=_0x351378[_0x43e0('0x2b')]||_0x43e0('0x2c');this[_0x43e0('0x2d')]=_0x351378[_0x43e0('0x2d')]||0x3;this[_0x43e0('0x2e')]=_0x351378[_0x43e0('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x351378[_0x43e0('0x2f')]||0x3;this[_0x43e0('0x30')]=_0x351378[_0x43e0('0x30')]||0x96;this['dialBusyMaxRetry']=_0x351378[_0x43e0('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x351378[_0x43e0('0x32')]||0x96;this['dialNoAnswerMaxRetry']=_0x351378[_0x43e0('0x33')]||0x3;this[_0x43e0('0x34')]=_0x351378[_0x43e0('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x351378['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x351378['dialNoSuchNumberRetryFrequency']||0x96;this[_0x43e0('0x35')]=_0x351378[_0x43e0('0x35')]||0x3;this[_0x43e0('0x36')]=_0x351378[_0x43e0('0x36')]||0x96;this[_0x43e0('0x37')]=_0x351378[_0x43e0('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x351378[_0x43e0('0x38')]||0x96;this['dialMachineMaxRetry']=_0x351378[_0x43e0('0x39')]||0x3;this[_0x43e0('0x3a')]=_0x351378[_0x43e0('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x351378[_0x43e0('0x3b')]||0x3;this[_0x43e0('0x3c')]=_0x351378[_0x43e0('0x3c')]||0x96;this[_0x43e0('0x3d')]=_0x351378[_0x43e0('0x3d')]||0x4;this[_0x43e0('0x3e')]=_0x351378[_0x43e0('0x3e')]?_0x351378['Trunk']:undefined;this[_0x43e0('0x3f')]=_0x351378['TrunkBackup']?_0x351378['TrunkBackup']:undefined;this[_0x43e0('0x40')]=_0x351378[_0x43e0('0x40')]||undefined;this[_0x43e0('0x41')]=_0x351378[_0x43e0('0x41')]?_0x351378[_0x43e0('0x41')]:undefined;this[_0x43e0('0x42')]=_0x351378[_0x43e0('0x42')]||_0x43e0('0x43');this[_0x43e0('0x44')]=_0x351378['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x43e0('0x45')]=_0x351378[_0x43e0('0x45')]||undefined;this[_0x43e0('0x46')]=strategy[_0x351378['strategy']]||_0x43e0('0x9');this[_0x43e0('0x47')]=!![];this[_0x43e0('0x48')]=_0x351378['dialAMDActive']||![];this[_0x43e0('0x49')]=_0x351378[_0x43e0('0x49')];this[_0x43e0('0x4a')]=_0x351378[_0x43e0('0x4a')];this[_0x43e0('0x4b')]=_0x351378['dialAMDAfterGreetingSilence'];this[_0x43e0('0x4c')]=_0x351378[_0x43e0('0x4c')];this['dialAMDMinWordLength']=_0x351378[_0x43e0('0x4d')];this[_0x43e0('0x4e')]=_0x351378[_0x43e0('0x4e')];this[_0x43e0('0x4f')]=_0x351378['dialAMDMaximumNumberOfWords'];this[_0x43e0('0x50')]=_0x351378[_0x43e0('0x50')];this[_0x43e0('0x51')]=_0x351378[_0x43e0('0x51')];this[_0x43e0('0x52')]=0x0;this[_0x43e0('0x53')]=0x0;this[_0x43e0('0x54')]=_0x351378[_0x43e0('0x54')];this[_0x43e0('0x55')]=0x0;this[_0x43e0('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x43e0('0x57')]=0x0;this[_0x43e0('0x58')]=0x0;this[_0x43e0('0x59')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x43e0('0x5a')]=0x0;this[_0x43e0('0x5b')]=0x0;this[_0x43e0('0x5c')]=0x0;this[_0x43e0('0x5d')]=0x0;this[_0x43e0('0x5e')]=0x0;this['outboundReCallsDay']=0x0;this[_0x43e0('0x5f')]=0x0;this[_0x43e0('0x60')]=undefined;this[_0x43e0('0x61')]=undefined;this['handlePredictive']=undefined;this[_0x43e0('0x62')]=1.05;this[_0x43e0('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x43e0('0x64')]=0x0;this[_0x43e0('0x65')]=0x0;this[_0x43e0('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x43e0('0x67')]=0x0;this[_0x43e0('0x68')]=0x0;this[_0x43e0('0x69')]=_0x351378['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x43e0('0x6a')]=_0x351378[_0x43e0('0x6b')]||0xa;this[_0x43e0('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x43e0('0x6d')]=0x1;this[_0x43e0('0x6e')]=0x0;this[_0x43e0('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x43e0('0x70')]=_0x351378[_0x43e0('0x70')]||0x1e;this['dialRecallInQueue']=_0x351378[_0x43e0('0x71')]||![];this[_0x43e0('0x72')]=!!_0x351378['dialPreviewAutoRecallMe']||![];this[_0x43e0('0x73')]=!!_0x351378[_0x43e0('0x73')]||![];this[_0x43e0('0x74')]=_0x351378[_0x43e0('0x74')]||undefined;this['dialAgiAfterHangupClient']=_0x351378['dialAgiAfterHangupClient']||![];this[_0x43e0('0x75')]=_0x351378[_0x43e0('0x75')]||![];this[_0x43e0('0xb')]=monitorFormat[_0x351378[_0x43e0('0xb')]]?monitorFormat[_0x351378['monitor_format']]:undefined;this[_0x43e0('0x76')]=_0x351378[_0x43e0('0x76')]||![];this[_0x43e0('0x77')]=_0x351378['mandatoryDispositionPause']?_0x351378[_0x43e0('0x77')]: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 78b1681..83e543b 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 _0x58a0=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0x58a0,0xce));var _0x058a=function(_0x3cbee0,_0x352a0a){_0x3cbee0=_0x3cbee0-0x0;var _0x2ed094=_0x58a0[_0x3cbee0];return _0x2ed094;};'use strict';function VtigerAccount(_0x33ff67){this['id']=_0x33ff67['id']||0x0;this[_0x058a('0x0')]=_0x33ff67['name']||'';this[_0x058a('0x1')]=_0x33ff67['username']||'';this[_0x058a('0x2')]=_0x33ff67[_0x058a('0x2')]||'';this[_0x058a('0x3')]=_0x33ff67[_0x058a('0x3')]||'';this[_0x058a('0x4')]=_0x33ff67['serverUrl']||'';this[_0x058a('0x5')]=_0x33ff67[_0x058a('0x5')]||{};}module[_0x058a('0x6')]=VtigerAccount; \ No newline at end of file +var _0x9880=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x337801,_0x4ebf13){var _0x222e33=function(_0x497bfa){while(--_0x497bfa){_0x337801['push'](_0x337801['shift']());}};_0x222e33(++_0x4ebf13);}(_0x9880,0x11a));var _0x0988=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0x9880[_0x54de5d];return _0x1b349e;};'use strict';function VtigerAccount(_0x1f33dc){this['id']=_0x1f33dc['id']||0x0;this[_0x0988('0x0')]=_0x1f33dc[_0x0988('0x0')]||'';this[_0x0988('0x1')]=_0x1f33dc[_0x0988('0x1')]||'';this[_0x0988('0x2')]=_0x1f33dc[_0x0988('0x2')]||'';this[_0x0988('0x3')]=_0x1f33dc[_0x0988('0x3')]||'';this[_0x0988('0x4')]=_0x1f33dc['serverUrl']||'';this['Configurations']=_0x1f33dc[_0x0988('0x5')]||{};}module[_0x0988('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 a5210da..6c2eed8 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 _0x6c1f=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x342ec7,_0x590a63){var _0x52c5de=function(_0xa8c29){while(--_0xa8c29){_0x342ec7['push'](_0x342ec7['shift']());}};_0x52c5de(++_0x590a63);}(_0x6c1f,0x10d));var _0xf6c1=function(_0x458d68,_0x1dbe12){_0x458d68=_0x458d68-0x0;var _0x3e4a4b=_0x6c1f[_0x458d68];return _0x3e4a4b;};'use strict';function ZendeskAccount(_0x2dc8ac){this['id']=_0x2dc8ac['id']||0x0;this[_0xf6c1('0x0')]=_0x2dc8ac[_0xf6c1('0x0')]||'';this[_0xf6c1('0x1')]=_0x2dc8ac['username']||'';this[_0xf6c1('0x2')]=_0x2dc8ac[_0xf6c1('0x2')]||'';this['token']=_0x2dc8ac[_0xf6c1('0x3')]||'';this[_0xf6c1('0x4')]=_0x2dc8ac[_0xf6c1('0x4')]||'';this[_0xf6c1('0x5')]=_0x2dc8ac[_0xf6c1('0x5')]||'';this[_0xf6c1('0x6')]=_0x2dc8ac['type']||_0xf6c1('0x7');this[_0xf6c1('0x8')]=_0x2dc8ac[_0xf6c1('0x8')]||'';this[_0xf6c1('0x9')]=_0x2dc8ac[_0xf6c1('0x9')]||{};}module[_0xf6c1('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5666=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x5666,0x170));var _0x6566=function(_0x250c88,_0x1cea94){_0x250c88=_0x250c88-0x0;var _0x55f29d=_0x5666[_0x250c88];return _0x55f29d;};'use strict';function ZendeskAccount(_0x53fbf3){this['id']=_0x53fbf3['id']||0x0;this['name']=_0x53fbf3[_0x6566('0x0')]||'';this[_0x6566('0x1')]=_0x53fbf3[_0x6566('0x1')]||'';this['password']=_0x53fbf3[_0x6566('0x2')]||'';this[_0x6566('0x3')]=_0x53fbf3['token']||'';this['remoteUri']=_0x53fbf3[_0x6566('0x4')]||'';this['authType']=_0x53fbf3[_0x6566('0x5')]||'';this[_0x6566('0x6')]=_0x53fbf3[_0x6566('0x6')]||_0x6566('0x7');this[_0x6566('0x8')]=_0x53fbf3[_0x6566('0x8')]||'';this[_0x6566('0x9')]=_0x53fbf3[_0x6566('0x9')]||{};}module[_0x6566('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 8486755..abe0d0c 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 _0x1478=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5dc061,_0x2e276c){var _0xcc5fe8=function(_0x1b16c9){while(--_0x1b16c9){_0x5dc061['push'](_0x5dc061['shift']());}};_0xcc5fe8(++_0x2e276c);}(_0x1478,0x11e));var _0x8147=function(_0x2f78bd,_0x3c4b24){_0x2f78bd=_0x2f78bd-0x0;var _0x48383e=_0x1478[_0x2f78bd];return _0x48383e;};'use strict';function ZohoAccount(_0x22deee){this['id']=_0x22deee['id']||0x0;this[_0x8147('0x0')]=_0x22deee[_0x8147('0x0')]||'';this[_0x8147('0x1')]=_0x22deee[_0x8147('0x1')]||'';this[_0x8147('0x2')]=_0x22deee[_0x8147('0x2')]||'';this[_0x8147('0x3')]=_0x22deee[_0x8147('0x3')]||'';this[_0x8147('0x4')]=_0x22deee[_0x8147('0x4')]||'';this[_0x8147('0x5')]=_0x22deee[_0x8147('0x5')]||'';this[_0x8147('0x6')]=_0x22deee[_0x8147('0x6')]||'';this[_0x8147('0x7')]=_0x22deee[_0x8147('0x7')]||'';this['refreshToken']=_0x22deee[_0x8147('0x8')]||'';this[_0x8147('0x9')]=_0x22deee[_0x8147('0x9')]||{};}module[_0x8147('0xa')]=ZohoAccount; \ No newline at end of file +var _0x8518=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x158c8b,_0x3c4b38){var _0x446f4e=function(_0x3a094e){while(--_0x3a094e){_0x158c8b['push'](_0x158c8b['shift']());}};_0x446f4e(++_0x3c4b38);}(_0x8518,0xf4));var _0x8851=function(_0x3b1bba,_0x220536){_0x3b1bba=_0x3b1bba-0x0;var _0x4ca374=_0x8518[_0x3b1bba];return _0x4ca374;};'use strict';function ZohoAccount(_0x355246){this['id']=_0x355246['id']||0x0;this[_0x8851('0x0')]=_0x355246[_0x8851('0x0')]||'';this[_0x8851('0x1')]=_0x355246['description']||'';this[_0x8851('0x2')]=_0x355246[_0x8851('0x2')]||'';this[_0x8851('0x3')]=_0x355246[_0x8851('0x3')]||'';this[_0x8851('0x4')]=_0x355246[_0x8851('0x4')]||'';this[_0x8851('0x5')]=_0x355246['clientSecret']||'';this['serverUrl']=_0x355246[_0x8851('0x6')]||'';this[_0x8851('0x7')]=_0x355246['code']||'';this[_0x8851('0x8')]=_0x355246[_0x8851('0x8')]||'';this[_0x8851('0x9')]=_0x355246[_0x8851('0x9')]||{};}module[_0x8851('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 3785921..42fbb44 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 _0xfbaa=['getCaller','\x22%s\x22\x20<%s>','lodash','moment','isNil','string','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0xe8ab41,_0x34740b){var _0x42d0e4=function(_0xce0746){while(--_0xce0746){_0xe8ab41['push'](_0xe8ab41['shift']());}};_0x42d0e4(++_0x34740b);}(_0xfbaa,0x7a));var _0xafba=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfbaa[_0x4c445a];return _0x2f611c;};'use strict';var util=require('util');var _=require(_0xafba('0x0'));var moment=require(_0xafba('0x1'));function checkNameSurname(_0x59858e,_0x13d494,_0xce2c8a){var _0x515a88='';if(!_[_0xafba('0x2')](_0x13d494)&&_0xafba('0x3')===typeof _0x13d494){_0x515a88+=_0x13d494;}if(!_['isNil'](_0xce2c8a)&&_0xafba('0x3')===typeof _0xce2c8a){_0x515a88+='\x20'+_0xce2c8a;}if(_0x515a88!==''){return _0x515a88;}return _0x59858e;}function Action(_0x24f38d,_0x52eb81,_0x412662,_0x12a4ce,_0x32052c){this['uniqueid']=_0x412662||undefined;this[_0xafba('0x4')]=_0x24f38d['id'];this[_0xafba('0x5')]=_0x52eb81['name'];this[_0xafba('0x6')]=_0x52eb81[_0xafba('0x6')];this[_0xafba('0x7')]=_0xafba('0x5');this[_0xafba('0x8')]=![];this[_0xafba('0x9')]=_[_0xafba('0x2')](_0x24f38d[_0xafba('0xa')])?undefined:_0x24f38d['Agent']['name'];this[_0xafba('0xb')]=this[_0xafba('0x9')]?util['format'](_0xafba('0xc'),this[_0xafba('0x9')]):_0x12a4ce||undefined;this[_0xafba('0xd')]=checkNameSurname(_0x24f38d[_0xafba('0xe')][_0xafba('0xf')],_0x24f38d['Contact']['firstName'],_0x24f38d[_0xafba('0xe')]['lastName']);this[_0xafba('0x10')]=_0x24f38d[_0xafba('0x10')]||![];this[_0xafba('0x11')]=_0x24f38d['Contact']['phone'];this[_0xafba('0x12')]=_0x24f38d[_0xafba('0x12')];this[_0xafba('0x13')]=_0x24f38d[_0xafba('0x13')]||0x0;this[_0xafba('0x14')]=_0x24f38d[_0xafba('0x14')]||0x0;this[_0xafba('0x15')]=_0x24f38d[_0xafba('0x15')]||0x0;this[_0xafba('0x16')]=(_0x24f38d[_0xafba('0x13')]||0x0)+(_0x24f38d['countcongestionretry']||0x0)+(_0x24f38d[_0xafba('0x15')]||0x0)+(_0x24f38d[_0xafba('0x17')]||0x0)+(_0x24f38d[_0xafba('0x18')]||0x0)+(_0x24f38d[_0xafba('0x19')]||0x0)+(_0x24f38d[_0xafba('0x1a')]||0x0)+(_0x24f38d['countagentrejectretry']||0x0);this[_0xafba('0x17')]=_0x24f38d[_0xafba('0x17')]||0x0;this['countdropretry']=_0x24f38d[_0xafba('0x18')]||0x0;this['countabandonedretry']=_0x24f38d['countabandonedretry']||0x0;this[_0xafba('0x1a')]=_0x24f38d[_0xafba('0x1a')]||0x0;this[_0xafba('0x1b')]=_0x24f38d['countagentrejectretry']||0x0;this[_0xafba('0x1c')]=_0x24f38d[_0xafba('0x1c')];this['callbackuniqueid']=_0x24f38d[_0xafba('0x1d')];this[_0xafba('0x1e')]=_0x24f38d['callbackat'];this['recallme']=_0x24f38d[_0xafba('0x1f')];this[_0xafba('0x20')]=_0x24f38d[_0xafba('0x20')];this[_0xafba('0x21')]=_0x24f38d['ListId'];this['UserId']=_[_0xafba('0x2')](_0x24f38d[_0xafba('0xa')])?_0x24f38d[_0xafba('0x22')]:_0x24f38d[_0xafba('0xa')]['id'];this['VoiceQueueId']=_0x24f38d[_0xafba('0x23')];this[_0xafba('0x24')]='';this[_0xafba('0x25')]='';}Action['prototype'][_0xafba('0x26')]=function(){return util['format'](_0xafba('0x27'),this[_0xafba('0xd')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x0797=['string','uniqueid','idContact','queue','name','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','isNil'];(function(_0x3c9992,_0x5565a2){var _0x3978d5=function(_0x31cfb5){while(--_0x31cfb5){_0x3c9992['push'](_0x3c9992['shift']());}};_0x3978d5(++_0x5565a2);}(_0x0797,0x124));var _0x7079=function(_0x27a1c8,_0x3941d1){_0x27a1c8=_0x27a1c8-0x0;var _0x21b2cd=_0x0797[_0x27a1c8];return _0x21b2cd;};'use strict';var util=require('util');var _=require(_0x7079('0x0'));var moment=require('moment');function checkNameSurname(_0x3a3b14,_0x451613,_0xf7a4c7){var _0xa965ad='';if(!_[_0x7079('0x1')](_0x451613)&&_0x7079('0x2')===typeof _0x451613){_0xa965ad+=_0x451613;}if(!_['isNil'](_0xf7a4c7)&&_0x7079('0x2')===typeof _0xf7a4c7){_0xa965ad+='\x20'+_0xf7a4c7;}if(_0xa965ad!==''){return _0xa965ad;}return _0x3a3b14;}function Action(_0x28bfd1,_0x2d05f0,_0x577484,_0x245335,_0x2a893e){this[_0x7079('0x3')]=_0x577484||undefined;this[_0x7079('0x4')]=_0x28bfd1['id'];this[_0x7079('0x5')]=_0x2d05f0[_0x7079('0x6')];this['type']=_0x2d05f0['type'];this[_0x7079('0x7')]=_0x7079('0x5');this['dialAnswer']=![];this[_0x7079('0x8')]=_[_0x7079('0x1')](_0x28bfd1[_0x7079('0x9')])?undefined:_0x28bfd1['Agent']['name'];this[_0x7079('0xa')]=this[_0x7079('0x8')]?util[_0x7079('0xb')](_0x7079('0xc'),this[_0x7079('0x8')]):_0x245335||undefined;this[_0x7079('0xd')]=checkNameSurname(_0x28bfd1[_0x7079('0xe')][_0x7079('0xf')],_0x28bfd1[_0x7079('0xe')][_0x7079('0x10')],_0x28bfd1[_0x7079('0xe')][_0x7079('0x11')]);this[_0x7079('0x12')]=_0x28bfd1[_0x7079('0x12')]||![];this['calleridnum']=_0x28bfd1[_0x7079('0xe')][_0x7079('0xf')];this[_0x7079('0x13')]=_0x28bfd1[_0x7079('0x13')];this[_0x7079('0x14')]=_0x28bfd1['countbusyretry']||0x0;this[_0x7079('0x15')]=_0x28bfd1[_0x7079('0x15')]||0x0;this[_0x7079('0x16')]=_0x28bfd1[_0x7079('0x16')]||0x0;this[_0x7079('0x17')]=(_0x28bfd1[_0x7079('0x14')]||0x0)+(_0x28bfd1[_0x7079('0x15')]||0x0)+(_0x28bfd1[_0x7079('0x16')]||0x0)+(_0x28bfd1[_0x7079('0x18')]||0x0)+(_0x28bfd1[_0x7079('0x19')]||0x0)+(_0x28bfd1[_0x7079('0x1a')]||0x0)+(_0x28bfd1['countmachineretry']||0x0)+(_0x28bfd1['countagentrejectretry']||0x0);this[_0x7079('0x18')]=_0x28bfd1['countnosuchnumberretry']||0x0;this[_0x7079('0x19')]=_0x28bfd1[_0x7079('0x19')]||0x0;this[_0x7079('0x1a')]=_0x28bfd1['countabandonedretry']||0x0;this[_0x7079('0x1b')]=_0x28bfd1[_0x7079('0x1b')]||0x0;this['countagentrejectretry']=_0x28bfd1[_0x7079('0x1c')]||0x0;this[_0x7079('0x1d')]=_0x28bfd1[_0x7079('0x1d')];this[_0x7079('0x1e')]=_0x28bfd1[_0x7079('0x1e')];this[_0x7079('0x1f')]=_0x28bfd1[_0x7079('0x1f')];this[_0x7079('0x20')]=_0x28bfd1[_0x7079('0x20')];this[_0x7079('0x21')]=_0x28bfd1[_0x7079('0x21')];this[_0x7079('0x22')]=_0x28bfd1[_0x7079('0x22')];this[_0x7079('0x23')]=_['isNil'](_0x28bfd1[_0x7079('0x9')])?_0x28bfd1[_0x7079('0x23')]:_0x28bfd1['Agent']['id'];this[_0x7079('0x24')]=_0x28bfd1['VoiceQueueId'];this[_0x7079('0x25')]='';this['originatecalleridname']='';}Action[_0x7079('0x26')]['getCaller']=function(){return util[_0x7079('0xb')](_0x7079('0x27'),this[_0x7079('0xd')],this[_0x7079('0x28')]);};module[_0x7079('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 3bf418e..f4eac09 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 _0xe14b=['sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','Calling','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','unlock','execRun','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','phone','substring','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','error','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','strategy','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','message','erlangCalls','erlangCallToSecond','startProgressive','Trunk','name','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','preview','clearZombieChannels','outbound','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','decrementTalkink','loggerError','[action]','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','getDiff','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue'];(function(_0x2ed3df,_0x5545cf){var _0x1cfe1c=function(_0x428258){while(--_0x428258){_0x2ed3df['push'](_0x2ed3df['shift']());}};_0x1cfe1c(++_0x5545cf);}(_0xe14b,0x93));var _0xbe14=function(_0x5d5eb4,_0x308f66){_0x5d5eb4=_0x5d5eb4-0x0;var _0x2295a9=_0xe14b[_0x5d5eb4];return _0x2295a9;};'use strict';var util=require(_0xbe14('0x0'));var _=require(_0xbe14('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xbe14('0x2'));var md5=require(_0xbe14('0x3'));var Redis=require('ioredis');var config=require(_0xbe14('0x4'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xbe14('0x5'))(_0xbe14('0x6'));var ami=require(_0xbe14('0x7'));var rpcDb=require(_0xbe14('0x8'));var Action=require(_0xbe14('0x9'));var ut=require(_0xbe14('0xa'));config[_0xbe14('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbe14('0xc'))(new Redis(config[_0xbe14('0xb')]));var Sequence=function(){};Sequence[_0xbe14('0xd')][_0xbe14('0xe')]=function(_0x53c7ea){this['tail']=this[_0xbe14('0xf')]?this[_0xbe14('0xf')]['finally'](_0x53c7ea):_0x53c7ea();};function Preview(_0x254c3b){this[_0xbe14('0x10')]=new Sequence();this[_0xbe14('0x11')]=_0x254c3b[_0xbe14('0x12')];this[_0xbe14('0x13')]=_0x254c3b[_0xbe14('0x13')];this[_0xbe14('0x14')]={};this[_0xbe14('0x15')]=_0x254c3b[_0xbe14('0x15')];this[_0xbe14('0x16')]=0x0;ami['on'](_0xbe14('0x17'),this[_0xbe14('0x18')][_0xbe14('0x19')](this));ami['on']('hangup',this['syncHangup'][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1a'),this[_0xbe14('0x1b')][_0xbe14('0x19')](this));ami['on']('dialend',this[_0xbe14('0x1c')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1d'),this[_0xbe14('0x1e')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x1f'),this[_0xbe14('0x20')]['bind'](this));ami['on'](_0xbe14('0x21'),this[_0xbe14('0x22')][_0xbe14('0x19')](this));ami['on'](_0xbe14('0x23'),this[_0xbe14('0x24')][_0xbe14('0x19')](this));this['loopCampaigns'](this[_0xbe14('0x11')]);}function emit(_0x4a1bbd,_0x417c8d,_0xc12977){io['to'](_0x4a1bbd)[_0xbe14('0x25')](_0x417c8d,_0xc12977);}function emitCampaignPreview(_0x51dc0b){if(_0x51dc0b[_0xbe14('0x26')]==='outbound'){var _0x3c1c85={'id':_0x51dc0b['id'],'name':_0x51dc0b['name'],'strategy':_0x51dc0b[_0xbe14('0x27')],'answered':_0x51dc0b['answered'],'available':_0x51dc0b[_0xbe14('0x28')],'loggedIn':_0x51dc0b[_0xbe14('0x29')],'pTalking':_0x51dc0b['pTalking'],'sumBillable':_0x51dc0b[_0xbe14('0x2a')],'sumDuration':_0x51dc0b['sumDuration'],'sumHoldTime':_0x51dc0b[_0xbe14('0x2b')]||0x0,'talking':_0x51dc0b['talking'],'total':_0x51dc0b[_0xbe14('0x2c')],'type':_0x51dc0b[_0xbe14('0x26')],'unmanaged':_0x51dc0b[_0xbe14('0x2d')],'abandoned':_0x51dc0b[_0xbe14('0x2e')],'waiting':_0x51dc0b[_0xbe14('0x2f')],'loggedInDb':_0x51dc0b[_0xbe14('0x30')],'dialActive':_0x51dc0b['dialActive'],'dialMethod':_0x51dc0b[_0xbe14('0x31')],'dialOriginateCallerIdName':_0x51dc0b[_0xbe14('0x32')],'dialOriginateCallerIdNumber':_0x51dc0b[_0xbe14('0x33')],'dialOriginateTimeout':_0x51dc0b[_0xbe14('0x34')],'dialPrefix':_0x51dc0b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x51dc0b[_0xbe14('0x35')],'outboundAnswerCallsDay':_0x51dc0b[_0xbe14('0x36')],'outboundBlacklistCallsDay':_0x51dc0b['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x51dc0b[_0xbe14('0x37')],'outboundCongestionCallsDay':_0x51dc0b[_0xbe14('0x38')],'outboundDropCallsDayACS':_0x51dc0b[_0xbe14('0x39')],'outboundDropCallsDayCallersExit':_0x51dc0b[_0xbe14('0x3a')],'outboundDropCallsDayTimeout':_0x51dc0b[_0xbe14('0x3b')],'outboundNoAnswerCallsDay':_0x51dc0b[_0xbe14('0x3c')],'outboundNoSuchCallsDay':_0x51dc0b[_0xbe14('0x3d')],'outboundOriginateFailureCallsDay':_0x51dc0b[_0xbe14('0x3e')],'outboundReCallsDay':_0x51dc0b[_0xbe14('0x3f')],'outboundRejectCallsDay':_0x51dc0b[_0xbe14('0x40')],'outboundUnknownCallsDay':_0x51dc0b[_0xbe14('0x41')],'outboundAbandonedCallsDay':_0x51dc0b[_0xbe14('0x42')],'predictiveIntervalAnsweredCalls':_0x51dc0b[_0xbe14('0x43')],'predictiveIntervalAvgHoldtime':_0x51dc0b[_0xbe14('0x44')],'predictiveIntervalAvgTalktime':_0x51dc0b[_0xbe14('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x51dc0b[_0xbe14('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x51dc0b[_0xbe14('0x47')],'predictiveIntervalErlangCalls':_0x51dc0b[_0xbe14('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x51dc0b[_0xbe14('0x49')],'predictiveIntervalHitRate':_0x51dc0b[_0xbe14('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x51dc0b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x51dc0b[_0xbe14('0x4b')],'predictiveIntervalAvailable':_0x51dc0b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x51dc0b['predictiveIntervalTotalCalls'],'message':_0x51dc0b[_0xbe14('0x4c')],'originated':_0x51dc0b['originated'],'erlangCalls':_0x51dc0b[_0xbe14('0x4d')],'erlangCallToSecond':_0x51dc0b[_0xbe14('0x4e')],'erlangAbandonmentRate':_0x51dc0b['erlangAbandonmentRate'],'erlangBusyFactor':_0x51dc0b['erlangBusyFactor'],'startPredictive':_0x51dc0b['startPredictive'],'startProgressive':_0x51dc0b[_0xbe14('0x4f')]};if(_0x51dc0b[_0xbe14('0x50')]){_0x3c1c85['Trunk']={'id':_0x51dc0b[_0xbe14('0x50')]['id'],'name':_0x51dc0b[_0xbe14('0x50')][_0xbe14('0x51')],'active':_0x51dc0b[_0xbe14('0x50')][_0xbe14('0x52')],'callerid':_0x51dc0b['Trunk']['callerid']};}if(_0x51dc0b[_0xbe14('0x53')]){_0x3c1c85['Interval']={'id':_0x51dc0b['Interval']['id'],'name':_0x51dc0b['Interval'][_0xbe14('0x51')]};}var _0x393f6b=md5(JSON[_0xbe14('0x54')](_0x3c1c85));if(_0x51dc0b[_0xbe14('0x3')]!==_0x393f6b){_0x51dc0b[_0xbe14('0x3')]=_0x393f6b;emit(util[_0xbe14('0x55')](_0xbe14('0x56'),_0x3c1c85[_0xbe14('0x51')]),_0xbe14('0x57'),_0x3c1c85);}}}function emitVoiceQueueChannelRemove(_0x2dfd5a){logger[_0xbe14('0x58')](_0xbe14('0x59'),JSON['stringify'](_0x2dfd5a));emit(util['format'](_0xbe14('0x56'),_0x2dfd5a[_0xbe14('0x51')]),_0xbe14('0x5a'),_0x2dfd5a);io['emit'](_0xbe14('0x5b'),_0x2dfd5a);}function notSendMessagesQueue(_0x2aa453){if(_0x2aa453[_0xbe14('0x5c')]){if(_0x2aa453[_0xbe14('0x5d')]===0x0&&_0x2aa453[_0xbe14('0x5e')]===0x0){_0x2aa453[_0xbe14('0x5c')]=![];_0x2aa453[_0xbe14('0x28')]=0x0;_0x2aa453[_0xbe14('0x5f')]=0x0;_0x2aa453[_0xbe14('0x4c')]='NOT_ACTIVE';ut[_0xbe14('0x60')](_0xbe14('0x61'),_0x2aa453[_0xbe14('0x51')]+_0xbe14('0x62'));}else{_0x2aa453[_0xbe14('0x4c')]=_0xbe14('0x63');ut['logger'](_0xbe14('0x61'),_0x2aa453[_0xbe14('0x51')]+_0xbe14('0x64'));}emitCampaignPreview(_0x2aa453);}}Preview[_0xbe14('0xd')]['loopCampaigns']=function(){var _0x4bfa96=this;setInterval(function(){_0x4bfa96[_0xbe14('0x65')]();},0x7cf);};Preview[_0xbe14('0xd')][_0xbe14('0x65')]=function(){var _0x51c859=this['campaignsPreview'];this[_0xbe14('0x16')]+=0x1;for(var _0x59ae4d in _0x51c859){if(_0x51c859['hasOwnProperty'](_0x59ae4d)&&(_0x51c859[_0x59ae4d][_0xbe14('0x31')]===_0xbe14('0x66')||_0x51c859[_0x59ae4d][_0xbe14('0x31')]==='booked')&&_0x51c859[_0x59ae4d]['type']==='outbound'){if(this[_0xbe14('0x16')]>0x7){this[_0xbe14('0x16')]=0x0;this[_0xbe14('0x67')]();}}if(_0x51c859['hasOwnProperty'](_0x59ae4d)&&_0x51c859[_0x59ae4d][_0xbe14('0x31')]===_0xbe14('0x66')&&_0x51c859[_0x59ae4d][_0xbe14('0x26')]===_0xbe14('0x68')){if(_0x51c859[_0x59ae4d]['dialActive']){this['setMessage'](_0x51c859[_0x59ae4d]);if(_0x51c859[_0x59ae4d][_0xbe14('0x69')])this[_0xbe14('0x6a')](_0x51c859[_0x59ae4d]);}else{notSendMessagesQueue(_0x51c859[_0x59ae4d]);}}}};Preview[_0xbe14('0xd')][_0xbe14('0x6b')]=function(_0x2550dc){var _0x4f2d95=this;this['sequence'][_0xbe14('0xe')](function(){if(!_[_0xbe14('0x6c')](_0x4f2d95[_0xbe14('0x14')][_0x2550dc])){loggerAction[_0xbe14('0x58')]('[clearZombieChannels][talking]',_0x2550dc,_0xbe14('0x6d'),_0x4f2d95[_0xbe14('0x14')][_0x2550dc]['queue'],_0xbe14('0x6e'),JSON[_0xbe14('0x54')](_0x4f2d95[_0xbe14('0x11')][_0x4f2d95[_0xbe14('0x14')][_0x2550dc]['queue']]['originated']),_0xbe14('0x6f'),JSON[_0xbe14('0x54')](_0x4f2d95['campaignsPreview'][_0x4f2d95['actions'][_0x2550dc][_0xbe14('0x70')]][_0xbe14('0x5e')]),JSON[_0xbe14('0x54')](_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x71')]),JSON[_0xbe14('0x54')](_[_0xbe14('0x72')](_0x4f2d95['actions'][_0x2550dc],[_0xbe14('0x73'),_0xbe14('0x74'),_0xbe14('0x75'),_0xbe14('0x76')])));return ami[_0xbe14('0x77')]({'action':'status','channel':_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x78')]})[_0xbe14('0x79')](function(_0x20f46d){if(_0x20f46d[_0xbe14('0x4c')]===_0xbe14('0x7a')){setTimeout(function(){if(_0x4f2d95['actions'][_0x2550dc]){ut['updateOriginated'](_0x4f2d95[_0xbe14('0x11')][_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]],'[clearZombieChannel]');if(_0x4f2d95['actions'][_0x2550dc][_0xbe14('0x71')]===!![]){ut[_0xbe14('0x7b')](_0x4f2d95['campaignsPreview'][_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]],'[clearZombieChannel]');ut[_0xbe14('0x7c')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2550dc,_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]);}ut[_0xbe14('0x7c')]('[Dialer][checkChannel][Preview]'+_0x2550dc,_0x4f2d95[_0xbe14('0x14')][_0x2550dc][_0xbe14('0x70')]);delete _0x4f2d95['actions'][_0x2550dc];}},0x2328);}});}});};Preview[_0xbe14('0xd')][_0xbe14('0x67')]=function(){var _0x2210cc=this;loggerAction[_0xbe14('0x58')](_0xbe14('0x7d'),_['size'](this[_0xbe14('0x14')]));for(var _0x34cd66 in this[_0xbe14('0x14')]){if(_0x2210cc[_0xbe14('0x14')][_0xbe14('0x7e')](_0x34cd66)){_0x2210cc[_0xbe14('0x6b')](_0x34cd66);}}};Preview[_0xbe14('0xd')]['recallMe']=function(_0x72c875){var _0x1b47a4=this;rpcDb[_0xbe14('0x7f')](_0x72c875['id'],ut[_0xbe14('0x80')](this[_0xbe14('0x15')]))[_0xbe14('0x81')](function(_0xd8f78f){if(!_[_0xbe14('0x6c')](_0xd8f78f)){for(var _0x285b6e=0x0;_0x285b6e<_0xd8f78f[_0xbe14('0x82')];_0x285b6e+=0x1){if(ut[_0xbe14('0x83')](_0xd8f78f[_0x285b6e]['scheduledat'])<_0x72c875['dialRecallMeTimeout']*0x3c){if(_0xd8f78f[_0x285b6e]['Agent']&&!_0xd8f78f[_0x285b6e][_0xbe14('0x84')][_0xbe14('0x85')]){_0x1b47a4[_0xbe14('0x86')](_0xd8f78f[_0x285b6e]['id'])[_0xbe14('0x81')](ut[_0xbe14('0x87')](_0xbe14('0x88')))[_0xbe14('0x79')](ut[_0xbe14('0x87')](_0xbe14('0x88')));}else{rpcDb[_0xbe14('0x89')](_0xd8f78f[_0x285b6e]['id']);}}else{var _0x603816=new Action(_0xd8f78f[_0x285b6e],_0x72c875);_0x603816[_0xbe14('0x8a')]=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));_0x72c875[_0xbe14('0x3f')]+=0x1;ut[_0xbe14('0x8c')](_0x603816,0x17,_0xbe14('0x8d'));if(_0x72c875[_0xbe14('0x8e')]){rpcDb[_0xbe14('0x8f')](ut[_0xbe14('0x90')](_0xd8f78f[_0x285b6e]));rpcDb['createCustomerHistory'](_0x603816,_0xbe14('0x91'));}else{ut[_0xbe14('0x8c')](_0x603816,0x16,_0xbe14('0x92'));rpcDb[_0xbe14('0x93')](_0x603816,_0xbe14('0x94'));rpcDb[_0xbe14('0x95')](_0x603816,_0xbe14('0x94'));}}}}})[_0xbe14('0x79')](ut[_0xbe14('0x87')](_0xbe14('0x96')));};Preview['prototype'][_0xbe14('0x97')]=function(_0x442ec4){_0x442ec4[_0xbe14('0x5c')]=!![];if(ut[_0xbe14('0x98')](_0x442ec4[_0xbe14('0x29')])){_0x442ec4['message']=_0xbe14('0x99');}else if(!ut[_0xbe14('0x9a')](_0x442ec4[_0xbe14('0x9b')])){_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0x9c');}else if(!this['isTrunkReachable'](_0x442ec4[_0xbe14('0x50')])){if(!this[_0xbe14('0x9d')](_0x442ec4[_0xbe14('0x9e')])){_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0x9f');}else{_0x442ec4[_0xbe14('0x4c')]=_0xbe14('0xa0');}}else{_0x442ec4[_0xbe14('0x4c')]='ACTIVE';}emitCampaignPreview(_0x442ec4);};Preview[_0xbe14('0xd')][_0xbe14('0xa1')]=function(_0x2fdf5d,_0x20b12e,_0x5982b7){var _0xa4b2a3=this;var _0x445302=this['actions'][_0x20b12e];var _0x4eedd2=this[_0xbe14('0x11')][_0x445302[_0xbe14('0x70')]];var _0x2d2643;if(_0x4eedd2){switch(_0x5982b7){case'1':_0x4eedd2[_0xbe14('0x3d')]+=0x1;_0x445302[_0xbe14('0xa2')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x0,'NoSuchNumber');ami['emit'](_0xbe14('0xa5'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xa7')));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xa8'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xac'));}else{if(_0x445302['countnosuchnumberretry']>=_0x4eedd2[_0xbe14('0xad')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xac'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xa2'),_0x4eedd2[_0xbe14('0xb0')]),_0x445302['unlockAgent'],_0x445302[_0xbe14('0xb1')]);}}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;case _0xbe14('0xb3'):var _0x28da4a=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));_0x445302[_0xbe14('0xb4')]=_0x28da4a;_0x445302['answertime']=_0x28da4a;_0x445302[_0xbe14('0x71')]=!![];_0x4eedd2[_0xbe14('0x5e')]+=0x1;logger[_0xbe14('0x58')](_0xbe14('0xb5'),_0x445302[_0xbe14('0xb6')],_0xbe14('0xb7'),_0x4eedd2['name'],_0xbe14('0x6f'),_0x4eedd2[_0xbe14('0x5e')]);ami[_0xbe14('0x25')](_0xbe14('0xb8'),ut['buildObj'](_0x445302,_0xbe14('0xb9'),this[_0xbe14('0x11')][_0x445302[_0xbe14('0x70')]]));if(_0x4eedd2[_0xbe14('0xba')]){ami[_0xbe14('0x25')](_0xbe14('0xbb'),ut[_0xbe14('0xbc')](_0x445302));}break;case'16':ami['emit'](_0xbe14('0xbd'),ut['buildObj'](_0x445302,_0xbe14('0xbe'),this['campaignsPreview'][_0x445302[_0xbe14('0x70')]]));emitVoiceQueueChannelRemove(ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xbe')));_0x4eedd2['outboundAnswerCallsDay']+=0x1;_0x4eedd2[_0xbe14('0x2c')]+=0x1;_0x4eedd2[_0xbe14('0xbf')]+=0x1;ut[_0xbe14('0x7b')](_0x4eedd2,'[16]');_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x4,_0xbe14('0xc0'));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xc1'));rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xc2'));rpcDb[_0xbe14('0xc3')](_0x445302);_0x4eedd2[_0xbe14('0xc4')]+=_0x445302[_0xbe14('0xc5')];_0x4eedd2[_0xbe14('0x2a')]+=_0x445302['talktime'];logger[_0xbe14('0x58')](_0xbe14('0xc6'),_0x445302[_0xbe14('0xb6')],'\x20Queue',_0x4eedd2[_0xbe14('0x51')],_0xbe14('0x6f'),_0x4eedd2[_0xbe14('0x5e')]);delete this['actions'][_0x2fdf5d[_0xbe14('0xb2')]];break;case _0xbe14('0xc7'):_0x4eedd2['outboundBusyCallsDay']+=0x1;_0x445302[_0xbe14('0xc8')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x5,'Busy');ami['emit'](_0xbe14('0xc9'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xca')));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xcb'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,'Global');rpcDb['createCustomerFinal'](_0x2d2643,_0xbe14('0xcc'));}else{if(_0x445302[_0xbe14('0xc8')]>=_0x4eedd2[_0xbe14('0xcd')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xcb'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,'countbusyretry',_0x4eedd2[_0xbe14('0xce')]),_0x445302['unlockAgent'],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xcf'):_0x4eedd2[_0xbe14('0x3c')]+=0x1;_0x445302[_0xbe14('0xd0')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x3,_0xbe14('0xd1'));ami['emit'](_0xbe14('0xd2'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xd3')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xd4'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xd5'));}else{if(_0x445302[_0xbe14('0xd0')]>=_0x4eedd2[_0xbe14('0xd6')]){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xd4'));}else{rpcDb[_0xbe14('0xae')](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xd0'),_0x4eedd2[_0xbe14('0xd7')]),_0x445302[_0xbe14('0xd8')],_0x445302['activeContact']);}}break;case _0xbe14('0xd9'):_0x4eedd2['outboundCongestionCallsDay']+=0x1;_0x445302[_0xbe14('0xda')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x8,_0xbe14('0xdb'));ami['emit']('custom:agentcongestion',ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xdc')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xdd'));if(ut['totalGlobal'](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,'Global');rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xde'));}else{if(_0x445302[_0xbe14('0xda')]>=_0x4eedd2[_0xbe14('0xdf')]){rpcDb['createCustomerFinal'](_0x445302,_0xbe14('0xdd'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x445302,_0xbe14('0xda'),_0x4eedd2[_0xbe14('0xce')]),_0x445302[_0xbe14('0xd8')],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xe0'):_0x4eedd2['outboundRejectCallsDay']+=0x1;_0x445302[_0xbe14('0xe1')]+=0x1;_0x445302[_0xbe14('0xa3')]=ut['totalGlobal'](_0x445302);ut['logCustomer'](_0x445302,0x14,_0xbe14('0xe2'));ami[_0xbe14('0x25')]('custom:agentreject',ut[_0xbe14('0xa6')](_0x445302,'agentreject'));rpcDb[_0xbe14('0x93')](_0x445302,'[syncHangupRequest][logAgentReject]');if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2['dialGlobalMaxRetry']){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0x14,'AgentReject');rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xe3'));}else{if(_0x445302['countagentrejectretry']>=_0x4eedd2['dialAgentRejectMaxRetry']){rpcDb[_0xbe14('0x95')](_0x445302,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xbe14('0xaf')](_0x445302,_0xbe14('0xe1'),_0x4eedd2[_0xbe14('0xe4')]),_0x445302[_0xbe14('0xd8')],_0x445302[_0xbe14('0xb1')]);}}break;case _0xbe14('0xe5'):_0x4eedd2[_0xbe14('0x42')]+=0x1;_0x445302['countabandonedretry']+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0xb,_0xbe14('0xe6'));rpcDb['createCustomerHistory'](_0x445302,_0xbe14('0xe7'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut['cloneAction'](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x445302[_0xbe14('0xe8')]>=_0x4eedd2['dialAbandonedMaxRety']){rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xe7'));}else{rpcDb[_0xbe14('0xae')](ut['scheduledAt'](_0x445302,_0xbe14('0xe9'),_0x4eedd2['dialAbandonedRetryFrequency']),_0x445302[_0xbe14('0xd8')],_0x445302['activeContact']);}}break;case'18':_0x4eedd2['outboundUnknownCallsDay']+=0x1;_0x445302[_0xbe14('0xea')]+=0x1;_0x445302['countglobal']=ut[_0xbe14('0xa4')](_0x445302);ut['logCustomer'](_0x445302,0x12,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);ami[_0xbe14('0x25')](_0xbe14('0xed'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xee')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xef'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xef'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;case'19':_0x4eedd2[_0xbe14('0x41')]+=0x1;_0x445302['countglobal']=ut['totalGlobal'](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0x13,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);ami[_0xbe14('0x25')](_0xbe14('0xed'),ut[_0xbe14('0xa6')](_0x445302,_0xbe14('0xee')));rpcDb[_0xbe14('0x93')](_0x445302,_0xbe14('0xf0'));if(ut[_0xbe14('0xa4')](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut[_0xbe14('0xaa')](_0x445302,0xf,_0xbe14('0xab'));rpcDb[_0xbe14('0x95')](_0x2d2643,_0xbe14('0xf0'));}else{rpcDb[_0xbe14('0x95')](_0x445302,_0xbe14('0xf0'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];break;default:if(_0x445302[_0xbe14('0x71')]){ut[_0xbe14('0x7b')](_0x4eedd2,_0xbe14('0xf1'));ut[_0xbe14('0x7c')](_0xbe14('0xf2')+_0x4eedd2[_0xbe14('0x51')],_0x2fdf5d);}_0x4eedd2['outboundUnknownCallsDay']+=0x1;_0x445302[_0xbe14('0xa3')]=ut[_0xbe14('0xa4')](_0x445302);ut[_0xbe14('0x8c')](_0x445302,0xc,_0x2fdf5d[_0xbe14('0xeb')]||_0x2fdf5d[_0xbe14('0xec')]);rpcDb[_0xbe14('0x93')](_0x445302,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x445302)>=_0x4eedd2[_0xbe14('0xa9')]){_0x2d2643=ut['cloneAction'](_0x445302,0xf,_0xbe14('0xab'));rpcDb['createCustomerFinal'](_0x2d2643,_0xbe14('0xf3'));}else{rpcDb['createCustomerFinal'](_0x445302,_0xbe14('0xf3'));}delete this[_0xbe14('0x14')][_0x2fdf5d[_0xbe14('0xb2')]];}if(!(_0x445302[_0xbe14('0x71')]&&_0x5982b7==='16')){ut[_0xbe14('0xf4')](_0x4eedd2,_0xbe14('0xf5'));logger[_0xbe14('0x58')](_0xbe14('0xf6'),_0x445302[_0xbe14('0xb6')],'\x20Queue',_0x4eedd2[_0xbe14('0x51')],_0xbe14('0x6e'),_0x4eedd2[_0xbe14('0x5d')]);}if(_0x5982b7!==_0xbe14('0xb3')){delete this['actions'][_0x2fdf5d[_0xbe14('0xb2')]];delete this['actions'][_0x2fdf5d[_0xbe14('0xf7')]];}}};Preview['prototype'][_0xbe14('0xf8')]=function(_0x3e7588,_0x24fa89,_0x5c134f){if(_[_0xbe14('0xf9')](_0x24fa89)&&'object'!==typeof _0x24fa89){return;}if(_[_0xbe14('0xf9')](_0x5c134f)&&_0xbe14('0xfa')!==typeof _0x5c134f){return;}switch(_0x5c134f[_0xbe14('0xfb')]){case'0':ut[_0xbe14('0xfc')](_0x3e7588,0x0,_0xbe14('0xfd'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0xff'));break;case'3':ut[_0xbe14('0xfc')](_0x3e7588,0x3,_0xbe14('0xd1'));rpcDb['createAgentHistory'](_0x3e7588,_0xbe14('0x100'));break;case'5':ut['logAgent'](_0x3e7588,0x5,_0xbe14('0x101'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x102'));break;case'8':ut['logAgent'](_0x3e7588,0x8,_0xbe14('0xdb'));rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x103'));break;case'22':ut[_0xbe14('0xfc')](_0x3e7588,0x16,_0xbe14('0x104'));rpcDb['createAgentHistory'](_0x3e7588,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbe14('0xfc')](_0x3e7588,0xc,_0x5c134f['reason']);rpcDb[_0xbe14('0xfe')](_0x3e7588,_0xbe14('0x103'));}ut[_0xbe14('0xf4')](_0x24fa89,_0xbe14('0x105'));logger['info'](_0xbe14('0x106'),_0x3e7588[_0xbe14('0xb6')],'\x20Queue',_0x24fa89[_0xbe14('0x51')],_0xbe14('0x6e'),_0x24fa89[_0xbe14('0x5d')]);delete this[_0xbe14('0x14')][_0x3e7588['uniqueid']];};Preview[_0xbe14('0xd')][_0xbe14('0x107')]=function(_0x37aff6,_0x3374d8,_0x3b7920,_0x469ef3,_0x208fae){var _0x310d42=this;return new BPromise(function(_0x9c229f,_0x1e8989){if(_['isNil'](_0x3374d8)||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x108')])||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x108')]['phone'])||_[_0xbe14('0x6c')](_0x3374d8[_0xbe14('0x75')])){_0x1e8989(ut[_0xbe14('0x4c')]('Contact\x20is\x20undefined',_0x469ef3,_0x208fae));return;}var _0x431602=uuid['v4']();var _0x3778e0=_0x310d42[_0xbe14('0x11')][_0x3374d8[_0xbe14('0x6d')][_0xbe14('0x51')]];var _0x2306f6=_0x3b7920?_0x310d42[_0xbe14('0x15')][_0x3b7920]['id']:undefined;_0x310d42['actions'][_0x431602]=new Action(_0x3374d8,_0x3778e0,_0x431602,_0x3b7920,_0x2306f6);var _0x2c2e46=_0x310d42['actions'][_0x431602];_0x2c2e46[_0xbe14('0xd8')]=_0x469ef3;_0x2c2e46[_0xbe14('0xb1')]=_0x208fae;_0x2c2e46[_0xbe14('0x109')]=_0x3b7920;if(_[_0xbe14('0x10a')](_0x37aff6)){_0x310d42[_0xbe14('0x10b')](_0x2c2e46,_0x3778e0,_0x3374d8,_0x3b7920)['then'](function(_0x5db8e8){logger[_0xbe14('0x58')](_0xbe14('0x10c'),_0xbe14('0x10d')+_0x2c2e46[_0xbe14('0x70')]+'\x20IdHopper:\x20'+_0x2c2e46[_0xbe14('0x10e')],JSON[_0xbe14('0x54')](_0x5db8e8));ami[_0xbe14('0x25')]('custom:agentcalled',ut[_0xbe14('0xa6')](_0x2c2e46,'called',_0x310d42['campaignsPreview'][_0x2c2e46[_0xbe14('0x70')]]));_0x9c229f(ut[_0xbe14('0x4c')](_0xbe14('0x10f')));})['catch'](function(_0x3ea9c2){ut[_0xbe14('0x60')]('[Preview][execCall][failure]',_0x3ea9c2);_0x1e8989(ut[_0xbe14('0x4c')](_0xbe14('0x110'),_0x469ef3,_0x208fae));});}else{_0x3778e0[_0xbe14('0x111')]+=0x1;ut['logBlacklist'](_0x2c2e46);rpcDb[_0xbe14('0x112')](_0x2c2e46,_0xbe14('0x113'));delete _0x310d42[_0xbe14('0x14')][_0x431602];_0x1e8989(ut[_0xbe14('0x4c')](_0xbe14('0x114'),_0x469ef3,_0x208fae));}});};Preview['prototype'][_0xbe14('0x9d')]=function(_0x2dc3a6){return!_[_0xbe14('0x6c')](_0x2dc3a6)&&!_['isNil'](_0x2dc3a6[_0xbe14('0x51')])&&!_[_0xbe14('0x6c')](_0x2dc3a6[_0xbe14('0x52')])&&_0x2dc3a6[_0xbe14('0x52')]&&!_[_0xbe14('0x6c')](this[_0xbe14('0x13')][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])])&&!_[_0xbe14('0x6c')](this[_0xbe14('0x13')][util['format'](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])][_0xbe14('0x116')])&&(this['trunks'][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6[_0xbe14('0x51')])]['status']===_0xbe14('0x117')||this['trunks'][util[_0xbe14('0x55')](_0xbe14('0x115'),_0x2dc3a6['name'])][_0xbe14('0x116')]===_0xbe14('0x118'));};Preview['prototype'][_0xbe14('0x86')]=function(_0x1e1540,_0x133ae9){var _0x27c892=this;return new BPromise(function(_0x246a02,_0x1662df){_0x27c892['execRun'](_0x1e1540,_0x133ae9)['then'](function(_0x319d08){_0x246a02(_[_0xbe14('0x72')](_0x319d08,[_0xbe14('0x4c')]));})[_0xbe14('0x79')](function(_0x48ec55){if(_0x48ec55[_0xbe14('0x119')]){rpcDb['unlockContact'](_0x1e1540);}if(_0x48ec55[_0xbe14('0x52')]){rpcDb[_0xbe14('0x89')](_0x1e1540);}_0x1662df(_['pick'](_0x48ec55,[_0xbe14('0x4c')]));});});};Preview[_0xbe14('0xd')][_0xbe14('0x11a')]=function(_0x1f06ec,_0x1137a9){var _0x17c8cc=this;return new BPromise(function(_0x1b7d69,_0x8625bb){var _0x220d5d,_0x3117fc;rpcDb[_0xbe14('0x11b')](_0x1f06ec)[_0xbe14('0x81')](function(_0x4ed1f7){if(!_[_0xbe14('0x6c')](_0x4ed1f7[0x0])){_0x3117fc=_0x4ed1f7[0x0][_0xbe14('0x11c')]?![]:!![];_0x220d5d=_0x4ed1f7[0x0][_0xbe14('0x11c')]?!![]:![];_0x220d5d=_0x1137a9?!![]:_0x220d5d;}var _0x4087b6=_0x17c8cc['validateContact'](_0x4ed1f7);if(_0x4087b6[_0xbe14('0x11d')]){rpcDb[_0xbe14('0x11e')](_['pick'](_0x4ed1f7[0x0],[_0xbe14('0x75'),_0xbe14('0x11f')]))[_0xbe14('0x81')](function(_0x4a6fc3){_0x17c8cc[_0xbe14('0x107')](_0x4a6fc3,_0x4ed1f7[0x0],_0x1137a9,_0x3117fc,_0x220d5d)[_0xbe14('0x81')](function(_0x25a038){_0x1b7d69(_0x25a038);})[_0xbe14('0x79')](function(_0x2279d1){_0x8625bb(_0x2279d1);});})['catch'](function(_0x23208d){ut[_0xbe14('0x60')](_0xbe14('0x120'),_0x23208d);_0x8625bb(ut[_0xbe14('0x4c')](_0xbe14('0x121'),_0x3117fc,_0x220d5d));});}else{_0x8625bb(ut['message'](_0x4087b6[_0xbe14('0x4c')],_0x3117fc,_0x220d5d));}})[_0xbe14('0x79')](function(_0x8eeaef){ut[_0xbe14('0x60')](_0xbe14('0x122'),_0x8eeaef);_0x8625bb(ut[_0xbe14('0x4c')](_0xbe14('0x121'),![],!![]));});});};Preview[_0xbe14('0xd')]['validateContact']=function(_0x5c25dc){if(_[_0xbe14('0x6c')](_0x5c25dc)||_[_0xbe14('0x10a')](_0x5c25dc)||!_[_0xbe14('0x6c')](_0x5c25dc[0x0][_0xbe14('0x84')])&&_[_0xbe14('0x6c')](_0x5c25dc[0x0]['Agent'][_0xbe14('0x51')])){ut[_0xbe14('0x60')](_0xbe14('0x123'),_0x5c25dc);return{'isValid':![],'message':_0xbe14('0x124')};}var _0x1257b2=this[_0xbe14('0x11')][_0x5c25dc[0x0][_0xbe14('0x6d')][_0xbe14('0x51')]];_0x1257b2['message']=_0xbe14('0xa0');if(_[_0xbe14('0x6c')](_0x1257b2)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x1257b2);return{'isValid':![],'message':_0xbe14('0x125')};}if(!this['isTrunkReachable'](_0x1257b2[_0xbe14('0x50')])){ut[_0xbe14('0x60')](_0xbe14('0x126'),_0xbe14('0x127')+_0x1257b2[_0xbe14('0x51')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xbe14('0x9d')](_0x1257b2[_0xbe14('0x9e')])){ut[_0xbe14('0x60')](_0xbe14('0x126'),_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x128'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x1257b2[_0xbe14('0x9b')])){ut['logger'](_0xbe14('0x129'),_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x12a'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1257b2[_0xbe14('0x51')]+_0xbe14('0x12a')};}return{'isValid':!![],'message':_0xbe14('0x12b')};};Preview[_0xbe14('0xd')][_0xbe14('0x10b')]=function(_0x2e5106,_0x156fb3,_0x513b6f,_0x2fd64c){var _0x5d5fad=this;return new BPromise(function(_0x5e8d27,_0x4e849c){var _0x4e3261=_0x2e5106[_0xbe14('0xb6')];var _0x1c899d=_0x5d5fad['isTrunkReachable'](_0x156fb3[_0xbe14('0x50')])?util['format'](_0xbe14('0x12c'),_0x156fb3['Trunk'][_0xbe14('0x51')],_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x12d')])?'':_0x156fb3[_0xbe14('0x12d')][_0xbe14('0x12e')]()||'',_0x156fb3['dialCutDigit']>0x0?_0x513b6f[_0xbe14('0x108')][_0xbe14('0x12f')][_0xbe14('0x130')](_0x156fb3[_0xbe14('0x131')]):_0x513b6f['Contact']['phone']):util['format'](_0xbe14('0x12c'),_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x9e')])?_0x156fb3[_0xbe14('0x50')][_0xbe14('0x51')]:_0x156fb3['TrunkBackup']['name'],_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x12d')])?'':_0x156fb3[_0xbe14('0x12d')][_0xbe14('0x12e')]()||'',_0x156fb3[_0xbe14('0x131')]>0x0?_0x513b6f['Contact'][_0xbe14('0x12f')]['substring'](_0x156fb3[_0xbe14('0x131')]):_0x513b6f[_0xbe14('0x108')][_0xbe14('0x12f')]);var _0x1d1c84=_0x5d5fad['isTrunkReachable'](_0x156fb3[_0xbe14('0x50')])?ut[_0xbe14('0x132')](_0x156fb3[_0xbe14('0x50')][_0xbe14('0x133')],_0x156fb3['dialOriginateCallerIdName'],_0x156fb3[_0xbe14('0x134')]>0x0?ut[_0xbe14('0x135')](_0x156fb3[_0xbe14('0x33')],_0x156fb3['dialRandomLastDigitCallerIdNumber']):_0x156fb3['dialOriginateCallerIdNumber']):ut[_0xbe14('0x132')](_[_0xbe14('0x6c')](_0x156fb3[_0xbe14('0x9e')])?_0x156fb3['Trunk'][_0xbe14('0x133')]:_0x156fb3[_0xbe14('0x9e')][_0xbe14('0x133')],_0x156fb3[_0xbe14('0x32')],_0x156fb3[_0xbe14('0x134')]>0x0?ut[_0xbe14('0x135')](_0x156fb3['dialOriginateCallerIdNumber'],_0x156fb3[_0xbe14('0x134')]):_0x156fb3[_0xbe14('0x33')]);if(_0x1d1c84){_0x2e5106[_0xbe14('0x136')]=ut[_0xbe14('0x137')](_0x1d1c84);_0x2e5106[_0xbe14('0x138')]=ut['extractCalleridNumber'](_0x1d1c84);}var _0x4d2094=ut[_0xbe14('0x139')](_0x156fb3,_0x513b6f,_0x1c899d,_0x1d1c84,_0x4e3261,_0x2e5106);_['merge'](_0x2e5106,ut[_0xbe14('0x13a')](_0x4d2094));_0x2e5106['starttime']=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));ami[_0xbe14('0x77')](ut['variablesAction'](_0x2e5106,_0x156fb3,_0x4d2094,_0x2e5106[_0xbe14('0xb1')],_0x2fd64c))[_0xbe14('0x81')](function(_0x2602ec){_0x156fb3[_0xbe14('0x5d')]+=0x1;logger[_0xbe14('0x58')](_0xbe14('0x13b'),_0x4e3261,_0xbe14('0xb7'),_0x156fb3[_0xbe14('0x51')],_0xbe14('0x6e'),_0x156fb3[_0xbe14('0x5d')]);_0x5e8d27(_0x2602ec);})['catch'](function(_0x1f1fb9){ut[_0xbe14('0xfc')](_0x2e5106,0xe,_0xbe14('0x13c'));rpcDb[_0xbe14('0xfe')](_0x2e5106,_0xbe14('0x13d'));_0x4e849c(_0x1f1fb9);});});};Preview[_0xbe14('0xd')][_0xbe14('0x1e')]=function(_0x36010e){if(this['actions'][_0x36010e[_0xbe14('0xb2')]]){this[_0xbe14('0x14')][_0x36010e[_0xbe14('0xb2')]][_0xbe14('0x78')]=_0x36010e[_0xbe14('0x78')];}};Preview[_0xbe14('0xd')]['syncOriginateResponse']=function(_0x479c1a){var _0x4f09fb=this;var _0x598ccc=this[_0xbe14('0x14')][_0x479c1a[_0xbe14('0x13e')]];if(_0x598ccc){if(_0x598ccc['lookAgent']&&this[_0xbe14('0x15')][_0x598ccc['lookAgent']]){ut[_0xbe14('0x13f')](_0x598ccc,this[_0xbe14('0x15')][_0x598ccc[_0xbe14('0x109')]][_0xbe14('0x51')],this[_0xbe14('0x15')][_0x598ccc[_0xbe14('0x109')]]['id']);}var _0x4f727c=_[_0xbe14('0x140')](_0x598ccc);_0x4f727c[_0xbe14('0xb4')]=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));var _0xc7acb6=_0x4f09fb[_0xbe14('0x11')][_0x598ccc[_0xbe14('0x70')]];if(ut[_0xbe14('0x141')](_0x479c1a[_0xbe14('0x142')])){if(_0x598ccc['unlockAgent']){rpcDb[_0xbe14('0x143')](_0x598ccc['idContact']);}if(_0x598ccc[_0xbe14('0xb1')]){rpcDb['disableContact'](_0x598ccc['idContact']);}ami[_0xbe14('0x25')](_0xbe14('0x144'),ut[_0xbe14('0xa6')](_0x598ccc,'rejected',this[_0xbe14('0x11')][_0x598ccc['queue']]));this[_0xbe14('0xf8')](_0x4f727c,_0xc7acb6,_0x479c1a);}else{_0x598ccc['starttime']=moment()[_0xbe14('0x55')](_0xbe14('0x8b'));ut[_0xbe14('0xfc')](_0x4f727c,0x4,_0xbe14('0xc0'));rpcDb[_0xbe14('0xfe')](_0x4f727c,_0xbe14('0x145'));}}};Preview['prototype'][_0xbe14('0x146')]=function(_0x1100c1){var _0x4d46a3=this;var _0x52cdfd=this['actions'][_0x1100c1[_0xbe14('0xb2')]];var _0x40ef0a;if(_0x52cdfd){_0x40ef0a=this[_0xbe14('0x11')][_0x52cdfd[_0xbe14('0x70')]];logger[_0xbe14('0x58')](_0xbe14('0x147'),_0x1100c1[_0xbe14('0xb2')],'\x20Queue',_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a[_0xbe14('0x5e')]);}if(this['actions'][_0x1100c1[_0xbe14('0xb2')]]&&_0x1100c1[_0xbe14('0xb2')]!==_0x1100c1[_0xbe14('0xb6')]){if(_0x1100c1['cause']==='16'&&this['actions'][_0x1100c1[_0xbe14('0xb2')]]['dialAnswer']){this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}else if(this[_0xbe14('0x14')][_0x1100c1[_0xbe14('0xb2')]][_0xbe14('0x71')]){logger['info'](_0xbe14('0x149'),_0x1100c1['linkedid'],_0x1100c1[_0xbe14('0x148')],_0xbe14('0xb7'),_0x40ef0a[_0xbe14('0x51')],'pTalking:\x20',_0x40ef0a[_0xbe14('0x5e')]);this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1['linkedid'],_0x1100c1['cause']);}}else if(_0x52cdfd&&_[_0xbe14('0x6c')](_0x52cdfd[_0xbe14('0x14a')])&&_0x40ef0a[_0xbe14('0x14b')]&&_0x1100c1['linkedid']===_0x1100c1[_0xbe14('0xb6')]&&_[_0xbe14('0x6c')](_0x1100c1['reason'])&&_0x1100c1['cause']==='16'&&_0x1100c1['channelstate']==='6'&&_['isUndefined'](_0x52cdfd[_0xbe14('0x14c')])){if(_0x52cdfd[_0xbe14('0xd8')]){rpcDb['unlockContact'](_0x52cdfd['idContact']);}if(_0x52cdfd[_0xbe14('0xb1')]){rpcDb[_0xbe14('0x89')](_0x52cdfd[_0xbe14('0x10e')]);}_0x1100c1['reason']='22';this[_0xbe14('0xf8')](_0x52cdfd,_0x40ef0a,_0x1100c1);}else if(_0x52cdfd&&_0x52cdfd[_0xbe14('0x14c')]){if(_0x1100c1[_0xbe14('0x148')]==='16'&&this[_0xbe14('0x14')][_0x1100c1['linkedid']][_0xbe14('0x71')]){logger[_0xbe14('0x58')]('[syncHangup][talking][transfer]',_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')],_0xbe14('0xb7'),_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a['pTalking']);this['callProgressDetectingCustomer'](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}else if(this[_0xbe14('0x14')][_0x1100c1[_0xbe14('0xb2')]]['dialAnswer']){logger[_0xbe14('0x58')](_0xbe14('0x149'),_0x1100c1['linkedid'],_0x1100c1[_0xbe14('0x148')],'\x20Queue',_0x40ef0a[_0xbe14('0x51')],_0xbe14('0x6f'),_0x40ef0a['pTalking']);this[_0xbe14('0xa1')](_0x1100c1,_0x1100c1[_0xbe14('0xb2')],_0x1100c1[_0xbe14('0x148')]);}}};Preview[_0xbe14('0xd')][_0xbe14('0x1c')]=function(_0xac2d63){if(this[_0xbe14('0x14')][_0xac2d63[_0xbe14('0xf7')]]&&_0xac2d63['destlinkedid']!==_0xac2d63[_0xbe14('0x14d')]){this[_0xbe14('0xa1')](_0xac2d63,_0xac2d63[_0xbe14('0xf7')],_0xac2d63['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x2a5e45){if(this[_0xbe14('0x14')][_0x2a5e45[_0xbe14('0xb2')]]&&_0x2a5e45['linkedid']!==_0x2a5e45['uniqueid']&&!this[_0xbe14('0x14')][_0x2a5e45[_0xbe14('0xb2')]][_0xbe14('0x71')]){if(_0x2a5e45[_0xbe14('0x148')]==='1'){this[_0xbe14('0xa1')](_0x2a5e45,_0x2a5e45[_0xbe14('0xb2')],_0x2a5e45[_0xbe14('0x148')]);}}};Preview[_0xbe14('0xd')][_0xbe14('0x14e')]=function(_0x4b76dd,_0x43509d,_0x3a2890){if(this[_0xbe14('0x14')][_0x4b76dd]){if(_[_0xbe14('0x6c')](this[_0xbe14('0x14')][_0x4b76dd]['variables'])){this[_0xbe14('0x14')][_0x4b76dd]['variables']={};}this['actions'][_0x4b76dd][_0xbe14('0x14f')][_0x43509d]=_0x3a2890;}};Preview[_0xbe14('0xd')]['syncVarSet']=function(_0x494083){try{if(!_[_0xbe14('0x6c')](_0x494083)){if(ut[_0xbe14('0x150')](_[_0xbe14('0x151')](_0x494083[_0xbe14('0x152')])[0x0])){this[_0xbe14('0x14e')](_0x494083['uniqueid'],_['keys'](_0x494083[_0xbe14('0x152')])[0x0],_0x494083['value']);}}}catch(_0x76e84){logger[_0xbe14('0x153')]('[syncVarSet][Preview]',util['inspect'](_0x76e84,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xbe14('0x22')]=function(_0x4ee0ad){if(_0x4ee0ad){if(this[_0xbe14('0x14')][_0x4ee0ad[_0xbe14('0x154')]]){this['actions'][_0x4ee0ad[_0xbe14('0x154')]][_0xbe14('0x14c')]=!![];}}};Preview[_0xbe14('0xd')][_0xbe14('0x24')]=function(_0x2ed138){if(_0x2ed138){if(this['actions'][_0x2ed138[_0xbe14('0x155')]]){this[_0xbe14('0x14')][_0x2ed138[_0xbe14('0x155')]][_0xbe14('0x14c')]=!![];}}};module[_0xbe14('0x156')]=Preview; \ No newline at end of file +var _0x44e8=['[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','starttime','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','countglobal','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','Queue:\x20','called','[Preview][execCall][failure]','Call\x20failed','createHistory','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','disableContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','idContact','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','dialMethod','booked','clockClearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','actions','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink'];(function(_0xfcb329,_0x4da5dc){var _0x256a54=function(_0x36af1c){while(--_0x36af1c){_0xfcb329['push'](_0xfcb329['shift']());}};_0x256a54(++_0x4da5dc);}(_0x44e8,0xd7));var _0x844e=function(_0xcb1fde,_0x449286){_0xcb1fde=_0xcb1fde-0x0;var _0x2f2134=_0x44e8[_0xcb1fde];return _0x2f2134;};'use strict';var util=require(_0x844e('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var md5=require(_0x844e('0x3'));var Redis=require(_0x844e('0x4'));var config=require('../../../config/environment');var logger=require(_0x844e('0x5'))(_0x844e('0x6'));var loggerAction=require(_0x844e('0x5'))(_0x844e('0x7'));var ami=require('../ami');var rpcDb=require(_0x844e('0x8'));var Action=require(_0x844e('0x9'));var ut=require(_0x844e('0xa'));config[_0x844e('0xb')]=_['defaults'](config[_0x844e('0xb')],{'host':_0x844e('0xc'),'port':0x18eb});var io=require(_0x844e('0xd'))(new Redis(config[_0x844e('0xb')]));var Sequence=function(){};Sequence[_0x844e('0xe')][_0x844e('0xf')]=function(_0x536601){this[_0x844e('0x10')]=this[_0x844e('0x10')]?this[_0x844e('0x10')][_0x844e('0x11')](_0x536601):_0x536601();};function Preview(_0x14909f){this[_0x844e('0x12')]=new Sequence();this[_0x844e('0x13')]=_0x14909f['voiceQueues'];this[_0x844e('0x14')]=_0x14909f[_0x844e('0x14')];this['actions']={};this[_0x844e('0x15')]=_0x14909f[_0x844e('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x844e('0x16'),this[_0x844e('0x17')][_0x844e('0x18')](this));ami['on']('hangup',this[_0x844e('0x19')][_0x844e('0x18')](this));ami['on'](_0x844e('0x1a'),this[_0x844e('0x1b')][_0x844e('0x18')](this));ami['on'](_0x844e('0x1c'),this[_0x844e('0x1d')][_0x844e('0x18')](this));ami['on']('newexten',this[_0x844e('0x1e')]['bind'](this));ami['on'](_0x844e('0x1f'),this['syncVarSet'][_0x844e('0x18')](this));ami['on']('attendedtransfer',this[_0x844e('0x20')][_0x844e('0x18')](this));ami['on'](_0x844e('0x21'),this[_0x844e('0x22')][_0x844e('0x18')](this));this[_0x844e('0x23')](this[_0x844e('0x13')]);}function emit(_0x243aeb,_0x4ffb86,_0x3b5c5c){io['to'](_0x243aeb)['emit'](_0x4ffb86,_0x3b5c5c);}function emitCampaignPreview(_0x549bb3){if(_0x549bb3[_0x844e('0x24')]===_0x844e('0x25')){var _0x439b26={'id':_0x549bb3['id'],'name':_0x549bb3[_0x844e('0x26')],'strategy':_0x549bb3['strategy'],'answered':_0x549bb3[_0x844e('0x27')],'available':_0x549bb3[_0x844e('0x28')],'loggedIn':_0x549bb3['loggedIn'],'pTalking':_0x549bb3[_0x844e('0x29')],'sumBillable':_0x549bb3[_0x844e('0x2a')],'sumDuration':_0x549bb3[_0x844e('0x2b')],'sumHoldTime':_0x549bb3[_0x844e('0x2c')]||0x0,'talking':_0x549bb3[_0x844e('0x2d')],'total':_0x549bb3[_0x844e('0x2e')],'type':_0x549bb3['type'],'unmanaged':_0x549bb3[_0x844e('0x2f')],'abandoned':_0x549bb3[_0x844e('0x30')],'waiting':_0x549bb3[_0x844e('0x31')],'loggedInDb':_0x549bb3[_0x844e('0x32')],'dialActive':_0x549bb3[_0x844e('0x33')],'dialMethod':_0x549bb3['dialMethod'],'dialOriginateCallerIdName':_0x549bb3[_0x844e('0x34')],'dialOriginateCallerIdNumber':_0x549bb3['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x549bb3['dialOriginateTimeout'],'dialPrefix':_0x549bb3[_0x844e('0x35')],'outboundAnswerAgiCallsDay':_0x549bb3[_0x844e('0x36')],'outboundAnswerCallsDay':_0x549bb3[_0x844e('0x37')],'outboundBlacklistCallsDay':_0x549bb3['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x549bb3[_0x844e('0x38')],'outboundCongestionCallsDay':_0x549bb3[_0x844e('0x39')],'outboundDropCallsDayACS':_0x549bb3[_0x844e('0x3a')],'outboundDropCallsDayCallersExit':_0x549bb3['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x549bb3[_0x844e('0x3b')],'outboundNoAnswerCallsDay':_0x549bb3[_0x844e('0x3c')],'outboundNoSuchCallsDay':_0x549bb3[_0x844e('0x3d')],'outboundOriginateFailureCallsDay':_0x549bb3[_0x844e('0x3e')],'outboundReCallsDay':_0x549bb3[_0x844e('0x3f')],'outboundRejectCallsDay':_0x549bb3[_0x844e('0x40')],'outboundUnknownCallsDay':_0x549bb3[_0x844e('0x41')],'outboundAbandonedCallsDay':_0x549bb3[_0x844e('0x42')],'predictiveIntervalAnsweredCalls':_0x549bb3[_0x844e('0x43')],'predictiveIntervalAvgHoldtime':_0x549bb3[_0x844e('0x44')],'predictiveIntervalAvgTalktime':_0x549bb3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x549bb3[_0x844e('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x549bb3[_0x844e('0x46')],'predictiveIntervalErlangCalls':_0x549bb3[_0x844e('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x549bb3[_0x844e('0x48')],'predictiveIntervalHitRate':_0x549bb3[_0x844e('0x49')],'predictiveIntervalMultiplicativeFactor':_0x549bb3[_0x844e('0x4a')],'predictiveIntervalPauses':_0x549bb3[_0x844e('0x4b')],'predictiveIntervalAvailable':_0x549bb3['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x549bb3[_0x844e('0x4c')],'message':_0x549bb3[_0x844e('0x4d')],'originated':_0x549bb3[_0x844e('0x4e')],'erlangCalls':_0x549bb3['erlangCalls'],'erlangCallToSecond':_0x549bb3[_0x844e('0x4f')],'erlangAbandonmentRate':_0x549bb3[_0x844e('0x50')],'erlangBusyFactor':_0x549bb3['erlangBusyFactor'],'startPredictive':_0x549bb3[_0x844e('0x51')],'startProgressive':_0x549bb3[_0x844e('0x52')]};if(_0x549bb3['Trunk']){_0x439b26[_0x844e('0x53')]={'id':_0x549bb3[_0x844e('0x53')]['id'],'name':_0x549bb3[_0x844e('0x53')][_0x844e('0x26')],'active':_0x549bb3[_0x844e('0x53')][_0x844e('0x54')],'callerid':_0x549bb3[_0x844e('0x53')]['callerid']};}if(_0x549bb3[_0x844e('0x55')]){_0x439b26[_0x844e('0x55')]={'id':_0x549bb3[_0x844e('0x55')]['id'],'name':_0x549bb3[_0x844e('0x55')][_0x844e('0x26')]};}var _0x41b911=md5(JSON[_0x844e('0x56')](_0x439b26));if(_0x549bb3[_0x844e('0x3')]!==_0x41b911){_0x549bb3[_0x844e('0x3')]=_0x41b911;emit(util[_0x844e('0x57')](_0x844e('0x58'),_0x439b26['name']),'voice_queue:save',_0x439b26);}}}function emitVoiceQueueChannelRemove(_0x3ad6d5){logger[_0x844e('0x59')](_0x844e('0x5a'),JSON[_0x844e('0x56')](_0x3ad6d5));emit(util[_0x844e('0x57')](_0x844e('0x58'),_0x3ad6d5[_0x844e('0x26')]),_0x844e('0x5b'),_0x3ad6d5);io[_0x844e('0x5c')]('voice_queue_presence:remove',_0x3ad6d5);}function notSendMessagesQueue(_0x2f4a90){if(_0x2f4a90['sendMessageOneNotActive']){if(_0x2f4a90[_0x844e('0x4e')]===0x0&&_0x2f4a90['pTalking']===0x0){_0x2f4a90[_0x844e('0x5d')]=![];_0x2f4a90['available']=0x0;_0x2f4a90[_0x844e('0x5e')]=0x0;_0x2f4a90[_0x844e('0x4d')]=_0x844e('0x5f');ut[_0x844e('0x60')](_0x844e('0x61'),_0x2f4a90[_0x844e('0x26')]+_0x844e('0x62'));}else{_0x2f4a90[_0x844e('0x4d')]=_0x844e('0x63');ut[_0x844e('0x60')](_0x844e('0x61'),_0x2f4a90['name']+_0x844e('0x64'));}emitCampaignPreview(_0x2f4a90);}}Preview[_0x844e('0xe')][_0x844e('0x23')]=function(){var _0x511c83=this;setInterval(function(){_0x511c83['syncCampaigns']();},0x7cf);};Preview[_0x844e('0xe')][_0x844e('0x65')]=function(){var _0x1a7817=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x52a460 in _0x1a7817){if(_0x1a7817['hasOwnProperty'](_0x52a460)&&(_0x1a7817[_0x52a460][_0x844e('0x66')]===_0x844e('0x6')||_0x1a7817[_0x52a460][_0x844e('0x66')]===_0x844e('0x67'))&&_0x1a7817[_0x52a460][_0x844e('0x24')]==='outbound'){if(this[_0x844e('0x68')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x1a7817[_0x844e('0x69')](_0x52a460)&&_0x1a7817[_0x52a460][_0x844e('0x66')]===_0x844e('0x6')&&_0x1a7817[_0x52a460][_0x844e('0x24')]==='outbound'){if(_0x1a7817[_0x52a460][_0x844e('0x33')]){this[_0x844e('0x6a')](_0x1a7817[_0x52a460]);if(_0x1a7817[_0x52a460][_0x844e('0x6b')])this['recallMe'](_0x1a7817[_0x52a460]);}else{notSendMessagesQueue(_0x1a7817[_0x52a460]);}}}};Preview[_0x844e('0xe')][_0x844e('0x6c')]=function(_0x558f21){var _0x3c6502=this;this[_0x844e('0x12')][_0x844e('0xf')](function(){if(!_[_0x844e('0x6d')](_0x3c6502[_0x844e('0x6e')][_0x558f21])){loggerAction[_0x844e('0x59')]('[clearZombieChannels][talking]',_0x558f21,_0x844e('0x6f'),_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x70')],_0x844e('0x71'),JSON[_0x844e('0x56')](_0x3c6502[_0x844e('0x13')][_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x70')]][_0x844e('0x4e')]),_0x844e('0x72'),JSON['stringify'](_0x3c6502[_0x844e('0x13')][_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x70')]]['pTalking']),JSON[_0x844e('0x56')](_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x73')]),JSON[_0x844e('0x56')](_[_0x844e('0x74')](_0x3c6502[_0x844e('0x6e')][_0x558f21],[_0x844e('0x75'),'UserId',_0x844e('0x76'),_0x844e('0x77')])));return ami[_0x844e('0x78')]({'action':_0x844e('0x79'),'channel':_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x7a')]})[_0x844e('0x7b')](function(_0x3acef5){if(_0x3acef5[_0x844e('0x4d')]===_0x844e('0x7c')){setTimeout(function(){if(_0x3c6502[_0x844e('0x6e')][_0x558f21]){ut[_0x844e('0x7d')](_0x3c6502[_0x844e('0x13')][_0x3c6502['actions'][_0x558f21][_0x844e('0x70')]],_0x844e('0x7e'));if(_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x73')]===!![]){ut[_0x844e('0x7f')](_0x3c6502[_0x844e('0x13')][_0x3c6502['actions'][_0x558f21][_0x844e('0x70')]],_0x844e('0x7e'));ut['loggerError'](_0x844e('0x80')+_0x558f21,_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x70')]);}ut[_0x844e('0x81')](_0x844e('0x82')+_0x558f21,_0x3c6502[_0x844e('0x6e')][_0x558f21][_0x844e('0x70')]);delete _0x3c6502[_0x844e('0x6e')][_0x558f21];}},0x2328);}});}});};Preview[_0x844e('0xe')][_0x844e('0x83')]=function(){var _0x2dfda6=this;loggerAction[_0x844e('0x59')](_0x844e('0x84'),_[_0x844e('0x85')](this['actions']));for(var _0x44d3de in this[_0x844e('0x6e')]){if(_0x2dfda6['actions'][_0x844e('0x69')](_0x44d3de)){_0x2dfda6['clearZombieChannel'](_0x44d3de);}}};Preview[_0x844e('0xe')][_0x844e('0x86')]=function(_0x1a84a7){var _0x5c4858=this;rpcDb['getContactRecallMe'](_0x1a84a7['id'],ut[_0x844e('0x87')](this[_0x844e('0x15')]))[_0x844e('0x88')](function(_0x3d6fa7){if(!_[_0x844e('0x6d')](_0x3d6fa7)){for(var _0x4dca78=0x0;_0x4dca78<_0x3d6fa7[_0x844e('0x89')];_0x4dca78+=0x1){if(ut[_0x844e('0x8a')](_0x3d6fa7[_0x4dca78][_0x844e('0x8b')])<_0x1a84a7[_0x844e('0x8c')]*0x3c){if(_0x3d6fa7[_0x4dca78]['Agent']&&!_0x3d6fa7[_0x4dca78][_0x844e('0x8d')][_0x844e('0x8e')]){_0x5c4858[_0x844e('0x8f')](_0x3d6fa7[_0x4dca78]['id'])['then'](ut['logger2'](_0x844e('0x90')))[_0x844e('0x7b')](ut[_0x844e('0x91')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x3d6fa7[_0x4dca78]['id']);}}else{var _0x33798f=new Action(_0x3d6fa7[_0x4dca78],_0x1a84a7);_0x33798f[_0x844e('0x92')]=moment()[_0x844e('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a84a7[_0x844e('0x3f')]+=0x1;ut[_0x844e('0x93')](_0x33798f,0x17,_0x844e('0x94'));if(_0x1a84a7['dialRecallInQueue']){rpcDb[_0x844e('0x95')](ut[_0x844e('0x96')](_0x3d6fa7[_0x4dca78]));rpcDb[_0x844e('0x97')](_0x33798f,_0x844e('0x98'));}else{ut['logCustomer'](_0x33798f,0x16,_0x844e('0x99'));rpcDb[_0x844e('0x97')](_0x33798f,_0x844e('0x9a'));rpcDb[_0x844e('0x9b')](_0x33798f,_0x844e('0x9a'));}}}}})[_0x844e('0x7b')](ut[_0x844e('0x91')](_0x844e('0x9c')));};Preview['prototype']['setMessage']=function(_0x3f32cc){_0x3f32cc['sendMessageOneNotActive']=!![];if(ut[_0x844e('0x9d')](_0x3f32cc[_0x844e('0x9e')])){_0x3f32cc[_0x844e('0x4d')]=_0x844e('0x9f');}else if(!ut['isActive'](_0x3f32cc['dialActive'])){_0x3f32cc['message']='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x3f32cc['Trunk'])){if(!this[_0x844e('0xa0')](_0x3f32cc[_0x844e('0xa1')])){_0x3f32cc[_0x844e('0x4d')]='TRUNK_IS_NOT_REACHABLE';}else{_0x3f32cc[_0x844e('0x4d')]=_0x844e('0xa2');}}else{_0x3f32cc['message']=_0x844e('0xa2');}emitCampaignPreview(_0x3f32cc);};Preview['prototype'][_0x844e('0xa3')]=function(_0x231136,_0x31ac08,_0x361e36){var _0x4805b7=this;var _0x5554e2=this['actions'][_0x31ac08];var _0x314586=this[_0x844e('0x13')][_0x5554e2[_0x844e('0x70')]];var _0x2fe056;if(_0x314586){switch(_0x361e36){case'1':_0x314586[_0x844e('0x3d')]+=0x1;_0x5554e2['countnosuchnumberretry']+=0x1;_0x5554e2['countglobal']=ut[_0x844e('0xa4')](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x0,_0x844e('0xa5'));ami[_0x844e('0x5c')](_0x844e('0xa6'),ut[_0x844e('0xa7')](_0x5554e2,'nosuchnumber'));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xa8'));if(ut['totalGlobal'](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,'Global');rpcDb['createCustomerFinal'](_0x2fe056,_0x844e('0xab'));}else{if(_0x5554e2[_0x844e('0xac')]>=_0x314586[_0x844e('0xad')]){rpcDb['createCustomerFinal'](_0x5554e2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0x844e('0xae')](_0x5554e2,'countnosuchnumberretry',_0x314586[_0x844e('0xaf')]),_0x5554e2[_0x844e('0xb0')],_0x5554e2[_0x844e('0xb1')]);}}delete this[_0x844e('0x6e')][_0x231136[_0x844e('0xb2')]];break;case _0x844e('0xb3'):var _0x4a2d21=moment()[_0x844e('0x57')](_0x844e('0xb4'));_0x5554e2['responsetime']=_0x4a2d21;_0x5554e2[_0x844e('0xb5')]=_0x4a2d21;_0x5554e2[_0x844e('0x73')]=!![];_0x314586[_0x844e('0x29')]+=0x1;logger[_0x844e('0x59')](_0x844e('0xb6'),_0x5554e2['uniqueid'],'\x20Queue',_0x314586[_0x844e('0x26')],_0x844e('0x72'),_0x314586[_0x844e('0x29')]);ami[_0x844e('0x5c')](_0x844e('0xb7'),ut[_0x844e('0xa7')](_0x5554e2,_0x844e('0xb8'),this['campaignsPreview'][_0x5554e2[_0x844e('0x70')]]));if(_0x314586[_0x844e('0xb9')]){ami['emit'](_0x844e('0xba'),ut[_0x844e('0xbb')](_0x5554e2));}break;case'16':ami[_0x844e('0x5c')]('custom:agentcomplete',ut['buildObj'](_0x5554e2,_0x844e('0xbc'),this[_0x844e('0x13')][_0x5554e2['queue']]));emitVoiceQueueChannelRemove(ut[_0x844e('0xa7')](_0x5554e2,_0x844e('0xbc')));_0x314586[_0x844e('0x37')]+=0x1;_0x314586[_0x844e('0x2e')]+=0x1;_0x314586[_0x844e('0x27')]+=0x1;ut[_0x844e('0x7f')](_0x314586,_0x844e('0xbd'));_0x5554e2['countglobal']=ut[_0x844e('0xa4')](_0x5554e2);ut['logCustomer'](_0x5554e2,0x4,_0x844e('0xbe'));rpcDb['createCustomerHistory'](_0x5554e2,_0x844e('0xbf'));rpcDb['createCustomerFinal'](_0x5554e2,_0x844e('0xc0'));rpcDb[_0x844e('0xc1')](_0x5554e2);_0x314586['sumDuration']+=_0x5554e2[_0x844e('0xc2')];_0x314586[_0x844e('0x2a')]+=_0x5554e2[_0x844e('0xc2')];logger[_0x844e('0x59')](_0x844e('0xc3'),_0x5554e2['uniqueid'],_0x844e('0xc4'),_0x314586[_0x844e('0x26')],_0x844e('0x72'),_0x314586[_0x844e('0x29')]);delete this[_0x844e('0x6e')][_0x231136[_0x844e('0xb2')]];break;case _0x844e('0xc5'):_0x314586[_0x844e('0x38')]+=0x1;_0x5554e2[_0x844e('0xc6')]+=0x1;_0x5554e2[_0x844e('0xc7')]=ut['totalGlobal'](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x5,_0x844e('0xc8'));ami[_0x844e('0x5c')](_0x844e('0xc9'),ut[_0x844e('0xa7')](_0x5554e2,_0x844e('0xca')));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xcb'));if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb[_0x844e('0x9b')](_0x2fe056,_0x844e('0xcd'));}else{if(_0x5554e2[_0x844e('0xc6')]>=_0x314586['dialBusyMaxRetry']){rpcDb[_0x844e('0x9b')](_0x5554e2,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x844e('0xce')](ut[_0x844e('0xae')](_0x5554e2,_0x844e('0xc6'),_0x314586[_0x844e('0xcf')]),_0x5554e2[_0x844e('0xb0')],_0x5554e2['activeContact']);}}break;case _0x844e('0xd0'):_0x314586[_0x844e('0x3c')]+=0x1;_0x5554e2[_0x844e('0xd1')]+=0x1;_0x5554e2['countglobal']=ut['totalGlobal'](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x3,_0x844e('0xd2'));ami['emit'](_0x844e('0xd3'),ut[_0x844e('0xa7')](_0x5554e2,_0x844e('0xd4')));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xd5'));if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb['createCustomerFinal'](_0x2fe056,_0x844e('0xd6'));}else{if(_0x5554e2['countnoanswerretry']>=_0x314586[_0x844e('0xd7')]){rpcDb[_0x844e('0x9b')](_0x5554e2,_0x844e('0xd5'));}else{rpcDb[_0x844e('0xce')](ut[_0x844e('0xae')](_0x5554e2,'countnoanswerretry',_0x314586[_0x844e('0xd8')]),_0x5554e2[_0x844e('0xb0')],_0x5554e2['activeContact']);}}break;case _0x844e('0xd9'):_0x314586[_0x844e('0x39')]+=0x1;_0x5554e2[_0x844e('0xda')]+=0x1;_0x5554e2[_0x844e('0xc7')]=ut[_0x844e('0xa4')](_0x5554e2);ut['logCustomer'](_0x5554e2,0x8,_0x844e('0xdb'));ami[_0x844e('0x5c')]('custom:agentcongestion',ut['buildObj'](_0x5554e2,'congestion'));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xdc'));if(ut['totalGlobal'](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb[_0x844e('0x9b')](_0x2fe056,_0x844e('0xdd'));}else{if(_0x5554e2['countcongestionretry']>=_0x314586['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x5554e2,_0x844e('0xdc'));}else{rpcDb[_0x844e('0xce')](ut[_0x844e('0xae')](_0x5554e2,_0x844e('0xda'),_0x314586['dialBusyRetryFrequency']),_0x5554e2['unlockAgent'],_0x5554e2[_0x844e('0xb1')]);}}break;case _0x844e('0xde'):_0x314586[_0x844e('0x40')]+=0x1;_0x5554e2[_0x844e('0xdf')]+=0x1;_0x5554e2[_0x844e('0xc7')]=ut['totalGlobal'](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x14,_0x844e('0xe0'));ami['emit'](_0x844e('0xe1'),ut['buildObj'](_0x5554e2,_0x844e('0xe2')));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xe3'));if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0x14,_0x844e('0xe0'));rpcDb[_0x844e('0x9b')](_0x2fe056,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x5554e2[_0x844e('0xdf')]>=_0x314586[_0x844e('0xe4')]){rpcDb[_0x844e('0x9b')](_0x5554e2,_0x844e('0xe5'));}else{rpcDb[_0x844e('0xce')](ut['scheduledAt'](_0x5554e2,_0x844e('0xdf'),_0x314586[_0x844e('0xe6')]),_0x5554e2[_0x844e('0xb0')],_0x5554e2[_0x844e('0xb1')]);}}break;case _0x844e('0xe7'):_0x314586[_0x844e('0x42')]+=0x1;_0x5554e2[_0x844e('0xe8')]+=0x1;_0x5554e2['countglobal']=ut['totalGlobal'](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0xb,_0x844e('0xe9'));rpcDb[_0x844e('0x97')](_0x5554e2,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb['createCustomerFinal'](_0x2fe056,_0x844e('0xea'));}else{if(_0x5554e2[_0x844e('0xeb')]>=_0x314586[_0x844e('0xec')]){rpcDb['createCustomerFinal'](_0x5554e2,_0x844e('0xea'));}else{rpcDb[_0x844e('0xce')](ut['scheduledAt'](_0x5554e2,_0x844e('0xe8'),_0x314586[_0x844e('0xed')]),_0x5554e2[_0x844e('0xb0')],_0x5554e2[_0x844e('0xb1')]);}}break;case'18':_0x314586[_0x844e('0x41')]+=0x1;_0x5554e2[_0x844e('0xee')]+=0x1;_0x5554e2['countglobal']=ut[_0x844e('0xa4')](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x12,_0x231136[_0x844e('0xef')]||_0x231136[_0x844e('0xf0')]);ami[_0x844e('0x5c')](_0x844e('0xf1'),ut['buildObj'](_0x5554e2,_0x844e('0xf2')));rpcDb[_0x844e('0x97')](_0x5554e2,_0x844e('0xf3'));if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb['createCustomerFinal'](_0x2fe056,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x5554e2,_0x844e('0xf3'));}delete this[_0x844e('0x6e')][_0x231136[_0x844e('0xb2')]];break;case'19':_0x314586[_0x844e('0x41')]+=0x1;_0x5554e2[_0x844e('0xc7')]=ut[_0x844e('0xa4')](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0x13,_0x231136[_0x844e('0xef')]||_0x231136[_0x844e('0xf0')]);ami['emit']('custom:amd',ut[_0x844e('0xa7')](_0x5554e2,'amd'));rpcDb[_0x844e('0x97')](_0x5554e2,'[callProgressDetectingCustomer][machine]');if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,_0x844e('0xcc'));rpcDb[_0x844e('0x9b')](_0x2fe056,_0x844e('0xf4'));}else{rpcDb['createCustomerFinal'](_0x5554e2,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x231136[_0x844e('0xb2')]];break;default:if(_0x5554e2[_0x844e('0x73')]){ut[_0x844e('0x7f')](_0x314586,_0x844e('0xf5'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x314586['name'],_0x231136);}_0x314586[_0x844e('0x41')]+=0x1;_0x5554e2[_0x844e('0xc7')]=ut[_0x844e('0xa4')](_0x5554e2);ut[_0x844e('0x93')](_0x5554e2,0xc,_0x231136[_0x844e('0xef')]||_0x231136[_0x844e('0xf0')]);rpcDb[_0x844e('0x97')](_0x5554e2,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x844e('0xa4')](_0x5554e2)>=_0x314586[_0x844e('0xa9')]){_0x2fe056=ut[_0x844e('0xaa')](_0x5554e2,0xf,'Global');rpcDb[_0x844e('0x9b')](_0x2fe056,_0x844e('0xf6'));}else{rpcDb[_0x844e('0x9b')](_0x5554e2,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x231136[_0x844e('0xb2')]];}if(!(_0x5554e2['dialAnswer']&&_0x361e36==='16')){ut['updateOriginated'](_0x314586,_0x844e('0xf7'));logger[_0x844e('0x59')]('[originated][decrement][callProgressDetectingCustomer]',_0x5554e2[_0x844e('0xf8')],_0x844e('0xc4'),_0x314586[_0x844e('0x26')],'originated:\x20',_0x314586[_0x844e('0x4e')]);}if(_0x361e36!==_0x844e('0xb3')){delete this[_0x844e('0x6e')][_0x231136[_0x844e('0xb2')]];delete this['actions'][_0x231136[_0x844e('0xf9')]];}}};Preview[_0x844e('0xe')][_0x844e('0xfa')]=function(_0x2a4a75,_0x4a8ffe,_0x223fd4){if(_[_0x844e('0xfb')](_0x4a8ffe)&&'object'!==typeof _0x4a8ffe){return;}if(_['isUndefined'](_0x223fd4)&&_0x844e('0xfc')!==typeof _0x223fd4){return;}switch(_0x223fd4[_0x844e('0xfd')]){case'0':ut[_0x844e('0xfe')](_0x2a4a75,0x0,'NoSuchNumber');rpcDb[_0x844e('0xff')](_0x2a4a75,_0x844e('0x100'));break;case'3':ut[_0x844e('0xfe')](_0x2a4a75,0x3,'NoAnswer');rpcDb[_0x844e('0xff')](_0x2a4a75,_0x844e('0x101'));break;case'5':ut['logAgent'](_0x2a4a75,0x5,_0x844e('0xc8'));rpcDb[_0x844e('0xff')](_0x2a4a75,_0x844e('0x102'));break;case'8':ut['logAgent'](_0x2a4a75,0x8,_0x844e('0xdb'));rpcDb[_0x844e('0xff')](_0x2a4a75,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x844e('0xfe')](_0x2a4a75,0x16,_0x844e('0x103'));rpcDb[_0x844e('0xff')](_0x2a4a75,_0x844e('0x104'));break;default:ut['logAgent'](_0x2a4a75,0xc,_0x223fd4[_0x844e('0xfd')]);rpcDb['createAgentHistory'](_0x2a4a75,_0x844e('0x105'));}ut[_0x844e('0x7d')](_0x4a8ffe,_0x844e('0x106'));logger['info'](_0x844e('0x107'),_0x2a4a75['uniqueid'],_0x844e('0xc4'),_0x4a8ffe[_0x844e('0x26')],_0x844e('0x71'),_0x4a8ffe['originated']);delete this[_0x844e('0x6e')][_0x2a4a75[_0x844e('0xf8')]];};Preview[_0x844e('0xe')][_0x844e('0x108')]=function(_0x7587d6,_0x7015d7,_0x20a7ad,_0x8fc499,_0x433aa1){var _0x1fbe98=this;return new BPromise(function(_0x2c9057,_0x370959){if(_[_0x844e('0x6d')](_0x7015d7)||_[_0x844e('0x6d')](_0x7015d7[_0x844e('0x109')])||_[_0x844e('0x6d')](_0x7015d7['Contact'][_0x844e('0x10a')])||_[_0x844e('0x6d')](_0x7015d7[_0x844e('0x76')])){_0x370959(ut['message']('Contact\x20is\x20undefined',_0x8fc499,_0x433aa1));return;}var _0x33aa74=uuid['v4']();var _0x7d6f7f=_0x1fbe98[_0x844e('0x13')][_0x7015d7[_0x844e('0x6f')][_0x844e('0x26')]];var _0x5d4914=_0x20a7ad?_0x1fbe98[_0x844e('0x15')][_0x20a7ad]['id']:undefined;_0x1fbe98[_0x844e('0x6e')][_0x33aa74]=new Action(_0x7015d7,_0x7d6f7f,_0x33aa74,_0x20a7ad,_0x5d4914);var _0x3fa9f7=_0x1fbe98['actions'][_0x33aa74];_0x3fa9f7['unlockAgent']=_0x8fc499;_0x3fa9f7[_0x844e('0xb1')]=_0x433aa1;_0x3fa9f7[_0x844e('0x10b')]=_0x20a7ad;if(_['isEmpty'](_0x7587d6)){_0x1fbe98['execCall'](_0x3fa9f7,_0x7d6f7f,_0x7015d7,_0x20a7ad)[_0x844e('0x88')](function(_0x90bafd){logger[_0x844e('0x59')]('[Preview][execCall][success]',_0x844e('0x10c')+_0x3fa9f7[_0x844e('0x70')]+'\x20IdHopper:\x20'+_0x3fa9f7['idContact'],JSON['stringify'](_0x90bafd));ami['emit']('custom:agentcalled',ut[_0x844e('0xa7')](_0x3fa9f7,_0x844e('0x10d'),_0x1fbe98[_0x844e('0x13')][_0x3fa9f7[_0x844e('0x70')]]));_0x2c9057(ut['message']('Calling'));})[_0x844e('0x7b')](function(_0x4b1a81){ut[_0x844e('0x60')](_0x844e('0x10e'),_0x4b1a81);_0x370959(ut[_0x844e('0x4d')](_0x844e('0x10f'),_0x8fc499,_0x433aa1));});}else{_0x7d6f7f['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x3fa9f7);rpcDb[_0x844e('0x110')](_0x3fa9f7,'[Blacklist][error]');delete _0x1fbe98[_0x844e('0x6e')][_0x33aa74];_0x370959(ut['message']('Contact\x20in\x20black\x20List',_0x8fc499,_0x433aa1));}});};Preview[_0x844e('0xe')][_0x844e('0xa0')]=function(_0x47c0fd){return!_[_0x844e('0x6d')](_0x47c0fd)&&!_['isNil'](_0x47c0fd[_0x844e('0x26')])&&!_[_0x844e('0x6d')](_0x47c0fd[_0x844e('0x54')])&&_0x47c0fd[_0x844e('0x54')]&&!_['isNil'](this[_0x844e('0x14')][util[_0x844e('0x57')](_0x844e('0x111'),_0x47c0fd['name'])])&&!_['isNil'](this[_0x844e('0x14')][util[_0x844e('0x57')](_0x844e('0x111'),_0x47c0fd[_0x844e('0x26')])][_0x844e('0x79')])&&(this[_0x844e('0x14')][util[_0x844e('0x57')](_0x844e('0x111'),_0x47c0fd[_0x844e('0x26')])]['status']===_0x844e('0x112')||this['trunks'][util[_0x844e('0x57')](_0x844e('0x111'),_0x47c0fd['name'])][_0x844e('0x79')]===_0x844e('0x113'));};Preview[_0x844e('0xe')][_0x844e('0x8f')]=function(_0x5d5d3e,_0x5282f1){var _0x1af6af=this;return new BPromise(function(_0x379908,_0x5dbabe){_0x1af6af[_0x844e('0x114')](_0x5d5d3e,_0x5282f1)[_0x844e('0x88')](function(_0x56ddb8){_0x379908(_[_0x844e('0x74')](_0x56ddb8,[_0x844e('0x4d')]));})['catch'](function(_0x5c386c){if(_0x5c386c[_0x844e('0x115')]){rpcDb[_0x844e('0x116')](_0x5d5d3e);}if(_0x5c386c[_0x844e('0x54')]){rpcDb[_0x844e('0x117')](_0x5d5d3e);}_0x5dbabe(_['pick'](_0x5c386c,[_0x844e('0x4d')]));});});};Preview[_0x844e('0xe')][_0x844e('0x114')]=function(_0x981713,_0xe930df){var _0x583c31=this;return new BPromise(function(_0x5a3db3,_0x4f00cb){var _0x2354a4,_0x1156a1;rpcDb['getContactPreview'](_0x981713)[_0x844e('0x88')](function(_0x149434){if(!_[_0x844e('0x6d')](_0x149434[0x0])){_0x1156a1=_0x149434[0x0]['recallme']?![]:!![];_0x2354a4=_0x149434[0x0][_0x844e('0x118')]?!![]:![];_0x2354a4=_0xe930df?!![]:_0x2354a4;}var _0x2378fb=_0x583c31[_0x844e('0x119')](_0x149434);if(_0x2378fb[_0x844e('0x11a')]){rpcDb[_0x844e('0x11b')](_[_0x844e('0x74')](_0x149434[0x0],['VoiceQueueId',_0x844e('0x11c')]))[_0x844e('0x88')](function(_0x385b2b){_0x583c31[_0x844e('0x108')](_0x385b2b,_0x149434[0x0],_0xe930df,_0x1156a1,_0x2354a4)[_0x844e('0x88')](function(_0x114bbc){_0x5a3db3(_0x114bbc);})[_0x844e('0x7b')](function(_0x18ddb5){_0x4f00cb(_0x18ddb5);});})[_0x844e('0x7b')](function(_0x3d4cde){ut[_0x844e('0x60')](_0x844e('0x11d'),_0x3d4cde);_0x4f00cb(ut[_0x844e('0x4d')](_0x844e('0x11e'),_0x1156a1,_0x2354a4));});}else{_0x4f00cb(ut['message'](_0x2378fb[_0x844e('0x4d')],_0x1156a1,_0x2354a4));}})[_0x844e('0x7b')](function(_0x30df30){ut[_0x844e('0x60')](_0x844e('0x11f'),_0x30df30);_0x4f00cb(ut[_0x844e('0x4d')](_0x844e('0x11e'),![],!![]));});});};Preview[_0x844e('0xe')][_0x844e('0x119')]=function(_0x18eb12){if(_['isNil'](_0x18eb12)||_[_0x844e('0x120')](_0x18eb12)||!_['isNil'](_0x18eb12[0x0][_0x844e('0x8d')])&&_[_0x844e('0x6d')](_0x18eb12[0x0][_0x844e('0x8d')][_0x844e('0x26')])){ut[_0x844e('0x60')](_0x844e('0x121'),_0x18eb12);return{'isValid':![],'message':_0x844e('0x122')};}var _0xe35689=this[_0x844e('0x13')][_0x18eb12[0x0][_0x844e('0x6f')]['name']];_0xe35689[_0x844e('0x4d')]='ACTIVE';if(_['isNil'](_0xe35689)){ut[_0x844e('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0xe35689);return{'isValid':![],'message':_0x844e('0x123')};}if(!this['isTrunkReachable'](_0xe35689[_0x844e('0x53')])){ut['logger'](_0x844e('0x124'),'campaign\x20Name:\x20'+_0xe35689[_0x844e('0x26')]+_0x844e('0x125'));if(!this['isTrunkReachable'](_0xe35689[_0x844e('0xa1')])){ut[_0x844e('0x60')](_0x844e('0x124'),_0xe35689['name']+_0x844e('0x126'));return{'isValid':![],'message':_0x844e('0x127')};}}if(!ut[_0x844e('0x128')](_0xe35689[_0x844e('0x33')])){ut[_0x844e('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0xe35689['name']+_0x844e('0x129'));return{'isValid':![],'message':_0x844e('0x12a')+_0xe35689[_0x844e('0x26')]+_0x844e('0x129')};}return{'isValid':!![],'message':_0x844e('0x12b')};};Preview[_0x844e('0xe')][_0x844e('0x12c')]=function(_0x10c8ad,_0x44ad39,_0x1c12ba,_0x394fb3){var _0x14c263=this;return new BPromise(function(_0x197e23,_0x4b9edc){var _0x49ef0b=_0x10c8ad[_0x844e('0xf8')];var _0x523daa=_0x14c263[_0x844e('0xa0')](_0x44ad39['Trunk'])?util[_0x844e('0x57')]('SIP/%s/%s%s',_0x44ad39[_0x844e('0x53')][_0x844e('0x26')],_[_0x844e('0x6d')](_0x44ad39[_0x844e('0x35')])?'':_0x44ad39['dialPrefix'][_0x844e('0x12d')]()||'',_0x44ad39[_0x844e('0x12e')]>0x0?_0x1c12ba[_0x844e('0x109')][_0x844e('0x10a')][_0x844e('0x12f')](_0x44ad39[_0x844e('0x12e')]):_0x1c12ba[_0x844e('0x109')][_0x844e('0x10a')]):util[_0x844e('0x57')](_0x844e('0x130'),_[_0x844e('0x6d')](_0x44ad39[_0x844e('0xa1')])?_0x44ad39[_0x844e('0x53')][_0x844e('0x26')]:_0x44ad39[_0x844e('0xa1')]['name'],_[_0x844e('0x6d')](_0x44ad39[_0x844e('0x35')])?'':_0x44ad39[_0x844e('0x35')][_0x844e('0x12d')]()||'',_0x44ad39[_0x844e('0x12e')]>0x0?_0x1c12ba[_0x844e('0x109')][_0x844e('0x10a')]['substring'](_0x44ad39[_0x844e('0x12e')]):_0x1c12ba[_0x844e('0x109')][_0x844e('0x10a')]);var _0x49a8a0=_0x14c263[_0x844e('0xa0')](_0x44ad39[_0x844e('0x53')])?ut[_0x844e('0x131')](_0x44ad39[_0x844e('0x53')]['callerid'],_0x44ad39[_0x844e('0x34')],_0x44ad39[_0x844e('0x132')]>0x0?ut[_0x844e('0x133')](_0x44ad39[_0x844e('0x134')],_0x44ad39['dialRandomLastDigitCallerIdNumber']):_0x44ad39[_0x844e('0x134')]):ut['getCallerId'](_[_0x844e('0x6d')](_0x44ad39[_0x844e('0xa1')])?_0x44ad39['Trunk'][_0x844e('0x135')]:_0x44ad39[_0x844e('0xa1')][_0x844e('0x135')],_0x44ad39['dialOriginateCallerIdName'],_0x44ad39[_0x844e('0x132')]>0x0?ut[_0x844e('0x133')](_0x44ad39['dialOriginateCallerIdNumber'],_0x44ad39[_0x844e('0x132')]):_0x44ad39[_0x844e('0x134')]);if(_0x49a8a0){_0x10c8ad[_0x844e('0x136')]=ut[_0x844e('0x137')](_0x49a8a0);_0x10c8ad[_0x844e('0x138')]=ut[_0x844e('0x139')](_0x49a8a0);}var _0xca5268=ut['addVariables'](_0x44ad39,_0x1c12ba,_0x523daa,_0x49a8a0,_0x49ef0b,_0x10c8ad);_[_0x844e('0x13a')](_0x10c8ad,ut[_0x844e('0x13b')](_0xca5268));_0x10c8ad[_0x844e('0x92')]=moment()[_0x844e('0x57')](_0x844e('0xb4'));ami[_0x844e('0x78')](ut['variablesAction'](_0x10c8ad,_0x44ad39,_0xca5268,_0x10c8ad[_0x844e('0xb1')],_0x394fb3))[_0x844e('0x88')](function(_0x28e6ec){_0x44ad39[_0x844e('0x4e')]+=0x1;logger[_0x844e('0x59')](_0x844e('0x13c'),_0x49ef0b,'\x20Queue',_0x44ad39['name'],'originated:\x20',_0x44ad39[_0x844e('0x4e')]);_0x197e23(_0x28e6ec);})[_0x844e('0x7b')](function(_0x214649){ut[_0x844e('0xfe')](_0x10c8ad,0xe,_0x844e('0x13d'));rpcDb[_0x844e('0xff')](_0x10c8ad,_0x844e('0x13e'));_0x4b9edc(_0x214649);});});};Preview[_0x844e('0xe')][_0x844e('0x1e')]=function(_0x466f00){if(this[_0x844e('0x6e')][_0x466f00['linkedid']]){this['actions'][_0x466f00['linkedid']][_0x844e('0x7a')]=_0x466f00[_0x844e('0x7a')];}};Preview['prototype'][_0x844e('0x17')]=function(_0x575bc8){var _0x3a9ee7=this;var _0xde7713=this['actions'][_0x575bc8['actionid']];if(_0xde7713){if(_0xde7713[_0x844e('0x10b')]&&this[_0x844e('0x15')][_0xde7713[_0x844e('0x10b')]]){ut['logLookAgent'](_0xde7713,this[_0x844e('0x15')][_0xde7713[_0x844e('0x10b')]][_0x844e('0x26')],this['agents'][_0xde7713[_0x844e('0x10b')]]['id']);}var _0x38eeb7=_['clone'](_0xde7713);_0x38eeb7['responsetime']=moment()[_0x844e('0x57')](_0x844e('0xb4'));var _0x4e5b88=_0x3a9ee7[_0x844e('0x13')][_0xde7713[_0x844e('0x70')]];if(ut['isFailure'](_0x575bc8[_0x844e('0x13f')])){if(_0xde7713['unlockAgent']){rpcDb['unlockContact'](_0xde7713['idContact']);}if(_0xde7713['activeContact']){rpcDb['disableContact'](_0xde7713['idContact']);}ami['emit'](_0x844e('0x140'),ut[_0x844e('0xa7')](_0xde7713,_0x844e('0x141'),this[_0x844e('0x13')][_0xde7713[_0x844e('0x70')]]));this[_0x844e('0xfa')](_0x38eeb7,_0x4e5b88,_0x575bc8);}else{_0xde7713[_0x844e('0x92')]=moment()[_0x844e('0x57')](_0x844e('0xb4'));ut[_0x844e('0xfe')](_0x38eeb7,0x4,_0x844e('0xbe'));rpcDb['createAgentHistory'](_0x38eeb7,_0x844e('0x142'));}}};Preview[_0x844e('0xe')][_0x844e('0x19')]=function(_0x4e80a3){var _0x591b89=this;var _0x1ddcd0=this[_0x844e('0x6e')][_0x4e80a3[_0x844e('0xb2')]];var _0x52e045;if(_0x1ddcd0){_0x52e045=this['campaignsPreview'][_0x1ddcd0[_0x844e('0x70')]];logger[_0x844e('0x59')](_0x844e('0x143'),_0x4e80a3[_0x844e('0xb2')],_0x844e('0xc4'),_0x52e045['name'],_0x844e('0x72'),_0x52e045[_0x844e('0x29')]);}if(this[_0x844e('0x6e')][_0x4e80a3[_0x844e('0xb2')]]&&_0x4e80a3[_0x844e('0xb2')]!==_0x4e80a3[_0x844e('0xf8')]){if(_0x4e80a3[_0x844e('0x144')]==='16'&&this[_0x844e('0x6e')][_0x4e80a3['linkedid']][_0x844e('0x73')]){this[_0x844e('0xa3')](_0x4e80a3,_0x4e80a3[_0x844e('0xb2')],_0x4e80a3[_0x844e('0x144')]);}else if(this['actions'][_0x4e80a3[_0x844e('0xb2')]][_0x844e('0x73')]){logger['info']('[syncHangup][talking][cause]',_0x4e80a3[_0x844e('0xb2')],_0x4e80a3[_0x844e('0x144')],_0x844e('0xc4'),_0x52e045[_0x844e('0x26')],_0x844e('0x72'),_0x52e045[_0x844e('0x29')]);this[_0x844e('0xa3')](_0x4e80a3,_0x4e80a3['linkedid'],_0x4e80a3[_0x844e('0x144')]);}}else if(_0x1ddcd0&&_[_0x844e('0x6d')](_0x1ddcd0[_0x844e('0x145')])&&_0x52e045[_0x844e('0x146')]&&_0x4e80a3[_0x844e('0xb2')]===_0x4e80a3[_0x844e('0xf8')]&&_[_0x844e('0x6d')](_0x4e80a3[_0x844e('0xfd')])&&_0x4e80a3[_0x844e('0x144')]==='16'&&_0x4e80a3['channelstate']==='6'&&_[_0x844e('0xfb')](_0x1ddcd0[_0x844e('0x147')])){if(_0x1ddcd0[_0x844e('0xb0')]){rpcDb[_0x844e('0x116')](_0x1ddcd0[_0x844e('0x148')]);}if(_0x1ddcd0[_0x844e('0xb1')]){rpcDb[_0x844e('0x117')](_0x1ddcd0[_0x844e('0x148')]);}_0x4e80a3[_0x844e('0xfd')]='22';this['callProgressDetectingAgent'](_0x1ddcd0,_0x52e045,_0x4e80a3);}else if(_0x1ddcd0&&_0x1ddcd0['transfer']){if(_0x4e80a3['cause']==='16'&&this[_0x844e('0x6e')][_0x4e80a3[_0x844e('0xb2')]][_0x844e('0x73')]){logger[_0x844e('0x59')]('[syncHangup][talking][transfer]',_0x4e80a3[_0x844e('0xb2')],_0x4e80a3[_0x844e('0x144')],_0x844e('0xc4'),_0x52e045[_0x844e('0x26')],'pTalking:\x20',_0x52e045[_0x844e('0x29')]);this[_0x844e('0xa3')](_0x4e80a3,_0x4e80a3[_0x844e('0xb2')],_0x4e80a3[_0x844e('0x144')]);}else if(this[_0x844e('0x6e')][_0x4e80a3[_0x844e('0xb2')]][_0x844e('0x73')]){logger[_0x844e('0x59')](_0x844e('0x149'),_0x4e80a3['linkedid'],_0x4e80a3[_0x844e('0x144')],_0x844e('0xc4'),_0x52e045[_0x844e('0x26')],_0x844e('0x72'),_0x52e045[_0x844e('0x29')]);this[_0x844e('0xa3')](_0x4e80a3,_0x4e80a3['linkedid'],_0x4e80a3[_0x844e('0x144')]);}}};Preview[_0x844e('0xe')][_0x844e('0x1d')]=function(_0x1f26b2){if(this[_0x844e('0x6e')][_0x1f26b2['destlinkedid']]&&_0x1f26b2[_0x844e('0xf9')]!==_0x1f26b2[_0x844e('0x14a')]){this[_0x844e('0xa3')](_0x1f26b2,_0x1f26b2[_0x844e('0xf9')],_0x1f26b2[_0x844e('0xf0')]);}};Preview[_0x844e('0xe')]['syncHangupRequest']=function(_0x4f2299){if(this['actions'][_0x4f2299[_0x844e('0xb2')]]&&_0x4f2299[_0x844e('0xb2')]!==_0x4f2299['uniqueid']&&!this[_0x844e('0x6e')][_0x4f2299[_0x844e('0xb2')]][_0x844e('0x73')]){if(_0x4f2299['cause']==='1'){this[_0x844e('0xa3')](_0x4f2299,_0x4f2299[_0x844e('0xb2')],_0x4f2299[_0x844e('0x144')]);}}};Preview[_0x844e('0xe')][_0x844e('0x14b')]=function(_0x505914,_0x32686c,_0x9a66c8){if(this['actions'][_0x505914]){if(_[_0x844e('0x6d')](this[_0x844e('0x6e')][_0x505914]['variables'])){this[_0x844e('0x6e')][_0x505914][_0x844e('0x14c')]={};}this['actions'][_0x505914][_0x844e('0x14c')][_0x32686c]=_0x9a66c8;}};Preview[_0x844e('0xe')][_0x844e('0x14d')]=function(_0x27ec2c){try{if(!_[_0x844e('0x6d')](_0x27ec2c)){if(ut[_0x844e('0x14e')](_[_0x844e('0x14f')](_0x27ec2c[_0x844e('0x150')])[0x0])){this[_0x844e('0x14b')](_0x27ec2c[_0x844e('0xf8')],_[_0x844e('0x14f')](_0x27ec2c[_0x844e('0x150')])[0x0],_0x27ec2c[_0x844e('0x151')]);}}}catch(_0x159026){logger['error'](_0x844e('0x152'),util[_0x844e('0x153')](_0x159026,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x844e('0x20')]=function(_0x147937){if(_0x147937){if(this[_0x844e('0x6e')][_0x147937[_0x844e('0x154')]]){this[_0x844e('0x6e')][_0x147937[_0x844e('0x154')]]['transfer']=!![];}}};Preview[_0x844e('0xe')]['syncBlindTransfer']=function(_0x7a4e66){if(_0x7a4e66){if(this[_0x844e('0x6e')][_0x7a4e66[_0x844e('0x155')]]){this[_0x844e('0x6e')][_0x7a4e66[_0x844e('0x155')]][_0x844e('0x147')]=!![];}}};module[_0x844e('0x156')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c659cad..08a4f51 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 _0x51ec=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','[createHistory]\x20','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x51ec,0x114));var _0xc51e=function(_0x5632fb,_0x1ba956){_0x5632fb=_0x5632fb-0x0;var _0x580ed9=_0x51ec[_0x5632fb];return _0x580ed9;};'use strict';var util=require(_0xc51e('0x0'));var BPromise=require(_0xc51e('0x1'));var logger=require(_0xc51e('0x2'))('preview');var _=require(_0xc51e('0x3'));var cmHopper=require(_0xc51e('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc51e('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xc51e('0x6'));var voiceQueueReport=require(_0xc51e('0x7'));function loggerCatch(_0x307088){return function(_0x104941){logger['error'](_0x307088,util[_0xc51e('0x8')](_0x104941,{'showHidden':![],'depth':null}));};}function create(_0x1e6bb4){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopperHistory['createHistory'](_0x1e6bb4))['catch'](loggerCatch(_0xc51e('0xb')));}function createAgent(_0x516b30){return BPromise['resolve']()[_0xc51e('0xa')](agentReportPreview[_0xc51e('0xc')](_0x516b30))[_0xc51e('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3f7750){return BPromise['resolve']()[_0xc51e('0xa')](cmHopper[_0xc51e('0xe')](_0x3f7750,!![]))[_0xc51e('0xd')](loggerCatch(_0xc51e('0xf')));}exports[_0xc51e('0x10')]=function(_0xd2878a){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopperBlack[_0xc51e('0x10')](_0xd2878a))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x11712f){return BPromise['resolve']()[_0xc51e('0xa')](cmHopper[_0xc51e('0x11')](_0x11712f))[_0xc51e('0xd')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x39fb7f,_0x3179c4){create(_0x39fb7f)[_0xc51e('0xd')](loggerCatch(_0x3179c4));moveContact(_0x39fb7f)[_0xc51e('0xd')](loggerCatch(_0x3179c4));};exports[_0xc51e('0x12')]=function(_0x47792d,_0x3044aa){createAgent(_0x47792d)[_0xc51e('0xd')](loggerCatch(_0x3044aa));};exports[_0xc51e('0x13')]=function(_0x39ecc7,_0x3db1e1){create(_0x39ecc7)[_0xc51e('0xd')](loggerCatch(_0x3db1e1));};exports['createCustomerFinal']=function(_0x52edd0,_0x22cad0){moveContact(_0x52edd0)[_0xc51e('0xd')](loggerCatch(_0x22cad0));};exports[_0xc51e('0x14')]=function(_0x3e17bb,_0x140073,_0x1752c6){if(_0x140073){_0x3e17bb[_0xc51e('0x15')]=null;}if(_0x1752c6){_0x3e17bb[_0xc51e('0x16')]=![];}return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopper[_0xc51e('0x14')](_0x3e17bb))[_0xc51e('0xd')](loggerCatch(_0xc51e('0x17')));};exports['countReScheduled']=function(_0x4d281f){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopper[_0xc51e('0x18')](_0x4d281f))[_0xc51e('0xd')](loggerCatch(_0xc51e('0x19')));};exports['unlockContact']=function(_0x340734){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopper['unlockContact']({'UserId':null},_0x340734,0x1))[_0xc51e('0xd')](loggerCatch(_0xc51e('0x1a')));};exports[_0xc51e('0x1b')]=function(_0x11fcfc){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopper[_0xc51e('0x1c')]({'active':![]},_0x11fcfc,0x1))['catch'](loggerCatch(_0xc51e('0x1d')));};exports[_0xc51e('0x1e')]=function(_0x4a0c8f){var _0x4f891f={};_0x4f891f[_0xc51e('0x1f')]=_0x4a0c8f[_0xc51e('0x1f')];_0x4f891f[_0xc51e('0x20')]=_0x4a0c8f['uniqueid'];_0x4f891f[_0xc51e('0x21')]=_0x4a0c8f[_0xc51e('0x21')];_0x4f891f[_0xc51e('0x22')]=_0x4a0c8f[_0xc51e('0x22')];_0x4f891f[_0xc51e('0x23')]=_0x4a0c8f[_0xc51e('0x23')];_0x4f891f[_0xc51e('0x24')]=_0x4a0c8f['answertime'];_0x4f891f['queuecallerleaveAt']=_0x4a0c8f[_0xc51e('0x25')];_0x4f891f[_0xc51e('0x26')]=0x1;_0x4f891f[_0xc51e('0x27')]=_0x4a0c8f[_0xc51e('0x28')];_0x4f891f[_0xc51e('0x29')]=_0x4a0c8f[_0xc51e('0x2a')];_0x4f891f[_0xc51e('0x2b')]='from-sip';_0x4f891f[_0xc51e('0x2c')]=_0xc51e('0x2d');_0x4f891f[_0xc51e('0x2e')]=0x0;_0x4f891f[_0xc51e('0x2f')]=0x1;_0x4f891f[_0xc51e('0x30')]=_0x4a0c8f[_0xc51e('0x2a')];_0x4f891f[_0xc51e('0x31')]=_0xc51e('0x32');return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](voiceQueueReport[_0xc51e('0x33')](_0x4f891f))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xc51e('0x34')]=function(_0x4c1a6d,_0x434964){return BPromise['resolve']()[_0xc51e('0xa')](cmHopper[_0xc51e('0x34')](_0x4c1a6d,_0x434964))[_0xc51e('0xd')](loggerCatch(_0xc51e('0x35')));};exports['rescheduleContactInQueue']=function(_0x34097c){return BPromise[_0xc51e('0x9')]()[_0xc51e('0xa')](cmHopper[_0xc51e('0x14')](_0x34097c,!![],!![]))['catch'](loggerCatch(_0xc51e('0x36')));}; \ No newline at end of file +var _0xd858=['[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview'];(function(_0x1b0dd2,_0x4bed26){var _0x84b7db=function(_0x10798d){while(--_0x10798d){_0x1b0dd2['push'](_0x1b0dd2['shift']());}};_0x84b7db(++_0x4bed26);}(_0xd858,0xb8));var _0x8d85=function(_0x2426d1,_0x736ed4){_0x2426d1=_0x2426d1-0x0;var _0x57fe74=_0xd858[_0x2426d1];return _0x57fe74;};'use strict';var util=require(_0x8d85('0x0'));var BPromise=require(_0x8d85('0x1'));var logger=require(_0x8d85('0x2'))(_0x8d85('0x3'));var _=require(_0x8d85('0x4'));var cmHopper=require(_0x8d85('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x8d85('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x8d85('0x7'));var voiceQueueReport=require(_0x8d85('0x8'));function loggerCatch(_0x5600d3){return function(_0x4f9170){logger['error'](_0x5600d3,util[_0x8d85('0x9')](_0x4f9170,{'showHidden':![],'depth':null}));};}function create(_0x41b71b){return BPromise[_0x8d85('0xa')]()['then'](cmHopperHistory[_0x8d85('0xb')](_0x41b71b))[_0x8d85('0xc')](loggerCatch(_0x8d85('0xd')));}function createAgent(_0x46d20b){return BPromise['resolve']()[_0x8d85('0xe')](agentReportPreview[_0x8d85('0xb')](_0x46d20b))[_0x8d85('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x29b4e8){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0xf')](_0x29b4e8,!![]))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x10')));}exports[_0x8d85('0x11')]=function(_0x108508){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopperBlack[_0x8d85('0x11')](_0x108508))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x12')));};exports['getContactPreview']=function(_0xd5b579){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0x13')](_0xd5b579))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x14')));};exports[_0x8d85('0xb')]=function(_0x5f4965,_0x7cb60e){create(_0x5f4965)[_0x8d85('0xc')](loggerCatch(_0x7cb60e));moveContact(_0x5f4965)['catch'](loggerCatch(_0x7cb60e));};exports[_0x8d85('0x15')]=function(_0x11a1d2,_0x3d1f44){createAgent(_0x11a1d2)['catch'](loggerCatch(_0x3d1f44));};exports[_0x8d85('0x16')]=function(_0x2c3c37,_0x579ad7){create(_0x2c3c37)[_0x8d85('0xc')](loggerCatch(_0x579ad7));};exports[_0x8d85('0x17')]=function(_0x3296ed,_0x158599){moveContact(_0x3296ed)[_0x8d85('0xc')](loggerCatch(_0x158599));};exports[_0x8d85('0x18')]=function(_0x180d35,_0x270975,_0x5160cf){if(_0x270975){_0x180d35['UserId']=null;}if(_0x5160cf){_0x180d35[_0x8d85('0x19')]=![];}return BPromise[_0x8d85('0xa')]()['then'](cmHopper[_0x8d85('0x18')](_0x180d35))[_0x8d85('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0xc0ec6c){return BPromise['resolve']()[_0x8d85('0xe')](cmHopper[_0x8d85('0x1a')](_0xc0ec6c))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x1b')));};exports[_0x8d85('0x1c')]=function(_0x1ec787){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0x1c')]({'UserId':null},_0x1ec787,0x1))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x1d')));};exports[_0x8d85('0x1e')]=function(_0x23d6ec){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0x1c')]({'active':![]},_0x23d6ec,0x1))[_0x8d85('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x8d85('0x1f')]=function(_0xb4482c){var _0x46e5e8={};_0x46e5e8[_0x8d85('0x20')]=_0xb4482c[_0x8d85('0x20')];_0x46e5e8['uniqueid']=_0xb4482c['uniqueid'];_0x46e5e8[_0x8d85('0x21')]=_0xb4482c[_0x8d85('0x21')];_0x46e5e8[_0x8d85('0x22')]=_0xb4482c[_0x8d85('0x22')];_0x46e5e8[_0x8d85('0x23')]=_0xb4482c[_0x8d85('0x23')];_0x46e5e8['queuecallerjoinAt']=_0xb4482c[_0x8d85('0x24')];_0x46e5e8[_0x8d85('0x25')]=_0xb4482c[_0x8d85('0x24')];_0x46e5e8['queuecallercomplete']=0x1;_0x46e5e8['queuecallercompleteAt']=_0xb4482c['endtime'];_0x46e5e8['connectedlinename']=_0xb4482c[_0x8d85('0x26')];_0x46e5e8[_0x8d85('0x27')]=_0x8d85('0x28');_0x46e5e8[_0x8d85('0x29')]='xcally-motion-preview';_0x46e5e8['holdtime']=0x0;_0x46e5e8[_0x8d85('0x2a')]=0x1;_0x46e5e8[_0x8d85('0x2b')]=_0xb4482c['membername'];_0x46e5e8[_0x8d85('0x2c')]=_0x8d85('0x2d');return BPromise[_0x8d85('0xa')]()['then'](voiceQueueReport['create'](_0x46e5e8))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x2e')));};exports['getContactRecallMe']=function(_0x8ebae8,_0x19fdd8){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0x2f')](_0x8ebae8,_0x19fdd8))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x30')));};exports[_0x8d85('0x31')]=function(_0x2ba9c4){return BPromise[_0x8d85('0xa')]()[_0x8d85('0xe')](cmHopper[_0x8d85('0x18')](_0x2ba9c4,!![],!![]))[_0x8d85('0xc')](loggerCatch(_0x8d85('0x32')));}; \ 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 0a2534c..3513d84 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 _0x9a9a=['xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','isNil','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','UserId','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','add','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue'];(function(_0x4dda69,_0x2a0fe4){var _0x9014a9=function(_0x3d2b40){while(--_0x3d2b40){_0x4dda69['push'](_0x4dda69['shift']());}};_0x9014a9(++_0x2a0fe4);}(_0x9a9a,0x9d));var _0xa9a9=function(_0x320a35,_0x8205bf){_0x320a35=_0x320a35-0x0;var _0x65836=_0x9a9a[_0x320a35];return _0x65836;};'use strict';var util=require(_0xa9a9('0x0'));var _=require(_0xa9a9('0x1'));var moment=require(_0xa9a9('0x2'));var logger=require(_0xa9a9('0x3'))('preview');var ipAgi=process[_0xa9a9('0x4')][_0xa9a9('0x5')]||'127.0.0.1';function getSeconds(_0x2310ac,_0x2d3830){var _0xdfe386=moment(_0x2310ac)[_0xa9a9('0x6')](0x0);var _0x3842ca=moment(_0x2d3830)[_0xa9a9('0x6')](0x0);return _0xdfe386[_0xa9a9('0x7')](_0x3842ca,_0xa9a9('0x8'));}exports[_0xa9a9('0x9')]=function(_0x591658){return function(_0x17ff79){logger[_0xa9a9('0xa')](_0x591658,util[_0xa9a9('0xb')](_0x17ff79,{'showHidden':![],'depth':null}));};};exports[_0xa9a9('0xc')]=function(_0x1e3ac8,_0x50a1d9){logger[_0xa9a9('0xd')](_0x1e3ac8,util['inspect'](_0x50a1d9,{'showHidden':![],'depth':null}));};exports[_0xa9a9('0xe')]=function(_0xafb0ac,_0x36362c){logger[_0xa9a9('0xa')](_0xafb0ac,util['inspect'](_0x36362c,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2a388c){return function(_0x205d32){logger[_0xa9a9('0xd')](_0x2a388c,util[_0xa9a9('0xb')](_0x205d32,{'showHidden':![],'depth':null}));};};exports[_0xa9a9('0xf')]=function(_0x3dbc59,_0x1647a4,_0x3f5113){return{'message':_0x3dbc59,'unlock':_0x1647a4,'active':_0x3f5113};};exports['getCallerId']=function(_0x385cf1,_0x12dcef,_0x75a530){if(!_['isUndefined'](_0x75a530)&&'string'===typeof _0x75a530&&!_['isEmpty'](_0x75a530)){if(!_[_0xa9a9('0x10')](_0x12dcef)&&_0xa9a9('0x11')===typeof _0x12dcef&&!_[_0xa9a9('0x12')](_0x12dcef)){return util[_0xa9a9('0x13')](_0xa9a9('0x14'),_0x12dcef,_0x75a530);}return util[_0xa9a9('0x13')]('\x22%s\x22\x20<%s>',_0x75a530,_0x75a530);}if(!_[_0xa9a9('0x10')](_0x385cf1)&&_0xa9a9('0x11')===typeof _0x385cf1&&!_['isEmpty'](_0x385cf1)){return _0x385cf1;}return _0xa9a9('0x15');};exports[_0xa9a9('0x16')]=function(_0x56fb36){if(_['isNil'](_0x56fb36)){return![];}return _0x56fb36;};exports[_0xa9a9('0x17')]=function(_0x10386f,_0x52336a,_0x255167,_0x5e27d5,_0x7d8aca,_0x18f9eb){var _0x184974={'XMD-QUEUE':_0x52336a[_0xa9a9('0x18')]?_0x52336a[_0xa9a9('0x18')][_0xa9a9('0x19')]:'','XMD-CALLERID':_0x5e27d5,'XMD-CALLERID-PREVIEW':_0x18f9eb?util[_0xa9a9('0x13')](_0xa9a9('0x14'),_0x18f9eb[_0xa9a9('0x1a')],_0x18f9eb[_0xa9a9('0x1b')]):_0x5e27d5,'XMD-DIALID':_0x7d8aca,'XMD-CONTACTID':_0x52336a['ContactId'],'XMD-CDRTYPE':_0xa9a9('0x1c'),'CALLERID(all)':_0x5e27d5,'XMD-VOICEQUEUEID':_0x52336a[_0xa9a9('0x1d')],'XMD-DIALCHANNEL':_0x255167,'XMD-DIALTIMEOUT':_0x10386f[_0xa9a9('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xa9a9('0x1f'),_0x10386f[_0xa9a9('0x20')]?'g':'',_['isEmpty'](_0x10386f[_0xa9a9('0x21')])?'':_0xa9a9('0x22')),'XMD-DIALURL':_0x10386f[_0xa9a9('0x23')]||'','XMD-AGI':_0x10386f['dialQueueProject']?util[_0xa9a9('0x13')](_0xa9a9('0x24'),ipAgi,_0x10386f['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x10386f[_0xa9a9('0x20')]?util[_0xa9a9('0x13')](_0xa9a9('0x24'),ipAgi,_0x10386f[_0xa9a9('0x20')]):_0xa9a9('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x18f9eb?_0x18f9eb[_0xa9a9('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x18f9eb?_0x18f9eb['originatecalleridname']:'','XMD-DESTINATION':_0xa9a9('0x27'),'SIPADDHEADER':_0xa9a9('0x28')};if(!_[_0xa9a9('0x12')](_0x10386f[_0xa9a9('0x21')])){_0x184974[util[_0xa9a9('0x13')]('%s',_0xa9a9('0x29'))]=_0x10386f[_0xa9a9('0x21')];_0x184974[util[_0xa9a9('0x13')]('%s',_0xa9a9('0x2a'))]=_0x7d8aca;}if(_0x52336a&&_0x52336a[_0xa9a9('0x2b')]){for(var _0x4206fd in _0x52336a[_0xa9a9('0x2b')]){if(_0x52336a[_0xa9a9('0x2b')][_0xa9a9('0x2c')](_0x4206fd)){if(!_['isNil'](_0x52336a[_0xa9a9('0x2b')][_0x4206fd])&&_0x4206fd!=='id'&&_0x4206fd!=='tags'&&_0x4206fd!==_0xa9a9('0x2d')&&_0x4206fd!==_0xa9a9('0x2e')){_0x184974[util[_0xa9a9('0x13')](_0xa9a9('0x2f'),_0xa9a9('0x30'),_[_0xa9a9('0x31')](_0x4206fd))]=_0x52336a[_0xa9a9('0x2b')][_0x4206fd];}}}}return _0x184974;};exports['toLowerVariables']=function(_0x17d9ac){var _0x1e6764={};for(var _0x1a6aa9 in _0x17d9ac){if(_0x17d9ac[_0xa9a9('0x2c')](_0x1a6aa9)){_0x1e6764[util[_0xa9a9('0x13')]('%s',_[_0xa9a9('0x32')](_0x1a6aa9))]=_0x17d9ac[_0x1a6aa9];}}return{'variables':_0x1e6764};};exports[_0xa9a9('0x33')]=function(_0x3cb059,_0x3c860b){if(!_[_0xa9a9('0x34')](_0x3cb059)){if(_0x3cb059[_0xa9a9('0x2c')]('originated')){if(_0x3cb059['originated']>0x0){_0x3cb059['originated']-=0x1;}else{logger[_0xa9a9('0xa')](_0xa9a9('0x35'),_0x3c860b);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3c860b);}};exports[_0xa9a9('0x36')]=function(_0x140a51){var _0x3d7503=moment()[_0xa9a9('0x13')](_0xa9a9('0x37'));_0x140a51[_0xa9a9('0x38')]=0xd;_0x140a51[_0xa9a9('0x39')]=_0xa9a9('0x3a');_0x140a51[_0xa9a9('0x3b')]=_0x3d7503;_0x140a51[_0xa9a9('0x3c')]=_0x3d7503;_0x140a51[_0xa9a9('0x3d')]=_0x3d7503;};exports[_0xa9a9('0x3e')]=function(_0x1ac4ef,_0x35b76a,_0x365ca7){var _0x52a5b1=moment()[_0xa9a9('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ac4ef['state']=_0x35b76a;_0x1ac4ef[_0xa9a9('0x39')]=_0x365ca7;_0x1ac4ef[_0xa9a9('0x3c')]=_0x52a5b1;_0x1ac4ef[_0xa9a9('0x3f')]=getSeconds(_0x1ac4ef[_0xa9a9('0x3c')],_0x1ac4ef[_0xa9a9('0x3b')]);};exports[_0xa9a9('0x40')]=function(_0x46fc28,_0x45298b,_0x3e19b9){_0x46fc28['membername']=_0x45298b;_0x46fc28[_0xa9a9('0x41')]=_0x3e19b9;};exports['logCustomer']=function(_0x3af222,_0x3eead2,_0x354739){var _0x1caab8=moment()[_0xa9a9('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x3af222[_0xa9a9('0x38')]=_0x3eead2;_0x3af222[_0xa9a9('0x39')]=_0x354739;_0x3af222['responsetime']=_0x3af222[_0xa9a9('0x3c')]?_0x3af222[_0xa9a9('0x3c')]:_0x1caab8;_0x3af222['endtime']=_0x3af222['endtime']?_0x3af222[_0xa9a9('0x3d')]:_0x1caab8;_0x3af222[_0xa9a9('0x3f')]=getSeconds(_0x3af222[_0xa9a9('0x3c')]||0x0,_0x3af222[_0xa9a9('0x3b')]||0x0);_0x3af222[_0xa9a9('0x42')]=_0x3af222[_0xa9a9('0x43')]?getSeconds(_0x3af222[_0xa9a9('0x3d')],_0x3af222[_0xa9a9('0x43')]):0x0;};exports['isFailure']=function(_0x42fc61){return _0x42fc61===_0xa9a9('0x44');};exports[_0xa9a9('0x45')]=function(_0x4b6adc,_0x46f0e7,_0x6ea08,_0x2583c3,_0x25570e){var _0x187fc6=_0x2583c3?_0xa9a9('0x46'):_0x4b6adc[_0xa9a9('0x1a')];_0x187fc6=_0x25570e?_0xa9a9('0x47'):_0x187fc6;return{'actionid':_0x4b6adc['uniqueid'],'action':'originate','channel':_0x4b6adc[_0xa9a9('0x48')],'callerid':util[_0xa9a9('0x13')](_0xa9a9('0x14'),_0x187fc6,_0x4b6adc[_0xa9a9('0x1b')]),'Exten':_0xa9a9('0x27'),'Context':_0xa9a9('0x49'),'Priority':'1','variable':_0x6ea08,'timeout':(_0x46f0e7[_0xa9a9('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4b6adc[_0xa9a9('0x4b')]};};exports[_0xa9a9('0x4c')]=function(_0x1f1010){return _0x1f1010[_0xa9a9('0x4d')]+_0x1f1010[_0xa9a9('0x4e')]+_0x1f1010[_0xa9a9('0x4f')]+_0x1f1010[_0xa9a9('0x50')]+_0x1f1010[_0xa9a9('0x51')];};exports[_0xa9a9('0x52')]=function(_0x41f945){var _0x3c2ac1=_[_0xa9a9('0x53')](_0x41f945);_0x3c2ac1['state']=0xf;_0x3c2ac1[_0xa9a9('0x39')]=_0xa9a9('0x54');return _0x3c2ac1;};exports['scheduledAt']=function(_0x3c033d,_0x2aba7c,_0x1613bb){var _0x35b80a={};_0x35b80a[_0x2aba7c]=_0x3c033d[_0x2aba7c];_0x35b80a[_0xa9a9('0x55')]=![];_0x35b80a['scheduledat']=moment()[_0xa9a9('0x56')](_0x1613bb,'minutes')[_0xa9a9('0x13')](_0xa9a9('0x37'));_0x35b80a[_0xa9a9('0x57')]=_0x3c033d[_0xa9a9('0x57')];_0x35b80a[_0xa9a9('0x58')]=_0x3c033d[_0xa9a9('0x58')];_0x35b80a[_0xa9a9('0x1d')]=_0x3c033d[_0xa9a9('0x1d')]||undefined;return _0x35b80a;};exports['decrementTalkink']=function(_0x17dfdb,_0x16e06a){if(!_[_0xa9a9('0x34')](_0x17dfdb)){if(_0x17dfdb[_0xa9a9('0x59')]>0x0){_0x17dfdb[_0xa9a9('0x59')]-=0x1;}else{logger['error'](_0x16e06a,_0xa9a9('0x5a'));}}else{logger[_0xa9a9('0xa')](_0x16e06a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xa9a9('0x5b')]=function(_0xc7f489){if(_0xc7f489<=0x0){return!![];}return![];};exports[_0xa9a9('0x5c')]=function(_0x14612b,_0x34416d,_0xed184c){_0x14612b[_0xa9a9('0x5d')]=_0x34416d;_0x14612b[_0xa9a9('0x19')]=_0x14612b[_0xa9a9('0x5e')];_0x14612b[_0xa9a9('0x5f')]=_0x14612b[_0xa9a9('0x48')];_0x14612b['motionChannel']=_0xa9a9('0x60');if(_0xed184c){_0x14612b[_0xa9a9('0x61')]=_0xed184c[_0xa9a9('0x61')];}return _0x14612b;};exports[_0xa9a9('0x62')]=function(_0x387df2){var _0x56d537={};_0x56d537['queue']=_0x387df2[_0xa9a9('0x5e')];_0x56d537[_0xa9a9('0x5f')]=_0x387df2['channelAgent'];_0x56d537[_0xa9a9('0x4b')]=_0x387df2[_0xa9a9('0x4b')];return _0x56d537;};exports[_0xa9a9('0x63')]=function(_0x36b0fe){var _0x24cb4a=[];for(var _0xd28451 in _0x36b0fe){if(_0x36b0fe['hasOwnProperty'](_0xd28451)){if(!_['isNil'](_0x36b0fe[_0xd28451])&&_0x36b0fe[_0xd28451][_0xa9a9('0x38')]==='not_inuse'&&_0x36b0fe[_0xd28451][_0xa9a9('0x64')]===_0xa9a9('0x65')){_0x24cb4a[_0xa9a9('0x66')](_0x36b0fe[_0xd28451]['id']);}}}return _0x24cb4a;};exports['getDiff']=function(_0x5839d4){var _0x3f0be5=moment()['milliseconds'](0x0);var _0x5ebea7=moment(_0x5839d4)['milliseconds'](0x0);return _0x3f0be5[_0xa9a9('0x7')](_0x5ebea7,'seconds');};exports[_0xa9a9('0x67')]=function(_0x41b57e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x41b57e[_0xa9a9('0x57')],'ListId':_0x41b57e[_0xa9a9('0x58')],'VoiceQueueId':_0x41b57e[_0xa9a9('0x1d')]||undefined,'CampaignId':_0x41b57e[_0xa9a9('0x68')]||undefined};};exports[_0xa9a9('0x69')]=function(_0x7e5940){if(_0x7e5940===_0xa9a9('0x4b')||_0x7e5940===_0xa9a9('0x6a')||_0x7e5940===_0xa9a9('0x5e')||_0x7e5940==='type'||_0x7e5940===_0xa9a9('0x6b')||_0x7e5940===_0xa9a9('0x6c')||_0x7e5940==='membername'||_0x7e5940===_0xa9a9('0x48')||_0x7e5940===_0xa9a9('0x1a')||_0x7e5940===_0xa9a9('0x55')||_0x7e5940===_0xa9a9('0x1b')||_0x7e5940==='scheduledat'||_0x7e5940==='countbusyretry'||_0x7e5940===_0xa9a9('0x4e')||_0x7e5940==='countnoanswerretry'||_0x7e5940===_0xa9a9('0x6d')||_0x7e5940===_0xa9a9('0x6e')||_0x7e5940===_0xa9a9('0x6f')||_0x7e5940===_0xa9a9('0x70')||_0x7e5940===_0xa9a9('0x71')||_0x7e5940===_0xa9a9('0x57')||_0x7e5940==='ListId'||_0x7e5940===_0xa9a9('0x41')||_0x7e5940===_0xa9a9('0x1d')||_0x7e5940===_0xa9a9('0x72')||_0x7e5940===_0xa9a9('0x73')||_0x7e5940===_0xa9a9('0x74')||_0x7e5940==='xmd-phone'||_0x7e5940==='xmd-listid'||_0x7e5940==='xmd-dialurl'||_0x7e5940==='xmd-dialtimeout'||_0x7e5940==='xmd-dialoptions'||_0x7e5940===_0xa9a9('0x75')||_0x7e5940===_0xa9a9('0x76')||_0x7e5940===_0xa9a9('0x77')||_0x7e5940==='xmd-cdrtype'||_0x7e5940===_0xa9a9('0x78')||_0x7e5940===_0xa9a9('0x79')||_0x7e5940===_0xa9a9('0x7a')||_0x7e5940===_0xa9a9('0x7b')||_0x7e5940===_0xa9a9('0x7c')||_0x7e5940===_0xa9a9('0x7d')||_0x7e5940==='rtpaudioqosjitterbridged'||_0x7e5940==='rtpaudioqosloss'||_0x7e5940===_0xa9a9('0x7e')||_0x7e5940===_0xa9a9('0x7f')||_0x7e5940===_0xa9a9('0x80')||_0x7e5940===_0xa9a9('0x7b')||_0x7e5940===_0xa9a9('0x7c')||_0x7e5940==='rtpaudioqosjitter'||_0x7e5940==='rtpaudioqosjitterbridged'||_0x7e5940==='rtpaudioqosloss'||_0x7e5940===_0xa9a9('0x7e')||_0x7e5940===_0xa9a9('0x7f')||_0x7e5940===_0xa9a9('0x80')||_0x7e5940===_0xa9a9('0x81')||_0x7e5940==='bridgepvtcallid'||_0x7e5940===_0xa9a9('0x38')||_0x7e5940===_0xa9a9('0x39')){return![];}return!![];};exports[_0xa9a9('0x82')]=function(_0x241344,_0x5de515){var _0x46a302,_0x51d720,_0x313bd0;if(_0x5de515<=0x0){_0x5de515=0x1;}_0x46a302=new RegExp(_0xa9a9('0x83')+_0x5de515+'}$');_0x51d720=Math['pow'](0xa,_0x5de515-0x1);_0x313bd0=Math[_0xa9a9('0x84')](0xa,_0x5de515)-0x1;return util['format']('%s',_[_0xa9a9('0x85')](_0x241344,_0x46a302,_['random'](_0x51d720,_0x313bd0)));};exports[_0xa9a9('0x86')]=function(_0xe0d333){var _0x3fd2a0=_0xe0d333[_0xa9a9('0x87')](/"(.*?)"/);return _0x3fd2a0?_0x3fd2a0[0x1]:_0xe0d333;};exports[_0xa9a9('0x88')]=function(_0x56e3b4){var _0x1edea8=_0x56e3b4[_0xa9a9('0x87')](/<(.*?)>/);return _0x1edea8?_0x1edea8[0x1]:_0x56e3b4;}; \ No newline at end of file +var _0xe674=['xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','127.0.0.1','milliseconds','diff','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','UserId','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','queue','agentReadyId','not_inuse','reachable','getDiff','seconds','CampaignId','idContact','campaigntype','dialAnswer','membername','countcongestionretry','countglobal','callback','callbackuniqueid','recallme','sipcallid'];(function(_0x2b4efd,_0x2432f3){var _0x102804=function(_0x2aa44d){while(--_0x2aa44d){_0x2b4efd['push'](_0x2b4efd['shift']());}};_0x102804(++_0x2432f3);}(_0xe674,0x12e));var _0x4e67=function(_0x2f7fe1,_0x26a883){_0x2f7fe1=_0x2f7fe1-0x0;var _0x54e5d6=_0xe674[_0x2f7fe1];return _0x54e5d6;};'use strict';var util=require(_0x4e67('0x0'));var _=require(_0x4e67('0x1'));var moment=require(_0x4e67('0x2'));var logger=require(_0x4e67('0x3'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0x4e67('0x4');function getSeconds(_0x30462f,_0x5be581){var _0x3bc2d3=moment(_0x30462f)[_0x4e67('0x5')](0x0);var _0x1abed8=moment(_0x5be581)['milliseconds'](0x0);return _0x3bc2d3[_0x4e67('0x6')](_0x1abed8,'seconds');}exports['loggerCatch']=function(_0x4203fd){return function(_0xbd7b06){logger[_0x4e67('0x7')](_0x4203fd,util[_0x4e67('0x8')](_0xbd7b06,{'showHidden':![],'depth':null}));};};exports[_0x4e67('0x9')]=function(_0x53b8ee,_0x1510be){logger[_0x4e67('0xa')](_0x53b8ee,util[_0x4e67('0x8')](_0x1510be,{'showHidden':![],'depth':null}));};exports[_0x4e67('0xb')]=function(_0x66956b,_0x4b8920){logger[_0x4e67('0x7')](_0x66956b,util[_0x4e67('0x8')](_0x4b8920,{'showHidden':![],'depth':null}));};exports[_0x4e67('0xc')]=function(_0x4efaa7){return function(_0x18ae19){logger[_0x4e67('0xa')](_0x4efaa7,util['inspect'](_0x18ae19,{'showHidden':![],'depth':null}));};};exports[_0x4e67('0xd')]=function(_0x3591bd,_0xfa52ed,_0x30c85a){return{'message':_0x3591bd,'unlock':_0xfa52ed,'active':_0x30c85a};};exports['getCallerId']=function(_0xc9400a,_0x31a9a7,_0x21a71d){if(!_[_0x4e67('0xe')](_0x21a71d)&&_0x4e67('0xf')===typeof _0x21a71d&&!_[_0x4e67('0x10')](_0x21a71d)){if(!_[_0x4e67('0xe')](_0x31a9a7)&&'string'===typeof _0x31a9a7&&!_['isEmpty'](_0x31a9a7)){return util[_0x4e67('0x11')]('\x22%s\x22\x20<%s>',_0x31a9a7,_0x21a71d);}return util['format'](_0x4e67('0x12'),_0x21a71d,_0x21a71d);}if(!_[_0x4e67('0xe')](_0xc9400a)&&'string'===typeof _0xc9400a&&!_[_0x4e67('0x10')](_0xc9400a)){return _0xc9400a;}return _0x4e67('0x13');};exports['isActive']=function(_0x377c35){if(_[_0x4e67('0x14')](_0x377c35)){return![];}return _0x377c35;};exports[_0x4e67('0x15')]=function(_0xda2569,_0x316042,_0x4cf698,_0x2e30f1,_0x515944,_0x418b4e){var _0x2e9d12={'XMD-QUEUE':_0x316042[_0x4e67('0x16')]?_0x316042[_0x4e67('0x16')][_0x4e67('0x17')]:'','XMD-CALLERID':_0x2e30f1,'XMD-CALLERID-PREVIEW':_0x418b4e?util[_0x4e67('0x11')](_0x4e67('0x12'),_0x418b4e[_0x4e67('0x18')],_0x418b4e['calleridnum']):_0x2e30f1,'XMD-DIALID':_0x515944,'XMD-CONTACTID':_0x316042['ContactId'],'XMD-CDRTYPE':_0x4e67('0x19'),'CALLERID(all)':_0x2e30f1,'XMD-VOICEQUEUEID':_0x316042[_0x4e67('0x1a')],'XMD-DIALCHANNEL':_0x4cf698,'XMD-DIALTIMEOUT':_0xda2569[_0x4e67('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x4e67('0x11')](_0x4e67('0x1c'),_0xda2569[_0x4e67('0x1d')]?'g':'',_[_0x4e67('0x10')](_0xda2569[_0x4e67('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0xda2569[_0x4e67('0x1f')]||'','XMD-AGI':_0xda2569[_0x4e67('0x20')]?util[_0x4e67('0x11')](_0x4e67('0x21'),ipAgi,_0xda2569['dialQueueProject']):_0x4e67('0x22'),'XMD-AGIAFTER':_0xda2569[_0x4e67('0x1d')]?util[_0x4e67('0x11')](_0x4e67('0x21'),ipAgi,_0xda2569[_0x4e67('0x1d')]):_0x4e67('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x418b4e?_0x418b4e['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x418b4e?_0x418b4e[_0x4e67('0x23')]:'','XMD-DESTINATION':_0x4e67('0x24'),'SIPADDHEADER':_0x4e67('0x25')};if(!_['isEmpty'](_0xda2569[_0x4e67('0x1e')])){_0x2e9d12[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xda2569[_0x4e67('0x1e')];_0x2e9d12[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x515944;}if(_0x316042&&_0x316042[_0x4e67('0x26')]){for(var _0xeadd61 in _0x316042[_0x4e67('0x26')]){if(_0x316042[_0x4e67('0x26')][_0x4e67('0x27')](_0xeadd61)){if(!_[_0x4e67('0x14')](_0x316042[_0x4e67('0x26')][_0xeadd61])&&_0xeadd61!=='id'&&_0xeadd61!==_0x4e67('0x28')&&_0xeadd61!==_0x4e67('0x29')&&_0xeadd61!==_0x4e67('0x2a')){_0x2e9d12[util[_0x4e67('0x11')](_0x4e67('0x2b'),_0x4e67('0x2c'),_[_0x4e67('0x2d')](_0xeadd61))]=_0x316042[_0x4e67('0x26')][_0xeadd61];}}}}return _0x2e9d12;};exports[_0x4e67('0x2e')]=function(_0x34ca75){var _0x25626e={};for(var _0x55ef70 in _0x34ca75){if(_0x34ca75['hasOwnProperty'](_0x55ef70)){_0x25626e[util['format']('%s',_['toLower'](_0x55ef70))]=_0x34ca75[_0x55ef70];}}return{'variables':_0x25626e};};exports[_0x4e67('0x2f')]=function(_0x104c63,_0x4d40c9){if(!_[_0x4e67('0x14')](_0x104c63)){if(_0x104c63[_0x4e67('0x27')](_0x4e67('0x30'))){if(_0x104c63[_0x4e67('0x30')]>0x0){_0x104c63[_0x4e67('0x30')]-=0x1;}else{logger['error'](_0x4e67('0x31'),_0x4d40c9);}}}else{logger['error'](_0x4e67('0x32'),_0x4d40c9);}};exports[_0x4e67('0x33')]=function(_0x174063){var _0x238146=moment()[_0x4e67('0x11')](_0x4e67('0x34'));_0x174063[_0x4e67('0x35')]=0xd;_0x174063[_0x4e67('0x36')]=_0x4e67('0x37');_0x174063[_0x4e67('0x38')]=_0x238146;_0x174063[_0x4e67('0x39')]=_0x238146;_0x174063['endtime']=_0x238146;};exports[_0x4e67('0x3a')]=function(_0x5c1a4b,_0x392c56,_0x5d3780){var _0x7a3bdd=moment()[_0x4e67('0x11')](_0x4e67('0x34'));_0x5c1a4b[_0x4e67('0x35')]=_0x392c56;_0x5c1a4b['statedesc']=_0x5d3780;_0x5c1a4b[_0x4e67('0x39')]=_0x7a3bdd;_0x5c1a4b['ringtime']=getSeconds(_0x5c1a4b[_0x4e67('0x39')],_0x5c1a4b[_0x4e67('0x38')]);};exports['logLookAgent']=function(_0x3aef54,_0x20912e,_0x509cde){_0x3aef54['membername']=_0x20912e;_0x3aef54[_0x4e67('0x3b')]=_0x509cde;};exports['logCustomer']=function(_0x12c13e,_0x5e1274,_0x3d7ee5){var _0xd3d28b=moment()[_0x4e67('0x11')](_0x4e67('0x34'));_0x12c13e[_0x4e67('0x35')]=_0x5e1274;_0x12c13e[_0x4e67('0x36')]=_0x3d7ee5;_0x12c13e[_0x4e67('0x39')]=_0x12c13e[_0x4e67('0x39')]?_0x12c13e[_0x4e67('0x39')]:_0xd3d28b;_0x12c13e[_0x4e67('0x3c')]=_0x12c13e['endtime']?_0x12c13e[_0x4e67('0x3c')]:_0xd3d28b;_0x12c13e['ringtime']=getSeconds(_0x12c13e[_0x4e67('0x39')]||0x0,_0x12c13e[_0x4e67('0x38')]||0x0);_0x12c13e[_0x4e67('0x3d')]=_0x12c13e[_0x4e67('0x3e')]?getSeconds(_0x12c13e[_0x4e67('0x3c')],_0x12c13e[_0x4e67('0x3e')]):0x0;};exports['isFailure']=function(_0x2cd06){return _0x2cd06===_0x4e67('0x3f');};exports[_0x4e67('0x40')]=function(_0x20d849,_0x3f73fe,_0x1f2750,_0x5a3dca,_0x5033b7){var _0x2413a7=_0x5a3dca?_0x4e67('0x41'):_0x20d849[_0x4e67('0x18')];_0x2413a7=_0x5033b7?_0x4e67('0x42'):_0x2413a7;return{'actionid':_0x20d849[_0x4e67('0x43')],'action':_0x4e67('0x44'),'channel':_0x20d849[_0x4e67('0x45')],'callerid':util[_0x4e67('0x11')](_0x4e67('0x12'),_0x2413a7,_0x20d849[_0x4e67('0x46')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x1f2750,'timeout':(_0x3f73fe[_0x4e67('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x20d849[_0x4e67('0x43')]};};exports[_0x4e67('0x48')]=function(_0x384eab){return _0x384eab[_0x4e67('0x49')]+_0x384eab['countcongestionretry']+_0x384eab[_0x4e67('0x4a')]+_0x384eab[_0x4e67('0x4b')]+_0x384eab['countnosuchnumberretry'];};exports[_0x4e67('0x4c')]=function(_0x5b31ce){var _0x18b716=_[_0x4e67('0x4d')](_0x5b31ce);_0x18b716[_0x4e67('0x35')]=0xf;_0x18b716[_0x4e67('0x36')]='Global';return _0x18b716;};exports[_0x4e67('0x4e')]=function(_0x221514,_0x4322f2,_0x2a1f4c){var _0x48f6bc={};_0x48f6bc[_0x4322f2]=_0x221514[_0x4322f2];_0x48f6bc['active']=![];_0x48f6bc[_0x4e67('0x4f')]=moment()[_0x4e67('0x50')](_0x2a1f4c,_0x4e67('0x51'))['format'](_0x4e67('0x34'));_0x48f6bc[_0x4e67('0x52')]=_0x221514[_0x4e67('0x52')];_0x48f6bc[_0x4e67('0x53')]=_0x221514[_0x4e67('0x53')];_0x48f6bc[_0x4e67('0x1a')]=_0x221514[_0x4e67('0x1a')]||undefined;return _0x48f6bc;};exports[_0x4e67('0x54')]=function(_0x493a0e,_0x5f57d2){if(!_['isNil'](_0x493a0e)){if(_0x493a0e[_0x4e67('0x55')]>0x0){_0x493a0e['pTalking']-=0x1;}else{logger['error'](_0x5f57d2,_0x4e67('0x56'));}}else{logger['error'](_0x5f57d2,_0x4e67('0x57'));}};exports[_0x4e67('0x58')]=function(_0x944a26){if(_0x944a26<=0x0){return!![];}return![];};exports[_0x4e67('0x59')]=function(_0x671912,_0x5ed73d,_0x3e62c9){_0x671912[_0x4e67('0x5a')]=_0x5ed73d;_0x671912[_0x4e67('0x17')]=_0x671912['queue'];_0x671912[_0x4e67('0x5b')]=_0x671912[_0x4e67('0x45')];_0x671912[_0x4e67('0x5c')]=_0x4e67('0x5d');if(_0x3e62c9){_0x671912[_0x4e67('0x5e')]=_0x3e62c9[_0x4e67('0x5e')];}return _0x671912;};exports['buildAcw']=function(_0xd2a0fb){var _0x465bca={};_0x465bca[_0x4e67('0x5f')]=_0xd2a0fb[_0x4e67('0x5f')];_0x465bca[_0x4e67('0x5b')]=_0xd2a0fb[_0x4e67('0x45')];_0x465bca[_0x4e67('0x43')]=_0xd2a0fb[_0x4e67('0x43')];return _0x465bca;};exports[_0x4e67('0x60')]=function(_0x539b7e){var _0x10fff7=[];for(var _0x34e4b6 in _0x539b7e){if(_0x539b7e[_0x4e67('0x27')](_0x34e4b6)){if(!_[_0x4e67('0x14')](_0x539b7e[_0x34e4b6])&&_0x539b7e[_0x34e4b6][_0x4e67('0x35')]===_0x4e67('0x61')&&_0x539b7e[_0x34e4b6]['status']===_0x4e67('0x62')){_0x10fff7['push'](_0x539b7e[_0x34e4b6]['id']);}}}return _0x10fff7;};exports[_0x4e67('0x63')]=function(_0x54ba2a){var _0x47bbe2=moment()['milliseconds'](0x0);var _0x2f5a8b=moment(_0x54ba2a)[_0x4e67('0x5')](0x0);return _0x47bbe2['diff'](_0x2f5a8b,_0x4e67('0x64'));};exports['createBody']=function(_0x49f951){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x49f951[_0x4e67('0x52')],'ListId':_0x49f951[_0x4e67('0x53')],'VoiceQueueId':_0x49f951[_0x4e67('0x1a')]||undefined,'CampaignId':_0x49f951[_0x4e67('0x65')]||undefined};};exports['filterKey']=function(_0x4a73f2){if(_0x4a73f2===_0x4e67('0x43')||_0x4a73f2===_0x4e67('0x66')||_0x4a73f2===_0x4e67('0x5f')||_0x4a73f2==='type'||_0x4a73f2===_0x4e67('0x67')||_0x4a73f2===_0x4e67('0x68')||_0x4a73f2===_0x4e67('0x69')||_0x4a73f2===_0x4e67('0x45')||_0x4a73f2===_0x4e67('0x18')||_0x4a73f2==='active'||_0x4a73f2===_0x4e67('0x46')||_0x4a73f2===_0x4e67('0x4f')||_0x4a73f2===_0x4e67('0x49')||_0x4a73f2===_0x4e67('0x6a')||_0x4a73f2===_0x4e67('0x4a')||_0x4a73f2===_0x4e67('0x6b')||_0x4a73f2===_0x4e67('0x6c')||_0x4a73f2===_0x4e67('0x6d')||_0x4a73f2==='callbackat'||_0x4a73f2===_0x4e67('0x6e')||_0x4a73f2==='ContactId'||_0x4a73f2===_0x4e67('0x53')||_0x4a73f2===_0x4e67('0x3b')||_0x4a73f2===_0x4e67('0x1a')||_0x4a73f2===_0x4e67('0x6f')||_0x4a73f2===_0x4e67('0x70')||_0x4a73f2==='xmd-queue'||_0x4a73f2===_0x4e67('0x71')||_0x4a73f2===_0x4e67('0x72')||_0x4a73f2===_0x4e67('0x73')||_0x4a73f2===_0x4e67('0x74')||_0x4a73f2===_0x4e67('0x75')||_0x4a73f2===_0x4e67('0x76')||_0x4a73f2===_0x4e67('0x77')||_0x4a73f2==='xmd-contactid'||_0x4a73f2==='xmd-cdrtype'||_0x4a73f2===_0x4e67('0x78')||_0x4a73f2==='xmd-agiafter'||_0x4a73f2===_0x4e67('0x79')||_0x4a73f2===_0x4e67('0x7a')||_0x4a73f2==='rtpaudioqosbridged'||_0x4a73f2==='rtpaudioqosjitter'||_0x4a73f2===_0x4e67('0x7b')||_0x4a73f2==='rtpaudioqosloss'||_0x4a73f2===_0x4e67('0x7c')||_0x4a73f2===_0x4e67('0x7d')||_0x4a73f2===_0x4e67('0x7e')||_0x4a73f2===_0x4e67('0x7a')||_0x4a73f2==='rtpaudioqosbridged'||_0x4a73f2===_0x4e67('0x7f')||_0x4a73f2===_0x4e67('0x7b')||_0x4a73f2===_0x4e67('0x80')||_0x4a73f2===_0x4e67('0x7c')||_0x4a73f2===_0x4e67('0x7d')||_0x4a73f2==='rtpaudioqosrttbridged'||_0x4a73f2===_0x4e67('0x81')||_0x4a73f2===_0x4e67('0x82')||_0x4a73f2==='state'||_0x4a73f2===_0x4e67('0x36')){return![];}return!![];};exports[_0x4e67('0x83')]=function(_0x271d21,_0x480933){var _0x136ffd,_0x26ae46,_0x1d3c15;if(_0x480933<=0x0){_0x480933=0x1;}_0x136ffd=new RegExp(_0x4e67('0x84')+_0x480933+'}$');_0x26ae46=Math[_0x4e67('0x85')](0xa,_0x480933-0x1);_0x1d3c15=Math[_0x4e67('0x85')](0xa,_0x480933)-0x1;return util[_0x4e67('0x11')]('%s',_['replace'](_0x271d21,_0x136ffd,_[_0x4e67('0x86')](_0x26ae46,_0x1d3c15)));};exports[_0x4e67('0x87')]=function(_0x5ef7bf){var _0xf343f6=_0x5ef7bf[_0x4e67('0x88')](/"(.*?)"/);return _0xf343f6?_0xf343f6[0x1]:_0x5ef7bf;};exports[_0x4e67('0x89')]=function(_0x1a969b){var _0x2e174f=_0x1a969b['match'](/<(.*?)>/);return _0x2e174f?_0x2e174f[0x1]:_0x1a969b;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 06fb8bb..16487cb 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 _0x1d73=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause'];(function(_0x5d0911,_0x2ce0dc){var _0x255c67=function(_0x3c9135){while(--_0x3c9135){_0x5d0911['push'](_0x5d0911['shift']());}};_0x255c67(++_0x2ce0dc);}(_0x1d73,0x127));var _0x31d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1d73[_0x321bb2];return _0x9c12ed;};'use strict';exports[_0x31d7('0x0')]={'queue':{'type':_0x31d7('0x1'),'required':!![]},'interface':{'type':_0x31d7('0x1'),'required':!![]},'membername':{'type':_0x31d7('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x31d7('0x2'),'required':![]}};exports[_0x31d7('0x3')]={'queue':{'type':_0x31d7('0x1'),'required':!![]},'interface':{'type':_0x31d7('0x1'),'required':!![]}};exports[_0x31d7('0x4')]={'interface':{'type':_0x31d7('0x1'),'required':!![]},'paused':{'type':_0x31d7('0x2')},'reason':{'type':_0x31d7('0x1'),'required':![]}};exports[_0x31d7('0x5')]={'module':{'type':_0x31d7('0x1'),'required':![]}};exports[_0x31d7('0x6')]={'uniqueid':{'type':_0x31d7('0x1'),'required':!![]}};exports[_0x31d7('0x7')]={'uniqueid':{'type':_0x31d7('0x1'),'required':!![]},'filename':{'type':_0x31d7('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x31d7('0x1')}};exports[_0x31d7('0x8')]={'uniqueid':{'type':_0x31d7('0x1'),'required':!![]}};exports[_0x31d7('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x31d7('0x1')}}; \ No newline at end of file +var _0xabf6=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabf6,0x9a));var _0x6abf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabf6[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':_0x6abf('0x0'),'required':!![]},'interface':{'type':_0x6abf('0x0'),'required':!![]},'membername':{'type':_0x6abf('0x0'),'required':!![]},'penalty':{'type':_0x6abf('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6abf('0x2')]={'queue':{'type':_0x6abf('0x0'),'required':!![]},'interface':{'type':_0x6abf('0x0'),'required':!![]}};exports[_0x6abf('0x3')]={'interface':{'type':_0x6abf('0x0'),'required':!![]},'paused':{'type':_0x6abf('0x4')},'reason':{'type':_0x6abf('0x0'),'required':![]}};exports[_0x6abf('0x5')]={'module':{'type':_0x6abf('0x0'),'required':![]}};exports[_0x6abf('0x6')]={'uniqueid':{'type':_0x6abf('0x0'),'required':!![]}};exports[_0x6abf('0x7')]={'uniqueid':{'type':_0x6abf('0x0'),'required':!![]},'filename':{'type':_0x6abf('0x0')},'format':{'type':_0x6abf('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x6abf('0x8')]={'uniqueid':{'type':_0x6abf('0x0'),'required':!![]}};exports[_0x6abf('0x9')]={'uniqueid':{'type':_0x6abf('0x0'),'required':!![]},'exten':{'type':_0x6abf('0x0'),'required':!![]},'context':{'type':_0x6abf('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 47cc291..c73e716 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 _0x5f01=['sumHoldTime','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','faxAccounts','bluebird','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumDuration','ivrAnswerCallsDay','isEmpty','total','answered','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','SIP/%s','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','sugarcrmAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queuecallerexit','queuecallerabandon','abandoned'];(function(_0x2e0d6c,_0x137319){var _0x3d0db7=function(_0x430b8a){while(--_0x430b8a){_0x2e0d6c['push'](_0x2e0d6c['shift']());}};_0x3d0db7(++_0x137319);}(_0x5f01,0x1cb));var _0x15f0=function(_0x37de91,_0x263fc2){_0x37de91=_0x37de91-0x0;var _0x5bb10d=_0x5f01[_0x37de91];return _0x5bb10d;};'use strict';var BPromise=require(_0x15f0('0x0'));var util=require(_0x15f0('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x15f0('0x2'));var Telephone=require(_0x15f0('0x3'));var Trunk=require(_0x15f0('0x4'));var VoiceQueue=require(_0x15f0('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x15f0('0x6'));var Campaign=require(_0x15f0('0x7'));var VoiceExtension=require(_0x15f0('0x8'));var ZendeskAccount=require(_0x15f0('0x9'));var SalesforceAccount=require(_0x15f0('0xa'));var FreshdeskAccount=require(_0x15f0('0xb'));var SugarcrmAccount=require(_0x15f0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x15f0('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x15f0('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x15f0('0xf'));var FaxAccount=require(_0x15f0('0x10'));var Realtime=function(){this[_0x15f0('0x11')]={};this[_0x15f0('0x12')]={};this['trunks']={};this['voiceQueues']={};this['triggers']={};this['campaigns']={};this[_0x15f0('0x13')]={};this[_0x15f0('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x15f0('0x15')]={};this[_0x15f0('0x16')]={};this[_0x15f0('0x17')]={};this[_0x15f0('0x18')]={};this[_0x15f0('0x19')]={};this[_0x15f0('0x1a')]={};this[_0x15f0('0x1b')]={};this['sugarcrmAccounts']={};this[_0x15f0('0x1c')]={};this[_0x15f0('0x1d')]={};this[_0x15f0('0x1e')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x15f0('0x1f')]={};this[_0x15f0('0x20')]={};this['faxAccounts']={};};function freeIsNotKey(_0x1835ef,_0x14c2a0,_0x1c934f){var _0x371636=_[_0x15f0('0x21')](_0x1835ef,function(_0x519d9b,_0x4cabc5){return _0x519d9b[_0x1c934f];});for(var _0xcee432 in _0x14c2a0){if(_0x14c2a0[_0x15f0('0x22')](_0xcee432)){if(!_0x371636[_0xcee432]){delete _0x14c2a0[_0xcee432];}}}}function freeIsNotKeySip(_0x2c181b,_0x50b5fc){var _0xe60219=_[_0x15f0('0x21')](_0x2c181b,function(_0x49f6bf,_0x45c363){return util[_0x15f0('0x23')]('SIP/%s',_0x49f6bf[_0x15f0('0x24')]);});for(var _0x12c6f8 in _0x50b5fc){if(_0x50b5fc[_0x15f0('0x22')](_0x12c6f8)){if(!_0xe60219[_0x12c6f8]){delete _0x50b5fc[_0x12c6f8];}}}}function freeIsNotKeyAgent(_0x42f3eb,_0x18a236){var _0x1c9d2f=_[_0x15f0('0x21')](_0x42f3eb,function(_0x3098dd,_0x21d222){var _0x323f14=_[_0x15f0('0x25')](_0x3098dd['interface'])?util['format']('SIP/%s',_0x3098dd[_0x15f0('0x24')]):_0x3098dd[_0x15f0('0x26')];return _0x323f14;});for(var _0x3bb096 in _0x18a236){if(_0x18a236[_0x15f0('0x22')](_0x3bb096)){if(!_0x1c9d2f[_0x3bb096]){delete _0x18a236[_0x3bb096];}}}}function clearVoiceCallReports(_0x2ed46e){_0x2ed46e['total']=0x0;_0x2ed46e['answered']=0x0;_0x2ed46e['sumHoldTime']=0x0;_0x2ed46e[_0x15f0('0x27')]=0x0;_0x2ed46e['sumBillable']=0x0;}function clearCampaigns(_0x232864){if(!_['isEmpty'](_0x232864)){for(var _0x5ec55c in _0x232864){if(_0x232864['hasOwnProperty'](_0x5ec55c)){_0x232864[_0x5ec55c]['ivrTotalCallsDays']=0x0;_0x232864[_0x5ec55c][_0x15f0('0x28')]=0x0;}}}}function clearVoiceQueues(_0x3cf05b){if(!_[_0x15f0('0x29')](_0x3cf05b)){for(var _0x34cee7 in _0x3cf05b){if(_0x3cf05b['hasOwnProperty'](_0x34cee7)){_0x3cf05b[_0x34cee7][_0x15f0('0x2a')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2b')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2c')]=0x0;_0x3cf05b[_0x34cee7]['abandoned']=0x0;_0x3cf05b[_0x34cee7]['sumHoldTime']=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x27')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2d')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2e')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2f')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x30')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x31')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x32')]=0x0;_0x3cf05b[_0x34cee7]['outboundUnknownCallsDay']=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x33')]=0x0;_0x3cf05b[_0x34cee7]['outboundDropCallsDayCallersExit']=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x34')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x35')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x36')]=0x0;_0x3cf05b[_0x34cee7]['outboundReCallsDay']=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x2e')]=0x0;_0x3cf05b[_0x34cee7][_0x15f0('0x37')]=0x0;_0x3cf05b[_0x34cee7]['queueStatusComplete']=!![];}}}}Realtime[_0x15f0('0x38')][_0x15f0('0x39')]=function(_0x51b0a3,_0x107ad4){for(var _0x5c4d07 in _0x107ad4){if(_0x51b0a3[_0x15f0('0x22')](_0x5c4d07)){_0x51b0a3[_0x5c4d07]=_0x107ad4[_0x5c4d07];}}};Realtime[_0x15f0('0x38')][_0x15f0('0x3a')]=function(){var _0x109fa0=this;return function(_0x1ea203){if(_0x1ea203){freeIsNotKeyAgent(_0x1ea203,_0x109fa0[_0x15f0('0x11')]);for(var _0x386c68=0x0,_0x319595={},_0x3fa32a={};_0x386c68<_0x1ea203[_0x15f0('0x3b')];_0x386c68+=0x1){_0x319595=_0x1ea203[_0x386c68];var _0x4eb9bf=_[_0x15f0('0x25')](_0x319595[_0x15f0('0x26')])?util[_0x15f0('0x23')](_0x15f0('0x3c'),_0x319595['name']):_0x319595[_0x15f0('0x26')];if(_[_0x15f0('0x3d')](_0x109fa0['agents'][_0x4eb9bf])){_0x109fa0['agents'][_0x4eb9bf]=new Agent(_0x319595);}else{_0x109fa0[_0x15f0('0x39')](_0x109fa0[_0x15f0('0x11')][_0x4eb9bf],_0x319595);}}}return _0x109fa0[_0x15f0('0x11')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x3e')]=function(){var _0x3ca6db=this;return function(_0xcf86a7){if(_0xcf86a7){freeIsNotKeySip(_0xcf86a7,_0x3ca6db[_0x15f0('0x12')]);for(var _0x387466=0x0,_0x3d35f6={},_0x5e1bee={};_0x387466<_0xcf86a7[_0x15f0('0x3b')];_0x387466+=0x1){_0x3d35f6=_0xcf86a7[_0x387466];if(_[_0x15f0('0x3d')](_0x3ca6db[_0x15f0('0x12')][util['format'](_0x15f0('0x3c'),_0x3d35f6['name'])])){_0x3ca6db[_0x15f0('0x12')][util[_0x15f0('0x23')]('SIP/%s',_0x3d35f6['name'])]=new Telephone(_0x3d35f6);}else{_0x3ca6db['mergeFromDatabase'](_0x3ca6db[_0x15f0('0x12')][util[_0x15f0('0x23')]('SIP/%s',_0x3d35f6[_0x15f0('0x24')])],_0x3d35f6);}}}return _0x3ca6db[_0x15f0('0x12')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x3f')]=function(){var _0x5d0341=this;return function(_0x1a444b){if(_0x1a444b){freeIsNotKeySip(_0x1a444b,_0x5d0341[_0x15f0('0x40')]);for(var _0x389cbe=0x0,_0x594ce6={},_0x33c3ee={};_0x389cbe<_0x1a444b[_0x15f0('0x3b')];_0x389cbe+=0x1){_0x594ce6=_0x1a444b[_0x389cbe];if(_[_0x15f0('0x3d')](_0x5d0341[_0x15f0('0x40')][util[_0x15f0('0x23')](_0x15f0('0x3c'),_0x594ce6['name'])])){_0x5d0341[_0x15f0('0x40')][util['format'](_0x15f0('0x3c'),_0x594ce6[_0x15f0('0x24')])]=new Trunk(_0x594ce6);}else{_0x5d0341['mergeFromDatabase'](_0x5d0341['trunks'][util[_0x15f0('0x23')](_0x15f0('0x3c'),_0x594ce6[_0x15f0('0x24')])],_0x594ce6);}}}return _0x5d0341['trunks'];};};Realtime[_0x15f0('0x38')][_0x15f0('0x41')]=function(){var _0x5c1ab6=this;return function(_0xfccd13){if(_0xfccd13){freeIsNotKey(_0xfccd13,_0x5c1ab6[_0x15f0('0x42')],'name');for(var _0x1c4791=0x0,_0x1c855b={},_0x535615={};_0x1c4791<_0xfccd13[_0x15f0('0x3b')];_0x1c4791+=0x1){_0x1c855b=_0xfccd13[_0x1c4791];if(_[_0x15f0('0x3d')](_0x5c1ab6['voiceQueues'][_0x1c855b[_0x15f0('0x24')]])){_0x5c1ab6[_0x15f0('0x42')][_0x1c855b['name']]=new VoiceQueue(_0x1c855b);}else{_0x5c1ab6[_0x15f0('0x39')](_0x5c1ab6['voiceQueues'][_0x1c855b[_0x15f0('0x24')]],_0x1c855b);}}}return _0x5c1ab6['voiceQueues'];};};Realtime['prototype'][_0x15f0('0x43')]=function(){var _0x30b266=this;return function(_0x37ebf8){if(_0x37ebf8){freeIsNotKey(_0x37ebf8,_0x30b266['triggers'],'id');for(var _0x2cfaed=0x0,_0x167d21={},_0x8f81e6={};_0x2cfaed<_0x37ebf8[_0x15f0('0x3b')];_0x2cfaed+=0x1){_0x167d21=_0x37ebf8[_0x2cfaed];if(_[_0x15f0('0x3d')](_0x30b266[_0x15f0('0x44')][_0x167d21['id']])){_0x30b266['triggers'][_0x167d21['id']]=new Trigger(_0x167d21);}else{_0x30b266[_0x15f0('0x39')](_0x30b266['triggers'][_0x167d21['id']],_0x167d21);}}}return _0x30b266['triggers'];};};Realtime[_0x15f0('0x38')][_0x15f0('0x45')]=function(){var _0x25ec76=this;return function(_0x47849a){if(_0x47849a){freeIsNotKey(_0x47849a,_0x25ec76[_0x15f0('0x13')],'id');for(var _0x221c1e=0x0,_0x19b291={},_0x39674c={};_0x221c1e<_0x47849a['length'];_0x221c1e+=0x1){_0x19b291=_0x47849a[_0x221c1e];if(_['isUndefined'](_0x25ec76[_0x15f0('0x13')][_0x19b291['id']])){_0x25ec76[_0x15f0('0x13')][_0x19b291['id']]=new Template(_0x19b291);}else{_0x25ec76[_0x15f0('0x39')](_0x25ec76[_0x15f0('0x13')][_0x19b291['id']],_0x19b291);}}}return _0x25ec76[_0x15f0('0x13')];};};Realtime['prototype'][_0x15f0('0x46')]=function(){var _0x107653=this;return function(_0x3612dc){if(_0x3612dc){freeIsNotKey(_0x3612dc,_0x107653[_0x15f0('0x1a')],'id');for(var _0x2cfc2a=0x0,_0x5b90d2={},_0x407988={};_0x2cfc2a<_0x3612dc['length'];_0x2cfc2a+=0x1){_0x5b90d2=_0x3612dc[_0x2cfc2a];if(_[_0x15f0('0x3d')](_0x107653[_0x15f0('0x1a')][_0x5b90d2['id']])){_0x107653[_0x15f0('0x1a')][_0x5b90d2['id']]=new ZendeskAccount(_0x5b90d2);}else{_0x107653[_0x15f0('0x39')](_0x107653[_0x15f0('0x1a')][_0x5b90d2['id']],_0x5b90d2);}}}return _0x107653[_0x15f0('0x1a')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x47')]=function(){var _0x2777e5=this;return function(_0x3606fe){if(_0x3606fe){freeIsNotKey(_0x3606fe,_0x2777e5['salesforceAccounts'],'id');for(var _0x44d541=0x0,_0x6c0d90={},_0x452183={};_0x44d541<_0x3606fe[_0x15f0('0x3b')];_0x44d541+=0x1){_0x6c0d90=_0x3606fe[_0x44d541];if(_[_0x15f0('0x3d')](_0x2777e5[_0x15f0('0x1b')][_0x6c0d90['id']])){_0x2777e5[_0x15f0('0x1b')][_0x6c0d90['id']]=new SalesforceAccount(_0x6c0d90);}else{_0x2777e5[_0x15f0('0x39')](_0x2777e5[_0x15f0('0x1b')][_0x6c0d90['id']],_0x6c0d90);}}}return _0x2777e5[_0x15f0('0x1b')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x48')]=function(){var _0x344049=this;return function(_0x54e2d1){if(_0x54e2d1){freeIsNotKey(_0x54e2d1,_0x344049[_0x15f0('0x1c')],'id');for(var _0x14c4a9=0x0,_0x3061fc={},_0x17140b={};_0x14c4a9<_0x54e2d1[_0x15f0('0x3b')];_0x14c4a9+=0x1){_0x3061fc=_0x54e2d1[_0x14c4a9];if(_[_0x15f0('0x3d')](_0x344049[_0x15f0('0x1c')][_0x3061fc['id']])){_0x344049[_0x15f0('0x1c')][_0x3061fc['id']]=new FreshdeskAccount(_0x3061fc);}else{_0x344049[_0x15f0('0x39')](_0x344049[_0x15f0('0x1c')][_0x3061fc['id']],_0x3061fc);}}}return _0x344049[_0x15f0('0x1c')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x5430a0=this;return function(_0x5d2fc7){if(_0x5d2fc7){freeIsNotKey(_0x5d2fc7,_0x5430a0[_0x15f0('0x1d')],'id');for(var _0x44fe95=0x0,_0x3c91d4={},_0x258645={};_0x44fe95<_0x5d2fc7[_0x15f0('0x3b')];_0x44fe95+=0x1){_0x3c91d4=_0x5d2fc7[_0x44fe95];if(_[_0x15f0('0x3d')](_0x5430a0[_0x15f0('0x1d')][_0x3c91d4['id']])){_0x5430a0[_0x15f0('0x1d')][_0x3c91d4['id']]=new ZohoAccount(_0x3c91d4);}else{_0x5430a0[_0x15f0('0x39')](_0x5430a0[_0x15f0('0x1d')][_0x3c91d4['id']],_0x3c91d4);}}}return _0x5430a0[_0x15f0('0x1d')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x49')]=function(){var _0x40425c=this;return function(_0x6e61ba){if(_0x6e61ba){freeIsNotKey(_0x6e61ba,_0x40425c['deskAccounts'],'id');for(var _0x190c26=0x0,_0x1d2421={},_0x382f3f={};_0x190c26<_0x6e61ba[_0x15f0('0x3b')];_0x190c26+=0x1){_0x1d2421=_0x6e61ba[_0x190c26];if(_[_0x15f0('0x3d')](_0x40425c[_0x15f0('0x1e')][_0x1d2421['id']])){_0x40425c['deskAccounts'][_0x1d2421['id']]=new DeskAccount(_0x1d2421);}else{_0x40425c[_0x15f0('0x39')](_0x40425c[_0x15f0('0x1e')][_0x1d2421['id']],_0x1d2421);}}}return _0x40425c[_0x15f0('0x1e')];};};Realtime[_0x15f0('0x38')]['initSugarcrmAccounts']=function(){var _0x52f484=this;return function(_0x4a4e59){if(_0x4a4e59){freeIsNotKey(_0x4a4e59,_0x52f484['sugarcrmAccounts'],'id');for(var _0x4845d5=0x0,_0x1513bf={},_0x405962={};_0x4845d5<_0x4a4e59[_0x15f0('0x3b')];_0x4845d5+=0x1){_0x1513bf=_0x4a4e59[_0x4845d5];if(_[_0x15f0('0x3d')](_0x52f484['sugarcrmAccounts'][_0x1513bf['id']])){_0x52f484[_0x15f0('0x4a')][_0x1513bf['id']]=new SugarcrmAccount(_0x1513bf);}else{_0x52f484[_0x15f0('0x39')](_0x52f484[_0x15f0('0x4a')][_0x1513bf['id']],_0x1513bf);}}}return _0x52f484[_0x15f0('0x4a')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x2d8bc9=this;return function(_0x25bc0e){if(_0x25bc0e){freeIsNotKey(_0x25bc0e,_0x2d8bc9[_0x15f0('0x4b')],'id');for(var _0x1ad270=0x0,_0x4e35b7={},_0x5487ca={};_0x1ad270<_0x25bc0e[_0x15f0('0x3b')];_0x1ad270+=0x1){_0x4e35b7=_0x25bc0e[_0x1ad270];if(_[_0x15f0('0x3d')](_0x2d8bc9[_0x15f0('0x4b')][_0x4e35b7['id']])){_0x2d8bc9[_0x15f0('0x4b')][_0x4e35b7['id']]=new VtigerAccount(_0x4e35b7);}else{_0x2d8bc9[_0x15f0('0x39')](_0x2d8bc9[_0x15f0('0x4b')][_0x4e35b7['id']],_0x4e35b7);}}}return _0x2d8bc9['vtigerAccounts'];};};Realtime[_0x15f0('0x38')][_0x15f0('0x4c')]=function(){var _0x3a5e34=this;return function(_0x3eb316){if(_0x3eb316){freeIsNotKey(_0x3eb316,_0x3a5e34[_0x15f0('0x4d')],'id');for(var _0x1d740d=0x0,_0x2399a3={},_0x54ecbc={};_0x1d740d<_0x3eb316[_0x15f0('0x3b')];_0x1d740d+=0x1){_0x2399a3=_0x3eb316[_0x1d740d];if(_[_0x15f0('0x3d')](_0x3a5e34['servicenowAccounts'][_0x2399a3['id']])){_0x3a5e34[_0x15f0('0x4d')][_0x2399a3['id']]=new ServicenowAccount(_0x2399a3);}else{_0x3a5e34[_0x15f0('0x39')](_0x3a5e34[_0x15f0('0x4d')][_0x2399a3['id']],_0x2399a3);}}}return _0x3a5e34[_0x15f0('0x4d')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x4e')]=function(){var _0x455633=this;return function(_0x52bc81){if(_0x52bc81){freeIsNotKey(_0x52bc81,_0x455633[_0x15f0('0x1f')],'id');for(var _0x3d6534=0x0,_0x4e3337={},_0x53c2f6={};_0x3d6534<_0x52bc81['length'];_0x3d6534+=0x1){_0x4e3337=_0x52bc81[_0x3d6534];if(_[_0x15f0('0x3d')](_0x455633[_0x15f0('0x1f')][_0x4e3337['id']])){_0x455633[_0x15f0('0x1f')][_0x4e3337['id']]=new Dynamics365Account(_0x4e3337);}else{_0x455633[_0x15f0('0x39')](_0x455633['dynamics365Accounts'][_0x4e3337['id']],_0x4e3337);}}}return _0x455633[_0x15f0('0x1f')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x4f')]=function(){var _0xeaddd5=this;return function(_0xdd627f){if(_0xdd627f){freeIsNotKey(_0xdd627f,_0xeaddd5['freshsalesAccounts'],'id');for(var _0x493c74=0x0,_0x2679fb={},_0x31b374={};_0x493c74<_0xdd627f[_0x15f0('0x3b')];_0x493c74+=0x1){_0x2679fb=_0xdd627f[_0x493c74];if(_[_0x15f0('0x3d')](_0xeaddd5[_0x15f0('0x20')][_0x2679fb['id']])){_0xeaddd5[_0x15f0('0x20')][_0x2679fb['id']]=new FreshsalesAccount(_0x2679fb);}else{_0xeaddd5[_0x15f0('0x39')](_0xeaddd5[_0x15f0('0x20')][_0x2679fb['id']],_0x2679fb);}}}return _0xeaddd5[_0x15f0('0x20')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x50')]=function(){var _0x11474b=this;return function(_0x43aaeb){for(var _0x4eeb2c=0x0;_0x4eeb2c<_0x43aaeb[_0x15f0('0x3b')];_0x4eeb2c+=0x1){_['merge'](_0x11474b[_0x15f0('0x42')][_0x43aaeb[_0x4eeb2c][_0x15f0('0x24')]],_0x43aaeb[_0x4eeb2c]);}return _0x11474b['voiceQueues'];};};Realtime[_0x15f0('0x38')]['initVoiceQueueReports']=function(){var _0x1e54b3=this;return function(_0x29be7c){clearVoiceQueues(_0x1e54b3[_0x15f0('0x42')]);if(_0x29be7c){_0x29be7c=_[_0x15f0('0x51')](_0x29be7c,_0x15f0('0x52'));for(var _0x4b4eae in _0x29be7c){if(_0x29be7c[_0x15f0('0x22')](_0x4b4eae)){var _0x481ad8={};for(var _0x4b92ab=0x0;_0x4b92ab<_0x29be7c[_0x4b4eae]['length'];_0x4b92ab+=0x1){var _0x10f346=_0x29be7c[_0x4b4eae][_0x4b92ab]['queue'];if(_0x1e54b3[_0x15f0('0x42')][_0x10f346]){if(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x53')]){_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x2c')]+=0x1;}if(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x54')]){_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x55')]+=0x1;}_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x56')]+=moment(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x57')])[_0x15f0('0x58')](moment(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x59')]),_0x15f0('0x5a'))||0x0;if(_0x4b92ab===_0x29be7c[_0x4b4eae][_0x15f0('0x3b')]-0x1){_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x27')]+=moment(_0x29be7c[_0x4b4eae][_0x4b92ab]['queuecallercompleteAt']||_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x5b')]||_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x5c')])[_0x15f0('0x58')](moment(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x59')]),'seconds')||0x0;_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x2a')]+=0x1;if(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x5d')]){_0x1e54b3[_0x15f0('0x42')][_0x10f346][_0x15f0('0x2b')]+=0x1;_0x1e54b3['voiceQueues'][_0x10f346][_0x15f0('0x2d')]+=moment(_0x29be7c[_0x4b4eae][_0x4b92ab][_0x15f0('0x5e')])[_0x15f0('0x58')](moment(_0x29be7c[_0x4b4eae][_0x4b92ab]['queuecallerleaveAt']),_0x15f0('0x5a'))||0x0;}}else{_0x1e54b3[_0x15f0('0x42')][_0x10f346]['sumDuration']+=_0x1e54b3['voiceQueues'][_0x10f346][_0x15f0('0x56')]||0x0;}}}}}}return _0x1e54b3['voiceQueues'];};};Realtime[_0x15f0('0x38')][_0x15f0('0x5f')]=function(){var _0xb8f4ac=this;return function(_0x4e9fc4){clearVoiceCallReports(_0xb8f4ac['outbound']);if(_0x4e9fc4){for(var _0x167b21=0x0;_0x167b21<_0x4e9fc4[_0x15f0('0x3b')];_0x167b21+=0x1){_0xb8f4ac[_0x15f0('0x14')][_0x15f0('0x2a')]+=0x1;_0xb8f4ac[_0x15f0('0x14')]['sumDuration']+=_0x4e9fc4[_0x167b21][_0x15f0('0x60')];if(_0x4e9fc4[_0x167b21][_0x15f0('0x61')]===_0x15f0('0x62')){_0xb8f4ac[_0x15f0('0x14')][_0x15f0('0x2b')]+=0x1;_0xb8f4ac[_0x15f0('0x14')][_0x15f0('0x56')]+=_0x4e9fc4[_0x167b21][_0x15f0('0x60')]-_0x4e9fc4[_0x167b21][_0x15f0('0x63')]||0x0;_0xb8f4ac['outbound'][_0x15f0('0x2d')]+=_0x4e9fc4[_0x167b21][_0x15f0('0x63')];}}}return _0xb8f4ac['outbound'];};};Realtime['prototype'][_0x15f0('0x64')]=function(){var _0xd702ad=this;return function(_0x37240d){if(_0x37240d){freeIsNotKey(_0x37240d,_0xd702ad[_0x15f0('0x65')],_0x15f0('0x24'));for(var _0x34da4b=0x0,_0x326fd2={};_0x34da4b<_0x37240d[_0x15f0('0x3b')];_0x34da4b+=0x1){_0x326fd2=_0x37240d[_0x34da4b];if(_[_0x15f0('0x3d')](_0xd702ad[_0x15f0('0x65')][_0x326fd2[_0x15f0('0x24')]])){_0xd702ad[_0x15f0('0x65')][_0x326fd2[_0x15f0('0x24')]]=new Campaign(_0x326fd2);}else{_0xd702ad[_0x15f0('0x39')](_0xd702ad[_0x15f0('0x65')][_0x326fd2[_0x15f0('0x24')]],_0x326fd2);_0xd702ad[_0x15f0('0x65')][_0x326fd2[_0x15f0('0x24')]][_0x15f0('0x66')]=_0x326fd2[_0x15f0('0x67')]?_0x326fd2[_0x15f0('0x67')]['name']:undefined;}}}return _0xd702ad[_0x15f0('0x65')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x68')]=function(){var _0x5109d1=this;return function(_0x2c8fe7){if(_0x2c8fe7){freeIsNotKey(_0x2c8fe7,_0x5109d1[_0x15f0('0x69')],'id');for(var _0xd8f4c1=0x0,_0x21b757={};_0xd8f4c1<_0x2c8fe7[_0x15f0('0x3b')];_0xd8f4c1+=0x1){_0x21b757=_0x2c8fe7[_0xd8f4c1];if(_[_0x15f0('0x3d')](_0x5109d1['voiceExtensions'][_0x21b757['id']])){_0x5109d1[_0x15f0('0x69')][_0x21b757['id']]=new VoiceExtension(_0x21b757);}else{_0x5109d1[_0x15f0('0x39')](_0x5109d1[_0x15f0('0x69')][_0x21b757['id']],_0x21b757);}}}return _0x5109d1['voiceExtensions'];};};Realtime[_0x15f0('0x38')]['initCampaignHopperHistory']=function(){var _0x1ed646=this;return function(_0x224e5e){clearCampaigns(_0x1ed646[_0x15f0('0x65')]);for(var _0x1173a1=0x0;_0x1173a1<_0x224e5e[_0x15f0('0x3b')];_0x1173a1+=0x1){_[_0x15f0('0x6a')](_0x1ed646[_0x15f0('0x65')][_0x224e5e[_0x1173a1][_0x15f0('0x24')]],_0x224e5e[_0x1173a1]);}return _0x1ed646[_0x15f0('0x65')];};};Realtime[_0x15f0('0x38')][_0x15f0('0x6b')]=function(){var _0x649db4=this;return function(_0x4d13bd){if(_0x4d13bd){freeIsNotKey(_0x4d13bd,_0x649db4['faxAccounts'],'id');for(var _0x58f2c0=0x0,_0x11f8bf={},_0x598cf2={};_0x58f2c0<_0x4d13bd[_0x15f0('0x3b')];_0x58f2c0+=0x1){_0x11f8bf=_0x4d13bd[_0x58f2c0];if(_['isUndefined'](_0x649db4['faxAccounts'][_0x11f8bf['id']])){_0x649db4['faxAccounts'][_0x11f8bf['id']]=new FaxAccount(_0x11f8bf);}else{_0x649db4[_0x15f0('0x39')](_0x649db4[_0x15f0('0x6c')][_0x11f8bf['id']],_0x11f8bf);}}}return _0x649db4[_0x15f0('0x6c')];};};module['exports']=Realtime; \ No newline at end of file +var _0x6841=['sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','name','isUndefined','agents','initTelephones','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','initTemplates','initFreshdeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','ANSWERED','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration'];(function(_0x4aac09,_0x535c51){var _0x45b09b=function(_0x5acd5a){while(--_0x5acd5a){_0x4aac09['push'](_0x4aac09['shift']());}};_0x45b09b(++_0x535c51);}(_0x6841,0x1da));var _0x1684=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x6841[_0xea8947];return _0x2455e9;};'use strict';var BPromise=require(_0x1684('0x0'));var util=require('util');var _=require(_0x1684('0x1'));var moment=require(_0x1684('0x2'));var Agent=require(_0x1684('0x3'));var Telephone=require(_0x1684('0x4'));var Trunk=require(_0x1684('0x5'));var VoiceQueue=require(_0x1684('0x6'));var Trigger=require(_0x1684('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x1684('0x8'));var ZendeskAccount=require(_0x1684('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x1684('0xa'));var ZohoAccount=require(_0x1684('0xb'));var DeskAccount=require(_0x1684('0xc'));var VtigerAccount=require(_0x1684('0xd'));var ServicenowAccount=require(_0x1684('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x1684('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x1684('0x10')]={};this[_0x1684('0x11')]={};this[_0x1684('0x12')]={};this[_0x1684('0x13')]={};this[_0x1684('0x14')]={};this[_0x1684('0x15')]={};this[_0x1684('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1684('0x17')]={};this[_0x1684('0x18')]={};this['queueChannels']={};this['outboundChannels']={};this[_0x1684('0x19')]={};this[_0x1684('0x1a')]={};this[_0x1684('0x1b')]={};this[_0x1684('0x1c')]={};this[_0x1684('0x1d')]={};this[_0x1684('0x1e')]={};this[_0x1684('0x1f')]={};this['deskAccounts']={};this[_0x1684('0x20')]={};this[_0x1684('0x21')]={};this[_0x1684('0x22')]={};this[_0x1684('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x36986b,_0x5d5877,_0x3e8c37){var _0x3c6d01=_['mapKeys'](_0x36986b,function(_0x1f8631,_0x2f4d4b){return _0x1f8631[_0x3e8c37];});for(var _0x45f319 in _0x5d5877){if(_0x5d5877['hasOwnProperty'](_0x45f319)){if(!_0x3c6d01[_0x45f319]){delete _0x5d5877[_0x45f319];}}}}function freeIsNotKeySip(_0x40b5d0,_0x26ccbf){var _0x104c42=_[_0x1684('0x24')](_0x40b5d0,function(_0x2d9f95,_0x48da48){return util[_0x1684('0x25')](_0x1684('0x26'),_0x2d9f95['name']);});for(var _0x285e22 in _0x26ccbf){if(_0x26ccbf[_0x1684('0x27')](_0x285e22)){if(!_0x104c42[_0x285e22]){delete _0x26ccbf[_0x285e22];}}}}function freeIsNotKeyAgent(_0x3770ee,_0x5cd1d8){var _0xa62bad=_['mapKeys'](_0x3770ee,function(_0x59815a,_0x5099d6){var _0x4be199=_[_0x1684('0x28')](_0x59815a['interface'])?util[_0x1684('0x25')]('SIP/%s',_0x59815a['name']):_0x59815a[_0x1684('0x29')];return _0x4be199;});for(var _0x174f1e in _0x5cd1d8){if(_0x5cd1d8['hasOwnProperty'](_0x174f1e)){if(!_0xa62bad[_0x174f1e]){delete _0x5cd1d8[_0x174f1e];}}}}function clearVoiceCallReports(_0x61ee17){_0x61ee17[_0x1684('0x2a')]=0x0;_0x61ee17[_0x1684('0x2b')]=0x0;_0x61ee17[_0x1684('0x2c')]=0x0;_0x61ee17[_0x1684('0x2d')]=0x0;_0x61ee17[_0x1684('0x2e')]=0x0;}function clearCampaigns(_0x563955){if(!_[_0x1684('0x2f')](_0x563955)){for(var _0x5368e4 in _0x563955){if(_0x563955[_0x1684('0x27')](_0x5368e4)){_0x563955[_0x5368e4][_0x1684('0x30')]=0x0;_0x563955[_0x5368e4][_0x1684('0x31')]=0x0;}}}}function clearVoiceQueues(_0x532e71){if(!_[_0x1684('0x2f')](_0x532e71)){for(var _0x54c114 in _0x532e71){if(_0x532e71['hasOwnProperty'](_0x54c114)){_0x532e71[_0x54c114]['total']=0x0;_0x532e71[_0x54c114][_0x1684('0x2b')]=0x0;_0x532e71[_0x54c114][_0x1684('0x32')]=0x0;_0x532e71[_0x54c114][_0x1684('0x33')]=0x0;_0x532e71[_0x54c114]['sumHoldTime']=0x0;_0x532e71[_0x54c114][_0x1684('0x2d')]=0x0;_0x532e71[_0x54c114]['sumBillable']=0x0;_0x532e71[_0x54c114][_0x1684('0x34')]=0x0;_0x532e71[_0x54c114][_0x1684('0x35')]=0x0;_0x532e71[_0x54c114]['outboundBusyCallsDay']=0x0;_0x532e71[_0x54c114][_0x1684('0x36')]=0x0;_0x532e71[_0x54c114][_0x1684('0x37')]=0x0;_0x532e71[_0x54c114][_0x1684('0x38')]=0x0;_0x532e71[_0x54c114][_0x1684('0x39')]=0x0;_0x532e71[_0x54c114]['outboundDropCallsDayCallersExit']=0x0;_0x532e71[_0x54c114][_0x1684('0x3a')]=0x0;_0x532e71[_0x54c114][_0x1684('0x3b')]=0x0;_0x532e71[_0x54c114][_0x1684('0x3c')]=0x0;_0x532e71[_0x54c114]['outboundReCallsDay']=0x0;_0x532e71[_0x54c114][_0x1684('0x34')]=0x0;_0x532e71[_0x54c114][_0x1684('0x3d')]=0x0;_0x532e71[_0x54c114][_0x1684('0x3e')]=!![];}}}}Realtime[_0x1684('0x3f')]['mergeFromDatabase']=function(_0x481893,_0x57b588){for(var _0x324ea8 in _0x57b588){if(_0x481893['hasOwnProperty'](_0x324ea8)){_0x481893[_0x324ea8]=_0x57b588[_0x324ea8];}}};Realtime[_0x1684('0x3f')][_0x1684('0x40')]=function(){var _0xea14ba=this;return function(_0x2b64a6){if(_0x2b64a6){freeIsNotKeyAgent(_0x2b64a6,_0xea14ba['agents']);for(var _0x2fa543=0x0,_0x27d726={},_0x5e6169={};_0x2fa543<_0x2b64a6[_0x1684('0x41')];_0x2fa543+=0x1){_0x27d726=_0x2b64a6[_0x2fa543];var _0x1ed68e=_[_0x1684('0x28')](_0x27d726['interface'])?util[_0x1684('0x25')](_0x1684('0x26'),_0x27d726[_0x1684('0x42')]):_0x27d726['interface'];if(_[_0x1684('0x43')](_0xea14ba[_0x1684('0x44')][_0x1ed68e])){_0xea14ba[_0x1684('0x44')][_0x1ed68e]=new Agent(_0x27d726);}else{_0xea14ba['mergeFromDatabase'](_0xea14ba['agents'][_0x1ed68e],_0x27d726);}}}return _0xea14ba[_0x1684('0x44')];};};Realtime['prototype'][_0x1684('0x45')]=function(){var _0x113048=this;return function(_0x47cd0d){if(_0x47cd0d){freeIsNotKeySip(_0x47cd0d,_0x113048[_0x1684('0x10')]);for(var _0x457d05=0x0,_0x4f6a7c={},_0x411dcc={};_0x457d05<_0x47cd0d['length'];_0x457d05+=0x1){_0x4f6a7c=_0x47cd0d[_0x457d05];if(_[_0x1684('0x43')](_0x113048['telephones'][util['format'](_0x1684('0x26'),_0x4f6a7c['name'])])){_0x113048['telephones'][util[_0x1684('0x25')](_0x1684('0x26'),_0x4f6a7c['name'])]=new Telephone(_0x4f6a7c);}else{_0x113048[_0x1684('0x46')](_0x113048[_0x1684('0x10')][util[_0x1684('0x25')]('SIP/%s',_0x4f6a7c['name'])],_0x4f6a7c);}}}return _0x113048['telephones'];};};Realtime['prototype'][_0x1684('0x47')]=function(){var _0x3850ab=this;return function(_0x1c9d58){if(_0x1c9d58){freeIsNotKeySip(_0x1c9d58,_0x3850ab['trunks']);for(var _0x266489=0x0,_0x1f7b95={},_0x17ebb5={};_0x266489<_0x1c9d58[_0x1684('0x41')];_0x266489+=0x1){_0x1f7b95=_0x1c9d58[_0x266489];if(_[_0x1684('0x43')](_0x3850ab['trunks'][util[_0x1684('0x25')](_0x1684('0x26'),_0x1f7b95[_0x1684('0x42')])])){_0x3850ab[_0x1684('0x11')][util[_0x1684('0x25')](_0x1684('0x26'),_0x1f7b95[_0x1684('0x42')])]=new Trunk(_0x1f7b95);}else{_0x3850ab[_0x1684('0x46')](_0x3850ab[_0x1684('0x11')][util[_0x1684('0x25')]('SIP/%s',_0x1f7b95[_0x1684('0x42')])],_0x1f7b95);}}}return _0x3850ab['trunks'];};};Realtime[_0x1684('0x3f')][_0x1684('0x48')]=function(){var _0xfeee4d=this;return function(_0x399bbf){if(_0x399bbf){freeIsNotKey(_0x399bbf,_0xfeee4d[_0x1684('0x12')],_0x1684('0x42'));for(var _0x333271=0x0,_0x299326={},_0x4fd359={};_0x333271<_0x399bbf[_0x1684('0x41')];_0x333271+=0x1){_0x299326=_0x399bbf[_0x333271];if(_[_0x1684('0x43')](_0xfeee4d[_0x1684('0x12')][_0x299326[_0x1684('0x42')]])){_0xfeee4d[_0x1684('0x12')][_0x299326['name']]=new VoiceQueue(_0x299326);}else{_0xfeee4d[_0x1684('0x46')](_0xfeee4d[_0x1684('0x12')][_0x299326[_0x1684('0x42')]],_0x299326);}}}return _0xfeee4d['voiceQueues'];};};Realtime[_0x1684('0x3f')][_0x1684('0x49')]=function(){var _0x5acda6=this;return function(_0x4d47d9){if(_0x4d47d9){freeIsNotKey(_0x4d47d9,_0x5acda6['triggers'],'id');for(var _0x773b8a=0x0,_0x486af2={},_0x5d1ffb={};_0x773b8a<_0x4d47d9['length'];_0x773b8a+=0x1){_0x486af2=_0x4d47d9[_0x773b8a];if(_['isUndefined'](_0x5acda6[_0x1684('0x13')][_0x486af2['id']])){_0x5acda6[_0x1684('0x13')][_0x486af2['id']]=new Trigger(_0x486af2);}else{_0x5acda6[_0x1684('0x46')](_0x5acda6[_0x1684('0x13')][_0x486af2['id']],_0x486af2);}}}return _0x5acda6[_0x1684('0x13')];};};Realtime['prototype'][_0x1684('0x4a')]=function(){var _0x5259df=this;return function(_0x9dc626){if(_0x9dc626){freeIsNotKey(_0x9dc626,_0x5259df[_0x1684('0x15')],'id');for(var _0x2acba5=0x0,_0x103b9b={},_0xf38146={};_0x2acba5<_0x9dc626['length'];_0x2acba5+=0x1){_0x103b9b=_0x9dc626[_0x2acba5];if(_[_0x1684('0x43')](_0x5259df[_0x1684('0x15')][_0x103b9b['id']])){_0x5259df[_0x1684('0x15')][_0x103b9b['id']]=new Template(_0x103b9b);}else{_0x5259df[_0x1684('0x46')](_0x5259df[_0x1684('0x15')][_0x103b9b['id']],_0x103b9b);}}}return _0x5259df[_0x1684('0x15')];};};Realtime[_0x1684('0x3f')]['initZendeskAccounts']=function(){var _0x5a4ca6=this;return function(_0x16b894){if(_0x16b894){freeIsNotKey(_0x16b894,_0x5a4ca6[_0x1684('0x1b')],'id');for(var _0x49b829=0x0,_0x204901={},_0x13fa8b={};_0x49b829<_0x16b894[_0x1684('0x41')];_0x49b829+=0x1){_0x204901=_0x16b894[_0x49b829];if(_[_0x1684('0x43')](_0x5a4ca6[_0x1684('0x1b')][_0x204901['id']])){_0x5a4ca6[_0x1684('0x1b')][_0x204901['id']]=new ZendeskAccount(_0x204901);}else{_0x5a4ca6[_0x1684('0x46')](_0x5a4ca6['zendeskAccounts'][_0x204901['id']],_0x204901);}}}return _0x5a4ca6[_0x1684('0x1b')];};};Realtime[_0x1684('0x3f')]['initSalesforceAccounts']=function(){var _0x47ffa7=this;return function(_0x118ad8){if(_0x118ad8){freeIsNotKey(_0x118ad8,_0x47ffa7[_0x1684('0x1c')],'id');for(var _0x3ef6e5=0x0,_0xa1adb3={},_0x216811={};_0x3ef6e5<_0x118ad8[_0x1684('0x41')];_0x3ef6e5+=0x1){_0xa1adb3=_0x118ad8[_0x3ef6e5];if(_[_0x1684('0x43')](_0x47ffa7[_0x1684('0x1c')][_0xa1adb3['id']])){_0x47ffa7[_0x1684('0x1c')][_0xa1adb3['id']]=new SalesforceAccount(_0xa1adb3);}else{_0x47ffa7[_0x1684('0x46')](_0x47ffa7[_0x1684('0x1c')][_0xa1adb3['id']],_0xa1adb3);}}}return _0x47ffa7[_0x1684('0x1c')];};};Realtime[_0x1684('0x3f')][_0x1684('0x4b')]=function(){var _0x4f0bcc=this;return function(_0x4448f2){if(_0x4448f2){freeIsNotKey(_0x4448f2,_0x4f0bcc[_0x1684('0x1e')],'id');for(var _0x131ee7=0x0,_0x52125b={},_0x590a2d={};_0x131ee7<_0x4448f2[_0x1684('0x41')];_0x131ee7+=0x1){_0x52125b=_0x4448f2[_0x131ee7];if(_[_0x1684('0x43')](_0x4f0bcc[_0x1684('0x1e')][_0x52125b['id']])){_0x4f0bcc[_0x1684('0x1e')][_0x52125b['id']]=new FreshdeskAccount(_0x52125b);}else{_0x4f0bcc['mergeFromDatabase'](_0x4f0bcc[_0x1684('0x1e')][_0x52125b['id']],_0x52125b);}}}return _0x4f0bcc[_0x1684('0x1e')];};};Realtime[_0x1684('0x3f')]['initZohoAccounts']=function(){var _0x218a02=this;return function(_0x4823e0){if(_0x4823e0){freeIsNotKey(_0x4823e0,_0x218a02[_0x1684('0x1f')],'id');for(var _0x10ba14=0x0,_0x2a0d06={},_0x120a7f={};_0x10ba14<_0x4823e0['length'];_0x10ba14+=0x1){_0x2a0d06=_0x4823e0[_0x10ba14];if(_[_0x1684('0x43')](_0x218a02['zohoAccounts'][_0x2a0d06['id']])){_0x218a02[_0x1684('0x1f')][_0x2a0d06['id']]=new ZohoAccount(_0x2a0d06);}else{_0x218a02[_0x1684('0x46')](_0x218a02[_0x1684('0x1f')][_0x2a0d06['id']],_0x2a0d06);}}}return _0x218a02[_0x1684('0x1f')];};};Realtime[_0x1684('0x3f')]['initDeskAccounts']=function(){var _0xa792d8=this;return function(_0x2b10e3){if(_0x2b10e3){freeIsNotKey(_0x2b10e3,_0xa792d8[_0x1684('0x4c')],'id');for(var _0x199deb=0x0,_0x233ef0={},_0x3b855c={};_0x199deb<_0x2b10e3[_0x1684('0x41')];_0x199deb+=0x1){_0x233ef0=_0x2b10e3[_0x199deb];if(_[_0x1684('0x43')](_0xa792d8[_0x1684('0x4c')][_0x233ef0['id']])){_0xa792d8[_0x1684('0x4c')][_0x233ef0['id']]=new DeskAccount(_0x233ef0);}else{_0xa792d8['mergeFromDatabase'](_0xa792d8[_0x1684('0x4c')][_0x233ef0['id']],_0x233ef0);}}}return _0xa792d8[_0x1684('0x4c')];};};Realtime[_0x1684('0x3f')][_0x1684('0x4d')]=function(){var _0x4ea465=this;return function(_0x1b4b57){if(_0x1b4b57){freeIsNotKey(_0x1b4b57,_0x4ea465['sugarcrmAccounts'],'id');for(var _0x5d490b=0x0,_0x1084d0={},_0x234512={};_0x5d490b<_0x1b4b57['length'];_0x5d490b+=0x1){_0x1084d0=_0x1b4b57[_0x5d490b];if(_[_0x1684('0x43')](_0x4ea465[_0x1684('0x1d')][_0x1084d0['id']])){_0x4ea465['sugarcrmAccounts'][_0x1084d0['id']]=new SugarcrmAccount(_0x1084d0);}else{_0x4ea465[_0x1684('0x46')](_0x4ea465[_0x1684('0x1d')][_0x1084d0['id']],_0x1084d0);}}}return _0x4ea465[_0x1684('0x1d')];};};Realtime['prototype'][_0x1684('0x4e')]=function(){var _0x103a0b=this;return function(_0xeed997){if(_0xeed997){freeIsNotKey(_0xeed997,_0x103a0b['vtigerAccounts'],'id');for(var _0x15a9bd=0x0,_0x46a883={},_0x5991dc={};_0x15a9bd<_0xeed997[_0x1684('0x41')];_0x15a9bd+=0x1){_0x46a883=_0xeed997[_0x15a9bd];if(_[_0x1684('0x43')](_0x103a0b[_0x1684('0x20')][_0x46a883['id']])){_0x103a0b['vtigerAccounts'][_0x46a883['id']]=new VtigerAccount(_0x46a883);}else{_0x103a0b[_0x1684('0x46')](_0x103a0b[_0x1684('0x20')][_0x46a883['id']],_0x46a883);}}}return _0x103a0b[_0x1684('0x20')];};};Realtime['prototype'][_0x1684('0x4f')]=function(){var _0x5b7346=this;return function(_0x5345a1){if(_0x5345a1){freeIsNotKey(_0x5345a1,_0x5b7346[_0x1684('0x21')],'id');for(var _0x1f1c67=0x0,_0x1f30a6={},_0x189a8a={};_0x1f1c67<_0x5345a1[_0x1684('0x41')];_0x1f1c67+=0x1){_0x1f30a6=_0x5345a1[_0x1f1c67];if(_[_0x1684('0x43')](_0x5b7346[_0x1684('0x21')][_0x1f30a6['id']])){_0x5b7346[_0x1684('0x21')][_0x1f30a6['id']]=new ServicenowAccount(_0x1f30a6);}else{_0x5b7346[_0x1684('0x46')](_0x5b7346[_0x1684('0x21')][_0x1f30a6['id']],_0x1f30a6);}}}return _0x5b7346[_0x1684('0x21')];};};Realtime[_0x1684('0x3f')][_0x1684('0x50')]=function(){var _0x75a1d4=this;return function(_0x367162){if(_0x367162){freeIsNotKey(_0x367162,_0x75a1d4['dynamics365Accounts'],'id');for(var _0x259163=0x0,_0x44df4a={},_0x108c34={};_0x259163<_0x367162[_0x1684('0x41')];_0x259163+=0x1){_0x44df4a=_0x367162[_0x259163];if(_['isUndefined'](_0x75a1d4[_0x1684('0x22')][_0x44df4a['id']])){_0x75a1d4['dynamics365Accounts'][_0x44df4a['id']]=new Dynamics365Account(_0x44df4a);}else{_0x75a1d4[_0x1684('0x46')](_0x75a1d4[_0x1684('0x22')][_0x44df4a['id']],_0x44df4a);}}}return _0x75a1d4[_0x1684('0x22')];};};Realtime['prototype'][_0x1684('0x51')]=function(){var _0x53675b=this;return function(_0x44349e){if(_0x44349e){freeIsNotKey(_0x44349e,_0x53675b['freshsalesAccounts'],'id');for(var _0x543288=0x0,_0x3f2aff={},_0x578e03={};_0x543288<_0x44349e[_0x1684('0x41')];_0x543288+=0x1){_0x3f2aff=_0x44349e[_0x543288];if(_[_0x1684('0x43')](_0x53675b[_0x1684('0x23')][_0x3f2aff['id']])){_0x53675b[_0x1684('0x23')][_0x3f2aff['id']]=new FreshsalesAccount(_0x3f2aff);}else{_0x53675b[_0x1684('0x46')](_0x53675b[_0x1684('0x23')][_0x3f2aff['id']],_0x3f2aff);}}}return _0x53675b['freshsalesAccounts'];};};Realtime[_0x1684('0x3f')][_0x1684('0x52')]=function(){var _0x4a3024=this;return function(_0x5d942b){for(var _0x5210b0=0x0;_0x5210b0<_0x5d942b[_0x1684('0x41')];_0x5210b0+=0x1){_[_0x1684('0x53')](_0x4a3024[_0x1684('0x12')][_0x5d942b[_0x5210b0][_0x1684('0x42')]],_0x5d942b[_0x5210b0]);}return _0x4a3024[_0x1684('0x12')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x573f93=this;return function(_0x41d1b5){clearVoiceQueues(_0x573f93[_0x1684('0x12')]);if(_0x41d1b5){_0x41d1b5=_[_0x1684('0x54')](_0x41d1b5,_0x1684('0x55'));for(var _0x2ca56d in _0x41d1b5){if(_0x41d1b5[_0x1684('0x27')](_0x2ca56d)){var _0x52a5fe={};for(var _0x293ada=0x0;_0x293ada<_0x41d1b5[_0x2ca56d][_0x1684('0x41')];_0x293ada+=0x1){var _0x43fe13=_0x41d1b5[_0x2ca56d][_0x293ada]['queue'];if(_0x573f93[_0x1684('0x12')][_0x43fe13]){if(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x56')]){_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x32')]+=0x1;}if(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x57')]){_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x33')]+=0x1;}_0x573f93[_0x1684('0x12')][_0x43fe13]['sumHoldTime']+=moment(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x58')])[_0x1684('0x59')](moment(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x5a')]),_0x1684('0x5b'))||0x0;if(_0x293ada===_0x41d1b5[_0x2ca56d][_0x1684('0x41')]-0x1){_0x573f93[_0x1684('0x12')][_0x43fe13]['sumDuration']+=moment(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x5c')]||_0x41d1b5[_0x2ca56d][_0x293ada]['queuecallerabandonAt']||_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x5d')])[_0x1684('0x59')](moment(_0x41d1b5[_0x2ca56d][_0x293ada]['queuecallerjoinAt']),'seconds')||0x0;_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x2a')]+=0x1;if(_0x41d1b5[_0x2ca56d][_0x293ada]['queuecallercomplete']){_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x2b')]+=0x1;_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x2e')]+=moment(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x5c')])[_0x1684('0x59')](moment(_0x41d1b5[_0x2ca56d][_0x293ada][_0x1684('0x58')]),_0x1684('0x5b'))||0x0;}}else{_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x2d')]+=_0x573f93[_0x1684('0x12')][_0x43fe13][_0x1684('0x2c')]||0x0;}}}}}}return _0x573f93[_0x1684('0x12')];};};Realtime[_0x1684('0x3f')][_0x1684('0x5e')]=function(){var _0x9c30fa=this;return function(_0x4fcb97){clearVoiceCallReports(_0x9c30fa[_0x1684('0x16')]);if(_0x4fcb97){for(var _0x83cee4=0x0;_0x83cee4<_0x4fcb97[_0x1684('0x41')];_0x83cee4+=0x1){_0x9c30fa[_0x1684('0x16')][_0x1684('0x2a')]+=0x1;_0x9c30fa['outbound'][_0x1684('0x2d')]+=_0x4fcb97[_0x83cee4][_0x1684('0x5f')];if(_0x4fcb97[_0x83cee4][_0x1684('0x60')]===_0x1684('0x61')){_0x9c30fa[_0x1684('0x16')][_0x1684('0x2b')]+=0x1;_0x9c30fa['outbound'][_0x1684('0x2c')]+=_0x4fcb97[_0x83cee4][_0x1684('0x5f')]-_0x4fcb97[_0x83cee4]['billableseconds']||0x0;_0x9c30fa['outbound'][_0x1684('0x2e')]+=_0x4fcb97[_0x83cee4]['billableseconds'];}}}return _0x9c30fa['outbound'];};};Realtime[_0x1684('0x3f')][_0x1684('0x62')]=function(){var _0x2e4843=this;return function(_0x734578){if(_0x734578){freeIsNotKey(_0x734578,_0x2e4843['campaigns'],'name');for(var _0x27a0ea=0x0,_0x2f3f55={};_0x27a0ea<_0x734578[_0x1684('0x41')];_0x27a0ea+=0x1){_0x2f3f55=_0x734578[_0x27a0ea];if(_['isUndefined'](_0x2e4843[_0x1684('0x14')][_0x2f3f55[_0x1684('0x42')]])){_0x2e4843[_0x1684('0x14')][_0x2f3f55[_0x1684('0x42')]]=new Campaign(_0x2f3f55);}else{_0x2e4843[_0x1684('0x46')](_0x2e4843[_0x1684('0x14')][_0x2f3f55[_0x1684('0x42')]],_0x2f3f55);_0x2e4843[_0x1684('0x14')][_0x2f3f55[_0x1684('0x42')]]['dialQueueProject']=_0x2f3f55[_0x1684('0x63')]?_0x2f3f55['SquareProject'][_0x1684('0x42')]:undefined;}}}return _0x2e4843[_0x1684('0x14')];};};Realtime[_0x1684('0x3f')][_0x1684('0x64')]=function(){var _0x3b6d3f=this;return function(_0x22cc4b){if(_0x22cc4b){freeIsNotKey(_0x22cc4b,_0x3b6d3f[_0x1684('0x17')],'id');for(var _0x260224=0x0,_0x5e7cca={};_0x260224<_0x22cc4b[_0x1684('0x41')];_0x260224+=0x1){_0x5e7cca=_0x22cc4b[_0x260224];if(_['isUndefined'](_0x3b6d3f[_0x1684('0x17')][_0x5e7cca['id']])){_0x3b6d3f[_0x1684('0x17')][_0x5e7cca['id']]=new VoiceExtension(_0x5e7cca);}else{_0x3b6d3f[_0x1684('0x46')](_0x3b6d3f[_0x1684('0x17')][_0x5e7cca['id']],_0x5e7cca);}}}return _0x3b6d3f[_0x1684('0x17')];};};Realtime['prototype'][_0x1684('0x65')]=function(){var _0xe1929=this;return function(_0x7a0a7a){clearCampaigns(_0xe1929[_0x1684('0x14')]);for(var _0x1d9a48=0x0;_0x1d9a48<_0x7a0a7a[_0x1684('0x41')];_0x1d9a48+=0x1){_[_0x1684('0x53')](_0xe1929[_0x1684('0x14')][_0x7a0a7a[_0x1d9a48][_0x1684('0x42')]],_0x7a0a7a[_0x1d9a48]);}return _0xe1929[_0x1684('0x14')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x2d1dfe=this;return function(_0x5b3008){if(_0x5b3008){freeIsNotKey(_0x5b3008,_0x2d1dfe[_0x1684('0x66')],'id');for(var _0x2beda2=0x0,_0x218742={},_0x299940={};_0x2beda2<_0x5b3008[_0x1684('0x41')];_0x2beda2+=0x1){_0x218742=_0x5b3008[_0x2beda2];if(_[_0x1684('0x43')](_0x2d1dfe['faxAccounts'][_0x218742['id']])){_0x2d1dfe[_0x1684('0x66')][_0x218742['id']]=new FaxAccount(_0x218742);}else{_0x2d1dfe[_0x1684('0x46')](_0x2d1dfe[_0x1684('0x66')][_0x218742['id']],_0x218742);}}}return _0x2d1dfe[_0x1684('0x66')];};};module[_0x1684('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 327974e..c80a1b9 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 _0x3a48=['ANSWERED','calleridname','transfers','linkedid','uniqueid','blindTransfer','getCallType','UserId','membername','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','create','isArray','forEach','startsWith','Local','substring','indexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','realtime','agents','prototype','sync','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','findAgent','accountcode','name','isNil','telephones','find','format','SIP/%s','connectedlinenum','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','getAgentByInternal','length','keys','channel','split','calleridnum','outbound','internal','destination','exten','type','lastapplication','queue','context','calleridpreview','destinationchannel','callerid','originatecalleridnum','disposition'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x3a48,0xc1));var _0x83a4=function(_0x366a16,_0x29e4bf){_0x366a16=_0x366a16-0x0;var _0x54f159=_0x3a48[_0x366a16];return _0x54f159;};'use strict';var _=require(_0x83a4('0x0'));var moment=require(_0x83a4('0x1'));var util=require(_0x83a4('0x2'));var config=require('../../../config/environment');var ami=require(_0x83a4('0x3'));var RpcVoiceAgentReport=require(_0x83a4('0x4'));var RpcVoiceCallReport=require(_0x83a4('0x5'));var RpcVoiceDialReport=require(_0x83a4('0x6'));var RpcMemberReport=require(_0x83a4('0x7'));var RpcVoiceQueueReport=require(_0x83a4('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x83a4('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x83a4('0xa'));var VoiceAgentReport=require(_0x83a4('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x1ad8d6){this[_0x83a4('0xc')]=_0x1ad8d6;this[_0x83a4('0xd')]=_0x1ad8d6['agents'];this['telephones']=_0x1ad8d6['telephones'];}Report[_0x83a4('0xe')][_0x83a4('0xf')]=function(_0xdbeac9){var _0x1ea48f=new VoiceQueueReport(this[_0x83a4('0xc')]);var _0x474e6e=new VoiceAgentReport(this['realtime']);var _0x5dd4a3=new VoiceDialReport(this[_0x83a4('0xc')]);var _0x11bb9f=new VoiceCallReport(this[_0x83a4('0xc')]);var _0x507513=new UserReport(this[_0x83a4('0xc')]);if(config[_0x83a4('0x10')]&&config[_0x83a4('0x10')][_0x83a4('0x11')]){ami['on']('custom:voiceQueueReport',this[_0x83a4('0x12')]['bind'](this));ami['on'](_0x83a4('0x13'),this[_0x83a4('0x14')]['bind'](this));ami['on'](_0x83a4('0x15'),this[_0x83a4('0x16')][_0x83a4('0x17')](this));ami['on'](_0x83a4('0x18'),this[_0x83a4('0x19')][_0x83a4('0x17')](this));ami['on'](_0x83a4('0x1a'),this['blindTransfer'][_0x83a4('0x17')](this));ami['on'](_0x83a4('0x1b'),this['attendedTransfer'][_0x83a4('0x17')](this));}};Report[_0x83a4('0xe')][_0x83a4('0x1c')]=function(_0x3e93c8){var _0x8d2b98;_0x8d2b98=_['find'](this['agents'],function(_0xd091f4){return _0xd091f4[_0x83a4('0x1d')]==_0x3e93c8||_0xd091f4[_0x83a4('0x1e')]==_0x3e93c8;});if(_[_0x83a4('0x1f')](_0x8d2b98)){var _0xa8d10a=_['find'](this[_0x83a4('0x20')],function(_0x9fc94c){return _0x9fc94c[_0x83a4('0x1d')]==_0x3e93c8||_0x9fc94c[_0x83a4('0x1e')]==_0x3e93c8;});if(_0xa8d10a){_0x8d2b98=_[_0x83a4('0x21')](this[_0x83a4('0xd')],function(_0x7aca52){return _0x7aca52['interface']==util[_0x83a4('0x22')](_0x83a4('0x23'),_0xa8d10a[_0x83a4('0x1e')]);});}}return _0x8d2b98;};Report[_0x83a4('0xe')][_0x83a4('0x12')]=function(_0x49dd38){for(var _0xa5ba39=0x0;_0xa5ba39<_0x49dd38['length'];_0xa5ba39+=0x1){var _0x36784f=this[_0x83a4('0x1c')](_0x49dd38[_0xa5ba39][_0x83a4('0x24')]);if(_0x36784f){_0x49dd38[_0xa5ba39][_0x83a4('0x1d')]=_0x36784f[_0x83a4('0x1d')];_0x49dd38[_0xa5ba39]['assigned']=!![];_0x49dd38[_0xa5ba39]['lastAssignedTo']=_0x36784f['name'];_0x49dd38[_0xa5ba39][_0x83a4('0x25')]=_['isNil'](_0x36784f['interface'])?util[_0x83a4('0x22')]('SIP/%s',_0x36784f[_0x83a4('0x1e')]):_0x36784f[_0x83a4('0x25')];if(_0x49dd38[_0xa5ba39]['queuecallercomplete']){_0x49dd38[_0xa5ba39][_0x83a4('0x26')]=moment()[_0x83a4('0x22')](_0x83a4('0x27'));}if(_0x49dd38[_0xa5ba39]['queuecallerexit']){_0x49dd38[_0xa5ba39]['queuecallerexitAt']=moment()[_0x83a4('0x22')](_0x83a4('0x27'));}RpcMemberReport[_0x83a4('0x12')](_0x49dd38[_0xa5ba39]);}RpcVoiceQueueReport['create'](_0x49dd38[_0xa5ba39]);}};function extractCalleridNumber(_0x2af07d){var _0x5ba80c=_0x2af07d['match'](/<(.*?)>/);return _0x5ba80c?_0x5ba80c[0x1]:_0x2af07d;}Report[_0x83a4('0xe')][_0x83a4('0x28')]=function(_0x3f46c1){for(var _0x1593a9=0x0;_0x1593a9',_0x1e46e0[_0x83a4('0x3c')],_0x1e46e0['calleridnum']);}if(RpcVoiceTransferReport[_0x83a4('0x3d')][_0x1e46e0[_0x83a4('0x3e')]]){var _0x175981=RpcVoiceTransferReport['transfers'][_0x1e46e0[_0x83a4('0x3e')]];_0x175981['transfereelinkedid']=_0x1e46e0[_0x83a4('0x3f')];RpcVoiceTransferReport[_0x83a4('0x40')](_0x175981);delete RpcVoiceTransferReport[_0x83a4('0x3d')][_0x1e46e0['linkedid']];}if(_['isNil'](_0x1e46e0[_0x83a4('0x32')])){_0x1e46e0['type']=this[_0x83a4('0x41')](_0x1e46e0);}if(_['isNil'](_0x1e46e0[_0x83a4('0x42')])){var _0x1e09fe=_0x1e46e0['channel'][_0x83a4('0x2c')]('-')[0x0];var _0x137207=this[_0x83a4('0xd')][_0x1e09fe];if(!_0x137207)_0x137207=this[_0x83a4('0x28')](_0x1e46e0['accountcode']);if(_0x137207){_0x1e46e0['UserId']=_0x137207['id'];_0x1e46e0[_0x83a4('0x43')]=_0x137207[_0x83a4('0x1e')];}}RpcVoiceCallReport['create'](_0x1e46e0);if(_0x1e46e0['monitor']){for(var _0xd1d2d7=0x0;_0xd1d2d7<_0x1e46e0[_0x83a4('0x44')]['length'];_0xd1d2d7+=0x1){_0x1e46e0[_0x83a4('0x45')]=_0x1e46e0['monitors'][_0xd1d2d7][_0x83a4('0x46')];_0x1e46e0[_0x83a4('0x47')]=_0x1e46e0[_0x83a4('0x44')][_0xd1d2d7][_0x83a4('0x47')];if(_0x1e46e0[_0x83a4('0x31')]==_0x83a4('0x48')){_0x1e46e0['calleridnum']=_0x1e46e0['connectedlinenum'];_0x1e46e0[_0x83a4('0x3c')]=_0x1e46e0[_0x83a4('0x49')];_0x1e46e0[_0x83a4('0x24')]=_0x1e46e0[_0x83a4('0x1d')];_0x1e46e0[_0x83a4('0x49')]=_0x1e46e0[_0x83a4('0x43')];_0x1e46e0[_0x83a4('0x31')]=_0x1e46e0[_0x83a4('0x39')];}else if(_0x1e46e0['exten']=='xcally-motion-dialer'){_0x1e46e0[_0x83a4('0x2d')]=_0x1e46e0[_0x83a4('0x30')];_0x1e46e0[_0x83a4('0x31')]=_0x1e46e0['originatecalleridnum'];}RpcVoiceRecording[_0x83a4('0x4a')](_0x1e46e0);}}};Report[_0x83a4('0xe')][_0x83a4('0x16')]=function(_0x52b6d1){if(_[_0x83a4('0x4b')](_0x52b6d1)){_0x52b6d1[_0x83a4('0x4c')](function(_0x425be2){RpcVoiceAgentReport[_0x83a4('0x4a')](_0x425be2);});}else{RpcVoiceAgentReport[_0x83a4('0x4a')](_0x52b6d1);}};Report[_0x83a4('0xe')][_0x83a4('0x19')]=function(_0x5330e8){RpcVoiceDialReport[_0x83a4('0x4a')](_0x5330e8);var _0x62346;var _0xe6af8e;var _0x113c56=_0x5330e8['channel'];if(_[_0x83a4('0x4d')](_0x113c56,_0x83a4('0x4e'))){_0xe6af8e=_0x113c56[_0x83a4('0x4f')](_0x113c56[_0x83a4('0x50')]('/')+0x1,_0x113c56['indexOf']('@'));_0x62346=_[_0x83a4('0x21')](this[_0x83a4('0xd')],function(_0x3401e9){return _0x3401e9['mobile']==_0xe6af8e||_0x3401e9['phone']==_0xe6af8e||_0x3401e9['accountcode']==_0xe6af8e;});}else{_0xe6af8e=_0x113c56[_0x83a4('0x4f')](_0x113c56[_0x83a4('0x50')]('/')+0x1,_0x113c56['lastIndexOf']('-'));_0x62346=this[_0x83a4('0x1c')](_0xe6af8e);}if(_0x62346){_0x5330e8['interface']=_[_0x83a4('0x1f')](_0x62346['interface'])?util[_0x83a4('0x22')](_0x83a4('0x23'),_0x62346[_0x83a4('0x1e')]):_0x62346[_0x83a4('0x25')];_0x5330e8['membername']=_0x62346[_0x83a4('0x1e')];_0x5330e8['accountcode']=_0x62346[_0x83a4('0x1d')];RpcMemberReport[_0x83a4('0x19')](_0x5330e8);}};Report[_0x83a4('0xe')][_0x83a4('0x40')]=function(_0xb7c744){RpcVoiceTransferReport['transfers'][_0xb7c744[_0x83a4('0x51')]]=_0xb7c744;};Report[_0x83a4('0xe')][_0x83a4('0x52')]=function(_0x531305){RpcVoiceTransferReport['attendedTransfer'](_0x531305);};module[_0x83a4('0x53')]=Report; \ No newline at end of file +var _0x9812=['find','accountcode','name','isNil','interface','format','voiceQueueReport','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','length','getCallType','calleridnum','outbound','internal','voiceCallReport','destination','type','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','originatecalleridnum','channel','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','UserId','split','monitor','monitorFilename','monitors','filename','exten','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','membername','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent'];(function(_0x4f4295,_0xd5145b){var _0x178fa7=function(_0x418f90){while(--_0x418f90){_0x4f4295['push'](_0x4f4295['shift']());}};_0x178fa7(++_0xd5145b);}(_0x9812,0x156));var _0x2981=function(_0xcc764,_0x10bb42){_0xcc764=_0xcc764-0x0;var _0x497fdf=_0x9812[_0xcc764];return _0x497fdf;};'use strict';var _=require('lodash');var moment=require(_0x2981('0x0'));var util=require(_0x2981('0x1'));var config=require(_0x2981('0x2'));var ami=require(_0x2981('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x2981('0x4'));var RpcVoiceDialReport=require(_0x2981('0x5'));var RpcMemberReport=require(_0x2981('0x6'));var RpcVoiceQueueReport=require(_0x2981('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x2981('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x2981('0x9'));var VoiceDialReport=require(_0x2981('0xa'));var UserReport=require(_0x2981('0xb'));function Report(_0xa37f21){this[_0x2981('0xc')]=_0xa37f21;this[_0x2981('0xd')]=_0xa37f21[_0x2981('0xd')];this[_0x2981('0xe')]=_0xa37f21[_0x2981('0xe')];}Report[_0x2981('0xf')][_0x2981('0x10')]=function(_0x1d7abe){var _0x3741ae=new VoiceQueueReport(this[_0x2981('0xc')]);var _0x370889=new VoiceAgentReport(this[_0x2981('0xc')]);var _0x38f96e=new VoiceDialReport(this[_0x2981('0xc')]);var _0x4f2366=new VoiceCallReport(this[_0x2981('0xc')]);var _0x19171e=new UserReport(this['realtime']);if(config[_0x2981('0x11')]&&config[_0x2981('0x11')][_0x2981('0x12')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x2981('0x13')](this));ami['on'](_0x2981('0x14'),this['voiceCallReport'][_0x2981('0x13')](this));ami['on'](_0x2981('0x15'),this[_0x2981('0x16')][_0x2981('0x13')](this));ami['on'](_0x2981('0x17'),this[_0x2981('0x18')][_0x2981('0x13')](this));ami['on'](_0x2981('0x19'),this[_0x2981('0x1a')]['bind'](this));ami['on'](_0x2981('0x1b'),this[_0x2981('0x1c')]['bind'](this));}};Report[_0x2981('0xf')][_0x2981('0x1d')]=function(_0x1da074){var _0x46f757;_0x46f757=_[_0x2981('0x1e')](this['agents'],function(_0x5cb7ab){return _0x5cb7ab[_0x2981('0x1f')]==_0x1da074||_0x5cb7ab[_0x2981('0x20')]==_0x1da074;});if(_[_0x2981('0x21')](_0x46f757)){var _0x4bc240=_['find'](this['telephones'],function(_0x46454e){return _0x46454e['accountcode']==_0x1da074||_0x46454e[_0x2981('0x20')]==_0x1da074;});if(_0x4bc240){_0x46f757=_[_0x2981('0x1e')](this[_0x2981('0xd')],function(_0x576d89){return _0x576d89[_0x2981('0x22')]==util[_0x2981('0x23')]('SIP/%s',_0x4bc240[_0x2981('0x20')]);});}}return _0x46f757;};Report['prototype'][_0x2981('0x24')]=function(_0x3ea58d){for(var _0x3e265d=0x0;_0x3e265d<_0x3ea58d['length'];_0x3e265d+=0x1){var _0x482c8b=this['findAgent'](_0x3ea58d[_0x3e265d][_0x2981('0x25')]);if(_0x482c8b){_0x3ea58d[_0x3e265d][_0x2981('0x1f')]=_0x482c8b[_0x2981('0x1f')];_0x3ea58d[_0x3e265d][_0x2981('0x26')]=!![];_0x3ea58d[_0x3e265d][_0x2981('0x27')]=_0x482c8b[_0x2981('0x20')];_0x3ea58d[_0x3e265d][_0x2981('0x22')]=_[_0x2981('0x21')](_0x482c8b[_0x2981('0x22')])?util[_0x2981('0x23')](_0x2981('0x28'),_0x482c8b[_0x2981('0x20')]):_0x482c8b['interface'];if(_0x3ea58d[_0x3e265d][_0x2981('0x29')]){_0x3ea58d[_0x3e265d][_0x2981('0x2a')]=moment()[_0x2981('0x23')](_0x2981('0x2b'));}if(_0x3ea58d[_0x3e265d][_0x2981('0x2c')]){_0x3ea58d[_0x3e265d]['queuecallerexitAt']=moment()['format'](_0x2981('0x2b'));}RpcMemberReport[_0x2981('0x24')](_0x3ea58d[_0x3e265d]);}RpcVoiceQueueReport[_0x2981('0x2d')](_0x3ea58d[_0x3e265d]);}};function extractCalleridNumber(_0x451b47){var _0x314a3a=_0x451b47[_0x2981('0x2e')](/<(.*?)>/);return _0x314a3a?_0x314a3a[0x1]:_0x451b47;}Report[_0x2981('0xf')][_0x2981('0x2f')]=function(_0x4d0bd9){for(var _0x2fb79a=0x0;_0x2fb79a0x0?_0x47181a:0x0;this[_0x4a7a('0x13')][_0x1e832b[_0x4a7a('0x67')]]['talking']=this[_0x4a7a('0x13')][_0x1e832b['queue']][_0x4a7a('0x33')]>_[_0x4a7a('0x6c')](_0x1e832b[_0x4a7a('0x6e')])?_[_0x4a7a('0x6c')](_0x1e832b[_0x4a7a('0x6e')]):this[_0x4a7a('0x13')][_0x1e832b[_0x4a7a('0x67')]][_0x4a7a('0x33')];this['emitVoiceQueueSummary'](this[_0x4a7a('0x13')][_0x1e832b[_0x4a7a('0x67')]],_0x4a7a('0x16'));}logger[_0x4a7a('0x47')](_0x4a7a('0x6f'),util[_0x4a7a('0x3f')](this[_0x4a7a('0x13')][_0x1e832b[_0x4a7a('0x67')]],{'showHidden':![],'depth':null}));ami[_0x4a7a('0x45')](_0x4a7a('0x70'),this[_0x4a7a('0x13')][_0x1e832b[_0x4a7a('0x67')]]);}}}catch(_0x5db71a){logger[_0x4a7a('0x3d')](_0x4a7a('0x66'),util[_0x4a7a('0x3f')](_0x5db71a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')]['syncQueueSummaryComplete']=function(_0x2fb388){logger[_0x4a7a('0x47')](_0x4a7a('0x71'),util['inspect'](_0x2fb388,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x4a7a('0x1b')]=function(_0x4e18c6){try{if(this['isNotNull'](_0x4e18c6)){logger[_0x4a7a('0x47')](_0x4a7a('0x72'),_0x4e18c6[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x4e18c6,{'showHidden':![],'depth':null}));if(_[_0x4a7a('0x73')](this[_0x4a7a('0x10')][_0x4e18c6[_0x4a7a('0x4d')]]))this[_0x4a7a('0x10')][_0x4e18c6['uniqueid']]=[];if(_[_0x4a7a('0x73')](this['channels'][_0x4e18c6[_0x4a7a('0x4d')]]))this[_0x4a7a('0x12')][_0x4e18c6[_0x4a7a('0x4d')]]={};var _0x329e14=new QueueReport();_0x329e14['name']=_0x4e18c6['queue'];_0x329e14['type']=this[_0x4a7a('0x13')][_0x329e14[_0x4a7a('0x4a')]]&&this[_0x4a7a('0x13')][_0x329e14[_0x4a7a('0x4a')]][_0x4a7a('0x50')]?this['voiceQueues'][_0x329e14['name']][_0x4a7a('0x50')]||_0x4a7a('0x51'):'inbound';_0x329e14[_0x4a7a('0x67')]=_0x4e18c6[_0x4a7a('0x67')];_0x329e14[_0x4a7a('0x74')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x329e14[_0x4a7a('0x76')]=_0x4e18c6[_0x4a7a('0x76')];_0x329e14[_0x4a7a('0x77')]=_0x4e18c6[_0x4a7a('0x77')];_0x329e14[_0x4a7a('0x4d')]=_0x4e18c6['uniqueid'];_0x329e14[_0x4a7a('0x78')]=this[_0x4a7a('0x12')][_0x4e18c6[_0x4a7a('0x4d')]][_0x4a7a('0x78')];logger[_0x4a7a('0x69')](_0x4a7a('0x79'),_0x329e14['name'],_0x329e14[_0x4a7a('0x50')]);_[_0x4a7a('0x7a')](_0x329e14,_['pick'](_0x4e18c6,_['keys'](_0x329e14)));this[_0x4a7a('0x10')][_0x4e18c6['uniqueid']][_0x4a7a('0x7b')](_0x329e14);this[_0x4a7a('0x12')][_0x4e18c6[_0x4a7a('0x4d')]]=_0x329e14;this['emitVoiceQueueChannelSave'](_0x329e14,_0x4a7a('0x7c'));}}catch(_0x564e01){logger[_0x4a7a('0x3d')](_0x4a7a('0x72'),_0x4e18c6['uniqueid'],util['inspect'](_0x564e01,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')][_0x4a7a('0x1d')]=function(_0x12d070){try{if(this[_0x4a7a('0x60')](_0x12d070)){logger[_0x4a7a('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x12d070[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x12d070,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x12d070[_0x4a7a('0x4d')]]){var _0x38950d=_['last'](this[_0x4a7a('0x10')][_0x12d070[_0x4a7a('0x4d')]]);_0x38950d['queuecallercomplete']=![];_0x38950d[_0x4a7a('0x7d')]=null;_0x38950d[_0x4a7a('0x7e')]=_0x12d070[_0x4a7a('0x7e')];_0x38950d['originalposition']=_0x12d070[_0x4a7a('0x7f')];_0x38950d['queuecallerabandon']=!![];_0x38950d['queuecallerabandonAt']=moment()[_0x4a7a('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x38950d[_0x4a7a('0x80')]=_0x4a7a('0x81');_0x38950d[_0x4a7a('0x82')]=null;logger[_0x4a7a('0x69')](_0x4a7a('0x83'),_0x38950d[_0x4a7a('0x4a')],_0x38950d[_0x4a7a('0x50')]);this[_0x4a7a('0x12')][_0x12d070[_0x4a7a('0x4d')]]=_0x38950d;this[_0x4a7a('0x43')](_0x38950d,_0x4a7a('0x1c'));}}}catch(_0x1f3b45){logger[_0x4a7a('0x3d')](_0x4a7a('0x84'),_0x12d070['uniqueid'],util[_0x4a7a('0x3f')](_0x1f3b45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')][_0x4a7a('0x1f')]=function(_0x248f77){try{if(this[_0x4a7a('0x60')](_0x248f77)){logger[_0x4a7a('0x47')](_0x4a7a('0x85'),_0x248f77[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x248f77,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x10')][_0x248f77['uniqueid']]){var _0x53199f=_['last'](this[_0x4a7a('0x10')][_0x248f77[_0x4a7a('0x4d')]]);_0x53199f[_0x4a7a('0x86')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x53199f['connectedlinenum']=_0x248f77[_0x4a7a('0x87')];_0x53199f[_0x4a7a('0x88')]=_0x248f77['connectedlinename'];logger[_0x4a7a('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x53199f[_0x4a7a('0x4a')],_0x53199f['type'],_0x248f77['connectedlinenum'],_0x248f77['connectedlinename']);this[_0x4a7a('0x12')][_0x248f77[_0x4a7a('0x4d')]]=_0x53199f;this[_0x4a7a('0x46')](_0x53199f,_0x4a7a('0x1e'));}}}catch(_0x1efce4){logger[_0x4a7a('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x248f77[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x1efce4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')]['syncAgentConnect']=function(_0xf34e4a){try{if(this[_0x4a7a('0x60')](_0xf34e4a)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0xf34e4a[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0xf34e4a,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x10')][_0xf34e4a[_0x4a7a('0x4d')]]){var _0x10cc14=_[_0x4a7a('0x89')](this[_0x4a7a('0x10')][_0xf34e4a[_0x4a7a('0x4d')]]);_0x10cc14['queuecallercomplete']=!![];_0x10cc14[_0x4a7a('0x80')]=_0x4a7a('0x8a');logger['info'](_0x4a7a('0x8b'),_0x10cc14[_0x4a7a('0x4a')],_0x10cc14['type']);}}}catch(_0xfa8478){logger[_0x4a7a('0x3d')](_0x4a7a('0x8c'),_0xf34e4a[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0xfa8478,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')][_0x4a7a('0x8d')]=function(_0x2016f7){try{if(this['isNotNull'](_0x2016f7)){logger['debug'](_0x4a7a('0x8e'),_0x2016f7[_0x4a7a('0x4d')],util['inspect'](_0x2016f7,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x10')][_0x2016f7[_0x4a7a('0x4d')]]){var _0x14083e=_[_0x4a7a('0x89')](this['queueReports'][_0x2016f7['uniqueid']]);_0x14083e[_0x4a7a('0x1c')]=![];_0x14083e[_0x4a7a('0x8f')]=null;_0x14083e[_0x4a7a('0x90')]=!![];_0x14083e[_0x4a7a('0x82')]=_0x2016f7[_0x4a7a('0x91')];_0x14083e['holdtime']=_0x2016f7[_0x4a7a('0x7e')];_0x14083e[_0x4a7a('0x92')]=!![];_0x14083e[_0x4a7a('0x93')]=![];_0x14083e[_0x4a7a('0x94')]=null;if(!_0x14083e['transfer']){if(_0x2016f7[_0x4a7a('0x95')]==_0x4a7a('0x96')){_0x14083e[_0x4a7a('0x80')]=_0x4a7a('0x97');logger[_0x4a7a('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x14083e[_0x4a7a('0x4a')],_0x14083e[_0x4a7a('0x50')]);}else{if(_[_0x4a7a('0x98')](_0x2016f7[_0x4a7a('0x99')]['toLowerCase'](),_0x4a7a('0x9a'))){if(this['queueReports'][_0x2016f7[_0x4a7a('0x9b')]]){var _0x4510cc=_[_0x4a7a('0x89')](this[_0x4a7a('0x10')][_0x2016f7['linkedid']]);_0x4510cc[_0x4a7a('0x92')]=![];_0x4510cc[_0x4a7a('0x93')]=!![];_0x4510cc[_0x4a7a('0x94')]=moment(_0x14083e[_0x4a7a('0x74')])[_0x4a7a('0x9c')](_0x2016f7[_0x4a7a('0x7e')],_0x4a7a('0x9d'))[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x4510cc[_0x4a7a('0x80')]=_0x4a7a('0x9e');_0x4510cc[_0x4a7a('0x96')]=!![];_0x4510cc[_0x4a7a('0x9f')]='FORWARD';_0x4510cc['transferexten']=_0x2016f7[_0x4a7a('0xa0')];_0x4510cc['transferuniqueid']=_0x2016f7[_0x4a7a('0x4d')];logger[_0x4a7a('0x69')](_0x4a7a('0xa1'),_0x4510cc['name'],_0x4510cc[_0x4a7a('0x50')]);var _0x2637af=this[_0x4a7a('0x10')][_0x2016f7[_0x4a7a('0x9b')]];this[_0x4a7a('0x10')][_0x2016f7[_0x4a7a('0x9b')]]=this[_0x4a7a('0x10')][_0x2016f7[_0x4a7a('0x4d')]];this['queueReports'][_0x2016f7[_0x4a7a('0x4d')]]=_0x2637af;}}else{_0x14083e[_0x4a7a('0x80')]='COMPLETEDBY'+_0x2016f7[_0x4a7a('0x95')][_0x4a7a('0xa2')]();logger[_0x4a7a('0x69')](_0x4a7a('0xa3'),_0x14083e[_0x4a7a('0x4a')],_0x14083e[_0x4a7a('0x50')],_0x14083e['queuecallerexitreason']);}}}this[_0x4a7a('0x12')][_0x2016f7[_0x4a7a('0x4d')]]=_0x14083e;this[_0x4a7a('0x43')](_0x14083e,_0x4a7a('0x20'));}}}catch(_0xbdd9ef){logger[_0x4a7a('0x3d')](_0x4a7a('0x8e'),_0x2016f7[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0xbdd9ef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')]['syncVarSet']=function(_0x8408b3){try{if(this[_0x4a7a('0x60')](_0x8408b3)){logger[_0x4a7a('0x47')](_0x4a7a('0xa4'),_0x8408b3[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x8408b3,{'showHidden':![],'depth':null}));this['addVariable'](_0x8408b3[_0x4a7a('0x4d')],_[_0x4a7a('0xa5')](_0x8408b3[_0x4a7a('0xa6')])[0x0],_0x8408b3[_0x4a7a('0xa7')]);if(this['queueReports'][_0x8408b3[_0x4a7a('0x4d')]]){var _0x51f30c=_[_0x4a7a('0x89')](this[_0x4a7a('0x10')][_0x8408b3[_0x4a7a('0x4d')]]);if(_0x51f30c){if(this[_0x4a7a('0x60')](_0x8408b3[_0x4a7a('0xa6')])&&this[_0x4a7a('0x60')](_0x8408b3['variable'][_0x4a7a('0xa8')])){switch(_0x8408b3[_0x4a7a('0xa7')]){case _0x4a7a('0xa9'):_0x51f30c['queuecallerexit']=![];_0x51f30c[_0x4a7a('0x94')]=null;break;case _0x4a7a('0xaa'):_0x51f30c[_0x4a7a('0xab')]=_0x4a7a('0xac');_0x51f30c[_0x4a7a('0x93')]=!![];_0x51f30c['queuecallerexitAt']=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x51f30c['queuecallerleaveAt']=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));logger[_0x4a7a('0x47')](_0x4a7a('0xad'),_0x8408b3['uniqueid'],util[_0x4a7a('0x3f')](_0x51f30c,{'showHidden':![],'depth':null}));ami[_0x4a7a('0x45')]('custom:timeout',_0x51f30c);break;default:_0x51f30c[_0x4a7a('0x93')]=!![];_0x51f30c[_0x4a7a('0x94')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x51f30c[_0x4a7a('0x86')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));}_0x51f30c[_0x4a7a('0x1c')]=![];_0x51f30c[_0x4a7a('0x8f')]=null;_0x51f30c[_0x4a7a('0x80')]=_0x8408b3[_0x4a7a('0xa7')];this[_0x4a7a('0x12')][_0x8408b3[_0x4a7a('0x4d')]]=_0x51f30c;this[_0x4a7a('0x43')](_0x51f30c,_0x4a7a('0x23'));}else if(this[_0x4a7a('0x60')](_0x8408b3[_0x4a7a('0xa6')])&&this[_0x4a7a('0x60')](_0x8408b3[_0x4a7a('0xa6')][_0x4a7a('0xae')])){if(!_0x51f30c[_0x4a7a('0x1c')]){_0x51f30c[_0x4a7a('0x93')]=!![];_0x51f30c[_0x4a7a('0x94')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));_0x51f30c['queuecallerexitreason']=_0x4a7a('0xaf');_0x51f30c[_0x4a7a('0x86')]=moment()[_0x4a7a('0x49')](_0x4a7a('0x75'));this[_0x4a7a('0x12')][_0x8408b3[_0x4a7a('0x4d')]]=_0x51f30c;}}logger[_0x4a7a('0x69')](_0x4a7a('0xb0'),_0x8408b3['uniqueid'],_0x51f30c['name'],_0x51f30c[_0x4a7a('0x50')],_['keys'](_0x8408b3[_0x4a7a('0xa6')])[0x0],_0x8408b3[_0x4a7a('0xa7')]);_0x51f30c['variables']=this[_0x4a7a('0x15')][_0x8408b3[_0x4a7a('0x4d')]];}}}}catch(_0x504ab8){logger[_0x4a7a('0x3d')](_0x4a7a('0xa4'),_0x8408b3['uniqueid'],util[_0x4a7a('0x3f')](_0x504ab8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4a7a('0xb')][_0x4a7a('0xb1')]=function(_0x35c0e6,_0x349fce,_0x188ba2){var _0x4f2d7a=[_0x4a7a('0xb2'),_0x4a7a('0xb3'),_0x4a7a('0xb4'),'rtpaudioqosjitterbridged',_0x4a7a('0xb5'),_0x4a7a('0xb6'),_0x4a7a('0xb7'),'rtpaudioqosrttbridged',_0x4a7a('0xb8'),_0x4a7a('0xb9'),'bridgepeer','bridgepvtcallid',_0x4a7a('0xba'),'memberdynamic',_0x4a7a('0xbb'),_0x4a7a('0xbc'),_0x4a7a('0x91'),_0x4a7a('0xbd'),_0x4a7a('0xbe')];if(!_[_0x4a7a('0x39')](_0x349fce)&&!_[_0x4a7a('0xbf')](_0x4f2d7a,_0x349fce)){if(_[_0x4a7a('0x73')](this[_0x4a7a('0x15')][_0x35c0e6])){this[_0x4a7a('0x15')][_0x35c0e6]={};}this['variables'][_0x35c0e6][_0x349fce]=_0x188ba2;}};VoiceQueueReport[_0x4a7a('0xb')][_0x4a7a('0x25')]=function(_0x44a477){try{if(this[_0x4a7a('0x60')](_0x44a477)){logger[_0x4a7a('0x47')](_0x4a7a('0xc0'),_0x44a477[_0x4a7a('0x4d')],util[_0x4a7a('0x3f')](_0x44a477,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x10')][_0x44a477['uniqueid']]){for(var _0x32064b=0x0,_0x1ca586={};_0x32064b0x0?_0x4cad15:0x0;this['voiceQueues'][_0x5d17f2[_0xd84f('0x63')]]['talking']=this[_0xd84f('0x11')][_0x5d17f2[_0xd84f('0x63')]][_0xd84f('0x2c')]>_['toNumber'](_0x5d17f2[_0xd84f('0x69')])?_[_0xd84f('0x68')](_0x5d17f2[_0xd84f('0x69')]):this[_0xd84f('0x11')][_0x5d17f2['queue']]['talking'];this[_0xd84f('0x6b')](this['voiceQueues'][_0x5d17f2['queue']],_0xd84f('0x15'));}logger[_0xd84f('0x44')](_0xd84f('0x6c'),util['inspect'](this[_0xd84f('0x11')][_0x5d17f2['queue']],{'showHidden':![],'depth':null}));ami[_0xd84f('0x42')](_0xd84f('0x6d'),this[_0xd84f('0x11')][_0x5d17f2[_0xd84f('0x63')]]);}}}catch(_0x349171){logger['error']('[voiceQueueReport][queuesummary]',util[_0xd84f('0x3b')](_0x349171,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')]['syncQueueSummaryComplete']=function(_0x442a33){logger[_0xd84f('0x44')](_0xd84f('0x6e'),util[_0xd84f('0x3b')](_0x442a33,{'showHidden':![],'depth':null}));this[_0xd84f('0x12')]=!![];};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x19')]=function(_0x551921){try{if(this['isNotNull'](_0x551921)){logger['debug'](_0xd84f('0x6f'),_0x551921[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x551921,{'showHidden':![],'depth':null}));if(_[_0xd84f('0x5b')](this[_0xd84f('0x3a')][_0x551921[_0xd84f('0x45')]]))this[_0xd84f('0x3a')][_0x551921[_0xd84f('0x45')]]=[];if(_['isUndefined'](this['channels'][_0x551921[_0xd84f('0x45')]]))this[_0xd84f('0x10')][_0x551921[_0xd84f('0x45')]]={};var _0xc11078=new QueueReport();_0xc11078[_0xd84f('0x48')]=_0x551921['queue'];_0xc11078['type']=this['voiceQueues'][_0xc11078[_0xd84f('0x48')]]&&this[_0xd84f('0x11')][_0xc11078['name']][_0xd84f('0x4b')]?this[_0xd84f('0x11')][_0xc11078[_0xd84f('0x48')]][_0xd84f('0x4b')]||_0xd84f('0x4c'):_0xd84f('0x4c');_0xc11078[_0xd84f('0x63')]=_0x551921[_0xd84f('0x63')];_0xc11078[_0xd84f('0x70')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc11078['position']=_0x551921['position'];_0xc11078[_0xd84f('0x71')]=_0x551921['count'];_0xc11078['uniqueid']=_0x551921[_0xd84f('0x45')];_0xc11078[_0xd84f('0x72')]=this[_0xd84f('0x10')][_0x551921[_0xd84f('0x45')]]['routealias'];logger['info'](_0xd84f('0x73'),_0xc11078[_0xd84f('0x48')],_0xc11078[_0xd84f('0x4b')]);_[_0xd84f('0x74')](_0xc11078,_['pick'](_0x551921,_[_0xd84f('0x75')](_0xc11078)));this[_0xd84f('0x3a')][_0x551921[_0xd84f('0x45')]]['push'](_0xc11078);this['channels'][_0x551921[_0xd84f('0x45')]]=_0xc11078;this[_0xd84f('0x43')](_0xc11078,_0xd84f('0x18'));}}catch(_0x25ec70){logger[_0xd84f('0x38')](_0xd84f('0x6f'),_0x551921[_0xd84f('0x45')],util['inspect'](_0x25ec70,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x1b')]=function(_0x41598d){try{if(this[_0xd84f('0x61')](_0x41598d)){logger['debug'](_0xd84f('0x76'),_0x41598d[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x41598d,{'showHidden':![],'depth':null}));if(this[_0xd84f('0x3a')][_0x41598d[_0xd84f('0x45')]]){var _0x5574c0=_[_0xd84f('0x77')](this[_0xd84f('0x3a')][_0x41598d['uniqueid']]);_0x5574c0['queuecallercomplete']=![];_0x5574c0[_0xd84f('0x78')]=null;_0x5574c0[_0xd84f('0x79')]=_0x41598d[_0xd84f('0x79')];_0x5574c0[_0xd84f('0x7a')]=_0x41598d[_0xd84f('0x7a')];_0x5574c0[_0xd84f('0x1a')]=!![];_0x5574c0[_0xd84f('0x7b')]=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));_0x5574c0['queuecallerexitreason']='ABANDONED';_0x5574c0[_0xd84f('0x7d')]=null;logger[_0xd84f('0x64')](_0xd84f('0x7e'),_0x5574c0[_0xd84f('0x48')],_0x5574c0[_0xd84f('0x4b')]);this[_0xd84f('0x10')][_0x41598d[_0xd84f('0x45')]]=_0x5574c0;this[_0xd84f('0x40')](_0x5574c0,_0xd84f('0x1a'));}}}catch(_0x307f90){logger['error'](_0xd84f('0x76'),_0x41598d[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x307f90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x7f')]=function(_0x4d9607){try{if(this[_0xd84f('0x61')](_0x4d9607)){logger['debug'](_0xd84f('0x80'),_0x4d9607[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x4d9607,{'showHidden':![],'depth':null}));if(this[_0xd84f('0x3a')][_0x4d9607[_0xd84f('0x45')]]){var _0x126989=_['last'](this[_0xd84f('0x3a')][_0x4d9607[_0xd84f('0x45')]]);_0x126989[_0xd84f('0x81')]=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));_0x126989['connectedlinenum']=_0x4d9607[_0xd84f('0x82')];_0x126989['connectedlinename']=_0x4d9607['connectedlinename'];logger[_0xd84f('0x64')](_0xd84f('0x83'),_0x126989[_0xd84f('0x48')],_0x126989[_0xd84f('0x4b')],_0x4d9607[_0xd84f('0x82')],_0x4d9607[_0xd84f('0x84')]);this[_0xd84f('0x10')][_0x4d9607[_0xd84f('0x45')]]=_0x126989;this[_0xd84f('0x43')](_0x126989,_0xd84f('0x1c'));}}}catch(_0x58944e){logger[_0xd84f('0x38')](_0xd84f('0x80'),_0x4d9607[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x58944e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x85')]=function(_0x3fdbb0){try{if(this[_0xd84f('0x61')](_0x3fdbb0)){logger[_0xd84f('0x44')]('[%s][voiceQueueReport][agentconnect]',_0x3fdbb0[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x3fdbb0,{'showHidden':![],'depth':null}));if(this[_0xd84f('0x3a')][_0x3fdbb0['uniqueid']]){var _0x42a1d8=_[_0xd84f('0x77')](this['queueReports'][_0x3fdbb0[_0xd84f('0x45')]]);_0x42a1d8[_0xd84f('0x86')]=!![];_0x42a1d8[_0xd84f('0x87')]=_0xd84f('0x88');logger[_0xd84f('0x64')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x42a1d8[_0xd84f('0x48')],_0x42a1d8[_0xd84f('0x4b')]);}}}catch(_0x1e5a92){logger[_0xd84f('0x38')](_0xd84f('0x89'),_0x3fdbb0['uniqueid'],util[_0xd84f('0x3b')](_0x1e5a92,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x1e')]=function(_0x35e134){try{if(this[_0xd84f('0x61')](_0x35e134)){logger['debug'](_0xd84f('0x8a'),_0x35e134[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x35e134,{'showHidden':![],'depth':null}));if(this[_0xd84f('0x3a')][_0x35e134[_0xd84f('0x45')]]){var _0x4abff0=_[_0xd84f('0x77')](this[_0xd84f('0x3a')][_0x35e134['uniqueid']]);_0x4abff0[_0xd84f('0x1a')]=![];_0x4abff0['queuecallerabandonAt']=null;_0x4abff0[_0xd84f('0x8b')]=!![];_0x4abff0[_0xd84f('0x7d')]=_0x35e134['membername'];_0x4abff0['holdtime']=_0x35e134[_0xd84f('0x79')];_0x4abff0['queuecallercomplete']=!![];_0x4abff0[_0xd84f('0x8c')]=![];_0x4abff0[_0xd84f('0x8d')]=null;if(!_0x4abff0[_0xd84f('0x8e')]){if(_0x35e134['reason']==_0xd84f('0x8e')){_0x4abff0[_0xd84f('0x87')]=_0xd84f('0x8f');logger['info'](_0xd84f('0x90'),_0x4abff0['name'],_0x4abff0[_0xd84f('0x4b')]);}else{if(_[_0xd84f('0x91')](_0x35e134[_0xd84f('0x35')][_0xd84f('0x92')](),'local/')){if(this[_0xd84f('0x3a')][_0x35e134[_0xd84f('0x93')]]){var _0x193cc1=_[_0xd84f('0x77')](this[_0xd84f('0x3a')][_0x35e134[_0xd84f('0x93')]]);_0x193cc1[_0xd84f('0x86')]=![];_0x193cc1['queuecallerexit']=!![];_0x193cc1[_0xd84f('0x8d')]=moment(_0x4abff0[_0xd84f('0x70')])[_0xd84f('0x94')](_0x35e134[_0xd84f('0x79')],_0xd84f('0x95'))[_0xd84f('0x46')](_0xd84f('0x7c'));_0x193cc1['queuecallerexitreason']='FORWARDTRANSFER';_0x193cc1['transfer']=!![];_0x193cc1[_0xd84f('0x96')]=_0xd84f('0x97');_0x193cc1['transferexten']=_0x35e134['destexten'];_0x193cc1[_0xd84f('0x98')]=_0x35e134['uniqueid'];logger[_0xd84f('0x64')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x193cc1['name'],_0x193cc1['type']);var _0x489232=this[_0xd84f('0x3a')][_0x35e134['linkedid']];this['queueReports'][_0x35e134[_0xd84f('0x93')]]=this[_0xd84f('0x3a')][_0x35e134[_0xd84f('0x45')]];this['queueReports'][_0x35e134[_0xd84f('0x45')]]=_0x489232;}}else{_0x4abff0[_0xd84f('0x87')]=_0xd84f('0x99')+_0x35e134[_0xd84f('0x9a')][_0xd84f('0x9b')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x4abff0['name'],_0x4abff0[_0xd84f('0x4b')],_0x4abff0[_0xd84f('0x87')]);}}}this[_0xd84f('0x10')][_0x35e134['uniqueid']]=_0x4abff0;this['emitVoiceQueueChannelRemove'](_0x4abff0,_0xd84f('0x1d'));}}}catch(_0x3c031d){logger[_0xd84f('0x38')](_0xd84f('0x8a'),_0x35e134[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x3c031d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0x20')]=function(_0x223cae){try{if(this[_0xd84f('0x61')](_0x223cae)){logger['debug'](_0xd84f('0x9c'),_0x223cae['uniqueid'],util[_0xd84f('0x3b')](_0x223cae,{'showHidden':![],'depth':null}));this['addVariable'](_0x223cae['uniqueid'],_[_0xd84f('0x75')](_0x223cae[_0xd84f('0x9d')])[0x0],_0x223cae[_0xd84f('0x9e')]);if(this[_0xd84f('0x3a')][_0x223cae[_0xd84f('0x45')]]){var _0x335942=_[_0xd84f('0x77')](this[_0xd84f('0x3a')][_0x223cae[_0xd84f('0x45')]]);if(_0x335942){if(this['isNotNull'](_0x223cae[_0xd84f('0x9d')])&&this[_0xd84f('0x61')](_0x223cae[_0xd84f('0x9d')][_0xd84f('0x9f')])){switch(_0x223cae[_0xd84f('0x9e')]){case'CONTINUE':_0x335942['queuecallerexit']=![];_0x335942[_0xd84f('0x8d')]=null;break;case'TIMEOUT':_0x335942[_0xd84f('0xa0')]=_0xd84f('0xa1');_0x335942['queuecallerexit']=!![];_0x335942[_0xd84f('0x8d')]=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));_0x335942['queuecallerleaveAt']=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));logger[_0xd84f('0x44')](_0xd84f('0xa2'),_0x223cae['uniqueid'],util['inspect'](_0x335942,{'showHidden':![],'depth':null}));ami[_0xd84f('0x42')]('custom:timeout',_0x335942);break;default:_0x335942[_0xd84f('0x8c')]=!![];_0x335942['queuecallerexitAt']=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));_0x335942[_0xd84f('0x81')]=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));}_0x335942[_0xd84f('0x1a')]=![];_0x335942[_0xd84f('0x7b')]=null;_0x335942[_0xd84f('0x87')]=_0x223cae['value'];this['channels'][_0x223cae[_0xd84f('0x45')]]=_0x335942;this[_0xd84f('0x40')](_0x335942,_0xd84f('0x1f'));}else if(this[_0xd84f('0x61')](_0x223cae[_0xd84f('0x9d')])&&this[_0xd84f('0x61')](_0x223cae['variable']['queueposition'])){if(!_0x335942[_0xd84f('0x1a')]){_0x335942[_0xd84f('0x8c')]=!![];_0x335942[_0xd84f('0x8d')]=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));_0x335942[_0xd84f('0x87')]=_0xd84f('0xa3');_0x335942['queuecallerleaveAt']=moment()[_0xd84f('0x46')](_0xd84f('0x7c'));this[_0xd84f('0x10')][_0x223cae[_0xd84f('0x45')]]=_0x335942;}}logger[_0xd84f('0x64')](_0xd84f('0xa4'),_0x223cae[_0xd84f('0x45')],_0x335942[_0xd84f('0x48')],_0x335942[_0xd84f('0x4b')],_[_0xd84f('0x75')](_0x223cae[_0xd84f('0x9d')])[0x0],_0x223cae[_0xd84f('0x9e')]);_0x335942[_0xd84f('0x14')]=this[_0xd84f('0x14')][_0x223cae[_0xd84f('0x45')]];}}}}catch(_0x226fb0){logger[_0xd84f('0x38')](_0xd84f('0x9c'),_0x223cae[_0xd84f('0x45')],util[_0xd84f('0x3b')](_0x226fb0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd84f('0xb')][_0xd84f('0xa5')]=function(_0x49ca9d,_0x490e3c,_0x445b55){var _0x543877=['rtpaudioqos','rtpaudioqosbridged',_0xd84f('0xa6'),'rtpaudioqosjitterbridged',_0xd84f('0xa7'),_0xd84f('0xa8'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer',_0xd84f('0xa9'),_0xd84f('0xaa'),_0xd84f('0xab'),_0xd84f('0xac'),_0xd84f('0xad'),'membername',_0xd84f('0xae'),_0xd84f('0xaf')];if(!_[_0xd84f('0x32')](_0x490e3c)&&!_[_0xd84f('0xb0')](_0x543877,_0x490e3c)){if(_[_0xd84f('0x5b')](this['variables'][_0x49ca9d])){this[_0xd84f('0x14')][_0x49ca9d]={};}this[_0xd84f('0x14')][_0x49ca9d][_0x490e3c]=_0x445b55;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x49d8cd){try{if(this[_0xd84f('0x61')](_0x49d8cd)){logger[_0xd84f('0x44')](_0xd84f('0xb1'),_0x49d8cd['uniqueid'],util[_0xd84f('0x3b')](_0x49d8cd,{'showHidden':![],'depth':null}));if(this[_0xd84f('0x3a')][_0x49d8cd[_0xd84f('0x45')]]){for(var _0x20f594=0x0,_0x2c4520={};_0x20f594=0x0?moment(_0xa6c045[_0x21df('0x19')])[_0x21df('0xd')](_0xa6c045['starttime'],_0x21df('0xe')):null,'data1':_0x21df('0x1a'),'data2':_0xa6c045[_0x21df('0x14')],'data3':_0xa6c045[_0x21df('0x11')],'data4':_0xa6c045[_0x21df('0x1b')]||null,'role':_0x21df('0x12'),'internal':_0xa6c045[_0x21df('0x14')]?_['toNumber'](_0xa6c045[_0x21df('0x14')]):undefined,'uniqueid':_0xa6c045[_0x21df('0x15')]},'log':_0x21df('0x6')});}; \ No newline at end of file +var _0x5475=['format','TALKING','diff','queuecallerleaveAt','seconds','inbound','agent','toNumber','accountcode','uniqueid','voiceDialReport','Request','CreateMemberReport','voice','starttime','endtime','outbound','exten','moment','lodash','util','../client','queuecallercompleteAt','lastAssignedTo','isNil','interface'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5475,0xae));var _0x5547=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x5475[_0x381589];return _0x2a075d;};'use strict';var moment=require(_0x5547('0x0'));var _=require(_0x5547('0x1'));var util=require(_0x5547('0x2'));var client=require(_0x5547('0x3'));exports['voiceQueueReport']=function(_0x47c7b3){var _0x2f27e3=_0x47c7b3[_0x5547('0x4')]||_0x47c7b3['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x47c7b3[_0x5547('0x5')],'interface':_[_0x5547('0x6')](_0x47c7b3[_0x5547('0x7')])?util[_0x5547('0x8')]('SIP/%s',_0x47c7b3['lastAssignedTo']):_0x47c7b3[_0x5547('0x7')],'type':_0x5547('0x9'),'enterAt':_0x47c7b3['queuecallerleaveAt'],'exitAt':_0x2f27e3,'duration':moment(_0x2f27e3)[_0x5547('0xa')](_0x47c7b3[_0x5547('0xb')],_0x5547('0xc')),'data1':_0x5547('0xd'),'data2':_0x47c7b3['calleridnum'],'data3':_0x47c7b3['exten'],'data4':null,'data5':_0x47c7b3['queue'],'role':_0x5547('0xe'),'internal':_0x47c7b3['accountcode']?_[_0x5547('0xf')](_0x47c7b3[_0x5547('0x10')]):undefined,'uniqueid':_0x47c7b3[_0x5547('0x11')]},'log':'CreateMemberReport'});};exports[_0x5547('0x12')]=function(_0x2ca66f){return client[_0x5547('0x13')](_0x5547('0x14'),{'body':{'channel':_0x5547('0x15'),'membername':_0x2ca66f['membername'],'interface':_0x2ca66f[_0x5547('0x7')],'type':'TALKING','enterAt':_0x2ca66f['starttime'],'exitAt':_0x2ca66f['endtime'],'duration':moment(_0x2ca66f['endtime'])[_0x5547('0xa')](_0x2ca66f[_0x5547('0x16')],_0x5547('0xc'))>=0x0?moment(_0x2ca66f[_0x5547('0x17')])[_0x5547('0xa')](_0x2ca66f['starttime'],_0x5547('0xc')):null,'data1':_0x5547('0x18'),'data2':_0x2ca66f[_0x5547('0x10')],'data3':_0x2ca66f[_0x5547('0x19')],'data4':_0x2ca66f['dialstring']||null,'role':_0x5547('0xe'),'internal':_0x2ca66f['accountcode']?_[_0x5547('0xf')](_0x2ca66f[_0x5547('0x10')]):undefined,'uniqueid':_0x2ca66f[_0x5547('0x11')]},'log':_0x5547('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index be09b49..983e246 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 _0x5a1c=['GetSettings','../client','getSettings','stopRecordingOnTransfer'];(function(_0x533d2a,_0x894b2c){var _0x3104c7=function(_0x128104){while(--_0x128104){_0x533d2a['push'](_0x533d2a['shift']());}};_0x3104c7(++_0x894b2c);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xbb8f9d,_0xd54e40){_0xbb8f9d=_0xbb8f9d-0x0;var _0x2bdd0b=_0x5a1c[_0xbb8f9d];return _0x2bdd0b;};'use strict';var client=require(_0xc5a1('0x0'));exports[_0xc5a1('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc5a1('0x2'),'previewRecallmeReminderInterval']},'log':_0xc5a1('0x3')});}; \ No newline at end of file +var _0x1e7b=['GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x47199b,_0x16e824){var _0x390911=function(_0x2f874d){while(--_0x2f874d){_0x47199b['push'](_0x47199b['shift']());}};_0x390911(++_0x16e824);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x3068c8,_0x1f5504){_0x3068c8=_0x3068c8-0x0;var _0x40c6e4=_0x1e7b[_0x3068c8];return _0x40c6e4;};'use strict';var client=require(_0xb1e7('0x0'));exports[_0xb1e7('0x1')]=function(){return client['Request'](_0xb1e7('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb1e7('0x3'),'previewRecallmeReminderInterval']},'log':_0xb1e7('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f1659b2..e03f651 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 _0x6cd8=['../client','getTemplates','GetTemplate','html'];(function(_0x5b2086,_0x3a6240){var _0x5919e1=function(_0x496b87){while(--_0x496b87){_0x5b2086['push'](_0x5b2086['shift']());}};_0x5919e1(++_0x3a6240);}(_0x6cd8,0x194));var _0x86cd=function(_0x5993b8,_0x182b45){_0x5993b8=_0x5993b8-0x0;var _0x43b1b8=_0x6cd8[_0x5993b8];return _0x43b1b8;};'use strict';var client=require(_0x86cd('0x0'));exports[_0x86cd('0x1')]=function(_0x290991){return function(_0x3ab361){return client['Request'](_0x86cd('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x86cd('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x6ca1=['html','../client','getTemplates','Request','GetTemplate'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x6ca1,0x150));var _0x16ca=function(_0x1d9eff,_0x34239a){_0x1d9eff=_0x1d9eff-0x0;var _0x2ce7c4=_0x6ca1[_0x1d9eff];return _0x2ce7c4;};'use strict';var client=require(_0x16ca('0x0'));exports[_0x16ca('0x1')]=function(_0x14eea4){return function(_0xe14841){return client[_0x16ca('0x2')](_0x16ca('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x16ca('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 581ace0..5a82f38 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 _0x0b8f=['AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition'];(function(_0x336ca3,_0x418a0d){var _0x507d25=function(_0x1d09fc){while(--_0x1d09fc){_0x336ca3['push'](_0x336ca3['shift']());}};_0x507d25(++_0x418a0d);}(_0x0b8f,0x1c1));var _0xf0b8=function(_0x323a10,_0x2ec60d){_0x323a10=_0x323a10-0x0;var _0x365a13=_0x0b8f[_0x323a10];return _0x365a13;};'use strict';var client=require('../client');exports[_0xf0b8('0x0')]=function(_0x33f523){return function(_0x29fe05){return client[_0xf0b8('0x1')](_0xf0b8('0x2'),{'options':{'raw':![],'attributes':['id',_0xf0b8('0x3'),_0xf0b8('0x4'),_0xf0b8('0x5')],'include':[{'model':_0xf0b8('0x6'),'as':_0xf0b8('0x7'),'attributes':['id',_0xf0b8('0x8'),'operator',_0xf0b8('0x9')]},{'model':'Condition','as':_0xf0b8('0xa'),'attributes':['id','field',_0xf0b8('0xb'),_0xf0b8('0x9')]},{'model':_0xf0b8('0xc'),'as':_0xf0b8('0xd'),'attributes':['id',_0xf0b8('0xe'),_0xf0b8('0xf'),'data2','data3','data4',_0xf0b8('0x10'),_0xf0b8('0x11'),_0xf0b8('0x12')]}]},'log':_0xf0b8('0x2')});};}; \ No newline at end of file +var _0x3d36=['operator','Condition','AnyConditions','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','getTriggers','Request','GetTrigger','channel','AllConditions','field'];(function(_0x182741,_0x32e4c1){var _0x431c8e=function(_0x375405){while(--_0x375405){_0x182741['push'](_0x182741['shift']());}};_0x431c8e(++_0x32e4c1);}(_0x3d36,0x9a));var _0x63d3=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x3d36[_0x119705];return _0x2affc2;};'use strict';var client=require('../client');exports[_0x63d3('0x0')]=function(_0x2cf292){return function(_0x216853){return client[_0x63d3('0x1')](_0x63d3('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x63d3('0x3'),'status'],'include':[{'model':'Condition','as':_0x63d3('0x4'),'attributes':['id',_0x63d3('0x5'),_0x63d3('0x6'),'value']},{'model':_0x63d3('0x7'),'as':_0x63d3('0x8'),'attributes':['id',_0x63d3('0x5'),_0x63d3('0x6'),_0x63d3('0x9')]},{'model':_0x63d3('0xa'),'as':_0x63d3('0xb'),'attributes':['id',_0x63d3('0xc'),_0x63d3('0xd'),_0x63d3('0xe'),_0x63d3('0xf'),_0x63d3('0x10'),_0x63d3('0x11'),_0x63d3('0x12'),_0x63d3('0x13')]}]},'log':_0x63d3('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c308c85..11cf2b1 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 _0x0b27=['getTrunks','Request','GetTrunk','defaultuser','../client'];(function(_0x1fcee6,_0x181474){var _0x1cc704=function(_0x4f28ca){while(--_0x4f28ca){_0x1fcee6['push'](_0x1fcee6['shift']());}};_0x1cc704(++_0x181474);}(_0x0b27,0xae));var _0x70b2=function(_0x209dd7,_0x5ddaa2){_0x209dd7=_0x209dd7-0x0;var _0x308b8c=_0x0b27[_0x209dd7];return _0x308b8c;};'use strict';var client=require(_0x70b2('0x0'));exports[_0x70b2('0x1')]=function(_0x6489c7){return function(_0x563ea5){return client[_0x70b2('0x2')](_0x70b2('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x70b2('0x4')]},'log':_0x70b2('0x3')});};}; \ No newline at end of file +var _0x7118=['defaultuser','GetTrunk','name','registry'];(function(_0x4a7731,_0x1c2245){var _0x222c6c=function(_0x374510){while(--_0x374510){_0x4a7731['push'](_0x4a7731['shift']());}};_0x222c6c(++_0x1c2245);}(_0x7118,0x159));var _0x8711=function(_0xd2535b,_0x438e13){_0xd2535b=_0xd2535b-0x0;var _0x1f8dee=_0x7118[_0xd2535b];return _0x1f8dee;};'use strict';var client=require('../client');exports['getTrunks']=function(_0xc5dd3b){return function(_0xf50b2e){return client['Request'](_0x8711('0x0'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8711('0x1'),_0x8711('0x2'),_0x8711('0x3')]},'log':_0x8711('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 2504c74..d7f25e7 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4e0cfe,_0x417a01){var _0x4d70b2=function(_0x28e871){while(--_0x28e871){_0x4e0cfe['push'](_0x4e0cfe['shift']());}};_0x4d70b2(++_0x417a01);}(_0xedd9,0xfc));var _0x9edd=function(_0x20aef1,_0x24a231){_0x20aef1=_0x20aef1-0x0;var _0x5a61e4=_0xedd9[_0x20aef1];return _0x5a61e4;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x10d6e2,_0x3db1cc){var _0x204f51=function(_0x42feb8){while(--_0x42feb8){_0x10d6e2['push'](_0x10d6e2['shift']());}};_0x204f51(++_0x3db1cc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xcb91[_0x355ce8];return _0x1db8b8;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index a1fbe1a..71271dd 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 _0xc1d7=['CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client','create'];(function(_0xc28d8c,_0x5c11e4){var _0x1b106f=function(_0x5251b6){while(--_0x5251b6){_0xc28d8c['push'](_0xc28d8c['shift']());}};_0x1b106f(++_0x5c11e4);}(_0xc1d7,0xcb));var _0x7c1d=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0xc1d7[_0x372047];return _0x44f282;};'use strict';var client=require(_0x7c1d('0x0'));exports[_0x7c1d('0x1')]=function(_0x372342){return client['Request']('CreateVoiceAgentReport',{'body':_0x372342,'log':_0x7c1d('0x2')});};exports['update']=function(_0x3f2523,_0x43acfe,_0x5a0895){return client[_0x7c1d('0x3')](_0x7c1d('0x4'),{'body':_0x3f2523,'options':{'where':{'uniqueid':_0x43acfe,'interface':_0x5a0895,'agentcomplete':!![]}},'log':_0x7c1d('0x4')});}; \ No newline at end of file +var _0x06eb=['../client','create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x06eb,0x120));var _0xb06e=function(_0x2eb1b1,_0x4c81c4){_0x2eb1b1=_0x2eb1b1-0x0;var _0x49eb5b=_0x06eb[_0x2eb1b1];return _0x49eb5b;};'use strict';var client=require(_0xb06e('0x0'));exports[_0xb06e('0x1')]=function(_0x167473){return client['Request']('CreateVoiceAgentReport',{'body':_0x167473,'log':_0xb06e('0x2')});};exports[_0xb06e('0x3')]=function(_0x2e37d6,_0x209d40,_0x3d9ea6){return client[_0xb06e('0x4')](_0xb06e('0x5'),{'body':_0x2e37d6,'options':{'where':{'uniqueid':_0x209d40,'interface':_0x3d9ea6,'agentcomplete':!![]}},'log':_0xb06e('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index efaeb9d..86cba7f 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 _0xe949=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe949,0x192));var _0x9e94=function(_0x21e45c,_0x58cb79){_0x21e45c=_0x21e45c-0x0;var _0x93e844=_0xe949[_0x21e45c];return _0x93e844;};'use strict';var moment=require(_0x9e94('0x0'));var util=require(_0x9e94('0x1'));var _=require(_0x9e94('0x2'));var client=require(_0x9e94('0x3'));exports[_0x9e94('0x4')]=function(_0x372a79){return client[_0x9e94('0x5')](_0x9e94('0x6'),{'body':_[_0x9e94('0x7')](_0x372a79,{'source':_0x372a79['calleridnum'],'destinationcontext':_0x372a79[_0x9e94('0x8')],'callerid':_0x372a79[_0x9e94('0x9')],'amaflags':_0x9e94('0xa')}),'log':_0x9e94('0x6')});};exports[_0x9e94('0xb')]=function(){return function(){return client[_0x9e94('0x5')](_0x9e94('0xc'),{'options':{'where':{'type':[_0x9e94('0xd')],'createdAt':{'$between':[moment()['startOf'](_0x9e94('0xe'))[_0x9e94('0xf')](_0x9e94('0x10')),moment()[_0x9e94('0x11')](_0x9e94('0xe'))[_0x9e94('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x9e94('0x12'),'disposition',_0x9e94('0x13'),_0x9e94('0x14')]},'log':_0x9e94('0x15')});};}; \ No newline at end of file +var _0xb980=['create','Request','merge','calleridnum','callerid','CreateVoiceCallReport','getVoiceCallReports','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','moment','util','../client'];(function(_0x8b3619,_0x25ea24){var _0x30b8c3=function(_0x58912d){while(--_0x58912d){_0x8b3619['push'](_0x8b3619['shift']());}};_0x30b8c3(++_0x25ea24);}(_0xb980,0xf9));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x0b98('0x0'));var util=require(_0x0b98('0x1'));var _=require('lodash');var client=require(_0x0b98('0x2'));exports[_0x0b98('0x3')]=function(_0x4645af){return client[_0x0b98('0x4')]('CreateVoiceCallReport',{'body':_[_0x0b98('0x5')](_0x4645af,{'source':_0x4645af[_0x0b98('0x6')],'destinationcontext':_0x4645af['context'],'callerid':_0x4645af[_0x0b98('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x0b98('0x8')});};exports[_0x0b98('0x9')]=function(){return function(){return client[_0x0b98('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x0b98('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x0b98('0xb'))[_0x0b98('0xc')](_0x0b98('0xd')),moment()[_0x0b98('0xe')](_0x0b98('0xb'))[_0x0b98('0xc')](_0x0b98('0xd'))]}},'attributes':[_0x0b98('0xf'),'disposition',_0x0b98('0x10'),_0x0b98('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 110225d..ddf1676 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 _0xa184=['Request','CreateVoiceDialReport'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xa184,0x130));var _0x4a18=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xa184[_0x2ab365];return _0x49fef3;};'use strict';var client=require('../client');exports['create']=function(_0x5b09da){return client[_0x4a18('0x0')](_0x4a18('0x1'),{'body':_0x5b09da,'log':_0x4a18('0x1')});}; \ No newline at end of file +var _0xcadb=['Request','../client','create'];(function(_0x2ca35e,_0xf6e164){var _0x3899ae=function(_0x8817bd){while(--_0x8817bd){_0x2ca35e['push'](_0x2ca35e['shift']());}};_0x3899ae(++_0xf6e164);}(_0xcadb,0xa9));var _0xbcad=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xcadb[_0x468b0f];return _0x3e74d9;};'use strict';var client=require(_0xbcad('0x0'));exports[_0xbcad('0x1')]=function(_0x338f7d){return client[_0xbcad('0x2')]('CreateVoiceDialReport',{'body':_0x338f7d,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 117875e..ac5fa4d 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 _0x58e5=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x41c5a6,_0x5310f1){var _0x1aa3f8=function(_0x3ca8ad){while(--_0x3ca8ad){_0x41c5a6['push'](_0x41c5a6['shift']());}};_0x1aa3f8(++_0x5310f1);}(_0x58e5,0xd1));var _0x558e=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x58e5[_0x2e4e19];return _0x9ba20b;};'use strict';var client=require(_0x558e('0x0'));exports[_0x558e('0x1')]=function(){return function(){return client[_0x558e('0x2')](_0x558e('0x3'),{'options':{'raw':!![],'attributes':['id',_0x558e('0x4'),_0x558e('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xfc1e=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat'];(function(_0x2a27d2,_0x1194e5){var _0x18f683=function(_0x553e0d){while(--_0x553e0d){_0x2a27d2['push'](_0x2a27d2['shift']());}};_0x18f683(++_0x1194e5);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xfc1e[_0x4409e7];return _0x24c751;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xefc1('0x0'),{'options':{'raw':!![],'attributes':['id',_0xefc1('0x1'),_0xefc1('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xefc1('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1222224..b811d72 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 _0x4603=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x33ac30,_0x51056f){var _0x118992=function(_0x11167d){while(--_0x11167d){_0x33ac30['push'](_0x33ac30['shift']());}};_0x118992(++_0x51056f);}(_0x4603,0x1a3));var _0x3460=function(_0x5166f9,_0x5aaf46){_0x5166f9=_0x5166f9-0x0;var _0x561bf3=_0x4603[_0x5166f9];return _0x561bf3;};'use strict';var client=require('../client');exports[_0x3460('0x0')]=function(){return function(){return client[_0x3460('0x1')](_0x3460('0x2'),{'options':{'raw':![],'attributes':['id',_0x3460('0x3'),_0x3460('0x4'),_0x3460('0x5'),_0x3460('0x6'),'monitor_format','type',_0x3460('0x7'),_0x3460('0x8'),_0x3460('0x9'),_0x3460('0xa'),_0x3460('0xb'),_0x3460('0xc'),'dialPredictiveOptimizationPercentage',_0x3460('0xd'),_0x3460('0xe'),_0x3460('0xf'),_0x3460('0x10'),_0x3460('0x11'),_0x3460('0x12'),_0x3460('0x13'),_0x3460('0x14'),_0x3460('0x15'),_0x3460('0x16'),_0x3460('0x17'),_0x3460('0x18'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x3460('0x19'),_0x3460('0x1a'),_0x3460('0x1b'),'dialCheckDuplicateType',_0x3460('0x1c'),_0x3460('0x1d'),_0x3460('0x1e'),_0x3460('0x1f'),_0x3460('0x20'),_0x3460('0x21'),_0x3460('0x22'),_0x3460('0x23'),_0x3460('0x24'),_0x3460('0x25'),_0x3460('0x26'),_0x3460('0x27'),_0x3460('0x28'),_0x3460('0x29'),_0x3460('0x2a'),_0x3460('0x2b'),_0x3460('0x2c'),_0x3460('0x2d'),_0x3460('0x2e'),_0x3460('0x2f'),'dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x3460('0x30'),_0x3460('0x31'),_0x3460('0x32'),_0x3460('0x33'),_0x3460('0x34'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x3460('0x35'),_0x3460('0x36'),_0x3460('0x37'),_0x3460('0x38'),_0x3460('0x39'),_0x3460('0x3a')],'include':[{'model':'Trunk','as':_0x3460('0x3b'),'attributes':['id','name',_0x3460('0x3c'),'active']},{'model':_0x3460('0x3d'),'as':_0x3460('0x3e'),'attributes':['id',_0x3460('0x3')]},{'model':_0x3460('0x3b'),'as':_0x3460('0x3f'),'attributes':['id',_0x3460('0x3'),_0x3460('0x3c'),_0x3460('0x40')]},{'model':_0x3460('0x41'),'as':_0x3460('0x41'),'attributes':['id',_0x3460('0x3')],'include':[{'model':_0x3460('0x41'),'as':_0x3460('0x42'),'attributes':['id',_0x3460('0x3'),'interval']}]}]},'log':_0x3460('0x0')});};}; \ No newline at end of file +var _0x91f5=['dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x2f21f4,_0x3a06d9){var _0x496028=function(_0x3dc679){while(--_0x3dc679){_0x2f21f4['push'](_0x2f21f4['shift']());}};_0x496028(++_0x3a06d9);}(_0x91f5,0x1d0));var _0x591f=function(_0x4433db,_0x3dd77a){_0x4433db=_0x4433db-0x0;var _0x54e592=_0x91f5[_0x4433db];return _0x54e592;};'use strict';var client=require(_0x591f('0x0'));exports[_0x591f('0x1')]=function(){return function(){return client['Request'](_0x591f('0x2'),{'options':{'raw':![],'attributes':['id',_0x591f('0x3'),'acw',_0x591f('0x4'),_0x591f('0x5'),_0x591f('0x6'),_0x591f('0x7'),_0x591f('0x8'),'dialMethod',_0x591f('0x9'),'dialLimitQueue','dialPowerLevel',_0x591f('0xa'),_0x591f('0xb'),_0x591f('0xc'),_0x591f('0xd'),_0x591f('0xe'),'dialOriginateTimeout','dialQueueOptions',_0x591f('0xf'),_0x591f('0x10'),_0x591f('0x11'),_0x591f('0x12'),_0x591f('0x13'),'dialBusyRetryFrequency',_0x591f('0x14'),_0x591f('0x15'),'dialGlobalMaxRetry',_0x591f('0x16'),_0x591f('0x17'),_0x591f('0x18'),'dialCheckDuplicateType',_0x591f('0x19'),'dialAMDInitialSilence',_0x591f('0x1a'),_0x591f('0x1b'),_0x591f('0x1c'),_0x591f('0x1d'),_0x591f('0x1e'),_0x591f('0x1f'),_0x591f('0x20'),_0x591f('0x21'),_0x591f('0x22'),_0x591f('0x23'),_0x591f('0x24'),_0x591f('0x25'),_0x591f('0x26'),_0x591f('0x27'),_0x591f('0x28'),_0x591f('0x6'),_0x591f('0x29'),'dialRandomLastDigitCallerIdNumber',_0x591f('0x2a'),_0x591f('0x2b'),_0x591f('0x2c'),_0x591f('0x2d'),_0x591f('0x2e'),_0x591f('0x2f'),'dialAbandonedRetryFrequency',_0x591f('0x30'),_0x591f('0x31'),_0x591f('0x32'),_0x591f('0x33'),_0x591f('0x34'),'dialPredictiveIntervalMaxThreshold',_0x591f('0x35'),_0x591f('0x36'),_0x591f('0x37')],'include':[{'model':_0x591f('0x38'),'as':_0x591f('0x38'),'attributes':['id',_0x591f('0x3'),_0x591f('0x39'),_0x591f('0x3a')]},{'model':_0x591f('0x3b'),'as':_0x591f('0x3c'),'attributes':['id',_0x591f('0x3')]},{'model':_0x591f('0x38'),'as':'TrunkBackup','attributes':['id','name','callerid',_0x591f('0x3a')]},{'model':_0x591f('0x3d'),'as':'Interval','attributes':['id',_0x591f('0x3')],'include':[{'model':'Interval','as':_0x591f('0x3e'),'attributes':['id',_0x591f('0x3'),'interval']}]}]},'log':_0x591f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4f7c8c7..079a4eb 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(_0x3a9b53,_0x30b0be){var _0xc4154a=function(_0x2df8cd){while(--_0x2df8cd){_0x3a9b53['push'](_0x3a9b53['shift']());}};_0xc4154a(++_0x30b0be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x3da24d,_0x4a1101){var _0x363af3=function(_0x1e9f10){while(--_0x1e9f10){_0x3da24d['push'](_0x3da24d['shift']());}};_0x363af3(++_0x4a1101);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 30d4511..5409a48 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 _0x4d9e=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4d9e,0x1c8));var _0xe4d9=function(_0x5976bf,_0x23e148){_0x5976bf=_0x5976bf-0x0;var _0x576bf9=_0x4d9e[_0x5976bf];return _0x576bf9;};'use strict';var client=require(_0xe4d9('0x0'));exports[_0xe4d9('0x1')]=function(_0x44c32c){return function(){return client[_0xe4d9('0x2')](_0xe4d9('0x3'),{'options':{'where':{'VoiceQueueId':_0x44c32c,'paused':!![]},'raw':!![]},'log':_0xe4d9('0x1')});};}; \ No newline at end of file +var _0xf4cd=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x32067a,_0x6eef28){var _0x42cfa8=function(_0x2f8050){while(--_0x2f8050){_0x32067a['push'](_0x32067a['shift']());}};_0x42cfa8(++_0x6eef28);}(_0xf4cd,0x88));var _0xdf4c=function(_0x5c0b33,_0x429b4e){_0x5c0b33=_0x5c0b33-0x0;var _0x342e46=_0xf4cd[_0x5c0b33];return _0x342e46;};'use strict';var client=require(_0xdf4c('0x0'));exports[_0xdf4c('0x1')]=function(_0x58233d){return function(){return client[_0xdf4c('0x2')](_0xdf4c('0x3'),{'options':{'where':{'VoiceQueueId':_0x58233d,'paused':!![]},'raw':!![]},'log':_0xdf4c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index cf9da3d..4913346 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4da073,_0x4f073c){var _0x1e1867=function(_0x34861b){while(--_0x34861b){_0x4da073['push'](_0x4da073['shift']());}};_0x1e1867(++_0x4f073c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x526a01,_0xc6f31b){var _0x507748=function(_0xc212c8){while(--_0xc212c8){_0x526a01['push'](_0x526a01['shift']());}};_0x507748(++_0xc6f31b);}(_0x7a54,0x106));var _0x47a5=function(_0x3fc408,_0x1b2d97){_0x3fc408=_0x3fc408-0x0;var _0x54c2bb=_0x7a54[_0x3fc408];return _0x54c2bb;};'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 ff510ba..1e74457 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 _0x8882=['transfertargetconnectedlinename','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x1e7a92,_0x1b4f46){var _0x55adfb=function(_0x562d44){while(--_0x562d44){_0x1e7a92['push'](_0x1e7a92['shift']());}};_0x55adfb(++_0x1b4f46);}(_0x8882,0xb9));var _0x2888=function(_0x58fff4,_0xbd86b2){_0x58fff4=_0x58fff4-0x0;var _0x5670bc=_0x8882[_0x58fff4];return _0x5670bc;};'use strict';var client=require(_0x2888('0x0'));exports[_0x2888('0x1')]={};exports[_0x2888('0x2')]=function(_0x1d4aa3){return client[_0x2888('0x3')](_0x2888('0x4'),{'body':{'result':_0x1d4aa3['result'],'transfererchannel':_0x1d4aa3[_0x2888('0x5')],'transferercalleridnum':_0x1d4aa3[_0x2888('0x6')],'transferercalleridname':_0x1d4aa3['transferercalleridname'],'transfererconnectedlinenum':_0x1d4aa3[_0x2888('0x7')],'transfererconnectedlinename':_0x1d4aa3[_0x2888('0x8')],'transfereraccountcode':_0x1d4aa3['transfereraccountcode'],'transferercontext':_0x1d4aa3[_0x2888('0x9')],'transfererexten':_0x1d4aa3[_0x2888('0xa')],'transfererlinkedid':_0x1d4aa3['transfererlinkedid'],'transfereechannel':_0x1d4aa3[_0x2888('0xb')],'transfereecalleridnum':_0x1d4aa3[_0x2888('0xc')],'transfereecalleridname':_0x1d4aa3[_0x2888('0xd')],'transfereeconnectedlinenum':_0x1d4aa3[_0x2888('0xe')],'transfereeconnectedlinename':_0x1d4aa3[_0x2888('0xf')],'transfereeaccountcode':_0x1d4aa3[_0x2888('0x10')],'transfereecontext':_0x1d4aa3[_0x2888('0x11')],'transfereeexten':_0x1d4aa3['transfereeexten'],'transfereelinkedid':_0x1d4aa3[_0x2888('0x12')],'isexternal':_0x1d4aa3[_0x2888('0x13')],'context':_0x1d4aa3[_0x2888('0x14')],'extension':_0x1d4aa3['extension'],'type':_0x2888('0x15')},'log':_0x2888('0x4')});};exports[_0x2888('0x16')]=function(_0x536024){return client['Request'](_0x2888('0x4'),{'body':{'result':_0x536024['result'],'transfererchannel':_0x536024['origtransfererchannel'],'transferercalleridnum':_0x536024['origtransferercalleridnum'],'transferercalleridname':_0x536024[_0x2888('0x17')],'transfererconnectedlinenum':_0x536024[_0x2888('0x18')],'transfererconnectedlinename':_0x536024['secondtransfererconnectedlinename'],'transfereraccountcode':_0x536024[_0x2888('0x19')],'transferercontext':_0x536024[_0x2888('0x1a')],'transfererexten':_0x536024[_0x2888('0x1b')],'transfererlinkedid':_0x536024[_0x2888('0x1c')],'transfereechannel':_0x536024['transfertargetchannel'],'transfereecalleridnum':_0x536024['transfertargetcalleridnum'],'transfereecalleridname':_0x536024[_0x2888('0x1d')],'transfereeconnectedlinenum':_0x536024[_0x2888('0x1e')],'transfereeconnectedlinename':_0x536024[_0x2888('0x1f')],'transfereeaccountcode':_0x536024['transfertargetaccountcode'],'transfereecontext':_0x536024['transfertargetcontext'],'transfereeexten':_0x536024['transfertargetexten'],'transfereelinkedid':_0x536024[_0x2888('0x20')],'isexternal':_0x536024[_0x2888('0x13')],'context':_0x536024[_0x2888('0x21')],'extension':_0x536024[_0x2888('0x22')],'type':_0x2888('0x23')},'log':_0x2888('0x4')});}; \ No newline at end of file +var _0xf392=['transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum'];(function(_0x55841f,_0x487812){var _0x4c5ccf=function(_0x2ce694){while(--_0x2ce694){_0x55841f['push'](_0x55841f['shift']());}};_0x4c5ccf(++_0x487812);}(_0xf392,0x1aa));var _0x2f39=function(_0x48ab75,_0x44a56c){_0x48ab75=_0x48ab75-0x0;var _0x4d4a19=_0xf392[_0x48ab75];return _0x4d4a19;};'use strict';var client=require(_0x2f39('0x0'));exports[_0x2f39('0x1')]={};exports[_0x2f39('0x2')]=function(_0x51b55a){return client[_0x2f39('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x51b55a[_0x2f39('0x4')],'transfererchannel':_0x51b55a[_0x2f39('0x5')],'transferercalleridnum':_0x51b55a[_0x2f39('0x6')],'transferercalleridname':_0x51b55a[_0x2f39('0x7')],'transfererconnectedlinenum':_0x51b55a['transfererconnectedlinenum'],'transfererconnectedlinename':_0x51b55a[_0x2f39('0x8')],'transfereraccountcode':_0x51b55a[_0x2f39('0x9')],'transferercontext':_0x51b55a['transferercontext'],'transfererexten':_0x51b55a[_0x2f39('0xa')],'transfererlinkedid':_0x51b55a['transfererlinkedid'],'transfereechannel':_0x51b55a[_0x2f39('0xb')],'transfereecalleridnum':_0x51b55a[_0x2f39('0xc')],'transfereecalleridname':_0x51b55a[_0x2f39('0xd')],'transfereeconnectedlinenum':_0x51b55a['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x51b55a[_0x2f39('0xe')],'transfereeaccountcode':_0x51b55a['transfereeaccountcode'],'transfereecontext':_0x51b55a['transfereecontext'],'transfereeexten':_0x51b55a[_0x2f39('0xf')],'transfereelinkedid':_0x51b55a[_0x2f39('0x10')],'isexternal':_0x51b55a[_0x2f39('0x11')],'context':_0x51b55a['context'],'extension':_0x51b55a[_0x2f39('0x12')],'type':_0x2f39('0x13')},'log':_0x2f39('0x14')});};exports[_0x2f39('0x15')]=function(_0x2d9fbc){return client[_0x2f39('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2d9fbc['result'],'transfererchannel':_0x2d9fbc[_0x2f39('0x16')],'transferercalleridnum':_0x2d9fbc[_0x2f39('0x17')],'transferercalleridname':_0x2d9fbc['origtransferercalleridname'],'transfererconnectedlinenum':_0x2d9fbc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2d9fbc[_0x2f39('0x18')],'transfereraccountcode':_0x2d9fbc['origtransfereraccountcode'],'transferercontext':_0x2d9fbc[_0x2f39('0x19')],'transfererexten':_0x2d9fbc[_0x2f39('0x1a')],'transfererlinkedid':_0x2d9fbc['origtransfererlinkedid'],'transfereechannel':_0x2d9fbc[_0x2f39('0x1b')],'transfereecalleridnum':_0x2d9fbc[_0x2f39('0x1c')],'transfereecalleridname':_0x2d9fbc[_0x2f39('0x1d')],'transfereeconnectedlinenum':_0x2d9fbc['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2d9fbc[_0x2f39('0x1e')],'transfereeaccountcode':_0x2d9fbc[_0x2f39('0x1f')],'transfereecontext':_0x2d9fbc[_0x2f39('0x20')],'transfereeexten':_0x2d9fbc['transfertargetexten'],'transfereelinkedid':_0x2d9fbc[_0x2f39('0x21')],'isexternal':_0x2d9fbc['isexternal'],'context':_0x2d9fbc['origtransferercontext'],'extension':_0x2d9fbc['origtransfererexten'],'type':_0x2f39('0x22')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 19ea843..3605ffc 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 _0x77a9=['uniqueid','Channel\x20doesn\x27t\x20exist','resolve','channel','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Hangup','exten','context','trunks','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','then','catch','message','error','join','Command','content','voiceQueues','hasOwnProperty','loggedIn','sumDuration','talking','type','unmanaged','abandoned','waiting','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','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','channels','voicechannel','validate','map','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec'];(function(_0x20d872,_0x15a01b){var _0xea3a4d=function(_0x5cbb38){while(--_0x5cbb38){_0x20d872['push'](_0x20d872['shift']());}};_0xea3a4d(++_0x15a01b);}(_0x77a9,0x19e));var _0x977a=function(_0x4bdce3,_0x565818){_0x4bdce3=_0x4bdce3-0x0;var _0xe9962a=_0x77a9[_0x4bdce3];return _0xe9962a;};'use strict';var _=require(_0x977a('0x0'));var util=require('util');var jayson=require(_0x977a('0x1'));var schema=require('validate');var BPromise=require(_0x977a('0x2'));var moment=require(_0x977a('0x3'));var config=require(_0x977a('0x4'));var properties=require(_0x977a('0x5'));var ami=require('../ami');exports[_0x977a('0x6')]=function(_0xb755,_0x3e2b27,_0x2b4ba5){return new BPromise(function(_0x261e46,_0x579e03){var _0x51950c={'QueuePause':function(_0x2e177f){return new Promise(function(_0x12fd82,_0x5ac9c7){var _0x3974cf=util[_0x977a('0x7')](_0x977a('0x8'),_0x977a('0x9'),_0x2e177f[_0x977a('0xa')]);if(_0xb755[_0x977a('0xb')]&&_0xb755[_0x977a('0xb')][_0x3974cf]&&_0xb755[_0x977a('0xb')][_0x3974cf][_0x977a('0xc')]){_0xb755[_0x977a('0xb')][_0x3974cf]['updateAcw']();}if(_0xb755[_0x977a('0xd')][_0x3974cf]){_0xb755[_0x977a('0xd')][_0x3974cf][_0x977a('0xe')]({'statePause':_0x2e177f[_0x977a('0xf')]?!![]:![]});}_0x12fd82({'code':0xc8,'message':_0x977a('0x10')});});},'Reload':function(_0x1fc863){var _0x42ccb8=this;return new Promise(function(_0x2fc086,_0x3d46ba){if(ami[_0x977a('0x11')]()==![]){return _0x3d46ba(_0x42ccb8['error'](0x1f4,[config[_0x977a('0x12')]['ip'],config['asterisk'][_0x977a('0x13')],_0x977a('0x14')]['join']('\x20')));}_0x1fc863=_[_0x977a('0x15')](_0x1fc863,_[_0x977a('0x16')](properties[_0x977a('0x17')]));_0x1fc863[_0x977a('0x18')]='Reload';return ami[_0x977a('0x19')](_0x1fc863)[_0x977a('0x1a')](function(_0x2d47a0){_0x2fc086({'code':0xc8,'message':_0x2d47a0['message']});})[_0x977a('0x1b')](function(_0x20b70b){_0x3d46ba(_0x42ccb8['error'](0x1f5,_0x20b70b[_0x977a('0x1c')]));});});},'Command':function(_0x5bb56d){var _0x709863=this;return new Promise(function(_0x37a2e0,_0x14994a){if(ami[_0x977a('0x11')]()==![]){return _0x14994a(_0x709863[_0x977a('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0x977a('0x12')][_0x977a('0x13')],_0x977a('0x14')][_0x977a('0x1e')]('\x20')));}_0x5bb56d=_[_0x977a('0x15')](_0x5bb56d,'command');_0x5bb56d['action']=_0x977a('0x1f');return ami[_0x977a('0x19')](_0x5bb56d)[_0x977a('0x1a')](function(_0x10408d){_0x37a2e0({'code':0xc8,'message':_0x10408d[_0x977a('0x20')]});})['catch'](function(_0x24a519){_0x14994a(_0x709863['error'](0x1f5,_0x24a519[_0x977a('0x1c')]));});});},'VoiceQueues':function(_0x3cc264){return new Promise(function(_0x33c9f9,_0x5794c6){var _0x3734ac=[];for(var _0x1efd0a in _0xb755[_0x977a('0x21')]){if(_0xb755['voiceQueues'][_0x977a('0x22')](_0x1efd0a)){var _0x49a87a=_0xb755[_0x977a('0x21')][_0x1efd0a];var _0x3184b2={'id':_0x49a87a['id'],'name':_0x49a87a[_0x977a('0xa')],'strategy':_0x49a87a['strategy'],'answered':_0x49a87a['answered'],'available':_0x49a87a['available'],'loggedIn':_0x49a87a[_0x977a('0x23')],'pTalking':_0x49a87a['pTalking'],'sumBillable':_0x49a87a['sumBillable'],'sumDuration':_0x49a87a[_0x977a('0x24')],'sumHoldTime':_0x49a87a['sumHoldTime']||0x0,'talking':_0x49a87a[_0x977a('0x25')],'total':_0x49a87a['total'],'type':_0x49a87a[_0x977a('0x26')],'unmanaged':_0x49a87a[_0x977a('0x27')],'abandoned':_0x49a87a[_0x977a('0x28')],'waiting':_0x49a87a[_0x977a('0x29')],'loggedInDb':_0x49a87a['loggedInDb']};if(_0x49a87a[_0x977a('0x26')]===_0x977a('0x2a')){_0x3184b2[_0x977a('0x2b')]=_0x49a87a[_0x977a('0x2b')];_0x3184b2[_0x977a('0x2c')]=_0x49a87a['dialMethod'];_0x3184b2['dialOriginateCallerIdName']=_0x49a87a[_0x977a('0x2d')];_0x3184b2[_0x977a('0x2e')]=_0x49a87a[_0x977a('0x2e')];_0x3184b2['dialOriginateTimeout']=_0x49a87a[_0x977a('0x2f')];_0x3184b2[_0x977a('0x30')]=_0x49a87a[_0x977a('0x30')];_0x3184b2['temp']=_0x49a87a[_0x977a('0x31')];_0x3184b2[_0x977a('0x32')]=_0x49a87a[_0x977a('0x32')];_0x3184b2[_0x977a('0x33')]=_0x49a87a[_0x977a('0x33')];_0x3184b2['outboundBlacklistCallsDay']=_0x49a87a[_0x977a('0x34')];_0x3184b2[_0x977a('0x35')]=_0x49a87a[_0x977a('0x35')];_0x3184b2[_0x977a('0x36')]=_0x49a87a[_0x977a('0x36')];_0x3184b2[_0x977a('0x37')]=_0x49a87a[_0x977a('0x37')];_0x3184b2[_0x977a('0x38')]=_0x49a87a['outboundDropCallsDayCallersExit'];_0x3184b2[_0x977a('0x39')]=_0x49a87a[_0x977a('0x39')];_0x3184b2[_0x977a('0x3a')]=_0x49a87a[_0x977a('0x3a')];_0x3184b2[_0x977a('0x3b')]=_0x49a87a[_0x977a('0x3b')];_0x3184b2[_0x977a('0x3c')]=_0x49a87a['outboundOriginateFailureCallsDay'];_0x3184b2[_0x977a('0x3d')]=_0x49a87a['outboundReCallsDay'];_0x3184b2[_0x977a('0x3e')]=_0x49a87a['outboundRejectCallsDay'];_0x3184b2['outboundUnknownCallsDay']=_0x49a87a[_0x977a('0x3f')];_0x3184b2[_0x977a('0x40')]=_0x49a87a[_0x977a('0x40')];_0x3184b2['predictiveIntervalAvgHoldtime']=_0x49a87a['predictiveIntervalAvgHoldtime'];_0x3184b2[_0x977a('0x41')]=_0x49a87a[_0x977a('0x41')];_0x3184b2[_0x977a('0x42')]=_0x49a87a[_0x977a('0x42')];_0x3184b2['predictiveIntervalDroppedCallsTimeout']=_0x49a87a['predictiveIntervalDroppedCallsTimeout'];_0x3184b2[_0x977a('0x43')]=_0x49a87a[_0x977a('0x43')];_0x3184b2[_0x977a('0x44')]=_0x49a87a['predictiveIntervalErlangCallsDroppedCalls'];_0x3184b2[_0x977a('0x45')]=_0x49a87a['predictiveIntervalHitRate'];_0x3184b2['predictiveIntervalMultiplicativeFactor']=_0x49a87a[_0x977a('0x46')];_0x3184b2['predictiveIntervalPauses']=_0x49a87a[_0x977a('0x47')];_0x3184b2[_0x977a('0x48')]=_0x49a87a[_0x977a('0x48')];_0x3184b2[_0x977a('0x49')]=_0x49a87a[_0x977a('0x49')];_0x3184b2[_0x977a('0x1c')]=_0x49a87a[_0x977a('0x1c')];_0x3184b2['originated']=_0x49a87a['originated'];_0x3184b2[_0x977a('0x4a')]=_0x49a87a[_0x977a('0x4a')];_0x3184b2[_0x977a('0x4b')]=_0x49a87a[_0x977a('0x4b')];_0x3184b2[_0x977a('0x4c')]=_0x49a87a[_0x977a('0x4c')];_0x3184b2[_0x977a('0x4d')]=_0x49a87a[_0x977a('0x4d')];_0x3184b2[_0x977a('0x4e')]=_0x49a87a['startPredictive'];_0x3184b2[_0x977a('0x4f')]=_0x49a87a[_0x977a('0x4f')];}if(_0x49a87a[_0x977a('0x50')]){_0x3184b2[_0x977a('0x50')]={'id':_0x49a87a[_0x977a('0x50')]['id'],'name':_0x49a87a[_0x977a('0x50')]['name'],'active':_0x49a87a[_0x977a('0x50')][_0x977a('0x51')],'callerid':_0x49a87a[_0x977a('0x50')]['callerid']};}if(_0x49a87a['Interval']){_0x3184b2['Interval']={'id':_0x49a87a['Interval']['id'],'name':_0x49a87a[_0x977a('0x52')][_0x977a('0xa')]};}_0x3734ac[_0x977a('0x53')](_0x3184b2);}}_0x33c9f9({'count':_0x3734ac[_0x977a('0x54')],'rows':_0x3734ac});});},'UpdateVoiceQueue':function(_0x24c2d5){return new Promise(function(_0x200586,_0x8f2dfb){var _0x1c2c1a=_[_0x977a('0x55')](_0xb755[_0x977a('0x21')],{'id':parseInt(_0x24c2d5['id'])});var _0x2fb5ab=_[_0x977a('0x56')](_0x24c2d5,['id']);if(_0x1c2c1a){for(var _0x5ee5ee in _0x2fb5ab){if(typeof _0x2fb5ab[_0x5ee5ee]!==_0x977a('0x57')&&typeof _0x1c2c1a[_0x5ee5ee]!==_0x977a('0x57')){_0x1c2c1a[_0x5ee5ee]=_0x2fb5ab[_0x5ee5ee];}}_0x200586(_0x1c2c1a);}else{_0x8f2dfb();}});},'VoiceChannels':function(_0x55d123){return new Promise(function(_0x501186,_0x2a6cb7){var _0x2449d3=_['values'](_0xb755[_0x977a('0x58')]);_0x501186({'count':_0x2449d3['length'],'rows':_0x2449d3});});},'VoiceChannelMixMonitor':function(_0x8b40df){var _0x2d6d75=this;return new Promise(function(_0x1b6fcc,_0x5f06a9){if(ami[_0x977a('0x11')]()==![]){return _0x5f06a9(_0x2d6d75[_0x977a('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0x977a('0x12')]['username'],_0x977a('0x14')][_0x977a('0x1e')]('\x20')));}var _0x47c6c6=schema(properties[_0x977a('0x59')])[_0x977a('0x5a')](_0x8b40df);if(_0x47c6c6[_0x977a('0x54')]>0x0){return _0x5f06a9(_0x2d6d75[_0x977a('0x1d')](0x1f4,_[_0x977a('0x5b')](_0x47c6c6,_0x977a('0x1c'))[_0x977a('0x1e')](',\x20')));}var _0x902a8f=_[_0x977a('0x55')](_0xb755[_0x977a('0x58')],{'uniqueid':_0x8b40df['uniqueid']});if(_0x902a8f&&_0x902a8f['channel']){var _0x1f3b5e=util['format']('%s.%s',_0x8b40df[_0x977a('0x5c')]||_0x8b40df['uniqueid'],_0x8b40df['format']||'wav');return ami[_0x977a('0x19')]({'action':_0x977a('0x5d'),'channel':_0x902a8f['channel'],'file':_0x1f3b5e,'options':'ai(mixmonitorid)'})[_0x977a('0x1a')](function(_0x356c36){var _0x1582ec=_[_0x977a('0x55')](_0x902a8f[_0x977a('0x5e')],{'filename':_0x977a('0x5f')+_0x1f3b5e[_0x977a('0x60')]()});if(_[_0x977a('0x61')](_0x1582ec)){_0x902a8f[_0x977a('0x5e')][_0x977a('0x53')]({'filename':_0x977a('0x5f')+_0x1f3b5e['toLowerCase'](),'createdAt':moment()[_0x977a('0x7')](_0x977a('0x62')),'mixmonitorid':_0x356c36[_0x977a('0x63')],'status':'rec'});}else{_0x1582ec[_0x977a('0x63')]=_0x356c36['mixmonitorid'];_0x1582ec[_0x977a('0x64')]=_0x977a('0x65');}_0x1b6fcc({'code':0xc8,'message':[_0x8b40df[_0x977a('0x66')],'MixMonitor\x20Success',_0x356c36[_0x977a('0x63')]]['join']('\x20'),'mixmonitorid':_0x356c36[_0x977a('0x63')]});})[_0x977a('0x1b')](function(_0x199631){_0x5f06a9(_0x2d6d75[_0x977a('0x1d')](0x1f5,[_0x8b40df[_0x977a('0x66')],_0x199631[_0x977a('0x1c')][_0x977a('0x60')]()][_0x977a('0x1e')]('\x20')));});}else{return _0x5f06a9(_0x2d6d75[_0x977a('0x1d')](0x1f5,_0x977a('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x215a2c){var _0x536b42=this;return new Promise(function(_0x4d87a6,_0x5ed283){if(ami[_0x977a('0x11')]()==![]){return _0x5ed283(_0x536b42[_0x977a('0x1d')](0x1f4,[config[_0x977a('0x12')]['ip'],config[_0x977a('0x12')][_0x977a('0x13')],_0x977a('0x14')][_0x977a('0x1e')]('\x20')));}var _0x1d8a4f=schema(properties[_0x977a('0x59')])['validate'](_0x215a2c);if(_0x1d8a4f['length']>0x0){return _0x5ed283(_0x536b42[_0x977a('0x1d')](0x1f4,_[_0x977a('0x5b')](_0x1d8a4f,'message')[_0x977a('0x1e')](',\x20')));}var _0x4fa0ee=_[_0x977a('0x55')](_0xb755[_0x977a('0x58')],{'uniqueid':_0x215a2c[_0x977a('0x66')]});if(_0x4fa0ee){return BPromise[_0x977a('0x68')]()['then'](function(){if(_0x4fa0ee[_0x977a('0x69')]){return ami['Action']({'action':_0x977a('0x6a'),'channel':_0x4fa0ee['channel'],'mixmonitorid':_0x215a2c[_0x977a('0x63')]})['catch'](function(_0xbfbd28){});}})[_0x977a('0x1a')](function(){if(_0x4fa0ee[_0x977a('0x6b')]){return ami['Action']({'action':_0x977a('0x6a'),'channel':_0x4fa0ee[_0x977a('0x6b')],'mixmonitorid':_0x215a2c[_0x977a('0x63')]})['catch'](function(_0x44b391){});}})[_0x977a('0x1a')](function(_0x3baf11){var _0x58ff93=_['find'](_0x4fa0ee['monitors'],{'mixmonitorid':_0x215a2c[_0x977a('0x63')]});if(_0x58ff93){_0x58ff93[_0x977a('0x64')]=_0x977a('0x6c');}})['then'](function(){var _0x3a111c=util[_0x977a('0x7')](_0x977a('0x6d'),_0x215a2c[_0x977a('0x5c')]||_0x215a2c[_0x977a('0x66')],_0x215a2c[_0x977a('0x7')]||'wav');var _0x1122bd=_[_0x977a('0x55')](_0x4fa0ee[_0x977a('0x5e')],{'filename':_0x977a('0x5f')+_0x3a111c[_0x977a('0x60')]()});if(_0x1122bd){_0x1122bd[_0x977a('0x64')]=_0x977a('0x6c');}})[_0x977a('0x1a')](function(){_0x4d87a6({'code':0xc8,'message':[_0x215a2c[_0x977a('0x66')],_0x977a('0x6e')][_0x977a('0x1e')]('\x20')});})[_0x977a('0x1b')](function(_0x4360d4){_0x5ed283(_0x536b42['error'](0x1f5,[_0x215a2c[_0x977a('0x66')],_0x4360d4['message'][_0x977a('0x60')]()][_0x977a('0x1e')]('\x20')));});}else{return _0x5ed283(_0x536b42[_0x977a('0x1d')](0x1f5,_0x977a('0x67')));}});},'VoiceQueuesChannels':function(_0x1e765b){return new Promise(function(_0x5dcba2,_0x4df5c9){var _0x1d3a24=_[_0x977a('0x6f')](_0xb755[_0x977a('0x70')]);_0x5dcba2({'count':_0x1d3a24[_0x977a('0x54')],'rows':_0x1d3a24});});},'VoiceQueuesChannel':function(_0x4a61d4){var _0x1ffcc8=this;return new Promise(function(_0x32efc5,_0x53ef24){var _0x2064f1=schema(properties[_0x977a('0x71')])[_0x977a('0x5a')](_0x4a61d4);if(_0x2064f1[_0x977a('0x54')]>0x0){return _0x53ef24(_0x1ffcc8[_0x977a('0x1d')](0x1f4,_[_0x977a('0x5b')](_0x2064f1,_0x977a('0x1c'))[_0x977a('0x1e')](',\x20')));}var _0x43d232=_['find'](_0xb755['queueChannels'],{'uniqueid':_0x4a61d4[_0x977a('0x66')]});if(_0x43d232){_0x32efc5(_0x43d232);}else{return _0x53ef24(_0x1ffcc8['error'](0x1f5,_0x977a('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x59a34e){var _0x2cf7d8=this;return new Promise(function(_0x57fffa,_0x3200fd){if(ami[_0x977a('0x11')]()==![]){return _0x3200fd(_0x2cf7d8[_0x977a('0x1d')](0x1f4,[config[_0x977a('0x12')]['ip'],config[_0x977a('0x12')]['username'],_0x977a('0x14')]['join']('\x20')));}var _0x250bd2=schema(properties['voicequeuechannelhangup'])[_0x977a('0x5a')](_0x59a34e);if(_0x250bd2[_0x977a('0x54')]>0x0){return _0x3200fd(_0x2cf7d8[_0x977a('0x1d')](0x1f4,_['map'](_0x250bd2,_0x977a('0x1c'))[_0x977a('0x1e')](',\x20')));}var _0x5b0067=_[_0x977a('0x55')](_0xb755[_0x977a('0x70')],{'uniqueid':_0x59a34e['uniqueid']});if(_0x5b0067&&_0x5b0067[_0x977a('0x69')]){return ami['Action']({'action':_0x977a('0x72'),'channel':_0x5b0067[_0x977a('0x69')]})[_0x977a('0x1a')](function(_0x1c6e9b){_0x57fffa({'code':0xc8,'message':[_0x59a34e[_0x977a('0x66')],_0x1c6e9b[_0x977a('0x1c')][_0x977a('0x60')]()]['join']('\x20')});})[_0x977a('0x1b')](function(_0x48da04){_0x3200fd(_0x2cf7d8['error'](0x1f5,[_0x59a34e[_0x977a('0x66')],_0x48da04['message'][_0x977a('0x60')]()][_0x977a('0x1e')]('\x20')));});}else{return _0x3200fd(_0x2cf7d8[_0x977a('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x10d917){var _0x36fc82=this;return new Promise(function(_0x62f26a,_0x17469a){if(ami[_0x977a('0x11')]()==![]){return _0x17469a(_0x36fc82[_0x977a('0x1d')](0x1f4,[config[_0x977a('0x12')]['ip'],config[_0x977a('0x12')][_0x977a('0x13')],'ami\x20disconnected'][_0x977a('0x1e')]('\x20')));}var _0x4f0df1=schema(properties['voicequeuechannelredirect'])[_0x977a('0x5a')](_0x10d917);if(_0x4f0df1[_0x977a('0x54')]>0x0){return _0x17469a(_0x36fc82['error'](0x1f4,_[_0x977a('0x5b')](_0x4f0df1,'message')[_0x977a('0x1e')](',\x20')));}var _0xaa008d=_['find'](_0xb755[_0x977a('0x70')],{'uniqueid':_0x10d917[_0x977a('0x66')]});if(_0xaa008d&&_0xaa008d[_0x977a('0x69')]){return ami[_0x977a('0x19')]({'action':'Redirect','channel':_0xaa008d[_0x977a('0x69')],'exten':_0x10d917[_0x977a('0x73')],'context':_0x10d917['context']||_0xaa008d[_0x977a('0x74')],'priority':0x1})['then'](function(_0x282c75){_0x62f26a({'code':0xc8,'message':[_0x10d917[_0x977a('0x66')],_0x282c75[_0x977a('0x1c')][_0x977a('0x60')]()][_0x977a('0x1e')]('\x20')});})[_0x977a('0x1b')](function(_0xf35f21){_0x17469a(_0x36fc82[_0x977a('0x1d')](0x1f5,[_0x10d917[_0x977a('0x66')],_0xf35f21[_0x977a('0x1c')][_0x977a('0x60')]()]['join']('\x20')));});}else{return _0x17469a(_0x36fc82[_0x977a('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2a2889){return new Promise(function(_0x15863e,_0x1371d0){var _0x1b70e1=_['values'](_0xb755['agents']);_0x15863e({'count':_0x1b70e1[_0x977a('0x54')],'rows':_0x1b70e1});});},'Telephones':function(_0x113fb8){return new Promise(function(_0x497939,_0x456210){var _0x2922cf=_[_0x977a('0x6f')](_0xb755['telephones']);_0x497939({'count':_0x2922cf[_0x977a('0x54')],'rows':_0x2922cf});});},'Trunks':function(_0x3948b0){return new Promise(function(_0x48e12b,_0x324f79){var _0x131066=_[_0x977a('0x6f')](_0xb755[_0x977a('0x75')]);_0x48e12b({'count':_0x131066['length'],'rows':_0x131066});});},'OutboundChannels':function(_0x4272e7){return new Promise(function(_0x47da3e,_0xd802df){var _0x3b03cf=_[_0x977a('0x6f')](_0xb755['outboundChannels']);_0x47da3e({'count':_0x3b03cf[_0x977a('0x54')],'rows':_0x3b03cf});});},'Outbound':function(_0x5f32a4){return new Promise(function(_0x165d70,_0x472b6d){_0x165d70(_0xb755['outbound']);});},'Campaigns':function(_0x2af13a){return new Promise(function(_0x18e6d5,_0x27b491){var _0x3cb5d8=_[_0x977a('0x6f')](_0xb755[_0x977a('0x76')]);_0x18e6d5({'count':_0x3cb5d8['length'],'rows':_0x3cb5d8});});},'VoiceQueuesPreview':function(_0x459d7a){var _0x316034=this;return new Promise(function(_0x23548f,_0x2e5693){_0x3e2b27[_0x977a('0x77')](_0x459d7a['id'])[_0x977a('0x1a')](function(_0x3dce40){_0x23548f({'code':0xc8,'message':_0x3dce40[_0x977a('0x1c')]});})[_0x977a('0x1b')](function(_0x18c65e){_0x2e5693(_0x316034[_0x977a('0x1d')](0x1f4,_0x18c65e[_0x977a('0x1c')]));});});},'EventManager':function(_0x5d0b36){var _0x539525=this;return new Promise(function(_0x11a015,_0x813b70){if(!_0x5d0b36[_0x977a('0x78')]){return _0x813b70(_0x539525['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x977a('0x79')+_0x5d0b36['event'],_0x5d0b36[_0x977a('0x1c')]);_0x11a015({'code':0xc8,'message':_0x5d0b36});});},'FaxAccounts':function(_0x53533c){return new Promise(function(_0x21997a,_0x212654){var _0xe3a0c2=_['values'](_0xb755[_0x977a('0x7a')]);_0x21997a({'count':_0xe3a0c2['length'],'rows':_0xe3a0c2});});},'SendFax':function(_0x38dcf1){var _0x3d2ee3=this;return new Promise(function(_0x5609c4,_0x2a299f){_0x2b4ba5[_0x977a('0x7b')](_0x38dcf1)[_0x977a('0x1a')](function(_0x2e08a8){_0x5609c4({'code':0xc8,'message':_0x2e08a8[_0x977a('0x1c')]});})[_0x977a('0x1b')](function(_0x133c84){_0x2a299f(_0x3d2ee3[_0x977a('0x1d')](0x1f4,_0x133c84[_0x977a('0x1c')]));});});},'CheckAfterSend':function(_0xab8f7c){var _0x279507=this;return new Promise(function(_0x2b35d0,_0x2e9b4c){_0x2b4ba5[_0x977a('0x7c')](_0xab8f7c)[_0x977a('0x1a')](function(_0x5aa2d2){_0x2b35d0({'code':0xc8,'message':_0x5aa2d2[_0x977a('0x1c')]});})['catch'](function(_0x48ac4d){_0x2e9b4c(_0x279507[_0x977a('0x1d')](0x1f4,_0x48ac4d[_0x977a('0x1c')]));});});}};var _0x3d5b60=jayson[_0x977a('0x7d')](_0x51950c)['http']();_0x3d5b60['on'](_0x977a('0x1d'),function(_0x43ddb){return _0x579e03(_0x43ddb);});_0x3d5b60['listen'](0x232a,_0x977a('0x7e'),function(){console['log'](_0x977a('0x7f'),0x232a);return _0x261e46(_0x977a('0x80')+0x232a);});});}; \ No newline at end of file +var _0x68b3=['predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','channels','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','values','Event\x20name\x20mandatory','emit','event','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Action','then','message','isConnected','command','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b3,0x1d8));var _0x368b=function(_0x5b3712,_0x2caf27){_0x5b3712=_0x5b3712-0x0;var _0x45383e=_0x68b3[_0x5b3712];return _0x45383e;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var jayson=require(_0x368b('0x2'));var schema=require(_0x368b('0x3'));var BPromise=require(_0x368b('0x4'));var moment=require('moment');var config=require(_0x368b('0x5'));var properties=require(_0x368b('0x6'));var ami=require(_0x368b('0x7'));exports[_0x368b('0x8')]=function(_0x5d68cb,_0x12eb8f,_0x41b15b){return new BPromise(function(_0x104dad,_0x23584a){var _0x4406c8={'QueuePause':function(_0x127c1e){return new Promise(function(_0x2dec1c,_0x142d05){var _0x23622f=util[_0x368b('0x9')](_0x368b('0xa'),'SIP',_0x127c1e[_0x368b('0xb')]);if(_0x5d68cb[_0x368b('0xc')]&&_0x5d68cb[_0x368b('0xc')][_0x23622f]&&_0x5d68cb['timers'][_0x23622f][_0x368b('0xd')]){_0x5d68cb[_0x368b('0xc')][_0x23622f][_0x368b('0xe')]();}if(_0x5d68cb['agents'][_0x23622f]){_0x5d68cb[_0x368b('0xf')][_0x23622f][_0x368b('0x10')]({'statePause':_0x127c1e['pause']?!![]:![]});}_0x2dec1c({'code':0xc8,'message':_0x368b('0x11')});});},'Reload':function(_0x250697){var _0x44e376=this;return new Promise(function(_0x4015fe,_0xdd5d13){if(ami['isConnected']()==![]){return _0xdd5d13(_0x44e376[_0x368b('0x12')](0x1f4,[config[_0x368b('0x13')]['ip'],config['asterisk'][_0x368b('0x14')],_0x368b('0x15')][_0x368b('0x16')]('\x20')));}_0x250697=_['pick'](_0x250697,_[_0x368b('0x17')](properties[_0x368b('0x18')]));_0x250697[_0x368b('0x19')]='Reload';return ami[_0x368b('0x1a')](_0x250697)[_0x368b('0x1b')](function(_0x1c2956){_0x4015fe({'code':0xc8,'message':_0x1c2956['message']});})['catch'](function(_0x3e2e9f){_0xdd5d13(_0x44e376[_0x368b('0x12')](0x1f5,_0x3e2e9f[_0x368b('0x1c')]));});});},'Command':function(_0x1e632a){var _0x1a4f20=this;return new Promise(function(_0x4b8fb7,_0x26447c){if(ami[_0x368b('0x1d')]()==![]){return _0x26447c(_0x1a4f20[_0x368b('0x12')](0x1f4,[config[_0x368b('0x13')]['ip'],config[_0x368b('0x13')][_0x368b('0x14')],_0x368b('0x15')][_0x368b('0x16')]('\x20')));}_0x1e632a=_['pick'](_0x1e632a,_0x368b('0x1e'));_0x1e632a[_0x368b('0x19')]=_0x368b('0x1f');return ami[_0x368b('0x1a')](_0x1e632a)[_0x368b('0x1b')](function(_0x4c2fca){_0x4b8fb7({'code':0xc8,'message':_0x4c2fca[_0x368b('0x20')]});})[_0x368b('0x21')](function(_0x3a22bd){_0x26447c(_0x1a4f20[_0x368b('0x12')](0x1f5,_0x3a22bd[_0x368b('0x1c')]));});});},'VoiceQueues':function(_0x85515f){return new Promise(function(_0x430e16,_0x11ea2d){var _0x3123c1=[];for(var _0x3f7f89 in _0x5d68cb[_0x368b('0x22')]){if(_0x5d68cb[_0x368b('0x22')][_0x368b('0x23')](_0x3f7f89)){var _0x376e61=_0x5d68cb[_0x368b('0x22')][_0x3f7f89];var _0x23a83a={'id':_0x376e61['id'],'name':_0x376e61[_0x368b('0xb')],'strategy':_0x376e61[_0x368b('0x24')],'answered':_0x376e61[_0x368b('0x25')],'available':_0x376e61[_0x368b('0x26')],'loggedIn':_0x376e61[_0x368b('0x27')],'pTalking':_0x376e61[_0x368b('0x28')],'sumBillable':_0x376e61[_0x368b('0x29')],'sumDuration':_0x376e61[_0x368b('0x2a')],'sumHoldTime':_0x376e61['sumHoldTime']||0x0,'talking':_0x376e61['talking'],'total':_0x376e61[_0x368b('0x2b')],'type':_0x376e61[_0x368b('0x2c')],'unmanaged':_0x376e61[_0x368b('0x2d')],'abandoned':_0x376e61[_0x368b('0x2e')],'waiting':_0x376e61['waiting'],'loggedInDb':_0x376e61[_0x368b('0x2f')]};if(_0x376e61[_0x368b('0x2c')]===_0x368b('0x30')){_0x23a83a[_0x368b('0x31')]=_0x376e61[_0x368b('0x31')];_0x23a83a['dialMethod']=_0x376e61[_0x368b('0x32')];_0x23a83a[_0x368b('0x33')]=_0x376e61[_0x368b('0x33')];_0x23a83a[_0x368b('0x34')]=_0x376e61['dialOriginateCallerIdNumber'];_0x23a83a['dialOriginateTimeout']=_0x376e61['dialOriginateTimeout'];_0x23a83a[_0x368b('0x35')]=_0x376e61[_0x368b('0x35')];_0x23a83a[_0x368b('0x36')]=_0x376e61[_0x368b('0x36')];_0x23a83a[_0x368b('0x37')]=_0x376e61['outboundAnswerAgiCallsDay'];_0x23a83a[_0x368b('0x38')]=_0x376e61[_0x368b('0x38')];_0x23a83a['outboundBlacklistCallsDay']=_0x376e61[_0x368b('0x39')];_0x23a83a[_0x368b('0x3a')]=_0x376e61['outboundBusyCallsDay'];_0x23a83a[_0x368b('0x3b')]=_0x376e61[_0x368b('0x3b')];_0x23a83a['outboundDropCallsDayACS']=_0x376e61[_0x368b('0x3c')];_0x23a83a['outboundDropCallsDayCallersExit']=_0x376e61['outboundDropCallsDayCallersExit'];_0x23a83a['outboundDropCallsDayTimeout']=_0x376e61[_0x368b('0x3d')];_0x23a83a[_0x368b('0x3e')]=_0x376e61[_0x368b('0x3e')];_0x23a83a[_0x368b('0x3f')]=_0x376e61[_0x368b('0x3f')];_0x23a83a[_0x368b('0x40')]=_0x376e61[_0x368b('0x40')];_0x23a83a[_0x368b('0x41')]=_0x376e61[_0x368b('0x41')];_0x23a83a[_0x368b('0x42')]=_0x376e61['outboundRejectCallsDay'];_0x23a83a[_0x368b('0x43')]=_0x376e61[_0x368b('0x43')];_0x23a83a['predictiveIntervalAnsweredCalls']=_0x376e61[_0x368b('0x44')];_0x23a83a[_0x368b('0x45')]=_0x376e61[_0x368b('0x45')];_0x23a83a[_0x368b('0x46')]=_0x376e61[_0x368b('0x46')];_0x23a83a['predictiveIntervalDroppedCallsCallersExit']=_0x376e61[_0x368b('0x47')];_0x23a83a[_0x368b('0x48')]=_0x376e61[_0x368b('0x48')];_0x23a83a[_0x368b('0x49')]=_0x376e61['predictiveIntervalErlangCalls'];_0x23a83a['predictiveIntervalErlangCallsDroppedCalls']=_0x376e61[_0x368b('0x4a')];_0x23a83a[_0x368b('0x4b')]=_0x376e61[_0x368b('0x4b')];_0x23a83a[_0x368b('0x4c')]=_0x376e61[_0x368b('0x4c')];_0x23a83a[_0x368b('0x4d')]=_0x376e61[_0x368b('0x4d')];_0x23a83a[_0x368b('0x4e')]=_0x376e61[_0x368b('0x4e')];_0x23a83a[_0x368b('0x4f')]=_0x376e61['predictiveIntervalTotalCalls'];_0x23a83a[_0x368b('0x1c')]=_0x376e61[_0x368b('0x1c')];_0x23a83a['originated']=_0x376e61[_0x368b('0x50')];_0x23a83a[_0x368b('0x51')]=_0x376e61[_0x368b('0x51')];_0x23a83a[_0x368b('0x52')]=_0x376e61['erlangCallToSecond'];_0x23a83a[_0x368b('0x53')]=_0x376e61[_0x368b('0x53')];_0x23a83a['erlangBusyFactor']=_0x376e61[_0x368b('0x54')];_0x23a83a[_0x368b('0x55')]=_0x376e61[_0x368b('0x55')];_0x23a83a['startProgressive']=_0x376e61[_0x368b('0x56')];}if(_0x376e61[_0x368b('0x57')]){_0x23a83a[_0x368b('0x57')]={'id':_0x376e61['Trunk']['id'],'name':_0x376e61['Trunk'][_0x368b('0xb')],'active':_0x376e61[_0x368b('0x57')]['active'],'callerid':_0x376e61[_0x368b('0x57')][_0x368b('0x58')]};}if(_0x376e61[_0x368b('0x59')]){_0x23a83a[_0x368b('0x59')]={'id':_0x376e61[_0x368b('0x59')]['id'],'name':_0x376e61[_0x368b('0x59')][_0x368b('0xb')]};}_0x3123c1[_0x368b('0x5a')](_0x23a83a);}}_0x430e16({'count':_0x3123c1[_0x368b('0x5b')],'rows':_0x3123c1});});},'UpdateVoiceQueue':function(_0x33914c){return new Promise(function(_0x321a64,_0x432df9){var _0xcaf3d0=_['find'](_0x5d68cb[_0x368b('0x22')],{'id':parseInt(_0x33914c['id'])});var _0x1fff8e=_[_0x368b('0x5c')](_0x33914c,['id']);if(_0xcaf3d0){for(var _0xf95817 in _0x1fff8e){if(typeof _0x1fff8e[_0xf95817]!==_0x368b('0x5d')&&typeof _0xcaf3d0[_0xf95817]!=='undefined'){_0xcaf3d0[_0xf95817]=_0x1fff8e[_0xf95817];}}_0x321a64(_0xcaf3d0);}else{_0x432df9();}});},'VoiceChannels':function(_0x5ed4c6){return new Promise(function(_0x131e50,_0x46b467){var _0x1c8755=_['values'](_0x5d68cb[_0x368b('0x5e')]);_0x131e50({'count':_0x1c8755[_0x368b('0x5b')],'rows':_0x1c8755});});},'VoiceChannelMixMonitor':function(_0xa87288){var _0xf22764=this;return new Promise(function(_0x3cae32,_0x1fdc4b){if(ami[_0x368b('0x1d')]()==![]){return _0x1fdc4b(_0xf22764[_0x368b('0x12')](0x1f4,[config[_0x368b('0x13')]['ip'],config[_0x368b('0x13')]['username'],_0x368b('0x15')]['join']('\x20')));}var _0x1a4370=schema(properties['voicechannel'])[_0x368b('0x3')](_0xa87288);if(_0x1a4370['length']>0x0){return _0x1fdc4b(_0xf22764[_0x368b('0x12')](0x1f4,_[_0x368b('0x5f')](_0x1a4370,_0x368b('0x1c'))[_0x368b('0x16')](',\x20')));}var _0x49b78c=_[_0x368b('0x60')](_0x5d68cb[_0x368b('0x5e')],{'uniqueid':_0xa87288[_0x368b('0x61')]});if(_0x49b78c&&_0x49b78c[_0x368b('0x62')]){var _0x424aa1=util[_0x368b('0x9')](_0x368b('0x63'),_0xa87288[_0x368b('0x64')]||_0xa87288[_0x368b('0x61')],_0xa87288['format']||_0x368b('0x65'));return ami[_0x368b('0x1a')]({'action':_0x368b('0x66'),'channel':_0x49b78c[_0x368b('0x62')],'file':_0x424aa1,'options':_0x368b('0x67')})['then'](function(_0x16492f){var _0x1ddb6e=_[_0x368b('0x60')](_0x49b78c[_0x368b('0x68')],{'filename':_0x368b('0x69')+_0x424aa1[_0x368b('0x6a')]()});if(_[_0x368b('0x6b')](_0x1ddb6e)){_0x49b78c['monitors']['push']({'filename':'/var/spool/asterisk/monitor/'+_0x424aa1['toLowerCase'](),'createdAt':moment()[_0x368b('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x16492f[_0x368b('0x6c')],'status':_0x368b('0x6d')});}else{_0x1ddb6e['mixmonitorid']=_0x16492f['mixmonitorid'];_0x1ddb6e[_0x368b('0x6e')]='rec';}_0x3cae32({'code':0xc8,'message':[_0xa87288[_0x368b('0x61')],_0x368b('0x6f'),_0x16492f['mixmonitorid']][_0x368b('0x16')]('\x20'),'mixmonitorid':_0x16492f[_0x368b('0x6c')]});})['catch'](function(_0x212b68){_0x1fdc4b(_0xf22764['error'](0x1f5,[_0xa87288[_0x368b('0x61')],_0x212b68[_0x368b('0x1c')][_0x368b('0x6a')]()][_0x368b('0x16')]('\x20')));});}else{return _0x1fdc4b(_0xf22764['error'](0x1f5,_0x368b('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x233a32){var _0x670789=this;return new Promise(function(_0x14974e,_0x49a634){if(ami[_0x368b('0x1d')]()==![]){return _0x49a634(_0x670789['error'](0x1f4,[config[_0x368b('0x13')]['ip'],config[_0x368b('0x13')]['username'],'ami\x20disconnected'][_0x368b('0x16')]('\x20')));}var _0xeea586=schema(properties[_0x368b('0x71')])[_0x368b('0x3')](_0x233a32);if(_0xeea586[_0x368b('0x5b')]>0x0){return _0x49a634(_0x670789['error'](0x1f4,_[_0x368b('0x5f')](_0xeea586,_0x368b('0x1c'))['join'](',\x20')));}var _0x2e5827=_[_0x368b('0x60')](_0x5d68cb[_0x368b('0x5e')],{'uniqueid':_0x233a32[_0x368b('0x61')]});if(_0x2e5827){return BPromise['resolve']()[_0x368b('0x1b')](function(){if(_0x2e5827[_0x368b('0x62')]){return ami[_0x368b('0x1a')]({'action':_0x368b('0x72'),'channel':_0x2e5827['channel'],'mixmonitorid':_0x233a32['mixmonitorid']})['catch'](function(_0x4b949f){});}})[_0x368b('0x1b')](function(){if(_0x2e5827[_0x368b('0x73')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x2e5827['destinationchannel'],'mixmonitorid':_0x233a32['mixmonitorid']})['catch'](function(_0x33c3a6){});}})[_0x368b('0x1b')](function(_0xca4639){var _0x5d5b4d=_[_0x368b('0x60')](_0x2e5827['monitors'],{'mixmonitorid':_0x233a32['mixmonitorid']});if(_0x5d5b4d){_0x5d5b4d[_0x368b('0x6e')]=_0x368b('0x74');}})[_0x368b('0x1b')](function(){var _0x17c862=util['format'](_0x368b('0x63'),_0x233a32[_0x368b('0x64')]||_0x233a32[_0x368b('0x61')],_0x233a32['format']||_0x368b('0x65'));var _0x159a89=_['find'](_0x2e5827[_0x368b('0x68')],{'filename':_0x368b('0x69')+_0x17c862['toLowerCase']()});if(_0x159a89){_0x159a89[_0x368b('0x6e')]='stop';}})[_0x368b('0x1b')](function(){_0x14974e({'code':0xc8,'message':[_0x233a32[_0x368b('0x61')],'StopMixMonitor\x20Success'][_0x368b('0x16')]('\x20')});})[_0x368b('0x21')](function(_0x3785af){_0x49a634(_0x670789[_0x368b('0x12')](0x1f5,[_0x233a32[_0x368b('0x61')],_0x3785af['message'][_0x368b('0x6a')]()][_0x368b('0x16')]('\x20')));});}else{return _0x49a634(_0x670789[_0x368b('0x12')](0x1f5,_0x368b('0x70')));}});},'VoiceQueuesChannels':function(_0x321168){return new Promise(function(_0x1c9cce,_0x3432f2){var _0x2ab1eb=_['values'](_0x5d68cb[_0x368b('0x75')]);_0x1c9cce({'count':_0x2ab1eb[_0x368b('0x5b')],'rows':_0x2ab1eb});});},'VoiceQueuesChannel':function(_0x4c04bf){var _0x273d33=this;return new Promise(function(_0x18b97b,_0x2f94d3){var _0x543ca3=schema(properties['voicequeuechannel'])[_0x368b('0x3')](_0x4c04bf);if(_0x543ca3[_0x368b('0x5b')]>0x0){return _0x2f94d3(_0x273d33[_0x368b('0x12')](0x1f4,_[_0x368b('0x5f')](_0x543ca3,'message')[_0x368b('0x16')](',\x20')));}var _0x5d7ed8=_[_0x368b('0x60')](_0x5d68cb[_0x368b('0x75')],{'uniqueid':_0x4c04bf[_0x368b('0x61')]});if(_0x5d7ed8){_0x18b97b(_0x5d7ed8);}else{return _0x2f94d3(_0x273d33['error'](0x1f5,_0x368b('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x2e9cbe){var _0x2c02ca=this;return new Promise(function(_0x4d6255,_0x51dffd){if(ami['isConnected']()==![]){return _0x51dffd(_0x2c02ca[_0x368b('0x12')](0x1f4,[config[_0x368b('0x13')]['ip'],config[_0x368b('0x13')][_0x368b('0x14')],_0x368b('0x15')]['join']('\x20')));}var _0x8710f7=schema(properties[_0x368b('0x76')])['validate'](_0x2e9cbe);if(_0x8710f7[_0x368b('0x5b')]>0x0){return _0x51dffd(_0x2c02ca['error'](0x1f4,_['map'](_0x8710f7,_0x368b('0x1c'))[_0x368b('0x16')](',\x20')));}var _0x46e660=_[_0x368b('0x60')](_0x5d68cb[_0x368b('0x75')],{'uniqueid':_0x2e9cbe[_0x368b('0x61')]});if(_0x46e660&&_0x46e660[_0x368b('0x62')]){return ami[_0x368b('0x1a')]({'action':_0x368b('0x77'),'channel':_0x46e660[_0x368b('0x62')]})['then'](function(_0x5ed540){_0x4d6255({'code':0xc8,'message':[_0x2e9cbe['uniqueid'],_0x5ed540['message'][_0x368b('0x6a')]()]['join']('\x20')});})['catch'](function(_0x23a1d6){_0x51dffd(_0x2c02ca[_0x368b('0x12')](0x1f5,[_0x2e9cbe[_0x368b('0x61')],_0x23a1d6[_0x368b('0x1c')][_0x368b('0x6a')]()][_0x368b('0x16')]('\x20')));});}else{return _0x51dffd(_0x2c02ca[_0x368b('0x12')](0x1f5,_0x368b('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x57b1c4){var _0x19e179=this;return new Promise(function(_0x99599c,_0x55f183){if(ami[_0x368b('0x1d')]()==![]){return _0x55f183(_0x19e179[_0x368b('0x12')](0x1f4,[config[_0x368b('0x13')]['ip'],config[_0x368b('0x13')][_0x368b('0x14')],_0x368b('0x15')][_0x368b('0x16')]('\x20')));}var _0x41e848=schema(properties[_0x368b('0x78')])[_0x368b('0x3')](_0x57b1c4);if(_0x41e848[_0x368b('0x5b')]>0x0){return _0x55f183(_0x19e179[_0x368b('0x12')](0x1f4,_[_0x368b('0x5f')](_0x41e848,_0x368b('0x1c'))['join'](',\x20')));}var _0x49ad9d=_[_0x368b('0x60')](_0x5d68cb[_0x368b('0x75')],{'uniqueid':_0x57b1c4[_0x368b('0x61')]});if(_0x49ad9d&&_0x49ad9d['channel']){return ami[_0x368b('0x1a')]({'action':_0x368b('0x79'),'channel':_0x49ad9d[_0x368b('0x62')],'exten':_0x57b1c4['exten'],'context':_0x57b1c4[_0x368b('0x7a')]||_0x49ad9d[_0x368b('0x7a')],'priority':0x1})['then'](function(_0x235c63){_0x99599c({'code':0xc8,'message':[_0x57b1c4[_0x368b('0x61')],_0x235c63[_0x368b('0x1c')]['toLowerCase']()]['join']('\x20')});})[_0x368b('0x21')](function(_0x52a495){_0x55f183(_0x19e179[_0x368b('0x12')](0x1f5,[_0x57b1c4[_0x368b('0x61')],_0x52a495[_0x368b('0x1c')][_0x368b('0x6a')]()]['join']('\x20')));});}else{return _0x55f183(_0x19e179[_0x368b('0x12')](0x1f5,_0x368b('0x70')));}});},'Agents':function(_0x1bb54f){return new Promise(function(_0x54c95a,_0x134054){var _0x46d5d3=_[_0x368b('0x7b')](_0x5d68cb[_0x368b('0xf')]);_0x54c95a({'count':_0x46d5d3['length'],'rows':_0x46d5d3});});},'Telephones':function(_0x407ab1){return new Promise(function(_0x4844fe,_0x1740a6){var _0x1374e0=_[_0x368b('0x7b')](_0x5d68cb['telephones']);_0x4844fe({'count':_0x1374e0['length'],'rows':_0x1374e0});});},'Trunks':function(_0x4bb209){return new Promise(function(_0x57435b,_0x221d92){var _0x3146a9=_['values'](_0x5d68cb['trunks']);_0x57435b({'count':_0x3146a9[_0x368b('0x5b')],'rows':_0x3146a9});});},'OutboundChannels':function(_0x4a5d99){return new Promise(function(_0x197d3a,_0x1697e4){var _0x570efe=_[_0x368b('0x7b')](_0x5d68cb['outboundChannels']);_0x197d3a({'count':_0x570efe[_0x368b('0x5b')],'rows':_0x570efe});});},'Outbound':function(_0x5294bf){return new Promise(function(_0x1dd4a7,_0x12cad7){_0x1dd4a7(_0x5d68cb['outbound']);});},'Campaigns':function(_0x64d199){return new Promise(function(_0x50e5d3,_0x147d22){var _0x2798e1=_['values'](_0x5d68cb['campaigns']);_0x50e5d3({'count':_0x2798e1[_0x368b('0x5b')],'rows':_0x2798e1});});},'VoiceQueuesPreview':function(_0x4ee51f){var _0x5aede6=this;return new Promise(function(_0x38bd68,_0x54c442){_0x12eb8f['run'](_0x4ee51f['id'])['then'](function(_0x4f5958){_0x38bd68({'code':0xc8,'message':_0x4f5958[_0x368b('0x1c')]});})['catch'](function(_0x303c52){_0x54c442(_0x5aede6[_0x368b('0x12')](0x1f4,_0x303c52['message']));});});},'EventManager':function(_0x302d6d){var _0x3f5e7b=this;return new Promise(function(_0x50de42,_0xe4bbd0){if(!_0x302d6d['event']){return _0xe4bbd0(_0x3f5e7b['error'](0x1f4,_0x368b('0x7c')));}ami[_0x368b('0x7d')]('custom:'+_0x302d6d[_0x368b('0x7e')],_0x302d6d['message']);_0x50de42({'code':0xc8,'message':_0x302d6d});});},'FaxAccounts':function(_0x4af1d3){return new Promise(function(_0x379dc9,_0x4d7151){var _0xb4049=_['values'](_0x5d68cb['faxAccounts']);_0x379dc9({'count':_0xb4049[_0x368b('0x5b')],'rows':_0xb4049});});},'SendFax':function(_0x5b02ca){var _0x30235b=this;return new Promise(function(_0x2b2c54,_0x3082df){_0x41b15b[_0x368b('0x7f')](_0x5b02ca)[_0x368b('0x1b')](function(_0x150a34){_0x2b2c54({'code':0xc8,'message':_0x150a34['message']});})[_0x368b('0x21')](function(_0x11ed4b){_0x3082df(_0x30235b[_0x368b('0x12')](0x1f4,_0x11ed4b[_0x368b('0x1c')]));});});},'CheckAfterSend':function(_0x134e28){var _0x498a81=this;return new Promise(function(_0x313462,_0x39db39){_0x41b15b[_0x368b('0x80')](_0x134e28)[_0x368b('0x1b')](function(_0x531cb4){_0x313462({'code':0xc8,'message':_0x531cb4[_0x368b('0x1c')]});})[_0x368b('0x21')](function(_0x19e5c4){_0x39db39(_0x498a81[_0x368b('0x12')](0x1f4,_0x19e5c4[_0x368b('0x1c')]));});});}};var _0x2eeb1c=jayson[_0x368b('0x81')](_0x4406c8)[_0x368b('0x82')]();_0x2eeb1c['on']('error',function(_0x4136e6){return _0x23584a(_0x4136e6);});_0x2eeb1c[_0x368b('0x8')](0x232a,_0x368b('0x83'),function(){console[_0x368b('0x84')](_0x368b('0x85'),0x232a);return _0x104dad(_0x368b('0x86')+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 3d3df44..f38144a 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 _0x5c12=['bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','map','destcalleridnum','firstName','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge'];(function(_0x4927c0,_0x5e2e39){var _0x159fbf=function(_0x3862ed){while(--_0x3862ed){_0x4927c0['push'](_0x4927c0['shift']());}};_0x159fbf(++_0x5e2e39);}(_0x5c12,0x188));var _0x25c1=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x5c12[_0x16e0c8];return _0xe4b5af;};'use strict';var _=require('lodash');var BPromise=require(_0x25c1('0x0'));var Redis=require(_0x25c1('0x1'));var util=require('util');var config=require(_0x25c1('0x2'));var logger=require(_0x25c1('0x3'))(_0x25c1('0x4'));var cmContactRpc=require(_0x25c1('0x5'));config[_0x25c1('0x6')]=_[_0x25c1('0x7')](config[_0x25c1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x25c1('0x8'))(new Redis(config[_0x25c1('0x6')]));function emit(_0x382922,_0x4ab674,_0x5c69b1,_0x24981c,_0x3b69ba){logger[_0x25c1('0x9')](_0x25c1('0xa'),_0x382922,_0x4ab674['id'],_0x5c69b1,_0x24981c,JSON[_0x25c1('0xb')](_0x3b69ba));io['to'](_0x5c69b1)['emit'](_0x24981c,_0x3b69ba);}exports[_0x25c1('0xc')]=function(_0x41c89d,_0x11a223,_0x81f0f4,_0x2872b2){var _0x5e44e2,_0x196e2f;var _0x401734={};var _0x49fb8e=Number(_0x81f0f4[_0x25c1('0xd')]);var _0x209af5=_0x81f0f4[_0x25c1('0xe')]?Boolean(Number(_0x81f0f4[_0x25c1('0xe')])):![];var _0x5d3d11;var _0x569ef9=![];if(!_['isNil'](_0x81f0f4['data5'])){if(_0x81f0f4[_0x25c1('0xf')]=='1')_0x569ef9=!![];}if(!_0x569ef9){if(_0x2872b2[_0x25c1('0x10')]){_0x401734['id']=_0x2872b2[_0x25c1('0x10')];}}if(!_0x401734['id']){_0x401734[_0x25c1('0x11')]=_0x49fb8e;_0x5d3d11=_0x81f0f4[_0x25c1('0x12')]&&_0x81f0f4['data3']!=='0'?_0x81f0f4[_0x25c1('0x12')]['split'](','):['phone'];_0x401734['$or']=_[_0x25c1('0x13')](_0x5d3d11,function(_0x1a08b5){var _0x4dc64b={};_0x4dc64b[_0x1a08b5]=_0x2872b2['routeId']?_0x2872b2[_0x25c1('0x14')]:_0x2872b2['calleridnum'];return _0x4dc64b;});}var _0x7175d4=['id',_0x25c1('0x15'),'lastName','phone','mobile',_0x25c1('0x16'),_0x25c1('0x11'),_0x25c1('0x17'),_0x25c1('0x18'),'updatedAt'];var _0x119639=_[_0x25c1('0x19')](_0x7175d4,_0x5d3d11);BPromise[_0x25c1('0x1a')]()[_0x25c1('0x1b')](cmContactRpc['getContacts']({'attributes':_0x119639,'where':_0x401734}))['then'](function(_0x2a8a84){_0x196e2f=_0x2a8a84;if(!_[_0x25c1('0x1c')](_0x196e2f)){if(_0x196e2f[_0x25c1('0x1d')]===0x1){_0x5e44e2=_0x196e2f[0x0];logger[_0x25c1('0x9')](_0x25c1('0x1e'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id'],_0x5e44e2['id']);}else{logger[_0x25c1('0x9')](_0x25c1('0x20'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id'],_[_0x25c1('0x13')](_0x196e2f,'id')[_0x25c1('0x21')](','));}return;}else{logger[_0x25c1('0x9')](_0x25c1('0x22'),_0x2872b2['uniqueid'],_0x11a223['id']);var _0x2dadae={'ListId':_0x49fb8e};var _0x20dbb9=_0x81f0f4[_0x25c1('0x23')]&&_0x81f0f4[_0x25c1('0x23')]!=='0'?_0x81f0f4[_0x25c1('0x23')]:_0x25c1('0x24');if(_0x209af5){logger['info'](_0x25c1('0x25'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id']);_0x2dadae[_0x20dbb9]=_[_0x25c1('0x26')](_0x2872b2[_0x25c1('0x27')])?_0x2872b2[_0x25c1('0x28')]:_0x2872b2[_0x25c1('0x14')];if(_['isNil'](_0x2872b2[_0x25c1('0x27')])){_0x2dadae['firstName']=_0x2872b2[_0x25c1('0x29')]&&_0x2872b2[_0x25c1('0x29')]!==_0x25c1('0x2a')?_0x2872b2[_0x25c1('0x29')]:_0x25c1('0x2b');}else{_0x2dadae[_0x25c1('0x15')]=_0x2872b2[_0x25c1('0x2c')]&&_0x2872b2[_0x25c1('0x2c')]!==_0x25c1('0x2a')?_0x2872b2['destcalleridname']:_0x25c1('0x2b');}return BPromise['resolve']()['then'](cmContactRpc[_0x25c1('0x2d')](_0x2dadae))[_0x25c1('0x1b')](function(_0x4ef790){_0x5e44e2=_0x4ef790;_0x196e2f[_0x25c1('0x2e')](_0x4ef790);if(_0x5e44e2){logger['info'](_0x25c1('0x2f'),_0x2872b2['uniqueid'],_0x11a223['id'],_0x5e44e2['id']);}return;});}else{logger[_0x25c1('0x9')](_0x25c1('0x30'),_0x2872b2[_0x25c1('0x1f')],_0x11a223['id']);_0x2dadae[_0x20dbb9]=_[_0x25c1('0x26')](_0x2872b2[_0x25c1('0x27')])?_0x2872b2[_0x25c1('0x28')]:_0x2872b2[_0x25c1('0x14')];if(_[_0x25c1('0x26')](_0x2872b2['routeId'])){_0x2dadae[_0x25c1('0x15')]=_0x2872b2['calleridname']&&_0x2872b2[_0x25c1('0x29')]!==''?_0x2872b2[_0x25c1('0x29')]:_0x25c1('0x2b');}else{_0x2dadae[_0x25c1('0x15')]=_0x2872b2[_0x25c1('0x2c')]&&_0x2872b2[_0x25c1('0x2c')]!==_0x25c1('0x2a')?_0x2872b2[_0x25c1('0x2c')]:_0x25c1('0x2b');}_0x5e44e2=_0x2dadae;_0x196e2f[_0x25c1('0x2e')](_0x2dadae);return;}}})[_0x25c1('0x1b')](function(){if(_0x41c89d){emit(_0x2872b2[_0x25c1('0x1f')],_0x11a223,util[_0x25c1('0x31')](_0x25c1('0x32'),_0x41c89d[_0x25c1('0x33')]),util[_0x25c1('0x31')](_0x25c1('0x34'),_0x81f0f4[_0x25c1('0x35')][_0x25c1('0x36')]()),{'evt':_[_0x25c1('0x37')](_0x2872b2,{'autoCreate':_0x209af5}),'contact':_0x5e44e2===undefined?{}:_0x5e44e2,'contacts':_0x196e2f[_0x25c1('0x1d')]===0x0?undefined:_0x196e2f});}});}; \ No newline at end of file +var _0x0e85=['data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','name','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x0e85,0x7c));var _0x50e8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0e85[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x50e8('0x0'));var BPromise=require(_0x50e8('0x1'));var Redis=require('ioredis');var util=require(_0x50e8('0x2'));var config=require(_0x50e8('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x50e8('0x4')]=_['defaults'](config[_0x50e8('0x4')],{'host':_0x50e8('0x5'),'port':0x18eb});var io=require(_0x50e8('0x6'))(new Redis(config[_0x50e8('0x4')]));function emit(_0x5e8b01,_0x3ce904,_0x108edc,_0x42665e,_0x988da0){logger[_0x50e8('0x7')](_0x50e8('0x8'),_0x5e8b01,_0x3ce904['id'],_0x108edc,_0x42665e,JSON['stringify'](_0x988da0));io['to'](_0x108edc)[_0x50e8('0x9')](_0x42665e,_0x988da0);}exports[_0x50e8('0xa')]=function(_0x19d1bc,_0x2d4750,_0x154b9e,_0x194a89){var _0x45dc6f,_0x3d25ea;var _0x55ba0a={};var _0x56707f=Number(_0x154b9e[_0x50e8('0xb')]);var _0x24d381=_0x154b9e['data2']?Boolean(Number(_0x154b9e['data2'])):![];var _0x3cb45c;var _0x2abda1=![];if(!_[_0x50e8('0xc')](_0x154b9e[_0x50e8('0xd')])){if(_0x154b9e['data5']=='1')_0x2abda1=!![];}if(!_0x2abda1){if(_0x194a89[_0x50e8('0xe')]){_0x55ba0a['id']=_0x194a89[_0x50e8('0xe')];}}if(!_0x55ba0a['id']){_0x55ba0a[_0x50e8('0xf')]=_0x56707f;_0x3cb45c=_0x154b9e['data3']&&_0x154b9e['data3']!=='0'?_0x154b9e[_0x50e8('0x10')][_0x50e8('0x11')](','):[_0x50e8('0x12')];_0x55ba0a[_0x50e8('0x13')]=_[_0x50e8('0x14')](_0x3cb45c,function(_0x1f0338){var _0x5642bf={};_0x5642bf[_0x1f0338]=_0x194a89['routeId']?_0x194a89[_0x50e8('0x15')]:_0x194a89[_0x50e8('0x16')];return _0x5642bf;});}var _0x40d060=['id',_0x50e8('0x17'),_0x50e8('0x18'),_0x50e8('0x12'),_0x50e8('0x19'),'fax',_0x50e8('0xf'),'createdAt',_0x50e8('0x1a'),_0x50e8('0x1b')];var _0xd263d=_[_0x50e8('0x1c')](_0x40d060,_0x3cb45c);BPromise[_0x50e8('0x1d')]()['then'](cmContactRpc[_0x50e8('0x1e')]({'attributes':_0xd263d,'where':_0x55ba0a}))[_0x50e8('0x1f')](function(_0x58110d){_0x3d25ea=_0x58110d;if(!_[_0x50e8('0x20')](_0x3d25ea)){if(_0x3d25ea[_0x50e8('0x21')]===0x1){_0x45dc6f=_0x3d25ea[0x0];logger['info'](_0x50e8('0x22'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id'],_0x45dc6f['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x194a89['uniqueid'],_0x2d4750['id'],_[_0x50e8('0x14')](_0x3d25ea,'id')[_0x50e8('0x24')](','));}return;}else{logger[_0x50e8('0x7')](_0x50e8('0x25'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);var _0x13b6e9={'ListId':_0x56707f};var _0x53d848=_0x154b9e[_0x50e8('0x26')]&&_0x154b9e[_0x50e8('0x26')]!=='0'?_0x154b9e['data4']:_0x50e8('0x12');if(_0x24d381){logger[_0x50e8('0x7')](_0x50e8('0x27'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_['isNil'](_0x194a89[_0x50e8('0x28')])?_0x194a89['calleridnum']:_0x194a89[_0x50e8('0x15')];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9['firstName']=_0x194a89[_0x50e8('0x29')]&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x29')]:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89['destcalleridname']!==_0x50e8('0x2a')?_0x194a89[_0x50e8('0x2c')]:'Unknown';}return BPromise['resolve']()[_0x50e8('0x1f')](cmContactRpc[_0x50e8('0x2d')](_0x13b6e9))[_0x50e8('0x1f')](function(_0x47ace2){_0x45dc6f=_0x47ace2;_0x3d25ea['push'](_0x47ace2);if(_0x45dc6f){logger[_0x50e8('0x7')](_0x50e8('0x2e'),_0x194a89['uniqueid'],_0x2d4750['id'],_0x45dc6f['id']);}return;});}else{logger[_0x50e8('0x7')](_0x50e8('0x2f'),_0x194a89[_0x50e8('0x23')],_0x2d4750['id']);_0x13b6e9[_0x53d848]=_[_0x50e8('0xc')](_0x194a89['routeId'])?_0x194a89[_0x50e8('0x16')]:_0x194a89['destcalleridnum'];if(_[_0x50e8('0xc')](_0x194a89[_0x50e8('0x28')])){_0x13b6e9[_0x50e8('0x17')]=_0x194a89['calleridname']&&_0x194a89[_0x50e8('0x29')]!==_0x50e8('0x2a')?_0x194a89['calleridname']:_0x50e8('0x2b');}else{_0x13b6e9[_0x50e8('0x17')]=_0x194a89[_0x50e8('0x2c')]&&_0x194a89[_0x50e8('0x2c')]!==''?_0x194a89[_0x50e8('0x2c')]:_0x50e8('0x2b');}_0x45dc6f=_0x13b6e9;_0x3d25ea[_0x50e8('0x30')](_0x13b6e9);return;}}})[_0x50e8('0x1f')](function(){if(_0x19d1bc){emit(_0x194a89['uniqueid'],_0x2d4750,util[_0x50e8('0x31')](_0x50e8('0x32'),_0x19d1bc[_0x50e8('0x33')]),util['format']('trigger:%s',_0x154b9e['action'][_0x50e8('0x34')]()),{'evt':_[_0x50e8('0x35')](_0x194a89,{'autoCreate':_0x24d381}),'contact':_0x45dc6f===undefined?{}:_0x45dc6f,'contacts':_0x3d25ea[_0x50e8('0x21')]===0x0?undefined:_0x3d25ea});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 200cae0..3335729 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 _0x302e=['../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','checkTrigger','variables','Actions','length','action','toLowerCase','motionbar','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','data6','600','winArguments','format','user:%s','trigger:%s:%s','data1','merge','name','trigger:%s','integration','exec','script','parse','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','account','chat','ChatWebsiteId','operator','value','AccountId','interaction','message','event','queue','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger'];(function(_0x4619d1,_0x37b761){var _0x1627aa=function(_0x433f21){while(--_0x433f21){_0x4619d1['push'](_0x4619d1['shift']());}};_0x1627aa(++_0x37b761);}(_0x302e,0x1eb));var _0xe302=function(_0x251705,_0x47d86c){_0x251705=_0x251705-0x0;var _0x4c4ceb=_0x302e[_0x251705];return _0x4c4ceb;};'use strict';var util=require(_0xe302('0x0'));var _=require(_0xe302('0x1'));var url=require(_0xe302('0x2'));var Mustache=require(_0xe302('0x3'));var Redis=require('ioredis');var urlforward=require(_0xe302('0x4'));var integration=require(_0xe302('0x5'));var cmContact=require(_0xe302('0x6'));var script=require('./script');var config=require(_0xe302('0x7'));var logger=require(_0xe302('0x8'))('trigger');var ami=require(_0xe302('0x9'));config[_0xe302('0xa')]=_[_0xe302('0xb')](config[_0xe302('0xa')],{'host':_0xe302('0xc'),'port':0x18eb});var io=require(_0xe302('0xd'))(new Redis(config[_0xe302('0xa')]));var operators={'equals':function(_0x1155a5,_0x20fb43){return _0x1155a5==_0x20fb43;},'not_equals':function(_0xf85771,_0x3795dd){return _0xf85771!=_0x3795dd;}};var barAndWebActions=[_0xe302('0xe'),_0xe302('0x2'),_0xe302('0xf')];function Trigger(_0x122a22){this[_0xe302('0x10')]=_0x122a22['triggers'];this[_0xe302('0x11')]=_0x122a22['agents'];this[_0xe302('0x12')]=_0x122a22[_0xe302('0x12')];this['templates']=_0x122a22[_0xe302('0x13')];this[_0xe302('0x14')]=_0x122a22['voiceExtensions'];this[_0xe302('0x15')]=_0x122a22[_0xe302('0x15')];this['freshdeskAccounts']=_0x122a22[_0xe302('0x16')];this['salesforceAccounts']=_0x122a22[_0xe302('0x17')];this[_0xe302('0x18')]=_0x122a22[_0xe302('0x18')];this[_0xe302('0x19')]=_0x122a22['zohoAccounts'];this['deskAccounts']=_0x122a22[_0xe302('0x1a')];this[_0xe302('0x1b')]=_0x122a22[_0xe302('0x1b')];this['servicenowAccounts']=_0x122a22[_0xe302('0x1c')];this[_0xe302('0x1d')]=_0x122a22[_0xe302('0x1d')];this['freshsalesAccounts']=_0x122a22[_0xe302('0x1e')];this[_0xe302('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xe302('0x16')],'sugarcrm':this[_0xe302('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0xe302('0x1a')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xe302('0x1e')],'servicenow':this['servicenowAccounts']};ami['on'](_0xe302('0x20'),this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x23'),this['syncCustomEvent'][_0xe302('0x22')](this));ami['on']('custom:agentringnoanswer',this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x24'),this[_0xe302('0x21')]['bind'](this));ami['on'](_0xe302('0x25'),this['syncCustomEvent'][_0xe302('0x22')](this));ami['on'](_0xe302('0x26'),this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x27'),this[_0xe302('0x21')]['bind'](this));ami['on']('custom:agentcongestion',this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on']('custom:agentreject',this[_0xe302('0x21')]['bind'](this));ami['on'](_0xe302('0x28'),this['syncCustomEvent']['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xe302('0x21')]['bind'](this));ami['on'](_0xe302('0x29'),this['syncCustomEvent'][_0xe302('0x22')](this));ami['on'](_0xe302('0x2a'),this[_0xe302('0x2b')][_0xe302('0x22')](this));ami['on'](_0xe302('0x2c'),this[_0xe302('0x2b')][_0xe302('0x22')](this));ami['on'](_0xe302('0x2d'),this[_0xe302('0x2b')][_0xe302('0x22')](this));ami['on'](_0xe302('0x2e'),this[_0xe302('0x21')]['bind'](this));ami['on'](_0xe302('0x2f'),this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x30'),this['syncCustomEvent']['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xe302('0x22')](this));ami['on']('custom:outgoingmessage',this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x31'),this[_0xe302('0x21')][_0xe302('0x22')](this));ami['on'](_0xe302('0x32'),this[_0xe302('0x21')]['bind'](this));ami['on'](_0xe302('0x33'),this['syncCustomEvent']['bind'](this));}Trigger[_0xe302('0x34')][_0xe302('0x35')]=function(_0x4f3c2b,_0x4bd072,_0x29b859){logger[_0xe302('0x36')](_0x4f3c2b,_0x4bd072,JSON[_0xe302('0x37')](_0x29b859));io['to'](_0x4f3c2b)['emit'](_0x4bd072,_0x29b859);};Trigger[_0xe302('0x34')][_0xe302('0x21')]=function(_0x511ce7){var _0x25782d=_[_0xe302('0x38')](_0x511ce7);if(typeof _0x25782d[_0xe302('0x39')]===_0xe302('0x3a')){_0x25782d['motionChannel']=_0xe302('0x3b');}this[_0xe302('0x3c')](_0x25782d);};Trigger[_0xe302('0x34')][_0xe302('0x2b')]=function(_0x8bbd17){if(this[_0xe302('0x11')][_0x8bbd17[_0xe302('0x3d')]]){this[_0xe302('0x21')](_0x8bbd17);}};Trigger[_0xe302('0x34')][_0xe302('0x3c')]=function(_0x2d877b){var _0x1971d8;for(var _0x32c009 in this[_0xe302('0x10')]){if(this[_0xe302('0x10')][_0xe302('0x3e')](_0x32c009)){if(this[_0xe302('0x10')][_0x32c009]['status']){_0x1971d8=this[_0xe302('0x3f')](this[_0xe302('0x10')][_0x32c009],_0x2d877b);if(_0x1971d8){_['merge'](_0x2d877b,_0x2d877b[_0xe302('0x40')]);for(var _0xec1d61=0x0,_0x3732f4,_0x35b7dd,_0x456b30;_0xec1d610x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[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:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x13b247,_0x2c76b8){var _0x26e3ae=function(_0x5a9db7){while(--_0x5a9db7){_0x13b247['push'](_0x13b247['shift']());}};_0x26e3ae(++_0x2c76b8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 8f4683e..efda53e 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 _0xdde8=['value','isNil','validateEmail','userEmail','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','username','length','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','toLowerCase','replace','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','type','customField','indexOf','content','ticketType','incident','POST','assign','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection','queue','phonecalls','Fields','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','outbound','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20%s\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','ioredis','../../../../config/logger','dynamics365','defaults','socket.io-emitter','redis','clientId','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0'];(function(_0x23940b,_0x58b123){var _0x43f68b=function(_0x44ab3d){while(--_0x44ab3d){_0x23940b['push'](_0x23940b['shift']());}};_0x43f68b(++_0x58b123);}(_0xdde8,0x107));var _0x8dde=function(_0x3f89a1,_0x3edfcb){_0x3f89a1=_0x3f89a1-0x0;var _0x1995e7=_0xdde8[_0x3f89a1];return _0x1995e7;};'use strict';var _=require(_0x8dde('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x8dde('0x1'));var logger=require(_0x8dde('0x2'))(_0x8dde('0x3'));var config=require('../../../../config/environment');config['redis']=_[_0x8dde('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8dde('0x5'))(new Redis(config[_0x8dde('0x6')]));function getAuthToken(_0x59021c,_0x58c9bc,_0xb52d2e){var _0x45a779={'method':'POST','uri':_0x58c9bc,'form':{'client_id':_0x59021c[_0x8dde('0x7')],'resource':_0x59021c[_0x8dde('0x8')],'username':_0x59021c['username'],'password':_0x59021c['password'],'grant_type':_0x8dde('0x9'),'client_secret':_0x59021c[_0x8dde('0xa')]},'json':!![]};return rp(_0x45a779)[_0x8dde('0xb')](function(_0x4ba088){return _0x4ba088[_0x8dde('0xc')];})[_0x8dde('0xd')](function(_0x3d703f){logger[_0x8dde('0xe')]('['+[_0xb52d2e[_0x8dde('0xf')]()]+_0x8dde('0x10'));return _0x3d703f[_0x8dde('0x11')];});}function getUser(_0x2c09a9,_0x2c8d32,_0x26aa07,_0x3e1b7d,_0x52d0eb,_0x92a09d){return new BPromise(function(_0x7598f2,_0x50568b){return getAuthToken(_0x2c8d32,_0x3e1b7d,_0x92a09d)[_0x8dde('0xb')](function(_0x98e3bf){var _0x42abcc={'method':_0x8dde('0x12'),'uri':_0x52d0eb+_0x8dde('0x13'),'headers':{'Authorization':_0x8dde('0x14')+_0x98e3bf,'OData-Version':_0x8dde('0x15')},'json':!![]};return rp(_0x42abcc);})[_0x8dde('0xb')](function(_0x3b4220){var _0x3496dd=_0x3b4220[_0x8dde('0x16')];var _0x34aa32=![];var _0x24b546=null;if(!_[_0x8dde('0x17')](_0x26aa07)){if(intUtil[_0x8dde('0x18')](_0x26aa07['email'])){_0x2c09a9[_0x8dde('0x19')]=_0x26aa07['email'];for(_0x24b546=0x0;_0x24b546<_0x3496dd['length'];_0x24b546++){if(_0x3496dd[_0x24b546][_0x8dde('0x1a')]===_0x26aa07[_0x8dde('0x1b')]&&!_0x3496dd[_0x24b546][_0x8dde('0x1c')]){_0x34aa32=!![];logger[_0x8dde('0x1d')]('['+[_0x92a09d['toUpperCase']()]+_0x8dde('0x1e')+_0x3496dd[_0x24b546][_0x8dde('0x1f')]+'!');_0x2c09a9[_0x8dde('0x20')]=_0x3496dd[_0x24b546]['systemuserid'];}}}}if(!_0x34aa32){logger[_0x8dde('0x1d')]('['+[_0x92a09d['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2c09a9[_0x8dde('0x19')]=_0x2c8d32[_0x8dde('0x21')];for(_0x24b546=0x0;_0x24b546<_0x3496dd[_0x8dde('0x22')];_0x24b546++){if(_0x3496dd[_0x24b546][_0x8dde('0x1a')]===_0x2c8d32[_0x8dde('0x21')]){_0x2c09a9[_0x8dde('0x20')]=_0x3496dd[_0x24b546][_0x8dde('0x1f')];}}}_0x7598f2(_0x2c09a9);})[_0x8dde('0xd')](function(_0x4fd6fc){_0x50568b(_0x4fd6fc[_0x8dde('0x11')]);});});}function createEndUser(_0xade811,_0x23b117,_0x2a6fa1,_0x326283,_0x36f612,_0x221496){return new BPromise(function(_0x26d816,_0x482c10){return getAuthToken(_0x23b117,_0x2a6fa1,_0x221496)[_0x8dde('0xb')](function(_0xfd4120){var _0x4497a6=_0x221496['toLowerCase']()==='outbound'?_0x36f612['destcalleridnum']:_0x36f612[_0x8dde('0x23')];var _0x5f0370={'method':'POST','uri':_0x326283+_0x8dde('0x24'),'body':{'telephone1':_0x4497a6,'fullname':_0x4497a6,'firstname':_0x4497a6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8dde('0x25')+_0xade811[_0x8dde('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xfd4120,'OData-Version':_0x8dde('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5f0370);})[_0x8dde('0xb')](function(_0x20d332){var _0x255492=_0x20d332[_0x8dde('0x26')][_0x8dde('0x27')];var _0x56dc6b=_0x255492[_0x8dde('0x28')](_0x255492[_0x8dde('0x29')]('(')+0x1,_0x255492['lastIndexOf'](')'));_0xade811['enduserId']=_0x56dc6b;_0x26d816(_0xade811);})['catch'](function(_0xaf9bf6){_0x482c10(_0xaf9bf6['message']);});});}function getEndUser(_0x20e64f,_0x262f2a,_0x21aff2,_0x4c2b4f,_0x225c25,_0x14d76f,_0x30ac4a){var _0x106f69=_0x14d76f[_0x8dde('0x2a')]()==='outbound'?_0x225c25['destcalleridnum']:_0x225c25['calleridnum'];return getAuthToken(_0x262f2a,_0x21aff2,_0x14d76f)[_0x8dde('0xb')](function(_0x11704e){var _0xb66bd0={'method':_0x8dde('0x12'),'uri':_0x4c2b4f+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x106f69[_0x8dde('0x2b')]('+',_0x8dde('0x2c'))+'\x27','headers':{'Authorization':_0x8dde('0x14')+_0x11704e,'If-None-Match':null,'OData-Version':_0x8dde('0x15')},'json':!![]};return rp(_0xb66bd0);})[_0x8dde('0xb')](function(_0x6ce8f8){var _0x3c3202=![];if(!_0x6ce8f8)return _0x3c3202;var _0x517195=_0x6ce8f8[_0x8dde('0x16')];for(var _0x43e33b=0x0;_0x43e33b<_0x517195['length'];_0x43e33b++){if(_0x517195[_0x43e33b]['telephone1']===_0x106f69){_0x3c3202=!![];_0x20e64f[_0x8dde('0x2d')]=_0x517195[_0x43e33b][_0x8dde('0x2e')];}}return _0x3c3202;})[_0x8dde('0xb')](function(_0x58ecb6){if(_0x58ecb6)return _0x20e64f;if(_0x30ac4a===_0x8dde('0x2f')){logger[_0x8dde('0x1d')]('['+[_0x14d76f[_0x8dde('0xf')]()]+_0x8dde('0x30'));return _0x20e64f;}return createEndUser(_0x20e64f,_0x262f2a,_0x21aff2,_0x4c2b4f,_0x225c25,_0x14d76f)['then'](function(_0xd37423){logger['info']('['+[_0x14d76f[_0x8dde('0xf')]()]+_0x8dde('0x31'),_0xd37423['enduserId']);return _0xd37423;});});}function getCustomFields(_0x518652,_0x3e682f,_0xbac46b){var _0x51f2dd={};if(_0x518652[_0x8dde('0x22')]>0x0){_['forEach'](_0x518652,function(_0x2dd761){if(_[_0x8dde('0x32')]([_0x8dde('0x33'),_0x8dde('0x34')],_0x2dd761[_0x8dde('0x35')])&&_0x2dd761['nameField']&&!_0x2dd761[_0x8dde('0x36')]){var _0x5a4e59=_0x2dd761['idField']['toLowerCase']();var _0x1fd0d1=_0x5a4e59[_0x8dde('0x28')](0x0,_0x5a4e59[_0x8dde('0x37')]('_'));var _0x16eedf=_0x5a4e59[_0x8dde('0x28')](_0x5a4e59[_0x8dde('0x37')]('_')+0x1);if(_0x1fd0d1===_0xbac46b){_0x51f2dd[_0x16eedf]=_0x2dd761[_0x8dde('0x38')];}}});}return _0x51f2dd;}function getTicket(_0x25d3c7,_0x3f9d43,_0x78448a,_0x3503cc,_0x4fde37,_0x9badd7,_0x211bba){return new BPromise(function(_0x309628,_0x22aa79){var _0x4df657;return getAuthToken(_0x3f9d43,_0x78448a,_0x211bba)['then'](function(_0x3c159b){if(_0x9badd7[_0x8dde('0x39')]===_0x8dde('0x3a')){_0x4df657={'method':_0x8dde('0x3b'),'uri':_0x3503cc+'incidents','body':Object[_0x8dde('0x3c')]({},{'title':intUtil[_0x8dde('0x3d')](_0x9badd7[_0x8dde('0x3e')],_0x4fde37,'\x20'),'description':intUtil[_0x8dde('0x3d')](_0x9badd7[_0x8dde('0x3f')],_0x4fde37,'\x0a'),'customerid_contact@odata.bind':_0x25d3c7[_0x8dde('0x2d')]?_0x8dde('0x40')+_0x25d3c7['enduserId']+')':undefined,'ownerid@odata.bind':_0x8dde('0x25')+_0x25d3c7['userId']+')','caseorigincode':'1'},getCustomFields(_0x9badd7['Fields'],_0x4fde37,_0x9badd7[_0x8dde('0x39')])),'headers':{'Authorization':_0x8dde('0x14')+_0x3c159b,'OData-Version':_0x8dde('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x9badd7['ticketType']===_0x8dde('0x41')){var _0x5420d9=_0x25d3c7[_0x8dde('0x2d')]?[{'partyid_systemuser@odata.bind':_0x8dde('0x25')+_0x25d3c7[_0x8dde('0x20')]+')','participationtypemask':_0x25d3c7[_0x8dde('0x42')]===_0x8dde('0x43')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x25d3c7[_0x8dde('0x2d')]+')','participationtypemask':_0x25d3c7[_0x8dde('0x42')]===_0x8dde('0x43')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x8dde('0x25')+_0x25d3c7[_0x8dde('0x20')]+')','participationtypemask':_0x25d3c7[_0x8dde('0x42')]==='queue'?0x2:0x1}];_0x4df657={'method':_0x8dde('0x3b'),'uri':_0x3503cc+_0x8dde('0x44'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x9badd7[_0x8dde('0x3e')],_0x4fde37,'\x20'),'phonenumber':String(_0x4fde37[_0x8dde('0x23')]),'description':intUtil[_0x8dde('0x3d')](_0x9badd7[_0x8dde('0x3f')],_0x4fde37,'\x0a'),'regardingobjectid_contact@odata.bind':_0x25d3c7[_0x8dde('0x2d')]?'/contacts('+_0x25d3c7[_0x8dde('0x2d')]+')':undefined,'ownerid@odata.bind':_0x8dde('0x25')+_0x25d3c7[_0x8dde('0x20')]+')','directioncode':_0x25d3c7[_0x8dde('0x42')]===_0x8dde('0x43')?![]:!![],'phonecall_activity_parties':_0x5420d9},getCustomFields(_0x9badd7[_0x8dde('0x45')],_0x4fde37,_0x9badd7[_0x8dde('0x39')])),'headers':{'Authorization':_0x8dde('0x14')+_0x3c159b,'OData-Version':_0x8dde('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4df657);})[_0x8dde('0xb')](function(_0x115da7){var _0xfcc9c5=_0x115da7['headers']['odata-entityid'];var _0xda4d7a=_0xfcc9c5[_0x8dde('0x28')](_0xfcc9c5[_0x8dde('0x29')]('(')+0x1,_0xfcc9c5[_0x8dde('0x29')](')'));_0x25d3c7[_0x8dde('0x46')]=_0xda4d7a;_0x309628(_0x25d3c7);})[_0x8dde('0xd')](function(_0x124453){_0x22aa79(_0x124453[_0x8dde('0x11')]);});});}function emit(_0x4a6e34,_0x1a6643,_0x11aa2c,_0xd531ce){var _0x58e948={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x4a6e34,_0x11aa2c,_0xd531ce)};io['to'](util[_0x8dde('0x47')](_0x8dde('0x48'),_0x1a6643))[_0x8dde('0x49')](_0x8dde('0x4a'),_0x58e948);}exports['cs']=function(_0x4d6e8f,_0x29b4fe,_0x2becb6,_0x543a3f,_0x2bbb4f,_0x14428c,_0x541935,_0x209812){var _0x49b453={};_0x14428c[_0x8dde('0x8')]=intUtil[_0x8dde('0x4b')](_0x14428c[_0x8dde('0x8')]);_0x14428c[_0x8dde('0x4c')]=intUtil[_0x8dde('0x4b')](_0x14428c['serverUrl']);_0x49b453[_0x8dde('0x42')]=_0x209812===_0x8dde('0x43')||_0x209812==='unmanaged'?_0x8dde('0x43'):_0x8dde('0x4d');var _0x3d8968=util[_0x8dde('0x47')](_0x8dde('0x4e'),_0x14428c[_0x8dde('0x8')]);var _0x3a05ed=util[_0x8dde('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x14428c[_0x8dde('0x4f')]);var _0x3c3b83=util[_0x8dde('0x47')](_0x8dde('0x50'),_0x14428c['serverUrl'],_0x29b4fe[_0x8dde('0x51')],md5(_0x29b4fe['uniqueid']));if(_0x2bbb4f&&_0x2bbb4f[_0x8dde('0x52')]){logger['info'](_0x8dde('0x53'),_0x8dde('0x54'));_0x29b4fe['recordingURL']=_0x3c3b83;}else if(_0x541935&&_0x541935[_0x8dde('0x55')]&&_0x541935[_0x8dde('0x55')]!==_0x8dde('0x56')){logger['info'](_0x8dde('0x57'),_0x8dde('0x54'));_0x29b4fe[_0x8dde('0x58')]=_0x3c3b83;}else{_0x29b4fe[_0x8dde('0x58')]='';}return getUser(_0x49b453,_0x14428c,_0x543a3f,_0x3a05ed,_0x3d8968,_0x209812)[_0x8dde('0xb')](function(_0x56ee87){logger[_0x8dde('0x1d')]('['+_0x209812['toUpperCase']()+_0x8dde('0x59'),_0x56ee87['userId']);logger[_0x8dde('0x1d')]('['+_0x209812[_0x8dde('0xf')]()+_0x8dde('0x5a'),_0x56ee87[_0x8dde('0x19')]);return getEndUser(_0x56ee87,_0x14428c,_0x3a05ed,_0x3d8968,_0x29b4fe,_0x209812,_0x2becb6[_0x8dde('0x5b')]);})[_0x8dde('0xb')](function(_0x3fd783){logger[_0x8dde('0x1d')]('['+_0x209812['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x3fd783[_0x8dde('0x2d')]);logger[_0x8dde('0x1d')]('['+_0x209812['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x29b4fe['calleridnum']);return getTicket(_0x3fd783,_0x14428c,_0x3a05ed,_0x3d8968,_0x29b4fe,_0x2becb6,_0x209812);})[_0x8dde('0xb')](function(_0x2e2ae7){logger['info'](util['format']('['+_0x209812['toUpperCase']()+_0x8dde('0x5c'),_0x2becb6['ticketType'],_0x2e2ae7[_0x8dde('0x46')]));logger[_0x8dde('0x1d')](util[_0x8dde('0x47')]('['+_0x209812[_0x8dde('0xf')]()+']\x20Call\x20direction:\x20%s',_0x209812));if(_0x209812!=='unmanaged'){logger[_0x8dde('0x1d')]('['+_0x209812[_0x8dde('0xf')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x14428c['remoteUri'],_0x543a3f[_0x8dde('0x5d')],_0x2becb6[_0x8dde('0x39')],_0x2e2ae7[_0x8dde('0x46')]);}})['catch'](function(_0x349fdd){logger[_0x8dde('0xe')]('['+_0x209812['toUpperCase']()+_0x8dde('0x5e'),util['inspect'](_0x349fdd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x79db=['POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','info','systemuserid','userId','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1',']\x20Enduser\x20created!','includes','picklist','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','callDirection','queue','headers','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','md5','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter'];(function(_0x59355f,_0x3225d2){var _0x47264c=function(_0xfd30d5){while(--_0xfd30d5){_0x59355f['push'](_0x59355f['shift']());}};_0x47264c(++_0x3225d2);}(_0x79db,0x1af));var _0xb79d=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x79db[_0xcfe8cc];return _0x55ac53;};'use strict';var _=require(_0xb79d('0x0'));var BPromise=require('bluebird');var rp=require(_0xb79d('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0xb79d('0x2'));var Redis=require('ioredis');var logger=require(_0xb79d('0x3'))(_0xb79d('0x4'));var config=require('../../../../config/environment');config['redis']=_[_0xb79d('0x5')](config[_0xb79d('0x6')],{'host':_0xb79d('0x7'),'port':0x18eb});var io=require(_0xb79d('0x8'))(new Redis(config[_0xb79d('0x6')]));function getAuthToken(_0x38fe69,_0x11fa6f,_0x2eaaab){var _0x1ad876={'method':_0xb79d('0x9'),'uri':_0x11fa6f,'form':{'client_id':_0x38fe69[_0xb79d('0xa')],'resource':_0x38fe69[_0xb79d('0xb')],'username':_0x38fe69[_0xb79d('0xc')],'password':_0x38fe69['password'],'grant_type':_0xb79d('0xd'),'client_secret':_0x38fe69[_0xb79d('0xe')]},'json':!![]};return rp(_0x1ad876)[_0xb79d('0xf')](function(_0x206c82){return _0x206c82[_0xb79d('0x10')];})[_0xb79d('0x11')](function(_0x2cf5d1){logger[_0xb79d('0x12')]('['+[_0x2eaaab[_0xb79d('0x13')]()]+_0xb79d('0x14'));return _0x2cf5d1[_0xb79d('0x15')];});}function getUser(_0xfdeb46,_0x33dfdb,_0x482041,_0xfc7881,_0x2f23d3,_0x4e64db){return new BPromise(function(_0x127fcd,_0x3dab2f){return getAuthToken(_0x33dfdb,_0xfc7881,_0x4e64db)[_0xb79d('0xf')](function(_0x2db146){var _0xb917c8={'method':'GET','uri':_0x2f23d3+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xb79d('0x16')+_0x2db146,'OData-Version':_0xb79d('0x17')},'json':!![]};return rp(_0xb917c8);})[_0xb79d('0xf')](function(_0x4a0ec6){var _0xef5e33=_0x4a0ec6[_0xb79d('0x18')];var _0x2e9c21=![];var _0x1d898d=null;if(!_['isNil'](_0x482041)){if(intUtil[_0xb79d('0x19')](_0x482041[_0xb79d('0x1a')])){_0xfdeb46[_0xb79d('0x1b')]=_0x482041[_0xb79d('0x1a')];for(_0x1d898d=0x0;_0x1d898d<_0xef5e33[_0xb79d('0x1c')];_0x1d898d++){if(_0xef5e33[_0x1d898d][_0xb79d('0x1d')]===_0x482041[_0xb79d('0x1a')]&&!_0xef5e33[_0x1d898d]['isdisabled']){_0x2e9c21=!![];logger[_0xb79d('0x1e')]('['+[_0x4e64db['toUpperCase']()]+']\x20Agent\x20found\x20'+_0xef5e33[_0x1d898d][_0xb79d('0x1f')]+'!');_0xfdeb46[_0xb79d('0x20')]=_0xef5e33[_0x1d898d][_0xb79d('0x1f')];}}}}if(!_0x2e9c21){logger[_0xb79d('0x1e')]('['+[_0x4e64db['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xfdeb46[_0xb79d('0x1b')]=_0x33dfdb[_0xb79d('0xc')];for(_0x1d898d=0x0;_0x1d898d<_0xef5e33[_0xb79d('0x1c')];_0x1d898d++){if(_0xef5e33[_0x1d898d][_0xb79d('0x1d')]===_0x33dfdb[_0xb79d('0xc')]){_0xfdeb46[_0xb79d('0x20')]=_0xef5e33[_0x1d898d][_0xb79d('0x1f')];}}}_0x127fcd(_0xfdeb46);})[_0xb79d('0x11')](function(_0x4bda1f){_0x3dab2f(_0x4bda1f['message']);});});}function createEndUser(_0x132312,_0x46ded1,_0x1847f8,_0x4564d9,_0x34bd83,_0x1529ea){return new BPromise(function(_0x820b83,_0x534d42){return getAuthToken(_0x46ded1,_0x1847f8,_0x1529ea)[_0xb79d('0xf')](function(_0x647b39){var _0x425c75=_0x1529ea[_0xb79d('0x21')]()==='outbound'?_0x34bd83[_0xb79d('0x22')]:_0x34bd83[_0xb79d('0x23')];var _0x52986b={'method':_0xb79d('0x9'),'uri':_0x4564d9+_0xb79d('0x24'),'body':{'telephone1':_0x425c75,'fullname':_0x425c75,'firstname':_0x425c75,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb79d('0x25')+_0x132312[_0xb79d('0x20')]+')'},'headers':{'Authorization':_0xb79d('0x16')+_0x647b39,'OData-Version':_0xb79d('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x52986b);})[_0xb79d('0xf')](function(_0x145d51){var _0x339e34=_0x145d51['headers'][_0xb79d('0x26')];var _0x995696=_0x339e34[_0xb79d('0x27')](_0x339e34[_0xb79d('0x28')]('(')+0x1,_0x339e34[_0xb79d('0x28')](')'));_0x132312[_0xb79d('0x29')]=_0x995696;_0x820b83(_0x132312);})[_0xb79d('0x11')](function(_0x1aab65){_0x534d42(_0x1aab65[_0xb79d('0x15')]);});});}function getEndUser(_0x11c28e,_0x5b87bf,_0x27d0da,_0x4baa05,_0x4f3d3b,_0x1e64c3,_0x4d09ee){var _0xf362de=_0x1e64c3['toLowerCase']()===_0xb79d('0x2a')?_0x4f3d3b['destcalleridnum']:_0x4f3d3b[_0xb79d('0x23')];return getAuthToken(_0x5b87bf,_0x27d0da,_0x1e64c3)[_0xb79d('0xf')](function(_0x48bebb){var _0x35a56d={'method':_0xb79d('0x2b'),'uri':_0x4baa05+_0xb79d('0x2c')+_0xf362de['replace']('+',_0xb79d('0x2d'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x48bebb,'If-None-Match':null,'OData-Version':_0xb79d('0x17')},'json':!![]};return rp(_0x35a56d);})[_0xb79d('0xf')](function(_0x4e611b){var _0x5d8c33=![];if(!_0x4e611b)return _0x5d8c33;var _0x373d35=_0x4e611b[_0xb79d('0x18')];for(var _0x1e7ed3=0x0;_0x1e7ed3<_0x373d35[_0xb79d('0x1c')];_0x1e7ed3++){if(_0x373d35[_0x1e7ed3][_0xb79d('0x2e')]===_0xf362de){_0x5d8c33=!![];_0x11c28e[_0xb79d('0x29')]=_0x373d35[_0x1e7ed3]['contactid'];}}return _0x5d8c33;})[_0xb79d('0xf')](function(_0x11003e){if(_0x11003e)return _0x11c28e;if(_0x4d09ee==='nothing'){logger[_0xb79d('0x1e')]('['+[_0x1e64c3[_0xb79d('0x13')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x11c28e;}return createEndUser(_0x11c28e,_0x5b87bf,_0x27d0da,_0x4baa05,_0x4f3d3b,_0x1e64c3)['then'](function(_0x44c6b6){logger[_0xb79d('0x1e')]('['+[_0x1e64c3[_0xb79d('0x13')]()]+_0xb79d('0x2f'),_0x44c6b6[_0xb79d('0x29')]);return _0x44c6b6;});});}function getCustomFields(_0x396434,_0x278e5a,_0x584184){var _0x4b2a77={};if(_0x396434[_0xb79d('0x1c')]>0x0){_['forEach'](_0x396434,function(_0x36fa16){if(_[_0xb79d('0x30')](['string',_0xb79d('0x31')],_0x36fa16['type'])&&_0x36fa16[_0xb79d('0x32')]&&!_0x36fa16[_0xb79d('0x33')]){var _0x4ea0d7=_0x36fa16[_0xb79d('0x34')][_0xb79d('0x21')]();var _0x7a68a2=_0x4ea0d7['substring'](0x0,_0x4ea0d7[_0xb79d('0x35')]('_'));var _0x382466=_0x4ea0d7[_0xb79d('0x27')](_0x4ea0d7[_0xb79d('0x35')]('_')+0x1);if(_0x7a68a2===_0x584184){_0x4b2a77[_0x382466]=_0x36fa16[_0xb79d('0x36')];}}});}return _0x4b2a77;}function getTicket(_0x5ad9ab,_0x53b5e7,_0x8c4ea9,_0x164bbd,_0x180f71,_0x47dc6f,_0xbf347){return new BPromise(function(_0x63ec42,_0x801908){var _0x517c8b;return getAuthToken(_0x53b5e7,_0x8c4ea9,_0xbf347)[_0xb79d('0xf')](function(_0x5ae0d5){if(_0x47dc6f[_0xb79d('0x37')]===_0xb79d('0x38')){_0x517c8b={'method':_0xb79d('0x9'),'uri':_0x164bbd+_0xb79d('0x39'),'body':Object[_0xb79d('0x3a')]({},{'title':intUtil['getString'](_0x47dc6f[_0xb79d('0x3b')],_0x180f71,'\x20'),'description':intUtil[_0xb79d('0x3c')](_0x47dc6f[_0xb79d('0x3d')],_0x180f71,'\x0a'),'customerid_contact@odata.bind':_0x5ad9ab[_0xb79d('0x29')]?_0xb79d('0x3e')+_0x5ad9ab['enduserId']+')':undefined,'ownerid@odata.bind':_0xb79d('0x25')+_0x5ad9ab[_0xb79d('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x47dc6f[_0xb79d('0x3f')],_0x180f71,_0x47dc6f['ticketType'])),'headers':{'Authorization':_0xb79d('0x16')+_0x5ae0d5,'OData-Version':_0xb79d('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47dc6f[_0xb79d('0x37')]==='phonecall'){var _0x575ba7=_0x5ad9ab['enduserId']?[{'partyid_systemuser@odata.bind':_0xb79d('0x25')+_0x5ad9ab[_0xb79d('0x20')]+')','participationtypemask':_0x5ad9ab[_0xb79d('0x40')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xb79d('0x3e')+_0x5ad9ab['enduserId']+')','participationtypemask':_0x5ad9ab['callDirection']===_0xb79d('0x41')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5ad9ab[_0xb79d('0x20')]+')','participationtypemask':_0x5ad9ab[_0xb79d('0x40')]===_0xb79d('0x41')?0x2:0x1}];_0x517c8b={'method':'POST','uri':_0x164bbd+'phonecalls','body':Object[_0xb79d('0x3a')]({},{'subject':intUtil[_0xb79d('0x3c')](_0x47dc6f['Subjects'],_0x180f71,'\x20'),'phonenumber':String(_0x180f71['calleridnum']),'description':intUtil[_0xb79d('0x3c')](_0x47dc6f[_0xb79d('0x3d')],_0x180f71,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5ad9ab[_0xb79d('0x29')]?'/contacts('+_0x5ad9ab[_0xb79d('0x29')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5ad9ab['userId']+')','directioncode':_0x5ad9ab[_0xb79d('0x40')]===_0xb79d('0x41')?![]:!![],'phonecall_activity_parties':_0x575ba7},getCustomFields(_0x47dc6f['Fields'],_0x180f71,_0x47dc6f['ticketType'])),'headers':{'Authorization':_0xb79d('0x16')+_0x5ae0d5,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x517c8b);})[_0xb79d('0xf')](function(_0x3cb885){var _0x2e3c59=_0x3cb885[_0xb79d('0x42')][_0xb79d('0x26')];var _0x373969=_0x2e3c59[_0xb79d('0x27')](_0x2e3c59[_0xb79d('0x28')]('(')+0x1,_0x2e3c59[_0xb79d('0x28')](')'));_0x5ad9ab[_0xb79d('0x43')]=_0x373969;_0x63ec42(_0x5ad9ab);})[_0xb79d('0x11')](function(_0x3662e9){_0x801908(_0x3662e9[_0xb79d('0x15')]);});});}function emit(_0x3c4523,_0x51bae4,_0xafa750,_0xd2839d){var _0xded16c={'uri':util[_0xb79d('0x44')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x3c4523,_0xafa750,_0xd2839d)};io['to'](util['format'](_0xb79d('0x45'),_0x51bae4))[_0xb79d('0x46')](_0xb79d('0x47'),_0xded16c);}exports['cs']=function(_0x49e3fa,_0x4e7e10,_0x324055,_0x1ea33c,_0x24ada0,_0x453a0a,_0x43010f,_0x4e56ec){var _0x13a47a={};_0x453a0a[_0xb79d('0xb')]=intUtil[_0xb79d('0x48')](_0x453a0a[_0xb79d('0xb')]);_0x453a0a[_0xb79d('0x49')]=intUtil[_0xb79d('0x48')](_0x453a0a['serverUrl']);_0x13a47a[_0xb79d('0x40')]=_0x4e56ec==='queue'||_0x4e56ec==='unmanaged'?_0xb79d('0x41'):'outbound';var _0x57ee9e=util[_0xb79d('0x44')](_0xb79d('0x4a'),_0x453a0a['remoteUri']);var _0x234aab=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x453a0a['tenantId']);var _0x5889cb=util[_0xb79d('0x44')](_0xb79d('0x4b'),_0x453a0a[_0xb79d('0x49')],_0x4e7e10[_0xb79d('0x4c')],md5(_0x4e7e10[_0xb79d('0x4c')]));if(_0x24ada0&&_0x24ada0[_0xb79d('0x4d')]){logger['info']('[QUEUE]',_0xb79d('0x4e'));_0x4e7e10[_0xb79d('0x4f')]=_0x5889cb;}else if(_0x43010f&&_0x43010f[_0xb79d('0x50')]&&_0x43010f[_0xb79d('0x50')]!=='none'){logger['info'](_0xb79d('0x51'),_0xb79d('0x4e'));_0x4e7e10[_0xb79d('0x4f')]=_0x5889cb;}else{_0x4e7e10[_0xb79d('0x4f')]='';}return getUser(_0x13a47a,_0x453a0a,_0x1ea33c,_0x234aab,_0x57ee9e,_0x4e56ec)['then'](function(_0x4cb991){logger[_0xb79d('0x1e')]('['+_0x4e56ec['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x4cb991[_0xb79d('0x20')]);logger[_0xb79d('0x1e')]('['+_0x4e56ec['toUpperCase']()+_0xb79d('0x52'),_0x4cb991[_0xb79d('0x1b')]);return getEndUser(_0x4cb991,_0x453a0a,_0x234aab,_0x57ee9e,_0x4e7e10,_0x4e56ec,_0x324055[_0xb79d('0x53')]);})['then'](function(_0x2fbaac){logger[_0xb79d('0x1e')]('['+_0x4e56ec['toUpperCase']()+_0xb79d('0x54'),_0x2fbaac['enduserId']);logger[_0xb79d('0x1e')]('['+_0x4e56ec['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x4e7e10[_0xb79d('0x23')]);return getTicket(_0x2fbaac,_0x453a0a,_0x234aab,_0x57ee9e,_0x4e7e10,_0x324055,_0x4e56ec);})[_0xb79d('0xf')](function(_0x1ddf68){logger['info'](util['format']('['+_0x4e56ec[_0xb79d('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x324055[_0xb79d('0x37')],_0x1ddf68[_0xb79d('0x43')]));logger[_0xb79d('0x1e')](util['format']('['+_0x4e56ec[_0xb79d('0x13')]()+']\x20Call\x20direction:\x20%s',_0x4e56ec));if(_0x4e56ec!==_0xb79d('0x55')){logger[_0xb79d('0x1e')]('['+_0x4e56ec[_0xb79d('0x13')]()+']',_0xb79d('0x56'));emit(_0x453a0a['remoteUri'],_0x1ea33c['name'],_0x324055[_0xb79d('0x37')],_0x1ddf68[_0xb79d('0x43')]);}})['catch'](function(_0x53a72b){logger[_0xb79d('0x12')]('['+_0x4e56ec[_0xb79d('0x13')]()+_0xb79d('0x57'),util['inspect'](_0x53a72b,{'showHidden':!![],'depth':null}));});}; \ 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 520fe6f..fb38fdb 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 _0x697d=['POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','defaults','map','forEach','includes','string','picklist','type','toLowerCase','content','idField','customField','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri'];(function(_0x5aa8e0,_0x1e552c){var _0x4f4060=function(_0x247415){while(--_0x247415){_0x5aa8e0['push'](_0x5aa8e0['shift']());}};_0x4f4060(++_0x1e552c);}(_0x697d,0x1c2));var _0xd697=function(_0x3a1044,_0x26b0c3){_0x3a1044=_0x3a1044-0x0;var _0x37e92d=_0x697d[_0x3a1044];return _0x37e92d;};'use strict';var _=require(_0xd697('0x0'));var rp=require(_0xd697('0x1'));var md5=require(_0xd697('0x2'));var util=require(_0xd697('0x3'));var Redis=require(_0xd697('0x4'));var intUtil=require(_0xd697('0x5'));var config=require(_0xd697('0x6'));var logger=require(_0xd697('0x7'))(_0xd697('0x8'));config[_0xd697('0x9')]=_['defaults'](config[_0xd697('0x9')],{'host':_0xd697('0xa'),'port':0x18eb});var io=require(_0xd697('0xb'))(new Redis(config[_0xd697('0x9')]));var headers={'Content-Type':_0xd697('0xc'),'Accept':_0xd697('0xc')};function emit(_0x4333e2,_0xa5304c,_0x1e34f4){io['to'](_0x4333e2)[_0xd697('0xd')](_0xa5304c,_0x1e34f4);}function getTicket(_0x1551b2,_0x1072ab,_0x378ec0,_0x1b8750,_0x1efb71){logger[_0xd697('0xe')](_0xd697('0xf'));var _0x47767c=_['merge']({'responder_id':_0x1072ab['id'],'requester_id':_0x378ec0['id'],'name':util[_0xd697('0x10')](_0xd697('0x11'),_0x1efb71[_0xd697('0x12')]),'phone':_0x1efb71[_0xd697('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd697('0x14')](_0x1b8750['Subjects'],_0x1efb71,'\x20'),'description':intUtil[_0xd697('0x14')](_0x1b8750[_0xd697('0x15')],_0x1efb71,_0xd697('0x16')),'tags':getTags(_0x1b8750[_0xd697('0x17')],'name')},getCustomFields(_0x1b8750[_0xd697('0x18')],_0x1efb71));_0x47767c['custom_fields']=_['mapValues'](_[_0xd697('0x19')](_0x47767c[_0xd697('0x1a')],'id'),_0xd697('0x1b'));return request({'uri':util[_0xd697('0x10')](_0xd697('0x1c'),_0x1551b2[_0xd697('0x1d')]),'method':_0xd697('0x1e'),'body':_0x47767c})[_0xd697('0x1f')](function(_0x30fecd){logger['info'](_0xd697('0x20'));return _0x30fecd;});}function getUser(_0x3673f0,_0x38f23d){if(intUtil[_0xd697('0x21')](_0x38f23d)){return request({'uri':util[_0xd697('0x10')]('%s/api/v2/agents',_0x3673f0['remoteUri']),'qs':{'email':_0x38f23d}})['then'](function(_0x29e5d7){if(_0x29e5d7['length']){logger[_0xd697('0xe')](_0xd697('0x22'));return _[_0xd697('0x23')](_0x29e5d7,function(_0x51b243){return _0x51b243[_0xd697('0x24')][_0xd697('0x25')]===_0x38f23d;});}else{logger['info'](_0xd697('0x26'));return request({'uri':util['format'](_0xd697('0x27'),_0x3673f0['remoteUri'])})[_0xd697('0x1f')](function(_0x5cb1c5){logger[_0xd697('0xe')](_0xd697('0x28'));return _0x5cb1c5;});}});}else{logger[_0xd697('0xe')](_0xd697('0x29'));return request({'uri':util[_0xd697('0x10')](_0xd697('0x27'),_0x3673f0[_0xd697('0x1d')])})[_0xd697('0x1f')](function(_0x1f4d0f){logger[_0xd697('0xe')]('Admin\x20account\x20selected.');return _0x1f4d0f;});}}function getEndUser(_0x21833e,_0x3d5979,_0x448fca){logger[_0xd697('0xe')](_0xd697('0x2a'),_0x448fca);return request({'uri':util[_0xd697('0x10')](_0xd697('0x2b'),_0x21833e[_0xd697('0x1d')]),'qs':{'phone':_0x448fca}})[_0xd697('0x1f')](function(_0x3675ee){if(_0x3675ee[_0xd697('0x2c')]){logger[_0xd697('0xe')]('Enduser\x20found!');return _[_0xd697('0x23')](_0x3675ee,{'phone':_0x448fca});}else{logger[_0xd697('0xe')](_0xd697('0x2d'));return request({'uri':util[_0xd697('0x10')]('%s/api/v2/contacts',_0x21833e[_0xd697('0x1d')]),'method':_0xd697('0x1e'),'body':{'name':_0x3d5979,'phone':_0x448fca}})[_0xd697('0x1f')](function(_0x16f182){logger[_0xd697('0xe')]('Enduser\x20created.');return _0x16f182;});}});}function getAuth(_0x2f5201){return util[_0xd697('0x10')](_0xd697('0x2e'),new Buffer(_0x2f5201[_0xd697('0x2f')]+':X')[_0xd697('0x30')](_0xd697('0x31')));}function request(_0x5656a8){logger['debug'](_0xd697('0x32'),JSON[_0xd697('0x33')](_0x5656a8));return rp(_[_0xd697('0x34')](_0x5656a8,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4866bf,_0x1f5e16){var _0xf4b92f=[];if(_0x4866bf&&_0x4866bf['length']>0x0){_0xf4b92f=_[_0xd697('0x35')](_0x4866bf,_0x1f5e16);}return _0xf4b92f;}function getCustomFields(_0x420150,_0x3665ec){var _0x53c50d=[];var _0x464e21={'custom_fields':[]};if(_0x420150[_0xd697('0x2c')]>0x0){_[_0xd697('0x36')](_0x420150,function(_0x2b30b1){if(_[_0xd697('0x37')]([_0xd697('0x38'),_0xd697('0x39')],_0x2b30b1[_0xd697('0x3a')])&&_0x2b30b1['nameField']&&!_0x2b30b1['customField']){_0x464e21[_0x2b30b1['nameField'][_0xd697('0x3b')]()]=_0x2b30b1[_0xd697('0x3c')][_0xd697('0x30')]();}else if(_['includes'](['string',_0xd697('0x39')],_0x2b30b1[_0xd697('0x3a')])&&_0x2b30b1[_0xd697('0x3d')]&&_0x2b30b1[_0xd697('0x3e')]){_0x464e21['custom_fields']['push']({'id':_0x2b30b1[_0xd697('0x3d')],'value':_0x2b30b1[_0xd697('0x3c')][_0xd697('0x30')]()});}else if(_0x2b30b1['type']==='variable'&&_0x2b30b1[_0xd697('0x3f')]&&_0x2b30b1[_0xd697('0x3d')]&&_0x2b30b1['customField']){_0x3665ec[_0x2b30b1['variableName']]&&_0x464e21[_0xd697('0x1a')][_0xd697('0x40')]({'id':_0x2b30b1[_0xd697('0x3d')],'value':_0x3665ec[_0x2b30b1[_0xd697('0x3f')]][_0xd697('0x30')]()});}else if(_0x2b30b1['type']===_0xd697('0x41')&&_0x2b30b1[_0xd697('0x42')]&&_0x2b30b1[_0xd697('0x42')][_0xd697('0x43')]&&_0x2b30b1[_0xd697('0x3d')]&&_0x2b30b1['customField']){_0x3665ec[_0x2b30b1[_0xd697('0x42')][_0xd697('0x43')][_0xd697('0x3b')]()]&&_0x464e21['custom_fields']['push']({'id':_0x2b30b1['idField'],'value':_0x3665ec[_0x2b30b1[_0xd697('0x42')][_0xd697('0x43')][_0xd697('0x3b')]()]['toString']()});}});}return _0x464e21;}exports[_0xd697('0x44')]=function(_0x336c6c,_0x2eecf1,_0x6965b,_0x78a19,_0x111757,_0x565e99){var _0x170d91,_0x31c428;_0x565e99['remoteUri']=intUtil[_0xd697('0x45')](_0x565e99['remoteUri']);_0x565e99[_0xd697('0x46')]=intUtil[_0xd697('0x45')](_0x565e99[_0xd697('0x46')]);if(_0x111757&&_0x111757[_0xd697('0x47')]){logger['info']('[QUEUE]',_0xd697('0x48'));_0x2eecf1[_0xd697('0x49')]=util['format'](_0xd697('0x4a'),_0x565e99['serverUrl'],_0x2eecf1[_0xd697('0x4b')],md5(_0x2eecf1[_0xd697('0x4b')]));}else{_0x2eecf1[_0xd697('0x49')]='';}headers[_0xd697('0x4c')]=getAuth(_0x565e99);return getUser(_0x565e99,_0x78a19[_0xd697('0x25')])[_0xd697('0x1f')](function(_0x25f88f){_0x170d91=_0x25f88f;logger[_0xd697('0xe')](_0xd697('0x4d'),_0x170d91['id']);return getEndUser(_0x565e99,_0x2eecf1[_0xd697('0x12')],_0x2eecf1['calleridnum']);})[_0xd697('0x1f')](function(_0x1db29d){_0x31c428=_0x1db29d;logger[_0xd697('0xe')]('The\x20Enduser\x20ID\x20is:',_0x31c428['id']);return getTicket(_0x565e99,_0x170d91,_0x31c428,_0x6965b,_0x2eecf1);})[_0xd697('0x1f')](function(_0x4f908c){if(_0x4f908c&&_0x4f908c['id']){logger[_0xd697('0xe')](_0xd697('0x20'));logger[_0xd697('0xe')]('The\x20Ticket\x20ID\x20is:',_0x4f908c['id']);logger[_0xd697('0xe')](_0xd697('0x4e'),_0xd697('0x4f'));emit(util[_0xd697('0x10')]('user:%s',_0x78a19[_0xd697('0x43')]),_0xd697('0x50'),{'uri':util['format'](_0xd697('0x51'),_0x565e99[_0xd697('0x1d')],_0x4f908c['id'])});}})['catch'](function(_0x2591fc){logger[_0xd697('0x52')](_0xd697('0x4e'),JSON['stringify'](_0x2591fc));});};exports[_0xd697('0x53')]=function(_0x1f0efe,_0x3be6c1,_0x31397f,_0x2a27f8,_0xd2c97e,_0x2da74b,_0x410755){var _0x329c7f,_0x17fedd;_0x2da74b[_0xd697('0x1d')]=intUtil[_0xd697('0x45')](_0x2da74b[_0xd697('0x1d')]);_0x2da74b[_0xd697('0x46')]=intUtil[_0xd697('0x45')](_0x2da74b[_0xd697('0x46')]);if(_0x410755&&_0x410755[_0xd697('0x54')]&&_0x410755[_0xd697('0x54')]!==_0xd697('0x55')){logger[_0xd697('0xe')](_0xd697('0x56'),_0xd697('0x48'));_0x3be6c1['recordingURL']=util[_0xd697('0x10')](_0xd697('0x4a'),_0x2da74b['serverUrl'],_0x3be6c1['uniqueid'],md5(_0x3be6c1['uniqueid']));}headers['Authorization']=getAuth(_0x2da74b);return getUser(_0x2da74b,_0x2a27f8[_0xd697('0x25')])[_0xd697('0x1f')](function(_0xbecbb8){_0x329c7f=_0xbecbb8;logger[_0xd697('0xe')]('The\x20User\x20ID\x20is:',_0x329c7f['id']);return getEndUser(_0x2da74b,_0x3be6c1[_0xd697('0x57')],_0x3be6c1[_0xd697('0x58')]);})[_0xd697('0x1f')](function(_0x8f4909){_0x17fedd=_0x8f4909;logger['info'](_0xd697('0x59'),_0x17fedd['id']);return getTicket(_0x2da74b,_0x329c7f,_0x17fedd,_0x31397f,_0x3be6c1);})['then'](function(_0x3cadbd){if(_0x3cadbd&&_0x3cadbd['id']){logger[_0xd697('0xe')]('Ticket\x20created!');logger[_0xd697('0xe')](_0xd697('0x5a'),_0x3cadbd['id']);logger['info'](_0xd697('0x56'),_0xd697('0x4f'));emit(util['format'](_0xd697('0x5b'),_0x2a27f8['name']),_0xd697('0x50'),{'uri':util[_0xd697('0x10')](_0xd697('0x51'),_0x2da74b[_0xd697('0x1d')],_0x3cadbd['id'])});}})['catch'](function(_0x2f525a){logger['error'](_0xd697('0x56'),JSON['stringify'](_0x2f525a));});};exports[_0xd697('0x5c')]=function(_0x3fa059,_0x5e987c,_0x558b64,_0x557c8f,_0x10697b,_0x105bc){var _0x2ceae3,_0x30269e;_0x105bc[_0xd697('0x1d')]=intUtil[_0xd697('0x45')](_0x105bc['remoteUri']);_0x105bc[_0xd697('0x46')]=intUtil[_0xd697('0x45')](_0x105bc[_0xd697('0x46')]);if(_0x10697b&&_0x10697b['monitor_format']){logger[_0xd697('0xe')]('['+_0x5e987c[_0xd697('0x5d')][_0xd697('0x5e')]()+']',_0xd697('0x48'));_0x5e987c[_0xd697('0x49')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x105bc[_0xd697('0x46')],_0x5e987c[_0xd697('0x4b')],md5(_0x5e987c['uniqueid']));}else{_0x5e987c[_0xd697('0x49')]='';}headers[_0xd697('0x4c')]=getAuth(_0x105bc);return getUser(_0x105bc,'')[_0xd697('0x1f')](function(_0x55cecb){_0x2ceae3=_0x55cecb;logger['info']('The\x20User\x20ID\x20is:',_0x2ceae3['id']);return getEndUser(_0x105bc,_0x5e987c[_0xd697('0x12')],_0x5e987c['calleridnum']);})[_0xd697('0x1f')](function(_0x4fe180){_0x30269e=_0x4fe180;logger[_0xd697('0xe')](_0xd697('0x59'),_0x30269e['id']);return getTicket(_0x105bc,_0x2ceae3,_0x30269e,_0x558b64,_0x5e987c);})['then'](function(_0xd03bb2){if(_0xd03bb2){logger[_0xd697('0xe')](_0xd697('0x20'));logger[_0xd697('0xe')](_0xd697('0x5a'),_0xd03bb2['id']);}})[_0xd697('0x5f')](function(_0x246cc2){logger[_0xd697('0x52')]('['+_0x5e987c['lastevent'][_0xd697('0x5e')]()+']',JSON[_0xd697('0x33')](_0x246cc2));});}; \ No newline at end of file +var _0xbdca=['customField','toLowerCase','content','includes','picklist','idField','variable','variableName','push','name','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','stringify','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','util','./util','../../../../config/environment','defaults','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','calleridname','calleridnum','getString','
','custom_fields','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','string','type','nameField'];(function(_0x236eee,_0x32421f){var _0x1dd280=function(_0x2250c6){while(--_0x2250c6){_0x236eee['push'](_0x236eee['shift']());}};_0x1dd280(++_0x32421f);}(_0xbdca,0x1ea));var _0xabdc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbdca[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xabdc('0x0'));var rp=require(_0xabdc('0x1'));var md5=require(_0xabdc('0x2'));var util=require(_0xabdc('0x3'));var Redis=require('ioredis');var intUtil=require(_0xabdc('0x4'));var config=require(_0xabdc('0x5'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0xabdc('0x6')](config[_0xabdc('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xabdc('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xabdc('0x9')};function emit(_0x3a04c6,_0x445ac0,_0x48ef67){io['to'](_0x3a04c6)['emit'](_0x445ac0,_0x48ef67);}function getTicket(_0x347dab,_0x460bd6,_0x233ce3,_0x1c53d1,_0x49fcd0){logger[_0xabdc('0xa')](_0xabdc('0xb'));var _0x24fca9=_['merge']({'responder_id':_0x460bd6['id'],'requester_id':_0x233ce3['id'],'name':util[_0xabdc('0xc')]('Caller\x20-\x20%s',_0x49fcd0[_0xabdc('0xd')]),'phone':_0x49fcd0[_0xabdc('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xabdc('0xf')](_0x1c53d1['Subjects'],_0x49fcd0,'\x20'),'description':intUtil['getString'](_0x1c53d1['Descriptions'],_0x49fcd0,_0xabdc('0x10')),'tags':getTags(_0x1c53d1['Tags'],'name')},getCustomFields(_0x1c53d1['Fields'],_0x49fcd0));_0x24fca9[_0xabdc('0x11')]=_['mapValues'](_[_0xabdc('0x12')](_0x24fca9['custom_fields'],'id'),_0xabdc('0x13'));return request({'uri':util[_0xabdc('0xc')](_0xabdc('0x14'),_0x347dab['remoteUri']),'method':_0xabdc('0x15'),'body':_0x24fca9})[_0xabdc('0x16')](function(_0x14bd05){logger['info'](_0xabdc('0x17'));return _0x14bd05;});}function getUser(_0x28083c,_0x279817){if(intUtil[_0xabdc('0x18')](_0x279817)){return request({'uri':util[_0xabdc('0xc')]('%s/api/v2/agents',_0x28083c[_0xabdc('0x19')]),'qs':{'email':_0x279817}})[_0xabdc('0x16')](function(_0x1ac98d){if(_0x1ac98d[_0xabdc('0x1a')]){logger[_0xabdc('0xa')](_0xabdc('0x1b'));return _[_0xabdc('0x1c')](_0x1ac98d,function(_0x10d74b){return _0x10d74b[_0xabdc('0x1d')][_0xabdc('0x1e')]===_0x279817;});}else{logger[_0xabdc('0xa')](_0xabdc('0x1f'));return request({'uri':util[_0xabdc('0xc')]('%s/api/v2/agents/me',_0x28083c[_0xabdc('0x19')])})[_0xabdc('0x16')](function(_0x4157e7){logger[_0xabdc('0xa')](_0xabdc('0x20'));return _0x4157e7;});}});}else{logger['info'](_0xabdc('0x21'));return request({'uri':util[_0xabdc('0xc')]('%s/api/v2/agents/me',_0x28083c[_0xabdc('0x19')])})['then'](function(_0x1eb915){logger[_0xabdc('0xa')]('Admin\x20account\x20selected.');return _0x1eb915;});}}function getEndUser(_0x43a302,_0x41a283,_0x59f775){logger[_0xabdc('0xa')](_0xabdc('0x22'),_0x59f775);return request({'uri':util[_0xabdc('0xc')](_0xabdc('0x23'),_0x43a302[_0xabdc('0x19')]),'qs':{'phone':_0x59f775}})[_0xabdc('0x16')](function(_0x17bab3){if(_0x17bab3[_0xabdc('0x1a')]){logger[_0xabdc('0xa')](_0xabdc('0x24'));return _[_0xabdc('0x1c')](_0x17bab3,{'phone':_0x59f775});}else{logger['info'](_0xabdc('0x25'));return request({'uri':util[_0xabdc('0xc')](_0xabdc('0x23'),_0x43a302[_0xabdc('0x19')]),'method':'POST','body':{'name':_0x41a283,'phone':_0x59f775}})[_0xabdc('0x16')](function(_0x40964f){logger[_0xabdc('0xa')](_0xabdc('0x26'));return _0x40964f;});}});}function getAuth(_0x2a7de9){return util['format'](_0xabdc('0x27'),new Buffer(_0x2a7de9[_0xabdc('0x28')]+':X')[_0xabdc('0x29')](_0xabdc('0x2a')));}function request(_0x502ea0){logger[_0xabdc('0x2b')](_0xabdc('0x2c'),JSON['stringify'](_0x502ea0));return rp(_['defaults'](_0x502ea0,{'method':_0xabdc('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x4a923e,_0x4d05af){var _0x3886dc=[];if(_0x4a923e&&_0x4a923e[_0xabdc('0x1a')]>0x0){_0x3886dc=_[_0xabdc('0x2e')](_0x4a923e,_0x4d05af);}return _0x3886dc;}function getCustomFields(_0x2f419b,_0x23ee71){var _0x2b30cc=[];var _0x4fe061={'custom_fields':[]};if(_0x2f419b['length']>0x0){_['forEach'](_0x2f419b,function(_0x26da8d){if(_['includes']([_0xabdc('0x2f'),'picklist'],_0x26da8d[_0xabdc('0x30')])&&_0x26da8d[_0xabdc('0x31')]&&!_0x26da8d[_0xabdc('0x32')]){_0x4fe061[_0x26da8d[_0xabdc('0x31')][_0xabdc('0x33')]()]=_0x26da8d[_0xabdc('0x34')]['toString']();}else if(_[_0xabdc('0x35')]([_0xabdc('0x2f'),_0xabdc('0x36')],_0x26da8d[_0xabdc('0x30')])&&_0x26da8d[_0xabdc('0x37')]&&_0x26da8d['customField']){_0x4fe061[_0xabdc('0x11')]['push']({'id':_0x26da8d[_0xabdc('0x37')],'value':_0x26da8d[_0xabdc('0x34')][_0xabdc('0x29')]()});}else if(_0x26da8d[_0xabdc('0x30')]===_0xabdc('0x38')&&_0x26da8d[_0xabdc('0x39')]&&_0x26da8d[_0xabdc('0x37')]&&_0x26da8d[_0xabdc('0x32')]){_0x23ee71[_0x26da8d[_0xabdc('0x39')]]&&_0x4fe061['custom_fields'][_0xabdc('0x3a')]({'id':_0x26da8d['idField'],'value':_0x23ee71[_0x26da8d['variableName']][_0xabdc('0x29')]()});}else if(_0x26da8d[_0xabdc('0x30')]==='customVariable'&&_0x26da8d['Variable']&&_0x26da8d['Variable'][_0xabdc('0x3b')]&&_0x26da8d[_0xabdc('0x37')]&&_0x26da8d['customField']){_0x23ee71[_0x26da8d[_0xabdc('0x3c')][_0xabdc('0x3b')][_0xabdc('0x33')]()]&&_0x4fe061[_0xabdc('0x11')][_0xabdc('0x3a')]({'id':_0x26da8d['idField'],'value':_0x23ee71[_0x26da8d[_0xabdc('0x3c')][_0xabdc('0x3b')]['toLowerCase']()][_0xabdc('0x29')]()});}});}return _0x4fe061;}exports[_0xabdc('0x3d')]=function(_0x1e0396,_0x56ecd1,_0x358f99,_0x18c79d,_0x1f7a0a,_0x142f2e){var _0x23ccb8,_0x53f734;_0x142f2e['remoteUri']=intUtil[_0xabdc('0x3e')](_0x142f2e['remoteUri']);_0x142f2e[_0xabdc('0x3f')]=intUtil[_0xabdc('0x3e')](_0x142f2e['serverUrl']);if(_0x1f7a0a&&_0x1f7a0a[_0xabdc('0x40')]){logger[_0xabdc('0xa')](_0xabdc('0x41'),_0xabdc('0x42'));_0x56ecd1[_0xabdc('0x43')]=util[_0xabdc('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x142f2e[_0xabdc('0x3f')],_0x56ecd1[_0xabdc('0x44')],md5(_0x56ecd1[_0xabdc('0x44')]));}else{_0x56ecd1[_0xabdc('0x43')]='';}headers['Authorization']=getAuth(_0x142f2e);return getUser(_0x142f2e,_0x18c79d[_0xabdc('0x1e')])[_0xabdc('0x16')](function(_0x4b63cf){_0x23ccb8=_0x4b63cf;logger[_0xabdc('0xa')](_0xabdc('0x45'),_0x23ccb8['id']);return getEndUser(_0x142f2e,_0x56ecd1[_0xabdc('0xd')],_0x56ecd1[_0xabdc('0xe')]);})[_0xabdc('0x16')](function(_0x1fc101){_0x53f734=_0x1fc101;logger[_0xabdc('0xa')](_0xabdc('0x46'),_0x53f734['id']);return getTicket(_0x142f2e,_0x23ccb8,_0x53f734,_0x358f99,_0x56ecd1);})[_0xabdc('0x16')](function(_0x59a078){if(_0x59a078&&_0x59a078['id']){logger['info']('Ticket\x20created!');logger[_0xabdc('0xa')]('The\x20Ticket\x20ID\x20is:',_0x59a078['id']);logger[_0xabdc('0xa')](_0xabdc('0x41'),_0xabdc('0x47'));emit(util[_0xabdc('0xc')](_0xabdc('0x48'),_0x18c79d[_0xabdc('0x3b')]),'trigger:browser:url',{'uri':util[_0xabdc('0xc')](_0xabdc('0x49'),_0x142f2e[_0xabdc('0x19')],_0x59a078['id'])});}})[_0xabdc('0x4a')](function(_0x42973d){logger[_0xabdc('0x4b')](_0xabdc('0x41'),JSON['stringify'](_0x42973d));});};exports[_0xabdc('0x4c')]=function(_0x278c16,_0x64ad05,_0x528e89,_0xeffd46,_0x10bb9e,_0x438fbb,_0x2ba421){var _0x29132a,_0x47032b;_0x438fbb[_0xabdc('0x19')]=intUtil[_0xabdc('0x3e')](_0x438fbb[_0xabdc('0x19')]);_0x438fbb[_0xabdc('0x3f')]=intUtil[_0xabdc('0x3e')](_0x438fbb['serverUrl']);if(_0x2ba421&&_0x2ba421[_0xabdc('0x4d')]&&_0x2ba421[_0xabdc('0x4d')]!==_0xabdc('0x4e')){logger[_0xabdc('0xa')]('[OUTBOUND]',_0xabdc('0x42'));_0x64ad05['recordingURL']=util[_0xabdc('0xc')](_0xabdc('0x4f'),_0x438fbb[_0xabdc('0x3f')],_0x64ad05[_0xabdc('0x44')],md5(_0x64ad05[_0xabdc('0x44')]));}headers[_0xabdc('0x50')]=getAuth(_0x438fbb);return getUser(_0x438fbb,_0xeffd46[_0xabdc('0x1e')])['then'](function(_0x4a01c4){_0x29132a=_0x4a01c4;logger[_0xabdc('0xa')](_0xabdc('0x45'),_0x29132a['id']);return getEndUser(_0x438fbb,_0x64ad05[_0xabdc('0x51')],_0x64ad05[_0xabdc('0x52')]);})[_0xabdc('0x16')](function(_0x31acfe){_0x47032b=_0x31acfe;logger[_0xabdc('0xa')](_0xabdc('0x46'),_0x47032b['id']);return getTicket(_0x438fbb,_0x29132a,_0x47032b,_0x528e89,_0x64ad05);})[_0xabdc('0x16')](function(_0x180afb){if(_0x180afb&&_0x180afb['id']){logger[_0xabdc('0xa')](_0xabdc('0x17'));logger[_0xabdc('0xa')]('The\x20Ticket\x20ID\x20is:',_0x180afb['id']);logger['info'](_0xabdc('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xabdc('0xc')](_0xabdc('0x48'),_0xeffd46['name']),_0xabdc('0x54'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x438fbb[_0xabdc('0x19')],_0x180afb['id'])});}})['catch'](function(_0x47e012){logger[_0xabdc('0x4b')](_0xabdc('0x53'),JSON[_0xabdc('0x55')](_0x47e012));});};exports[_0xabdc('0x56')]=function(_0x277425,_0x25f809,_0x561ec6,_0x11806b,_0x4f4916,_0x3bbbd7){var _0x1af638,_0x355bb5;_0x3bbbd7[_0xabdc('0x19')]=intUtil[_0xabdc('0x3e')](_0x3bbbd7[_0xabdc('0x19')]);_0x3bbbd7[_0xabdc('0x3f')]=intUtil[_0xabdc('0x3e')](_0x3bbbd7[_0xabdc('0x3f')]);if(_0x4f4916&&_0x4f4916[_0xabdc('0x40')]){logger[_0xabdc('0xa')]('['+_0x25f809[_0xabdc('0x57')][_0xabdc('0x58')]()+']',_0xabdc('0x42'));_0x25f809[_0xabdc('0x43')]=util[_0xabdc('0xc')](_0xabdc('0x4f'),_0x3bbbd7['serverUrl'],_0x25f809[_0xabdc('0x44')],md5(_0x25f809[_0xabdc('0x44')]));}else{_0x25f809[_0xabdc('0x43')]='';}headers['Authorization']=getAuth(_0x3bbbd7);return getUser(_0x3bbbd7,'')[_0xabdc('0x16')](function(_0x403408){_0x1af638=_0x403408;logger[_0xabdc('0xa')](_0xabdc('0x45'),_0x1af638['id']);return getEndUser(_0x3bbbd7,_0x25f809[_0xabdc('0xd')],_0x25f809['calleridnum']);})[_0xabdc('0x16')](function(_0x1bdf44){_0x355bb5=_0x1bdf44;logger[_0xabdc('0xa')](_0xabdc('0x46'),_0x355bb5['id']);return getTicket(_0x3bbbd7,_0x1af638,_0x355bb5,_0x561ec6,_0x25f809);})[_0xabdc('0x16')](function(_0xe3f837){if(_0xe3f837){logger[_0xabdc('0xa')]('Ticket\x20created!');logger[_0xabdc('0xa')](_0xabdc('0x59'),_0xe3f837['id']);}})[_0xabdc('0x4a')](function(_0x51489c){logger[_0xabdc('0x4b')]('['+_0x25f809['lastevent'][_0xabdc('0x58')]()+']',JSON[_0xabdc('0x55')](_0x51489c));});}; \ 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 e706e8a..fc004c1 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 _0x43c9=['recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','headers','Getting\x20admin\x20information','users','length','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','/api/selector/owners','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','Subjects','getString','Descriptions','add','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','adminEmail','toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL'];(function(_0x2f7e1b,_0x545a06){var _0x5832c5=function(_0x38f9bb){while(--_0x38f9bb){_0x2f7e1b['push'](_0x2f7e1b['shift']());}};_0x5832c5(++_0x545a06);}(_0x43c9,0x1f2));var _0x943c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x43c9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x943c('0x0'));var rp=require(_0x943c('0x1'));var md5=require(_0x943c('0x2'));var util=require(_0x943c('0x3'));var moment=require(_0x943c('0x4'));var Promise=require('bluebird');var Redis=require(_0x943c('0x5'));var intUtil=require(_0x943c('0x6'));var config=require(_0x943c('0x7'));var logger=require(_0x943c('0x8'))(_0x943c('0x9'));config['redis']=_[_0x943c('0xa')](config['redis'],{'host':_0x943c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x45f9f1,_0x13ff8c,_0x241f83,_0x1fbac5){return new Promise(function(_0x17051c,_0x431cb6){var _0x161d94=![];var _0x492f73={'method':'GET','uri':_0x1fbac5+'/api/selector/owners','json':!![]};_0x492f73[_0x943c('0xc')]=_0x241f83;logger['info'](_0x943c('0xd'));return rp(_0x492f73)['then'](function(_0x42543a){if(_0x42543a){var _0x5d179b=_0x42543a[_0x943c('0xe')];var _0x149cc0=null;for(_0x149cc0=0x0;_0x149cc0<_0x5d179b[_0x943c('0xf')];_0x149cc0++){if(_0x5d179b[_0x149cc0]['email']===_0x45f9f1['adminEmail']){_0x45f9f1['adminId']=_0x5d179b[_0x149cc0]['id'];_0x161d94=!![];}}if(_0x161d94){logger[_0x943c('0x10')](_0x943c('0x11'),_0x45f9f1[_0x943c('0x12')]);_0x17051c(_0x45f9f1);}else{_0x431cb6({'statusCode':0x194,'message':_0x943c('0x13')});}}else{_0x431cb6({'statusCode':0x194,'message':_0x943c('0x13')});}})[_0x943c('0x14')](function(_0x1e52ba){logger[_0x943c('0x15')]('['+[_0x13ff8c[_0x943c('0x16')]()]+']',_0x1e52ba['message']);_0x431cb6(_0x1e52ba);});});}function getUser(_0x2bdf93,_0x23cdc0,_0x45b753){return function(_0x56fdbb){return new Promise(function(_0x7e4e58,_0x2b82dd){var _0x30fc42={'method':_0x943c('0x17'),'uri':_0x45b753+_0x943c('0x18'),'json':!![]};_0x30fc42[_0x943c('0xc')]=_0x23cdc0;logger[_0x943c('0x10')]('Getting\x20user\x20list');return rp(_0x30fc42)[_0x943c('0x19')](function(_0x3ddd94){if(_0x3ddd94){var _0x43014a=_0x3ddd94[_0x943c('0xe')];var _0x1a7454=![];var _0x231e0e=null;if(_0x56fdbb[_0x943c('0x1a')]!==null){logger[_0x943c('0x10')](_0x943c('0x1b'),_0x56fdbb[_0x943c('0x1a')]);_0x56fdbb[_0x943c('0x1c')]=_0x56fdbb[_0x943c('0x1a')];for(_0x231e0e=0x0;_0x231e0e<_0x43014a['length'];_0x231e0e++){if(_0x43014a[_0x231e0e][_0x943c('0x1d')]===_0x56fdbb[_0x943c('0x1a')]){_0x1a7454=!![];_0x56fdbb['userId']=_0x43014a[_0x231e0e]['id'];logger[_0x943c('0x10')](_0x943c('0x1e'),_0x56fdbb[_0x943c('0x1f')]);}}}if(!_0x1a7454){logger[_0x943c('0x10')]('Admin\x20selected');_0x56fdbb[_0x943c('0x1c')]=_0x56fdbb['adminEmail'];_0x56fdbb[_0x943c('0x1f')]=_0x56fdbb[_0x943c('0x12')];_0x1a7454=!![];}if(_0x1a7454){_0x7e4e58(_0x56fdbb);}else{_0x2b82dd({'statusCode':0x194,'message':_0x943c('0x13')});}}else{_0x2b82dd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x943c('0x14')](function(_0x10cfac){logger['error']('['+[_0x2bdf93[_0x943c('0x16')]()]+']',_0x10cfac[_0x943c('0x20')]);_0x2b82dd(_0x10cfac);});});};}function searchContact(_0x2db3ed,_0x417998,_0x65a8d7,_0x3f5dd0){return new Promise(function(_0x232f9a,_0x290f8a){var _0x3a324={'method':_0x943c('0x17'),'headers':_0x417998,'uri':_0x2db3ed+_0x943c('0x21')+_0x3f5dd0+_0x943c('0x22')+_0x65a8d7+_0x943c('0x23'),'json':!![]};rp(_0x3a324)[_0x943c('0x19')](function(_0x5d68e7){var _0x56bdbe=_[_0x943c('0x24')](_0x5d68e7[_0x943c('0x25')][_0x943c('0x25')],[_0x65a8d7,_0x3f5dd0]);_0x232f9a(_0x56bdbe);})[_0x943c('0x14')](function(_0x239d8){_0x290f8a(_0x239d8);});});}function getEndUser(_0x301db4,_0x509113,_0x14a660){return function(_0x42e724){return new Promise(function(_0x52289d,_0x102b6e){logger[_0x943c('0x10')](util[_0x943c('0x26')](_0x943c('0x27'),_0x42e724[_0x943c('0x28')]));searchContact(_0x14a660,_0x509113,_0x943c('0x29'),_0x42e724['contactNumber'])[_0x943c('0x19')](function(_0x4ddb0d){if(_0x4ddb0d){_0x42e724['endUserId']=_0x4ddb0d['id'];logger['info'](_0x943c('0x2a'),_0x42e724['endUserId']);return _0x52289d(_0x42e724);}searchContact(_0x14a660,_0x509113,_0x943c('0x2b'),_0x42e724[_0x943c('0x28')])[_0x943c('0x19')](function(_0x2423ba){if(_0x2423ba){_0x42e724[_0x943c('0x2c')]=_0x2423ba['id'];logger['info'](_0x943c('0x2d'),_0x42e724[_0x943c('0x2c')]);return _0x52289d(_0x42e724);}createEndUser(_0x42e724,_0x301db4,_0x509113,_0x14a660)[_0x943c('0x19')](function(_0x3c238e){logger[_0x943c('0x10')](_0x943c('0x2e'),_0x3c238e[_0x943c('0x2c')]);return _0x52289d(_0x3c238e);});});})['catch'](function(_0x5ed591){_0x102b6e(_0x5ed591);});});};}function createEndUser(_0x57bf97,_0x40b8bc,_0x22a1e3,_0x5ae3fa){return new Promise(function(_0x4f3f31,_0x59b4a3){var _0x4ead26=moment();var _0x30a651={'method':_0x943c('0x2f'),'uri':_0x5ae3fa+_0x943c('0x30'),'body':{'contact':{'last_name':_0x57bf97[_0x943c('0x28')],'work_number':_0x57bf97[_0x943c('0x28')],'mobile_number':_0x57bf97[_0x943c('0x28')],'owner_id':_0x57bf97['userId'],'created_at':_0x4ead26[_0x943c('0x26')](_0x943c('0x31'))}},'json':!![]};_0x30a651[_0x943c('0xc')]=_0x22a1e3;logger[_0x943c('0x10')](_0x943c('0x32'));return rp(_0x30a651)[_0x943c('0x19')](function(_0x11f326){_0x57bf97[_0x943c('0x2c')]=_0x11f326['contact']['id'];_0x4f3f31(_0x57bf97);})[_0x943c('0x14')](function(_0xae13da){logger[_0x943c('0x15')]('['+[_0x40b8bc['toUpperCase']()]+']',_0xae13da[_0x943c('0x20')]);_0x59b4a3(_0xae13da[_0x943c('0x20')]);});});}function getTicket(_0x1936b6,_0x1fda19,_0x27c16c,_0x17470c,_0x1142de){return function(_0x4407f0){logger[_0x943c('0x10')](_0x943c('0x33'));return new Promise(function(_0x412fd1,_0x405a95){var _0x14da92=moment();var _0x32bade={'method':_0x943c('0x2f'),'uri':_0x27c16c+'/api/tasks','body':{'title':intUtil['getString'](_0x17470c[_0x943c('0x34')],_0x1142de,'\x20'),'description':intUtil[_0x943c('0x35')](_0x17470c[_0x943c('0x36')],_0x1142de,'\x0a'),'owner_id':_0x4407f0['userId'],'creater_id':_0x4407f0['adminId'],'targetable_id':_0x4407f0[_0x943c('0x2c')],'targetable_type':'Contact','created_at':_0x14da92[_0x943c('0x26')](_0x943c('0x31')),'due_date':_0x14da92[_0x943c('0x37')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x32bade[_0x943c('0xc')]=_0x1fda19;return rp(_0x32bade)[_0x943c('0x19')](function(_0x1fe176){_0x4407f0[_0x943c('0x38')]=_0x1fe176[_0x943c('0x39')]['id'];logger[_0x943c('0x10')]('Task\x20created:',_0x4407f0['ticketId']);_0x412fd1(_0x4407f0);})[_0x943c('0x14')](function(_0x3a50e6){logger['error']('['+[_0x1936b6[_0x943c('0x16')]()]+']',_0x3a50e6[_0x943c('0x20')]);_0x405a95(_0x3a50e6['message']);});});};}function emit(_0xc5d94e,_0xe714dd,_0x5477df){var _0x5dbb59={'uri':_0xc5d94e+_0x943c('0x3a')+_0x5477df};io['to'](util[_0x943c('0x26')]('user:%s',_0xe714dd))[_0x943c('0x3b')](_0x943c('0x3c'),_0x5dbb59);}exports['cs']=function(_0x23d7e9,_0x45021c,_0x31db18,_0x4a9104,_0x33deb4,_0x27a40b,_0x454738,_0xf3d4fa){var _0x3d63cd={};var _0x5f0999={'Authorization':_0x943c('0x3d')+_0x27a40b['apiKey']};_0x27a40b[_0x943c('0x3e')]=intUtil[_0x943c('0x3f')](_0x27a40b[_0x943c('0x3e')]);_0x27a40b[_0x943c('0x40')]=intUtil[_0x943c('0x3f')](_0x27a40b['serverUrl']);var _0x11b0bf=_0x27a40b[_0x943c('0x3e')];_0x3d63cd[_0x943c('0x41')]=_0x27a40b['username'];_0x3d63cd[_0x943c('0x28')]=_0xf3d4fa[_0x943c('0x42')]()===_0x943c('0x43')?_0x45021c[_0x943c('0x44')]:_0x45021c['calleridnum'];_0x3d63cd['callDirection']=_0xf3d4fa===_0x943c('0x45')||_0xf3d4fa===_0x943c('0x46')?_0x943c('0x45'):_0x943c('0x43');if(_0x4a9104){_0x3d63cd[_0x943c('0x1a')]=_0x4a9104['email'];}var _0x1a2ff2=util[_0x943c('0x26')](_0x943c('0x47'),_0x27a40b['serverUrl'],_0x45021c[_0x943c('0x48')],md5(_0x45021c['uniqueid']));if(_0x33deb4&&_0x33deb4[_0x943c('0x49')]){logger['info'](_0x943c('0x4a'),'Recording\x20is\x20enabled!');_0x45021c[_0x943c('0x4b')]=_0x1a2ff2;}else if(_0x454738&&_0x454738['recordingFormat']&&_0x454738[_0x943c('0x4c')]!=='none'){logger[_0x943c('0x10')](_0x943c('0x4d'),_0x943c('0x4e'));_0x45021c['recordingURL']=_0x1a2ff2;}else{_0x45021c[_0x943c('0x4b')]='';}return getAdminId(_0x3d63cd,_0xf3d4fa,_0x5f0999,_0x11b0bf)['then'](getUser(_0xf3d4fa,_0x5f0999,_0x11b0bf))[_0x943c('0x19')](getEndUser(_0xf3d4fa,_0x5f0999,_0x11b0bf))['then'](getTicket(_0xf3d4fa,_0x5f0999,_0x11b0bf,_0x31db18,_0x45021c))[_0x943c('0x19')](function(_0x493a53){logger[_0x943c('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x493a53['ticketId']));if(_0xf3d4fa!==_0x943c('0x46')){logger['info']('['+[_0xf3d4fa['toUpperCase']()]+']',_0x943c('0x4f'));emit(_0x11b0bf,_0x4a9104[_0x943c('0x50')],_0x493a53[_0x943c('0x2c')]);}})['catch'](function(_0x23a391){logger['error']('['+[_0xf3d4fa[_0x943c('0x16')]()]+_0x943c('0x51'),util['inspect'](_0x23a391,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4c2d=['getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','message','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c2d,0x175));var _0xd4c2=function(_0x5b2a74,_0x49526e){_0x5b2a74=_0x5b2a74-0x0;var _0x2a4e0c=_0x4c2d[_0x5b2a74];return _0x2a4e0c;};'use strict';var _=require(_0xd4c2('0x0'));var rp=require('request-promise');var md5=require(_0xd4c2('0x1'));var util=require(_0xd4c2('0x2'));var moment=require(_0xd4c2('0x3'));var Promise=require(_0xd4c2('0x4'));var Redis=require(_0xd4c2('0x5'));var intUtil=require(_0xd4c2('0x6'));var config=require(_0xd4c2('0x7'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0xd4c2('0x8')](config[_0xd4c2('0x9')],{'host':_0xd4c2('0xa'),'port':0x18eb});var io=require(_0xd4c2('0xb'))(new Redis(config[_0xd4c2('0x9')]));function getAdminId(_0xc08670,_0x111739,_0x4d41fa,_0x31ad2d){return new Promise(function(_0x141e96,_0x15b594){var _0x33e2bf=![];var _0x1c79cf={'method':_0xd4c2('0xc'),'uri':_0x31ad2d+_0xd4c2('0xd'),'json':!![]};_0x1c79cf[_0xd4c2('0xe')]=_0x4d41fa;logger['info'](_0xd4c2('0xf'));return rp(_0x1c79cf)[_0xd4c2('0x10')](function(_0x39e3b7){if(_0x39e3b7){var _0x5da137=_0x39e3b7[_0xd4c2('0x11')];var _0xe2ea=null;for(_0xe2ea=0x0;_0xe2ea<_0x5da137[_0xd4c2('0x12')];_0xe2ea++){if(_0x5da137[_0xe2ea][_0xd4c2('0x13')]===_0xc08670[_0xd4c2('0x14')]){_0xc08670[_0xd4c2('0x15')]=_0x5da137[_0xe2ea]['id'];_0x33e2bf=!![];}}if(_0x33e2bf){logger[_0xd4c2('0x16')](_0xd4c2('0x17'),_0xc08670[_0xd4c2('0x15')]);_0x141e96(_0xc08670);}else{_0x15b594({'statusCode':0x194,'message':_0xd4c2('0x18')});}}else{_0x15b594({'statusCode':0x194,'message':_0xd4c2('0x18')});}})[_0xd4c2('0x19')](function(_0x96a70a){logger[_0xd4c2('0x1a')]('['+[_0x111739[_0xd4c2('0x1b')]()]+']',_0x96a70a['message']);_0x15b594(_0x96a70a);});});}function getUser(_0x182444,_0x2dfeae,_0x2339c2){return function(_0x584f81){return new Promise(function(_0x4e7c11,_0x1bf2bd){var _0x34dcee={'method':_0xd4c2('0xc'),'uri':_0x2339c2+'/api/selector/owners','json':!![]};_0x34dcee['headers']=_0x2dfeae;logger['info'](_0xd4c2('0x1c'));return rp(_0x34dcee)[_0xd4c2('0x10')](function(_0x5cd95e){if(_0x5cd95e){var _0x1f60f8=_0x5cd95e['users'];var _0x5cbb7b=![];var _0x47ccd8=null;if(_0x584f81[_0xd4c2('0x1d')]!==null){logger['info'](_0xd4c2('0x1e'),_0x584f81[_0xd4c2('0x1d')]);_0x584f81[_0xd4c2('0x1f')]=_0x584f81[_0xd4c2('0x1d')];for(_0x47ccd8=0x0;_0x47ccd8<_0x1f60f8[_0xd4c2('0x12')];_0x47ccd8++){if(_0x1f60f8[_0x47ccd8][_0xd4c2('0x13')]===_0x584f81[_0xd4c2('0x1d')]){_0x5cbb7b=!![];_0x584f81['userId']=_0x1f60f8[_0x47ccd8]['id'];logger[_0xd4c2('0x16')](_0xd4c2('0x20'),_0x584f81[_0xd4c2('0x21')]);}}}if(!_0x5cbb7b){logger[_0xd4c2('0x16')]('Admin\x20selected');_0x584f81['userEmail']=_0x584f81[_0xd4c2('0x14')];_0x584f81[_0xd4c2('0x21')]=_0x584f81[_0xd4c2('0x15')];_0x5cbb7b=!![];}if(_0x5cbb7b){_0x4e7c11(_0x584f81);}else{_0x1bf2bd({'statusCode':0x194,'message':_0xd4c2('0x18')});}}else{_0x1bf2bd({'statusCode':0x194,'message':_0xd4c2('0x18')});}})[_0xd4c2('0x19')](function(_0x165be0){logger[_0xd4c2('0x1a')]('['+[_0x182444[_0xd4c2('0x1b')]()]+']',_0x165be0[_0xd4c2('0x22')]);_0x1bf2bd(_0x165be0);});});};}function searchContact(_0xbbfe09,_0x3a8c56,_0x4f65e5,_0x1a62d3){return new Promise(function(_0x2c0a3e,_0x2d5c25){var _0x4c5299={'method':'GET','headers':_0x3a8c56,'uri':_0xbbfe09+_0xd4c2('0x23')+_0x1a62d3+_0xd4c2('0x24')+_0x4f65e5+'&entities=contact','json':!![]};rp(_0x4c5299)[_0xd4c2('0x10')](function(_0x12dc93){var _0xfa78cd=_[_0xd4c2('0x25')](_0x12dc93['contacts'][_0xd4c2('0x26')],[_0x4f65e5,_0x1a62d3]);_0x2c0a3e(_0xfa78cd);})[_0xd4c2('0x19')](function(_0x9c58ce){_0x2d5c25(_0x9c58ce);});});}function getEndUser(_0x49c558,_0x868140,_0x270e6d){return function(_0x368227){return new Promise(function(_0x361b84,_0x5d0eb7){logger[_0xd4c2('0x16')](util[_0xd4c2('0x27')](_0xd4c2('0x28'),_0x368227[_0xd4c2('0x29')]));searchContact(_0x270e6d,_0x868140,_0xd4c2('0x2a'),_0x368227[_0xd4c2('0x29')])[_0xd4c2('0x10')](function(_0xadb390){if(_0xadb390){_0x368227[_0xd4c2('0x2b')]=_0xadb390['id'];logger[_0xd4c2('0x16')](_0xd4c2('0x2c'),_0x368227[_0xd4c2('0x2b')]);return _0x361b84(_0x368227);}searchContact(_0x270e6d,_0x868140,'work_number',_0x368227[_0xd4c2('0x29')])['then'](function(_0x51e394){if(_0x51e394){_0x368227[_0xd4c2('0x2b')]=_0x51e394['id'];logger[_0xd4c2('0x16')](_0xd4c2('0x2d'),_0x368227[_0xd4c2('0x2b')]);return _0x361b84(_0x368227);}createEndUser(_0x368227,_0x49c558,_0x868140,_0x270e6d)[_0xd4c2('0x10')](function(_0x358d47){logger[_0xd4c2('0x16')](_0xd4c2('0x2e'),_0x358d47[_0xd4c2('0x2b')]);return _0x361b84(_0x358d47);});});})[_0xd4c2('0x19')](function(_0x281b73){_0x5d0eb7(_0x281b73);});});};}function createEndUser(_0x1ec537,_0x4e2c73,_0x5c0ece,_0x206222){return new Promise(function(_0x38731a,_0x5d4137){var _0x120d22=moment();var _0x17ad89={'method':_0xd4c2('0x2f'),'uri':_0x206222+_0xd4c2('0x30'),'body':{'contact':{'last_name':_0x1ec537[_0xd4c2('0x29')],'work_number':_0x1ec537[_0xd4c2('0x29')],'mobile_number':_0x1ec537[_0xd4c2('0x29')],'owner_id':_0x1ec537['userId'],'created_at':_0x120d22['format'](_0xd4c2('0x31'))}},'json':!![]};_0x17ad89[_0xd4c2('0xe')]=_0x5c0ece;logger[_0xd4c2('0x16')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x17ad89)[_0xd4c2('0x10')](function(_0x74af54){_0x1ec537['endUserId']=_0x74af54['contact']['id'];_0x38731a(_0x1ec537);})[_0xd4c2('0x19')](function(_0x488a7e){logger[_0xd4c2('0x1a')]('['+[_0x4e2c73[_0xd4c2('0x1b')]()]+']',_0x488a7e[_0xd4c2('0x22')]);_0x5d4137(_0x488a7e[_0xd4c2('0x22')]);});});}function getTicket(_0x1cbd60,_0x2e476a,_0x317fd7,_0x5a8bac,_0x3766a6){return function(_0x2cd3cc){logger[_0xd4c2('0x16')](_0xd4c2('0x32'));return new Promise(function(_0x4297cd,_0x210bc8){var _0x3d995f=moment();var _0x15ff8c={'method':'POST','uri':_0x317fd7+_0xd4c2('0x33'),'body':{'title':intUtil[_0xd4c2('0x34')](_0x5a8bac[_0xd4c2('0x35')],_0x3766a6,'\x20'),'description':intUtil['getString'](_0x5a8bac[_0xd4c2('0x36')],_0x3766a6,'\x0a'),'owner_id':_0x2cd3cc[_0xd4c2('0x21')],'creater_id':_0x2cd3cc[_0xd4c2('0x15')],'targetable_id':_0x2cd3cc[_0xd4c2('0x2b')],'targetable_type':_0xd4c2('0x37'),'created_at':_0x3d995f['format'](_0xd4c2('0x31')),'due_date':_0x3d995f[_0xd4c2('0x38')](0x1e,'m')[_0xd4c2('0x27')](_0xd4c2('0x31'))},'json':!![]};_0x15ff8c[_0xd4c2('0xe')]=_0x2e476a;return rp(_0x15ff8c)['then'](function(_0x4617f2){_0x2cd3cc['ticketId']=_0x4617f2['task']['id'];logger[_0xd4c2('0x16')](_0xd4c2('0x39'),_0x2cd3cc[_0xd4c2('0x3a')]);_0x4297cd(_0x2cd3cc);})[_0xd4c2('0x19')](function(_0x573c4b){logger[_0xd4c2('0x1a')]('['+[_0x1cbd60[_0xd4c2('0x1b')]()]+']',_0x573c4b[_0xd4c2('0x22')]);_0x210bc8(_0x573c4b[_0xd4c2('0x22')]);});});};}function emit(_0x3cb14f,_0x42c664,_0x210ab7){var _0x2298d5={'uri':_0x3cb14f+_0xd4c2('0x3b')+_0x210ab7};io['to'](util[_0xd4c2('0x27')](_0xd4c2('0x3c'),_0x42c664))[_0xd4c2('0x3d')](_0xd4c2('0x3e'),_0x2298d5);}exports['cs']=function(_0x44a5ff,_0x23135a,_0x28cc50,_0x454630,_0x452eca,_0x3b3148,_0x1d42b8,_0x34f651){var _0x35b110={};var _0x1630ca={'Authorization':_0xd4c2('0x3f')+_0x3b3148[_0xd4c2('0x40')]};_0x3b3148[_0xd4c2('0x41')]=intUtil[_0xd4c2('0x42')](_0x3b3148[_0xd4c2('0x41')]);_0x3b3148[_0xd4c2('0x43')]=intUtil[_0xd4c2('0x42')](_0x3b3148['serverUrl']);var _0xbd3d72=_0x3b3148['remoteUri'];_0x35b110[_0xd4c2('0x14')]=_0x3b3148[_0xd4c2('0x44')];_0x35b110['contactNumber']=_0x34f651[_0xd4c2('0x45')]()===_0xd4c2('0x46')?_0x23135a['destcalleridnum']:_0x23135a[_0xd4c2('0x47')];_0x35b110[_0xd4c2('0x48')]=_0x34f651==='queue'||_0x34f651===_0xd4c2('0x49')?'queue':_0xd4c2('0x46');if(_0x454630){_0x35b110['agentEmail']=_0x454630[_0xd4c2('0x13')];}var _0x13a4fe=util[_0xd4c2('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b3148[_0xd4c2('0x43')],_0x23135a['uniqueid'],md5(_0x23135a[_0xd4c2('0x4a')]));if(_0x452eca&&_0x452eca[_0xd4c2('0x4b')]){logger[_0xd4c2('0x16')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23135a[_0xd4c2('0x4c')]=_0x13a4fe;}else if(_0x1d42b8&&_0x1d42b8['recordingFormat']&&_0x1d42b8[_0xd4c2('0x4d')]!==_0xd4c2('0x4e')){logger[_0xd4c2('0x16')](_0xd4c2('0x4f'),_0xd4c2('0x50'));_0x23135a['recordingURL']=_0x13a4fe;}else{_0x23135a[_0xd4c2('0x4c')]='';}return getAdminId(_0x35b110,_0x34f651,_0x1630ca,_0xbd3d72)['then'](getUser(_0x34f651,_0x1630ca,_0xbd3d72))[_0xd4c2('0x10')](getEndUser(_0x34f651,_0x1630ca,_0xbd3d72))[_0xd4c2('0x10')](getTicket(_0x34f651,_0x1630ca,_0xbd3d72,_0x28cc50,_0x23135a))[_0xd4c2('0x10')](function(_0x4a8da9){logger[_0xd4c2('0x16')](util[_0xd4c2('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4a8da9[_0xd4c2('0x3a')]));if(_0x34f651!==_0xd4c2('0x49')){logger[_0xd4c2('0x16')]('['+[_0x34f651[_0xd4c2('0x1b')]()]+']',_0xd4c2('0x51'));emit(_0xbd3d72,_0x454630[_0xd4c2('0x52')],_0x4a8da9[_0xd4c2('0x2b')]);}})[_0xd4c2('0x19')](function(_0x1600bf){logger[_0xd4c2('0x1a')]('['+[_0x34f651[_0xd4c2('0x1b')]()]+_0xd4c2('0x53'),util[_0xd4c2('0x54')](_0x1600bf,{'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 f3f4957..10a152c 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 _0x6335=['error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','log','EVENT\x20UNKNOWN','servicenow','unknown\x20integration','../../../../config/logger'];(function(_0x45562c,_0x13266e){var _0x24a805=function(_0x209154){while(--_0x209154){_0x45562c['push'](_0x45562c['shift']());}};_0x24a805(++_0x13266e);}(_0x6335,0xab));var _0x5633=function(_0x4055d0,_0x2393d0){_0x4055d0=_0x4055d0-0x0;var _0x1c7b2d=_0x6335[_0x4055d0];return _0x1c7b2d;};'use strict';var _=require(_0x5633('0x0'));var util=require('util');var zendesk=require(_0x5633('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x5633('0x2'));var desk=require(_0x5633('0x3'));var vtiger=require(_0x5633('0x4'));var servicenow=require(_0x5633('0x5'));var dynamics365=require('./dynamics365');var freshsales=require(_0x5633('0x6'));var integrations=[_0x5633('0x7'),_0x5633('0x8'),_0x5633('0x9'),_0x5633('0xa'),_0x5633('0xb'),_0x5633('0xc'),_0x5633('0xd'),'dynamics365',_0x5633('0xe'),'servicenow'];exports['exec']=function(_0x293812,_0x20b5ef,_0x57cd66,_0x4edfe5,_0x6cdb4c,_0x8967d1){if(_0x57cd66){if(_[_0x5633('0xf')](integrations,_0x293812[_0x5633('0x10')][_0x5633('0x11')]())){try{var _0x26d1d5=null;var _0x168bef='';var _0x227edc=_0x57cd66[_0x293812[_0x5633('0x10')][_0x5633('0x11')]()];if(_0x227edc){var _0x2ebf83=_0x227edc[_0x293812[_0x5633('0x12')]];if(_0x2ebf83){var _0x544d4c=_[_0x5633('0x13')](_0x2ebf83[_0x5633('0x14')],{'id':parseInt(_0x293812['data3'],0xa)});if(_0x544d4c){if(_0x4edfe5){if(_0x6cdb4c&&_0x20b5ef[_0x5633('0x15')]){_0x168bef=_0x5633('0x15');}else if(_0x20b5ef['routeId']){_0x168bef='outbound';}else{console[_0x5633('0x16')](_0x5633('0x17'),_0x20b5ef);}}else{_0x168bef='unmanaged';}switch(_0x293812[_0x5633('0x10')]['toLowerCase']()){case _0x5633('0x7'):zendesk[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0x8'):salesforce[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0x9'):sugarcrm[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0xa'):freshdesk[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0xb'):zoho[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0xc'):desk[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0xd'):vtiger[_0x168bef](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1);break;case _0x5633('0xe'):freshsales['cs'](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1,_0x168bef);break;case _0x5633('0x18'):servicenow['cs'](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1,_0x168bef);break;case'dynamics365':dynamics365['cs'](_0x293812,_0x20b5ef,_0x544d4c,_0x4edfe5,_0x6cdb4c,_0x2ebf83,_0x8967d1,_0x168bef);break;default:console[_0x5633('0x16')](_0x5633('0x19'));}}else{_0x26d1d5=require(_0x5633('0x1a'))(_0x293812[_0x5633('0x10')]['toLowerCase']());_0x26d1d5[_0x5633('0x1b')](_0x5633('0x1c'),util[_0x5633('0x1d')](_0x5633('0x1e'),_0x293812['data1'][_0x5633('0x11')](),_0x293812[_0x5633('0x1f')]));}}else{_0x26d1d5=require(_0x5633('0x1a'))(_0x293812['data1']['toLowerCase']());_0x26d1d5['error'](_0x5633('0x1c'),util[_0x5633('0x1d')](_0x5633('0x20'),_0x293812[_0x5633('0x10')][_0x5633('0x11')](),_0x293812['data2']));}}else{}}catch(_0x52da92){console['error'](_0x52da92);}}}}; \ No newline at end of file +var _0xfd67=['toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','includes','data1'];(function(_0x4d560a,_0x48d9dd){var _0x368b51=function(_0x4124a8){while(--_0x4124a8){_0x4d560a['push'](_0x4d560a['shift']());}};_0x368b51(++_0x48d9dd);}(_0xfd67,0x1cc));var _0x7fd6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfd67[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x7fd6('0x0'));var util=require(_0x7fd6('0x1'));var zendesk=require(_0x7fd6('0x2'));var salesforce=require(_0x7fd6('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x7fd6('0x4'));var zoho=require(_0x7fd6('0x5'));var desk=require(_0x7fd6('0x6'));var vtiger=require(_0x7fd6('0x7'));var servicenow=require(_0x7fd6('0x8'));var dynamics365=require(_0x7fd6('0x9'));var freshsales=require(_0x7fd6('0xa'));var integrations=[_0x7fd6('0xb'),_0x7fd6('0xc'),'sugarcrm',_0x7fd6('0xd'),_0x7fd6('0xe'),'desk',_0x7fd6('0xf'),_0x7fd6('0x10'),_0x7fd6('0x11'),_0x7fd6('0x12')];exports['exec']=function(_0x22f72e,_0xb30c38,_0x1df6eb,_0x14daf6,_0x52dce2,_0x287000){if(_0x1df6eb){if(_[_0x7fd6('0x13')](integrations,_0x22f72e[_0x7fd6('0x14')][_0x7fd6('0x15')]())){try{var _0x1eaadc=null;var _0x105452='';var _0x300481=_0x1df6eb[_0x22f72e[_0x7fd6('0x14')][_0x7fd6('0x15')]()];if(_0x300481){var _0x228935=_0x300481[_0x22f72e[_0x7fd6('0x16')]];if(_0x228935){var _0x1084da=_[_0x7fd6('0x17')](_0x228935[_0x7fd6('0x18')],{'id':parseInt(_0x22f72e[_0x7fd6('0x19')],0xa)});if(_0x1084da){if(_0x14daf6){if(_0x52dce2&&_0xb30c38[_0x7fd6('0x1a')]){_0x105452='queue';}else if(_0xb30c38[_0x7fd6('0x1b')]){_0x105452=_0x7fd6('0x1c');}else{console[_0x7fd6('0x1d')](_0x7fd6('0x1e'),_0xb30c38);}}else{_0x105452='unmanaged';}switch(_0x22f72e['data1'][_0x7fd6('0x15')]()){case'zendesk':zendesk[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case _0x7fd6('0xc'):salesforce[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case'sugarcrm':sugarcrm[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case _0x7fd6('0xd'):freshdesk[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case _0x7fd6('0xe'):zoho[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case'desk':desk[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case _0x7fd6('0xf'):vtiger[_0x105452](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000);break;case'freshsales':freshsales['cs'](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000,_0x105452);break;case _0x7fd6('0x12'):servicenow['cs'](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000,_0x105452);break;case _0x7fd6('0x10'):dynamics365['cs'](_0x22f72e,_0xb30c38,_0x1084da,_0x14daf6,_0x52dce2,_0x228935,_0x287000,_0x105452);break;default:console[_0x7fd6('0x1d')]('unknown\x20integration');}}else{_0x1eaadc=require(_0x7fd6('0x1f'))(_0x22f72e[_0x7fd6('0x14')][_0x7fd6('0x15')]());_0x1eaadc[_0x7fd6('0x20')](_0x7fd6('0x21'),util[_0x7fd6('0x22')](_0x7fd6('0x23'),_0x22f72e[_0x7fd6('0x14')]['toLowerCase'](),_0x22f72e[_0x7fd6('0x19')]));}}else{_0x1eaadc=require('../../../../config/logger')(_0x22f72e['data1'][_0x7fd6('0x15')]());_0x1eaadc[_0x7fd6('0x20')](_0x7fd6('0x21'),util[_0x7fd6('0x22')](_0x7fd6('0x24'),_0x22f72e['data1'][_0x7fd6('0x15')](),_0x22f72e[_0x7fd6('0x16')]));}}else{}}catch(_0x599a41){console[_0x7fd6('0x20')](_0x599a41);}}}}; \ 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 661e6e8..d3eff75 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 _0x7c8c=['redis','defaults','localhost','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','resolve','Name','info','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','cloneDeep','additionalSearchContact','$or','merge','Lead','additionalSearchAccount','Account','Contact','additionalSearchLead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','No\x20Company','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','clientId','login','username','Connection\x20established.','stripTrailingSlash','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce'];(function(_0x595c47,_0x3e84c5){var _0x40611e=function(_0x516bd8){while(--_0x516bd8){_0x595c47['push'](_0x595c47['shift']());}};_0x40611e(++_0x3e84c5);}(_0x7c8c,0x1db));var _0xc7c8=function(_0x1cf4c1,_0x494249){_0x1cf4c1=_0x1cf4c1-0x0;var _0x4cdf25=_0x7c8c[_0x1cf4c1];return _0x4cdf25;};'use strict';var _=require(_0xc7c8('0x0'));var rp=require('request-promise');var moment=require(_0xc7c8('0x1'));var BPromise=require(_0xc7c8('0x2'));var md5=require(_0xc7c8('0x3'));var jsforce=require('jsforce');var util=require(_0xc7c8('0x4'));var Redis=require(_0xc7c8('0x5'));var intUtil=require('./util');var config=require(_0xc7c8('0x6'));var logger=require(_0xc7c8('0x7'))(_0xc7c8('0x8'));config[_0xc7c8('0x9')]=_[_0xc7c8('0xa')](config[_0xc7c8('0x9')],{'host':_0xc7c8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc7c8('0x9')]));function emit(_0x107231,_0x49e9ad,_0x2e75c7){io['to'](_0x107231)['emit'](_0x49e9ad,_0x2e75c7);}function getTicket(_0x303a0e,_0x3308d4,_0x99c405,_0x42b8aa,_0x35da65,_0x142da5,_0x3c7d82,_0x561c15){var _0x388f54=Object[_0xc7c8('0xc')]({},{'OwnerId':_0x3308d4['id'],'Subject':intUtil['getString'](_0x42b8aa[_0xc7c8('0xd')],_0x35da65,'\x20'),'Description':intUtil[_0xc7c8('0xe')](_0x42b8aa[_0xc7c8('0xf')],_0x35da65,'\x0a')},getCustomFields(_0x142da5,_0x35da65));if(_0x99c405){if(_0x42b8aa[_0xc7c8('0x10')]===_0xc7c8('0x11')){_0x388f54[_0xc7c8('0x12')]=moment['utc']();_0x388f54[_0xc7c8('0x13')]=![];_0x388f54[_0xc7c8('0x14')]=![];if(_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x16')||_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x17')){_0x388f54['WhoId']=_0x99c405['id'];}else if(_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x18')){_0x388f54[_0xc7c8('0x19')]=_0x99c405['id'];}}else if(_0x42b8aa[_0xc7c8('0x10')]==='Case'){if(_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x16')){_0x388f54[_0xc7c8('0x1a')]=_0x99c405['id'];}else if(_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x18')){_0x388f54[_0xc7c8('0x1b')]=_0x99c405['id'];}else if(_0x99c405[_0xc7c8('0x15')]===_0xc7c8('0x17')&&_0x42b8aa[_0xc7c8('0x1c')]){_0x388f54[_0x42b8aa['leadId']]=_0x99c405['id'];}else{logger['info'](_0xc7c8('0x1d'));}}}return _0x3c7d82[_0xc7c8('0x1e')](_0x42b8aa[_0xc7c8('0x10')])['create'](_0x388f54);}function getUser(_0x2dfda2,_0x1c5878,_0x97533f){if(!_[_0xc7c8('0x1f')](_0x1c5878)&&intUtil[_0xc7c8('0x20')](_0x1c5878)){var _0x3924df={'Email':_0x1c5878};var _0x1addbe={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x97533f[_0xc7c8('0x1e')](_0xc7c8('0x21'))[_0xc7c8('0x22')](_0x3924df,_0x1addbe)[_0xc7c8('0x23')]()[_0xc7c8('0x24')](function(_0x4d5fa2){if(_0x4d5fa2[_0xc7c8('0x25')]){var _0x2ed7f0=_[_0xc7c8('0x22')](_0x4d5fa2,function(_0x52e917){return _0x52e917[_0xc7c8('0x26')]===_0x1c5878;});if(_0x2ed7f0){logger['info']('Agent\x20%s\x20found.',_0x1c5878);return BPromise[_0xc7c8('0x27')]({'id':_0x2ed7f0['Id'],'name':_0x2ed7f0[_0xc7c8('0x28')]});}}else{logger[_0xc7c8('0x29')](_0xc7c8('0x2a'),_0x1c5878);return _0x97533f[_0xc7c8('0x2b')]()[_0xc7c8('0x24')](function(_0x2c538b){return BPromise['resolve']({'id':_0x2c538b[_0xc7c8('0x2c')],'name':_0x2c538b[_0xc7c8('0x2d')]});});}});}else{logger[_0xc7c8('0x29')](_0xc7c8('0x2a'),_0x1c5878);return _0x97533f[_0xc7c8('0x2b')]()[_0xc7c8('0x24')](function(_0x56443c){return BPromise[_0xc7c8('0x27')]({'id':_0x56443c['user_id'],'name':_0x56443c[_0xc7c8('0x2d')]});});}}function getEndUser(_0x15f93e,_0x1a6f39,_0x35adbf,_0x4d6efd,_0x19f889){var _0x2babae={'$or':{'Phone':_0x4d6efd}};var _0x31b03b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc7c8('0x27')]()[_0xc7c8('0x24')](function(){logger[_0xc7c8('0x29')](_0xc7c8('0x2e'),_0x4d6efd,_0x1a6f39[_0xc7c8('0x2f')]);switch(_0x1a6f39[_0xc7c8('0x2f')]){case'contact_lead':var _0x318756=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39[_0xc7c8('0x31')]){var _0x56b001={};_0x56b001[_0x1a6f39['additionalSearchContact']]=_0x4d6efd;_['merge'](_0x318756[_0xc7c8('0x32')],_0x56b001);}return _0x19f889[_0xc7c8('0x1e')]('Contact')[_0xc7c8('0x22')](_0x318756,_0x31b03b)[_0xc7c8('0x23')]()[_0xc7c8('0x24')](function(_0x4cb2c4){if(_0x4cb2c4&&_0x4cb2c4[_0xc7c8('0x25')]){return _0x4cb2c4;}else{var _0x369a52=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39['additionalSearchLead']){var _0x33059e={};_0x33059e[_0x1a6f39['additionalSearchLead']]=_0x4d6efd;_[_0xc7c8('0x33')](_0x369a52[_0xc7c8('0x32')],_0x33059e);}return _0x19f889[_0xc7c8('0x1e')](_0xc7c8('0x34'))[_0xc7c8('0x22')](_0x369a52,_0x31b03b);}});case'account_contact_lead':var _0x328631=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39[_0xc7c8('0x35')]){var _0x56b001={};_0x56b001[_0x1a6f39['additionalSearchAccount']]=_0x4d6efd;_['merge'](_0x328631[_0xc7c8('0x32')],_0x56b001);}return _0x19f889[_0xc7c8('0x1e')](_0xc7c8('0x36'))[_0xc7c8('0x22')](_0x328631,_0x31b03b)[_0xc7c8('0x23')]()[_0xc7c8('0x24')](function(_0xe7876e){if(_0xe7876e&&_0xe7876e[_0xc7c8('0x25')]){return _0xe7876e;}else{var _0x4c18a2=_['cloneDeep'](_0x2babae);if(_0x1a6f39['additionalSearchContact']){var _0x1241e0={};_0x1241e0[_0x1a6f39[_0xc7c8('0x31')]]=_0x4d6efd;_[_0xc7c8('0x33')](_0x4c18a2[_0xc7c8('0x32')],_0x1241e0);}return _0x19f889['sobject'](_0xc7c8('0x37'))[_0xc7c8('0x22')](_0x4c18a2,_0x31b03b)[_0xc7c8('0x24')](function(_0x3ca7c0){if(_0x3ca7c0&&_0x3ca7c0[_0xc7c8('0x25')]){return _0x3ca7c0;}else{var _0x5df4f1=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39[_0xc7c8('0x38')]){var _0x3a8b51={};_0x3a8b51[_0x1a6f39[_0xc7c8('0x38')]]=_0x4d6efd;_['merge'](_0x5df4f1[_0xc7c8('0x32')],_0x3a8b51);}return _0x19f889['sobject']('Lead')['find'](_0x5df4f1,_0x31b03b);}});}});case _0xc7c8('0x16'):var _0x318756=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39[_0xc7c8('0x31')]){var _0x56b001={};_0x56b001[_0x1a6f39['additionalSearchContact']]=_0x4d6efd;_[_0xc7c8('0x33')](_0x318756[_0xc7c8('0x32')],_0x56b001);}return _0x19f889[_0xc7c8('0x1e')](_0xc7c8('0x37'))['find'](_0x318756,_0x31b03b)[_0xc7c8('0x23')]();case'lead':var _0x21dd71=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39['additionalSearchLead']){var _0x56b001={};_0x56b001[_0x1a6f39[_0xc7c8('0x38')]]=_0x4d6efd;_[_0xc7c8('0x33')](_0x21dd71[_0xc7c8('0x32')],_0x56b001);}return _0x19f889[_0xc7c8('0x1e')]('Lead')[_0xc7c8('0x22')](_0x21dd71,_0x31b03b);case _0xc7c8('0x18'):var _0x328631=_[_0xc7c8('0x30')](_0x2babae);if(_0x1a6f39[_0xc7c8('0x35')]){var _0x56b001={};_0x56b001[_0x1a6f39[_0xc7c8('0x35')]]=_0x4d6efd;_[_0xc7c8('0x33')](_0x328631[_0xc7c8('0x32')],_0x56b001);}return _0x19f889[_0xc7c8('0x1e')](_0xc7c8('0x36'))[_0xc7c8('0x22')](_0x328631,_0x31b03b);default:return null;}})[_0xc7c8('0x24')](function(_0x5a834b){if(_0x5a834b&&_0x5a834b[_0xc7c8('0x25')]){var _0x5ecb61=_[_0xc7c8('0x39')](_0x5a834b);if(_0x5ecb61){return BPromise[_0xc7c8('0x27')]({'id':_0x5ecb61['Id'],'name':_0x5ecb61[_0xc7c8('0x28')],'phone':_0x5ecb61[_0xc7c8('0x3a')],'endUserType':_0x5ecb61['attributes'][_0xc7c8('0x3b')][_0xc7c8('0x3c')]()});}}})[_0xc7c8('0x24')](function(_0x1a93ce){if(_0x1a93ce){logger['info'](_0xc7c8('0x3d'),_0x1a93ce[_0xc7c8('0x15')],_0x4d6efd);return BPromise[_0xc7c8('0x27')](_0x1a93ce);}else{logger[_0xc7c8('0x29')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4d6efd);var _0x3ee519={'Phone':_0x4d6efd};if(_0x1a6f39['moduleCreate']){if(_0x1a6f39[_0xc7c8('0x3e')]===_0xc7c8('0x16')){logger[_0xc7c8('0x29')](_0xc7c8('0x3f'),_0x4d6efd,_0x1a6f39[_0xc7c8('0x3e')]);_0x3ee519[_0xc7c8('0x40')]=_0x35adbf!==_0xc7c8('0x41')?_0x35adbf:util['format'](_0xc7c8('0x42'),_0x4d6efd);}else if(_0x1a6f39[_0xc7c8('0x3e')]===_0xc7c8('0x17')){logger[_0xc7c8('0x29')](_0xc7c8('0x3f'),_0x4d6efd,_0x1a6f39[_0xc7c8('0x3e')]);_0x3ee519[_0xc7c8('0x40')]=_0x35adbf!==_0xc7c8('0x41')?_0x35adbf:util[_0xc7c8('0x43')](_0xc7c8('0x42'),_0x4d6efd);_0x3ee519[_0xc7c8('0x44')]=_0xc7c8('0x45');}else if(_0x1a6f39[_0xc7c8('0x3e')]===_0xc7c8('0x18')){logger[_0xc7c8('0x29')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4d6efd,_0x1a6f39[_0xc7c8('0x3e')]);_0x3ee519[_0xc7c8('0x28')]=_0x35adbf!==''?_0x35adbf:util[_0xc7c8('0x43')](_0xc7c8('0x42'),_0x4d6efd);}else{return null;}}return _0x19f889[_0xc7c8('0x1e')](_['upperFirst'](_0x1a6f39[_0xc7c8('0x3e')]))['create'](_0x3ee519)['then'](function(_0x4b604a){return BPromise[_0xc7c8('0x27')]({'id':_0x4b604a['id'],'endUserType':_0x1a6f39['moduleCreate']});});}});}function getCustomFields(_0x1416c4,_0x346af3){var _0x573777={};if(_0x1416c4[_0xc7c8('0x25')]>0x0){_['forEach'](_0x1416c4,function(_0x5c6afc){if(_[_0xc7c8('0x46')]([_0xc7c8('0x47'),_0xc7c8('0x48')],_0x5c6afc[_0xc7c8('0x3b')])&&_0x5c6afc[_0xc7c8('0x49')]){_0x573777[_0x5c6afc[_0xc7c8('0x49')]]=_0x5c6afc[_0xc7c8('0x4a')][_0xc7c8('0x4b')]();}else if(_0x5c6afc[_0xc7c8('0x3b')]===_0xc7c8('0x4c')&&_0x5c6afc[_0xc7c8('0x4d')]&&_0x5c6afc[_0xc7c8('0x49')]){_0x346af3[_0x5c6afc['variableName']]&&(_0x573777[_0x5c6afc[_0xc7c8('0x49')]]=_0x346af3[_0x5c6afc['variableName']][_0xc7c8('0x4b')]());}else if(_0x5c6afc[_0xc7c8('0x3b')]===_0xc7c8('0x4e')&&_0x5c6afc[_0xc7c8('0x4f')]&&_0x5c6afc[_0xc7c8('0x4f')][_0xc7c8('0x50')]&&_0x5c6afc[_0xc7c8('0x49')]){_0x346af3[_0x5c6afc[_0xc7c8('0x4f')]['name'][_0xc7c8('0x3c')]()]&&(_0x573777[_0x5c6afc['idField']]=_0x346af3[_0x5c6afc[_0xc7c8('0x4f')]['name'][_0xc7c8('0x3c')]()][_0xc7c8('0x4b')]());}});}return _0x573777;}function getConnection(_0x1b13bf){var _0x112f10=_0x1b13bf['password'][_0xc7c8('0x51')](_0x1b13bf[_0xc7c8('0x52')]);var _0x5a5fc0=new jsforce[(_0xc7c8('0x53'))]({'oauth2':{'loginUrl':_0x1b13bf['remoteUri']||'https://login.salesforce.com','clientId':_0x1b13bf[_0xc7c8('0x54')],'clientSecret':_0x1b13bf['clientSecret']}});return _0x5a5fc0[_0xc7c8('0x55')](_0x1b13bf[_0xc7c8('0x56')],_0x112f10)[_0xc7c8('0x24')](function(){logger[_0xc7c8('0x29')](_0xc7c8('0x57'));return _0x5a5fc0;});}exports['queue']=function(_0x379fdc,_0x540ccc,_0x525719,_0x41ef7c,_0x26d669,_0x1c8f74){var _0x32c351,_0xce88b7,_0x5208e0,_0x251ad3;_0x1c8f74['serverUrl']=intUtil[_0xc7c8('0x58')](_0x1c8f74[_0xc7c8('0x59')]);_0x1c8f74[_0xc7c8('0x5a')]=intUtil[_0xc7c8('0x58')](_0x1c8f74[_0xc7c8('0x5a')]);if(_0x26d669&&_0x26d669[_0xc7c8('0x5b')]){logger['info'](_0xc7c8('0x5c'),_0xc7c8('0x5d'));_0x540ccc[_0xc7c8('0x5e')]=util[_0xc7c8('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c8f74[_0xc7c8('0x59')],_0x540ccc['uniqueid'],md5(_0x540ccc[_0xc7c8('0x5f')]));}else{_0x540ccc[_0xc7c8('0x5e')]='';}return getConnection(_0x1c8f74)[_0xc7c8('0x24')](function(_0x3a9fdf){_0x251ad3=_0x3a9fdf;return getUser(_0x1c8f74,_0x41ef7c[_0xc7c8('0x60')],_0x251ad3);})[_0xc7c8('0x24')](function(_0x37834a){_0x32c351=_0x37834a;return getEndUser(_0x1c8f74,_0x525719,_0x540ccc[_0xc7c8('0x61')],_0x540ccc[_0xc7c8('0x62')],_0x251ad3);})[_0xc7c8('0x24')](function(_0x5721c6){_0xce88b7=_0x5721c6;return getTicket(_0x1c8f74,_0x32c351,_0xce88b7,_0x525719,_0x540ccc,_0x525719[_0xc7c8('0x63')],_0x251ad3,_0xc7c8('0x64'));})['then'](function(_0xb509ae){_0x5208e0=_0xb509ae;logger[_0xc7c8('0x29')](_0xc7c8('0x65'),_0x5208e0['id']);logger[_0xc7c8('0x29')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5208e0['id'],_0x41ef7c['name'],_0x1c8f74[_0xc7c8('0x3b')]);switch(_0x1c8f74['type']){case'integrationTab':emit(util[_0xc7c8('0x43')](_0xc7c8('0x66'),_0x41ef7c[_0xc7c8('0x50')]),_0xc7c8('0x67'),{'recordId':_0x5208e0['id']});break;case'newTab':emit(util[_0xc7c8('0x43')]('user:%s',_0x41ef7c[_0xc7c8('0x50')]),_0xc7c8('0x68'),{'uri':util[_0xc7c8('0x43')](_0xc7c8('0x69'),_0x251ad3[_0xc7c8('0x6a')],_0x5208e0['id'])});break;default:logger[_0xc7c8('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5f53d2){logger[_0xc7c8('0x6b')](_0xc7c8('0x5c'),_0x5f53d2);});};exports['outbound']=function(_0x91d3a6,_0x388a07,_0x55da67,_0x495f65,_0x3a350d,_0x37e4a3,_0x2ce68c){var _0x1f8cbc,_0x4dc33c,_0x300e3b,_0xf07437;_0x37e4a3['serverUrl']=intUtil[_0xc7c8('0x58')](_0x37e4a3[_0xc7c8('0x59')]);_0x37e4a3[_0xc7c8('0x5a')]=intUtil['stripTrailingSlash'](_0x37e4a3[_0xc7c8('0x5a')]);if(_0x2ce68c&&_0x2ce68c['recordingFormat']&&_0x2ce68c['recordingFormat']!=='none'){logger['info'](_0xc7c8('0x6c'),_0xc7c8('0x5d'));_0x388a07['recordingURL']=util[_0xc7c8('0x43')](_0xc7c8('0x6d'),_0x37e4a3[_0xc7c8('0x59')],_0x388a07[_0xc7c8('0x5f')],md5(_0x388a07['uniqueid']));}return getConnection(_0x37e4a3)[_0xc7c8('0x24')](function(_0xb89fcc){_0xf07437=_0xb89fcc;return getUser(_0x37e4a3,_0x495f65['email'],_0xf07437);})[_0xc7c8('0x24')](function(_0x3fa472){_0x1f8cbc=_0x3fa472;return getEndUser(_0x37e4a3,_0x55da67,_0x388a07['destcalleridname'],_0x388a07[_0xc7c8('0x6e')],_0xf07437);})['then'](function(_0x1f9290){_0x4dc33c=_0x1f9290;return getTicket(_0x37e4a3,_0x1f8cbc,_0x4dc33c,_0x55da67,_0x388a07,_0x55da67[_0xc7c8('0x63')],_0xf07437,_0xc7c8('0x6f'));})[_0xc7c8('0x24')](function(_0x582046){_0x300e3b=_0x582046;logger[_0xc7c8('0x29')](_0xc7c8('0x70'),_0x300e3b['id']);logger['info'](_0xc7c8('0x71'),_0x300e3b['id'],_0x495f65[_0xc7c8('0x50')],_0x37e4a3[_0xc7c8('0x3b')]);switch(_0x37e4a3['type']){case _0xc7c8('0x72'):emit(util[_0xc7c8('0x43')](_0xc7c8('0x66'),_0x495f65[_0xc7c8('0x50')]),_0xc7c8('0x67'),{'recordId':_0x300e3b['id']});break;case'newTab':emit(util[_0xc7c8('0x43')]('user:%s',_0x495f65['name']),_0xc7c8('0x68'),{'uri':util['format'](_0xc7c8('0x69'),_0xf07437[_0xc7c8('0x6a')],_0x300e3b['id'])});break;default:logger['error'](_0xc7c8('0x6c'),_0xc7c8('0x73'));}})[_0xc7c8('0x74')](function(_0x138d6f){logger[_0xc7c8('0x6b')]('[OUTBOUND]',_0x138d6f);});};exports['unmanaged']=function(_0x366822,_0xe657ec,_0x15b2db,_0xd3e1f3,_0x5e5ce9,_0x53bde3){var _0x30e50d,_0x1eb316,_0x3c48b6,_0x51e482;_0x53bde3[_0xc7c8('0x59')]=intUtil[_0xc7c8('0x58')](_0x53bde3['serverUrl']);_0x53bde3[_0xc7c8('0x5a')]=intUtil[_0xc7c8('0x58')](_0x53bde3[_0xc7c8('0x5a')]);if(_0x5e5ce9&&_0x5e5ce9[_0xc7c8('0x5b')]){logger[_0xc7c8('0x29')]('['+_0xe657ec[_0xc7c8('0x75')][_0xc7c8('0x76')]()+']',_0xc7c8('0x5d'));_0xe657ec['recordingURL']=util[_0xc7c8('0x43')](_0xc7c8('0x6d'),_0x53bde3[_0xc7c8('0x59')],_0xe657ec[_0xc7c8('0x5f')],md5(_0xe657ec[_0xc7c8('0x5f')]));}else{_0xe657ec[_0xc7c8('0x5e')]='';}return getConnection(_0x53bde3)[_0xc7c8('0x24')](function(_0x5e450e){_0x51e482=_0x5e450e;if(!_[_0xc7c8('0x1f')](_0xd3e1f3)){return getUser(_0x53bde3,_0xd3e1f3[_0xc7c8('0x50')],_0x51e482);}else{return getUser(_0x53bde3,null,_0x51e482);}})[_0xc7c8('0x24')](function(_0x242784){_0x30e50d=_0x242784;return getEndUser(_0x53bde3,_0x15b2db,_0xe657ec[_0xc7c8('0x61')],_0xe657ec[_0xc7c8('0x62')],_0x51e482);})[_0xc7c8('0x24')](function(_0x1cbae7){_0x1eb316=_0x1cbae7;return getTicket(_0x53bde3,_0x30e50d,_0x1eb316,_0x15b2db,_0xe657ec,_0x15b2db['Fields'],_0x51e482);})['then'](function(_0x2b5437){_0x3c48b6=_0x2b5437;logger[_0xc7c8('0x29')]('['+_0xe657ec[_0xc7c8('0x75')][_0xc7c8('0x76')]()+_0xc7c8('0x77'),_0x3c48b6['id']);logger[_0xc7c8('0x29')]('['+_0xe657ec[_0xc7c8('0x75')][_0xc7c8('0x76')]()+_0xc7c8('0x78'),_0x53bde3['type']);})[_0xc7c8('0x74')](function(_0xdca1e6){logger[_0xc7c8('0x6b')]('['+_0xe657ec[_0xc7c8('0x75')]['toUpperCase']()+']',_0xdca1e6);});}; \ No newline at end of file +var _0x9d28=['first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','uniqueid','recordingURL','email','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','endUserType','contact','lead','account','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','sobject','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','Contact','cloneDeep','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','$or','Account'];(function(_0x11893e,_0x330ea2){var _0x24d206=function(_0x3276a8){while(--_0x3276a8){_0x11893e['push'](_0x11893e['shift']());}};_0x24d206(++_0x330ea2);}(_0x9d28,0xc2));var _0x89d2=function(_0x348d8d,_0x25a6dd){_0x348d8d=_0x348d8d-0x0;var _0x2a7d1f=_0x9d28[_0x348d8d];return _0x2a7d1f;};'use strict';var _=require(_0x89d2('0x0'));var rp=require(_0x89d2('0x1'));var moment=require(_0x89d2('0x2'));var BPromise=require(_0x89d2('0x3'));var md5=require(_0x89d2('0x4'));var jsforce=require(_0x89d2('0x5'));var util=require(_0x89d2('0x6'));var Redis=require(_0x89d2('0x7'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x89d2('0x8'))(_0x89d2('0x9'));config['redis']=_[_0x89d2('0xa')](config[_0x89d2('0xb')],{'host':_0x89d2('0xc'),'port':0x18eb});var io=require(_0x89d2('0xd'))(new Redis(config[_0x89d2('0xb')]));function emit(_0x26f2aa,_0x4050ec,_0xb0f014){io['to'](_0x26f2aa)['emit'](_0x4050ec,_0xb0f014);}function getTicket(_0x5a2af9,_0x3e902b,_0x4197b0,_0x57f097,_0x3c64f4,_0x2a4689,_0x3295fe,_0x2f680d){var _0x1ab6ed=Object[_0x89d2('0xe')]({},{'OwnerId':_0x3e902b['id'],'Subject':intUtil[_0x89d2('0xf')](_0x57f097[_0x89d2('0x10')],_0x3c64f4,'\x20'),'Description':intUtil[_0x89d2('0xf')](_0x57f097[_0x89d2('0x11')],_0x3c64f4,'\x0a')},getCustomFields(_0x2a4689,_0x3c64f4));if(_0x4197b0){if(_0x57f097['ticketType']===_0x89d2('0x12')){_0x1ab6ed['ActivityDate']=moment[_0x89d2('0x13')]();_0x1ab6ed[_0x89d2('0x14')]=![];_0x1ab6ed['IsRecurrence']=![];if(_0x4197b0[_0x89d2('0x15')]===_0x89d2('0x16')||_0x4197b0[_0x89d2('0x15')]===_0x89d2('0x17')){_0x1ab6ed['WhoId']=_0x4197b0['id'];}else if(_0x4197b0[_0x89d2('0x15')]===_0x89d2('0x18')){_0x1ab6ed['WhatId']=_0x4197b0['id'];}}else if(_0x57f097[_0x89d2('0x19')]===_0x89d2('0x1a')){if(_0x4197b0['endUserType']==='contact'){_0x1ab6ed[_0x89d2('0x1b')]=_0x4197b0['id'];}else if(_0x4197b0[_0x89d2('0x15')]===_0x89d2('0x18')){_0x1ab6ed[_0x89d2('0x1c')]=_0x4197b0['id'];}else if(_0x4197b0[_0x89d2('0x15')]===_0x89d2('0x17')&&_0x57f097['leadId']){_0x1ab6ed[_0x57f097[_0x89d2('0x1d')]]=_0x4197b0['id'];}else{logger[_0x89d2('0x1e')](_0x89d2('0x1f'));}}}return _0x3295fe['sobject'](_0x57f097['ticketType'])[_0x89d2('0x20')](_0x1ab6ed);}function getUser(_0x434088,_0x3f2b3c,_0x20d857){if(!_['isNil'](_0x3f2b3c)&&intUtil['validateEmail'](_0x3f2b3c)){var _0xdc8f33={'Email':_0x3f2b3c};var _0x35311c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x20d857[_0x89d2('0x21')](_0x89d2('0x22'))[_0x89d2('0x23')](_0xdc8f33,_0x35311c)[_0x89d2('0x24')]()[_0x89d2('0x25')](function(_0x4e4f68){if(_0x4e4f68[_0x89d2('0x26')]){var _0x335366=_['find'](_0x4e4f68,function(_0x449099){return _0x449099['Email']===_0x3f2b3c;});if(_0x335366){logger[_0x89d2('0x1e')](_0x89d2('0x27'),_0x3f2b3c);return BPromise[_0x89d2('0x28')]({'id':_0x335366['Id'],'name':_0x335366[_0x89d2('0x29')]});}}else{logger[_0x89d2('0x1e')](_0x89d2('0x2a'),_0x3f2b3c);return _0x20d857['identity']()[_0x89d2('0x25')](function(_0x243776){return BPromise['resolve']({'id':_0x243776['user_id'],'name':_0x243776[_0x89d2('0x2b')]});});}});}else{logger[_0x89d2('0x1e')](_0x89d2('0x2a'),_0x3f2b3c);return _0x20d857[_0x89d2('0x2c')]()[_0x89d2('0x25')](function(_0x1f8181){return BPromise['resolve']({'id':_0x1f8181[_0x89d2('0x2d')],'name':_0x1f8181[_0x89d2('0x2b')]});});}}function getEndUser(_0x10e575,_0x475408,_0x518625,_0x126f9d,_0x286826){var _0x278967={'$or':{'Phone':_0x126f9d}};var _0x296e67={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x89d2('0x25')](function(){logger[_0x89d2('0x1e')](_0x89d2('0x2e'),_0x126f9d,_0x475408[_0x89d2('0x2f')]);switch(_0x475408[_0x89d2('0x2f')]){case'contact_lead':var _0x2c54c2=_['cloneDeep'](_0x278967);if(_0x475408[_0x89d2('0x30')]){var _0x34c38f={};_0x34c38f[_0x475408[_0x89d2('0x30')]]=_0x126f9d;_['merge'](_0x2c54c2['$or'],_0x34c38f);}return _0x286826[_0x89d2('0x21')](_0x89d2('0x31'))[_0x89d2('0x23')](_0x2c54c2,_0x296e67)[_0x89d2('0x24')]()['then'](function(_0x55f0a2){if(_0x55f0a2&&_0x55f0a2[_0x89d2('0x26')]){return _0x55f0a2;}else{var _0x4c9293=_[_0x89d2('0x32')](_0x278967);if(_0x475408[_0x89d2('0x33')]){var _0x3aa1fd={};_0x3aa1fd[_0x475408[_0x89d2('0x33')]]=_0x126f9d;_[_0x89d2('0x34')](_0x4c9293['$or'],_0x3aa1fd);}return _0x286826[_0x89d2('0x21')](_0x89d2('0x35'))[_0x89d2('0x23')](_0x4c9293,_0x296e67);}});case _0x89d2('0x36'):var _0x54e673=_[_0x89d2('0x32')](_0x278967);if(_0x475408['additionalSearchAccount']){var _0x34c38f={};_0x34c38f[_0x475408[_0x89d2('0x37')]]=_0x126f9d;_[_0x89d2('0x34')](_0x54e673[_0x89d2('0x38')],_0x34c38f);}return _0x286826['sobject'](_0x89d2('0x39'))[_0x89d2('0x23')](_0x54e673,_0x296e67)[_0x89d2('0x24')]()['then'](function(_0x1025bb){if(_0x1025bb&&_0x1025bb['length']){return _0x1025bb;}else{var _0x38db62=_[_0x89d2('0x32')](_0x278967);if(_0x475408['additionalSearchContact']){var _0x598161={};_0x598161[_0x475408[_0x89d2('0x30')]]=_0x126f9d;_['merge'](_0x38db62[_0x89d2('0x38')],_0x598161);}return _0x286826[_0x89d2('0x21')](_0x89d2('0x31'))[_0x89d2('0x23')](_0x38db62,_0x296e67)[_0x89d2('0x25')](function(_0x5a4477){if(_0x5a4477&&_0x5a4477[_0x89d2('0x26')]){return _0x5a4477;}else{var _0x5502df=_[_0x89d2('0x32')](_0x278967);if(_0x475408[_0x89d2('0x33')]){var _0xaa7378={};_0xaa7378[_0x475408[_0x89d2('0x33')]]=_0x126f9d;_['merge'](_0x5502df['$or'],_0xaa7378);}return _0x286826[_0x89d2('0x21')](_0x89d2('0x35'))[_0x89d2('0x23')](_0x5502df,_0x296e67);}});}});case _0x89d2('0x16'):var _0x2c54c2=_[_0x89d2('0x32')](_0x278967);if(_0x475408[_0x89d2('0x30')]){var _0x34c38f={};_0x34c38f[_0x475408[_0x89d2('0x30')]]=_0x126f9d;_[_0x89d2('0x34')](_0x2c54c2[_0x89d2('0x38')],_0x34c38f);}return _0x286826[_0x89d2('0x21')](_0x89d2('0x31'))[_0x89d2('0x23')](_0x2c54c2,_0x296e67)['execute']();case _0x89d2('0x17'):var _0x3b94de=_[_0x89d2('0x32')](_0x278967);if(_0x475408[_0x89d2('0x33')]){var _0x34c38f={};_0x34c38f[_0x475408[_0x89d2('0x33')]]=_0x126f9d;_['merge'](_0x3b94de[_0x89d2('0x38')],_0x34c38f);}return _0x286826['sobject'](_0x89d2('0x35'))[_0x89d2('0x23')](_0x3b94de,_0x296e67);case _0x89d2('0x18'):var _0x54e673=_['cloneDeep'](_0x278967);if(_0x475408[_0x89d2('0x37')]){var _0x34c38f={};_0x34c38f[_0x475408[_0x89d2('0x37')]]=_0x126f9d;_[_0x89d2('0x34')](_0x54e673[_0x89d2('0x38')],_0x34c38f);}return _0x286826[_0x89d2('0x21')]('Account')[_0x89d2('0x23')](_0x54e673,_0x296e67);default:return null;}})[_0x89d2('0x25')](function(_0x27d32a){if(_0x27d32a&&_0x27d32a[_0x89d2('0x26')]){var _0x18f231=_[_0x89d2('0x3a')](_0x27d32a);if(_0x18f231){return BPromise[_0x89d2('0x28')]({'id':_0x18f231['Id'],'name':_0x18f231[_0x89d2('0x29')],'phone':_0x18f231[_0x89d2('0x3b')],'endUserType':_0x18f231[_0x89d2('0x3c')][_0x89d2('0x3d')]['toLowerCase']()});}}})['then'](function(_0x58986f){if(_0x58986f){logger[_0x89d2('0x1e')](_0x89d2('0x3e'),_0x58986f[_0x89d2('0x15')],_0x126f9d);return BPromise['resolve'](_0x58986f);}else{logger[_0x89d2('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x126f9d);var _0x38c3ed={'Phone':_0x126f9d};if(_0x475408[_0x89d2('0x3f')]){if(_0x475408[_0x89d2('0x3f')]===_0x89d2('0x16')){logger[_0x89d2('0x1e')](_0x89d2('0x40'),_0x126f9d,_0x475408[_0x89d2('0x3f')]);_0x38c3ed[_0x89d2('0x41')]=_0x518625!==_0x89d2('0x42')?_0x518625:util[_0x89d2('0x43')]('Caller\x20-\x20%s',_0x126f9d);}else if(_0x475408['moduleCreate']===_0x89d2('0x17')){logger[_0x89d2('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x126f9d,_0x475408[_0x89d2('0x3f')]);_0x38c3ed[_0x89d2('0x41')]=_0x518625!==''?_0x518625:util[_0x89d2('0x43')](_0x89d2('0x44'),_0x126f9d);_0x38c3ed['Company']=_0x89d2('0x45');}else if(_0x475408[_0x89d2('0x3f')]==='account'){logger['info'](_0x89d2('0x40'),_0x126f9d,_0x475408[_0x89d2('0x3f')]);_0x38c3ed['Name']=_0x518625!==_0x89d2('0x42')?_0x518625:util[_0x89d2('0x43')]('Caller\x20-\x20%s',_0x126f9d);}else{return null;}}return _0x286826[_0x89d2('0x21')](_['upperFirst'](_0x475408[_0x89d2('0x3f')]))[_0x89d2('0x20')](_0x38c3ed)[_0x89d2('0x25')](function(_0x1cb45e){return BPromise['resolve']({'id':_0x1cb45e['id'],'endUserType':_0x475408[_0x89d2('0x3f')]});});}});}function getCustomFields(_0x198479,_0x52fa5e){var _0xf63e44={};if(_0x198479[_0x89d2('0x26')]>0x0){_[_0x89d2('0x46')](_0x198479,function(_0x30d2e5){if(_['includes']([_0x89d2('0x47'),_0x89d2('0x48')],_0x30d2e5[_0x89d2('0x3d')])&&_0x30d2e5[_0x89d2('0x49')]){_0xf63e44[_0x30d2e5[_0x89d2('0x49')]]=_0x30d2e5[_0x89d2('0x4a')][_0x89d2('0x4b')]();}else if(_0x30d2e5['type']===_0x89d2('0x4c')&&_0x30d2e5[_0x89d2('0x4d')]&&_0x30d2e5[_0x89d2('0x49')]){_0x52fa5e[_0x30d2e5[_0x89d2('0x4d')]]&&(_0xf63e44[_0x30d2e5['idField']]=_0x52fa5e[_0x30d2e5[_0x89d2('0x4d')]][_0x89d2('0x4b')]());}else if(_0x30d2e5[_0x89d2('0x3d')]===_0x89d2('0x4e')&&_0x30d2e5[_0x89d2('0x4f')]&&_0x30d2e5['Variable'][_0x89d2('0x50')]&&_0x30d2e5['idField']){_0x52fa5e[_0x30d2e5['Variable']['name'][_0x89d2('0x51')]()]&&(_0xf63e44[_0x30d2e5['idField']]=_0x52fa5e[_0x30d2e5[_0x89d2('0x4f')][_0x89d2('0x50')][_0x89d2('0x51')]()]['toString']());}});}return _0xf63e44;}function getConnection(_0x663b94){var _0x339320=_0x663b94[_0x89d2('0x52')][_0x89d2('0x53')](_0x663b94[_0x89d2('0x54')]);var _0x3eb9e2=new jsforce[(_0x89d2('0x55'))]({'oauth2':{'loginUrl':_0x663b94[_0x89d2('0x56')]||_0x89d2('0x57'),'clientId':_0x663b94[_0x89d2('0x58')],'clientSecret':_0x663b94[_0x89d2('0x59')]}});return _0x3eb9e2[_0x89d2('0x5a')](_0x663b94[_0x89d2('0x5b')],_0x339320)['then'](function(){logger[_0x89d2('0x1e')](_0x89d2('0x5c'));return _0x3eb9e2;});}exports[_0x89d2('0x5d')]=function(_0x45ba4c,_0x4942a2,_0x4c27dc,_0x2cb211,_0x573905,_0x19d356){var _0x3f2d26,_0xce5316,_0x490638,_0x374885;_0x19d356[_0x89d2('0x5e')]=intUtil['stripTrailingSlash'](_0x19d356['serverUrl']);_0x19d356['remoteUri']=intUtil[_0x89d2('0x5f')](_0x19d356[_0x89d2('0x56')]);if(_0x573905&&_0x573905[_0x89d2('0x60')]){logger[_0x89d2('0x1e')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4942a2['recordingURL']=util[_0x89d2('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19d356['serverUrl'],_0x4942a2[_0x89d2('0x61')],md5(_0x4942a2[_0x89d2('0x61')]));}else{_0x4942a2[_0x89d2('0x62')]='';}return getConnection(_0x19d356)[_0x89d2('0x25')](function(_0xe00dd6){_0x374885=_0xe00dd6;return getUser(_0x19d356,_0x2cb211[_0x89d2('0x63')],_0x374885);})[_0x89d2('0x25')](function(_0x4bb0e8){_0x3f2d26=_0x4bb0e8;return getEndUser(_0x19d356,_0x4c27dc,_0x4942a2[_0x89d2('0x64')],_0x4942a2['calleridnum'],_0x374885);})[_0x89d2('0x25')](function(_0x3a2bbb){_0xce5316=_0x3a2bbb;return getTicket(_0x19d356,_0x3f2d26,_0xce5316,_0x4c27dc,_0x4942a2,_0x4c27dc['Fields'],_0x374885,_0x89d2('0x5d'));})[_0x89d2('0x25')](function(_0x16f22f){_0x490638=_0x16f22f;logger[_0x89d2('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x490638['id']);logger[_0x89d2('0x1e')](_0x89d2('0x65'),_0x490638['id'],_0x2cb211[_0x89d2('0x50')],_0x19d356[_0x89d2('0x3d')]);switch(_0x19d356['type']){case _0x89d2('0x66'):emit(util[_0x89d2('0x43')](_0x89d2('0x67'),_0x2cb211[_0x89d2('0x50')]),_0x89d2('0x68'),{'recordId':_0x490638['id']});break;case'newTab':emit(util[_0x89d2('0x43')](_0x89d2('0x67'),_0x2cb211[_0x89d2('0x50')]),_0x89d2('0x69'),{'uri':util[_0x89d2('0x43')](_0x89d2('0x6a'),_0x374885[_0x89d2('0x6b')],_0x490638['id'])});break;default:logger[_0x89d2('0x6c')](_0x89d2('0x6d'));}})[_0x89d2('0x6e')](function(_0x344281){logger[_0x89d2('0x6c')](_0x89d2('0x6f'),_0x344281);});};exports['outbound']=function(_0x588a2a,_0x31622b,_0x2005b6,_0x4a5f38,_0x441ee4,_0x10ec25,_0x263685){var _0x389fbe,_0x7abaa2,_0x3d8df1,_0x4ad915;_0x10ec25['serverUrl']=intUtil[_0x89d2('0x5f')](_0x10ec25[_0x89d2('0x5e')]);_0x10ec25[_0x89d2('0x56')]=intUtil[_0x89d2('0x5f')](_0x10ec25['remoteUri']);if(_0x263685&&_0x263685['recordingFormat']&&_0x263685[_0x89d2('0x70')]!=='none'){logger['info'](_0x89d2('0x71'),_0x89d2('0x72'));_0x31622b[_0x89d2('0x62')]=util[_0x89d2('0x43')](_0x89d2('0x73'),_0x10ec25[_0x89d2('0x5e')],_0x31622b['uniqueid'],md5(_0x31622b[_0x89d2('0x61')]));}return getConnection(_0x10ec25)[_0x89d2('0x25')](function(_0x140684){_0x4ad915=_0x140684;return getUser(_0x10ec25,_0x4a5f38['email'],_0x4ad915);})['then'](function(_0x49fb42){_0x389fbe=_0x49fb42;return getEndUser(_0x10ec25,_0x2005b6,_0x31622b[_0x89d2('0x74')],_0x31622b['destcalleridnum'],_0x4ad915);})[_0x89d2('0x25')](function(_0x52c63c){_0x7abaa2=_0x52c63c;return getTicket(_0x10ec25,_0x389fbe,_0x7abaa2,_0x2005b6,_0x31622b,_0x2005b6[_0x89d2('0x75')],_0x4ad915,'outbound');})['then'](function(_0x4ec4f1){_0x3d8df1=_0x4ec4f1;logger[_0x89d2('0x1e')](_0x89d2('0x76'),_0x3d8df1['id']);logger[_0x89d2('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3d8df1['id'],_0x4a5f38['name'],_0x10ec25[_0x89d2('0x3d')]);switch(_0x10ec25[_0x89d2('0x3d')]){case _0x89d2('0x66'):emit(util['format'](_0x89d2('0x67'),_0x4a5f38[_0x89d2('0x50')]),_0x89d2('0x68'),{'recordId':_0x3d8df1['id']});break;case _0x89d2('0x77'):emit(util[_0x89d2('0x43')]('user:%s',_0x4a5f38[_0x89d2('0x50')]),_0x89d2('0x69'),{'uri':util['format'](_0x89d2('0x6a'),_0x4ad915[_0x89d2('0x6b')],_0x3d8df1['id'])});break;default:logger[_0x89d2('0x6c')](_0x89d2('0x71'),_0x89d2('0x78'));}})[_0x89d2('0x6e')](function(_0x5ac0f6){logger['error'](_0x89d2('0x71'),_0x5ac0f6);});};exports['unmanaged']=function(_0xf652a3,_0xa2ac0f,_0x521a18,_0x160136,_0x298070,_0x418376){var _0x52afbf,_0x44a9d1,_0x31dacd,_0x200810;_0x418376[_0x89d2('0x5e')]=intUtil[_0x89d2('0x5f')](_0x418376[_0x89d2('0x5e')]);_0x418376[_0x89d2('0x56')]=intUtil['stripTrailingSlash'](_0x418376[_0x89d2('0x56')]);if(_0x298070&&_0x298070['monitor_format']){logger['info']('['+_0xa2ac0f[_0x89d2('0x79')]['toUpperCase']()+']',_0x89d2('0x72'));_0xa2ac0f[_0x89d2('0x62')]=util['format'](_0x89d2('0x73'),_0x418376[_0x89d2('0x5e')],_0xa2ac0f[_0x89d2('0x61')],md5(_0xa2ac0f[_0x89d2('0x61')]));}else{_0xa2ac0f[_0x89d2('0x62')]='';}return getConnection(_0x418376)[_0x89d2('0x25')](function(_0x5db30e){_0x200810=_0x5db30e;if(!_['isNil'](_0x160136)){return getUser(_0x418376,_0x160136[_0x89d2('0x50')],_0x200810);}else{return getUser(_0x418376,null,_0x200810);}})[_0x89d2('0x25')](function(_0x8b793c){_0x52afbf=_0x8b793c;return getEndUser(_0x418376,_0x521a18,_0xa2ac0f[_0x89d2('0x64')],_0xa2ac0f[_0x89d2('0x7a')],_0x200810);})[_0x89d2('0x25')](function(_0x1fc110){_0x44a9d1=_0x1fc110;return getTicket(_0x418376,_0x52afbf,_0x44a9d1,_0x521a18,_0xa2ac0f,_0x521a18['Fields'],_0x200810);})[_0x89d2('0x25')](function(_0x545e0e){_0x31dacd=_0x545e0e;logger[_0x89d2('0x1e')]('['+_0xa2ac0f[_0x89d2('0x79')][_0x89d2('0x7b')]()+_0x89d2('0x7c'),_0x31dacd['id']);logger[_0x89d2('0x1e')]('['+_0xa2ac0f[_0x89d2('0x79')][_0x89d2('0x7b')]()+_0x89d2('0x7d'),_0x418376['type']);})[_0x89d2('0x6e')](function(_0x5bab5e){logger['error']('['+_0xa2ac0f[_0x89d2('0x79')]['toUpperCase']()+']',_0x5bab5e);});}; \ 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 1fe4632..875d17f 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 _0xa39d=['label_entry','Incident','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','md5','ioredis','../../../../config/environment','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','length','active','sys_id','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','content','toString','string','idField','toLowerCase','variable','variableName','name','Variable',']\x20getTicket\x20input\x20crm','incident','assign','true','getString','Subjects','Fields','ticketId','label','?sysparm_query=name%3D','POST'];(function(_0x3d0502,_0x1f030f){var _0x4263c3=function(_0x8e5d57){while(--_0x8e5d57){_0x3d0502['push'](_0x3d0502['shift']());}};_0x4263c3(++_0x1f030f);}(_0xa39d,0x88));var _0xda39=function(_0x500bc2,_0x278c52){_0x500bc2=_0x500bc2-0x0;var _0xeb1575=_0xa39d[_0x500bc2];return _0xeb1575;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xda39('0x0'));var util=require('util');var md5=require(_0xda39('0x1'));var Redis=require(_0xda39('0x2'));var intUtil=require('./util');var config=require(_0xda39('0x3'));var logger=require('../../../../config/logger')('servicenow');config[_0xda39('0x4')]=_[_0xda39('0x5')](config[_0xda39('0x4')],{'host':_0xda39('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xda39('0x4')]));function getAdminUser(_0x222ff6,_0x1bd30e,_0x3d393b,_0x54936e,_0x4eb106,_0x2ea237){return new Promise(function(_0x4c7ff8,_0x502d67){var _0x1b4226={'method':_0xda39('0x7'),'uri':_0x54936e+_0xda39('0x8')+'&'+_0x4eb106+'&'+_0x2ea237,'auth':_0x1bd30e,'json':!![]};return rp(_0x1b4226)[_0xda39('0x9')](function(_0x536486){if(_0x536486[_0xda39('0xa')]['length']>0x0){_0x3d393b[_0xda39('0xb')]=_0x536486[_0xda39('0xa')][0x0]['sys_id'];}logger[_0xda39('0xc')]('['+[_0x222ff6[_0xda39('0xd')]()]+_0xda39('0xe'),_0x3d393b);_0x4c7ff8(_0x3d393b);})[_0xda39('0xf')](function(_0x1120f0){logger[_0xda39('0x10')]('['+[_0x222ff6[_0xda39('0xd')]()]+']',_0x1120f0[_0xda39('0x11')]);_0x502d67(_0x1120f0[_0xda39('0x11')]);});});}function getUser(_0xd0b541,_0x53db94,_0x4f9d26,_0x4d5f6a,_0x3a2f6e){return function(_0x43a6ae){logger[_0xda39('0xc')]('['+[_0xd0b541[_0xda39('0xd')]()]+'],\x20getUser\x20input\x20crm',_0x43a6ae);return new Promise(function(_0x11157e,_0x167b48){if(intUtil[_0xda39('0x12')](_0x43a6ae[_0xda39('0x13')])){var _0x49187b={'method':_0xda39('0x7'),'uri':_0x4f9d26+_0xda39('0x14')+_0x43a6ae[_0xda39('0x13')]+'&'+_0x4d5f6a+'&'+_0x3a2f6e,'auth':_0x53db94,'json':!![]};logger['info']('['+[_0xd0b541[_0xda39('0xd')]()]+'],\x20getUser\x20rp\x20obj',_0x49187b);return rp(_0x49187b)[_0xda39('0x9')](function(_0x2a7d66){logger[_0xda39('0xc')]('['+[_0xd0b541[_0xda39('0xd')]()]+_0xda39('0x15'),_0x2a7d66);if(_0x2a7d66[_0xda39('0xa')][_0xda39('0x16')]>0x0&&String(_0x2a7d66[_0xda39('0xa')][0x0][_0xda39('0x17')])==='true'){_0x43a6ae['userId']=_0x2a7d66[_0xda39('0xa')][0x0][_0xda39('0x18')];}else{_0x43a6ae[_0xda39('0x19')]=_0x43a6ae['adminId'];_0x43a6ae[_0xda39('0x13')]=_0x43a6ae[_0xda39('0x1a')];}logger[_0xda39('0xc')]('['+[_0xd0b541['toUpperCase']()]+_0xda39('0x1b'),_0x43a6ae);_0x11157e(_0x43a6ae);})[_0xda39('0xf')](function(_0xd0619c){logger[_0xda39('0x10')]('['+[_0xd0b541['toUpperCase']()]+']',_0xd0619c['message']);_0x167b48(_0xd0619c[_0xda39('0x11')]);});}else{logger['info']('['+[_0xd0b541[_0xda39('0xd')]()]+_0xda39('0x1c'));_0x43a6ae[_0xda39('0x19')]=_0x43a6ae[_0xda39('0xb')];_0x43a6ae[_0xda39('0x13')]=_0x43a6ae[_0xda39('0x1a')];_0x11157e(_0x43a6ae);}});};}function createEndUser(_0x2f1798,_0x5087b8,_0x562daf,_0x3384f6,_0x256611){logger[_0xda39('0xc')]('['+[_0x2f1798[_0xda39('0xd')]()]+_0xda39('0x1d'),_0x562daf);return new Promise(function(_0x3a8da9,_0x15d138){var _0x2108a9={'method':'POST','uri':_0x3384f6+'sys_user?'+_0x256611,'body':{'user_name':_0x562daf[_0xda39('0x1e')],'roles':_0xda39('0x1f'),'first_name':_0x562daf[_0xda39('0x1e')],'active':'true','date_format':'System','phone':_0x562daf[_0xda39('0x1e')]},'auth':_0x5087b8,'json':!![]};return rp(_0x2108a9)['then'](function(_0x47646f){logger[_0xda39('0xc')]('['+[_0x2f1798[_0xda39('0xd')]()]+_0xda39('0x20'),_0x47646f[_0xda39('0xa')]);_0x562daf[_0xda39('0x21')]=_0x47646f[_0xda39('0xa')][_0xda39('0x18')];_0x3a8da9(_0x562daf);})[_0xda39('0xf')](function(_0x57452b){logger['error']('['+[_0x2f1798['toUpperCase']()]+']',_0x57452b['message']);_0x15d138(_0x57452b['message']);});});}function getEndUser(_0xf70bf3,_0x3d74af,_0x2082e5,_0x544e55,_0x5c752e){return function(_0x35e1ef){logger['info']('['+[_0xf70bf3['toUpperCase']()]+_0xda39('0x22'),_0x35e1ef);return new Promise(function(_0x15c3c9,_0x57aaf1){var _0x34f5e3={'method':_0xda39('0x7'),'uri':_0x2082e5+_0xda39('0x23')+_0x35e1ef['endUserNumber']+'&'+_0x544e55+'&'+_0x5c752e,'auth':_0x3d74af,'json':!![]};return rp(_0x34f5e3)['then'](function(_0x280a0e){if(_0x280a0e['result']['length']>0x0){_0x35e1ef[_0xda39('0x21')]=_0x280a0e[_0xda39('0xa')][0x0][_0xda39('0x18')];logger['info']('['+[_0xf70bf3[_0xda39('0xd')]()]+_0xda39('0x24'),_0x35e1ef);_0x15c3c9(_0x35e1ef);}else{return createEndUser(_0xf70bf3,_0x3d74af,_0x35e1ef,_0x2082e5,_0x544e55)[_0xda39('0x9')](function(_0x11c5bf){logger[_0xda39('0xc')]('['+[_0xf70bf3[_0xda39('0xd')]()]+_0xda39('0x25'),_0x11c5bf);_0x15c3c9(_0x11c5bf);});}})[_0xda39('0xf')](function(_0x2bbe61){logger[_0xda39('0x10')]('['+[_0xf70bf3[_0xda39('0xd')]()]+']',_0x2bbe61[_0xda39('0x11')]);_0x57aaf1(_0x2bbe61[_0xda39('0x11')]);});});};}function getCustomFields(_0x4765f1,_0x1f9ebd){var _0x13cc00={};if(_0x4765f1[_0xda39('0x16')]>0x0){_[_0xda39('0x26')](_0x4765f1,function(_0x434710){if(_[_0xda39('0x27')](['string',_0xda39('0x28')],_0x434710[_0xda39('0x29')])&&_0x434710[_0xda39('0x2a')]&&!_0x434710[_0xda39('0x2b')]){_0x13cc00[_0x434710['nameField']['toLowerCase']()]=_0x434710[_0xda39('0x2c')][_0xda39('0x2d')]();}else if(_['includes']([_0xda39('0x2e'),'picklist'],_0x434710[_0xda39('0x29')])&&_0x434710[_0xda39('0x2f')]&&_0x434710['customField']){_0x13cc00[_0x434710[_0xda39('0x2f')][_0xda39('0x30')]()]=_0x434710[_0xda39('0x2c')][_0xda39('0x2d')]();}else if(_0x434710[_0xda39('0x29')]===_0xda39('0x31')&&_0x434710[_0xda39('0x32')]&&_0x434710[_0xda39('0x2f')]&&_0x434710['customField']){_0x13cc00[_0x434710[_0xda39('0x2f')][_0xda39('0x30')]()]=_0x1f9ebd[_0x434710['variableName']][_0xda39('0x2d')]();}else if(_0x434710[_0xda39('0x29')]==='customVariable'&&_0x434710['Variable']&&_0x434710['Variable'][_0xda39('0x33')]&&_0x434710[_0xda39('0x2f')]&&_0x434710[_0xda39('0x2b')]){_0x13cc00[_0x434710[_0xda39('0x2f')][_0xda39('0x30')]()]=_0x1f9ebd[_0x434710[_0xda39('0x34')][_0xda39('0x33')][_0xda39('0x30')]()][_0xda39('0x2d')]();}});}return _0x13cc00;}function getTicket(_0x29586b,_0x4f5a74,_0x186348,_0x2ea586,_0x56e916,_0x3dd021){return function(_0x24e4f1){logger['info']('['+[_0x29586b[_0xda39('0xd')]()]+_0xda39('0x35'),_0x24e4f1);return new Promise(function(_0x527bf0,_0x1a8437){var _0x1ed24d=_0x29586b[_0xda39('0x30')]()==='outbound'?_0x24e4f1['userId']:_0x24e4f1[_0xda39('0x21')];var _0x4ba1b4={'method':'POST','uri':_0x186348+_0xda39('0x36')+'?'+_0x3dd021,'body':Object[_0xda39('0x37')]({},{'active':_0xda39('0x38'),'caller_id':_0x1ed24d,'assigned_to':_0x24e4f1[_0xda39('0x19')],'short_description':intUtil[_0xda39('0x39')](_0x2ea586[_0xda39('0x3a')],_0x56e916,'\x20'),'description':intUtil[_0xda39('0x39')](_0x2ea586['Descriptions'],_0x56e916,'\x0a')},getCustomFields(_0x2ea586[_0xda39('0x3b')],_0x56e916)),'auth':_0x4f5a74,'json':!![]};return rp(_0x4ba1b4)[_0xda39('0x9')](function(_0xbdb354){logger[_0xda39('0xc')]('['+[_0x29586b[_0xda39('0xd')]()]+']\x20POST\x20incident\x20entity\x20schema',_0xbdb354['result']);_0x24e4f1[_0xda39('0x3c')]=_0xbdb354[_0xda39('0xa')][_0xda39('0x18')];_0x24e4f1['ticketNumber']=_0xbdb354[_0xda39('0xa')]['number'];logger[_0xda39('0xc')]('['+[_0x29586b[_0xda39('0xd')]()]+']\x20getTicket\x20crm',_0x24e4f1);_0x527bf0(_0x24e4f1);})['catch'](function(_0x1c4370){logger['error']('['+[_0x29586b['toUpperCase']()]+']',_0x1c4370[_0xda39('0x11')]);_0x1a8437(_0x1c4370[_0xda39('0x11')]);});});};}function createRemoteTag(_0x547435,_0x27785e,_0x537af4,_0x3b7261){return new Promise(function(_0x12607f,_0x230045){var _0xa5af1e={'method':'POST','uri':_0x537af4+_0xda39('0x3d')+'?'+_0x3b7261,'body':{'short_description':_0x547435,'global':!![],'active':!![],'name':_0x547435},'auth':_0x27785e,'json':!![]};return rp(_0xa5af1e)['then'](function(_0x473212){var _0x6b46f2=_0x473212[_0xda39('0xa')]['sys_id'];_0x12607f(_0x6b46f2);});});}function getRemoteTag(_0x29b356,_0x168dc0,_0x4d9edb,_0x4264db,_0x34a050){return new Promise(function(_0x19d9e1,_0x3adcde){var _0x47d7e9={'method':_0xda39('0x7'),'uri':_0x4d9edb+'label'+_0xda39('0x3e')+_0x29b356+'&'+_0x4264db,'auth':_0x168dc0,'json':!![]};return rp(_0x47d7e9)['then'](function(_0x1572b2){if(_0x1572b2[_0xda39('0xa')][_0xda39('0x16')]>0x0){var _0x10bd76=_0x1572b2[_0xda39('0xa')][0x0]['sys_id'];_0x19d9e1(_0x10bd76);}else{return createRemoteTag(_0x29b356,_0x168dc0,_0x4d9edb,_0x4264db)[_0xda39('0x9')](function(_0x240c39){_0x19d9e1(_0x240c39);});}});});}function assignTagToIncident(_0x1c4fd0,_0x23183c,_0x820b07,_0x4a0c51,_0x5239b8){return new Promise(function(_0x378aa4,_0x41c46b){var _0x3d702f={'method':_0xda39('0x3f'),'uri':_0x820b07+_0xda39('0x40')+'?'+_0x5239b8,'body':{'label':_0x1c4fd0,'table':_0xda39('0x36'),'id_type':_0xda39('0x41'),'table_key':_0x4a0c51[_0xda39('0x3c')],'title':_0xda39('0x42')+_0x4a0c51[_0xda39('0x43')],'id_display':_0x4a0c51[_0xda39('0x43')]},'auth':_0x23183c,'json':!![]};return rp(_0x3d702f)['then'](function(_0x40466d){_0x378aa4();})[_0xda39('0xf')](function(){_0x378aa4();});});}function manageTags(_0x350939,_0x24237a,_0x4c4ea8,_0x7321dd,_0x440e30,_0xd70641,_0x3c5952){return new Promise(function(_0x45fbf7,_0x49acce){var _0x4b92d2=[];_0x24237a['forEach'](function(_0x160811){_0x4b92d2[_0xda39('0x44')](getRemoteTag(_0x160811,_0x4c4ea8,_0x7321dd,_0xd70641,_0x3c5952));});return Promise['all'](_0x4b92d2)[_0xda39('0x9')](function(_0x4404a5){if(_0x4404a5[_0xda39('0x16')]){logger[_0xda39('0xc')]('['+[_0x350939[_0xda39('0xd')]()]+_0xda39('0x45'),_0x4404a5);var _0x17d778=[];_0x4404a5['forEach'](function(_0x372239){_0x17d778['push'](assignTagToIncident(_0x372239,_0x4c4ea8,_0x7321dd,_0x440e30,_0xd70641));});return Promise[_0xda39('0x46')](_0x17d778)[_0xda39('0x9')](function(){_0x45fbf7();})[_0xda39('0xf')](function(){_0x45fbf7();});}else{_0x45fbf7();}});});}function getTags(_0x32c104,_0x26166f,_0x2977df,_0x348d6c,_0xd5d38c,_0x3e85e4){return function(_0x38bd2d){return new Promise(function(_0x22c651,_0x70e6ee){var _0x45e491=[];var _0x2d8eef=_0x348d6c['Tags'];if(_0x2d8eef&&_0x2d8eef['length']>0x0){_0x45e491=_['map'](_0x2d8eef,_0xda39('0x33'));}if(_0x45e491[_0xda39('0x16')]>0x0){return manageTags(_0x32c104,_0x45e491,_0x26166f,_0x2977df,_0x38bd2d,_0xd5d38c,_0x3e85e4)[_0xda39('0x9')](function(){_0x22c651(_0x38bd2d);});}else{_0x22c651(_0x38bd2d);}});};}function emit(_0x945391,_0xf5fc,_0x32a99c){var _0x23a9bb='%26sysparm_record_target%3Dincident'+_0xda39('0x47')+_0xda39('0x48')+'%255EORDERBYDESCnumber';var _0x29b528={'uri':_0x945391+_0xda39('0x49')+_0x32a99c+_0x23a9bb};io['to'](util[_0xda39('0x4a')](_0xda39('0x4b'),_0xf5fc))['emit'](_0xda39('0x4c'),_0x29b528);}exports['cs']=function(_0x51a0f2,_0x58046f,_0xc8b8f0,_0x48fb54,_0x53a1ea,_0x5f074a,_0x33d143,_0x1492cb){var _0x1abacd={};var _0x293028={'user':_0x5f074a[_0xda39('0x4d')],'pass':_0x5f074a[_0xda39('0x4e')]};var _0x218bc2=_0xda39('0x4f');var _0x58437e='sysparm_display_value=true';_0x5f074a[_0xda39('0x50')]=intUtil['stripTrailingSlash'](_0x5f074a[_0xda39('0x50')]);_0x5f074a[_0xda39('0x51')]=intUtil[_0xda39('0x52')](_0x5f074a[_0xda39('0x51')]);var _0x3b4904=util['format'](_0xda39('0x53'),_0x5f074a[_0xda39('0x50')]);_0x1abacd[_0xda39('0x13')]=!_[_0xda39('0x54')](_0x48fb54)?_0x48fb54[_0xda39('0x55')]:null;_0x1abacd[_0xda39('0x1a')]=_0x5f074a[_0xda39('0x55')];_0x1abacd[_0xda39('0x1e')]=_0x1492cb[_0xda39('0x30')]()===_0xda39('0x56')?_0x58046f[_0xda39('0x57')]:_0x58046f[_0xda39('0x58')];_0x1abacd['callDirection']=_0x1492cb==='queue'||_0x1492cb===_0xda39('0x59')?'queue':_0xda39('0x56');var _0x36873c=util[_0xda39('0x4a')](_0xda39('0x5a'),_0x5f074a[_0xda39('0x51')],_0x58046f['uniqueid'],md5(_0x58046f[_0xda39('0x5b')]));if(_0x53a1ea&&_0x53a1ea[_0xda39('0x5c')]){logger['info'](_0xda39('0x5d'),_0xda39('0x5e'));_0x58046f[_0xda39('0x5f')]=_0x36873c;}else if(_0x33d143&&_0x33d143['recordingFormat']&&_0x33d143[_0xda39('0x60')]!==_0xda39('0x61')){logger[_0xda39('0xc')]('[OUTBOUND]',_0xda39('0x5e'));_0x58046f[_0xda39('0x5f')]=_0x36873c;}else{_0x58046f[_0xda39('0x5f')]='';}return getAdminUser(_0x1492cb,_0x293028,_0x1abacd,_0x3b4904,_0x58437e,_0x218bc2)[_0xda39('0x9')](getUser(_0x1492cb,_0x293028,_0x3b4904,_0x58437e,_0x218bc2))[_0xda39('0x9')](getEndUser(_0x1492cb,_0x293028,_0x3b4904,_0x58437e,_0x218bc2))[_0xda39('0x9')](getTicket(_0x1492cb,_0x293028,_0x3b4904,_0xc8b8f0,_0x58046f,_0x58437e))[_0xda39('0x9')](function(_0x30a1b7){logger[_0xda39('0xc')](util[_0xda39('0x4a')]('The\x20ticket\x20ID\x20is:\x20%s',_0x30a1b7[_0xda39('0x3c')]));logger[_0xda39('0xc')](util[_0xda39('0x4a')](_0xda39('0x62'),_0x1492cb));if(_0x1492cb!==_0xda39('0x59')){logger[_0xda39('0xc')]('['+[_0x1492cb[_0xda39('0xd')]()]+']',_0xda39('0x63'));emit(_0x5f074a[_0xda39('0x50')],_0x48fb54['name'],_0x30a1b7[_0xda39('0x3c')]);}})[_0xda39('0xf')](function(_0x5bb463){logger['error']('['+[_0x1492cb[_0xda39('0xd')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x5bb463,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfefd=['sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','length','active','true','userId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','content','toString','picklist','toLowerCase','variable','variableName','idField','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Fields','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password'];(function(_0xf0711c,_0x1094af){var _0x1899ac=function(_0x8ab1c9){while(--_0x8ab1c9){_0xf0711c['push'](_0xf0711c['shift']());}};_0x1899ac(++_0x1094af);}(_0xfefd,0x162));var _0xdfef=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0xfefd[_0x334d1e];return _0x3b33ba;};'use strict';var _=require(_0xdfef('0x0'));var Promise=require(_0xdfef('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0xdfef('0x2'));var Redis=require(_0xdfef('0x3'));var intUtil=require(_0xdfef('0x4'));var config=require(_0xdfef('0x5'));var logger=require(_0xdfef('0x6'))(_0xdfef('0x7'));config['redis']=_[_0xdfef('0x8')](config[_0xdfef('0x9')],{'host':_0xdfef('0xa'),'port':0x18eb});var io=require(_0xdfef('0xb'))(new Redis(config[_0xdfef('0x9')]));function getAdminUser(_0x50ea2a,_0x61b3a6,_0x578753,_0x454984,_0x23f5a1,_0x3fed67){return new Promise(function(_0x21a3b8,_0x504567){var _0x2126b2={'method':_0xdfef('0xc'),'uri':_0x454984+_0xdfef('0xd')+'&'+_0x23f5a1+'&'+_0x3fed67,'auth':_0x61b3a6,'json':!![]};return rp(_0x2126b2)[_0xdfef('0xe')](function(_0x4d523a){if(_0x4d523a[_0xdfef('0xf')]['length']>0x0){_0x578753[_0xdfef('0x10')]=_0x4d523a[_0xdfef('0xf')][0x0][_0xdfef('0x11')];}logger[_0xdfef('0x12')]('['+[_0x50ea2a[_0xdfef('0x13')]()]+_0xdfef('0x14'),_0x578753);_0x21a3b8(_0x578753);})['catch'](function(_0x220a27){logger['error']('['+[_0x50ea2a['toUpperCase']()]+']',_0x220a27[_0xdfef('0x15')]);_0x504567(_0x220a27[_0xdfef('0x15')]);});});}function getUser(_0x2cb887,_0x2ac21c,_0x2e26f0,_0xdd7415,_0xbacd90){return function(_0x656956){logger[_0xdfef('0x12')]('['+[_0x2cb887[_0xdfef('0x13')]()]+_0xdfef('0x16'),_0x656956);return new Promise(function(_0x269bd2,_0x3bf81f){if(intUtil['validateEmail'](_0x656956['userEmail'])){var _0x24609a={'method':'GET','uri':_0x2e26f0+_0xdfef('0x17')+_0x656956[_0xdfef('0x18')]+'&'+_0xdd7415+'&'+_0xbacd90,'auth':_0x2ac21c,'json':!![]};logger[_0xdfef('0x12')]('['+[_0x2cb887[_0xdfef('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x24609a);return rp(_0x24609a)[_0xdfef('0xe')](function(_0x32ab11){logger['info']('['+[_0x2cb887[_0xdfef('0x13')]()]+_0xdfef('0x19'),_0x32ab11);if(_0x32ab11['result'][_0xdfef('0x1a')]>0x0&&String(_0x32ab11[_0xdfef('0xf')][0x0][_0xdfef('0x1b')])===_0xdfef('0x1c')){_0x656956['userId']=_0x32ab11[_0xdfef('0xf')][0x0]['sys_id'];}else{_0x656956[_0xdfef('0x1d')]=_0x656956[_0xdfef('0x10')];_0x656956[_0xdfef('0x18')]=_0x656956[_0xdfef('0x1e')];}logger['info']('['+[_0x2cb887[_0xdfef('0x13')]()]+'],\x20getUser\x20crm',_0x656956);_0x269bd2(_0x656956);})['catch'](function(_0x40d613){logger[_0xdfef('0x1f')]('['+[_0x2cb887[_0xdfef('0x13')]()]+']',_0x40d613[_0xdfef('0x15')]);_0x3bf81f(_0x40d613['message']);});}else{logger[_0xdfef('0x12')]('['+[_0x2cb887[_0xdfef('0x13')]()]+_0xdfef('0x20'));_0x656956[_0xdfef('0x1d')]=_0x656956[_0xdfef('0x10')];_0x656956[_0xdfef('0x18')]=_0x656956['adminEmail'];_0x269bd2(_0x656956);}});};}function createEndUser(_0x3caa29,_0x5c8735,_0x13baa6,_0x2eb394,_0x107d4d){logger[_0xdfef('0x12')]('['+[_0x3caa29[_0xdfef('0x13')]()]+_0xdfef('0x21'),_0x13baa6);return new Promise(function(_0x2e458c,_0x17c44c){var _0xe53115={'method':'POST','uri':_0x2eb394+_0xdfef('0x22')+_0x107d4d,'body':{'user_name':_0x13baa6[_0xdfef('0x23')],'roles':_0xdfef('0x24'),'first_name':_0x13baa6['endUserNumber'],'active':_0xdfef('0x1c'),'date_format':'System','phone':_0x13baa6['endUserNumber']},'auth':_0x5c8735,'json':!![]};return rp(_0xe53115)['then'](function(_0x3cfe41){logger[_0xdfef('0x12')]('['+[_0x3caa29[_0xdfef('0x13')]()]+_0xdfef('0x25'),_0x3cfe41[_0xdfef('0xf')]);_0x13baa6[_0xdfef('0x26')]=_0x3cfe41[_0xdfef('0xf')][_0xdfef('0x11')];_0x2e458c(_0x13baa6);})[_0xdfef('0x27')](function(_0x4d75a3){logger[_0xdfef('0x1f')]('['+[_0x3caa29[_0xdfef('0x13')]()]+']',_0x4d75a3['message']);_0x17c44c(_0x4d75a3[_0xdfef('0x15')]);});});}function getEndUser(_0x1de4f7,_0x353070,_0x3eb8b6,_0x150b5e,_0x5968c4){return function(_0x16e69d){logger[_0xdfef('0x12')]('['+[_0x1de4f7[_0xdfef('0x13')]()]+_0xdfef('0x28'),_0x16e69d);return new Promise(function(_0x55886c,_0x5b1d6f){var _0x2d96ec={'method':_0xdfef('0xc'),'uri':_0x3eb8b6+_0xdfef('0x29')+_0x16e69d['endUserNumber']+'&'+_0x150b5e+'&'+_0x5968c4,'auth':_0x353070,'json':!![]};return rp(_0x2d96ec)[_0xdfef('0xe')](function(_0x1e5e95){if(_0x1e5e95[_0xdfef('0xf')][_0xdfef('0x1a')]>0x0){_0x16e69d[_0xdfef('0x26')]=_0x1e5e95['result'][0x0][_0xdfef('0x11')];logger['info']('['+[_0x1de4f7[_0xdfef('0x13')]()]+_0xdfef('0x2a'),_0x16e69d);_0x55886c(_0x16e69d);}else{return createEndUser(_0x1de4f7,_0x353070,_0x16e69d,_0x3eb8b6,_0x150b5e)[_0xdfef('0xe')](function(_0x2d5a85){logger[_0xdfef('0x12')]('['+[_0x1de4f7[_0xdfef('0x13')]()]+_0xdfef('0x2b'),_0x2d5a85);_0x55886c(_0x2d5a85);});}})[_0xdfef('0x27')](function(_0x1d6888){logger[_0xdfef('0x1f')]('['+[_0x1de4f7[_0xdfef('0x13')]()]+']',_0x1d6888[_0xdfef('0x15')]);_0x5b1d6f(_0x1d6888['message']);});});};}function getCustomFields(_0x33de37,_0x3761ca){var _0x109c63={};if(_0x33de37[_0xdfef('0x1a')]>0x0){_[_0xdfef('0x2c')](_0x33de37,function(_0x45c8ea){if(_[_0xdfef('0x2d')]([_0xdfef('0x2e'),'picklist'],_0x45c8ea[_0xdfef('0x2f')])&&_0x45c8ea[_0xdfef('0x30')]&&!_0x45c8ea[_0xdfef('0x31')]){_0x109c63[_0x45c8ea[_0xdfef('0x30')]['toLowerCase']()]=_0x45c8ea[_0xdfef('0x32')][_0xdfef('0x33')]();}else if(_['includes']([_0xdfef('0x2e'),_0xdfef('0x34')],_0x45c8ea[_0xdfef('0x2f')])&&_0x45c8ea['idField']&&_0x45c8ea[_0xdfef('0x31')]){_0x109c63[_0x45c8ea['idField'][_0xdfef('0x35')]()]=_0x45c8ea[_0xdfef('0x32')][_0xdfef('0x33')]();}else if(_0x45c8ea[_0xdfef('0x2f')]===_0xdfef('0x36')&&_0x45c8ea[_0xdfef('0x37')]&&_0x45c8ea[_0xdfef('0x38')]&&_0x45c8ea['customField']){_0x109c63[_0x45c8ea[_0xdfef('0x38')]['toLowerCase']()]=_0x3761ca[_0x45c8ea[_0xdfef('0x37')]]['toString']();}else if(_0x45c8ea['type']===_0xdfef('0x39')&&_0x45c8ea[_0xdfef('0x3a')]&&_0x45c8ea[_0xdfef('0x3a')][_0xdfef('0x3b')]&&_0x45c8ea[_0xdfef('0x38')]&&_0x45c8ea[_0xdfef('0x31')]){_0x109c63[_0x45c8ea['idField'][_0xdfef('0x35')]()]=_0x3761ca[_0x45c8ea[_0xdfef('0x3a')][_0xdfef('0x3b')][_0xdfef('0x35')]()][_0xdfef('0x33')]();}});}return _0x109c63;}function getTicket(_0x5a8bee,_0x29e0fa,_0x52f506,_0x3996b9,_0x453bfa,_0x3bf909){return function(_0x58d1c8){logger[_0xdfef('0x12')]('['+[_0x5a8bee[_0xdfef('0x13')]()]+_0xdfef('0x3c'),_0x58d1c8);return new Promise(function(_0x37eb8f,_0x268520){var _0x5af73a=_0x5a8bee[_0xdfef('0x35')]()===_0xdfef('0x3d')?_0x58d1c8[_0xdfef('0x1d')]:_0x58d1c8[_0xdfef('0x26')];var _0x5e3c11={'method':_0xdfef('0x3e'),'uri':_0x52f506+_0xdfef('0x3f')+'?'+_0x3bf909,'body':Object[_0xdfef('0x40')]({},{'active':_0xdfef('0x1c'),'caller_id':_0x5af73a,'assigned_to':_0x58d1c8[_0xdfef('0x1d')],'short_description':intUtil[_0xdfef('0x41')](_0x3996b9[_0xdfef('0x42')],_0x453bfa,'\x20'),'description':intUtil[_0xdfef('0x41')](_0x3996b9['Descriptions'],_0x453bfa,'\x0a')},getCustomFields(_0x3996b9[_0xdfef('0x43')],_0x453bfa)),'auth':_0x29e0fa,'json':!![]};return rp(_0x5e3c11)['then'](function(_0x1fe267){logger[_0xdfef('0x12')]('['+[_0x5a8bee['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x1fe267[_0xdfef('0xf')]);_0x58d1c8[_0xdfef('0x44')]=_0x1fe267[_0xdfef('0xf')]['sys_id'];_0x58d1c8[_0xdfef('0x45')]=_0x1fe267[_0xdfef('0xf')]['number'];logger[_0xdfef('0x12')]('['+[_0x5a8bee['toUpperCase']()]+_0xdfef('0x46'),_0x58d1c8);_0x37eb8f(_0x58d1c8);})[_0xdfef('0x27')](function(_0x1ce0d8){logger[_0xdfef('0x1f')]('['+[_0x5a8bee['toUpperCase']()]+']',_0x1ce0d8['message']);_0x268520(_0x1ce0d8['message']);});});};}function createRemoteTag(_0x251e0a,_0x3bddce,_0x23a81c,_0x360973){return new Promise(function(_0x57e245,_0x54cf06){var _0x5a10a1={'method':_0xdfef('0x3e'),'uri':_0x23a81c+'label'+'?'+_0x360973,'body':{'short_description':_0x251e0a,'global':!![],'active':!![],'name':_0x251e0a},'auth':_0x3bddce,'json':!![]};return rp(_0x5a10a1)[_0xdfef('0xe')](function(_0x4d3e84){var _0x3f0972=_0x4d3e84['result'][_0xdfef('0x11')];_0x57e245(_0x3f0972);});});}function getRemoteTag(_0x3dc7a8,_0x259b21,_0x751c3f,_0x3dd6d3,_0x2e2095){return new Promise(function(_0x35f431,_0x235c9f){var _0x58b60b={'method':_0xdfef('0xc'),'uri':_0x751c3f+_0xdfef('0x47')+_0xdfef('0x48')+_0x3dc7a8+'&'+_0x3dd6d3,'auth':_0x259b21,'json':!![]};return rp(_0x58b60b)[_0xdfef('0xe')](function(_0x3c5b90){if(_0x3c5b90['result']['length']>0x0){var _0x15e703=_0x3c5b90[_0xdfef('0xf')][0x0]['sys_id'];_0x35f431(_0x15e703);}else{return createRemoteTag(_0x3dc7a8,_0x259b21,_0x751c3f,_0x3dd6d3)[_0xdfef('0xe')](function(_0x27b29a){_0x35f431(_0x27b29a);});}});});}function assignTagToIncident(_0x1b51d6,_0x4774c5,_0x47275e,_0x2344d7,_0x3b44cb){return new Promise(function(_0x1128b4,_0x1d99b4){var _0x1abb96={'method':'POST','uri':_0x47275e+'label_entry'+'?'+_0x3b44cb,'body':{'label':_0x1b51d6,'table':_0xdfef('0x3f'),'id_type':_0xdfef('0x49'),'table_key':_0x2344d7[_0xdfef('0x44')],'title':_0xdfef('0x4a')+_0x2344d7[_0xdfef('0x45')],'id_display':_0x2344d7[_0xdfef('0x45')]},'auth':_0x4774c5,'json':!![]};return rp(_0x1abb96)[_0xdfef('0xe')](function(_0x26709c){_0x1128b4();})[_0xdfef('0x27')](function(){_0x1128b4();});});}function manageTags(_0x101d38,_0x4d9798,_0x479706,_0x44c786,_0x40117d,_0x205ece,_0x4fdb5d){return new Promise(function(_0x16e3ad,_0x40f9cc){var _0x5df611=[];_0x4d9798[_0xdfef('0x2c')](function(_0x1e216f){_0x5df611[_0xdfef('0x4b')](getRemoteTag(_0x1e216f,_0x479706,_0x44c786,_0x205ece,_0x4fdb5d));});return Promise[_0xdfef('0x4c')](_0x5df611)[_0xdfef('0xe')](function(_0x3a5ab4){if(_0x3a5ab4[_0xdfef('0x1a')]){logger[_0xdfef('0x12')]('['+[_0x101d38[_0xdfef('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3a5ab4);var _0x5a4b4c=[];_0x3a5ab4[_0xdfef('0x2c')](function(_0x54e86b){_0x5a4b4c[_0xdfef('0x4b')](assignTagToIncident(_0x54e86b,_0x479706,_0x44c786,_0x40117d,_0x205ece));});return Promise[_0xdfef('0x4c')](_0x5a4b4c)[_0xdfef('0xe')](function(){_0x16e3ad();})['catch'](function(){_0x16e3ad();});}else{_0x16e3ad();}});});}function getTags(_0x537c4a,_0x51a0a0,_0x18a53a,_0xf5fb06,_0x18f100,_0x4a780c){return function(_0x45657e){return new Promise(function(_0x49f244,_0x4f7357){var _0x2da503=[];var _0xc2a049=_0xf5fb06[_0xdfef('0x4d')];if(_0xc2a049&&_0xc2a049[_0xdfef('0x1a')]>0x0){_0x2da503=_[_0xdfef('0x4e')](_0xc2a049,'name');}if(_0x2da503[_0xdfef('0x1a')]>0x0){return manageTags(_0x537c4a,_0x2da503,_0x51a0a0,_0x18a53a,_0x45657e,_0x18f100,_0x4a780c)['then'](function(){_0x49f244(_0x45657e);});}else{_0x49f244(_0x45657e);}});};}function emit(_0x80c0d4,_0x1a2c9d,_0x50d568){var _0x58b4c5='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xdfef('0x4f')+_0xdfef('0x50');var _0x37eeec={'uri':_0x80c0d4+_0xdfef('0x51')+_0x50d568+_0x58b4c5};io['to'](util[_0xdfef('0x52')]('user:%s',_0x1a2c9d))[_0xdfef('0x53')]('trigger:browser:url',_0x37eeec);}exports['cs']=function(_0x15587d,_0x422fff,_0x12dc87,_0x80b317,_0x1fbe4f,_0x2f48de,_0x33356b,_0x1ae861){var _0x354196={};var _0x4051a6={'user':_0x2f48de[_0xdfef('0x54')],'pass':_0x2f48de[_0xdfef('0x55')]};var _0x4ac276=_0xdfef('0x56');var _0x299b43=_0xdfef('0x57');_0x2f48de[_0xdfef('0x58')]=intUtil[_0xdfef('0x59')](_0x2f48de['remoteUri']);_0x2f48de['serverUrl']=intUtil[_0xdfef('0x59')](_0x2f48de[_0xdfef('0x5a')]);var _0x214745=util[_0xdfef('0x52')](_0xdfef('0x5b'),_0x2f48de[_0xdfef('0x58')]);_0x354196['userEmail']=!_[_0xdfef('0x5c')](_0x80b317)?_0x80b317['email']:null;_0x354196['adminEmail']=_0x2f48de[_0xdfef('0x5d')];_0x354196[_0xdfef('0x23')]=_0x1ae861[_0xdfef('0x35')]()===_0xdfef('0x3d')?_0x422fff[_0xdfef('0x5e')]:_0x422fff[_0xdfef('0x5f')];_0x354196['callDirection']=_0x1ae861===_0xdfef('0x60')||_0x1ae861===_0xdfef('0x61')?_0xdfef('0x60'):_0xdfef('0x3d');var _0x13d382=util[_0xdfef('0x52')](_0xdfef('0x62'),_0x2f48de['serverUrl'],_0x422fff[_0xdfef('0x63')],md5(_0x422fff[_0xdfef('0x63')]));if(_0x1fbe4f&&_0x1fbe4f[_0xdfef('0x64')]){logger[_0xdfef('0x12')](_0xdfef('0x65'),_0xdfef('0x66'));_0x422fff[_0xdfef('0x67')]=_0x13d382;}else if(_0x33356b&&_0x33356b[_0xdfef('0x68')]&&_0x33356b['recordingFormat']!==_0xdfef('0x69')){logger[_0xdfef('0x12')](_0xdfef('0x6a'),'Recording\x20is\x20enabled!');_0x422fff[_0xdfef('0x67')]=_0x13d382;}else{_0x422fff[_0xdfef('0x67')]='';}return getAdminUser(_0x1ae861,_0x4051a6,_0x354196,_0x214745,_0x299b43,_0x4ac276)[_0xdfef('0xe')](getUser(_0x1ae861,_0x4051a6,_0x214745,_0x299b43,_0x4ac276))['then'](getEndUser(_0x1ae861,_0x4051a6,_0x214745,_0x299b43,_0x4ac276))[_0xdfef('0xe')](getTicket(_0x1ae861,_0x4051a6,_0x214745,_0x12dc87,_0x422fff,_0x299b43))['then'](function(_0x1919c6){logger[_0xdfef('0x12')](util[_0xdfef('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1919c6['ticketId']));logger[_0xdfef('0x12')](util[_0xdfef('0x52')](_0xdfef('0x6b'),_0x1ae861));if(_0x1ae861!==_0xdfef('0x61')){logger[_0xdfef('0x12')]('['+[_0x1ae861[_0xdfef('0x13')]()]+']',_0xdfef('0x6c'));emit(_0x2f48de[_0xdfef('0x58')],_0x80b317['name'],_0x1919c6[_0xdfef('0x44')]);}})[_0xdfef('0x27')](function(_0x25f533){logger[_0xdfef('0x1f')]('['+[_0x1ae861['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xdfef('0x6d')](_0x25f533,{'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 e0319b8..4e6b414 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 _0x2027=['resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','idField','push','content','custom_fields','customVariable','Variable','POST','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','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','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','trigger:browser:url','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','unmanaged','lastevent','toUpperCase','calleridname','catch','lodash','request-promise','bluebird','ioredis','./util','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','description','Descriptions','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','set_entry','JSON','Calls','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','entry_list','find','name_value_list','user_name','value','Agent\x20found!'];(function(_0x4d9935,_0x425350){var _0x2d05a3=function(_0x530764){while(--_0x530764){_0x4d9935['push'](_0x4d9935['shift']());}};_0x2d05a3(++_0x425350);}(_0x2027,0x13c));var _0x7202=function(_0x5c26e9,_0x29fffa){_0x5c26e9=_0x5c26e9-0x0;var _0x22373e=_0x2027[_0x5c26e9];return _0x22373e;};'use strict';var _=require(_0x7202('0x0'));var rp=require(_0x7202('0x1'));var BPromise=require(_0x7202('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x7202('0x3'));var intUtil=require(_0x7202('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0x7202('0x5')]=_[_0x7202('0x6')](config[_0x7202('0x5')],{'host':_0x7202('0x7'),'port':0x18eb});var io=require(_0x7202('0x8'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x43819d,_0xec471b,_0x1a1d7a){io['to'](_0x43819d)['emit'](_0xec471b,_0x1a1d7a);}function getTicket(_0x2473cb,_0x1ab11c,_0x5beab6,_0x1df55b,_0xef104,_0x3cd25a,_0x5a23de,_0x38b388){logger[_0x7202('0x9')](_0x7202('0xa'));var _0x2027ea=new Date();var _0x4cf357=[{'name':'name','value':intUtil[_0x7202('0xb')](_0x1df55b[_0x7202('0xc')],_0xef104,'\x20')},{'name':'assigned_user_id','value':_0x1ab11c['id']},{'name':_0x7202('0xd'),'value':_0x1ab11c['id']},{'name':_0x7202('0xe'),'value':intUtil['getString'](_0x1df55b[_0x7202('0xf')],_0xef104,'\x0a')},{'name':'date_start','value':_0x2027ea['toISOString']()['slice'](0x0,0x13)[_0x7202('0x10')]('T','\x20')},{'name':_0x7202('0x11'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x7202('0x12'),'value':_0x5beab6['id']},{'name':_0x7202('0x13'),'value':_0x7202('0x14')},{'name':_0x7202('0x15'),'value':_0x5beab6[_0x7202('0x16')]},{'name':_0x7202('0x17'),'value':_0x38b388}];if(_0x3cd25a[_0x7202('0x18')]){_[_0x7202('0x19')](_0x3cd25a,function(_0x24c09b){if(_0xef104[_0x24c09b[_0x7202('0x1a')]]){_0x4cf357['push']({'name':_0x24c09b['idField'],'value':_0xef104[_0x24c09b[_0x7202('0x1a')]]});}});}return request({'form':{'method':_0x7202('0x1b'),'input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON['stringify']({'session':_0x5a23de['id'],'module_name':_0x7202('0x1d'),'name_value_list':_0x4cf357})}});}function getAuth(_0xa2966c){return util[_0x7202('0x1e')](_0x7202('0x1f'),new Buffer(_0xa2966c[_0x7202('0x20')]+':X')[_0x7202('0x21')](_0x7202('0x22')));}function getServerInfo(_0x1bd87b){return request({'form':{'method':_0x7202('0x23'),'input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON[_0x7202('0x24')]({'session':_0x1bd87b['id']})}});}function getUser(_0x1541fa,_0x55f1ca,_0x2f2e6a){if(!_[_0x7202('0x25')](_0x55f1ca)){logger[_0x7202('0x9')]('Getting\x20agent\x20with\x20name',_0x55f1ca);return request({'form':{'method':_0x7202('0x26'),'input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON[_0x7202('0x24')]({'session':_0x2f2e6a['id'],'module_name':_0x7202('0x27'),'query':util[_0x7202('0x1e')](_0x7202('0x28'),_0x55f1ca),'order_by':'','offset':'0','select_fields':['id',_0x7202('0x16'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3f2c4e){if(_0x3f2c4e[_0x7202('0x29')][_0x7202('0x18')]){var _0x2e6875=_[_0x7202('0x2a')](_0x3f2c4e[_0x7202('0x29')],function(_0x16390a){return _0x16390a[_0x7202('0x2b')][_0x7202('0x2c')][_0x7202('0x2d')]===_0x55f1ca;});if(_0x2e6875){logger[_0x7202('0x9')](_0x7202('0x2e'));return BPromise[_0x7202('0x2f')]({'id':_0x2e6875['name_value_list']['id'][_0x7202('0x2d')],'name':_0x2e6875[_0x7202('0x2b')][_0x7202('0x16')][_0x7202('0x2d')]});}}logger['info'](_0x7202('0x30'));return BPromise[_0x7202('0x2f')]({'id':_0x2f2e6a[_0x7202('0x2b')][_0x7202('0x31')]['value'],'name':_0x2f2e6a[_0x7202('0x2b')][_0x7202('0x2c')][_0x7202('0x2d')]});});}else{logger[_0x7202('0x9')](_0x7202('0x32'));return BPromise[_0x7202('0x2f')]({'id':_0x2f2e6a[_0x7202('0x2b')][_0x7202('0x31')]['value'],'name':_0x2f2e6a['name_value_list'][_0x7202('0x2c')][_0x7202('0x2d')]});}}function getEndUser(_0x2be719,_0x4faaee,_0x1358a2,_0x19a761){logger[_0x7202('0x9')](_0x7202('0x33'),_0x1358a2);return request({'form':{'method':_0x7202('0x26'),'input_type':'JSON','response_type':_0x7202('0x1c'),'rest_data':JSON[_0x7202('0x24')]({'session':_0x19a761['id'],'module_name':_0x7202('0x14'),'query':util[_0x7202('0x1e')](_0x7202('0x34'),_0x1358a2),'order_by':'','offset':'0','select_fields':['id',_0x7202('0x16'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x8ab59f){if(_0x8ab59f[_0x7202('0x29')]['length']){var _0x29eac1=_[_0x7202('0x2a')](_0x8ab59f[_0x7202('0x29')],function(_0x25a22f){return _0x25a22f[_0x7202('0x2b')][_0x7202('0x35')][_0x7202('0x2d')]===_0x1358a2;});if(_0x29eac1){logger[_0x7202('0x9')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x29eac1[_0x7202('0x2b')]['id'][_0x7202('0x2d')],'name':_0x29eac1[_0x7202('0x2b')][_0x7202('0x16')][_0x7202('0x2d')],'phone':_0x29eac1[_0x7202('0x2b')][_0x7202('0x35')][_0x7202('0x2d')]});}}else{logger[_0x7202('0x9')](_0x7202('0x36'));return request({'form':{'method':_0x7202('0x1b'),'input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON[_0x7202('0x24')]({'session':_0x19a761['id'],'module_name':_0x7202('0x14'),'name_value_list':[{'name':_0x7202('0x37'),'value':_0x4faaee!==_0x7202('0x38')?_0x4faaee:util[_0x7202('0x1e')](_0x7202('0x39'),_0x1358a2)},{'name':_0x7202('0x35'),'value':_0x1358a2}]})}})[_0x7202('0x3a')](function(_0x124484){logger['info'](_0x7202('0x3b'));return BPromise[_0x7202('0x2f')]({'id':_0x124484['id'],'name':_0x124484[_0x7202('0x29')][_0x7202('0x37')][_0x7202('0x2d')],'phone':_0x124484['entry_list']['phone_home'][_0x7202('0x2d')]});});}});}function request(_0x4e9828){logger[_0x7202('0x3c')](_0x7202('0x3d'),JSON['stringify'](_0x4e9828));return rp(_[_0x7202('0x3e')](def,_0x4e9828));}function getTags(_0x5b6314,_0x2ba3e3){var _0x57bb53=[];if(_0x5b6314&&_0x5b6314[_0x7202('0x18')]>0x0){_0x57bb53=_[_0x7202('0x3f')](_0x5b6314,_0x2ba3e3);}return _0x57bb53;}function getCustomFields(_0xe11c02,_0x476667){var _0x59232e=[];var _0x4ae6a6={'custom_fields':[]};if(_0xe11c02[_0x7202('0x18')]>0x0){_[_0x7202('0x19')](_0xe11c02,function(_0x48d0d7){if(_0x48d0d7[_0x7202('0x40')]===_0x7202('0x41')&&_0x48d0d7[_0x7202('0x42')]&&!_0x48d0d7[_0x7202('0x43')]){_0x4ae6a6[_0x48d0d7[_0x7202('0x42')][_0x7202('0x44')]()]=_0x48d0d7['content']['toString']();}else if(_0x48d0d7[_0x7202('0x40')]===_0x7202('0x41')&&_0x48d0d7[_0x7202('0x45')]&&_0x48d0d7[_0x7202('0x43')]){_0x4ae6a6['custom_fields'][_0x7202('0x46')]({'id':_0x48d0d7[_0x7202('0x45')],'value':_0x48d0d7[_0x7202('0x47')][_0x7202('0x21')]()});}else if(_0x48d0d7[_0x7202('0x40')]==='variable'&&_0x48d0d7[_0x7202('0x1a')]&&_0x48d0d7[_0x7202('0x45')]&&_0x48d0d7[_0x7202('0x43')]){_0x476667[_0x48d0d7[_0x7202('0x1a')]]&&_0x4ae6a6[_0x7202('0x48')][_0x7202('0x46')]({'id':_0x48d0d7[_0x7202('0x45')],'value':_0x476667[_0x48d0d7[_0x7202('0x1a')]][_0x7202('0x21')]()});}else if(_0x48d0d7[_0x7202('0x40')]===_0x7202('0x49')&&_0x48d0d7[_0x7202('0x4a')]&&_0x48d0d7[_0x7202('0x4a')]['name']&&_0x48d0d7[_0x7202('0x45')]&&_0x48d0d7[_0x7202('0x43')]){_0x476667[_0x48d0d7[_0x7202('0x4a')][_0x7202('0x16')]['toLowerCase']()]&&_0x4ae6a6['custom_fields']['push']({'id':_0x48d0d7[_0x7202('0x45')],'value':_0x476667[_0x48d0d7['Variable'][_0x7202('0x16')]['toLowerCase']()]['toString']()});}});}return _0x4ae6a6;}function getConnection(_0x9c4976){return request({'method':_0x7202('0x4b'),'form':{'method':_0x7202('0x4c'),'input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x9c4976['username'],'password':_0x9c4976[_0x7202('0x4d')],'encryption':_0x7202('0x4e')},'application':_0x7202('0x4f')})}})[_0x7202('0x3a')](function(_0x5a59d7){var _0x3642ff=_0x5a59d7;if(_0x3642ff['id']){def[_0x7202('0x50')]=_0x3642ff['id'];return BPromise[_0x7202('0x2f')](_0x3642ff);}else{throw new Error(util[_0x7202('0x1e')](_0x7202('0x51'),_0x9c4976['id']));}});}function setRelationship(_0x1526a8,_0x30b7a9,_0x40971f,_0x5a9a40){return request({'form':{'method':'set_relationship','input_type':_0x7202('0x1c'),'response_type':_0x7202('0x1c'),'rest_data':JSON[_0x7202('0x24')]({'session':_0x1526a8['id'],'module_name':'Calls','module_id':_0x40971f['id'],'link_field_name':_0x5a9a40,'related_ids':[_0x30b7a9['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7202('0x52')]=function(_0x135586,_0x5cf095,_0x1ecabd,_0x337cf4,_0x3d3e72,_0x12bb05){var _0x3183ef,_0x1fdab4,_0x3535fe,_0x47bb09;_0x12bb05[_0x7202('0x53')]=intUtil[_0x7202('0x54')](_0x12bb05['remoteUri']);_0x12bb05[_0x7202('0x55')]=intUtil[_0x7202('0x54')](_0x12bb05[_0x7202('0x55')]);def[_0x7202('0x56')]=util[_0x7202('0x1e')](_0x7202('0x57'),_0x12bb05[_0x7202('0x53')]);if(_0x3d3e72&&_0x3d3e72[_0x7202('0x58')]){logger[_0x7202('0x9')]('[QUEUE]',_0x7202('0x59'));_0x5cf095[_0x7202('0x5a')]=util[_0x7202('0x1e')](_0x7202('0x5b'),_0x12bb05[_0x7202('0x55')],_0x5cf095[_0x7202('0x5c')],md5(_0x5cf095[_0x7202('0x5c')]));}else{_0x5cf095[_0x7202('0x5a')]='';}return getConnection(_0x12bb05)[_0x7202('0x3a')](function(_0x28dd3a){_0x47bb09=_0x28dd3a;return getUser(_0x12bb05,_0x337cf4[_0x7202('0x16')],_0x47bb09);})[_0x7202('0x3a')](function(_0x162b28){_0x3183ef=_0x162b28;logger['info'](_0x7202('0x5d'),_0x3183ef['id']);return getEndUser(_0x12bb05,_0x5cf095['calleridname'],_0x5cf095[_0x7202('0x5e')],_0x47bb09);})['then'](function(_0x1fc385){_0x1fdab4=_0x1fc385;logger[_0x7202('0x9')]('The\x20Enduser\x20ID\x20is:',_0x1fdab4['id']);return getTicket(_0x12bb05,_0x3183ef,_0x1fdab4,_0x1ecabd,_0x5cf095,_0x1ecabd['Fields'],_0x47bb09,_0x7202('0x5f'));})['then'](function(_0x3c1a0c){_0x3535fe=_0x3c1a0c;logger[_0x7202('0x9')](_0x7202('0x60'));logger[_0x7202('0x9')](_0x7202('0x61'),_0x3535fe['id']);return setRelationship(_0x47bb09,_0x3183ef,_0x3535fe,_0x7202('0x62'));})[_0x7202('0x3a')](function(){return setRelationship(_0x47bb09,_0x1fdab4,_0x3535fe,_0x7202('0x63'));})['then'](function(){return getServerInfo(_0x47bb09);})[_0x7202('0x3a')](function(_0x2600f8){var _0x5e9d4f=parseInt(_0x2600f8['version']['charAt'](0x0));var _0x588c69=util['format'](_0x7202('0x64'),_0x12bb05[_0x7202('0x53')],_0x3535fe['id']);if(_0x5e9d4f>0x6){_0x588c69=util[_0x7202('0x1e')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x12bb05[_0x7202('0x53')],_0x3535fe['id']);}logger['info'](_0x7202('0x65'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x337cf4['name']),_0x7202('0x66'),{'uri':_0x588c69});})['catch'](function(_0x32b0f2){logger['error'](_0x7202('0x65'),JSON['stringify'](_0x32b0f2));});};exports['outbound']=function(_0x9d4b85,_0x51f8b8,_0x23013e,_0x3a3d84,_0x3997ab,_0x2f4732,_0x4882a3){var _0x36ed3b,_0xacdcb5,_0x38ad7f,_0x48a786;_0x2f4732[_0x7202('0x53')]=intUtil[_0x7202('0x54')](_0x2f4732[_0x7202('0x53')]);_0x2f4732[_0x7202('0x55')]=intUtil[_0x7202('0x54')](_0x2f4732[_0x7202('0x55')]);def['uri']=util[_0x7202('0x1e')](_0x7202('0x57'),_0x2f4732[_0x7202('0x53')]);if(_0x4882a3&&_0x4882a3[_0x7202('0x67')]&&_0x4882a3[_0x7202('0x67')]!==_0x7202('0x68')){logger[_0x7202('0x9')](_0x7202('0x69'),_0x7202('0x59'));_0x51f8b8[_0x7202('0x5a')]=util[_0x7202('0x1e')](_0x7202('0x5b'),_0x2f4732[_0x7202('0x55')],_0x51f8b8['uniqueid'],md5(_0x51f8b8[_0x7202('0x5c')]));}return getConnection(_0x2f4732)[_0x7202('0x3a')](function(_0x2b6d74){_0x48a786=_0x2b6d74;return getUser(_0x2f4732,_0x3a3d84[_0x7202('0x16')],_0x48a786);})[_0x7202('0x3a')](function(_0xcc68ff){_0x36ed3b=_0xcc68ff;logger[_0x7202('0x9')](_0x7202('0x5d'),_0x36ed3b['id']);return getEndUser(_0x2f4732,_0x51f8b8[_0x7202('0x6a')],_0x51f8b8[_0x7202('0x6b')],_0x48a786);})[_0x7202('0x3a')](function(_0x547c53){_0xacdcb5=_0x547c53;logger[_0x7202('0x9')](_0x7202('0x6c'),_0xacdcb5['id']);return getTicket(_0x2f4732,_0x36ed3b,_0xacdcb5,_0x23013e,_0x51f8b8,_0x23013e[_0x7202('0x6d')],_0x48a786,'Outbound');})[_0x7202('0x3a')](function(_0x300d49){_0x38ad7f=_0x300d49;logger['info'](_0x7202('0x60'));logger[_0x7202('0x9')](_0x7202('0x61'),_0x38ad7f['id']);return setRelationship(_0x48a786,_0x36ed3b,_0x38ad7f,_0x7202('0x62'));})[_0x7202('0x3a')](function(){return setRelationship(_0x48a786,_0xacdcb5,_0x38ad7f,_0x7202('0x63'));})[_0x7202('0x3a')](function(){return getServerInfo(_0x48a786);})['then'](function(_0x7c0646){var _0x1b1db2=parseInt(_0x7c0646[_0x7202('0x6e')][_0x7202('0x6f')](0x0));var _0x2f1193=util[_0x7202('0x1e')](_0x7202('0x64'),_0x2f4732[_0x7202('0x53')],_0x38ad7f['id']);if(_0x1b1db2>0x6){_0x2f1193=util['format'](_0x7202('0x70'),_0x2f4732['remoteUri'],_0x38ad7f['id']);}logger[_0x7202('0x9')](_0x7202('0x69'),_0x7202('0x71'));emit(util[_0x7202('0x1e')](_0x7202('0x72'),_0x3a3d84[_0x7202('0x16')]),_0x7202('0x66'),{'uri':_0x2f1193});})['catch'](function(_0x1ecbc9){logger[_0x7202('0x73')](_0x7202('0x69'),JSON['stringify'](_0x1ecbc9));});};exports[_0x7202('0x74')]=function(_0x2ce432,_0x3750a8,_0xb5f059,_0xfddc15,_0x383faf,_0x2ff0cc){var _0x111fa9,_0x5ef007,_0x470b5a,_0xd0ac83;_0x2ff0cc[_0x7202('0x53')]=intUtil[_0x7202('0x54')](_0x2ff0cc[_0x7202('0x53')]);_0x2ff0cc[_0x7202('0x55')]=intUtil[_0x7202('0x54')](_0x2ff0cc['serverUrl']);def[_0x7202('0x56')]=util[_0x7202('0x1e')](_0x7202('0x57'),_0x2ff0cc[_0x7202('0x53')]);if(_0x383faf&&_0x383faf['monitor_format']){logger[_0x7202('0x9')]('['+_0x3750a8[_0x7202('0x75')][_0x7202('0x76')]()+']',_0x7202('0x59'));_0x3750a8[_0x7202('0x5a')]=util[_0x7202('0x1e')](_0x7202('0x5b'),_0x2ff0cc[_0x7202('0x55')],_0x3750a8[_0x7202('0x5c')],md5(_0x3750a8[_0x7202('0x5c')]));}else{_0x3750a8[_0x7202('0x5a')]='';}return getConnection(_0x2ff0cc)[_0x7202('0x3a')](function(_0x29c736){_0xd0ac83=_0x29c736;if(!_[_0x7202('0x25')](_0xfddc15)){return getUser(_0x2ff0cc,_0xfddc15[_0x7202('0x16')],_0xd0ac83);}else{return getUser(_0x2ff0cc,null,_0xd0ac83);}})[_0x7202('0x3a')](function(_0x5df5a5){_0x111fa9=_0x5df5a5;logger[_0x7202('0x9')](_0x7202('0x5d'),_0x111fa9['id']);return getEndUser(_0x2ff0cc,_0x3750a8[_0x7202('0x77')],_0x3750a8[_0x7202('0x5e')],_0xd0ac83);})[_0x7202('0x3a')](function(_0x5576d0){_0x5ef007=_0x5576d0;logger[_0x7202('0x9')]('The\x20Enduser\x20ID\x20is:',_0x5ef007['id']);return getTicket(_0x2ff0cc,_0x111fa9,_0x5ef007,_0xb5f059,_0x3750a8,_0xb5f059[_0x7202('0x6d')],_0xd0ac83,_0x7202('0x5f'));})['then'](function(_0x43d152){_0x470b5a=_0x43d152;logger['info'](_0x7202('0x60'));logger[_0x7202('0x9')](_0x7202('0x61'),_0x470b5a['id']);return setRelationship(_0xd0ac83,_0x111fa9,_0x470b5a,_0x7202('0x62'));})[_0x7202('0x3a')](function(){return setRelationship(_0xd0ac83,_0x5ef007,_0x470b5a,_0x7202('0x63'));})[_0x7202('0x3a')](function(){return getServerInfo(_0xd0ac83);})[_0x7202('0x78')](function(_0x15407d){logger[_0x7202('0x73')]('['+_0x3750a8[_0x7202('0x75')][_0x7202('0x76')]()+']',JSON[_0x7202('0x24')](_0x15407d));});}; \ No newline at end of file +var _0x5129=['replace','duration_hours','duration_minutes','parent_id','Contacts','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','toString','base64','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','then','first_name','[HTTP]','map','type','string','nameField','toLowerCase','content','customField','custom_fields','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','Ticket\x20created!','%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','unmanaged','toUpperCase','calleridnum','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice'];(function(_0x1d628d,_0x325eb9){var _0x3eff3d=function(_0x1b626d){while(--_0x1b626d){_0x1d628d['push'](_0x1d628d['shift']());}};_0x3eff3d(++_0x325eb9);}(_0x5129,0x1b5));var _0x9512=function(_0x54d2b9,_0x331e64){_0x54d2b9=_0x54d2b9-0x0;var _0x377458=_0x5129[_0x54d2b9];return _0x377458;};'use strict';var _=require(_0x9512('0x0'));var rp=require(_0x9512('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x9512('0x2'));var Redis=require(_0x9512('0x3'));var intUtil=require(_0x9512('0x4'));var config=require(_0x9512('0x5'));var logger=require(_0x9512('0x6'))(_0x9512('0x7'));config[_0x9512('0x8')]=_[_0x9512('0x9')](config[_0x9512('0x8')],{'host':_0x9512('0xa'),'port':0x18eb});var io=require(_0x9512('0xb'))(new Redis(config['redis']));var def={'method':_0x9512('0xc'),'json':!![]};function emit(_0x157a1b,_0x214157,_0x54da4f){io['to'](_0x157a1b)['emit'](_0x214157,_0x54da4f);}function getTicket(_0x382e48,_0x3bc2cf,_0x2b9f48,_0x23e948,_0x3a81c8,_0x9e205e,_0x5b2a9c,_0x44a0f2){logger[_0x9512('0xd')](_0x9512('0xe'));var _0x43088d=new Date();var _0xed77db=[{'name':_0x9512('0xf'),'value':intUtil[_0x9512('0x10')](_0x23e948['Subjects'],_0x3a81c8,'\x20')},{'name':_0x9512('0x11'),'value':_0x3bc2cf['id']},{'name':'created_by','value':_0x3bc2cf['id']},{'name':_0x9512('0x12'),'value':intUtil[_0x9512('0x10')](_0x23e948[_0x9512('0x13')],_0x3a81c8,'\x0a')},{'name':_0x9512('0x14'),'value':_0x43088d[_0x9512('0x15')]()[_0x9512('0x16')](0x0,0x13)[_0x9512('0x17')]('T','\x20')},{'name':_0x9512('0x18'),'value':'0'},{'name':_0x9512('0x19'),'value':'15'},{'name':_0x9512('0x1a'),'value':_0x2b9f48['id']},{'name':'parent_type','value':_0x9512('0x1b')},{'name':'parent_name','value':_0x2b9f48[_0x9512('0xf')]},{'name':'direction','value':_0x44a0f2}];if(_0x9e205e['length']){_[_0x9512('0x1c')](_0x9e205e,function(_0x3db799){if(_0x3a81c8[_0x3db799[_0x9512('0x1d')]]){_0xed77db[_0x9512('0x1e')]({'name':_0x3db799[_0x9512('0x1f')],'value':_0x3a81c8[_0x3db799[_0x9512('0x1d')]]});}});}return request({'form':{'method':_0x9512('0x20'),'input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON[_0x9512('0x22')]({'session':_0x5b2a9c['id'],'module_name':_0x9512('0x23'),'name_value_list':_0xed77db})}});}function getAuth(_0xbba64e){return util[_0x9512('0x24')]('Basic\x20%s',new Buffer(_0xbba64e['apiKey']+':X')[_0x9512('0x25')](_0x9512('0x26')));}function getServerInfo(_0x142c47){return request({'form':{'method':'get_server_info','input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON[_0x9512('0x22')]({'session':_0x142c47['id']})}});}function getUser(_0x565a89,_0x3c291f,_0x31a212){if(!_['isNil'](_0x3c291f)){logger[_0x9512('0xd')](_0x9512('0x27'),_0x3c291f);return request({'form':{'method':_0x9512('0x28'),'input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON[_0x9512('0x22')]({'session':_0x31a212['id'],'module_name':_0x9512('0x29'),'query':util[_0x9512('0x24')](_0x9512('0x2a'),_0x3c291f),'order_by':'','offset':'0','select_fields':['id',_0x9512('0xf'),_0x9512('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x55580f){if(_0x55580f[_0x9512('0x2c')][_0x9512('0x2d')]){var _0x47ff78=_[_0x9512('0x2e')](_0x55580f[_0x9512('0x2c')],function(_0x56282f){return _0x56282f['name_value_list']['user_name'][_0x9512('0x2f')]===_0x3c291f;});if(_0x47ff78){logger[_0x9512('0xd')](_0x9512('0x30'));return BPromise[_0x9512('0x31')]({'id':_0x47ff78[_0x9512('0x32')]['id'][_0x9512('0x2f')],'name':_0x47ff78[_0x9512('0x32')][_0x9512('0xf')]['value']});}}logger[_0x9512('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9512('0x31')]({'id':_0x31a212[_0x9512('0x32')][_0x9512('0x33')]['value'],'name':_0x31a212[_0x9512('0x32')][_0x9512('0x2b')]['value']});});}else{logger[_0x9512('0xd')](_0x9512('0x34'));return BPromise[_0x9512('0x31')]({'id':_0x31a212['name_value_list'][_0x9512('0x33')][_0x9512('0x2f')],'name':_0x31a212['name_value_list'][_0x9512('0x2b')][_0x9512('0x2f')]});}}function getEndUser(_0x481988,_0x3aaead,_0x22c938,_0x527adc){logger['info'](_0x9512('0x35'),_0x22c938);return request({'form':{'method':_0x9512('0x28'),'input_type':'JSON','response_type':_0x9512('0x21'),'rest_data':JSON['stringify']({'session':_0x527adc['id'],'module_name':_0x9512('0x1b'),'query':util[_0x9512('0x24')](_0x9512('0x36'),_0x22c938),'order_by':'','offset':'0','select_fields':['id',_0x9512('0xf'),_0x9512('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4fc14c){if(_0x4fc14c['entry_list'][_0x9512('0x2d')]){var _0x1d92ed=_[_0x9512('0x2e')](_0x4fc14c['entry_list'],function(_0x28150e){return _0x28150e[_0x9512('0x32')][_0x9512('0x37')][_0x9512('0x2f')]===_0x22c938;});if(_0x1d92ed){logger[_0x9512('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x1d92ed[_0x9512('0x32')]['id']['value'],'name':_0x1d92ed['name_value_list'][_0x9512('0xf')][_0x9512('0x2f')],'phone':_0x1d92ed[_0x9512('0x32')][_0x9512('0x37')][_0x9512('0x2f')]});}}else{logger[_0x9512('0xd')](_0x9512('0x38'));return request({'form':{'method':_0x9512('0x20'),'input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON[_0x9512('0x22')]({'session':_0x527adc['id'],'module_name':_0x9512('0x1b'),'name_value_list':[{'name':'first_name','value':_0x3aaead!==''?_0x3aaead:util[_0x9512('0x24')](_0x9512('0x39'),_0x22c938)},{'name':_0x9512('0x37'),'value':_0x22c938}]})}})[_0x9512('0x3a')](function(_0x49ab82){logger[_0x9512('0xd')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x49ab82['id'],'name':_0x49ab82[_0x9512('0x2c')][_0x9512('0x3b')][_0x9512('0x2f')],'phone':_0x49ab82[_0x9512('0x2c')]['phone_home']['value']});});}});}function request(_0x4f3b3f){logger['debug'](_0x9512('0x3c'),JSON[_0x9512('0x22')](_0x4f3b3f));return rp(_['merge'](def,_0x4f3b3f));}function getTags(_0x12f42b,_0x2eb16d){var _0x2b5f0a=[];if(_0x12f42b&&_0x12f42b[_0x9512('0x2d')]>0x0){_0x2b5f0a=_[_0x9512('0x3d')](_0x12f42b,_0x2eb16d);}return _0x2b5f0a;}function getCustomFields(_0x16010a,_0x3a22ae){var _0x2185ad=[];var _0x1ba61d={'custom_fields':[]};if(_0x16010a[_0x9512('0x2d')]>0x0){_[_0x9512('0x1c')](_0x16010a,function(_0x136e9c){if(_0x136e9c[_0x9512('0x3e')]===_0x9512('0x3f')&&_0x136e9c['nameField']&&!_0x136e9c['customField']){_0x1ba61d[_0x136e9c[_0x9512('0x40')][_0x9512('0x41')]()]=_0x136e9c[_0x9512('0x42')][_0x9512('0x25')]();}else if(_0x136e9c[_0x9512('0x3e')]===_0x9512('0x3f')&&_0x136e9c[_0x9512('0x1f')]&&_0x136e9c[_0x9512('0x43')]){_0x1ba61d[_0x9512('0x44')][_0x9512('0x1e')]({'id':_0x136e9c[_0x9512('0x1f')],'value':_0x136e9c[_0x9512('0x42')][_0x9512('0x25')]()});}else if(_0x136e9c[_0x9512('0x3e')]==='variable'&&_0x136e9c[_0x9512('0x1d')]&&_0x136e9c[_0x9512('0x1f')]&&_0x136e9c['customField']){_0x3a22ae[_0x136e9c[_0x9512('0x1d')]]&&_0x1ba61d['custom_fields'][_0x9512('0x1e')]({'id':_0x136e9c[_0x9512('0x1f')],'value':_0x3a22ae[_0x136e9c[_0x9512('0x1d')]][_0x9512('0x25')]()});}else if(_0x136e9c[_0x9512('0x3e')]===_0x9512('0x45')&&_0x136e9c['Variable']&&_0x136e9c[_0x9512('0x46')][_0x9512('0xf')]&&_0x136e9c[_0x9512('0x1f')]&&_0x136e9c[_0x9512('0x43')]){_0x3a22ae[_0x136e9c[_0x9512('0x46')][_0x9512('0xf')]['toLowerCase']()]&&_0x1ba61d[_0x9512('0x44')][_0x9512('0x1e')]({'id':_0x136e9c[_0x9512('0x1f')],'value':_0x3a22ae[_0x136e9c[_0x9512('0x46')][_0x9512('0xf')][_0x9512('0x41')]()]['toString']()});}});}return _0x1ba61d;}function getConnection(_0x231ab0){return request({'method':_0x9512('0xc'),'form':{'method':'login','input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x231ab0['username'],'password':_0x231ab0[_0x9512('0x47')],'encryption':_0x9512('0x48')},'application':_0x9512('0x49')})}})[_0x9512('0x3a')](function(_0x50ea1b){var _0x3612a1=_0x50ea1b;if(_0x3612a1['id']){def['sessionID']=_0x3612a1['id'];return BPromise[_0x9512('0x31')](_0x3612a1);}else{throw new Error(util[_0x9512('0x24')](_0x9512('0x4a'),_0x231ab0['id']));}});}function setRelationship(_0x1261ff,_0x54e9b8,_0x504c3c,_0x4f109e){return request({'form':{'method':_0x9512('0x4b'),'input_type':_0x9512('0x21'),'response_type':_0x9512('0x21'),'rest_data':JSON[_0x9512('0x22')]({'session':_0x1261ff['id'],'module_name':_0x9512('0x23'),'module_id':_0x504c3c['id'],'link_field_name':_0x4f109e,'related_ids':[_0x54e9b8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9512('0x4c')]=function(_0x23a6f8,_0x5c2c79,_0x52098f,_0x5a9b9f,_0x460644,_0x4ddc1b){var _0xb88ca6,_0x44ca67,_0x5b933f,_0x491489;_0x4ddc1b[_0x9512('0x4d')]=intUtil[_0x9512('0x4e')](_0x4ddc1b[_0x9512('0x4d')]);_0x4ddc1b['serverUrl']=intUtil[_0x9512('0x4e')](_0x4ddc1b['serverUrl']);def['uri']=util[_0x9512('0x24')](_0x9512('0x4f'),_0x4ddc1b[_0x9512('0x4d')]);if(_0x460644&&_0x460644[_0x9512('0x50')]){logger[_0x9512('0xd')](_0x9512('0x51'),'Recording\x20is\x20enabled!');_0x5c2c79[_0x9512('0x52')]=util[_0x9512('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ddc1b[_0x9512('0x53')],_0x5c2c79[_0x9512('0x54')],md5(_0x5c2c79[_0x9512('0x54')]));}else{_0x5c2c79[_0x9512('0x52')]='';}return getConnection(_0x4ddc1b)[_0x9512('0x3a')](function(_0x1804ed){_0x491489=_0x1804ed;return getUser(_0x4ddc1b,_0x5a9b9f['name'],_0x491489);})['then'](function(_0xfe010){_0xb88ca6=_0xfe010;logger[_0x9512('0xd')](_0x9512('0x55'),_0xb88ca6['id']);return getEndUser(_0x4ddc1b,_0x5c2c79[_0x9512('0x56')],_0x5c2c79['calleridnum'],_0x491489);})[_0x9512('0x3a')](function(_0x43c9ff){_0x44ca67=_0x43c9ff;logger['info'](_0x9512('0x57'),_0x44ca67['id']);return getTicket(_0x4ddc1b,_0xb88ca6,_0x44ca67,_0x52098f,_0x5c2c79,_0x52098f[_0x9512('0x58')],_0x491489,_0x9512('0x59'));})['then'](function(_0x3d7401){_0x5b933f=_0x3d7401;logger['info']('Ticket\x20created!');logger[_0x9512('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5b933f['id']);return setRelationship(_0x491489,_0xb88ca6,_0x5b933f,_0x9512('0x5a'));})['then'](function(){return setRelationship(_0x491489,_0x44ca67,_0x5b933f,_0x9512('0x5b'));})[_0x9512('0x3a')](function(){return getServerInfo(_0x491489);})[_0x9512('0x3a')](function(_0x26b916){var _0x3c47df=parseInt(_0x26b916[_0x9512('0x5c')][_0x9512('0x5d')](0x0));var _0x3d9a43=util[_0x9512('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4ddc1b[_0x9512('0x4d')],_0x5b933f['id']);if(_0x3c47df>0x6){_0x3d9a43=util[_0x9512('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4ddc1b[_0x9512('0x4d')],_0x5b933f['id']);}logger[_0x9512('0xd')](_0x9512('0x51'),_0x9512('0x5e'));emit(util[_0x9512('0x24')](_0x9512('0x5f'),_0x5a9b9f['name']),_0x9512('0x60'),{'uri':_0x3d9a43});})[_0x9512('0x61')](function(_0xb9369b){logger[_0x9512('0x62')](_0x9512('0x51'),JSON[_0x9512('0x22')](_0xb9369b));});};exports[_0x9512('0x63')]=function(_0x1073a9,_0x4f853d,_0x21c5a9,_0x35593b,_0x5a8ce6,_0x14616c,_0x286dfe){var _0x8cbaed,_0x31b54a,_0x45608e,_0x3fc985;_0x14616c[_0x9512('0x4d')]=intUtil[_0x9512('0x4e')](_0x14616c['remoteUri']);_0x14616c[_0x9512('0x53')]=intUtil[_0x9512('0x4e')](_0x14616c['serverUrl']);def[_0x9512('0x64')]=util['format'](_0x9512('0x4f'),_0x14616c[_0x9512('0x4d')]);if(_0x286dfe&&_0x286dfe[_0x9512('0x65')]&&_0x286dfe[_0x9512('0x65')]!==_0x9512('0x66')){logger[_0x9512('0xd')](_0x9512('0x67'),_0x9512('0x68'));_0x4f853d[_0x9512('0x52')]=util[_0x9512('0x24')](_0x9512('0x69'),_0x14616c[_0x9512('0x53')],_0x4f853d[_0x9512('0x54')],md5(_0x4f853d[_0x9512('0x54')]));}return getConnection(_0x14616c)[_0x9512('0x3a')](function(_0x5c6119){_0x3fc985=_0x5c6119;return getUser(_0x14616c,_0x35593b[_0x9512('0xf')],_0x3fc985);})['then'](function(_0xce85c4){_0x8cbaed=_0xce85c4;logger[_0x9512('0xd')](_0x9512('0x55'),_0x8cbaed['id']);return getEndUser(_0x14616c,_0x4f853d[_0x9512('0x6a')],_0x4f853d['destcalleridnum'],_0x3fc985);})[_0x9512('0x3a')](function(_0x45055e){_0x31b54a=_0x45055e;logger['info'](_0x9512('0x57'),_0x31b54a['id']);return getTicket(_0x14616c,_0x8cbaed,_0x31b54a,_0x21c5a9,_0x4f853d,_0x21c5a9['Fields'],_0x3fc985,_0x9512('0x6b'));})[_0x9512('0x3a')](function(_0x1213aa){_0x45608e=_0x1213aa;logger[_0x9512('0xd')](_0x9512('0x6c'));logger[_0x9512('0xd')]('The\x20Ticket\x20ID\x20is:',_0x45608e['id']);return setRelationship(_0x3fc985,_0x8cbaed,_0x45608e,_0x9512('0x5a'));})[_0x9512('0x3a')](function(){return setRelationship(_0x3fc985,_0x31b54a,_0x45608e,'contacts');})['then'](function(){return getServerInfo(_0x3fc985);})[_0x9512('0x3a')](function(_0x3f6e6d){var _0x2ff6d2=parseInt(_0x3f6e6d['version'][_0x9512('0x5d')](0x0));var _0x1129d3=util[_0x9512('0x24')](_0x9512('0x6d'),_0x14616c[_0x9512('0x4d')],_0x45608e['id']);if(_0x2ff6d2>0x6){_0x1129d3=util['format'](_0x9512('0x6e'),_0x14616c[_0x9512('0x4d')],_0x45608e['id']);}logger[_0x9512('0xd')](_0x9512('0x67'),_0x9512('0x5e'));emit(util[_0x9512('0x24')](_0x9512('0x5f'),_0x35593b[_0x9512('0xf')]),_0x9512('0x60'),{'uri':_0x1129d3});})['catch'](function(_0x5a2167){logger[_0x9512('0x62')](_0x9512('0x67'),JSON[_0x9512('0x22')](_0x5a2167));});};exports[_0x9512('0x6f')]=function(_0x350af6,_0x2282a9,_0x3f2b14,_0x30a0e6,_0x20d801,_0x7d47b3){var _0x59d20d,_0x4f4692,_0x5f0288,_0x524325;_0x7d47b3[_0x9512('0x4d')]=intUtil[_0x9512('0x4e')](_0x7d47b3[_0x9512('0x4d')]);_0x7d47b3[_0x9512('0x53')]=intUtil[_0x9512('0x4e')](_0x7d47b3[_0x9512('0x53')]);def[_0x9512('0x64')]=util['format']('%s/service/v4_1/rest.php',_0x7d47b3[_0x9512('0x4d')]);if(_0x20d801&&_0x20d801[_0x9512('0x50')]){logger[_0x9512('0xd')]('['+_0x2282a9['lastevent'][_0x9512('0x70')]()+']',_0x9512('0x68'));_0x2282a9[_0x9512('0x52')]=util[_0x9512('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7d47b3[_0x9512('0x53')],_0x2282a9[_0x9512('0x54')],md5(_0x2282a9['uniqueid']));}else{_0x2282a9['recordingURL']='';}return getConnection(_0x7d47b3)['then'](function(_0x1730bc){_0x524325=_0x1730bc;if(!_['isNil'](_0x30a0e6)){return getUser(_0x7d47b3,_0x30a0e6['name'],_0x524325);}else{return getUser(_0x7d47b3,null,_0x524325);}})[_0x9512('0x3a')](function(_0x366af1){_0x59d20d=_0x366af1;logger[_0x9512('0xd')](_0x9512('0x55'),_0x59d20d['id']);return getEndUser(_0x7d47b3,_0x2282a9[_0x9512('0x56')],_0x2282a9[_0x9512('0x71')],_0x524325);})[_0x9512('0x3a')](function(_0x30d040){_0x4f4692=_0x30d040;logger['info'](_0x9512('0x57'),_0x4f4692['id']);return getTicket(_0x7d47b3,_0x59d20d,_0x4f4692,_0x3f2b14,_0x2282a9,_0x3f2b14[_0x9512('0x58')],_0x524325,_0x9512('0x59'));})['then'](function(_0x51af1d){_0x5f0288=_0x51af1d;logger[_0x9512('0xd')](_0x9512('0x6c'));logger[_0x9512('0xd')](_0x9512('0x72'),_0x5f0288['id']);return setRelationship(_0x524325,_0x59d20d,_0x5f0288,_0x9512('0x5a'));})[_0x9512('0x3a')](function(){return setRelationship(_0x524325,_0x4f4692,_0x5f0288,_0x9512('0x5b'));})[_0x9512('0x3a')](function(){return getServerInfo(_0x524325);})[_0x9512('0x61')](function(_0x599c11){logger[_0x9512('0x62')]('['+_0x2282a9['lastevent'][_0x9512('0x70')]()+']',JSON[_0x9512('0x22')](_0x599c11));});}; \ 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 6a4cc2e..012b8b2 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 _0x25a7=['lastIndexOf','isNil','lodash','util','getString','sortBy','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','keyContent','format','%s:\x20%s','keyType','slice','substring'];(function(_0x5ebf90,_0x4aa4fc){var _0x5020ef=function(_0xaba82b){while(--_0xaba82b){_0x5ebf90['push'](_0x5ebf90['shift']());}};_0x5020ef(++_0x4aa4fc);}(_0x25a7,0x188));var _0x725a=function(_0x3af43c,_0x333c9f){_0x3af43c=_0x3af43c-0x0;var _0x206dd4=_0x25a7[_0x3af43c];return _0x206dd4;};'use strict';var _=require(_0x725a('0x0'));var util=require(_0x725a('0x1'));exports[_0x725a('0x2')]=function(_0x28ef22,_0x53372c,_0x457ff0){var _0x3ec6b8=[];if(_0x28ef22['length']>0x0){var _0x23d3ea=_[_0x725a('0x3')](_0x28ef22,['id']);for(var _0x248f47=0x0;_0x248f47<_0x23d3ea[_0x725a('0x4')];_0x248f47++){var _0x2ba49f=_0x23d3ea[_0x248f47];if(_0x2ba49f[_0x725a('0x5')]===_0x725a('0x6')){_0x3ec6b8[_0x725a('0x7')](_0x2ba49f[_0x725a('0x8')]);}else if(_0x2ba49f[_0x725a('0x5')]===_0x725a('0x9')&&_0x2ba49f[_0x725a('0xa')]){_0x53372c[_0x2ba49f[_0x725a('0xa')]]&&_0x3ec6b8[_0x725a('0x7')](_0x53372c[_0x2ba49f[_0x725a('0xa')]][_0x725a('0xb')]());}else if(_0x2ba49f[_0x725a('0x5')]===_0x725a('0xc')&&_0x2ba49f['Variable']&&_0x2ba49f[_0x725a('0xd')][_0x725a('0xe')]){_0x53372c[_0x2ba49f[_0x725a('0xd')]['name']['toLowerCase']()]&&_0x3ec6b8[_0x725a('0x7')](_0x53372c[_0x2ba49f[_0x725a('0xd')][_0x725a('0xe')][_0x725a('0xf')]()][_0x725a('0xb')]());}else if(_0x2ba49f[_0x725a('0x5')]===_0x725a('0x10')){if(_0x2ba49f['keyType']==='string'&&_0x2ba49f['key']){_0x3ec6b8[_0x725a('0x7')](util['format']('%s:\x20%s',_0x2ba49f[_0x725a('0x11')],_0x2ba49f[_0x725a('0x12')]));}else if(_0x2ba49f['keyType']===_0x725a('0x9')&&_0x2ba49f['variableName']&&_0x2ba49f[_0x725a('0x11')]){_0x53372c[_0x2ba49f[_0x725a('0xa')]]&&_0x3ec6b8['push'](util[_0x725a('0x13')](_0x725a('0x14'),_0x2ba49f[_0x725a('0x11')],_0x53372c[_0x2ba49f['variableName']]));}else if(_0x2ba49f[_0x725a('0x15')]===_0x725a('0xc')&&_0x2ba49f[_0x725a('0xd')]&&_0x2ba49f['Variable']['name']&&_0x2ba49f[_0x725a('0x11')]){_0x53372c[_0x2ba49f[_0x725a('0xd')][_0x725a('0xe')][_0x725a('0xf')]()]&&_0x3ec6b8[_0x725a('0x7')](util['format'](_0x725a('0x14'),_0x2ba49f[_0x725a('0x11')],_0x53372c[_0x2ba49f[_0x725a('0xd')][_0x725a('0xe')][_0x725a('0xf')]()]));}}}}return _0x3ec6b8['join'](_0x457ff0);};exports['stripTrailingSlash']=function(_0x25eb92){var _0x222412=_0x25eb92[_0x725a('0x16')](-0x1);if(_0x222412==='/'){_0x25eb92=_0x25eb92[_0x725a('0x17')](0x0,_0x25eb92[_0x725a('0x18')](_0x222412));}return _0x25eb92;};exports['validateEmail']=function(_0x5b7fec){if(!_[_0x725a('0x19')](_0x5b7fec)&&_0x5b7fec!==''){var _0x1f44eb=/^(([^<>()\[\]\\.,;:\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 _0x1f44eb['test'](String(_0x5b7fec)[_0x725a('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x1cad=['keyValue','format','%s:\x20%s','keyContent','keyType','key','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString'];(function(_0x25aefc,_0x5474ea){var _0x993e28=function(_0x1d1a27){while(--_0x1d1a27){_0x25aefc['push'](_0x25aefc['shift']());}};_0x993e28(++_0x5474ea);}(_0x1cad,0x141));var _0xd1ca=function(_0x1d69c2,_0x11bee7){_0x1d69c2=_0x1d69c2-0x0;var _0x36e2a0=_0x1cad[_0x1d69c2];return _0x36e2a0;};'use strict';var _=require(_0xd1ca('0x0'));var util=require('util');exports[_0xd1ca('0x1')]=function(_0x1984db,_0x59fb36,_0x532272){var _0x4c9585=[];if(_0x1984db[_0xd1ca('0x2')]>0x0){var _0x38e1b5=_[_0xd1ca('0x3')](_0x1984db,['id']);for(var _0x2bacfe=0x0;_0x2bacfe<_0x38e1b5['length'];_0x2bacfe++){var _0x54f828=_0x38e1b5[_0x2bacfe];if(_0x54f828[_0xd1ca('0x4')]===_0xd1ca('0x5')){_0x4c9585[_0xd1ca('0x6')](_0x54f828[_0xd1ca('0x7')]);}else if(_0x54f828[_0xd1ca('0x4')]===_0xd1ca('0x8')&&_0x54f828['variableName']){_0x59fb36[_0x54f828[_0xd1ca('0x9')]]&&_0x4c9585['push'](_0x59fb36[_0x54f828[_0xd1ca('0x9')]]['toString']());}else if(_0x54f828[_0xd1ca('0x4')]===_0xd1ca('0xa')&&_0x54f828['Variable']&&_0x54f828[_0xd1ca('0xb')]['name']){_0x59fb36[_0x54f828[_0xd1ca('0xb')][_0xd1ca('0xc')][_0xd1ca('0xd')]()]&&_0x4c9585['push'](_0x59fb36[_0x54f828[_0xd1ca('0xb')][_0xd1ca('0xc')]['toLowerCase']()][_0xd1ca('0xe')]());}else if(_0x54f828[_0xd1ca('0x4')]===_0xd1ca('0xf')){if(_0x54f828['keyType']===_0xd1ca('0x5')&&_0x54f828['key']){_0x4c9585[_0xd1ca('0x6')](util[_0xd1ca('0x10')](_0xd1ca('0x11'),_0x54f828['key'],_0x54f828[_0xd1ca('0x12')]));}else if(_0x54f828[_0xd1ca('0x13')]==='variable'&&_0x54f828[_0xd1ca('0x9')]&&_0x54f828[_0xd1ca('0x14')]){_0x59fb36[_0x54f828[_0xd1ca('0x9')]]&&_0x4c9585[_0xd1ca('0x6')](util['format']('%s:\x20%s',_0x54f828[_0xd1ca('0x14')],_0x59fb36[_0x54f828[_0xd1ca('0x9')]]));}else if(_0x54f828[_0xd1ca('0x13')]===_0xd1ca('0xa')&&_0x54f828[_0xd1ca('0xb')]&&_0x54f828[_0xd1ca('0xb')][_0xd1ca('0xc')]&&_0x54f828['key']){_0x59fb36[_0x54f828['Variable'][_0xd1ca('0xc')][_0xd1ca('0xd')]()]&&_0x4c9585[_0xd1ca('0x6')](util[_0xd1ca('0x10')]('%s:\x20%s',_0x54f828['key'],_0x59fb36[_0x54f828[_0xd1ca('0xb')][_0xd1ca('0xc')][_0xd1ca('0xd')]()]));}}}}return _0x4c9585[_0xd1ca('0x15')](_0x532272);};exports[_0xd1ca('0x16')]=function(_0x43d8b9){var _0x1b083f=_0x43d8b9[_0xd1ca('0x17')](-0x1);if(_0x1b083f==='/'){_0x43d8b9=_0x43d8b9[_0xd1ca('0x18')](0x0,_0x43d8b9[_0xd1ca('0x19')](_0x1b083f));}return _0x43d8b9;};exports[_0xd1ca('0x1a')]=function(_0x4c99e6){if(!_[_0xd1ca('0x1b')](_0x4c99e6)&&_0x4c99e6!==''){var _0x2e4025=/^(([^<>()\[\]\\.,;:\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 _0x2e4025['test'](String(_0x4c99e6)[_0xd1ca('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 ace992b..2724e93 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4d0d99,_0x508809){var _0x291384=function(_0x48fa73){while(--_0x48fa73){_0x4d0d99['push'](_0x4d0d99['shift']());}};_0x291384(++_0x508809);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 3390358..0d68213 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 _0xd34d=['validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','idField','push','variable','variableName','custom_fields','Variable','toLowerCase','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','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','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','integrationTab','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','The\x20Enduser\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','ioredis','./util','zendesk','defaults','socket.io-emitter','redis','emit','application/json','Creating\x20new\x20ticket...','%s/tickets.json','POST','Tags','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!'];(function(_0x40c326,_0x52f1cc){var _0x4df27b=function(_0x2a5382){while(--_0x2a5382){_0x40c326['push'](_0x40c326['shift']());}};_0x4df27b(++_0x52f1cc);}(_0xd34d,0xc7));var _0xdd34=function(_0x122afc,_0x2b77e8){_0x122afc=_0x122afc-0x0;var _0x2041d0=_0xd34d[_0x122afc];return _0x2041d0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xdd34('0x0'));var intUtil=require(_0xdd34('0x1'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xdd34('0x2'));config['redis']=_[_0xdd34('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xdd34('0x4'))(new Redis(config[_0xdd34('0x5')]));function emit(_0x5b38ef,_0x38b63c,_0x59b760){io['to'](_0x5b38ef)[_0xdd34('0x6')](_0x38b63c,_0x59b760);}var headers={'Content-Type':_0xdd34('0x7'),'Accept':'application/json'};function getTicket(_0x23bd47,_0x49bc64,_0x2322ab,_0x58eee5,_0xb58bbb){logger['info'](_0xdd34('0x8'));return request({'uri':util['format'](_0xdd34('0x9'),_0x23bd47['remoteUri']),'method':_0xdd34('0xa'),'body':{'ticket':_['merge']({'requester_id':_0x2322ab['id'],'submitter_id':_0x49bc64?_0x49bc64['id']:undefined,'assignee_id':_0x49bc64?_0x49bc64['id']:undefined,'tags':getTags(_0x58eee5[_0xdd34('0xb')],'name'),'subject':intUtil[_0xdd34('0xc')](_0x58eee5[_0xdd34('0xd')],_0xb58bbb,'\x20'),'description':intUtil[_0xdd34('0xc')](_0x58eee5[_0xdd34('0xe')],_0xb58bbb,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x58eee5[_0xdd34('0xe')],_0xb58bbb,'\x0a')}},getCustomFields(_0x58eee5[_0xdd34('0xf')],_0xb58bbb))}})[_0xdd34('0x10')](function(_0x5a6466){logger[_0xdd34('0x11')](_0xdd34('0x12'));return _0x5a6466['ticket'];});}function getUser(_0x2ed084,_0x50963b){if(intUtil[_0xdd34('0x13')](_0x50963b)){logger[_0xdd34('0x11')](_0xdd34('0x14'),_0x50963b);return request({'uri':util[_0xdd34('0x15')](_0xdd34('0x16'),_0x2ed084[_0xdd34('0x17')]),'qs':{'query':util[_0xdd34('0x15')](_0xdd34('0x18'),_0x50963b)}})[_0xdd34('0x10')](function(_0x17a20e){if(_0x17a20e['count']){logger[_0xdd34('0x11')](_0xdd34('0x19'));return _[_0xdd34('0x1a')](_0x17a20e[_0xdd34('0x1b')],{'email':_0x50963b,'role':_0xdd34('0x1c')});}else{logger[_0xdd34('0x11')](_0xdd34('0x1d'));return request({'uri':util[_0xdd34('0x15')](_0xdd34('0x1e'),_0x2ed084['remoteUri'])})[_0xdd34('0x10')](function(_0x35184b){logger[_0xdd34('0x11')](_0xdd34('0x1f'));return _0x35184b[_0xdd34('0x20')];});}});}else{logger[_0xdd34('0x11')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdd34('0x15')](_0xdd34('0x1e'),_0x2ed084[_0xdd34('0x17')])})[_0xdd34('0x10')](function(_0xc829d8){logger[_0xdd34('0x11')](_0xdd34('0x1f'));return _0xc829d8['user'];});}}function getEndUser(_0x3c0d2b,_0x5abc23,_0x1fd153){logger[_0xdd34('0x11')]('Searching\x20enduser\x20with\x20phone',_0x1fd153);return request({'uri':util[_0xdd34('0x15')]('%s/search.json',_0x3c0d2b[_0xdd34('0x17')]),'qs':{'query':util[_0xdd34('0x15')]('type:user\x20role:end-user\x20phone:%s',_0x1fd153)}})[_0xdd34('0x10')](function(_0x2bba42){var _0x2dd939;if(_0x2bba42[_0xdd34('0x1b')][_0xdd34('0x21')]){_0x2bba42['results']=_[_0xdd34('0x22')](_0x2bba42[_0xdd34('0x1b')],{'suspended':![],'role':'end-user'});if(_0x2bba42[_0xdd34('0x1b')]['length']){_0x2dd939=_[_0xdd34('0x23')](_0x2bba42[_0xdd34('0x1b')]);}}if(_0x2dd939){logger['info'](_0xdd34('0x24'));return _0x2dd939;}else{logger[_0xdd34('0x11')](_0xdd34('0x25'));return request({'uri':util['format'](_0xdd34('0x26'),_0x3c0d2b[_0xdd34('0x17')]),'method':_0xdd34('0xa'),'body':{'user':{'role':_0xdd34('0x27'),'name':util[_0xdd34('0x15')](_0xdd34('0x28'),_0x5abc23||_0x1fd153),'phone':_0x1fd153}}})['then'](function(_0x35ecba){logger['info'](_0xdd34('0x29'));return _0x35ecba[_0xdd34('0x20')];});}});}function getAuth(_0xc09099){var _0x49a98d;if(_0xc09099[_0xdd34('0x2a')]===_0xdd34('0x2b')){_0x49a98d=util['format']('%s:%s',_0xc09099[_0xdd34('0x2c')],_0xc09099[_0xdd34('0x2b')]);}else if(_0xc09099[_0xdd34('0x2a')]===_0xdd34('0x2d')){_0x49a98d=util[_0xdd34('0x15')](_0xdd34('0x2e'),_0xc09099[_0xdd34('0x2c')],_0xc09099[_0xdd34('0x2d')]);}return util['format'](_0xdd34('0x2f'),new Buffer(_0x49a98d)[_0xdd34('0x30')]('base64'));}function request(_0x150d0c){logger[_0xdd34('0x31')](_0xdd34('0x32'),JSON['stringify'](_0x150d0c));return rp(_[_0xdd34('0x3')](_0x150d0c,{'method':_0xdd34('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x53516e,_0x1c378f){var _0x14881b=[];if(_0x53516e&&_0x53516e[_0xdd34('0x21')]>0x0){_0x14881b=_[_0xdd34('0x34')](_0x53516e,_0x1c378f);}return _0x14881b;}function getCustomFields(_0x410dd1,_0x50614a){var _0x1bb66b=[];var _0x47f51b={'custom_fields':[]};if(_0x410dd1[_0xdd34('0x21')]>0x0){_[_0xdd34('0x35')](_0x410dd1,function(_0x1efdf7){if(_[_0xdd34('0x36')]([_0xdd34('0x37'),_0xdd34('0x38')],_0x1efdf7[_0xdd34('0x39')])&&_0x1efdf7[_0xdd34('0x3a')]&&!_0x1efdf7[_0xdd34('0x3b')]){_0x47f51b[_0x1efdf7[_0xdd34('0x3a')]['toLowerCase']()]=_0x1efdf7[_0xdd34('0x3c')][_0xdd34('0x30')]();}else if(_['includes']([_0xdd34('0x37'),_0xdd34('0x38')],_0x1efdf7[_0xdd34('0x39')])&&_0x1efdf7[_0xdd34('0x3d')]&&_0x1efdf7[_0xdd34('0x3b')]){_0x47f51b['custom_fields'][_0xdd34('0x3e')]({'id':_0x1efdf7['idField'],'value':_0x1efdf7[_0xdd34('0x3c')][_0xdd34('0x30')]()});}else if(_0x1efdf7[_0xdd34('0x39')]===_0xdd34('0x3f')&&_0x1efdf7[_0xdd34('0x40')]&&_0x1efdf7[_0xdd34('0x3d')]&&_0x1efdf7[_0xdd34('0x3b')]){_0x50614a[_0x1efdf7['variableName']]&&_0x47f51b[_0xdd34('0x41')]['push']({'id':_0x1efdf7[_0xdd34('0x3d')],'value':_0x50614a[_0x1efdf7['variableName']][_0xdd34('0x30')]()});}else if(_0x1efdf7['type']==='customVariable'&&_0x1efdf7[_0xdd34('0x42')]&&_0x1efdf7[_0xdd34('0x42')]['name']&&_0x1efdf7[_0xdd34('0x3d')]&&_0x1efdf7[_0xdd34('0x3b')]){_0x50614a[_0x1efdf7[_0xdd34('0x42')]['name'][_0xdd34('0x43')]()]&&_0x47f51b[_0xdd34('0x41')][_0xdd34('0x3e')]({'id':_0x1efdf7[_0xdd34('0x3d')],'value':_0x50614a[_0x1efdf7['Variable'][_0xdd34('0x44')][_0xdd34('0x43')]()]['toString']()});}});}return _0x47f51b;}exports[_0xdd34('0x45')]=function(_0x13d92d,_0x4c1e19,_0x475f84,_0x5845a2,_0x3c2fc8,_0x36670f){var _0x55f6f2,_0x55effe;_0x36670f[_0xdd34('0x17')]=intUtil[_0xdd34('0x46')](_0x36670f[_0xdd34('0x17')]);_0x36670f[_0xdd34('0x47')]=intUtil['stripTrailingSlash'](_0x36670f[_0xdd34('0x47')]);if(_0x3c2fc8&&_0x3c2fc8[_0xdd34('0x48')]){logger['info'](_0xdd34('0x49'),_0xdd34('0x4a'));_0x4c1e19[_0xdd34('0x4b')]=util[_0xdd34('0x15')](_0xdd34('0x4c'),_0x36670f[_0xdd34('0x47')],_0x4c1e19[_0xdd34('0x4d')],md5(_0x4c1e19[_0xdd34('0x4d')]));}else{_0x4c1e19[_0xdd34('0x4b')]='';}headers[_0xdd34('0x4e')]=getAuth(_0x36670f);return getUser(_0x36670f,_0x5845a2[_0xdd34('0x4f')])[_0xdd34('0x10')](function(_0x360a59){_0x55f6f2=_0x360a59;logger['info'](_0xdd34('0x50'),_0x55f6f2['id']);return getEndUser(_0x36670f,_0x4c1e19['calleridname'],_0x4c1e19[_0xdd34('0x51')]);})[_0xdd34('0x10')](function(_0x5e8427){_0x55effe=_0x5e8427;logger[_0xdd34('0x11')]('The\x20Enduser\x20ID\x20is:',_0x55effe['id']);return getTicket(_0x36670f,_0x55f6f2,_0x55effe,_0x475f84,_0x4c1e19);})[_0xdd34('0x10')](function(_0x39831a){if(_0x39831a){logger['info'](_0xdd34('0x52'),_0x39831a['id']);switch(_0x36670f[_0xdd34('0x39')]){case'integrationTab':logger[_0xdd34('0x11')]('[QUEUE]',_0xdd34('0x53'));return request({'uri':util[_0xdd34('0x15')](_0xdd34('0x54'),_0x36670f['remoteUri'],_0x55f6f2['id'],_0x39831a['id']),'method':'POST'});case _0xdd34('0x55'):logger[_0xdd34('0x11')](_0xdd34('0x49'),_0xdd34('0x56'));emit(util[_0xdd34('0x15')](_0xdd34('0x57'),_0x5845a2[_0xdd34('0x44')]),_0xdd34('0x58'),{'uri':util[_0xdd34('0x15')](_0xdd34('0x59'),_0x36670f[_0xdd34('0x17')][_0xdd34('0x5a')](_0xdd34('0x5b'),''),_0x39831a['id'])});break;default:logger[_0xdd34('0x5c')](_0xdd34('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdd34('0x5d')](function(_0x29b4ab){logger['error'](_0xdd34('0x5e'),util[_0xdd34('0x5f')](_0x29b4ab,{'showHidden':!![],'depth':null}));});};exports[_0xdd34('0x60')]=function(_0x55b759,_0x5d3457,_0x1a1517,_0x5c349a,_0x1af095,_0x412769,_0x48f116){var _0x179004,_0x5c635c;_0x412769[_0xdd34('0x17')]=intUtil[_0xdd34('0x46')](_0x412769[_0xdd34('0x17')]);_0x412769[_0xdd34('0x47')]=intUtil[_0xdd34('0x46')](_0x412769[_0xdd34('0x47')]);if(_0x48f116&&_0x48f116[_0xdd34('0x61')]&&_0x48f116[_0xdd34('0x61')]!==_0xdd34('0x62')){logger['info'](_0xdd34('0x63'),_0xdd34('0x4a'));_0x5d3457['recordingURL']=util['format'](_0xdd34('0x4c'),_0x412769[_0xdd34('0x47')],_0x5d3457[_0xdd34('0x4d')],md5(_0x5d3457['uniqueid']));}headers[_0xdd34('0x4e')]=getAuth(_0x412769);return getUser(_0x412769,_0x5c349a[_0xdd34('0x4f')])['then'](function(_0x12f7de){_0x179004=_0x12f7de;logger[_0xdd34('0x11')](_0xdd34('0x50'),_0x179004['id']);return getEndUser(_0x412769,_0x5d3457['destcalleridname'],_0x5d3457['destcalleridnum']);})['then'](function(_0x58534d){_0x5c635c=_0x58534d;logger[_0xdd34('0x11')]('The\x20Enduser\x20ID\x20is:',_0x5c635c['id']);return getTicket(_0x412769,_0x179004,_0x5c635c,_0x1a1517,_0x5d3457);})[_0xdd34('0x10')](function(_0x32f399){if(_0x32f399){logger[_0xdd34('0x11')](_0xdd34('0x52'),_0x32f399['id']);switch(_0x412769[_0xdd34('0x39')]){case _0xdd34('0x64'):logger[_0xdd34('0x11')](_0xdd34('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xdd34('0x15')](_0xdd34('0x54'),_0x412769[_0xdd34('0x17')],_0x179004['id'],_0x32f399['id']),'method':_0xdd34('0xa')});case _0xdd34('0x55'):logger['info'](_0xdd34('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdd34('0x15')](_0xdd34('0x57'),_0x5c349a[_0xdd34('0x44')]),_0xdd34('0x58'),{'uri':util[_0xdd34('0x15')](_0xdd34('0x59'),_0x412769['remoteUri'][_0xdd34('0x5a')](_0xdd34('0x5b'),''),_0x32f399['id'])});break;default:logger['error']('[OUTBOUND]',_0xdd34('0x65'));}}})[_0xdd34('0x5d')](function(_0x53cb4c){logger['error'](_0xdd34('0x66'),util['inspect'](_0x53cb4c,{'showHidden':!![],'depth':null}));});};exports[_0xdd34('0x67')]=function(_0x281bbe,_0x535a56,_0x1f31fd,_0x3c6506,_0x4681ee,_0x334dbd){var _0x16f108,_0x1a0568;_0x334dbd[_0xdd34('0x17')]=intUtil['stripTrailingSlash'](_0x334dbd['remoteUri']);_0x334dbd['serverUrl']=intUtil['stripTrailingSlash'](_0x334dbd['serverUrl']);if(_0x4681ee&&_0x4681ee[_0xdd34('0x48')]){logger[_0xdd34('0x11')]('['+_0x535a56[_0xdd34('0x68')][_0xdd34('0x69')]()+']','Recording\x20is\x20enabled!');_0x535a56[_0xdd34('0x4b')]=util['format'](_0xdd34('0x4c'),_0x334dbd['serverUrl'],_0x535a56['uniqueid'],md5(_0x535a56[_0xdd34('0x4d')]));}else{_0x535a56[_0xdd34('0x4b')]='';}headers[_0xdd34('0x4e')]=getAuth(_0x334dbd);return getUser(_0x334dbd)['then'](function(_0x215cbe){_0x16f108=_0x215cbe;logger['info'](_0xdd34('0x50'),_0x16f108['id']);return getEndUser(_0x334dbd,_0x535a56[_0xdd34('0x6a')],_0x535a56['calleridnum']);})['then'](function(_0x44a109){_0x1a0568=_0x44a109;logger[_0xdd34('0x11')](_0xdd34('0x6b'),_0x1a0568['id']);return getTicket(_0x334dbd,_0x16f108,_0x1a0568,_0x1f31fd,_0x535a56);})[_0xdd34('0x10')](function(_0x296a80){if(_0x296a80){logger[_0xdd34('0x11')](_0xdd34('0x52'),_0x296a80['id']);}})[_0xdd34('0x5d')](function(_0x4da6f7){logger[_0xdd34('0x5c')]('['+_0x535a56['lastevent'][_0xdd34('0x69')]()+']'+_0xdd34('0x6c'),util[_0xdd34('0x5f')](_0x4da6f7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xecfc=['../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','name','getString','Descriptions','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','string','nameField','picklist','type','idField','customField','custom_fields','push','content','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util'];(function(_0x9fed29,_0x3ace4b){var _0x4f352d=function(_0x86012){while(--_0x86012){_0x9fed29['push'](_0x9fed29['shift']());}};_0x4f352d(++_0x3ace4b);}(_0xecfc,0x6d));var _0xcecf=function(_0x4a37d9,_0x2f8925){_0x4a37d9=_0x4a37d9-0x0;var _0xad0655=_0xecfc[_0x4a37d9];return _0xad0655;};'use strict';var _=require(_0xcecf('0x0'));var rp=require(_0xcecf('0x1'));var md5=require('md5');var util=require(_0xcecf('0x2'));var Redis=require(_0xcecf('0x3'));var intUtil=require(_0xcecf('0x4'));var config=require(_0xcecf('0x5'));var logger=require(_0xcecf('0x6'))(_0xcecf('0x7'));config[_0xcecf('0x8')]=_[_0xcecf('0x9')](config[_0xcecf('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xcecf('0xa'))(new Redis(config['redis']));function emit(_0x15bbf2,_0x5fa148,_0x59bd11){io['to'](_0x15bbf2)[_0xcecf('0xb')](_0x5fa148,_0x59bd11);}var headers={'Content-Type':_0xcecf('0xc'),'Accept':_0xcecf('0xc')};function getTicket(_0x2315fc,_0x43be3b,_0x581bbb,_0x425235,_0x52f709){logger['info'](_0xcecf('0xd'));return request({'uri':util[_0xcecf('0xe')](_0xcecf('0xf'),_0x2315fc['remoteUri']),'method':_0xcecf('0x10'),'body':{'ticket':_[_0xcecf('0x11')]({'requester_id':_0x581bbb['id'],'submitter_id':_0x43be3b?_0x43be3b['id']:undefined,'assignee_id':_0x43be3b?_0x43be3b['id']:undefined,'tags':getTags(_0x425235['Tags'],_0xcecf('0x12')),'subject':intUtil[_0xcecf('0x13')](_0x425235['Subjects'],_0x52f709,'\x20'),'description':intUtil[_0xcecf('0x13')](_0x425235[_0xcecf('0x14')],_0x52f709,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x425235[_0xcecf('0x14')],_0x52f709,'\x0a')}},getCustomFields(_0x425235['Fields'],_0x52f709))}})[_0xcecf('0x15')](function(_0xea4dde){logger[_0xcecf('0x16')](_0xcecf('0x17'));return _0xea4dde[_0xcecf('0x18')];});}function getUser(_0xd7769d,_0xaa8f2c){if(intUtil['validateEmail'](_0xaa8f2c)){logger['info'](_0xcecf('0x19'),_0xaa8f2c);return request({'uri':util['format'](_0xcecf('0x1a'),_0xd7769d[_0xcecf('0x1b')]),'qs':{'query':util[_0xcecf('0xe')](_0xcecf('0x1c'),_0xaa8f2c)}})[_0xcecf('0x15')](function(_0x3d3078){if(_0x3d3078[_0xcecf('0x1d')]){logger[_0xcecf('0x16')](_0xcecf('0x1e'));return _[_0xcecf('0x1f')](_0x3d3078[_0xcecf('0x20')],{'email':_0xaa8f2c,'role':'agent'});}else{logger['info'](_0xcecf('0x21'));return request({'uri':util[_0xcecf('0xe')]('%s/users/me.json',_0xd7769d[_0xcecf('0x1b')])})[_0xcecf('0x15')](function(_0x57ff36){logger[_0xcecf('0x16')](_0xcecf('0x22'));return _0x57ff36[_0xcecf('0x23')];});}});}else{logger[_0xcecf('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcecf('0xe')]('%s/users/me.json',_0xd7769d[_0xcecf('0x1b')])})[_0xcecf('0x15')](function(_0x311d95){logger[_0xcecf('0x16')]('Admin\x20account\x20selected.');return _0x311d95[_0xcecf('0x23')];});}}function getEndUser(_0x9c7a85,_0x5b71b1,_0x275ecb){logger[_0xcecf('0x16')](_0xcecf('0x24'),_0x275ecb);return request({'uri':util['format'](_0xcecf('0x1a'),_0x9c7a85['remoteUri']),'qs':{'query':util['format'](_0xcecf('0x25'),_0x275ecb)}})['then'](function(_0x48a99b){var _0x2f9d72;if(_0x48a99b[_0xcecf('0x20')][_0xcecf('0x26')]){_0x48a99b[_0xcecf('0x20')]=_[_0xcecf('0x27')](_0x48a99b['results'],{'suspended':![],'role':_0xcecf('0x28')});if(_0x48a99b['results'][_0xcecf('0x26')]){_0x2f9d72=_[_0xcecf('0x29')](_0x48a99b[_0xcecf('0x20')]);}}if(_0x2f9d72){logger['info'](_0xcecf('0x2a'));return _0x2f9d72;}else{logger[_0xcecf('0x16')](_0xcecf('0x2b'));return request({'uri':util[_0xcecf('0xe')](_0xcecf('0x2c'),_0x9c7a85[_0xcecf('0x1b')]),'method':_0xcecf('0x10'),'body':{'user':{'role':_0xcecf('0x28'),'name':util[_0xcecf('0xe')](_0xcecf('0x2d'),_0x5b71b1||_0x275ecb),'phone':_0x275ecb}}})[_0xcecf('0x15')](function(_0x469268){logger[_0xcecf('0x16')](_0xcecf('0x2e'));return _0x469268[_0xcecf('0x23')];});}});}function getAuth(_0x318d72){var _0x3f4b6f;if(_0x318d72['authType']===_0xcecf('0x2f')){_0x3f4b6f=util[_0xcecf('0xe')](_0xcecf('0x30'),_0x318d72[_0xcecf('0x31')],_0x318d72['password']);}else if(_0x318d72[_0xcecf('0x32')]===_0xcecf('0x33')){_0x3f4b6f=util[_0xcecf('0xe')](_0xcecf('0x34'),_0x318d72[_0xcecf('0x31')],_0x318d72[_0xcecf('0x33')]);}return util[_0xcecf('0xe')](_0xcecf('0x35'),new Buffer(_0x3f4b6f)[_0xcecf('0x36')](_0xcecf('0x37')));}function request(_0x132594){logger[_0xcecf('0x38')]('[HTTP]',JSON[_0xcecf('0x39')](_0x132594));return rp(_['defaults'](_0x132594,{'method':_0xcecf('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x2e3989,_0xae5090){var _0x491346=[];if(_0x2e3989&&_0x2e3989[_0xcecf('0x26')]>0x0){_0x491346=_[_0xcecf('0x3b')](_0x2e3989,_0xae5090);}return _0x491346;}function getCustomFields(_0x5f1729,_0x3cf685){var _0x10ea58=[];var _0x27dbab={'custom_fields':[]};if(_0x5f1729[_0xcecf('0x26')]>0x0){_['forEach'](_0x5f1729,function(_0x455929){if(_['includes']([_0xcecf('0x3c'),'picklist'],_0x455929['type'])&&_0x455929[_0xcecf('0x3d')]&&!_0x455929['customField']){_0x27dbab[_0x455929['nameField']['toLowerCase']()]=_0x455929['content']['toString']();}else if(_['includes']([_0xcecf('0x3c'),_0xcecf('0x3e')],_0x455929[_0xcecf('0x3f')])&&_0x455929[_0xcecf('0x40')]&&_0x455929[_0xcecf('0x41')]){_0x27dbab[_0xcecf('0x42')][_0xcecf('0x43')]({'id':_0x455929[_0xcecf('0x40')],'value':_0x455929[_0xcecf('0x44')]['toString']()});}else if(_0x455929[_0xcecf('0x3f')]===_0xcecf('0x45')&&_0x455929[_0xcecf('0x46')]&&_0x455929[_0xcecf('0x40')]&&_0x455929[_0xcecf('0x41')]){_0x3cf685[_0x455929[_0xcecf('0x46')]]&&_0x27dbab['custom_fields'][_0xcecf('0x43')]({'id':_0x455929['idField'],'value':_0x3cf685[_0x455929[_0xcecf('0x46')]]['toString']()});}else if(_0x455929[_0xcecf('0x3f')]==='customVariable'&&_0x455929[_0xcecf('0x47')]&&_0x455929['Variable']['name']&&_0x455929[_0xcecf('0x40')]&&_0x455929[_0xcecf('0x41')]){_0x3cf685[_0x455929[_0xcecf('0x47')][_0xcecf('0x12')]['toLowerCase']()]&&_0x27dbab[_0xcecf('0x42')]['push']({'id':_0x455929[_0xcecf('0x40')],'value':_0x3cf685[_0x455929[_0xcecf('0x47')][_0xcecf('0x12')][_0xcecf('0x48')]()][_0xcecf('0x36')]()});}});}return _0x27dbab;}exports[_0xcecf('0x49')]=function(_0x4844da,_0x5e93b7,_0x1cf885,_0x8e7f52,_0x60be94,_0x2e8e04){var _0x151868,_0x3cba4a;_0x2e8e04[_0xcecf('0x1b')]=intUtil[_0xcecf('0x4a')](_0x2e8e04['remoteUri']);_0x2e8e04[_0xcecf('0x4b')]=intUtil[_0xcecf('0x4a')](_0x2e8e04[_0xcecf('0x4b')]);if(_0x60be94&&_0x60be94[_0xcecf('0x4c')]){logger[_0xcecf('0x16')](_0xcecf('0x4d'),_0xcecf('0x4e'));_0x5e93b7[_0xcecf('0x4f')]=util['format'](_0xcecf('0x50'),_0x2e8e04[_0xcecf('0x4b')],_0x5e93b7[_0xcecf('0x51')],md5(_0x5e93b7[_0xcecf('0x51')]));}else{_0x5e93b7[_0xcecf('0x4f')]='';}headers[_0xcecf('0x52')]=getAuth(_0x2e8e04);return getUser(_0x2e8e04,_0x8e7f52['email'])['then'](function(_0x461890){_0x151868=_0x461890;logger[_0xcecf('0x16')]('The\x20User\x20ID\x20is:',_0x151868['id']);return getEndUser(_0x2e8e04,_0x5e93b7[_0xcecf('0x53')],_0x5e93b7[_0xcecf('0x54')]);})[_0xcecf('0x15')](function(_0x4454ec){_0x3cba4a=_0x4454ec;logger[_0xcecf('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3cba4a['id']);return getTicket(_0x2e8e04,_0x151868,_0x3cba4a,_0x1cf885,_0x5e93b7);})['then'](function(_0x5c7be5){if(_0x5c7be5){logger['info'](_0xcecf('0x55'),_0x5c7be5['id']);switch(_0x2e8e04[_0xcecf('0x3f')]){case _0xcecf('0x56'):logger['info']('[QUEUE]',_0xcecf('0x57'));return request({'uri':util[_0xcecf('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2e8e04[_0xcecf('0x1b')],_0x151868['id'],_0x5c7be5['id']),'method':_0xcecf('0x10')});case _0xcecf('0x58'):logger['info'](_0xcecf('0x4d'),_0xcecf('0x59'));emit(util[_0xcecf('0xe')](_0xcecf('0x5a'),_0x8e7f52[_0xcecf('0x12')]),_0xcecf('0x5b'),{'uri':util[_0xcecf('0xe')](_0xcecf('0x5c'),_0x2e8e04['remoteUri'][_0xcecf('0x5d')](_0xcecf('0x5e'),''),_0x5c7be5['id'])});break;default:logger[_0xcecf('0x5f')](_0xcecf('0x4d'),_0xcecf('0x60'));}}})[_0xcecf('0x61')](function(_0x22cbb8){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x22cbb8,{'showHidden':!![],'depth':null}));});};exports[_0xcecf('0x62')]=function(_0xe3d15f,_0x7a65bf,_0xf12e85,_0x26af41,_0x1d6c97,_0x72b3c5,_0x2c08cf){var _0x91ebee,_0x44c250;_0x72b3c5['remoteUri']=intUtil[_0xcecf('0x4a')](_0x72b3c5[_0xcecf('0x1b')]);_0x72b3c5[_0xcecf('0x4b')]=intUtil['stripTrailingSlash'](_0x72b3c5['serverUrl']);if(_0x2c08cf&&_0x2c08cf[_0xcecf('0x63')]&&_0x2c08cf[_0xcecf('0x63')]!==_0xcecf('0x64')){logger[_0xcecf('0x16')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x7a65bf[_0xcecf('0x4f')]=util[_0xcecf('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x72b3c5['serverUrl'],_0x7a65bf[_0xcecf('0x51')],md5(_0x7a65bf[_0xcecf('0x51')]));}headers[_0xcecf('0x52')]=getAuth(_0x72b3c5);return getUser(_0x72b3c5,_0x26af41[_0xcecf('0x65')])['then'](function(_0x27052d){_0x91ebee=_0x27052d;logger[_0xcecf('0x16')]('The\x20User\x20ID\x20is:',_0x91ebee['id']);return getEndUser(_0x72b3c5,_0x7a65bf[_0xcecf('0x66')],_0x7a65bf[_0xcecf('0x67')]);})[_0xcecf('0x15')](function(_0x724a47){_0x44c250=_0x724a47;logger[_0xcecf('0x16')](_0xcecf('0x68'),_0x44c250['id']);return getTicket(_0x72b3c5,_0x91ebee,_0x44c250,_0xf12e85,_0x7a65bf);})['then'](function(_0x2d67cf){if(_0x2d67cf){logger[_0xcecf('0x16')](_0xcecf('0x55'),_0x2d67cf['id']);switch(_0x72b3c5[_0xcecf('0x3f')]){case _0xcecf('0x56'):logger[_0xcecf('0x16')](_0xcecf('0x69'),_0xcecf('0x57'));return request({'uri':util[_0xcecf('0xe')](_0xcecf('0x6a'),_0x72b3c5[_0xcecf('0x1b')],_0x91ebee['id'],_0x2d67cf['id']),'method':_0xcecf('0x10')});case _0xcecf('0x58'):logger[_0xcecf('0x16')](_0xcecf('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcecf('0xe')](_0xcecf('0x5a'),_0x26af41[_0xcecf('0x12')]),_0xcecf('0x5b'),{'uri':util['format'](_0xcecf('0x5c'),_0x72b3c5[_0xcecf('0x1b')]['replace'](_0xcecf('0x5e'),''),_0x2d67cf['id'])});break;default:logger['error'](_0xcecf('0x69'),_0xcecf('0x60'));}}})[_0xcecf('0x61')](function(_0x215581){logger[_0xcecf('0x5f')](_0xcecf('0x6b'),util[_0xcecf('0x6c')](_0x215581,{'showHidden':!![],'depth':null}));});};exports[_0xcecf('0x6d')]=function(_0x2d9c2d,_0x533b68,_0x31f4cc,_0x3c94df,_0x154ca5,_0x613c9b){var _0x385b06,_0x4b7f1c;_0x613c9b[_0xcecf('0x1b')]=intUtil[_0xcecf('0x4a')](_0x613c9b[_0xcecf('0x1b')]);_0x613c9b['serverUrl']=intUtil[_0xcecf('0x4a')](_0x613c9b['serverUrl']);if(_0x154ca5&&_0x154ca5[_0xcecf('0x4c')]){logger[_0xcecf('0x16')]('['+_0x533b68[_0xcecf('0x6e')][_0xcecf('0x6f')]()+']',_0xcecf('0x4e'));_0x533b68[_0xcecf('0x4f')]=util['format'](_0xcecf('0x50'),_0x613c9b[_0xcecf('0x4b')],_0x533b68['uniqueid'],md5(_0x533b68[_0xcecf('0x51')]));}else{_0x533b68[_0xcecf('0x4f')]='';}headers[_0xcecf('0x52')]=getAuth(_0x613c9b);return getUser(_0x613c9b)[_0xcecf('0x15')](function(_0x39f800){_0x385b06=_0x39f800;logger[_0xcecf('0x16')](_0xcecf('0x70'),_0x385b06['id']);return getEndUser(_0x613c9b,_0x533b68[_0xcecf('0x53')],_0x533b68['calleridnum']);})[_0xcecf('0x15')](function(_0x5614ed){_0x4b7f1c=_0x5614ed;logger[_0xcecf('0x16')]('The\x20Enduser\x20ID\x20is:',_0x4b7f1c['id']);return getTicket(_0x613c9b,_0x385b06,_0x4b7f1c,_0x31f4cc,_0x533b68);})[_0xcecf('0x15')](function(_0x3763df){if(_0x3763df){logger[_0xcecf('0x16')]('The\x20Ticket\x20ID\x20is:',_0x3763df['id']);}})['catch'](function(_0x4fd0b3){logger[_0xcecf('0x5f')]('['+_0x533b68[_0xcecf('0x6e')]['toUpperCase']()+']'+_0xcecf('0x71'),util['inspect'](_0x4fd0b3,{'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 3bc4a36..e471779 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 _0xe845=['profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','role','first_name','last_name','code','details','startCase','moduleCreate','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','https://www.zohoapis.','Contacts','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','Call_Duration','talktime','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Called','connect','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','[OUTBOUND]','https://crm.','unmanaged','toUpperCase','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','picklist','type','content','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','access_token','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator'];(function(_0x3e5116,_0x214c7f){var _0x218bdf=function(_0x25374d){while(--_0x25374d){_0x3e5116['push'](_0x3e5116['shift']());}};_0x218bdf(++_0x214c7f);}(_0xe845,0x101));var _0x5e84=function(_0x280ee2,_0x33e8d5){_0x280ee2=_0x280ee2-0x0;var _0x558bc3=_0xe845[_0x280ee2];return _0x558bc3;};'use strict';var _=require('lodash');var rp=require(_0x5e84('0x0'));var md5=require('md5');var util=require(_0x5e84('0x1'));var intUtil=require(_0x5e84('0x2'));var moment=require(_0x5e84('0x3'));var Redis=require(_0x5e84('0x4'));var BPromise=require(_0x5e84('0x5'));var config=require('../../../../config/environment');var logger=require(_0x5e84('0x6'))('zoho');config[_0x5e84('0x7')]=_[_0x5e84('0x8')](config[_0x5e84('0x7')],{'host':_0x5e84('0x9'),'port':0x18eb});var io=require(_0x5e84('0xa'))(new Redis(config['redis']));function emit(_0x1a2437,_0x319cb3,_0x331588){io['to'](_0x1a2437)[_0x5e84('0xb')](_0x319cb3,_0x331588);}function request(_0x38c274){logger[_0x5e84('0xc')]('[HTTP]',JSON[_0x5e84('0xd')](_0x38c274));return rp(_0x38c274);}function getCustomFields(_0x31bc2e,_0x5b1c98){var _0x425738={};if(_0x31bc2e[_0x5e84('0xe')]>0x0){_[_0x5e84('0xf')](_0x31bc2e,function(_0x3dd408){if(_[_0x5e84('0x10')]([_0x5e84('0x11'),_0x5e84('0x12')],_0x3dd408[_0x5e84('0x13')])&&_0x3dd408['idField']){_0x425738[_0x3dd408['idField']]=_0x3dd408[_0x5e84('0x14')][_0x5e84('0x15')]();}else if(_0x3dd408[_0x5e84('0x13')]===_0x5e84('0x16')&&_0x3dd408[_0x5e84('0x17')]&&_0x3dd408[_0x5e84('0x18')]&&_0x5b1c98[_0x3dd408[_0x5e84('0x17')]]){_0x425738[_0x3dd408[_0x5e84('0x18')]]=_0x5b1c98[_0x3dd408[_0x5e84('0x17')]][_0x5e84('0x15')]();}else if(_0x3dd408[_0x5e84('0x13')]===_0x5e84('0x19')&&_0x3dd408[_0x5e84('0x1a')]&&_0x3dd408[_0x5e84('0x1a')][_0x5e84('0x1b')]&&_0x3dd408['idField']&&_0x5b1c98[_0x3dd408[_0x5e84('0x1a')]['name'][_0x5e84('0x1c')]()]){_0x425738[_0x3dd408[_0x5e84('0x18')]]=_0x5b1c98[_0x3dd408[_0x5e84('0x1a')][_0x5e84('0x1b')][_0x5e84('0x1c')]()][_0x5e84('0x15')]();}});}return _0x425738;}function getName(_0x5a75f6){if(_0x5a75f6[_0x5e84('0x1d')]('\x20')>0x0){var _0x807842=_0x5a75f6[_0x5e84('0x1e')](/ (.+)/);if(_0x807842[0x1]){return _0x807842;}}return[_0x5a75f6,_0x5a75f6];}var accountsTokens={};function getAccessToken(_0x341889){return new Promise(function(_0x4bb679,_0x6c14d5){if(!_[_0x5e84('0x1f')](accountsTokens[_0x341889['id']])&&!_['isNil'](accountsTokens[_0x341889['id']]['access_token'])){if(moment()[_0x5e84('0x20')](accountsTokens[_0x341889['id']]['expires_in'])){_0x4bb679(accountsTokens[_0x341889['id']][_0x5e84('0x21')]);}}var _0x30a5cc;switch(_0x341889[_0x5e84('0x22')]){case'US':_0x30a5cc='https://accounts.zoho.com';break;case'AU':_0x30a5cc='https://accounts.zoho.com.au';break;case'EU':_0x30a5cc=_0x5e84('0x23');break;case'IN':_0x30a5cc=_0x5e84('0x24');break;case'CN':_0x30a5cc=_0x5e84('0x25');break;default:_0x30a5cc=_0x5e84('0x23');break;}var _0x3e0b0d={'method':_0x5e84('0x26'),'uri':_0x30a5cc+_0x5e84('0x27'),'qs':{'refresh_token':_0x341889[_0x5e84('0x28')],'client_id':_0x341889[_0x5e84('0x29')],'client_secret':_0x341889[_0x5e84('0x2a')],'grant_type':_0x5e84('0x2b')},'json':!![]};return rp(_0x3e0b0d)[_0x5e84('0x2c')](function(_0x2c34fe){accountsTokens[_0x341889['id']]={'access_token':_0x2c34fe['access_token'],'expires_in':moment()[_0x5e84('0x2d')](_0x2c34fe[_0x5e84('0x2e')],'seconds')};_0x4bb679(_0x2c34fe[_0x5e84('0x21')]);})[_0x5e84('0x2f')](function(_0x5cd025){logger[_0x5e84('0x30')](_0x5e84('0x31'),_0x5cd025[_0x5e84('0x32')]);_0x6c14d5(_0x5cd025);});});}function getUser(_0x193d17,_0x115667,_0xa1bcc4,_0x293cd2){logger['info'](_0x5e84('0x33'));return request({'method':_0x5e84('0x34'),'uri':util[_0x5e84('0x35')](_0x5e84('0x36'),_0x115667),'qs':{'type':_0x5e84('0x37')},'headers':{'Authorization':_0x5e84('0x38')+_0x193d17},'json':!![]})[_0x5e84('0x2c')](function(_0x1f0542){if(_0x1f0542[_0x5e84('0x39')]){var _0x27be3b=-0x1;if(_[_0x5e84('0x3a')](_0x1f0542[_0x5e84('0x39')])){if(!_[_0x5e84('0x1f')](_0x293cd2)){_0x27be3b=_['findIndex'](_0x1f0542['users'],function(_0x4e980f){return _0x4e980f['email']===_0x293cd2;});}if(_0x27be3b>=0x0){logger[_0x5e84('0x3b')](_0x5e84('0x3c'));}else{logger[_0x5e84('0x3b')](_0x5e84('0x3d'));_0x27be3b=_['findIndex'](_0x1f0542[_0x5e84('0x39')],function(_0x5233f4){return _0x5233f4['profile']['name']===_0x5e84('0x3e');});}return _0x1f0542[_0x5e84('0x39')][_0x27be3b];}else{if(_0x1f0542['user'][_0x5e84('0x3f')][_0x5e84('0x1b')]===_0x5e84('0x3e')){logger[_0x5e84('0x3b')](_0x5e84('0x3d'));user=_0x1f0542['user'];return user;}else{logger[_0x5e84('0x30')](_0x5e84('0x40'),JSON[_0x5e84('0xd')](_0x1f0542));throw new Error(_0x5e84('0x41')+JSON[_0x5e84('0xd')](_0x1f0542));}}}else{logger['error'](_0x5e84('0x40'),JSON[_0x5e84('0xd')](_0x1f0542));throw new Error(_0x5e84('0x41')+JSON[_0x5e84('0xd')](_0x1f0542));}})['catch'](function(_0x5829b5){console['error'](_0x5829b5);});}function getZohoUser(_0x9a6dc5,_0x529a70){return new BPromise(function(_0x2436c,_0x3f7230){request(_0x9a6dc5)[_0x5e84('0x2c')](function(_0x371af0){var _0x2de774=null;if(_0x371af0){_0x2de774=_0x371af0[_0x5e84('0x42')][0x0];_0x2de774[_0x5e84('0x43')]=_0x529a70;}_0x2436c(_0x2de774);})[_0x5e84('0x2f')](function(_0x1e7ceb){_0x3f7230(_0x1e7ceb);});});}function createEndUser(_0x53965b,_0x48ea23,_0x5c9e32,_0x15155c,_0x32eaad,_0x2be375){var _0x5c9e32=getName(_0x5c9e32);return request({'method':_0x5e84('0x26'),'uri':'https://www.zohoapis.'+_0x48ea23+_0x5e84('0x44')+_['startCase'](_0x2be375['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5c9e32[0x1],'First_Name':_0x5c9e32[0x0],'Phone':_0x15155c,'Owner':{'name':!_[_0x5e84('0x1f')](_0x32eaad[_0x5e84('0x45')]['name'])?_0x32eaad[_0x5e84('0x45')][_0x5e84('0x1b')]:!_[_0x5e84('0x1f')](_0x32eaad[_0x5e84('0x46')])?_0x32eaad[_0x5e84('0x46')]+'\x20'+_0x32eaad[_0x5e84('0x47')]:_0x32eaad[_0x5e84('0x47')],'id':_0x32eaad['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x53965b},'json':!![]})[_0x5e84('0x2c')](function(_0x562938){if(_0x562938&&_0x562938[_0x5e84('0x42')][0x0][_0x5e84('0x48')]==='SUCCESS'){var _0x398b1e=_0x562938[_0x5e84('0x42')][0x0][_0x5e84('0x49')];_0x398b1e[_0x5e84('0x43')]=_[_0x5e84('0x4a')](_0x2be375[_0x5e84('0x4b')])+'s';return _0x398b1e;}logger[_0x5e84('0x30')](_0x5e84('0x40'),JSON[_0x5e84('0xd')](data));throw new Error('Error:\x20'+JSON[_0x5e84('0xd')](data));})[_0x5e84('0x2f')](function(_0x31f8a4){console[_0x5e84('0x4c')](_0x5e84('0x4d'),_0x31f8a4);});}function getEndUser(_0x2bc6e4,_0x323753,_0x801832,_0x3be09c,_0x426362,_0x45edd1,_0x5c2cf6){var _0x3ce15d={'method':_0x5e84('0x34'),'uri':'','headers':{'Authorization':_0x5e84('0x38')+_0x2bc6e4},'json':!![]};switch(_0x5c2cf6[_0x5e84('0x4e')]){case _0x5e84('0x4f'):_0x3ce15d[_0x5e84('0x50')]='https://www.zohoapis.'+_0x323753+_0x5e84('0x51')+_0x426362+'))';return getZohoUser(_0x3ce15d,'Contacts')[_0x5e84('0x2c')](function(_0x474f71){if(_0x474f71)return _0x474f71;_0x3ce15d[_0x5e84('0x50')]='https://www.zohoapis.'+_0x323753+_0x5e84('0x52')+_0x426362+'))';return getZohoUser(_0x3ce15d,'Leads')[_0x5e84('0x2c')](function(_0x4aca28){if(_0x4aca28)return _0x4aca28;if(_0x5c2cf6[_0x5e84('0x4b')]!=_0x5e84('0x53')){return createEndUser(_0x2bc6e4,_0x323753,_0x3be09c,_0x426362,_0x45edd1,_0x5c2cf6);}else{return{};}});});break;case _0x5e84('0x54'):_0x3ce15d[_0x5e84('0x50')]=_0x5e84('0x55')+_0x323753+_0x5e84('0x51')+_0x426362+'))';return getZohoUser(_0x3ce15d,_0x5e84('0x56'))[_0x5e84('0x2c')](function(_0x567744){if(_0x567744)return _0x567744;if(_0x5c2cf6['moduleCreate']!=_0x5e84('0x53')){return createEndUser(_0x2bc6e4,_0x323753,_0x3be09c,_0x426362,_0x45edd1,_0x5c2cf6);}else{return{};}});break;case'lead':_0x3ce15d[_0x5e84('0x50')]=_0x5e84('0x55')+_0x323753+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x426362+'))';return getZohoUser(_0x3ce15d,'Leads')['then'](function(_0x1e3777){if(_0x1e3777)return _0x1e3777;if(_0x5c2cf6[_0x5e84('0x4b')]!=_0x5e84('0x53')){return createEndUser(_0x2bc6e4,_0x323753,_0x3be09c,_0x426362,_0x45edd1,_0x5c2cf6);}else{return{};}});break;}}function getCall(_0x11b3db,_0x22353d,_0x51245e,_0x2a7aa7,_0x5527fa,_0x4ae99d,_0x508e55,_0x36dee0){logger[_0x5e84('0x3b')](_0x5e84('0x57'));var _0x418de8={};_0x418de8[_0x5e84('0x58')]={'name':!_[_0x5e84('0x1f')](_0x2a7aa7[_0x5e84('0x45')][_0x5e84('0x1b')])&&!_[_0x5e84('0x1f')](_0x2a7aa7['profile'][_0x5e84('0x1b')])&&_0x2a7aa7[_0x5e84('0x3f')][_0x5e84('0x1b')]===_0x5e84('0x59')?_0x2a7aa7['role'][_0x5e84('0x1b')]:!_['isNil'](_0x2a7aa7[_0x5e84('0x46')])?_0x2a7aa7['first_name']+'\x20'+_0x2a7aa7[_0x5e84('0x47')]:_0x2a7aa7[_0x5e84('0x47')],'id':_0x2a7aa7['id']};_0x418de8[_0x5e84('0x5a')]=intUtil[_0x5e84('0x5b')](_0x4ae99d[_0x5e84('0x5c')],_0x508e55,'\x20');_0x418de8[_0x5e84('0x5d')]=intUtil['getString'](_0x4ae99d[_0x5e84('0x5e')],_0x508e55,'\x0a');if(_0x5527fa['enduserType']===_0x5e84('0x56')){_0x418de8[_0x5e84('0x5f')]={'name':!_['isNil'](_0x5527fa[_0x5e84('0x60')])?_0x5527fa['Full_Name']:!_[_0x5e84('0x1f')](_0x5527fa[_0x5e84('0x61')])?_0x5527fa[_0x5e84('0x61')]+'\x20'+_0x5527fa[_0x5e84('0x62')]:_0x5527fa[_0x5e84('0x62')],'id':_0x5527fa['id']};}if(_0x5527fa[_0x5e84('0x43')]===_0x5e84('0x63')){_0x418de8[_0x5e84('0x64')]={'name':!_[_0x5e84('0x1f')](_0x5527fa[_0x5e84('0x60')])?_0x5527fa[_0x5e84('0x60')]:!_[_0x5e84('0x1f')](_0x5527fa[_0x5e84('0x61')])?_0x5527fa[_0x5e84('0x61')]+'\x20'+_0x5527fa[_0x5e84('0x62')]:_0x5527fa['Last_Name'],'id':_0x5527fa['id']};_0x418de8[_0x5e84('0x65')]=_['startCase'](_0x5527fa['enduserType']);}if(_0x508e55['talktime']){_0x418de8[_0x5e84('0x66')]=moment['utc'](parseInt(_0x508e55[_0x5e84('0x67')])*0x3e8)[_0x5e84('0x35')](_0x5e84('0x68'));}else if(_0x508e55['answertime']&&_0x508e55[_0x5e84('0x69')]){_0x418de8[_0x5e84('0x66')]=moment[_0x5e84('0x6a')](moment(_0x508e55[_0x5e84('0x69')],_0x5e84('0x6b'))[_0x5e84('0x6c')](moment(_0x508e55[_0x5e84('0x6d')],_0x5e84('0x6b'))))[_0x5e84('0x35')](_0x5e84('0x68'));}switch(_0x508e55['lastevent']){case _0x5e84('0x6e'):_0x418de8['Call_Result']=_0x5e84('0x6f');break;case'complete':case _0x5e84('0x70'):_0x418de8[_0x5e84('0x71')]=_0x5e84('0x72');break;case _0x5e84('0x73'):_0x418de8[_0x5e84('0x71')]=_0x5e84('0x74');break;case _0x5e84('0x75'):_0x418de8[_0x5e84('0x71')]='Abandoned';break;case _0x5e84('0x76'):_0x418de8['Call_Result']=_0x5e84('0x77');default:}_0x418de8[_0x5e84('0x78')]=(_0x36dee0==='outbound'?moment(_0x508e55[_0x5e84('0x6d')])[_0x5e84('0x35')](_0x5e84('0x6b')):moment(_0x508e55[_0x5e84('0x79')])[_0x5e84('0x35')](_0x5e84('0x6b')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x418de8[_0x5e84('0x7a')]=_0x36dee0||_0x5e84('0x7b');_0x418de8=_[_0x5e84('0x7c')](_0x418de8,getCustomFields(_0x4ae99d[_0x5e84('0x7d')],_0x508e55));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x22353d+_0x5e84('0x7e'),'headers':{'Authorization':_0x5e84('0x38')+_0x11b3db},'body':{'data':[_0x418de8]},'json':!![]})[_0x5e84('0x2c')](function(_0x1e51ae){if(_0x1e51ae&&_0x1e51ae[_0x5e84('0x42')][0x0][_0x5e84('0x48')]===_0x5e84('0x7f')){logger[_0x5e84('0x3b')](_0x5e84('0x80'));return{'id':_0x1e51ae[_0x5e84('0x42')][0x0][_0x5e84('0x49')]['id']};}})[_0x5e84('0x2f')](function(_0x8e5244){logger['info'](_0x5e84('0x81'),_0x8e5244['stack']);console['log'](_0x5e84('0x81'),_0x8e5244);});}exports[_0x5e84('0x82')]=function(_0x5342ae,_0x5e7540,_0x252d35,_0x3f817d,_0xbf3809,_0x1b7fb2){var _0x4ef64b,_0x4f7b47,_0x3090b3;_0x1b7fb2[_0x5e84('0x83')]=intUtil[_0x5e84('0x84')](_0x1b7fb2['host']);_0x1b7fb2[_0x5e84('0x85')]=intUtil[_0x5e84('0x84')](_0x1b7fb2[_0x5e84('0x85')]);if(_0xbf3809&&_0xbf3809[_0x5e84('0x86')]){logger['info'](_0x5e84('0x87'),_0x5e84('0x88'));_0x5e7540[_0x5e84('0x89')]=_0x1b7fb2['serverUrl']+_0x5e84('0x8a')+_0x5e7540[_0x5e84('0x8b')]+_0x5e84('0x8c')+md5(_0x5e7540[_0x5e84('0x8b')]);}else{_0x5e7540['recordingURL']='';}var _0x3765e9=_0x1b7fb2[_0x5e84('0x83')]===_0x5e84('0x8d')?'eu':_0x5e84('0x8e');return getAccessToken(_0x1b7fb2)[_0x5e84('0x2c')](function(_0x44c462){_0x3090b3=_0x44c462;return getUser(_0x3090b3,_0x3765e9,_0x1b7fb2,_0x3f817d[_0x5e84('0x8f')]);})[_0x5e84('0x2c')](function(_0x1424b1){_0x4ef64b=_0x1424b1;logger[_0x5e84('0x3b')](_0x5e84('0x90'),_0x4ef64b['id']);return getEndUser(_0x3090b3,_0x3765e9,_0x1b7fb2,_0x5e7540[_0x5e84('0x91')],_0x5e7540['calleridnum'],_0x4ef64b,_0x252d35);})[_0x5e84('0x2c')](function(_0x1513fe){_0x4f7b47=_0x1513fe;return getCall(_0x3090b3,_0x3765e9,_0x1b7fb2,_0x4ef64b,_0x4f7b47,_0x252d35,_0x5e7540,'Inbound');})[_0x5e84('0x2c')](function(_0x3bf8ff){if(_0x3bf8ff){logger[_0x5e84('0x3b')]('The\x20Call\x20ID\x20is:',_0x3bf8ff['id']);logger[_0x5e84('0x3b')](_0x5e84('0x87'),_0x5e84('0x92'));emit(util['format'](_0x5e84('0x93'),_0x3f817d['name']),_0x5e84('0x94'),{'uri':'https://crm.'+_0x1b7fb2[_0x5e84('0x83')]+_0x5e84('0x95')+_0x3bf8ff['id']});}})[_0x5e84('0x2f')](function(_0x1c0bd3){logger[_0x5e84('0x30')](_0x5e84('0x87'),JSON[_0x5e84('0xd')](_0x1c0bd3));});};exports[_0x5e84('0x96')]=function(_0x492c6c,_0x21b90e,_0x2ad34c,_0x198ed1,_0x573ce8,_0x213ad1,_0x2befc9){var _0x6b90e8,_0x46ce3d,_0x474499;_0x213ad1[_0x5e84('0x83')]=intUtil[_0x5e84('0x84')](_0x213ad1['host']);_0x213ad1[_0x5e84('0x85')]=intUtil[_0x5e84('0x84')](_0x213ad1[_0x5e84('0x85')]);if(_0x2befc9&&_0x2befc9[_0x5e84('0x97')]&&_0x2befc9[_0x5e84('0x97')]!==_0x5e84('0x98')){logger[_0x5e84('0x3b')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x21b90e[_0x5e84('0x89')]=_0x213ad1[_0x5e84('0x85')]+'/api/voice/recordings/'+_0x21b90e[_0x5e84('0x8b')]+_0x5e84('0x8c')+md5(_0x21b90e[_0x5e84('0x8b')]);}var _0x12bd02=_0x213ad1[_0x5e84('0x83')]===_0x5e84('0x8d')?'eu':'com';return getAccessToken(_0x213ad1)[_0x5e84('0x2c')](function(_0x368c64){_0x474499=_0x368c64;return getUser(_0x474499,_0x12bd02,_0x213ad1,_0x198ed1[_0x5e84('0x8f')]);})[_0x5e84('0x2c')](function(_0x2aec11){_0x6b90e8=_0x2aec11;logger[_0x5e84('0x3b')](_0x5e84('0x90'),_0x6b90e8['id']);return getEndUser(_0x474499,_0x12bd02,_0x213ad1,_0x21b90e[_0x5e84('0x99')],_0x21b90e[_0x5e84('0x9a')],_0x6b90e8,_0x2ad34c);})[_0x5e84('0x2c')](function(_0x4d62b5){_0x46ce3d=_0x4d62b5;return getCall(_0x474499,_0x12bd02,_0x213ad1,_0x6b90e8,_0x46ce3d,_0x2ad34c,_0x21b90e,'Outbound');})[_0x5e84('0x2c')](function(_0x47dc6a){if(_0x47dc6a){logger[_0x5e84('0x3b')](_0x5e84('0x9b'),_0x47dc6a['id']);logger[_0x5e84('0x3b')](_0x5e84('0x9c'),_0x5e84('0x92'));emit(util[_0x5e84('0x35')](_0x5e84('0x93'),_0x198ed1['name']),'trigger:browser:url',{'uri':_0x5e84('0x9d')+_0x213ad1[_0x5e84('0x83')]+_0x5e84('0x95')+_0x47dc6a['id']});}})['catch'](function(_0x3265d3){logger[_0x5e84('0x30')](_0x5e84('0x9c'),JSON[_0x5e84('0xd')](_0x3265d3));});};exports[_0x5e84('0x9e')]=function(_0x3318b2,_0x493d5c,_0x3a9fef,_0x37958f,_0x141dbc,_0x4cddc6){var _0x55da86,_0x379d95,_0x4bc03e;_0x4cddc6[_0x5e84('0x83')]=intUtil[_0x5e84('0x84')](_0x4cddc6['host']);_0x4cddc6['serverUrl']=intUtil[_0x5e84('0x84')](_0x4cddc6[_0x5e84('0x85')]);if(_0x141dbc&&_0x141dbc['monitor_format']){logger[_0x5e84('0x3b')]('['+_0x493d5c['lastevent'][_0x5e84('0x9f')]()+']','Recording\x20is\x20enabled!');_0x493d5c[_0x5e84('0x89')]=_0x4cddc6[_0x5e84('0x85')]+_0x5e84('0x8a')+_0x493d5c['uniqueid']+_0x5e84('0x8c')+md5(_0x493d5c[_0x5e84('0x8b')]);}else{_0x493d5c[_0x5e84('0x89')]='';}var _0x35d0a2=_0x4cddc6[_0x5e84('0x83')]===_0x5e84('0x8d')?'eu':'com';return getAccessToken(_0x4cddc6)[_0x5e84('0x2c')](function(_0x5d1112){_0x4bc03e=_0x5d1112;return getUser(_0x4bc03e,_0x35d0a2,_0x4cddc6);})['then'](function(_0x228160){_0x55da86=_0x228160;logger[_0x5e84('0x3b')](_0x5e84('0x90'),_0x55da86['id']);return getEndUser(_0x4bc03e,_0x35d0a2,_0x4cddc6,_0x493d5c['calleridname'],_0x493d5c['calleridnum'],_0x55da86,_0x3a9fef);})[_0x5e84('0x2c')](function(_0x22ca29){_0x379d95=_0x22ca29;return getCall(_0x4bc03e,_0x35d0a2,_0x4cddc6,_0x55da86,_0x379d95,_0x3a9fef,_0x493d5c,_0x5e84('0x7b'));})['then'](function(_0x37a108){if(_0x37a108){logger[_0x5e84('0x3b')](_0x5e84('0x9b'),_0x37a108['id']);}})[_0x5e84('0x2f')](function(_0x5c9207){logger[_0x5e84('0x30')]('['+_0x493d5c['lastevent'][_0x5e84('0x9f')]()+']',JSON[_0x5e84('0xd')](_0x5c9207));});}; \ No newline at end of file +var _0xfa1e=['Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','data','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','Contacts','Owner','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Call_Duration','utc','talktime','endtime','diff','YYYY-MM-DDTHH:mm:ss','called','Called','complete','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','starttime','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','stack','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientSecret','then','add','seconds','error'];(function(_0x272873,_0x349d5d){var _0x312427=function(_0x371da2){while(--_0x371da2){_0x272873['push'](_0x272873['shift']());}};_0x312427(++_0x349d5d);}(_0xfa1e,0x102));var _0xefa1=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xfa1e[_0x122e9b];return _0x22c247;};'use strict';var _=require(_0xefa1('0x0'));var rp=require(_0xefa1('0x1'));var md5=require(_0xefa1('0x2'));var util=require(_0xefa1('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xefa1('0x4'));var BPromise=require('bluebird');var config=require(_0xefa1('0x5'));var logger=require(_0xefa1('0x6'))(_0xefa1('0x7'));config[_0xefa1('0x8')]=_[_0xefa1('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xefa1('0xa'))(new Redis(config[_0xefa1('0x8')]));function emit(_0x39e16f,_0x221c9c,_0x4991f1){io['to'](_0x39e16f)['emit'](_0x221c9c,_0x4991f1);}function request(_0x2480ec){logger[_0xefa1('0xb')](_0xefa1('0xc'),JSON[_0xefa1('0xd')](_0x2480ec));return rp(_0x2480ec);}function getCustomFields(_0x180c4c,_0x146342){var _0x199bfe={};if(_0x180c4c[_0xefa1('0xe')]>0x0){_[_0xefa1('0xf')](_0x180c4c,function(_0x54d31e){if(_['includes']([_0xefa1('0x10'),_0xefa1('0x11')],_0x54d31e[_0xefa1('0x12')])&&_0x54d31e[_0xefa1('0x13')]){_0x199bfe[_0x54d31e['idField']]=_0x54d31e[_0xefa1('0x14')][_0xefa1('0x15')]();}else if(_0x54d31e[_0xefa1('0x12')]===_0xefa1('0x16')&&_0x54d31e[_0xefa1('0x17')]&&_0x54d31e[_0xefa1('0x13')]&&_0x146342[_0x54d31e['variableName']]){_0x199bfe[_0x54d31e[_0xefa1('0x13')]]=_0x146342[_0x54d31e[_0xefa1('0x17')]][_0xefa1('0x15')]();}else if(_0x54d31e['type']===_0xefa1('0x18')&&_0x54d31e[_0xefa1('0x19')]&&_0x54d31e[_0xefa1('0x19')][_0xefa1('0x1a')]&&_0x54d31e[_0xefa1('0x13')]&&_0x146342[_0x54d31e[_0xefa1('0x19')][_0xefa1('0x1a')][_0xefa1('0x1b')]()]){_0x199bfe[_0x54d31e[_0xefa1('0x13')]]=_0x146342[_0x54d31e[_0xefa1('0x19')][_0xefa1('0x1a')][_0xefa1('0x1b')]()][_0xefa1('0x15')]();}});}return _0x199bfe;}function getName(_0x20efff){if(_0x20efff[_0xefa1('0x1c')]('\x20')>0x0){var _0x331892=_0x20efff[_0xefa1('0x1d')](/ (.+)/);if(_0x331892[0x1]){return _0x331892;}}return[_0x20efff,_0x20efff];}var accountsTokens={};function getAccessToken(_0x507e98){return new Promise(function(_0x4b13ce,_0x3df071){if(!_[_0xefa1('0x1e')](accountsTokens[_0x507e98['id']])&&!_[_0xefa1('0x1e')](accountsTokens[_0x507e98['id']][_0xefa1('0x1f')])){if(moment()[_0xefa1('0x20')](accountsTokens[_0x507e98['id']][_0xefa1('0x21')])){_0x4b13ce(accountsTokens[_0x507e98['id']][_0xefa1('0x1f')]);}}var _0x5225b7;switch(_0x507e98[_0xefa1('0x22')]){case'US':_0x5225b7='https://accounts.zoho.com';break;case'AU':_0x5225b7=_0xefa1('0x23');break;case'EU':_0x5225b7='https://accounts.zoho.eu';break;case'IN':_0x5225b7=_0xefa1('0x24');break;case'CN':_0x5225b7=_0xefa1('0x25');break;default:_0x5225b7=_0xefa1('0x26');break;}var _0x10c776={'method':'POST','uri':_0x5225b7+_0xefa1('0x27'),'qs':{'refresh_token':_0x507e98[_0xefa1('0x28')],'client_id':_0x507e98['clientId'],'client_secret':_0x507e98[_0xefa1('0x29')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x10c776)[_0xefa1('0x2a')](function(_0x1e642a){accountsTokens[_0x507e98['id']]={'access_token':_0x1e642a[_0xefa1('0x1f')],'expires_in':moment()[_0xefa1('0x2b')](_0x1e642a[_0xefa1('0x21')],_0xefa1('0x2c'))};_0x4b13ce(_0x1e642a[_0xefa1('0x1f')]);})['catch'](function(_0x4c0f7b){logger[_0xefa1('0x2d')](_0xefa1('0x2e'),_0x4c0f7b['stack']);_0x3df071(_0x4c0f7b);});});}function getUser(_0x533c68,_0x3d7052,_0x484243,_0x3f5743){logger['info'](_0xefa1('0x2f'));return request({'method':_0xefa1('0x30'),'uri':util[_0xefa1('0x31')](_0xefa1('0x32'),_0x3d7052),'qs':{'type':_0xefa1('0x33')},'headers':{'Authorization':_0xefa1('0x34')+_0x533c68},'json':!![]})[_0xefa1('0x2a')](function(_0x51b198){if(_0x51b198[_0xefa1('0x35')]){var _0x58458b=-0x1;if(_[_0xefa1('0x36')](_0x51b198[_0xefa1('0x35')])){if(!_[_0xefa1('0x1e')](_0x3f5743)){_0x58458b=_['findIndex'](_0x51b198[_0xefa1('0x35')],function(_0x577f38){return _0x577f38[_0xefa1('0x37')]===_0x3f5743;});}if(_0x58458b>=0x0){logger[_0xefa1('0x38')](_0xefa1('0x39'));}else{logger[_0xefa1('0x38')](_0xefa1('0x3a'));_0x58458b=_['findIndex'](_0x51b198[_0xefa1('0x35')],function(_0x1c35d4){return _0x1c35d4['profile']['name']==='Administrator';});}return _0x51b198['users'][_0x58458b];}else{if(_0x51b198[_0xefa1('0x3b')][_0xefa1('0x3c')][_0xefa1('0x1a')]===_0xefa1('0x3d')){logger['info'](_0xefa1('0x3a'));user=_0x51b198['user'];return user;}else{logger[_0xefa1('0x2d')](_0xefa1('0x3e'),JSON[_0xefa1('0xd')](_0x51b198));throw new Error(_0xefa1('0x3f')+JSON[_0xefa1('0xd')](_0x51b198));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x51b198));throw new Error(_0xefa1('0x3f')+JSON[_0xefa1('0xd')](_0x51b198));}})[_0xefa1('0x40')](function(_0x5641fa){console[_0xefa1('0x2d')](_0x5641fa);});}function getZohoUser(_0x3d3600,_0x4ead91){return new BPromise(function(_0xed9d2b,_0x37641f){request(_0x3d3600)[_0xefa1('0x2a')](function(_0x138137){var _0x272def=null;if(_0x138137){_0x272def=_0x138137['data'][0x0];_0x272def[_0xefa1('0x41')]=_0x4ead91;}_0xed9d2b(_0x272def);})[_0xefa1('0x40')](function(_0xbd6bba){_0x37641f(_0xbd6bba);});});}function createEndUser(_0xa0f80a,_0x254ccc,_0x1db0c1,_0x5efaf7,_0x42d983,_0x17bd30){var _0x1db0c1=getName(_0x1db0c1);return request({'method':_0xefa1('0x42'),'uri':_0xefa1('0x43')+_0x254ccc+'/crm/v2/'+_[_0xefa1('0x44')](_0x17bd30['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1db0c1[0x1],'First_Name':_0x1db0c1[0x0],'Phone':_0x5efaf7,'Owner':{'name':!_[_0xefa1('0x1e')](_0x42d983[_0xefa1('0x45')]['name'])?_0x42d983[_0xefa1('0x45')][_0xefa1('0x1a')]:!_[_0xefa1('0x1e')](_0x42d983['first_name'])?_0x42d983[_0xefa1('0x46')]+'\x20'+_0x42d983['last_name']:_0x42d983[_0xefa1('0x47')],'id':_0x42d983['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xa0f80a},'json':!![]})['then'](function(_0x383010){if(_0x383010&&_0x383010['data'][0x0][_0xefa1('0x48')]===_0xefa1('0x49')){var _0x429df1=_0x383010[_0xefa1('0x4a')][0x0][_0xefa1('0x4b')];_0x429df1[_0xefa1('0x41')]=_[_0xefa1('0x44')](_0x17bd30['moduleCreate'])+'s';return _0x429df1;}logger['error'](_0xefa1('0x3e'),JSON[_0xefa1('0xd')](data));throw new Error(_0xefa1('0x4c')+JSON[_0xefa1('0xd')](data));})[_0xefa1('0x40')](function(_0x12f412){console[_0xefa1('0x4d')](_0xefa1('0x4e'),_0x12f412);});}function getEndUser(_0x24992e,_0x2e2173,_0x17f3aa,_0x23fc92,_0x4c2f46,_0x5d6953,_0x3a8db8){var _0xe96119={'method':_0xefa1('0x30'),'uri':'','headers':{'Authorization':_0xefa1('0x34')+_0x24992e},'json':!![]};switch(_0x3a8db8['moduleSearch']){case _0xefa1('0x4f'):_0xe96119[_0xefa1('0x50')]='https://www.zohoapis.'+_0x2e2173+_0xefa1('0x51')+_0x4c2f46+'))';return getZohoUser(_0xe96119,'Contacts')['then'](function(_0x39a995){if(_0x39a995)return _0x39a995;_0xe96119[_0xefa1('0x50')]=_0xefa1('0x43')+_0x2e2173+_0xefa1('0x52')+_0x4c2f46+'))';return getZohoUser(_0xe96119,_0xefa1('0x53'))[_0xefa1('0x2a')](function(_0x33aa4f){if(_0x33aa4f)return _0x33aa4f;if(_0x3a8db8[_0xefa1('0x54')]!=_0xefa1('0x55')){return createEndUser(_0x24992e,_0x2e2173,_0x23fc92,_0x4c2f46,_0x5d6953,_0x3a8db8);}else{return{};}});});break;case'contact':_0xe96119[_0xefa1('0x50')]='https://www.zohoapis.'+_0x2e2173+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4c2f46+'))';return getZohoUser(_0xe96119,_0xefa1('0x56'))[_0xefa1('0x2a')](function(_0xb8e38d){if(_0xb8e38d)return _0xb8e38d;if(_0x3a8db8['moduleCreate']!=_0xefa1('0x55')){return createEndUser(_0x24992e,_0x2e2173,_0x23fc92,_0x4c2f46,_0x5d6953,_0x3a8db8);}else{return{};}});break;case'lead':_0xe96119[_0xefa1('0x50')]=_0xefa1('0x43')+_0x2e2173+_0xefa1('0x52')+_0x4c2f46+'))';return getZohoUser(_0xe96119,'Leads')[_0xefa1('0x2a')](function(_0x5ac29d){if(_0x5ac29d)return _0x5ac29d;if(_0x3a8db8[_0xefa1('0x54')]!='nothing'){return createEndUser(_0x24992e,_0x2e2173,_0x23fc92,_0x4c2f46,_0x5d6953,_0x3a8db8);}else{return{};}});break;}}function getCall(_0x2c7140,_0x3d0324,_0xad4fc2,_0x187223,_0x288965,_0x29fed4,_0x1c6584,_0x19c9ec){logger[_0xefa1('0x38')]('Creating\x20new\x20call...');var _0x3b29d6={};_0x3b29d6[_0xefa1('0x57')]={'name':!_[_0xefa1('0x1e')](_0x187223['role'][_0xefa1('0x1a')])&&!_[_0xefa1('0x1e')](_0x187223[_0xefa1('0x3c')][_0xefa1('0x1a')])&&_0x187223[_0xefa1('0x3c')]['name']==='administrator'?_0x187223[_0xefa1('0x45')][_0xefa1('0x1a')]:!_[_0xefa1('0x1e')](_0x187223[_0xefa1('0x46')])?_0x187223[_0xefa1('0x46')]+'\x20'+_0x187223[_0xefa1('0x47')]:_0x187223['last_name'],'id':_0x187223['id']};_0x3b29d6['Subject']=intUtil[_0xefa1('0x58')](_0x29fed4['Subjects'],_0x1c6584,'\x20');_0x3b29d6[_0xefa1('0x59')]=intUtil[_0xefa1('0x58')](_0x29fed4[_0xefa1('0x5a')],_0x1c6584,'\x0a');if(_0x288965['enduserType']===_0xefa1('0x56')){_0x3b29d6[_0xefa1('0x5b')]={'name':!_[_0xefa1('0x1e')](_0x288965[_0xefa1('0x5c')])?_0x288965[_0xefa1('0x5c')]:!_['isNil'](_0x288965['First_Name'])?_0x288965[_0xefa1('0x5d')]+'\x20'+_0x288965[_0xefa1('0x5e')]:_0x288965[_0xefa1('0x5e')],'id':_0x288965['id']};}if(_0x288965['enduserType']==='Leads'){_0x3b29d6['What_Id']={'name':!_[_0xefa1('0x1e')](_0x288965[_0xefa1('0x5c')])?_0x288965[_0xefa1('0x5c')]:!_[_0xefa1('0x1e')](_0x288965['First_Name'])?_0x288965[_0xefa1('0x5d')]+'\x20'+_0x288965[_0xefa1('0x5e')]:_0x288965['Last_Name'],'id':_0x288965['id']};_0x3b29d6['$se_module']=_[_0xefa1('0x44')](_0x288965['enduserType']);}if(_0x1c6584['talktime']){_0x3b29d6[_0xefa1('0x5f')]=moment[_0xefa1('0x60')](parseInt(_0x1c6584[_0xefa1('0x61')])*0x3e8)[_0xefa1('0x31')]('mm:ss');}else if(_0x1c6584['answertime']&&_0x1c6584[_0xefa1('0x62')]){_0x3b29d6[_0xefa1('0x5f')]=moment[_0xefa1('0x60')](moment(_0x1c6584[_0xefa1('0x62')],'YYYY-MM-DDTHH:mm:ss')[_0xefa1('0x63')](moment(_0x1c6584['starttime'],_0xefa1('0x64'))))['format']('mm:ss');}switch(_0x1c6584['lastevent']){case _0xefa1('0x65'):_0x3b29d6['Call_Result']=_0xefa1('0x66');break;case _0xefa1('0x67'):case _0xefa1('0x68'):_0x3b29d6[_0xefa1('0x69')]=_0xefa1('0x6a');break;case _0xefa1('0x6b'):_0x3b29d6[_0xefa1('0x69')]='Rejected';break;case _0xefa1('0x6c'):_0x3b29d6[_0xefa1('0x69')]=_0xefa1('0x6d');break;case _0xefa1('0x6e'):_0x3b29d6[_0xefa1('0x69')]='Timeout';default:}_0x3b29d6[_0xefa1('0x6f')]=(_0x19c9ec===_0xefa1('0x70')?moment(_0x1c6584[_0xefa1('0x71')])['format'](_0xefa1('0x64')):moment(_0x1c6584['agentcalledAt'])[_0xefa1('0x31')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xefa1('0x31')](_0xefa1('0x64'));_0x3b29d6[_0xefa1('0x72')]=_0x19c9ec||'Inbound';_0x3b29d6=_[_0xefa1('0x73')](_0x3b29d6,getCustomFields(_0x29fed4[_0xefa1('0x74')],_0x1c6584));return request({'method':_0xefa1('0x42'),'uri':_0xefa1('0x43')+_0x3d0324+_0xefa1('0x75'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2c7140},'body':{'data':[_0x3b29d6]},'json':!![]})[_0xefa1('0x2a')](function(_0x56a0d1){if(_0x56a0d1&&_0x56a0d1[_0xefa1('0x4a')][0x0][_0xefa1('0x48')]===_0xefa1('0x49')){logger[_0xefa1('0x38')](_0xefa1('0x76'));return{'id':_0x56a0d1['data'][0x0][_0xefa1('0x4b')]['id']};}})['catch'](function(_0x594864){logger[_0xefa1('0x38')]('err',_0x594864[_0xefa1('0x77')]);console['log'](_0xefa1('0x78'),_0x594864);});}exports[_0xefa1('0x79')]=function(_0x1a8077,_0x10a60b,_0x162979,_0xeb8194,_0x2f4f1a,_0x5ba04d){var _0x376f81,_0x776aff,_0x26e6d7;_0x5ba04d['host']=intUtil['stripTrailingSlash'](_0x5ba04d[_0xefa1('0x7a')]);_0x5ba04d[_0xefa1('0x7b')]=intUtil[_0xefa1('0x7c')](_0x5ba04d[_0xefa1('0x7b')]);if(_0x2f4f1a&&_0x2f4f1a['monitor_format']){logger[_0xefa1('0x38')](_0xefa1('0x7d'),_0xefa1('0x7e'));_0x10a60b[_0xefa1('0x7f')]=_0x5ba04d[_0xefa1('0x7b')]+_0xefa1('0x80')+_0x10a60b[_0xefa1('0x81')]+_0xefa1('0x82')+md5(_0x10a60b[_0xefa1('0x81')]);}else{_0x10a60b[_0xefa1('0x7f')]='';}var _0x4eadce=_0x5ba04d['host']===_0xefa1('0x83')?'eu':_0xefa1('0x84');return getAccessToken(_0x5ba04d)[_0xefa1('0x2a')](function(_0x3abd59){_0x26e6d7=_0x3abd59;return getUser(_0x26e6d7,_0x4eadce,_0x5ba04d,_0xeb8194['email']);})['then'](function(_0x39da19){_0x376f81=_0x39da19;logger[_0xefa1('0x38')](_0xefa1('0x85'),_0x376f81['id']);return getEndUser(_0x26e6d7,_0x4eadce,_0x5ba04d,_0x10a60b[_0xefa1('0x86')],_0x10a60b[_0xefa1('0x87')],_0x376f81,_0x162979);})['then'](function(_0x37db14){_0x776aff=_0x37db14;return getCall(_0x26e6d7,_0x4eadce,_0x5ba04d,_0x376f81,_0x776aff,_0x162979,_0x10a60b,_0xefa1('0x88'));})[_0xefa1('0x2a')](function(_0xbb8c64){if(_0xbb8c64){logger[_0xefa1('0x38')](_0xefa1('0x89'),_0xbb8c64['id']);logger[_0xefa1('0x38')](_0xefa1('0x7d'),_0xefa1('0x8a'));emit(util[_0xefa1('0x31')](_0xefa1('0x8b'),_0xeb8194['name']),_0xefa1('0x8c'),{'uri':_0xefa1('0x8d')+_0x5ba04d[_0xefa1('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0xbb8c64['id']});}})['catch'](function(_0x476e5a){logger[_0xefa1('0x2d')](_0xefa1('0x7d'),JSON['stringify'](_0x476e5a));});};exports[_0xefa1('0x70')]=function(_0x1ab303,_0x1ad200,_0x352503,_0x31040c,_0x49bdea,_0x4ae02c,_0x4025e5){var _0x6c50f3,_0x314011,_0x771658;_0x4ae02c[_0xefa1('0x7a')]=intUtil[_0xefa1('0x7c')](_0x4ae02c[_0xefa1('0x7a')]);_0x4ae02c[_0xefa1('0x7b')]=intUtil['stripTrailingSlash'](_0x4ae02c[_0xefa1('0x7b')]);if(_0x4025e5&&_0x4025e5['recordingFormat']&&_0x4025e5[_0xefa1('0x8e')]!==_0xefa1('0x8f')){logger['info'](_0xefa1('0x90'),'Recording\x20is\x20enabled!');_0x1ad200[_0xefa1('0x7f')]=_0x4ae02c[_0xefa1('0x7b')]+_0xefa1('0x80')+_0x1ad200['uniqueid']+_0xefa1('0x82')+md5(_0x1ad200['uniqueid']);}var _0x4f42c4=_0x4ae02c['host']===_0xefa1('0x83')?'eu':_0xefa1('0x84');return getAccessToken(_0x4ae02c)['then'](function(_0x3402d4){_0x771658=_0x3402d4;return getUser(_0x771658,_0x4f42c4,_0x4ae02c,_0x31040c[_0xefa1('0x37')]);})[_0xefa1('0x2a')](function(_0x59037d){_0x6c50f3=_0x59037d;logger['info'](_0xefa1('0x85'),_0x6c50f3['id']);return getEndUser(_0x771658,_0x4f42c4,_0x4ae02c,_0x1ad200[_0xefa1('0x91')],_0x1ad200[_0xefa1('0x92')],_0x6c50f3,_0x352503);})[_0xefa1('0x2a')](function(_0x4699ba){_0x314011=_0x4699ba;return getCall(_0x771658,_0x4f42c4,_0x4ae02c,_0x6c50f3,_0x314011,_0x352503,_0x1ad200,'Outbound');})['then'](function(_0x346565){if(_0x346565){logger['info']('The\x20Call\x20ID\x20is:',_0x346565['id']);logger[_0xefa1('0x38')](_0xefa1('0x90'),_0xefa1('0x8a'));emit(util['format'](_0xefa1('0x8b'),_0x31040c[_0xefa1('0x1a')]),_0xefa1('0x8c'),{'uri':_0xefa1('0x8d')+_0x4ae02c[_0xefa1('0x7a')]+_0xefa1('0x93')+_0x346565['id']});}})[_0xefa1('0x40')](function(_0x2adf5f){logger['error'](_0xefa1('0x90'),JSON[_0xefa1('0xd')](_0x2adf5f));});};exports[_0xefa1('0x94')]=function(_0x2326be,_0x5ae795,_0x682f7e,_0x2231c9,_0x1fb5ef,_0xc606a8){var _0x203414,_0x49e36c,_0x435ff9;_0xc606a8[_0xefa1('0x7a')]=intUtil[_0xefa1('0x7c')](_0xc606a8['host']);_0xc606a8[_0xefa1('0x7b')]=intUtil['stripTrailingSlash'](_0xc606a8['serverUrl']);if(_0x1fb5ef&&_0x1fb5ef[_0xefa1('0x95')]){logger[_0xefa1('0x38')]('['+_0x5ae795['lastevent'][_0xefa1('0x96')]()+']',_0xefa1('0x7e'));_0x5ae795['recordingURL']=_0xc606a8[_0xefa1('0x7b')]+'/api/voice/recordings/'+_0x5ae795['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x5ae795[_0xefa1('0x81')]);}else{_0x5ae795['recordingURL']='';}var _0x3c38c9=_0xc606a8[_0xefa1('0x7a')]===_0xefa1('0x83')?'eu':_0xefa1('0x84');return getAccessToken(_0xc606a8)[_0xefa1('0x2a')](function(_0x1cc3cb){_0x435ff9=_0x1cc3cb;return getUser(_0x435ff9,_0x3c38c9,_0xc606a8);})['then'](function(_0x4f6fa4){_0x203414=_0x4f6fa4;logger['info'](_0xefa1('0x85'),_0x203414['id']);return getEndUser(_0x435ff9,_0x3c38c9,_0xc606a8,_0x5ae795['calleridname'],_0x5ae795[_0xefa1('0x87')],_0x203414,_0x682f7e);})[_0xefa1('0x2a')](function(_0x25c1ff){_0x49e36c=_0x25c1ff;return getCall(_0x435ff9,_0x3c38c9,_0xc606a8,_0x203414,_0x49e36c,_0x682f7e,_0x5ae795,_0xefa1('0x88'));})['then'](function(_0x5ecd96){if(_0x5ecd96){logger[_0xefa1('0x38')](_0xefa1('0x89'),_0x5ecd96['id']);}})['catch'](function(_0x1e4c05){logger['error']('['+_0x5ae795[_0xefa1('0x97')][_0xefa1('0x96')]()+']',JSON[_0xefa1('0xd')](_0x1e4c05));});}; \ 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 048b8fb..7bfcf59 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 _0x35e8=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x448b29,_0x309b98){var _0x4c8162=function(_0x22380d){while(--_0x22380d){_0x448b29['push'](_0x448b29['shift']());}};_0x4c8162(++_0x309b98);}(_0x35e8,0x16e));var _0x835e=function(_0xf2645b,_0x3c60f1){_0xf2645b=_0xf2645b-0x0;var _0x5b6d70=_0x35e8[_0xf2645b];return _0x5b6d70;};'use strict';var util=require(_0x835e('0x0'));var sh=require(_0x835e('0x1'));var Mustache=require(_0x835e('0x2'));var logger=require('../../../../config/logger')(_0x835e('0x3'));exports[_0x835e('0x4')]=function(_0x135b59,_0x3f3b7e){var _0x428f6d=_0x135b59[_0x835e('0x5')]?_0x135b59[_0x835e('0x5')]:'Script';var _0x5c4bb3=_0x135b59[_0x835e('0x6')]?Mustache[_0x835e('0x7')](_0x135b59['data3'],_0x3f3b7e):_0x3f3b7e;sh[_0x835e('0x4')](_0x5c4bb3,function(_0x553ae6,_0x1e171c,_0x42e07d){if(_0x553ae6!==0x0){logger[_0x835e('0x8')](util[_0x835e('0x9')](_0x835e('0xa'),_0x428f6d,_0x5c4bb3,_0x553ae6,_0x42e07d));}else{logger[_0x835e('0xb')](util[_0x835e('0x9')](_0x835e('0xc'),_0x428f6d,_0x5c4bb3,_0x1e171c));}});}; \ No newline at end of file +var _0x78e4=['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','mustache','../../../../config/logger','exec','Script','data3','render'];(function(_0x4c2240,_0x361760){var _0x367bba=function(_0x2b3f5a){while(--_0x2b3f5a){_0x4c2240['push'](_0x4c2240['shift']());}};_0x367bba(++_0x361760);}(_0x78e4,0x161));var _0x478e=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x78e4[_0x45d55e];return _0x29812a;};'use strict';var util=require(_0x478e('0x0'));var sh=require('shelljs');var Mustache=require(_0x478e('0x1'));var logger=require(_0x478e('0x2'))('trigger');exports[_0x478e('0x3')]=function(_0x55cef6,_0x3d86cb){var _0x1e4dd8=_0x55cef6['data2']?_0x55cef6['data2']:_0x478e('0x4');var _0x44bfb8=_0x55cef6[_0x478e('0x5')]?Mustache[_0x478e('0x6')](_0x55cef6['data3'],_0x3d86cb):_0x3d86cb;sh[_0x478e('0x3')](_0x44bfb8,function(_0x161176,_0x149b2e,_0x5526ca){if(_0x161176!==0x0){logger[_0x478e('0x7')](util[_0x478e('0x8')](_0x478e('0x9'),_0x1e4dd8,_0x44bfb8,_0x161176,_0x5526ca));}else{logger[_0x478e('0xa')](util[_0x478e('0x8')](_0x478e('0xb'),_0x1e4dd8,_0x44bfb8,_0x149b2e));}});}; \ 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 518ca5d..e2dd05a 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 _0xdd9f=['exec','data1','toUpperCase','render','data5','number','headers','data6','error','stack','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','then',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','trigger'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xdd9f,0x78));var _0xfdd9=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xdd9f[_0xbd08b4];return _0x314f1e;};'use strict';var rp=require(_0xfdd9('0x0'));var util=require(_0xfdd9('0x1'));var _=require('lodash');var Mustache=require(_0xfdd9('0x2'));var logger=require('../../../../config/logger')(_0xfdd9('0x3'));exports[_0xfdd9('0x4')]=function(_0x32e381,_0x726265){var _0x49047c,_0x4218de;var _0x543874={'method':_0x32e381[_0xfdd9('0x5')][_0xfdd9('0x6')](),'uri':Mustache[_0xfdd9('0x7')](_0x32e381['data2'],_0x726265),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x32e381[_0xfdd9('0x8')])===_0xfdd9('0x9')&&parseInt(_0x32e381['data5'])>=0x1&&parseInt(_0x32e381[_0xfdd9('0x8')])<=0xa?parseInt(_0x32e381['data5'])*0x3e8:0x5*0x3e8};try{_0x543874[_0xfdd9('0xa')]=_0x32e381[_0xfdd9('0xb')]?JSON['parse'](Mustache['render'](_0x32e381[_0xfdd9('0xb')],_0x726265)):{};}catch(_0x38134c){logger[_0xfdd9('0xc')](_0x38134c[_0xfdd9('0xd')]);}switch(_0x32e381[_0xfdd9('0x5')]['toUpperCase']()){case _0xfdd9('0xe'):case _0xfdd9('0xf'):_0x49047c=null;_0x543874['qs']=_0x726265;break;case'POST':case _0xfdd9('0x10'):if(_0x32e381[_0xfdd9('0x11')]){try{_0x49047c=JSON['parse'](Mustache[_0xfdd9('0x7')](_0x32e381[_0xfdd9('0x11')],_0x726265));_0x543874[_0xfdd9('0x12')]=_0x49047c;}catch(_0x2aaef6){logger[_0xfdd9('0xc')](_0x2aaef6[_0xfdd9('0xd')]);logger[_0xfdd9('0xc')](_0xfdd9('0x13'));}}else{_0x49047c=_0x726265;_0x543874[_0xfdd9('0x12')]=_0x49047c;}break;}logger[_0xfdd9('0x14')](util[_0xfdd9('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x32e381[_0xfdd9('0x5')],_0x32e381[_0xfdd9('0x16')],JSON[_0xfdd9('0x17')](_0x543874)));rp(_0x543874)[_0xfdd9('0x18')](function(_0xbd540b){_0x49047c=!_['isNil'](_0x49047c)?_0xfdd9('0x19')+_0x49047c:'';_0x4218de=typeof _0xbd540b['body']===_0xfdd9('0x1a')?JSON[_0xfdd9('0x17')](_0xbd540b[_0xfdd9('0x12')]):_0xbd540b[_0xfdd9('0x12')];logger[_0xfdd9('0x14')](util[_0xfdd9('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x32e381[_0xfdd9('0x5')],_0x32e381[_0xfdd9('0x16')],_0xbd540b[_0xfdd9('0x1b')],_0x4218de));})[_0xfdd9('0x1c')](function(_0x42cdc6){logger[_0xfdd9('0xc')](util[_0xfdd9('0x15')](_0xfdd9('0x1d'),_0x32e381[_0xfdd9('0x5')],_0x32e381['data2'],_0x42cdc6[_0xfdd9('0x1b')],_0x42cdc6[_0xfdd9('0x1e')],_0x42cdc6['message']));});}; \ No newline at end of file +var _0x12ec=['exec','toUpperCase','render','data2','data5','data6','parse','stack','data1','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','statusCode','message','request-promise','lodash','mustache','trigger'];(function(_0x32628c,_0x57328c){var _0x4fda73=function(_0x287657){while(--_0x287657){_0x32628c['push'](_0x32628c['shift']());}};_0x4fda73(++_0x57328c);}(_0x12ec,0x11c));var _0xc12e=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x12ec[_0x1d5400];return _0x21d9fe;};'use strict';var rp=require(_0xc12e('0x0'));var util=require('util');var _=require(_0xc12e('0x1'));var Mustache=require(_0xc12e('0x2'));var logger=require('../../../../config/logger')(_0xc12e('0x3'));exports[_0xc12e('0x4')]=function(_0x27d9e9,_0x380b16){var _0xacc0f7,_0x22f2fa;var _0x1db0d2={'method':_0x27d9e9['data1'][_0xc12e('0x5')](),'uri':Mustache[_0xc12e('0x6')](_0x27d9e9[_0xc12e('0x7')],_0x380b16),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x27d9e9[_0xc12e('0x8')])==='number'&&parseInt(_0x27d9e9[_0xc12e('0x8')])>=0x1&&parseInt(_0x27d9e9[_0xc12e('0x8')])<=0xa?parseInt(_0x27d9e9['data5'])*0x3e8:0x5*0x3e8};try{_0x1db0d2['headers']=_0x27d9e9[_0xc12e('0x9')]?JSON[_0xc12e('0xa')](Mustache[_0xc12e('0x6')](_0x27d9e9[_0xc12e('0x9')],_0x380b16)):{};}catch(_0x3bc07c){logger['error'](_0x3bc07c[_0xc12e('0xb')]);}switch(_0x27d9e9[_0xc12e('0xc')][_0xc12e('0x5')]()){case _0xc12e('0xd'):case _0xc12e('0xe'):_0xacc0f7=null;_0x1db0d2['qs']=_0x380b16;break;case _0xc12e('0xf'):case _0xc12e('0x10'):if(_0x27d9e9[_0xc12e('0x11')]){try{_0xacc0f7=JSON[_0xc12e('0xa')](Mustache[_0xc12e('0x6')](_0x27d9e9[_0xc12e('0x11')],_0x380b16));_0x1db0d2[_0xc12e('0x12')]=_0xacc0f7;}catch(_0x1e75c8){logger[_0xc12e('0x13')](_0x1e75c8[_0xc12e('0xb')]);logger[_0xc12e('0x13')](_0xc12e('0x14'));}}else{_0xacc0f7=_0x380b16;_0x1db0d2[_0xc12e('0x12')]=_0xacc0f7;}break;}logger[_0xc12e('0x15')](util['format'](_0xc12e('0x16'),_0x27d9e9['data1'],_0x27d9e9[_0xc12e('0x7')],JSON[_0xc12e('0x17')](_0x1db0d2)));rp(_0x1db0d2)[_0xc12e('0x18')](function(_0x45f9f3){_0xacc0f7=!_['isNil'](_0xacc0f7)?_0xc12e('0x19')+_0xacc0f7:'';_0x22f2fa=typeof _0x45f9f3[_0xc12e('0x12')]===_0xc12e('0x1a')?JSON[_0xc12e('0x17')](_0x45f9f3[_0xc12e('0x12')]):_0x45f9f3[_0xc12e('0x12')];logger[_0xc12e('0x15')](util[_0xc12e('0x1b')](_0xc12e('0x1c'),_0x27d9e9[_0xc12e('0xc')],_0x27d9e9[_0xc12e('0x7')],_0x45f9f3['statusCode'],_0x22f2fa));})[_0xc12e('0x1d')](function(_0x3b2954){logger[_0xc12e('0x13')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x27d9e9[_0xc12e('0xc')],_0x27d9e9[_0xc12e('0x7')],_0x3b2954[_0xc12e('0x1e')],_0x3b2954['name'],_0x3b2954[_0xc12e('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index bc06ace..7b47b27 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 _0x093e=['routing','client','http','request','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x4fee31,_0x2b2d0a){var _0x1ae270=function(_0x47b1ba){while(--_0x47b1ba){_0x4fee31['push'](_0x4fee31['shift']());}};_0x1ae270(++_0x2b2d0a);}(_0x093e,0x142));var _0xe093=function(_0x57d7f4,_0x45665d){_0x57d7f4=_0x57d7f4-0x0;var _0x2d49da=_0x093e[_0x57d7f4];return _0x2d49da;};'use strict';var jayson=require(_0xe093('0x0'));var BPromise=require(_0xe093('0x1'));var logger=require(_0xe093('0x2'))(_0xe093('0x3'));var client=jayson[_0xe093('0x4')][_0xe093('0x5')]({'port':0x2329});client['Request']=function(_0x20c9a9,_0x4863a9){return new BPromise(function(_0x5dd376,_0x2d1b65){return client[_0xe093('0x6')](_0x20c9a9,_0x4863a9)['then'](function(_0x1a6dea){logger[_0xe093('0x7')](_0xe093('0x8'),_0xe093('0x3'),_0x20c9a9,_0x4863a9,_0x1a6dea);if(_0x1a6dea['error']){logger[_0xe093('0x9')](_0xe093('0x8'),_0xe093('0x3'),_0x20c9a9,_0x1a6dea['error'][_0xe093('0xa')],_0x4863a9);return _0x2d1b65(_0x1a6dea[_0xe093('0x9')][_0xe093('0xa')]);}else{return _0x5dd376(_0x1a6dea['result']);}})[_0xe093('0xb')](function(_0x601e88){logger['error'](_0xe093('0x8'),_0xe093('0x3'),_0x20c9a9,_0x601e88,_0x4863a9);return _0x2d1b65(_0x601e88);});});};module[_0xe093('0xc')]=client; \ No newline at end of file +var _0xd694=['message','result','exports','jayson/promise','../../config/logger','routing','Request','then','debug','rpc','error'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd694,0xdf));var _0x4d69=function(_0x549d13,_0x9f7df2){_0x549d13=_0x549d13-0x0;var _0x40a774=_0xd694[_0x549d13];return _0x40a774;};'use strict';var jayson=require(_0x4d69('0x0'));var BPromise=require('bluebird');var logger=require(_0x4d69('0x1'))(_0x4d69('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x4d69('0x3')]=function(_0xb5a5e1,_0x341265){return new BPromise(function(_0xfc7502,_0x27fc7d){return client['request'](_0xb5a5e1,_0x341265)[_0x4d69('0x4')](function(_0x98defd){logger[_0x4d69('0x5')](_0x4d69('0x6'),'routing',_0xb5a5e1,_0x341265,_0x98defd);if(_0x98defd[_0x4d69('0x7')]){logger['error'](_0x4d69('0x6'),_0x4d69('0x2'),_0xb5a5e1,_0x98defd[_0x4d69('0x7')][_0x4d69('0x8')],_0x341265);return _0x27fc7d(_0x98defd['error'][_0x4d69('0x8')]);}else{return _0xfc7502(_0x98defd[_0x4d69('0x9')]);}})['catch'](function(_0x134538){logger[_0x4d69('0x7')](_0x4d69('0x6'),_0x4d69('0x2'),_0xb5a5e1,_0x134538,_0x341265);return _0x27fc7d(_0x134538);});});};module[_0x4d69('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 02ae664..a9225e3 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 _0x7440=['./rpc/mailAccount','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x5e35fa,_0x5d8898){var _0x1700b5=function(_0x181ec1){while(--_0x181ec1){_0x5e35fa['push'](_0x5e35fa['shift']());}};_0x1700b5(++_0x5d8898);}(_0x7440,0xfd));var _0x0744=function(_0x1e0f65,_0x22f839){_0x1e0f65=_0x1e0f65-0x0;var _0x8c9925=_0x7440[_0x1e0f65];return _0x8c9925;};'use strict';var server=require(_0x0744('0x0'));var Realtime=require(_0x0744('0x1'));var EmailChannel=require(_0x0744('0x2'));var mailAccount=require(_0x0744('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0x0744('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0744('0x5')]()[_0x0744('0x6')](mailAccount[_0x0744('0x7')]())[_0x0744('0x6')](realtime[_0x0744('0x8')]())[_0x0744('0x6')](function(){email[_0x0744('0x9')](realtime[_0x0744('0xa')]);return realtime;});}function main(){return server[_0x0744('0xb')](realtime,email)[_0x0744('0x6')](function(){return initRealtime();})[_0x0744('0x6')](function(){return setting[_0x0744('0xc')]();})[_0x0744('0x6')](function(_0x2cc6c1){return setInterval(initRealtime,_0x2cc6c1[_0x0744('0xd')]*0x3e8);})['catch'](function(_0x2ccb57){logger[_0x0744('0xe')](_0x0744('0xf'),_0x2ccb57);});}main(); \ No newline at end of file +var _0xf472=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x353abb,_0x194c80){var _0x43c9c5=function(_0x456b74){while(--_0x456b74){_0x353abb['push'](_0x353abb['shift']());}};_0x43c9c5(++_0x194c80);}(_0xf472,0x1b3));var _0x2f47=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf472[_0x122ef9];return _0x42fba0;};'use strict';var server=require(_0x2f47('0x0'));var Realtime=require(_0x2f47('0x1'));var EmailChannel=require(_0x2f47('0x2'));var mailAccount=require(_0x2f47('0x3'));var setting=require(_0x2f47('0x4'));var logger=require(_0x2f47('0x5'))(_0x2f47('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2f47('0x7')]()[_0x2f47('0x8')](mailAccount[_0x2f47('0x9')]())['then'](realtime[_0x2f47('0xa')]())[_0x2f47('0x8')](function(){email[_0x2f47('0xb')](realtime[_0x2f47('0xc')]);return realtime;});}function main(){return server[_0x2f47('0xd')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x2f47('0xe')]();})[_0x2f47('0x8')](function(_0x1bc5a9){return setInterval(initRealtime,_0x1bc5a9[_0x2f47('0xf')]*0x3e8);})[_0x2f47('0x10')](function(_0x1d85ee){logger[_0x2f47('0x11')](_0x2f47('0x12'),_0x1d85ee);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b3ac9b7..239ed2d 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 _0x099c=['bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','box','handleImapBox','bind','end','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','send','isNil','Smtp','verify','then','verified','catch','exports','lodash'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x099c,0x121));var _0xc099=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x099c[_0x285800];return _0x4b809e;};'use strict';var _=require(_0xc099('0x0'));var moment=require('moment');var BPromise=require(_0xc099('0x1'));var md5=require(_0xc099('0x2'));var Redis=require('ioredis');var config=require(_0xc099('0x3'));var logger=require(_0xc099('0x4'))(_0xc099('0x5'));config[_0xc099('0x6')]=_[_0xc099('0x7')](config[_0xc099('0x6')],{'host':_0xc099('0x8'),'port':0x18eb});var io=require(_0xc099('0x9'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0xc099('0xa'));var mailAccount=require(_0xc099('0xb'));var md5Accounts={};function EmailChannel(_0x1b96b5){logger[_0xc099('0xc')](_0xc099('0xd'));this[_0xc099('0xe')]=_0x1b96b5[_0xc099('0xe')];this[_0xc099('0xf')]={};this[_0xc099('0x10')]=new EmailSmtp();}EmailChannel[_0xc099('0x11')][_0xc099('0x12')]=function(_0x11e4cf){var _0x22aeda=this['mailAccounts'][_0x11e4cf];var _0x561b24={'id':_0x22aeda['id'],'name':_0x22aeda[_0xc099('0x13')],'key':_0x22aeda[_0xc099('0x14')],'active':_0x22aeda[_0xc099('0x15')],'Imap':{'status':_0x22aeda[_0xc099('0x16')][_0xc099('0x17')],'messageStatus':_0x22aeda[_0xc099('0x16')][_0xc099('0x18')],'total':_0x22aeda[_0xc099('0x16')][_0xc099('0x19')]}};if(_['isNil'](md5Accounts[_0x11e4cf])){md5Accounts[_0x11e4cf]={};}var _0x510730=md5(JSON['stringify'](_0x561b24));if(md5Accounts[_0x11e4cf][_0xc099('0x2')]!==_0x510730){md5Accounts[_0x11e4cf][_0xc099('0x2')]=_0x510730;io[_0xc099('0x12')](_0xc099('0x1a'),_0x561b24);}};EmailChannel['prototype'][_0xc099('0x1b')]=function(_0x4de38e){for(var _0x4e6c29 in _0x4de38e){if(_0x4de38e['hasOwnProperty'](_0x4e6c29)){if(_0x4de38e[_0x4e6c29]['Imap']&&_0x4de38e[_0x4e6c29][_0xc099('0x15')]){var _0x4ecf47=_0x4de38e[_0x4e6c29][_0xc099('0x16')];if(!_0x4ecf47[_0xc099('0x1c')]&&_0x4de38e[_0x4e6c29][_0xc099('0x1d')]!==_0xc099('0x1e'))_0x4ecf47[_0xc099('0x1c')]=_0x4de38e[_0x4e6c29][_0xc099('0x1d')];if(!this[_0xc099('0xf')][_0xc099('0x1f')](_0x4ecf47['id'])){this[_0xc099('0xf')][_0x4ecf47['id']]=new EmailImap(_0x4ecf47,_0x4de38e[_0x4e6c29]['email']);this[_0xc099('0xf')][_0x4ecf47['id']]['on'](_0xc099('0x20'),this[_0xc099('0x21')][_0xc099('0x22')](this,_0x4e6c29));this[_0xc099('0xf')][_0x4ecf47['id']]['on'](_0xc099('0x5'),this['handleImapEmail'][_0xc099('0x22')](this,_0x4e6c29));this[_0xc099('0xf')][_0x4ecf47['id']]['on'](_0xc099('0x23'),this['handleImapEnd']['bind'](this,_0x4e6c29));this['imapAccounts'][_0x4ecf47['id']]['on']('error',this[_0xc099('0x24')][_0xc099('0x22')](this,_0x4e6c29));}}else{if(_['isNil'](this['mailAccounts'][_0x4e6c29][_0xc099('0x16')])){this[_0xc099('0xe')][_0x4e6c29][_0xc099('0x16')]={};}this['mailAccounts'][_0x4e6c29][_0xc099('0x16')]['status']=_0xc099('0x25');this[_0xc099('0xe')][_0x4e6c29]['Imap'][_0xc099('0x18')]='';this[_0xc099('0x12')](_0x4e6c29);}}}};EmailChannel['prototype'][_0xc099('0x21')]=function(_0x26d623,_0x1abfb1){if(this[_0xc099('0xe')][_0x26d623]){this[_0xc099('0xe')][_0x26d623][_0xc099('0x16')]['status']=_0xc099('0x26');this[_0xc099('0xe')][_0x26d623]['Imap'][_0xc099('0x18')]=_0x1abfb1['name'];if(_0x1abfb1[_0xc099('0x27')]){this[_0xc099('0xe')][_0x26d623][_0xc099('0x16')][_0xc099('0x19')]=_0x1abfb1[_0xc099('0x27')][_0xc099('0x19')];}return this[_0xc099('0x12')](_0x26d623);}};EmailChannel[_0xc099('0x11')][_0xc099('0x28')]=function(_0xd7400b,_0x2e41c9){logger[_0xc099('0xc')](_0xc099('0x29'),_0x2e41c9[_0xc099('0x2a')],_0x2e41c9[_0xc099('0x2b')],_0x2e41c9[_0xc099('0x2c')],_0xd7400b);if(this[_0xc099('0xe')][_0xd7400b]){return mailAccount['notify'](_0xd7400b,_0x2e41c9)['then'](function(_0x4b4cb7){if(_0x4b4cb7){logger[_0xc099('0xc')](_0xc099('0x2d'));}})['catch'](function(_0x4bdc1c){logger[_0xc099('0x2e')](_0xc099('0x2f'),JSON['stringify'](_0x4bdc1c));});}};EmailChannel[_0xc099('0x11')][_0xc099('0x30')]=function(_0x1ef5c5){if(this[_0xc099('0xe')][_0x1ef5c5]&&this[_0xc099('0xe')][_0x1ef5c5][_0xc099('0x16')]){if(this['imapAccounts'][this[_0xc099('0xe')][_0x1ef5c5][_0xc099('0x16')]['id']]){delete this[_0xc099('0xf')][this[_0xc099('0xe')][_0x1ef5c5][_0xc099('0x16')]['id']];}this['mailAccounts'][_0x1ef5c5][_0xc099('0x16')][_0xc099('0x31')]=moment();this[_0xc099('0x12')](_0x1ef5c5);}};EmailChannel['prototype'][_0xc099('0x24')]=function(_0x5c7d63,_0x53f0f2){if(this[_0xc099('0xe')][_0x5c7d63]){this[_0xc099('0xe')][_0x5c7d63][_0xc099('0x16')][_0xc099('0x17')]='error';this[_0xc099('0xe')][_0x5c7d63][_0xc099('0x16')]['messageStatus']=_0x53f0f2;return this['emit'](_0x5c7d63);}};EmailChannel[_0xc099('0x11')]['sendMail']=function(_0x5baf9d,_0x3f677f){return this[_0xc099('0x10')][_0xc099('0x32')](_0x5baf9d,_0x3f677f);};EmailChannel[_0xc099('0x11')]['verifySmtp']=function(_0xa21091){var _0x12a915=this;if(this[_0xc099('0xe')][_0xa21091['id']]){if(_[_0xc099('0x33')](this[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')])){this[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')]={};}this[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')][_0xc099('0x31')]=moment();return new BPromise(function(_0x387b99,_0x40681c){return _0x12a915[_0xc099('0x10')][_0xc099('0x35')](_0xa21091)[_0xc099('0x36')](function(_0x2600d6){_0x12a915[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')]['status']=_0xc099('0x37');_0x12a915[_0xc099('0xe')][_0xa21091['id']]['Smtp'][_0xc099('0x18')]='';_0x12a915[_0xc099('0x12')](_0xa21091['id']);_0x387b99(_0x2600d6);})[_0xc099('0x38')](function(_0x343728){_0x12a915[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')][_0xc099('0x17')]=_0xc099('0x2e');_0x12a915[_0xc099('0xe')][_0xa21091['id']][_0xc099('0x34')][_0xc099('0x18')]=_0x343728;_0x12a915[_0xc099('0x12')](_0xa21091['id']);_0x40681c(_0x343728);});});}return this[_0xc099('0x10')][_0xc099('0x35')](_0xa21091);};module[_0xc099('0x39')]=EmailChannel; \ No newline at end of file +var _0xca09=['Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','end','handleImapError','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then'];(function(_0x45d3c7,_0x120c98){var _0x3a9fbf=function(_0x3156bf){while(--_0x3156bf){_0x45d3c7['push'](_0x45d3c7['shift']());}};_0x3a9fbf(++_0x120c98);}(_0xca09,0xb3));var _0x9ca0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xca09[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var moment=require(_0x9ca0('0x0'));var BPromise=require(_0x9ca0('0x1'));var md5=require(_0x9ca0('0x2'));var Redis=require(_0x9ca0('0x3'));var config=require(_0x9ca0('0x4'));var logger=require(_0x9ca0('0x5'))(_0x9ca0('0x6'));config[_0x9ca0('0x7')]=_[_0x9ca0('0x8')](config[_0x9ca0('0x7')],{'host':_0x9ca0('0x9'),'port':0x18eb});var io=require(_0x9ca0('0xa'))(new Redis(config['redis']));var EmailImap=require(_0x9ca0('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1d84dc){logger[_0x9ca0('0xc')]('start\x20email\x20channel');this[_0x9ca0('0xd')]=_0x1d84dc[_0x9ca0('0xd')];this[_0x9ca0('0xe')]={};this[_0x9ca0('0xf')]=new EmailSmtp();}EmailChannel[_0x9ca0('0x10')][_0x9ca0('0x11')]=function(_0x582d69){var _0x31873a=this[_0x9ca0('0xd')][_0x582d69];var _0x2ccc86={'id':_0x31873a['id'],'name':_0x31873a[_0x9ca0('0x12')],'key':_0x31873a[_0x9ca0('0x13')],'active':_0x31873a['active'],'Imap':{'status':_0x31873a[_0x9ca0('0x14')][_0x9ca0('0x15')],'messageStatus':_0x31873a[_0x9ca0('0x14')][_0x9ca0('0x16')],'total':_0x31873a[_0x9ca0('0x14')][_0x9ca0('0x17')]}};if(_[_0x9ca0('0x18')](md5Accounts[_0x582d69])){md5Accounts[_0x582d69]={};}var _0x40ae9e=md5(JSON[_0x9ca0('0x19')](_0x2ccc86));if(md5Accounts[_0x582d69][_0x9ca0('0x2')]!==_0x40ae9e){md5Accounts[_0x582d69][_0x9ca0('0x2')]=_0x40ae9e;io['emit'](_0x9ca0('0x1a'),_0x2ccc86);}};EmailChannel['prototype'][_0x9ca0('0x1b')]=function(_0x23f272){for(var _0x4795f7 in _0x23f272){if(_0x23f272[_0x9ca0('0x1c')](_0x4795f7)){if(_0x23f272[_0x4795f7][_0x9ca0('0x14')]&&_0x23f272[_0x4795f7]['active']){var _0x5a248b=_0x23f272[_0x4795f7][_0x9ca0('0x14')];if(!_0x5a248b[_0x9ca0('0x1d')]&&_0x23f272[_0x4795f7][_0x9ca0('0x1e')]!==_0x9ca0('0x1f'))_0x5a248b['service']=_0x23f272[_0x4795f7]['provider'];if(!this[_0x9ca0('0xe')]['hasOwnProperty'](_0x5a248b['id'])){this[_0x9ca0('0xe')][_0x5a248b['id']]=new EmailImap(_0x5a248b,_0x23f272[_0x4795f7]['email']);this[_0x9ca0('0xe')][_0x5a248b['id']]['on'](_0x9ca0('0x20'),this[_0x9ca0('0x21')][_0x9ca0('0x22')](this,_0x4795f7));this[_0x9ca0('0xe')][_0x5a248b['id']]['on'](_0x9ca0('0x6'),this['handleImapEmail'][_0x9ca0('0x22')](this,_0x4795f7));this[_0x9ca0('0xe')][_0x5a248b['id']]['on'](_0x9ca0('0x23'),this['handleImapEnd']['bind'](this,_0x4795f7));this[_0x9ca0('0xe')][_0x5a248b['id']]['on']('error',this[_0x9ca0('0x24')][_0x9ca0('0x22')](this,_0x4795f7));}}else{if(_[_0x9ca0('0x18')](this[_0x9ca0('0xd')][_0x4795f7][_0x9ca0('0x14')])){this[_0x9ca0('0xd')][_0x4795f7][_0x9ca0('0x14')]={};}this['mailAccounts'][_0x4795f7][_0x9ca0('0x14')][_0x9ca0('0x15')]='disabled';this['mailAccounts'][_0x4795f7][_0x9ca0('0x14')][_0x9ca0('0x16')]='';this['emit'](_0x4795f7);}}}};EmailChannel[_0x9ca0('0x10')][_0x9ca0('0x21')]=function(_0x15a0e8,_0x4b4e6b){if(this['mailAccounts'][_0x15a0e8]){this[_0x9ca0('0xd')][_0x15a0e8]['Imap']['status']=_0x9ca0('0x25');this[_0x9ca0('0xd')][_0x15a0e8]['Imap']['messageStatus']=_0x4b4e6b['name'];if(_0x4b4e6b[_0x9ca0('0x26')]){this[_0x9ca0('0xd')][_0x15a0e8][_0x9ca0('0x14')]['total']=_0x4b4e6b[_0x9ca0('0x26')][_0x9ca0('0x17')];}return this[_0x9ca0('0x11')](_0x15a0e8);}};EmailChannel[_0x9ca0('0x10')][_0x9ca0('0x27')]=function(_0x9569e2,_0x1a9f13){logger[_0x9ca0('0xc')](_0x9ca0('0x28'),_0x1a9f13[_0x9ca0('0x29')],_0x1a9f13['lastName'],_0x1a9f13[_0x9ca0('0x2a')],_0x9569e2);if(this[_0x9ca0('0xd')][_0x9569e2]){return mailAccount[_0x9ca0('0x2b')](_0x9569e2,_0x1a9f13)[_0x9ca0('0x2c')](function(_0x503ba3){if(_0x503ba3){logger[_0x9ca0('0xc')](_0x9ca0('0x2d'));}})[_0x9ca0('0x2e')](function(_0x2c1f3e){logger[_0x9ca0('0x2f')](_0x9ca0('0x30'),JSON[_0x9ca0('0x19')](_0x2c1f3e));});}};EmailChannel[_0x9ca0('0x10')]['handleImapEnd']=function(_0x52c0ce){if(this[_0x9ca0('0xd')][_0x52c0ce]&&this[_0x9ca0('0xd')][_0x52c0ce][_0x9ca0('0x14')]){if(this[_0x9ca0('0xe')][this[_0x9ca0('0xd')][_0x52c0ce][_0x9ca0('0x14')]['id']]){delete this[_0x9ca0('0xe')][this[_0x9ca0('0xd')][_0x52c0ce][_0x9ca0('0x14')]['id']];}this[_0x9ca0('0xd')][_0x52c0ce]['Imap'][_0x9ca0('0x31')]=moment();this[_0x9ca0('0x11')](_0x52c0ce);}};EmailChannel['prototype'][_0x9ca0('0x24')]=function(_0x378041,_0x18e27f){if(this[_0x9ca0('0xd')][_0x378041]){this['mailAccounts'][_0x378041][_0x9ca0('0x14')][_0x9ca0('0x15')]=_0x9ca0('0x2f');this[_0x9ca0('0xd')][_0x378041][_0x9ca0('0x14')]['messageStatus']=_0x18e27f;return this['emit'](_0x378041);}};EmailChannel['prototype'][_0x9ca0('0x32')]=function(_0x165aea,_0x1f8a8d){return this[_0x9ca0('0xf')][_0x9ca0('0x33')](_0x165aea,_0x1f8a8d);};EmailChannel[_0x9ca0('0x10')][_0x9ca0('0x34')]=function(_0x33a610){var _0x1503c8=this;if(this[_0x9ca0('0xd')][_0x33a610['id']]){if(_[_0x9ca0('0x18')](this[_0x9ca0('0xd')][_0x33a610['id']][_0x9ca0('0x35')])){this[_0x9ca0('0xd')][_0x33a610['id']]['Smtp']={};}this[_0x9ca0('0xd')][_0x33a610['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x3882b5,_0x4ba0b8){return _0x1503c8[_0x9ca0('0xf')][_0x9ca0('0x36')](_0x33a610)['then'](function(_0x4cba32){_0x1503c8['mailAccounts'][_0x33a610['id']][_0x9ca0('0x35')]['status']=_0x9ca0('0x37');_0x1503c8[_0x9ca0('0xd')][_0x33a610['id']][_0x9ca0('0x35')][_0x9ca0('0x16')]='';_0x1503c8[_0x9ca0('0x11')](_0x33a610['id']);_0x3882b5(_0x4cba32);})[_0x9ca0('0x2e')](function(_0x590adf){_0x1503c8['mailAccounts'][_0x33a610['id']][_0x9ca0('0x35')]['status']='error';_0x1503c8['mailAccounts'][_0x33a610['id']]['Smtp'][_0x9ca0('0x16')]=_0x590adf;_0x1503c8[_0x9ca0('0x11')](_0x33a610['id']);_0x4ba0b8(_0x590adf);});});}return this[_0x9ca0('0xf')][_0x9ca0('0x36')](_0x33a610);};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 1010beb..b715c70 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 _0xc2c7=['textCode','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','email','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','service','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','parser'];(function(_0x2e5405,_0x11284b){var _0x50442a=function(_0x2d75b5){while(--_0x2d75b5){_0x2e5405['push'](_0x2e5405['shift']());}};_0x50442a(++_0x11284b);}(_0xc2c7,0x134));var _0x7c2c=function(_0x510f45,_0x2553ef){_0x510f45=_0x510f45-0x0;var _0x1a7f09=_0xc2c7[_0x510f45];return _0x1a7f09;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var Imap=require(_0x7c2c('0x1'));var simpleParser=require(_0x7c2c('0x2'))[_0x7c2c('0x3')];var Iconv=require(_0x7c2c('0x4'))[_0x7c2c('0x5')];var EventEmitter=require(_0x7c2c('0x6'))[_0x7c2c('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x7c2c('0x8'));function EmailImap(_0x42ecc9,_0x23c038){this['mailbox']='INBOX';this['account']=this[_0x7c2c('0x9')](_0x42ecc9,_0x23c038);this[_0x7c2c('0x1')]=new Imap(this[_0x7c2c('0xa')]);this[_0x7c2c('0x1')][_0x7c2c('0xb')]('ready',this[_0x7c2c('0xc')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0xf')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')]['on'](_0x7c2c('0x10'),this[_0x7c2c('0x11')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0x12')]();}util[_0x7c2c('0x13')](EmailImap,EventEmitter);EmailImap[_0x7c2c('0x14')][_0x7c2c('0x9')]=function(_0x4c4aaf,_0x5b5729){var _0x102778={'connTimeout':_0x4c4aaf[_0x7c2c('0x15')]?_0x4c4aaf[_0x7c2c('0x15')]*0x3e8:0x2710,'authTimeout':_0x4c4aaf['authTimeout']?_0x4c4aaf[_0x7c2c('0x16')]*0x3e8:0x1388};if(_[_0x7c2c('0x17')](_0x4c4aaf['service'])){if(_0x4c4aaf[_0x7c2c('0x18')]){_0x102778['user']=_0x4c4aaf[_0x7c2c('0x19')];_0x102778['password']=_0x4c4aaf[_0x7c2c('0x1a')];}_0x102778[_0x7c2c('0x1b')]=_0x4c4aaf[_0x7c2c('0x1b')];_0x102778[_0x7c2c('0x1c')]=_0x4c4aaf[_0x7c2c('0x1c')]||0x3e1;if(_0x4c4aaf[_0x7c2c('0x1d')]){_0x102778[_0x7c2c('0x1d')]=!![];}else{_0x102778[_0x7c2c('0x1d')]=![];_0x102778[_0x7c2c('0x1e')]=_0x7c2c('0x1f');}}else{if(_0x4c4aaf[_0x7c2c('0x20')]){_0x102778[_0x7c2c('0x21')]=utils['generateXOAuth2Token'](_0x4c4aaf[_0x7c2c('0x22')]['data5'],_0x4c4aaf['user']);_0x102778[_0x7c2c('0x19')]=_0x4c4aaf[_0x7c2c('0x19')];}else{_0x102778[_0x7c2c('0x19')]=_0x4c4aaf[_0x7c2c('0x19')];_0x102778[_0x7c2c('0x1a')]=_0x4c4aaf[_0x7c2c('0x1a')];}_0x102778[_0x7c2c('0x1b')]=utils['getHost'](_0x4c4aaf[_0x7c2c('0x23')]);_0x102778['port']=0x3e1;_0x102778[_0x7c2c('0x1d')]=!![];}_0x102778['email']=_0x5b5729||_0x4c4aaf[_0x7c2c('0x19')]||_0x7c2c('0x24');return _0x102778;};EmailImap[_0x7c2c('0x14')]['handleReady']=function(){this['imap'][_0x7c2c('0x25')](this[_0x7c2c('0x26')],![],this[_0x7c2c('0x27')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x27')]=function(_0x3f4618,_0x4b1dd0){if(_0x3f4618){this[_0x7c2c('0x11')](_0x3f4618,!![]);}else{this[_0x7c2c('0x28')](_0x7c2c('0x29'),_0x4b1dd0);this[_0x7c2c('0x2a')]();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2b')]=function(_0xf2bfd1){if(_0xf2bfd1){this[_0x7c2c('0x11')](_0xf2bfd1,!![]);}else{this[_0x7c2c('0x1')]['end']();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2a')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x2c')](['UNSEEN'],this[_0x7c2c('0x2d')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2d')]=function(_0x1859c2,_0x3ad837){if(_0x1859c2){this[_0x7c2c('0x11')](_0x1859c2,!![]);}else{if(_0x3ad837['length']){try{var _0x1969f4=this[_0x7c2c('0x1')][_0x7c2c('0x2e')](_0x3ad837,{'bodies':'','markSeen':!![]});_0x1969f4['on'](_0x7c2c('0x2f'),this[_0x7c2c('0x30')]['bind'](this));_0x1969f4['once'](_0x7c2c('0x10'),this['handleFetchError']['bind'](this));_0x1969f4[_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0x31')][_0x7c2c('0xd')](this));}catch(_0x536dcf){logger[_0x7c2c('0x10')](_0x536dcf);}}else{this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this[_0x7c2c('0x2b')][_0x7c2c('0xd')](this));}}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x30')]=function(_0xab5072){_0xab5072['on'](_0x7c2c('0x33'),this[_0x7c2c('0x34')][_0x7c2c('0xd')](this));_0xab5072[_0x7c2c('0xb')](_0x7c2c('0x35'),this['handleMessageAttributes']['bind'](this));_0xab5072[_0x7c2c('0xb')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x34')]=function(_0x129bf0){simpleParser(_0x129bf0,{'Iconv':Iconv},this[_0x7c2c('0x36')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x37')]=function(){};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x38')]=function(){};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x36')]=function(_0x58696a,_0x4c7402){if(_0x58696a){logger[_0x7c2c('0x10')](_0x58696a);}else{var _0x360928=this;utils[_0x7c2c('0x39')](this[_0x7c2c('0xa')],_0x4c7402,function(_0x5e8c96){_0x360928[_0x7c2c('0x28')](_0x7c2c('0x8'),_0x5e8c96);});}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x31')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this[_0x7c2c('0x2b')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')]['handleFetchError']=function(_0xe2a67b){this['handleError'](_0xe2a67b);this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this['handleCloseBox'][_0x7c2c('0xd')](this));};EmailImap['prototype'][_0x7c2c('0xf')]=function(){this[_0x7c2c('0x28')](_0x7c2c('0xe'));};EmailImap[_0x7c2c('0x14')]['handleError']=function(_0x23fdcf,_0x500974){logger['error'](_0x7c2c('0x11'),this[_0x7c2c('0xa')][_0x7c2c('0x8')],JSON['stringify'](_0x23fdcf));var _0x3adfd1='';if(_0x23fdcf){if(_0x23fdcf[_0x7c2c('0x3a')]){_0x3adfd1=_0x23fdcf['textCode'];}else{for(var _0x267361 in _0x23fdcf){if(_0x23fdcf['hasOwnProperty'](_0x267361)){_0x3adfd1+=_[_0x7c2c('0x3b')](_0x267361)+':\x20'+_0x23fdcf[_0x267361]+'\x0a';}}}}if(_0x500974){this[_0x7c2c('0x1')]['end']();}else{this['emit'](_0x7c2c('0x10'),_0x3adfd1);this[_0x7c2c('0x28')]('end');}};module[_0x7c2c('0x3c')]=EmailImap; \ No newline at end of file +var _0x53ec=['modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','service','email','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','handleFetchMessage','handleFetchError','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','./utils','../../../config/logger','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required'];(function(_0x34c794,_0x291070){var _0x442169=function(_0x5e3dc7){while(--_0x5e3dc7){_0x34c794['push'](_0x34c794['shift']());}};_0x442169(++_0x291070);}(_0x53ec,0x192));var _0xc53e=function(_0xd3bcf8,_0x994fdb){_0xd3bcf8=_0xd3bcf8-0x0;var _0x296170=_0x53ec[_0xd3bcf8];return _0x296170;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var Imap=require(_0xc53e('0x2'));var simpleParser=require(_0xc53e('0x3'))[_0xc53e('0x4')];var Iconv=require(_0xc53e('0x5'))['Iconv'];var EventEmitter=require(_0xc53e('0x6'))['EventEmitter'];var utils=require(_0xc53e('0x7'));var logger=require(_0xc53e('0x8'))('email');function EmailImap(_0x2f1414,_0x4f989b){this[_0xc53e('0x9')]=_0xc53e('0xa');this['account']=this[_0xc53e('0xb')](_0x2f1414,_0x4f989b);this[_0xc53e('0x2')]=new Imap(this[_0xc53e('0xc')]);this[_0xc53e('0x2')][_0xc53e('0xd')](_0xc53e('0xe'),this[_0xc53e('0xf')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['once']('end',this[_0xc53e('0x11')]['bind'](this));this['imap']['on'](_0xc53e('0x12'),this[_0xc53e('0x13')][_0xc53e('0x10')](this));this[_0xc53e('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xc53e('0x14')][_0xc53e('0xb')]=function(_0x7cd798,_0x3d2e17){var _0x358ef3={'connTimeout':_0x7cd798[_0xc53e('0x15')]?_0x7cd798[_0xc53e('0x15')]*0x3e8:0x2710,'authTimeout':_0x7cd798[_0xc53e('0x16')]?_0x7cd798[_0xc53e('0x16')]*0x3e8:0x1388};if(_[_0xc53e('0x17')](_0x7cd798['service'])){if(_0x7cd798[_0xc53e('0x18')]){_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3[_0xc53e('0x1a')]=_0x7cd798[_0xc53e('0x1a')];}_0x358ef3[_0xc53e('0x1b')]=_0x7cd798[_0xc53e('0x1b')];_0x358ef3[_0xc53e('0x1c')]=_0x7cd798[_0xc53e('0x1c')]||0x3e1;if(_0x7cd798['tls']){_0x358ef3['tls']=!![];}else{_0x358ef3[_0xc53e('0x1d')]=![];_0x358ef3[_0xc53e('0x1e')]=_0xc53e('0x1f');}}else{if(_0x7cd798[_0xc53e('0x20')]){_0x358ef3[_0xc53e('0x21')]=utils[_0xc53e('0x22')](_0x7cd798[_0xc53e('0x23')][_0xc53e('0x24')],_0x7cd798[_0xc53e('0x19')]);_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];}else{_0x358ef3[_0xc53e('0x19')]=_0x7cd798[_0xc53e('0x19')];_0x358ef3['password']=_0x7cd798['password'];}_0x358ef3['host']=utils[_0xc53e('0x25')](_0x7cd798[_0xc53e('0x26')]);_0x358ef3[_0xc53e('0x1c')]=0x3e1;_0x358ef3[_0xc53e('0x1d')]=!![];}_0x358ef3[_0xc53e('0x27')]=_0x3d2e17||_0x7cd798['user']||'anonymous@xcally.com';return _0x358ef3;};EmailImap[_0xc53e('0x14')]['handleReady']=function(){this[_0xc53e('0x2')][_0xc53e('0x28')](this[_0xc53e('0x9')],![],this[_0xc53e('0x29')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x29')]=function(_0x4b9f6a,_0x4d9a68){if(_0x4b9f6a){this['handleError'](_0x4b9f6a,!![]);}else{this[_0xc53e('0x2a')]('box',_0x4d9a68);this[_0xc53e('0x2b')]();}};EmailImap['prototype'][_0xc53e('0x2c')]=function(_0x5112d2){if(_0x5112d2){this['handleError'](_0x5112d2,!![]);}else{this[_0xc53e('0x2')][_0xc53e('0x2d')]();}};EmailImap[_0xc53e('0x14')][_0xc53e('0x2b')]=function(){this[_0xc53e('0x2')][_0xc53e('0x2e')]([_0xc53e('0x2f')],this[_0xc53e('0x30')]['bind'](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x30')]=function(_0x2d36c0,_0x56206b){if(_0x2d36c0){this[_0xc53e('0x13')](_0x2d36c0,!![]);}else{if(_0x56206b['length']){try{var _0x4572e=this[_0xc53e('0x2')]['fetch'](_0x56206b,{'bodies':'','markSeen':!![]});_0x4572e['on']('message',this[_0xc53e('0x31')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x12'),this[_0xc53e('0x32')][_0xc53e('0x10')](this));_0x4572e[_0xc53e('0xd')](_0xc53e('0x2d'),this['handleFetchEnd'][_0xc53e('0x10')](this));}catch(_0x3bae8a){logger[_0xc53e('0x12')](_0x3bae8a);}}else{this[_0xc53e('0x2')][_0xc53e('0x33')](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));}}};EmailImap[_0xc53e('0x14')][_0xc53e('0x31')]=function(_0x595efb){_0x595efb['on'](_0xc53e('0x34'),this['handleMessageBody'][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('attributes',this[_0xc53e('0x35')][_0xc53e('0x10')](this));_0x595efb[_0xc53e('0xd')]('end',this[_0xc53e('0x36')][_0xc53e('0x10')](this));};EmailImap[_0xc53e('0x14')][_0xc53e('0x37')]=function(_0xeaec72){simpleParser(_0xeaec72,{'Iconv':Iconv},this[_0xc53e('0x38')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x35')]=function(){};EmailImap[_0xc53e('0x14')][_0xc53e('0x36')]=function(){};EmailImap['prototype'][_0xc53e('0x38')]=function(_0x5e8ab7,_0xaa00cd){if(_0x5e8ab7){logger[_0xc53e('0x12')](_0x5e8ab7);}else{var _0x40c4f5=this;utils[_0xc53e('0x39')](this[_0xc53e('0xc')],_0xaa00cd,function(_0x5507d0){_0x40c4f5[_0xc53e('0x2a')](_0xc53e('0x27'),_0x5507d0);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this[_0xc53e('0x2c')][_0xc53e('0x10')](this));};EmailImap['prototype'][_0xc53e('0x32')]=function(_0x574983){this['handleError'](_0x574983);this['imap'][_0xc53e('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xc53e('0x14')]['handleEnd']=function(){this[_0xc53e('0x2a')](_0xc53e('0x2d'));};EmailImap['prototype'][_0xc53e('0x13')]=function(_0x3a4ebc,_0x509a04){logger[_0xc53e('0x12')]('handleError',this['account']['email'],JSON['stringify'](_0x3a4ebc));var _0x887d78='';if(_0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3a')]){_0x887d78=_0x3a4ebc[_0xc53e('0x3a')];}else{for(var _0x5f1884 in _0x3a4ebc){if(_0x3a4ebc[_0xc53e('0x3b')](_0x5f1884)){_0x887d78+=_[_0xc53e('0x3c')](_0x5f1884)+':\x20'+_0x3a4ebc[_0x5f1884]+'\x0a';}}}}if(_0x509a04){this['imap']['end']();}else{this[_0xc53e('0x2a')](_0xc53e('0x12'),_0x887d78);this[_0xc53e('0x2a')]('end');}};module[_0xc53e('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index dbe24a8..0e3b959 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 _0x744f=['prototype','send','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x3872e6,_0x23ea68){var _0x57d9c7=function(_0x1f661f){while(--_0x1f661f){_0x3872e6['push'](_0x3872e6['shift']());}};_0x57d9c7(++_0x23ea68);}(_0x744f,0xda));var _0xf744=function(_0x3cce1e,_0x5e1011){_0x3cce1e=_0x3cce1e-0x0;var _0x2cc69d=_0x744f[_0x3cce1e];return _0x2cc69d;};'use strict';var nodemailer=require(_0xf744('0x0'));var inlineBase64=require(_0xf744('0x1'));function EmailSmtp(){}EmailSmtp[_0xf744('0x2')][_0xf744('0x3')]=function(_0x4bd6f8,_0x404fda){return new Promise(function(_0xd3d9d9,_0x261e9e){var _0x2c3f7b=nodemailer['createTransport'](_0x4bd6f8);_0x2c3f7b[_0xf744('0x4')](_0xf744('0x5'),inlineBase64());_0x2c3f7b[_0xf744('0x6')](_0x404fda,function(_0x147541,_0x136452){if(_0x147541){_0x261e9e(_0x147541[_0xf744('0x7')]());}else{_0xd3d9d9(_0x136452);}});});};EmailSmtp[_0xf744('0x2')][_0xf744('0x8')]=function(_0x159e37){return new Promise(function(_0x1db8df,_0x49ab9d){var _0x4d9d0a=nodemailer['createTransport'](_0x159e37);_0x4d9d0a[_0xf744('0x8')](function(_0x2bceb5,_0x5b0686){if(_0x2bceb5){_0x49ab9d(_0x2bceb5[_0xf744('0x7')]());}else{if(_0x5b0686){_0x1db8df(_0x5b0686);}else{_0x49ab9d(_0xf744('0x9'));}}});});};module[_0xf744('0xa')]=EmailSmtp; \ No newline at end of file +var _0xebff=['compile','sendMail','toString','verify','createTransport','Not\x20verifired','exports','prototype','send','use'];(function(_0x1b77aa,_0x1e6bc9){var _0x23be2d=function(_0x2bf0b7){while(--_0x2bf0b7){_0x1b77aa['push'](_0x1b77aa['shift']());}};_0x23be2d(++_0x1e6bc9);}(_0xebff,0x93));var _0xfebf=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xebff[_0x346737];return _0x1ade2e;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xfebf('0x0')][_0xfebf('0x1')]=function(_0x4aad47,_0x2fb27d){return new Promise(function(_0x490387,_0x4917a9){var _0x338340=nodemailer['createTransport'](_0x4aad47);_0x338340[_0xfebf('0x2')](_0xfebf('0x3'),inlineBase64());_0x338340[_0xfebf('0x4')](_0x2fb27d,function(_0x578a96,_0x3de32c){if(_0x578a96){_0x4917a9(_0x578a96[_0xfebf('0x5')]());}else{_0x490387(_0x3de32c);}});});};EmailSmtp['prototype'][_0xfebf('0x6')]=function(_0x21903c){return new Promise(function(_0x3f127c,_0x2f9e6c){var _0x1feb63=nodemailer[_0xfebf('0x7')](_0x21903c);_0x1feb63['verify'](function(_0x444e18,_0x2d4494){if(_0x444e18){_0x2f9e6c(_0x444e18[_0xfebf('0x5')]());}else{if(_0x2d4494){_0x3f127c(_0x2d4494);}else{_0x2f9e6c(_0xfebf('0x8'));}}});});};module[_0xfebf('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 16f12c1..4265eb7 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 _0x9abe=['base64','moment','randomstring','path','node-tnef','email','../../../config/environment','head','address','anonymous','generate','value','name','indexOf','length','slice','join','split','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','body','textAsHtml','message','originCc','originTo','attach','attachment','filename','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','Attachments','Title','

Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','utf-8'];(function(_0x40cdfa,_0x1cf634){var _0x2c5e4d=function(_0x1a666c){while(--_0x1a666c){_0x40cdfa['push'](_0x40cdfa['shift']());}};_0x2c5e4d(++_0x1cf634);}(_0x9abe,0xe5));var _0xe9ab=function(_0x3c7169,_0x1b863a){_0x3c7169=_0x3c7169-0x0;var _0x32d367=_0x9abe[_0x3c7169];return _0x32d367;};'use strict';var _=require('lodash');var moment=require(_0xe9ab('0x0'));var random=require(_0xe9ab('0x1'));var fs=require('fs');var path=require(_0xe9ab('0x2'));var util=require('util');var tnef=require(_0xe9ab('0x3'));var logger=require('../../../config/logger')(_0xe9ab('0x4'));var config=require(_0xe9ab('0x5'));function getAddress(_0x1d4b2f){var _0x3add34=_[_0xe9ab('0x6')](_0x1d4b2f['value']);return _0x3add34&&_0x3add34[_0xe9ab('0x7')]?_0x3add34[_0xe9ab('0x7')]:_0xe9ab('0x8')+random[_0xe9ab('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x4488eb){var _0x1d4b6d=_[_0xe9ab('0x6')](_0x4488eb[_0xe9ab('0xa')]);if(_0x1d4b6d&&_0x1d4b6d[_0xe9ab('0xb')]){if(_0x1d4b6d[_0xe9ab('0xb')]==_0x1d4b6d[_0xe9ab('0x7')]){return _0x1d4b6d[_0xe9ab('0xb')]['substring'](0x0,_0x1d4b6d[_0xe9ab('0xb')][_0xe9ab('0xc')]('@'));}var _0x5b023e=_0x1d4b6d[_0xe9ab('0xb')]['split'](/\s+/);return _0x5b023e[_0xe9ab('0xd')]>0x1?_0x5b023e[_0xe9ab('0xe')](0x0,-0x1)[_0xe9ab('0xf')]('\x20'):_0x1d4b6d[_0xe9ab('0xb')];}return'Anonymous';}function getLastName(_0x18e432){var _0x3981c0=_[_0xe9ab('0x6')](_0x18e432['value']);if(_0x3981c0&&_0x3981c0['name']){var _0x74af4d=_0x3981c0['name'][_0xe9ab('0x10')](/\s+/);return _0x74af4d[_0xe9ab('0xd')]>0x1?_0x74af4d[_0xe9ab('0x11')]():'';}return'';}function getMails(_0x33934f,_0x3040c8){var _0x355d29='';for(var _0x5af083=0x0;_0x5af083<_0x3040c8['value']['length'];_0x5af083+=0x1){if(_0x3040c8[_0xe9ab('0xa')][_0x5af083][_0xe9ab('0x7')]!==_0x33934f){if(!_[_0xe9ab('0x12')](_0x355d29)){_0x355d29+=',';}_0x355d29+=_0x3040c8[_0xe9ab('0xa')][_0x5af083]['name']||_0x3040c8[_0xe9ab('0xa')][_0x5af083]['address']||'';_0x355d29+='\x20<';_0x355d29+=_0x3040c8[_0xe9ab('0xa')][_0x5af083][_0xe9ab('0x7')]?_0x3040c8[_0xe9ab('0xa')][_0x5af083][_0xe9ab('0x7')]:_0xe9ab('0x8')+random[_0xe9ab('0x9')](0x6)+_0xe9ab('0x13');_0x355d29+='>';}}return _0x355d29;}function parseEmail(_0x41c046,_0x123246,_0x22f229){if(_0x123246[_0xe9ab('0x14')]){var _0x5e92a9=/)<[^<]*)*<\/script>/gi;while(_0x5e92a9[_0xe9ab('0x15')](_0x123246[_0xe9ab('0x14')])){_0x123246[_0xe9ab('0x14')]=_0x123246['html']['replace'](_0x5e92a9,'');}if(_0x123246[_0xe9ab('0x14')][_0xe9ab('0x16')](_0xe9ab('0x17'))){var _0xdd652b=[];_0x123246[_0xe9ab('0x18')][_0xe9ab('0x19')](_0x5e7494=>{_0xdd652b[_0xe9ab('0x1a')](_0x5e7494['filename']);});var _0x2a44d3=/]+>/g;var _0x1853f9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x341d64=_0x123246[_0xe9ab('0x14')]['replace'](_0x1853f9,_0xe9ab('0x1b'));var _0x113f35=_0x341d64[_0xe9ab('0x1c')](_0x2a44d3,_0xe9ab('0x1d'));for(let _0xde1e19=0x0;_0xde1e19<_0xdd652b['length'];_0xde1e19++){var _0x2026f5=_0x113f35[_0xe9ab('0x1c')](_0xe9ab('0x1d'),_0xe9ab('0x1e')+_0xdd652b[_0xde1e19]+'\x20]');_0x113f35=_0x2026f5;}_0x123246['html']=_0x113f35;}_0x22f229[_0xe9ab('0x1f')]=_0x123246[_0xe9ab('0x14')];}else{_0x22f229[_0xe9ab('0x1f')]=_0x123246[_0xe9ab('0x20')];}if(_0x22f229[_0xe9ab('0x1f')]){_0x22f229[_0xe9ab('0x1f')]=_0x22f229[_0xe9ab('0x1f')][_0xe9ab('0x1c')](/0x0){var _0xcab706=[_0xe9ab('0x30'),_0xe9ab('0x31'),'Precedence:\x20auto_reply'];for(var _0x58f667=0x0;_0x58f667<_0x123246[_0xe9ab('0x2f')][_0xe9ab('0xd')];_0x58f667++){var _0x50a9cf=_[_0xe9ab('0xc')](_0xcab706,_0x123246[_0xe9ab('0x2f')][_0x58f667][_0xe9ab('0x32')]);if(_0x50a9cf>=0x0){_0x22f229[_0xe9ab('0x33')]=!![];}}}return _0x22f229;}exports[_0xe9ab('0x34')]=function(_0x5a6248,_0x135076,_0x8d0323){var _0x27f8de={'from':getAddress(_0x135076[_0xe9ab('0x35')]),'firstName':getFirstName(_0x135076[_0xe9ab('0x35')]),'lastName':getLastName(_0x135076[_0xe9ab('0x35')]),'mapKey':'email','message':{'from':getMails(_0x5a6248['email'],_0x135076[_0xe9ab('0x35')]),'to':_0x5a6248[_0xe9ab('0x4')],'cc':'','subject':_0x135076['subject']||'','messageId':_0x135076['messageId'],'inReplyTo':_0x135076[_0xe9ab('0x36')],'sentAt':moment(_0x135076[_0xe9ab('0x37')])[_0xe9ab('0x28')](_0xe9ab('0x38')),'attach':![],'attachments':[]}};if(!_0x135076[_0xe9ab('0x14')]&&!_0x135076[_0xe9ab('0x20')]){var _0x3bb35c=_[_0xe9ab('0x39')](_0x135076[_0xe9ab('0x18')],{'contentType':_0xe9ab('0x3a')});if(_0x3bb35c['length']){logger['info'](util[_0xe9ab('0x28')](_0xe9ab('0x3b'),_0x135076['messageId']));tnef[_0xe9ab('0x3c')](_['first'](_0x3bb35c)[_0xe9ab('0x2d')],function(_0x29899d,_0x5e23cb){if(_0x5e23cb){_0x135076[_0xe9ab('0x14')]=_0x5e23cb['BodyHTML']||'

Empty\x20message

';if(_0x5e23cb[_0xe9ab('0x3d')]){for(var _0x2b02b9=0x0;_0x2b02b9<_0x5e23cb[_0xe9ab('0x3d')][_0xe9ab('0xd')];_0x2b02b9++){var _0x232412=_0x5e23cb[_0xe9ab('0x3d')][_0x2b02b9];_0x27f8de[_0xe9ab('0x21')]['attachments'][_0xe9ab('0x1a')]({'filename':_0x232412[_0xe9ab('0x3e')],'content':Buffer[_0xe9ab('0x35')](_0x232412['Data'])});}}}_0x8d0323(parseEmail(_0x5a6248,_0x135076,_0x27f8de));});}else{_0x135076[_0xe9ab('0x14')]=_0xe9ab('0x3f');_0x8d0323(parseEmail(_0x5a6248,_0x135076,_0x27f8de));}}else{_0x8d0323(parseEmail(_0x5a6248,_0x135076,_0x27f8de));}};exports[_0xe9ab('0x40')]=function(_0x35a0e9){switch(_0x35a0e9){case _0xe9ab('0x41'):return _0xe9ab('0x42');case _0xe9ab('0x43'):return _0xe9ab('0x44');case'hotmail':return _0xe9ab('0x45');case _0xe9ab('0x46'):return _0xe9ab('0x47');}return _0xe9ab('0x48');};exports[_0xe9ab('0x49')]=function(_0x12e78c,_0x42689b){var _0x426d19=['user='+(_0x42689b||''),'auth=Bearer\x20'+_0x12e78c,'',''];return Buffer['from'](_0x426d19[_0xe9ab('0xf')](''),_0xe9ab('0x4a'))['toString'](_0xe9ab('0x4b'));}; \ No newline at end of file +var _0xa7f6=['Precedence:\x20auto_reply','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','pop','isEmpty','generate','html','test','replace','attachments','forEach','push','\x20[Attachment:\x20','\x20]','textAsHtml','body','message','originTo','includes','originCc','bcc','attach','attachment','filename','attachment-','format','%s-%s','now','join','root','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0xa7f6,0x1b3));var _0x6a7f=function(_0x59531a,_0x42e761){_0x59531a=_0x59531a-0x0;var _0x31b12a=_0xa7f6[_0x59531a];return _0x31b12a;};'use strict';var _=require(_0x6a7f('0x0'));var moment=require(_0x6a7f('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x6a7f('0x2'));var util=require(_0x6a7f('0x3'));var tnef=require(_0x6a7f('0x4'));var logger=require(_0x6a7f('0x5'))(_0x6a7f('0x6'));var config=require(_0x6a7f('0x7'));function getAddress(_0x47e103){var _0x181f6b=_[_0x6a7f('0x8')](_0x47e103[_0x6a7f('0x9')]);return _0x181f6b&&_0x181f6b['address']?_0x181f6b[_0x6a7f('0xa')]:_0x6a7f('0xb')+random['generate'](0x6)+_0x6a7f('0xc');}function getFirstName(_0x45e284){var _0x344fe6=_['head'](_0x45e284['value']);if(_0x344fe6&&_0x344fe6[_0x6a7f('0xd')]){if(_0x344fe6[_0x6a7f('0xd')]==_0x344fe6['address']){return _0x344fe6[_0x6a7f('0xd')][_0x6a7f('0xe')](0x0,_0x344fe6[_0x6a7f('0xd')][_0x6a7f('0xf')]('@'));}var _0x3d3454=_0x344fe6['name'][_0x6a7f('0x10')](/\s+/);return _0x3d3454[_0x6a7f('0x11')]>0x1?_0x3d3454[_0x6a7f('0x12')](0x0,-0x1)['join']('\x20'):_0x344fe6[_0x6a7f('0xd')];}return _0x6a7f('0x13');}function getLastName(_0x30c5af){var _0x590ed4=_[_0x6a7f('0x8')](_0x30c5af[_0x6a7f('0x9')]);if(_0x590ed4&&_0x590ed4['name']){var _0x1ce14c=_0x590ed4[_0x6a7f('0xd')][_0x6a7f('0x10')](/\s+/);return _0x1ce14c['length']>0x1?_0x1ce14c[_0x6a7f('0x14')]():'';}return'';}function getMails(_0x451e2f,_0xeb5f45){var _0x27bd4d='';for(var _0x59657f=0x0;_0x59657f<_0xeb5f45[_0x6a7f('0x9')][_0x6a7f('0x11')];_0x59657f+=0x1){if(_0xeb5f45[_0x6a7f('0x9')][_0x59657f]['address']!==_0x451e2f){if(!_[_0x6a7f('0x15')](_0x27bd4d)){_0x27bd4d+=',';}_0x27bd4d+=_0xeb5f45[_0x6a7f('0x9')][_0x59657f][_0x6a7f('0xd')]||_0xeb5f45[_0x6a7f('0x9')][_0x59657f][_0x6a7f('0xa')]||'';_0x27bd4d+='\x20<';_0x27bd4d+=_0xeb5f45[_0x6a7f('0x9')][_0x59657f][_0x6a7f('0xa')]?_0xeb5f45[_0x6a7f('0x9')][_0x59657f][_0x6a7f('0xa')]:_0x6a7f('0xb')+random[_0x6a7f('0x16')](0x6)+'@xcally.com';_0x27bd4d+='>';}}return _0x27bd4d;}function parseEmail(_0x2d0ce4,_0x55489c,_0x559ade){if(_0x55489c[_0x6a7f('0x17')]){var _0x2e2cdb=/)<[^<]*)*<\/script>/gi;while(_0x2e2cdb[_0x6a7f('0x18')](_0x55489c[_0x6a7f('0x17')])){_0x55489c['html']=_0x55489c[_0x6a7f('0x17')][_0x6a7f('0x19')](_0x2e2cdb,'');}if(_0x55489c['html']['includes']('{_0x3f72ce[_0x6a7f('0x1c')](_0x3a6ebd['filename']);});var _0x4df452=/]+>/g;var _0x38d615=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x273afd=_0x55489c['html']['replace'](_0x38d615,'_SRC');var _0x42347b=_0x273afd[_0x6a7f('0x19')](_0x4df452,'_IMG');for(let _0x5c1b30=0x0;_0x5c1b30<_0x3f72ce[_0x6a7f('0x11')];_0x5c1b30++){var _0x5e6dfb=_0x42347b['replace']('_IMG',_0x6a7f('0x1d')+_0x3f72ce[_0x5c1b30]+_0x6a7f('0x1e'));_0x42347b=_0x5e6dfb;}_0x55489c[_0x6a7f('0x17')]=_0x42347b;}_0x559ade['body']=_0x55489c[_0x6a7f('0x17')];}else{_0x559ade['body']=_0x55489c[_0x6a7f('0x1f')];}if(_0x559ade[_0x6a7f('0x20')]){_0x559ade[_0x6a7f('0x20')]=_0x559ade['body']['replace'](/0x0){var _0xc77e1d=['Auto-Submitted:\x20auto-replied',_0x6a7f('0x32'),_0x6a7f('0x33')];for(var _0x48c39c=0x0;_0x48c39c<_0x55489c[_0x6a7f('0x31')]['length'];_0x48c39c++){var _0x112990=_[_0x6a7f('0xf')](_0xc77e1d,_0x55489c[_0x6a7f('0x31')][_0x48c39c]['line']);if(_0x112990>=0x0){_0x559ade[_0x6a7f('0x34')]=!![];}}}return _0x559ade;}exports[_0x6a7f('0x35')]=function(_0x1dcd7e,_0xc58f6f,_0x120208){var _0x473462={'from':getAddress(_0xc58f6f[_0x6a7f('0x36')]),'firstName':getFirstName(_0xc58f6f[_0x6a7f('0x36')]),'lastName':getLastName(_0xc58f6f['from']),'mapKey':'email','message':{'from':getMails(_0x1dcd7e[_0x6a7f('0x6')],_0xc58f6f['from']),'to':_0x1dcd7e[_0x6a7f('0x6')],'cc':'','subject':_0xc58f6f[_0x6a7f('0x37')]||'','messageId':_0xc58f6f[_0x6a7f('0x38')],'inReplyTo':_0xc58f6f['inReplyTo'],'sentAt':moment(_0xc58f6f[_0x6a7f('0x39')])[_0x6a7f('0x2a')](_0x6a7f('0x3a')),'attach':![],'attachments':[]}};if(!_0xc58f6f[_0x6a7f('0x17')]&&!_0xc58f6f[_0x6a7f('0x1f')]){var _0x279670=_[_0x6a7f('0x3b')](_0xc58f6f[_0x6a7f('0x1a')],{'contentType':_0x6a7f('0x3c')});if(_0x279670[_0x6a7f('0x11')]){logger['info'](util[_0x6a7f('0x2a')](_0x6a7f('0x3d'),_0xc58f6f['messageId']));tnef[_0x6a7f('0x3e')](_['first'](_0x279670)[_0x6a7f('0x2f')],function(_0xf61277,_0x153a71){if(_0x153a71){_0xc58f6f[_0x6a7f('0x17')]=_0x153a71[_0x6a7f('0x3f')]||_0x6a7f('0x40');if(_0x153a71['Attachments']){for(var _0x5c6b9c=0x0;_0x5c6b9c<_0x153a71[_0x6a7f('0x41')][_0x6a7f('0x11')];_0x5c6b9c++){var _0x4d0d20=_0x153a71[_0x6a7f('0x41')][_0x5c6b9c];_0x473462[_0x6a7f('0x21')][_0x6a7f('0x1a')][_0x6a7f('0x1c')]({'filename':_0x4d0d20[_0x6a7f('0x42')],'content':Buffer[_0x6a7f('0x36')](_0x4d0d20[_0x6a7f('0x43')])});}}}_0x120208(parseEmail(_0x1dcd7e,_0xc58f6f,_0x473462));});}else{_0xc58f6f['html']=_0x6a7f('0x40');_0x120208(parseEmail(_0x1dcd7e,_0xc58f6f,_0x473462));}}else{_0x120208(parseEmail(_0x1dcd7e,_0xc58f6f,_0x473462));}};exports[_0x6a7f('0x44')]=function(_0xd5ae47){switch(_0xd5ae47){case _0x6a7f('0x45'):return _0x6a7f('0x46');case _0x6a7f('0x47'):return _0x6a7f('0x48');case _0x6a7f('0x49'):return _0x6a7f('0x4a');case'outlook365':return'outlook.office365.com';}return'127.0.0.1';};exports[_0x6a7f('0x4b')]=function(_0x376577,_0x45ac1e){var _0x31d5f7=[_0x6a7f('0x4c')+(_0x45ac1e||''),_0x6a7f('0x4d')+_0x376577,'',''];return Buffer[_0x6a7f('0x36')](_0x31d5f7[_0x6a7f('0x2d')](''),_0x6a7f('0x4e'))[_0x6a7f('0x4f')](_0x6a7f('0x50'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 352b9de..d51e082 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 _0xf573=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0x29b3aa,_0x50f51f){var _0x303bbb=function(_0x299dcd){while(--_0x299dcd){_0x29b3aa['push'](_0x29b3aa['shift']());}};_0x303bbb(++_0x50f51f);}(_0xf573,0x1d8));var _0x3f57=function(_0x586465,_0x33d879){_0x586465=_0x586465-0x0;var _0x1ec8f5=_0xf573[_0x586465];return _0x1ec8f5;};'use strict';var _=require(_0x3f57('0x0'));function MailAccount(_0x2308e4){this['id']=_0x2308e4['id']||0x0;this[_0x3f57('0x1')]=_0x2308e4[_0x3f57('0x1')]||_0x3f57('0x2');this['key']=_0x2308e4[_0x3f57('0x3')]||_0x3f57('0x4');this[_0x3f57('0x5')]=_0x2308e4[_0x3f57('0x5')]||![];this[_0x3f57('0x6')]=_0x2308e4[_0x3f57('0x6')]||[];this[_0x3f57('0x7')]=_0x2308e4[_0x3f57('0x7')]||[];}module[_0x3f57('0x8')]=MailAccount; \ No newline at end of file +var _0x534b=['Imap','Smtp','exports','lodash','name','Service','key','SERV','active'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x534b,0xae));var _0xb534=function(_0x2ac081,_0x500948){_0x2ac081=_0x2ac081-0x0;var _0x14b31a=_0x534b[_0x2ac081];return _0x14b31a;};'use strict';var _=require(_0xb534('0x0'));function MailAccount(_0x179b04){this['id']=_0x179b04['id']||0x0;this[_0xb534('0x1')]=_0x179b04['name']||_0xb534('0x2');this[_0xb534('0x3')]=_0x179b04[_0xb534('0x3')]||_0xb534('0x4');this[_0xb534('0x5')]=_0x179b04[_0xb534('0x5')]||![];this[_0xb534('0x6')]=_0x179b04['Imap']||[];this['Smtp']=_0x179b04[_0xb534('0x7')]||[];}module[_0xb534('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 56bff12..0cd246c 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 _0x23a1=['hasOwnProperty','initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mapKeys','prototype','mergeFromDatabase'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x23a1,0x166));var _0x123a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x23a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x123a('0x0'));var MailAccount=require(_0x123a('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5e8021,_0xbf3096,_0x45177b){var _0x1ecea7=_[_0x123a('0x2')](_0x5e8021,function(_0x57e117,_0x119bbd){return _0x57e117[_0x45177b];});for(var _0x20f2ee in _0xbf3096){if(_0xbf3096['hasOwnProperty'](_0x20f2ee)){if(!_0x1ecea7[_0x20f2ee]){delete _0xbf3096[_0x20f2ee];}}}}Realtime[_0x123a('0x3')][_0x123a('0x4')]=function(_0x402a9a,_0x1dcb38){for(var _0x2fdc3a in _0x1dcb38){if(_0x402a9a[_0x123a('0x5')](_0x2fdc3a)){_0x402a9a[_0x2fdc3a]=_0x1dcb38[_0x2fdc3a];}}};Realtime[_0x123a('0x3')][_0x123a('0x6')]=function(){var _0x5c1146=this;return function(_0x4dd4f6){if(_0x4dd4f6){freeIsNotKey(_0x4dd4f6,_0x5c1146[_0x123a('0x7')],'id');for(var _0x173822=0x0,_0x30a81e={},_0x130c41={};_0x173822<_0x4dd4f6[_0x123a('0x8')];_0x173822+=0x1){_0x30a81e=_0x4dd4f6[_0x173822];if(_[_0x123a('0x9')](_0x5c1146[_0x123a('0x7')][_0x30a81e['id']])){_0x5c1146[_0x123a('0x7')][_0x30a81e['id']]=new MailAccount(_0x30a81e);}else{_[_0x123a('0xa')](_0x5c1146[_0x123a('0x7')][_0x30a81e['id']],_0x30a81e);}}}return _0x5c1146[_0x123a('0x7')];};};module['exports']=Realtime; \ No newline at end of file +var _0x80f5=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80f5,0x78));var _0x580f=function(_0x406ba5,_0x39fa4b){_0x406ba5=_0x406ba5-0x0;var _0x557db7=_0x80f5[_0x406ba5];return _0x557db7;};'use strict';var _=require(_0x580f('0x0'));var MailAccount=require(_0x580f('0x1'));var Realtime=function(){this[_0x580f('0x2')]={};};function freeIsNotKey(_0x51a746,_0x46aafa,_0x37561d){var _0x46cb8d=_[_0x580f('0x3')](_0x51a746,function(_0x5b2913,_0x2b4018){return _0x5b2913[_0x37561d];});for(var _0x3270a9 in _0x46aafa){if(_0x46aafa[_0x580f('0x4')](_0x3270a9)){if(!_0x46cb8d[_0x3270a9]){delete _0x46aafa[_0x3270a9];}}}}Realtime[_0x580f('0x5')][_0x580f('0x6')]=function(_0x1038d8,_0x169b74){for(var _0x47b9ea in _0x169b74){if(_0x1038d8[_0x580f('0x4')](_0x47b9ea)){_0x1038d8[_0x47b9ea]=_0x169b74[_0x47b9ea];}}};Realtime[_0x580f('0x5')][_0x580f('0x7')]=function(){var _0x1edde4=this;return function(_0x5e9fcb){if(_0x5e9fcb){freeIsNotKey(_0x5e9fcb,_0x1edde4[_0x580f('0x2')],'id');for(var _0x442eee=0x0,_0xbe636={},_0x4d53a3={};_0x442eee<_0x5e9fcb[_0x580f('0x8')];_0x442eee+=0x1){_0xbe636=_0x5e9fcb[_0x442eee];if(_[_0x580f('0x9')](_0x1edde4[_0x580f('0x2')][_0xbe636['id']])){_0x1edde4[_0x580f('0x2')][_0xbe636['id']]=new MailAccount(_0xbe636);}else{_['merge'](_0x1edde4[_0x580f('0x2')][_0xbe636['id']],_0xbe636);}}}return _0x1edde4[_0x580f('0x2')];};};module[_0x580f('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 6fbb2c7..48d05ac 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 _0x4c41=['Imap','CloudProvider','type','MailServerOut','Smtp','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','key','ListId','TemplateId','MailServerIn'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4c41,0xda));var _0x14c4=function(_0x4a1933,_0x375da7){_0x4a1933=_0x4a1933-0x0;var _0x533553=_0x4c41[_0x4a1933];return _0x533553;};'use strict';var client=require(_0x14c4('0x0'));exports[_0x14c4('0x1')]=function(){return function(){return client[_0x14c4('0x2')](_0x14c4('0x3'),{'options':{'attributes':['id',_0x14c4('0x4'),'provider',_0x14c4('0x5'),'email','active',_0x14c4('0x6'),_0x14c4('0x7'),_0x14c4('0x8')],'raw':![],'include':[{'model':_0x14c4('0x9'),'as':_0x14c4('0xa'),'include':[{'model':_0x14c4('0xb'),'attributes':['id','name',_0x14c4('0x5'),_0x14c4('0xc'),'data5'],'as':_0x14c4('0xb')}]},{'model':_0x14c4('0xd'),'as':_0x14c4('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x14c4('0x4'),_0x14c4('0x5'),'type',_0x14c4('0xf')],'as':_0x14c4('0xb')}]}]},'log':_0x14c4('0x10')});};};exports[_0x14c4('0x11')]=function(_0x4c8ea3,_0xdaf2cf){return client['Request']('NotifyMailAccount',{'account':{'id':_0x4c8ea3},'body':_0xdaf2cf,'log':_0x14c4('0x12')});}; \ No newline at end of file +var _0xde3a=['../client','getMailAccounts','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','name','type','data5','CloudProvider','MailServerOut','Smtp','notify','Request','NotifyMailAccount'];(function(_0x1def29,_0x5b842d){var _0x1a9cff=function(_0x2144c9){while(--_0x2144c9){_0x1def29['push'](_0x1def29['shift']());}};_0x1a9cff(++_0x5b842d);}(_0xde3a,0x140));var _0xade3=function(_0x16425c,_0x202e98){_0x16425c=_0x16425c-0x0;var _0x2fa54c=_0xde3a[_0x16425c];return _0x2fa54c;};'use strict';var client=require(_0xade3('0x0'));exports[_0xade3('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0xade3('0x2'),_0xade3('0x3'),_0xade3('0x4'),_0xade3('0x5'),_0xade3('0x6'),_0xade3('0x7'),_0xade3('0x8')],'raw':![],'include':[{'model':_0xade3('0x9'),'as':_0xade3('0xa'),'include':[{'model':'CloudProvider','attributes':['id',_0xade3('0xb'),_0xade3('0x3'),_0xade3('0xc'),_0xade3('0xd')],'as':_0xade3('0xe')}]},{'model':_0xade3('0xf'),'as':_0xade3('0x10'),'include':[{'model':'CloudProvider','attributes':['id',_0xade3('0xb'),_0xade3('0x3'),_0xade3('0xc'),_0xade3('0xd')],'as':_0xade3('0xe')}]}]},'log':'getMailAccount'});};};exports[_0xade3('0x11')]=function(_0x168c49,_0x3fabdf){return client[_0xade3('0x12')](_0xade3('0x13'),{'account':{'id':_0x168c49},'body':_0x3fabdf,'log':_0xade3('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 49d1c64..6af33fa 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 _0xfee8=['loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xfee8,0x14a));var _0x8fee=function(_0x34ac64,_0x23f246){_0x34ac64=_0x34ac64-0x0;var _0xae8ae9=_0xfee8[_0x34ac64];return _0xae8ae9;};'use strict';var client=require('../client');exports[_0x8fee('0x0')]=function(){return client[_0x8fee('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8fee('0x2')]},'log':_0x8fee('0x3')});}; \ No newline at end of file +var _0x81d8=['ShowSetting','loginMailFrequency','../client','getSettings','Request'];(function(_0x4eab93,_0x397ed6){var _0x44a622=function(_0x4a6a8e){while(--_0x4a6a8e){_0x4eab93['push'](_0x4eab93['shift']());}};_0x44a622(++_0x397ed6);}(_0x81d8,0x66));var _0x881d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81d8[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x881d('0x0'));exports[_0x881d('0x1')]=function(){return client[_0x881d('0x2')](_0x881d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x881d('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 3a00972..273812f 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 5bda7d0..ce3c6ef 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 _0xcf60=['defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','createServer','timeout','listen','socket.io','polling','redis'];(function(_0x29a2ff,_0x42a5cf){var _0x35fbb5=function(_0x358e35){while(--_0x358e35){_0x29a2ff['push'](_0x29a2ff['shift']());}};_0x35fbb5(++_0x42a5cf);}(_0xcf60,0x1c4));var _0x0cf6=function(_0x5c3d7c,_0xfd05cc){_0x5c3d7c=_0x5c3d7c-0x0;var _0xcb1e2f=_0xcf60[_0x5c3d7c];return _0xcb1e2f;};'use strict';var _=require(_0x0cf6('0x0'));var http=require(_0x0cf6('0x1'));var express=require('express');var sticky=require(_0x0cf6('0x2'));var Redis=require(_0x0cf6('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x0cf6('0x4')](app);server[_0x0cf6('0x5')]=0xdbba0;if(sticky[_0x0cf6('0x6')](server,config['port'])){var socketio=require(_0x0cf6('0x7'))(server,{'transports':['websocket',_0x0cf6('0x8')]});config[_0x0cf6('0x9')]=_[_0x0cf6('0xa')](config['redis'],{'host':_0x0cf6('0xb'),'port':0x18eb});socketio[_0x0cf6('0xc')](require(_0x0cf6('0xd'))({'pubClient':new Redis(config[_0x0cf6('0x9')]),'subClient':new Redis(config[_0x0cf6('0x9')])}));require(_0x0cf6('0xe'))[_0x0cf6('0xf')]();require(_0x0cf6('0x10'))['default'](socketio);require(_0x0cf6('0x11'))[_0x0cf6('0xf')](app);require(_0x0cf6('0x12'))[_0x0cf6('0xf')](app);}else{server['once']('listening',function(){console[_0x0cf6('0x13')](_0x0cf6('0x14'),config['port']);});}exports=module[_0x0cf6('0x15')]=app; \ No newline at end of file +var _0xb494=['websocket','polling','defaults','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','ioredis','createServer','listen','socket.io'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb494,0x93));var _0x4b49=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xb494[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0x4b49('0x0'));var http=require('http');var express=require(_0x4b49('0x1'));var sticky=require(_0x4b49('0x2'));var Redis=require(_0x4b49('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x4b49('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x4b49('0x5')](server,config['port'])){var socketio=require(_0x4b49('0x6'))(server,{'transports':[_0x4b49('0x7'),_0x4b49('0x8')]});config['redis']=_[_0x4b49('0x9')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x4b49('0xa')](require(_0x4b49('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x4b49('0xc'))[_0x4b49('0xd')]();require(_0x4b49('0xe'))[_0x4b49('0xd')](socketio);require('../../config/express')['default'](app);require(_0x4b49('0xf'))[_0x4b49('0xd')](app);}else{server[_0x4b49('0x10')](_0x4b49('0x11'),function(){console[_0x4b49('0x12')](_0x4b49('0x13'),config[_0x4b49('0x14')]);});}exports=module[_0x4b49('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index c1823cc..59b4362 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 _0x230f=['client','http','Request','then','debug','rpc','error','message','result','exports','jayson/promise','bluebird','routing'];(function(_0x3ae285,_0x27a64f){var _0x38de01=function(_0xdd2ac8){while(--_0xdd2ac8){_0x3ae285['push'](_0x3ae285['shift']());}};_0x38de01(++_0x27a64f);}(_0x230f,0x1eb));var _0xf230=function(_0x2a8841,_0x355633){_0x2a8841=_0x2a8841-0x0;var _0x164f64=_0x230f[_0x2a8841];return _0x164f64;};'use strict';var jayson=require(_0xf230('0x0'));var BPromise=require(_0xf230('0x1'));var logger=require('../../config/logger')(_0xf230('0x2'));var client=jayson[_0xf230('0x3')][_0xf230('0x4')]({'port':0x2329});client[_0xf230('0x5')]=function(_0x5785fe,_0x304415){return new BPromise(function(_0x2254e3,_0x2be505){return client['request'](_0x5785fe,_0x304415)[_0xf230('0x6')](function(_0x1e31f0){logger[_0xf230('0x7')](_0xf230('0x8'),_0xf230('0x2'),_0x5785fe,_0x304415,_0x1e31f0);if(_0x1e31f0[_0xf230('0x9')]){logger[_0xf230('0x9')](_0xf230('0x8'),'routing',_0x5785fe,_0x1e31f0['error'][_0xf230('0xa')],_0x304415);return _0x2be505(_0x1e31f0[_0xf230('0x9')][_0xf230('0xa')]);}else{return _0x2254e3(_0x1e31f0[_0xf230('0xb')]);}})['catch'](function(_0xecb375){logger[_0xf230('0x9')](_0xf230('0x8'),_0xf230('0x2'),_0x5785fe,_0xecb375,_0x304415);return _0x2be505(_0xecb375);});});};module[_0xf230('0xc')]=client; \ No newline at end of file +var _0x88f7=['then','rpc','error','message','catch','exports','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x46b7c8,_0x460808){var _0x198983=function(_0x2ebbcc){while(--_0x2ebbcc){_0x46b7c8['push'](_0x46b7c8['shift']());}};_0x198983(++_0x460808);}(_0x88f7,0x14a));var _0x788f=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x88f7[_0x257642];return _0x3d813b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x788f('0x0'));var logger=require(_0x788f('0x1'))(_0x788f('0x2'));var client=jayson[_0x788f('0x3')][_0x788f('0x4')]({'port':0x2329});client[_0x788f('0x5')]=function(_0x2e7398,_0xdaea7e){return new BPromise(function(_0x17706d,_0x120254){return client['request'](_0x2e7398,_0xdaea7e)[_0x788f('0x6')](function(_0x33d2c7){logger['debug'](_0x788f('0x7'),'routing',_0x2e7398,_0xdaea7e,_0x33d2c7);if(_0x33d2c7[_0x788f('0x8')]){logger[_0x788f('0x8')](_0x788f('0x7'),'routing',_0x2e7398,_0x33d2c7[_0x788f('0x8')][_0x788f('0x9')],_0xdaea7e);return _0x120254(_0x33d2c7['error'][_0x788f('0x9')]);}else{return _0x17706d(_0x33d2c7['result']);}})[_0x788f('0xa')](function(_0x25aae6){logger[_0x788f('0x8')](_0x788f('0x7'),_0x788f('0x2'),_0x2e7398,_0x25aae6,_0xdaea7e);return _0x120254(_0x25aae6);});});};module[_0x788f('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 07f4479..2ed7515 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 _0x1052=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x3fb947,_0x162636){var _0x2ced66=function(_0x2fb579){while(--_0x2fb579){_0x3fb947['push'](_0x3fb947['shift']());}};_0x2ced66(++_0x162636);}(_0x1052,0xcb));var _0x2105=function(_0x2cd809,_0x4cdedd){_0x2cd809=_0x2cd809-0x0;var _0x5a1519=_0x1052[_0x2cd809];return _0x5a1519;};'use strict';var BPromise=require(_0x2105('0x0'));var server=require(_0x2105('0x1'));var Realtime=require(_0x2105('0x2'));var user=require(_0x2105('0x3'));var interval=require(_0x2105('0x4'));var openchannelQueue=require(_0x2105('0x5'));var chatQueue=require(_0x2105('0x6'));var smsQueue=require(_0x2105('0x7'));var mailQueue=require(_0x2105('0x8'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x2105('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x2105('0xa')]()[_0x2105('0xb')](user[_0x2105('0xc')]())[_0x2105('0xb')](realtime['initAgents']())[_0x2105('0xb')](interval[_0x2105('0xd')]())['then'](realtime['initIntervals']())[_0x2105('0xb')](openchannelQueue[_0x2105('0xe')]())[_0x2105('0xb')](realtime[_0x2105('0xf')]())[_0x2105('0xb')](chatQueue[_0x2105('0x10')]())['then'](realtime[_0x2105('0x11')]())[_0x2105('0xb')](smsQueue['getSmsQueues']())[_0x2105('0xb')](realtime['initSmsQueues']())[_0x2105('0xb')](mailQueue[_0x2105('0x12')]())[_0x2105('0xb')](realtime[_0x2105('0x13')]())[_0x2105('0xb')](faxQueue[_0x2105('0x14')]())['then'](realtime['initFaxQueues']())[_0x2105('0xb')](whatsappQueue[_0x2105('0x15')]())['then'](realtime[_0x2105('0x16')]())[_0x2105('0xb')](function(){return realtime;});}function main(){return server[_0x2105('0x17')](realtime)[_0x2105('0xb')](function(_0x5dc797){return initRealtime();})[_0x2105('0xb')](function(_0x86bfee){return setInterval(initRealtime,0x1388);})[_0x2105('0x18')](function(_0x176a90){console[_0x2105('0x19')](_0x176a90);});}main(); \ No newline at end of file +var _0xa2ff=['initAgents','initIntervals','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x37f280,_0x3f4ccb){var _0x3417aa=function(_0xe83827){while(--_0xe83827){_0x37f280['push'](_0x37f280['shift']());}};_0x3417aa(++_0x3f4ccb);}(_0xa2ff,0xfe));var _0xfa2f=function(_0x2dd57a,_0x5aa3ea){_0x2dd57a=_0x2dd57a-0x0;var _0x249949=_0xa2ff[_0x2dd57a];return _0x249949;};'use strict';var BPromise=require(_0xfa2f('0x0'));var server=require(_0xfa2f('0x1'));var Realtime=require(_0xfa2f('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0xfa2f('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xfa2f('0x4'));var faxQueue=require(_0xfa2f('0x5'));var whatsappQueue=require(_0xfa2f('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xfa2f('0x7')]()[_0xfa2f('0x8')](user[_0xfa2f('0x9')]())[_0xfa2f('0x8')](realtime[_0xfa2f('0xa')]())['then'](interval['getIntervals']())[_0xfa2f('0x8')](realtime[_0xfa2f('0xb')]())[_0xfa2f('0x8')](openchannelQueue['getOpenchannelQueues']())[_0xfa2f('0x8')](realtime[_0xfa2f('0xc')]())['then'](chatQueue[_0xfa2f('0xd')]())[_0xfa2f('0x8')](realtime['initChatQueues']())[_0xfa2f('0x8')](smsQueue[_0xfa2f('0xe')]())[_0xfa2f('0x8')](realtime[_0xfa2f('0xf')]())['then'](mailQueue['getMailQueues']())[_0xfa2f('0x8')](realtime[_0xfa2f('0x10')]())[_0xfa2f('0x8')](faxQueue['getFaxQueues']())[_0xfa2f('0x8')](realtime[_0xfa2f('0x11')]())[_0xfa2f('0x8')](whatsappQueue['getWhatsappQueues']())[_0xfa2f('0x8')](realtime[_0xfa2f('0x12')]())[_0xfa2f('0x8')](function(){return realtime;});}function main(){return server[_0xfa2f('0x13')](realtime)['then'](function(_0x6aa0a7){return initRealtime();})[_0xfa2f('0x8')](function(_0xa9bcc9){return setInterval(initRealtime,0x1388);})[_0xfa2f('0x14')](function(_0x244cf7){console[_0xfa2f('0x15')](_0x244cf7);});}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 177dd7e..d31f939 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x38d852,_0x5ce645){var _0x105103=function(_0x5d2805){while(--_0x5d2805){_0x38d852['push'](_0x38d852['shift']());}};_0x105103(++_0x5ce645);}(_0x326f,0xd1));var _0xf326=function(_0x11bc7c,_0x53de6e){_0x11bc7c=_0x11bc7c-0x0;var _0x58c715=_0x326f[_0x11bc7c];return _0x58c715;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x571a36,_0x5936f2){var _0x4dd68e=function(_0x12d4c7){while(--_0x12d4c7){_0x571a36['push'](_0x571a36['shift']());}};_0x4dd68e(++_0x5936f2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x5fc3[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index ec76372..effd96a 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 _0x603d=['http','request','error','message','result','catch','SendMail','client'];(function(_0x1bb11e,_0x58fd78){var _0x422492=function(_0x5d8dfd){while(--_0x5d8dfd){_0x1bb11e['push'](_0x1bb11e['shift']());}};_0x422492(++_0x58fd78);}(_0x603d,0xc7));var _0xd603=function(_0x3ecebf,_0x11d3f1){_0x3ecebf=_0x3ecebf-0x0;var _0x452aa8=_0x603d[_0x3ecebf];return _0x452aa8;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xd603('0x0')][_0xd603('0x1')]({'port':0x232b});function request(_0x4946eb,_0x300896){return new BPromise(function(_0x515163,_0x139721){return client[_0xd603('0x2')](_0x4946eb,_0x300896)['then'](function(_0x49b97d){if(_0x49b97d[_0xd603('0x3')]){return _0x139721(_0x49b97d['error'][_0xd603('0x4')]);}else{return _0x515163(_0x49b97d[_0xd603('0x5')]);}})[_0xd603('0x6')](function(_0x184614){return _0x139721(_0x184614);});});}exports['sendMailMessage']=function(_0x350b5d,_0x1eff70){return request(_0xd603('0x7'),{'account':_0x350b5d,'message':_0x1eff70});}; \ No newline at end of file +var _0xda3d=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','then','error','message'];(function(_0x1c5835,_0x20431a){var _0x558ebf=function(_0x2bc9da){while(--_0x2bc9da){_0x1c5835['push'](_0x1c5835['shift']());}};_0x558ebf(++_0x20431a);}(_0xda3d,0xb8));var _0xdda3=function(_0x5c18e1,_0x246fab){_0x5c18e1=_0x5c18e1-0x0;var _0x9c9475=_0xda3d[_0x5c18e1];return _0x9c9475;};'use strict';var BPromise=require(_0xdda3('0x0'));var jayson=require(_0xdda3('0x1'));var client=jayson['client'][_0xdda3('0x2')]({'port':0x232b});function request(_0x16eee5,_0x410d9d){return new BPromise(function(_0x526de2,_0x55bc67){return client['request'](_0x16eee5,_0x410d9d)[_0xdda3('0x3')](function(_0x1c6574){if(_0x1c6574[_0xdda3('0x4')]){return _0x55bc67(_0x1c6574['error'][_0xdda3('0x5')]);}else{return _0x526de2(_0x1c6574[_0xdda3('0x6')]);}})[_0xdda3('0x7')](function(_0x3332df){return _0x55bc67(_0x3332df);});});}exports[_0xdda3('0x8')]=function(_0x29b121,_0x3de0da){return request(_0xdda3('0x9'),{'account':_0x29b121,'message':_0x3de0da});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 606edc2..6a42db2 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 _0x69c4=['stringify','emit','user:save','exports','lodash','moment','ioredis','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','prototype','getChannelStatus','Capacity','CurrentCapacity','working','idle','updateRealtime','chat','fax','sms','whatsapp','Status','StatusTime','toNumber','format','chatCurrentCapacity'];(function(_0x9c83e3,_0x460d22){var _0x5d1e0b=function(_0x1b45cc){while(--_0x1b45cc){_0x9c83e3['push'](_0x9c83e3['shift']());}};_0x5d1e0b(++_0x460d22);}(_0x69c4,0xf0));var _0x469c=function(_0x3d8a75,_0x33bb2b){_0x3d8a75=_0x3d8a75-0x0;var _0x209fa8=_0x69c4[_0x3d8a75];return _0x209fa8;};'use strict';var _=require(_0x469c('0x0'));var moment=require(_0x469c('0x1'));var md5=require('md5');var Redis=require(_0x469c('0x2'));var config=require('../../../config/environment');config[_0x469c('0x3')]=_[_0x469c('0x4')](config[_0x469c('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x469c('0x3')]));function Agent(_0x260cf8){this['id']=_0x260cf8['id']||0x0;this['name']=_0x260cf8[_0x469c('0x5')]||'';this['online']=_0x260cf8[_0x469c('0x6')]||!![];this[_0x469c('0x7')]=_0x260cf8[_0x469c('0x7')]||![];this[_0x469c('0x8')]=_0x260cf8[_0x469c('0x8')]||![];this['mailPause']=_0x260cf8[_0x469c('0x9')]||![];this[_0x469c('0xa')]=_0x260cf8[_0x469c('0xa')]||![];this[_0x469c('0xb')]=_0x260cf8['smsPause']||![];this[_0x469c('0xc')]=_0x260cf8['openchannelPause']||![];this[_0x469c('0xd')]=_0x469c('0xe');this['chatStatusTime']=0x0;this[_0x469c('0xf')]=_0x260cf8['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x469c('0x10')]=_0x469c('0xe');this[_0x469c('0x11')]=0x0;this[_0x469c('0x12')]=_0x260cf8[_0x469c('0x12')]||0x0;this[_0x469c('0x13')]=0x0;this[_0x469c('0x14')]=_0x469c('0xe');this[_0x469c('0x15')]=0x0;this['faxCapacity']=_0x260cf8[_0x469c('0x16')]||0x0;this[_0x469c('0x17')]=0x0;this[_0x469c('0x18')]=_0x469c('0xe');this[_0x469c('0x19')]=0x0;this[_0x469c('0x1a')]=_0x260cf8[_0x469c('0x1a')]||0x0;this[_0x469c('0x1b')]=0x0;this[_0x469c('0x1c')]='unknown';this[_0x469c('0x1d')]=0x0;this['whatsappCapacity']=_0x260cf8[_0x469c('0x1e')]||0x0;this[_0x469c('0x1f')]=0x0;this[_0x469c('0x20')]=_0x469c('0xe');this[_0x469c('0x21')]=0x0;this[_0x469c('0x22')]=_0x260cf8['openchannelCapacity']||0x0;this[_0x469c('0x23')]=0x0;this[_0x469c('0x24')]=![];this[_0x469c('0x25')]=undefined;this[_0x469c('0x26')]='';this['updateRealtime']();}Agent[_0x469c('0x27')][_0x469c('0x28')]=function(_0x37e45c){if(this[_0x37e45c+'CurrentCapacity']>0x0){if(this[_0x37e45c+_0x469c('0x29')]>0x0&&this[_0x37e45c+_0x469c('0x2a')]>=this[_0x37e45c+_0x469c('0x29')]){return'maxcapacity';}else{return _0x469c('0x2b');}}else{return _0x469c('0x2c');}};Agent[_0x469c('0x27')][_0x469c('0x2d')]=function(){var _0x252fdc=['mail',_0x469c('0x2e'),'openchannel',_0x469c('0x2f'),_0x469c('0x30'),_0x469c('0x31')];for(var _0x2b5844=0x0;_0x2b5844<_0x252fdc['length'];_0x2b5844+=0x1){var _0x3b2b2f=this['getChannelStatus'](_0x252fdc[_0x2b5844]);if(this[_0x252fdc[_0x2b5844]+_0x469c('0x32')]!==_0x3b2b2f){this[_0x252fdc[_0x2b5844]+_0x469c('0x33')]=_[_0x469c('0x34')](moment()[_0x469c('0x35')]('x'));}this[_0x252fdc[_0x2b5844]+_0x469c('0x32')]=_0x3b2b2f;}var _0x49444e={'id':this['id'],'name':this[_0x469c('0x5')],'online':this[_0x469c('0x6')],'voicePause':this[_0x469c('0x7')],'chatPause':this[_0x469c('0x8')],'mailPause':this[_0x469c('0x9')],'smsPause':this[_0x469c('0xb')],'faxPause':this[_0x469c('0xa')],'openchannelPause':this[_0x469c('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x469c('0xf')],'chatCurrentCapacity':this[_0x469c('0x36')],'mailStatus':this[_0x469c('0x10')],'mailStatusTime':this[_0x469c('0x11')],'mailCapacity':this[_0x469c('0x12')],'mailCurrentCapacity':this[_0x469c('0x13')],'faxStatus':this[_0x469c('0x14')],'faxStatusTime':this[_0x469c('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x469c('0x18')],'smsStatusTime':this[_0x469c('0x19')],'smsCapacity':this[_0x469c('0x1a')],'smsCurrentCapacity':this[_0x469c('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x469c('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x469c('0x21')],'openchannelCapacity':this[_0x469c('0x22')],'openchannelCurrentCapacity':this[_0x469c('0x23')],'busy':this[_0x469c('0x24')],'busyQueue':this[_0x469c('0x25')]};var _0x1b2df5=md5(JSON[_0x469c('0x37')](_0x49444e));if(this[_0x469c('0x26')]!==_0x1b2df5){this['md5']=_0x1b2df5;io[_0x469c('0x38')](_0x469c('0x39'),_0x49444e);}};module[_0x469c('0x3a')]=Agent; \ No newline at end of file +var _0xdab4=['busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailStatusTime','smsStatus','whatsappStatusTime','whatsappCurrentCapacity','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy'];(function(_0x5e74e3,_0x13f32b){var _0x3e6b62=function(_0x544fda){while(--_0x544fda){_0x5e74e3['push'](_0x5e74e3['shift']());}};_0x3e6b62(++_0x13f32b);}(_0xdab4,0x92));var _0x4dab=function(_0x11fb51,_0x22c8d1){_0x11fb51=_0x11fb51-0x0;var _0x3cf0ff=_0xdab4[_0x11fb51];return _0x3cf0ff;};'use strict';var _=require(_0x4dab('0x0'));var moment=require(_0x4dab('0x1'));var md5=require(_0x4dab('0x2'));var Redis=require(_0x4dab('0x3'));var config=require(_0x4dab('0x4'));config[_0x4dab('0x5')]=_['defaults'](config['redis'],{'host':_0x4dab('0x6'),'port':0x18eb});var io=require(_0x4dab('0x7'))(new Redis(config[_0x4dab('0x5')]));function Agent(_0x1404c2){this['id']=_0x1404c2['id']||0x0;this[_0x4dab('0x8')]=_0x1404c2['name']||'';this[_0x4dab('0x9')]=_0x1404c2[_0x4dab('0x9')]||!![];this['voicePause']=_0x1404c2[_0x4dab('0xa')]||![];this[_0x4dab('0xb')]=_0x1404c2['chatPause']||![];this[_0x4dab('0xc')]=_0x1404c2[_0x4dab('0xc')]||![];this['faxPause']=_0x1404c2[_0x4dab('0xd')]||![];this[_0x4dab('0xe')]=_0x1404c2[_0x4dab('0xe')]||![];this[_0x4dab('0xf')]=_0x1404c2[_0x4dab('0xf')]||![];this[_0x4dab('0x10')]=_0x4dab('0x11');this[_0x4dab('0x12')]=0x0;this[_0x4dab('0x13')]=_0x1404c2['chatCapacity']||0x0;this[_0x4dab('0x14')]=0x0;this[_0x4dab('0x15')]=_0x4dab('0x11');this['mailStatusTime']=0x0;this[_0x4dab('0x16')]=_0x1404c2['mailCapacity']||0x0;this[_0x4dab('0x17')]=0x0;this[_0x4dab('0x18')]=_0x4dab('0x11');this[_0x4dab('0x19')]=0x0;this['faxCapacity']=_0x1404c2[_0x4dab('0x1a')]||0x0;this[_0x4dab('0x1b')]=0x0;this['smsStatus']=_0x4dab('0x11');this['smsStatusTime']=0x0;this['smsCapacity']=_0x1404c2[_0x4dab('0x1c')]||0x0;this[_0x4dab('0x1d')]=0x0;this[_0x4dab('0x1e')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x1404c2[_0x4dab('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x4dab('0x20')]=_0x4dab('0x11');this[_0x4dab('0x21')]=0x0;this[_0x4dab('0x22')]=_0x1404c2[_0x4dab('0x22')]||0x0;this[_0x4dab('0x23')]=0x0;this[_0x4dab('0x24')]=![];this[_0x4dab('0x25')]=undefined;this['md5']='';this[_0x4dab('0x26')]();}Agent[_0x4dab('0x27')][_0x4dab('0x28')]=function(_0x5f1f54){if(this[_0x5f1f54+_0x4dab('0x29')]>0x0){if(this[_0x5f1f54+_0x4dab('0x2a')]>0x0&&this[_0x5f1f54+_0x4dab('0x29')]>=this[_0x5f1f54+_0x4dab('0x2a')]){return'maxcapacity';}else{return _0x4dab('0x2b');}}else{return _0x4dab('0x2c');}};Agent['prototype'][_0x4dab('0x26')]=function(){var _0x1a4ea4=['mail','chat',_0x4dab('0x2d'),_0x4dab('0x2e'),_0x4dab('0x2f'),_0x4dab('0x30')];for(var _0x4d324f=0x0;_0x4d324f<_0x1a4ea4[_0x4dab('0x31')];_0x4d324f+=0x1){var _0x19054b=this[_0x4dab('0x28')](_0x1a4ea4[_0x4d324f]);if(this[_0x1a4ea4[_0x4d324f]+_0x4dab('0x32')]!==_0x19054b){this[_0x1a4ea4[_0x4d324f]+_0x4dab('0x33')]=_[_0x4dab('0x34')](moment()[_0x4dab('0x35')]('x'));}this[_0x1a4ea4[_0x4d324f]+_0x4dab('0x32')]=_0x19054b;}var _0x1ed578={'id':this['id'],'name':this['name'],'online':this[_0x4dab('0x9')],'voicePause':this[_0x4dab('0xa')],'chatPause':this[_0x4dab('0xb')],'mailPause':this[_0x4dab('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x4dab('0xd')],'openchannelPause':this[_0x4dab('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x4dab('0x13')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x4dab('0x15')],'mailStatusTime':this[_0x4dab('0x36')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x4dab('0x17')],'faxStatus':this[_0x4dab('0x18')],'faxStatusTime':this[_0x4dab('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x4dab('0x1b')],'smsStatus':this[_0x4dab('0x37')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x4dab('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x4dab('0x1e')],'whatsappStatusTime':this[_0x4dab('0x38')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x4dab('0x39')],'openchannelStatus':this[_0x4dab('0x20')],'openchannelStatusTime':this[_0x4dab('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x4dab('0x24')],'busyQueue':this[_0x4dab('0x25')]};var _0x30c1e1=md5(JSON['stringify'](_0x1ed578));if(this[_0x4dab('0x2')]!==_0x30c1e1){this[_0x4dab('0x2')]=_0x30c1e1;io[_0x4dab('0x3a')](_0x4dab('0x3b'),_0x1ed578);}};module[_0x4dab('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 350b291..0145dfb 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 _0x05b4=['emit','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','chatPause','available','waiting','stringify','format','chat:queue:%s'];(function(_0x3fb13f,_0x1fabe7){var _0x94344c=function(_0x5ab3e4){while(--_0x5ab3e4){_0x3fb13f['push'](_0x3fb13f['shift']());}};_0x94344c(++_0x1fabe7);}(_0x05b4,0xbe));var _0x405b=function(_0x300441,_0xcb59ad){_0x300441=_0x300441-0x0;var _0x16899f=_0x05b4[_0x300441];return _0x16899f;};'use strict';var _=require('lodash');var md5=require(_0x405b('0x0'));var util=require(_0x405b('0x1'));var Redis=require(_0x405b('0x2'));var config=require(_0x405b('0x3'));config[_0x405b('0x4')]=_[_0x405b('0x5')](config[_0x405b('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x405b('0x6'))(new Redis(config[_0x405b('0x4')]));function ChatQueue(_0x1364c6){this['id']=_0x1364c6['id']||0x0;this[_0x405b('0x7')]=_0x1364c6[_0x405b('0x7')]||'';this[_0x405b('0x8')]=_0x1364c6[_0x405b('0x8')]||0xa;this[_0x405b('0x9')]=_0x1364c6[_0x405b('0x9')]||'beepall';this[_0x405b('0xa')]=_0x1364c6[_0x405b('0xa')];this[_0x405b('0xb')]={};this['waiting']=0x0;this[_0x405b('0x0')]='';this[_0x405b('0xc')]();this[_0x405b('0xd')]();}ChatQueue[_0x405b('0xe')][_0x405b('0xc')]=function(){var _0x2db6d1=this[_0x405b('0xb')]['_rr'];this[_0x405b('0xb')]=_[_0x405b('0xf')](this[_0x405b('0xa')],'id');this[_0x405b('0xb')][_0x405b('0x10')]=_0x2db6d1;};ChatQueue['prototype'][_0x405b('0xd')]=function(){this[_0x405b('0x11')]=0x0;this[_0x405b('0x12')]=0x0;for(var _0x1243f6=0x0;_0x1243f6=0x0?this[_0x405b('0x15')]:0x0;var _0x41cecd={'id':this['id'],'available':this[_0x405b('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x405b('0x7')],'paused':this['paused'],'waiting':this[_0x405b('0x16')]};var _0x24a818=md5(JSON[_0x405b('0x17')](_0x41cecd));if(this[_0x405b('0x0')]!==_0x24a818){this['md5']=_0x24a818;io['to'](util[_0x405b('0x18')](_0x405b('0x19'),_0x41cecd['name']))[_0x405b('0x1a')]('chat_queue:save',_0x41cecd);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xa558=['chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','online'];(function(_0x25c100,_0x5dec45){var _0x57e91c=function(_0x54b6e5){while(--_0x54b6e5){_0x25c100['push'](_0x25c100['shift']());}};_0x57e91c(++_0x5dec45);}(_0xa558,0xa4));var _0x8a55=function(_0xdbc8e3,_0x156f38){_0xdbc8e3=_0xdbc8e3-0x0;var _0x169148=_0xa558[_0xdbc8e3];return _0x169148;};'use strict';var _=require(_0x8a55('0x0'));var md5=require(_0x8a55('0x1'));var util=require(_0x8a55('0x2'));var Redis=require(_0x8a55('0x3'));var config=require(_0x8a55('0x4'));config[_0x8a55('0x5')]=_['defaults'](config['redis'],{'host':_0x8a55('0x6'),'port':0x18eb});var io=require(_0x8a55('0x7'))(new Redis(config[_0x8a55('0x5')]));function ChatQueue(_0x5ba5b1){this['id']=_0x5ba5b1['id']||0x0;this[_0x8a55('0x8')]=_0x5ba5b1[_0x8a55('0x8')]||'';this[_0x8a55('0x9')]=_0x5ba5b1[_0x8a55('0x9')]||0xa;this[_0x8a55('0xa')]=_0x5ba5b1[_0x8a55('0xa')]||_0x8a55('0xb');this['Agents']=_0x5ba5b1['Agents'];this[_0x8a55('0xc')]={};this[_0x8a55('0xd')]=0x0;this['md5']='';this[_0x8a55('0xe')]();this[_0x8a55('0xf')]();}ChatQueue[_0x8a55('0x10')][_0x8a55('0xe')]=function(){var _0x4ecf55=this[_0x8a55('0xc')][_0x8a55('0x11')];this[_0x8a55('0xc')]=_[_0x8a55('0x12')](this[_0x8a55('0x13')],'id');this['mapAgentsId'][_0x8a55('0x11')]=_0x4ecf55;};ChatQueue[_0x8a55('0x10')][_0x8a55('0xf')]=function(){this[_0x8a55('0x14')]=0x0;this['paused']=0x0;for(var _0x25b8cf=0x0;_0x25b8cf=0x0?this[_0x8a55('0x18')]:0x0;var _0x2bd72e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8a55('0x14')],'name':this[_0x8a55('0x8')],'paused':this[_0x8a55('0x17')],'waiting':this[_0x8a55('0xd')]};var _0x4399db=md5(JSON[_0x8a55('0x19')](_0x2bd72e));if(this[_0x8a55('0x1')]!==_0x4399db){this['md5']=_0x4399db;io['to'](util[_0x8a55('0x1a')](_0x8a55('0x1b'),_0x2bd72e[_0x8a55('0x8')]))[_0x8a55('0x1c')](_0x8a55('0x1d'),_0x2bd72e);}};module[_0x8a55('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 55bc3a9..d10f963 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 _0x3da2=['defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','_rr','map','prototype','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x19f33c,_0x4622c9){var _0x4954af=function(_0x3ebcb7){while(--_0x3ebcb7){_0x19f33c['push'](_0x19f33c['shift']());}};_0x4954af(++_0x4622c9);}(_0x3da2,0x1f3));var _0x23da=function(_0x38a88a,_0x19aa68){_0x38a88a=_0x38a88a-0x0;var _0x55837d=_0x3da2[_0x38a88a];return _0x55837d;};'use strict';var _=require(_0x23da('0x0'));var md5=require(_0x23da('0x1'));var util=require(_0x23da('0x2'));var Redis=require('ioredis');var config=require(_0x23da('0x3'));config[_0x23da('0x4')]=_[_0x23da('0x5')](config[_0x23da('0x4')],{'host':_0x23da('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x2f9b9c){this['id']=_0x2f9b9c['id']||0x0;this[_0x23da('0x7')]=_0x2f9b9c['name']||'';this['timeout']=_0x2f9b9c[_0x23da('0x8')]||0xa;this['strategy']=_0x2f9b9c['strategy']||_0x23da('0x9');this['Agents']=_0x2f9b9c[_0x23da('0xa')];this[_0x23da('0xb')]={};this[_0x23da('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x59ac08=this[_0x23da('0xb')][_0x23da('0xd')];this['mapAgentsId']=_[_0x23da('0xe')](this['Agents'],'id');this[_0x23da('0xb')][_0x23da('0xd')]=_0x59ac08;};FaxQueue[_0x23da('0xf')]['updateRealtime']=function(){this[_0x23da('0x10')]=0x0;this[_0x23da('0x11')]=0x0;for(var _0x2c1b26=0x0;_0x2c1b26=0x0?this['available']:0x0;var _0x3bbf59={'id':this['id'],'available':this['available'],'loggedIn':this[_0x23da('0x10')],'name':this[_0x23da('0x7')],'paused':this[_0x23da('0x11')],'waiting':this[_0x23da('0xc')]};var _0x4f76ac=md5(JSON[_0x23da('0x16')](_0x3bbf59));if(this[_0x23da('0x1')]!==_0x4f76ac){this[_0x23da('0x1')]=_0x4f76ac;io['to'](util[_0x23da('0x17')](_0x23da('0x18'),_0x3bbf59['name']))[_0x23da('0x19')](_0x23da('0x1a'),_0x3bbf59);}};module[_0x23da('0x1b')]=FaxQueue; \ No newline at end of file +var _0xa5d9=['stringify','format','fax:queue:%s','exports','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','faxPause','available','waiting'];(function(_0x5ed024,_0x20fcac){var _0x529b32=function(_0x373b27){while(--_0x373b27){_0x5ed024['push'](_0x5ed024['shift']());}};_0x529b32(++_0x20fcac);}(_0xa5d9,0x148));var _0x9a5d=function(_0x428ff4,_0x4f3aed){_0x428ff4=_0x428ff4-0x0;var _0x193c0e=_0xa5d9[_0x428ff4];return _0x193c0e;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x9a5d('0x0'));var Redis=require(_0x9a5d('0x1'));var config=require(_0x9a5d('0x2'));config[_0x9a5d('0x3')]=_[_0x9a5d('0x4')](config[_0x9a5d('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9a5d('0x3')]));function FaxQueue(_0x4dc836){this['id']=_0x4dc836['id']||0x0;this[_0x9a5d('0x5')]=_0x4dc836[_0x9a5d('0x5')]||'';this[_0x9a5d('0x6')]=_0x4dc836['timeout']||0xa;this[_0x9a5d('0x7')]=_0x4dc836[_0x9a5d('0x7')]||'beepall';this[_0x9a5d('0x8')]=_0x4dc836[_0x9a5d('0x8')];this[_0x9a5d('0x9')]={};this['waiting']=0x0;this[_0x9a5d('0xa')]='';this[_0x9a5d('0xb')]();this[_0x9a5d('0xc')]();}FaxQueue['prototype'][_0x9a5d('0xb')]=function(){var _0x2d37f2=this[_0x9a5d('0x9')][_0x9a5d('0xd')];this[_0x9a5d('0x9')]=_[_0x9a5d('0xe')](this[_0x9a5d('0x8')],'id');this['mapAgentsId']['_rr']=_0x2d37f2;};FaxQueue[_0x9a5d('0xf')][_0x9a5d('0xc')]=function(){this[_0x9a5d('0x10')]=0x0;this[_0x9a5d('0x11')]=0x0;for(var _0x2639b6=0x0;_0x2639b6=0x0?this[_0x9a5d('0x15')]:0x0;var _0x6bfc2f={'id':this['id'],'available':this[_0x9a5d('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x9a5d('0x5')],'paused':this[_0x9a5d('0x11')],'waiting':this[_0x9a5d('0x16')]};var _0x12fc25=md5(JSON[_0x9a5d('0x17')](_0x6bfc2f));if(this['md5']!==_0x12fc25){this[_0x9a5d('0xa')]=_0x12fc25;io['to'](util[_0x9a5d('0x18')](_0x9a5d('0x19'),_0x6bfc2f[_0x9a5d('0x5')]))['emit']('fax_queue:save',_0x6bfc2f);}};module[_0x9a5d('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9c89496..f8ca30f 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 _0xd358=['Intervals','exports','name'];(function(_0x58dc8a,_0x1765da){var _0x9461c4=function(_0x2dddc7){while(--_0x2dddc7){_0x58dc8a['push'](_0x58dc8a['shift']());}};_0x9461c4(++_0x1765da);}(_0xd358,0x1a9));var _0x8d35=function(_0x1b1384,_0x174dd0){_0x1b1384=_0x1b1384-0x0;var _0x19618a=_0xd358[_0x1b1384];return _0x19618a;};'use strict';function Interval(_0x2c3b04){this['id']=_0x2c3b04['id']||0x0;this[_0x8d35('0x0')]=_0x2c3b04[_0x8d35('0x0')]||'';this[_0x8d35('0x1')]=_0x2c3b04[_0x8d35('0x1')]||{};}module[_0x8d35('0x2')]=Interval; \ No newline at end of file +var _0xc10f=['name','Intervals','exports'];(function(_0x5a1a7d,_0x3fdf91){var _0x1dc271=function(_0x53f20b){while(--_0x53f20b){_0x5a1a7d['push'](_0x5a1a7d['shift']());}};_0x1dc271(++_0x3fdf91);}(_0xc10f,0xb1));var _0xfc10=function(_0x2745d8,_0x15fde8){_0x2745d8=_0x2745d8-0x0;var _0x12a3d8=_0xc10f[_0x2745d8];return _0x12a3d8;};'use strict';function Interval(_0x27f45e){this['id']=_0x27f45e['id']||0x0;this[_0xfc10('0x0')]=_0x27f45e[_0xfc10('0x0')]||'';this[_0xfc10('0x1')]=_0x27f45e[_0xfc10('0x1')]||{};}module[_0xfc10('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 2e7665d..321a6b3 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 _0x6459=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','mailPause','available','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0x6459,0xfb));var _0x9645=function(_0x104ef4,_0x52f1d9){_0x104ef4=_0x104ef4-0x0;var _0x26c030=_0x6459[_0x104ef4];return _0x26c030;};'use strict';var _=require(_0x9645('0x0'));var md5=require(_0x9645('0x1'));var util=require(_0x9645('0x2'));var Redis=require('ioredis');var config=require(_0x9645('0x3'));config[_0x9645('0x4')]=_[_0x9645('0x5')](config[_0x9645('0x4')],{'host':_0x9645('0x6'),'port':0x18eb});var io=require(_0x9645('0x7'))(new Redis(config[_0x9645('0x4')]));function MailQueue(_0x46d29a){this['id']=_0x46d29a['id']||0x0;this[_0x9645('0x8')]=_0x46d29a['name']||'';this[_0x9645('0x9')]=_0x46d29a[_0x9645('0x9')]||0xa;this[_0x9645('0xa')]=_0x46d29a['strategy']||_0x9645('0xb');this['Agents']=_0x46d29a[_0x9645('0xc')];this[_0x9645('0xd')]={};this[_0x9645('0xe')]=0x0;this[_0x9645('0x1')]='';this[_0x9645('0xf')]();this[_0x9645('0x10')]();}MailQueue[_0x9645('0x11')][_0x9645('0xf')]=function(){var _0x30e115=this[_0x9645('0xd')][_0x9645('0x12')];this['mapAgentsId']=_['map'](this[_0x9645('0xc')],'id');this['mapAgentsId'][_0x9645('0x12')]=_0x30e115;};MailQueue[_0x9645('0x11')][_0x9645('0x10')]=function(){this[_0x9645('0x13')]=0x0;this[_0x9645('0x14')]=0x0;for(var _0x3e9bc0=0x0;_0x3e9bc0=0x0?this[_0x9645('0x16')]:0x0;var _0x406a0c={'id':this['id'],'available':this[_0x9645('0x16')],'loggedIn':this[_0x9645('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x9645('0xe')]};var _0x5c4c06=md5(JSON['stringify'](_0x406a0c));if(this['md5']!==_0x5c4c06){this['md5']=_0x5c4c06;io['to'](util['format'](_0x9645('0x17'),_0x406a0c[_0x9645('0x8')]))['emit'](_0x9645('0x18'),_0x406a0c);}};module[_0x9645('0x19')]=MailQueue; \ No newline at end of file +var _0x1022=['map','loggedIn','length','available','stringify','format','emit','mail_queue:save','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr'];(function(_0x13bb29,_0x3cb459){var _0x540735=function(_0x3c64af){while(--_0x3c64af){_0x13bb29['push'](_0x13bb29['shift']());}};_0x540735(++_0x3cb459);}(_0x1022,0xb0));var _0x2102=function(_0xb04f6b,_0x1ade6){_0xb04f6b=_0xb04f6b-0x0;var _0x571dcb=_0x1022[_0xb04f6b];return _0x571dcb;};'use strict';var _=require('lodash');var md5=require(_0x2102('0x0'));var util=require('util');var Redis=require(_0x2102('0x1'));var config=require(_0x2102('0x2'));config[_0x2102('0x3')]=_[_0x2102('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2102('0x5'))(new Redis(config[_0x2102('0x3')]));function MailQueue(_0x1b2554){this['id']=_0x1b2554['id']||0x0;this[_0x2102('0x6')]=_0x1b2554[_0x2102('0x6')]||'';this['timeout']=_0x1b2554[_0x2102('0x7')]||0xa;this[_0x2102('0x8')]=_0x1b2554[_0x2102('0x8')]||_0x2102('0x9');this['Agents']=_0x1b2554[_0x2102('0xa')];this['mapAgentsId']={};this[_0x2102('0xb')]=0x0;this[_0x2102('0x0')]='';this[_0x2102('0xc')]();this['updateRealtime']();}MailQueue[_0x2102('0xd')][_0x2102('0xc')]=function(){var _0x4b1e1e=this[_0x2102('0xe')][_0x2102('0xf')];this['mapAgentsId']=_[_0x2102('0x10')](this[_0x2102('0xa')],'id');this[_0x2102('0xe')][_0x2102('0xf')]=_0x4b1e1e;};MailQueue['prototype']['updateRealtime']=function(){this[_0x2102('0x11')]=0x0;this['paused']=0x0;for(var _0x3775b7=0x0;_0x3775b7=0x0?this[_0x2102('0x13')]:0x0;var _0x591635={'id':this['id'],'available':this[_0x2102('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x2102('0x6')],'paused':this['paused'],'waiting':this[_0x2102('0xb')]};var _0x17d1ee=md5(JSON[_0x2102('0x14')](_0x591635));if(this[_0x2102('0x0')]!==_0x17d1ee){this[_0x2102('0x0')]=_0x17d1ee;io['to'](util[_0x2102('0x15')]('mail:queue:%s',_0x591635[_0x2102('0x6')]))[_0x2102('0x16')](_0x2102('0x17'),_0x591635);}};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 b4d952b..d9ffdde 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xa76db3,_0xf8fd0){var _0x47338e=function(_0x3163b6){while(--_0x3163b6){_0xa76db3['push'](_0xa76db3['shift']());}};_0x47338e(++_0xf8fd0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x5fc3[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x7a54,0x106));var _0x47a5=function(_0x5442ba,_0x450c37){_0x5442ba=_0x5442ba-0x0;var _0x14e9fd=_0x7a54[_0x5442ba];return _0x14e9fd;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 7308db8..01c5af6 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 _0x7d86=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0xed4017,_0x2e0190){var _0x2d0d1a=function(_0x180999){while(--_0x180999){_0xed4017['push'](_0xed4017['shift']());}};_0x2d0d1a(++_0x2e0190);}(_0x7d86,0x86));var _0x67d8=function(_0x1225f7,_0x542cba){_0x1225f7=_0x1225f7-0x0;var _0x415043=_0x7d86[_0x1225f7];return _0x415043;};'use strict';var _=require(_0x67d8('0x0'));var md5=require('md5');var util=require(_0x67d8('0x1'));var Redis=require(_0x67d8('0x2'));var config=require(_0x67d8('0x3'));config[_0x67d8('0x4')]=_[_0x67d8('0x5')](config[_0x67d8('0x4')],{'host':_0x67d8('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x67d8('0x4')]));function SmsQueue(_0x33de53){this['id']=_0x33de53['id']||0x0;this[_0x67d8('0x7')]=_0x33de53[_0x67d8('0x7')]||'';this[_0x67d8('0x8')]=_0x33de53[_0x67d8('0x8')]||0xa;this[_0x67d8('0x9')]=_0x33de53[_0x67d8('0x9')]||_0x67d8('0xa');this[_0x67d8('0xb')]=_0x33de53[_0x67d8('0xb')];this[_0x67d8('0xc')]={};this[_0x67d8('0xd')]=0x0;this[_0x67d8('0xe')]='';this[_0x67d8('0xf')]();this[_0x67d8('0x10')]();}SmsQueue[_0x67d8('0x11')][_0x67d8('0xf')]=function(){var _0x38107b=this[_0x67d8('0xc')][_0x67d8('0x12')];this['mapAgentsId']=_[_0x67d8('0x13')](this[_0x67d8('0xb')],'id');this[_0x67d8('0xc')]['_rr']=_0x38107b;};SmsQueue[_0x67d8('0x11')][_0x67d8('0x10')]=function(){this[_0x67d8('0x14')]=0x0;this[_0x67d8('0x15')]=0x0;for(var _0x2d54e6=0x0;_0x2d54e6=0x0?this[_0x67d8('0x18')]:0x0;var _0x23328d={'id':this['id'],'available':this[_0x67d8('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x67d8('0x7')],'paused':this[_0x67d8('0x15')],'waiting':this[_0x67d8('0xd')]};var _0x14a81f=md5(JSON[_0x67d8('0x19')](_0x23328d));if(this['md5']!==_0x14a81f){this[_0x67d8('0xe')]=_0x14a81f;io['to'](util[_0x67d8('0x1a')]('sms:queue:%s',_0x23328d['name']))[_0x67d8('0x1b')]('sms_queue:save',_0x23328d);}};module[_0x67d8('0x1c')]=SmsQueue; \ No newline at end of file +var _0x3667=['defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x58c84e,_0x197950){var _0x429da9=function(_0x3211f3){while(--_0x3211f3){_0x58c84e['push'](_0x58c84e['shift']());}};_0x429da9(++_0x197950);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var md5=require(_0x7366('0x1'));var util=require(_0x7366('0x2'));var Redis=require(_0x7366('0x3'));var config=require(_0x7366('0x4'));config['redis']=_[_0x7366('0x5')](config[_0x7366('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7366('0x7'))(new Redis(config[_0x7366('0x6')]));function SmsQueue(_0x1a35f8){this['id']=_0x1a35f8['id']||0x0;this[_0x7366('0x8')]=_0x1a35f8[_0x7366('0x8')]||'';this['timeout']=_0x1a35f8[_0x7366('0x9')]||0xa;this[_0x7366('0xa')]=_0x1a35f8[_0x7366('0xa')]||_0x7366('0xb');this[_0x7366('0xc')]=_0x1a35f8[_0x7366('0xc')];this[_0x7366('0xd')]={};this[_0x7366('0xe')]=0x0;this[_0x7366('0x1')]='';this[_0x7366('0xf')]();this[_0x7366('0x10')]();}SmsQueue[_0x7366('0x11')][_0x7366('0xf')]=function(){var _0x425ee4=this[_0x7366('0xd')][_0x7366('0x12')];this[_0x7366('0xd')]=_[_0x7366('0x13')](this[_0x7366('0xc')],'id');this[_0x7366('0xd')][_0x7366('0x12')]=_0x425ee4;};SmsQueue[_0x7366('0x11')][_0x7366('0x10')]=function(){this[_0x7366('0x14')]=0x0;this[_0x7366('0x15')]=0x0;for(var _0x27500c=0x0;_0x27500c=0x0?this[_0x7366('0x19')]:0x0;var _0x49e50b={'id':this['id'],'available':this[_0x7366('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x7366('0x8')],'paused':this[_0x7366('0x15')],'waiting':this[_0x7366('0xe')]};var _0x52b43e=md5(JSON[_0x7366('0x1a')](_0x49e50b));if(this[_0x7366('0x1')]!==_0x52b43e){this[_0x7366('0x1')]=_0x52b43e;io['to'](util['format'](_0x7366('0x1b'),_0x49e50b[_0x7366('0x8')]))['emit'](_0x7366('0x1c'),_0x49e50b);}};module[_0x7366('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 3c8810c..4c4a4c1 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 _0x8194=['name','emit','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','whatsappPause','available','paused','format'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x8194,0xc0));var _0x4819=function(_0x18350a,_0x105fe4){_0x18350a=_0x18350a-0x0;var _0x33050e=_0x8194[_0x18350a];return _0x33050e;};'use strict';var _=require(_0x4819('0x0'));var md5=require(_0x4819('0x1'));var util=require(_0x4819('0x2'));var Redis=require('ioredis');var config=require(_0x4819('0x3'));config[_0x4819('0x4')]=_[_0x4819('0x5')](config[_0x4819('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4819('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x24d077){this['id']=_0x24d077['id']||0x0;this['name']=_0x24d077['name']||'';this[_0x4819('0x7')]=_0x24d077[_0x4819('0x7')]||0xa;this['strategy']=_0x24d077['strategy']||_0x4819('0x8');this[_0x4819('0x9')]=_0x24d077[_0x4819('0x9')];this[_0x4819('0xa')]={};this[_0x4819('0xb')]=0x0;this['md5']='';this[_0x4819('0xc')]();this[_0x4819('0xd')]();}WhatsappQueue[_0x4819('0xe')][_0x4819('0xc')]=function(){var _0x4ea9bf=this[_0x4819('0xa')][_0x4819('0xf')];this[_0x4819('0xa')]=_[_0x4819('0x10')](this[_0x4819('0x9')],'id');this[_0x4819('0xa')]['_rr']=_0x4ea9bf;};WhatsappQueue[_0x4819('0xe')]['updateRealtime']=function(){this[_0x4819('0x11')]=0x0;this['paused']=0x0;for(var _0x2cd29b=0x0;_0x2cd29b=0x0?this[_0x4819('0x15')]:0x0;var _0x2b32e8={'id':this['id'],'available':this[_0x4819('0x15')],'loggedIn':this[_0x4819('0x11')],'name':this['name'],'paused':this[_0x4819('0x16')],'waiting':this[_0x4819('0xb')]};var _0x3e93df=md5(JSON['stringify'](_0x2b32e8));if(this[_0x4819('0x1')]!==_0x3e93df){this[_0x4819('0x1')]=_0x3e93df;io['to'](util[_0x4819('0x17')]('whatsapp:queue:%s',_0x2b32e8[_0x4819('0x18')]))[_0x4819('0x19')](_0x4819('0x1a'),_0x2b32e8);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x4828=['format','whatsapp:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify'];(function(_0x38cba1,_0x5e9f79){var _0xd79b4=function(_0x50919e){while(--_0x50919e){_0x38cba1['push'](_0x38cba1['shift']());}};_0xd79b4(++_0x5e9f79);}(_0x4828,0xc0));var _0x8482=function(_0x1af232,_0x543140){_0x1af232=_0x1af232-0x0;var _0x248a80=_0x4828[_0x1af232];return _0x248a80;};'use strict';var _=require(_0x8482('0x0'));var md5=require(_0x8482('0x1'));var util=require(_0x8482('0x2'));var Redis=require(_0x8482('0x3'));var config=require(_0x8482('0x4'));config[_0x8482('0x5')]=_['defaults'](config[_0x8482('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x5a33a2){this['id']=_0x5a33a2['id']||0x0;this[_0x8482('0x6')]=_0x5a33a2[_0x8482('0x6')]||'';this['timeout']=_0x5a33a2[_0x8482('0x7')]||0xa;this[_0x8482('0x8')]=_0x5a33a2[_0x8482('0x8')]||_0x8482('0x9');this[_0x8482('0xa')]=_0x5a33a2[_0x8482('0xa')];this[_0x8482('0xb')]={};this[_0x8482('0xc')]=0x0;this[_0x8482('0x1')]='';this['updateRouting']();this[_0x8482('0xd')]();}WhatsappQueue[_0x8482('0xe')][_0x8482('0xf')]=function(){var _0x24ce2f=this['mapAgentsId'][_0x8482('0x10')];this['mapAgentsId']=_[_0x8482('0x11')](this[_0x8482('0xa')],'id');this[_0x8482('0xb')][_0x8482('0x10')]=_0x24ce2f;};WhatsappQueue[_0x8482('0xe')]['updateRealtime']=function(){this[_0x8482('0x12')]=0x0;this[_0x8482('0x13')]=0x0;for(var _0x3dfb75=0x0;_0x3dfb75=0x0?this[_0x8482('0x16')]:0x0;var _0x3a1f5f={'id':this['id'],'available':this[_0x8482('0x16')],'loggedIn':this[_0x8482('0x12')],'name':this[_0x8482('0x6')],'paused':this[_0x8482('0x13')],'waiting':this[_0x8482('0xc')]};var _0x5d19e5=md5(JSON[_0x8482('0x17')](_0x3a1f5f));if(this[_0x8482('0x1')]!==_0x5d19e5){this[_0x8482('0x1')]=_0x5d19e5;io['to'](util[_0x8482('0x18')](_0x8482('0x19'),_0x3a1f5f[_0x8482('0x6')]))[_0x8482('0x1a')]('whatsapp_queue:save',_0x3a1f5f);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 0ccadf0..cfaea82 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 82a00eb..210caab 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 _0x4d18=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4d18,0x1c7));var _0x84d1=function(_0x4d2b53,_0x25f721){_0x4d2b53=_0x4d2b53-0x0;var _0x4bc453=_0x4d18[_0x4d2b53];return _0x4bc453;};'use strict';var client=require(_0x84d1('0x0'));exports[_0x84d1('0x1')]=function(_0x156c07,_0xfac9bd){return client[_0x84d1('0x2')](_0x84d1('0x3'),{'body':_0xfac9bd,'options':{'where':{'id':_0x156c07}},'log':_0x84d1('0x4')});};exports[_0x84d1('0x5')]=function(_0xb4ec1f,_0x413604){return client[_0x84d1('0x2')](_0x84d1('0x6'),{'body':_0x413604,'options':{'where':{'id':_0xb4ec1f}},'log':_0x84d1('0x7')});}; \ No newline at end of file +var _0x1cca=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1cca,0xea));var _0xa1cc=function(_0x29af00,_0x4053aa){_0x29af00=_0x29af00-0x0;var _0x12b1ed=_0x1cca[_0x29af00];return _0x12b1ed;};'use strict';var client=require(_0xa1cc('0x0'));exports[_0xa1cc('0x1')]=function(_0x503c41,_0x244225){return client[_0xa1cc('0x2')](_0xa1cc('0x3'),{'body':_0x244225,'options':{'where':{'id':_0x503c41}},'log':'updateChatInteraction'});};exports[_0xa1cc('0x4')]=function(_0x2c3905,_0x5a1f08){return client[_0xa1cc('0x2')](_0xa1cc('0x5'),{'body':_0x5a1f08,'options':{'where':{'id':_0x2c3905}},'log':_0xa1cc('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 27629a8..e86169e 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 _0x4113=['../client','Request','CreateChatMessage','createChatMessage'];(function(_0x410483,_0x411205){var _0x50e82b=function(_0x32a76c){while(--_0x32a76c){_0x410483['push'](_0x410483['shift']());}};_0x50e82b(++_0x411205);}(_0x4113,0xd8));var _0x3411=function(_0x397605,_0x2c5501){_0x397605=_0x397605-0x0;var _0xbc84d1=_0x4113[_0x397605];return _0xbc84d1;};'use strict';var client=require(_0x3411('0x0'));exports['create']=function(_0x73a5f){return client[_0x3411('0x1')](_0x3411('0x2'),{'body':_0x73a5f,'log':_0x3411('0x3')});}; \ No newline at end of file +var _0xb6a5=['create','CreateChatMessage','createChatMessage'];(function(_0x57c1c0,_0x4c5e66){var _0x36d1de=function(_0x59ae9c){while(--_0x59ae9c){_0x57c1c0['push'](_0x57c1c0['shift']());}};_0x36d1de(++_0x4c5e66);}(_0xb6a5,0x153));var _0x5b6a=function(_0xb1d6d4,_0x4dee3b){_0xb1d6d4=_0xb1d6d4-0x0;var _0x31030d=_0xb6a5[_0xb1d6d4];return _0x31030d;};'use strict';var client=require('../client');exports[_0x5b6a('0x0')]=function(_0x52b6fd){return client['Request'](_0x5b6a('0x1'),{'body':_0x52b6fd,'log':_0x5b6a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 4e7eb2a..4dd2d77 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 _0x5fc3=['name','timeout','strategy','User','online','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(){return function(){return client['Request'](_0x35fc('0x2'),{'options':{'raw':![],'attributes':['id',_0x35fc('0x3'),_0x35fc('0x4'),_0x35fc('0x5')],'include':[{'model':_0x35fc('0x6'),'as':'Agents','attributes':['id',_0x35fc('0x3'),_0x35fc('0x7'),_0x35fc('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x1061=['strategy','User','Agents','online','chatPause','../client','name','timeout'];(function(_0x3f80b9,_0x5a9025){var _0x1de77d=function(_0x521349){while(--_0x521349){_0x3f80b9['push'](_0x3f80b9['shift']());}};_0x1de77d(++_0x5a9025);}(_0x1061,0x1b5));var _0x1106=function(_0x3c9583,_0x333570){_0x3c9583=_0x3c9583-0x0;var _0x4819df=_0x1061[_0x3c9583];return _0x4819df;};'use strict';var client=require(_0x1106('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x1106('0x1'),_0x1106('0x2'),_0x1106('0x3')],'include':[{'model':_0x1106('0x4'),'as':_0x1106('0x5'),'attributes':['id',_0x1106('0x1'),_0x1106('0x6'),_0x1106('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 73ea56d..59e07c3 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 _0x89fe=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x89fe,0x83));var _0xe89f=function(_0x4959d0,_0x21f44b){_0x4959d0=_0x4959d0-0x0;var _0x2a7258=_0x89fe[_0x4959d0];return _0x2a7258;};'use strict';var client=require(_0xe89f('0x0'));exports[_0xe89f('0x1')]=function(_0x2aac3e){return client[_0xe89f('0x2')]('CreateChatQueueReport',{'body':_0x2aac3e,'log':_0xe89f('0x3')});};exports[_0xe89f('0x4')]=function(_0x580dce,_0x3d3aa8){return client[_0xe89f('0x2')](_0xe89f('0x5'),{'body':_0x3d3aa8,'options':{'where':{'uniqueid':_0x580dce},'order':[['id',_0xe89f('0x6')]],'limit':0x1},'log':_0xe89f('0x5')});}; \ No newline at end of file +var _0x4016=['UpdateChatQueueReport','create','update','Request'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x4016,0x131));var _0x6401=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4016[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports[_0x6401('0x0')]=function(_0x40f99f){return client['Request']('CreateChatQueueReport',{'body':_0x40f99f,'log':'CreateChatQueueReport'});};exports[_0x6401('0x1')]=function(_0x4de6b1,_0x4fc38){return client[_0x6401('0x2')]('UpdateChatQueueReport',{'body':_0x4fc38,'options':{'where':{'uniqueid':_0x4de6b1},'order':[['id','DESC']],'limit':0x1},'log':_0x6401('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ce37966..4380560 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x57ec28,_0x2c5feb){var _0xa7324f=function(_0x182d7c){while(--_0x182d7c){_0x57ec28['push'](_0x57ec28['shift']());}};_0xa7324f(++_0x2c5feb);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x7a54,0x106));var _0x47a5=function(_0x4875a0,_0x111f08){_0x4875a0=_0x4875a0-0x0;var _0x44d290=_0x7a54[_0x4875a0];return _0x44d290;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 52e0d07..d7a1d83 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 _0x89e7=['createFaxMessage','../client','create','Request'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x89e7,0x115));var _0x789e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x89e7[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x789e('0x0'));exports[_0x789e('0x1')]=function(_0x4365e8){return client[_0x789e('0x2')]('CreateFaxMessage',{'body':_0x4365e8,'log':_0x789e('0x3')});}; \ No newline at end of file +var _0xd2f2=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x52e53c,_0x514f11){var _0x3fe122=function(_0x24db31){while(--_0x24db31){_0x52e53c['push'](_0x52e53c['shift']());}};_0x3fe122(++_0x514f11);}(_0xd2f2,0x7c));var _0x2d2f=function(_0x1e45ec,_0x2e11eb){_0x1e45ec=_0x1e45ec-0x0;var _0x42f22d=_0xd2f2[_0x1e45ec];return _0x42f22d;};'use strict';var client=require('../client');exports[_0x2d2f('0x0')]=function(_0x45b6a8){return client[_0x2d2f('0x1')](_0x2d2f('0x2'),{'body':_0x45b6a8,'log':_0x2d2f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ee81093..307799e 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 _0xc3d9=['Request','GetFaxQueue','name','timeout','User','Agents','../client','getFaxQueues'];(function(_0x379d86,_0x1814be){var _0x383a3c=function(_0x1223eb){while(--_0x1223eb){_0x379d86['push'](_0x379d86['shift']());}};_0x383a3c(++_0x1814be);}(_0xc3d9,0x13e));var _0x9c3d=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0xc3d9[_0x2fdf82];return _0x2382f5;};'use strict';var client=require(_0x9c3d('0x0'));exports[_0x9c3d('0x1')]=function(){return function(){return client[_0x9c3d('0x2')](_0x9c3d('0x3'),{'options':{'raw':![],'attributes':['id',_0x9c3d('0x4'),_0x9c3d('0x5'),'strategy'],'include':[{'model':_0x9c3d('0x6'),'as':_0x9c3d('0x7'),'attributes':['id',_0x9c3d('0x4'),'online','faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x053a=['Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x053a,0x1a7));var _0xa053=function(_0x1a7ce7,_0x159cc7){_0x1a7ce7=_0x1a7ce7-0x0;var _0x2e9f64=_0x053a[_0x1a7ce7];return _0x2e9f64;};'use strict';var client=require('../client');exports[_0xa053('0x0')]=function(){return function(){return client[_0xa053('0x1')](_0xa053('0x2'),{'options':{'raw':![],'attributes':['id',_0xa053('0x3'),_0xa053('0x4'),_0xa053('0x5')],'include':[{'model':_0xa053('0x6'),'as':_0xa053('0x7'),'attributes':['id',_0xa053('0x3'),_0xa053('0x8'),_0xa053('0x9')]}]},'log':_0xa053('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index fea36fd..2717efd 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 _0x266e=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x266e,0x1d8));var _0xe266=function(_0x403064,_0x38f125){_0x403064=_0x403064-0x0;var _0x30cf56=_0x266e[_0x403064];return _0x30cf56;};'use strict';var client=require(_0xe266('0x0'));exports[_0xe266('0x1')]=function(_0x52a0cb){return client[_0xe266('0x2')]('CreateFaxQueueReport',{'body':_0x52a0cb,'log':_0xe266('0x3')});};exports[_0xe266('0x4')]=function(_0x493290,_0xc705f3){return client[_0xe266('0x2')](_0xe266('0x5'),{'body':_0xc705f3,'options':{'where':{'uniqueid':_0x493290},'order':[['id',_0xe266('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x1a5c=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x1a5c,0x100));var _0xc1a5=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1a5c[_0x2ec461];return _0x28603d;};'use strict';var client=require(_0xc1a5('0x0'));exports[_0xc1a5('0x1')]=function(_0x54fbc3){return client[_0xc1a5('0x2')](_0xc1a5('0x3'),{'body':_0x54fbc3,'log':'CreateFaxQueueReport'});};exports[_0xc1a5('0x4')]=function(_0x17e40c,_0x821c59){return client[_0xc1a5('0x2')](_0xc1a5('0x5'),{'body':_0x821c59,'options':{'where':{'uniqueid':_0x17e40c},'order':[['id',_0xc1a5('0x6')]],'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 ef90844..ab5badb 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 _0x54c6=['name','getIntervals','Request','GetInterval','Interval','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54c6,0x139));var _0x654c=function(_0x4b55e2,_0x27fa6){_0x4b55e2=_0x4b55e2-0x0;var _0x2fb1be=_0x54c6[_0x4b55e2];return _0x2fb1be;};'use strict';var client=require('../client');exports[_0x654c('0x0')]=function(){return function(){return client[_0x654c('0x1')](_0x654c('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x654c('0x3'),'as':_0x654c('0x4'),'attributes':['id',_0x654c('0x5'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x315a=['../client','GetInterval','Interval','Intervals','name','interval','getIntervals'];(function(_0xd9bad5,_0x3c6daf){var _0x297eaf=function(_0x454a9b){while(--_0x454a9b){_0xd9bad5['push'](_0xd9bad5['shift']());}};_0x297eaf(++_0x3c6daf);}(_0x315a,0x9a));var _0xa315=function(_0x511723,_0x4db8e2){_0x511723=_0x511723-0x0;var _0x25add0=_0x315a[_0x511723];return _0x25add0;};'use strict';var client=require(_0xa315('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xa315('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xa315('0x2'),'as':_0xa315('0x3'),'attributes':['id',_0xa315('0x4'),_0xa315('0x5')]}]},'log':_0xa315('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b4a86e0..73b5b26 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 _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x33af,0xec));var _0xf33a=function(_0x564242,_0x4159f7){_0x564242=_0x564242-0x0;var _0x2906fb=_0x33af[_0x564242];return _0x2906fb;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x8952=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x17e75d,_0x31c553){var _0x471643=function(_0x1c34fd){while(--_0x1c34fd){_0x17e75d['push'](_0x17e75d['shift']());}};_0x471643(++_0x31c553);}(_0x8952,0x17e));var _0x2895=function(_0x4af30f,_0x2a6971){_0x4af30f=_0x4af30f-0x0;var _0x2f85bc=_0x8952[_0x4af30f];return _0x2f85bc;};'use strict';var client=require('../client');exports[_0x2895('0x0')]=function(_0x2c099b,_0x43e8d9){return client[_0x2895('0x1')](_0x2895('0x2'),{'body':_0x43e8d9,'options':{'where':{'id':_0x2c099b}},'log':'updateMailInteraction'});};exports[_0x2895('0x3')]=function(_0xb5afd9,_0x1f69f6){return client['Request'](_0x2895('0x4'),{'body':_0x1f69f6,'options':{'where':{'id':_0xb5afd9}},'log':_0x2895('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b5a53f5..7a5ba27 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 _0xbc08=['Request','createMailMessage'];(function(_0x2fe47b,_0x3e7419){var _0x536cd6=function(_0x1a9c98){while(--_0x1a9c98){_0x2fe47b['push'](_0x2fe47b['shift']());}};_0x536cd6(++_0x3e7419);}(_0xbc08,0xd2));var _0x8bc0=function(_0x5e1c1f,_0x477de3){_0x5e1c1f=_0x5e1c1f-0x0;var _0x284a57=_0xbc08[_0x5e1c1f];return _0x284a57;};'use strict';var client=require('../client');exports['create']=function(_0xac83ce){return client[_0x8bc0('0x0')]('CreateMailMessage',{'body':_0xac83ce,'log':_0x8bc0('0x1')});}; \ No newline at end of file +var _0xfc6d=['createMailMessage','../client','create','CreateMailMessage'];(function(_0x57327d,_0x4d22be){var _0x136549=function(_0x10785b){while(--_0x10785b){_0x57327d['push'](_0x57327d['shift']());}};_0x136549(++_0x4d22be);}(_0xfc6d,0x7d));var _0xdfc6=function(_0x2df60d,_0x1e08b1){_0x2df60d=_0x2df60d-0x0;var _0x210ff1=_0xfc6d[_0x2df60d];return _0x210ff1;};'use strict';var client=require(_0xdfc6('0x0'));exports[_0xdfc6('0x1')]=function(_0x5738ec){return client['Request'](_0xdfc6('0x2'),{'body':_0x5738ec,'log':_0xdfc6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f43f536..37a9803 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 _0x3ee8=['Request','GetMailQueue','name','timeout','User','Agents','online','mailPause'];(function(_0x2fbb5c,_0x3ecbcc){var _0x581a52=function(_0x3ca627){while(--_0x3ca627){_0x2fbb5c['push'](_0x2fbb5c['shift']());}};_0x581a52(++_0x3ecbcc);}(_0x3ee8,0x188));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x83ee('0x0')](_0x83ee('0x1'),{'options':{'raw':![],'attributes':['id',_0x83ee('0x2'),_0x83ee('0x3'),'strategy'],'include':[{'model':_0x83ee('0x4'),'as':_0x83ee('0x5'),'attributes':['id',_0x83ee('0x2'),_0x83ee('0x6'),_0x83ee('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x6474=['strategy','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x3a6138,_0x122e5c){var _0x17e6f2=function(_0x4c4c36){while(--_0x4c4c36){_0x3a6138['push'](_0x3a6138['shift']());}};_0x17e6f2(++_0x122e5c);}(_0x6474,0x8a));var _0x4647=function(_0x544c0f,_0xb5249){_0x544c0f=_0x544c0f-0x0;var _0x2b0dff=_0x6474[_0x544c0f];return _0x2b0dff;};'use strict';var client=require(_0x4647('0x0'));exports[_0x4647('0x1')]=function(){return function(){return client[_0x4647('0x2')](_0x4647('0x3'),{'options':{'raw':![],'attributes':['id',_0x4647('0x4'),_0x4647('0x5'),_0x4647('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x4647('0x4'),_0x4647('0x7'),_0x4647('0x8')]}]},'log':_0x4647('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index cbc22a2..815a7bf 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 _0xd96a=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x1da80f,_0x59f7c8){var _0x382ff6=function(_0x469595){while(--_0x469595){_0x1da80f['push'](_0x1da80f['shift']());}};_0x382ff6(++_0x59f7c8);}(_0xd96a,0x81));var _0xad96=function(_0x5437fa,_0x429c45){_0x5437fa=_0x5437fa-0x0;var _0xc52711=_0xd96a[_0x5437fa];return _0xc52711;};'use strict';var client=require(_0xad96('0x0'));exports[_0xad96('0x1')]=function(_0x455203){return client[_0xad96('0x2')](_0xad96('0x3'),{'body':_0x455203,'log':_0xad96('0x3')});};exports[_0xad96('0x4')]=function(_0x8bb998,_0x54ad99){return client[_0xad96('0x2')](_0xad96('0x5'),{'body':_0x54ad99,'options':{'where':{'uniqueid':_0x8bb998},'order':[['id',_0xad96('0x6')]],'limit':0x1},'log':_0xad96('0x5')});}; \ No newline at end of file +var _0x193f=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x10568f,_0x20dd18){var _0x4fc717=function(_0x2bbb58){while(--_0x2bbb58){_0x10568f['push'](_0x10568f['shift']());}};_0x4fc717(++_0x20dd18);}(_0x193f,0x115));var _0xf193=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x193f[_0x273f77];return _0x71e147;};'use strict';var client=require(_0xf193('0x0'));exports[_0xf193('0x1')]=function(_0xcfc786){return client[_0xf193('0x2')](_0xf193('0x3'),{'body':_0xcfc786,'log':_0xf193('0x3')});};exports[_0xf193('0x4')]=function(_0x3e083b,_0x5c19ef){return client[_0xf193('0x2')](_0xf193('0x5'),{'body':_0x5c19ef,'options':{'where':{'uniqueid':_0x3e083b},'order':[['id',_0xf193('0x6')]],'limit':0x1},'log':_0xf193('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b7296fe..2e171c1 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 _0x39cc=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x10fb6e,_0x22949d){var _0x3b58e0=function(_0x2489e6){while(--_0x2489e6){_0x10fb6e['push'](_0x10fb6e['shift']());}};_0x3b58e0(++_0x22949d);}(_0x39cc,0xb8));var _0xc39c=function(_0x3e354a,_0x5b12a5){_0x3e354a=_0x3e354a-0x0;var _0x450168=_0x39cc[_0x3e354a];return _0x450168;};'use strict';var client=require(_0xc39c('0x0'));exports['update']=function(_0x10bcbc,_0x479b3a){return client[_0xc39c('0x1')](_0xc39c('0x2'),{'body':_0x479b3a,'options':{'where':{'id':_0x10bcbc}},'log':_0xc39c('0x3')});};exports[_0xc39c('0x4')]=function(_0x3af7cb,_0x397757){return client['Request'](_0xc39c('0x5'),{'body':_0x397757,'options':{'where':{'id':_0x3af7cb}},'log':_0xc39c('0x6')});}; \ No newline at end of file +var _0x9561=['UpdateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x543865,_0x502676){var _0x1d3e67=function(_0x3132e4){while(--_0x3132e4){_0x543865['push'](_0x543865['shift']());}};_0x1d3e67(++_0x502676);}(_0x9561,0x194));var _0x1956=function(_0x1c9263,_0x162625){_0x1c9263=_0x1c9263-0x0;var _0x4b7bec=_0x9561[_0x1c9263];return _0x4b7bec;};'use strict';var client=require(_0x1956('0x0'));exports[_0x1956('0x1')]=function(_0x163009,_0x4bece0){return client['Request'](_0x1956('0x2'),{'body':_0x4bece0,'options':{'where':{'id':_0x163009}},'log':'updateOpenchannelInteraction'});};exports[_0x1956('0x3')]=function(_0x435ddf,_0x4243e8){return client[_0x1956('0x4')](_0x1956('0x5'),{'body':_0x4243e8,'options':{'where':{'id':_0x435ddf}},'log':_0x1956('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 687d6bc..1fe8ff9 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 _0x838b=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x2210ab,_0x400b89){var _0x302300=function(_0x2c8508){while(--_0x2c8508){_0x2210ab['push'](_0x2210ab['shift']());}};_0x302300(++_0x400b89);}(_0x838b,0xab));var _0xb838=function(_0x490a31,_0x5440f0){_0x490a31=_0x490a31-0x0;var _0x3fe411=_0x838b[_0x490a31];return _0x3fe411;};'use strict';var client=require('../client');exports[_0xb838('0x0')]=function(_0x76b329){return client[_0xb838('0x1')](_0xb838('0x2'),{'body':_0x76b329,'log':_0xb838('0x3')});}; \ No newline at end of file +var _0x193b=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x25a928,_0x513718){var _0x2d2651=function(_0x42b32c){while(--_0x42b32c){_0x25a928['push'](_0x25a928['shift']());}};_0x2d2651(++_0x513718);}(_0x193b,0x114));var _0xb193=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x193b[_0x525798];return _0x57da9a;};'use strict';var client=require(_0xb193('0x0'));exports[_0xb193('0x1')]=function(_0x4c5acb){return client[_0xb193('0x2')](_0xb193('0x3'),{'body':_0x4c5acb,'log':_0xb193('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index aa96098..ef20ec9 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 _0xb1d9=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x39be76,_0x5bf653){var _0x1c163d=function(_0x352d7b){while(--_0x352d7b){_0x39be76['push'](_0x39be76['shift']());}};_0x1c163d(++_0x5bf653);}(_0xb1d9,0x147));var _0x9b1d=function(_0x1c9f12,_0x387041){_0x1c9f12=_0x1c9f12-0x0;var _0x48a3fc=_0xb1d9[_0x1c9f12];return _0x48a3fc;};'use strict';var client=require(_0x9b1d('0x0'));exports[_0x9b1d('0x1')]=function(){return function(){return client[_0x9b1d('0x2')](_0x9b1d('0x3'),{'options':{'raw':![],'attributes':['id',_0x9b1d('0x4'),_0x9b1d('0x5'),_0x9b1d('0x6')],'include':[{'model':_0x9b1d('0x7'),'as':_0x9b1d('0x8'),'attributes':['id','name','online',_0x9b1d('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x419d=['strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x24c7d4,_0x26ad19){var _0x5a3d82=function(_0x1e682a){while(--_0x1e682a){_0x24c7d4['push'](_0x24c7d4['shift']());}};_0x5a3d82(++_0x26ad19);}(_0x419d,0xcd));var _0xd419=function(_0x6e9a01,_0x41ab36){_0x6e9a01=_0x6e9a01-0x0;var _0x238469=_0x419d[_0x6e9a01];return _0x238469;};'use strict';var client=require('../client');exports[_0xd419('0x0')]=function(){return function(){return client[_0xd419('0x1')](_0xd419('0x2'),{'options':{'raw':![],'attributes':['id',_0xd419('0x3'),_0xd419('0x4'),_0xd419('0x5')],'include':[{'model':_0xd419('0x6'),'as':_0xd419('0x7'),'attributes':['id',_0xd419('0x3'),_0xd419('0x8'),_0xd419('0x9')]}]},'log':_0xd419('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 9e31f70..ed7f51d 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 _0xf1c9=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4b8903,_0xcb84a0){var _0x277233=function(_0x106c48){while(--_0x106c48){_0x4b8903['push'](_0x4b8903['shift']());}};_0x277233(++_0xcb84a0);}(_0xf1c9,0x12d));var _0x9f1c=function(_0x5b9767,_0x3cec4b){_0x5b9767=_0x5b9767-0x0;var _0x40208d=_0xf1c9[_0x5b9767];return _0x40208d;};'use strict';var client=require(_0x9f1c('0x0'));exports['create']=function(_0x16ceab){return client[_0x9f1c('0x1')](_0x9f1c('0x2'),{'body':_0x16ceab,'log':_0x9f1c('0x2')});};exports[_0x9f1c('0x3')]=function(_0x58790b,_0x232eac){return client['Request'](_0x9f1c('0x4'),{'body':_0x232eac,'options':{'where':{'uniqueid':_0x58790b},'order':[['id',_0x9f1c('0x5')]],'limit':0x1},'log':_0x9f1c('0x4')});}; \ No newline at end of file +var _0x54aa=['update','UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x32fe5b,_0x464e33){var _0x2440e5=function(_0x43522f){while(--_0x43522f){_0x32fe5b['push'](_0x32fe5b['shift']());}};_0x2440e5(++_0x464e33);}(_0x54aa,0x116));var _0xa54a=function(_0x2695d0,_0x5ef8f0){_0x2695d0=_0x2695d0-0x0;var _0x4f76eb=_0x54aa[_0x2695d0];return _0x4f76eb;};'use strict';var client=require(_0xa54a('0x0'));exports[_0xa54a('0x1')]=function(_0x102715){return client[_0xa54a('0x2')]('CreateOpenchannelQueueReport',{'body':_0x102715,'log':_0xa54a('0x3')});};exports[_0xa54a('0x4')]=function(_0x11205a,_0x5b17f5){return client[_0xa54a('0x2')](_0xa54a('0x5'),{'body':_0x5b17f5,'options':{'where':{'uniqueid':_0x11205a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 234953e..a773692 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 _0x8e94=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags'];(function(_0x235506,_0x458531){var _0x417e23=function(_0x3e57af){while(--_0x3e57af){_0x235506['push'](_0x235506['shift']());}};_0x417e23(++_0x458531);}(_0x8e94,0xf8));var _0x48e9=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x8e94[_0x237546];return _0x233e29;};'use strict';var client=require(_0x48e9('0x0'));exports[_0x48e9('0x1')]=function(_0x58af83,_0x2a7215){return client['Request'](_0x48e9('0x2'),{'body':_0x2a7215,'options':{'where':{'id':_0x58af83}},'log':'updateSmsInteraction'});};exports[_0x48e9('0x3')]=function(_0x5f4f1a,_0x506fa6){return client['Request'](_0x48e9('0x4'),{'body':_0x506fa6,'options':{'where':{'id':_0x5f4f1a}},'log':_0x48e9('0x5')});}; \ No newline at end of file +var _0x50b9=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x3719b7,_0x494695){var _0x1c049a=function(_0x54d57){while(--_0x54d57){_0x3719b7['push'](_0x3719b7['shift']());}};_0x1c049a(++_0x494695);}(_0x50b9,0x171));var _0x950b=function(_0x5af89d,_0xa40ecd){_0x5af89d=_0x5af89d-0x0;var _0x44e390=_0x50b9[_0x5af89d];return _0x44e390;};'use strict';var client=require(_0x950b('0x0'));exports['update']=function(_0x4734ea,_0x4b101f){return client[_0x950b('0x1')](_0x950b('0x2'),{'body':_0x4b101f,'options':{'where':{'id':_0x4734ea}},'log':_0x950b('0x3')});};exports[_0x950b('0x4')]=function(_0x237b83,_0x986b16){return client[_0x950b('0x1')](_0x950b('0x5'),{'body':_0x986b16,'options':{'where':{'id':_0x237b83}},'log':_0x950b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 6987b91..fd8d7f6 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 _0xf62a=['create','Request','createSmsMessage','../client'];(function(_0x197065,_0x2e79d0){var _0x3d9404=function(_0xf582a7){while(--_0xf582a7){_0x197065['push'](_0x197065['shift']());}};_0x3d9404(++_0x2e79d0);}(_0xf62a,0xe3));var _0xaf62=function(_0xa011f5,_0x3e5ea5){_0xa011f5=_0xa011f5-0x0;var _0x2b692e=_0xf62a[_0xa011f5];return _0x2b692e;};'use strict';var client=require(_0xaf62('0x0'));exports[_0xaf62('0x1')]=function(_0x71c5fd){return client[_0xaf62('0x2')]('CreateSmsMessage',{'body':_0x71c5fd,'log':_0xaf62('0x3')});}; \ No newline at end of file +var _0xef92=['Request','CreateSmsMessage'];(function(_0x22d8ff,_0x467fdc){var _0x403b65=function(_0x4583ae){while(--_0x4583ae){_0x22d8ff['push'](_0x22d8ff['shift']());}};_0x403b65(++_0x467fdc);}(_0xef92,0x15e));var _0x2ef9=function(_0x216ea8,_0x557f42){_0x216ea8=_0x216ea8-0x0;var _0x90bf0b=_0xef92[_0x216ea8];return _0x90bf0b;};'use strict';var client=require('../client');exports['create']=function(_0x61a86e){return client[_0x2ef9('0x0')](_0x2ef9('0x1'),{'body':_0x61a86e,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 10d167d..43b68c2 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x489896,_0x5e54a2){var _0x4b1255=function(_0x17d319){while(--_0x17d319){_0x489896['push'](_0x489896['shift']());}};_0x4b1255(++_0x5e54a2);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5d07aad..eb05fb0 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1a456a,_0x50fe05){var _0x23c52d=function(_0x4b1f65){while(--_0x4b1f65){_0x1a456a['push'](_0x1a456a['shift']());}};_0x23c52d(++_0x50fe05);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x3a4398,_0x22f80d){var _0x12ae09=function(_0x8cbbb3){while(--_0x8cbbb3){_0x3a4398['push'](_0x3a4398['shift']());}};_0x12ae09(++_0x22f80d);}(_0x70e0,0x17b));var _0x070e=function(_0x16fd1d,_0x5aa53e){_0x16fd1d=_0x16fd1d-0x0;var _0x1ebc86=_0x70e0[_0x16fd1d];return _0x1ebc86;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 01ebcc1..e0cf675 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(_0x54334a,_0x56bcd8){var _0x51cd78=function(_0x4f9df3){while(--_0x4f9df3){_0x54334a['push'](_0x54334a['shift']());}};_0x51cd78(++_0x56bcd8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x1bdbd7,_0x1e269){var _0x1d98ca=function(_0x5df7e4){while(--_0x5df7e4){_0x1bdbd7['push'](_0x1bdbd7['shift']());}};_0x1d98ca(++_0x1e269);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 b46db04..020e574 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 _0x323f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var client=require('../client');exports[_0xf323('0x0')]=function(_0x564979,_0x766661){return client[_0xf323('0x1')](_0xf323('0x2'),{'body':_0x766661,'options':{'where':{'id':_0x564979}},'log':_0xf323('0x3')});};exports[_0xf323('0x4')]=function(_0x2c9d35,_0xb4caa8){return client[_0xf323('0x1')](_0xf323('0x5'),{'body':_0xb4caa8,'options':{'where':{'id':_0x2c9d35}},'log':_0xf323('0x6')});}; \ No newline at end of file +var _0xffd6=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x5b0b6b,_0x1fc4c5){var _0x55a589=function(_0x225023){while(--_0x225023){_0x5b0b6b['push'](_0x5b0b6b['shift']());}};_0x55a589(++_0x1fc4c5);}(_0xffd6,0x97));var _0x6ffd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xffd6[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x6ffd('0x0'));exports[_0x6ffd('0x1')]=function(_0x292378,_0x4fadac){return client['Request'](_0x6ffd('0x2'),{'body':_0x4fadac,'options':{'where':{'id':_0x292378}},'log':_0x6ffd('0x3')});};exports[_0x6ffd('0x4')]=function(_0x560afa,_0x1d12e3){return client[_0x6ffd('0x5')](_0x6ffd('0x6'),{'body':_0x1d12e3,'options':{'where':{'id':_0x560afa}},'log':_0x6ffd('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 18e57f4..7abac79 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 _0xc833=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x5cef86,_0x22be08){var _0x5164cc=function(_0x13e26d){while(--_0x13e26d){_0x5cef86['push'](_0x5cef86['shift']());}};_0x5164cc(++_0x22be08);}(_0xc833,0x1f2));var _0x3c83=function(_0x1ca206,_0x2bd5d4){_0x1ca206=_0x1ca206-0x0;var _0x41ddd6=_0xc833[_0x1ca206];return _0x41ddd6;};'use strict';var client=require(_0x3c83('0x0'));exports[_0x3c83('0x1')]=function(_0x41cc1d){return client[_0x3c83('0x2')](_0x3c83('0x3'),{'body':_0x41cc1d,'log':_0x3c83('0x4')});}; \ No newline at end of file +var _0x31e4=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x31e4,0x142));var _0x431e=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x31e4[_0x334599];return _0x4cdff2;};'use strict';var client=require(_0x431e('0x0'));exports[_0x431e('0x1')]=function(_0x4220f6){return client[_0x431e('0x2')](_0x431e('0x3'),{'body':_0x4220f6,'log':_0x431e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index d5b29da..1a50dae 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 _0x2d06=['whatsappPause','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0x3d7579,_0x599163){var _0x4db38a=function(_0x535d6a){while(--_0x535d6a){_0x3d7579['push'](_0x3d7579['shift']());}};_0x4db38a(++_0x599163);}(_0x2d06,0x141));var _0x62d0=function(_0x120701,_0x261c55){_0x120701=_0x120701-0x0;var _0x6cdc95=_0x2d06[_0x120701];return _0x6cdc95;};'use strict';var client=require('../client');exports[_0x62d0('0x0')]=function(){return function(){return client['Request'](_0x62d0('0x1'),{'options':{'raw':![],'attributes':['id',_0x62d0('0x2'),_0x62d0('0x3'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x62d0('0x2'),'online',_0x62d0('0x4')]}]},'log':_0x62d0('0x0')});};}; \ No newline at end of file +var _0x9ad7=['getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9ad7,0x189));var _0x79ad=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9ad7[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x79ad('0x0'),{'options':{'raw':![],'attributes':['id',_0x79ad('0x1'),_0x79ad('0x2'),_0x79ad('0x3')],'include':[{'model':_0x79ad('0x4'),'as':_0x79ad('0x5'),'attributes':['id',_0x79ad('0x1'),_0x79ad('0x6'),'whatsappPause']}]},'log':_0x79ad('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5401a47..d695f54 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 _0x34e1=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x44eaf6,_0x47f444){var _0x30e5b0=function(_0x5bb46c){while(--_0x5bb46c){_0x44eaf6['push'](_0x44eaf6['shift']());}};_0x30e5b0(++_0x47f444);}(_0x34e1,0x1a4));var _0x134e=function(_0xbe90aa,_0x4be8c6){_0xbe90aa=_0xbe90aa-0x0;var _0x13fed0=_0x34e1[_0xbe90aa];return _0x13fed0;};'use strict';var client=require('../client');exports[_0x134e('0x0')]=function(_0x3c2f35){return client[_0x134e('0x1')](_0x134e('0x2'),{'body':_0x3c2f35,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x3aaef9,_0x1a96e7){return client['Request'](_0x134e('0x3'),{'body':_0x1a96e7,'options':{'where':{'uniqueid':_0x3aaef9},'order':[['id',_0x134e('0x4')]],'limit':0x1},'log':_0x134e('0x3')});}; \ No newline at end of file +var _0x68bf=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0xe16fcf,_0x2b5918){var _0x5981e9=function(_0x494df2){while(--_0x494df2){_0xe16fcf['push'](_0xe16fcf['shift']());}};_0x5981e9(++_0x2b5918);}(_0x68bf,0x155));var _0xf68b=function(_0x4e347b,_0x58155f){_0x4e347b=_0x4e347b-0x0;var _0x169a64=_0x68bf[_0x4e347b];return _0x169a64;};'use strict';var client=require(_0xf68b('0x0'));exports[_0xf68b('0x1')]=function(_0x535f4c){return client[_0xf68b('0x2')](_0xf68b('0x3'),{'body':_0x535f4c,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x1dd01f,_0x28c2f0){return client['Request'](_0xf68b('0x4'),{'body':_0x28c2f0,'options':{'where':{'uniqueid':_0x1dd01f},'order':[['id','DESC']],'limit':0x1},'log':_0xf68b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 242da52..a928c3e 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 _0x64b8=['stack','validate','util','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','stop','find','timeout','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s'];(function(_0x3f0068,_0x227667){var _0x1500ab=function(_0x39d99f){while(--_0x39d99f){_0x3f0068['push'](_0x3f0068['shift']());}};_0x1500ab(++_0x227667);}(_0x64b8,0xda));var _0x864b=function(_0x358a5f,_0x4a2991){_0x358a5f=_0x358a5f-0x0;var _0x400fbb=_0x64b8[_0x358a5f];return _0x400fbb;};'use strict';var schema=require(_0x864b('0x0'));var _=require('lodash');var util=require(_0x864b('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x864b('0x2')},'timeout':{'type':_0x864b('0x3'),'message':_0x864b('0x4')}});function writeLog(_0x5855ac,_0x3ed126,_0x185cd1){return logger[_0x864b('0x5')](util[_0x864b('0x6')](_0x864b('0x7'),_0x5855ac,_0x3ed126[_0x864b('0x8')],_0x185cd1));}function handleFindAgent(_0x101db7){return function(_0x58eb6b){return _0x58eb6b[_0x864b('0x8')][_0x864b('0x9')]()===_0x101db7[_0x864b('0x9')]();};}exports['consequence']=function(_0x48b3ac,_0x5a227b,_0x9d619,_0x12593b){return function(_0x2ba1fd){try{var _0x3cb1df={'name':_0x5a227b[0x0],'timeout':_0x5a227b[0x1]};var _0x32db6c=queue['validate'](_0x3cb1df,{'typecast':!![]});if(_0x32db6c['length']){logger[_0x864b('0xa')](_0x864b('0xb'),_0x48b3ac,_[_0x864b('0xc')](_0x32db6c,_0x864b('0xd'))['join'](',\x20'));_0x2ba1fd[_0x864b('0xe')]();}else{var _0xab6aa8=_[_0x864b('0xf')](_0x9d619['agents'],handleFindAgent(_0x3cb1df['name']));if(_0xab6aa8){var _0x56d0f6=(_0x3cb1df[_0x864b('0x10')]||0xa)*0x3e8;var _0x5492f7,_0x5d2036;var _0x51225d=seqqueue['createQueue'](_0x56d0f6);_0x51225d['id']=_0x48b3ac;_0x51225d[_0x864b('0x11')]=_0x56d0f6;_0x51225d['channel']=_0x12593b[_0x864b('0x12')];writeLog(_0x48b3ac,_0xab6aa8,util[_0x864b('0x6')](_0x864b('0x13'),_0x56d0f6));_0x9d619[_0x864b('0x14')][_0x48b3ac]['on']('end',function(){logger['info'](_0x864b('0x15'),_0x48b3ac);clearTimeout(_0x5d2036);_0x5d2036=undefined;_0x51225d[_0x864b('0x16')]();if(_0x9d619[_0x864b('0x14')][_0x48b3ac]){delete _0x9d619[_0x864b('0x14')][_0x48b3ac];}_0x2ba1fd[_0x864b('0xe')]();});_0x9d619[_0x864b('0x14')][_0x48b3ac]['on'](_0x864b('0x17'),function(){if(_0x9d619[_0x864b('0x14')][_0x48b3ac]){delete _0x9d619[_0x864b('0x14')][_0x48b3ac];}});_0x5d2036=setTimeout(function(){logger['info'](_0x864b('0x18'),_0x48b3ac);clearTimeout(_0x5d2036);_0x51225d[_0x864b('0x16')]();_0x2ba1fd[_0x864b('0x19')]();},_0x56d0f6);strategy[_0x864b('0x1a')](_0x51225d,_0xab6aa8,_0x9d619,_0x12593b);}else{logger[_0x864b('0xa')](_0x864b('0x1b'),_0x48b3ac,_0x3cb1df[_0x864b('0x8')]);_0x2ba1fd[_0x864b('0xe')]();}}}catch(_0xe66376){console[_0x864b('0x1c')](_0xe66376);logger[_0x864b('0xa')](_0x864b('0x1d'),_0x48b3ac,_0xe66376[_0x864b('0x1e')]);_0x2ba1fd[_0x864b('0xe')]();}};}; \ No newline at end of file +var _0xe631=['[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','[%s][AGENT]\x20%s','map','stop','find','agents','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe631,0x11f));var _0x1e63=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xe631[_0x3fb030];return _0xd6899b;};'use strict';var schema=require('validate');var _=require(_0x1e63('0x0'));var util=require(_0x1e63('0x1'));var seqqueue=require(_0x1e63('0x2'));var logger=require('../../../../config/logger')(_0x1e63('0x3'));var strategy=require(_0x1e63('0x4'));var queue=schema({'name':{'type':_0x1e63('0x5'),'required':!![],'message':_0x1e63('0x6')},'timeout':{'type':_0x1e63('0x7'),'message':_0x1e63('0x8')}});function writeLog(_0x11916b,_0x597ec9,_0x5be3b1){return logger[_0x1e63('0x9')](util[_0x1e63('0xa')](_0x1e63('0xb'),_0x11916b,_0x597ec9[_0x1e63('0xc')],_0x5be3b1));}function handleFindAgent(_0x55a45b){return function(_0x4c854b){return _0x4c854b[_0x1e63('0xc')]['toLowerCase']()===_0x55a45b[_0x1e63('0xd')]();};}exports['consequence']=function(_0x5e4a0e,_0x2f1b7a,_0x18908b,_0x714b70){return function(_0x18a63a){try{var _0x337acf={'name':_0x2f1b7a[0x0],'timeout':_0x2f1b7a[0x1]};var _0x1b265f=queue['validate'](_0x337acf,{'typecast':!![]});if(_0x1b265f['length']){logger['error'](_0x1e63('0xe'),_0x5e4a0e,_[_0x1e63('0xf')](_0x1b265f,'message')['join'](',\x20'));_0x18a63a[_0x1e63('0x10')]();}else{var _0x278e9a=_[_0x1e63('0x11')](_0x18908b[_0x1e63('0x12')],handleFindAgent(_0x337acf['name']));if(_0x278e9a){var _0x4f91b8=(_0x337acf[_0x1e63('0x13')]||0xa)*0x3e8;var _0x4c736d,_0x207f08;var _0x1b1c7e=seqqueue[_0x1e63('0x14')](_0x4f91b8);_0x1b1c7e['id']=_0x5e4a0e;_0x1b1c7e[_0x1e63('0x15')]=_0x4f91b8;_0x1b1c7e[_0x1e63('0x16')]=_0x714b70['channel'];writeLog(_0x5e4a0e,_0x278e9a,util[_0x1e63('0xa')]('START:%s',_0x4f91b8));_0x18908b[_0x1e63('0x17')][_0x5e4a0e]['on'](_0x1e63('0x18'),function(){logger[_0x1e63('0x9')](_0x1e63('0x19'),_0x5e4a0e);clearTimeout(_0x207f08);_0x207f08=undefined;_0x1b1c7e[_0x1e63('0x1a')]();if(_0x18908b[_0x1e63('0x17')][_0x5e4a0e]){delete _0x18908b['rules'][_0x5e4a0e];}_0x18a63a[_0x1e63('0x10')]();});_0x18908b[_0x1e63('0x17')][_0x5e4a0e]['on'](_0x1e63('0x1b'),function(){if(_0x18908b[_0x1e63('0x17')][_0x5e4a0e]){delete _0x18908b[_0x1e63('0x17')][_0x5e4a0e];}});_0x207f08=setTimeout(function(){logger[_0x1e63('0x9')](_0x1e63('0x1c'),_0x5e4a0e);clearTimeout(_0x207f08);_0x1b1c7e[_0x1e63('0x1a')]();_0x18a63a[_0x1e63('0x1d')]();},_0x4f91b8);strategy['agent'](_0x1b1c7e,_0x278e9a,_0x18908b,_0x714b70);}else{logger[_0x1e63('0x1e')](_0x1e63('0x1f'),_0x5e4a0e,_0x337acf['name']);_0x18a63a[_0x1e63('0x10')]();}}}catch(_0x59e46f){console[_0x1e63('0x20')](_0x59e46f);logger['error'](_0x1e63('0x21'),_0x5e4a0e,_0x59e46f[_0x1e63('0x22')]);_0x18a63a[_0x1e63('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 344c1d5..bd2c424 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 _0x39bd=['upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','stop','LexRuntime','message','postText','amazonlex','providerName','providerResponse','next','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','account'];(function(_0x4dbe10,_0x25ef1c){var _0x53d07f=function(_0x314744){while(--_0x314744){_0x4dbe10['push'](_0x4dbe10['shift']());}};_0x53d07f(++_0x25ef1c);}(_0x39bd,0x1bc));var _0xd39b=function(_0x321826,_0x52b3f8){_0x321826=_0x321826-0x0;var _0x206932=_0x39bd[_0x321826];return _0x206932;};'use strict';var _=require(_0xd39b('0x0'));var moment=require(_0xd39b('0x1'));var AWS=require('aws-sdk');var utils=require(_0xd39b('0x2'));var logger=require(_0xd39b('0x3'))(_0xd39b('0x4'));var rpc={'chatMessage':require(_0xd39b('0x5')),'openchannelMessage':require(_0xd39b('0x6')),'mailMessage':require(_0xd39b('0x7')),'smsMessage':require(_0xd39b('0x8')),'faxMessage':require(_0xd39b('0x9')),'whatsappMessage':require(_0xd39b('0xa'))};exports['consequence']=function(_0x43f88c,_0x4d70cb){return function(_0x52024f){try{if(!_[_0xd39b('0xb')](this['interaction'][_0xd39b('0xc')])){logger[_0xd39b('0xd')](_0xd39b('0xe'),_0x43f88c,_0xd39b('0xf'));return _0x52024f['next']();}var _0x4da06b={'ContactId':this[_0xd39b('0x10')]['id'],'sentAt':moment()[_0xd39b('0x11')](_0xd39b('0x12')),'direction':_0xd39b('0x13')};if(this['channel']==='sms'||this[_0xd39b('0x14')]===_0xd39b('0x15')){_0x4da06b[_0xd39b('0x16')]=this[_0xd39b('0x17')][_0xd39b('0x16')];}var _0xe7b9e2=this['channel'];if(_0xe7b9e2===_0xd39b('0x18')){_0x4da06b['ChatWebsiteId']=this[_0xd39b('0x19')]['id'];}else{_0x4da06b[_[_0xd39b('0x1a')](_0xe7b9e2)+_0xd39b('0x1b')]=this[_0xd39b('0x19')]['id'];}_0x4da06b[_[_0xd39b('0x1a')](_0xe7b9e2)+_0xd39b('0x1c')]=this['interaction']['id'];if(this[_0xd39b('0x17')][_0xd39b('0x1d')]){var _0xdd3de8=_0x4d70cb[0x4];if(!_[_0xd39b('0x1e')](_0xdd3de8)){_0x4da06b[_0xd39b('0x1f')]=utils[_0xd39b('0x20')](_0xdd3de8,this);return rpc[_0xe7b9e2+'Message'][_0xd39b('0x21')](_0x4da06b)[_0xd39b('0x22')](function(_0x37e59e){logger[_0xd39b('0xd')](_0xd39b('0xe'),_0x43f88c,_0x4da06b[_0xd39b('0x1f')]);})[_0xd39b('0x23')](function(_0x3b834a){logger[_0xd39b('0x24')]('[%s][AMAZONLEX]\x20%s',_0x43f88c,JSON[_0xd39b('0x25')](_0x3b834a));})[_0xd39b('0x26')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x43f88c);_0x52024f['stop']();});}else{logger[_0xd39b('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x43f88c);_0x52024f[_0xd39b('0x27')]();}}else{var _0x264d3c=this;var _0x1b2ac2=new AWS[(_0xd39b('0x28'))]({'accessKeyId':_0x4d70cb[0x0],'secretAccessKey':_0x4d70cb[0x1],'region':_0x4d70cb[0x2]});var _0x3dda3d={'botAlias':'$LATEST','botName':_0x4d70cb[0x3],'inputText':this[_0xd39b('0x29')][_0xd39b('0x1f')],'userId':this['channel']+':'+this[_0xd39b('0x17')]['id']['toString']()};_0x1b2ac2[_0xd39b('0x2a')](_0x3dda3d,function(_0x59ee55,_0xbcdcdc){if(_0x59ee55){logger[_0xd39b('0x24')](_0xd39b('0xe'),_0x43f88c,_0x59ee55[_0xd39b('0x29')]);_0x52024f['next']();}else if(_0xbcdcdc&&_0xbcdcdc[_0xd39b('0x29')]){_0x264d3c[_0xd39b('0x1f')][_0xd39b('0x2b')]=_0xbcdcdc;_0x4da06b[_0xd39b('0x1f')]=_0xbcdcdc[_0xd39b('0x29')];_0x4da06b[_0xd39b('0x2c')]=_0xd39b('0x2b');_0x4da06b[_0xd39b('0x2d')]=JSON['stringify'](_0xbcdcdc);return rpc[_0xe7b9e2+'Message'][_0xd39b('0x21')](_0x4da06b)['then'](function(_0x6b91b5){logger[_0xd39b('0xd')](_0xd39b('0xe'),_0x43f88c,_0x4da06b[_0xd39b('0x1f')]);if(_0xbcdcdc['dialogState']=='Failed'){_0x52024f[_0xd39b('0x2e')]();}else{_0x52024f[_0xd39b('0x27')]();}})[_0xd39b('0x23')](function(_0xab3251){logger[_0xd39b('0x24')](_0xd39b('0xe'),_0x43f88c,JSON[_0xd39b('0x25')](_0xab3251));_0x52024f[_0xd39b('0x2e')]();});}else{_0x52024f[_0xd39b('0x2e')]();}});}}catch(_0x27cb1e){logger[_0xd39b('0x24')]('[%s][AMAZONLEX]\x20%s',_0x43f88c,JSON[_0xd39b('0x25')](_0x27cb1e));_0x52024f[_0xd39b('0x27')]();}};}; \ No newline at end of file +var _0xd314=['stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','then','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','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','account','upperFirst','AccountId','InteractionId','created','isEmpty','create','body','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x582aab,_0x360d1f){var _0x3ee32e=function(_0xcf9e9a){while(--_0xcf9e9a){_0x582aab['push'](_0x582aab['shift']());}};_0x3ee32e(++_0x360d1f);}(_0xd314,0x1b2));var _0x4d31=function(_0x43b919,_0xc9df5b){_0x43b919=_0x43b919-0x0;var _0x482e1f=_0xd314[_0x43b919];return _0x482e1f;};'use strict';var _=require(_0x4d31('0x0'));var moment=require(_0x4d31('0x1'));var AWS=require(_0x4d31('0x2'));var utils=require(_0x4d31('0x3'));var logger=require(_0x4d31('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4d31('0x5')),'mailMessage':require(_0x4d31('0x6')),'smsMessage':require(_0x4d31('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x4d31('0x8')]=function(_0x4c0cf9,_0x141299){return function(_0x4426e8){try{if(!_['isNil'](this[_0x4d31('0x9')][_0x4d31('0xa')])){logger[_0x4d31('0xb')](_0x4d31('0xc'),_0x4c0cf9,_0x4d31('0xd'));return _0x4426e8[_0x4d31('0xe')]();}var _0x492a09={'ContactId':this[_0x4d31('0xf')]['id'],'sentAt':moment()[_0x4d31('0x10')](_0x4d31('0x11')),'direction':'out'};if(this[_0x4d31('0x12')]==='sms'||this[_0x4d31('0x12')]===_0x4d31('0x13')){_0x492a09[_0x4d31('0x14')]=this[_0x4d31('0x9')]['phone'];}var _0x2179bb=this[_0x4d31('0x12')];if(_0x2179bb===_0x4d31('0x15')){_0x492a09[_0x4d31('0x16')]=this[_0x4d31('0x17')]['id'];}else{_0x492a09[_[_0x4d31('0x18')](_0x2179bb)+_0x4d31('0x19')]=this[_0x4d31('0x17')]['id'];}_0x492a09[_[_0x4d31('0x18')](_0x2179bb)+_0x4d31('0x1a')]=this[_0x4d31('0x9')]['id'];if(this[_0x4d31('0x9')][_0x4d31('0x1b')]){var _0x5785b1=_0x141299[0x4];if(!_[_0x4d31('0x1c')](_0x5785b1)){_0x492a09['body']=utils['getMustacheRender'](_0x5785b1,this);return rpc[_0x2179bb+'Message'][_0x4d31('0x1d')](_0x492a09)['then'](function(_0x2467c6){logger[_0x4d31('0xb')](_0x4d31('0xc'),_0x4c0cf9,_0x492a09[_0x4d31('0x1e')]);})[_0x4d31('0x1f')](function(_0x2a957f){logger[_0x4d31('0x20')](_0x4d31('0xc'),_0x4c0cf9,JSON[_0x4d31('0x21')](_0x2a957f));})['finally'](function(){logger[_0x4d31('0xb')](_0x4d31('0x22'),_0x4c0cf9);_0x4426e8['stop']();});}else{logger[_0x4d31('0xb')](_0x4d31('0x23'),_0x4c0cf9);_0x4426e8[_0x4d31('0x24')]();}}else{var _0x192e7b=this;var _0x3b2717=new AWS[(_0x4d31('0x25'))]({'accessKeyId':_0x141299[0x0],'secretAccessKey':_0x141299[0x1],'region':_0x141299[0x2]});var _0x37f3e5={'botAlias':_0x4d31('0x26'),'botName':_0x141299[0x3],'inputText':this[_0x4d31('0x27')][_0x4d31('0x1e')],'userId':this[_0x4d31('0x12')]+':'+this[_0x4d31('0x9')]['id'][_0x4d31('0x28')]()};_0x3b2717[_0x4d31('0x29')](_0x37f3e5,function(_0x1a5162,_0x11d5d2){if(_0x1a5162){logger[_0x4d31('0x20')](_0x4d31('0xc'),_0x4c0cf9,_0x1a5162[_0x4d31('0x27')]);_0x4426e8[_0x4d31('0xe')]();}else if(_0x11d5d2&&_0x11d5d2[_0x4d31('0x27')]){_0x192e7b[_0x4d31('0x1e')][_0x4d31('0x2a')]=_0x11d5d2;_0x492a09[_0x4d31('0x1e')]=_0x11d5d2[_0x4d31('0x27')];_0x492a09[_0x4d31('0x2b')]=_0x4d31('0x2a');_0x492a09[_0x4d31('0x2c')]=JSON[_0x4d31('0x21')](_0x11d5d2);return rpc[_0x2179bb+'Message'][_0x4d31('0x1d')](_0x492a09)[_0x4d31('0x2d')](function(_0x3edbe2){logger['info'](_0x4d31('0xc'),_0x4c0cf9,_0x492a09[_0x4d31('0x1e')]);if(_0x11d5d2[_0x4d31('0x2e')]=='Failed'){_0x4426e8[_0x4d31('0xe')]();}else{_0x4426e8[_0x4d31('0x24')]();}})[_0x4d31('0x1f')](function(_0x59b50b){logger['error'](_0x4d31('0xc'),_0x4c0cf9,JSON[_0x4d31('0x21')](_0x59b50b));_0x4426e8['next']();});}else{_0x4426e8['next']();}});}}catch(_0x5bbe84){logger[_0x4d31('0x20')](_0x4d31('0xc'),_0x4c0cf9,JSON[_0x4d31('0x21')](_0x5bbe84));_0x4426e8[_0x4d31('0x24')]();}};}; \ 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 23b9566..c112664 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 _0x1a7d=['[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','getMustacheRender','message','from','read','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','html','replace','','headers','auto-replied','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error'];(function(_0x4c9a98,_0x194087){var _0x5be1fd=function(_0x30d8dd){while(--_0x30d8dd){_0x4c9a98['push'](_0x4c9a98['shift']());}};_0x5be1fd(++_0x194087);}(_0x1a7d,0x1ca));var _0xd1a7=function(_0x274838,_0x23a205){_0x274838=_0x274838-0x0;var _0x3f478c=_0x1a7d[_0x274838];return _0x3f478c;};'use strict';var _=require(_0xd1a7('0x0'));var moment=require(_0xd1a7('0x1'));var utils=require(_0xd1a7('0x2'));var logger=require('../../../../config/logger')(_0xd1a7('0x3'));var rpc={'chatMessage':require(_0xd1a7('0x4')),'openchannelMessage':require(_0xd1a7('0x5')),'mailMessage':require(_0xd1a7('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd1a7('0x7')),'whatsappMessage':require(_0xd1a7('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd1a7('0x9')),'mailInteraction':require(_0xd1a7('0xa')),'smsInteraction':require(_0xd1a7('0xb')),'faxInteraction':require(_0xd1a7('0xc')),'whatsappInteraction':require(_0xd1a7('0xd'))};var mailRpc=require(_0xd1a7('0xe'));exports['consequence']=function(_0x4200d5,_0x2ac005,_0x40e6b4,_0x24b0cc){return function(_0x303429){try{var _0x4fccce=this[_0xd1a7('0xf')];if(_0x4fccce===_0xd1a7('0x10')&&_0x24b0cc[_0xd1a7('0x11')][_0xd1a7('0x12')]){logger[_0xd1a7('0x13')](_0xd1a7('0x14'),_0x4200d5,_0xd1a7('0x15'));return _0x303429[_0xd1a7('0x16')]();}if(_0x2ac005[0x0]==='1'&&(_[_0xd1a7('0x17')](this['interaction'][_0xd1a7('0x18')])||!this['interaction'][_0xd1a7('0x18')])){logger[_0xd1a7('0x13')](_0xd1a7('0x14'),_0x4200d5,_0xd1a7('0x19'));return _0x303429[_0xd1a7('0x16')]();}if(_0x2ac005[0x0]==='2'&&this[_0xd1a7('0x1a')][_0xd1a7('0x1b')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4200d5,_0xd1a7('0x1c'));return _0x303429[_0xd1a7('0x16')]();}var _0x565803={'ContactId':this[_0xd1a7('0x1d')]['id'],'sentAt':moment()[_0xd1a7('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xd1a7('0xf')]===_0xd1a7('0x10')){_0x565803[_0xd1a7('0x11')]=utils[_0xd1a7('0x1f')](_0x2ac005[0x2],this);}else{_0x565803[_0xd1a7('0x11')]=utils['getMustacheRender'](_0x2ac005[0x1],this);}if(this[_0xd1a7('0x20')]){_0x565803['to']=this[_0xd1a7('0x20')]['from']||'';if(this[_0xd1a7('0xf')]===_0xd1a7('0x10')&&_0x2ac005[0x1]==='1'){_0x565803['cc']=this[_0xd1a7('0x20')]['cc']||'';}_0x565803[_0xd1a7('0x21')]=this[_0xd1a7('0x20')]['to']||'';_0x565803['phone']=this[_0xd1a7('0x20')]['phone']||'';_0x565803[_0xd1a7('0x22')]=!![];if(this['message']['subject']){_0x565803[_0xd1a7('0x23')]='';_0x565803[_0xd1a7('0x23')]+=_[_0xd1a7('0x24')](this[_0xd1a7('0x20')]['subject'],_0xd1a7('0x25'))?'':'Re:\x20';_0x565803[_0xd1a7('0x23')]+=this[_0xd1a7('0x20')][_0xd1a7('0x23')];}}if(this[_0xd1a7('0xf')]==='chat'){_0x565803[_0xd1a7('0x26')]=this[_0xd1a7('0x27')]['id'];}else{_0x565803[_['upperFirst'](this['channel'])+'AccountId']=this[_0xd1a7('0x27')]['id'];}_0x565803[_[_0xd1a7('0x28')](this['channel'])+_0xd1a7('0x29')]=this[_0xd1a7('0x1a')]['id'];var _0x349f90=this['interaction'];if(rpc[this[_0xd1a7('0xf')]+_0xd1a7('0x2a')]){if(this[_0xd1a7('0xf')]===_0xd1a7('0x10')){var _0x2a0426={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xd1a7('0x2b')][_0xd1a7('0x2c')]){_0x2a0426[_0xd1a7('0x2c')]=this['account']['Smtp']['service'];}else{_0x2a0426[_0xd1a7('0x2d')]=this[_0xd1a7('0x27')][_0xd1a7('0x2b')][_0xd1a7('0x2d')];_0x2a0426[_0xd1a7('0x2e')]=this[_0xd1a7('0x27')]['Smtp'][_0xd1a7('0x2e')];_0x2a0426[_0xd1a7('0x2f')]=this[_0xd1a7('0x27')][_0xd1a7('0x2b')][_0xd1a7('0x2f')];}if(this[_0xd1a7('0x27')][_0xd1a7('0x2b')][_0xd1a7('0x30')]){_0x2a0426[_0xd1a7('0x31')]={'user':this['account']['Smtp'][_0xd1a7('0x32')],'pass':this[_0xd1a7('0x27')][_0xd1a7('0x2b')]['pass']};}_0x565803[_0xd1a7('0x33')]=this[_0xd1a7('0x20')]['messageId'];_0x565803[_0xd1a7('0x34')]=''+_[_0xd1a7('0x35')](_0x565803[_0xd1a7('0x11')],'','replace','','headers','auto-replied','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','update','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','consequence','channel','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','mail','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x280913,_0x1aff07){var _0x2279a8=function(_0x31a473){while(--_0x31a473){_0x280913['push'](_0x280913['shift']());}};_0x2279a8(++_0x1aff07);}(_0xb0ce,0xa8));var _0xeb0c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb0ce[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeb0c('0x0'));var moment=require(_0xeb0c('0x1'));var utils=require(_0xeb0c('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xeb0c('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xeb0c('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xeb0c('0x5')),'chatInteraction':require(_0xeb0c('0x6')),'openchannelInteraction':require(_0xeb0c('0x7')),'mailInteraction':require(_0xeb0c('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0xeb0c('0x9')]=function(_0x4b1a2b,_0x30cfa8,_0x517fa6,_0x305977){return function(_0x5cfbad){try{var _0x1daca2=this[_0xeb0c('0xa')];if(_0x1daca2==='mail'&&_0x305977[_0xeb0c('0xb')]['isAutoreply']){logger[_0xeb0c('0xc')](_0xeb0c('0xd'),_0x4b1a2b,_0xeb0c('0xe'));return _0x5cfbad[_0xeb0c('0xf')]();}if(_0x30cfa8[0x0]==='1'&&(_[_0xeb0c('0x10')](this[_0xeb0c('0x11')][_0xeb0c('0x12')])||!this['interaction'][_0xeb0c('0x12')])){logger[_0xeb0c('0xc')](_0xeb0c('0xd'),_0x4b1a2b,_0xeb0c('0x13'));return _0x5cfbad['next']();}if(_0x30cfa8[0x0]==='2'&&this[_0xeb0c('0x11')]['autoreplyExecuted']){logger[_0xeb0c('0xc')](_0xeb0c('0x14'),_0x4b1a2b,_0xeb0c('0x15'));return _0x5cfbad[_0xeb0c('0xf')]();}var _0x3664bd={'ContactId':this[_0xeb0c('0x16')]['id'],'sentAt':moment()[_0xeb0c('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xeb0c('0x18')};if(this['channel']===_0xeb0c('0x19')){_0x3664bd['body']=utils[_0xeb0c('0x1a')](_0x30cfa8[0x2],this);}else{_0x3664bd[_0xeb0c('0xb')]=utils['getMustacheRender'](_0x30cfa8[0x1],this);}if(this[_0xeb0c('0x1b')]){_0x3664bd['to']=this['message'][_0xeb0c('0x1c')]||'';if(this[_0xeb0c('0xa')]===_0xeb0c('0x19')&&_0x30cfa8[0x1]==='1'){_0x3664bd['cc']=this[_0xeb0c('0x1b')]['cc']||'';}_0x3664bd[_0xeb0c('0x1c')]=this['message']['to']||'';_0x3664bd[_0xeb0c('0x1d')]=this[_0xeb0c('0x1b')][_0xeb0c('0x1d')]||'';_0x3664bd['read']=!![];if(this[_0xeb0c('0x1b')][_0xeb0c('0x1e')]){_0x3664bd[_0xeb0c('0x1e')]='';_0x3664bd[_0xeb0c('0x1e')]+=_[_0xeb0c('0x1f')](this['message'][_0xeb0c('0x1e')],_0xeb0c('0x20'))?'':'Re:\x20';_0x3664bd[_0xeb0c('0x1e')]+=this['message']['subject'];}}if(this[_0xeb0c('0xa')]===_0xeb0c('0x21')){_0x3664bd[_0xeb0c('0x22')]=this[_0xeb0c('0x23')]['id'];}else{_0x3664bd[_['upperFirst'](this[_0xeb0c('0xa')])+'AccountId']=this[_0xeb0c('0x23')]['id'];}_0x3664bd[_['upperFirst'](this['channel'])+'InteractionId']=this[_0xeb0c('0x11')]['id'];var _0x9cbb3a=this[_0xeb0c('0x11')];if(rpc[this['channel']+'Message']){if(this[_0xeb0c('0xa')]==='mail'){var _0xb69e47={'tls':{'rejectUnauthorized':![]}};if(this[_0xeb0c('0x23')][_0xeb0c('0x24')][_0xeb0c('0x25')]){_0xb69e47[_0xeb0c('0x25')]=this['account'][_0xeb0c('0x24')][_0xeb0c('0x25')];}else{_0xb69e47[_0xeb0c('0x26')]=this['account'][_0xeb0c('0x24')][_0xeb0c('0x26')];_0xb69e47['port']=this[_0xeb0c('0x23')][_0xeb0c('0x24')][_0xeb0c('0x27')];_0xb69e47[_0xeb0c('0x28')]=this[_0xeb0c('0x23')][_0xeb0c('0x24')][_0xeb0c('0x28')];}if(this[_0xeb0c('0x23')][_0xeb0c('0x24')][_0xeb0c('0x29')]){_0xb69e47['auth']={'user':this[_0xeb0c('0x23')]['Smtp'][_0xeb0c('0x2a')],'pass':this[_0xeb0c('0x23')][_0xeb0c('0x24')][_0xeb0c('0x2b')]};}_0x3664bd['inReplyTo']=this['message'][_0xeb0c('0x2c')];_0x3664bd['html']=_0xeb0c('0x2d')+_[_0xeb0c('0x2e')](_0x3664bd['body'],_0xeb0c('0x2f'),_0xeb0c('0x30'))+_0xeb0c('0x31');_0x3664bd[_0xeb0c('0x32')]={'Auto-Submitted':_0xeb0c('0x33'),'X-Auto-Response-Suppress':_0xeb0c('0x34'),'Precedence':_0xeb0c('0x35')};return mailRpc['sendMailMessage'](_0xb69e47,_0x3664bd)[_0xeb0c('0x36')](function(_0x520084){logger[_0xeb0c('0xc')](_0xeb0c('0x37'),_0x4b1a2b);_0x3664bd['messageId']=_0x520084['message'][_0xeb0c('0x2c')];return rpc[_0x1daca2+_0xeb0c('0x38')][_0xeb0c('0x39')](_0x3664bd);})['then'](function(_0xd4cbe8){logger[_0xeb0c('0xc')](_0xeb0c('0xd'),_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0xd4cbe8));})['catch'](function(_0x532c75){logger[_0xeb0c('0x3b')](_0xeb0c('0x3c'),_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0x532c75));})['finally'](function(){Promise[_0xeb0c('0x3d')]()[_0xeb0c('0x36')](function(){if(_0x30cfa8[0x0]!=='2'||_0x9cbb3a['autoreplyExecuted'])return;return rpc[_0x1daca2+_0xeb0c('0x3e')]['update'](_0x9cbb3a['id'],{'autoreplyExecuted':!![]})[_0xeb0c('0x36')](function(_0x155904){logger[_0xeb0c('0xc')](_0xeb0c('0x14'),_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0x155904));})[_0xeb0c('0x3f')](function(_0x5108f1){logger['error'](_0xeb0c('0x40'),_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0x5108f1));});})['then'](function(){_0x5cfbad[_0xeb0c('0xf')]();});});}else{return rpc[this[_0xeb0c('0xa')]+_0xeb0c('0x38')]['create'](_0x3664bd)['then'](function(_0x45753d){logger[_0xeb0c('0xc')](_0xeb0c('0xd'),_0x4b1a2b,_0x3664bd['body']);})[_0xeb0c('0x3f')](function(_0x410a34){logger[_0xeb0c('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0x410a34));})[_0xeb0c('0x41')](function(){Promise[_0xeb0c('0x3d')]()[_0xeb0c('0x36')](function(){if(_0x30cfa8[0x0]!=='2'||_0x9cbb3a['autoreplyExecuted'])return;return rpc[_0x1daca2+_0xeb0c('0x3e')][_0xeb0c('0x42')](_0x9cbb3a['id'],{'autoreplyExecuted':!![]})[_0xeb0c('0x36')](function(_0x27ac10){logger['info'](_0xeb0c('0x14'),_0x4b1a2b,JSON['stringify'](_0x27ac10));})[_0xeb0c('0x3f')](function(_0x3a150e){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4b1a2b,JSON[_0xeb0c('0x3a')](_0x3a150e));});})[_0xeb0c('0x36')](function(){_0x5cfbad[_0xeb0c('0xf')]();});});}}}catch(_0x26b4d1){logger[_0xeb0c('0x3b')](_0xeb0c('0xd'),_0x4b1a2b,JSON['stringify'](_0x26b4d1));_0x5cfbad[_0xeb0c('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 4d82c62..782997c 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb48f=['moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s'];(function(_0x557db9,_0x3dd857){var _0x298700=function(_0x5290f7){while(--_0x5290f7){_0x557db9['push'](_0x557db9['shift']());}};_0x298700(++_0x3dd857);}(_0xb48f,0x170));var _0xfb48=function(_0x4026d1,_0x53f826){_0x4026d1=_0x4026d1-0x0;var _0x4f978e=_0xb48f[_0x4026d1];return _0x4f978e;};'use strict';var moment=require(_0xfb48('0x0'));var logger=require(_0xfb48('0x1'))(_0xfb48('0x2'));var rpc={'chatInteraction':require(_0xfb48('0x3')),'openchannelInteraction':require(_0xfb48('0x4')),'smsInteraction':require(_0xfb48('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xfb48('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xfb48('0x7')]=function(_0x4dd75c,_0x7bf6cc,_0x24de19,_0x579f5a){return function(_0x496054){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4dd75c,_0x7bf6cc[0x0]);var _0x1dbc7b={'closed':0x1,'closedAt':moment()[_0xfb48('0x8')](_0xfb48('0x9')),'closeReason':_0xfb48('0xa'),'disposition':_0x7bf6cc[0x0]};if(rpc[_0x579f5a['channel']+'Interaction']){rpc[_0x579f5a[_0xfb48('0xb')]+_0xfb48('0xc')]['update'](_0x579f5a[_0xfb48('0xd')]['id'],_0x1dbc7b)[_0xfb48('0xe')](function(_0x2dd32a){logger[_0xfb48('0xf')](_0xfb48('0x10'),_0x4dd75c,_0x579f5a[_0xfb48('0xd')]['id']);})[_0xfb48('0x11')](function(_0x34ef85){logger[_0xfb48('0x12')]('[%s][CLOSE]\x20%s',_0x4dd75c,JSON[_0xfb48('0x13')](_0x34ef85));})[_0xfb48('0x14')](function(){_0x496054[_0xfb48('0x15')]();});}}catch(_0x20bd70){logger[_0xfb48('0x12')](_0xfb48('0x16'),_0x4dd75c,JSON['stringify'](_0x20bd70));_0x496054[_0xfb48('0x15')]();}};}; \ No newline at end of file +var _0x5a6d=['info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','stringify','finally','stop','error','[%s][CLOSE]\x20%s','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence'];(function(_0x3a362d,_0x28b32d){var _0x302ddf=function(_0x4cc70d){while(--_0x4cc70d){_0x3a362d['push'](_0x3a362d['shift']());}};_0x302ddf(++_0x28b32d);}(_0x5a6d,0x184));var _0xd5a6=function(_0x2831d8,_0x290507){_0x2831d8=_0x2831d8-0x0;var _0x2691d0=_0x5a6d[_0x2831d8];return _0x2691d0;};'use strict';var moment=require(_0xd5a6('0x0'));var logger=require('../../../../config/logger')(_0xd5a6('0x1'));var rpc={'chatInteraction':require(_0xd5a6('0x2')),'openchannelInteraction':require(_0xd5a6('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xd5a6('0x4')),'faxInteraction':require(_0xd5a6('0x5')),'whatsappInteraction':require(_0xd5a6('0x6'))};exports[_0xd5a6('0x7')]=function(_0x524f61,_0x411b34,_0x202a36,_0x370b8c){return function(_0x204823){try{logger[_0xd5a6('0x8')](_0xd5a6('0x9'),_0x524f61,_0x411b34[0x0]);var _0x56c443={'closed':0x1,'closedAt':moment()[_0xd5a6('0xa')](_0xd5a6('0xb')),'closeReason':_0xd5a6('0xc'),'disposition':_0x411b34[0x0]};if(rpc[_0x370b8c[_0xd5a6('0xd')]+_0xd5a6('0xe')]){rpc[_0x370b8c[_0xd5a6('0xd')]+'Interaction']['update'](_0x370b8c['interaction']['id'],_0x56c443)['then'](function(_0x6f3202){logger[_0xd5a6('0x8')](_0xd5a6('0xf'),_0x524f61,_0x370b8c[_0xd5a6('0x10')]['id']);})['catch'](function(_0x38c72f){logger['error']('[%s][CLOSE]\x20%s',_0x524f61,JSON[_0xd5a6('0x11')](_0x38c72f));})[_0xd5a6('0x12')](function(){_0x204823[_0xd5a6('0x13')]();});}}catch(_0x4c7dfa){logger[_0xd5a6('0x14')](_0xd5a6('0x15'),_0x524f61,JSON['stringify'](_0x4c7dfa));_0x204823['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 94a1fab..9b1c205 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9261=['sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','metadata','endConversation','lodash','moment','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x4c7e43,_0x12f4e5){var _0x204ae2=function(_0x5a686d){while(--_0x5a686d){_0x4c7e43['push'](_0x4c7e43['shift']());}};_0x204ae2(++_0x12f4e5);}(_0x9261,0x1de));var _0x1926=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x9261[_0x879e31];return _0x3467e8;};'use strict';var _=require(_0x1926('0x0'));var moment=require(_0x1926('0x1'));var apiai=require('apiai-promise');var md5=require(_0x1926('0x2'));var utils=require(_0x1926('0x3'));var logger=require(_0x1926('0x4'))('routing');var rpc={'chatMessage':require(_0x1926('0x5')),'openchannelMessage':require(_0x1926('0x6')),'mailMessage':require(_0x1926('0x7')),'smsMessage':require(_0x1926('0x8')),'faxMessage':require(_0x1926('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1926('0xa')]=function(_0x4cf00b,_0x73600d){return function(_0x424dd9){try{if(!_['isNil'](this[_0x1926('0xb')][_0x1926('0xc')])){logger[_0x1926('0xd')](_0x1926('0xe'),_0x4cf00b,_0x1926('0xf'));return _0x424dd9[_0x1926('0x10')]();}var _0x2e03e1={'ContactId':this[_0x1926('0x11')]['id'],'sentAt':moment()[_0x1926('0x12')](_0x1926('0x13')),'direction':_0x1926('0x14')};if(this[_0x1926('0x15')]===_0x1926('0x16')||this[_0x1926('0x15')]===_0x1926('0x17')){_0x2e03e1[_0x1926('0x18')]=this[_0x1926('0xb')][_0x1926('0x18')];}var _0x2ac6d3=this[_0x1926('0x15')];if(_0x2ac6d3===_0x1926('0x19')){_0x2e03e1[_0x1926('0x1a')]=this[_0x1926('0x1b')]['id'];}else{_0x2e03e1[_[_0x1926('0x1c')](_0x2ac6d3)+_0x1926('0x1d')]=this[_0x1926('0x1b')]['id'];}_0x2e03e1[_['upperFirst'](_0x2ac6d3)+_0x1926('0x1e')]=this[_0x1926('0xb')]['id'];if(this[_0x1926('0xb')]['created']){var _0x2a4f09=_0x73600d[0x2];if(!_[_0x1926('0x1f')](_0x2a4f09)){_0x2e03e1['body']=utils[_0x1926('0x20')](_0x2a4f09,this);return rpc[_0x2ac6d3+_0x1926('0x21')][_0x1926('0x22')](_0x2e03e1)[_0x1926('0x23')](function(_0x1b8d73){logger[_0x1926('0xd')](_0x1926('0xe'),_0x4cf00b,_0x2e03e1[_0x1926('0x24')]);})[_0x1926('0x25')](function(_0x3e452b){logger[_0x1926('0x26')](_0x1926('0xe'),_0x4cf00b,JSON[_0x1926('0x27')](_0x3e452b));})['finally'](function(){logger['info'](_0x1926('0x28'),_0x4cf00b);_0x424dd9[_0x1926('0x29')]();});}else{logger[_0x1926('0xd')](_0x1926('0x2a'),_0x4cf00b);_0x424dd9[_0x1926('0x29')]();}}else{var _0x31d906=this;var _0x32bd70=apiai(_0x73600d[0x0],{'language':_0x73600d[0x1]||'en'});return _0x32bd70[_0x1926('0x2b')](this[_0x1926('0x2c')][_0x1926('0x24')],{'sessionId':md5(this[_0x1926('0xb')]['id'])})['then'](function(_0x5d00c7){_0x31d906['body']['dialogflow']=_0x5d00c7;_0x2e03e1[_0x1926('0x24')]=_0x5d00c7[_0x1926('0x2d')][_0x1926('0x2e')][_0x1926('0x2f')];_0x2e03e1['providerName']='dialogflow';_0x2e03e1['providerResponse']=JSON[_0x1926('0x27')](_0x5d00c7);return rpc[_0x2ac6d3+_0x1926('0x21')]['create'](_0x2e03e1)[_0x1926('0x23')](function(_0x2649ff){logger[_0x1926('0xd')](_0x1926('0xe'),_0x4cf00b,_0x2e03e1[_0x1926('0x24')]);if(_0x5d00c7[_0x1926('0x2d')][_0x1926('0x30')][_0x1926('0x31')]){_0x424dd9[_0x1926('0x10')]();}else{_0x424dd9['stop']();}})[_0x1926('0x25')](function(_0x42e41e){logger[_0x1926('0x26')](_0x1926('0xe'),_0x4cf00b,JSON['stringify'](_0x42e41e));_0x424dd9[_0x1926('0x10')]();});})[_0x1926('0x25')](function(_0x406631){logger[_0x1926('0x26')](_0x1926('0xe'),_0x4cf00b,_0x406631['message']);_0x424dd9[_0x1926('0x10')]();});}}catch(_0x47e474){logger[_0x1926('0x26')](_0x1926('0xe'),_0x4cf00b,JSON[_0x1926('0x27')](_0x47e474));_0x424dd9[_0x1926('0x29')]();}};}; \ No newline at end of file +var _0x672a=['out','sms','channel','whatsapp','phone','chat','account','upperFirst','created','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x51461b,_0x32ad42){var _0x1a66c4=function(_0x291777){while(--_0x291777){_0x51461b['push'](_0x51461b['shift']());}};_0x1a66c4(++_0x32ad42);}(_0x672a,0x122));var _0xa672=function(_0x9c486b,_0xde35dc){_0x9c486b=_0x9c486b-0x0;var _0x442b71=_0x672a[_0x9c486b];return _0x442b71;};'use strict';var _=require(_0xa672('0x0'));var moment=require(_0xa672('0x1'));var apiai=require(_0xa672('0x2'));var md5=require(_0xa672('0x3'));var utils=require(_0xa672('0x4'));var logger=require(_0xa672('0x5'))(_0xa672('0x6'));var rpc={'chatMessage':require(_0xa672('0x7')),'openchannelMessage':require(_0xa672('0x8')),'mailMessage':require(_0xa672('0x9')),'smsMessage':require(_0xa672('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa672('0xb'))};exports[_0xa672('0xc')]=function(_0x3a4797,_0x33dd0c){return function(_0x13402c){try{if(!_[_0xa672('0xd')](this[_0xa672('0xe')][_0xa672('0xf')])){logger[_0xa672('0x10')](_0xa672('0x11'),_0x3a4797,_0xa672('0x12'));return _0x13402c[_0xa672('0x13')]();}var _0x2c1de6={'ContactId':this[_0xa672('0x14')]['id'],'sentAt':moment()['format'](_0xa672('0x15')),'direction':_0xa672('0x16')};if(this['channel']===_0xa672('0x17')||this[_0xa672('0x18')]===_0xa672('0x19')){_0x2c1de6[_0xa672('0x1a')]=this[_0xa672('0xe')][_0xa672('0x1a')];}var _0x26deb7=this[_0xa672('0x18')];if(_0x26deb7===_0xa672('0x1b')){_0x2c1de6['ChatWebsiteId']=this[_0xa672('0x1c')]['id'];}else{_0x2c1de6[_[_0xa672('0x1d')](_0x26deb7)+'AccountId']=this['account']['id'];}_0x2c1de6[_[_0xa672('0x1d')](_0x26deb7)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0xa672('0x1e')]){var _0x582a75=_0x33dd0c[0x2];if(!_['isEmpty'](_0x582a75)){_0x2c1de6[_0xa672('0x1f')]=utils[_0xa672('0x20')](_0x582a75,this);return rpc[_0x26deb7+_0xa672('0x21')][_0xa672('0x22')](_0x2c1de6)[_0xa672('0x23')](function(_0x10dc1c){logger[_0xa672('0x10')](_0xa672('0x11'),_0x3a4797,_0x2c1de6[_0xa672('0x1f')]);})[_0xa672('0x24')](function(_0x580858){logger[_0xa672('0x25')](_0xa672('0x11'),_0x3a4797,JSON[_0xa672('0x26')](_0x580858));})[_0xa672('0x27')](function(){logger[_0xa672('0x10')](_0xa672('0x28'),_0x3a4797);_0x13402c['stop']();});}else{logger[_0xa672('0x10')](_0xa672('0x29'),_0x3a4797);_0x13402c[_0xa672('0x2a')]();}}else{var _0x894eef=this;var _0x394e54=apiai(_0x33dd0c[0x0],{'language':_0x33dd0c[0x1]||'en'});return _0x394e54['textRequest'](this[_0xa672('0x2b')][_0xa672('0x1f')],{'sessionId':md5(this[_0xa672('0xe')]['id'])})[_0xa672('0x23')](function(_0x4a9d19){_0x894eef['body'][_0xa672('0x2c')]=_0x4a9d19;_0x2c1de6['body']=_0x4a9d19[_0xa672('0x2d')][_0xa672('0x2e')][_0xa672('0x2f')];_0x2c1de6[_0xa672('0x30')]=_0xa672('0x2c');_0x2c1de6[_0xa672('0x31')]=JSON['stringify'](_0x4a9d19);return rpc[_0x26deb7+'Message'][_0xa672('0x22')](_0x2c1de6)[_0xa672('0x23')](function(_0x229f7f){logger['info'](_0xa672('0x11'),_0x3a4797,_0x2c1de6[_0xa672('0x1f')]);if(_0x4a9d19['result'][_0xa672('0x32')][_0xa672('0x33')]){_0x13402c['next']();}else{_0x13402c[_0xa672('0x2a')]();}})[_0xa672('0x24')](function(_0x47daa1){logger[_0xa672('0x25')](_0xa672('0x11'),_0x3a4797,JSON[_0xa672('0x26')](_0x47daa1));_0x13402c[_0xa672('0x13')]();});})[_0xa672('0x24')](function(_0x48ccf3){logger[_0xa672('0x25')](_0xa672('0x11'),_0x3a4797,_0x48ccf3[_0xa672('0x2b')]);_0x13402c[_0xa672('0x13')]();});}}catch(_0x45cdb5){logger[_0xa672('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x3a4797,JSON[_0xa672('0x26')](_0x45cdb5));_0x13402c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index c2d931a..d428866 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75f3=['stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','push','fulfillmentText','error','dialogflow','md5','bluebird','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x75f3,0xc5));var _0x375f=function(_0x5068e4,_0x49405a){_0x5068e4=_0x5068e4-0x0;var _0x41069b=_0x75f3[_0x5068e4];return _0x41069b;};'use strict';var _=require('lodash');var dialogflow=require(_0x375f('0x0'));var md5=require(_0x375f('0x1'));var moment=require('moment');var Promise=require(_0x375f('0x2'));var logger=require('../../../../config/logger')(_0x375f('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x375f('0x4')),'openchannelMessage':require(_0x375f('0x5')),'mailMessage':require(_0x375f('0x6')),'smsMessage':require(_0x375f('0x7')),'faxMessage':require(_0x375f('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x3a181e,_0x565005,_0x1fc46c,_0x461250){return new Promise(function(_0x6d8109,_0x4abe77){var _0x1bf27a=_[_0x375f('0x9')](_0x1fc46c);_0x1bf27a[_0x375f('0xa')]=_0x461250;return rpc[_0x565005+_0x375f('0xb')][_0x375f('0xc')](_0x1bf27a)['then'](function(){logger[_0x375f('0xd')](_0x375f('0xe'),_0x3a181e,_0x1bf27a[_0x375f('0xa')]);_0x6d8109();})[_0x375f('0xf')](function(_0x8c5c40){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x3a181e,JSON[_0x375f('0x10')](_0x8c5c40));_0x4abe77(_0x8c5c40);});});}exports[_0x375f('0x11')]=function(_0x4d89e6,_0x4c1cdb){return function(_0x249e5d){try{if(!_[_0x375f('0x12')](this[_0x375f('0x13')]['UserId'])){logger[_0x375f('0xd')](_0x375f('0xe'),_0x4d89e6,_0x375f('0x14'));return _0x249e5d[_0x375f('0x15')]();}var _0x5394ad={'ContactId':this[_0x375f('0x16')]['id'],'sentAt':moment()['format'](_0x375f('0x17')),'direction':_0x375f('0x18')};if(this[_0x375f('0x19')]===_0x375f('0x1a')||this[_0x375f('0x19')]===_0x375f('0x1b')){_0x5394ad[_0x375f('0x1c')]=this[_0x375f('0x13')]['phone'];}var _0x40ab22=this[_0x375f('0x19')];if(_0x40ab22===_0x375f('0x1d')){_0x5394ad[_0x375f('0x1e')]=this['account']['id'];}else{_0x5394ad[_[_0x375f('0x1f')](_0x40ab22)+'AccountId']=this['account']['id'];}_0x5394ad[_['upperFirst'](_0x40ab22)+_0x375f('0x20')]=this[_0x375f('0x13')]['id'];if(this['interaction'][_0x375f('0x21')]){var _0x4e508b=_0x4c1cdb[0x4];if(!_[_0x375f('0x22')](_0x4e508b)){_0x5394ad[_0x375f('0xa')]=utils[_0x375f('0x23')](_0x4e508b,this);return rpc[_0x40ab22+_0x375f('0xb')][_0x375f('0xc')](_0x5394ad)[_0x375f('0x24')](function(_0x18c1df){logger['info'](_0x375f('0xe'),_0x4d89e6,_0x5394ad['body']);})['catch'](function(_0x30af2a){logger['error'](_0x375f('0xe'),_0x4d89e6,JSON[_0x375f('0x10')](_0x30af2a));})[_0x375f('0x25')](function(){logger['info'](_0x375f('0x26'),_0x4d89e6);_0x249e5d[_0x375f('0x27')]();});}else{logger[_0x375f('0xd')](_0x375f('0x28'),_0x4d89e6);_0x249e5d[_0x375f('0x27')]();}}else{var _0x4eafeb=this;var _0x110cad=_0x4c1cdb[0x2][_0x375f('0x29')](/\\n/g,'\x0a');var _0x259e25={'credentials':{'private_key':_0x110cad,'client_email':_0x4c1cdb[0x1]}};var _0x1d10d4=new dialogflow[(_0x375f('0x2a'))](_0x259e25);var _0x4de1f4=_0x1d10d4[_0x375f('0x2b')](_0x4c1cdb[0x0],md5(_0x4eafeb[_0x375f('0x13')]['id']));var _0x19b6da={'session':_0x4de1f4,'queryInput':{'text':{'text':_0x4eafeb[_0x375f('0x2c')]['body'],'languageCode':_0x4c1cdb[0x3]||'en'}}};return _0x1d10d4['detectIntent'](_0x19b6da)[_0x375f('0x24')](function(_0x127517){if(_0x127517&&_0x127517[_0x375f('0x2d')]){_0x4eafeb[_0x375f('0xa')][_0x375f('0x2e')]=_0x127517;var _0x3389d0=_0x127517[0x0];var _0x5617b3=_0x3389d0[_0x375f('0x2f')][_0x375f('0x30')]&&_0x3389d0[_0x375f('0x2f')]['diagnosticInfo'][_0x375f('0x31')]?_0x3389d0[_0x375f('0x2f')][_0x375f('0x30')]['fields']['end_conversation'][_0x375f('0x32')]:![];_0x4eafeb[_0x375f('0xa')][_0x375f('0x33')]=_0x3389d0[_0x375f('0x2f')]['action'];_0x4eafeb[_0x375f('0xa')][_0x375f('0x34')]=_0x3389d0[_0x375f('0x2f')]['allRequiredParamsPresent'];_0x4eafeb[_0x375f('0xa')][_0x375f('0x35')]=_0x3389d0[_0x375f('0x2f')][_0x375f('0x30')]&&_0x3389d0[_0x375f('0x2f')]['diagnosticInfo']['fields']?_0x3389d0[_0x375f('0x2f')][_0x375f('0x30')][_0x375f('0x31')][_0x375f('0x36')][_0x375f('0x32')]:![];_0x4eafeb[_0x375f('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x3389d0[_0x375f('0x2f')][_0x375f('0x37')][_0x375f('0x38')];_0x4eafeb[_0x375f('0xa')][_0x375f('0x39')]=_0x3389d0['queryResult']['intent'][_0x375f('0x3a')];_0x4eafeb[_0x375f('0xa')][_0x375f('0x3b')]=_0x3389d0[_0x375f('0x2f')]['intent'][_0x375f('0x3c')];_0x4eafeb[_0x375f('0xa')][_0x375f('0x3d')]=_0x3389d0[_0x375f('0x2f')][_0x375f('0x3e')];_0x4eafeb[_0x375f('0xa')][_0x375f('0x3f')]=_0x3389d0[_0x375f('0x2f')][_0x375f('0x40')];_0x4eafeb[_0x375f('0xa')][_0x375f('0x41')]=_0x3389d0[_0x375f('0x2f')][_0x375f('0x42')];_0x5394ad[_0x375f('0x43')]=_0x375f('0x2e');_0x5394ad['providerResponse']=JSON[_0x375f('0x10')](_0x127517);var _0x55db9b=[];for(var _0x44727f=0x0;_0x44727f<_0x127517['length'];_0x44727f++){var _0x562e5d=_0x127517[_0x44727f];if(_0x562e5d&&_0x562e5d[_0x375f('0x2f')]&&_0x562e5d['queryResult']['fulfillmentText']){_0x55db9b[_0x375f('0x44')](createMessage(_0x4d89e6,_0x40ab22,_0x5394ad,_0x562e5d[_0x375f('0x2f')][_0x375f('0x45')]));}}return Promise['all'](_0x55db9b)[_0x375f('0x24')](function(){if(_0x5617b3){_0x249e5d['next']();}else{_0x249e5d[_0x375f('0x27')]();}})[_0x375f('0xf')](function(_0x382d4f){logger[_0x375f('0x46')]('[%s][DIALOGFLOWV2]\x20%s',_0x4d89e6,JSON[_0x375f('0x10')](_0x382d4f));_0x249e5d[_0x375f('0x15')]();});}})[_0x375f('0xf')](function(_0x308531){logger[_0x375f('0x46')](_0x375f('0xe'),_0x4d89e6,_0x308531[_0x375f('0x2c')]);_0x249e5d[_0x375f('0x15')]();});}}catch(_0x199102){logger['error'](_0x375f('0xe'),_0x4d89e6,JSON[_0x375f('0x10')](_0x199102));_0x249e5d[_0x375f('0x27')]();}};}; \ No newline at end of file +var _0x1a8f=['all','next','lodash','dialogflow','moment','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','getMustacheRender','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','message','detectIntent','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','end_conversation','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push'];(function(_0x286f1d,_0x290954){var _0x2fbde3=function(_0x252b9e){while(--_0x252b9e){_0x286f1d['push'](_0x286f1d['shift']());}};_0x2fbde3(++_0x290954);}(_0x1a8f,0x88));var _0xf1a8=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x1a8f[_0x14fad0];return _0x5c665f;};'use strict';var _=require(_0xf1a8('0x0'));var dialogflow=require(_0xf1a8('0x1'));var md5=require('md5');var moment=require(_0xf1a8('0x2'));var Promise=require('bluebird');var logger=require(_0xf1a8('0x3'))(_0xf1a8('0x4'));var utils=require(_0xf1a8('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf1a8('0x6')),'mailMessage':require(_0xf1a8('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf1a8('0x8'))};function createMessage(_0x40c271,_0x3dfad2,_0x386755,_0x30036d){return new Promise(function(_0x2da9d3,_0x13962d){var _0x17847a=_[_0xf1a8('0x9')](_0x386755);_0x17847a[_0xf1a8('0xa')]=_0x30036d;return rpc[_0x3dfad2+_0xf1a8('0xb')][_0xf1a8('0xc')](_0x17847a)['then'](function(){logger[_0xf1a8('0xd')](_0xf1a8('0xe'),_0x40c271,_0x17847a[_0xf1a8('0xa')]);_0x2da9d3();})[_0xf1a8('0xf')](function(_0x395121){logger[_0xf1a8('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x40c271,JSON['stringify'](_0x395121));_0x13962d(_0x395121);});});}exports[_0xf1a8('0x11')]=function(_0x2151ab,_0x5e28f0){return function(_0xb2e6a8){try{if(!_[_0xf1a8('0x12')](this[_0xf1a8('0x13')][_0xf1a8('0x14')])){logger[_0xf1a8('0xd')](_0xf1a8('0xe'),_0x2151ab,_0xf1a8('0x15'));return _0xb2e6a8['next']();}var _0x2d9440={'ContactId':this[_0xf1a8('0x16')]['id'],'sentAt':moment()[_0xf1a8('0x17')](_0xf1a8('0x18')),'direction':_0xf1a8('0x19')};if(this[_0xf1a8('0x1a')]==='sms'||this[_0xf1a8('0x1a')]===_0xf1a8('0x1b')){_0x2d9440[_0xf1a8('0x1c')]=this[_0xf1a8('0x13')][_0xf1a8('0x1c')];}var _0x3610df=this[_0xf1a8('0x1a')];if(_0x3610df===_0xf1a8('0x1d')){_0x2d9440[_0xf1a8('0x1e')]=this[_0xf1a8('0x1f')]['id'];}else{_0x2d9440[_[_0xf1a8('0x20')](_0x3610df)+_0xf1a8('0x21')]=this['account']['id'];}_0x2d9440[_[_0xf1a8('0x20')](_0x3610df)+'InteractionId']=this['interaction']['id'];if(this[_0xf1a8('0x13')]['created']){var _0x5c03e8=_0x5e28f0[0x4];if(!_[_0xf1a8('0x22')](_0x5c03e8)){_0x2d9440[_0xf1a8('0xa')]=utils[_0xf1a8('0x23')](_0x5c03e8,this);return rpc[_0x3610df+_0xf1a8('0xb')][_0xf1a8('0xc')](_0x2d9440)['then'](function(_0x2feec7){logger[_0xf1a8('0xd')](_0xf1a8('0xe'),_0x2151ab,_0x2d9440[_0xf1a8('0xa')]);})[_0xf1a8('0xf')](function(_0x4a9f7b){logger['error'](_0xf1a8('0xe'),_0x2151ab,JSON[_0xf1a8('0x24')](_0x4a9f7b));})[_0xf1a8('0x25')](function(){logger[_0xf1a8('0xd')](_0xf1a8('0x26'),_0x2151ab);_0xb2e6a8['stop']();});}else{logger['info'](_0xf1a8('0x27'),_0x2151ab);_0xb2e6a8[_0xf1a8('0x28')]();}}else{var _0x2e1268=this;var _0xe6d1d9=_0x5e28f0[0x2][_0xf1a8('0x29')](/\\n/g,'\x0a');var _0x5471fa={'credentials':{'private_key':_0xe6d1d9,'client_email':_0x5e28f0[0x1]}};var _0x2fad74=new dialogflow[(_0xf1a8('0x2a'))](_0x5471fa);var _0x5d4d72=_0x2fad74['sessionPath'](_0x5e28f0[0x0],md5(_0x2e1268['interaction']['id']));var _0x376d62={'session':_0x5d4d72,'queryInput':{'text':{'text':_0x2e1268[_0xf1a8('0x2b')][_0xf1a8('0xa')],'languageCode':_0x5e28f0[0x3]||'en'}}};return _0x2fad74[_0xf1a8('0x2c')](_0x376d62)[_0xf1a8('0x2d')](function(_0x236c9a){if(_0x236c9a&&_0x236c9a[_0xf1a8('0x2e')]){_0x2e1268[_0xf1a8('0xa')][_0xf1a8('0x2f')]=_0x236c9a;var _0x56f072=_0x236c9a[0x0];var _0x1007dd=_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x31')]&&_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x31')][_0xf1a8('0x32')]?_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x31')][_0xf1a8('0x32')]['end_conversation'][_0xf1a8('0x33')]:![];_0x2e1268[_0xf1a8('0xa')][_0xf1a8('0x34')]=_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x35')];_0x2e1268['body'][_0xf1a8('0x36')]=_0x56f072[_0xf1a8('0x30')]['allRequiredParamsPresent'];_0x2e1268['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x56f072[_0xf1a8('0x30')]['diagnosticInfo']&&_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x31')]['fields']?_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x31')][_0xf1a8('0x32')][_0xf1a8('0x37')][_0xf1a8('0x33')]:![];_0x2e1268[_0xf1a8('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x56f072['queryResult'][_0xf1a8('0x38')]['name'];_0x2e1268[_0xf1a8('0xa')][_0xf1a8('0x39')]=_0x56f072[_0xf1a8('0x30')]['intent']['displayName'];_0x2e1268[_0xf1a8('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x38')][_0xf1a8('0x3a')];_0x2e1268[_0xf1a8('0xa')]['DIALOGFLOWV2_LANGUAGECODE']=_0x56f072[_0xf1a8('0x30')]['languageCode'];_0x2e1268[_0xf1a8('0xa')]['DIALOGFLOWV2_QUERYTEXT']=_0x56f072[_0xf1a8('0x30')]['queryText'];_0x2e1268['body'][_0xf1a8('0x3b')]=_0x56f072[_0xf1a8('0x30')][_0xf1a8('0x3c')];_0x2d9440[_0xf1a8('0x3d')]='dialogflowV2';_0x2d9440[_0xf1a8('0x3e')]=JSON[_0xf1a8('0x24')](_0x236c9a);var _0x36bc57=[];for(var _0x29c193=0x0;_0x29c193<_0x236c9a[_0xf1a8('0x2e')];_0x29c193++){var _0x2e1fbc=_0x236c9a[_0x29c193];if(_0x2e1fbc&&_0x2e1fbc[_0xf1a8('0x30')]&&_0x2e1fbc[_0xf1a8('0x30')][_0xf1a8('0x3f')]){_0x36bc57[_0xf1a8('0x40')](createMessage(_0x2151ab,_0x3610df,_0x2d9440,_0x2e1fbc['queryResult']['fulfillmentText']));}}return Promise[_0xf1a8('0x41')](_0x36bc57)[_0xf1a8('0x2d')](function(){if(_0x1007dd){_0xb2e6a8[_0xf1a8('0x42')]();}else{_0xb2e6a8[_0xf1a8('0x28')]();}})[_0xf1a8('0xf')](function(_0x18559c){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2151ab,JSON[_0xf1a8('0x24')](_0x18559c));_0xb2e6a8['next']();});}})[_0xf1a8('0xf')](function(_0x26e2a0){logger[_0xf1a8('0x10')](_0xf1a8('0xe'),_0x2151ab,_0x26e2a0[_0xf1a8('0x2b')]);_0xb2e6a8['next']();});}}catch(_0x4cad33){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2151ab,JSON[_0xf1a8('0x24')](_0x4cad33));_0xb2e6a8[_0xf1a8('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 1a6ba58..363d27c 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25f0=['error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','validate','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x2db466,_0x228988){var _0x414add=function(_0x2e8823){while(--_0x2e8823){_0x2db466['push'](_0x2db466['shift']());}};_0x414add(++_0x228988);}(_0x25f0,0x94));var _0x025f=function(_0x4da637,_0xe9fd4c){_0x4da637=_0x4da637-0x0;var _0x51bd8a=_0x25f0[_0x4da637];return _0x51bd8a;};'use strict';var schema=require('validate');var _=require(_0x025f('0x0'));var htmlToText=require('html-to-text');var utils=require(_0x025f('0x1'));var logger=require(_0x025f('0x2'))(_0x025f('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x025f('0x4'),'message':_0x025f('0x5')},'priorityFalse':{'type':_0x025f('0x4'),'message':_0x025f('0x6')}});exports[_0x025f('0x7')]=function(_0x43baec,_0x19c02d){return function(_0x3e2e16){try{var _0x23f9e0={'condition':htmlToText[_0x025f('0x8')](utils['getMustacheRender'](_0x19c02d[0x0],this),{'wordwrap':![]})[_0x025f('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x19c02d[0x1],'priorityFalse':_0x19c02d[0x2]};var _0xc0c2d9=gotoif[_0x025f('0xa')](_0x23f9e0,{'typecast':!![]});if(_0xc0c2d9[_0x025f('0xb')]){logger['error'](_0x025f('0xc'),_0x43baec,_[_0x025f('0xd')](_0xc0c2d9,_0x025f('0xe'))[_0x025f('0xf')](',\x20'));_0x3e2e16[_0x025f('0x10')]();}else{try{var _0x20f177=eval('('+_0x23f9e0[_0x025f('0x11')]+')');var _0x54ac75=_0x20f177?_0x23f9e0[_0x025f('0x12')]:_0x23f9e0[_0x025f('0x13')];logger['info'](_0x025f('0x14'),_0x43baec,_0x23f9e0[_0x025f('0x11')],_0x20f177,_0x54ac75||_0x025f('0x15'));if(_0x54ac75){var _0x4c30b4=_[_0x025f('0x16')](_0x3e2e16['rules'](),{'p':_0x54ac75});if(_0x4c30b4>=0x0){logger[_0x025f('0x17')](_0x025f('0x18'),_0x43baec,_0x54ac75||_0x025f('0x15'),_0x4c30b4);_0x3e2e16['next'](_0x4c30b4);}else{logger['info'](_0x025f('0x19'),_0x43baec,_0x54ac75||'next');_0x3e2e16[_0x025f('0x10')]();}}else{_0x3e2e16[_0x025f('0x15')]();}}catch(_0x2f1880){logger[_0x025f('0x1a')](_0x025f('0x1b'),_0x43baec,_0x2f1880[_0x025f('0xe')]);_0x3e2e16[_0x025f('0x10')]();}}}catch(_0x220cb4){logger[_0x025f('0x1a')](_0x025f('0xc'),_0x43baec,JSON[_0x025f('0x1c')](_0x220cb4));_0x3e2e16[_0x025f('0x10')]();}};}; \ No newline at end of file +var _0x836d=['priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','length','error','message','join','condition','priorityTrue','next','findIndex','rules','info','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','stringify','validate','lodash','html-to-text','./utils','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0xeab2ef,_0x5db9f6){var _0x32cc61=function(_0x5b82c2){while(--_0x5b82c2){_0xeab2ef['push'](_0xeab2ef['shift']());}};_0x32cc61(++_0x5db9f6);}(_0x836d,0x12e));var _0xd836=function(_0x15ed67,_0x44767c){_0x15ed67=_0x15ed67-0x0;var _0x161805=_0x836d[_0x15ed67];return _0x161805;};'use strict';var schema=require(_0xd836('0x0'));var _=require(_0xd836('0x1'));var htmlToText=require(_0xd836('0x2'));var utils=require(_0xd836('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xd836('0x4')},'priorityTrue':{'type':_0xd836('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xd836('0x5'),'message':_0xd836('0x6')}});exports[_0xd836('0x7')]=function(_0xc96dc6,_0x4ff009){return function(_0x7abcc6){try{var _0x35a75d={'condition':htmlToText['fromString'](utils[_0xd836('0x8')](_0x4ff009[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4ff009[0x1],'priorityFalse':_0x4ff009[0x2]};var _0x5d471e=gotoif[_0xd836('0x0')](_0x35a75d,{'typecast':!![]});if(_0x5d471e[_0xd836('0x9')]){logger[_0xd836('0xa')]('[%s][GOTOIF]\x20%s',_0xc96dc6,_['map'](_0x5d471e,_0xd836('0xb'))[_0xd836('0xc')](',\x20'));_0x7abcc6['stop']();}else{try{var _0x4056a4=eval('('+_0x35a75d[_0xd836('0xd')]+')');var _0x240f01=_0x4056a4?_0x35a75d[_0xd836('0xe')]:_0x35a75d['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xc96dc6,_0x35a75d['condition'],_0x4056a4,_0x240f01||_0xd836('0xf'));if(_0x240f01){var _0x14b5d5=_[_0xd836('0x10')](_0x7abcc6[_0xd836('0x11')](),{'p':_0x240f01});if(_0x14b5d5>=0x0){logger[_0xd836('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xc96dc6,_0x240f01||_0xd836('0xf'),_0x14b5d5);_0x7abcc6[_0xd836('0xf')](_0x14b5d5);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xc96dc6,_0x240f01||_0xd836('0xf'));_0x7abcc6['stop']();}}else{_0x7abcc6[_0xd836('0xf')]();}}catch(_0x43d5ab){logger['error'](_0xd836('0x13'),_0xc96dc6,_0x43d5ab[_0xd836('0xb')]);_0x7abcc6[_0xd836('0x14')]();}}}catch(_0x2c1a51){logger[_0xd836('0xa')]('[%s][GOTOIF]\x20%s',_0xc96dc6,JSON[_0xd836('0x15')](_0x2c1a51));_0x7abcc6[_0xd836('0x14')]();}};}; \ 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 9515e91..74e9d0b 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 _0xa386=['error','[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','consequence','length'];(function(_0x49a500,_0x167764){var _0x1118cb=function(_0x1c949d){while(--_0x1c949d){_0x49a500['push'](_0x49a500['shift']());}};_0x1118cb(++_0x167764);}(_0xa386,0x1f2));var _0x6a38=function(_0xbfba71,_0x36d378){_0xbfba71=_0xbfba71-0x0;var _0x39470b=_0xa386[_0xbfba71];return _0x39470b;};'use strict';var schema=require(_0x6a38('0x0'));var _=require(_0x6a38('0x1'));var logger=require(_0x6a38('0x2'))(_0x6a38('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x6a38('0x4')]=function(_0x4f3e12,_0x2d7246){return function(_0x36ebfe){try{var _0x5937c2={'priority':_0x2d7246[0x0]};var _0x5406c1=gotop['validate'](_0x5937c2,{'typecast':!![]});if(_0x5406c1[_0x6a38('0x5')]){logger[_0x6a38('0x6')](_0x6a38('0x7'),_0x4f3e12,_[_0x6a38('0x8')](_0x5406c1,_0x6a38('0x9'))['join'](',\x20'));_0x36ebfe[_0x6a38('0xa')]();}else{logger['info'](_0x6a38('0xb'),_0x4f3e12,_0x5937c2[_0x6a38('0xc')]);if(_0x5937c2[_0x6a38('0xc')]){var _0x42ced7=_[_0x6a38('0xd')](_0x36ebfe[_0x6a38('0xe')](),{'p':_0x5937c2[_0x6a38('0xc')]});if(_0x42ced7>=0x0){logger[_0x6a38('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4f3e12,_0x5937c2[_0x6a38('0xc')]||_0x6a38('0x10'),_0x42ced7);_0x36ebfe[_0x6a38('0x10')](_0x42ced7);}else{logger['info'](_0x6a38('0x11'),_0x4f3e12,_0x5937c2['priority']||_0x6a38('0x10'));_0x36ebfe[_0x6a38('0xa')]();}}else{_0x36ebfe[_0x6a38('0x10')]();}}}catch(_0x3e72e4){logger[_0x6a38('0x6')](_0x6a38('0x7'),_0x4f3e12,JSON['stringify'](_0x3e72e4));_0x36ebfe[_0x6a38('0xa')]();}};}; \ No newline at end of file +var _0xa7cb=['stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x46bd7e,_0x55f146){var _0x2b8e37=function(_0x56bd92){while(--_0x56bd92){_0x46bd7e['push'](_0x46bd7e['shift']());}};_0x2b8e37(++_0x55f146);}(_0xa7cb,0x1a5));var _0xba7c=function(_0x20a74e,_0x26c09d){_0x20a74e=_0x20a74e-0x0;var _0x513e0f=_0xa7cb[_0x20a74e];return _0x513e0f;};'use strict';var schema=require(_0xba7c('0x0'));var _=require(_0xba7c('0x1'));var logger=require(_0xba7c('0x2'))(_0xba7c('0x3'));var gotop=schema({'priority':{'type':_0xba7c('0x4'),'required':!![],'message':_0xba7c('0x5')}});exports[_0xba7c('0x6')]=function(_0x52bba3,_0x5d7053){return function(_0x3cb897){try{var _0x4d4124={'priority':_0x5d7053[0x0]};var _0x114180=gotop[_0xba7c('0x0')](_0x4d4124,{'typecast':!![]});if(_0x114180[_0xba7c('0x7')]){logger[_0xba7c('0x8')]('[%s][GOTOP]\x20%s',_0x52bba3,_[_0xba7c('0x9')](_0x114180,'message')[_0xba7c('0xa')](',\x20'));_0x3cb897[_0xba7c('0xb')]();}else{logger['info'](_0xba7c('0xc'),_0x52bba3,_0x4d4124[_0xba7c('0xd')]);if(_0x4d4124['priority']){var _0xfe516d=_[_0xba7c('0xe')](_0x3cb897[_0xba7c('0xf')](),{'p':_0x4d4124[_0xba7c('0xd')]});if(_0xfe516d>=0x0){logger[_0xba7c('0x10')](_0xba7c('0x11'),_0x52bba3,_0x4d4124[_0xba7c('0xd')]||_0xba7c('0x12'),_0xfe516d);_0x3cb897[_0xba7c('0x12')](_0xfe516d);}else{logger[_0xba7c('0x10')](_0xba7c('0x13'),_0x52bba3,_0x4d4124['priority']||_0xba7c('0x12'));_0x3cb897[_0xba7c('0xb')]();}}else{_0x3cb897[_0xba7c('0x12')]();}}}catch(_0x5ace21){logger[_0xba7c('0x8')]('[%s][GOTOP]\x20%s',_0x52bba3,JSON[_0xba7c('0x14')](_0x5ace21));_0x3cb897['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index ca75434..472436e 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 _0xd1f1=['routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','AccountId','account','upperFirst','InteractionId','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger'];(function(_0x55d9d9,_0x134208){var _0x1559da=function(_0x17ec52){while(--_0x17ec52){_0x55d9d9['push'](_0x55d9d9['shift']());}};_0x1559da(++_0x134208);}(_0xd1f1,0x84));var _0x1d1f=function(_0x195299,_0x7a1c77){_0x195299=_0x195299-0x0;var _0x258842=_0xd1f1[_0x195299];return _0x258842;};'use strict';var _=require(_0x1d1f('0x0'));var utils=require(_0x1d1f('0x1'));var logger=require(_0x1d1f('0x2'))(_0x1d1f('0x3'));var rpc={'chatMessage':require(_0x1d1f('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1d1f('0x5')),'smsMessage':require(_0x1d1f('0x6')),'faxMessage':require(_0x1d1f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1d1f('0x8')]=function(_0x13e896,_0x54e8a0){return function(_0x2337fc){try{var _0x5c285a={'body':utils[_0x1d1f('0x9')](_0x54e8a0[0x0],this),'ContactId':this[_0x1d1f('0xa')]['id']};if(this[_0x1d1f('0xb')]===_0x1d1f('0xc')){_0x5c285a['ChatWebsiteId']=this['account']['id'];}else{_0x5c285a[_['upperFirst'](this[_0x1d1f('0xb')])+_0x1d1f('0xd')]=this[_0x1d1f('0xe')]['id'];}_0x5c285a[_[_0x1d1f('0xf')](this['channel'])+_0x1d1f('0x10')]=this[_0x1d1f('0x11')]['id'];if(rpc[this[_0x1d1f('0xb')]+_0x1d1f('0x12')]){return rpc[this[_0x1d1f('0xb')]+_0x1d1f('0x12')]['create'](_0x5c285a)['then'](function(_0x48e2c0){logger[_0x1d1f('0x13')](_0x1d1f('0x14'),_0x13e896,_0x5c285a[_0x1d1f('0x15')]);_0x2337fc[_0x1d1f('0x16')]();})[_0x1d1f('0x17')](function(_0x465f20){logger[_0x1d1f('0x18')](_0x1d1f('0x14'),_0x13e896,JSON[_0x1d1f('0x19')](_0x465f20));_0x2337fc[_0x1d1f('0x1a')]();});}}catch(_0x2ec931){logger[_0x1d1f('0x18')](_0x1d1f('0x14'),_0x13e896,JSON['stringify'](_0x2ec931));_0x2337fc[_0x1d1f('0x1a')]();}};}; \ No newline at end of file +var _0x827a=['Message','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','interaction'];(function(_0x20610f,_0xbe2167){var _0x4ef310=function(_0x1b5395){while(--_0x1b5395){_0x20610f['push'](_0x20610f['shift']());}};_0x4ef310(++_0xbe2167);}(_0x827a,0x167));var _0xa827=function(_0x41d5e4,_0x363232){_0x41d5e4=_0x41d5e4-0x0;var _0x2ba7aa=_0x827a[_0x41d5e4];return _0x2ba7aa;};'use strict';var _=require(_0xa827('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xa827('0x1'));var rpc={'chatMessage':require(_0xa827('0x2')),'openchannelMessage':require(_0xa827('0x3')),'mailMessage':require(_0xa827('0x4')),'smsMessage':require(_0xa827('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa827('0x6'))};exports[_0xa827('0x7')]=function(_0x3c7208,_0x5d92ab){return function(_0x15d9fe){try{var _0x5af65e={'body':utils[_0xa827('0x8')](_0x5d92ab[0x0],this),'ContactId':this[_0xa827('0x9')]['id']};if(this[_0xa827('0xa')]===_0xa827('0xb')){_0x5af65e['ChatWebsiteId']=this[_0xa827('0xc')]['id'];}else{_0x5af65e[_[_0xa827('0xd')](this[_0xa827('0xa')])+_0xa827('0xe')]=this[_0xa827('0xc')]['id'];}_0x5af65e[_[_0xa827('0xd')](this[_0xa827('0xa')])+'InteractionId']=this[_0xa827('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xa827('0xa')]+_0xa827('0x10')]['create'](_0x5af65e)[_0xa827('0x11')](function(_0x3e3c87){logger[_0xa827('0x12')](_0xa827('0x13'),_0x3c7208,_0x5af65e[_0xa827('0x14')]);_0x15d9fe[_0xa827('0x15')]();})['catch'](function(_0x2bbd3f){logger[_0xa827('0x16')]('[%s][MESSAGE]\x20%s',_0x3c7208,JSON[_0xa827('0x17')](_0x2bbd3f));_0x15d9fe[_0xa827('0x18')]();});}}catch(_0x5721d5){logger[_0xa827('0x16')](_0xa827('0x13'),_0x3c7208,JSON[_0xa827('0x17')](_0x5721d5));_0x15d9fe[_0xa827('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 5c1ea1e..9374910 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 _0x984a=['error','[%s][NOOP]\x20%s','stringify','routing','consequence','info','getMustacheRender','next'];(function(_0x42db70,_0x1a2684){var _0x34e797=function(_0x580b84){while(--_0x580b84){_0x42db70['push'](_0x42db70['shift']());}};_0x34e797(++_0x1a2684);}(_0x984a,0xc3));var _0xa984=function(_0x28c53e,_0x22f67f){_0x28c53e=_0x28c53e-0x0;var _0x2aaf65=_0x984a[_0x28c53e];return _0x2aaf65;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0xa984('0x0'));exports[_0xa984('0x1')]=function(_0x2ad683,_0x1c5901){return function(_0x4bb0a6){try{logger[_0xa984('0x2')]('[%s][NOOP]\x20%s',_0x2ad683,utils[_0xa984('0x3')](_0x1c5901[0x0],this));_0x4bb0a6[_0xa984('0x4')]();}catch(_0x596331){logger[_0xa984('0x5')](_0xa984('0x6'),_0x2ad683,JSON[_0xa984('0x7')](_0x596331));_0x4bb0a6['stop']();}};}; \ No newline at end of file +var _0x4dfc=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x4dfc,0x1ee));var _0xc4df=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x4dfc[_0x30d87a];return _0x48f64b;};'use strict';var utils=require(_0xc4df('0x0'));var logger=require(_0xc4df('0x1'))(_0xc4df('0x2'));exports[_0xc4df('0x3')]=function(_0x2324d1,_0x3b1e9d){return function(_0x568003){try{logger[_0xc4df('0x4')](_0xc4df('0x5'),_0x2324d1,utils[_0xc4df('0x6')](_0x3b1e9d[0x0],this));_0x568003[_0xc4df('0x7')]();}catch(_0x4fd72e){logger[_0xc4df('0x8')](_0xc4df('0x5'),_0x2324d1,JSON[_0xc4df('0x9')](_0x4fd72e));_0x568003[_0xc4df('0xa')]();}};}; \ 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 e5f8c50..d7d8ee4 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 _0x6643=['end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','info','name','QueueReport','create','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','timeout','toLowerCase','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue','qtimeout','rules'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6643,0x1d9));var _0x3664=function(_0x5dd5bc,_0x528adf){_0x5dd5bc=_0x5dd5bc-0x0;var _0x47cb21=_0x6643[_0x5dd5bc];return _0x47cb21;};'use strict';var schema=require(_0x3664('0x0'));var _=require(_0x3664('0x1'));var util=require(_0x3664('0x2'));var seqqueue=require(_0x3664('0x3'));var moment=require(_0x3664('0x4'));var Redis=require(_0x3664('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3664('0x6'))(_0x3664('0x7'));var strategy=require(_0x3664('0x8'));config[_0x3664('0x9')]=_[_0x3664('0xa')](config[_0x3664('0x9')],{'host':_0x3664('0xb'),'port':0x18eb});var io=require(_0x3664('0xc'))(new Redis(config['redis']));var attributes=['id',_0x3664('0xd'),_0x3664('0xe'),'queue',_0x3664('0xf'),_0x3664('0x10')];function emit(_0x352c0d,_0x5a0522,_0x580472){io['to'](_0x352c0d)[_0x3664('0x11')](_0x5a0522,_0x580472);}function emitChannelQueueInteraction(_0x4e294e,_0x119ff5,_0x64b6fb,_0x685224,_0x4a2271,_0x21ec75,_0x378185,_0x5eeca1){var _0x1959c5=_[_0x3664('0x12')](_0x64b6fb);_0x1959c5[_0x3664('0xd')]=_0x5eeca1;_0x1959c5[_0x3664('0x13')]=_0x119ff5;_0x1959c5[_0x3664('0xe')]=_0x685224;_0x1959c5['id']=_0x4a2271;if(_0x21ec75){_0x378185[util['format'](_0x3664('0x14'),_0x4e294e)][_0x4a2271]=_['pick'](_0x1959c5,attributes);}else{delete _0x378185[util[_0x3664('0x15')](_0x3664('0x14'),_0x4e294e)][_0x4a2271];}emit(util['format'](_0x3664('0x16'),_0x4e294e,_0x119ff5),util[_0x3664('0x15')](_0x3664('0x17'),_0x4e294e,_0x21ec75?_0x3664('0x18'):_0x3664('0x19')),_['pick'](_0x1959c5,attributes));}var rpc={'openchannelQueueReport':require(_0x3664('0x1a')),'mailQueueReport':require(_0x3664('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x3664('0x1c')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x3664('0x1d'))};var queue=schema({'name':{'type':_0x3664('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x3664('0x1f'),'message':_0x3664('0x20')}});function startRouting(_0x14defa,_0x53a477,_0x3032d1,_0x174553){if(_0x14defa&&_0x53a477&&_0x3032d1){_0x53a477[_0x3664('0x21')]+=0x1;var _0x197e9c={'uniqueid':_0x14defa,'from':_0x3032d1[_0x3664('0x22')]?_0x3032d1[_0x3664('0x22')]['from']:'','joinAt':moment()[_0x3664('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3032d1['contact']?_0x3032d1[_0x3664('0x23')]['id']:null,'ListId':_0x3032d1[_0x3664('0x24')]?_0x3032d1[_0x3664('0x24')]['id']:null};_0x197e9c[_[_0x3664('0x25')](_0x3032d1[_0x3664('0x26')])+_0x3664('0x27')]=_0x53a477['id']||null;_0x197e9c[_[_0x3664('0x25')](_0x3032d1[_0x3664('0x26')])+'InteractionId']=_0x3032d1['interaction']?_0x3032d1[_0x3664('0x28')]['id']:null;_0x197e9c[_['upperFirst'](_0x3032d1[_0x3664('0x26')])+'MessageId']=_0x3032d1[_0x3664('0x29')]?_0x3032d1[_0x3664('0x29')]['id']:null;_0x197e9c[_[_0x3664('0x25')](_0x3032d1[_0x3664('0x26')])+(_0x3032d1[_0x3664('0x26')]!==_0x3664('0x2a')?_0x3664('0x2b'):'WebsiteId')]=_0x3032d1['account']?_0x3032d1[_0x3664('0xe')]['id']:null;logger[_0x3664('0x2c')](util[_0x3664('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x14defa,_0x53a477[_0x3664('0x2d')]));emitChannelQueueInteraction(_0x3032d1[_0x3664('0x26')],_0x53a477[_0x3664('0x2d')],_0x197e9c,_0x3032d1[_0x3664('0xe')][_0x3664('0x2d')],_0x3032d1[_0x3664('0x29')]['id'],!![],_0x174553,_0x53a477['id']);if(rpc[_0x3032d1[_0x3664('0x26')]+_0x3664('0x2e')]){return rpc[_0x3032d1[_0x3664('0x26')]+_0x3664('0x2e')][_0x3664('0x2f')](_0x197e9c)['catch'](function(_0x3eed91){logger['error'](_0x3664('0x30'));});}}}function stopRouting(_0x356975,_0x35c668,_0xbfd9e1,_0x4514f8){if(_0x356975&&_0x35c668){_0x35c668[_0x3664('0x21')]-=0x1;var _0x20177d={'leaveAt':moment()[_0x3664('0x15')](_0x3664('0x31')),'acceptAt':moment()[_0x3664('0x15')](_0x3664('0x31')),'reason':_0x3664('0x32')};logger[_0x3664('0x2c')](util[_0x3664('0x15')](_0x3664('0x33'),_0x356975,_0x35c668[_0x3664('0x2d')]));emitChannelQueueInteraction(_0xbfd9e1['channel'],_0x35c668['name'],_0xbfd9e1['body'],_0xbfd9e1[_0x3664('0xe')][_0x3664('0x2d')],_0xbfd9e1['message']['id'],![],_0x4514f8,_0x35c668['id']);if(rpc[_0xbfd9e1['channel']+_0x3664('0x2e')]){return rpc[_0xbfd9e1[_0x3664('0x26')]+_0x3664('0x2e')][_0x3664('0x34')](_0x356975,_0x20177d)[_0x3664('0x35')](function(_0x3dcd8f){logger[_0x3664('0x36')](_0x3664('0x37'));});}}}function endRouting(_0x5787bb,_0x4209e1,_0x2cb16c,_0x213c22){if(_0x5787bb&&_0x4209e1){_0x4209e1[_0x3664('0x21')]-=0x1;var _0x1a942a={'leaveAt':moment()[_0x3664('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x3664('0x38')};logger[_0x3664('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x5787bb,_0x4209e1[_0x3664('0x2d')]));emitChannelQueueInteraction(_0x2cb16c['channel'],_0x4209e1[_0x3664('0x2d')],_0x2cb16c[_0x3664('0x22')],_0x2cb16c[_0x3664('0xe')][_0x3664('0x2d')],_0x2cb16c[_0x3664('0x29')]['id'],![],_0x213c22);if(rpc[_0x2cb16c[_0x3664('0x26')]+_0x3664('0x2e')]){return rpc[_0x2cb16c['channel']+'QueueReport'][_0x3664('0x34')](_0x5787bb,_0x1a942a)[_0x3664('0x35')](function(_0x261dca){logger[_0x3664('0x36')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x16f5f3){return function(_0x5d0dab){return _0x5d0dab[_0x3664('0x2d')][_0x3664('0x39')]()===_0x16f5f3[_0x3664('0x39')]();};}exports['consequence']=function(_0x1eb2a6,_0x37c71a,_0x3e7ea3,_0x380530){return function(_0x4376bf){try{var _0x1d4385={'name':_0x37c71a[0x0],'timeout':_0x37c71a[0x1]};var _0x301e6b=queue[_0x3664('0x0')](_0x1d4385,{'typecast':!![]});if(_0x301e6b['length']){logger[_0x3664('0x36')](_0x3664('0x3a'),_0x1eb2a6,_['map'](_0x301e6b,_0x3664('0x29'))[_0x3664('0x3b')](',\x20'));_0x4376bf[_0x3664('0x3c')]();}else{var _0x48775d=_[_0x3664('0x3d')](_0x3e7ea3[_0x380530[_0x3664('0x26')]+_0x3664('0x3e')],handleFindQueue(_0x1d4385[_0x3664('0x2d')]));if(_0x48775d){startRouting(_0x1eb2a6,_0x48775d,_0x380530,_0x3e7ea3);var _0x26b476=(_0x48775d[_0x3664('0x38')]||0xa)*0x3e8;var _0x3165fc=(_0x1d4385['timeout']||0x14)*0x3e8;var _0x40d543,_0x5a63bc;if(_0x26b476>_0x3165fc){_0x3165fc=_0x26b476;}var _0x3fd512=seqqueue[_0x3664('0x3f')](_0x26b476);_0x3fd512['id']=_0x1eb2a6;_0x3fd512['atimeout']=_0x26b476;_0x3fd512[_0x3664('0x40')]=_0x3165fc;_0x3fd512[_0x3664('0x26')]=_0x380530[_0x3664('0x26')];_0x3e7ea3[_0x3664('0x41')][_0x1eb2a6]['on'](_0x3664('0x42'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1eb2a6);stopRouting(_0x1eb2a6,_0x48775d,_0x380530,_0x3e7ea3);clearTimeout(_0x40d543);_0x40d543=undefined;_0x3fd512[_0x3664('0x43')](!![]);if(_0x3e7ea3[_0x3664('0x41')][_0x1eb2a6]){delete _0x3e7ea3[_0x3664('0x41')][_0x1eb2a6];}_0x4376bf[_0x3664('0x3c')]();});_0x3e7ea3[_0x3664('0x41')][_0x1eb2a6]['on'](_0x3664('0x44'),function(){if(_0x3e7ea3[_0x3664('0x41')][_0x1eb2a6]){delete _0x3e7ea3[_0x3664('0x41')][_0x1eb2a6];}});_0x40d543=setTimeout(function(){logger['info'](_0x3664('0x45'),_0x1eb2a6);endRouting(_0x1eb2a6,_0x48775d,_0x380530,_0x3e7ea3);clearTimeout(_0x40d543);_0x3fd512['close'](!![]);_0x4376bf[_0x3664('0x46')]();},_0x3165fc);switch(_0x48775d[_0x3664('0x47')]){case _0x3664('0x48'):strategy['rrmemory'](_0x3fd512,_0x48775d,_0x3e7ea3,_0x380530);break;default:strategy[_0x3664('0x49')](_0x3fd512,_0x48775d,_0x3e7ea3,_0x380530);}}else{logger['error'](_0x3664('0x4a'),_0x1eb2a6,_0x1d4385[_0x3664('0x2d')]);_0x4376bf[_0x3664('0x3c')]();}}}catch(_0x1d927d){console[_0x3664('0x4b')](_0x1d927d);logger[_0x3664('0x36')](_0x3664('0x3a'),_0x1eb2a6,_0x1d927d[_0x3664('0x4c')]);_0x4376bf['stop']();}};}; \ No newline at end of file +var _0xcfc8=['validate','lodash','seq-queue','moment','ioredis','routing','./strategy','defaults','localhost','socket.io-emitter','redis','account','queue','from','joinAt','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack'];(function(_0x3157a8,_0x595f58){var _0x4b6a0c=function(_0x26696a){while(--_0x26696a){_0x3157a8['push'](_0x3157a8['shift']());}};_0x4b6a0c(++_0x595f58);}(_0xcfc8,0x172));var _0x8cfc=function(_0x35f613,_0x597b14){_0x35f613=_0x35f613-0x0;var _0x24281f=_0xcfc8[_0x35f613];return _0x24281f;};'use strict';var schema=require(_0x8cfc('0x0'));var _=require(_0x8cfc('0x1'));var util=require('util');var seqqueue=require(_0x8cfc('0x2'));var moment=require(_0x8cfc('0x3'));var Redis=require(_0x8cfc('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x8cfc('0x5'));var strategy=require(_0x8cfc('0x6'));config['redis']=_[_0x8cfc('0x7')](config['redis'],{'host':_0x8cfc('0x8'),'port':0x18eb});var io=require(_0x8cfc('0x9'))(new Redis(config[_0x8cfc('0xa')]));var attributes=['id','queue_id',_0x8cfc('0xb'),_0x8cfc('0xc'),_0x8cfc('0xd'),_0x8cfc('0xe')];function emit(_0x11ca89,_0x23e8ac,_0x5376a8){io['to'](_0x11ca89)['emit'](_0x23e8ac,_0x5376a8);}function emitChannelQueueInteraction(_0x219ad5,_0x50df01,_0x1e013e,_0x35de1e,_0x1c1371,_0x14a68c,_0x26a107,_0x1bf29d){var _0x52cfb2=_['clone'](_0x1e013e);_0x52cfb2[_0x8cfc('0xf')]=_0x1bf29d;_0x52cfb2[_0x8cfc('0xc')]=_0x50df01;_0x52cfb2[_0x8cfc('0xb')]=_0x35de1e;_0x52cfb2['id']=_0x1c1371;if(_0x14a68c){_0x26a107[util[_0x8cfc('0x10')]('%sQueuesWaitingInteractions',_0x219ad5)][_0x1c1371]=_['pick'](_0x52cfb2,attributes);}else{delete _0x26a107[util[_0x8cfc('0x10')](_0x8cfc('0x11'),_0x219ad5)][_0x1c1371];}emit(util['format'](_0x8cfc('0x12'),_0x219ad5,_0x50df01),util[_0x8cfc('0x10')](_0x8cfc('0x13'),_0x219ad5,_0x14a68c?_0x8cfc('0x14'):'remove'),_['pick'](_0x52cfb2,attributes));}var rpc={'openchannelQueueReport':require(_0x8cfc('0x15')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8cfc('0x16')),'smsQueueReport':require(_0x8cfc('0x17')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8cfc('0x18'))};var queue=schema({'name':{'type':_0x8cfc('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8cfc('0x1a'),'message':_0x8cfc('0x1b')}});function startRouting(_0x4c2a0f,_0x1c5cef,_0x20b0fd,_0x38aef1){if(_0x4c2a0f&&_0x1c5cef&&_0x20b0fd){_0x1c5cef[_0x8cfc('0x1c')]+=0x1;var _0x5eb339={'uniqueid':_0x4c2a0f,'from':_0x20b0fd['body']?_0x20b0fd[_0x8cfc('0x1d')][_0x8cfc('0xd')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20b0fd[_0x8cfc('0x1e')]?_0x20b0fd[_0x8cfc('0x1e')]['id']:null,'ListId':_0x20b0fd[_0x8cfc('0x1f')]?_0x20b0fd[_0x8cfc('0x1f')]['id']:null};_0x5eb339[_[_0x8cfc('0x20')](_0x20b0fd[_0x8cfc('0x21')])+_0x8cfc('0x22')]=_0x1c5cef['id']||null;_0x5eb339[_['upperFirst'](_0x20b0fd[_0x8cfc('0x21')])+'InteractionId']=_0x20b0fd[_0x8cfc('0x23')]?_0x20b0fd[_0x8cfc('0x23')]['id']:null;_0x5eb339[_[_0x8cfc('0x20')](_0x20b0fd[_0x8cfc('0x21')])+_0x8cfc('0x24')]=_0x20b0fd[_0x8cfc('0x25')]?_0x20b0fd[_0x8cfc('0x25')]['id']:null;_0x5eb339[_['upperFirst'](_0x20b0fd[_0x8cfc('0x21')])+(_0x20b0fd[_0x8cfc('0x21')]!==_0x8cfc('0x26')?'AccountId':_0x8cfc('0x27'))]=_0x20b0fd['account']?_0x20b0fd[_0x8cfc('0xb')]['id']:null;logger[_0x8cfc('0x28')](util[_0x8cfc('0x10')](_0x8cfc('0x29'),_0x4c2a0f,_0x1c5cef[_0x8cfc('0x2a')]));emitChannelQueueInteraction(_0x20b0fd['channel'],_0x1c5cef[_0x8cfc('0x2a')],_0x5eb339,_0x20b0fd[_0x8cfc('0xb')][_0x8cfc('0x2a')],_0x20b0fd[_0x8cfc('0x25')]['id'],!![],_0x38aef1,_0x1c5cef['id']);if(rpc[_0x20b0fd[_0x8cfc('0x21')]+_0x8cfc('0x2b')]){return rpc[_0x20b0fd[_0x8cfc('0x21')]+_0x8cfc('0x2b')][_0x8cfc('0x2c')](_0x5eb339)[_0x8cfc('0x2d')](function(_0x141a00){logger[_0x8cfc('0x2e')](_0x8cfc('0x2f'));});}}}function stopRouting(_0xc1b3d7,_0x27cfd3,_0x54f94d,_0x28dc09){if(_0xc1b3d7&&_0x27cfd3){_0x27cfd3['waiting']-=0x1;var _0x58cda2={'leaveAt':moment()[_0x8cfc('0x10')](_0x8cfc('0x30')),'acceptAt':moment()[_0x8cfc('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x8cfc('0x28')](util[_0x8cfc('0x10')](_0x8cfc('0x31'),_0xc1b3d7,_0x27cfd3[_0x8cfc('0x2a')]));emitChannelQueueInteraction(_0x54f94d[_0x8cfc('0x21')],_0x27cfd3[_0x8cfc('0x2a')],_0x54f94d[_0x8cfc('0x1d')],_0x54f94d[_0x8cfc('0xb')]['name'],_0x54f94d[_0x8cfc('0x25')]['id'],![],_0x28dc09,_0x27cfd3['id']);if(rpc[_0x54f94d[_0x8cfc('0x21')]+_0x8cfc('0x2b')]){return rpc[_0x54f94d[_0x8cfc('0x21')]+_0x8cfc('0x2b')][_0x8cfc('0x32')](_0xc1b3d7,_0x58cda2)[_0x8cfc('0x2d')](function(_0x336ae8){logger['error'](_0x8cfc('0x33'));});}}}function endRouting(_0x3fe936,_0x2af6cd,_0xedc937,_0x2f26a1){if(_0x3fe936&&_0x2af6cd){_0x2af6cd[_0x8cfc('0x1c')]-=0x1;var _0x3c3fd9={'leaveAt':moment()['format'](_0x8cfc('0x30')),'exitAt':moment()['format'](_0x8cfc('0x30')),'reason':_0x8cfc('0x34')};logger[_0x8cfc('0x28')](util[_0x8cfc('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x3fe936,_0x2af6cd[_0x8cfc('0x2a')]));emitChannelQueueInteraction(_0xedc937[_0x8cfc('0x21')],_0x2af6cd[_0x8cfc('0x2a')],_0xedc937[_0x8cfc('0x1d')],_0xedc937['account'][_0x8cfc('0x2a')],_0xedc937[_0x8cfc('0x25')]['id'],![],_0x2f26a1);if(rpc[_0xedc937[_0x8cfc('0x21')]+'QueueReport']){return rpc[_0xedc937[_0x8cfc('0x21')]+_0x8cfc('0x2b')][_0x8cfc('0x32')](_0x3fe936,_0x3c3fd9)[_0x8cfc('0x2d')](function(_0x40aaa1){logger[_0x8cfc('0x2e')](_0x8cfc('0x33'));});}}}function handleFindQueue(_0x3ba77f){return function(_0x53d03f){return _0x53d03f[_0x8cfc('0x2a')]['toLowerCase']()===_0x3ba77f[_0x8cfc('0x35')]();};}exports[_0x8cfc('0x36')]=function(_0x1bcbc4,_0x282433,_0x5a8720,_0x1d15a7){return function(_0x6cba12){try{var _0x192a05={'name':_0x282433[0x0],'timeout':_0x282433[0x1]};var _0x251aa4=queue[_0x8cfc('0x0')](_0x192a05,{'typecast':!![]});if(_0x251aa4[_0x8cfc('0x37')]){logger[_0x8cfc('0x2e')](_0x8cfc('0x38'),_0x1bcbc4,_[_0x8cfc('0x39')](_0x251aa4,_0x8cfc('0x25'))[_0x8cfc('0x3a')](',\x20'));_0x6cba12[_0x8cfc('0x3b')]();}else{var _0x4e061d=_['find'](_0x5a8720[_0x1d15a7[_0x8cfc('0x21')]+_0x8cfc('0x3c')],handleFindQueue(_0x192a05[_0x8cfc('0x2a')]));if(_0x4e061d){startRouting(_0x1bcbc4,_0x4e061d,_0x1d15a7,_0x5a8720);var _0x36db3d=(_0x4e061d[_0x8cfc('0x34')]||0xa)*0x3e8;var _0x4cca29=(_0x192a05[_0x8cfc('0x34')]||0x14)*0x3e8;var _0x40a150,_0x26ed4c;if(_0x36db3d>_0x4cca29){_0x4cca29=_0x36db3d;}var _0x1ab493=seqqueue[_0x8cfc('0x3d')](_0x36db3d);_0x1ab493['id']=_0x1bcbc4;_0x1ab493[_0x8cfc('0x3e')]=_0x36db3d;_0x1ab493[_0x8cfc('0x3f')]=_0x4cca29;_0x1ab493[_0x8cfc('0x21')]=_0x1d15a7[_0x8cfc('0x21')];_0x5a8720[_0x8cfc('0x40')][_0x1bcbc4]['on'](_0x8cfc('0x41'),function(){logger['info'](_0x8cfc('0x42'),_0x1bcbc4);stopRouting(_0x1bcbc4,_0x4e061d,_0x1d15a7,_0x5a8720);clearTimeout(_0x40a150);_0x40a150=undefined;_0x1ab493[_0x8cfc('0x43')](!![]);if(_0x5a8720[_0x8cfc('0x40')][_0x1bcbc4]){delete _0x5a8720[_0x8cfc('0x40')][_0x1bcbc4];}_0x6cba12[_0x8cfc('0x3b')]();});_0x5a8720[_0x8cfc('0x40')][_0x1bcbc4]['on'](_0x8cfc('0x44'),function(){if(_0x5a8720[_0x8cfc('0x40')][_0x1bcbc4]){delete _0x5a8720[_0x8cfc('0x40')][_0x1bcbc4];}});_0x40a150=setTimeout(function(){logger[_0x8cfc('0x28')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x1bcbc4);endRouting(_0x1bcbc4,_0x4e061d,_0x1d15a7,_0x5a8720);clearTimeout(_0x40a150);_0x1ab493[_0x8cfc('0x43')](!![]);_0x6cba12['next']();},_0x4cca29);switch(_0x4e061d[_0x8cfc('0x45')]){case'rrmemory':strategy[_0x8cfc('0x46')](_0x1ab493,_0x4e061d,_0x5a8720,_0x1d15a7);break;default:strategy['beepall'](_0x1ab493,_0x4e061d,_0x5a8720,_0x1d15a7);}}else{logger[_0x8cfc('0x2e')](_0x8cfc('0x47'),_0x1bcbc4,_0x192a05['name']);_0x6cba12[_0x8cfc('0x3b')]();}}}catch(_0x449d3b){console[_0x8cfc('0x48')](_0x449d3b);logger[_0x8cfc('0x2e')](_0x8cfc('0x38'),_0x1bcbc4,_0x449d3b[_0x8cfc('0x49')]);_0x6cba12['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 88c02b8..81a7bcb 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 _0x3403=['bind','drained','handleDrained','prototype','handleRun','handleTimeout','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','routing','busyQueue','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','squeue','agent','push'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x3403,0x165));var _0x3340=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3403[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x3340('0x0'));var uuid=require('uuid');var util=require(_0x3340('0x1'));var logger=require(_0x3340('0x2'))('routing');var Agent=function(_0x9fd896,_0x242b42,_0x389f3c,_0x2bf293){this['notificationId']=uuid['v4']();this[_0x3340('0x3')]=_0x9fd896;this[_0x3340('0x4')]=_0x242b42;this['realtime']=_0x389f3c;this['routing']=_0x2bf293;this[_0x3340('0x3')][_0x3340('0x5')](this['handleRun'][_0x3340('0x6')](this),this['handleTimeout'][_0x3340('0x6')](this));this[_0x3340('0x3')]['on']('timeout',this['handleTimeout'][_0x3340('0x6')](this));this['squeue']['on'](_0x3340('0x7'),this[_0x3340('0x8')][_0x3340('0x6')](this));};Agent[_0x3340('0x9')][_0x3340('0x5')]=function(){this[_0x3340('0x3')][_0x3340('0x5')](this[_0x3340('0xa')][_0x3340('0x6')](this),this[_0x3340('0xb')][_0x3340('0x6')](this));};Agent[_0x3340('0x9')][_0x3340('0x8')]=function(){this[_0x3340('0xb')](!![]);};Agent[_0x3340('0x9')][_0x3340('0xa')]=function(_0x21626b){logger[_0x3340('0xc')](_0x3340('0xd'),this[_0x3340('0x3')]['id'],this[_0x3340('0x4')]['id']);if(_[_0x3340('0xe')](this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']])){logger[_0x3340('0xc')](_0x3340('0x11'),this[_0x3340('0x3')]['id'],this[_0x3340('0x4')]['id']);setTimeout(this[_0x3340('0x5')][_0x3340('0x6')](this),0x3e8);}else{if(this['routing'][_0x3340('0x12')]||util['isAgentAvailable'](this[_0x3340('0x3')]['id'],this[_0x3340('0xf')][_0x3340('0x10')][this['agent']['id']],this[_0x3340('0x3')]['channel'],![])){this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']][_0x3340('0x13')]=!![];this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']]['busyQueue']=undefined;util[_0x3340('0x14')](this[_0x3340('0x15')],this[_0x3340('0x3')]['id'],this['realtime'][_0x3340('0x10')][this[_0x3340('0x4')]['id']],null,this['routing']);util[_0x3340('0x16')](this[_0x3340('0x3')]['id'],this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']],_0x3340('0x17')+(this['routing'][_0x3340('0x12')]?_0x3340('0x18'):''));}else{logger[_0x3340('0xc')](_0x3340('0x19'),this['squeue']['id'],this[_0x3340('0x4')]['id']);setTimeout(this[_0x3340('0x5')][_0x3340('0x6')](this),0x3e8);}}};Agent['prototype'][_0x3340('0xb')]=function(_0x332f31){if(_[_0x3340('0xe')](this[_0x3340('0xf')][_0x3340('0x10')][this['agent']['id']])){return logger['info'](_0x3340('0x11'),this['squeue']['id'],this[_0x3340('0x4')]['id']);}else{logger['info'](_0x3340('0x1a'),this['squeue']['id'],this[_0x3340('0x4')]['id']);util[_0x3340('0x1b')](this[_0x3340('0x15')],this[_0x3340('0x3')]['id'],this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']],null,this[_0x3340('0x1c')]);this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']]['busy']=![];this['realtime'][_0x3340('0x10')][this[_0x3340('0x4')]['id']][_0x3340('0x1d')]=undefined;util[_0x3340('0x16')](this['squeue']['id'],this[_0x3340('0xf')][_0x3340('0x10')][this[_0x3340('0x4')]['id']],_0x332f31?_0x3340('0x1e'):_0x3340('0x1f'));}if(!_0x332f31){setTimeout(this[_0x3340('0x5')]['bind'](this),0x3e8);}};function agent(_0x5d0a8c,_0x442b3a,_0x5d0bcf,_0x4da47e){return new Agent(_0x5d0a8c,_0x442b3a,_0x5d0bcf,_0x4da47e);}module[_0x3340('0x20')]=agent; \ No newline at end of file +var _0x9b1f=['routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','drained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','busy','showNotification','writeLog','RINGING',':FORCED','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger'];(function(_0x7d171,_0x2ec19e){var _0x20ef96=function(_0xa9c165){while(--_0xa9c165){_0x7d171['push'](_0x7d171['shift']());}};_0x20ef96(++_0x2ec19e);}(_0x9b1f,0x1ec));var _0xf9b1=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x9b1f[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0xf9b1('0x0'));var uuid=require(_0xf9b1('0x1'));var util=require('./util');var logger=require(_0xf9b1('0x2'))(_0xf9b1('0x3'));var Agent=function(_0x55880b,_0x1873b2,_0x15f891,_0x189b24){this[_0xf9b1('0x4')]=uuid['v4']();this[_0xf9b1('0x5')]=_0x55880b;this[_0xf9b1('0x6')]=_0x1873b2;this['realtime']=_0x15f891;this[_0xf9b1('0x3')]=_0x189b24;this[_0xf9b1('0x5')][_0xf9b1('0x7')](this[_0xf9b1('0x8')][_0xf9b1('0x9')](this),this[_0xf9b1('0xa')][_0xf9b1('0x9')](this));this['squeue']['on'](_0xf9b1('0xb'),this[_0xf9b1('0xa')]['bind'](this));this[_0xf9b1('0x5')]['on'](_0xf9b1('0xc'),this['handleDrained'][_0xf9b1('0x9')](this));};Agent['prototype']['push']=function(){this[_0xf9b1('0x5')]['push'](this[_0xf9b1('0x8')]['bind'](this),this[_0xf9b1('0xa')]['bind'](this));};Agent[_0xf9b1('0xd')]['handleDrained']=function(){this[_0xf9b1('0xa')](!![]);};Agent[_0xf9b1('0xd')][_0xf9b1('0x8')]=function(_0x54e452){logger[_0xf9b1('0xe')](_0xf9b1('0xf'),this['squeue']['id'],this[_0xf9b1('0x6')]['id']);if(_['isNil'](this['realtime'][_0xf9b1('0x10')][this['agent']['id']])){logger['info'](_0xf9b1('0x11'),this[_0xf9b1('0x5')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0xf9b1('0x3')]['forcedOwnership']||util[_0xf9b1('0x12')](this[_0xf9b1('0x5')]['id'],this[_0xf9b1('0x13')][_0xf9b1('0x10')][this[_0xf9b1('0x6')]['id']],this[_0xf9b1('0x5')][_0xf9b1('0x14')],![])){this[_0xf9b1('0x13')][_0xf9b1('0x10')][this['agent']['id']][_0xf9b1('0x15')]=!![];this[_0xf9b1('0x13')][_0xf9b1('0x10')][this['agent']['id']]['busyQueue']=undefined;util[_0xf9b1('0x16')](this[_0xf9b1('0x4')],this['squeue']['id'],this[_0xf9b1('0x13')][_0xf9b1('0x10')][this[_0xf9b1('0x6')]['id']],null,this[_0xf9b1('0x3')]);util[_0xf9b1('0x17')](this['squeue']['id'],this[_0xf9b1('0x13')][_0xf9b1('0x10')][this['agent']['id']],_0xf9b1('0x18')+(this[_0xf9b1('0x3')]['forcedOwnership']?_0xf9b1('0x19'):''));}else{logger[_0xf9b1('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xf9b1('0x5')]['id'],this[_0xf9b1('0x6')]['id']);setTimeout(this[_0xf9b1('0x7')][_0xf9b1('0x9')](this),0x3e8);}}};Agent[_0xf9b1('0xd')]['handleTimeout']=function(_0x3a2ba2){if(_[_0xf9b1('0x1a')](this[_0xf9b1('0x13')][_0xf9b1('0x10')][this[_0xf9b1('0x6')]['id']])){return logger[_0xf9b1('0xe')](_0xf9b1('0x11'),this['squeue']['id'],this[_0xf9b1('0x6')]['id']);}else{logger[_0xf9b1('0xe')](_0xf9b1('0x1b'),this[_0xf9b1('0x5')]['id'],this[_0xf9b1('0x6')]['id']);util[_0xf9b1('0x1c')](this[_0xf9b1('0x4')],this[_0xf9b1('0x5')]['id'],this['realtime'][_0xf9b1('0x10')][this['agent']['id']],null,this[_0xf9b1('0x3')]);this['realtime'][_0xf9b1('0x10')][this[_0xf9b1('0x6')]['id']]['busy']=![];this[_0xf9b1('0x13')][_0xf9b1('0x10')][this[_0xf9b1('0x6')]['id']][_0xf9b1('0x1d')]=undefined;util[_0xf9b1('0x17')](this['squeue']['id'],this[_0xf9b1('0x13')]['agents'][this[_0xf9b1('0x6')]['id']],_0x3a2ba2?_0xf9b1('0x1e'):_0xf9b1('0x1f'));}if(!_0x3a2ba2){setTimeout(this[_0xf9b1('0x7')][_0xf9b1('0x9')](this),0x3e8);}};function agent(_0x2721f1,_0x4405d7,_0x1292a8,_0x4b3f25){return new Agent(_0x2721f1,_0x4405d7,_0x1292a8,_0x4b3f25);}module[_0xf9b1('0x20')]=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 a10d5a2..7650060 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 _0x4fd7=['handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','isNil','Agents','length','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','queue','routing','squeue'];(function(_0x56d2cc,_0x13dd2e){var _0x4c5deb=function(_0x151ef5){while(--_0x151ef5){_0x56d2cc['push'](_0x56d2cc['shift']());}};_0x4c5deb(++_0x13dd2e);}(_0x4fd7,0xe6));var _0x74fd=function(_0x89d697,_0x1e74be){_0x89d697=_0x89d697-0x0;var _0x31aa7c=_0x4fd7[_0x89d697];return _0x31aa7c;};'use strict';var _=require(_0x74fd('0x0'));var uuid=require(_0x74fd('0x1'));var util=require(_0x74fd('0x2'));var logger=require(_0x74fd('0x3'))('routing');var Beepall=function(_0x4fba38,_0xfa6318,_0x29109a,_0x59e3f1){this[_0x74fd('0x4')]=uuid['v4']();this['squeue']=_0x4fba38;this[_0x74fd('0x5')]=_0xfa6318;this['realtime']=_0x29109a;this[_0x74fd('0x6')]=_0x59e3f1;this[_0x74fd('0x7')]['push'](this[_0x74fd('0x8')][_0x74fd('0x9')](this),this['handleTimeout'][_0x74fd('0x9')](this));this[_0x74fd('0x7')]['on'](_0x74fd('0xa'),this[_0x74fd('0xb')][_0x74fd('0x9')](this));this[_0x74fd('0x7')]['on'](_0x74fd('0xc'),this[_0x74fd('0xd')][_0x74fd('0x9')](this));};Beepall[_0x74fd('0xe')][_0x74fd('0xf')]=function(){this[_0x74fd('0x7')][_0x74fd('0xf')](this[_0x74fd('0x8')][_0x74fd('0x9')](this),this[_0x74fd('0xb')]['bind'](this));};Beepall[_0x74fd('0xe')][_0x74fd('0xd')]=function(_0x4cd5bf){this['handleTimeout'](!![]);};Beepall[_0x74fd('0xe')][_0x74fd('0x8')]=function(_0x1a812e){var _0xf6164=!![];if(!_[_0x74fd('0x10')](this[_0x74fd('0x5')])&&!_[_0x74fd('0x10')](this[_0x74fd('0x5')][_0x74fd('0x11')])&&this[_0x74fd('0x5')][_0x74fd('0x11')]['length']>0x0){for(var _0x2975f3=0x0,_0x2a166b;_0x2975f30x0){for(var _0x4a1e67=0x0,_0x2335ff;_0x4a1e670x0&&_0x477e6a[_0x48a08d+'CurrentCapacity']>=_0x477e6a[_0x48a08d+_0x1126('0x21')]){writeLog(_0x29ab60,_0x477e6a,_0x48a08d[_0x1126('0x23')]()+_0x1126('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x541bc9,_0xeb7d89,_0x39bf0e,_0x55e195,_0x2fb797){return sendNotification(!![],_0x541bc9,_0xeb7d89,_0x39bf0e,_0x55e195,_0x2fb797);};exports[_0x1126('0x25')]=function(_0x4a334a,_0x3fa694,_0x4bf807,_0xc62460,_0x4bd50b){return sendNotification(![],_0x4a334a,_0x3fa694,_0x4bf807,_0xc62460,_0x4bd50b);};exports[_0x1126('0x26')]=writeLog; \ No newline at end of file +var _0x4fb4=['isAgentAvailable','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','save','remove','info'];(function(_0x52a3e9,_0x419096){var _0x44629d=function(_0x98549b){while(--_0x98549b){_0x52a3e9['push'](_0x52a3e9['shift']());}};_0x44629d(++_0x419096);}(_0x4fb4,0x190));var _0x44fb=function(_0x2ab743,_0x26c189){_0x2ab743=_0x2ab743-0x0;var _0x3225c8=_0x4fb4[_0x2ab743];return _0x3225c8;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var utils=require(_0x44fb('0x1'));var Mustache=require(_0x44fb('0x2'));var Redis=require(_0x44fb('0x3'));var config=require(_0x44fb('0x4'));var logger=require(_0x44fb('0x5'))('routing');config[_0x44fb('0x6')]=_[_0x44fb('0x7')](config[_0x44fb('0x6')],{'host':_0x44fb('0x8'),'port':0x18eb});var io=require(_0x44fb('0x9'))(new Redis(config[_0x44fb('0x6')]));function emit(_0x464af5,_0x2a4d75,_0x59aa6d){io['to'](_0x464af5)[_0x44fb('0xa')](_0x2a4d75,_0x59aa6d);}function sendNotification(_0xd4ead0,_0x5405a8,_0x42fcc2,_0x3d9002,_0x2a1cb7,_0x34444f){io['to'](util[_0x44fb('0xb')](_0x44fb('0xc'),_0x3d9002[_0x44fb('0xd')]))[_0x44fb('0xa')](_0x44fb('0xe'),_0x3d9002);var _0x2ae684=_0x34444f||{};var _0x4b202d=_0x42fcc2[_0x44fb('0xf')]('.');var _0x1e8a60={'uniqueid':_0x5405a8,'channel':_0x4b202d[0x0],'id':_0x4b202d[0x1],'title':_0x4b202d[0x0]+_0x44fb('0x10'),'interactionId':_0x4b202d[0x2],'queue':_0x2a1cb7?_0x2a1cb7[_0x44fb('0xd')]:null,'sound':_0x2ae684[_0x44fb('0x11')]['notificationSound'],'shake':_0x2ae684[_0x44fb('0x11')][_0x44fb('0x12')]};try{if(!_0x2ae684[_0x44fb('0x13')]){_0x2ae684[_0x44fb('0x13')]={};}if(_0x2a1cb7){_0x2ae684[_0x44fb('0x13')]['queue']=_0x2a1cb7;}else if(_0x2ae684[_0x44fb('0x13')][_0x44fb('0x14')]){delete _0x2ae684[_0x44fb('0x13')][_0x44fb('0x14')];}_0x1e8a60[_0x44fb('0x15')]=utils[_0x44fb('0x16')](_0x2ae684[_0x44fb('0x11')]['notificationTemplate'],_0x2ae684);}catch(_0x2c622f){_0x1e8a60[_0x44fb('0x15')]=_0x44fb('0x17');logger[_0x44fb('0x18')](util[_0x44fb('0xb')](_0x44fb('0x19'),_0x5405a8,_0x2c622f[_0x44fb('0x1a')]));}io['to'](util[_0x44fb('0xb')](_0x44fb('0xc'),_0x3d9002[_0x44fb('0xd')]))['emit'](util['format']('notification:%s',_0xd4ead0?_0x44fb('0x1b'):_0x44fb('0x1c')),_0x1e8a60);}function writeLog(_0x2dd412,_0x544647,_0x52507a){return logger[_0x44fb('0x1d')](util[_0x44fb('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2dd412,_0x544647['name'],_0x52507a));}exports[_0x44fb('0x1e')]=function(_0x5cf7ec,_0x441d79,_0x4fc66d,_0x954b1d){if(_0x441d79[_0x44fb('0x1f')]){writeLog(_0x5cf7ec,_0x441d79,_0x44fb('0x20'));return![];}if(!_0x441d79['online']){writeLog(_0x5cf7ec,_0x441d79,'OFFLINE');return![];}if(_0x441d79[_0x4fc66d+_0x44fb('0x21')]){writeLog(_0x5cf7ec,_0x441d79,_0x44fb('0x22'));return![];}if(_0x954b1d&&_0x441d79[_0x44fb('0x23')](_0x4fc66d+_0x44fb('0x24'))&&_0x441d79['hasOwnProperty'](_0x4fc66d+_0x44fb('0x25'))){if(_0x441d79[_0x4fc66d+_0x44fb('0x24')]>0x0&&_0x441d79[_0x4fc66d+'CurrentCapacity']>=_0x441d79[_0x4fc66d+'Capacity']){writeLog(_0x5cf7ec,_0x441d79,_0x4fc66d[_0x44fb('0x26')]()+_0x44fb('0x27'));return![];}}return!![];};exports[_0x44fb('0x28')]=function(_0x1f5d4c,_0xb7e5e8,_0x15e748,_0x2ce72d,_0x35652e){return sendNotification(!![],_0x1f5d4c,_0xb7e5e8,_0x15e748,_0x2ce72d,_0x35652e);};exports[_0x44fb('0x29')]=function(_0x4f079d,_0x48eb7d,_0x587984,_0x51b40e,_0x4a957f){return sendNotification(![],_0x4f079d,_0x48eb7d,_0x587984,_0x51b40e,_0x4a957f);};exports[_0x44fb('0x2a')]=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 02a9658..06245f2 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 _0xdb6f=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20%s','isObject','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender'];(function(_0x11640f,_0x27ba94){var _0x5c2882=function(_0x12626c){while(--_0x12626c){_0x11640f['push'](_0x11640f['shift']());}};_0x5c2882(++_0x27ba94);}(_0xdb6f,0x93));var _0xfdb6=function(_0x22b983,_0x244e2e){_0x22b983=_0x22b983-0x0;var _0x2b28da=_0xdb6f[_0x22b983];return _0x2b28da;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xfdb6('0x0'));var utils=require(_0xfdb6('0x1'));var logger=require(_0xfdb6('0x2'))(_0xfdb6('0x3'));var system=schema({'command':{'type':_0xfdb6('0x4'),'required':!![],'message':_0xfdb6('0x5')}});exports[_0xfdb6('0x6')]=function(_0x332f79,_0x22fe28){return function(_0x47b207){try{var _0x5784af={'command':_0x22fe28[0x0]};var _0xe0b8c0=system[_0xfdb6('0x7')](_0x5784af,{'typecast':!![]});if(_0xe0b8c0[_0xfdb6('0x8')]){logger[_0xfdb6('0x9')]('[%s][SYSTEM]\x20%s',_0x332f79,_[_0xfdb6('0xa')](_0xe0b8c0,'message')[_0xfdb6('0xb')](',\x20'));logger[_0xfdb6('0xc')](_0xfdb6('0xd'),_0x332f79);_0x47b207['next']();}else{var _0x1c8200=this;var _0x4efa2c=utils[_0xfdb6('0xe')](_0x22fe28[0x0],this);logger[_0xfdb6('0xc')](_0xfdb6('0xf'),_0x332f79,_0x4efa2c);sh[_0xfdb6('0x10')](_[_0xfdb6('0x11')](_0x4efa2c),function(_0x2ee8d1,_0x37bb03){logger[_0xfdb6('0xc')](_0xfdb6('0x12'),_0x332f79,_0x2ee8d1);if(_0x2ee8d1==0x0){var _0x552776=_0x37bb03[_0xfdb6('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xfdb6('0x14')](_0x22fe28[0x1])||_[_0xfdb6('0x15')](_0x22fe28[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x332f79);_0x1c8200[_0xfdb6('0x16')][_0x22fe28[0x1]]=_0x552776;}else{logger[_0xfdb6('0xc')](_0xfdb6('0x17'),_0x332f79,_0x22fe28[0x1],_0x552776);_0x1c8200['body'][_0x22fe28[0x1]]=_0x552776;}}_0x47b207[_0xfdb6('0x18')]();});}}catch(_0x32c1a2){logger[_0xfdb6('0x9')](_0xfdb6('0x19'),_0x332f79,_[_0xfdb6('0x1a')](_0x32c1a2)?JSON['stringify'](_0x32c1a2):_0x32c1a2);logger[_0xfdb6('0xc')](_0xfdb6('0xd'),_0x332f79);_0x47b207['next']();}};}; \ No newline at end of file +var _0x9946=['length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%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','shelljs','lodash','../../../../config/logger','routing'];(function(_0x39ec06,_0xa5e032){var _0x43c12f=function(_0x31fcfc){while(--_0x31fcfc){_0x39ec06['push'](_0x39ec06['shift']());}};_0x43c12f(++_0xa5e032);}(_0x9946,0x82));var _0x6994=function(_0xcfbb1d,_0x10f3b3){_0xcfbb1d=_0xcfbb1d-0x0;var _0x710ffd=_0x9946[_0xcfbb1d];return _0x710ffd;};'use strict';var schema=require(_0x6994('0x0'));var sh=require(_0x6994('0x1'));var _=require(_0x6994('0x2'));var utils=require('./utils');var logger=require(_0x6994('0x3'))(_0x6994('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x15c588,_0x235c10){return function(_0x5ef15e){try{var _0x403b5d={'command':_0x235c10[0x0]};var _0x25490a=system[_0x6994('0x0')](_0x403b5d,{'typecast':!![]});if(_0x25490a[_0x6994('0x5')]){logger[_0x6994('0x6')](_0x6994('0x7'),_0x15c588,_[_0x6994('0x8')](_0x25490a,_0x6994('0x9'))[_0x6994('0xa')](',\x20'));logger['info'](_0x6994('0xb'),_0x15c588);_0x5ef15e[_0x6994('0xc')]();}else{var _0x3d7b7a=this;var _0x41835f=utils[_0x6994('0xd')](_0x235c10[0x0],this);logger['info'](_0x6994('0xe'),_0x15c588,_0x41835f);sh[_0x6994('0xf')](_[_0x6994('0x10')](_0x41835f),function(_0x2ddc6f,_0x15d369){logger[_0x6994('0x11')](_0x6994('0x12'),_0x15c588,_0x2ddc6f);if(_0x2ddc6f==0x0){var _0x3c5d47=_0x15d369[_0x6994('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x6994('0x14')](_0x235c10[0x1])||_[_0x6994('0x15')](_0x235c10[0x1])){logger[_0x6994('0x11')](_0x6994('0x16'),_0x15c588);_0x3d7b7a[_0x6994('0x17')][_0x235c10[0x1]]=_0x3c5d47;}else{logger[_0x6994('0x11')](_0x6994('0x18'),_0x15c588,_0x235c10[0x1],_0x3c5d47);_0x3d7b7a[_0x6994('0x17')][_0x235c10[0x1]]=_0x3c5d47;}}_0x5ef15e[_0x6994('0xc')]();});}}catch(_0x26e13c){logger[_0x6994('0x6')]('[%s][SYSTEM]\x20%s',_0x15c588,_[_0x6994('0x19')](_0x26e13c)?JSON[_0x6994('0x1a')](_0x26e13c):_0x26e13c);logger['info'](_0x6994('0xb'),_0x15c588);_0x5ef15e['next']();}};}; \ 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 f4d954c..db4ede9 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 _0xe1b7=['consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x101237,_0x448f24){var _0x50ede4=function(_0x4d858d){while(--_0x4d858d){_0x101237['push'](_0x101237['shift']());}};_0x50ede4(++_0x448f24);}(_0xe1b7,0x16e));var _0x7e1b=function(_0x1c8780,_0x5d68b7){_0x1c8780=_0x1c8780-0x0;var _0x36cd11=_0xe1b7[_0x1c8780];return _0x36cd11;};'use strict';var schema=require(_0x7e1b('0x0'));var _=require(_0x7e1b('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7e1b('0x2')),'smsInteraction':require(_0x7e1b('0x3')),'mailInteraction':require(_0x7e1b('0x4')),'faxInteraction':require(_0x7e1b('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x7e1b('0x6'))(_0x7e1b('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7e1b('0x8')}});exports[_0x7e1b('0x9')]=function(_0x1ebdc7,_0x110a2c,_0x47346c,_0x49a017){return function(_0x5bcfa7){try{var _0x511cd2={'tag':_0x110a2c[0x0]};var _0x1dc34d=tag['validate'](_0x511cd2,{'typecast':!![]});if(_0x1dc34d['length']){logger[_0x7e1b('0xa')](_0x7e1b('0xb'),_0x1ebdc7,_[_0x7e1b('0xc')](_0x1dc34d,_0x7e1b('0xd'))[_0x7e1b('0xe')](',\x20'));logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0x1ebdc7);_0x5bcfa7[_0x7e1b('0x11')]();}else{var _0x19b37c={'ids':[_0x110a2c[0x0]]};if(rpc[_0x49a017[_0x7e1b('0x12')]+_0x7e1b('0x13')]){rpc[_0x49a017[_0x7e1b('0x12')]+'Interaction'][_0x7e1b('0x14')](_0x49a017[_0x7e1b('0x15')]['id'],_0x19b37c)['then'](function(_0x82e97b){logger[_0x7e1b('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x1ebdc7,_0x110a2c[0x1],_0x49a017['channel'],_0x49a017['interaction']['id']);})[_0x7e1b('0x16')](function(_0x1ddc2d){logger[_0x7e1b('0xa')](_0x7e1b('0xb'),_0x1ebdc7,JSON[_0x7e1b('0x17')](_0x1ddc2d));logger['info'](_0x7e1b('0x10'),_0x1ebdc7);})[_0x7e1b('0x18')](function(){_0x5bcfa7[_0x7e1b('0x11')]();});}}}catch(_0x390079){logger[_0x7e1b('0xa')](_0x7e1b('0xb'),_0x1ebdc7,_['isObject'](_0x390079)?JSON[_0x7e1b('0x17')](_0x390079):_0x390079);logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0x1ebdc7);_0x5bcfa7[_0x7e1b('0x11')]();}};}; \ No newline at end of file +var _0xdf21=['addTags','then','interaction','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction'];(function(_0x2eae43,_0x869d68){var _0x1b30b8=function(_0x2834c3){while(--_0x2834c3){_0x2eae43['push'](_0x2eae43['shift']());}};_0x1b30b8(++_0x869d68);}(_0xdf21,0xe7));var _0x1df2=function(_0x567df0,_0x4fa88e){_0x567df0=_0x567df0-0x0;var _0x77ec51=_0xdf21[_0x567df0];return _0x77ec51;};'use strict';var schema=require(_0x1df2('0x0'));var _=require(_0x1df2('0x1'));var rpc={'chatInteraction':require(_0x1df2('0x2')),'openchannelInteraction':require(_0x1df2('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x1df2('0x4')),'faxInteraction':require(_0x1df2('0x5')),'whatsappInteraction':require(_0x1df2('0x6'))};var logger=require(_0x1df2('0x7'))(_0x1df2('0x8'));var tag=schema({'tag':{'type':_0x1df2('0x9'),'required':!![],'message':_0x1df2('0xa')}});exports[_0x1df2('0xb')]=function(_0x3cbfeb,_0x6eac4d,_0x9a7e87,_0x104835){return function(_0x13967c){try{var _0x5782c6={'tag':_0x6eac4d[0x0]};var _0x12aab0=tag[_0x1df2('0x0')](_0x5782c6,{'typecast':!![]});if(_0x12aab0['length']){logger[_0x1df2('0xc')](_0x1df2('0xd'),_0x3cbfeb,_['map'](_0x12aab0,_0x1df2('0xe'))[_0x1df2('0xf')](',\x20'));logger[_0x1df2('0x10')](_0x1df2('0x11'),_0x3cbfeb);_0x13967c[_0x1df2('0x12')]();}else{var _0x2bdf13={'ids':[_0x6eac4d[0x0]]};if(rpc[_0x104835[_0x1df2('0x13')]+_0x1df2('0x14')]){rpc[_0x104835[_0x1df2('0x13')]+_0x1df2('0x14')][_0x1df2('0x15')](_0x104835['interaction']['id'],_0x2bdf13)[_0x1df2('0x16')](function(_0x3b3c27){logger[_0x1df2('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3cbfeb,_0x6eac4d[0x1],_0x104835[_0x1df2('0x13')],_0x104835[_0x1df2('0x17')]['id']);})[_0x1df2('0x18')](function(_0x2726ce){logger['error'](_0x1df2('0xd'),_0x3cbfeb,JSON[_0x1df2('0x19')](_0x2726ce));logger[_0x1df2('0x10')](_0x1df2('0x11'),_0x3cbfeb);})[_0x1df2('0x1a')](function(){_0x13967c[_0x1df2('0x12')]();});}}}catch(_0x3c2b2b){logger[_0x1df2('0xc')](_0x1df2('0xd'),_0x3cbfeb,_[_0x1df2('0x1b')](_0x3c2b2b)?JSON['stringify'](_0x3c2b2b):_0x3c2b2b);logger[_0x1df2('0x10')](_0x1df2('0x11'),_0x3cbfeb);_0x13967c[_0x1df2('0x12')]();}};}; \ 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 1bc8afd..7a7c3fc 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 _0xd960=['lodash','consequence','replace','\x20-\x20','includes','push','?params=','urlOnRing','title','jsonrpc','2.0','params','stringify','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing'];(function(_0xe78ca0,_0x29ffef){var _0x587e2a=function(_0x45f7e4){while(--_0x45f7e4){_0xe78ca0['push'](_0xe78ca0['shift']());}};_0x587e2a(++_0x29ffef);}(_0xd960,0xf9));var _0x0d96=function(_0x4d4600,_0x4f4780){_0x4d4600=_0x4d4600-0x0;var _0x193d8d=_0xd960[_0x4d4600];return _0x193d8d;};'use strict';var rp=require(_0x0d96('0x0'));var logger=require(_0x0d96('0x1'))(_0x0d96('0x2'));var _=require(_0x0d96('0x3'));var arr=[];exports[_0x0d96('0x4')]=function(_0x2d1962,_0x45e98c){return function(_0x1ad507){var _0x287bb6=_0x45e98c[0xa];var _0x566173=_0x45e98c[0xb];var _0x3b5eb1=_0x45e98c[0xc];var _0x49a28e=_0x45e98c[0xd];var _0x480f08=_0x45e98c[0xe];var _0x187f2d=_0x45e98c[0xf][_0x0d96('0x5')](/\n/g,_0x0d96('0x6'));var _0x3bdfcf=_0x45e98c[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x0d96('0x7')](_0x566173)){arr[_0x0d96('0x8')](_0x566173);var _0x49ca39=_0x45e98c[0x3];var _0x42ffb8=_0x45e98c[0x4];var _0x529148=_0x45e98c[0x1];var _0x1e26a5=_0x45e98c[0x0];var _0x10b191={};_0x10b191['urlOnAnswer']=_0x45e98c[0x8]+_0x0d96('0x9')+_0x3b5eb1+'|'+_0x287bb6+'|'+_0x49a28e+'|'+_0x566173+'|'+_0x480f08;_0x10b191[_0x0d96('0xa')]=_0x45e98c[0x7]+_0x0d96('0x9')+_0x3b5eb1+'|'+_0x287bb6+'|'+_0x49a28e+'|'+_0x566173+'|'+_0x480f08+'|'+_0x187f2d+'|'+_0x3bdfcf;_0x10b191[_0x0d96('0xb')]=_0x45e98c[0x9];var _0x276200={};_0x276200[_0x0d96('0xc')]=_0x0d96('0xd');_0x276200['method']='login';var _0x461c9d=[];_0x461c9d[_0x0d96('0x8')](_0x45e98c[0x2]);_0x461c9d[_0x0d96('0x8')](_0x45e98c[0x5]);_0x461c9d[_0x0d96('0x8')](_0x45e98c[0x6]);_0x276200[_0x0d96('0xe')]=_0x461c9d;_0x276200['id']=0x1;var _0x3275c1=JSON[_0x0d96('0xf')](_0x276200);var _0x4ccc4c={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x49ca39,'headers':{'Content-Type':_0x0d96('0x10')},'body':_0x3275c1};return rp(_0x4ccc4c)['then'](function(_0x176747){const _0x5cc8b5=JSON[_0x0d96('0x11')](_0x176747);if(!_0x5cc8b5[_0x0d96('0x12')][_0x0d96('0x13')]){throw new Error(_0x0d96('0x14'));}var _0x302705=_0x566173;var _0x1fcd87='channelId='+_0x529148+'&serviceId='+_0x1e26a5+'&sessionId='+_0x302705+_0x0d96('0x15')+JSON['stringify'](_0x10b191);var _0x53c797=_0x42ffb8+'?'+_0x1fcd87;return rp(_0x53c797);})[_0x0d96('0x16')](function(_0x51efa3){logger[_0x0d96('0x17')](_0x0d96('0x18'),_0x2d1962,_0x51efa3);_0x1ad507[_0x0d96('0x19')]();})[_0x0d96('0x1a')](function(_0x54bc03){logger['error']('[%s][TVOX]\x20%s',_0x2d1962,_['isObject'](_0x54bc03)?JSON[_0x0d96('0xf')](_0x54bc03):_0x54bc03);_0x1ad507[_0x0d96('0x19')]();});}else{logger[_0x0d96('0x17')](_0x0d96('0x1b'),_0x2d1962);_0x1ad507['next']();}};}; \ No newline at end of file +var _0x377b=['then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','?params=','urlOnRing','2.0','push','params','stringify','application/json-rpc'];(function(_0x314880,_0x111ba3){var _0x2bdf10=function(_0x526039){while(--_0x526039){_0x314880['push'](_0x314880['shift']());}};_0x2bdf10(++_0x111ba3);}(_0x377b,0x166));var _0xb377=function(_0x55399f,_0x254f63){_0x55399f=_0x55399f-0x0;var _0x1ad021=_0x377b[_0x55399f];return _0x1ad021;};'use strict';var rp=require(_0xb377('0x0'));var logger=require('../../../../config/logger')(_0xb377('0x1'));var _=require(_0xb377('0x2'));var arr=[];exports[_0xb377('0x3')]=function(_0x1976f6,_0x374323){return function(_0x45597c){var _0x25a6ad=_0x374323[0xa];var _0xda8cd8=_0x374323[0xb];var _0x21503f=_0x374323[0xc];var _0x396363=_0x374323[0xd];var _0x43c4be=_0x374323[0xe];var _0x5c0127=_0x374323[0xf][_0xb377('0x4')](/\n/g,_0xb377('0x5'));var _0x36b1a1=_0x374323[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xb377('0x6')](_0xda8cd8)){arr['push'](_0xda8cd8);var _0x55c89d=_0x374323[0x3];var _0x52f1a2=_0x374323[0x4];var _0x50477e=_0x374323[0x1];var _0x148286=_0x374323[0x0];var _0x4f207f={};_0x4f207f['urlOnAnswer']=_0x374323[0x8]+_0xb377('0x7')+_0x21503f+'|'+_0x25a6ad+'|'+_0x396363+'|'+_0xda8cd8+'|'+_0x43c4be;_0x4f207f[_0xb377('0x8')]=_0x374323[0x7]+_0xb377('0x7')+_0x21503f+'|'+_0x25a6ad+'|'+_0x396363+'|'+_0xda8cd8+'|'+_0x43c4be+'|'+_0x5c0127+'|'+_0x36b1a1;_0x4f207f['title']=_0x374323[0x9];var _0x5b3de4={};_0x5b3de4['jsonrpc']=_0xb377('0x9');_0x5b3de4['method']='login';var _0x171247=[];_0x171247[_0xb377('0xa')](_0x374323[0x2]);_0x171247[_0xb377('0xa')](_0x374323[0x5]);_0x171247['push'](_0x374323[0x6]);_0x5b3de4[_0xb377('0xb')]=_0x171247;_0x5b3de4['id']=0x1;var _0x181e39=JSON[_0xb377('0xc')](_0x5b3de4);var _0x932973={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x55c89d,'headers':{'Content-Type':_0xb377('0xd')},'body':_0x181e39};return rp(_0x932973)[_0xb377('0xe')](function(_0x531ab2){const _0x7fdbd1=JSON[_0xb377('0xf')](_0x531ab2);if(!_0x7fdbd1[_0xb377('0x10')][_0xb377('0x11')]){throw new Error(_0xb377('0x12'));}var _0x4e4436=_0xda8cd8;var _0x55c855=_0xb377('0x13')+_0x50477e+_0xb377('0x14')+_0x148286+'&sessionId='+_0x4e4436+_0xb377('0x15')+JSON[_0xb377('0xc')](_0x4f207f);var _0x5cd141=_0x52f1a2+'?'+_0x55c855;return rp(_0x5cd141);})[_0xb377('0xe')](function(_0x352029){logger[_0xb377('0x16')](_0xb377('0x17'),_0x1976f6,_0x352029);_0x45597c[_0xb377('0x18')]();})[_0xb377('0x19')](function(_0xdea370){logger[_0xb377('0x1a')](_0xb377('0x1b'),_0x1976f6,_[_0xb377('0x1c')](_0xdea370)?JSON['stringify'](_0xdea370):_0xdea370);_0x45597c[_0xb377('0x18')]();});}else{logger[_0xb377('0x16')](_0xb377('0x1d'),_0x1976f6);_0x45597c[_0xb377('0x1e')]();}};}; \ 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 ba7ea26..87d7411 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x53abee,_0x116a5f){var _0x48c3b9=function(_0xf88951){while(--_0xf88951){_0x53abee['push'](_0x53abee['shift']());}};_0x48c3b9(++_0x116a5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x1aa05c,_0x3bf78c){var _0x59308a=function(_0x111bf5){while(--_0x111bf5){_0x1aa05c['push'](_0x1aa05c['shift']());}};_0x59308a(++_0x3bf78c);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 dcec347..911d3e1 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 _0xb921=['condition','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','stringify','emit','complete','agent','agents','busy','channel','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','waiting','mailQueues','available','loggedIn','name','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../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','Intervals','map','interval','listen','message','interaction','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xb921,0x16a));var _0x1b92=function(_0x12f4d8,_0x1f6d82){_0x12f4d8=_0x12f4d8-0x0;var _0x265413=_0xb921[_0x12f4d8];return _0x265413;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var path=require(_0x1b92('0x2'));var fs=require('fs');var jayson=require(_0x1b92('0x3'));var BPromise=require(_0x1b92('0x4'));var uuid=require('uuid');var utils=require('./applications/utils');var config=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var rpc={'openchannelQueueReport':require(_0x1b92('0x8')),'mailQueueReport':require(_0x1b92('0x9')),'chatQueueReport':require(_0x1b92('0xa')),'smsQueueReport':require(_0x1b92('0xb')),'faxQueueReport':require(_0x1b92('0xc')),'whatsappQueueReport':require(_0x1b92('0xd'))};var RuleEngine=require(_0x1b92('0xe'));function getId(_0x1545f9,_0x64a3ed,_0x2cf050){return util[_0x1b92('0xf')](_0x1b92('0x10'),_0x1545f9,_0x64a3ed||0x0,_0x2cf050||0x0);}function getIntervals(_0x4c8e30,_0x31e314){var _0x1e5802=[];if(!_[_0x1b92('0x11')](_0x31e314[_0x1b92('0x12')])&&!_[_0x1b92('0x11')](_0x4c8e30[_0x31e314[_0x1b92('0x12')]])&&!_[_0x1b92('0x11')](_0x4c8e30[_0x31e314['IntervalId']][_0x1b92('0x13')])){_0x1e5802=_[_0x1b92('0x14')](_0x4c8e30[_0x31e314['IntervalId']][_0x1b92('0x13')],_0x1b92('0x15'));}else if(!_[_0x1b92('0x11')](_0x31e314[_0x1b92('0x15')])){_0x1e5802=[_0x31e314[_0x1b92('0x15')]];}return _0x1e5802;}exports[_0x1b92('0x16')]=function(_0x1d33bf){_0x1d33bf['rules']={};return new BPromise(function(_0x428396,_0x5c5c89){var _0x1a559b={'Start':function(_0x511a97){var _0x694d4f=this;return new Promise(function(_0x523285,_0x1eee75){if(_0x511a97){try{var _0x19b218=[];var _0x688aef=getId(_0x511a97['channel'],_0x511a97[_0x1b92('0x17')]?_0x511a97[_0x1b92('0x17')]['id']:0x0,_0x511a97[_0x1b92('0x18')]?_0x511a97[_0x1b92('0x18')]['id']:0x0);if(_0x511a97[_0x1b92('0x19')]&&_['isArray'](_0x511a97[_0x1b92('0x19')])&&_0x511a97[_0x1b92('0x19')][_0x1b92('0x1a')]){for(var _0x581d8a=0x0;_0x581d8a<_0x511a97[_0x1b92('0x19')][_0x1b92('0x1a')];_0x581d8a+=0x1){var _0x2cdc01=_0x511a97['applications'][_0x581d8a];if(fs[_0x1b92('0x1b')](path['join'](__dirname,_0x1b92('0x19'),_0x2cdc01[_0x1b92('0x1c')]+'.js'))){var _0x4ea25f=[];switch(_0x2cdc01[_0x1b92('0x1c')][_0x1b92('0x1d')]()){case _0x1b92('0x1e'):var _0x2badce=_0x2cdc01[_0x1b92('0x1f')][_0x1b92('0x20')](',');if(_0x511a97['channel']===_0x1b92('0x21')){_0x4ea25f[_0x1b92('0x22')](_0x2badce[0x0]);_0x4ea25f[_0x1b92('0x22')](_0x2badce[0x1]);_0x4ea25f[_0x1b92('0x22')](_0x2badce['slice'](0x2,_0x2badce[_0x1b92('0x1a')])['join'](','));}else{_0x4ea25f[_0x1b92('0x22')](_0x2badce[0x0]);_0x4ea25f[_0x1b92('0x22')](_0x2badce[_0x1b92('0x23')](0x1,_0x2badce[_0x1b92('0x1a')])[_0x1b92('0x24')](','));}break;case _0x1b92('0x25'):var _0xa56a28=_0x2cdc01[_0x1b92('0x1f')]['split'](',');_0x4ea25f['push'](_0xa56a28[0x0]);_0x4ea25f['push'](_0xa56a28[0x1]);_0x4ea25f[_0x1b92('0x22')](_0xa56a28['slice'](0x2,_0xa56a28[_0x1b92('0x1a')])['join'](','));break;case _0x1b92('0x26'):var _0x4656aa=_0x2cdc01[_0x1b92('0x1f')]['split'](',');_0x4ea25f[_0x1b92('0x22')](_0x4656aa[0x0]);_0x4ea25f[_0x1b92('0x22')](_0x4656aa[0x1]);_0x4ea25f['push'](_0x4656aa[0x2]);_0x4ea25f['push'](_0x4656aa[0x3]);_0x4ea25f[_0x1b92('0x22')](_0x4656aa[_0x1b92('0x23')](0x4,_0x4656aa[_0x1b92('0x1a')])[_0x1b92('0x24')](','));break;case _0x1b92('0x27'):var _0x50eddf=_0x2cdc01[_0x1b92('0x1f')][_0x1b92('0x20')](',');_0x4ea25f[_0x1b92('0x22')](_0x50eddf[0x0]);_0x4ea25f[_0x1b92('0x22')](_0x50eddf[0x1]);_0x4ea25f[_0x1b92('0x22')](_0x50eddf[0x2]);_0x4ea25f[_0x1b92('0x22')](_0x50eddf[0x3]);_0x4ea25f[_0x1b92('0x22')](_0x50eddf['slice'](0x4,_0x50eddf[_0x1b92('0x1a')])[_0x1b92('0x24')](','));break;case'message':_0x4ea25f[_0x1b92('0x22')](_0x2cdc01[_0x1b92('0x1f')]);break;case _0x1b92('0x28'):_0x4ea25f['push'](_0x2cdc01[_0x1b92('0x29')]);_0x4ea25f[_0x1b92('0x22')](_0x2cdc01['appdata']);break;case'tvox':var _0x280bc3=utils[_0x1b92('0x2a')](_0x511a97[_0x1b92('0x2b')][_0x1b92('0x2c')],_0x511a97);var _0x5d1ed8=_0x2cdc01['appdata']['split'](',');_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x0]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x1]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x2]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x3]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x4]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x5]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x6]);_0x4ea25f['push'](_0x5d1ed8[0x7]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x8]);_0x4ea25f[_0x1b92('0x22')](_0x5d1ed8[0x9]);_0x4ea25f['push'](_0x5d1ed8[0xa]);_0x4ea25f[_0x1b92('0x22')](_0x511a97[_0x1b92('0x18')]['id']);_0x4ea25f[_0x1b92('0x22')](_0x511a97[_0x1b92('0x17')]['id']);_0x4ea25f[_0x1b92('0x22')](_0x2cdc01[_0x1b92('0x2d')]);_0x4ea25f[_0x1b92('0x22')](_0x511a97[_0x1b92('0x18')][_0x1b92('0x2e')]);_0x4ea25f[_0x1b92('0x22')](_0x511a97['body'][_0x1b92('0x2f')]);_0x4ea25f['push'](_0x280bc3);break;default:_0x4ea25f=_[_0x1b92('0x11')](_0x2cdc01['appdata'])?[]:_0x2cdc01[_0x1b92('0x1f')][_0x1b92('0x20')](',');}var _0x25e709={'id':util[_0x1b92('0xf')](_0x1b92('0x30'),_0x688aef,_0x2cdc01['id'],_0x2cdc01[_0x1b92('0x1c')]),'condition':require(_0x1b92('0x31'))[_0x1b92('0x32')](_0x688aef,getIntervals(_0x1d33bf[_0x1b92('0x33')],_0x2cdc01),_0x1d33bf),'consequence':require('./applications/'+_0x2cdc01[_0x1b92('0x1c')])['consequence'](_0x688aef,_0x4ea25f,_0x1d33bf,_0x511a97),'p':_0x2cdc01[_0x1b92('0x34')]||0x0};logger[_0x1b92('0x35')](_0x1b92('0x36'),_0x25e709['id'],_0x1b92('0x37'),getIntervals(_0x1d33bf['intervals'],_0x2cdc01)[_0x1b92('0x24')](_0x1b92('0x38')));_0x19b218[_0x1b92('0x22')](_0x25e709);}else{logger[_0x1b92('0x39')](_0x1b92('0x3a'),path[_0x1b92('0x24')](__dirname,'applications',_0x2cdc01[_0x1b92('0x1c')]+_0x1b92('0x3b')));}}_0x1d33bf[_0x1b92('0x3c')][_0x688aef]=new RuleEngine(_0x19b218);_0x1d33bf[_0x1b92('0x3c')][_0x688aef][_0x1b92('0x3d')](_0x511a97,function(_0x2bb12f){logger['info'](_0x1b92('0x3e'),JSON[_0x1b92('0x3f')](_0x2bb12f['matchPath']));if(_0x1d33bf[_0x1b92('0x3c')][_0x688aef]){_0x1d33bf['rules'][_0x688aef][_0x1b92('0x40')](_0x1b92('0x41'));}});return _0x523285({'code':0xc8,'message':_0x511a97});}else{logger[_0x1b92('0x35')]('No\x20applications\x20to\x20execute');return _0x523285({'code':0xc8,'message':_0x511a97});}}catch(_0x31b436){logger[_0x1b92('0x39')](_0x31b436['stack']);return _0x1eee75(_0x694d4f['error'](0x1f4,_0x31b436));}}return _0x1eee75('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2e325c){var _0x401c67=this;return new Promise(function(_0x1b5255,_0x1d04ed){if(_0x2e325c[_0x1b92('0x42')]&&_0x2e325c[_0x1b92('0x42')]['id']){if(_0x1d33bf['agents'][_0x2e325c[_0x1b92('0x42')]['id']]){_0x1d33bf[_0x1b92('0x43')][_0x2e325c['agent']['id']][_0x1b92('0x44')]=![];_0x1d33bf[_0x1b92('0x43')][_0x2e325c[_0x1b92('0x42')]['id']]['busyQueue']=undefined;}}if(_0x2e325c[_0x1b92('0x17')]&&_0x2e325c[_0x1b92('0x17')]['id']){try{var _0x38df65=getId(_0x2e325c[_0x1b92('0x45')],_0x2e325c[_0x1b92('0x17')]?_0x2e325c['message']['id']:0x0,_0x2e325c[_0x1b92('0x18')]?_0x2e325c[_0x1b92('0x18')]['id']:0x0);if(_0x1d33bf[_0x1b92('0x3c')][_0x38df65]){_0x1d33bf[_0x1b92('0x3c')][_0x38df65][_0x1b92('0x40')]('end');if(rpc[_0x2e325c['channel']+_0x1b92('0x46')]){rpc[_0x2e325c[_0x1b92('0x45')]+_0x1b92('0x46')][_0x1b92('0x47')](_0x38df65,{'UserId':_0x2e325c['message'][_0x1b92('0x48')]})[_0x1b92('0x49')](function(_0x5e10fa){logger[_0x1b92('0x39')](_0x1b92('0x4a'));});}}return _0x1b5255({'code':0xc8,'message':_0x2e325c});}catch(_0x10fd17){logger['error'](_0x10fd17[_0x1b92('0x4b')]);return _0x1d04ed(_0x401c67[_0x1b92('0x39')](0x1f4,_0x10fd17));}}logger[_0x1b92('0x39')](_0x1b92('0x4c'));return _0x1d04ed(_0x401c67[_0x1b92('0x39')](0x1f4,_0x1b92('0x4c')));});},'RejectMessage':function(_0x5de86e){var _0x235234=this;return new Promise(function(_0x4baa1a,_0x140202){if(_0x5de86e['agent']&&_0x5de86e[_0x1b92('0x42')]['id']){try{if(_0x1d33bf[_0x1b92('0x43')][_0x5de86e[_0x1b92('0x42')]['id']]){_0x1d33bf[_0x1b92('0x43')][_0x5de86e[_0x1b92('0x42')]['id']][_0x1b92('0x44')]=![];_0x1d33bf[_0x1b92('0x43')][_0x5de86e[_0x1b92('0x42')]['id']][_0x1b92('0x4d')]=undefined;}return _0x4baa1a({'code':0xc8,'message':_0x5de86e});}catch(_0x23e03a){logger[_0x1b92('0x39')](_0x23e03a[_0x1b92('0x4b')]);return _0x140202(_0x235234[_0x1b92('0x39')](0x1f4,_0x23e03a));}}logger[_0x1b92('0x39')](_0x1b92('0x4c'));return _0x140202(_0x235234[_0x1b92('0x39')](0x1f4,_0x1b92('0x4c')));});},'AbandonInteraction':function(_0x29005a){var _0x965e5c=this;return new Promise(function(_0x1e2e77,_0x5d4a1a){if(_0x29005a[_0x1b92('0x45')]&&_0x29005a[_0x1b92('0x18')]&&_0x29005a['interaction']['id']){try{var _0x41a80f=getId(_0x29005a[_0x1b92('0x45')],_0x29005a['message']?_0x29005a['message']['id']:0x0,_0x29005a[_0x1b92('0x18')]?_0x29005a[_0x1b92('0x18')]['id']:0x0);if(_0x1d33bf['rules'][_0x41a80f]){_0x1d33bf[_0x1b92('0x3c')][_0x41a80f][_0x1b92('0x40')](_0x1b92('0x4e'));}return _0x1e2e77({'code':0xc8,'message':_0x29005a});}catch(_0x33069d){logger[_0x1b92('0x39')](_0x33069d[_0x1b92('0x4b')]);return _0x5d4a1a(_0x965e5c['error'](0x1f4,_0x33069d));}}logger[_0x1b92('0x39')]('message\x20is\x20empty');return _0x5d4a1a(_0x965e5c['error'](0x1f4,_0x1b92('0x4c')));});},'AgentCapacity':function(_0x15a756){var _0x98fb95=this;return new Promise(function(_0x432762,_0x10b2b0){if(_0x1d33bf[_0x1b92('0x43')][_0x1b92('0x4f')](_0x15a756['id'])){for(var _0x27f388 in _0x15a756[_0x1b92('0x50')]){if(_0x15a756[_0x1b92('0x50')]['hasOwnProperty'](_0x27f388)){if(_0x1d33bf[_0x1b92('0x43')][_0x15a756['id']][_0x1b92('0x4f')](_0x27f388+_0x1b92('0x51'))){_0x1d33bf['agents'][_0x15a756['id']][_0x27f388+'CurrentCapacity']=parseInt(_0x15a756[_0x1b92('0x50')][_0x27f388],0xa);}}}_0x1d33bf[_0x1b92('0x43')][_0x15a756['id']][_0x1b92('0x52')]();return _0x432762({'code':0xc8,'message':_0x1d33bf[_0x1b92('0x43')][_0x15a756['id']]});}else{return _0x10b2b0(_0x98fb95[_0x1b92('0x39')](0x1f4,_0x1b92('0x53')));}});},'Agents':function(_0x3c4ed4){return new Promise(function(_0x6f27ed,_0x63c79a){var _0x406dd4=_[_0x1b92('0x54')](_0x1d33bf[_0x1b92('0x43')]);_0x6f27ed({'count':_0x406dd4['length'],'rows':_0x406dd4});});},'ChatQueues':function(_0x273b75){return new Promise(function(_0xfecd33,_0x554086){var _0x23eb77=[];for(var _0x46d1e9 in _0x1d33bf['chatQueues']){if(_0x1d33bf[_0x1b92('0x55')][_0x1b92('0x4f')](_0x46d1e9)){var _0x1d3d74=_0x1d33bf[_0x1b92('0x55')][_0x46d1e9];var _0x2540d2={'id':_0x1d3d74['id'],'available':_0x1d3d74['available'],'loggedIn':_0x1d3d74['loggedIn'],'name':_0x1d3d74['name'],'paused':_0x1d3d74['paused'],'waiting':_0x1d3d74[_0x1b92('0x56')]};_0x23eb77[_0x1b92('0x22')](_0x2540d2);}}_0xfecd33({'count':_0x23eb77[_0x1b92('0x1a')],'rows':_0x23eb77});});},'MailQueues':function(_0x2e4330){return new Promise(function(_0x5e1c1d,_0x290959){var _0xb330f=[];for(var _0x513830 in _0x1d33bf[_0x1b92('0x57')]){if(_0x1d33bf['mailQueues']['hasOwnProperty'](_0x513830)){var _0x1684e3=_0x1d33bf['mailQueues'][_0x513830];var _0x1b106d={'id':_0x1684e3['id'],'available':_0x1684e3[_0x1b92('0x58')],'loggedIn':_0x1684e3[_0x1b92('0x59')],'name':_0x1684e3[_0x1b92('0x5a')],'paused':_0x1684e3[_0x1b92('0x5b')],'waiting':_0x1684e3[_0x1b92('0x56')]};_0xb330f['push'](_0x1b106d);}}_0x5e1c1d({'count':_0xb330f[_0x1b92('0x1a')],'rows':_0xb330f});});},'OpenchannelQueues':function(_0x1bab85){return new Promise(function(_0xc0a853,_0x1df855){var _0x1fefaf=[];for(var _0x55b5b2 in _0x1d33bf['openchannelQueues']){if(_0x1d33bf[_0x1b92('0x5c')][_0x1b92('0x4f')](_0x55b5b2)){var _0x39ad41=_0x1d33bf[_0x1b92('0x5c')][_0x55b5b2];var _0x5f3a04={'id':_0x39ad41['id'],'available':_0x39ad41[_0x1b92('0x58')],'loggedIn':_0x39ad41[_0x1b92('0x59')],'name':_0x39ad41[_0x1b92('0x5a')],'paused':_0x39ad41[_0x1b92('0x5b')],'waiting':_0x39ad41['waiting']};_0x1fefaf[_0x1b92('0x22')](_0x5f3a04);}}_0xc0a853({'count':_0x1fefaf[_0x1b92('0x1a')],'rows':_0x1fefaf});});},'SmsQueues':function(_0x15ba0b){return new Promise(function(_0x40f610,_0xfb4a7f){var _0x28de7f=[];for(var _0x15b6b1 in _0x1d33bf['smsQueues']){if(_0x1d33bf[_0x1b92('0x5d')]['hasOwnProperty'](_0x15b6b1)){var _0x59eedf=_0x1d33bf[_0x1b92('0x5d')][_0x15b6b1];var _0x1d5ad6={'id':_0x59eedf['id'],'available':_0x59eedf[_0x1b92('0x58')],'loggedIn':_0x59eedf[_0x1b92('0x59')],'name':_0x59eedf['name'],'paused':_0x59eedf['paused'],'waiting':_0x59eedf[_0x1b92('0x56')]};_0x28de7f[_0x1b92('0x22')](_0x1d5ad6);}}_0x40f610({'count':_0x28de7f['length'],'rows':_0x28de7f});});},'FaxQueues':function(_0x31faab){return new Promise(function(_0x501c8e,_0x67b087){var _0x226fa2=[];for(var _0x36f758 in _0x1d33bf[_0x1b92('0x5e')]){if(_0x1d33bf['faxQueues'][_0x1b92('0x4f')](_0x36f758)){var _0x447b4f=_0x1d33bf[_0x1b92('0x5e')][_0x36f758];var _0x16280d={'id':_0x447b4f['id'],'available':_0x447b4f[_0x1b92('0x58')],'loggedIn':_0x447b4f['loggedIn'],'name':_0x447b4f[_0x1b92('0x5a')],'paused':_0x447b4f[_0x1b92('0x5b')],'waiting':_0x447b4f[_0x1b92('0x56')]};_0x226fa2[_0x1b92('0x22')](_0x16280d);}}_0x501c8e({'count':_0x226fa2['length'],'rows':_0x226fa2});});},'WhatsappQueues':function(_0x2b5e2d){return new Promise(function(_0x2934fd,_0x530b4d){var _0x32a237=[];for(var _0x2b19dc in _0x1d33bf[_0x1b92('0x5f')]){if(_0x1d33bf[_0x1b92('0x5f')][_0x1b92('0x4f')](_0x2b19dc)){var _0x300065=_0x1d33bf['whatsappQueues'][_0x2b19dc];var _0x9bf9af={'id':_0x300065['id'],'available':_0x300065[_0x1b92('0x58')],'loggedIn':_0x300065[_0x1b92('0x59')],'name':_0x300065[_0x1b92('0x5a')],'paused':_0x300065[_0x1b92('0x5b')],'waiting':_0x300065[_0x1b92('0x56')]};_0x32a237[_0x1b92('0x22')](_0x9bf9af);}}_0x2934fd({'count':_0x32a237['length'],'rows':_0x32a237});});},'ChatQueuesWaitingInteractions':function(_0x445241){return new Promise(function(_0x19a439,_0x31853d){var _0x58bd8e=_[_0x1b92('0x54')](_0x1d33bf[_0x1b92('0x60')]);_0x19a439({'count':_0x58bd8e[_0x1b92('0x1a')],'rows':_0x58bd8e});});},'MailQueuesWaitingInteractions':function(_0x142263){return new Promise(function(_0x151b68,_0x223ff1){var _0x685d82=_[_0x1b92('0x54')](_0x1d33bf['mailQueuesWaitingInteractions']);_0x151b68({'count':_0x685d82[_0x1b92('0x1a')],'rows':_0x685d82});});},'OpenchannelQueuesWaitingInteractions':function(_0x558978){return new Promise(function(_0x22b84e,_0xb0d3a){var _0x418560=_[_0x1b92('0x54')](_0x1d33bf[_0x1b92('0x61')]);_0x22b84e({'count':_0x418560['length'],'rows':_0x418560});});},'SmsQueuesWaitingInteractions':function(_0x1b74f3){return new Promise(function(_0x39b518,_0x106c5e){var _0x3974a8=_[_0x1b92('0x54')](_0x1d33bf[_0x1b92('0x62')]);_0x39b518({'count':_0x3974a8[_0x1b92('0x1a')],'rows':_0x3974a8});});},'FaxQueuesWaitingInteractions':function(_0x1b42c4){return new Promise(function(_0x29e462,_0x2330f8){var _0x554502=_[_0x1b92('0x54')](_0x1d33bf[_0x1b92('0x63')]);_0x29e462({'count':_0x554502[_0x1b92('0x1a')],'rows':_0x554502});});},'WhatsappQueuesWaitingInteractions':function(_0x4d4218){return new Promise(function(_0x3eabe1,_0x2dc287){var _0x4d5385=_[_0x1b92('0x54')](_0x1d33bf['whatsappQueuesWaitingInteractions']);_0x3eabe1({'count':_0x4d5385[_0x1b92('0x1a')],'rows':_0x4d5385});});}};var _0x508806=jayson['server'](_0x1a559b)['http']();_0x508806['on'](_0x1b92('0x39'),function(_0x3e3b36){logger[_0x1b92('0x39')](JSON[_0x1b92('0x3f')](_0x3e3b36));return _0x5c5c89(_0x3e3b36);});_0x508806[_0x1b92('0x16')](0x232c,'127.0.0.1',function(){console[_0x1b92('0x64')](_0x1b92('0x65'),0x232c);return _0x428396(_0x1b92('0x66')+0x232c);});});}; \ No newline at end of file +var _0xb32d=['TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','message\x20is\x20empty','busy','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','name','paused','waiting','mailQueues','available','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','split','channel','mail','push','slice','dialogflow','appdata','amazonlex','tag'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb32d,0x1da));var _0xdb32=function(_0x51e77b,_0x4d4926){_0x51e77b=_0x51e77b-0x0;var _0x1dfcf9=_0xb32d[_0x51e77b];return _0x1dfcf9;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var path=require(_0xdb32('0x2'));var fs=require('fs');var jayson=require(_0xdb32('0x3'));var BPromise=require(_0xdb32('0x4'));var uuid=require('uuid');var utils=require('./applications/utils');var config=require(_0xdb32('0x5'));var logger=require(_0xdb32('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0xdb32('0x7')),'mailQueueReport':require(_0xdb32('0x8')),'chatQueueReport':require(_0xdb32('0x9')),'smsQueueReport':require(_0xdb32('0xa')),'faxQueueReport':require(_0xdb32('0xb')),'whatsappQueueReport':require(_0xdb32('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3b0995,_0x2686db,_0xbe779d){return util[_0xdb32('0xd')](_0xdb32('0xe'),_0x3b0995,_0x2686db||0x0,_0xbe779d||0x0);}function getIntervals(_0x5583ae,_0x112db6){var _0x3ddfc6=[];if(!_[_0xdb32('0xf')](_0x112db6[_0xdb32('0x10')])&&!_[_0xdb32('0xf')](_0x5583ae[_0x112db6[_0xdb32('0x10')]])&&!_[_0xdb32('0xf')](_0x5583ae[_0x112db6[_0xdb32('0x10')]][_0xdb32('0x11')])){_0x3ddfc6=_[_0xdb32('0x12')](_0x5583ae[_0x112db6[_0xdb32('0x10')]][_0xdb32('0x11')],_0xdb32('0x13'));}else if(!_[_0xdb32('0xf')](_0x112db6[_0xdb32('0x13')])){_0x3ddfc6=[_0x112db6['interval']];}return _0x3ddfc6;}exports[_0xdb32('0x14')]=function(_0x223890){_0x223890[_0xdb32('0x15')]={};return new BPromise(function(_0x2adea8,_0x2d3270){var _0x4b38ab={'Start':function(_0x540bc4){var _0x1c7b54=this;return new Promise(function(_0x3a4028,_0x4fc593){if(_0x540bc4){try{var _0x4fe088=[];var _0x59a5f8=getId(_0x540bc4['channel'],_0x540bc4[_0xdb32('0x16')]?_0x540bc4['message']['id']:0x0,_0x540bc4[_0xdb32('0x17')]?_0x540bc4[_0xdb32('0x17')]['id']:0x0);if(_0x540bc4[_0xdb32('0x18')]&&_[_0xdb32('0x19')](_0x540bc4['applications'])&&_0x540bc4['applications']['length']){for(var _0x26b43c=0x0;_0x26b43c<_0x540bc4['applications'][_0xdb32('0x1a')];_0x26b43c+=0x1){var _0x1d31ee=_0x540bc4[_0xdb32('0x18')][_0x26b43c];if(fs[_0xdb32('0x1b')](path[_0xdb32('0x1c')](__dirname,'applications',_0x1d31ee[_0xdb32('0x1d')]+_0xdb32('0x1e')))){var _0x2429ea=[];switch(_0x1d31ee['app']['toLowerCase']()){case _0xdb32('0x1f'):var _0x4e765c=_0x1d31ee['appdata'][_0xdb32('0x20')](',');if(_0x540bc4[_0xdb32('0x21')]===_0xdb32('0x22')){_0x2429ea[_0xdb32('0x23')](_0x4e765c[0x0]);_0x2429ea['push'](_0x4e765c[0x1]);_0x2429ea['push'](_0x4e765c[_0xdb32('0x24')](0x2,_0x4e765c[_0xdb32('0x1a')])[_0xdb32('0x1c')](','));}else{_0x2429ea['push'](_0x4e765c[0x0]);_0x2429ea[_0xdb32('0x23')](_0x4e765c['slice'](0x1,_0x4e765c[_0xdb32('0x1a')])[_0xdb32('0x1c')](','));}break;case _0xdb32('0x25'):var _0x2e1ada=_0x1d31ee[_0xdb32('0x26')]['split'](',');_0x2429ea['push'](_0x2e1ada[0x0]);_0x2429ea[_0xdb32('0x23')](_0x2e1ada[0x1]);_0x2429ea['push'](_0x2e1ada[_0xdb32('0x24')](0x2,_0x2e1ada[_0xdb32('0x1a')])[_0xdb32('0x1c')](','));break;case'dialogflowv2':var _0x5344ea=_0x1d31ee[_0xdb32('0x26')][_0xdb32('0x20')](',');_0x2429ea[_0xdb32('0x23')](_0x5344ea[0x0]);_0x2429ea['push'](_0x5344ea[0x1]);_0x2429ea[_0xdb32('0x23')](_0x5344ea[0x2]);_0x2429ea[_0xdb32('0x23')](_0x5344ea[0x3]);_0x2429ea[_0xdb32('0x23')](_0x5344ea[_0xdb32('0x24')](0x4,_0x5344ea[_0xdb32('0x1a')])[_0xdb32('0x1c')](','));break;case _0xdb32('0x27'):var _0x84ef42=_0x1d31ee[_0xdb32('0x26')]['split'](',');_0x2429ea['push'](_0x84ef42[0x0]);_0x2429ea[_0xdb32('0x23')](_0x84ef42[0x1]);_0x2429ea['push'](_0x84ef42[0x2]);_0x2429ea[_0xdb32('0x23')](_0x84ef42[0x3]);_0x2429ea[_0xdb32('0x23')](_0x84ef42[_0xdb32('0x24')](0x4,_0x84ef42['length'])[_0xdb32('0x1c')](','));break;case _0xdb32('0x16'):_0x2429ea['push'](_0x1d31ee[_0xdb32('0x26')]);break;case _0xdb32('0x28'):_0x2429ea['push'](_0x1d31ee[_0xdb32('0x29')]);_0x2429ea[_0xdb32('0x23')](_0x1d31ee[_0xdb32('0x26')]);break;case _0xdb32('0x2a'):var _0x3345d4=utils[_0xdb32('0x2b')](_0x540bc4[_0xdb32('0x2c')]['notificationTemplate'],_0x540bc4);var _0xcb0323=_0x1d31ee[_0xdb32('0x26')][_0xdb32('0x20')](',');_0x2429ea[_0xdb32('0x23')](_0xcb0323[0x0]);_0x2429ea['push'](_0xcb0323[0x1]);_0x2429ea['push'](_0xcb0323[0x2]);_0x2429ea['push'](_0xcb0323[0x3]);_0x2429ea[_0xdb32('0x23')](_0xcb0323[0x4]);_0x2429ea['push'](_0xcb0323[0x5]);_0x2429ea['push'](_0xcb0323[0x6]);_0x2429ea[_0xdb32('0x23')](_0xcb0323[0x7]);_0x2429ea['push'](_0xcb0323[0x8]);_0x2429ea[_0xdb32('0x23')](_0xcb0323[0x9]);_0x2429ea[_0xdb32('0x23')](_0xcb0323[0xa]);_0x2429ea[_0xdb32('0x23')](_0x540bc4[_0xdb32('0x17')]['id']);_0x2429ea['push'](_0x540bc4[_0xdb32('0x16')]['id']);_0x2429ea[_0xdb32('0x23')](_0x1d31ee[_0xdb32('0x2d')]);_0x2429ea[_0xdb32('0x23')](_0x540bc4[_0xdb32('0x17')][_0xdb32('0x2e')]);_0x2429ea[_0xdb32('0x23')](_0x540bc4[_0xdb32('0x2f')][_0xdb32('0x2f')]);_0x2429ea['push'](_0x3345d4);break;default:_0x2429ea=_[_0xdb32('0xf')](_0x1d31ee['appdata'])?[]:_0x1d31ee[_0xdb32('0x26')][_0xdb32('0x20')](',');}var _0x7f8263={'id':util['format'](_0xdb32('0x30'),_0x59a5f8,_0x1d31ee['id'],_0x1d31ee[_0xdb32('0x1d')]),'condition':require(_0xdb32('0x31'))[_0xdb32('0x32')](_0x59a5f8,getIntervals(_0x223890[_0xdb32('0x33')],_0x1d31ee),_0x223890),'consequence':require(_0xdb32('0x34')+_0x1d31ee[_0xdb32('0x1d')])['consequence'](_0x59a5f8,_0x2429ea,_0x223890,_0x540bc4),'p':_0x1d31ee[_0xdb32('0x35')]||0x0};logger['info'](_0xdb32('0x36'),_0x7f8263['id'],_0xdb32('0x37'),getIntervals(_0x223890[_0xdb32('0x33')],_0x1d31ee)[_0xdb32('0x1c')](_0xdb32('0x38')));_0x4fe088[_0xdb32('0x23')](_0x7f8263);}else{logger['error'](_0xdb32('0x39'),path[_0xdb32('0x1c')](__dirname,_0xdb32('0x18'),_0x1d31ee['app']+'.js'));}}_0x223890[_0xdb32('0x15')][_0x59a5f8]=new RuleEngine(_0x4fe088);_0x223890['rules'][_0x59a5f8][_0xdb32('0x3a')](_0x540bc4,function(_0x3baf71){logger[_0xdb32('0x3b')](_0xdb32('0x3c'),JSON[_0xdb32('0x3d')](_0x3baf71['matchPath']));if(_0x223890[_0xdb32('0x15')][_0x59a5f8]){_0x223890['rules'][_0x59a5f8][_0xdb32('0x3e')](_0xdb32('0x3f'));}});return _0x3a4028({'code':0xc8,'message':_0x540bc4});}else{logger['info'](_0xdb32('0x40'));return _0x3a4028({'code':0xc8,'message':_0x540bc4});}}catch(_0x31b4d8){logger['error'](_0x31b4d8[_0xdb32('0x41')]);return _0x4fc593(_0x1c7b54[_0xdb32('0x42')](0x1f4,_0x31b4d8));}}return _0x4fc593(_0xdb32('0x43'));});},'AcceptMessage':function(_0x2f25ff){var _0x4835ad=this;return new Promise(function(_0x544a7b,_0x19bf98){if(_0x2f25ff[_0xdb32('0x44')]&&_0x2f25ff[_0xdb32('0x44')]['id']){if(_0x223890[_0xdb32('0x45')][_0x2f25ff[_0xdb32('0x44')]['id']]){_0x223890[_0xdb32('0x45')][_0x2f25ff['agent']['id']]['busy']=![];_0x223890[_0xdb32('0x45')][_0x2f25ff['agent']['id']][_0xdb32('0x46')]=undefined;}}if(_0x2f25ff['message']&&_0x2f25ff[_0xdb32('0x16')]['id']){try{var _0x284c9e=getId(_0x2f25ff[_0xdb32('0x21')],_0x2f25ff[_0xdb32('0x16')]?_0x2f25ff[_0xdb32('0x16')]['id']:0x0,_0x2f25ff[_0xdb32('0x17')]?_0x2f25ff['interaction']['id']:0x0);if(_0x223890[_0xdb32('0x15')][_0x284c9e]){_0x223890[_0xdb32('0x15')][_0x284c9e][_0xdb32('0x3e')]('end');if(rpc[_0x2f25ff[_0xdb32('0x21')]+'QueueReport']){rpc[_0x2f25ff[_0xdb32('0x21')]+_0xdb32('0x47')][_0xdb32('0x48')](_0x284c9e,{'UserId':_0x2f25ff[_0xdb32('0x16')][_0xdb32('0x49')]})[_0xdb32('0x4a')](function(_0x5aef11){logger[_0xdb32('0x42')]('error\x20update\x20queue\x20report');});}}return _0x544a7b({'code':0xc8,'message':_0x2f25ff});}catch(_0x5392a7){logger[_0xdb32('0x42')](_0x5392a7[_0xdb32('0x41')]);return _0x19bf98(_0x4835ad['error'](0x1f4,_0x5392a7));}}logger[_0xdb32('0x42')]('message\x20is\x20empty');return _0x19bf98(_0x4835ad[_0xdb32('0x42')](0x1f4,_0xdb32('0x4b')));});},'RejectMessage':function(_0x49ded9){var _0x54b306=this;return new Promise(function(_0x2ba2f8,_0x3de465){if(_0x49ded9[_0xdb32('0x44')]&&_0x49ded9[_0xdb32('0x44')]['id']){try{if(_0x223890[_0xdb32('0x45')][_0x49ded9['agent']['id']]){_0x223890[_0xdb32('0x45')][_0x49ded9[_0xdb32('0x44')]['id']][_0xdb32('0x4c')]=![];_0x223890['agents'][_0x49ded9[_0xdb32('0x44')]['id']][_0xdb32('0x46')]=undefined;}return _0x2ba2f8({'code':0xc8,'message':_0x49ded9});}catch(_0x11b7bd){logger[_0xdb32('0x42')](_0x11b7bd[_0xdb32('0x41')]);return _0x3de465(_0x54b306[_0xdb32('0x42')](0x1f4,_0x11b7bd));}}logger[_0xdb32('0x42')]('message\x20is\x20empty');return _0x3de465(_0x54b306[_0xdb32('0x42')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x496a3f){var _0x229b94=this;return new Promise(function(_0x325054,_0x20bf83){if(_0x496a3f[_0xdb32('0x21')]&&_0x496a3f[_0xdb32('0x17')]&&_0x496a3f[_0xdb32('0x17')]['id']){try{var _0x192903=getId(_0x496a3f[_0xdb32('0x21')],_0x496a3f[_0xdb32('0x16')]?_0x496a3f[_0xdb32('0x16')]['id']:0x0,_0x496a3f['interaction']?_0x496a3f[_0xdb32('0x17')]['id']:0x0);if(_0x223890[_0xdb32('0x15')][_0x192903]){_0x223890[_0xdb32('0x15')][_0x192903][_0xdb32('0x3e')](_0xdb32('0x4d'));}return _0x325054({'code':0xc8,'message':_0x496a3f});}catch(_0x39556d){logger[_0xdb32('0x42')](_0x39556d['stack']);return _0x20bf83(_0x229b94[_0xdb32('0x42')](0x1f4,_0x39556d));}}logger[_0xdb32('0x42')]('message\x20is\x20empty');return _0x20bf83(_0x229b94['error'](0x1f4,_0xdb32('0x4b')));});},'AgentCapacity':function(_0x42daea){var _0x3e64ca=this;return new Promise(function(_0x31350d,_0x40b0fc){if(_0x223890['agents'][_0xdb32('0x4e')](_0x42daea['id'])){for(var _0x4f5e57 in _0x42daea[_0xdb32('0x4f')]){if(_0x42daea['capacity']['hasOwnProperty'](_0x4f5e57)){if(_0x223890['agents'][_0x42daea['id']][_0xdb32('0x4e')](_0x4f5e57+'CurrentCapacity')){_0x223890[_0xdb32('0x45')][_0x42daea['id']][_0x4f5e57+_0xdb32('0x50')]=parseInt(_0x42daea['capacity'][_0x4f5e57],0xa);}}}_0x223890[_0xdb32('0x45')][_0x42daea['id']]['updateRealtime']();return _0x31350d({'code':0xc8,'message':_0x223890[_0xdb32('0x45')][_0x42daea['id']]});}else{return _0x40b0fc(_0x3e64ca[_0xdb32('0x42')](0x1f4,_0xdb32('0x51')));}});},'Agents':function(_0x548882){return new Promise(function(_0x545671,_0x5579b5){var _0x300258=_['values'](_0x223890['agents']);_0x545671({'count':_0x300258[_0xdb32('0x1a')],'rows':_0x300258});});},'ChatQueues':function(_0x5e5ff2){return new Promise(function(_0x1ac54d,_0x359402){var _0x21724d=[];for(var _0x5eefe9 in _0x223890['chatQueues']){if(_0x223890[_0xdb32('0x52')][_0xdb32('0x4e')](_0x5eefe9)){var _0x1aad20=_0x223890[_0xdb32('0x52')][_0x5eefe9];var _0x2d372d={'id':_0x1aad20['id'],'available':_0x1aad20['available'],'loggedIn':_0x1aad20['loggedIn'],'name':_0x1aad20[_0xdb32('0x53')],'paused':_0x1aad20[_0xdb32('0x54')],'waiting':_0x1aad20[_0xdb32('0x55')]};_0x21724d['push'](_0x2d372d);}}_0x1ac54d({'count':_0x21724d[_0xdb32('0x1a')],'rows':_0x21724d});});},'MailQueues':function(_0x80f271){return new Promise(function(_0x246c9c,_0x2f2ccf){var _0x5b9a9d=[];for(var _0x6ce88c in _0x223890[_0xdb32('0x56')]){if(_0x223890[_0xdb32('0x56')][_0xdb32('0x4e')](_0x6ce88c)){var _0x106729=_0x223890[_0xdb32('0x56')][_0x6ce88c];var _0x525369={'id':_0x106729['id'],'available':_0x106729[_0xdb32('0x57')],'loggedIn':_0x106729[_0xdb32('0x58')],'name':_0x106729[_0xdb32('0x53')],'paused':_0x106729['paused'],'waiting':_0x106729[_0xdb32('0x55')]};_0x5b9a9d[_0xdb32('0x23')](_0x525369);}}_0x246c9c({'count':_0x5b9a9d[_0xdb32('0x1a')],'rows':_0x5b9a9d});});},'OpenchannelQueues':function(_0x15d7f1){return new Promise(function(_0x4809f8,_0x2e30bc){var _0x2d0076=[];for(var _0x5374e in _0x223890[_0xdb32('0x59')]){if(_0x223890['openchannelQueues'][_0xdb32('0x4e')](_0x5374e)){var _0x17d501=_0x223890[_0xdb32('0x59')][_0x5374e];var _0x538487={'id':_0x17d501['id'],'available':_0x17d501[_0xdb32('0x57')],'loggedIn':_0x17d501[_0xdb32('0x58')],'name':_0x17d501[_0xdb32('0x53')],'paused':_0x17d501[_0xdb32('0x54')],'waiting':_0x17d501[_0xdb32('0x55')]};_0x2d0076[_0xdb32('0x23')](_0x538487);}}_0x4809f8({'count':_0x2d0076[_0xdb32('0x1a')],'rows':_0x2d0076});});},'SmsQueues':function(_0x50cba3){return new Promise(function(_0x3ca2e2,_0x4f5d90){var _0x465738=[];for(var _0x79d4f9 in _0x223890[_0xdb32('0x5a')]){if(_0x223890[_0xdb32('0x5a')][_0xdb32('0x4e')](_0x79d4f9)){var _0x239aec=_0x223890[_0xdb32('0x5a')][_0x79d4f9];var _0x4bfc1f={'id':_0x239aec['id'],'available':_0x239aec[_0xdb32('0x57')],'loggedIn':_0x239aec[_0xdb32('0x58')],'name':_0x239aec[_0xdb32('0x53')],'paused':_0x239aec['paused'],'waiting':_0x239aec[_0xdb32('0x55')]};_0x465738[_0xdb32('0x23')](_0x4bfc1f);}}_0x3ca2e2({'count':_0x465738[_0xdb32('0x1a')],'rows':_0x465738});});},'FaxQueues':function(_0x3bfbba){return new Promise(function(_0x5392ac,_0x3fff81){var _0x440163=[];for(var _0x5c2a81 in _0x223890[_0xdb32('0x5b')]){if(_0x223890[_0xdb32('0x5b')]['hasOwnProperty'](_0x5c2a81)){var _0x1c2ad0=_0x223890[_0xdb32('0x5b')][_0x5c2a81];var _0x162f2f={'id':_0x1c2ad0['id'],'available':_0x1c2ad0['available'],'loggedIn':_0x1c2ad0['loggedIn'],'name':_0x1c2ad0[_0xdb32('0x53')],'paused':_0x1c2ad0[_0xdb32('0x54')],'waiting':_0x1c2ad0['waiting']};_0x440163[_0xdb32('0x23')](_0x162f2f);}}_0x5392ac({'count':_0x440163[_0xdb32('0x1a')],'rows':_0x440163});});},'WhatsappQueues':function(_0x1f79b7){return new Promise(function(_0xcd876b,_0x4924b9){var _0x405a9e=[];for(var _0x3593ec in _0x223890[_0xdb32('0x5c')]){if(_0x223890[_0xdb32('0x5c')][_0xdb32('0x4e')](_0x3593ec)){var _0x3f0ece=_0x223890[_0xdb32('0x5c')][_0x3593ec];var _0x4d7146={'id':_0x3f0ece['id'],'available':_0x3f0ece[_0xdb32('0x57')],'loggedIn':_0x3f0ece[_0xdb32('0x58')],'name':_0x3f0ece[_0xdb32('0x53')],'paused':_0x3f0ece[_0xdb32('0x54')],'waiting':_0x3f0ece[_0xdb32('0x55')]};_0x405a9e[_0xdb32('0x23')](_0x4d7146);}}_0xcd876b({'count':_0x405a9e['length'],'rows':_0x405a9e});});},'ChatQueuesWaitingInteractions':function(_0x4b2b84){return new Promise(function(_0x5a8882,_0x368411){var _0x1c745f=_[_0xdb32('0x5d')](_0x223890[_0xdb32('0x5e')]);_0x5a8882({'count':_0x1c745f[_0xdb32('0x1a')],'rows':_0x1c745f});});},'MailQueuesWaitingInteractions':function(_0xcc553f){return new Promise(function(_0x1f868c,_0x44df50){var _0x3ca2ff=_['values'](_0x223890['mailQueuesWaitingInteractions']);_0x1f868c({'count':_0x3ca2ff[_0xdb32('0x1a')],'rows':_0x3ca2ff});});},'OpenchannelQueuesWaitingInteractions':function(_0x530c65){return new Promise(function(_0x38f170,_0x18c674){var _0x13cc79=_[_0xdb32('0x5d')](_0x223890[_0xdb32('0x5f')]);_0x38f170({'count':_0x13cc79[_0xdb32('0x1a')],'rows':_0x13cc79});});},'SmsQueuesWaitingInteractions':function(_0xfe4747){return new Promise(function(_0x19970b,_0x5d7b0b){var _0x278514=_[_0xdb32('0x5d')](_0x223890[_0xdb32('0x60')]);_0x19970b({'count':_0x278514['length'],'rows':_0x278514});});},'FaxQueuesWaitingInteractions':function(_0x505640){return new Promise(function(_0x36a266,_0x47cede){var _0x2d0248=_[_0xdb32('0x5d')](_0x223890['faxQueuesWaitingInteractions']);_0x36a266({'count':_0x2d0248[_0xdb32('0x1a')],'rows':_0x2d0248});});},'WhatsappQueuesWaitingInteractions':function(_0x16997f){return new Promise(function(_0xb0ad86,_0xc5f984){var _0x1db595=_['values'](_0x223890[_0xdb32('0x61')]);_0xb0ad86({'count':_0x1db595[_0xdb32('0x1a')],'rows':_0x1db595});});}};var _0x46bfe3=jayson[_0xdb32('0x62')](_0x4b38ab)['http']();_0x46bfe3['on'](_0xdb32('0x42'),function(_0x2d4b9f){logger[_0xdb32('0x42')](JSON[_0xdb32('0x3d')](_0x2d4b9f));return _0x2d3270(_0x2d4b9f);});_0x46bfe3['listen'](0x232c,_0xdb32('0x63'),function(){console[_0xdb32('0x64')](_0xdb32('0x65'),0x232c);return _0x2adea8(_0xdb32('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b3f3343..aedf005 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 _0x2d11=['result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','message'];(function(_0x4c8106,_0x37a590){var _0x51f51b=function(_0x47e3f3){while(--_0x47e3f3){_0x4c8106['push'](_0x4c8106['shift']());}};_0x51f51b(++_0x37a590);}(_0x2d11,0x8b));var _0x12d1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2d11[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x12d1('0x0'));var BPromise=require(_0x12d1('0x1'));var jayson=require(_0x12d1('0x2'));var _=require(_0x12d1('0x3'));var logger=require(_0x12d1('0x4'))(_0x12d1('0x5'));var client=jayson[_0x12d1('0x6')][_0x12d1('0x7')]({'port':0x232a});function request(_0x369179,_0x24b02e){return new BPromise(function(_0x4f4f84,_0x33f483){return client[_0x12d1('0x8')](_0x369179,_0x24b02e)['then'](function(_0x2122b4){if(_0x2122b4['error']){return _0x33f483(_0x2122b4[_0x12d1('0x9')][_0x12d1('0xa')]);}else{return _0x4f4f84(_0x2122b4[_0x12d1('0xb')]);}})[_0x12d1('0xc')](function(_0x5a8f0f){return _0x33f483(_0x5a8f0f);});});}exports[_0x12d1('0xd')]=function(_0x2f4493,_0x1c9a53,_0x41823a){return function(_0x45be17){if(_0x41823a[_0x12d1('0xe')]&&!_0x41823a['rules'][_0x2f4493]){logger[_0x12d1('0xf')](_0x12d1('0x10'),_0x2f4493);return _0x45be17[_0x12d1('0x11')]();}var _0x56dc7c=[];for(var _0xc8a71=0x0;_0xc8a71<_0x1c9a53['length'];_0xc8a71+=0x1){_0x56dc7c[_0x12d1('0x12')](request(_0x12d1('0x13'),{'command':util['format'](_0x12d1('0x14'),_0x1c9a53[_0xc8a71])})[_0x12d1('0x15')](function(_0xeeacaf){return _0xeeacaf&&_0xeeacaf[_0x12d1('0xa')]&&_0xeeacaf[_0x12d1('0xa')][_0x12d1('0x16')](_0x12d1('0x17'))>=0x0?!![]:![];})['catch'](function(_0xc7d803){logger[_0x12d1('0x9')](_0x12d1('0x18'),_0x2f4493,_0x1c9a53[_0xc8a71]);}));}BPromise[_0x12d1('0x19')](_0x56dc7c)[_0x12d1('0x15')](function(_0x305fcb){var _0x119b05=_['some'](_0x305fcb);logger[_0x12d1('0xf')](_0x12d1('0x1a'),_0x2f4493,_0x1c9a53[_0x12d1('0x1b')]('\x20|\x20'),_0x119b05);_0x45be17['when'](_0x119b05);})[_0x12d1('0xc')](function(_0x3177e7){console[_0x12d1('0x1c')](_0x3177e7);logger[_0x12d1('0x9')](_0x12d1('0x1a'),_0x2f4493,_0x1c9a53['join'](_0x12d1('0x1d')),_0x3177e7['stack']);_0x45be17[_0x12d1('0x11')]();});};}; \ No newline at end of file +var _0x5031=['request','error','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','../../../config/logger','routing','client','http'];(function(_0x284914,_0x43f9ed){var _0x165e81=function(_0x55213a){while(--_0x55213a){_0x284914['push'](_0x284914['shift']());}};_0x165e81(++_0x43f9ed);}(_0x5031,0x11c));var _0x1503=function(_0xffa842,_0x38fe73){_0xffa842=_0xffa842-0x0;var _0xec4615=_0x5031[_0xffa842];return _0xec4615;};'use strict';var util=require(_0x1503('0x0'));var BPromise=require(_0x1503('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x1503('0x2'))(_0x1503('0x3'));var client=jayson[_0x1503('0x4')][_0x1503('0x5')]({'port':0x232a});function request(_0x1046f8,_0x2e3fba){return new BPromise(function(_0x80c3d3,_0x3c80d3){return client[_0x1503('0x6')](_0x1046f8,_0x2e3fba)['then'](function(_0x24bb79){if(_0x24bb79[_0x1503('0x7')]){return _0x3c80d3(_0x24bb79[_0x1503('0x7')]['message']);}else{return _0x80c3d3(_0x24bb79['result']);}})['catch'](function(_0x181ed9){return _0x3c80d3(_0x181ed9);});});}exports['condition']=function(_0x16b7fe,_0x2570e6,_0xdc3312){return function(_0x18f04c){if(_0xdc3312['rules']&&!_0xdc3312['rules'][_0x16b7fe]){logger[_0x1503('0x8')](_0x1503('0x9'),_0x16b7fe);return _0x18f04c[_0x1503('0xa')]();}var _0x69e963=[];for(var _0x40cc75=0x0;_0x40cc75<_0x2570e6[_0x1503('0xb')];_0x40cc75+=0x1){_0x69e963[_0x1503('0xc')](request(_0x1503('0xd'),{'command':util[_0x1503('0xe')](_0x1503('0xf'),_0x2570e6[_0x40cc75])})[_0x1503('0x10')](function(_0x5e4a3e){return _0x5e4a3e&&_0x5e4a3e['message']&&_0x5e4a3e['message'][_0x1503('0x11')](_0x1503('0x12'))>=0x0?!![]:![];})[_0x1503('0x13')](function(_0x49cb92){logger['error'](_0x1503('0x14'),_0x16b7fe,_0x2570e6[_0x40cc75]);}));}BPromise[_0x1503('0x15')](_0x69e963)[_0x1503('0x10')](function(_0x11477f){var _0x3400b2=_[_0x1503('0x16')](_0x11477f);logger[_0x1503('0x8')](_0x1503('0x17'),_0x16b7fe,_0x2570e6['join']('\x20|\x20'),_0x3400b2);_0x18f04c[_0x1503('0x18')](_0x3400b2);})['catch'](function(_0x580c09){console[_0x1503('0x19')](_0x580c09);logger[_0x1503('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x16b7fe,_0x2570e6[_0x1503('0x1a')](_0x1503('0x1b')),_0x580c09[_0x1503('0x1c')]);_0x18f04c[_0x1503('0xa')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index c53a1c4..91c4a7d 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 _0xb49a=['[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','reason','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agentcomplete','agent','lodash','util','./utils','format'];(function(_0xac5315,_0xafce68){var _0x415c41=function(_0x390fe6){while(--_0x390fe6){_0xac5315['push'](_0xac5315['shift']());}};_0x415c41(++_0xafce68);}(_0xb49a,0xfb));var _0xab49=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xb49a[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var utils=require(_0xab49('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1d512a,_0x8db649){utils['info'](util[_0xab49('0x3')](_0xab49('0x4'),_0x1d512a['uniqueid'],_0x1d512a['channel'],_0x1d512a[_0xab49('0x5')],_0x1d512a[_0xab49('0x6')],_0x1d512a[_0xab49('0x7')],_0x1d512a[_0xab49('0x8')],_0x1d512a[_0xab49('0x9')],_0x1d512a[_0xab49('0xa')]));if(_0x1d512a[_0xab49('0x5')]){utils['getVoiceQueueByName'](_0x1d512a[_0xab49('0x5')])[_0xab49('0xb')](function(_0xf12653){if(_0xf12653){_0x1d512a[_0xab49('0xc')]=_0xf12653[_0xab49('0xc')];_0x1d512a['agentacw']=_0x1d512a['agentcomplete']?_0xf12653[_0xab49('0xd')]:![];_0x1d512a[_0xab49('0xe')]=_0x1d512a[_0xab49('0xf')]?_0xf12653[_0xab49('0x10')]:0x0;}utils[_0xab49('0x11')]('CreateVoiceAgentReport',_0x1d512a);});}else{utils[_0xab49('0x11')](_0xab49('0x12'),_0x1d512a);}if(_0x8db649){delete transfers[_0x1d512a[_0xab49('0x13')]];}else{delete agents[_0x1d512a[_0xab49('0x14')]];}}exports[_0xab49('0x15')]=function(_0x36091a){try{utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x17'),_0x36091a[_0xab49('0x13')]),_0x36091a);agents[_0x36091a[_0xab49('0x14')]]=_0x36091a;agents[_0x36091a['destuniqueid']][_0xab49('0x18')]=utils[_0xab49('0x19')]();agents[_0x36091a[_0xab49('0x14')]][_0xab49('0xa')]=_0xab49('0x1a');agents[_0x36091a['destuniqueid']][_0xab49('0x9')]=null;agents[_0x36091a[_0xab49('0x14')]][_0xab49('0x1b')]=null;utils[_0xab49('0x1c')](util[_0xab49('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x36091a[_0xab49('0x13')],agents[_0x36091a[_0xab49('0x14')]][_0xab49('0x6')],_0x36091a['destuniqueid']));}catch(_0x4c22cd){utils[_0xab49('0x1d')](util[_0xab49('0x3')]('[%s][agents][agentcalled]',_0x36091a[_0xab49('0x13')]),_0x4c22cd);}};exports[_0xab49('0x1e')]=function(_0x49b716){try{if(!_[_0xab49('0x1f')](agents[_0x49b716['destuniqueid']])){utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][agentringnoanswer]',_0x49b716['uniqueid']),_0x49b716);utils[_0xab49('0x1c')](util['format'](_0xab49('0x20'),_0x49b716['uniqueid'],agents[_0x49b716[_0xab49('0x14')]][_0xab49('0x6')],_0x49b716[_0xab49('0x14')]));agents[_0x49b716['destuniqueid']][_0xab49('0x1e')]=!![];agents[_0x49b716['destuniqueid']][_0xab49('0x21')]=utils[_0xab49('0x19')]();agents[_0x49b716['destuniqueid']][_0xab49('0xa')]=_0xab49('0x22');agents[_0x49b716['destuniqueid']]['reason']=_0xab49('0x22');agents[_0x49b716[_0xab49('0x14')]][_0xab49('0x23')]=_0x49b716['ringtime']?parseInt(_0x49b716[_0xab49('0x24')])/0x3e8:0x0;agents[_0x49b716[_0xab49('0x14')]]['talktime']=0x0;unanswered[_0xab49('0x25')](_0x49b716[_0xab49('0x14')]);}}catch(_0x342fdf){utils['error'](util[_0xab49('0x3')]('[%s][agents][agentringnoanswer]',_0x49b716[_0xab49('0x13')]),_0x342fdf);}};exports['queuecallerabandon']=function(_0x19f094){try{_['forIn'](agents,function(_0x134a03,_0x24bd0f){if(_0x134a03[_0xab49('0x13')]==_0x19f094[_0xab49('0x13')]&&!_['includes'](unanswered,_0x134a03[_0xab49('0x14')])){utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]',_0x19f094[_0xab49('0x13')]),_0x19f094);utils['info'](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x19f094['uniqueid'],_0x134a03['membername'],_0x134a03[_0xab49('0x14')]));_0x134a03['agentringnoanswer']=!![];_0x134a03[_0xab49('0x21')]=utils[_0xab49('0x19')]();_0x134a03[_0xab49('0xa')]='abandoned';_0x134a03[_0xab49('0x26')]=_0xab49('0x27');_0x134a03[_0xab49('0x23')]=_0x19f094[_0xab49('0x23')];_0x134a03[_0xab49('0x28')]=0x0;writeDB(_0x134a03);}});}catch(_0x56b768){utils[_0xab49('0x1d')](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]',_0x19f094['uniqueid']),_0x56b768);}};exports[_0xab49('0x29')]=function(_0x29c6cf){try{if(agents[_0x29c6cf[_0xab49('0x14')]]){utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x2a'),_0x29c6cf[_0xab49('0x13')]),_0x29c6cf);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x2b'),_0x29c6cf[_0xab49('0x13')],agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x6')],_0x29c6cf['destuniqueid']));agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x2c')]=utils[_0xab49('0x19')]();agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x9')]=_0x29c6cf['connectedlinenum'];agents[_0x29c6cf[_0xab49('0x14')]]['connectedlinename']=_0x29c6cf['connectedlinename'];agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x23')]=_0x29c6cf[_0xab49('0x24')];agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0xa')]='connect';_[_0xab49('0x2d')](agents,function(_0x2cdcbf,_0x2016a9){if(_0x2cdcbf[_0xab49('0x14')]!=_0x29c6cf[_0xab49('0x14')]&&_0x2cdcbf['uniqueid']==_0x29c6cf['uniqueid']){_0x2cdcbf[_0xab49('0x28')]=0x0;_0x2cdcbf[_0xab49('0x23')]=_0x29c6cf[_0xab49('0x24')];_0x2cdcbf['agentringnoanswer']=!![];_0x2cdcbf[_0xab49('0x21')]=utils['now']();_0x2cdcbf['lastevent']='answered_elsewhere';_0x2cdcbf['reason']=_0xab49('0x2e');_0x2cdcbf[_0xab49('0x2f')]=_0x29c6cf[_0xab49('0x14')];_0x2cdcbf[_0xab49('0x30')]=_0x29c6cf[_0xab49('0x6')];writeDB(_0x2cdcbf);}});}}catch(_0x3f3776){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x2a'),_0x29c6cf[_0xab49('0x13')]),_0x3f3776);}};exports['agentcomplete']=function(_0x158042){try{if(!_[_0xab49('0x1f')](agents[_0x158042['destuniqueid']])){utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x31'),_0x158042[_0xab49('0x13')]),_0x158042);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x32'),_0x158042[_0xab49('0x13')],agents[_0x158042['destuniqueid']][_0xab49('0x6')],_0x158042[_0xab49('0x14')]));agents[_0x158042[_0xab49('0x14')]]['agentcomplete']=!![];agents[_0x158042[_0xab49('0x14')]][_0xab49('0x33')]=utils[_0xab49('0x19')]();agents[_0x158042[_0xab49('0x14')]][_0xab49('0x28')]=utils[_0xab49('0x34')](agents[_0x158042['destuniqueid']][_0xab49('0x33')],agents[_0x158042[_0xab49('0x14')]][_0xab49('0x2c')]);agents[_0x158042[_0xab49('0x14')]][_0xab49('0x26')]=_0x158042[_0xab49('0x26')];agents[_0x158042['destuniqueid']][_0xab49('0xa')]=_0xab49('0x35');writeDB(agents[_0x158042[_0xab49('0x14')]]);}}catch(_0xca56ce){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x31'),_0x158042[_0xab49('0x13')]),_0xca56ce);}};exports[_0xab49('0x36')]=function(_0xfb7d69){try{if(!_[_0xab49('0x1f')](agents[_0xfb7d69[_0xab49('0x37')]])){utils['debug'](util[_0xab49('0x3')](_0xab49('0x38'),_0xfb7d69[_0xab49('0x13')]),_0xfb7d69);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x39'),_0xfb7d69[_0xab49('0x13')],agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x6')],agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x13')]));agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x3a')]=!![];agents[_0xfb7d69[_0xab49('0x37')]]['transfertype']=_0xab49('0x3b');agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x3c')]=_0xfb7d69[_0xab49('0x3d')];agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x3e')]=agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x13')];}}catch(_0x37cf42){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x38'),_0xfb7d69[_0xab49('0x13')]),_0x37cf42);}};exports[_0xab49('0x3f')]=function(_0x235ba8){try{utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][attendedtransfer]',_0x235ba8[_0xab49('0x40')]),_0x235ba8);if(_0x235ba8[_0xab49('0x40')]==_0x235ba8[_0xab49('0x41')]){if(!_[_0xab49('0x1f')](agents[_0x235ba8[_0xab49('0x42')]])){utils['info'](util[_0xab49('0x3')](_0xab49('0x43'),_0x235ba8[_0xab49('0x40')],agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x6')]));agents[_0x235ba8[_0xab49('0x42')]]['transfer']=!![];agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x44')]=_0xab49('0x45');agents[_0x235ba8[_0xab49('0x42')]]['transferexten']=_0x235ba8['origtransfererexten'];agents[_0x235ba8[_0xab49('0x42')]]['transferuniqueid']=_0x235ba8[_0xab49('0x40')];}if(_0x235ba8[_0xab49('0x46')]&&agents[_0x235ba8[_0xab49('0x46')]]){agents[_0x235ba8[_0xab49('0x46')]][_0xab49('0x47')]=0x1;transfers[_0x235ba8[_0xab49('0x46')]]=_[_0xab49('0x48')](agents[_0x235ba8[_0xab49('0x46')]]);transfers[_0x235ba8['transfereeuniqueid']][_0xab49('0x8')]=agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x8')];transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x49')]=agents[_0x235ba8['secondtransfereruniqueid']][_0xab49('0x49')];transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x18')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x2c')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x23')]=0x0;transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x47')]=0x2;}}else if(_0x235ba8[_0xab49('0x42')]==_0x235ba8[_0xab49('0x4a')]){if(!_['isNil'](agents[_0x235ba8[_0xab49('0x40')]])){utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x43'),_0x235ba8[_0xab49('0x40')],agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x6')]));agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x3a')]=!![];agents[_0x235ba8[_0xab49('0x40')]]['transfertype']=_0xab49('0x45');agents[_0x235ba8[_0xab49('0x40')]]['transferexten']=_0x235ba8[_0xab49('0x4b')];agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x3e')]=_0x235ba8['secondtransfereruniqueid'];}if(_0x235ba8[_0xab49('0x4c')]&&agents[_0x235ba8[_0xab49('0x4c')]]){agents[_0x235ba8['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x235ba8[_0xab49('0x4c')]]=_[_0xab49('0x48')](agents[_0x235ba8[_0xab49('0x4c')]]);transfers[_0x235ba8['transfertargetuniqueid']]['calleridnum']=agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x8')];transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x49')]=agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x49')];transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x18')]=utils['now']();transfers[_0x235ba8['transfertargetuniqueid']][_0xab49('0x2c')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x23')]=0x0;transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x47')]=0x2;}}}catch(_0x108755){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x4d'),_0x235ba8['origtransfereruniqueid']),_0x108755);}};exports[_0xab49('0x4e')]=function(_0x24fb84){try{utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x4f'),_0x24fb84[_0xab49('0x13')]),_0x24fb84);if(agents[_0x24fb84[_0xab49('0x13')]]&&agents[_0x24fb84[_0xab49('0x13')]]['reason']===_0xab49('0x22')){if(_0x24fb84['cause']==='21'){agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=_0xab49('0x50');agents[_0x24fb84['uniqueid']][_0xab49('0xa')]=_0xab49('0x50');}utils['info'](util[_0xab49('0x3')](_0xab49('0x51'),_0x24fb84[_0xab49('0x13')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x6')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]));writeDB(agents[_0x24fb84[_0xab49('0x13')]]);var _0x366a3c=unanswered[_0xab49('0x52')](_0x24fb84[_0xab49('0x13')]);if(_0x366a3c>-0x1){unanswered['splice'](_0x366a3c,0x1);}}if(transfers[_0x24fb84[_0xab49('0x13')]]){transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x53')]=!![];transfers[_0x24fb84['uniqueid']][_0xab49('0x33')]=utils[_0xab49('0x19')]();transfers[_0x24fb84['uniqueid']][_0xab49('0x28')]=utils[_0xab49('0x34')](transfers[_0x24fb84['uniqueid']][_0xab49('0x33')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]);transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=_0xab49('0x54');transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]='complete';utils['info'](util[_0xab49('0x3')](_0xab49('0x51'),_0x24fb84[_0xab49('0x13')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x6')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')],transfers[_0x24fb84[_0xab49('0x13')]]['lastevent']));writeDB(transfers[_0x24fb84[_0xab49('0x13')]],!![]);}if(agents[_0x24fb84['uniqueid']]&&agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]){agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x53')]=!![];agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x33')]=utils[_0xab49('0x19')]();agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x28')]=utils[_0xab49('0x34')](agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x33')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]);agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=agents[_0x24fb84['uniqueid']]['transfer']?_0xab49('0x3a'):_0xab49('0x54');agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]=_0xab49('0x35');utils[_0xab49('0x1c')](util['format'](_0xab49('0x51'),_0x24fb84['uniqueid'],agents[_0x24fb84['uniqueid']][_0xab49('0x6')],agents[_0x24fb84['uniqueid']][_0xab49('0x26')],agents[_0x24fb84[_0xab49('0x13')]]['lastevent']));writeDB(agents[_0x24fb84[_0xab49('0x13')]]);}}catch(_0x271ee4){utils[_0xab49('0x1d')](util['format']('[%s][agents][hangup]',_0x24fb84[_0xab49('0x13')]),_0x271ee4);}}; \ No newline at end of file +var _0x6cb4=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','cause'];(function(_0xb479b4,_0x11eb3b){var _0x170c1d=function(_0x2c7035){while(--_0x2c7035){_0xb479b4['push'](_0xb479b4['shift']());}};_0x170c1d(++_0x11eb3b);}(_0x6cb4,0xff));var _0x46cb=function(_0x499503,_0xfc7065){_0x499503=_0x499503-0x0;var _0x5d390c=_0x6cb4[_0x499503];return _0x5d390c;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var utils=require(_0x46cb('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3403fc,_0x375bef){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x5'),_0x3403fc[_0x46cb('0x6')],_0x3403fc['channel'],_0x3403fc[_0x46cb('0x7')],_0x3403fc['membername'],_0x3403fc[_0x46cb('0x8')],_0x3403fc['calleridnum'],_0x3403fc[_0x46cb('0x9')],_0x3403fc[_0x46cb('0xa')]));if(_0x3403fc[_0x46cb('0x7')]){utils[_0x46cb('0xb')](_0x3403fc[_0x46cb('0x7')])[_0x46cb('0xc')](function(_0x56258a){if(_0x56258a){_0x3403fc[_0x46cb('0xd')]=_0x56258a[_0x46cb('0xd')];_0x3403fc['agentacw']=_0x3403fc[_0x46cb('0xe')]?_0x56258a[_0x46cb('0xf')]:![];_0x3403fc['acwtime']=_0x3403fc[_0x46cb('0x10')]?_0x56258a[_0x46cb('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x3403fc);});}else{utils['request'](_0x46cb('0x12'),_0x3403fc);}if(_0x375bef){delete transfers[_0x3403fc[_0x46cb('0x6')]];}else{delete agents[_0x3403fc[_0x46cb('0x13')]];}}exports[_0x46cb('0x14')]=function(_0x553440){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0x553440);agents[_0x553440[_0x46cb('0x13')]]=_0x553440;agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x17')]=utils[_0x46cb('0x18')]();agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x19');agents[_0x553440['destuniqueid']][_0x46cb('0x9')]=null;agents[_0x553440['destuniqueid']][_0x46cb('0x1a')]=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x553440[_0x46cb('0x6')],agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x553440[_0x46cb('0x13')]));}catch(_0xbd488f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0xbd488f);}};exports[_0x46cb('0x1d')]=function(_0x149483){try{if(!_[_0x46cb('0x1e')](agents[_0x149483[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x149483);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x20'),_0x149483[_0x46cb('0x6')],agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x149483[_0x46cb('0x13')]));agents[_0x149483[_0x46cb('0x13')]]['agentringnoanswer']=!![];agents[_0x149483['destuniqueid']][_0x46cb('0x21')]=utils[_0x46cb('0x18')]();agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x22');agents[_0x149483['destuniqueid']][_0x46cb('0x23')]='timeout';agents[_0x149483['destuniqueid']]['holdtime']=_0x149483[_0x46cb('0x24')]?parseInt(_0x149483[_0x46cb('0x24')])/0x3e8:0x0;agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x25')]=0x0;unanswered[_0x46cb('0x26')](_0x149483[_0x46cb('0x13')]);}}catch(_0x378dc7){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x378dc7);}};exports['queuecallerabandon']=function(_0x1ce88f){try{_[_0x46cb('0x27')](agents,function(_0x4c73bd,_0x49e0bc){if(_0x4c73bd[_0x46cb('0x6')]==_0x1ce88f['uniqueid']&&!_[_0x46cb('0x28')](unanswered,_0x4c73bd[_0x46cb('0x13')])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f[_0x46cb('0x6')]),_0x1ce88f);utils['info'](util[_0x46cb('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ce88f[_0x46cb('0x6')],_0x4c73bd[_0x46cb('0x1b')],_0x4c73bd['destuniqueid']));_0x4c73bd[_0x46cb('0x1d')]=!![];_0x4c73bd[_0x46cb('0x21')]=utils[_0x46cb('0x18')]();_0x4c73bd[_0x46cb('0xa')]=_0x46cb('0x2a');_0x4c73bd['reason']=_0x46cb('0x2a');_0x4c73bd['holdtime']=_0x1ce88f[_0x46cb('0x2b')];_0x4c73bd[_0x46cb('0x25')]=0x0;writeDB(_0x4c73bd);}});}catch(_0x2630e0){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f['uniqueid']),_0x2630e0);}};exports[_0x46cb('0x2c')]=function(_0xf8be9){try{if(agents[_0xf8be9[_0x46cb('0x13')]]){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9[_0x46cb('0x6')]),_0xf8be9);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x2e'),_0xf8be9[_0x46cb('0x6')],agents[_0xf8be9['destuniqueid']]['membername'],_0xf8be9['destuniqueid']));agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x2f')]=utils[_0x46cb('0x18')]();agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x9')]=_0xf8be9[_0x46cb('0x9')];agents[_0xf8be9['destuniqueid']][_0x46cb('0x1a')]=_0xf8be9['connectedlinename'];agents[_0xf8be9['destuniqueid']][_0x46cb('0x2b')]=_0xf8be9['ringtime'];agents[_0xf8be9['destuniqueid']][_0x46cb('0xa')]='connect';_['forIn'](agents,function(_0x67bd14,_0x10017d){if(_0x67bd14[_0x46cb('0x13')]!=_0xf8be9[_0x46cb('0x13')]&&_0x67bd14[_0x46cb('0x6')]==_0xf8be9[_0x46cb('0x6')]){_0x67bd14[_0x46cb('0x25')]=0x0;_0x67bd14['holdtime']=_0xf8be9[_0x46cb('0x24')];_0x67bd14['agentringnoanswer']=!![];_0x67bd14[_0x46cb('0x21')]=utils['now']();_0x67bd14[_0x46cb('0xa')]=_0x46cb('0x30');_0x67bd14[_0x46cb('0x23')]='answered_elsewhere';_0x67bd14[_0x46cb('0x31')]=_0xf8be9[_0x46cb('0x13')];_0x67bd14['answeredelsewheremembername']=_0xf8be9[_0x46cb('0x1b')];writeDB(_0x67bd14);}});}}catch(_0x3d0b83){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9['uniqueid']),_0x3d0b83);}};exports['agentcomplete']=function(_0x10bada){try{if(!_['isNil'](agents[_0x10bada[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util['format'](_0x46cb('0x32'),_0x10bada[_0x46cb('0x6')]),_0x10bada);utils[_0x46cb('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10bada['uniqueid'],agents[_0x10bada['destuniqueid']][_0x46cb('0x1b')],_0x10bada[_0x46cb('0x13')]));agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0xe')]=!![];agents[_0x10bada[_0x46cb('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x25')]=utils['diffTime'](agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x33')],agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x2f')]);agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x23')]=_0x10bada[_0x46cb('0x23')];agents[_0x10bada['destuniqueid']]['lastevent']=_0x46cb('0x34');writeDB(agents[_0x10bada['destuniqueid']]);}}catch(_0x2c4ecb){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')]('[%s][agents][agentcomplete]',_0x10bada[_0x46cb('0x6')]),_0x2c4ecb);}};exports['blindtransfer']=function(_0x5c02c9){try{if(!_[_0x46cb('0x1e')](agents[_0x5c02c9[_0x46cb('0x35')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9[_0x46cb('0x6')]),_0x5c02c9);utils[_0x46cb('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5c02c9[_0x46cb('0x6')],agents[_0x5c02c9[_0x46cb('0x35')]]['membername'],agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x6')]));agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x37')]=!![];agents[_0x5c02c9[_0x46cb('0x35')]]['transfertype']=_0x46cb('0x38');agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x39')]=_0x5c02c9['extension'];agents[_0x5c02c9[_0x46cb('0x35')]]['transferuniqueid']=agents[_0x5c02c9['transfereruniqueid']][_0x46cb('0x6')];}}catch(_0x2cfe6f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9['uniqueid']),_0x2cfe6f);}};exports[_0x46cb('0x3a')]=function(_0xd51a75){try{utils['debug'](util['format'](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0xd51a75);if(_0xd51a75[_0x46cb('0x3c')]==_0xd51a75['origtransfererlinkedid']){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3d')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x1b')]));agents[_0xd51a75[_0x46cb('0x3d')]]['transfer']=!![];agents[_0xd51a75[_0x46cb('0x3d')]]['transfertype']=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x40')];agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3c')];}if(_0xd51a75[_0x46cb('0x42')]&&agents[_0xd51a75[_0x46cb('0x42')]]){agents[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x42')]]=_[_0x46cb('0x44')](agents[_0xd51a75['transfereeuniqueid']]);transfers[_0xd51a75['transfereeuniqueid']]['calleridnum']=agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x42')]]['calleridname']=agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x42')]]['agentcalledAt']=utils['now']();transfers[_0xd51a75[_0x46cb('0x42')]]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x2;}}else if(_0xd51a75[_0x46cb('0x3d')]==_0xd51a75[_0x46cb('0x47')]){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3c')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x1b')]));agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x37')]=!![];agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x48')]=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x49')];agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3d')];}if(_0xd51a75[_0x46cb('0x4a')]&&agents[_0xd51a75[_0x46cb('0x4a')]]){agents[_0xd51a75['transfertargetuniqueid']][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x4a')]]=_[_0x46cb('0x44')](agents[_0xd51a75[_0x46cb('0x4a')]]);transfers[_0xd51a75[_0x46cb('0x4a')]]['calleridnum']=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x46')]=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x17')]=utils['now']();transfers[_0xd51a75['transfertargetuniqueid']]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x43')]=0x2;}}}catch(_0x1e3dca){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0x1e3dca);}};exports[_0x46cb('0x4b')]=function(_0x199dc0){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')]('[%s][agents][hangup]',_0x199dc0[_0x46cb('0x6')]),_0x199dc0);if(agents[_0x199dc0['uniqueid']]&&agents[_0x199dc0[_0x46cb('0x6')]]['reason']===_0x46cb('0x22')){if(_0x199dc0[_0x46cb('0x4c')]==='21'){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='rejected';agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]='rejected';}utils['info'](util[_0x46cb('0x4')](_0x46cb('0x4d'),_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0['uniqueid']]['reason'],agents[_0x199dc0['uniqueid']][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);var _0x30b303=unanswered[_0x46cb('0x4e')](_0x199dc0[_0x46cb('0x6')]);if(_0x30b303>-0x1){unanswered[_0x46cb('0x4f')](_0x30b303,0x1);}}if(transfers[_0x199dc0[_0x46cb('0x6')]]){transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')]=utils['now']();transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](transfers[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x2f')]);transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='agent';transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0['uniqueid'],transfers[_0x199dc0[_0x46cb('0x6')]]['membername'],transfers[_0x199dc0[_0x46cb('0x6')]]['reason'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(transfers[_0x199dc0[_0x46cb('0x6')]],!![]);}if(agents[_0x199dc0[_0x46cb('0x6')]]&&agents[_0x199dc0['uniqueid']][_0x46cb('0x2f')]){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];agents[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')],agents[_0x199dc0[_0x46cb('0x6')]]['agentconnectAt']);agents[_0x199dc0['uniqueid']][_0x46cb('0x23')]=agents[_0x199dc0[_0x46cb('0x6')]]['transfer']?_0x46cb('0x37'):_0x46cb('0x51');agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util[_0x46cb('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);}}catch(_0x5567cc){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x52'),_0x199dc0[_0x46cb('0x6')]),_0x5567cc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6ac1be7..7ff17c3 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 _0xc319=['interface','calleridnum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','recording','newchannel','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','isNil','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','cause-txt','endtime','starttime','billableseconds','diffTime','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastapplication','Queue','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','noop','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername'];(function(_0x2e2799,_0x476010){var _0x23c915=function(_0x346470){while(--_0x346470){_0x2e2799['push'](_0x2e2799['shift']());}};_0x23c915(++_0x476010);}(_0xc319,0x12e));var _0x9c31=function(_0x21a146,_0x25ab99){_0x21a146=_0x21a146-0x0;var _0x534b8c=_0xc319[_0x21a146];return _0x534b8c;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var utils=require(_0x9c31('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x9c31('0x3'),_0x9c31('0x4'),'FAILED',_0x9c31('0x3'),_0x9c31('0x3'),_0x9c31('0x3'),_0x9c31('0x5'),'BUSY',_0x9c31('0x4'),_0x9c31('0x4'),_0x9c31('0x4')];var channels={};function writeDB(_0x2bdff2){var _0x3aa031;if(transfers[_0x9c31('0x6')][_0x2bdff2[_0x9c31('0x7')]]){_0x3aa031=_0x2bdff2[_0x9c31('0x7')];_0x2bdff2[_0x9c31('0x7')]=transfers['blinds'][_0x2bdff2['uniqueid']]['transfereeuniqueid'];}utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0xa'),_0x2bdff2[_0x9c31('0x7')],_0x2bdff2[_0x9c31('0xb')],_0x2bdff2['queue'],_0x2bdff2[_0x9c31('0xc')],_0x2bdff2[_0x9c31('0xd')],_0x2bdff2[_0x9c31('0xe')],_0x2bdff2['connectedlinenum'],_0x2bdff2[_0x9c31('0xf')]));if(_0x2bdff2[_0x9c31('0x10')]){utils[_0x9c31('0x11')](_0x2bdff2[_0x9c31('0x10')])[_0x9c31('0x12')](function(_0x4d9601){if(_0x4d9601){_0x2bdff2['UserId']=_0x4d9601['id'];}utils['request']('CreateVoiceCallReport',_0x2bdff2);});}else{utils['request'](_0x9c31('0x13'),_0x2bdff2);}if(channels[_0x2bdff2[_0x9c31('0x7')]]){delete channels[_0x2bdff2['uniqueid']];}else if(_0x3aa031&&channels[_0x3aa031]){if(!transfers[_0x9c31('0x6')][_0x3aa031][_0x9c31('0x14')])delete transfers[_0x9c31('0x6')][_0x3aa031];delete channels[_0x3aa031];}}exports[_0x9c31('0x15')]=function(_0x330ed4){try{utils['debug'](util[_0x9c31('0x9')]('[%s][calls][newchannel]',_0x330ed4[_0x9c31('0x7')]),_0x330ed4);if(_0x330ed4['uniqueid']==_0x330ed4[_0x9c31('0x16')]&&_0x330ed4['channel']!=_0x9c31('0x17')){utils[_0x9c31('0x8')](util[_0x9c31('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x330ed4[_0x9c31('0x7')],_0x330ed4[_0x9c31('0x18')],_0x330ed4[_0x9c31('0x19')]));channels[_0x330ed4['uniqueid']]={'uniqueid':_0x330ed4[_0x9c31('0x7')],'accountcode':_0x330ed4[_0x9c31('0x10')],'source':_0x330ed4['calleridnum'],'destination':_0x330ed4[_0x9c31('0x19')],'destinationcontext':_0x330ed4[_0x9c31('0x18')],'channel':_0x330ed4[_0x9c31('0xb')],'starttime':utils[_0x9c31('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x9c31('0x1b')};}}catch(_0x3f66ee){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')](_0x9c31('0x1d'),_0x330ed4[_0x9c31('0x7')]),_0x3f66ee);}};exports[_0x9c31('0x1e')]=function(_0x47f388){try{utils[_0x9c31('0x1f')](util[_0x9c31('0x9')](_0x9c31('0x20'),_0x47f388[_0x9c31('0x7')]),_0x47f388);if(!_[_0x9c31('0x21')](channels[_0x47f388[_0x9c31('0x7')]])&&_0x47f388['channelstate']==0x6){utils[_0x9c31('0x8')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x47f388[_0x9c31('0x7')],_0x47f388[_0x9c31('0x18')],_0x47f388[_0x9c31('0xb')]));if(_[_0x9c31('0x21')](channels[_0x47f388['uniqueid']][_0x9c31('0x22')])){channels[_0x47f388[_0x9c31('0x7')]][_0x9c31('0x22')]=utils[_0x9c31('0x1a')]();}}else if(!_[_0x9c31('0x21')](channels[_0x47f388[_0x9c31('0x16')]])&&_0x47f388[_0x9c31('0x23')]==0x6&&_0x47f388['context']!=_0x9c31('0x24')){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x25'),_0x47f388[_0x9c31('0x7')],_0x47f388[_0x9c31('0x16')],_0x47f388[_0x9c31('0x18')],_0x47f388[_0x9c31('0xb')]));channels[_0x47f388[_0x9c31('0x16')]][_0x9c31('0x10')]=_0x47f388[_0x9c31('0x10')];channels[_0x47f388[_0x9c31('0x16')]][_0x9c31('0x26')]=_0x47f388['channel'];if(_['isNil'](channels[_0x47f388[_0x9c31('0x16')]][_0x9c31('0x27')])){channels[_0x47f388[_0x9c31('0x16')]][_0x9c31('0x27')]=utils['now']();}channels[_0x47f388[_0x9c31('0x16')]][_0x9c31('0x28')]=dispositions[_[_0x9c31('0x29')](_0x47f388[_0x9c31('0x23')])]||_0x9c31('0x5');}}catch(_0x10cb06){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')]('[%s][calls][newstate]',_0x47f388[_0x9c31('0x7')]),_0x10cb06);}};exports[_0x9c31('0x2a')]=function(_0xd8ac8f){try{if(!_['isNil'](channels[_0xd8ac8f[_0x9c31('0x7')]])){utils[_0x9c31('0x1f')](util[_0x9c31('0x9')]('[%s][calls][hangup]',_0xd8ac8f[_0x9c31('0x7')]),_0xd8ac8f);if(_[_0x9c31('0x21')](channels[_0xd8ac8f['uniqueid']]['callerid'])){channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x2b')]=_0xd8ac8f[_0x9c31('0x2c')]+'\x20<'+_0xd8ac8f[_0x9c31('0xe')]+'>';}utils[_0x9c31('0x8')](util[_0x9c31('0x9')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xd8ac8f[_0x9c31('0x7')],channels[_0xd8ac8f['uniqueid']][_0x9c31('0x2b')],_0xd8ac8f[_0x9c31('0x2d')]));channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x2e')]=utils[_0x9c31('0x1a')]();channels[_0xd8ac8f[_0x9c31('0x7')]]['duration']=utils['diffTime'](channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x2e')],channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x2f')]);channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x30')]=channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x27')]?utils[_0x9c31('0x31')](channels[_0xd8ac8f['uniqueid']][_0x9c31('0x2e')],channels[_0xd8ac8f[_0x9c31('0x7')]][_0x9c31('0x27')]):0x0;writeDB(channels[_0xd8ac8f['uniqueid']]);}}catch(_0x1e085c){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')](_0x9c31('0x32'),_0xd8ac8f[_0x9c31('0x7')]),_0x1e085c);}};exports['attendedtransfer']=function(_0x3be59d){try{if(!_[_0x9c31('0x21')](channels[_0x3be59d[_0x9c31('0x33')]])){utils['debug'](util[_0x9c31('0x9')](_0x9c31('0x34'),_0x3be59d[_0x9c31('0x35')]),_0x3be59d);if(channels[_0x3be59d[_0x9c31('0x33')]][_0x9c31('0xb')]==_0x3be59d[_0x9c31('0x36')]){utils[_0x9c31('0x8')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3be59d[_0x9c31('0x35')],_0x3be59d[_0x9c31('0x33')],_0x3be59d[_0x9c31('0x37')]));channels[_0x3be59d[_0x9c31('0x33')]][_0x9c31('0x26')]=_0x3be59d['secondtransfererchannel'];channels[_0x3be59d['localtwolinkedid']][_0x9c31('0x38')]=_0x9c31('0x39');}else if(channels[_0x3be59d[_0x9c31('0x33')]][_0x9c31('0xb')]=_0x3be59d[_0x9c31('0x3a')]){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x3b'),_0x3be59d['origtransfereruniqueid'],_0x3be59d[_0x9c31('0x33')],_0x3be59d['origtransfererchannel']));channels[_0x3be59d['localtwolinkedid']][_0x9c31('0x26')]=_0x3be59d[_0x9c31('0x3c')];channels[_0x3be59d['localtwolinkedid']]['userfield']=_0x9c31('0x39');}}}catch(_0x1e0e47){utils[_0x9c31('0x1c')](util['format'](_0x9c31('0x34'),_0x3be59d[_0x9c31('0x35')]),_0x1e0e47);}};exports[_0x9c31('0x3d')]=function(_0x5603f3){try{if(!_[_0x9c31('0x21')](channels[_0x5603f3[_0x9c31('0x7')]])){utils[_0x9c31('0x1f')](util[_0x9c31('0x9')](_0x9c31('0x3e'),_0x5603f3['uniqueid']),_0x5603f3);channels[_0x5603f3['uniqueid']][_0x9c31('0x3f')]=utils[_0x9c31('0x1a')]();utils[_0x9c31('0x8')](util['format'](_0x9c31('0x40'),_0x5603f3[_0x9c31('0x7')],channels[_0x5603f3['uniqueid']][_0x9c31('0x3f')]));}}catch(_0x308303){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')]('[%s][calls][musiconholdstart]',_0x5603f3['uniqueid']),_0x308303);}};exports[_0x9c31('0x41')]=function(_0x4bc5c6){try{if(!_[_0x9c31('0x21')](channels[_0x4bc5c6[_0x9c31('0x7')]])){utils['debug'](util[_0x9c31('0x9')]('[%s][calls][musiconholdstop]',_0x4bc5c6['uniqueid']),_0x4bc5c6);if(!_[_0x9c31('0x21')](channels[_0x4bc5c6[_0x9c31('0x7')]][_0x9c31('0x3f')])){channels[_0x4bc5c6[_0x9c31('0x7')]][_0x9c31('0x42')]+=utils[_0x9c31('0x31')](utils[_0x9c31('0x1a')](),channels[_0x4bc5c6[_0x9c31('0x7')]][_0x9c31('0x3f')]);utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x43'),_0x4bc5c6[_0x9c31('0x7')],channels[_0x4bc5c6['uniqueid']][_0x9c31('0x42')]));delete channels[_0x4bc5c6[_0x9c31('0x7')]][_0x9c31('0x3f')];}}}catch(_0x4a65b3){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')]('[%s][calls][musiconholdstop]',_0x4bc5c6[_0x9c31('0x7')]),_0x4a65b3);}};exports['varset']=function(_0x59683a){try{if(!_[_0x9c31('0x21')](channels[_0x59683a['uniqueid']])){utils['debug'](util[_0x9c31('0x9')](_0x9c31('0x44'),_0x59683a[_0x9c31('0x7')]),_0x59683a);if(!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')]['xmd-originatecalleridnum'])){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x46'),_0x59683a[_0x9c31('0x7')],_0x59683a['value']));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x47')]=_0x59683a[_0x9c31('0x48')];}if(!_['isNil'](_0x59683a[_0x9c31('0x45')]['xmd-phone'])){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x49'),_0x59683a['uniqueid'],_0x59683a[_0x9c31('0x48')]));channels[_0x59683a['uniqueid']][_0x9c31('0x4a')]=_0x59683a[_0x9c31('0x48')];channels[_0x59683a[_0x9c31('0x7')]]['callerid']='\x22'+_0x59683a[_0x9c31('0x48')]+'\x22\x20<'+_0x59683a['value']+'>';}if(!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')]['xmd-callerid-preview'])||!_['isNil'](_0x59683a[_0x9c31('0x45')][_0x9c31('0x4b')])){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x4c'),_0x59683a[_0x9c31('0x7')],!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')]['xmd-callerid-preview'])?_0x9c31('0x4d'):_0x9c31('0x4b'),_0x59683a[_0x9c31('0x48')]));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x2b')]=_0x59683a['value'];}if(!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')]['xmd-queue'])||!_[_0x9c31('0x21')](_0x59683a['variable'][_0x9c31('0x4e')])){utils['info'](util[_0x9c31('0x9')](_0x9c31('0x4c'),_0x59683a['uniqueid'],!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')][_0x9c31('0x4f')])?_0x9c31('0x4f'):_0x9c31('0x4e'),_0x59683a[_0x9c31('0x48')]));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x50')]=_0x9c31('0x51');channels[_0x59683a['uniqueid']]['lastdata']=_0x59683a[_0x9c31('0x48')];channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x52')]=!![];}if(!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')]['xmd-contactid'])){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x53'),_0x59683a['uniqueid'],_0x59683a[_0x9c31('0x48')]));channels[_0x59683a['uniqueid']][_0x9c31('0x54')]=_0x59683a[_0x9c31('0x48')];}if(!_[_0x9c31('0x21')](_0x59683a['variable'][_0x9c31('0x55')])){utils['info'](util[_0x9c31('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x59683a['uniqueid'],_0x59683a[_0x9c31('0x48')]));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x56')]=_0x59683a[_0x9c31('0x48')];}if(!_[_0x9c31('0x21')](_0x59683a['variable']['outboundrouteid'])){utils['info'](util[_0x9c31('0x9')](_0x9c31('0x57'),_0x59683a['uniqueid'],_0x59683a[_0x9c31('0x48')]));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x58')]=_0x59683a[_0x9c31('0x48')];}if(!_[_0x9c31('0x21')](_0x59683a[_0x9c31('0x45')][_0x9c31('0x59')])){utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x5a'),_0x59683a[_0x9c31('0x7')],_0x59683a[_0x9c31('0x48')]));channels[_0x59683a[_0x9c31('0x7')]][_0x9c31('0x59')]=_0x59683a[_0x9c31('0x48')];}}}catch(_0xdfc740){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')](_0x9c31('0x44'),_0x59683a[_0x9c31('0x7')]),_0xdfc740);}};exports[_0x9c31('0x5b')]=function(_0x4d86bd){try{if(!_[_0x9c31('0x21')](channels[_0x4d86bd[_0x9c31('0x7')]])){utils['debug'](util['format'](_0x9c31('0x5c'),_0x4d86bd[_0x9c31('0x7')]),_0x4d86bd);utils[_0x9c31('0x8')](util[_0x9c31('0x9')](_0x9c31('0x5d'),_0x4d86bd['uniqueid'],_0x4d86bd[_0x9c31('0x5e')],_0x4d86bd[_0x9c31('0x5f')]));if(_0x4d86bd[_0x9c31('0x5e')][_0x9c31('0x60')]()==_0x9c31('0x61')&&_[_0x9c31('0x62')](_0x4d86bd[_0x9c31('0x5f')][_0x9c31('0x60')](),'cdr')){var _0x44ca5a=_0x4d86bd[_0x9c31('0x5f')]['split']('=');var _0xccc86a=_0x44ca5a[0x0][_0x9c31('0x63')](_0x44ca5a[0x0][_0x9c31('0x64')]('(')+0x1,_0x44ca5a[0x0]['lastIndexOf'](')'));var _0x3d5ae3=_0x44ca5a[0x1];channels[_0x4d86bd[_0x9c31('0x7')]][_0xccc86a]=_0x3d5ae3;}if(!_[_0x9c31('0x65')]([_0x9c31('0x2a'),_0x9c31('0x66'),'execif',_0x9c31('0x61'),_0x9c31('0x67')],_0x4d86bd['application'][_0x9c31('0x60')]())){channels[_0x4d86bd[_0x9c31('0x7')]][_0x9c31('0x50')]=_0x4d86bd[_0x9c31('0x5e')];channels[_0x4d86bd['uniqueid']][_0x9c31('0x68')]=_0x4d86bd[_0x9c31('0x5f')];}}}catch(_0xc620d1){utils[_0x9c31('0x1c')](util[_0x9c31('0x9')]('[%s][calls][newexten]',_0x4d86bd[_0x9c31('0x7')]),_0xc620d1);}}; \ No newline at end of file +var _0x04cc=['systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','routeid','sipcallid','newexten','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','execif','set','gotoif','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0x04cc,0x11a));var _0xc04c=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x04cc[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var utils=require(_0xc04c('0x2'));var transfers=require(_0xc04c('0x3'));var dispositions=['NO\x20ANSWER',_0xc04c('0x4'),'FAILED','NO\x20ANSWER',_0xc04c('0x5'),_0xc04c('0x5'),_0xc04c('0x6'),_0xc04c('0x7'),_0xc04c('0x4'),_0xc04c('0x4'),_0xc04c('0x4')];var channels={};function writeDB(_0x5a6076){var _0x422430;if(transfers[_0xc04c('0x8')][_0x5a6076[_0xc04c('0x9')]]){_0x422430=_0x5a6076[_0xc04c('0x9')];_0x5a6076[_0xc04c('0x9')]=transfers[_0xc04c('0x8')][_0x5a6076[_0xc04c('0x9')]][_0xc04c('0xa')];}utils['info'](util['format'](_0xc04c('0xb'),_0x5a6076[_0xc04c('0x9')],_0x5a6076[_0xc04c('0xc')],_0x5a6076[_0xc04c('0xd')],_0x5a6076[_0xc04c('0xe')],_0x5a6076[_0xc04c('0xf')],_0x5a6076[_0xc04c('0x10')],_0x5a6076['connectedlinenum'],_0x5a6076['lastevent']));if(_0x5a6076[_0xc04c('0x11')]){utils['getUserByInternal'](_0x5a6076[_0xc04c('0x11')])[_0xc04c('0x12')](function(_0x27a3f8){if(_0x27a3f8){_0x5a6076[_0xc04c('0x13')]=_0x27a3f8['id'];}utils['request'](_0xc04c('0x14'),_0x5a6076);});}else{utils[_0xc04c('0x15')](_0xc04c('0x14'),_0x5a6076);}if(channels[_0x5a6076[_0xc04c('0x9')]]){delete channels[_0x5a6076['uniqueid']];}else if(_0x422430&&channels[_0x422430]){if(!transfers['blinds'][_0x422430]['recording'])delete transfers[_0xc04c('0x8')][_0x422430];delete channels[_0x422430];}}exports[_0xc04c('0x16')]=function(_0x5b58b5){try{utils[_0xc04c('0x17')](util['format'](_0xc04c('0x18'),_0x5b58b5[_0xc04c('0x9')]),_0x5b58b5);if(_0x5b58b5['uniqueid']==_0x5b58b5[_0xc04c('0x19')]&&_0x5b58b5[_0xc04c('0xc')]!=_0xc04c('0x1a')){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x1d'),_0x5b58b5[_0xc04c('0x9')],_0x5b58b5[_0xc04c('0x1e')],_0x5b58b5[_0xc04c('0x1f')]));channels[_0x5b58b5[_0xc04c('0x9')]]={'uniqueid':_0x5b58b5[_0xc04c('0x9')],'accountcode':_0x5b58b5['accountcode'],'source':_0x5b58b5[_0xc04c('0x10')],'destination':_0x5b58b5[_0xc04c('0x1f')],'destinationcontext':_0x5b58b5[_0xc04c('0x1e')],'channel':_0x5b58b5[_0xc04c('0xc')],'starttime':utils[_0xc04c('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc04c('0x5'),'amaflags':_0xc04c('0x21')};}}catch(_0x244e80){utils[_0xc04c('0x22')](util[_0xc04c('0x1c')]('[%s][calls][newchannel]',_0x5b58b5[_0xc04c('0x9')]),_0x244e80);}};exports['newstate']=function(_0x275d83){try{utils[_0xc04c('0x17')](util[_0xc04c('0x1c')](_0xc04c('0x23'),_0x275d83[_0xc04c('0x9')]),_0x275d83);if(!_['isNil'](channels[_0x275d83[_0xc04c('0x9')]])&&_0x275d83[_0xc04c('0x24')]==0x6){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x25'),_0x275d83['uniqueid'],_0x275d83[_0xc04c('0x1e')],_0x275d83[_0xc04c('0xc')]));if(_[_0xc04c('0x26')](channels[_0x275d83['uniqueid']][_0xc04c('0x27')])){channels[_0x275d83['uniqueid']][_0xc04c('0x27')]=utils[_0xc04c('0x20')]();}}else if(!_[_0xc04c('0x26')](channels[_0x275d83['linkedid']])&&_0x275d83[_0xc04c('0x24')]==0x6&&_0x275d83['context']!=_0xc04c('0x28')){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x29'),_0x275d83[_0xc04c('0x9')],_0x275d83['linkedid'],_0x275d83[_0xc04c('0x1e')],_0x275d83['channel']));channels[_0x275d83[_0xc04c('0x19')]]['accountcode']=_0x275d83['accountcode'];channels[_0x275d83['linkedid']][_0xc04c('0x2a')]=_0x275d83[_0xc04c('0xc')];if(_['isNil'](channels[_0x275d83['linkedid']][_0xc04c('0x2b')])){channels[_0x275d83[_0xc04c('0x19')]][_0xc04c('0x2b')]=utils[_0xc04c('0x20')]();}channels[_0x275d83['linkedid']][_0xc04c('0x2c')]=dispositions[_[_0xc04c('0x2d')](_0x275d83[_0xc04c('0x24')])]||_0xc04c('0x6');}}catch(_0x2a2460){utils[_0xc04c('0x22')](util[_0xc04c('0x1c')](_0xc04c('0x23'),_0x275d83[_0xc04c('0x9')]),_0x2a2460);}};exports['hangup']=function(_0x326330){try{if(!_[_0xc04c('0x26')](channels[_0x326330[_0xc04c('0x9')]])){utils[_0xc04c('0x17')](util[_0xc04c('0x1c')](_0xc04c('0x2e'),_0x326330['uniqueid']),_0x326330);if(_[_0xc04c('0x26')](channels[_0x326330['uniqueid']]['callerid'])){channels[_0x326330['uniqueid']][_0xc04c('0x2f')]=_0x326330[_0xc04c('0x30')]+'\x20<'+_0x326330[_0xc04c('0x10')]+'>';}utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x31'),_0x326330[_0xc04c('0x9')],channels[_0x326330[_0xc04c('0x9')]]['callerid'],_0x326330[_0xc04c('0x32')]));channels[_0x326330[_0xc04c('0x9')]]['endtime']=utils[_0xc04c('0x20')]();channels[_0x326330[_0xc04c('0x9')]][_0xc04c('0x33')]=utils[_0xc04c('0x34')](channels[_0x326330[_0xc04c('0x9')]][_0xc04c('0x35')],channels[_0x326330[_0xc04c('0x9')]][_0xc04c('0x36')]);channels[_0x326330['uniqueid']][_0xc04c('0x37')]=channels[_0x326330['uniqueid']][_0xc04c('0x2b')]?utils[_0xc04c('0x34')](channels[_0x326330[_0xc04c('0x9')]][_0xc04c('0x35')],channels[_0x326330[_0xc04c('0x9')]][_0xc04c('0x2b')]):0x0;writeDB(channels[_0x326330[_0xc04c('0x9')]]);}}catch(_0x598ad7){utils[_0xc04c('0x22')](util[_0xc04c('0x1c')](_0xc04c('0x2e'),_0x326330[_0xc04c('0x9')]),_0x598ad7);}};exports[_0xc04c('0x38')]=function(_0x42eda4){try{if(!_[_0xc04c('0x26')](channels[_0x42eda4[_0xc04c('0x39')]])){utils[_0xc04c('0x17')](util['format'](_0xc04c('0x3a'),_0x42eda4[_0xc04c('0x3b')]),_0x42eda4);if(channels[_0x42eda4['localtwolinkedid']][_0xc04c('0xc')]==_0x42eda4[_0xc04c('0x3c')]){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x3d'),_0x42eda4[_0xc04c('0x3b')],_0x42eda4[_0xc04c('0x39')],_0x42eda4['secondtransfererchannel']));channels[_0x42eda4[_0xc04c('0x39')]][_0xc04c('0x2a')]=_0x42eda4['secondtransfererchannel'];channels[_0x42eda4[_0xc04c('0x39')]][_0xc04c('0x3e')]=_0xc04c('0x3f');}else if(channels[_0x42eda4[_0xc04c('0x39')]]['channel']=_0x42eda4['transfertargetchannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x42eda4[_0xc04c('0x3b')],_0x42eda4[_0xc04c('0x39')],_0x42eda4['origtransfererchannel']));channels[_0x42eda4[_0xc04c('0x39')]][_0xc04c('0x2a')]=_0x42eda4[_0xc04c('0x40')];channels[_0x42eda4[_0xc04c('0x39')]][_0xc04c('0x3e')]='_attended';}}}catch(_0x4ca728){utils[_0xc04c('0x22')](util[_0xc04c('0x1c')](_0xc04c('0x3a'),_0x42eda4[_0xc04c('0x3b')]),_0x4ca728);}};exports[_0xc04c('0x41')]=function(_0x59f313){try{if(!_[_0xc04c('0x26')](channels[_0x59f313[_0xc04c('0x9')]])){utils[_0xc04c('0x17')](util[_0xc04c('0x1c')](_0xc04c('0x42'),_0x59f313['uniqueid']),_0x59f313);channels[_0x59f313[_0xc04c('0x9')]]['musiconholdstartAt']=utils['now']();utils[_0xc04c('0x1b')](util['format'](_0xc04c('0x43'),_0x59f313['uniqueid'],channels[_0x59f313[_0xc04c('0x9')]][_0xc04c('0x44')]));}}catch(_0x593408){utils[_0xc04c('0x22')](util['format'](_0xc04c('0x42'),_0x59f313[_0xc04c('0x9')]),_0x593408);}};exports[_0xc04c('0x45')]=function(_0x2cc72d){try{if(!_[_0xc04c('0x26')](channels[_0x2cc72d[_0xc04c('0x9')]])){utils[_0xc04c('0x17')](util['format'](_0xc04c('0x46'),_0x2cc72d[_0xc04c('0x9')]),_0x2cc72d);if(!_[_0xc04c('0x26')](channels[_0x2cc72d[_0xc04c('0x9')]][_0xc04c('0x44')])){channels[_0x2cc72d[_0xc04c('0x9')]][_0xc04c('0x47')]+=utils[_0xc04c('0x34')](utils[_0xc04c('0x20')](),channels[_0x2cc72d['uniqueid']]['musiconholdstartAt']);utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x48'),_0x2cc72d['uniqueid'],channels[_0x2cc72d[_0xc04c('0x9')]][_0xc04c('0x47')]));delete channels[_0x2cc72d[_0xc04c('0x9')]][_0xc04c('0x44')];}}}catch(_0xf3ff03){utils[_0xc04c('0x22')](util['format'](_0xc04c('0x46'),_0x2cc72d[_0xc04c('0x9')]),_0xf3ff03);}};exports[_0xc04c('0x49')]=function(_0x1cafcb){try{if(!_[_0xc04c('0x26')](channels[_0x1cafcb['uniqueid']])){utils['debug'](util[_0xc04c('0x1c')](_0xc04c('0x4a'),_0x1cafcb[_0xc04c('0x9')]),_0x1cafcb);if(!_['isNil'](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x4c')])){utils[_0xc04c('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1cafcb[_0xc04c('0x9')],_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb['uniqueid']]['source']=_0x1cafcb[_0xc04c('0x4d')];}if(!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x4e')])){utils[_0xc04c('0x1b')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1cafcb[_0xc04c('0x9')],_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x4f')]=_0x1cafcb[_0xc04c('0x4d')];channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x2f')]='\x22'+_0x1cafcb['value']+_0xc04c('0x50')+_0x1cafcb[_0xc04c('0x4d')]+'>';}if(!_['isNil'](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x51')])||!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x52')])){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x53'),_0x1cafcb[_0xc04c('0x9')],!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')]['xmd-callerid-preview'])?_0xc04c('0x51'):_0xc04c('0x52'),_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x2f')]=_0x1cafcb[_0xc04c('0x4d')];}if(!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')]['xmd-queue'])||!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')]['xmcs-queue'])){utils[_0xc04c('0x1b')](util['format'](_0xc04c('0x53'),_0x1cafcb[_0xc04c('0x9')],!_['isNil'](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x54')])?'xmd-queue':'xmcs-queue',_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb['uniqueid']]['lastapplication']=_0xc04c('0x55');channels[_0x1cafcb['uniqueid']][_0xc04c('0x56')]=_0x1cafcb['value'];channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0xd')]=!![];}if(!_['isNil'](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x57')])){utils['info'](util[_0xc04c('0x1c')](_0xc04c('0x58'),_0x1cafcb[_0xc04c('0x9')],_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x59')]=_0x1cafcb[_0xc04c('0x4d')];}if(!_[_0xc04c('0x26')](_0x1cafcb['variable'][_0xc04c('0x5a')])){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')](_0xc04c('0x5b'),_0x1cafcb[_0xc04c('0x9')],_0x1cafcb['value']));channels[_0x1cafcb[_0xc04c('0x9')]]['type']=_0x1cafcb[_0xc04c('0x4d')];}if(!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')]['outboundrouteid'])){utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x1cafcb[_0xc04c('0x9')],_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x5c')]=_0x1cafcb[_0xc04c('0x4d')];}if(!_[_0xc04c('0x26')](_0x1cafcb[_0xc04c('0x4b')][_0xc04c('0x5d')])){utils[_0xc04c('0x1b')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1cafcb[_0xc04c('0x9')],_0x1cafcb[_0xc04c('0x4d')]));channels[_0x1cafcb[_0xc04c('0x9')]][_0xc04c('0x5d')]=_0x1cafcb['value'];}}}catch(_0x2f6c64){utils['error'](util[_0xc04c('0x1c')]('[%s][calls][varset]',_0x1cafcb[_0xc04c('0x9')]),_0x2f6c64);}};exports[_0xc04c('0x5e')]=function(_0xa33200){try{if(!_[_0xc04c('0x26')](channels[_0xa33200[_0xc04c('0x9')]])){utils[_0xc04c('0x17')](util['format']('[%s][calls][newexten]',_0xa33200['uniqueid']),_0xa33200);utils[_0xc04c('0x1b')](util[_0xc04c('0x1c')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0xa33200[_0xc04c('0x9')],_0xa33200[_0xc04c('0x5f')],_0xa33200[_0xc04c('0x60')]));if(_0xa33200[_0xc04c('0x5f')][_0xc04c('0x61')]()=='set'&&_[_0xc04c('0x62')](_0xa33200['appdata'][_0xc04c('0x61')](),_0xc04c('0x63'))){var _0x2d1424=_0xa33200[_0xc04c('0x60')][_0xc04c('0x64')]('=');var _0x9e7406=_0x2d1424[0x0][_0xc04c('0x65')](_0x2d1424[0x0]['lastIndexOf']('(')+0x1,_0x2d1424[0x0][_0xc04c('0x66')](')'));var _0x54a4cc=_0x2d1424[0x1];channels[_0xa33200[_0xc04c('0x9')]][_0x9e7406]=_0x54a4cc;}if(!_[_0xc04c('0x67')](['hangup','noop',_0xc04c('0x68'),_0xc04c('0x69'),_0xc04c('0x6a')],_0xa33200[_0xc04c('0x5f')][_0xc04c('0x61')]())){channels[_0xa33200[_0xc04c('0x9')]]['lastapplication']=_0xa33200['application'];channels[_0xa33200[_0xc04c('0x9')]]['lastdata']=_0xa33200[_0xc04c('0x60')];}}}catch(_0x40b241){utils['error'](util[_0xc04c('0x1c')]('[%s][calls][newexten]',_0xa33200[_0xc04c('0x9')]),_0x40b241);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index dad0c14..c897d63 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 _0x16dc=['connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0xbcc991,_0x4a7430){var _0x2a2219=function(_0x58c8a9){while(--_0x58c8a9){_0xbcc991['push'](_0xbcc991['shift']());}};_0x2a2219(++_0x4a7430);}(_0x16dc,0x1ef));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require('./utils');exports[_0xc16d('0x0')]=function(){utils[_0xc16d('0x1')](_0xc16d('0x2'));};exports['shutdown']=function(){utils['info'](_0xc16d('0x3'));};exports[_0xc16d('0x4')]=function(){utils[_0xc16d('0x1')]('[core]\x20fullybooted');};exports[_0xc16d('0x5')]=function(_0x2f77c7){utils[_0xc16d('0x5')](_0xc16d('0x6'),_0x2f77c7);};exports[_0xc16d('0x7')]=function(){utils[_0xc16d('0x1')](_0xc16d('0x8'));};exports['managerevent']=function(_0x37c14b){}; \ No newline at end of file +var _0x49df=['close','managerevent','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error'];(function(_0x1ed78f,_0x5ab61b){var _0x46f620=function(_0x44276e){while(--_0x44276e){_0x1ed78f['push'](_0x1ed78f['shift']());}};_0x46f620(++_0x5ab61b);}(_0x49df,0xad));var _0xf49d=function(_0x3e1353,_0x138834){_0x3e1353=_0x3e1353-0x0;var _0x2e6cae=_0x49df[_0x3e1353];return _0x2e6cae;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0xf49d('0x0')](_0xf49d('0x1'));};exports[_0xf49d('0x2')]=function(){utils[_0xf49d('0x0')](_0xf49d('0x3'));};exports[_0xf49d('0x4')]=function(){utils[_0xf49d('0x0')]('[core]\x20fullybooted');};exports[_0xf49d('0x5')]=function(_0x3d0e09){utils[_0xf49d('0x5')](_0xf49d('0x6'),_0x3d0e09);};exports[_0xf49d('0x7')]=function(){utils[_0xf49d('0x0')]('[core]\x20close');};exports[_0xf49d('0x8')]=function(_0x36ed1d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 82768d2..2ce4c94 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 _0xc21b=['calleridnum','request','newexten','debug','info','application','appdata','toLowerCase','startsWith','split','error','[%s][dials][newexten]','varset','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','isNil','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','holdtime','diffTime','util','./utils','format','uniqueid','channel','dialstring'];(function(_0x58f555,_0x552ef2){var _0x4eb99b=function(_0x110a86){while(--_0x110a86){_0x58f555['push'](_0x58f555['shift']());}};_0x4eb99b(++_0x552ef2);}(_0xc21b,0x84));var _0xbc21=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0xc21b[_0x8a7e38];return _0x228609;};'use strict';var _=require('lodash');var util=require(_0xbc21('0x0'));var utils=require(_0xbc21('0x1'));var dials={};function writeDB(_0x574328){utils['info'](util[_0xbc21('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x574328[_0xbc21('0x3')],_0x574328[_0xbc21('0x4')],_0x574328[_0xbc21('0x5')],_0x574328[_0xbc21('0x6')],_0x574328['connectedlinenum'],_0x574328['dialstatus']));utils[_0xbc21('0x7')]('CreateVoiceDialReport',_0x574328);delete dials[_0x574328[_0xbc21('0x3')]];}exports[_0xbc21('0x8')]=function(_0x3f7d4a){try{utils[_0xbc21('0x9')](util[_0xbc21('0x2')]('[%s][dials][newexten]',_0x3f7d4a[_0xbc21('0x3')]),_0x3f7d4a);utils[_0xbc21('0xa')](util[_0xbc21('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3f7d4a[_0xbc21('0x3')],_0x3f7d4a[_0xbc21('0xb')],_0x3f7d4a[_0xbc21('0xc')]));if(_0x3f7d4a['application'][_0xbc21('0xd')]()=='set'&&_[_0xbc21('0xe')](_0x3f7d4a[_0xbc21('0xc')][_0xbc21('0xd')](),'cdr(routeid)')){var _0xfe9f4b=_0x3f7d4a[_0xbc21('0xc')][_0xbc21('0xf')]('=');dials[_0x3f7d4a['uniqueid']]={'routeId':_0xfe9f4b[0x1]};}}catch(_0x1c81b0){utils[_0xbc21('0x10')](util[_0xbc21('0x2')](_0xbc21('0x11'),_0x3f7d4a['uniqueid']),_0x1c81b0);}};exports[_0xbc21('0x12')]=function(_0x39149e){try{utils[_0xbc21('0x9')](util[_0xbc21('0x2')]('[%s][dials][varset]',_0x39149e[_0xbc21('0x3')]),_0x39149e);if(!_['isNil'](_0x39149e[_0xbc21('0x13')]['outboundrouteid'])){utils[_0xbc21('0xa')](util[_0xbc21('0x2')](_0xbc21('0x14'),_0x39149e[_0xbc21('0x3')],_0x39149e[_0xbc21('0x15')]));dials[_0x39149e[_0xbc21('0x3')]]={'routeId':_0x39149e[_0xbc21('0x15')]};}}catch(_0x20e240){utils[_0xbc21('0x10')](util[_0xbc21('0x2')](_0xbc21('0x16'),_0x39149e[_0xbc21('0x3')]),_0x20e240);}};exports['dialbegin']=function(_0x52d048){try{if(!_[_0xbc21('0x17')](dials[_0x52d048['uniqueid']])){utils[_0xbc21('0x9')](util[_0xbc21('0x2')]('[%s][dials][dialbegin]',_0x52d048[_0xbc21('0x3')]),_0x52d048);dials[_0x52d048['uniqueid']]=_[_0xbc21('0x18')](dials[_0x52d048[_0xbc21('0x3')]],_0x52d048);dials[_0x52d048[_0xbc21('0x3')]][_0xbc21('0x19')]=utils[_0xbc21('0x1a')]();dials[_0x52d048[_0xbc21('0x3')]][_0xbc21('0x1b')]=_0xbc21('0x1c');utils[_0xbc21('0xa')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x52d048[_0xbc21('0x3')],dials[_0x52d048[_0xbc21('0x3')]][_0xbc21('0x19')]));}}catch(_0x492a61){utils['error'](util[_0xbc21('0x2')](_0xbc21('0x1d'),_0x52d048[_0xbc21('0x3')]),_0x492a61);}};exports[_0xbc21('0x1e')]=function(_0x14cced){try{if(!_[_0xbc21('0x17')](dials[_0x14cced[_0xbc21('0x3')]])){utils[_0xbc21('0x9')](util['format'](_0xbc21('0x1f'),_0x14cced[_0xbc21('0x3')]),_0x14cced);dials[_0x14cced['uniqueid']][_0xbc21('0x20')]=_0x14cced[_0xbc21('0x20')];if(_0x14cced[_0xbc21('0x20')]==_0xbc21('0x21')){dials[_0x14cced['uniqueid']]=_[_0xbc21('0x18')](dials[_0x14cced[_0xbc21('0x3')]],_0x14cced);dials[_0x14cced[_0xbc21('0x3')]][_0xbc21('0x22')]=utils[_0xbc21('0x1a')]();dials[_0x14cced[_0xbc21('0x3')]][_0xbc21('0x1b')]=_0xbc21('0x23');utils[_0xbc21('0xa')](util[_0xbc21('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x14cced[_0xbc21('0x3')],_0x14cced[_0xbc21('0x20')],dials[_0x14cced[_0xbc21('0x3')]][_0xbc21('0x22')]));}else{utils[_0xbc21('0xa')](util[_0xbc21('0x2')](_0xbc21('0x24'),_0x14cced['uniqueid'],_0x14cced['dialstatus']));}}}catch(_0xfe72bc){utils[_0xbc21('0x10')](util[_0xbc21('0x2')](_0xbc21('0x1f'),_0x14cced[_0xbc21('0x3')]),_0xfe72bc);}};exports[_0xbc21('0x25')]=function(_0x53f588){try{if(!_['isNil'](dials[_0x53f588['uniqueid']])){utils[_0xbc21('0x9')](util[_0xbc21('0x2')](_0xbc21('0x26'),_0x53f588[_0xbc21('0x3')]),_0x53f588);utils['info'](util[_0xbc21('0x2')](_0xbc21('0x27'),_0x53f588[_0xbc21('0x3')],_0x53f588['calleridnum'],_0x53f588[_0xbc21('0x28')],_0x53f588[_0xbc21('0x29')]));dials[_0x53f588['uniqueid']]=_[_0xbc21('0x18')](dials[_0x53f588[_0xbc21('0x3')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x53f588[_0xbc21('0x3')]][_0xbc21('0x2a')]=utils['diffTime'](dials[_0x53f588[_0xbc21('0x3')]][_0xbc21('0x2b')],dials[_0x53f588[_0xbc21('0x3')]][_0xbc21('0x19')]);dials[_0x53f588['uniqueid']][_0xbc21('0x2c')]=utils[_0xbc21('0x2d')](dials[_0x53f588[_0xbc21('0x3')]][_0xbc21('0x22')]||dials[_0x53f588[_0xbc21('0x3')]]['endtime'],dials[_0x53f588['uniqueid']][_0xbc21('0x19')]);dials[_0x53f588[_0xbc21('0x3')]]['billableseconds']=dials[_0x53f588[_0xbc21('0x3')]]['answertime']?utils[_0xbc21('0x2d')](dials[_0x53f588['uniqueid']]['endtime'],dials[_0x53f588[_0xbc21('0x3')]][_0xbc21('0x22')]):0x0;writeDB(dials[_0x53f588['uniqueid']]);}}catch(_0xccd09e){utils['error'](util[_0xbc21('0x2')]('[%s][dials][hangup]',_0x53f588['uniqueid']),_0xccd09e);}}; \ No newline at end of file +var _0xfc7f=['[%s][dials][dialend]','dialstatus','assign','answertime','now','lastevent','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','uniqueid','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','error','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x65f016,_0x5b3240){var _0x310610=function(_0xe23262){while(--_0xe23262){_0x65f016['push'](_0x65f016['shift']());}};_0x310610(++_0x5b3240);}(_0xfc7f,0x1dc));var _0xffc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xffc7('0x0'));var util=require('util');var utils=require(_0xffc7('0x1'));var dials={};function writeDB(_0x1f3292){utils[_0xffc7('0x2')](util[_0xffc7('0x3')](_0xffc7('0x4'),_0x1f3292['uniqueid'],_0x1f3292[_0xffc7('0x5')],_0x1f3292['dialstring'],_0x1f3292[_0xffc7('0x6')],_0x1f3292[_0xffc7('0x7')],_0x1f3292['dialstatus']));utils['request'](_0xffc7('0x8'),_0x1f3292);delete dials[_0x1f3292['uniqueid']];}exports[_0xffc7('0x9')]=function(_0x2aae51){try{utils[_0xffc7('0xa')](util[_0xffc7('0x3')]('[%s][dials][newexten]',_0x2aae51[_0xffc7('0xb')]),_0x2aae51);utils[_0xffc7('0x2')](util[_0xffc7('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2aae51[_0xffc7('0xb')],_0x2aae51['application'],_0x2aae51[_0xffc7('0xc')]));if(_0x2aae51[_0xffc7('0xd')]['toLowerCase']()==_0xffc7('0xe')&&_[_0xffc7('0xf')](_0x2aae51[_0xffc7('0xc')][_0xffc7('0x10')](),_0xffc7('0x11'))){var _0x3b3674=_0x2aae51[_0xffc7('0xc')][_0xffc7('0x12')]('=');dials[_0x2aae51[_0xffc7('0xb')]]={'routeId':_0x3b3674[0x1]};}}catch(_0xaab9e){utils[_0xffc7('0x13')](util[_0xffc7('0x3')]('[%s][dials][newexten]',_0x2aae51['uniqueid']),_0xaab9e);}};exports['varset']=function(_0x19416a){try{utils[_0xffc7('0xa')](util[_0xffc7('0x3')]('[%s][dials][varset]',_0x19416a[_0xffc7('0xb')]),_0x19416a);if(!_[_0xffc7('0x14')](_0x19416a['variable'][_0xffc7('0x15')])){utils['info'](util[_0xffc7('0x3')](_0xffc7('0x16'),_0x19416a[_0xffc7('0xb')],_0x19416a[_0xffc7('0x17')]));dials[_0x19416a[_0xffc7('0xb')]]={'routeId':_0x19416a[_0xffc7('0x17')]};}}catch(_0x5f07d3){utils[_0xffc7('0x13')](util[_0xffc7('0x3')]('[%s][dials][varset]',_0x19416a[_0xffc7('0xb')]),_0x5f07d3);}};exports[_0xffc7('0x18')]=function(_0x3b02a4){try{if(!_[_0xffc7('0x14')](dials[_0x3b02a4['uniqueid']])){utils[_0xffc7('0xa')](util['format'](_0xffc7('0x19'),_0x3b02a4['uniqueid']),_0x3b02a4);dials[_0x3b02a4[_0xffc7('0xb')]]=_['assign'](dials[_0x3b02a4[_0xffc7('0xb')]],_0x3b02a4);dials[_0x3b02a4['uniqueid']][_0xffc7('0x1a')]=utils['now']();dials[_0x3b02a4[_0xffc7('0xb')]]['lastevent']=_0xffc7('0x1b');utils[_0xffc7('0x2')](util[_0xffc7('0x3')](_0xffc7('0x1c'),_0x3b02a4['uniqueid'],dials[_0x3b02a4['uniqueid']]['starttime']));}}catch(_0x161150){utils[_0xffc7('0x13')](util[_0xffc7('0x3')](_0xffc7('0x19'),_0x3b02a4['uniqueid']),_0x161150);}};exports[_0xffc7('0x1d')]=function(_0x3223cd){try{if(!_[_0xffc7('0x14')](dials[_0x3223cd['uniqueid']])){utils[_0xffc7('0xa')](util['format'](_0xffc7('0x1e'),_0x3223cd['uniqueid']),_0x3223cd);dials[_0x3223cd['uniqueid']]['dialstatus']=_0x3223cd['dialstatus'];if(_0x3223cd[_0xffc7('0x1f')]=='ANSWER'){dials[_0x3223cd[_0xffc7('0xb')]]=_[_0xffc7('0x20')](dials[_0x3223cd[_0xffc7('0xb')]],_0x3223cd);dials[_0x3223cd[_0xffc7('0xb')]][_0xffc7('0x21')]=utils[_0xffc7('0x22')]();dials[_0x3223cd[_0xffc7('0xb')]][_0xffc7('0x23')]='connect';utils[_0xffc7('0x2')](util[_0xffc7('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3223cd['uniqueid'],_0x3223cd['dialstatus'],dials[_0x3223cd['uniqueid']][_0xffc7('0x21')]));}else{utils['info'](util[_0xffc7('0x3')](_0xffc7('0x24'),_0x3223cd['uniqueid'],_0x3223cd['dialstatus']));}}}catch(_0x38f6c9){utils[_0xffc7('0x13')](util[_0xffc7('0x3')](_0xffc7('0x1e'),_0x3223cd[_0xffc7('0xb')]),_0x38f6c9);}};exports[_0xffc7('0x25')]=function(_0x28834f){try{if(!_[_0xffc7('0x14')](dials[_0x28834f[_0xffc7('0xb')]])){utils['debug'](util[_0xffc7('0x3')](_0xffc7('0x26'),_0x28834f[_0xffc7('0xb')]),_0x28834f);utils['info'](util['format'](_0xffc7('0x27'),_0x28834f[_0xffc7('0xb')],_0x28834f[_0xffc7('0x6')],_0x28834f['calleridname'],_0x28834f[_0xffc7('0x28')]));dials[_0x28834f[_0xffc7('0xb')]]=_[_0xffc7('0x20')](dials[_0x28834f[_0xffc7('0xb')]],{'endtime':utils[_0xffc7('0x22')](),'lastevent':_0xffc7('0x29')});dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x2a')]=utils[_0xffc7('0x2b')](dials[_0x28834f['uniqueid']][_0xffc7('0x2c')],dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x1a')]);dials[_0x28834f['uniqueid']][_0xffc7('0x2d')]=utils[_0xffc7('0x2b')](dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x21')]||dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x2c')],dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x1a')]);dials[_0x28834f[_0xffc7('0xb')]]['billableseconds']=dials[_0x28834f['uniqueid']][_0xffc7('0x21')]?utils[_0xffc7('0x2b')](dials[_0x28834f['uniqueid']][_0xffc7('0x2c')],dials[_0x28834f[_0xffc7('0xb')]][_0xffc7('0x21')]):0x0;writeDB(dials[_0x28834f['uniqueid']]);}}catch(_0x2dd0be){utils['error'](util[_0xffc7('0x3')](_0xffc7('0x26'),_0x28834f[_0xffc7('0xb')]),_0x2dd0be);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 53f11e1..09ef000 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 _0xd3ef=['[%s][index][agentringnoanswer]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','production','asterisk','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0xd3ef,0x69));var _0xfd3e=function(_0x3e52bc,_0x16a89c){_0x3e52bc=_0x3e52bc-0x0;var _0x8b0f8=_0xd3ef[_0x3e52bc];return _0x8b0f8;};var AsteriskManager=require(_0xfd3e('0x0'));var config=require('../../config/environment');var utils=require(_0xfd3e('0x1'));var util=require(_0xfd3e('0x2'));var isXDREnabled=config[_0xfd3e('0x3')]&&!config['xdr'][_0xfd3e('0x4')];var isProduction=config['env']===_0xfd3e('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0xfd3e('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0xfd3e('0x6')]['ip'],config[_0xfd3e('0x6')][_0xfd3e('0x7')],config[_0xfd3e('0x6')][_0xfd3e('0x8')],!![]);ami[_0xfd3e('0x9')]();if(!isXDREnabled){utils['info'](_0xfd3e('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xfd3e('0xb')](_0xfd3e('0xc'));}else{var agents=require(_0xfd3e('0xd'));var calls=require(_0xfd3e('0xe'));var queues=require('./queues.controller');var recordings=require(_0xfd3e('0xf'));var members=require(_0xfd3e('0x10'));var dials=require('./dials.controller');var transfers=require(_0xfd3e('0x11'));var core=require('./core.controller');ami['on'](_0xfd3e('0x12'),core['connect']);ami['on'](_0xfd3e('0x13'),core[_0xfd3e('0x13')]);ami['on'](_0xfd3e('0x14'),core[_0xfd3e('0x14')]);ami['on']('error',core[_0xfd3e('0x15')]);ami['on']('close',core['close']);ami['on'](_0xfd3e('0x16'),core[_0xfd3e('0x16')]);ami['on'](_0xfd3e('0x17'),function(_0x500ead){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x1a'),_0x500ead['device']),_0x500ead);members['devicestatechange'](_0x500ead);}catch(_0x4d25df){utils[_0xfd3e('0x15')](util['format']('[%s][index][devicestatechange]',_0x500ead[_0xfd3e('0x1b')]),_0x4d25df);}});ami['on'](_0xfd3e('0x1c'),function(_0x43275a){try{utils[_0xfd3e('0x18')](util['format'](_0xfd3e('0x1d'),_0x43275a[_0xfd3e('0x1e')]),_0x43275a);agents[_0xfd3e('0x1c')](_0x43275a);}catch(_0x262fb2){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x1d'),_0x43275a['uniqueid']),_0x262fb2);}});ami['on']('agentringnoanswer',function(_0x3798aa){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x1f'),_0x3798aa[_0xfd3e('0x1e')]),_0x3798aa);agents[_0xfd3e('0x20')](_0x3798aa);}catch(_0x201c29){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x1f'),_0x3798aa['uniqueid']),_0x201c29);}});ami['on']('agentconnect',function(_0x2e74ab){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x21'),_0x2e74ab['uniqueid']),_0x2e74ab);agents['agentconnect'](_0x2e74ab);queues[_0xfd3e('0x22')](_0x2e74ab);}catch(_0x58bbad){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x21'),_0x2e74ab[_0xfd3e('0x1e')]),_0x58bbad);}});ami['on'](_0xfd3e('0x23'),function(_0xdee5e1){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x24'),_0xdee5e1['uniqueid']),_0xdee5e1);agents[_0xfd3e('0x23')](_0xdee5e1);queues[_0xfd3e('0x23')](_0xdee5e1);members[_0xfd3e('0x23')](_0xdee5e1);}catch(_0x35556d){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x24'),_0xdee5e1[_0xfd3e('0x1e')]),_0x35556d);}});ami['on'](_0xfd3e('0x25'),function(_0x1a2b9){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x26'),_0x1a2b9[_0xfd3e('0x1e')]),_0x1a2b9);agents[_0xfd3e('0x25')](_0x1a2b9);queues['queuecallerabandon'](_0x1a2b9);}catch(_0x19ce1e){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x26'),_0x1a2b9[_0xfd3e('0x1e')]),_0x19ce1e);}});ami['on']('queuecallerjoin',function(_0x3b9f02){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x27'),_0x3b9f02['uniqueid']),_0x3b9f02);queues['queuecallerjoin'](_0x3b9f02);recordings[_0xfd3e('0x28')](_0x3b9f02);}catch(_0x1f70b1){utils['error'](util[_0xfd3e('0x19')](_0xfd3e('0x27'),_0x3b9f02[_0xfd3e('0x1e')]),_0x1f70b1);}});ami['on']('queuecallerleave',function(_0x119dbe){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x29'),_0x119dbe['uniqueid']),_0x119dbe);queues[_0xfd3e('0x2a')](_0x119dbe);}catch(_0x159254){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x29'),_0x119dbe[_0xfd3e('0x1e')]),_0x159254);}});ami['on'](_0xfd3e('0x2b'),function(_0x381ce6){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x2c'),_0x381ce6[_0xfd3e('0x1e')]),_0x381ce6);queues['musiconholdstart'](_0x381ce6);calls[_0xfd3e('0x2b')](_0x381ce6);}catch(_0x5240e7){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x2c'),_0x381ce6['uniqueid']),_0x5240e7);}});ami['on'](_0xfd3e('0x2d'),function(_0x35abc4){try{utils[_0xfd3e('0x18')](util['format'](_0xfd3e('0x2e'),_0x35abc4[_0xfd3e('0x1e')]),_0x35abc4);queues[_0xfd3e('0x2d')](_0x35abc4);calls[_0xfd3e('0x2d')](_0x35abc4);}catch(_0x545963){utils['error'](util['format'](_0xfd3e('0x2e'),_0x35abc4[_0xfd3e('0x1e')]),_0x545963);}});ami['on'](_0xfd3e('0x2f'),function(_0x31d1ef){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')]('[%s][index][newstate]',_0x31d1ef[_0xfd3e('0x1e')]),_0x31d1ef);calls[_0xfd3e('0x2f')](_0x31d1ef);recordings[_0xfd3e('0x2f')](_0x31d1ef);}catch(_0x367786){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x30'),_0x31d1ef[_0xfd3e('0x1e')]),_0x367786);}});ami['on'](_0xfd3e('0x31'),function(_0x44f354){try{utils[_0xfd3e('0x18')](util['format'](_0xfd3e('0x32'),_0x44f354[_0xfd3e('0x1e')]),_0x44f354);calls[_0xfd3e('0x31')](_0x44f354);recordings[_0xfd3e('0x31')](_0x44f354);dials['hangup'](_0x44f354);agents['hangup'](_0x44f354);queues['hangup'](_0x44f354);}catch(_0xf15c25){utils['error'](util[_0xfd3e('0x19')](_0xfd3e('0x32'),_0x44f354[_0xfd3e('0x1e')]),_0xf15c25);}});ami['on']('cdr',function(_0x1a2115){try{utils['debug'](util['format'](_0xfd3e('0x33'),_0x1a2115[_0xfd3e('0x1e')]),_0x1a2115);members[_0xfd3e('0x34')](_0x1a2115);}catch(_0x22daad){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')]('[%s][index][cdr]',_0x1a2115[_0xfd3e('0x1e')]),_0x22daad);}});ami['on']('blindtransfer',function(_0x33d1c9){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x35'),_0x33d1c9[_0xfd3e('0x1e')]),_0x33d1c9);queues['blindtransfer'](_0x33d1c9);agents['blindtransfer'](_0x33d1c9);transfers[_0xfd3e('0x36')](_0x33d1c9);recordings[_0xfd3e('0x36')](_0x33d1c9);}catch(_0x3fdc0a){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x35'),_0x33d1c9[_0xfd3e('0x1e')]),_0x3fdc0a);}});ami['on'](_0xfd3e('0x37'),function(_0x1df6a3){try{utils['debug'](util['format'](_0xfd3e('0x38'),_0x1df6a3[_0xfd3e('0x39')]),_0x1df6a3);queues[_0xfd3e('0x37')](_0x1df6a3);transfers[_0xfd3e('0x37')](_0x1df6a3);agents['attendedtransfer'](_0x1df6a3);calls[_0xfd3e('0x37')](_0x1df6a3);}catch(_0x15ad3e){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x38'),_0x1df6a3[_0xfd3e('0x39')]),_0x15ad3e);}});ami['on'](_0xfd3e('0x3a'),function(_0x326bb5){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x3b'),_0x326bb5[_0xfd3e('0x1e')]),_0x326bb5);queues[_0xfd3e('0x3a')](_0x326bb5);recordings[_0xfd3e('0x3a')](_0x326bb5);calls['varset'](_0x326bb5);dials[_0xfd3e('0x3a')](_0x326bb5);}catch(_0x26a4b5){utils[_0xfd3e('0x15')](util[_0xfd3e('0x19')](_0xfd3e('0x3b'),_0x326bb5['uniqueid']),_0x26a4b5);}});ami['on'](_0xfd3e('0x3c'),function(_0x20aefe){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x3d'),_0x20aefe[_0xfd3e('0x1e')]),_0x20aefe);calls[_0xfd3e('0x3c')](_0x20aefe);recordings['newexten'](_0x20aefe);dials[_0xfd3e('0x3c')](_0x20aefe);}catch(_0x23643d){utils[_0xfd3e('0x15')](util['format']('[%s][index][newexten]',_0x20aefe[_0xfd3e('0x1e')]),_0x23643d);}});ami['on'](_0xfd3e('0x3e'),function(_0x1da602){try{utils[_0xfd3e('0x18')](util['format'](_0xfd3e('0x3f'),_0x1da602[_0xfd3e('0x1e')]),_0x1da602);calls[_0xfd3e('0x3e')](_0x1da602);recordings[_0xfd3e('0x3e')](_0x1da602);}catch(_0x57d8a2){utils[_0xfd3e('0x15')](util['format'](_0xfd3e('0x3f'),_0x1da602[_0xfd3e('0x1e')]),_0x57d8a2);}});ami['on'](_0xfd3e('0x40'),function(_0x581d2b){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x41'),_0x581d2b[_0xfd3e('0x1e')]),_0x581d2b);dials[_0xfd3e('0x40')](_0x581d2b);}catch(_0x20df83){utils[_0xfd3e('0x15')](util['format']('[%s]dialbegin',_0x581d2b['uniqueid']),_0x20df83);}});ami['on'](_0xfd3e('0x42'),function(_0x1bcbb9){try{utils[_0xfd3e('0x18')](util[_0xfd3e('0x19')](_0xfd3e('0x43'),_0x1bcbb9[_0xfd3e('0x1e')]),_0x1bcbb9);dials[_0xfd3e('0x42')](_0x1bcbb9);}catch(_0x4334f0){utils['error'](util[_0xfd3e('0x19')](_0xfd3e('0x43'),_0x1bcbb9['uniqueid']),_0x4334f0);}});} \ No newline at end of file +var _0xede7=['password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','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]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','production','local','port','asterisk','username'];(function(_0x850b80,_0x18f9c3){var _0xa626f9=function(_0x1e04a5){while(--_0x1e04a5){_0x850b80['push'](_0x850b80['shift']());}};_0xa626f9(++_0x18f9c3);}(_0xede7,0xcc));var _0x7ede=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0xede7[_0x393500];return _0x120d3b;};var AsteriskManager=require(_0x7ede('0x0'));var config=require('../../config/environment');var utils=require(_0x7ede('0x1'));var util=require(_0x7ede('0x2'));var isXDREnabled=config[_0x7ede('0x3')]&&!config[_0x7ede('0x3')]['disabled'];var isProduction=config['env']===_0x7ede('0x4')||![];var isLocalAsterisk=config[_0x7ede('0x3')]&&config[_0x7ede('0x3')][_0x7ede('0x5')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x7ede('0x6')],config[_0x7ede('0x7')]['ip'],config['asterisk'][_0x7ede('0x8')],config[_0x7ede('0x7')][_0x7ede('0x9')],!![]);ami[_0x7ede('0xa')]();if(!isXDREnabled){utils[_0x7ede('0xb')](_0x7ede('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x7ede('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x7ede('0xe'));var queues=require(_0x7ede('0xf'));var recordings=require(_0x7ede('0x10'));var members=require(_0x7ede('0x11'));var dials=require(_0x7ede('0x12'));var transfers=require('./transfers.controller');var core=require(_0x7ede('0x13'));ami['on'](_0x7ede('0x14'),core[_0x7ede('0x14')]);ami['on'](_0x7ede('0x15'),core[_0x7ede('0x15')]);ami['on'](_0x7ede('0x16'),core['fullybooted']);ami['on'](_0x7ede('0x17'),core[_0x7ede('0x17')]);ami['on'](_0x7ede('0x18'),core['close']);ami['on']('managerevent',core[_0x7ede('0x19')]);ami['on'](_0x7ede('0x1a'),function(_0x316489){try{utils[_0x7ede('0x1b')](util['format'](_0x7ede('0x1c'),_0x316489[_0x7ede('0x1d')]),_0x316489);members[_0x7ede('0x1a')](_0x316489);}catch(_0x2a6fed){utils[_0x7ede('0x17')](util['format'](_0x7ede('0x1c'),_0x316489['device']),_0x2a6fed);}});ami['on']('agentcalled',function(_0x21c2e2){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x1f'),_0x21c2e2[_0x7ede('0x20')]),_0x21c2e2);agents[_0x7ede('0x21')](_0x21c2e2);}catch(_0x526c58){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')](_0x7ede('0x1f'),_0x21c2e2[_0x7ede('0x20')]),_0x526c58);}});ami['on'](_0x7ede('0x22'),function(_0x2e882f){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x23'),_0x2e882f['uniqueid']),_0x2e882f);agents[_0x7ede('0x22')](_0x2e882f);}catch(_0xbda4a5){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')]('[%s][index][agentringnoanswer]',_0x2e882f['uniqueid']),_0xbda4a5);}});ami['on'](_0x7ede('0x24'),function(_0x52c973){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x25'),_0x52c973['uniqueid']),_0x52c973);agents['agentconnect'](_0x52c973);queues[_0x7ede('0x24')](_0x52c973);}catch(_0x32452e){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')]('[%s][index][agentconnect]',_0x52c973['uniqueid']),_0x32452e);}});ami['on'](_0x7ede('0x26'),function(_0x4e7305){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x27'),_0x4e7305['uniqueid']),_0x4e7305);agents[_0x7ede('0x26')](_0x4e7305);queues['agentcomplete'](_0x4e7305);members['agentcomplete'](_0x4e7305);}catch(_0x388b1b){utils['error'](util[_0x7ede('0x1e')](_0x7ede('0x27'),_0x4e7305['uniqueid']),_0x388b1b);}});ami['on'](_0x7ede('0x28'),function(_0x3bd504){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x29'),_0x3bd504[_0x7ede('0x20')]),_0x3bd504);agents[_0x7ede('0x28')](_0x3bd504);queues[_0x7ede('0x28')](_0x3bd504);}catch(_0x5ba381){utils[_0x7ede('0x17')](util['format']('[%s][index][queuecallerabandon]',_0x3bd504[_0x7ede('0x20')]),_0x5ba381);}});ami['on'](_0x7ede('0x2a'),function(_0x3a7a5d){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x2b'),_0x3a7a5d[_0x7ede('0x20')]),_0x3a7a5d);queues[_0x7ede('0x2a')](_0x3a7a5d);recordings[_0x7ede('0x2a')](_0x3a7a5d);}catch(_0x201877){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')](_0x7ede('0x2b'),_0x3a7a5d[_0x7ede('0x20')]),_0x201877);}});ami['on'](_0x7ede('0x2c'),function(_0x1295b3){try{utils[_0x7ede('0x1b')](util['format'](_0x7ede('0x2d'),_0x1295b3['uniqueid']),_0x1295b3);queues[_0x7ede('0x2c')](_0x1295b3);}catch(_0x45f23c){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x1295b3[_0x7ede('0x20')]),_0x45f23c);}});ami['on']('musiconholdstart',function(_0x2182f8){try{utils['debug'](util[_0x7ede('0x1e')](_0x7ede('0x2e'),_0x2182f8[_0x7ede('0x20')]),_0x2182f8);queues['musiconholdstart'](_0x2182f8);calls[_0x7ede('0x2f')](_0x2182f8);}catch(_0x362efa){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')]('[%s][index][musiconholdstart]',_0x2182f8[_0x7ede('0x20')]),_0x362efa);}});ami['on'](_0x7ede('0x30'),function(_0x56553e){try{utils[_0x7ede('0x1b')](util['format'](_0x7ede('0x31'),_0x56553e[_0x7ede('0x20')]),_0x56553e);queues[_0x7ede('0x30')](_0x56553e);calls[_0x7ede('0x30')](_0x56553e);}catch(_0x6c3911){utils['error'](util[_0x7ede('0x1e')](_0x7ede('0x31'),_0x56553e[_0x7ede('0x20')]),_0x6c3911);}});ami['on'](_0x7ede('0x32'),function(_0x51f243){try{utils['debug'](util[_0x7ede('0x1e')](_0x7ede('0x33'),_0x51f243[_0x7ede('0x20')]),_0x51f243);calls[_0x7ede('0x32')](_0x51f243);recordings[_0x7ede('0x32')](_0x51f243);}catch(_0x3cecc9){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')](_0x7ede('0x33'),_0x51f243[_0x7ede('0x20')]),_0x3cecc9);}});ami['on'](_0x7ede('0x34'),function(_0x49d8de){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')]('[%s][index][hangup]',_0x49d8de[_0x7ede('0x20')]),_0x49d8de);calls[_0x7ede('0x34')](_0x49d8de);recordings[_0x7ede('0x34')](_0x49d8de);dials['hangup'](_0x49d8de);agents['hangup'](_0x49d8de);queues[_0x7ede('0x34')](_0x49d8de);}catch(_0xd7b0d3){utils[_0x7ede('0x17')](util['format'](_0x7ede('0x35'),_0x49d8de[_0x7ede('0x20')]),_0xd7b0d3);}});ami['on']('cdr',function(_0x14b6c1){try{utils[_0x7ede('0x1b')](util['format'](_0x7ede('0x36'),_0x14b6c1[_0x7ede('0x20')]),_0x14b6c1);members['cdr'](_0x14b6c1);}catch(_0x1f07fb){utils['error'](util[_0x7ede('0x1e')](_0x7ede('0x36'),_0x14b6c1[_0x7ede('0x20')]),_0x1f07fb);}});ami['on'](_0x7ede('0x37'),function(_0x40fce3){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x38'),_0x40fce3[_0x7ede('0x20')]),_0x40fce3);queues[_0x7ede('0x37')](_0x40fce3);agents[_0x7ede('0x37')](_0x40fce3);transfers[_0x7ede('0x37')](_0x40fce3);recordings[_0x7ede('0x37')](_0x40fce3);}catch(_0x27c1cd){utils[_0x7ede('0x17')](util['format']('[%s][index][blindtransfer]',_0x40fce3[_0x7ede('0x20')]),_0x27c1cd);}});ami['on']('attendedtransfer',function(_0x442bad){try{utils['debug'](util[_0x7ede('0x1e')]('[%s][index][attendedtransfer]',_0x442bad['origtransfereruniqueid']),_0x442bad);queues['attendedtransfer'](_0x442bad);transfers[_0x7ede('0x39')](_0x442bad);agents[_0x7ede('0x39')](_0x442bad);calls[_0x7ede('0x39')](_0x442bad);}catch(_0x871c29){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')](_0x7ede('0x3a'),_0x442bad[_0x7ede('0x3b')]),_0x871c29);}});ami['on'](_0x7ede('0x3c'),function(_0xf2b270){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x3d'),_0xf2b270[_0x7ede('0x20')]),_0xf2b270);queues['varset'](_0xf2b270);recordings[_0x7ede('0x3c')](_0xf2b270);calls[_0x7ede('0x3c')](_0xf2b270);dials['varset'](_0xf2b270);}catch(_0x5336de){utils['error'](util[_0x7ede('0x1e')](_0x7ede('0x3d'),_0xf2b270[_0x7ede('0x20')]),_0x5336de);}});ami['on']('newexten',function(_0x5a709d){try{utils[_0x7ede('0x1b')](util['format'](_0x7ede('0x3e'),_0x5a709d[_0x7ede('0x20')]),_0x5a709d);calls[_0x7ede('0x3f')](_0x5a709d);recordings[_0x7ede('0x3f')](_0x5a709d);dials[_0x7ede('0x3f')](_0x5a709d);}catch(_0x4b930b){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')](_0x7ede('0x3e'),_0x5a709d[_0x7ede('0x20')]),_0x4b930b);}});ami['on']('newchannel',function(_0x1d428d){try{utils['debug'](util[_0x7ede('0x1e')](_0x7ede('0x40'),_0x1d428d[_0x7ede('0x20')]),_0x1d428d);calls[_0x7ede('0x41')](_0x1d428d);recordings[_0x7ede('0x41')](_0x1d428d);}catch(_0x1cac5a){utils['error'](util[_0x7ede('0x1e')](_0x7ede('0x40'),_0x1d428d[_0x7ede('0x20')]),_0x1cac5a);}});ami['on'](_0x7ede('0x42'),function(_0x54f75a){try{utils[_0x7ede('0x1b')](util[_0x7ede('0x1e')](_0x7ede('0x43'),_0x54f75a[_0x7ede('0x20')]),_0x54f75a);dials[_0x7ede('0x42')](_0x54f75a);}catch(_0xb95c9d){utils[_0x7ede('0x17')](util['format'](_0x7ede('0x44'),_0x54f75a[_0x7ede('0x20')]),_0xb95c9d);}});ami['on'](_0x7ede('0x45'),function(_0x3914f5){try{utils['debug'](util['format'](_0x7ede('0x46'),_0x3914f5[_0x7ede('0x20')]),_0x3914f5);dials['dialend'](_0x3914f5);}catch(_0x3d7146){utils[_0x7ede('0x17')](util[_0x7ede('0x1e')]('[%s][index][dialend]',_0x3914f5[_0x7ede('0x20')]),_0x3d7146);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5f7487f..fad19fa 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 _0x6478=['lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','uniqueid','some','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','assign','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','data3'];(function(_0x2bf722,_0x1d7e89){var _0x281105=function(_0x5721fd){while(--_0x5721fd){_0x2bf722['push'](_0x2bf722['shift']());}};_0x281105(++_0x1d7e89);}(_0x6478,0x64));var _0x8647=function(_0x5c5c1b,_0x4a67da){_0x5c5c1b=_0x5c5c1b-0x0;var _0x27ab42=_0x6478[_0x5c5c1b];return _0x27ab42;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var utils=require(_0x8647('0x2'));var members={};var exclude=[_0x8647('0x3'),'Queue:'];function writeDB(_0x882207){utils['info'](util[_0x8647('0x4')](_0x8647('0x5'),_0x882207['uniqueid'],_0x882207[_0x8647('0x6')],_0x882207[_0x8647('0x7')],_0x882207['data2'],_0x882207[_0x8647('0x8')],_0x882207['type']));if(_0x882207[_0x8647('0x6')]){utils[_0x8647('0x9')](_0x882207[_0x8647('0x6')])[_0x8647('0xa')](function(_0xbe3076){if(_0xbe3076){_0x882207[_0x8647('0x8')]=_0xbe3076[_0x8647('0xb')];_0x882207[_0x8647('0xc')]=_0xbe3076[_0x8647('0xc')];utils[_0x8647('0xd')]('CreateMemberReport',_0x882207);}else{utils[_0x8647('0xe')](_0x882207[_0x8647('0x6')][_0x8647('0xf')]('/')[0x1])[_0x8647('0xa')](function(_0x53083d){if(_0x53083d){_0x882207[_0x8647('0x8')]=_0x53083d[_0x8647('0xb')];_0x882207['internal']=_0x53083d[_0x8647('0xc')];utils[_0x8647('0xd')](_0x8647('0x10'),_0x882207);}});}})[_0x8647('0x11')](function(_0x4a4acf){utils[_0x8647('0x12')](util[_0x8647('0x4')]('[%s][members][writeDB]',_0x882207[_0x8647('0x13')]),_0x4a4acf);});}delete members[_0x882207[_0x8647('0x6')]];}function startsWith(_0x1bf05e,_0xaa2f15){return _[_0x8647('0x14')](_0x1bf05e,function(_0x26ea8b){return _['startsWith'](_0xaa2f15,_0x26ea8b);});}exports[_0x8647('0x15')]=function(_0x344e3d){try{utils[_0x8647('0x16')](util[_0x8647('0x4')](_0x8647('0x17'),members[_0x344e3d[_0x8647('0x18')]]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d[_0x8647('0x18')]),_0x344e3d);utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x1a'),members[_0x344e3d[_0x8647('0x18')]]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d['device'],_0x344e3d['state'],_0x344e3d[_0x8647('0x18')]));switch(_0x344e3d[_0x8647('0x1b')]){case _0x8647('0x1c'):case _0x8647('0x1d'):if(!startsWith(exclude,_0x344e3d[_0x8647('0x18')])){members[_0x344e3d[_0x8647('0x18')]]={'channel':_0x8647('0x1e'),'interface':_0x344e3d[_0x8647('0x18')],'type':_0x8647('0x1f'),'enterAt':utils[_0x8647('0x20')](),'role':_0x8647('0x21')};}break;case _0x8647('0x22'):if(!_[_0x8647('0x23')](members[_0x344e3d[_0x8647('0x18')]])){members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x24')]=utils['now']();members[_0x344e3d['device']]['duration']=utils[_0x8647('0x25')](members[_0x344e3d['device']]['exitAt'],members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x26')]);if(members[_0x344e3d['device']][_0x8647('0x13')]){writeDB(members[_0x344e3d['device']]);}}break;default:break;}}catch(_0x240a30){utils[_0x8647('0x12')](util[_0x8647('0x4')](_0x8647('0x17'),members[_0x344e3d['device']]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d[_0x8647('0x18')]),_0x240a30);}};exports[_0x8647('0x27')]=function(_0x30e71d){try{if(!_[_0x8647('0x23')](members[_0x30e71d[_0x8647('0x6')]])){utils[_0x8647('0x16')](util['format'](_0x8647('0x28'),_0x30e71d[_0x8647('0x13')]),_0x30e71d);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x30e71d[_0x8647('0x13')],_0x30e71d[_0x8647('0x6')],_0x30e71d['queue']));members[_0x30e71d[_0x8647('0x6')]]=_[_0x8647('0x29')](members[_0x30e71d[_0x8647('0x6')]],{'data4':_0x30e71d['queue'],'uniqueid':_0x30e71d[_0x8647('0x13')]});}}catch(_0x326583){utils[_0x8647('0x12')](util['format']('[%s][members][agentcomplete]',_0x30e71d[_0x8647('0x13')]),_0x326583);}};exports['cdr']=function(_0x5ac47c){try{utils['debug'](util['format']('[%s][members][cdr]',_0x5ac47c[_0x8647('0x13')]),_0x5ac47c);if(_0x5ac47c[_0x8647('0x7')]){var _0x35a6b4=_0x5ac47c[_0x8647('0x7')]['split']('-')[0x0];if(!_[_0x8647('0x23')](members[_0x35a6b4])){members[_0x35a6b4]=_[_0x8647('0x29')](members[_0x35a6b4],{'data1':members[_0x35a6b4][_0x8647('0x2a')]||_0x5ac47c[_0x8647('0x2b')],'data2':members[_0x35a6b4]['data2']||_0x5ac47c[_0x8647('0x2c')],'data3':members[_0x35a6b4]['data3']||_0x5ac47c[_0x8647('0x2d')],'uniqueid':members[_0x35a6b4]['uniqueid']||_0x5ac47c['uniqueid']});utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x2e'),_0x5ac47c['uniqueid'],members[_0x35a6b4][_0x8647('0x2a')],members[_0x35a6b4][_0x8647('0x2f')],members[_0x35a6b4]['data3']));if(members[_0x35a6b4][_0x8647('0x24')]){writeDB(members[_0x35a6b4]);}}}if(_0x5ac47c['destinationchannel']){var _0x487a0f=_0x5ac47c[_0x8647('0x30')]['split']('-')[0x0];if(!_[_0x8647('0x23')](members[_0x487a0f])){members[_0x487a0f]=_[_0x8647('0x29')](members[_0x487a0f],{'data1':members[_0x487a0f][_0x8647('0x2a')]||_0x5ac47c[_0x8647('0x2b')],'data2':members[_0x487a0f][_0x8647('0x2f')]||_0x5ac47c[_0x8647('0x2c')],'data3':members[_0x487a0f][_0x8647('0x31')]||_0x5ac47c[_0x8647('0x2d')],'uniqueid':members[_0x487a0f][_0x8647('0x13')]||_0x5ac47c['uniqueid']});utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x2e'),_0x5ac47c['uniqueid'],members[_0x487a0f][_0x8647('0x2a')],members[_0x487a0f][_0x8647('0x2f')],members[_0x487a0f][_0x8647('0x31')]));if(members[_0x487a0f][_0x8647('0x24')]){writeDB(members[_0x487a0f]);}}}}catch(_0x1cd837){utils[_0x8647('0x12')](util[_0x8647('0x4')]('[%s][members][cdr]',_0x5ac47c[_0x8647('0x13')]),_0x1cd837);}}; \ No newline at end of file +var _0x074f=['data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]','assign','queue','cdr','[%s][members][cdr]','data1','source'];(function(_0x56989c,_0x92e7b4){var _0xbe1a6a=function(_0x2f55ca){while(--_0x2f55ca){_0x56989c['push'](_0x56989c['shift']());}};_0xbe1a6a(++_0x92e7b4);}(_0x074f,0x97));var _0xf074=function(_0x5bb207,_0x157700){_0x5bb207=_0x5bb207-0x0;var _0x4b198e=_0x074f[_0x5bb207];return _0x4b198e;};'use strict';var _=require(_0xf074('0x0'));var util=require(_0xf074('0x1'));var utils=require(_0xf074('0x2'));var members={};var exclude=[_0xf074('0x3'),'Queue:'];function writeDB(_0x3e480a){utils[_0xf074('0x4')](util[_0xf074('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3e480a[_0xf074('0x6')],_0x3e480a[_0xf074('0x7')],_0x3e480a[_0xf074('0x8')],_0x3e480a[_0xf074('0x9')],_0x3e480a[_0xf074('0xa')],_0x3e480a[_0xf074('0xb')]));if(_0x3e480a[_0xf074('0x7')]){utils[_0xf074('0xc')](_0x3e480a[_0xf074('0x7')])[_0xf074('0xd')](function(_0x1dc203){if(_0x1dc203){_0x3e480a['membername']=_0x1dc203[_0xf074('0xe')];_0x3e480a[_0xf074('0xf')]=_0x1dc203['internal'];utils[_0xf074('0x10')](_0xf074('0x11'),_0x3e480a);}else{utils['getUserByName'](_0x3e480a[_0xf074('0x7')][_0xf074('0x12')]('/')[0x1])[_0xf074('0xd')](function(_0x5c2504){if(_0x5c2504){_0x3e480a[_0xf074('0xa')]=_0x5c2504[_0xf074('0xe')];_0x3e480a[_0xf074('0xf')]=_0x5c2504[_0xf074('0xf')];utils[_0xf074('0x10')]('CreateMemberReport',_0x3e480a);}});}})[_0xf074('0x13')](function(_0x59ab13){utils['error'](util['format']('[%s][members][writeDB]',_0x3e480a[_0xf074('0x6')]),_0x59ab13);});}delete members[_0x3e480a['interface']];}function startsWith(_0x149988,_0x2eddb6){return _[_0xf074('0x14')](_0x149988,function(_0x5b06a9){return _[_0xf074('0x15')](_0x2eddb6,_0x5b06a9);});}exports['devicestatechange']=function(_0x25bc5){try{utils[_0xf074('0x16')](util[_0xf074('0x5')](_0xf074('0x17'),members[_0x25bc5[_0xf074('0x18')]]?members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x6')]:_0x25bc5['device']),_0x25bc5);utils[_0xf074('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x25bc5[_0xf074('0x18')]]?members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x6')]:_0x25bc5[_0xf074('0x18')],_0x25bc5['state'],_0x25bc5[_0xf074('0x18')]));switch(_0x25bc5[_0xf074('0x19')]){case _0xf074('0x1a'):case'BUSY':if(!startsWith(exclude,_0x25bc5['device'])){members[_0x25bc5[_0xf074('0x18')]]={'channel':_0xf074('0x1b'),'interface':_0x25bc5[_0xf074('0x18')],'type':_0xf074('0x1c'),'enterAt':utils[_0xf074('0x1d')](),'role':'agent'};}break;case _0xf074('0x1e'):if(!_[_0xf074('0x1f')](members[_0x25bc5[_0xf074('0x18')]])){members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x20')]=utils['now']();members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x21')]=utils[_0xf074('0x22')](members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x20')],members[_0x25bc5['device']][_0xf074('0x23')]);if(members[_0x25bc5[_0xf074('0x18')]][_0xf074('0x6')]){writeDB(members[_0x25bc5[_0xf074('0x18')]]);}}break;default:break;}}catch(_0x2b1de7){utils[_0xf074('0x24')](util[_0xf074('0x5')](_0xf074('0x17'),members[_0x25bc5[_0xf074('0x18')]]?members[_0x25bc5[_0xf074('0x18')]]['uniqueid']:_0x25bc5[_0xf074('0x18')]),_0x2b1de7);}};exports[_0xf074('0x25')]=function(_0xdd71e0){try{if(!_[_0xf074('0x1f')](members[_0xdd71e0[_0xf074('0x7')]])){utils[_0xf074('0x16')](util[_0xf074('0x5')](_0xf074('0x26'),_0xdd71e0['uniqueid']),_0xdd71e0);utils[_0xf074('0x4')](util[_0xf074('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0xdd71e0[_0xf074('0x6')],_0xdd71e0[_0xf074('0x7')],_0xdd71e0['queue']));members[_0xdd71e0[_0xf074('0x7')]]=_[_0xf074('0x27')](members[_0xdd71e0[_0xf074('0x7')]],{'data4':_0xdd71e0[_0xf074('0x28')],'uniqueid':_0xdd71e0[_0xf074('0x6')]});}}catch(_0x2bda37){utils[_0xf074('0x24')](util[_0xf074('0x5')](_0xf074('0x26'),_0xdd71e0['uniqueid']),_0x2bda37);}};exports[_0xf074('0x29')]=function(_0x4f63ae){try{utils[_0xf074('0x16')](util['format'](_0xf074('0x2a'),_0x4f63ae[_0xf074('0x6')]),_0x4f63ae);if(_0x4f63ae['channel']){var _0x1a309c=_0x4f63ae[_0xf074('0x8')][_0xf074('0x12')]('-')[0x0];if(!_[_0xf074('0x1f')](members[_0x1a309c])){members[_0x1a309c]=_['assign'](members[_0x1a309c],{'data1':members[_0x1a309c][_0xf074('0x2b')]||_0x4f63ae['type'],'data2':members[_0x1a309c][_0xf074('0x9')]||_0x4f63ae[_0xf074('0x2c')],'data3':members[_0x1a309c][_0xf074('0x2d')]||_0x4f63ae[_0xf074('0x2e')],'uniqueid':members[_0x1a309c][_0xf074('0x6')]||_0x4f63ae[_0xf074('0x6')]});utils[_0xf074('0x4')](util[_0xf074('0x5')](_0xf074('0x2f'),_0x4f63ae[_0xf074('0x6')],members[_0x1a309c][_0xf074('0x2b')],members[_0x1a309c][_0xf074('0x9')],members[_0x1a309c][_0xf074('0x2d')]));if(members[_0x1a309c][_0xf074('0x20')]){writeDB(members[_0x1a309c]);}}}if(_0x4f63ae[_0xf074('0x30')]){var _0xfa6202=_0x4f63ae[_0xf074('0x30')][_0xf074('0x12')]('-')[0x0];if(!_[_0xf074('0x1f')](members[_0xfa6202])){members[_0xfa6202]=_['assign'](members[_0xfa6202],{'data1':members[_0xfa6202]['data1']||_0x4f63ae[_0xf074('0xb')],'data2':members[_0xfa6202]['data2']||_0x4f63ae[_0xf074('0x2c')],'data3':members[_0xfa6202][_0xf074('0x2d')]||_0x4f63ae[_0xf074('0x2e')],'uniqueid':members[_0xfa6202][_0xf074('0x6')]||_0x4f63ae[_0xf074('0x6')]});utils[_0xf074('0x4')](util[_0xf074('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4f63ae[_0xf074('0x6')],members[_0xfa6202][_0xf074('0x2b')],members[_0xfa6202][_0xf074('0x9')],members[_0xfa6202]['data3']));if(members[_0xfa6202]['exitAt']){writeDB(members[_0xfa6202]);}}}}catch(_0x131ca2){utils[_0xf074('0x24')](util['format'](_0xf074('0x2a'),_0x4f63ae[_0xf074('0x6')]),_0x131ca2);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 044c6b7..806979d 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 _0xdc73=['queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','diffTime','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','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','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt'];(function(_0xc56c46,_0x3fc792){var _0x2055d6=function(_0x110ac3){while(--_0x110ac3){_0xc56c46['push'](_0xc56c46['shift']());}};_0x2055d6(++_0x3fc792);}(_0xdc73,0xb4));var _0x3dc7=function(_0xcc78f,_0x2ec704){_0xcc78f=_0xcc78f-0x0;var _0x36a0b0=_0xdc73[_0xcc78f];return _0x36a0b0;};'use strict';var _=require(_0x3dc7('0x0'));var util=require('util');var utils=require(_0x3dc7('0x1'));var queues={};function writeDB(_0x2a2a87){utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x4'),_0x2a2a87[_0x3dc7('0x5')],_0x2a2a87[_0x3dc7('0x6')],_0x2a2a87['queue'],_0x2a2a87[_0x3dc7('0x7')],_0x2a2a87[_0x3dc7('0x8')],_0x2a2a87['accountcode'],_0x2a2a87['queuecallerexitreason']));if(_0x2a2a87[_0x3dc7('0x9')]){utils[_0x3dc7('0xa')](_0x2a2a87['queue'])[_0x3dc7('0xb')](function(_0x87b261){if(_0x87b261){_0x2a2a87[_0x3dc7('0xc')]=_0x87b261[_0x3dc7('0xc')];}utils[_0x3dc7('0xd')](_0x3dc7('0xe'),_0x2a2a87);});}else{utils[_0x3dc7('0xd')](_0x3dc7('0xe'),_0x2a2a87);}if(_0x2a2a87['transfereduniqueid']){delete queues[_0x2a2a87[_0x3dc7('0xf')]];}else{delete queues[_0x2a2a87['uniqueid']];}}exports['queuecallerjoin']=function(_0x22f699){try{utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x11'),_0x22f699[_0x3dc7('0x5')]),_0x22f699);utils['info'](util[_0x3dc7('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x22f699[_0x3dc7('0x5')],_0x22f699['queue'],_0x22f699[_0x3dc7('0x12')]));queues[_0x22f699[_0x3dc7('0x5')]]=_[_0x3dc7('0x13')](_0x22f699,{'originalposition':_0x22f699['position'],'queuecallerjoinAt':utils[_0x3dc7('0x14')](),'mohtime':0x0});}catch(_0x2080fb){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')]('[%s][queues][queuecallerjoin]',_0x22f699[_0x3dc7('0x5')]),_0x2080fb);}};exports['hangup']=function(_0x10dd6b){try{if(!_[_0x3dc7('0x16')](queues[_0x10dd6b[_0x3dc7('0x5')]])){utils[_0x3dc7('0x10')](util['format'](_0x3dc7('0x17'),_0x10dd6b['uniqueid']),_0x10dd6b);if(queues[_0x10dd6b[_0x3dc7('0x5')]][_0x3dc7('0x18')]){if(!queues[_0x10dd6b[_0x3dc7('0x5')]][_0x3dc7('0x19')]&&!queues[_0x10dd6b[_0x3dc7('0x5')]][_0x3dc7('0x1a')]){queues[_0x10dd6b[_0x3dc7('0x5')]]['queuecallercomplete']=!![];queues[_0x10dd6b[_0x3dc7('0x5')]][_0x3dc7('0x1b')]=utils[_0x3dc7('0x14')]();queues[_0x10dd6b['uniqueid']][_0x3dc7('0x1c')]=_0x3dc7('0x1d');}utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x1e'),_0x10dd6b[_0x3dc7('0x5')],queues[_0x10dd6b['uniqueid']][_0x3dc7('0x1f')],queues[_0x10dd6b['uniqueid']][_0x3dc7('0x1c')]));writeDB(queues[_0x10dd6b[_0x3dc7('0x5')]]);}else if(queues[_0x10dd6b[_0x3dc7('0x5')]]['transfereduniqueid']){utils[_0x3dc7('0x2')](util['format'](_0x3dc7('0x20'),_0x10dd6b[_0x3dc7('0x5')],queues[_0x10dd6b[_0x3dc7('0x5')]][_0x3dc7('0x1f')],queues[_0x10dd6b['uniqueid']][_0x3dc7('0xf')]));queues[queues[_0x10dd6b['uniqueid']][_0x3dc7('0xf')]]=queues[_0x10dd6b[_0x3dc7('0x5')]];queues[queues[_0x10dd6b['uniqueid']]['transfereduniqueid']][_0x3dc7('0x21')]=0x2;delete queues[_0x10dd6b[_0x3dc7('0x5')]];}}}catch(_0x52c073){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')](_0x3dc7('0x17'),_0x10dd6b['uniqueid']),_0x52c073);}};exports['varset']=function(_0x2da265){try{utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x22'),_0x2da265[_0x3dc7('0x5')]),_0x2da265);if(!_['isNil'](_0x2da265['variable'][_0x3dc7('0x23')])&&_0x2da265['value'][_0x3dc7('0x24')]()!==_0x3dc7('0x25')){if(!_[_0x3dc7('0x16')](queues[_0x2da265[_0x3dc7('0x5')]])){queues[_0x2da265[_0x3dc7('0x5')]]['queuecallerabandon']=![];queues[_0x2da265['uniqueid']][_0x3dc7('0x26')]=null;queues[_0x2da265[_0x3dc7('0x5')]][_0x3dc7('0x1a')]=!![];queues[_0x2da265[_0x3dc7('0x5')]][_0x3dc7('0x27')]=utils[_0x3dc7('0x14')]();queues[_0x2da265['uniqueid']][_0x3dc7('0x1c')]=_0x2da265[_0x3dc7('0x28')][_0x3dc7('0x24')]();utils[_0x3dc7('0x2')](util['format'](_0x3dc7('0x29'),_0x2da265[_0x3dc7('0x5')],queues[_0x2da265['uniqueid']][_0x3dc7('0x1f')],_0x2da265[_0x3dc7('0x28')],queues[_0x2da265['uniqueid']][_0x3dc7('0x1c')]));writeDB(queues[_0x2da265[_0x3dc7('0x5')]]);}}else if(!_[_0x3dc7('0x16')](_0x2da265[_0x3dc7('0x2a')][_0x3dc7('0x2b')])){if(!_[_0x3dc7('0x16')](queues[_0x2da265[_0x3dc7('0x5')]])&&!queues[_0x2da265[_0x3dc7('0x5')]][_0x3dc7('0x19')]){queues[_0x2da265['uniqueid']]['queuecallerabandon']=![];queues[_0x2da265[_0x3dc7('0x5')]]['queuecallerabandonAt']=null;queues[_0x2da265[_0x3dc7('0x5')]][_0x3dc7('0x1a')]=!![];queues[_0x2da265[_0x3dc7('0x5')]]['queuecallerexitAt']=utils[_0x3dc7('0x14')]();queues[_0x2da265[_0x3dc7('0x5')]]['queuecallerexitreason']=_0x3dc7('0x2c');utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x2d'),_0x2da265[_0x3dc7('0x5')],queues[_0x2da265[_0x3dc7('0x5')]]['name'],_0x2da265[_0x3dc7('0x28')],queues[_0x2da265['uniqueid']][_0x3dc7('0x1c')]));}}}catch(_0x1a2076){utils[_0x3dc7('0x15')](util['format'](_0x3dc7('0x22'),_0x2da265['uniqueid']),_0x1a2076);}};exports[_0x3dc7('0x19')]=function(_0x29d366){try{if(!_['isNil'](queues[_0x29d366[_0x3dc7('0x5')]])){utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x2e'),_0x29d366[_0x3dc7('0x5')]),_0x29d366);queues[_0x29d366[_0x3dc7('0x5')]][_0x3dc7('0x1a')]=![];queues[_0x29d366[_0x3dc7('0x5')]][_0x3dc7('0x27')]=null;queues[_0x29d366['uniqueid']][_0x3dc7('0x19')]=!![];queues[_0x29d366['uniqueid']][_0x3dc7('0x26')]=utils[_0x3dc7('0x14')]();queues[_0x29d366['uniqueid']][_0x3dc7('0x1c')]=_0x3dc7('0x2f');utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x30'),_0x29d366['uniqueid'],queues[_0x29d366['uniqueid']][_0x3dc7('0x1f')],queues[_0x29d366[_0x3dc7('0x5')]][_0x3dc7('0x1c')]));}}catch(_0x112be9){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')](_0x3dc7('0x2e'),_0x29d366[_0x3dc7('0x5')]),_0x112be9);}};exports[_0x3dc7('0x31')]=function(_0x4d62f2){try{if(!_[_0x3dc7('0x16')](queues[_0x4d62f2[_0x3dc7('0x5')]])){utils['debug'](util[_0x3dc7('0x3')]('[%s][queues][queuecallerleave]',_0x4d62f2[_0x3dc7('0x5')]),_0x4d62f2);utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x32'),_0x4d62f2[_0x3dc7('0x5')],queues[_0x4d62f2[_0x3dc7('0x5')]][_0x3dc7('0x1f')],_0x4d62f2['connectedlinenum'],_0x4d62f2[_0x3dc7('0x33')]));queues[_0x4d62f2[_0x3dc7('0x5')]]['queuecallerleave']=!![];queues[_0x4d62f2[_0x3dc7('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x4d62f2[_0x3dc7('0x5')]]['holdtime']=utils[_0x3dc7('0x34')](queues[_0x4d62f2[_0x3dc7('0x5')]][_0x3dc7('0x18')],queues[_0x4d62f2[_0x3dc7('0x5')]]['queuecallerjoinAt']);queues[_0x4d62f2[_0x3dc7('0x5')]][_0x3dc7('0x12')]=_0x4d62f2[_0x3dc7('0x12')];queues[_0x4d62f2[_0x3dc7('0x5')]]['count']=_0x4d62f2[_0x3dc7('0x35')];queues[_0x4d62f2[_0x3dc7('0x5')]]['connectedlinenum']=_0x4d62f2[_0x3dc7('0x36')];queues[_0x4d62f2[_0x3dc7('0x5')]][_0x3dc7('0x33')]=_0x4d62f2[_0x3dc7('0x33')];}}catch(_0x597a54){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')]('[%s][queues][queuecallerleave]',_0x4d62f2[_0x3dc7('0x5')]),_0x597a54);}};exports[_0x3dc7('0x37')]=function(_0x3e370a){try{if(!_[_0x3dc7('0x16')](queues[_0x3e370a['uniqueid']])){utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x38'),_0x3e370a[_0x3dc7('0x5')]),_0x3e370a);utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3e370a[_0x3dc7('0x5')],queues[_0x3e370a[_0x3dc7('0x5')]]['name'],_0x3e370a[_0x3dc7('0x39')],_0x3e370a[_0x3dc7('0x3a')]));queues[_0x3e370a['uniqueid']]['queuecallerabandon']=![];queues[_0x3e370a['uniqueid']][_0x3dc7('0x19')]=![];queues[_0x3e370a[_0x3dc7('0x5')]][_0x3dc7('0x26')]=null;queues[_0x3e370a[_0x3dc7('0x5')]]['queuecallerexit']=![];queues[_0x3e370a['uniqueid']]['queuecallerexitreason']=null;queues[_0x3e370a[_0x3dc7('0x5')]][_0x3dc7('0x27')]=null;queues[_0x3e370a[_0x3dc7('0x5')]][_0x3dc7('0x3b')]=!![];queues[_0x3e370a[_0x3dc7('0x5')]]['accountcode']=_0x3e370a[_0x3dc7('0x3a')];queues[_0x3e370a[_0x3dc7('0x5')]]['lastAssignedTo']=_0x3e370a[_0x3dc7('0x39')];}}catch(_0x57dbea){utils['error'](util['format'](_0x3dc7('0x38'),_0x3e370a['uniqueid']),_0x57dbea);}};exports[_0x3dc7('0x3c')]=function(_0x16a7df){try{if(!_[_0x3dc7('0x16')](queues[_0x16a7df[_0x3dc7('0x5')]])){if(queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x18')]){utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x3d'),_0x16a7df[_0x3dc7('0x5')]),_0x16a7df);queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x19')]=![];queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x19')]=![];queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x26')]=null;queues[_0x16a7df['uniqueid']][_0x3dc7('0x1a')]=![];queues[_0x16a7df['uniqueid']]['queuecallerexitAt']=null;queues[_0x16a7df['uniqueid']][_0x3dc7('0x3b')]=!![];queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x7')]=_0x16a7df['membername'];queues[_0x16a7df['uniqueid']][_0x3dc7('0x3e')]=!![];queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x1b')]=utils[_0x3dc7('0x14')]();if(_0x16a7df['reason']==_0x3dc7('0x3f')){if(!queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x3f')]){queues[_0x16a7df[_0x3dc7('0x5')]][_0x3dc7('0x1c')]='TRANSFER';}}else{queues[_0x16a7df['uniqueid']][_0x3dc7('0x1c')]=_0x3dc7('0x40')+_0x16a7df[_0x3dc7('0x41')][_0x3dc7('0x24')]();}utils[_0x3dc7('0x2')](util['format'](_0x3dc7('0x42'),_0x16a7df[_0x3dc7('0x5')],queues[_0x16a7df['uniqueid']][_0x3dc7('0x1f')],_0x16a7df[_0x3dc7('0x39')],queues[_0x16a7df['uniqueid']][_0x3dc7('0x1c')]));writeDB(queues[_0x16a7df[_0x3dc7('0x5')]]);}}}catch(_0x4004fc){utils['error'](util[_0x3dc7('0x3')](_0x3dc7('0x3d'),_0x16a7df[_0x3dc7('0x5')]),_0x4004fc);}};exports['blindtransfer']=function(_0x345fa3){try{if(!_['isNil'](queues[_0x345fa3[_0x3dc7('0x43')]])){utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x44'),_0x345fa3['uniqueid']),_0x345fa3);queues[_0x345fa3['transfereeuniqueid']][_0x3dc7('0x3f')]=!![];queues[_0x345fa3[_0x3dc7('0x43')]][_0x3dc7('0x45')]=_0x3dc7('0x46');queues[_0x345fa3[_0x3dc7('0x43')]][_0x3dc7('0x47')]=_0x345fa3[_0x3dc7('0x48')];queues[_0x345fa3[_0x3dc7('0x43')]]['transferuniqueid']=_0x345fa3[_0x3dc7('0x43')];queues[_0x345fa3[_0x3dc7('0x43')]]['queuecallerexitreason']=_0x3dc7('0x49');utils[_0x3dc7('0x2')](util['format'](_0x3dc7('0x4a'),_0x345fa3['uniqueid'],queues[_0x345fa3['transfereeuniqueid']]['name'],_0x345fa3[_0x3dc7('0x43')],_0x345fa3['extension']));}}catch(_0x3412fd){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')]('[%s][queues][blindtransfer]',_0x345fa3[_0x3dc7('0x5')]),_0x3412fd);}};exports[_0x3dc7('0x4b')]=function(_0x1f1ce4){try{utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x4c'),_0x1f1ce4[_0x3dc7('0x4d')]),_0x1f1ce4);if(_0x1f1ce4[_0x3dc7('0x4d')]==_0x1f1ce4[_0x3dc7('0x4e')]){if(!_[_0x3dc7('0x16')](queues[_0x1f1ce4[_0x3dc7('0x4f')]])){utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x50'),_0x1f1ce4[_0x3dc7('0x4d')],queues[_0x1f1ce4[_0x3dc7('0x4f')]]['name'],_0x1f1ce4[_0x3dc7('0x51')]));queues[_0x1f1ce4[_0x3dc7('0x4f')]]['transfer']=!![];queues[_0x1f1ce4[_0x3dc7('0x4f')]][_0x3dc7('0x45')]=_0x3dc7('0x52');queues[_0x1f1ce4[_0x3dc7('0x4f')]][_0x3dc7('0x47')]=_0x1f1ce4[_0x3dc7('0x51')];queues[_0x1f1ce4[_0x3dc7('0x4f')]][_0x3dc7('0x53')]=_0x1f1ce4[_0x3dc7('0x4d')];queues[_0x1f1ce4['secondtransfererlinkedid']][_0x3dc7('0x1c')]=_0x3dc7('0x54');}if(!_['isNil'](queues[_0x1f1ce4['origtransfererlinkedid']])){if(_0x1f1ce4['transfereelinkedid']&&queues[_0x1f1ce4[_0x3dc7('0x55')]]){queues[_0x1f1ce4['transfereelinkedid']][_0x3dc7('0x21')]=0x1;queues[_0x1f1ce4[_0x3dc7('0x43')]]=_[_0x3dc7('0x56')](queues[_0x1f1ce4[_0x3dc7('0x55')]]);queues[_0x1f1ce4['transfereeuniqueid']]['transfereduniqueid']=_0x1f1ce4[_0x3dc7('0x57')];queues[_0x1f1ce4['transfereeuniqueid']][_0x3dc7('0x21')]=0x2;queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x8')]=queues[_0x1f1ce4['secondtransfererlinkedid']][_0x3dc7('0x8')];queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x58')]=queues[_0x1f1ce4[_0x3dc7('0x4f')]][_0x3dc7('0x58')];queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x59')]=utils['now']();queues[_0x1f1ce4['transfereeuniqueid']][_0x3dc7('0x18')]=utils[_0x3dc7('0x14')]();queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x5a')]=0x0;queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x5b')]=0x0;utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x5c'),_0x1f1ce4['origtransfereruniqueid'],queues[_0x1f1ce4[_0x3dc7('0x43')]]['name'],queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x8')],queues[_0x1f1ce4[_0x3dc7('0x43')]][_0x3dc7('0x58')]));}else{utils['info'](util[_0x3dc7('0x3')](_0x3dc7('0x5d'),_0x1f1ce4[_0x3dc7('0x4d')],queues[_0x1f1ce4[_0x3dc7('0x4e')]]['name'],_0x1f1ce4[_0x3dc7('0x4f')]));queues[_0x1f1ce4[_0x3dc7('0x4e')]]['transfereduniqueid']=_0x1f1ce4[_0x3dc7('0x4f')];}}}else if(_0x1f1ce4[_0x3dc7('0x5e')]==_0x1f1ce4['secondtransfererlinkedid']){if(!_[_0x3dc7('0x16')](queues[_0x1f1ce4[_0x3dc7('0x4e')]])){utils['info'](util['format'](_0x3dc7('0x5f'),_0x1f1ce4[_0x3dc7('0x4d')],queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x1f')],_0x1f1ce4[_0x3dc7('0x5e')],_0x1f1ce4[_0x3dc7('0x60')]));queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x3f')]=!![];queues[_0x1f1ce4[_0x3dc7('0x4e')]]['transfertype']='ATTENDED';queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x47')]=_0x1f1ce4[_0x3dc7('0x60')];queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x53')]=_0x1f1ce4[_0x3dc7('0x5e')];queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x1c')]=_0x3dc7('0x54');}if(!_['isNil'](queues[_0x1f1ce4[_0x3dc7('0x4f')]])){if(_0x1f1ce4[_0x3dc7('0x61')]&&queues[_0x1f1ce4['transfertargetlinkedid']]){queues[_0x1f1ce4['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x1f1ce4[_0x3dc7('0x57')]]=_[_0x3dc7('0x56')](queues[_0x1f1ce4[_0x3dc7('0x61')]]);queues[_0x1f1ce4[_0x3dc7('0x57')]]['transfereduniqueid']=_0x1f1ce4['transfertargetuniqueid'];queues[_0x1f1ce4['transfertargetuniqueid']][_0x3dc7('0x21')]=0x2;queues[_0x1f1ce4[_0x3dc7('0x57')]]['calleridnum']=queues[_0x1f1ce4[_0x3dc7('0x4e')]][_0x3dc7('0x8')];queues[_0x1f1ce4['transfertargetuniqueid']][_0x3dc7('0x58')]=queues[_0x1f1ce4[_0x3dc7('0x4e')]]['calleridname'];queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x59')]=utils[_0x3dc7('0x14')]();queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x18')]=utils[_0x3dc7('0x14')]();queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x5a')]=0x0;queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x5b')]=0x0;utils['info'](util['format'](_0x3dc7('0x62'),_0x1f1ce4[_0x3dc7('0x4d')],queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x1f')],queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0xf')],queues[_0x1f1ce4['transfertargetuniqueid']][_0x3dc7('0x8')],queues[_0x1f1ce4[_0x3dc7('0x57')]][_0x3dc7('0x58')]));}else{utils[_0x3dc7('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1f1ce4[_0x3dc7('0x4d')],queues[_0x1f1ce4['secondtransfererlinkedid']][_0x3dc7('0x1f')],_0x1f1ce4[_0x3dc7('0x4e')]));queues[_0x1f1ce4[_0x3dc7('0x4f')]]['transfereduniqueid']=_0x1f1ce4[_0x3dc7('0x4e')];}}}}catch(_0x795b06){utils[_0x3dc7('0x15')](util['format'](_0x3dc7('0x4c'),_0x1f1ce4[_0x3dc7('0x4d')]),_0x795b06);}};exports[_0x3dc7('0x63')]=function(_0x16b890){try{if(!_[_0x3dc7('0x16')](queues[_0x16b890[_0x3dc7('0x5')]])){utils[_0x3dc7('0x10')](util[_0x3dc7('0x3')](_0x3dc7('0x64'),_0x16b890[_0x3dc7('0x5')]),_0x16b890);queues[_0x16b890[_0x3dc7('0x5')]]['musiconholdstartAt']=utils['now']();utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')](_0x3dc7('0x65'),_0x16b890[_0x3dc7('0x5')],queues[_0x16b890['uniqueid']]['name'],queues[_0x16b890[_0x3dc7('0x5')]]['musiconholdstartAt']));}}catch(_0x8cae91){utils[_0x3dc7('0x15')](util[_0x3dc7('0x3')](_0x3dc7('0x64'),_0x16b890[_0x3dc7('0x5')]),_0x8cae91);}};exports['musiconholdstop']=function(_0x32567c){try{if(!_[_0x3dc7('0x16')](queues[_0x32567c[_0x3dc7('0x5')]])){if(!_[_0x3dc7('0x16')](queues[_0x32567c['uniqueid']][_0x3dc7('0x66')])){utils['debug'](util[_0x3dc7('0x3')]('[%s][queues][musiconholdstop]',_0x32567c[_0x3dc7('0x5')]),_0x32567c);queues[_0x32567c['uniqueid']][_0x3dc7('0x5b')]+=utils['diffTime'](utils[_0x3dc7('0x14')](),queues[_0x32567c[_0x3dc7('0x5')]][_0x3dc7('0x66')]);utils[_0x3dc7('0x2')](util[_0x3dc7('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x32567c[_0x3dc7('0x5')],queues[_0x32567c[_0x3dc7('0x5')]][_0x3dc7('0x1f')],queues[_0x32567c[_0x3dc7('0x5')]][_0x3dc7('0x5b')]));delete queues[_0x32567c[_0x3dc7('0x5')]][_0x3dc7('0x66')];}}}catch(_0x5031d0){utils['error'](util[_0x3dc7('0x3')](_0x3dc7('0x67'),_0x32567c[_0x3dc7('0x5')]),_0x5031d0);}}; \ No newline at end of file +var _0xe037=['queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','isNil','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xe037,0x103));var _0x7e03=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0xe037[_0x4604ad];return _0x3ed8ef;};'use strict';var _=require(_0x7e03('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x24fecb){utils[_0x7e03('0x1')](util['format'](_0x7e03('0x2'),_0x24fecb['uniqueid'],_0x24fecb[_0x7e03('0x3')],_0x24fecb[_0x7e03('0x4')],_0x24fecb['lastAssignedTo'],_0x24fecb[_0x7e03('0x5')],_0x24fecb[_0x7e03('0x6')],_0x24fecb['queuecallerexitreason']));if(_0x24fecb['queue']){utils[_0x7e03('0x7')](_0x24fecb[_0x7e03('0x4')])[_0x7e03('0x8')](function(_0x4fe987){if(_0x4fe987){_0x24fecb[_0x7e03('0x9')]=_0x4fe987[_0x7e03('0x9')];}utils[_0x7e03('0xa')](_0x7e03('0xb'),_0x24fecb);});}else{utils['request']('CreateVoiceQueueReport',_0x24fecb);}if(_0x24fecb[_0x7e03('0xc')]){delete queues[_0x24fecb[_0x7e03('0xc')]];}else{delete queues[_0x24fecb[_0x7e03('0xd')]];}}exports[_0x7e03('0xe')]=function(_0x43a6ee){try{utils[_0x7e03('0xf')](util['format'](_0x7e03('0x10'),_0x43a6ee[_0x7e03('0xd')]),_0x43a6ee);utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x12'),_0x43a6ee['uniqueid'],_0x43a6ee['queue'],_0x43a6ee[_0x7e03('0x13')]));queues[_0x43a6ee[_0x7e03('0xd')]]=_['assign'](_0x43a6ee,{'originalposition':_0x43a6ee[_0x7e03('0x13')],'queuecallerjoinAt':utils[_0x7e03('0x14')](),'mohtime':0x0});}catch(_0x4e39e3){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x10'),_0x43a6ee[_0x7e03('0xd')]),_0x4e39e3);}};exports[_0x7e03('0x16')]=function(_0xc48bf7){try{if(!_['isNil'](queues[_0xc48bf7['uniqueid']])){utils['debug'](util[_0x7e03('0x11')]('[%s][queues][hangup]',_0xc48bf7[_0x7e03('0xd')]),_0xc48bf7);if(queues[_0xc48bf7['uniqueid']][_0x7e03('0x17')]){if(!queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0x18')]&&!queues[_0xc48bf7[_0x7e03('0xd')]]['queuecallerexit']){queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0x19')]=!![];queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0x1a')]=utils[_0x7e03('0x14')]();queues[_0xc48bf7['uniqueid']][_0x7e03('0x1b')]=_0x7e03('0x1c');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xc48bf7['uniqueid'],queues[_0xc48bf7[_0x7e03('0xd')]]['name'],queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0x1b')]));writeDB(queues[_0xc48bf7[_0x7e03('0xd')]]);}else if(queues[_0xc48bf7[_0x7e03('0xd')]]['transfereduniqueid']){utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x1d'),_0xc48bf7[_0x7e03('0xd')],queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0x1e')],queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0xc')]));queues[queues[_0xc48bf7[_0x7e03('0xd')]][_0x7e03('0xc')]]=queues[_0xc48bf7['uniqueid']];queues[queues[_0xc48bf7['uniqueid']]['transfereduniqueid']][_0x7e03('0x1f')]=0x2;delete queues[_0xc48bf7[_0x7e03('0xd')]];}}}catch(_0x51b885){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x20'),_0xc48bf7[_0x7e03('0xd')]),_0x51b885);}};exports[_0x7e03('0x21')]=function(_0x3432df){try{utils['debug'](util[_0x7e03('0x11')](_0x7e03('0x22'),_0x3432df['uniqueid']),_0x3432df);if(!_['isNil'](_0x3432df[_0x7e03('0x23')][_0x7e03('0x24')])&&_0x3432df['value'][_0x7e03('0x25')]()!==_0x7e03('0x26')){if(!_['isNil'](queues[_0x3432df[_0x7e03('0xd')]])){queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x18')]=![];queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x27')]=null;queues[_0x3432df['uniqueid']][_0x7e03('0x28')]=!![];queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x29')]=utils['now']();queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x1b')]=_0x3432df[_0x7e03('0x2a')][_0x7e03('0x25')]();utils['info'](util[_0x7e03('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3432df[_0x7e03('0xd')],queues[_0x3432df['uniqueid']]['name'],_0x3432df[_0x7e03('0x2a')],queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x1b')]));writeDB(queues[_0x3432df[_0x7e03('0xd')]]);}}else if(!_[_0x7e03('0x2b')](_0x3432df[_0x7e03('0x23')][_0x7e03('0x2c')])){if(!_[_0x7e03('0x2b')](queues[_0x3432df['uniqueid']])&&!queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x18')]){queues[_0x3432df[_0x7e03('0xd')]]['queuecallerabandon']=![];queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x27')]=null;queues[_0x3432df['uniqueid']][_0x7e03('0x28')]=!![];queues[_0x3432df['uniqueid']][_0x7e03('0x29')]=utils['now']();queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x1b')]=_0x7e03('0x2d');utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x2e'),_0x3432df[_0x7e03('0xd')],queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x1e')],_0x3432df[_0x7e03('0x2a')],queues[_0x3432df[_0x7e03('0xd')]][_0x7e03('0x1b')]));}}}catch(_0x39acab){utils['error'](util[_0x7e03('0x11')](_0x7e03('0x22'),_0x3432df['uniqueid']),_0x39acab);}};exports[_0x7e03('0x18')]=function(_0x29d9fb){try{if(!_['isNil'](queues[_0x29d9fb[_0x7e03('0xd')]])){utils[_0x7e03('0xf')](util[_0x7e03('0x11')]('[%s][queues][queuecallerabandon]',_0x29d9fb[_0x7e03('0xd')]),_0x29d9fb);queues[_0x29d9fb[_0x7e03('0xd')]]['queuecallerexit']=![];queues[_0x29d9fb[_0x7e03('0xd')]][_0x7e03('0x29')]=null;queues[_0x29d9fb[_0x7e03('0xd')]][_0x7e03('0x18')]=!![];queues[_0x29d9fb[_0x7e03('0xd')]][_0x7e03('0x27')]=utils[_0x7e03('0x14')]();queues[_0x29d9fb[_0x7e03('0xd')]][_0x7e03('0x1b')]=_0x7e03('0x2f');utils['info'](util[_0x7e03('0x11')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x29d9fb[_0x7e03('0xd')],queues[_0x29d9fb[_0x7e03('0xd')]]['name'],queues[_0x29d9fb[_0x7e03('0xd')]][_0x7e03('0x1b')]));}}catch(_0x338b3c){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x30'),_0x29d9fb[_0x7e03('0xd')]),_0x338b3c);}};exports[_0x7e03('0x31')]=function(_0x4f1bdb){try{if(!_['isNil'](queues[_0x4f1bdb[_0x7e03('0xd')]])){utils[_0x7e03('0xf')](util[_0x7e03('0x11')]('[%s][queues][queuecallerleave]',_0x4f1bdb[_0x7e03('0xd')]),_0x4f1bdb);utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x32'),_0x4f1bdb['uniqueid'],queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x1e')],_0x4f1bdb[_0x7e03('0x33')],_0x4f1bdb['connectedlinename']));queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x31')]=!![];queues[_0x4f1bdb[_0x7e03('0xd')]]['queuecallerleaveAt']=utils[_0x7e03('0x14')]();queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x34')]=utils['diffTime'](queues[_0x4f1bdb[_0x7e03('0xd')]]['queuecallerleaveAt'],queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x35')]);queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x13')]=_0x4f1bdb[_0x7e03('0x13')];queues[_0x4f1bdb['uniqueid']][_0x7e03('0x36')]=_0x4f1bdb['count'];queues[_0x4f1bdb[_0x7e03('0xd')]]['connectedlinenum']=_0x4f1bdb[_0x7e03('0x33')];queues[_0x4f1bdb[_0x7e03('0xd')]][_0x7e03('0x37')]=_0x4f1bdb[_0x7e03('0x37')];}}catch(_0x26cb54){utils['error'](util[_0x7e03('0x11')]('[%s][queues][queuecallerleave]',_0x4f1bdb['uniqueid']),_0x26cb54);}};exports['agentconnect']=function(_0x8a980d){try{if(!_[_0x7e03('0x2b')](queues[_0x8a980d['uniqueid']])){utils[_0x7e03('0xf')](util[_0x7e03('0x11')](_0x7e03('0x38'),_0x8a980d[_0x7e03('0xd')]),_0x8a980d);utils['info'](util[_0x7e03('0x11')](_0x7e03('0x39'),_0x8a980d[_0x7e03('0xd')],queues[_0x8a980d[_0x7e03('0xd')]][_0x7e03('0x1e')],_0x8a980d[_0x7e03('0x3a')],_0x8a980d[_0x7e03('0x3b')]));queues[_0x8a980d['uniqueid']]['queuecallerabandon']=![];queues[_0x8a980d['uniqueid']]['queuecallerabandon']=![];queues[_0x8a980d['uniqueid']][_0x7e03('0x27')]=null;queues[_0x8a980d['uniqueid']][_0x7e03('0x28')]=![];queues[_0x8a980d[_0x7e03('0xd')]][_0x7e03('0x1b')]=null;queues[_0x8a980d[_0x7e03('0xd')]]['queuecallerexitAt']=null;queues[_0x8a980d['uniqueid']][_0x7e03('0x3c')]=!![];queues[_0x8a980d['uniqueid']][_0x7e03('0x6')]=_0x8a980d['destaccountcode'];queues[_0x8a980d[_0x7e03('0xd')]][_0x7e03('0x3d')]=_0x8a980d[_0x7e03('0x3a')];}}catch(_0x509c8d){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x38'),_0x8a980d[_0x7e03('0xd')]),_0x509c8d);}};exports[_0x7e03('0x3e')]=function(_0x1a70f3){try{if(!_[_0x7e03('0x2b')](queues[_0x1a70f3[_0x7e03('0xd')]])){if(queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x17')]){utils['debug'](util[_0x7e03('0x11')](_0x7e03('0x3f'),_0x1a70f3[_0x7e03('0xd')]),_0x1a70f3);queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x18')]=![];queues[_0x1a70f3[_0x7e03('0xd')]]['queuecallerabandon']=![];queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x27')]=null;queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x28')]=![];queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x29')]=null;queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x3c')]=!![];queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x3d')]=_0x1a70f3['membername'];queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x19')]=!![];queues[_0x1a70f3['uniqueid']]['queuecallercompleteAt']=utils[_0x7e03('0x14')]();if(_0x1a70f3['reason']=='transfer'){if(!queues[_0x1a70f3[_0x7e03('0xd')]][_0x7e03('0x40')]){queues[_0x1a70f3['uniqueid']][_0x7e03('0x1b')]=_0x7e03('0x41');}}else{queues[_0x1a70f3['uniqueid']][_0x7e03('0x1b')]='COMPLETEDBY'+_0x1a70f3[_0x7e03('0x42')]['toUpperCase']();}utils['info'](util[_0x7e03('0x11')](_0x7e03('0x43'),_0x1a70f3['uniqueid'],queues[_0x1a70f3[_0x7e03('0xd')]]['name'],_0x1a70f3[_0x7e03('0x3a')],queues[_0x1a70f3['uniqueid']][_0x7e03('0x1b')]));writeDB(queues[_0x1a70f3[_0x7e03('0xd')]]);}}}catch(_0x5a857a){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x3f'),_0x1a70f3['uniqueid']),_0x5a857a);}};exports[_0x7e03('0x44')]=function(_0x41d59d){try{if(!_[_0x7e03('0x2b')](queues[_0x41d59d[_0x7e03('0x45')]])){utils['debug'](util[_0x7e03('0x11')](_0x7e03('0x46'),_0x41d59d[_0x7e03('0xd')]),_0x41d59d);queues[_0x41d59d[_0x7e03('0x45')]][_0x7e03('0x40')]=!![];queues[_0x41d59d['transfereeuniqueid']][_0x7e03('0x47')]=_0x7e03('0x48');queues[_0x41d59d[_0x7e03('0x45')]]['transferexten']=_0x41d59d[_0x7e03('0x49')];queues[_0x41d59d[_0x7e03('0x45')]][_0x7e03('0x4a')]=_0x41d59d['transfereeuniqueid'];queues[_0x41d59d[_0x7e03('0x45')]][_0x7e03('0x1b')]=_0x7e03('0x4b');utils['info'](util['format'](_0x7e03('0x4c'),_0x41d59d['uniqueid'],queues[_0x41d59d[_0x7e03('0x45')]][_0x7e03('0x1e')],_0x41d59d[_0x7e03('0x45')],_0x41d59d['extension']));}}catch(_0x4577d7){utils[_0x7e03('0x15')](util['format']('[%s][queues][blindtransfer]',_0x41d59d['uniqueid']),_0x4577d7);}};exports[_0x7e03('0x4d')]=function(_0x4ab94a){try{utils[_0x7e03('0xf')](util[_0x7e03('0x11')](_0x7e03('0x4e'),_0x4ab94a[_0x7e03('0x4f')]),_0x4ab94a);if(_0x4ab94a[_0x7e03('0x4f')]==_0x4ab94a[_0x7e03('0x50')]){if(!_[_0x7e03('0x2b')](queues[_0x4ab94a['secondtransfererlinkedid']])){utils[_0x7e03('0x1')](util['format'](_0x7e03('0x51'),_0x4ab94a['origtransfereruniqueid'],queues[_0x4ab94a['secondtransfererlinkedid']][_0x7e03('0x1e')],_0x4ab94a['origtransfererexten']));queues[_0x4ab94a[_0x7e03('0x52')]][_0x7e03('0x40')]=!![];queues[_0x4ab94a['secondtransfererlinkedid']][_0x7e03('0x47')]=_0x7e03('0x53');queues[_0x4ab94a[_0x7e03('0x52')]][_0x7e03('0x54')]=_0x4ab94a[_0x7e03('0x55')];queues[_0x4ab94a[_0x7e03('0x52')]][_0x7e03('0x4a')]=_0x4ab94a[_0x7e03('0x4f')];queues[_0x4ab94a[_0x7e03('0x52')]][_0x7e03('0x1b')]=_0x7e03('0x56');}if(!_['isNil'](queues[_0x4ab94a[_0x7e03('0x50')]])){if(_0x4ab94a[_0x7e03('0x57')]&&queues[_0x4ab94a[_0x7e03('0x57')]]){queues[_0x4ab94a[_0x7e03('0x57')]][_0x7e03('0x1f')]=0x1;queues[_0x4ab94a['transfereeuniqueid']]=_[_0x7e03('0x58')](queues[_0x4ab94a['transfereelinkedid']]);queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0xc')]=_0x4ab94a['transfertargetuniqueid'];queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x1f')]=0x2;queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x5')]=queues[_0x4ab94a['secondtransfererlinkedid']][_0x7e03('0x5')];queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x59')]=queues[_0x4ab94a['secondtransfererlinkedid']][_0x7e03('0x59')];queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x35')]=utils[_0x7e03('0x14')]();queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x17')]=utils['now']();queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x34')]=0x0;queues[_0x4ab94a[_0x7e03('0x45')]]['mohtime']=0x0;utils['info'](util[_0x7e03('0x11')](_0x7e03('0x5a'),_0x4ab94a[_0x7e03('0x4f')],queues[_0x4ab94a['transfereeuniqueid']][_0x7e03('0x1e')],queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x5')],queues[_0x4ab94a[_0x7e03('0x45')]][_0x7e03('0x59')]));}else{utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x5b'),_0x4ab94a[_0x7e03('0x4f')],queues[_0x4ab94a[_0x7e03('0x50')]][_0x7e03('0x1e')],_0x4ab94a[_0x7e03('0x52')]));queues[_0x4ab94a['origtransfererlinkedid']][_0x7e03('0xc')]=_0x4ab94a[_0x7e03('0x52')];}}}else if(_0x4ab94a[_0x7e03('0x5c')]==_0x4ab94a[_0x7e03('0x52')]){if(!_['isNil'](queues[_0x4ab94a[_0x7e03('0x50')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4ab94a[_0x7e03('0x4f')],queues[_0x4ab94a[_0x7e03('0x50')]]['name'],_0x4ab94a[_0x7e03('0x5c')],_0x4ab94a[_0x7e03('0x5d')]));queues[_0x4ab94a[_0x7e03('0x50')]]['transfer']=!![];queues[_0x4ab94a[_0x7e03('0x50')]][_0x7e03('0x47')]=_0x7e03('0x53');queues[_0x4ab94a[_0x7e03('0x50')]][_0x7e03('0x54')]=_0x4ab94a[_0x7e03('0x5d')];queues[_0x4ab94a[_0x7e03('0x50')]]['transferuniqueid']=_0x4ab94a[_0x7e03('0x5c')];queues[_0x4ab94a[_0x7e03('0x50')]][_0x7e03('0x1b')]='ATTENDEDTRANSFER';}if(!_[_0x7e03('0x2b')](queues[_0x4ab94a['secondtransfererlinkedid']])){if(_0x4ab94a[_0x7e03('0x5e')]&&queues[_0x4ab94a['transfertargetlinkedid']]){queues[_0x4ab94a['transfertargetlinkedid']][_0x7e03('0x1f')]=0x1;queues[_0x4ab94a[_0x7e03('0x5f')]]=_[_0x7e03('0x58')](queues[_0x4ab94a['transfertargetlinkedid']]);queues[_0x4ab94a[_0x7e03('0x5f')]][_0x7e03('0xc')]=_0x4ab94a[_0x7e03('0x5f')];queues[_0x4ab94a[_0x7e03('0x5f')]][_0x7e03('0x1f')]=0x2;queues[_0x4ab94a[_0x7e03('0x5f')]][_0x7e03('0x5')]=queues[_0x4ab94a[_0x7e03('0x50')]]['calleridnum'];queues[_0x4ab94a[_0x7e03('0x5f')]]['calleridname']=queues[_0x4ab94a[_0x7e03('0x50')]][_0x7e03('0x59')];queues[_0x4ab94a['transfertargetuniqueid']][_0x7e03('0x35')]=utils['now']();queues[_0x4ab94a[_0x7e03('0x5f')]]['queuecallerleaveAt']=utils[_0x7e03('0x14')]();queues[_0x4ab94a[_0x7e03('0x5f')]]['holdtime']=0x0;queues[_0x4ab94a[_0x7e03('0x5f')]][_0x7e03('0x60')]=0x0;utils['info'](util[_0x7e03('0x11')](_0x7e03('0x61'),_0x4ab94a[_0x7e03('0x4f')],queues[_0x4ab94a['transfertargetuniqueid']][_0x7e03('0x1e')],queues[_0x4ab94a['transfertargetuniqueid']][_0x7e03('0xc')],queues[_0x4ab94a['transfertargetuniqueid']][_0x7e03('0x5')],queues[_0x4ab94a[_0x7e03('0x5f')]]['calleridname']));}else{utils['info'](util[_0x7e03('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4ab94a[_0x7e03('0x4f')],queues[_0x4ab94a['secondtransfererlinkedid']]['name'],_0x4ab94a['origtransfererlinkedid']));queues[_0x4ab94a[_0x7e03('0x52')]][_0x7e03('0xc')]=_0x4ab94a[_0x7e03('0x50')];}}}}catch(_0x4609b6){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x4e'),_0x4ab94a[_0x7e03('0x4f')]),_0x4609b6);}};exports['musiconholdstart']=function(_0x3536a0){try{if(!_[_0x7e03('0x2b')](queues[_0x3536a0[_0x7e03('0xd')]])){utils[_0x7e03('0xf')](util[_0x7e03('0x11')](_0x7e03('0x62'),_0x3536a0['uniqueid']),_0x3536a0);queues[_0x3536a0[_0x7e03('0xd')]]['musiconholdstartAt']=utils[_0x7e03('0x14')]();utils[_0x7e03('0x1')](util[_0x7e03('0x11')](_0x7e03('0x63'),_0x3536a0[_0x7e03('0xd')],queues[_0x3536a0[_0x7e03('0xd')]][_0x7e03('0x1e')],queues[_0x3536a0[_0x7e03('0xd')]][_0x7e03('0x64')]));}}catch(_0xa8f788){utils['error'](util[_0x7e03('0x11')]('[%s][queues][musiconholdstart]',_0x3536a0[_0x7e03('0xd')]),_0xa8f788);}};exports[_0x7e03('0x65')]=function(_0x5cd8ac){try{if(!_[_0x7e03('0x2b')](queues[_0x5cd8ac[_0x7e03('0xd')]])){if(!_[_0x7e03('0x2b')](queues[_0x5cd8ac[_0x7e03('0xd')]][_0x7e03('0x64')])){utils['debug'](util['format'](_0x7e03('0x66'),_0x5cd8ac[_0x7e03('0xd')]),_0x5cd8ac);queues[_0x5cd8ac['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0x7e03('0x14')](),queues[_0x5cd8ac[_0x7e03('0xd')]][_0x7e03('0x64')]);utils[_0x7e03('0x1')](util['format'](_0x7e03('0x67'),_0x5cd8ac['uniqueid'],queues[_0x5cd8ac[_0x7e03('0xd')]]['name'],queues[_0x5cd8ac[_0x7e03('0xd')]][_0x7e03('0x60')]));delete queues[_0x5cd8ac['uniqueid']][_0x7e03('0x64')];}}}catch(_0x5dc0ce){utils[_0x7e03('0x15')](util[_0x7e03('0x11')](_0x7e03('0x66'),_0x5cd8ac[_0x7e03('0xd')]),_0x5dc0ce);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7451484..b66f526 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 _0xbb21=['cdr','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','appdata','application','set','startsWith','toLowerCase'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xbb21,0x1ea));var _0x1bb2=function(_0x16e3f3,_0x4a6745){_0x16e3f3=_0x16e3f3-0x0;var _0x1b6b41=_0xbb21[_0x16e3f3];return _0x1b6b41;};'use strict';var _=require('lodash');var util=require(_0x1bb2('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x421253){var _0xbee942;utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')](_0x1bb2('0x3'),_0x421253[_0x1bb2('0x4')]));if(transfers[_0x1bb2('0x5')][_0x421253[_0x1bb2('0x4')]]){_0xbee942=_0x421253[_0x1bb2('0x4')];_0x421253[_0x1bb2('0x4')]=transfers['blinds'][_0x421253[_0x1bb2('0x4')]][_0x1bb2('0x6')];}if(_0x421253[_0x1bb2('0x7')]){utils[_0x1bb2('0x8')](_0x421253[_0x1bb2('0x7')])['then'](function(_0x50dbdc){if(_0x50dbdc){_0x421253[_0x1bb2('0x9')]=_0x50dbdc[_0x1bb2('0xa')];_0x421253[_0x1bb2('0xb')]=_0x50dbdc['id'];}utils[_0x1bb2('0xc')](_0x1bb2('0xd'),_0x421253);});}else{utils['request']('CreateVoiceRecording',_0x421253);}if(_0xbee942)delete transfers[_0x1bb2('0x5')][_0xbee942];}exports['newchannel']=function(_0x122f68){try{utils[_0x1bb2('0xe')](util[_0x1bb2('0x2')]('[%s][recordings][newchannel]',_0x122f68[_0x1bb2('0x4')]),_0x122f68);if(_0x122f68[_0x1bb2('0x4')]==_0x122f68[_0x1bb2('0xf')]){utils['info'](util['format'](_0x1bb2('0x10'),_0x122f68[_0x1bb2('0x4')],_0x122f68[_0x1bb2('0x11')],_0x122f68[_0x1bb2('0x12')]));recordings[_0x122f68[_0x1bb2('0x4')]]={'uniqueid':_0x122f68[_0x1bb2('0x4')],'accountcode':_0x122f68[_0x1bb2('0x7')],'exten':_0x122f68[_0x1bb2('0x12')],'context':_0x122f68[_0x1bb2('0x11')],'channel':_0x122f68[_0x1bb2('0x13')],'monitors':[]};}}catch(_0x538ae0){utils[_0x1bb2('0x14')](util['format'](_0x1bb2('0x15'),_0x122f68[_0x1bb2('0x4')]),_0x538ae0);}};exports['newstate']=function(_0x57d1a4){try{utils[_0x1bb2('0xe')](util[_0x1bb2('0x2')](_0x1bb2('0x16'),_0x57d1a4[_0x1bb2('0x4')]),_0x57d1a4);if(!_[_0x1bb2('0x17')](recordings[_0x57d1a4[_0x1bb2('0x4')]])&&_0x57d1a4[_0x1bb2('0x18')]==0x6){utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')](_0x1bb2('0x19'),_0x57d1a4['uniqueid'],_0x57d1a4[_0x1bb2('0x11')],_0x57d1a4[_0x1bb2('0x13')]));}else if(!_['isNil'](recordings[_0x57d1a4[_0x1bb2('0xf')]])&&_0x57d1a4['channelstate']==0x6&&_0x57d1a4[_0x1bb2('0x11')]!='transfer'){utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')](_0x1bb2('0x1a'),_0x57d1a4[_0x1bb2('0x4')],_0x57d1a4['linkedid'],_0x57d1a4[_0x1bb2('0x11')],_0x57d1a4['channel']));recordings[_0x57d1a4[_0x1bb2('0xf')]][_0x1bb2('0x7')]=_0x57d1a4[_0x1bb2('0x7')];}}catch(_0x50bd2d){utils['error'](util['format'](_0x1bb2('0x16'),_0x57d1a4[_0x1bb2('0x4')]),_0x50bd2d);}};exports['varset']=function(_0x239ceb){try{if(!_[_0x1bb2('0x17')](_0x239ceb[_0x1bb2('0x1b')])&&!_[_0x1bb2('0x17')](_0x239ceb[_0x1bb2('0x1b')]['mixmonitor_filename'])){utils[_0x1bb2('0xe')](util[_0x1bb2('0x2')](_0x1bb2('0x1c'),_0x239ceb[_0x1bb2('0x4')]),_0x239ceb);utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')](_0x1bb2('0x1d'),_0x239ceb[_0x1bb2('0x4')],_0x239ceb[_0x1bb2('0x1b')],_0x239ceb['value']));if(_[_0x1bb2('0x1e')](_0x239ceb[_0x1bb2('0x1f')],_0x1bb2('0x20'))){_0x239ceb['value']=_0x239ceb['value'][_0x1bb2('0x21')](_0x1bb2('0x20'),_0x1bb2('0x22'));}if(recordings[_0x239ceb[_0x1bb2('0xf')]]){var _0x4cf81f=_[_0x1bb2('0x23')](recordings[_0x239ceb['linkedid']][_0x1bb2('0x24')],{'value':_0x239ceb['value']});if(_['isNil'](_0x4cf81f)){recordings[_0x239ceb[_0x1bb2('0xf')]][_0x1bb2('0x24')][_0x1bb2('0x25')]({'value':_0x239ceb[_0x1bb2('0x1f')]});}}}}catch(_0x3152c1){utils[_0x1bb2('0x14')](util[_0x1bb2('0x2')]('[%s][recordings][varset]',_0x239ceb[_0x1bb2('0x4')]),_0x3152c1);}};exports[_0x1bb2('0x26')]=function(_0x2c7866){try{if(!_[_0x1bb2('0x17')](recordings[_0x2c7866['uniqueid']])){utils['debug'](util[_0x1bb2('0x2')](_0x1bb2('0x27'),_0x2c7866[_0x1bb2('0x4')]),_0x2c7866);utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x2c7866['uniqueid'],_0x2c7866[_0x1bb2('0x28')],_0x2c7866[_0x1bb2('0x29')],_0x2c7866['cause-txt']));recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x28')]=_0x2c7866[_0x1bb2('0x28')];recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x29')]=_0x2c7866[_0x1bb2('0x29')];recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x2a')]=_0x2c7866[_0x1bb2('0x2a')];recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x2b')]=_0x2c7866['connectedlinename'];if(recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x2c')]==_0x1bb2('0x2d')&&recordings[_0x2c7866['uniqueid']][_0x1bb2('0x7')]){recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x2a')]=recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x7')];recordings[_0x2c7866['uniqueid']]['connectedlinename']='';}recordings[_0x2c7866[_0x1bb2('0x4')]][_0x1bb2('0x24')][_0x1bb2('0x2e')](function(_0x3fd010){var _0xdbe991=_['clone'](recordings[_0x2c7866[_0x1bb2('0x4')]]);_0xdbe991[_0x1bb2('0x1f')]=_0x3fd010['value'];writeDB(_0xdbe991);});delete recordings[_0x2c7866[_0x1bb2('0x4')]];}}catch(_0xb12ad0){utils[_0x1bb2('0x14')](util[_0x1bb2('0x2')]('[%s][recordings][hangup]',_0x2c7866[_0x1bb2('0x4')]),_0xb12ad0);}};exports[_0x1bb2('0x2f')]=function(_0x56d16d){try{if(!_[_0x1bb2('0x17')](recordings[_0x56d16d[_0x1bb2('0x4')]])){utils[_0x1bb2('0xe')](util['format'](_0x1bb2('0x30'),_0x56d16d[_0x1bb2('0x4')]),_0x56d16d);utils['info'](util[_0x1bb2('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x56d16d[_0x1bb2('0x4')],_0x56d16d['application'],_0x56d16d[_0x1bb2('0x31')]));if(_0x56d16d[_0x1bb2('0x32')]['toLowerCase']()==_0x1bb2('0x33')&&_[_0x1bb2('0x34')](_0x56d16d['appdata'][_0x1bb2('0x35')](),_0x1bb2('0x36'))){var _0x360ed0=_0x56d16d['appdata']['split']('=');var _0x280a97=_0x360ed0[0x0][_0x1bb2('0x37')](_0x360ed0[0x0][_0x1bb2('0x38')]('(')+0x1,_0x360ed0[0x0][_0x1bb2('0x38')](')'));var _0x29ee09=_0x360ed0[0x1];recordings[_0x56d16d['uniqueid']][_0x280a97]=_0x29ee09;}}}catch(_0x579ce9){utils['error'](util[_0x1bb2('0x2')]('[%s][recordings][newexten]',_0x56d16d[_0x1bb2('0x4')]),_0x579ce9);}};exports['queuecallerjoin']=function(_0x15f131){try{if(!_[_0x1bb2('0x17')](recordings[_0x15f131[_0x1bb2('0x4')]])){utils[_0x1bb2('0xe')](util[_0x1bb2('0x2')](_0x1bb2('0x39'),_0x15f131[_0x1bb2('0x4')]),_0x15f131);utils[_0x1bb2('0x1')](util['format'](_0x1bb2('0x3a'),_0x15f131[_0x1bb2('0x4')],_0x15f131[_0x1bb2('0x3b')]));recordings[_0x15f131[_0x1bb2('0x4')]]['queue']=_0x15f131[_0x1bb2('0x3b')];}}catch(_0x2eecbc){utils[_0x1bb2('0x14')](util['format']('[%s][recordings][queuecallerjoin]',_0x15f131[_0x1bb2('0x4')]),_0x2eecbc);}};exports[_0x1bb2('0x3c')]=function(_0x2516dd){try{utils[_0x1bb2('0xe')](util[_0x1bb2('0x2')](_0x1bb2('0x3d'),_0x2516dd['uniqueid']),_0x2516dd);utils[_0x1bb2('0x1')](util[_0x1bb2('0x2')](_0x1bb2('0x3e'),_0x2516dd[_0x1bb2('0x4')],_0x2516dd[_0x1bb2('0x3f')],_0x2516dd['transferercalleridname'],_0x2516dd[_0x1bb2('0x40')],_0x2516dd[_0x1bb2('0x41')]));if(recordings[_0x2516dd[_0x1bb2('0x42')]]&&transfers[_0x1bb2('0x5')][_0x2516dd[_0x1bb2('0x42')]]){transfers[_0x1bb2('0x5')][_0x2516dd['transfereruniqueid']][_0x1bb2('0x43')]=!![];}}catch(_0x1a8e8f){utils[_0x1bb2('0x14')](util['format'](_0x1bb2('0x3d'),_0x2516dd[_0x1bb2('0x4')]),_0x1a8e8f);}}; \ No newline at end of file +var _0x87aa=['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','context','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','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','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten'];(function(_0x34b287,_0x57fa12){var _0x123460=function(_0x540b6c){while(--_0x540b6c){_0x34b287['push'](_0x34b287['shift']());}};_0x123460(++_0x57fa12);}(_0x87aa,0x112));var _0xa87a=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x87aa[_0x39609a];return _0xecd92;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xa87a('0x0'));var transfers=require(_0xa87a('0x1'));var recordings={};function writeDB(_0x54bf8c){var _0x4ab452;utils[_0xa87a('0x2')](util[_0xa87a('0x3')]('[%s][recordings][writeDB]',_0x54bf8c[_0xa87a('0x4')]));if(transfers[_0xa87a('0x5')][_0x54bf8c[_0xa87a('0x4')]]){_0x4ab452=_0x54bf8c[_0xa87a('0x4')];_0x54bf8c[_0xa87a('0x4')]=transfers[_0xa87a('0x5')][_0x54bf8c[_0xa87a('0x4')]][_0xa87a('0x6')];}if(_0x54bf8c[_0xa87a('0x7')]){utils['getUserByInternal'](_0x54bf8c[_0xa87a('0x7')])[_0xa87a('0x8')](function(_0x5be668){if(_0x5be668){_0x54bf8c['membername']=_0x5be668[_0xa87a('0x9')];_0x54bf8c[_0xa87a('0xa')]=_0x5be668['id'];}utils[_0xa87a('0xb')]('CreateVoiceRecording',_0x54bf8c);});}else{utils[_0xa87a('0xb')](_0xa87a('0xc'),_0x54bf8c);}if(_0x4ab452)delete transfers[_0xa87a('0x5')][_0x4ab452];}exports[_0xa87a('0xd')]=function(_0x1cfe85){try{utils[_0xa87a('0xe')](util[_0xa87a('0x3')]('[%s][recordings][newchannel]',_0x1cfe85['uniqueid']),_0x1cfe85);if(_0x1cfe85[_0xa87a('0x4')]==_0x1cfe85[_0xa87a('0xf')]){utils['info'](util[_0xa87a('0x3')](_0xa87a('0x10'),_0x1cfe85['uniqueid'],_0x1cfe85['context'],_0x1cfe85[_0xa87a('0x11')]));recordings[_0x1cfe85[_0xa87a('0x4')]]={'uniqueid':_0x1cfe85[_0xa87a('0x4')],'accountcode':_0x1cfe85[_0xa87a('0x7')],'exten':_0x1cfe85['exten'],'context':_0x1cfe85['context'],'channel':_0x1cfe85[_0xa87a('0x12')],'monitors':[]};}}catch(_0x296665){utils[_0xa87a('0x13')](util[_0xa87a('0x3')]('[%s][recordings][newchannel]',_0x1cfe85['uniqueid']),_0x296665);}};exports[_0xa87a('0x14')]=function(_0x3fa85e){try{utils[_0xa87a('0xe')](util[_0xa87a('0x3')](_0xa87a('0x15'),_0x3fa85e[_0xa87a('0x4')]),_0x3fa85e);if(!_[_0xa87a('0x16')](recordings[_0x3fa85e[_0xa87a('0x4')]])&&_0x3fa85e[_0xa87a('0x17')]==0x6){utils[_0xa87a('0x2')](util[_0xa87a('0x3')](_0xa87a('0x18'),_0x3fa85e[_0xa87a('0x4')],_0x3fa85e['context'],_0x3fa85e[_0xa87a('0x12')]));}else if(!_[_0xa87a('0x16')](recordings[_0x3fa85e['linkedid']])&&_0x3fa85e['channelstate']==0x6&&_0x3fa85e['context']!=_0xa87a('0x19')){utils['info'](util[_0xa87a('0x3')](_0xa87a('0x1a'),_0x3fa85e['uniqueid'],_0x3fa85e[_0xa87a('0xf')],_0x3fa85e[_0xa87a('0x1b')],_0x3fa85e['channel']));recordings[_0x3fa85e[_0xa87a('0xf')]][_0xa87a('0x7')]=_0x3fa85e[_0xa87a('0x7')];}}catch(_0xed378){utils['error'](util[_0xa87a('0x3')]('[%s][recordings][newstate]',_0x3fa85e['uniqueid']),_0xed378);}};exports[_0xa87a('0x1c')]=function(_0x111a15){try{if(!_[_0xa87a('0x16')](_0x111a15[_0xa87a('0x1d')])&&!_[_0xa87a('0x16')](_0x111a15['variable'][_0xa87a('0x1e')])){utils['debug'](util[_0xa87a('0x3')](_0xa87a('0x1f'),_0x111a15[_0xa87a('0x4')]),_0x111a15);utils[_0xa87a('0x2')](util[_0xa87a('0x3')](_0xa87a('0x20'),_0x111a15['uniqueid'],_0x111a15[_0xa87a('0x1d')],_0x111a15[_0xa87a('0x21')]));if(_[_0xa87a('0x22')](_0x111a15[_0xa87a('0x21')],_0xa87a('0x23'))){_0x111a15[_0xa87a('0x21')]=_0x111a15['value'][_0xa87a('0x24')]('.wav49',_0xa87a('0x25'));}if(recordings[_0x111a15[_0xa87a('0xf')]]){var _0xb0265e=_[_0xa87a('0x26')](recordings[_0x111a15[_0xa87a('0xf')]][_0xa87a('0x27')],{'value':_0x111a15[_0xa87a('0x21')]});if(_[_0xa87a('0x16')](_0xb0265e)){recordings[_0x111a15[_0xa87a('0xf')]][_0xa87a('0x27')]['push']({'value':_0x111a15['value']});}}}}catch(_0x37f5a1){utils[_0xa87a('0x13')](util[_0xa87a('0x3')]('[%s][recordings][varset]',_0x111a15[_0xa87a('0x4')]),_0x37f5a1);}};exports['hangup']=function(_0x4d3828){try{if(!_[_0xa87a('0x16')](recordings[_0x4d3828['uniqueid']])){utils[_0xa87a('0xe')](util[_0xa87a('0x3')](_0xa87a('0x28'),_0x4d3828[_0xa87a('0x4')]),_0x4d3828);utils[_0xa87a('0x2')](util[_0xa87a('0x3')](_0xa87a('0x29'),_0x4d3828[_0xa87a('0x4')],_0x4d3828[_0xa87a('0x2a')],_0x4d3828[_0xa87a('0x2b')],_0x4d3828[_0xa87a('0x2c')]));recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2a')]=_0x4d3828[_0xa87a('0x2a')];recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2b')]=_0x4d3828[_0xa87a('0x2b')];recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2d')]=_0x4d3828['connectedlinenum'];recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2e')]=_0x4d3828[_0xa87a('0x2e')];if(recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2f')]==_0xa87a('0x30')&&recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x7')]){recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x2d')]=recordings[_0x4d3828['uniqueid']][_0xa87a('0x7')];recordings[_0x4d3828[_0xa87a('0x4')]]['connectedlinename']='';}recordings[_0x4d3828[_0xa87a('0x4')]][_0xa87a('0x27')][_0xa87a('0x31')](function(_0x4662a8){var _0x144614=_[_0xa87a('0x32')](recordings[_0x4d3828[_0xa87a('0x4')]]);_0x144614[_0xa87a('0x21')]=_0x4662a8[_0xa87a('0x21')];writeDB(_0x144614);});delete recordings[_0x4d3828[_0xa87a('0x4')]];}}catch(_0x48cfa1){utils['error'](util[_0xa87a('0x3')]('[%s][recordings][hangup]',_0x4d3828[_0xa87a('0x4')]),_0x48cfa1);}};exports[_0xa87a('0x33')]=function(_0x21d2d7){try{if(!_[_0xa87a('0x16')](recordings[_0x21d2d7[_0xa87a('0x4')]])){utils[_0xa87a('0xe')](util['format'](_0xa87a('0x34'),_0x21d2d7[_0xa87a('0x4')]),_0x21d2d7);utils[_0xa87a('0x2')](util[_0xa87a('0x3')](_0xa87a('0x35'),_0x21d2d7['uniqueid'],_0x21d2d7[_0xa87a('0x36')],_0x21d2d7['appdata']));if(_0x21d2d7[_0xa87a('0x36')][_0xa87a('0x37')]()==_0xa87a('0x38')&&_[_0xa87a('0x39')](_0x21d2d7[_0xa87a('0x3a')][_0xa87a('0x37')](),_0xa87a('0x3b'))){var _0x66ee30=_0x21d2d7[_0xa87a('0x3a')]['split']('=');var _0x359862=_0x66ee30[0x0][_0xa87a('0x3c')](_0x66ee30[0x0]['lastIndexOf']('(')+0x1,_0x66ee30[0x0][_0xa87a('0x3d')](')'));var _0x3d6fbe=_0x66ee30[0x1];recordings[_0x21d2d7[_0xa87a('0x4')]][_0x359862]=_0x3d6fbe;}}}catch(_0xbb3135){utils[_0xa87a('0x13')](util[_0xa87a('0x3')](_0xa87a('0x34'),_0x21d2d7[_0xa87a('0x4')]),_0xbb3135);}};exports[_0xa87a('0x3e')]=function(_0x5097ad){try{if(!_['isNil'](recordings[_0x5097ad[_0xa87a('0x4')]])){utils[_0xa87a('0xe')](util[_0xa87a('0x3')](_0xa87a('0x3f'),_0x5097ad['uniqueid']),_0x5097ad);utils[_0xa87a('0x2')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x5097ad[_0xa87a('0x4')],_0x5097ad['queue']));recordings[_0x5097ad['uniqueid']]['queue']=_0x5097ad[_0xa87a('0x40')];}}catch(_0x796fe2){utils[_0xa87a('0x13')](util[_0xa87a('0x3')]('[%s][recordings][queuecallerjoin]',_0x5097ad[_0xa87a('0x4')]),_0x796fe2);}};exports[_0xa87a('0x41')]=function(_0xa85f46){try{utils['debug'](util[_0xa87a('0x3')](_0xa87a('0x42'),_0xa85f46['uniqueid']),_0xa85f46);utils[_0xa87a('0x2')](util['format'](_0xa87a('0x43'),_0xa85f46['uniqueid'],_0xa85f46[_0xa87a('0x44')],_0xa85f46[_0xa87a('0x45')],_0xa85f46['transfereecalleridnum'],_0xa85f46[_0xa87a('0x46')]));if(recordings[_0xa85f46[_0xa87a('0x47')]]&&transfers[_0xa87a('0x5')][_0xa85f46[_0xa87a('0x47')]]){transfers[_0xa87a('0x5')][_0xa85f46[_0xa87a('0x47')]][_0xa87a('0x48')]=!![];}}catch(_0xf0b05c){utils[_0xa87a('0x13')](util[_0xa87a('0x3')](_0xa87a('0x42'),_0xa85f46[_0xa87a('0x4')]),_0xf0b05c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3397838..e98f421 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 _0x0ad7=['blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransferercontext','origtransfererexten','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0ad7,0x8c));var _0x70ad=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0ad7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x70ad('0x0'));var util=require(_0x70ad('0x1'));var utils=require(_0x70ad('0x2'));function writeDB(_0x98f0d9){utils[_0x70ad('0x3')](util[_0x70ad('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x98f0d9[_0x70ad('0x5')]===_0x70ad('0x6')?_0x98f0d9[_0x70ad('0x7')]:_0x98f0d9[_0x70ad('0x8')],_0x98f0d9[_0x70ad('0x5')]));utils[_0x70ad('0x9')](_0x70ad('0xa'),_0x98f0d9);}exports[_0x70ad('0xb')]={};exports[_0x70ad('0xc')]=function(_0x513884){try{utils[_0x70ad('0xd')](util[_0x70ad('0x4')](_0x70ad('0xe'),_0x513884['uniqueid']),_0x513884);utils['info'](util['format'](_0x70ad('0xf'),_0x513884[_0x70ad('0x8')],_0x513884[_0x70ad('0x10')],_0x513884[_0x70ad('0x11')],_0x513884[_0x70ad('0x12')],_0x513884['transfereecalleridname']));_0x513884[_0x70ad('0x5')]=_0x70ad('0x13');exports['blinds'][_0x513884[_0x70ad('0x14')]]=_0x513884;writeDB(_0x513884);}catch(_0x453ad1){utils['error'](util[_0x70ad('0x4')](_0x70ad('0xe'),_0x513884[_0x70ad('0x8')]),_0x453ad1);}};exports[_0x70ad('0x15')]=function(_0x4cd157){try{utils['debug'](util[_0x70ad('0x4')]('[%s][transfers][attendedtransfer]',_0x4cd157['origtransfereruniqueid']),_0x4cd157);utils[_0x70ad('0x3')](util[_0x70ad('0x4')](_0x70ad('0x16'),_0x4cd157[_0x70ad('0x7')],_0x4cd157[_0x70ad('0x17')],_0x4cd157[_0x70ad('0x18')],_0x4cd157['transfertargetcalleridnum'],_0x4cd157[_0x70ad('0x19')]));_0x4cd157=_[_0x70ad('0x1a')](_0x4cd157,{'transfererchannel':_0x4cd157[_0x70ad('0x1b')],'transferercalleridnum':_0x4cd157[_0x70ad('0x17')],'transferercalleridname':_0x4cd157[_0x70ad('0x18')],'transfererconnectedlinenum':_0x4cd157['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4cd157[_0x70ad('0x1c')],'transfereraccountcode':_0x4cd157['origtransfereraccountcode'],'transferercontext':_0x4cd157['secondtransferercontext'],'transfererexten':_0x4cd157['secondtransfererexten'],'transfererlinkedid':_0x4cd157['origtransfererlinkedid'],'context':_0x4cd157[_0x70ad('0x1d')],'extension':_0x4cd157[_0x70ad('0x1e')],'type':_0x70ad('0x6')});if(_['isNil'](_0x4cd157[_0x70ad('0x1f')])){_0x4cd157=_[_0x70ad('0x1a')](_0x4cd157,{'transfereechannel':_0x4cd157['transfertargetchannel'],'transfereecalleridnum':_0x4cd157[_0x70ad('0x20')],'transfereecalleridname':_0x4cd157[_0x70ad('0x19')],'transfereeconnectedlinenum':_0x4cd157[_0x70ad('0x21')],'transfereeconnectedlinename':_0x4cd157[_0x70ad('0x22')],'transfereeaccountcode':_0x4cd157[_0x70ad('0x23')],'transfereecontext':_0x4cd157[_0x70ad('0x24')],'transfereeexten':_0x4cd157[_0x70ad('0x25')],'transfereelinkedid':_0x4cd157['transfertargetlinkedid']});}writeDB(_0x4cd157);}catch(_0x444662){utils['error'](util[_0x70ad('0x4')]('[%s][transfers][attendedtransfer]',_0x4cd157[_0x70ad('0x7')]),_0x444662);}}; \ No newline at end of file +var _0x04d6=['origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','error','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x2bd1bc,_0x114511){var _0x2e3cd1=function(_0x266641){while(--_0x266641){_0x2bd1bc['push'](_0x2bd1bc['shift']());}};_0x2e3cd1(++_0x114511);}(_0x04d6,0xb5));var _0x604d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x604d('0x0'));var util=require(_0x604d('0x1'));var utils=require(_0x604d('0x2'));function writeDB(_0x345e41){utils[_0x604d('0x3')](util['format'](_0x604d('0x4'),_0x345e41[_0x604d('0x5')]===_0x604d('0x6')?_0x345e41['origtransfereruniqueid']:_0x345e41['uniqueid'],_0x345e41[_0x604d('0x5')]));utils['request'](_0x604d('0x7'),_0x345e41);}exports[_0x604d('0x8')]={};exports[_0x604d('0x9')]=function(_0x16511b){try{utils[_0x604d('0xa')](util[_0x604d('0xb')](_0x604d('0xc'),_0x16511b[_0x604d('0xd')]),_0x16511b);utils[_0x604d('0x3')](util[_0x604d('0xb')](_0x604d('0xe'),_0x16511b[_0x604d('0xd')],_0x16511b[_0x604d('0xf')],_0x16511b[_0x604d('0x10')],_0x16511b[_0x604d('0x11')],_0x16511b[_0x604d('0x12')]));_0x16511b[_0x604d('0x5')]=_0x604d('0x13');exports[_0x604d('0x8')][_0x16511b[_0x604d('0x14')]]=_0x16511b;writeDB(_0x16511b);}catch(_0x28e983){utils['error'](util[_0x604d('0xb')](_0x604d('0xc'),_0x16511b[_0x604d('0xd')]),_0x28e983);}};exports[_0x604d('0x15')]=function(_0x41c5af){try{utils[_0x604d('0xa')](util[_0x604d('0xb')](_0x604d('0x16'),_0x41c5af[_0x604d('0x17')]),_0x41c5af);utils[_0x604d('0x3')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x41c5af[_0x604d('0x17')],_0x41c5af[_0x604d('0x18')],_0x41c5af[_0x604d('0x19')],_0x41c5af[_0x604d('0x1a')],_0x41c5af[_0x604d('0x1b')]));_0x41c5af=_[_0x604d('0x1c')](_0x41c5af,{'transfererchannel':_0x41c5af['origtransfererchannel'],'transferercalleridnum':_0x41c5af['origtransferercalleridnum'],'transferercalleridname':_0x41c5af['origtransferercalleridname'],'transfererconnectedlinenum':_0x41c5af[_0x604d('0x1d')],'transfererconnectedlinename':_0x41c5af[_0x604d('0x1e')],'transfereraccountcode':_0x41c5af['origtransfereraccountcode'],'transferercontext':_0x41c5af[_0x604d('0x1f')],'transfererexten':_0x41c5af[_0x604d('0x20')],'transfererlinkedid':_0x41c5af[_0x604d('0x21')],'context':_0x41c5af['origtransferercontext'],'extension':_0x41c5af[_0x604d('0x22')],'type':_0x604d('0x6')});if(_[_0x604d('0x23')](_0x41c5af[_0x604d('0x24')])){_0x41c5af=_[_0x604d('0x1c')](_0x41c5af,{'transfereechannel':_0x41c5af[_0x604d('0x25')],'transfereecalleridnum':_0x41c5af[_0x604d('0x1a')],'transfereecalleridname':_0x41c5af[_0x604d('0x1b')],'transfereeconnectedlinenum':_0x41c5af[_0x604d('0x26')],'transfereeconnectedlinename':_0x41c5af[_0x604d('0x27')],'transfereeaccountcode':_0x41c5af[_0x604d('0x28')],'transfereecontext':_0x41c5af['transfertargetcontext'],'transfereeexten':_0x41c5af['transfertargetexten'],'transfereelinkedid':_0x41c5af[_0x604d('0x29')]});}writeDB(_0x41c5af);}catch(_0x533ffd){utils[_0x604d('0x2a')](util[_0x604d('0xb')]('[%s][transfers][attendedtransfer]',_0x41c5af[_0x604d('0x17')]),_0x533ffd);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 4e36510..e81751b 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 _0x0b0a=['http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client'];(function(_0x5f0b6e,_0x440bc3){var _0x48d913=function(_0x1b1952){while(--_0x1b1952){_0x5f0b6e['push'](_0x5f0b6e['shift']());}};_0x48d913(++_0x440bc3);}(_0x0b0a,0x1c7));var _0xa0b0=function(_0x25a951,_0xfc031b){_0x25a951=_0x25a951-0x0;var _0x2b1815=_0x0b0a[_0x25a951];return _0x2b1815;};'use strict';var BPromise=require(_0xa0b0('0x0'));var jayson=require(_0xa0b0('0x1'));var moment=require(_0xa0b0('0x2'));var util=require(_0xa0b0('0x3'));var client=jayson[_0xa0b0('0x4')][_0xa0b0('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xa0b0('0x6'));exports['info']=function(_0x4727b8,_0x27a5d6){logger[_0xa0b0('0x7')](_0x4727b8,_0x27a5d6?util[_0xa0b0('0x8')](_0x27a5d6,{'showHidden':![],'depth':null}):'');};exports[_0xa0b0('0x9')]=function(_0x246b2b,_0x99fd47){logger[_0xa0b0('0x9')](_0x246b2b,_0x99fd47?util['inspect'](_0x99fd47,{'showHidden':![],'depth':null}):'');};exports[_0xa0b0('0xa')]=function(_0x377827,_0x57b100){logger['error'](_0x377827,_0x57b100?util[_0xa0b0('0x8')](_0x57b100,{'showHidden':![],'depth':null}):'');};exports[_0xa0b0('0xb')]=function(_0x368b54,_0x6f80f7){return client[_0xa0b0('0xb')](_0x368b54,{'body':_0x6f80f7})[_0xa0b0('0xc')](function(_0x30b52a){logger[_0xa0b0('0x9')](_0xa0b0('0xd'),_0x368b54,_0x30b52a?util[_0xa0b0('0x8')](_0x30b52a,{'showHidden':![],'depth':null}):'');})[_0xa0b0('0xe')](function(_0x584f04){logger[_0xa0b0('0xa')](_0xa0b0('0xd'),_0x368b54,_0x584f04?util[_0xa0b0('0x8')](_0x584f04,{'showHidden':![],'depth':null}):'');});};function getUser(_0x22c15f){return client[_0xa0b0('0xb')](_0xa0b0('0xf'),{'options':{'raw':!![],'attributes':['id',_0xa0b0('0x10'),_0xa0b0('0x11'),_0xa0b0('0x12')],'where':_0x22c15f,'limit':0x1}})['then'](function(_0x5b45a3){logger[_0xa0b0('0x9')]('[utils][getUser]\x20where:%s',JSON[_0xa0b0('0x13')](_0x22c15f),_0x5b45a3?util['inspect'](_0x5b45a3,{'showHidden':![],'depth':null}):'');return _0x5b45a3[_0xa0b0('0x14')][_0xa0b0('0x15')]?_0x5b45a3['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x214292){return new BPromise(function(_0x31afc0,_0x349c0b){if(_0x214292){return getUser({'internal':_0x214292})[_0xa0b0('0xc')](function(_0x17f76c){logger[_0xa0b0('0x7')](_0xa0b0('0x16'),_0x214292,_0x17f76c?_0xa0b0('0x17'):_0xa0b0('0x18'));return _0x31afc0(_0x17f76c);})[_0xa0b0('0xe')](function(_0x159413){logger['error'](_0xa0b0('0x19'),_0x159413?util[_0xa0b0('0x8')](_0x159413,{'showHidden':![],'depth':null}):'');return _0x31afc0(null);});}return _0x31afc0(null);});};exports['getUserByInterface']=function(_0x4d9219){return new BPromise(function(_0x2f7eb0,_0x508d55){if(_0x4d9219){return getUser({'interface':_0x4d9219})[_0xa0b0('0xc')](function(_0x211fc3){logger[_0xa0b0('0x7')](_0xa0b0('0x1a'),_0x4d9219,_0x211fc3?_0xa0b0('0x17'):_0xa0b0('0x18'));return _0x2f7eb0(_0x211fc3);})[_0xa0b0('0xe')](function(_0x1011c9){logger[_0xa0b0('0xa')](_0xa0b0('0x1b'),_0x1011c9?util[_0xa0b0('0x8')](_0x1011c9,{'showHidden':![],'depth':null}):'');return _0x2f7eb0(null);});}return _0x2f7eb0(null);});};exports[_0xa0b0('0x1c')]=function(_0x449555){return new BPromise(function(_0x852ec7,_0x440343){if(_0x449555){return getUser({'name':_0x449555})[_0xa0b0('0xc')](function(_0x19c902){logger['info'](_0xa0b0('0x1d'),_0x449555,_0x19c902?_0xa0b0('0x17'):'notfound');return _0x852ec7(_0x19c902);})['catch'](function(_0x2f2402){logger['error'](_0xa0b0('0x1e'),_0x2f2402?util[_0xa0b0('0x8')](_0x2f2402,{'showHidden':![],'depth':null}):'');return _0x852ec7(null);});}return _0x852ec7(null);});};exports[_0xa0b0('0x1f')]=function(_0x1d3b74){return new BPromise(function(_0x1fa01e,_0x27e027){if(_0x1d3b74){return client[_0xa0b0('0xb')](_0xa0b0('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0xa0b0('0x21'),'acw',_0xa0b0('0x22')],'where':{'name':_0x1d3b74},'limit':0x1}})[_0xa0b0('0xc')](function(_0x43c8e8){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x1d3b74,_0x43c8e8?util['inspect'](_0x43c8e8,{'showHidden':![],'depth':null}):'');logger[_0xa0b0('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1d3b74,_0x43c8e8?_0xa0b0('0x17'):_0xa0b0('0x18'));return _0x1fa01e(_0x43c8e8[_0xa0b0('0x14')][_0xa0b0('0x15')]?_0x43c8e8[_0xa0b0('0x14')][0x0]:null);})['catch'](function(_0x3de493){logger[_0xa0b0('0xa')](_0xa0b0('0x23'),_0x3de493?util[_0xa0b0('0x8')](_0x3de493,{'showHidden':![],'depth':null}):'');return _0x1fa01e(null);});}return _0x1fa01e(null);});};exports['addTime']=function(_0x26038d,_0x4a3a61){return moment(_0x26038d)[_0xa0b0('0x24')](_0x4a3a61,_0xa0b0('0x25'))[_0xa0b0('0x26')](_0xa0b0('0x27'));};exports[_0xa0b0('0x28')]=function(_0x201efa,_0x1d9c13){return moment(_0x201efa)[_0xa0b0('0x29')](_0x1d9c13,_0xa0b0('0x25'))[_0xa0b0('0x26')](_0xa0b0('0x27'));};exports[_0xa0b0('0x2a')]=function(_0x5156f1,_0xc4125f){return moment(_0x5156f1)['diff'](moment(_0xc4125f),'seconds');};exports[_0xa0b0('0x2b')]=function(_0x505650,_0x20f283){return parseInt(_0x505650,0xa)+parseInt(_0x20f283,0xa);};exports['now']=function(){return moment()['format'](_0xa0b0('0x27'));};exports[_0xa0b0('0x2c')]=function(_0x5e1f29,_0x1acb72){if(_0x1acb72){return moment(_0x5e1f29)[_0xa0b0('0x2c')](_0x1acb72);}return!![];};exports[_0xa0b0('0x2d')]=function(_0x413e9e,_0x4407ca){if(_0x4407ca){return moment(_0x413e9e)[_0xa0b0('0x2d')](_0x4407ca);}else if(_0x413e9e){return!![];}return![];}; \ No newline at end of file +var _0x6bf6=['name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','subtract','diff','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','internal'];(function(_0x339430,_0x14ad6a){var _0x528291=function(_0x5b9e30){while(--_0x5b9e30){_0x339430['push'](_0x339430['shift']());}};_0x528291(++_0x14ad6a);}(_0x6bf6,0x11c));var _0x66bf=function(_0x6ff984,_0x52fbd1){_0x6ff984=_0x6ff984-0x0;var _0x1b8400=_0x6bf6[_0x6ff984];return _0x1b8400;};'use strict';var BPromise=require(_0x66bf('0x0'));var jayson=require(_0x66bf('0x1'));var moment=require(_0x66bf('0x2'));var util=require('util');var client=jayson[_0x66bf('0x3')][_0x66bf('0x4')]({'port':0x2329});var logger=require(_0x66bf('0x5'))(_0x66bf('0x6'));exports['info']=function(_0x5877f8,_0x4dd1e0){logger[_0x66bf('0x7')](_0x5877f8,_0x4dd1e0?util[_0x66bf('0x8')](_0x4dd1e0,{'showHidden':![],'depth':null}):'');};exports[_0x66bf('0x9')]=function(_0x1550cb,_0x2fe224){logger[_0x66bf('0x9')](_0x1550cb,_0x2fe224?util[_0x66bf('0x8')](_0x2fe224,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1bc41c,_0x54d8c6){logger[_0x66bf('0xa')](_0x1bc41c,_0x54d8c6?util['inspect'](_0x54d8c6,{'showHidden':![],'depth':null}):'');};exports[_0x66bf('0xb')]=function(_0x2b477a,_0xcefdef){return client[_0x66bf('0xb')](_0x2b477a,{'body':_0xcefdef})['then'](function(_0x57f504){logger[_0x66bf('0x9')](_0x66bf('0xc'),_0x2b477a,_0x57f504?util['inspect'](_0x57f504,{'showHidden':![],'depth':null}):'');})[_0x66bf('0xd')](function(_0x4b5315){logger[_0x66bf('0xa')]('[utils][request]\x20name:%s',_0x2b477a,_0x4b5315?util[_0x66bf('0x8')](_0x4b5315,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e27dc){return client[_0x66bf('0xb')](_0x66bf('0xe'),{'options':{'raw':!![],'attributes':['id',_0x66bf('0xf'),_0x66bf('0x10'),_0x66bf('0x11')],'where':_0x3e27dc,'limit':0x1}})[_0x66bf('0x12')](function(_0x92ccdc){logger[_0x66bf('0x9')](_0x66bf('0x13'),JSON[_0x66bf('0x14')](_0x3e27dc),_0x92ccdc?util[_0x66bf('0x8')](_0x92ccdc,{'showHidden':![],'depth':null}):'');return _0x92ccdc[_0x66bf('0x15')][_0x66bf('0x16')]?_0x92ccdc['result'][0x0]:null;});}exports[_0x66bf('0x17')]=function(_0x184908){return new BPromise(function(_0x29c141,_0x2230c4){if(_0x184908){return getUser({'internal':_0x184908})['then'](function(_0x24e4da){logger[_0x66bf('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x184908,_0x24e4da?_0x66bf('0x18'):_0x66bf('0x19'));return _0x29c141(_0x24e4da);})[_0x66bf('0xd')](function(_0x5390bd){logger[_0x66bf('0xa')](_0x66bf('0x1a'),_0x5390bd?util[_0x66bf('0x8')](_0x5390bd,{'showHidden':![],'depth':null}):'');return _0x29c141(null);});}return _0x29c141(null);});};exports[_0x66bf('0x1b')]=function(_0x231aea){return new BPromise(function(_0x2cb1ed,_0x3ef0e5){if(_0x231aea){return getUser({'interface':_0x231aea})['then'](function(_0x5cad1c){logger[_0x66bf('0x7')](_0x66bf('0x1c'),_0x231aea,_0x5cad1c?_0x66bf('0x18'):'notfound');return _0x2cb1ed(_0x5cad1c);})[_0x66bf('0xd')](function(_0x43a7f4){logger[_0x66bf('0xa')](_0x66bf('0x1d'),_0x43a7f4?util[_0x66bf('0x8')](_0x43a7f4,{'showHidden':![],'depth':null}):'');return _0x2cb1ed(null);});}return _0x2cb1ed(null);});};exports[_0x66bf('0x1e')]=function(_0x38ecd0){return new BPromise(function(_0x363ed1,_0x3495f0){if(_0x38ecd0){return getUser({'name':_0x38ecd0})[_0x66bf('0x12')](function(_0x59e2ab){logger['info'](_0x66bf('0x1f'),_0x38ecd0,_0x59e2ab?_0x66bf('0x18'):'notfound');return _0x363ed1(_0x59e2ab);})[_0x66bf('0xd')](function(_0xc5b75f){logger[_0x66bf('0xa')](_0x66bf('0x20'),_0xc5b75f?util[_0x66bf('0x8')](_0xc5b75f,{'showHidden':![],'depth':null}):'');return _0x363ed1(null);});}return _0x363ed1(null);});};exports[_0x66bf('0x21')]=function(_0x2232ff){return new BPromise(function(_0x56464e,_0x1e7dfa){if(_0x2232ff){return client[_0x66bf('0xb')](_0x66bf('0x22'),{'options':{'raw':!![],'attributes':['id',_0x66bf('0x10'),_0x66bf('0x23'),_0x66bf('0x24'),_0x66bf('0x25')],'where':{'name':_0x2232ff},'limit':0x1}})[_0x66bf('0x12')](function(_0x27acc7){logger[_0x66bf('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x2232ff,_0x27acc7?util[_0x66bf('0x8')](_0x27acc7,{'showHidden':![],'depth':null}):'');logger[_0x66bf('0x7')](_0x66bf('0x26'),_0x2232ff,_0x27acc7?_0x66bf('0x18'):_0x66bf('0x19'));return _0x56464e(_0x27acc7[_0x66bf('0x15')][_0x66bf('0x16')]?_0x27acc7[_0x66bf('0x15')][0x0]:null);})['catch'](function(_0x19dad3){logger[_0x66bf('0xa')](_0x66bf('0x27'),_0x19dad3?util[_0x66bf('0x8')](_0x19dad3,{'showHidden':![],'depth':null}):'');return _0x56464e(null);});}return _0x56464e(null);});};exports[_0x66bf('0x28')]=function(_0xca4ea2,_0x28e0ff){return moment(_0xca4ea2)[_0x66bf('0x29')](_0x28e0ff,_0x66bf('0x2a'))[_0x66bf('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x66bf('0x2c')]=function(_0x4aecbb,_0x533e48){return moment(_0x4aecbb)[_0x66bf('0x2d')](_0x533e48,_0x66bf('0x2a'))[_0x66bf('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x18a4a9,_0x251d65){return moment(_0x18a4a9)[_0x66bf('0x2e')](moment(_0x251d65),'seconds');};exports['sumTime']=function(_0xb889fc,_0x40399a){return parseInt(_0xb889fc,0xa)+parseInt(_0x40399a,0xa);};exports['now']=function(){return moment()[_0x66bf('0x2b')](_0x66bf('0x2f'));};exports[_0x66bf('0x30')]=function(_0x3f973e,_0x3b74dc){if(_0x3b74dc){return moment(_0x3f973e)['isAfter'](_0x3b74dc);}return!![];};exports[_0x66bf('0x31')]=function(_0x301fa8,_0x10708c){if(_0x10708c){return moment(_0x301fa8)['isBefore'](_0x10708c);}else if(_0x301fa8){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 4788fbb..38fe0c9 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 _0x9589=['maskSensitiveData','join','/var','xcally','client','role','name','ensureDir','then','catch','log','user','no-user','data','error','api','auth','set','client-side-logger','use','logger','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','device','other','agent_name','test','fs-extra','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data'];(function(_0x2270e0,_0x551309){var _0x1521b1=function(_0x2c5439){while(--_0x2c5439){_0x2270e0['push'](_0x2270e0['shift']());}};_0x1521b1(++_0x551309);}(_0x9589,0x1b0));var _0x9958=function(_0x2986ae,_0x3f4bcb){_0x2986ae=_0x2986ae-0x0;var _0x5b52ca=_0x9589[_0x2986ae];return _0x5b52ca;};var fs=require(_0x9958('0x0'));var _=require(_0x9958('0x1'));var ewinston=require(_0x9958('0x2'));var path=require(_0x9958('0x3'));var util=require(_0x9958('0x4'));var fileLogger=require(_0x9958('0x5'))[_0x9958('0x6')];var safeTemplate=require(_0x9958('0x7'))['safeTemplate'];var maskSensitiveData=require(_0x9958('0x8'))[_0x9958('0x9')];function ClientSideLogger(){function _0x11c831(_0x12a9e9){var _0x5cbc1e=path[_0x9958('0xa')](_0x9958('0xb'),'log',_0x9958('0xc'));var _0x5e7df4=path[_0x9958('0xa')](_0x9958('0xd'),_0x12a9e9[_0x9958('0xe')]+'-'+_0x12a9e9[_0x9958('0xf')]);return fs[_0x9958('0x10')](path['join'](_0x5cbc1e,_0x5e7df4))[_0x9958('0x11')](function(){var _0xa19ac3=fileLogger('client',path[_0x9958('0xa')](_0x5cbc1e,_0x5e7df4));return _0xa19ac3;})[_0x9958('0x12')](function(_0x52f129){throw _0x52f129;});}this[_0x9958('0x13')]=function(_0x3a25bf,_0x32e5d4,_0x2e2bf3,_0x14ec6c){return _0x11c831(_0x3a25bf[_0x9958('0x14')])['then'](function(_0x4ddb48){var _0x3db8f8=_0x4ddb48[_0x32e5d4];return _0x3db8f8;})['then'](function(_0x1d0d77){var _0x67acc2=_0x3a25bf[_0x9958('0x14')]?_0x3a25bf['user']['id']:_0x9958('0x15');var _0x1b8923=_0x14ec6c[_0x9958('0x16')];var _0x1b995b=_0x14ec6c['timestamp'];var _0x4d1a71=new Date(Number(_0x1b995b));return _0x1d0d77(_0x67acc2,_0x4d1a71,_0x2e2bf3,_0x1b8923);})[_0x9958('0x12')](function(_0x53ae6b){fileLogger(_0x9958('0xd'))[_0x9958('0x17')](_0x53ae6b);});};}function setupLoggers(_0x4f1fc2){return new Promise(function(_0x472de7){var _0x284f63=new ClientSideLogger();var _0x2de686=fileLogger(_0x9958('0x18'));var _0x1115cb=fileLogger(_0x9958('0x19'));_0x4f1fc2[_0x9958('0x1a')](_0x9958('0x1b'),_0x284f63);_0x4f1fc2[_0x9958('0x1c')](ewinston[_0x9958('0x1d')]({'winstonInstance':_0x2de686,'meta':![],'statusLevels':!![],'msg':function(_0x5ceab0,_0xcb7c19){var _0x17df03='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9958('0x1e')](_0x5ceab0['body'])){_0x17df03+=_0x9958('0x1f');var _0xc5a1d4=_0x5ceab0[_0x9958('0x20')];maskSensitiveData(_0xc5a1d4);}return safeTemplate(util[_0x9958('0x21')](_0x17df03,_0x5ceab0[_0x9958('0x22')],_0x5ceab0[_0x9958('0x23')][_0x9958('0x24')]?_0x5ceab0[_0x9958('0x23')][_0x9958('0x24')]:_0x5ceab0[_0x9958('0x25')][_0x9958('0x26')]||_0x5ceab0['ip'],_0x5ceab0[_0x9958('0x27')],_0xcb7c19[_0x9958('0x28')],_0xcb7c19['responseTime'],_0x5ceab0['user']?_0x5ceab0['user']['id']:null,_0x5ceab0[_0x9958('0x14')]?_0x5ceab0['user'][_0x9958('0xf')]:null,_0x5ceab0[_0x9958('0x14')]?_0x5ceab0[_0x9958('0x14')][_0x9958('0xe')]:null,_0xc5a1d4?util[_0x9958('0x29')](_0xc5a1d4,![],null):''));}}));_0x4f1fc2[_0x9958('0x1c')](ewinston[_0x9958('0x1d')]({'winstonInstance':_0x1115cb,'meta':![],'statusLevels':!![],'msg':function(_0x24ce7f,_0x133f3f){var _0x8054c1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x24ce7f[_0x9958('0x20')]&&_0x24ce7f['body']['device']&&_0x24ce7f['body'][_0x9958('0x2a')]){_0x8054c1=_0x9958('0x2b');}return util[_0x9958('0x21')](_0x8054c1,_0x24ce7f[_0x9958('0x22')],_0x24ce7f['headers']['x-forwarded-for']?_0x24ce7f[_0x9958('0x23')][_0x9958('0x24')]:_0x24ce7f[_0x9958('0x25')][_0x9958('0x26')]||_0x24ce7f['ip'],_0x24ce7f[_0x9958('0x27')],_0x133f3f[_0x9958('0x28')],_0x133f3f[_0x9958('0x2c')],_0x24ce7f[_0x9958('0x14')]?_0x24ce7f['user']['id']:null,_0x24ce7f['user']?_0x24ce7f[_0x9958('0x14')]['name']:null,_0x24ce7f[_0x9958('0x14')]?_0x24ce7f['user'][_0x9958('0xe')]:null,_0x24ce7f[_0x9958('0x20')]&&_0x24ce7f['body'][_0x9958('0x2d')]?_0x24ce7f['body'][_0x9958('0x2d')]:_0x9958('0x2e'),_0x24ce7f[_0x9958('0x20')]&&_0x24ce7f['body'][_0x9958('0x2a')]?_0x24ce7f['body'][_0x9958('0x2a')]:'',_0x24ce7f[_0x9958('0x20')]&&_0x24ce7f['body'][_0x9958('0x2f')]?_0x24ce7f[_0x9958('0x20')][_0x9958('0x2f')]:'');},'ignoreRoute':function(_0x599eea){var _0x500849=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x500849[_0x9958('0x30')](_0x599eea[_0x9958('0x27')]);}}));return _0x472de7();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x73d4=['use','isEmpty','body','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_name','test','fs-extra','lodash','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','role','name','ensureDir','catch','then','user','no-user','error','api','auth','set','client-side-logger'];(function(_0x2bb66b,_0x9f5a79){var _0x412a46=function(_0x2c36ef){while(--_0x2c36ef){_0x2bb66b['push'](_0x2bb66b['shift']());}};_0x412a46(++_0x9f5a79);}(_0x73d4,0x11c));var _0x473d=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x73d4[_0x40927b];return _0x2635e8;};var fs=require(_0x473d('0x0'));var _=require(_0x473d('0x1'));var ewinston=require('express-winston');var path=require(_0x473d('0x2'));var util=require('util');var fileLogger=require(_0x473d('0x3'))[_0x473d('0x4')];var safeTemplate=require(_0x473d('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x473d('0x6'))[_0x473d('0x7')];function ClientSideLogger(){function _0x30dffd(_0x3efabd){var _0x3bcdeb=path[_0x473d('0x8')]('/var',_0x473d('0x9'),_0x473d('0xa'));var _0x26249f=path[_0x473d('0x8')](_0x473d('0xb'),_0x3efabd[_0x473d('0xc')]+'-'+_0x3efabd[_0x473d('0xd')]);return fs[_0x473d('0xe')](path[_0x473d('0x8')](_0x3bcdeb,_0x26249f))['then'](function(){var _0x228d30=fileLogger(_0x473d('0xb'),path[_0x473d('0x8')](_0x3bcdeb,_0x26249f));return _0x228d30;})[_0x473d('0xf')](function(_0xf5f035){throw _0xf5f035;});}this[_0x473d('0x9')]=function(_0x4e8440,_0x296378,_0x592678,_0x5b079c){return _0x30dffd(_0x4e8440['user'])[_0x473d('0x10')](function(_0x4408e8){var _0x42d1c4=_0x4408e8[_0x296378];return _0x42d1c4;})[_0x473d('0x10')](function(_0x4f0f39){var _0x38df69=_0x4e8440[_0x473d('0x11')]?_0x4e8440[_0x473d('0x11')]['id']:_0x473d('0x12');var _0x199abd=_0x5b079c['data'];var _0x44b136=_0x5b079c['timestamp'];var _0x4730f6=new Date(Number(_0x44b136));return _0x4f0f39(_0x38df69,_0x4730f6,_0x592678,_0x199abd);})[_0x473d('0xf')](function(_0x37a590){fileLogger(_0x473d('0xb'))[_0x473d('0x13')](_0x37a590);});};}function setupLoggers(_0x104d47){return new Promise(function(_0x15ccc3){var _0x255ddd=new ClientSideLogger();var _0x89f2f6=fileLogger(_0x473d('0x14'));var _0xe3c115=fileLogger(_0x473d('0x15'));_0x104d47[_0x473d('0x16')](_0x473d('0x17'),_0x255ddd);_0x104d47[_0x473d('0x18')](ewinston['logger']({'winstonInstance':_0x89f2f6,'meta':![],'statusLevels':!![],'msg':function(_0x522396,_0x3ecf46){var _0x4d0737='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x473d('0x19')](_0x522396[_0x473d('0x1a')])){_0x4d0737+='\x20body=%s';var _0x1d83d4=_0x522396['body'];maskSensitiveData(_0x1d83d4);}return safeTemplate(util[_0x473d('0x1b')](_0x4d0737,_0x522396[_0x473d('0x1c')],_0x522396['headers']['x-forwarded-for']?_0x522396[_0x473d('0x1d')][_0x473d('0x1e')]:_0x522396[_0x473d('0x1f')]['remoteAddress']||_0x522396['ip'],_0x522396[_0x473d('0x20')],_0x3ecf46[_0x473d('0x21')],_0x3ecf46[_0x473d('0x22')],_0x522396[_0x473d('0x11')]?_0x522396[_0x473d('0x11')]['id']:null,_0x522396['user']?_0x522396['user'][_0x473d('0xd')]:null,_0x522396['user']?_0x522396[_0x473d('0x11')]['role']:null,_0x1d83d4?util['inspect'](_0x1d83d4,![],null):''));}}));_0x104d47[_0x473d('0x18')](ewinston[_0x473d('0x23')]({'winstonInstance':_0xe3c115,'meta':![],'statusLevels':!![],'msg':function(_0x1b035d,_0x3011f5){var _0x472d3e=_0x473d('0x24');if(_0x1b035d[_0x473d('0x1a')]&&_0x1b035d['body'][_0x473d('0x25')]&&_0x1b035d[_0x473d('0x1a')][_0x473d('0x26')]){_0x472d3e=_0x473d('0x27');}return util[_0x473d('0x1b')](_0x472d3e,_0x1b035d[_0x473d('0x1c')],_0x1b035d[_0x473d('0x1d')][_0x473d('0x1e')]?_0x1b035d['headers'][_0x473d('0x1e')]:_0x1b035d[_0x473d('0x1f')][_0x473d('0x28')]||_0x1b035d['ip'],_0x1b035d[_0x473d('0x20')],_0x3011f5[_0x473d('0x21')],_0x3011f5[_0x473d('0x22')],_0x1b035d[_0x473d('0x11')]?_0x1b035d['user']['id']:null,_0x1b035d[_0x473d('0x11')]?_0x1b035d['user'][_0x473d('0xd')]:null,_0x1b035d[_0x473d('0x11')]?_0x1b035d[_0x473d('0x11')]['role']:null,_0x1b035d[_0x473d('0x1a')]&&_0x1b035d[_0x473d('0x1a')]['device']?_0x1b035d[_0x473d('0x1a')][_0x473d('0x25')]:_0x473d('0x29'),_0x1b035d[_0x473d('0x1a')]&&_0x1b035d['body']['agent_id']?_0x1b035d[_0x473d('0x1a')][_0x473d('0x26')]:'',_0x1b035d[_0x473d('0x1a')]&&_0x1b035d['body'][_0x473d('0x2a')]?_0x1b035d[_0x473d('0x1a')][_0x473d('0x2a')]:'');},'ignoreRoute':function(_0x59762b){var _0x1056e8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1056e8[_0x473d('0x2b')](_0x59762b[_0x473d('0x20')]);}}));return _0x15ccc3();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 5c4783c..50d0635 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb1a=['consoleLogger','fileLogger','path','util','moment','winston','../config/environment','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','format','%s-%s.log','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','length','stringify','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','%s-%s','error','warn'];(function(_0x2fe299,_0x2e1408){var _0x3e7659=function(_0x399706){while(--_0x399706){_0x2fe299['push'](_0x2fe299['shift']());}};_0x3e7659(++_0x2e1408);}(_0xbb1a,0x105));var _0xabb1=function(_0x45edad,_0x623046){_0x45edad=_0x45edad-0x0;var _0x20a540=_0xbb1a[_0x45edad];return _0x20a540;};'use strict';var path=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var moment=require(_0xabb1('0x2'));var winston=require(_0xabb1('0x3'));var config=require(_0xabb1('0x4'));var debugLevel=config['debugLevel']?config['debugLevel'][_0xabb1('0x5')]():_0xabb1('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xabb1('0x7'),'warn':_0xabb1('0x8'),'info':_0xabb1('0x9'),'print':_0xabb1('0xa'),'success':'bold\x20green','http':_0xabb1('0xb'),'verbose':'bold\x20magenta','debug':_0xabb1('0xc'),'silly':_0xabb1('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3d5f99,_0x4c2e27,_0x24faba){var _0x383a2c=_0x3d5f99||_0xabb1('0xe');return path['join'](_0x383a2c,util[_0xabb1('0xf')](_0xabb1('0x10'),_0x4c2e27,_0x24faba));}function formatter(_0x32e144,_0x9aace4){_0x9aace4['message']=_0x9aace4['message'][_0xabb1('0x11')](/@@{/g,_0xabb1('0x12'))[_0xabb1('0x11')](/}@@/g,_0xabb1('0x13'))[_0xabb1('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xabb1('0xf')](_0xabb1('0x14')),_0x9aace4[_0xabb1('0x15')][_0xabb1('0x16')](),_0x32e144,_0x9aace4['message']);}function fileFormat(_0x43ab1c,_0x318c18){_0x318c18[_0xabb1('0x17')]=_0x318c18[_0xabb1('0x17')]['replace'](/@@{/g,'{{{')[_0xabb1('0x11')](/}@@/g,'}}}')[_0xabb1('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x53e880=_0x318c18['meta']&&Object['keys'](_0x318c18['meta'])[_0xabb1('0x18')]?'\x0a\x09'+JSON[_0xabb1('0x19')](_0x318c18[_0xabb1('0x1a')]):'';return util['format'](_0xabb1('0x1b'),moment()[_0xabb1('0xf')](_0xabb1('0x14')),_0x318c18[_0xabb1('0x15')][_0xabb1('0x16')](),_0x43ab1c,_0x318c18[_0xabb1('0x17')],_0x53e880);}function consoleLogger(){var _0x3e0bed=new winston[(_0xabb1('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xabb1('0x1d'))][(_0xabb1('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x18b299){return formatter('',_0x18b299);}})]});return _0x3e0bed;}function fileLogger(_0x1f7868,_0x1c78c2){var _0x2576c4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xabb1('0x1f'))]({'name':util[_0xabb1('0xf')](_0xabb1('0x20'),_0x1f7868,'error'),'filename':getLogFileName(_0x1c78c2,_0x1f7868,_0xabb1('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f0b0d){return fileFormat(_0x1f7868,_0x1f0b0d);}}),new winston[(_0xabb1('0x1d'))][(_0xabb1('0x1f'))]({'name':util[_0xabb1('0xf')]('%s-%s',_0x1f7868,debugLevel),'filename':getLogFileName(_0x1c78c2,_0x1f7868,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x259f80){return fileFormat(_0x1f7868,_0x259f80);}}),new winston[(_0xabb1('0x1d'))]['Console']({'level':_0xabb1('0x22'),'json':![],'formatter':function(_0x2d84cf){return fileFormat(_0x1f7868,_0x2d84cf);}})]});return _0x2576c4;}exports[_0xabb1('0x23')]=consoleLogger;exports[_0xabb1('0x24')]=fileLogger; \ No newline at end of file +var _0x6206=['../config/environment','debugLevel','info','redBG\x20white','white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{','}}}','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','File','%s-%s','error','Console','warn','consoleLogger','fileLogger','moment','winston'];(function(_0x40671d,_0x97f1b9){var _0x46db0e=function(_0x2fdb45){while(--_0x2fdb45){_0x40671d['push'](_0x40671d['shift']());}};_0x46db0e(++_0x97f1b9);}(_0x6206,0x15c));var _0x6620=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6206[_0x40a045];return _0x1a687c;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x6620('0x0'));var winston=require(_0x6620('0x1'));var config=require(_0x6620('0x2'));var debugLevel=config[_0x6620('0x3')]?config[_0x6620('0x3')]['toLowerCase']():_0x6620('0x4');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':_0x6620('0x5'),'error':'red','warn':'bold\x20yellow','info':_0x6620('0x6'),'print':'bold\x20white','success':_0x6620('0x7'),'http':'gray','verbose':_0x6620('0x8'),'debug':_0x6620('0x9'),'silly':_0x6620('0xa')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x15dc55,_0x2c6387,_0x574071){var _0x34f30b=_0x15dc55||_0x6620('0xb');return path[_0x6620('0xc')](_0x34f30b,util[_0x6620('0xd')](_0x6620('0xe'),_0x2c6387,_0x574071));}function formatter(_0x1849ac,_0x3b5f68){_0x3b5f68[_0x6620('0xf')]=_0x3b5f68[_0x6620('0xf')][_0x6620('0x10')](/@@{/g,'{{{')[_0x6620('0x10')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x6620('0x10')](/}@/g,'}}');return util[_0x6620('0xd')](_0x6620('0x11'),moment()[_0x6620('0xd')](_0x6620('0x12')),_0x3b5f68[_0x6620('0x13')]['toUpperCase'](),_0x1849ac,_0x3b5f68[_0x6620('0xf')]);}function fileFormat(_0x1e1e1f,_0x598757){_0x598757[_0x6620('0xf')]=_0x598757[_0x6620('0xf')][_0x6620('0x10')](/@@{/g,_0x6620('0x14'))[_0x6620('0x10')](/}@@/g,_0x6620('0x15'))[_0x6620('0x10')](/@{/g,'{{')[_0x6620('0x10')](/}@/g,'}}');var _0x1e4036=_0x598757[_0x6620('0x16')]&&Object[_0x6620('0x17')](_0x598757[_0x6620('0x16')])[_0x6620('0x18')]?'\x0a\x09'+JSON['stringify'](_0x598757['meta']):'';return util['format'](_0x6620('0x19'),moment()[_0x6620('0xd')](_0x6620('0x12')),_0x598757[_0x6620('0x13')]['toUpperCase'](),_0x1e1e1f,_0x598757[_0x6620('0xf')],_0x1e4036);}function consoleLogger(){var _0x49e120=new winston[(_0x6620('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0x5e6773){return formatter('',_0x5e6773);}})]});return _0x49e120;}function fileLogger(_0x250e1c,_0x243ddb){var _0x5ce897=new winston[(_0x6620('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6620('0x1b'))][(_0x6620('0x1c'))]({'name':util[_0x6620('0xd')](_0x6620('0x1d'),_0x250e1c,_0x6620('0x1e')),'filename':getLogFileName(_0x243ddb,_0x250e1c,_0x6620('0x1e')),'level':_0x6620('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35c488){return fileFormat(_0x250e1c,_0x35c488);}}),new winston[(_0x6620('0x1b'))][(_0x6620('0x1c'))]({'name':util[_0x6620('0xd')](_0x6620('0x1d'),_0x250e1c,debugLevel),'filename':getLogFileName(_0x243ddb,_0x250e1c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8a2dc3){return fileFormat(_0x250e1c,_0x8a2dc3);}}),new winston[(_0x6620('0x1b'))][(_0x6620('0x1f'))]({'level':_0x6620('0x20'),'json':![],'formatter':function(_0x15ac68){return fileFormat(_0x250e1c,_0x15ac68);}})]});return _0x5ce897;}exports[_0x6620('0x21')]=consoleLogger;exports[_0x6620('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index d2497e1..151235a 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 _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(_0x1ad805,_0x2dcf2d){var _0x366d90=function(_0x2fa8bd){while(--_0x2fa8bd){_0x1ad805['push'](_0x1ad805['shift']());}};_0x366d90(++_0x2dcf2d);}(_0xadb5,0xad));var _0x5adb=function(_0x4c68d7,_0x1456da){_0x4c68d7=_0x4c68d7-0x0;var _0x3b4beb=_0xadb5[_0x4c68d7];return _0x3b4beb;};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 +var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x210e8c,_0x16855f){var _0x10d2e7=function(_0x1b006e){while(--_0x1b006e){_0x210e8c['push'](_0x210e8c['shift']());}};_0x10d2e7(++_0x16855f);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa6914a,_0x49a74f){_0xa6914a=_0xa6914a-0x0;var _0x41eb01=_0x5f2f[_0xa6914a];return _0x41eb01;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 33e5032..2684a07 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 _0x9354=['map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0x2f089b,_0x1d3f3c){var _0xd5b5a0=function(_0x568970){while(--_0x568970){_0x2f089b['push'](_0x2f089b['shift']());}};_0xd5b5a0(++_0x1d3f3c);}(_0x9354,0x96));var _0x4935=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x9354[_0x35e92e];return _0x1205a8;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42d9d9){return _0x42d9d9==='{{'?_0x4935('0x0'):'\x20}\x20}';}function safeTemplate(_0x263dd5){var _0x2a4993=_0x263dd5;if(typeof _0x263dd5===_0x4935('0x1')){_0x2a4993=_0x263dd5[_0x4935('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x263dd5)){_0x2a4993=_0x263dd5[_0x4935('0x3')](function(_0x2d509b){return safeTemplate(_0x2d509b);});}else if(_[_0x4935('0x4')](_0x263dd5)){_0x2a4993=Object[_0x4935('0x5')](_0x263dd5)[_0x4935('0x6')](function(_0x2e47bd,_0x118d36){_0x2e47bd[_0x118d36]=safeTemplate(_0x263dd5[_0x118d36]);return _0x2e47bd;},{});}return _0x2a4993;}module[_0x4935('0x7')][_0x4935('0x8')]=safeTemplate; \ No newline at end of file +var _0x087b=['exports','safeTemplate','lodash','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x4f2a44,_0x5b1e87){var _0x35d8c9=function(_0x52ba1c){while(--_0x52ba1c){_0x4f2a44['push'](_0x4f2a44['shift']());}};_0x35d8c9(++_0x5b1e87);}(_0x087b,0x11a));var _0xb087=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x087b[_0x5f3f88];return _0xd08119;};var _=require(_0xb087('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x35e3d3){return _0x35e3d3==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x40e6d6){var _0x5aa7a8=_0x40e6d6;if(typeof _0x40e6d6===_0xb087('0x1')){_0x5aa7a8=_0x40e6d6[_0xb087('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xb087('0x3')](_0x40e6d6)){_0x5aa7a8=_0x40e6d6[_0xb087('0x4')](function(_0x183efd){return safeTemplate(_0x183efd);});}else if(_[_0xb087('0x5')](_0x40e6d6)){_0x5aa7a8=Object[_0xb087('0x6')](_0x40e6d6)[_0xb087('0x7')](function(_0xecf080,_0x36ac30){_0xecf080[_0x36ac30]=safeTemplate(_0x40e6d6[_0x36ac30]);return _0xecf080;},{});}return _0x5aa7a8;}module[_0xb087('0x8')][_0xb087('0x9')]=safeTemplate; \ No newline at end of file